From: Andrea Amorese Date: Wed, 6 Oct 2021 08:30:35 +0000 (+0200) Subject: Built motion from commit 8dfab3cb.|2.5.36 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22thisimagedoesnotexist.png/%22javascript:;//%22%7B%7Blicense.fax?a=commitdiff_plain;h=352d7b631b5cd4d75828439a259798185664fb6c;p=motion2.git Built motion from commit 8dfab3cb.|2.5.36 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index ef78356..54146b1 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-10-06T07:58:02.866Z", + "time": "2021-10-06T08:18:01.574Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 60bc957..fda2d50 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-10-06T07:58:02.866Z", + "time": "2021-10-06T08:18:01.574Z", "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 a227031..e94bb4d 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 _0x061b=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','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)]'];(function(_0x115ac5,_0x24271a){var _0x2c13e6=function(_0x1c6641){while(--_0x1c6641){_0x115ac5['push'](_0x115ac5['shift']());}};_0x2c13e6(++_0x24271a);}(_0x061b,0x6f));var _0xb061=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x061b[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require(_0xb061('0x0'));module[_0xb061('0x1')]={'name':{'type':Sequelize[_0xb061('0x2')],'get':function(_0x5f0f0f){return this[_0xb061('0x3')](_0xb061('0x4'));}},'action':{'type':Sequelize[_0xb061('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb061('0x6'),_0xb061('0x7'),'motionbar',_0xb061('0x8'),_0xb061('0x9'),_0xb061('0xa'),_0xb061('0xb'),'script']],'msg':_0xb061('0xc')}},'comment':_0xb061('0xc')},'data1':{'type':Sequelize[_0xb061('0x5')](0x1000),'comment':'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)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xb061('0xd')},'data3':{'type':Sequelize[_0xb061('0x5')](0x1000),'comment':_0xb061('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xb061('0xf')},'data5':{'type':Sequelize[_0xb061('0x5')](0x1000),'comments':_0xb061('0x10')},'data6':{'type':Sequelize[_0xb061('0x5')],'comments':_0xb061('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x826e=['STRING','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','exports','VIRTUAL','getDataValue','action','motionbar','jscripty','urlForward','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x354bb1,_0x13c981){var _0x359351=function(_0x457226){while(--_0x457226){_0x354bb1['push'](_0x354bb1['shift']());}};_0x359351(++_0x13c981);}(_0x826e,0x163));var _0xe826=function(_0x1bb33e,_0x26a28f){_0x1bb33e=_0x1bb33e-0x0;var _0x3077e0=_0x826e[_0x1bb33e];return _0x3077e0;};'use strict';var Sequelize=require('sequelize');module[_0xe826('0x0')]={'name':{'type':Sequelize[_0xe826('0x1')],'get':function(_0x26b60c){return this[_0xe826('0x2')](_0xe826('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0xe826('0x4'),_0xe826('0x5'),_0xe826('0x6'),_0xe826('0x7'),'bot','script']],'msg':_0xe826('0x8')}},'comment':_0xe826('0x8')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'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)]'},'data2':{'type':Sequelize[_0xe826('0x9')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xe826('0x9')](0x1000),'comment':_0xe826('0xa')},'data4':{'type':Sequelize[_0xe826('0x9')](0x1000),'comments':_0xe826('0xb')},'data5':{'type':Sequelize[_0xe826('0x9')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xe826('0x9')],'comments':_0xe826('0xc')},'data7':{'type':Sequelize[_0xe826('0xd')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 3d4058e..7a7a8e2 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 _0xdca6=['offset','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','body','find','catch','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined'];(function(_0x1a288e,_0x805d1d){var _0x593b72=function(_0x22d1ed){while(--_0x22d1ed){_0x1a288e['push'](_0x1a288e['shift']());}};_0x593b72(++_0x805d1d);}(_0xdca6,0xe2));var _0x6dca=function(_0x4504f5,_0x17b74d){_0x4504f5=_0x4504f5-0x0;var _0x57d974=_0xdca6[_0x4504f5];return _0x57d974;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6dca('0x0'));var zipdir=require(_0x6dca('0x1'));var jsonpatch=require(_0x6dca('0x2'));var rp=require(_0x6dca('0x3'));var moment=require(_0x6dca('0x4'));var BPromise=require(_0x6dca('0x5'));var Mustache=require(_0x6dca('0x6'));var util=require(_0x6dca('0x7'));var path=require(_0x6dca('0x8'));var sox=require(_0x6dca('0x9'));var csv=require(_0x6dca('0xa'));var ejs=require(_0x6dca('0xb'));var fs=require('fs');var fs_extra=require(_0x6dca('0xc'));var _=require(_0x6dca('0xd'));var squel=require('squel');var crypto=require(_0x6dca('0xe'));var jsforce=require(_0x6dca('0xf'));var deskjs=require(_0x6dca('0x10'));var toCsv=require(_0x6dca('0xa'));var querystring=require(_0x6dca('0x11'));var Papa=require(_0x6dca('0x12'));var Redis=require(_0x6dca('0x13'));var authService=require(_0x6dca('0x14'));var qs=require(_0x6dca('0x15'));var as=require(_0x6dca('0x16'));var hardwareService=require(_0x6dca('0x17'));var logger=require(_0x6dca('0x18'))(_0x6dca('0x19'));var utils=require(_0x6dca('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x6dca('0x1b'));var db=require(_0x6dca('0x1c'))['db'];function respondWithStatusCode(_0xe75101,_0x431a15){_0x431a15=_0x431a15||0xcc;return function(_0x559ed1){if(_0x559ed1){return _0xe75101[_0x6dca('0x1d')](_0x431a15);}return _0xe75101[_0x6dca('0x1e')](_0x431a15)['end']();};}function respondWithResult(_0xc60ca3,_0x1a1558){_0x1a1558=_0x1a1558||0xc8;return function(_0x3e288b){if(_0x3e288b){return _0xc60ca3[_0x6dca('0x1e')](_0x1a1558)[_0x6dca('0x1f')](_0x3e288b);}};}function respondWithFilteredResult(_0x38c666,_0x366272){return function(_0x152bdc){if(_0x152bdc){var _0x361c96=typeof _0x366272['offset']==='undefined'&&typeof _0x366272[_0x6dca('0x20')]===_0x6dca('0x21');var _0x3e28b9=_0x152bdc['count'];var _0x2d399b=_0x361c96?0x0:_0x366272[_0x6dca('0x22')];var _0x22571f=_0x361c96?_0x152bdc[_0x6dca('0x23')]:_0x366272['offset']+_0x366272[_0x6dca('0x20')];var _0x83b482;if(_0x22571f>=_0x3e28b9){_0x22571f=_0x3e28b9;_0x83b482=0xc8;}else{_0x83b482=0xce;}_0x38c666[_0x6dca('0x1e')](_0x83b482);return _0x38c666[_0x6dca('0x24')](_0x6dca('0x25'),_0x2d399b+'-'+_0x22571f+'/'+_0x3e28b9)['json'](_0x152bdc);}return null;};}function patchUpdates(_0x4b72e4){return function(_0x12ccc5){try{jsonpatch[_0x6dca('0x26')](_0x12ccc5,_0x4b72e4,!![]);}catch(_0xd489e3){return BPromise[_0x6dca('0x27')](_0xd489e3);}return _0x12ccc5['save']();};}function saveUpdates(_0x19a8c8,_0x125b3f){return function(_0x15b792){if(_0x15b792){return _0x15b792[_0x6dca('0x28')](_0x19a8c8)[_0x6dca('0x29')](function(_0x72c83c){return _0x72c83c;});}return null;};}function removeEntity(_0x5aec07,_0x3b154f){return function(_0x262c0e){if(_0x262c0e){return _0x262c0e[_0x6dca('0x2a')]()['then'](function(){_0x5aec07[_0x6dca('0x1e')](0xcc)[_0x6dca('0x2b')]();});}};}function handleEntityNotFound(_0x23ea9b,_0x422e72){return function(_0x153fd9){if(!_0x153fd9){_0x23ea9b[_0x6dca('0x1d')](0x194);}return _0x153fd9;};}function handleError(_0x3329f6,_0x20db8c){_0x20db8c=_0x20db8c||0x1f4;return function(_0x15bc36){logger[_0x6dca('0x2c')](_0x15bc36[_0x6dca('0x2d')]);if(_0x15bc36[_0x6dca('0x2e')]){delete _0x15bc36['name'];}_0x3329f6['status'](_0x20db8c)[_0x6dca('0x2f')](_0x15bc36);};}exports[_0x6dca('0x28')]=function(_0x4c048e,_0x58123a){if(_0x4c048e['body']['id']){delete _0x4c048e[_0x6dca('0x30')]['id'];}return db['Action'][_0x6dca('0x31')]({'where':{'id':_0x4c048e['params']['id']}})['then'](handleEntityNotFound(_0x58123a,null))[_0x6dca('0x29')](saveUpdates(_0x4c048e[_0x6dca('0x30')],null))['then'](respondWithResult(_0x58123a,null))[_0x6dca('0x32')](handleError(_0x58123a,null));};exports[_0x6dca('0x2a')]=function(_0x245d53,_0x4f4e6d){return db['Action'][_0x6dca('0x31')]({'where':{'id':_0x245d53[_0x6dca('0x33')]['id']}})[_0x6dca('0x29')](handleEntityNotFound(_0x4f4e6d,null))[_0x6dca('0x29')](removeEntity(_0x4f4e6d,null))['catch'](handleError(_0x4f4e6d,null));}; \ No newline at end of file +var _0xdc8a=['params','catch','find','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','set','apply','reject','save','then','destroy','sendStatus','error','name','send','update','body','Action'];(function(_0x4c4042,_0x3967e4){var _0x4bb9d1=function(_0xac1371){while(--_0xac1371){_0x4c4042['push'](_0x4c4042['shift']());}};_0x4bb9d1(++_0x3967e4);}(_0xdc8a,0xe4));var _0xadc8=function(_0x1dd415,_0x1b38bb){_0x1dd415=_0x1dd415-0x0;var _0x3855cf=_0xdc8a[_0x1dd415];return _0x3855cf;};'use strict';var emlformat=require(_0xadc8('0x0'));var rimraf=require(_0xadc8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xadc8('0x2'));var rp=require(_0xadc8('0x3'));var moment=require(_0xadc8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xadc8('0x5'));var path=require(_0xadc8('0x6'));var sox=require('sox');var csv=require(_0xadc8('0x7'));var ejs=require(_0xadc8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xadc8('0x9'));var squel=require(_0xadc8('0xa'));var crypto=require(_0xadc8('0xb'));var jsforce=require(_0xadc8('0xc'));var deskjs=require(_0xadc8('0xd'));var toCsv=require('to-csv');var querystring=require(_0xadc8('0xe'));var Papa=require('papaparse');var Redis=require(_0xadc8('0xf'));var authService=require(_0xadc8('0x10'));var qs=require(_0xadc8('0x11'));var as=require(_0xadc8('0x12'));var hardwareService=require(_0xadc8('0x13'));var logger=require('../../config/logger')(_0xadc8('0x14'));var utils=require(_0xadc8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xadc8('0x16'))['db'];function respondWithStatusCode(_0x492c13,_0x547b84){_0x547b84=_0x547b84||0xcc;return function(_0xec8b1b){if(_0xec8b1b){return _0x492c13['sendStatus'](_0x547b84);}return _0x492c13[_0xadc8('0x17')](_0x547b84)[_0xadc8('0x18')]();};}function respondWithResult(_0x443d80,_0x564189){_0x564189=_0x564189||0xc8;return function(_0x3168c1){if(_0x3168c1){return _0x443d80[_0xadc8('0x17')](_0x564189)[_0xadc8('0x19')](_0x3168c1);}};}function respondWithFilteredResult(_0x4fc719,_0x4195fe){return function(_0x27562b){if(_0x27562b){var _0x3d1daf=typeof _0x4195fe[_0xadc8('0x1a')]===_0xadc8('0x1b')&&typeof _0x4195fe['limit']===_0xadc8('0x1b');var _0x4bc18e=_0x27562b['count'];var _0x1ba344=_0x3d1daf?0x0:_0x4195fe[_0xadc8('0x1a')];var _0x3357c9=_0x3d1daf?_0x27562b['count']:_0x4195fe['offset']+_0x4195fe[_0xadc8('0x1c')];var _0x59a6ff;if(_0x3357c9>=_0x4bc18e){_0x3357c9=_0x4bc18e;_0x59a6ff=0xc8;}else{_0x59a6ff=0xce;}_0x4fc719['status'](_0x59a6ff);return _0x4fc719[_0xadc8('0x1d')]('Content-Range',_0x1ba344+'-'+_0x3357c9+'/'+_0x4bc18e)[_0xadc8('0x19')](_0x27562b);}return null;};}function patchUpdates(_0x429998){return function(_0x57bf22){try{jsonpatch[_0xadc8('0x1e')](_0x57bf22,_0x429998,!![]);}catch(_0x92cf28){return BPromise[_0xadc8('0x1f')](_0x92cf28);}return _0x57bf22[_0xadc8('0x20')]();};}function saveUpdates(_0x33649f,_0xac0a0b){return function(_0x4d74d5){if(_0x4d74d5){return _0x4d74d5['update'](_0x33649f)[_0xadc8('0x21')](function(_0x58d4ad){return _0x58d4ad;});}return null;};}function removeEntity(_0x79b3dd,_0x51cf46){return function(_0x3a98ce){if(_0x3a98ce){return _0x3a98ce[_0xadc8('0x22')]()[_0xadc8('0x21')](function(){_0x79b3dd[_0xadc8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x354eff,_0x4ddffd){return function(_0x1699fe){if(!_0x1699fe){_0x354eff[_0xadc8('0x23')](0x194);}return _0x1699fe;};}function handleError(_0x42b5a2,_0x3fb88c){_0x3fb88c=_0x3fb88c||0x1f4;return function(_0x42d274){logger[_0xadc8('0x24')](_0x42d274['stack']);if(_0x42d274['name']){delete _0x42d274[_0xadc8('0x25')];}_0x42b5a2[_0xadc8('0x17')](_0x3fb88c)[_0xadc8('0x26')](_0x42d274);};}exports[_0xadc8('0x27')]=function(_0x32b2c9,_0xff286){if(_0x32b2c9[_0xadc8('0x28')]['id']){delete _0x32b2c9[_0xadc8('0x28')]['id'];}return db[_0xadc8('0x29')]['find']({'where':{'id':_0x32b2c9[_0xadc8('0x2a')]['id']}})[_0xadc8('0x21')](handleEntityNotFound(_0xff286,null))[_0xadc8('0x21')](saveUpdates(_0x32b2c9[_0xadc8('0x28')],null))[_0xadc8('0x21')](respondWithResult(_0xff286,null))[_0xadc8('0x2b')](handleError(_0xff286,null));};exports[_0xadc8('0x22')]=function(_0x4f9f35,_0xa3b27d){return db[_0xadc8('0x29')][_0xadc8('0x2c')]({'where':{'id':_0x4f9f35[_0xadc8('0x2a')]['id']}})[_0xadc8('0x21')](handleEntityNotFound(_0xa3b27d,null))['then'](removeEntity(_0xa3b27d,null))[_0xadc8('0x2b')](handleError(_0xa3b27d,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index aab3e44..2530671 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 _0x6edb=['path','rimraf','exports','Action','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x388280,_0xeef89){var _0x51122b=function(_0x250e3e){while(--_0x250e3e){_0x388280['push'](_0x388280['shift']());}};_0x51122b(++_0xeef89);}(_0x6edb,0x122));var _0xb6ed=function(_0x20e06e,_0x15a44a){_0x20e06e=_0x20e06e-0x0;var _0x2b2387=_0x6edb[_0x20e06e];return _0x2b2387;};'use strict';var _=require(_0xb6ed('0x0'));var util=require(_0xb6ed('0x1'));var logger=require(_0xb6ed('0x2'))(_0xb6ed('0x3'));var moment=require(_0xb6ed('0x4'));var BPromise=require(_0xb6ed('0x5'));var rp=require(_0xb6ed('0x6'));var fs=require('fs');var path=require(_0xb6ed('0x7'));var rimraf=require(_0xb6ed('0x8'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0xb6ed('0x9')]=function(_0x4e8df3,_0x2ee27e){return _0x4e8df3['define'](_0xb6ed('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5100=['moment','bluebird','path','../../config/environment','./action.attributes','tools_actions','lodash','util','../../config/logger','api'];(function(_0x5e0565,_0x507a73){var _0x118380=function(_0xf99a56){while(--_0xf99a56){_0x5e0565['push'](_0x5e0565['shift']());}};_0x118380(++_0x507a73);}(_0x5100,0x132));var _0x0510=function(_0x4d3d46,_0x35282a){_0x4d3d46=_0x4d3d46-0x0;var _0x4b76d4=_0x5100[_0x4d3d46];return _0x4b76d4;};'use strict';var _=require(_0x0510('0x0'));var util=require(_0x0510('0x1'));var logger=require(_0x0510('0x2'))(_0x0510('0x3'));var moment=require(_0x0510('0x4'));var BPromise=require(_0x0510('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0510('0x6'));var rimraf=require('rimraf');var config=require(_0x0510('0x7'));var attributes=require(_0x0510('0x8'));module['exports']=function(_0x314bfe,_0x187274){return _0x314bfe['define']('Action',attributes,{'tableName':_0x0510('0x9'),'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 bc05f80..fed51a8 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 _0x7a54=['info','Action,\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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x43a9d8,_0x680a91){_0x43a9d8=_0x43a9d8-0x0;var _0x13f25c=_0x7a54[_0x43a9d8];return _0x13f25c;};'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')]('Action,\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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4975,0x86));var _0x5497=function(_0x2b0474,_0x2565b9){_0x2b0474=_0x2b0474-0x0;var _0x1c8326=_0x4975[_0x2b0474];return _0x1c8326;};'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')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 62f6ef0..b405b38 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 _0xe2fb=['./action.controller','/:id','isAuthenticated','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2fb,0x138));var _0xbe2f=function(_0x51221b,_0x17aaa1){_0x51221b=_0x51221b-0x0;var _0xc2dc3=_0xe2fb[_0x51221b];return _0xc2dc3;};'use strict';var multer=require(_0xbe2f('0x0'));var util=require(_0xbe2f('0x1'));var path=require(_0xbe2f('0x2'));var timeout=require(_0xbe2f('0x3'));var express=require(_0xbe2f('0x4'));var router=express[_0xbe2f('0x5')]();var fs_extra=require(_0xbe2f('0x6'));var auth=require(_0xbe2f('0x7'));var interaction=require(_0xbe2f('0x8'));var config=require(_0xbe2f('0x9'));var controller=require(_0xbe2f('0xa'));router['put'](_0xbe2f('0xb'),auth[_0xbe2f('0xc')](),controller['update']);router[_0xbe2f('0xd')](_0xbe2f('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x207a=['util','connect-timeout','express','fs-extra','../../components/interaction/service','./action.controller','put','/:id','delete','isAuthenticated','exports','multer'];(function(_0x5a86fa,_0x13c0e9){var _0x2b0c5f=function(_0x57f874){while(--_0x57f874){_0x5a86fa['push'](_0x5a86fa['shift']());}};_0x2b0c5f(++_0x13c0e9);}(_0x207a,0x83));var _0xa207=function(_0xb6015f,_0x2e3fd8){_0xb6015f=_0xb6015f-0x0;var _0x48407e=_0x207a[_0xb6015f];return _0x48407e;};'use strict';var multer=require(_0xa207('0x0'));var util=require(_0xa207('0x1'));var path=require('path');var timeout=require(_0xa207('0x2'));var express=require(_0xa207('0x3'));var router=express['Router']();var fs_extra=require(_0xa207('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa207('0x5'));var config=require('../../config/environment');var controller=require(_0xa207('0x6'));router[_0xa207('0x7')](_0xa207('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xa207('0x9')]('/:id',auth[_0xa207('0xa')](),controller['destroy']);module[_0xa207('0xb')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index ca72cdc..f62a56a 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 _0x2675=['sequelize','STRING','TEXT'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x2675,0x75));var _0x5267=function(_0x4aecbd,_0xc8830c){_0x4aecbd=_0x4aecbd-0x0;var _0x49073c=_0x2675[_0x4aecbd];return _0x49073c;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}}; \ No newline at end of file +var _0x2bd8=['TEXT','sequelize','STRING'];(function(_0x47f2c5,_0x40c84b){var _0x38b405=function(_0x22c2aa){while(--_0x22c2aa){_0x47f2c5['push'](_0x47f2c5['shift']());}};_0x38b405(++_0x40c84b);}(_0x2bd8,0x130));var _0x82bd=function(_0x460b1f,_0x494b84){_0x460b1f=_0x460b1f-0x0;var _0x9e09d0=_0x2bd8[_0x460b1f];return _0x9e09d0;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x82bd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x82bd('0x1')]},'parent':{'type':Sequelize[_0x82bd('0x1')]},'table':{'type':Sequelize[_0x82bd('0x1')]},'conditions':{'type':Sequelize[_0x82bd('0x2')]},'joins':{'type':Sequelize[_0x82bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 80409be..e495e43 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 _0x00b8=['offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','CustomReports','UserProfileResource','destroy','stack','name','send','index','map','AnalyticCustomReport','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','error','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','from','DESC','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json'];(function(_0x14ef5b,_0x3f052a){var _0xba5a6f=function(_0x476e47){while(--_0x476e47){_0x14ef5b['push'](_0x14ef5b['shift']());}};_0xba5a6f(++_0x3f052a);}(_0x00b8,0x1e0));var _0x800b=function(_0x2a53f3,_0x5a4ab7){_0x2a53f3=_0x2a53f3-0x0;var _0xc62c3=_0x00b8[_0x2a53f3];return _0xc62c3;};'use strict';var emlformat=require(_0x800b('0x0'));var rimraf=require(_0x800b('0x1'));var zipdir=require(_0x800b('0x2'));var jsonpatch=require(_0x800b('0x3'));var rp=require(_0x800b('0x4'));var moment=require(_0x800b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x800b('0x6'));var util=require('util');var path=require(_0x800b('0x7'));var sox=require(_0x800b('0x8'));var csv=require(_0x800b('0x9'));var ejs=require(_0x800b('0xa'));var fs=require('fs');var fs_extra=require(_0x800b('0xb'));var _=require(_0x800b('0xc'));var squel=require(_0x800b('0xd'));var crypto=require(_0x800b('0xe'));var jsforce=require(_0x800b('0xf'));var deskjs=require(_0x800b('0x10'));var toCsv=require(_0x800b('0x9'));var querystring=require(_0x800b('0x11'));var Papa=require(_0x800b('0x12'));var Redis=require('ioredis');var authService=require(_0x800b('0x13'));var qs=require(_0x800b('0x14'));var as=require(_0x800b('0x15'));var hardwareService=require(_0x800b('0x16'));var logger=require('../../config/logger')(_0x800b('0x17'));var utils=require(_0x800b('0x18'));var config=require(_0x800b('0x19'));var licenseUtil=require(_0x800b('0x1a'));var db=require(_0x800b('0x1b'))['db'];var dbH=require(_0x800b('0x1b'))[_0x800b('0x1c')];function respondWithStatusCode(_0x1512e8,_0x1d7520){_0x1d7520=_0x1d7520||0xcc;return function(_0x1e6964){if(_0x1e6964){return _0x1512e8[_0x800b('0x1d')](_0x1d7520);}return _0x1512e8[_0x800b('0x1e')](_0x1d7520)[_0x800b('0x1f')]();};}function respondWithResult(_0x1c4546,_0x413957){_0x413957=_0x413957||0xc8;return function(_0x59d454){if(_0x59d454){return _0x1c4546[_0x800b('0x1e')](_0x413957)[_0x800b('0x20')](_0x59d454);}};}function respondWithFilteredResult(_0x564d27,_0x43249b){return function(_0x116e00){if(_0x116e00){var _0x3794f7=typeof _0x43249b[_0x800b('0x21')]===_0x800b('0x22')&&typeof _0x43249b[_0x800b('0x23')]===_0x800b('0x22');var _0x50e857=_0x116e00[_0x800b('0x24')];var _0x117680=_0x3794f7?0x0:_0x43249b['offset'];var _0x327c71=_0x3794f7?_0x116e00[_0x800b('0x24')]:_0x43249b[_0x800b('0x21')]+_0x43249b[_0x800b('0x23')];var _0x4c23ce;if(_0x327c71>=_0x50e857){_0x327c71=_0x50e857;_0x4c23ce=0xc8;}else{_0x4c23ce=0xce;}_0x564d27[_0x800b('0x1e')](_0x4c23ce);return _0x564d27[_0x800b('0x25')](_0x800b('0x26'),_0x117680+'-'+_0x327c71+'/'+_0x50e857)[_0x800b('0x20')](_0x116e00);}return null;};}function patchUpdates(_0x5f37d7){return function(_0x5e476e){try{jsonpatch['apply'](_0x5e476e,_0x5f37d7,!![]);}catch(_0x78dbff){return BPromise[_0x800b('0x27')](_0x78dbff);}return _0x5e476e[_0x800b('0x28')]();};}function saveUpdates(_0x4611e5,_0x1d1bd7){return function(_0x279dd9){if(_0x279dd9){return _0x279dd9[_0x800b('0x29')](_0x4611e5)[_0x800b('0x2a')](function(_0x338d64){return _0x338d64;});}return null;};}function removeEntity(_0xcde909,_0x2713f4){return function(_0x252c96){if(_0x252c96){return _0x252c96['destroy']()[_0x800b('0x2a')](function(){var _0x52d4cd=_0x252c96[_0x800b('0x2b')]({'plain':!![]});var _0x59ea97=_0x800b('0x2c');return db[_0x800b('0x2d')][_0x800b('0x2e')]({'where':{'type':_0x59ea97,'resourceId':_0x52d4cd['id']}})['then'](function(){return _0x252c96;});})[_0x800b('0x2a')](function(){_0xcde909[_0x800b('0x1e')](0xcc)[_0x800b('0x1f')]();});}};}function handleEntityNotFound(_0x26e23b,_0x42a678){return function(_0x447b2e){if(!_0x447b2e){_0x26e23b[_0x800b('0x1d')](0x194);}return _0x447b2e;};}function handleError(_0x57b7f2,_0x4ad806){_0x4ad806=_0x4ad806||0x1f4;return function(_0x5dcd20){logger['error'](_0x5dcd20[_0x800b('0x2f')]);if(_0x5dcd20[_0x800b('0x30')]){delete _0x5dcd20['name'];}_0x57b7f2['status'](_0x4ad806)[_0x800b('0x31')](_0x5dcd20);};}exports[_0x800b('0x32')]=function(_0x12f52,_0x1cad56){var _0x1a57bd={},_0x1072c2={},_0x4af766={'count':0x0,'rows':[]};var _0x4c7d55=_[_0x800b('0x33')](db[_0x800b('0x34')]['rawAttributes'],function(_0x1563c3){return{'name':_0x1563c3['fieldName'],'type':_0x1563c3['type'][_0x800b('0x35')]};});_0x1072c2[_0x800b('0x36')]=_[_0x800b('0x33')](_0x4c7d55,_0x800b('0x30'));_0x1072c2[_0x800b('0x37')]=_['keys'](_0x12f52[_0x800b('0x37')]);_0x1072c2[_0x800b('0x38')]=_[_0x800b('0x39')](_0x1072c2[_0x800b('0x36')],_0x1072c2[_0x800b('0x37')]);_0x1a57bd[_0x800b('0x3a')]=_[_0x800b('0x39')](_0x1072c2[_0x800b('0x36')],qs[_0x800b('0x3b')](_0x12f52[_0x800b('0x37')]['fields']));_0x1a57bd['attributes']=_0x1a57bd['attributes'][_0x800b('0x3c')]?_0x1a57bd[_0x800b('0x3a')]:_0x1072c2[_0x800b('0x36')];if(!_0x12f52[_0x800b('0x37')]['hasOwnProperty'](_0x800b('0x3d'))){_0x1a57bd['limit']=qs[_0x800b('0x23')](_0x12f52[_0x800b('0x37')][_0x800b('0x23')]);_0x1a57bd[_0x800b('0x21')]=qs['offset'](_0x12f52[_0x800b('0x37')][_0x800b('0x21')]);}_0x1a57bd['order']=qs[_0x800b('0x3e')](_0x12f52[_0x800b('0x37')]['sort']);_0x1a57bd[_0x800b('0x3f')]=qs[_0x800b('0x38')](_[_0x800b('0x40')](_0x12f52[_0x800b('0x37')],_0x1072c2[_0x800b('0x38')]),_0x4c7d55);if(_0x12f52['query'][_0x800b('0x41')]){_0x1a57bd[_0x800b('0x3f')]=_[_0x800b('0x42')](_0x1a57bd[_0x800b('0x3f')],{'$or':_['map'](_0x4c7d55,function(_0x165042){if(_0x165042[_0x800b('0x43')]!==_0x800b('0x44')){var _0x5751cb={};_0x5751cb[_0x165042[_0x800b('0x30')]]={'$like':'%'+_0x12f52[_0x800b('0x37')][_0x800b('0x41')]+'%'};return _0x5751cb;}})});}_0x1a57bd=_[_0x800b('0x42')]({},_0x1a57bd,_0x12f52[_0x800b('0x45')]);var _0x205248={'where':_0x1a57bd['where']};return db[_0x800b('0x34')]['count'](_0x205248)['then'](function(_0x2dbd1d){_0x4af766[_0x800b('0x24')]=_0x2dbd1d;if(_0x12f52[_0x800b('0x37')][_0x800b('0x46')]){_0x1a57bd[_0x800b('0x47')]=[{'all':!![]}];}return db[_0x800b('0x34')][_0x800b('0x48')](_0x1a57bd);})['then'](function(_0x19e6f1){_0x4af766[_0x800b('0x49')]=_0x19e6f1;return _0x4af766;})[_0x800b('0x2a')](respondWithFilteredResult(_0x1cad56,_0x1a57bd))[_0x800b('0x4a')](handleError(_0x1cad56,null));};exports[_0x800b('0x4b')]=function(_0x2bf0a7,_0x9ebefd){var _0x1274f3={'raw':![],'where':{'id':_0x2bf0a7[_0x800b('0x4c')]['id']}},_0x217fdc={};_0x217fdc[_0x800b('0x36')]=_[_0x800b('0x4d')](db['AnalyticCustomReport'][_0x800b('0x4e')]);_0x217fdc[_0x800b('0x37')]=_[_0x800b('0x4d')](_0x2bf0a7['query']);_0x217fdc['filters']=_[_0x800b('0x39')](_0x217fdc[_0x800b('0x36')],_0x217fdc['query']);_0x1274f3[_0x800b('0x3a')]=_[_0x800b('0x39')](_0x217fdc['model'],qs[_0x800b('0x3b')](_0x2bf0a7[_0x800b('0x37')]['fields']));_0x1274f3['attributes']=_0x1274f3[_0x800b('0x3a')]['length']?_0x1274f3['attributes']:_0x217fdc[_0x800b('0x36')];if(_0x2bf0a7[_0x800b('0x37')][_0x800b('0x46')]){_0x1274f3[_0x800b('0x47')]=[{'all':!![]}];}_0x1274f3=_['merge']({},_0x1274f3,_0x2bf0a7['options']);return db[_0x800b('0x34')][_0x800b('0x4f')](_0x1274f3)[_0x800b('0x2a')](handleEntityNotFound(_0x9ebefd,null))[_0x800b('0x2a')](respondWithResult(_0x9ebefd,null))[_0x800b('0x4a')](handleError(_0x9ebefd,null));};exports[_0x800b('0x50')]=function(_0x3c85e3,_0x14b414){return db['AnalyticCustomReport']['create'](_0x3c85e3['body'],{})['then'](function(_0x5c7de1){var _0x71bdec=_0x3c85e3[_0x800b('0x51')][_0x800b('0x2b')]({'plain':!![]});if(!_0x71bdec)throw new Error(_0x800b('0x52'));if(_0x71bdec[_0x800b('0x53')]===_0x800b('0x51')){var _0x2935ab=_0x5c7de1[_0x800b('0x2b')]({'plain':!![]});var _0x22e149=_0x800b('0x54');return db['UserProfileSection'][_0x800b('0x4f')]({'where':{'name':_0x22e149,'userProfileId':_0x71bdec[_0x800b('0x55')]},'raw':!![]})[_0x800b('0x2a')](function(_0x492810){if(_0x492810&&_0x492810[_0x800b('0x56')]===0x0){return db[_0x800b('0x2d')][_0x800b('0x50')]({'name':_0x2935ab[_0x800b('0x30')],'resourceId':_0x2935ab['id'],'type':'CustomReports','sectionId':_0x492810['id']},{})['then'](function(){return _0x5c7de1;});}else{return _0x5c7de1;}})['catch'](function(_0x47ed1f){logger[_0x800b('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47ed1f);throw _0x47ed1f;});}return _0x5c7de1;})['then'](respondWithResult(_0x14b414,0xc9))[_0x800b('0x4a')](handleError(_0x14b414,null));};exports['update']=function(_0x291f0b,_0x316869){if(_0x291f0b[_0x800b('0x58')]['id']){delete _0x291f0b['body']['id'];}return db['AnalyticCustomReport'][_0x800b('0x4f')]({'where':{'id':_0x291f0b['params']['id']}})[_0x800b('0x2a')](handleEntityNotFound(_0x316869,null))[_0x800b('0x2a')](saveUpdates(_0x291f0b[_0x800b('0x58')],null))['then'](respondWithResult(_0x316869,null))[_0x800b('0x4a')](handleError(_0x316869,null));};exports['destroy']=function(_0x56ca50,_0x363f5f){return db['AnalyticCustomReport'][_0x800b('0x4f')]({'where':{'id':_0x56ca50['params']['id']}})[_0x800b('0x2a')](handleEntityNotFound(_0x363f5f,null))[_0x800b('0x2a')](removeEntity(_0x363f5f,null))[_0x800b('0x4a')](handleError(_0x363f5f,null));};exports[_0x800b('0x59')]=function(_0x15ce4b,_0x45dd38){var _0x2bd6e4=0xa;var _0x585d47=[_0x800b('0x5a'),_0x800b('0x5b'),_0x800b('0x5c'),'cross_join'];var _0x825a00={'SUM':_0x800b('0x5d'),'COUNT':_0x800b('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x800b('0x5f'),'MIN':_0x800b('0x60'),'AVG':_0x800b('0x61'),'GROUP_CONCAT':_0x800b('0x62'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5ba8c6={'SEC_TO_TIME':_0x800b('0x63'),'DATE':_0x800b('0x64'),'HOUR':_0x800b('0x65'),'ROUND':_0x800b('0x66'),'UNIX_TIMESTAMP':_0x800b('0x67')};var _0x2bb204=function(_0x336df5){return!_['includes']([_0x800b('0x68'),_0x800b('0x69'),_0x800b('0x6a'),_0x800b('0x6b')],_0x336df5);};var _0x3d78d5=function(_0x4805ce){if(!_0x4805ce||!_0x4805ce['rules'][_0x800b('0x3c')]){return'';}for(var _0x514c0d='(',_0x3cc55e=0x0;_0x3cc55e<_0x4805ce[_0x800b('0x6c')][_0x800b('0x3c')];_0x3cc55e+=0x1){_0x3cc55e>0x0&&(_0x514c0d+='\x20'+_0x4805ce[_0x800b('0x6d')]+'\x20');_0x514c0d+=_0x4805ce['rules'][_0x3cc55e][_0x800b('0x6e')]?_0x3d78d5(_0x4805ce[_0x800b('0x6c')][_0x3cc55e][_0x800b('0x6e')]):_0x4805ce[_0x800b('0x6c')][_0x3cc55e][_0x800b('0x6f')]+'\x20'+_0x4805ce[_0x800b('0x6c')][_0x3cc55e][_0x800b('0x70')]+(_0x2bb204(_0x4805ce['rules'][_0x3cc55e][_0x800b('0x70')])?'\x20'+_0x4805ce[_0x800b('0x6c')][_0x3cc55e][_0x800b('0x71')]:'');}return _0x514c0d+')';};var _0x3fd2e9={'where':{'id':_0x15ce4b[_0x800b('0x4c')]['id']}},_0x317929,_0xc39a8e,_0x3a88aa,_0x4256fd,_0x606301;_0x3fd2e9=_['merge']({},_0x3fd2e9,_0x15ce4b['options']);return db[_0x800b('0x34')]['find'](_0x3fd2e9)[_0x800b('0x2a')](function(_0x1b20a1){if(_0x1b20a1){_0x317929=_0x1b20a1;return _0x1b20a1[_0x800b('0x72')]();}return null;})[_0x800b('0x2a')](function(_0x3edc97){if(_0x3edc97){if(!_0x3edc97['length']){throw new db[(_0x800b('0x73'))][(_0x800b('0x74'))](_0x800b('0x75'),0x193);}_0xc39a8e=_0x3edc97;return db[_0x800b('0x76')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x52b989){if(_0x52b989){_0x3a88aa=_[_0x800b('0x77')](_0x52b989,'id');var _0x41824c;var _0x86dcaa=squel[_0x800b('0x78')]();_0x86dcaa['from'](_0x317929[_0x800b('0x79')]);for(var _0x28c1d7=0x0;_0x28c1d7<_0xc39a8e[_0x800b('0x3c')];_0x28c1d7+=0x1){_0x41824c=_0xc39a8e[_0x28c1d7]['MetricId']?_0x3a88aa[_0xc39a8e[_0x28c1d7][_0x800b('0x7a')]][_0x800b('0x7b')]:_0xc39a8e[_0x28c1d7][_0x800b('0x6f')];_0x41824c=_0xc39a8e[_0x28c1d7][_0x800b('0x7c')]?_[_0x800b('0x7d')](_0x825a00[_0xc39a8e[_0x28c1d7][_0x800b('0x7c')]],'%s',_0x41824c):_0x41824c;_0x41824c=_0xc39a8e[_0x28c1d7][_0x800b('0x7e')]?_[_0x800b('0x7d')](_0x5ba8c6[_0xc39a8e[_0x28c1d7][_0x800b('0x7e')]],'%s',_0x41824c):_0x41824c;if(_0xc39a8e[_0x28c1d7][_0x800b('0x7f')]){_0x86dcaa[_0x800b('0x6e')](_0x41824c);}_0xc39a8e[_0x28c1d7][_0x800b('0x80')]&&_0x86dcaa['order'](_0x41824c,_0xc39a8e[_0x28c1d7][_0x800b('0x80')]==='DESC'?![]:!![]);_0x86dcaa['field'](_0x41824c,_0xc39a8e[_0x28c1d7][_0x800b('0x81')]||_0x41824c);}if(_0x317929[_0x800b('0x82')]){_0x317929[_0x800b('0x82')]=JSON[_0x800b('0x83')](_0x317929[_0x800b('0x82')]);for(var _0x3fa008=0x0;_0x3fa008<_0x317929[_0x800b('0x82')][_0x800b('0x3c')];_0x3fa008+=0x1){if(_0x317929[_0x800b('0x82')][_0x3fa008][_0x800b('0x43')]&&_[_0x800b('0x84')](_0x585d47,_0x317929['joins'][_0x3fa008][_0x800b('0x43')])&&_0x317929[_0x800b('0x82')][_0x3fa008][_0x800b('0x85')]&&_0x317929['joins'][_0x3fa008]['foreignTable']&&_0x317929['joins'][_0x3fa008]['foreignKey']){_0x86dcaa[_0x317929[_0x800b('0x82')][_0x3fa008]['type']](_0x317929[_0x800b('0x82')][_0x3fa008][_0x800b('0x86')],null,util[_0x800b('0x7e')](_0x800b('0x87'),_0x317929[_0x800b('0x79')],_0x317929['joins'][_0x3fa008][_0x800b('0x85')],_0x317929['joins'][_0x3fa008][_0x800b('0x86')],_0x317929[_0x800b('0x82')][_0x3fa008][_0x800b('0x88')]));}}}if(_0x317929[_0x800b('0x89')]){_0x317929['conditions']=JSON[_0x800b('0x83')](_0x317929[_0x800b('0x89')]);_0x86dcaa[_0x800b('0x3f')](_0x3d78d5(_0x317929[_0x800b('0x89')][_0x800b('0x6e')]));}_0x606301=_0x86dcaa[_0x800b('0x8a')]();_0x86dcaa[_0x800b('0x23')](_0x2bd6e4);_0x86dcaa[_0x800b('0x21')](0x0);logger[_0x800b('0x8b')](_0x800b('0x8c'),_0x86dcaa[_0x800b('0x8d')]());return dbH[_0x800b('0x8e')][_0x800b('0x37')](_0x86dcaa[_0x800b('0x8d')](),{'type':dbH[_0x800b('0x8e')][_0x800b('0x8f')][_0x800b('0x90')]});}})[_0x800b('0x2a')](respondWithResult(_0x45dd38,null))[_0x800b('0x4a')](handleError(_0x45dd38,null));};function runReport(_0x546b28,_0x31390d,_0x21ba3e){var _0x155d25=_0x31390d[_0x800b('0x30')];var _0xa90ce1=0xa;var _0x1d906b=[_0x800b('0x5a'),'left_join','right_join',_0x800b('0x91')];var _0x18dc8a={'SUM':'SUM(%s)','COUNT':_0x800b('0x5e'),'COUNT DISTINCT':_0x800b('0x92'),'MAX':'MAX(%s)','MIN':_0x800b('0x60'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x800b('0x62'),'GROUP_CONCAT ASC':_0x800b('0x93'),'GROUP_CONCAT DESC':_0x800b('0x94')};var _0x2cbaff={'SEC_TO_TIME':_0x800b('0x63'),'DATE':_0x800b('0x64'),'HOUR':_0x800b('0x65'),'ROUND':_0x800b('0x66'),'UNIX_TIMESTAMP':_0x800b('0x67')};var _0x2caff3=function(_0x46a3ec){return!_['includes']([_0x800b('0x68'),_0x800b('0x69'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x46a3ec);};var _0xb0fac2=function(_0x557b5c){if(!_0x557b5c||!_0x557b5c[_0x800b('0x6c')][_0x800b('0x3c')]){return'';}for(var _0x2bce3f='(',_0x30f4db=0x0;_0x30f4db<_0x557b5c[_0x800b('0x6c')][_0x800b('0x3c')];_0x30f4db+=0x1){_0x30f4db>0x0&&(_0x2bce3f+='\x20'+_0x557b5c[_0x800b('0x6d')]+'\x20');_0x2bce3f+=_0x557b5c[_0x800b('0x6c')][_0x30f4db]['group']?_0xb0fac2(_0x557b5c['rules'][_0x30f4db][_0x800b('0x6e')]):_0x557b5c[_0x800b('0x6c')][_0x30f4db]['field']+'\x20'+_0x557b5c[_0x800b('0x6c')][_0x30f4db][_0x800b('0x70')]+(_0x2caff3(_0x557b5c[_0x800b('0x6c')][_0x30f4db][_0x800b('0x70')])?'\x20'+_0x557b5c['rules'][_0x30f4db][_0x800b('0x71')]:'');}return _0x2bce3f+')';};var _0x2db6a4={'where':{'id':_0x546b28['id']}},_0x36b455,_0x2f0117,_0x35cdf2,_0x569d35,_0x49b7f4;_0x2db6a4=_[_0x800b('0x42')]({},_0x2db6a4,_0x21ba3e);return db[_0x800b('0x34')]['find'](_0x2db6a4)[_0x800b('0x2a')](function(_0x22c136){if(_0x22c136){_0x36b455=_0x22c136;return _0x22c136[_0x800b('0x72')]();}return null;})[_0x800b('0x2a')](function(_0xb3664f){if(_0xb3664f){if(!_0xb3664f['length']){throw new db['Sequelize'][(_0x800b('0x74'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2f0117=_0xb3664f;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x800b('0x2a')](function(_0x5c6d0b){if(_0x5c6d0b){_0x35cdf2=_[_0x800b('0x77')](_0x5c6d0b,'id');var _0x3d48ff;var _0x3773ee=squel['select']();_0x3773ee['from'](_0x36b455[_0x800b('0x79')]);for(var _0x44aa0a=0x0;_0x44aa0a<_0x2f0117['length'];_0x44aa0a+=0x1){_0x3d48ff=_0x2f0117[_0x44aa0a][_0x800b('0x7a')]?_0x35cdf2[_0x2f0117[_0x44aa0a][_0x800b('0x7a')]]['metric']:_0x2f0117[_0x44aa0a][_0x800b('0x6f')];_0x3d48ff=_0x2f0117[_0x44aa0a][_0x800b('0x7c')]?_[_0x800b('0x7d')](_0x18dc8a[_0x2f0117[_0x44aa0a][_0x800b('0x7c')]],'%s',_0x3d48ff):_0x3d48ff;_0x3d48ff=_0x2f0117[_0x44aa0a][_0x800b('0x7e')]?_[_0x800b('0x7d')](_0x2cbaff[_0x2f0117[_0x44aa0a][_0x800b('0x7e')]],'%s',_0x3d48ff):_0x3d48ff;if(_0x2f0117[_0x44aa0a][_0x800b('0x7f')]){_0x3773ee[_0x800b('0x6e')](_0x3d48ff);}_0x2f0117[_0x44aa0a][_0x800b('0x80')]&&_0x3773ee['order'](_0x3d48ff,_0x2f0117[_0x44aa0a][_0x800b('0x80')]==='DESC'?![]:!![]);_0x3773ee['field'](_0x3d48ff,_0x2f0117[_0x44aa0a][_0x800b('0x81')]||_0x3d48ff);}if(_0x36b455[_0x800b('0x82')]){_0x36b455['joins']=JSON[_0x800b('0x83')](_0x36b455[_0x800b('0x82')]);for(var _0x3f3d48=0x0;_0x3f3d48<_0x36b455[_0x800b('0x82')]['length'];_0x3f3d48+=0x1){if(_0x36b455['joins'][_0x3f3d48][_0x800b('0x43')]&&_['includes'](_0x1d906b,_0x36b455[_0x800b('0x82')][_0x3f3d48][_0x800b('0x43')])&&_0x36b455[_0x800b('0x82')][_0x3f3d48]['parentKey']&&_0x36b455[_0x800b('0x82')][_0x3f3d48]['foreignTable']&&_0x36b455[_0x800b('0x82')][_0x3f3d48][_0x800b('0x88')]){_0x3773ee[_0x36b455['joins'][_0x3f3d48][_0x800b('0x43')]](_0x36b455[_0x800b('0x82')][_0x3f3d48]['foreignTable'],null,util[_0x800b('0x7e')](_0x800b('0x87'),_0x36b455[_0x800b('0x79')],_0x36b455[_0x800b('0x82')][_0x3f3d48]['parentKey'],_0x36b455[_0x800b('0x82')][_0x3f3d48][_0x800b('0x86')],_0x36b455[_0x800b('0x82')][_0x3f3d48][_0x800b('0x88')]));}}}if(_0x36b455[_0x800b('0x89')]){_0x36b455[_0x800b('0x89')]=JSON[_0x800b('0x83')](_0x36b455['conditions']);_0x3773ee[_0x800b('0x3f')](_0xb0fac2(_0x36b455[_0x800b('0x89')][_0x800b('0x6e')]));}_0x49b7f4=_0x3773ee[_0x800b('0x8a')]();_0x3773ee[_0x800b('0x23')](_0xa90ce1);_0x3773ee[_0x800b('0x21')](0x0);return;}})[_0x800b('0x2a')](function(){if(_0x31390d[_0x800b('0x95')]===_0x800b('0x96')){return null;}var _0x51b05b=_[_0x800b('0x42')](_0x31390d,{'name':_0x31390d[_0x800b('0x97')]||_0x31390d['name']||_0x36b455[_0x800b('0x30')],'basename':_0x155d25,'savename':util[_0x800b('0x7e')](_0x800b('0x98'),_0x31390d['name']||_0x36b455['name'],require(_0x800b('0x99'))['generate'](0x4),_0x31390d[_0x800b('0x95')]||_0x800b('0x9a')),'reportId':_0x36b455['id'],'reportType':_0x800b('0x9b')});return db['AnalyticExtractedReport'][_0x800b('0x50')](_0x51b05b,{'raw':!![]});})['then'](function(_0x19a4f8){if(_0x36b455[_0x800b('0x79')]===_0x800b('0x9c')){_0x49b7f4[_0x800b('0x3f')](_0x36b455[_0x800b('0x79')]+_0x800b('0x9d'),_0x31390d[_0x800b('0x9e')],_0x31390d[_0x800b('0x9f')]);}else{_0x49b7f4['where'](_0x36b455[_0x800b('0x79')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x31390d['startDate'],_0x31390d['endDate']);}if(_0x19a4f8){logger[_0x800b('0xa0')](_0x800b('0xa1'),_0x49b7f4[_0x800b('0x8d')]());require(_0x800b('0xa2'))['fork'](path[_0x800b('0x5a')](__dirname,_0x800b('0xa3'),_0x19a4f8['output']),[_0x19a4f8['id'],_0x49b7f4['toString'](),path[_0x800b('0x5a')](__dirname,_0x800b('0xa4'),_0x19a4f8['savename']),_0x155d25]);return _0x19a4f8;}else{var _0x199d33=squel[_0x800b('0x78')]();_0x199d33['from']('('+_0x49b7f4[_0x800b('0x8d')]()+')',_0x800b('0xa5'));_0x199d33['field'](_0x800b('0xa6'),'count');_0x49b7f4[_0x800b('0x23')](_0x31390d['limit']||_0xa90ce1);_0x49b7f4[_0x800b('0x21')](_0x31390d[_0x800b('0x21')]||0x0);return dbH[_0x800b('0x8e')][_0x800b('0x37')](_0x199d33[_0x800b('0x8d')](),{'type':dbH[_0x800b('0x8e')]['QueryTypes'][_0x800b('0x90')]})[_0x800b('0x2a')](function(_0x527658){if(!_0x527658[_0x800b('0x3c')]){_0x569d35=0x0;}else{_0x569d35=_0x527658[0x0]['count']||0x0;}return dbH[_0x800b('0x8e')][_0x800b('0x37')](_0x49b7f4['toString'](),{'type':dbH[_0x800b('0x8e')][_0x800b('0x8f')]['SELECT']});})[_0x800b('0x2a')](function(_0x18c365){return{'rows':_0x18c365||[],'count':_0x569d35};});}});}exports[_0x800b('0xa7')]=function(_0x404142,_0x49c628){return runReport(_0x404142[_0x800b('0x4c')],_0x404142[_0x800b('0x37')],_0x404142[_0x800b('0x45')])[_0x800b('0x2a')](respondWithResult(_0x49c628,null))['catch'](handleError(_0x49c628,null));};exports[_0x800b('0xa8')]=runReport;exports[_0x800b('0x37')]=function(_0x533929,_0x4dc27b){var _0x1dc721=0xa;var _0x3e710d=['join','left_join',_0x800b('0x5c'),_0x800b('0x91')];var _0x4e7ba9={'SUM':_0x800b('0x5d'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x800b('0x92'),'MAX':'MAX(%s)','MIN':_0x800b('0x60'),'AVG':_0x800b('0x61'),'GROUP_CONCAT':_0x800b('0x62'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x800b('0x94')};var _0x24c25a={'SEC_TO_TIME':_0x800b('0x63'),'DATE':_0x800b('0x64'),'HOUR':_0x800b('0x65'),'ROUND':_0x800b('0x66'),'UNIX_TIMESTAMP':_0x800b('0x67')};var _0x193ff7=function(_0x24b0c7){return!_['includes']([_0x800b('0x68'),_0x800b('0x69'),_0x800b('0x6a'),_0x800b('0x6b')],_0x24b0c7);};var _0x1b6161=function(_0x33b3c9){if(!_0x33b3c9||!_0x33b3c9[_0x800b('0x6c')][_0x800b('0x3c')]){return'';}for(var _0x421c6f='(',_0x4e45db=0x0;_0x4e45db<_0x33b3c9['rules'][_0x800b('0x3c')];_0x4e45db+=0x1){_0x4e45db>0x0&&(_0x421c6f+='\x20'+_0x33b3c9[_0x800b('0x6d')]+'\x20');_0x421c6f+=_0x33b3c9[_0x800b('0x6c')][_0x4e45db][_0x800b('0x6e')]?_0x1b6161(_0x33b3c9[_0x800b('0x6c')][_0x4e45db][_0x800b('0x6e')]):_0x33b3c9['rules'][_0x4e45db][_0x800b('0x6f')]+'\x20'+_0x33b3c9[_0x800b('0x6c')][_0x4e45db][_0x800b('0x70')]+(_0x193ff7(_0x33b3c9['rules'][_0x4e45db]['condition'])?'\x20'+_0x33b3c9[_0x800b('0x6c')][_0x4e45db][_0x800b('0x71')]:'');}return _0x421c6f+')';};var _0x38c053={'where':{'id':_0x533929[_0x800b('0x4c')]['id']}},_0x184687,_0x53aab2,_0x26bcd2,_0x4d1f2a,_0x49321b;_0x38c053=_[_0x800b('0x42')]({},_0x38c053,_0x533929[_0x800b('0x45')]);return db['AnalyticCustomReport'][_0x800b('0x4f')](_0x38c053)[_0x800b('0x2a')](function(_0x51efcd){if(_0x51efcd){_0x184687=_0x51efcd;return _0x51efcd[_0x800b('0x72')]();}return null;})['then'](function(_0x346aa4){if(_0x346aa4){if(!_0x346aa4['length']){throw new db[(_0x800b('0x73'))][(_0x800b('0x74'))](_0x800b('0x75'),0x193);}_0x53aab2=_0x346aa4;return db[_0x800b('0x76')]['findAll']({'raw':!![]});}return null;})[_0x800b('0x2a')](function(_0x281807){if(_0x281807){_0x26bcd2=_[_0x800b('0x77')](_0x281807,'id');var _0x149632;var _0x4afd16=squel[_0x800b('0x78')]();_0x4afd16[_0x800b('0xa9')](_0x184687[_0x800b('0x79')]);for(var _0x5ee6b0=0x0;_0x5ee6b0<_0x53aab2[_0x800b('0x3c')];_0x5ee6b0+=0x1){_0x149632=_0x53aab2[_0x5ee6b0][_0x800b('0x7a')]?_0x26bcd2[_0x53aab2[_0x5ee6b0][_0x800b('0x7a')]]['metric']:_0x53aab2[_0x5ee6b0][_0x800b('0x6f')];_0x149632=_0x53aab2[_0x5ee6b0]['function']?_[_0x800b('0x7d')](_0x4e7ba9[_0x53aab2[_0x5ee6b0][_0x800b('0x7c')]],'%s',_0x149632):_0x149632;_0x149632=_0x53aab2[_0x5ee6b0][_0x800b('0x7e')]?_[_0x800b('0x7d')](_0x24c25a[_0x53aab2[_0x5ee6b0]['format']],'%s',_0x149632):_0x149632;if(_0x53aab2[_0x5ee6b0][_0x800b('0x7f')]){_0x4afd16[_0x800b('0x6e')](_0x149632);}_0x53aab2[_0x5ee6b0][_0x800b('0x80')]&&_0x4afd16['order'](_0x149632,_0x53aab2[_0x5ee6b0][_0x800b('0x80')]===_0x800b('0xaa')?![]:!![]);_0x4afd16[_0x800b('0x6f')](_0x149632,_0x53aab2[_0x5ee6b0][_0x800b('0x81')]||_0x149632);}if(_0x184687[_0x800b('0x82')]){_0x184687[_0x800b('0x82')]=JSON[_0x800b('0x83')](_0x184687['joins']);for(var _0x22848b=0x0;_0x22848b<_0x184687[_0x800b('0x82')][_0x800b('0x3c')];_0x22848b+=0x1){if(_0x184687[_0x800b('0x82')][_0x22848b][_0x800b('0x43')]&&_[_0x800b('0x84')](_0x3e710d,_0x184687['joins'][_0x22848b][_0x800b('0x43')])&&_0x184687[_0x800b('0x82')][_0x22848b][_0x800b('0x85')]&&_0x184687[_0x800b('0x82')][_0x22848b][_0x800b('0x86')]&&_0x184687['joins'][_0x22848b][_0x800b('0x88')]){_0x4afd16[_0x184687[_0x800b('0x82')][_0x22848b][_0x800b('0x43')]](_0x184687[_0x800b('0x82')][_0x22848b]['foreignTable'],null,util[_0x800b('0x7e')](_0x800b('0x87'),_0x184687[_0x800b('0x79')],_0x184687[_0x800b('0x82')][_0x22848b][_0x800b('0x85')],_0x184687[_0x800b('0x82')][_0x22848b]['foreignTable'],_0x184687[_0x800b('0x82')][_0x22848b][_0x800b('0x88')]));}}}if(_0x184687[_0x800b('0x89')]){_0x184687[_0x800b('0x89')]=JSON['parse'](_0x184687['conditions']);_0x4afd16[_0x800b('0x3f')](_0x1b6161(_0x184687[_0x800b('0x89')][_0x800b('0x6e')]));}_0x49321b=_0x4afd16['clone']();_0x4afd16[_0x800b('0x23')](_0x1dc721);_0x4afd16['offset'](0x0);logger['debug'](_0x800b('0x8c'),_0x4afd16['toString']());return dbH[_0x800b('0x8e')][_0x800b('0x37')](_0x4afd16[_0x800b('0x8d')](),{'type':dbH[_0x800b('0x8e')][_0x800b('0x8f')][_0x800b('0x90')]});}})[_0x800b('0x2a')](function(){return{'sql':_0x49321b[_0x800b('0x8d')]()};})['then'](respondWithResult(_0x4dc27b,null))[_0x800b('0x4a')](handleError(_0x4dc27b,null));}; \ No newline at end of file +var _0x6a13=['autoAssociation','UserProfileResource','preview','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','length','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','replace','function','groupBy','orderBy','alias','joins','parse','includes','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','debug','toString','sequelize','join','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','value','order','DESC','clone','output','web','fullPath','%s-%s.%s','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','SELECT','run','Limited\x20Query:','rimraf','fast-json-patch','request-promise','mustache','util','path','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','CustomReports','destroy','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','sort','filters','pick','where','merge','VIRTUAL','filter','options','include','rows','catch','show','params','includeAll','find','create','body','user','get','role','UserProfileSection'];(function(_0x27380a,_0x11b4db){var _0x49557d=function(_0x11984a){while(--_0x11984a){_0x27380a['push'](_0x27380a['shift']());}};_0x49557d(++_0x11b4db);}(_0x6a13,0xf4));var _0x36a1=function(_0x309c75,_0x2514f5){_0x309c75=_0x309c75-0x0;var _0x187e12=_0x6a13[_0x309c75];return _0x187e12;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x36a1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x36a1('0x1'));var rp=require(_0x36a1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x36a1('0x3'));var util=require(_0x36a1('0x4'));var path=require(_0x36a1('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x36a1('0x6'));var _=require(_0x36a1('0x7'));var squel=require(_0x36a1('0x8'));var crypto=require('crypto');var jsforce=require(_0x36a1('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x36a1('0xa'));var querystring=require(_0x36a1('0xb'));var Papa=require(_0x36a1('0xc'));var Redis=require(_0x36a1('0xd'));var authService=require(_0x36a1('0xe'));var qs=require(_0x36a1('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x36a1('0x10'));var logger=require(_0x36a1('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x36a1('0x12'));var db=require(_0x36a1('0x13'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x157a56,_0x10aaff){_0x10aaff=_0x10aaff||0xcc;return function(_0x272324){if(_0x272324){return _0x157a56[_0x36a1('0x14')](_0x10aaff);}return _0x157a56[_0x36a1('0x15')](_0x10aaff)[_0x36a1('0x16')]();};}function respondWithResult(_0x25b8c9,_0x4aee16){_0x4aee16=_0x4aee16||0xc8;return function(_0x5ac42f){if(_0x5ac42f){return _0x25b8c9[_0x36a1('0x15')](_0x4aee16)[_0x36a1('0x17')](_0x5ac42f);}};}function respondWithFilteredResult(_0x3e7621,_0x39be59){return function(_0x5a144a){if(_0x5a144a){var _0x2550a2=typeof _0x39be59[_0x36a1('0x18')]===_0x36a1('0x19')&&typeof _0x39be59[_0x36a1('0x1a')]===_0x36a1('0x19');var _0x50376e=_0x5a144a[_0x36a1('0x1b')];var _0x544f07=_0x2550a2?0x0:_0x39be59[_0x36a1('0x18')];var _0x47ab17=_0x2550a2?_0x5a144a[_0x36a1('0x1b')]:_0x39be59[_0x36a1('0x18')]+_0x39be59['limit'];var _0x38b9fc;if(_0x47ab17>=_0x50376e){_0x47ab17=_0x50376e;_0x38b9fc=0xc8;}else{_0x38b9fc=0xce;}_0x3e7621['status'](_0x38b9fc);return _0x3e7621[_0x36a1('0x1c')](_0x36a1('0x1d'),_0x544f07+'-'+_0x47ab17+'/'+_0x50376e)[_0x36a1('0x17')](_0x5a144a);}return null;};}function patchUpdates(_0x5c34e2){return function(_0x16eaa5){try{jsonpatch[_0x36a1('0x1e')](_0x16eaa5,_0x5c34e2,!![]);}catch(_0xd8cabc){return BPromise[_0x36a1('0x1f')](_0xd8cabc);}return _0x16eaa5[_0x36a1('0x20')]();};}function saveUpdates(_0x593308,_0x3df7f4){return function(_0x1e55d2){if(_0x1e55d2){return _0x1e55d2[_0x36a1('0x21')](_0x593308)[_0x36a1('0x22')](function(_0x547f4b){return _0x547f4b;});}return null;};}function removeEntity(_0x9eb22f,_0x4a1eba){return function(_0x5752b6){if(_0x5752b6){return _0x5752b6['destroy']()[_0x36a1('0x22')](function(){var _0x4f79ef=_0x5752b6['get']({'plain':!![]});var _0x5c80ae=_0x36a1('0x23');return db['UserProfileResource'][_0x36a1('0x24')]({'where':{'type':_0x5c80ae,'resourceId':_0x4f79ef['id']}})[_0x36a1('0x22')](function(){return _0x5752b6;});})[_0x36a1('0x22')](function(){_0x9eb22f[_0x36a1('0x15')](0xcc)[_0x36a1('0x16')]();});}};}function handleEntityNotFound(_0x388bc7,_0x506577){return function(_0x13439f){if(!_0x13439f){_0x388bc7['sendStatus'](0x194);}return _0x13439f;};}function handleError(_0x53d44a,_0x2ed36c){_0x2ed36c=_0x2ed36c||0x1f4;return function(_0x5087a2){logger[_0x36a1('0x25')](_0x5087a2[_0x36a1('0x26')]);if(_0x5087a2['name']){delete _0x5087a2[_0x36a1('0x27')];}_0x53d44a[_0x36a1('0x15')](_0x2ed36c)[_0x36a1('0x28')](_0x5087a2);};}exports[_0x36a1('0x29')]=function(_0x526131,_0x30a389){var _0x507ae4={},_0x495d7f={},_0x4a83a7={'count':0x0,'rows':[]};var _0x205712=_[_0x36a1('0x2a')](db[_0x36a1('0x2b')][_0x36a1('0x2c')],function(_0x2046ec){return{'name':_0x2046ec[_0x36a1('0x2d')],'type':_0x2046ec[_0x36a1('0x2e')]['key']};});_0x495d7f[_0x36a1('0x2f')]=_[_0x36a1('0x2a')](_0x205712,_0x36a1('0x27'));_0x495d7f[_0x36a1('0x30')]=_[_0x36a1('0x31')](_0x526131[_0x36a1('0x30')]);_0x495d7f['filters']=_['intersection'](_0x495d7f[_0x36a1('0x2f')],_0x495d7f[_0x36a1('0x30')]);_0x507ae4[_0x36a1('0x32')]=_[_0x36a1('0x33')](_0x495d7f[_0x36a1('0x2f')],qs[_0x36a1('0x34')](_0x526131[_0x36a1('0x30')][_0x36a1('0x34')]));_0x507ae4[_0x36a1('0x32')]=_0x507ae4[_0x36a1('0x32')]['length']?_0x507ae4[_0x36a1('0x32')]:_0x495d7f[_0x36a1('0x2f')];if(!_0x526131['query']['hasOwnProperty']('nolimit')){_0x507ae4[_0x36a1('0x1a')]=qs[_0x36a1('0x1a')](_0x526131[_0x36a1('0x30')][_0x36a1('0x1a')]);_0x507ae4[_0x36a1('0x18')]=qs[_0x36a1('0x18')](_0x526131[_0x36a1('0x30')][_0x36a1('0x18')]);}_0x507ae4['order']=qs[_0x36a1('0x35')](_0x526131[_0x36a1('0x30')][_0x36a1('0x35')]);_0x507ae4['where']=qs[_0x36a1('0x36')](_[_0x36a1('0x37')](_0x526131[_0x36a1('0x30')],_0x495d7f['filters']),_0x205712);if(_0x526131[_0x36a1('0x30')]['filter']){_0x507ae4[_0x36a1('0x38')]=_[_0x36a1('0x39')](_0x507ae4['where'],{'$or':_['map'](_0x205712,function(_0x5e1be2){if(_0x5e1be2[_0x36a1('0x2e')]!==_0x36a1('0x3a')){var _0x58eebf={};_0x58eebf[_0x5e1be2[_0x36a1('0x27')]]={'$like':'%'+_0x526131[_0x36a1('0x30')][_0x36a1('0x3b')]+'%'};return _0x58eebf;}})});}_0x507ae4=_[_0x36a1('0x39')]({},_0x507ae4,_0x526131[_0x36a1('0x3c')]);var _0x267454={'where':_0x507ae4['where']};return db[_0x36a1('0x2b')]['count'](_0x267454)[_0x36a1('0x22')](function(_0x27876a){_0x4a83a7[_0x36a1('0x1b')]=_0x27876a;if(_0x526131[_0x36a1('0x30')]['includeAll']){_0x507ae4[_0x36a1('0x3d')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x507ae4);})[_0x36a1('0x22')](function(_0xdc62f6){_0x4a83a7[_0x36a1('0x3e')]=_0xdc62f6;return _0x4a83a7;})[_0x36a1('0x22')](respondWithFilteredResult(_0x30a389,_0x507ae4))[_0x36a1('0x3f')](handleError(_0x30a389,null));};exports[_0x36a1('0x40')]=function(_0x36f763,_0x501244){var _0x3cbe1b={'raw':![],'where':{'id':_0x36f763[_0x36a1('0x41')]['id']}},_0x2eca9e={};_0x2eca9e[_0x36a1('0x2f')]=_[_0x36a1('0x31')](db[_0x36a1('0x2b')]['rawAttributes']);_0x2eca9e['query']=_['keys'](_0x36f763['query']);_0x2eca9e[_0x36a1('0x36')]=_[_0x36a1('0x33')](_0x2eca9e[_0x36a1('0x2f')],_0x2eca9e['query']);_0x3cbe1b[_0x36a1('0x32')]=_['intersection'](_0x2eca9e['model'],qs[_0x36a1('0x34')](_0x36f763['query'][_0x36a1('0x34')]));_0x3cbe1b['attributes']=_0x3cbe1b['attributes']['length']?_0x3cbe1b[_0x36a1('0x32')]:_0x2eca9e[_0x36a1('0x2f')];if(_0x36f763[_0x36a1('0x30')][_0x36a1('0x42')]){_0x3cbe1b[_0x36a1('0x3d')]=[{'all':!![]}];}_0x3cbe1b=_['merge']({},_0x3cbe1b,_0x36f763[_0x36a1('0x3c')]);return db[_0x36a1('0x2b')][_0x36a1('0x43')](_0x3cbe1b)[_0x36a1('0x22')](handleEntityNotFound(_0x501244,null))[_0x36a1('0x22')](respondWithResult(_0x501244,null))[_0x36a1('0x3f')](handleError(_0x501244,null));};exports[_0x36a1('0x44')]=function(_0x5b6163,_0x1b6a2f){return db[_0x36a1('0x2b')][_0x36a1('0x44')](_0x5b6163[_0x36a1('0x45')],{})[_0x36a1('0x22')](function(_0x2bf459){var _0x1084eb=_0x5b6163[_0x36a1('0x46')][_0x36a1('0x47')]({'plain':!![]});if(!_0x1084eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1084eb[_0x36a1('0x48')]==='user'){var _0x18c7d7=_0x2bf459['get']({'plain':!![]});var _0x4a0a99='Reports';return db[_0x36a1('0x49')][_0x36a1('0x43')]({'where':{'name':_0x4a0a99,'userProfileId':_0x1084eb['userProfileId']},'raw':!![]})[_0x36a1('0x22')](function(_0x4ef4c5){if(_0x4ef4c5&&_0x4ef4c5[_0x36a1('0x4a')]===0x0){return db[_0x36a1('0x4b')][_0x36a1('0x44')]({'name':_0x18c7d7[_0x36a1('0x27')],'resourceId':_0x18c7d7['id'],'type':_0x36a1('0x23'),'sectionId':_0x4ef4c5['id']},{})[_0x36a1('0x22')](function(){return _0x2bf459;});}else{return _0x2bf459;}})[_0x36a1('0x3f')](function(_0x4e41b5){logger[_0x36a1('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e41b5);throw _0x4e41b5;});}return _0x2bf459;})[_0x36a1('0x22')](respondWithResult(_0x1b6a2f,0xc9))[_0x36a1('0x3f')](handleError(_0x1b6a2f,null));};exports[_0x36a1('0x21')]=function(_0x269644,_0x173330){if(_0x269644[_0x36a1('0x45')]['id']){delete _0x269644[_0x36a1('0x45')]['id'];}return db[_0x36a1('0x2b')][_0x36a1('0x43')]({'where':{'id':_0x269644[_0x36a1('0x41')]['id']}})[_0x36a1('0x22')](handleEntityNotFound(_0x173330,null))['then'](saveUpdates(_0x269644[_0x36a1('0x45')],null))[_0x36a1('0x22')](respondWithResult(_0x173330,null))['catch'](handleError(_0x173330,null));};exports['destroy']=function(_0x56c739,_0xcd6c9b){return db[_0x36a1('0x2b')]['find']({'where':{'id':_0x56c739[_0x36a1('0x41')]['id']}})[_0x36a1('0x22')](handleEntityNotFound(_0xcd6c9b,null))[_0x36a1('0x22')](removeEntity(_0xcd6c9b,null))[_0x36a1('0x3f')](handleError(_0xcd6c9b,null));};exports[_0x36a1('0x4c')]=function(_0x3de41a,_0x559495){var _0x5908af=0xa;var _0x1a5a7a=['join','left_join',_0x36a1('0x4d'),_0x36a1('0x4e')];var _0x16bc20={'SUM':_0x36a1('0x4f'),'COUNT':_0x36a1('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x36a1('0x51'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x36a1('0x52'),'GROUP_CONCAT ASC':_0x36a1('0x53'),'GROUP_CONCAT DESC':_0x36a1('0x54')};var _0x438251={'SEC_TO_TIME':_0x36a1('0x55'),'DATE':_0x36a1('0x56'),'HOUR':_0x36a1('0x57'),'ROUND':_0x36a1('0x58'),'UNIX_TIMESTAMP':_0x36a1('0x59')};var _0x587b46=function(_0x3ca1b7){return!_['includes']([_0x36a1('0x5a'),_0x36a1('0x5b'),_0x36a1('0x5c'),_0x36a1('0x5d')],_0x3ca1b7);};var _0x4d287f=function(_0x43ae40){if(!_0x43ae40||!_0x43ae40['rules'][_0x36a1('0x5e')]){return'';}for(var _0x4cdb0c='(',_0x5da59d=0x0;_0x5da59d<_0x43ae40[_0x36a1('0x5f')][_0x36a1('0x5e')];_0x5da59d+=0x1){_0x5da59d>0x0&&(_0x4cdb0c+='\x20'+_0x43ae40[_0x36a1('0x60')]+'\x20');_0x4cdb0c+=_0x43ae40[_0x36a1('0x5f')][_0x5da59d][_0x36a1('0x61')]?_0x4d287f(_0x43ae40['rules'][_0x5da59d][_0x36a1('0x61')]):_0x43ae40[_0x36a1('0x5f')][_0x5da59d][_0x36a1('0x62')]+'\x20'+_0x43ae40['rules'][_0x5da59d][_0x36a1('0x63')]+(_0x587b46(_0x43ae40[_0x36a1('0x5f')][_0x5da59d][_0x36a1('0x63')])?'\x20'+_0x43ae40[_0x36a1('0x5f')][_0x5da59d]['value']:'');}return _0x4cdb0c+')';};var _0x6ac7f0={'where':{'id':_0x3de41a[_0x36a1('0x41')]['id']}},_0x5c75ce,_0x52d9ae,_0x3008c1,_0x328ca2,_0x2fd427;_0x6ac7f0=_[_0x36a1('0x39')]({},_0x6ac7f0,_0x3de41a['options']);return db[_0x36a1('0x2b')][_0x36a1('0x43')](_0x6ac7f0)[_0x36a1('0x22')](function(_0x4d888c){if(_0x4d888c){_0x5c75ce=_0x4d888c;return _0x4d888c[_0x36a1('0x64')]();}return null;})[_0x36a1('0x22')](function(_0x3ae349){if(_0x3ae349){if(!_0x3ae349[_0x36a1('0x5e')]){throw new db[(_0x36a1('0x65'))][(_0x36a1('0x66'))](_0x36a1('0x67'),0x193);}_0x52d9ae=_0x3ae349;return db[_0x36a1('0x68')][_0x36a1('0x69')]({'raw':!![]});}return null;})[_0x36a1('0x22')](function(_0x58cc66){if(_0x58cc66){_0x3008c1=_[_0x36a1('0x6a')](_0x58cc66,'id');var _0xf91bf2;var _0xd4309b=squel[_0x36a1('0x6b')]();_0xd4309b[_0x36a1('0x6c')](_0x5c75ce['table']);for(var _0x211de7=0x0;_0x211de7<_0x52d9ae[_0x36a1('0x5e')];_0x211de7+=0x1){_0xf91bf2=_0x52d9ae[_0x211de7][_0x36a1('0x6d')]?_0x3008c1[_0x52d9ae[_0x211de7]['MetricId']][_0x36a1('0x6e')]:_0x52d9ae[_0x211de7][_0x36a1('0x62')];_0xf91bf2=_0x52d9ae[_0x211de7]['function']?_[_0x36a1('0x6f')](_0x16bc20[_0x52d9ae[_0x211de7][_0x36a1('0x70')]],'%s',_0xf91bf2):_0xf91bf2;_0xf91bf2=_0x52d9ae[_0x211de7]['format']?_[_0x36a1('0x6f')](_0x438251[_0x52d9ae[_0x211de7]['format']],'%s',_0xf91bf2):_0xf91bf2;if(_0x52d9ae[_0x211de7][_0x36a1('0x71')]){_0xd4309b['group'](_0xf91bf2);}_0x52d9ae[_0x211de7][_0x36a1('0x72')]&&_0xd4309b['order'](_0xf91bf2,_0x52d9ae[_0x211de7][_0x36a1('0x72')]==='DESC'?![]:!![]);_0xd4309b[_0x36a1('0x62')](_0xf91bf2,_0x52d9ae[_0x211de7][_0x36a1('0x73')]||_0xf91bf2);}if(_0x5c75ce[_0x36a1('0x74')]){_0x5c75ce['joins']=JSON[_0x36a1('0x75')](_0x5c75ce[_0x36a1('0x74')]);for(var _0x19cb6b=0x0;_0x19cb6b<_0x5c75ce[_0x36a1('0x74')]['length'];_0x19cb6b+=0x1){if(_0x5c75ce[_0x36a1('0x74')][_0x19cb6b][_0x36a1('0x2e')]&&_[_0x36a1('0x76')](_0x1a5a7a,_0x5c75ce[_0x36a1('0x74')][_0x19cb6b]['type'])&&_0x5c75ce[_0x36a1('0x74')][_0x19cb6b]['parentKey']&&_0x5c75ce[_0x36a1('0x74')][_0x19cb6b][_0x36a1('0x77')]&&_0x5c75ce['joins'][_0x19cb6b][_0x36a1('0x78')]){_0xd4309b[_0x5c75ce[_0x36a1('0x74')][_0x19cb6b][_0x36a1('0x2e')]](_0x5c75ce[_0x36a1('0x74')][_0x19cb6b]['foreignTable'],null,util[_0x36a1('0x79')](_0x36a1('0x7a'),_0x5c75ce[_0x36a1('0x7b')],_0x5c75ce[_0x36a1('0x74')][_0x19cb6b][_0x36a1('0x7c')],_0x5c75ce[_0x36a1('0x74')][_0x19cb6b]['foreignTable'],_0x5c75ce['joins'][_0x19cb6b][_0x36a1('0x78')]));}}}if(_0x5c75ce[_0x36a1('0x7d')]){_0x5c75ce[_0x36a1('0x7d')]=JSON['parse'](_0x5c75ce['conditions']);_0xd4309b[_0x36a1('0x38')](_0x4d287f(_0x5c75ce[_0x36a1('0x7d')][_0x36a1('0x61')]));}_0x2fd427=_0xd4309b['clone']();_0xd4309b[_0x36a1('0x1a')](_0x5908af);_0xd4309b[_0x36a1('0x18')](0x0);logger[_0x36a1('0x7e')]('Limited\x20Query:',_0xd4309b[_0x36a1('0x7f')]());return dbH[_0x36a1('0x80')]['query'](_0xd4309b['toString'](),{'type':dbH[_0x36a1('0x80')]['QueryTypes']['SELECT']});}})[_0x36a1('0x22')](respondWithResult(_0x559495,null))[_0x36a1('0x3f')](handleError(_0x559495,null));};function runReport(_0xcace51,_0x508389,_0x5f3017){var _0x55ea60=_0x508389[_0x36a1('0x27')];var _0x249205=0xa;var _0x4962e6=[_0x36a1('0x81'),_0x36a1('0x82'),_0x36a1('0x4d'),_0x36a1('0x4e')];var _0x575c15={'SUM':_0x36a1('0x4f'),'COUNT':_0x36a1('0x50'),'COUNT DISTINCT':_0x36a1('0x83'),'MAX':'MAX(%s)','MIN':_0x36a1('0x84'),'AVG':_0x36a1('0x85'),'GROUP_CONCAT':_0x36a1('0x52'),'GROUP_CONCAT ASC':_0x36a1('0x53'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x593455={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x36a1('0x58'),'UNIX_TIMESTAMP':_0x36a1('0x59')};var _0x521ebe=function(_0x177121){return!_[_0x36a1('0x76')]([_0x36a1('0x5a'),_0x36a1('0x5b'),'IS\x20EMPTY',_0x36a1('0x5d')],_0x177121);};var _0x32a541=function(_0x28451d){if(!_0x28451d||!_0x28451d[_0x36a1('0x5f')][_0x36a1('0x5e')]){return'';}for(var _0x50962a='(',_0x470592=0x0;_0x470592<_0x28451d[_0x36a1('0x5f')][_0x36a1('0x5e')];_0x470592+=0x1){_0x470592>0x0&&(_0x50962a+='\x20'+_0x28451d['operator']+'\x20');_0x50962a+=_0x28451d['rules'][_0x470592][_0x36a1('0x61')]?_0x32a541(_0x28451d[_0x36a1('0x5f')][_0x470592][_0x36a1('0x61')]):_0x28451d[_0x36a1('0x5f')][_0x470592][_0x36a1('0x62')]+'\x20'+_0x28451d['rules'][_0x470592][_0x36a1('0x63')]+(_0x521ebe(_0x28451d[_0x36a1('0x5f')][_0x470592][_0x36a1('0x63')])?'\x20'+_0x28451d[_0x36a1('0x5f')][_0x470592][_0x36a1('0x86')]:'');}return _0x50962a+')';};var _0xe22113={'where':{'id':_0xcace51['id']}},_0x486b2c,_0x11cc15,_0x634347,_0x42801d,_0x4d4e19;_0xe22113=_[_0x36a1('0x39')]({},_0xe22113,_0x5f3017);return db[_0x36a1('0x2b')][_0x36a1('0x43')](_0xe22113)[_0x36a1('0x22')](function(_0xcaf1c5){if(_0xcaf1c5){_0x486b2c=_0xcaf1c5;return _0xcaf1c5[_0x36a1('0x64')]();}return null;})['then'](function(_0x2927c7){if(_0x2927c7){if(!_0x2927c7[_0x36a1('0x5e')]){throw new db[(_0x36a1('0x65'))][(_0x36a1('0x66'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x11cc15=_0x2927c7;return db[_0x36a1('0x68')][_0x36a1('0x69')]({'raw':!![]});}return null;})[_0x36a1('0x22')](function(_0x1a9798){if(_0x1a9798){_0x634347=_[_0x36a1('0x6a')](_0x1a9798,'id');var _0x51b89d;var _0xc27c61=squel[_0x36a1('0x6b')]();_0xc27c61[_0x36a1('0x6c')](_0x486b2c['table']);for(var _0x5a8615=0x0;_0x5a8615<_0x11cc15['length'];_0x5a8615+=0x1){_0x51b89d=_0x11cc15[_0x5a8615]['MetricId']?_0x634347[_0x11cc15[_0x5a8615][_0x36a1('0x6d')]][_0x36a1('0x6e')]:_0x11cc15[_0x5a8615][_0x36a1('0x62')];_0x51b89d=_0x11cc15[_0x5a8615][_0x36a1('0x70')]?_[_0x36a1('0x6f')](_0x575c15[_0x11cc15[_0x5a8615]['function']],'%s',_0x51b89d):_0x51b89d;_0x51b89d=_0x11cc15[_0x5a8615]['format']?_['replace'](_0x593455[_0x11cc15[_0x5a8615][_0x36a1('0x79')]],'%s',_0x51b89d):_0x51b89d;if(_0x11cc15[_0x5a8615][_0x36a1('0x71')]){_0xc27c61[_0x36a1('0x61')](_0x51b89d);}_0x11cc15[_0x5a8615]['orderBy']&&_0xc27c61[_0x36a1('0x87')](_0x51b89d,_0x11cc15[_0x5a8615][_0x36a1('0x72')]===_0x36a1('0x88')?![]:!![]);_0xc27c61['field'](_0x51b89d,_0x11cc15[_0x5a8615][_0x36a1('0x73')]||_0x51b89d);}if(_0x486b2c[_0x36a1('0x74')]){_0x486b2c[_0x36a1('0x74')]=JSON[_0x36a1('0x75')](_0x486b2c[_0x36a1('0x74')]);for(var _0x3f614a=0x0;_0x3f614a<_0x486b2c[_0x36a1('0x74')][_0x36a1('0x5e')];_0x3f614a+=0x1){if(_0x486b2c[_0x36a1('0x74')][_0x3f614a][_0x36a1('0x2e')]&&_[_0x36a1('0x76')](_0x4962e6,_0x486b2c[_0x36a1('0x74')][_0x3f614a][_0x36a1('0x2e')])&&_0x486b2c[_0x36a1('0x74')][_0x3f614a][_0x36a1('0x7c')]&&_0x486b2c[_0x36a1('0x74')][_0x3f614a][_0x36a1('0x77')]&&_0x486b2c['joins'][_0x3f614a][_0x36a1('0x78')]){_0xc27c61[_0x486b2c[_0x36a1('0x74')][_0x3f614a][_0x36a1('0x2e')]](_0x486b2c[_0x36a1('0x74')][_0x3f614a][_0x36a1('0x77')],null,util['format'](_0x36a1('0x7a'),_0x486b2c['table'],_0x486b2c['joins'][_0x3f614a][_0x36a1('0x7c')],_0x486b2c['joins'][_0x3f614a][_0x36a1('0x77')],_0x486b2c[_0x36a1('0x74')][_0x3f614a][_0x36a1('0x78')]));}}}if(_0x486b2c[_0x36a1('0x7d')]){_0x486b2c[_0x36a1('0x7d')]=JSON[_0x36a1('0x75')](_0x486b2c[_0x36a1('0x7d')]);_0xc27c61[_0x36a1('0x38')](_0x32a541(_0x486b2c['conditions'][_0x36a1('0x61')]));}_0x4d4e19=_0xc27c61[_0x36a1('0x89')]();_0xc27c61[_0x36a1('0x1a')](_0x249205);_0xc27c61[_0x36a1('0x18')](0x0);return;}})[_0x36a1('0x22')](function(){if(_0x508389[_0x36a1('0x8a')]===_0x36a1('0x8b')){return null;}var _0x41ac17=_['merge'](_0x508389,{'name':_0x508389[_0x36a1('0x8c')]||_0x508389[_0x36a1('0x27')]||_0x486b2c[_0x36a1('0x27')],'basename':_0x55ea60,'savename':util[_0x36a1('0x79')](_0x36a1('0x8d'),_0x508389['name']||_0x486b2c[_0x36a1('0x27')],require('randomstring')['generate'](0x4),_0x508389[_0x36a1('0x8a')]||_0x36a1('0x8e')),'reportId':_0x486b2c['id'],'reportType':'custom'});return db[_0x36a1('0x8f')][_0x36a1('0x44')](_0x41ac17,{'raw':!![]});})[_0x36a1('0x22')](function(_0x1a0f6b){if(_0x486b2c[_0x36a1('0x7b')]===_0x36a1('0x90')){_0x4d4e19[_0x36a1('0x38')](_0x486b2c['table']+_0x36a1('0x91'),_0x508389[_0x36a1('0x92')],_0x508389[_0x36a1('0x93')]);}else{_0x4d4e19[_0x36a1('0x38')](_0x486b2c[_0x36a1('0x7b')]+_0x36a1('0x94'),_0x508389[_0x36a1('0x92')],_0x508389[_0x36a1('0x93')]);}if(_0x1a0f6b){logger['info']('Run\x20Query:',_0x4d4e19[_0x36a1('0x7f')]());require('child_process')[_0x36a1('0x95')](path['join'](__dirname,_0x36a1('0x96'),_0x1a0f6b[_0x36a1('0x8a')]),[_0x1a0f6b['id'],_0x4d4e19['toString'](),path[_0x36a1('0x81')](__dirname,_0x36a1('0x97'),_0x1a0f6b[_0x36a1('0x98')]),_0x55ea60]);return _0x1a0f6b;}else{var _0x119afa=squel[_0x36a1('0x6b')]();_0x119afa[_0x36a1('0x6c')]('('+_0x4d4e19['toString']()+')',_0x36a1('0x99'));_0x119afa['field'](_0x36a1('0x9a'),_0x36a1('0x1b'));_0x4d4e19[_0x36a1('0x1a')](_0x508389[_0x36a1('0x1a')]||_0x249205);_0x4d4e19[_0x36a1('0x18')](_0x508389[_0x36a1('0x18')]||0x0);return dbH[_0x36a1('0x80')][_0x36a1('0x30')](_0x119afa[_0x36a1('0x7f')](),{'type':dbH['sequelize'][_0x36a1('0x9b')][_0x36a1('0x9c')]})[_0x36a1('0x22')](function(_0x3354b6){if(!_0x3354b6['length']){_0x42801d=0x0;}else{_0x42801d=_0x3354b6[0x0][_0x36a1('0x1b')]||0x0;}return dbH[_0x36a1('0x80')][_0x36a1('0x30')](_0x4d4e19[_0x36a1('0x7f')](),{'type':dbH[_0x36a1('0x80')][_0x36a1('0x9b')]['SELECT']});})[_0x36a1('0x22')](function(_0x4389ed){return{'rows':_0x4389ed||[],'count':_0x42801d};});}});}exports[_0x36a1('0x9d')]=function(_0xe159c,_0x15ba09){return runReport(_0xe159c[_0x36a1('0x41')],_0xe159c[_0x36a1('0x30')],_0xe159c[_0x36a1('0x3c')])[_0x36a1('0x22')](respondWithResult(_0x15ba09,null))['catch'](handleError(_0x15ba09,null));};exports['runReport']=runReport;exports['query']=function(_0x5c2378,_0x75663c){var _0x8d7f9b=0xa;var _0x4ca0ef=[_0x36a1('0x81'),_0x36a1('0x82'),_0x36a1('0x4d'),_0x36a1('0x4e')];var _0x136686={'SUM':_0x36a1('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x36a1('0x84'),'AVG':_0x36a1('0x85'),'GROUP_CONCAT':_0x36a1('0x52'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x36a1('0x54')};var _0x34da42={'SEC_TO_TIME':_0x36a1('0x55'),'DATE':_0x36a1('0x56'),'HOUR':_0x36a1('0x57'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x36a1('0x59')};var _0x210ff3=function(_0x19c89c){return!_['includes']([_0x36a1('0x5a'),_0x36a1('0x5b'),_0x36a1('0x5c'),_0x36a1('0x5d')],_0x19c89c);};var _0x14bb27=function(_0x4804a2){if(!_0x4804a2||!_0x4804a2[_0x36a1('0x5f')]['length']){return'';}for(var _0x2e136e='(',_0x4a9499=0x0;_0x4a9499<_0x4804a2[_0x36a1('0x5f')][_0x36a1('0x5e')];_0x4a9499+=0x1){_0x4a9499>0x0&&(_0x2e136e+='\x20'+_0x4804a2[_0x36a1('0x60')]+'\x20');_0x2e136e+=_0x4804a2[_0x36a1('0x5f')][_0x4a9499]['group']?_0x14bb27(_0x4804a2[_0x36a1('0x5f')][_0x4a9499]['group']):_0x4804a2['rules'][_0x4a9499]['field']+'\x20'+_0x4804a2[_0x36a1('0x5f')][_0x4a9499][_0x36a1('0x63')]+(_0x210ff3(_0x4804a2[_0x36a1('0x5f')][_0x4a9499][_0x36a1('0x63')])?'\x20'+_0x4804a2[_0x36a1('0x5f')][_0x4a9499][_0x36a1('0x86')]:'');}return _0x2e136e+')';};var _0x27f965={'where':{'id':_0x5c2378[_0x36a1('0x41')]['id']}},_0x47e484,_0x528a9d,_0x5b456c,_0x42cc27,_0x7d75c6;_0x27f965=_['merge']({},_0x27f965,_0x5c2378['options']);return db[_0x36a1('0x2b')][_0x36a1('0x43')](_0x27f965)['then'](function(_0x19bea6){if(_0x19bea6){_0x47e484=_0x19bea6;return _0x19bea6[_0x36a1('0x64')]();}return null;})[_0x36a1('0x22')](function(_0x4438ef){if(_0x4438ef){if(!_0x4438ef[_0x36a1('0x5e')]){throw new db[(_0x36a1('0x65'))][(_0x36a1('0x66'))](_0x36a1('0x67'),0x193);}_0x528a9d=_0x4438ef;return db['AnalyticMetric'][_0x36a1('0x69')]({'raw':!![]});}return null;})[_0x36a1('0x22')](function(_0x2801dd){if(_0x2801dd){_0x5b456c=_[_0x36a1('0x6a')](_0x2801dd,'id');var _0x12518c;var _0x5dff3f=squel[_0x36a1('0x6b')]();_0x5dff3f[_0x36a1('0x6c')](_0x47e484[_0x36a1('0x7b')]);for(var _0x534074=0x0;_0x534074<_0x528a9d['length'];_0x534074+=0x1){_0x12518c=_0x528a9d[_0x534074][_0x36a1('0x6d')]?_0x5b456c[_0x528a9d[_0x534074][_0x36a1('0x6d')]]['metric']:_0x528a9d[_0x534074][_0x36a1('0x62')];_0x12518c=_0x528a9d[_0x534074]['function']?_[_0x36a1('0x6f')](_0x136686[_0x528a9d[_0x534074][_0x36a1('0x70')]],'%s',_0x12518c):_0x12518c;_0x12518c=_0x528a9d[_0x534074][_0x36a1('0x79')]?_[_0x36a1('0x6f')](_0x34da42[_0x528a9d[_0x534074]['format']],'%s',_0x12518c):_0x12518c;if(_0x528a9d[_0x534074][_0x36a1('0x71')]){_0x5dff3f['group'](_0x12518c);}_0x528a9d[_0x534074][_0x36a1('0x72')]&&_0x5dff3f[_0x36a1('0x87')](_0x12518c,_0x528a9d[_0x534074][_0x36a1('0x72')]===_0x36a1('0x88')?![]:!![]);_0x5dff3f[_0x36a1('0x62')](_0x12518c,_0x528a9d[_0x534074][_0x36a1('0x73')]||_0x12518c);}if(_0x47e484[_0x36a1('0x74')]){_0x47e484['joins']=JSON[_0x36a1('0x75')](_0x47e484[_0x36a1('0x74')]);for(var _0xade88e=0x0;_0xade88e<_0x47e484[_0x36a1('0x74')]['length'];_0xade88e+=0x1){if(_0x47e484[_0x36a1('0x74')][_0xade88e][_0x36a1('0x2e')]&&_[_0x36a1('0x76')](_0x4ca0ef,_0x47e484['joins'][_0xade88e]['type'])&&_0x47e484['joins'][_0xade88e][_0x36a1('0x7c')]&&_0x47e484[_0x36a1('0x74')][_0xade88e][_0x36a1('0x77')]&&_0x47e484[_0x36a1('0x74')][_0xade88e][_0x36a1('0x78')]){_0x5dff3f[_0x47e484[_0x36a1('0x74')][_0xade88e]['type']](_0x47e484['joins'][_0xade88e][_0x36a1('0x77')],null,util['format'](_0x36a1('0x7a'),_0x47e484[_0x36a1('0x7b')],_0x47e484[_0x36a1('0x74')][_0xade88e]['parentKey'],_0x47e484[_0x36a1('0x74')][_0xade88e][_0x36a1('0x77')],_0x47e484['joins'][_0xade88e][_0x36a1('0x78')]));}}}if(_0x47e484[_0x36a1('0x7d')]){_0x47e484['conditions']=JSON[_0x36a1('0x75')](_0x47e484['conditions']);_0x5dff3f[_0x36a1('0x38')](_0x14bb27(_0x47e484[_0x36a1('0x7d')][_0x36a1('0x61')]));}_0x7d75c6=_0x5dff3f[_0x36a1('0x89')]();_0x5dff3f[_0x36a1('0x1a')](_0x8d7f9b);_0x5dff3f[_0x36a1('0x18')](0x0);logger[_0x36a1('0x7e')](_0x36a1('0x9e'),_0x5dff3f[_0x36a1('0x7f')]());return dbH[_0x36a1('0x80')][_0x36a1('0x30')](_0x5dff3f['toString'](),{'type':dbH[_0x36a1('0x80')][_0x36a1('0x9b')][_0x36a1('0x9c')]});}})[_0x36a1('0x22')](function(){return{'sql':_0x7d75c6[_0x36a1('0x7f')]()};})['then'](respondWithResult(_0x75663c,null))['catch'](handleError(_0x75663c,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 3ef3a90..cde25e7 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 _0xa375=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x18abe8,_0x2f7d4c){var _0xef4f51=function(_0x9ee6c){while(--_0x9ee6c){_0x18abe8['push'](_0x18abe8['shift']());}};_0xef4f51(++_0x2f7d4c);}(_0xa375,0x8f));var _0x5a37=function(_0x23e33d,_0x31c8c8){_0x23e33d=_0x23e33d-0x0;var _0x818fc=_0xa375[_0x23e33d];return _0x818fc;};'use strict';var _=require(_0x5a37('0x0'));var util=require(_0x5a37('0x1'));var logger=require(_0x5a37('0x2'))('api');var moment=require(_0x5a37('0x3'));var BPromise=require(_0x5a37('0x4'));var rp=require(_0x5a37('0x5'));var fs=require('fs');var path=require(_0x5a37('0x6'));var rimraf=require('rimraf');var config=require(_0x5a37('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x5a37('0x8')]=function(_0x1be034,_0xc3bced){return _0x1be034[_0x5a37('0x9')](_0x5a37('0xa'),attributes,{'tableName':_0x5a37('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3cf=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','request-promise','path'];(function(_0x495f5e,_0x505cba){var _0x1a1669=function(_0x4c169b){while(--_0x4c169b){_0x495f5e['push'](_0x495f5e['shift']());}};_0x1a1669(++_0x505cba);}(_0xe3cf,0x103));var _0xfe3c=function(_0x242054,_0x36cd5a){_0x242054=_0x242054-0x0;var _0x2d5b33=_0xe3cf[_0x242054];return _0x2d5b33;};'use strict';var _=require(_0xfe3c('0x0'));var util=require(_0xfe3c('0x1'));var logger=require(_0xfe3c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfe3c('0x3'));var fs=require('fs');var path=require(_0xfe3c('0x4'));var rimraf=require(_0xfe3c('0x5'));var config=require(_0xfe3c('0x6'));var attributes=require(_0xfe3c('0x7'));module[_0xfe3c('0x8')]=function(_0x553928,_0x1b29e8){return _0x553928['define'](_0xfe3c('0x9'),attributes,{'tableName':_0xfe3c('0xa'),'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 e1ba865..a5be8f9 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 _0x99f5=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x356dcc,_0x51f8f7){var _0xe6c019=function(_0xc0710d){while(--_0xc0710d){_0x356dcc['push'](_0x356dcc['shift']());}};_0xe6c019(++_0x51f8f7);}(_0x99f5,0x175));var _0x599f=function(_0x42c1a0,_0x268813){_0x42c1a0=_0x42c1a0-0x0;var _0x2f984b=_0x99f5[_0x42c1a0];return _0x2f984b;};'use strict';var _=require(_0x599f('0x0'));var util=require(_0x599f('0x1'));var moment=require(_0x599f('0x2'));var BPromise=require(_0x599f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x599f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x599f('0x5'));var logger=require(_0x599f('0x6'))(_0x599f('0x7'));var config=require(_0x599f('0x8'));var jayson=require(_0x599f('0x9'));var client=jayson[_0x599f('0xa')][_0x599f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2709d3,_0xf96e62,_0x2e6052){return new BPromise(function(_0x373ee2,_0x11a192){return client[_0x599f('0xc')](_0x2709d3,_0x2e6052)[_0x599f('0xd')](function(_0x36b7d0){logger[_0x599f('0xe')](_0x599f('0xf'),_0xf96e62,_0x599f('0x10'));logger[_0x599f('0x11')](_0x599f('0x12'),_0xf96e62,'request\x20sent',JSON[_0x599f('0x13')](_0x36b7d0));if(_0x36b7d0['error']){if(_0x36b7d0[_0x599f('0x14')][_0x599f('0x15')]===0x1f4){logger[_0x599f('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0xf96e62,_0x36b7d0[_0x599f('0x14')][_0x599f('0x16')]);return _0x11a192(_0x36b7d0['error']['message']);}logger[_0x599f('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0xf96e62,_0x36b7d0['error'][_0x599f('0x16')]);return _0x373ee2(_0x36b7d0[_0x599f('0x14')]['message']);}else{logger[_0x599f('0xe')](_0x599f('0xf'),_0xf96e62,_0x599f('0x10'));_0x373ee2(_0x36b7d0[_0x599f('0x17')][_0x599f('0x16')]);}})['catch'](function(_0x1aed8f){logger[_0x599f('0x14')](_0x599f('0xf'),_0xf96e62,_0x1aed8f);_0x11a192(_0x1aed8f);});});} \ No newline at end of file +var _0x8f9a=['stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x160606,_0x38d60b){var _0x3457e6=function(_0x3dadfa){while(--_0x3dadfa){_0x160606['push'](_0x160606['shift']());}};_0x3457e6(++_0x38d60b);}(_0x8f9a,0x16b));var _0xa8f9=function(_0x3fd073,_0x32931f){_0x3fd073=_0x3fd073-0x0;var _0x40d7b1=_0x8f9a[_0x3fd073];return _0x40d7b1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa8f9('0x0'));var BPromise=require(_0xa8f9('0x1'));var rs=require(_0xa8f9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa8f9('0x3'))['db'];var utils=require(_0xa8f9('0x4'));var logger=require(_0xa8f9('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa8f9('0x6'));var client=jayson['client'][_0xa8f9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e5262,_0x4acf8c,_0x45107e){return new BPromise(function(_0x47b24d,_0x3b219d){return client[_0xa8f9('0x8')](_0x4e5262,_0x45107e)[_0xa8f9('0x9')](function(_0x34410d){logger[_0xa8f9('0xa')](_0xa8f9('0xb'),_0x4acf8c,'request\x20sent');logger[_0xa8f9('0xc')](_0xa8f9('0xd'),_0x4acf8c,_0xa8f9('0xe'),JSON[_0xa8f9('0xf')](_0x34410d));if(_0x34410d[_0xa8f9('0x10')]){if(_0x34410d[_0xa8f9('0x10')][_0xa8f9('0x11')]===0x1f4){logger[_0xa8f9('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4acf8c,_0x34410d['error'][_0xa8f9('0x12')]);return _0x3b219d(_0x34410d[_0xa8f9('0x10')][_0xa8f9('0x12')]);}logger[_0xa8f9('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4acf8c,_0x34410d['error']['message']);return _0x47b24d(_0x34410d[_0xa8f9('0x10')][_0xa8f9('0x12')]);}else{logger[_0xa8f9('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4acf8c,_0xa8f9('0xe'));_0x47b24d(_0x34410d[_0xa8f9('0x13')]['message']);}})[_0xa8f9('0x14')](function(_0x5a63d7){logger[_0xa8f9('0x10')](_0xa8f9('0xb'),_0x4acf8c,_0x5a63d7);_0x3b219d(_0x5a63d7);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 3ed6e51..78f7f2d 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 _0x4ce7=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','create','put','update','exports'];(function(_0x88d090,_0xc4e820){var _0x50c8cf=function(_0x2ebded){while(--_0x2ebded){_0x88d090['push'](_0x88d090['shift']());}};_0x50c8cf(++_0xc4e820);}(_0x4ce7,0x1e4));var _0x74ce=function(_0x2e9c2d,_0x209f38){_0x2e9c2d=_0x2e9c2d-0x0;var _0x162ed1=_0x4ce7[_0x2e9c2d];return _0x162ed1;};'use strict';var multer=require(_0x74ce('0x0'));var util=require(_0x74ce('0x1'));var path=require(_0x74ce('0x2'));var timeout=require('connect-timeout');var express=require(_0x74ce('0x3'));var router=express[_0x74ce('0x4')]();var fs_extra=require(_0x74ce('0x5'));var auth=require(_0x74ce('0x6'));var interaction=require(_0x74ce('0x7'));var config=require(_0x74ce('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x74ce('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x74ce('0x9')](_0x74ce('0xa'),auth[_0x74ce('0xb')](),controller[_0x74ce('0xc')]);router[_0x74ce('0x9')](_0x74ce('0xd'),auth[_0x74ce('0xb')](),controller[_0x74ce('0xe')]);router['get'](_0x74ce('0xf'),auth[_0x74ce('0xb')](),controller['run']);router['get'](_0x74ce('0x10'),auth[_0x74ce('0xb')](),controller[_0x74ce('0x11')]);router['post']('/',auth[_0x74ce('0xb')](),controller[_0x74ce('0x12')]);router[_0x74ce('0x13')](_0x74ce('0xa'),auth[_0x74ce('0xb')](),controller[_0x74ce('0x14')]);router['delete']('/:id',auth[_0x74ce('0xb')](),controller['destroy']);module[_0x74ce('0x15')]=router; \ No newline at end of file +var _0x097c=['update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','post','put'];(function(_0x4b51aa,_0x2d363e){var _0x586b66=function(_0x310d73){while(--_0x310d73){_0x4b51aa['push'](_0x4b51aa['shift']());}};_0x586b66(++_0x2d363e);}(_0x097c,0x168));var _0xc097=function(_0xba7682,_0x47231f){_0xba7682=_0xba7682-0x0;var _0x52ad33=_0x097c[_0xba7682];return _0x52ad33;};'use strict';var multer=require(_0xc097('0x0'));var util=require(_0xc097('0x1'));var path=require(_0xc097('0x2'));var timeout=require(_0xc097('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc097('0x4'));var auth=require(_0xc097('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc097('0x6'));var controller=require(_0xc097('0x7'));router[_0xc097('0x8')]('/',auth[_0xc097('0x9')](),controller[_0xc097('0xa')]);router[_0xc097('0x8')](_0xc097('0xb'),auth[_0xc097('0x9')](),controller['show']);router[_0xc097('0x8')](_0xc097('0xc'),auth['isAuthenticated'](),controller[_0xc097('0xd')]);router['get'](_0xc097('0xe'),auth['isAuthenticated'](),controller[_0xc097('0xf')]);router['get']('/:id/query',auth['isAuthenticated'](),controller['query']);router[_0xc097('0x10')]('/',auth[_0xc097('0x9')](),controller['create']);router[_0xc097('0x11')]('/:id',auth[_0xc097('0x9')](),controller[_0xc097('0x12')]);router[_0xc097('0x13')](_0xc097('0xb'),auth[_0xc097('0x9')](),controller[_0xc097('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 696da73..6d877c6 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 _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x83b4e,_0x47c407){var _0x2beec8=function(_0x48848f){while(--_0x48848f){_0x83b4e['push'](_0x83b4e['shift']());}};_0x2beec8(++_0x47c407);}(_0x5fab,0x177));var _0xb5fa=function(_0x4d6624,_0x78b606){_0x4d6624=_0x4d6624-0x0;var _0x5dbb01=_0x5fab[_0x4d6624];return _0x5dbb01;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}}; \ No newline at end of file +var _0x2675=['sequelize','STRING','TEXT'];(function(_0x4f431d,_0xd51a3b){var _0x4f31e1=function(_0x1c688d){while(--_0x1c688d){_0x4f431d['push'](_0x4f431d['shift']());}};_0x4f31e1(++_0xd51a3b);}(_0x2675,0x75));var _0x5267=function(_0x1319e6,_0xbac853){_0x1319e6=_0x1319e6-0x0;var _0x14ec6b=_0x2675[_0x1319e6];return _0x14ec6b;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index b47edc5..96c252d 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 _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','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','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xabce[_0x433a86];return _0x23000c;};'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'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));}; \ No newline at end of file +var _0xdc97=['startDate','toString','../../components/export/','savename','COUNT(*)','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','DefaultReports','UserProfileResource','error','stack','name','map','AnalyticDefaultReport','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','condition','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','join','SUM(%s)','COUNT(%s)','value','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','clone','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','default','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc97,0x13b));var _0x7dc9=function(_0x36f32e,_0x485452){_0x36f32e=_0x36f32e-0x0;var _0x491c76=_0xdc97[_0x36f32e];return _0x491c76;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x7dc9('0x16')];function respondWithStatusCode(_0x14e5db,_0x5c6ca5){_0x5c6ca5=_0x5c6ca5||0xcc;return function(_0xbd06be){if(_0xbd06be){return _0x14e5db[_0x7dc9('0x17')](_0x5c6ca5);}return _0x14e5db[_0x7dc9('0x18')](_0x5c6ca5)[_0x7dc9('0x19')]();};}function respondWithResult(_0x31d43d,_0x11af93){_0x11af93=_0x11af93||0xc8;return function(_0x524d09){if(_0x524d09){return _0x31d43d[_0x7dc9('0x18')](_0x11af93)[_0x7dc9('0x1a')](_0x524d09);}};}function respondWithFilteredResult(_0x1b0aa1,_0x442819){return function(_0x11606f){if(_0x11606f){var _0xbe0437=typeof _0x442819[_0x7dc9('0x1b')]===_0x7dc9('0x1c')&&typeof _0x442819[_0x7dc9('0x1d')]==='undefined';var _0x22577e=_0x11606f['count'];var _0x1f5906=_0xbe0437?0x0:_0x442819[_0x7dc9('0x1b')];var _0x5d61d7=_0xbe0437?_0x11606f[_0x7dc9('0x1e')]:_0x442819[_0x7dc9('0x1b')]+_0x442819[_0x7dc9('0x1d')];var _0x4b2703;if(_0x5d61d7>=_0x22577e){_0x5d61d7=_0x22577e;_0x4b2703=0xc8;}else{_0x4b2703=0xce;}_0x1b0aa1[_0x7dc9('0x18')](_0x4b2703);return _0x1b0aa1[_0x7dc9('0x1f')](_0x7dc9('0x20'),_0x1f5906+'-'+_0x5d61d7+'/'+_0x22577e)[_0x7dc9('0x1a')](_0x11606f);}return null;};}function patchUpdates(_0x155cc4){return function(_0x2b38d6){try{jsonpatch['apply'](_0x2b38d6,_0x155cc4,!![]);}catch(_0x593e60){return BPromise[_0x7dc9('0x21')](_0x593e60);}return _0x2b38d6[_0x7dc9('0x22')]();};}function saveUpdates(_0x596e0f,_0x349001){return function(_0x27f7fa){if(_0x27f7fa){return _0x27f7fa['update'](_0x596e0f)[_0x7dc9('0x23')](function(_0x43d31f){return _0x43d31f;});}return null;};}function removeEntity(_0x41110a,_0x4906b1){return function(_0x424763){if(_0x424763){return _0x424763[_0x7dc9('0x24')]()[_0x7dc9('0x23')](function(){var _0x55a482=_0x424763['get']({'plain':!![]});var _0x4b9ba6=_0x7dc9('0x25');return db[_0x7dc9('0x26')]['destroy']({'where':{'type':_0x4b9ba6,'resourceId':_0x55a482['id']}})['then'](function(){return _0x424763;});})[_0x7dc9('0x23')](function(){_0x41110a['status'](0xcc)[_0x7dc9('0x19')]();});}};}function handleEntityNotFound(_0x1c690b,_0x3a74a0){return function(_0x3e4102){if(!_0x3e4102){_0x1c690b[_0x7dc9('0x17')](0x194);}return _0x3e4102;};}function handleError(_0x450124,_0x236d42){_0x236d42=_0x236d42||0x1f4;return function(_0x229f8e){logger[_0x7dc9('0x27')](_0x229f8e[_0x7dc9('0x28')]);if(_0x229f8e[_0x7dc9('0x29')]){delete _0x229f8e[_0x7dc9('0x29')];}_0x450124['status'](_0x236d42)['send'](_0x229f8e);};}exports['index']=function(_0x49a4a5,_0x4a68f0){var _0x553a03={},_0x58c4e8={},_0x59f5d8={'count':0x0,'rows':[]};var _0x4463dc=_[_0x7dc9('0x2a')](db[_0x7dc9('0x2b')][_0x7dc9('0x2c')],function(_0x3300ff){return{'name':_0x3300ff[_0x7dc9('0x2d')],'type':_0x3300ff['type']['key']};});_0x58c4e8['model']=_[_0x7dc9('0x2a')](_0x4463dc,'name');_0x58c4e8[_0x7dc9('0x2e')]=_[_0x7dc9('0x2f')](_0x49a4a5[_0x7dc9('0x2e')]);_0x58c4e8[_0x7dc9('0x30')]=_[_0x7dc9('0x31')](_0x58c4e8[_0x7dc9('0x32')],_0x58c4e8[_0x7dc9('0x2e')]);_0x553a03[_0x7dc9('0x33')]=_['intersection'](_0x58c4e8[_0x7dc9('0x32')],qs['fields'](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x34')]));_0x553a03[_0x7dc9('0x33')]=_0x553a03[_0x7dc9('0x33')]['length']?_0x553a03[_0x7dc9('0x33')]:_0x58c4e8['model'];if(!_0x49a4a5[_0x7dc9('0x2e')]['hasOwnProperty']('nolimit')){_0x553a03[_0x7dc9('0x1d')]=qs[_0x7dc9('0x1d')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x1d')]);_0x553a03['offset']=qs[_0x7dc9('0x1b')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x1b')]);}_0x553a03[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x553a03[_0x7dc9('0x37')]=qs[_0x7dc9('0x30')](_[_0x7dc9('0x38')](_0x49a4a5[_0x7dc9('0x2e')],_0x58c4e8[_0x7dc9('0x30')]),_0x4463dc);if(_0x49a4a5['query'][_0x7dc9('0x39')]){_0x553a03[_0x7dc9('0x37')]=_[_0x7dc9('0x3a')](_0x553a03[_0x7dc9('0x37')],{'$or':_['map'](_0x4463dc,function(_0x3492e6){if(_0x3492e6[_0x7dc9('0x3b')]!==_0x7dc9('0x3c')){var _0x3876b6={};_0x3876b6[_0x3492e6[_0x7dc9('0x29')]]={'$like':'%'+_0x49a4a5[_0x7dc9('0x2e')]['filter']+'%'};return _0x3876b6;}})});}_0x553a03=_['merge']({},_0x553a03,_0x49a4a5[_0x7dc9('0x3d')]);var _0x36a965={'where':_0x553a03['where']};return db[_0x7dc9('0x2b')]['count'](_0x36a965)[_0x7dc9('0x23')](function(_0x2a91fe){_0x59f5d8[_0x7dc9('0x1e')]=_0x2a91fe;if(_0x49a4a5['query'][_0x7dc9('0x3e')]){_0x553a03[_0x7dc9('0x3f')]=[{'all':!![]}];}return db[_0x7dc9('0x2b')][_0x7dc9('0x40')](_0x553a03);})[_0x7dc9('0x23')](function(_0x23499a){_0x59f5d8[_0x7dc9('0x41')]=_0x23499a;return _0x59f5d8;})['then'](respondWithFilteredResult(_0x4a68f0,_0x553a03))[_0x7dc9('0x42')](handleError(_0x4a68f0,null));};exports['show']=function(_0x52d883,_0xcced6c){var _0x294276={'raw':!![],'where':{'id':_0x52d883[_0x7dc9('0x43')]['id']}},_0x18c8a1={};_0x18c8a1[_0x7dc9('0x32')]=_[_0x7dc9('0x2f')](db[_0x7dc9('0x2b')][_0x7dc9('0x2c')]);_0x18c8a1[_0x7dc9('0x2e')]=_['keys'](_0x52d883[_0x7dc9('0x2e')]);_0x18c8a1[_0x7dc9('0x30')]=_[_0x7dc9('0x31')](_0x18c8a1[_0x7dc9('0x32')],_0x18c8a1[_0x7dc9('0x2e')]);_0x294276[_0x7dc9('0x33')]=_['intersection'](_0x18c8a1[_0x7dc9('0x32')],qs[_0x7dc9('0x34')](_0x52d883['query'][_0x7dc9('0x34')]));_0x294276[_0x7dc9('0x33')]=_0x294276[_0x7dc9('0x33')]['length']?_0x294276[_0x7dc9('0x33')]:_0x18c8a1['model'];if(_0x52d883['query'][_0x7dc9('0x3e')]){_0x294276[_0x7dc9('0x3f')]=[{'all':!![]}];}_0x294276=_[_0x7dc9('0x3a')]({},_0x294276,_0x52d883['options']);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x294276)['then'](handleEntityNotFound(_0xcced6c,null))[_0x7dc9('0x23')](respondWithResult(_0xcced6c,null))[_0x7dc9('0x42')](handleError(_0xcced6c,null));};exports['create']=function(_0x24ccce,_0x1d6c0a){return db[_0x7dc9('0x2b')][_0x7dc9('0x45')](_0x24ccce[_0x7dc9('0x46')],{})[_0x7dc9('0x23')](function(_0x86739f){var _0x3a1102=_0x24ccce[_0x7dc9('0x47')][_0x7dc9('0x48')]({'plain':!![]});if(!_0x3a1102)throw new Error(_0x7dc9('0x49'));if(_0x3a1102[_0x7dc9('0x4a')]===_0x7dc9('0x47')){var _0x59be9b=_0x86739f[_0x7dc9('0x48')]({'plain':!![]});var _0x4fcfd5='Reports';return db[_0x7dc9('0x4b')][_0x7dc9('0x44')]({'where':{'name':_0x4fcfd5,'userProfileId':_0x3a1102[_0x7dc9('0x4c')]},'raw':!![]})[_0x7dc9('0x23')](function(_0x346d27){if(_0x346d27&&_0x346d27['autoAssociation']===0x0){return db[_0x7dc9('0x26')][_0x7dc9('0x45')]({'name':_0x59be9b[_0x7dc9('0x29')],'resourceId':_0x59be9b['id'],'type':'DefaultReports','sectionId':_0x346d27['id']},{})[_0x7dc9('0x23')](function(){return _0x86739f;});}else{return _0x86739f;}})[_0x7dc9('0x42')](function(_0x2cf133){logger[_0x7dc9('0x27')](_0x7dc9('0x4d'),_0x2cf133);throw _0x2cf133;});}return _0x86739f;})[_0x7dc9('0x23')](respondWithResult(_0x1d6c0a,0xc9))['catch'](handleError(_0x1d6c0a,null));};exports[_0x7dc9('0x4e')]=function(_0x2ecc80,_0x2b0941){if(_0x2ecc80[_0x7dc9('0x46')]['id']){delete _0x2ecc80[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x2b')][_0x7dc9('0x44')]({'where':{'id':_0x2ecc80[_0x7dc9('0x43')]['id']}})[_0x7dc9('0x23')](handleEntityNotFound(_0x2b0941,null))[_0x7dc9('0x23')](saveUpdates(_0x2ecc80[_0x7dc9('0x46')],null))[_0x7dc9('0x23')](respondWithResult(_0x2b0941,null))['catch'](handleError(_0x2b0941,null));};exports[_0x7dc9('0x24')]=function(_0x39be46,_0x38df9a){return db[_0x7dc9('0x2b')][_0x7dc9('0x44')]({'where':{'id':_0x39be46['params']['id']}})[_0x7dc9('0x23')](handleEntityNotFound(_0x38df9a,null))[_0x7dc9('0x23')](removeEntity(_0x38df9a,null))[_0x7dc9('0x42')](handleError(_0x38df9a,null));};exports[_0x7dc9('0x4f')]=function(_0x2a1db8,_0x2f01a0){var _0x495a06=0xa;var _0x547caa=['join',_0x7dc9('0x50'),_0x7dc9('0x51'),_0x7dc9('0x52')];var _0x2afefc={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7dc9('0x53'),'MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':_0x7dc9('0x56'),'GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':_0x7dc9('0x59')};var _0x4905f6={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':_0x7dc9('0x5b'),'HOUR':_0x7dc9('0x5c'),'ROUND':_0x7dc9('0x5d'),'UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x4bbf8b=function(_0x175858){return!_[_0x7dc9('0x5f')]([_0x7dc9('0x60'),_0x7dc9('0x61'),_0x7dc9('0x62'),_0x7dc9('0x63')],_0x175858);};var _0x286ac5=function(_0x2a02ed){if(!_0x2a02ed||!_0x2a02ed[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x19c209='(',_0xf3ae59=0x0;_0xf3ae59<_0x2a02ed[_0x7dc9('0x64')]['length'];_0xf3ae59+=0x1){_0xf3ae59>0x0&&(_0x19c209+='\x20'+_0x2a02ed[_0x7dc9('0x66')]+'\x20');_0x19c209+=_0x2a02ed['rules'][_0xf3ae59][_0x7dc9('0x67')]?_0x286ac5(_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59]['group']):_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59][_0x7dc9('0x68')]+'\x20'+_0x2a02ed['rules'][_0xf3ae59][_0x7dc9('0x69')]+(_0x4bbf8b(_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59][_0x7dc9('0x69')])?'\x20'+_0x2a02ed['rules'][_0xf3ae59]['value']:'');}return _0x19c209+')';};var _0x205d01={'where':{'id':_0x2a1db8[_0x7dc9('0x43')]['id']}},_0x366d4d,_0x4ed60e,_0x3aba59,_0x15d02f,_0x2bbf61;_0x205d01=_[_0x7dc9('0x3a')]({},_0x205d01,_0x2a1db8[_0x7dc9('0x3d')]);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x205d01)[_0x7dc9('0x23')](function(_0x3f81dd){if(_0x3f81dd){_0x366d4d=_0x3f81dd;return _0x3f81dd['getFields']();}return null;})['then'](function(_0x1b2369){if(_0x1b2369){if(!_0x1b2369[_0x7dc9('0x65')]){throw new db[(_0x7dc9('0x6a'))][(_0x7dc9('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ed60e=_0x1b2369;return db['AnalyticMetric'][_0x7dc9('0x40')]({'raw':!![]});}return null;})[_0x7dc9('0x23')](function(_0x25f8b3){if(_0x25f8b3){_0x3aba59=_[_0x7dc9('0x6c')](_0x25f8b3,'id');var _0x5d211b;var _0xea1728=squel[_0x7dc9('0x6d')]();_0xea1728[_0x7dc9('0x6e')](_0x366d4d[_0x7dc9('0x6f')]);for(var _0x19e0b1=0x0;_0x19e0b1<_0x4ed60e[_0x7dc9('0x65')];_0x19e0b1+=0x1){_0x5d211b=_0x4ed60e[_0x19e0b1][_0x7dc9('0x70')]?_0x3aba59[_0x4ed60e[_0x19e0b1]['MetricId']][_0x7dc9('0x71')]:_0x4ed60e[_0x19e0b1][_0x7dc9('0x68')];_0x5d211b=_0x4ed60e[_0x19e0b1]['function']?_['replace'](_0x2afefc[_0x4ed60e[_0x19e0b1][_0x7dc9('0x72')]],'%s',_0x5d211b):_0x5d211b;_0x5d211b=_0x4ed60e[_0x19e0b1]['format']?_[_0x7dc9('0x73')](_0x4905f6[_0x4ed60e[_0x19e0b1][_0x7dc9('0x74')]],'%s',_0x5d211b):_0x5d211b;if(_0x4ed60e[_0x19e0b1][_0x7dc9('0x75')]){_0xea1728[_0x7dc9('0x67')](_0x5d211b);}_0x4ed60e[_0x19e0b1][_0x7dc9('0x76')]&&_0xea1728[_0x7dc9('0x35')](_0x5d211b,_0x4ed60e[_0x19e0b1][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0xea1728[_0x7dc9('0x68')](_0x5d211b,_0x4ed60e[_0x19e0b1][_0x7dc9('0x78')]||_0x5d211b);}if(_0x366d4d['joins']){_0x366d4d[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x366d4d[_0x7dc9('0x79')]);for(var _0x499393=0x0;_0x499393<_0x366d4d[_0x7dc9('0x79')]['length'];_0x499393+=0x1){if(_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')]&&_[_0x7dc9('0x5f')](_0x547caa,_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')])&&_0x366d4d['joins'][_0x499393]['parentKey']&&_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7b')]&&_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7c')]){_0xea1728[_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')]](_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7b')],null,util[_0x7dc9('0x74')](_0x7dc9('0x7d'),_0x366d4d[_0x7dc9('0x6f')],_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7e')],_0x366d4d['joins'][_0x499393]['foreignTable'],_0x366d4d[_0x7dc9('0x79')][_0x499393]['foreignKey']));}}}if(_0x366d4d[_0x7dc9('0x7f')]){_0x366d4d[_0x7dc9('0x7f')]=JSON[_0x7dc9('0x7a')](_0x366d4d[_0x7dc9('0x7f')]);_0xea1728['where'](_0x286ac5(_0x366d4d[_0x7dc9('0x7f')][_0x7dc9('0x67')]));}_0x2bbf61=_0xea1728['clone']();_0xea1728[_0x7dc9('0x1d')](_0x495a06);_0xea1728[_0x7dc9('0x1b')](0x0);logger[_0x7dc9('0x80')](_0x7dc9('0x81'),_0xea1728['toString']());return dbH[_0x7dc9('0x82')][_0x7dc9('0x2e')](_0xea1728['toString'](),{'type':dbH['sequelize'][_0x7dc9('0x83')][_0x7dc9('0x84')]});}})['then'](respondWithResult(_0x2f01a0,null))[_0x7dc9('0x42')](handleError(_0x2f01a0,null));};function runReport(_0x5f08f6,_0x2e7296,_0x1d0722){var _0x1acdba=_0x2e7296['name'];var _0x33d68c=0xa;var _0x3c7daf=[_0x7dc9('0x85'),'left_join',_0x7dc9('0x51'),'cross_join'];var _0x5761cb={'SUM':_0x7dc9('0x86'),'COUNT':_0x7dc9('0x87'),'COUNT DISTINCT':_0x7dc9('0x53'),'MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':_0x7dc9('0x59')};var _0x2dc92e={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':'DATE(%s)','HOUR':_0x7dc9('0x5c'),'ROUND':_0x7dc9('0x5d'),'UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x200df7=function(_0x53c992){return!_[_0x7dc9('0x5f')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x7dc9('0x62'),'IS\x20NOT\x20EMPTY'],_0x53c992);};var _0x21da79=function(_0x476a24){if(!_0x476a24||!_0x476a24[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x38dccc='(',_0xc716c3=0x0;_0xc716c3<_0x476a24['rules'][_0x7dc9('0x65')];_0xc716c3+=0x1){_0xc716c3>0x0&&(_0x38dccc+='\x20'+_0x476a24[_0x7dc9('0x66')]+'\x20');_0x38dccc+=_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x67')]?_0x21da79(_0x476a24[_0x7dc9('0x64')][_0xc716c3]['group']):_0x476a24[_0x7dc9('0x64')][_0xc716c3]['field']+'\x20'+_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x69')]+(_0x200df7(_0x476a24[_0x7dc9('0x64')][_0xc716c3]['condition'])?'\x20'+_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x88')]:'');}return _0x38dccc+')';};var _0x5e8806={'where':{'id':_0x5f08f6['id']}},_0x1a9c7e,_0x3f8839,_0xf74b6,_0x2b3d46,_0x5c466d;_0x5e8806=_[_0x7dc9('0x3a')]({},_0x5e8806,_0x1d0722);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x5e8806)[_0x7dc9('0x23')](function(_0x3e06b3){if(_0x3e06b3){_0x1a9c7e=_0x3e06b3;return _0x3e06b3['getFields']();}return null;})[_0x7dc9('0x23')](function(_0x4588a7){if(_0x4588a7){if(!_0x4588a7[_0x7dc9('0x65')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7dc9('0x89'),0x193);}_0x3f8839=_0x4588a7;return db[_0x7dc9('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xb0c228){if(_0xb0c228){_0xf74b6=_[_0x7dc9('0x6c')](_0xb0c228,'id');var _0x5f3487;var _0x29c228=squel['select']();_0x29c228[_0x7dc9('0x6e')](_0x1a9c7e[_0x7dc9('0x6f')]);for(var _0x235473=0x0;_0x235473<_0x3f8839[_0x7dc9('0x65')];_0x235473+=0x1){_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x70')]?_0xf74b6[_0x3f8839[_0x235473][_0x7dc9('0x70')]]['metric']:_0x3f8839[_0x235473][_0x7dc9('0x68')];_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x72')]?_[_0x7dc9('0x73')](_0x5761cb[_0x3f8839[_0x235473][_0x7dc9('0x72')]],'%s',_0x5f3487):_0x5f3487;_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x74')]?_['replace'](_0x2dc92e[_0x3f8839[_0x235473][_0x7dc9('0x74')]],'%s',_0x5f3487):_0x5f3487;if(_0x3f8839[_0x235473][_0x7dc9('0x75')]){_0x29c228[_0x7dc9('0x67')](_0x5f3487);}_0x3f8839[_0x235473][_0x7dc9('0x76')]&&_0x29c228['order'](_0x5f3487,_0x3f8839[_0x235473][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0x29c228['field'](_0x5f3487,_0x3f8839[_0x235473][_0x7dc9('0x78')]||_0x5f3487);}if(_0x1a9c7e['joins']){_0x1a9c7e[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x1a9c7e[_0x7dc9('0x79')]);for(var _0x4173c2=0x0;_0x4173c2<_0x1a9c7e[_0x7dc9('0x79')][_0x7dc9('0x65')];_0x4173c2+=0x1){if(_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')]&&_['includes'](_0x3c7daf,_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')])&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7e')]&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2]['foreignTable']&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7c')]){_0x29c228[_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')]](_0x1a9c7e['joins'][_0x4173c2][_0x7dc9('0x7b')],null,util['format'](_0x7dc9('0x7d'),_0x1a9c7e['table'],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7e')],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7b')],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7c')]));}}}if(_0x1a9c7e[_0x7dc9('0x7f')]){_0x1a9c7e[_0x7dc9('0x7f')]=JSON[_0x7dc9('0x7a')](_0x1a9c7e[_0x7dc9('0x7f')]);_0x29c228[_0x7dc9('0x37')](_0x21da79(_0x1a9c7e[_0x7dc9('0x7f')]['group']));}_0x5c466d=_0x29c228[_0x7dc9('0x8b')]();_0x29c228[_0x7dc9('0x1d')](_0x33d68c);_0x29c228[_0x7dc9('0x1b')](0x0);return;}})[_0x7dc9('0x23')](function(){if(_0x2e7296['output']===_0x7dc9('0x8c')){return null;}var _0x35e061=_[_0x7dc9('0x3a')](_0x2e7296,{'name':_0x2e7296[_0x7dc9('0x8d')]||_0x2e7296['name']||_0x1a9c7e[_0x7dc9('0x29')],'basename':_0x1acdba,'savename':util[_0x7dc9('0x74')](_0x7dc9('0x8e'),_0x2e7296['name']||_0x1a9c7e['name'],require(_0x7dc9('0x8f'))[_0x7dc9('0x90')](0x4),_0x2e7296[_0x7dc9('0x91')]||_0x7dc9('0x92')),'reportId':_0x1a9c7e['id'],'reportType':_0x7dc9('0x93')});return db['AnalyticExtractedReport'][_0x7dc9('0x45')](_0x35e061,{'raw':!![]});})[_0x7dc9('0x23')](function(_0x648bf9){if(_0x1a9c7e[_0x7dc9('0x6f')]==='cdr'){_0x5c466d[_0x7dc9('0x37')](_0x1a9c7e['table']+_0x7dc9('0x94'),_0x2e7296['startDate'],_0x2e7296[_0x7dc9('0x95')]);}else{_0x5c466d[_0x7dc9('0x37')](_0x1a9c7e[_0x7dc9('0x6f')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2e7296[_0x7dc9('0x96')],_0x2e7296[_0x7dc9('0x95')]);}if(_0x648bf9){logger['info']('Run\x20Query:',_0x5c466d[_0x7dc9('0x97')]());require('child_process')['fork'](path[_0x7dc9('0x85')](__dirname,_0x7dc9('0x98'),_0x648bf9[_0x7dc9('0x91')]),[_0x648bf9['id'],_0x5c466d['toString'](),path['join'](__dirname,'../../files/reports',_0x648bf9[_0x7dc9('0x99')]),_0x1acdba]);return _0x648bf9;}else{var _0xb825f3=squel[_0x7dc9('0x6d')]();_0xb825f3[_0x7dc9('0x6e')]('('+_0x5c466d['toString']()+')','countTable');_0xb825f3[_0x7dc9('0x68')](_0x7dc9('0x9a'),_0x7dc9('0x1e'));_0x5c466d['limit'](_0x2e7296['limit']||_0x33d68c);_0x5c466d[_0x7dc9('0x1b')](_0x2e7296['offset']||0x0);return dbH[_0x7dc9('0x82')][_0x7dc9('0x2e')](_0xb825f3['toString'](),{'type':dbH[_0x7dc9('0x82')][_0x7dc9('0x83')][_0x7dc9('0x84')]})[_0x7dc9('0x23')](function(_0x14cbd9){if(!_0x14cbd9[_0x7dc9('0x65')]){_0x2b3d46=0x0;}else{_0x2b3d46=_0x14cbd9[0x0][_0x7dc9('0x1e')]||0x0;}return dbH[_0x7dc9('0x82')]['query'](_0x5c466d[_0x7dc9('0x97')](),{'type':dbH['sequelize'][_0x7dc9('0x83')]['SELECT']});})[_0x7dc9('0x23')](function(_0x20f245){return{'rows':_0x20f245||[],'count':_0x2b3d46};});}});}exports['run']=function(_0x67d933,_0x1b2b88){return runReport(_0x67d933[_0x7dc9('0x43')],_0x67d933[_0x7dc9('0x2e')],_0x67d933[_0x7dc9('0x3d')])['then'](respondWithResult(_0x1b2b88,null))[_0x7dc9('0x42')](handleError(_0x1b2b88,null));};exports['runReport']=runReport;exports[_0x7dc9('0x2e')]=function(_0x313b41,_0x275675){var _0x299c23=0xa;var _0x4c1c43=[_0x7dc9('0x85'),_0x7dc9('0x50'),'right_join',_0x7dc9('0x52')];var _0x1fbaea={'SUM':_0x7dc9('0x86'),'COUNT':_0x7dc9('0x87'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':_0x7dc9('0x56'),'GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6c7fdc={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':_0x7dc9('0x5b'),'HOUR':_0x7dc9('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x5c9d64=function(_0x59710c){return!_['includes']([_0x7dc9('0x60'),_0x7dc9('0x61'),_0x7dc9('0x62'),_0x7dc9('0x63')],_0x59710c);};var _0x24a1e2=function(_0x45bcf4){if(!_0x45bcf4||!_0x45bcf4[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x4b18e1='(',_0x28e50e=0x0;_0x28e50e<_0x45bcf4[_0x7dc9('0x64')][_0x7dc9('0x65')];_0x28e50e+=0x1){_0x28e50e>0x0&&(_0x4b18e1+='\x20'+_0x45bcf4['operator']+'\x20');_0x4b18e1+=_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x67')]?_0x24a1e2(_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x67')]):_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x68')]+'\x20'+_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x69')]+(_0x5c9d64(_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x69')])?'\x20'+_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x88')]:'');}return _0x4b18e1+')';};var _0x1dc474={'where':{'id':_0x313b41[_0x7dc9('0x43')]['id']}},_0x31121a,_0x454b3a,_0x409a9f,_0x187f17,_0x809ae5;_0x1dc474=_[_0x7dc9('0x3a')]({},_0x1dc474,_0x313b41['options']);return db[_0x7dc9('0x2b')]['find'](_0x1dc474)[_0x7dc9('0x23')](function(_0x56e1ba){if(_0x56e1ba){_0x31121a=_0x56e1ba;return _0x56e1ba['getFields']();}return null;})[_0x7dc9('0x23')](function(_0x342b95){if(_0x342b95){if(!_0x342b95['length']){throw new db[(_0x7dc9('0x6a'))]['ValidationErrorItem'](_0x7dc9('0x89'),0x193);}_0x454b3a=_0x342b95;return db[_0x7dc9('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x338c78){if(_0x338c78){_0x409a9f=_[_0x7dc9('0x6c')](_0x338c78,'id');var _0x8ee4f4;var _0x8f887e=squel['select']();_0x8f887e[_0x7dc9('0x6e')](_0x31121a[_0x7dc9('0x6f')]);for(var _0x4e2edf=0x0;_0x4e2edf<_0x454b3a[_0x7dc9('0x65')];_0x4e2edf+=0x1){_0x8ee4f4=_0x454b3a[_0x4e2edf][_0x7dc9('0x70')]?_0x409a9f[_0x454b3a[_0x4e2edf]['MetricId']]['metric']:_0x454b3a[_0x4e2edf][_0x7dc9('0x68')];_0x8ee4f4=_0x454b3a[_0x4e2edf][_0x7dc9('0x72')]?_[_0x7dc9('0x73')](_0x1fbaea[_0x454b3a[_0x4e2edf][_0x7dc9('0x72')]],'%s',_0x8ee4f4):_0x8ee4f4;_0x8ee4f4=_0x454b3a[_0x4e2edf]['format']?_[_0x7dc9('0x73')](_0x6c7fdc[_0x454b3a[_0x4e2edf]['format']],'%s',_0x8ee4f4):_0x8ee4f4;if(_0x454b3a[_0x4e2edf]['groupBy']){_0x8f887e[_0x7dc9('0x67')](_0x8ee4f4);}_0x454b3a[_0x4e2edf][_0x7dc9('0x76')]&&_0x8f887e[_0x7dc9('0x35')](_0x8ee4f4,_0x454b3a[_0x4e2edf][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0x8f887e[_0x7dc9('0x68')](_0x8ee4f4,_0x454b3a[_0x4e2edf][_0x7dc9('0x78')]||_0x8ee4f4);}if(_0x31121a['joins']){_0x31121a[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x31121a[_0x7dc9('0x79')]);for(var _0x283f96=0x0;_0x283f96<_0x31121a[_0x7dc9('0x79')][_0x7dc9('0x65')];_0x283f96+=0x1){if(_0x31121a[_0x7dc9('0x79')][_0x283f96]['type']&&_[_0x7dc9('0x5f')](_0x4c1c43,_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x3b')])&&_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7e')]&&_0x31121a['joins'][_0x283f96][_0x7dc9('0x7b')]&&_0x31121a['joins'][_0x283f96][_0x7dc9('0x7c')]){_0x8f887e[_0x31121a[_0x7dc9('0x79')][_0x283f96]['type']](_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7b')],null,util[_0x7dc9('0x74')](_0x7dc9('0x7d'),_0x31121a[_0x7dc9('0x6f')],_0x31121a[_0x7dc9('0x79')][_0x283f96]['parentKey'],_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7b')],_0x31121a['joins'][_0x283f96][_0x7dc9('0x7c')]));}}}if(_0x31121a[_0x7dc9('0x7f')]){_0x31121a['conditions']=JSON['parse'](_0x31121a[_0x7dc9('0x7f')]);_0x8f887e[_0x7dc9('0x37')](_0x24a1e2(_0x31121a[_0x7dc9('0x7f')]['group']));}_0x809ae5=_0x8f887e[_0x7dc9('0x8b')]();_0x8f887e['limit'](_0x299c23);_0x8f887e[_0x7dc9('0x1b')](0x0);logger[_0x7dc9('0x80')](_0x7dc9('0x81'),_0x8f887e['toString']());return dbH[_0x7dc9('0x82')]['query'](_0x8f887e['toString'](),{'type':dbH[_0x7dc9('0x82')][_0x7dc9('0x83')][_0x7dc9('0x84')]});}})[_0x7dc9('0x23')](function(){return{'sql':_0x809ae5[_0x7dc9('0x97')]()};})['then'](respondWithResult(_0x275675,null))['catch'](handleError(_0x275675,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index c4f0667..82b8aef 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 _0x0724=['AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0xfef05d,_0x537455){var _0x373df4=function(_0x57d6f4){while(--_0x57d6f4){_0xfef05d['push'](_0xfef05d['shift']());}};_0x373df4(++_0x537455);}(_0x0724,0x162));var _0x4072=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0724[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x4072('0x0'));var util=require(_0x4072('0x1'));var logger=require(_0x4072('0x2'))(_0x4072('0x3'));var moment=require(_0x4072('0x4'));var BPromise=require(_0x4072('0x5'));var rp=require(_0x4072('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4072('0x7'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x4072('0x8')]=function(_0x240687,_0x339a3a){return _0x240687['define'](_0x4072('0x9'),attributes,{'tableName':_0x4072('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4905=['moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','lodash','util','../../config/logger','api'];(function(_0x4f966a,_0x22d73b){var _0x31993d=function(_0x4d0891){while(--_0x4d0891){_0x4f966a['push'](_0x4f966a['shift']());}};_0x31993d(++_0x22d73b);}(_0x4905,0x80));var _0x5490=function(_0x1e4f2f,_0x35edfa){_0x1e4f2f=_0x1e4f2f-0x0;var _0xccea89=_0x4905[_0x1e4f2f];return _0xccea89;};'use strict';var _=require(_0x5490('0x0'));var util=require(_0x5490('0x1'));var logger=require(_0x5490('0x2'))(_0x5490('0x3'));var moment=require(_0x5490('0x4'));var BPromise=require(_0x5490('0x5'));var rp=require(_0x5490('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5490('0x7'));var config=require(_0x5490('0x8'));var attributes=require(_0x5490('0x9'));module[_0x5490('0xa')]=function(_0x3cbc8e,_0x4220c1){return _0x3cbc8e['define'](_0x5490('0xb'),attributes,{'tableName':'analytics_default_reports','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 a446d29..856cc0d 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 _0x2f11=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x2c03bf,_0x23f4a4){var _0x127cd7=function(_0xe66114){while(--_0xe66114){_0x2c03bf['push'](_0x2c03bf['shift']());}};_0x127cd7(++_0x23f4a4);}(_0x2f11,0x9b));var _0x12f1=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x2f11[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x12f1('0x0'));var util=require(_0x12f1('0x1'));var moment=require('moment');var BPromise=require(_0x12f1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x12f1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x12f1('0x4'))(_0x12f1('0x5'));var config=require(_0x12f1('0x6'));var jayson=require(_0x12f1('0x7'));var client=jayson[_0x12f1('0x8')][_0x12f1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21c99c,_0x4a311c,_0x91cc89){return new BPromise(function(_0x31a22d,_0x43ff29){return client[_0x12f1('0xa')](_0x21c99c,_0x91cc89)['then'](function(_0x2607c9){logger[_0x12f1('0xb')](_0x12f1('0xc'),_0x4a311c,'request\x20sent');logger[_0x12f1('0xd')](_0x12f1('0xe'),_0x4a311c,_0x12f1('0xf'),JSON[_0x12f1('0x10')](_0x2607c9));if(_0x2607c9[_0x12f1('0x11')]){if(_0x2607c9['error'][_0x12f1('0x12')]===0x1f4){logger[_0x12f1('0x11')](_0x12f1('0xc'),_0x4a311c,_0x2607c9['error'][_0x12f1('0x13')]);return _0x43ff29(_0x2607c9[_0x12f1('0x11')][_0x12f1('0x13')]);}logger[_0x12f1('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4a311c,_0x2607c9[_0x12f1('0x11')][_0x12f1('0x13')]);return _0x31a22d(_0x2607c9[_0x12f1('0x11')][_0x12f1('0x13')]);}else{logger[_0x12f1('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4a311c,'request\x20sent');_0x31a22d(_0x2607c9['result'][_0x12f1('0x13')]);}})[_0x12f1('0x14')](function(_0x2d771d){logger[_0x12f1('0x11')](_0x12f1('0xc'),_0x4a311c,_0x2d771d);_0x43ff29(_0x2d771d);});});} \ No newline at end of file +var _0xbb8e=['rpc','jayson/promise','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0xbb8e,0x19a));var _0xebb8=function(_0x3af341,_0x56730c){_0x3af341=_0x3af341-0x0;var _0x7de169=_0xbb8e[_0x3af341];return _0x7de169;};'use strict';var _=require(_0xebb8('0x0'));var util=require(_0xebb8('0x1'));var moment=require('moment');var BPromise=require(_0xebb8('0x2'));var rs=require(_0xebb8('0x3'));var fs=require('fs');var Redis=require(_0xebb8('0x4'));var db=require(_0xebb8('0x5'))['db'];var utils=require(_0xebb8('0x6'));var logger=require(_0xebb8('0x7'))(_0xebb8('0x8'));var config=require('../../config/environment');var jayson=require(_0xebb8('0x9'));var client=jayson[_0xebb8('0xa')][_0xebb8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16b6b8,_0x4d0f50,_0x459c86){return new BPromise(function(_0x54f68e,_0x482a5b){return client[_0xebb8('0xc')](_0x16b6b8,_0x459c86)['then'](function(_0x57328c){logger[_0xebb8('0xd')](_0xebb8('0xe'),_0x4d0f50,_0xebb8('0xf'));logger[_0xebb8('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4d0f50,_0xebb8('0xf'),JSON[_0xebb8('0x11')](_0x57328c));if(_0x57328c[_0xebb8('0x12')]){if(_0x57328c[_0xebb8('0x12')][_0xebb8('0x13')]===0x1f4){logger['error'](_0xebb8('0xe'),_0x4d0f50,_0x57328c['error'][_0xebb8('0x14')]);return _0x482a5b(_0x57328c[_0xebb8('0x12')][_0xebb8('0x14')]);}logger[_0xebb8('0x12')](_0xebb8('0xe'),_0x4d0f50,_0x57328c['error'][_0xebb8('0x14')]);return _0x54f68e(_0x57328c[_0xebb8('0x12')][_0xebb8('0x14')]);}else{logger[_0xebb8('0xd')](_0xebb8('0xe'),_0x4d0f50,'request\x20sent');_0x54f68e(_0x57328c[_0xebb8('0x15')][_0xebb8('0x14')]);}})['catch'](function(_0x508472){logger[_0xebb8('0x12')](_0xebb8('0xe'),_0x4d0f50,_0x508472);_0x482a5b(_0x508472);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 83585c4..32f5002 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 _0x2884=['isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','query','create','put','update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get'];(function(_0x49e988,_0x1b10bf){var _0x5c07cc=function(_0x42a621){while(--_0x42a621){_0x49e988['push'](_0x49e988['shift']());}};_0x5c07cc(++_0x1b10bf);}(_0x2884,0xea));var _0x4288=function(_0x377fb1,_0x5ee538){_0x377fb1=_0x377fb1-0x0;var _0x3248e9=_0x2884[_0x377fb1];return _0x3248e9;};'use strict';var multer=require(_0x4288('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4288('0x1'));var express=require(_0x4288('0x2'));var router=express['Router']();var fs_extra=require(_0x4288('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4288('0x4'));var config=require(_0x4288('0x5'));var controller=require(_0x4288('0x6'));router[_0x4288('0x7')]('/',auth[_0x4288('0x8')](),controller[_0x4288('0x9')]);router[_0x4288('0x7')](_0x4288('0xa'),auth['isAuthenticated'](),controller[_0x4288('0xb')]);router[_0x4288('0x7')](_0x4288('0xc'),auth[_0x4288('0x8')](),controller[_0x4288('0xd')]);router['get'](_0x4288('0xe'),auth['isAuthenticated'](),controller[_0x4288('0xf')]);router[_0x4288('0x7')]('/:id/query',auth[_0x4288('0x8')](),controller[_0x4288('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4288('0x11')]);router[_0x4288('0x12')](_0x4288('0xa'),auth[_0x4288('0x8')](),controller[_0x4288('0x13')]);router[_0x4288('0x14')](_0x4288('0xa'),auth[_0x4288('0x8')](),controller['destroy']);module[_0x4288('0x15')]=router; \ No newline at end of file +var _0x9e07=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','/:id','show','get','/:id/preview','run','query','post','update','delete','destroy'];(function(_0x2d4c3e,_0x158273){var _0x47b398=function(_0x58d29f){while(--_0x58d29f){_0x2d4c3e['push'](_0x2d4c3e['shift']());}};_0x47b398(++_0x158273);}(_0x9e07,0x1cf));var _0x79e0=function(_0x3fb889,_0x365def){_0x3fb889=_0x3fb889-0x0;var _0x5d444f=_0x9e07[_0x3fb889];return _0x5d444f;};'use strict';var multer=require(_0x79e0('0x0'));var util=require(_0x79e0('0x1'));var path=require('path');var timeout=require(_0x79e0('0x2'));var express=require(_0x79e0('0x3'));var router=express[_0x79e0('0x4')]();var fs_extra=require(_0x79e0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x79e0('0x6'));var config=require(_0x79e0('0x7'));var controller=require(_0x79e0('0x8'));router['get']('/',auth[_0x79e0('0x9')](),controller[_0x79e0('0xa')]);router['get'](_0x79e0('0xb'),auth['isAuthenticated'](),controller[_0x79e0('0xc')]);router[_0x79e0('0xd')](_0x79e0('0xe'),auth[_0x79e0('0x9')](),controller['preview']);router[_0x79e0('0xd')]('/:id/run',auth['isAuthenticated'](),controller[_0x79e0('0xf')]);router[_0x79e0('0xd')]('/:id/query',auth[_0x79e0('0x9')](),controller[_0x79e0('0x10')]);router[_0x79e0('0x11')]('/',auth[_0x79e0('0x9')](),controller['create']);router['put'](_0x79e0('0xb'),auth['isAuthenticated'](),controller[_0x79e0('0x12')]);router[_0x79e0('0x13')](_0x79e0('0xb'),auth[_0x79e0('0x9')](),controller[_0x79e0('0x14')]);module[_0x79e0('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 6f104bb..b2872ef 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 _0x1236=['csv','pdf','DATE','Loading','ENUM','manual','scheduled','sequelize','exports','STRING'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x1236,0x9d));var _0x6123=function(_0x1a3e18,_0x40aba2){_0x1a3e18=_0x1a3e18-0x0;var _0xe8c9a4=_0x1236[_0x1a3e18];return _0xe8c9a4;};'use strict';var Sequelize=require(_0x6123('0x0'));var moment=require('moment');module[_0x6123('0x1')]={'name':{'type':Sequelize[_0x6123('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x6123('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x6123('0x3'),_0x6123('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0x6123('0x3')},'savename':{'type':Sequelize[_0x6123('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x6123('0x5')]},'status':{'type':Sequelize[_0x6123('0x2')],'defaultValue':_0x6123('0x6')},'type':{'type':Sequelize[_0x6123('0x7')](_0x6123('0x8'),_0x6123('0x9')),'allowNull':![],'defaultValue':_0x6123('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x6123('0x2')]}}; \ No newline at end of file +var _0x4b9d=['Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','csv','xlsx','DATE'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4b9d,0x10d));var _0xd4b9=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x4b9d[_0x266618];return _0x54dbf5;};'use strict';var Sequelize=require(_0xd4b9('0x0'));var moment=require(_0xd4b9('0x1'));module['exports']={'name':{'type':Sequelize[_0xd4b9('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xd4b9('0x3')](_0xd4b9('0x4'),'pdf',_0xd4b9('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xd4b9('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd4b9('0x6')]},'endDate':{'type':Sequelize[_0xd4b9('0x6')]},'status':{'type':Sequelize[_0xd4b9('0x2')],'defaultValue':_0xd4b9('0x7')},'type':{'type':Sequelize['ENUM'](_0xd4b9('0x8'),_0xd4b9('0x9')),'allowNull':![],'defaultValue':_0xd4b9('0x8')},'reportId':{'type':Sequelize[_0xd4b9('0xa')](0xb)[_0xd4b9('0xb')]},'reportType':{'type':Sequelize[_0xd4b9('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 9857976..e1354d4 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 _0x19f3=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','findAll','rows','catch','params','attributes','fields','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','join','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x19f3,0x100));var _0x319f=function(_0x4697fa,_0x21c841){_0x4697fa=_0x4697fa-0x0;var _0x390950=_0x19f3[_0x4697fa];return _0x390950;};'use strict';var emlformat=require(_0x319f('0x0'));var rimraf=require(_0x319f('0x1'));var zipdir=require(_0x319f('0x2'));var jsonpatch=require(_0x319f('0x3'));var rp=require(_0x319f('0x4'));var moment=require('moment');var BPromise=require(_0x319f('0x5'));var Mustache=require('mustache');var util=require(_0x319f('0x6'));var path=require(_0x319f('0x7'));var sox=require('sox');var csv=require(_0x319f('0x8'));var ejs=require(_0x319f('0x9'));var fs=require('fs');var fs_extra=require(_0x319f('0xa'));var _=require('lodash');var squel=require(_0x319f('0xb'));var crypto=require(_0x319f('0xc'));var jsforce=require(_0x319f('0xd'));var deskjs=require(_0x319f('0xe'));var toCsv=require(_0x319f('0x8'));var querystring=require(_0x319f('0xf'));var Papa=require(_0x319f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x319f('0x11'));var as=require(_0x319f('0x12'));var hardwareService=require(_0x319f('0x13'));var logger=require(_0x319f('0x14'))('api');var utils=require(_0x319f('0x15'));var config=require(_0x319f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x319f('0x17'))['db'];function respondWithStatusCode(_0x204f4c,_0x4f67d9){_0x4f67d9=_0x4f67d9||0xcc;return function(_0x1ee6ab){if(_0x1ee6ab){return _0x204f4c[_0x319f('0x18')](_0x4f67d9);}return _0x204f4c[_0x319f('0x19')](_0x4f67d9)['end']();};}function respondWithResult(_0x2927e3,_0xb2d331){_0xb2d331=_0xb2d331||0xc8;return function(_0x100102){if(_0x100102){return _0x2927e3[_0x319f('0x19')](_0xb2d331)[_0x319f('0x1a')](_0x100102);}};}function respondWithFilteredResult(_0x3135d3,_0x4a9500){return function(_0x3e3d98){if(_0x3e3d98){var _0x28e8c8=typeof _0x4a9500[_0x319f('0x1b')]===_0x319f('0x1c')&&typeof _0x4a9500[_0x319f('0x1d')]==='undefined';var _0x194adb=_0x3e3d98[_0x319f('0x1e')];var _0x144ba2=_0x28e8c8?0x0:_0x4a9500[_0x319f('0x1b')];var _0x345755=_0x28e8c8?_0x3e3d98[_0x319f('0x1e')]:_0x4a9500[_0x319f('0x1b')]+_0x4a9500[_0x319f('0x1d')];var _0x411f62;if(_0x345755>=_0x194adb){_0x345755=_0x194adb;_0x411f62=0xc8;}else{_0x411f62=0xce;}_0x3135d3[_0x319f('0x19')](_0x411f62);return _0x3135d3[_0x319f('0x1f')](_0x319f('0x20'),_0x144ba2+'-'+_0x345755+'/'+_0x194adb)[_0x319f('0x1a')](_0x3e3d98);}return null;};}function patchUpdates(_0x461a09){return function(_0x40973b){try{jsonpatch[_0x319f('0x21')](_0x40973b,_0x461a09,!![]);}catch(_0x3cb84d){return BPromise[_0x319f('0x22')](_0x3cb84d);}return _0x40973b[_0x319f('0x23')]();};}function saveUpdates(_0x28c273,_0xf1e91e){return function(_0x398535){if(_0x398535){return _0x398535[_0x319f('0x24')](_0x28c273)[_0x319f('0x25')](function(_0x209f0d){return _0x209f0d;});}return null;};}function removeEntity(_0x573848,_0x5988dd){return function(_0x1596bb){if(_0x1596bb){return _0x1596bb[_0x319f('0x26')]()[_0x319f('0x25')](function(){var _0x17d18c=_0x1596bb[_0x319f('0x27')]({'plain':!![]});var _0x205262=_0x319f('0x28');return db[_0x319f('0x29')][_0x319f('0x26')]({'where':{'type':_0x205262,'resourceId':_0x17d18c['id']}})[_0x319f('0x25')](function(){return _0x1596bb;});})[_0x319f('0x25')](function(){_0x573848[_0x319f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x282c1b,_0x573b53){return function(_0x480d78){if(!_0x480d78){_0x282c1b[_0x319f('0x18')](0x194);}return _0x480d78;};}function handleError(_0x3ec476,_0x233739){_0x233739=_0x233739||0x1f4;return function(_0x3ab224){logger[_0x319f('0x2a')](_0x3ab224['stack']);if(_0x3ab224['name']){delete _0x3ab224[_0x319f('0x2b')];}_0x3ec476[_0x319f('0x19')](_0x233739)[_0x319f('0x2c')](_0x3ab224);};}exports[_0x319f('0x2d')]=function(_0x278b5d,_0x26398c){var _0x51b0c1={},_0x35c323={},_0x1721bd={'count':0x0,'rows':[]};var _0x4d4ffb=_[_0x319f('0x2e')](db[_0x319f('0x2f')][_0x319f('0x30')],function(_0x1b50c2){return{'name':_0x1b50c2[_0x319f('0x31')],'type':_0x1b50c2[_0x319f('0x32')][_0x319f('0x33')]};});_0x35c323[_0x319f('0x34')]=_[_0x319f('0x2e')](_0x4d4ffb,_0x319f('0x2b'));_0x35c323['query']=_[_0x319f('0x35')](_0x278b5d[_0x319f('0x36')]);_0x35c323[_0x319f('0x37')]=_[_0x319f('0x38')](_0x35c323['model'],_0x35c323['query']);_0x51b0c1['attributes']=_['intersection'](_0x35c323[_0x319f('0x34')],qs['fields'](_0x278b5d[_0x319f('0x36')]['fields']));_0x51b0c1['attributes']=_0x51b0c1['attributes']['length']?_0x51b0c1['attributes']:_0x35c323['model'];if(!_0x278b5d[_0x319f('0x36')][_0x319f('0x39')]('nolimit')){_0x51b0c1[_0x319f('0x1d')]=qs[_0x319f('0x1d')](_0x278b5d[_0x319f('0x36')][_0x319f('0x1d')]);_0x51b0c1[_0x319f('0x1b')]=qs[_0x319f('0x1b')](_0x278b5d[_0x319f('0x36')][_0x319f('0x1b')]);}_0x51b0c1[_0x319f('0x3a')]=qs[_0x319f('0x3b')](_0x278b5d[_0x319f('0x36')][_0x319f('0x3b')]);_0x51b0c1[_0x319f('0x3c')]=qs['filters'](_[_0x319f('0x3d')](_0x278b5d[_0x319f('0x36')],_0x35c323[_0x319f('0x37')]),_0x4d4ffb);if(_0x278b5d['query']['filter']){_0x51b0c1[_0x319f('0x3c')]=_[_0x319f('0x3e')](_0x51b0c1[_0x319f('0x3c')],{'$or':_[_0x319f('0x2e')](_0x4d4ffb,function(_0x495026){if(_0x495026['type']!==_0x319f('0x3f')){var _0x537aef={};_0x537aef[_0x495026[_0x319f('0x2b')]]={'$like':'%'+_0x278b5d['query']['filter']+'%'};return _0x537aef;}})});}_0x51b0c1=_[_0x319f('0x3e')]({},_0x51b0c1,_0x278b5d[_0x319f('0x40')]);var _0x297dea={'where':_0x51b0c1[_0x319f('0x3c')]};return db['AnalyticExtractedReport']['count'](_0x297dea)['then'](function(_0x4dfc17){_0x1721bd['count']=_0x4dfc17;if(_0x278b5d['query']['includeAll']){_0x51b0c1['include']=[{'all':!![]}];}return db[_0x319f('0x2f')][_0x319f('0x41')](_0x51b0c1);})[_0x319f('0x25')](function(_0x49adce){_0x1721bd[_0x319f('0x42')]=_0x49adce;return _0x1721bd;})[_0x319f('0x25')](respondWithFilteredResult(_0x26398c,_0x51b0c1))[_0x319f('0x43')](handleError(_0x26398c,null));};exports['show']=function(_0x504209,_0x490fcd){var _0x4038fc={'raw':!![],'where':{'id':_0x504209[_0x319f('0x44')]['id']}},_0x588d24={};_0x588d24[_0x319f('0x34')]=_[_0x319f('0x35')](db[_0x319f('0x2f')][_0x319f('0x30')]);_0x588d24[_0x319f('0x36')]=_['keys'](_0x504209[_0x319f('0x36')]);_0x588d24[_0x319f('0x37')]=_[_0x319f('0x38')](_0x588d24[_0x319f('0x34')],_0x588d24[_0x319f('0x36')]);_0x4038fc[_0x319f('0x45')]=_[_0x319f('0x38')](_0x588d24['model'],qs['fields'](_0x504209[_0x319f('0x36')][_0x319f('0x46')]));_0x4038fc['attributes']=_0x4038fc[_0x319f('0x45')][_0x319f('0x47')]?_0x4038fc['attributes']:_0x588d24['model'];if(_0x504209[_0x319f('0x36')][_0x319f('0x48')]){_0x4038fc['include']=[{'all':!![]}];}_0x4038fc=_[_0x319f('0x3e')]({},_0x4038fc,_0x504209[_0x319f('0x40')]);return db[_0x319f('0x2f')][_0x319f('0x49')](_0x4038fc)['then'](handleEntityNotFound(_0x490fcd,null))['then'](respondWithResult(_0x490fcd,null))[_0x319f('0x43')](handleError(_0x490fcd,null));};exports[_0x319f('0x4a')]=function(_0x2b7fa2,_0x530908){return db[_0x319f('0x2f')][_0x319f('0x4a')](_0x2b7fa2['body'],{})['then'](function(_0x29c728){var _0x145373=_0x2b7fa2[_0x319f('0x4b')][_0x319f('0x27')]({'plain':!![]});if(!_0x145373)throw new Error(_0x319f('0x4c'));if(_0x145373[_0x319f('0x4d')]===_0x319f('0x4b')){var _0x1b5da9=_0x29c728[_0x319f('0x27')]({'plain':!![]});var _0x389445=_0x319f('0x28');return db[_0x319f('0x4e')][_0x319f('0x49')]({'where':{'name':_0x389445,'userProfileId':_0x145373['userProfileId']},'raw':!![]})[_0x319f('0x25')](function(_0x2f89df){if(_0x2f89df&&_0x2f89df[_0x319f('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x1b5da9[_0x319f('0x2b')],'resourceId':_0x1b5da9['id'],'type':_0x2f89df[_0x319f('0x2b')],'sectionId':_0x2f89df['id']},{})[_0x319f('0x25')](function(){return _0x29c728;});}else{return _0x29c728;}})[_0x319f('0x43')](function(_0x5108a6){logger[_0x319f('0x2a')](_0x319f('0x50'),_0x5108a6);throw _0x5108a6;});}return _0x29c728;})['then'](respondWithResult(_0x530908,0xc9))['catch'](handleError(_0x530908,null));};exports[_0x319f('0x24')]=function(_0x4cb04d,_0x307b1b){if(_0x4cb04d[_0x319f('0x51')]['id']){delete _0x4cb04d[_0x319f('0x51')]['id'];}return db[_0x319f('0x2f')]['find']({'where':{'id':_0x4cb04d['params']['id']}})[_0x319f('0x25')](handleEntityNotFound(_0x307b1b,null))[_0x319f('0x25')](saveUpdates(_0x4cb04d[_0x319f('0x51')],null))[_0x319f('0x25')](respondWithResult(_0x307b1b,null))[_0x319f('0x43')](handleError(_0x307b1b,null));};exports[_0x319f('0x26')]=function(_0x1f96d6,_0x8c2ed3){return db['AnalyticExtractedReport'][_0x319f('0x49')]({'where':{'id':_0x1f96d6['params']['id']}})['then'](handleEntityNotFound(_0x8c2ed3,null))[_0x319f('0x25')](removeEntity(_0x8c2ed3,null))[_0x319f('0x43')](handleError(_0x8c2ed3,null));};exports['download']=function(_0x3b2c09,_0x42eb42,_0x3c600a){return db['AnalyticExtractedReport'][_0x319f('0x49')]({'where':{'id':_0x3b2c09['params']['id']},'attributes':[_0x319f('0x2b'),'basename','savename','output'],'raw':!![]})['then'](handleEntityNotFound(_0x42eb42,null))[_0x319f('0x25')](function(_0x35bc13){if(_0x35bc13){if(!fs[_0x319f('0x52')](path['join'](config[_0x319f('0x53')],_0x319f('0x54'),_0x35bc13['savename']))){throw new db[(_0x319f('0x55'))][(_0x319f('0x56'))](_0x319f('0x57'));}if(_0x3b2c09['query'][_0x319f('0x58')]){return _0x42eb42['sendStatus'](0xc8);}return _0x42eb42[_0x319f('0x59')](path[_0x319f('0x5a')](config[_0x319f('0x53')],_0x319f('0x54'),_0x35bc13['savename']),util[_0x319f('0x5b')](_0x319f('0x5c'),_0x35bc13[_0x319f('0x5d')]||_0x35bc13[_0x319f('0x2b')],_0x35bc13['output'][_0x319f('0x5e')]()));}})[_0x319f('0x43')](handleError(_0x42eb42,null));}; \ No newline at end of file +var _0x6e52=['UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','download','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','ExtractedReports','end','error','stack','name','send','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','rows','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x176dd3,_0x1f546f){var _0x21bdd6=function(_0x59df8a){while(--_0x59df8a){_0x176dd3['push'](_0x176dd3['shift']());}};_0x21bdd6(++_0x1f546f);}(_0x6e52,0x1ed));var _0x26e5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e52[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x26e5('0x0'));var rimraf=require(_0x26e5('0x1'));var zipdir=require(_0x26e5('0x2'));var jsonpatch=require(_0x26e5('0x3'));var rp=require(_0x26e5('0x4'));var moment=require(_0x26e5('0x5'));var BPromise=require(_0x26e5('0x6'));var Mustache=require(_0x26e5('0x7'));var util=require(_0x26e5('0x8'));var path=require(_0x26e5('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x26e5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x26e5('0xb'));var squel=require(_0x26e5('0xc'));var crypto=require('crypto');var jsforce=require(_0x26e5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x26e5('0xe'));var Papa=require(_0x26e5('0xf'));var Redis=require(_0x26e5('0x10'));var authService=require(_0x26e5('0x11'));var qs=require(_0x26e5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x26e5('0x13'));var config=require(_0x26e5('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x26e5('0x15'))['db'];function respondWithStatusCode(_0x3f95f1,_0x1115e9){_0x1115e9=_0x1115e9||0xcc;return function(_0x34a9ff){if(_0x34a9ff){return _0x3f95f1[_0x26e5('0x16')](_0x1115e9);}return _0x3f95f1[_0x26e5('0x17')](_0x1115e9)['end']();};}function respondWithResult(_0x3aa84d,_0x2e64bd){_0x2e64bd=_0x2e64bd||0xc8;return function(_0x3e497d){if(_0x3e497d){return _0x3aa84d[_0x26e5('0x17')](_0x2e64bd)[_0x26e5('0x18')](_0x3e497d);}};}function respondWithFilteredResult(_0x4140a9,_0x5dc2f7){return function(_0x2428ea){if(_0x2428ea){var _0x61f2f0=typeof _0x5dc2f7[_0x26e5('0x19')]===_0x26e5('0x1a')&&typeof _0x5dc2f7[_0x26e5('0x1b')]===_0x26e5('0x1a');var _0x58efdc=_0x2428ea[_0x26e5('0x1c')];var _0x154f5e=_0x61f2f0?0x0:_0x5dc2f7[_0x26e5('0x19')];var _0x340395=_0x61f2f0?_0x2428ea['count']:_0x5dc2f7[_0x26e5('0x19')]+_0x5dc2f7[_0x26e5('0x1b')];var _0x355b96;if(_0x340395>=_0x58efdc){_0x340395=_0x58efdc;_0x355b96=0xc8;}else{_0x355b96=0xce;}_0x4140a9[_0x26e5('0x17')](_0x355b96);return _0x4140a9[_0x26e5('0x1d')](_0x26e5('0x1e'),_0x154f5e+'-'+_0x340395+'/'+_0x58efdc)[_0x26e5('0x18')](_0x2428ea);}return null;};}function patchUpdates(_0x9dd6a){return function(_0x5703f8){try{jsonpatch[_0x26e5('0x1f')](_0x5703f8,_0x9dd6a,!![]);}catch(_0x3f2acb){return BPromise[_0x26e5('0x20')](_0x3f2acb);}return _0x5703f8['save']();};}function saveUpdates(_0x17f165,_0x25f29d){return function(_0x34ff68){if(_0x34ff68){return _0x34ff68[_0x26e5('0x21')](_0x17f165)['then'](function(_0x52431a){return _0x52431a;});}return null;};}function removeEntity(_0x294c99,_0x4de306){return function(_0x1a7372){if(_0x1a7372){return _0x1a7372[_0x26e5('0x22')]()[_0x26e5('0x23')](function(){var _0x1fda11=_0x1a7372[_0x26e5('0x24')]({'plain':!![]});var _0x3f8500=_0x26e5('0x25');return db['UserProfileResource'][_0x26e5('0x22')]({'where':{'type':_0x3f8500,'resourceId':_0x1fda11['id']}})['then'](function(){return _0x1a7372;});})[_0x26e5('0x23')](function(){_0x294c99[_0x26e5('0x17')](0xcc)[_0x26e5('0x26')]();});}};}function handleEntityNotFound(_0x56969c,_0x30e7a0){return function(_0x4efbf9){if(!_0x4efbf9){_0x56969c[_0x26e5('0x16')](0x194);}return _0x4efbf9;};}function handleError(_0x33b23f,_0x15795b){_0x15795b=_0x15795b||0x1f4;return function(_0x5d3e61){logger[_0x26e5('0x27')](_0x5d3e61[_0x26e5('0x28')]);if(_0x5d3e61[_0x26e5('0x29')]){delete _0x5d3e61[_0x26e5('0x29')];}_0x33b23f[_0x26e5('0x17')](_0x15795b)[_0x26e5('0x2a')](_0x5d3e61);};}exports['index']=function(_0x56a182,_0x1adbc2){var _0x3bc8a2={},_0x2b8b62={},_0x297951={'count':0x0,'rows':[]};var _0x5239e7=_['map'](db[_0x26e5('0x2b')][_0x26e5('0x2c')],function(_0x1b15dc){return{'name':_0x1b15dc[_0x26e5('0x2d')],'type':_0x1b15dc[_0x26e5('0x2e')][_0x26e5('0x2f')]};});_0x2b8b62[_0x26e5('0x30')]=_['map'](_0x5239e7,_0x26e5('0x29'));_0x2b8b62['query']=_['keys'](_0x56a182[_0x26e5('0x31')]);_0x2b8b62[_0x26e5('0x32')]=_['intersection'](_0x2b8b62[_0x26e5('0x30')],_0x2b8b62[_0x26e5('0x31')]);_0x3bc8a2[_0x26e5('0x33')]=_[_0x26e5('0x34')](_0x2b8b62[_0x26e5('0x30')],qs[_0x26e5('0x35')](_0x56a182[_0x26e5('0x31')][_0x26e5('0x35')]));_0x3bc8a2['attributes']=_0x3bc8a2[_0x26e5('0x33')][_0x26e5('0x36')]?_0x3bc8a2['attributes']:_0x2b8b62['model'];if(!_0x56a182[_0x26e5('0x31')][_0x26e5('0x37')](_0x26e5('0x38'))){_0x3bc8a2[_0x26e5('0x1b')]=qs[_0x26e5('0x1b')](_0x56a182[_0x26e5('0x31')]['limit']);_0x3bc8a2[_0x26e5('0x19')]=qs[_0x26e5('0x19')](_0x56a182[_0x26e5('0x31')][_0x26e5('0x19')]);}_0x3bc8a2['order']=qs[_0x26e5('0x39')](_0x56a182[_0x26e5('0x31')][_0x26e5('0x39')]);_0x3bc8a2[_0x26e5('0x3a')]=qs[_0x26e5('0x32')](_[_0x26e5('0x3b')](_0x56a182[_0x26e5('0x31')],_0x2b8b62[_0x26e5('0x32')]),_0x5239e7);if(_0x56a182['query']['filter']){_0x3bc8a2[_0x26e5('0x3a')]=_[_0x26e5('0x3c')](_0x3bc8a2[_0x26e5('0x3a')],{'$or':_[_0x26e5('0x3d')](_0x5239e7,function(_0x24a30f){if(_0x24a30f[_0x26e5('0x2e')]!==_0x26e5('0x3e')){var _0x22f3ee={};_0x22f3ee[_0x24a30f[_0x26e5('0x29')]]={'$like':'%'+_0x56a182[_0x26e5('0x31')][_0x26e5('0x3f')]+'%'};return _0x22f3ee;}})});}_0x3bc8a2=_[_0x26e5('0x3c')]({},_0x3bc8a2,_0x56a182[_0x26e5('0x40')]);var _0xb87bef={'where':_0x3bc8a2[_0x26e5('0x3a')]};return db[_0x26e5('0x2b')][_0x26e5('0x1c')](_0xb87bef)['then'](function(_0x37b316){_0x297951[_0x26e5('0x1c')]=_0x37b316;if(_0x56a182[_0x26e5('0x31')][_0x26e5('0x41')]){_0x3bc8a2[_0x26e5('0x42')]=[{'all':!![]}];}return db[_0x26e5('0x2b')]['findAll'](_0x3bc8a2);})[_0x26e5('0x23')](function(_0x3749c2){_0x297951[_0x26e5('0x43')]=_0x3749c2;return _0x297951;})[_0x26e5('0x23')](respondWithFilteredResult(_0x1adbc2,_0x3bc8a2))['catch'](handleError(_0x1adbc2,null));};exports[_0x26e5('0x44')]=function(_0x2a4a46,_0x1f4538){var _0x467881={'raw':!![],'where':{'id':_0x2a4a46[_0x26e5('0x45')]['id']}},_0x19c7bc={};_0x19c7bc[_0x26e5('0x30')]=_[_0x26e5('0x46')](db[_0x26e5('0x2b')][_0x26e5('0x2c')]);_0x19c7bc[_0x26e5('0x31')]=_[_0x26e5('0x46')](_0x2a4a46[_0x26e5('0x31')]);_0x19c7bc[_0x26e5('0x32')]=_[_0x26e5('0x34')](_0x19c7bc['model'],_0x19c7bc[_0x26e5('0x31')]);_0x467881[_0x26e5('0x33')]=_[_0x26e5('0x34')](_0x19c7bc[_0x26e5('0x30')],qs[_0x26e5('0x35')](_0x2a4a46[_0x26e5('0x31')][_0x26e5('0x35')]));_0x467881[_0x26e5('0x33')]=_0x467881['attributes'][_0x26e5('0x36')]?_0x467881[_0x26e5('0x33')]:_0x19c7bc[_0x26e5('0x30')];if(_0x2a4a46[_0x26e5('0x31')][_0x26e5('0x41')]){_0x467881['include']=[{'all':!![]}];}_0x467881=_['merge']({},_0x467881,_0x2a4a46[_0x26e5('0x40')]);return db[_0x26e5('0x2b')][_0x26e5('0x47')](_0x467881)[_0x26e5('0x23')](handleEntityNotFound(_0x1f4538,null))[_0x26e5('0x23')](respondWithResult(_0x1f4538,null))['catch'](handleError(_0x1f4538,null));};exports[_0x26e5('0x48')]=function(_0x12858f,_0x351485){return db['AnalyticExtractedReport'][_0x26e5('0x48')](_0x12858f[_0x26e5('0x49')],{})['then'](function(_0x165aa3){var _0x321266=_0x12858f[_0x26e5('0x4a')]['get']({'plain':!![]});if(!_0x321266)throw new Error(_0x26e5('0x4b'));if(_0x321266[_0x26e5('0x4c')]===_0x26e5('0x4a')){var _0x475c61=_0x165aa3[_0x26e5('0x24')]({'plain':!![]});var _0x269350='ExtractedReports';return db[_0x26e5('0x4d')][_0x26e5('0x47')]({'where':{'name':_0x269350,'userProfileId':_0x321266['userProfileId']},'raw':!![]})['then'](function(_0x172e14){if(_0x172e14&&_0x172e14[_0x26e5('0x4e')]===0x0){return db[_0x26e5('0x4f')][_0x26e5('0x48')]({'name':_0x475c61['name'],'resourceId':_0x475c61['id'],'type':_0x172e14[_0x26e5('0x29')],'sectionId':_0x172e14['id']},{})[_0x26e5('0x23')](function(){return _0x165aa3;});}else{return _0x165aa3;}})['catch'](function(_0x3bb119){logger[_0x26e5('0x27')](_0x26e5('0x50'),_0x3bb119);throw _0x3bb119;});}return _0x165aa3;})[_0x26e5('0x23')](respondWithResult(_0x351485,0xc9))[_0x26e5('0x51')](handleError(_0x351485,null));};exports['update']=function(_0x5a0017,_0x5802e8){if(_0x5a0017[_0x26e5('0x49')]['id']){delete _0x5a0017[_0x26e5('0x49')]['id'];}return db[_0x26e5('0x2b')][_0x26e5('0x47')]({'where':{'id':_0x5a0017[_0x26e5('0x45')]['id']}})['then'](handleEntityNotFound(_0x5802e8,null))[_0x26e5('0x23')](saveUpdates(_0x5a0017[_0x26e5('0x49')],null))[_0x26e5('0x23')](respondWithResult(_0x5802e8,null))[_0x26e5('0x51')](handleError(_0x5802e8,null));};exports[_0x26e5('0x22')]=function(_0x2d970f,_0x3cac80){return db['AnalyticExtractedReport'][_0x26e5('0x47')]({'where':{'id':_0x2d970f['params']['id']}})[_0x26e5('0x23')](handleEntityNotFound(_0x3cac80,null))[_0x26e5('0x23')](removeEntity(_0x3cac80,null))[_0x26e5('0x51')](handleError(_0x3cac80,null));};exports[_0x26e5('0x52')]=function(_0x509d62,_0x48ea95,_0x4ae22b){return db[_0x26e5('0x2b')]['find']({'where':{'id':_0x509d62[_0x26e5('0x45')]['id']},'attributes':[_0x26e5('0x29'),_0x26e5('0x53'),_0x26e5('0x54'),_0x26e5('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x48ea95,null))[_0x26e5('0x23')](function(_0x51a3f8){if(_0x51a3f8){if(!fs['existsSync'](path[_0x26e5('0x56')](config[_0x26e5('0x57')],_0x26e5('0x58'),_0x51a3f8[_0x26e5('0x54')]))){throw new db[(_0x26e5('0x59'))][(_0x26e5('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x509d62[_0x26e5('0x31')][_0x26e5('0x5b')]){return _0x48ea95['sendStatus'](0xc8);}return _0x48ea95[_0x26e5('0x52')](path[_0x26e5('0x56')](config['root'],_0x26e5('0x58'),_0x51a3f8['savename']),util[_0x26e5('0x5c')](_0x26e5('0x5d'),_0x51a3f8[_0x26e5('0x53')]||_0x51a3f8[_0x26e5('0x29')],_0x51a3f8[_0x26e5('0x55')][_0x26e5('0x5e')]()));}})[_0x26e5('0x51')](handleError(_0x48ea95,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 57fa429..b9b3a2a 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 _0x89a2=['api','moment','bluebird','request-promise','path','rimraf','exports','define','AnalyticExtractedReport','util','../../config/logger'];(function(_0x1767de,_0x1c8994){var _0x2dbae2=function(_0x9b3bb1){while(--_0x9b3bb1){_0x1767de['push'](_0x1767de['shift']());}};_0x2dbae2(++_0x1c8994);}(_0x89a2,0x132));var _0x289a=function(_0x166146,_0x1f34c6){_0x166146=_0x166146-0x0;var _0x9c7390=_0x89a2[_0x166146];return _0x9c7390;};'use strict';var _=require('lodash');var util=require(_0x289a('0x0'));var logger=require(_0x289a('0x1'))(_0x289a('0x2'));var moment=require(_0x289a('0x3'));var BPromise=require(_0x289a('0x4'));var rp=require(_0x289a('0x5'));var fs=require('fs');var path=require(_0x289a('0x6'));var rimraf=require(_0x289a('0x7'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0x289a('0x8')]=function(_0xaa41a0,_0x56c880){return _0xaa41a0[_0x289a('0x9')](_0x289a('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c4a=['analytics_extracted_reports','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0xe1b14b,_0x275799){var _0x21da52=function(_0x5232a7){while(--_0x5232a7){_0xe1b14b['push'](_0xe1b14b['shift']());}};_0x21da52(++_0x275799);}(_0x9c4a,0xe5));var _0xa9c4=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x9c4a[_0x39e283];return _0x7de89f;};'use strict';var _=require(_0xa9c4('0x0'));var util=require('util');var logger=require(_0xa9c4('0x1'))(_0xa9c4('0x2'));var moment=require(_0xa9c4('0x3'));var BPromise=require('bluebird');var rp=require(_0xa9c4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c4('0x5'));var config=require(_0xa9c4('0x6'));var attributes=require(_0xa9c4('0x7'));module[_0xa9c4('0x8')]=function(_0x2ee55e,_0x35ab42){return _0x2ee55e[_0xa9c4('0x9')](_0xa9c4('0xa'),attributes,{'tableName':_0xa9c4('0xb'),'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 4e6ea78..23709e5 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 _0x32ad=['request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x3d87ea,_0x21c003){var _0x78e20b=function(_0x34a8d5){while(--_0x34a8d5){_0x3d87ea['push'](_0x3d87ea['shift']());}};_0x78e20b(++_0x21c003);}(_0x32ad,0x18b));var _0xd32a=function(_0x47c520,_0x56b2db){_0x47c520=_0x47c520-0x0;var _0x36704c=_0x32ad[_0x47c520];return _0x36704c;};'use strict';var _=require(_0xd32a('0x0'));var util=require(_0xd32a('0x1'));var moment=require(_0xd32a('0x2'));var BPromise=require(_0xd32a('0x3'));var rs=require(_0xd32a('0x4'));var fs=require('fs');var Redis=require(_0xd32a('0x5'));var db=require(_0xd32a('0x6'))['db'];var utils=require(_0xd32a('0x7'));var logger=require(_0xd32a('0x8'))(_0xd32a('0x9'));var config=require(_0xd32a('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xd32a('0xb')][_0xd32a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf31c33,_0x3c3410,_0x3652b3){return new BPromise(function(_0x10b754,_0x975c68){return client[_0xd32a('0xd')](_0xf31c33,_0x3652b3)[_0xd32a('0xe')](function(_0x410ec8){logger[_0xd32a('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3c3410,_0xd32a('0x10'));logger[_0xd32a('0x11')](_0xd32a('0x12'),_0x3c3410,_0xd32a('0x10'),JSON[_0xd32a('0x13')](_0x410ec8));if(_0x410ec8[_0xd32a('0x14')]){if(_0x410ec8['error']['code']===0x1f4){logger[_0xd32a('0x14')](_0xd32a('0x15'),_0x3c3410,_0x410ec8[_0xd32a('0x14')][_0xd32a('0x16')]);return _0x975c68(_0x410ec8[_0xd32a('0x14')][_0xd32a('0x16')]);}logger[_0xd32a('0x14')](_0xd32a('0x15'),_0x3c3410,_0x410ec8[_0xd32a('0x14')]['message']);return _0x10b754(_0x410ec8[_0xd32a('0x14')]['message']);}else{logger[_0xd32a('0xf')](_0xd32a('0x15'),_0x3c3410,_0xd32a('0x10'));_0x10b754(_0x410ec8[_0xd32a('0x17')][_0xd32a('0x16')]);}})['catch'](function(_0x43daa9){logger['error'](_0xd32a('0x15'),_0x3c3410,_0x43daa9);_0x975c68(_0x43daa9);});});} \ No newline at end of file +var _0x8da8=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x5c0687,_0xe75ce2){var _0x581f60=function(_0x374997){while(--_0x374997){_0x5c0687['push'](_0x5c0687['shift']());}};_0x581f60(++_0xe75ce2);}(_0x8da8,0x187));var _0x88da=function(_0x291fc4,_0x39bf93){_0x291fc4=_0x291fc4-0x0;var _0x6f8a72=_0x8da8[_0x291fc4];return _0x6f8a72;};'use strict';var _=require(_0x88da('0x0'));var util=require(_0x88da('0x1'));var moment=require(_0x88da('0x2'));var BPromise=require(_0x88da('0x3'));var rs=require(_0x88da('0x4'));var fs=require('fs');var Redis=require(_0x88da('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x88da('0x6'));var logger=require(_0x88da('0x7'))(_0x88da('0x8'));var config=require(_0x88da('0x9'));var jayson=require(_0x88da('0xa'));var client=jayson[_0x88da('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6baa96,_0x33e3be,_0x3de109){return new BPromise(function(_0x3b2868,_0x58a969){return client['request'](_0x6baa96,_0x3de109)[_0x88da('0xc')](function(_0x10db86){logger[_0x88da('0xd')](_0x88da('0xe'),_0x33e3be,_0x88da('0xf'));logger[_0x88da('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x33e3be,_0x88da('0xf'),JSON[_0x88da('0x11')](_0x10db86));if(_0x10db86['error']){if(_0x10db86[_0x88da('0x12')][_0x88da('0x13')]===0x1f4){logger[_0x88da('0x12')](_0x88da('0xe'),_0x33e3be,_0x10db86['error'][_0x88da('0x14')]);return _0x58a969(_0x10db86['error']['message']);}logger['error'](_0x88da('0xe'),_0x33e3be,_0x10db86[_0x88da('0x12')][_0x88da('0x14')]);return _0x3b2868(_0x10db86[_0x88da('0x12')]['message']);}else{logger[_0x88da('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x33e3be,'request\x20sent');_0x3b2868(_0x10db86[_0x88da('0x15')][_0x88da('0x14')]);}})['catch'](function(_0x4d9ffd){logger[_0x88da('0x12')](_0x88da('0xe'),_0x33e3be,_0x4d9ffd);_0x58a969(_0x4d9ffd);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index e5caa73..c57b2ea 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 _0xea91=['/:id/download','create','put','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xea91,0x1ce));var _0x1ea9=function(_0x214266,_0x1f6f52){_0x214266=_0x214266-0x0;var _0x568f75=_0xea91[_0x214266];return _0x568f75;};'use strict';var multer=require(_0x1ea9('0x0'));var util=require(_0x1ea9('0x1'));var path=require(_0x1ea9('0x2'));var timeout=require('connect-timeout');var express=require(_0x1ea9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1ea9('0x4'));var interaction=require(_0x1ea9('0x5'));var config=require(_0x1ea9('0x6'));var controller=require(_0x1ea9('0x7'));router[_0x1ea9('0x8')]('/',auth[_0x1ea9('0x9')](),controller[_0x1ea9('0xa')]);router[_0x1ea9('0x8')](_0x1ea9('0xb'),auth[_0x1ea9('0x9')](),controller[_0x1ea9('0xc')]);router[_0x1ea9('0x8')](_0x1ea9('0xd'),auth[_0x1ea9('0x9')](),controller['download']);router['post']('/',auth[_0x1ea9('0x9')](),controller[_0x1ea9('0xe')]);router[_0x1ea9('0xf')](_0x1ea9('0xb'),auth[_0x1ea9('0x9')](),controller['update']);router[_0x1ea9('0x10')]('/:id',auth[_0x1ea9('0x9')](),controller[_0x1ea9('0x11')]);module[_0x1ea9('0x12')]=router; \ No newline at end of file +var _0x11fb=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','download','create','delete','destroy','exports','util','path'];(function(_0x15acd2,_0x18730e){var _0x3b192d=function(_0x42c28f){while(--_0x42c28f){_0x15acd2['push'](_0x15acd2['shift']());}};_0x3b192d(++_0x18730e);}(_0x11fb,0x1ce));var _0xb11f=function(_0x3eee70,_0x2173d6){_0x3eee70=_0x3eee70-0x0;var _0x14f04a=_0x11fb[_0x3eee70];return _0x14f04a;};'use strict';var multer=require('multer');var util=require(_0xb11f('0x0'));var path=require(_0xb11f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb11f('0x2')]();var fs_extra=require(_0xb11f('0x3'));var auth=require(_0xb11f('0x4'));var interaction=require(_0xb11f('0x5'));var config=require(_0xb11f('0x6'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xb11f('0x7')](),controller[_0xb11f('0x8')]);router[_0xb11f('0x9')](_0xb11f('0xa'),auth[_0xb11f('0x7')](),controller['show']);router[_0xb11f('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0xb11f('0xb')]);router['post']('/',auth[_0xb11f('0x7')](),controller[_0xb11f('0xc')]);router['put'](_0xb11f('0xa'),auth[_0xb11f('0x7')](),controller['update']);router[_0xb11f('0xd')](_0xb11f('0xa'),auth[_0xb11f('0x7')](),controller[_0xb11f('0xe')]);module[_0xb11f('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index ae81b1f..708ecc4 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 _0xd407=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x1220dc,_0x448145){var _0x264ada=function(_0x171972){while(--_0x171972){_0x1220dc['push'](_0x1220dc['shift']());}};_0x264ada(++_0x448145);}(_0xd407,0x6f));var _0x7d40=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd407[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7d40('0x0'));module[_0x7d40('0x1')]={'field':{'type':Sequelize[_0x7d40('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x7d40('0x3')]},'format':{'type':Sequelize[_0x7d40('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x7d40('0x3')]},'custom':{'type':Sequelize[_0x7d40('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xea6d=['sequelize','exports','STRING','BOOLEAN'];(function(_0x483985,_0x3e589e){var _0x3a513a=function(_0x9099a9){while(--_0x9099a9){_0x483985['push'](_0x483985['shift']());}};_0x3a513a(++_0x3e589e);}(_0xea6d,0x16c));var _0xdea6=function(_0x1693cf,_0x2ccbcc){_0x1693cf=_0x1693cf-0x0;var _0x56b509=_0xea6d[_0x1693cf];return _0x56b509;};'use strict';var Sequelize=require(_0xdea6('0x0'));module[_0xdea6('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xdea6('0x2')]},'format':{'type':Sequelize[_0xdea6('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xdea6('0x2')]},'custom':{'type':Sequelize[_0xdea6('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index ba1ec52..8842e84 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 _0x225d=['rawAttributes','include','options','create','bulkCreate','body','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','error','stack','index','map','AnalyticFieldReport','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','then','includeAll','findAll','rows','catch','show','params','keys'];(function(_0x271e3f,_0x57e6ed){var _0x2157eb=function(_0x12af10){while(--_0x12af10){_0x271e3f['push'](_0x271e3f['shift']());}};_0x2157eb(++_0x57e6ed);}(_0x225d,0x16f));var _0xd225=function(_0x22a2b3,_0x1b9e8d){_0x22a2b3=_0x22a2b3-0x0;var _0x48d024=_0x225d[_0x22a2b3];return _0x48d024;};'use strict';var emlformat=require(_0xd225('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd225('0x1'));var jsonpatch=require(_0xd225('0x2'));var rp=require(_0xd225('0x3'));var moment=require(_0xd225('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd225('0x5'));var sox=require(_0xd225('0x6'));var csv=require('to-csv');var ejs=require(_0xd225('0x7'));var fs=require('fs');var fs_extra=require(_0xd225('0x8'));var _=require(_0xd225('0x9'));var squel=require(_0xd225('0xa'));var crypto=require(_0xd225('0xb'));var jsforce=require(_0xd225('0xc'));var deskjs=require(_0xd225('0xd'));var toCsv=require(_0xd225('0xe'));var querystring=require(_0xd225('0xf'));var Papa=require(_0xd225('0x10'));var Redis=require(_0xd225('0x11'));var authService=require(_0xd225('0x12'));var qs=require(_0xd225('0x13'));var as=require(_0xd225('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd225('0x15'))(_0xd225('0x16'));var utils=require(_0xd225('0x17'));var config=require(_0xd225('0x18'));var licenseUtil=require(_0xd225('0x19'));var db=require(_0xd225('0x1a'))['db'];function respondWithStatusCode(_0x46702a,_0x28f086){_0x28f086=_0x28f086||0xcc;return function(_0x2c8414){if(_0x2c8414){return _0x46702a[_0xd225('0x1b')](_0x28f086);}return _0x46702a[_0xd225('0x1c')](_0x28f086)[_0xd225('0x1d')]();};}function respondWithResult(_0xfb975d,_0x21b16a){_0x21b16a=_0x21b16a||0xc8;return function(_0x303ab8){if(_0x303ab8){return _0xfb975d[_0xd225('0x1c')](_0x21b16a)[_0xd225('0x1e')](_0x303ab8);}};}function respondWithFilteredResult(_0x534736,_0xdee868){return function(_0x5c117c){if(_0x5c117c){var _0x4f961e=typeof _0xdee868['offset']===_0xd225('0x1f')&&typeof _0xdee868[_0xd225('0x20')]===_0xd225('0x1f');var _0x3ae99b=_0x5c117c[_0xd225('0x21')];var _0x49507c=_0x4f961e?0x0:_0xdee868[_0xd225('0x22')];var _0x360df2=_0x4f961e?_0x5c117c[_0xd225('0x21')]:_0xdee868[_0xd225('0x22')]+_0xdee868[_0xd225('0x20')];var _0x531874;if(_0x360df2>=_0x3ae99b){_0x360df2=_0x3ae99b;_0x531874=0xc8;}else{_0x531874=0xce;}_0x534736[_0xd225('0x1c')](_0x531874);return _0x534736[_0xd225('0x23')]('Content-Range',_0x49507c+'-'+_0x360df2+'/'+_0x3ae99b)[_0xd225('0x1e')](_0x5c117c);}return null;};}function patchUpdates(_0x3bf02a){return function(_0x56c92b){try{jsonpatch[_0xd225('0x24')](_0x56c92b,_0x3bf02a,!![]);}catch(_0x38b457){return BPromise[_0xd225('0x25')](_0x38b457);}return _0x56c92b[_0xd225('0x26')]();};}function saveUpdates(_0x3cc26a,_0x390243){return function(_0x2a1062){if(_0x2a1062){return _0x2a1062[_0xd225('0x27')](_0x3cc26a)['then'](function(_0x2c04e2){return _0x2c04e2;});}return null;};}function removeEntity(_0x65e9de,_0xd6d126){return function(_0x2a22b8){if(_0x2a22b8){return _0x2a22b8[_0xd225('0x28')]()['then'](function(){_0x65e9de[_0xd225('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bf473,_0x54c574){return function(_0xd02c37){if(!_0xd02c37){_0x2bf473[_0xd225('0x1b')](0x194);}return _0xd02c37;};}function handleError(_0x468fb8,_0x3dd2aa){_0x3dd2aa=_0x3dd2aa||0x1f4;return function(_0x5a8f9d){logger[_0xd225('0x29')](_0x5a8f9d[_0xd225('0x2a')]);if(_0x5a8f9d['name']){delete _0x5a8f9d['name'];}_0x468fb8[_0xd225('0x1c')](_0x3dd2aa)['send'](_0x5a8f9d);};}exports[_0xd225('0x2b')]=function(_0x96e1aa,_0x3eae5a){var _0x40c27e={},_0x147313={},_0x2c0d49={'count':0x0,'rows':[]};var _0x133c74=_[_0xd225('0x2c')](db[_0xd225('0x2d')]['rawAttributes'],function(_0x23b41d){return{'name':_0x23b41d['fieldName'],'type':_0x23b41d[_0xd225('0x2e')][_0xd225('0x2f')]};});_0x147313[_0xd225('0x30')]=_[_0xd225('0x2c')](_0x133c74,_0xd225('0x31'));_0x147313['query']=_['keys'](_0x96e1aa[_0xd225('0x32')]);_0x147313[_0xd225('0x33')]=_[_0xd225('0x34')](_0x147313[_0xd225('0x30')],_0x147313[_0xd225('0x32')]);_0x40c27e[_0xd225('0x35')]=_[_0xd225('0x34')](_0x147313[_0xd225('0x30')],qs[_0xd225('0x36')](_0x96e1aa['query'][_0xd225('0x36')]));_0x40c27e[_0xd225('0x35')]=_0x40c27e['attributes'][_0xd225('0x37')]?_0x40c27e[_0xd225('0x35')]:_0x147313['model'];if(!_0x96e1aa[_0xd225('0x32')][_0xd225('0x38')](_0xd225('0x39'))){_0x40c27e[_0xd225('0x20')]=qs['limit'](_0x96e1aa['query']['limit']);_0x40c27e[_0xd225('0x22')]=qs[_0xd225('0x22')](_0x96e1aa[_0xd225('0x32')]['offset']);}_0x40c27e[_0xd225('0x3a')]=qs[_0xd225('0x3b')](_0x96e1aa[_0xd225('0x32')]['sort']);_0x40c27e[_0xd225('0x3c')]=qs[_0xd225('0x33')](_[_0xd225('0x3d')](_0x96e1aa['query'],_0x147313[_0xd225('0x33')]),_0x133c74);if(_0x96e1aa[_0xd225('0x32')]['filter']){_0x40c27e[_0xd225('0x3c')]=_[_0xd225('0x3e')](_0x40c27e[_0xd225('0x3c')],{'$or':_[_0xd225('0x2c')](_0x133c74,function(_0x131a17){if(_0x131a17[_0xd225('0x2e')]!==_0xd225('0x3f')){var _0x5e7c75={};_0x5e7c75[_0x131a17['name']]={'$like':'%'+_0x96e1aa[_0xd225('0x32')][_0xd225('0x40')]+'%'};return _0x5e7c75;}})});}_0x40c27e=_[_0xd225('0x3e')]({},_0x40c27e,_0x96e1aa['options']);var _0x4e0453={'where':_0x40c27e['where']};return db[_0xd225('0x2d')][_0xd225('0x21')](_0x4e0453)[_0xd225('0x41')](function(_0x5cb6a8){_0x2c0d49[_0xd225('0x21')]=_0x5cb6a8;if(_0x96e1aa[_0xd225('0x32')][_0xd225('0x42')]){_0x40c27e['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xd225('0x43')](_0x40c27e);})[_0xd225('0x41')](function(_0x10a475){_0x2c0d49[_0xd225('0x44')]=_0x10a475;return _0x2c0d49;})[_0xd225('0x41')](respondWithFilteredResult(_0x3eae5a,_0x40c27e))[_0xd225('0x45')](handleError(_0x3eae5a,null));};exports[_0xd225('0x46')]=function(_0x11b919,_0x59502a){var _0x13e67c={'raw':![],'where':{'id':_0x11b919[_0xd225('0x47')]['id']}},_0x4de696={};_0x4de696[_0xd225('0x30')]=_[_0xd225('0x48')](db[_0xd225('0x2d')][_0xd225('0x49')]);_0x4de696[_0xd225('0x32')]=_[_0xd225('0x48')](_0x11b919['query']);_0x4de696[_0xd225('0x33')]=_['intersection'](_0x4de696[_0xd225('0x30')],_0x4de696[_0xd225('0x32')]);_0x13e67c[_0xd225('0x35')]=_[_0xd225('0x34')](_0x4de696[_0xd225('0x30')],qs[_0xd225('0x36')](_0x11b919['query'][_0xd225('0x36')]));_0x13e67c[_0xd225('0x35')]=_0x13e67c[_0xd225('0x35')][_0xd225('0x37')]?_0x13e67c[_0xd225('0x35')]:_0x4de696[_0xd225('0x30')];if(_0x11b919['query'][_0xd225('0x42')]){_0x13e67c[_0xd225('0x4a')]=[{'all':!![]}];}_0x13e67c=_[_0xd225('0x3e')]({},_0x13e67c,_0x11b919[_0xd225('0x4b')]);return db[_0xd225('0x2d')]['find'](_0x13e67c)[_0xd225('0x41')](handleEntityNotFound(_0x59502a,null))[_0xd225('0x41')](respondWithResult(_0x59502a,null))[_0xd225('0x45')](handleError(_0x59502a,null));};exports[_0xd225('0x4c')]=function(_0x290513,_0x5a4353){return db[_0xd225('0x2d')]['create'](_0x290513['body'],{})[_0xd225('0x41')](respondWithResult(_0x5a4353,0xc9))['catch'](handleError(_0x5a4353,null));};exports['bulkCreate']=function(_0xadf363,_0x362029){return db[_0xd225('0x2d')][_0xd225('0x4d')](_0xadf363['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x362029,0xc9))[_0xd225('0x45')](handleError(_0x362029,null));};exports['update']=function(_0x2471f1,_0x410a35){if(_0x2471f1[_0xd225('0x4e')]['id']){delete _0x2471f1['body']['id'];}return db[_0xd225('0x2d')][_0xd225('0x4f')]({'where':{'id':_0x2471f1[_0xd225('0x47')]['id']}})[_0xd225('0x41')](handleEntityNotFound(_0x410a35,null))[_0xd225('0x41')](saveUpdates(_0x2471f1[_0xd225('0x4e')],null))['then'](respondWithResult(_0x410a35,null))[_0xd225('0x45')](handleError(_0x410a35,null));};exports['destroy']=function(_0x286f9a,_0x405072){return db[_0xd225('0x2d')]['find']({'where':{'id':_0x286f9a[_0xd225('0x47')]['id']}})['then'](handleEntityNotFound(_0x405072,null))[_0xd225('0x41')](removeEntity(_0x405072,null))[_0xd225('0x45')](handleError(_0x405072,null));};exports[_0xd225('0x50')]=function(_0x52ea79,_0x335ac6){return db['AnalyticFieldReport'][_0xd225('0x28')]({'where':{'id':_0x52ea79[_0xd225('0x32')][_0xd225('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0xd225('0x41')](respondWithResult(_0x335ac6,0xcc))[_0xd225('0x45')](handleError(_0x335ac6,null));};exports[_0xd225('0x52')]=function(_0x2b6fe1,_0x39fa94,_0x5a1925){return db[_0xd225('0x53')][_0xd225('0x54')]({'where':{'id':_0x2b6fe1[_0xd225('0x47')]['id']}})[_0xd225('0x41')](handleEntityNotFound(_0x39fa94,null))['then'](function(_0x18bee9){if(_0x18bee9){return db[_0xd225('0x55')][_0xd225('0x56')](function(_0x3d08fa){return db[_0xd225('0x2d')][_0xd225('0x28')]({'where':{'CustomReportId':_0x2b6fe1[_0xd225('0x47')]['id']},'transaction':_0x3d08fa})[_0xd225('0x41')](function(_0x469ff6){var _0x41aece=_[_0xd225('0x2c')](_0x2b6fe1[_0xd225('0x4e')],function(_0x3d7ab8){delete _0x3d7ab8['id'];_0x3d7ab8[_0xd225('0x57')]=_0x2b6fe1[_0xd225('0x47')]['id'];return _0x3d7ab8;});return db[_0xd225('0x2d')]['bulkCreate'](_0x41aece,{'transaction':_0x3d08fa});});})[_0xd225('0x41')](function(){return db['AnalyticFieldReport'][_0xd225('0x43')]({'where':{'CustomReportId':_0x2b6fe1[_0xd225('0x47')]['id']}});});}})[_0xd225('0x41')](respondWithResult(_0x39fa94,null))['catch'](handleError(_0x39fa94,null));}; \ No newline at end of file +var _0x5a52=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','options','includeAll','rows','params','include','find','create','catch','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','CustomReportId','findAll','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','ioredis','../../components/parsers/qs'];(function(_0x135b81,_0x39db4b){var _0x5d8a8e=function(_0x3a7614){while(--_0x3a7614){_0x135b81['push'](_0x135b81['shift']());}};_0x5d8a8e(++_0x39db4b);}(_0x5a52,0x178));var _0x25a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a52[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x25a5('0x0'));var rimraf=require(_0x25a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x25a5('0x2'));var moment=require(_0x25a5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x25a5('0x4'));var path=require(_0x25a5('0x5'));var sox=require(_0x25a5('0x6'));var csv=require(_0x25a5('0x7'));var ejs=require(_0x25a5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25a5('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x25a5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x25a5('0x7'));var querystring=require(_0x25a5('0xb'));var Papa=require('papaparse');var Redis=require(_0x25a5('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x25a5('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x25a5('0xe'))(_0x25a5('0xf'));var utils=require(_0x25a5('0x10'));var config=require(_0x25a5('0x11'));var licenseUtil=require(_0x25a5('0x12'));var db=require(_0x25a5('0x13'))['db'];function respondWithStatusCode(_0x1e052b,_0x5c92f3){_0x5c92f3=_0x5c92f3||0xcc;return function(_0x322eb0){if(_0x322eb0){return _0x1e052b['sendStatus'](_0x5c92f3);}return _0x1e052b['status'](_0x5c92f3)[_0x25a5('0x14')]();};}function respondWithResult(_0x1ba7a0,_0x301cfd){_0x301cfd=_0x301cfd||0xc8;return function(_0x2c2f0f){if(_0x2c2f0f){return _0x1ba7a0[_0x25a5('0x15')](_0x301cfd)[_0x25a5('0x16')](_0x2c2f0f);}};}function respondWithFilteredResult(_0x1b2899,_0x5ac1b5){return function(_0x104bf2){if(_0x104bf2){var _0x325d5e=typeof _0x5ac1b5['offset']==='undefined'&&typeof _0x5ac1b5[_0x25a5('0x17')]===_0x25a5('0x18');var _0x465b60=_0x104bf2[_0x25a5('0x19')];var _0x7570e3=_0x325d5e?0x0:_0x5ac1b5['offset'];var _0x28d24e=_0x325d5e?_0x104bf2[_0x25a5('0x19')]:_0x5ac1b5[_0x25a5('0x1a')]+_0x5ac1b5[_0x25a5('0x17')];var _0x1e69d1;if(_0x28d24e>=_0x465b60){_0x28d24e=_0x465b60;_0x1e69d1=0xc8;}else{_0x1e69d1=0xce;}_0x1b2899[_0x25a5('0x15')](_0x1e69d1);return _0x1b2899[_0x25a5('0x1b')](_0x25a5('0x1c'),_0x7570e3+'-'+_0x28d24e+'/'+_0x465b60)[_0x25a5('0x16')](_0x104bf2);}return null;};}function patchUpdates(_0x321f5a){return function(_0x523964){try{jsonpatch[_0x25a5('0x1d')](_0x523964,_0x321f5a,!![]);}catch(_0x211950){return BPromise['reject'](_0x211950);}return _0x523964[_0x25a5('0x1e')]();};}function saveUpdates(_0x2d62bf,_0x49639f){return function(_0x44a6f3){if(_0x44a6f3){return _0x44a6f3[_0x25a5('0x1f')](_0x2d62bf)[_0x25a5('0x20')](function(_0x36ca77){return _0x36ca77;});}return null;};}function removeEntity(_0x1db32c,_0x21dce7){return function(_0x1ed064){if(_0x1ed064){return _0x1ed064[_0x25a5('0x21')]()['then'](function(){_0x1db32c[_0x25a5('0x15')](0xcc)[_0x25a5('0x14')]();});}};}function handleEntityNotFound(_0x50016d,_0x104dc0){return function(_0x2ad39a){if(!_0x2ad39a){_0x50016d[_0x25a5('0x22')](0x194);}return _0x2ad39a;};}function handleError(_0x301f68,_0x2f11cf){_0x2f11cf=_0x2f11cf||0x1f4;return function(_0xd343e){logger[_0x25a5('0x23')](_0xd343e['stack']);if(_0xd343e['name']){delete _0xd343e[_0x25a5('0x24')];}_0x301f68[_0x25a5('0x15')](_0x2f11cf)[_0x25a5('0x25')](_0xd343e);};}exports[_0x25a5('0x26')]=function(_0x34f168,_0x4c6b32){var _0x536363={},_0x4b56bc={},_0x59afd4={'count':0x0,'rows':[]};var _0x43764a=_[_0x25a5('0x27')](db[_0x25a5('0x28')][_0x25a5('0x29')],function(_0x2511f6){return{'name':_0x2511f6[_0x25a5('0x2a')],'type':_0x2511f6['type'][_0x25a5('0x2b')]};});_0x4b56bc[_0x25a5('0x2c')]=_[_0x25a5('0x27')](_0x43764a,_0x25a5('0x24'));_0x4b56bc[_0x25a5('0x2d')]=_[_0x25a5('0x2e')](_0x34f168['query']);_0x4b56bc[_0x25a5('0x2f')]=_[_0x25a5('0x30')](_0x4b56bc['model'],_0x4b56bc['query']);_0x536363[_0x25a5('0x31')]=_['intersection'](_0x4b56bc[_0x25a5('0x2c')],qs['fields'](_0x34f168['query'][_0x25a5('0x32')]));_0x536363[_0x25a5('0x31')]=_0x536363[_0x25a5('0x31')][_0x25a5('0x33')]?_0x536363[_0x25a5('0x31')]:_0x4b56bc[_0x25a5('0x2c')];if(!_0x34f168[_0x25a5('0x2d')][_0x25a5('0x34')](_0x25a5('0x35'))){_0x536363['limit']=qs['limit'](_0x34f168['query'][_0x25a5('0x17')]);_0x536363['offset']=qs['offset'](_0x34f168[_0x25a5('0x2d')][_0x25a5('0x1a')]);}_0x536363[_0x25a5('0x36')]=qs[_0x25a5('0x37')](_0x34f168[_0x25a5('0x2d')]['sort']);_0x536363['where']=qs[_0x25a5('0x2f')](_[_0x25a5('0x38')](_0x34f168[_0x25a5('0x2d')],_0x4b56bc[_0x25a5('0x2f')]),_0x43764a);if(_0x34f168[_0x25a5('0x2d')][_0x25a5('0x39')]){_0x536363['where']=_[_0x25a5('0x3a')](_0x536363[_0x25a5('0x3b')],{'$or':_[_0x25a5('0x27')](_0x43764a,function(_0x1b368f){if(_0x1b368f[_0x25a5('0x3c')]!=='VIRTUAL'){var _0x29f5ab={};_0x29f5ab[_0x1b368f['name']]={'$like':'%'+_0x34f168[_0x25a5('0x2d')][_0x25a5('0x39')]+'%'};return _0x29f5ab;}})});}_0x536363=_[_0x25a5('0x3a')]({},_0x536363,_0x34f168[_0x25a5('0x3d')]);var _0x37874b={'where':_0x536363[_0x25a5('0x3b')]};return db[_0x25a5('0x28')][_0x25a5('0x19')](_0x37874b)[_0x25a5('0x20')](function(_0x47ad3e){_0x59afd4[_0x25a5('0x19')]=_0x47ad3e;if(_0x34f168[_0x25a5('0x2d')][_0x25a5('0x3e')]){_0x536363['include']=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x536363);})[_0x25a5('0x20')](function(_0x548da3){_0x59afd4[_0x25a5('0x3f')]=_0x548da3;return _0x59afd4;})[_0x25a5('0x20')](respondWithFilteredResult(_0x4c6b32,_0x536363))['catch'](handleError(_0x4c6b32,null));};exports['show']=function(_0x4fcff6,_0x68125e){var _0x46bbcf={'raw':![],'where':{'id':_0x4fcff6[_0x25a5('0x40')]['id']}},_0xc32aaf={};_0xc32aaf[_0x25a5('0x2c')]=_[_0x25a5('0x2e')](db[_0x25a5('0x28')][_0x25a5('0x29')]);_0xc32aaf['query']=_[_0x25a5('0x2e')](_0x4fcff6['query']);_0xc32aaf['filters']=_[_0x25a5('0x30')](_0xc32aaf['model'],_0xc32aaf[_0x25a5('0x2d')]);_0x46bbcf['attributes']=_[_0x25a5('0x30')](_0xc32aaf[_0x25a5('0x2c')],qs['fields'](_0x4fcff6['query'][_0x25a5('0x32')]));_0x46bbcf[_0x25a5('0x31')]=_0x46bbcf['attributes'][_0x25a5('0x33')]?_0x46bbcf['attributes']:_0xc32aaf[_0x25a5('0x2c')];if(_0x4fcff6[_0x25a5('0x2d')][_0x25a5('0x3e')]){_0x46bbcf[_0x25a5('0x41')]=[{'all':!![]}];}_0x46bbcf=_[_0x25a5('0x3a')]({},_0x46bbcf,_0x4fcff6[_0x25a5('0x3d')]);return db[_0x25a5('0x28')][_0x25a5('0x42')](_0x46bbcf)[_0x25a5('0x20')](handleEntityNotFound(_0x68125e,null))['then'](respondWithResult(_0x68125e,null))['catch'](handleError(_0x68125e,null));};exports['create']=function(_0xe6d3e6,_0x54dd9b){return db['AnalyticFieldReport'][_0x25a5('0x43')](_0xe6d3e6['body'],{})['then'](respondWithResult(_0x54dd9b,0xc9))[_0x25a5('0x44')](handleError(_0x54dd9b,null));};exports[_0x25a5('0x45')]=function(_0x10e3b0,_0x17d5fa){return db['AnalyticFieldReport'][_0x25a5('0x45')](_0x10e3b0[_0x25a5('0x46')],{'raw':![],'individualHooks':!![]})[_0x25a5('0x20')](respondWithResult(_0x17d5fa,0xc9))['catch'](handleError(_0x17d5fa,null));};exports[_0x25a5('0x1f')]=function(_0x57d518,_0x330cc4){if(_0x57d518[_0x25a5('0x46')]['id']){delete _0x57d518[_0x25a5('0x46')]['id'];}return db['AnalyticFieldReport'][_0x25a5('0x42')]({'where':{'id':_0x57d518['params']['id']}})[_0x25a5('0x20')](handleEntityNotFound(_0x330cc4,null))[_0x25a5('0x20')](saveUpdates(_0x57d518['body'],null))[_0x25a5('0x20')](respondWithResult(_0x330cc4,null))[_0x25a5('0x44')](handleError(_0x330cc4,null));};exports['destroy']=function(_0x33ca67,_0xeec670){return db['AnalyticFieldReport']['find']({'where':{'id':_0x33ca67[_0x25a5('0x40')]['id']}})[_0x25a5('0x20')](handleEntityNotFound(_0xeec670,null))[_0x25a5('0x20')](removeEntity(_0xeec670,null))['catch'](handleError(_0xeec670,null));};exports[_0x25a5('0x47')]=function(_0x2eb04a,_0x3a5457){return db[_0x25a5('0x28')][_0x25a5('0x21')]({'where':{'id':_0x2eb04a[_0x25a5('0x2d')][_0x25a5('0x48')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3a5457,0xcc))[_0x25a5('0x44')](handleError(_0x3a5457,null));};exports[_0x25a5('0x49')]=function(_0x45a49f,_0x463376,_0x2f5ef4){return db[_0x25a5('0x4a')][_0x25a5('0x4b')]({'where':{'id':_0x45a49f[_0x25a5('0x40')]['id']}})[_0x25a5('0x20')](handleEntityNotFound(_0x463376,null))[_0x25a5('0x20')](function(_0xadcf0c){if(_0xadcf0c){return db['sequelize']['transaction'](function(_0x3afee){return db[_0x25a5('0x28')][_0x25a5('0x21')]({'where':{'CustomReportId':_0x45a49f[_0x25a5('0x40')]['id']},'transaction':_0x3afee})[_0x25a5('0x20')](function(_0x228608){var _0x4efb01=_[_0x25a5('0x27')](_0x45a49f[_0x25a5('0x46')],function(_0x165a7f){delete _0x165a7f['id'];_0x165a7f[_0x25a5('0x4c')]=_0x45a49f['params']['id'];return _0x165a7f;});return db[_0x25a5('0x28')][_0x25a5('0x45')](_0x4efb01,{'transaction':_0x3afee});});})['then'](function(){return db[_0x25a5('0x28')][_0x25a5('0x4d')]({'where':{'CustomReportId':_0x45a49f[_0x25a5('0x40')]['id']}});});}})['then'](respondWithResult(_0x463376,null))[_0x25a5('0x44')](handleError(_0x463376,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index d47e6f9..9d7c106 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 _0xceb9=['request-promise','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','moment','bluebird'];(function(_0x2cbf0c,_0x372a64){var _0x3a3f47=function(_0x571cc0){while(--_0x571cc0){_0x2cbf0c['push'](_0x2cbf0c['shift']());}};_0x3a3f47(++_0x372a64);}(_0xceb9,0xb0));var _0x9ceb=function(_0xc10d36,_0x2e3e63){_0xc10d36=_0xc10d36-0x0;var _0x274999=_0xceb9[_0xc10d36];return _0x274999;};'use strict';var _=require(_0x9ceb('0x0'));var util=require('util');var logger=require(_0x9ceb('0x1'))('api');var moment=require(_0x9ceb('0x2'));var BPromise=require(_0x9ceb('0x3'));var rp=require(_0x9ceb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9ceb('0x5'));module[_0x9ceb('0x6')]=function(_0x340d09,_0x4c7647){return _0x340d09[_0x9ceb('0x7')](_0x9ceb('0x8'),attributes,{'tableName':_0x9ceb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a14=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x4a14,0x11e));var _0x44a1=function(_0xb06ca0,_0x1afdfd){_0xb06ca0=_0xb06ca0-0x0;var _0x2dfd9b=_0x4a14[_0xb06ca0];return _0x2dfd9b;};'use strict';var _=require(_0x44a1('0x0'));var util=require(_0x44a1('0x1'));var logger=require(_0x44a1('0x2'))(_0x44a1('0x3'));var moment=require('moment');var BPromise=require(_0x44a1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x44a1('0x5'));var rimraf=require(_0x44a1('0x6'));var config=require(_0x44a1('0x7'));var attributes=require(_0x44a1('0x8'));module[_0x44a1('0x9')]=function(_0x3512c7,_0x5e5b0b){return _0x3512c7['define'](_0x44a1('0xa'),attributes,{'tableName':_0x44a1('0xb'),'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 2f99354..42a9a77 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 _0x6293=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug'];(function(_0x498874,_0x34a63d){var _0x21f0fe=function(_0xf0eff5){while(--_0xf0eff5){_0x498874['push'](_0x498874['shift']());}};_0x21f0fe(++_0x34a63d);}(_0x6293,0x133));var _0x3629=function(_0x377199,_0x1439fa){_0x377199=_0x377199-0x0;var _0x501155=_0x6293[_0x377199];return _0x501155;};'use strict';var _=require(_0x3629('0x0'));var util=require(_0x3629('0x1'));var moment=require(_0x3629('0x2'));var BPromise=require(_0x3629('0x3'));var rs=require(_0x3629('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3629('0x5'));var logger=require('../../config/logger')(_0x3629('0x6'));var config=require(_0x3629('0x7'));var jayson=require(_0x3629('0x8'));var client=jayson[_0x3629('0x9')][_0x3629('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19b9d1,_0x1f0674,_0x37ab80){return new BPromise(function(_0x1d1361,_0x13a07b){return client['request'](_0x19b9d1,_0x37ab80)[_0x3629('0xb')](function(_0x488b43){logger[_0x3629('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1f0674,_0x3629('0xd'));logger[_0x3629('0xe')](_0x3629('0xf'),_0x1f0674,'request\x20sent',JSON[_0x3629('0x10')](_0x488b43));if(_0x488b43[_0x3629('0x11')]){if(_0x488b43[_0x3629('0x11')][_0x3629('0x12')]===0x1f4){logger[_0x3629('0x11')](_0x3629('0x13'),_0x1f0674,_0x488b43[_0x3629('0x11')][_0x3629('0x14')]);return _0x13a07b(_0x488b43[_0x3629('0x11')]['message']);}logger[_0x3629('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1f0674,_0x488b43[_0x3629('0x11')][_0x3629('0x14')]);return _0x1d1361(_0x488b43[_0x3629('0x11')][_0x3629('0x14')]);}else{logger[_0x3629('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1f0674,_0x3629('0xd'));_0x1d1361(_0x488b43[_0x3629('0x15')][_0x3629('0x14')]);}})[_0x3629('0x16')](function(_0x55dbde){logger[_0x3629('0x11')](_0x3629('0x13'),_0x1f0674,_0x55dbde);_0x13a07b(_0x55dbde);});});} \ No newline at end of file +var _0x6978=['request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x1eccf0,_0x4a4efe){var _0x582f43=function(_0x27ad67){while(--_0x27ad67){_0x1eccf0['push'](_0x1eccf0['shift']());}};_0x582f43(++_0x4a4efe);}(_0x6978,0x16f));var _0x8697=function(_0x108d5f,_0x33f82d){_0x108d5f=_0x108d5f-0x0;var _0x456ea3=_0x6978[_0x108d5f];return _0x456ea3;};'use strict';var _=require(_0x8697('0x0'));var util=require(_0x8697('0x1'));var moment=require(_0x8697('0x2'));var BPromise=require(_0x8697('0x3'));var rs=require(_0x8697('0x4'));var fs=require('fs');var Redis=require(_0x8697('0x5'));var db=require(_0x8697('0x6'))['db'];var utils=require(_0x8697('0x7'));var logger=require(_0x8697('0x8'))(_0x8697('0x9'));var config=require(_0x8697('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8697('0xb')][_0x8697('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a9458,_0x5d223a,_0x188ab8){return new BPromise(function(_0x1482f0,_0x1f18cb){return client[_0x8697('0xd')](_0x5a9458,_0x188ab8)[_0x8697('0xe')](function(_0x4517db){logger[_0x8697('0xf')](_0x8697('0x10'),_0x5d223a,_0x8697('0x11'));logger[_0x8697('0x12')](_0x8697('0x13'),_0x5d223a,_0x8697('0x11'),JSON['stringify'](_0x4517db));if(_0x4517db['error']){if(_0x4517db[_0x8697('0x14')][_0x8697('0x15')]===0x1f4){logger[_0x8697('0x14')](_0x8697('0x10'),_0x5d223a,_0x4517db[_0x8697('0x14')][_0x8697('0x16')]);return _0x1f18cb(_0x4517db[_0x8697('0x14')][_0x8697('0x16')]);}logger['error'](_0x8697('0x10'),_0x5d223a,_0x4517db['error']['message']);return _0x1482f0(_0x4517db['error']['message']);}else{logger[_0x8697('0xf')](_0x8697('0x10'),_0x5d223a,'request\x20sent');_0x1482f0(_0x4517db[_0x8697('0x17')][_0x8697('0x16')]);}})['catch'](function(_0x1d995c){logger['error'](_0x8697('0x10'),_0x5d223a,_0x1d995c);_0x1f18cb(_0x1d995c);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index f2a0742..57902f6 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(_0x2ffc0a,_0x47604a){var _0x47ee3d=function(_0x49012a){while(--_0x49012a){_0x2ffc0a['push'](_0x2ffc0a['shift']());}};_0x47ee3d(++_0x47604a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x2fe63d,_0x5b80ac){var _0x11b001=function(_0x573030){while(--_0x573030){_0x2fe63d['push'](_0x2fe63d['shift']());}};_0x11b001(++_0x5b80ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 eaf838e..d91ca14 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 _0xf958=['sequelize','STRING'];(function(_0x4a3323,_0x4f1468){var _0x3c8181=function(_0x4f7bd7){while(--_0x4f7bd7){_0x4a3323['push'](_0x4a3323['shift']());}};_0x3c8181(++_0x4f1468);}(_0xf958,0xe6));var _0x8f95=function(_0x44a77a,_0x52408e){_0x44a77a=_0x44a77a-0x0;var _0x69fb42=_0xf958[_0x44a77a];return _0x69fb42;};'use strict';var Sequelize=require(_0x8f95('0x0'));module['exports']={'name':{'type':Sequelize[_0x8f95('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x8f95('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x8f95('0x1')]}}; \ No newline at end of file +var _0x96cc=['TEXT','sequelize','STRING'];(function(_0x30bb30,_0x564af1){var _0xce44e7=function(_0x5b96aa){while(--_0x5b96aa){_0x30bb30['push'](_0x30bb30['shift']());}};_0xce44e7(++_0x564af1);}(_0x96cc,0x16c));var _0xc96c=function(_0x2d41fc,_0x58b122){_0x2d41fc=_0x2d41fc-0x0;var _0x51473d=_0x96cc[_0x2d41fc];return _0x51473d;};'use strict';var Sequelize=require(_0xc96c('0x0'));module['exports']={'name':{'type':Sequelize[_0xc96c('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xc96c('0x1')]},'metric':{'type':Sequelize[_0xc96c('0x2')]},'description':{'type':Sequelize[_0xc96c('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 1233bf4..28a2785 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 _0x7da7=['model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','options','where','AnalyticMetric','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x7da7,0x10d));var _0x77da=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0x7da7[_0x5cab28];return _0xa3554d;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x23')]({'plain':!![]});var _0x2d009f=_0x77da('0x24');return db[_0x77da('0x25')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x21')](function(){return _0x270318;});})[_0x77da('0x21')](function(){_0x27b6c7[_0x77da('0x18')](0xcc)[_0x77da('0x26')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x17')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x18')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=_[_0x77da('0x2a')](db['AnalyticMetric'][_0x77da('0x2b')],function(_0x228851){return{'name':_0x228851[_0x77da('0x2c')],'type':_0x228851[_0x77da('0x2d')][_0x77da('0x2e')]};});_0x356bfb[_0x77da('0x2f')]=_[_0x77da('0x2a')](_0x1e7853,_0x77da('0x27'));_0x356bfb['query']=_['keys'](_0x4eeb99[_0x77da('0x30')]);_0x356bfb[_0x77da('0x31')]=_['intersection'](_0x356bfb[_0x77da('0x2f')],_0x356bfb[_0x77da('0x30')]);_0x26f5a0[_0x77da('0x32')]=_[_0x77da('0x33')](_0x356bfb[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x4eeb99[_0x77da('0x30')]['fields']));_0x26f5a0[_0x77da('0x32')]=_0x26f5a0['attributes']['length']?_0x26f5a0['attributes']:_0x356bfb[_0x77da('0x2f')];if(!_0x4eeb99['query'][_0x77da('0x35')](_0x77da('0x36'))){_0x26f5a0[_0x77da('0x1c')]=qs[_0x77da('0x1c')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x1c')]);_0x26f5a0[_0x77da('0x19')]=qs['offset'](_0x4eeb99[_0x77da('0x30')][_0x77da('0x19')]);}_0x26f5a0[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x38')]);_0x26f5a0['where']=qs[_0x77da('0x31')](_[_0x77da('0x39')](_0x4eeb99[_0x77da('0x30')],_0x356bfb['filters']),_0x1e7853);if(_0x4eeb99[_0x77da('0x30')]['filter']){_0x26f5a0['where']=_['merge'](_0x26f5a0['where'],{'$or':_[_0x77da('0x2a')](_0x1e7853,function(_0x1adba5){if(_0x1adba5[_0x77da('0x2d')]!=='VIRTUAL'){var _0x21d337={};_0x21d337[_0x1adba5['name']]={'$like':'%'+_0x4eeb99[_0x77da('0x30')]['filter']+'%'};return _0x21d337;}})});}_0x26f5a0=_[_0x77da('0x3a')]({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x290667={'where':_0x26f5a0[_0x77da('0x3c')]};return db[_0x77da('0x3d')]['count'](_0x290667)[_0x77da('0x21')](function(_0x1f48bd){_0x1d381b[_0x77da('0x1b')]=_0x1f48bd;if(_0x4eeb99[_0x77da('0x30')][_0x77da('0x3e')]){_0x26f5a0[_0x77da('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x77da('0x40')](_0x26f5a0);})[_0x77da('0x21')](function(_0x21de41){_0x1d381b[_0x77da('0x41')]=_0x21de41;return _0x1d381b;})[_0x77da('0x21')](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x42')](handleError(_0x350b4e,null));};exports['show']=function(_0x10957b,_0x5abcd9){var _0x1ae806={'raw':!![],'where':{'id':_0x10957b[_0x77da('0x43')]['id']}},_0x373fb2={};_0x373fb2['model']=_[_0x77da('0x44')](db[_0x77da('0x3d')][_0x77da('0x2b')]);_0x373fb2[_0x77da('0x30')]=_[_0x77da('0x44')](_0x10957b[_0x77da('0x30')]);_0x373fb2[_0x77da('0x31')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],_0x373fb2['query']);_0x1ae806[_0x77da('0x32')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x10957b[_0x77da('0x30')][_0x77da('0x34')]));_0x1ae806['attributes']=_0x1ae806['attributes'][_0x77da('0x45')]?_0x1ae806[_0x77da('0x32')]:_0x373fb2[_0x77da('0x2f')];if(_0x10957b[_0x77da('0x30')][_0x77da('0x3e')]){_0x1ae806[_0x77da('0x3f')]=[{'all':!![]}];}_0x1ae806=_['merge']({},_0x1ae806,_0x10957b[_0x77da('0x3b')]);return db[_0x77da('0x3d')][_0x77da('0x46')](_0x1ae806)[_0x77da('0x21')](handleEntityNotFound(_0x5abcd9,null))['then'](respondWithResult(_0x5abcd9,null))[_0x77da('0x42')](handleError(_0x5abcd9,null));};exports['create']=function(_0x518fd5,_0x36263b){return db[_0x77da('0x3d')][_0x77da('0x47')](_0x518fd5[_0x77da('0x48')],{})['then'](function(_0x16bf4b){var _0x1e36ee=_0x518fd5['user'][_0x77da('0x23')]({'plain':!![]});if(!_0x1e36ee)throw new Error(_0x77da('0x49'));if(_0x1e36ee['role']===_0x77da('0x4a')){var _0x3aaf5b=_0x16bf4b[_0x77da('0x23')]({'plain':!![]});var _0xef2496=_0x77da('0x24');return db[_0x77da('0x4b')][_0x77da('0x46')]({'where':{'name':_0xef2496,'userProfileId':_0x1e36ee[_0x77da('0x4c')]},'raw':!![]})[_0x77da('0x21')](function(_0x3a34a8){if(_0x3a34a8&&_0x3a34a8['autoAssociation']===0x0){return db[_0x77da('0x25')]['create']({'name':_0x3aaf5b[_0x77da('0x27')],'resourceId':_0x3aaf5b['id'],'type':_0x3a34a8[_0x77da('0x27')],'sectionId':_0x3a34a8['id']},{})[_0x77da('0x21')](function(){return _0x16bf4b;});}else{return _0x16bf4b;}})[_0x77da('0x42')](function(_0x374179){logger[_0x77da('0x4d')](_0x77da('0x4e'),_0x374179);throw _0x374179;});}return _0x16bf4b;})['then'](respondWithResult(_0x36263b,0xc9))[_0x77da('0x42')](handleError(_0x36263b,null));};exports[_0x77da('0x20')]=function(_0x1a7115,_0x353be9){if(_0x1a7115['body']['id']){delete _0x1a7115[_0x77da('0x48')]['id'];}return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x1a7115['params']['id']}})['then'](handleEntityNotFound(_0x353be9,null))[_0x77da('0x21')](saveUpdates(_0x1a7115[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x353be9,null))[_0x77da('0x42')](handleError(_0x353be9,null));};exports[_0x77da('0x22')]=function(_0x528a32,_0x50437b){return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x528a32['params']['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x50437b,null))[_0x77da('0x21')](removeEntity(_0x50437b,null))[_0x77da('0x42')](handleError(_0x50437b,null));}; \ No newline at end of file +var _0x8ef6=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xbc4659,_0x578fba){var _0x5831f9=function(_0x5eb0eb){while(--_0x5eb0eb){_0xbc4659['push'](_0xbc4659['shift']());}};_0x5831f9(++_0x578fba);}(_0x8ef6,0xf2));var _0x68ef=function(_0x13448a,_0x559bd9){_0x13448a=_0x13448a-0x0;var _0x76c5b0=_0x8ef6[_0x13448a];return _0x76c5b0;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){var _0x49374f=_0x438b4c[_0x68ef('0x29')]({'plain':!![]});var _0x13280b='Metrics';return db[_0x68ef('0x2a')]['destroy']({'where':{'type':_0x13280b,'resourceId':_0x49374f['id']}})['then'](function(){return _0x438b4c;});})['then'](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x123041,_0x29518e){return function(_0x52e67e){if(!_0x52e67e){_0x123041['sendStatus'](0x194);}return _0x52e67e;};}function handleError(_0x1cbe4f,_0x28907a){_0x28907a=_0x28907a||0x1f4;return function(_0x7bf96){logger[_0x68ef('0x2b')](_0x7bf96[_0x68ef('0x2c')]);if(_0x7bf96[_0x68ef('0x2d')]){delete _0x7bf96[_0x68ef('0x2d')];}_0x1cbe4f[_0x68ef('0x1d')](_0x28907a)['send'](_0x7bf96);};}exports[_0x68ef('0x2e')]=function(_0x4314bd,_0x132d9e){var _0x4c25aa={},_0x370a8f={},_0x523120={'count':0x0,'rows':[]};var _0x133788=_[_0x68ef('0x2f')](db['AnalyticMetric']['rawAttributes'],function(_0x159395){return{'name':_0x159395[_0x68ef('0x30')],'type':_0x159395['type'][_0x68ef('0x31')]};});_0x370a8f[_0x68ef('0x32')]=_[_0x68ef('0x2f')](_0x133788,_0x68ef('0x2d'));_0x370a8f['query']=_[_0x68ef('0x33')](_0x4314bd[_0x68ef('0x34')]);_0x370a8f['filters']=_[_0x68ef('0x35')](_0x370a8f['model'],_0x370a8f[_0x68ef('0x34')]);_0x4c25aa[_0x68ef('0x36')]=_['intersection'](_0x370a8f[_0x68ef('0x32')],qs['fields'](_0x4314bd[_0x68ef('0x34')]['fields']));_0x4c25aa[_0x68ef('0x36')]=_0x4c25aa[_0x68ef('0x36')][_0x68ef('0x37')]?_0x4c25aa['attributes']:_0x370a8f[_0x68ef('0x32')];if(!_0x4314bd['query'][_0x68ef('0x38')]('nolimit')){_0x4c25aa[_0x68ef('0x21')]=qs[_0x68ef('0x21')](_0x4314bd[_0x68ef('0x34')][_0x68ef('0x21')]);_0x4c25aa[_0x68ef('0x1f')]=qs[_0x68ef('0x1f')](_0x4314bd['query'][_0x68ef('0x1f')]);}_0x4c25aa[_0x68ef('0x39')]=qs[_0x68ef('0x3a')](_0x4314bd['query'][_0x68ef('0x3a')]);_0x4c25aa[_0x68ef('0x3b')]=qs[_0x68ef('0x3c')](_['pick'](_0x4314bd['query'],_0x370a8f[_0x68ef('0x3c')]),_0x133788);if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x3d')]){_0x4c25aa[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x4c25aa[_0x68ef('0x3b')],{'$or':_[_0x68ef('0x2f')](_0x133788,function(_0x5b1246){if(_0x5b1246[_0x68ef('0x3f')]!==_0x68ef('0x40')){var _0x2f6ee0={};_0x2f6ee0[_0x5b1246[_0x68ef('0x2d')]]={'$like':'%'+_0x4314bd['query'][_0x68ef('0x3d')]+'%'};return _0x2f6ee0;}})});}_0x4c25aa=_[_0x68ef('0x3e')]({},_0x4c25aa,_0x4314bd[_0x68ef('0x41')]);var _0x410c10={'where':_0x4c25aa[_0x68ef('0x3b')]};return db[_0x68ef('0x42')]['count'](_0x410c10)[_0x68ef('0x27')](function(_0x3f7699){_0x523120[_0x68ef('0x43')]=_0x3f7699;if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x44')]){_0x4c25aa[_0x68ef('0x45')]=[{'all':!![]}];}return db[_0x68ef('0x42')][_0x68ef('0x46')](_0x4c25aa);})[_0x68ef('0x27')](function(_0x531096){_0x523120[_0x68ef('0x47')]=_0x531096;return _0x523120;})[_0x68ef('0x27')](respondWithFilteredResult(_0x132d9e,_0x4c25aa))[_0x68ef('0x48')](handleError(_0x132d9e,null));};exports[_0x68ef('0x49')]=function(_0xdeacf2,_0x183377){var _0xcac58f={'raw':!![],'where':{'id':_0xdeacf2[_0x68ef('0x4a')]['id']}},_0x576767={};_0x576767['model']=_[_0x68ef('0x33')](db[_0x68ef('0x42')][_0x68ef('0x4b')]);_0x576767[_0x68ef('0x34')]=_['keys'](_0xdeacf2[_0x68ef('0x34')]);_0x576767['filters']=_[_0x68ef('0x35')](_0x576767['model'],_0x576767[_0x68ef('0x34')]);_0xcac58f[_0x68ef('0x36')]=_[_0x68ef('0x35')](_0x576767['model'],qs['fields'](_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x4c')]));_0xcac58f['attributes']=_0xcac58f['attributes']['length']?_0xcac58f[_0x68ef('0x36')]:_0x576767[_0x68ef('0x32')];if(_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x44')]){_0xcac58f[_0x68ef('0x45')]=[{'all':!![]}];}_0xcac58f=_['merge']({},_0xcac58f,_0xdeacf2['options']);return db[_0x68ef('0x42')][_0x68ef('0x4d')](_0xcac58f)[_0x68ef('0x27')](handleEntityNotFound(_0x183377,null))[_0x68ef('0x27')](respondWithResult(_0x183377,null))['catch'](handleError(_0x183377,null));};exports[_0x68ef('0x4e')]=function(_0x474e5a,_0x1c9b6f){return db[_0x68ef('0x42')]['create'](_0x474e5a['body'],{})[_0x68ef('0x27')](function(_0x3c3074){var _0x566e7c=_0x474e5a[_0x68ef('0x4f')][_0x68ef('0x29')]({'plain':!![]});if(!_0x566e7c)throw new Error(_0x68ef('0x50'));if(_0x566e7c[_0x68ef('0x51')]===_0x68ef('0x4f')){var _0x4f0f77=_0x3c3074[_0x68ef('0x29')]({'plain':!![]});var _0x3984ca=_0x68ef('0x52');return db['UserProfileSection'][_0x68ef('0x4d')]({'where':{'name':_0x3984ca,'userProfileId':_0x566e7c[_0x68ef('0x53')]},'raw':!![]})[_0x68ef('0x27')](function(_0x50ef1f){if(_0x50ef1f&&_0x50ef1f[_0x68ef('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4f0f77[_0x68ef('0x2d')],'resourceId':_0x4f0f77['id'],'type':_0x50ef1f['name'],'sectionId':_0x50ef1f['id']},{})[_0x68ef('0x27')](function(){return _0x3c3074;});}else{return _0x3c3074;}})[_0x68ef('0x48')](function(_0x53ebd){logger[_0x68ef('0x2b')](_0x68ef('0x55'),_0x53ebd);throw _0x53ebd;});}return _0x3c3074;})[_0x68ef('0x27')](respondWithResult(_0x1c9b6f,0xc9))[_0x68ef('0x48')](handleError(_0x1c9b6f,null));};exports[_0x68ef('0x56')]=function(_0x2b35f4,_0x247915){if(_0x2b35f4['body']['id']){delete _0x2b35f4['body']['id'];}return db[_0x68ef('0x42')][_0x68ef('0x4d')]({'where':{'id':_0x2b35f4[_0x68ef('0x4a')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x247915,null))[_0x68ef('0x27')](saveUpdates(_0x2b35f4[_0x68ef('0x57')],null))[_0x68ef('0x27')](respondWithResult(_0x247915,null))[_0x68ef('0x48')](handleError(_0x247915,null));};exports[_0x68ef('0x28')]=function(_0x4c2e9c,_0x5685bb){return db[_0x68ef('0x42')]['find']({'where':{'id':_0x4c2e9c[_0x68ef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5685bb,null))[_0x68ef('0x27')](removeEntity(_0x5685bb,null))[_0x68ef('0x48')](handleError(_0x5685bb,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index e41eb38..633b345 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 _0x363e=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics'];(function(_0x37dd7b,_0x29619d){var _0x548856=function(_0x5f62ff){while(--_0x5f62ff){_0x37dd7b['push'](_0x37dd7b['shift']());}};_0x548856(++_0x29619d);}(_0x363e,0x179));var _0xe363=function(_0x3f5b0d,_0x2f5def){_0x3f5b0d=_0x3f5b0d-0x0;var _0x44e766=_0x363e[_0x3f5b0d];return _0x44e766;};'use strict';var _=require(_0xe363('0x0'));var util=require(_0xe363('0x1'));var logger=require('../../config/logger')(_0xe363('0x2'));var moment=require(_0xe363('0x3'));var BPromise=require(_0xe363('0x4'));var rp=require(_0xe363('0x5'));var fs=require('fs');var path=require(_0xe363('0x6'));var rimraf=require(_0xe363('0x7'));var config=require(_0xe363('0x8'));var attributes=require(_0xe363('0x9'));module[_0xe363('0xa')]=function(_0x1834ca,_0x8953cc){return _0x1834ca['define'](_0xe363('0xb'),attributes,{'tableName':_0xe363('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0df=['analytics_metrics','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticMetric'];(function(_0x2082bb,_0x216c62){var _0x8ceeeb=function(_0x2b9a60){while(--_0x2b9a60){_0x2082bb['push'](_0x2082bb['shift']());}};_0x8ceeeb(++_0x216c62);}(_0xb0df,0x85));var _0xfb0d=function(_0x673722,_0x275d7e){_0x673722=_0x673722-0x0;var _0x21249c=_0xb0df[_0x673722];return _0x21249c;};'use strict';var _=require('lodash');var util=require(_0xfb0d('0x0'));var logger=require(_0xfb0d('0x1'))(_0xfb0d('0x2'));var moment=require(_0xfb0d('0x3'));var BPromise=require(_0xfb0d('0x4'));var rp=require(_0xfb0d('0x5'));var fs=require('fs');var path=require(_0xfb0d('0x6'));var rimraf=require(_0xfb0d('0x7'));var config=require(_0xfb0d('0x8'));var attributes=require('./analyticMetric.attributes');module[_0xfb0d('0x9')]=function(_0x12458c,_0x58e4c0){return _0x12458c['define'](_0xfb0d('0xa'),attributes,{'tableName':_0xfb0d('0xb'),'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 62f1a25..f9bd31a 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 _0x8e9b=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info'];(function(_0x19fe09,_0x47cc7c){var _0x514472=function(_0x50e64d){while(--_0x50e64d){_0x19fe09['push'](_0x19fe09['shift']());}};_0x514472(++_0x47cc7c);}(_0x8e9b,0x15e));var _0xb8e9=function(_0x53b3ee,_0x12feb7){_0x53b3ee=_0x53b3ee-0x0;var _0x50fae3=_0x8e9b[_0x53b3ee];return _0x50fae3;};'use strict';var _=require(_0xb8e9('0x0'));var util=require(_0xb8e9('0x1'));var moment=require(_0xb8e9('0x2'));var BPromise=require(_0xb8e9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8e9('0x4'))['db'];var utils=require(_0xb8e9('0x5'));var logger=require('../../config/logger')(_0xb8e9('0x6'));var config=require('../../config/environment');var jayson=require(_0xb8e9('0x7'));var client=jayson[_0xb8e9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f26fa,_0x3de947,_0x783c04){return new BPromise(function(_0x5a2ec5,_0x1168d5){return client[_0xb8e9('0x9')](_0x3f26fa,_0x783c04)['then'](function(_0xfb304f){logger[_0xb8e9('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x3de947,_0xb8e9('0xb'));logger[_0xb8e9('0xc')](_0xb8e9('0xd'),_0x3de947,_0xb8e9('0xb'),JSON[_0xb8e9('0xe')](_0xfb304f));if(_0xfb304f[_0xb8e9('0xf')]){if(_0xfb304f[_0xb8e9('0xf')]['code']===0x1f4){logger[_0xb8e9('0xf')](_0xb8e9('0x10'),_0x3de947,_0xfb304f[_0xb8e9('0xf')][_0xb8e9('0x11')]);return _0x1168d5(_0xfb304f[_0xb8e9('0xf')][_0xb8e9('0x11')]);}logger[_0xb8e9('0xf')](_0xb8e9('0x10'),_0x3de947,_0xfb304f[_0xb8e9('0xf')]['message']);return _0x5a2ec5(_0xfb304f[_0xb8e9('0xf')][_0xb8e9('0x11')]);}else{logger[_0xb8e9('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x3de947,'request\x20sent');_0x5a2ec5(_0xfb304f[_0xb8e9('0x12')][_0xb8e9('0x11')]);}})['catch'](function(_0x3c2b6c){logger['error'](_0xb8e9('0x10'),_0x3de947,_0x3c2b6c);_0x1168d5(_0x3c2b6c);});});} \ No newline at end of file +var _0x4404=['../../config/logger','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x25dd3b,_0x27e043){var _0x3084aa=function(_0x45f3c1){while(--_0x45f3c1){_0x25dd3b['push'](_0x25dd3b['shift']());}};_0x3084aa(++_0x27e043);}(_0x4404,0x16e));var _0x4440=function(_0x494fcb,_0x4f6a92){_0x494fcb=_0x494fcb-0x0;var _0x1a3a98=_0x4404[_0x494fcb];return _0x1a3a98;};'use strict';var _=require(_0x4440('0x0'));var util=require(_0x4440('0x1'));var moment=require(_0x4440('0x2'));var BPromise=require(_0x4440('0x3'));var rs=require(_0x4440('0x4'));var fs=require('fs');var Redis=require(_0x4440('0x5'));var db=require(_0x4440('0x6'))['db'];var utils=require(_0x4440('0x7'));var logger=require(_0x4440('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ed9a8,_0x4626d2,_0x21f35c){return new BPromise(function(_0x57b514,_0x567895){return client[_0x4440('0x9')](_0x1ed9a8,_0x21f35c)[_0x4440('0xa')](function(_0x440080){logger[_0x4440('0xb')](_0x4440('0xc'),_0x4626d2,_0x4440('0xd'));logger[_0x4440('0xe')](_0x4440('0xf'),_0x4626d2,'request\x20sent',JSON[_0x4440('0x10')](_0x440080));if(_0x440080['error']){if(_0x440080[_0x4440('0x11')][_0x4440('0x12')]===0x1f4){logger[_0x4440('0x11')](_0x4440('0xc'),_0x4626d2,_0x440080[_0x4440('0x11')][_0x4440('0x13')]);return _0x567895(_0x440080[_0x4440('0x11')]['message']);}logger['error'](_0x4440('0xc'),_0x4626d2,_0x440080['error'][_0x4440('0x13')]);return _0x57b514(_0x440080[_0x4440('0x11')][_0x4440('0x13')]);}else{logger[_0x4440('0xb')](_0x4440('0xc'),_0x4626d2,'request\x20sent');_0x57b514(_0x440080[_0x4440('0x14')][_0x4440('0x13')]);}})[_0x4440('0x15')](function(_0x502549){logger[_0x4440('0x11')](_0x4440('0xc'),_0x4626d2,_0x502549);_0x567895(_0x502549);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 71fe7d7..5619f4f 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 _0xc838=['../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x275b63,_0x684508){var _0x2d4b9d=function(_0x59acb6){while(--_0x59acb6){_0x275b63['push'](_0x275b63['shift']());}};_0x2d4b9d(++_0x684508);}(_0xc838,0xbd));var _0x8c83=function(_0x3a1405,_0x433caf){_0x3a1405=_0x3a1405-0x0;var _0x2e78f1=_0xc838[_0x3a1405];return _0x2e78f1;};'use strict';var multer=require(_0x8c83('0x0'));var util=require(_0x8c83('0x1'));var path=require(_0x8c83('0x2'));var timeout=require(_0x8c83('0x3'));var express=require(_0x8c83('0x4'));var router=express[_0x8c83('0x5')]();var fs_extra=require(_0x8c83('0x6'));var auth=require(_0x8c83('0x7'));var interaction=require(_0x8c83('0x8'));var config=require(_0x8c83('0x9'));var controller=require(_0x8c83('0xa'));router[_0x8c83('0xb')]('/',auth[_0x8c83('0xc')](),controller[_0x8c83('0xd')]);router[_0x8c83('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x8c83('0xe')]);router['post']('/',auth[_0x8c83('0xc')](),controller[_0x8c83('0xf')]);router[_0x8c83('0x10')](_0x8c83('0x11'),auth[_0x8c83('0xc')](),controller[_0x8c83('0x12')]);router[_0x8c83('0x13')](_0x8c83('0x11'),auth[_0x8c83('0xc')](),controller[_0x8c83('0x14')]);module[_0x8c83('0x15')]=router; \ No newline at end of file +var _0x7412=['delete','destroy','exports','multer','connect-timeout','Router','isAuthenticated','index','get','show','post','put','/:id','update'];(function(_0x307888,_0x2e8d30){var _0x3af557=function(_0x48aa49){while(--_0x48aa49){_0x307888['push'](_0x307888['shift']());}};_0x3af557(++_0x2e8d30);}(_0x7412,0x161));var _0x2741=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x7412[_0xfa634c];return _0x73e478;};'use strict';var multer=require(_0x2741('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2741('0x1'));var express=require('express');var router=express[_0x2741('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x2741('0x3')](),controller[_0x2741('0x4')]);router[_0x2741('0x5')]('/:id',auth[_0x2741('0x3')](),controller[_0x2741('0x6')]);router[_0x2741('0x7')]('/',auth[_0x2741('0x3')](),controller['create']);router[_0x2741('0x8')](_0x2741('0x9'),auth[_0x2741('0x3')](),controller[_0x2741('0xa')]);router[_0x2741('0xb')]('/:id',auth[_0x2741('0x3')](),controller[_0x2741('0xc')]);module[_0x2741('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index fa15121..17b95c1 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 _0x624c=['exports','sequelize'];(function(_0x477017,_0x99a3b){var _0x29bbc9=function(_0x40e1c2){while(--_0x40e1c2){_0x477017['push'](_0x477017['shift']());}};_0x29bbc9(++_0x99a3b);}(_0x624c,0x83));var _0xc624=function(_0x397843,_0xa7173e){_0x397843=_0x397843-0x0;var _0x2ba028=_0x624c[_0x397843];return _0x2ba028;};'use strict';var Sequelize=require(_0xc624('0x0'));module[_0xc624('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0xfb6a=['TEXT','sequelize'];(function(_0x3cfc01,_0x4ea6b9){var _0x52d02c=function(_0x375398){while(--_0x375398){_0x3cfc01['push'](_0x3cfc01['shift']());}};_0x52d02c(++_0x4ea6b9);}(_0xfb6a,0x79));var _0xafb6=function(_0x564e9f,_0x225a15){_0x564e9f=_0x564e9f-0x0;var _0x3a9f3e=_0xfb6a[_0x564e9f];return _0x3a9f3e;};'use strict';var Sequelize=require(_0xafb6('0x0'));module['exports']={'tree':{'type':Sequelize[_0xafb6('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 1659b64..0d051ca 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 _0x22c6=['include','catch','create','body','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','findAll','rows','then','show','params'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x22c6,0x9f));var _0x622c=function(_0x16be52,_0x35af14){_0x16be52=_0x16be52-0x0;var _0x40d854=_0x22c6[_0x16be52];return _0x40d854;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x622c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x622c('0x1'));var rp=require(_0x622c('0x2'));var moment=require(_0x622c('0x3'));var BPromise=require(_0x622c('0x4'));var Mustache=require(_0x622c('0x5'));var util=require(_0x622c('0x6'));var path=require(_0x622c('0x7'));var sox=require(_0x622c('0x8'));var csv=require(_0x622c('0x9'));var ejs=require(_0x622c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x622c('0xb'));var squel=require(_0x622c('0xc'));var crypto=require(_0x622c('0xd'));var jsforce=require(_0x622c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x622c('0x9'));var querystring=require(_0x622c('0xf'));var Papa=require(_0x622c('0x10'));var Redis=require(_0x622c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x622c('0x12'));var as=require(_0x622c('0x13'));var hardwareService=require(_0x622c('0x14'));var logger=require(_0x622c('0x15'))(_0x622c('0x16'));var utils=require(_0x622c('0x17'));var config=require(_0x622c('0x18'));var licenseUtil=require(_0x622c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38f8b4,_0x12d7ae){_0x12d7ae=_0x12d7ae||0xcc;return function(_0x27b488){if(_0x27b488){return _0x38f8b4['sendStatus'](_0x12d7ae);}return _0x38f8b4[_0x622c('0x1a')](_0x12d7ae)[_0x622c('0x1b')]();};}function respondWithResult(_0x5134e8,_0x3ed8b6){_0x3ed8b6=_0x3ed8b6||0xc8;return function(_0x3087b0){if(_0x3087b0){return _0x5134e8['status'](_0x3ed8b6)[_0x622c('0x1c')](_0x3087b0);}};}function respondWithFilteredResult(_0x2cf5d5,_0x214e8f){return function(_0x12b3da){if(_0x12b3da){var _0x1f7a75=typeof _0x214e8f[_0x622c('0x1d')]===_0x622c('0x1e')&&typeof _0x214e8f[_0x622c('0x1f')]===_0x622c('0x1e');var _0x2b9c27=_0x12b3da[_0x622c('0x20')];var _0x1b512a=_0x1f7a75?0x0:_0x214e8f[_0x622c('0x1d')];var _0x53d06e=_0x1f7a75?_0x12b3da[_0x622c('0x20')]:_0x214e8f[_0x622c('0x1d')]+_0x214e8f[_0x622c('0x1f')];var _0x22f693;if(_0x53d06e>=_0x2b9c27){_0x53d06e=_0x2b9c27;_0x22f693=0xc8;}else{_0x22f693=0xce;}_0x2cf5d5[_0x622c('0x1a')](_0x22f693);return _0x2cf5d5[_0x622c('0x21')](_0x622c('0x22'),_0x1b512a+'-'+_0x53d06e+'/'+_0x2b9c27)[_0x622c('0x1c')](_0x12b3da);}return null;};}function patchUpdates(_0x4069e8){return function(_0x41f7d8){try{jsonpatch[_0x622c('0x23')](_0x41f7d8,_0x4069e8,!![]);}catch(_0x417ed6){return BPromise['reject'](_0x417ed6);}return _0x41f7d8['save']();};}function saveUpdates(_0x83aaeb,_0x58fa22){return function(_0x544f33){if(_0x544f33){return _0x544f33[_0x622c('0x24')](_0x83aaeb)['then'](function(_0x3f5b98){return _0x3f5b98;});}return null;};}function removeEntity(_0x351114,_0x421a0c){return function(_0x2885c8){if(_0x2885c8){return _0x2885c8['destroy']()['then'](function(){_0x351114[_0x622c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3af1b2,_0x476c3c){return function(_0x492422){if(!_0x492422){_0x3af1b2[_0x622c('0x25')](0x194);}return _0x492422;};}function handleError(_0x3dd7f9,_0x5f00a6){_0x5f00a6=_0x5f00a6||0x1f4;return function(_0x31c90e){logger[_0x622c('0x26')](_0x31c90e[_0x622c('0x27')]);if(_0x31c90e['name']){delete _0x31c90e[_0x622c('0x28')];}_0x3dd7f9[_0x622c('0x1a')](_0x5f00a6)[_0x622c('0x29')](_0x31c90e);};}exports[_0x622c('0x2a')]=function(_0x5758a2,_0xfaa975){var _0x49539c={},_0x30a992={},_0x52e5f8={'count':0x0,'rows':[]};var _0x3c80b6=_[_0x622c('0x2b')](db['AnalyticTreeReport'][_0x622c('0x2c')],function(_0x275d66){return{'name':_0x275d66['fieldName'],'type':_0x275d66[_0x622c('0x2d')][_0x622c('0x2e')]};});_0x30a992[_0x622c('0x2f')]=_[_0x622c('0x2b')](_0x3c80b6,'name');_0x30a992[_0x622c('0x30')]=_[_0x622c('0x31')](_0x5758a2['query']);_0x30a992['filters']=_[_0x622c('0x32')](_0x30a992[_0x622c('0x2f')],_0x30a992[_0x622c('0x30')]);_0x49539c[_0x622c('0x33')]=_[_0x622c('0x32')](_0x30a992[_0x622c('0x2f')],qs[_0x622c('0x34')](_0x5758a2[_0x622c('0x30')][_0x622c('0x34')]));_0x49539c[_0x622c('0x33')]=_0x49539c[_0x622c('0x33')][_0x622c('0x35')]?_0x49539c[_0x622c('0x33')]:_0x30a992['model'];if(!_0x5758a2[_0x622c('0x30')][_0x622c('0x36')](_0x622c('0x37'))){_0x49539c[_0x622c('0x1f')]=qs[_0x622c('0x1f')](_0x5758a2[_0x622c('0x30')][_0x622c('0x1f')]);_0x49539c[_0x622c('0x1d')]=qs[_0x622c('0x1d')](_0x5758a2[_0x622c('0x30')][_0x622c('0x1d')]);}_0x49539c[_0x622c('0x38')]=qs[_0x622c('0x39')](_0x5758a2[_0x622c('0x30')][_0x622c('0x39')]);_0x49539c['where']=qs[_0x622c('0x3a')](_[_0x622c('0x3b')](_0x5758a2['query'],_0x30a992['filters']),_0x3c80b6);if(_0x5758a2[_0x622c('0x30')][_0x622c('0x3c')]){_0x49539c[_0x622c('0x3d')]=_[_0x622c('0x3e')](_0x49539c[_0x622c('0x3d')],{'$or':_[_0x622c('0x2b')](_0x3c80b6,function(_0x39dc2f){if(_0x39dc2f[_0x622c('0x2d')]!==_0x622c('0x3f')){var _0x51adbc={};_0x51adbc[_0x39dc2f[_0x622c('0x28')]]={'$like':'%'+_0x5758a2[_0x622c('0x30')][_0x622c('0x3c')]+'%'};return _0x51adbc;}})});}_0x49539c=_[_0x622c('0x3e')]({},_0x49539c,_0x5758a2[_0x622c('0x40')]);var _0x34a2d7={'where':_0x49539c['where']};return db[_0x622c('0x41')][_0x622c('0x20')](_0x34a2d7)['then'](function(_0x2aab92){_0x52e5f8[_0x622c('0x20')]=_0x2aab92;if(_0x5758a2[_0x622c('0x30')][_0x622c('0x42')]){_0x49539c['include']=[{'all':!![]}];}return db[_0x622c('0x41')][_0x622c('0x43')](_0x49539c);})['then'](function(_0x21b7de){_0x52e5f8[_0x622c('0x44')]=_0x21b7de;return _0x52e5f8;})[_0x622c('0x45')](respondWithFilteredResult(_0xfaa975,_0x49539c))['catch'](handleError(_0xfaa975,null));};exports[_0x622c('0x46')]=function(_0x468178,_0x411481){var _0x41712b={'raw':!![],'where':{'id':_0x468178[_0x622c('0x47')]['id']}},_0x5a7693={};_0x5a7693[_0x622c('0x2f')]=_[_0x622c('0x31')](db[_0x622c('0x41')][_0x622c('0x2c')]);_0x5a7693['query']=_[_0x622c('0x31')](_0x468178['query']);_0x5a7693[_0x622c('0x3a')]=_[_0x622c('0x32')](_0x5a7693[_0x622c('0x2f')],_0x5a7693[_0x622c('0x30')]);_0x41712b[_0x622c('0x33')]=_['intersection'](_0x5a7693['model'],qs[_0x622c('0x34')](_0x468178[_0x622c('0x30')][_0x622c('0x34')]));_0x41712b['attributes']=_0x41712b[_0x622c('0x33')][_0x622c('0x35')]?_0x41712b['attributes']:_0x5a7693['model'];if(_0x468178[_0x622c('0x30')][_0x622c('0x42')]){_0x41712b[_0x622c('0x48')]=[{'all':!![]}];}_0x41712b=_[_0x622c('0x3e')]({},_0x41712b,_0x468178[_0x622c('0x40')]);return db[_0x622c('0x41')]['find'](_0x41712b)[_0x622c('0x45')](handleEntityNotFound(_0x411481,null))[_0x622c('0x45')](respondWithResult(_0x411481,null))[_0x622c('0x49')](handleError(_0x411481,null));};exports[_0x622c('0x4a')]=function(_0x18158f,_0x56c21f){return db['AnalyticTreeReport']['create'](_0x18158f[_0x622c('0x4b')],{})[_0x622c('0x45')](respondWithResult(_0x56c21f,0xc9))['catch'](handleError(_0x56c21f,null));};exports['update']=function(_0x2b438e,_0x22eadf){if(_0x2b438e[_0x622c('0x4b')]['id']){delete _0x2b438e[_0x622c('0x4b')]['id'];}return db[_0x622c('0x41')][_0x622c('0x4c')]({'where':{'id':_0x2b438e[_0x622c('0x47')]['id']}})[_0x622c('0x45')](handleEntityNotFound(_0x22eadf,null))['then'](saveUpdates(_0x2b438e[_0x622c('0x4b')],null))[_0x622c('0x45')](respondWithResult(_0x22eadf,null))[_0x622c('0x49')](handleError(_0x22eadf,null));};exports['destroy']=function(_0x2d3786,_0x5f31a8){return db[_0x622c('0x41')][_0x622c('0x4c')]({'where':{'id':_0x2d3786[_0x622c('0x47')]['id']}})['then'](handleEntityNotFound(_0x5f31a8,null))[_0x622c('0x45')](removeEntity(_0x5f31a8,null))[_0x622c('0x49')](handleError(_0x5f31a8,null));}; \ No newline at end of file +var _0x5024=['findAll','rows','catch','show','params','include','create','body','find','eml-format','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','stack','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','AnalyticTreeReport','count','includeAll'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5024,0x16c));var _0x4502=function(_0x4d9ad1,_0x467b48){_0x4d9ad1=_0x4d9ad1-0x0;var _0x4962dd=_0x5024[_0x4d9ad1];return _0x4962dd;};'use strict';var emlformat=require(_0x4502('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4502('0x1'));var BPromise=require(_0x4502('0x2'));var Mustache=require(_0x4502('0x3'));var util=require(_0x4502('0x4'));var path=require('path');var sox=require(_0x4502('0x5'));var csv=require(_0x4502('0x6'));var ejs=require(_0x4502('0x7'));var fs=require('fs');var fs_extra=require(_0x4502('0x8'));var _=require(_0x4502('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4502('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4502('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4502('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4502('0xc'));var hardwareService=require(_0x4502('0xd'));var logger=require(_0x4502('0xe'))(_0x4502('0xf'));var utils=require(_0x4502('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4502('0x11'));var db=require(_0x4502('0x12'))['db'];function respondWithStatusCode(_0x2c459f,_0x22c7a6){_0x22c7a6=_0x22c7a6||0xcc;return function(_0x43a701){if(_0x43a701){return _0x2c459f['sendStatus'](_0x22c7a6);}return _0x2c459f['status'](_0x22c7a6)[_0x4502('0x13')]();};}function respondWithResult(_0x4bb5ba,_0x41af7f){_0x41af7f=_0x41af7f||0xc8;return function(_0x235a3d){if(_0x235a3d){return _0x4bb5ba[_0x4502('0x14')](_0x41af7f)['json'](_0x235a3d);}};}function respondWithFilteredResult(_0x399d60,_0x378a0a){return function(_0x5300b8){if(_0x5300b8){var _0x308bd4=typeof _0x378a0a[_0x4502('0x15')]==='undefined'&&typeof _0x378a0a[_0x4502('0x16')]===_0x4502('0x17');var _0x5894f7=_0x5300b8['count'];var _0x43b8f5=_0x308bd4?0x0:_0x378a0a[_0x4502('0x15')];var _0x35c4e4=_0x308bd4?_0x5300b8['count']:_0x378a0a[_0x4502('0x15')]+_0x378a0a[_0x4502('0x16')];var _0x4eb3f1;if(_0x35c4e4>=_0x5894f7){_0x35c4e4=_0x5894f7;_0x4eb3f1=0xc8;}else{_0x4eb3f1=0xce;}_0x399d60[_0x4502('0x14')](_0x4eb3f1);return _0x399d60[_0x4502('0x18')](_0x4502('0x19'),_0x43b8f5+'-'+_0x35c4e4+'/'+_0x5894f7)[_0x4502('0x1a')](_0x5300b8);}return null;};}function patchUpdates(_0x1c4441){return function(_0xcf8ee1){try{jsonpatch[_0x4502('0x1b')](_0xcf8ee1,_0x1c4441,!![]);}catch(_0x303b9e){return BPromise[_0x4502('0x1c')](_0x303b9e);}return _0xcf8ee1['save']();};}function saveUpdates(_0x3ef6b1,_0x406924){return function(_0x577455){if(_0x577455){return _0x577455[_0x4502('0x1d')](_0x3ef6b1)[_0x4502('0x1e')](function(_0x428075){return _0x428075;});}return null;};}function removeEntity(_0x4c1738,_0x1777e8){return function(_0x360f8c){if(_0x360f8c){return _0x360f8c[_0x4502('0x1f')]()['then'](function(){_0x4c1738[_0x4502('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57cb7e,_0x2503f1){return function(_0x4044f1){if(!_0x4044f1){_0x57cb7e[_0x4502('0x20')](0x194);}return _0x4044f1;};}function handleError(_0x1387bb,_0x20b33){_0x20b33=_0x20b33||0x1f4;return function(_0x4d0a70){logger['error'](_0x4d0a70[_0x4502('0x21')]);if(_0x4d0a70['name']){delete _0x4d0a70['name'];}_0x1387bb[_0x4502('0x14')](_0x20b33)[_0x4502('0x22')](_0x4d0a70);};}exports[_0x4502('0x23')]=function(_0x2bc568,_0x592c19){var _0x3fadf5={},_0x45e5e3={},_0x17023f={'count':0x0,'rows':[]};var _0xc8c37b=_[_0x4502('0x24')](db['AnalyticTreeReport'][_0x4502('0x25')],function(_0x2f3851){return{'name':_0x2f3851[_0x4502('0x26')],'type':_0x2f3851[_0x4502('0x27')][_0x4502('0x28')]};});_0x45e5e3[_0x4502('0x29')]=_[_0x4502('0x24')](_0xc8c37b,'name');_0x45e5e3[_0x4502('0x2a')]=_[_0x4502('0x2b')](_0x2bc568['query']);_0x45e5e3[_0x4502('0x2c')]=_['intersection'](_0x45e5e3[_0x4502('0x29')],_0x45e5e3[_0x4502('0x2a')]);_0x3fadf5['attributes']=_[_0x4502('0x2d')](_0x45e5e3[_0x4502('0x29')],qs[_0x4502('0x2e')](_0x2bc568[_0x4502('0x2a')][_0x4502('0x2e')]));_0x3fadf5[_0x4502('0x2f')]=_0x3fadf5[_0x4502('0x2f')][_0x4502('0x30')]?_0x3fadf5['attributes']:_0x45e5e3[_0x4502('0x29')];if(!_0x2bc568[_0x4502('0x2a')]['hasOwnProperty'](_0x4502('0x31'))){_0x3fadf5[_0x4502('0x16')]=qs[_0x4502('0x16')](_0x2bc568[_0x4502('0x2a')][_0x4502('0x16')]);_0x3fadf5[_0x4502('0x15')]=qs[_0x4502('0x15')](_0x2bc568[_0x4502('0x2a')][_0x4502('0x15')]);}_0x3fadf5[_0x4502('0x32')]=qs[_0x4502('0x33')](_0x2bc568['query'][_0x4502('0x33')]);_0x3fadf5[_0x4502('0x34')]=qs[_0x4502('0x2c')](_[_0x4502('0x35')](_0x2bc568[_0x4502('0x2a')],_0x45e5e3[_0x4502('0x2c')]),_0xc8c37b);if(_0x2bc568[_0x4502('0x2a')][_0x4502('0x36')]){_0x3fadf5[_0x4502('0x34')]=_[_0x4502('0x37')](_0x3fadf5['where'],{'$or':_[_0x4502('0x24')](_0xc8c37b,function(_0xd5e8a8){if(_0xd5e8a8['type']!==_0x4502('0x38')){var _0x688fdd={};_0x688fdd[_0xd5e8a8[_0x4502('0x39')]]={'$like':'%'+_0x2bc568[_0x4502('0x2a')][_0x4502('0x36')]+'%'};return _0x688fdd;}})});}_0x3fadf5=_[_0x4502('0x37')]({},_0x3fadf5,_0x2bc568[_0x4502('0x3a')]);var _0x8f00d2={'where':_0x3fadf5['where']};return db[_0x4502('0x3b')][_0x4502('0x3c')](_0x8f00d2)[_0x4502('0x1e')](function(_0x3d4b13){_0x17023f['count']=_0x3d4b13;if(_0x2bc568[_0x4502('0x2a')][_0x4502('0x3d')]){_0x3fadf5['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x4502('0x3e')](_0x3fadf5);})[_0x4502('0x1e')](function(_0xccc5c3){_0x17023f[_0x4502('0x3f')]=_0xccc5c3;return _0x17023f;})[_0x4502('0x1e')](respondWithFilteredResult(_0x592c19,_0x3fadf5))[_0x4502('0x40')](handleError(_0x592c19,null));};exports[_0x4502('0x41')]=function(_0x42a549,_0x5a9a14){var _0x406811={'raw':!![],'where':{'id':_0x42a549[_0x4502('0x42')]['id']}},_0x4cf132={};_0x4cf132[_0x4502('0x29')]=_['keys'](db['AnalyticTreeReport'][_0x4502('0x25')]);_0x4cf132[_0x4502('0x2a')]=_['keys'](_0x42a549['query']);_0x4cf132[_0x4502('0x2c')]=_[_0x4502('0x2d')](_0x4cf132[_0x4502('0x29')],_0x4cf132[_0x4502('0x2a')]);_0x406811['attributes']=_[_0x4502('0x2d')](_0x4cf132[_0x4502('0x29')],qs[_0x4502('0x2e')](_0x42a549[_0x4502('0x2a')][_0x4502('0x2e')]));_0x406811[_0x4502('0x2f')]=_0x406811[_0x4502('0x2f')][_0x4502('0x30')]?_0x406811[_0x4502('0x2f')]:_0x4cf132[_0x4502('0x29')];if(_0x42a549[_0x4502('0x2a')][_0x4502('0x3d')]){_0x406811[_0x4502('0x43')]=[{'all':!![]}];}_0x406811=_[_0x4502('0x37')]({},_0x406811,_0x42a549[_0x4502('0x3a')]);return db[_0x4502('0x3b')]['find'](_0x406811)[_0x4502('0x1e')](handleEntityNotFound(_0x5a9a14,null))['then'](respondWithResult(_0x5a9a14,null))['catch'](handleError(_0x5a9a14,null));};exports[_0x4502('0x44')]=function(_0x2d6252,_0x113e4b){return db['AnalyticTreeReport'][_0x4502('0x44')](_0x2d6252[_0x4502('0x45')],{})[_0x4502('0x1e')](respondWithResult(_0x113e4b,0xc9))[_0x4502('0x40')](handleError(_0x113e4b,null));};exports[_0x4502('0x1d')]=function(_0x162ef9,_0x5f06ea){if(_0x162ef9[_0x4502('0x45')]['id']){delete _0x162ef9[_0x4502('0x45')]['id'];}return db[_0x4502('0x3b')][_0x4502('0x46')]({'where':{'id':_0x162ef9[_0x4502('0x42')]['id']}})[_0x4502('0x1e')](handleEntityNotFound(_0x5f06ea,null))[_0x4502('0x1e')](saveUpdates(_0x162ef9[_0x4502('0x45')],null))[_0x4502('0x1e')](respondWithResult(_0x5f06ea,null))['catch'](handleError(_0x5f06ea,null));};exports[_0x4502('0x1f')]=function(_0x2169be,_0x437569){return db['AnalyticTreeReport'][_0x4502('0x46')]({'where':{'id':_0x2169be[_0x4502('0x42')]['id']}})[_0x4502('0x1e')](handleEntityNotFound(_0x437569,null))[_0x4502('0x1e')](removeEntity(_0x437569,null))[_0x4502('0x40')](handleError(_0x437569,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 4fd2d0e..13d9a69 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 _0x1493=['analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport'];(function(_0x268555,_0x20241f){var _0x5a1d01=function(_0x5122c2){while(--_0x5122c2){_0x268555['push'](_0x268555['shift']());}};_0x5a1d01(++_0x20241f);}(_0x1493,0x121));var _0x3149=function(_0x33290b,_0x545ef3){_0x33290b=_0x33290b-0x0;var _0x57d076=_0x1493[_0x33290b];return _0x57d076;};'use strict';var _=require(_0x3149('0x0'));var util=require('util');var logger=require(_0x3149('0x1'))(_0x3149('0x2'));var moment=require(_0x3149('0x3'));var BPromise=require(_0x3149('0x4'));var rp=require(_0x3149('0x5'));var fs=require('fs');var path=require(_0x3149('0x6'));var rimraf=require('rimraf');var config=require(_0x3149('0x7'));var attributes=require(_0x3149('0x8'));module['exports']=function(_0x5e767d,_0x4851a2){return _0x5e767d[_0x3149('0x9')](_0x3149('0xa'),attributes,{'tableName':_0x3149('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01be=['request-promise','rimraf','./analyticTreeReport.attributes','AnalyticTreeReport','lodash','api','bluebird'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x01be,0x162));var _0xe01b=function(_0x129c23,_0x2d8387){_0x129c23=_0x129c23-0x0;var _0x133723=_0x01be[_0x129c23];return _0x133723;};'use strict';var _=require(_0xe01b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe01b('0x1'));var moment=require('moment');var BPromise=require(_0xe01b('0x2'));var rp=require(_0xe01b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe01b('0x4'));var config=require('../../config/environment');var attributes=require(_0xe01b('0x5'));module['exports']=function(_0x4316e3,_0x2a1123){return _0x4316e3['define'](_0xe01b('0x6'),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 131ae75..0b5e342 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 _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(_0x2d5887,_0xace828){var _0x257084=function(_0x457e3a){while(--_0x457e3a){_0x2d5887['push'](_0x2d5887['shift']());}};_0x257084(++_0xace828);}(_0xadb5,0xad));var _0x5adb=function(_0x4b39f1,_0x1f97ee){_0x4b39f1=_0x4b39f1-0x0;var _0x14014f=_0xadb5[_0x4b39f1];return _0x14014f;};'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 +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(_0x1e0144,_0x1528e3){var _0x172a14=function(_0x3ab22e){while(--_0x3ab22e){_0x1e0144['push'](_0x1e0144['shift']());}};_0x172a14(++_0x1528e3);}(_0xadb5,0xad));var _0x5adb=function(_0x48d4f9,_0x4dfecb){_0x48d4f9=_0x48d4f9-0x0;var _0x506d6c=_0xadb5[_0x48d4f9];return _0x506d6c;};'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 a6be68a..7d938b9 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 _0xdc1f=['multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports'];(function(_0x3c4d90,_0x47d8d){var _0x49dec7=function(_0x5367f6){while(--_0x5367f6){_0x3c4d90['push'](_0x3c4d90['shift']());}};_0x49dec7(++_0x47d8d);}(_0xdc1f,0x1db));var _0xfdc1=function(_0x304ed0,_0x7a1b5c){_0x304ed0=_0x304ed0-0x0;var _0x1e965a=_0xdc1f[_0x304ed0];return _0x1e965a;};'use strict';var multer=require(_0xfdc1('0x0'));var util=require(_0xfdc1('0x1'));var path=require(_0xfdc1('0x2'));var timeout=require(_0xfdc1('0x3'));var express=require('express');var router=express[_0xfdc1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfdc1('0x5'));var config=require(_0xfdc1('0x6'));var controller=require(_0xfdc1('0x7'));router[_0xfdc1('0x8')]('/',auth[_0xfdc1('0x9')](),controller[_0xfdc1('0xa')]);router[_0xfdc1('0x8')]('/:id',auth[_0xfdc1('0x9')](),controller[_0xfdc1('0xb')]);router[_0xfdc1('0xc')]('/',auth[_0xfdc1('0x9')](),controller[_0xfdc1('0xd')]);router[_0xfdc1('0xe')](_0xfdc1('0xf'),auth[_0xfdc1('0x9')](),controller[_0xfdc1('0x10')]);router[_0xfdc1('0x11')]('/:id',auth[_0xfdc1('0x9')](),controller['destroy']);module[_0xfdc1('0x12')]=router; \ No newline at end of file +var _0xcf01=['./analyticTreeReport.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x273f88,_0x5d4150){var _0x177ca1=function(_0xf46ec4){while(--_0xf46ec4){_0x273f88['push'](_0x273f88['shift']());}};_0x177ca1(++_0x5d4150);}(_0xcf01,0x13d));var _0x1cf0=function(_0x5dd181,_0x1eac8b){_0x5dd181=_0x5dd181-0x0;var _0x27cc98=_0xcf01[_0x5dd181];return _0x27cc98;};'use strict';var multer=require(_0x1cf0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1cf0('0x1'));var express=require(_0x1cf0('0x2'));var router=express[_0x1cf0('0x3')]();var fs_extra=require(_0x1cf0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1cf0('0x5'));var config=require('../../config/environment');var controller=require(_0x1cf0('0x6'));router['get']('/',auth[_0x1cf0('0x7')](),controller[_0x1cf0('0x8')]);router[_0x1cf0('0x9')](_0x1cf0('0xa'),auth[_0x1cf0('0x7')](),controller[_0x1cf0('0xb')]);router[_0x1cf0('0xc')]('/',auth['isAuthenticated'](),controller[_0x1cf0('0xd')]);router[_0x1cf0('0xe')](_0x1cf0('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x1cf0('0xf')](_0x1cf0('0xa'),auth[_0x1cf0('0x7')](),controller['destroy']);module[_0x1cf0('0x10')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 525ee4b..5545fe8 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 _0x61a1=['STRING','sequelize','exports'];(function(_0x2d2258,_0x2ce510){var _0x18e155=function(_0x11949e){while(--_0x11949e){_0x2d2258['push'](_0x2d2258['shift']());}};_0x18e155(++_0x2ce510);}(_0x61a1,0x127));var _0x161a=function(_0x1a72b8,_0x1e4f4b){_0x1a72b8=_0x1a72b8-0x0;var _0x39f72d=_0x61a1[_0x1a72b8];return _0x39f72d;};'use strict';var Sequelize=require(_0x161a('0x0'));module[_0x161a('0x1')]={'name':{'type':Sequelize[_0x161a('0x2')]},'basename':{'type':Sequelize[_0x161a('0x2')]},'type':{'type':Sequelize[_0x161a('0x2')]}}; \ No newline at end of file +var _0xae53=['sequelize','STRING'];(function(_0x209e59,_0x5343c0){var _0x4fd0a3=function(_0x33726b){while(--_0x33726b){_0x209e59['push'](_0x209e59['shift']());}};_0x4fd0a3(++_0x5343c0);}(_0xae53,0x16e));var _0x3ae5=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xae53[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require(_0x3ae5('0x0'));module['exports']={'name':{'type':Sequelize[_0x3ae5('0x1')]},'basename':{'type':Sequelize[_0x3ae5('0x1')]},'type':{'type':Sequelize[_0x3ae5('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index cd0ea50..670877c 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 _0x0c3a=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','Attachment','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','find','clone','get','omit','body','createdAt','create','destroy','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x159195,_0x595363){var _0x1ed1c3=function(_0x2192da){while(--_0x2192da){_0x159195['push'](_0x159195['shift']());}};_0x1ed1c3(++_0x595363);}(_0x0c3a,0x154));var _0xa0c3=function(_0x33e241,_0x7b53b2){_0x33e241=_0x33e241-0x0;var _0x14a5dc=_0x0c3a[_0x33e241];return _0x14a5dc;};'use strict';var emlformat=require(_0xa0c3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa0c3('0x1'));var moment=require(_0xa0c3('0x2'));var BPromise=require(_0xa0c3('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa0c3('0x4'));var csv=require(_0xa0c3('0x5'));var ejs=require(_0xa0c3('0x6'));var fs=require('fs');var fs_extra=require(_0xa0c3('0x7'));var _=require(_0xa0c3('0x8'));var squel=require('squel');var crypto=require(_0xa0c3('0x9'));var jsforce=require(_0xa0c3('0xa'));var deskjs=require(_0xa0c3('0xb'));var toCsv=require(_0xa0c3('0x5'));var querystring=require(_0xa0c3('0xc'));var Papa=require(_0xa0c3('0xd'));var Redis=require(_0xa0c3('0xe'));var authService=require(_0xa0c3('0xf'));var qs=require(_0xa0c3('0x10'));var as=require(_0xa0c3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0c3('0x12'))(_0xa0c3('0x13'));var utils=require(_0xa0c3('0x14'));var config=require(_0xa0c3('0x15'));var licenseUtil=require(_0xa0c3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41026a,_0x269c0d){_0x269c0d=_0x269c0d||0xcc;return function(_0x47a1f5){if(_0x47a1f5){return _0x41026a['sendStatus'](_0x269c0d);}return _0x41026a['status'](_0x269c0d)[_0xa0c3('0x17')]();};}function respondWithResult(_0x39188a,_0x3b05ad){_0x3b05ad=_0x3b05ad||0xc8;return function(_0x5f14ab){if(_0x5f14ab){return _0x39188a['status'](_0x3b05ad)[_0xa0c3('0x18')](_0x5f14ab);}};}function respondWithFilteredResult(_0x3ac9d8,_0x389540){return function(_0x1360c5){if(_0x1360c5){var _0x45e42e=typeof _0x389540[_0xa0c3('0x19')]===_0xa0c3('0x1a')&&typeof _0x389540['limit']==='undefined';var _0x4829e7=_0x1360c5[_0xa0c3('0x1b')];var _0x2607a9=_0x45e42e?0x0:_0x389540[_0xa0c3('0x19')];var _0x5384d3=_0x45e42e?_0x1360c5[_0xa0c3('0x1b')]:_0x389540['offset']+_0x389540['limit'];var _0x25276f;if(_0x5384d3>=_0x4829e7){_0x5384d3=_0x4829e7;_0x25276f=0xc8;}else{_0x25276f=0xce;}_0x3ac9d8[_0xa0c3('0x1c')](_0x25276f);return _0x3ac9d8[_0xa0c3('0x1d')](_0xa0c3('0x1e'),_0x2607a9+'-'+_0x5384d3+'/'+_0x4829e7)[_0xa0c3('0x18')](_0x1360c5);}return null;};}function patchUpdates(_0x3bca26){return function(_0x369ba7){try{jsonpatch[_0xa0c3('0x1f')](_0x369ba7,_0x3bca26,!![]);}catch(_0x3d76c6){return BPromise[_0xa0c3('0x20')](_0x3d76c6);}return _0x369ba7[_0xa0c3('0x21')]();};}function saveUpdates(_0x3d1ce9,_0x5b04a8){return function(_0x22f118){if(_0x22f118){return _0x22f118[_0xa0c3('0x22')](_0x3d1ce9)[_0xa0c3('0x23')](function(_0x14d122){return _0x14d122;});}return null;};}function removeEntity(_0x1f3f10,_0x45ae6d){return function(_0x1ed2db){if(_0x1ed2db){return _0x1ed2db['destroy']()[_0xa0c3('0x23')](function(){_0x1f3f10[_0xa0c3('0x1c')](0xcc)[_0xa0c3('0x17')]();});}};}function handleEntityNotFound(_0x1c189f,_0x421e5b){return function(_0x3e228a){if(!_0x3e228a){_0x1c189f['sendStatus'](0x194);}return _0x3e228a;};}function handleError(_0x2a679b,_0x3f71ae){_0x3f71ae=_0x3f71ae||0x1f4;return function(_0x4e2f18){logger[_0xa0c3('0x24')](_0x4e2f18['stack']);if(_0x4e2f18['name']){delete _0x4e2f18[_0xa0c3('0x25')];}_0x2a679b[_0xa0c3('0x1c')](_0x3f71ae)[_0xa0c3('0x26')](_0x4e2f18);};}exports[_0xa0c3('0x27')]=function(_0x58b611,_0x3b6b71){var _0x35ece3={},_0x4b9291={},_0x1811f1={'count':0x0,'rows':[]};var _0x55aa09=_[_0xa0c3('0x28')](db[_0xa0c3('0x29')][_0xa0c3('0x2a')],function(_0x470d96){return{'name':_0x470d96[_0xa0c3('0x2b')],'type':_0x470d96['type']['key']};});_0x4b9291[_0xa0c3('0x2c')]=_[_0xa0c3('0x28')](_0x55aa09,_0xa0c3('0x25'));_0x4b9291['query']=_[_0xa0c3('0x2d')](_0x58b611[_0xa0c3('0x2e')]);_0x4b9291[_0xa0c3('0x2f')]=_[_0xa0c3('0x30')](_0x4b9291[_0xa0c3('0x2c')],_0x4b9291[_0xa0c3('0x2e')]);_0x35ece3[_0xa0c3('0x31')]=_[_0xa0c3('0x30')](_0x4b9291['model'],qs[_0xa0c3('0x32')](_0x58b611[_0xa0c3('0x2e')]['fields']));_0x35ece3[_0xa0c3('0x31')]=_0x35ece3['attributes'][_0xa0c3('0x33')]?_0x35ece3[_0xa0c3('0x31')]:_0x4b9291[_0xa0c3('0x2c')];if(!_0x58b611[_0xa0c3('0x2e')][_0xa0c3('0x34')](_0xa0c3('0x35'))){_0x35ece3['limit']=qs['limit'](_0x58b611[_0xa0c3('0x2e')][_0xa0c3('0x36')]);_0x35ece3[_0xa0c3('0x19')]=qs[_0xa0c3('0x19')](_0x58b611[_0xa0c3('0x2e')][_0xa0c3('0x19')]);}_0x35ece3[_0xa0c3('0x37')]=qs['sort'](_0x58b611[_0xa0c3('0x2e')][_0xa0c3('0x38')]);_0x35ece3[_0xa0c3('0x39')]=qs[_0xa0c3('0x2f')](_[_0xa0c3('0x3a')](_0x58b611['query'],_0x4b9291[_0xa0c3('0x2f')]),_0x55aa09);if(_0x58b611[_0xa0c3('0x2e')][_0xa0c3('0x3b')]){_0x35ece3['where']=_[_0xa0c3('0x3c')](_0x35ece3[_0xa0c3('0x39')],{'$or':_['map'](_0x55aa09,function(_0x59e925){if(_0x59e925[_0xa0c3('0x3d')]!==_0xa0c3('0x3e')){var _0x35850c={};_0x35850c[_0x59e925[_0xa0c3('0x25')]]={'$like':'%'+_0x58b611[_0xa0c3('0x2e')][_0xa0c3('0x3b')]+'%'};return _0x35850c;}})});}_0x35ece3=_[_0xa0c3('0x3c')]({},_0x35ece3,_0x58b611['options']);var _0x4d59c3={'where':_0x35ece3[_0xa0c3('0x39')]};return db[_0xa0c3('0x29')]['count'](_0x4d59c3)[_0xa0c3('0x23')](function(_0x2fe1bc){_0x1811f1[_0xa0c3('0x1b')]=_0x2fe1bc;if(_0x58b611['query'][_0xa0c3('0x3f')]){_0x35ece3['include']=[{'all':!![]}];}return db[_0xa0c3('0x29')][_0xa0c3('0x40')](_0x35ece3);})[_0xa0c3('0x23')](function(_0x4977ab){_0x1811f1[_0xa0c3('0x41')]=_0x4977ab;return _0x1811f1;})['then'](respondWithFilteredResult(_0x3b6b71,_0x35ece3))[_0xa0c3('0x42')](handleError(_0x3b6b71,null));};exports[_0xa0c3('0x43')]=function(_0x308828,_0xc8f7ad){var _0x30527b={'raw':!![],'where':{'id':_0x308828[_0xa0c3('0x44')]['id']}},_0x305c18={};_0x305c18[_0xa0c3('0x2c')]=_[_0xa0c3('0x2d')](db[_0xa0c3('0x29')][_0xa0c3('0x2a')]);_0x305c18['query']=_['keys'](_0x308828[_0xa0c3('0x2e')]);_0x305c18[_0xa0c3('0x2f')]=_[_0xa0c3('0x30')](_0x305c18['model'],_0x305c18[_0xa0c3('0x2e')]);_0x30527b['attributes']=_[_0xa0c3('0x30')](_0x305c18[_0xa0c3('0x2c')],qs[_0xa0c3('0x32')](_0x308828['query'][_0xa0c3('0x32')]));_0x30527b[_0xa0c3('0x31')]=_0x30527b[_0xa0c3('0x31')][_0xa0c3('0x33')]?_0x30527b['attributes']:_0x305c18[_0xa0c3('0x2c')];if(_0x308828[_0xa0c3('0x2e')]['includeAll']){_0x30527b[_0xa0c3('0x45')]=[{'all':!![]}];}_0x30527b=_[_0xa0c3('0x3c')]({},_0x30527b,_0x308828['options']);return db['Attachment'][_0xa0c3('0x46')](_0x30527b)[_0xa0c3('0x23')](handleEntityNotFound(_0xc8f7ad,null))[_0xa0c3('0x23')](respondWithResult(_0xc8f7ad,null))[_0xa0c3('0x42')](handleError(_0xc8f7ad,null));};exports[_0xa0c3('0x47')]=function(_0x3c6d3a,_0x3f11f4){var _0x3cfd21={'where':{'id':_0x3c6d3a[_0xa0c3('0x44')]['id']}},_0x2d853d={};_0x2d853d['model']=_[_0xa0c3('0x2d')](db['Attachment'][_0xa0c3('0x2a')]);_0x3cfd21[_0xa0c3('0x31')]=_['intersection'](_0x2d853d[_0xa0c3('0x2c')],qs[_0xa0c3('0x32')](_0x3c6d3a['query'][_0xa0c3('0x32')]));_0x3cfd21['attributes']=_0x3cfd21[_0xa0c3('0x31')]['length']?_0x3cfd21[_0xa0c3('0x31')]:_0x2d853d[_0xa0c3('0x2c')];if(_0x3c6d3a[_0xa0c3('0x2e')][_0xa0c3('0x3f')]){_0x3cfd21['include']=[{'all':!![]}];}_0x3cfd21=_[_0xa0c3('0x3c')]({},_0x3cfd21,_0x3c6d3a['options']);return db['Attachment']['find'](_0x3cfd21)[_0xa0c3('0x23')](handleEntityNotFound(_0x3f11f4,null))[_0xa0c3('0x23')](function(_0x118263){if(_0x118263){var _0x124ad0=_0x118263[_0xa0c3('0x48')]({'plain':!![]});_0x124ad0=qs[_0xa0c3('0x49')](_0x124ad0,['id','createdAt','updatedAt']);_0x3c6d3a[_0xa0c3('0x4a')]=_[_0xa0c3('0x49')](_0x3c6d3a[_0xa0c3('0x4a')],['id',_0xa0c3('0x4b'),'updatedAt']);return db[_0xa0c3('0x29')][_0xa0c3('0x4c')](_[_0xa0c3('0x3c')](_0x124ad0,_0x3c6d3a[_0xa0c3('0x4a')]),{'include':_0x3c6d3a[_0xa0c3('0x2e')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xa0c3('0x23')](respondWithResult(_0x3f11f4,0xc9))['catch'](handleError(_0x3f11f4,null));};exports['update']=function(_0x4a435e,_0x516b00){if(_0x4a435e[_0xa0c3('0x4a')]['id']){delete _0x4a435e[_0xa0c3('0x4a')]['id'];}return db[_0xa0c3('0x29')][_0xa0c3('0x46')]({'where':{'id':_0x4a435e[_0xa0c3('0x44')]['id']}})[_0xa0c3('0x23')](handleEntityNotFound(_0x516b00,null))[_0xa0c3('0x23')](saveUpdates(_0x4a435e[_0xa0c3('0x4a')],null))['then'](respondWithResult(_0x516b00,null))[_0xa0c3('0x42')](handleError(_0x516b00,null));};exports[_0xa0c3('0x4d')]=function(_0x5f11a9,_0x1f96d1){return db['Attachment'][_0xa0c3('0x46')]({'where':{'id':_0x5f11a9['params']['id']}})[_0xa0c3('0x23')](handleEntityNotFound(_0x1f96d1,null))[_0xa0c3('0x23')](removeEntity(_0x1f96d1,null))['catch'](handleError(_0x1f96d1,null));};exports[_0xa0c3('0x4c')]=function(_0x29bd3b,_0x5455c2,_0x2bc70c){_0x29bd3b['body']['name']=_0x29bd3b[_0xa0c3('0x4e')][_0xa0c3('0x4f')];_0x29bd3b[_0xa0c3('0x4a')][_0xa0c3('0x50')]=_0x29bd3b[_0xa0c3('0x4e')][_0xa0c3('0x51')];_0x29bd3b[_0xa0c3('0x4a')]['type']=_0x29bd3b['file'][_0xa0c3('0x52')];return db[_0xa0c3('0x29')]['create'](_0x29bd3b['body'])[_0xa0c3('0x23')](respondWithResult(_0x5455c2,0xc9))[_0xa0c3('0x42')](handleError(_0x5455c2,null));};exports[_0xa0c3('0x53')]=function(_0x5b17c7,_0x1190ce,_0x395e58){return db[_0xa0c3('0x29')]['findOne']({'where':{'id':_0x5b17c7['params']['id']},'raw':!![]})[_0xa0c3('0x23')](handleEntityNotFound(_0x1190ce,null))[_0xa0c3('0x23')](function(_0x249e27){if(_0x249e27){var _0x3ff1b4=_0x249e27[_0xa0c3('0x54')]!==null;var _0x519d73=path[_0xa0c3('0x55')](config[_0xa0c3('0x56')],_0xa0c3('0x57'));if(_0x3ff1b4){_0x519d73=path[_0xa0c3('0x55')](_0x519d73,_0xa0c3('0x58'));}var _0x51ffe4=path[_0xa0c3('0x55')](_0x519d73,_0x249e27[_0xa0c3('0x50')]);return _0x1190ce[_0xa0c3('0x53')](_0x51ffe4);}})[_0xa0c3('0x42')](handleError(_0x1190ce,null));}; \ No newline at end of file +var _0x1d8a=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','stack','name','send','index','map','Attachment','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','rows','catch','show','params','include','options','find','clone','get','omit','createdAt','updatedAt','body','create','update','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/'];(function(_0x5da27b,_0x1a78bf){var _0x4890e4=function(_0x428bb6){while(--_0x428bb6){_0x5da27b['push'](_0x5da27b['shift']());}};_0x4890e4(++_0x1a78bf);}(_0x1d8a,0x1cc));var _0xa1d8=function(_0x16f8a9,_0x348c8f){_0x16f8a9=_0x16f8a9-0x0;var _0x427a18=_0x1d8a[_0x16f8a9];return _0x427a18;};'use strict';var emlformat=require(_0xa1d8('0x0'));var rimraf=require(_0xa1d8('0x1'));var zipdir=require(_0xa1d8('0x2'));var jsonpatch=require(_0xa1d8('0x3'));var rp=require(_0xa1d8('0x4'));var moment=require('moment');var BPromise=require(_0xa1d8('0x5'));var Mustache=require(_0xa1d8('0x6'));var util=require(_0xa1d8('0x7'));var path=require('path');var sox=require(_0xa1d8('0x8'));var csv=require(_0xa1d8('0x9'));var ejs=require(_0xa1d8('0xa'));var fs=require('fs');var fs_extra=require(_0xa1d8('0xb'));var _=require(_0xa1d8('0xc'));var squel=require(_0xa1d8('0xd'));var crypto=require(_0xa1d8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa1d8('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa1d8('0x10'));var Redis=require(_0xa1d8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa1d8('0x12'));var as=require(_0xa1d8('0x13'));var hardwareService=require(_0xa1d8('0x14'));var logger=require(_0xa1d8('0x15'))('api');var utils=require(_0xa1d8('0x16'));var config=require(_0xa1d8('0x17'));var licenseUtil=require(_0xa1d8('0x18'));var db=require(_0xa1d8('0x19'))['db'];function respondWithStatusCode(_0x6de110,_0x3ee3ef){_0x3ee3ef=_0x3ee3ef||0xcc;return function(_0x5f4ee1){if(_0x5f4ee1){return _0x6de110['sendStatus'](_0x3ee3ef);}return _0x6de110[_0xa1d8('0x1a')](_0x3ee3ef)[_0xa1d8('0x1b')]();};}function respondWithResult(_0x13af43,_0x4066d5){_0x4066d5=_0x4066d5||0xc8;return function(_0x4d54c5){if(_0x4d54c5){return _0x13af43['status'](_0x4066d5)[_0xa1d8('0x1c')](_0x4d54c5);}};}function respondWithFilteredResult(_0x4d1304,_0x2ac733){return function(_0x3517f8){if(_0x3517f8){var _0x44aa13=typeof _0x2ac733[_0xa1d8('0x1d')]===_0xa1d8('0x1e')&&typeof _0x2ac733[_0xa1d8('0x1f')]==='undefined';var _0x1053c4=_0x3517f8[_0xa1d8('0x20')];var _0x1e843e=_0x44aa13?0x0:_0x2ac733['offset'];var _0x2295b1=_0x44aa13?_0x3517f8[_0xa1d8('0x20')]:_0x2ac733[_0xa1d8('0x1d')]+_0x2ac733[_0xa1d8('0x1f')];var _0x14b5d4;if(_0x2295b1>=_0x1053c4){_0x2295b1=_0x1053c4;_0x14b5d4=0xc8;}else{_0x14b5d4=0xce;}_0x4d1304[_0xa1d8('0x1a')](_0x14b5d4);return _0x4d1304[_0xa1d8('0x21')](_0xa1d8('0x22'),_0x1e843e+'-'+_0x2295b1+'/'+_0x1053c4)['json'](_0x3517f8);}return null;};}function patchUpdates(_0x5cee07){return function(_0x2d50fd){try{jsonpatch[_0xa1d8('0x23')](_0x2d50fd,_0x5cee07,!![]);}catch(_0x3749b4){return BPromise['reject'](_0x3749b4);}return _0x2d50fd['save']();};}function saveUpdates(_0x56e1fe,_0x384223){return function(_0x2b716e){if(_0x2b716e){return _0x2b716e['update'](_0x56e1fe)[_0xa1d8('0x24')](function(_0x14d16b){return _0x14d16b;});}return null;};}function removeEntity(_0x57d23d,_0x3bc701){return function(_0x50e366){if(_0x50e366){return _0x50e366[_0xa1d8('0x25')]()['then'](function(){_0x57d23d[_0xa1d8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c16d4,_0x277e14){return function(_0x580301){if(!_0x580301){_0x5c16d4['sendStatus'](0x194);}return _0x580301;};}function handleError(_0x4cba57,_0x3191e1){_0x3191e1=_0x3191e1||0x1f4;return function(_0x42bdf1){logger['error'](_0x42bdf1[_0xa1d8('0x26')]);if(_0x42bdf1['name']){delete _0x42bdf1[_0xa1d8('0x27')];}_0x4cba57['status'](_0x3191e1)[_0xa1d8('0x28')](_0x42bdf1);};}exports[_0xa1d8('0x29')]=function(_0x26fd80,_0x228b8d){var _0x32a78d={},_0xf5c82={},_0x3270a8={'count':0x0,'rows':[]};var _0x40bd2a=_[_0xa1d8('0x2a')](db[_0xa1d8('0x2b')][_0xa1d8('0x2c')],function(_0xc1896e){return{'name':_0xc1896e[_0xa1d8('0x2d')],'type':_0xc1896e['type'][_0xa1d8('0x2e')]};});_0xf5c82['model']=_[_0xa1d8('0x2a')](_0x40bd2a,'name');_0xf5c82[_0xa1d8('0x2f')]=_[_0xa1d8('0x30')](_0x26fd80['query']);_0xf5c82[_0xa1d8('0x31')]=_[_0xa1d8('0x32')](_0xf5c82[_0xa1d8('0x33')],_0xf5c82['query']);_0x32a78d[_0xa1d8('0x34')]=_[_0xa1d8('0x32')](_0xf5c82['model'],qs[_0xa1d8('0x35')](_0x26fd80[_0xa1d8('0x2f')]['fields']));_0x32a78d['attributes']=_0x32a78d[_0xa1d8('0x34')][_0xa1d8('0x36')]?_0x32a78d['attributes']:_0xf5c82[_0xa1d8('0x33')];if(!_0x26fd80[_0xa1d8('0x2f')][_0xa1d8('0x37')](_0xa1d8('0x38'))){_0x32a78d[_0xa1d8('0x1f')]=qs[_0xa1d8('0x1f')](_0x26fd80['query'][_0xa1d8('0x1f')]);_0x32a78d[_0xa1d8('0x1d')]=qs[_0xa1d8('0x1d')](_0x26fd80[_0xa1d8('0x2f')][_0xa1d8('0x1d')]);}_0x32a78d[_0xa1d8('0x39')]=qs[_0xa1d8('0x3a')](_0x26fd80[_0xa1d8('0x2f')][_0xa1d8('0x3a')]);_0x32a78d[_0xa1d8('0x3b')]=qs['filters'](_[_0xa1d8('0x3c')](_0x26fd80[_0xa1d8('0x2f')],_0xf5c82[_0xa1d8('0x31')]),_0x40bd2a);if(_0x26fd80[_0xa1d8('0x2f')]['filter']){_0x32a78d['where']=_[_0xa1d8('0x3d')](_0x32a78d[_0xa1d8('0x3b')],{'$or':_[_0xa1d8('0x2a')](_0x40bd2a,function(_0x52a94c){if(_0x52a94c[_0xa1d8('0x3e')]!==_0xa1d8('0x3f')){var _0x21a3b3={};_0x21a3b3[_0x52a94c[_0xa1d8('0x27')]]={'$like':'%'+_0x26fd80[_0xa1d8('0x2f')][_0xa1d8('0x40')]+'%'};return _0x21a3b3;}})});}_0x32a78d=_['merge']({},_0x32a78d,_0x26fd80['options']);var _0x58484a={'where':_0x32a78d['where']};return db[_0xa1d8('0x2b')][_0xa1d8('0x20')](_0x58484a)[_0xa1d8('0x24')](function(_0x1f5d29){_0x3270a8[_0xa1d8('0x20')]=_0x1f5d29;if(_0x26fd80[_0xa1d8('0x2f')][_0xa1d8('0x41')]){_0x32a78d['include']=[{'all':!![]}];}return db[_0xa1d8('0x2b')]['findAll'](_0x32a78d);})[_0xa1d8('0x24')](function(_0x450338){_0x3270a8[_0xa1d8('0x42')]=_0x450338;return _0x3270a8;})[_0xa1d8('0x24')](respondWithFilteredResult(_0x228b8d,_0x32a78d))[_0xa1d8('0x43')](handleError(_0x228b8d,null));};exports[_0xa1d8('0x44')]=function(_0x5b4547,_0x28cd8a){var _0x1a1ec9={'raw':!![],'where':{'id':_0x5b4547[_0xa1d8('0x45')]['id']}},_0x3f0535={};_0x3f0535[_0xa1d8('0x33')]=_[_0xa1d8('0x30')](db[_0xa1d8('0x2b')][_0xa1d8('0x2c')]);_0x3f0535[_0xa1d8('0x2f')]=_[_0xa1d8('0x30')](_0x5b4547[_0xa1d8('0x2f')]);_0x3f0535[_0xa1d8('0x31')]=_['intersection'](_0x3f0535[_0xa1d8('0x33')],_0x3f0535[_0xa1d8('0x2f')]);_0x1a1ec9[_0xa1d8('0x34')]=_[_0xa1d8('0x32')](_0x3f0535[_0xa1d8('0x33')],qs[_0xa1d8('0x35')](_0x5b4547[_0xa1d8('0x2f')][_0xa1d8('0x35')]));_0x1a1ec9[_0xa1d8('0x34')]=_0x1a1ec9[_0xa1d8('0x34')][_0xa1d8('0x36')]?_0x1a1ec9[_0xa1d8('0x34')]:_0x3f0535[_0xa1d8('0x33')];if(_0x5b4547[_0xa1d8('0x2f')][_0xa1d8('0x41')]){_0x1a1ec9[_0xa1d8('0x46')]=[{'all':!![]}];}_0x1a1ec9=_[_0xa1d8('0x3d')]({},_0x1a1ec9,_0x5b4547[_0xa1d8('0x47')]);return db[_0xa1d8('0x2b')][_0xa1d8('0x48')](_0x1a1ec9)['then'](handleEntityNotFound(_0x28cd8a,null))[_0xa1d8('0x24')](respondWithResult(_0x28cd8a,null))['catch'](handleError(_0x28cd8a,null));};exports[_0xa1d8('0x49')]=function(_0x42220b,_0x11bd79){var _0x5a8a77={'where':{'id':_0x42220b[_0xa1d8('0x45')]['id']}},_0x1d75ec={};_0x1d75ec[_0xa1d8('0x33')]=_[_0xa1d8('0x30')](db[_0xa1d8('0x2b')][_0xa1d8('0x2c')]);_0x5a8a77[_0xa1d8('0x34')]=_[_0xa1d8('0x32')](_0x1d75ec[_0xa1d8('0x33')],qs[_0xa1d8('0x35')](_0x42220b[_0xa1d8('0x2f')][_0xa1d8('0x35')]));_0x5a8a77[_0xa1d8('0x34')]=_0x5a8a77[_0xa1d8('0x34')]['length']?_0x5a8a77[_0xa1d8('0x34')]:_0x1d75ec[_0xa1d8('0x33')];if(_0x42220b[_0xa1d8('0x2f')]['includeAll']){_0x5a8a77[_0xa1d8('0x46')]=[{'all':!![]}];}_0x5a8a77=_[_0xa1d8('0x3d')]({},_0x5a8a77,_0x42220b[_0xa1d8('0x47')]);return db['Attachment']['find'](_0x5a8a77)[_0xa1d8('0x24')](handleEntityNotFound(_0x11bd79,null))[_0xa1d8('0x24')](function(_0x214dbf){if(_0x214dbf){var _0x5cf24e=_0x214dbf[_0xa1d8('0x4a')]({'plain':!![]});_0x5cf24e=qs[_0xa1d8('0x4b')](_0x5cf24e,['id',_0xa1d8('0x4c'),_0xa1d8('0x4d')]);_0x42220b[_0xa1d8('0x4e')]=_['omit'](_0x42220b['body'],['id','createdAt',_0xa1d8('0x4d')]);return db[_0xa1d8('0x2b')][_0xa1d8('0x4f')](_[_0xa1d8('0x3d')](_0x5cf24e,_0x42220b[_0xa1d8('0x4e')]),{'include':_0x42220b[_0xa1d8('0x2f')][_0xa1d8('0x41')]?[{'all':!![]}]:undefined});}})[_0xa1d8('0x24')](respondWithResult(_0x11bd79,0xc9))[_0xa1d8('0x43')](handleError(_0x11bd79,null));};exports[_0xa1d8('0x50')]=function(_0x1bb8a9,_0x461622){if(_0x1bb8a9[_0xa1d8('0x4e')]['id']){delete _0x1bb8a9[_0xa1d8('0x4e')]['id'];}return db['Attachment'][_0xa1d8('0x48')]({'where':{'id':_0x1bb8a9[_0xa1d8('0x45')]['id']}})[_0xa1d8('0x24')](handleEntityNotFound(_0x461622,null))[_0xa1d8('0x24')](saveUpdates(_0x1bb8a9[_0xa1d8('0x4e')],null))[_0xa1d8('0x24')](respondWithResult(_0x461622,null))[_0xa1d8('0x43')](handleError(_0x461622,null));};exports['destroy']=function(_0x5e4315,_0x45a991){return db[_0xa1d8('0x2b')]['find']({'where':{'id':_0x5e4315['params']['id']}})['then'](handleEntityNotFound(_0x45a991,null))[_0xa1d8('0x24')](removeEntity(_0x45a991,null))[_0xa1d8('0x43')](handleError(_0x45a991,null));};exports[_0xa1d8('0x4f')]=function(_0x2243b9,_0x394813,_0x35a574){_0x2243b9[_0xa1d8('0x4e')][_0xa1d8('0x27')]=_0x2243b9[_0xa1d8('0x51')][_0xa1d8('0x52')];_0x2243b9[_0xa1d8('0x4e')][_0xa1d8('0x53')]=_0x2243b9['file'][_0xa1d8('0x54')];_0x2243b9[_0xa1d8('0x4e')][_0xa1d8('0x3e')]=_0x2243b9['file'][_0xa1d8('0x55')];return db['Attachment']['create'](_0x2243b9[_0xa1d8('0x4e')])[_0xa1d8('0x24')](respondWithResult(_0x394813,0xc9))[_0xa1d8('0x43')](handleError(_0x394813,null));};exports[_0xa1d8('0x56')]=function(_0x18cfd5,_0x5c0cb2,_0x39db6b){return db['Attachment'][_0xa1d8('0x57')]({'where':{'id':_0x18cfd5[_0xa1d8('0x45')]['id']},'raw':!![]})[_0xa1d8('0x24')](handleEntityNotFound(_0x5c0cb2,null))[_0xa1d8('0x24')](function(_0x38a4e0){if(_0x38a4e0){var _0x56f432=_0x38a4e0[_0xa1d8('0x58')]!==null;var _0x12719e=path[_0xa1d8('0x59')](config[_0xa1d8('0x5a')],_0xa1d8('0x5b'));if(_0x56f432){_0x12719e=path[_0xa1d8('0x59')](_0x12719e,'offline-chat/');}var _0x22ca67=path[_0xa1d8('0x59')](_0x12719e,_0x38a4e0[_0xa1d8('0x53')]);return _0x5c0cb2[_0xa1d8('0x56')](_0x22ca67);}})['catch'](handleError(_0x5c0cb2,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 3d7a1b5..0696b80 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 _0xb1c7=['lodash','moment','bluebird','path','rimraf','../../config/environment','exports','define','Attachment','attachments'];(function(_0x2c690b,_0x4b42dd){var _0x8756cd=function(_0x396522){while(--_0x396522){_0x2c690b['push'](_0x2c690b['shift']());}};_0x8756cd(++_0x4b42dd);}(_0xb1c7,0x96));var _0x7b1c=function(_0x353313,_0x5c3686){_0x353313=_0x353313-0x0;var _0x4cb750=_0xb1c7[_0x353313];return _0x4cb750;};'use strict';var _=require(_0x7b1c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7b1c('0x1'));var BPromise=require(_0x7b1c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b1c('0x3'));var rimraf=require(_0x7b1c('0x4'));var config=require(_0x7b1c('0x5'));var attributes=require('./attachment.attributes');module[_0x7b1c('0x6')]=function(_0x3e7395,_0x516d3d){return _0x3e7395[_0x7b1c('0x7')](_0x7b1c('0x8'),attributes,{'tableName':_0x7b1c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfce2=['api','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','lodash','util','../../config/logger'];(function(_0x1b1266,_0xa8fd7a){var _0x48aeed=function(_0x27fc59){while(--_0x27fc59){_0x1b1266['push'](_0x1b1266['shift']());}};_0x48aeed(++_0xa8fd7a);}(_0xfce2,0xf4));var _0x2fce=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfce2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2fce('0x0'));var util=require(_0x2fce('0x1'));var logger=require(_0x2fce('0x2'))(_0x2fce('0x3'));var moment=require(_0x2fce('0x4'));var BPromise=require(_0x2fce('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2fce('0x6'));var rimraf=require(_0x2fce('0x7'));var config=require(_0x2fce('0x8'));var attributes=require(_0x2fce('0x9'));module[_0x2fce('0xa')]=function(_0x267ef2,_0x19e07c){return _0x267ef2[_0x2fce('0xb')]('Attachment',attributes,{'tableName':_0x2fce('0xc'),'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 3919b97..7a97bdb 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 _0x1b32=['http','info','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Attachment,\x20%s,\x20%s','message','result','catch','create','body','options','raw','then','CreateAttachment','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xbebf50,_0x44ec09){var _0xce1496=function(_0x1bf94d){while(--_0x1bf94d){_0xbebf50['push'](_0xbebf50['shift']());}};_0xce1496(++_0x44ec09);}(_0x1b32,0x85));var _0x21b3=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x1b32[_0x476bf4];return _0x788ffe;};'use strict';var _=require('lodash');var util=require(_0x21b3('0x0'));var moment=require(_0x21b3('0x1'));var BPromise=require(_0x21b3('0x2'));var rs=require(_0x21b3('0x3'));var fs=require('fs');var Redis=require(_0x21b3('0x4'));var db=require(_0x21b3('0x5'))['db'];var utils=require(_0x21b3('0x6'));var logger=require(_0x21b3('0x7'))(_0x21b3('0x8'));var config=require(_0x21b3('0x9'));var jayson=require(_0x21b3('0xa'));var client=jayson[_0x21b3('0xb')][_0x21b3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47516a,_0x21e881,_0x5c0f36){return new BPromise(function(_0x45b1b7,_0x5639eb){return client['request'](_0x47516a,_0x5c0f36)['then'](function(_0xd7a981){logger[_0x21b3('0xd')]('Attachment,\x20%s,\x20%s',_0x21e881,'request\x20sent');logger[_0x21b3('0xe')](_0x21b3('0xf'),_0x21e881,_0x21b3('0x10'),JSON['stringify'](_0xd7a981));if(_0xd7a981[_0x21b3('0x11')]){if(_0xd7a981[_0x21b3('0x11')][_0x21b3('0x12')]===0x1f4){logger[_0x21b3('0x11')](_0x21b3('0x13'),_0x21e881,_0xd7a981[_0x21b3('0x11')][_0x21b3('0x14')]);return _0x5639eb(_0xd7a981[_0x21b3('0x11')][_0x21b3('0x14')]);}logger['error'](_0x21b3('0x13'),_0x21e881,_0xd7a981[_0x21b3('0x11')][_0x21b3('0x14')]);return _0x45b1b7(_0xd7a981['error'][_0x21b3('0x14')]);}else{logger['info'](_0x21b3('0x13'),_0x21e881,'request\x20sent');_0x45b1b7(_0xd7a981[_0x21b3('0x15')][_0x21b3('0x14')]);}})[_0x21b3('0x16')](function(_0x4217d6){logger['error'](_0x21b3('0x13'),_0x21e881,_0x4217d6);_0x5639eb(_0x4217d6);});});}exports['CreateAttachment']=function(_0x408c17){var _0x2af6e4=this;return new Promise(function(_0xaf1eba,_0x21921b){return db['Attachment'][_0x21b3('0x17')](_0x408c17[_0x21b3('0x18')],{'raw':_0x408c17[_0x21b3('0x19')]?_0x408c17['options'][_0x21b3('0x1a')]===undefined?!![]:![]:!![]})[_0x21b3('0x1b')](function(_0x2f996d){logger[_0x21b3('0xd')](_0x21b3('0x1c'),_0x408c17);logger[_0x21b3('0xe')](_0x21b3('0x1c'),_0x408c17,JSON['stringify'](_0x2f996d));_0xaf1eba(_0x2f996d);})[_0x21b3('0x16')](function(_0x54695b){logger[_0x21b3('0x11')](_0x21b3('0x1c'),_0x54695b[_0x21b3('0x14')],_0x408c17);_0x21921b(_0x2af6e4['error'](0x1f4,_0x54695b[_0x21b3('0x14')]));});});}; \ No newline at end of file +var _0x21a3=['Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Attachment','create','body','options','raw','CreateAttachment','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x21a3,0x66));var _0x321a=function(_0x22e101,_0x412840){_0x22e101=_0x22e101-0x0;var _0xa51f61=_0x21a3[_0x22e101];return _0xa51f61;};'use strict';var _=require(_0x321a('0x0'));var util=require('util');var moment=require(_0x321a('0x1'));var BPromise=require(_0x321a('0x2'));var rs=require(_0x321a('0x3'));var fs=require('fs');var Redis=require(_0x321a('0x4'));var db=require(_0x321a('0x5'))['db'];var utils=require(_0x321a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x321a('0x7'));var jayson=require(_0x321a('0x8'));var client=jayson[_0x321a('0x9')][_0x321a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f3b81,_0x388901,_0x24a04c){return new BPromise(function(_0x10c1d3,_0xdfd6b8){return client[_0x321a('0xb')](_0x5f3b81,_0x24a04c)[_0x321a('0xc')](function(_0x2c52dc){logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,_0x321a('0xf'));logger[_0x321a('0x10')](_0x321a('0x11'),_0x388901,'request\x20sent',JSON[_0x321a('0x12')](_0x2c52dc));if(_0x2c52dc[_0x321a('0x13')]){if(_0x2c52dc['error']['code']===0x1f4){logger[_0x321a('0x13')]('Attachment,\x20%s,\x20%s',_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0xdfd6b8(_0x2c52dc['error']['message']);}logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0x10c1d3(_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);}else{logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,'request\x20sent');_0x10c1d3(_0x2c52dc[_0x321a('0x15')][_0x321a('0x14')]);}})['catch'](function(_0x45ceb2){logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x45ceb2);_0xdfd6b8(_0x45ceb2);});});}exports['CreateAttachment']=function(_0x5b1810){var _0x464bd7=this;return new Promise(function(_0x35fd6f,_0x58595b){return db[_0x321a('0x16')][_0x321a('0x17')](_0x5b1810[_0x321a('0x18')],{'raw':_0x5b1810['options']?_0x5b1810[_0x321a('0x19')][_0x321a('0x1a')]===undefined?!![]:![]:!![]})[_0x321a('0xc')](function(_0x423cb8){logger[_0x321a('0xd')](_0x321a('0x1b'),_0x5b1810);logger[_0x321a('0x10')](_0x321a('0x1b'),_0x5b1810,JSON[_0x321a('0x12')](_0x423cb8));_0x35fd6f(_0x423cb8);})[_0x321a('0x1c')](function(_0x1b94a1){logger[_0x321a('0x13')]('CreateAttachment',_0x1b94a1[_0x321a('0x14')],_0x5b1810);_0x58595b(_0x464bd7[_0x321a('0x13')](0x1f4,_0x1b94a1[_0x321a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 5246966..0d66c20 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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x39908d,_0x375620){var _0x592f52=function(_0x4425e4){while(--_0x4425e4){_0x39908d['push'](_0x39908d['shift']());}};_0x592f52(++_0x375620);}(_0xb10b,0x12a));var _0xbb10=function(_0x28f153,_0x4852ed){_0x28f153=_0x28f153-0x0;var _0x56b861=_0xb10b[_0x28f153];return _0x56b861;};'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('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file +var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x0b0e[_0x45d55e];return _0x29812a;};'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('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);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 c5e3433..6b31fab 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 _0x5b25=['../../config/utils','login','authenticate','google','/login','profile','email','callback','use','clientSecret','secret','callbackURL','Setting','findOne','blockDuration','then','map','value','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken'];(function(_0x3af288,_0x1a9c9c){var _0x55d2a4=function(_0x4d0677){while(--_0x4d0677){_0x3af288['push'](_0x3af288['shift']());}};_0x55d2a4(++_0x1a9c9c);}(_0x5b25,0x88));var _0x55b2=function(_0x1256ca,_0x29a6c2){_0x1256ca=_0x1256ca-0x0;var _0x55fa8c=_0x5b25[_0x1256ca];return _0x55fa8c;};'use strict';var _=require(_0x55b2('0x0'));var passport=require(_0x55b2('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0x55b2('0x2')];var moment=require(_0x55b2('0x3'));var db=require(_0x55b2('0x4'))['db'];var config=require(_0x55b2('0x5'));var signToken=require(_0x55b2('0x6'))[_0x55b2('0x7')];var utils=require(_0x55b2('0x8'));exports[_0x55b2('0x9')]=passport[_0x55b2('0xa')](_0x55b2('0xb'),{'failureRedirect':_0x55b2('0xc'),'scope':[_0x55b2('0xd'),_0x55b2('0xe')],'session':![]});exports[_0x55b2('0xf')]=passport['authenticate']('google',{'failureRedirect':'/login','session':![]});passport[_0x55b2('0x10')](new GoogleStrategy({'clientID':config[_0x55b2('0xb')]?config['google']['clientID']:'id','clientSecret':config[_0x55b2('0xb')]?config[_0x55b2('0xb')][_0x55b2('0x11')]:_0x55b2('0x12'),'callbackURL':config[_0x55b2('0xb')]?config[_0x55b2('0xb')][_0x55b2('0x13')]:''},function(_0x36beed,_0x3b5c15,_0x480b67,_0x49dd9b){var _0x409cbc,_0x2a7edd;return db[_0x55b2('0x14')][_0x55b2('0x15')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x55b2('0x16')],'raw':!![]})[_0x55b2('0x17')](function(_0x45c9c4){_0x409cbc=_0x45c9c4;return db['User']['find']({'where':{'email':_[_0x55b2('0x18')](_0x480b67['emails'],_0x55b2('0x19')),'role':{'$or':['admin','user',_0x55b2('0x1a')]}}});})['then'](function(_0x16b340){_0x2a7edd=_0x16b340;if(_0x2a7edd){if(_0x2a7edd[_0x55b2('0x1b')]){return _0x49dd9b(_0x55b2('0x1c'));}else if(_0x409cbc['blockDuration']>0x0){if(_0x2a7edd[_0x55b2('0x1d')]){if(moment(_0x2a7edd[_0x55b2('0x1e')])[_0x55b2('0x1f')](_0x409cbc[_0x55b2('0x16')],_0x55b2('0x20'))>moment()){return _0x49dd9b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x55b2('0x21')](_0x2a7edd,0x0,![],null)['then'](function(){return utils[_0x55b2('0x22')](_0x2a7edd);})[_0x55b2('0x17')](function(){return _0x49dd9b(null,_0x2a7edd);});}}else{return utils[_0x55b2('0x22')](_0x2a7edd)[_0x55b2('0x17')](function(){return _0x49dd9b(null,_0x2a7edd);});}}else{return utils['getLicense'](_0x2a7edd)[_0x55b2('0x17')](function(){return _0x49dd9b(null,_0x2a7edd);});}}return _0x49dd9b(_0x55b2('0x1c'));})[_0x55b2('0x23')](function(_0x505c4c){_0x49dd9b(_0x505c4c);});})); \ No newline at end of file +var _0x2d90=['clientID','clientSecret','secret','Setting','findOne','blockDuration','then','User','find','emails','value','user','agent','disabled','blocked','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','login','google','/login','profile','email','callback'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x2d90,0x1a1));var _0x02d9=function(_0x3d82af,_0x5a703d){_0x3d82af=_0x3d82af-0x0;var _0x22de45=_0x2d90[_0x3d82af];return _0x22de45;};'use strict';var _=require(_0x02d9('0x0'));var passport=require(_0x02d9('0x1'));var GoogleStrategy=require(_0x02d9('0x2'))[_0x02d9('0x3')];var moment=require(_0x02d9('0x4'));var db=require(_0x02d9('0x5'))['db'];var config=require(_0x02d9('0x6'));var signToken=require('../../components/auth/service')[_0x02d9('0x7')];var utils=require(_0x02d9('0x8'));exports[_0x02d9('0x9')]=passport['authenticate'](_0x02d9('0xa'),{'failureRedirect':_0x02d9('0xb'),'scope':[_0x02d9('0xc'),_0x02d9('0xd')],'session':![]});exports[_0x02d9('0xe')]=passport['authenticate']('google',{'failureRedirect':_0x02d9('0xb'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x02d9('0xa')]?config[_0x02d9('0xa')][_0x02d9('0xf')]:'id','clientSecret':config[_0x02d9('0xa')]?config[_0x02d9('0xa')][_0x02d9('0x10')]:_0x02d9('0x11'),'callbackURL':config['google']?config[_0x02d9('0xa')]['callbackURL']:''},function(_0x18883b,_0x1f5a46,_0xc0254e,_0x113d00){var _0x2c6f59,_0x2fc789;return db[_0x02d9('0x12')][_0x02d9('0x13')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x02d9('0x14')],'raw':!![]})[_0x02d9('0x15')](function(_0xb07f0d){_0x2c6f59=_0xb07f0d;return db[_0x02d9('0x16')][_0x02d9('0x17')]({'where':{'email':_['map'](_0xc0254e[_0x02d9('0x18')],_0x02d9('0x19')),'role':{'$or':['admin',_0x02d9('0x1a'),_0x02d9('0x1b')]}}});})[_0x02d9('0x15')](function(_0x65201b){_0x2fc789=_0x65201b;if(_0x2fc789){if(_0x2fc789[_0x02d9('0x1c')]){return _0x113d00('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x2c6f59[_0x02d9('0x14')]>0x0){if(_0x2fc789[_0x02d9('0x1d')]){if(moment(_0x2fc789[_0x02d9('0x1e')])[_0x02d9('0x1f')](_0x2c6f59[_0x02d9('0x14')],_0x02d9('0x20'))>moment()){return _0x113d00(_0x02d9('0x21'));}else{return utils[_0x02d9('0x22')](_0x2fc789,0x0,![],null)['then'](function(){return utils[_0x02d9('0x23')](_0x2fc789);})[_0x02d9('0x15')](function(){return _0x113d00(null,_0x2fc789);});}}else{return utils[_0x02d9('0x23')](_0x2fc789)[_0x02d9('0x15')](function(){return _0x113d00(null,_0x2fc789);});}}else{return utils[_0x02d9('0x23')](_0x2fc789)['then'](function(){return _0x113d00(null,_0x2fc789);});}}return _0x113d00('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})['catch'](function(_0x420c34){_0x113d00(_0x420c34);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 919c0ce..f23e26f 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 _0x33d8=['get','callback','isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x33d8,0x1a7));var _0x833d=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x33d8[_0x4b055c];return _0x4b62bb;};'use strict';var express=require('express');var passport=require(_0x833d('0x0'));var router=express[_0x833d('0x1')]();var controller=require(_0x833d('0x2'));var userController=require(_0x833d('0x3'));var authService=require(_0x833d('0x4'));router['get']('/',controller[_0x833d('0x5')]);router[_0x833d('0x6')]('/callback',controller[_0x833d('0x7')],authService[_0x833d('0x8')],userController[_0x833d('0x5')],authService[_0x833d('0x9')]);module[_0x833d('0xa')]=router; \ No newline at end of file +var _0x8a9c=['exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','login','/callback','callback','isMiddleware','setTokenCookie'];(function(_0x900da4,_0x3857fa){var _0x2e6bdb=function(_0x31204c){while(--_0x31204c){_0x900da4['push'](_0x900da4['shift']());}};_0x2e6bdb(++_0x3857fa);}(_0x8a9c,0x12d));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xc8a9('0x0'));var passport=require(_0xc8a9('0x1'));var router=express[_0xc8a9('0x2')]();var controller=require(_0xc8a9('0x3'));var userController=require(_0xc8a9('0x4'));var authService=require('../../components/auth/service');router[_0xc8a9('0x5')]('/',controller[_0xc8a9('0x6')]);router['get'](_0xc8a9('0x7'),controller[_0xc8a9('0x8')],authService[_0xc8a9('0x9')],userController['login'],authService[_0xc8a9('0xa')]);module[_0xc8a9('0xb')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index f4f3f52..af692d5 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 _0x2289=['minutes','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','https://','headers','send','Reset\x20Email\x20sent!','reset','params','token','now','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','blockDuration','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','clearBlockUser','getLicense','catch','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','login','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.'];(function(_0x2fa946,_0x4e1f6e){var _0x4ed01c=function(_0x4ed8df){while(--_0x4ed8df){_0x2fa946['push'](_0x2fa946['shift']());}};_0x4ed01c(++_0x4e1f6e);}(_0x2289,0xc6));var _0x9228=function(_0xd31621,_0x17b567){_0xd31621=_0xd31621-0x0;var _0x2e7ac0=_0x2289[_0xd31621];return _0x2e7ac0;};'use strict';var util=require(_0x9228('0x0'));var passport=require(_0x9228('0x1'));var LocalStrategy=require(_0x9228('0x2'))['Strategy'];var jayson=require(_0x9228('0x3'));var _=require(_0x9228('0x4'));var rs=require(_0x9228('0x5'));var moment=require('moment');var db=require(_0x9228('0x6'))['db'];var authService=require(_0x9228('0x7'));var utils=require(_0x9228('0x8'));var client=jayson[_0x9228('0x9')][_0x9228('0xa')]({'port':0x232b});function localAuthenticate(_0x22c518,_0x4c6591,_0x2c8859,_0x4ccf04){var _0x1497a5,_0x39aec2;return db[_0x9228('0xb')][_0x9228('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x9228('0xd')],'raw':!![]})['then'](function(_0x34ce70){_0x1497a5=_0x34ce70;return _0x22c518[_0x9228('0xc')]({'attributes':['id',_0x9228('0xe'),_0x9228('0xf'),_0x9228('0x10'),_0x9228('0x11'),_0x9228('0x12'),_0x9228('0x13'),_0x9228('0x14'),_0x9228('0x15')],'where':{'name':_0x4c6591,'role':{'$or':[_0x9228('0x16'),_0x9228('0x17'),_0x9228('0x18')]}}});})[_0x9228('0x19')](function(_0x99f523){if(!_0x99f523||_0x99f523&&_0x99f523['name']!==_0x4c6591){throw new Error(_0x9228('0x1a'));}else{_0x39aec2=_0x99f523;return _0x39aec2;}})[_0x9228('0x19')](function(){_0x39aec2['authenticate'](_0x2c8859,function(_0x920bad,_0x2efcaf){var _0x18e348=_0x39aec2['loginAttempts']+0x1;if(_0x920bad){return _0x4ccf04(_0x920bad);}else if(!_0x2efcaf){if(_0x39aec2[_0x9228('0x12')]){return _0x4ccf04(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1497a5[_0x9228('0x1b')]>0x0){if(_0x39aec2[_0x9228('0x13')]){if(_0x1497a5[_0x9228('0xd')]>0x0){if(moment(_0x39aec2[_0x9228('0x14')])[_0x9228('0x1c')](_0x1497a5[_0x9228('0xd')],'minutes')>moment()){return _0x4ccf04(null,![],{'message':_0x9228('0x1a')});}else{return utils[_0x9228('0x1d')](_0x39aec2,_0x18e348,![],null)[_0x9228('0x19')](function(){return _0x4ccf04(null,![],{'message':_0x9228('0x1a')});});}}else{return _0x4ccf04(null,![],{'message':_0x9228('0x1a')});}}else{if(_0x18e348>=_0x1497a5[_0x9228('0x1b')]){return utils[_0x9228('0x1d')](_0x39aec2,0x0,!![],moment())[_0x9228('0x19')](function(){return _0x4ccf04(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x9228('0x1d')](_0x39aec2,_0x18e348,![],null)[_0x9228('0x19')](function(){return _0x4ccf04(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x4ccf04(null,![],{'message':_0x9228('0x1a')});}}else{if(_0x39aec2['disabled']){return _0x4ccf04(null,![],{'message':_0x9228('0x1a')});}else if(_0x1497a5[_0x9228('0x1b')]>0x0){if(_0x39aec2[_0x9228('0x13')]){if(_0x1497a5[_0x9228('0xd')]>0x0){if(moment(_0x39aec2[_0x9228('0x14')])[_0x9228('0x1c')](_0x1497a5[_0x9228('0xd')],'minutes')>moment()){return _0x4ccf04(null,![],{'message':_0x9228('0x1a')});}else{return utils['clearBlockUser'](_0x39aec2,0x0,![],null)[_0x9228('0x19')](function(){return utils[_0x9228('0x1e')](_0x39aec2);})[_0x9228('0x19')](function(){return _0x4ccf04(null,_0x39aec2);});}}else{return _0x4ccf04(null,![],{'message':_0x9228('0x1a')});}}else{return utils['clearBlockUser'](_0x39aec2,0x0,![],null)[_0x9228('0x19')](function(){return utils[_0x9228('0x1e')](_0x39aec2);})['then'](function(){return _0x4ccf04(null,_0x39aec2);})[_0x9228('0x1f')](function(_0x57bb35){return _0x4ccf04(null,![],_0x57bb35);});}}else{if(_0x39aec2['blocked']){return _0x4ccf04(null,![],{'message':_0x9228('0x1a')});}else{return utils['getLicense'](_0x39aec2)['then'](function(){return _0x4ccf04(null,_0x39aec2);});}}}});})[_0x9228('0x1f')](function(_0x5d21aa){return _0x4ccf04(null,![],_0x5d21aa);});}function sendServiceMail(_0x4fe67b){return db['MailAccount'][_0x9228('0x20')]({'where':{'service':!![]},'attributes':['id',_0x9228('0xe'),_0x9228('0x21')],'include':[{'model':db['MailServerOut'],'as':_0x9228('0x22')}]})[_0x9228('0x19')](function(_0x484a38){if(!_0x484a38){throw new Error(_0x9228('0x23'));}var _0x20aecc={'tls':{'rejectUnauthorized':![]}};if(_0x484a38[_0x9228('0x22')]['service']){_0x20aecc[_0x9228('0x24')]=_0x484a38[_0x9228('0x22')][_0x9228('0x24')];}else{_0x20aecc[_0x9228('0x25')]=_0x484a38[_0x9228('0x22')][_0x9228('0x25')];_0x20aecc[_0x9228('0x26')]=_0x484a38[_0x9228('0x22')]['port'];_0x20aecc[_0x9228('0x27')]=_0x484a38[_0x9228('0x22')][_0x9228('0x27')];}if(_0x484a38['Smtp']['authentication']){_0x20aecc['auth']={'user':_0x484a38[_0x9228('0x22')][_0x9228('0x17')],'pass':_0x484a38[_0x9228('0x22')][_0x9228('0x28')]};}var _0x4050bc={'account':_0x20aecc,'message':_[_0x9228('0x29')]({'from':util[_0x9228('0x2a')](_0x9228('0x2b'),_0x484a38['name'],_0x484a38[_0x9228('0x21')]||_0x484a38[_0x9228('0x22')][_0x9228('0x17')])},_0x4fe67b)};return client[_0x9228('0x2c')](_0x9228('0x2d'),_0x4050bc);})[_0x9228('0x19')](function(_0xffc4ca){if(_0xffc4ca['error']){throw new Error(util['format'](_0x9228('0x2e'),_0xffc4ca[_0x9228('0x2f')][_0x9228('0x30')]||JSON[_0x9228('0x31')](_0xffc4ca[_0x9228('0x2f')])));}return!![];});}function handleError(_0x58e786,_0xd81775,_0x4fa2f3){return _0x58e786[_0x9228('0x32')](_0xd81775||0x1f4)['send']({'message':_0x4fa2f3?_0x4fa2f3[_0x9228('0x30')]||_0x4fa2f3:''});}exports[_0x9228('0x33')]=function(_0x367646,_0x28368d,_0x30c27d){passport[_0x9228('0x34')](_0x9228('0x35'),function(_0xbbe1ab,_0x3467a2,_0xab223a){var _0xd25fb1=_0xbbe1ab||_0xab223a;if(_0xd25fb1){return handleError(_0x28368d,0x191,_0xd25fb1);}if(!_0x3467a2){return handleError(_0x28368d,0x194,{'message':_0x9228('0x36')});}else{var _0x668af4={'payload':{'id':_0x3467a2['id'],'role':_0x3467a2[_0x9228('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x9228('0x37')](_0x668af4)[_0x9228('0x19')](function(_0x5d194e){_0x28368d[_0x9228('0x38')]({'id':_0x3467a2['id'],'token':_0x5d194e,'statusCall':'','isAlreadyLogged':_0x3467a2[_0x9228('0x39')]});});}})(_0x367646,_0x28368d,_0x30c27d);};exports[_0x9228('0x3a')]=function(_0x31d16e,_0xd5ad24,_0x649f33){if(!_0x31d16e[_0x9228('0x3b')]['email']){return handleError(_0xd5ad24,0x1f4,{'message':_0x9228('0x3c')});}var _0x2e1557=rs[_0x9228('0x3d')]();_0x31d16e[_0x9228('0x3b')][_0x9228('0x21')]=_0x31d16e[_0x9228('0x3b')][_0x9228('0x21')][_0x9228('0x3e')]()[_0x9228('0x3f')]();var _0x3c5792;return db[_0x9228('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x9228('0x1b'),_0x9228('0xd')],'raw':!![]})[_0x9228('0x19')](function(_0x5133e2){_0x3c5792=_0x5133e2;return db[_0x9228('0x40')][_0x9228('0x20')]({'where':{'email':_0x31d16e[_0x9228('0x3b')][_0x9228('0x21')]}});})['then'](function(_0xed9a0b){if(!_0xed9a0b){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0xed9a0b[_0x9228('0x12')]){throw new Error(_0x9228('0x41'));}if(_0xed9a0b[_0x9228('0x13')]){if(moment(_0xed9a0b['blockedAt'])[_0x9228('0x1c')](_0x3c5792[_0x9228('0xd')],_0x9228('0x42'))>moment()){throw new Error(_0x9228('0x43'));}else{_0xed9a0b['blocked']=![];_0xed9a0b['blockedAt']=null;}}_0xed9a0b[_0x9228('0x44')]=_0x2e1557;_0xed9a0b[_0x9228('0x45')]=Date['now']()+0x36ee80;return _0xed9a0b['save']();})[_0x9228('0x19')](function(){return sendServiceMail({'to':_0x31d16e[_0x9228('0x3b')]['email'],'subject':_0x9228('0x46'),'text':_0x9228('0x47')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x9228('0x48')+_0x31d16e[_0x9228('0x49')][_0x9228('0x25')]+'/reset/'+_0x2e1557+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x9228('0x19')](function(){_0xd5ad24['status'](0xc8)[_0x9228('0x4a')]({'message':_0x9228('0x4b')});})['catch'](function(_0x1b22a8){return handleError(_0xd5ad24,0x1f4,_0x1b22a8);});};exports[_0x9228('0x4c')]=function(_0x2b7c58,_0xdada7a,_0x15334a){return db[_0x9228('0x40')][_0x9228('0x20')]({'where':{'resetPasswordToken':_0x2b7c58[_0x9228('0x4d')][_0x9228('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x9228('0x4f')]()}}})[_0x9228('0x19')](function(_0x100802){if(!_0x100802){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x9228('0xb')]['findOne']({'attributes':['id',_0x9228('0x50'),_0x9228('0x51'),_0x9228('0x52')]})[_0x9228('0x19')](function(_0x5240a9){if(_0x5240a9[_0x9228('0x50')])authService['validatePasswordPattern'](_0x2b7c58[_0x9228('0x3b')][_0x9228('0xf')]);if(!_0x5240a9['enforcePasswordHistory']||!_0x100802[_0x9228('0x53')])return _0x100802;authService[_0x9228('0x54')](_0x2b7c58[_0x9228('0x3b')][_0x9228('0xf')],_0x100802[_0x9228('0x53')],_0x5240a9['passwordHistoryLimit']);return _0x100802;})[_0x9228('0x19')](function(){_0x100802[_0x9228('0xf')]=_0x2b7c58['body'][_0x9228('0xf')];_0x100802['resetPasswordToken']=null;_0x100802['resetPasswordExpires']=null;return _0x100802[_0x9228('0x55')]();});})['then'](function(){_0xdada7a['status'](0xc8)[_0x9228('0x4a')]({'message':_0x9228('0x56')});})[_0x9228('0x1f')](function(_0x426e11){return handleError(_0xdada7a,0x1f4,_0x426e11);});};passport[_0x9228('0x57')](new LocalStrategy({'usernameField':'name','passwordField':_0x9228('0xf')},function(_0x59029d,_0xaad680,_0x113e5e){return localAuthenticate(db[_0x9228('0x40')],_0x59029d,_0xaad680,_0x113e5e);})); \ No newline at end of file +var _0x1af7=['login','local','role','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','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://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','send','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordHistory','util','passport','passport-local','Strategy','lodash','moment','../../mysqldb','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','clearBlockUser','minutes','getLicense','catch','find','email','MailServerOut','Smtp','service','host','port','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify'];(function(_0x4207f4,_0x1f778b){var _0x29a621=function(_0xa6f5b7){while(--_0xa6f5b7){_0x4207f4['push'](_0x4207f4['shift']());}};_0x29a621(++_0x1f778b);}(_0x1af7,0x1b8));var _0x71af=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1af7[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0x71af('0x0'));var passport=require(_0x71af('0x1'));var LocalStrategy=require(_0x71af('0x2'))[_0x71af('0x3')];var jayson=require('jayson/promise');var _=require(_0x71af('0x4'));var rs=require('randomstring');var moment=require(_0x71af('0x5'));var db=require(_0x71af('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson['client'][_0x71af('0x7')]({'port':0x232b});function localAuthenticate(_0x5510f7,_0x1af506,_0x5e0fdf,_0x3cec6f){var _0x5868c0,_0x47fad8;return db[_0x71af('0x8')][_0x71af('0x9')]({'where':{'id':0x1},'attributes':[_0x71af('0xa'),'blockDuration'],'raw':!![]})[_0x71af('0xb')](function(_0x57c0c0){_0x5868c0=_0x57c0c0;return _0x5510f7[_0x71af('0x9')]({'attributes':['id',_0x71af('0xc'),_0x71af('0xd'),_0x71af('0xe'),'role','disabled',_0x71af('0xf'),_0x71af('0x10'),_0x71af('0x11')],'where':{'name':_0x1af506,'role':{'$or':[_0x71af('0x12'),_0x71af('0x13'),_0x71af('0x14')]}}});})[_0x71af('0xb')](function(_0x4aab00){if(!_0x4aab00||_0x4aab00&&_0x4aab00[_0x71af('0xc')]!==_0x1af506){throw new Error(_0x71af('0x15'));}else{_0x47fad8=_0x4aab00;return _0x47fad8;}})[_0x71af('0xb')](function(){_0x47fad8[_0x71af('0x16')](_0x5e0fdf,function(_0x3002ec,_0xa5c8b9){var _0x5cd36a=_0x47fad8[_0x71af('0x11')]+0x1;if(_0x3002ec){return _0x3cec6f(_0x3002ec);}else if(!_0xa5c8b9){if(_0x47fad8['disabled']){return _0x3cec6f(null,![],{'message':_0x71af('0x15')});}else if(_0x5868c0[_0x71af('0xa')]>0x0){if(_0x47fad8['blocked']){if(_0x5868c0[_0x71af('0x17')]>0x0){if(moment(_0x47fad8['blockedAt'])[_0x71af('0x18')](_0x5868c0[_0x71af('0x17')],'minutes')>moment()){return _0x3cec6f(null,![],{'message':_0x71af('0x15')});}else{return utils['clearBlockUser'](_0x47fad8,_0x5cd36a,![],null)['then'](function(){return _0x3cec6f(null,![],{'message':_0x71af('0x15')});});}}else{return _0x3cec6f(null,![],{'message':_0x71af('0x15')});}}else{if(_0x5cd36a>=_0x5868c0[_0x71af('0xa')]){return utils[_0x71af('0x19')](_0x47fad8,0x0,!![],moment())[_0x71af('0xb')](function(){return _0x3cec6f(null,![],{'message':_0x71af('0x15')});});}else{return utils['clearBlockUser'](_0x47fad8,_0x5cd36a,![],null)[_0x71af('0xb')](function(){return _0x3cec6f(null,![],{'message':_0x71af('0x15')});});}}}else{return _0x3cec6f(null,![],{'message':_0x71af('0x15')});}}else{if(_0x47fad8['disabled']){return _0x3cec6f(null,![],{'message':_0x71af('0x15')});}else if(_0x5868c0[_0x71af('0xa')]>0x0){if(_0x47fad8['blocked']){if(_0x5868c0[_0x71af('0x17')]>0x0){if(moment(_0x47fad8[_0x71af('0x10')])[_0x71af('0x18')](_0x5868c0[_0x71af('0x17')],_0x71af('0x1a'))>moment()){return _0x3cec6f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x47fad8,0x0,![],null)[_0x71af('0xb')](function(){return utils[_0x71af('0x1b')](_0x47fad8);})[_0x71af('0xb')](function(){return _0x3cec6f(null,_0x47fad8);});}}else{return _0x3cec6f(null,![],{'message':_0x71af('0x15')});}}else{return utils['clearBlockUser'](_0x47fad8,0x0,![],null)[_0x71af('0xb')](function(){return utils[_0x71af('0x1b')](_0x47fad8);})[_0x71af('0xb')](function(){return _0x3cec6f(null,_0x47fad8);})[_0x71af('0x1c')](function(_0xa5e756){return _0x3cec6f(null,![],_0xa5e756);});}}else{if(_0x47fad8['blocked']){return _0x3cec6f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x47fad8)[_0x71af('0xb')](function(){return _0x3cec6f(null,_0x47fad8);});}}}});})['catch'](function(_0xabf4d6){return _0x3cec6f(null,![],_0xabf4d6);});}function sendServiceMail(_0x299a60){return db['MailAccount'][_0x71af('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x71af('0xc'),_0x71af('0x1e')],'include':[{'model':db[_0x71af('0x1f')],'as':_0x71af('0x20')}]})[_0x71af('0xb')](function(_0x4a4493){if(!_0x4a4493){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x484b98={'tls':{'rejectUnauthorized':![]}};if(_0x4a4493[_0x71af('0x20')][_0x71af('0x21')]){_0x484b98['service']=_0x4a4493[_0x71af('0x20')][_0x71af('0x21')];}else{_0x484b98['host']=_0x4a4493[_0x71af('0x20')][_0x71af('0x22')];_0x484b98[_0x71af('0x23')]=_0x4a4493[_0x71af('0x20')][_0x71af('0x23')];_0x484b98['secure']=_0x4a4493[_0x71af('0x20')]['secure'];}if(_0x4a4493['Smtp'][_0x71af('0x24')]){_0x484b98[_0x71af('0x25')]={'user':_0x4a4493[_0x71af('0x20')][_0x71af('0x13')],'pass':_0x4a4493[_0x71af('0x20')][_0x71af('0x26')]};}var _0x534ec4={'account':_0x484b98,'message':_[_0x71af('0x27')]({'from':util[_0x71af('0x28')](_0x71af('0x29'),_0x4a4493[_0x71af('0xc')],_0x4a4493[_0x71af('0x1e')]||_0x4a4493['Smtp'][_0x71af('0x13')])},_0x299a60)};return client['request'](_0x71af('0x2a'),_0x534ec4);})['then'](function(_0x4d5d83){if(_0x4d5d83[_0x71af('0x2b')]){throw new Error(util[_0x71af('0x28')](_0x71af('0x2c'),_0x4d5d83[_0x71af('0x2b')]['message']||JSON[_0x71af('0x2d')](_0x4d5d83[_0x71af('0x2b')])));}return!![];});}function handleError(_0x55ab2a,_0x9ea37b,_0x3319fd){return _0x55ab2a['status'](_0x9ea37b||0x1f4)['send']({'message':_0x3319fd?_0x3319fd['message']||_0x3319fd:''});}exports[_0x71af('0x2e')]=function(_0x2351ad,_0x6cd89f,_0x2bbcc3){passport[_0x71af('0x16')](_0x71af('0x2f'),function(_0x53d327,_0x51d5e8,_0x6b3a36){var _0x50e3fe=_0x53d327||_0x6b3a36;if(_0x50e3fe){return handleError(_0x6cd89f,0x191,_0x50e3fe);}if(!_0x51d5e8){return handleError(_0x6cd89f,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3594cd={'payload':{'id':_0x51d5e8['id'],'role':_0x51d5e8[_0x71af('0x30')]},'options':{'expiresIn':0x15180}};return authService[_0x71af('0x31')](_0x3594cd)[_0x71af('0xb')](function(_0x2f7cb5){_0x6cd89f[_0x71af('0x32')]({'id':_0x51d5e8['id'],'token':_0x2f7cb5,'statusCall':'','isAlreadyLogged':_0x51d5e8[_0x71af('0x33')]});});}})(_0x2351ad,_0x6cd89f,_0x2bbcc3);};exports[_0x71af('0x34')]=function(_0x40ff09,_0x4a8ded,_0x338906){if(!_0x40ff09[_0x71af('0x35')][_0x71af('0x1e')]){return handleError(_0x4a8ded,0x1f4,{'message':_0x71af('0x36')});}var _0x45b063=rs[_0x71af('0x37')]();_0x40ff09[_0x71af('0x35')][_0x71af('0x1e')]=_0x40ff09[_0x71af('0x35')][_0x71af('0x1e')]['trim']()[_0x71af('0x38')]();var _0x4594e0;return db[_0x71af('0x8')][_0x71af('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x71af('0x17')],'raw':!![]})[_0x71af('0xb')](function(_0x425059){_0x4594e0=_0x425059;return db[_0x71af('0x39')][_0x71af('0x1d')]({'where':{'email':_0x40ff09[_0x71af('0x35')][_0x71af('0x1e')]}});})['then'](function(_0x372755){if(!_0x372755){throw new Error(_0x71af('0x3a'));}if(_0x372755['disabled']){throw new Error(_0x71af('0x3b'));}if(_0x372755[_0x71af('0xf')]){if(moment(_0x372755['blockedAt'])['add'](_0x4594e0['blockDuration'],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x372755['blocked']=![];_0x372755[_0x71af('0x10')]=null;}}_0x372755[_0x71af('0x3c')]=_0x45b063;_0x372755[_0x71af('0x3d')]=Date['now']()+0x36ee80;return _0x372755[_0x71af('0x3e')]();})[_0x71af('0xb')](function(){return sendServiceMail({'to':_0x40ff09[_0x71af('0x35')]['email'],'subject':_0x71af('0x3f'),'text':_0x71af('0x40')+_0x71af('0x41')+_0x71af('0x42')+_0x40ff09['headers'][_0x71af('0x22')]+_0x71af('0x43')+_0x45b063+'\x0a\x0a'+_0x71af('0x44')});})[_0x71af('0xb')](function(){_0x4a8ded[_0x71af('0x45')](0xc8)[_0x71af('0x46')]({'message':_0x71af('0x47')});})[_0x71af('0x1c')](function(_0x5879ae){return handleError(_0x4a8ded,0x1f4,_0x5879ae);});};exports[_0x71af('0x48')]=function(_0x9cc6db,_0x1c016d,_0x506e08){return db[_0x71af('0x39')][_0x71af('0x1d')]({'where':{'resetPasswordToken':_0x9cc6db[_0x71af('0x49')][_0x71af('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x71af('0x4b')]()}}})[_0x71af('0xb')](function(_0x19222d){if(!_0x19222d){throw new Error(_0x71af('0x4c'));}return db[_0x71af('0x8')][_0x71af('0x9')]({'attributes':['id','securePassword',_0x71af('0x4d'),_0x71af('0x4e')]})[_0x71af('0xb')](function(_0xf8655){if(_0xf8655[_0x71af('0x4f')])authService['validatePasswordPattern'](_0x9cc6db[_0x71af('0x35')][_0x71af('0xd')]);if(!_0xf8655[_0x71af('0x4d')]||!_0x19222d['previousPasswords'])return _0x19222d;authService[_0x71af('0x50')](_0x9cc6db[_0x71af('0x35')][_0x71af('0xd')],_0x19222d['previousPasswords'],_0xf8655[_0x71af('0x4e')]);return _0x19222d;})[_0x71af('0xb')](function(){_0x19222d[_0x71af('0xd')]=_0x9cc6db['body'][_0x71af('0xd')];_0x19222d[_0x71af('0x3c')]=null;_0x19222d[_0x71af('0x3d')]=null;return _0x19222d[_0x71af('0x3e')]();});})[_0x71af('0xb')](function(){_0x1c016d[_0x71af('0x45')](0xc8)[_0x71af('0x46')]({'message':'Password\x20reset!'});})['catch'](function(_0x307626){return handleError(_0x1c016d,0x1f4,_0x307626);});};passport['use'](new LocalStrategy({'usernameField':_0x71af('0xc'),'passwordField':_0x71af('0xd')},function(_0x3ad616,_0x59133b,_0x54342d){return localAuthenticate(db[_0x71af('0x39')],_0x3ad616,_0x59133b,_0x54342d);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 0f60787..847ca61 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 _0xe4b3=['exports','express','Router','post','login','/forgot','/reset/:token'];(function(_0x38e642,_0x52c2af){var _0x4aaf6a=function(_0x151f78){while(--_0x151f78){_0x38e642['push'](_0x38e642['shift']());}};_0x4aaf6a(++_0x52c2af);}(_0xe4b3,0x12e));var _0x3e4b=function(_0x93d1ec,_0x5330a0){_0x93d1ec=_0x93d1ec-0x0;var _0x529f14=_0xe4b3[_0x93d1ec];return _0x529f14;};'use strict';var express=require(_0x3e4b('0x0'));var router=express[_0x3e4b('0x1')]();var controller=require('./authLocal.controller');router[_0x3e4b('0x2')]('/',controller[_0x3e4b('0x3')]);router['post'](_0x3e4b('0x4'),controller['forgot']);router[_0x3e4b('0x2')](_0x3e4b('0x5'),controller['reset']);module[_0x3e4b('0x6')]=router; \ No newline at end of file +var _0x2304=['exports','express','login','post','/forgot','/reset/:token','reset'];(function(_0x259dac,_0x33ac39){var _0x337b53=function(_0x9a138e){while(--_0x9a138e){_0x259dac['push'](_0x259dac['shift']());}};_0x337b53(++_0x33ac39);}(_0x2304,0x14a));var _0x4230=function(_0x4751b9,_0x4b62a1){_0x4751b9=_0x4751b9-0x0;var _0x4b2feb=_0x2304[_0x4751b9];return _0x4b2feb;};'use strict';var express=require(_0x4230('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller[_0x4230('0x1')]);router[_0x4230('0x2')](_0x4230('0x3'),controller['forgot']);router['post'](_0x4230('0x4'),controller[_0x4230('0x5')]);module[_0x4230('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index d1b9dd4..9cce9c3 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 _0x1654=['BOOLEAN','exports','STRING'];(function(_0x12ab01,_0x11195e){var _0x4d3917=function(_0x5c027c){while(--_0x5c027c){_0x12ab01['push'](_0x12ab01['shift']());}};_0x4d3917(++_0x11195e);}(_0x1654,0x94));var _0x4165=function(_0x3f36f9,_0x574d38){_0x3f36f9=_0x3f36f9-0x0;var _0x3dfbf7=_0x1654[_0x3f36f9];return _0x3dfbf7;};'use strict';var Sequelize=require('sequelize');module[_0x4165('0x0')]={'name':{'type':Sequelize[_0x4165('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x4165('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x74e7=['BOOLEAN','INTEGER','exports','STRING'];(function(_0x1958ae,_0x238fc7){var _0x4330cf=function(_0x56f70c){while(--_0x56f70c){_0x1958ae['push'](_0x1958ae['shift']());}};_0x4330cf(++_0x238fc7);}(_0x74e7,0x10a));var _0x774e=function(_0x2d0245,_0x2e30fa){_0x2d0245=_0x2d0245-0x0;var _0x336e42=_0x74e7[_0x2d0245];return _0x336e42;};'use strict';var Sequelize=require('sequelize');module[_0x774e('0x0')]={'name':{'type':Sequelize[_0x774e('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x774e('0x1')]},'description':{'type':Sequelize[_0x774e('0x1')]},'status':{'type':Sequelize[_0x774e('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x774e('0x3')],'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 2c3bac1..5655761 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 _0x8aec=['offset','undefined','limit','count','set','json','reject','save','update','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','Automation','then','include','findAll','catch','includeAll','find','create','params','body','Condition','addConditions','ids','omit','findOne','getConditions','addActions','getActions','Action','pick','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8aec,0x123));var _0xc8ae=function(_0x5809e8,_0x565f30){_0x5809e8=_0x5809e8-0x0;var _0x194390=_0x8aec[_0x5809e8];return _0x194390;};'use strict';var emlformat=require(_0xc8ae('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc8ae('0x1'));var moment=require(_0xc8ae('0x2'));var BPromise=require(_0xc8ae('0x3'));var Mustache=require(_0xc8ae('0x4'));var util=require(_0xc8ae('0x5'));var path=require(_0xc8ae('0x6'));var sox=require(_0xc8ae('0x7'));var csv=require(_0xc8ae('0x8'));var ejs=require(_0xc8ae('0x9'));var fs=require('fs');var fs_extra=require(_0xc8ae('0xa'));var _=require(_0xc8ae('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc8ae('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc8ae('0x8'));var querystring=require(_0xc8ae('0xd'));var Papa=require('papaparse');var Redis=require(_0xc8ae('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(_0xc8ae('0xf'))('api');var utils=require('../../config/utils');var config=require(_0xc8ae('0x10'));var licenseUtil=require(_0xc8ae('0x11'));var db=require(_0xc8ae('0x12'))['db'];function respondWithStatusCode(_0x456f75,_0x24cab0){_0x24cab0=_0x24cab0||0xcc;return function(_0x148a8c){if(_0x148a8c){return _0x456f75[_0xc8ae('0x13')](_0x24cab0);}return _0x456f75[_0xc8ae('0x14')](_0x24cab0)['end']();};}function respondWithResult(_0x103e99,_0xac4c45){_0xac4c45=_0xac4c45||0xc8;return function(_0x3bf862){if(_0x3bf862){return _0x103e99[_0xc8ae('0x14')](_0xac4c45)['json'](_0x3bf862);}};}function respondWithFilteredResult(_0x219538,_0x40e10f){return function(_0x1aad4a){if(_0x1aad4a){var _0x5ce4e3=typeof _0x40e10f[_0xc8ae('0x15')]===_0xc8ae('0x16')&&typeof _0x40e10f[_0xc8ae('0x17')]==='undefined';var _0x545633=_0x1aad4a[_0xc8ae('0x18')];var _0x33f682=_0x5ce4e3?0x0:_0x40e10f[_0xc8ae('0x15')];var _0x25da97=_0x5ce4e3?_0x1aad4a['count']:_0x40e10f[_0xc8ae('0x15')]+_0x40e10f[_0xc8ae('0x17')];var _0x415949;if(_0x25da97>=_0x545633){_0x25da97=_0x545633;_0x415949=0xc8;}else{_0x415949=0xce;}_0x219538['status'](_0x415949);return _0x219538[_0xc8ae('0x19')]('Content-Range',_0x33f682+'-'+_0x25da97+'/'+_0x545633)[_0xc8ae('0x1a')](_0x1aad4a);}return null;};}function patchUpdates(_0x37c746){return function(_0x578fea){try{jsonpatch['apply'](_0x578fea,_0x37c746,!![]);}catch(_0x212873){return BPromise[_0xc8ae('0x1b')](_0x212873);}return _0x578fea[_0xc8ae('0x1c')]();};}function saveUpdates(_0x4933f5,_0x3e0c69){return function(_0x1fae76){if(_0x1fae76){return _0x1fae76[_0xc8ae('0x1d')](_0x4933f5)['then'](function(_0xb96c8a){return _0xb96c8a;});}return null;};}function removeEntity(_0x5c7fa8,_0x1c34b4){return function(_0x551a08){if(_0x551a08){return _0x551a08[_0xc8ae('0x1e')]()['then'](function(){_0x5c7fa8[_0xc8ae('0x14')](0xcc)[_0xc8ae('0x1f')]();});}};}function handleEntityNotFound(_0x295fef,_0x45e3f9){return function(_0x4c6070){if(!_0x4c6070){_0x295fef['sendStatus'](0x194);}return _0x4c6070;};}function handleError(_0x5954a2,_0x1965e2){_0x1965e2=_0x1965e2||0x1f4;return function(_0x4d0908){logger[_0xc8ae('0x20')](_0x4d0908[_0xc8ae('0x21')]);if(_0x4d0908[_0xc8ae('0x22')]){delete _0x4d0908[_0xc8ae('0x22')];}_0x5954a2[_0xc8ae('0x14')](_0x1965e2)['send'](_0x4d0908);};}exports[_0xc8ae('0x23')]=function(_0xb4a752,_0x331b8d){var _0x5f0a96={},_0x377cb8={},_0x12630d={'count':0x0,'rows':[]};var _0x12e135=_[_0xc8ae('0x24')](db['Automation'][_0xc8ae('0x25')],function(_0x3f8190){return{'name':_0x3f8190[_0xc8ae('0x26')],'type':_0x3f8190[_0xc8ae('0x27')][_0xc8ae('0x28')]};});_0x377cb8['model']=_[_0xc8ae('0x24')](_0x12e135,_0xc8ae('0x22'));_0x377cb8[_0xc8ae('0x29')]=_[_0xc8ae('0x2a')](_0xb4a752['query']);_0x377cb8['filters']=_[_0xc8ae('0x2b')](_0x377cb8[_0xc8ae('0x2c')],_0x377cb8[_0xc8ae('0x29')]);_0x5f0a96[_0xc8ae('0x2d')]=_[_0xc8ae('0x2b')](_0x377cb8['model'],qs[_0xc8ae('0x2e')](_0xb4a752[_0xc8ae('0x29')][_0xc8ae('0x2e')]));_0x5f0a96[_0xc8ae('0x2d')]=_0x5f0a96[_0xc8ae('0x2d')][_0xc8ae('0x2f')]?_0x5f0a96[_0xc8ae('0x2d')]:_0x377cb8[_0xc8ae('0x2c')];if(!_0xb4a752[_0xc8ae('0x29')][_0xc8ae('0x30')](_0xc8ae('0x31'))){_0x5f0a96[_0xc8ae('0x17')]=qs[_0xc8ae('0x17')](_0xb4a752[_0xc8ae('0x29')]['limit']);_0x5f0a96['offset']=qs[_0xc8ae('0x15')](_0xb4a752[_0xc8ae('0x29')][_0xc8ae('0x15')]);}_0x5f0a96[_0xc8ae('0x32')]=qs['sort'](_0xb4a752[_0xc8ae('0x29')][_0xc8ae('0x33')]);_0x5f0a96[_0xc8ae('0x34')]=qs[_0xc8ae('0x35')](_['pick'](_0xb4a752['query'],_0x377cb8[_0xc8ae('0x35')]),_0x12e135);if(_0xb4a752['query'][_0xc8ae('0x36')]){_0x5f0a96[_0xc8ae('0x34')]=_[_0xc8ae('0x37')](_0x5f0a96[_0xc8ae('0x34')],{'$or':_[_0xc8ae('0x24')](_0x12e135,function(_0x50613a){if(_0x50613a[_0xc8ae('0x27')]!==_0xc8ae('0x38')){var _0x2bb37f={};_0x2bb37f[_0x50613a['name']]={'$like':'%'+_0xb4a752[_0xc8ae('0x29')][_0xc8ae('0x36')]+'%'};return _0x2bb37f;}})});}_0x5f0a96=_[_0xc8ae('0x37')]({},_0x5f0a96,_0xb4a752[_0xc8ae('0x39')]);var _0x1167a2={'where':_0x5f0a96[_0xc8ae('0x34')]};return db[_0xc8ae('0x3a')][_0xc8ae('0x18')](_0x1167a2)[_0xc8ae('0x3b')](function(_0x49b420){_0x12630d[_0xc8ae('0x18')]=_0x49b420;if(_0xb4a752['query']['includeAll']){_0x5f0a96[_0xc8ae('0x3c')]=[{'all':!![]}];}return db[_0xc8ae('0x3a')][_0xc8ae('0x3d')](_0x5f0a96);})[_0xc8ae('0x3b')](function(_0x28e5f9){_0x12630d['rows']=_0x28e5f9;return _0x12630d;})['then'](respondWithFilteredResult(_0x331b8d,_0x5f0a96))[_0xc8ae('0x3e')](handleError(_0x331b8d,null));};exports['show']=function(_0x4cde20,_0x245bd4){var _0x47739e={'raw':![],'where':{'id':_0x4cde20['params']['id']}},_0x56d0e0={};_0x56d0e0['model']=_[_0xc8ae('0x2a')](db[_0xc8ae('0x3a')][_0xc8ae('0x25')]);_0x56d0e0[_0xc8ae('0x29')]=_['keys'](_0x4cde20[_0xc8ae('0x29')]);_0x56d0e0['filters']=_[_0xc8ae('0x2b')](_0x56d0e0[_0xc8ae('0x2c')],_0x56d0e0[_0xc8ae('0x29')]);_0x47739e[_0xc8ae('0x2d')]=_[_0xc8ae('0x2b')](_0x56d0e0[_0xc8ae('0x2c')],qs[_0xc8ae('0x2e')](_0x4cde20['query'][_0xc8ae('0x2e')]));_0x47739e[_0xc8ae('0x2d')]=_0x47739e[_0xc8ae('0x2d')][_0xc8ae('0x2f')]?_0x47739e[_0xc8ae('0x2d')]:_0x56d0e0[_0xc8ae('0x2c')];if(_0x4cde20[_0xc8ae('0x29')][_0xc8ae('0x3f')]){_0x47739e['include']=[{'all':!![]}];}_0x47739e=_[_0xc8ae('0x37')]({},_0x47739e,_0x4cde20['options']);return db['Automation'][_0xc8ae('0x40')](_0x47739e)[_0xc8ae('0x3b')](handleEntityNotFound(_0x245bd4,null))['then'](respondWithResult(_0x245bd4,null))[_0xc8ae('0x3e')](handleError(_0x245bd4,null));};exports[_0xc8ae('0x41')]=function(_0x3ba8ae,_0x2e14f5){return db[_0xc8ae('0x3a')][_0xc8ae('0x41')](_0x3ba8ae['body'],{})[_0xc8ae('0x3b')](respondWithResult(_0x2e14f5,0xc9))[_0xc8ae('0x3e')](handleError(_0x2e14f5,null));};exports[_0xc8ae('0x1d')]=function(_0x53f194,_0x105a81){if(_0x53f194['body']['id']){delete _0x53f194['body']['id'];}return db[_0xc8ae('0x3a')]['find']({'where':{'id':_0x53f194[_0xc8ae('0x42')]['id']}})[_0xc8ae('0x3b')](handleEntityNotFound(_0x105a81,null))[_0xc8ae('0x3b')](saveUpdates(_0x53f194[_0xc8ae('0x43')],null))[_0xc8ae('0x3b')](respondWithResult(_0x105a81,null))[_0xc8ae('0x3e')](handleError(_0x105a81,null));};exports[_0xc8ae('0x1e')]=function(_0xd60554,_0x4cbd96){return db[_0xc8ae('0x3a')][_0xc8ae('0x40')]({'where':{'id':_0xd60554[_0xc8ae('0x42')]['id']}})['then'](handleEntityNotFound(_0x4cbd96,null))[_0xc8ae('0x3b')](removeEntity(_0x4cbd96,null))[_0xc8ae('0x3e')](handleError(_0x4cbd96,null));};exports['addConditions']=function(_0x21036e,_0x187530,_0x4e2c9d){return db[_0xc8ae('0x44')][_0xc8ae('0x40')]({'where':{'id':_0x21036e[_0xc8ae('0x42')]['id']}})[_0xc8ae('0x3b')](handleEntityNotFound(_0x187530,null))[_0xc8ae('0x3b')](function(_0x13fee3){if(_0x13fee3){return _0x13fee3[_0xc8ae('0x45')](_0x21036e[_0xc8ae('0x43')][_0xc8ae('0x46')],_[_0xc8ae('0x47')](_0x21036e['body'],[_0xc8ae('0x46'),'id'])||{});}})[_0xc8ae('0x3b')](respondWithResult(_0x187530,null))[_0xc8ae('0x3e')](handleError(_0x187530,null));};exports['getConditions']=function(_0x3e3c56,_0x362c33,_0x17e1ae){var _0x48e813={};var _0x318fd1={};var _0x1cd057;var _0x2fb4d6;return db[_0xc8ae('0x3a')][_0xc8ae('0x48')]({'where':{'id':_0x3e3c56[_0xc8ae('0x42')]['id']}})['then'](handleEntityNotFound(_0x362c33,null))[_0xc8ae('0x3b')](function(_0x360b09){if(_0x360b09){_0x1cd057=_0x360b09;_0x318fd1[_0xc8ae('0x2c')]=_[_0xc8ae('0x2a')](db[_0xc8ae('0x44')]['rawAttributes']);_0x318fd1['query']=_[_0xc8ae('0x2a')](_0x3e3c56[_0xc8ae('0x29')]);_0x318fd1['filters']=_[_0xc8ae('0x2b')](_0x318fd1[_0xc8ae('0x2c')],_0x318fd1[_0xc8ae('0x29')]);_0x48e813['attributes']=_[_0xc8ae('0x2b')](_0x318fd1[_0xc8ae('0x2c')],qs[_0xc8ae('0x2e')](_0x3e3c56[_0xc8ae('0x29')][_0xc8ae('0x2e')]));_0x48e813['attributes']=_0x48e813[_0xc8ae('0x2d')][_0xc8ae('0x2f')]?_0x48e813['attributes']:_0x318fd1['model'];_0x48e813['order']=qs[_0xc8ae('0x33')](_0x3e3c56['query'][_0xc8ae('0x33')]);_0x48e813['where']=qs[_0xc8ae('0x35')](_['pick'](_0x3e3c56[_0xc8ae('0x29')],_0x318fd1[_0xc8ae('0x35')]));if(_0x3e3c56['query'][_0xc8ae('0x36')]){_0x48e813['where']=_[_0xc8ae('0x37')](_0x48e813[_0xc8ae('0x34')],{'$or':_['map'](_0x48e813[_0xc8ae('0x2d')],function(_0x51b0ee){var _0xac11f2={};_0xac11f2[_0x51b0ee]={'$like':'%'+_0x3e3c56[_0xc8ae('0x29')][_0xc8ae('0x36')]+'%'};return _0xac11f2;})});}_0x48e813=_[_0xc8ae('0x37')]({},_0x48e813,_0x3e3c56[_0xc8ae('0x39')]);return _0x1cd057[_0xc8ae('0x49')](_0x48e813);}})[_0xc8ae('0x3b')](function(_0x51d371){if(_0x51d371){_0x2fb4d6=_0x51d371[_0xc8ae('0x2f')];if(!_0x3e3c56[_0xc8ae('0x29')][_0xc8ae('0x30')](_0xc8ae('0x31'))){_0x48e813[_0xc8ae('0x17')]=qs[_0xc8ae('0x17')](_0x3e3c56[_0xc8ae('0x29')][_0xc8ae('0x17')]);_0x48e813[_0xc8ae('0x15')]=qs[_0xc8ae('0x15')](_0x3e3c56[_0xc8ae('0x29')]['offset']);}return _0x1cd057['getConditions'](_0x48e813);}})[_0xc8ae('0x3b')](function(_0x41f60e){if(_0x41f60e){return _0x41f60e?{'count':_0x2fb4d6,'rows':_0x41f60e}:null;}})[_0xc8ae('0x3b')](respondWithResult(_0x362c33,null))[_0xc8ae('0x3e')](handleError(_0x362c33,null));};exports[_0xc8ae('0x4a')]=function(_0x2ec5f6,_0x2a6732,_0x1d98d7){return db['Action'][_0xc8ae('0x40')]({'where':{'id':_0x2ec5f6['params']['id']}})[_0xc8ae('0x3b')](handleEntityNotFound(_0x2a6732,null))[_0xc8ae('0x3b')](function(_0x501579){if(_0x501579){return _0x501579['addActions'](_0x2ec5f6[_0xc8ae('0x43')]['ids'],_[_0xc8ae('0x47')](_0x2ec5f6[_0xc8ae('0x43')],[_0xc8ae('0x46'),'id'])||{});}})['then'](respondWithResult(_0x2a6732,null))[_0xc8ae('0x3e')](handleError(_0x2a6732,null));};exports[_0xc8ae('0x4b')]=function(_0x131ad5,_0x5291ad,_0x36812d){var _0x324b95={};var _0x45bab0={};var _0x229bfd;var _0x2b5453;return db[_0xc8ae('0x3a')][_0xc8ae('0x48')]({'where':{'id':_0x131ad5[_0xc8ae('0x42')]['id']}})['then'](handleEntityNotFound(_0x5291ad,null))[_0xc8ae('0x3b')](function(_0x137d3a){if(_0x137d3a){_0x229bfd=_0x137d3a;_0x45bab0[_0xc8ae('0x2c')]=_[_0xc8ae('0x2a')](db[_0xc8ae('0x4c')][_0xc8ae('0x25')]);_0x45bab0[_0xc8ae('0x29')]=_[_0xc8ae('0x2a')](_0x131ad5['query']);_0x45bab0[_0xc8ae('0x35')]=_[_0xc8ae('0x2b')](_0x45bab0['model'],_0x45bab0[_0xc8ae('0x29')]);_0x324b95[_0xc8ae('0x2d')]=_['intersection'](_0x45bab0[_0xc8ae('0x2c')],qs[_0xc8ae('0x2e')](_0x131ad5[_0xc8ae('0x29')]['fields']));_0x324b95[_0xc8ae('0x2d')]=_0x324b95['attributes'][_0xc8ae('0x2f')]?_0x324b95[_0xc8ae('0x2d')]:_0x45bab0[_0xc8ae('0x2c')];_0x324b95[_0xc8ae('0x32')]=qs[_0xc8ae('0x33')](_0x131ad5[_0xc8ae('0x29')][_0xc8ae('0x33')]);_0x324b95[_0xc8ae('0x34')]=qs[_0xc8ae('0x35')](_[_0xc8ae('0x4d')](_0x131ad5[_0xc8ae('0x29')],_0x45bab0[_0xc8ae('0x35')]));if(_0x131ad5['query'][_0xc8ae('0x36')]){_0x324b95[_0xc8ae('0x34')]=_[_0xc8ae('0x37')](_0x324b95[_0xc8ae('0x34')],{'$or':_['map'](_0x324b95[_0xc8ae('0x2d')],function(_0x47793c){var _0x487ef9={};_0x487ef9[_0x47793c]={'$like':'%'+_0x131ad5[_0xc8ae('0x29')]['filter']+'%'};return _0x487ef9;})});}_0x324b95=_[_0xc8ae('0x37')]({},_0x324b95,_0x131ad5['options']);return _0x229bfd[_0xc8ae('0x4b')](_0x324b95);}})['then'](function(_0x4f1f64){if(_0x4f1f64){_0x2b5453=_0x4f1f64[_0xc8ae('0x2f')];if(!_0x131ad5[_0xc8ae('0x29')][_0xc8ae('0x30')](_0xc8ae('0x31'))){_0x324b95['limit']=qs[_0xc8ae('0x17')](_0x131ad5[_0xc8ae('0x29')][_0xc8ae('0x17')]);_0x324b95[_0xc8ae('0x15')]=qs[_0xc8ae('0x15')](_0x131ad5[_0xc8ae('0x29')][_0xc8ae('0x15')]);}return _0x229bfd[_0xc8ae('0x4b')](_0x324b95);}})[_0xc8ae('0x3b')](function(_0x595c99){if(_0x595c99){return _0x595c99?{'count':_0x2b5453,'rows':_0x595c99}:null;}})[_0xc8ae('0x3b')](respondWithResult(_0x5291ad,null))[_0xc8ae('0x3e')](handleError(_0x5291ad,null));}; \ No newline at end of file +var _0xa31a=['include','findAll','rows','catch','params','includeAll','options','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','reject','save','update','then','destroy','stack','send','map','Automation','rawAttributes','fieldName','type','key','model','name','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter'];(function(_0x339ee2,_0x2b27ae){var _0x2984f5=function(_0x9f4e5b){while(--_0x9f4e5b){_0x339ee2['push'](_0x339ee2['shift']());}};_0x2984f5(++_0x2b27ae);}(_0xa31a,0x69));var _0xaa31=function(_0xb1c4a4,_0x70fbdc){_0xb1c4a4=_0xb1c4a4-0x0;var _0x4ea691=_0xa31a[_0xb1c4a4];return _0x4ea691;};'use strict';var emlformat=require(_0xaa31('0x0'));var rimraf=require(_0xaa31('0x1'));var zipdir=require(_0xaa31('0x2'));var jsonpatch=require(_0xaa31('0x3'));var rp=require(_0xaa31('0x4'));var moment=require(_0xaa31('0x5'));var BPromise=require(_0xaa31('0x6'));var Mustache=require(_0xaa31('0x7'));var util=require(_0xaa31('0x8'));var path=require(_0xaa31('0x9'));var sox=require(_0xaa31('0xa'));var csv=require(_0xaa31('0xb'));var ejs=require(_0xaa31('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa31('0xd'));var squel=require(_0xaa31('0xe'));var crypto=require('crypto');var jsforce=require(_0xaa31('0xf'));var deskjs=require(_0xaa31('0x10'));var toCsv=require(_0xaa31('0xb'));var querystring=require(_0xaa31('0x11'));var Papa=require(_0xaa31('0x12'));var Redis=require(_0xaa31('0x13'));var authService=require(_0xaa31('0x14'));var qs=require(_0xaa31('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa31('0x16'));var logger=require(_0xaa31('0x17'))(_0xaa31('0x18'));var utils=require(_0xaa31('0x19'));var config=require(_0xaa31('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xaa31('0x1b'))['db'];function respondWithStatusCode(_0x12c90d,_0x258f91){_0x258f91=_0x258f91||0xcc;return function(_0x2758a5){if(_0x2758a5){return _0x12c90d[_0xaa31('0x1c')](_0x258f91);}return _0x12c90d[_0xaa31('0x1d')](_0x258f91)[_0xaa31('0x1e')]();};}function respondWithResult(_0x19807c,_0x8bab77){_0x8bab77=_0x8bab77||0xc8;return function(_0x59661d){if(_0x59661d){return _0x19807c[_0xaa31('0x1d')](_0x8bab77)[_0xaa31('0x1f')](_0x59661d);}};}function respondWithFilteredResult(_0x4bf594,_0x26eaa8){return function(_0x403921){if(_0x403921){var _0x42803d=typeof _0x26eaa8[_0xaa31('0x20')]===_0xaa31('0x21')&&typeof _0x26eaa8['limit']===_0xaa31('0x21');var _0x3bb4de=_0x403921[_0xaa31('0x22')];var _0x316c4c=_0x42803d?0x0:_0x26eaa8['offset'];var _0x52e5ab=_0x42803d?_0x403921[_0xaa31('0x22')]:_0x26eaa8['offset']+_0x26eaa8[_0xaa31('0x23')];var _0x3c56c9;if(_0x52e5ab>=_0x3bb4de){_0x52e5ab=_0x3bb4de;_0x3c56c9=0xc8;}else{_0x3c56c9=0xce;}_0x4bf594[_0xaa31('0x1d')](_0x3c56c9);return _0x4bf594['set']('Content-Range',_0x316c4c+'-'+_0x52e5ab+'/'+_0x3bb4de)['json'](_0x403921);}return null;};}function patchUpdates(_0x5ebd63){return function(_0x425ff0){try{jsonpatch['apply'](_0x425ff0,_0x5ebd63,!![]);}catch(_0x4cd4b6){return BPromise[_0xaa31('0x24')](_0x4cd4b6);}return _0x425ff0[_0xaa31('0x25')]();};}function saveUpdates(_0x196e0f,_0x43d570){return function(_0x823f0e){if(_0x823f0e){return _0x823f0e[_0xaa31('0x26')](_0x196e0f)[_0xaa31('0x27')](function(_0x1a5b30){return _0x1a5b30;});}return null;};}function removeEntity(_0x1b9114,_0x4eda87){return function(_0x19158b){if(_0x19158b){return _0x19158b[_0xaa31('0x28')]()['then'](function(){_0x1b9114[_0xaa31('0x1d')](0xcc)[_0xaa31('0x1e')]();});}};}function handleEntityNotFound(_0x43c90e,_0x5fb171){return function(_0x98e674){if(!_0x98e674){_0x43c90e['sendStatus'](0x194);}return _0x98e674;};}function handleError(_0x27f583,_0x2c42a4){_0x2c42a4=_0x2c42a4||0x1f4;return function(_0x15c269){logger['error'](_0x15c269[_0xaa31('0x29')]);if(_0x15c269['name']){delete _0x15c269['name'];}_0x27f583[_0xaa31('0x1d')](_0x2c42a4)[_0xaa31('0x2a')](_0x15c269);};}exports['index']=function(_0xd9bcb5,_0x43413b){var _0x22704e={},_0x429498={},_0x3d41cb={'count':0x0,'rows':[]};var _0x283152=_[_0xaa31('0x2b')](db[_0xaa31('0x2c')][_0xaa31('0x2d')],function(_0x2a1a96){return{'name':_0x2a1a96[_0xaa31('0x2e')],'type':_0x2a1a96[_0xaa31('0x2f')][_0xaa31('0x30')]};});_0x429498[_0xaa31('0x31')]=_[_0xaa31('0x2b')](_0x283152,_0xaa31('0x32'));_0x429498['query']=_[_0xaa31('0x33')](_0xd9bcb5['query']);_0x429498[_0xaa31('0x34')]=_[_0xaa31('0x35')](_0x429498[_0xaa31('0x31')],_0x429498['query']);_0x22704e[_0xaa31('0x36')]=_['intersection'](_0x429498[_0xaa31('0x31')],qs[_0xaa31('0x37')](_0xd9bcb5['query'][_0xaa31('0x37')]));_0x22704e[_0xaa31('0x36')]=_0x22704e[_0xaa31('0x36')][_0xaa31('0x38')]?_0x22704e[_0xaa31('0x36')]:_0x429498[_0xaa31('0x31')];if(!_0xd9bcb5[_0xaa31('0x39')][_0xaa31('0x3a')](_0xaa31('0x3b'))){_0x22704e[_0xaa31('0x23')]=qs[_0xaa31('0x23')](_0xd9bcb5[_0xaa31('0x39')][_0xaa31('0x23')]);_0x22704e['offset']=qs[_0xaa31('0x20')](_0xd9bcb5[_0xaa31('0x39')]['offset']);}_0x22704e[_0xaa31('0x3c')]=qs[_0xaa31('0x3d')](_0xd9bcb5[_0xaa31('0x39')][_0xaa31('0x3d')]);_0x22704e[_0xaa31('0x3e')]=qs['filters'](_[_0xaa31('0x3f')](_0xd9bcb5['query'],_0x429498[_0xaa31('0x34')]),_0x283152);if(_0xd9bcb5['query']['filter']){_0x22704e[_0xaa31('0x3e')]=_[_0xaa31('0x40')](_0x22704e[_0xaa31('0x3e')],{'$or':_['map'](_0x283152,function(_0x4a9866){if(_0x4a9866['type']!==_0xaa31('0x41')){var _0x52f264={};_0x52f264[_0x4a9866['name']]={'$like':'%'+_0xd9bcb5['query'][_0xaa31('0x42')]+'%'};return _0x52f264;}})});}_0x22704e=_['merge']({},_0x22704e,_0xd9bcb5['options']);var _0x23c9a4={'where':_0x22704e[_0xaa31('0x3e')]};return db[_0xaa31('0x2c')][_0xaa31('0x22')](_0x23c9a4)[_0xaa31('0x27')](function(_0x8bced8){_0x3d41cb[_0xaa31('0x22')]=_0x8bced8;if(_0xd9bcb5[_0xaa31('0x39')]['includeAll']){_0x22704e[_0xaa31('0x43')]=[{'all':!![]}];}return db['Automation'][_0xaa31('0x44')](_0x22704e);})[_0xaa31('0x27')](function(_0x1f618b){_0x3d41cb[_0xaa31('0x45')]=_0x1f618b;return _0x3d41cb;})[_0xaa31('0x27')](respondWithFilteredResult(_0x43413b,_0x22704e))[_0xaa31('0x46')](handleError(_0x43413b,null));};exports['show']=function(_0x2bae1a,_0x2cd6b9){var _0x1cd9bd={'raw':![],'where':{'id':_0x2bae1a[_0xaa31('0x47')]['id']}},_0x1d99d2={};_0x1d99d2[_0xaa31('0x31')]=_[_0xaa31('0x33')](db[_0xaa31('0x2c')][_0xaa31('0x2d')]);_0x1d99d2[_0xaa31('0x39')]=_[_0xaa31('0x33')](_0x2bae1a[_0xaa31('0x39')]);_0x1d99d2[_0xaa31('0x34')]=_[_0xaa31('0x35')](_0x1d99d2[_0xaa31('0x31')],_0x1d99d2[_0xaa31('0x39')]);_0x1cd9bd['attributes']=_[_0xaa31('0x35')](_0x1d99d2[_0xaa31('0x31')],qs[_0xaa31('0x37')](_0x2bae1a[_0xaa31('0x39')][_0xaa31('0x37')]));_0x1cd9bd[_0xaa31('0x36')]=_0x1cd9bd[_0xaa31('0x36')][_0xaa31('0x38')]?_0x1cd9bd[_0xaa31('0x36')]:_0x1d99d2['model'];if(_0x2bae1a[_0xaa31('0x39')][_0xaa31('0x48')]){_0x1cd9bd[_0xaa31('0x43')]=[{'all':!![]}];}_0x1cd9bd=_[_0xaa31('0x40')]({},_0x1cd9bd,_0x2bae1a[_0xaa31('0x49')]);return db[_0xaa31('0x2c')][_0xaa31('0x4a')](_0x1cd9bd)[_0xaa31('0x27')](handleEntityNotFound(_0x2cd6b9,null))[_0xaa31('0x27')](respondWithResult(_0x2cd6b9,null))['catch'](handleError(_0x2cd6b9,null));};exports[_0xaa31('0x4b')]=function(_0x34afd3,_0x422cff){return db[_0xaa31('0x2c')][_0xaa31('0x4b')](_0x34afd3[_0xaa31('0x4c')],{})['then'](respondWithResult(_0x422cff,0xc9))[_0xaa31('0x46')](handleError(_0x422cff,null));};exports['update']=function(_0x3b0e0e,_0x20cf52){if(_0x3b0e0e['body']['id']){delete _0x3b0e0e['body']['id'];}return db[_0xaa31('0x2c')][_0xaa31('0x4a')]({'where':{'id':_0x3b0e0e['params']['id']}})[_0xaa31('0x27')](handleEntityNotFound(_0x20cf52,null))[_0xaa31('0x27')](saveUpdates(_0x3b0e0e[_0xaa31('0x4c')],null))[_0xaa31('0x27')](respondWithResult(_0x20cf52,null))[_0xaa31('0x46')](handleError(_0x20cf52,null));};exports[_0xaa31('0x28')]=function(_0x3fbb90,_0x4d0d69){return db[_0xaa31('0x2c')][_0xaa31('0x4a')]({'where':{'id':_0x3fbb90[_0xaa31('0x47')]['id']}})[_0xaa31('0x27')](handleEntityNotFound(_0x4d0d69,null))[_0xaa31('0x27')](removeEntity(_0x4d0d69,null))[_0xaa31('0x46')](handleError(_0x4d0d69,null));};exports[_0xaa31('0x4d')]=function(_0x1ad617,_0x570d07,_0x318b2f){return db[_0xaa31('0x4e')][_0xaa31('0x4a')]({'where':{'id':_0x1ad617[_0xaa31('0x47')]['id']}})[_0xaa31('0x27')](handleEntityNotFound(_0x570d07,null))[_0xaa31('0x27')](function(_0x336fe5){if(_0x336fe5){return _0x336fe5[_0xaa31('0x4d')](_0x1ad617[_0xaa31('0x4c')][_0xaa31('0x4f')],_[_0xaa31('0x50')](_0x1ad617[_0xaa31('0x4c')],[_0xaa31('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x570d07,null))[_0xaa31('0x46')](handleError(_0x570d07,null));};exports[_0xaa31('0x51')]=function(_0x4253c3,_0x3e6a46,_0x45afd4){var _0x755270={};var _0x197946={};var _0x352cc9;var _0x1afd45;return db[_0xaa31('0x2c')][_0xaa31('0x52')]({'where':{'id':_0x4253c3[_0xaa31('0x47')]['id']}})[_0xaa31('0x27')](handleEntityNotFound(_0x3e6a46,null))['then'](function(_0x2f8594){if(_0x2f8594){_0x352cc9=_0x2f8594;_0x197946[_0xaa31('0x31')]=_[_0xaa31('0x33')](db['Condition'][_0xaa31('0x2d')]);_0x197946[_0xaa31('0x39')]=_['keys'](_0x4253c3['query']);_0x197946['filters']=_['intersection'](_0x197946[_0xaa31('0x31')],_0x197946[_0xaa31('0x39')]);_0x755270['attributes']=_[_0xaa31('0x35')](_0x197946[_0xaa31('0x31')],qs[_0xaa31('0x37')](_0x4253c3['query'][_0xaa31('0x37')]));_0x755270[_0xaa31('0x36')]=_0x755270[_0xaa31('0x36')][_0xaa31('0x38')]?_0x755270['attributes']:_0x197946[_0xaa31('0x31')];_0x755270[_0xaa31('0x3c')]=qs[_0xaa31('0x3d')](_0x4253c3[_0xaa31('0x39')]['sort']);_0x755270[_0xaa31('0x3e')]=qs['filters'](_[_0xaa31('0x3f')](_0x4253c3['query'],_0x197946[_0xaa31('0x34')]));if(_0x4253c3['query'][_0xaa31('0x42')]){_0x755270['where']=_[_0xaa31('0x40')](_0x755270[_0xaa31('0x3e')],{'$or':_[_0xaa31('0x2b')](_0x755270[_0xaa31('0x36')],function(_0xea2d49){var _0x5d7282={};_0x5d7282[_0xea2d49]={'$like':'%'+_0x4253c3[_0xaa31('0x39')][_0xaa31('0x42')]+'%'};return _0x5d7282;})});}_0x755270=_[_0xaa31('0x40')]({},_0x755270,_0x4253c3['options']);return _0x352cc9[_0xaa31('0x51')](_0x755270);}})[_0xaa31('0x27')](function(_0x25e259){if(_0x25e259){_0x1afd45=_0x25e259[_0xaa31('0x38')];if(!_0x4253c3['query'][_0xaa31('0x3a')]('nolimit')){_0x755270['limit']=qs['limit'](_0x4253c3[_0xaa31('0x39')][_0xaa31('0x23')]);_0x755270[_0xaa31('0x20')]=qs[_0xaa31('0x20')](_0x4253c3[_0xaa31('0x39')]['offset']);}return _0x352cc9[_0xaa31('0x51')](_0x755270);}})[_0xaa31('0x27')](function(_0x3df788){if(_0x3df788){return _0x3df788?{'count':_0x1afd45,'rows':_0x3df788}:null;}})['then'](respondWithResult(_0x3e6a46,null))[_0xaa31('0x46')](handleError(_0x3e6a46,null));};exports[_0xaa31('0x53')]=function(_0x415348,_0x4f51b1,_0x1b331b){return db[_0xaa31('0x54')][_0xaa31('0x4a')]({'where':{'id':_0x415348[_0xaa31('0x47')]['id']}})[_0xaa31('0x27')](handleEntityNotFound(_0x4f51b1,null))['then'](function(_0x5074d4){if(_0x5074d4){return _0x5074d4[_0xaa31('0x53')](_0x415348['body']['ids'],_['omit'](_0x415348['body'],[_0xaa31('0x4f'),'id'])||{});}})[_0xaa31('0x27')](respondWithResult(_0x4f51b1,null))['catch'](handleError(_0x4f51b1,null));};exports['getActions']=function(_0x937470,_0x5b232e,_0xf2e33){var _0x443bfd={};var _0x2ff8ff={};var _0x55c0d4;var _0xffa62;return db['Automation'][_0xaa31('0x52')]({'where':{'id':_0x937470[_0xaa31('0x47')]['id']}})[_0xaa31('0x27')](handleEntityNotFound(_0x5b232e,null))[_0xaa31('0x27')](function(_0x22721b){if(_0x22721b){_0x55c0d4=_0x22721b;_0x2ff8ff[_0xaa31('0x31')]=_[_0xaa31('0x33')](db['Action'][_0xaa31('0x2d')]);_0x2ff8ff[_0xaa31('0x39')]=_[_0xaa31('0x33')](_0x937470[_0xaa31('0x39')]);_0x2ff8ff[_0xaa31('0x34')]=_[_0xaa31('0x35')](_0x2ff8ff[_0xaa31('0x31')],_0x2ff8ff[_0xaa31('0x39')]);_0x443bfd['attributes']=_[_0xaa31('0x35')](_0x2ff8ff[_0xaa31('0x31')],qs['fields'](_0x937470[_0xaa31('0x39')]['fields']));_0x443bfd[_0xaa31('0x36')]=_0x443bfd[_0xaa31('0x36')][_0xaa31('0x38')]?_0x443bfd[_0xaa31('0x36')]:_0x2ff8ff[_0xaa31('0x31')];_0x443bfd[_0xaa31('0x3c')]=qs[_0xaa31('0x3d')](_0x937470[_0xaa31('0x39')][_0xaa31('0x3d')]);_0x443bfd[_0xaa31('0x3e')]=qs[_0xaa31('0x34')](_[_0xaa31('0x3f')](_0x937470['query'],_0x2ff8ff[_0xaa31('0x34')]));if(_0x937470[_0xaa31('0x39')][_0xaa31('0x42')]){_0x443bfd[_0xaa31('0x3e')]=_[_0xaa31('0x40')](_0x443bfd[_0xaa31('0x3e')],{'$or':_[_0xaa31('0x2b')](_0x443bfd[_0xaa31('0x36')],function(_0x5549da){var _0x13ce9d={};_0x13ce9d[_0x5549da]={'$like':'%'+_0x937470['query'][_0xaa31('0x42')]+'%'};return _0x13ce9d;})});}_0x443bfd=_[_0xaa31('0x40')]({},_0x443bfd,_0x937470[_0xaa31('0x49')]);return _0x55c0d4[_0xaa31('0x55')](_0x443bfd);}})[_0xaa31('0x27')](function(_0x297e3a){if(_0x297e3a){_0xffa62=_0x297e3a[_0xaa31('0x38')];if(!_0x937470[_0xaa31('0x39')][_0xaa31('0x3a')](_0xaa31('0x3b'))){_0x443bfd[_0xaa31('0x23')]=qs['limit'](_0x937470['query'][_0xaa31('0x23')]);_0x443bfd[_0xaa31('0x20')]=qs[_0xaa31('0x20')](_0x937470[_0xaa31('0x39')][_0xaa31('0x20')]);}return _0x55c0d4[_0xaa31('0x55')](_0x443bfd);}})[_0xaa31('0x27')](function(_0xf0f5df){if(_0xf0f5df){return _0xf0f5df?{'count':_0xffa62,'rows':_0xf0f5df}:null;}})[_0xaa31('0x27')](respondWithResult(_0x5b232e,null))[_0xaa31('0x46')](handleError(_0x5b232e,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 6d26e55..8f31d00 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 _0xbe74=['lodash','util','api','moment','bluebird','request-promise','../../config/environment','./automation.attributes','exports','define','tools_automations'];(function(_0x14691c,_0xe1c878){var _0xbec98=function(_0x100b9e){while(--_0x100b9e){_0x14691c['push'](_0x14691c['shift']());}};_0xbec98(++_0xe1c878);}(_0xbe74,0x176));var _0x4be7=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xbe74[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x4be7('0x0'));var util=require(_0x4be7('0x1'));var logger=require('../../config/logger')(_0x4be7('0x2'));var moment=require(_0x4be7('0x3'));var BPromise=require(_0x4be7('0x4'));var rp=require(_0x4be7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4be7('0x6'));var attributes=require(_0x4be7('0x7'));module[_0x4be7('0x8')]=function(_0xe0d43,_0x515e0c){return _0xe0d43[_0x4be7('0x9')]('Automation',attributes,{'tableName':_0x4be7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11d7=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','define','Automation','tools_automations'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x11d7,0xd1));var _0x711d=function(_0x29733c,_0x2da30b){_0x29733c=_0x29733c-0x0;var _0x49e72f=_0x11d7[_0x29733c];return _0x49e72f;};'use strict';var _=require(_0x711d('0x0'));var util=require(_0x711d('0x1'));var logger=require('../../config/logger')(_0x711d('0x2'));var moment=require('moment');var BPromise=require(_0x711d('0x3'));var rp=require(_0x711d('0x4'));var fs=require('fs');var path=require(_0x711d('0x5'));var rimraf=require(_0x711d('0x6'));var config=require(_0x711d('0x7'));var attributes=require('./automation.attributes');module['exports']=function(_0xdf51c1,_0x57d1f5){return _0xdf51c1[_0x711d('0x8')](_0x711d('0x9'),attributes,{'tableName':_0x711d('0xa'),'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 e9168af..8354ae4 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 _0x07a2=['error','Automation,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','debug','stringify'];(function(_0x2ce160,_0x2a9ea0){var _0x30a9a4=function(_0xf8243f){while(--_0xf8243f){_0x2ce160['push'](_0x2ce160['shift']());}};_0x30a9a4(++_0x2a9ea0);}(_0x07a2,0x12c));var _0x207a=function(_0x5bd044,_0xafd5fa){_0x5bd044=_0x5bd044-0x0;var _0x582fd7=_0x07a2[_0x5bd044];return _0x582fd7;};'use strict';var _=require(_0x207a('0x0'));var util=require(_0x207a('0x1'));var moment=require('moment');var BPromise=require(_0x207a('0x2'));var rs=require(_0x207a('0x3'));var fs=require('fs');var Redis=require(_0x207a('0x4'));var db=require(_0x207a('0x5'))['db'];var utils=require(_0x207a('0x6'));var logger=require(_0x207a('0x7'))(_0x207a('0x8'));var config=require(_0x207a('0x9'));var jayson=require(_0x207a('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x18dddc,_0x15d085,_0x7be81c){return new BPromise(function(_0x2a0b70,_0x55412c){return client[_0x207a('0xb')](_0x18dddc,_0x7be81c)['then'](function(_0x5201fe){logger[_0x207a('0xc')]('Automation,\x20%s,\x20%s',_0x15d085,'request\x20sent');logger[_0x207a('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0x15d085,'request\x20sent',JSON[_0x207a('0xe')](_0x5201fe));if(_0x5201fe[_0x207a('0xf')]){if(_0x5201fe[_0x207a('0xf')]['code']===0x1f4){logger[_0x207a('0xf')](_0x207a('0x10'),_0x15d085,_0x5201fe[_0x207a('0xf')]['message']);return _0x55412c(_0x5201fe[_0x207a('0xf')][_0x207a('0x11')]);}logger[_0x207a('0xf')](_0x207a('0x10'),_0x15d085,_0x5201fe[_0x207a('0xf')]['message']);return _0x2a0b70(_0x5201fe[_0x207a('0xf')]['message']);}else{logger[_0x207a('0xc')](_0x207a('0x10'),_0x15d085,_0x207a('0x12'));_0x2a0b70(_0x5201fe[_0x207a('0x13')][_0x207a('0x11')]);}})[_0x207a('0x14')](function(_0xd60aa3){logger[_0x207a('0xf')](_0x207a('0x10'),_0x15d085,_0xd60aa3);_0x55412c(_0xd60aa3);});});} \ No newline at end of file +var _0x0f42=['rpc','../../config/environment','jayson/promise','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x443570,_0x5125dc){var _0x5f4e0d=function(_0x29b03b){while(--_0x29b03b){_0x443570['push'](_0x443570['shift']());}};_0x5f4e0d(++_0x5125dc);}(_0x0f42,0x126));var _0x20f4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0f42[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x20f4('0x0'));var util=require(_0x20f4('0x1'));var moment=require(_0x20f4('0x2'));var BPromise=require(_0x20f4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x20f4('0x5'));var logger=require('../../config/logger')(_0x20f4('0x6'));var config=require(_0x20f4('0x7'));var jayson=require(_0x20f4('0x8'));var client=jayson['client'][_0x20f4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1519fe,_0x525da0,_0x45adf6){return new BPromise(function(_0x553d5d,_0x4a452d){return client['request'](_0x1519fe,_0x45adf6)[_0x20f4('0xa')](function(_0x4f3d95){logger[_0x20f4('0xb')](_0x20f4('0xc'),_0x525da0,_0x20f4('0xd'));logger[_0x20f4('0xe')]('Automation,\x20%s,\x20%s,\x20%s',_0x525da0,_0x20f4('0xd'),JSON['stringify'](_0x4f3d95));if(_0x4f3d95[_0x20f4('0xf')]){if(_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x10')]===0x1f4){logger[_0x20f4('0xf')]('Automation,\x20%s,\x20%s',_0x525da0,_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x11')]);return _0x4a452d(_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x11')]);}logger[_0x20f4('0xf')](_0x20f4('0xc'),_0x525da0,_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x11')]);return _0x553d5d(_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x11')]);}else{logger[_0x20f4('0xb')]('Automation,\x20%s,\x20%s',_0x525da0,'request\x20sent');_0x553d5d(_0x4f3d95[_0x20f4('0x12')][_0x20f4('0x11')]);}})[_0x20f4('0x13')](function(_0x36fdc2){logger[_0x20f4('0xf')]('Automation,\x20%s,\x20%s',_0x525da0,_0x36fdc2);_0x4a452d(_0x36fdc2);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 924dd9e..44f995f 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 _0xfbdb=['destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','getConditions','getActions','post','/:id/conditions','addConditions','/:id/actions','delete'];(function(_0x2e15fe,_0x59d847){var _0x4bccce=function(_0x57aa97){while(--_0x57aa97){_0x2e15fe['push'](_0x2e15fe['shift']());}};_0x4bccce(++_0x59d847);}(_0xfbdb,0x1ba));var _0xbfbd=function(_0x5339b6,_0x4dfff8){_0x5339b6=_0x5339b6-0x0;var _0x5e3b04=_0xfbdb[_0x5339b6];return _0x5e3b04;};'use strict';var multer=require(_0xbfbd('0x0'));var util=require('util');var path=require(_0xbfbd('0x1'));var timeout=require('connect-timeout');var express=require(_0xbfbd('0x2'));var router=express[_0xbfbd('0x3')]();var fs_extra=require(_0xbfbd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbfbd('0x5'));var config=require(_0xbfbd('0x6'));var controller=require(_0xbfbd('0x7'));router[_0xbfbd('0x8')]('/',auth[_0xbfbd('0x9')](),controller[_0xbfbd('0xa')]);router[_0xbfbd('0x8')](_0xbfbd('0xb'),auth[_0xbfbd('0x9')](),controller[_0xbfbd('0xc')]);router[_0xbfbd('0x8')]('/:id/conditions',auth[_0xbfbd('0x9')](),controller[_0xbfbd('0xd')]);router[_0xbfbd('0x8')]('/:id/actions',auth[_0xbfbd('0x9')](),controller[_0xbfbd('0xe')]);router[_0xbfbd('0xf')]('/',auth[_0xbfbd('0x9')](),controller['create']);router['post'](_0xbfbd('0x10'),auth[_0xbfbd('0x9')](),controller[_0xbfbd('0x11')]);router[_0xbfbd('0xf')](_0xbfbd('0x12'),auth[_0xbfbd('0x9')](),controller['addActions']);router['put']('/:id',auth[_0xbfbd('0x9')](),controller['update']);router[_0xbfbd('0x13')](_0xbfbd('0xb'),auth['isAuthenticated'](),controller[_0xbfbd('0x14')]);module[_0xbfbd('0x15')]=router; \ No newline at end of file +var _0x4d9e=['../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','getActions','post','create','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service'];(function(_0x588777,_0xb115db){var _0x58746e=function(_0x2ec4bd){while(--_0x2ec4bd){_0x588777['push'](_0x588777['shift']());}};_0x58746e(++_0xb115db);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x39903f,_0x2b76ad){_0x39903f=_0x39903f-0x0;var _0x1c0074=_0x4d9e[_0x39903f];return _0x1c0074;};'use strict';var multer=require(_0xe4d9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe4d9('0x1'));var express=require('express');var router=express[_0xe4d9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe4d9('0x3'));var interaction=require(_0xe4d9('0x4'));var config=require('../../config/environment');var controller=require(_0xe4d9('0x5'));router[_0xe4d9('0x6')]('/',auth[_0xe4d9('0x7')](),controller[_0xe4d9('0x8')]);router[_0xe4d9('0x6')](_0xe4d9('0x9'),auth['isAuthenticated'](),controller[_0xe4d9('0xa')]);router[_0xe4d9('0x6')](_0xe4d9('0xb'),auth[_0xe4d9('0x7')](),controller[_0xe4d9('0xc')]);router[_0xe4d9('0x6')]('/:id/actions',auth[_0xe4d9('0x7')](),controller[_0xe4d9('0xd')]);router[_0xe4d9('0xe')]('/',auth[_0xe4d9('0x7')](),controller[_0xe4d9('0xf')]);router[_0xe4d9('0xe')](_0xe4d9('0xb'),auth['isAuthenticated'](),controller['addConditions']);router['post']('/:id/actions',auth['isAuthenticated'](),controller['addActions']);router['put']('/:id',auth[_0xe4d9('0x7')](),controller[_0xe4d9('0x10')]);router[_0xe4d9('0x11')]('/:id',auth[_0xe4d9('0x7')](),controller[_0xe4d9('0x12')]);module[_0xe4d9('0x13')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 935ef4b..f70b8ee 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 _0xffcc=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ENUM','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\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','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xffcc,0x147));var _0xcffc=function(_0x2d755d,_0x2fd0f5){_0x2d755d=_0x2d755d-0x0;var _0x323067=_0xffcc[_0x2d755d];return _0x323067;};'use strict';var Sequelize=require(_0xcffc('0x0'));module['exports']={'name':{'type':Sequelize[_0xcffc('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xcffc('0x2')](_0xcffc('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xcffc('0x4')],'defaultValue':0x0,'comment':_0xcffc('0x5')},'limitCalls':{'type':Sequelize[_0xcffc('0x6')](0x4)[_0xcffc('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xcffc('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xcffc('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xcffc('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcffc('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcffc('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xcffc('0x6')](0x5)[_0xcffc('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcffc('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xcffc('0x6')](0x3)[_0xcffc('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xcffc('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcffc('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xcffc('0x6')](0x3)[_0xcffc('0x7')],'defaultValue':0x3,'comment':_0xcffc('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xcffc('0x6')](0x5)[_0xcffc('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcffc('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xcffc('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xcffc('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xcffc('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xcffc('0xf'),_0xcffc('0x10'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xcffc('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xcffc('0x6')](0x9)[_0xcffc('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xcffc('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xcffc('0x6')](0x9)[_0xcffc('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xcffc('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xcffc('0x6')](0x9)[_0xcffc('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xcffc('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xcffc('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xcffc('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xcffc('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xcffc('0x6')](0x9)[_0xcffc('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xcffc('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xcffc('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xcffc('0x6')](0x5)[_0xcffc('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xcffc('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xcffc('0x6')](0x9)[_0xcffc('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xcffc('0x18')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xcffc('0x19'),_0xcffc('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xcffc('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xcffc('0x6')](0x3)[_0xcffc('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xcffc('0x1b')},'dialCutDigit':{'type':Sequelize[_0xcffc('0x6')](0x3)[_0xcffc('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xcffc('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xcffc('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xcffc('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xcffc('0x6')](0x5)[_0xcffc('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcffc('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xcffc('0x6')](0x3)[_0xcffc('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcffc('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xcffc('0x6')](0x5)[_0xcffc('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcffc('0x1f')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xcffc('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xcffc('0x6')](0x5)[_0xcffc('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcffc('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xcffc('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcffc('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xcffc('0x6')](0x5)[_0xcffc('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcffc('0x22')}}; \ No newline at end of file +var _0x8f96=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','ENUM','ivr','STRING','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','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\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8f96,0x1a3));var _0x68f9=function(_0x70221a,_0x150939){_0x70221a=_0x70221a-0x0;var _0xe703c4=_0x8f96[_0x70221a];return _0xe703c4;};'use strict';var Sequelize=require(_0x68f9('0x0'));module[_0x68f9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x68f9('0x2')]('ivr'),'allowNull':![],'defaultValue':_0x68f9('0x3')},'description':{'type':Sequelize[_0x68f9('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x68f9('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x68f9('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x68f9('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x68f9('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x68f9('0x7')](0x5)[_0x68f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x68f9('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x68f9('0x7')](0x5)[_0x68f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x68f9('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x68f9('0x7')](0x5)[_0x68f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x68f9('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x68f9('0xd')},'dialTimezone':{'type':Sequelize[_0x68f9('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x68f9('0x4')],'defaultValue':_0x68f9('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x68f9('0x2')](_0x68f9('0xf'),'never','onlyIfOpen'),'defaultValue':_0x68f9('0xf')},'dialAMDActive':{'type':Sequelize[_0x68f9('0x10')],'defaultValue':0x0,'comment':_0x68f9('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x68f9('0x7')](0x9)[_0x68f9('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x68f9('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x68f9('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x68f9('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x68f9('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x68f9('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x68f9('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x68f9('0x7')](0x9)[_0x68f9('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x68f9('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x68f9('0x7')](0x9)[_0x68f9('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x68f9('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x68f9('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x68f9('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x68f9('0x7')](0x9)[_0x68f9('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x68f9('0x2')]('DESC',_0x68f9('0x18')),'defaultValue':_0x68f9('0x19')},'dialPrefix':{'type':Sequelize[_0x68f9('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x68f9('0x1a')},'dialCutDigit':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x68f9('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x68f9('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x68f9('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x68f9('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x68f9('0x7')](0x5)[_0x68f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x68f9('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x68f9('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x68f9('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x68f9('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x68f9('0x7')](0x5)[_0x68f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x68f9('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x68f9('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x68f9('0x7')](0x5)[_0x68f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x68f9('0x25')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 9bebbc9..dcc9798 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 _0x6185=['destroy','get','IvrCampaigns','end','sendStatus','error','stack','send','Campaign','rawAttributes','fieldName','type','key','model','map','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','findOne','CmHopper','nolimit','getHopperHistories','CmHopperHistory','order','getHopperFinals','CmHopperFinal','CampaignId','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','field','NOW()','ContactId','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','ListId','COALESCE(phone,\x27\x27)','deletedAt\x20IS\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','zip-dir','request-promise','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then'];(function(_0x2c1aa8,_0x3e0609){var _0x4019f5=function(_0x916eac){while(--_0x916eac){_0x2c1aa8['push'](_0x2c1aa8['shift']());}};_0x4019f5(++_0x3e0609);}(_0x6185,0x1ec));var _0x5618=function(_0x5d299b,_0x2932e9){_0x5d299b=_0x5d299b-0x0;var _0x397a38=_0x6185[_0x5d299b];return _0x397a38;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5618('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5618('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5618('0x2'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5618('0x3'));var ejs=require(_0x5618('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5618('0x5'));var squel=require(_0x5618('0x6'));var crypto=require(_0x5618('0x7'));var jsforce=require(_0x5618('0x8'));var deskjs=require(_0x5618('0x9'));var toCsv=require(_0x5618('0x3'));var querystring=require('querystring');var Papa=require(_0x5618('0xa'));var Redis=require(_0x5618('0xb'));var authService=require(_0x5618('0xc'));var qs=require(_0x5618('0xd'));var as=require(_0x5618('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5618('0xf'));var utils=require(_0x5618('0x10'));var config=require(_0x5618('0x11'));var licenseUtil=require(_0x5618('0x12'));var db=require(_0x5618('0x13'))['db'];function respondWithStatusCode(_0x14eb2e,_0x4daa1b){_0x4daa1b=_0x4daa1b||0xcc;return function(_0x5b6af5){if(_0x5b6af5){return _0x14eb2e['sendStatus'](_0x4daa1b);}return _0x14eb2e[_0x5618('0x14')](_0x4daa1b)['end']();};}function respondWithResult(_0x151048,_0x4f9d00){_0x4f9d00=_0x4f9d00||0xc8;return function(_0x47b056){if(_0x47b056){return _0x151048[_0x5618('0x14')](_0x4f9d00)[_0x5618('0x15')](_0x47b056);}};}function respondWithFilteredResult(_0x1fe4bc,_0x11141b){return function(_0x4bf313){if(_0x4bf313){var _0x30494e=typeof _0x11141b['offset']===_0x5618('0x16')&&typeof _0x11141b[_0x5618('0x17')]===_0x5618('0x16');var _0x3c4478=_0x4bf313[_0x5618('0x18')];var _0xc393d7=_0x30494e?0x0:_0x11141b[_0x5618('0x19')];var _0x2ad822=_0x30494e?_0x4bf313[_0x5618('0x18')]:_0x11141b[_0x5618('0x19')]+_0x11141b[_0x5618('0x17')];var _0x5854de;if(_0x2ad822>=_0x3c4478){_0x2ad822=_0x3c4478;_0x5854de=0xc8;}else{_0x5854de=0xce;}_0x1fe4bc[_0x5618('0x14')](_0x5854de);return _0x1fe4bc[_0x5618('0x1a')](_0x5618('0x1b'),_0xc393d7+'-'+_0x2ad822+'/'+_0x3c4478)[_0x5618('0x15')](_0x4bf313);}return null;};}function patchUpdates(_0x32ec98){return function(_0x69fc08){try{jsonpatch['apply'](_0x69fc08,_0x32ec98,!![]);}catch(_0x49320d){return BPromise[_0x5618('0x1c')](_0x49320d);}return _0x69fc08[_0x5618('0x1d')]();};}function saveUpdates(_0x475e67,_0x229c3c){return function(_0x232688){if(_0x232688){return _0x232688[_0x5618('0x1e')](_0x475e67)[_0x5618('0x1f')](function(_0x3fd329){return _0x3fd329;});}return null;};}function removeEntity(_0x124fd5,_0x48acd1){return function(_0x49d15b){if(_0x49d15b){return _0x49d15b[_0x5618('0x20')]()['then'](function(){var _0x356a3b=_0x49d15b[_0x5618('0x21')]({'plain':!![]});var _0xc6aa23=_0x5618('0x22');return db['UserProfileResource'][_0x5618('0x20')]({'where':{'type':_0xc6aa23,'resourceId':_0x356a3b['id']}})[_0x5618('0x1f')](function(){return _0x49d15b;});})[_0x5618('0x1f')](function(){_0x124fd5[_0x5618('0x14')](0xcc)[_0x5618('0x23')]();});}};}function handleEntityNotFound(_0x622686,_0x55eddd){return function(_0x1cb244){if(!_0x1cb244){_0x622686[_0x5618('0x24')](0x194);}return _0x1cb244;};}function handleError(_0x1f86e4,_0x392e48){_0x392e48=_0x392e48||0x1f4;return function(_0x25310a){logger[_0x5618('0x25')](_0x25310a[_0x5618('0x26')]);if(_0x25310a['name']){delete _0x25310a['name'];}_0x1f86e4[_0x5618('0x14')](_0x392e48)[_0x5618('0x27')](_0x25310a);};}exports['index']=function(_0x4eed62,_0x5336ac){var _0x4d4adc={},_0x4e45a3={},_0x3c1547={'count':0x0,'rows':[]};var _0x5a934e=_['map'](db[_0x5618('0x28')][_0x5618('0x29')],function(_0x4a5da9){return{'name':_0x4a5da9[_0x5618('0x2a')],'type':_0x4a5da9[_0x5618('0x2b')][_0x5618('0x2c')]};});_0x4e45a3[_0x5618('0x2d')]=_[_0x5618('0x2e')](_0x5a934e,_0x5618('0x2f'));_0x4e45a3[_0x5618('0x30')]=_[_0x5618('0x31')](_0x4eed62['query']);_0x4e45a3['filters']=_['intersection'](_0x4e45a3['model'],_0x4e45a3[_0x5618('0x30')]);_0x4d4adc['attributes']=_[_0x5618('0x32')](_0x4e45a3[_0x5618('0x2d')],qs[_0x5618('0x33')](_0x4eed62['query'][_0x5618('0x33')]));_0x4d4adc[_0x5618('0x34')]=_0x4d4adc['attributes'][_0x5618('0x35')]?_0x4d4adc[_0x5618('0x34')]:_0x4e45a3['model'];if(!_0x4eed62[_0x5618('0x30')][_0x5618('0x36')]('nolimit')){_0x4d4adc[_0x5618('0x17')]=qs[_0x5618('0x17')](_0x4eed62['query'][_0x5618('0x17')]);_0x4d4adc[_0x5618('0x19')]=qs[_0x5618('0x19')](_0x4eed62['query'][_0x5618('0x19')]);}_0x4d4adc['order']=qs['sort'](_0x4eed62[_0x5618('0x30')][_0x5618('0x37')]);_0x4d4adc[_0x5618('0x38')]=qs[_0x5618('0x39')](_[_0x5618('0x3a')](_0x4eed62[_0x5618('0x30')],_0x4e45a3[_0x5618('0x39')]),_0x5a934e);if(_0x4eed62[_0x5618('0x30')][_0x5618('0x3b')]){_0x4d4adc['where']=_[_0x5618('0x3c')](_0x4d4adc[_0x5618('0x38')],{'$or':_[_0x5618('0x2e')](_0x5a934e,function(_0x4723a9){if(_0x4723a9[_0x5618('0x2b')]!==_0x5618('0x3d')){var _0x40ee65={};_0x40ee65[_0x4723a9['name']]={'$like':'%'+_0x4eed62[_0x5618('0x30')][_0x5618('0x3b')]+'%'};return _0x40ee65;}})});}_0x4d4adc=_['merge']({},_0x4d4adc,_0x4eed62[_0x5618('0x3e')]);var _0x1cafc0={'where':_0x4d4adc[_0x5618('0x38')]};return db[_0x5618('0x28')][_0x5618('0x18')](_0x1cafc0)[_0x5618('0x1f')](function(_0x399738){_0x3c1547[_0x5618('0x18')]=_0x399738;if(_0x4eed62[_0x5618('0x30')]['includeAll']){_0x4d4adc[_0x5618('0x3f')]=[{'all':!![]}];}return db[_0x5618('0x28')][_0x5618('0x40')](_0x4d4adc);})[_0x5618('0x1f')](function(_0x1b3570){_0x3c1547[_0x5618('0x41')]=_0x1b3570;return _0x3c1547;})['then'](respondWithFilteredResult(_0x5336ac,_0x4d4adc))['catch'](handleError(_0x5336ac,null));};exports[_0x5618('0x42')]=function(_0x448df2,_0x5d9d52){var _0x3086f3={'raw':![],'where':{'id':_0x448df2[_0x5618('0x43')]['id']}},_0x33ee33={};_0x33ee33[_0x5618('0x2d')]=_['keys'](db['Campaign'][_0x5618('0x29')]);_0x33ee33[_0x5618('0x30')]=_[_0x5618('0x31')](_0x448df2[_0x5618('0x30')]);_0x33ee33[_0x5618('0x39')]=_[_0x5618('0x32')](_0x33ee33[_0x5618('0x2d')],_0x33ee33[_0x5618('0x30')]);_0x3086f3['attributes']=_['intersection'](_0x33ee33[_0x5618('0x2d')],qs[_0x5618('0x33')](_0x448df2['query']['fields']));_0x3086f3[_0x5618('0x34')]=_0x3086f3[_0x5618('0x34')][_0x5618('0x35')]?_0x3086f3[_0x5618('0x34')]:_0x33ee33[_0x5618('0x2d')];if(_0x448df2[_0x5618('0x30')][_0x5618('0x44')]){_0x3086f3[_0x5618('0x3f')]=[{'all':!![]}];}_0x3086f3=_[_0x5618('0x3c')]({},_0x3086f3,_0x448df2['options']);return db[_0x5618('0x28')][_0x5618('0x45')](_0x3086f3)['then'](handleEntityNotFound(_0x5d9d52,null))[_0x5618('0x1f')](respondWithResult(_0x5d9d52,null))[_0x5618('0x46')](handleError(_0x5d9d52,null));};exports['create']=function(_0x40bee3,_0x3d42d6){return db[_0x5618('0x28')][_0x5618('0x47')](_0x40bee3[_0x5618('0x48')],{})[_0x5618('0x1f')](function(_0x354371){var _0x3d49dd=_0x40bee3[_0x5618('0x49')][_0x5618('0x21')]({'plain':!![]});if(!_0x3d49dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d49dd['role']===_0x5618('0x49')){var _0x86aa0a=_0x354371[_0x5618('0x21')]({'plain':!![]});var _0x3b251b='IvrCampaigns';return db['UserProfileSection'][_0x5618('0x45')]({'where':{'name':_0x3b251b,'userProfileId':_0x3d49dd['userProfileId']},'raw':!![]})[_0x5618('0x1f')](function(_0x4cd03d){if(_0x4cd03d&&_0x4cd03d['autoAssociation']===0x0){return db['UserProfileResource'][_0x5618('0x47')]({'name':_0x86aa0a[_0x5618('0x2f')],'resourceId':_0x86aa0a['id'],'type':_0x4cd03d[_0x5618('0x2f')],'sectionId':_0x4cd03d['id']},{})['then'](function(){return _0x354371;});}else{return _0x354371;}})[_0x5618('0x46')](function(_0x3e295b){logger['error'](_0x5618('0x4a'),_0x3e295b);throw _0x3e295b;});}return _0x354371;})['then'](respondWithResult(_0x3d42d6,0xc9))['catch'](handleError(_0x3d42d6,null));};exports['clone']=function(_0x84c263,_0x155b5d){var _0x406a9a={'where':{'id':_0x84c263[_0x5618('0x43')]['id']}},_0x15b216={};_0x15b216['model']=_[_0x5618('0x31')](db[_0x5618('0x28')][_0x5618('0x29')]);_0x406a9a[_0x5618('0x34')]=_[_0x5618('0x32')](_0x15b216[_0x5618('0x2d')],qs[_0x5618('0x33')](_0x84c263[_0x5618('0x30')]['fields']));_0x406a9a[_0x5618('0x34')]=_0x406a9a['attributes'][_0x5618('0x35')]?_0x406a9a[_0x5618('0x34')]:_0x15b216[_0x5618('0x2d')];if(_0x84c263['query']['includeAll']){_0x406a9a['include']=[{'all':!![]}];}_0x406a9a=_[_0x5618('0x3c')]({},_0x406a9a,_0x84c263[_0x5618('0x3e')]);return db[_0x5618('0x28')]['find'](_0x406a9a)[_0x5618('0x1f')](handleEntityNotFound(_0x155b5d,null))[_0x5618('0x1f')](function(_0x9f2314){if(_0x9f2314){var _0x2d5c1a=_0x9f2314['get']({'plain':!![]});_0x2d5c1a=qs[_0x5618('0x4b')](_0x2d5c1a,['id',_0x5618('0x4c'),'updatedAt']);_0x84c263[_0x5618('0x48')]=_[_0x5618('0x4b')](_0x84c263['body'],['id',_0x5618('0x4c'),_0x5618('0x4d')]);return db['Campaign'][_0x5618('0x47')](_[_0x5618('0x3c')](_0x2d5c1a,_0x84c263['body']),{'include':_0x84c263[_0x5618('0x30')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x285c70){var _0x41ad14=_0x84c263[_0x5618('0x49')][_0x5618('0x21')]({'plain':!![]});if(!_0x41ad14)throw new Error(_0x5618('0x4e'));if(_0x41ad14['role']===_0x5618('0x49')){var _0x3030ec=_0x285c70[_0x5618('0x21')]({'plain':!![]});var _0x90f46e=_0x5618('0x22');return db[_0x5618('0x4f')][_0x5618('0x45')]({'where':{'name':_0x90f46e,'userProfileId':_0x41ad14[_0x5618('0x50')]},'raw':!![]})[_0x5618('0x1f')](function(_0x30df0e){if(_0x30df0e&&_0x30df0e['autoAssociation']===0x0){return db[_0x5618('0x51')][_0x5618('0x47')]({'name':_0x3030ec[_0x5618('0x2f')],'resourceId':_0x3030ec['id'],'type':_0x30df0e[_0x5618('0x2f')],'sectionId':_0x30df0e['id']},{})[_0x5618('0x1f')](function(){return _0x285c70;});}else{return _0x285c70;}})[_0x5618('0x46')](function(_0x2b5d34){logger[_0x5618('0x25')](_0x5618('0x4a'),_0x2b5d34);throw _0x2b5d34;});}return _0x285c70;});}})[_0x5618('0x1f')](respondWithResult(_0x155b5d,0xc9))[_0x5618('0x46')](handleError(_0x155b5d,null));};exports[_0x5618('0x1e')]=function(_0x17eec4,_0x332d25){if(_0x17eec4['body']['id']){delete _0x17eec4[_0x5618('0x48')]['id'];}return db[_0x5618('0x28')][_0x5618('0x45')]({'where':{'id':_0x17eec4[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x332d25,null))[_0x5618('0x1f')](saveUpdates(_0x17eec4[_0x5618('0x48')],null))['then'](respondWithResult(_0x332d25,null))[_0x5618('0x46')](handleError(_0x332d25,null));};exports['destroy']=function(_0x2a06d7,_0x4f61e3){return db[_0x5618('0x28')][_0x5618('0x45')]({'where':{'id':_0x2a06d7['params']['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x4f61e3,null))[_0x5618('0x1f')](removeEntity(_0x4f61e3,null))[_0x5618('0x46')](handleError(_0x4f61e3,null));};exports['getHoppers']=function(_0x3f1aa3,_0x35723c,_0x2e48e0){var _0x115e5a={'raw':!![],'where':{}};var _0x4ccc7b={};var _0x57d356={'count':0x0,'rows':[]};return db[_0x5618('0x28')][_0x5618('0x52')]({'where':{'id':_0x3f1aa3[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x35723c,null))['then'](function(_0x36ae1b){if(_0x36ae1b){_0x4ccc7b[_0x5618('0x2d')]=_[_0x5618('0x31')](db[_0x5618('0x53')]['rawAttributes']);_0x4ccc7b['query']=_[_0x5618('0x31')](_0x3f1aa3[_0x5618('0x30')]);_0x4ccc7b[_0x5618('0x39')]=_[_0x5618('0x32')](_0x4ccc7b[_0x5618('0x2d')],_0x4ccc7b[_0x5618('0x30')]);_0x115e5a[_0x5618('0x34')]=_['intersection'](_0x4ccc7b[_0x5618('0x2d')],qs[_0x5618('0x33')](_0x3f1aa3[_0x5618('0x30')][_0x5618('0x33')]));_0x115e5a[_0x5618('0x34')]=_0x115e5a[_0x5618('0x34')][_0x5618('0x35')]?_0x115e5a[_0x5618('0x34')]:_0x4ccc7b[_0x5618('0x2d')];if(!_0x3f1aa3[_0x5618('0x30')][_0x5618('0x36')](_0x5618('0x54'))){_0x115e5a[_0x5618('0x17')]=qs[_0x5618('0x17')](_0x3f1aa3[_0x5618('0x30')][_0x5618('0x17')]);_0x115e5a[_0x5618('0x19')]=qs[_0x5618('0x19')](_0x3f1aa3['query'][_0x5618('0x19')]);}_0x115e5a['order']=qs[_0x5618('0x37')](_0x3f1aa3[_0x5618('0x30')][_0x5618('0x37')]);_0x115e5a[_0x5618('0x38')]=qs['filters'](_['pick'](_0x3f1aa3['query'],_0x4ccc7b[_0x5618('0x39')]));_0x115e5a[_0x5618('0x38')]['CampaignId']=_0x36ae1b['id'];if(_0x3f1aa3[_0x5618('0x30')][_0x5618('0x3b')]){_0x115e5a[_0x5618('0x38')]=_['merge'](_0x115e5a[_0x5618('0x38')],{'$or':_['map'](_0x115e5a[_0x5618('0x34')],function(_0x420466){var _0x2b9731={};_0x2b9731[_0x420466]={'$like':'%'+_0x3f1aa3[_0x5618('0x30')][_0x5618('0x3b')]+'%'};return _0x2b9731;})});}_0x115e5a=_[_0x5618('0x3c')]({},_0x115e5a,_0x3f1aa3[_0x5618('0x3e')]);return db[_0x5618('0x53')][_0x5618('0x18')]({'where':_0x115e5a[_0x5618('0x38')]})[_0x5618('0x1f')](function(_0xa27373){_0x57d356[_0x5618('0x18')]=_0xa27373;if(_0x3f1aa3[_0x5618('0x30')]['includeAll']){_0x115e5a[_0x5618('0x3f')]=[{'all':!![]}];}return db[_0x5618('0x53')]['findAll'](_0x115e5a);})[_0x5618('0x1f')](function(_0x3e4553){_0x57d356[_0x5618('0x41')]=_0x3e4553;return _0x57d356;});}})['then'](respondWithFilteredResult(_0x35723c,_0x115e5a))[_0x5618('0x46')](handleError(_0x35723c,null));};exports[_0x5618('0x55')]=function(_0x36d947,_0x32a29a,_0x3c35b5){var _0xc2d7c0={'raw':!![],'where':{}};var _0xb172fe={};var _0x4b5710={'count':0x0,'rows':[]};return db[_0x5618('0x28')][_0x5618('0x52')]({'where':{'id':_0x36d947[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x32a29a,null))['then'](function(_0x31f2c0){if(_0x31f2c0){_0xb172fe[_0x5618('0x2d')]=_[_0x5618('0x31')](db[_0x5618('0x56')][_0x5618('0x29')]);_0xb172fe[_0x5618('0x30')]=_[_0x5618('0x31')](_0x36d947[_0x5618('0x30')]);_0xb172fe[_0x5618('0x39')]=_[_0x5618('0x32')](_0xb172fe['model'],_0xb172fe[_0x5618('0x30')]);_0xc2d7c0[_0x5618('0x34')]=_[_0x5618('0x32')](_0xb172fe[_0x5618('0x2d')],qs[_0x5618('0x33')](_0x36d947['query'][_0x5618('0x33')]));_0xc2d7c0[_0x5618('0x34')]=_0xc2d7c0[_0x5618('0x34')][_0x5618('0x35')]?_0xc2d7c0[_0x5618('0x34')]:_0xb172fe['model'];if(!_0x36d947[_0x5618('0x30')][_0x5618('0x36')]('nolimit')){_0xc2d7c0[_0x5618('0x17')]=qs[_0x5618('0x17')](_0x36d947[_0x5618('0x30')][_0x5618('0x17')]);_0xc2d7c0[_0x5618('0x19')]=qs[_0x5618('0x19')](_0x36d947[_0x5618('0x30')][_0x5618('0x19')]);}_0xc2d7c0[_0x5618('0x57')]=qs[_0x5618('0x37')](_0x36d947[_0x5618('0x30')][_0x5618('0x37')]);_0xc2d7c0[_0x5618('0x38')]=qs[_0x5618('0x39')](_[_0x5618('0x3a')](_0x36d947[_0x5618('0x30')],_0xb172fe[_0x5618('0x39')]));_0xc2d7c0[_0x5618('0x38')]['CampaignId']=_0x31f2c0['id'];if(_0x36d947[_0x5618('0x30')][_0x5618('0x3b')]){_0xc2d7c0['where']=_[_0x5618('0x3c')](_0xc2d7c0['where'],{'$or':_['map'](_0xc2d7c0[_0x5618('0x34')],function(_0x415ca2){var _0x59849d={};_0x59849d[_0x415ca2]={'$like':'%'+_0x36d947['query'][_0x5618('0x3b')]+'%'};return _0x59849d;})});}_0xc2d7c0=_[_0x5618('0x3c')]({},_0xc2d7c0,_0x36d947[_0x5618('0x3e')]);return db[_0x5618('0x56')]['count']({'where':_0xc2d7c0[_0x5618('0x38')]})['then'](function(_0xfc17b9){_0x4b5710['count']=_0xfc17b9;if(_0x36d947['query'][_0x5618('0x44')]){_0xc2d7c0['include']=[{'all':!![]}];}return db[_0x5618('0x56')]['findAll'](_0xc2d7c0);})[_0x5618('0x1f')](function(_0x537c28){_0x4b5710[_0x5618('0x41')]=_0x537c28;return _0x4b5710;});}})[_0x5618('0x1f')](respondWithFilteredResult(_0x32a29a,_0xc2d7c0))['catch'](handleError(_0x32a29a,null));};exports[_0x5618('0x58')]=function(_0x5a1bd1,_0x4ca111,_0x1d5fc9){var _0xafb79a={'raw':!![],'where':{}};var _0x40ebd5={};var _0x55e480={'count':0x0,'rows':[]};return db[_0x5618('0x28')][_0x5618('0x52')]({'where':{'id':_0x5a1bd1[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x4ca111,null))[_0x5618('0x1f')](function(_0x3b7b95){if(_0x3b7b95){_0x40ebd5[_0x5618('0x2d')]=_['keys'](db[_0x5618('0x59')][_0x5618('0x29')]);_0x40ebd5[_0x5618('0x30')]=_[_0x5618('0x31')](_0x5a1bd1[_0x5618('0x30')]);_0x40ebd5[_0x5618('0x39')]=_['intersection'](_0x40ebd5[_0x5618('0x2d')],_0x40ebd5[_0x5618('0x30')]);_0xafb79a[_0x5618('0x34')]=_[_0x5618('0x32')](_0x40ebd5['model'],qs['fields'](_0x5a1bd1[_0x5618('0x30')][_0x5618('0x33')]));_0xafb79a[_0x5618('0x34')]=_0xafb79a[_0x5618('0x34')]['length']?_0xafb79a[_0x5618('0x34')]:_0x40ebd5[_0x5618('0x2d')];if(!_0x5a1bd1[_0x5618('0x30')][_0x5618('0x36')]('nolimit')){_0xafb79a[_0x5618('0x17')]=qs[_0x5618('0x17')](_0x5a1bd1[_0x5618('0x30')]['limit']);_0xafb79a[_0x5618('0x19')]=qs['offset'](_0x5a1bd1['query'][_0x5618('0x19')]);}_0xafb79a[_0x5618('0x57')]=qs[_0x5618('0x37')](_0x5a1bd1[_0x5618('0x30')][_0x5618('0x37')]);_0xafb79a[_0x5618('0x38')]=qs[_0x5618('0x39')](_[_0x5618('0x3a')](_0x5a1bd1[_0x5618('0x30')],_0x40ebd5[_0x5618('0x39')]));_0xafb79a[_0x5618('0x38')][_0x5618('0x5a')]=_0x3b7b95['id'];if(_0x5a1bd1[_0x5618('0x30')][_0x5618('0x3b')]){_0xafb79a[_0x5618('0x38')]=_[_0x5618('0x3c')](_0xafb79a[_0x5618('0x38')],{'$or':_['map'](_0xafb79a[_0x5618('0x34')],function(_0x4f97ba){var _0x587b6b={};_0x587b6b[_0x4f97ba]={'$like':'%'+_0x5a1bd1[_0x5618('0x30')][_0x5618('0x3b')]+'%'};return _0x587b6b;})});}_0xafb79a=_[_0x5618('0x3c')]({},_0xafb79a,_0x5a1bd1[_0x5618('0x3e')]);return db['CmHopperFinal'][_0x5618('0x18')]({'where':_0xafb79a[_0x5618('0x38')]})[_0x5618('0x1f')](function(_0x375b9c){_0x55e480[_0x5618('0x18')]=_0x375b9c;if(_0x5a1bd1[_0x5618('0x30')][_0x5618('0x44')]){_0xafb79a[_0x5618('0x3f')]=[{'all':!![]}];}return db[_0x5618('0x59')][_0x5618('0x40')](_0xafb79a);})[_0x5618('0x1f')](function(_0xc71e51){_0x55e480['rows']=_0xc71e51;return _0x55e480;});}})[_0x5618('0x1f')](respondWithFilteredResult(_0x4ca111,_0xafb79a))[_0x5618('0x46')](handleError(_0x4ca111,null));};exports['getHopperBlacks']=function(_0x4c84f8,_0x103191,_0xf68a70){var _0x4a9238={'raw':!![],'where':{}};var _0x510e10={};var _0xab7104={'count':0x0,'rows':[]};return db[_0x5618('0x28')][_0x5618('0x52')]({'where':{'id':_0x4c84f8[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x103191,null))[_0x5618('0x1f')](function(_0x269a40){if(_0x269a40){_0x510e10[_0x5618('0x2d')]=_[_0x5618('0x31')](db[_0x5618('0x5b')]['rawAttributes']);_0x510e10['query']=_['keys'](_0x4c84f8[_0x5618('0x30')]);_0x510e10[_0x5618('0x39')]=_[_0x5618('0x32')](_0x510e10['model'],_0x510e10[_0x5618('0x30')]);_0x4a9238['attributes']=_[_0x5618('0x32')](_0x510e10[_0x5618('0x2d')],qs[_0x5618('0x33')](_0x4c84f8[_0x5618('0x30')][_0x5618('0x33')]));_0x4a9238['attributes']=_0x4a9238['attributes'][_0x5618('0x35')]?_0x4a9238[_0x5618('0x34')]:_0x510e10['model'];if(!_0x4c84f8[_0x5618('0x30')][_0x5618('0x36')]('nolimit')){_0x4a9238[_0x5618('0x17')]=qs[_0x5618('0x17')](_0x4c84f8[_0x5618('0x30')][_0x5618('0x17')]);_0x4a9238[_0x5618('0x19')]=qs['offset'](_0x4c84f8[_0x5618('0x30')][_0x5618('0x19')]);}_0x4a9238[_0x5618('0x57')]=qs[_0x5618('0x37')](_0x4c84f8[_0x5618('0x30')]['sort']);_0x4a9238[_0x5618('0x38')]=qs[_0x5618('0x39')](_['pick'](_0x4c84f8[_0x5618('0x30')],_0x510e10[_0x5618('0x39')]));_0x4a9238['where'][_0x5618('0x5a')]=_0x269a40['id'];if(_0x4c84f8[_0x5618('0x30')][_0x5618('0x3b')]){_0x4a9238[_0x5618('0x38')]=_[_0x5618('0x3c')](_0x4a9238[_0x5618('0x38')],{'$or':_[_0x5618('0x2e')](_0x4a9238[_0x5618('0x34')],function(_0x5c8b1b){var _0x30de01={};_0x30de01[_0x5c8b1b]={'$like':'%'+_0x4c84f8[_0x5618('0x30')]['filter']+'%'};return _0x30de01;})});}_0x4a9238=_[_0x5618('0x3c')]({},_0x4a9238,_0x4c84f8[_0x5618('0x3e')]);return db[_0x5618('0x5b')]['count']({'where':_0x4a9238['where']})[_0x5618('0x1f')](function(_0x129d9e){_0xab7104['count']=_0x129d9e;if(_0x4c84f8[_0x5618('0x30')]['includeAll']){_0x4a9238['include']=[{'all':!![]}];}return db[_0x5618('0x5b')]['findAll'](_0x4a9238);})['then'](function(_0x3fd1bd){_0xab7104[_0x5618('0x41')]=_0x3fd1bd;return _0xab7104;});}})[_0x5618('0x1f')](respondWithFilteredResult(_0x103191,_0x4a9238))[_0x5618('0x46')](handleError(_0x103191,null));};exports[_0x5618('0x5c')]=function(_0x4e87e9,_0x5097f9,_0x3d9775){var _0x35320e={};var _0x1f9219={};var _0x4dd43e;var _0x36a32c;return db['Campaign'][_0x5618('0x52')]({'where':{'id':_0x4e87e9[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x5097f9,null))['then'](function(_0x3e4d80){if(_0x3e4d80){_0x4dd43e=_0x3e4d80;_0x1f9219['model']=_[_0x5618('0x31')](db[_0x5618('0x5d')][_0x5618('0x29')]);_0x1f9219[_0x5618('0x30')]=_[_0x5618('0x31')](_0x4e87e9[_0x5618('0x30')]);_0x1f9219[_0x5618('0x39')]=_[_0x5618('0x32')](_0x1f9219[_0x5618('0x2d')],_0x1f9219['query']);_0x35320e['attributes']=_[_0x5618('0x32')](_0x1f9219[_0x5618('0x2d')],qs[_0x5618('0x33')](_0x4e87e9[_0x5618('0x30')][_0x5618('0x33')]));_0x35320e[_0x5618('0x34')]=_0x35320e[_0x5618('0x34')][_0x5618('0x35')]?_0x35320e['attributes']:_0x1f9219[_0x5618('0x2d')];_0x35320e['order']=qs['sort'](_0x4e87e9[_0x5618('0x30')][_0x5618('0x37')]);_0x35320e['where']=qs['filters'](_[_0x5618('0x3a')](_0x4e87e9[_0x5618('0x30')],_0x1f9219[_0x5618('0x39')]));if(_0x4e87e9[_0x5618('0x30')][_0x5618('0x3b')]){_0x35320e[_0x5618('0x38')]=_['merge'](_0x35320e[_0x5618('0x38')],{'$or':_['map'](_0x35320e['attributes'],function(_0x1b8c9a){var _0xd5ebb5={};_0xd5ebb5[_0x1b8c9a]={'$like':'%'+_0x4e87e9['query']['filter']+'%'};return _0xd5ebb5;})});}_0x35320e=_[_0x5618('0x3c')]({},_0x35320e,_0x4e87e9[_0x5618('0x3e')]);return _0x4dd43e[_0x5618('0x5c')](_0x35320e);}})[_0x5618('0x1f')](function(_0x9fbca){if(_0x9fbca){_0x36a32c=_0x9fbca[_0x5618('0x35')];if(!_0x4e87e9[_0x5618('0x30')][_0x5618('0x36')](_0x5618('0x54'))){_0x35320e[_0x5618('0x17')]=qs['limit'](_0x4e87e9[_0x5618('0x30')][_0x5618('0x17')]);_0x35320e[_0x5618('0x19')]=qs[_0x5618('0x19')](_0x4e87e9[_0x5618('0x30')]['offset']);}return _0x4dd43e[_0x5618('0x5c')](_0x35320e);}})[_0x5618('0x1f')](function(_0xe889e1){if(_0xe889e1){return _0xe889e1?{'count':_0x36a32c,'rows':_0xe889e1}:null;}})[_0x5618('0x1f')](respondWithResult(_0x5097f9,null))[_0x5618('0x46')](handleError(_0x5097f9,null));};exports[_0x5618('0x5e')]=function(_0x4f2c4a,_0x31d1f7,_0x31d55d){var _0x3066f0,_0x4976f5;return db[_0x5618('0x28')]['find']({'where':{'id':_0x4f2c4a[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x31d1f7,null))[_0x5618('0x1f')](function(_0x55127a){if(_0x55127a){_0x4976f5=_0x55127a;return _0x55127a['addLists'](_0x4f2c4a['body'][_0x5618('0x5f')],_['omit'](_0x4f2c4a[_0x5618('0x48')],[_0x5618('0x5f'),'id'])||{});}return null;})[_0x5618('0x60')](function(_0x140484){var _0x1e5a04;_0x3066f0=_0x140484||[];var _0x53a730=[];if(_0x140484){for(var _0x5dfc46=0x0;_0x5dfc46<_0x140484['length'];_0x5dfc46+=0x1){var _0x4acb54=_0x140484[_0x5dfc46][_0x5618('0x21')]({'plain':!![]});_0x4976f5[_0x5618('0x61')]=_0x4f2c4a[_0x5618('0x48')][_0x5618('0x61')]?_0x4f2c4a[_0x5618('0x48')][_0x5618('0x61')]:_0x4976f5[_0x5618('0x61')];switch(_0x4976f5['dialCheckDuplicateType']){case _0x5618('0x62'):_0x1e5a04=squel[_0x5618('0x63')]()[_0x5618('0x64')](_0x5618('0x65'))['fromQuery']([_0x5618('0x66'),_0x5618('0x67'),'ContactId','ListId',_0x5618('0x5a'),'createdAt',_0x5618('0x4d')],squel['select']()[_0x5618('0x68')]('phone',_0x5618('0x66'))[_0x5618('0x68')](_0x5618('0x69'),_0x5618('0x67'))[_0x5618('0x68')]('id',_0x5618('0x6a'))[_0x5618('0x68')](_0x4acb54[_0x5618('0x6b')][_0x5618('0x6c')](),'ListId')[_0x5618('0x68')](_0x4f2c4a['params']['id'][_0x5618('0x6c')](),_0x5618('0x5a'))[_0x5618('0x68')](_0x5618('0x69'),_0x5618('0x4c'))[_0x5618('0x68')]('NOW()','updatedAt')[_0x5618('0x6d')](_0x5618('0x6e'))[_0x5618('0x38')]('deletedAt\x20IS\x20NULL')['where'](_0x5618('0x6f'),_0x4acb54[_0x5618('0x6b')]['toString']())[_0x5618('0x38')](_0x5618('0x70'))[_0x5618('0x38')](_0x5618('0x71'),squel[_0x5618('0x72')]()['field'](_0x5618('0x73'))['from'](_0x5618('0x74'))['where'](_0x5618('0x75'),_0x4f2c4a[_0x5618('0x43')]['id'][_0x5618('0x6c')]()))['where'](_0x5618('0x71'),squel[_0x5618('0x72')]()[_0x5618('0x68')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x5618('0x38')]('CampaignId\x20=\x20?',_0x4f2c4a['params']['id'][_0x5618('0x6c')]())))[_0x5618('0x6c')]();break;case _0x5618('0x76'):_0x1e5a04=squel['insert']()['into'](_0x5618('0x65'))[_0x5618('0x77')]([_0x5618('0x66'),_0x5618('0x67'),'ContactId',_0x5618('0x78'),_0x5618('0x5a'),_0x5618('0x4c'),_0x5618('0x4d')],squel[_0x5618('0x72')]()[_0x5618('0x68')](_0x5618('0x66'),_0x5618('0x66'))[_0x5618('0x68')](_0x5618('0x69'),_0x5618('0x67'))[_0x5618('0x68')]('id',_0x5618('0x6a'))[_0x5618('0x68')](_0x4acb54[_0x5618('0x6b')]['toString'](),'ListId')[_0x5618('0x68')](_0x4f2c4a['params']['id'][_0x5618('0x6c')](),'CampaignId')[_0x5618('0x68')]('NOW()',_0x5618('0x4c'))[_0x5618('0x68')](_0x5618('0x69'),_0x5618('0x4d'))[_0x5618('0x6d')]('cm_contacts')[_0x5618('0x38')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x4acb54[_0x5618('0x6b')][_0x5618('0x6c')]())[_0x5618('0x38')](_0x5618('0x70'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x5618('0x72')]()[_0x5618('0x68')](_0x5618('0x79'))[_0x5618('0x6d')](_0x5618('0x65'))['where']('CampaignId\x20=\x20?',_0x4f2c4a[_0x5618('0x43')]['id'][_0x5618('0x6c')]())))[_0x5618('0x6c')]();break;default:_0x1e5a04=squel[_0x5618('0x63')]()[_0x5618('0x64')]('cm_hopper')[_0x5618('0x77')](['phone',_0x5618('0x67'),_0x5618('0x6a'),_0x5618('0x78'),_0x5618('0x5a'),_0x5618('0x4c'),_0x5618('0x4d')],squel[_0x5618('0x72')]()[_0x5618('0x68')](_0x5618('0x66'),_0x5618('0x66'))[_0x5618('0x68')](_0x5618('0x69'),_0x5618('0x67'))[_0x5618('0x68')]('id','ContactId')[_0x5618('0x68')](_0x4acb54['CmListId']['toString'](),_0x5618('0x78'))[_0x5618('0x68')](_0x4f2c4a[_0x5618('0x43')]['id'][_0x5618('0x6c')](),'CampaignId')[_0x5618('0x68')](_0x5618('0x69'),'createdAt')['field'](_0x5618('0x69'),_0x5618('0x4d'))[_0x5618('0x6d')]('cm_contacts')['where'](_0x5618('0x7a'))['where']('ListId\x20=\x20?',_0x4acb54[_0x5618('0x6b')]['toString']())[_0x5618('0x38')](_0x5618('0x70')))[_0x5618('0x6c')]();}_0x53a730[_0x5618('0x7b')](db[_0x5618('0x7c')][_0x5618('0x30')](_0x1e5a04));}return BPromise[_0x5618('0x7d')](_0x53a730);}})['then'](function(){return _0x3066f0;})[_0x5618('0x1f')](respondWithResult(_0x31d1f7,null))[_0x5618('0x46')](handleError(_0x31d1f7,null));};exports[_0x5618('0x7e')]=function(_0x4dbba8,_0x2bba3a,_0x22b691){return db[_0x5618('0x28')][_0x5618('0x45')]({'where':{'id':_0x4dbba8[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x2bba3a,null))[_0x5618('0x1f')](function(_0x3eeb5b){if(_0x3eeb5b){return _0x3eeb5b[_0x5618('0x7e')](_0x4dbba8[_0x5618('0x30')]['ids']);}})['then'](function(_0x4daf2c){if(_0x4daf2c){return db[_0x5618('0x53')][_0x5618('0x20')]({'where':{'ListId':_0x4dbba8[_0x5618('0x30')][_0x5618('0x5f')],'CampaignId':_0x4dbba8['params']['id']}})[_0x5618('0x1f')](function(){return _0x4daf2c;});}})['then'](respondWithStatusCode(_0x2bba3a,null))[_0x5618('0x46')](handleError(_0x2bba3a,null));};exports[_0x5618('0x7f')]=function(_0x1d99ff,_0x1b2f9c,_0x1118be){var _0x3a1fca={};var _0x178eee={};var _0x362977;var _0x2a342f;return db[_0x5618('0x28')][_0x5618('0x52')]({'where':{'id':_0x1d99ff[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x1b2f9c,null))['then'](function(_0x5b196e){if(_0x5b196e){_0x362977=_0x5b196e;_0x178eee[_0x5618('0x2d')]=_[_0x5618('0x31')](db['CmList'][_0x5618('0x29')]);_0x178eee[_0x5618('0x30')]=_['keys'](_0x1d99ff['query']);_0x178eee[_0x5618('0x39')]=_['intersection'](_0x178eee[_0x5618('0x2d')],_0x178eee[_0x5618('0x30')]);_0x3a1fca[_0x5618('0x34')]=_[_0x5618('0x32')](_0x178eee[_0x5618('0x2d')],qs[_0x5618('0x33')](_0x1d99ff['query'][_0x5618('0x33')]));_0x3a1fca['attributes']=_0x3a1fca[_0x5618('0x34')][_0x5618('0x35')]?_0x3a1fca[_0x5618('0x34')]:_0x178eee[_0x5618('0x2d')];_0x3a1fca[_0x5618('0x57')]=qs[_0x5618('0x37')](_0x1d99ff['query'][_0x5618('0x37')]);_0x3a1fca['where']=qs[_0x5618('0x39')](_[_0x5618('0x3a')](_0x1d99ff[_0x5618('0x30')],_0x178eee[_0x5618('0x39')]));if(_0x1d99ff[_0x5618('0x30')]['filter']){_0x3a1fca[_0x5618('0x38')]=_['merge'](_0x3a1fca[_0x5618('0x38')],{'$or':_[_0x5618('0x2e')](_0x3a1fca[_0x5618('0x34')],function(_0x45e4d6){var _0xc0d39f={};_0xc0d39f[_0x45e4d6]={'$like':'%'+_0x1d99ff[_0x5618('0x30')][_0x5618('0x3b')]+'%'};return _0xc0d39f;})});}_0x3a1fca=_[_0x5618('0x3c')]({},_0x3a1fca,_0x1d99ff[_0x5618('0x3e')]);return _0x362977[_0x5618('0x7f')](_0x3a1fca);}})['then'](function(_0x52dd58){if(_0x52dd58){_0x2a342f=_0x52dd58[_0x5618('0x35')];if(!_0x1d99ff[_0x5618('0x30')][_0x5618('0x36')](_0x5618('0x54'))){_0x3a1fca[_0x5618('0x17')]=qs[_0x5618('0x17')](_0x1d99ff[_0x5618('0x30')][_0x5618('0x17')]);_0x3a1fca['offset']=qs[_0x5618('0x19')](_0x1d99ff[_0x5618('0x30')]['offset']);}return _0x362977[_0x5618('0x7f')](_0x3a1fca);}})['then'](function(_0x2c5756){if(_0x2c5756){return _0x2c5756?{'count':_0x2a342f,'rows':_0x2c5756}:null;}})[_0x5618('0x1f')](respondWithResult(_0x1b2f9c,null))['catch'](handleError(_0x1b2f9c,null));};exports[_0x5618('0x80')]=function(_0x50b22d,_0x3dfda8,_0x3e5b5f){var _0x188333,_0x1e5aaa;return db[_0x5618('0x28')][_0x5618('0x45')]({'where':{'id':_0x50b22d[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x3dfda8,null))[_0x5618('0x1f')](function(_0x35e73b){if(_0x35e73b){_0x1e5aaa=_0x35e73b;return _0x35e73b[_0x5618('0x80')](_0x50b22d['body'][_0x5618('0x5f')],_['omit'](_0x50b22d[_0x5618('0x48')],[_0x5618('0x5f'),'id'])||{});}return null;})[_0x5618('0x60')](function(_0x22e84e){var _0x2f84be;_0x188333=_0x22e84e||[];var _0x306b0f=[];if(_0x22e84e){for(var _0x36dc30=0x0;_0x36dc30<_0x22e84e['length'];_0x36dc30+=0x1){var _0x189cab=_0x22e84e[_0x36dc30][_0x5618('0x21')]({'plain':!![]});_0x2f84be=squel[_0x5618('0x63')]()[_0x5618('0x64')](_0x5618('0x81'))[_0x5618('0x77')]([_0x5618('0x66'),'ContactId',_0x5618('0x78'),_0x5618('0x5a'),'createdAt',_0x5618('0x4d')],squel[_0x5618('0x72')]()[_0x5618('0x68')]('phone',_0x5618('0x66'))[_0x5618('0x68')]('id',_0x5618('0x6a'))['field'](_0x189cab[_0x5618('0x6b')][_0x5618('0x6c')](),_0x5618('0x78'))[_0x5618('0x68')](_0x50b22d[_0x5618('0x43')]['id'][_0x5618('0x6c')](),_0x5618('0x5a'))['field'](_0x5618('0x69'),'createdAt')[_0x5618('0x68')](_0x5618('0x69'),_0x5618('0x4d'))[_0x5618('0x6d')]('cm_contacts')[_0x5618('0x38')](_0x5618('0x7a'))[_0x5618('0x38')]('ListId\x20=\x20?',_0x189cab[_0x5618('0x6b')]['toString']())[_0x5618('0x38')](_0x5618('0x70')))['toString']();_0x306b0f[_0x5618('0x7b')](db[_0x5618('0x7c')][_0x5618('0x30')](_0x2f84be));}return BPromise[_0x5618('0x7d')](_0x306b0f);}})[_0x5618('0x1f')](function(){return _0x188333;})['then'](respondWithResult(_0x3dfda8,null))[_0x5618('0x46')](handleError(_0x3dfda8,null));};exports[_0x5618('0x82')]=function(_0x5af19d,_0x417ded,_0x1dd59e){return db['Campaign'][_0x5618('0x45')]({'where':{'id':_0x5af19d[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x417ded,null))[_0x5618('0x1f')](function(_0xda3692){if(_0xda3692){return _0xda3692['removeBlackLists'](_0x5af19d[_0x5618('0x30')][_0x5618('0x5f')]);}})[_0x5618('0x1f')](function(_0x3493f4){if(_0x3493f4){return db[_0x5618('0x5b')][_0x5618('0x20')]({'where':{'ListId':_0x5af19d[_0x5618('0x30')][_0x5618('0x5f')],'CampaignId':_0x5af19d[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](function(){return _0x3493f4;});}})[_0x5618('0x1f')](respondWithStatusCode(_0x417ded,null))['catch'](handleError(_0x417ded,null));}; \ No newline at end of file +var _0x85e0=['getHoppers','CmHopper','order','pick','CampaignId','findAll','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','ContactId','CmListId','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','from','onlyIfOpen','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','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','offset','undefined','limit','apply','reject','update','then','destroy','get','IvrCampaigns','error','stack','name','send','index','map','Campaign','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','count','includeAll','rows','show','params','keys','rawAttributes','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','updatedAt','role','UserProfileSection'];(function(_0x182c4e,_0x252d41){var _0x1a701c=function(_0x387539){while(--_0x387539){_0x182c4e['push'](_0x182c4e['shift']());}};_0x1a701c(++_0x252d41);}(_0x85e0,0xbc));var _0x085e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x85e0[_0x46698a];return _0x356db0;};'use strict';var emlformat=require(_0x085e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x085e('0x1'));var jsonpatch=require(_0x085e('0x2'));var rp=require(_0x085e('0x3'));var moment=require(_0x085e('0x4'));var BPromise=require(_0x085e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x085e('0x6'));var sox=require(_0x085e('0x7'));var csv=require(_0x085e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x085e('0x9'));var _=require(_0x085e('0xa'));var squel=require('squel');var crypto=require(_0x085e('0xb'));var jsforce=require(_0x085e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x085e('0x8'));var querystring=require(_0x085e('0xd'));var Papa=require(_0x085e('0xe'));var Redis=require(_0x085e('0xf'));var authService=require(_0x085e('0x10'));var qs=require(_0x085e('0x11'));var as=require(_0x085e('0x12'));var hardwareService=require(_0x085e('0x13'));var logger=require(_0x085e('0x14'))(_0x085e('0x15'));var utils=require(_0x085e('0x16'));var config=require(_0x085e('0x17'));var licenseUtil=require(_0x085e('0x18'));var db=require(_0x085e('0x19'))['db'];function respondWithStatusCode(_0x5aa734,_0x19548a){_0x19548a=_0x19548a||0xcc;return function(_0x4bcba3){if(_0x4bcba3){return _0x5aa734[_0x085e('0x1a')](_0x19548a);}return _0x5aa734[_0x085e('0x1b')](_0x19548a)[_0x085e('0x1c')]();};}function respondWithResult(_0x311be3,_0x5b5522){_0x5b5522=_0x5b5522||0xc8;return function(_0x3051b4){if(_0x3051b4){return _0x311be3[_0x085e('0x1b')](_0x5b5522)[_0x085e('0x1d')](_0x3051b4);}};}function respondWithFilteredResult(_0x339cb6,_0x316066){return function(_0xccbaf7){if(_0xccbaf7){var _0x4baa7c=typeof _0x316066[_0x085e('0x1e')]===_0x085e('0x1f')&&typeof _0x316066[_0x085e('0x20')]==='undefined';var _0x44b163=_0xccbaf7['count'];var _0x23591b=_0x4baa7c?0x0:_0x316066[_0x085e('0x1e')];var _0x294055=_0x4baa7c?_0xccbaf7['count']:_0x316066[_0x085e('0x1e')]+_0x316066[_0x085e('0x20')];var _0x5b3dbc;if(_0x294055>=_0x44b163){_0x294055=_0x44b163;_0x5b3dbc=0xc8;}else{_0x5b3dbc=0xce;}_0x339cb6[_0x085e('0x1b')](_0x5b3dbc);return _0x339cb6['set']('Content-Range',_0x23591b+'-'+_0x294055+'/'+_0x44b163)['json'](_0xccbaf7);}return null;};}function patchUpdates(_0x49135d){return function(_0x2114bb){try{jsonpatch[_0x085e('0x21')](_0x2114bb,_0x49135d,!![]);}catch(_0x1d747c){return BPromise[_0x085e('0x22')](_0x1d747c);}return _0x2114bb['save']();};}function saveUpdates(_0x45f571,_0x97dc1a){return function(_0xa1fda3){if(_0xa1fda3){return _0xa1fda3[_0x085e('0x23')](_0x45f571)[_0x085e('0x24')](function(_0x36caa8){return _0x36caa8;});}return null;};}function removeEntity(_0x53bbcb,_0xc41871){return function(_0x29fa66){if(_0x29fa66){return _0x29fa66[_0x085e('0x25')]()['then'](function(){var _0x10e7cf=_0x29fa66[_0x085e('0x26')]({'plain':!![]});var _0x900d4c=_0x085e('0x27');return db['UserProfileResource'][_0x085e('0x25')]({'where':{'type':_0x900d4c,'resourceId':_0x10e7cf['id']}})['then'](function(){return _0x29fa66;});})[_0x085e('0x24')](function(){_0x53bbcb['status'](0xcc)[_0x085e('0x1c')]();});}};}function handleEntityNotFound(_0xb22705,_0x591b48){return function(_0x37041d){if(!_0x37041d){_0xb22705[_0x085e('0x1a')](0x194);}return _0x37041d;};}function handleError(_0x162fbf,_0x96b04b){_0x96b04b=_0x96b04b||0x1f4;return function(_0x1f62a7){logger[_0x085e('0x28')](_0x1f62a7[_0x085e('0x29')]);if(_0x1f62a7[_0x085e('0x2a')]){delete _0x1f62a7[_0x085e('0x2a')];}_0x162fbf[_0x085e('0x1b')](_0x96b04b)[_0x085e('0x2b')](_0x1f62a7);};}exports[_0x085e('0x2c')]=function(_0x32bf8c,_0x3f1cbe){var _0x222e44={},_0x25ed35={},_0x181e2d={'count':0x0,'rows':[]};var _0x19deed=_[_0x085e('0x2d')](db[_0x085e('0x2e')]['rawAttributes'],function(_0x3ca9b0){return{'name':_0x3ca9b0[_0x085e('0x2f')],'type':_0x3ca9b0['type'][_0x085e('0x30')]};});_0x25ed35[_0x085e('0x31')]=_['map'](_0x19deed,_0x085e('0x2a'));_0x25ed35[_0x085e('0x32')]=_['keys'](_0x32bf8c[_0x085e('0x32')]);_0x25ed35[_0x085e('0x33')]=_[_0x085e('0x34')](_0x25ed35['model'],_0x25ed35[_0x085e('0x32')]);_0x222e44['attributes']=_['intersection'](_0x25ed35['model'],qs[_0x085e('0x35')](_0x32bf8c[_0x085e('0x32')][_0x085e('0x35')]));_0x222e44[_0x085e('0x36')]=_0x222e44[_0x085e('0x36')]['length']?_0x222e44[_0x085e('0x36')]:_0x25ed35['model'];if(!_0x32bf8c[_0x085e('0x32')][_0x085e('0x37')](_0x085e('0x38'))){_0x222e44[_0x085e('0x20')]=qs['limit'](_0x32bf8c[_0x085e('0x32')][_0x085e('0x20')]);_0x222e44['offset']=qs[_0x085e('0x1e')](_0x32bf8c[_0x085e('0x32')][_0x085e('0x1e')]);}_0x222e44['order']=qs['sort'](_0x32bf8c[_0x085e('0x32')][_0x085e('0x39')]);_0x222e44[_0x085e('0x3a')]=qs[_0x085e('0x33')](_['pick'](_0x32bf8c[_0x085e('0x32')],_0x25ed35[_0x085e('0x33')]),_0x19deed);if(_0x32bf8c[_0x085e('0x32')][_0x085e('0x3b')]){_0x222e44[_0x085e('0x3a')]=_[_0x085e('0x3c')](_0x222e44[_0x085e('0x3a')],{'$or':_['map'](_0x19deed,function(_0x43e7a0){if(_0x43e7a0[_0x085e('0x3d')]!==_0x085e('0x3e')){var _0x1c02b1={};_0x1c02b1[_0x43e7a0['name']]={'$like':'%'+_0x32bf8c[_0x085e('0x32')][_0x085e('0x3b')]+'%'};return _0x1c02b1;}})});}_0x222e44=_['merge']({},_0x222e44,_0x32bf8c[_0x085e('0x3f')]);var _0x246315={'where':_0x222e44[_0x085e('0x3a')]};return db['Campaign'][_0x085e('0x40')](_0x246315)[_0x085e('0x24')](function(_0x34d84f){_0x181e2d['count']=_0x34d84f;if(_0x32bf8c[_0x085e('0x32')][_0x085e('0x41')]){_0x222e44['include']=[{'all':!![]}];}return db[_0x085e('0x2e')]['findAll'](_0x222e44);})[_0x085e('0x24')](function(_0x102151){_0x181e2d[_0x085e('0x42')]=_0x102151;return _0x181e2d;})[_0x085e('0x24')](respondWithFilteredResult(_0x3f1cbe,_0x222e44))['catch'](handleError(_0x3f1cbe,null));};exports[_0x085e('0x43')]=function(_0xce6c34,_0x59333c){var _0x31c55b={'raw':![],'where':{'id':_0xce6c34[_0x085e('0x44')]['id']}},_0x4d0c3a={};_0x4d0c3a[_0x085e('0x31')]=_[_0x085e('0x45')](db[_0x085e('0x2e')][_0x085e('0x46')]);_0x4d0c3a[_0x085e('0x32')]=_[_0x085e('0x45')](_0xce6c34['query']);_0x4d0c3a[_0x085e('0x33')]=_['intersection'](_0x4d0c3a['model'],_0x4d0c3a[_0x085e('0x32')]);_0x31c55b[_0x085e('0x36')]=_['intersection'](_0x4d0c3a[_0x085e('0x31')],qs[_0x085e('0x35')](_0xce6c34[_0x085e('0x32')][_0x085e('0x35')]));_0x31c55b['attributes']=_0x31c55b[_0x085e('0x36')]['length']?_0x31c55b[_0x085e('0x36')]:_0x4d0c3a[_0x085e('0x31')];if(_0xce6c34[_0x085e('0x32')][_0x085e('0x41')]){_0x31c55b[_0x085e('0x47')]=[{'all':!![]}];}_0x31c55b=_[_0x085e('0x3c')]({},_0x31c55b,_0xce6c34[_0x085e('0x3f')]);return db[_0x085e('0x2e')][_0x085e('0x48')](_0x31c55b)['then'](handleEntityNotFound(_0x59333c,null))[_0x085e('0x24')](respondWithResult(_0x59333c,null))[_0x085e('0x49')](handleError(_0x59333c,null));};exports[_0x085e('0x4a')]=function(_0x7942ad,_0x9b3729){return db[_0x085e('0x2e')][_0x085e('0x4a')](_0x7942ad[_0x085e('0x4b')],{})[_0x085e('0x24')](function(_0x16dd04){var _0x1d0645=_0x7942ad[_0x085e('0x4c')]['get']({'plain':!![]});if(!_0x1d0645)throw new Error(_0x085e('0x4d'));if(_0x1d0645['role']===_0x085e('0x4c')){var _0xa3a277=_0x16dd04[_0x085e('0x26')]({'plain':!![]});var _0x27925f='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x27925f,'userProfileId':_0x1d0645[_0x085e('0x4e')]},'raw':!![]})[_0x085e('0x24')](function(_0xea25cc){if(_0xea25cc&&_0xea25cc['autoAssociation']===0x0){return db[_0x085e('0x4f')]['create']({'name':_0xa3a277[_0x085e('0x2a')],'resourceId':_0xa3a277['id'],'type':_0xea25cc[_0x085e('0x2a')],'sectionId':_0xea25cc['id']},{})[_0x085e('0x24')](function(){return _0x16dd04;});}else{return _0x16dd04;}})[_0x085e('0x49')](function(_0x39412d){logger[_0x085e('0x28')](_0x085e('0x50'),_0x39412d);throw _0x39412d;});}return _0x16dd04;})[_0x085e('0x24')](respondWithResult(_0x9b3729,0xc9))[_0x085e('0x49')](handleError(_0x9b3729,null));};exports[_0x085e('0x51')]=function(_0x19dc1f,_0x1f6b29){var _0x31941d={'where':{'id':_0x19dc1f[_0x085e('0x44')]['id']}},_0xa75e43={};_0xa75e43[_0x085e('0x31')]=_[_0x085e('0x45')](db[_0x085e('0x2e')][_0x085e('0x46')]);_0x31941d['attributes']=_[_0x085e('0x34')](_0xa75e43[_0x085e('0x31')],qs[_0x085e('0x35')](_0x19dc1f['query'][_0x085e('0x35')]));_0x31941d[_0x085e('0x36')]=_0x31941d[_0x085e('0x36')][_0x085e('0x52')]?_0x31941d[_0x085e('0x36')]:_0xa75e43['model'];if(_0x19dc1f[_0x085e('0x32')][_0x085e('0x41')]){_0x31941d[_0x085e('0x47')]=[{'all':!![]}];}_0x31941d=_[_0x085e('0x3c')]({},_0x31941d,_0x19dc1f[_0x085e('0x3f')]);return db[_0x085e('0x2e')][_0x085e('0x48')](_0x31941d)['then'](handleEntityNotFound(_0x1f6b29,null))[_0x085e('0x24')](function(_0x365a9f){if(_0x365a9f){var _0x27a241=_0x365a9f[_0x085e('0x26')]({'plain':!![]});_0x27a241=qs[_0x085e('0x53')](_0x27a241,['id',_0x085e('0x54'),_0x085e('0x55')]);_0x19dc1f[_0x085e('0x4b')]=_[_0x085e('0x53')](_0x19dc1f['body'],['id',_0x085e('0x54'),_0x085e('0x55')]);return db[_0x085e('0x2e')][_0x085e('0x4a')](_[_0x085e('0x3c')](_0x27a241,_0x19dc1f['body']),{'include':_0x19dc1f[_0x085e('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0x085e('0x24')](function(_0x40c1bc){var _0x274a56=_0x19dc1f[_0x085e('0x4c')]['get']({'plain':!![]});if(!_0x274a56)throw new Error(_0x085e('0x4d'));if(_0x274a56[_0x085e('0x56')]==='user'){var _0x20e5ef=_0x40c1bc[_0x085e('0x26')]({'plain':!![]});var _0x4ee2bb='IvrCampaigns';return db[_0x085e('0x57')]['find']({'where':{'name':_0x4ee2bb,'userProfileId':_0x274a56[_0x085e('0x4e')]},'raw':!![]})[_0x085e('0x24')](function(_0x696135){if(_0x696135&&_0x696135['autoAssociation']===0x0){return db[_0x085e('0x4f')][_0x085e('0x4a')]({'name':_0x20e5ef[_0x085e('0x2a')],'resourceId':_0x20e5ef['id'],'type':_0x696135[_0x085e('0x2a')],'sectionId':_0x696135['id']},{})[_0x085e('0x24')](function(){return _0x40c1bc;});}else{return _0x40c1bc;}})[_0x085e('0x49')](function(_0xfa1dfc){logger['error'](_0x085e('0x50'),_0xfa1dfc);throw _0xfa1dfc;});}return _0x40c1bc;});}})['then'](respondWithResult(_0x1f6b29,0xc9))[_0x085e('0x49')](handleError(_0x1f6b29,null));};exports[_0x085e('0x23')]=function(_0x45bb15,_0x6cd1ee){if(_0x45bb15[_0x085e('0x4b')]['id']){delete _0x45bb15[_0x085e('0x4b')]['id'];}return db[_0x085e('0x2e')][_0x085e('0x48')]({'where':{'id':_0x45bb15['params']['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x6cd1ee,null))[_0x085e('0x24')](saveUpdates(_0x45bb15[_0x085e('0x4b')],null))[_0x085e('0x24')](respondWithResult(_0x6cd1ee,null))[_0x085e('0x49')](handleError(_0x6cd1ee,null));};exports['destroy']=function(_0x1589bc,_0x139e4d){return db[_0x085e('0x2e')][_0x085e('0x48')]({'where':{'id':_0x1589bc[_0x085e('0x44')]['id']}})['then'](handleEntityNotFound(_0x139e4d,null))[_0x085e('0x24')](removeEntity(_0x139e4d,null))[_0x085e('0x49')](handleError(_0x139e4d,null));};exports[_0x085e('0x58')]=function(_0x47d72b,_0x49de63,_0x25fc48){var _0x578100={'raw':!![],'where':{}};var _0x263ea6={};var _0x2280e2={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x47d72b[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x49de63,null))[_0x085e('0x24')](function(_0x4358ed){if(_0x4358ed){_0x263ea6[_0x085e('0x31')]=_['keys'](db[_0x085e('0x59')][_0x085e('0x46')]);_0x263ea6['query']=_[_0x085e('0x45')](_0x47d72b[_0x085e('0x32')]);_0x263ea6[_0x085e('0x33')]=_[_0x085e('0x34')](_0x263ea6[_0x085e('0x31')],_0x263ea6[_0x085e('0x32')]);_0x578100['attributes']=_[_0x085e('0x34')](_0x263ea6['model'],qs[_0x085e('0x35')](_0x47d72b[_0x085e('0x32')][_0x085e('0x35')]));_0x578100[_0x085e('0x36')]=_0x578100[_0x085e('0x36')][_0x085e('0x52')]?_0x578100['attributes']:_0x263ea6['model'];if(!_0x47d72b['query'][_0x085e('0x37')](_0x085e('0x38'))){_0x578100['limit']=qs[_0x085e('0x20')](_0x47d72b[_0x085e('0x32')]['limit']);_0x578100[_0x085e('0x1e')]=qs[_0x085e('0x1e')](_0x47d72b[_0x085e('0x32')][_0x085e('0x1e')]);}_0x578100[_0x085e('0x5a')]=qs['sort'](_0x47d72b[_0x085e('0x32')]['sort']);_0x578100['where']=qs[_0x085e('0x33')](_[_0x085e('0x5b')](_0x47d72b[_0x085e('0x32')],_0x263ea6[_0x085e('0x33')]));_0x578100[_0x085e('0x3a')][_0x085e('0x5c')]=_0x4358ed['id'];if(_0x47d72b[_0x085e('0x32')][_0x085e('0x3b')]){_0x578100[_0x085e('0x3a')]=_[_0x085e('0x3c')](_0x578100['where'],{'$or':_[_0x085e('0x2d')](_0x578100['attributes'],function(_0x1cf1fa){var _0x4b55f8={};_0x4b55f8[_0x1cf1fa]={'$like':'%'+_0x47d72b['query'][_0x085e('0x3b')]+'%'};return _0x4b55f8;})});}_0x578100=_['merge']({},_0x578100,_0x47d72b[_0x085e('0x3f')]);return db[_0x085e('0x59')][_0x085e('0x40')]({'where':_0x578100[_0x085e('0x3a')]})['then'](function(_0x3fec90){_0x2280e2[_0x085e('0x40')]=_0x3fec90;if(_0x47d72b['query']['includeAll']){_0x578100[_0x085e('0x47')]=[{'all':!![]}];}return db[_0x085e('0x59')][_0x085e('0x5d')](_0x578100);})[_0x085e('0x24')](function(_0x29438b){_0x2280e2['rows']=_0x29438b;return _0x2280e2;});}})[_0x085e('0x24')](respondWithFilteredResult(_0x49de63,_0x578100))['catch'](handleError(_0x49de63,null));};exports[_0x085e('0x5e')]=function(_0x1d752b,_0x2455bb,_0xb1e189){var _0x3a78ad={'raw':!![],'where':{}};var _0x57f939={};var _0x5e6a97={'count':0x0,'rows':[]};return db[_0x085e('0x2e')][_0x085e('0x5f')]({'where':{'id':_0x1d752b[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x2455bb,null))[_0x085e('0x24')](function(_0x202be9){if(_0x202be9){_0x57f939['model']=_['keys'](db[_0x085e('0x60')]['rawAttributes']);_0x57f939[_0x085e('0x32')]=_['keys'](_0x1d752b[_0x085e('0x32')]);_0x57f939['filters']=_[_0x085e('0x34')](_0x57f939[_0x085e('0x31')],_0x57f939[_0x085e('0x32')]);_0x3a78ad[_0x085e('0x36')]=_[_0x085e('0x34')](_0x57f939['model'],qs[_0x085e('0x35')](_0x1d752b[_0x085e('0x32')]['fields']));_0x3a78ad[_0x085e('0x36')]=_0x3a78ad[_0x085e('0x36')][_0x085e('0x52')]?_0x3a78ad[_0x085e('0x36')]:_0x57f939[_0x085e('0x31')];if(!_0x1d752b['query'][_0x085e('0x37')](_0x085e('0x38'))){_0x3a78ad[_0x085e('0x20')]=qs[_0x085e('0x20')](_0x1d752b[_0x085e('0x32')][_0x085e('0x20')]);_0x3a78ad[_0x085e('0x1e')]=qs[_0x085e('0x1e')](_0x1d752b[_0x085e('0x32')][_0x085e('0x1e')]);}_0x3a78ad['order']=qs[_0x085e('0x39')](_0x1d752b[_0x085e('0x32')][_0x085e('0x39')]);_0x3a78ad[_0x085e('0x3a')]=qs['filters'](_[_0x085e('0x5b')](_0x1d752b['query'],_0x57f939[_0x085e('0x33')]));_0x3a78ad[_0x085e('0x3a')][_0x085e('0x5c')]=_0x202be9['id'];if(_0x1d752b[_0x085e('0x32')]['filter']){_0x3a78ad['where']=_[_0x085e('0x3c')](_0x3a78ad['where'],{'$or':_['map'](_0x3a78ad[_0x085e('0x36')],function(_0x19c0fb){var _0x216a56={};_0x216a56[_0x19c0fb]={'$like':'%'+_0x1d752b[_0x085e('0x32')][_0x085e('0x3b')]+'%'};return _0x216a56;})});}_0x3a78ad=_['merge']({},_0x3a78ad,_0x1d752b['options']);return db[_0x085e('0x60')][_0x085e('0x40')]({'where':_0x3a78ad[_0x085e('0x3a')]})['then'](function(_0x134f55){_0x5e6a97[_0x085e('0x40')]=_0x134f55;if(_0x1d752b[_0x085e('0x32')]['includeAll']){_0x3a78ad[_0x085e('0x47')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x085e('0x5d')](_0x3a78ad);})[_0x085e('0x24')](function(_0x1e5a62){_0x5e6a97[_0x085e('0x42')]=_0x1e5a62;return _0x5e6a97;});}})[_0x085e('0x24')](respondWithFilteredResult(_0x2455bb,_0x3a78ad))[_0x085e('0x49')](handleError(_0x2455bb,null));};exports['getHopperFinals']=function(_0xd6e167,_0x5cc811,_0x2423e0){var _0x112d92={'raw':!![],'where':{}};var _0x2667fd={};var _0x10628e={'count':0x0,'rows':[]};return db[_0x085e('0x2e')]['findOne']({'where':{'id':_0xd6e167[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x5cc811,null))['then'](function(_0x432e50){if(_0x432e50){_0x2667fd[_0x085e('0x31')]=_[_0x085e('0x45')](db[_0x085e('0x61')][_0x085e('0x46')]);_0x2667fd[_0x085e('0x32')]=_['keys'](_0xd6e167['query']);_0x2667fd[_0x085e('0x33')]=_['intersection'](_0x2667fd['model'],_0x2667fd['query']);_0x112d92[_0x085e('0x36')]=_['intersection'](_0x2667fd[_0x085e('0x31')],qs[_0x085e('0x35')](_0xd6e167[_0x085e('0x32')]['fields']));_0x112d92['attributes']=_0x112d92[_0x085e('0x36')][_0x085e('0x52')]?_0x112d92[_0x085e('0x36')]:_0x2667fd['model'];if(!_0xd6e167[_0x085e('0x32')][_0x085e('0x37')](_0x085e('0x38'))){_0x112d92['limit']=qs[_0x085e('0x20')](_0xd6e167[_0x085e('0x32')][_0x085e('0x20')]);_0x112d92['offset']=qs[_0x085e('0x1e')](_0xd6e167[_0x085e('0x32')][_0x085e('0x1e')]);}_0x112d92['order']=qs[_0x085e('0x39')](_0xd6e167[_0x085e('0x32')][_0x085e('0x39')]);_0x112d92['where']=qs['filters'](_[_0x085e('0x5b')](_0xd6e167['query'],_0x2667fd['filters']));_0x112d92[_0x085e('0x3a')]['CampaignId']=_0x432e50['id'];if(_0xd6e167['query'][_0x085e('0x3b')]){_0x112d92[_0x085e('0x3a')]=_['merge'](_0x112d92['where'],{'$or':_['map'](_0x112d92[_0x085e('0x36')],function(_0x5a7a7c){var _0x4c987b={};_0x4c987b[_0x5a7a7c]={'$like':'%'+_0xd6e167[_0x085e('0x32')][_0x085e('0x3b')]+'%'};return _0x4c987b;})});}_0x112d92=_[_0x085e('0x3c')]({},_0x112d92,_0xd6e167[_0x085e('0x3f')]);return db['CmHopperFinal'][_0x085e('0x40')]({'where':_0x112d92[_0x085e('0x3a')]})[_0x085e('0x24')](function(_0x120688){_0x10628e[_0x085e('0x40')]=_0x120688;if(_0xd6e167['query']['includeAll']){_0x112d92['include']=[{'all':!![]}];}return db[_0x085e('0x61')]['findAll'](_0x112d92);})[_0x085e('0x24')](function(_0x52243e){_0x10628e['rows']=_0x52243e;return _0x10628e;});}})['then'](respondWithFilteredResult(_0x5cc811,_0x112d92))['catch'](handleError(_0x5cc811,null));};exports['getHopperBlacks']=function(_0x19bc52,_0xf3dc94,_0x3b8a05){var _0xc34f3f={'raw':!![],'where':{}};var _0x55be06={};var _0xb65cbd={'count':0x0,'rows':[]};return db['Campaign'][_0x085e('0x5f')]({'where':{'id':_0x19bc52[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0xf3dc94,null))[_0x085e('0x24')](function(_0x14ba51){if(_0x14ba51){_0x55be06[_0x085e('0x31')]=_[_0x085e('0x45')](db[_0x085e('0x62')][_0x085e('0x46')]);_0x55be06['query']=_[_0x085e('0x45')](_0x19bc52[_0x085e('0x32')]);_0x55be06[_0x085e('0x33')]=_[_0x085e('0x34')](_0x55be06['model'],_0x55be06[_0x085e('0x32')]);_0xc34f3f[_0x085e('0x36')]=_[_0x085e('0x34')](_0x55be06[_0x085e('0x31')],qs['fields'](_0x19bc52['query']['fields']));_0xc34f3f[_0x085e('0x36')]=_0xc34f3f[_0x085e('0x36')]['length']?_0xc34f3f[_0x085e('0x36')]:_0x55be06['model'];if(!_0x19bc52[_0x085e('0x32')][_0x085e('0x37')](_0x085e('0x38'))){_0xc34f3f[_0x085e('0x20')]=qs[_0x085e('0x20')](_0x19bc52[_0x085e('0x32')][_0x085e('0x20')]);_0xc34f3f[_0x085e('0x1e')]=qs['offset'](_0x19bc52[_0x085e('0x32')][_0x085e('0x1e')]);}_0xc34f3f[_0x085e('0x5a')]=qs[_0x085e('0x39')](_0x19bc52[_0x085e('0x32')][_0x085e('0x39')]);_0xc34f3f[_0x085e('0x3a')]=qs['filters'](_[_0x085e('0x5b')](_0x19bc52[_0x085e('0x32')],_0x55be06[_0x085e('0x33')]));_0xc34f3f[_0x085e('0x3a')][_0x085e('0x5c')]=_0x14ba51['id'];if(_0x19bc52['query'][_0x085e('0x3b')]){_0xc34f3f[_0x085e('0x3a')]=_[_0x085e('0x3c')](_0xc34f3f[_0x085e('0x3a')],{'$or':_[_0x085e('0x2d')](_0xc34f3f[_0x085e('0x36')],function(_0x116a78){var _0x55b8a4={};_0x55b8a4[_0x116a78]={'$like':'%'+_0x19bc52[_0x085e('0x32')][_0x085e('0x3b')]+'%'};return _0x55b8a4;})});}_0xc34f3f=_['merge']({},_0xc34f3f,_0x19bc52[_0x085e('0x3f')]);return db['CmHopperBlack'][_0x085e('0x40')]({'where':_0xc34f3f[_0x085e('0x3a')]})[_0x085e('0x24')](function(_0x31d573){_0xb65cbd[_0x085e('0x40')]=_0x31d573;if(_0x19bc52['query'][_0x085e('0x41')]){_0xc34f3f[_0x085e('0x47')]=[{'all':!![]}];}return db[_0x085e('0x62')][_0x085e('0x5d')](_0xc34f3f);})['then'](function(_0x48d001){_0xb65cbd[_0x085e('0x42')]=_0x48d001;return _0xb65cbd;});}})[_0x085e('0x24')](respondWithFilteredResult(_0xf3dc94,_0xc34f3f))[_0x085e('0x49')](handleError(_0xf3dc94,null));};exports[_0x085e('0x63')]=function(_0xfef94d,_0x4d55e5,_0x3895ed){var _0x568040={};var _0x323bd9={};var _0x392768;var _0xa23572;return db[_0x085e('0x2e')]['findOne']({'where':{'id':_0xfef94d[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x4d55e5,null))[_0x085e('0x24')](function(_0x136888){if(_0x136888){_0x392768=_0x136888;_0x323bd9[_0x085e('0x31')]=_[_0x085e('0x45')](db[_0x085e('0x64')][_0x085e('0x46')]);_0x323bd9[_0x085e('0x32')]=_[_0x085e('0x45')](_0xfef94d[_0x085e('0x32')]);_0x323bd9[_0x085e('0x33')]=_[_0x085e('0x34')](_0x323bd9[_0x085e('0x31')],_0x323bd9[_0x085e('0x32')]);_0x568040[_0x085e('0x36')]=_[_0x085e('0x34')](_0x323bd9['model'],qs[_0x085e('0x35')](_0xfef94d['query'][_0x085e('0x35')]));_0x568040[_0x085e('0x36')]=_0x568040[_0x085e('0x36')]['length']?_0x568040[_0x085e('0x36')]:_0x323bd9['model'];_0x568040[_0x085e('0x5a')]=qs[_0x085e('0x39')](_0xfef94d[_0x085e('0x32')][_0x085e('0x39')]);_0x568040[_0x085e('0x3a')]=qs['filters'](_[_0x085e('0x5b')](_0xfef94d[_0x085e('0x32')],_0x323bd9[_0x085e('0x33')]));if(_0xfef94d['query'][_0x085e('0x3b')]){_0x568040[_0x085e('0x3a')]=_[_0x085e('0x3c')](_0x568040[_0x085e('0x3a')],{'$or':_[_0x085e('0x2d')](_0x568040[_0x085e('0x36')],function(_0x37d9c9){var _0x44c863={};_0x44c863[_0x37d9c9]={'$like':'%'+_0xfef94d[_0x085e('0x32')][_0x085e('0x3b')]+'%'};return _0x44c863;})});}_0x568040=_[_0x085e('0x3c')]({},_0x568040,_0xfef94d[_0x085e('0x3f')]);return _0x392768[_0x085e('0x63')](_0x568040);}})['then'](function(_0x107f15){if(_0x107f15){_0xa23572=_0x107f15['length'];if(!_0xfef94d[_0x085e('0x32')][_0x085e('0x37')](_0x085e('0x38'))){_0x568040[_0x085e('0x20')]=qs[_0x085e('0x20')](_0xfef94d[_0x085e('0x32')]['limit']);_0x568040['offset']=qs[_0x085e('0x1e')](_0xfef94d[_0x085e('0x32')][_0x085e('0x1e')]);}return _0x392768[_0x085e('0x63')](_0x568040);}})[_0x085e('0x24')](function(_0x1a4e06){if(_0x1a4e06){return _0x1a4e06?{'count':_0xa23572,'rows':_0x1a4e06}:null;}})[_0x085e('0x24')](respondWithResult(_0x4d55e5,null))[_0x085e('0x49')](handleError(_0x4d55e5,null));};exports[_0x085e('0x65')]=function(_0xcec444,_0x4d75d4,_0x19289a){var _0x4ad0bb,_0x32e16c;return db[_0x085e('0x2e')][_0x085e('0x48')]({'where':{'id':_0xcec444[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x4d75d4,null))[_0x085e('0x24')](function(_0x52653d){if(_0x52653d){_0x32e16c=_0x52653d;return _0x52653d[_0x085e('0x65')](_0xcec444[_0x085e('0x4b')][_0x085e('0x66')],_[_0x085e('0x53')](_0xcec444[_0x085e('0x4b')],[_0x085e('0x66'),'id'])||{});}return null;})[_0x085e('0x67')](function(_0x6a0dbc){var _0x584776;_0x4ad0bb=_0x6a0dbc||[];var _0x57a741=[];if(_0x6a0dbc){for(var _0x166604=0x0;_0x166604<_0x6a0dbc[_0x085e('0x52')];_0x166604+=0x1){var _0x4c12aa=_0x6a0dbc[_0x166604][_0x085e('0x26')]({'plain':!![]});_0x32e16c[_0x085e('0x68')]=_0xcec444[_0x085e('0x4b')][_0x085e('0x68')]?_0xcec444[_0x085e('0x4b')][_0x085e('0x68')]:_0x32e16c[_0x085e('0x68')];switch(_0x32e16c['dialCheckDuplicateType']){case _0x085e('0x69'):_0x584776=squel[_0x085e('0x6a')]()[_0x085e('0x6b')](_0x085e('0x6c'))[_0x085e('0x6d')]([_0x085e('0x6e'),_0x085e('0x6f'),'ContactId',_0x085e('0x70'),_0x085e('0x5c'),_0x085e('0x54'),_0x085e('0x55')],squel[_0x085e('0x71')]()['field']('phone',_0x085e('0x6e'))[_0x085e('0x72')]('NOW()','scheduledAt')[_0x085e('0x72')]('id',_0x085e('0x73'))['field'](_0x4c12aa[_0x085e('0x74')][_0x085e('0x75')](),_0x085e('0x70'))['field'](_0xcec444[_0x085e('0x44')]['id'][_0x085e('0x75')](),_0x085e('0x5c'))[_0x085e('0x72')](_0x085e('0x76'),'createdAt')[_0x085e('0x72')](_0x085e('0x76'),_0x085e('0x55'))['from'](_0x085e('0x77'))[_0x085e('0x3a')](_0x085e('0x78'))[_0x085e('0x3a')](_0x085e('0x79'),_0x4c12aa[_0x085e('0x74')]['toString']())[_0x085e('0x3a')](_0x085e('0x7a'))[_0x085e('0x3a')](_0x085e('0x7b'),squel[_0x085e('0x71')]()[_0x085e('0x72')](_0x085e('0x7c'))['from'](_0x085e('0x7d'))[_0x085e('0x3a')](_0x085e('0x7e'),_0xcec444[_0x085e('0x44')]['id'][_0x085e('0x75')]()))[_0x085e('0x3a')](_0x085e('0x7b'),squel['select']()['field'](_0x085e('0x7f'))[_0x085e('0x80')]('cm_hopper')[_0x085e('0x3a')](_0x085e('0x7e'),_0xcec444['params']['id'][_0x085e('0x75')]())))['toString']();break;case _0x085e('0x81'):_0x584776=squel[_0x085e('0x6a')]()[_0x085e('0x6b')]('cm_hopper')[_0x085e('0x6d')]([_0x085e('0x6e'),_0x085e('0x6f'),_0x085e('0x73'),'ListId','CampaignId',_0x085e('0x54'),_0x085e('0x55')],squel[_0x085e('0x71')]()[_0x085e('0x72')](_0x085e('0x6e'),_0x085e('0x6e'))[_0x085e('0x72')](_0x085e('0x76'),_0x085e('0x6f'))[_0x085e('0x72')]('id','ContactId')[_0x085e('0x72')](_0x4c12aa[_0x085e('0x74')]['toString'](),_0x085e('0x70'))[_0x085e('0x72')](_0xcec444['params']['id'][_0x085e('0x75')](),_0x085e('0x5c'))[_0x085e('0x72')](_0x085e('0x76'),_0x085e('0x54'))[_0x085e('0x72')](_0x085e('0x76'),'updatedAt')['from']('cm_contacts')[_0x085e('0x3a')]('deletedAt\x20IS\x20NULL')[_0x085e('0x3a')](_0x085e('0x79'),_0x4c12aa[_0x085e('0x74')][_0x085e('0x75')]())[_0x085e('0x3a')](_0x085e('0x7a'))[_0x085e('0x3a')](_0x085e('0x7b'),squel[_0x085e('0x71')]()[_0x085e('0x72')](_0x085e('0x7f'))[_0x085e('0x80')](_0x085e('0x6c'))[_0x085e('0x3a')]('CampaignId\x20=\x20?',_0xcec444[_0x085e('0x44')]['id']['toString']())))[_0x085e('0x75')]();break;default:_0x584776=squel[_0x085e('0x6a')]()[_0x085e('0x6b')](_0x085e('0x6c'))[_0x085e('0x6d')]([_0x085e('0x6e'),'scheduledAt',_0x085e('0x73'),_0x085e('0x70'),_0x085e('0x5c'),_0x085e('0x54'),_0x085e('0x55')],squel[_0x085e('0x71')]()['field'](_0x085e('0x6e'),_0x085e('0x6e'))[_0x085e('0x72')](_0x085e('0x76'),_0x085e('0x6f'))[_0x085e('0x72')]('id','ContactId')['field'](_0x4c12aa[_0x085e('0x74')][_0x085e('0x75')](),_0x085e('0x70'))[_0x085e('0x72')](_0xcec444[_0x085e('0x44')]['id'][_0x085e('0x75')](),_0x085e('0x5c'))['field'](_0x085e('0x76'),_0x085e('0x54'))[_0x085e('0x72')](_0x085e('0x76'),_0x085e('0x55'))['from'](_0x085e('0x77'))['where'](_0x085e('0x78'))['where'](_0x085e('0x79'),_0x4c12aa['CmListId']['toString']())[_0x085e('0x3a')](_0x085e('0x7a')))[_0x085e('0x75')]();}_0x57a741[_0x085e('0x82')](db[_0x085e('0x83')][_0x085e('0x32')](_0x584776));}return BPromise[_0x085e('0x84')](_0x57a741);}})['then'](function(){return _0x4ad0bb;})['then'](respondWithResult(_0x4d75d4,null))['catch'](handleError(_0x4d75d4,null));};exports[_0x085e('0x85')]=function(_0x2b82a7,_0x1ce355,_0x5a9026){return db[_0x085e('0x2e')]['find']({'where':{'id':_0x2b82a7[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x1ce355,null))[_0x085e('0x24')](function(_0x1c1237){if(_0x1c1237){return _0x1c1237['removeLists'](_0x2b82a7[_0x085e('0x32')][_0x085e('0x66')]);}})['then'](function(_0x1076dd){if(_0x1076dd){return db[_0x085e('0x59')][_0x085e('0x25')]({'where':{'ListId':_0x2b82a7[_0x085e('0x32')][_0x085e('0x66')],'CampaignId':_0x2b82a7[_0x085e('0x44')]['id']}})[_0x085e('0x24')](function(){return _0x1076dd;});}})['then'](respondWithStatusCode(_0x1ce355,null))[_0x085e('0x49')](handleError(_0x1ce355,null));};exports[_0x085e('0x86')]=function(_0x5314a2,_0x34ae3c,_0x4c717f){var _0x39cc28={};var _0x57b6be={};var _0xe1050;var _0x2d642d;return db[_0x085e('0x2e')][_0x085e('0x5f')]({'where':{'id':_0x5314a2[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x34ae3c,null))[_0x085e('0x24')](function(_0x3d586d){if(_0x3d586d){_0xe1050=_0x3d586d;_0x57b6be[_0x085e('0x31')]=_[_0x085e('0x45')](db[_0x085e('0x64')][_0x085e('0x46')]);_0x57b6be[_0x085e('0x32')]=_[_0x085e('0x45')](_0x5314a2[_0x085e('0x32')]);_0x57b6be['filters']=_[_0x085e('0x34')](_0x57b6be[_0x085e('0x31')],_0x57b6be['query']);_0x39cc28[_0x085e('0x36')]=_[_0x085e('0x34')](_0x57b6be[_0x085e('0x31')],qs[_0x085e('0x35')](_0x5314a2[_0x085e('0x32')][_0x085e('0x35')]));_0x39cc28['attributes']=_0x39cc28[_0x085e('0x36')]['length']?_0x39cc28[_0x085e('0x36')]:_0x57b6be['model'];_0x39cc28[_0x085e('0x5a')]=qs[_0x085e('0x39')](_0x5314a2['query'][_0x085e('0x39')]);_0x39cc28[_0x085e('0x3a')]=qs[_0x085e('0x33')](_[_0x085e('0x5b')](_0x5314a2['query'],_0x57b6be[_0x085e('0x33')]));if(_0x5314a2[_0x085e('0x32')][_0x085e('0x3b')]){_0x39cc28['where']=_[_0x085e('0x3c')](_0x39cc28['where'],{'$or':_[_0x085e('0x2d')](_0x39cc28[_0x085e('0x36')],function(_0x4f5b67){var _0x2ce799={};_0x2ce799[_0x4f5b67]={'$like':'%'+_0x5314a2['query'][_0x085e('0x3b')]+'%'};return _0x2ce799;})});}_0x39cc28=_[_0x085e('0x3c')]({},_0x39cc28,_0x5314a2[_0x085e('0x3f')]);return _0xe1050[_0x085e('0x86')](_0x39cc28);}})['then'](function(_0x3c43cc){if(_0x3c43cc){_0x2d642d=_0x3c43cc[_0x085e('0x52')];if(!_0x5314a2['query'][_0x085e('0x37')]('nolimit')){_0x39cc28[_0x085e('0x20')]=qs[_0x085e('0x20')](_0x5314a2['query']['limit']);_0x39cc28['offset']=qs[_0x085e('0x1e')](_0x5314a2['query'][_0x085e('0x1e')]);}return _0xe1050[_0x085e('0x86')](_0x39cc28);}})['then'](function(_0x1466f5){if(_0x1466f5){return _0x1466f5?{'count':_0x2d642d,'rows':_0x1466f5}:null;}})[_0x085e('0x24')](respondWithResult(_0x34ae3c,null))[_0x085e('0x49')](handleError(_0x34ae3c,null));};exports['addBlackLists']=function(_0x2d9a58,_0x3d8f1d,_0x4eab8e){var _0x19cf86,_0x35ddd8;return db['Campaign'][_0x085e('0x48')]({'where':{'id':_0x2d9a58['params']['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x3d8f1d,null))[_0x085e('0x24')](function(_0x4d1a64){if(_0x4d1a64){_0x35ddd8=_0x4d1a64;return _0x4d1a64[_0x085e('0x87')](_0x2d9a58[_0x085e('0x4b')][_0x085e('0x66')],_[_0x085e('0x53')](_0x2d9a58[_0x085e('0x4b')],['ids','id'])||{});}return null;})[_0x085e('0x67')](function(_0x52b87a){var _0x1277b8;_0x19cf86=_0x52b87a||[];var _0x1b84b9=[];if(_0x52b87a){for(var _0x7f31be=0x0;_0x7f31be<_0x52b87a[_0x085e('0x52')];_0x7f31be+=0x1){var _0x503cbb=_0x52b87a[_0x7f31be][_0x085e('0x26')]({'plain':!![]});_0x1277b8=squel['insert']()[_0x085e('0x6b')](_0x085e('0x88'))[_0x085e('0x6d')]([_0x085e('0x6e'),_0x085e('0x73'),'ListId',_0x085e('0x5c'),_0x085e('0x54'),_0x085e('0x55')],squel[_0x085e('0x71')]()['field'](_0x085e('0x6e'),_0x085e('0x6e'))[_0x085e('0x72')]('id',_0x085e('0x73'))['field'](_0x503cbb[_0x085e('0x74')]['toString'](),'ListId')[_0x085e('0x72')](_0x2d9a58[_0x085e('0x44')]['id'][_0x085e('0x75')](),_0x085e('0x5c'))['field']('NOW()',_0x085e('0x54'))[_0x085e('0x72')](_0x085e('0x76'),_0x085e('0x55'))[_0x085e('0x80')](_0x085e('0x77'))[_0x085e('0x3a')]('deletedAt\x20IS\x20NULL')[_0x085e('0x3a')]('ListId\x20=\x20?',_0x503cbb[_0x085e('0x74')][_0x085e('0x75')]())[_0x085e('0x3a')](_0x085e('0x7a')))['toString']();_0x1b84b9[_0x085e('0x82')](db[_0x085e('0x83')][_0x085e('0x32')](_0x1277b8));}return BPromise[_0x085e('0x84')](_0x1b84b9);}})[_0x085e('0x24')](function(){return _0x19cf86;})[_0x085e('0x24')](respondWithResult(_0x3d8f1d,null))[_0x085e('0x49')](handleError(_0x3d8f1d,null));};exports[_0x085e('0x89')]=function(_0x4a86e5,_0x36256c,_0x58a5cc){return db['Campaign'][_0x085e('0x48')]({'where':{'id':_0x4a86e5[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x36256c,null))[_0x085e('0x24')](function(_0x5efef2){if(_0x5efef2){return _0x5efef2[_0x085e('0x89')](_0x4a86e5[_0x085e('0x32')][_0x085e('0x66')]);}})[_0x085e('0x24')](function(_0x50e6ba){if(_0x50e6ba){return db['CmHopperBlack'][_0x085e('0x25')]({'where':{'ListId':_0x4a86e5[_0x085e('0x32')][_0x085e('0x66')],'CampaignId':_0x4a86e5[_0x085e('0x44')]['id']}})[_0x085e('0x24')](function(){return _0x50e6ba;});}})[_0x085e('0x24')](respondWithStatusCode(_0x36256c,null))[_0x085e('0x49')](handleError(_0x36256c,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index a58c1da..35fe5db 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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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':'campaigns','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 5bbc1e3..87199cf 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 _0x2121=['request\x20sent','stringify','error','message','GetCampaign','Campaign','options','raw','where','limit','include','map','model','attributes','debug','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s'];(function(_0x4b1cb8,_0x33d977){var _0x25d6ed=function(_0x21134c){while(--_0x21134c){_0x4b1cb8['push'](_0x4b1cb8['shift']());}};_0x25d6ed(++_0x33d977);}(_0x2121,0x1b4));var _0x1212=function(_0x25986d,_0x4ea0b6){_0x25986d=_0x25986d-0x0;var _0x1a694b=_0x2121[_0x25986d];return _0x1a694b;};'use strict';var _=require(_0x1212('0x0'));var util=require(_0x1212('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1212('0x2'));var fs=require('fs');var Redis=require(_0x1212('0x3'));var db=require(_0x1212('0x4'))['db'];var utils=require(_0x1212('0x5'));var logger=require(_0x1212('0x6'))('rpc');var config=require(_0x1212('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1212('0x8')][_0x1212('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20fadc,_0x1b1ef5,_0x233a53){return new BPromise(function(_0x642ed5,_0x4a3d2a){return client[_0x1212('0xa')](_0x20fadc,_0x233a53)[_0x1212('0xb')](function(_0x434d23){logger[_0x1212('0xc')](_0x1212('0xd'),_0x1b1ef5,_0x1212('0xe'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x1b1ef5,_0x1212('0xe'),JSON[_0x1212('0xf')](_0x434d23));if(_0x434d23[_0x1212('0x10')]){if(_0x434d23[_0x1212('0x10')]['code']===0x1f4){logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);return _0x4a3d2a(_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);}logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);return _0x642ed5(_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);}else{logger[_0x1212('0xc')](_0x1212('0xd'),_0x1b1ef5,_0x1212('0xe'));_0x642ed5(_0x434d23['result']['message']);}})['catch'](function(_0x3cfe21){logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x3cfe21);_0x4a3d2a(_0x3cfe21);});});}exports[_0x1212('0x12')]=function(_0x3cf284){var _0x3face0=this;return new Promise(function(_0xb0dc88,_0x22eefb){return db[_0x1212('0x13')]['findAll']({'raw':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')][_0x1212('0x15')]===undefined?!![]:![]:!![],'where':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')][_0x1212('0x16')]||null:null,'attributes':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')]['attributes']||null:null,'limit':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')][_0x1212('0x17')]||null:null,'include':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')][_0x1212('0x18')]?_[_0x1212('0x19')](_0x3cf284[_0x1212('0x14')]['include'],function(_0x58ab5b){return{'model':db[_0x58ab5b['model']],'as':_0x58ab5b['as'],'attributes':_0x58ab5b['attributes'],'include':_0x58ab5b['include']?_[_0x1212('0x19')](_0x58ab5b[_0x1212('0x18')],function(_0x4c32a7){return{'model':db[_0x4c32a7[_0x1212('0x1a')]],'as':_0x4c32a7['as'],'attributes':_0x4c32a7[_0x1212('0x1b')],'include':_0x4c32a7['include']?_[_0x1212('0x19')](_0x4c32a7[_0x1212('0x18')],function(_0x4630b4){return{'model':db[_0x4630b4[_0x1212('0x1a')]],'as':_0x4630b4['as'],'attributes':_0x4630b4[_0x1212('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1212('0xb')](function(_0x2750b0){logger[_0x1212('0xc')]('GetCampaign',_0x3cf284);logger[_0x1212('0x1c')](_0x1212('0x12'),_0x3cf284,JSON[_0x1212('0xf')](_0x2750b0));_0xb0dc88(_0x2750b0);})[_0x1212('0x1d')](function(_0x17d0f6){logger[_0x1212('0x10')](_0x1212('0x12'),_0x17d0f6[_0x1212('0x11')],_0x3cf284);_0x22eefb(_0x3face0[_0x1212('0x10')](0x1f4,_0x17d0f6[_0x1212('0x11')]));});});}; \ No newline at end of file +var _0x96a2=['jayson/promise','client','http','request','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','Campaign,\x20%s,\x20%s','message','GetCampaign','findAll','options','where','attributes','limit','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x12c8f7,_0x38edf6){var _0x43c77a=function(_0x18cb2f){while(--_0x18cb2f){_0x12c8f7['push'](_0x12c8f7['shift']());}};_0x43c77a(++_0x38edf6);}(_0x96a2,0x96));var _0x296a=function(_0x3fddda,_0x4d0ca0){_0x3fddda=_0x3fddda-0x0;var _0x5ba097=_0x96a2[_0x3fddda];return _0x5ba097;};'use strict';var _=require(_0x296a('0x0'));var util=require('util');var moment=require(_0x296a('0x1'));var BPromise=require(_0x296a('0x2'));var rs=require(_0x296a('0x3'));var fs=require('fs');var Redis=require(_0x296a('0x4'));var db=require(_0x296a('0x5'))['db'];var utils=require(_0x296a('0x6'));var logger=require(_0x296a('0x7'))(_0x296a('0x8'));var config=require(_0x296a('0x9'));var jayson=require(_0x296a('0xa'));var client=jayson[_0x296a('0xb')][_0x296a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4eb919,_0x273b83,_0x3c3486){return new BPromise(function(_0x3a2b44,_0x17d4d2){return client[_0x296a('0xd')](_0x4eb919,_0x3c3486)['then'](function(_0x307644){logger[_0x296a('0xe')]('Campaign,\x20%s,\x20%s',_0x273b83,_0x296a('0xf'));logger[_0x296a('0x10')](_0x296a('0x11'),_0x273b83,_0x296a('0xf'),JSON[_0x296a('0x12')](_0x307644));if(_0x307644[_0x296a('0x13')]){if(_0x307644[_0x296a('0x13')]['code']===0x1f4){logger[_0x296a('0x13')](_0x296a('0x14'),_0x273b83,_0x307644[_0x296a('0x13')][_0x296a('0x15')]);return _0x17d4d2(_0x307644[_0x296a('0x13')]['message']);}logger[_0x296a('0x13')](_0x296a('0x14'),_0x273b83,_0x307644['error'][_0x296a('0x15')]);return _0x3a2b44(_0x307644[_0x296a('0x13')][_0x296a('0x15')]);}else{logger[_0x296a('0xe')](_0x296a('0x14'),_0x273b83,_0x296a('0xf'));_0x3a2b44(_0x307644['result'][_0x296a('0x15')]);}})['catch'](function(_0x55864e){logger['error'](_0x296a('0x14'),_0x273b83,_0x55864e);_0x17d4d2(_0x55864e);});});}exports[_0x296a('0x16')]=function(_0x2b82d6){var _0x55295f=this;return new Promise(function(_0x51ba98,_0x3e72fa){return db['Campaign'][_0x296a('0x17')]({'raw':_0x2b82d6[_0x296a('0x18')]?_0x2b82d6[_0x296a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2b82d6[_0x296a('0x18')]?_0x2b82d6[_0x296a('0x18')][_0x296a('0x19')]||null:null,'attributes':_0x2b82d6['options']?_0x2b82d6[_0x296a('0x18')][_0x296a('0x1a')]||null:null,'limit':_0x2b82d6['options']?_0x2b82d6['options'][_0x296a('0x1b')]||null:null,'include':_0x2b82d6[_0x296a('0x18')]?_0x2b82d6[_0x296a('0x18')][_0x296a('0x1c')]?_[_0x296a('0x1d')](_0x2b82d6[_0x296a('0x18')][_0x296a('0x1c')],function(_0x2cf007){return{'model':db[_0x2cf007[_0x296a('0x1e')]],'as':_0x2cf007['as'],'attributes':_0x2cf007[_0x296a('0x1a')],'include':_0x2cf007[_0x296a('0x1c')]?_[_0x296a('0x1d')](_0x2cf007[_0x296a('0x1c')],function(_0xf6b922){return{'model':db[_0xf6b922[_0x296a('0x1e')]],'as':_0xf6b922['as'],'attributes':_0xf6b922['attributes'],'include':_0xf6b922[_0x296a('0x1c')]?_[_0x296a('0x1d')](_0xf6b922['include'],function(_0x2c4bed){return{'model':db[_0x2c4bed[_0x296a('0x1e')]],'as':_0x2c4bed['as'],'attributes':_0x2c4bed[_0x296a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24b280){logger[_0x296a('0xe')]('GetCampaign',_0x2b82d6);logger['debug'](_0x296a('0x16'),_0x2b82d6,JSON[_0x296a('0x12')](_0x24b280));_0x51ba98(_0x24b280);})[_0x296a('0x1f')](function(_0x583548){logger['error'](_0x296a('0x16'),_0x583548[_0x296a('0x15')],_0x2b82d6);_0x3e72fa(_0x55295f[_0x296a('0x13')](0x1f4,_0x583548[_0x296a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 04c6066..2a0ecfa 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 _0xd93a=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','addLists','addBlackLists','put','update','destroy','delete','exports','util','path'];(function(_0x127abd,_0xabc647){var _0x19b3aa=function(_0x2a4bcc){while(--_0x2a4bcc){_0x127abd['push'](_0x127abd['shift']());}};_0x19b3aa(++_0xabc647);}(_0xd93a,0xa3));var _0xad93=function(_0x2e5687,_0x3ff69a){_0x2e5687=_0x2e5687-0x0;var _0x5891d2=_0xd93a[_0x2e5687];return _0x5891d2;};'use strict';var multer=require('multer');var util=require(_0xad93('0x0'));var path=require(_0xad93('0x1'));var timeout=require(_0xad93('0x2'));var express=require(_0xad93('0x3'));var router=express[_0xad93('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xad93('0x5'));var interaction=require(_0xad93('0x6'));var config=require(_0xad93('0x7'));var controller=require(_0xad93('0x8'));router[_0xad93('0x9')]('/',auth[_0xad93('0xa')](),controller[_0xad93('0xb')]);router['get'](_0xad93('0xc'),auth[_0xad93('0xa')](),controller[_0xad93('0xd')]);router['get'](_0xad93('0xe'),auth[_0xad93('0xa')](),controller[_0xad93('0xf')]);router['get'](_0xad93('0x10'),auth['isAuthenticated'](),controller[_0xad93('0x11')]);router[_0xad93('0x9')](_0xad93('0x12'),auth['isAuthenticated'](),controller[_0xad93('0x13')]);router['get'](_0xad93('0x14'),auth[_0xad93('0xa')](),controller[_0xad93('0x15')]);router[_0xad93('0x9')](_0xad93('0x16'),auth[_0xad93('0xa')](),controller['getLists']);router['get'](_0xad93('0x17'),auth[_0xad93('0xa')](),controller[_0xad93('0x18')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xad93('0x19')]('/:id/clone',auth[_0xad93('0xa')](),controller['clone']);router['post']('/:id/lists',auth[_0xad93('0xa')](),controller[_0xad93('0x1a')]);router[_0xad93('0x19')](_0xad93('0x17'),auth['isAuthenticated'](),controller[_0xad93('0x1b')]);router[_0xad93('0x1c')]('/:id',auth[_0xad93('0xa')](),controller[_0xad93('0x1d')]);router['delete'](_0xad93('0xc'),auth[_0xad93('0xa')](),controller[_0xad93('0x1e')]);router[_0xad93('0x1f')]('/:id/lists',auth[_0xad93('0xa')](),controller['removeLists']);router[_0xad93('0x1f')]('/:id/blacklists',auth[_0xad93('0xa')](),controller['removeBlackLists']);module[_0xad93('0x20')]=router; \ No newline at end of file +var _0x077a=['getHopperHistories','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','/:id','update','delete','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','getHoppers','/:id/hopper_histories'];(function(_0x11d230,_0x4542ab){var _0x488064=function(_0x2f8f4f){while(--_0x2f8f4f){_0x11d230['push'](_0x11d230['shift']());}};_0x488064(++_0x4542ab);}(_0x077a,0x1f2));var _0xa077=function(_0x404bda,_0x1c2365){_0x404bda=_0x404bda-0x0;var _0x4b5a6e=_0x077a[_0x404bda];return _0x4b5a6e;};'use strict';var multer=require(_0xa077('0x0'));var util=require('util');var path=require(_0xa077('0x1'));var timeout=require(_0xa077('0x2'));var express=require(_0xa077('0x3'));var router=express[_0xa077('0x4')]();var fs_extra=require(_0xa077('0x5'));var auth=require(_0xa077('0x6'));var interaction=require(_0xa077('0x7'));var config=require(_0xa077('0x8'));var controller=require('./campaign.controller');router[_0xa077('0x9')]('/',auth[_0xa077('0xa')](),controller['index']);router['get']('/:id',auth[_0xa077('0xa')](),controller[_0xa077('0xb')]);router['get']('/:id/hoppers',auth[_0xa077('0xa')](),controller[_0xa077('0xc')]);router[_0xa077('0x9')](_0xa077('0xd'),auth[_0xa077('0xa')](),controller[_0xa077('0xe')]);router[_0xa077('0x9')]('/:id/hopper_finals',auth[_0xa077('0xa')](),controller[_0xa077('0xf')]);router[_0xa077('0x9')](_0xa077('0x10'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xa077('0x9')](_0xa077('0x11'),auth[_0xa077('0xa')](),controller[_0xa077('0x12')]);router[_0xa077('0x9')](_0xa077('0x13'),auth[_0xa077('0xa')](),controller[_0xa077('0x14')]);router[_0xa077('0x15')]('/',auth[_0xa077('0xa')](),controller[_0xa077('0x16')]);router[_0xa077('0x15')](_0xa077('0x17'),auth[_0xa077('0xa')](),controller[_0xa077('0x18')]);router[_0xa077('0x15')](_0xa077('0x11'),auth[_0xa077('0xa')](),controller[_0xa077('0x19')]);router[_0xa077('0x15')](_0xa077('0x13'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0xa077('0x1a')](_0xa077('0x1b'),auth[_0xa077('0xa')](),controller[_0xa077('0x1c')]);router[_0xa077('0x1d')]('/:id',auth[_0xa077('0xa')](),controller['destroy']);router[_0xa077('0x1d')](_0xa077('0x11'),auth[_0xa077('0xa')](),controller['removeLists']);router[_0xa077('0x1d')](_0xa077('0x13'),auth[_0xa077('0xa')](),controller[_0xa077('0x1e')]);module[_0xa077('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 0d16c4e..f74e246 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 _0x92bd=['sequelize','exports','STRING','TEXT','VIRTUAL','key'];(function(_0x9a65e1,_0x4b3471){var _0x36e14e=function(_0x4d951a){while(--_0x4d951a){_0x9a65e1['push'](_0x9a65e1['shift']());}};_0x36e14e(++_0x4b3471);}(_0x92bd,0x8a));var _0xd92b=function(_0x21192f,_0x131d0f){_0x21192f=_0x21192f-0x0;var _0x4006dc=_0x92bd[_0x21192f];return _0x4006dc;};'use strict';var Sequelize=require(_0xd92b('0x0'));module[_0xd92b('0x1')]={'key':{'type':Sequelize[_0xd92b('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xd92b('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xd92b('0x2')]},'name':{'type':Sequelize[_0xd92b('0x4')],'get':function(){return this['getDataValue'](_0xd92b('0x5'));}}}; \ No newline at end of file +var _0x04b4=['key','exports','TEXT','STRING','getDataValue'];(function(_0x486398,_0x370d53){var _0x2d4bc5=function(_0x4013f9){while(--_0x4013f9){_0x486398['push'](_0x486398['shift']());}};_0x2d4bc5(++_0x370d53);}(_0x04b4,0x1c8));var _0x404b=function(_0x6e6fa2,_0x2c592c){_0x6e6fa2=_0x6e6fa2-0x0;var _0x5c619e=_0x04b4[_0x6e6fa2];return _0x5c619e;};'use strict';var Sequelize=require('sequelize');module[_0x404b('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x404b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x404b('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x404b('0x3')](_0x404b('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index accb94c..6e79dde 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 _0x7898=['MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','body','find','params'];(function(_0x3af9a9,_0x4431c6){var _0x599d29=function(_0x5ceafe){while(--_0x5ceafe){_0x3af9a9['push'](_0x3af9a9['shift']());}};_0x599d29(++_0x4431c6);}(_0x7898,0x175));var _0x8789=function(_0x4f9922,_0x5182d5){_0x4f9922=_0x4f9922-0x0;var _0x3d6a25=_0x7898[_0x4f9922];return _0x3d6a25;};'use strict';var emlformat=require(_0x8789('0x0'));var rimraf=require(_0x8789('0x1'));var zipdir=require(_0x8789('0x2'));var jsonpatch=require(_0x8789('0x3'));var rp=require(_0x8789('0x4'));var moment=require(_0x8789('0x5'));var BPromise=require(_0x8789('0x6'));var Mustache=require('mustache');var util=require(_0x8789('0x7'));var path=require(_0x8789('0x8'));var sox=require(_0x8789('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8789('0xa'));var _=require(_0x8789('0xb'));var squel=require(_0x8789('0xc'));var crypto=require(_0x8789('0xd'));var jsforce=require(_0x8789('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8789('0xf'));var querystring=require(_0x8789('0x10'));var Papa=require(_0x8789('0x11'));var Redis=require(_0x8789('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8789('0x13'));var as=require(_0x8789('0x14'));var hardwareService=require(_0x8789('0x15'));var logger=require(_0x8789('0x16'))(_0x8789('0x17'));var utils=require(_0x8789('0x18'));var config=require(_0x8789('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3614f7,_0x9ec441){_0x9ec441=_0x9ec441||0xcc;return function(_0x45276e){if(_0x45276e){return _0x3614f7['sendStatus'](_0x9ec441);}return _0x3614f7['status'](_0x9ec441)[_0x8789('0x1a')]();};}function respondWithResult(_0x5ae9b9,_0x53f2e9){_0x53f2e9=_0x53f2e9||0xc8;return function(_0x200e25){if(_0x200e25){return _0x5ae9b9[_0x8789('0x1b')](_0x53f2e9)[_0x8789('0x1c')](_0x200e25);}};}function respondWithFilteredResult(_0x5ce88e,_0x15aad8){return function(_0x14cc39){if(_0x14cc39){var _0x165460=typeof _0x15aad8[_0x8789('0x1d')]===_0x8789('0x1e')&&typeof _0x15aad8[_0x8789('0x1f')]===_0x8789('0x1e');var _0x435b55=_0x14cc39[_0x8789('0x20')];var _0x43fbab=_0x165460?0x0:_0x15aad8['offset'];var _0x419f5a=_0x165460?_0x14cc39[_0x8789('0x20')]:_0x15aad8['offset']+_0x15aad8[_0x8789('0x1f')];var _0x43ea3f;if(_0x419f5a>=_0x435b55){_0x419f5a=_0x435b55;_0x43ea3f=0xc8;}else{_0x43ea3f=0xce;}_0x5ce88e[_0x8789('0x1b')](_0x43ea3f);return _0x5ce88e['set'](_0x8789('0x21'),_0x43fbab+'-'+_0x419f5a+'/'+_0x435b55)[_0x8789('0x1c')](_0x14cc39);}return null;};}function patchUpdates(_0x514eb8){return function(_0x51181c){try{jsonpatch[_0x8789('0x22')](_0x51181c,_0x514eb8,!![]);}catch(_0x360c41){return BPromise[_0x8789('0x23')](_0x360c41);}return _0x51181c[_0x8789('0x24')]();};}function saveUpdates(_0xe70f7,_0x4a2d05){return function(_0x639ebd){if(_0x639ebd){return _0x639ebd[_0x8789('0x25')](_0xe70f7)[_0x8789('0x26')](function(_0x12e57a){return _0x12e57a;});}return null;};}function removeEntity(_0x4e4b4a,_0x5d8c7f){return function(_0x935963){if(_0x935963){return _0x935963[_0x8789('0x27')]()['then'](function(){var _0x27ebb2=_0x935963[_0x8789('0x28')]({'plain':!![]});var _0x4e7558=_0x8789('0x29');return db[_0x8789('0x2a')]['destroy']({'where':{'type':_0x4e7558,'resourceId':_0x27ebb2['id']}})[_0x8789('0x26')](function(){return _0x935963;});})[_0x8789('0x26')](function(){_0x4e4b4a[_0x8789('0x1b')](0xcc)[_0x8789('0x1a')]();});}};}function handleEntityNotFound(_0x39fd6f,_0x223fda){return function(_0x54b9e0){if(!_0x54b9e0){_0x39fd6f[_0x8789('0x2b')](0x194);}return _0x54b9e0;};}function handleError(_0x6411e8,_0x7d36ca){_0x7d36ca=_0x7d36ca||0x1f4;return function(_0x5d5827){logger['error'](_0x5d5827['stack']);if(_0x5d5827[_0x8789('0x2c')]){delete _0x5d5827[_0x8789('0x2c')];}_0x6411e8[_0x8789('0x1b')](_0x7d36ca)[_0x8789('0x2d')](_0x5d5827);};}exports[_0x8789('0x2e')]=function(_0x4972fa,_0x3ab819){var _0x15d3f2={},_0x456ec4={},_0x37c126={'count':0x0,'rows':[]};var _0x1926d5=_[_0x8789('0x2f')](db[_0x8789('0x30')][_0x8789('0x31')],function(_0x47358e){return{'name':_0x47358e['fieldName'],'type':_0x47358e[_0x8789('0x32')][_0x8789('0x33')]};});_0x456ec4[_0x8789('0x34')]=_[_0x8789('0x2f')](_0x1926d5,'name');_0x456ec4[_0x8789('0x35')]=_[_0x8789('0x36')](_0x4972fa[_0x8789('0x35')]);_0x456ec4[_0x8789('0x37')]=_['intersection'](_0x456ec4[_0x8789('0x34')],_0x456ec4[_0x8789('0x35')]);_0x15d3f2[_0x8789('0x38')]=_[_0x8789('0x39')](_0x456ec4[_0x8789('0x34')],qs[_0x8789('0x3a')](_0x4972fa['query'][_0x8789('0x3a')]));_0x15d3f2[_0x8789('0x38')]=_0x15d3f2[_0x8789('0x38')][_0x8789('0x3b')]?_0x15d3f2[_0x8789('0x38')]:_0x456ec4[_0x8789('0x34')];if(!_0x4972fa['query'][_0x8789('0x3c')](_0x8789('0x3d'))){_0x15d3f2['limit']=qs[_0x8789('0x1f')](_0x4972fa['query'][_0x8789('0x1f')]);_0x15d3f2[_0x8789('0x1d')]=qs[_0x8789('0x1d')](_0x4972fa[_0x8789('0x35')][_0x8789('0x1d')]);}_0x15d3f2[_0x8789('0x3e')]=qs[_0x8789('0x3f')](_0x4972fa[_0x8789('0x35')][_0x8789('0x3f')]);_0x15d3f2[_0x8789('0x40')]=qs[_0x8789('0x37')](_[_0x8789('0x41')](_0x4972fa['query'],_0x456ec4['filters']),_0x1926d5);if(_0x4972fa['query'][_0x8789('0x42')]){_0x15d3f2[_0x8789('0x40')]=_[_0x8789('0x43')](_0x15d3f2['where'],{'$or':[{'key':{'$like':'%'+_0x4972fa['query'][_0x8789('0x42')]+'%'}},{'value':{'$like':'%'+_0x4972fa[_0x8789('0x35')][_0x8789('0x42')]+'%'}}]});}_0x15d3f2=_[_0x8789('0x43')]({},_0x15d3f2,_0x4972fa[_0x8789('0x44')]);var _0x2bcbd2={'where':_0x15d3f2[_0x8789('0x40')]};return db[_0x8789('0x30')][_0x8789('0x20')](_0x2bcbd2)[_0x8789('0x26')](function(_0x3c72e5){_0x37c126[_0x8789('0x20')]=_0x3c72e5;if(_0x4972fa[_0x8789('0x35')][_0x8789('0x45')]){_0x15d3f2[_0x8789('0x46')]=[{'all':!![]}];}return db[_0x8789('0x30')][_0x8789('0x47')](_0x15d3f2);})[_0x8789('0x26')](function(_0x45c538){_0x37c126['rows']=_0x45c538;return _0x37c126;})['then'](respondWithFilteredResult(_0x3ab819,_0x15d3f2))[_0x8789('0x48')](handleError(_0x3ab819,null));};exports[_0x8789('0x49')]=function(_0xc8358d,_0x5c6a46){var _0x4f40dd={'raw':!![],'where':{'id':_0xc8358d['params']['id']}},_0x37d04a={};_0x37d04a[_0x8789('0x34')]=_[_0x8789('0x36')](db[_0x8789('0x30')][_0x8789('0x31')]);_0x37d04a[_0x8789('0x35')]=_[_0x8789('0x36')](_0xc8358d[_0x8789('0x35')]);_0x37d04a[_0x8789('0x37')]=_[_0x8789('0x39')](_0x37d04a[_0x8789('0x34')],_0x37d04a[_0x8789('0x35')]);_0x4f40dd[_0x8789('0x38')]=_[_0x8789('0x39')](_0x37d04a[_0x8789('0x34')],qs[_0x8789('0x3a')](_0xc8358d['query'][_0x8789('0x3a')]));_0x4f40dd[_0x8789('0x38')]=_0x4f40dd[_0x8789('0x38')]['length']?_0x4f40dd[_0x8789('0x38')]:_0x37d04a['model'];if(_0xc8358d[_0x8789('0x35')][_0x8789('0x45')]){_0x4f40dd[_0x8789('0x46')]=[{'all':!![]}];}_0x4f40dd=_[_0x8789('0x43')]({},_0x4f40dd,_0xc8358d[_0x8789('0x44')]);return db[_0x8789('0x30')]['find'](_0x4f40dd)[_0x8789('0x26')](handleEntityNotFound(_0x5c6a46,null))['then'](respondWithResult(_0x5c6a46,null))[_0x8789('0x48')](handleError(_0x5c6a46,null));};exports['update']=function(_0x45d3b5,_0x4bea8f){if(_0x45d3b5[_0x8789('0x4a')]['id']){delete _0x45d3b5[_0x8789('0x4a')]['id'];}return db[_0x8789('0x30')][_0x8789('0x4b')]({'where':{'id':_0x45d3b5['params']['id']}})['then'](handleEntityNotFound(_0x4bea8f,null))[_0x8789('0x26')](saveUpdates(_0x45d3b5[_0x8789('0x4a')],null))[_0x8789('0x26')](respondWithResult(_0x4bea8f,null))[_0x8789('0x48')](handleError(_0x4bea8f,null));};exports['destroy']=function(_0x57845c,_0x43527e){return db[_0x8789('0x30')]['find']({'where':{'id':_0x57845c[_0x8789('0x4c')]['id']}})[_0x8789('0x26')](handleEntityNotFound(_0x43527e,null))[_0x8789('0x26')](removeEntity(_0x43527e,null))[_0x8789('0x48')](handleError(_0x43527e,null));};exports['create']=function(_0x47c13f,_0x3d6b06){var _0x4e302a={'key':_0x47c13f[_0x8789('0x4a')][_0x8789('0x33')]};if(_0x47c13f['body'][_0x8789('0x4d')]){_0x4e302a[_0x8789('0x4d')]=_0x47c13f[_0x8789('0x4a')][_0x8789('0x4d')];}else if(_0x47c13f['body'][_0x8789('0x4e')]){_0x4e302a[_0x8789('0x4e')]=_0x47c13f['body'][_0x8789('0x4e')];}else if(_0x47c13f[_0x8789('0x4a')][_0x8789('0x4f')]){_0x4e302a[_0x8789('0x4f')]=_0x47c13f[_0x8789('0x4a')][_0x8789('0x4f')];}else if(_0x47c13f[_0x8789('0x4a')][_0x8789('0x50')]){_0x4e302a[_0x8789('0x50')]=_0x47c13f[_0x8789('0x4a')][_0x8789('0x50')];}return db[_0x8789('0x30')][_0x8789('0x4b')]({'where':_0x4e302a})['then'](function(_0x1166e8){if(_0x1166e8){throw new db['Sequelize'][(_0x8789('0x51'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x8789('0x30')][_0x8789('0x52')](_0x47c13f['body']);})[_0x8789('0x26')](function(_0x357630){var _0x97b82=_0x47c13f[_0x8789('0x53')][_0x8789('0x28')]({'plain':!![]});if(!_0x97b82)throw new Error(_0x8789('0x54'));if(_0x97b82[_0x8789('0x55')]==='user'){var _0x4a5bf9=_0x357630[_0x8789('0x28')]({'plain':!![]});return db[_0x8789('0x56')][_0x8789('0x4b')]({'where':{'name':_0x8789('0x29'),'userProfileId':_0x97b82[_0x8789('0x57')]},'raw':!![]})['then'](function(_0x1e3488){if(_0x1e3488&&_0x1e3488['autoAssociation']===0x0){return db[_0x8789('0x2a')][_0x8789('0x52')]({'name':_0x4a5bf9[_0x8789('0x2c')],'resourceId':_0x4a5bf9['id'],'type':_0x1e3488[_0x8789('0x2c')],'sectionId':_0x1e3488['id']},{})[_0x8789('0x26')](function(){return _0x357630;});}else{return _0x357630;}})[_0x8789('0x48')](function(_0x158a72){logger[_0x8789('0x58')](_0x8789('0x59'),_0x158a72);throw _0x158a72;});}return _0x357630;})[_0x8789('0x26')](respondWithResult(_0x3d6b06,0xc9))[_0x8789('0x48')](handleError(_0x3d6b06,null));}; \ No newline at end of file +var _0x3feb=['sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','find','catch','update','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','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','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','destroy','then','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x1c9762,_0x553707){var _0x1b6eed=function(_0x2a882d){while(--_0x2a882d){_0x1c9762['push'](_0x1c9762['shift']());}};_0x1b6eed(++_0x553707);}(_0x3feb,0x12e));var _0xb3fe=function(_0x28be64,_0x48c7c5){_0x28be64=_0x28be64-0x0;var _0x3d92ec=_0x3feb[_0x28be64];return _0x3d92ec;};'use strict';var emlformat=require(_0xb3fe('0x0'));var rimraf=require(_0xb3fe('0x1'));var zipdir=require(_0xb3fe('0x2'));var jsonpatch=require(_0xb3fe('0x3'));var rp=require('request-promise');var moment=require(_0xb3fe('0x4'));var BPromise=require(_0xb3fe('0x5'));var Mustache=require(_0xb3fe('0x6'));var util=require(_0xb3fe('0x7'));var path=require(_0xb3fe('0x8'));var sox=require(_0xb3fe('0x9'));var csv=require('to-csv');var ejs=require(_0xb3fe('0xa'));var fs=require('fs');var fs_extra=require(_0xb3fe('0xb'));var _=require(_0xb3fe('0xc'));var squel=require(_0xb3fe('0xd'));var crypto=require(_0xb3fe('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb3fe('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb3fe('0x10'));var Redis=require(_0xb3fe('0x11'));var authService=require(_0xb3fe('0x12'));var qs=require(_0xb3fe('0x13'));var as=require(_0xb3fe('0x14'));var hardwareService=require(_0xb3fe('0x15'));var logger=require(_0xb3fe('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xb3fe('0x17'));var licenseUtil=require(_0xb3fe('0x18'));var db=require(_0xb3fe('0x19'))['db'];function respondWithStatusCode(_0x16c449,_0x2ad369){_0x2ad369=_0x2ad369||0xcc;return function(_0x231a6a){if(_0x231a6a){return _0x16c449[_0xb3fe('0x1a')](_0x2ad369);}return _0x16c449[_0xb3fe('0x1b')](_0x2ad369)[_0xb3fe('0x1c')]();};}function respondWithResult(_0x4ef6b9,_0x5270cc){_0x5270cc=_0x5270cc||0xc8;return function(_0xeab218){if(_0xeab218){return _0x4ef6b9['status'](_0x5270cc)[_0xb3fe('0x1d')](_0xeab218);}};}function respondWithFilteredResult(_0xbd43d9,_0x33fc7f){return function(_0x4f76a7){if(_0x4f76a7){var _0x4b13d=typeof _0x33fc7f[_0xb3fe('0x1e')]===_0xb3fe('0x1f')&&typeof _0x33fc7f['limit']===_0xb3fe('0x1f');var _0x17e320=_0x4f76a7['count'];var _0x2f6ad8=_0x4b13d?0x0:_0x33fc7f[_0xb3fe('0x1e')];var _0x48839a=_0x4b13d?_0x4f76a7[_0xb3fe('0x20')]:_0x33fc7f[_0xb3fe('0x1e')]+_0x33fc7f['limit'];var _0x588bad;if(_0x48839a>=_0x17e320){_0x48839a=_0x17e320;_0x588bad=0xc8;}else{_0x588bad=0xce;}_0xbd43d9[_0xb3fe('0x1b')](_0x588bad);return _0xbd43d9[_0xb3fe('0x21')]('Content-Range',_0x2f6ad8+'-'+_0x48839a+'/'+_0x17e320)[_0xb3fe('0x1d')](_0x4f76a7);}return null;};}function patchUpdates(_0x2c93ae){return function(_0x2db7d3){try{jsonpatch[_0xb3fe('0x22')](_0x2db7d3,_0x2c93ae,!![]);}catch(_0x1cce98){return BPromise[_0xb3fe('0x23')](_0x1cce98);}return _0x2db7d3['save']();};}function saveUpdates(_0x30b300,_0x27fa30){return function(_0x12914a){if(_0x12914a){return _0x12914a['update'](_0x30b300)['then'](function(_0x3b6ca3){return _0x3b6ca3;});}return null;};}function removeEntity(_0x4b0e1e,_0x2c360c){return function(_0x3fb1bf){if(_0x3fb1bf){return _0x3fb1bf[_0xb3fe('0x24')]()[_0xb3fe('0x25')](function(){var _0x37de9a=_0x3fb1bf['get']({'plain':!![]});var _0x2e85a2=_0xb3fe('0x26');return db[_0xb3fe('0x27')]['destroy']({'where':{'type':_0x2e85a2,'resourceId':_0x37de9a['id']}})['then'](function(){return _0x3fb1bf;});})[_0xb3fe('0x25')](function(){_0x4b0e1e[_0xb3fe('0x1b')](0xcc)[_0xb3fe('0x1c')]();});}};}function handleEntityNotFound(_0x2fcf17,_0x356ef8){return function(_0xf4f577){if(!_0xf4f577){_0x2fcf17[_0xb3fe('0x1a')](0x194);}return _0xf4f577;};}function handleError(_0x23e749,_0x2c83b9){_0x2c83b9=_0x2c83b9||0x1f4;return function(_0x1ee79e){logger[_0xb3fe('0x28')](_0x1ee79e[_0xb3fe('0x29')]);if(_0x1ee79e[_0xb3fe('0x2a')]){delete _0x1ee79e[_0xb3fe('0x2a')];}_0x23e749[_0xb3fe('0x1b')](_0x2c83b9)[_0xb3fe('0x2b')](_0x1ee79e);};}exports[_0xb3fe('0x2c')]=function(_0x49e001,_0x345600){var _0x5d9614={},_0x125589={},_0x2b75e3={'count':0x0,'rows':[]};var _0x1e48d1=_[_0xb3fe('0x2d')](db[_0xb3fe('0x2e')][_0xb3fe('0x2f')],function(_0x5f0bd4){return{'name':_0x5f0bd4[_0xb3fe('0x30')],'type':_0x5f0bd4[_0xb3fe('0x31')][_0xb3fe('0x32')]};});_0x125589['model']=_['map'](_0x1e48d1,'name');_0x125589['query']=_[_0xb3fe('0x33')](_0x49e001[_0xb3fe('0x34')]);_0x125589[_0xb3fe('0x35')]=_[_0xb3fe('0x36')](_0x125589[_0xb3fe('0x37')],_0x125589[_0xb3fe('0x34')]);_0x5d9614[_0xb3fe('0x38')]=_['intersection'](_0x125589[_0xb3fe('0x37')],qs[_0xb3fe('0x39')](_0x49e001[_0xb3fe('0x34')][_0xb3fe('0x39')]));_0x5d9614['attributes']=_0x5d9614['attributes'][_0xb3fe('0x3a')]?_0x5d9614[_0xb3fe('0x38')]:_0x125589[_0xb3fe('0x37')];if(!_0x49e001[_0xb3fe('0x34')][_0xb3fe('0x3b')](_0xb3fe('0x3c'))){_0x5d9614[_0xb3fe('0x3d')]=qs['limit'](_0x49e001[_0xb3fe('0x34')]['limit']);_0x5d9614[_0xb3fe('0x1e')]=qs[_0xb3fe('0x1e')](_0x49e001[_0xb3fe('0x34')][_0xb3fe('0x1e')]);}_0x5d9614['order']=qs[_0xb3fe('0x3e')](_0x49e001[_0xb3fe('0x34')][_0xb3fe('0x3e')]);_0x5d9614[_0xb3fe('0x3f')]=qs[_0xb3fe('0x35')](_[_0xb3fe('0x40')](_0x49e001['query'],_0x125589['filters']),_0x1e48d1);if(_0x49e001[_0xb3fe('0x34')][_0xb3fe('0x41')]){_0x5d9614['where']=_[_0xb3fe('0x42')](_0x5d9614[_0xb3fe('0x3f')],{'$or':[{'key':{'$like':'%'+_0x49e001[_0xb3fe('0x34')][_0xb3fe('0x41')]+'%'}},{'value':{'$like':'%'+_0x49e001[_0xb3fe('0x34')][_0xb3fe('0x41')]+'%'}}]});}_0x5d9614=_[_0xb3fe('0x42')]({},_0x5d9614,_0x49e001[_0xb3fe('0x43')]);var _0x430459={'where':_0x5d9614[_0xb3fe('0x3f')]};return db[_0xb3fe('0x2e')]['count'](_0x430459)[_0xb3fe('0x25')](function(_0x49a5da){_0x2b75e3[_0xb3fe('0x20')]=_0x49a5da;if(_0x49e001[_0xb3fe('0x34')][_0xb3fe('0x44')]){_0x5d9614[_0xb3fe('0x45')]=[{'all':!![]}];}return db[_0xb3fe('0x2e')]['findAll'](_0x5d9614);})[_0xb3fe('0x25')](function(_0x50db97){_0x2b75e3[_0xb3fe('0x46')]=_0x50db97;return _0x2b75e3;})[_0xb3fe('0x25')](respondWithFilteredResult(_0x345600,_0x5d9614))['catch'](handleError(_0x345600,null));};exports[_0xb3fe('0x47')]=function(_0x173ea3,_0x3cdb77){var _0x1435cb={'raw':!![],'where':{'id':_0x173ea3[_0xb3fe('0x48')]['id']}},_0x367c25={};_0x367c25[_0xb3fe('0x37')]=_[_0xb3fe('0x33')](db[_0xb3fe('0x2e')]['rawAttributes']);_0x367c25[_0xb3fe('0x34')]=_[_0xb3fe('0x33')](_0x173ea3[_0xb3fe('0x34')]);_0x367c25[_0xb3fe('0x35')]=_[_0xb3fe('0x36')](_0x367c25['model'],_0x367c25[_0xb3fe('0x34')]);_0x1435cb['attributes']=_[_0xb3fe('0x36')](_0x367c25[_0xb3fe('0x37')],qs[_0xb3fe('0x39')](_0x173ea3['query'][_0xb3fe('0x39')]));_0x1435cb[_0xb3fe('0x38')]=_0x1435cb[_0xb3fe('0x38')][_0xb3fe('0x3a')]?_0x1435cb['attributes']:_0x367c25[_0xb3fe('0x37')];if(_0x173ea3[_0xb3fe('0x34')]['includeAll']){_0x1435cb['include']=[{'all':!![]}];}_0x1435cb=_['merge']({},_0x1435cb,_0x173ea3[_0xb3fe('0x43')]);return db[_0xb3fe('0x2e')][_0xb3fe('0x49')](_0x1435cb)[_0xb3fe('0x25')](handleEntityNotFound(_0x3cdb77,null))['then'](respondWithResult(_0x3cdb77,null))[_0xb3fe('0x4a')](handleError(_0x3cdb77,null));};exports[_0xb3fe('0x4b')]=function(_0x137620,_0x1907d2){if(_0x137620['body']['id']){delete _0x137620[_0xb3fe('0x4c')]['id'];}return db['CannedAnswer'][_0xb3fe('0x49')]({'where':{'id':_0x137620['params']['id']}})[_0xb3fe('0x25')](handleEntityNotFound(_0x1907d2,null))[_0xb3fe('0x25')](saveUpdates(_0x137620['body'],null))['then'](respondWithResult(_0x1907d2,null))[_0xb3fe('0x4a')](handleError(_0x1907d2,null));};exports['destroy']=function(_0x3d695c,_0x305757){return db[_0xb3fe('0x2e')][_0xb3fe('0x49')]({'where':{'id':_0x3d695c[_0xb3fe('0x48')]['id']}})[_0xb3fe('0x25')](handleEntityNotFound(_0x305757,null))[_0xb3fe('0x25')](removeEntity(_0x305757,null))[_0xb3fe('0x4a')](handleError(_0x305757,null));};exports['create']=function(_0x5762a3,_0x232783){var _0x361671={'key':_0x5762a3[_0xb3fe('0x4c')][_0xb3fe('0x32')]};if(_0x5762a3[_0xb3fe('0x4c')]['MailAccountId']){_0x361671['MailAccountId']=_0x5762a3[_0xb3fe('0x4c')][_0xb3fe('0x4d')];}else if(_0x5762a3['body'][_0xb3fe('0x4e')]){_0x361671['SmsAccountId']=_0x5762a3['body'][_0xb3fe('0x4e')];}else if(_0x5762a3[_0xb3fe('0x4c')][_0xb3fe('0x4f')]){_0x361671[_0xb3fe('0x4f')]=_0x5762a3[_0xb3fe('0x4c')]['OpenchannelAccountId'];}else if(_0x5762a3[_0xb3fe('0x4c')][_0xb3fe('0x50')]){_0x361671[_0xb3fe('0x50')]=_0x5762a3[_0xb3fe('0x4c')][_0xb3fe('0x50')];}return db['CannedAnswer'][_0xb3fe('0x49')]({'where':_0x361671})[_0xb3fe('0x25')](function(_0x5c168f){if(_0x5c168f){throw new db['Sequelize'][(_0xb3fe('0x51'))](_0xb3fe('0x52'));}return db[_0xb3fe('0x2e')]['create'](_0x5762a3[_0xb3fe('0x4c')]);})[_0xb3fe('0x25')](function(_0x1cce29){var _0x4b24f8=_0x5762a3[_0xb3fe('0x53')]['get']({'plain':!![]});if(!_0x4b24f8)throw new Error(_0xb3fe('0x54'));if(_0x4b24f8[_0xb3fe('0x55')]===_0xb3fe('0x53')){var _0x22b61e=_0x1cce29[_0xb3fe('0x56')]({'plain':!![]});return db[_0xb3fe('0x57')][_0xb3fe('0x49')]({'where':{'name':_0xb3fe('0x26'),'userProfileId':_0x4b24f8[_0xb3fe('0x58')]},'raw':!![]})[_0xb3fe('0x25')](function(_0x38b718){if(_0x38b718&&_0x38b718[_0xb3fe('0x59')]===0x0){return db[_0xb3fe('0x27')]['create']({'name':_0x22b61e[_0xb3fe('0x2a')],'resourceId':_0x22b61e['id'],'type':_0x38b718[_0xb3fe('0x2a')],'sectionId':_0x38b718['id']},{})['then'](function(){return _0x1cce29;});}else{return _0x1cce29;}})[_0xb3fe('0x4a')](function(_0xdc7e0){logger[_0xb3fe('0x28')](_0xb3fe('0x5a'),_0xdc7e0);throw _0xdc7e0;});}return _0x1cce29;})[_0xb3fe('0x25')](respondWithResult(_0x232783,0xc9))[_0xb3fe('0x4a')](handleError(_0x232783,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 48f65de..35210b0 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 _0x08ff=['request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x56acd3,_0x52fcc5){var _0x920a32=function(_0x16dc60){while(--_0x16dc60){_0x56acd3['push'](_0x56acd3['shift']());}};_0x920a32(++_0x52fcc5);}(_0x08ff,0x72));var _0xf08f=function(_0x15cf2c,_0x114878){_0x15cf2c=_0x15cf2c-0x0;var _0x47b99a=_0x08ff[_0x15cf2c];return _0x47b99a;};'use strict';var _=require(_0xf08f('0x0'));var util=require(_0xf08f('0x1'));var logger=require(_0xf08f('0x2'))(_0xf08f('0x3'));var moment=require(_0xf08f('0x4'));var BPromise=require(_0xf08f('0x5'));var rp=require(_0xf08f('0x6'));var fs=require('fs');var path=require(_0xf08f('0x7'));var rimraf=require('rimraf');var config=require(_0xf08f('0x8'));var attributes=require(_0xf08f('0x9'));module[_0xf08f('0xa')]=function(_0x1bf734,_0x4a4e14){return _0x1bf734['define'](_0xf08f('0xb'),attributes,{'tableName':_0xf08f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf08f('0xd'),'collate':_0xf08f('0xe')});}; \ No newline at end of file +var _0x22b3=['exports','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x49c186,_0x14c4b0){var _0x34e626=function(_0x5c0f95){while(--_0x5c0f95){_0x49c186['push'](_0x49c186['shift']());}};_0x34e626(++_0x14c4b0);}(_0x22b3,0x189));var _0x322b=function(_0x29c652,_0x251ca1){_0x29c652=_0x29c652-0x0;var _0x13b5cd=_0x22b3[_0x29c652];return _0x13b5cd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x322b('0x0'))(_0x322b('0x1'));var moment=require(_0x322b('0x2'));var BPromise=require(_0x322b('0x3'));var rp=require(_0x322b('0x4'));var fs=require('fs');var path=require(_0x322b('0x5'));var rimraf=require('rimraf');var config=require(_0x322b('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x322b('0x7')]=function(_0xd6f2a,_0x36d64a){return _0xd6f2a['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x322b('0x8'),'collate':_0x322b('0x9')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index cbe8429..de8923b 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(_0x1f861f,_0x573858){var _0x33ca05=function(_0x5ef9b9){while(--_0x5ef9b9){_0x1f861f['push'](_0x1f861f['shift']());}};_0x33ca05(++_0x573858);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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(_0x523886,_0x3ad7d8){var _0x4e704c=function(_0x3c1a9e){while(--_0x3c1a9e){_0x523886['push'](_0x523886['shift']());}};_0x4e704c(++_0x3ad7d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 199c028..5053a72 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 _0x9e67=['/:id','show','destroy','exports','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x33bf91,_0xb8c629){var _0x37ceed=function(_0x48f82b){while(--_0x48f82b){_0x33bf91['push'](_0x33bf91['shift']());}};_0x37ceed(++_0xb8c629);}(_0x9e67,0x1cb));var _0x79e6=function(_0x13394d,_0x13653b){_0x13394d=_0x13394d-0x0;var _0x410bcb=_0x9e67[_0x13394d];return _0x410bcb;};'use strict';var multer=require('multer');var util=require(_0x79e6('0x0'));var path=require(_0x79e6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x79e6('0x2')]();var fs_extra=require(_0x79e6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x79e6('0x4'));var config=require(_0x79e6('0x5'));var controller=require('./cannedAnswer.controller');router[_0x79e6('0x6')]('/',auth[_0x79e6('0x7')](),controller[_0x79e6('0x8')]);router[_0x79e6('0x6')](_0x79e6('0x9'),auth['isAuthenticated'](),controller[_0x79e6('0xa')]);router['post']('/',auth[_0x79e6('0x7')](),controller['create']);router['put']('/:id',auth[_0x79e6('0x7')](),controller['update']);router['delete']('/:id',auth[_0x79e6('0x7')](),controller[_0x79e6('0xb')]);module[_0x79e6('0xc')]=router; \ No newline at end of file +var _0x05d8=['create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show'];(function(_0x4ef17a,_0x1a799b){var _0x141f41=function(_0x12ec71){while(--_0x12ec71){_0x4ef17a['push'](_0x4ef17a['shift']());}};_0x141f41(++_0x1a799b);}(_0x05d8,0x64));var _0x805d=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x05d8[_0x4bb66f];return _0xf2772f;};'use strict';var multer=require(_0x805d('0x0'));var util=require(_0x805d('0x1'));var path=require('path');var timeout=require(_0x805d('0x2'));var express=require(_0x805d('0x3'));var router=express[_0x805d('0x4')]();var fs_extra=require(_0x805d('0x5'));var auth=require(_0x805d('0x6'));var interaction=require(_0x805d('0x7'));var config=require(_0x805d('0x8'));var controller=require(_0x805d('0x9'));router[_0x805d('0xa')]('/',auth[_0x805d('0xb')](),controller['index']);router[_0x805d('0xa')](_0x805d('0xc'),auth[_0x805d('0xb')](),controller[_0x805d('0xd')]);router['post']('/',auth[_0x805d('0xb')](),controller[_0x805d('0xe')]);router[_0x805d('0xf')](_0x805d('0xc'),auth[_0x805d('0xb')](),controller[_0x805d('0x10')]);router['delete'](_0x805d('0xc'),auth[_0x805d('0xb')](),controller[_0x805d('0x11')]);module[_0x805d('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 2318d93..18d17a7 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 _0x10bd=['1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x34752e,_0x557215){var _0x4d6e49=function(_0x400b1a){while(--_0x400b1a){_0x34752e['push'](_0x34752e['shift']());}};_0x4d6e49(++_0x557215);}(_0x10bd,0x97));var _0xd10b=function(_0x4cd11c,_0x3faeb2){_0x4cd11c=_0x4cd11c-0x0;var _0xade338=_0x10bd[_0x4cd11c];return _0xade338;};'use strict';var Sequelize=require('sequelize');module[_0xd10b('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xd10b('0x1')},'clid':{'type':Sequelize[_0xd10b('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xd10b('0x2')]},'channel':{'type':Sequelize[_0xd10b('0x2')]},'dstchannel':{'type':Sequelize[_0xd10b('0x2')]},'lastapp':{'type':Sequelize[_0xd10b('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xd10b('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd10b('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd10b('0x2')]},'amaflags':{'type':Sequelize[_0xd10b('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd10b('0x2')]},'userfield':{'type':Sequelize[_0xd10b('0x2')]},'uniqueid':{'type':Sequelize[_0xd10b('0x2')]},'linkedid':{'type':Sequelize[_0xd10b('0x2')]},'sequence':{'type':Sequelize[_0xd10b('0x2')]},'peeraccount':{'type':Sequelize[_0xd10b('0x2')]},'type':{'type':Sequelize[_0xd10b('0x2')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaf09=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x4af527,_0x22291b){var _0x55ae8d=function(_0x41086c){while(--_0x41086c){_0x4af527['push'](_0x4af527['shift']());}};_0x55ae8d(++_0x22291b);}(_0xaf09,0x10d));var _0x9af0=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xaf09[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x9af0('0x0'));module[_0x9af0('0x1')]={'calldate':{'type':Sequelize[_0x9af0('0x2')],'allowNull':![],'defaultValue':_0x9af0('0x3')},'clid':{'type':Sequelize[_0x9af0('0x4')]},'src':{'type':Sequelize[_0x9af0('0x4')]},'dst':{'type':Sequelize[_0x9af0('0x4')]},'dcontext':{'type':Sequelize[_0x9af0('0x4')]},'channel':{'type':Sequelize[_0x9af0('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x9af0('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9af0('0x4')]},'linkedid':{'type':Sequelize[_0x9af0('0x4')]},'sequence':{'type':Sequelize[_0x9af0('0x4')]},'peeraccount':{'type':Sequelize[_0x9af0('0x4')]},'type':{'type':Sequelize[_0x9af0('0x4')]},'tag':{'type':Sequelize[_0x9af0('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index bb567eb..6a6bac1 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 _0x8c46=['filter','VIRTUAL','merge','options','include','Cdr','rows','catch','includeAll','find','create','body','params','describe','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick'];(function(_0xa14049,_0x127041){var _0x584efc=function(_0x157707){while(--_0x157707){_0xa14049['push'](_0xa14049['shift']());}};_0x584efc(++_0x127041);}(_0x8c46,0x171));var _0x68c4=function(_0x3767ef,_0x29c168){_0x3767ef=_0x3767ef-0x0;var _0x14c673=_0x8c46[_0x3767ef];return _0x14c673;};'use strict';var emlformat=require(_0x68c4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x68c4('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x68c4('0x2'));var Mustache=require(_0x68c4('0x3'));var util=require(_0x68c4('0x4'));var path=require(_0x68c4('0x5'));var sox=require(_0x68c4('0x6'));var csv=require(_0x68c4('0x7'));var ejs=require(_0x68c4('0x8'));var fs=require('fs');var fs_extra=require(_0x68c4('0x9'));var _=require(_0x68c4('0xa'));var squel=require(_0x68c4('0xb'));var crypto=require('crypto');var jsforce=require(_0x68c4('0xc'));var deskjs=require(_0x68c4('0xd'));var toCsv=require(_0x68c4('0x7'));var querystring=require('querystring');var Papa=require(_0x68c4('0xe'));var Redis=require(_0x68c4('0xf'));var authService=require(_0x68c4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68c4('0x11'));var logger=require(_0x68c4('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x68c4('0x13'));var licenseUtil=require(_0x68c4('0x14'));var db=require(_0x68c4('0x15'))['db'];function respondWithStatusCode(_0x48783b,_0x3a432a){_0x3a432a=_0x3a432a||0xcc;return function(_0x1f5f42){if(_0x1f5f42){return _0x48783b[_0x68c4('0x16')](_0x3a432a);}return _0x48783b['status'](_0x3a432a)[_0x68c4('0x17')]();};}function respondWithResult(_0x14919c,_0x5e1341){_0x5e1341=_0x5e1341||0xc8;return function(_0x52f031){if(_0x52f031){return _0x14919c[_0x68c4('0x18')](_0x5e1341)[_0x68c4('0x19')](_0x52f031);}};}function respondWithFilteredResult(_0x5be0de,_0xc25f7b){return function(_0x4ea2a4){if(_0x4ea2a4){var _0x1a7045=typeof _0xc25f7b['offset']==='undefined'&&typeof _0xc25f7b[_0x68c4('0x1a')]===_0x68c4('0x1b');var _0x4f4797=_0x4ea2a4[_0x68c4('0x1c')];var _0x1d757c=_0x1a7045?0x0:_0xc25f7b[_0x68c4('0x1d')];var _0x33c5c5=_0x1a7045?_0x4ea2a4[_0x68c4('0x1c')]:_0xc25f7b[_0x68c4('0x1d')]+_0xc25f7b[_0x68c4('0x1a')];var _0x415ef2;if(_0x33c5c5>=_0x4f4797){_0x33c5c5=_0x4f4797;_0x415ef2=0xc8;}else{_0x415ef2=0xce;}_0x5be0de[_0x68c4('0x18')](_0x415ef2);return _0x5be0de[_0x68c4('0x1e')](_0x68c4('0x1f'),_0x1d757c+'-'+_0x33c5c5+'/'+_0x4f4797)['json'](_0x4ea2a4);}return null;};}function patchUpdates(_0x398a71){return function(_0x4edf9f){try{jsonpatch['apply'](_0x4edf9f,_0x398a71,!![]);}catch(_0x34d3a6){return BPromise[_0x68c4('0x20')](_0x34d3a6);}return _0x4edf9f[_0x68c4('0x21')]();};}function saveUpdates(_0x42f0bc,_0x5b8135){return function(_0x35e865){if(_0x35e865){return _0x35e865[_0x68c4('0x22')](_0x42f0bc)['then'](function(_0x201742){return _0x201742;});}return null;};}function removeEntity(_0x392ccf,_0x45f9be){return function(_0x10278e){if(_0x10278e){return _0x10278e[_0x68c4('0x23')]()[_0x68c4('0x24')](function(){_0x392ccf[_0x68c4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ff4a5,_0x55355d){return function(_0xf16a78){if(!_0xf16a78){_0x2ff4a5[_0x68c4('0x16')](0x194);}return _0xf16a78;};}function handleError(_0x57f32,_0x4f9d32){_0x4f9d32=_0x4f9d32||0x1f4;return function(_0x1e14db){logger[_0x68c4('0x25')](_0x1e14db[_0x68c4('0x26')]);if(_0x1e14db[_0x68c4('0x27')]){delete _0x1e14db[_0x68c4('0x27')];}_0x57f32[_0x68c4('0x18')](_0x4f9d32)[_0x68c4('0x28')](_0x1e14db);};}exports['index']=function(_0x26d56b,_0x4b4634){var _0x3772b3={},_0x1442ba={},_0x56ed70={'count':0x0,'rows':[]};var _0x2847d1=_[_0x68c4('0x29')](db['Cdr'][_0x68c4('0x2a')],function(_0x3a1b69){return{'name':_0x3a1b69[_0x68c4('0x2b')],'type':_0x3a1b69[_0x68c4('0x2c')][_0x68c4('0x2d')]};});_0x1442ba[_0x68c4('0x2e')]=_[_0x68c4('0x29')](_0x2847d1,_0x68c4('0x27'));_0x1442ba[_0x68c4('0x2f')]=_[_0x68c4('0x30')](_0x26d56b[_0x68c4('0x2f')]);_0x1442ba[_0x68c4('0x31')]=_[_0x68c4('0x32')](_0x1442ba[_0x68c4('0x2e')],_0x1442ba[_0x68c4('0x2f')]);_0x3772b3[_0x68c4('0x33')]=_[_0x68c4('0x32')](_0x1442ba[_0x68c4('0x2e')],qs['fields'](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x34')]));_0x3772b3[_0x68c4('0x33')]=_0x3772b3[_0x68c4('0x33')][_0x68c4('0x35')]?_0x3772b3['attributes']:_0x1442ba[_0x68c4('0x2e')];if(!_0x26d56b['query']['hasOwnProperty']('nolimit')){_0x3772b3[_0x68c4('0x1a')]=qs[_0x68c4('0x1a')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x1a')]);_0x3772b3['offset']=qs[_0x68c4('0x1d')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x1d')]);}_0x3772b3['order']=qs[_0x68c4('0x36')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x36')]);_0x3772b3[_0x68c4('0x37')]=qs[_0x68c4('0x31')](_[_0x68c4('0x38')](_0x26d56b[_0x68c4('0x2f')],_0x1442ba[_0x68c4('0x31')]),_0x2847d1);if(_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x39')]){_0x3772b3['where']=_['merge'](_0x3772b3[_0x68c4('0x37')],{'$or':_[_0x68c4('0x29')](_0x2847d1,function(_0x460e11){if(_0x460e11[_0x68c4('0x2c')]!==_0x68c4('0x3a')){var _0x13386d={};_0x13386d[_0x460e11[_0x68c4('0x27')]]={'$like':'%'+_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x39')]+'%'};return _0x13386d;}})});}_0x3772b3=_[_0x68c4('0x3b')]({},_0x3772b3,_0x26d56b[_0x68c4('0x3c')]);var _0x30a1cd={'where':_0x3772b3[_0x68c4('0x37')]};return db['Cdr']['count'](_0x30a1cd)[_0x68c4('0x24')](function(_0x2785b4){_0x56ed70[_0x68c4('0x1c')]=_0x2785b4;if(_0x26d56b[_0x68c4('0x2f')]['includeAll']){_0x3772b3[_0x68c4('0x3d')]=[{'all':!![]}];}return db[_0x68c4('0x3e')]['findAll'](_0x3772b3);})['then'](function(_0x4c564a){_0x56ed70[_0x68c4('0x3f')]=_0x4c564a;return _0x56ed70;})['then'](respondWithFilteredResult(_0x4b4634,_0x3772b3))[_0x68c4('0x40')](handleError(_0x4b4634,null));};exports['show']=function(_0x18da6f,_0x2406b1){var _0xbd848f={'raw':!![],'where':{'id':_0x18da6f['params']['id']}},_0xefe68d={};_0xefe68d[_0x68c4('0x2e')]=_[_0x68c4('0x30')](db[_0x68c4('0x3e')][_0x68c4('0x2a')]);_0xefe68d['query']=_[_0x68c4('0x30')](_0x18da6f[_0x68c4('0x2f')]);_0xefe68d[_0x68c4('0x31')]=_[_0x68c4('0x32')](_0xefe68d[_0x68c4('0x2e')],_0xefe68d['query']);_0xbd848f['attributes']=_['intersection'](_0xefe68d[_0x68c4('0x2e')],qs[_0x68c4('0x34')](_0x18da6f[_0x68c4('0x2f')][_0x68c4('0x34')]));_0xbd848f['attributes']=_0xbd848f[_0x68c4('0x33')][_0x68c4('0x35')]?_0xbd848f[_0x68c4('0x33')]:_0xefe68d[_0x68c4('0x2e')];if(_0x18da6f[_0x68c4('0x2f')][_0x68c4('0x41')]){_0xbd848f[_0x68c4('0x3d')]=[{'all':!![]}];}_0xbd848f=_[_0x68c4('0x3b')]({},_0xbd848f,_0x18da6f[_0x68c4('0x3c')]);return db[_0x68c4('0x3e')][_0x68c4('0x42')](_0xbd848f)['then'](handleEntityNotFound(_0x2406b1,null))[_0x68c4('0x24')](respondWithResult(_0x2406b1,null))['catch'](handleError(_0x2406b1,null));};exports[_0x68c4('0x43')]=function(_0x44e3c9,_0x463a6b){return db[_0x68c4('0x3e')]['create'](_0x44e3c9[_0x68c4('0x44')],{})['then'](respondWithResult(_0x463a6b,0xc9))[_0x68c4('0x40')](handleError(_0x463a6b,null));};exports[_0x68c4('0x22')]=function(_0x570e25,_0x250941){if(_0x570e25[_0x68c4('0x44')]['id']){delete _0x570e25[_0x68c4('0x44')]['id'];}return db[_0x68c4('0x3e')][_0x68c4('0x42')]({'where':{'id':_0x570e25[_0x68c4('0x45')]['id']}})['then'](handleEntityNotFound(_0x250941,null))[_0x68c4('0x24')](saveUpdates(_0x570e25[_0x68c4('0x44')],null))[_0x68c4('0x24')](respondWithResult(_0x250941,null))[_0x68c4('0x40')](handleError(_0x250941,null));};exports['destroy']=function(_0x40ecf6,_0x19aec2){return db[_0x68c4('0x3e')][_0x68c4('0x42')]({'where':{'id':_0x40ecf6[_0x68c4('0x45')]['id']}})[_0x68c4('0x24')](handleEntityNotFound(_0x19aec2,null))['then'](removeEntity(_0x19aec2,null))[_0x68c4('0x40')](handleError(_0x19aec2,null));};exports[_0x68c4('0x46')]=function(_0x3db854,_0x51db14){return db[_0x68c4('0x3e')][_0x68c4('0x46')]()['then'](respondWithResult(_0x51db14,null))['catch'](handleError(_0x51db14,null));}; \ No newline at end of file +var _0xf69d=['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','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','then','send','map','Cdr','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','keys','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x22fa8d,_0x3af3bb){var _0x1c445e=function(_0xabe36c){while(--_0xabe36c){_0x22fa8d['push'](_0x22fa8d['shift']());}};_0x1c445e(++_0x3af3bb);}(_0xf69d,0xd3));var _0xdf69=function(_0x5b1b43,_0x42f389){_0x5b1b43=_0x5b1b43-0x0;var _0x2758b3=_0xf69d[_0x5b1b43];return _0x2758b3;};'use strict';var emlformat=require(_0xdf69('0x0'));var rimraf=require(_0xdf69('0x1'));var zipdir=require(_0xdf69('0x2'));var jsonpatch=require(_0xdf69('0x3'));var rp=require(_0xdf69('0x4'));var moment=require('moment');var BPromise=require(_0xdf69('0x5'));var Mustache=require(_0xdf69('0x6'));var util=require(_0xdf69('0x7'));var path=require(_0xdf69('0x8'));var sox=require(_0xdf69('0x9'));var csv=require(_0xdf69('0xa'));var ejs=require(_0xdf69('0xb'));var fs=require('fs');var fs_extra=require(_0xdf69('0xc'));var _=require(_0xdf69('0xd'));var squel=require(_0xdf69('0xe'));var crypto=require(_0xdf69('0xf'));var jsforce=require(_0xdf69('0x10'));var deskjs=require(_0xdf69('0x11'));var toCsv=require(_0xdf69('0xa'));var querystring=require(_0xdf69('0x12'));var Papa=require(_0xdf69('0x13'));var Redis=require(_0xdf69('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdf69('0x15'));var as=require(_0xdf69('0x16'));var hardwareService=require(_0xdf69('0x17'));var logger=require(_0xdf69('0x18'))(_0xdf69('0x19'));var utils=require(_0xdf69('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5df98a,_0x3dcda8){_0x3dcda8=_0x3dcda8||0xcc;return function(_0xbacdc6){if(_0xbacdc6){return _0x5df98a[_0xdf69('0x1b')](_0x3dcda8);}return _0x5df98a[_0xdf69('0x1c')](_0x3dcda8)[_0xdf69('0x1d')]();};}function respondWithResult(_0x38aee2,_0x584cbd){_0x584cbd=_0x584cbd||0xc8;return function(_0x41cc77){if(_0x41cc77){return _0x38aee2[_0xdf69('0x1c')](_0x584cbd)[_0xdf69('0x1e')](_0x41cc77);}};}function respondWithFilteredResult(_0xef2df5,_0x4f28fc){return function(_0xa4242f){if(_0xa4242f){var _0x56be66=typeof _0x4f28fc[_0xdf69('0x1f')]===_0xdf69('0x20')&&typeof _0x4f28fc['limit']===_0xdf69('0x20');var _0x449908=_0xa4242f[_0xdf69('0x21')];var _0x85d1d=_0x56be66?0x0:_0x4f28fc['offset'];var _0x5ae237=_0x56be66?_0xa4242f[_0xdf69('0x21')]:_0x4f28fc[_0xdf69('0x1f')]+_0x4f28fc['limit'];var _0x32cf65;if(_0x5ae237>=_0x449908){_0x5ae237=_0x449908;_0x32cf65=0xc8;}else{_0x32cf65=0xce;}_0xef2df5[_0xdf69('0x1c')](_0x32cf65);return _0xef2df5[_0xdf69('0x22')]('Content-Range',_0x85d1d+'-'+_0x5ae237+'/'+_0x449908)[_0xdf69('0x1e')](_0xa4242f);}return null;};}function patchUpdates(_0x452cfa){return function(_0x4d09d5){try{jsonpatch['apply'](_0x4d09d5,_0x452cfa,!![]);}catch(_0x32505a){return BPromise[_0xdf69('0x23')](_0x32505a);}return _0x4d09d5[_0xdf69('0x24')]();};}function saveUpdates(_0x5d91b8,_0x50ef18){return function(_0x5be7dd){if(_0x5be7dd){return _0x5be7dd[_0xdf69('0x25')](_0x5d91b8)['then'](function(_0x21f757){return _0x21f757;});}return null;};}function removeEntity(_0x311534,_0x1d37d8){return function(_0x54d2ca){if(_0x54d2ca){return _0x54d2ca['destroy']()[_0xdf69('0x26')](function(){_0x311534[_0xdf69('0x1c')](0xcc)[_0xdf69('0x1d')]();});}};}function handleEntityNotFound(_0x3fd933,_0x549191){return function(_0x3b727c){if(!_0x3b727c){_0x3fd933[_0xdf69('0x1b')](0x194);}return _0x3b727c;};}function handleError(_0x3e4f28,_0x5969cb){_0x5969cb=_0x5969cb||0x1f4;return function(_0x2da3df){logger['error'](_0x2da3df['stack']);if(_0x2da3df['name']){delete _0x2da3df['name'];}_0x3e4f28[_0xdf69('0x1c')](_0x5969cb)[_0xdf69('0x27')](_0x2da3df);};}exports['index']=function(_0x301bd2,_0xd81d0a){var _0x19cf2d={},_0x12aec3={},_0x1b7c16={'count':0x0,'rows':[]};var _0x1b57b3=_[_0xdf69('0x28')](db[_0xdf69('0x29')][_0xdf69('0x2a')],function(_0x3b97df){return{'name':_0x3b97df[_0xdf69('0x2b')],'type':_0x3b97df[_0xdf69('0x2c')][_0xdf69('0x2d')]};});_0x12aec3[_0xdf69('0x2e')]=_[_0xdf69('0x28')](_0x1b57b3,_0xdf69('0x2f'));_0x12aec3[_0xdf69('0x30')]=_['keys'](_0x301bd2[_0xdf69('0x30')]);_0x12aec3[_0xdf69('0x31')]=_[_0xdf69('0x32')](_0x12aec3[_0xdf69('0x2e')],_0x12aec3[_0xdf69('0x30')]);_0x19cf2d['attributes']=_[_0xdf69('0x32')](_0x12aec3['model'],qs[_0xdf69('0x33')](_0x301bd2[_0xdf69('0x30')]['fields']));_0x19cf2d[_0xdf69('0x34')]=_0x19cf2d['attributes'][_0xdf69('0x35')]?_0x19cf2d[_0xdf69('0x34')]:_0x12aec3[_0xdf69('0x2e')];if(!_0x301bd2[_0xdf69('0x30')][_0xdf69('0x36')]('nolimit')){_0x19cf2d[_0xdf69('0x37')]=qs['limit'](_0x301bd2[_0xdf69('0x30')][_0xdf69('0x37')]);_0x19cf2d[_0xdf69('0x1f')]=qs[_0xdf69('0x1f')](_0x301bd2['query'][_0xdf69('0x1f')]);}_0x19cf2d['order']=qs[_0xdf69('0x38')](_0x301bd2['query'][_0xdf69('0x38')]);_0x19cf2d['where']=qs[_0xdf69('0x31')](_[_0xdf69('0x39')](_0x301bd2[_0xdf69('0x30')],_0x12aec3[_0xdf69('0x31')]),_0x1b57b3);if(_0x301bd2[_0xdf69('0x30')]['filter']){_0x19cf2d[_0xdf69('0x3a')]=_[_0xdf69('0x3b')](_0x19cf2d['where'],{'$or':_['map'](_0x1b57b3,function(_0x4ee03c){if(_0x4ee03c['type']!==_0xdf69('0x3c')){var _0x5aff7d={};_0x5aff7d[_0x4ee03c[_0xdf69('0x2f')]]={'$like':'%'+_0x301bd2[_0xdf69('0x30')][_0xdf69('0x3d')]+'%'};return _0x5aff7d;}})});}_0x19cf2d=_[_0xdf69('0x3b')]({},_0x19cf2d,_0x301bd2['options']);var _0x3de096={'where':_0x19cf2d[_0xdf69('0x3a')]};return db[_0xdf69('0x29')]['count'](_0x3de096)[_0xdf69('0x26')](function(_0xdd919d){_0x1b7c16[_0xdf69('0x21')]=_0xdd919d;if(_0x301bd2[_0xdf69('0x30')][_0xdf69('0x3e')]){_0x19cf2d[_0xdf69('0x3f')]=[{'all':!![]}];}return db[_0xdf69('0x29')]['findAll'](_0x19cf2d);})['then'](function(_0x1fc4aa){_0x1b7c16[_0xdf69('0x40')]=_0x1fc4aa;return _0x1b7c16;})[_0xdf69('0x26')](respondWithFilteredResult(_0xd81d0a,_0x19cf2d))[_0xdf69('0x41')](handleError(_0xd81d0a,null));};exports['show']=function(_0x4a972c,_0x5980b1){var _0x5454e1={'raw':!![],'where':{'id':_0x4a972c['params']['id']}},_0x2abc7f={};_0x2abc7f[_0xdf69('0x2e')]=_['keys'](db[_0xdf69('0x29')][_0xdf69('0x2a')]);_0x2abc7f[_0xdf69('0x30')]=_[_0xdf69('0x42')](_0x4a972c[_0xdf69('0x30')]);_0x2abc7f[_0xdf69('0x31')]=_[_0xdf69('0x32')](_0x2abc7f[_0xdf69('0x2e')],_0x2abc7f[_0xdf69('0x30')]);_0x5454e1['attributes']=_['intersection'](_0x2abc7f[_0xdf69('0x2e')],qs['fields'](_0x4a972c[_0xdf69('0x30')][_0xdf69('0x33')]));_0x5454e1[_0xdf69('0x34')]=_0x5454e1['attributes'][_0xdf69('0x35')]?_0x5454e1[_0xdf69('0x34')]:_0x2abc7f[_0xdf69('0x2e')];if(_0x4a972c[_0xdf69('0x30')]['includeAll']){_0x5454e1[_0xdf69('0x3f')]=[{'all':!![]}];}_0x5454e1=_[_0xdf69('0x3b')]({},_0x5454e1,_0x4a972c['options']);return db['Cdr'][_0xdf69('0x43')](_0x5454e1)[_0xdf69('0x26')](handleEntityNotFound(_0x5980b1,null))[_0xdf69('0x26')](respondWithResult(_0x5980b1,null))[_0xdf69('0x41')](handleError(_0x5980b1,null));};exports[_0xdf69('0x44')]=function(_0x1b46c6,_0x578eec){return db['Cdr'][_0xdf69('0x44')](_0x1b46c6[_0xdf69('0x45')],{})[_0xdf69('0x26')](respondWithResult(_0x578eec,0xc9))[_0xdf69('0x41')](handleError(_0x578eec,null));};exports['update']=function(_0x4bc70f,_0xb34f76){if(_0x4bc70f[_0xdf69('0x45')]['id']){delete _0x4bc70f[_0xdf69('0x45')]['id'];}return db[_0xdf69('0x29')][_0xdf69('0x43')]({'where':{'id':_0x4bc70f[_0xdf69('0x46')]['id']}})[_0xdf69('0x26')](handleEntityNotFound(_0xb34f76,null))[_0xdf69('0x26')](saveUpdates(_0x4bc70f[_0xdf69('0x45')],null))[_0xdf69('0x26')](respondWithResult(_0xb34f76,null))[_0xdf69('0x41')](handleError(_0xb34f76,null));};exports[_0xdf69('0x47')]=function(_0x9a24c9,_0x439b06){return db['Cdr'][_0xdf69('0x43')]({'where':{'id':_0x9a24c9[_0xdf69('0x46')]['id']}})[_0xdf69('0x26')](handleEntityNotFound(_0x439b06,null))['then'](removeEntity(_0x439b06,null))[_0xdf69('0x41')](handleError(_0x439b06,null));};exports[_0xdf69('0x48')]=function(_0x15ca48,_0x4abeb7){return db[_0xdf69('0x29')]['describe']()[_0xdf69('0x26')](respondWithResult(_0x4abeb7,null))[_0xdf69('0x41')](handleError(_0x4abeb7,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 4052242..503861c 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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x152459,_0x4ef11d){var _0x126827=function(_0x434ed6){while(--_0x434ed6){_0x152459['push'](_0x152459['shift']());}};_0x126827(++_0x4ef11d);}(_0x7a54,0x106));var _0x47a5=function(_0x18f857,_0x3b3d3a){_0x18f857=_0x18f857-0x0;var _0x1504bd=_0x7a54[_0x18f857];return _0x1504bd;};'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':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'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(_0x40f2a4,_0x261c4b){var _0x48f496=function(_0x38f49b){while(--_0x38f49b){_0x40f2a4['push'](_0x40f2a4['shift']());}};_0x48f496(++_0x261c4b);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 e521818..a9deadd 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 _0x7f43=['info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then'];(function(_0x51d3ac,_0x2cdcfc){var _0x29b333=function(_0xd4e32){while(--_0xd4e32){_0x51d3ac['push'](_0x51d3ac['shift']());}};_0x29b333(++_0x2cdcfc);}(_0x7f43,0xfb));var _0x37f4=function(_0x45e7b8,_0x1d3180){_0x45e7b8=_0x45e7b8-0x0;var _0x4838a=_0x7f43[_0x45e7b8];return _0x4838a;};'use strict';var _=require(_0x37f4('0x0'));var util=require(_0x37f4('0x1'));var moment=require(_0x37f4('0x2'));var BPromise=require(_0x37f4('0x3'));var rs=require(_0x37f4('0x4'));var fs=require('fs');var Redis=require(_0x37f4('0x5'));var db=require(_0x37f4('0x6'))['db'];var utils=require(_0x37f4('0x7'));var logger=require(_0x37f4('0x8'))(_0x37f4('0x9'));var config=require('../../config/environment');var jayson=require(_0x37f4('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56108c,_0x1a1f11,_0x30e5a9){return new BPromise(function(_0x4a4fbc,_0x3b4b46){return client[_0x37f4('0xb')](_0x56108c,_0x30e5a9)[_0x37f4('0xc')](function(_0x4a09a0){logger[_0x37f4('0xd')](_0x37f4('0xe'),_0x1a1f11,_0x37f4('0xf'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x1a1f11,_0x37f4('0xf'),JSON[_0x37f4('0x10')](_0x4a09a0));if(_0x4a09a0[_0x37f4('0x11')]){if(_0x4a09a0[_0x37f4('0x11')][_0x37f4('0x12')]===0x1f4){logger[_0x37f4('0x11')](_0x37f4('0xe'),_0x1a1f11,_0x4a09a0['error'][_0x37f4('0x13')]);return _0x3b4b46(_0x4a09a0['error'][_0x37f4('0x13')]);}logger['error'](_0x37f4('0xe'),_0x1a1f11,_0x4a09a0[_0x37f4('0x11')][_0x37f4('0x13')]);return _0x4a4fbc(_0x4a09a0[_0x37f4('0x11')][_0x37f4('0x13')]);}else{logger[_0x37f4('0xd')](_0x37f4('0xe'),_0x1a1f11,_0x37f4('0xf'));_0x4a4fbc(_0x4a09a0[_0x37f4('0x14')]['message']);}})[_0x37f4('0x15')](function(_0x448bec){logger[_0x37f4('0x11')](_0x37f4('0xe'),_0x1a1f11,_0x448bec);_0x3b4b46(_0x448bec);});});} \ No newline at end of file +var _0xa585=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x472ede,_0xeafc05){var _0x4b35fd=function(_0x3ae5fc){while(--_0x3ae5fc){_0x472ede['push'](_0x472ede['shift']());}};_0x4b35fd(++_0xeafc05);}(_0xa585,0x84));var _0x5a58=function(_0x4fd508,_0x340941){_0x4fd508=_0x4fd508-0x0;var _0xc8e65b=_0xa585[_0x4fd508];return _0xc8e65b;};'use strict';var _=require(_0x5a58('0x0'));var util=require(_0x5a58('0x1'));var moment=require(_0x5a58('0x2'));var BPromise=require(_0x5a58('0x3'));var rs=require(_0x5a58('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a58('0x5'))['db'];var utils=require(_0x5a58('0x6'));var logger=require(_0x5a58('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5a58('0x8')][_0x5a58('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39a0c9,_0x3a1de1,_0x24d726){return new BPromise(function(_0xe42f84,_0x4396bc){return client[_0x5a58('0xa')](_0x39a0c9,_0x24d726)[_0x5a58('0xb')](function(_0xf3aef9){logger[_0x5a58('0xc')](_0x5a58('0xd'),_0x3a1de1,'request\x20sent');logger[_0x5a58('0xe')](_0x5a58('0xf'),_0x3a1de1,_0x5a58('0x10'),JSON['stringify'](_0xf3aef9));if(_0xf3aef9[_0x5a58('0x11')]){if(_0xf3aef9[_0x5a58('0x11')][_0x5a58('0x12')]===0x1f4){logger['error'](_0x5a58('0xd'),_0x3a1de1,_0xf3aef9[_0x5a58('0x11')][_0x5a58('0x13')]);return _0x4396bc(_0xf3aef9[_0x5a58('0x11')][_0x5a58('0x13')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x3a1de1,_0xf3aef9['error'][_0x5a58('0x13')]);return _0xe42f84(_0xf3aef9['error'][_0x5a58('0x13')]);}else{logger[_0x5a58('0xc')](_0x5a58('0xd'),_0x3a1de1,'request\x20sent');_0xe42f84(_0xf3aef9[_0x5a58('0x14')]['message']);}})[_0x5a58('0x15')](function(_0x2ed5c3){logger[_0x5a58('0x11')](_0x5a58('0xd'),_0x3a1de1,_0x2ed5c3);_0x4396bc(_0x2ed5c3);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index beb48cf..fbdfa02 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(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 _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(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 04f94e1..7babdec 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 _0xbecd=['STRING'];(function(_0x29f800,_0x19fbf1){var _0x213eb2=function(_0x43d3e0){while(--_0x43d3e0){_0x29f800['push'](_0x29f800['shift']());}};_0x213eb2(++_0x19fbf1);}(_0xbecd,0x105));var _0xdbec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbecd[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xdbec('0x0')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xf9c6=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x16fdf2,_0x5c0a1e){var _0x23c7ba=function(_0xa40af){while(--_0xa40af){_0x16fdf2['push'](_0x16fdf2['shift']());}};_0x23c7ba(++_0x5c0a1e);}(_0xf9c6,0x18f));var _0x6f9c=function(_0x459274,_0x384c01){_0x459274=_0x459274-0x0;var _0x35c4ab=_0xf9c6[_0x459274];return _0x35c4ab;};'use strict';var Sequelize=require(_0x6f9c('0x0'));module[_0x6f9c('0x1')]={'priority':{'type':Sequelize[_0x6f9c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6f9c('0x3')],'allowNull':![],'defaultValue':_0x6f9c('0x4')},'appdata':{'type':Sequelize[_0x6f9c('0x5')]()},'description':{'type':Sequelize[_0x6f9c('0x3')]},'interval':{'type':Sequelize[_0x6f9c('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index c7faac7..e115c03 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 _0x2948=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','reject','update','then','destroy','stack','name','model','keys','ChatApplication','query','intersection','attributes','fields','length','includeAll','include','merge','find','body','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x2eea65,_0x7809ce){var _0x859a85=function(_0x3b7e13){while(--_0x3b7e13){_0x2eea65['push'](_0x2eea65['shift']());}};_0x859a85(++_0x7809ce);}(_0x2948,0xcb));var _0x8294=function(_0x18e9c4,_0x45775e){_0x18e9c4=_0x18e9c4-0x0;var _0x3c380f=_0x2948[_0x18e9c4];return _0x3c380f;};'use strict';var emlformat=require(_0x8294('0x0'));var rimraf=require(_0x8294('0x1'));var zipdir=require(_0x8294('0x2'));var jsonpatch=require(_0x8294('0x3'));var rp=require(_0x8294('0x4'));var moment=require(_0x8294('0x5'));var BPromise=require(_0x8294('0x6'));var Mustache=require(_0x8294('0x7'));var util=require(_0x8294('0x8'));var path=require('path');var sox=require(_0x8294('0x9'));var csv=require('to-csv');var ejs=require(_0x8294('0xa'));var fs=require('fs');var fs_extra=require(_0x8294('0xb'));var _=require(_0x8294('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8294('0xd'));var querystring=require(_0x8294('0xe'));var Papa=require('papaparse');var Redis=require(_0x8294('0xf'));var authService=require(_0x8294('0x10'));var qs=require(_0x8294('0x11'));var as=require(_0x8294('0x12'));var hardwareService=require(_0x8294('0x13'));var logger=require(_0x8294('0x14'))('api');var utils=require(_0x8294('0x15'));var config=require(_0x8294('0x16'));var licenseUtil=require(_0x8294('0x17'));var db=require(_0x8294('0x18'))['db'];function respondWithStatusCode(_0x3a13f4,_0x29f1c6){_0x29f1c6=_0x29f1c6||0xcc;return function(_0x71e347){if(_0x71e347){return _0x3a13f4[_0x8294('0x19')](_0x29f1c6);}return _0x3a13f4['status'](_0x29f1c6)[_0x8294('0x1a')]();};}function respondWithResult(_0xde307c,_0x3041ce){_0x3041ce=_0x3041ce||0xc8;return function(_0x552a87){if(_0x552a87){return _0xde307c['status'](_0x3041ce)['json'](_0x552a87);}};}function respondWithFilteredResult(_0x19295d,_0x1bccf6){return function(_0x25c9ae){if(_0x25c9ae){var _0x2ca14b=typeof _0x1bccf6[_0x8294('0x1b')]===_0x8294('0x1c')&&typeof _0x1bccf6[_0x8294('0x1d')]===_0x8294('0x1c');var _0xf93bde=_0x25c9ae[_0x8294('0x1e')];var _0x3d194a=_0x2ca14b?0x0:_0x1bccf6['offset'];var _0x40175a=_0x2ca14b?_0x25c9ae['count']:_0x1bccf6[_0x8294('0x1b')]+_0x1bccf6[_0x8294('0x1d')];var _0x256be3;if(_0x40175a>=_0xf93bde){_0x40175a=_0xf93bde;_0x256be3=0xc8;}else{_0x256be3=0xce;}_0x19295d[_0x8294('0x1f')](_0x256be3);return _0x19295d[_0x8294('0x20')](_0x8294('0x21'),_0x3d194a+'-'+_0x40175a+'/'+_0xf93bde)[_0x8294('0x22')](_0x25c9ae);}return null;};}function patchUpdates(_0x27273d){return function(_0x318fd3){try{jsonpatch['apply'](_0x318fd3,_0x27273d,!![]);}catch(_0x24ea70){return BPromise[_0x8294('0x23')](_0x24ea70);}return _0x318fd3['save']();};}function saveUpdates(_0x1e5d1e,_0x140666){return function(_0xc0eed4){if(_0xc0eed4){return _0xc0eed4[_0x8294('0x24')](_0x1e5d1e)[_0x8294('0x25')](function(_0x3a36af){return _0x3a36af;});}return null;};}function removeEntity(_0x2b6935,_0xff5d69){return function(_0x3aa9f6){if(_0x3aa9f6){return _0x3aa9f6[_0x8294('0x26')]()[_0x8294('0x25')](function(){_0x2b6935['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d2b6a,_0x557529){return function(_0x83f0c4){if(!_0x83f0c4){_0x2d2b6a['sendStatus'](0x194);}return _0x83f0c4;};}function handleError(_0x591b94,_0x37601e){_0x37601e=_0x37601e||0x1f4;return function(_0x399c9d){logger['error'](_0x399c9d[_0x8294('0x27')]);if(_0x399c9d[_0x8294('0x28')]){delete _0x399c9d[_0x8294('0x28')];}_0x591b94[_0x8294('0x1f')](_0x37601e)['send'](_0x399c9d);};}exports['show']=function(_0x311e6b,_0x2d6312){var _0x3ae908={'raw':!![],'where':{'id':_0x311e6b['params']['id']}},_0x4fa43c={};_0x4fa43c[_0x8294('0x29')]=_[_0x8294('0x2a')](db[_0x8294('0x2b')]['rawAttributes']);_0x4fa43c['query']=_[_0x8294('0x2a')](_0x311e6b[_0x8294('0x2c')]);_0x4fa43c['filters']=_[_0x8294('0x2d')](_0x4fa43c[_0x8294('0x29')],_0x4fa43c['query']);_0x3ae908[_0x8294('0x2e')]=_['intersection'](_0x4fa43c[_0x8294('0x29')],qs['fields'](_0x311e6b[_0x8294('0x2c')][_0x8294('0x2f')]));_0x3ae908[_0x8294('0x2e')]=_0x3ae908[_0x8294('0x2e')][_0x8294('0x30')]?_0x3ae908[_0x8294('0x2e')]:_0x4fa43c[_0x8294('0x29')];if(_0x311e6b['query'][_0x8294('0x31')]){_0x3ae908[_0x8294('0x32')]=[{'all':!![]}];}_0x3ae908=_[_0x8294('0x33')]({},_0x3ae908,_0x311e6b['options']);return db[_0x8294('0x2b')][_0x8294('0x34')](_0x3ae908)[_0x8294('0x25')](handleEntityNotFound(_0x2d6312,null))['then'](respondWithResult(_0x2d6312,null))['catch'](handleError(_0x2d6312,null));};exports[_0x8294('0x24')]=function(_0x35a80d,_0x1f60f3){if(_0x35a80d[_0x8294('0x35')]['id']){delete _0x35a80d[_0x8294('0x35')]['id'];}return db[_0x8294('0x2b')][_0x8294('0x34')]({'where':{'id':_0x35a80d[_0x8294('0x36')]['id']}})[_0x8294('0x25')](handleEntityNotFound(_0x1f60f3,null))['then'](saveUpdates(_0x35a80d[_0x8294('0x35')],null))[_0x8294('0x25')](respondWithResult(_0x1f60f3,null))['catch'](handleError(_0x1f60f3,null));};exports[_0x8294('0x26')]=function(_0x8ad38c,_0x1f2b33){return db[_0x8294('0x2b')]['find']({'where':{'id':_0x8ad38c[_0x8294('0x36')]['id']}})[_0x8294('0x25')](handleEntityNotFound(_0x1f2b33,null))[_0x8294('0x25')](removeEntity(_0x1f2b33,null))[_0x8294('0x37')](handleError(_0x1f2b33,null));}; \ No newline at end of file +var _0x4f6f=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','params','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','fields','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4f6f,0x157));var _0xf4f6=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x4f6f[_0x468b0f];return _0x3e74d9;};'use strict';var emlformat=require(_0xf4f6('0x0'));var rimraf=require(_0xf4f6('0x1'));var zipdir=require(_0xf4f6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf4f6('0x3'));var moment=require('moment');var BPromise=require(_0xf4f6('0x4'));var Mustache=require(_0xf4f6('0x5'));var util=require('util');var path=require(_0xf4f6('0x6'));var sox=require(_0xf4f6('0x7'));var csv=require('to-csv');var ejs=require(_0xf4f6('0x8'));var fs=require('fs');var fs_extra=require(_0xf4f6('0x9'));var _=require(_0xf4f6('0xa'));var squel=require('squel');var crypto=require(_0xf4f6('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf4f6('0xc'));var querystring=require(_0xf4f6('0xd'));var Papa=require(_0xf4f6('0xe'));var Redis=require(_0xf4f6('0xf'));var authService=require(_0xf4f6('0x10'));var qs=require(_0xf4f6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf4f6('0x12'));var logger=require(_0xf4f6('0x13'))(_0xf4f6('0x14'));var utils=require(_0xf4f6('0x15'));var config=require(_0xf4f6('0x16'));var licenseUtil=require(_0xf4f6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ea38b,_0x107046){_0x107046=_0x107046||0xcc;return function(_0x4976f5){if(_0x4976f5){return _0x5ea38b['sendStatus'](_0x107046);}return _0x5ea38b[_0xf4f6('0x18')](_0x107046)[_0xf4f6('0x19')]();};}function respondWithResult(_0x33492d,_0x4e623b){_0x4e623b=_0x4e623b||0xc8;return function(_0x3f314c){if(_0x3f314c){return _0x33492d[_0xf4f6('0x18')](_0x4e623b)[_0xf4f6('0x1a')](_0x3f314c);}};}function respondWithFilteredResult(_0x51c4c3,_0xfdf7ae){return function(_0x5ba4c4){if(_0x5ba4c4){var _0x1f06b6=typeof _0xfdf7ae[_0xf4f6('0x1b')]===_0xf4f6('0x1c')&&typeof _0xfdf7ae['limit']===_0xf4f6('0x1c');var _0x310845=_0x5ba4c4[_0xf4f6('0x1d')];var _0x4e1d2a=_0x1f06b6?0x0:_0xfdf7ae[_0xf4f6('0x1b')];var _0x4cb047=_0x1f06b6?_0x5ba4c4[_0xf4f6('0x1d')]:_0xfdf7ae[_0xf4f6('0x1b')]+_0xfdf7ae[_0xf4f6('0x1e')];var _0x4f0d14;if(_0x4cb047>=_0x310845){_0x4cb047=_0x310845;_0x4f0d14=0xc8;}else{_0x4f0d14=0xce;}_0x51c4c3[_0xf4f6('0x18')](_0x4f0d14);return _0x51c4c3[_0xf4f6('0x1f')](_0xf4f6('0x20'),_0x4e1d2a+'-'+_0x4cb047+'/'+_0x310845)[_0xf4f6('0x1a')](_0x5ba4c4);}return null;};}function patchUpdates(_0x112918){return function(_0x794453){try{jsonpatch[_0xf4f6('0x21')](_0x794453,_0x112918,!![]);}catch(_0x30917b){return BPromise[_0xf4f6('0x22')](_0x30917b);}return _0x794453[_0xf4f6('0x23')]();};}function saveUpdates(_0x3a5e24,_0x4d8497){return function(_0x9148f1){if(_0x9148f1){return _0x9148f1[_0xf4f6('0x24')](_0x3a5e24)[_0xf4f6('0x25')](function(_0x55ac8c){return _0x55ac8c;});}return null;};}function removeEntity(_0x1324f3,_0x45b5fb){return function(_0x5bbc9d){if(_0x5bbc9d){return _0x5bbc9d[_0xf4f6('0x26')]()[_0xf4f6('0x25')](function(){_0x1324f3[_0xf4f6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32af7b,_0x224be7){return function(_0x464be1){if(!_0x464be1){_0x32af7b[_0xf4f6('0x27')](0x194);}return _0x464be1;};}function handleError(_0x5f1d69,_0x303e94){_0x303e94=_0x303e94||0x1f4;return function(_0x330ec1){logger[_0xf4f6('0x28')](_0x330ec1[_0xf4f6('0x29')]);if(_0x330ec1[_0xf4f6('0x2a')]){delete _0x330ec1[_0xf4f6('0x2a')];}_0x5f1d69[_0xf4f6('0x18')](_0x303e94)[_0xf4f6('0x2b')](_0x330ec1);};}exports['show']=function(_0x43604d,_0x3fb157){var _0xe13578={'raw':!![],'where':{'id':_0x43604d[_0xf4f6('0x2c')]['id']}},_0x59490b={};_0x59490b[_0xf4f6('0x2d')]=_[_0xf4f6('0x2e')](db[_0xf4f6('0x2f')][_0xf4f6('0x30')]);_0x59490b[_0xf4f6('0x31')]=_[_0xf4f6('0x2e')](_0x43604d[_0xf4f6('0x31')]);_0x59490b[_0xf4f6('0x32')]=_['intersection'](_0x59490b['model'],_0x59490b[_0xf4f6('0x31')]);_0xe13578[_0xf4f6('0x33')]=_[_0xf4f6('0x34')](_0x59490b[_0xf4f6('0x2d')],qs[_0xf4f6('0x35')](_0x43604d[_0xf4f6('0x31')][_0xf4f6('0x35')]));_0xe13578[_0xf4f6('0x33')]=_0xe13578[_0xf4f6('0x33')]['length']?_0xe13578[_0xf4f6('0x33')]:_0x59490b[_0xf4f6('0x2d')];if(_0x43604d[_0xf4f6('0x31')]['includeAll']){_0xe13578[_0xf4f6('0x36')]=[{'all':!![]}];}_0xe13578=_[_0xf4f6('0x37')]({},_0xe13578,_0x43604d[_0xf4f6('0x38')]);return db[_0xf4f6('0x2f')][_0xf4f6('0x39')](_0xe13578)['then'](handleEntityNotFound(_0x3fb157,null))[_0xf4f6('0x25')](respondWithResult(_0x3fb157,null))[_0xf4f6('0x3a')](handleError(_0x3fb157,null));};exports['update']=function(_0x36315f,_0x384436){if(_0x36315f[_0xf4f6('0x3b')]['id']){delete _0x36315f[_0xf4f6('0x3b')]['id'];}return db['ChatApplication'][_0xf4f6('0x39')]({'where':{'id':_0x36315f['params']['id']}})[_0xf4f6('0x25')](handleEntityNotFound(_0x384436,null))[_0xf4f6('0x25')](saveUpdates(_0x36315f[_0xf4f6('0x3b')],null))['then'](respondWithResult(_0x384436,null))[_0xf4f6('0x3a')](handleError(_0x384436,null));};exports[_0xf4f6('0x26')]=function(_0x46f9b9,_0xf11e25){return db['ChatApplication'][_0xf4f6('0x39')]({'where':{'id':_0x46f9b9[_0xf4f6('0x2c')]['id']}})[_0xf4f6('0x25')](handleEntityNotFound(_0xf11e25,null))['then'](removeEntity(_0xf11e25,null))[_0xf4f6('0x3a')](handleError(_0xf11e25,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index f87fd09..15419fb 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 _0x20ef=['./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x177a61,_0x40b148){var _0x49a6a8=function(_0xa68318){while(--_0xa68318){_0x177a61['push'](_0x177a61['shift']());}};_0x49a6a8(++_0x40b148);}(_0x20ef,0xe6));var _0xf20e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf20e('0x0'));var util=require(_0xf20e('0x1'));var logger=require(_0xf20e('0x2'))(_0xf20e('0x3'));var moment=require(_0xf20e('0x4'));var BPromise=require(_0xf20e('0x5'));var rp=require(_0xf20e('0x6'));var fs=require('fs');var path=require(_0xf20e('0x7'));var rimraf=require(_0xf20e('0x8'));var config=require(_0xf20e('0x9'));var attributes=require(_0xf20e('0xa'));module[_0xf20e('0xb')]=function(_0x40bc26,_0x27b0b2){return _0x40bc26[_0xf20e('0xc')](_0xf20e('0xd'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf20e('0xe'),'collate':_0xf20e('0xf')});}; \ No newline at end of file +var _0xe1ce=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication','lodash'];(function(_0x4ae666,_0x5e849a){var _0x3d282a=function(_0x2d9979){while(--_0x2d9979){_0x4ae666['push'](_0x4ae666['shift']());}};_0x3d282a(++_0x5e849a);}(_0xe1ce,0x15e));var _0xee1c=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xe1ce[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0xee1c('0x0'));var util=require(_0xee1c('0x1'));var logger=require(_0xee1c('0x2'))(_0xee1c('0x3'));var moment=require(_0xee1c('0x4'));var BPromise=require(_0xee1c('0x5'));var rp=require(_0xee1c('0x6'));var fs=require('fs');var path=require(_0xee1c('0x7'));var rimraf=require(_0xee1c('0x8'));var config=require(_0xee1c('0x9'));var attributes=require('./chatApplication.attributes');module[_0xee1c('0xa')]=function(_0x4f0733,_0x5729f0){return _0x4f0733[_0xee1c('0xb')](_0xee1c('0xc'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 78592ef..a187c1c 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 _0x72af=['../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','message','ChatApplication,\x20%s,\x20%s','info','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x72af,0xb5));var _0xf72a=function(_0x24de55,_0x43bf51){_0x24de55=_0x24de55-0x0;var _0x48400f=_0x72af[_0x24de55];return _0x48400f;};'use strict';var _=require(_0xf72a('0x0'));var util=require(_0xf72a('0x1'));var moment=require(_0xf72a('0x2'));var BPromise=require(_0xf72a('0x3'));var rs=require(_0xf72a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf72a('0x5'));var logger=require(_0xf72a('0x6'))(_0xf72a('0x7'));var config=require(_0xf72a('0x8'));var jayson=require(_0xf72a('0x9'));var client=jayson[_0xf72a('0xa')][_0xf72a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30e0d5,_0x487a9e,_0x51996f){return new BPromise(function(_0x5c7beb,_0x5044c5){return client[_0xf72a('0xc')](_0x30e0d5,_0x51996f)['then'](function(_0x5b2965){logger['info']('ChatApplication,\x20%s,\x20%s',_0x487a9e,_0xf72a('0xd'));logger[_0xf72a('0xe')](_0xf72a('0xf'),_0x487a9e,_0xf72a('0xd'),JSON['stringify'](_0x5b2965));if(_0x5b2965[_0xf72a('0x10')]){if(_0x5b2965[_0xf72a('0x10')]['code']===0x1f4){logger[_0xf72a('0x10')]('ChatApplication,\x20%s,\x20%s',_0x487a9e,_0x5b2965[_0xf72a('0x10')][_0xf72a('0x11')]);return _0x5044c5(_0x5b2965[_0xf72a('0x10')][_0xf72a('0x11')]);}logger[_0xf72a('0x10')](_0xf72a('0x12'),_0x487a9e,_0x5b2965['error']['message']);return _0x5c7beb(_0x5b2965[_0xf72a('0x10')]['message']);}else{logger[_0xf72a('0x13')](_0xf72a('0x12'),_0x487a9e,_0xf72a('0xd'));_0x5c7beb(_0x5b2965['result']['message']);}})[_0xf72a('0x14')](function(_0x46757c){logger['error'](_0xf72a('0x12'),_0x487a9e,_0x46757c);_0x5044c5(_0x46757c);});});} \ No newline at end of file +var _0xf5e3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','ChatApplication,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','randomstring'];(function(_0x248baa,_0x4fbab1){var _0x4e8f6c=function(_0x252bc8){while(--_0x252bc8){_0x248baa['push'](_0x248baa['shift']());}};_0x4e8f6c(++_0x4fbab1);}(_0xf5e3,0x13e));var _0x3f5e=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xf5e3[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0x3f5e('0x0'));var util=require(_0x3f5e('0x1'));var moment=require(_0x3f5e('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f5e('0x3'));var fs=require('fs');var Redis=require(_0x3f5e('0x4'));var db=require(_0x3f5e('0x5'))['db'];var utils=require(_0x3f5e('0x6'));var logger=require(_0x3f5e('0x7'))(_0x3f5e('0x8'));var config=require(_0x3f5e('0x9'));var jayson=require(_0x3f5e('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xea8f77,_0x40a479,_0x1f9e47){return new BPromise(function(_0x598a59,_0x40a0fc){return client[_0x3f5e('0xb')](_0xea8f77,_0x1f9e47)[_0x3f5e('0xc')](function(_0x5b1afd){logger[_0x3f5e('0xd')]('ChatApplication,\x20%s,\x20%s',_0x40a479,'request\x20sent');logger[_0x3f5e('0xe')](_0x3f5e('0xf'),_0x40a479,'request\x20sent',JSON['stringify'](_0x5b1afd));if(_0x5b1afd[_0x3f5e('0x10')]){if(_0x5b1afd['error'][_0x3f5e('0x11')]===0x1f4){logger[_0x3f5e('0x10')](_0x3f5e('0x12'),_0x40a479,_0x5b1afd[_0x3f5e('0x10')][_0x3f5e('0x13')]);return _0x40a0fc(_0x5b1afd[_0x3f5e('0x10')][_0x3f5e('0x13')]);}logger[_0x3f5e('0x10')](_0x3f5e('0x12'),_0x40a479,_0x5b1afd[_0x3f5e('0x10')][_0x3f5e('0x13')]);return _0x598a59(_0x5b1afd[_0x3f5e('0x10')][_0x3f5e('0x13')]);}else{logger[_0x3f5e('0xd')](_0x3f5e('0x12'),_0x40a479,_0x3f5e('0x14'));_0x598a59(_0x5b1afd[_0x3f5e('0x15')]['message']);}})[_0x3f5e('0x16')](function(_0x2cc355){logger['error'](_0x3f5e('0x12'),_0x40a479,_0x2cc355);_0x40a0fc(_0x2cc355);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 45dbde1..1a5261c 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 _0xa707=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/:id','show','put','isAuthenticated','update','destroy','exports','multer','util','path'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xa707,0xfd));var _0x7a70=function(_0x4bb3ea,_0x2ce356){_0x4bb3ea=_0x4bb3ea-0x0;var _0xdb178a=_0xa707[_0x4bb3ea];return _0xdb178a;};'use strict';var multer=require(_0x7a70('0x0'));var util=require(_0x7a70('0x1'));var path=require(_0x7a70('0x2'));var timeout=require(_0x7a70('0x3'));var express=require(_0x7a70('0x4'));var router=express[_0x7a70('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7a70('0x6'));var interaction=require(_0x7a70('0x7'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x7a70('0x8')](_0x7a70('0x9'),auth['isAuthenticated'](),controller[_0x7a70('0xa')]);router[_0x7a70('0xb')](_0x7a70('0x9'),auth[_0x7a70('0xc')](),controller[_0x7a70('0xd')]);router['delete']('/:id',auth[_0x7a70('0xc')](),controller[_0x7a70('0xe')]);module[_0x7a70('0xf')]=router; \ No newline at end of file +var _0xb994=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','update','delete','destroy','util','path','connect-timeout'];(function(_0x3c704f,_0x5b5106){var _0x550c19=function(_0x562091){while(--_0x562091){_0x3c704f['push'](_0x3c704f['shift']());}};_0x550c19(++_0x5b5106);}(_0xb994,0x97));var _0x4b99=function(_0x39d812,_0x9b37e5){_0x39d812=_0x39d812-0x0;var _0x43882d=_0xb994[_0x39d812];return _0x43882d;};'use strict';var multer=require('multer');var util=require(_0x4b99('0x0'));var path=require(_0x4b99('0x1'));var timeout=require(_0x4b99('0x2'));var express=require(_0x4b99('0x3'));var router=express[_0x4b99('0x4')]();var fs_extra=require(_0x4b99('0x5'));var auth=require(_0x4b99('0x6'));var interaction=require(_0x4b99('0x7'));var config=require(_0x4b99('0x8'));var controller=require('./chatApplication.controller');router['get'](_0x4b99('0x9'),auth[_0x4b99('0xa')](),controller['show']);router['put'](_0x4b99('0x9'),auth[_0x4b99('0xa')](),controller[_0x4b99('0xb')]);router[_0x4b99('0xc')](_0x4b99('0x9'),auth[_0x4b99('0xa')](),controller[_0x4b99('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 1da0ce5..e054343 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 _0xf4a9=['sequelize','exports','STRING','BOOLEAN'];(function(_0x3b3466,_0x228276){var _0x16157f=function(_0x51a1af){while(--_0x51a1af){_0x3b3466['push'](_0x3b3466['shift']());}};_0x16157f(++_0x228276);}(_0xf4a9,0x164));var _0x9f4a=function(_0x1cd51f,_0x297954){_0x1cd51f=_0x1cd51f-0x0;var _0x54208a=_0xf4a9[_0x1cd51f];return _0x54208a;};'use strict';var Sequelize=require(_0x9f4a('0x0'));module[_0x9f4a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9f4a('0x2')]},'write':{'type':Sequelize[_0x9f4a('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd1ca=['sequelize','exports'];(function(_0x16d03f,_0x308f79){var _0x235081=function(_0xc768ec){while(--_0xc768ec){_0x16d03f['push'](_0x16d03f['shift']());}};_0x235081(++_0x308f79);}(_0xd1ca,0x140));var _0xad1c=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xd1ca[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0xad1c('0x0'));module[_0xad1c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 6b18438..9e54da2 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 _0x2b45=['includeAll','findAll','catch','show','params','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','order','$gte','eml-format','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','end','sendStatus','error','stack','name','send','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','merge','options','ChatGroup'];(function(_0x283d30,_0x4a0b8a){var _0x5540f1=function(_0x4c20f3){while(--_0x4c20f3){_0x283d30['push'](_0x283d30['shift']());}};_0x5540f1(++_0x4a0b8a);}(_0x2b45,0x71));var _0x52b4=function(_0x47b844,_0x540bac){_0x47b844=_0x47b844-0x0;var _0x86cc76=_0x2b45[_0x47b844];return _0x86cc76;};'use strict';var emlformat=require(_0x52b4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x52b4('0x1'));var moment=require(_0x52b4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x52b4('0x3'));var util=require('util');var path=require(_0x52b4('0x4'));var sox=require(_0x52b4('0x5'));var csv=require(_0x52b4('0x6'));var ejs=require(_0x52b4('0x7'));var fs=require('fs');var fs_extra=require(_0x52b4('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x52b4('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x52b4('0xa'));var Redis=require(_0x52b4('0xb'));var authService=require(_0x52b4('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x52b4('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x52b4('0xe'))(_0x52b4('0xf'));var utils=require(_0x52b4('0x10'));var config=require(_0x52b4('0x11'));var licenseUtil=require(_0x52b4('0x12'));var db=require(_0x52b4('0x13'))['db'];config[_0x52b4('0x14')]=_[_0x52b4('0x15')](config['redis'],{'host':_0x52b4('0x16'),'port':0x18eb});var socket=require(_0x52b4('0x17'))(new Redis(config[_0x52b4('0x14')]));require(_0x52b4('0x18'))[_0x52b4('0x19')](socket);function respondWithStatusCode(_0x141132,_0x332300){_0x332300=_0x332300||0xcc;return function(_0x4bc1f4){if(_0x4bc1f4){return _0x141132['sendStatus'](_0x332300);}return _0x141132['status'](_0x332300)['end']();};}function respondWithResult(_0x23c48e,_0x38b1f1){_0x38b1f1=_0x38b1f1||0xc8;return function(_0x50fdb8){if(_0x50fdb8){return _0x23c48e[_0x52b4('0x1a')](_0x38b1f1)[_0x52b4('0x1b')](_0x50fdb8);}};}function respondWithFilteredResult(_0x173318,_0x4c8800){return function(_0x256353){if(_0x256353){var _0x3f5a9f=typeof _0x4c8800[_0x52b4('0x1c')]===_0x52b4('0x1d')&&typeof _0x4c8800[_0x52b4('0x1e')]===_0x52b4('0x1d');var _0x2a873d=_0x256353[_0x52b4('0x1f')];var _0x39cb32=_0x3f5a9f?0x0:_0x4c8800[_0x52b4('0x1c')];var _0x5188d5=_0x3f5a9f?_0x256353['count']:_0x4c8800[_0x52b4('0x1c')]+_0x4c8800[_0x52b4('0x1e')];var _0x4ccbce;if(_0x5188d5>=_0x2a873d){_0x5188d5=_0x2a873d;_0x4ccbce=0xc8;}else{_0x4ccbce=0xce;}_0x173318[_0x52b4('0x1a')](_0x4ccbce);return _0x173318[_0x52b4('0x20')](_0x52b4('0x21'),_0x39cb32+'-'+_0x5188d5+'/'+_0x2a873d)[_0x52b4('0x1b')](_0x256353);}return null;};}function patchUpdates(_0x4561bf){return function(_0x2630ab){try{jsonpatch[_0x52b4('0x22')](_0x2630ab,_0x4561bf,!![]);}catch(_0x30fd4b){return BPromise['reject'](_0x30fd4b);}return _0x2630ab[_0x52b4('0x23')]();};}function saveUpdates(_0x15efc0,_0x13a05e){return function(_0x2801d3){if(_0x2801d3){return _0x2801d3[_0x52b4('0x24')](_0x15efc0)['then'](function(_0x40fe6a){return _0x40fe6a;});}return null;};}function removeEntity(_0x56d3a9,_0x2716eb){return function(_0x4b3ee1){if(_0x4b3ee1){return _0x4b3ee1[_0x52b4('0x25')]()[_0x52b4('0x26')](function(){_0x56d3a9[_0x52b4('0x1a')](0xcc)[_0x52b4('0x27')]();});}};}function handleEntityNotFound(_0x433a2b,_0x23b8f0){return function(_0x46b49e){if(!_0x46b49e){_0x433a2b[_0x52b4('0x28')](0x194);}return _0x46b49e;};}function handleError(_0x44aab8,_0x19cdd6){_0x19cdd6=_0x19cdd6||0x1f4;return function(_0x5f20ce){logger[_0x52b4('0x29')](_0x5f20ce[_0x52b4('0x2a')]);if(_0x5f20ce[_0x52b4('0x2b')]){delete _0x5f20ce[_0x52b4('0x2b')];}_0x44aab8['status'](_0x19cdd6)[_0x52b4('0x2c')](_0x5f20ce);};}exports['index']=function(_0x6ade4b,_0x15453d){var _0x3a56b9={},_0x202614={},_0x198d2a={'count':0x0,'rows':[]};var _0x530bfd=_['map'](db['ChatGroup'][_0x52b4('0x2d')],function(_0x11b331){return{'name':_0x11b331[_0x52b4('0x2e')],'type':_0x11b331['type'][_0x52b4('0x2f')]};});_0x202614[_0x52b4('0x30')]=_[_0x52b4('0x31')](_0x530bfd,_0x52b4('0x2b'));_0x202614['query']=_[_0x52b4('0x32')](_0x6ade4b[_0x52b4('0x33')]);_0x202614[_0x52b4('0x34')]=_[_0x52b4('0x35')](_0x202614['model'],_0x202614[_0x52b4('0x33')]);_0x3a56b9['attributes']=_[_0x52b4('0x35')](_0x202614[_0x52b4('0x30')],qs[_0x52b4('0x36')](_0x6ade4b[_0x52b4('0x33')]['fields']));_0x3a56b9[_0x52b4('0x37')]=_0x3a56b9[_0x52b4('0x37')][_0x52b4('0x38')]?_0x3a56b9[_0x52b4('0x37')]:_0x202614['model'];if(!_0x6ade4b['query'][_0x52b4('0x39')](_0x52b4('0x3a'))){_0x3a56b9[_0x52b4('0x1e')]=qs[_0x52b4('0x1e')](_0x6ade4b[_0x52b4('0x33')][_0x52b4('0x1e')]);_0x3a56b9[_0x52b4('0x1c')]=qs[_0x52b4('0x1c')](_0x6ade4b['query'][_0x52b4('0x1c')]);}_0x3a56b9['order']=qs[_0x52b4('0x3b')](_0x6ade4b[_0x52b4('0x33')][_0x52b4('0x3b')]);_0x3a56b9['where']=qs[_0x52b4('0x34')](_[_0x52b4('0x3c')](_0x6ade4b[_0x52b4('0x33')],_0x202614[_0x52b4('0x34')]),_0x530bfd);if(_0x6ade4b[_0x52b4('0x33')][_0x52b4('0x3d')]){_0x3a56b9[_0x52b4('0x3e')]=_['merge'](_0x3a56b9[_0x52b4('0x3e')],{'$or':_[_0x52b4('0x31')](_0x530bfd,function(_0x57b8a0){if(_0x57b8a0[_0x52b4('0x3f')]!=='VIRTUAL'){var _0x55596e={};_0x55596e[_0x57b8a0[_0x52b4('0x2b')]]={'$like':'%'+_0x6ade4b[_0x52b4('0x33')][_0x52b4('0x3d')]+'%'};return _0x55596e;}})});}_0x3a56b9=_[_0x52b4('0x40')]({},_0x3a56b9,_0x6ade4b[_0x52b4('0x41')]);var _0xf331dc={'where':_0x3a56b9['where']};return db[_0x52b4('0x42')]['count'](_0xf331dc)['then'](function(_0x420076){_0x198d2a[_0x52b4('0x1f')]=_0x420076;if(_0x6ade4b[_0x52b4('0x33')][_0x52b4('0x43')]){_0x3a56b9['include']=[{'all':!![]}];}return db['ChatGroup'][_0x52b4('0x44')](_0x3a56b9);})[_0x52b4('0x26')](function(_0x44d916){_0x198d2a['rows']=_0x44d916;return _0x198d2a;})[_0x52b4('0x26')](respondWithFilteredResult(_0x15453d,_0x3a56b9))[_0x52b4('0x45')](handleError(_0x15453d,null));};exports[_0x52b4('0x46')]=function(_0x341813,_0x531799){var _0x2da4dd={'raw':!![],'where':{'id':_0x341813[_0x52b4('0x47')]['id']}},_0x3bbfc0={};_0x3bbfc0[_0x52b4('0x30')]=_['keys'](db['ChatGroup']['rawAttributes']);_0x3bbfc0[_0x52b4('0x33')]=_[_0x52b4('0x32')](_0x341813['query']);_0x3bbfc0['filters']=_[_0x52b4('0x35')](_0x3bbfc0['model'],_0x3bbfc0[_0x52b4('0x33')]);_0x2da4dd[_0x52b4('0x37')]=_['intersection'](_0x3bbfc0[_0x52b4('0x30')],qs[_0x52b4('0x36')](_0x341813['query'][_0x52b4('0x36')]));_0x2da4dd[_0x52b4('0x37')]=_0x2da4dd[_0x52b4('0x37')]['length']?_0x2da4dd[_0x52b4('0x37')]:_0x3bbfc0[_0x52b4('0x30')];if(_0x341813[_0x52b4('0x33')]['includeAll']){_0x2da4dd['include']=[{'all':!![]}];}_0x2da4dd=_[_0x52b4('0x40')]({},_0x2da4dd,_0x341813[_0x52b4('0x41')]);return db[_0x52b4('0x42')][_0x52b4('0x48')](_0x2da4dd)['then'](handleEntityNotFound(_0x531799,null))['then'](respondWithResult(_0x531799,null))[_0x52b4('0x45')](handleError(_0x531799,null));};exports['create']=function(_0xdcc78b,_0x2a9d64){return db[_0x52b4('0x42')][_0x52b4('0x49')](_0xdcc78b[_0x52b4('0x4a')],{})['then'](respondWithResult(_0x2a9d64,0xc9))['catch'](handleError(_0x2a9d64,null));};exports[_0x52b4('0x24')]=function(_0xf3e0e,_0x23a814){if(_0xf3e0e[_0x52b4('0x4a')]['id']){delete _0xf3e0e[_0x52b4('0x4a')]['id'];}return db[_0x52b4('0x42')][_0x52b4('0x48')]({'where':{'id':_0xf3e0e[_0x52b4('0x47')]['id']}})[_0x52b4('0x26')](handleEntityNotFound(_0x23a814,null))['then'](saveUpdates(_0xf3e0e[_0x52b4('0x4a')],null))[_0x52b4('0x26')](respondWithResult(_0x23a814,null))[_0x52b4('0x45')](handleError(_0x23a814,null));};exports['destroy']=function(_0x242062,_0x9c540a){return db[_0x52b4('0x42')]['find']({'where':{'id':_0x242062['params']['id']}})[_0x52b4('0x26')](handleEntityNotFound(_0x9c540a,null))[_0x52b4('0x26')](removeEntity(_0x9c540a,null))[_0x52b4('0x45')](handleError(_0x9c540a,null));};exports[_0x52b4('0x4b')]=function(_0x3807b3,_0x54cf1e){return db[_0x52b4('0x42')][_0x52b4('0x4b')]()['then'](respondWithResult(_0x54cf1e,null))[_0x52b4('0x45')](handleError(_0x54cf1e,null));};exports[_0x52b4('0x4c')]=function(_0x11b4ad,_0x577730,_0x5f59de){return db[_0x52b4('0x4d')]['count']({'where':{'ChatGroupId':_0x11b4ad[_0x52b4('0x47')]['id'],'ToId':_0x11b4ad[_0x52b4('0x4e')]['id'],'read':![]}})[_0x52b4('0x26')](function(_0x1d7466){return{'id':_[_0x52b4('0x4f')](_0x11b4ad[_0x52b4('0x47')]['id']),'count':_0x1d7466};})[_0x52b4('0x26')](respondWithResult(_0x577730,null))[_0x52b4('0x45')](handleError(_0x577730,null));};exports[_0x52b4('0x50')]=function(_0x41d847,_0x3290a3,_0x32b035){return db[_0x52b4('0x42')][_0x52b4('0x48')]({'where':{'id':_0x41d847[_0x52b4('0x47')]['id']}})[_0x52b4('0x26')](handleEntityNotFound(_0x3290a3,null))[_0x52b4('0x26')](function(_0x3e7c9e){if(_0x3e7c9e){return _0x3e7c9e['addMembers'](_0x41d847[_0x52b4('0x4a')][_0x52b4('0x51')],_[_0x52b4('0x52')](_0x41d847[_0x52b4('0x4a')],[_0x52b4('0x51'),'id'])||{});}})[_0x52b4('0x26')](respondWithResult(_0x3290a3,null))[_0x52b4('0x45')](handleError(_0x3290a3,null));};exports[_0x52b4('0x53')]=function(_0x1d8491,_0x17ce1d,_0x144758){var _0x267b0f={};var _0x377ed5={};var _0x5ea896;var _0x301635;return db['ChatGroup']['findOne']({'where':{'id':_0x1d8491['params']['id']}})[_0x52b4('0x26')](handleEntityNotFound(_0x17ce1d,null))[_0x52b4('0x26')](function(_0x40363b){if(_0x40363b){_0x5ea896=_0x40363b;_0x377ed5[_0x52b4('0x30')]=_[_0x52b4('0x32')](db['User'][_0x52b4('0x2d')]);_0x377ed5[_0x52b4('0x33')]=_[_0x52b4('0x32')](_0x1d8491['query']);_0x377ed5[_0x52b4('0x34')]=_[_0x52b4('0x35')](_0x377ed5['model'],_0x377ed5[_0x52b4('0x33')]);_0x267b0f[_0x52b4('0x37')]=_[_0x52b4('0x35')](_0x377ed5[_0x52b4('0x30')],qs[_0x52b4('0x36')](_0x1d8491[_0x52b4('0x33')][_0x52b4('0x36')]));_0x267b0f[_0x52b4('0x37')]=_0x267b0f[_0x52b4('0x37')]['length']?_0x267b0f[_0x52b4('0x37')]:_0x377ed5['model'];_0x267b0f['order']=qs[_0x52b4('0x3b')](_0x1d8491[_0x52b4('0x33')]['sort']);_0x267b0f[_0x52b4('0x3e')]=qs[_0x52b4('0x34')](_[_0x52b4('0x3c')](_0x1d8491[_0x52b4('0x33')],_0x377ed5['filters']));if(_0x1d8491[_0x52b4('0x33')][_0x52b4('0x3d')]){_0x267b0f[_0x52b4('0x3e')]=_[_0x52b4('0x40')](_0x267b0f[_0x52b4('0x3e')],{'$or':_['map'](_0x267b0f[_0x52b4('0x37')],function(_0x2ef862){var _0x4416fa={};_0x4416fa[_0x2ef862]={'$like':'%'+_0x1d8491[_0x52b4('0x33')]['filter']+'%'};return _0x4416fa;})});}_0x267b0f=_['merge']({},_0x267b0f,_0x1d8491['options']);return _0x5ea896[_0x52b4('0x53')](_0x267b0f);}})[_0x52b4('0x26')](function(_0x4129ea){if(_0x4129ea){_0x301635=_0x4129ea['length'];if(!_0x1d8491[_0x52b4('0x33')]['hasOwnProperty']('nolimit')){_0x267b0f[_0x52b4('0x1e')]=qs[_0x52b4('0x1e')](_0x1d8491[_0x52b4('0x33')][_0x52b4('0x1e')]);_0x267b0f[_0x52b4('0x1c')]=qs[_0x52b4('0x1c')](_0x1d8491[_0x52b4('0x33')][_0x52b4('0x1c')]);}return _0x5ea896['getMembers'](_0x267b0f);}})['then'](function(_0x60a22){if(_0x60a22){return _0x60a22?{'count':_0x301635,'rows':_0x60a22}:null;}})[_0x52b4('0x26')](respondWithResult(_0x17ce1d,null))['catch'](handleError(_0x17ce1d,null));};exports[_0x52b4('0x54')]=function(_0x55cc49,_0x16f28d,_0x13eb57){return db[_0x52b4('0x42')][_0x52b4('0x48')]({'where':{'id':_0x55cc49[_0x52b4('0x47')]['id']}})[_0x52b4('0x26')](handleEntityNotFound(_0x16f28d,null))[_0x52b4('0x26')](function(_0x134b03){if(_0x134b03){return _0x134b03[_0x52b4('0x54')](_0x55cc49[_0x52b4('0x33')][_0x52b4('0x51')]);}})[_0x52b4('0x26')](respondWithStatusCode(_0x16f28d,null))[_0x52b4('0x45')](handleError(_0x16f28d,null));};exports[_0x52b4('0x55')]=function(_0x3feee4,_0x2766b2,_0x199a02){if(_0x3feee4[_0x52b4('0x4a')]['id']){delete _0x3feee4[_0x52b4('0x4a')]['id'];}return db[_0x52b4('0x42')]['find']({'where':{'id':_0x3feee4['params']['id']}})['then'](handleEntityNotFound(_0x2766b2,null))[_0x52b4('0x26')](function(_0x2e0b8c){if(_0x2e0b8c){_0x3feee4[_0x52b4('0x4a')][_0x52b4('0x56')]=_0x2e0b8c['id'];return db[_0x52b4('0x4d')][_0x52b4('0x49')](_0x3feee4['body']);}})['then'](respondWithResult(_0x2766b2,null))[_0x52b4('0x45')](handleError(_0x2766b2,null));};exports[_0x52b4('0x57')]=function(_0x490ce6,_0x3919ba,_0xb24883){var _0x289d01={};var _0x27baff={};var _0x1ee5d5;var _0x506484;return db[_0x52b4('0x42')]['findOne']({'where':{'id':_0x490ce6['params']['id']}})[_0x52b4('0x26')](handleEntityNotFound(_0x3919ba,null))[_0x52b4('0x26')](function(_0x51ffda){if(_0x51ffda){_0x1ee5d5=_0x51ffda;_0x27baff[_0x52b4('0x30')]=_[_0x52b4('0x32')](db[_0x52b4('0x4d')][_0x52b4('0x2d')]);_0x27baff[_0x52b4('0x33')]=_[_0x52b4('0x32')](_0x490ce6[_0x52b4('0x33')]);_0x27baff[_0x52b4('0x34')]=_[_0x52b4('0x35')](_0x27baff[_0x52b4('0x30')],_0x27baff[_0x52b4('0x33')]);_0x289d01[_0x52b4('0x37')]=_[_0x52b4('0x35')](_0x27baff[_0x52b4('0x30')],qs[_0x52b4('0x36')](_0x490ce6[_0x52b4('0x33')][_0x52b4('0x36')]));_0x289d01[_0x52b4('0x37')]=_0x289d01[_0x52b4('0x37')][_0x52b4('0x38')]?_0x289d01[_0x52b4('0x37')]:_0x27baff['model'];_0x289d01[_0x52b4('0x58')]=qs[_0x52b4('0x3b')](_0x490ce6[_0x52b4('0x33')][_0x52b4('0x3b')]);_0x289d01[_0x52b4('0x3e')]=qs[_0x52b4('0x34')](_[_0x52b4('0x3c')](_0x490ce6[_0x52b4('0x33')],_0x27baff[_0x52b4('0x34')]));if(_0x490ce6[_0x52b4('0x33')][_0x52b4('0x3d')]){_0x289d01[_0x52b4('0x3e')]=_['merge'](_0x289d01[_0x52b4('0x3e')],{'$or':_[_0x52b4('0x31')](_0x289d01[_0x52b4('0x37')],function(_0x27398b){var _0x3819e0={};_0x3819e0[_0x27398b]={'$like':'%'+_0x490ce6[_0x52b4('0x33')][_0x52b4('0x3d')]+'%'};return _0x3819e0;})});}if(_0x490ce6[_0x52b4('0x33')][_0x52b4('0x59')]){var _0x32637f=_0x490ce6[_0x52b4('0x33')][_0x52b4('0x59')]['split'](',');var _0x3f11da={};_0x3f11da[_0x32637f[0x0]]={'$gte':moment(_0x32637f[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x289d01[_0x52b4('0x3e')]=_[_0x52b4('0x40')](_0x289d01[_0x52b4('0x3e')],_0x3f11da);}_0x289d01=_['merge']({},_0x289d01,_0x490ce6[_0x52b4('0x41')]);return _0x1ee5d5[_0x52b4('0x57')](_0x289d01);}})[_0x52b4('0x26')](function(_0x11c438){if(_0x11c438){_0x506484=_0x11c438['length'];if(!_0x490ce6[_0x52b4('0x33')]['hasOwnProperty'](_0x52b4('0x3a'))){_0x289d01[_0x52b4('0x1e')]=qs[_0x52b4('0x1e')](_0x490ce6[_0x52b4('0x33')]['limit']);_0x289d01['offset']=qs[_0x52b4('0x1c')](_0x490ce6[_0x52b4('0x33')][_0x52b4('0x1c')]);}return _0x1ee5d5['getMessages'](_0x289d01);}})['then'](function(_0x823cd8){if(_0x823cd8){return _0x823cd8?{'count':_0x506484,'rows':_0x823cd8}:null;}})[_0x52b4('0x26')](respondWithResult(_0x3919ba,null))[_0x52b4('0x45')](handleError(_0x3919ba,null));}; \ No newline at end of file +var _0x21a6=['create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','order','pick','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./chatGroup.socket','register','status','end','json','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','key','model','keys','filters','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','find'];(function(_0x19283a,_0x303ffc){var _0x14b3b3=function(_0x434de2){while(--_0x434de2){_0x19283a['push'](_0x19283a['shift']());}};_0x14b3b3(++_0x303ffc);}(_0x21a6,0x1f0));var _0x621a=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0x21a6[_0x26d6d9];return _0x1b4875;};'use strict';var emlformat=require(_0x621a('0x0'));var rimraf=require(_0x621a('0x1'));var zipdir=require(_0x621a('0x2'));var jsonpatch=require(_0x621a('0x3'));var rp=require(_0x621a('0x4'));var moment=require(_0x621a('0x5'));var BPromise=require(_0x621a('0x6'));var Mustache=require(_0x621a('0x7'));var util=require(_0x621a('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x621a('0x9'));var ejs=require(_0x621a('0xa'));var fs=require('fs');var fs_extra=require(_0x621a('0xb'));var _=require(_0x621a('0xc'));var squel=require(_0x621a('0xd'));var crypto=require(_0x621a('0xe'));var jsforce=require(_0x621a('0xf'));var deskjs=require(_0x621a('0x10'));var toCsv=require(_0x621a('0x9'));var querystring=require(_0x621a('0x11'));var Papa=require('papaparse');var Redis=require(_0x621a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x621a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x621a('0x14'))(_0x621a('0x15'));var utils=require(_0x621a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x621a('0x17'));var db=require('../../mysqldb')['db'];config[_0x621a('0x18')]=_[_0x621a('0x19')](config['redis'],{'host':_0x621a('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x621a('0x18')]));require(_0x621a('0x1b'))[_0x621a('0x1c')](socket);function respondWithStatusCode(_0x5f4ef7,_0xd4f528){_0xd4f528=_0xd4f528||0xcc;return function(_0x54eb8b){if(_0x54eb8b){return _0x5f4ef7['sendStatus'](_0xd4f528);}return _0x5f4ef7[_0x621a('0x1d')](_0xd4f528)[_0x621a('0x1e')]();};}function respondWithResult(_0x26ba03,_0x2c157c){_0x2c157c=_0x2c157c||0xc8;return function(_0x50c6a1){if(_0x50c6a1){return _0x26ba03[_0x621a('0x1d')](_0x2c157c)[_0x621a('0x1f')](_0x50c6a1);}};}function respondWithFilteredResult(_0x19c7ed,_0x46a7bc){return function(_0x4e2036){if(_0x4e2036){var _0x356b45=typeof _0x46a7bc[_0x621a('0x20')]==='undefined'&&typeof _0x46a7bc['limit']==='undefined';var _0x11b3ee=_0x4e2036[_0x621a('0x21')];var _0x5de37b=_0x356b45?0x0:_0x46a7bc[_0x621a('0x20')];var _0x68dad6=_0x356b45?_0x4e2036['count']:_0x46a7bc['offset']+_0x46a7bc[_0x621a('0x22')];var _0x2f38b4;if(_0x68dad6>=_0x11b3ee){_0x68dad6=_0x11b3ee;_0x2f38b4=0xc8;}else{_0x2f38b4=0xce;}_0x19c7ed[_0x621a('0x1d')](_0x2f38b4);return _0x19c7ed[_0x621a('0x23')](_0x621a('0x24'),_0x5de37b+'-'+_0x68dad6+'/'+_0x11b3ee)['json'](_0x4e2036);}return null;};}function patchUpdates(_0x439727){return function(_0x1909ad){try{jsonpatch[_0x621a('0x25')](_0x1909ad,_0x439727,!![]);}catch(_0x216a42){return BPromise[_0x621a('0x26')](_0x216a42);}return _0x1909ad['save']();};}function saveUpdates(_0x672809,_0x2b5bae){return function(_0x90e2a9){if(_0x90e2a9){return _0x90e2a9[_0x621a('0x27')](_0x672809)[_0x621a('0x28')](function(_0xd90c85){return _0xd90c85;});}return null;};}function removeEntity(_0x17f538,_0x1e742f){return function(_0x2cc340){if(_0x2cc340){return _0x2cc340[_0x621a('0x29')]()[_0x621a('0x28')](function(){_0x17f538[_0x621a('0x1d')](0xcc)[_0x621a('0x1e')]();});}};}function handleEntityNotFound(_0x3df292,_0x58d463){return function(_0x48e7b6){if(!_0x48e7b6){_0x3df292['sendStatus'](0x194);}return _0x48e7b6;};}function handleError(_0xd68a07,_0x5bd0c7){_0x5bd0c7=_0x5bd0c7||0x1f4;return function(_0x3e92c7){logger[_0x621a('0x2a')](_0x3e92c7[_0x621a('0x2b')]);if(_0x3e92c7['name']){delete _0x3e92c7[_0x621a('0x2c')];}_0xd68a07['status'](_0x5bd0c7)['send'](_0x3e92c7);};}exports[_0x621a('0x2d')]=function(_0xa00c2e,_0x338615){var _0x5dd58a={},_0x1ac56e={},_0x48eadf={'count':0x0,'rows':[]};var _0x587b29=_[_0x621a('0x2e')](db[_0x621a('0x2f')][_0x621a('0x30')],function(_0x8b30a5){return{'name':_0x8b30a5[_0x621a('0x31')],'type':_0x8b30a5['type'][_0x621a('0x32')]};});_0x1ac56e[_0x621a('0x33')]=_[_0x621a('0x2e')](_0x587b29,_0x621a('0x2c'));_0x1ac56e['query']=_[_0x621a('0x34')](_0xa00c2e['query']);_0x1ac56e[_0x621a('0x35')]=_['intersection'](_0x1ac56e[_0x621a('0x33')],_0x1ac56e[_0x621a('0x36')]);_0x5dd58a['attributes']=_[_0x621a('0x37')](_0x1ac56e['model'],qs[_0x621a('0x38')](_0xa00c2e['query'][_0x621a('0x38')]));_0x5dd58a[_0x621a('0x39')]=_0x5dd58a[_0x621a('0x39')]['length']?_0x5dd58a['attributes']:_0x1ac56e[_0x621a('0x33')];if(!_0xa00c2e['query'][_0x621a('0x3a')](_0x621a('0x3b'))){_0x5dd58a[_0x621a('0x22')]=qs[_0x621a('0x22')](_0xa00c2e[_0x621a('0x36')]['limit']);_0x5dd58a['offset']=qs['offset'](_0xa00c2e['query']['offset']);}_0x5dd58a['order']=qs[_0x621a('0x3c')](_0xa00c2e[_0x621a('0x36')][_0x621a('0x3c')]);_0x5dd58a['where']=qs[_0x621a('0x35')](_['pick'](_0xa00c2e[_0x621a('0x36')],_0x1ac56e[_0x621a('0x35')]),_0x587b29);if(_0xa00c2e[_0x621a('0x36')][_0x621a('0x3d')]){_0x5dd58a[_0x621a('0x3e')]=_[_0x621a('0x3f')](_0x5dd58a['where'],{'$or':_[_0x621a('0x2e')](_0x587b29,function(_0x1204ba){if(_0x1204ba['type']!==_0x621a('0x40')){var _0x4a5f88={};_0x4a5f88[_0x1204ba[_0x621a('0x2c')]]={'$like':'%'+_0xa00c2e[_0x621a('0x36')][_0x621a('0x3d')]+'%'};return _0x4a5f88;}})});}_0x5dd58a=_[_0x621a('0x3f')]({},_0x5dd58a,_0xa00c2e[_0x621a('0x41')]);var _0x2025ff={'where':_0x5dd58a[_0x621a('0x3e')]};return db[_0x621a('0x2f')][_0x621a('0x21')](_0x2025ff)[_0x621a('0x28')](function(_0x452df1){_0x48eadf[_0x621a('0x21')]=_0x452df1;if(_0xa00c2e[_0x621a('0x36')][_0x621a('0x42')]){_0x5dd58a['include']=[{'all':!![]}];}return db[_0x621a('0x2f')][_0x621a('0x43')](_0x5dd58a);})[_0x621a('0x28')](function(_0x2560db){_0x48eadf[_0x621a('0x44')]=_0x2560db;return _0x48eadf;})['then'](respondWithFilteredResult(_0x338615,_0x5dd58a))[_0x621a('0x45')](handleError(_0x338615,null));};exports[_0x621a('0x46')]=function(_0x1f214a,_0x4115b8){var _0x29fdb8={'raw':!![],'where':{'id':_0x1f214a[_0x621a('0x47')]['id']}},_0x20161e={};_0x20161e[_0x621a('0x33')]=_['keys'](db['ChatGroup']['rawAttributes']);_0x20161e[_0x621a('0x36')]=_[_0x621a('0x34')](_0x1f214a['query']);_0x20161e[_0x621a('0x35')]=_['intersection'](_0x20161e[_0x621a('0x33')],_0x20161e[_0x621a('0x36')]);_0x29fdb8[_0x621a('0x39')]=_[_0x621a('0x37')](_0x20161e['model'],qs['fields'](_0x1f214a[_0x621a('0x36')]['fields']));_0x29fdb8['attributes']=_0x29fdb8[_0x621a('0x39')][_0x621a('0x48')]?_0x29fdb8[_0x621a('0x39')]:_0x20161e['model'];if(_0x1f214a['query'][_0x621a('0x42')]){_0x29fdb8['include']=[{'all':!![]}];}_0x29fdb8=_[_0x621a('0x3f')]({},_0x29fdb8,_0x1f214a[_0x621a('0x41')]);return db[_0x621a('0x2f')][_0x621a('0x49')](_0x29fdb8)[_0x621a('0x28')](handleEntityNotFound(_0x4115b8,null))[_0x621a('0x28')](respondWithResult(_0x4115b8,null))[_0x621a('0x45')](handleError(_0x4115b8,null));};exports[_0x621a('0x4a')]=function(_0x59f2fb,_0x5759fc){return db[_0x621a('0x2f')][_0x621a('0x4a')](_0x59f2fb['body'],{})['then'](respondWithResult(_0x5759fc,0xc9))[_0x621a('0x45')](handleError(_0x5759fc,null));};exports[_0x621a('0x27')]=function(_0x1afc91,_0x13228f){if(_0x1afc91[_0x621a('0x4b')]['id']){delete _0x1afc91[_0x621a('0x4b')]['id'];}return db['ChatGroup'][_0x621a('0x49')]({'where':{'id':_0x1afc91[_0x621a('0x47')]['id']}})['then'](handleEntityNotFound(_0x13228f,null))[_0x621a('0x28')](saveUpdates(_0x1afc91[_0x621a('0x4b')],null))[_0x621a('0x28')](respondWithResult(_0x13228f,null))[_0x621a('0x45')](handleError(_0x13228f,null));};exports[_0x621a('0x29')]=function(_0x84f96f,_0x520951){return db[_0x621a('0x2f')][_0x621a('0x49')]({'where':{'id':_0x84f96f[_0x621a('0x47')]['id']}})['then'](handleEntityNotFound(_0x520951,null))['then'](removeEntity(_0x520951,null))[_0x621a('0x45')](handleError(_0x520951,null));};exports[_0x621a('0x4c')]=function(_0x3606dc,_0x2c38f4){return db[_0x621a('0x2f')]['describe']()[_0x621a('0x28')](respondWithResult(_0x2c38f4,null))[_0x621a('0x45')](handleError(_0x2c38f4,null));};exports['getUnread']=function(_0x39b22f,_0x18f7b7,_0x2d7b2e){return db[_0x621a('0x4d')][_0x621a('0x21')]({'where':{'ChatGroupId':_0x39b22f['params']['id'],'ToId':_0x39b22f[_0x621a('0x4e')]['id'],'read':![]}})[_0x621a('0x28')](function(_0x22e664){return{'id':_[_0x621a('0x4f')](_0x39b22f[_0x621a('0x47')]['id']),'count':_0x22e664};})[_0x621a('0x28')](respondWithResult(_0x18f7b7,null))[_0x621a('0x45')](handleError(_0x18f7b7,null));};exports[_0x621a('0x50')]=function(_0x109bff,_0x3cd931,_0x200142){return db[_0x621a('0x2f')][_0x621a('0x49')]({'where':{'id':_0x109bff['params']['id']}})[_0x621a('0x28')](handleEntityNotFound(_0x3cd931,null))[_0x621a('0x28')](function(_0x33dde9){if(_0x33dde9){return _0x33dde9[_0x621a('0x50')](_0x109bff[_0x621a('0x4b')][_0x621a('0x51')],_['omit'](_0x109bff[_0x621a('0x4b')],[_0x621a('0x51'),'id'])||{});}})[_0x621a('0x28')](respondWithResult(_0x3cd931,null))['catch'](handleError(_0x3cd931,null));};exports[_0x621a('0x52')]=function(_0x34f3e9,_0x37115c,_0x2b7e6c){var _0x45286a={};var _0x1776a5={};var _0x8b7869;var _0x482b34;return db[_0x621a('0x2f')][_0x621a('0x53')]({'where':{'id':_0x34f3e9[_0x621a('0x47')]['id']}})[_0x621a('0x28')](handleEntityNotFound(_0x37115c,null))[_0x621a('0x28')](function(_0x5a72f5){if(_0x5a72f5){_0x8b7869=_0x5a72f5;_0x1776a5[_0x621a('0x33')]=_[_0x621a('0x34')](db[_0x621a('0x54')][_0x621a('0x30')]);_0x1776a5[_0x621a('0x36')]=_['keys'](_0x34f3e9[_0x621a('0x36')]);_0x1776a5[_0x621a('0x35')]=_['intersection'](_0x1776a5[_0x621a('0x33')],_0x1776a5[_0x621a('0x36')]);_0x45286a['attributes']=_[_0x621a('0x37')](_0x1776a5[_0x621a('0x33')],qs['fields'](_0x34f3e9['query'][_0x621a('0x38')]));_0x45286a['attributes']=_0x45286a['attributes']['length']?_0x45286a[_0x621a('0x39')]:_0x1776a5[_0x621a('0x33')];_0x45286a[_0x621a('0x55')]=qs[_0x621a('0x3c')](_0x34f3e9[_0x621a('0x36')][_0x621a('0x3c')]);_0x45286a[_0x621a('0x3e')]=qs[_0x621a('0x35')](_[_0x621a('0x56')](_0x34f3e9[_0x621a('0x36')],_0x1776a5['filters']));if(_0x34f3e9[_0x621a('0x36')][_0x621a('0x3d')]){_0x45286a[_0x621a('0x3e')]=_['merge'](_0x45286a['where'],{'$or':_[_0x621a('0x2e')](_0x45286a[_0x621a('0x39')],function(_0x13eb56){var _0x50a494={};_0x50a494[_0x13eb56]={'$like':'%'+_0x34f3e9['query']['filter']+'%'};return _0x50a494;})});}_0x45286a=_[_0x621a('0x3f')]({},_0x45286a,_0x34f3e9[_0x621a('0x41')]);return _0x8b7869['getMembers'](_0x45286a);}})[_0x621a('0x28')](function(_0x3b0237){if(_0x3b0237){_0x482b34=_0x3b0237[_0x621a('0x48')];if(!_0x34f3e9[_0x621a('0x36')][_0x621a('0x3a')](_0x621a('0x3b'))){_0x45286a['limit']=qs['limit'](_0x34f3e9['query'][_0x621a('0x22')]);_0x45286a[_0x621a('0x20')]=qs[_0x621a('0x20')](_0x34f3e9[_0x621a('0x36')][_0x621a('0x20')]);}return _0x8b7869[_0x621a('0x52')](_0x45286a);}})[_0x621a('0x28')](function(_0x53c1cd){if(_0x53c1cd){return _0x53c1cd?{'count':_0x482b34,'rows':_0x53c1cd}:null;}})[_0x621a('0x28')](respondWithResult(_0x37115c,null))[_0x621a('0x45')](handleError(_0x37115c,null));};exports[_0x621a('0x57')]=function(_0x4b0b2c,_0x125f6a,_0x32bea8){return db[_0x621a('0x2f')][_0x621a('0x49')]({'where':{'id':_0x4b0b2c['params']['id']}})[_0x621a('0x28')](handleEntityNotFound(_0x125f6a,null))[_0x621a('0x28')](function(_0x123b72){if(_0x123b72){return _0x123b72[_0x621a('0x57')](_0x4b0b2c['query'][_0x621a('0x51')]);}})[_0x621a('0x28')](respondWithStatusCode(_0x125f6a,null))[_0x621a('0x45')](handleError(_0x125f6a,null));};exports[_0x621a('0x58')]=function(_0xa2fe36,_0x265bc6,_0x22716b){if(_0xa2fe36['body']['id']){delete _0xa2fe36[_0x621a('0x4b')]['id'];}return db[_0x621a('0x2f')][_0x621a('0x49')]({'where':{'id':_0xa2fe36[_0x621a('0x47')]['id']}})[_0x621a('0x28')](handleEntityNotFound(_0x265bc6,null))['then'](function(_0x2aa0c5){if(_0x2aa0c5){_0xa2fe36[_0x621a('0x4b')][_0x621a('0x59')]=_0x2aa0c5['id'];return db[_0x621a('0x4d')][_0x621a('0x4a')](_0xa2fe36['body']);}})[_0x621a('0x28')](respondWithResult(_0x265bc6,null))[_0x621a('0x45')](handleError(_0x265bc6,null));};exports[_0x621a('0x5a')]=function(_0x2e08ff,_0x20b54d,_0x1549b8){var _0x545ce5={};var _0x146b13={};var _0x1f8348;var _0x2336e0;return db['ChatGroup'][_0x621a('0x53')]({'where':{'id':_0x2e08ff['params']['id']}})['then'](handleEntityNotFound(_0x20b54d,null))[_0x621a('0x28')](function(_0xa0a63e){if(_0xa0a63e){_0x1f8348=_0xa0a63e;_0x146b13[_0x621a('0x33')]=_[_0x621a('0x34')](db['ChatInternalMessage']['rawAttributes']);_0x146b13[_0x621a('0x36')]=_['keys'](_0x2e08ff[_0x621a('0x36')]);_0x146b13[_0x621a('0x35')]=_['intersection'](_0x146b13[_0x621a('0x33')],_0x146b13['query']);_0x545ce5['attributes']=_[_0x621a('0x37')](_0x146b13[_0x621a('0x33')],qs[_0x621a('0x38')](_0x2e08ff[_0x621a('0x36')]['fields']));_0x545ce5[_0x621a('0x39')]=_0x545ce5[_0x621a('0x39')][_0x621a('0x48')]?_0x545ce5[_0x621a('0x39')]:_0x146b13[_0x621a('0x33')];_0x545ce5[_0x621a('0x55')]=qs['sort'](_0x2e08ff[_0x621a('0x36')]['sort']);_0x545ce5[_0x621a('0x3e')]=qs[_0x621a('0x35')](_[_0x621a('0x56')](_0x2e08ff['query'],_0x146b13[_0x621a('0x35')]));if(_0x2e08ff[_0x621a('0x36')][_0x621a('0x3d')]){_0x545ce5[_0x621a('0x3e')]=_[_0x621a('0x3f')](_0x545ce5[_0x621a('0x3e')],{'$or':_[_0x621a('0x2e')](_0x545ce5['attributes'],function(_0x589992){var _0x418f61={};_0x418f61[_0x589992]={'$like':'%'+_0x2e08ff['query'][_0x621a('0x3d')]+'%'};return _0x418f61;})});}if(_0x2e08ff[_0x621a('0x36')][_0x621a('0x5b')]){var _0xcb865d=_0x2e08ff[_0x621a('0x36')][_0x621a('0x5b')][_0x621a('0x5c')](',');var _0x3cf87d={};_0x3cf87d[_0xcb865d[0x0]]={'$gte':moment(_0xcb865d[0x1])[_0x621a('0x5d')](_0x621a('0x5e'))};_0x545ce5['where']=_[_0x621a('0x3f')](_0x545ce5[_0x621a('0x3e')],_0x3cf87d);}_0x545ce5=_[_0x621a('0x3f')]({},_0x545ce5,_0x2e08ff['options']);return _0x1f8348[_0x621a('0x5a')](_0x545ce5);}})[_0x621a('0x28')](function(_0x34bf73){if(_0x34bf73){_0x2336e0=_0x34bf73[_0x621a('0x48')];if(!_0x2e08ff[_0x621a('0x36')][_0x621a('0x3a')](_0x621a('0x3b'))){_0x545ce5[_0x621a('0x22')]=qs[_0x621a('0x22')](_0x2e08ff[_0x621a('0x36')][_0x621a('0x22')]);_0x545ce5['offset']=qs[_0x621a('0x20')](_0x2e08ff[_0x621a('0x36')]['offset']);}return _0x1f8348[_0x621a('0x5a')](_0x545ce5);}})[_0x621a('0x28')](function(_0x2fe99d){if(_0x2fe99d){return _0x2fe99d?{'count':_0x2336e0,'rows':_0x2fe99d}:null;}})[_0x621a('0x28')](respondWithResult(_0x20b54d,null))['catch'](handleError(_0x20b54d,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 6b28348..4b944e5 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 _0x0648=['exports','ChatGroup','setMaxListeners','save','remove','emit','hook'];(function(_0x299028,_0x4d7e9f){var _0x12154e=function(_0x558d18){while(--_0x558d18){_0x299028['push'](_0x299028['shift']());}};_0x12154e(++_0x4d7e9f);}(_0x0648,0x1a5));var _0x8064=function(_0x2e66a0,_0x505e42){_0x2e66a0=_0x2e66a0-0x0;var _0x595d22=_0x0648[_0x2e66a0];return _0x595d22;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x8064('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8064('0x1')](0x0);var events={'afterCreate':_0x8064('0x2'),'afterUpdate':'update','afterDestroy':_0x8064('0x3')};function emitEvent(_0x4c8019){return function(_0x104fa8,_0x3f3896,_0x262229){ChatGroupEvents[_0x8064('0x4')](_0x4c8019+':'+_0x104fa8['id'],_0x104fa8);ChatGroupEvents[_0x8064('0x4')](_0x4c8019,_0x104fa8);_0x262229(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x8064('0x5')](e,emitEvent(event));}}module[_0x8064('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0x6a55=['hasOwnProperty','hook','exports','events','save','emit'];(function(_0x518b2f,_0x238346){var _0x2c92a5=function(_0x40ef20){while(--_0x40ef20){_0x518b2f['push'](_0x518b2f['shift']());}};_0x2c92a5(++_0x238346);}(_0x6a55,0xdb));var _0x56a5=function(_0x4d3924,_0x327b56){_0x4d3924=_0x4d3924-0x0;var _0x844555=_0x6a55[_0x4d3924];return _0x844555;};'use strict';var EventEmitter=require(_0x56a5('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x56a5('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x116199){return function(_0x5e5a32,_0x3ff76a,_0x5171fa){ChatGroupEvents[_0x56a5('0x2')](_0x116199+':'+_0x5e5a32['id'],_0x5e5a32);ChatGroupEvents[_0x56a5('0x2')](_0x116199,_0x5e5a32);_0x5171fa(null);};}for(var e in events){if(events[_0x56a5('0x3')](e)){var event=events[e];ChatGroup[_0x56a5('0x4')](e,emitEvent(event));}}module[_0x56a5('0x5')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index e8d24b9..678a6c0 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 _0xf181=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash'];(function(_0x58ffb3,_0x5b67aa){var _0x4d8ddd=function(_0x240ca8){while(--_0x240ca8){_0x58ffb3['push'](_0x58ffb3['shift']());}};_0x4d8ddd(++_0x5b67aa);}(_0xf181,0xa8));var _0x1f18=function(_0x4df5d3,_0x522c48){_0x4df5d3=_0x4df5d3-0x0;var _0x34a8d=_0xf181[_0x4df5d3];return _0x34a8d;};'use strict';var _=require(_0x1f18('0x0'));var util=require(_0x1f18('0x1'));var logger=require(_0x1f18('0x2'))(_0x1f18('0x3'));var moment=require(_0x1f18('0x4'));var BPromise=require(_0x1f18('0x5'));var rp=require(_0x1f18('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f18('0x7'));var config=require(_0x1f18('0x8'));var attributes=require(_0x1f18('0x9'));module[_0x1f18('0xa')]=function(_0xe84977,_0x15744e){return _0xe84977[_0x1f18('0xb')]('ChatGroup',attributes,{'tableName':_0x1f18('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02c3=['bluebird','../../config/environment','./chatGroup.attributes','ChatGroup','chat_groups','lodash','util','../../config/logger','moment'];(function(_0x19cbac,_0x3541cb){var _0x156ba6=function(_0x3495f3){while(--_0x3495f3){_0x19cbac['push'](_0x19cbac['shift']());}};_0x156ba6(++_0x3541cb);}(_0x02c3,0x12e));var _0x302c=function(_0x2b8607,_0x4ccf37){_0x2b8607=_0x2b8607-0x0;var _0x2ce6f1=_0x02c3[_0x2b8607];return _0x2ce6f1;};'use strict';var _=require(_0x302c('0x0'));var util=require(_0x302c('0x1'));var logger=require(_0x302c('0x2'))('api');var moment=require(_0x302c('0x3'));var BPromise=require(_0x302c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x302c('0x5'));var attributes=require(_0x302c('0x6'));module['exports']=function(_0x49dce9,_0x1ee4f9){return _0x49dce9['define'](_0x302c('0x7'),attributes,{'tableName':_0x302c('0x8'),'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 9cbc2d8..d2d6943 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 _0x550b=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2229a1,_0x339925){var _0x204007=function(_0x17c93b){while(--_0x17c93b){_0x2229a1['push'](_0x2229a1['shift']());}};_0x204007(++_0x339925);}(_0x550b,0x17e));var _0xb550=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0x550b[_0x3c51d4];return _0x53c45f;};'use strict';var _=require(_0xb550('0x0'));var util=require(_0xb550('0x1'));var moment=require(_0xb550('0x2'));var BPromise=require(_0xb550('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb550('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb550('0x5'));var logger=require(_0xb550('0x6'))('rpc');var config=require(_0xb550('0x7'));var jayson=require(_0xb550('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xb550('0x9')]=_[_0xb550('0xa')](config['redis'],{'host':_0xb550('0xb'),'port':0x18eb});var socket=require(_0xb550('0xc'))(new Redis(config[_0xb550('0x9')]));require('./chatGroup.socket')[_0xb550('0xd')](socket);function respondWithRpcPromise(_0x38ee6c,_0x2e3631,_0x262405){return new BPromise(function(_0x91e6db,_0x5d56a8){return client[_0xb550('0xe')](_0x38ee6c,_0x262405)[_0xb550('0xf')](function(_0xb08026){logger[_0xb550('0x10')](_0xb550('0x11'),_0x2e3631,_0xb550('0x12'));logger[_0xb550('0x13')](_0xb550('0x14'),_0x2e3631,'request\x20sent',JSON[_0xb550('0x15')](_0xb08026));if(_0xb08026[_0xb550('0x16')]){if(_0xb08026[_0xb550('0x16')][_0xb550('0x17')]===0x1f4){logger[_0xb550('0x16')](_0xb550('0x11'),_0x2e3631,_0xb08026[_0xb550('0x16')]['message']);return _0x5d56a8(_0xb08026['error'][_0xb550('0x18')]);}logger[_0xb550('0x16')]('ChatGroup,\x20%s,\x20%s',_0x2e3631,_0xb08026[_0xb550('0x16')][_0xb550('0x18')]);return _0x91e6db(_0xb08026[_0xb550('0x16')][_0xb550('0x18')]);}else{logger[_0xb550('0x10')](_0xb550('0x11'),_0x2e3631,_0xb550('0x12'));_0x91e6db(_0xb08026[_0xb550('0x19')]['message']);}})[_0xb550('0x1a')](function(_0x2e22c7){logger['error'](_0xb550('0x11'),_0x2e3631,_0x2e22c7);_0x5d56a8(_0x2e22c7);});});} \ No newline at end of file +var _0x97ed=['then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','socket.io-emitter','request'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x97ed,0x1e7));var _0xd97e=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x97ed[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xd97e('0x0'));var util=require(_0xd97e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd97e('0x2'));var fs=require('fs');var Redis=require(_0xd97e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd97e('0x4'));var logger=require(_0xd97e('0x5'))(_0xd97e('0x6'));var config=require(_0xd97e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd97e('0x8')][_0xd97e('0x9')]({'port':0x232a});config['redis']=_[_0xd97e('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd97e('0xb'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x448f66,_0x55f533,_0x370017){return new BPromise(function(_0x1afa13,_0x49c988){return client[_0xd97e('0xc')](_0x448f66,_0x370017)[_0xd97e('0xd')](function(_0x9316d2){logger['info'](_0xd97e('0xe'),_0x55f533,_0xd97e('0xf'));logger[_0xd97e('0x10')](_0xd97e('0x11'),_0x55f533,_0xd97e('0xf'),JSON[_0xd97e('0x12')](_0x9316d2));if(_0x9316d2[_0xd97e('0x13')]){if(_0x9316d2[_0xd97e('0x13')][_0xd97e('0x14')]===0x1f4){logger[_0xd97e('0x13')]('ChatGroup,\x20%s,\x20%s',_0x55f533,_0x9316d2[_0xd97e('0x13')]['message']);return _0x49c988(_0x9316d2[_0xd97e('0x13')][_0xd97e('0x15')]);}logger[_0xd97e('0x13')](_0xd97e('0xe'),_0x55f533,_0x9316d2[_0xd97e('0x13')][_0xd97e('0x15')]);return _0x1afa13(_0x9316d2['error'][_0xd97e('0x15')]);}else{logger[_0xd97e('0x16')](_0xd97e('0xe'),_0x55f533,_0xd97e('0xf'));_0x1afa13(_0x9316d2[_0xd97e('0x17')][_0xd97e('0x15')]);}})[_0xd97e('0x18')](function(_0x28b818){logger[_0xd97e('0x13')](_0xd97e('0xe'),_0x55f533,_0x28b818);_0x49c988(_0x28b818);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 248c06f..f45cc4e 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 _0x07a0=['update','emit','removeListener','register','./chatGroup.events','save','remove'];(function(_0x5acc75,_0x15f7ce){var _0x70e355=function(_0x2dbc21){while(--_0x2dbc21){_0x5acc75['push'](_0x5acc75['shift']());}};_0x70e355(++_0x15f7ce);}(_0x07a0,0x13f));var _0x007a=function(_0x25cf6d,_0x1dce1d){_0x25cf6d=_0x25cf6d-0x0;var _0xbff02a=_0x07a0[_0x25cf6d];return _0xbff02a;};'use strict';var ChatGroupEvents=require(_0x007a('0x0'));var events=[_0x007a('0x1'),_0x007a('0x2'),_0x007a('0x3')];function createListener(_0x517178,_0x514ed4){return function(_0x218b9b){_0x514ed4[_0x007a('0x4')](_0x517178,_0x218b9b);};}function removeListener(_0x399a9d,_0x1a012e){return function(){ChatGroupEvents[_0x007a('0x5')](_0x399a9d,_0x1a012e);};}exports[_0x007a('0x6')]=function(_0x4ea26b){for(var _0x45ea0e=0x0,_0x4af766=events['length'];_0x45ea0e<_0x4af766;_0x45ea0e++){var _0x5ecbdb=events[_0x45ea0e];var _0x15e1f7=createListener('chatGroup:'+_0x5ecbdb,_0x4ea26b);ChatGroupEvents['on'](_0x5ecbdb,_0x15e1f7);}}; \ No newline at end of file +var _0xe0c1=['emit','removeListener','length','chatGroup:','./chatGroup.events','save','update'];(function(_0x48b163,_0x464055){var _0x5ce3a2=function(_0x533fa7){while(--_0x533fa7){_0x48b163['push'](_0x48b163['shift']());}};_0x5ce3a2(++_0x464055);}(_0xe0c1,0xa5));var _0x1e0c=function(_0x4a3fd0,_0x37ca05){_0x4a3fd0=_0x4a3fd0-0x0;var _0x33b81d=_0xe0c1[_0x4a3fd0];return _0x33b81d;};'use strict';var ChatGroupEvents=require(_0x1e0c('0x0'));var events=[_0x1e0c('0x1'),'remove',_0x1e0c('0x2')];function createListener(_0x37ab49,_0x250395){return function(_0x4540a2){_0x250395[_0x1e0c('0x3')](_0x37ab49,_0x4540a2);};}function removeListener(_0x42fec4,_0x412e43){return function(){ChatGroupEvents[_0x1e0c('0x4')](_0x42fec4,_0x412e43);};}exports['register']=function(_0x2f2751){for(var _0x4978da=0x0,_0x1f2e72=events[_0x1e0c('0x5')];_0x4978da<_0x1f2e72;_0x4978da++){var _0x3a0b75=events[_0x4978da];var _0x442de4=createListener(_0x1e0c('0x6')+_0x3a0b75,_0x2f2751);ChatGroupEvents['on'](_0x3a0b75,_0x442de4);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index cc3ff5f..439fc35 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 _0x5b9a=['getMessages','create','/:id/members','post','addMessage','put','update','delete','destroy','removeMembers','exports','multer','path','connect-timeout','express','Router','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/messages'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5b9a,0x193));var _0xa5b9=function(_0x5429ec,_0x975d62){_0x5429ec=_0x5429ec-0x0;var _0x495635=_0x5b9a[_0x5429ec];return _0x495635;};'use strict';var multer=require(_0xa5b9('0x0'));var util=require('util');var path=require(_0xa5b9('0x1'));var timeout=require(_0xa5b9('0x2'));var express=require(_0xa5b9('0x3'));var router=express[_0xa5b9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa5b9('0x5'));var controller=require(_0xa5b9('0x6'));router[_0xa5b9('0x7')]('/',auth[_0xa5b9('0x8')](),controller[_0xa5b9('0x9')]);router['get'](_0xa5b9('0xa'),auth[_0xa5b9('0x8')](),controller[_0xa5b9('0xb')]);router['get'](_0xa5b9('0xc'),auth['isAuthenticated'](),controller[_0xa5b9('0xd')]);router[_0xa5b9('0x7')](_0xa5b9('0xe'),auth[_0xa5b9('0x8')](),controller[_0xa5b9('0xf')]);router[_0xa5b9('0x7')]('/:id/members',auth[_0xa5b9('0x8')](),controller['getMembers']);router[_0xa5b9('0x7')](_0xa5b9('0x10'),auth[_0xa5b9('0x8')](),controller[_0xa5b9('0x11')]);router['post']('/',auth[_0xa5b9('0x8')](),controller[_0xa5b9('0x12')]);router['post'](_0xa5b9('0x13'),auth[_0xa5b9('0x8')](),controller['addMembers']);router[_0xa5b9('0x14')](_0xa5b9('0x10'),auth[_0xa5b9('0x8')](),controller[_0xa5b9('0x15')]);router[_0xa5b9('0x16')]('/:id',auth[_0xa5b9('0x8')](),controller[_0xa5b9('0x17')]);router[_0xa5b9('0x18')](_0xa5b9('0xc'),auth[_0xa5b9('0x8')](),controller[_0xa5b9('0x19')]);router[_0xa5b9('0x18')](_0xa5b9('0x13'),auth[_0xa5b9('0x8')](),controller[_0xa5b9('0x1a')]);module[_0xa5b9('0x1b')]=router; \ No newline at end of file +var _0x5cfd=['/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMessage','delete','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe'];(function(_0x5d622a,_0x158399){var _0x37f8d2=function(_0x1aa657){while(--_0x1aa657){_0x5d622a['push'](_0x5d622a['shift']());}};_0x37f8d2(++_0x158399);}(_0x5cfd,0x12b));var _0xd5cf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5cfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd5cf('0x0'));var util=require(_0xd5cf('0x1'));var path=require(_0xd5cf('0x2'));var timeout=require(_0xd5cf('0x3'));var express=require(_0xd5cf('0x4'));var router=express[_0xd5cf('0x5')]();var fs_extra=require(_0xd5cf('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd5cf('0x7'));var config=require(_0xd5cf('0x8'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0xd5cf('0x9')](),controller[_0xd5cf('0xa')]);router[_0xd5cf('0xb')]('/describe',auth[_0xd5cf('0x9')](),controller[_0xd5cf('0xc')]);router[_0xd5cf('0xb')](_0xd5cf('0xd'),auth[_0xd5cf('0x9')](),controller[_0xd5cf('0xe')]);router[_0xd5cf('0xb')](_0xd5cf('0xf'),auth['isAuthenticated'](),controller[_0xd5cf('0x10')]);router[_0xd5cf('0xb')](_0xd5cf('0x11'),auth[_0xd5cf('0x9')](),controller[_0xd5cf('0x12')]);router['get'](_0xd5cf('0x13'),auth['isAuthenticated'](),controller['getMessages']);router[_0xd5cf('0x14')]('/',auth[_0xd5cf('0x9')](),controller[_0xd5cf('0x15')]);router['post'](_0xd5cf('0x11'),auth[_0xd5cf('0x9')](),controller['addMembers']);router[_0xd5cf('0x14')](_0xd5cf('0x13'),auth[_0xd5cf('0x9')](),controller[_0xd5cf('0x16')]);router['put'](_0xd5cf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xd5cf('0x17')](_0xd5cf('0xd'),auth[_0xd5cf('0x9')](),controller['destroy']);router['delete'](_0xd5cf('0x11'),auth[_0xd5cf('0x9')](),controller[_0xd5cf('0x18')]);module[_0xd5cf('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 53d94e1..9e82ce8 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 _0x750a=['TEXT','STRING','DATE','out','BOOLEAN','exports','ENUM','star','thumb'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x750a,0x140));var _0xa750=function(_0x1d3791,_0x51c613){_0x1d3791=_0x1d3791-0x0;var _0x40fbf5=_0x750a[_0x1d3791];return _0x40fbf5;};'use strict';var Sequelize=require('sequelize');module[_0xa750('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xa750('0x1')](_0xa750('0x2'),_0xa750('0x3')),'defaultValue':_0xa750('0x2')},'ratingMessage':{'type':Sequelize[_0xa750('0x4')]},'pathTranscript':{'type':Sequelize[_0xa750('0x4')]},'mailTranscript':{'type':Sequelize[_0xa750('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa750('0x6')]},'disposition':{'type':Sequelize[_0xa750('0x5')]},'secondDisposition':{'type':Sequelize[_0xa750('0x5')]},'thirdDisposition':{'type':Sequelize[_0xa750('0x5')]},'note':{'type':Sequelize[_0xa750('0x5')]},'browserName':{'type':Sequelize[_0xa750('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xa750('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xa750('0x5')]},'deviceType':{'type':Sequelize[_0xa750('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xa750('0x5')]},'formData':{'type':Sequelize[_0xa750('0x4')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xa750('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa750('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa750('0x5')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xa750('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xa750('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0xdef9=['out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long'];(function(_0x58aaf8,_0x525867){var _0x35e8dc=function(_0x30c81b){while(--_0x30c81b){_0x58aaf8['push'](_0x58aaf8['shift']());}};_0x35e8dc(++_0x525867);}(_0xdef9,0x1ed));var _0x9def=function(_0x4583d0,_0x24551f){_0x4583d0=_0x4583d0-0x0;var _0x7b3c5a=_0xdef9[_0x4583d0];return _0x7b3c5a;};'use strict';var Sequelize=require(_0x9def('0x0'));module[_0x9def('0x1')]={'closed':{'type':Sequelize[_0x9def('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x9def('0x3')]},'ratingType':{'type':Sequelize[_0x9def('0x4')](_0x9def('0x5'),_0x9def('0x6')),'defaultValue':_0x9def('0x5')},'ratingMessage':{'type':Sequelize[_0x9def('0x7')]},'pathTranscript':{'type':Sequelize[_0x9def('0x7')]},'mailTranscript':{'type':Sequelize[_0x9def('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x9def('0x9')]},'disposition':{'type':Sequelize[_0x9def('0x8')]},'secondDisposition':{'type':Sequelize[_0x9def('0x8')]},'thirdDisposition':{'type':Sequelize[_0x9def('0x8')]},'note':{'type':Sequelize[_0x9def('0x8')]},'browserName':{'type':Sequelize[_0x9def('0x8')]},'browserVersion':{'type':Sequelize[_0x9def('0x8')]},'osName':{'type':Sequelize[_0x9def('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x9def('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x9def('0x7')]},'customerIp':{'type':Sequelize[_0x9def('0x8')]},'formData':{'type':Sequelize[_0x9def('0x7')](_0x9def('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x9def('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x9def('0x4')]('in',_0x9def('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x9def('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x9def('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x9def('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 8f030ba..84972e9 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 _0x7880=['parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','agent','sequelize','toString','keyBy','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','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','include','options','create','destroy','describe','createVidaooSession','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','update','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','findOne','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','transcript-%s.txt','now','Messages','%s%d','agentAlias','customer','format','website_alias','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailServerOut','Smtp','service','host','port','secure','pass','SendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','pick','YYYY-MM-DD\x20HH:mm:ss','includeAll','getMyMessages','secret','includeAgent','findAll','addTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Owner','get','mkdirSync','Account','closedAt','browserName','customerPort','N.A.','tail','createReadStream','createWriteStream','direction','renderFile','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../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','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','client','then','info','request\x20sent','debug','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','name','send','merge','contact','interaction','account','fullname','Tags','TagIds','split','forEach','push','index','map','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','select','field','color','from','tools_tags','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','isEmpty','concat','createdAt'];(function(_0x54280d,_0x565316){var _0x56f50b=function(_0x4ceb52){while(--_0x4ceb52){_0x54280d['push'](_0x54280d['shift']());}};_0x56f50b(++_0x565316);}(_0x7880,0x1f4));var _0x0788=function(_0x15d9bc,_0x513b46){_0x15d9bc=_0x15d9bc-0x0;var _0x5868fe=_0x7880[_0x15d9bc];return _0x5868fe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var pdf=require(_0x0788('0x14'));var hardwareService=require(_0x0788('0x15'));var logger=require('../../config/logger')(_0x0788('0x16'));var utils=require(_0x0788('0x17'));var config=require(_0x0788('0x18'));var licenseUtil=require(_0x0788('0x19'));var db=require(_0x0788('0x1a'))['db'];config[_0x0788('0x1b')]=_[_0x0788('0x1c')](config['redis'],{'host':_0x0788('0x1d'),'port':0x18eb});var socket=require(_0x0788('0x1e'))(new Redis(config[_0x0788('0x1b')]));require(_0x0788('0x1f'))['register'](socket);var jayson=require(_0x0788('0x20'));var client=jayson['client'][_0x0788('0x21')]({'port':0x232b});var client9004=jayson[_0x0788('0x22')][_0x0788('0x21')]({'port':0x232c});function respondWithRpcPromise(_0xb406fb,_0x2ddd1a,_0x430e34,_0x5e1a29){return new BPromise(function(_0x573822,_0x17d805){var _0x461d9d=_0x5e1a29||client;return _0x461d9d['request'](_0xb406fb,_0x430e34)[_0x0788('0x23')](function(_0x415f19){logger[_0x0788('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x2ddd1a,_0x0788('0x25'));logger[_0x0788('0x26')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2ddd1a,_0x0788('0x25'),JSON['stringify'](_0x415f19));if(_0x415f19[_0x0788('0x27')]){if(_0x415f19['error'][_0x0788('0x28')]===0x1f4){logger[_0x0788('0x27')](_0x0788('0x29'),_0x2ddd1a,_0x415f19[_0x0788('0x27')][_0x0788('0x2a')]);return _0x17d805(_0x415f19['error']['message']);}logger[_0x0788('0x27')](_0x0788('0x29'),_0x2ddd1a,_0x415f19[_0x0788('0x27')][_0x0788('0x2a')]);return _0x573822(_0x415f19['error']['message']);}else{logger[_0x0788('0x24')](_0x0788('0x29'),_0x2ddd1a,_0x0788('0x25'));_0x573822(_0x415f19['result']['message']);}})[_0x0788('0x2b')](function(_0xa1f7dc){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2ddd1a,_0xa1f7dc);_0x17d805(_0xa1f7dc);});});}function respondWithStatusCode(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0xcc;return function(_0x57fda1){if(_0x57fda1){return _0x5a54a5[_0x0788('0x2c')](_0x44798c);}return _0x5a54a5[_0x0788('0x2d')](_0x44798c)[_0x0788('0x2e')]();};}function respondWithResult(_0x18fc0e,_0xf9ba32){_0xf9ba32=_0xf9ba32||0xc8;return function(_0xb2f4a5){if(_0xb2f4a5){return _0x18fc0e[_0x0788('0x2d')](_0xf9ba32)[_0x0788('0x2f')](_0xb2f4a5);}};}function respondWithFilteredResult(_0x5b7594,_0x5a5178){return function(_0x3c5246){if(_0x3c5246){var _0x40d345=typeof _0x5a5178['offset']==='undefined'&&typeof _0x5a5178[_0x0788('0x30')]===_0x0788('0x31');var _0x20fcd8=_0x3c5246[_0x0788('0x32')];var _0x44cbfb=_0x40d345?0x0:_0x5a5178[_0x0788('0x33')];var _0x327d67=_0x40d345?_0x3c5246[_0x0788('0x32')]:_0x5a5178[_0x0788('0x33')]+_0x5a5178[_0x0788('0x30')];var _0x5ec0ed;if(_0x327d67>=_0x20fcd8){_0x327d67=_0x20fcd8;_0x5ec0ed=0xc8;}else{_0x5ec0ed=0xce;}_0x5b7594[_0x0788('0x2d')](_0x5ec0ed);return _0x5b7594[_0x0788('0x34')](_0x0788('0x35'),_0x44cbfb+'-'+_0x327d67+'/'+_0x20fcd8)[_0x0788('0x2f')](_0x3c5246);}return null;};}function patchUpdates(_0xce4534){return function(_0x458193){try{jsonpatch[_0x0788('0x36')](_0x458193,_0xce4534,!![]);}catch(_0x15d67a){return BPromise[_0x0788('0x37')](_0x15d67a);}return _0x458193[_0x0788('0x38')]();};}function saveUpdates(_0x4fa055,_0x4ae132){return function(_0x5947d3){if(_0x5947d3){return _0x5947d3['update'](_0x4fa055)['then'](function(_0x586a06){return _0x586a06;});}return null;};}function removeEntity(_0x208a89,_0x38a4ae){return function(_0x2130e3){if(_0x2130e3){return _0x2130e3['destroy']()[_0x0788('0x23')](function(){_0x208a89[_0x0788('0x2d')](0xcc)[_0x0788('0x2e')]();});}};}function handleEntityNotFound(_0xaea11d,_0x57c4d8){return function(_0x2ed940){if(!_0x2ed940){_0xaea11d['sendStatus'](0x194);}return _0x2ed940;};}function handleError(_0x322465,_0x4fcde3){_0x4fcde3=_0x4fcde3||0x1f4;return function(_0x9d1edb){logger[_0x0788('0x27')](_0x9d1edb['stack']);if(_0x9d1edb[_0x0788('0x39')]){delete _0x9d1edb[_0x0788('0x39')];}_0x322465['status'](_0x4fcde3)[_0x0788('0x3a')](_0x9d1edb);};}function getMustacheRender(_0x5eb693,_0x295024){return Mustache['render'](_0x5eb693,_[_0x0788('0x3b')](_0x295024['body'],{'contact':_0x295024[_0x0788('0x3c')],'message':_0x295024['message'],'agent':_0x295024['agent'],'interaction':_0x295024[_0x0788('0x3d')],'account':_0x295024[_0x0788('0x3e')]}))||'';}function getInteractionUsers(_0x2e48cf,_0x2d17b0){return new BPromise(function(_0x8cfffc,_0x53da74){try{if(_0x2d17b0[_0x2e48cf['id']]){_0x2e48cf['Users']=_['map'](_0x2d17b0[_0x2e48cf['id']],function(_0x4d539a){return{'id':_0x4d539a['id'],'fullname':_0x4d539a[_0x0788('0x3f')]};});}}catch(_0x1202c4){_0x53da74(_0x1202c4);}_0x8cfffc(_0x2e48cf);});}function getInteractionTags(_0x45b247,_0x358a22){return new BPromise(function(_0x362c49,_0x5993ad){try{if(_0x45b247['TagIds']){_0x45b247[_0x0788('0x40')]=[];_0x45b247[_0x0788('0x41')][_0x0788('0x42')](',')[_0x0788('0x43')](function(_0x236b63){_0x45b247[_0x0788('0x40')][_0x0788('0x44')](_0x358a22[_0x236b63]);});}delete _0x45b247[_0x0788('0x41')];}catch(_0x347984){_0x5993ad(_0x347984);}_0x362c49(_0x45b247);});}function updateChatInteraction(_0x50e8f5,_0x5581e6,_0x441aec){return new BPromise(function(_0x1d579d,_0x9e8ee){return getInteractionUsers(_0x50e8f5,_0x441aec)['then'](function(_0x5ab353){return getInteractionTags(_0x5ab353,_0x5581e6);})['then'](function(_0x172424){_0x1d579d(_0x172424);})[_0x0788('0x2b')](function(_0x25501b){_0x9e8ee(_0x25501b);});});}exports[_0x0788('0x45')]=function(_0x2737d8,_0x1928f3){var _0x1ab634={},_0x15b90c={},_0x4bd0d9={'count':0x0,'rows':[]};var _0x15c618=_[_0x0788('0x46')](db[_0x0788('0x47')][_0x0788('0x48')],function(_0x58eb04){return{'name':_0x58eb04[_0x0788('0x49')],'type':_0x58eb04[_0x0788('0x4a')]['key']};});_0x15b90c['model']=_['map'](_0x15c618,_0x0788('0x39'));_0x15b90c['query']=_[_0x0788('0x4b')](_0x2737d8[_0x0788('0x4c')]);_0x15b90c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x15b90c[_0x0788('0x4f')],_0x15b90c[_0x0788('0x4c')]);_0x1ab634[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x15b90c['model'],qs['fields'](_0x2737d8[_0x0788('0x4c')][_0x0788('0x51')]));_0x1ab634[_0x0788('0x50')]=_0x1ab634['attributes'][_0x0788('0x52')]?_0x1ab634[_0x0788('0x50')]:_0x15b90c[_0x0788('0x4f')];if(!_0x2737d8[_0x0788('0x4c')][_0x0788('0x53')]('nolimit')){_0x1ab634['limit']=qs[_0x0788('0x30')](_0x2737d8[_0x0788('0x4c')]['limit']);_0x1ab634[_0x0788('0x33')]=qs['offset'](_0x2737d8[_0x0788('0x4c')][_0x0788('0x33')]);}_0x1ab634[_0x0788('0x54')]=qs[_0x0788('0x55')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x55')]);_0x1ab634[_0x0788('0x56')]=qs[_0x0788('0x4d')](_['pick'](_0x2737d8[_0x0788('0x4c')],_0x15b90c[_0x0788('0x4d')]),_0x15c618);var _0x3f2f1b=[];var _0x5ef557=squel[_0x0788('0x57')]()[_0x0788('0x58')]('id')['field'](_0x0788('0x39'))[_0x0788('0x58')](_0x0788('0x59'))[_0x0788('0x5a')](_0x0788('0x5b'));var _0x347cc8=squel['select']()['field'](_0x0788('0x5c'))[_0x0788('0x58')]('u.fullname')[_0x0788('0x58')](_0x0788('0x5d'))[_0x0788('0x5a')](_0x0788('0x5e'),'ui')[_0x0788('0x5f')](_0x0788('0x60'),'u',_0x0788('0x61'));var _0xeedd30=squel[_0x0788('0x57')]()[_0x0788('0x5a')](_0x0788('0x62'),'i')[_0x0788('0x5f')]('cm_contacts','c',_0x0788('0x63'))[_0x0788('0x5f')](_0x0788('0x60'),'o','o.id\x20=\x20i.UserId')[_0x0788('0x5f')](_0x0788('0x64'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0x0788('0x65'),'me',_0x0788('0x66'))[_0x0788('0x5f')](_0x0788('0x67'),'it',_0x0788('0x68'))[_0x0788('0x5f')]('tools_tags','t',_0x0788('0x69'));var _0x3be076=squel[_0x0788('0x6a')]();var _0x47be71=[];var _0x533f71=squel[_0x0788('0x6a')]();var _0x5419d9;if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x6b')]){_0x5419d9=as[_0x0788('0x6c')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x6b')]);var _0x348d25=_0x5419d9[_0x0788('0x6d')];for(var _0x29c912=0x0;_0x29c912<_0x5419d9[_0x0788('0x6e')][_0x0788('0x52')];_0x29c912++){var _0x59fcbc=_0x5419d9[_0x0788('0x6e')][_0x29c912];var _0x446170='i';var _0x602e3b=_[_0x0788('0x6f')](_0x15c618,['name',_0x59fcbc[_0x0788('0x58')]]);if(!_0x602e3b){switch(_0x59fcbc[_0x0788('0x58')]){case _0x0788('0x70'):if(_0x59fcbc[_0x0788('0x71')]==0x1){_0xeedd30[_0x0788('0x72')]('`'+_0x59fcbc['field']+_0x0788('0x73'));}else{_0xeedd30['having']('`'+_0x59fcbc[_0x0788('0x58')]+_0x0788('0x74'));}break;case _0x0788('0x75'):if(_0x59fcbc[_0x0788('0x76')]===_0x0788('0x77')){if(_0x59fcbc[_0x0788('0x71')][_0x0788('0x42')]('\x20')[_0x0788('0x52')]>0x1){_0x3be076[_0x348d25](_0x0788('0x78'),qs['getFullTextValue'](_0x59fcbc[_0x0788('0x71')]),null);}else{var _0x2dea6c='%'+_0x59fcbc[_0x0788('0x71')]+'%';_0x3be076[_0x348d25]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2dea6c,_0x2dea6c,_0x2dea6c);}}else{_0x602e3b=_['find'](_0x15c618,[_0x0788('0x39'),_0x0788('0x79')]);_0x59fcbc[_0x0788('0x58')]='ContactId';_0x35c612=as[_0x0788('0x7a')](_0x446170,_0x602e3b[_0x0788('0x4a')],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')]['start'],_0x35c612['value']['end']);}break;case _0x0788('0x7c'):var _0x2a55f2=_0x59fcbc[_0x0788('0x71')]['split'](',')['map'](function(_0xaa2d4d){return Number(_0xaa2d4d);});_0x2a55f2['forEach'](function(_0x955bfa){_0x533f71['or'](_0x0788('0x7d'),'%,'+_0x955bfa+',%');});_0x47be71=_[_0x0788('0x7e')](_0x47be71,_0x2a55f2);break;case _0x0788('0x7f'):if(_0x59fcbc[_0x0788('0x76')]===_0x0788('0x77')){_0x3be076[_0x348d25](_0x0788('0x80'),'%'+_0x59fcbc[_0x0788('0x71')]+'%',null);}else{_0x602e3b=_[_0x0788('0x6f')](_0x15c618,[_0x0788('0x39'),'UserId']);_0x59fcbc[_0x0788('0x58')]=_0x0788('0x81');_0x35c612=as['buildExpression'](_0x446170,_0x602e3b['type'],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')][_0x0788('0x82')],_0x35c612[_0x0788('0x71')][_0x0788('0x2e')]);}break;case _0x0788('0x83'):_0x35c612=as['buildExpression']('me',null,_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')][_0x0788('0x82')],_0x35c612[_0x0788('0x71')]['end']);break;}}else{var _0x35c612=as[_0x0788('0x7a')](_0x446170,_0x602e3b[_0x0788('0x4a')],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612['value']['start'],_0x35c612[_0x0788('0x71')][_0x0788('0x2e')]);}}}else{var _0x5513f7=_(_0x2737d8[_0x0788('0x4c')])[_0x0788('0x4b')]()[_0x0788('0x46')](function(_0x2b10fe){return _[_0x0788('0x84')](_0x15c618,[_0x0788('0x39'),_0x2b10fe])?_0x2b10fe:undefined;})['compact']()[_0x0788('0x71')]();if(!_[_0x0788('0x85')](_0x5513f7)){_0x5513f7[_0x0788('0x43')](function(_0x515dd8){if(_0x515dd8==='ChatWebsiteId'){_0xeedd30[_0x0788('0x56')]('i.ChatWebsiteId\x20IN\x20?',[][_0x0788('0x86')](_0x2737d8[_0x0788('0x4c')][_0x515dd8]));}else if(_0x515dd8===_0x0788('0x87')){var _0xa4b3f8=JSON[_0x0788('0x88')](_0x2737d8[_0x0788('0x4c')][_0x515dd8])[_0x0788('0x89')];var _0x216ea9=JSON[_0x0788('0x88')](_0x2737d8['query'][_0x515dd8])[_0x0788('0x8a')];_0xeedd30[_0x0788('0x56')](_0x0788('0x8b'),_0xa4b3f8,_0x216ea9);}else{if(_0x2737d8['query'][_0x515dd8]===_0x0788('0x8c')){_0xeedd30[_0x0788('0x56')]('i.'+_0x515dd8+_0x0788('0x8d'));}else{_0xeedd30['where']('i.'+_0x515dd8+_0x0788('0x8e'),_0x2737d8[_0x0788('0x4c')][_0x515dd8]);}}});}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x8f')]){if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x8f')]==0x1){_0xeedd30[_0x0788('0x72')](_0x0788('0x90'));}else{_0xeedd30[_0x0788('0x72')]('`unreadMessages`\x20>\x200');}}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')]){_0x47be71=_[_0x0788('0x92')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')])?_0x2737d8['query'][_0x0788('0x91')]:new Array(_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')]);_0x47be71['forEach'](function(_0x1788d1){_0x533f71['or'](_0x0788('0x7d'),'%,'+_0x1788d1+',%');});}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x93')]){var _0x2b74df=_0x2737d8['query'][_0x0788('0x93')][_0x0788('0x94')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x0788('0x95')](_0x2b74df)){_0x3be076['or'](_0x0788('0x96'),_0x2b74df+'%');}else{_0x3be076['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0788('0x97')](_0x2b74df))['or'](_0x0788('0x98'),_0x2b74df+'%');}}}_0xeedd30[_0x0788('0x56')](_0x3be076);_0xeedd30['group'](_0x0788('0x99'));var _0x42c537={'type':db[_0x0788('0x9a')]['QueryTypes'][_0x0788('0x9b')],'raw':!![]};var _0x1b3046=_0xeedd30[_0x0788('0x9c')]();_0x1b3046[_0x0788('0x58')](_0x0788('0x99'));_0x1b3046[_0x0788('0x58')](_0x0788('0x9d'),_0x0788('0x70'));if(_0x1ab634['order']){_0x1ab634[_0x0788('0x54')][_0x0788('0x43')](function(_0x121f1d){var _0x31c921=_0x121f1d[0x0]==='contactName'?_0x121f1d[0x0]:'i.'+_0x121f1d[0x0];_0xeedd30['order'](_0x31c921,_0x121f1d[0x1]===_0x0788('0x9e')?![]:!![]);});}if(!_[_0x0788('0x85')](_0x47be71)){_0xeedd30['having'](_0x533f71);_0x1b3046[_0x0788('0x56')](_0x0788('0x9f'),_0x47be71);}BPromise[_0x0788('0xa0')]()['then'](function(){if(!_0x5419d9){if(_0x2737d8['query'][_0x0788('0xa1')])return;_0x1b3046[_0x0788('0x56')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0xeedd30['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2737d8[_0x0788('0xa2')][_0x0788('0xa3')]!=='agent')return;return _0x2737d8[_0x0788('0xa2')][_0x0788('0xa4')]({'attributes':['id'],'raw':!![]})[_0x0788('0x23')](function(_0x41fe7a){if(_[_0x0788('0x85')](_0x41fe7a)){_0x1b3046['where'](_0x0788('0xa5'));_0xeedd30['where'](_0x0788('0xa5'));}else{_0x1b3046['where'](_0x0788('0xa6'),_[_0x0788('0x46')](_0x41fe7a,'id'));_0xeedd30[_0x0788('0x56')](_0x0788('0xa6'),_[_0x0788('0x46')](_0x41fe7a,'id'));}});})[_0x0788('0x23')](function(){if(_0x2737d8[_0x0788('0xa2')][_0x0788('0xa3')]===_0x0788('0xa7')&&!_0x5419d9&&!_0x2737d8[_0x0788('0x4c')][_0x0788('0xa1')])return[];return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x1b3046['toString'](),_0x42c537);})['then'](function(_0x50363e){_0x4bd0d9[_0x0788('0x32')]=_0x50363e[_0x0788('0x52')];if(_0x4bd0d9[_0x0788('0x32')]===0x0)return[];return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x5ef557[_0x0788('0xa9')](),_0x42c537)[_0x0788('0x23')](function(_0x16838d){_0x3f2f1b=_[_0x0788('0xaa')](_0x16838d,'id');_0x42c537=_[_0x0788('0x3b')](_0x42c537,{'model':db[_0x0788('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2737d8['query']['fields']){_0x1ab634[_0x0788('0x50')][_0x0788('0x43')](function(_0x104a70){_0xeedd30[_0x0788('0x58')]('i.'+_0x104a70);});}else{_0xeedd30[_0x0788('0x58')](_0x0788('0x9d'),_0x0788('0x70'));_0xeedd30[_0x0788('0x58')]('a.key','Account.key');_0xeedd30[_0x0788('0x58')](_0x0788('0xab'),_0x0788('0xac'));_0xeedd30[_0x0788('0x58')](_0x0788('0xad'),_0x0788('0xae'));_0xeedd30['field'](_0x0788('0xaf'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb0'),_0x0788('0xb1'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb2'),_0x0788('0xb3'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb4'),'Contact.email');_0xeedd30[_0x0788('0x58')](_0x0788('0xb5'),_0x0788('0xb6'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb7'),_0x0788('0xb8'));_0xeedd30['field'](_0x0788('0xb9'),_0x0788('0xba'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbb'),_0x0788('0xbc'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbd'),_0x0788('0xbe'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbf'),'TagIds');}if(_0x1ab634[_0x0788('0x30')])_0xeedd30['limit'](_0x1ab634[_0x0788('0x30')]);if(_0x1ab634['offset'])_0xeedd30[_0x0788('0x33')](_0x1ab634['offset']);return db[_0x0788('0xa8')][_0x0788('0x4c')](_0xeedd30[_0x0788('0xa9')](),_0x42c537);})[_0x0788('0x23')](function(_0x5242eb){if(_0x5242eb[_0x0788('0x52')]>0x0)_0x347cc8[_0x0788('0x56')](_0x0788('0xc0'),_['map'](_0x5242eb,'id'));return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x347cc8['toString'](),_0x42c537)[_0x0788('0x23')](function(_0x4645aa){var _0x37e9a9=_[_0x0788('0xc1')](_0x4645aa,_0x0788('0xc2'));var _0xab471b=[];_0x5242eb[_0x0788('0x43')](function(_0x563533){_0xab471b[_0x0788('0x44')](updateChatInteraction(_0x563533,_0x3f2f1b,_0x37e9a9));});return BPromise[_0x0788('0xc3')](_0xab471b);});});})[_0x0788('0x23')](function(_0x3f3e06){_0x4bd0d9[_0x0788('0xc4')]=_0x3f3e06;return _0x4bd0d9;})[_0x0788('0x23')](respondWithFilteredResult(_0x1928f3,_0x1ab634))[_0x0788('0x2b')](handleError(_0x1928f3,null));};exports[_0x0788('0xc5')]=function(_0x5761b1,_0x5130c4){var _0x26233b={'raw':![],'where':{'id':_0x5761b1[_0x0788('0xc6')]['id']}},_0x42f6df={};_0x42f6df[_0x0788('0x4f')]=_[_0x0788('0x4b')](db[_0x0788('0x47')][_0x0788('0x48')]);_0x42f6df['query']=_[_0x0788('0x4b')](_0x5761b1['query']);_0x42f6df['filters']=_[_0x0788('0x4e')](_0x42f6df[_0x0788('0x4f')],_0x42f6df['query']);_0x26233b[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x42f6df[_0x0788('0x4f')],qs[_0x0788('0x51')](_0x5761b1[_0x0788('0x4c')][_0x0788('0x51')]));_0x26233b['attributes']=_0x26233b[_0x0788('0x50')][_0x0788('0x52')]?_0x26233b['attributes']:_0x42f6df[_0x0788('0x4f')];if(_0x5761b1[_0x0788('0x4c')]['includeAll']){_0x26233b[_0x0788('0xc7')]=[{'all':!![]}];}_0x26233b=_[_0x0788('0x3b')]({},_0x26233b,_0x5761b1[_0x0788('0xc8')]);return db[_0x0788('0x47')][_0x0788('0x6f')](_0x26233b)[_0x0788('0x23')](handleEntityNotFound(_0x5130c4,null))[_0x0788('0x23')](respondWithResult(_0x5130c4,null))['catch'](handleError(_0x5130c4,null));};exports[_0x0788('0xc9')]=function(_0x2e0529,_0x1f9944){return db[_0x0788('0x47')]['create'](_0x2e0529[_0x0788('0x83')],{})[_0x0788('0x23')](respondWithResult(_0x1f9944,0xc9))['catch'](handleError(_0x1f9944,null));};exports['update']=function(_0x691225,_0x15a70b){if(_0x691225[_0x0788('0x83')]['id']){delete _0x691225[_0x0788('0x83')]['id'];}return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x691225['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x15a70b,null))[_0x0788('0x23')](saveUpdates(_0x691225[_0x0788('0x83')],null))[_0x0788('0x23')](respondWithResult(_0x15a70b,null))[_0x0788('0x2b')](handleError(_0x15a70b,null));};exports[_0x0788('0xca')]=function(_0xc5e64a,_0x3539d4){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0xc5e64a[_0x0788('0xc6')]['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x3539d4,null))[_0x0788('0x23')](removeEntity(_0x3539d4,null))[_0x0788('0x2b')](handleError(_0x3539d4,null));};exports[_0x0788('0xcb')]=function(_0x150a05,_0x1e0fb7){return db['ChatInteraction'][_0x0788('0xcb')]()[_0x0788('0x23')](respondWithResult(_0x1e0fb7,null))[_0x0788('0x2b')](handleError(_0x1e0fb7,null));};exports[_0x0788('0xcc')]=function(_0x57b44e,_0x191e15){var _0x5d0919=_0x57b44e[_0x0788('0xc6')]['id'];var _0x563e4c;var _0x51da2c;var _0x34a12a;return db[_0x0788('0x47')]['findOne']({'where':{'id':_0x5d0919}})[_0x0788('0x23')](function(_0x522e02){_0x563e4c=_0x522e02;return db[_0x0788('0xcd')]['findOne']({'where':{'id':_0x522e02[_0x0788('0xa1')]},'attributes':['id',_0x0788('0xce'),_0x0788('0xcf'),_0x0788('0xd0'),_0x0788('0xd1'),_0x0788('0xd2')],'raw':!![]});})['then'](function(_0x473491){if(_0x473491&&_0x473491['vidaooApiKey']&&_0x473491[_0x0788('0xcf')]){_0x51da2c=_0x473491;var _0x1222f8={'interaction':{'id':_0x5d0919},'agent':{'id':_0x57b44e['user']['id'],'name':_0x57b44e['user']['name'],'fullname':_0x57b44e[_0x0788('0xa2')]['fullname'],'email':_0x57b44e['user']['email']},'contact':_0x57b44e['body']['contact'],'account':_0x57b44e['body'][_0x0788('0x3e')]};var _0x3c2aa3={'rejectUnauthorized':![],'method':'POST','url':_0x0788('0xd3'),'headers':{'X-APIKEY':_0x473491['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x57b44e[_0x0788('0xa2')]['email']],'buttons':null,'topic':_0x51da2c[_0x0788('0xd0')],'note':_[_0x0788('0xd4')](_0x51da2c[_0x0788('0xd1')])?null:getMustacheRender(_0x51da2c[_0x0788('0xd1')],_0x1222f8),'metadata':null},'redirect':_0x0788('0xd5'),'json':!![]};try{if(!_[_0x0788('0xd4')](_0x51da2c[_0x0788('0xd2')])){var _0x37439f=getMustacheRender(_0x51da2c[_0x0788('0xd2')],_0x1222f8);var _0xf87649=JSON['parse'](_0x37439f);_0x3c2aa3[_0x0788('0x83')]['metadata']=_0xf87649;}}catch(_0x3bd7f3){throw new db['Sequelize']['ValidationError'](_0x0788('0xd6'));}return rp(_0x3c2aa3);}else{throw new db[(_0x0788('0x9a'))][(_0x0788('0xd7'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x0788('0x23')](function(_0x1b52f6){_0x34a12a=_0x1b52f6;if(_0x34a12a['id']){var _0x5be647={'body':_0x34a12a['join_url'],'ChatWebsiteId':_0x51da2c['id'],'ChatInteractionId':_0x563e4c['id'],'direction':_0x0788('0xd8'),'UserId':_0x57b44e[_0x0788('0xa2')]['id']};return db[_0x0788('0xd9')]['create'](_0x5be647,{});}else{throw new db['Sequelize'][(_0x0788('0xd7'))](_0x0788('0xda'));}})[_0x0788('0x23')](function(){return _0x563e4c[_0x0788('0xdb')]({'vidaooSessionId':_0x34a12a['id']});})[_0x0788('0x23')](respondWithResult(_0x191e15,null))[_0x0788('0x2b')](handleError(_0x191e15,null));};exports[_0x0788('0xdc')]=function(_0x252780,_0x3d3272){if(_0x252780['body']['id']){delete _0x252780[_0x0788('0x83')]['id'];}return db['ChatInteraction'][_0x0788('0x6f')]({'where':{'id':_0x252780[_0x0788('0xc6')]['id']},'include':[{'model':db[_0x0788('0xdd')],'as':_0x0788('0x75')}]})[_0x0788('0x23')](handleEntityNotFound(_0x3d3272,null))['then'](saveUpdates(_0x252780[_0x0788('0x83')],null))[_0x0788('0x23')](respondWithResult(_0x3d3272,null))['catch'](handleError(_0x3d3272,null));};exports[_0x0788('0xde')]=function(_0x881d27,_0x47ce3c,_0x1c9b6f){if(_0x881d27['body']['id']){delete _0x881d27[_0x0788('0x83')]['id'];}return db[_0x0788('0x47')]['find']({'where':{'id':_0x881d27[_0x0788('0xc6')]['id']}})[_0x0788('0x23')](function(_0x207b55){if(!_0x207b55){logger[_0x0788('0x27')](_0x0788('0xdf'),_0x0788('0xde'),0x194,_0x0788('0xe0'));_0x47ce3c[_0x0788('0x2c')](0x194);}else{if(_0x207b55['UserId']){throw new db[(_0x0788('0x9a'))][(_0x0788('0xd7'))](_0x0788('0xe1'));}}return _0x207b55;})['then'](function(_0x5ac0bc){if(_0x5ac0bc){return _0x5ac0bc[_0x0788('0xe2')]({'closed':_0x881d27[_0x0788('0x83')][_0x0788('0xe3')],'disposition':_0x881d27[_0x0788('0x83')][_0x0788('0xe4')]})[_0x0788('0x23')](function(_0x48e56d){return _0x48e56d;});}})[_0x0788('0x23')](function(_0x227eaf){return respondWithRpcPromise(_0x0788('0xe5'),_0x0788('0xde'),_0x881d27[_0x0788('0x83')],client9004);})[_0x0788('0x23')](respondWithResult(_0x47ce3c,null))[_0x0788('0x2b')](handleError(_0x47ce3c,null));};exports[_0x0788('0xe6')]=function(_0x1fc335,_0x27c428,_0x1ce4f2){_0x1fc335[_0x0788('0x83')][_0x0788('0x39')]=_0x1fc335[_0x0788('0xe7')][_0x0788('0xe8')];_0x1fc335[_0x0788('0x83')][_0x0788('0xe9')]=_0x1fc335[_0x0788('0xe7')][_0x0788('0xea')];_0x1fc335[_0x0788('0x83')][_0x0788('0x4a')]=_0x1fc335['file'][_0x0788('0xeb')];return db[_0x0788('0xec')][_0x0788('0xc9')](_0x1fc335[_0x0788('0x83')])['then'](respondWithResult(_0x27c428,0xc9))[_0x0788('0x2b')](handleError(_0x27c428,null));};exports[_0x0788('0xed')]=function(_0x5eb3f1,_0xb63553,_0x4a34e2){return db['ChatInteraction']['findOne']({'where':{'id':_0x5eb3f1['params']['id']},'raw':!![]})[_0x0788('0x23')](handleEntityNotFound(_0xb63553,null))[_0x0788('0x23')](function(_0x4cc536){if(_0x4cc536){if(_0x4cc536[_0x0788('0xe3')]){return _0xb63553[_0x0788('0x2d')](0x193)[_0x0788('0x2f')]({'status':0x193,'message':_0x0788('0xee')});}return db[_0x0788('0xec')][_0x0788('0xef')]({'where':{'id':_0x5eb3f1[_0x0788('0x4c')][_0x0788('0xf0')]},'raw':!![]})[_0x0788('0x23')](handleEntityNotFound(_0xb63553,null));}})['then'](function(_0x2047bc){if(_0x2047bc){var _0x38fd71=_0x2047bc['ChatOfflineMessageId']!==null;var _0x224ef9=path[_0x0788('0xf1')](config[_0x0788('0xf2')],_0x0788('0xf3'));if(_0x38fd71){_0x224ef9=path[_0x0788('0xf1')](_0x224ef9,_0x0788('0xf4'));}var _0x2399b9=path[_0x0788('0xf1')](_0x224ef9,_0x2047bc[_0x0788('0xe9')]);return _0xb63553[_0x0788('0xf5')](_0x2399b9);}})[_0x0788('0x2b')](handleError(_0xb63553,null));};exports[_0x0788('0xf6')]=function(_0x31c746,_0x4f696c){var _0x11de9c=null;var _0xf690e0=null;var _0x4a492c=null;var _0x523faa=null;if(_0x31c746[_0x0788('0x83')]['id']){delete _0x31c746[_0x0788('0x83')]['id'];}if(_0x31c746['body'][_0x0788('0xf7')]){_0x523faa=path[_0x0788('0xf1')](config[_0x0788('0xf2')],'server/files/chat/upload/',util['format'](_0x0788('0xf8'),Date[_0x0788('0xf9')]()));_0x31c746['body']['pathTranscript']=_0x523faa;}return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x31c746['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x0788('0xfa'),'include':[{'model':db[_0x0788('0x7f')],'as':'User'}]}]})[_0x0788('0x23')](handleEntityNotFound(_0x4f696c,null))[_0x0788('0x23')](saveUpdates(_0x31c746['body'],null))[_0x0788('0x23')](function(_0x21be45){if(_0x21be45){_0x11de9c=_0x21be45;return db[_0x0788('0xcd')][_0x0788('0x6f')]({'where':{'id':_0x11de9c[_0x0788('0xa1')]}});}})['then'](function(_0x36acad){if(_0x36acad){_0x4a492c=_0x36acad;return db[_0x0788('0xdd')][_0x0788('0x6f')]({'where':{'id':_0x11de9c[_0x0788('0x79')]}});}})[_0x0788('0x23')](function(_0x569b4d){if(_0x569b4d){_0xf690e0=_0x569b4d;if(_0x523faa){var _0x31ffc7=null;for(var _0x59aece=0x1;_0x59aece<_0x11de9c['Messages'][_0x0788('0x52')];++_0x59aece){_0x31ffc7=_0x11de9c[_0x0788('0xfa')][_0x59aece];var _0x3787d3=_0x31ffc7[_0x0788('0x81')]?util['format'](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7[_0x0788('0x81')]):'System';var _0x3ea229=_0x31c746[_0x0788('0x83')][_0x0788('0xfd')]||util[_0x0788('0xfe')](_0x0788('0xfb'),'Visitor',_0x31ffc7[_0x0788('0x79')]);switch(_0x4a492c['agentIdentifier']){case _0x0788('0xff'):_0x3787d3=_0x31ffc7[_0x0788('0x81')]?util[_0x0788('0xfe')](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7['UserId']):_0x0788('0x100');break;case'agent_alias':_0x3787d3=_0x31ffc7[_0x0788('0x81')]?_0x31ffc7['User'][_0x0788('0x101')]||_0x31ffc7[_0x0788('0x7f')]['fullname']:_0x0788('0x100');break;case _0x0788('0x102'):_0x3787d3=_0x31ffc7[_0x0788('0x81')]?_0x31ffc7[_0x0788('0x7f')][_0x0788('0x3f')]:_0x0788('0x100');break;default:_0x3787d3=_0x31ffc7[_0x0788('0x81')]?util[_0x0788('0xfe')](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7[_0x0788('0x81')]):'System';}var _0x303d5=util['format'](_0x0788('0x103'),moment(_0x31ffc7['createdAt'])[_0x0788('0xfe')](_0x0788('0x104')),_0x31ffc7['direction']==='in'?_0x3ea229:_0x3787d3,_0x31ffc7['body']);if(!_0x31ffc7['secret']){fs[_0x0788('0x105')](_0x523faa,_0x303d5);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x0788('0x106')],'as':_0x0788('0x107'),'raw':!![]}]});}}})[_0x0788('0x23')](function(_0x5c5464){if(_0x5c5464&&_0x5c5464[_0x0788('0x107')]&&_0x31c746[_0x0788('0x83')]){var _0x14420b={'tls':{'rejectUnauthorized':![]}};if(_0x5c5464['Smtp']['service']){_0x14420b[_0x0788('0x108')]=_0x5c5464[_0x0788('0x107')][_0x0788('0x108')];}else{_0x14420b['host']=_0x5c5464[_0x0788('0x107')][_0x0788('0x109')];_0x14420b[_0x0788('0x10a')]=_0x5c5464['Smtp']['port'];_0x14420b[_0x0788('0x10b')]=_0x5c5464['Smtp'][_0x0788('0x10b')];}if(_0x5c5464[_0x0788('0x107')]['authentication']){_0x14420b['auth']={'user':_0x5c5464[_0x0788('0x107')][_0x0788('0xa2')],'pass':_0x5c5464['Smtp'][_0x0788('0x10c')]};}return respondWithRpcPromise(_0x0788('0x10d'),'sendMail',{'account':_0x14420b,'message':{'from':util[_0x0788('0xfe')](_0x0788('0x10e'),_0x5c5464[_0x0788('0x39')],_0x5c5464[_0x0788('0x10f')]||_0x5c5464['Smtp'][_0x0788('0xa2')]),'to':_0x31c746[_0x0788('0x83')][_0x0788('0xf7')],'subject':_0x0788('0x110'),'text':util[_0x0788('0xfe')](_0x0788('0x111'),_0x31c746[_0x0788('0x83')][_0x0788('0xf7')]),'attachments':[{'path':_0x523faa}]}})[_0x0788('0x23')](function(){return _0x11de9c;})['catch'](function(_0x1b5b80){console[_0x0788('0x27')](_0x1b5b80);});}else{return _0x11de9c;}})['then'](respondWithStatusCode(_0x4f696c,0xc8))[_0x0788('0x2b')](handleError(_0x4f696c,null));};exports[_0x0788('0x112')]=function(_0x5522e3,_0x5f1a46,_0x248f60){return db[_0x0788('0xd9')][_0x0788('0x6f')]({'where':{'id':_0x5522e3['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x5f1a46,null))[_0x0788('0x23')](function(_0x36d7f9){if(_0x36d7f9){return _0x36d7f9['addMessage'](_0x5522e3[_0x0788('0x83')][_0x0788('0x113')],_['omit'](_0x5522e3['body'],['ids','id'])||{});}})[_0x0788('0x23')](respondWithResult(_0x5f1a46,null))[_0x0788('0x2b')](handleError(_0x5f1a46,null));};exports[_0x0788('0x114')]=function(_0x20f429,_0x364f26,_0x351665){var _0x1ba9fb={'raw':![],'where':{}};var _0x56b11c={};var _0x4f36bd={'count':0x0,'rows':[]};return db[_0x0788('0x47')][_0x0788('0xef')]({'where':{'id':_0x20f429[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x364f26,null))[_0x0788('0x23')](function(_0x1c7980){if(_0x1c7980){_0x56b11c[_0x0788('0x4f')]=_[_0x0788('0x4b')](db['ChatMessage']['rawAttributes']);_0x56b11c[_0x0788('0x4c')]=_[_0x0788('0x4b')](_0x20f429[_0x0788('0x4c')]);_0x56b11c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x56b11c[_0x0788('0x4f')],_0x56b11c[_0x0788('0x4c')]);_0x1ba9fb[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x56b11c['model'],qs[_0x0788('0x51')](_0x20f429[_0x0788('0x4c')][_0x0788('0x51')]));_0x1ba9fb[_0x0788('0x50')]=_0x1ba9fb[_0x0788('0x50')][_0x0788('0x52')]?_0x1ba9fb[_0x0788('0x50')]:_0x56b11c['model'];if(!_0x20f429[_0x0788('0x4c')][_0x0788('0x53')](_0x0788('0x115'))){_0x1ba9fb['limit']=qs[_0x0788('0x30')](_0x20f429[_0x0788('0x4c')][_0x0788('0x30')]);_0x1ba9fb[_0x0788('0x33')]=qs[_0x0788('0x33')](_0x20f429['query']['offset']);}_0x1ba9fb['order']=qs[_0x0788('0x55')](_0x20f429[_0x0788('0x4c')][_0x0788('0x55')]);_0x1ba9fb[_0x0788('0x56')]=qs[_0x0788('0x4d')](_[_0x0788('0x116')](_0x20f429[_0x0788('0x4c')],_0x56b11c['filters']));_0x1ba9fb[_0x0788('0x56')][_0x0788('0xc2')]=_0x1c7980['id'];if(_0x20f429[_0x0788('0x4c')][_0x0788('0x93')]){_0x1ba9fb['where']=_[_0x0788('0x3b')](_0x1ba9fb[_0x0788('0x56')],{'$or':_[_0x0788('0x46')](_0x1ba9fb[_0x0788('0x50')],function(_0xccb2e6){var _0x4cc769={};_0x4cc769[_0xccb2e6]={'$like':'%'+_0x20f429[_0x0788('0x4c')][_0x0788('0x93')]+'%'};return _0x4cc769;})});}if(_0x20f429[_0x0788('0x4c')][_0x0788('0x89')]){var _0x4785ac=_0x20f429[_0x0788('0x4c')][_0x0788('0x89')][_0x0788('0x42')](',');var _0x4455dc={};_0x4455dc[_0x4785ac[0x0]]={'$gte':moment(_0x4785ac[0x1])['format'](_0x0788('0x117'))};_0x1ba9fb['where']=_[_0x0788('0x3b')](_0x1ba9fb[_0x0788('0x56')],_0x4455dc);}_0x1ba9fb=_[_0x0788('0x3b')]({},_0x1ba9fb,_0x20f429[_0x0788('0xc8')]);return db[_0x0788('0xd9')][_0x0788('0x32')]({'where':_0x1ba9fb[_0x0788('0x56')]})['then'](function(_0x3eb474){_0x4f36bd[_0x0788('0x32')]=_0x3eb474;if(_0x20f429['query'][_0x0788('0x118')]){_0x1ba9fb[_0x0788('0xc7')]=[{'all':!![]}];}return db[_0x0788('0xd9')]['findAll'](_0x1ba9fb);})['then'](function(_0x1aa86f){_0x4f36bd[_0x0788('0xc4')]=_0x1aa86f;return _0x4f36bd;});}})['then'](respondWithFilteredResult(_0x364f26,_0x1ba9fb))['catch'](handleError(_0x364f26,null));};exports[_0x0788('0x119')]=function(_0x4d6a60,_0x114658,_0x4b11b9){var _0x9af662={'where':{}},_0x257e1c={},_0x35a6bc={'count':0x0,'rows':[]};return db[_0x0788('0x47')]['findOne']({'where':{'id':_0x4d6a60['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x114658,null))[_0x0788('0x23')](function(_0x278a6f){if(_0x278a6f){_0x257e1c[_0x0788('0x4f')]=_['keys'](db[_0x0788('0xd9')][_0x0788('0x48')]);_0x257e1c[_0x0788('0x4c')]=_[_0x0788('0x4b')](_0x4d6a60['query']);_0x257e1c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x257e1c['model'],_0x257e1c[_0x0788('0x4c')]);_0x9af662[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x257e1c[_0x0788('0x4f')],qs[_0x0788('0x51')](_0x4d6a60[_0x0788('0x4c')]['fields']));_0x9af662[_0x0788('0x50')]=_0x9af662[_0x0788('0x50')][_0x0788('0x52')]?_0x9af662[_0x0788('0x50')]:_0x257e1c['model'];if(!_0x4d6a60[_0x0788('0x4c')]['hasOwnProperty'](_0x0788('0x115'))){_0x9af662['limit']=qs['limit'](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x30')]);_0x9af662[_0x0788('0x33')]=qs[_0x0788('0x33')](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x33')]);}_0x9af662[_0x0788('0x54')]=qs[_0x0788('0x55')](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x55')]);_0x9af662['where']=qs['filters'](_['pick'](_0x4d6a60[_0x0788('0x4c')],_0x257e1c[_0x0788('0x4d')]));_0x9af662[_0x0788('0x56')][_0x0788('0xc2')]=_0x278a6f['id'];if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x93')]){_0x9af662[_0x0788('0x56')]=_[_0x0788('0x3b')](_0x9af662['where'],{'$or':_[_0x0788('0x46')](_0x9af662[_0x0788('0x50')],function(_0x4a4297){var _0x1fb846={};_0x1fb846[_0x4a4297]={'$like':'%'+_0x4d6a60[_0x0788('0x4c')][_0x0788('0x93')]+'%'};return _0x1fb846;})});}_0x9af662['where'][_0x0788('0x11a')]=![];if(_0x4d6a60[_0x0788('0x4c')]['id']){_0x9af662[_0x0788('0x56')]['id']={'$gt':_0x4d6a60[_0x0788('0x4c')]['id']};}_0x9af662=_[_0x0788('0x3b')]({},_0x9af662,_0x4d6a60[_0x0788('0xc8')]);return db[_0x0788('0xd9')][_0x0788('0x32')]({'where':_0x9af662[_0x0788('0x56')]})[_0x0788('0x23')](function(_0x292d07){_0x35a6bc[_0x0788('0x32')]=_0x292d07;_0x9af662[_0x0788('0xc7')]=[];if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x11b')]){_0x9af662['include'][_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x7f'),'attributes':['id','fullname',_0x0788('0x101')]});}if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x118')]){_0x9af662['include']=[{'all':!![]}];}return db[_0x0788('0xd9')][_0x0788('0x11c')](_0x9af662);})['then'](function(_0xa44dc3){_0x35a6bc[_0x0788('0xc4')]=_0xa44dc3;return _0x35a6bc;});}})[_0x0788('0x23')](respondWithFilteredResult(_0x114658,_0x9af662))['catch'](handleError(_0x114658,null));};exports[_0x0788('0x11d')]=function(_0x5b0417,_0x4d5e94,_0x1fb141){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x5b0417[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x4d5e94,null))[_0x0788('0x23')](function(_0x5bf415){if(_0x5bf415){return _0x5bf415['setTags'](_0x5b0417['body'][_0x0788('0x113')],_['omit'](_0x5b0417['body'],['ids','id'])||{})[_0x0788('0x11e')](function(){return db[_0x0788('0x7c')][_0x0788('0x11c')]({'attributes':['id',_0x0788('0x39'),_0x0788('0x59')],'where':{'id':_0x5b0417[_0x0788('0x83')][_0x0788('0x113')]}});})[_0x0788('0x23')](function(_0x109d90){socket[_0x0788('0x11f')](_0x0788('0x120'),{'id':Number(_0x5b0417[_0x0788('0xc6')]['id']),'tags':_0x109d90||[]});return{'id':Number(_0x5b0417[_0x0788('0xc6')]['id']),'tags':_0x109d90||[]};});}})['then'](respondWithResult(_0x4d5e94,null))[_0x0788('0x2b')](handleError(_0x4d5e94,null));};exports['removeTags']=function(_0x26343c,_0x30334c,_0x1d18bc){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x26343c[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x30334c,null))[_0x0788('0x23')](function(_0x10266b){if(_0x10266b){return _0x10266b[_0x0788('0x121')](_0x26343c[_0x0788('0x4c')][_0x0788('0x113')]);}})[_0x0788('0x23')](respondWithStatusCode(_0x30334c,null))['catch'](handleError(_0x30334c,null));};exports['download']=function(_0x1fb76f,_0x17ca71){var _0xbae24f=moment()[_0x0788('0x122')]()[_0x0788('0xa9')]();var _0x525754=path['join'](config['root'],_0x0788('0x123'),_0x0788('0x124'),_0x0788('0x125'));var _0x2d51ef=path[_0x0788('0xf1')](config[_0x0788('0xf2')],_0x0788('0x123'),_0x0788('0x124'),_0x0788('0x126'));var _0x5ecd59=path['join'](_0x525754,_0xbae24f);var _0xf63471=util[_0x0788('0xfe')](_0x0788('0x127'),_0x1fb76f[_0x0788('0xc6')]['id'],_0xbae24f);var _0x390cdf=path[_0x0788('0xf1')](_0x525754,_0xf63471);var _0x40a75d=[];_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x7f'),'attributes':['id',_0x0788('0x3f')],'raw':!![]});_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0xdd')],'as':'Contact','attributes':['id',_0x0788('0x128'),_0x0788('0x129')],'raw':!![]});if(_0x1fb76f[_0x0788('0x4c')][_0x0788('0x126')]){_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0xec')],'as':_0x0788('0xec'),'raw':!![]});}var _0x4cf323=[{'model':db[_0x0788('0xd9')],'as':_0x0788('0xfa'),'attributes':['id','body',_0x0788('0x87'),'direction',_0x0788('0x11a'),_0x0788('0x8f')],'include':_0x40a75d}];_0x4cf323['push']({'model':db[_0x0788('0xcd')],'as':'Account','attributes':['id',_0x0788('0x39')]});_0x4cf323[_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x12a'),'attributes':['id',_0x0788('0x3f')]});return db['ChatInteraction'][_0x0788('0x6f')]({'where':{'id':_0x1fb76f['params']['id']},'include':_0x4cf323})['then'](handleEntityNotFound(_0x17ca71,null))[_0x0788('0x23')](function(_0x1fa39f){if(_0x1fa39f){var _0x19b030=_0x1fa39f[_0x0788('0x12b')]({'plain':!![]});fs[_0x0788('0x12c')](_0x5ecd59);var _0x35fc5b={'channel':'Chat','account':_0x19b030[_0x0788('0x12d')]['name'],'agent':_0x19b030[_0x0788('0x12a')]?_0x19b030[_0x0788('0x12a')][_0x0788('0x3f')]:'N.A.','createdAt':moment(_0x19b030['createdAt'])[_0x0788('0xfe')](_0x0788('0x117'))['toString'](),'closedAt':_0x19b030[_0x0788('0xe3')]?moment(_0x19b030[_0x0788('0x12e')])[_0x0788('0xfe')](_0x0788('0x117'))[_0x0788('0xa9')]():'','disposition':_0x19b030[_0x0788('0xe4')],'chatInfo':{'browser':_0x19b030[_0x0788('0x12f')],'os':_0x19b030['osName'],'referer':_0x19b030['referer'],'customerIp':_0x19b030['customerIp'],'customerPort':_0x19b030[_0x0788('0x130')]?_0x19b030['customerPort']:_0x0788('0x131')},'messages':_(_0x19b030[_0x0788('0xfa')])[_0x0788('0x132')]()[_0x0788('0x93')]({'secret':![]})[_0x0788('0x46')](function(_0x3ff416){if(_0x3ff416[_0x0788('0xec')]){var _0x7d6cf9=path[_0x0788('0xf1')](_0x2d51ef,_0x3ff416[_0x0788('0xec')][_0x0788('0xe9')]);if(fs['existsSync'](_0x7d6cf9)){fs[_0x0788('0x133')](_0x7d6cf9)['pipe'](fs[_0x0788('0x134')](path[_0x0788('0xf1')](_0x5ecd59,_0x3ff416[_0x0788('0xec')][_0x0788('0xe9')])));}}return{'date':moment(_0x3ff416[_0x0788('0x87')])[_0x0788('0xfe')](_0x0788('0x117'))[_0x0788('0xa9')](),'sender':_0x3ff416[_0x0788('0x135')]===_0x0788('0xd8')?_0x3ff416['User']?_0x3ff416[_0x0788('0x7f')][_0x0788('0x3f')]:_0x0788('0x100'):_0x3ff416[_0x0788('0x75')]['firstName']+(_0x3ff416[_0x0788('0x75')][_0x0788('0x129')]?'\x20'+_0x3ff416['Contact'][_0x0788('0x129')]:''),'body':_0x3ff416['Attachment']?_0x3ff416[_0x0788('0xec')]['basename']:_0x3ff416[_0x0788('0x83')],'direction':_0x3ff416[_0x0788('0x135')]===_0x0788('0xd8')?'A':'C','secret':_0x3ff416['secret'],'read':_0x3ff416[_0x0788('0x8f')],'attachment':_0x3ff416['Attachment']};})[_0x0788('0x71')]()};return ejs[_0x0788('0x136')](path[_0x0788('0xf1')](config[_0x0788('0xf2')],'server','views',_0x0788('0x137')),{'interaction':_0x35fc5b})['then'](function(_0x45962d){var _0x4cc133=path[_0x0788('0xf1')](_0x5ecd59,_0x0788('0x138')+_0x19b030['id']+'-'+_0xbae24f+_0x0788('0x139'));var _0x52452f={'path':_0x4cc133,'channel':_0x0788('0x13a'),'interactionId':_0x19b030['id']};return pdf[_0x0788('0x13b')](_0x45962d,_0x52452f);})[_0x0788('0x23')](function(){return new BPromise(function(_0xe2d72d,_0x5401a8){zipdir(_0x5ecd59,{'saveTo':_0x390cdf},function(_0x5b289e,_0x4191b4){if(_0x5b289e)return _0x5401a8(_0x5b289e);return _0xe2d72d(_0x4191b4);});})[_0x0788('0x23')](function(){return new BPromise(function(_0x5440c6,_0x2dbb74){rimraf(_0x5ecd59,function(_0x8a89c0){if(_0x8a89c0)_0x2dbb74(_0x8a89c0);return _0x5440c6();});});})['then'](function(){return _0x17ca71['download'](_0x390cdf,_0xf63471,function(_0x2487db){if(_0x2487db){console['log'](_0x0788('0x13c'),_0x2487db);}else{fs[_0x0788('0x13d')](_0x390cdf);}});});});}else{return _0x17ca71[_0x0788('0x2c')](0xc8);}})['catch'](handleError(_0x17ca71,null));}; \ No newline at end of file +var _0x5f2f=['vidaooMetadata','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','mailTranscript','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','service','host','port','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','getMessages','pick','includeAll','findAll','getMyMessages','includeAgent','alias','setTags','ids','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','get','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','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','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','status','end','limit','undefined','count','set','Content-Range','json','apply','save','update','name','merge','body','contact','account','Users','map','fullname','TagIds','Tags','split','forEach','push','index','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','getFullTextValue','find','ContactId','buildExpression','text','start','Tag','union','User','UserId','some','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','contactName','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','keyBy','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','include','options','create','destroy','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow'];(function(_0x4a1412,_0x2b6ee8){var _0x2cc456=function(_0x2cf4a4){while(--_0x2cf4a4){_0x4a1412['push'](_0x4a1412['shift']());}};_0x2cc456(++_0x2b6ee8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5ee824,_0x3b1c7b){_0x5ee824=_0x5ee824-0x0;var _0x1abd19=_0x5f2f[_0x5ee824];return _0x1abd19;};'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 pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5f2('0x14'))(_0xf5f2('0x15'));var utils=require('../../config/utils');var config=require(_0xf5f2('0x16'));var licenseUtil=require(_0xf5f2('0x17'));var db=require(_0xf5f2('0x18'))['db'];config[_0xf5f2('0x19')]=_[_0xf5f2('0x1a')](config[_0xf5f2('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf5f2('0x1b'))(new Redis(config[_0xf5f2('0x19')]));require(_0xf5f2('0x1c'))[_0xf5f2('0x1d')](socket);var jayson=require(_0xf5f2('0x1e'));var client=jayson['client'][_0xf5f2('0x1f')]({'port':0x232b});var client9004=jayson[_0xf5f2('0x20')][_0xf5f2('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x1b6dd2,_0x23e23a,_0x3a9dbb,_0xdb61b3){return new BPromise(function(_0x395a5a,_0x11f702){var _0x228ace=_0xdb61b3||client;return _0x228ace[_0xf5f2('0x21')](_0x1b6dd2,_0x3a9dbb)[_0xf5f2('0x22')](function(_0x4ff59b){logger[_0xf5f2('0x23')](_0xf5f2('0x24'),_0x23e23a,_0xf5f2('0x25'));logger[_0xf5f2('0x26')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x23e23a,_0xf5f2('0x25'),JSON[_0xf5f2('0x27')](_0x4ff59b));if(_0x4ff59b['error']){if(_0x4ff59b['error'][_0xf5f2('0x28')]===0x1f4){logger[_0xf5f2('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);return _0x11f702(_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);}logger[_0xf5f2('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);return _0x395a5a(_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);}else{logger[_0xf5f2('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,'request\x20sent');_0x395a5a(_0x4ff59b[_0xf5f2('0x2b')][_0xf5f2('0x2a')]);}})[_0xf5f2('0x2c')](function(_0x1a5bb3){logger[_0xf5f2('0x29')](_0xf5f2('0x24'),_0x23e23a,_0x1a5bb3);_0x11f702(_0x1a5bb3);});});}function respondWithStatusCode(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0xcc;return function(_0x294414){if(_0x294414){return _0x13a3be['sendStatus'](_0x281ec8);}return _0x13a3be[_0xf5f2('0x2d')](_0x281ec8)[_0xf5f2('0x2e')]();};}function respondWithResult(_0x375ca8,_0x31bfcb){_0x31bfcb=_0x31bfcb||0xc8;return function(_0x198c73){if(_0x198c73){return _0x375ca8[_0xf5f2('0x2d')](_0x31bfcb)['json'](_0x198c73);}};}function respondWithFilteredResult(_0x53cb96,_0x22c826){return function(_0x14c829){if(_0x14c829){var _0x11c771=typeof _0x22c826['offset']==='undefined'&&typeof _0x22c826[_0xf5f2('0x2f')]===_0xf5f2('0x30');var _0x17394a=_0x14c829[_0xf5f2('0x31')];var _0x1b381e=_0x11c771?0x0:_0x22c826['offset'];var _0x52e959=_0x11c771?_0x14c829[_0xf5f2('0x31')]:_0x22c826['offset']+_0x22c826[_0xf5f2('0x2f')];var _0x58a4df;if(_0x52e959>=_0x17394a){_0x52e959=_0x17394a;_0x58a4df=0xc8;}else{_0x58a4df=0xce;}_0x53cb96[_0xf5f2('0x2d')](_0x58a4df);return _0x53cb96[_0xf5f2('0x32')](_0xf5f2('0x33'),_0x1b381e+'-'+_0x52e959+'/'+_0x17394a)[_0xf5f2('0x34')](_0x14c829);}return null;};}function patchUpdates(_0x256bd9){return function(_0x277eee){try{jsonpatch[_0xf5f2('0x35')](_0x277eee,_0x256bd9,!![]);}catch(_0x2c0e05){return BPromise['reject'](_0x2c0e05);}return _0x277eee[_0xf5f2('0x36')]();};}function saveUpdates(_0x43e4ff,_0x4590ec){return function(_0x43c77d){if(_0x43c77d){return _0x43c77d[_0xf5f2('0x37')](_0x43e4ff)[_0xf5f2('0x22')](function(_0x297c0c){return _0x297c0c;});}return null;};}function removeEntity(_0x48d64d,_0x144646){return function(_0xf503e8){if(_0xf503e8){return _0xf503e8['destroy']()[_0xf5f2('0x22')](function(){_0x48d64d['status'](0xcc)[_0xf5f2('0x2e')]();});}};}function handleEntityNotFound(_0x3930fb,_0x2a2c31){return function(_0x2e3cca){if(!_0x2e3cca){_0x3930fb['sendStatus'](0x194);}return _0x2e3cca;};}function handleError(_0x5a98d7,_0x41088b){_0x41088b=_0x41088b||0x1f4;return function(_0x46ad4a){logger[_0xf5f2('0x29')](_0x46ad4a['stack']);if(_0x46ad4a[_0xf5f2('0x38')]){delete _0x46ad4a['name'];}_0x5a98d7[_0xf5f2('0x2d')](_0x41088b)['send'](_0x46ad4a);};}function getMustacheRender(_0x46f464,_0x456764){return Mustache['render'](_0x46f464,_[_0xf5f2('0x39')](_0x456764[_0xf5f2('0x3a')],{'contact':_0x456764[_0xf5f2('0x3b')],'message':_0x456764[_0xf5f2('0x2a')],'agent':_0x456764['agent'],'interaction':_0x456764['interaction'],'account':_0x456764[_0xf5f2('0x3c')]}))||'';}function getInteractionUsers(_0x140a11,_0x22b20c){return new BPromise(function(_0x2d4400,_0x2c7f65){try{if(_0x22b20c[_0x140a11['id']]){_0x140a11[_0xf5f2('0x3d')]=_[_0xf5f2('0x3e')](_0x22b20c[_0x140a11['id']],function(_0x4c0ac7){return{'id':_0x4c0ac7['id'],'fullname':_0x4c0ac7[_0xf5f2('0x3f')]};});}}catch(_0x3b4ea6){_0x2c7f65(_0x3b4ea6);}_0x2d4400(_0x140a11);});}function getInteractionTags(_0x536501,_0xc6a1ae){return new BPromise(function(_0x3f3895,_0x71b0e7){try{if(_0x536501[_0xf5f2('0x40')]){_0x536501[_0xf5f2('0x41')]=[];_0x536501[_0xf5f2('0x40')][_0xf5f2('0x42')](',')[_0xf5f2('0x43')](function(_0x574f24){_0x536501[_0xf5f2('0x41')][_0xf5f2('0x44')](_0xc6a1ae[_0x574f24]);});}delete _0x536501[_0xf5f2('0x40')];}catch(_0x4a8e39){_0x71b0e7(_0x4a8e39);}_0x3f3895(_0x536501);});}function updateChatInteraction(_0x509dbc,_0x59eb00,_0x76d21b){return new BPromise(function(_0x2ad13c,_0x4c8d8e){return getInteractionUsers(_0x509dbc,_0x76d21b)[_0xf5f2('0x22')](function(_0xeed03d){return getInteractionTags(_0xeed03d,_0x59eb00);})[_0xf5f2('0x22')](function(_0x31f86c){_0x2ad13c(_0x31f86c);})[_0xf5f2('0x2c')](function(_0x2b3b1c){_0x4c8d8e(_0x2b3b1c);});});}exports[_0xf5f2('0x45')]=function(_0x212e90,_0x40c322){var _0x106062={},_0x444317={},_0x4773cd={'count':0x0,'rows':[]};var _0x4252a3=_[_0xf5f2('0x3e')](db['ChatInteraction'][_0xf5f2('0x46')],function(_0x578c93){return{'name':_0x578c93[_0xf5f2('0x47')],'type':_0x578c93[_0xf5f2('0x48')][_0xf5f2('0x49')]};});_0x444317[_0xf5f2('0x4a')]=_[_0xf5f2('0x3e')](_0x4252a3,_0xf5f2('0x38'));_0x444317['query']=_[_0xf5f2('0x4b')](_0x212e90[_0xf5f2('0x4c')]);_0x444317[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x444317[_0xf5f2('0x4a')],_0x444317[_0xf5f2('0x4c')]);_0x106062[_0xf5f2('0x4f')]=_[_0xf5f2('0x4e')](_0x444317['model'],qs[_0xf5f2('0x50')](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x106062['attributes']=_0x106062[_0xf5f2('0x4f')][_0xf5f2('0x51')]?_0x106062[_0xf5f2('0x4f')]:_0x444317['model'];if(!_0x212e90['query'][_0xf5f2('0x52')](_0xf5f2('0x53'))){_0x106062['limit']=qs[_0xf5f2('0x2f')](_0x212e90['query'][_0xf5f2('0x2f')]);_0x106062['offset']=qs[_0xf5f2('0x54')](_0x212e90['query'][_0xf5f2('0x54')]);}_0x106062[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x212e90[_0xf5f2('0x4c')]['sort']);_0x106062[_0xf5f2('0x57')]=qs[_0xf5f2('0x4d')](_['pick'](_0x212e90['query'],_0x444317[_0xf5f2('0x4d')]),_0x4252a3);var _0x3dc0c4=[];var _0x57782c=squel[_0xf5f2('0x58')]()[_0xf5f2('0x59')]('id')[_0xf5f2('0x59')](_0xf5f2('0x38'))['field']('color')[_0xf5f2('0x5a')](_0xf5f2('0x5b'));var _0x4b62fc=squel[_0xf5f2('0x58')]()[_0xf5f2('0x59')](_0xf5f2('0x5c'))[_0xf5f2('0x59')](_0xf5f2('0x5d'))[_0xf5f2('0x59')](_0xf5f2('0x5e'))['from']('user_has_chat_interactions','ui')[_0xf5f2('0x5f')](_0xf5f2('0x60'),'u',_0xf5f2('0x61'));var _0x46a905=squel[_0xf5f2('0x58')]()['from'](_0xf5f2('0x62'),'i')[_0xf5f2('0x5f')](_0xf5f2('0x63'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf5f2('0x5f')]('users','o',_0xf5f2('0x64'))[_0xf5f2('0x5f')](_0xf5f2('0x65'),'a',_0xf5f2('0x66'))['left_join']('chat_messages','me',_0xf5f2('0x67'))['left_join'](_0xf5f2('0x68'),'it',_0xf5f2('0x69'))['left_join'](_0xf5f2('0x5b'),'t',_0xf5f2('0x6a'));var _0x2a8f6d=squel['expr']();var _0x397b99=[];var _0xcf7a50=squel[_0xf5f2('0x6b')]();var _0x4579f4;if(_0x212e90['query'][_0xf5f2('0x6c')]){_0x4579f4=as['parseSearch'](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x6c')]);var _0x2e6f5d=_0x4579f4[_0xf5f2('0x6d')];for(var _0x9f210e=0x0;_0x9f210e<_0x4579f4['conditions'][_0xf5f2('0x51')];_0x9f210e++){var _0xacd80=_0x4579f4[_0xf5f2('0x6e')][_0x9f210e];var _0x212639='i';var _0x2c5733=_['find'](_0x4252a3,[_0xf5f2('0x38'),_0xacd80['field']]);if(!_0x2c5733){switch(_0xacd80['field']){case _0xf5f2('0x6f'):if(_0xacd80['value']==0x1){_0x46a905[_0xf5f2('0x70')]('`'+_0xacd80[_0xf5f2('0x59')]+_0xf5f2('0x71'));}else{_0x46a905[_0xf5f2('0x70')]('`'+_0xacd80['field']+_0xf5f2('0x72'));}break;case _0xf5f2('0x73'):if(_0xacd80[_0xf5f2('0x74')]===_0xf5f2('0x75')){if(_0xacd80[_0xf5f2('0x76')][_0xf5f2('0x42')]('\x20')[_0xf5f2('0x51')]>0x1){_0x2a8f6d[_0x2e6f5d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf5f2('0x77')](_0xacd80[_0xf5f2('0x76')]),null);}else{var _0xb39a6e='%'+_0xacd80[_0xf5f2('0x76')]+'%';_0x2a8f6d[_0x2e6f5d]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xb39a6e,_0xb39a6e,_0xb39a6e);}}else{_0x2c5733=_[_0xf5f2('0x78')](_0x4252a3,['name',_0xf5f2('0x79')]);_0xacd80[_0xf5f2('0x59')]='ContactId';_0x5a143f=as[_0xf5f2('0x7a')](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value'][_0xf5f2('0x2e')]);}break;case _0xf5f2('0x7d'):var _0x3a0e75=_0xacd80[_0xf5f2('0x76')][_0xf5f2('0x42')](',')[_0xf5f2('0x3e')](function(_0x53284f){return Number(_0x53284f);});_0x3a0e75[_0xf5f2('0x43')](function(_0x3f475e){_0xcf7a50['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3f475e+',%');});_0x397b99=_[_0xf5f2('0x7e')](_0x397b99,_0x3a0e75);break;case _0xf5f2('0x7f'):if(_0xacd80[_0xf5f2('0x74')]==='$substring'){_0x2a8f6d[_0x2e6f5d]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xacd80['value']+'%',null);}else{_0x2c5733=_[_0xf5f2('0x78')](_0x4252a3,[_0xf5f2('0x38'),_0xf5f2('0x80')]);_0xacd80[_0xf5f2('0x59')]=_0xf5f2('0x80');_0x5a143f=as['buildExpression'](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x2e')]);}break;case _0xf5f2('0x3a'):_0x5a143f=as[_0xf5f2('0x7a')]('me',null,_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value']['end']);break;}}else{var _0x5a143f=as[_0xf5f2('0x7a')](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value'][_0xf5f2('0x2e')]);}}}else{var _0x43c732=_(_0x212e90[_0xf5f2('0x4c')])[_0xf5f2('0x4b')]()[_0xf5f2('0x3e')](function(_0x55748d){return _[_0xf5f2('0x81')](_0x4252a3,[_0xf5f2('0x38'),_0x55748d])?_0x55748d:undefined;})['compact']()[_0xf5f2('0x76')]();if(!_[_0xf5f2('0x82')](_0x43c732)){_0x43c732[_0xf5f2('0x43')](function(_0x30ac41){if(_0x30ac41==='ChatWebsiteId'){_0x46a905[_0xf5f2('0x57')](_0xf5f2('0x83'),[][_0xf5f2('0x84')](_0x212e90[_0xf5f2('0x4c')][_0x30ac41]));}else if(_0x30ac41===_0xf5f2('0x85')){var _0x4f47e1=JSON['parse'](_0x212e90[_0xf5f2('0x4c')][_0x30ac41])[_0xf5f2('0x86')];var _0x17eb69=JSON[_0xf5f2('0x87')](_0x212e90['query'][_0x30ac41])['$lte'];_0x46a905[_0xf5f2('0x57')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f47e1,_0x17eb69);}else{if(_0x212e90['query'][_0x30ac41]==='null'){_0x46a905['where']('i.'+_0x30ac41+_0xf5f2('0x88'));}else{_0x46a905[_0xf5f2('0x57')]('i.'+_0x30ac41+_0xf5f2('0x89'),_0x212e90[_0xf5f2('0x4c')][_0x30ac41]);}}});}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8a')]){if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8a')]==0x1){_0x46a905[_0xf5f2('0x70')](_0xf5f2('0x8b'));}else{_0x46a905[_0xf5f2('0x70')](_0xf5f2('0x8c'));}}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')]){_0x397b99=_[_0xf5f2('0x8e')](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')])?_0x212e90[_0xf5f2('0x4c')]['tag']:new Array(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')]);_0x397b99[_0xf5f2('0x43')](function(_0x2811ad){_0xcf7a50['or'](_0xf5f2('0x8f'),'%,'+_0x2811ad+',%');});}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x90')]){var _0xcf48eb=_0x212e90['query'][_0xf5f2('0x90')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0xcf48eb)){_0x2a8f6d['or']('i.id\x20LIKE\x20?',_0xcf48eb+'%');}else{_0x2a8f6d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xcf48eb))['or'](_0xf5f2('0x91'),_0xcf48eb+'%');}}}_0x46a905[_0xf5f2('0x57')](_0x2a8f6d);_0x46a905[_0xf5f2('0x92')](_0xf5f2('0x93'));var _0x145d4d={'type':db[_0xf5f2('0x94')]['QueryTypes']['SELECT'],'raw':!![]};var _0x2fb1a6=_0x46a905['clone']();_0x2fb1a6[_0xf5f2('0x59')](_0xf5f2('0x93'));_0x2fb1a6['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf5f2('0x6f'));if(_0x106062[_0xf5f2('0x55')]){_0x106062['order'][_0xf5f2('0x43')](function(_0x388b32){var _0x49e363=_0x388b32[0x0]===_0xf5f2('0x95')?_0x388b32[0x0]:'i.'+_0x388b32[0x0];_0x46a905[_0xf5f2('0x55')](_0x49e363,_0x388b32[0x1]===_0xf5f2('0x96')?![]:!![]);});}if(!_['isEmpty'](_0x397b99)){_0x46a905[_0xf5f2('0x70')](_0xcf7a50);_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x97'),_0x397b99);}BPromise[_0xf5f2('0x98')]()[_0xf5f2('0x22')](function(){if(!_0x4579f4){if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x99')])return;_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x9a'));_0x46a905[_0xf5f2('0x57')](_0xf5f2('0x9a'));return;}if(_0x212e90[_0xf5f2('0x9b')][_0xf5f2('0x9c')]!==_0xf5f2('0x9d'))return;return _0x212e90[_0xf5f2('0x9b')][_0xf5f2('0x9e')]({'attributes':['id'],'raw':!![]})[_0xf5f2('0x22')](function(_0x29a9d4){if(_[_0xf5f2('0x82')](_0x29a9d4)){_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x9f'));_0x46a905['where'](_0xf5f2('0x9f'));}else{_0x2fb1a6[_0xf5f2('0x57')]('i.ChatWebsiteId\x20IN\x20?',_[_0xf5f2('0x3e')](_0x29a9d4,'id'));_0x46a905[_0xf5f2('0x57')]('i.ChatWebsiteId\x20IN\x20?',_[_0xf5f2('0x3e')](_0x29a9d4,'id'));}});})[_0xf5f2('0x22')](function(){if(_0x212e90[_0xf5f2('0x9b')]['role']==='agent'&&!_0x4579f4&&!_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x99')])return[];return db[_0xf5f2('0xa0')]['query'](_0x2fb1a6['toString'](),_0x145d4d);})[_0xf5f2('0x22')](function(_0xcdc6fd){_0x4773cd[_0xf5f2('0x31')]=_0xcdc6fd['length'];if(_0x4773cd['count']===0x0)return[];return db['sequelize']['query'](_0x57782c['toString'](),_0x145d4d)[_0xf5f2('0x22')](function(_0x561bab){_0x3dc0c4=_[_0xf5f2('0xa1')](_0x561bab,'id');_0x145d4d=_[_0xf5f2('0x39')](_0x145d4d,{'model':db[_0xf5f2('0xa2')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x50')]){_0x106062[_0xf5f2('0x4f')][_0xf5f2('0x43')](function(_0x40e921){_0x46a905[_0xf5f2('0x59')]('i.'+_0x40e921);});}else{_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xa3'),_0xf5f2('0x6f'));_0x46a905[_0xf5f2('0x59')]('a.key',_0xf5f2('0xa4'));_0x46a905[_0xf5f2('0x59')]('a.mandatoryDisposition',_0xf5f2('0xa5'));_0x46a905[_0xf5f2('0x59')]('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',_0xf5f2('0x95'));_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xa6'));_0x46a905['field'](_0xf5f2('0xa7'),_0xf5f2('0xa8'));_0x46a905['field'](_0xf5f2('0xa9'),_0xf5f2('0xaa'));_0x46a905[_0xf5f2('0x59')]('c.email',_0xf5f2('0xab'));_0x46a905['field'](_0xf5f2('0xac'),'Contact.phone');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xad'),_0xf5f2('0xae'));_0x46a905[_0xf5f2('0x59')]('c.fax',_0xf5f2('0xaf'));_0x46a905['field']('o.fullname','Owner.fullname');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xb0'),'Owner.internal');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xb1'),_0xf5f2('0x40'));}if(_0x106062[_0xf5f2('0x2f')])_0x46a905[_0xf5f2('0x2f')](_0x106062[_0xf5f2('0x2f')]);if(_0x106062['offset'])_0x46a905[_0xf5f2('0x54')](_0x106062[_0xf5f2('0x54')]);return db['sequelize'][_0xf5f2('0x4c')](_0x46a905[_0xf5f2('0xb2')](),_0x145d4d);})['then'](function(_0x32301a){if(_0x32301a[_0xf5f2('0x51')]>0x0)_0x4b62fc[_0xf5f2('0x57')](_0xf5f2('0xb3'),_[_0xf5f2('0x3e')](_0x32301a,'id'));return db[_0xf5f2('0xa0')]['query'](_0x4b62fc[_0xf5f2('0xb2')](),_0x145d4d)[_0xf5f2('0x22')](function(_0x13fcb0){var _0x792c75=_[_0xf5f2('0xb4')](_0x13fcb0,_0xf5f2('0xb5'));var _0x162c13=[];_0x32301a[_0xf5f2('0x43')](function(_0x3e4e40){_0x162c13['push'](updateChatInteraction(_0x3e4e40,_0x3dc0c4,_0x792c75));});return BPromise[_0xf5f2('0xb6')](_0x162c13);});});})[_0xf5f2('0x22')](function(_0xdbb2cd){_0x4773cd[_0xf5f2('0xb7')]=_0xdbb2cd;return _0x4773cd;})[_0xf5f2('0x22')](respondWithFilteredResult(_0x40c322,_0x106062))[_0xf5f2('0x2c')](handleError(_0x40c322,null));};exports[_0xf5f2('0xb8')]=function(_0x56f4b4,_0x33cfe7){var _0x40d0eb={'raw':![],'where':{'id':_0x56f4b4['params']['id']}},_0x4c138c={};_0x4c138c[_0xf5f2('0x4a')]=_[_0xf5f2('0x4b')](db[_0xf5f2('0xa2')][_0xf5f2('0x46')]);_0x4c138c['query']=_[_0xf5f2('0x4b')](_0x56f4b4[_0xf5f2('0x4c')]);_0x4c138c[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x4c138c[_0xf5f2('0x4a')],_0x4c138c['query']);_0x40d0eb[_0xf5f2('0x4f')]=_[_0xf5f2('0x4e')](_0x4c138c['model'],qs[_0xf5f2('0x50')](_0x56f4b4[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x40d0eb[_0xf5f2('0x4f')]=_0x40d0eb['attributes'][_0xf5f2('0x51')]?_0x40d0eb[_0xf5f2('0x4f')]:_0x4c138c[_0xf5f2('0x4a')];if(_0x56f4b4['query']['includeAll']){_0x40d0eb[_0xf5f2('0xb9')]=[{'all':!![]}];}_0x40d0eb=_[_0xf5f2('0x39')]({},_0x40d0eb,_0x56f4b4[_0xf5f2('0xba')]);return db[_0xf5f2('0xa2')][_0xf5f2('0x78')](_0x40d0eb)[_0xf5f2('0x22')](handleEntityNotFound(_0x33cfe7,null))['then'](respondWithResult(_0x33cfe7,null))[_0xf5f2('0x2c')](handleError(_0x33cfe7,null));};exports['create']=function(_0x151f13,_0x1624a4){return db[_0xf5f2('0xa2')][_0xf5f2('0xbb')](_0x151f13[_0xf5f2('0x3a')],{})[_0xf5f2('0x22')](respondWithResult(_0x1624a4,0xc9))['catch'](handleError(_0x1624a4,null));};exports[_0xf5f2('0x37')]=function(_0x409ed1,_0x457b53){if(_0x409ed1[_0xf5f2('0x3a')]['id']){delete _0x409ed1[_0xf5f2('0x3a')]['id'];}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x409ed1['params']['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x457b53,null))['then'](saveUpdates(_0x409ed1['body'],null))['then'](respondWithResult(_0x457b53,null))[_0xf5f2('0x2c')](handleError(_0x457b53,null));};exports[_0xf5f2('0xbc')]=function(_0x568806,_0x3487df){return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x568806[_0xf5f2('0xbd')]['id']}})['then'](handleEntityNotFound(_0x3487df,null))[_0xf5f2('0x22')](removeEntity(_0x3487df,null))[_0xf5f2('0x2c')](handleError(_0x3487df,null));};exports[_0xf5f2('0xbe')]=function(_0x5d3ca7,_0x29f7bd){return db[_0xf5f2('0xa2')]['describe']()[_0xf5f2('0x22')](respondWithResult(_0x29f7bd,null))[_0xf5f2('0x2c')](handleError(_0x29f7bd,null));};exports[_0xf5f2('0xbf')]=function(_0x1583bb,_0x176974){var _0x8b591c=_0x1583bb[_0xf5f2('0xbd')]['id'];var _0x2c242b;var _0x155007;var _0x4782da;return db[_0xf5f2('0xa2')]['findOne']({'where':{'id':_0x8b591c}})[_0xf5f2('0x22')](function(_0x31dbfa){_0x2c242b=_0x31dbfa;return db['ChatWebsite'][_0xf5f2('0xc0')]({'where':{'id':_0x31dbfa['ChatWebsiteId']},'attributes':['id',_0xf5f2('0xc1'),_0xf5f2('0xc2'),_0xf5f2('0xc3'),_0xf5f2('0xc4'),'vidaooMetadata'],'raw':!![]});})[_0xf5f2('0x22')](function(_0x5a104b){if(_0x5a104b&&_0x5a104b[_0xf5f2('0xc1')]&&_0x5a104b['vidaooEscalation']){_0x155007=_0x5a104b;var _0x3310cb={'interaction':{'id':_0x8b591c},'agent':{'id':_0x1583bb[_0xf5f2('0x9b')]['id'],'name':_0x1583bb['user'][_0xf5f2('0x38')],'fullname':_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0x3f')],'email':_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0xc5')]},'contact':_0x1583bb[_0xf5f2('0x3a')]['contact'],'account':_0x1583bb['body'][_0xf5f2('0x3c')]};var _0x17e1eb={'rejectUnauthorized':![],'method':'POST','url':_0xf5f2('0xc6'),'headers':{'X-APIKEY':_0x5a104b[_0xf5f2('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0xc5')]],'buttons':null,'topic':_0x155007[_0xf5f2('0xc3')],'note':_[_0xf5f2('0xc7')](_0x155007[_0xf5f2('0xc4')])?null:getMustacheRender(_0x155007['vidaooNote'],_0x3310cb),'metadata':null},'redirect':_0xf5f2('0xc8'),'json':!![]};try{if(!_['isNull'](_0x155007[_0xf5f2('0xc9')])){var _0x5ec0f3=getMustacheRender(_0x155007[_0xf5f2('0xc9')],_0x3310cb);var _0x4f2531=JSON[_0xf5f2('0x87')](_0x5ec0f3);_0x17e1eb['body']['metadata']=_0x4f2531;}}catch(_0x2c285c){throw new db[(_0xf5f2('0x94'))]['ValidationError'](_0xf5f2('0xca'));}return rp(_0x17e1eb);}else{throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xcc'));}})[_0xf5f2('0x22')](function(_0x25af1e){_0x4782da=_0x25af1e;if(_0x4782da['id']){var _0xd0b5d={'body':_0x4782da[_0xf5f2('0xcd')],'ChatWebsiteId':_0x155007['id'],'ChatInteractionId':_0x2c242b['id'],'direction':'out','UserId':_0x1583bb['user']['id']};return db[_0xf5f2('0xce')]['create'](_0xd0b5d,{});}else{throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xcf'));}})[_0xf5f2('0x22')](function(){return _0x2c242b[_0xf5f2('0xd0')]({'vidaooSessionId':_0x4782da['id']});})[_0xf5f2('0x22')](respondWithResult(_0x176974,null))[_0xf5f2('0x2c')](handleError(_0x176974,null));};exports[_0xf5f2('0xd1')]=function(_0x28f65b,_0x16cbd3){if(_0x28f65b[_0xf5f2('0x3a')]['id']){delete _0x28f65b[_0xf5f2('0x3a')]['id'];}return db['ChatInteraction'][_0xf5f2('0x78')]({'where':{'id':_0x28f65b['params']['id']},'include':[{'model':db[_0xf5f2('0xd2')],'as':_0xf5f2('0x73')}]})[_0xf5f2('0x22')](handleEntityNotFound(_0x16cbd3,null))[_0xf5f2('0x22')](saveUpdates(_0x28f65b[_0xf5f2('0x3a')],null))[_0xf5f2('0x22')](respondWithResult(_0x16cbd3,null))[_0xf5f2('0x2c')](handleError(_0x16cbd3,null));};exports[_0xf5f2('0xd3')]=function(_0x29db4f,_0x377c68,_0xe0f288){if(_0x29db4f['body']['id']){delete _0x29db4f[_0xf5f2('0x3a')]['id'];}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x29db4f[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](function(_0x3f8794){if(!_0x3f8794){logger[_0xf5f2('0x29')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xf5f2('0xd3'),0x194,_0xf5f2('0xd4'));_0x377c68[_0xf5f2('0xd5')](0x194);}else{if(_0x3f8794[_0xf5f2('0x80')]){throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xd6'));}}return _0x3f8794;})[_0xf5f2('0x22')](function(_0x356155){if(_0x356155){return _0x356155[_0xf5f2('0x37')]({'closed':_0x29db4f[_0xf5f2('0x3a')][_0xf5f2('0xd7')],'disposition':_0x29db4f[_0xf5f2('0x3a')][_0xf5f2('0xd8')]})[_0xf5f2('0x22')](function(_0x654b1b){return _0x654b1b;});}})['then'](function(_0x25566a){return respondWithRpcPromise(_0xf5f2('0xd9'),'abandon',_0x29db4f['body'],client9004);})[_0xf5f2('0x22')](respondWithResult(_0x377c68,null))[_0xf5f2('0x2c')](handleError(_0x377c68,null));};exports[_0xf5f2('0xda')]=function(_0x2c8f4c,_0x529d6f,_0x28cc){_0x2c8f4c[_0xf5f2('0x3a')][_0xf5f2('0x38')]=_0x2c8f4c[_0xf5f2('0xdb')][_0xf5f2('0xdc')];_0x2c8f4c[_0xf5f2('0x3a')]['basename']=_0x2c8f4c[_0xf5f2('0xdb')]['filename'];_0x2c8f4c['body'][_0xf5f2('0x48')]=_0x2c8f4c[_0xf5f2('0xdb')][_0xf5f2('0xdd')];return db[_0xf5f2('0xde')][_0xf5f2('0xbb')](_0x2c8f4c[_0xf5f2('0x3a')])[_0xf5f2('0x22')](respondWithResult(_0x529d6f,0xc9))['catch'](handleError(_0x529d6f,null));};exports[_0xf5f2('0xdf')]=function(_0x3a2862,_0x2c1160,_0x5e6c83){return db[_0xf5f2('0xa2')]['findOne']({'where':{'id':_0x3a2862['params']['id']},'raw':!![]})[_0xf5f2('0x22')](handleEntityNotFound(_0x2c1160,null))['then'](function(_0x2389b7){if(_0x2389b7){if(_0x2389b7[_0xf5f2('0xd7')]){return _0x2c1160['status'](0x193)[_0xf5f2('0x34')]({'status':0x193,'message':_0xf5f2('0xe0')});}return db['Attachment'][_0xf5f2('0xc0')]({'where':{'id':_0x3a2862[_0xf5f2('0x4c')][_0xf5f2('0xe1')]},'raw':!![]})[_0xf5f2('0x22')](handleEntityNotFound(_0x2c1160,null));}})[_0xf5f2('0x22')](function(_0x47a28a){if(_0x47a28a){var _0x182fa7=_0x47a28a[_0xf5f2('0xe2')]!==null;var _0x4d9048=path['join'](config[_0xf5f2('0xe3')],_0xf5f2('0xe4'));if(_0x182fa7){_0x4d9048=path[_0xf5f2('0xe5')](_0x4d9048,_0xf5f2('0xe6'));}var _0x1f51d8=path[_0xf5f2('0xe5')](_0x4d9048,_0x47a28a[_0xf5f2('0xe7')]);return _0x2c1160[_0xf5f2('0xe8')](_0x1f51d8);}})['catch'](handleError(_0x2c1160,null));};exports['close']=function(_0xc86ed5,_0x5be398){var _0x34abb6=null;var _0x235c30=null;var _0x15b060=null;var _0x422e88=null;if(_0xc86ed5['body']['id']){delete _0xc86ed5[_0xf5f2('0x3a')]['id'];}if(_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xe9')]){_0x422e88=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],'server/files/chat/upload/',util[_0xf5f2('0xea')](_0xf5f2('0xeb'),Date[_0xf5f2('0xec')]()));_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xed')]=_0x422e88;}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0xc86ed5[_0xf5f2('0xbd')]['id']},'include':[{'model':db[_0xf5f2('0xce')],'as':_0xf5f2('0xee'),'include':[{'model':db[_0xf5f2('0x7f')],'as':_0xf5f2('0x7f')}]}]})['then'](handleEntityNotFound(_0x5be398,null))[_0xf5f2('0x22')](saveUpdates(_0xc86ed5['body'],null))[_0xf5f2('0x22')](function(_0x349efe){if(_0x349efe){_0x34abb6=_0x349efe;return db[_0xf5f2('0xef')][_0xf5f2('0x78')]({'where':{'id':_0x34abb6[_0xf5f2('0x99')]}});}})[_0xf5f2('0x22')](function(_0x2cd0b7){if(_0x2cd0b7){_0x15b060=_0x2cd0b7;return db[_0xf5f2('0xd2')][_0xf5f2('0x78')]({'where':{'id':_0x34abb6[_0xf5f2('0x79')]}});}})[_0xf5f2('0x22')](function(_0x2b6f46){if(_0x2b6f46){_0x235c30=_0x2b6f46;if(_0x422e88){var _0xf53f16=null;for(var _0xd45a63=0x1;_0xd45a63<_0x34abb6[_0xf5f2('0xee')][_0xf5f2('0x51')];++_0xd45a63){_0xf53f16=_0x34abb6[_0xf5f2('0xee')][_0xd45a63];var _0x33f987=_0xf53f16['UserId']?util[_0xf5f2('0xea')]('%s%d',_0x15b060['agentAlias'],_0xf53f16[_0xf5f2('0x80')]):_0xf5f2('0xf0');var _0x53e85c=_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xf1')]||util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0xf5f2('0xf3'),_0xf53f16[_0xf5f2('0x79')]);switch(_0x15b060[_0xf5f2('0xf4')]){case _0xf5f2('0xf5'):_0x33f987=_0xf53f16['UserId']?util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0x15b060[_0xf5f2('0xf6')],_0xf53f16['UserId']):_0xf5f2('0xf0');break;case _0xf5f2('0xf7'):_0x33f987=_0xf53f16[_0xf5f2('0x80')]?_0xf53f16[_0xf5f2('0x7f')]['alias']||_0xf53f16['User'][_0xf5f2('0x3f')]:_0xf5f2('0xf0');break;case _0xf5f2('0xf8'):_0x33f987=_0xf53f16[_0xf5f2('0x80')]?_0xf53f16[_0xf5f2('0x7f')][_0xf5f2('0x3f')]:_0xf5f2('0xf0');break;default:_0x33f987=_0xf53f16[_0xf5f2('0x80')]?util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0x15b060['agentAlias'],_0xf53f16[_0xf5f2('0x80')]):_0xf5f2('0xf0');}var _0x3881cd=util['format'](_0xf5f2('0xf9'),moment(_0xf53f16[_0xf5f2('0x85')])['format'](_0xf5f2('0xfa')),_0xf53f16['direction']==='in'?_0x53e85c:_0x33f987,_0xf53f16[_0xf5f2('0x3a')]);if(!_0xf53f16[_0xf5f2('0xfb')]){fs['appendFileSync'](_0x422e88,_0x3881cd);}}return db[_0xf5f2('0xfc')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf5f2('0xfd')],'as':_0xf5f2('0xfe'),'raw':!![]}]});}}})['then'](function(_0x3971ee){if(_0x3971ee&&_0x3971ee[_0xf5f2('0xfe')]&&_0xc86ed5[_0xf5f2('0x3a')]){var _0xfeccdd={'tls':{'rejectUnauthorized':![]}};if(_0x3971ee[_0xf5f2('0xfe')]['service']){_0xfeccdd[_0xf5f2('0xff')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0xff')];}else{_0xfeccdd[_0xf5f2('0x100')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x100')];_0xfeccdd[_0xf5f2('0x101')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x101')];_0xfeccdd['secure']=_0x3971ee[_0xf5f2('0xfe')]['secure'];}if(_0x3971ee['Smtp'][_0xf5f2('0x102')]){_0xfeccdd[_0xf5f2('0x103')]={'user':_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x9b')],'pass':_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x104')]};}return respondWithRpcPromise(_0xf5f2('0x105'),_0xf5f2('0x106'),{'account':_0xfeccdd,'message':{'from':util[_0xf5f2('0xea')](_0xf5f2('0x107'),_0x3971ee['name'],_0x3971ee['email']||_0x3971ee['Smtp'][_0xf5f2('0x9b')]),'to':_0xc86ed5['body'][_0xf5f2('0xe9')],'subject':_0xf5f2('0x108'),'text':util[_0xf5f2('0xea')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xe9')]),'attachments':[{'path':_0x422e88}]}})['then'](function(){return _0x34abb6;})['catch'](function(_0x4d0709){console[_0xf5f2('0x29')](_0x4d0709);});}else{return _0x34abb6;}})[_0xf5f2('0x22')](respondWithStatusCode(_0x5be398,0xc8))[_0xf5f2('0x2c')](handleError(_0x5be398,null));};exports['addMessage']=function(_0x2cfa84,_0x4a22fb,_0x7cf1b6){return db[_0xf5f2('0xce')][_0xf5f2('0x78')]({'where':{'id':_0x2cfa84['params']['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x4a22fb,null))['then'](function(_0x1b88b5){if(_0x1b88b5){return _0x1b88b5[_0xf5f2('0x109')](_0x2cfa84[_0xf5f2('0x3a')]['ids'],_[_0xf5f2('0x10a')](_0x2cfa84[_0xf5f2('0x3a')],['ids','id'])||{});}})[_0xf5f2('0x22')](respondWithResult(_0x4a22fb,null))[_0xf5f2('0x2c')](handleError(_0x4a22fb,null));};exports[_0xf5f2('0x10b')]=function(_0x29526c,_0x2a52e3,_0x439c9f){var _0x44adaa={'raw':![],'where':{}};var _0x3c7058={};var _0x3bcb44={'count':0x0,'rows':[]};return db[_0xf5f2('0xa2')][_0xf5f2('0xc0')]({'where':{'id':_0x29526c[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x2a52e3,null))[_0xf5f2('0x22')](function(_0x23675a){if(_0x23675a){_0x3c7058[_0xf5f2('0x4a')]=_[_0xf5f2('0x4b')](db[_0xf5f2('0xce')][_0xf5f2('0x46')]);_0x3c7058[_0xf5f2('0x4c')]=_[_0xf5f2('0x4b')](_0x29526c[_0xf5f2('0x4c')]);_0x3c7058['filters']=_[_0xf5f2('0x4e')](_0x3c7058[_0xf5f2('0x4a')],_0x3c7058[_0xf5f2('0x4c')]);_0x44adaa[_0xf5f2('0x4f')]=_['intersection'](_0x3c7058[_0xf5f2('0x4a')],qs['fields'](_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x44adaa[_0xf5f2('0x4f')]=_0x44adaa[_0xf5f2('0x4f')][_0xf5f2('0x51')]?_0x44adaa[_0xf5f2('0x4f')]:_0x3c7058[_0xf5f2('0x4a')];if(!_0x29526c['query']['hasOwnProperty'](_0xf5f2('0x53'))){_0x44adaa[_0xf5f2('0x2f')]=qs[_0xf5f2('0x2f')](_0x29526c[_0xf5f2('0x4c')]['limit']);_0x44adaa[_0xf5f2('0x54')]=qs[_0xf5f2('0x54')](_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x54')]);}_0x44adaa[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x29526c['query']['sort']);_0x44adaa['where']=qs[_0xf5f2('0x4d')](_[_0xf5f2('0x10c')](_0x29526c[_0xf5f2('0x4c')],_0x3c7058['filters']));_0x44adaa[_0xf5f2('0x57')]['ChatInteractionId']=_0x23675a['id'];if(_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x90')]){_0x44adaa[_0xf5f2('0x57')]=_[_0xf5f2('0x39')](_0x44adaa[_0xf5f2('0x57')],{'$or':_[_0xf5f2('0x3e')](_0x44adaa[_0xf5f2('0x4f')],function(_0xece862){var _0x3b4121={};_0x3b4121[_0xece862]={'$like':'%'+_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x90')]+'%'};return _0x3b4121;})});}if(_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x86')]){var _0x2fa70d=_0x29526c['query'][_0xf5f2('0x86')][_0xf5f2('0x42')](',');var _0x31f018={};_0x31f018[_0x2fa70d[0x0]]={'$gte':moment(_0x2fa70d[0x1])[_0xf5f2('0xea')]('YYYY-MM-DD\x20HH:mm:ss')};_0x44adaa[_0xf5f2('0x57')]=_[_0xf5f2('0x39')](_0x44adaa[_0xf5f2('0x57')],_0x31f018);}_0x44adaa=_[_0xf5f2('0x39')]({},_0x44adaa,_0x29526c['options']);return db[_0xf5f2('0xce')]['count']({'where':_0x44adaa[_0xf5f2('0x57')]})[_0xf5f2('0x22')](function(_0x20bb46){_0x3bcb44[_0xf5f2('0x31')]=_0x20bb46;if(_0x29526c['query'][_0xf5f2('0x10d')]){_0x44adaa[_0xf5f2('0xb9')]=[{'all':!![]}];}return db[_0xf5f2('0xce')][_0xf5f2('0x10e')](_0x44adaa);})[_0xf5f2('0x22')](function(_0x889f0e){_0x3bcb44['rows']=_0x889f0e;return _0x3bcb44;});}})[_0xf5f2('0x22')](respondWithFilteredResult(_0x2a52e3,_0x44adaa))[_0xf5f2('0x2c')](handleError(_0x2a52e3,null));};exports[_0xf5f2('0x10f')]=function(_0x3dcf4e,_0x4212d4,_0x2ebe4f){var _0x34fc35={'where':{}},_0x29c1ca={},_0x2cf93e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf5f2('0xc0')]({'where':{'id':_0x3dcf4e[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x4212d4,null))[_0xf5f2('0x22')](function(_0x544db3){if(_0x544db3){_0x29c1ca['model']=_[_0xf5f2('0x4b')](db[_0xf5f2('0xce')][_0xf5f2('0x46')]);_0x29c1ca['query']=_['keys'](_0x3dcf4e[_0xf5f2('0x4c')]);_0x29c1ca[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x29c1ca[_0xf5f2('0x4a')],_0x29c1ca[_0xf5f2('0x4c')]);_0x34fc35[_0xf5f2('0x4f')]=_['intersection'](_0x29c1ca[_0xf5f2('0x4a')],qs[_0xf5f2('0x50')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x34fc35['attributes']=_0x34fc35['attributes'][_0xf5f2('0x51')]?_0x34fc35['attributes']:_0x29c1ca[_0xf5f2('0x4a')];if(!_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x52')](_0xf5f2('0x53'))){_0x34fc35[_0xf5f2('0x2f')]=qs[_0xf5f2('0x2f')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x2f')]);_0x34fc35[_0xf5f2('0x54')]=qs[_0xf5f2('0x54')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x54')]);}_0x34fc35[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x3dcf4e['query'][_0xf5f2('0x56')]);_0x34fc35[_0xf5f2('0x57')]=qs[_0xf5f2('0x4d')](_[_0xf5f2('0x10c')](_0x3dcf4e[_0xf5f2('0x4c')],_0x29c1ca['filters']));_0x34fc35[_0xf5f2('0x57')][_0xf5f2('0xb5')]=_0x544db3['id'];if(_0x3dcf4e['query'][_0xf5f2('0x90')]){_0x34fc35[_0xf5f2('0x57')]=_['merge'](_0x34fc35['where'],{'$or':_[_0xf5f2('0x3e')](_0x34fc35[_0xf5f2('0x4f')],function(_0x3e7f54){var _0x5e165c={};_0x5e165c[_0x3e7f54]={'$like':'%'+_0x3dcf4e['query'][_0xf5f2('0x90')]+'%'};return _0x5e165c;})});}_0x34fc35[_0xf5f2('0x57')][_0xf5f2('0xfb')]=![];if(_0x3dcf4e[_0xf5f2('0x4c')]['id']){_0x34fc35[_0xf5f2('0x57')]['id']={'$gt':_0x3dcf4e[_0xf5f2('0x4c')]['id']};}_0x34fc35=_[_0xf5f2('0x39')]({},_0x34fc35,_0x3dcf4e[_0xf5f2('0xba')]);return db[_0xf5f2('0xce')][_0xf5f2('0x31')]({'where':_0x34fc35['where']})[_0xf5f2('0x22')](function(_0x1c2842){_0x2cf93e['count']=_0x1c2842;_0x34fc35[_0xf5f2('0xb9')]=[];if(_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x110')]){_0x34fc35[_0xf5f2('0xb9')][_0xf5f2('0x44')]({'model':db['User'],'as':'User','attributes':['id',_0xf5f2('0x3f'),_0xf5f2('0x111')]});}if(_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x10d')]){_0x34fc35['include']=[{'all':!![]}];}return db[_0xf5f2('0xce')][_0xf5f2('0x10e')](_0x34fc35);})[_0xf5f2('0x22')](function(_0x3518f9){_0x2cf93e['rows']=_0x3518f9;return _0x2cf93e;});}})['then'](respondWithFilteredResult(_0x4212d4,_0x34fc35))['catch'](handleError(_0x4212d4,null));};exports['addTags']=function(_0x2e9d3b,_0x496802,_0x5be074){return db['ChatInteraction']['find']({'where':{'id':_0x2e9d3b[_0xf5f2('0xbd')]['id']}})['then'](handleEntityNotFound(_0x496802,null))['then'](function(_0x43150f){if(_0x43150f){return _0x43150f[_0xf5f2('0x112')](_0x2e9d3b[_0xf5f2('0x3a')][_0xf5f2('0x113')],_['omit'](_0x2e9d3b[_0xf5f2('0x3a')],[_0xf5f2('0x113'),'id'])||{})[_0xf5f2('0x114')](function(){return db[_0xf5f2('0x7d')][_0xf5f2('0x10e')]({'attributes':['id',_0xf5f2('0x38'),_0xf5f2('0x115')],'where':{'id':_0x2e9d3b['body'][_0xf5f2('0x113')]}});})[_0xf5f2('0x22')](function(_0x4f4af9){socket[_0xf5f2('0x116')](_0xf5f2('0x117'),{'id':Number(_0x2e9d3b[_0xf5f2('0xbd')]['id']),'tags':_0x4f4af9||[]});return{'id':Number(_0x2e9d3b[_0xf5f2('0xbd')]['id']),'tags':_0x4f4af9||[]};});}})[_0xf5f2('0x22')](respondWithResult(_0x496802,null))['catch'](handleError(_0x496802,null));};exports[_0xf5f2('0x118')]=function(_0x5f470f,_0x1f0a64,_0x2bbc23){return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x5f470f['params']['id']}})['then'](handleEntityNotFound(_0x1f0a64,null))[_0xf5f2('0x22')](function(_0x179901){if(_0x179901){return _0x179901[_0xf5f2('0x118')](_0x5f470f[_0xf5f2('0x4c')][_0xf5f2('0x113')]);}})[_0xf5f2('0x22')](respondWithStatusCode(_0x1f0a64,null))[_0xf5f2('0x2c')](handleError(_0x1f0a64,null));};exports[_0xf5f2('0xe8')]=function(_0x5d8c6a,_0x4f777b){var _0x26dc8c=moment()[_0xf5f2('0x119')]()['toString']();var _0xb8bcf3=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],_0xf5f2('0x11a'),_0xf5f2('0x11b'),_0xf5f2('0x11c'));var _0x2bc493=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],_0xf5f2('0x11a'),_0xf5f2('0x11b'),_0xf5f2('0x11d'));var _0x212d97=path[_0xf5f2('0xe5')](_0xb8bcf3,_0x26dc8c);var _0x8ee5fd=util[_0xf5f2('0xea')](_0xf5f2('0x11e'),_0x5d8c6a['params']['id'],_0x26dc8c);var _0x3712e3=path['join'](_0xb8bcf3,_0x8ee5fd);var _0x56a1c3=[];_0x56a1c3['push']({'model':db['User'],'as':_0xf5f2('0x7f'),'attributes':['id',_0xf5f2('0x3f')],'raw':!![]});_0x56a1c3[_0xf5f2('0x44')]({'model':db[_0xf5f2('0xd2')],'as':'Contact','attributes':['id',_0xf5f2('0x11f'),_0xf5f2('0x120')],'raw':!![]});if(_0x5d8c6a['query']['attachments']){_0x56a1c3['push']({'model':db[_0xf5f2('0xde')],'as':_0xf5f2('0xde'),'raw':!![]});}var _0x5a6da7=[{'model':db[_0xf5f2('0xce')],'as':_0xf5f2('0xee'),'attributes':['id',_0xf5f2('0x3a'),'createdAt',_0xf5f2('0x121'),_0xf5f2('0xfb'),_0xf5f2('0x8a')],'include':_0x56a1c3}];_0x5a6da7[_0xf5f2('0x44')]({'model':db[_0xf5f2('0xef')],'as':_0xf5f2('0x122'),'attributes':['id','name']});_0x5a6da7['push']({'model':db[_0xf5f2('0x7f')],'as':_0xf5f2('0x123'),'attributes':['id','fullname']});return db['ChatInteraction'][_0xf5f2('0x78')]({'where':{'id':_0x5d8c6a['params']['id']},'include':_0x5a6da7})[_0xf5f2('0x22')](handleEntityNotFound(_0x4f777b,null))[_0xf5f2('0x22')](function(_0x2ee55f){if(_0x2ee55f){var _0x43ca34=_0x2ee55f[_0xf5f2('0x124')]({'plain':!![]});fs[_0xf5f2('0x125')](_0x212d97);var _0x220300={'channel':_0xf5f2('0x126'),'account':_0x43ca34[_0xf5f2('0x122')][_0xf5f2('0x38')],'agent':_0x43ca34['Owner']?_0x43ca34[_0xf5f2('0x123')][_0xf5f2('0x3f')]:_0xf5f2('0x127'),'createdAt':moment(_0x43ca34[_0xf5f2('0x85')])['format'](_0xf5f2('0x128'))[_0xf5f2('0xb2')](),'closedAt':_0x43ca34['closed']?moment(_0x43ca34[_0xf5f2('0x129')])['format'](_0xf5f2('0x128'))[_0xf5f2('0xb2')]():'','disposition':_0x43ca34['disposition'],'chatInfo':{'browser':_0x43ca34[_0xf5f2('0x12a')],'os':_0x43ca34[_0xf5f2('0x12b')],'referer':_0x43ca34[_0xf5f2('0x12c')],'customerIp':_0x43ca34[_0xf5f2('0x12d')],'customerPort':_0x43ca34['customerPort']?_0x43ca34[_0xf5f2('0x12e')]:_0xf5f2('0x127')},'messages':_(_0x43ca34[_0xf5f2('0xee')])['tail']()[_0xf5f2('0x90')]({'secret':![]})[_0xf5f2('0x3e')](function(_0x5981bb){if(_0x5981bb[_0xf5f2('0xde')]){var _0x4586b5=path[_0xf5f2('0xe5')](_0x2bc493,_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')]);if(fs[_0xf5f2('0x12f')](_0x4586b5)){fs[_0xf5f2('0x130')](_0x4586b5)[_0xf5f2('0x131')](fs[_0xf5f2('0x132')](path['join'](_0x212d97,_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')])));}}return{'date':moment(_0x5981bb[_0xf5f2('0x85')])[_0xf5f2('0xea')](_0xf5f2('0x128'))[_0xf5f2('0xb2')](),'sender':_0x5981bb[_0xf5f2('0x121')]===_0xf5f2('0x133')?_0x5981bb[_0xf5f2('0x7f')]?_0x5981bb[_0xf5f2('0x7f')][_0xf5f2('0x3f')]:'System':_0x5981bb['Contact']['firstName']+(_0x5981bb[_0xf5f2('0x73')][_0xf5f2('0x120')]?'\x20'+_0x5981bb[_0xf5f2('0x73')]['lastName']:''),'body':_0x5981bb[_0xf5f2('0xde')]?_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')]:_0x5981bb['body'],'direction':_0x5981bb[_0xf5f2('0x121')]===_0xf5f2('0x133')?'A':'C','secret':_0x5981bb[_0xf5f2('0xfb')],'read':_0x5981bb[_0xf5f2('0x8a')],'attachment':_0x5981bb[_0xf5f2('0xde')]};})[_0xf5f2('0x76')]()};return ejs[_0xf5f2('0x134')](path[_0xf5f2('0xe5')](config['root'],_0xf5f2('0x11a'),_0xf5f2('0x135'),_0xf5f2('0x136')),{'interaction':_0x220300})[_0xf5f2('0x22')](function(_0x510f56){var _0x319b39=path[_0xf5f2('0xe5')](_0x212d97,_0xf5f2('0x137')+_0x43ca34['id']+'-'+_0x26dc8c+'.pdf');var _0x346a95={'path':_0x319b39,'channel':_0xf5f2('0x126'),'interactionId':_0x43ca34['id']};return pdf[_0xf5f2('0x138')](_0x510f56,_0x346a95);})[_0xf5f2('0x22')](function(){return new BPromise(function(_0x249e9b,_0x56ab93){zipdir(_0x212d97,{'saveTo':_0x3712e3},function(_0x21fce7,_0x38a5e3){if(_0x21fce7)return _0x56ab93(_0x21fce7);return _0x249e9b(_0x38a5e3);});})[_0xf5f2('0x22')](function(){return new BPromise(function(_0x4d8a71,_0x1ca92b){rimraf(_0x212d97,function(_0x486c5e){if(_0x486c5e)_0x1ca92b(_0x486c5e);return _0x4d8a71();});});})[_0xf5f2('0x22')](function(){return _0x4f777b[_0xf5f2('0xe8')](_0x3712e3,_0x8ee5fd,function(_0x5089c1){if(_0x5089c1){console[_0xf5f2('0x139')](_0xf5f2('0x13a'),_0x5089c1);}else{fs[_0xf5f2('0x13b')](_0x3712e3);}});});});}else{return _0x4f777b['sendStatus'](0xc8);}})[_0xf5f2('0x2c')](handleError(_0x4f777b,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index a33cd6c..09ce161 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 _0x015f=['hasOwnProperty','hook','ChatInteraction','../../mysqldb','ChatMessage','save','update','remove','getUsers','then','setDataValue','findAll','unreadMessages','length','emit','catch'];(function(_0x27a74c,_0x1db582){var _0x4efe5b=function(_0x72b283){while(--_0x72b283){_0x27a74c['push'](_0x27a74c['shift']());}};_0x4efe5b(++_0x1db582);}(_0x015f,0xe2));var _0xf015=function(_0x1bbad0,_0x34e914){_0x1bbad0=_0x1bbad0-0x0;var _0x463383=_0x015f[_0x1bbad0];return _0x463383;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0xf015('0x0')];var ChatMessage=require(_0xf015('0x1'))['db'][_0xf015('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf015('0x3'),'afterUpdate':_0xf015('0x4'),'afterDestroy':_0xf015('0x5')};function emitEvent(_0x55d774){return function(_0x181fa5,_0x41e603,_0x53c40c){_0x181fa5[_0xf015('0x6')]({'attributes':['id'],'raw':!![]})[_0xf015('0x7')](function(_0x4fc355){_0x181fa5[_0xf015('0x8')]('Users',_0x4fc355['map'](function(_0xc6556){return{'id':_0xc6556['id']};}));return ChatMessage[_0xf015('0x9')]({'where':{'ChatInteractionId':_0x181fa5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf015('0x7')](function(_0x577ca8){_0x181fa5['setDataValue'](_0xf015('0xa'),_0x577ca8[_0xf015('0xb')]);ChatInteractionEvents[_0xf015('0xc')](_0x55d774+':'+_0x181fa5['id'],_0x181fa5);ChatInteractionEvents[_0xf015('0xc')](_0x55d774,_0x181fa5);_0x53c40c(null);})[_0xf015('0xd')](_0x53c40c(null));};}for(var e in events){if(events[_0xf015('0xe')](e)){var event=events[e];ChatInteraction[_0xf015('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x1e66=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','update','then','map','findAll','setDataValue','emit','catch'];(function(_0x1842e4,_0x4b67d5){var _0x456a40=function(_0x5058d5){while(--_0x5058d5){_0x1842e4['push'](_0x1842e4['shift']());}};_0x456a40(++_0x4b67d5);}(_0x1e66,0xd5));var _0x61e6=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x1e66[_0x1e3c16];return _0x47a0c9;};'use strict';var EventEmitter=require(_0x61e6('0x0'));var ChatInteraction=require(_0x61e6('0x1'))['db'][_0x61e6('0x2')];var ChatMessage=require(_0x61e6('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x61e6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x61e6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x255f39){return function(_0x19ee02,_0x5b1a6d,_0x31618c){_0x19ee02['getUsers']({'attributes':['id'],'raw':!![]})[_0x61e6('0x5')](function(_0x21cefe){_0x19ee02['setDataValue']('Users',_0x21cefe[_0x61e6('0x6')](function(_0x3e73f6){return{'id':_0x3e73f6['id']};}));return ChatMessage[_0x61e6('0x7')]({'where':{'ChatInteractionId':_0x19ee02['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x12eca3){_0x19ee02[_0x61e6('0x8')]('unreadMessages',_0x12eca3['length']);ChatInteractionEvents[_0x61e6('0x9')](_0x255f39+':'+_0x19ee02['id'],_0x19ee02);ChatInteractionEvents[_0x61e6('0x9')](_0x255f39,_0x19ee02);_0x31618c(null);})[_0x61e6('0xa')](_0x31618c(null));};}for(var e in events){if(events[_0x61e6('0xb')](e)){var event=events[e];ChatInteraction[_0x61e6('0xc')](e,emitEvent(event));}}module[_0x61e6('0xd')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index e4abf74..b9425f1 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 _0xe6c8=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','changed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x31de52,_0x19b57f){var _0x4b3d88=function(_0x4fc7e2){while(--_0x4fc7e2){_0x31de52['push'](_0x31de52['shift']());}};_0x4b3d88(++_0x19b57f);}(_0xe6c8,0x192));var _0x8e6c=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xe6c8[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x8e6c('0x0'));var util=require(_0x8e6c('0x1'));var logger=require(_0x8e6c('0x2'))(_0x8e6c('0x3'));var moment=require(_0x8e6c('0x4'));var BPromise=require(_0x8e6c('0x5'));var rp=require(_0x8e6c('0x6'));var fs=require('fs');var path=require(_0x8e6c('0x7'));var rimraf=require(_0x8e6c('0x8'));var config=require(_0x8e6c('0x9'));var attributes=require(_0x8e6c('0xa'));module['exports']=function(_0x117007,_0x2e5856){return _0x117007[_0x8e6c('0xb')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x490bb2,_0x4110ce,_0x149174){if(_0x490bb2[_0x8e6c('0xc')]('closed')){_0x490bb2['closedAt']=moment()[_0x8e6c('0xd')](_0x8e6c('0xe'));}_0x149174(null,_0x490bb2);}},'charset':_0x8e6c('0xf'),'collate':_0x8e6c('0x10')});}; \ No newline at end of file +var _0x6afa=['./chatInteraction.attributes','define','ChatInteraction','changed','format','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xc93e24,_0x3fe75e){var _0x32a649=function(_0x4f7b12){while(--_0x4f7b12){_0xc93e24['push'](_0xc93e24['shift']());}};_0x32a649(++_0x3fe75e);}(_0x6afa,0x13a));var _0xa6af=function(_0x50bf72,_0x5ae1a6){_0x50bf72=_0x50bf72-0x0;var _0x2f2574=_0x6afa[_0x50bf72];return _0x2f2574;};'use strict';var _=require(_0xa6af('0x0'));var util=require(_0xa6af('0x1'));var logger=require(_0xa6af('0x2'))('api');var moment=require(_0xa6af('0x3'));var BPromise=require('bluebird');var rp=require(_0xa6af('0x4'));var fs=require('fs');var path=require(_0xa6af('0x5'));var rimraf=require(_0xa6af('0x6'));var config=require(_0xa6af('0x7'));var attributes=require(_0xa6af('0x8'));module['exports']=function(_0x1c992a,_0x40340e){return _0x1c992a[_0xa6af('0x9')](_0xa6af('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5233af,_0x26f720,_0x3666a1){if(_0x5233af[_0xa6af('0xb')]('closed')){_0x5233af['closedAt']=moment()[_0xa6af('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3666a1(null,_0x5233af);}},'charset':'utf8mb4','collate':_0xa6af('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 57e57d3..ca0707e 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 _0x1a71=['register','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','then','AddTagsToChatInteraction','find','addTags','body','ids','omit','spread','AddTags','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket'];(function(_0x5a6402,_0x4062a9){var _0x134b49=function(_0x416f0b){while(--_0x416f0b){_0x5a6402['push'](_0x5a6402['shift']());}};_0x134b49(++_0x4062a9);}(_0x1a71,0x157));var _0x11a7=function(_0x16b1b8,_0x432d03){_0x16b1b8=_0x16b1b8-0x0;var _0x558b1e=_0x1a71[_0x16b1b8];return _0x558b1e;};'use strict';var _=require(_0x11a7('0x0'));var util=require(_0x11a7('0x1'));var moment=require(_0x11a7('0x2'));var BPromise=require('bluebird');var rs=require(_0x11a7('0x3'));var fs=require('fs');var Redis=require(_0x11a7('0x4'));var db=require(_0x11a7('0x5'))['db'];var utils=require(_0x11a7('0x6'));var logger=require(_0x11a7('0x7'))(_0x11a7('0x8'));var config=require(_0x11a7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x11a7('0xa')][_0x11a7('0xb')]({'port':0x232a});config[_0x11a7('0xc')]=_[_0x11a7('0xd')](config['redis'],{'host':_0x11a7('0xe'),'port':0x18eb});var socket=require(_0x11a7('0xf'))(new Redis(config['redis']));require(_0x11a7('0x10'))[_0x11a7('0x11')](socket);function respondWithRpcPromise(_0x162563,_0x323998,_0x1262ae){return new BPromise(function(_0x3ad9a3,_0x26f578){return client[_0x11a7('0x12')](_0x162563,_0x1262ae)['then'](function(_0x5b9f6b){logger['info'](_0x11a7('0x13'),_0x323998,_0x11a7('0x14'));logger[_0x11a7('0x15')](_0x11a7('0x16'),_0x323998,'request\x20sent',JSON['stringify'](_0x5b9f6b));if(_0x5b9f6b[_0x11a7('0x17')]){if(_0x5b9f6b[_0x11a7('0x17')][_0x11a7('0x18')]===0x1f4){logger[_0x11a7('0x17')](_0x11a7('0x13'),_0x323998,_0x5b9f6b[_0x11a7('0x17')]['message']);return _0x26f578(_0x5b9f6b[_0x11a7('0x17')][_0x11a7('0x19')]);}logger[_0x11a7('0x17')](_0x11a7('0x13'),_0x323998,_0x5b9f6b['error'][_0x11a7('0x19')]);return _0x3ad9a3(_0x5b9f6b[_0x11a7('0x17')]['message']);}else{logger[_0x11a7('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x323998,_0x11a7('0x14'));_0x3ad9a3(_0x5b9f6b[_0x11a7('0x1b')][_0x11a7('0x19')]);}})[_0x11a7('0x1c')](function(_0x4facb5){logger[_0x11a7('0x17')](_0x11a7('0x13'),_0x323998,_0x4facb5);_0x26f578(_0x4facb5);});});}exports[_0x11a7('0x1d')]=function(_0x4f908c){var _0x2785fe=this;return new Promise(function(_0x22c725,_0x36ee03){return db[_0x11a7('0x1e')][_0x11a7('0x1f')](_0x4f908c['body'],{'raw':_0x4f908c[_0x11a7('0x20')]?_0x4f908c[_0x11a7('0x20')][_0x11a7('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f908c[_0x11a7('0x20')]?_0x4f908c[_0x11a7('0x20')][_0x11a7('0x22')]||null:null,'attributes':_0x4f908c['options']?_0x4f908c[_0x11a7('0x20')]['attributes']||null:null,'limit':_0x4f908c[_0x11a7('0x20')]?_0x4f908c[_0x11a7('0x20')]['limit']||null:null})[_0x11a7('0x23')](function(_0x1b3bfb){logger[_0x11a7('0x1a')](_0x11a7('0x1d'),_0x4f908c);logger[_0x11a7('0x15')](_0x11a7('0x1d'),_0x4f908c,JSON['stringify'](_0x1b3bfb));_0x22c725(_0x1b3bfb);})[_0x11a7('0x1c')](function(_0x45ffd2){logger[_0x11a7('0x17')]('UpdateChatInteraction',_0x45ffd2[_0x11a7('0x19')],_0x4f908c);_0x36ee03(_0x2785fe[_0x11a7('0x17')](0x1f4,_0x45ffd2[_0x11a7('0x19')]));});});};exports[_0x11a7('0x24')]=function(_0x5126f7){return new Promise(function(_0x19bdfb,_0x3c85da){return db['ChatInteraction'][_0x11a7('0x25')]({'where':_0x5126f7[_0x11a7('0x20')]?_0x5126f7['options']['where']||null:null})[_0x11a7('0x23')](function(_0x452db3){if(_0x452db3){return _0x452db3[_0x11a7('0x26')](_0x5126f7[_0x11a7('0x27')][_0x11a7('0x28')],_[_0x11a7('0x29')](_0x5126f7[_0x11a7('0x27')],[_0x11a7('0x28'),'id'])||{});}})[_0x11a7('0x2a')](function(_0x5f69ab){logger[_0x11a7('0x1a')]('AddTags',_0x5126f7);logger[_0x11a7('0x15')](_0x11a7('0x2b'),_0x5126f7,JSON[_0x11a7('0x2c')](_0x5f69ab));_0x19bdfb(_0x5f69ab);})['catch'](function(_0x3a1194){logger['error'](_0x11a7('0x2b'),_0x3a1194[_0x11a7('0x19')],_0x5126f7);_0x3c85da(_this[_0x11a7('0x17')](0x1f4,_0x3a1194[_0x11a7('0x19')]));});});}; \ No newline at end of file +var _0x602c=['info','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','./chatInteraction.socket','register','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','update','body','options','where','attributes','limit','then'];(function(_0x115f70,_0x18a247){var _0x251562=function(_0x29adcf){while(--_0x29adcf){_0x115f70['push'](_0x115f70['shift']());}};_0x251562(++_0x18a247);}(_0x602c,0xcf));var _0xc602=function(_0x376c3c,_0x4fcf2c){_0x376c3c=_0x376c3c-0x0;var _0x46aefe=_0x602c[_0x376c3c];return _0x46aefe;};'use strict';var _=require(_0xc602('0x0'));var util=require(_0xc602('0x1'));var moment=require(_0xc602('0x2'));var BPromise=require(_0xc602('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc602('0x4'))['db'];var utils=require(_0xc602('0x5'));var logger=require('../../config/logger')(_0xc602('0x6'));var config=require('../../config/environment');var jayson=require(_0xc602('0x7'));var client=jayson['client'][_0xc602('0x8')]({'port':0x232a});config[_0xc602('0x9')]=_[_0xc602('0xa')](config[_0xc602('0x9')],{'host':_0xc602('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc602('0x9')]));require(_0xc602('0xc'))[_0xc602('0xd')](socket);function respondWithRpcPromise(_0x2c6534,_0x45f51a,_0x2117c6){return new BPromise(function(_0x22e2a4,_0x3e6cdd){return client[_0xc602('0xe')](_0x2c6534,_0x2117c6)['then'](function(_0x186924){logger['info'](_0xc602('0xf'),_0x45f51a,_0xc602('0x10'));logger[_0xc602('0x11')](_0xc602('0x12'),_0x45f51a,_0xc602('0x10'),JSON[_0xc602('0x13')](_0x186924));if(_0x186924['error']){if(_0x186924[_0xc602('0x14')][_0xc602('0x15')]===0x1f4){logger['error'](_0xc602('0xf'),_0x45f51a,_0x186924[_0xc602('0x14')][_0xc602('0x16')]);return _0x3e6cdd(_0x186924['error'][_0xc602('0x16')]);}logger[_0xc602('0x14')](_0xc602('0xf'),_0x45f51a,_0x186924['error'][_0xc602('0x16')]);return _0x22e2a4(_0x186924['error']['message']);}else{logger['info'](_0xc602('0xf'),_0x45f51a,_0xc602('0x10'));_0x22e2a4(_0x186924[_0xc602('0x17')][_0xc602('0x16')]);}})[_0xc602('0x18')](function(_0xbce0fb){logger[_0xc602('0x14')](_0xc602('0xf'),_0x45f51a,_0xbce0fb);_0x3e6cdd(_0xbce0fb);});});}exports[_0xc602('0x19')]=function(_0x25e828){var _0x415c33=this;return new Promise(function(_0x8b479c,_0x232b54){return db['ChatInteraction'][_0xc602('0x1a')](_0x25e828[_0xc602('0x1b')],{'raw':_0x25e828[_0xc602('0x1c')]?_0x25e828[_0xc602('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25e828['options']?_0x25e828['options'][_0xc602('0x1d')]||null:null,'attributes':_0x25e828['options']?_0x25e828['options'][_0xc602('0x1e')]||null:null,'limit':_0x25e828[_0xc602('0x1c')]?_0x25e828[_0xc602('0x1c')][_0xc602('0x1f')]||null:null})[_0xc602('0x20')](function(_0x3153f7){logger[_0xc602('0x21')](_0xc602('0x19'),_0x25e828);logger[_0xc602('0x11')](_0xc602('0x19'),_0x25e828,JSON[_0xc602('0x13')](_0x3153f7));_0x8b479c(_0x3153f7);})[_0xc602('0x18')](function(_0x5a1a0a){logger[_0xc602('0x14')](_0xc602('0x19'),_0x5a1a0a['message'],_0x25e828);_0x232b54(_0x415c33[_0xc602('0x14')](0x1f4,_0x5a1a0a[_0xc602('0x16')]));});});};exports[_0xc602('0x22')]=function(_0x44b5c4){return new Promise(function(_0x552e6e,_0xba061e){return db['ChatInteraction'][_0xc602('0x23')]({'where':_0x44b5c4[_0xc602('0x1c')]?_0x44b5c4['options']['where']||null:null})[_0xc602('0x20')](function(_0xc00164){if(_0xc00164){return _0xc00164[_0xc602('0x24')](_0x44b5c4[_0xc602('0x1b')][_0xc602('0x25')],_[_0xc602('0x26')](_0x44b5c4[_0xc602('0x1b')],['ids','id'])||{});}})['spread'](function(_0x9c973b){logger['info']('AddTags',_0x44b5c4);logger[_0xc602('0x11')](_0xc602('0x27'),_0x44b5c4,JSON[_0xc602('0x13')](_0x9c973b));_0x552e6e(_0x9c973b);})[_0xc602('0x18')](function(_0x51f225){logger[_0xc602('0x14')](_0xc602('0x27'),_0x51f225[_0xc602('0x16')],_0x44b5c4);_0xba061e(_this[_0xc602('0x14')](0x1f4,_0x51f225[_0xc602('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 9e4cbb1..ca2adfe 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 _0xa363=['emit','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x962bb5,_0x26cb1d){var _0x549440=function(_0x1f30b9){while(--_0x1f30b9){_0x962bb5['push'](_0x962bb5['shift']());}};_0x549440(++_0x26cb1d);}(_0xa363,0x19b));var _0x3a36=function(_0x36e0f6,_0x4da6a7){_0x36e0f6=_0x36e0f6-0x0;var _0xc90479=_0xa363[_0x36e0f6];return _0xc90479;};'use strict';var ChatInteractionEvents=require(_0x3a36('0x0'));var events=[_0x3a36('0x1'),_0x3a36('0x2'),'update'];function createListener(_0x618035,_0x3802e8){return function(_0x8e5ead){_0x3802e8[_0x3a36('0x3')](_0x618035,_0x8e5ead);};}function removeListener(_0x1b3568,_0x1c66c1){return function(){ChatInteractionEvents['removeListener'](_0x1b3568,_0x1c66c1);};}exports['register']=function(_0x228667){for(var _0x4365dd=0x0,_0x1bb114=events[_0x3a36('0x4')];_0x4365dd<_0x1bb114;_0x4365dd++){var _0x32d82f=events[_0x4365dd];var _0x9c0ba7=createListener(_0x3a36('0x5')+_0x32d82f,_0x228667);ChatInteractionEvents['on'](_0x32d82f,_0x9c0ba7);}}; \ No newline at end of file +var _0xf498=['update','removeListener','register','length','chatInteraction:','./chatInteraction.events','remove'];(function(_0x2e2b76,_0x2460ae){var _0x4da918=function(_0x2c8fc7){while(--_0x2c8fc7){_0x2e2b76['push'](_0x2e2b76['shift']());}};_0x4da918(++_0x2460ae);}(_0xf498,0x108));var _0x8f49=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xf498[_0xc4001c];return _0x49f7bc;};'use strict';var ChatInteractionEvents=require(_0x8f49('0x0'));var events=['save',_0x8f49('0x1'),_0x8f49('0x2')];function createListener(_0x50b4c0,_0x32eac0){return function(_0x213aa6){_0x32eac0['emit'](_0x50b4c0,_0x213aa6);};}function removeListener(_0x54f3bf,_0x3800e4){return function(){ChatInteractionEvents[_0x8f49('0x3')](_0x54f3bf,_0x3800e4);};}exports[_0x8f49('0x4')]=function(_0x52521d){for(var _0x2be802=0x0,_0x25d471=events[_0x8f49('0x5')];_0x2be802<_0x25d471;_0x2be802++){var _0x211b5b=events[_0x2be802];var _0x5b563b=createListener(_0x8f49('0x6')+_0x211b5b,_0x52521d);ChatInteractionEvents['on'](_0x211b5b,_0x5b563b);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 7c8c5cf..6c8f026 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 _0xa91d=['/:id/tags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/attachment_download','isChatInteractionAuthorized','/:id/messages','getMessages','getMyMessages','/:id/download','post','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','chat','put','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete'];(function(_0x49e734,_0xc04f4f){var _0x2a2d42=function(_0x564e55){while(--_0x564e55){_0x49e734['push'](_0x49e734['shift']());}};_0x2a2d42(++_0xc04f4f);}(_0xa91d,0x167));var _0xda91=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa91d[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xda91('0x0'));var util=require('util');var path=require(_0xda91('0x1'));var timeout=require(_0xda91('0x2'));var express=require(_0xda91('0x3'));var router=express[_0xda91('0x4')]();var fs_extra=require(_0xda91('0x5'));var auth=require(_0xda91('0x6'));var interaction=require(_0xda91('0x7'));var config=require(_0xda91('0x8'));var controller=require(_0xda91('0x9'));router[_0xda91('0xa')]('/',auth[_0xda91('0xb')](),controller[_0xda91('0xc')]);router[_0xda91('0xa')](_0xda91('0xd'),auth[_0xda91('0xb')](),controller[_0xda91('0xe')]);router[_0xda91('0xa')](_0xda91('0xf'),auth['isChatInteractionAuthorized'](),controller['show']);router[_0xda91('0xa')](_0xda91('0x10'),auth[_0xda91('0x11')](),controller['attachmentDownload']);router['get'](_0xda91('0x12'),auth[_0xda91('0xb')](),controller[_0xda91('0x13')]);router['get']('/:id/my_messages',auth[_0xda91('0x11')](),controller[_0xda91('0x14')]);router['get'](_0xda91('0x15'),auth[_0xda91('0xb')](),controller['download']);router[_0xda91('0x16')]('/',auth[_0xda91('0xb')](),controller['create']);router[_0xda91('0x16')](_0xda91('0x17'),auth[_0xda91('0xb')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xda91('0x18')]({'destination':function(_0x530c4b,_0x29f694,_0x24f9da){_0x24f9da(null,path[_0xda91('0x19')](config[_0xda91('0x1a')],_0xda91('0x1b')));},'filename':function(_0x16f81e,_0x257d4a,_0x327b2b){_0x327b2b(null,util[_0xda91('0x1c')]('%s-%s',Date[_0xda91('0x1d')](),_0x257d4a[_0xda91('0x1e')][_0xda91('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xda91('0x16')](_0xda91('0x20'),upload[_0xda91('0x21')](_0xda91('0x22')),controller[_0xda91('0x23')]);router['post'](_0xda91('0x12'),auth[_0xda91('0x11')](),controller[_0xda91('0x24')]);router[_0xda91('0x16')]('/:id/tags',auth[_0xda91('0xb')](),interaction['tracked'](_0xda91('0x25'),'chatinteraction:addtags'),controller['addTags']);router[_0xda91('0x26')]('/:id',auth['isAuthenticated'](),interaction[_0xda91('0x27')](_0xda91('0x25'),_0xda91('0x28')),controller[_0xda91('0x29')]);router[_0xda91('0x26')](_0xda91('0x2a'),controller[_0xda91('0x2b')]);router[_0xda91('0x26')](_0xda91('0x2c'),auth[_0xda91('0x11')](),controller[_0xda91('0x2d')]);router['put'](_0xda91('0x2e'),controller[_0xda91('0x2f')]);router[_0xda91('0x30')](_0xda91('0xf'),auth[_0xda91('0xb')](),interaction[_0xda91('0x27')](_0xda91('0x25'),'chatinteraction:destroy'),controller['destroy']);router[_0xda91('0x30')](_0xda91('0x31'),auth['isAuthenticated'](),controller['removeTags']);module[_0xda91('0x32')]=router; \ No newline at end of file +var _0xcfc8=['%s-%s','now','originalname','replace','/:id/attachment_upload','file','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','/:id/custom_update','customUpdate','/:id/abandon','abandon','chatinteraction:destroy','destroy','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized','show','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession','root','server/files/attachments/','format'];(function(_0x417452,_0x19ecdd){var _0x326b75=function(_0x1d817e){while(--_0x1d817e){_0x417452['push'](_0x417452['shift']());}};_0x326b75(++_0x19ecdd);}(_0xcfc8,0x150));var _0x8cfc=function(_0x19b6bc,_0x14f3cf){_0x19b6bc=_0x19b6bc-0x0;var _0x3a7172=_0xcfc8[_0x19b6bc];return _0x3a7172;};'use strict';var multer=require(_0x8cfc('0x0'));var util=require(_0x8cfc('0x1'));var path=require(_0x8cfc('0x2'));var timeout=require('connect-timeout');var express=require(_0x8cfc('0x3'));var router=express['Router']();var fs_extra=require(_0x8cfc('0x4'));var auth=require(_0x8cfc('0x5'));var interaction=require(_0x8cfc('0x6'));var config=require('../../config/environment');var controller=require(_0x8cfc('0x7'));router[_0x8cfc('0x8')]('/',auth[_0x8cfc('0x9')](),controller['index']);router[_0x8cfc('0x8')](_0x8cfc('0xa'),auth[_0x8cfc('0x9')](),controller['describe']);router[_0x8cfc('0x8')](_0x8cfc('0xb'),auth[_0x8cfc('0xc')](),controller[_0x8cfc('0xd')]);router['get']('/:id/attachment_download',auth[_0x8cfc('0xc')](),controller['attachmentDownload']);router[_0x8cfc('0x8')](_0x8cfc('0xe'),auth[_0x8cfc('0x9')](),controller['getMessages']);router[_0x8cfc('0x8')](_0x8cfc('0xf'),auth[_0x8cfc('0xc')](),controller[_0x8cfc('0x10')]);router[_0x8cfc('0x8')](_0x8cfc('0x11'),auth['isAuthenticated'](),controller[_0x8cfc('0x12')]);router['post']('/',auth[_0x8cfc('0x9')](),controller['create']);router[_0x8cfc('0x13')]('/:id/vidaoo',auth[_0x8cfc('0x9')](),controller[_0x8cfc('0x14')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5945d6,_0x3965de,_0x106afe){_0x106afe(null,path['join'](config[_0x8cfc('0x15')],_0x8cfc('0x16')));},'filename':function(_0x2df7dd,_0x16a616,_0x58a6d2){_0x58a6d2(null,util[_0x8cfc('0x17')](_0x8cfc('0x18'),Date[_0x8cfc('0x19')](),_0x16a616[_0x8cfc('0x1a')][_0x8cfc('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8cfc('0x13')](_0x8cfc('0x1c'),upload['single'](_0x8cfc('0x1d')),controller['attachmentUpload']);router[_0x8cfc('0x13')]('/:id/messages',auth[_0x8cfc('0xc')](),controller[_0x8cfc('0x1e')]);router['post'](_0x8cfc('0x1f'),auth[_0x8cfc('0x9')](),interaction['tracked'](_0x8cfc('0x20'),_0x8cfc('0x21')),controller[_0x8cfc('0x22')]);router[_0x8cfc('0x23')](_0x8cfc('0xb'),auth['isAuthenticated'](),interaction[_0x8cfc('0x24')](_0x8cfc('0x20'),'chatinteraction:update'),controller['update']);router[_0x8cfc('0x23')](_0x8cfc('0x25'),controller[_0x8cfc('0x26')]);router[_0x8cfc('0x23')](_0x8cfc('0x27'),auth[_0x8cfc('0xc')](),controller[_0x8cfc('0x28')]);router['put']('/:id/close',controller['close']);router['delete'](_0x8cfc('0xb'),auth[_0x8cfc('0x9')](),interaction[_0x8cfc('0x24')](_0x8cfc('0x20'),_0x8cfc('0x29')),controller[_0x8cfc('0x2a')]);router[_0x8cfc('0x2b')](_0x8cfc('0x1f'),auth['isAuthenticated'](),controller['removeTags']);module[_0x8cfc('0x2c')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 42101f7..e025b1f 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 _0x5629=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x2138e7,_0x235c2d){var _0x2504d6=function(_0x37e191){while(--_0x37e191){_0x2138e7['push'](_0x2138e7['shift']());}};_0x2504d6(++_0x235c2d);}(_0x5629,0x1e4));var _0x9562=function(_0x4c1378,_0x100a00){_0x4c1378=_0x4c1378-0x0;var _0x34083c=_0x5629[_0x4c1378];return _0x34083c;};'use strict';var Sequelize=require(_0x9562('0x0'));module[_0x9562('0x1')]={'body':{'type':Sequelize[_0x9562('0x2')](_0x9562('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9562('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9562('0x5')]}}; \ No newline at end of file +var _0x7979=['medium','BOOLEAN','INTEGER','exports','TEXT'];(function(_0x58ae0a,_0x3e120d){var _0x394c2d=function(_0xdded18){while(--_0xdded18){_0x58ae0a['push'](_0x58ae0a['shift']());}};_0x394c2d(++_0x3e120d);}(_0x7979,0x1b1));var _0x9797=function(_0x439a7e,_0x301aa4){_0x439a7e=_0x439a7e-0x0;var _0x369a5f=_0x7979[_0x439a7e];return _0x369a5f;};'use strict';var Sequelize=require('sequelize');module[_0x9797('0x0')]={'body':{'type':Sequelize[_0x9797('0x1')](_0x9797('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9797('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9797('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 9c9b486..fe47824 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 _0x5fa6=['sendStatus','offset','undefined','count','limit','Content-Range','json','apply','reject','update','then','status','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','map','VIRTUAL','include','rows','catch','show','includeAll','options','find','create','body','params','destroy','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','sort','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','findAll','isEmpty','resourceId','push','length','FromId','ToId','read','-createdAt','all','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0xda2dd1,_0x2fe6a8){var _0x43637e=function(_0x1a1753){while(--_0x1a1753){_0xda2dd1['push'](_0xda2dd1['shift']());}};_0x43637e(++_0x2fe6a8);}(_0x5fa6,0xc0));var _0x65fa=function(_0x21f013,_0x3a2050){_0x21f013=_0x21f013-0x0;var _0x1addf8=_0x5fa6[_0x21f013];return _0x1addf8;};'use strict';var emlformat=require(_0x65fa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x65fa('0x1'));var rp=require(_0x65fa('0x2'));var moment=require(_0x65fa('0x3'));var BPromise=require(_0x65fa('0x4'));var Mustache=require('mustache');var util=require(_0x65fa('0x5'));var path=require('path');var sox=require(_0x65fa('0x6'));var csv=require(_0x65fa('0x7'));var ejs=require(_0x65fa('0x8'));var fs=require('fs');var fs_extra=require(_0x65fa('0x9'));var _=require(_0x65fa('0xa'));var squel=require('squel');var crypto=require(_0x65fa('0xb'));var jsforce=require(_0x65fa('0xc'));var deskjs=require(_0x65fa('0xd'));var toCsv=require('to-csv');var querystring=require(_0x65fa('0xe'));var Papa=require('papaparse');var Redis=require(_0x65fa('0xf'));var authService=require(_0x65fa('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x65fa('0x11'));var hardwareService=require(_0x65fa('0x12'));var logger=require(_0x65fa('0x13'))(_0x65fa('0x14'));var utils=require(_0x65fa('0x15'));var config=require(_0x65fa('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x65fa('0x17')]=_['defaults'](config[_0x65fa('0x17')],{'host':_0x65fa('0x18'),'port':0x18eb});var socket=require(_0x65fa('0x19'))(new Redis(config['redis']));require(_0x65fa('0x1a'))[_0x65fa('0x1b')](socket);function respondWithStatusCode(_0x140602,_0xad921){_0xad921=_0xad921||0xcc;return function(_0x2e9656){if(_0x2e9656){return _0x140602[_0x65fa('0x1c')](_0xad921);}return _0x140602['status'](_0xad921)['end']();};}function respondWithResult(_0x348f60,_0x330a49){_0x330a49=_0x330a49||0xc8;return function(_0x46ac07){if(_0x46ac07){return _0x348f60['status'](_0x330a49)['json'](_0x46ac07);}};}function respondWithFilteredResult(_0xcf9eb5,_0x148df3){return function(_0x137d39){if(_0x137d39){var _0x180849=typeof _0x148df3[_0x65fa('0x1d')]===_0x65fa('0x1e')&&typeof _0x148df3['limit']==='undefined';var _0x47514c=_0x137d39[_0x65fa('0x1f')];var _0x43ccc8=_0x180849?0x0:_0x148df3[_0x65fa('0x1d')];var _0x19e8fc=_0x180849?_0x137d39[_0x65fa('0x1f')]:_0x148df3[_0x65fa('0x1d')]+_0x148df3[_0x65fa('0x20')];var _0x5ee376;if(_0x19e8fc>=_0x47514c){_0x19e8fc=_0x47514c;_0x5ee376=0xc8;}else{_0x5ee376=0xce;}_0xcf9eb5['status'](_0x5ee376);return _0xcf9eb5['set'](_0x65fa('0x21'),_0x43ccc8+'-'+_0x19e8fc+'/'+_0x47514c)[_0x65fa('0x22')](_0x137d39);}return null;};}function patchUpdates(_0x319e13){return function(_0x1642c2){try{jsonpatch[_0x65fa('0x23')](_0x1642c2,_0x319e13,!![]);}catch(_0x4ce3ba){return BPromise[_0x65fa('0x24')](_0x4ce3ba);}return _0x1642c2['save']();};}function saveUpdates(_0x324325,_0x41afb2){return function(_0x1250a9){if(_0x1250a9){return _0x1250a9[_0x65fa('0x25')](_0x324325)['then'](function(_0x2bb5c8){return _0x2bb5c8;});}return null;};}function removeEntity(_0x19ee7e,_0x4e618a){return function(_0x3e832e){if(_0x3e832e){return _0x3e832e['destroy']()[_0x65fa('0x26')](function(){_0x19ee7e[_0x65fa('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fce19,_0x1cf44c){return function(_0x3934e5){if(!_0x3934e5){_0x2fce19[_0x65fa('0x1c')](0x194);}return _0x3934e5;};}function handleError(_0x21c752,_0x4ac566){_0x4ac566=_0x4ac566||0x1f4;return function(_0x22771e){logger['error'](_0x22771e[_0x65fa('0x28')]);if(_0x22771e[_0x65fa('0x29')]){delete _0x22771e[_0x65fa('0x29')];}_0x21c752[_0x65fa('0x27')](_0x4ac566)[_0x65fa('0x2a')](_0x22771e);};}exports[_0x65fa('0x2b')]=function(_0xda28c8,_0x374c09){var _0x3cca6c={},_0x1b71dd={},_0x5f39e9={'count':0x0,'rows':[]};var _0x1da79a=_['map'](db[_0x65fa('0x2c')][_0x65fa('0x2d')],function(_0x4f3f7a){return{'name':_0x4f3f7a[_0x65fa('0x2e')],'type':_0x4f3f7a[_0x65fa('0x2f')][_0x65fa('0x30')]};});_0x1b71dd['model']=_['map'](_0x1da79a,'name');_0x1b71dd['query']=_[_0x65fa('0x31')](_0xda28c8[_0x65fa('0x32')]);_0x1b71dd[_0x65fa('0x33')]=_[_0x65fa('0x34')](_0x1b71dd[_0x65fa('0x35')],_0x1b71dd[_0x65fa('0x32')]);_0x3cca6c[_0x65fa('0x36')]=_[_0x65fa('0x34')](_0x1b71dd[_0x65fa('0x35')],qs[_0x65fa('0x37')](_0xda28c8[_0x65fa('0x32')][_0x65fa('0x37')]));_0x3cca6c['attributes']=_0x3cca6c[_0x65fa('0x36')]['length']?_0x3cca6c['attributes']:_0x1b71dd[_0x65fa('0x35')];if(!_0xda28c8['query'][_0x65fa('0x38')](_0x65fa('0x39'))){_0x3cca6c[_0x65fa('0x20')]=qs['limit'](_0xda28c8[_0x65fa('0x32')][_0x65fa('0x20')]);_0x3cca6c[_0x65fa('0x1d')]=qs['offset'](_0xda28c8[_0x65fa('0x32')][_0x65fa('0x1d')]);}_0x3cca6c['order']=qs['sort'](_0xda28c8['query']['sort']);_0x3cca6c[_0x65fa('0x3a')]=qs[_0x65fa('0x33')](_[_0x65fa('0x3b')](_0xda28c8[_0x65fa('0x32')],_0x1b71dd[_0x65fa('0x33')]),_0x1da79a);if(_0xda28c8[_0x65fa('0x32')][_0x65fa('0x3c')]){_0x3cca6c[_0x65fa('0x3a')]=_[_0x65fa('0x3d')](_0x3cca6c[_0x65fa('0x3a')],{'$or':_[_0x65fa('0x3e')](_0x1da79a,function(_0x30f060){if(_0x30f060[_0x65fa('0x2f')]!==_0x65fa('0x3f')){var _0x133c76={};_0x133c76[_0x30f060['name']]={'$like':'%'+_0xda28c8['query'][_0x65fa('0x3c')]+'%'};return _0x133c76;}})});}_0x3cca6c=_['merge']({},_0x3cca6c,_0xda28c8['options']);var _0x4272d7={'where':_0x3cca6c[_0x65fa('0x3a')]};return db[_0x65fa('0x2c')][_0x65fa('0x1f')](_0x4272d7)['then'](function(_0x18ee2e){_0x5f39e9[_0x65fa('0x1f')]=_0x18ee2e;if(_0xda28c8[_0x65fa('0x32')]['includeAll']){_0x3cca6c[_0x65fa('0x40')]=[{'all':!![]}];}return db[_0x65fa('0x2c')]['findAll'](_0x3cca6c);})[_0x65fa('0x26')](function(_0x5b7df1){_0x5f39e9[_0x65fa('0x41')]=_0x5b7df1;return _0x5f39e9;})[_0x65fa('0x26')](respondWithFilteredResult(_0x374c09,_0x3cca6c))[_0x65fa('0x42')](handleError(_0x374c09,null));};exports[_0x65fa('0x43')]=function(_0x517c7c,_0xc066ef){var _0x538102={'raw':!![],'where':{'id':_0x517c7c['params']['id']}},_0x1a7b6b={};_0x1a7b6b['model']=_[_0x65fa('0x31')](db[_0x65fa('0x2c')][_0x65fa('0x2d')]);_0x1a7b6b[_0x65fa('0x32')]=_[_0x65fa('0x31')](_0x517c7c[_0x65fa('0x32')]);_0x1a7b6b[_0x65fa('0x33')]=_['intersection'](_0x1a7b6b[_0x65fa('0x35')],_0x1a7b6b['query']);_0x538102[_0x65fa('0x36')]=_[_0x65fa('0x34')](_0x1a7b6b[_0x65fa('0x35')],qs['fields'](_0x517c7c['query'][_0x65fa('0x37')]));_0x538102['attributes']=_0x538102[_0x65fa('0x36')]['length']?_0x538102[_0x65fa('0x36')]:_0x1a7b6b['model'];if(_0x517c7c[_0x65fa('0x32')][_0x65fa('0x44')]){_0x538102[_0x65fa('0x40')]=[{'all':!![]}];}_0x538102=_[_0x65fa('0x3d')]({},_0x538102,_0x517c7c[_0x65fa('0x45')]);return db[_0x65fa('0x2c')][_0x65fa('0x46')](_0x538102)[_0x65fa('0x26')](handleEntityNotFound(_0xc066ef,null))[_0x65fa('0x26')](respondWithResult(_0xc066ef,null))['catch'](handleError(_0xc066ef,null));};exports['create']=function(_0x4abbdf,_0x1b6fff){return db[_0x65fa('0x2c')][_0x65fa('0x47')](_0x4abbdf['body'],{})[_0x65fa('0x26')](respondWithResult(_0x1b6fff,0xc9))['catch'](handleError(_0x1b6fff,null));};exports['update']=function(_0x1459e6,_0x3bf3ea){if(_0x1459e6[_0x65fa('0x48')]['id']){delete _0x1459e6['body']['id'];}return db['ChatInternalMessage'][_0x65fa('0x46')]({'where':{'id':_0x1459e6[_0x65fa('0x49')]['id']}})[_0x65fa('0x26')](handleEntityNotFound(_0x3bf3ea,null))['then'](saveUpdates(_0x1459e6[_0x65fa('0x48')],null))[_0x65fa('0x26')](respondWithResult(_0x3bf3ea,null))[_0x65fa('0x42')](handleError(_0x3bf3ea,null));};exports[_0x65fa('0x4a')]=function(_0x456361,_0x57fc38){return db[_0x65fa('0x2c')][_0x65fa('0x46')]({'where':{'id':_0x456361[_0x65fa('0x49')]['id']}})[_0x65fa('0x26')](handleEntityNotFound(_0x57fc38,null))[_0x65fa('0x26')](removeEntity(_0x57fc38,null))[_0x65fa('0x42')](handleError(_0x57fc38,null));};exports['describe']=function(_0x5e8293,_0x3c1195){return db[_0x65fa('0x2c')]['describe']()[_0x65fa('0x26')](respondWithResult(_0x3c1195,null))[_0x65fa('0x42')](handleError(_0x3c1195,null));};function wrapUser(_0x56c50c){return function(_0xe6cb6d){var _0x26b275=_0x56c50c[_0x65fa('0x4b')]({'plain':!![]});_0x26b275[_0x65fa('0x4c')]=[];if(_0xe6cb6d){_0x26b275[_0x65fa('0x4d')]=_0xe6cb6d[_0x65fa('0x4e')];_0x26b275[_0x65fa('0x4f')]=_0xe6cb6d;}else{_0x26b275['lastMessageAt']=moment(0x0)['format'](_0x65fa('0x50'));_0x26b275[_0x65fa('0x4f')]={};}return _0x26b275;};}exports[_0x65fa('0x51')]=function(_0x3b2364,_0x54ab26,_0x4c543c){var _0x9f5eb0=[];return db[_0x65fa('0x52')]['findAll']({'where':{'role':[_0x65fa('0x53'),_0x65fa('0x54'),_0x65fa('0x55')]},'attributes':['id',_0x65fa('0x56'),_0x65fa('0x29'),_0x65fa('0x57'),_0x65fa('0x58'),_0x65fa('0x59'),'online',_0x65fa('0x5a'),_0x65fa('0x5b'),_0x65fa('0x5c')],'order':qs[_0x65fa('0x5d')]('-online'),'include':[{'model':db[_0x65fa('0x5e')],'as':'VoiceQueues','attributes':['id',_0x65fa('0x29'),'type'],'through':{'attributes':[]}}]})[_0x65fa('0x26')](function(_0x5be13f){if(_0x5be13f){var _0x876eb2=_0x3b2364[_0x65fa('0x55')][_0x65fa('0x4b')]({'plain':!![]});if(!_0x876eb2)throw new Error(_0x65fa('0x5f'));if(_0x876eb2[_0x65fa('0x57')]==='user'){return db[_0x65fa('0x60')]['find']({'where':{'name':'Agents','userProfileId':_0x876eb2[_0x65fa('0x61')]},'raw':!![]})[_0x65fa('0x26')](function(_0x42b3d9){if(_0x42b3d9){if(_0x42b3d9[_0x65fa('0x62')]===0x0){return db[_0x65fa('0x63')][_0x65fa('0x64')]({'where':{'sectionId':_0x42b3d9['id']},'raw':!![]})[_0x65fa('0x26')](function(_0x4f9dbd){var _0xf589bc=[];if(_[_0x65fa('0x65')](_0x4f9dbd)){_0xf589bc=_[_0x65fa('0x3c')](_0x5be13f,function(_0x2dc42d){if(_0x2dc42d[_0x65fa('0x57')]!==_0x65fa('0x53')){return _0x2dc42d;}});return _0xf589bc;}else{for(var _0xd5f6c2=0x0;_0xd5f6c2<_0x5be13f['length'];_0xd5f6c2++){var _0x4d3623=_0x5be13f[_0xd5f6c2];if(_0x4d3623[_0x65fa('0x57')]===_0x65fa('0x53')){var _0x4a5067=_[_0x65fa('0x46')](_0x4f9dbd,function(_0x26c0d8){return _0x26c0d8[_0x65fa('0x66')]===_0x4d3623['id'];});if(_0x4a5067)_0xf589bc[_0x65fa('0x67')](_0x4d3623);}else{_0xf589bc[_0x65fa('0x67')](_0x4d3623);}}return _0xf589bc;}});}else{return _0x5be13f;}}else{var _0x2f9f97=_[_0x65fa('0x3c')](_0x5be13f,function(_0x3b9e68){if(_0x3b9e68[_0x65fa('0x57')]!==_0x65fa('0x53')){return _0x3b9e68;}});return _0x2f9f97;}});}else{return _0x5be13f;}}})['then'](function(_0x4f2dc5){var _0x228ee1=[];if(_0x4f2dc5){_0x9f5eb0=_0x4f2dc5;for(var _0x18a070=0x0;_0x18a070<_0x4f2dc5[_0x65fa('0x68')];_0x18a070+=0x1){_0x9f5eb0[_0x18a070]['messages']=[];_0x228ee1[_0x65fa('0x67')](db[_0x65fa('0x2c')][_0x65fa('0x46')]({'where':{'FromId':[_0x3b2364[_0x65fa('0x55')]['id'],_0x4f2dc5[_0x18a070]['id']],'ToId':[_0x3b2364[_0x65fa('0x55')]['id'],_0x4f2dc5[_0x18a070]['id']],'ChatGroupId':null},'attributes':['id',_0x65fa('0x4e'),_0x65fa('0x69'),_0x65fa('0x6a'),_0x65fa('0x6b'),'body'],'order':qs['sort'](_0x65fa('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x65fa('0x26')](wrapUser(_0x4f2dc5[_0x18a070])));}return BPromise[_0x65fa('0x6d')](_0x228ee1);}return[];})[_0x65fa('0x26')](function(_0x4e56f9){return{'rows':_0x4e56f9,'count':_0x4e56f9[_0x65fa('0x68')]};})['then'](respondWithResult(_0x54ab26,null))[_0x65fa('0x42')](handleError(_0x54ab26,null));}; \ No newline at end of file +var _0x0d24=['includeAll','findAll','params','rawAttributes','include','find','catch','create','body','describe','get','createdAt','lastMessage','lastMessageAt','getUsers','agent','admin','user','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','filter','messages','FromId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','fieldName','type','key','model','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0d24,0x1d5));var _0x40d2=function(_0x2c0b2c,_0x59dbb2){_0x2c0b2c=_0x2c0b2c-0x0;var _0x2c3596=_0x0d24[_0x2c0b2c];return _0x2c3596;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x40d2('0x0'));var zipdir=require(_0x40d2('0x1'));var jsonpatch=require(_0x40d2('0x2'));var rp=require(_0x40d2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x40d2('0x4'));var util=require(_0x40d2('0x5'));var path=require(_0x40d2('0x6'));var sox=require('sox');var csv=require(_0x40d2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x40d2('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x40d2('0x9'));var Papa=require(_0x40d2('0xa'));var Redis=require(_0x40d2('0xb'));var authService=require(_0x40d2('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x40d2('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x40d2('0xe'))(_0x40d2('0xf'));var utils=require(_0x40d2('0x10'));var config=require(_0x40d2('0x11'));var licenseUtil=require(_0x40d2('0x12'));var db=require(_0x40d2('0x13'))['db'];config[_0x40d2('0x14')]=_[_0x40d2('0x15')](config[_0x40d2('0x14')],{'host':_0x40d2('0x16'),'port':0x18eb});var socket=require(_0x40d2('0x17'))(new Redis(config['redis']));require(_0x40d2('0x18'))[_0x40d2('0x19')](socket);function respondWithStatusCode(_0x3eb9d7,_0x2917b3){_0x2917b3=_0x2917b3||0xcc;return function(_0x5ecd7b){if(_0x5ecd7b){return _0x3eb9d7[_0x40d2('0x1a')](_0x2917b3);}return _0x3eb9d7['status'](_0x2917b3)[_0x40d2('0x1b')]();};}function respondWithResult(_0x52ab09,_0x508e91){_0x508e91=_0x508e91||0xc8;return function(_0x638d73){if(_0x638d73){return _0x52ab09[_0x40d2('0x1c')](_0x508e91)[_0x40d2('0x1d')](_0x638d73);}};}function respondWithFilteredResult(_0x4648e6,_0x564401){return function(_0x1a34cc){if(_0x1a34cc){var _0x69817=typeof _0x564401[_0x40d2('0x1e')]===_0x40d2('0x1f')&&typeof _0x564401[_0x40d2('0x20')]===_0x40d2('0x1f');var _0x299df1=_0x1a34cc['count'];var _0x5b02d4=_0x69817?0x0:_0x564401[_0x40d2('0x1e')];var _0x1692ee=_0x69817?_0x1a34cc[_0x40d2('0x21')]:_0x564401[_0x40d2('0x1e')]+_0x564401[_0x40d2('0x20')];var _0x4ead66;if(_0x1692ee>=_0x299df1){_0x1692ee=_0x299df1;_0x4ead66=0xc8;}else{_0x4ead66=0xce;}_0x4648e6[_0x40d2('0x1c')](_0x4ead66);return _0x4648e6[_0x40d2('0x22')](_0x40d2('0x23'),_0x5b02d4+'-'+_0x1692ee+'/'+_0x299df1)[_0x40d2('0x1d')](_0x1a34cc);}return null;};}function patchUpdates(_0x375cf5){return function(_0x5e2017){try{jsonpatch['apply'](_0x5e2017,_0x375cf5,!![]);}catch(_0x12b2ef){return BPromise[_0x40d2('0x24')](_0x12b2ef);}return _0x5e2017[_0x40d2('0x25')]();};}function saveUpdates(_0x1437a7,_0x31a528){return function(_0x21977d){if(_0x21977d){return _0x21977d[_0x40d2('0x26')](_0x1437a7)[_0x40d2('0x27')](function(_0x45922f){return _0x45922f;});}return null;};}function removeEntity(_0x843b60,_0x595e8e){return function(_0x27543c){if(_0x27543c){return _0x27543c[_0x40d2('0x28')]()[_0x40d2('0x27')](function(){_0x843b60[_0x40d2('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a338f,_0x38b0dc){return function(_0x45313b){if(!_0x45313b){_0x1a338f[_0x40d2('0x1a')](0x194);}return _0x45313b;};}function handleError(_0x33bf17,_0x379a7e){_0x379a7e=_0x379a7e||0x1f4;return function(_0x19a39f){logger[_0x40d2('0x29')](_0x19a39f[_0x40d2('0x2a')]);if(_0x19a39f[_0x40d2('0x2b')]){delete _0x19a39f['name'];}_0x33bf17['status'](_0x379a7e)[_0x40d2('0x2c')](_0x19a39f);};}exports[_0x40d2('0x2d')]=function(_0x4cd53e,_0x288581){var _0xd9eaca={},_0x3bf290={},_0xc463c4={'count':0x0,'rows':[]};var _0x226f57=_[_0x40d2('0x2e')](db[_0x40d2('0x2f')]['rawAttributes'],function(_0x338a38){return{'name':_0x338a38[_0x40d2('0x30')],'type':_0x338a38[_0x40d2('0x31')][_0x40d2('0x32')]};});_0x3bf290[_0x40d2('0x33')]=_[_0x40d2('0x2e')](_0x226f57,_0x40d2('0x2b'));_0x3bf290['query']=_[_0x40d2('0x34')](_0x4cd53e['query']);_0x3bf290[_0x40d2('0x35')]=_[_0x40d2('0x36')](_0x3bf290['model'],_0x3bf290['query']);_0xd9eaca[_0x40d2('0x37')]=_[_0x40d2('0x36')](_0x3bf290[_0x40d2('0x33')],qs['fields'](_0x4cd53e['query'][_0x40d2('0x38')]));_0xd9eaca[_0x40d2('0x37')]=_0xd9eaca[_0x40d2('0x37')][_0x40d2('0x39')]?_0xd9eaca[_0x40d2('0x37')]:_0x3bf290[_0x40d2('0x33')];if(!_0x4cd53e[_0x40d2('0x3a')][_0x40d2('0x3b')](_0x40d2('0x3c'))){_0xd9eaca[_0x40d2('0x20')]=qs[_0x40d2('0x20')](_0x4cd53e['query'][_0x40d2('0x20')]);_0xd9eaca[_0x40d2('0x1e')]=qs[_0x40d2('0x1e')](_0x4cd53e[_0x40d2('0x3a')][_0x40d2('0x1e')]);}_0xd9eaca['order']=qs[_0x40d2('0x3d')](_0x4cd53e[_0x40d2('0x3a')][_0x40d2('0x3d')]);_0xd9eaca[_0x40d2('0x3e')]=qs['filters'](_['pick'](_0x4cd53e['query'],_0x3bf290['filters']),_0x226f57);if(_0x4cd53e['query']['filter']){_0xd9eaca[_0x40d2('0x3e')]=_[_0x40d2('0x3f')](_0xd9eaca[_0x40d2('0x3e')],{'$or':_[_0x40d2('0x2e')](_0x226f57,function(_0xb7dda5){if(_0xb7dda5['type']!==_0x40d2('0x40')){var _0x22df59={};_0x22df59[_0xb7dda5[_0x40d2('0x2b')]]={'$like':'%'+_0x4cd53e[_0x40d2('0x3a')]['filter']+'%'};return _0x22df59;}})});}_0xd9eaca=_[_0x40d2('0x3f')]({},_0xd9eaca,_0x4cd53e[_0x40d2('0x41')]);var _0x165892={'where':_0xd9eaca['where']};return db[_0x40d2('0x2f')][_0x40d2('0x21')](_0x165892)[_0x40d2('0x27')](function(_0x2d613d){_0xc463c4[_0x40d2('0x21')]=_0x2d613d;if(_0x4cd53e['query'][_0x40d2('0x42')]){_0xd9eaca['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x40d2('0x43')](_0xd9eaca);})[_0x40d2('0x27')](function(_0x166a7){_0xc463c4['rows']=_0x166a7;return _0xc463c4;})[_0x40d2('0x27')](respondWithFilteredResult(_0x288581,_0xd9eaca))['catch'](handleError(_0x288581,null));};exports['show']=function(_0x137300,_0x564905){var _0xab0f50={'raw':!![],'where':{'id':_0x137300[_0x40d2('0x44')]['id']}},_0x5e46dc={};_0x5e46dc[_0x40d2('0x33')]=_[_0x40d2('0x34')](db['ChatInternalMessage'][_0x40d2('0x45')]);_0x5e46dc[_0x40d2('0x3a')]=_[_0x40d2('0x34')](_0x137300[_0x40d2('0x3a')]);_0x5e46dc[_0x40d2('0x35')]=_[_0x40d2('0x36')](_0x5e46dc[_0x40d2('0x33')],_0x5e46dc[_0x40d2('0x3a')]);_0xab0f50[_0x40d2('0x37')]=_[_0x40d2('0x36')](_0x5e46dc[_0x40d2('0x33')],qs[_0x40d2('0x38')](_0x137300['query'][_0x40d2('0x38')]));_0xab0f50['attributes']=_0xab0f50['attributes'][_0x40d2('0x39')]?_0xab0f50[_0x40d2('0x37')]:_0x5e46dc['model'];if(_0x137300['query']['includeAll']){_0xab0f50[_0x40d2('0x46')]=[{'all':!![]}];}_0xab0f50=_[_0x40d2('0x3f')]({},_0xab0f50,_0x137300['options']);return db[_0x40d2('0x2f')][_0x40d2('0x47')](_0xab0f50)[_0x40d2('0x27')](handleEntityNotFound(_0x564905,null))[_0x40d2('0x27')](respondWithResult(_0x564905,null))[_0x40d2('0x48')](handleError(_0x564905,null));};exports['create']=function(_0x448c94,_0x17ff13){return db[_0x40d2('0x2f')][_0x40d2('0x49')](_0x448c94[_0x40d2('0x4a')],{})[_0x40d2('0x27')](respondWithResult(_0x17ff13,0xc9))[_0x40d2('0x48')](handleError(_0x17ff13,null));};exports['update']=function(_0x4a9fa8,_0x36dc56){if(_0x4a9fa8['body']['id']){delete _0x4a9fa8['body']['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x4a9fa8[_0x40d2('0x44')]['id']}})[_0x40d2('0x27')](handleEntityNotFound(_0x36dc56,null))[_0x40d2('0x27')](saveUpdates(_0x4a9fa8['body'],null))[_0x40d2('0x27')](respondWithResult(_0x36dc56,null))['catch'](handleError(_0x36dc56,null));};exports[_0x40d2('0x28')]=function(_0x539d8d,_0x1c9fb3){return db['ChatInternalMessage']['find']({'where':{'id':_0x539d8d[_0x40d2('0x44')]['id']}})[_0x40d2('0x27')](handleEntityNotFound(_0x1c9fb3,null))[_0x40d2('0x27')](removeEntity(_0x1c9fb3,null))[_0x40d2('0x48')](handleError(_0x1c9fb3,null));};exports['describe']=function(_0x4f3eea,_0x241e30){return db[_0x40d2('0x2f')][_0x40d2('0x4b')]()[_0x40d2('0x27')](respondWithResult(_0x241e30,null))[_0x40d2('0x48')](handleError(_0x241e30,null));};function wrapUser(_0x225da1){return function(_0x2a65e6){var _0x3595d0=_0x225da1[_0x40d2('0x4c')]({'plain':!![]});_0x3595d0['messages']=[];if(_0x2a65e6){_0x3595d0['lastMessageAt']=_0x2a65e6[_0x40d2('0x4d')];_0x3595d0[_0x40d2('0x4e')]=_0x2a65e6;}else{_0x3595d0[_0x40d2('0x4f')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3595d0[_0x40d2('0x4e')]={};}return _0x3595d0;};}exports[_0x40d2('0x50')]=function(_0x43c686,_0x7389da,_0x41bb71){var _0x97c671=[];return db['User'][_0x40d2('0x43')]({'where':{'role':[_0x40d2('0x51'),_0x40d2('0x52'),_0x40d2('0x53')]},'attributes':['id','fullname',_0x40d2('0x2b'),_0x40d2('0x54'),_0x40d2('0x55'),_0x40d2('0x56'),_0x40d2('0x57'),_0x40d2('0x58'),_0x40d2('0x59'),'showWebBar'],'order':qs[_0x40d2('0x3d')](_0x40d2('0x5a')),'include':[{'model':db[_0x40d2('0x5b')],'as':_0x40d2('0x5c'),'attributes':['id','name',_0x40d2('0x31')],'through':{'attributes':[]}}]})[_0x40d2('0x27')](function(_0x4ae5e0){if(_0x4ae5e0){var _0x3c5843=_0x43c686[_0x40d2('0x53')][_0x40d2('0x4c')]({'plain':!![]});if(!_0x3c5843)throw new Error(_0x40d2('0x5d'));if(_0x3c5843[_0x40d2('0x54')]===_0x40d2('0x53')){return db[_0x40d2('0x5e')][_0x40d2('0x47')]({'where':{'name':_0x40d2('0x5f'),'userProfileId':_0x3c5843[_0x40d2('0x60')]},'raw':!![]})[_0x40d2('0x27')](function(_0x57b232){if(_0x57b232){if(_0x57b232[_0x40d2('0x61')]===0x0){return db[_0x40d2('0x62')][_0x40d2('0x43')]({'where':{'sectionId':_0x57b232['id']},'raw':!![]})[_0x40d2('0x27')](function(_0x57c029){var _0xb70582=[];if(_['isEmpty'](_0x57c029)){_0xb70582=_['filter'](_0x4ae5e0,function(_0x3e3fc1){if(_0x3e3fc1[_0x40d2('0x54')]!=='agent'){return _0x3e3fc1;}});return _0xb70582;}else{for(var _0x3711f2=0x0;_0x3711f2<_0x4ae5e0[_0x40d2('0x39')];_0x3711f2++){var _0x186e07=_0x4ae5e0[_0x3711f2];if(_0x186e07[_0x40d2('0x54')]===_0x40d2('0x51')){var _0x3c20c9=_['find'](_0x57c029,function(_0x4e3099){return _0x4e3099[_0x40d2('0x63')]===_0x186e07['id'];});if(_0x3c20c9)_0xb70582[_0x40d2('0x64')](_0x186e07);}else{_0xb70582['push'](_0x186e07);}}return _0xb70582;}});}else{return _0x4ae5e0;}}else{var _0x1fee39=_[_0x40d2('0x65')](_0x4ae5e0,function(_0x12d77f){if(_0x12d77f[_0x40d2('0x54')]!=='agent'){return _0x12d77f;}});return _0x1fee39;}});}else{return _0x4ae5e0;}}})[_0x40d2('0x27')](function(_0x171db1){var _0x11f5e1=[];if(_0x171db1){_0x97c671=_0x171db1;for(var _0x41d03f=0x0;_0x41d03f<_0x171db1[_0x40d2('0x39')];_0x41d03f+=0x1){_0x97c671[_0x41d03f][_0x40d2('0x66')]=[];_0x11f5e1[_0x40d2('0x64')](db[_0x40d2('0x2f')][_0x40d2('0x47')]({'where':{'FromId':[_0x43c686[_0x40d2('0x53')]['id'],_0x171db1[_0x41d03f]['id']],'ToId':[_0x43c686[_0x40d2('0x53')]['id'],_0x171db1[_0x41d03f]['id']],'ChatGroupId':null},'attributes':['id',_0x40d2('0x4d'),_0x40d2('0x67'),'ToId',_0x40d2('0x68'),_0x40d2('0x4a')],'order':qs[_0x40d2('0x3d')](_0x40d2('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x40d2('0x27')](wrapUser(_0x171db1[_0x41d03f])));}return BPromise[_0x40d2('0x6a')](_0x11f5e1);}return[];})[_0x40d2('0x27')](function(_0x4ac909){return{'rows':_0x4ac909,'count':_0x4ac909['length']};})[_0x40d2('0x27')](respondWithResult(_0x7389da,null))['catch'](handleError(_0x7389da,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 597ec21..b3b2804 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 _0xf559=['hasOwnProperty','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save','emit'];(function(_0x97b24f,_0x4bc0a9){var _0x627fa7=function(_0x271063){while(--_0x271063){_0x97b24f['push'](_0x97b24f['shift']());}};_0x627fa7(++_0x4bc0a9);}(_0xf559,0xb8));var _0x9f55=function(_0x465f75,_0x4b9141){_0x465f75=_0x465f75-0x0;var _0x53f44a=_0xf559[_0x465f75];return _0x53f44a;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x9f55('0x0'))['db'][_0x9f55('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x9f55('0x2')](0x0);var events={'afterCreate':_0x9f55('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1dbac9){return function(_0x6e981a,_0x351596,_0x494203){ChatInternalMessageEvents[_0x9f55('0x4')](_0x1dbac9+':'+_0x6e981a['id'],_0x6e981a);ChatInternalMessageEvents['emit'](_0x1dbac9,_0x6e981a);_0x494203(null);};}for(var e in events){if(events[_0x9f55('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x9f55('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x030a=['emit','hook','exports','events','../../mysqldb','ChatInternalMessage','save','update','remove'];(function(_0x414743,_0x2e6d87){var _0x39d57d=function(_0xb932fa){while(--_0xb932fa){_0x414743['push'](_0x414743['shift']());}};_0x39d57d(++_0x2e6d87);}(_0x030a,0xdb));var _0xa030=function(_0x1c206c,_0x30bdcf){_0x1c206c=_0x1c206c-0x0;var _0x188aaa=_0x030a[_0x1c206c];return _0x188aaa;};'use strict';var EventEmitter=require(_0xa030('0x0'));var ChatInternalMessage=require(_0xa030('0x1'))['db'][_0xa030('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa030('0x3'),'afterUpdate':_0xa030('0x4'),'afterDestroy':_0xa030('0x5')};function emitEvent(_0x8712e9){return function(_0x243cef,_0x25162e,_0x504386){ChatInternalMessageEvents[_0xa030('0x6')](_0x8712e9+':'+_0x243cef['id'],_0x243cef);ChatInternalMessageEvents[_0xa030('0x6')](_0x8712e9,_0x243cef);_0x504386(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xa030('0x7')](e,emitEvent(event));}}module[_0xa030('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 0c870c3..264ad73 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 _0xb80c=['../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','request-promise','rimraf'];(function(_0x17de64,_0x283320){var _0x18e352=function(_0x3cd244){while(--_0x3cd244){_0x17de64['push'](_0x17de64['shift']());}};_0x18e352(++_0x283320);}(_0xb80c,0x98));var _0xcb80=function(_0x1b2bf8,_0x319800){_0x1b2bf8=_0x1b2bf8-0x0;var _0xffb475=_0xb80c[_0x1b2bf8];return _0xffb475;};'use strict';var _=require(_0xcb80('0x0'));var util=require(_0xcb80('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb80('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb80('0x3'));var config=require(_0xcb80('0x4'));var attributes=require(_0xcb80('0x5'));module[_0xcb80('0x6')]=function(_0x3b393,_0x4594f6){return _0x3b393[_0xcb80('0x7')](_0xcb80('0x8'),attributes,{'tableName':_0xcb80('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcb80('0xa'),'collate':_0xcb80('0xb')});}; \ No newline at end of file +var _0x521d=['ChatInternalMessage','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','define'];(function(_0x364bf5,_0x9f144e){var _0x58f413=function(_0x1fea98){while(--_0x1fea98){_0x364bf5['push'](_0x364bf5['shift']());}};_0x58f413(++_0x9f144e);}(_0x521d,0x12e));var _0xd521=function(_0xd4c75a,_0x3b6e6e){_0xd4c75a=_0xd4c75a-0x0;var _0xc6926a=_0x521d[_0xd4c75a];return _0xc6926a;};'use strict';var _=require(_0xd521('0x0'));var util=require('util');var logger=require(_0xd521('0x1'))(_0xd521('0x2'));var moment=require(_0xd521('0x3'));var BPromise=require(_0xd521('0x4'));var rp=require(_0xd521('0x5'));var fs=require('fs');var path=require(_0xd521('0x6'));var rimraf=require(_0xd521('0x7'));var config=require('../../config/environment');var attributes=require(_0xd521('0x8'));module['exports']=function(_0x2ce6d1,_0x4e9fb8){return _0x2ce6d1[_0xd521('0x9')](_0xd521('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd521('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 9b0eaf5..36fe84c 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 _0x93ea=['debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','info','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x28a439,_0x5d9b3a){var _0x455e33=function(_0x18ddf0){while(--_0x18ddf0){_0x28a439['push'](_0x28a439['shift']());}};_0x455e33(++_0x5d9b3a);}(_0x93ea,0x131));var _0xa93e=function(_0x50cfc3,_0x526cc6){_0x50cfc3=_0x50cfc3-0x0;var _0x5c11ef=_0x93ea[_0x50cfc3];return _0x5c11ef;};'use strict';var _=require(_0xa93e('0x0'));var util=require(_0xa93e('0x1'));var moment=require('moment');var BPromise=require(_0xa93e('0x2'));var rs=require(_0xa93e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa93e('0x4'))['db'];var utils=require(_0xa93e('0x5'));var logger=require(_0xa93e('0x6'))(_0xa93e('0x7'));var config=require(_0xa93e('0x8'));var jayson=require(_0xa93e('0x9'));var client=jayson[_0xa93e('0xa')][_0xa93e('0xb')]({'port':0x232a});config[_0xa93e('0xc')]=_[_0xa93e('0xd')](config[_0xa93e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa93e('0xe'))(new Redis(config[_0xa93e('0xc')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2ee93f,_0x550607,_0x3fed5d){return new BPromise(function(_0x4ddc6e,_0x1ce09e){return client['request'](_0x2ee93f,_0x3fed5d)['then'](function(_0x1ab7cf){logger[_0xa93e('0xf')](_0xa93e('0x10'),_0x550607,'request\x20sent');logger[_0xa93e('0x11')](_0xa93e('0x12'),_0x550607,_0xa93e('0x13'),JSON[_0xa93e('0x14')](_0x1ab7cf));if(_0x1ab7cf['error']){if(_0x1ab7cf[_0xa93e('0x15')]['code']===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x550607,_0x1ab7cf[_0xa93e('0x15')][_0xa93e('0x16')]);return _0x1ce09e(_0x1ab7cf[_0xa93e('0x15')][_0xa93e('0x16')]);}logger[_0xa93e('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x550607,_0x1ab7cf[_0xa93e('0x15')][_0xa93e('0x16')]);return _0x4ddc6e(_0x1ab7cf[_0xa93e('0x15')]['message']);}else{logger[_0xa93e('0xf')](_0xa93e('0x10'),_0x550607,_0xa93e('0x13'));_0x4ddc6e(_0x1ab7cf['result'][_0xa93e('0x16')]);}})['catch'](function(_0x54cdb4){logger[_0xa93e('0x15')](_0xa93e('0x10'),_0x550607,_0x54cdb4);_0x1ce09e(_0x54cdb4);});});} \ No newline at end of file +var _0x5693=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','request\x20sent','debug'];(function(_0x4ea712,_0x261e02){var _0x159e1d=function(_0x44f723){while(--_0x44f723){_0x4ea712['push'](_0x4ea712['shift']());}};_0x159e1d(++_0x261e02);}(_0x5693,0x1d2));var _0x3569=function(_0x39c9fc,_0x267494){_0x39c9fc=_0x39c9fc-0x0;var _0x425ea4=_0x5693[_0x39c9fc];return _0x425ea4;};'use strict';var _=require(_0x3569('0x0'));var util=require(_0x3569('0x1'));var moment=require(_0x3569('0x2'));var BPromise=require('bluebird');var rs=require(_0x3569('0x3'));var fs=require('fs');var Redis=require(_0x3569('0x4'));var db=require(_0x3569('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3569('0x6'))(_0x3569('0x7'));var config=require('../../config/environment');var jayson=require(_0x3569('0x8'));var client=jayson[_0x3569('0x9')]['http']({'port':0x232a});config[_0x3569('0xa')]=_[_0x3569('0xb')](config[_0x3569('0xa')],{'host':_0x3569('0xc'),'port':0x18eb});var socket=require(_0x3569('0xd'))(new Redis(config[_0x3569('0xa')]));require(_0x3569('0xe'))[_0x3569('0xf')](socket);function respondWithRpcPromise(_0x32668a,_0x1fc954,_0x373bc9){return new BPromise(function(_0x20dd7c,_0x391588){return client['request'](_0x32668a,_0x373bc9)[_0x3569('0x10')](function(_0x5a2cff){logger[_0x3569('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x1fc954,_0x3569('0x12'));logger[_0x3569('0x13')](_0x3569('0x14'),_0x1fc954,_0x3569('0x12'),JSON[_0x3569('0x15')](_0x5a2cff));if(_0x5a2cff[_0x3569('0x16')]){if(_0x5a2cff[_0x3569('0x16')][_0x3569('0x17')]===0x1f4){logger[_0x3569('0x16')](_0x3569('0x18'),_0x1fc954,_0x5a2cff[_0x3569('0x16')][_0x3569('0x19')]);return _0x391588(_0x5a2cff['error'][_0x3569('0x19')]);}logger[_0x3569('0x16')](_0x3569('0x18'),_0x1fc954,_0x5a2cff[_0x3569('0x16')][_0x3569('0x19')]);return _0x20dd7c(_0x5a2cff['error'][_0x3569('0x19')]);}else{logger[_0x3569('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x1fc954,_0x3569('0x12'));_0x20dd7c(_0x5a2cff[_0x3569('0x1a')][_0x3569('0x19')]);}})['catch'](function(_0x21c182){logger[_0x3569('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x1fc954,_0x21c182);_0x391588(_0x21c182);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 20936ba..b432a27 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 _0xeed2=['./chatInternalMessage.events','remove','update','removeListener','length'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xeed2,0x1ef));var _0x2eed=function(_0x1b04b2,_0x43cd52){_0x1b04b2=_0x1b04b2-0x0;var _0x56e88d=_0xeed2[_0x1b04b2];return _0x56e88d;};'use strict';var ChatInternalMessageEvents=require(_0x2eed('0x0'));var events=['save',_0x2eed('0x1'),_0x2eed('0x2')];function createListener(_0x3bb5ca,_0x5d60a3){return function(_0x4b1810){_0x5d60a3['emit'](_0x3bb5ca,_0x4b1810);};}function removeListener(_0x2fddbd,_0x162fe9){return function(){ChatInternalMessageEvents[_0x2eed('0x3')](_0x2fddbd,_0x162fe9);};}exports['register']=function(_0x31c6aa){for(var _0xc79c95=0x0,_0x14c84a=events[_0x2eed('0x4')];_0xc79c95<_0x14c84a;_0xc79c95++){var _0xb23768=events[_0xc79c95];var _0x41c09c=createListener('chatInternalMessage:'+_0xb23768,_0x31c6aa);ChatInternalMessageEvents['on'](_0xb23768,_0x41c09c);}}; \ No newline at end of file +var _0x03fc=['chatInternalMessage:','save','remove','update','emit','removeListener','register'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x03fc,0x86));var _0xc03f=function(_0x552203,_0x530526){_0x552203=_0x552203-0x0;var _0x3dab1e=_0x03fc[_0x552203];return _0x3dab1e;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xc03f('0x0'),_0xc03f('0x1'),_0xc03f('0x2')];function createListener(_0x115dc6,_0x271a15){return function(_0x147af0){_0x271a15[_0xc03f('0x3')](_0x115dc6,_0x147af0);};}function removeListener(_0xedf3e9,_0x2845cc){return function(){ChatInternalMessageEvents[_0xc03f('0x4')](_0xedf3e9,_0x2845cc);};}exports[_0xc03f('0x5')]=function(_0x558cb9){for(var _0x25e91a=0x0,_0x1ed063=events['length'];_0x25e91a<_0x1ed063;_0x25e91a++){var _0x39e9b7=events[_0x25e91a];var _0x2975d3=createListener(_0xc03f('0x6')+_0x39e9b7,_0x558cb9);ChatInternalMessageEvents['on'](_0x39e9b7,_0x2975d3);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 8217fe4..139a6b1 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 _0x404d=['index','get','describe','getUsers','show','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated'];(function(_0x6a6960,_0x3008f6){var _0x43c3e8=function(_0x19ebf2){while(--_0x19ebf2){_0x6a6960['push'](_0x6a6960['shift']());}};_0x43c3e8(++_0x3008f6);}(_0x404d,0xf9));var _0xd404=function(_0x5a3f41,_0x4f1913){_0x5a3f41=_0x5a3f41-0x0;var _0x51cc1f=_0x404d[_0x5a3f41];return _0x51cc1f;};'use strict';var multer=require(_0xd404('0x0'));var util=require(_0xd404('0x1'));var path=require(_0xd404('0x2'));var timeout=require(_0xd404('0x3'));var express=require(_0xd404('0x4'));var router=express[_0xd404('0x5')]();var fs_extra=require(_0xd404('0x6'));var auth=require(_0xd404('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd404('0x8'));var controller=require(_0xd404('0x9'));router['get']('/',auth[_0xd404('0xa')](),controller[_0xd404('0xb')]);router[_0xd404('0xc')]('/describe',auth['isAuthenticated'](),controller[_0xd404('0xd')]);router[_0xd404('0xc')]('/users',auth[_0xd404('0xa')](),controller[_0xd404('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd404('0xf')]);router['post']('/',auth[_0xd404('0xa')](),controller['create']);router[_0xd404('0x10')](_0xd404('0x11'),controller['update']);router[_0xd404('0x12')](_0xd404('0x11'),auth[_0xd404('0xa')](),controller['destroy']);module[_0xd404('0x13')]=router; \ No newline at end of file +var _0x80d9=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','/:id','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x3451d7,_0x20d83a){var _0x1575b4=function(_0x57f42c){while(--_0x57f42c){_0x3451d7['push'](_0x3451d7['shift']());}};_0x1575b4(++_0x20d83a);}(_0x80d9,0xb6));var _0x980d=function(_0xa13fdb,_0x22bd20){_0xa13fdb=_0xa13fdb-0x0;var _0x32758b=_0x80d9[_0xa13fdb];return _0x32758b;};'use strict';var multer=require(_0x980d('0x0'));var util=require(_0x980d('0x1'));var path=require(_0x980d('0x2'));var timeout=require(_0x980d('0x3'));var express=require(_0x980d('0x4'));var router=express[_0x980d('0x5')]();var fs_extra=require(_0x980d('0x6'));var auth=require(_0x980d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x980d('0x8'));var controller=require(_0x980d('0x9'));router[_0x980d('0xa')]('/',auth[_0x980d('0xb')](),controller[_0x980d('0xc')]);router[_0x980d('0xa')]('/describe',auth[_0x980d('0xb')](),controller[_0x980d('0xd')]);router[_0x980d('0xa')](_0x980d('0xe'),auth[_0x980d('0xb')](),controller['getUsers']);router[_0x980d('0xa')](_0x980d('0xf'),auth[_0x980d('0xb')](),controller[_0x980d('0x10')]);router[_0x980d('0x11')]('/',auth[_0x980d('0xb')](),controller[_0x980d('0x12')]);router['put'](_0x980d('0xf'),controller[_0x980d('0x13')]);router[_0x980d('0x14')]('/:id',auth[_0x980d('0xb')](),controller[_0x980d('0x15')]);module[_0x980d('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index f4e7917..597a570 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 _0x9805=['sequelize','exports','TEXT','medium','ENUM','out','DATE'];(function(_0x1a3d06,_0x5b0511){var _0x4b3d44=function(_0x2bea93){while(--_0x2bea93){_0x1a3d06['push'](_0x1a3d06['shift']());}};_0x4b3d44(++_0x5b0511);}(_0x9805,0x18f));var _0x5980=function(_0x13bcbb,_0x2eb915){_0x13bcbb=_0x13bcbb-0x0;var _0x457c81=_0x9805[_0x13bcbb];return _0x457c81;};'use strict';var Sequelize=require(_0x5980('0x0'));module[_0x5980('0x1')]={'body':{'type':Sequelize[_0x5980('0x2')](_0x5980('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5980('0x4')]('in',_0x5980('0x5')),'defaultValue':_0x5980('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x5980('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9ccd=['TEXT','medium','ENUM','out','DATE','STRING','sequelize'];(function(_0x3d6c73,_0x34047d){var _0x1ab97c=function(_0x34d16b){while(--_0x34d16b){_0x3d6c73['push'](_0x3d6c73['shift']());}};_0x1ab97c(++_0x34047d);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9ccd[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xd9cc('0x0'));module['exports']={'body':{'type':Sequelize[_0xd9cc('0x1')](_0xd9cc('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9cc('0x3')]('in','out'),'defaultValue':_0xd9cc('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd9cc('0x5')]},'providerName':{'type':Sequelize[_0xd9cc('0x6')]},'providerResponse':{'type':Sequelize[_0xd9cc('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index b490504..848ad10 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 _0xad36=['accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectmessage','formData','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','params','ChatMessage','find','create','body','describe','../../config/logger','chat-interactions'];(function(_0x31a576,_0x424419){var _0x30b1d3=function(_0x4710e8){while(--_0x4710e8){_0x31a576['push'](_0x31a576['shift']());}};_0x30b1d3(++_0x424419);}(_0xad36,0xa5));var _0x6ad3=function(_0x1bc286,_0x1bf518){_0x1bc286=_0x1bc286-0x0;var _0x20de66=_0xad36[_0x1bc286];return _0x20de66;};'use strict';var emlformat=require(_0x6ad3('0x0'));var rimraf=require(_0x6ad3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6ad3('0x2'));var rp=require(_0x6ad3('0x3'));var moment=require(_0x6ad3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6ad3('0x5'));var path=require(_0x6ad3('0x6'));var sox=require(_0x6ad3('0x7'));var csv=require(_0x6ad3('0x8'));var ejs=require(_0x6ad3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ad3('0xa'));var squel=require(_0x6ad3('0xb'));var crypto=require(_0x6ad3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6ad3('0xd'));var toCsv=require(_0x6ad3('0x8'));var querystring=require(_0x6ad3('0xe'));var Papa=require(_0x6ad3('0xf'));var Redis=require(_0x6ad3('0x10'));var authService=require(_0x6ad3('0x11'));var qs=require(_0x6ad3('0x12'));var as=require(_0x6ad3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6ad3('0x14'));var config=require(_0x6ad3('0x15'));var licenseUtil=require(_0x6ad3('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x6ad3('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x6ad3('0x18'))(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x6ad3('0x19'));var client=jayson[_0x6ad3('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0x6ad3('0x1a')][_0x6ad3('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x210622,_0x3ab4f6,_0x11dc00,_0x2362b4){return new BPromise(function(_0xddeb90,_0xc86acd){var _0x4c5c80=_0x2362b4||client;return _0x4c5c80[_0x6ad3('0x1c')](_0x210622,_0x11dc00)['then'](function(_0x44092f){logger[_0x6ad3('0x1d')]('ChatMessage,\x20%s,\x20%s',_0x3ab4f6,_0x6ad3('0x1e'));logger[_0x6ad3('0x1f')](_0x6ad3('0x20'),_0x3ab4f6,_0x6ad3('0x1e'),JSON[_0x6ad3('0x21')](_0x44092f));if(_0x44092f['error']){if(_0x44092f[_0x6ad3('0x22')][_0x6ad3('0x23')]===0x1f4){logger[_0x6ad3('0x22')](_0x6ad3('0x24'),_0x3ab4f6,_0x44092f['error']['message']);return _0xc86acd(_0x44092f[_0x6ad3('0x22')]['message']);}logger[_0x6ad3('0x22')](_0x6ad3('0x24'),_0x3ab4f6,_0x44092f[_0x6ad3('0x22')][_0x6ad3('0x25')]);return _0xddeb90(_0x44092f['error']['message']);}else{logger[_0x6ad3('0x1d')](_0x6ad3('0x24'),_0x3ab4f6,_0x6ad3('0x1e'));_0xddeb90(_0x44092f['result'][_0x6ad3('0x25')]);}})[_0x6ad3('0x26')](function(_0x2c354b){logger[_0x6ad3('0x22')](_0x6ad3('0x24'),_0x3ab4f6,_0x2c354b);_0xc86acd(_0x2c354b);});});}function respondWithStatusCode(_0x5395b2,_0x5f0f27){_0x5f0f27=_0x5f0f27||0xcc;return function(_0x2b7cfb){if(_0x2b7cfb){return _0x5395b2[_0x6ad3('0x27')](_0x5f0f27);}return _0x5395b2[_0x6ad3('0x28')](_0x5f0f27)[_0x6ad3('0x29')]();};}function respondWithResult(_0x1530ee,_0x4f41fa){_0x4f41fa=_0x4f41fa||0xc8;return function(_0x2fcaa7){if(_0x2fcaa7){return _0x1530ee[_0x6ad3('0x28')](_0x4f41fa)['json'](_0x2fcaa7);}};}function respondWithFilteredResult(_0x2c66b9,_0x32be81){return function(_0x560529){if(_0x560529){var _0x4dd886=typeof _0x32be81['offset']===_0x6ad3('0x2a')&&typeof _0x32be81[_0x6ad3('0x2b')]===_0x6ad3('0x2a');var _0xec3fd2=_0x560529['count'];var _0x22fb96=_0x4dd886?0x0:_0x32be81[_0x6ad3('0x2c')];var _0x42f7ee=_0x4dd886?_0x560529[_0x6ad3('0x2d')]:_0x32be81['offset']+_0x32be81[_0x6ad3('0x2b')];var _0x5b50c3;if(_0x42f7ee>=_0xec3fd2){_0x42f7ee=_0xec3fd2;_0x5b50c3=0xc8;}else{_0x5b50c3=0xce;}_0x2c66b9[_0x6ad3('0x28')](_0x5b50c3);return _0x2c66b9[_0x6ad3('0x2e')](_0x6ad3('0x2f'),_0x22fb96+'-'+_0x42f7ee+'/'+_0xec3fd2)[_0x6ad3('0x30')](_0x560529);}return null;};}function patchUpdates(_0x20c998){return function(_0x271eb3){try{jsonpatch[_0x6ad3('0x31')](_0x271eb3,_0x20c998,!![]);}catch(_0xc66f36){return BPromise[_0x6ad3('0x32')](_0xc66f36);}return _0x271eb3[_0x6ad3('0x33')]();};}function saveUpdates(_0x18cd98,_0x51eebd){return function(_0x2c2a4d){if(_0x2c2a4d){return _0x2c2a4d[_0x6ad3('0x34')](_0x18cd98)[_0x6ad3('0x35')](function(_0x3c8b67){return _0x3c8b67;});}return null;};}function removeEntity(_0x265159,_0x17d921){return function(_0x272263){if(_0x272263){return _0x272263[_0x6ad3('0x36')]()[_0x6ad3('0x35')](function(){_0x265159[_0x6ad3('0x28')](0xcc)[_0x6ad3('0x29')]();});}};}function handleEntityNotFound(_0x3ad263,_0x2a2d17){return function(_0x33dc57){if(!_0x33dc57){_0x3ad263['sendStatus'](0x194);}return _0x33dc57;};}function handleError(_0x4cd6aa,_0x106d52){_0x106d52=_0x106d52||0x1f4;return function(_0x58b400){logger[_0x6ad3('0x22')](_0x58b400[_0x6ad3('0x37')]);if(_0x58b400[_0x6ad3('0x38')]){delete _0x58b400[_0x6ad3('0x38')];}_0x4cd6aa['status'](_0x106d52)[_0x6ad3('0x39')](_0x58b400);};}exports[_0x6ad3('0x3a')]=function(_0x5ec536,_0x5656e7){var _0x312319={},_0x5e0034={},_0x506b21={'count':0x0,'rows':[]};var _0x2b6aa3=_[_0x6ad3('0x3b')](db['ChatMessage'][_0x6ad3('0x3c')],function(_0xfb9c91){return{'name':_0xfb9c91[_0x6ad3('0x3d')],'type':_0xfb9c91[_0x6ad3('0x3e')][_0x6ad3('0x3f')]};});_0x5e0034[_0x6ad3('0x40')]=_[_0x6ad3('0x3b')](_0x2b6aa3,'name');_0x5e0034[_0x6ad3('0x41')]=_[_0x6ad3('0x42')](_0x5ec536['query']);_0x5e0034[_0x6ad3('0x43')]=_[_0x6ad3('0x44')](_0x5e0034[_0x6ad3('0x40')],_0x5e0034['query']);_0x312319[_0x6ad3('0x45')]=_[_0x6ad3('0x44')](_0x5e0034['model'],qs['fields'](_0x5ec536['query'][_0x6ad3('0x46')]));_0x312319[_0x6ad3('0x45')]=_0x312319[_0x6ad3('0x45')][_0x6ad3('0x47')]?_0x312319[_0x6ad3('0x45')]:_0x5e0034[_0x6ad3('0x40')];if(!_0x5ec536['query']['hasOwnProperty'](_0x6ad3('0x48'))){_0x312319[_0x6ad3('0x2b')]=qs[_0x6ad3('0x2b')](_0x5ec536[_0x6ad3('0x41')][_0x6ad3('0x2b')]);_0x312319[_0x6ad3('0x2c')]=qs[_0x6ad3('0x2c')](_0x5ec536['query']['offset']);}_0x312319[_0x6ad3('0x49')]=qs[_0x6ad3('0x4a')](_0x5ec536[_0x6ad3('0x41')][_0x6ad3('0x4a')]);_0x312319[_0x6ad3('0x4b')]=qs[_0x6ad3('0x43')](_['pick'](_0x5ec536['query'],_0x5e0034['filters']),_0x2b6aa3);if(_0x5ec536[_0x6ad3('0x41')]['filter']){_0x312319[_0x6ad3('0x4b')]=_[_0x6ad3('0x4c')](_0x312319[_0x6ad3('0x4b')],{'$or':_[_0x6ad3('0x3b')](_0x2b6aa3,function(_0x12e05d){if(_0x12e05d[_0x6ad3('0x3e')]!==_0x6ad3('0x4d')){var _0x5f2d2f={};_0x5f2d2f[_0x12e05d['name']]={'$like':'%'+_0x5ec536['query'][_0x6ad3('0x4e')]+'%'};return _0x5f2d2f;}})});}_0x312319=_[_0x6ad3('0x4c')]({},_0x312319,_0x5ec536[_0x6ad3('0x4f')]);var _0x56ee25={'where':_0x312319[_0x6ad3('0x4b')]};return db['ChatMessage']['count'](_0x56ee25)[_0x6ad3('0x35')](function(_0x3b66da){_0x506b21['count']=_0x3b66da;if(_0x5ec536['query']['includeAll']){_0x312319[_0x6ad3('0x50')]=[{'all':!![]}];}return db['ChatMessage'][_0x6ad3('0x51')](_0x312319);})[_0x6ad3('0x35')](function(_0x57bb7a){_0x506b21[_0x6ad3('0x52')]=_0x57bb7a;return _0x506b21;})[_0x6ad3('0x35')](respondWithFilteredResult(_0x5656e7,_0x312319))[_0x6ad3('0x26')](handleError(_0x5656e7,null));};exports['show']=function(_0xcc153b,_0x424765){var _0x5a8252={'raw':!![],'where':{'id':_0xcc153b[_0x6ad3('0x53')]['id']}},_0xd7f8d5={};_0xd7f8d5['model']=_[_0x6ad3('0x42')](db[_0x6ad3('0x54')]['rawAttributes']);_0xd7f8d5[_0x6ad3('0x41')]=_['keys'](_0xcc153b['query']);_0xd7f8d5[_0x6ad3('0x43')]=_[_0x6ad3('0x44')](_0xd7f8d5[_0x6ad3('0x40')],_0xd7f8d5[_0x6ad3('0x41')]);_0x5a8252['attributes']=_[_0x6ad3('0x44')](_0xd7f8d5['model'],qs[_0x6ad3('0x46')](_0xcc153b[_0x6ad3('0x41')][_0x6ad3('0x46')]));_0x5a8252[_0x6ad3('0x45')]=_0x5a8252['attributes'][_0x6ad3('0x47')]?_0x5a8252[_0x6ad3('0x45')]:_0xd7f8d5[_0x6ad3('0x40')];if(_0xcc153b[_0x6ad3('0x41')]['includeAll']){_0x5a8252[_0x6ad3('0x50')]=[{'all':!![]}];}_0x5a8252=_['merge']({},_0x5a8252,_0xcc153b[_0x6ad3('0x4f')]);return db[_0x6ad3('0x54')][_0x6ad3('0x55')](_0x5a8252)['then'](handleEntityNotFound(_0x424765,null))[_0x6ad3('0x35')](respondWithResult(_0x424765,null))[_0x6ad3('0x26')](handleError(_0x424765,null));};exports[_0x6ad3('0x56')]=function(_0x1abd84,_0x4090c9){return db[_0x6ad3('0x54')][_0x6ad3('0x56')](_0x1abd84[_0x6ad3('0x57')],{})[_0x6ad3('0x35')](respondWithResult(_0x4090c9,0xc9))[_0x6ad3('0x26')](handleError(_0x4090c9,null));};exports[_0x6ad3('0x34')]=function(_0x505d89,_0x25c4a1){if(_0x505d89[_0x6ad3('0x57')]['id']){delete _0x505d89[_0x6ad3('0x57')]['id'];}return db[_0x6ad3('0x54')][_0x6ad3('0x55')]({'where':{'id':_0x505d89[_0x6ad3('0x53')]['id']}})[_0x6ad3('0x35')](handleEntityNotFound(_0x25c4a1,null))[_0x6ad3('0x35')](saveUpdates(_0x505d89[_0x6ad3('0x57')],null))[_0x6ad3('0x35')](respondWithResult(_0x25c4a1,null))[_0x6ad3('0x26')](handleError(_0x25c4a1,null));};exports[_0x6ad3('0x36')]=function(_0x411557,_0x68448a){return db[_0x6ad3('0x54')]['find']({'where':{'id':_0x411557[_0x6ad3('0x53')]['id']}})[_0x6ad3('0x35')](handleEntityNotFound(_0x68448a,null))[_0x6ad3('0x35')](removeEntity(_0x68448a,null))[_0x6ad3('0x26')](handleError(_0x68448a,null));};exports[_0x6ad3('0x58')]=function(_0x199674,_0x57f07d){return db[_0x6ad3('0x54')][_0x6ad3('0x58')]()['then'](respondWithResult(_0x57f07d,null))[_0x6ad3('0x26')](handleError(_0x57f07d,null));};var interaction_log=require(_0x6ad3('0x59'))(_0x6ad3('0x5a'));exports[_0x6ad3('0x5b')]=function(_0x2d6037,_0x455aa5,_0x2206ed){var _0x24daf4={'agent':{},'channel':_0x6ad3('0x5c')};if(_0x2d6037[_0x6ad3('0x57')]['id']){delete _0x2d6037[_0x6ad3('0x57')]['id'];}_0x2d6037[_0x6ad3('0x57')]['read']=!![];_0x2d6037[_0x6ad3('0x57')][_0x6ad3('0x5d')]=moment()[_0x6ad3('0x5e')](_0x6ad3('0x5f'));_0x2d6037[_0x6ad3('0x57')][_0x6ad3('0x60')]=_0x2d6037[_0x6ad3('0x57')][_0x6ad3('0x60')]||_0x2d6037[_0x6ad3('0x61')]['id'];_0x24daf4['agent']['id']=_0x2d6037[_0x6ad3('0x57')][_0x6ad3('0x60')];return db['ChatMessage'][_0x6ad3('0x55')]({'where':{'id':_0x2d6037[_0x6ad3('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x455aa5,null))[_0x6ad3('0x35')](saveUpdates(_0x2d6037[_0x6ad3('0x57')],null))['then'](function(_0x334001){if(_0x334001){_0x24daf4[_0x6ad3('0x25')]=_0x334001['get']({'plain':!![]});return db[_0x6ad3('0x62')][_0x6ad3('0x55')]({'where':{'id':_0x334001['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x455aa5,null))[_0x6ad3('0x35')](function(_0x87a964){if(_0x87a964){return _0x87a964[_0x6ad3('0x34')]({'UserId':_0x2d6037[_0x6ad3('0x57')][_0x6ad3('0x60')],'read1stAt':_['isNil'](_0x87a964[_0x6ad3('0x63')])?moment()['format'](_0x6ad3('0x5f')):undefined});}return null;})[_0x6ad3('0x35')](function(_0x2d4593){if(_0x2d4593){_0x24daf4[_0x6ad3('0x64')]=_0x2d4593[_0x6ad3('0x65')]({'plain':!![]});interaction_log[_0x6ad3('0x1d')](_0x6ad3('0x66'),_0x2d6037['user']['id'],_0x2d6037[_0x6ad3('0x61')][_0x6ad3('0x38')],_0x2d6037[_0x6ad3('0x61')][_0x6ad3('0x67')],_0x24daf4[_0x6ad3('0x64')]['id'],_0x2d6037[_0x6ad3('0x57')]?JSON[_0x6ad3('0x21')](_0x2d6037[_0x6ad3('0x57')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x24daf4);}return null;})[_0x6ad3('0x35')](function(_0x4abed8){var _0x55b089='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4abed8[_0x6ad3('0x25')][_0x6ad3('0x68')];return db[_0x6ad3('0x69')][_0x6ad3('0x41')](_0x55b089,{'type':db[_0x6ad3('0x6a')][_0x6ad3('0x6b')]['SELECT'],'raw':!![]})[_0x6ad3('0x35')](function(_0x3b5a88){return _0x3b5a88;});})[_0x6ad3('0x35')](function(_0x13173a){if(_0x13173a){_0x24daf4[_0x6ad3('0x25')][_0x6ad3('0x6c')]=_0x13173a[0x0];if(!_0x2d6037[_0x6ad3('0x57')][_0x6ad3('0x60')])return;return db[_0x6ad3('0x6d')]['find']({'where':{'id':_0x2d6037[_0x6ad3('0x57')][_0x6ad3('0x60')],'role':_0x6ad3('0x6e')},'attributes':['id',_0x6ad3('0x38'),_0x6ad3('0x6f'),_0x6ad3('0x70'),_0x6ad3('0x71')],'raw':!![]});}return null;})[_0x6ad3('0x35')](function(_0x3150cd){if(!_0x3150cd)return null;_0x24daf4[_0x6ad3('0x25')][_0x6ad3('0x6e')]=_0x3150cd;return _0x24daf4;})[_0x6ad3('0x35')](function(_0x5b03f9){if(_0x5b03f9){if(_0x2d6037['body'][_0x6ad3('0x72')]){_0x24daf4[_0x6ad3('0x25')][_0x6ad3('0x73')]=util[_0x6ad3('0x5e')](_0x6ad3('0x74'),_0x2d6037[_0x6ad3('0x61')][_0x6ad3('0x38')]);_0x24daf4['message'][_0x6ad3('0x75')]=_0x24daf4[_0x6ad3('0x75')];_0x24daf4[_0x6ad3('0x25')][_0x6ad3('0x76')]=_0x24daf4['channel'];_0x24daf4['message'][_0x6ad3('0x77')]=_0x6ad3('0x5b');return respondWithRpcPromise(_0x6ad3('0x78'),_0x6ad3('0x78'),{'event':_0x6ad3('0x79'),'message':_[_0x6ad3('0x4c')](_0x24daf4[_0x6ad3('0x25')],JSON['parse'](_0x24daf4['interaction']['formData']))},client9002)[_0x6ad3('0x35')](function(){return _0x24daf4;});}return _0x24daf4;}return null;})[_0x6ad3('0x35')](respondWithResult(_0x455aa5,null))[_0x6ad3('0x26')](handleError(_0x455aa5,null));};var interaction_log=require(_0x6ad3('0x59'))(_0x6ad3('0x5a'));exports['reject']=function(_0x55b210,_0x525b65,_0x53518a){var _0x5cd3fd={'agent':{},'channel':_0x6ad3('0x5c')};if(_0x55b210[_0x6ad3('0x57')]['id']){delete _0x55b210[_0x6ad3('0x57')]['id'];}_0x55b210[_0x6ad3('0x57')]['UserId']=_0x55b210[_0x6ad3('0x57')]['UserId']||_0x55b210['user']['id'];_0x5cd3fd['agent']['id']=_0x55b210['body'][_0x6ad3('0x60')];return db[_0x6ad3('0x54')][_0x6ad3('0x55')]({'where':{'id':_0x55b210[_0x6ad3('0x53')]['id'],'UserId':null}})[_0x6ad3('0x35')](handleEntityNotFound(_0x525b65,null))[_0x6ad3('0x35')](function(_0x55089e){if(_0x55089e){_0x5cd3fd[_0x6ad3('0x25')]=_0x55089e[_0x6ad3('0x65')]({'plain':!![]});return db['ChatInteraction'][_0x6ad3('0x55')]({'where':{'id':_0x55089e[_0x6ad3('0x7a')]}});}return null;})[_0x6ad3('0x35')](handleEntityNotFound(_0x525b65,null))['then'](function(_0x6e2470){if(_0x6e2470){_0x5cd3fd[_0x6ad3('0x64')]=_0x6e2470[_0x6ad3('0x65')]({'plain':!![]});interaction_log[_0x6ad3('0x1d')](_0x6ad3('0x7b'),_0x55b210[_0x6ad3('0x61')]['id'],_0x55b210[_0x6ad3('0x61')]['name'],_0x55b210[_0x6ad3('0x61')][_0x6ad3('0x67')],_0x5cd3fd[_0x6ad3('0x64')]['id'],_0x55b210[_0x6ad3('0x57')]?JSON[_0x6ad3('0x21')](_0x55b210['body']):_0x6ad3('0x7c'));return respondWithRpcPromise(_0x6ad3('0x7d'),'rejectMessage',_0x5cd3fd);}return null;})[_0x6ad3('0x35')](function(_0x52a61c){var _0x3b450e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x52a61c[_0x6ad3('0x25')][_0x6ad3('0x68')];return db['sequelize'][_0x6ad3('0x41')](_0x3b450e,{'type':db[_0x6ad3('0x6a')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x18b01b){return _0x18b01b;});})[_0x6ad3('0x35')](function(_0x3d2a5a){if(_0x3d2a5a){_0x5cd3fd[_0x6ad3('0x25')][_0x6ad3('0x6c')]=_0x3d2a5a[0x0];if(!_0x55b210[_0x6ad3('0x57')][_0x6ad3('0x60')])return;return db[_0x6ad3('0x6d')]['find']({'where':{'id':_0x55b210['body'][_0x6ad3('0x60')],'role':_0x6ad3('0x6e')},'attributes':['id',_0x6ad3('0x38'),_0x6ad3('0x6f'),_0x6ad3('0x70'),_0x6ad3('0x71')],'raw':!![]});}return null;})[_0x6ad3('0x35')](function(_0x1923b4){if(!_0x1923b4)return null;_0x5cd3fd['message'][_0x6ad3('0x6e')]=_0x1923b4;return _0x5cd3fd;})[_0x6ad3('0x35')](function(_0x267834){if(_0x267834){_0x267834[_0x6ad3('0x25')]['interface']=util[_0x6ad3('0x5e')](_0x6ad3('0x74'),_0x55b210[_0x6ad3('0x61')][_0x6ad3('0x38')]);_0x267834['message']['channel']=_0x5cd3fd[_0x6ad3('0x75')];_0x267834[_0x6ad3('0x25')][_0x6ad3('0x76')]=_0x5cd3fd[_0x6ad3('0x75')];_0x267834[_0x6ad3('0x25')][_0x6ad3('0x77')]=_0x6ad3('0x32');respondWithRpcPromise('EventManager',_0x6ad3('0x78'),{'event':_0x6ad3('0x7e'),'message':_[_0x6ad3('0x4c')](_0x5cd3fd[_0x6ad3('0x25')],JSON['parse'](_0x5cd3fd['interaction'][_0x6ad3('0x7f')]))},client9002);return _0x5cd3fd;}return null;})[_0x6ad3('0x35')](respondWithResult(_0x525b65,null))[_0x6ad3('0x26')](handleError(_0x525b65,null));}; \ No newline at end of file +var _0xd16a=['result','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','reject','save','destroy','stack','name','map','ChatMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','show','rawAttributes','includeAll','include','find','catch','create','body','update','params','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','ChatInteractionId','isNil','interaction','get','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','agent','internal','manual','SIP/%s','channel','event','EventManager','formData','ChatInteraction','null','RejectMessage','rejectMessage','ContactId','Sequelize','email','interface','motionChannel','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x47c825,_0x5355be){var _0x12f621=function(_0x28072c){while(--_0x28072c){_0x47c825['push'](_0x47c825['shift']());}};_0x12f621(++_0x5355be);}(_0xd16a,0x167));var _0xad16=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd16a[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xad16('0x0'));var rimraf=require(_0xad16('0x1'));var zipdir=require(_0xad16('0x2'));var jsonpatch=require(_0xad16('0x3'));var rp=require(_0xad16('0x4'));var moment=require('moment');var BPromise=require(_0xad16('0x5'));var Mustache=require(_0xad16('0x6'));var util=require(_0xad16('0x7'));var path=require(_0xad16('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad16('0x9'));var _=require(_0xad16('0xa'));var squel=require(_0xad16('0xb'));var crypto=require(_0xad16('0xc'));var jsforce=require(_0xad16('0xd'));var deskjs=require(_0xad16('0xe'));var toCsv=require(_0xad16('0xf'));var querystring=require(_0xad16('0x10'));var Papa=require(_0xad16('0x11'));var Redis=require('ioredis');var authService=require(_0xad16('0x12'));var qs=require(_0xad16('0x13'));var as=require(_0xad16('0x14'));var hardwareService=require(_0xad16('0x15'));var logger=require(_0xad16('0x16'))('api');var utils=require(_0xad16('0x17'));var config=require(_0xad16('0x18'));var licenseUtil=require(_0xad16('0x19'));var db=require(_0xad16('0x1a'))['db'];config[_0xad16('0x1b')]=_['defaults'](config[_0xad16('0x1b')],{'host':_0xad16('0x1c'),'port':0x18eb});var socket=require(_0xad16('0x1d'))(new Redis(config['redis']));require(_0xad16('0x1e'))[_0xad16('0x1f')](socket);var jayson=require(_0xad16('0x20'));var client=jayson[_0xad16('0x21')][_0xad16('0x22')]({'port':0x232c});var client9002=jayson[_0xad16('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36ae2f,_0x553be1,_0x5a5ad1,_0x35982e){return new BPromise(function(_0x254843,_0x1a61d0){var _0x2f5c4f=_0x35982e||client;return _0x2f5c4f[_0xad16('0x23')](_0x36ae2f,_0x5a5ad1)[_0xad16('0x24')](function(_0x1eb8d3){logger[_0xad16('0x25')](_0xad16('0x26'),_0x553be1,_0xad16('0x27'));logger[_0xad16('0x28')](_0xad16('0x29'),_0x553be1,_0xad16('0x27'),JSON[_0xad16('0x2a')](_0x1eb8d3));if(_0x1eb8d3[_0xad16('0x2b')]){if(_0x1eb8d3[_0xad16('0x2b')][_0xad16('0x2c')]===0x1f4){logger['error'](_0xad16('0x26'),_0x553be1,_0x1eb8d3[_0xad16('0x2b')][_0xad16('0x2d')]);return _0x1a61d0(_0x1eb8d3[_0xad16('0x2b')][_0xad16('0x2d')]);}logger[_0xad16('0x2b')](_0xad16('0x26'),_0x553be1,_0x1eb8d3['error'][_0xad16('0x2d')]);return _0x254843(_0x1eb8d3['error'][_0xad16('0x2d')]);}else{logger['info'](_0xad16('0x26'),_0x553be1,_0xad16('0x27'));_0x254843(_0x1eb8d3[_0xad16('0x2e')][_0xad16('0x2d')]);}})['catch'](function(_0xd93752){logger[_0xad16('0x2b')](_0xad16('0x26'),_0x553be1,_0xd93752);_0x1a61d0(_0xd93752);});});}function respondWithStatusCode(_0x1a227f,_0x772d46){_0x772d46=_0x772d46||0xcc;return function(_0x4aa910){if(_0x4aa910){return _0x1a227f[_0xad16('0x2f')](_0x772d46);}return _0x1a227f['status'](_0x772d46)[_0xad16('0x30')]();};}function respondWithResult(_0x34f925,_0x2c097c){_0x2c097c=_0x2c097c||0xc8;return function(_0x130d76){if(_0x130d76){return _0x34f925['status'](_0x2c097c)[_0xad16('0x31')](_0x130d76);}};}function respondWithFilteredResult(_0x530b25,_0xceb1b7){return function(_0x24929a){if(_0x24929a){var _0x22144c=typeof _0xceb1b7[_0xad16('0x32')]==='undefined'&&typeof _0xceb1b7[_0xad16('0x33')]==='undefined';var _0x1140b0=_0x24929a[_0xad16('0x34')];var _0x48bd4f=_0x22144c?0x0:_0xceb1b7['offset'];var _0x39f328=_0x22144c?_0x24929a[_0xad16('0x34')]:_0xceb1b7[_0xad16('0x32')]+_0xceb1b7[_0xad16('0x33')];var _0x55ef03;if(_0x39f328>=_0x1140b0){_0x39f328=_0x1140b0;_0x55ef03=0xc8;}else{_0x55ef03=0xce;}_0x530b25[_0xad16('0x35')](_0x55ef03);return _0x530b25[_0xad16('0x36')](_0xad16('0x37'),_0x48bd4f+'-'+_0x39f328+'/'+_0x1140b0)[_0xad16('0x31')](_0x24929a);}return null;};}function patchUpdates(_0x1d5787){return function(_0x5e4686){try{jsonpatch[_0xad16('0x38')](_0x5e4686,_0x1d5787,!![]);}catch(_0x10043b){return BPromise[_0xad16('0x39')](_0x10043b);}return _0x5e4686[_0xad16('0x3a')]();};}function saveUpdates(_0xbaafd6,_0x58ac6b){return function(_0x487662){if(_0x487662){return _0x487662['update'](_0xbaafd6)[_0xad16('0x24')](function(_0x52c50f){return _0x52c50f;});}return null;};}function removeEntity(_0xfb74f7,_0x58de90){return function(_0x3053f3){if(_0x3053f3){return _0x3053f3[_0xad16('0x3b')]()[_0xad16('0x24')](function(){_0xfb74f7['status'](0xcc)[_0xad16('0x30')]();});}};}function handleEntityNotFound(_0x44bd09,_0x286210){return function(_0x444087){if(!_0x444087){_0x44bd09[_0xad16('0x2f')](0x194);}return _0x444087;};}function handleError(_0x543d93,_0x28897a){_0x28897a=_0x28897a||0x1f4;return function(_0x2f390e){logger[_0xad16('0x2b')](_0x2f390e[_0xad16('0x3c')]);if(_0x2f390e[_0xad16('0x3d')]){delete _0x2f390e[_0xad16('0x3d')];}_0x543d93['status'](_0x28897a)['send'](_0x2f390e);};}exports['index']=function(_0x3ee781,_0x1a7a24){var _0x15125e={},_0x41381d={},_0x57a700={'count':0x0,'rows':[]};var _0x53bf1e=_[_0xad16('0x3e')](db[_0xad16('0x3f')]['rawAttributes'],function(_0x38ec88){return{'name':_0x38ec88[_0xad16('0x40')],'type':_0x38ec88[_0xad16('0x41')][_0xad16('0x42')]};});_0x41381d[_0xad16('0x43')]=_[_0xad16('0x3e')](_0x53bf1e,_0xad16('0x3d'));_0x41381d[_0xad16('0x44')]=_[_0xad16('0x45')](_0x3ee781['query']);_0x41381d[_0xad16('0x46')]=_[_0xad16('0x47')](_0x41381d[_0xad16('0x43')],_0x41381d['query']);_0x15125e[_0xad16('0x48')]=_[_0xad16('0x47')](_0x41381d['model'],qs['fields'](_0x3ee781[_0xad16('0x44')][_0xad16('0x49')]));_0x15125e[_0xad16('0x48')]=_0x15125e['attributes'][_0xad16('0x4a')]?_0x15125e[_0xad16('0x48')]:_0x41381d[_0xad16('0x43')];if(!_0x3ee781[_0xad16('0x44')]['hasOwnProperty']('nolimit')){_0x15125e[_0xad16('0x33')]=qs[_0xad16('0x33')](_0x3ee781[_0xad16('0x44')]['limit']);_0x15125e[_0xad16('0x32')]=qs[_0xad16('0x32')](_0x3ee781[_0xad16('0x44')][_0xad16('0x32')]);}_0x15125e[_0xad16('0x4b')]=qs[_0xad16('0x4c')](_0x3ee781[_0xad16('0x44')][_0xad16('0x4c')]);_0x15125e[_0xad16('0x4d')]=qs[_0xad16('0x46')](_[_0xad16('0x4e')](_0x3ee781[_0xad16('0x44')],_0x41381d[_0xad16('0x46')]),_0x53bf1e);if(_0x3ee781['query'][_0xad16('0x4f')]){_0x15125e[_0xad16('0x4d')]=_[_0xad16('0x50')](_0x15125e['where'],{'$or':_[_0xad16('0x3e')](_0x53bf1e,function(_0x3b8e2b){if(_0x3b8e2b[_0xad16('0x41')]!==_0xad16('0x51')){var _0x223f2a={};_0x223f2a[_0x3b8e2b[_0xad16('0x3d')]]={'$like':'%'+_0x3ee781[_0xad16('0x44')][_0xad16('0x4f')]+'%'};return _0x223f2a;}})});}_0x15125e=_[_0xad16('0x50')]({},_0x15125e,_0x3ee781[_0xad16('0x52')]);var _0xf10d7={'where':_0x15125e[_0xad16('0x4d')]};return db[_0xad16('0x3f')][_0xad16('0x34')](_0xf10d7)[_0xad16('0x24')](function(_0x114f1f){_0x57a700[_0xad16('0x34')]=_0x114f1f;if(_0x3ee781[_0xad16('0x44')]['includeAll']){_0x15125e['include']=[{'all':!![]}];}return db[_0xad16('0x3f')][_0xad16('0x53')](_0x15125e);})[_0xad16('0x24')](function(_0x35e284){_0x57a700['rows']=_0x35e284;return _0x57a700;})['then'](respondWithFilteredResult(_0x1a7a24,_0x15125e))['catch'](handleError(_0x1a7a24,null));};exports[_0xad16('0x54')]=function(_0x16140c,_0x52d98d){var _0x5ced46={'raw':!![],'where':{'id':_0x16140c['params']['id']}},_0x5bda1f={};_0x5bda1f['model']=_[_0xad16('0x45')](db['ChatMessage'][_0xad16('0x55')]);_0x5bda1f[_0xad16('0x44')]=_['keys'](_0x16140c[_0xad16('0x44')]);_0x5bda1f['filters']=_[_0xad16('0x47')](_0x5bda1f[_0xad16('0x43')],_0x5bda1f[_0xad16('0x44')]);_0x5ced46[_0xad16('0x48')]=_[_0xad16('0x47')](_0x5bda1f[_0xad16('0x43')],qs[_0xad16('0x49')](_0x16140c['query'][_0xad16('0x49')]));_0x5ced46[_0xad16('0x48')]=_0x5ced46[_0xad16('0x48')]['length']?_0x5ced46[_0xad16('0x48')]:_0x5bda1f[_0xad16('0x43')];if(_0x16140c['query'][_0xad16('0x56')]){_0x5ced46[_0xad16('0x57')]=[{'all':!![]}];}_0x5ced46=_[_0xad16('0x50')]({},_0x5ced46,_0x16140c[_0xad16('0x52')]);return db[_0xad16('0x3f')][_0xad16('0x58')](_0x5ced46)['then'](handleEntityNotFound(_0x52d98d,null))['then'](respondWithResult(_0x52d98d,null))[_0xad16('0x59')](handleError(_0x52d98d,null));};exports[_0xad16('0x5a')]=function(_0xb25591,_0x39bb14){return db['ChatMessage'][_0xad16('0x5a')](_0xb25591[_0xad16('0x5b')],{})[_0xad16('0x24')](respondWithResult(_0x39bb14,0xc9))[_0xad16('0x59')](handleError(_0x39bb14,null));};exports[_0xad16('0x5c')]=function(_0x3d8777,_0x86da87){if(_0x3d8777['body']['id']){delete _0x3d8777[_0xad16('0x5b')]['id'];}return db[_0xad16('0x3f')][_0xad16('0x58')]({'where':{'id':_0x3d8777[_0xad16('0x5d')]['id']}})[_0xad16('0x24')](handleEntityNotFound(_0x86da87,null))['then'](saveUpdates(_0x3d8777['body'],null))[_0xad16('0x24')](respondWithResult(_0x86da87,null))[_0xad16('0x59')](handleError(_0x86da87,null));};exports[_0xad16('0x3b')]=function(_0x45f280,_0x2db1cb){return db[_0xad16('0x3f')][_0xad16('0x58')]({'where':{'id':_0x45f280['params']['id']}})[_0xad16('0x24')](handleEntityNotFound(_0x2db1cb,null))['then'](removeEntity(_0x2db1cb,null))[_0xad16('0x59')](handleError(_0x2db1cb,null));};exports[_0xad16('0x5e')]=function(_0x51d845,_0x1a1607){return db[_0xad16('0x3f')]['describe']()[_0xad16('0x24')](respondWithResult(_0x1a1607,null))[_0xad16('0x59')](handleError(_0x1a1607,null));};var interaction_log=require(_0xad16('0x16'))(_0xad16('0x5f'));exports[_0xad16('0x60')]=function(_0x553566,_0x40fc60,_0x467333){var _0x2a47b2={'agent':{},'channel':_0xad16('0x61')};if(_0x553566[_0xad16('0x5b')]['id']){delete _0x553566[_0xad16('0x5b')]['id'];}_0x553566[_0xad16('0x5b')][_0xad16('0x62')]=!![];_0x553566[_0xad16('0x5b')]['readAt']=moment()[_0xad16('0x63')](_0xad16('0x64'));_0x553566['body'][_0xad16('0x65')]=_0x553566[_0xad16('0x5b')]['UserId']||_0x553566['user']['id'];_0x2a47b2['agent']['id']=_0x553566[_0xad16('0x5b')][_0xad16('0x65')];return db[_0xad16('0x3f')]['find']({'where':{'id':_0x553566[_0xad16('0x5d')]['id'],'UserId':null}})[_0xad16('0x24')](handleEntityNotFound(_0x40fc60,null))[_0xad16('0x24')](saveUpdates(_0x553566['body'],null))[_0xad16('0x24')](function(_0x328e03){if(_0x328e03){_0x2a47b2[_0xad16('0x2d')]=_0x328e03['get']({'plain':!![]});return db['ChatInteraction'][_0xad16('0x58')]({'where':{'id':_0x328e03[_0xad16('0x66')]}});}return null;})[_0xad16('0x24')](handleEntityNotFound(_0x40fc60,null))[_0xad16('0x24')](function(_0x154037){if(_0x154037){return _0x154037['update']({'UserId':_0x553566[_0xad16('0x5b')][_0xad16('0x65')],'read1stAt':_[_0xad16('0x67')](_0x154037['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x120ab0){if(_0x120ab0){_0x2a47b2[_0xad16('0x68')]=_0x120ab0[_0xad16('0x69')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x553566['user']['id'],_0x553566[_0xad16('0x6a')][_0xad16('0x3d')],_0x553566[_0xad16('0x6a')][_0xad16('0x6b')],_0x2a47b2[_0xad16('0x68')]['id'],_0x553566[_0xad16('0x5b')]?JSON[_0xad16('0x2a')](_0x553566[_0xad16('0x5b')]):'null');return respondWithRpcPromise(_0xad16('0x6c'),_0xad16('0x6d'),_0x2a47b2);}return null;})[_0xad16('0x24')](function(_0x57c96b){var _0x11834d=_0xad16('0x6e')+_0x57c96b[_0xad16('0x2d')]['ContactId'];return db[_0xad16('0x6f')][_0xad16('0x44')](_0x11834d,{'type':db['Sequelize'][_0xad16('0x70')][_0xad16('0x71')],'raw':!![]})[_0xad16('0x24')](function(_0x1e41fd){return _0x1e41fd;});})['then'](function(_0x560e94){if(_0x560e94){_0x2a47b2['message'][_0xad16('0x72')]=_0x560e94[0x0];if(!_0x553566[_0xad16('0x5b')][_0xad16('0x65')])return;return db[_0xad16('0x73')][_0xad16('0x58')]({'where':{'id':_0x553566[_0xad16('0x5b')][_0xad16('0x65')],'role':_0xad16('0x74')},'attributes':['id',_0xad16('0x3d'),'fullname','email',_0xad16('0x75')],'raw':!![]});}return null;})['then'](function(_0x7b5a19){if(!_0x7b5a19)return null;_0x2a47b2[_0xad16('0x2d')][_0xad16('0x74')]=_0x7b5a19;return _0x2a47b2;})[_0xad16('0x24')](function(_0x4a741d){if(_0x4a741d){if(_0x553566[_0xad16('0x5b')][_0xad16('0x76')]){_0x2a47b2[_0xad16('0x2d')]['interface']=util[_0xad16('0x63')](_0xad16('0x77'),_0x553566[_0xad16('0x6a')][_0xad16('0x3d')]);_0x2a47b2['message']['channel']=_0x2a47b2['channel'];_0x2a47b2[_0xad16('0x2d')]['motionChannel']=_0x2a47b2[_0xad16('0x78')];_0x2a47b2['message'][_0xad16('0x79')]='accept';return respondWithRpcPromise(_0xad16('0x7a'),'EventManager',{'event':'acceptmessage','message':_['merge'](_0x2a47b2[_0xad16('0x2d')],JSON['parse'](_0x2a47b2[_0xad16('0x68')][_0xad16('0x7b')]))},client9002)[_0xad16('0x24')](function(){return _0x2a47b2;});}return _0x2a47b2;}return null;})['then'](respondWithResult(_0x40fc60,null))[_0xad16('0x59')](handleError(_0x40fc60,null));};var interaction_log=require(_0xad16('0x16'))(_0xad16('0x5f'));exports[_0xad16('0x39')]=function(_0x1a7509,_0x55adfb,_0xadd3e9){var _0x3894b8={'agent':{},'channel':_0xad16('0x61')};if(_0x1a7509['body']['id']){delete _0x1a7509[_0xad16('0x5b')]['id'];}_0x1a7509['body']['UserId']=_0x1a7509['body']['UserId']||_0x1a7509[_0xad16('0x6a')]['id'];_0x3894b8[_0xad16('0x74')]['id']=_0x1a7509[_0xad16('0x5b')]['UserId'];return db[_0xad16('0x3f')]['find']({'where':{'id':_0x1a7509[_0xad16('0x5d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x55adfb,null))[_0xad16('0x24')](function(_0x1a0977){if(_0x1a0977){_0x3894b8[_0xad16('0x2d')]=_0x1a0977[_0xad16('0x69')]({'plain':!![]});return db[_0xad16('0x7c')]['find']({'where':{'id':_0x1a0977[_0xad16('0x66')]}});}return null;})[_0xad16('0x24')](handleEntityNotFound(_0x55adfb,null))[_0xad16('0x24')](function(_0x556db3){if(_0x556db3){_0x3894b8[_0xad16('0x68')]=_0x556db3[_0xad16('0x69')]({'plain':!![]});interaction_log[_0xad16('0x25')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1a7509['user']['id'],_0x1a7509[_0xad16('0x6a')][_0xad16('0x3d')],_0x1a7509[_0xad16('0x6a')][_0xad16('0x6b')],_0x3894b8['interaction']['id'],_0x1a7509[_0xad16('0x5b')]?JSON[_0xad16('0x2a')](_0x1a7509[_0xad16('0x5b')]):_0xad16('0x7d'));return respondWithRpcPromise(_0xad16('0x7e'),_0xad16('0x7f'),_0x3894b8);}return null;})[_0xad16('0x24')](function(_0x1a1c51){var _0x419fb5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1a1c51['message'][_0xad16('0x80')];return db['sequelize'][_0xad16('0x44')](_0x419fb5,{'type':db[_0xad16('0x81')][_0xad16('0x70')]['SELECT'],'raw':!![]})[_0xad16('0x24')](function(_0x567afc){return _0x567afc;});})['then'](function(_0x5704eb){if(_0x5704eb){_0x3894b8[_0xad16('0x2d')]['contact']=_0x5704eb[0x0];if(!_0x1a7509[_0xad16('0x5b')][_0xad16('0x65')])return;return db[_0xad16('0x73')][_0xad16('0x58')]({'where':{'id':_0x1a7509[_0xad16('0x5b')]['UserId'],'role':'agent'},'attributes':['id',_0xad16('0x3d'),'fullname',_0xad16('0x82'),'internal'],'raw':!![]});}return null;})['then'](function(_0x1ef7d7){if(!_0x1ef7d7)return null;_0x3894b8[_0xad16('0x2d')][_0xad16('0x74')]=_0x1ef7d7;return _0x3894b8;})['then'](function(_0x329e67){if(_0x329e67){_0x329e67[_0xad16('0x2d')][_0xad16('0x83')]=util[_0xad16('0x63')](_0xad16('0x77'),_0x1a7509[_0xad16('0x6a')][_0xad16('0x3d')]);_0x329e67[_0xad16('0x2d')][_0xad16('0x78')]=_0x3894b8[_0xad16('0x78')];_0x329e67[_0xad16('0x2d')][_0xad16('0x84')]=_0x3894b8[_0xad16('0x78')];_0x329e67[_0xad16('0x2d')][_0xad16('0x79')]=_0xad16('0x39');respondWithRpcPromise(_0xad16('0x7a'),'EventManager',{'event':_0xad16('0x85'),'message':_[_0xad16('0x50')](_0x3894b8['message'],JSON[_0xad16('0x86')](_0x3894b8[_0xad16('0x68')][_0xad16('0x7b')]))},client9002);return _0x3894b8;}return null;})[_0xad16('0x24')](respondWithResult(_0x55adfb,null))[_0xad16('0x59')](handleError(_0x55adfb,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index ea2025b..204d981 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 _0x6a2b=['exports','../../mysqldb','ChatMessage','setMaxListeners','update','remove','hook'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x6a2b,0x19e));var _0xb6a2=function(_0x55a41c,_0x2ced02){_0x55a41c=_0x55a41c-0x0;var _0x278b73=_0x6a2b[_0x55a41c];return _0x278b73;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xb6a2('0x0'))['db'][_0xb6a2('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb6a2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb6a2('0x3'),'afterDestroy':_0xb6a2('0x4')};function emitEvent(_0x17d345){return function(_0x5d85d9,_0x33a583,_0x47bd30){ChatMessageEvents['emit'](_0x17d345+':'+_0x5d85d9['id'],_0x5d85d9);ChatMessageEvents['emit'](_0x17d345,_0x5d85d9);_0x47bd30(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xb6a2('0x5')](e,emitEvent(event));}}module[_0xb6a2('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0xa1dd=['ChatMessage','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4b4508,_0x2fd5cf){var _0x49db31=function(_0x41217a){while(--_0x41217a){_0x4b4508['push'](_0x4b4508['shift']());}};_0x49db31(++_0x2fd5cf);}(_0xa1dd,0x11e));var _0xda1d=function(_0x3e80af,_0x132c33){_0x3e80af=_0x3e80af-0x0;var _0x1ec9a8=_0xa1dd[_0x3e80af];return _0x1ec9a8;};'use strict';var EventEmitter=require(_0xda1d('0x0'));var ChatMessage=require(_0xda1d('0x1'))['db'][_0xda1d('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xda1d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xda1d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x45d4eb){return function(_0x39fe07,_0x29b6a8,_0x5d9375){ChatMessageEvents[_0xda1d('0x5')](_0x45d4eb+':'+_0x39fe07['id'],_0x39fe07);ChatMessageEvents[_0xda1d('0x5')](_0x45d4eb,_0x39fe07);_0x5d9375(null);};}for(var e in events){if(events[_0xda1d('0x6')](e)){var event=events[e];ChatMessage[_0xda1d('0x7')](e,emitEvent(event));}}module[_0xda1d('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 9597399..2f11025 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 _0x0a34=['get','direction','toLowerCase','secret','isNil','ChatInteraction','findOne','then','update','createdAt','error','utf8mb4','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','body','FULLTEXT'];(function(_0x21343a,_0x42204c){var _0x4ce4f8=function(_0x548875){while(--_0x548875){_0x21343a['push'](_0x21343a['shift']());}};_0x4ce4f8(++_0x42204c);}(_0x0a34,0x12a));var _0x40a3=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x0a34[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x40a3('0x0'));var util=require(_0x40a3('0x1'));var logger=require('../../config/logger')(_0x40a3('0x2'));var moment=require(_0x40a3('0x3'));var BPromise=require(_0x40a3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x40a3('0x5'));var rimraf=require(_0x40a3('0x6'));var config=require(_0x40a3('0x7'));var attributes=require('./chatMessage.attributes');module[_0x40a3('0x8')]=function(_0x1cdc8a,_0xbda4a8){return _0x1cdc8a[_0x40a3('0x9')](_0x40a3('0xa'),attributes,{'tableName':_0x40a3('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x40a3('0xc')],'type':_0x40a3('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x258101,_0x1459bc,_0x519e1b){var _0x2edb15=_0x1cdc8a['models'];var _0x643d61=_0x258101[_0x40a3('0xe')]({'plain':!![]});if(_0x643d61[_0x40a3('0xf')]['toLowerCase']()==='in'||_0x643d61[_0x40a3('0xf')][_0x40a3('0x10')]()==='out'&&!_0x643d61[_0x40a3('0x11')]&&!_[_0x40a3('0x12')](_0x643d61['UserId'])){_0x2edb15[_0x40a3('0x13')][_0x40a3('0x14')]({'where':{'id':_0x643d61['ChatInteractionId']}})[_0x40a3('0x15')](function(_0x3ced7b){if(_0x3ced7b){_0x3ced7b[_0x40a3('0x16')]({'lastMsgAt':_0x643d61[_0x40a3('0x17')],'lastMsgDirection':_0x643d61['direction']['toLowerCase']()});}})['catch'](function(_0x28bb05){console[_0x40a3('0x18')](_0x28bb05);});}_0x519e1b();}},'charset':_0x40a3('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9380=['api','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci'];(function(_0x1eb9f0,_0x16f8a6){var _0x3b900a=function(_0x6cd644){while(--_0x6cd644){_0x1eb9f0['push'](_0x1eb9f0['shift']());}};_0x3b900a(++_0x16f8a6);}(_0x9380,0x1b3));var _0x0938=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x9380[_0x29d94e];return _0x106237;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0938('0x0'));var moment=require(_0x0938('0x1'));var BPromise=require(_0x0938('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0938('0x3'));var rimraf=require(_0x0938('0x4'));var config=require(_0x0938('0x5'));var attributes=require(_0x0938('0x6'));module[_0x0938('0x7')]=function(_0x39e169,_0x27def8){return _0x39e169[_0x0938('0x8')](_0x0938('0x9'),attributes,{'tableName':_0x0938('0xa'),'paranoid':![],'indexes':[{'name':_0x0938('0xb'),'fields':[_0x0938('0xc')],'type':_0x0938('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x409fe6,_0x360d34,_0x134a03){var _0x4d0520=_0x39e169[_0x0938('0xe')];var _0x361195=_0x409fe6[_0x0938('0xf')]({'plain':!![]});if(_0x361195[_0x0938('0x10')][_0x0938('0x11')]()==='in'||_0x361195['direction'][_0x0938('0x11')]()===_0x0938('0x12')&&!_0x361195['secret']&&!_['isNil'](_0x361195[_0x0938('0x13')])){_0x4d0520[_0x0938('0x14')][_0x0938('0x15')]({'where':{'id':_0x361195[_0x0938('0x16')]}})[_0x0938('0x17')](function(_0x5620b3){if(_0x5620b3){_0x5620b3[_0x0938('0x18')]({'lastMsgAt':_0x361195[_0x0938('0x19')],'lastMsgDirection':_0x361195[_0x0938('0x10')][_0x0938('0x11')]()});}})[_0x0938('0x1a')](function(_0x5829b9){console[_0x0938('0x1b')](_0x5829b9);});}_0x134a03();}},'charset':'utf8mb4','collate':_0x0938('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index b642a4c..caf845e 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 _0x1220=['request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost'];(function(_0x266010,_0x2735e7){var _0x4aa73a=function(_0x43dc89){while(--_0x43dc89){_0x266010['push'](_0x266010['shift']());}};_0x4aa73a(++_0x2735e7);}(_0x1220,0x8a));var _0x0122=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x1220[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x0122('0x0'));var util=require(_0x0122('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0122('0x2'));var db=require(_0x0122('0x3'))['db'];var utils=require(_0x0122('0x4'));var logger=require(_0x0122('0x5'))(_0x0122('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0122('0x7')][_0x0122('0x8')]({'port':0x232a});config[_0x0122('0x9')]=_[_0x0122('0xa')](config['redis'],{'host':_0x0122('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2d0fa4,_0x21b455,_0x305412){return new BPromise(function(_0xa304e2,_0x3c4e33){return client[_0x0122('0xc')](_0x2d0fa4,_0x305412)[_0x0122('0xd')](function(_0x301578){logger['info'](_0x0122('0xe'),_0x21b455,_0x0122('0xf'));logger[_0x0122('0x10')](_0x0122('0x11'),_0x21b455,_0x0122('0xf'),JSON[_0x0122('0x12')](_0x301578));if(_0x301578[_0x0122('0x13')]){if(_0x301578[_0x0122('0x13')][_0x0122('0x14')]===0x1f4){logger[_0x0122('0x13')](_0x0122('0xe'),_0x21b455,_0x301578[_0x0122('0x13')][_0x0122('0x15')]);return _0x3c4e33(_0x301578['error'][_0x0122('0x15')]);}logger[_0x0122('0x13')]('ChatMessage,\x20%s,\x20%s',_0x21b455,_0x301578[_0x0122('0x13')][_0x0122('0x15')]);return _0xa304e2(_0x301578[_0x0122('0x13')]['message']);}else{logger[_0x0122('0x16')](_0x0122('0xe'),_0x21b455,_0x0122('0xf'));_0xa304e2(_0x301578[_0x0122('0x17')][_0x0122('0x15')]);}})[_0x0122('0x18')](function(_0x5d3016){logger[_0x0122('0x13')](_0x0122('0xe'),_0x21b455,_0x5d3016);_0x3c4e33(_0x5d3016);});});}exports[_0x0122('0x19')]=function(_0x547acd){var _0x2401ed=this;return new Promise(function(_0x49c984,_0xdda6b1){return db[_0x0122('0x1a')]['create'](_0x547acd[_0x0122('0x1b')],{'raw':_0x547acd[_0x0122('0x1c')]?_0x547acd[_0x0122('0x1c')][_0x0122('0x1d')]===undefined?!![]:![]:!![]})[_0x0122('0xd')](function(_0x4d08e6){logger[_0x0122('0x16')](_0x0122('0x19'),_0x547acd);logger[_0x0122('0x10')](_0x0122('0x19'),_0x547acd,JSON['stringify'](_0x4d08e6));_0x49c984(_0x4d08e6);})[_0x0122('0x18')](function(_0x136856){logger[_0x0122('0x13')](_0x0122('0x19'),_0x136856['message'],_0x547acd);_0xdda6b1(_0x2401ed[_0x0122('0x13')](0x1f4,_0x136856[_0x0122('0x15')]));});});}; \ No newline at end of file +var _0x5a43=['socket.io-emitter','./chatMessage.socket','register','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ChatMessage','create','options','raw','then','CreateChatMessage','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis'];(function(_0x170983,_0x49786d){var _0x1e6962=function(_0x19075a){while(--_0x19075a){_0x170983['push'](_0x170983['shift']());}};_0x1e6962(++_0x49786d);}(_0x5a43,0x12a));var _0x35a4=function(_0x1813d8,_0x52abf1){_0x1813d8=_0x1813d8-0x0;var _0xf09630=_0x5a43[_0x1813d8];return _0xf09630;};'use strict';var _=require(_0x35a4('0x0'));var util=require(_0x35a4('0x1'));var moment=require('moment');var BPromise=require(_0x35a4('0x2'));var rs=require(_0x35a4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35a4('0x4'))['db'];var utils=require(_0x35a4('0x5'));var logger=require('../../config/logger')(_0x35a4('0x6'));var config=require('../../config/environment');var jayson=require(_0x35a4('0x7'));var client=jayson[_0x35a4('0x8')][_0x35a4('0x9')]({'port':0x232a});config['redis']=_[_0x35a4('0xa')](config[_0x35a4('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x35a4('0xc'))(new Redis(config['redis']));require(_0x35a4('0xd'))[_0x35a4('0xe')](socket);function respondWithRpcPromise(_0xaf708a,_0x1631fa,_0x5431e5){return new BPromise(function(_0x4194dc,_0x4f44e5){return client['request'](_0xaf708a,_0x5431e5)['then'](function(_0x5c3f13){logger[_0x35a4('0xf')](_0x35a4('0x10'),_0x1631fa,'request\x20sent');logger[_0x35a4('0x11')](_0x35a4('0x12'),_0x1631fa,_0x35a4('0x13'),JSON[_0x35a4('0x14')](_0x5c3f13));if(_0x5c3f13['error']){if(_0x5c3f13[_0x35a4('0x15')][_0x35a4('0x16')]===0x1f4){logger[_0x35a4('0x15')](_0x35a4('0x10'),_0x1631fa,_0x5c3f13[_0x35a4('0x15')][_0x35a4('0x17')]);return _0x4f44e5(_0x5c3f13[_0x35a4('0x15')][_0x35a4('0x17')]);}logger[_0x35a4('0x15')]('ChatMessage,\x20%s,\x20%s',_0x1631fa,_0x5c3f13[_0x35a4('0x15')]['message']);return _0x4194dc(_0x5c3f13[_0x35a4('0x15')][_0x35a4('0x17')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x1631fa,_0x35a4('0x13'));_0x4194dc(_0x5c3f13['result'][_0x35a4('0x17')]);}})[_0x35a4('0x18')](function(_0x5a6ab1){logger[_0x35a4('0x15')](_0x35a4('0x10'),_0x1631fa,_0x5a6ab1);_0x4f44e5(_0x5a6ab1);});});}exports['CreateChatMessage']=function(_0x323446){var _0x2e29ee=this;return new Promise(function(_0x1c5a0a,_0x49d5ce){return db[_0x35a4('0x19')][_0x35a4('0x1a')](_0x323446['body'],{'raw':_0x323446['options']?_0x323446[_0x35a4('0x1b')][_0x35a4('0x1c')]===undefined?!![]:![]:!![]})[_0x35a4('0x1d')](function(_0x11b9d5){logger[_0x35a4('0xf')](_0x35a4('0x1e'),_0x323446);logger['debug'](_0x35a4('0x1e'),_0x323446,JSON[_0x35a4('0x14')](_0x11b9d5));_0x1c5a0a(_0x11b9d5);})['catch'](function(_0x5785fd){logger[_0x35a4('0x15')]('CreateChatMessage',_0x5785fd[_0x35a4('0x17')],_0x323446);_0x49d5ce(_0x2e29ee[_0x35a4('0x15')](0x1f4,_0x5785fd[_0x35a4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 1c7b66d..ccce69e 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 _0xf185=['update','emit','removeListener','register','length','./chatMessage.events','remove'];(function(_0x4fbc23,_0x559772){var _0x45dc12=function(_0xf31bd1){while(--_0xf31bd1){_0x4fbc23['push'](_0x4fbc23['shift']());}};_0x45dc12(++_0x559772);}(_0xf185,0x1be));var _0x5f18=function(_0x11ae93,_0x52a4e6){_0x11ae93=_0x11ae93-0x0;var _0x33435c=_0xf185[_0x11ae93];return _0x33435c;};'use strict';var ChatMessageEvents=require(_0x5f18('0x0'));var events=['save',_0x5f18('0x1'),_0x5f18('0x2')];function createListener(_0x26ab30,_0x3100aa){return function(_0x40e868){_0x3100aa[_0x5f18('0x3')](_0x26ab30,_0x40e868);};}function removeListener(_0x529b25,_0x33d44f){return function(){ChatMessageEvents[_0x5f18('0x4')](_0x529b25,_0x33d44f);};}exports[_0x5f18('0x5')]=function(_0x1cac08){for(var _0x5b7cc5=0x0,_0x2982d6=events[_0x5f18('0x6')];_0x5b7cc5<_0x2982d6;_0x5b7cc5++){var _0x47e05a=events[_0x5b7cc5];var _0x15b931=createListener('chatMessage:'+_0x47e05a,_0x1cac08);ChatMessageEvents['on'](_0x47e05a,_0x15b931);}}; \ No newline at end of file +var _0x50d0=['update','removeListener','register','length','chatMessage:','./chatMessage.events','remove'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x50d0,0x101));var _0x050d=function(_0x5df47d,_0x56b70d){_0x5df47d=_0x5df47d-0x0;var _0x503d79=_0x50d0[_0x5df47d];return _0x503d79;};'use strict';var ChatMessageEvents=require(_0x050d('0x0'));var events=['save',_0x050d('0x1'),_0x050d('0x2')];function createListener(_0x449ea6,_0x3a26e2){return function(_0x2d73d4){_0x3a26e2['emit'](_0x449ea6,_0x2d73d4);};}function removeListener(_0x3553e3,_0xd37556){return function(){ChatMessageEvents[_0x050d('0x3')](_0x3553e3,_0xd37556);};}exports[_0x050d('0x4')]=function(_0x3c2dbe){for(var _0x20bede=0x0,_0x348909=events[_0x050d('0x5')];_0x20bede<_0x348909;_0x20bede++){var _0x2b2faa=events[_0x20bede];var _0x516f5d=createListener(_0x050d('0x6')+_0x2b2faa,_0x3c2dbe);ChatMessageEvents['on'](_0x2b2faa,_0x516f5d);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 1149092..0c855ba 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 _0x7853=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','post','tracked','chat','chatmessage:create','put','update','accept','reject','delete','multer'];(function(_0x545173,_0x46180a){var _0x270ef2=function(_0x1f2ea0){while(--_0x1f2ea0){_0x545173['push'](_0x545173['shift']());}};_0x270ef2(++_0x46180a);}(_0x7853,0xa7));var _0x3785=function(_0xec2394,_0x40b2df){_0xec2394=_0xec2394-0x0;var _0x2e78a0=_0x7853[_0xec2394];return _0x2e78a0;};'use strict';var multer=require(_0x3785('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3785('0x1'));var express=require(_0x3785('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3785('0x3'));var interaction=require(_0x3785('0x4'));var config=require(_0x3785('0x5'));var controller=require(_0x3785('0x6'));router[_0x3785('0x7')]('/',auth[_0x3785('0x8')](),controller['index']);router[_0x3785('0x7')](_0x3785('0x9'),auth[_0x3785('0x8')](),controller[_0x3785('0xa')]);router[_0x3785('0x7')](_0x3785('0xb'),auth[_0x3785('0x8')](),controller['show']);router[_0x3785('0xc')]('/',auth['isAuthenticated'](),interaction[_0x3785('0xd')](_0x3785('0xe'),_0x3785('0xf')),controller['create']);router[_0x3785('0x10')](_0x3785('0xb'),controller[_0x3785('0x11')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x3785('0x12')]);router['put']('/:id/reject',auth[_0x3785('0x8')](),controller[_0x3785('0x13')]);router[_0x3785('0x14')]('/:id',auth[_0x3785('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb73f=['isAuthenticated','index','get','/describe','describe','show','post','tracked','chat','create','update','/:id/accept','put','/:id/reject','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatMessage.controller'];(function(_0x470bfb,_0x389787){var _0x2f5d97=function(_0x3431b4){while(--_0x3431b4){_0x470bfb['push'](_0x470bfb['shift']());}};_0x2f5d97(++_0x389787);}(_0xb73f,0x149));var _0xfb73=function(_0x29e91f,_0x19746f){_0x29e91f=_0x29e91f-0x0;var _0x96024=_0xb73f[_0x29e91f];return _0x96024;};'use strict';var multer=require(_0xfb73('0x0'));var util=require(_0xfb73('0x1'));var path=require(_0xfb73('0x2'));var timeout=require(_0xfb73('0x3'));var express=require(_0xfb73('0x4'));var router=express[_0xfb73('0x5')]();var fs_extra=require(_0xfb73('0x6'));var auth=require(_0xfb73('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfb73('0x8'));router['get']('/',auth[_0xfb73('0x9')](),controller[_0xfb73('0xa')]);router[_0xfb73('0xb')](_0xfb73('0xc'),auth['isAuthenticated'](),controller[_0xfb73('0xd')]);router[_0xfb73('0xb')]('/:id',auth[_0xfb73('0x9')](),controller[_0xfb73('0xe')]);router[_0xfb73('0xf')]('/',auth[_0xfb73('0x9')](),interaction[_0xfb73('0x10')](_0xfb73('0x11'),'chatmessage:create'),controller[_0xfb73('0x12')]);router['put']('/:id',controller[_0xfb73('0x13')]);router['put'](_0xfb73('0x14'),auth['isAuthenticated'](),controller['accept']);router[_0xfb73('0x15')](_0xfb73('0x16'),auth[_0xfb73('0x9')](),controller['reject']);router['delete'](_0xfb73('0x17'),auth['isAuthenticated'](),controller[_0xfb73('0x18')]);module[_0xfb73('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 30fbdab..27a2958 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 _0xb7c1=['exports','medium','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7c1,0x10a));var _0x1b7c=function(_0x930369,_0x3a255f){_0x930369=_0x930369-0x0;var _0x46afa0=_0xb7c1[_0x930369];return _0x46afa0;};'use strict';var Sequelize=require(_0x1b7c('0x0'));module[_0x1b7c('0x1')]={'body':{'type':Sequelize['TEXT'](_0x1b7c('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xeb53=['TEXT','exports'];(function(_0x3afb73,_0xaa578f){var _0x5165f2=function(_0x142ac9){while(--_0x142ac9){_0x3afb73['push'](_0x3afb73['shift']());}};_0x5165f2(++_0xaa578f);}(_0xeb53,0x1a7));var _0x3eb5=function(_0x588e7c,_0x112f11){_0x588e7c=_0x588e7c-0x0;var _0x97e0ce=_0xeb53[_0x588e7c];return _0x97e0ce;};'use strict';var Sequelize=require('sequelize');module[_0x3eb5('0x0')]={'body':{'type':Sequelize[_0x3eb5('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 7c9249b..dff3b34 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 _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(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x7a54,0x106));var _0x47a5=function(_0x2794b4,_0x3b8468){_0x2794b4=_0x2794b4-0x0;var _0xc46db1=_0x7a54[_0x2794b4];return _0xc46db1;};'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 +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(_0x31abab,_0x2f71c5){var _0x384373=function(_0x201b7e){while(--_0x201b7e){_0x31abab['push'](_0x31abab['shift']());}};_0x384373(++_0x2f71c5);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 2e47e3e..6cac367 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 _0x9386=['define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports'];(function(_0x3685d6,_0x2ae608){var _0x628d2c=function(_0x34e316){while(--_0x34e316){_0x3685d6['push'](_0x3685d6['shift']());}};_0x628d2c(++_0x2ae608);}(_0x9386,0x108));var _0x6938=function(_0x2b31a2,_0x124f77){_0x2b31a2=_0x2b31a2-0x0;var _0x511515=_0x9386[_0x2b31a2];return _0x511515;};'use strict';var _=require('lodash');var util=require(_0x6938('0x0'));var logger=require(_0x6938('0x1'))(_0x6938('0x2'));var moment=require(_0x6938('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6938('0x4'));var rimraf=require(_0x6938('0x5'));var config=require(_0x6938('0x6'));var attributes=require(_0x6938('0x7'));module[_0x6938('0x8')]=function(_0x4e9443,_0x4056f8){return _0x4e9443[_0x6938('0x9')]('ChatOfflineMessage',attributes,{'tableName':_0x6938('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6938('0xb'),'collate':_0x6938('0xc')});}; \ No newline at end of file +var _0x2059=['bluebird','./chatOfflineMessage.attributes','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2059,0x113));var _0x9205=function(_0x30f5bb,_0x4db4bd){_0x30f5bb=_0x30f5bb-0x0;var _0x1cfc00=_0x2059[_0x30f5bb];return _0x1cfc00;};'use strict';var _=require(_0x9205('0x0'));var util=require(_0x9205('0x1'));var logger=require(_0x9205('0x2'))(_0x9205('0x3'));var moment=require(_0x9205('0x4'));var BPromise=require(_0x9205('0x5'));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(_0x9205('0x6'));module['exports']=function(_0x4db99a,_0x11ccc8){return _0x4db99a[_0x9205('0x7')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9205('0x8'),'collate':_0x9205('0x9')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index b4c6d6b..33ee9cb 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 _0x69a2=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x69a2,0x181));var _0x269a=function(_0x4c63ee,_0x1f719d){_0x4c63ee=_0x4c63ee-0x0;var _0x172087=_0x69a2[_0x4c63ee];return _0x172087;};'use strict';var _=require('lodash');var util=require(_0x269a('0x0'));var moment=require('moment');var BPromise=require(_0x269a('0x1'));var rs=require(_0x269a('0x2'));var fs=require('fs');var Redis=require(_0x269a('0x3'));var db=require(_0x269a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x269a('0x5'))(_0x269a('0x6'));var config=require(_0x269a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x269a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a8006,_0x1ca23b,_0x5f29f0){return new BPromise(function(_0x3dbc4e,_0x3012b3){return client[_0x269a('0x9')](_0x2a8006,_0x5f29f0)['then'](function(_0xf72a04){logger[_0x269a('0xa')](_0x269a('0xb'),_0x1ca23b,_0x269a('0xc'));logger[_0x269a('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1ca23b,_0x269a('0xc'),JSON[_0x269a('0xe')](_0xf72a04));if(_0xf72a04['error']){if(_0xf72a04[_0x269a('0xf')][_0x269a('0x10')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x1ca23b,_0xf72a04[_0x269a('0xf')]['message']);return _0x3012b3(_0xf72a04[_0x269a('0xf')]['message']);}logger[_0x269a('0xf')](_0x269a('0xb'),_0x1ca23b,_0xf72a04['error'][_0x269a('0x11')]);return _0x3dbc4e(_0xf72a04[_0x269a('0xf')]['message']);}else{logger[_0x269a('0xa')](_0x269a('0xb'),_0x1ca23b,_0x269a('0xc'));_0x3dbc4e(_0xf72a04[_0x269a('0x12')][_0x269a('0x11')]);}})[_0x269a('0x13')](function(_0x43f87a){logger[_0x269a('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1ca23b,_0x43f87a);_0x3012b3(_0x43f87a);});});} \ No newline at end of file +var _0x62f0=['error','message','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x835dbc,_0x3852e3){var _0x1ac9d7=function(_0x295263){while(--_0x295263){_0x835dbc['push'](_0x835dbc['shift']());}};_0x1ac9d7(++_0x3852e3);}(_0x62f0,0x167));var _0x062f=function(_0x121350,_0x361f4d){_0x121350=_0x121350-0x0;var _0x2e21c7=_0x62f0[_0x121350];return _0x2e21c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x062f('0x0'));var rs=require(_0x062f('0x1'));var fs=require('fs');var Redis=require(_0x062f('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x062f('0x3'))(_0x062f('0x4'));var config=require(_0x062f('0x5'));var jayson=require(_0x062f('0x6'));var client=jayson[_0x062f('0x7')][_0x062f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x504846,_0x5ae756,_0x107f00){return new BPromise(function(_0xde7ab0,_0x12d7fb){return client['request'](_0x504846,_0x107f00)[_0x062f('0x9')](function(_0x493d13){logger[_0x062f('0xa')](_0x062f('0xb'),_0x5ae756,_0x062f('0xc'));logger['debug'](_0x062f('0xd'),_0x5ae756,_0x062f('0xc'),JSON[_0x062f('0xe')](_0x493d13));if(_0x493d13['error']){if(_0x493d13['error']['code']===0x1f4){logger[_0x062f('0xf')](_0x062f('0xb'),_0x5ae756,_0x493d13[_0x062f('0xf')][_0x062f('0x10')]);return _0x12d7fb(_0x493d13[_0x062f('0xf')][_0x062f('0x10')]);}logger[_0x062f('0xf')](_0x062f('0xb'),_0x5ae756,_0x493d13[_0x062f('0xf')][_0x062f('0x10')]);return _0xde7ab0(_0x493d13['error'][_0x062f('0x10')]);}else{logger['info'](_0x062f('0xb'),_0x5ae756,_0x062f('0xc'));_0xde7ab0(_0x493d13['result'][_0x062f('0x10')]);}})['catch'](function(_0x41162c){logger['error'](_0x062f('0xb'),_0x5ae756,_0x41162c);_0x12d7fb(_0x41162c);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index a750c52..e76f648 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 _0xfda9=['/describe','describe','/:id','show','post','create','put','delete','destroy','multer','util','connect-timeout','express','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get'];(function(_0x446301,_0x15b238){var _0x268e22=function(_0x29a525){while(--_0x29a525){_0x446301['push'](_0x446301['shift']());}};_0x268e22(++_0x15b238);}(_0xfda9,0xe1));var _0x9fda=function(_0x278dcf,_0x5f23f3){_0x278dcf=_0x278dcf-0x0;var _0x85bbcc=_0xfda9[_0x278dcf];return _0x85bbcc;};'use strict';var multer=require(_0x9fda('0x0'));var util=require(_0x9fda('0x1'));var path=require('path');var timeout=require(_0x9fda('0x2'));var express=require(_0x9fda('0x3'));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(_0x9fda('0x4'));var controller=require(_0x9fda('0x5'));router['get']('/',auth[_0x9fda('0x6')](),controller[_0x9fda('0x7')]);router[_0x9fda('0x8')](_0x9fda('0x9'),auth[_0x9fda('0x6')](),controller[_0x9fda('0xa')]);router[_0x9fda('0x8')](_0x9fda('0xb'),auth[_0x9fda('0x6')](),controller[_0x9fda('0xc')]);router[_0x9fda('0xd')]('/',auth['isAuthenticated'](),controller[_0x9fda('0xe')]);router[_0x9fda('0xf')](_0x9fda('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x9fda('0x10')](_0x9fda('0xb'),auth[_0x9fda('0x6')](),controller[_0x9fda('0x11')]);module['exports']=router; \ No newline at end of file +var _0xfc6d=['create','put','update','delete','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','show','post'];(function(_0x3ab47c,_0x5cf435){var _0x1aa972=function(_0x2ca8ff){while(--_0x2ca8ff){_0x3ab47c['push'](_0x3ab47c['shift']());}};_0x1aa972(++_0x5cf435);}(_0xfc6d,0x1ad));var _0xdfc6=function(_0x279f6d,_0x122316){_0x279f6d=_0x279f6d-0x0;var _0x5874a5=_0xfc6d[_0x279f6d];return _0x5874a5;};'use strict';var multer=require(_0xdfc6('0x0'));var util=require(_0xdfc6('0x1'));var path=require('path');var timeout=require(_0xdfc6('0x2'));var express=require(_0xdfc6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdfc6('0x4'));var interaction=require(_0xdfc6('0x5'));var config=require(_0xdfc6('0x6'));var controller=require(_0xdfc6('0x7'));router[_0xdfc6('0x8')]('/',auth[_0xdfc6('0x9')](),controller[_0xdfc6('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xdfc6('0x9')](),controller[_0xdfc6('0xb')]);router[_0xdfc6('0xc')]('/',auth[_0xdfc6('0x9')](),controller[_0xdfc6('0xd')]);router[_0xdfc6('0xe')]('/:id',auth[_0xdfc6('0x9')](),controller[_0xdfc6('0xf')]);router[_0xdfc6('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 87e6de0..1682eb7 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 _0xf4e7=['timeout','INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x49bc69,_0x17439f){var _0x213c42=function(_0x4c88dd){while(--_0x4c88dd){_0x49bc69['push'](_0x49bc69['shift']());}};_0x213c42(++_0x17439f);}(_0xf4e7,0xb8));var _0x7f4e=function(_0x2b95d0,_0x592abb){_0x2b95d0=_0x2b95d0-0x0;var _0x356268=_0xf4e7[_0x2b95d0];return _0x356268;};'use strict';var Sequelize=require(_0x7f4e('0x0'));module[_0x7f4e('0x1')]={'name':{'type':Sequelize[_0x7f4e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7f4e('0x3')](_0x7f4e('0x4'),_0x7f4e('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x7f4e('0x2')]},'timeout':{'type':Sequelize[_0x7f4e('0x6')]}}; \ No newline at end of file +var _0x00e4=['STRING','ENUM','mouseOver','sequelize','exports'];(function(_0x4df337,_0x3bf41d){var _0x4a1c4e=function(_0x248214){while(--_0x248214){_0x4df337['push'](_0x4df337['shift']());}};_0x4a1c4e(++_0x3bf41d);}(_0x00e4,0x157));var _0x400e=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x00e4[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require(_0x400e('0x0'));module[_0x400e('0x1')]={'name':{'type':Sequelize[_0x400e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x400e('0x3')](_0x400e('0x4'),'timeout'),'defaultValue':_0x400e('0x4')},'selector':{'type':Sequelize[_0x400e('0x2')]},'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 4f886ba..52c4e2a 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 _0x2d17=['../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','then','error','name','show','params','keys','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','merge','options','ChatProactiveAction','find','catch','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','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'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2d17,0x17e));var _0x72d1=function(_0x2e24c7,_0x52191c){_0x2e24c7=_0x2e24c7-0x0;var _0x48be94=_0x2d17[_0x2e24c7];return _0x48be94;};'use strict';var emlformat=require(_0x72d1('0x0'));var rimraf=require(_0x72d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x72d1('0x2'));var rp=require(_0x72d1('0x3'));var moment=require('moment');var BPromise=require(_0x72d1('0x4'));var Mustache=require(_0x72d1('0x5'));var util=require('util');var path=require(_0x72d1('0x6'));var sox=require('sox');var csv=require(_0x72d1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72d1('0x8'));var _=require(_0x72d1('0x9'));var squel=require('squel');var crypto=require(_0x72d1('0xa'));var jsforce=require(_0x72d1('0xb'));var deskjs=require(_0x72d1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x72d1('0xd'));var Papa=require(_0x72d1('0xe'));var Redis=require(_0x72d1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x72d1('0x10'));var as=require(_0x72d1('0x11'));var hardwareService=require(_0x72d1('0x12'));var logger=require(_0x72d1('0x13'))(_0x72d1('0x14'));var utils=require(_0x72d1('0x15'));var config=require(_0x72d1('0x16'));var licenseUtil=require(_0x72d1('0x17'));var db=require(_0x72d1('0x18'))['db'];function respondWithStatusCode(_0x2f5a78,_0x5ad4df){_0x5ad4df=_0x5ad4df||0xcc;return function(_0x3cd1ae){if(_0x3cd1ae){return _0x2f5a78[_0x72d1('0x19')](_0x5ad4df);}return _0x2f5a78[_0x72d1('0x1a')](_0x5ad4df)[_0x72d1('0x1b')]();};}function respondWithResult(_0x22ac6f,_0x685a27){_0x685a27=_0x685a27||0xc8;return function(_0x143718){if(_0x143718){return _0x22ac6f[_0x72d1('0x1a')](_0x685a27)[_0x72d1('0x1c')](_0x143718);}};}function respondWithFilteredResult(_0x3f190f,_0x21c85e){return function(_0x23a238){if(_0x23a238){var _0x8d458=typeof _0x21c85e['offset']===_0x72d1('0x1d')&&typeof _0x21c85e['limit']===_0x72d1('0x1d');var _0x2c9851=_0x23a238['count'];var _0x1061b7=_0x8d458?0x0:_0x21c85e[_0x72d1('0x1e')];var _0x1ca18d=_0x8d458?_0x23a238['count']:_0x21c85e['offset']+_0x21c85e[_0x72d1('0x1f')];var _0x10d464;if(_0x1ca18d>=_0x2c9851){_0x1ca18d=_0x2c9851;_0x10d464=0xc8;}else{_0x10d464=0xce;}_0x3f190f[_0x72d1('0x1a')](_0x10d464);return _0x3f190f[_0x72d1('0x20')](_0x72d1('0x21'),_0x1061b7+'-'+_0x1ca18d+'/'+_0x2c9851)[_0x72d1('0x1c')](_0x23a238);}return null;};}function patchUpdates(_0x1e2411){return function(_0x5c7982){try{jsonpatch[_0x72d1('0x22')](_0x5c7982,_0x1e2411,!![]);}catch(_0x56e8d3){return BPromise['reject'](_0x56e8d3);}return _0x5c7982['save']();};}function saveUpdates(_0x585243,_0x445985){return function(_0x374602){if(_0x374602){return _0x374602['update'](_0x585243)[_0x72d1('0x23')](function(_0x256dc1){return _0x256dc1;});}return null;};}function removeEntity(_0x492086,_0x1431ee){return function(_0x26fa35){if(_0x26fa35){return _0x26fa35['destroy']()['then'](function(){_0x492086[_0x72d1('0x1a')](0xcc)[_0x72d1('0x1b')]();});}};}function handleEntityNotFound(_0x2f661,_0x2f879f){return function(_0xdf6a69){if(!_0xdf6a69){_0x2f661[_0x72d1('0x19')](0x194);}return _0xdf6a69;};}function handleError(_0x163bec,_0x589f7c){_0x589f7c=_0x589f7c||0x1f4;return function(_0x57ec9e){logger[_0x72d1('0x24')](_0x57ec9e['stack']);if(_0x57ec9e[_0x72d1('0x25')]){delete _0x57ec9e[_0x72d1('0x25')];}_0x163bec[_0x72d1('0x1a')](_0x589f7c)['send'](_0x57ec9e);};}exports[_0x72d1('0x26')]=function(_0x4c4c41,_0x707cd0){var _0x20055f={'raw':!![],'where':{'id':_0x4c4c41[_0x72d1('0x27')]['id']}},_0x32588f={};_0x32588f['model']=_[_0x72d1('0x28')](db['ChatProactiveAction'][_0x72d1('0x29')]);_0x32588f[_0x72d1('0x2a')]=_['keys'](_0x4c4c41[_0x72d1('0x2a')]);_0x32588f[_0x72d1('0x2b')]=_[_0x72d1('0x2c')](_0x32588f[_0x72d1('0x2d')],_0x32588f[_0x72d1('0x2a')]);_0x20055f['attributes']=_[_0x72d1('0x2c')](_0x32588f[_0x72d1('0x2d')],qs[_0x72d1('0x2e')](_0x4c4c41['query'][_0x72d1('0x2e')]));_0x20055f[_0x72d1('0x2f')]=_0x20055f['attributes'][_0x72d1('0x30')]?_0x20055f[_0x72d1('0x2f')]:_0x32588f[_0x72d1('0x2d')];if(_0x4c4c41['query'][_0x72d1('0x31')]){_0x20055f['include']=[{'all':!![]}];}_0x20055f=_[_0x72d1('0x32')]({},_0x20055f,_0x4c4c41[_0x72d1('0x33')]);return db[_0x72d1('0x34')][_0x72d1('0x35')](_0x20055f)[_0x72d1('0x23')](handleEntityNotFound(_0x707cd0,null))[_0x72d1('0x23')](respondWithResult(_0x707cd0,null))[_0x72d1('0x36')](handleError(_0x707cd0,null));};exports[_0x72d1('0x37')]=function(_0x4006b9,_0x24be04){return db[_0x72d1('0x34')]['create'](_0x4006b9[_0x72d1('0x38')],{})[_0x72d1('0x23')](respondWithResult(_0x24be04,0xc9))[_0x72d1('0x36')](handleError(_0x24be04,null));};exports[_0x72d1('0x39')]=function(_0x49e074,_0x3eb3da){if(_0x49e074[_0x72d1('0x38')]['id']){delete _0x49e074[_0x72d1('0x38')]['id'];}return db['ChatProactiveAction'][_0x72d1('0x35')]({'where':{'id':_0x49e074[_0x72d1('0x27')]['id']}})[_0x72d1('0x23')](handleEntityNotFound(_0x3eb3da,null))['then'](saveUpdates(_0x49e074[_0x72d1('0x38')],null))[_0x72d1('0x23')](respondWithResult(_0x3eb3da,null))[_0x72d1('0x36')](handleError(_0x3eb3da,null));};exports['destroy']=function(_0x43b419,_0x40cdbd){return db[_0x72d1('0x34')][_0x72d1('0x35')]({'where':{'id':_0x43b419[_0x72d1('0x27')]['id']}})[_0x72d1('0x23')](handleEntityNotFound(_0x40cdbd,null))[_0x72d1('0x23')](removeEntity(_0x40cdbd,null))['catch'](handleError(_0x40cdbd,null));}; \ No newline at end of file +var _0x2171=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','json','apply','reject','save','then','destroy','stack','name','send','show','params','model','rawAttributes','query','keys','intersection','fields','attributes','includeAll','merge','options','ChatProactiveAction','find','catch','create','body','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x1bc794,_0x3e7f10){var _0x47055f=function(_0x1957e1){while(--_0x1957e1){_0x1bc794['push'](_0x1bc794['shift']());}};_0x47055f(++_0x3e7f10);}(_0x2171,0x143));var _0x1217=function(_0x24f894,_0x2e838b){_0x24f894=_0x24f894-0x0;var _0x36e466=_0x2171[_0x24f894];return _0x36e466;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1217('0x0'));var zipdir=require(_0x1217('0x1'));var jsonpatch=require(_0x1217('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1217('0x3'));var Mustache=require('mustache');var util=require(_0x1217('0x4'));var path=require(_0x1217('0x5'));var sox=require(_0x1217('0x6'));var csv=require(_0x1217('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1217('0x8'));var _=require(_0x1217('0x9'));var squel=require(_0x1217('0xa'));var crypto=require('crypto');var jsforce=require(_0x1217('0xb'));var deskjs=require(_0x1217('0xc'));var toCsv=require(_0x1217('0x7'));var querystring=require(_0x1217('0xd'));var Papa=require(_0x1217('0xe'));var Redis=require(_0x1217('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1217('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1217('0x11'));var logger=require(_0x1217('0x12'))(_0x1217('0x13'));var utils=require(_0x1217('0x14'));var config=require(_0x1217('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1217('0x16'))['db'];function respondWithStatusCode(_0x358007,_0x1e34e9){_0x1e34e9=_0x1e34e9||0xcc;return function(_0x107d99){if(_0x107d99){return _0x358007[_0x1217('0x17')](_0x1e34e9);}return _0x358007['status'](_0x1e34e9)['end']();};}function respondWithResult(_0xb06ed5,_0x5d8f22){_0x5d8f22=_0x5d8f22||0xc8;return function(_0x4aa848){if(_0x4aa848){return _0xb06ed5[_0x1217('0x18')](_0x5d8f22)['json'](_0x4aa848);}};}function respondWithFilteredResult(_0x4ef9be,_0x2300f0){return function(_0x24a3f3){if(_0x24a3f3){var _0x417cfe=typeof _0x2300f0[_0x1217('0x19')]==='undefined'&&typeof _0x2300f0[_0x1217('0x1a')]===_0x1217('0x1b');var _0x41c34f=_0x24a3f3[_0x1217('0x1c')];var _0x512159=_0x417cfe?0x0:_0x2300f0[_0x1217('0x19')];var _0x24033f=_0x417cfe?_0x24a3f3[_0x1217('0x1c')]:_0x2300f0[_0x1217('0x19')]+_0x2300f0[_0x1217('0x1a')];var _0x20ccb9;if(_0x24033f>=_0x41c34f){_0x24033f=_0x41c34f;_0x20ccb9=0xc8;}else{_0x20ccb9=0xce;}_0x4ef9be[_0x1217('0x18')](_0x20ccb9);return _0x4ef9be[_0x1217('0x1d')]('Content-Range',_0x512159+'-'+_0x24033f+'/'+_0x41c34f)[_0x1217('0x1e')](_0x24a3f3);}return null;};}function patchUpdates(_0x49382b){return function(_0x3bb618){try{jsonpatch[_0x1217('0x1f')](_0x3bb618,_0x49382b,!![]);}catch(_0x5f018c){return BPromise[_0x1217('0x20')](_0x5f018c);}return _0x3bb618[_0x1217('0x21')]();};}function saveUpdates(_0x4ea5e6,_0xb4e4ea){return function(_0x2c625b){if(_0x2c625b){return _0x2c625b['update'](_0x4ea5e6)[_0x1217('0x22')](function(_0x11f512){return _0x11f512;});}return null;};}function removeEntity(_0x1516e8,_0x5b9b7a){return function(_0x4a9c32){if(_0x4a9c32){return _0x4a9c32[_0x1217('0x23')]()[_0x1217('0x22')](function(){_0x1516e8[_0x1217('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x463c66,_0x8bd9d9){return function(_0x1bde0b){if(!_0x1bde0b){_0x463c66[_0x1217('0x17')](0x194);}return _0x1bde0b;};}function handleError(_0x465209,_0x446dc3){_0x446dc3=_0x446dc3||0x1f4;return function(_0x518a0a){logger['error'](_0x518a0a[_0x1217('0x24')]);if(_0x518a0a[_0x1217('0x25')]){delete _0x518a0a['name'];}_0x465209[_0x1217('0x18')](_0x446dc3)[_0x1217('0x26')](_0x518a0a);};}exports[_0x1217('0x27')]=function(_0x21392c,_0x2f5387){var _0x5eb398={'raw':!![],'where':{'id':_0x21392c[_0x1217('0x28')]['id']}},_0xdb98d5={};_0xdb98d5[_0x1217('0x29')]=_['keys'](db['ChatProactiveAction'][_0x1217('0x2a')]);_0xdb98d5[_0x1217('0x2b')]=_[_0x1217('0x2c')](_0x21392c['query']);_0xdb98d5['filters']=_[_0x1217('0x2d')](_0xdb98d5[_0x1217('0x29')],_0xdb98d5[_0x1217('0x2b')]);_0x5eb398['attributes']=_['intersection'](_0xdb98d5[_0x1217('0x29')],qs[_0x1217('0x2e')](_0x21392c[_0x1217('0x2b')][_0x1217('0x2e')]));_0x5eb398[_0x1217('0x2f')]=_0x5eb398['attributes']['length']?_0x5eb398['attributes']:_0xdb98d5['model'];if(_0x21392c[_0x1217('0x2b')][_0x1217('0x30')]){_0x5eb398['include']=[{'all':!![]}];}_0x5eb398=_[_0x1217('0x31')]({},_0x5eb398,_0x21392c[_0x1217('0x32')]);return db[_0x1217('0x33')][_0x1217('0x34')](_0x5eb398)[_0x1217('0x22')](handleEntityNotFound(_0x2f5387,null))[_0x1217('0x22')](respondWithResult(_0x2f5387,null))[_0x1217('0x35')](handleError(_0x2f5387,null));};exports[_0x1217('0x36')]=function(_0x2d6653,_0x445bd2){return db[_0x1217('0x33')][_0x1217('0x36')](_0x2d6653[_0x1217('0x37')],{})[_0x1217('0x22')](respondWithResult(_0x445bd2,0xc9))[_0x1217('0x35')](handleError(_0x445bd2,null));};exports['update']=function(_0xc189a6,_0x3ac293){if(_0xc189a6[_0x1217('0x37')]['id']){delete _0xc189a6['body']['id'];}return db[_0x1217('0x33')]['find']({'where':{'id':_0xc189a6[_0x1217('0x28')]['id']}})['then'](handleEntityNotFound(_0x3ac293,null))[_0x1217('0x22')](saveUpdates(_0xc189a6[_0x1217('0x37')],null))[_0x1217('0x22')](respondWithResult(_0x3ac293,null))[_0x1217('0x35')](handleError(_0x3ac293,null));};exports['destroy']=function(_0xc699b3,_0x437f54){return db[_0x1217('0x33')]['find']({'where':{'id':_0xc699b3[_0x1217('0x28')]['id']}})['then'](handleEntityNotFound(_0x437f54,null))[_0x1217('0x22')](removeEntity(_0x437f54,null))[_0x1217('0x35')](handleError(_0x437f54,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index b04f78a..bfaf0d5 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 _0xcc48=['ChatProactiveAction','lodash','../../config/logger','api','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x226318,_0x43f075){var _0x15c149=function(_0x28b962){while(--_0x28b962){_0x226318['push'](_0x226318['shift']());}};_0x15c149(++_0x43f075);}(_0xcc48,0x1eb));var _0x8cc4=function(_0xb3fe4b,_0x1bde5c){_0xb3fe4b=_0xb3fe4b-0x0;var _0x42027f=_0xcc48[_0xb3fe4b];return _0x42027f;};'use strict';var _=require(_0x8cc4('0x0'));var util=require('util');var logger=require(_0x8cc4('0x1'))(_0x8cc4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8cc4('0x3'));var fs=require('fs');var path=require(_0x8cc4('0x4'));var rimraf=require('rimraf');var config=require(_0x8cc4('0x5'));var attributes=require(_0x8cc4('0x6'));module[_0x8cc4('0x7')]=function(_0x2480f8,_0x21ddab){return _0x2480f8[_0x8cc4('0x8')](_0x8cc4('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07a8=['rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07a8,0x16c));var _0x807a=function(_0x1fb0fa,_0x5011bf){_0x1fb0fa=_0x1fb0fa-0x0;var _0x40eb0d=_0x07a8[_0x1fb0fa];return _0x40eb0d;};'use strict';var _=require('lodash');var util=require(_0x807a('0x0'));var logger=require(_0x807a('0x1'))('api');var moment=require(_0x807a('0x2'));var BPromise=require(_0x807a('0x3'));var rp=require(_0x807a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x807a('0x5'));var config=require('../../config/environment');var attributes=require(_0x807a('0x6'));module['exports']=function(_0x1c21f1,_0x34b543){return _0x1c21f1[_0x807a('0x7')](_0x807a('0x8'),attributes,{'tableName':'chat_proactive_actions','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 f565874..64d8d5f 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 _0x8115=['util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x243de9,_0x1897bb){var _0x58e4bd=function(_0x342b42){while(--_0x342b42){_0x243de9['push'](_0x243de9['shift']());}};_0x58e4bd(++_0x1897bb);}(_0x8115,0xa7));var _0x5811=function(_0x1106d5,_0x35d6f4){_0x1106d5=_0x1106d5-0x0;var _0x232944=_0x8115[_0x1106d5];return _0x232944;};'use strict';var _=require(_0x5811('0x0'));var util=require(_0x5811('0x1'));var moment=require('moment');var BPromise=require(_0x5811('0x2'));var rs=require(_0x5811('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5811('0x4'))['db'];var utils=require(_0x5811('0x5'));var logger=require('../../config/logger')(_0x5811('0x6'));var config=require(_0x5811('0x7'));var jayson=require(_0x5811('0x8'));var client=jayson[_0x5811('0x9')][_0x5811('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x562d06,_0x36b92c,_0x4969ea){return new BPromise(function(_0x284c20,_0xc291f){return client[_0x5811('0xb')](_0x562d06,_0x4969ea)[_0x5811('0xc')](function(_0x1f6e62){logger['info'](_0x5811('0xd'),_0x36b92c,_0x5811('0xe'));logger[_0x5811('0xf')](_0x5811('0x10'),_0x36b92c,'request\x20sent',JSON[_0x5811('0x11')](_0x1f6e62));if(_0x1f6e62[_0x5811('0x12')]){if(_0x1f6e62[_0x5811('0x12')][_0x5811('0x13')]===0x1f4){logger[_0x5811('0x12')](_0x5811('0xd'),_0x36b92c,_0x1f6e62['error'][_0x5811('0x14')]);return _0xc291f(_0x1f6e62[_0x5811('0x12')]['message']);}logger[_0x5811('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x36b92c,_0x1f6e62[_0x5811('0x12')][_0x5811('0x14')]);return _0x284c20(_0x1f6e62['error'][_0x5811('0x14')]);}else{logger[_0x5811('0x15')](_0x5811('0xd'),_0x36b92c,'request\x20sent');_0x284c20(_0x1f6e62[_0x5811('0x16')]['message']);}})[_0x5811('0x17')](function(_0x5cee72){logger[_0x5811('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x36b92c,_0x5cee72);_0xc291f(_0x5cee72);});});} \ No newline at end of file +var _0x78f9=['error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x78f9,0x14f));var _0x978f=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x78f9[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x978f('0x0'));var util=require('util');var moment=require(_0x978f('0x1'));var BPromise=require('bluebird');var rs=require(_0x978f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x978f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x978f('0x4'))(_0x978f('0x5'));var config=require(_0x978f('0x6'));var jayson=require(_0x978f('0x7'));var client=jayson[_0x978f('0x8')][_0x978f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22238c,_0x4d8311,_0x167cf2){return new BPromise(function(_0x36602e,_0x5f5617){return client[_0x978f('0xa')](_0x22238c,_0x167cf2)[_0x978f('0xb')](function(_0x335ba3){logger[_0x978f('0xc')](_0x978f('0xd'),_0x4d8311,_0x978f('0xe'));logger[_0x978f('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4d8311,'request\x20sent',JSON[_0x978f('0x10')](_0x335ba3));if(_0x335ba3[_0x978f('0x11')]){if(_0x335ba3[_0x978f('0x11')][_0x978f('0x12')]===0x1f4){logger[_0x978f('0x11')](_0x978f('0xd'),_0x4d8311,_0x335ba3[_0x978f('0x11')][_0x978f('0x13')]);return _0x5f5617(_0x335ba3[_0x978f('0x11')]['message']);}logger[_0x978f('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x4d8311,_0x335ba3[_0x978f('0x11')]['message']);return _0x36602e(_0x335ba3[_0x978f('0x11')]['message']);}else{logger[_0x978f('0xc')](_0x978f('0xd'),_0x4d8311,_0x978f('0xe'));_0x36602e(_0x335ba3[_0x978f('0x14')][_0x978f('0x13')]);}})[_0x978f('0x15')](function(_0x485e5b){logger['error'](_0x978f('0xd'),_0x4d8311,_0x485e5b);_0x5f5617(_0x485e5b);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index b52518b..9a83eed 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 _0x8958=['show','post','put','update','delete','destroy','exports','util','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated'];(function(_0x5b46b4,_0x5645c9){var _0x29632e=function(_0x15d0d9){while(--_0x15d0d9){_0x5b46b4['push'](_0x5b46b4['shift']());}};_0x29632e(++_0x5645c9);}(_0x8958,0x93));var _0x8895=function(_0x51d177,_0x4288b9){_0x51d177=_0x51d177-0x0;var _0xbf010e=_0x8958[_0x51d177];return _0xbf010e;};'use strict';var multer=require('multer');var util=require(_0x8895('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8895('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var controller=require(_0x8895('0x4'));router['get'](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0x7')]);router[_0x8895('0x8')]('/',auth[_0x8895('0x6')](),controller['create']);router[_0x8895('0x9')](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0xa')]);router[_0x8895('0xb')](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0xc')]);module[_0x8895('0xd')]=router; \ No newline at end of file +var _0x55ca=['multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','destroy','exports'];(function(_0x56fab5,_0x38e754){var _0x11cf97=function(_0x1b0af6){while(--_0x1b0af6){_0x56fab5['push'](_0x56fab5['shift']());}};_0x11cf97(++_0x38e754);}(_0x55ca,0x126));var _0xa55c=function(_0x1113d9,_0x52cd99){_0x1113d9=_0x1113d9-0x0;var _0x4a5aa2=_0x55ca[_0x1113d9];return _0x4a5aa2;};'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')](_0xa55c('0x8'),auth[_0xa55c('0x9')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x9')](),controller[_0xa55c('0xb')]);router['put'](_0xa55c('0x8'),auth[_0xa55c('0x9')](),controller['update']);router['delete'](_0xa55c('0x8'),auth[_0xa55c('0x9')](),controller[_0xa55c('0xc')]);module[_0xa55c('0xd')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index c52c466..525bd60 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 _0x881c=['sequelize','exports','STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x350a7b,_0x236625){var _0x1100f9=function(_0x2f37c3){while(--_0x2f37c3){_0x350a7b['push'](_0x350a7b['shift']());}};_0x1100f9(++_0x236625);}(_0x881c,0xf0));var _0xc881=function(_0xd7ddc4,_0x4e57dc){_0xd7ddc4=_0xd7ddc4-0x0;var _0x3d264d=_0x881c[_0xd7ddc4];return _0x3d264d;};'use strict';var Sequelize=require(_0xc881('0x0'));module[_0xc881('0x1')]={'name':{'type':Sequelize[_0xc881('0x2')],'unique':_0xc881('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc881('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc881('0x4')](_0xc881('0x5'),_0xc881('0x6'),_0xc881('0x7'))}}; \ No newline at end of file +var _0xa4ef=['roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x1067b1,_0xe1f971){var _0x46e160=function(_0x5a4752){while(--_0x5a4752){_0x1067b1['push'](_0x1067b1['shift']());}};_0x46e160(++_0xe1f971);}(_0xa4ef,0xd1));var _0xfa4e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa4ef[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0xfa4e('0x0')]={'name':{'type':Sequelize[_0xfa4e('0x1')],'unique':_0xfa4e('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfa4e('0x1')]},'timeout':{'type':Sequelize[_0xfa4e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfa4e('0x4')](_0xfa4e('0x5'),_0xfa4e('0x6'),_0xfa4e('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 7e45722..a3bd827 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 _0x73ab=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','catch','show','length','includeAll','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','params','describe','getMembers','findOne','UserChatQueue','User','UserId','agent','chatPause','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./chatQueue.socket','register','client','http','request','then','info','request\x20sent','debug','stringify','error','message','ChatQueue,\x20%s,\x20%s','sendStatus','end','status'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x73ab,0x67));var _0xb73a=function(_0x3a2118,_0x31fc3c){_0x3a2118=_0x3a2118-0x0;var _0x1d181d=_0x73ab[_0x3a2118];return _0x1d181d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb73a('0x0'));var jsonpatch=require(_0xb73a('0x1'));var rp=require(_0xb73a('0x2'));var moment=require('moment');var BPromise=require(_0xb73a('0x3'));var Mustache=require(_0xb73a('0x4'));var util=require('util');var path=require(_0xb73a('0x5'));var sox=require(_0xb73a('0x6'));var csv=require(_0xb73a('0x7'));var ejs=require(_0xb73a('0x8'));var fs=require('fs');var fs_extra=require(_0xb73a('0x9'));var _=require('lodash');var squel=require(_0xb73a('0xa'));var crypto=require(_0xb73a('0xb'));var jsforce=require(_0xb73a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb73a('0x7'));var querystring=require(_0xb73a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb73a('0xe'));var authService=require(_0xb73a('0xf'));var qs=require(_0xb73a('0x10'));var as=require(_0xb73a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb73a('0x12'))(_0xb73a('0x13'));var utils=require(_0xb73a('0x14'));var config=require(_0xb73a('0x15'));var licenseUtil=require(_0xb73a('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb73a('0x17')](config['redis'],{'host':_0xb73a('0x18'),'port':0x18eb});var socket=require(_0xb73a('0x19'))(new Redis(config[_0xb73a('0x1a')]));require(_0xb73a('0x1b'))[_0xb73a('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb73a('0x1d')][_0xb73a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x53e139,_0x382c54,_0x33a6c,_0x13354d){return new BPromise(function(_0x457fb6,_0x5f30b3){var _0x323309=_0x13354d||client;return _0x323309[_0xb73a('0x1f')](_0x53e139,_0x33a6c)[_0xb73a('0x20')](function(_0x131095){logger[_0xb73a('0x21')]('ChatQueue,\x20%s,\x20%s',_0x382c54,_0xb73a('0x22'));logger[_0xb73a('0x23')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x382c54,_0xb73a('0x22'),JSON[_0xb73a('0x24')](_0x131095));if(_0x131095['error']){if(_0x131095[_0xb73a('0x25')]['code']===0x1f4){logger[_0xb73a('0x25')]('ChatQueue,\x20%s,\x20%s',_0x382c54,_0x131095[_0xb73a('0x25')][_0xb73a('0x26')]);return _0x5f30b3(_0x131095['error'][_0xb73a('0x26')]);}logger['error'](_0xb73a('0x27'),_0x382c54,_0x131095[_0xb73a('0x25')][_0xb73a('0x26')]);return _0x457fb6(_0x131095[_0xb73a('0x25')][_0xb73a('0x26')]);}else{logger['info'](_0xb73a('0x27'),_0x382c54,_0xb73a('0x22'));_0x457fb6(_0x131095['result']['message']);}})['catch'](function(_0x460c0d){logger['error'](_0xb73a('0x27'),_0x382c54,_0x460c0d);_0x5f30b3(_0x460c0d);});});}function respondWithStatusCode(_0x5e565b,_0x114d6e){_0x114d6e=_0x114d6e||0xcc;return function(_0x16557e){if(_0x16557e){return _0x5e565b[_0xb73a('0x28')](_0x114d6e);}return _0x5e565b['status'](_0x114d6e)[_0xb73a('0x29')]();};}function respondWithResult(_0x424c86,_0x47ac83){_0x47ac83=_0x47ac83||0xc8;return function(_0x55c093){if(_0x55c093){return _0x424c86[_0xb73a('0x2a')](_0x47ac83)[_0xb73a('0x2b')](_0x55c093);}};}function respondWithFilteredResult(_0x4de8e7,_0x12c111){return function(_0x5d918e){if(_0x5d918e){var _0x23bcf6=typeof _0x12c111[_0xb73a('0x2c')]===_0xb73a('0x2d')&&typeof _0x12c111[_0xb73a('0x2e')]==='undefined';var _0x26d08c=_0x5d918e[_0xb73a('0x2f')];var _0x31c484=_0x23bcf6?0x0:_0x12c111[_0xb73a('0x2c')];var _0x313e7b=_0x23bcf6?_0x5d918e['count']:_0x12c111[_0xb73a('0x2c')]+_0x12c111['limit'];var _0x429450;if(_0x313e7b>=_0x26d08c){_0x313e7b=_0x26d08c;_0x429450=0xc8;}else{_0x429450=0xce;}_0x4de8e7['status'](_0x429450);return _0x4de8e7[_0xb73a('0x30')](_0xb73a('0x31'),_0x31c484+'-'+_0x313e7b+'/'+_0x26d08c)[_0xb73a('0x2b')](_0x5d918e);}return null;};}function patchUpdates(_0x37b5a3){return function(_0x3e5e0d){try{jsonpatch[_0xb73a('0x32')](_0x3e5e0d,_0x37b5a3,!![]);}catch(_0x2906ab){return BPromise[_0xb73a('0x33')](_0x2906ab);}return _0x3e5e0d[_0xb73a('0x34')]();};}function saveUpdates(_0x416fa0,_0x184aea){return function(_0x1aad72){if(_0x1aad72){return _0x1aad72[_0xb73a('0x35')](_0x416fa0)[_0xb73a('0x20')](function(_0x37f645){return _0x37f645;});}return null;};}function removeEntity(_0x1d6d84,_0x529e0c){return function(_0x148624){if(_0x148624){return _0x148624[_0xb73a('0x36')]()[_0xb73a('0x20')](function(){var _0xb16828=_0x148624['get']({'plain':!![]});var _0x5e6904=_0xb73a('0x37');return db[_0xb73a('0x38')][_0xb73a('0x36')]({'where':{'type':_0x5e6904,'resourceId':_0xb16828['id']}})['then'](function(){return _0x148624;});})['then'](function(){_0x1d6d84[_0xb73a('0x2a')](0xcc)[_0xb73a('0x29')]();});}};}function handleEntityNotFound(_0x5ed46c,_0x27beb9){return function(_0x31950f){if(!_0x31950f){_0x5ed46c['sendStatus'](0x194);}return _0x31950f;};}function handleError(_0x207b0f,_0x1e1afb){_0x1e1afb=_0x1e1afb||0x1f4;return function(_0xb19533){logger[_0xb73a('0x25')](_0xb19533[_0xb73a('0x39')]);if(_0xb19533['name']){delete _0xb19533[_0xb73a('0x3a')];}_0x207b0f['status'](_0x1e1afb)[_0xb73a('0x3b')](_0xb19533);};}exports[_0xb73a('0x3c')]=function(_0x484086,_0x454914){var _0x27e7fd={},_0x21aa22={},_0x16e6a6={'count':0x0,'rows':[]};var _0x413773=_[_0xb73a('0x3d')](db[_0xb73a('0x3e')][_0xb73a('0x3f')],function(_0x209346){return{'name':_0x209346[_0xb73a('0x40')],'type':_0x209346[_0xb73a('0x41')]['key']};});_0x21aa22['model']=_['map'](_0x413773,_0xb73a('0x3a'));_0x21aa22[_0xb73a('0x42')]=_[_0xb73a('0x43')](_0x484086[_0xb73a('0x42')]);_0x21aa22[_0xb73a('0x44')]=_[_0xb73a('0x45')](_0x21aa22['model'],_0x21aa22[_0xb73a('0x42')]);_0x27e7fd[_0xb73a('0x46')]=_[_0xb73a('0x45')](_0x21aa22[_0xb73a('0x47')],qs[_0xb73a('0x48')](_0x484086[_0xb73a('0x42')][_0xb73a('0x48')]));_0x27e7fd['attributes']=_0x27e7fd[_0xb73a('0x46')]['length']?_0x27e7fd[_0xb73a('0x46')]:_0x21aa22['model'];if(!_0x484086[_0xb73a('0x42')][_0xb73a('0x49')](_0xb73a('0x4a'))){_0x27e7fd[_0xb73a('0x2e')]=qs['limit'](_0x484086[_0xb73a('0x42')][_0xb73a('0x2e')]);_0x27e7fd['offset']=qs[_0xb73a('0x2c')](_0x484086[_0xb73a('0x42')][_0xb73a('0x2c')]);}_0x27e7fd[_0xb73a('0x4b')]=qs['sort'](_0x484086['query'][_0xb73a('0x4c')]);_0x27e7fd[_0xb73a('0x4d')]=qs[_0xb73a('0x44')](_[_0xb73a('0x4e')](_0x484086[_0xb73a('0x42')],_0x21aa22[_0xb73a('0x44')]),_0x413773);if(_0x484086[_0xb73a('0x42')][_0xb73a('0x4f')]){_0x27e7fd[_0xb73a('0x4d')]=_[_0xb73a('0x50')](_0x27e7fd['where'],{'$or':_[_0xb73a('0x3d')](_0x413773,function(_0x367041){if(_0x367041['type']!=='VIRTUAL'){var _0x3456b4={};_0x3456b4[_0x367041[_0xb73a('0x3a')]]={'$like':'%'+_0x484086[_0xb73a('0x42')][_0xb73a('0x4f')]+'%'};return _0x3456b4;}})});}_0x27e7fd=_['merge']({},_0x27e7fd,_0x484086['options']);var _0x4287b1={'where':_0x27e7fd[_0xb73a('0x4d')]};return db[_0xb73a('0x3e')]['count'](_0x4287b1)[_0xb73a('0x20')](function(_0x567a48){_0x16e6a6[_0xb73a('0x2f')]=_0x567a48;if(_0x484086['query']['includeAll']){_0x27e7fd[_0xb73a('0x51')]=[{'all':!![]}];}return db[_0xb73a('0x3e')][_0xb73a('0x52')](_0x27e7fd);})['then'](function(_0x40e1e4){_0x16e6a6['rows']=_0x40e1e4;return _0x16e6a6;})[_0xb73a('0x20')](respondWithFilteredResult(_0x454914,_0x27e7fd))[_0xb73a('0x53')](handleError(_0x454914,null));};exports[_0xb73a('0x54')]=function(_0x3a432d,_0x2c0315){var _0x1bac41={'raw':!![],'where':{'id':_0x3a432d['params']['id']}},_0x39727e={};_0x39727e[_0xb73a('0x47')]=_[_0xb73a('0x43')](db[_0xb73a('0x3e')][_0xb73a('0x3f')]);_0x39727e[_0xb73a('0x42')]=_[_0xb73a('0x43')](_0x3a432d[_0xb73a('0x42')]);_0x39727e[_0xb73a('0x44')]=_[_0xb73a('0x45')](_0x39727e[_0xb73a('0x47')],_0x39727e[_0xb73a('0x42')]);_0x1bac41[_0xb73a('0x46')]=_[_0xb73a('0x45')](_0x39727e[_0xb73a('0x47')],qs[_0xb73a('0x48')](_0x3a432d[_0xb73a('0x42')]['fields']));_0x1bac41[_0xb73a('0x46')]=_0x1bac41[_0xb73a('0x46')][_0xb73a('0x55')]?_0x1bac41[_0xb73a('0x46')]:_0x39727e[_0xb73a('0x47')];if(_0x3a432d['query'][_0xb73a('0x56')]){_0x1bac41['include']=[{'all':!![]}];}_0x1bac41=_[_0xb73a('0x50')]({},_0x1bac41,_0x3a432d[_0xb73a('0x57')]);return db[_0xb73a('0x3e')][_0xb73a('0x58')](_0x1bac41)[_0xb73a('0x20')](handleEntityNotFound(_0x2c0315,null))[_0xb73a('0x20')](respondWithResult(_0x2c0315,null))[_0xb73a('0x53')](handleError(_0x2c0315,null));};exports['create']=function(_0x1ee0c2,_0x441218){return db[_0xb73a('0x3e')][_0xb73a('0x59')](_0x1ee0c2[_0xb73a('0x5a')],{})[_0xb73a('0x20')](function(_0x79b6bb){var _0x3a1840=_0x1ee0c2['user'][_0xb73a('0x5b')]({'plain':!![]});if(!_0x3a1840)throw new Error(_0xb73a('0x5c'));if(_0x3a1840['role']===_0xb73a('0x5d')){var _0x28b2f6=_0x79b6bb['get']({'plain':!![]});var _0x46bc36=_0xb73a('0x37');return db[_0xb73a('0x5e')][_0xb73a('0x58')]({'where':{'name':_0x46bc36,'userProfileId':_0x3a1840[_0xb73a('0x5f')]},'raw':!![]})[_0xb73a('0x20')](function(_0x3f3755){if(_0x3f3755&&_0x3f3755[_0xb73a('0x60')]===0x0){return db[_0xb73a('0x38')][_0xb73a('0x59')]({'name':_0x28b2f6[_0xb73a('0x3a')],'resourceId':_0x28b2f6['id'],'type':_0x3f3755[_0xb73a('0x3a')],'sectionId':_0x3f3755['id']},{})[_0xb73a('0x20')](function(){return _0x79b6bb;});}else{return _0x79b6bb;}})['catch'](function(_0x4b4047){logger[_0xb73a('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b4047);throw _0x4b4047;});}return _0x79b6bb;})[_0xb73a('0x20')](respondWithResult(_0x441218,0xc9))[_0xb73a('0x53')](handleError(_0x441218,null));};exports[_0xb73a('0x35')]=function(_0x10db0b,_0x2cc9b9){if(_0x10db0b['body']['id']){delete _0x10db0b[_0xb73a('0x5a')]['id'];}return db[_0xb73a('0x3e')][_0xb73a('0x58')]({'where':{'id':_0x10db0b['params']['id']}})[_0xb73a('0x20')](handleEntityNotFound(_0x2cc9b9,null))['then'](saveUpdates(_0x10db0b[_0xb73a('0x5a')],null))[_0xb73a('0x20')](respondWithResult(_0x2cc9b9,null))['catch'](handleError(_0x2cc9b9,null));};exports[_0xb73a('0x36')]=function(_0x4d4947,_0x3cc39f){return db[_0xb73a('0x3e')][_0xb73a('0x58')]({'where':{'id':_0x4d4947[_0xb73a('0x61')]['id']}})[_0xb73a('0x20')](handleEntityNotFound(_0x3cc39f,null))['then'](removeEntity(_0x3cc39f,null))[_0xb73a('0x53')](handleError(_0x3cc39f,null));};exports[_0xb73a('0x62')]=function(_0x579ba6,_0x36160f){return db[_0xb73a('0x3e')][_0xb73a('0x62')]()['then'](respondWithResult(_0x36160f,null))[_0xb73a('0x53')](handleError(_0x36160f,null));};exports[_0xb73a('0x63')]=function(_0x12aa7a,_0x1f9900,_0x5e5b98){var _0x59c3a7={'raw':!![],'where':{}},_0x578c1e={},_0x2d061d;return db[_0xb73a('0x3e')][_0xb73a('0x64')]({'where':{'id':_0x12aa7a[_0xb73a('0x61')]['id']}})[_0xb73a('0x20')](handleEntityNotFound(_0x1f9900,null))[_0xb73a('0x20')](function(_0x516903){if(_0x516903){_0x2d061d=_0x516903['get']({'plain':!![]});_0x578c1e[_0xb73a('0x47')]=_[_0xb73a('0x43')](db[_0xb73a('0x65')][_0xb73a('0x3f')]);_0x578c1e[_0xb73a('0x42')]=_['keys'](_0x12aa7a['query']);_0x578c1e[_0xb73a('0x44')]=_[_0xb73a('0x45')](_0x578c1e[_0xb73a('0x47')],_0x578c1e[_0xb73a('0x42')]);_0x59c3a7['attributes']=_['intersection'](_0x578c1e[_0xb73a('0x47')],qs['fields'](_0x12aa7a['query'][_0xb73a('0x48')]));_0x59c3a7[_0xb73a('0x46')]=_0x59c3a7[_0xb73a('0x46')]['length']?_0x59c3a7[_0xb73a('0x46')]:_0x578c1e[_0xb73a('0x47')];if(!_0x12aa7a[_0xb73a('0x42')][_0xb73a('0x49')](_0xb73a('0x4a'))){_0x59c3a7[_0xb73a('0x2e')]=qs['limit'](_0x12aa7a[_0xb73a('0x42')][_0xb73a('0x2e')]);_0x59c3a7['offset']=qs[_0xb73a('0x2c')](_0x12aa7a[_0xb73a('0x42')][_0xb73a('0x2c')]);}_0x59c3a7[_0xb73a('0x4b')]=qs['sort'](_0x12aa7a['query'][_0xb73a('0x4c')]);_0x59c3a7[_0xb73a('0x4d')]=qs[_0xb73a('0x44')](_[_0xb73a('0x4e')](_0x12aa7a[_0xb73a('0x42')],_0x578c1e[_0xb73a('0x44')]));_0x59c3a7['where']['ChatQueueId']=_0x516903['id'];if(_0x12aa7a[_0xb73a('0x42')]['filter']){_0x59c3a7['where']=_[_0xb73a('0x50')](_0x59c3a7['where'],{'$or':_[_0xb73a('0x3d')](_0x59c3a7[_0xb73a('0x46')],function(_0x59ef00){var _0x5a593c={};_0x5a593c[_0x59ef00]={'$like':'%'+_0x12aa7a[_0xb73a('0x42')][_0xb73a('0x4f')]+'%'};return _0x5a593c;})});}_0x59c3a7=_[_0xb73a('0x50')]({},_0x59c3a7,_0x12aa7a[_0xb73a('0x57')]);return db[_0xb73a('0x65')][_0xb73a('0x52')](_0x59c3a7);}})['then'](function(_0x2c17e5){if(_0x2c17e5){return db[_0xb73a('0x66')]['findAndCountAll']({'where':{'id':_[_0xb73a('0x3d')](_0x2c17e5,_0xb73a('0x67')),'role':_0xb73a('0x68')},'attributes':['id',_0xb73a('0x3a'),_0xb73a('0x69'),'updatedAt',_0xb73a('0x6a')]});}})[_0xb73a('0x20')](function(_0x3a6c8c){if(_0x3a6c8c){return{'count':_0x3a6c8c[_0xb73a('0x2f')],'rows':_[_0xb73a('0x3d')](_0x3a6c8c['rows'],function(_0x5194aa){return{'membername':_0x5194aa[_0xb73a('0x3a')],'UserId':_0x5194aa['id'],'queue_name':_0x2d061d[_0xb73a('0x3a')],'ChatQueueId':_0x2d061d['id'],'interface':util['format'](_0xb73a('0x6b'),_0xb73a('0x6c'),_0x5194aa[_0xb73a('0x3a')]),'penalty':0x0,'paused':_0x5194aa[_0xb73a('0x69')],'createdAt':_0x5194aa[_0xb73a('0x6a')],'updatedAt':_0x5194aa['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb73a('0x20')](respondWithFilteredResult(_0x1f9900,_0x59c3a7))[_0xb73a('0x53')](handleError(_0x1f9900,null));};exports[_0xb73a('0x6d')]=function(_0x4fccc2,_0x4212d0,_0x51789a){var _0x45e2ca={};var _0x28804a={};var _0x43a355;var _0x4de103;return db[_0xb73a('0x3e')]['findOne']({'where':{'id':_0x4fccc2['params']['id']}})[_0xb73a('0x20')](handleEntityNotFound(_0x4212d0,null))['then'](function(_0x4f5bb8){if(_0x4f5bb8){_0x43a355=_0x4f5bb8;_0x28804a[_0xb73a('0x47')]=_[_0xb73a('0x43')](db[_0xb73a('0x6e')][_0xb73a('0x3f')]);_0x28804a['query']=_['keys'](_0x4fccc2[_0xb73a('0x42')]);_0x28804a[_0xb73a('0x44')]=_[_0xb73a('0x45')](_0x28804a[_0xb73a('0x47')],_0x28804a['query']);_0x45e2ca['attributes']=_[_0xb73a('0x45')](_0x28804a[_0xb73a('0x47')],qs[_0xb73a('0x48')](_0x4fccc2[_0xb73a('0x42')]['fields']));_0x45e2ca['attributes']=_0x45e2ca['attributes'][_0xb73a('0x55')]?_0x45e2ca['attributes']:_0x28804a[_0xb73a('0x47')];_0x45e2ca['order']=qs[_0xb73a('0x4c')](_0x4fccc2[_0xb73a('0x42')][_0xb73a('0x4c')]);_0x45e2ca[_0xb73a('0x4d')]=qs[_0xb73a('0x44')](_['pick'](_0x4fccc2[_0xb73a('0x42')],_0x28804a[_0xb73a('0x44')]));if(_0x4fccc2['query'][_0xb73a('0x4f')]){_0x45e2ca['where']=_[_0xb73a('0x50')](_0x45e2ca[_0xb73a('0x4d')],{'$or':_[_0xb73a('0x3d')](_0x45e2ca[_0xb73a('0x46')],function(_0x37964e){var _0x43be0f={};_0x43be0f[_0x37964e]={'$like':'%'+_0x4fccc2[_0xb73a('0x42')][_0xb73a('0x4f')]+'%'};return _0x43be0f;})});}_0x45e2ca=_[_0xb73a('0x50')]({},_0x45e2ca,_0x4fccc2[_0xb73a('0x57')]);return _0x43a355[_0xb73a('0x6d')](_0x45e2ca);}})['then'](function(_0x1173cf){if(_0x1173cf){_0x4de103=_0x1173cf[_0xb73a('0x55')];if(!_0x4fccc2[_0xb73a('0x42')][_0xb73a('0x49')](_0xb73a('0x4a'))){_0x45e2ca[_0xb73a('0x2e')]=qs['limit'](_0x4fccc2[_0xb73a('0x42')][_0xb73a('0x2e')]);_0x45e2ca[_0xb73a('0x2c')]=qs['offset'](_0x4fccc2[_0xb73a('0x42')][_0xb73a('0x2c')]);}return _0x43a355[_0xb73a('0x6d')](_0x45e2ca);}})[_0xb73a('0x20')](function(_0x3dc95c){if(_0x3dc95c){return _0x3dc95c?{'count':_0x4de103,'rows':_0x3dc95c}:null;}})[_0xb73a('0x20')](respondWithResult(_0x4212d0,null))[_0xb73a('0x53')](handleError(_0x4212d0,null));};exports[_0xb73a('0x6f')]=function(_0x4eb32a,_0x53a7aa,_0x222b74){var _0x27ba7c=_0x4eb32a[_0xb73a('0x5a')][_0xb73a('0x70')];return db[_0xb73a('0x6e')][_0xb73a('0x52')]({'where':{'id':_0x27ba7c},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb73a('0x71'),'attributes':['id',_0xb73a('0x3a'),'online','voicePause',_0xb73a('0x72')],'raw':!![]}]})['then'](function(_0x554ade){if(_0x554ade){var _0x4797f2=_[_0xb73a('0x73')](_0x554ade,function(_0x329dec){var _0x12b6a0=_0x329dec[_0xb73a('0x5b')]({'plain':!![]});return _0x12b6a0['Agents'];});return db[_0xb73a('0x3e')][_0xb73a('0x58')]({'where':{'id':_0x4eb32a[_0xb73a('0x61')]['id']}})[_0xb73a('0x20')](function(_0x208492){return db[_0xb73a('0x74')][_0xb73a('0x75')](function(_0x4f21fb){return _0x208492['addTeams'](_0x27ba7c,{'transaction':_0x4f21fb})['then'](function(){return BPromise[_0xb73a('0x76')](_0x4797f2,function(_0x2a0051){return db[_0xb73a('0x65')][_0xb73a('0x77')]({'where':{'UserId':_0x2a0051['id'],'ChatQueueId':_0x4eb32a[_0xb73a('0x61')]['id']},'transaction':_0x4f21fb});});})[_0xb73a('0x20')](function(){_0x4797f2[_0xb73a('0x78')](function(_0x351de8){socket[_0xb73a('0x79')](_0xb73a('0x7a'),{'UserId':_0x351de8['id'],'ChatQueueId':_0x208492['id']});});});});});}})['then'](respondWithStatusCode(_0x53a7aa,null))[_0xb73a('0x53')](handleError(_0x53a7aa,null));};exports[_0xb73a('0x7b')]=function(_0x33daa6,_0x517093,_0x26bca9){return db[_0xb73a('0x6e')]['findAll']({'where':{'id':_0x33daa6[_0xb73a('0x42')][_0xb73a('0x70')]},'attributes':['id'],'include':[{'model':db[_0xb73a('0x66')],'as':_0xb73a('0x71'),'attributes':['id'],'raw':!![]}]})[_0xb73a('0x20')](handleEntityNotFound(_0x517093,null))[_0xb73a('0x20')](function(_0x18c707){var _0x32609a=_['map'](_0x18c707,'id');var _0x2dba00=[];var _0x573fd1=[];var _0x5325da=squel[_0xb73a('0x7c')]();_0x5325da[_0xb73a('0x7d')]('tq.TeamId')['from'](_0xb73a('0x7e'),'tq')[_0xb73a('0x7f')]('user_has_teams','ut',_0xb73a('0x80'))[_0xb73a('0x4d')](_0xb73a('0x81'),_0x33daa6[_0xb73a('0x61')]['id']);for(var _0x395cf1=0x0;_0x395cf1<_0x18c707[_0xb73a('0x55')];_0x395cf1+=0x1){let _0x314e55=_0x18c707[_0x395cf1];for(var _0x200fc5=0x0;_0x200fc5<_0x314e55[_0xb73a('0x71')]['length'];_0x200fc5+=0x1){let _0x43229c=_0x314e55[_0xb73a('0x71')][_0x200fc5];var _0x1f3c8f=_0x5325da[_0xb73a('0x82')]();_0x1f3c8f[_0xb73a('0x4d')](_0xb73a('0x83'),_0x43229c['id']);_0x573fd1['push'](db[_0xb73a('0x74')][_0xb73a('0x42')](_0x1f3c8f[_0xb73a('0x84')](),{'type':db[_0xb73a('0x74')][_0xb73a('0x85')][_0xb73a('0x86')]})['then'](function(_0x21191c){if(_0x21191c['length']===0x1){return _0x43229c['id'];}else{var _0x4f325d=_[_0xb73a('0x87')](_[_0xb73a('0x3d')](_0x21191c,_0xb73a('0x88')),function(_0xe31d8b){return _['includes'](_0x32609a,_0xe31d8b);});if(_0x4f325d){return _0x43229c['id'];}}}));}}return BPromise['all'](_0x573fd1)[_0xb73a('0x20')](function(_0x38eb29){_0x2dba00=_(_0x2dba00)['union'](_0x38eb29)['compact']()[_0xb73a('0x89')]();return db[_0xb73a('0x3e')][_0xb73a('0x58')]({'where':{'id':_0x33daa6['params']['id']}})[_0xb73a('0x20')](function(_0x17ab2b){return db['sequelize']['transaction'](function(_0x1c0347){return _0x17ab2b[_0xb73a('0x7b')](_0x33daa6[_0xb73a('0x42')][_0xb73a('0x70')],{'transaction':_0x1c0347})[_0xb73a('0x20')](function(){if(!_[_0xb73a('0x8a')](_0x2dba00)){return _0x17ab2b[_0xb73a('0x8b')](_0x2dba00,{'transaction':_0x1c0347});}})[_0xb73a('0x20')](function(){_0x2dba00['forEach'](function(_0x523d3f){socket[_0xb73a('0x79')](_0xb73a('0x8c'),{'UserId':_0x523d3f,'ChatQueueId':_0x17ab2b['id']});});});});});});})[_0xb73a('0x20')](respondWithStatusCode(_0x517093,null))[_0xb73a('0x53')](handleError(_0x517093,null));};exports[_0xb73a('0x8d')]=function(_0x1303e7,_0x48851a,_0x183af8){return db[_0xb73a('0x3e')]['find']({'where':{'id':_0x1303e7[_0xb73a('0x61')]['id']}})['then'](handleEntityNotFound(_0x48851a,null))[_0xb73a('0x20')](function(_0x1b6167){if(_0x1b6167){return _0x1b6167['addAgents'](_0x1303e7[_0xb73a('0x5a')][_0xb73a('0x70')],_[_0xb73a('0x8e')](_0x1303e7[_0xb73a('0x5a')],[_0xb73a('0x70'),'id'])||{})[_0xb73a('0x8f')](function(_0x49f486){for(var _0x19ea6e=0x0;_0x19ea6e<_0x1303e7[_0xb73a('0x5a')][_0xb73a('0x70')][_0xb73a('0x55')];_0x19ea6e+=0x1){socket[_0xb73a('0x79')](_0xb73a('0x7a'),{'UserId':Number(_0x1303e7[_0xb73a('0x5a')][_0xb73a('0x70')][_0x19ea6e]),'ChatQueueId':Number(_0x1303e7[_0xb73a('0x61')]['id'])});}return _0x49f486;});}})[_0xb73a('0x20')](respondWithResult(_0x48851a,null))[_0xb73a('0x53')](handleError(_0x48851a,null));};exports[_0xb73a('0x8b')]=function(_0x1763fa,_0x2c913a,_0x47a237){return db['ChatQueue'][_0xb73a('0x58')]({'where':{'id':_0x1763fa['params']['id']}})[_0xb73a('0x20')](handleEntityNotFound(_0x2c913a,null))['then'](function(_0xa83734){if(_0xa83734){return _0xa83734[_0xb73a('0x8b')](_0x1763fa[_0xb73a('0x42')][_0xb73a('0x70')])['then'](function(){if(_[_0xb73a('0x90')](_0x1763fa[_0xb73a('0x42')][_0xb73a('0x70')])){for(var _0x5f0f69=0x0;_0x5f0f69<_0x1763fa[_0xb73a('0x42')][_0xb73a('0x70')][_0xb73a('0x55')];_0x5f0f69+=0x1){socket[_0xb73a('0x79')](_0xb73a('0x8c'),{'UserId':Number(_0x1763fa['query'][_0xb73a('0x70')][_0x5f0f69]),'ChatQueueId':Number(_0x1763fa[_0xb73a('0x61')]['id'])});}}else{socket[_0xb73a('0x79')](_0xb73a('0x8c'),{'UserId':Number(_0x1763fa[_0xb73a('0x42')][_0xb73a('0x70')]),'ChatQueueId':Number(_0x1763fa['params']['id'])});}});}})[_0xb73a('0x20')](respondWithStatusCode(_0x2c913a,null))[_0xb73a('0x53')](handleError(_0x2c913a,null));};exports[_0xb73a('0x91')]=function(_0x4c4d4a,_0x1aa2e9,_0x158032){var _0xa5da9b={};var _0x117eb8={};var _0x1a691f;var _0x25a62e;return db[_0xb73a('0x3e')][_0xb73a('0x64')]({'where':{'id':_0x4c4d4a[_0xb73a('0x61')]['id']}})[_0xb73a('0x20')](handleEntityNotFound(_0x1aa2e9,null))[_0xb73a('0x20')](function(_0x3b346c){if(_0x3b346c){_0x1a691f=_0x3b346c;_0x117eb8['model']=_['keys'](db[_0xb73a('0x66')][_0xb73a('0x3f')]);_0x117eb8['query']=_[_0xb73a('0x43')](_0x4c4d4a[_0xb73a('0x42')]);_0x117eb8['filters']=_['intersection'](_0x117eb8[_0xb73a('0x47')],_0x117eb8[_0xb73a('0x42')]);_0xa5da9b[_0xb73a('0x46')]=_['intersection'](_0x117eb8[_0xb73a('0x47')],qs['fields'](_0x4c4d4a[_0xb73a('0x42')][_0xb73a('0x48')]));_0xa5da9b[_0xb73a('0x46')]=_0xa5da9b[_0xb73a('0x46')]['length']?_0xa5da9b[_0xb73a('0x46')]:_0x117eb8[_0xb73a('0x47')];_0xa5da9b[_0xb73a('0x4b')]=qs[_0xb73a('0x4c')](_0x4c4d4a[_0xb73a('0x42')][_0xb73a('0x4c')]);_0xa5da9b['where']=qs['filters'](_[_0xb73a('0x4e')](_0x4c4d4a[_0xb73a('0x42')],_0x117eb8[_0xb73a('0x44')]));if(_0x4c4d4a[_0xb73a('0x42')][_0xb73a('0x4f')]){_0xa5da9b[_0xb73a('0x4d')]=_[_0xb73a('0x50')](_0xa5da9b[_0xb73a('0x4d')],{'$or':_[_0xb73a('0x3d')](_0xa5da9b[_0xb73a('0x46')],function(_0x117baf){var _0x1823d5={};_0x1823d5[_0x117baf]={'$like':'%'+_0x4c4d4a[_0xb73a('0x42')][_0xb73a('0x4f')]+'%'};return _0x1823d5;})});}_0xa5da9b=_[_0xb73a('0x50')]({},_0xa5da9b,_0x4c4d4a[_0xb73a('0x57')]);return _0x1a691f[_0xb73a('0x91')](_0xa5da9b);}})[_0xb73a('0x20')](function(_0xaa7941){if(_0xaa7941){_0x25a62e=_0xaa7941[_0xb73a('0x55')];if(!_0x4c4d4a[_0xb73a('0x42')][_0xb73a('0x49')]('nolimit')){_0xa5da9b['limit']=qs[_0xb73a('0x2e')](_0x4c4d4a[_0xb73a('0x42')][_0xb73a('0x2e')]);_0xa5da9b[_0xb73a('0x2c')]=qs[_0xb73a('0x2c')](_0x4c4d4a[_0xb73a('0x42')][_0xb73a('0x2c')]);}return _0x1a691f[_0xb73a('0x91')](_0xa5da9b);}})[_0xb73a('0x20')](function(_0x43918b){if(_0x43918b){return _0x43918b?{'count':_0x25a62e,'rows':_0x43918b}:null;}})['then'](respondWithResult(_0x1aa2e9,null))['catch'](handleError(_0x1aa2e9,null));}; \ No newline at end of file +var _0xf66a=['message','result','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','ChatQueues','UserProfileResource','destroy','name','index','map','ChatQueue','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','rows','catch','params','includeAll','options','create','body','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserChatQueue','ChatQueueId','findAll','User','findAndCountAll','agent','chatPause','createdAt','%s/%s','SIP','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','compact','value','transaction','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3a5b0b,_0x50e024){var _0x37c881=function(_0x418a37){while(--_0x418a37){_0x3a5b0b['push'](_0x3a5b0b['shift']());}};_0x37c881(++_0x50e024);}(_0xf66a,0x196));var _0xaf66=function(_0x1201d2,_0x4e166f){_0x1201d2=_0x1201d2-0x0;var _0x1a8c11=_0xf66a[_0x1201d2];return _0x1a8c11;};'use strict';var emlformat=require(_0xaf66('0x0'));var rimraf=require(_0xaf66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaf66('0x2'));var BPromise=require(_0xaf66('0x3'));var Mustache=require('mustache');var util=require(_0xaf66('0x4'));var path=require(_0xaf66('0x5'));var sox=require(_0xaf66('0x6'));var csv=require(_0xaf66('0x7'));var ejs=require(_0xaf66('0x8'));var fs=require('fs');var fs_extra=require(_0xaf66('0x9'));var _=require(_0xaf66('0xa'));var squel=require(_0xaf66('0xb'));var crypto=require(_0xaf66('0xc'));var jsforce=require(_0xaf66('0xd'));var deskjs=require(_0xaf66('0xe'));var toCsv=require(_0xaf66('0x7'));var querystring=require(_0xaf66('0xf'));var Papa=require(_0xaf66('0x10'));var Redis=require(_0xaf66('0x11'));var authService=require(_0xaf66('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf66('0x13'));var logger=require(_0xaf66('0x14'))(_0xaf66('0x15'));var utils=require(_0xaf66('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xaf66('0x17'));var db=require('../../mysqldb')['db'];config[_0xaf66('0x18')]=_[_0xaf66('0x19')](config[_0xaf66('0x18')],{'host':_0xaf66('0x1a'),'port':0x18eb});var socket=require(_0xaf66('0x1b'))(new Redis(config[_0xaf66('0x18')]));require(_0xaf66('0x1c'))[_0xaf66('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xaf66('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47cb60,_0x3b6549,_0x2b0e1f,_0x1175c7){return new BPromise(function(_0x2f91bb,_0x176aa5){var _0x27bf20=_0x1175c7||client;return _0x27bf20[_0xaf66('0x1f')](_0x47cb60,_0x2b0e1f)[_0xaf66('0x20')](function(_0x24c422){logger[_0xaf66('0x21')](_0xaf66('0x22'),_0x3b6549,_0xaf66('0x23'));logger[_0xaf66('0x24')](_0xaf66('0x25'),_0x3b6549,_0xaf66('0x23'),JSON[_0xaf66('0x26')](_0x24c422));if(_0x24c422[_0xaf66('0x27')]){if(_0x24c422[_0xaf66('0x27')][_0xaf66('0x28')]===0x1f4){logger[_0xaf66('0x27')](_0xaf66('0x22'),_0x3b6549,_0x24c422[_0xaf66('0x27')]['message']);return _0x176aa5(_0x24c422[_0xaf66('0x27')][_0xaf66('0x29')]);}logger[_0xaf66('0x27')](_0xaf66('0x22'),_0x3b6549,_0x24c422[_0xaf66('0x27')]['message']);return _0x2f91bb(_0x24c422[_0xaf66('0x27')][_0xaf66('0x29')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x3b6549,_0xaf66('0x23'));_0x2f91bb(_0x24c422[_0xaf66('0x2a')][_0xaf66('0x29')]);}})['catch'](function(_0xe7e281){logger[_0xaf66('0x27')](_0xaf66('0x22'),_0x3b6549,_0xe7e281);_0x176aa5(_0xe7e281);});});}function respondWithStatusCode(_0x564de4,_0x997219){_0x997219=_0x997219||0xcc;return function(_0xd388b5){if(_0xd388b5){return _0x564de4[_0xaf66('0x2b')](_0x997219);}return _0x564de4[_0xaf66('0x2c')](_0x997219)[_0xaf66('0x2d')]();};}function respondWithResult(_0x2bfa3b,_0x253a15){_0x253a15=_0x253a15||0xc8;return function(_0x2798a7){if(_0x2798a7){return _0x2bfa3b['status'](_0x253a15)[_0xaf66('0x2e')](_0x2798a7);}};}function respondWithFilteredResult(_0x48bdef,_0x3bd8b6){return function(_0x3f7c1d){if(_0x3f7c1d){var _0xa19814=typeof _0x3bd8b6[_0xaf66('0x2f')]===_0xaf66('0x30')&&typeof _0x3bd8b6['limit']===_0xaf66('0x30');var _0x214977=_0x3f7c1d[_0xaf66('0x31')];var _0x54c7d8=_0xa19814?0x0:_0x3bd8b6[_0xaf66('0x2f')];var _0x3f3835=_0xa19814?_0x3f7c1d[_0xaf66('0x31')]:_0x3bd8b6[_0xaf66('0x2f')]+_0x3bd8b6['limit'];var _0x2df016;if(_0x3f3835>=_0x214977){_0x3f3835=_0x214977;_0x2df016=0xc8;}else{_0x2df016=0xce;}_0x48bdef[_0xaf66('0x2c')](_0x2df016);return _0x48bdef[_0xaf66('0x32')](_0xaf66('0x33'),_0x54c7d8+'-'+_0x3f3835+'/'+_0x214977)[_0xaf66('0x2e')](_0x3f7c1d);}return null;};}function patchUpdates(_0x2cc112){return function(_0x27d061){try{jsonpatch[_0xaf66('0x34')](_0x27d061,_0x2cc112,!![]);}catch(_0x2ec891){return BPromise[_0xaf66('0x35')](_0x2ec891);}return _0x27d061['save']();};}function saveUpdates(_0x5e3b5e,_0x92ac42){return function(_0x603113){if(_0x603113){return _0x603113['update'](_0x5e3b5e)[_0xaf66('0x20')](function(_0x54dc44){return _0x54dc44;});}return null;};}function removeEntity(_0x24bd75,_0x314e19){return function(_0x74e345){if(_0x74e345){return _0x74e345['destroy']()[_0xaf66('0x20')](function(){var _0x1608b3=_0x74e345['get']({'plain':!![]});var _0x4a61df=_0xaf66('0x36');return db[_0xaf66('0x37')][_0xaf66('0x38')]({'where':{'type':_0x4a61df,'resourceId':_0x1608b3['id']}})[_0xaf66('0x20')](function(){return _0x74e345;});})['then'](function(){_0x24bd75['status'](0xcc)[_0xaf66('0x2d')]();});}};}function handleEntityNotFound(_0x2509df,_0x41de00){return function(_0x455902){if(!_0x455902){_0x2509df['sendStatus'](0x194);}return _0x455902;};}function handleError(_0x394d94,_0x582542){_0x582542=_0x582542||0x1f4;return function(_0x661f6b){logger['error'](_0x661f6b['stack']);if(_0x661f6b[_0xaf66('0x39')]){delete _0x661f6b[_0xaf66('0x39')];}_0x394d94['status'](_0x582542)['send'](_0x661f6b);};}exports[_0xaf66('0x3a')]=function(_0x24c271,_0x35ba6a){var _0x3a1da1={},_0x9d128f={},_0x2a39d9={'count':0x0,'rows':[]};var _0x5b683e=_[_0xaf66('0x3b')](db[_0xaf66('0x3c')][_0xaf66('0x3d')],function(_0x33511d){return{'name':_0x33511d['fieldName'],'type':_0x33511d['type']['key']};});_0x9d128f[_0xaf66('0x3e')]=_[_0xaf66('0x3b')](_0x5b683e,_0xaf66('0x39'));_0x9d128f[_0xaf66('0x3f')]=_[_0xaf66('0x40')](_0x24c271['query']);_0x9d128f[_0xaf66('0x41')]=_['intersection'](_0x9d128f[_0xaf66('0x3e')],_0x9d128f[_0xaf66('0x3f')]);_0x3a1da1['attributes']=_[_0xaf66('0x42')](_0x9d128f['model'],qs['fields'](_0x24c271[_0xaf66('0x3f')][_0xaf66('0x43')]));_0x3a1da1['attributes']=_0x3a1da1[_0xaf66('0x44')][_0xaf66('0x45')]?_0x3a1da1[_0xaf66('0x44')]:_0x9d128f['model'];if(!_0x24c271[_0xaf66('0x3f')][_0xaf66('0x46')](_0xaf66('0x47'))){_0x3a1da1['limit']=qs[_0xaf66('0x48')](_0x24c271[_0xaf66('0x3f')]['limit']);_0x3a1da1[_0xaf66('0x2f')]=qs[_0xaf66('0x2f')](_0x24c271[_0xaf66('0x3f')][_0xaf66('0x2f')]);}_0x3a1da1[_0xaf66('0x49')]=qs[_0xaf66('0x4a')](_0x24c271[_0xaf66('0x3f')][_0xaf66('0x4a')]);_0x3a1da1['where']=qs[_0xaf66('0x41')](_[_0xaf66('0x4b')](_0x24c271[_0xaf66('0x3f')],_0x9d128f[_0xaf66('0x41')]),_0x5b683e);if(_0x24c271[_0xaf66('0x3f')][_0xaf66('0x4c')]){_0x3a1da1[_0xaf66('0x4d')]=_[_0xaf66('0x4e')](_0x3a1da1[_0xaf66('0x4d')],{'$or':_[_0xaf66('0x3b')](_0x5b683e,function(_0x2fc2f9){if(_0x2fc2f9['type']!==_0xaf66('0x4f')){var _0x2c67ea={};_0x2c67ea[_0x2fc2f9['name']]={'$like':'%'+_0x24c271[_0xaf66('0x3f')]['filter']+'%'};return _0x2c67ea;}})});}_0x3a1da1=_[_0xaf66('0x4e')]({},_0x3a1da1,_0x24c271['options']);var _0x4e9fb0={'where':_0x3a1da1['where']};return db['ChatQueue']['count'](_0x4e9fb0)[_0xaf66('0x20')](function(_0x4fcfe1){_0x2a39d9[_0xaf66('0x31')]=_0x4fcfe1;if(_0x24c271[_0xaf66('0x3f')]['includeAll']){_0x3a1da1['include']=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x3a1da1);})[_0xaf66('0x20')](function(_0x28fe47){_0x2a39d9[_0xaf66('0x50')]=_0x28fe47;return _0x2a39d9;})[_0xaf66('0x20')](respondWithFilteredResult(_0x35ba6a,_0x3a1da1))[_0xaf66('0x51')](handleError(_0x35ba6a,null));};exports['show']=function(_0x3ba319,_0x5aee03){var _0x2f8699={'raw':!![],'where':{'id':_0x3ba319[_0xaf66('0x52')]['id']}},_0x24160d={};_0x24160d[_0xaf66('0x3e')]=_['keys'](db['ChatQueue']['rawAttributes']);_0x24160d[_0xaf66('0x3f')]=_['keys'](_0x3ba319[_0xaf66('0x3f')]);_0x24160d['filters']=_[_0xaf66('0x42')](_0x24160d[_0xaf66('0x3e')],_0x24160d[_0xaf66('0x3f')]);_0x2f8699[_0xaf66('0x44')]=_[_0xaf66('0x42')](_0x24160d[_0xaf66('0x3e')],qs[_0xaf66('0x43')](_0x3ba319['query'][_0xaf66('0x43')]));_0x2f8699[_0xaf66('0x44')]=_0x2f8699['attributes'][_0xaf66('0x45')]?_0x2f8699[_0xaf66('0x44')]:_0x24160d[_0xaf66('0x3e')];if(_0x3ba319[_0xaf66('0x3f')][_0xaf66('0x53')]){_0x2f8699['include']=[{'all':!![]}];}_0x2f8699=_[_0xaf66('0x4e')]({},_0x2f8699,_0x3ba319[_0xaf66('0x54')]);return db[_0xaf66('0x3c')]['find'](_0x2f8699)[_0xaf66('0x20')](handleEntityNotFound(_0x5aee03,null))[_0xaf66('0x20')](respondWithResult(_0x5aee03,null))[_0xaf66('0x51')](handleError(_0x5aee03,null));};exports['create']=function(_0x3d35ca,_0x46db9c){return db['ChatQueue'][_0xaf66('0x55')](_0x3d35ca[_0xaf66('0x56')],{})[_0xaf66('0x20')](function(_0x4c25a1){var _0x1637bc=_0x3d35ca[_0xaf66('0x57')][_0xaf66('0x58')]({'plain':!![]});if(!_0x1637bc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1637bc[_0xaf66('0x59')]===_0xaf66('0x57')){var _0x37b8e7=_0x4c25a1[_0xaf66('0x58')]({'plain':!![]});var _0x1a2f45=_0xaf66('0x36');return db[_0xaf66('0x5a')][_0xaf66('0x5b')]({'where':{'name':_0x1a2f45,'userProfileId':_0x1637bc[_0xaf66('0x5c')]},'raw':!![]})[_0xaf66('0x20')](function(_0x180a9e){if(_0x180a9e&&_0x180a9e[_0xaf66('0x5d')]===0x0){return db[_0xaf66('0x37')]['create']({'name':_0x37b8e7[_0xaf66('0x39')],'resourceId':_0x37b8e7['id'],'type':_0x180a9e['name'],'sectionId':_0x180a9e['id']},{})[_0xaf66('0x20')](function(){return _0x4c25a1;});}else{return _0x4c25a1;}})[_0xaf66('0x51')](function(_0x55060b){logger['error'](_0xaf66('0x5e'),_0x55060b);throw _0x55060b;});}return _0x4c25a1;})['then'](respondWithResult(_0x46db9c,0xc9))['catch'](handleError(_0x46db9c,null));};exports['update']=function(_0x6d0f5c,_0x27a988){if(_0x6d0f5c[_0xaf66('0x56')]['id']){delete _0x6d0f5c[_0xaf66('0x56')]['id'];}return db[_0xaf66('0x3c')]['find']({'where':{'id':_0x6d0f5c[_0xaf66('0x52')]['id']}})['then'](handleEntityNotFound(_0x27a988,null))[_0xaf66('0x20')](saveUpdates(_0x6d0f5c[_0xaf66('0x56')],null))[_0xaf66('0x20')](respondWithResult(_0x27a988,null))[_0xaf66('0x51')](handleError(_0x27a988,null));};exports[_0xaf66('0x38')]=function(_0x55421f,_0x4252d7){return db[_0xaf66('0x3c')][_0xaf66('0x5b')]({'where':{'id':_0x55421f[_0xaf66('0x52')]['id']}})[_0xaf66('0x20')](handleEntityNotFound(_0x4252d7,null))['then'](removeEntity(_0x4252d7,null))[_0xaf66('0x51')](handleError(_0x4252d7,null));};exports['describe']=function(_0x193b74,_0x261d38){return db['ChatQueue'][_0xaf66('0x5f')]()[_0xaf66('0x20')](respondWithResult(_0x261d38,null))[_0xaf66('0x51')](handleError(_0x261d38,null));};exports['getMembers']=function(_0x4b62d5,_0x3ea7dd,_0x10a9d1){var _0x11c843={'raw':!![],'where':{}},_0x121526={},_0x4894d2;return db[_0xaf66('0x3c')]['findOne']({'where':{'id':_0x4b62d5['params']['id']}})[_0xaf66('0x20')](handleEntityNotFound(_0x3ea7dd,null))[_0xaf66('0x20')](function(_0x2703e9){if(_0x2703e9){_0x4894d2=_0x2703e9[_0xaf66('0x58')]({'plain':!![]});_0x121526[_0xaf66('0x3e')]=_[_0xaf66('0x40')](db[_0xaf66('0x60')][_0xaf66('0x3d')]);_0x121526[_0xaf66('0x3f')]=_[_0xaf66('0x40')](_0x4b62d5[_0xaf66('0x3f')]);_0x121526[_0xaf66('0x41')]=_[_0xaf66('0x42')](_0x121526[_0xaf66('0x3e')],_0x121526[_0xaf66('0x3f')]);_0x11c843['attributes']=_[_0xaf66('0x42')](_0x121526[_0xaf66('0x3e')],qs['fields'](_0x4b62d5[_0xaf66('0x3f')][_0xaf66('0x43')]));_0x11c843[_0xaf66('0x44')]=_0x11c843[_0xaf66('0x44')][_0xaf66('0x45')]?_0x11c843['attributes']:_0x121526[_0xaf66('0x3e')];if(!_0x4b62d5[_0xaf66('0x3f')][_0xaf66('0x46')]('nolimit')){_0x11c843['limit']=qs['limit'](_0x4b62d5[_0xaf66('0x3f')][_0xaf66('0x48')]);_0x11c843[_0xaf66('0x2f')]=qs[_0xaf66('0x2f')](_0x4b62d5['query'][_0xaf66('0x2f')]);}_0x11c843[_0xaf66('0x49')]=qs['sort'](_0x4b62d5['query'][_0xaf66('0x4a')]);_0x11c843[_0xaf66('0x4d')]=qs['filters'](_[_0xaf66('0x4b')](_0x4b62d5[_0xaf66('0x3f')],_0x121526[_0xaf66('0x41')]));_0x11c843[_0xaf66('0x4d')][_0xaf66('0x61')]=_0x2703e9['id'];if(_0x4b62d5[_0xaf66('0x3f')]['filter']){_0x11c843[_0xaf66('0x4d')]=_[_0xaf66('0x4e')](_0x11c843[_0xaf66('0x4d')],{'$or':_[_0xaf66('0x3b')](_0x11c843[_0xaf66('0x44')],function(_0x291037){var _0x5940ec={};_0x5940ec[_0x291037]={'$like':'%'+_0x4b62d5[_0xaf66('0x3f')][_0xaf66('0x4c')]+'%'};return _0x5940ec;})});}_0x11c843=_[_0xaf66('0x4e')]({},_0x11c843,_0x4b62d5['options']);return db['UserChatQueue'][_0xaf66('0x62')](_0x11c843);}})[_0xaf66('0x20')](function(_0x2bec3d){if(_0x2bec3d){return db[_0xaf66('0x63')][_0xaf66('0x64')]({'where':{'id':_[_0xaf66('0x3b')](_0x2bec3d,'UserId'),'role':_0xaf66('0x65')},'attributes':['id',_0xaf66('0x39'),_0xaf66('0x66'),'updatedAt',_0xaf66('0x67')]});}})[_0xaf66('0x20')](function(_0x3855c7){if(_0x3855c7){return{'count':_0x3855c7[_0xaf66('0x31')],'rows':_[_0xaf66('0x3b')](_0x3855c7[_0xaf66('0x50')],function(_0x5daeb8){return{'membername':_0x5daeb8[_0xaf66('0x39')],'UserId':_0x5daeb8['id'],'queue_name':_0x4894d2[_0xaf66('0x39')],'ChatQueueId':_0x4894d2['id'],'interface':util['format'](_0xaf66('0x68'),_0xaf66('0x69'),_0x5daeb8[_0xaf66('0x39')]),'penalty':0x0,'paused':_0x5daeb8[_0xaf66('0x66')],'createdAt':_0x5daeb8[_0xaf66('0x67')],'updatedAt':_0x5daeb8[_0xaf66('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xaf66('0x20')](respondWithFilteredResult(_0x3ea7dd,_0x11c843))[_0xaf66('0x51')](handleError(_0x3ea7dd,null));};exports[_0xaf66('0x6b')]=function(_0x32d90b,_0x4b8f54,_0x51a83d){var _0x49c7f4={};var _0x433e0b={};var _0x1e83bd;var _0x29bd47;return db['ChatQueue'][_0xaf66('0x6c')]({'where':{'id':_0x32d90b[_0xaf66('0x52')]['id']}})[_0xaf66('0x20')](handleEntityNotFound(_0x4b8f54,null))[_0xaf66('0x20')](function(_0x292cee){if(_0x292cee){_0x1e83bd=_0x292cee;_0x433e0b[_0xaf66('0x3e')]=_[_0xaf66('0x40')](db[_0xaf66('0x6d')][_0xaf66('0x3d')]);_0x433e0b['query']=_[_0xaf66('0x40')](_0x32d90b[_0xaf66('0x3f')]);_0x433e0b['filters']=_[_0xaf66('0x42')](_0x433e0b[_0xaf66('0x3e')],_0x433e0b[_0xaf66('0x3f')]);_0x49c7f4[_0xaf66('0x44')]=_[_0xaf66('0x42')](_0x433e0b[_0xaf66('0x3e')],qs[_0xaf66('0x43')](_0x32d90b[_0xaf66('0x3f')][_0xaf66('0x43')]));_0x49c7f4[_0xaf66('0x44')]=_0x49c7f4[_0xaf66('0x44')][_0xaf66('0x45')]?_0x49c7f4[_0xaf66('0x44')]:_0x433e0b[_0xaf66('0x3e')];_0x49c7f4[_0xaf66('0x49')]=qs[_0xaf66('0x4a')](_0x32d90b[_0xaf66('0x3f')][_0xaf66('0x4a')]);_0x49c7f4[_0xaf66('0x4d')]=qs[_0xaf66('0x41')](_[_0xaf66('0x4b')](_0x32d90b[_0xaf66('0x3f')],_0x433e0b[_0xaf66('0x41')]));if(_0x32d90b[_0xaf66('0x3f')][_0xaf66('0x4c')]){_0x49c7f4[_0xaf66('0x4d')]=_[_0xaf66('0x4e')](_0x49c7f4[_0xaf66('0x4d')],{'$or':_['map'](_0x49c7f4[_0xaf66('0x44')],function(_0x336787){var _0x3a2d34={};_0x3a2d34[_0x336787]={'$like':'%'+_0x32d90b['query'][_0xaf66('0x4c')]+'%'};return _0x3a2d34;})});}_0x49c7f4=_['merge']({},_0x49c7f4,_0x32d90b[_0xaf66('0x54')]);return _0x1e83bd[_0xaf66('0x6b')](_0x49c7f4);}})[_0xaf66('0x20')](function(_0x28e98d){if(_0x28e98d){_0x29bd47=_0x28e98d[_0xaf66('0x45')];if(!_0x32d90b[_0xaf66('0x3f')]['hasOwnProperty'](_0xaf66('0x47'))){_0x49c7f4[_0xaf66('0x48')]=qs[_0xaf66('0x48')](_0x32d90b[_0xaf66('0x3f')]['limit']);_0x49c7f4[_0xaf66('0x2f')]=qs[_0xaf66('0x2f')](_0x32d90b[_0xaf66('0x3f')][_0xaf66('0x2f')]);}return _0x1e83bd[_0xaf66('0x6b')](_0x49c7f4);}})[_0xaf66('0x20')](function(_0x417d3c){if(_0x417d3c){return _0x417d3c?{'count':_0x29bd47,'rows':_0x417d3c}:null;}})['then'](respondWithResult(_0x4b8f54,null))[_0xaf66('0x51')](handleError(_0x4b8f54,null));};exports[_0xaf66('0x6e')]=function(_0x1aa7c6,_0x57918d,_0xd567f1){var _0x284f4f=_0x1aa7c6[_0xaf66('0x56')][_0xaf66('0x6f')];return db[_0xaf66('0x6d')][_0xaf66('0x62')]({'where':{'id':_0x284f4f},'attributes':['id'],'include':[{'model':db[_0xaf66('0x63')],'as':_0xaf66('0x70'),'attributes':['id','name',_0xaf66('0x71'),_0xaf66('0x72'),'interface'],'raw':!![]}]})[_0xaf66('0x20')](function(_0x2de015){if(_0x2de015){var _0x57d725=_[_0xaf66('0x73')](_0x2de015,function(_0x15b6f0){var _0x747685=_0x15b6f0[_0xaf66('0x58')]({'plain':!![]});return _0x747685[_0xaf66('0x70')];});return db['ChatQueue']['find']({'where':{'id':_0x1aa7c6[_0xaf66('0x52')]['id']}})[_0xaf66('0x20')](function(_0x374cd2){return db[_0xaf66('0x74')]['transaction'](function(_0x37ea16){return _0x374cd2['addTeams'](_0x284f4f,{'transaction':_0x37ea16})[_0xaf66('0x20')](function(){return BPromise[_0xaf66('0x75')](_0x57d725,function(_0x121081){return db[_0xaf66('0x60')][_0xaf66('0x76')]({'where':{'UserId':_0x121081['id'],'ChatQueueId':_0x1aa7c6[_0xaf66('0x52')]['id']},'transaction':_0x37ea16});});})['then'](function(){_0x57d725[_0xaf66('0x77')](function(_0x58bf8f){socket[_0xaf66('0x78')](_0xaf66('0x79'),{'UserId':_0x58bf8f['id'],'ChatQueueId':_0x374cd2['id']});});});});});}})[_0xaf66('0x20')](respondWithStatusCode(_0x57918d,null))['catch'](handleError(_0x57918d,null));};exports[_0xaf66('0x7a')]=function(_0x1d50ab,_0x27c69c,_0x53ca0a){return db[_0xaf66('0x6d')][_0xaf66('0x62')]({'where':{'id':_0x1d50ab[_0xaf66('0x3f')]['ids']},'attributes':['id'],'include':[{'model':db[_0xaf66('0x63')],'as':_0xaf66('0x70'),'attributes':['id'],'raw':!![]}]})[_0xaf66('0x20')](handleEntityNotFound(_0x27c69c,null))[_0xaf66('0x20')](function(_0x3eece6){var _0x416301=_[_0xaf66('0x3b')](_0x3eece6,'id');var _0x3a5dd7=[];var _0x145f08=[];var _0x53867a=squel[_0xaf66('0x7b')]();_0x53867a[_0xaf66('0x7c')](_0xaf66('0x7d'))[_0xaf66('0x7e')]('team_has_chat_queues','tq')[_0xaf66('0x7f')](_0xaf66('0x80'),'ut',_0xaf66('0x81'))[_0xaf66('0x4d')](_0xaf66('0x82'),_0x1d50ab[_0xaf66('0x52')]['id']);for(var _0x18fe40=0x0;_0x18fe40<_0x3eece6[_0xaf66('0x45')];_0x18fe40+=0x1){let _0x238a8f=_0x3eece6[_0x18fe40];for(var _0x53b281=0x0;_0x53b281<_0x238a8f['Agents'][_0xaf66('0x45')];_0x53b281+=0x1){let _0x521d64=_0x238a8f['Agents'][_0x53b281];var _0x5d5b09=_0x53867a['clone']();_0x5d5b09[_0xaf66('0x4d')](_0xaf66('0x83'),_0x521d64['id']);_0x145f08[_0xaf66('0x84')](db['sequelize'][_0xaf66('0x3f')](_0x5d5b09[_0xaf66('0x85')](),{'type':db[_0xaf66('0x74')][_0xaf66('0x86')]['SELECT']})[_0xaf66('0x20')](function(_0x29f173){if(_0x29f173[_0xaf66('0x45')]===0x1){return _0x521d64['id'];}else{var _0x41202e=_[_0xaf66('0x87')](_['map'](_0x29f173,_0xaf66('0x88')),function(_0x187e7e){return _['includes'](_0x416301,_0x187e7e);});if(_0x41202e){return _0x521d64['id'];}}}));}}return BPromise[_0xaf66('0x89')](_0x145f08)[_0xaf66('0x20')](function(_0xaa2de8){_0x3a5dd7=_(_0x3a5dd7)[_0xaf66('0x8a')](_0xaa2de8)[_0xaf66('0x8b')]()[_0xaf66('0x8c')]();return db[_0xaf66('0x3c')][_0xaf66('0x5b')]({'where':{'id':_0x1d50ab[_0xaf66('0x52')]['id']}})[_0xaf66('0x20')](function(_0x4c5c18){return db[_0xaf66('0x74')][_0xaf66('0x8d')](function(_0x1b3f7f){return _0x4c5c18[_0xaf66('0x7a')](_0x1d50ab[_0xaf66('0x3f')][_0xaf66('0x6f')],{'transaction':_0x1b3f7f})[_0xaf66('0x20')](function(){if(!_['isEmpty'](_0x3a5dd7)){return _0x4c5c18[_0xaf66('0x8e')](_0x3a5dd7,{'transaction':_0x1b3f7f});}})['then'](function(){_0x3a5dd7['forEach'](function(_0x386ddb){socket[_0xaf66('0x78')](_0xaf66('0x8f'),{'UserId':_0x386ddb,'ChatQueueId':_0x4c5c18['id']});});});});});});})[_0xaf66('0x20')](respondWithStatusCode(_0x27c69c,null))[_0xaf66('0x51')](handleError(_0x27c69c,null));};exports[_0xaf66('0x90')]=function(_0x32f9f4,_0x4870c8,_0x100705){return db[_0xaf66('0x3c')][_0xaf66('0x5b')]({'where':{'id':_0x32f9f4['params']['id']}})['then'](handleEntityNotFound(_0x4870c8,null))[_0xaf66('0x20')](function(_0x1cfd4e){if(_0x1cfd4e){return _0x1cfd4e[_0xaf66('0x90')](_0x32f9f4[_0xaf66('0x56')][_0xaf66('0x6f')],_[_0xaf66('0x91')](_0x32f9f4['body'],['ids','id'])||{})[_0xaf66('0x92')](function(_0x2368e2){for(var _0x3bd602=0x0;_0x3bd602<_0x32f9f4[_0xaf66('0x56')][_0xaf66('0x6f')][_0xaf66('0x45')];_0x3bd602+=0x1){socket[_0xaf66('0x78')](_0xaf66('0x79'),{'UserId':Number(_0x32f9f4['body'][_0xaf66('0x6f')][_0x3bd602]),'ChatQueueId':Number(_0x32f9f4[_0xaf66('0x52')]['id'])});}return _0x2368e2;});}})['then'](respondWithResult(_0x4870c8,null))['catch'](handleError(_0x4870c8,null));};exports[_0xaf66('0x8e')]=function(_0x1d6bdf,_0x14c593,_0x22fb11){return db[_0xaf66('0x3c')]['find']({'where':{'id':_0x1d6bdf[_0xaf66('0x52')]['id']}})[_0xaf66('0x20')](handleEntityNotFound(_0x14c593,null))[_0xaf66('0x20')](function(_0x207609){if(_0x207609){return _0x207609['removeAgents'](_0x1d6bdf[_0xaf66('0x3f')][_0xaf66('0x6f')])[_0xaf66('0x20')](function(){if(_[_0xaf66('0x93')](_0x1d6bdf['query'][_0xaf66('0x6f')])){for(var _0x359924=0x0;_0x359924<_0x1d6bdf[_0xaf66('0x3f')][_0xaf66('0x6f')][_0xaf66('0x45')];_0x359924+=0x1){socket[_0xaf66('0x78')](_0xaf66('0x8f'),{'UserId':Number(_0x1d6bdf[_0xaf66('0x3f')][_0xaf66('0x6f')][_0x359924]),'ChatQueueId':Number(_0x1d6bdf[_0xaf66('0x52')]['id'])});}}else{socket['emit'](_0xaf66('0x8f'),{'UserId':Number(_0x1d6bdf[_0xaf66('0x3f')]['ids']),'ChatQueueId':Number(_0x1d6bdf['params']['id'])});}});}})['then'](respondWithStatusCode(_0x14c593,null))[_0xaf66('0x51')](handleError(_0x14c593,null));};exports['getAgents']=function(_0xc09c38,_0xe6e0ff,_0x544441){var _0xfe69f={};var _0xc679={};var _0x56d16c;var _0x503e4b;return db['ChatQueue']['findOne']({'where':{'id':_0xc09c38[_0xaf66('0x52')]['id']}})[_0xaf66('0x20')](handleEntityNotFound(_0xe6e0ff,null))[_0xaf66('0x20')](function(_0x3d1c65){if(_0x3d1c65){_0x56d16c=_0x3d1c65;_0xc679['model']=_[_0xaf66('0x40')](db['User'][_0xaf66('0x3d')]);_0xc679[_0xaf66('0x3f')]=_['keys'](_0xc09c38['query']);_0xc679['filters']=_[_0xaf66('0x42')](_0xc679['model'],_0xc679[_0xaf66('0x3f')]);_0xfe69f[_0xaf66('0x44')]=_['intersection'](_0xc679[_0xaf66('0x3e')],qs['fields'](_0xc09c38[_0xaf66('0x3f')][_0xaf66('0x43')]));_0xfe69f[_0xaf66('0x44')]=_0xfe69f[_0xaf66('0x44')][_0xaf66('0x45')]?_0xfe69f[_0xaf66('0x44')]:_0xc679[_0xaf66('0x3e')];_0xfe69f[_0xaf66('0x49')]=qs['sort'](_0xc09c38['query'][_0xaf66('0x4a')]);_0xfe69f[_0xaf66('0x4d')]=qs[_0xaf66('0x41')](_['pick'](_0xc09c38[_0xaf66('0x3f')],_0xc679[_0xaf66('0x41')]));if(_0xc09c38['query'][_0xaf66('0x4c')]){_0xfe69f[_0xaf66('0x4d')]=_[_0xaf66('0x4e')](_0xfe69f[_0xaf66('0x4d')],{'$or':_[_0xaf66('0x3b')](_0xfe69f['attributes'],function(_0xf49a6f){var _0x5e39aa={};_0x5e39aa[_0xf49a6f]={'$like':'%'+_0xc09c38[_0xaf66('0x3f')]['filter']+'%'};return _0x5e39aa;})});}_0xfe69f=_[_0xaf66('0x4e')]({},_0xfe69f,_0xc09c38[_0xaf66('0x54')]);return _0x56d16c[_0xaf66('0x94')](_0xfe69f);}})['then'](function(_0x2b5f11){if(_0x2b5f11){_0x503e4b=_0x2b5f11['length'];if(!_0xc09c38[_0xaf66('0x3f')][_0xaf66('0x46')]('nolimit')){_0xfe69f[_0xaf66('0x48')]=qs['limit'](_0xc09c38[_0xaf66('0x3f')]['limit']);_0xfe69f['offset']=qs[_0xaf66('0x2f')](_0xc09c38[_0xaf66('0x3f')][_0xaf66('0x2f')]);}return _0x56d16c[_0xaf66('0x94')](_0xfe69f);}})[_0xaf66('0x20')](function(_0x5c6983){if(_0x5c6983){return _0x5c6983?{'count':_0x503e4b,'rows':_0x5c6983}:null;}})[_0xaf66('0x20')](respondWithResult(_0xe6e0ff,null))[_0xaf66('0x51')](handleError(_0xe6e0ff,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 1e9b7ab..b58a2e5 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 _0xc9b6=['ChatQueue','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x1819bd,_0x15e90e){var _0x5b5f76=function(_0x358907){while(--_0x358907){_0x1819bd['push'](_0x1819bd['shift']());}};_0x5b5f76(++_0x15e90e);}(_0xc9b6,0xb6));var _0x6c9b=function(_0x3f59e7,_0x3ac9df){_0x3f59e7=_0x3f59e7-0x0;var _0x26e855=_0xc9b6[_0x3f59e7];return _0x26e855;};'use strict';var EventEmitter=require(_0x6c9b('0x0'));var ChatQueue=require(_0x6c9b('0x1'))['db'][_0x6c9b('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6c9b('0x3'),'afterUpdate':_0x6c9b('0x4'),'afterDestroy':_0x6c9b('0x5')};function emitEvent(_0x4a9305){return function(_0x44a559,_0x25300b,_0x855dc9){ChatQueueEvents[_0x6c9b('0x6')](_0x4a9305+':'+_0x44a559['id'],_0x44a559);ChatQueueEvents[_0x6c9b('0x6')](_0x4a9305,_0x44a559);_0x855dc9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x6c9b('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x7ab1=['update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x192807,_0x17de9e){var _0x4061df=function(_0x44eed9){while(--_0x44eed9){_0x192807['push'](_0x192807['shift']());}};_0x4061df(++_0x17de9e);}(_0x7ab1,0x1b5));var _0x17ab=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7ab1[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x17ab('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x17ab('0x1'),'afterDestroy':_0x17ab('0x2')};function emitEvent(_0x3f3cf0){return function(_0x29b082,_0x158d0d,_0x15919c){ChatQueueEvents['emit'](_0x3f3cf0+':'+_0x29b082['id'],_0x29b082);ChatQueueEvents[_0x17ab('0x3')](_0x3f3cf0,_0x29b082);_0x15919c(null);};}for(var e in events){if(events[_0x17ab('0x4')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x17ab('0x5')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index ab95141..b8bd462 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 _0x480b=['util','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','ChatQueue','chat_queues','lodash'];(function(_0x50b918,_0x12064c){var _0x21c735=function(_0x269229){while(--_0x269229){_0x50b918['push'](_0x50b918['shift']());}};_0x21c735(++_0x12064c);}(_0x480b,0x78));var _0xb480=function(_0x518c4a,_0x1139bb){_0x518c4a=_0x518c4a-0x0;var _0x4daca4=_0x480b[_0x518c4a];return _0x4daca4;};'use strict';var _=require(_0xb480('0x0'));var util=require(_0xb480('0x1'));var logger=require('../../config/logger')(_0xb480('0x2'));var moment=require(_0xb480('0x3'));var BPromise=require(_0xb480('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb480('0x5'));var rimraf=require(_0xb480('0x6'));var config=require(_0xb480('0x7'));var attributes=require(_0xb480('0x8'));module['exports']=function(_0x11a56f,_0x2fbb4b){return _0x11a56f['define'](_0xb480('0x9'),attributes,{'tableName':_0xb480('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6be9=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','util'];(function(_0x1d7300,_0x17f109){var _0x46ee98=function(_0x5ee16a){while(--_0x5ee16a){_0x1d7300['push'](_0x1d7300['shift']());}};_0x46ee98(++_0x17f109);}(_0x6be9,0x66));var _0x96be=function(_0x2ed989,_0xf3616){_0x2ed989=_0x2ed989-0x0;var _0x1200f3=_0x6be9[_0x2ed989];return _0x1200f3;};'use strict';var _=require(_0x96be('0x0'));var util=require(_0x96be('0x1'));var logger=require(_0x96be('0x2'))(_0x96be('0x3'));var moment=require('moment');var BPromise=require(_0x96be('0x4'));var rp=require(_0x96be('0x5'));var fs=require('fs');var path=require(_0x96be('0x6'));var rimraf=require(_0x96be('0x7'));var config=require(_0x96be('0x8'));var attributes=require(_0x96be('0x9'));module[_0x96be('0xa')]=function(_0x2c3c37,_0x1a0cde){return _0x2c3c37[_0x96be('0xb')](_0x96be('0xc'),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 d559cce..65f1006 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 _0x7aa0=['rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','limit','map','include','model','debug','stringify','catch','ShowChatQueue','find','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0x7aa0,0xa1));var _0x07aa=function(_0x366c77,_0x20e6a8){_0x366c77=_0x366c77-0x0;var _0x5b1950=_0x7aa0[_0x366c77];return _0x5b1950;};'use strict';var _=require(_0x07aa('0x0'));var util=require(_0x07aa('0x1'));var moment=require(_0x07aa('0x2'));var BPromise=require(_0x07aa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x07aa('0x4'))['db'];var utils=require(_0x07aa('0x5'));var logger=require(_0x07aa('0x6'))(_0x07aa('0x7'));var config=require(_0x07aa('0x8'));var jayson=require(_0x07aa('0x9'));var client=jayson['client'][_0x07aa('0xa')]({'port':0x232a});config['redis']=_[_0x07aa('0xb')](config['redis'],{'host':_0x07aa('0xc'),'port':0x18eb});var socket=require(_0x07aa('0xd'))(new Redis(config[_0x07aa('0xe')]));require(_0x07aa('0xf'))[_0x07aa('0x10')](socket);function respondWithRpcPromise(_0x18064b,_0xddeeba,_0x150026){return new BPromise(function(_0x4803dc,_0x2d11de){return client['request'](_0x18064b,_0x150026)[_0x07aa('0x11')](function(_0x13d341){logger[_0x07aa('0x12')](_0x07aa('0x13'),_0xddeeba,_0x07aa('0x14'));logger['debug'](_0x07aa('0x15'),_0xddeeba,_0x07aa('0x14'),JSON['stringify'](_0x13d341));if(_0x13d341[_0x07aa('0x16')]){if(_0x13d341['error'][_0x07aa('0x17')]===0x1f4){logger['error'](_0x07aa('0x13'),_0xddeeba,_0x13d341[_0x07aa('0x16')][_0x07aa('0x18')]);return _0x2d11de(_0x13d341['error']['message']);}logger[_0x07aa('0x16')](_0x07aa('0x13'),_0xddeeba,_0x13d341[_0x07aa('0x16')][_0x07aa('0x18')]);return _0x4803dc(_0x13d341[_0x07aa('0x16')]['message']);}else{logger[_0x07aa('0x12')](_0x07aa('0x13'),_0xddeeba,'request\x20sent');_0x4803dc(_0x13d341[_0x07aa('0x19')][_0x07aa('0x18')]);}})['catch'](function(_0x1b3d3e){logger[_0x07aa('0x16')](_0x07aa('0x13'),_0xddeeba,_0x1b3d3e);_0x2d11de(_0x1b3d3e);});});}exports[_0x07aa('0x1a')]=function(_0xd18462){var _0x5548fd=this;return new Promise(function(_0x13f865,_0x517ea1){return db[_0x07aa('0x1b')][_0x07aa('0x1c')]({'raw':_0xd18462['options']?_0xd18462['options'][_0x07aa('0x1d')]===undefined?!![]:![]:!![],'where':_0xd18462[_0x07aa('0x1e')]?_0xd18462[_0x07aa('0x1e')][_0x07aa('0x1f')]||null:null,'attributes':_0xd18462['options']?_0xd18462[_0x07aa('0x1e')][_0x07aa('0x20')]||null:null,'limit':_0xd18462[_0x07aa('0x1e')]?_0xd18462[_0x07aa('0x1e')][_0x07aa('0x21')]||null:null,'include':_0xd18462[_0x07aa('0x1e')]?_0xd18462[_0x07aa('0x1e')]['include']?_[_0x07aa('0x22')](_0xd18462[_0x07aa('0x1e')][_0x07aa('0x23')],function(_0x4fe949){return{'model':db[_0x4fe949[_0x07aa('0x24')]],'as':_0x4fe949['as'],'attributes':_0x4fe949[_0x07aa('0x20')],'include':_0x4fe949[_0x07aa('0x23')]?_['map'](_0x4fe949[_0x07aa('0x23')],function(_0x4aacbd){return{'model':db[_0x4aacbd[_0x07aa('0x24')]],'as':_0x4aacbd['as'],'attributes':_0x4aacbd['attributes'],'include':_0x4aacbd[_0x07aa('0x23')]?_[_0x07aa('0x22')](_0x4aacbd[_0x07aa('0x23')],function(_0x3c55ab){return{'model':db[_0x3c55ab[_0x07aa('0x24')]],'as':_0x3c55ab['as'],'attributes':_0x3c55ab[_0x07aa('0x20')]};}):[]};}):[]};}):[]:[]})[_0x07aa('0x11')](function(_0xa8f57d){logger[_0x07aa('0x12')](_0x07aa('0x1a'),_0xd18462);logger[_0x07aa('0x25')](_0x07aa('0x1a'),_0xd18462,JSON[_0x07aa('0x26')](_0xa8f57d));_0x13f865(_0xa8f57d);})[_0x07aa('0x27')](function(_0x156134){logger['error'](_0x07aa('0x1a'),_0x156134[_0x07aa('0x18')],_0xd18462);_0x517ea1(_0x5548fd[_0x07aa('0x16')](0x1f4,_0x156134[_0x07aa('0x18')]));});});};exports[_0x07aa('0x28')]=function(_0x4317f8){var _0x273f3d=this;return new Promise(function(_0x2cc824,_0xe18859){return db['ChatQueue'][_0x07aa('0x29')]({'raw':_0x4317f8[_0x07aa('0x1e')]?_0x4317f8[_0x07aa('0x1e')][_0x07aa('0x1d')]===undefined?!![]:![]:!![],'where':_0x4317f8['options']?_0x4317f8[_0x07aa('0x1e')][_0x07aa('0x1f')]||null:null,'attributes':_0x4317f8[_0x07aa('0x1e')]?_0x4317f8[_0x07aa('0x1e')][_0x07aa('0x20')]||null:null,'include':_0x4317f8['options']?_0x4317f8[_0x07aa('0x1e')]['include']?_[_0x07aa('0x22')](_0x4317f8[_0x07aa('0x1e')][_0x07aa('0x23')],function(_0x30f283){return{'model':db[_0x30f283[_0x07aa('0x24')]],'as':_0x30f283['as'],'attributes':_0x30f283[_0x07aa('0x20')],'include':_0x30f283[_0x07aa('0x23')]?_['map'](_0x30f283[_0x07aa('0x23')],function(_0x2e900d){return{'model':db[_0x2e900d[_0x07aa('0x24')]],'as':_0x2e900d['as'],'attributes':_0x2e900d[_0x07aa('0x20')],'include':_0x2e900d[_0x07aa('0x23')]?_[_0x07aa('0x22')](_0x2e900d[_0x07aa('0x23')],function(_0x4e2750){return{'model':db[_0x4e2750[_0x07aa('0x24')]],'as':_0x4e2750['as'],'attributes':_0x4e2750[_0x07aa('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1dd86e){logger[_0x07aa('0x12')](_0x07aa('0x28'),_0x4317f8);logger['debug']('ShowChatQueue',_0x4317f8,JSON[_0x07aa('0x26')](_0x1dd86e));_0x2cc824(_0x1dd86e);})[_0x07aa('0x27')](function(_0x4b8184){logger['error']('ShowChatQueue',_0x4b8184[_0x07aa('0x18')],_0x4317f8);_0xe18859(_0x273f3d[_0x07aa('0x16')](0x1f4,_0x4b8184[_0x07aa('0x18')]));});});}; \ No newline at end of file +var _0x672d=['message','result','catch','ChatQueue','options','raw','where','attributes','limit','map','model','include','GetChatQueue','ShowChatQueue','find','lodash','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x219d87,_0x1cb6f7){var _0x22823d=function(_0x5357bf){while(--_0x5357bf){_0x219d87['push'](_0x219d87['shift']());}};_0x22823d(++_0x1cb6f7);}(_0x672d,0x181));var _0xd672=function(_0x4748b5,_0x442d0a){_0x4748b5=_0x4748b5-0x0;var _0x311a30=_0x672d[_0x4748b5];return _0x311a30;};'use strict';var _=require(_0xd672('0x0'));var util=require('util');var moment=require(_0xd672('0x1'));var BPromise=require(_0xd672('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd672('0x3'));var logger=require(_0xd672('0x4'))('rpc');var config=require(_0xd672('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd672('0x6')][_0xd672('0x7')]({'port':0x232a});config[_0xd672('0x8')]=_[_0xd672('0x9')](config[_0xd672('0x8')],{'host':_0xd672('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd672('0x8')]));require(_0xd672('0xb'))[_0xd672('0xc')](socket);function respondWithRpcPromise(_0x431bfa,_0x218c6f,_0x41289b){return new BPromise(function(_0x4e87ba,_0x5ae10e){return client[_0xd672('0xd')](_0x431bfa,_0x41289b)[_0xd672('0xe')](function(_0x46f78b){logger[_0xd672('0xf')](_0xd672('0x10'),_0x218c6f,'request\x20sent');logger[_0xd672('0x11')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x218c6f,_0xd672('0x12'),JSON[_0xd672('0x13')](_0x46f78b));if(_0x46f78b[_0xd672('0x14')]){if(_0x46f78b['error'][_0xd672('0x15')]===0x1f4){logger[_0xd672('0x14')](_0xd672('0x10'),_0x218c6f,_0x46f78b[_0xd672('0x14')][_0xd672('0x16')]);return _0x5ae10e(_0x46f78b[_0xd672('0x14')]['message']);}logger[_0xd672('0x14')](_0xd672('0x10'),_0x218c6f,_0x46f78b[_0xd672('0x14')]['message']);return _0x4e87ba(_0x46f78b[_0xd672('0x14')][_0xd672('0x16')]);}else{logger[_0xd672('0xf')](_0xd672('0x10'),_0x218c6f,'request\x20sent');_0x4e87ba(_0x46f78b[_0xd672('0x17')][_0xd672('0x16')]);}})[_0xd672('0x18')](function(_0x3a99d8){logger[_0xd672('0x14')](_0xd672('0x10'),_0x218c6f,_0x3a99d8);_0x5ae10e(_0x3a99d8);});});}exports['GetChatQueue']=function(_0x236bd7){var _0x486ba1=this;return new Promise(function(_0x1cda11,_0x5604cb){return db[_0xd672('0x19')]['findAll']({'raw':_0x236bd7[_0xd672('0x1a')]?_0x236bd7['options'][_0xd672('0x1b')]===undefined?!![]:![]:!![],'where':_0x236bd7[_0xd672('0x1a')]?_0x236bd7[_0xd672('0x1a')][_0xd672('0x1c')]||null:null,'attributes':_0x236bd7['options']?_0x236bd7[_0xd672('0x1a')][_0xd672('0x1d')]||null:null,'limit':_0x236bd7[_0xd672('0x1a')]?_0x236bd7[_0xd672('0x1a')][_0xd672('0x1e')]||null:null,'include':_0x236bd7[_0xd672('0x1a')]?_0x236bd7[_0xd672('0x1a')]['include']?_[_0xd672('0x1f')](_0x236bd7['options']['include'],function(_0x314d7d){return{'model':db[_0x314d7d[_0xd672('0x20')]],'as':_0x314d7d['as'],'attributes':_0x314d7d['attributes'],'include':_0x314d7d[_0xd672('0x21')]?_[_0xd672('0x1f')](_0x314d7d[_0xd672('0x21')],function(_0x5764e2){return{'model':db[_0x5764e2['model']],'as':_0x5764e2['as'],'attributes':_0x5764e2['attributes'],'include':_0x5764e2[_0xd672('0x21')]?_['map'](_0x5764e2['include'],function(_0x549c5e){return{'model':db[_0x549c5e['model']],'as':_0x549c5e['as'],'attributes':_0x549c5e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x526a90){logger[_0xd672('0xf')]('GetChatQueue',_0x236bd7);logger['debug'](_0xd672('0x22'),_0x236bd7,JSON[_0xd672('0x13')](_0x526a90));_0x1cda11(_0x526a90);})[_0xd672('0x18')](function(_0x8ef91d){logger[_0xd672('0x14')](_0xd672('0x22'),_0x8ef91d[_0xd672('0x16')],_0x236bd7);_0x5604cb(_0x486ba1[_0xd672('0x14')](0x1f4,_0x8ef91d[_0xd672('0x16')]));});});};exports[_0xd672('0x23')]=function(_0x15d280){var _0x267aa3=this;return new Promise(function(_0x162c35,_0x1ba48a){return db[_0xd672('0x19')][_0xd672('0x24')]({'raw':_0x15d280['options']?_0x15d280[_0xd672('0x1a')][_0xd672('0x1b')]===undefined?!![]:![]:!![],'where':_0x15d280['options']?_0x15d280[_0xd672('0x1a')][_0xd672('0x1c')]||null:null,'attributes':_0x15d280[_0xd672('0x1a')]?_0x15d280[_0xd672('0x1a')]['attributes']||null:null,'include':_0x15d280[_0xd672('0x1a')]?_0x15d280['options'][_0xd672('0x21')]?_[_0xd672('0x1f')](_0x15d280[_0xd672('0x1a')]['include'],function(_0xf16e2c){return{'model':db[_0xf16e2c[_0xd672('0x20')]],'as':_0xf16e2c['as'],'attributes':_0xf16e2c['attributes'],'include':_0xf16e2c[_0xd672('0x21')]?_['map'](_0xf16e2c[_0xd672('0x21')],function(_0x1d43e8){return{'model':db[_0x1d43e8[_0xd672('0x20')]],'as':_0x1d43e8['as'],'attributes':_0x1d43e8[_0xd672('0x1d')],'include':_0x1d43e8['include']?_[_0xd672('0x1f')](_0x1d43e8[_0xd672('0x21')],function(_0xe353d4){return{'model':db[_0xe353d4[_0xd672('0x20')]],'as':_0xe353d4['as'],'attributes':_0xe353d4['attributes']};}):[]};}):[]};}):[]:[]})[_0xd672('0xe')](function(_0x54cd33){logger[_0xd672('0xf')](_0xd672('0x23'),_0x15d280);logger[_0xd672('0x11')](_0xd672('0x23'),_0x15d280,JSON[_0xd672('0x13')](_0x54cd33));_0x162c35(_0x54cd33);})[_0xd672('0x18')](function(_0x129baa){logger[_0xd672('0x14')](_0xd672('0x23'),_0x129baa[_0xd672('0x16')],_0x15d280);_0x1ba48a(_0x267aa3['error'](0x1f4,_0x129baa['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 0201567..902a8c1 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(_0x49b063,_0xc246bf){var _0x812a93=function(_0x4fee29){while(--_0x4fee29){_0x49b063['push'](_0x49b063['shift']());}};_0x812a93(++_0xc246bf);}(_0x3140,0xaf));var _0x0314=function(_0x296d9d,_0x4d286b){_0x296d9d=_0x296d9d-0x0;var _0x53f5d0=_0x3140[_0x296d9d];return _0x53f5d0;};'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 _0xb332=['emit','register','./chatQueue.events','remove','update'];(function(_0x285800,_0x26765e){var _0x4b809e=function(_0x12c58b){while(--_0x12c58b){_0x285800['push'](_0x285800['shift']());}};_0x4b809e(++_0x26765e);}(_0xb332,0xd9));var _0x2b33=function(_0x4a7843,_0x24f6d1){_0x4a7843=_0x4a7843-0x0;var _0x2c57fe=_0xb332[_0x4a7843];return _0x2c57fe;};'use strict';var ChatQueueEvents=require(_0x2b33('0x0'));var events=['save',_0x2b33('0x1'),_0x2b33('0x2')];function createListener(_0x5ee720,_0xf8c6a7){return function(_0x548a70){_0xf8c6a7[_0x2b33('0x3')](_0x5ee720,_0x548a70);};}function removeListener(_0x4c6634,_0x34b111){return function(){ChatQueueEvents['removeListener'](_0x4c6634,_0x34b111);};}exports[_0x2b33('0x4')]=function(_0x22d66){for(var _0x478214=0x0,_0x461d44=events['length'];_0x478214<_0x461d44;_0x478214++){var _0x5ccf2d=events[_0x478214];var _0x4302b7=createListener('chatQueue:'+_0x5ccf2d,_0x22d66);ChatQueueEvents['on'](_0x5ccf2d,_0x4302b7);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 628fa1a..fa72950 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3e74,0x175));var _0x43e7=function(_0x295f99,_0x245ffd){_0x295f99=_0x295f99-0x0;var _0x8f96da=_0x3e74[_0x295f99];return _0x8f96da;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file +var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x32b8a0,_0x213779){var _0x223a7d=function(_0x51f25e){while(--_0x51f25e){_0x32b8a0['push'](_0x32b8a0['shift']());}};_0x223a7d(++_0x213779);}(_0x008c,0x188));var _0xc008=function(_0x88da9,_0x52cd6a){_0x88da9=_0x88da9-0x0;var _0x42df80=_0x008c[_0x88da9];return _0x42df80;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);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 ff4a95d..4111663 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 _0x4b2e=['STRING','DATE','moment','sequelize','exports'];(function(_0x18cd87,_0x358a7f){var _0x379687=function(_0x1f8da3){while(--_0x1f8da3){_0x18cd87['push'](_0x18cd87['shift']());}};_0x379687(++_0x358a7f);}(_0x4b2e,0x1ec));var _0xe4b2=function(_0x1a8d48,_0x452097){_0x1a8d48=_0x1a8d48-0x0;var _0x1f9de2=_0x4b2e[_0x1a8d48];return _0x1f9de2;};'use strict';var moment=require(_0xe4b2('0x0'));var Sequelize=require(_0xe4b2('0x1'));module[_0xe4b2('0x2')]={'uniqueid':{'type':Sequelize[_0xe4b2('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xe4b2('0x3')]},'joinAt':{'type':Sequelize[_0xe4b2('0x4')]},'leaveAt':{'type':Sequelize[_0xe4b2('0x4')]},'acceptAt':{'type':Sequelize[_0xe4b2('0x4')]},'exitAt':{'type':Sequelize[_0xe4b2('0x4')]},'reason':{'type':Sequelize[_0xe4b2('0x3')]}}; \ No newline at end of file +var _0x9670=['exports','STRING','DATE','moment','sequelize'];(function(_0x284e49,_0x200326){var _0x4737b2=function(_0x269c43){while(--_0x269c43){_0x284e49['push'](_0x284e49['shift']());}};_0x4737b2(++_0x200326);}(_0x9670,0x71));var _0x0967=function(_0x229c23,_0x380edc){_0x229c23=_0x229c23-0x0;var _0x348784=_0x9670[_0x229c23];return _0x348784;};'use strict';var moment=require(_0x0967('0x0'));var Sequelize=require(_0x0967('0x1'));module[_0x0967('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x0967('0x3')]},'joinAt':{'type':Sequelize[_0x0967('0x4')]},'leaveAt':{'type':Sequelize[_0x0967('0x4')]},'acceptAt':{'type':Sequelize[_0x0967('0x4')]},'exitAt':{'type':Sequelize[_0x0967('0x4')]},'reason':{'type':Sequelize[_0x0967('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 788844f..1f894ea 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 _0xdf98=['ejs','fs-extra','squel','crypto','jsforce','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','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','pick','filters','filter','options','includeAll','include','ChatQueueReport','findAll','rows','catch','show','params','length','create','body','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xdf98,0xcf));var _0x8df9=function(_0x317bf0,_0x277c03){_0x317bf0=_0x317bf0-0x0;var _0x225932=_0xdf98[_0x317bf0];return _0x225932;};'use strict';var emlformat=require(_0x8df9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8df9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8df9('0x2'));var BPromise=require(_0x8df9('0x3'));var Mustache=require(_0x8df9('0x4'));var util=require(_0x8df9('0x5'));var path=require(_0x8df9('0x6'));var sox=require(_0x8df9('0x7'));var csv=require(_0x8df9('0x8'));var ejs=require(_0x8df9('0x9'));var fs=require('fs');var fs_extra=require(_0x8df9('0xa'));var _=require('lodash');var squel=require(_0x8df9('0xb'));var crypto=require(_0x8df9('0xc'));var jsforce=require(_0x8df9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8df9('0xe'));var Papa=require('papaparse');var Redis=require(_0x8df9('0xf'));var authService=require(_0x8df9('0x10'));var qs=require(_0x8df9('0x11'));var as=require(_0x8df9('0x12'));var hardwareService=require(_0x8df9('0x13'));var logger=require(_0x8df9('0x14'))(_0x8df9('0x15'));var utils=require(_0x8df9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8df9('0x17'));var db=require(_0x8df9('0x18'))['db'];function respondWithStatusCode(_0x45f85b,_0x5a97dd){_0x5a97dd=_0x5a97dd||0xcc;return function(_0x42666d){if(_0x42666d){return _0x45f85b[_0x8df9('0x19')](_0x5a97dd);}return _0x45f85b[_0x8df9('0x1a')](_0x5a97dd)[_0x8df9('0x1b')]();};}function respondWithResult(_0x4bc4cc,_0x510e66){_0x510e66=_0x510e66||0xc8;return function(_0x2dcc1c){if(_0x2dcc1c){return _0x4bc4cc[_0x8df9('0x1a')](_0x510e66)[_0x8df9('0x1c')](_0x2dcc1c);}};}function respondWithFilteredResult(_0x50f0f7,_0x110f2b){return function(_0x526c78){if(_0x526c78){var _0xcc0419=typeof _0x110f2b['offset']===_0x8df9('0x1d')&&typeof _0x110f2b[_0x8df9('0x1e')]===_0x8df9('0x1d');var _0x218e76=_0x526c78[_0x8df9('0x1f')];var _0x16e8c4=_0xcc0419?0x0:_0x110f2b['offset'];var _0x54f2b0=_0xcc0419?_0x526c78[_0x8df9('0x1f')]:_0x110f2b['offset']+_0x110f2b['limit'];var _0x324dc0;if(_0x54f2b0>=_0x218e76){_0x54f2b0=_0x218e76;_0x324dc0=0xc8;}else{_0x324dc0=0xce;}_0x50f0f7[_0x8df9('0x1a')](_0x324dc0);return _0x50f0f7[_0x8df9('0x20')](_0x8df9('0x21'),_0x16e8c4+'-'+_0x54f2b0+'/'+_0x218e76)[_0x8df9('0x1c')](_0x526c78);}return null;};}function patchUpdates(_0xd73eb3){return function(_0x5a0071){try{jsonpatch[_0x8df9('0x22')](_0x5a0071,_0xd73eb3,!![]);}catch(_0x36deb6){return BPromise[_0x8df9('0x23')](_0x36deb6);}return _0x5a0071['save']();};}function saveUpdates(_0x5041f8,_0x490028){return function(_0x4a6748){if(_0x4a6748){return _0x4a6748['update'](_0x5041f8)[_0x8df9('0x24')](function(_0x239b71){return _0x239b71;});}return null;};}function removeEntity(_0x360d0b,_0x3dea66){return function(_0x478453){if(_0x478453){return _0x478453[_0x8df9('0x25')]()[_0x8df9('0x24')](function(){_0x360d0b[_0x8df9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3323dc,_0xe662a6){return function(_0x30cc42){if(!_0x30cc42){_0x3323dc['sendStatus'](0x194);}return _0x30cc42;};}function handleError(_0x5e8f46,_0x27d441){_0x27d441=_0x27d441||0x1f4;return function(_0x5117c9){logger['error'](_0x5117c9[_0x8df9('0x26')]);if(_0x5117c9[_0x8df9('0x27')]){delete _0x5117c9[_0x8df9('0x27')];}_0x5e8f46[_0x8df9('0x1a')](_0x27d441)[_0x8df9('0x28')](_0x5117c9);};}exports['index']=function(_0x5a3907,_0x8de080){var _0xce8575={},_0x2a9fee={},_0x5180fb={'count':0x0,'rows':[]};var _0x25d636=_[_0x8df9('0x29')](db['ChatQueueReport'][_0x8df9('0x2a')],function(_0x1c5065){return{'name':_0x1c5065['fieldName'],'type':_0x1c5065[_0x8df9('0x2b')][_0x8df9('0x2c')]};});_0x2a9fee[_0x8df9('0x2d')]=_['map'](_0x25d636,'name');_0x2a9fee[_0x8df9('0x2e')]=_[_0x8df9('0x2f')](_0x5a3907[_0x8df9('0x2e')]);_0x2a9fee['filters']=_[_0x8df9('0x30')](_0x2a9fee[_0x8df9('0x2d')],_0x2a9fee[_0x8df9('0x2e')]);_0xce8575[_0x8df9('0x31')]=_['intersection'](_0x2a9fee[_0x8df9('0x2d')],qs[_0x8df9('0x32')](_0x5a3907['query'][_0x8df9('0x32')]));_0xce8575['attributes']=_0xce8575['attributes']['length']?_0xce8575['attributes']:_0x2a9fee[_0x8df9('0x2d')];if(!_0x5a3907[_0x8df9('0x2e')][_0x8df9('0x33')](_0x8df9('0x34'))){_0xce8575[_0x8df9('0x1e')]=qs[_0x8df9('0x1e')](_0x5a3907[_0x8df9('0x2e')][_0x8df9('0x1e')]);_0xce8575[_0x8df9('0x35')]=qs[_0x8df9('0x35')](_0x5a3907[_0x8df9('0x2e')][_0x8df9('0x35')]);}_0xce8575['order']=qs['sort'](_0x5a3907['query'][_0x8df9('0x36')]);_0xce8575[_0x8df9('0x37')]=qs['filters'](_[_0x8df9('0x38')](_0x5a3907['query'],_0x2a9fee[_0x8df9('0x39')]),_0x25d636);if(_0x5a3907[_0x8df9('0x2e')]['filter']){_0xce8575['where']=_['merge'](_0xce8575[_0x8df9('0x37')],{'$or':_[_0x8df9('0x29')](_0x25d636,function(_0x25d77f){if(_0x25d77f['type']!=='VIRTUAL'){var _0x16b0c3={};_0x16b0c3[_0x25d77f['name']]={'$like':'%'+_0x5a3907[_0x8df9('0x2e')][_0x8df9('0x3a')]+'%'};return _0x16b0c3;}})});}_0xce8575=_['merge']({},_0xce8575,_0x5a3907[_0x8df9('0x3b')]);var _0x44e295={'where':_0xce8575[_0x8df9('0x37')]};return db['ChatQueueReport'][_0x8df9('0x1f')](_0x44e295)['then'](function(_0x11014b){_0x5180fb[_0x8df9('0x1f')]=_0x11014b;if(_0x5a3907[_0x8df9('0x2e')][_0x8df9('0x3c')]){_0xce8575[_0x8df9('0x3d')]=[{'all':!![]}];}return db[_0x8df9('0x3e')][_0x8df9('0x3f')](_0xce8575);})[_0x8df9('0x24')](function(_0x211b51){_0x5180fb[_0x8df9('0x40')]=_0x211b51;return _0x5180fb;})[_0x8df9('0x24')](respondWithFilteredResult(_0x8de080,_0xce8575))[_0x8df9('0x41')](handleError(_0x8de080,null));};exports[_0x8df9('0x42')]=function(_0x5d68b0,_0x5b84e6){var _0x1b5cb3={'raw':!![],'where':{'id':_0x5d68b0[_0x8df9('0x43')]['id']}},_0x4fdf12={};_0x4fdf12['model']=_[_0x8df9('0x2f')](db[_0x8df9('0x3e')][_0x8df9('0x2a')]);_0x4fdf12[_0x8df9('0x2e')]=_[_0x8df9('0x2f')](_0x5d68b0[_0x8df9('0x2e')]);_0x4fdf12[_0x8df9('0x39')]=_[_0x8df9('0x30')](_0x4fdf12[_0x8df9('0x2d')],_0x4fdf12[_0x8df9('0x2e')]);_0x1b5cb3[_0x8df9('0x31')]=_[_0x8df9('0x30')](_0x4fdf12['model'],qs[_0x8df9('0x32')](_0x5d68b0[_0x8df9('0x2e')][_0x8df9('0x32')]));_0x1b5cb3['attributes']=_0x1b5cb3[_0x8df9('0x31')][_0x8df9('0x44')]?_0x1b5cb3['attributes']:_0x4fdf12['model'];if(_0x5d68b0['query'][_0x8df9('0x3c')]){_0x1b5cb3[_0x8df9('0x3d')]=[{'all':!![]}];}_0x1b5cb3=_['merge']({},_0x1b5cb3,_0x5d68b0['options']);return db[_0x8df9('0x3e')]['find'](_0x1b5cb3)['then'](handleEntityNotFound(_0x5b84e6,null))['then'](respondWithResult(_0x5b84e6,null))[_0x8df9('0x41')](handleError(_0x5b84e6,null));};exports[_0x8df9('0x45')]=function(_0x28313f,_0x5510f7){return db[_0x8df9('0x3e')][_0x8df9('0x45')](_0x28313f[_0x8df9('0x46')],{})[_0x8df9('0x24')](respondWithResult(_0x5510f7,0xc9))[_0x8df9('0x41')](handleError(_0x5510f7,null));};exports['update']=function(_0x4f9dac,_0xdee15b){if(_0x4f9dac[_0x8df9('0x46')]['id']){delete _0x4f9dac[_0x8df9('0x46')]['id'];}return db[_0x8df9('0x3e')]['find']({'where':{'id':_0x4f9dac[_0x8df9('0x43')]['id']}})[_0x8df9('0x24')](handleEntityNotFound(_0xdee15b,null))[_0x8df9('0x24')](saveUpdates(_0x4f9dac[_0x8df9('0x46')],null))[_0x8df9('0x24')](respondWithResult(_0xdee15b,null))[_0x8df9('0x41')](handleError(_0xdee15b,null));};exports['destroy']=function(_0x3d9e7b,_0x4a24e5){return db[_0x8df9('0x3e')]['find']({'where':{'id':_0x3d9e7b[_0x8df9('0x43')]['id']}})['then'](handleEntityNotFound(_0x4a24e5,null))[_0x8df9('0x24')](removeEntity(_0x4a24e5,null))['catch'](handleError(_0x4a24e5,null));};exports[_0x8df9('0x47')]=function(_0x343518,_0xd445c9){return db['ChatQueueReport'][_0x8df9('0x47')]()['then'](respondWithResult(_0xd445c9,null))[_0x8df9('0x41')](handleError(_0xd445c9,null));}; \ No newline at end of file +var _0x57ca=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','ChatQueueReport','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x161a13,_0x100a56){var _0x425b96=function(_0x46d922){while(--_0x46d922){_0x161a13['push'](_0x161a13['shift']());}};_0x425b96(++_0x100a56);}(_0x57ca,0x108));var _0xa57c=function(_0x53d9af,_0x8789d6){_0x53d9af=_0x53d9af-0x0;var _0x30e406=_0x57ca[_0x53d9af];return _0x30e406;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':!![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['ChatQueueReport']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')](_0x247906['body'],{})['then'](respondWithResult(_0x44ea0a,0xc9))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x232675,_0x49492f){if(_0x232675[_0xa57c('0x42')]['id']){delete _0x232675[_0xa57c('0x42')]['id'];}return db['ChatQueueReport'][_0xa57c('0x3f')]({'where':{'id':_0x232675[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x49492f,null))[_0xa57c('0x21')](saveUpdates(_0x232675[_0xa57c('0x42')],null))['then'](respondWithResult(_0x49492f,null))[_0xa57c('0x40')](handleError(_0x49492f,null));};exports[_0xa57c('0x22')]=function(_0x4584e8,_0xd57bac){return db[_0xa57c('0x2a')]['find']({'where':{'id':_0x4584e8[_0xa57c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xd57bac,null))['then'](removeEntity(_0xd57bac,null))[_0xa57c('0x40')](handleError(_0xd57bac,null));};exports[_0xa57c('0x43')]=function(_0x5ded49,_0x5bf336){return db['ChatQueueReport'][_0xa57c('0x43')]()[_0xa57c('0x21')](respondWithResult(_0x5bf336,null))[_0xa57c('0x40')](handleError(_0x5bf336,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 6d1bfae..17d9773 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(_0x56c8b2,_0x4741b3){var _0x23912b=function(_0x5607d5){while(--_0x5607d5){_0x56c8b2['push'](_0x56c8b2['shift']());}};_0x23912b(++_0x4741b3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3d1f22,_0x3c6726){var _0x3f38b3=function(_0x1176d4){while(--_0x1176d4){_0x3d1f22['push'](_0x3d1f22['shift']());}};_0x3f38b3(++_0x3c6726);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'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 diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 1bc07ae..600f0dc 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 _0x1136=['create','body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0x1136,0x13c));var _0x6113=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1136[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x6113('0x0'));var util=require(_0x6113('0x1'));var moment=require(_0x6113('0x2'));var BPromise=require(_0x6113('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6113('0x4'))['db'];var utils=require(_0x6113('0x5'));var logger=require('../../config/logger')(_0x6113('0x6'));var config=require(_0x6113('0x7'));var jayson=require(_0x6113('0x8'));var client=jayson['client'][_0x6113('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43284d,_0x2f2286,_0x4c7a69){return new BPromise(function(_0x527ca5,_0x3c4089){return client[_0x6113('0xa')](_0x43284d,_0x4c7a69)[_0x6113('0xb')](function(_0x37d032){logger[_0x6113('0xc')](_0x6113('0xd'),_0x2f2286,_0x6113('0xe'));logger['debug'](_0x6113('0xf'),_0x2f2286,_0x6113('0xe'),JSON[_0x6113('0x10')](_0x37d032));if(_0x37d032[_0x6113('0x11')]){if(_0x37d032[_0x6113('0x11')][_0x6113('0x12')]===0x1f4){logger[_0x6113('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x2f2286,_0x37d032[_0x6113('0x11')]['message']);return _0x3c4089(_0x37d032[_0x6113('0x11')]['message']);}logger[_0x6113('0x11')](_0x6113('0xd'),_0x2f2286,_0x37d032[_0x6113('0x11')][_0x6113('0x13')]);return _0x527ca5(_0x37d032[_0x6113('0x11')][_0x6113('0x13')]);}else{logger[_0x6113('0xc')](_0x6113('0xd'),_0x2f2286,_0x6113('0xe'));_0x527ca5(_0x37d032[_0x6113('0x14')][_0x6113('0x13')]);}})[_0x6113('0x15')](function(_0x43eeba){logger[_0x6113('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x2f2286,_0x43eeba);_0x3c4089(_0x43eeba);});});}exports[_0x6113('0x16')]=function(_0x44f65b){var _0x55f70c=this;return new Promise(function(_0x1faaac,_0x43f90a){return db[_0x6113('0x17')][_0x6113('0x18')](_0x44f65b[_0x6113('0x19')],{'raw':_0x44f65b[_0x6113('0x1a')]?_0x44f65b[_0x6113('0x1a')][_0x6113('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x4b58c9){logger[_0x6113('0xc')]('CreateChatQueueReport',_0x44f65b);logger['debug']('CreateChatQueueReport',_0x44f65b,JSON[_0x6113('0x10')](_0x4b58c9));_0x1faaac(_0x4b58c9);})[_0x6113('0x15')](function(_0x5b84c2){logger[_0x6113('0x11')](_0x6113('0x16'),_0x5b84c2[_0x6113('0x13')],_0x44f65b);_0x43f90a(_0x55f70c['error'](0x1f4,_0x5b84c2[_0x6113('0x13')]));});});};exports[_0x6113('0x1c')]=function(_0x3d2bd){var _0x2d07fb=this;return new Promise(function(_0x2b000e,_0x2c1340){return db[_0x6113('0x17')][_0x6113('0x1d')](_0x3d2bd[_0x6113('0x19')],{'raw':_0x3d2bd[_0x6113('0x1a')]?_0x3d2bd[_0x6113('0x1a')][_0x6113('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d2bd['options']?_0x3d2bd['options'][_0x6113('0x1e')]||null:null,'attributes':_0x3d2bd['options']?_0x3d2bd[_0x6113('0x1a')][_0x6113('0x1f')]||null:null,'limit':_0x3d2bd['options']?_0x3d2bd[_0x6113('0x1a')][_0x6113('0x20')]||null:null})['then'](function(_0x180ac1){logger[_0x6113('0xc')]('UpdateChatQueueReport',_0x3d2bd);logger[_0x6113('0x21')](_0x6113('0x1c'),_0x3d2bd,JSON[_0x6113('0x10')](_0x180ac1));_0x2b000e(_0x180ac1);})[_0x6113('0x15')](function(_0x4f262a){logger[_0x6113('0x11')](_0x6113('0x1c'),_0x4f262a[_0x6113('0x13')],_0x3d2bd);_0x2c1340(_0x2d07fb[_0x6113('0x11')](0x1f4,_0x4f262a['message']));});});}; \ No newline at end of file +var _0x8054=['rpc','http','request','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','CreateChatQueueReport','ChatQueueReport','create','options','raw','catch','UpdateChatQueueReport','body','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x988f0b,_0x1bcef8){var _0x678898=function(_0x49341b){while(--_0x49341b){_0x988f0b['push'](_0x988f0b['shift']());}};_0x678898(++_0x1bcef8);}(_0x8054,0x141));var _0x4805=function(_0x1c4493,_0x42c1be){_0x1c4493=_0x1c4493-0x0;var _0x2e375a=_0x8054[_0x1c4493];return _0x2e375a;};'use strict';var _=require(_0x4805('0x0'));var util=require(_0x4805('0x1'));var moment=require(_0x4805('0x2'));var BPromise=require(_0x4805('0x3'));var rs=require(_0x4805('0x4'));var fs=require('fs');var Redis=require(_0x4805('0x5'));var db=require(_0x4805('0x6'))['db'];var utils=require(_0x4805('0x7'));var logger=require(_0x4805('0x8'))(_0x4805('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4805('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x244e07,_0x5b4002,_0x4b4bba){return new BPromise(function(_0x25187b,_0x35f092){return client[_0x4805('0xb')](_0x244e07,_0x4b4bba)[_0x4805('0xc')](function(_0x4175f0){logger[_0x4805('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x5b4002,_0x4805('0xe'));logger[_0x4805('0xf')](_0x4805('0x10'),_0x5b4002,_0x4805('0xe'),JSON[_0x4805('0x11')](_0x4175f0));if(_0x4175f0['error']){if(_0x4175f0[_0x4805('0x12')][_0x4805('0x13')]===0x1f4){logger[_0x4805('0x12')](_0x4805('0x14'),_0x5b4002,_0x4175f0[_0x4805('0x12')][_0x4805('0x15')]);return _0x35f092(_0x4175f0[_0x4805('0x12')]['message']);}logger[_0x4805('0x12')](_0x4805('0x14'),_0x5b4002,_0x4175f0['error'][_0x4805('0x15')]);return _0x25187b(_0x4175f0['error']['message']);}else{logger[_0x4805('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x5b4002,'request\x20sent');_0x25187b(_0x4175f0[_0x4805('0x16')][_0x4805('0x15')]);}})['catch'](function(_0x284f4b){logger[_0x4805('0x12')](_0x4805('0x14'),_0x5b4002,_0x284f4b);_0x35f092(_0x284f4b);});});}exports[_0x4805('0x17')]=function(_0x1a95a6){var _0x41d5f8=this;return new Promise(function(_0x4cde3f,_0x17184c){return db[_0x4805('0x18')][_0x4805('0x19')](_0x1a95a6['body'],{'raw':_0x1a95a6[_0x4805('0x1a')]?_0x1a95a6[_0x4805('0x1a')][_0x4805('0x1b')]===undefined?!![]:![]:!![]})[_0x4805('0xc')](function(_0x33709b){logger[_0x4805('0xd')](_0x4805('0x17'),_0x1a95a6);logger['debug']('CreateChatQueueReport',_0x1a95a6,JSON[_0x4805('0x11')](_0x33709b));_0x4cde3f(_0x33709b);})[_0x4805('0x1c')](function(_0x525af2){logger[_0x4805('0x12')]('CreateChatQueueReport',_0x525af2['message'],_0x1a95a6);_0x17184c(_0x41d5f8[_0x4805('0x12')](0x1f4,_0x525af2[_0x4805('0x15')]));});});};exports[_0x4805('0x1d')]=function(_0x5e582e){var _0x52de54=this;return new Promise(function(_0x11dce8,_0x25585e){return db[_0x4805('0x18')]['update'](_0x5e582e[_0x4805('0x1e')],{'raw':_0x5e582e[_0x4805('0x1a')]?_0x5e582e[_0x4805('0x1a')][_0x4805('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e582e[_0x4805('0x1a')]?_0x5e582e[_0x4805('0x1a')][_0x4805('0x1f')]||null:null,'attributes':_0x5e582e[_0x4805('0x1a')]?_0x5e582e['options'][_0x4805('0x20')]||null:null,'limit':_0x5e582e[_0x4805('0x1a')]?_0x5e582e['options']['limit']||null:null})['then'](function(_0x228a65){logger[_0x4805('0xd')](_0x4805('0x1d'),_0x5e582e);logger[_0x4805('0xf')](_0x4805('0x1d'),_0x5e582e,JSON[_0x4805('0x11')](_0x228a65));_0x11dce8(_0x228a65);})[_0x4805('0x1c')](function(_0x19f3ba){logger[_0x4805('0x12')]('UpdateChatQueueReport',_0x19f3ba[_0x4805('0x15')],_0x5e582e);_0x25585e(_0x52de54[_0x4805('0x12')](0x1f4,_0x19f3ba[_0x4805('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 0a84d8c..7d86e8d 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 _0x2e1a=['path','connect-timeout','express','Router','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','destroy','multer','util'];(function(_0x216428,_0x5d20ea){var _0x313dd4=function(_0x447e0d){while(--_0x447e0d){_0x216428['push'](_0x216428['shift']());}};_0x313dd4(++_0x5d20ea);}(_0x2e1a,0x8e));var _0xa2e1=function(_0x56ba92,_0xb3c986){_0x56ba92=_0x56ba92-0x0;var _0x8fe94d=_0x2e1a[_0x56ba92];return _0x8fe94d;};'use strict';var multer=require(_0xa2e1('0x0'));var util=require(_0xa2e1('0x1'));var path=require(_0xa2e1('0x2'));var timeout=require(_0xa2e1('0x3'));var express=require(_0xa2e1('0x4'));var router=express[_0xa2e1('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa2e1('0x6'));router['get']('/',auth[_0xa2e1('0x7')](),controller[_0xa2e1('0x8')]);router[_0xa2e1('0x9')](_0xa2e1('0xa'),auth[_0xa2e1('0x7')](),controller[_0xa2e1('0xb')]);router[_0xa2e1('0x9')](_0xa2e1('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa2e1('0xd')]('/',auth[_0xa2e1('0x7')](),controller[_0xa2e1('0xe')]);router[_0xa2e1('0xf')]('/:id',auth[_0xa2e1('0x7')](),controller[_0xa2e1('0x10')]);router['delete'](_0xa2e1('0xc'),auth[_0xa2e1('0x7')](),controller[_0xa2e1('0x11')]);module['exports']=router; \ No newline at end of file +var _0xeeaf=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4b9a50,_0x1d1312){var _0x368c57=function(_0x1e5ff5){while(--_0x1e5ff5){_0x4b9a50['push'](_0x4b9a50['shift']());}};_0x368c57(++_0x1d1312);}(_0xeeaf,0x78));var _0xfeea=function(_0x31183e,_0x4764cc){_0x31183e=_0x31183e-0x0;var _0xa6cf81=_0xeeaf[_0x31183e];return _0xa6cf81;};'use strict';var multer=require(_0xfeea('0x0'));var util=require(_0xfeea('0x1'));var path=require('path');var timeout=require(_0xfeea('0x2'));var express=require(_0xfeea('0x3'));var router=express[_0xfeea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfeea('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfeea('0x6'));var controller=require('./chatQueueReport.controller');router[_0xfeea('0x7')]('/',auth[_0xfeea('0x8')](),controller[_0xfeea('0x9')]);router[_0xfeea('0x7')](_0xfeea('0xa'),auth[_0xfeea('0x8')](),controller['describe']);router['get'](_0xfeea('0xb'),auth[_0xfeea('0x8')](),controller[_0xfeea('0xc')]);router[_0xfeea('0xd')]('/',auth[_0xfeea('0x8')](),controller[_0xfeea('0xe')]);router[_0xfeea('0xf')](_0xfeea('0xb'),auth['isAuthenticated'](),controller[_0xfeea('0x10')]);router[_0xfeea('0x11')]('/:id',auth[_0xfeea('0x8')](),controller[_0xfeea('0x12')]);module[_0xfeea('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 56e8832..899be3a 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x4407d9,_0x33ce90){var _0x355ad4=function(_0x33421c){while(--_0x33421c){_0x4407d9['push'](_0x4407d9['shift']());}};_0x355ad4(++_0x33ce90);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0xcb91[_0x58c20f];return _0x3b0318;};'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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1afe91,_0x29e173){var _0x45a1cb=function(_0x2d8c78){while(--_0x2d8c78){_0x1afe91['push'](_0x1afe91['shift']());}};_0x45a1cb(++_0x29e173);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x22663b,_0xc8c6e3){_0x22663b=_0x22663b-0x0;var _0x310d0a=_0xcb91[_0x22663b];return _0x310d0a;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 08eb19b..6a8d9bf 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 _0x4df2=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','rows','catch','params','create','body','find','describe','eml-format'];(function(_0x5685ff,_0x3acac3){var _0x246d98=function(_0x5f3acc){while(--_0x5f3acc){_0x5685ff['push'](_0x5685ff['shift']());}};_0x246d98(++_0x3acac3);}(_0x4df2,0x176));var _0x24df=function(_0x5991a8,_0x1aee07){_0x5991a8=_0x5991a8-0x0;var _0x532c72=_0x4df2[_0x5991a8];return _0x532c72;};'use strict';var emlformat=require(_0x24df('0x0'));var rimraf=require(_0x24df('0x1'));var zipdir=require(_0x24df('0x2'));var jsonpatch=require(_0x24df('0x3'));var rp=require(_0x24df('0x4'));var moment=require(_0x24df('0x5'));var BPromise=require(_0x24df('0x6'));var Mustache=require(_0x24df('0x7'));var util=require('util');var path=require(_0x24df('0x8'));var sox=require(_0x24df('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x24df('0xa'));var _=require(_0x24df('0xb'));var squel=require(_0x24df('0xc'));var crypto=require(_0x24df('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x24df('0xe'));var toCsv=require(_0x24df('0xf'));var querystring=require(_0x24df('0x10'));var Papa=require(_0x24df('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x24df('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24df('0x13'))(_0x24df('0x14'));var utils=require(_0x24df('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x24df('0x16'))['db'];function respondWithStatusCode(_0x4480fd,_0x420ce8){_0x420ce8=_0x420ce8||0xcc;return function(_0x4b99a2){if(_0x4b99a2){return _0x4480fd[_0x24df('0x17')](_0x420ce8);}return _0x4480fd[_0x24df('0x18')](_0x420ce8)[_0x24df('0x19')]();};}function respondWithResult(_0x1b5faa,_0x429a26){_0x429a26=_0x429a26||0xc8;return function(_0x1fce5c){if(_0x1fce5c){return _0x1b5faa[_0x24df('0x18')](_0x429a26)[_0x24df('0x1a')](_0x1fce5c);}};}function respondWithFilteredResult(_0x5f3fea,_0x358e0e){return function(_0x52050b){if(_0x52050b){var _0x291b0d=typeof _0x358e0e[_0x24df('0x1b')]===_0x24df('0x1c')&&typeof _0x358e0e[_0x24df('0x1d')]===_0x24df('0x1c');var _0xbab2e=_0x52050b[_0x24df('0x1e')];var _0x555bbd=_0x291b0d?0x0:_0x358e0e[_0x24df('0x1b')];var _0x4f290b=_0x291b0d?_0x52050b[_0x24df('0x1e')]:_0x358e0e[_0x24df('0x1b')]+_0x358e0e[_0x24df('0x1d')];var _0x3c2848;if(_0x4f290b>=_0xbab2e){_0x4f290b=_0xbab2e;_0x3c2848=0xc8;}else{_0x3c2848=0xce;}_0x5f3fea[_0x24df('0x18')](_0x3c2848);return _0x5f3fea[_0x24df('0x1f')](_0x24df('0x20'),_0x555bbd+'-'+_0x4f290b+'/'+_0xbab2e)['json'](_0x52050b);}return null;};}function patchUpdates(_0x50cb1c){return function(_0x1061f0){try{jsonpatch[_0x24df('0x21')](_0x1061f0,_0x50cb1c,!![]);}catch(_0x1cb57f){return BPromise[_0x24df('0x22')](_0x1cb57f);}return _0x1061f0[_0x24df('0x23')]();};}function saveUpdates(_0x53f91f,_0x4be7ab){return function(_0x2112a9){if(_0x2112a9){return _0x2112a9[_0x24df('0x24')](_0x53f91f)[_0x24df('0x25')](function(_0xd12116){return _0xd12116;});}return null;};}function removeEntity(_0x30a4d0,_0xfa4371){return function(_0x42a8fe){if(_0x42a8fe){return _0x42a8fe[_0x24df('0x26')]()['then'](function(){_0x30a4d0[_0x24df('0x18')](0xcc)[_0x24df('0x19')]();});}};}function handleEntityNotFound(_0x3a29ea,_0xd7c140){return function(_0x82879e){if(!_0x82879e){_0x3a29ea[_0x24df('0x17')](0x194);}return _0x82879e;};}function handleError(_0x3d7bf9,_0x2f5447){_0x2f5447=_0x2f5447||0x1f4;return function(_0x43c6fc){logger[_0x24df('0x27')](_0x43c6fc[_0x24df('0x28')]);if(_0x43c6fc[_0x24df('0x29')]){delete _0x43c6fc['name'];}_0x3d7bf9['status'](_0x2f5447)[_0x24df('0x2a')](_0x43c6fc);};}exports[_0x24df('0x2b')]=function(_0x544b4d,_0x1cfe07){var _0x50648c={},_0x26da54={},_0x465b8d={'count':0x0,'rows':[]};var _0x5e003f=_['map'](db['ChatTransferReport'][_0x24df('0x2c')],function(_0x3c456a){return{'name':_0x3c456a[_0x24df('0x2d')],'type':_0x3c456a[_0x24df('0x2e')]['key']};});_0x26da54[_0x24df('0x2f')]=_[_0x24df('0x30')](_0x5e003f,_0x24df('0x29'));_0x26da54[_0x24df('0x31')]=_[_0x24df('0x32')](_0x544b4d[_0x24df('0x31')]);_0x26da54[_0x24df('0x33')]=_[_0x24df('0x34')](_0x26da54['model'],_0x26da54[_0x24df('0x31')]);_0x50648c[_0x24df('0x35')]=_[_0x24df('0x34')](_0x26da54['model'],qs[_0x24df('0x36')](_0x544b4d[_0x24df('0x31')][_0x24df('0x36')]));_0x50648c[_0x24df('0x35')]=_0x50648c[_0x24df('0x35')][_0x24df('0x37')]?_0x50648c[_0x24df('0x35')]:_0x26da54[_0x24df('0x2f')];if(!_0x544b4d[_0x24df('0x31')][_0x24df('0x38')](_0x24df('0x39'))){_0x50648c[_0x24df('0x1d')]=qs['limit'](_0x544b4d[_0x24df('0x31')][_0x24df('0x1d')]);_0x50648c[_0x24df('0x1b')]=qs[_0x24df('0x1b')](_0x544b4d[_0x24df('0x31')][_0x24df('0x1b')]);}_0x50648c[_0x24df('0x3a')]=qs['sort'](_0x544b4d[_0x24df('0x31')][_0x24df('0x3b')]);_0x50648c[_0x24df('0x3c')]=qs[_0x24df('0x33')](_['pick'](_0x544b4d[_0x24df('0x31')],_0x26da54['filters']),_0x5e003f);if(_0x544b4d[_0x24df('0x31')][_0x24df('0x3d')]){_0x50648c[_0x24df('0x3c')]=_[_0x24df('0x3e')](_0x50648c['where'],{'$or':_[_0x24df('0x30')](_0x5e003f,function(_0x5b4e47){if(_0x5b4e47[_0x24df('0x2e')]!==_0x24df('0x3f')){var _0x21882d={};_0x21882d[_0x5b4e47[_0x24df('0x29')]]={'$like':'%'+_0x544b4d[_0x24df('0x31')][_0x24df('0x3d')]+'%'};return _0x21882d;}})});}_0x50648c=_[_0x24df('0x3e')]({},_0x50648c,_0x544b4d[_0x24df('0x40')]);var _0x1b5928={'where':_0x50648c['where']};return db[_0x24df('0x41')]['count'](_0x1b5928)[_0x24df('0x25')](function(_0x3dc9f1){_0x465b8d[_0x24df('0x1e')]=_0x3dc9f1;if(_0x544b4d[_0x24df('0x31')][_0x24df('0x42')]){_0x50648c[_0x24df('0x43')]=[{'all':!![]}];}return db[_0x24df('0x41')]['findAll'](_0x50648c);})['then'](function(_0x5ea63b){_0x465b8d[_0x24df('0x44')]=_0x5ea63b;return _0x465b8d;})[_0x24df('0x25')](respondWithFilteredResult(_0x1cfe07,_0x50648c))[_0x24df('0x45')](handleError(_0x1cfe07,null));};exports['show']=function(_0xf6c4a4,_0x5877de){var _0x3afe00={'raw':!![],'where':{'id':_0xf6c4a4[_0x24df('0x46')]['id']}},_0x455d2d={};_0x455d2d[_0x24df('0x2f')]=_[_0x24df('0x32')](db[_0x24df('0x41')][_0x24df('0x2c')]);_0x455d2d[_0x24df('0x31')]=_[_0x24df('0x32')](_0xf6c4a4[_0x24df('0x31')]);_0x455d2d[_0x24df('0x33')]=_['intersection'](_0x455d2d[_0x24df('0x2f')],_0x455d2d['query']);_0x3afe00[_0x24df('0x35')]=_[_0x24df('0x34')](_0x455d2d[_0x24df('0x2f')],qs[_0x24df('0x36')](_0xf6c4a4[_0x24df('0x31')][_0x24df('0x36')]));_0x3afe00[_0x24df('0x35')]=_0x3afe00[_0x24df('0x35')][_0x24df('0x37')]?_0x3afe00[_0x24df('0x35')]:_0x455d2d['model'];if(_0xf6c4a4[_0x24df('0x31')][_0x24df('0x42')]){_0x3afe00[_0x24df('0x43')]=[{'all':!![]}];}_0x3afe00=_[_0x24df('0x3e')]({},_0x3afe00,_0xf6c4a4[_0x24df('0x40')]);return db['ChatTransferReport']['find'](_0x3afe00)['then'](handleEntityNotFound(_0x5877de,null))[_0x24df('0x25')](respondWithResult(_0x5877de,null))['catch'](handleError(_0x5877de,null));};exports[_0x24df('0x47')]=function(_0x1ccb04,_0x25fa42){return db[_0x24df('0x41')][_0x24df('0x47')](_0x1ccb04[_0x24df('0x48')],{})[_0x24df('0x25')](respondWithResult(_0x25fa42,0xc9))['catch'](handleError(_0x25fa42,null));};exports[_0x24df('0x24')]=function(_0x35b117,_0x32e371){if(_0x35b117[_0x24df('0x48')]['id']){delete _0x35b117[_0x24df('0x48')]['id'];}return db[_0x24df('0x41')][_0x24df('0x49')]({'where':{'id':_0x35b117[_0x24df('0x46')]['id']}})[_0x24df('0x25')](handleEntityNotFound(_0x32e371,null))[_0x24df('0x25')](saveUpdates(_0x35b117[_0x24df('0x48')],null))[_0x24df('0x25')](respondWithResult(_0x32e371,null))[_0x24df('0x45')](handleError(_0x32e371,null));};exports[_0x24df('0x26')]=function(_0x341fec,_0x426a52){return db[_0x24df('0x41')]['find']({'where':{'id':_0x341fec[_0x24df('0x46')]['id']}})['then'](handleEntityNotFound(_0x426a52,null))['then'](removeEntity(_0x426a52,null))[_0x24df('0x45')](handleError(_0x426a52,null));};exports['describe']=function(_0x3df55c,_0x1c8a6e){return db[_0x24df('0x41')][_0x24df('0x4a')]()[_0x24df('0x25')](respondWithResult(_0x1c8a6e,null))['catch'](handleError(_0x1c8a6e,null));}; \ No newline at end of file +var _0x98cf=['keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','VIRTUAL','includeAll','include','findAll','show','params','merge','options','catch','create','body','find','describe','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','destroy','then','status','error','stack','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x17f7e1,_0x561bf4){var _0x556d66=function(_0xd871eb){while(--_0xd871eb){_0x17f7e1['push'](_0x17f7e1['shift']());}};_0x556d66(++_0x561bf4);}(_0x98cf,0xb1));var _0xf98c=function(_0x537998,_0x4a1e32){_0x537998=_0x537998-0x0;var _0x2ba597=_0x98cf[_0x537998];return _0x2ba597;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf98c('0x0'));var jsonpatch=require(_0xf98c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf98c('0x2'));var Mustache=require(_0xf98c('0x3'));var util=require(_0xf98c('0x4'));var path=require(_0xf98c('0x5'));var sox=require(_0xf98c('0x6'));var csv=require(_0xf98c('0x7'));var ejs=require(_0xf98c('0x8'));var fs=require('fs');var fs_extra=require(_0xf98c('0x9'));var _=require(_0xf98c('0xa'));var squel=require(_0xf98c('0xb'));var crypto=require(_0xf98c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf98c('0xd'));var toCsv=require(_0xf98c('0x7'));var querystring=require(_0xf98c('0xe'));var Papa=require(_0xf98c('0xf'));var Redis=require(_0xf98c('0x10'));var authService=require(_0xf98c('0x11'));var qs=require(_0xf98c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf98c('0x13'));var logger=require(_0xf98c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xf98c('0x15'));var licenseUtil=require(_0xf98c('0x16'));var db=require(_0xf98c('0x17'))['db'];function respondWithStatusCode(_0x2ca676,_0x58d252){_0x58d252=_0x58d252||0xcc;return function(_0x1fce13){if(_0x1fce13){return _0x2ca676[_0xf98c('0x18')](_0x58d252);}return _0x2ca676['status'](_0x58d252)[_0xf98c('0x19')]();};}function respondWithResult(_0x38423e,_0x2c7f53){_0x2c7f53=_0x2c7f53||0xc8;return function(_0x479e3c){if(_0x479e3c){return _0x38423e['status'](_0x2c7f53)[_0xf98c('0x1a')](_0x479e3c);}};}function respondWithFilteredResult(_0x4f4799,_0x3bfd95){return function(_0x1e3257){if(_0x1e3257){var _0x267f1a=typeof _0x3bfd95['offset']===_0xf98c('0x1b')&&typeof _0x3bfd95['limit']===_0xf98c('0x1b');var _0x2f513b=_0x1e3257[_0xf98c('0x1c')];var _0x2b06d0=_0x267f1a?0x0:_0x3bfd95[_0xf98c('0x1d')];var _0x18a98f=_0x267f1a?_0x1e3257[_0xf98c('0x1c')]:_0x3bfd95[_0xf98c('0x1d')]+_0x3bfd95[_0xf98c('0x1e')];var _0x2dade0;if(_0x18a98f>=_0x2f513b){_0x18a98f=_0x2f513b;_0x2dade0=0xc8;}else{_0x2dade0=0xce;}_0x4f4799['status'](_0x2dade0);return _0x4f4799['set'](_0xf98c('0x1f'),_0x2b06d0+'-'+_0x18a98f+'/'+_0x2f513b)['json'](_0x1e3257);}return null;};}function patchUpdates(_0x456dd3){return function(_0x585e87){try{jsonpatch[_0xf98c('0x20')](_0x585e87,_0x456dd3,!![]);}catch(_0x295c37){return BPromise[_0xf98c('0x21')](_0x295c37);}return _0x585e87['save']();};}function saveUpdates(_0x24eeb2,_0x19ad08){return function(_0x22c2f8){if(_0x22c2f8){return _0x22c2f8[_0xf98c('0x22')](_0x24eeb2)['then'](function(_0x2ca452){return _0x2ca452;});}return null;};}function removeEntity(_0x1ef07d,_0x1d1ff3){return function(_0x24220c){if(_0x24220c){return _0x24220c[_0xf98c('0x23')]()[_0xf98c('0x24')](function(){_0x1ef07d[_0xf98c('0x25')](0xcc)[_0xf98c('0x19')]();});}};}function handleEntityNotFound(_0x65f75d,_0x56f507){return function(_0x36ee47){if(!_0x36ee47){_0x65f75d['sendStatus'](0x194);}return _0x36ee47;};}function handleError(_0x16ee3a,_0x13d0da){_0x13d0da=_0x13d0da||0x1f4;return function(_0xbe43b5){logger[_0xf98c('0x26')](_0xbe43b5[_0xf98c('0x27')]);if(_0xbe43b5[_0xf98c('0x28')]){delete _0xbe43b5[_0xf98c('0x28')];}_0x16ee3a[_0xf98c('0x25')](_0x13d0da)[_0xf98c('0x29')](_0xbe43b5);};}exports[_0xf98c('0x2a')]=function(_0x44a1b5,_0x2eea5a){var _0x33ee6d={},_0x51ab32={},_0x214543={'count':0x0,'rows':[]};var _0x2195d1=_['map'](db[_0xf98c('0x2b')][_0xf98c('0x2c')],function(_0x384b10){return{'name':_0x384b10[_0xf98c('0x2d')],'type':_0x384b10[_0xf98c('0x2e')][_0xf98c('0x2f')]};});_0x51ab32[_0xf98c('0x30')]=_[_0xf98c('0x31')](_0x2195d1,'name');_0x51ab32[_0xf98c('0x32')]=_[_0xf98c('0x33')](_0x44a1b5[_0xf98c('0x32')]);_0x51ab32['filters']=_[_0xf98c('0x34')](_0x51ab32[_0xf98c('0x30')],_0x51ab32['query']);_0x33ee6d[_0xf98c('0x35')]=_[_0xf98c('0x34')](_0x51ab32[_0xf98c('0x30')],qs['fields'](_0x44a1b5[_0xf98c('0x32')][_0xf98c('0x36')]));_0x33ee6d[_0xf98c('0x35')]=_0x33ee6d['attributes'][_0xf98c('0x37')]?_0x33ee6d[_0xf98c('0x35')]:_0x51ab32['model'];if(!_0x44a1b5[_0xf98c('0x32')][_0xf98c('0x38')]('nolimit')){_0x33ee6d[_0xf98c('0x1e')]=qs[_0xf98c('0x1e')](_0x44a1b5[_0xf98c('0x32')][_0xf98c('0x1e')]);_0x33ee6d['offset']=qs[_0xf98c('0x1d')](_0x44a1b5[_0xf98c('0x32')][_0xf98c('0x1d')]);}_0x33ee6d[_0xf98c('0x39')]=qs[_0xf98c('0x3a')](_0x44a1b5[_0xf98c('0x32')]['sort']);_0x33ee6d[_0xf98c('0x3b')]=qs['filters'](_[_0xf98c('0x3c')](_0x44a1b5[_0xf98c('0x32')],_0x51ab32[_0xf98c('0x3d')]),_0x2195d1);if(_0x44a1b5[_0xf98c('0x32')][_0xf98c('0x3e')]){_0x33ee6d[_0xf98c('0x3b')]=_['merge'](_0x33ee6d[_0xf98c('0x3b')],{'$or':_['map'](_0x2195d1,function(_0x293512){if(_0x293512[_0xf98c('0x2e')]!==_0xf98c('0x3f')){var _0x415b5a={};_0x415b5a[_0x293512[_0xf98c('0x28')]]={'$like':'%'+_0x44a1b5[_0xf98c('0x32')]['filter']+'%'};return _0x415b5a;}})});}_0x33ee6d=_['merge']({},_0x33ee6d,_0x44a1b5['options']);var _0x4ac83c={'where':_0x33ee6d[_0xf98c('0x3b')]};return db[_0xf98c('0x2b')][_0xf98c('0x1c')](_0x4ac83c)[_0xf98c('0x24')](function(_0x177487){_0x214543[_0xf98c('0x1c')]=_0x177487;if(_0x44a1b5['query'][_0xf98c('0x40')]){_0x33ee6d[_0xf98c('0x41')]=[{'all':!![]}];}return db[_0xf98c('0x2b')][_0xf98c('0x42')](_0x33ee6d);})[_0xf98c('0x24')](function(_0x38dda8){_0x214543['rows']=_0x38dda8;return _0x214543;})['then'](respondWithFilteredResult(_0x2eea5a,_0x33ee6d))['catch'](handleError(_0x2eea5a,null));};exports[_0xf98c('0x43')]=function(_0x3a4e5e,_0x4239fc){var _0x57d379={'raw':!![],'where':{'id':_0x3a4e5e[_0xf98c('0x44')]['id']}},_0x1fbe20={};_0x1fbe20[_0xf98c('0x30')]=_[_0xf98c('0x33')](db[_0xf98c('0x2b')][_0xf98c('0x2c')]);_0x1fbe20[_0xf98c('0x32')]=_[_0xf98c('0x33')](_0x3a4e5e['query']);_0x1fbe20[_0xf98c('0x3d')]=_[_0xf98c('0x34')](_0x1fbe20[_0xf98c('0x30')],_0x1fbe20[_0xf98c('0x32')]);_0x57d379['attributes']=_[_0xf98c('0x34')](_0x1fbe20[_0xf98c('0x30')],qs[_0xf98c('0x36')](_0x3a4e5e[_0xf98c('0x32')][_0xf98c('0x36')]));_0x57d379[_0xf98c('0x35')]=_0x57d379[_0xf98c('0x35')][_0xf98c('0x37')]?_0x57d379[_0xf98c('0x35')]:_0x1fbe20[_0xf98c('0x30')];if(_0x3a4e5e['query'][_0xf98c('0x40')]){_0x57d379['include']=[{'all':!![]}];}_0x57d379=_[_0xf98c('0x45')]({},_0x57d379,_0x3a4e5e[_0xf98c('0x46')]);return db[_0xf98c('0x2b')]['find'](_0x57d379)[_0xf98c('0x24')](handleEntityNotFound(_0x4239fc,null))[_0xf98c('0x24')](respondWithResult(_0x4239fc,null))[_0xf98c('0x47')](handleError(_0x4239fc,null));};exports[_0xf98c('0x48')]=function(_0x580ee8,_0x3fe50d){return db['ChatTransferReport'][_0xf98c('0x48')](_0x580ee8[_0xf98c('0x49')],{})['then'](respondWithResult(_0x3fe50d,0xc9))[_0xf98c('0x47')](handleError(_0x3fe50d,null));};exports[_0xf98c('0x22')]=function(_0x1e9fda,_0x230a37){if(_0x1e9fda[_0xf98c('0x49')]['id']){delete _0x1e9fda['body']['id'];}return db['ChatTransferReport'][_0xf98c('0x4a')]({'where':{'id':_0x1e9fda[_0xf98c('0x44')]['id']}})[_0xf98c('0x24')](handleEntityNotFound(_0x230a37,null))['then'](saveUpdates(_0x1e9fda['body'],null))['then'](respondWithResult(_0x230a37,null))[_0xf98c('0x47')](handleError(_0x230a37,null));};exports['destroy']=function(_0x3df7b5,_0x716fe8){return db[_0xf98c('0x2b')][_0xf98c('0x4a')]({'where':{'id':_0x3df7b5[_0xf98c('0x44')]['id']}})[_0xf98c('0x24')](handleEntityNotFound(_0x716fe8,null))['then'](removeEntity(_0x716fe8,null))[_0xf98c('0x47')](handleError(_0x716fe8,null));};exports[_0xf98c('0x4b')]=function(_0x243aac,_0x4aec57){return db[_0xf98c('0x2b')]['describe']()[_0xf98c('0x24')](respondWithResult(_0x4aec57,null))[_0xf98c('0x47')](handleError(_0x4aec57,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 71b0f8a..904a4e0 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 _0x7291=['api','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x37cbb0,_0x307a2b){var _0x2b1ce3=function(_0x29dff7){while(--_0x29dff7){_0x37cbb0['push'](_0x37cbb0['shift']());}};_0x2b1ce3(++_0x307a2b);}(_0x7291,0x6d));var _0x1729=function(_0xd17ce0,_0x246123){_0xd17ce0=_0xd17ce0-0x0;var _0x4a9f3d=_0x7291[_0xd17ce0];return _0x4a9f3d;};'use strict';var _=require(_0x1729('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1729('0x1'));var moment=require('moment');var BPromise=require(_0x1729('0x2'));var rp=require(_0x1729('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1729('0x4'));var config=require(_0x1729('0x5'));var attributes=require(_0x1729('0x6'));module[_0x1729('0x7')]=function(_0x24f896,_0x5bd302){return _0x24f896['define'](_0x1729('0x8'),attributes,{'tableName':_0x1729('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1729('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0812=['ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define'];(function(_0x52bb01,_0x1f0a38){var _0x112a08=function(_0x41e827){while(--_0x41e827){_0x52bb01['push'](_0x52bb01['shift']());}};_0x112a08(++_0x1f0a38);}(_0x0812,0x6e));var _0x2081=function(_0x2e4b9b,_0x3ea071){_0x2e4b9b=_0x2e4b9b-0x0;var _0x5812e4=_0x0812[_0x2e4b9b];return _0x5812e4;};'use strict';var _=require(_0x2081('0x0'));var util=require(_0x2081('0x1'));var logger=require(_0x2081('0x2'))(_0x2081('0x3'));var moment=require(_0x2081('0x4'));var BPromise=require(_0x2081('0x5'));var rp=require(_0x2081('0x6'));var fs=require('fs');var path=require(_0x2081('0x7'));var rimraf=require(_0x2081('0x8'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x418df3,_0x268f10){return _0x418df3[_0x2081('0x9')](_0x2081('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2081('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 2e80ee8..1df1d3e 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 _0xb08f=['request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','http','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x5e1664,_0x12dab0){var _0x29c99d=function(_0xa4eb65){while(--_0xa4eb65){_0x5e1664['push'](_0x5e1664['shift']());}};_0x29c99d(++_0x12dab0);}(_0xb08f,0x139));var _0xfb08=function(_0x2d84e2,_0x132f45){_0x2d84e2=_0x2d84e2-0x0;var _0x1a0181=_0xb08f[_0x2d84e2];return _0x1a0181;};'use strict';var _=require(_0xfb08('0x0'));var util=require(_0xfb08('0x1'));var moment=require(_0xfb08('0x2'));var BPromise=require(_0xfb08('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb08('0x4'));var db=require(_0xfb08('0x5'))['db'];var utils=require(_0xfb08('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xfb08('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x14966a,_0x22c767,_0x6922bf){return new BPromise(function(_0x16585e,_0x38bf0f){return client['request'](_0x14966a,_0x6922bf)[_0xfb08('0x8')](function(_0x179bb2){logger[_0xfb08('0x9')](_0xfb08('0xa'),_0x22c767,_0xfb08('0xb'));logger['debug'](_0xfb08('0xc'),_0x22c767,_0xfb08('0xb'),JSON[_0xfb08('0xd')](_0x179bb2));if(_0x179bb2['error']){if(_0x179bb2[_0xfb08('0xe')][_0xfb08('0xf')]===0x1f4){logger[_0xfb08('0xe')](_0xfb08('0xa'),_0x22c767,_0x179bb2[_0xfb08('0xe')][_0xfb08('0x10')]);return _0x38bf0f(_0x179bb2[_0xfb08('0xe')][_0xfb08('0x10')]);}logger[_0xfb08('0xe')](_0xfb08('0xa'),_0x22c767,_0x179bb2[_0xfb08('0xe')]['message']);return _0x16585e(_0x179bb2[_0xfb08('0xe')][_0xfb08('0x10')]);}else{logger[_0xfb08('0x9')](_0xfb08('0xa'),_0x22c767,_0xfb08('0xb'));_0x16585e(_0x179bb2['result'][_0xfb08('0x10')]);}})[_0xfb08('0x11')](function(_0x3d0215){logger[_0xfb08('0xe')](_0xfb08('0xa'),_0x22c767,_0x3d0215);_0x38bf0f(_0x3d0215);});});} \ No newline at end of file +var _0x7927=['stringify','error','ChatTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x5f49c0,_0x27a1b4){var _0x5ab653=function(_0x4de962){while(--_0x4de962){_0x5f49c0['push'](_0x5f49c0['shift']());}};_0x5ab653(++_0x27a1b4);}(_0x7927,0x1d4));var _0x7792=function(_0x23ad16,_0x40c45a){_0x23ad16=_0x23ad16-0x0;var _0x435bc2=_0x7927[_0x23ad16];return _0x435bc2;};'use strict';var _=require(_0x7792('0x0'));var util=require(_0x7792('0x1'));var moment=require(_0x7792('0x2'));var BPromise=require(_0x7792('0x3'));var rs=require(_0x7792('0x4'));var fs=require('fs');var Redis=require(_0x7792('0x5'));var db=require(_0x7792('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7792('0x7'))(_0x7792('0x8'));var config=require(_0x7792('0x9'));var jayson=require(_0x7792('0xa'));var client=jayson['client'][_0x7792('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a3c34,_0x570ca1,_0x4bf76d){return new BPromise(function(_0x5310af,_0x1194d3){return client[_0x7792('0xc')](_0x5a3c34,_0x4bf76d)['then'](function(_0x2bb122){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x570ca1,_0x7792('0xd'));logger['debug'](_0x7792('0xe'),_0x570ca1,_0x7792('0xd'),JSON[_0x7792('0xf')](_0x2bb122));if(_0x2bb122['error']){if(_0x2bb122[_0x7792('0x10')]['code']===0x1f4){logger[_0x7792('0x10')](_0x7792('0x11'),_0x570ca1,_0x2bb122[_0x7792('0x10')]['message']);return _0x1194d3(_0x2bb122['error']['message']);}logger[_0x7792('0x10')](_0x7792('0x11'),_0x570ca1,_0x2bb122[_0x7792('0x10')][_0x7792('0x12')]);return _0x5310af(_0x2bb122[_0x7792('0x10')][_0x7792('0x12')]);}else{logger[_0x7792('0x13')](_0x7792('0x11'),_0x570ca1,_0x7792('0xd'));_0x5310af(_0x2bb122[_0x7792('0x14')][_0x7792('0x12')]);}})['catch'](function(_0x4a5921){logger[_0x7792('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x570ca1,_0x4a5921);_0x1194d3(_0x4a5921);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 3bdbd40..24cb616 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 _0xe4f6=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xe4f6,0xfd));var _0x6e4f=function(_0x5bf28a,_0x24385a){_0x5bf28a=_0x5bf28a-0x0;var _0x5b5bdf=_0xe4f6[_0x5bf28a];return _0x5b5bdf;};'use strict';var multer=require(_0x6e4f('0x0'));var util=require(_0x6e4f('0x1'));var path=require(_0x6e4f('0x2'));var timeout=require(_0x6e4f('0x3'));var express=require(_0x6e4f('0x4'));var router=express['Router']();var fs_extra=require(_0x6e4f('0x5'));var auth=require(_0x6e4f('0x6'));var interaction=require(_0x6e4f('0x7'));var config=require(_0x6e4f('0x8'));var controller=require('./chatTransferReport.controller');router[_0x6e4f('0x9')]('/',auth[_0x6e4f('0xa')](),controller[_0x6e4f('0xb')]);router[_0x6e4f('0x9')](_0x6e4f('0xc'),auth['isAuthenticated'](),controller[_0x6e4f('0xd')]);router[_0x6e4f('0x9')](_0x6e4f('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x6e4f('0xf')]('/',auth[_0x6e4f('0xa')](),controller[_0x6e4f('0x10')]);router[_0x6e4f('0x11')]('/:id',auth[_0x6e4f('0xa')](),controller['update']);router[_0x6e4f('0x12')](_0x6e4f('0xe'),auth[_0x6e4f('0xa')](),controller['destroy']);module[_0x6e4f('0x13')]=router; \ No newline at end of file +var _0x7bc1=['post','create','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xf56f08,_0x48a748){var _0x5c1b2c=function(_0x49780e){while(--_0x49780e){_0xf56f08['push'](_0xf56f08['shift']());}};_0x5c1b2c(++_0x48a748);}(_0x7bc1,0xaf));var _0x17bc=function(_0x466538,_0x24ca73){_0x466538=_0x466538-0x0;var _0x3e7489=_0x7bc1[_0x466538];return _0x3e7489;};'use strict';var multer=require(_0x17bc('0x0'));var util=require(_0x17bc('0x1'));var path=require(_0x17bc('0x2'));var timeout=require(_0x17bc('0x3'));var express=require(_0x17bc('0x4'));var router=express[_0x17bc('0x5')]();var fs_extra=require(_0x17bc('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x17bc('0x7'));var controller=require(_0x17bc('0x8'));router[_0x17bc('0x9')]('/',auth[_0x17bc('0xa')](),controller[_0x17bc('0xb')]);router['get'](_0x17bc('0xc'),auth[_0x17bc('0xa')](),controller[_0x17bc('0xd')]);router[_0x17bc('0x9')](_0x17bc('0xe'),auth[_0x17bc('0xa')](),controller['show']);router[_0x17bc('0xf')]('/',auth[_0x17bc('0xa')](),controller[_0x17bc('0x10')]);router[_0x17bc('0x11')](_0x17bc('0xe'),auth[_0x17bc('0xa')](),controller['update']);router['delete'](_0x17bc('0xe'),auth['isAuthenticated'](),controller[_0x17bc('0x12')]);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 bfec550..1a1bbe2 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 _0x9c52=['sequelize','STRING','address','email','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Contact\x20us','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','thumb','INTEGER','input','name','text','getDataValue','parse','onlineForm','setDataValue','stringify','TEXT','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','website_alias','bottom_right','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}'];(function(_0xfe7ce3,_0x394ba8){var _0x108672=function(_0x4000b5){while(--_0x4000b5){_0xfe7ce3['push'](_0xfe7ce3['shift']());}};_0x108672(++_0x394ba8);}(_0x9c52,0x170));var _0x29c5=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9c52[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x29c5('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x29c5('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x29c5('0x1')],'allowNull':![],'unique':_0x29c5('0x2')},'description':{'type':Sequelize[_0x29c5('0x1')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x29c5('0x3')},'mapKeyOffline':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0x3')},'key':{'type':Sequelize[_0x29c5('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x29c5('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x29c5('0x1')],'allowNull':![],'defaultValue':_0x29c5('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29c5('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x29c5('0x1')]},'animation':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x29c5('0x7')](_0x29c5('0x8'),_0x29c5('0x9')),'defaultValue':_0x29c5('0x8')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x29c5('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x29c5('0xb')},'download_transcript':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0xc')},'formSubmitFailureMessage':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0xd')},'placeholderMessage':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0xe')},'closingMessage':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0xf')},'closingMessageButton':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0x10')},'skipMessageButton':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0x11')},'conditionAgreement':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x29c5('0x7')](_0x29c5('0x12'),_0x29c5('0x13')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x29c5('0x14')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x29c5('0x15'),'variable':null,'config':{'placeholder':_0x29c5('0x16'),'type':_0x29c5('0x17'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x29c5('0x15'),'props':{'title':_0x29c5('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x29c5('0x3'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x29c5('0x18')]('onlineForm')?JSON[_0x29c5('0x19')](this[_0x29c5('0x18')](_0x29c5('0x1a'))):{};},'set':function(_0x2b89fc){return this[_0x29c5('0x1b')](_0x29c5('0x1a'),JSON[_0x29c5('0x1c')](_0x2b89fc));}},'offlineForm':{'type':Sequelize[_0x29c5('0x1d')],'defaultValue':function(){return JSON[_0x29c5('0x1c')]({'items':[{'type':_0x29c5('0x15'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x29c5('0x3'),'type':_0x29c5('0x3')},'variable':null},{'type':_0x29c5('0x1e'),'config':{'placeholder':_0x29c5('0x1f')},'props':{'title':'Comments','helpText':_0x29c5('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x29c5('0x18')](_0x29c5('0x21'))?JSON[_0x29c5('0x19')](this[_0x29c5('0x18')]('offlineForm')):{};},'set':function(_0x3ff1c7){return this[_0x29c5('0x1b')](_0x29c5('0x21'),JSON[_0x29c5('0x1c')](_0x3ff1c7));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x29c5('0x1')]},'forwardOffline':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x29c5('0x1')]},'waitingTitle':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0x22')},'waitingMessage':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0x24')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x29c5('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0x10')},'enableCustomerAttachment':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x29c5('0x1')]},'notificationTemplate':{'type':Sequelize[_0x29c5('0x1d')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0x29c5('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x29c5('0x27')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x29c5('0x1')]},'customerAvatar':{'type':Sequelize[_0x29c5('0x1d')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x29c5('0x14')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x29c5('0x1')],'allowNull':![],'defaultValue':_0x29c5('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x29c5('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x29c5('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x29c5('0x29')},'systemAvatar':{'type':Sequelize[_0x29c5('0x1d')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x29c5('0x14')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![],'comment':_0x29c5('0x2a'),'set':function(_0x2dcd56){if(!_0x2dcd56)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x29c5('0x1b')](_0x29c5('0x2b'),_0x2dcd56);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x29c5('0x1')]},'vidaooTopic':{'type':Sequelize[_0x29c5('0x1')],'allowNull':![],'defaultValue':_0x29c5('0x2c')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x29c5('0x2d');}},'vidaooMetadata':{'type':Sequelize[_0x29c5('0x1d')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x29c5('0x1d')]}}; \ No newline at end of file +var _0x746c=['Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','name','input','getDataValue','onlineForm','parse','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','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}}','bottom_right','#fafafa','System','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT'];(function(_0x43c758,_0x290424){var _0x18d46e=function(_0x395d4a){while(--_0x395d4a){_0x43c758['push'](_0x43c758['shift']());}};_0x18d46e(++_0x290424);}(_0x746c,0x7f));var _0xc746=function(_0x58b603,_0x450f6d){_0x58b603=_0x58b603-0x0;var _0xf76126=_0x746c[_0x58b603];return _0xf76126;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc746('0x0'));module[_0xc746('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xc746('0x2')],'allowNull':![],'unique':_0xc746('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x4')},'mapKeyOffline':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x4')},'key':{'type':Sequelize[_0xc746('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x5')},'customerAlias':{'type':Sequelize[_0xc746('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xc746('0x2')],'allowNull':![],'defaultValue':_0xc746('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xc746('0x2')],'allowNull':![],'defaultValue':_0xc746('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xc746('0x2')],'allowNull':![],'defaultValue':_0xc746('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xc746('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xc746('0x2')]},'animation':{'type':Sequelize[_0xc746('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xc746('0xa')](_0xc746('0xb'),_0xc746('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xc746('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xc746('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xc746('0xd')},'header_offline':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0xe')},'download_transcript':{'type':Sequelize[_0xc746('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xc746('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xc746('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xc746('0x10')]},'closingQuestion':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xc746('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xc746('0x14')},'placeholderMessage':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x15')},'closingMessage':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xc746('0xd')},'skipMessageButton':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x17')},'conditionAgreement':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x18')},'ratingType':{'type':Sequelize[_0xc746('0xa')](_0xc746('0x19'),_0xc746('0x1a')),'defaultValue':_0xc746('0x19')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xc746('0x1b'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xc746('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xc746('0x4'),'type':_0xc746('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xc746('0x1d')](_0xc746('0x1e'))?JSON[_0xc746('0x1f')](this['getDataValue'](_0xc746('0x1e'))):{};},'set':function(_0x19671a){return this[_0xc746('0x20')](_0xc746('0x1e'),JSON[_0xc746('0x21')](_0x19671a));}},'offlineForm':{'type':Sequelize[_0xc746('0x10')],'defaultValue':function(){return JSON[_0xc746('0x21')]({'items':[{'type':'input','props':{'title':_0xc746('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xc746('0x4'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0xc746('0x22'),'helpText':_0xc746('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xc746('0x1d')](_0xc746('0x24'))?JSON['parse'](this[_0xc746('0x1d')](_0xc746('0x24'))):{};},'set':function(_0x1520cf){return this[_0xc746('0x20')](_0xc746('0x24'),JSON[_0xc746('0x21')](_0x1520cf));}},'token':{'type':Sequelize[_0xc746('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xc746('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xc746('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x25')},'waitingMessage':{'type':Sequelize[_0xc746('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x26')},'offlineMessageBody':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xc746('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xc746('0x28')},'skipUnmanaged':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x17')},'sendUnmanaged':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xc746('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xc746('0x2')]},'notificationTemplate':{'type':Sequelize[_0xc746('0x10')],'defaultValue':function(){return _0xc746('0x29');}},'notificationSound':{'type':Sequelize[_0xc746('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xc746('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x2a')},'verticalAlignment':{'type':Sequelize[_0xc746('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xc746('0x2')]},'customerAvatar':{'type':Sequelize[_0xc746('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xc746('0x2')],'allowNull':![],'defaultValue':_0xc746('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc746('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x2c')},'systemAvatar':{'type':Sequelize[_0xc746('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc746('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x454d2b){if(!_0x454d2b)this[_0xc746('0x20')](_0xc746('0x2d'),null);this[_0xc746('0x20')]('mandatoryDisposition',_0x454d2b);}},'vidaooEscalation':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xc746('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc746('0x2e')},'vidaooNote':{'type':Sequelize[_0xc746('0x2')],'defaultValue':function(){return _0xc746('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0xc746('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xc746('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index d79dda9..4a96c6c 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 _0x6855=['Intervals','virtual','custom','License','increment','push','all','some','utf8','remote','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','textColor','backgroundColor','addApplications','sequelize','ChatApplication','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','getFields','online','false','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../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','./chatWebsite.socket','register','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','get','ChatWebsites','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','ChatWebsite','includeAll','include','rows','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','nolimit','ChatWebsiteId','Disposition','findAll','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','ids','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','getLicense','isNil','existsSync','server/files/images/logos/','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','describe','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','Applications','List','account','list','applications','orderBy','priority','asc','Contacts','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','unknown','format','%s\x20%s','device','vendor','threadId','ChatInteraction','ContactId','interaction','contact','lastName','messageId','created','autoclose','close','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','offline','no\x20available\x20attributes','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','files','attachments','offline-chat','basename','transaction','Attachment','bulkCreate','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','openNewInteraction','MailAccountId','mimetype','toPairsIn','mapValues','subjectOffline','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','tag','Command','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','timezone','No\x20timezone','getSnippet','Interval'];(function(_0x49adfe,_0x2fd329){var _0x1d53da=function(_0x4edbdb){while(--_0x4edbdb){_0x49adfe['push'](_0x49adfe['shift']());}};_0x1d53da(++_0x2fd329);}(_0x6855,0x157));var _0x5685=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0x6855[_0x5e4563];return _0x8d1bf5;};'use strict';var emlformat=require(_0x5685('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5685('0x1'));var rp=require('request-promise');var moment=require(_0x5685('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5685('0x3'));var util=require(_0x5685('0x4'));var path=require(_0x5685('0x5'));var sox=require(_0x5685('0x6'));var csv=require('to-csv');var ejs=require(_0x5685('0x7'));var fs=require('fs');var fs_extra=require(_0x5685('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5685('0x9'));var jsforce=require(_0x5685('0xa'));var deskjs=require(_0x5685('0xb'));var toCsv=require(_0x5685('0xc'));var querystring=require(_0x5685('0xd'));var Papa=require(_0x5685('0xe'));var Redis=require('ioredis');var authService=require(_0x5685('0xf'));var qs=require(_0x5685('0x10'));var as=require(_0x5685('0x11'));var hardwareService=require(_0x5685('0x12'));var logger=require(_0x5685('0x13'))('api');var utils=require(_0x5685('0x14'));var config=require(_0x5685('0x15'));var licenseUtil=require(_0x5685('0x16'));var db=require(_0x5685('0x17'))['db'];config[_0x5685('0x18')]=_[_0x5685('0x19')](config[_0x5685('0x18')],{'host':_0x5685('0x1a'),'port':0x18eb});var socket=require(_0x5685('0x1b'))(new Redis(config[_0x5685('0x18')]));require(_0x5685('0x1c'))[_0x5685('0x1d')](socket);var jayson=require(_0x5685('0x1e'));var client=jayson[_0x5685('0x1f')][_0x5685('0x20')]({'port':0x232c});var client9002=jayson[_0x5685('0x1f')][_0x5685('0x20')]({'port':0x232a});var client9003=jayson[_0x5685('0x1f')][_0x5685('0x20')]({'port':0x232b});var client9001=jayson[_0x5685('0x1f')]['http']({'port':0x2329});function respondWithRpcPromise(_0x1dfa38,_0x273360,_0x368a53,_0x5651e9){return new BPromise(function(_0xdde08d,_0x1f292a){var _0x64dfe3=_0x5651e9||client;return _0x64dfe3['request'](_0x1dfa38,_0x368a53)[_0x5685('0x21')](function(_0xdc2cbc){logger[_0x5685('0x22')](_0x5685('0x23'),_0x273360,_0x5685('0x24'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x273360,_0x5685('0x24'),JSON[_0x5685('0x25')](_0xdc2cbc));if(_0xdc2cbc[_0x5685('0x26')]){if(_0xdc2cbc[_0x5685('0x26')][_0x5685('0x27')]===0x1f4){logger[_0x5685('0x26')](_0x5685('0x23'),_0x273360,_0xdc2cbc[_0x5685('0x26')][_0x5685('0x28')]);return _0x1f292a(_0xdc2cbc['error']['message']);}logger[_0x5685('0x26')](_0x5685('0x23'),_0x273360,_0xdc2cbc[_0x5685('0x26')]['message']);return _0xdde08d(_0xdc2cbc[_0x5685('0x26')][_0x5685('0x28')]);}else{logger[_0x5685('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x273360,'request\x20sent');_0xdde08d(_0xdc2cbc[_0x5685('0x29')][_0x5685('0x28')]);}})[_0x5685('0x2a')](function(_0xfaa39b){logger[_0x5685('0x26')](_0x5685('0x23'),_0x273360,_0xfaa39b);_0x1f292a(_0xfaa39b);});});}function respondWithStatusCode(_0x6e1964,_0x32ff47){_0x32ff47=_0x32ff47||0xcc;return function(_0x58d265){if(_0x58d265){return _0x6e1964[_0x5685('0x2b')](_0x32ff47);}return _0x6e1964[_0x5685('0x2c')](_0x32ff47)[_0x5685('0x2d')]();};}function respondWithResult(_0x310856,_0x5c5c40){_0x5c5c40=_0x5c5c40||0xc8;return function(_0x7cce1f){if(_0x7cce1f){return _0x310856[_0x5685('0x2c')](_0x5c5c40)[_0x5685('0x2e')](_0x7cce1f);}};}function respondWithFilteredResult(_0x534fff,_0x1e7fe0){return function(_0x3ebd8d){if(_0x3ebd8d){var _0x59d938=typeof _0x1e7fe0[_0x5685('0x2f')]===_0x5685('0x30')&&typeof _0x1e7fe0['limit']===_0x5685('0x30');var _0x458b8f=_0x3ebd8d[_0x5685('0x31')];var _0x1c8243=_0x59d938?0x0:_0x1e7fe0[_0x5685('0x2f')];var _0x29ffde=_0x59d938?_0x3ebd8d['count']:_0x1e7fe0[_0x5685('0x2f')]+_0x1e7fe0[_0x5685('0x32')];var _0x37bf6d;if(_0x29ffde>=_0x458b8f){_0x29ffde=_0x458b8f;_0x37bf6d=0xc8;}else{_0x37bf6d=0xce;}_0x534fff[_0x5685('0x2c')](_0x37bf6d);return _0x534fff[_0x5685('0x33')]('Content-Range',_0x1c8243+'-'+_0x29ffde+'/'+_0x458b8f)['json'](_0x3ebd8d);}return null;};}function patchUpdates(_0x52f61a){return function(_0x396257){try{jsonpatch[_0x5685('0x34')](_0x396257,_0x52f61a,!![]);}catch(_0x4ffb03){return BPromise['reject'](_0x4ffb03);}return _0x396257[_0x5685('0x35')]();};}function saveUpdates(_0x109087,_0x53a510){return function(_0xb3456c){if(_0xb3456c){return _0xb3456c[_0x5685('0x36')](_0x109087)[_0x5685('0x21')](function(_0x1d0876){return _0x1d0876;});}return null;};}function removeEntity(_0xb8c19b,_0x5cca69){return function(_0x4b8fc3){if(_0x4b8fc3){return _0x4b8fc3['destroy']()[_0x5685('0x21')](function(){var _0x517a6e=_0x4b8fc3[_0x5685('0x37')]({'plain':!![]});var _0x41519a=_0x5685('0x38');return db['UserProfileResource'][_0x5685('0x39')]({'where':{'type':_0x41519a,'resourceId':_0x517a6e['id']}})[_0x5685('0x21')](function(){return _0x4b8fc3;});})['then'](function(){_0xb8c19b[_0x5685('0x2c')](0xcc)[_0x5685('0x2d')]();});}};}function handleEntityNotFound(_0x4455a2,_0xdaeb4a){return function(_0x426600){if(!_0x426600){_0x4455a2[_0x5685('0x2b')](0x194);}return _0x426600;};}function handleError(_0x285baa,_0x42c562){_0x42c562=_0x42c562||0x1f4;return function(_0x453b87){logger[_0x5685('0x26')](_0x453b87[_0x5685('0x3a')]);if(_0x453b87[_0x5685('0x3b')]){delete _0x453b87[_0x5685('0x3b')];}_0x285baa['status'](_0x42c562)[_0x5685('0x3c')](_0x453b87);};}exports[_0x5685('0x3d')]=function(_0x55312d,_0x2ce479){var _0x1932ae={'include':[{'model':db[_0x5685('0x3e')],'as':_0x5685('0x3f')}]},_0x199a18={},_0x6ed76={'count':0x0,'rows':[]};var _0x3a02e3=_[_0x5685('0x40')](db['ChatWebsite'][_0x5685('0x41')],function(_0x46da56){return{'name':_0x46da56[_0x5685('0x42')],'type':_0x46da56[_0x5685('0x43')][_0x5685('0x44')]};});_0x199a18[_0x5685('0x45')]=_['map'](_0x3a02e3,_0x5685('0x3b'));_0x199a18[_0x5685('0x46')]=_[_0x5685('0x47')](_0x55312d[_0x5685('0x46')]);_0x199a18['filters']=_[_0x5685('0x48')](_0x199a18[_0x5685('0x45')],_0x199a18['query']);_0x1932ae[_0x5685('0x49')]=_['intersection'](_0x199a18[_0x5685('0x45')],qs['fields'](_0x55312d['query'][_0x5685('0x4a')]));_0x1932ae[_0x5685('0x49')]=_0x1932ae[_0x5685('0x49')][_0x5685('0x4b')]?_0x1932ae[_0x5685('0x49')]:_0x199a18[_0x5685('0x45')];if(!_0x55312d[_0x5685('0x46')][_0x5685('0x4c')]('nolimit')){_0x1932ae['limit']=qs[_0x5685('0x32')](_0x55312d['query'][_0x5685('0x32')]);_0x1932ae['offset']=qs[_0x5685('0x2f')](_0x55312d[_0x5685('0x46')][_0x5685('0x2f')]);}_0x1932ae[_0x5685('0x4d')]=qs['sort'](_0x55312d[_0x5685('0x46')][_0x5685('0x4e')]);_0x1932ae['where']=qs[_0x5685('0x4f')](_[_0x5685('0x50')](_0x55312d[_0x5685('0x46')],_0x199a18[_0x5685('0x4f')]),_0x3a02e3);if(_0x55312d[_0x5685('0x46')][_0x5685('0x51')]){_0x1932ae[_0x5685('0x52')]=_[_0x5685('0x53')](_0x1932ae[_0x5685('0x52')],{'$or':_[_0x5685('0x40')](_0x3a02e3,function(_0x44ad7e){if(_0x44ad7e[_0x5685('0x43')]!==_0x5685('0x54')){var _0x36822c={};_0x36822c[_0x44ad7e[_0x5685('0x3b')]]={'$like':'%'+_0x55312d[_0x5685('0x46')][_0x5685('0x51')]+'%'};return _0x36822c;}})});}_0x1932ae=_['merge']({},_0x1932ae,_0x55312d[_0x5685('0x55')]);var _0x188f60={'where':_0x1932ae[_0x5685('0x52')]};return db[_0x5685('0x56')][_0x5685('0x31')](_0x188f60)[_0x5685('0x21')](function(_0x51bec6){_0x6ed76['count']=_0x51bec6;if(_0x55312d[_0x5685('0x46')][_0x5685('0x57')]){_0x1932ae[_0x5685('0x58')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x1932ae);})[_0x5685('0x21')](function(_0x170dd5){_0x6ed76[_0x5685('0x59')]=_0x170dd5;return _0x6ed76;})[_0x5685('0x21')](respondWithFilteredResult(_0x2ce479,_0x1932ae))[_0x5685('0x2a')](handleError(_0x2ce479,null));};exports['show']=function(_0x1197d3,_0x154eb1){var _0x56701e={'raw':![],'where':{'id':_0x1197d3[_0x5685('0x5a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2840dc={};_0x2840dc[_0x5685('0x45')]=_[_0x5685('0x47')](db[_0x5685('0x56')][_0x5685('0x41')]);_0x2840dc[_0x5685('0x46')]=_[_0x5685('0x47')](_0x1197d3[_0x5685('0x46')]);_0x2840dc[_0x5685('0x4f')]=_['intersection'](_0x2840dc[_0x5685('0x45')],_0x2840dc['query']);_0x56701e[_0x5685('0x49')]=_[_0x5685('0x48')](_0x2840dc['model'],qs[_0x5685('0x4a')](_0x1197d3[_0x5685('0x46')][_0x5685('0x4a')]));_0x56701e['attributes']=_0x56701e[_0x5685('0x49')][_0x5685('0x4b')]?_0x56701e[_0x5685('0x49')]:_0x2840dc[_0x5685('0x45')];if(_0x1197d3[_0x5685('0x46')][_0x5685('0x57')]){_0x56701e[_0x5685('0x58')]=[{'all':!![]}];}_0x56701e=_[_0x5685('0x53')]({},_0x56701e,_0x1197d3[_0x5685('0x55')]);return db[_0x5685('0x56')][_0x5685('0x5b')](_0x56701e)[_0x5685('0x21')](handleEntityNotFound(_0x154eb1,null))[_0x5685('0x21')](respondWithResult(_0x154eb1,null))[_0x5685('0x2a')](handleError(_0x154eb1,null));};exports[_0x5685('0x5c')]=function(_0x40bf0d,_0x4958a9){return db['ChatWebsite'][_0x5685('0x5c')](_0x40bf0d[_0x5685('0x5d')],{})[_0x5685('0x21')](function(_0x29c238){var _0x2d5c59=_0x40bf0d[_0x5685('0x5e')][_0x5685('0x37')]({'plain':!![]});if(!_0x2d5c59)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d5c59[_0x5685('0x5f')]==='user'){var _0x181772=_0x29c238[_0x5685('0x37')]({'plain':!![]});var _0xcf2ad3='ChatWebsites';return db[_0x5685('0x60')][_0x5685('0x5b')]({'where':{'name':_0xcf2ad3,'userProfileId':_0x2d5c59[_0x5685('0x61')]},'raw':!![]})[_0x5685('0x21')](function(_0x3dc6c8){if(_0x3dc6c8&&_0x3dc6c8[_0x5685('0x62')]===0x0){return db[_0x5685('0x63')]['create']({'name':_0x181772[_0x5685('0x3b')],'resourceId':_0x181772['id'],'type':_0x3dc6c8[_0x5685('0x3b')],'sectionId':_0x3dc6c8['id']},{})['then'](function(){return _0x29c238;});}else{return _0x29c238;}})[_0x5685('0x2a')](function(_0x504d20){logger[_0x5685('0x26')](_0x5685('0x64'),_0x504d20);throw _0x504d20;});}return _0x29c238;})[_0x5685('0x21')](respondWithResult(_0x4958a9,0xc9))['catch'](handleError(_0x4958a9,null));};exports[_0x5685('0x36')]=function(_0x4a7af1,_0xe8e978){if(_0x4a7af1['body']['id']){delete _0x4a7af1[_0x5685('0x5d')]['id'];}return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x4a7af1[_0x5685('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x5685('0x3f')}]})['then'](handleEntityNotFound(_0xe8e978,null))[_0x5685('0x21')](saveUpdates(_0x4a7af1[_0x5685('0x5d')],null))[_0x5685('0x21')](respondWithResult(_0xe8e978,null))[_0x5685('0x2a')](handleError(_0xe8e978,null));};exports[_0x5685('0x39')]=function(_0x4413dd,_0x4220df){return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x4413dd[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x4220df,null))[_0x5685('0x21')](removeEntity(_0x4220df,null))[_0x5685('0x2a')](handleError(_0x4220df,null));};exports['describe']=function(_0x15fa78,_0x577ef3){return db[_0x5685('0x56')]['describe']()['then'](respondWithResult(_0x577ef3,null))['catch'](handleError(_0x577ef3,null));};exports[_0x5685('0x65')]=function(_0x2a8588,_0x225469,_0x2e333d){if(_0x2a8588[_0x5685('0x5d')]['id']){delete _0x2a8588[_0x5685('0x5d')]['id'];}return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x2a8588[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x225469,null))[_0x5685('0x21')](function(_0x13cdad){if(_0x13cdad){_0x2a8588[_0x5685('0x5d')]['ChatWebsiteId']=_0x13cdad['id'];return db['Disposition'][_0x5685('0x5c')](_0x2a8588[_0x5685('0x5d')]);}})[_0x5685('0x21')](respondWithResult(_0x225469,null))[_0x5685('0x2a')](handleError(_0x225469,null));};exports['getDispositions']=function(_0x160ba8,_0x3ddd96,_0x14bdde){var _0x373fe1={'raw':![],'where':{}};var _0x34559b={};var _0x2cccb3={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x160ba8[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x3ddd96,null))['then'](function(_0x5bb1f2){if(_0x5bb1f2){_0x34559b['model']=_[_0x5685('0x47')](db['Disposition'][_0x5685('0x41')]);_0x34559b[_0x5685('0x46')]=_['keys'](_0x160ba8[_0x5685('0x46')]);_0x34559b[_0x5685('0x4f')]=_[_0x5685('0x48')](_0x34559b[_0x5685('0x45')],_0x34559b[_0x5685('0x46')]);_0x373fe1[_0x5685('0x49')]=_[_0x5685('0x48')](_0x34559b[_0x5685('0x45')],qs[_0x5685('0x4a')](_0x160ba8[_0x5685('0x46')][_0x5685('0x4a')]));_0x373fe1[_0x5685('0x49')]=_0x373fe1[_0x5685('0x49')][_0x5685('0x4b')]?_0x373fe1['attributes']:_0x34559b[_0x5685('0x45')];if(!_0x160ba8['query'][_0x5685('0x4c')](_0x5685('0x66'))){_0x373fe1['limit']=qs[_0x5685('0x32')](_0x160ba8[_0x5685('0x46')][_0x5685('0x32')]);_0x373fe1[_0x5685('0x2f')]=qs[_0x5685('0x2f')](_0x160ba8[_0x5685('0x46')]['offset']);}_0x373fe1['order']=qs[_0x5685('0x4e')](_0x160ba8[_0x5685('0x46')][_0x5685('0x4e')]);_0x373fe1[_0x5685('0x52')]=qs[_0x5685('0x4f')](_[_0x5685('0x50')](_0x160ba8['query'],_0x34559b[_0x5685('0x4f')]));_0x373fe1[_0x5685('0x52')][_0x5685('0x67')]=_0x5bb1f2['id'];if(_0x160ba8['query'][_0x5685('0x51')]){_0x373fe1[_0x5685('0x52')]=_['merge'](_0x373fe1['where'],{'$or':_[_0x5685('0x40')](_0x373fe1[_0x5685('0x49')],function(_0x394783){var _0x478378={};_0x478378[_0x394783]={'$like':'%'+_0x160ba8['query'][_0x5685('0x51')]+'%'};return _0x478378;})});}_0x373fe1=_[_0x5685('0x53')]({},_0x373fe1,_0x160ba8[_0x5685('0x55')]);return db['Disposition']['count']({'where':_0x373fe1[_0x5685('0x52')]})[_0x5685('0x21')](function(_0x1fb097){_0x2cccb3[_0x5685('0x31')]=_0x1fb097;if(_0x160ba8['query'][_0x5685('0x57')]){_0x373fe1['include']=[{'all':!![]}];}return db[_0x5685('0x68')][_0x5685('0x69')](_0x373fe1);})[_0x5685('0x21')](function(_0x2ba85e){_0x2cccb3['rows']=_0x2ba85e;return _0x2cccb3;});}})['then'](respondWithFilteredResult(_0x3ddd96,_0x373fe1))[_0x5685('0x2a')](handleError(_0x3ddd96,null));};exports[_0x5685('0x6a')]=function(_0x1aefa7,_0x128633,_0x216591){return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x1aefa7['params']['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x128633,null))['then'](function(_0x2c97f2){if(_0x2c97f2){return _0x2c97f2[_0x5685('0x6a')](_0x1aefa7[_0x5685('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x128633,null))['catch'](handleError(_0x128633,null));};exports[_0x5685('0x6b')]=function(_0x4ce07f,_0x9e9468,_0x66b1af){if(_0x4ce07f['body']['id']){delete _0x4ce07f['body']['id'];}return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x4ce07f['params']['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x9e9468,null))[_0x5685('0x21')](function(_0x3ea573){if(_0x3ea573){_0x4ce07f[_0x5685('0x5d')][_0x5685('0x67')]=_0x3ea573['id'];return db['CannedAnswer'][_0x5685('0x5c')](_0x4ce07f[_0x5685('0x5d')]);}})[_0x5685('0x21')](respondWithResult(_0x9e9468,null))[_0x5685('0x2a')](handleError(_0x9e9468,null));};exports[_0x5685('0x6c')]=function(_0x19f98e,_0x3252eb,_0x2bee11){var _0xc71188={'raw':![],'where':{}};var _0x25fe09={};var _0x54fad9={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5685('0x6d')]({'where':{'id':_0x19f98e['params']['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x3252eb,null))[_0x5685('0x21')](function(_0x15453c){if(_0x15453c){_0x25fe09[_0x5685('0x45')]=_[_0x5685('0x47')](db[_0x5685('0x6e')][_0x5685('0x41')]);_0x25fe09[_0x5685('0x46')]=_[_0x5685('0x47')](_0x19f98e[_0x5685('0x46')]);_0x25fe09[_0x5685('0x4f')]=_[_0x5685('0x48')](_0x25fe09[_0x5685('0x45')],_0x25fe09[_0x5685('0x46')]);_0xc71188['attributes']=_['intersection'](_0x25fe09[_0x5685('0x45')],qs[_0x5685('0x4a')](_0x19f98e[_0x5685('0x46')][_0x5685('0x4a')]));_0xc71188[_0x5685('0x49')]=_0xc71188['attributes'][_0x5685('0x4b')]?_0xc71188[_0x5685('0x49')]:_0x25fe09[_0x5685('0x45')];if(!_0x19f98e[_0x5685('0x46')][_0x5685('0x4c')](_0x5685('0x66'))){_0xc71188[_0x5685('0x32')]=qs[_0x5685('0x32')](_0x19f98e[_0x5685('0x46')][_0x5685('0x32')]);_0xc71188[_0x5685('0x2f')]=qs[_0x5685('0x2f')](_0x19f98e[_0x5685('0x46')][_0x5685('0x2f')]);}_0xc71188[_0x5685('0x4d')]=qs[_0x5685('0x4e')](_0x19f98e['query'][_0x5685('0x4e')]);_0xc71188['where']=qs[_0x5685('0x4f')](_['pick'](_0x19f98e[_0x5685('0x46')],_0x25fe09['filters']));_0xc71188[_0x5685('0x52')][_0x5685('0x67')]=_0x15453c['id'];if(_0x19f98e[_0x5685('0x46')][_0x5685('0x51')]){_0xc71188[_0x5685('0x52')]=_[_0x5685('0x53')](_0xc71188[_0x5685('0x52')],{'$or':_[_0x5685('0x40')](_0xc71188[_0x5685('0x49')],function(_0x56e668){var _0x5c2a27={};_0x5c2a27[_0x56e668]={'$like':'%'+_0x19f98e[_0x5685('0x46')][_0x5685('0x51')]+'%'};return _0x5c2a27;})});}_0xc71188=_[_0x5685('0x53')]({},_0xc71188,_0x19f98e[_0x5685('0x55')]);return db['CannedAnswer']['count']({'where':_0xc71188[_0x5685('0x52')]})[_0x5685('0x21')](function(_0x2ef29d){_0x54fad9['count']=_0x2ef29d;if(_0x19f98e[_0x5685('0x46')]['includeAll']){_0xc71188[_0x5685('0x58')]=[{'all':!![]}];}return db[_0x5685('0x6e')][_0x5685('0x69')](_0xc71188);})[_0x5685('0x21')](function(_0x3d844a){_0x54fad9[_0x5685('0x59')]=_0x3d844a;return _0x54fad9;});}})[_0x5685('0x21')](respondWithFilteredResult(_0x3252eb,_0xc71188))[_0x5685('0x2a')](handleError(_0x3252eb,null));};exports[_0x5685('0x6f')]=function(_0x5cd4df,_0x353c0e,_0x36dec0){return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x5cd4df['params']['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x353c0e,null))[_0x5685('0x21')](function(_0x2a9a15){if(_0x2a9a15){return _0x2a9a15[_0x5685('0x6f')](_0x5cd4df[_0x5685('0x46')][_0x5685('0x70')]);}})[_0x5685('0x21')](respondWithStatusCode(_0x353c0e,null))[_0x5685('0x2a')](handleError(_0x353c0e,null));};exports[_0x5685('0x71')]=function(_0x13e8d6,_0x39d2c3,_0x308c3a){_0x13e8d6[_0x5685('0x5d')]['sitepic']=_0x13e8d6[_0x5685('0x72')][_0x5685('0x73')];return db[_0x5685('0x56')]['find']({'where':{'id':_0x13e8d6[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x39d2c3,null))[_0x5685('0x21')](saveUpdates(_0x13e8d6[_0x5685('0x5d')],null))[_0x5685('0x21')](respondWithResult(_0x39d2c3,null))[_0x5685('0x2a')](handleError(_0x39d2c3,null));};exports[_0x5685('0x74')]=function(_0x294460,_0x3921d8,_0x4529b4){_0x294460[_0x5685('0x5d')][_0x5685('0x75')]=_0x294460[_0x5685('0x72')][_0x5685('0x73')];return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x294460[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x3921d8,null))[_0x5685('0x21')](saveUpdates(_0x294460[_0x5685('0x5d')],null))[_0x5685('0x21')](respondWithResult(_0x3921d8,null))['catch'](handleError(_0x3921d8,null));};exports[_0x5685('0x76')]=function(_0x46001b,_0x4e7a60,_0x3bb3e2){_0x46001b['body']['customerAvatar']=_0x46001b[_0x5685('0x72')]['filename'];return db['ChatWebsite'][_0x5685('0x5b')]({'where':{'id':_0x46001b[_0x5685('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4e7a60,null))[_0x5685('0x21')](saveUpdates(_0x46001b[_0x5685('0x5d')],null))[_0x5685('0x21')](respondWithResult(_0x4e7a60,null))[_0x5685('0x2a')](handleError(_0x4e7a60,null));};exports['addSystemAvatar']=function(_0x1f4afc,_0x32d751,_0x5f20b7){_0x1f4afc[_0x5685('0x5d')]['systemAvatar']=_0x1f4afc[_0x5685('0x72')][_0x5685('0x73')];return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x1f4afc[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x32d751,null))['then'](saveUpdates(_0x1f4afc[_0x5685('0x5d')],null))[_0x5685('0x21')](respondWithResult(_0x32d751,null))['catch'](handleError(_0x32d751,null));};exports[_0x5685('0x77')]=function(_0x8a2b07,_0x55f352,_0x52b009){var _0xec091e=path[_0x5685('0x78')](config[_0x5685('0x79')],_0x5685('0x7a'));var _0x31a402={'where':{'id':_0x8a2b07['params']['id']},'attributes':['id',_0x5685('0x7b')],'raw':!![]};var _0x362a83=![];return require(_0x5685('0x16'))[_0x5685('0x7c')]()[_0x5685('0x21')](function(_0x101dd4){if(_0x101dd4){_0x362a83=_0x101dd4['custom'];}})[_0x5685('0x21')](function(){return db[_0x5685('0x56')]['find'](_0x31a402);})['then'](handleEntityNotFound(_0x55f352,null))[_0x5685('0x21')](function(_0x46c635){if(_0x46c635){if(!_[_0x5685('0x7d')](_0x46c635['sitepic'])){if(fs[_0x5685('0x7e')](path[_0x5685('0x78')](config[_0x5685('0x79')],'server/files/images/logos/',_0x46c635[_0x5685('0x7b')]))&&_0x362a83){_0xec091e=path[_0x5685('0x78')](config[_0x5685('0x79')],_0x5685('0x7f'),_0x46c635[_0x5685('0x7b')]);}}return _0x55f352['download'](_0xec091e);}})[_0x5685('0x2a')](handleError(_0x55f352,null));};exports['getAvatar']=function(_0x405b76,_0x1d6d54,_0xf97bec){var _0x37fb42=path[_0x5685('0x78')](config[_0x5685('0x79')],'server/files/images/avatars/default_avatar.png');var _0xc18602={'where':{'id':_0x405b76[_0x5685('0x5a')]['id']},'attributes':['id',_0x5685('0x75')],'raw':!![]};return db[_0x5685('0x56')][_0x5685('0x5b')](_0xc18602)[_0x5685('0x21')](handleEntityNotFound(_0x1d6d54,null))['then'](function(_0x337d6c){if(_0x337d6c){if(!_[_0x5685('0x7d')](_0x337d6c[_0x5685('0x75')])){if(fs[_0x5685('0x7e')](path[_0x5685('0x78')](config[_0x5685('0x79')],_0x5685('0x80'),_0x337d6c[_0x5685('0x75')]))){_0x37fb42=path[_0x5685('0x78')](config['root'],_0x5685('0x80'),_0x337d6c[_0x5685('0x75')]);}}return _0x1d6d54['download'](_0x37fb42);}})[_0x5685('0x2a')](handleError(_0x1d6d54,null));};exports[_0x5685('0x81')]=function(_0x5a3d55,_0x51043e,_0x3778f4){var _0x422cb2=path[_0x5685('0x78')](config[_0x5685('0x79')],_0x5685('0x82'));var _0x28c4b6={'where':{'id':_0x5a3d55[_0x5685('0x5a')]['id']},'attributes':['id',_0x5685('0x83'),_0x5685('0x84')],'raw':!![]};return db['ChatWebsite'][_0x5685('0x5b')](_0x28c4b6)[_0x5685('0x21')](handleEntityNotFound(_0x51043e,null))[_0x5685('0x21')](function(_0x20672e){if(_0x20672e){if(!_[_0x5685('0x7d')](_0x20672e[_0x5685('0x83')])){if(fs[_0x5685('0x7e')](path[_0x5685('0x78')](config[_0x5685('0x79')],_0x5685('0x80'),_0x20672e['customerAvatar']))&&_0x20672e[_0x5685('0x84')]){_0x422cb2=path['join'](config[_0x5685('0x79')],'server/files/images/avatars/',_0x20672e[_0x5685('0x83')]);}}return _0x51043e[_0x5685('0x85')](_0x422cb2);}})[_0x5685('0x2a')](handleError(_0x51043e,null));};exports[_0x5685('0x86')]=function(_0x397fdc,_0x58eafb,_0x5e7a09){var _0x59cebe=path[_0x5685('0x78')](config['root'],_0x5685('0x87'));var _0x315ab5={'where':{'id':_0x397fdc[_0x5685('0x5a')]['id']},'attributes':['id',_0x5685('0x88')],'raw':!![]};return db['ChatWebsite'][_0x5685('0x5b')](_0x315ab5)[_0x5685('0x21')](handleEntityNotFound(_0x58eafb,null))[_0x5685('0x21')](function(_0x387156){if(_0x387156){if(!_[_0x5685('0x7d')](_0x387156['systemAvatar'])){if(fs[_0x5685('0x7e')](path[_0x5685('0x78')](config['root'],_0x5685('0x80'),_0x387156[_0x5685('0x88')]))){_0x59cebe=path[_0x5685('0x78')](config[_0x5685('0x79')],_0x5685('0x80'),_0x387156['systemAvatar']);}}return _0x58eafb[_0x5685('0x85')](_0x59cebe);}})[_0x5685('0x2a')](handleError(_0x58eafb,null));};exports[_0x5685('0x89')]=function(_0x23f326,_0x4b2108,_0x155b92){var _0x429748=require(_0x5685('0x8a'));var _0x1e84bc=new _0x429748();var _0x5e76d2=_0x1e84bc[_0x5685('0x8b')](_0x23f326[_0x5685('0x8c')][_0x5685('0x8d')])[_0x5685('0x8e')]();var _0x23e5ab={'body':_0x23f326[_0x5685('0x5d')],'channel':_0x5685('0x8f')};var _0x55be9d=[];var _0x47af3a=[];var _0x53c1e2={};var _0x5c95be=![];return db[_0x5685('0x90')][_0x5685('0x91')]()[_0x5685('0x21')](function(_0x182a2e){if(!_0x182a2e){throw new db[(_0x5685('0x92'))][(_0x5685('0x93'))]('no\x20available\x20attributes');}_0x55be9d=_[_0x5685('0x94')](_[_0x5685('0x47')](_0x182a2e),['createdAt',_0x5685('0x95')]);_0x47af3a=_[_0x5685('0x94')](_[_0x5685('0x47')](_0x182a2e),[_0x5685('0x96'),_0x5685('0x95'),_0x5685('0x97'),_0x5685('0x98')]);if(_0x23f326[_0x5685('0x5d')]['id']){delete _0x23f326[_0x5685('0x5d')]['id'];}if(_['isNil'](_0x23f326['body'][_0x5685('0x99')])){throw new db['Sequelize'][(_0x5685('0x93'))](_0x5685('0x9a'));}if(_['isNil'](_0x23f326[_0x5685('0x5d')]['body'])||_0x23f326[_0x5685('0x5d')][_0x5685('0x5d')]===''){throw new db[(_0x5685('0x92'))][(_0x5685('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5685('0x7d')](_0x23f326[_0x5685('0x5d')][_0x5685('0x9b')])){throw new db[(_0x5685('0x92'))][(_0x5685('0x93'))](_0x5685('0x9c')+_0x47af3a);}if(!_[_0x5685('0x9d')](_0x47af3a,_0x23f326['body'][_0x5685('0x9b')])){throw new db['Sequelize'][(_0x5685('0x93'))](_0x5685('0x9e')+_0x47af3a);}_0x53c1e2[_0x23f326['body'][_0x5685('0x9b')]]=_0x23f326[_0x5685('0x5d')][_0x5685('0x99')];})[_0x5685('0x21')](function(){return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x23f326['params']['id']},'include':[{'model':db[_0x5685('0x9f')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x53c1e2,'limit':0x1,'order':[[_0x5685('0x95'),_0x5685('0xa0')]]}]},{'model':db['ChatApplication'],'as':_0x5685('0xa1')}]});})[_0x5685('0x21')](handleEntityNotFound(_0x4b2108,null))[_0x5685('0x21')](function(_0x103904){if(_0x103904&&_0x103904[_0x5685('0xa2')]){_0x23e5ab[_0x5685('0xa3')]=_0x103904;_0x23e5ab['applications']=_0x103904[_0x5685('0xa1')];_0x23e5ab[_0x5685('0xa4')]=_0x103904[_0x5685('0xa2')];_0x23e5ab[_0x5685('0xa5')]=_[_0x5685('0xa6')](_0x23e5ab[_0x5685('0xa5')],[_0x5685('0xa7')],[_0x5685('0xa8')]);if(_0x23e5ab['account'][_0x5685('0xa1')]){delete _0x23e5ab[_0x5685('0xa3')]['Applications'];}if(_0x23e5ab[_0x5685('0xa3')][_0x5685('0xa2')]&&_0x23e5ab[_0x5685('0xa3')][_0x5685('0xa2')][_0x5685('0xa9')][_0x5685('0x4b')]){return _0x23e5ab['account']['List'][_0x5685('0xa9')][0x0];}var _0x33f988=_['defaults'](_0x23f326[_0x5685('0x5d')],{'firstName':_0x23f326[_0x5685('0x5d')]['from'],'ListId':_0x103904[_0x5685('0x98')]});_0x33f988[_0x23f326[_0x5685('0x5d')]['mapKey']]=_0x23f326[_0x5685('0x5d')][_0x5685('0x99')];return db[_0x5685('0x90')][_0x5685('0x5c')](_0x33f988,{'fields':_0x55be9d,'raw':!![]});}})[_0x5685('0x21')](handleEntityNotFound(_0x4b2108,null))[_0x5685('0x21')](function(_0x24975b){_0x23e5ab['contact']=_0x24975b;var _0x303b77=_0x23f326[_0x5685('0x5d')][_0x5685('0xaa')];if(_0x23f326['headers'][_0x5685('0xab')]){_0x303b77=_0x23f326[_0x5685('0x8c')][_0x5685('0xab')];}else if(_0x23f326['headers'][_0x5685('0xac')]){_0x303b77=_[_0x5685('0xad')](_0x23f326[_0x5685('0x8c')][_0x5685('0xac')][_0x5685('0xae')](','));}if(_0x24975b){var _0x2e316b={'ContactId':_0x24975b['id'],'ChatWebsiteId':_0x23f326[_0x5685('0x5a')]['id'],'from':(_0x24975b[_0x5685('0xaf')]||'')+'\x20'+(_0x24975b['lastName']||''),'customerIp':_0x303b77,'customerPort':_0x23f326[_0x5685('0x8c')][_0x5685('0xb0')]?_0x23f326[_0x5685('0x8c')][_0x5685('0xb0')]:null,'referer':_0x23f326[_0x5685('0x5d')][_0x5685('0xb1')],'browserName':_0x5e76d2[_0x5685('0xb2')]['name']&&_0x5e76d2[_0x5685('0xb2')][_0x5685('0xb3')]?util['format']('%s\x20%s',_0x5e76d2[_0x5685('0xb2')][_0x5685('0x3b')],_0x5e76d2[_0x5685('0xb2')][_0x5685('0xb3')]):_0x5685('0xb4'),'browserVersion':_0x5e76d2['browser'][_0x5685('0xb3')]||_0x5685('0xb4'),'osName':util[_0x5685('0xb5')](_0x5685('0xb6'),_0x5e76d2['os'][_0x5685('0x3b')],_0x5e76d2['os']['version']),'osVersion':_0x5e76d2['os'][_0x5685('0xb3')],'deviceModel':_0x5e76d2[_0x5685('0xb7')][_0x5685('0x45')]&&_0x5e76d2[_0x5685('0xb7')][_0x5685('0xb8')]?util[_0x5685('0xb5')]('%s\x20%s\x20%s',_0x5e76d2[_0x5685('0xb7')][_0x5685('0x45')],_0x5e76d2[_0x5685('0xb7')][_0x5685('0xb8')],_0x5e76d2[_0x5685('0xb7')][_0x5685('0x43')]):null,'deviceVendor':_0x5e76d2[_0x5685('0xb7')]['vendor'],'deviceType':_0x5e76d2[_0x5685('0xb7')][_0x5685('0x43')],'formData':JSON[_0x5685('0x25')](_0x23f326[_0x5685('0x5d')])};var _0x1122a8={'ChatWebsiteId':_0x23f326[_0x5685('0x5a')]['id'],'closed':![]};if(_0x23f326[_0x5685('0x5d')][_0x5685('0xb9')]){_0x1122a8['threadId']=_0x23f326[_0x5685('0x5d')][_0x5685('0xb9')];return db[_0x5685('0xba')]['find']({'where':_0x1122a8})['then'](function(_0x78cb58){if(_0x78cb58){return[_0x78cb58,![]];}_0x2e316b[_0x5685('0xb9')]=_0x23f326['body'][_0x5685('0xb9')];_0x2e316b['externalUrl']=_0x23f326['body']['externalUrl'];return db[_0x5685('0xba')][_0x5685('0x5c')](_0x2e316b)['then'](function(_0x24ae5d){return[_0x24ae5d,!![]];});});}_0x1122a8[_0x5685('0xbb')]=_0x24975b['id'];if(_0x23f326[_0x5685('0x5d')]['interaction']&&_0x23f326[_0x5685('0x5d')][_0x5685('0xbc')]['id']){_0x1122a8['id']=_0x23f326[_0x5685('0x5d')][_0x5685('0xbc')]['id'];return db[_0x5685('0xba')][_0x5685('0x5b')]({'where':_0x1122a8})[_0x5685('0x21')](function(_0x3a1698){if(_0x3a1698){return[_0x3a1698,![]];}return db['ChatInteraction'][_0x5685('0x5c')](_0x2e316b)['then'](function(_0x37c8ac){return[_0x37c8ac,!![]];});});}return db[_0x5685('0xba')][_0x5685('0x5c')](_0x2e316b)[_0x5685('0x21')](function(_0x1ee322){return[_0x1ee322,!![]];});}})['spread'](function(_0x343257,_0x482ca1){if(_0x343257){_0x5c95be=_0x482ca1;if(!_0x482ca1){var _0x19c76b={'from':(_0x23e5ab['contact'][_0x5685('0xaf')]||'')+'\x20'+(_0x23e5ab[_0x5685('0xbd')][_0x5685('0xbe')]||'')};if(_0x23f326['body']['threadId']&&_0x23f326[_0x5685('0x5d')][_0x5685('0xbf')]&&_0x23f326[_0x5685('0x5d')][_0x5685('0xb9')]!=_0x23f326[_0x5685('0x5d')][_0x5685('0xbf')]){_0x19c76b[_0x5685('0xb9')]=_0x23f326[_0x5685('0x5d')][_0x5685('0xbf')];}return _0x343257[_0x5685('0x36')](_0x19c76b);}else{return _0x343257;}}})[_0x5685('0x21')](function(_0x2f5432){_0x23e5ab[_0x5685('0xbc')]=_0x2f5432[_0x5685('0x37')]({'plain':!![]});_0x23e5ab['interaction'][_0x5685('0xc0')]=_0x5c95be;if(_0x23e5ab[_0x5685('0xbc')]['created']){if(_0x23e5ab[_0x5685('0xa3')][_0x5685('0xc1')]){_0x23e5ab['applications']['push']({'id':0x0,'priority':_0x23e5ab[_0x5685('0xa5')][_0x5685('0x4b')]+0x1,'app':_0x5685('0xc2'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x5685('0xc3')][_0x5685('0x5c')]({'body':_0x23f326[_0x5685('0x5d')][_0x5685('0x5d')],'ChatWebsiteId':_0x23f326['params']['id'],'ChatInteractionId':_0x2f5432['id'],'direction':'in','ContactId':_0x23e5ab[_0x5685('0xbd')]['id'],'AttachmentId':_0x23f326['body'][_0x5685('0xc4')]});})['then'](function(_0x10af69){_0x23e5ab[_0x5685('0x28')]=_0x10af69;if(_0x23e5ab[_0x5685('0xbc')][_0x5685('0xc5')]){return db[_0x5685('0xc6')][_0x5685('0x5b')]({'attributes':['id',_0x5685('0x3b')],'where':{'id':_0x23e5ab[_0x5685('0xbc')][_0x5685('0xc5')]}})['then'](function(_0x24926b){if(_0x24926b){_0x23e5ab[_0x5685('0xa5')][_0x5685('0xc7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x24926b[_0x5685('0x3b')]+','+(_0x23e5ab['account'][_0x5685('0xc8')]||0xa),'interval':_0x5685('0xc9')});_0x23e5ab['forcedOwnership']=!![];}return respondWithRpcPromise(_0x5685('0xca'),_0x5685('0xcb'),_0x23e5ab);});}return respondWithRpcPromise(_0x5685('0xca'),'startRouting',_0x23e5ab);})['then'](function(_0x51c2aa){respondWithRpcPromise(_0x5685('0xcc'),_0x5685('0xcc'),{'event':_0x5685('0x89'),'message':_0x51c2aa},client9002);return _0x51c2aa;})[_0x5685('0x21')](respondWithResult(_0x4b2108,null))[_0x5685('0x2a')](handleError(_0x4b2108,null));};exports[_0x5685('0xcd')]=function(_0x3882a3,_0x585f03,_0x7fbc){var _0x2ef173,_0x114fe8,_0x388002;var _0x574e67=[];var _0x112295=[];var _0x313ccc={};var _0x18b84b=_0x3882a3['files']||[];var _0xe1ce9e=[];var _0x17d589;return db[_0x5685('0x90')]['describe']()[_0x5685('0x21')](function(_0x48500a){if(!_0x48500a){throw new db[(_0x5685('0x92'))][(_0x5685('0x93'))](_0x5685('0xce'));}_0x112295=_[_0x5685('0x94')](_[_0x5685('0x47')](_0x48500a),[_0x5685('0x96'),_0x5685('0x95')]);_0x574e67=_[_0x5685('0x94')](_[_0x5685('0x47')](_0x48500a),['createdAt','updatedAt',_0x5685('0x97'),'ListId']);if(_0x3882a3[_0x5685('0x5d')]['id']){delete _0x3882a3[_0x5685('0x5d')]['id'];}if(_[_0x5685('0x7d')](_0x3882a3[_0x5685('0x5d')][_0x5685('0x99')])){throw _0x585f03[_0x5685('0x2c')](0x1f4)[_0x5685('0x3c')](new db[(_0x5685('0x92'))]['ValidationError'](_0x5685('0x9a')));}if(_['isNil'](_0x3882a3[_0x5685('0x5d')][_0x5685('0x5d')])||_0x3882a3[_0x5685('0x5d')][_0x5685('0x5d')]===''){throw _0x585f03[_0x5685('0x2c')](0x1f4)['send'](new db[(_0x5685('0x92'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x3882a3[_0x5685('0x5d')]['mapKeyOffline'])){throw _0x585f03[_0x5685('0x2c')](0x1f4)[_0x5685('0x3c')](new db[(_0x5685('0x92'))]['ValidationError'](_0x5685('0xcf')+_0x574e67));}if(!_[_0x5685('0x9d')](_0x574e67,_0x3882a3[_0x5685('0x5d')]['mapKeyOffline'])){throw _0x585f03[_0x5685('0x2c')](0x1f4)[_0x5685('0x3c')](new db[(_0x5685('0x92'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x574e67));}_0x313ccc[_0x3882a3[_0x5685('0x5d')][_0x5685('0xd0')]]=_0x3882a3[_0x5685('0x5d')][_0x5685('0x99')];})[_0x5685('0x21')](function(){return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x3882a3[_0x5685('0x5a')]['id']},'include':[{'model':db[_0x5685('0x9f')],'as':_0x5685('0xa2')},{'model':db['MailAccount'],'as':_0x5685('0xd1')}]});})['then'](handleEntityNotFound(_0x585f03,null))[_0x5685('0x21')](function(_0x154af4){if(_0x154af4&&_0x154af4['List']){_0x114fe8=_0x154af4;var _0x356572=_[_0x5685('0x19')](_0x3882a3[_0x5685('0x5d')],{'firstName':_0x3882a3[_0x5685('0x5d')][_0x5685('0x99')],'phone':_0x3882a3['body'][_0x5685('0x99')],'ListId':_0x154af4['ListId']});_0x356572[_0x3882a3[_0x5685('0x5d')][_0x5685('0xd0')]]=_0x3882a3[_0x5685('0x5d')]['from'];return db[_0x5685('0x90')]['findOrCreate']({'where':_0x313ccc,'defaults':_0x356572});}})[_0x5685('0xd2')](function(_0x42df58){if(_0x42df58){_0x388002=_0x42df58;var _0xaa3549=fs[_0x5685('0xd3')](path[_0x5685('0x78')](config[_0x5685('0x79')],_0x5685('0xd4')),'utf8');var _0x18ffbc=ejs['render'](_0xaa3549,{'body':_[_0x5685('0xd5')](_0x3882a3[_0x5685('0x5d')][_0x5685('0x5d')]),'bodyTitle':_0x114fe8[_0x5685('0xd6')]});return db[_0x5685('0xd7')][_0x5685('0x5c')]({'body':_0x18ffbc,'ContactId':_0x42df58['id'],'ChatWebsiteId':_0x114fe8['id']});}})[_0x5685('0x21')](function(_0x565922){_0x17d589=_0x565922;if(_0x18b84b[_0x5685('0x4b')]){var _0x26bee9=_0x18b84b['map'](function(_0x2c1a6b){return{'name':_0x2c1a6b[_0x5685('0xd8')],'basename':_0x2c1a6b[_0x5685('0x73')],'type':_0x2c1a6b['mimetype'],'ChatOfflineMessageId':_0x565922['id']};});_0xe1ce9e=_0x26bee9[_0x5685('0x40')](_0x39e1c9=>{var _0x1f48d0={'filename':_0x39e1c9['name'],'path':path['join'](config[_0x5685('0x79')],_0x5685('0xd9'),_0x5685('0xda'),_0x5685('0xdb'),_0x5685('0xdc'),_0x39e1c9[_0x5685('0xdd')])};return _0x1f48d0;});if(!_0x114fe8['openNewInteraction']){return db['sequelize'][_0x5685('0xde')](function(_0x462856){return db[_0x5685('0xdf')][_0x5685('0xe0')](_0x26bee9,{'transaction':_0x462856});});}}})[_0x5685('0x21')](function(){if(_0x17d589){_0x2ef173=_0x17d589;return db[_0x5685('0xd1')][_0x5685('0x6d')]({'where':{'active':!![]},'include':[{'model':db[_0x5685('0xe1')],'as':_0x5685('0xe2'),'raw':!![]}]});}})['then'](function(_0x26d9a6){if(_0x26d9a6&&_0x26d9a6[_0x5685('0xe2')]&&_0x114fe8['forwardOffline']&&_0x114fe8['forwardOfflineAddress']){var _0xb3809b={'tls':{'rejectUnauthorized':![]}};if(_0x26d9a6[_0x5685('0xe2')]['service']){_0xb3809b[_0x5685('0xe3')]=_0x26d9a6[_0x5685('0xe2')][_0x5685('0xe3')];}else{_0xb3809b[_0x5685('0xe4')]=_0x26d9a6[_0x5685('0xe2')][_0x5685('0xe4')];_0xb3809b[_0x5685('0xe5')]=_0x26d9a6['Smtp']['port'];_0xb3809b[_0x5685('0xe6')]=_0x26d9a6[_0x5685('0xe2')][_0x5685('0xe6')];}if(_0x26d9a6[_0x5685('0xe2')][_0x5685('0xe7')]){_0xb3809b['auth']={'user':_0x26d9a6[_0x5685('0xe2')][_0x5685('0x5e')],'pass':_0x26d9a6[_0x5685('0xe2')][_0x5685('0xe8')]};}return respondWithRpcPromise(_0x5685('0xe9'),_0x5685('0xea'),{'account':_0xb3809b,'message':{'from':util[_0x5685('0xb5')]('\x22%s\x22\x20<%s>',_0x26d9a6['name'],_0x26d9a6['email']||_0x26d9a6[_0x5685('0xe2')][_0x5685('0x5e')]),'to':_0x114fe8['forwardOfflineAddress'],'subject':_0x114fe8['offlineMessageSubject'],'html':_0x2ef173[_0x5685('0x5d')],'attachments':_0xe1ce9e}},client9003)[_0x5685('0x21')](function(){return _0x2ef173;})[_0x5685('0x2a')](function(_0xcce31a){console[_0x5685('0x26')](_0xcce31a);});}})[_0x5685('0x21')](function(){if(_0x114fe8&&_0x114fe8[_0x5685('0xeb')]&&_0x114fe8[_0x5685('0xec')]){var _0x388854=[];if(_0x18b84b[_0x5685('0x4b')]){_0x388854=_0x18b84b[_0x5685('0x40')](function(_0x934d57){return{'name':_0x934d57['originalname'],'basename':_0x934d57[_0x5685('0x73')],'type':_0x934d57[_0x5685('0xed')],'ChatOfflineMessageId':_0x17d589['id']};});}var _0x54c28f;if(!_[_0x5685('0x7d')](_0x114fe8['subjectOffline'])){var _0x36f784=_['map'](_0x3882a3['body'],function(_0x411614){return _0x411614;});var _0x374a61=_[_0x5685('0xee')](_0x36f784)[0x0];var _0x27205a=_[_0x5685('0xef')](_0x374a61,function(_0x53f9f7){return _0x53f9f7;});_0x54c28f=_0x27205a[0x1][_0x114fe8[_0x5685('0xf0')]];}var _0x48e79c={'from':_0x388002[_0x5685('0xf1')],'firstName':_0x388002[_0x5685('0xaf')],'lastName':_0x388002[_0x5685('0xbe')],'mapKey':_0x5685('0xf1'),'message':{'from':_0x388002[_0x5685('0xf1')],'to':_0x114fe8[_0x5685('0xd1')][_0x5685('0xf1')],'cc':'','subject':_[_0x5685('0x7d')](_0x54c28f)?_0x114fe8[_0x5685('0xf2')]:_0x54c28f,'messageId':'','sentAt':new Date(),'attach':_0x388854['length'],'attachments':_0x388854,'originChannel':_0x5685('0xf3'),'ChatWebsiteId':_0x114fe8['id'],'ChatOfflineMessageId':_0x2ef173['id'],'originTo':_0x114fe8[_0x5685('0xd1')]['email']},'body':_0x2ef173[_0x5685('0x5d')]};var _0x35b1dd={'account':{'id':_0x114fe8[_0x5685('0xec')]},'body':_0x48e79c,'log':_0x5685('0xf4')};return respondWithRpcPromise(_0x5685('0xf4'),_0x5685('0xf5'),_0x35b1dd,client9001)[_0x5685('0x21')](function(){return _0x2ef173;})[_0x5685('0x2a')](function(_0x7672e2){console['error'](_0x7672e2);});}return;})[_0x5685('0x21')](function(){if(_0x2ef173){return _0x2ef173;}})['then'](respondWithResult(_0x585f03,null))[_0x5685('0x2a')](function(_0x48da48){console[_0x5685('0x26')](_0x5685('0x2a'),_0x48da48);for(var _0x482ea7 of _0x18b84b){var _0x194022=path[_0x5685('0x78')](config[_0x5685('0x79')],_0x5685('0xd9'),_0x5685('0xda'),_0x5685('0xdb'),_0x5685('0xdc'),_0x482ea7[_0x5685('0x73')]);fs_extra[_0x5685('0xf6')](_0x194022)['catch'](function(_0x3de726){console[_0x5685('0x26')]('Could\x20not\x20remove\x20attachment\x20file',_0x194022,_0x3de726);});}});};exports[_0x5685('0xf7')]=function(_0x1256e1,_0x1dcc02,_0x38c032){return db[_0x5685('0xba')][_0x5685('0x5b')]({'where':{'id':_0x1256e1[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x1dcc02,null))['then'](function(_0x426e73){if(_0x426e73){return _0x426e73[_0x5685('0xf7')](_0x1256e1[_0x5685('0x5d')][_0x5685('0x70')],_[_0x5685('0xf8')](_0x1256e1[_0x5685('0x5d')],[_0x5685('0x70'),'id'])||{});}})[_0x5685('0x21')](respondWithResult(_0x1dcc02,null))['catch'](handleError(_0x1dcc02,null));};exports[_0x5685('0xf9')]=function(_0x877d21,_0x3ac4fc,_0x1c5264){var _0x5150be={'raw':![],'where':{}};var _0x2c3d78={};var _0x57c64c={'count':0x0,'rows':[]};return db[_0x5685('0x56')][_0x5685('0x6d')]({'where':{'id':_0x877d21[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x3ac4fc,null))[_0x5685('0x21')](function(_0x5e5031){if(_0x5e5031){_0x2c3d78['model']=_[_0x5685('0x47')](db[_0x5685('0xba')][_0x5685('0x41')]);_0x2c3d78[_0x5685('0x46')]=_['keys'](_0x877d21[_0x5685('0x46')]);_0x2c3d78['filters']=_[_0x5685('0x48')](_0x2c3d78[_0x5685('0x45')],_0x2c3d78[_0x5685('0x46')]);_0x5150be[_0x5685('0x49')]=_[_0x5685('0x48')](_0x2c3d78[_0x5685('0x45')],qs[_0x5685('0x4a')](_0x877d21[_0x5685('0x46')][_0x5685('0x4a')]));_0x5150be[_0x5685('0x49')]=_0x5150be[_0x5685('0x49')][_0x5685('0x4b')]?_0x5150be[_0x5685('0x49')]:_0x2c3d78[_0x5685('0x45')];if(!_0x877d21[_0x5685('0x46')][_0x5685('0x4c')](_0x5685('0x66'))){_0x5150be[_0x5685('0x32')]=qs[_0x5685('0x32')](_0x877d21[_0x5685('0x46')][_0x5685('0x32')]);_0x5150be[_0x5685('0x2f')]=qs[_0x5685('0x2f')](_0x877d21[_0x5685('0x46')][_0x5685('0x2f')]);}_0x5150be[_0x5685('0x4d')]=qs[_0x5685('0x4e')](_0x877d21[_0x5685('0x46')][_0x5685('0x4e')]);_0x5150be['where']=qs['filters'](_[_0x5685('0x50')](_0x877d21[_0x5685('0x46')],_0x2c3d78[_0x5685('0x4f')]));_0x5150be[_0x5685('0x52')][_0x5685('0x67')]=_0x5e5031['id'];if(_0x877d21[_0x5685('0x46')][_0x5685('0x51')]){_0x5150be[_0x5685('0x52')]=_[_0x5685('0x53')](_0x5150be[_0x5685('0x52')],{'$or':_[_0x5685('0x40')](_0x5150be[_0x5685('0x49')],function(_0x30e36b){var _0x4fdb94={};_0x4fdb94[_0x30e36b]={'$like':'%'+_0x877d21[_0x5685('0x46')][_0x5685('0x51')]+'%'};return _0x4fdb94;})});}_0x5150be=_['merge']({},_0x5150be,_0x877d21[_0x5685('0x55')]);return db[_0x5685('0xba')][_0x5685('0x31')]({'where':_0x5150be[_0x5685('0x52')]})[_0x5685('0x21')](function(_0x2ac030){_0x57c64c[_0x5685('0x31')]=_0x2ac030;if(_0x877d21[_0x5685('0x46')][_0x5685('0x57')]){_0x5150be[_0x5685('0x58')]=[{'model':db[_0x5685('0x90')],'as':_0x5685('0xfa'),'required':![]},{'model':db[_0x5685('0xc6')],'as':_0x5685('0xfb'),'attributes':[_0x5685('0x3b'),_0x5685('0xfc'),_0x5685('0xfd')],'required':![]},{'model':db[_0x5685('0xfe')],'as':'Tags','attributes':['id',_0x5685('0x3b'),'color'],'where':_0x877d21[_0x5685('0x46')][_0x5685('0xff')]?{'id':_0x877d21[_0x5685('0x46')]['tag']}:undefined,'required':_0x877d21[_0x5685('0x46')][_0x5685('0xff')]?!![]:![]}];}return db[_0x5685('0xba')][_0x5685('0x69')](_0x5150be);})[_0x5685('0x21')](function(_0x595a45){_0x57c64c[_0x5685('0x59')]=_0x595a45;return _0x57c64c;});}})[_0x5685('0x21')](respondWithFilteredResult(_0x3ac4fc,_0x5150be))[_0x5685('0x2a')](handleError(_0x3ac4fc,null));};function iftimePromise(_0xb45167,_0x37a962){return respondWithRpcPromise(_0x5685('0x100'),'getSnippet',{'command':_0x37a962['timezone']?util[_0x5685('0xb5')](_0x5685('0x101'),_0xb45167[_0x5685('0x102')],_0x37a962['timezone']):util[_0x5685('0xb5')]('iftime\x20%s',_0xb45167[_0x5685('0x102')])},client9002)[_0x5685('0x21')](function(_0x29d8be){var _0x4e737f=_0x29d8be&&_0x29d8be[_0x5685('0x103')](_0x5685('0x104'))>=0x0?!![]:![];logger[_0x5685('0x22')](_0x5685('0x105'),_0x37a962['id'],_0xb45167['id'],_0xb45167[_0x5685('0x102')],_0x4e737f?_0x5685('0x106'):'OFFLINE',_0x37a962[_0x5685('0x107')]?_0x37a962[_0x5685('0x107')]:'No\x20timezone');return _0x4e737f;})[_0x5685('0x2a')](function(_0x5f188d){logger[_0x5685('0x26')](_0x5685('0x105'),_0x37a962['id'],_0xb45167['id'],_0xb45167[_0x5685('0x102')],util['inspect'](_0x5f188d,{'showHidden':![],'depth':null}),_0x37a962[_0x5685('0x107')]?_0x37a962[_0x5685('0x107')]:_0x5685('0x108'));return![];});}exports[_0x5685('0x109')]=function(_0xb00ad3,_0x794911,_0x1f79a7){var _0x577464=0x0;var _0x2841d1=0x0;var _0x130e19=![];var _0x5cbc21;var _0x4139cc;return db[_0x5685('0x56')]['find']({'where':{'id':_0xb00ad3[_0x5685('0x5a')]['id']},'include':[{'model':db['Interval'],'as':_0x5685('0x10a'),'include':[{'model':db[_0x5685('0x10a')],'as':_0x5685('0x10b'),'attributes':['id',_0x5685('0x102')],'raw':!![]}]}]})[_0x5685('0x21')](handleEntityNotFound(_0x794911,null))[_0x5685('0x21')](function(_0xe19a02){if(_0xe19a02){_0x5cbc21=_0xe19a02;return _0xe19a02['getProactiveActions']({'raw':!![]});}})[_0x5685('0x21')](function(_0x18ec62){if(_0x5cbc21){if(_0x18ec62){_0x4139cc=_0x18ec62;}}return require(_0x5685('0x16'))['getLicense']();})[_0x5685('0x21')](function(_0x15d270){if(_0x15d270){_0x2841d1=_0x15d270[_0x5685('0x10c')];_0x130e19=_0x15d270[_0x5685('0x10d')];}})['then'](function(){return db[_0x5685('0xba')][_0x5685('0x31')]({'where':{'closed':![]}});})[_0x5685('0x21')](function(_0x1218c6){_0x577464=_0x1218c6;if(_0x2841d1&&_0x1218c6>_0x2841d1){return db[_0x5685('0x10e')][_0x5685('0x6d')]({'where':{'id':0x1}})[_0x5685('0x21')](function(_0x5eba6d){if(_0x5eba6d){_0x5eba6d[_0x5685('0x10f')]('chatLicenseExceeded');}});}})['then'](function(){if(_0x5cbc21[_0x5685('0x10a')]&&_0x5cbc21['Interval'][_0x5685('0x10b')]){var _0x1210e7=[];for(var _0x580545=0x0;_0x580545<_0x5cbc21['Interval'][_0x5685('0x10b')][_0x5685('0x4b')];_0x580545++){var _0x484ae8=_0x5cbc21[_0x5685('0x10a')][_0x5685('0x10b')][_0x580545][_0x5685('0x37')]({'plain':!![]});_0x1210e7[_0x5685('0x110')](iftimePromise(_0x484ae8,_0x5cbc21));}return BPromise[_0x5685('0x111')](_0x1210e7)[_0x5685('0x21')](function(_0x2d612){return _[_0x5685('0x112')](_0x2d612);});}else{return!![];}})[_0x5685('0x21')](function(_0x470548){var _0x2c3db4=fs[_0x5685('0xd3')](path[_0x5685('0x78')](config[_0x5685('0x79')],'server/files/chat/iframe.ejs'),_0x5685('0x113'));var _0x59facf={'remote':_0x5cbc21[_0x5685('0x114')],'query':querystring['stringify'](_['merge'](_0x5cbc21[_0x5685('0x37')]({'plain':!![]}),{'customerIp':_0xb00ad3[_0x5685('0x8c')]['x-forwarded-for']||_0xb00ad3[_0x5685('0x8c')][_0x5685('0x115')]||_0xb00ad3['connection'][_0x5685('0x116')]||_0xb00ad3['ip'],'referer':_0xb00ad3[_0x5685('0x8c')][_0x5685('0xb1')],'openedInteractions':_0x577464,'maxInteractions':_0x2841d1,'virtual':_0x130e19[_0x5685('0x10c')],'online':_0x470548,'custom':_0x130e19}))[_0x5685('0x117')](/'/g,'\x5c\x27')};_0x794911[_0x5685('0x3c')](ejs['render'](Mustache['render'](_0x2c3db4,_0x59facf),{'proactiveActions':_0x4139cc,'alignment':_0x5cbc21[_0x5685('0x118')],'verticalAlignment':_0x5cbc21[_0x5685('0x119')],'div_color':_0x5cbc21['color'],'text_color':_0x5cbc21[_0x5685('0x11a')],'button_color':_0x5cbc21['color_button'],'background_color':_0x5cbc21[_0x5685('0x11b')]}));})['catch'](handleError(_0x794911,null));};exports[_0x5685('0x11c')]=function(_0x1f1a66,_0x4471e3,_0x40e48f){return db['ChatWebsite'][_0x5685('0x6d')]({'where':{'id':_0x1f1a66[_0x5685('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4471e3,null))[_0x5685('0x21')](function(_0x3c83f2){if(_0x3c83f2){return db[_0x5685('0x11d')]['transaction'](function(_0x463389){return db[_0x5685('0x11e')][_0x5685('0x39')]({'where':{'ChatWebsiteId':_0x1f1a66['params']['id']},'transaction':_0x463389})['then'](function(_0x17e61b){var _0x27e619=_['map'](_0x1f1a66['body'],function(_0x42c0c9){_0x42c0c9[_0x5685('0x67')]=_0x1f1a66[_0x5685('0x5a')]['id'];return _0x42c0c9;});return db[_0x5685('0x11e')]['bulkCreate'](_0x27e619,{'transaction':_0x463389});});})[_0x5685('0x21')](function(){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x1f1a66[_0x5685('0x5a')]['id']},'order':_0x5685('0xa7')});});}})[_0x5685('0x21')](respondWithResult(_0x4471e3,null))[_0x5685('0x2a')](handleError(_0x4471e3,null));};exports[_0x5685('0x11f')]=function(_0x58f3cc,_0x543e09,_0x2c367a){var _0x3fc531={};var _0x442605={};var _0x397b27;var _0xa10b6;return db[_0x5685('0x56')][_0x5685('0x6d')]({'where':{'id':_0x58f3cc['params']['id']}})['then'](handleEntityNotFound(_0x543e09,null))[_0x5685('0x21')](function(_0x347532){if(_0x347532){_0x397b27=_0x347532;_0x442605[_0x5685('0x45')]=_[_0x5685('0x47')](db[_0x5685('0x11e')]['rawAttributes']);_0x442605[_0x5685('0x46')]=_['keys'](_0x58f3cc[_0x5685('0x46')]);_0x442605[_0x5685('0x4f')]=_[_0x5685('0x48')](_0x442605[_0x5685('0x45')],_0x442605['query']);_0x3fc531[_0x5685('0x49')]=_['intersection'](_0x442605[_0x5685('0x45')],qs[_0x5685('0x4a')](_0x58f3cc[_0x5685('0x46')]['fields']));_0x3fc531['attributes']=_0x3fc531['attributes'][_0x5685('0x4b')]?_0x3fc531['attributes']:_0x442605[_0x5685('0x45')];_0x3fc531['order']=qs[_0x5685('0x4e')](_0x58f3cc[_0x5685('0x46')][_0x5685('0x4e')]);_0x3fc531['where']=qs[_0x5685('0x4f')](_[_0x5685('0x50')](_0x58f3cc[_0x5685('0x46')],_0x442605[_0x5685('0x4f')]));if(_0x58f3cc[_0x5685('0x46')][_0x5685('0x51')]){_0x3fc531[_0x5685('0x52')]=_[_0x5685('0x53')](_0x3fc531[_0x5685('0x52')],{'$or':_[_0x5685('0x40')](_0x3fc531[_0x5685('0x49')],function(_0x8ecb13){var _0x1aae72={};_0x1aae72[_0x8ecb13]={'$like':'%'+_0x58f3cc[_0x5685('0x46')][_0x5685('0x51')]+'%'};return _0x1aae72;})});}_0x3fc531=_[_0x5685('0x53')]({},_0x3fc531,_0x58f3cc[_0x5685('0x55')]);return _0x397b27[_0x5685('0x11f')](_0x3fc531);}})['then'](function(_0x3b0f09){if(_0x3b0f09){_0xa10b6=_0x3b0f09[_0x5685('0x4b')];if(!_0x58f3cc[_0x5685('0x46')]['hasOwnProperty'](_0x5685('0x66'))){_0x3fc531[_0x5685('0x32')]=qs[_0x5685('0x32')](_0x58f3cc['query']['limit']);_0x3fc531['offset']=qs['offset'](_0x58f3cc['query']['offset']);}return _0x397b27[_0x5685('0x11f')](_0x3fc531);}})['then'](function(_0x421909){if(_0x421909){return _0x421909?{'count':_0xa10b6,'rows':_0x421909}:null;}})[_0x5685('0x21')](respondWithResult(_0x543e09,null))[_0x5685('0x2a')](handleError(_0x543e09,null));};exports[_0x5685('0x120')]=function(_0x4c47a0,_0x5a97ba,_0x9a3cb7){return db[_0x5685('0x121')][_0x5685('0x5b')]({'where':{'id':_0x4c47a0[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x5a97ba,null))['then'](function(_0x295ad4){if(_0x295ad4){return _0x295ad4['addProactiveActions'](_0x4c47a0['body'][_0x5685('0x70')],_[_0x5685('0xf8')](_0x4c47a0[_0x5685('0x5d')],[_0x5685('0x70'),'id'])||{});}})[_0x5685('0x21')](respondWithResult(_0x5a97ba,null))['catch'](handleError(_0x5a97ba,null));};exports[_0x5685('0x122')]=function(_0x5d1d5b,_0x13c707,_0x178bf9){var _0xe2baa5={};var _0x209647={};var _0x212950;var _0x1546ce;return db[_0x5685('0x56')][_0x5685('0x6d')]({'where':{'id':_0x5d1d5b[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x13c707,null))['then'](function(_0x58309c){if(_0x58309c){_0x212950=_0x58309c;_0x209647[_0x5685('0x45')]=_[_0x5685('0x47')](db['ChatProactiveAction'][_0x5685('0x41')]);_0x209647[_0x5685('0x46')]=_[_0x5685('0x47')](_0x5d1d5b[_0x5685('0x46')]);_0x209647[_0x5685('0x4f')]=_[_0x5685('0x48')](_0x209647['model'],_0x209647[_0x5685('0x46')]);_0xe2baa5[_0x5685('0x49')]=_['intersection'](_0x209647[_0x5685('0x45')],qs[_0x5685('0x4a')](_0x5d1d5b[_0x5685('0x46')][_0x5685('0x4a')]));_0xe2baa5[_0x5685('0x49')]=_0xe2baa5[_0x5685('0x49')]['length']?_0xe2baa5[_0x5685('0x49')]:_0x209647[_0x5685('0x45')];_0xe2baa5[_0x5685('0x4d')]=qs[_0x5685('0x4e')](_0x5d1d5b['query'][_0x5685('0x4e')]);_0xe2baa5['where']=qs[_0x5685('0x4f')](_[_0x5685('0x50')](_0x5d1d5b[_0x5685('0x46')],_0x209647[_0x5685('0x4f')]));if(_0x5d1d5b[_0x5685('0x46')][_0x5685('0x51')]){_0xe2baa5[_0x5685('0x52')]=_[_0x5685('0x53')](_0xe2baa5[_0x5685('0x52')],{'$or':_[_0x5685('0x40')](_0xe2baa5['attributes'],function(_0x5a8ff4){var _0x39d766={};_0x39d766[_0x5a8ff4]={'$like':'%'+_0x5d1d5b[_0x5685('0x46')][_0x5685('0x51')]+'%'};return _0x39d766;})});}_0xe2baa5=_[_0x5685('0x53')]({},_0xe2baa5,_0x5d1d5b[_0x5685('0x55')]);return _0x212950[_0x5685('0x122')](_0xe2baa5);}})['then'](function(_0xa5c28e){if(_0xa5c28e){_0x1546ce=_0xa5c28e[_0x5685('0x4b')];if(!_0x5d1d5b[_0x5685('0x46')][_0x5685('0x4c')](_0x5685('0x66'))){_0xe2baa5[_0x5685('0x32')]=qs[_0x5685('0x32')](_0x5d1d5b[_0x5685('0x46')][_0x5685('0x32')]);_0xe2baa5[_0x5685('0x2f')]=qs[_0x5685('0x2f')](_0x5d1d5b['query'][_0x5685('0x2f')]);}return _0x212950[_0x5685('0x122')](_0xe2baa5);}})[_0x5685('0x21')](function(_0xcf7a48){if(_0xcf7a48){return _0xcf7a48?{'count':_0x1546ce,'rows':_0xcf7a48}:null;}})[_0x5685('0x21')](respondWithResult(_0x13c707,null))['catch'](handleError(_0x13c707,null));};exports[_0x5685('0x123')]=function(_0xf6b1dc,_0x52b585,_0x409a0e){var _0x5a1409=_0xf6b1dc['query'][_0x5685('0x124')]===_0x5685('0x125')?_0x5685('0x126'):_0x5685('0x127');return db[_0x5685('0x56')][_0x5685('0x5b')]({'attributes':['id',_0x5a1409],'where':{'id':_0xf6b1dc['params']['id']}})['then'](handleEntityNotFound(_0x52b585,null))[_0x5685('0x21')](function(_0x136432){if(_0x136432){var _0x19fe2a=_0x136432[_0x5a1409];var _0x44b250=_0x19fe2a&&_0x19fe2a[_0x5685('0x128')]?_0x19fe2a[_0x5685('0x128')]:[];_0x52b585[_0x5685('0x3c')]({'fromKey':_[_0x5685('0x7d')](_0x19fe2a[_0x5685('0x129')])?undefined:_0x19fe2a[_0x5685('0x129')],'count':_0x44b250[_0x5685('0x4b')],'rows':_0x44b250});}})[_0x5685('0x2a')](handleError(_0x52b585,null));};exports['getOfflineMessages']=function(_0x16bb1e,_0x7174b3,_0x373250){var _0x42e1a6={'raw':![],'where':{}};var _0x31579c={};var _0x5bae19={'count':0x0,'rows':[]};return db[_0x5685('0x56')]['findOne']({'where':{'id':_0x16bb1e['params']['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x7174b3,null))['then'](function(_0x19f549){if(_0x19f549){_0x31579c[_0x5685('0x45')]=_[_0x5685('0x47')](db[_0x5685('0xd7')][_0x5685('0x41')]);_0x31579c[_0x5685('0x46')]=_[_0x5685('0x47')](_0x16bb1e[_0x5685('0x46')]);_0x31579c[_0x5685('0x4f')]=_[_0x5685('0x48')](_0x31579c[_0x5685('0x45')],_0x31579c[_0x5685('0x46')]);_0x42e1a6[_0x5685('0x49')]=_[_0x5685('0x48')](_0x31579c[_0x5685('0x45')],qs[_0x5685('0x4a')](_0x16bb1e['query'][_0x5685('0x4a')]));_0x42e1a6[_0x5685('0x49')]=_0x42e1a6[_0x5685('0x49')][_0x5685('0x4b')]?_0x42e1a6['attributes']:_0x31579c[_0x5685('0x45')];if(!_0x16bb1e[_0x5685('0x46')]['hasOwnProperty'](_0x5685('0x66'))){_0x42e1a6[_0x5685('0x32')]=qs[_0x5685('0x32')](_0x16bb1e[_0x5685('0x46')][_0x5685('0x32')]);_0x42e1a6[_0x5685('0x2f')]=qs['offset'](_0x16bb1e[_0x5685('0x46')][_0x5685('0x2f')]);}_0x42e1a6[_0x5685('0x4d')]=qs[_0x5685('0x4e')](_0x16bb1e[_0x5685('0x46')]['sort']);_0x42e1a6[_0x5685('0x52')]=qs[_0x5685('0x4f')](_[_0x5685('0x50')](_0x16bb1e[_0x5685('0x46')],_0x31579c[_0x5685('0x4f')]));_0x42e1a6['where'][_0x5685('0x67')]=_0x19f549['id'];if(_0x16bb1e['query'][_0x5685('0x51')]){_0x42e1a6[_0x5685('0x52')]=_[_0x5685('0x53')](_0x42e1a6[_0x5685('0x52')],{'$or':_[_0x5685('0x40')](_0x42e1a6[_0x5685('0x49')],function(_0x53dc07){var _0x493a56={};_0x493a56[_0x53dc07]={'$like':'%'+_0x16bb1e[_0x5685('0x46')][_0x5685('0x51')]+'%'};return _0x493a56;})});}_0x42e1a6=_[_0x5685('0x53')]({},_0x42e1a6,_0x16bb1e[_0x5685('0x55')]);return db['ChatOfflineMessage'][_0x5685('0x31')]({'where':_0x42e1a6['where']})[_0x5685('0x21')](function(_0x5559ac){_0x5bae19[_0x5685('0x31')]=_0x5559ac;if(_0x16bb1e[_0x5685('0x46')]['includeAll']){_0x42e1a6['include']=[{'all':!![]}];}else{_0x42e1a6[_0x5685('0x58')]=[{'model':db['CmContact'],'as':_0x5685('0xfa'),'required':![]},{'model':db[_0x5685('0xdf')],'as':_0x5685('0x12a'),'required':![]}];}return db[_0x5685('0xd7')][_0x5685('0x69')](_0x42e1a6);})[_0x5685('0x21')](function(_0x4b5b1a){_0x5bae19[_0x5685('0x59')]=_0x4b5b1a;return _0x5bae19;});}})['then'](respondWithFilteredResult(_0x7174b3,_0x42e1a6))[_0x5685('0x2a')](handleError(_0x7174b3,null));};exports[_0x5685('0x12b')]=function(_0x2e2ba8,_0x19bb40,_0x1bd9e8){return db[_0x5685('0x56')]['find']({'where':{'id':_0x2e2ba8[_0x5685('0x5a')]['id']}})['then'](handleEntityNotFound(_0x19bb40,null))['then'](function(_0x74e48d){if(_0x74e48d){return _0x74e48d[_0x5685('0x12b')](_0x2e2ba8[_0x5685('0x5d')]['ids'],_[_0x5685('0xf8')](_0x2e2ba8[_0x5685('0x5d')],[_0x5685('0x70'),'id'])||{})[_0x5685('0xd2')](function(_0x41a852){for(var _0x48c1b1=0x0;_0x48c1b1<_0x2e2ba8[_0x5685('0x5d')][_0x5685('0x70')]['length'];_0x48c1b1+=0x1){socket[_0x5685('0x12c')]('userChatWebsite:save',{'UserId':Number(_0x2e2ba8['body'][_0x5685('0x70')][_0x48c1b1]),'ChatWebsiteId':Number(_0x2e2ba8[_0x5685('0x5a')]['id'])});}return _0x41a852;});}})[_0x5685('0x21')](respondWithResult(_0x19bb40,null))[_0x5685('0x2a')](handleError(_0x19bb40,null));};exports[_0x5685('0x12d')]=function(_0x525bb9,_0x30d950,_0x3c6be0){return db[_0x5685('0x56')]['find']({'where':{'id':_0x525bb9['params']['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x30d950,null))[_0x5685('0x21')](function(_0x5b6c2c){if(_0x5b6c2c){return _0x5b6c2c[_0x5685('0x12d')](_0x525bb9['query'][_0x5685('0x70')])['then'](function(){if(_[_0x5685('0x12e')](_0x525bb9[_0x5685('0x46')][_0x5685('0x70')])){for(var _0x2e0fc2=0x0;_0x2e0fc2<_0x525bb9[_0x5685('0x46')][_0x5685('0x70')][_0x5685('0x4b')];_0x2e0fc2+=0x1){socket[_0x5685('0x12c')]('userChatWebsite:remove',{'UserId':Number(_0x525bb9[_0x5685('0x46')][_0x5685('0x70')][_0x2e0fc2]),'ChatWebsiteId':Number(_0x525bb9[_0x5685('0x5a')]['id'])});}}else{socket[_0x5685('0x12c')](_0x5685('0x12f'),{'UserId':Number(_0x525bb9[_0x5685('0x46')][_0x5685('0x70')]),'ChatWebsiteId':Number(_0x525bb9[_0x5685('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x30d950,null))['catch'](handleError(_0x30d950,null));};exports[_0x5685('0x130')]=function(_0x2336a2,_0x34f4c2,_0x138908){var _0x45690f={};var _0x2caefc={};var _0x2f3888;var _0x252b65;return db['ChatWebsite'][_0x5685('0x6d')]({'where':{'id':_0x2336a2[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x34f4c2,null))[_0x5685('0x21')](function(_0x4a5a47){if(_0x4a5a47){_0x2f3888=_0x4a5a47;_0x2caefc[_0x5685('0x45')]=_[_0x5685('0x47')](db['User'][_0x5685('0x41')]);_0x2caefc[_0x5685('0x46')]=_[_0x5685('0x47')](_0x2336a2['query']);_0x2caefc[_0x5685('0x4f')]=_[_0x5685('0x48')](_0x2caefc['model'],_0x2caefc[_0x5685('0x46')]);_0x45690f[_0x5685('0x49')]=_[_0x5685('0x48')](_0x2caefc[_0x5685('0x45')],qs[_0x5685('0x4a')](_0x2336a2[_0x5685('0x46')][_0x5685('0x4a')]));_0x45690f[_0x5685('0x49')]=_0x45690f[_0x5685('0x49')]['length']?_0x45690f[_0x5685('0x49')]:_0x2caefc[_0x5685('0x45')];_0x45690f[_0x5685('0x4d')]=qs['sort'](_0x2336a2['query']['sort']);_0x45690f[_0x5685('0x52')]=qs[_0x5685('0x4f')](_[_0x5685('0x50')](_0x2336a2[_0x5685('0x46')],_0x2caefc['filters']));if(_0x2336a2[_0x5685('0x46')][_0x5685('0x51')]){_0x45690f[_0x5685('0x52')]=_[_0x5685('0x53')](_0x45690f[_0x5685('0x52')],{'$or':_[_0x5685('0x40')](_0x45690f['attributes'],function(_0x56c346){var _0xc138eb={};_0xc138eb[_0x56c346]={'$like':'%'+_0x2336a2[_0x5685('0x46')]['filter']+'%'};return _0xc138eb;})});}_0x45690f=_['merge']({},_0x45690f,_0x2336a2[_0x5685('0x55')]);return _0x2f3888[_0x5685('0x130')](_0x45690f);}})['then'](function(_0x373ebb){if(_0x373ebb){_0x252b65=_0x373ebb[_0x5685('0x4b')];if(!_0x2336a2[_0x5685('0x46')][_0x5685('0x4c')]('nolimit')){_0x45690f[_0x5685('0x32')]=qs[_0x5685('0x32')](_0x2336a2[_0x5685('0x46')]['limit']);_0x45690f[_0x5685('0x2f')]=qs['offset'](_0x2336a2[_0x5685('0x46')][_0x5685('0x2f')]);}return _0x2f3888[_0x5685('0x130')](_0x45690f);}})[_0x5685('0x21')](function(_0x488990){if(_0x488990){return _0x488990?{'count':_0x252b65,'rows':_0x488990}:null;}})[_0x5685('0x21')](respondWithResult(_0x34f4c2,null))[_0x5685('0x2a')](handleError(_0x34f4c2,null));}; \ No newline at end of file +var _0x501e=['spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','CompanyId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','ListId','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','offlineMessageBody','ChatOfflineMessage','mimetype','files','attachments','offline-chat','openNewInteraction','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','mapValues','Chat','NotifyMailAccount','server','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','info','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','Intervals','increment','chatLicenseExceeded','all','some','remote','x-real-ip','connection','remoteAddress','virtual','replace','render','alignment','textColor','color_button','backgroundColor','addApplications','sequelize','transaction','findAndCountAll','getApplications','addProactiveActions','getProactiveActions','ChatProactiveAction','false','offlineForm','onlineForm','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./chatWebsite.socket','register','client','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','get','ChatWebsites','UserProfileResource','destroy','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','show','params','keys','fields','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','describe','ChatWebsiteId','findOne','Disposition','pick','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','getLicense','custom','isNil','root','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','List','Contacts','DESC','ChatApplication','applications','Applications','list','orderBy','priority','asc','account','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x501e,0x1a7));var _0xe501=function(_0x3fbe61,_0x17093b){_0x3fbe61=_0x3fbe61-0x0;var _0x3450b3=_0x501e[_0x3fbe61];return _0x3450b3;};'use strict';var emlformat=require(_0xe501('0x0'));var rimraf=require(_0xe501('0x1'));var zipdir=require(_0xe501('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe501('0x3'));var BPromise=require(_0xe501('0x4'));var Mustache=require(_0xe501('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe501('0x6'));var csv=require('to-csv');var ejs=require(_0xe501('0x7'));var fs=require('fs');var fs_extra=require(_0xe501('0x8'));var _=require(_0xe501('0x9'));var squel=require(_0xe501('0xa'));var crypto=require(_0xe501('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe501('0xc'));var toCsv=require(_0xe501('0xd'));var querystring=require(_0xe501('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe501('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe501('0x10'))('api');var utils=require(_0xe501('0x11'));var config=require(_0xe501('0x12'));var licenseUtil=require(_0xe501('0x13'));var db=require('../../mysqldb')['db'];config[_0xe501('0x14')]=_['defaults'](config[_0xe501('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xe501('0x15'))(new Redis(config[_0xe501('0x14')]));require(_0xe501('0x16'))[_0xe501('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe501('0x18')]['http']({'port':0x232c});var client9002=jayson[_0xe501('0x18')]['http']({'port':0x232a});var client9003=jayson[_0xe501('0x18')]['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x59d932,_0x5e0153,_0x581dda,_0x351e0b){return new BPromise(function(_0x1e603f,_0x1f9c16){var _0x5347ab=_0x351e0b||client;return _0x5347ab['request'](_0x59d932,_0x581dda)['then'](function(_0x1fbe17){logger['info'](_0xe501('0x19'),_0x5e0153,_0xe501('0x1a'));logger[_0xe501('0x1b')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5e0153,_0xe501('0x1a'),JSON[_0xe501('0x1c')](_0x1fbe17));if(_0x1fbe17['error']){if(_0x1fbe17['error'][_0xe501('0x1d')]===0x1f4){logger[_0xe501('0x1e')](_0xe501('0x19'),_0x5e0153,_0x1fbe17['error']['message']);return _0x1f9c16(_0x1fbe17['error'][_0xe501('0x1f')]);}logger[_0xe501('0x1e')](_0xe501('0x19'),_0x5e0153,_0x1fbe17[_0xe501('0x1e')][_0xe501('0x1f')]);return _0x1e603f(_0x1fbe17['error'][_0xe501('0x1f')]);}else{logger['info'](_0xe501('0x19'),_0x5e0153,'request\x20sent');_0x1e603f(_0x1fbe17['result'][_0xe501('0x1f')]);}})['catch'](function(_0x41df82){logger[_0xe501('0x1e')](_0xe501('0x19'),_0x5e0153,_0x41df82);_0x1f9c16(_0x41df82);});});}function respondWithStatusCode(_0x2592f9,_0x7310d0){_0x7310d0=_0x7310d0||0xcc;return function(_0x51aad5){if(_0x51aad5){return _0x2592f9['sendStatus'](_0x7310d0);}return _0x2592f9[_0xe501('0x20')](_0x7310d0)[_0xe501('0x21')]();};}function respondWithResult(_0x22f81e,_0x23c98e){_0x23c98e=_0x23c98e||0xc8;return function(_0x1cb53f){if(_0x1cb53f){return _0x22f81e['status'](_0x23c98e)[_0xe501('0x22')](_0x1cb53f);}};}function respondWithFilteredResult(_0x44225b,_0x5d95dd){return function(_0x2d3b85){if(_0x2d3b85){var _0x4100dc=typeof _0x5d95dd[_0xe501('0x23')]===_0xe501('0x24')&&typeof _0x5d95dd['limit']==='undefined';var _0x48be4a=_0x2d3b85[_0xe501('0x25')];var _0x24b75c=_0x4100dc?0x0:_0x5d95dd[_0xe501('0x23')];var _0x5060db=_0x4100dc?_0x2d3b85[_0xe501('0x25')]:_0x5d95dd[_0xe501('0x23')]+_0x5d95dd[_0xe501('0x26')];var _0x4520d3;if(_0x5060db>=_0x48be4a){_0x5060db=_0x48be4a;_0x4520d3=0xc8;}else{_0x4520d3=0xce;}_0x44225b[_0xe501('0x20')](_0x4520d3);return _0x44225b[_0xe501('0x27')]('Content-Range',_0x24b75c+'-'+_0x5060db+'/'+_0x48be4a)['json'](_0x2d3b85);}return null;};}function patchUpdates(_0x22b511){return function(_0x40b9b3){try{jsonpatch[_0xe501('0x28')](_0x40b9b3,_0x22b511,!![]);}catch(_0x32a103){return BPromise[_0xe501('0x29')](_0x32a103);}return _0x40b9b3[_0xe501('0x2a')]();};}function saveUpdates(_0x54cca2,_0x498c44){return function(_0x589d37){if(_0x589d37){return _0x589d37[_0xe501('0x2b')](_0x54cca2)[_0xe501('0x2c')](function(_0x4dbe14){return _0x4dbe14;});}return null;};}function removeEntity(_0x515182,_0x36143d){return function(_0x3c1379){if(_0x3c1379){return _0x3c1379['destroy']()[_0xe501('0x2c')](function(){var _0x1cbb74=_0x3c1379[_0xe501('0x2d')]({'plain':!![]});var _0x193a74=_0xe501('0x2e');return db[_0xe501('0x2f')][_0xe501('0x30')]({'where':{'type':_0x193a74,'resourceId':_0x1cbb74['id']}})[_0xe501('0x2c')](function(){return _0x3c1379;});})[_0xe501('0x2c')](function(){_0x515182[_0xe501('0x20')](0xcc)[_0xe501('0x21')]();});}};}function handleEntityNotFound(_0x9316c2,_0x590198){return function(_0x48088c){if(!_0x48088c){_0x9316c2[_0xe501('0x31')](0x194);}return _0x48088c;};}function handleError(_0x1a8e53,_0x2120fa){_0x2120fa=_0x2120fa||0x1f4;return function(_0x2f2e08){logger['error'](_0x2f2e08[_0xe501('0x32')]);if(_0x2f2e08['name']){delete _0x2f2e08[_0xe501('0x33')];}_0x1a8e53[_0xe501('0x20')](_0x2120fa)['send'](_0x2f2e08);};}exports[_0xe501('0x34')]=function(_0x4c6906,_0x5a7f00){var _0xd7931c={'include':[{'model':db[_0xe501('0x35')],'as':_0xe501('0x36')}]},_0x646e18={},_0xbae3={'count':0x0,'rows':[]};var _0x1dbbc5=_['map'](db[_0xe501('0x37')][_0xe501('0x38')],function(_0x261376){return{'name':_0x261376['fieldName'],'type':_0x261376[_0xe501('0x39')][_0xe501('0x3a')]};});_0x646e18[_0xe501('0x3b')]=_[_0xe501('0x3c')](_0x1dbbc5,_0xe501('0x33'));_0x646e18[_0xe501('0x3d')]=_['keys'](_0x4c6906[_0xe501('0x3d')]);_0x646e18[_0xe501('0x3e')]=_[_0xe501('0x3f')](_0x646e18['model'],_0x646e18[_0xe501('0x3d')]);_0xd7931c['attributes']=_[_0xe501('0x3f')](_0x646e18[_0xe501('0x3b')],qs['fields'](_0x4c6906[_0xe501('0x3d')]['fields']));_0xd7931c[_0xe501('0x40')]=_0xd7931c[_0xe501('0x40')][_0xe501('0x41')]?_0xd7931c['attributes']:_0x646e18[_0xe501('0x3b')];if(!_0x4c6906[_0xe501('0x3d')][_0xe501('0x42')]('nolimit')){_0xd7931c[_0xe501('0x26')]=qs[_0xe501('0x26')](_0x4c6906[_0xe501('0x3d')][_0xe501('0x26')]);_0xd7931c[_0xe501('0x23')]=qs[_0xe501('0x23')](_0x4c6906[_0xe501('0x3d')]['offset']);}_0xd7931c[_0xe501('0x43')]=qs[_0xe501('0x44')](_0x4c6906[_0xe501('0x3d')]['sort']);_0xd7931c[_0xe501('0x45')]=qs[_0xe501('0x3e')](_['pick'](_0x4c6906[_0xe501('0x3d')],_0x646e18[_0xe501('0x3e')]),_0x1dbbc5);if(_0x4c6906[_0xe501('0x3d')][_0xe501('0x46')]){_0xd7931c[_0xe501('0x45')]=_[_0xe501('0x47')](_0xd7931c['where'],{'$or':_[_0xe501('0x3c')](_0x1dbbc5,function(_0x323675){if(_0x323675[_0xe501('0x39')]!==_0xe501('0x48')){var _0x1f842b={};_0x1f842b[_0x323675[_0xe501('0x33')]]={'$like':'%'+_0x4c6906[_0xe501('0x3d')][_0xe501('0x46')]+'%'};return _0x1f842b;}})});}_0xd7931c=_['merge']({},_0xd7931c,_0x4c6906[_0xe501('0x49')]);var _0x1f6072={'where':_0xd7931c[_0xe501('0x45')]};return db[_0xe501('0x37')]['count'](_0x1f6072)[_0xe501('0x2c')](function(_0x9c3b1c){_0xbae3[_0xe501('0x25')]=_0x9c3b1c;if(_0x4c6906[_0xe501('0x3d')][_0xe501('0x4a')]){_0xd7931c[_0xe501('0x4b')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0xd7931c);})['then'](function(_0x49dba3){_0xbae3['rows']=_0x49dba3;return _0xbae3;})['then'](respondWithFilteredResult(_0x5a7f00,_0xd7931c))['catch'](handleError(_0x5a7f00,null));};exports[_0xe501('0x4c')]=function(_0x44290a,_0x11e33d){var _0x104ef3={'raw':![],'where':{'id':_0x44290a[_0xe501('0x4d')]['id']},'include':[{'model':db[_0xe501('0x35')],'as':_0xe501('0x36')}]},_0x5ac55a={};_0x5ac55a['model']=_[_0xe501('0x4e')](db['ChatWebsite']['rawAttributes']);_0x5ac55a[_0xe501('0x3d')]=_['keys'](_0x44290a[_0xe501('0x3d')]);_0x5ac55a['filters']=_['intersection'](_0x5ac55a[_0xe501('0x3b')],_0x5ac55a[_0xe501('0x3d')]);_0x104ef3[_0xe501('0x40')]=_[_0xe501('0x3f')](_0x5ac55a[_0xe501('0x3b')],qs[_0xe501('0x4f')](_0x44290a[_0xe501('0x3d')][_0xe501('0x4f')]));_0x104ef3[_0xe501('0x40')]=_0x104ef3[_0xe501('0x40')][_0xe501('0x41')]?_0x104ef3['attributes']:_0x5ac55a[_0xe501('0x3b')];if(_0x44290a['query'][_0xe501('0x4a')]){_0x104ef3[_0xe501('0x4b')]=[{'all':!![]}];}_0x104ef3=_[_0xe501('0x47')]({},_0x104ef3,_0x44290a[_0xe501('0x49')]);return db[_0xe501('0x37')]['find'](_0x104ef3)[_0xe501('0x2c')](handleEntityNotFound(_0x11e33d,null))[_0xe501('0x2c')](respondWithResult(_0x11e33d,null))[_0xe501('0x50')](handleError(_0x11e33d,null));};exports['create']=function(_0x244e9b,_0x5caeea){return db[_0xe501('0x37')][_0xe501('0x51')](_0x244e9b[_0xe501('0x52')],{})[_0xe501('0x2c')](function(_0x4488fc){var _0x2086c1=_0x244e9b[_0xe501('0x53')][_0xe501('0x2d')]({'plain':!![]});if(!_0x2086c1)throw new Error(_0xe501('0x54'));if(_0x2086c1[_0xe501('0x55')]==='user'){var _0x4bb65a=_0x4488fc['get']({'plain':!![]});var _0x2ced18=_0xe501('0x2e');return db['UserProfileSection'][_0xe501('0x56')]({'where':{'name':_0x2ced18,'userProfileId':_0x2086c1[_0xe501('0x57')]},'raw':!![]})[_0xe501('0x2c')](function(_0x5505ee){if(_0x5505ee&&_0x5505ee[_0xe501('0x58')]===0x0){return db[_0xe501('0x2f')][_0xe501('0x51')]({'name':_0x4bb65a[_0xe501('0x33')],'resourceId':_0x4bb65a['id'],'type':_0x5505ee[_0xe501('0x33')],'sectionId':_0x5505ee['id']},{})[_0xe501('0x2c')](function(){return _0x4488fc;});}else{return _0x4488fc;}})[_0xe501('0x50')](function(_0x2d799e){logger[_0xe501('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d799e);throw _0x2d799e;});}return _0x4488fc;})[_0xe501('0x2c')](respondWithResult(_0x5caeea,0xc9))[_0xe501('0x50')](handleError(_0x5caeea,null));};exports[_0xe501('0x2b')]=function(_0x5ae9ee,_0x47d4f3){if(_0x5ae9ee[_0xe501('0x52')]['id']){delete _0x5ae9ee['body']['id'];}return db[_0xe501('0x37')]['find']({'where':{'id':_0x5ae9ee['params']['id']},'include':[{'model':db[_0xe501('0x35')],'as':_0xe501('0x36')}]})[_0xe501('0x2c')](handleEntityNotFound(_0x47d4f3,null))[_0xe501('0x2c')](saveUpdates(_0x5ae9ee[_0xe501('0x52')],null))[_0xe501('0x2c')](respondWithResult(_0x47d4f3,null))['catch'](handleError(_0x47d4f3,null));};exports[_0xe501('0x30')]=function(_0x47400a,_0x14fb5a){return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x47400a['params']['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x14fb5a,null))[_0xe501('0x2c')](removeEntity(_0x14fb5a,null))['catch'](handleError(_0x14fb5a,null));};exports['describe']=function(_0x21231e,_0x497755){return db['ChatWebsite'][_0xe501('0x59')]()[_0xe501('0x2c')](respondWithResult(_0x497755,null))[_0xe501('0x50')](handleError(_0x497755,null));};exports['addDisposition']=function(_0x40a457,_0x339960,_0x11c3e3){if(_0x40a457[_0xe501('0x52')]['id']){delete _0x40a457[_0xe501('0x52')]['id'];}return db['ChatWebsite'][_0xe501('0x56')]({'where':{'id':_0x40a457[_0xe501('0x4d')]['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x339960,null))['then'](function(_0x56500e){if(_0x56500e){_0x40a457['body'][_0xe501('0x5a')]=_0x56500e['id'];return db['Disposition'][_0xe501('0x51')](_0x40a457['body']);}})[_0xe501('0x2c')](respondWithResult(_0x339960,null))[_0xe501('0x50')](handleError(_0x339960,null));};exports['getDispositions']=function(_0x100d31,_0x3096e7,_0x237085){var _0x4698a2={'raw':![],'where':{}};var _0x48da30={};var _0x95193={'count':0x0,'rows':[]};return db[_0xe501('0x37')][_0xe501('0x5b')]({'where':{'id':_0x100d31['params']['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x3096e7,null))[_0xe501('0x2c')](function(_0x5caa85){if(_0x5caa85){_0x48da30[_0xe501('0x3b')]=_[_0xe501('0x4e')](db[_0xe501('0x5c')][_0xe501('0x38')]);_0x48da30[_0xe501('0x3d')]=_['keys'](_0x100d31[_0xe501('0x3d')]);_0x48da30['filters']=_[_0xe501('0x3f')](_0x48da30[_0xe501('0x3b')],_0x48da30[_0xe501('0x3d')]);_0x4698a2[_0xe501('0x40')]=_['intersection'](_0x48da30['model'],qs[_0xe501('0x4f')](_0x100d31[_0xe501('0x3d')]['fields']));_0x4698a2['attributes']=_0x4698a2[_0xe501('0x40')][_0xe501('0x41')]?_0x4698a2[_0xe501('0x40')]:_0x48da30[_0xe501('0x3b')];if(!_0x100d31[_0xe501('0x3d')][_0xe501('0x42')]('nolimit')){_0x4698a2[_0xe501('0x26')]=qs[_0xe501('0x26')](_0x100d31['query']['limit']);_0x4698a2[_0xe501('0x23')]=qs['offset'](_0x100d31['query'][_0xe501('0x23')]);}_0x4698a2['order']=qs[_0xe501('0x44')](_0x100d31[_0xe501('0x3d')][_0xe501('0x44')]);_0x4698a2['where']=qs[_0xe501('0x3e')](_[_0xe501('0x5d')](_0x100d31[_0xe501('0x3d')],_0x48da30[_0xe501('0x3e')]));_0x4698a2[_0xe501('0x45')]['ChatWebsiteId']=_0x5caa85['id'];if(_0x100d31['query'][_0xe501('0x46')]){_0x4698a2[_0xe501('0x45')]=_[_0xe501('0x47')](_0x4698a2['where'],{'$or':_[_0xe501('0x3c')](_0x4698a2[_0xe501('0x40')],function(_0x26eeb3){var _0x3040fb={};_0x3040fb[_0x26eeb3]={'$like':'%'+_0x100d31[_0xe501('0x3d')][_0xe501('0x46')]+'%'};return _0x3040fb;})});}_0x4698a2=_[_0xe501('0x47')]({},_0x4698a2,_0x100d31['options']);return db['Disposition'][_0xe501('0x25')]({'where':_0x4698a2[_0xe501('0x45')]})[_0xe501('0x2c')](function(_0x41e385){_0x95193[_0xe501('0x25')]=_0x41e385;if(_0x100d31[_0xe501('0x3d')][_0xe501('0x4a')]){_0x4698a2['include']=[{'all':!![]}];}return db[_0xe501('0x5c')][_0xe501('0x5e')](_0x4698a2);})['then'](function(_0x1fb0c5){_0x95193[_0xe501('0x5f')]=_0x1fb0c5;return _0x95193;});}})['then'](respondWithFilteredResult(_0x3096e7,_0x4698a2))[_0xe501('0x50')](handleError(_0x3096e7,null));};exports[_0xe501('0x60')]=function(_0x268935,_0x3758f6,_0x297932){return db['ChatWebsite'][_0xe501('0x56')]({'where':{'id':_0x268935[_0xe501('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3758f6,null))['then'](function(_0x4b3d80){if(_0x4b3d80){return _0x4b3d80[_0xe501('0x60')](_0x268935[_0xe501('0x3d')][_0xe501('0x61')]);}})[_0xe501('0x2c')](respondWithStatusCode(_0x3758f6,null))[_0xe501('0x50')](handleError(_0x3758f6,null));};exports[_0xe501('0x62')]=function(_0x3ad7a0,_0x5d8000,_0xbd5cc){if(_0x3ad7a0['body']['id']){delete _0x3ad7a0[_0xe501('0x52')]['id'];}return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x3ad7a0[_0xe501('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5d8000,null))[_0xe501('0x2c')](function(_0x30f46a){if(_0x30f46a){_0x3ad7a0[_0xe501('0x52')][_0xe501('0x5a')]=_0x30f46a['id'];return db[_0xe501('0x63')][_0xe501('0x51')](_0x3ad7a0['body']);}})[_0xe501('0x2c')](respondWithResult(_0x5d8000,null))[_0xe501('0x50')](handleError(_0x5d8000,null));};exports[_0xe501('0x64')]=function(_0x427d70,_0x187cea,_0x2bbd9c){var _0x28cf58={'raw':![],'where':{}};var _0x468565={};var _0x5ddd33={'count':0x0,'rows':[]};return db[_0xe501('0x37')][_0xe501('0x5b')]({'where':{'id':_0x427d70[_0xe501('0x4d')]['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x187cea,null))[_0xe501('0x2c')](function(_0x3d0d4b){if(_0x3d0d4b){_0x468565[_0xe501('0x3b')]=_[_0xe501('0x4e')](db['CannedAnswer'][_0xe501('0x38')]);_0x468565[_0xe501('0x3d')]=_['keys'](_0x427d70[_0xe501('0x3d')]);_0x468565[_0xe501('0x3e')]=_['intersection'](_0x468565[_0xe501('0x3b')],_0x468565['query']);_0x28cf58[_0xe501('0x40')]=_['intersection'](_0x468565['model'],qs['fields'](_0x427d70[_0xe501('0x3d')][_0xe501('0x4f')]));_0x28cf58[_0xe501('0x40')]=_0x28cf58[_0xe501('0x40')]['length']?_0x28cf58[_0xe501('0x40')]:_0x468565['model'];if(!_0x427d70[_0xe501('0x3d')][_0xe501('0x42')](_0xe501('0x65'))){_0x28cf58[_0xe501('0x26')]=qs['limit'](_0x427d70[_0xe501('0x3d')][_0xe501('0x26')]);_0x28cf58['offset']=qs['offset'](_0x427d70[_0xe501('0x3d')][_0xe501('0x23')]);}_0x28cf58[_0xe501('0x43')]=qs['sort'](_0x427d70[_0xe501('0x3d')][_0xe501('0x44')]);_0x28cf58[_0xe501('0x45')]=qs[_0xe501('0x3e')](_[_0xe501('0x5d')](_0x427d70[_0xe501('0x3d')],_0x468565[_0xe501('0x3e')]));_0x28cf58[_0xe501('0x45')][_0xe501('0x5a')]=_0x3d0d4b['id'];if(_0x427d70[_0xe501('0x3d')][_0xe501('0x46')]){_0x28cf58['where']=_[_0xe501('0x47')](_0x28cf58['where'],{'$or':_[_0xe501('0x3c')](_0x28cf58[_0xe501('0x40')],function(_0x525392){var _0x34926a={};_0x34926a[_0x525392]={'$like':'%'+_0x427d70[_0xe501('0x3d')]['filter']+'%'};return _0x34926a;})});}_0x28cf58=_['merge']({},_0x28cf58,_0x427d70[_0xe501('0x49')]);return db['CannedAnswer'][_0xe501('0x25')]({'where':_0x28cf58[_0xe501('0x45')]})[_0xe501('0x2c')](function(_0x2bbc5d){_0x5ddd33[_0xe501('0x25')]=_0x2bbc5d;if(_0x427d70[_0xe501('0x3d')][_0xe501('0x4a')]){_0x28cf58[_0xe501('0x4b')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe501('0x5e')](_0x28cf58);})['then'](function(_0x74c3fd){_0x5ddd33['rows']=_0x74c3fd;return _0x5ddd33;});}})[_0xe501('0x2c')](respondWithFilteredResult(_0x187cea,_0x28cf58))[_0xe501('0x50')](handleError(_0x187cea,null));};exports[_0xe501('0x66')]=function(_0x385b50,_0x130dee,_0x43e2e8){return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x385b50[_0xe501('0x4d')]['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x130dee,null))[_0xe501('0x2c')](function(_0x4c4874){if(_0x4c4874){return _0x4c4874[_0xe501('0x66')](_0x385b50[_0xe501('0x3d')][_0xe501('0x61')]);}})['then'](respondWithStatusCode(_0x130dee,null))[_0xe501('0x50')](handleError(_0x130dee,null));};exports[_0xe501('0x67')]=function(_0x2817b6,_0x364f90,_0xba423d){_0x2817b6[_0xe501('0x52')][_0xe501('0x68')]=_0x2817b6[_0xe501('0x69')][_0xe501('0x6a')];return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x2817b6[_0xe501('0x4d')]['id']}})['then'](handleEntityNotFound(_0x364f90,null))['then'](saveUpdates(_0x2817b6['body'],null))[_0xe501('0x2c')](respondWithResult(_0x364f90,null))[_0xe501('0x50')](handleError(_0x364f90,null));};exports[_0xe501('0x6b')]=function(_0x14cf38,_0x1b3e4e,_0x5a5e22){_0x14cf38['body'][_0xe501('0x6c')]=_0x14cf38['file']['filename'];return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x14cf38[_0xe501('0x4d')]['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x1b3e4e,null))[_0xe501('0x2c')](saveUpdates(_0x14cf38[_0xe501('0x52')],null))['then'](respondWithResult(_0x1b3e4e,null))[_0xe501('0x50')](handleError(_0x1b3e4e,null));};exports[_0xe501('0x6d')]=function(_0x4f3b4d,_0x345d53,_0x480275){_0x4f3b4d[_0xe501('0x52')][_0xe501('0x6e')]=_0x4f3b4d[_0xe501('0x69')][_0xe501('0x6a')];return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x4f3b4d[_0xe501('0x4d')]['id']}})['then'](handleEntityNotFound(_0x345d53,null))['then'](saveUpdates(_0x4f3b4d[_0xe501('0x52')],null))[_0xe501('0x2c')](respondWithResult(_0x345d53,null))[_0xe501('0x50')](handleError(_0x345d53,null));};exports[_0xe501('0x6f')]=function(_0x48c801,_0x291ccf,_0x58edde){_0x48c801[_0xe501('0x52')][_0xe501('0x70')]=_0x48c801[_0xe501('0x69')][_0xe501('0x6a')];return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x48c801[_0xe501('0x4d')]['id']}})['then'](handleEntityNotFound(_0x291ccf,null))[_0xe501('0x2c')](saveUpdates(_0x48c801[_0xe501('0x52')],null))[_0xe501('0x2c')](respondWithResult(_0x291ccf,null))[_0xe501('0x50')](handleError(_0x291ccf,null));};exports[_0xe501('0x71')]=function(_0x2dd7c9,_0xa4e72d,_0x1ddab2){var _0x28f5d8=path[_0xe501('0x72')](config['root'],'server/files/images/logos/default_logo.svg');var _0x1e2088={'where':{'id':_0x2dd7c9[_0xe501('0x4d')]['id']},'attributes':['id',_0xe501('0x68')],'raw':!![]};var _0x3e3f88=![];return require(_0xe501('0x13'))[_0xe501('0x73')]()[_0xe501('0x2c')](function(_0x358b11){if(_0x358b11){_0x3e3f88=_0x358b11[_0xe501('0x74')];}})[_0xe501('0x2c')](function(){return db['ChatWebsite']['find'](_0x1e2088);})['then'](handleEntityNotFound(_0xa4e72d,null))[_0xe501('0x2c')](function(_0x10761e){if(_0x10761e){if(!_[_0xe501('0x75')](_0x10761e[_0xe501('0x68')])){if(fs['existsSync'](path[_0xe501('0x72')](config[_0xe501('0x76')],'server/files/images/logos/',_0x10761e[_0xe501('0x68')]))&&_0x3e3f88){_0x28f5d8=path[_0xe501('0x72')](config['root'],_0xe501('0x77'),_0x10761e[_0xe501('0x68')]);}}return _0xa4e72d[_0xe501('0x78')](_0x28f5d8);}})['catch'](handleError(_0xa4e72d,null));};exports['getAvatar']=function(_0x55657f,_0x1c4329,_0x3b1506){var _0x1e17d3=path['join'](config[_0xe501('0x76')],_0xe501('0x79'));var _0x425656={'where':{'id':_0x55657f[_0xe501('0x4d')]['id']},'attributes':['id',_0xe501('0x6c')],'raw':!![]};return db[_0xe501('0x37')]['find'](_0x425656)[_0xe501('0x2c')](handleEntityNotFound(_0x1c4329,null))[_0xe501('0x2c')](function(_0xa1f951){if(_0xa1f951){if(!_[_0xe501('0x75')](_0xa1f951[_0xe501('0x6c')])){if(fs['existsSync'](path[_0xe501('0x72')](config[_0xe501('0x76')],_0xe501('0x7a'),_0xa1f951[_0xe501('0x6c')]))){_0x1e17d3=path[_0xe501('0x72')](config['root'],_0xe501('0x7a'),_0xa1f951[_0xe501('0x6c')]);}}return _0x1c4329[_0xe501('0x78')](_0x1e17d3);}})[_0xe501('0x50')](handleError(_0x1c4329,null));};exports[_0xe501('0x7b')]=function(_0x3abc6c,_0xdc28e5,_0x36e3e2){var _0x206265=path['join'](config[_0xe501('0x76')],_0xe501('0x7c'));var _0x1f844f={'where':{'id':_0x3abc6c['params']['id']},'attributes':['id','customerAvatar',_0xe501('0x7d')],'raw':!![]};return db['ChatWebsite'][_0xe501('0x56')](_0x1f844f)['then'](handleEntityNotFound(_0xdc28e5,null))[_0xe501('0x2c')](function(_0x29b1a1){if(_0x29b1a1){if(!_[_0xe501('0x75')](_0x29b1a1['customerAvatar'])){if(fs[_0xe501('0x7e')](path['join'](config['root'],_0xe501('0x7a'),_0x29b1a1[_0xe501('0x6e')]))&&_0x29b1a1[_0xe501('0x7d')]){_0x206265=path['join'](config[_0xe501('0x76')],_0xe501('0x7a'),_0x29b1a1[_0xe501('0x6e')]);}}return _0xdc28e5[_0xe501('0x78')](_0x206265);}})[_0xe501('0x50')](handleError(_0xdc28e5,null));};exports[_0xe501('0x7f')]=function(_0x28b7a0,_0x8d31f9,_0x1377c7){var _0x246258=path['join'](config[_0xe501('0x76')],_0xe501('0x80'));var _0x716bf4={'where':{'id':_0x28b7a0[_0xe501('0x4d')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xe501('0x37')][_0xe501('0x56')](_0x716bf4)[_0xe501('0x2c')](handleEntityNotFound(_0x8d31f9,null))[_0xe501('0x2c')](function(_0x21d640){if(_0x21d640){if(!_[_0xe501('0x75')](_0x21d640[_0xe501('0x70')])){if(fs['existsSync'](path[_0xe501('0x72')](config[_0xe501('0x76')],_0xe501('0x7a'),_0x21d640[_0xe501('0x70')]))){_0x246258=path['join'](config[_0xe501('0x76')],'server/files/images/avatars/',_0x21d640[_0xe501('0x70')]);}}return _0x8d31f9[_0xe501('0x78')](_0x246258);}})[_0xe501('0x50')](handleError(_0x8d31f9,null));};exports[_0xe501('0x81')]=function(_0x2e2534,_0x3020fb,_0x2ff2e7){var _0x44e4b7=require(_0xe501('0x82'));var _0x53a8d0=new _0x44e4b7();var _0x123c1f=_0x53a8d0[_0xe501('0x83')](_0x2e2534[_0xe501('0x84')][_0xe501('0x85')])[_0xe501('0x86')]();var _0x27b3e3={'body':_0x2e2534[_0xe501('0x52')],'channel':_0xe501('0x87')};var _0x1bbcc2=[];var _0x44e871=[];var _0x12588d={};var _0x2b860a=![];return db[_0xe501('0x88')]['describe']()['then'](function(_0x419676){if(!_0x419676){throw new db[(_0xe501('0x89'))][(_0xe501('0x8a'))](_0xe501('0x8b'));}_0x1bbcc2=_['difference'](_[_0xe501('0x4e')](_0x419676),[_0xe501('0x8c'),_0xe501('0x8d')]);_0x44e871=_[_0xe501('0x8e')](_[_0xe501('0x4e')](_0x419676),[_0xe501('0x8c'),_0xe501('0x8d'),'CompanyId','ListId']);if(_0x2e2534[_0xe501('0x52')]['id']){delete _0x2e2534[_0xe501('0x52')]['id'];}if(_[_0xe501('0x75')](_0x2e2534[_0xe501('0x52')][_0xe501('0x8f')])){throw new db[(_0xe501('0x89'))][(_0xe501('0x8a'))]('from\x20is\x20mandatory');}if(_[_0xe501('0x75')](_0x2e2534[_0xe501('0x52')][_0xe501('0x52')])||_0x2e2534[_0xe501('0x52')][_0xe501('0x52')]===''){throw new db[(_0xe501('0x89'))][(_0xe501('0x8a'))](_0xe501('0x90'));}if(_['isNil'](_0x2e2534['body'][_0xe501('0x91')])){throw new db[(_0xe501('0x89'))][(_0xe501('0x8a'))](_0xe501('0x92')+_0x44e871);}if(!_[_0xe501('0x93')](_0x44e871,_0x2e2534[_0xe501('0x52')][_0xe501('0x91')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x44e871);}_0x12588d[_0x2e2534['body'][_0xe501('0x91')]]=_0x2e2534['body'][_0xe501('0x8f')];})[_0xe501('0x2c')](function(){return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x2e2534[_0xe501('0x4d')]['id']},'include':[{'model':db['CmList'],'as':_0xe501('0x94'),'include':[{'model':db[_0xe501('0x88')],'as':_0xe501('0x95'),'where':_0x12588d,'limit':0x1,'order':[[_0xe501('0x8d'),_0xe501('0x96')]]}]},{'model':db[_0xe501('0x97')],'as':'Applications'}]});})[_0xe501('0x2c')](handleEntityNotFound(_0x3020fb,null))[_0xe501('0x2c')](function(_0xdf2870){if(_0xdf2870&&_0xdf2870['List']){_0x27b3e3['account']=_0xdf2870;_0x27b3e3[_0xe501('0x98')]=_0xdf2870[_0xe501('0x99')];_0x27b3e3[_0xe501('0x9a')]=_0xdf2870['List'];_0x27b3e3['applications']=_[_0xe501('0x9b')](_0x27b3e3[_0xe501('0x98')],[_0xe501('0x9c')],[_0xe501('0x9d')]);if(_0x27b3e3[_0xe501('0x9e')][_0xe501('0x99')]){delete _0x27b3e3[_0xe501('0x9e')][_0xe501('0x99')];}if(_0x27b3e3[_0xe501('0x9e')][_0xe501('0x94')]&&_0x27b3e3[_0xe501('0x9e')]['List'][_0xe501('0x95')][_0xe501('0x41')]){return _0x27b3e3['account'][_0xe501('0x94')][_0xe501('0x95')][0x0];}var _0x5b6155=_[_0xe501('0x9f')](_0x2e2534['body'],{'firstName':_0x2e2534[_0xe501('0x52')]['from'],'ListId':_0xdf2870['ListId']});_0x5b6155[_0x2e2534[_0xe501('0x52')][_0xe501('0x91')]]=_0x2e2534[_0xe501('0x52')]['from'];return db[_0xe501('0x88')][_0xe501('0x51')](_0x5b6155,{'fields':_0x1bbcc2,'raw':!![]});}})[_0xe501('0x2c')](handleEntityNotFound(_0x3020fb,null))[_0xe501('0x2c')](function(_0xdd7a02){_0x27b3e3[_0xe501('0xa0')]=_0xdd7a02;var _0x1ca98d=_0x2e2534[_0xe501('0x52')][_0xe501('0xa1')];if(_0x2e2534['headers'][_0xe501('0xa2')]){_0x1ca98d=_0x2e2534[_0xe501('0x84')][_0xe501('0xa2')];}else if(_0x2e2534['headers'][_0xe501('0xa3')]){_0x1ca98d=_[_0xe501('0xa4')](_0x2e2534['headers'][_0xe501('0xa3')][_0xe501('0xa5')](','));}if(_0xdd7a02){var _0x1cf79f={'ContactId':_0xdd7a02['id'],'ChatWebsiteId':_0x2e2534['params']['id'],'from':(_0xdd7a02[_0xe501('0xa6')]||'')+'\x20'+(_0xdd7a02[_0xe501('0xa7')]||''),'customerIp':_0x1ca98d,'customerPort':_0x2e2534['headers'][_0xe501('0xa8')]?_0x2e2534[_0xe501('0x84')]['x-real-port']:null,'referer':_0x2e2534[_0xe501('0x52')][_0xe501('0xa9')],'browserName':_0x123c1f['browser'][_0xe501('0x33')]&&_0x123c1f[_0xe501('0xaa')][_0xe501('0xab')]?util['format'](_0xe501('0xac'),_0x123c1f['browser'][_0xe501('0x33')],_0x123c1f[_0xe501('0xaa')][_0xe501('0xab')]):_0xe501('0xad'),'browserVersion':_0x123c1f[_0xe501('0xaa')][_0xe501('0xab')]||_0xe501('0xad'),'osName':util[_0xe501('0xae')](_0xe501('0xac'),_0x123c1f['os'][_0xe501('0x33')],_0x123c1f['os']['version']),'osVersion':_0x123c1f['os'][_0xe501('0xab')],'deviceModel':_0x123c1f[_0xe501('0xaf')][_0xe501('0x3b')]&&_0x123c1f[_0xe501('0xaf')][_0xe501('0xb0')]?util[_0xe501('0xae')](_0xe501('0xb1'),_0x123c1f[_0xe501('0xaf')][_0xe501('0x3b')],_0x123c1f[_0xe501('0xaf')][_0xe501('0xb0')],_0x123c1f[_0xe501('0xaf')]['type']):null,'deviceVendor':_0x123c1f[_0xe501('0xaf')][_0xe501('0xb0')],'deviceType':_0x123c1f['device'][_0xe501('0x39')],'formData':JSON[_0xe501('0x1c')](_0x2e2534['body'])};var _0x504258={'ChatWebsiteId':_0x2e2534[_0xe501('0x4d')]['id'],'closed':![]};if(_0x2e2534['body'][_0xe501('0xb2')]){_0x504258['threadId']=_0x2e2534[_0xe501('0x52')][_0xe501('0xb2')];return db[_0xe501('0xb3')]['find']({'where':_0x504258})[_0xe501('0x2c')](function(_0x21bcb0){if(_0x21bcb0){return[_0x21bcb0,![]];}_0x1cf79f[_0xe501('0xb2')]=_0x2e2534[_0xe501('0x52')][_0xe501('0xb2')];_0x1cf79f[_0xe501('0xb4')]=_0x2e2534[_0xe501('0x52')][_0xe501('0xb4')];return db[_0xe501('0xb3')][_0xe501('0x51')](_0x1cf79f)[_0xe501('0x2c')](function(_0x42d8e8){return[_0x42d8e8,!![]];});});}_0x504258[_0xe501('0xb5')]=_0xdd7a02['id'];if(_0x2e2534[_0xe501('0x52')][_0xe501('0xb6')]&&_0x2e2534[_0xe501('0x52')][_0xe501('0xb6')]['id']){_0x504258['id']=_0x2e2534[_0xe501('0x52')][_0xe501('0xb6')]['id'];return db[_0xe501('0xb3')]['find']({'where':_0x504258})[_0xe501('0x2c')](function(_0x23923f){if(_0x23923f){return[_0x23923f,![]];}return db[_0xe501('0xb3')]['create'](_0x1cf79f)[_0xe501('0x2c')](function(_0x3bfc71){return[_0x3bfc71,!![]];});});}return db[_0xe501('0xb3')][_0xe501('0x51')](_0x1cf79f)[_0xe501('0x2c')](function(_0x24be56){return[_0x24be56,!![]];});}})[_0xe501('0xb7')](function(_0xe1aab9,_0x2a4af8){if(_0xe1aab9){_0x2b860a=_0x2a4af8;if(!_0x2a4af8){var _0x3a96e1={'from':(_0x27b3e3[_0xe501('0xa0')][_0xe501('0xa6')]||'')+'\x20'+(_0x27b3e3[_0xe501('0xa0')]['lastName']||'')};if(_0x2e2534[_0xe501('0x52')][_0xe501('0xb2')]&&_0x2e2534[_0xe501('0x52')][_0xe501('0xb8')]&&_0x2e2534['body'][_0xe501('0xb2')]!=_0x2e2534['body'][_0xe501('0xb8')]){_0x3a96e1['threadId']=_0x2e2534[_0xe501('0x52')][_0xe501('0xb8')];}return _0xe1aab9['update'](_0x3a96e1);}else{return _0xe1aab9;}}})[_0xe501('0x2c')](function(_0x494f5a){_0x27b3e3[_0xe501('0xb6')]=_0x494f5a[_0xe501('0x2d')]({'plain':!![]});_0x27b3e3[_0xe501('0xb6')][_0xe501('0xb9')]=_0x2b860a;if(_0x27b3e3['interaction'][_0xe501('0xb9')]){if(_0x27b3e3[_0xe501('0x9e')][_0xe501('0xba')]){_0x27b3e3[_0xe501('0x98')][_0xe501('0xbb')]({'id':0x0,'priority':_0x27b3e3['applications'][_0xe501('0x41')]+0x1,'app':_0xe501('0xbc'),'appdata':_0xe501('0xbd'),'interval':_0xe501('0xbe')});}}return db[_0xe501('0xbf')]['create']({'body':_0x2e2534[_0xe501('0x52')][_0xe501('0x52')],'ChatWebsiteId':_0x2e2534[_0xe501('0x4d')]['id'],'ChatInteractionId':_0x494f5a['id'],'direction':'in','ContactId':_0x27b3e3['contact']['id'],'AttachmentId':_0x2e2534['body'][_0xe501('0xc0')]});})[_0xe501('0x2c')](function(_0x1f4c79){_0x27b3e3[_0xe501('0x1f')]=_0x1f4c79;if(_0x27b3e3[_0xe501('0xb6')][_0xe501('0xc1')]){return db['User'][_0xe501('0x56')]({'attributes':['id',_0xe501('0x33')],'where':{'id':_0x27b3e3[_0xe501('0xb6')][_0xe501('0xc1')]}})[_0xe501('0x2c')](function(_0x2591f2){if(_0x2591f2){_0x27b3e3['applications'][_0xe501('0xc2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2591f2['name']+','+(_0x27b3e3[_0xe501('0x9e')][_0xe501('0xc3')]||0xa),'interval':_0xe501('0xbe')});_0x27b3e3['forcedOwnership']=!![];}return respondWithRpcPromise(_0xe501('0xc4'),_0xe501('0xc5'),_0x27b3e3);});}return respondWithRpcPromise(_0xe501('0xc4'),_0xe501('0xc5'),_0x27b3e3);})['then'](function(_0x32e210){respondWithRpcPromise(_0xe501('0xc6'),_0xe501('0xc6'),{'event':'notify','message':_0x32e210},client9002);return _0x32e210;})[_0xe501('0x2c')](respondWithResult(_0x3020fb,null))['catch'](handleError(_0x3020fb,null));};exports[_0xe501('0xc7')]=function(_0x4b1818,_0xe52520,_0x5d9278){var _0x230bb1,_0x4f23da,_0x539b47;var _0x5a9567=[];var _0x4253a4=[];var _0x663df9={};var _0x3e6ea8=_0x4b1818['files']||[];var _0x466ff7=[];var _0x1df45c;return db[_0xe501('0x88')]['describe']()['then'](function(_0xa807ce){if(!_0xa807ce){throw new db[(_0xe501('0x89'))][(_0xe501('0x8a'))](_0xe501('0x8b'));}_0x4253a4=_[_0xe501('0x8e')](_[_0xe501('0x4e')](_0xa807ce),[_0xe501('0x8c'),_0xe501('0x8d')]);_0x5a9567=_['difference'](_[_0xe501('0x4e')](_0xa807ce),[_0xe501('0x8c'),_0xe501('0x8d'),_0xe501('0xc8'),'ListId']);if(_0x4b1818[_0xe501('0x52')]['id']){delete _0x4b1818[_0xe501('0x52')]['id'];}if(_[_0xe501('0x75')](_0x4b1818[_0xe501('0x52')]['from'])){throw _0xe52520[_0xe501('0x20')](0x1f4)[_0xe501('0xc9')](new db[(_0xe501('0x89'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xe501('0x75')](_0x4b1818[_0xe501('0x52')][_0xe501('0x52')])||_0x4b1818['body'][_0xe501('0x52')]===''){throw _0xe52520[_0xe501('0x20')](0x1f4)[_0xe501('0xc9')](new db[(_0xe501('0x89'))][(_0xe501('0x8a'))](_0xe501('0x90')));}if(_[_0xe501('0x75')](_0x4b1818[_0xe501('0x52')][_0xe501('0xca')])){throw _0xe52520[_0xe501('0x20')](0x1f4)[_0xe501('0xc9')](new db[(_0xe501('0x89'))][(_0xe501('0x8a'))](_0xe501('0xcb')+_0x5a9567));}if(!_[_0xe501('0x93')](_0x5a9567,_0x4b1818['body'][_0xe501('0xca')])){throw _0xe52520['status'](0x1f4)[_0xe501('0xc9')](new db['Sequelize']['ValidationError'](_0xe501('0xcc')+_0x5a9567));}_0x663df9[_0x4b1818[_0xe501('0x52')]['mapKeyOffline']]=_0x4b1818[_0xe501('0x52')][_0xe501('0x8f')];})[_0xe501('0x2c')](function(){return db['ChatWebsite'][_0xe501('0x56')]({'where':{'id':_0x4b1818[_0xe501('0x4d')]['id']},'include':[{'model':db[_0xe501('0xcd')],'as':'List'},{'model':db[_0xe501('0xce')],'as':_0xe501('0xce')}]});})[_0xe501('0x2c')](handleEntityNotFound(_0xe52520,null))[_0xe501('0x2c')](function(_0x2e99c9){if(_0x2e99c9&&_0x2e99c9[_0xe501('0x94')]){_0x4f23da=_0x2e99c9;var _0x177513=_['defaults'](_0x4b1818[_0xe501('0x52')],{'firstName':_0x4b1818[_0xe501('0x52')][_0xe501('0x8f')],'phone':_0x4b1818[_0xe501('0x52')]['from'],'ListId':_0x2e99c9[_0xe501('0xcf')]});_0x177513[_0x4b1818['body']['mapKeyOffline']]=_0x4b1818[_0xe501('0x52')][_0xe501('0x8f')];return db['CmContact'][_0xe501('0xd0')]({'where':_0x663df9,'defaults':_0x177513});}})[_0xe501('0xb7')](function(_0x311c7a){if(_0x311c7a){_0x539b47=_0x311c7a;var _0x396309=fs[_0xe501('0xd1')](path['join'](config[_0xe501('0x76')],_0xe501('0xd2')),_0xe501('0xd3'));var _0x219bce=ejs['render'](_0x396309,{'body':_['toPairs'](_0x4b1818[_0xe501('0x52')][_0xe501('0x52')]),'bodyTitle':_0x4f23da[_0xe501('0xd4')]});return db[_0xe501('0xd5')]['create']({'body':_0x219bce,'ContactId':_0x311c7a['id'],'ChatWebsiteId':_0x4f23da['id']});}})[_0xe501('0x2c')](function(_0x5e2d87){_0x1df45c=_0x5e2d87;if(_0x3e6ea8[_0xe501('0x41')]){var _0x4a24ff=_0x3e6ea8[_0xe501('0x3c')](function(_0x33a3e5){return{'name':_0x33a3e5['originalname'],'basename':_0x33a3e5[_0xe501('0x6a')],'type':_0x33a3e5[_0xe501('0xd6')],'ChatOfflineMessageId':_0x5e2d87['id']};});_0x466ff7=_0x4a24ff[_0xe501('0x3c')](_0x391793=>{var _0x2f7861={'filename':_0x391793[_0xe501('0x33')],'path':path[_0xe501('0x72')](config[_0xe501('0x76')],'server',_0xe501('0xd7'),_0xe501('0xd8'),_0xe501('0xd9'),_0x391793['basename'])};return _0x2f7861;});if(!_0x4f23da[_0xe501('0xda')]){return db['sequelize']['transaction'](function(_0x583e86){return db['Attachment'][_0xe501('0xdb')](_0x4a24ff,{'transaction':_0x583e86});});}}})[_0xe501('0x2c')](function(){if(_0x1df45c){_0x230bb1=_0x1df45c;return db[_0xe501('0xce')][_0xe501('0x5b')]({'where':{'active':!![]},'include':[{'model':db[_0xe501('0xdc')],'as':_0xe501('0xdd'),'raw':!![]}]});}})[_0xe501('0x2c')](function(_0x1f694d){if(_0x1f694d&&_0x1f694d[_0xe501('0xdd')]&&_0x4f23da['forwardOffline']&&_0x4f23da[_0xe501('0xde')]){var _0x3b01b2={'tls':{'rejectUnauthorized':![]}};if(_0x1f694d[_0xe501('0xdd')]['service']){_0x3b01b2[_0xe501('0xdf')]=_0x1f694d[_0xe501('0xdd')][_0xe501('0xdf')];}else{_0x3b01b2[_0xe501('0xe0')]=_0x1f694d['Smtp'][_0xe501('0xe0')];_0x3b01b2[_0xe501('0xe1')]=_0x1f694d[_0xe501('0xdd')][_0xe501('0xe1')];_0x3b01b2[_0xe501('0xe2')]=_0x1f694d[_0xe501('0xdd')][_0xe501('0xe2')];}if(_0x1f694d[_0xe501('0xdd')][_0xe501('0xe3')]){_0x3b01b2['auth']={'user':_0x1f694d['Smtp'][_0xe501('0x53')],'pass':_0x1f694d[_0xe501('0xdd')][_0xe501('0xe4')]};}return respondWithRpcPromise(_0xe501('0xe5'),_0xe501('0xe6'),{'account':_0x3b01b2,'message':{'from':util[_0xe501('0xae')](_0xe501('0xe7'),_0x1f694d[_0xe501('0x33')],_0x1f694d[_0xe501('0xe8')]||_0x1f694d['Smtp'][_0xe501('0x53')]),'to':_0x4f23da[_0xe501('0xde')],'subject':_0x4f23da[_0xe501('0xe9')],'html':_0x230bb1[_0xe501('0x52')],'attachments':_0x466ff7}},client9003)[_0xe501('0x2c')](function(){return _0x230bb1;})['catch'](function(_0x352e22){console[_0xe501('0x1e')](_0x352e22);});}})[_0xe501('0x2c')](function(){if(_0x4f23da&&_0x4f23da[_0xe501('0xda')]&&_0x4f23da[_0xe501('0xea')]){var _0xd19c9=[];if(_0x3e6ea8[_0xe501('0x41')]){_0xd19c9=_0x3e6ea8[_0xe501('0x3c')](function(_0x606492){return{'name':_0x606492[_0xe501('0xeb')],'basename':_0x606492[_0xe501('0x6a')],'type':_0x606492['mimetype'],'ChatOfflineMessageId':_0x1df45c['id']};});}var _0x46c959;if(!_[_0xe501('0x75')](_0x4f23da[_0xe501('0xec')])){var _0x46be3e=_[_0xe501('0x3c')](_0x4b1818[_0xe501('0x52')],function(_0x31e51a){return _0x31e51a;});var _0x353b69=_['toPairsIn'](_0x46be3e)[0x0];var _0xdeb2f5=_[_0xe501('0xed')](_0x353b69,function(_0x126dfb){return _0x126dfb;});_0x46c959=_0xdeb2f5[0x1][_0x4f23da['subjectOffline']];}var _0x196491={'from':_0x539b47[_0xe501('0xe8')],'firstName':_0x539b47['firstName'],'lastName':_0x539b47[_0xe501('0xa7')],'mapKey':_0xe501('0xe8'),'message':{'from':_0x539b47[_0xe501('0xe8')],'to':_0x4f23da[_0xe501('0xce')]['email'],'cc':'','subject':_[_0xe501('0x75')](_0x46c959)?_0x4f23da[_0xe501('0xe9')]:_0x46c959,'messageId':'','sentAt':new Date(),'attach':_0xd19c9['length'],'attachments':_0xd19c9,'originChannel':_0xe501('0xee'),'ChatWebsiteId':_0x4f23da['id'],'ChatOfflineMessageId':_0x230bb1['id'],'originTo':_0x4f23da['MailAccount']['email']},'body':_0x230bb1['body']};var _0x229714={'account':{'id':_0x4f23da[_0xe501('0xea')]},'body':_0x196491,'log':_0xe501('0xef')};return respondWithRpcPromise(_0xe501('0xef'),'notifyMail',_0x229714,client9001)[_0xe501('0x2c')](function(){return _0x230bb1;})['catch'](function(_0x436a47){console[_0xe501('0x1e')](_0x436a47);});}return;})['then'](function(){if(_0x230bb1){return _0x230bb1;}})[_0xe501('0x2c')](respondWithResult(_0xe52520,null))[_0xe501('0x50')](function(_0x265ac1){console[_0xe501('0x1e')](_0xe501('0x50'),_0x265ac1);for(var _0x329db4 of _0x3e6ea8){var _0x5cc52d=path[_0xe501('0x72')](config[_0xe501('0x76')],_0xe501('0xf0'),_0xe501('0xd7'),'attachments',_0xe501('0xd9'),_0x329db4[_0xe501('0x6a')]);fs_extra['remove'](_0x5cc52d)[_0xe501('0x50')](function(_0x32023a){console[_0xe501('0x1e')](_0xe501('0xf1'),_0x5cc52d,_0x32023a);});}});};exports[_0xe501('0xf2')]=function(_0x570c78,_0x41ccaa,_0x18faae){return db[_0xe501('0xb3')]['find']({'where':{'id':_0x570c78[_0xe501('0x4d')]['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x41ccaa,null))['then'](function(_0x15c35b){if(_0x15c35b){return _0x15c35b[_0xe501('0xf2')](_0x570c78[_0xe501('0x52')][_0xe501('0x61')],_[_0xe501('0xf3')](_0x570c78['body'],[_0xe501('0x61'),'id'])||{});}})['then'](respondWithResult(_0x41ccaa,null))['catch'](handleError(_0x41ccaa,null));};exports[_0xe501('0xf4')]=function(_0x1d0c52,_0x476730,_0x25a30e){var _0x3454d7={'raw':![],'where':{}};var _0x404d19={};var _0x2f55f6={'count':0x0,'rows':[]};return db[_0xe501('0x37')][_0xe501('0x5b')]({'where':{'id':_0x1d0c52[_0xe501('0x4d')]['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x476730,null))[_0xe501('0x2c')](function(_0x36513a){if(_0x36513a){_0x404d19[_0xe501('0x3b')]=_[_0xe501('0x4e')](db['ChatInteraction'][_0xe501('0x38')]);_0x404d19[_0xe501('0x3d')]=_['keys'](_0x1d0c52['query']);_0x404d19[_0xe501('0x3e')]=_[_0xe501('0x3f')](_0x404d19[_0xe501('0x3b')],_0x404d19['query']);_0x3454d7[_0xe501('0x40')]=_[_0xe501('0x3f')](_0x404d19[_0xe501('0x3b')],qs['fields'](_0x1d0c52[_0xe501('0x3d')][_0xe501('0x4f')]));_0x3454d7['attributes']=_0x3454d7['attributes'][_0xe501('0x41')]?_0x3454d7[_0xe501('0x40')]:_0x404d19['model'];if(!_0x1d0c52['query']['hasOwnProperty'](_0xe501('0x65'))){_0x3454d7[_0xe501('0x26')]=qs[_0xe501('0x26')](_0x1d0c52['query'][_0xe501('0x26')]);_0x3454d7[_0xe501('0x23')]=qs['offset'](_0x1d0c52[_0xe501('0x3d')]['offset']);}_0x3454d7[_0xe501('0x43')]=qs['sort'](_0x1d0c52[_0xe501('0x3d')][_0xe501('0x44')]);_0x3454d7['where']=qs[_0xe501('0x3e')](_[_0xe501('0x5d')](_0x1d0c52[_0xe501('0x3d')],_0x404d19[_0xe501('0x3e')]));_0x3454d7['where'][_0xe501('0x5a')]=_0x36513a['id'];if(_0x1d0c52[_0xe501('0x3d')][_0xe501('0x46')]){_0x3454d7[_0xe501('0x45')]=_[_0xe501('0x47')](_0x3454d7['where'],{'$or':_[_0xe501('0x3c')](_0x3454d7[_0xe501('0x40')],function(_0x39fa43){var _0x4f1fcc={};_0x4f1fcc[_0x39fa43]={'$like':'%'+_0x1d0c52['query'][_0xe501('0x46')]+'%'};return _0x4f1fcc;})});}_0x3454d7=_[_0xe501('0x47')]({},_0x3454d7,_0x1d0c52[_0xe501('0x49')]);return db['ChatInteraction'][_0xe501('0x25')]({'where':_0x3454d7[_0xe501('0x45')]})['then'](function(_0x2add0a){_0x2f55f6[_0xe501('0x25')]=_0x2add0a;if(_0x1d0c52['query'][_0xe501('0x4a')]){_0x3454d7[_0xe501('0x4b')]=[{'model':db[_0xe501('0x88')],'as':_0xe501('0xf5'),'required':![]},{'model':db[_0xe501('0xf6')],'as':_0xe501('0xf7'),'attributes':[_0xe501('0x33'),_0xe501('0xf8'),_0xe501('0xf9')],'required':![]},{'model':db[_0xe501('0xfa')],'as':_0xe501('0xfb'),'attributes':['id',_0xe501('0x33'),_0xe501('0xfc')],'where':_0x1d0c52['query'][_0xe501('0xfd')]?{'id':_0x1d0c52[_0xe501('0x3d')][_0xe501('0xfd')]}:undefined,'required':_0x1d0c52[_0xe501('0x3d')]['tag']?!![]:![]}];}return db[_0xe501('0xb3')]['findAll'](_0x3454d7);})[_0xe501('0x2c')](function(_0xd6002b){_0x2f55f6['rows']=_0xd6002b;return _0x2f55f6;});}})['then'](respondWithFilteredResult(_0x476730,_0x3454d7))[_0xe501('0x50')](handleError(_0x476730,null));};function iftimePromise(_0x49d4cf,_0x55202a){return respondWithRpcPromise(_0xe501('0xfe'),_0xe501('0xff'),{'command':_0x55202a[_0xe501('0x100')]?util[_0xe501('0xae')](_0xe501('0x101'),_0x49d4cf[_0xe501('0x102')],_0x55202a[_0xe501('0x100')]):util['format'](_0xe501('0x103'),_0x49d4cf[_0xe501('0x102')])},client9002)[_0xe501('0x2c')](function(_0x577983){var _0x3920fe=_0x577983&&_0x577983['indexOf'](_0xe501('0x104'))>=0x0?!![]:![];logger[_0xe501('0x105')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x55202a['id'],_0x49d4cf['id'],_0x49d4cf[_0xe501('0x102')],_0x3920fe?_0xe501('0x106'):_0xe501('0x107'),_0x55202a[_0xe501('0x100')]?_0x55202a[_0xe501('0x100')]:'No\x20timezone');return _0x3920fe;})['catch'](function(_0x3b346b){logger[_0xe501('0x1e')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x55202a['id'],_0x49d4cf['id'],_0x49d4cf['interval'],util[_0xe501('0x108')](_0x3b346b,{'showHidden':![],'depth':null}),_0x55202a[_0xe501('0x100')]?_0x55202a['timezone']:_0xe501('0x109'));return![];});}exports[_0xe501('0xff')]=function(_0x5af667,_0x15dbfa,_0x15cddf){var _0xcc79b3=0x0;var _0x369eb3=0x0;var _0x5e3ee6=![];var _0x226475;var _0x21392f;return db[_0xe501('0x37')]['find']({'where':{'id':_0x5af667['params']['id']},'include':[{'model':db['Interval'],'as':_0xe501('0x10a'),'include':[{'model':db[_0xe501('0x10a')],'as':_0xe501('0x10b'),'attributes':['id',_0xe501('0x102')],'raw':!![]}]}]})[_0xe501('0x2c')](handleEntityNotFound(_0x15dbfa,null))[_0xe501('0x2c')](function(_0x27b7ba){if(_0x27b7ba){_0x226475=_0x27b7ba;return _0x27b7ba['getProactiveActions']({'raw':!![]});}})[_0xe501('0x2c')](function(_0x1db99e){if(_0x226475){if(_0x1db99e){_0x21392f=_0x1db99e;}}return require('../../config/license/util')[_0xe501('0x73')]();})[_0xe501('0x2c')](function(_0x1ebf02){if(_0x1ebf02){_0x369eb3=_0x1ebf02['virtual'];_0x5e3ee6=_0x1ebf02['custom'];}})[_0xe501('0x2c')](function(){return db[_0xe501('0xb3')]['count']({'where':{'closed':![]}});})[_0xe501('0x2c')](function(_0x15e7a3){_0xcc79b3=_0x15e7a3;if(_0x369eb3&&_0x15e7a3>_0x369eb3){return db['License'][_0xe501('0x5b')]({'where':{'id':0x1}})[_0xe501('0x2c')](function(_0xef50f6){if(_0xef50f6){_0xef50f6[_0xe501('0x10c')](_0xe501('0x10d'));}});}})[_0xe501('0x2c')](function(){if(_0x226475[_0xe501('0x10a')]&&_0x226475[_0xe501('0x10a')][_0xe501('0x10b')]){var _0x19e0df=[];for(var _0xf99a46=0x0;_0xf99a46<_0x226475['Interval']['Intervals'][_0xe501('0x41')];_0xf99a46++){var _0x1f9eb6=_0x226475[_0xe501('0x10a')]['Intervals'][_0xf99a46][_0xe501('0x2d')]({'plain':!![]});_0x19e0df['push'](iftimePromise(_0x1f9eb6,_0x226475));}return BPromise[_0xe501('0x10e')](_0x19e0df)[_0xe501('0x2c')](function(_0x3a5c7a){return _[_0xe501('0x10f')](_0x3a5c7a);});}else{return!![];}})[_0xe501('0x2c')](function(_0x257b2e){var _0xaf5cbe=fs['readFileSync'](path[_0xe501('0x72')](config['root'],'server/files/chat/iframe.ejs'),_0xe501('0xd3'));var _0x4e0111={'remote':_0x226475[_0xe501('0x110')],'query':querystring[_0xe501('0x1c')](_['merge'](_0x226475['get']({'plain':!![]}),{'customerIp':_0x5af667[_0xe501('0x84')][_0xe501('0xa3')]||_0x5af667['headers'][_0xe501('0x111')]||_0x5af667[_0xe501('0x112')][_0xe501('0x113')]||_0x5af667['ip'],'referer':_0x5af667[_0xe501('0x84')][_0xe501('0xa9')],'openedInteractions':_0xcc79b3,'maxInteractions':_0x369eb3,'virtual':_0x5e3ee6[_0xe501('0x114')],'online':_0x257b2e,'custom':_0x5e3ee6}))[_0xe501('0x115')](/'/g,'\x5c\x27')};_0x15dbfa[_0xe501('0xc9')](ejs['render'](Mustache[_0xe501('0x116')](_0xaf5cbe,_0x4e0111),{'proactiveActions':_0x21392f,'alignment':_0x226475[_0xe501('0x117')],'verticalAlignment':_0x226475['verticalAlignment'],'div_color':_0x226475[_0xe501('0xfc')],'text_color':_0x226475[_0xe501('0x118')],'button_color':_0x226475[_0xe501('0x119')],'background_color':_0x226475[_0xe501('0x11a')]}));})[_0xe501('0x50')](handleError(_0x15dbfa,null));};exports[_0xe501('0x11b')]=function(_0x202b19,_0x1f42aa,_0x313e31){return db[_0xe501('0x37')][_0xe501('0x5b')]({'where':{'id':_0x202b19[_0xe501('0x4d')]['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x1f42aa,null))[_0xe501('0x2c')](function(_0x113fbc){if(_0x113fbc){return db[_0xe501('0x11c')][_0xe501('0x11d')](function(_0x45de69){return db[_0xe501('0x97')][_0xe501('0x30')]({'where':{'ChatWebsiteId':_0x202b19[_0xe501('0x4d')]['id']},'transaction':_0x45de69})['then'](function(_0x48371a){var _0x2f525f=_[_0xe501('0x3c')](_0x202b19[_0xe501('0x52')],function(_0x65b02a){_0x65b02a[_0xe501('0x5a')]=_0x202b19[_0xe501('0x4d')]['id'];return _0x65b02a;});return db[_0xe501('0x97')]['bulkCreate'](_0x2f525f,{'transaction':_0x45de69});});})[_0xe501('0x2c')](function(){return db[_0xe501('0x97')][_0xe501('0x11e')]({'where':{'ChatWebsiteId':_0x202b19[_0xe501('0x4d')]['id']},'order':'priority'});});}})[_0xe501('0x2c')](respondWithResult(_0x1f42aa,null))[_0xe501('0x50')](handleError(_0x1f42aa,null));};exports['getApplications']=function(_0x4d6383,_0x2152a6,_0x51edec){var _0x2ac4cf={};var _0x15a7d7={};var _0x245632;var _0x1f56ad;return db[_0xe501('0x37')][_0xe501('0x5b')]({'where':{'id':_0x4d6383['params']['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x2152a6,null))[_0xe501('0x2c')](function(_0x58bb3d){if(_0x58bb3d){_0x245632=_0x58bb3d;_0x15a7d7[_0xe501('0x3b')]=_[_0xe501('0x4e')](db[_0xe501('0x97')][_0xe501('0x38')]);_0x15a7d7[_0xe501('0x3d')]=_['keys'](_0x4d6383['query']);_0x15a7d7[_0xe501('0x3e')]=_[_0xe501('0x3f')](_0x15a7d7[_0xe501('0x3b')],_0x15a7d7[_0xe501('0x3d')]);_0x2ac4cf[_0xe501('0x40')]=_[_0xe501('0x3f')](_0x15a7d7[_0xe501('0x3b')],qs[_0xe501('0x4f')](_0x4d6383[_0xe501('0x3d')][_0xe501('0x4f')]));_0x2ac4cf['attributes']=_0x2ac4cf['attributes']['length']?_0x2ac4cf[_0xe501('0x40')]:_0x15a7d7['model'];_0x2ac4cf['order']=qs[_0xe501('0x44')](_0x4d6383['query']['sort']);_0x2ac4cf[_0xe501('0x45')]=qs['filters'](_[_0xe501('0x5d')](_0x4d6383[_0xe501('0x3d')],_0x15a7d7[_0xe501('0x3e')]));if(_0x4d6383[_0xe501('0x3d')][_0xe501('0x46')]){_0x2ac4cf[_0xe501('0x45')]=_[_0xe501('0x47')](_0x2ac4cf['where'],{'$or':_[_0xe501('0x3c')](_0x2ac4cf[_0xe501('0x40')],function(_0x1dfd47){var _0x5855bb={};_0x5855bb[_0x1dfd47]={'$like':'%'+_0x4d6383[_0xe501('0x3d')]['filter']+'%'};return _0x5855bb;})});}_0x2ac4cf=_[_0xe501('0x47')]({},_0x2ac4cf,_0x4d6383['options']);return _0x245632[_0xe501('0x11f')](_0x2ac4cf);}})[_0xe501('0x2c')](function(_0xa555bd){if(_0xa555bd){_0x1f56ad=_0xa555bd[_0xe501('0x41')];if(!_0x4d6383[_0xe501('0x3d')][_0xe501('0x42')](_0xe501('0x65'))){_0x2ac4cf[_0xe501('0x26')]=qs[_0xe501('0x26')](_0x4d6383[_0xe501('0x3d')][_0xe501('0x26')]);_0x2ac4cf[_0xe501('0x23')]=qs[_0xe501('0x23')](_0x4d6383[_0xe501('0x3d')][_0xe501('0x23')]);}return _0x245632[_0xe501('0x11f')](_0x2ac4cf);}})[_0xe501('0x2c')](function(_0xd71df9){if(_0xd71df9){return _0xd71df9?{'count':_0x1f56ad,'rows':_0xd71df9}:null;}})[_0xe501('0x2c')](respondWithResult(_0x2152a6,null))[_0xe501('0x50')](handleError(_0x2152a6,null));};exports[_0xe501('0x120')]=function(_0x5e4b3c,_0x174c68,_0x25fea7){return db['chatProactiveAction'][_0xe501('0x56')]({'where':{'id':_0x5e4b3c['params']['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x174c68,null))['then'](function(_0x48d2ee){if(_0x48d2ee){return _0x48d2ee[_0xe501('0x120')](_0x5e4b3c[_0xe501('0x52')][_0xe501('0x61')],_[_0xe501('0xf3')](_0x5e4b3c['body'],[_0xe501('0x61'),'id'])||{});}})['then'](respondWithResult(_0x174c68,null))[_0xe501('0x50')](handleError(_0x174c68,null));};exports[_0xe501('0x121')]=function(_0x5b6a14,_0x2ffcbc,_0x50e9d0){var _0x58dcaf={};var _0x5941ba={};var _0x1ca5cb;var _0x28fa98;return db['ChatWebsite'][_0xe501('0x5b')]({'where':{'id':_0x5b6a14[_0xe501('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2ffcbc,null))[_0xe501('0x2c')](function(_0x16f766){if(_0x16f766){_0x1ca5cb=_0x16f766;_0x5941ba[_0xe501('0x3b')]=_[_0xe501('0x4e')](db[_0xe501('0x122')]['rawAttributes']);_0x5941ba['query']=_[_0xe501('0x4e')](_0x5b6a14[_0xe501('0x3d')]);_0x5941ba[_0xe501('0x3e')]=_[_0xe501('0x3f')](_0x5941ba[_0xe501('0x3b')],_0x5941ba['query']);_0x58dcaf[_0xe501('0x40')]=_[_0xe501('0x3f')](_0x5941ba[_0xe501('0x3b')],qs[_0xe501('0x4f')](_0x5b6a14['query']['fields']));_0x58dcaf[_0xe501('0x40')]=_0x58dcaf[_0xe501('0x40')][_0xe501('0x41')]?_0x58dcaf[_0xe501('0x40')]:_0x5941ba[_0xe501('0x3b')];_0x58dcaf[_0xe501('0x43')]=qs[_0xe501('0x44')](_0x5b6a14['query'][_0xe501('0x44')]);_0x58dcaf[_0xe501('0x45')]=qs[_0xe501('0x3e')](_['pick'](_0x5b6a14[_0xe501('0x3d')],_0x5941ba['filters']));if(_0x5b6a14['query']['filter']){_0x58dcaf[_0xe501('0x45')]=_[_0xe501('0x47')](_0x58dcaf['where'],{'$or':_[_0xe501('0x3c')](_0x58dcaf[_0xe501('0x40')],function(_0x185de2){var _0x403cf9={};_0x403cf9[_0x185de2]={'$like':'%'+_0x5b6a14[_0xe501('0x3d')][_0xe501('0x46')]+'%'};return _0x403cf9;})});}_0x58dcaf=_[_0xe501('0x47')]({},_0x58dcaf,_0x5b6a14['options']);return _0x1ca5cb[_0xe501('0x121')](_0x58dcaf);}})[_0xe501('0x2c')](function(_0x4ee93a){if(_0x4ee93a){_0x28fa98=_0x4ee93a[_0xe501('0x41')];if(!_0x5b6a14['query'][_0xe501('0x42')](_0xe501('0x65'))){_0x58dcaf['limit']=qs[_0xe501('0x26')](_0x5b6a14[_0xe501('0x3d')]['limit']);_0x58dcaf['offset']=qs[_0xe501('0x23')](_0x5b6a14[_0xe501('0x3d')][_0xe501('0x23')]);}return _0x1ca5cb[_0xe501('0x121')](_0x58dcaf);}})['then'](function(_0x2983c5){if(_0x2983c5){return _0x2983c5?{'count':_0x28fa98,'rows':_0x2983c5}:null;}})[_0xe501('0x2c')](respondWithResult(_0x2ffcbc,null))['catch'](handleError(_0x2ffcbc,null));};exports['getFields']=function(_0x1a6358,_0x2a7b72,_0xfea5dd){var _0x49f27b=_0x1a6358[_0xe501('0x3d')]['online']===_0xe501('0x123')?_0xe501('0x124'):_0xe501('0x125');return db[_0xe501('0x37')][_0xe501('0x56')]({'attributes':['id',_0x49f27b],'where':{'id':_0x1a6358['params']['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x2a7b72,null))[_0xe501('0x2c')](function(_0x117926){if(_0x117926){var _0x24a663=_0x117926[_0x49f27b];var _0x4e4222=_0x24a663&&_0x24a663['items']?_0x24a663['items']:[];_0x2a7b72['send']({'fromKey':_['isNil'](_0x24a663[_0xe501('0x126')])?undefined:_0x24a663[_0xe501('0x126')],'count':_0x4e4222['length'],'rows':_0x4e4222});}})[_0xe501('0x50')](handleError(_0x2a7b72,null));};exports[_0xe501('0x127')]=function(_0x4d3f3c,_0x46f707,_0x2f533b){var _0x3de1c3={'raw':![],'where':{}};var _0x4117d0={};var _0x5abbf7={'count':0x0,'rows':[]};return db[_0xe501('0x37')][_0xe501('0x5b')]({'where':{'id':_0x4d3f3c['params']['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x46f707,null))[_0xe501('0x2c')](function(_0x13a2c8){if(_0x13a2c8){_0x4117d0[_0xe501('0x3b')]=_[_0xe501('0x4e')](db[_0xe501('0xd5')][_0xe501('0x38')]);_0x4117d0[_0xe501('0x3d')]=_[_0xe501('0x4e')](_0x4d3f3c[_0xe501('0x3d')]);_0x4117d0[_0xe501('0x3e')]=_['intersection'](_0x4117d0[_0xe501('0x3b')],_0x4117d0[_0xe501('0x3d')]);_0x3de1c3['attributes']=_['intersection'](_0x4117d0[_0xe501('0x3b')],qs[_0xe501('0x4f')](_0x4d3f3c[_0xe501('0x3d')][_0xe501('0x4f')]));_0x3de1c3[_0xe501('0x40')]=_0x3de1c3[_0xe501('0x40')][_0xe501('0x41')]?_0x3de1c3['attributes']:_0x4117d0[_0xe501('0x3b')];if(!_0x4d3f3c['query'][_0xe501('0x42')](_0xe501('0x65'))){_0x3de1c3[_0xe501('0x26')]=qs['limit'](_0x4d3f3c[_0xe501('0x3d')]['limit']);_0x3de1c3[_0xe501('0x23')]=qs['offset'](_0x4d3f3c[_0xe501('0x3d')]['offset']);}_0x3de1c3[_0xe501('0x43')]=qs[_0xe501('0x44')](_0x4d3f3c[_0xe501('0x3d')]['sort']);_0x3de1c3[_0xe501('0x45')]=qs[_0xe501('0x3e')](_[_0xe501('0x5d')](_0x4d3f3c[_0xe501('0x3d')],_0x4117d0['filters']));_0x3de1c3['where'][_0xe501('0x5a')]=_0x13a2c8['id'];if(_0x4d3f3c[_0xe501('0x3d')][_0xe501('0x46')]){_0x3de1c3[_0xe501('0x45')]=_[_0xe501('0x47')](_0x3de1c3[_0xe501('0x45')],{'$or':_[_0xe501('0x3c')](_0x3de1c3[_0xe501('0x40')],function(_0xf3065a){var _0x2cc9e6={};_0x2cc9e6[_0xf3065a]={'$like':'%'+_0x4d3f3c[_0xe501('0x3d')][_0xe501('0x46')]+'%'};return _0x2cc9e6;})});}_0x3de1c3=_[_0xe501('0x47')]({},_0x3de1c3,_0x4d3f3c[_0xe501('0x49')]);return db[_0xe501('0xd5')][_0xe501('0x25')]({'where':_0x3de1c3[_0xe501('0x45')]})[_0xe501('0x2c')](function(_0x3be115){_0x5abbf7['count']=_0x3be115;if(_0x4d3f3c[_0xe501('0x3d')][_0xe501('0x4a')]){_0x3de1c3['include']=[{'all':!![]}];}else{_0x3de1c3['include']=[{'model':db[_0xe501('0x88')],'as':_0xe501('0xf5'),'required':![]},{'model':db[_0xe501('0x128')],'as':_0xe501('0x129'),'required':![]}];}return db['ChatOfflineMessage'][_0xe501('0x5e')](_0x3de1c3);})[_0xe501('0x2c')](function(_0x3e171d){_0x5abbf7['rows']=_0x3e171d;return _0x5abbf7;});}})['then'](respondWithFilteredResult(_0x46f707,_0x3de1c3))[_0xe501('0x50')](handleError(_0x46f707,null));};exports[_0xe501('0x12a')]=function(_0x58e47c,_0x24fde5,_0x4be8c3){return db[_0xe501('0x37')]['find']({'where':{'id':_0x58e47c[_0xe501('0x4d')]['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x24fde5,null))[_0xe501('0x2c')](function(_0x134835){if(_0x134835){return _0x134835[_0xe501('0x12a')](_0x58e47c[_0xe501('0x52')][_0xe501('0x61')],_['omit'](_0x58e47c[_0xe501('0x52')],[_0xe501('0x61'),'id'])||{})[_0xe501('0xb7')](function(_0x5e41e4){for(var _0x21e8f0=0x0;_0x21e8f0<_0x58e47c['body']['ids'][_0xe501('0x41')];_0x21e8f0+=0x1){socket[_0xe501('0x12b')]('userChatWebsite:save',{'UserId':Number(_0x58e47c[_0xe501('0x52')]['ids'][_0x21e8f0]),'ChatWebsiteId':Number(_0x58e47c[_0xe501('0x4d')]['id'])});}return _0x5e41e4;});}})[_0xe501('0x2c')](respondWithResult(_0x24fde5,null))[_0xe501('0x50')](handleError(_0x24fde5,null));};exports['removeAgents']=function(_0x45c27c,_0x346510,_0x51b491){return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x45c27c[_0xe501('0x4d')]['id']}})['then'](handleEntityNotFound(_0x346510,null))[_0xe501('0x2c')](function(_0x2537f1){if(_0x2537f1){return _0x2537f1[_0xe501('0x12c')](_0x45c27c[_0xe501('0x3d')][_0xe501('0x61')])[_0xe501('0x2c')](function(){if(_['isArray'](_0x45c27c[_0xe501('0x3d')][_0xe501('0x61')])){for(var _0x35e6ec=0x0;_0x35e6ec<_0x45c27c[_0xe501('0x3d')]['ids'][_0xe501('0x41')];_0x35e6ec+=0x1){socket[_0xe501('0x12b')](_0xe501('0x12d'),{'UserId':Number(_0x45c27c['query'][_0xe501('0x61')][_0x35e6ec]),'ChatWebsiteId':Number(_0x45c27c[_0xe501('0x4d')]['id'])});}}else{socket['emit'](_0xe501('0x12d'),{'UserId':Number(_0x45c27c[_0xe501('0x3d')][_0xe501('0x61')]),'ChatWebsiteId':Number(_0x45c27c['params']['id'])});}});}})[_0xe501('0x2c')](respondWithStatusCode(_0x346510,null))[_0xe501('0x50')](handleError(_0x346510,null));};exports[_0xe501('0x12e')]=function(_0xa1d749,_0x5d2b76,_0x53ee0c){var _0x174d3c={};var _0x414ead={};var _0x39cac3;var _0x13d76a;return db[_0xe501('0x37')][_0xe501('0x5b')]({'where':{'id':_0xa1d749[_0xe501('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5d2b76,null))[_0xe501('0x2c')](function(_0x24eb95){if(_0x24eb95){_0x39cac3=_0x24eb95;_0x414ead[_0xe501('0x3b')]=_[_0xe501('0x4e')](db[_0xe501('0xf6')][_0xe501('0x38')]);_0x414ead[_0xe501('0x3d')]=_[_0xe501('0x4e')](_0xa1d749[_0xe501('0x3d')]);_0x414ead['filters']=_[_0xe501('0x3f')](_0x414ead[_0xe501('0x3b')],_0x414ead['query']);_0x174d3c['attributes']=_[_0xe501('0x3f')](_0x414ead[_0xe501('0x3b')],qs[_0xe501('0x4f')](_0xa1d749[_0xe501('0x3d')]['fields']));_0x174d3c[_0xe501('0x40')]=_0x174d3c[_0xe501('0x40')][_0xe501('0x41')]?_0x174d3c[_0xe501('0x40')]:_0x414ead['model'];_0x174d3c[_0xe501('0x43')]=qs[_0xe501('0x44')](_0xa1d749['query'][_0xe501('0x44')]);_0x174d3c[_0xe501('0x45')]=qs['filters'](_['pick'](_0xa1d749[_0xe501('0x3d')],_0x414ead[_0xe501('0x3e')]));if(_0xa1d749[_0xe501('0x3d')]['filter']){_0x174d3c['where']=_[_0xe501('0x47')](_0x174d3c[_0xe501('0x45')],{'$or':_[_0xe501('0x3c')](_0x174d3c['attributes'],function(_0x4480eb){var _0x1cdb01={};_0x1cdb01[_0x4480eb]={'$like':'%'+_0xa1d749[_0xe501('0x3d')][_0xe501('0x46')]+'%'};return _0x1cdb01;})});}_0x174d3c=_[_0xe501('0x47')]({},_0x174d3c,_0xa1d749[_0xe501('0x49')]);return _0x39cac3[_0xe501('0x12e')](_0x174d3c);}})[_0xe501('0x2c')](function(_0x5a33a7){if(_0x5a33a7){_0x13d76a=_0x5a33a7[_0xe501('0x41')];if(!_0xa1d749['query'][_0xe501('0x42')]('nolimit')){_0x174d3c[_0xe501('0x26')]=qs[_0xe501('0x26')](_0xa1d749[_0xe501('0x3d')]['limit']);_0x174d3c[_0xe501('0x23')]=qs[_0xe501('0x23')](_0xa1d749[_0xe501('0x3d')][_0xe501('0x23')]);}return _0x39cac3['getAgents'](_0x174d3c);}})[_0xe501('0x2c')](function(_0x2e54da){if(_0x2e54da){return _0x2e54da?{'count':_0x13d76a,'rows':_0x2e54da}:null;}})[_0xe501('0x2c')](respondWithResult(_0x5d2b76,null))['catch'](handleError(_0x5d2b76,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 30dc715..ff4ab1c 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 _0x5447=['exports','events','ChatWebsite','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0xfbd2a9,_0x28b8b3){var _0x399bc5=function(_0x2cee1e){while(--_0x2cee1e){_0xfbd2a9['push'](_0xfbd2a9['shift']());}};_0x399bc5(++_0x28b8b3);}(_0x5447,0xf1));var _0x7544=function(_0x49e1df,_0x5e5424){_0x49e1df=_0x49e1df-0x0;var _0xf23632=_0x5447[_0x49e1df];return _0xf23632;};'use strict';var EventEmitter=require(_0x7544('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x7544('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7544('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7544('0x3'),'afterDestroy':'remove'};function emitEvent(_0x6e3582){return function(_0x2b18eb,_0xe47f97,_0x340bda){ChatWebsiteEvents[_0x7544('0x4')](_0x6e3582+':'+_0x2b18eb['id'],_0x2b18eb);ChatWebsiteEvents[_0x7544('0x4')](_0x6e3582,_0x2b18eb);_0x340bda(null);};}for(var e in events){if(events[_0x7544('0x5')](e)){var event=events[e];ChatWebsite[_0x7544('0x6')](e,emitEvent(event));}}module[_0x7544('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0x3a32=['update','remove','emit','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x158b90,_0x597dbc){var _0x141dce=function(_0x5c9f68){while(--_0x5c9f68){_0x158b90['push'](_0x158b90['shift']());}};_0x141dce(++_0x597dbc);}(_0x3a32,0x9b));var _0x23a3=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x3a32[_0x160c73];return _0xd9302;};'use strict';var EventEmitter=require(_0x23a3('0x0'));var ChatWebsite=require(_0x23a3('0x1'))['db'][_0x23a3('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x23a3('0x3')](0x0);var events={'afterCreate':_0x23a3('0x4'),'afterUpdate':_0x23a3('0x5'),'afterDestroy':_0x23a3('0x6')};function emitEvent(_0x4a1378){return function(_0x480d99,_0xc06a55,_0xd3df2f){ChatWebsiteEvents['emit'](_0x4a1378+':'+_0x480d99['id'],_0x480d99);ChatWebsiteEvents[_0x23a3('0x7')](_0x4a1378,_0x480d99);_0xd3df2f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x23a3('0x8')](e,emitEvent(event));}}module[_0x23a3('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index c52de0f..d624f64 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 _0x6470=['bluebird','path','rimraf','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment'];(function(_0x6392e4,_0x4bb7ea){var _0x4f0319=function(_0x433cda){while(--_0x433cda){_0x6392e4['push'](_0x6392e4['shift']());}};_0x4f0319(++_0x4bb7ea);}(_0x6470,0x124));var _0x0647=function(_0x34872e,_0x1f18a3){_0x34872e=_0x34872e-0x0;var _0x2e3319=_0x6470[_0x34872e];return _0x2e3319;};'use strict';var _=require(_0x0647('0x0'));var util=require(_0x0647('0x1'));var logger=require(_0x0647('0x2'))(_0x0647('0x3'));var moment=require(_0x0647('0x4'));var BPromise=require(_0x0647('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0647('0x6'));var rimraf=require(_0x0647('0x7'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x0647('0x8')]=function(_0x5870ca,_0x35bdee){return _0x5870ca['define'](_0x0647('0x9'),attributes,{'tableName':_0x0647('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95d9=['./chatWebsite.attributes','define','ChatWebsite','lodash','api','moment','request-promise','path','rimraf'];(function(_0x153022,_0xefa3ec){var _0x1f6ab1=function(_0x1f47f8){while(--_0x1f47f8){_0x153022['push'](_0x153022['shift']());}};_0x1f6ab1(++_0xefa3ec);}(_0x95d9,0xdb));var _0x995d=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x95d9[_0xac151d];return _0x111dba;};'use strict';var _=require(_0x995d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x995d('0x1'));var moment=require(_0x995d('0x2'));var BPromise=require('bluebird');var rp=require(_0x995d('0x3'));var fs=require('fs');var path=require(_0x995d('0x4'));var rimraf=require(_0x995d('0x5'));var config=require('../../config/environment');var attributes=require(_0x995d('0x6'));module['exports']=function(_0xef0b0e,_0x49f5c4){return _0xef0b0e[_0x995d('0x7')](_0x995d('0x8'),attributes,{'tableName':'chat_websites','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 1d652ba..99f592b 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 _0xdcdd=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2a1513,_0x425364){var _0x1a1a10=function(_0x5463a6){while(--_0x5463a6){_0x2a1513['push'](_0x2a1513['shift']());}};_0x1a1a10(++_0x425364);}(_0xdcdd,0xbf));var _0xddcd=function(_0x42c28d,_0x3d4777){_0x42c28d=_0x42c28d-0x0;var _0x585c2f=_0xdcdd[_0x42c28d];return _0x585c2f;};'use strict';var _=require(_0xddcd('0x0'));var util=require(_0xddcd('0x1'));var moment=require(_0xddcd('0x2'));var BPromise=require('bluebird');var rs=require(_0xddcd('0x3'));var fs=require('fs');var Redis=require(_0xddcd('0x4'));var db=require(_0xddcd('0x5'))['db'];var utils=require(_0xddcd('0x6'));var logger=require(_0xddcd('0x7'))(_0xddcd('0x8'));var config=require(_0xddcd('0x9'));var jayson=require(_0xddcd('0xa'));var client=jayson[_0xddcd('0xb')][_0xddcd('0xc')]({'port':0x232a});config[_0xddcd('0xd')]=_[_0xddcd('0xe')](config[_0xddcd('0xd')],{'host':_0xddcd('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xddcd('0xd')]));require(_0xddcd('0x10'))[_0xddcd('0x11')](socket);function respondWithRpcPromise(_0x1b21be,_0x464043,_0x2422c9){return new BPromise(function(_0x57a6f4,_0xe599c8){return client[_0xddcd('0x12')](_0x1b21be,_0x2422c9)[_0xddcd('0x13')](function(_0x53789a){logger[_0xddcd('0x14')](_0xddcd('0x15'),_0x464043,_0xddcd('0x16'));logger[_0xddcd('0x17')](_0xddcd('0x18'),_0x464043,_0xddcd('0x16'),JSON[_0xddcd('0x19')](_0x53789a));if(_0x53789a[_0xddcd('0x1a')]){if(_0x53789a[_0xddcd('0x1a')][_0xddcd('0x1b')]===0x1f4){logger['error'](_0xddcd('0x15'),_0x464043,_0x53789a['error'][_0xddcd('0x1c')]);return _0xe599c8(_0x53789a['error'][_0xddcd('0x1c')]);}logger['error'](_0xddcd('0x15'),_0x464043,_0x53789a[_0xddcd('0x1a')][_0xddcd('0x1c')]);return _0x57a6f4(_0x53789a[_0xddcd('0x1a')][_0xddcd('0x1c')]);}else{logger[_0xddcd('0x14')](_0xddcd('0x15'),_0x464043,_0xddcd('0x16'));_0x57a6f4(_0x53789a[_0xddcd('0x1d')][_0xddcd('0x1c')]);}})[_0xddcd('0x1e')](function(_0x5d3206){logger[_0xddcd('0x1a')](_0xddcd('0x15'),_0x464043,_0x5d3206);_0xe599c8(_0x5d3206);});});} \ No newline at end of file +var _0xe5be=['error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','localhost','socket.io-emitter','redis','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x379dc2,_0x35509e){var _0x1935dd=function(_0x10ca49){while(--_0x10ca49){_0x379dc2['push'](_0x379dc2['shift']());}};_0x1935dd(++_0x35509e);}(_0xe5be,0x109));var _0xee5b=function(_0x244eb6,_0x29c6fd){_0x244eb6=_0x244eb6-0x0;var _0x1e13e0=_0xe5be[_0x244eb6];return _0x1e13e0;};'use strict';var _=require(_0xee5b('0x0'));var util=require(_0xee5b('0x1'));var moment=require(_0xee5b('0x2'));var BPromise=require(_0xee5b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee5b('0x4'));var db=require(_0xee5b('0x5'))['db'];var utils=require(_0xee5b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xee5b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xee5b('0x8')][_0xee5b('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xee5b('0xa'),'port':0x18eb});var socket=require(_0xee5b('0xb'))(new Redis(config[_0xee5b('0xc')]));require(_0xee5b('0xd'))[_0xee5b('0xe')](socket);function respondWithRpcPromise(_0x17a6ed,_0x4c8c2e,_0x2c4ae4){return new BPromise(function(_0x7a6b88,_0x10b415){return client[_0xee5b('0xf')](_0x17a6ed,_0x2c4ae4)[_0xee5b('0x10')](function(_0x23bfc8){logger[_0xee5b('0x11')](_0xee5b('0x12'),_0x4c8c2e,_0xee5b('0x13'));logger[_0xee5b('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4c8c2e,_0xee5b('0x13'),JSON['stringify'](_0x23bfc8));if(_0x23bfc8[_0xee5b('0x15')]){if(_0x23bfc8['error'][_0xee5b('0x16')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4c8c2e,_0x23bfc8[_0xee5b('0x15')][_0xee5b('0x17')]);return _0x10b415(_0x23bfc8[_0xee5b('0x15')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4c8c2e,_0x23bfc8[_0xee5b('0x15')][_0xee5b('0x17')]);return _0x7a6b88(_0x23bfc8[_0xee5b('0x15')][_0xee5b('0x17')]);}else{logger[_0xee5b('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x4c8c2e,_0xee5b('0x13'));_0x7a6b88(_0x23bfc8[_0xee5b('0x18')][_0xee5b('0x17')]);}})[_0xee5b('0x19')](function(_0x4acbeb){logger[_0xee5b('0x15')](_0xee5b('0x12'),_0x4c8c2e,_0x4acbeb);_0x10b415(_0x4acbeb);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index d0b5b7b..ae94a9d 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 _0x610c=['./chatWebsite.events','save','remove','update','removeListener','register','length'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x610c,0x85));var _0xc610=function(_0x42ac5a,_0x1444d6){_0x42ac5a=_0x42ac5a-0x0;var _0x29505d=_0x610c[_0x42ac5a];return _0x29505d;};'use strict';var ChatWebsiteEvents=require(_0xc610('0x0'));var events=[_0xc610('0x1'),_0xc610('0x2'),_0xc610('0x3')];function createListener(_0x32dd71,_0x4bbe1b){return function(_0x5d2c9b){_0x4bbe1b['emit'](_0x32dd71,_0x5d2c9b);};}function removeListener(_0x2e206c,_0x5f4801){return function(){ChatWebsiteEvents[_0xc610('0x4')](_0x2e206c,_0x5f4801);};}exports[_0xc610('0x5')]=function(_0x54cb4e){for(var _0x474b3b=0x0,_0x4f009a=events[_0xc610('0x6')];_0x474b3b<_0x4f009a;_0x474b3b++){var _0x530c5b=events[_0x474b3b];var _0x1be0d5=createListener('chatWebsite:'+_0x530c5b,_0x54cb4e);ChatWebsiteEvents['on'](_0x530c5b,_0x1be0d5);}}; \ No newline at end of file +var _0x9e17=['register','length','chatWebsite:','./chatWebsite.events','emit','removeListener'];(function(_0x47b673,_0x3d6eeb){var _0x13b656=function(_0x221e42){while(--_0x221e42){_0x47b673['push'](_0x47b673['shift']());}};_0x13b656(++_0x3d6eeb);}(_0x9e17,0x141));var _0x79e1=function(_0x404b9a,_0xca0480){_0x404b9a=_0x404b9a-0x0;var _0x30ba61=_0x9e17[_0x404b9a];return _0x30ba61;};'use strict';var ChatWebsiteEvents=require(_0x79e1('0x0'));var events=['save','remove','update'];function createListener(_0x399f51,_0x2c625f){return function(_0x119221){_0x2c625f[_0x79e1('0x1')](_0x399f51,_0x119221);};}function removeListener(_0x553f9b,_0x13d06f){return function(){ChatWebsiteEvents[_0x79e1('0x2')](_0x553f9b,_0x13d06f);};}exports[_0x79e1('0x3')]=function(_0x525df1){for(var _0xbdbdbc=0x0,_0x1b9822=events[_0x79e1('0x4')];_0xbdbdbc<_0x1b9822;_0xbdbdbc++){var _0x28c56d=events[_0xbdbdbc];var _0xc8e2f5=createListener(_0x79e1('0x5')+_0x28c56d,_0x525df1);ChatWebsiteEvents['on'](_0x28c56d,_0xc8e2f5);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 7921d5a..4cd3a28 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 _0x275c=['now','originalname','file','addLogo','diskStorage','root','server/files/images/avatars/','/:id/avatar','single','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','any','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','/:id/users','addAgents','put','update','delete','/:id','destroy','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','index','/describe','describe','show','get','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','addAnswer','join','server/files/images/logos/','format','%s-%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x275c,0x70));var _0xc275=function(_0x19dc1b,_0x35ffcb){_0x19dc1b=_0x19dc1b-0x0;var _0x1fbaf5=_0x275c[_0x19dc1b];return _0x1fbaf5;};'use strict';var multer=require(_0xc275('0x0'));var util=require(_0xc275('0x1'));var path=require(_0xc275('0x2'));var timeout=require(_0xc275('0x3'));var express=require(_0xc275('0x4'));var router=express[_0xc275('0x5')]();var fs_extra=require(_0xc275('0x6'));var auth=require(_0xc275('0x7'));var interaction=require(_0xc275('0x8'));var config=require('../../config/environment');var controller=require(_0xc275('0x9'));router['get']('/',auth[_0xc275('0xa')](),controller[_0xc275('0xb')]);router['get'](_0xc275('0xc'),auth[_0xc275('0xa')](),controller[_0xc275('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc275('0xe')]);router[_0xc275('0xf')](_0xc275('0x10'),auth[_0xc275('0xa')](),controller[_0xc275('0x11')]);router['get'](_0xc275('0x12'),auth[_0xc275('0xa')](),controller['getAnswers']);router[_0xc275('0xf')](_0xc275('0x13'),controller[_0xc275('0x14')]);router[_0xc275('0xf')]('/:id/avatar',controller[_0xc275('0x15')]);router['get']('/:id/customer_avatar',controller[_0xc275('0x16')]);router[_0xc275('0xf')](_0xc275('0x17'),controller[_0xc275('0x18')]);router[_0xc275('0xf')](_0xc275('0x19'),auth['isAuthenticated'](),controller[_0xc275('0x1a')]);router['get']('/:id/snippet',controller[_0xc275('0x1b')]);router['get'](_0xc275('0x1c'),auth[_0xc275('0xa')](),controller[_0xc275('0x1d')]);router[_0xc275('0xf')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xc275('0x1e')]);router['get'](_0xc275('0x1f'),controller[_0xc275('0x20')]);router[_0xc275('0xf')](_0xc275('0x21'),auth[_0xc275('0xa')](),controller[_0xc275('0x22')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xc275('0x23')]);router[_0xc275('0x24')]('/',auth[_0xc275('0xa')](),controller['create']);router[_0xc275('0x24')](_0xc275('0x10'),auth[_0xc275('0xa')](),controller['addDisposition']);router['post'](_0xc275('0x12'),auth[_0xc275('0xa')](),controller[_0xc275('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3c870e,_0x508d0f,_0x4a0d93){_0x4a0d93(null,path[_0xc275('0x26')](config['root'],_0xc275('0x27')));},'filename':function(_0x21fc3c,_0x33a720,_0x28893e){_0x28893e(null,util[_0xc275('0x28')](_0xc275('0x29'),Date[_0xc275('0x2a')](),_0x33a720[_0xc275('0x2b')]));}})});router[_0xc275('0x24')]('/:id/logo',upload['single'](_0xc275('0x2c')),controller[_0xc275('0x2d')]);var upload=multer({'storage':multer[_0xc275('0x2e')]({'destination':function(_0x5009fd,_0x5731d4,_0x46a594){_0x46a594(null,path[_0xc275('0x26')](config[_0xc275('0x2f')],_0xc275('0x30')));},'filename':function(_0x26a372,_0xebc708,_0x1a12a5){_0x1a12a5(null,util[_0xc275('0x28')](_0xc275('0x29'),Date[_0xc275('0x2a')](),_0xebc708[_0xc275('0x2b')]));}})});router[_0xc275('0x24')](_0xc275('0x31'),upload[_0xc275('0x32')](_0xc275('0x2c')),controller[_0xc275('0x33')]);var upload=multer({'storage':multer[_0xc275('0x2e')]({'destination':function(_0x94f9a7,_0x1c5dc4,_0x40d593){_0x40d593(null,path[_0xc275('0x26')](config[_0xc275('0x2f')],_0xc275('0x30')));},'filename':function(_0x3755b5,_0x49a42d,_0x3d8d82){_0x3d8d82(null,util[_0xc275('0x28')](_0xc275('0x29'),Date[_0xc275('0x2a')](),_0x49a42d[_0xc275('0x2b')]));}})});router['post']('/:id/customer_avatar',upload[_0xc275('0x32')](_0xc275('0x2c')),controller[_0xc275('0x34')]);var upload=multer({'storage':multer[_0xc275('0x2e')]({'destination':function(_0x741361,_0x4ebdf2,_0x21fb3d){_0x21fb3d(null,path['join'](config[_0xc275('0x2f')],'server/files/images/avatars/'));},'filename':function(_0x577f69,_0x2aff31,_0x41270d){_0x41270d(null,util[_0xc275('0x28')](_0xc275('0x29'),Date[_0xc275('0x2a')](),_0x2aff31[_0xc275('0x2b')]));}})});router[_0xc275('0x24')](_0xc275('0x17'),upload['single'](_0xc275('0x2c')),controller[_0xc275('0x35')]);router[_0xc275('0x24')](_0xc275('0x36'),controller[_0xc275('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0xc275('0x2e')]({'destination':function(_0x148efa,_0x3c20c3,_0x4e254c){const _0x4c63a0=path[_0xc275('0x26')](config[_0xc275('0x2f')],_0xc275('0x38'),_0xc275('0x39'),_0xc275('0x3a'));fs_extra[_0xc275('0x3b')](_0x4c63a0,function(){_0x4e254c(null,_0x4c63a0);});},'filename':function(_0x6aed59,_0xbc044c,_0x46c193){const _0x3043e0=_0xbc044c[_0xc275('0x2b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x40ddd9=path[_0xc275('0x3c')](_0x3043e0);const _0x2d046d=Date[_0xc275('0x2a')]()+'-'+_0x3043e0[_0xc275('0x3d')](_0x40ddd9,'')+_0x40ddd9;_0x46c193(null,_0x2d046d);}})});router['post']('/:id/offline',offlineUploadMulter[_0xc275('0x3e')](),controller[_0xc275('0x3f')]);router[_0xc275('0x24')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc275('0x40')]);router[_0xc275('0x24')](_0xc275('0x1c'),auth[_0xc275('0xa')](),controller[_0xc275('0x41')]);router[_0xc275('0x24')](_0xc275('0x42'),auth[_0xc275('0xa')](),controller[_0xc275('0x43')]);router[_0xc275('0x24')](_0xc275('0x44'),auth[_0xc275('0xa')](),controller[_0xc275('0x45')]);router[_0xc275('0x46')]('/:id',auth[_0xc275('0xa')](),controller[_0xc275('0x47')]);router[_0xc275('0x48')](_0xc275('0x49'),auth['isAuthenticated'](),controller[_0xc275('0x4a')]);router[_0xc275('0x48')](_0xc275('0x10'),auth[_0xc275('0xa')](),controller['removeDispositions']);router[_0xc275('0x48')](_0xc275('0x12'),auth[_0xc275('0xa')](),controller[_0xc275('0x4b')]);router['delete'](_0xc275('0x44'),auth[_0xc275('0xa')](),controller[_0xc275('0x4c')]);module['exports']=router; \ No newline at end of file +var _0x3938=['now','originalname','single','file','addLogo','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','update','delete','/:id/dispositions','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','get','isAuthenticated','describe','/:id','show','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/snippet','getSnippet','/:id/applications','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s'];(function(_0x3c4dad,_0x25ffd5){var _0x1a4f49=function(_0x6fe6c){while(--_0x6fe6c){_0x3c4dad['push'](_0x3c4dad['shift']());}};_0x1a4f49(++_0x25ffd5);}(_0x3938,0x17a));var _0x8393=function(_0x55e287,_0x36472d){_0x55e287=_0x55e287-0x0;var _0x582ca5=_0x3938[_0x55e287];return _0x582ca5;};'use strict';var multer=require(_0x8393('0x0'));var util=require(_0x8393('0x1'));var path=require(_0x8393('0x2'));var timeout=require(_0x8393('0x3'));var express=require(_0x8393('0x4'));var router=express[_0x8393('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8393('0x6'));var config=require(_0x8393('0x7'));var controller=require(_0x8393('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x8393('0x9')]);router[_0x8393('0xa')]('/describe',auth[_0x8393('0xb')](),controller[_0x8393('0xc')]);router[_0x8393('0xa')](_0x8393('0xd'),auth[_0x8393('0xb')](),controller[_0x8393('0xe')]);router[_0x8393('0xa')]('/:id/dispositions',auth[_0x8393('0xb')](),controller[_0x8393('0xf')]);router[_0x8393('0xa')]('/:id/canned_answers',auth[_0x8393('0xb')](),controller[_0x8393('0x10')]);router[_0x8393('0xa')](_0x8393('0x11'),controller[_0x8393('0x12')]);router[_0x8393('0xa')](_0x8393('0x13'),controller[_0x8393('0x14')]);router[_0x8393('0xa')](_0x8393('0x15'),controller[_0x8393('0x16')]);router['get'](_0x8393('0x17'),controller['getSystemAvatar']);router[_0x8393('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x8393('0xa')](_0x8393('0x18'),controller[_0x8393('0x19')]);router[_0x8393('0xa')](_0x8393('0x1a'),auth['isAuthenticated'](),controller['getApplications']);router[_0x8393('0xa')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['getProactiveActions']);router['get'](_0x8393('0x1b'),controller[_0x8393('0x1c')]);router[_0x8393('0xa')]('/:id/offline_messages',auth[_0x8393('0xb')](),controller[_0x8393('0x1d')]);router['get'](_0x8393('0x1e'),auth[_0x8393('0xb')](),controller[_0x8393('0x1f')]);router[_0x8393('0x20')]('/',auth[_0x8393('0xb')](),controller[_0x8393('0x21')]);router[_0x8393('0x20')]('/:id/dispositions',auth[_0x8393('0xb')](),controller[_0x8393('0x22')]);router[_0x8393('0x20')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8393('0x23')]);var upload=multer({'storage':multer[_0x8393('0x24')]({'destination':function(_0x9d55b0,_0x34f0b5,_0x5b665e){_0x5b665e(null,path[_0x8393('0x25')](config[_0x8393('0x26')],_0x8393('0x27')));},'filename':function(_0x5453f0,_0x1a1b89,_0x4de7ba){_0x4de7ba(null,util[_0x8393('0x28')](_0x8393('0x29'),Date[_0x8393('0x2a')](),_0x1a1b89[_0x8393('0x2b')]));}})});router[_0x8393('0x20')](_0x8393('0x11'),upload[_0x8393('0x2c')](_0x8393('0x2d')),controller[_0x8393('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xa4cbbb,_0x255dce,_0x41c879){_0x41c879(null,path[_0x8393('0x25')](config[_0x8393('0x26')],'server/files/images/avatars/'));},'filename':function(_0x8a3e40,_0x19e07e,_0x3dd03b){_0x3dd03b(null,util[_0x8393('0x28')](_0x8393('0x29'),Date[_0x8393('0x2a')](),_0x19e07e[_0x8393('0x2b')]));}})});router[_0x8393('0x20')](_0x8393('0x13'),upload['single'](_0x8393('0x2d')),controller[_0x8393('0x2f')]);var upload=multer({'storage':multer[_0x8393('0x24')]({'destination':function(_0x2bcc3d,_0x410937,_0x570e20){_0x570e20(null,path[_0x8393('0x25')](config[_0x8393('0x26')],'server/files/images/avatars/'));},'filename':function(_0xdacd88,_0x387872,_0x2c3535){_0x2c3535(null,util['format']('%s-%s',Date[_0x8393('0x2a')](),_0x387872[_0x8393('0x2b')]));}})});router[_0x8393('0x20')](_0x8393('0x15'),upload[_0x8393('0x2c')]('file'),controller[_0x8393('0x30')]);var upload=multer({'storage':multer[_0x8393('0x24')]({'destination':function(_0x118f8c,_0x5c52ca,_0x3c7053){_0x3c7053(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x396cc9,_0x247be8,_0x2b97e4){_0x2b97e4(null,util[_0x8393('0x28')](_0x8393('0x29'),Date[_0x8393('0x2a')](),_0x247be8[_0x8393('0x2b')]));}})});router['post'](_0x8393('0x17'),upload[_0x8393('0x2c')](_0x8393('0x2d')),controller[_0x8393('0x31')]);router['post'](_0x8393('0x32'),controller[_0x8393('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x8393('0x24')]({'destination':function(_0x960d82,_0x47ada8,_0x33fdc5){const _0x1bda7f=path['join'](config['root'],'server/files',_0x8393('0x34'),'offline-chat');fs_extra['ensureDir'](_0x1bda7f,function(){_0x33fdc5(null,_0x1bda7f);});},'filename':function(_0x561c93,_0x22188c,_0x8b83fa){const _0x5ab529=_0x22188c[_0x8393('0x2b')][_0x8393('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x514e0c=path[_0x8393('0x36')](_0x5ab529);const _0x367b95=Date['now']()+'-'+_0x5ab529['replace'](_0x514e0c,'')+_0x514e0c;_0x8b83fa(null,_0x367b95);}})});router['post'](_0x8393('0x37'),offlineUploadMulter[_0x8393('0x38')](),controller[_0x8393('0x39')]);router[_0x8393('0x20')](_0x8393('0x3a'),auth[_0x8393('0xb')](),controller[_0x8393('0x3b')]);router['post'](_0x8393('0x1a'),auth['isAuthenticated'](),controller[_0x8393('0x3c')]);router[_0x8393('0x20')](_0x8393('0x3d'),auth[_0x8393('0xb')](),controller[_0x8393('0x3e')]);router[_0x8393('0x20')](_0x8393('0x1e'),auth[_0x8393('0xb')](),controller['addAgents']);router['put'](_0x8393('0xd'),auth[_0x8393('0xb')](),controller[_0x8393('0x3f')]);router['delete'](_0x8393('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x8393('0x40')](_0x8393('0x41'),auth[_0x8393('0xb')](),controller[_0x8393('0x42')]);router[_0x8393('0x40')](_0x8393('0x43'),auth[_0x8393('0xb')](),controller[_0x8393('0x44')]);router[_0x8393('0x40')](_0x8393('0x1e'),auth['isAuthenticated'](),controller[_0x8393('0x45')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 7152e5c..763dca3 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 _0x1af5=['Google','sequelize','STRING','ENUM','AmazonAWS'];(function(_0xdb23fa,_0x254851){var _0x157954=function(_0x39346a){while(--_0x39346a){_0xdb23fa['push'](_0xdb23fa['shift']());}};_0x157954(++_0x254851);}(_0x1af5,0x17d));var _0x51af=function(_0x5424c4,_0x591b70){_0x5424c4=_0x5424c4-0x0;var _0x157cac=_0x1af5[_0x5424c4];return _0x157cac;};'use strict';var Sequelize=require(_0x51af('0x0'));module['exports']={'name':{'type':Sequelize[_0x51af('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x51af('0x2')](_0x51af('0x3'),_0x51af('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x51af('0x1')]},'data2':{'type':Sequelize[_0x51af('0x1')]}}; \ No newline at end of file +var _0xd43e=['Google','sequelize','STRING','ENUM','AmazonAWS'];(function(_0x1e238c,_0x4a17d2){var _0x308f0d=function(_0x49dd90){while(--_0x49dd90){_0x1e238c['push'](_0x1e238c['shift']());}};_0x308f0d(++_0x4a17d2);}(_0xd43e,0x88));var _0xed43=function(_0x4a6470,_0x167a61){_0x4a6470=_0x4a6470-0x0;var _0x5203d7=_0xd43e[_0x4a6470];return _0x5203d7;};'use strict';var Sequelize=require(_0xed43('0x0'));module['exports']={'name':{'type':Sequelize[_0xed43('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xed43('0x2')](_0xed43('0x3'),_0xed43('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index cd1cdf5..de98b17 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(_0x5d9de5,_0x19608d){var _0x1e188e=function(_0xdc0762){while(--_0xdc0762){_0x5d9de5['push'](_0x5d9de5['shift']());}};_0x1e188e(++_0x19608d);}(_0x2ef3,0xba));var _0x32ef=function(_0x5075a5,_0x175b42){_0x5075a5=_0x5075a5-0x0;var _0x31cb0f=_0x2ef3[_0x5075a5];return _0x31cb0f;};'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 _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(_0xb096ef,_0x20ebdf){var _0x5ac5b=function(_0x11b4be){while(--_0x11b4be){_0xb096ef['push'](_0xb096ef['shift']());}};_0x5ac5b(++_0x20ebdf);}(_0x2ef3,0xba));var _0x32ef=function(_0x29f0c7,_0x41bb6d){_0x29f0c7=_0x29f0c7-0x0;var _0xb09310=_0x2ef3[_0x29f0c7];return _0xb09310;};'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 diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 777415c..3a3e722 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 _0xd796=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers'];(function(_0x2d4c16,_0x1cc64a){var _0x354ed8=function(_0x1aee44){while(--_0x1aee44){_0x2d4c16['push'](_0x2d4c16['shift']());}};_0x354ed8(++_0x1cc64a);}(_0xd796,0xea));var _0x6d79=function(_0x506550,_0x5d2359){_0x506550=_0x506550-0x0;var _0x344791=_0xd796[_0x506550];return _0x344791;};'use strict';var _=require(_0x6d79('0x0'));var util=require('util');var logger=require(_0x6d79('0x1'))(_0x6d79('0x2'));var moment=require(_0x6d79('0x3'));var BPromise=require(_0x6d79('0x4'));var rp=require(_0x6d79('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6d79('0x6'));var config=require(_0x6d79('0x7'));var attributes=require(_0x6d79('0x8'));module[_0x6d79('0x9')]=function(_0x57d7bd,_0x46d95e){return _0x57d7bd[_0x6d79('0xa')](_0x6d79('0xb'),attributes,{'tableName':_0x6d79('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14bb=['bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','lodash','util','api','moment'];(function(_0x27d527,_0x529167){var _0x4a09bd=function(_0x4a1031){while(--_0x4a1031){_0x27d527['push'](_0x27d527['shift']());}};_0x4a09bd(++_0x529167);}(_0x14bb,0x1e8));var _0xb14b=function(_0x5486c2,_0x30c249){_0x5486c2=_0x5486c2-0x0;var _0x45371c=_0x14bb[_0x5486c2];return _0x45371c;};'use strict';var _=require(_0xb14b('0x0'));var util=require(_0xb14b('0x1'));var logger=require('../../config/logger')(_0xb14b('0x2'));var moment=require(_0xb14b('0x3'));var BPromise=require(_0xb14b('0x4'));var rp=require(_0xb14b('0x5'));var fs=require('fs');var path=require(_0xb14b('0x6'));var rimraf=require(_0xb14b('0x7'));var config=require(_0xb14b('0x8'));var attributes=require(_0xb14b('0x9'));module[_0xb14b('0xa')]=function(_0x1db7e6,_0x5c3d29){return _0x1db7e6['define'](_0xb14b('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 f69b54e..6d0f449 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 _0x93e9=['request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s'];(function(_0x295147,_0x5abf17){var _0x39ce09=function(_0x2b7d92){while(--_0x2b7d92){_0x295147['push'](_0x295147['shift']());}};_0x39ce09(++_0x5abf17);}(_0x93e9,0xcc));var _0x993e=function(_0x38db20,_0x1759cb){_0x38db20=_0x38db20-0x0;var _0x1918f4=_0x93e9[_0x38db20];return _0x1918f4;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var moment=require(_0x993e('0x2'));var BPromise=require(_0x993e('0x3'));var rs=require(_0x993e('0x4'));var fs=require('fs');var Redis=require(_0x993e('0x5'));var db=require(_0x993e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x993e('0x7'));var config=require(_0x993e('0x8'));var jayson=require(_0x993e('0x9'));var client=jayson[_0x993e('0xa')][_0x993e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2366d9,_0x12ac94,_0x1aef74){return new BPromise(function(_0x53d0ce,_0x4701d3){return client[_0x993e('0xc')](_0x2366d9,_0x1aef74)[_0x993e('0xd')](function(_0x280291){logger[_0x993e('0xe')](_0x993e('0xf'),_0x12ac94,_0x993e('0x10'));logger['debug'](_0x993e('0x11'),_0x12ac94,_0x993e('0x10'),JSON['stringify'](_0x280291));if(_0x280291['error']){if(_0x280291[_0x993e('0x12')]['code']===0x1f4){logger[_0x993e('0x12')]('CloudProvider,\x20%s,\x20%s',_0x12ac94,_0x280291['error'][_0x993e('0x13')]);return _0x4701d3(_0x280291[_0x993e('0x12')][_0x993e('0x13')]);}logger[_0x993e('0x12')](_0x993e('0xf'),_0x12ac94,_0x280291[_0x993e('0x12')][_0x993e('0x13')]);return _0x53d0ce(_0x280291[_0x993e('0x12')][_0x993e('0x13')]);}else{logger[_0x993e('0xe')](_0x993e('0xf'),_0x12ac94,_0x993e('0x10'));_0x53d0ce(_0x280291[_0x993e('0x14')][_0x993e('0x13')]);}})[_0x993e('0x15')](function(_0x454475){logger[_0x993e('0x12')]('CloudProvider,\x20%s,\x20%s',_0x12ac94,_0x454475);_0x4701d3(_0x454475);});});} \ No newline at end of file +var _0x073d=['request','then','info','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x073d,0xd2));var _0xd073=function(_0x312962,_0x282d40){_0x312962=_0x312962-0x0;var _0x3e85d0=_0x073d[_0x312962];return _0x3e85d0;};'use strict';var _=require('lodash');var util=require(_0xd073('0x0'));var moment=require(_0xd073('0x1'));var BPromise=require(_0xd073('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd073('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd073('0x4'));var logger=require(_0xd073('0x5'))('rpc');var config=require(_0xd073('0x6'));var jayson=require(_0xd073('0x7'));var client=jayson[_0xd073('0x8')][_0xd073('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f5792,_0x3541cd,_0x440c91){return new BPromise(function(_0x409e4a,_0x199033){return client[_0xd073('0xa')](_0x2f5792,_0x440c91)[_0xd073('0xb')](function(_0x1c9295){logger[_0xd073('0xc')](_0xd073('0xd'),_0x3541cd,'request\x20sent');logger['debug'](_0xd073('0xe'),_0x3541cd,'request\x20sent',JSON[_0xd073('0xf')](_0x1c9295));if(_0x1c9295[_0xd073('0x10')]){if(_0x1c9295[_0xd073('0x10')][_0xd073('0x11')]===0x1f4){logger[_0xd073('0x10')]('CloudProvider,\x20%s,\x20%s',_0x3541cd,_0x1c9295[_0xd073('0x10')][_0xd073('0x12')]);return _0x199033(_0x1c9295[_0xd073('0x10')][_0xd073('0x12')]);}logger['error'](_0xd073('0xd'),_0x3541cd,_0x1c9295[_0xd073('0x10')]['message']);return _0x409e4a(_0x1c9295[_0xd073('0x10')][_0xd073('0x12')]);}else{logger[_0xd073('0xc')](_0xd073('0xd'),_0x3541cd,'request\x20sent');_0x409e4a(_0x1c9295[_0xd073('0x13')]['message']);}})['catch'](function(_0x195c5d){logger[_0xd073('0x10')](_0xd073('0xd'),_0x3541cd,_0x195c5d);_0x199033(_0x195c5d);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 649fec5..9fe0c8e 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 _0xb664=['../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x41f5a6,_0xb35c51){var _0x241efd=function(_0x2cfaa5){while(--_0x2cfaa5){_0x41f5a6['push'](_0x41f5a6['shift']());}};_0x241efd(++_0xb35c51);}(_0xb664,0x163));var _0x4b66=function(_0x5cec3d,_0x1e7628){_0x5cec3d=_0x5cec3d-0x0;var _0x3eceb6=_0xb664[_0x5cec3d];return _0x3eceb6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4b66('0x0'));var timeout=require('connect-timeout');var express=require(_0x4b66('0x1'));var router=express[_0x4b66('0x2')]();var fs_extra=require(_0x4b66('0x3'));var auth=require(_0x4b66('0x4'));var interaction=require(_0x4b66('0x5'));var config=require(_0x4b66('0x6'));var controller=require('./cloudProvider.controller');router['get']('/',auth[_0x4b66('0x7')](),controller['index']);router[_0x4b66('0x8')](_0x4b66('0x9'),auth[_0x4b66('0x7')](),controller[_0x4b66('0xa')]);router[_0x4b66('0xb')]('/',auth[_0x4b66('0x7')](),controller[_0x4b66('0xc')]);router[_0x4b66('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x4b66('0xe')]);router[_0x4b66('0xf')](_0x4b66('0x9'),auth['isAuthenticated'](),controller[_0x4b66('0x10')]);module[_0x4b66('0x11')]=router; \ No newline at end of file +var _0x05f3=['destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./cloudProvider.controller','index','get','/:id','isAuthenticated','show','post','update','delete'];(function(_0x550f45,_0x506e32){var _0x4fa063=function(_0x3b76c0){while(--_0x3b76c0){_0x550f45['push'](_0x550f45['shift']());}};_0x4fa063(++_0x506e32);}(_0x05f3,0xf0));var _0x305f=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0x05f3[_0x3b90ab];return _0x206e92;};'use strict';var multer=require('multer');var util=require(_0x305f('0x0'));var path=require(_0x305f('0x1'));var timeout=require(_0x305f('0x2'));var express=require(_0x305f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x305f('0x4'));var config=require(_0x305f('0x5'));var controller=require(_0x305f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x305f('0x7')]);router[_0x305f('0x8')](_0x305f('0x9'),auth[_0x305f('0xa')](),controller[_0x305f('0xb')]);router[_0x305f('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x305f('0x9'),auth['isAuthenticated'](),controller[_0x305f('0xd')]);router[_0x305f('0xe')](_0x305f('0x9'),auth[_0x305f('0xa')](),controller[_0x305f('0xf')]);module[_0x305f('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 f6a0280..47bea21 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 _0xfe62=['STRING','name','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe62,0x76));var _0x2fe6=function(_0x587a1f,_0x6f50b7){_0x587a1f=_0x587a1f-0x0;var _0x317bc1=_0xfe62[_0x587a1f];return _0x317bc1;};'use strict';var Sequelize=require(_0x2fe6('0x0'));module[_0x2fe6('0x1')]={'name':{'type':Sequelize[_0x2fe6('0x2')],'unique':_0x2fe6('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2fe6('0x2')]},'companyId':{'type':Sequelize[_0x2fe6('0x2')]},'website':{'type':Sequelize[_0x2fe6('0x2')]},'phone':{'type':Sequelize[_0x2fe6('0x2')]},'fax':{'type':Sequelize[_0x2fe6('0x2')]},'type':{'type':Sequelize[_0x2fe6('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x2fe6('0x2')]},'city':{'type':Sequelize[_0x2fe6('0x2')]},'country':{'type':Sequelize[_0x2fe6('0x2')]},'email':{'type':Sequelize[_0x2fe6('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2fe6('0x2')]},'sStreet':{'type':Sequelize[_0x2fe6('0x2')]},'sPostalCode':{'type':Sequelize[_0x2fe6('0x2')]},'sCity':{'type':Sequelize[_0x2fe6('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2fe6('0x2')]}}; \ No newline at end of file +var _0x5c4a=['STRING','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x28d25e,_0x3cdc7a){_0x28d25e=_0x28d25e-0x0;var _0x1be491=_0x5c4a[_0x28d25e];return _0x1be491;};'use strict';var Sequelize=require('sequelize');module[_0xa5c4('0x0')]={'name':{'type':Sequelize[_0xa5c4('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa5c4('0x1')]},'companyId':{'type':Sequelize[_0xa5c4('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa5c4('0x1')]},'fax':{'type':Sequelize[_0xa5c4('0x1')]},'type':{'type':Sequelize[_0xa5c4('0x1')]},'street':{'type':Sequelize[_0xa5c4('0x1')]},'postalCode':{'type':Sequelize[_0xa5c4('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa5c4('0x1')]},'email':{'type':Sequelize[_0xa5c4('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa5c4('0x1')]},'sStreet':{'type':Sequelize[_0xa5c4('0x1')]},'sPostalCode':{'type':Sequelize[_0xa5c4('0x1')]},'sCity':{'type':Sequelize[_0xa5c4('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa5c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 82b4533..9844a4b 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 _0xd07c=['Companies','UserProfileResource','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','rawAttributes','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','findOne','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','count','offset','Content-Range','reject','update','destroy','then','get'];(function(_0x3f5389,_0x55588e){var _0x1734a4=function(_0x1ef7d5){while(--_0x1ef7d5){_0x3f5389['push'](_0x3f5389['shift']());}};_0x1734a4(++_0x55588e);}(_0xd07c,0x8b));var _0xcd07=function(_0x49da9d,_0x5f1b0c){_0x49da9d=_0x49da9d-0x0;var _0x5e8c59=_0xd07c[_0x49da9d];return _0x5e8c59;};'use strict';var emlformat=require(_0xcd07('0x0'));var rimraf=require(_0xcd07('0x1'));var zipdir=require(_0xcd07('0x2'));var jsonpatch=require(_0xcd07('0x3'));var rp=require(_0xcd07('0x4'));var moment=require(_0xcd07('0x5'));var BPromise=require(_0xcd07('0x6'));var Mustache=require(_0xcd07('0x7'));var util=require(_0xcd07('0x8'));var path=require(_0xcd07('0x9'));var sox=require(_0xcd07('0xa'));var csv=require(_0xcd07('0xb'));var ejs=require(_0xcd07('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd07('0xd'));var squel=require(_0xcd07('0xe'));var crypto=require('crypto');var jsforce=require(_0xcd07('0xf'));var deskjs=require(_0xcd07('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcd07('0x11'));var Papa=require(_0xcd07('0x12'));var Redis=require(_0xcd07('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcd07('0x14'));var hardwareService=require(_0xcd07('0x15'));var logger=require(_0xcd07('0x16'))(_0xcd07('0x17'));var utils=require(_0xcd07('0x18'));var config=require(_0xcd07('0x19'));var licenseUtil=require(_0xcd07('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x461464,_0x1f17ed){_0x1f17ed=_0x1f17ed||0xcc;return function(_0x3deeee){if(_0x3deeee){return _0x461464['sendStatus'](_0x1f17ed);}return _0x461464[_0xcd07('0x1b')](_0x1f17ed)[_0xcd07('0x1c')]();};}function respondWithResult(_0x5cf843,_0x5c1d8f){_0x5c1d8f=_0x5c1d8f||0xc8;return function(_0x59afff){if(_0x59afff){return _0x5cf843[_0xcd07('0x1b')](_0x5c1d8f)[_0xcd07('0x1d')](_0x59afff);}};}function respondWithFilteredResult(_0x1ee739,_0x4f276f){return function(_0x4f1ad){if(_0x4f1ad){var _0x35733c=typeof _0x4f276f['offset']===_0xcd07('0x1e')&&typeof _0x4f276f['limit']===_0xcd07('0x1e');var _0x541bbb=_0x4f1ad[_0xcd07('0x1f')];var _0x490ce9=_0x35733c?0x0:_0x4f276f[_0xcd07('0x20')];var _0x10bce0=_0x35733c?_0x4f1ad['count']:_0x4f276f[_0xcd07('0x20')]+_0x4f276f['limit'];var _0x100959;if(_0x10bce0>=_0x541bbb){_0x10bce0=_0x541bbb;_0x100959=0xc8;}else{_0x100959=0xce;}_0x1ee739[_0xcd07('0x1b')](_0x100959);return _0x1ee739['set'](_0xcd07('0x21'),_0x490ce9+'-'+_0x10bce0+'/'+_0x541bbb)[_0xcd07('0x1d')](_0x4f1ad);}return null;};}function patchUpdates(_0x3bb0e7){return function(_0x2a2dd6){try{jsonpatch['apply'](_0x2a2dd6,_0x3bb0e7,!![]);}catch(_0x1f5ef5){return BPromise[_0xcd07('0x22')](_0x1f5ef5);}return _0x2a2dd6['save']();};}function saveUpdates(_0x50a95a,_0x329cde){return function(_0x15dd53){if(_0x15dd53){return _0x15dd53[_0xcd07('0x23')](_0x50a95a)['then'](function(_0xf22f95){return _0xf22f95;});}return null;};}function removeEntity(_0x593972,_0x256972){return function(_0xda9c83){if(_0xda9c83){return _0xda9c83[_0xcd07('0x24')]()[_0xcd07('0x25')](function(){var _0x2c4665=_0xda9c83[_0xcd07('0x26')]({'plain':!![]});var _0x59d315=_0xcd07('0x27');return db[_0xcd07('0x28')][_0xcd07('0x24')]({'where':{'type':_0x59d315,'resourceId':_0x2c4665['id']}})['then'](function(){return _0xda9c83;});})[_0xcd07('0x25')](function(){_0x593972[_0xcd07('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x597580,_0x5aadfc){return function(_0x4f169b){if(!_0x4f169b){_0x597580[_0xcd07('0x29')](0x194);}return _0x4f169b;};}function handleError(_0x47f5dc,_0x418e33){_0x418e33=_0x418e33||0x1f4;return function(_0x5dd418){logger[_0xcd07('0x2a')](_0x5dd418[_0xcd07('0x2b')]);if(_0x5dd418[_0xcd07('0x2c')]){delete _0x5dd418[_0xcd07('0x2c')];}_0x47f5dc[_0xcd07('0x1b')](_0x418e33)[_0xcd07('0x2d')](_0x5dd418);};}exports[_0xcd07('0x2e')]=function(_0xaacae3,_0x2886cd){var _0x33bbeb={},_0x35ae69={},_0x1dbc2f={'count':0x0,'rows':[]};return db[_0xcd07('0x2f')][_0xcd07('0x30')]()[_0xcd07('0x25')](function(_0x4151c5){_0x35ae69[_0xcd07('0x31')]=_[_0xcd07('0x32')](_0x4151c5);_0x35ae69[_0xcd07('0x33')]=_['keys'](_0xaacae3[_0xcd07('0x33')]);_0x35ae69[_0xcd07('0x34')]=_[_0xcd07('0x35')](_0x35ae69['model'],_0x35ae69[_0xcd07('0x33')]);_0x33bbeb[_0xcd07('0x36')]=_[_0xcd07('0x35')](_0x35ae69[_0xcd07('0x31')],qs['fields'](_0xaacae3[_0xcd07('0x33')]['fields']));_0x33bbeb[_0xcd07('0x36')]=_0x33bbeb['attributes']['length']?_0x33bbeb[_0xcd07('0x36')]:_0x35ae69[_0xcd07('0x31')];if(!_0xaacae3['query'][_0xcd07('0x37')](_0xcd07('0x38'))){_0x33bbeb[_0xcd07('0x39')]=qs[_0xcd07('0x39')](_0xaacae3[_0xcd07('0x33')][_0xcd07('0x39')]);_0x33bbeb[_0xcd07('0x20')]=qs[_0xcd07('0x20')](_0xaacae3[_0xcd07('0x33')][_0xcd07('0x20')]);}_0x33bbeb[_0xcd07('0x3a')]=qs[_0xcd07('0x3b')](_0xaacae3[_0xcd07('0x33')][_0xcd07('0x3b')]);_0x33bbeb[_0xcd07('0x3c')]=qs[_0xcd07('0x34')](_[_0xcd07('0x3d')](_0xaacae3[_0xcd07('0x33')],_0x35ae69['filters']),_0x4151c5);if(_0xaacae3['query'][_0xcd07('0x3e')]){_0x33bbeb[_0xcd07('0x3c')]=_['merge'](_0x33bbeb[_0xcd07('0x3c')],{'$or':_['map'](_0x33bbeb[_0xcd07('0x36')],function(_0x19fa51){var _0x571845={};_0x571845[_0x19fa51]={'$like':'%'+_0xaacae3[_0xcd07('0x33')][_0xcd07('0x3e')]+'%'};return _0x571845;})});}_0x33bbeb=_[_0xcd07('0x3f')]({},_0x33bbeb,_0xaacae3[_0xcd07('0x40')]);var _0x5978ff={'where':_0x33bbeb['where']};return db[_0xcd07('0x2f')][_0xcd07('0x1f')](_0x5978ff)['then'](function(_0x4e32a4){_0x1dbc2f[_0xcd07('0x1f')]=_0x4e32a4;if(_0xaacae3[_0xcd07('0x33')][_0xcd07('0x41')]){_0x33bbeb[_0xcd07('0x42')]=[{'all':!![]}];}return db[_0xcd07('0x2f')]['findAll'](_0x33bbeb);})[_0xcd07('0x25')](function(_0x2a55fb){_0x1dbc2f[_0xcd07('0x43')]=_0x2a55fb;return _0x1dbc2f;})[_0xcd07('0x25')](respondWithFilteredResult(_0x2886cd,_0x33bbeb))['catch'](handleError(_0x2886cd,null));})[_0xcd07('0x44')](handleError(_0x2886cd,null));};exports[_0xcd07('0x45')]=function(_0x5e58ff,_0x425224){var _0x407051={'raw':![],'where':{'id':_0x5e58ff['params']['id']}},_0x940722={};_0x940722[_0xcd07('0x31')]=_[_0xcd07('0x32')](db[_0xcd07('0x2f')][_0xcd07('0x46')]);_0x940722[_0xcd07('0x33')]=_['keys'](_0x5e58ff[_0xcd07('0x33')]);_0x940722[_0xcd07('0x34')]=_[_0xcd07('0x35')](_0x940722[_0xcd07('0x31')],_0x940722[_0xcd07('0x33')]);_0x407051[_0xcd07('0x36')]=_[_0xcd07('0x35')](_0x940722[_0xcd07('0x31')],qs[_0xcd07('0x47')](_0x5e58ff[_0xcd07('0x33')][_0xcd07('0x47')]));_0x407051['attributes']=_0x407051['attributes'][_0xcd07('0x48')]?_0x407051[_0xcd07('0x36')]:_0x940722['model'];if(_0x5e58ff['query'][_0xcd07('0x41')]){_0x407051[_0xcd07('0x42')]=[{'all':!![]}];}_0x407051=_[_0xcd07('0x3f')]({},_0x407051,_0x5e58ff[_0xcd07('0x40')]);return db['CmCompany'][_0xcd07('0x49')](_0x407051)[_0xcd07('0x25')](handleEntityNotFound(_0x425224,null))[_0xcd07('0x25')](respondWithResult(_0x425224,null))[_0xcd07('0x44')](handleError(_0x425224,null));};exports[_0xcd07('0x4a')]=function(_0x5171eb,_0x367dc8){return db[_0xcd07('0x2f')][_0xcd07('0x4a')](_0x5171eb[_0xcd07('0x4b')],{})[_0xcd07('0x25')](function(_0x5f9bbc){var _0x4bc393=_0x5171eb[_0xcd07('0x4c')]['get']({'plain':!![]});if(!_0x4bc393)throw new Error(_0xcd07('0x4d'));if(_0x4bc393[_0xcd07('0x4e')]===_0xcd07('0x4c')){var _0x21fd22=_0x5f9bbc[_0xcd07('0x26')]({'plain':!![]});var _0x210a4=_0xcd07('0x27');return db[_0xcd07('0x4f')][_0xcd07('0x49')]({'where':{'name':_0x210a4,'userProfileId':_0x4bc393['userProfileId']},'raw':!![]})[_0xcd07('0x25')](function(_0x24e97b){if(_0x24e97b&&_0x24e97b['autoAssociation']===0x0){return db[_0xcd07('0x28')][_0xcd07('0x4a')]({'name':_0x21fd22[_0xcd07('0x2c')],'resourceId':_0x21fd22['id'],'type':_0x24e97b['name'],'sectionId':_0x24e97b['id']},{})[_0xcd07('0x25')](function(){return _0x5f9bbc;});}else{return _0x5f9bbc;}})[_0xcd07('0x44')](function(_0x3c6d95){logger[_0xcd07('0x2a')](_0xcd07('0x50'),_0x3c6d95);throw _0x3c6d95;});}return _0x5f9bbc;})[_0xcd07('0x25')](respondWithResult(_0x367dc8,0xc9))[_0xcd07('0x44')](handleError(_0x367dc8,null));};exports[_0xcd07('0x23')]=function(_0x3bfd34,_0x43ed3c){if(_0x3bfd34[_0xcd07('0x4b')]['id']){delete _0x3bfd34[_0xcd07('0x4b')]['id'];}return db[_0xcd07('0x2f')][_0xcd07('0x49')]({'where':{'id':_0x3bfd34['params']['id']}})['then'](handleEntityNotFound(_0x43ed3c,null))[_0xcd07('0x25')](saveUpdates(_0x3bfd34[_0xcd07('0x4b')],null))[_0xcd07('0x25')](respondWithResult(_0x43ed3c,null))['catch'](handleError(_0x43ed3c,null));};exports[_0xcd07('0x24')]=function(_0x6c4da8,_0x40f3a4){return db['CmCompany'][_0xcd07('0x49')]({'where':{'id':_0x6c4da8[_0xcd07('0x51')]['id']}})[_0xcd07('0x25')](handleEntityNotFound(_0x40f3a4,null))['then'](removeEntity(_0x40f3a4,null))[_0xcd07('0x44')](handleError(_0x40f3a4,null));};exports[_0xcd07('0x30')]=function(_0x195d89,_0x5b5279){return db[_0xcd07('0x2f')]['describe']()[_0xcd07('0x25')](respondWithResult(_0x5b5279,null))[_0xcd07('0x44')](handleError(_0x5b5279,null));};exports[_0xcd07('0x52')]=function(_0x2cb206,_0x2a2d88,_0x5a1c5e){return db[_0xcd07('0x53')][_0xcd07('0x49')]({'where':{'id':_0x2cb206['params']['id']}})[_0xcd07('0x25')](handleEntityNotFound(_0x2a2d88,null))[_0xcd07('0x25')](function(_0x26ac4b){if(_0x26ac4b){return _0x26ac4b[_0xcd07('0x52')](_0x2cb206[_0xcd07('0x4b')][_0xcd07('0x54')],_[_0xcd07('0x55')](_0x2cb206[_0xcd07('0x4b')],[_0xcd07('0x54'),'id'])||{});}})['then'](respondWithResult(_0x2a2d88,null))[_0xcd07('0x44')](handleError(_0x2a2d88,null));};exports[_0xcd07('0x56')]=function(_0x491045,_0x46e37e,_0x8f8f6e){var _0x5973db={};var _0x1000a6={};var _0xc50108;var _0x1179db;return db[_0xcd07('0x2f')][_0xcd07('0x57')]({'where':{'id':_0x491045[_0xcd07('0x51')]['id']}})[_0xcd07('0x25')](handleEntityNotFound(_0x46e37e,null))[_0xcd07('0x25')](function(_0x3a953b){if(_0x3a953b){_0xc50108=_0x3a953b;_0x1000a6[_0xcd07('0x31')]=_[_0xcd07('0x32')](db['CmContact'][_0xcd07('0x46')]);_0x1000a6[_0xcd07('0x33')]=_[_0xcd07('0x32')](_0x491045[_0xcd07('0x33')]);_0x1000a6[_0xcd07('0x34')]=_[_0xcd07('0x35')](_0x1000a6[_0xcd07('0x31')],_0x1000a6[_0xcd07('0x33')]);_0x5973db[_0xcd07('0x36')]=_['intersection'](_0x1000a6[_0xcd07('0x31')],qs[_0xcd07('0x47')](_0x491045[_0xcd07('0x33')][_0xcd07('0x47')]));_0x5973db[_0xcd07('0x36')]=_0x5973db[_0xcd07('0x36')][_0xcd07('0x48')]?_0x5973db[_0xcd07('0x36')]:_0x1000a6['model'];_0x5973db[_0xcd07('0x3a')]=qs[_0xcd07('0x3b')](_0x491045['query'][_0xcd07('0x3b')]);_0x5973db[_0xcd07('0x3c')]=qs['filters'](_[_0xcd07('0x3d')](_0x491045[_0xcd07('0x33')],_0x1000a6[_0xcd07('0x34')]));if(_0x491045[_0xcd07('0x33')]['filter']){_0x5973db[_0xcd07('0x3c')]=_[_0xcd07('0x3f')](_0x5973db['where'],{'$or':_[_0xcd07('0x58')](_0x5973db['attributes'],function(_0x554fea){var _0x2ea2a2={};_0x2ea2a2[_0x554fea]={'$like':'%'+_0x491045[_0xcd07('0x33')]['filter']+'%'};return _0x2ea2a2;})});}_0x5973db=_['merge']({},_0x5973db,_0x491045['options']);return _0xc50108[_0xcd07('0x56')](_0x5973db);}})[_0xcd07('0x25')](function(_0x14c1e2){if(_0x14c1e2){_0x1179db=_0x14c1e2[_0xcd07('0x48')];if(!_0x491045[_0xcd07('0x33')][_0xcd07('0x37')](_0xcd07('0x38'))){_0x5973db[_0xcd07('0x39')]=qs['limit'](_0x491045[_0xcd07('0x33')]['limit']);_0x5973db[_0xcd07('0x20')]=qs['offset'](_0x491045[_0xcd07('0x33')]['offset']);}return _0xc50108[_0xcd07('0x56')](_0x5973db);}})['then'](function(_0x4258e7){if(_0x4258e7){return _0x4258e7?{'count':_0x1179db,'rows':_0x4258e7}:null;}})[_0xcd07('0x25')](respondWithResult(_0x46e37e,null))[_0xcd07('0x44')](handleError(_0x46e37e,null));}; \ No newline at end of file +var _0x59fd=['options','includeAll','include','catch','show','length','find','create','body','role','user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContact','addContacts','ids','omit','getContacts','rawAttributes','order','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','sendStatus','error','stack','name','send','index','CmCompany','describe','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x59fd,0xbc));var _0xd59f=function(_0x1e237a,_0x43991a){_0x1e237a=_0x1e237a-0x0;var _0x461d8a=_0x59fd[_0x1e237a];return _0x461d8a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd59f('0x0'));var jsonpatch=require(_0xd59f('0x1'));var rp=require(_0xd59f('0x2'));var moment=require(_0xd59f('0x3'));var BPromise=require(_0xd59f('0x4'));var Mustache=require(_0xd59f('0x5'));var util=require(_0xd59f('0x6'));var path=require(_0xd59f('0x7'));var sox=require(_0xd59f('0x8'));var csv=require(_0xd59f('0x9'));var ejs=require(_0xd59f('0xa'));var fs=require('fs');var fs_extra=require(_0xd59f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd59f('0xc'));var jsforce=require(_0xd59f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd59f('0x9'));var querystring=require(_0xd59f('0xe'));var Papa=require('papaparse');var Redis=require(_0xd59f('0xf'));var authService=require(_0xd59f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd59f('0x11'));var logger=require('../../config/logger')(_0xd59f('0x12'));var utils=require('../../config/utils');var config=require(_0xd59f('0x13'));var licenseUtil=require(_0xd59f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x159b60,_0x256974){_0x256974=_0x256974||0xcc;return function(_0x188506){if(_0x188506){return _0x159b60['sendStatus'](_0x256974);}return _0x159b60[_0xd59f('0x15')](_0x256974)[_0xd59f('0x16')]();};}function respondWithResult(_0x3f26fb,_0x1bc60a){_0x1bc60a=_0x1bc60a||0xc8;return function(_0x535535){if(_0x535535){return _0x3f26fb[_0xd59f('0x15')](_0x1bc60a)[_0xd59f('0x17')](_0x535535);}};}function respondWithFilteredResult(_0x14dc2a,_0x2cc253){return function(_0x3e806e){if(_0x3e806e){var _0x3ccffa=typeof _0x2cc253[_0xd59f('0x18')]==='undefined'&&typeof _0x2cc253[_0xd59f('0x19')]===_0xd59f('0x1a');var _0x1b1550=_0x3e806e[_0xd59f('0x1b')];var _0x3ca53f=_0x3ccffa?0x0:_0x2cc253[_0xd59f('0x18')];var _0x41c92d=_0x3ccffa?_0x3e806e[_0xd59f('0x1b')]:_0x2cc253[_0xd59f('0x18')]+_0x2cc253[_0xd59f('0x19')];var _0x556338;if(_0x41c92d>=_0x1b1550){_0x41c92d=_0x1b1550;_0x556338=0xc8;}else{_0x556338=0xce;}_0x14dc2a[_0xd59f('0x15')](_0x556338);return _0x14dc2a[_0xd59f('0x1c')](_0xd59f('0x1d'),_0x3ca53f+'-'+_0x41c92d+'/'+_0x1b1550)['json'](_0x3e806e);}return null;};}function patchUpdates(_0x390ebd){return function(_0x16312f){try{jsonpatch[_0xd59f('0x1e')](_0x16312f,_0x390ebd,!![]);}catch(_0x18a128){return BPromise[_0xd59f('0x1f')](_0x18a128);}return _0x16312f[_0xd59f('0x20')]();};}function saveUpdates(_0xaf77cd,_0x18e000){return function(_0x4bf0bc){if(_0x4bf0bc){return _0x4bf0bc[_0xd59f('0x21')](_0xaf77cd)[_0xd59f('0x22')](function(_0x14ab65){return _0x14ab65;});}return null;};}function removeEntity(_0x1d61d9,_0x4a62ba){return function(_0x562b00){if(_0x562b00){return _0x562b00[_0xd59f('0x23')]()['then'](function(){var _0x25f436=_0x562b00[_0xd59f('0x24')]({'plain':!![]});var _0x28299f=_0xd59f('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x28299f,'resourceId':_0x25f436['id']}})[_0xd59f('0x22')](function(){return _0x562b00;});})[_0xd59f('0x22')](function(){_0x1d61d9[_0xd59f('0x15')](0xcc)[_0xd59f('0x16')]();});}};}function handleEntityNotFound(_0x4a9b92,_0x3bbc31){return function(_0x18d9a6){if(!_0x18d9a6){_0x4a9b92[_0xd59f('0x26')](0x194);}return _0x18d9a6;};}function handleError(_0x5349bd,_0x583caa){_0x583caa=_0x583caa||0x1f4;return function(_0x25431d){logger[_0xd59f('0x27')](_0x25431d[_0xd59f('0x28')]);if(_0x25431d['name']){delete _0x25431d[_0xd59f('0x29')];}_0x5349bd['status'](_0x583caa)[_0xd59f('0x2a')](_0x25431d);};}exports[_0xd59f('0x2b')]=function(_0x5c13eb,_0x805f62){var _0x4aa71b={},_0x382e70={},_0x1f6861={'count':0x0,'rows':[]};return db[_0xd59f('0x2c')][_0xd59f('0x2d')]()[_0xd59f('0x22')](function(_0x56aca9){_0x382e70['model']=_[_0xd59f('0x2e')](_0x56aca9);_0x382e70[_0xd59f('0x2f')]=_['keys'](_0x5c13eb[_0xd59f('0x2f')]);_0x382e70['filters']=_[_0xd59f('0x30')](_0x382e70[_0xd59f('0x31')],_0x382e70['query']);_0x4aa71b['attributes']=_[_0xd59f('0x30')](_0x382e70['model'],qs[_0xd59f('0x32')](_0x5c13eb[_0xd59f('0x2f')][_0xd59f('0x32')]));_0x4aa71b[_0xd59f('0x33')]=_0x4aa71b[_0xd59f('0x33')]['length']?_0x4aa71b['attributes']:_0x382e70[_0xd59f('0x31')];if(!_0x5c13eb[_0xd59f('0x2f')][_0xd59f('0x34')](_0xd59f('0x35'))){_0x4aa71b[_0xd59f('0x19')]=qs[_0xd59f('0x19')](_0x5c13eb[_0xd59f('0x2f')][_0xd59f('0x19')]);_0x4aa71b[_0xd59f('0x18')]=qs['offset'](_0x5c13eb[_0xd59f('0x2f')][_0xd59f('0x18')]);}_0x4aa71b['order']=qs[_0xd59f('0x36')](_0x5c13eb[_0xd59f('0x2f')][_0xd59f('0x36')]);_0x4aa71b[_0xd59f('0x37')]=qs[_0xd59f('0x38')](_[_0xd59f('0x39')](_0x5c13eb[_0xd59f('0x2f')],_0x382e70['filters']),_0x56aca9);if(_0x5c13eb[_0xd59f('0x2f')][_0xd59f('0x3a')]){_0x4aa71b[_0xd59f('0x37')]=_[_0xd59f('0x3b')](_0x4aa71b[_0xd59f('0x37')],{'$or':_[_0xd59f('0x3c')](_0x4aa71b['attributes'],function(_0x2e7e63){var _0x57406a={};_0x57406a[_0x2e7e63]={'$like':'%'+_0x5c13eb[_0xd59f('0x2f')][_0xd59f('0x3a')]+'%'};return _0x57406a;})});}_0x4aa71b=_[_0xd59f('0x3b')]({},_0x4aa71b,_0x5c13eb[_0xd59f('0x3d')]);var _0xd9a0a9={'where':_0x4aa71b[_0xd59f('0x37')]};return db['CmCompany'][_0xd59f('0x1b')](_0xd9a0a9)['then'](function(_0x14c4e7){_0x1f6861[_0xd59f('0x1b')]=_0x14c4e7;if(_0x5c13eb[_0xd59f('0x2f')][_0xd59f('0x3e')]){_0x4aa71b[_0xd59f('0x3f')]=[{'all':!![]}];}return db[_0xd59f('0x2c')]['findAll'](_0x4aa71b);})['then'](function(_0xf9bd3e){_0x1f6861['rows']=_0xf9bd3e;return _0x1f6861;})[_0xd59f('0x22')](respondWithFilteredResult(_0x805f62,_0x4aa71b))[_0xd59f('0x40')](handleError(_0x805f62,null));})['catch'](handleError(_0x805f62,null));};exports[_0xd59f('0x41')]=function(_0xdcd837,_0x24e319){var _0x35b941={'raw':![],'where':{'id':_0xdcd837['params']['id']}},_0x2abbd2={};_0x2abbd2[_0xd59f('0x31')]=_[_0xd59f('0x2e')](db[_0xd59f('0x2c')]['rawAttributes']);_0x2abbd2[_0xd59f('0x2f')]=_[_0xd59f('0x2e')](_0xdcd837[_0xd59f('0x2f')]);_0x2abbd2[_0xd59f('0x38')]=_[_0xd59f('0x30')](_0x2abbd2['model'],_0x2abbd2[_0xd59f('0x2f')]);_0x35b941['attributes']=_[_0xd59f('0x30')](_0x2abbd2[_0xd59f('0x31')],qs[_0xd59f('0x32')](_0xdcd837[_0xd59f('0x2f')][_0xd59f('0x32')]));_0x35b941[_0xd59f('0x33')]=_0x35b941[_0xd59f('0x33')][_0xd59f('0x42')]?_0x35b941[_0xd59f('0x33')]:_0x2abbd2[_0xd59f('0x31')];if(_0xdcd837['query'][_0xd59f('0x3e')]){_0x35b941[_0xd59f('0x3f')]=[{'all':!![]}];}_0x35b941=_[_0xd59f('0x3b')]({},_0x35b941,_0xdcd837[_0xd59f('0x3d')]);return db[_0xd59f('0x2c')][_0xd59f('0x43')](_0x35b941)['then'](handleEntityNotFound(_0x24e319,null))[_0xd59f('0x22')](respondWithResult(_0x24e319,null))[_0xd59f('0x40')](handleError(_0x24e319,null));};exports[_0xd59f('0x44')]=function(_0x1942cf,_0x38dddf){return db[_0xd59f('0x2c')][_0xd59f('0x44')](_0x1942cf[_0xd59f('0x45')],{})['then'](function(_0x563e47){var _0x78c5ea=_0x1942cf['user'][_0xd59f('0x24')]({'plain':!![]});if(!_0x78c5ea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x78c5ea[_0xd59f('0x46')]===_0xd59f('0x47')){var _0x25f3d8=_0x563e47[_0xd59f('0x24')]({'plain':!![]});var _0x2c7584=_0xd59f('0x25');return db['UserProfileSection'][_0xd59f('0x43')]({'where':{'name':_0x2c7584,'userProfileId':_0x78c5ea[_0xd59f('0x48')]},'raw':!![]})['then'](function(_0x17f630){if(_0x17f630&&_0x17f630['autoAssociation']===0x0){return db[_0xd59f('0x49')][_0xd59f('0x44')]({'name':_0x25f3d8[_0xd59f('0x29')],'resourceId':_0x25f3d8['id'],'type':_0x17f630['name'],'sectionId':_0x17f630['id']},{})['then'](function(){return _0x563e47;});}else{return _0x563e47;}})['catch'](function(_0x20ea3a){logger[_0xd59f('0x27')](_0xd59f('0x4a'),_0x20ea3a);throw _0x20ea3a;});}return _0x563e47;})[_0xd59f('0x22')](respondWithResult(_0x38dddf,0xc9))['catch'](handleError(_0x38dddf,null));};exports[_0xd59f('0x21')]=function(_0x4f00b3,_0x211d78){if(_0x4f00b3['body']['id']){delete _0x4f00b3[_0xd59f('0x45')]['id'];}return db[_0xd59f('0x2c')]['find']({'where':{'id':_0x4f00b3['params']['id']}})[_0xd59f('0x22')](handleEntityNotFound(_0x211d78,null))[_0xd59f('0x22')](saveUpdates(_0x4f00b3[_0xd59f('0x45')],null))[_0xd59f('0x22')](respondWithResult(_0x211d78,null))[_0xd59f('0x40')](handleError(_0x211d78,null));};exports[_0xd59f('0x23')]=function(_0x11a4bd,_0x4b1ecd){return db[_0xd59f('0x2c')][_0xd59f('0x43')]({'where':{'id':_0x11a4bd[_0xd59f('0x4b')]['id']}})[_0xd59f('0x22')](handleEntityNotFound(_0x4b1ecd,null))[_0xd59f('0x22')](removeEntity(_0x4b1ecd,null))[_0xd59f('0x40')](handleError(_0x4b1ecd,null));};exports['describe']=function(_0x17efa7,_0x241201){return db[_0xd59f('0x2c')][_0xd59f('0x2d')]()[_0xd59f('0x22')](respondWithResult(_0x241201,null))[_0xd59f('0x40')](handleError(_0x241201,null));};exports['addContacts']=function(_0xe86942,_0x49c4e9,_0x5388d4){return db[_0xd59f('0x4c')][_0xd59f('0x43')]({'where':{'id':_0xe86942['params']['id']}})[_0xd59f('0x22')](handleEntityNotFound(_0x49c4e9,null))[_0xd59f('0x22')](function(_0x44be3e){if(_0x44be3e){return _0x44be3e[_0xd59f('0x4d')](_0xe86942[_0xd59f('0x45')][_0xd59f('0x4e')],_[_0xd59f('0x4f')](_0xe86942[_0xd59f('0x45')],[_0xd59f('0x4e'),'id'])||{});}})[_0xd59f('0x22')](respondWithResult(_0x49c4e9,null))[_0xd59f('0x40')](handleError(_0x49c4e9,null));};exports[_0xd59f('0x50')]=function(_0x10986c,_0x115baf,_0x44e0ce){var _0x201815={};var _0xf66e31={};var _0x745844;var _0x1dd5aa;return db[_0xd59f('0x2c')]['findOne']({'where':{'id':_0x10986c[_0xd59f('0x4b')]['id']}})[_0xd59f('0x22')](handleEntityNotFound(_0x115baf,null))['then'](function(_0x577261){if(_0x577261){_0x745844=_0x577261;_0xf66e31[_0xd59f('0x31')]=_[_0xd59f('0x2e')](db['CmContact'][_0xd59f('0x51')]);_0xf66e31['query']=_[_0xd59f('0x2e')](_0x10986c['query']);_0xf66e31[_0xd59f('0x38')]=_['intersection'](_0xf66e31[_0xd59f('0x31')],_0xf66e31[_0xd59f('0x2f')]);_0x201815[_0xd59f('0x33')]=_['intersection'](_0xf66e31[_0xd59f('0x31')],qs[_0xd59f('0x32')](_0x10986c[_0xd59f('0x2f')][_0xd59f('0x32')]));_0x201815[_0xd59f('0x33')]=_0x201815[_0xd59f('0x33')][_0xd59f('0x42')]?_0x201815[_0xd59f('0x33')]:_0xf66e31[_0xd59f('0x31')];_0x201815[_0xd59f('0x52')]=qs[_0xd59f('0x36')](_0x10986c[_0xd59f('0x2f')][_0xd59f('0x36')]);_0x201815[_0xd59f('0x37')]=qs[_0xd59f('0x38')](_[_0xd59f('0x39')](_0x10986c['query'],_0xf66e31[_0xd59f('0x38')]));if(_0x10986c[_0xd59f('0x2f')][_0xd59f('0x3a')]){_0x201815[_0xd59f('0x37')]=_[_0xd59f('0x3b')](_0x201815[_0xd59f('0x37')],{'$or':_[_0xd59f('0x3c')](_0x201815[_0xd59f('0x33')],function(_0x32139a){var _0x1fb5d0={};_0x1fb5d0[_0x32139a]={'$like':'%'+_0x10986c[_0xd59f('0x2f')][_0xd59f('0x3a')]+'%'};return _0x1fb5d0;})});}_0x201815=_[_0xd59f('0x3b')]({},_0x201815,_0x10986c['options']);return _0x745844['getContacts'](_0x201815);}})[_0xd59f('0x22')](function(_0x18cba9){if(_0x18cba9){_0x1dd5aa=_0x18cba9[_0xd59f('0x42')];if(!_0x10986c[_0xd59f('0x2f')][_0xd59f('0x34')](_0xd59f('0x35'))){_0x201815[_0xd59f('0x19')]=qs[_0xd59f('0x19')](_0x10986c[_0xd59f('0x2f')][_0xd59f('0x19')]);_0x201815[_0xd59f('0x18')]=qs['offset'](_0x10986c['query'][_0xd59f('0x18')]);}return _0x745844[_0xd59f('0x50')](_0x201815);}})[_0xd59f('0x22')](function(_0x52ca6d){if(_0x52ca6d){return _0x52ca6d?{'count':_0x1dd5aa,'rows':_0x52ca6d}:null;}})['then'](respondWithResult(_0x115baf,null))[_0xd59f('0x40')](handleError(_0x115baf,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 27bf609..3dfa394 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 _0x202b=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x202b,0x1e1));var _0xb202=function(_0x5e8b64,_0x3b0ad7){_0x5e8b64=_0x5e8b64-0x0;var _0x57cf34=_0x202b[_0x5e8b64];return _0x57cf34;};'use strict';var _=require(_0xb202('0x0'));var util=require(_0xb202('0x1'));var logger=require(_0xb202('0x2'))(_0xb202('0x3'));var moment=require(_0xb202('0x4'));var BPromise=require(_0xb202('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb202('0x6'));var rimraf=require(_0xb202('0x7'));var config=require(_0xb202('0x8'));var attributes=require(_0xb202('0x9'));module[_0xb202('0xa')]=function(_0x24233a,_0x32d1ec){return _0x24233a[_0xb202('0xb')](_0xb202('0xc'),attributes,{'tableName':_0xb202('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa655=['CmCompany','cm_companies','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x20bba9,_0x256685){var _0x2620d8=function(_0x3c8717){while(--_0x3c8717){_0x20bba9['push'](_0x20bba9['shift']());}};_0x2620d8(++_0x256685);}(_0xa655,0x1a6));var _0x5a65=function(_0x5edbac,_0xa54f78){_0x5edbac=_0x5edbac-0x0;var _0x2a5b78=_0xa655[_0x5edbac];return _0x2a5b78;};'use strict';var _=require('lodash');var util=require(_0x5a65('0x0'));var logger=require(_0x5a65('0x1'))(_0x5a65('0x2'));var moment=require(_0x5a65('0x3'));var BPromise=require('bluebird');var rp=require(_0x5a65('0x4'));var fs=require('fs');var path=require(_0x5a65('0x5'));var rimraf=require('rimraf');var config=require(_0x5a65('0x6'));var attributes=require(_0x5a65('0x7'));module[_0x5a65('0x8')]=function(_0x621796,_0x99d9f9){return _0x621796[_0x5a65('0x9')](_0x5a65('0xa'),attributes,{'tableName':_0x5a65('0xb'),'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 5317715..365519e 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 _0x4f7e=['catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x2e75f4,_0x4ec199){var _0x51de51=function(_0xb370dd){while(--_0xb370dd){_0x2e75f4['push'](_0x2e75f4['shift']());}};_0x51de51(++_0x4ec199);}(_0x4f7e,0x177));var _0xe4f7=function(_0x1e8d1f,_0x48ab24){_0x1e8d1f=_0x1e8d1f-0x0;var _0x47ef46=_0x4f7e[_0x1e8d1f];return _0x47ef46;};'use strict';var _=require(_0xe4f7('0x0'));var util=require(_0xe4f7('0x1'));var moment=require(_0xe4f7('0x2'));var BPromise=require(_0xe4f7('0x3'));var rs=require(_0xe4f7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe4f7('0x5'));var logger=require(_0xe4f7('0x6'))(_0xe4f7('0x7'));var config=require('../../config/environment');var jayson=require(_0xe4f7('0x8'));var client=jayson[_0xe4f7('0x9')][_0xe4f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cbebe,_0x586aaf,_0x56f865){return new BPromise(function(_0x4b6edc,_0x5c5159){return client[_0xe4f7('0xb')](_0x4cbebe,_0x56f865)[_0xe4f7('0xc')](function(_0x340e80){logger['info'](_0xe4f7('0xd'),_0x586aaf,_0xe4f7('0xe'));logger['debug'](_0xe4f7('0xf'),_0x586aaf,_0xe4f7('0xe'),JSON['stringify'](_0x340e80));if(_0x340e80[_0xe4f7('0x10')]){if(_0x340e80[_0xe4f7('0x10')][_0xe4f7('0x11')]===0x1f4){logger[_0xe4f7('0x10')](_0xe4f7('0xd'),_0x586aaf,_0x340e80[_0xe4f7('0x10')]['message']);return _0x5c5159(_0x340e80[_0xe4f7('0x10')][_0xe4f7('0x12')]);}logger[_0xe4f7('0x10')](_0xe4f7('0xd'),_0x586aaf,_0x340e80[_0xe4f7('0x10')][_0xe4f7('0x12')]);return _0x4b6edc(_0x340e80['error'][_0xe4f7('0x12')]);}else{logger[_0xe4f7('0x13')](_0xe4f7('0xd'),_0x586aaf,_0xe4f7('0xe'));_0x4b6edc(_0x340e80[_0xe4f7('0x14')][_0xe4f7('0x12')]);}})[_0xe4f7('0x15')](function(_0xee3ebf){logger[_0xe4f7('0x10')](_0xe4f7('0xd'),_0x586aaf,_0xee3ebf);_0x5c5159(_0xee3ebf);});});} \ No newline at end of file +var _0x9795=['CmCompany,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4b3033,_0x556ef3){var _0x397cd3=function(_0x67055c){while(--_0x67055c){_0x4b3033['push'](_0x4b3033['shift']());}};_0x397cd3(++_0x556ef3);}(_0x9795,0x157));var _0x5979=function(_0x3994e6,_0x1abef6){_0x3994e6=_0x3994e6-0x0;var _0x2e38b2=_0x9795[_0x3994e6];return _0x2e38b2;};'use strict';var _=require(_0x5979('0x0'));var util=require(_0x5979('0x1'));var moment=require(_0x5979('0x2'));var BPromise=require(_0x5979('0x3'));var rs=require(_0x5979('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5979('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5979('0x6'));var config=require('../../config/environment');var jayson=require(_0x5979('0x7'));var client=jayson['client'][_0x5979('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xabd45a,_0x505829,_0x33b227){return new BPromise(function(_0x2bb3cd,_0x341f98){return client[_0x5979('0x9')](_0xabd45a,_0x33b227)[_0x5979('0xa')](function(_0x5bc8ca){logger[_0x5979('0xb')]('CmCompany,\x20%s,\x20%s',_0x505829,'request\x20sent');logger['debug'](_0x5979('0xc'),_0x505829,_0x5979('0xd'),JSON[_0x5979('0xe')](_0x5bc8ca));if(_0x5bc8ca[_0x5979('0xf')]){if(_0x5bc8ca[_0x5979('0xf')][_0x5979('0x10')]===0x1f4){logger[_0x5979('0xf')](_0x5979('0x11'),_0x505829,_0x5bc8ca['error']['message']);return _0x341f98(_0x5bc8ca[_0x5979('0xf')]['message']);}logger[_0x5979('0xf')]('CmCompany,\x20%s,\x20%s',_0x505829,_0x5bc8ca[_0x5979('0xf')][_0x5979('0x12')]);return _0x2bb3cd(_0x5bc8ca[_0x5979('0xf')][_0x5979('0x12')]);}else{logger[_0x5979('0xb')](_0x5979('0x11'),_0x505829,_0x5979('0xd'));_0x2bb3cd(_0x5bc8ca[_0x5979('0x13')][_0x5979('0x12')]);}})['catch'](function(_0x35b6bd){logger[_0x5979('0xf')](_0x5979('0x11'),_0x505829,_0x35b6bd);_0x341f98(_0x35b6bd);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 904b201..6ca498f 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 _0xb41f=['isAuthenticated','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get'];(function(_0x12a5d4,_0x41ae93){var _0x4c1910=function(_0x488d0c){while(--_0x488d0c){_0x12a5d4['push'](_0x12a5d4['shift']());}};_0x4c1910(++_0x41ae93);}(_0xb41f,0x14f));var _0xfb41=function(_0x386e47,_0x5d10cb){_0x386e47=_0x386e47-0x0;var _0x58f333=_0xb41f[_0x386e47];return _0x58f333;};'use strict';var multer=require(_0xfb41('0x0'));var util=require(_0xfb41('0x1'));var path=require('path');var timeout=require(_0xfb41('0x2'));var express=require(_0xfb41('0x3'));var router=express['Router']();var fs_extra=require(_0xfb41('0x4'));var auth=require(_0xfb41('0x5'));var interaction=require(_0xfb41('0x6'));var config=require(_0xfb41('0x7'));var controller=require(_0xfb41('0x8'));router[_0xfb41('0x9')]('/',auth[_0xfb41('0xa')](),controller['index']);router[_0xfb41('0x9')](_0xfb41('0xb'),auth[_0xfb41('0xa')](),controller[_0xfb41('0xc')]);router[_0xfb41('0x9')](_0xfb41('0xd'),auth[_0xfb41('0xa')](),controller[_0xfb41('0xe')]);router[_0xfb41('0x9')](_0xfb41('0xf'),auth[_0xfb41('0xa')](),controller[_0xfb41('0x10')]);router[_0xfb41('0x11')]('/',auth[_0xfb41('0xa')](),controller[_0xfb41('0x12')]);router[_0xfb41('0x11')](_0xfb41('0xf'),auth[_0xfb41('0xa')](),controller[_0xfb41('0x13')]);router[_0xfb41('0x14')]('/:id',auth[_0xfb41('0xa')](),controller[_0xfb41('0x15')]);router['delete'](_0xfb41('0xd'),auth['isAuthenticated'](),controller[_0xfb41('0x16')]);module['exports']=router; \ No newline at end of file +var _0x0317=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','describe','isAuthenticated','show','post','/:id/contacts','addContacts','/:id','update','delete','destroy','exports'];(function(_0x3b0966,_0x3fc4ca){var _0x18e6b0=function(_0x535058){while(--_0x535058){_0x3b0966['push'](_0x3b0966['shift']());}};_0x18e6b0(++_0x3fc4ca);}(_0x0317,0x1b9));var _0x7031=function(_0x5ee0ef,_0x34f2b1){_0x5ee0ef=_0x5ee0ef-0x0;var _0x144aab=_0x0317[_0x5ee0ef];return _0x144aab;};'use strict';var multer=require('multer');var util=require(_0x7031('0x0'));var path=require(_0x7031('0x1'));var timeout=require(_0x7031('0x2'));var express=require(_0x7031('0x3'));var router=express[_0x7031('0x4')]();var fs_extra=require(_0x7031('0x5'));var auth=require(_0x7031('0x6'));var interaction=require(_0x7031('0x7'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7031('0x8')]);router[_0x7031('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x7031('0xa')]);router[_0x7031('0x9')]('/:id',auth[_0x7031('0xb')](),controller[_0x7031('0xc')]);router[_0x7031('0x9')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0x7031('0xd')]('/',auth[_0x7031('0xb')](),controller['create']);router['post'](_0x7031('0xe'),auth[_0x7031('0xb')](),controller[_0x7031('0xf')]);router['put'](_0x7031('0x10'),auth[_0x7031('0xb')](),controller[_0x7031('0x11')]);router[_0x7031('0x12')](_0x7031('0x10'),auth[_0x7031('0xb')](),controller[_0x7031('0x13')]);module[_0x7031('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 7277282..9f9075d 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 _0xdccc=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xdccc,0x111));var _0xcdcc=function(_0x4134f9,_0xb72988){_0x4134f9=_0x4134f9-0x0;var _0x3989a8=_0xdccc[_0x4134f9];return _0x3989a8;};'use strict';var _=require(_0xcdcc('0x0'));var Sequelize=require(_0xcdcc('0x1'));module[_0xcdcc('0x2')]={'firstName':{'type':Sequelize[_0xcdcc('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xcdcc('0x3')]},'street':{'type':Sequelize[_0xcdcc('0x3')]},'postalCode':{'type':Sequelize[_0xcdcc('0x3')]},'city':{'type':Sequelize[_0xcdcc('0x3')]},'country':{'type':Sequelize[_0xcdcc('0x3')]},'dateOfBirth':{'type':Sequelize[_0xcdcc('0x3')]},'description':{'type':Sequelize[_0xcdcc('0x4')]},'phone':{'type':Sequelize[_0xcdcc('0x3')]},'mobile':{'type':Sequelize[_0xcdcc('0x3')]},'fax':{'type':Sequelize[_0xcdcc('0x3')]},'email':{'type':Sequelize[_0xcdcc('0x3')]},'url':{'type':Sequelize[_0xcdcc('0x3')]},'facebook':{'type':Sequelize[_0xcdcc('0x3')]},'fb_data':{'type':Sequelize[_0xcdcc('0x3')]},'twitter':{'type':Sequelize[_0xcdcc('0x3')]},'skype':{'type':Sequelize[_0xcdcc('0x3')]},'teams':{'type':Sequelize[_0xcdcc('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xcdcc('0x3')]},'wechat':{'type':Sequelize[_0xcdcc('0x3')]},'telegram':{'type':Sequelize[_0xcdcc('0x3')]},'UserId':{'type':Sequelize[_0xcdcc('0x5')]},'priority':{'type':Sequelize[_0xcdcc('0x5')](0x2)[_0xcdcc('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xcdcc('0x7')]}}; \ No newline at end of file +var _0x8520=['INTEGER','UNSIGNED','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8520,0x16b));var _0x0852=function(_0x50c270,_0x112e9){_0x50c270=_0x50c270-0x0;var _0x4e7064=_0x8520[_0x50c270];return _0x4e7064;};'use strict';var _=require(_0x0852('0x0'));var Sequelize=require(_0x0852('0x1'));module[_0x0852('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x0852('0x3')]},'postalCode':{'type':Sequelize[_0x0852('0x3')]},'city':{'type':Sequelize[_0x0852('0x3')]},'country':{'type':Sequelize[_0x0852('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0852('0x4')]},'phone':{'type':Sequelize[_0x0852('0x3')]},'mobile':{'type':Sequelize[_0x0852('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0852('0x3')]},'url':{'type':Sequelize[_0x0852('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x0852('0x3')]},'skype':{'type':Sequelize[_0x0852('0x3')]},'teams':{'type':Sequelize[_0x0852('0x3')]},'viber':{'type':Sequelize[_0x0852('0x3')]},'line':{'type':Sequelize[_0x0852('0x3')]},'wechat':{'type':Sequelize[_0x0852('0x3')]},'telegram':{'type':Sequelize[_0x0852('0x3')]},'UserId':{'type':Sequelize[_0x0852('0x5')]},'priority':{'type':Sequelize[_0x0852('0x5')](0x2)[_0x0852('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x0852('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 8b1e40f..eeb758a 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 _0x333c=['Contact','isEmpty','ListId','c.ListId\x20IN\x20?','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','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?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','order','DESC','t.id\x20IN\x20?','user','role','agent','conditions','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','merge','CmContact','c.mobile','c.fax','c.email','c.createdAt','c.deletedAt','TagIds','Tags','rows','catch','params','describe','startsWith','columnName','displayName','findAll','alias','custom','values','body','get','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','each','duplicates','$or','findOrCreate','show','color','$and','cf_%d','omit','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','options','setTags','ids','getHoppers','includeAll','include','CmHopperHistory','ContactId','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','filename','chmodSync','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','import','binding','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','error\x20child\x20process','mail','chat','openchannel','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','VoiceCallReport','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','key','Owner','browserName','osName','ratingMessage','ratingType','ratingValue','subject','externalUrl','threadId','Interaction','findAndCountAll','all','sortBy','reverse','moment','bluebird','path','lodash','ioredis','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','update','destroy','then','sendStatus','error','stack','name','send','index','keys','cf_','CmCustomField','findOne','trimStart','length','fieldType','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','cm_contact_has_tags','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','type','text','start','end','hasOwnProperty','filter','isNil','push'];(function(_0x1534d4,_0x33c784){var _0x274edd=function(_0xe8d545){while(--_0xe8d545){_0x1534d4['push'](_0x1534d4['shift']());}};_0x274edd(++_0x33c784);}(_0x333c,0xbf));var _0xc333=function(_0x10d888,_0x5c8b27){_0x10d888=_0x10d888-0x0;var _0x1c30e1=_0x333c[_0x10d888];return _0x1c30e1;};'use strict';var moment=require(_0xc333('0x0'));var BPromise=require(_0xc333('0x1'));var util=require('util');var path=require(_0xc333('0x2'));var fs=require('fs');var _=require(_0xc333('0x3'));var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0xc333('0x4'));var qs=require('../../components/parsers/qs');var as=require(_0xc333('0x5'));var logger=require('../../config/logger')('api');var config=require(_0xc333('0x6'));var db=require(_0xc333('0x7'))['db'];config[_0xc333('0x8')]=_[_0xc333('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc333('0xa'))(new Redis(config['redis']));require(_0xc333('0xb'))[_0xc333('0xc')](socket);function respondWithResult(_0x38c947,_0x12e874){_0x12e874=_0x12e874||0xc8;return function(_0x58ca86){if(_0x58ca86){return _0x38c947[_0xc333('0xd')](_0x12e874)[_0xc333('0xe')](_0x58ca86);}};}function respondWithFilteredResult(_0x4af396,_0x4f08ed){return function(_0x56f23d){if(_0x56f23d){var _0x3b004e=typeof _0x4f08ed[_0xc333('0xf')]===_0xc333('0x10')&&typeof _0x4f08ed[_0xc333('0x11')]==='undefined';var _0x3e811c=_0x56f23d[_0xc333('0x12')];var _0x58c9c7=_0x3b004e?0x0:_0x4f08ed['offset'];var _0x20bdec=_0x3b004e?_0x56f23d[_0xc333('0x12')]:_0x4f08ed['offset']+_0x4f08ed[_0xc333('0x11')];var _0x5b54dd;if(_0x20bdec>=_0x3e811c){_0x20bdec=_0x3e811c;_0x5b54dd=0xc8;}else{_0x5b54dd=0xce;}_0x4af396[_0xc333('0xd')](_0x5b54dd);return _0x4af396[_0xc333('0x13')]('Content-Range',_0x58c9c7+'-'+_0x20bdec+'/'+_0x3e811c)[_0xc333('0xe')](_0x56f23d);}return null;};}function saveUpdates(_0x18e9ae){return function(_0x3b86f8){if(_0x3b86f8){return _0x3b86f8[_0xc333('0x14')](_0x18e9ae)['then'](function(_0xb70203){return _0xb70203;});}return null;};}function removeEntity(_0x15c1ec){return function(_0x570255){if(_0x570255){return _0x570255[_0xc333('0x15')]()[_0xc333('0x16')](function(){_0x15c1ec['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a130b){return function(_0x447779){if(!_0x447779){_0x3a130b[_0xc333('0x17')](0x194);}return _0x447779;};}function handleError(_0x18f8e5,_0x1955d5){_0x1955d5=_0x1955d5||0x1f4;return function(_0x5e08a2){logger[_0xc333('0x18')](_0x5e08a2[_0xc333('0x19')]);if(_0x5e08a2[_0xc333('0x1a')]){delete _0x5e08a2[_0xc333('0x1a')];}_0x18f8e5[_0xc333('0xd')](_0x1955d5)[_0xc333('0x1b')](_0x5e08a2);};}exports[_0xc333('0x1c')]=function(_0x3f5230,_0x319177){var _0x4c72f5={},_0x118c77={},_0x5edf1d={'count':0x0,'rows':[]};return db['CmContact']['describe']()['then'](function(_0x1d7c43){var _0xee826c=[];for(var _0x1757b4=0x0;_0x1757b40x1){_0xa343ed['or'](_0xc333('0x5a'),qs['getFullTextValue'](_0x9328dd),null);}else{if(qs[_0xc333('0x5b')](_0x9328dd)){_0xa343ed['or'](_0xc333('0x5c'),_0x9328dd+'%');_0xa343ed['or'](_0xc333('0x5d'),_0x9328dd+'%');_0xa343ed['or'](_0xc333('0x5e'),_0x9328dd+'%');_0xa343ed['or'](_0xc333('0x5f'),_0x9328dd+'%');}else if(qs[_0xc333('0x60')](_0x9328dd)){_0xa343ed['or'](_0xc333('0x61'),_0x9328dd+'%');}else{_0xa343ed['or'](_0xc333('0x62'),'%'+_0x9328dd+'%');_0xa343ed['or'](_0xc333('0x63'),'%'+_0x9328dd+'%');_0xa343ed['or'](_0xc333('0x61'),'%'+_0x9328dd+'%');}}}}_0x4e91d8[_0xc333('0x2c')](_0xa343ed);_0x4e91d8[_0xc333('0x64')](_0xc333('0x65'));var _0x1fe2dc={'type':db[_0xc333('0x66')][_0xc333('0x67')][_0xc333('0x68')],'raw':!![]};var _0x12fddf=_0x4e91d8['clone']()['field'](_0xc333('0x65'));if(_0x4c72f5[_0xc333('0x69')]){_0x4c72f5['order'][_0xc333('0x3f')](function(_0xcd9447){_0x4e91d8[_0xc333('0x69')]('c.'+_0xcd9447[0x0],_0xcd9447[0x1]===_0xc333('0x6a')?![]:!![]);});}if(!_[_0xc333('0x53')](_0x4cf960)){_0x4e91d8['having'](_0xa41b20);_0x12fddf[_0xc333('0x2c')](_0xc333('0x6b'),_0x4cf960);}BPromise['resolve']()[_0xc333('0x16')](function(){if(!_0x26ddfd)return;if(_0x3f5230[_0xc333('0x6c')][_0xc333('0x6d')]!==_0xc333('0x6e'))return;if(!_['some'](_0x26ddfd[_0xc333('0x6f')],['field',_0xc333('0x42')])){return _0x3f5230[_0xc333('0x6c')][_0xc333('0x70')]({'attributes':['id'],'raw':!![]})['then'](function(_0x327d57){if(_['isEmpty'](_0x327d57)){_0x12fddf['where'](_0xc333('0x71'));_0x4e91d8[_0xc333('0x2c')](_0xc333('0x71'));}else{_0x12fddf['where'](_0xc333('0x55'),_[_0xc333('0x3e')](_0x327d57,'id'));_0x4e91d8['where']('c.ListId\x20IN\x20?',_[_0xc333('0x3e')](_0x327d57,'id'));}});}})[_0xc333('0x16')](function(){if(_0x3f5230[_0xc333('0x6c')][_0xc333('0x6d')]===_0xc333('0x6e')&&!_0x26ddfd&&!_0x3f5230[_0xc333('0x25')][_0xc333('0x54')])return[];return db[_0xc333('0x72')][_0xc333('0x25')](_0x12fddf['toString'](),_0x1fe2dc);})[_0xc333('0x16')](function(_0x3c7b53){_0x5edf1d[_0xc333('0x12')]=_0x3c7b53[_0xc333('0x22')];if(_0x5edf1d[_0xc333('0x12')]===0x0)return[];return db[_0xc333('0x72')][_0xc333('0x25')](_0x4455b5[_0xc333('0x73')](),_0x1fe2dc)['then'](function(_0x133c0b){_0x20e01f=_['keyBy'](_0x133c0b,'id');_0x1fe2dc=_[_0xc333('0x74')](_0x1fe2dc,{'model':db[_0xc333('0x75')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3f5230[_0xc333('0x25')][_0xc333('0x29')]){_0x4c72f5[_0xc333('0x28')][_0xc333('0x3f')](function(_0x5ee3d3){_0x4e91d8[_0xc333('0x2f')]('c.'+_0x5ee3d3);});}else{_0x4e91d8[_0xc333('0x2f')](_0xc333('0x65'));_0x4e91d8[_0xc333('0x2f')]('c.firstName');_0x4e91d8[_0xc333('0x2f')]('c.lastName');_0x4e91d8[_0xc333('0x2f')]('c.phone');_0x4e91d8['field'](_0xc333('0x76'));_0x4e91d8[_0xc333('0x2f')](_0xc333('0x77'));_0x4e91d8[_0xc333('0x2f')](_0xc333('0x78'));_0x4e91d8[_0xc333('0x2f')]('c.ListId');_0x4e91d8['field'](_0xc333('0x79'));_0x4e91d8[_0xc333('0x2f')](_0xc333('0x7a'));_0x4e91d8[_0xc333('0x2f')]('c.CompanyId');_0x4e91d8[_0xc333('0x2f')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xc333('0x7b'));}if(_0x4c72f5[_0xc333('0x11')])_0x4e91d8[_0xc333('0x11')](_0x4c72f5['limit']);if(_0x4c72f5[_0xc333('0xf')])_0x4e91d8['offset'](_0x4c72f5[_0xc333('0xf')]);return db[_0xc333('0x72')]['query'](_0x4e91d8[_0xc333('0x73')](),_0x1fe2dc);});})[_0xc333('0x16')](function(_0x52ccb5){_0x52ccb5[_0xc333('0x3f')](function(_0x476c9a){if(_0x476c9a[_0xc333('0x7b')]){_0x476c9a[_0xc333('0x7c')]=[];_0x476c9a[_0xc333('0x7b')][_0xc333('0x3d')](',')[_0xc333('0x3f')](function(_0x1eb493){_0x476c9a[_0xc333('0x7c')][_0xc333('0x51')](_0x20e01f[_0x1eb493]);});}delete _0x476c9a[_0xc333('0x7b')];});_0x5edf1d[_0xc333('0x7d')]=_0x52ccb5;return _0x5edf1d;})[_0xc333('0x16')](respondWithFilteredResult(_0x319177,_0x4c72f5));})[_0xc333('0x7e')](handleError(_0x319177,null));};exports[_0xc333('0x15')]=function(_0x1f573f,_0x27fd11){return db[_0xc333('0x75')]['find']({'where':{'id':_0x1f573f[_0xc333('0x7f')]['id']}})[_0xc333('0x16')](handleEntityNotFound(_0x27fd11,null))[_0xc333('0x16')](removeEntity(_0x27fd11,null))[_0xc333('0x7e')](handleError(_0x27fd11,null));};exports[_0xc333('0x80')]=function(_0x15c978,_0x292c11){return db[_0xc333('0x75')]['describe']()[_0xc333('0x16')](function(_0x2d3244){delete _0x2d3244['tags'];for(var _0x3d7d67=0x0;_0x3d7d67=_0x3d77ef){_0x28167d=_0x3d77ef;_0x46c9b9=0xc8;}else{_0x46c9b9=0xce;}_0xb227ae[_0x760c('0xe')](_0x46c9b9);return _0xb227ae['set']('Content-Range',_0xce8619+'-'+_0x28167d+'/'+_0x3d77ef)['json'](_0x4253c4);}return null;};}function saveUpdates(_0x49ee1c){return function(_0xc65975){if(_0xc65975){return _0xc65975[_0x760c('0x14')](_0x49ee1c)[_0x760c('0x15')](function(_0x1a0982){return _0x1a0982;});}return null;};}function removeEntity(_0x4d1607){return function(_0x45dd69){if(_0x45dd69){return _0x45dd69[_0x760c('0x16')]()['then'](function(){_0x4d1607['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x848082){return function(_0x569636){if(!_0x569636){_0x848082[_0x760c('0x17')](0x194);}return _0x569636;};}function handleError(_0x4b5628,_0x432e25){_0x432e25=_0x432e25||0x1f4;return function(_0xb3248c){logger[_0x760c('0x18')](_0xb3248c['stack']);if(_0xb3248c[_0x760c('0x19')]){delete _0xb3248c[_0x760c('0x19')];}_0x4b5628[_0x760c('0xe')](_0x432e25)[_0x760c('0x1a')](_0xb3248c);};}exports['index']=function(_0x74faa,_0x59b226){var _0x4fa1d1={},_0x1544da={},_0x3d5326={'count':0x0,'rows':[]};return db['CmContact'][_0x760c('0x1b')]()[_0x760c('0x15')](function(_0x38805c){var _0x3c90b9=[];for(var _0x4b7506=0x0;_0x4b75060x1){_0x3384e6['or'](_0x760c('0x58'),qs['getFullTextValue'](_0x5266d7),null);}else{if(qs[_0x760c('0x59')](_0x5266d7)){_0x3384e6['or'](_0x760c('0x5a'),_0x5266d7+'%');_0x3384e6['or'](_0x760c('0x5b'),_0x5266d7+'%');_0x3384e6['or'](_0x760c('0x5c'),_0x5266d7+'%');_0x3384e6['or'](_0x760c('0x5d'),_0x5266d7+'%');}else if(qs['isEmail'](_0x5266d7)){_0x3384e6['or'](_0x760c('0x5e'),_0x5266d7+'%');}else{_0x3384e6['or'](_0x760c('0x5f'),'%'+_0x5266d7+'%');_0x3384e6['or'](_0x760c('0x60'),'%'+_0x5266d7+'%');_0x3384e6['or']('c.email\x20LIKE\x20?','%'+_0x5266d7+'%');}}}}_0x9a4be5['where'](_0x3384e6);_0x9a4be5['group'](_0x760c('0x61'));var _0x561556={'type':db[_0x760c('0x62')][_0x760c('0x63')][_0x760c('0x64')],'raw':!![]};var _0x9ca07e=_0x9a4be5['clone']()['field'](_0x760c('0x61'));if(_0x4fa1d1['order']){_0x4fa1d1[_0x760c('0x29')]['forEach'](function(_0x54b133){_0x9a4be5['order']('c.'+_0x54b133[0x0],_0x54b133[0x1]===_0x760c('0x65')?![]:!![]);});}if(!_[_0x760c('0x66')](_0x51991e)){_0x9a4be5[_0x760c('0x67')](_0x3ee1b6);_0x9ca07e[_0x760c('0x35')](_0x760c('0x68'),_0x51991e);}BPromise[_0x760c('0x69')]()[_0x760c('0x15')](function(){if(!_0x4ab3f0)return;if(_0x74faa[_0x760c('0x6a')][_0x760c('0x6b')]!==_0x760c('0x6c'))return;if(!_[_0x760c('0x6d')](_0x4ab3f0[_0x760c('0x3a')],['field','User'])){return _0x74faa[_0x760c('0x6a')][_0x760c('0x6e')]({'attributes':['id'],'raw':!![]})['then'](function(_0xadf6f3){if(_[_0x760c('0x66')](_0xadf6f3)){_0x9ca07e[_0x760c('0x35')](_0x760c('0x6f'));_0x9a4be5[_0x760c('0x35')]('c.ListId\x20IS\x20NULL');}else{_0x9ca07e[_0x760c('0x35')]('c.ListId\x20IN\x20?',_['map'](_0xadf6f3,'id'));_0x9a4be5[_0x760c('0x35')](_0x760c('0x52'),_[_0x760c('0x4c')](_0xadf6f3,'id'));}});}})[_0x760c('0x15')](function(){if(_0x74faa[_0x760c('0x6a')][_0x760c('0x6b')]===_0x760c('0x6c')&&!_0x4ab3f0&&!_0x74faa[_0x760c('0x24')][_0x760c('0x51')])return[];return db[_0x760c('0x70')][_0x760c('0x24')](_0x9ca07e[_0x760c('0x71')](),_0x561556);})[_0x760c('0x15')](function(_0x2d1fca){_0x3d5326[_0x760c('0x13')]=_0x2d1fca[_0x760c('0x57')];if(_0x3d5326['count']===0x0)return[];return db['sequelize']['query'](_0x48c70a[_0x760c('0x71')](),_0x561556)['then'](function(_0x1381df){_0x422ae3=_[_0x760c('0x72')](_0x1381df,'id');_0x561556=_['merge'](_0x561556,{'model':db[_0x760c('0x73')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x74faa[_0x760c('0x24')][_0x760c('0x27')]){_0x4fa1d1[_0x760c('0x25')][_0x760c('0x3e')](function(_0x42f515){_0x9a4be5['field']('c.'+_0x42f515);});}else{_0x9a4be5['field'](_0x760c('0x61'));_0x9a4be5[_0x760c('0x3b')](_0x760c('0x74'));_0x9a4be5[_0x760c('0x3b')](_0x760c('0x75'));_0x9a4be5[_0x760c('0x3b')](_0x760c('0x76'));_0x9a4be5[_0x760c('0x3b')](_0x760c('0x77'));_0x9a4be5['field']('c.fax');_0x9a4be5['field'](_0x760c('0x78'));_0x9a4be5[_0x760c('0x3b')](_0x760c('0x79'));_0x9a4be5[_0x760c('0x3b')](_0x760c('0x7a'));_0x9a4be5['field'](_0x760c('0x7b'));_0x9a4be5[_0x760c('0x3b')]('c.CompanyId');_0x9a4be5[_0x760c('0x3b')](_0x760c('0x7c'),_0x760c('0x7d'));}if(_0x4fa1d1[_0x760c('0x12')])_0x9a4be5['limit'](_0x4fa1d1['limit']);if(_0x4fa1d1[_0x760c('0x10')])_0x9a4be5[_0x760c('0x10')](_0x4fa1d1[_0x760c('0x10')]);return db[_0x760c('0x70')][_0x760c('0x24')](_0x9a4be5[_0x760c('0x71')](),_0x561556);});})[_0x760c('0x15')](function(_0x24bd36){_0x24bd36[_0x760c('0x3e')](function(_0x4e19b2){if(_0x4e19b2['TagIds']){_0x4e19b2[_0x760c('0x7e')]=[];_0x4e19b2[_0x760c('0x7d')][_0x760c('0x3d')](',')[_0x760c('0x3e')](function(_0x4b09e4){_0x4e19b2[_0x760c('0x7e')][_0x760c('0x1e')](_0x422ae3[_0x4b09e4]);});}delete _0x4e19b2[_0x760c('0x7d')];});_0x3d5326[_0x760c('0x7f')]=_0x24bd36;return _0x3d5326;})['then'](respondWithFilteredResult(_0x59b226,_0x4fa1d1));})['catch'](handleError(_0x59b226,null));};exports[_0x760c('0x16')]=function(_0x35256a,_0x4f3baf){return db['CmContact'][_0x760c('0x80')]({'where':{'id':_0x35256a[_0x760c('0x81')]['id']}})[_0x760c('0x15')](handleEntityNotFound(_0x4f3baf,null))[_0x760c('0x15')](removeEntity(_0x4f3baf,null))[_0x760c('0x82')](handleError(_0x4f3baf,null));};exports[_0x760c('0x1b')]=function(_0x4350b8,_0x50673c){return db['CmContact'][_0x760c('0x1b')]()['then'](function(_0xd50fcf){delete _0xd50fcf[_0x760c('0x83')];for(var _0x199479=0x0;_0x199479{}\s\\|]/g,'-');_0x208aa3(null,util[_0x1d0c('0x1f')](_0x1d0c('0x20'),path[_0x1d0c('0x21')](_0x4ca6e8['originalname'],path[_0x1d0c('0x22')](_0x4ca6e8[_0x1d0c('0x1e')])),Date['now'](),path['extname'](_0x4ca6e8['originalname'])));}})});router[_0x1d0c('0x19')](_0x1d0c('0x23'),upload[_0x1d0c('0x24')](_0x1d0c('0x25')),controller[_0x1d0c('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xcd9cd5,_0x1b7f59,_0x4c41c8){_0x4c41c8(null,path[_0x1d0c('0x1b')](config[_0x1d0c('0x1c')],'server/files/tmp'));},'filename':function(_0x471fc4,_0x5dab9b,_0x1fe2b2){_0x5dab9b[_0x1d0c('0x1e')]=_0x5dab9b['originalname'][_0x1d0c('0x27')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1fe2b2(null,util[_0x1d0c('0x1f')](_0x1d0c('0x20'),path['basename'](_0x5dab9b[_0x1d0c('0x1e')],path[_0x1d0c('0x22')](_0x5dab9b[_0x1d0c('0x1e')])),Date[_0x1d0c('0x28')](),path['extname'](_0x5dab9b['originalname'])));}})});router[_0x1d0c('0x19')]('/upload',upload[_0x1d0c('0x24')](_0x1d0c('0x25')),controller[_0x1d0c('0x29')]);router[_0x1d0c('0x19')](_0x1d0c('0x2a'),auth[_0x1d0c('0xa')](),controller[_0x1d0c('0x2b')]);router[_0x1d0c('0x2c')](_0x1d0c('0xb'),auth[_0x1d0c('0xa')](),controller[_0x1d0c('0x2d')]);router[_0x1d0c('0x2e')](_0x1d0c('0xb'),auth[_0x1d0c('0xa')](),controller[_0x1d0c('0x2f')]);module['exports']=router; \ No newline at end of file +var _0x3ef4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/tags','getTags','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getJscriptySessions','getJourney','post','/merge','merge','bulkCreate','setTags','join','server/files/tmp','originalname','replace','%s-%s%s','basename','extname','now','/csv','single','uploadCsv','root','format','/upload','file','upload','put','destroy','exports','util','path','express','Router','fs-extra'];(function(_0x534c20,_0x5a9e1c){var _0x5ae382=function(_0x22c5fd){while(--_0x22c5fd){_0x534c20['push'](_0x534c20['shift']());}};_0x5ae382(++_0x5a9e1c);}(_0x3ef4,0xeb));var _0x43ef=function(_0x5db65f,_0xf89cc8){_0x5db65f=_0x5db65f-0x0;var _0x34fb4b=_0x3ef4[_0x5db65f];return _0x34fb4b;};'use strict';var multer=require('multer');var util=require(_0x43ef('0x0'));var path=require(_0x43ef('0x1'));var timeout=require('connect-timeout');var express=require(_0x43ef('0x2'));var router=express[_0x43ef('0x3')]();var fs_extra=require(_0x43ef('0x4'));var auth=require(_0x43ef('0x5'));var interaction=require(_0x43ef('0x6'));var config=require(_0x43ef('0x7'));var controller=require(_0x43ef('0x8'));router[_0x43ef('0x9')]('/',auth['isAuthenticated'](),controller[_0x43ef('0xa')]);router[_0x43ef('0x9')](_0x43ef('0xb'),auth['isAuthenticated'](),controller[_0x43ef('0xc')]);router[_0x43ef('0x9')](_0x43ef('0xd'),auth[_0x43ef('0xe')](),controller[_0x43ef('0xf')]);router[_0x43ef('0x9')](_0x43ef('0x10'),auth['isAuthenticated'](),controller[_0x43ef('0x11')]);router[_0x43ef('0x9')]('/:id/hoppers',auth[_0x43ef('0xe')](),controller['getHoppers']);router[_0x43ef('0x9')](_0x43ef('0x12'),auth['isAuthenticated'](),controller[_0x43ef('0x13')]);router[_0x43ef('0x9')](_0x43ef('0x14'),auth[_0x43ef('0xe')](),controller[_0x43ef('0x15')]);router['get']('/:id/jscripty_sessions',auth[_0x43ef('0xe')](),controller[_0x43ef('0x16')]);router[_0x43ef('0x9')]('/:id/journey',auth['isAuthenticated'](),controller[_0x43ef('0x17')]);router[_0x43ef('0x18')](_0x43ef('0x19'),auth['isAuthenticated'](),controller[_0x43ef('0x1a')]);router['post']('/',auth[_0x43ef('0xe')](),controller['create']);router[_0x43ef('0x18')]('/create_many',auth['isAuthenticated'](),controller[_0x43ef('0x1b')]);router['post'](_0x43ef('0x10'),auth['isAuthenticated'](),controller[_0x43ef('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x35cf4d,_0x253b7f,_0x2230db){_0x2230db(null,path[_0x43ef('0x1d')](config['root'],_0x43ef('0x1e')));},'filename':function(_0x2ea1ae,_0x98c5f5,_0xf6a9e){_0x98c5f5[_0x43ef('0x1f')]=_0x98c5f5[_0x43ef('0x1f')][_0x43ef('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xf6a9e(null,util['format'](_0x43ef('0x21'),path[_0x43ef('0x22')](_0x98c5f5[_0x43ef('0x1f')],path[_0x43ef('0x23')](_0x98c5f5[_0x43ef('0x1f')])),Date[_0x43ef('0x24')](),path[_0x43ef('0x23')](_0x98c5f5[_0x43ef('0x1f')])));}})});router[_0x43ef('0x18')](_0x43ef('0x25'),upload[_0x43ef('0x26')]('file'),controller[_0x43ef('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x29c382,_0x480bec,_0x539fdc){_0x539fdc(null,path[_0x43ef('0x1d')](config[_0x43ef('0x28')],'server/files/tmp'));},'filename':function(_0x174504,_0x38b51d,_0x3c21fe){_0x38b51d[_0x43ef('0x1f')]=_0x38b51d[_0x43ef('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3c21fe(null,util[_0x43ef('0x29')](_0x43ef('0x21'),path[_0x43ef('0x22')](_0x38b51d[_0x43ef('0x1f')],path['extname'](_0x38b51d[_0x43ef('0x1f')])),Date[_0x43ef('0x24')](),path[_0x43ef('0x23')](_0x38b51d[_0x43ef('0x1f')])));}})});router[_0x43ef('0x18')](_0x43ef('0x2a'),upload[_0x43ef('0x26')](_0x43ef('0x2b')),controller[_0x43ef('0x2c')]);router[_0x43ef('0x18')]('/upload/:id',auth['isAuthenticated'](),controller['import']);router[_0x43ef('0x2d')]('/:id',auth[_0x43ef('0xe')](),controller['update']);router['delete'](_0x43ef('0xd'),auth[_0x43ef('0xe')](),controller[_0x43ef('0x2e')]);module[_0x43ef('0x2f')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index c2228fe..fd41ac6 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 _0x1fab=['parse','values','isArray','stringify','BOOLEAN','voice','lodash','exports','VIRTUAL','getDataValue','STRING','setDataValue','alias','name','TEXT','long','type'];(function(_0x2f4e55,_0x2abe26){var _0x2eb1e3=function(_0xeb129f){while(--_0xeb129f){_0x2f4e55['push'](_0x2f4e55['shift']());}};_0x2eb1e3(++_0x2abe26);}(_0x1fab,0x9f));var _0xb1fa=function(_0x15c2aa,_0x3ff6b8){_0x15c2aa=_0x15c2aa-0x0;var _0x973c42=_0x1fab[_0x15c2aa];return _0x973c42;};'use strict';var Sequelize=require('sequelize');var _=require(_0xb1fa('0x0'));module[_0xb1fa('0x1')]={'name':{'type':Sequelize[_0xb1fa('0x2')],'get':function(_0x3adb60){return this[_0xb1fa('0x3')]('alias');}},'alias':{'type':Sequelize[_0xb1fa('0x4')],'allowNull':![],'set':function(_0x803d83){this[_0xb1fa('0x5')](_0xb1fa('0x6'),_0x803d83?_0x803d83:this['getDataValue'](_0xb1fa('0x7')));}},'type':{'type':Sequelize[_0xb1fa('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xb1fa('0x8')](_0xb1fa('0x9')),'get':function(){if(this[_0xb1fa('0x3')](_0xb1fa('0xa'))==='select'){return JSON[_0xb1fa('0xb')](this[_0xb1fa('0x3')](_0xb1fa('0xc')));}else{return this[_0xb1fa('0x3')]('values');}},'set':function(_0x507f06){if(Array[_0xb1fa('0xd')](_0x507f06)){this['setDataValue']('values',JSON[_0xb1fa('0xe')](_0x507f06));}else{this['setDataValue']('values',_0x507f06);}}},'required':{'type':Sequelize[_0xb1fa('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xb1fa('0x10'))}}; \ No newline at end of file +var _0xcde1=['name','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','lodash','exports','VIRTUAL','getDataValue','STRING','setDataValue','alias'];(function(_0x5ab478,_0x398bf8){var _0x3377ab=function(_0x3604c1){while(--_0x3604c1){_0x5ab478['push'](_0x5ab478['shift']());}};_0x3377ab(++_0x398bf8);}(_0xcde1,0xf8));var _0x1cde=function(_0x3fc464,_0x49d7c4){_0x3fc464=_0x3fc464-0x0;var _0x4b3ab7=_0xcde1[_0x3fc464];return _0x4b3ab7;};'use strict';var Sequelize=require('sequelize');var _=require(_0x1cde('0x0'));module[_0x1cde('0x1')]={'name':{'type':Sequelize[_0x1cde('0x2')],'get':function(_0x46f0ce){return this[_0x1cde('0x3')]('alias');}},'alias':{'type':Sequelize[_0x1cde('0x4')],'allowNull':![],'set':function(_0x40ee75){this[_0x1cde('0x5')](_0x1cde('0x6'),_0x40ee75?_0x40ee75:this[_0x1cde('0x3')](_0x1cde('0x7')));}},'type':{'type':Sequelize[_0x1cde('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this[_0x1cde('0x3')](_0x1cde('0x8'))===_0x1cde('0x9')){return JSON[_0x1cde('0xa')](this[_0x1cde('0x3')](_0x1cde('0xb')));}else{return this[_0x1cde('0x3')](_0x1cde('0xb'));}},'set':function(_0x2e241a){if(Array[_0x1cde('0xc')](_0x2e241a)){this[_0x1cde('0x5')](_0x1cde('0xb'),JSON[_0x1cde('0xd')](_0x2e241a));}else{this[_0x1cde('0x5')](_0x1cde('0xb'),_0x2e241a);}}},'required':{'type':Sequelize[_0x1cde('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x1cde('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x1cde('0xf')](_0x1cde('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 4e62d14..1a4fba9 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 _0x068e=['include','rows','params','intersection','fields','catch','body','find','create','transaction','Sequelize','TEXT','text','number','INTEGER','switch','sequelize','addColumn','cm_contacts','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','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','offset','undefined','count','limit','set','apply','reject','update','destroy','end','error','name','send','index','CmCustomField','rawAttributes','fieldName','type','key','map','query','keys','model','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','then','includeAll'];(function(_0x48c6cc,_0x1bee96){var _0x3786b4=function(_0x33de2c){while(--_0x33de2c){_0x48c6cc['push'](_0x48c6cc['shift']());}};_0x3786b4(++_0x1bee96);}(_0x068e,0x66));var _0xe068=function(_0x2c0c68,_0x22fa53){_0x2c0c68=_0x2c0c68-0x0;var _0x3139ea=_0x068e[_0x2c0c68];return _0x3139ea;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe068('0x0'));var jsonpatch=require(_0xe068('0x1'));var rp=require(_0xe068('0x2'));var moment=require('moment');var BPromise=require(_0xe068('0x3'));var Mustache=require('mustache');var util=require(_0xe068('0x4'));var path=require('path');var sox=require(_0xe068('0x5'));var csv=require(_0xe068('0x6'));var ejs=require(_0xe068('0x7'));var fs=require('fs');var fs_extra=require(_0xe068('0x8'));var _=require(_0xe068('0x9'));var squel=require(_0xe068('0xa'));var crypto=require(_0xe068('0xb'));var jsforce=require(_0xe068('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe068('0xd'));var Papa=require(_0xe068('0xe'));var Redis=require(_0xe068('0xf'));var authService=require(_0xe068('0x10'));var qs=require(_0xe068('0x11'));var as=require(_0xe068('0x12'));var hardwareService=require(_0xe068('0x13'));var logger=require('../../config/logger')(_0xe068('0x14'));var utils=require(_0xe068('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe068('0x16'));var db=require(_0xe068('0x17'))['db'];function respondWithStatusCode(_0x4a90e6,_0x3fd731){_0x3fd731=_0x3fd731||0xcc;return function(_0x207cbc){if(_0x207cbc){return _0x4a90e6[_0xe068('0x18')](_0x3fd731);}return _0x4a90e6[_0xe068('0x19')](_0x3fd731)['end']();};}function respondWithResult(_0x302780,_0x1ef97d){_0x1ef97d=_0x1ef97d||0xc8;return function(_0x27599c){if(_0x27599c){return _0x302780[_0xe068('0x19')](_0x1ef97d)[_0xe068('0x1a')](_0x27599c);}};}function respondWithFilteredResult(_0x44e6c9,_0x2eaf9b){return function(_0x53741f){if(_0x53741f){var _0x46b5a7=typeof _0x2eaf9b[_0xe068('0x1b')]===_0xe068('0x1c')&&typeof _0x2eaf9b['limit']===_0xe068('0x1c');var _0x1b5307=_0x53741f[_0xe068('0x1d')];var _0x5dca4c=_0x46b5a7?0x0:_0x2eaf9b[_0xe068('0x1b')];var _0x587f65=_0x46b5a7?_0x53741f[_0xe068('0x1d')]:_0x2eaf9b[_0xe068('0x1b')]+_0x2eaf9b[_0xe068('0x1e')];var _0x283563;if(_0x587f65>=_0x1b5307){_0x587f65=_0x1b5307;_0x283563=0xc8;}else{_0x283563=0xce;}_0x44e6c9[_0xe068('0x19')](_0x283563);return _0x44e6c9[_0xe068('0x1f')]('Content-Range',_0x5dca4c+'-'+_0x587f65+'/'+_0x1b5307)[_0xe068('0x1a')](_0x53741f);}return null;};}function patchUpdates(_0x26de3b){return function(_0x53d071){try{jsonpatch[_0xe068('0x20')](_0x53d071,_0x26de3b,!![]);}catch(_0x2b1dc7){return BPromise[_0xe068('0x21')](_0x2b1dc7);}return _0x53d071['save']();};}function saveUpdates(_0x4348b6,_0x15e734){return function(_0x1f8515){if(_0x1f8515){return _0x1f8515[_0xe068('0x22')](_0x4348b6)['then'](function(_0x2c4d28){return _0x2c4d28;});}return null;};}function removeEntity(_0x323c45,_0x3345c6){return function(_0x5ad5b2){if(_0x5ad5b2){return _0x5ad5b2[_0xe068('0x23')]()['then'](function(){_0x323c45[_0xe068('0x19')](0xcc)[_0xe068('0x24')]();});}};}function handleEntityNotFound(_0x299230,_0x5ddb38){return function(_0xa1126b){if(!_0xa1126b){_0x299230['sendStatus'](0x194);}return _0xa1126b;};}function handleError(_0x3ad244,_0x5274d9){_0x5274d9=_0x5274d9||0x1f4;return function(_0x2bfeda){logger[_0xe068('0x25')](_0x2bfeda['stack']);if(_0x2bfeda['name']){delete _0x2bfeda[_0xe068('0x26')];}_0x3ad244[_0xe068('0x19')](_0x5274d9)[_0xe068('0x27')](_0x2bfeda);};}exports[_0xe068('0x28')]=function(_0x2258ae,_0x23a3e5){var _0x9e9316={},_0x3243ce={},_0x605a80={'count':0x0,'rows':[]};var _0x1f9e85=_['map'](db[_0xe068('0x29')][_0xe068('0x2a')],function(_0x2cd8e9){return{'name':_0x2cd8e9[_0xe068('0x2b')],'type':_0x2cd8e9[_0xe068('0x2c')][_0xe068('0x2d')]};});_0x3243ce['model']=_['differenceBy'](_[_0xe068('0x2e')](_0x1f9e85,_0xe068('0x26')),[_0xe068('0x26')]);_0x3243ce[_0xe068('0x2f')]=_[_0xe068('0x30')](_0x2258ae[_0xe068('0x2f')]);_0x3243ce['filters']=_['intersection'](_0x3243ce[_0xe068('0x31')],_0x3243ce[_0xe068('0x2f')]);_0x9e9316[_0xe068('0x32')]=_['intersection'](_0x3243ce['model'],qs['fields'](_0x2258ae[_0xe068('0x2f')]['fields']));_0x9e9316[_0xe068('0x32')]=_0x9e9316[_0xe068('0x32')][_0xe068('0x33')]?_0x9e9316[_0xe068('0x32')]:_0x3243ce[_0xe068('0x31')];if(!_0x2258ae[_0xe068('0x2f')][_0xe068('0x34')](_0xe068('0x35'))){_0x9e9316['limit']=qs['limit'](_0x2258ae[_0xe068('0x2f')][_0xe068('0x1e')]);_0x9e9316[_0xe068('0x1b')]=qs[_0xe068('0x1b')](_0x2258ae[_0xe068('0x2f')]['offset']);}_0x9e9316['order']=qs[_0xe068('0x36')](_0x2258ae['query'][_0xe068('0x36')]);_0x9e9316[_0xe068('0x37')]=qs[_0xe068('0x38')](_[_0xe068('0x39')](_0x2258ae[_0xe068('0x2f')],_0x3243ce['filters']),_0x1f9e85);if(_0x2258ae[_0xe068('0x2f')][_0xe068('0x3a')]){_0x9e9316[_0xe068('0x37')]=_['merge'](_0x9e9316['where'],{'$or':_[_0xe068('0x2e')](_0x1f9e85,function(_0xfa198e){if(_0xfa198e[_0xe068('0x2c')]!==_0xe068('0x3b')){var _0x347886={};_0x347886[_0xfa198e[_0xe068('0x26')]]={'$like':'%'+_0x2258ae[_0xe068('0x2f')][_0xe068('0x3a')]+'%'};return _0x347886;}})});}_0x9e9316=_[_0xe068('0x3c')]({},_0x9e9316,_0x2258ae[_0xe068('0x3d')]);var _0x378ae0={'where':_0x9e9316[_0xe068('0x37')]};return db[_0xe068('0x29')][_0xe068('0x1d')](_0x378ae0)[_0xe068('0x3e')](function(_0x59f136){_0x605a80[_0xe068('0x1d')]=_0x59f136;if(_0x2258ae['query'][_0xe068('0x3f')]){_0x9e9316[_0xe068('0x40')]=[{'all':!![]}];}return db[_0xe068('0x29')]['findAll'](_0x9e9316);})['then'](function(_0x2eb928){_0x605a80[_0xe068('0x41')]=_0x2eb928;return _0x605a80;})[_0xe068('0x3e')](respondWithFilteredResult(_0x23a3e5,_0x9e9316))['catch'](handleError(_0x23a3e5,null));};exports['show']=function(_0x26c43a,_0x34adb9){var _0x285f68={'raw':!![],'where':{'id':_0x26c43a[_0xe068('0x42')]['id']}},_0x48f029={};_0x48f029['model']=_[_0xe068('0x30')](db[_0xe068('0x29')]['rawAttributes']);_0x48f029[_0xe068('0x2f')]=_['keys'](_0x26c43a[_0xe068('0x2f')]);_0x48f029[_0xe068('0x38')]=_[_0xe068('0x43')](_0x48f029['model'],_0x48f029[_0xe068('0x2f')]);_0x285f68[_0xe068('0x32')]=_[_0xe068('0x43')](_0x48f029[_0xe068('0x31')],qs[_0xe068('0x44')](_0x26c43a['query'][_0xe068('0x44')]));_0x285f68['attributes']=_0x285f68[_0xe068('0x32')][_0xe068('0x33')]?_0x285f68[_0xe068('0x32')]:_0x48f029[_0xe068('0x31')];if(_0x26c43a[_0xe068('0x2f')][_0xe068('0x3f')]){_0x285f68[_0xe068('0x40')]=[{'all':!![]}];}_0x285f68=_[_0xe068('0x3c')]({},_0x285f68,_0x26c43a['options']);return db[_0xe068('0x29')]['find'](_0x285f68)[_0xe068('0x3e')](handleEntityNotFound(_0x34adb9,null))[_0xe068('0x3e')](respondWithResult(_0x34adb9,null))[_0xe068('0x45')](handleError(_0x34adb9,null));};exports['update']=function(_0x24a2f7,_0x3edb4a){if(_0x24a2f7[_0xe068('0x46')]['id']){delete _0x24a2f7['body']['id'];}return db[_0xe068('0x29')][_0xe068('0x47')]({'where':{'id':_0x24a2f7['params']['id']}})[_0xe068('0x3e')](handleEntityNotFound(_0x3edb4a,null))[_0xe068('0x3e')](saveUpdates(_0x24a2f7[_0xe068('0x46')],null))[_0xe068('0x3e')](respondWithResult(_0x3edb4a,null))['catch'](handleError(_0x3edb4a,null));};exports[_0xe068('0x23')]=function(_0x47b819,_0x16cd79){return db[_0xe068('0x29')][_0xe068('0x47')]({'where':{'id':_0x47b819[_0xe068('0x42')]['id']}})[_0xe068('0x3e')](handleEntityNotFound(_0x16cd79,null))[_0xe068('0x3e')](removeEntity(_0x16cd79,null))[_0xe068('0x45')](handleError(_0x16cd79,null));};exports[_0xe068('0x48')]=function(_0x2f49ae,_0x3fd9d9){var _0x4bd855;return db['sequelize'][_0xe068('0x49')](function(_0x392f6d){return db[_0xe068('0x29')][_0xe068('0x48')](_0x2f49ae[_0xe068('0x46')],{'transaction':_0x392f6d})[_0xe068('0x3e')](function(_0x2cdd2e){_0x4bd855=_0x2cdd2e;var _0x2385a8={'type':db[_0xe068('0x4a')][_0xe068('0x4b')],'transaction':_0x392f6d};switch(_0x2f49ae['body'][_0xe068('0x2c')]){case _0xe068('0x4c'):_0x2385a8[_0xe068('0x2c')]=db['Sequelize'][_0xe068('0x4b')];break;case _0xe068('0x4d'):_0x2385a8[_0xe068('0x2c')]=db[_0xe068('0x4a')][_0xe068('0x4e')];break;case _0xe068('0x4f'):_0x2385a8[_0xe068('0x2c')]=db[_0xe068('0x4a')]['BOOLEAN'];_0x2385a8['defaultValue']=![];break;default:}return db[_0xe068('0x50')]['queryInterface'][_0xe068('0x51')](_0xe068('0x52'),util['format']('cf_%d',_0x4bd855['id']),_0x2385a8);})['then'](function(){return _0x4bd855;});})[_0xe068('0x3e')](respondWithResult(_0x3fd9d9,0xc9))['catch'](handleError(_0x3fd9d9,null));}; \ No newline at end of file +var _0x2724=['query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','filters','body','find','transaction','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','CmCustomField','rawAttributes','model'];(function(_0x46660a,_0x2ba7e1){var _0x2a8f0f=function(_0xc819e8){while(--_0xc819e8){_0x46660a['push'](_0x46660a['shift']());}};_0x2a8f0f(++_0x2ba7e1);}(_0x2724,0x135));var _0x4272=function(_0x215159,_0x4bebb9){_0x215159=_0x215159-0x0;var _0x3b4ddd=_0x2724[_0x215159];return _0x3b4ddd;};'use strict';var emlformat=require(_0x4272('0x0'));var rimraf=require(_0x4272('0x1'));var zipdir=require(_0x4272('0x2'));var jsonpatch=require(_0x4272('0x3'));var rp=require(_0x4272('0x4'));var moment=require('moment');var BPromise=require(_0x4272('0x5'));var Mustache=require(_0x4272('0x6'));var util=require(_0x4272('0x7'));var path=require(_0x4272('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4272('0x9'));var fs=require('fs');var fs_extra=require(_0x4272('0xa'));var _=require(_0x4272('0xb'));var squel=require(_0x4272('0xc'));var crypto=require(_0x4272('0xd'));var jsforce=require(_0x4272('0xe'));var deskjs=require(_0x4272('0xf'));var toCsv=require(_0x4272('0x10'));var querystring=require(_0x4272('0x11'));var Papa=require(_0x4272('0x12'));var Redis=require(_0x4272('0x13'));var authService=require(_0x4272('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x4272('0x15'));var hardwareService=require(_0x4272('0x16'));var logger=require(_0x4272('0x17'))(_0x4272('0x18'));var utils=require(_0x4272('0x19'));var config=require(_0x4272('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x4272('0x1b'))['db'];function respondWithStatusCode(_0x30768f,_0x1270f1){_0x1270f1=_0x1270f1||0xcc;return function(_0x56bbf3){if(_0x56bbf3){return _0x30768f['sendStatus'](_0x1270f1);}return _0x30768f[_0x4272('0x1c')](_0x1270f1)['end']();};}function respondWithResult(_0xdb5f2b,_0xf5c6d5){_0xf5c6d5=_0xf5c6d5||0xc8;return function(_0x1bde5f){if(_0x1bde5f){return _0xdb5f2b['status'](_0xf5c6d5)[_0x4272('0x1d')](_0x1bde5f);}};}function respondWithFilteredResult(_0x622b7a,_0x44dcf4){return function(_0x1751e1){if(_0x1751e1){var _0x5e89c3=typeof _0x44dcf4[_0x4272('0x1e')]===_0x4272('0x1f')&&typeof _0x44dcf4[_0x4272('0x20')]===_0x4272('0x1f');var _0x4cc34b=_0x1751e1[_0x4272('0x21')];var _0x560c42=_0x5e89c3?0x0:_0x44dcf4['offset'];var _0x25ba75=_0x5e89c3?_0x1751e1[_0x4272('0x21')]:_0x44dcf4[_0x4272('0x1e')]+_0x44dcf4[_0x4272('0x20')];var _0x3ba60d;if(_0x25ba75>=_0x4cc34b){_0x25ba75=_0x4cc34b;_0x3ba60d=0xc8;}else{_0x3ba60d=0xce;}_0x622b7a[_0x4272('0x1c')](_0x3ba60d);return _0x622b7a[_0x4272('0x22')]('Content-Range',_0x560c42+'-'+_0x25ba75+'/'+_0x4cc34b)[_0x4272('0x1d')](_0x1751e1);}return null;};}function patchUpdates(_0xba44cc){return function(_0x18f233){try{jsonpatch[_0x4272('0x23')](_0x18f233,_0xba44cc,!![]);}catch(_0x3b13fc){return BPromise[_0x4272('0x24')](_0x3b13fc);}return _0x18f233[_0x4272('0x25')]();};}function saveUpdates(_0x57a20b,_0x331978){return function(_0x5c88c9){if(_0x5c88c9){return _0x5c88c9[_0x4272('0x26')](_0x57a20b)['then'](function(_0x281c9b){return _0x281c9b;});}return null;};}function removeEntity(_0x1ad67d,_0x1c7135){return function(_0x3018c0){if(_0x3018c0){return _0x3018c0[_0x4272('0x27')]()[_0x4272('0x28')](function(){_0x1ad67d[_0x4272('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b6a79,_0x5aa5f3){return function(_0x5a9d05){if(!_0x5a9d05){_0x1b6a79[_0x4272('0x29')](0x194);}return _0x5a9d05;};}function handleError(_0x5860e4,_0x14eb42){_0x14eb42=_0x14eb42||0x1f4;return function(_0x38fcd2){logger[_0x4272('0x2a')](_0x38fcd2[_0x4272('0x2b')]);if(_0x38fcd2[_0x4272('0x2c')]){delete _0x38fcd2[_0x4272('0x2c')];}_0x5860e4[_0x4272('0x1c')](_0x14eb42)[_0x4272('0x2d')](_0x38fcd2);};}exports[_0x4272('0x2e')]=function(_0x168ac6,_0x51bcd8){var _0x1c714f={},_0x7a55db={},_0x2f49fb={'count':0x0,'rows':[]};var _0x2c7ddf=_[_0x4272('0x2f')](db[_0x4272('0x30')][_0x4272('0x31')],function(_0x476231){return{'name':_0x476231['fieldName'],'type':_0x476231['type']['key']};});_0x7a55db[_0x4272('0x32')]=_['differenceBy'](_[_0x4272('0x2f')](_0x2c7ddf,_0x4272('0x2c')),[_0x4272('0x2c')]);_0x7a55db[_0x4272('0x33')]=_[_0x4272('0x34')](_0x168ac6[_0x4272('0x33')]);_0x7a55db['filters']=_['intersection'](_0x7a55db[_0x4272('0x32')],_0x7a55db[_0x4272('0x33')]);_0x1c714f[_0x4272('0x35')]=_[_0x4272('0x36')](_0x7a55db[_0x4272('0x32')],qs[_0x4272('0x37')](_0x168ac6['query'][_0x4272('0x37')]));_0x1c714f['attributes']=_0x1c714f[_0x4272('0x35')][_0x4272('0x38')]?_0x1c714f[_0x4272('0x35')]:_0x7a55db[_0x4272('0x32')];if(!_0x168ac6[_0x4272('0x33')][_0x4272('0x39')](_0x4272('0x3a'))){_0x1c714f[_0x4272('0x20')]=qs[_0x4272('0x20')](_0x168ac6[_0x4272('0x33')][_0x4272('0x20')]);_0x1c714f[_0x4272('0x1e')]=qs[_0x4272('0x1e')](_0x168ac6['query']['offset']);}_0x1c714f[_0x4272('0x3b')]=qs[_0x4272('0x3c')](_0x168ac6[_0x4272('0x33')][_0x4272('0x3c')]);_0x1c714f['where']=qs['filters'](_['pick'](_0x168ac6[_0x4272('0x33')],_0x7a55db['filters']),_0x2c7ddf);if(_0x168ac6[_0x4272('0x33')][_0x4272('0x3d')]){_0x1c714f[_0x4272('0x3e')]=_[_0x4272('0x3f')](_0x1c714f[_0x4272('0x3e')],{'$or':_[_0x4272('0x2f')](_0x2c7ddf,function(_0x17b48c){if(_0x17b48c[_0x4272('0x40')]!==_0x4272('0x41')){var _0x5b1f8c={};_0x5b1f8c[_0x17b48c[_0x4272('0x2c')]]={'$like':'%'+_0x168ac6[_0x4272('0x33')][_0x4272('0x3d')]+'%'};return _0x5b1f8c;}})});}_0x1c714f=_[_0x4272('0x3f')]({},_0x1c714f,_0x168ac6[_0x4272('0x42')]);var _0x2ebcf4={'where':_0x1c714f[_0x4272('0x3e')]};return db[_0x4272('0x30')][_0x4272('0x21')](_0x2ebcf4)['then'](function(_0x319e9c){_0x2f49fb['count']=_0x319e9c;if(_0x168ac6[_0x4272('0x33')][_0x4272('0x43')]){_0x1c714f[_0x4272('0x44')]=[{'all':!![]}];}return db[_0x4272('0x30')][_0x4272('0x45')](_0x1c714f);})['then'](function(_0xb5d14f){_0x2f49fb['rows']=_0xb5d14f;return _0x2f49fb;})['then'](respondWithFilteredResult(_0x51bcd8,_0x1c714f))[_0x4272('0x46')](handleError(_0x51bcd8,null));};exports[_0x4272('0x47')]=function(_0x16702a,_0x4b79d6){var _0x1f308f={'raw':!![],'where':{'id':_0x16702a[_0x4272('0x48')]['id']}},_0x5a7b73={};_0x5a7b73[_0x4272('0x32')]=_['keys'](db[_0x4272('0x30')][_0x4272('0x31')]);_0x5a7b73[_0x4272('0x33')]=_[_0x4272('0x34')](_0x16702a[_0x4272('0x33')]);_0x5a7b73[_0x4272('0x49')]=_['intersection'](_0x5a7b73['model'],_0x5a7b73[_0x4272('0x33')]);_0x1f308f[_0x4272('0x35')]=_['intersection'](_0x5a7b73[_0x4272('0x32')],qs[_0x4272('0x37')](_0x16702a[_0x4272('0x33')][_0x4272('0x37')]));_0x1f308f[_0x4272('0x35')]=_0x1f308f[_0x4272('0x35')]['length']?_0x1f308f[_0x4272('0x35')]:_0x5a7b73[_0x4272('0x32')];if(_0x16702a[_0x4272('0x33')][_0x4272('0x43')]){_0x1f308f[_0x4272('0x44')]=[{'all':!![]}];}_0x1f308f=_[_0x4272('0x3f')]({},_0x1f308f,_0x16702a[_0x4272('0x42')]);return db[_0x4272('0x30')]['find'](_0x1f308f)[_0x4272('0x28')](handleEntityNotFound(_0x4b79d6,null))['then'](respondWithResult(_0x4b79d6,null))[_0x4272('0x46')](handleError(_0x4b79d6,null));};exports[_0x4272('0x26')]=function(_0xa7d68c,_0x10bc9d){if(_0xa7d68c[_0x4272('0x4a')]['id']){delete _0xa7d68c[_0x4272('0x4a')]['id'];}return db[_0x4272('0x30')][_0x4272('0x4b')]({'where':{'id':_0xa7d68c['params']['id']}})[_0x4272('0x28')](handleEntityNotFound(_0x10bc9d,null))[_0x4272('0x28')](saveUpdates(_0xa7d68c[_0x4272('0x4a')],null))[_0x4272('0x28')](respondWithResult(_0x10bc9d,null))[_0x4272('0x46')](handleError(_0x10bc9d,null));};exports['destroy']=function(_0x6aa0d7,_0x3cf295){return db[_0x4272('0x30')][_0x4272('0x4b')]({'where':{'id':_0x6aa0d7[_0x4272('0x48')]['id']}})['then'](handleEntityNotFound(_0x3cf295,null))[_0x4272('0x28')](removeEntity(_0x3cf295,null))[_0x4272('0x46')](handleError(_0x3cf295,null));};exports['create']=function(_0x5a99e8,_0x37a79b){var _0x31ae79;return db['sequelize'][_0x4272('0x4c')](function(_0x19946a){return db[_0x4272('0x30')]['create'](_0x5a99e8['body'],{'transaction':_0x19946a})['then'](function(_0x5653f4){_0x31ae79=_0x5653f4;var _0x1d5f94={'type':db[_0x4272('0x4d')]['TEXT'],'transaction':_0x19946a};switch(_0x5a99e8[_0x4272('0x4a')][_0x4272('0x40')]){case _0x4272('0x4e'):_0x1d5f94[_0x4272('0x40')]=db[_0x4272('0x4d')][_0x4272('0x4f')];break;case _0x4272('0x50'):_0x1d5f94[_0x4272('0x40')]=db['Sequelize'][_0x4272('0x51')];break;case _0x4272('0x52'):_0x1d5f94[_0x4272('0x40')]=db[_0x4272('0x4d')][_0x4272('0x53')];_0x1d5f94[_0x4272('0x54')]=![];break;default:}return db[_0x4272('0x55')][_0x4272('0x56')]['addColumn'](_0x4272('0x57'),util[_0x4272('0x58')](_0x4272('0x59'),_0x31ae79['id']),_0x1d5f94);})[_0x4272('0x28')](function(){return _0x31ae79;});})[_0x4272('0x28')](respondWithResult(_0x37a79b,0xc9))[_0x4272('0x46')](handleError(_0x37a79b,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 9643c37..eac160f 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 _0x3b0e=['moment','bluebird','path','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','api'];(function(_0x1f85a2,_0x3b1995){var _0x571d78=function(_0x46f20b){while(--_0x46f20b){_0x1f85a2['push'](_0x1f85a2['shift']());}};_0x571d78(++_0x3b1995);}(_0x3b0e,0x121));var _0xe3b0=function(_0x1eda93,_0x550613){_0x1eda93=_0x1eda93-0x0;var _0x2e9e44=_0x3b0e[_0x1eda93];return _0x2e9e44;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe3b0('0x0'));var moment=require(_0xe3b0('0x1'));var BPromise=require(_0xe3b0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3b0('0x3'));var rimraf=require('rimraf');var config=require(_0xe3b0('0x4'));var attributes=require(_0xe3b0('0x5'));module[_0xe3b0('0x6')]=function(_0x4a6d37,_0x30220e){return _0x4a6d37[_0xe3b0('0x7')](_0xe3b0('0x8'),attributes,{'tableName':_0xe3b0('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe452=['../../config/environment','./cmCustomField.attributes','exports','CmCustomField','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe452,0x1bc));var _0x2e45=function(_0xf74696,_0x4abff2){_0xf74696=_0xf74696-0x0;var _0x5ad75e=_0xe452[_0xf74696];return _0x5ad75e;};'use strict';var _=require(_0x2e45('0x0'));var util=require(_0x2e45('0x1'));var logger=require(_0x2e45('0x2'))(_0x2e45('0x3'));var moment=require(_0x2e45('0x4'));var BPromise=require(_0x2e45('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e45('0x6'));var rimraf=require('rimraf');var config=require(_0x2e45('0x7'));var attributes=require(_0x2e45('0x8'));module[_0x2e45('0x9')]=function(_0x474191,_0x177154){return _0x474191['define'](_0x2e45('0xa'),attributes,{'tableName':'cm_custom_fields','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 9c0bf53..0128f42 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 _0xf204=['request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../config/logger','rpc','jayson/promise'];(function(_0x587b3b,_0x59da05){var _0x1ba031=function(_0x37d4b5){while(--_0x37d4b5){_0x587b3b['push'](_0x587b3b['shift']());}};_0x1ba031(++_0x59da05);}(_0xf204,0x1c4));var _0x4f20=function(_0xd1e9df,_0x5cd235){_0xd1e9df=_0xd1e9df-0x0;var _0x1b33a9=_0xf204[_0xd1e9df];return _0x1b33a9;};'use strict';var _=require(_0x4f20('0x0'));var util=require(_0x4f20('0x1'));var moment=require(_0x4f20('0x2'));var BPromise=require(_0x4f20('0x3'));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(_0x4f20('0x4'))(_0x4f20('0x5'));var config=require('../../config/environment');var jayson=require(_0x4f20('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20cc9c,_0x3d28bb,_0x3da2d6){return new BPromise(function(_0x2cfd65,_0x1a67af){return client[_0x4f20('0x7')](_0x20cc9c,_0x3da2d6)['then'](function(_0x4097d4){logger[_0x4f20('0x8')](_0x4f20('0x9'),_0x3d28bb,_0x4f20('0xa'));logger['debug'](_0x4f20('0xb'),_0x3d28bb,_0x4f20('0xa'),JSON[_0x4f20('0xc')](_0x4097d4));if(_0x4097d4[_0x4f20('0xd')]){if(_0x4097d4['error']['code']===0x1f4){logger[_0x4f20('0xd')](_0x4f20('0x9'),_0x3d28bb,_0x4097d4['error'][_0x4f20('0xe')]);return _0x1a67af(_0x4097d4[_0x4f20('0xd')][_0x4f20('0xe')]);}logger[_0x4f20('0xd')](_0x4f20('0x9'),_0x3d28bb,_0x4097d4['error']['message']);return _0x2cfd65(_0x4097d4['error'][_0x4f20('0xe')]);}else{logger[_0x4f20('0x8')](_0x4f20('0x9'),_0x3d28bb,_0x4f20('0xa'));_0x2cfd65(_0x4097d4[_0x4f20('0xf')][_0x4f20('0xe')]);}})[_0x4f20('0x10')](function(_0x4fb71f){logger['error'](_0x4f20('0x9'),_0x3d28bb,_0x4fb71f);_0x1a67af(_0x4fb71f);});});} \ No newline at end of file +var _0x6f21=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','bluebird','randomstring'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x6f21,0xac));var _0x16f2=function(_0x4dd327,_0x1b29b7){_0x4dd327=_0x4dd327-0x0;var _0x445a6e=_0x6f21[_0x4dd327];return _0x445a6e;};'use strict';var _=require(_0x16f2('0x0'));var util=require(_0x16f2('0x1'));var moment=require('moment');var BPromise=require(_0x16f2('0x2'));var rs=require(_0x16f2('0x3'));var fs=require('fs');var Redis=require(_0x16f2('0x4'));var db=require(_0x16f2('0x5'))['db'];var utils=require(_0x16f2('0x6'));var logger=require(_0x16f2('0x7'))('rpc');var config=require(_0x16f2('0x8'));var jayson=require(_0x16f2('0x9'));var client=jayson['client'][_0x16f2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x193e07,_0x481046,_0x280a7c){return new BPromise(function(_0x1b06c8,_0x44f605){return client[_0x16f2('0xb')](_0x193e07,_0x280a7c)[_0x16f2('0xc')](function(_0x3cae60){logger[_0x16f2('0xd')](_0x16f2('0xe'),_0x481046,_0x16f2('0xf'));logger[_0x16f2('0x10')](_0x16f2('0x11'),_0x481046,'request\x20sent',JSON['stringify'](_0x3cae60));if(_0x3cae60[_0x16f2('0x12')]){if(_0x3cae60['error'][_0x16f2('0x13')]===0x1f4){logger[_0x16f2('0x12')](_0x16f2('0xe'),_0x481046,_0x3cae60[_0x16f2('0x12')][_0x16f2('0x14')]);return _0x44f605(_0x3cae60[_0x16f2('0x12')][_0x16f2('0x14')]);}logger[_0x16f2('0x12')](_0x16f2('0xe'),_0x481046,_0x3cae60[_0x16f2('0x12')][_0x16f2('0x14')]);return _0x1b06c8(_0x3cae60[_0x16f2('0x12')][_0x16f2('0x14')]);}else{logger[_0x16f2('0xd')](_0x16f2('0xe'),_0x481046,_0x16f2('0xf'));_0x1b06c8(_0x3cae60[_0x16f2('0x15')][_0x16f2('0x14')]);}})['catch'](function(_0xfeaca6){logger[_0x16f2('0x12')](_0x16f2('0xe'),_0x481046,_0xfeaca6);_0x44f605(_0xfeaca6);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 11af91e..4997dad 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 _0x4f5d=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x4f5d[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0xd4f5('0x0'));var util=require(_0xd4f5('0x1'));var path=require(_0xd4f5('0x2'));var timeout=require(_0xd4f5('0x3'));var express=require(_0xd4f5('0x4'));var router=express[_0xd4f5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd4f5('0x6'));var interaction=require(_0xd4f5('0x7'));var config=require(_0xd4f5('0x8'));var controller=require(_0xd4f5('0x9'));router[_0xd4f5('0xa')]('/',auth[_0xd4f5('0xb')](),controller[_0xd4f5('0xc')]);router[_0xd4f5('0xa')](_0xd4f5('0xd'),auth[_0xd4f5('0xb')](),controller[_0xd4f5('0xe')]);router[_0xd4f5('0xf')]('/',auth[_0xd4f5('0xb')](),controller['create']);router[_0xd4f5('0x10')](_0xd4f5('0xd'),auth['isAuthenticated'](),controller[_0xd4f5('0x11')]);router[_0xd4f5('0x12')](_0xd4f5('0xd'),auth[_0xd4f5('0xb')](),controller[_0xd4f5('0x13')]);module[_0xd4f5('0x14')]=router; \ No newline at end of file +var _0x4312=['post','put','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated','get','/:id','show'];(function(_0x5a7618,_0x3f44c2){var _0x12dc65=function(_0x3cc4cd){while(--_0x3cc4cd){_0x5a7618['push'](_0x5a7618['shift']());}};_0x12dc65(++_0x3f44c2);}(_0x4312,0xaf));var _0x2431=function(_0x16d09a,_0x4d863a){_0x16d09a=_0x16d09a-0x0;var _0x567bca=_0x4312[_0x16d09a];return _0x567bca;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2431('0x0'));var timeout=require(_0x2431('0x1'));var express=require('express');var router=express[_0x2431('0x2')]();var fs_extra=require(_0x2431('0x3'));var auth=require(_0x2431('0x4'));var interaction=require(_0x2431('0x5'));var config=require(_0x2431('0x6'));var controller=require(_0x2431('0x7'));router['get']('/',auth[_0x2431('0x8')](),controller['index']);router[_0x2431('0x9')](_0x2431('0xa'),auth['isAuthenticated'](),controller[_0x2431('0xb')]);router[_0x2431('0xc')]('/',auth[_0x2431('0x8')](),controller['create']);router[_0x2431('0xd')](_0x2431('0xa'),auth[_0x2431('0x8')](),controller['update']);router[_0x2431('0xe')]('/:id',auth[_0x2431('0x8')](),controller[_0x2431('0xf')]);module[_0x2431('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 3ec3f74..1373605 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 _0x086e=['moment','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue'];(function(_0x389b58,_0x5ef9c2){var _0x5f4efe=function(_0x483967){while(--_0x483967){_0x389b58['push'](_0x389b58['shift']());}};_0x5f4efe(++_0x5ef9c2);}(_0x086e,0xaa));var _0xe086=function(_0x36bf4a,_0x13cf2f){_0x36bf4a=_0x36bf4a-0x0;var _0x3588c6=_0x086e[_0x36bf4a];return _0x3588c6;};'use strict';var moment=require(_0xe086('0x0'));var Sequelize=require('sequelize');module[_0xe086('0x1')]={'phone':{'type':Sequelize[_0xe086('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xe086('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xe086('0x4')],'defaultValue':moment()[_0xe086('0x5')](_0xe086('0x6'))},'countbusyretry':{'type':Sequelize[_0xe086('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe086('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe086('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe086('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe086('0x4')]},'priority':{'type':Sequelize[_0xe086('0x7')](0x2)[_0xe086('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xe086('0x7')],'unique':_0xe086('0x9')},'ListId':{'type':Sequelize[_0xe086('0x7')],'unique':_0xe086('0x9')},'UserId':{'type':Sequelize[_0xe086('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xe086('0x7')],'unique':_0xe086('0x9')},'CampaignId':{'type':Sequelize[_0xe086('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xe086('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe086('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe086('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe086('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe086('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0xba73=['sequelize','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED','contactListQueue','moment'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0xba73,0xdb));var _0x3ba7=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xba73[_0x4fbfd9];return _0x31dc94;};'use strict';var moment=require(_0x3ba7('0x0'));var Sequelize=require(_0x3ba7('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x3ba7('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3ba7('0x3')],'defaultValue':moment()[_0x3ba7('0x4')](_0x3ba7('0x5'))},'countbusyretry':{'type':Sequelize[_0x3ba7('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3ba7('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3ba7('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3ba7('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3ba7('0x3')]},'priority':{'type':Sequelize[_0x3ba7('0x6')](0x2)[_0x3ba7('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3ba7('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x3ba7('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x3ba7('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x3ba7('0x6')],'unique':_0x3ba7('0x9')},'CampaignId':{'type':Sequelize[_0x3ba7('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3ba7('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3ba7('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3ba7('0x6')],'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 442ca33..214c06f 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 _0x1310=['ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','Contact','CmCompany','Company','CmList','List','Queue','dialActive','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','eml-format','zip-dir','request-promise','moment','bluebird','util','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/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','end','error','name','index','map','CmHopper','rawAttributes','type','key','model','query','keys','filters','intersection','$and','$gt','$gte','$lt','$lte','$ne','$not','$between','$in','$notIn','$like','$notLike','$iLike','$notILike','$any','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','params','fields','create','body','find','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','state','deleted','campaign','user','UserId','deletedat','format','phone','campaigntype','queue'];(function(_0xa656f7,_0x8fbfcf){var _0x53421e=function(_0x46f774){while(--_0x46f774){_0xa656f7['push'](_0xa656f7['shift']());}};_0x53421e(++_0x8fbfcf);}(_0x1310,0x1d8));var _0x0131=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1310[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x0131('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0131('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0131('0x2'));var moment=require(_0x0131('0x3'));var BPromise=require(_0x0131('0x4'));var Mustache=require('mustache');var util=require(_0x0131('0x5'));var path=require('path');var sox=require(_0x0131('0x6'));var csv=require(_0x0131('0x7'));var ejs=require(_0x0131('0x8'));var fs=require('fs');var fs_extra=require(_0x0131('0x9'));var _=require(_0x0131('0xa'));var squel=require(_0x0131('0xb'));var crypto=require(_0x0131('0xc'));var jsforce=require(_0x0131('0xd'));var deskjs=require(_0x0131('0xe'));var toCsv=require(_0x0131('0x7'));var querystring=require(_0x0131('0xf'));var Papa=require(_0x0131('0x10'));var Redis=require(_0x0131('0x11'));var authService=require(_0x0131('0x12'));var qs=require(_0x0131('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0131('0x14'));var logger=require(_0x0131('0x15'))(_0x0131('0x16'));var utils=require(_0x0131('0x17'));var config=require(_0x0131('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0131('0x19'))['db'];function respondWithStatusCode(_0xb04a2f,_0x4dadbc){_0x4dadbc=_0x4dadbc||0xcc;return function(_0x114afa){if(_0x114afa){return _0xb04a2f[_0x0131('0x1a')](_0x4dadbc);}return _0xb04a2f[_0x0131('0x1b')](_0x4dadbc)['end']();};}function respondWithResult(_0x2c0872,_0x3b038e){_0x3b038e=_0x3b038e||0xc8;return function(_0x5251a5){if(_0x5251a5){return _0x2c0872[_0x0131('0x1b')](_0x3b038e)[_0x0131('0x1c')](_0x5251a5);}};}function respondWithFilteredResult(_0x599b1c,_0x47ded6){return function(_0xa1cd9c){if(_0xa1cd9c){var _0x435d40=typeof _0x47ded6['offset']===_0x0131('0x1d')&&typeof _0x47ded6['limit']===_0x0131('0x1d');var _0x266a5b=_0xa1cd9c[_0x0131('0x1e')];var _0x501408=_0x435d40?0x0:_0x47ded6[_0x0131('0x1f')];var _0x1eae74=_0x435d40?_0xa1cd9c[_0x0131('0x1e')]:_0x47ded6[_0x0131('0x1f')]+_0x47ded6[_0x0131('0x20')];var _0x2b9d1a;if(_0x1eae74>=_0x266a5b){_0x1eae74=_0x266a5b;_0x2b9d1a=0xc8;}else{_0x2b9d1a=0xce;}_0x599b1c[_0x0131('0x1b')](_0x2b9d1a);return _0x599b1c[_0x0131('0x21')](_0x0131('0x22'),_0x501408+'-'+_0x1eae74+'/'+_0x266a5b)['json'](_0xa1cd9c);}return null;};}function patchUpdates(_0x151a4c){return function(_0x16bb51){try{jsonpatch['apply'](_0x16bb51,_0x151a4c,!![]);}catch(_0x281d3d){return BPromise[_0x0131('0x23')](_0x281d3d);}return _0x16bb51[_0x0131('0x24')]();};}function saveUpdates(_0x5caf76,_0x2121b3){return function(_0x4f795f){if(_0x4f795f){return _0x4f795f[_0x0131('0x25')](_0x5caf76)['then'](function(_0x386d74){return _0x386d74;});}return null;};}function removeEntity(_0x2f54a3,_0x55ce42){return function(_0x3d8737){if(_0x3d8737){return _0x3d8737[_0x0131('0x26')]()[_0x0131('0x27')](function(){_0x2f54a3[_0x0131('0x1b')](0xcc)[_0x0131('0x28')]();});}};}function handleEntityNotFound(_0xb0cc2c,_0x153ee6){return function(_0x281caa){if(!_0x281caa){_0xb0cc2c[_0x0131('0x1a')](0x194);}return _0x281caa;};}function handleError(_0x2147d4,_0xb943f3){_0xb943f3=_0xb943f3||0x1f4;return function(_0x56791b){logger[_0x0131('0x29')](_0x56791b['stack']);if(_0x56791b[_0x0131('0x2a')]){delete _0x56791b[_0x0131('0x2a')];}_0x2147d4[_0x0131('0x1b')](_0xb943f3)['send'](_0x56791b);};}exports[_0x0131('0x2b')]=function(_0x3e246d,_0x402749){var _0x24ecce={},_0x3831ff={},_0x1d1f37={'count':0x0,'rows':[]};var _0x5a9bba=_[_0x0131('0x2c')](db[_0x0131('0x2d')][_0x0131('0x2e')],function(_0x4c3865){return{'name':_0x4c3865['fieldName'],'type':_0x4c3865[_0x0131('0x2f')][_0x0131('0x30')]};});_0x3831ff[_0x0131('0x31')]=_[_0x0131('0x2c')](_0x5a9bba,'name');_0x3831ff[_0x0131('0x32')]=_[_0x0131('0x33')](_0x3e246d[_0x0131('0x32')]);_0x3831ff[_0x0131('0x34')]=_[_0x0131('0x35')](_0x3831ff[_0x0131('0x31')],_0x3831ff['query']);_0x3831ff[_0x0131('0x34')]=_['concat'](_0x3831ff[_0x0131('0x34')],[_0x0131('0x36'),'$or',_0x0131('0x37'),_0x0131('0x38'),_0x0131('0x39'),_0x0131('0x3a'),_0x0131('0x3b'),'$eq',_0x0131('0x3c'),_0x0131('0x3d'),'$notBetween',_0x0131('0x3e'),_0x0131('0x3f'),_0x0131('0x40'),_0x0131('0x41'),_0x0131('0x42'),_0x0131('0x43'),_0x0131('0x40'),'$overlap','$contains','$contained',_0x0131('0x44')]);_0x24ecce[_0x0131('0x45')]=_[_0x0131('0x35')](_0x3831ff[_0x0131('0x31')],qs['fields'](_0x3e246d[_0x0131('0x32')]['fields']));_0x24ecce[_0x0131('0x45')]=_0x24ecce['attributes'][_0x0131('0x46')]?_0x24ecce['attributes']:_0x3831ff[_0x0131('0x31')];if(!_0x3e246d[_0x0131('0x32')]['hasOwnProperty'](_0x0131('0x47'))){_0x24ecce[_0x0131('0x20')]=qs[_0x0131('0x20')](_0x3e246d[_0x0131('0x32')][_0x0131('0x20')]);_0x24ecce[_0x0131('0x1f')]=qs[_0x0131('0x1f')](_0x3e246d['query']['offset']);}_0x24ecce[_0x0131('0x48')]=qs[_0x0131('0x49')](_0x3e246d[_0x0131('0x32')][_0x0131('0x49')]);_0x24ecce[_0x0131('0x4a')]=qs[_0x0131('0x34')](_[_0x0131('0x4b')](_0x3e246d['query'],_0x3831ff[_0x0131('0x34')]),_0x5a9bba);if(_0x3e246d[_0x0131('0x32')][_0x0131('0x4c')]){_0x24ecce[_0x0131('0x4a')]=_[_0x0131('0x4d')](_0x24ecce[_0x0131('0x4a')],{'$or':_[_0x0131('0x2c')](_0x5a9bba,function(_0x29bdf7){if(_0x29bdf7['type']!=='VIRTUAL'){var _0x9b7559={};_0x9b7559[_0x29bdf7[_0x0131('0x2a')]]={'$like':'%'+_0x3e246d[_0x0131('0x32')][_0x0131('0x4c')]+'%'};return _0x9b7559;}})});}_0x24ecce=_['merge']({},_0x24ecce,_0x3e246d[_0x0131('0x4e')]);var _0x1f5294={'where':_0x24ecce[_0x0131('0x4a')]};return db[_0x0131('0x2d')][_0x0131('0x1e')](_0x1f5294)[_0x0131('0x27')](function(_0x1ae822){_0x1d1f37[_0x0131('0x1e')]=_0x1ae822;if(_0x3e246d['query']['includeAll']){_0x24ecce[_0x0131('0x4f')]=[{'all':!![]}];}return db['CmHopper'][_0x0131('0x50')](_0x24ecce);})[_0x0131('0x27')](function(_0x2ec289){_0x1d1f37[_0x0131('0x51')]=_0x2ec289;return _0x1d1f37;})[_0x0131('0x27')](respondWithFilteredResult(_0x402749,_0x24ecce))[_0x0131('0x52')](handleError(_0x402749,null));};exports['show']=function(_0xe23d74,_0x32f363){var _0x2d864c={'raw':!![],'where':{'id':_0xe23d74[_0x0131('0x53')]['id']}},_0x3f787b={};_0x3f787b[_0x0131('0x31')]=_[_0x0131('0x33')](db[_0x0131('0x2d')][_0x0131('0x2e')]);_0x3f787b[_0x0131('0x32')]=_[_0x0131('0x33')](_0xe23d74[_0x0131('0x32')]);_0x3f787b[_0x0131('0x34')]=_[_0x0131('0x35')](_0x3f787b[_0x0131('0x31')],_0x3f787b[_0x0131('0x32')]);_0x2d864c[_0x0131('0x45')]=_['intersection'](_0x3f787b[_0x0131('0x31')],qs[_0x0131('0x54')](_0xe23d74['query'][_0x0131('0x54')]));_0x2d864c['attributes']=_0x2d864c[_0x0131('0x45')][_0x0131('0x46')]?_0x2d864c[_0x0131('0x45')]:_0x3f787b[_0x0131('0x31')];if(_0xe23d74['query']['includeAll']){_0x2d864c[_0x0131('0x4f')]=[{'all':!![]}];}_0x2d864c=_[_0x0131('0x4d')]({},_0x2d864c,_0xe23d74['options']);return db[_0x0131('0x2d')]['find'](_0x2d864c)[_0x0131('0x27')](handleEntityNotFound(_0x32f363,null))[_0x0131('0x27')](respondWithResult(_0x32f363,null))[_0x0131('0x52')](handleError(_0x32f363,null));};exports[_0x0131('0x55')]=function(_0x1404d2,_0xce4b96){return db[_0x0131('0x2d')][_0x0131('0x55')](_0x1404d2['body'],{})[_0x0131('0x27')](respondWithResult(_0xce4b96,0xc9))[_0x0131('0x52')](handleError(_0xce4b96,null));};exports[_0x0131('0x25')]=function(_0x2a26bd,_0x1c2714){if(_0x2a26bd[_0x0131('0x56')]['id']){delete _0x2a26bd[_0x0131('0x56')]['id'];}return db['CmHopper'][_0x0131('0x57')]({'where':{'id':_0x2a26bd[_0x0131('0x53')]['id']}})['then'](handleEntityNotFound(_0x1c2714,null))[_0x0131('0x27')](saveUpdates(_0x2a26bd[_0x0131('0x56')],null))[_0x0131('0x27')](respondWithResult(_0x1c2714,null))[_0x0131('0x52')](handleError(_0x1c2714,null));};exports[_0x0131('0x58')]=function(_0x2e9fe9,_0x1a127a){return db[_0x0131('0x2d')][_0x0131('0x58')]()['then'](respondWithResult(_0x1a127a,null))[_0x0131('0x52')](handleError(_0x1a127a,null));};exports['destroy']=function(_0x1dc855,_0x3e5f23){var _0x2ea990;return db[_0x0131('0x2d')][_0x0131('0x57')]({'where':{'id':_0x1dc855[_0x0131('0x53')]['id']}})[_0x0131('0x27')](handleEntityNotFound(_0x3e5f23,null))['then'](function(_0x2bdbf2){if(_0x2bdbf2){return _0x2bdbf2[_0x0131('0x26')]()['then'](function(_0x494251){return _0x494251;});}})['then'](function(_0x382a28){_0x2ea990=_0x382a28;if(_0x382a28){if(_0x382a28[_0x0131('0x59')]||_0x382a28[_0x0131('0x5a')]){return db[_0x382a28[_0x0131('0x59')]?_0x0131('0x5b'):_0x0131('0x5c')][_0x0131('0x57')]({'where':{'id':_0x382a28[_0x0131('0x59')]?_0x382a28[_0x0131('0x59')]:_0x382a28[_0x0131('0x5a')]},'attributes':['id',_0x0131('0x2a')],'raw':!![]});}}})[_0x0131('0x27')](function(_0xe945){var _0x5affeb={};if(_0xe945){_['merge'](_0x5affeb,_[_0x0131('0x5d')](_0x2ea990['dataValues'],['createdAt','updatedAt','id']));_0x5affeb[_0x0131('0x5e')]=0x15;_0x5affeb['statedesc']=_0x0131('0x5f');_0x5affeb[_0x0131('0x60')]=_0xe945[_0x0131('0x2a')];_0x5affeb['membername']=_0x1dc855[_0x0131('0x61')][_0x0131('0x2a')];_0x5affeb[_0x0131('0x62')]=_0x1dc855['user']['id'];_0x5affeb['deleted']=!![];_0x5affeb[_0x0131('0x63')]=moment()[_0x0131('0x64')]('YYYY-MM-DD\x20HH:mm:ss');_0x5affeb['calleridnum']=_0x2ea990[_0x0131('0x65')];_0x5affeb[_0x0131('0x66')]=_0x2ea990[_0x0131('0x59')]?_0x0131('0x67'):_0x0131('0x68');return db[_0x0131('0x69')][_0x0131('0x57')]({'where':{'id':_0x5affeb[_0x0131('0x6a')]},'attributes':[_0x0131('0x6b'),_0x0131('0x6c')]})['then'](function(_0x20946e){if(!_[_0x0131('0x6d')](_0x3e5f23)&&!_[_0x0131('0x6d')](_0x20946e[_0x0131('0x6b')])){_0x5affeb['calleridname']=_0x20946e['firstName'];if(!_[_0x0131('0x6d')](_0x20946e[_0x0131('0x6c')])){_0x5affeb[_0x0131('0x6e')]+='\x20'+_0x20946e[_0x0131('0x6c')];}}})['finally'](function(){return db[_0x0131('0x6f')][_0x0131('0x55')](_0x5affeb);});}})[_0x0131('0x27')](function(){return _0x3e5f23['status'](0xcc)[_0x0131('0x28')]();})[_0x0131('0x52')](handleError(_0x3e5f23,null));};exports[_0x0131('0x70')]=function(_0x5c00b4,_0x477618,_0x380783){var _0x339da5=[];return db['CmContact'][_0x0131('0x58')]()[_0x0131('0x27')](function(_0x30c7b1){_0x339da5=_[_0x0131('0x33')](_0x30c7b1);return _0x5c00b4['user'][_0x0131('0x71')]({'where':{'type':_0x0131('0x72'),'dialActive':!![],'dialMethod':_0x0131('0x73')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0x0131('0x27')](function(_0x35ad0a){if(_0x35ad0a&&_0x35ad0a[_0x0131('0x46')]){return db[_0x0131('0x74')][_0x0131('0x75')](function(_0x4d2cbe){var _0x504ad5={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0131('0x64')](_0x0131('0x76'))},'VoiceQueueId':{'$in':_[_0x0131('0x2c')](_0x35ad0a,'id')},'$or':[{'UserId':null},{'UserId':_0x5c00b4['user']['id']}]};var _0x4d27d2=[];if(_0x5c00b4[_0x0131('0x56')][_0x0131('0x77')]&&_0x5c00b4['body'][_0x0131('0x77')]===_0x0131('0x78')){if(!_[_0x0131('0x79')](_0x5c00b4[_0x0131('0x56')][_0x0131('0x7a')])){_0x504ad5['id']={'$in':_0x5c00b4[_0x0131('0x56')][_0x0131('0x7a')]};}_0x4d27d2=[[_0x0131('0x7b'),_0x0131('0x7c')],[_0x0131('0x7d'),_0x35ad0a[0x0][_0x0131('0x7e')]===_0x0131('0x7c')?_0x0131('0x7f'):_0x0131('0x7c')],db[_0x0131('0x74')][_0x0131('0x80')](_0x0131('0x81')),['id',_0x0131('0x7f')]];}else{if(!_['isEmpty'](_0x5c00b4['body'][_0x0131('0x7a')])){_0x504ad5['id']={'$notIn':_0x5c00b4[_0x0131('0x56')][_0x0131('0x7a')]};}_0x4d27d2=[[_0x0131('0x7b'),_0x0131('0x7f')],['scheduledAt',_0x35ad0a[0x0][_0x0131('0x7e')]],db[_0x0131('0x74')][_0x0131('0x80')](_0x0131('0x82')),['id',_0x0131('0x7c')]];}return db[_0x0131('0x2d')][_0x0131('0x83')]({'attributes':['id',_0x0131('0x84')],'where':_0x504ad5,'order':_0x4d27d2,'transaction':_0x4d2cbe,'lock':_0x4d2cbe[_0x0131('0x85')]['UPDATE'],'include':[{'model':db[_0x0131('0x69')],'as':_0x0131('0x86'),'attributes':_0x339da5,'include':[{'model':db[_0x0131('0x87')],'as':_0x0131('0x88'),'attributes':['id',_0x0131('0x2a')]}]},{'model':db[_0x0131('0x89')],'as':_0x0131('0x8a'),'attributes':['id','name']},{'model':db[_0x0131('0x5b')],'as':_0x0131('0x8b'),'attributes':['id',_0x0131('0x2a'),_0x0131('0x8c')]}]})[_0x0131('0x27')](function(_0x55c574){if(_0x55c574){return _0x55c574[_0x0131('0x25')]({'UserId':_0x5c00b4[_0x0131('0x61')]['id']},{'transaction':_0x4d2cbe});}});});}})[_0x0131('0x27')](handleEntityNotFound(_0x477618,null))[_0x0131('0x27')](respondWithResult(_0x477618,null))[_0x0131('0x52')](handleError(_0x477618,null));};exports['getOpenContacts']=function(_0x347866,_0x48b019,_0x56b5d2){return _0x347866['user']['getVoiceQueues']({'where':{'type':_0x0131('0x72'),'dialActive':!![],'dialMethod':_0x0131('0x73')},'attributes':['id'],'raw':!![]})['then'](function(_0x3af69d){if(_0x3af69d&&_0x3af69d[_0x0131('0x46')]){return db[_0x0131('0x2d')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0131('0x64')](_0x0131('0x76'))},'VoiceQueueId':{'$in':_[_0x0131('0x2c')](_0x3af69d,'id')},'$or':[{'UserId':null},{'UserId':_0x347866['user']['id']}]}});}return 0x0;})[_0x0131('0x27')](function(_0x58411a){if(!_[_0x0131('0x6d')](_0x58411a)&&_['isNumber'](_0x58411a)){return _0x48b019[_0x0131('0x1b')](0xc8)['json']({'contacts':_0x58411a});}else{logger[_0x0131('0x29')](_0x0131('0x8d'),_0x0131('0x8e'),0x194,_0x0131('0x8f'));_0x48b019[_0x0131('0x1a')](0x194);}})['catch'](handleError(_0x48b019,null));}; \ No newline at end of file +var _0xddda=['isNil','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','findOne','LOCK','UPDATE','CmCompany','Company','CmList','VoiceQueue','Queue','dialActive','getOpenContacts','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','sendStatus','stack','name','index','map','CmHopper','fieldName','model','query','filters','concat','$and','$or','$gt','$gte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$iLike','$overlap','$contains','$contained','$any','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','options','find','create','body','describe','destroy','VoiceQueueId','Campaign','CampaignId','omit','dataValues','createdAt','updatedAt','state','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','firstName','lastName'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0xddda,0xb5));var _0xaddd=function(_0x2daff6,_0x18a06f){_0x2daff6=_0x2daff6-0x0;var _0x19a3d6=_0xddda[_0x2daff6];return _0x19a3d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaddd('0x0'));var zipdir=require(_0xaddd('0x1'));var jsonpatch=require(_0xaddd('0x2'));var rp=require(_0xaddd('0x3'));var moment=require('moment');var BPromise=require(_0xaddd('0x4'));var Mustache=require(_0xaddd('0x5'));var util=require(_0xaddd('0x6'));var path=require(_0xaddd('0x7'));var sox=require(_0xaddd('0x8'));var csv=require(_0xaddd('0x9'));var ejs=require(_0xaddd('0xa'));var fs=require('fs');var fs_extra=require(_0xaddd('0xb'));var _=require(_0xaddd('0xc'));var squel=require('squel');var crypto=require(_0xaddd('0xd'));var jsforce=require(_0xaddd('0xe'));var deskjs=require(_0xaddd('0xf'));var toCsv=require(_0xaddd('0x9'));var querystring=require(_0xaddd('0x10'));var Papa=require(_0xaddd('0x11'));var Redis=require('ioredis');var authService=require(_0xaddd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xaddd('0x13'));var hardwareService=require(_0xaddd('0x14'));var logger=require(_0xaddd('0x15'))(_0xaddd('0x16'));var utils=require(_0xaddd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xaddd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bcea5,_0x9a33d){_0x9a33d=_0x9a33d||0xcc;return function(_0x65cbd){if(_0x65cbd){return _0x4bcea5['sendStatus'](_0x9a33d);}return _0x4bcea5[_0xaddd('0x19')](_0x9a33d)[_0xaddd('0x1a')]();};}function respondWithResult(_0x3d90a3,_0x1721f9){_0x1721f9=_0x1721f9||0xc8;return function(_0x12b4a0){if(_0x12b4a0){return _0x3d90a3[_0xaddd('0x19')](_0x1721f9)[_0xaddd('0x1b')](_0x12b4a0);}};}function respondWithFilteredResult(_0x57094a,_0x37c24b){return function(_0x329e3d){if(_0x329e3d){var _0x44b1d1=typeof _0x37c24b[_0xaddd('0x1c')]===_0xaddd('0x1d')&&typeof _0x37c24b[_0xaddd('0x1e')]===_0xaddd('0x1d');var _0x57bf00=_0x329e3d[_0xaddd('0x1f')];var _0x23fb8e=_0x44b1d1?0x0:_0x37c24b[_0xaddd('0x1c')];var _0x4290ef=_0x44b1d1?_0x329e3d[_0xaddd('0x1f')]:_0x37c24b[_0xaddd('0x1c')]+_0x37c24b[_0xaddd('0x1e')];var _0x51c498;if(_0x4290ef>=_0x57bf00){_0x4290ef=_0x57bf00;_0x51c498=0xc8;}else{_0x51c498=0xce;}_0x57094a['status'](_0x51c498);return _0x57094a[_0xaddd('0x20')](_0xaddd('0x21'),_0x23fb8e+'-'+_0x4290ef+'/'+_0x57bf00)['json'](_0x329e3d);}return null;};}function patchUpdates(_0x2df141){return function(_0x12bcb0){try{jsonpatch[_0xaddd('0x22')](_0x12bcb0,_0x2df141,!![]);}catch(_0x1614fa){return BPromise['reject'](_0x1614fa);}return _0x12bcb0['save']();};}function saveUpdates(_0x1e7db8,_0x501165){return function(_0x14e62a){if(_0x14e62a){return _0x14e62a[_0xaddd('0x23')](_0x1e7db8)[_0xaddd('0x24')](function(_0x3a4f85){return _0x3a4f85;});}return null;};}function removeEntity(_0xef5e67,_0x40e9c6){return function(_0x399a92){if(_0x399a92){return _0x399a92['destroy']()[_0xaddd('0x24')](function(){_0xef5e67[_0xaddd('0x19')](0xcc)[_0xaddd('0x1a')]();});}};}function handleEntityNotFound(_0x342b06,_0x2de20b){return function(_0x321839){if(!_0x321839){_0x342b06[_0xaddd('0x25')](0x194);}return _0x321839;};}function handleError(_0x2f9d5c,_0x4429a1){_0x4429a1=_0x4429a1||0x1f4;return function(_0x29babb){logger['error'](_0x29babb[_0xaddd('0x26')]);if(_0x29babb[_0xaddd('0x27')]){delete _0x29babb[_0xaddd('0x27')];}_0x2f9d5c[_0xaddd('0x19')](_0x4429a1)['send'](_0x29babb);};}exports[_0xaddd('0x28')]=function(_0x52b269,_0x22b5f9){var _0x2783d2={},_0x524238={},_0x5efc68={'count':0x0,'rows':[]};var _0x225a2b=_[_0xaddd('0x29')](db[_0xaddd('0x2a')]['rawAttributes'],function(_0x4eeb17){return{'name':_0x4eeb17[_0xaddd('0x2b')],'type':_0x4eeb17['type']['key']};});_0x524238[_0xaddd('0x2c')]=_[_0xaddd('0x29')](_0x225a2b,'name');_0x524238['query']=_['keys'](_0x52b269[_0xaddd('0x2d')]);_0x524238[_0xaddd('0x2e')]=_['intersection'](_0x524238['model'],_0x524238[_0xaddd('0x2d')]);_0x524238[_0xaddd('0x2e')]=_[_0xaddd('0x2f')](_0x524238[_0xaddd('0x2e')],[_0xaddd('0x30'),_0xaddd('0x31'),_0xaddd('0x32'),_0xaddd('0x33'),'$lt','$lte',_0xaddd('0x34'),_0xaddd('0x35'),_0xaddd('0x36'),_0xaddd('0x37'),_0xaddd('0x38'),'$in',_0xaddd('0x39'),_0xaddd('0x3a'),'$notLike',_0xaddd('0x3b'),'$notILike',_0xaddd('0x3a'),_0xaddd('0x3c'),_0xaddd('0x3d'),_0xaddd('0x3e'),_0xaddd('0x3f')]);_0x2783d2[_0xaddd('0x40')]=_[_0xaddd('0x41')](_0x524238[_0xaddd('0x2c')],qs[_0xaddd('0x42')](_0x52b269[_0xaddd('0x2d')][_0xaddd('0x42')]));_0x2783d2[_0xaddd('0x40')]=_0x2783d2[_0xaddd('0x40')][_0xaddd('0x43')]?_0x2783d2['attributes']:_0x524238[_0xaddd('0x2c')];if(!_0x52b269[_0xaddd('0x2d')]['hasOwnProperty'](_0xaddd('0x44'))){_0x2783d2['limit']=qs[_0xaddd('0x1e')](_0x52b269[_0xaddd('0x2d')]['limit']);_0x2783d2['offset']=qs[_0xaddd('0x1c')](_0x52b269[_0xaddd('0x2d')][_0xaddd('0x1c')]);}_0x2783d2[_0xaddd('0x45')]=qs['sort'](_0x52b269['query'][_0xaddd('0x46')]);_0x2783d2[_0xaddd('0x47')]=qs[_0xaddd('0x2e')](_[_0xaddd('0x48')](_0x52b269[_0xaddd('0x2d')],_0x524238[_0xaddd('0x2e')]),_0x225a2b);if(_0x52b269[_0xaddd('0x2d')][_0xaddd('0x49')]){_0x2783d2[_0xaddd('0x47')]=_[_0xaddd('0x4a')](_0x2783d2['where'],{'$or':_[_0xaddd('0x29')](_0x225a2b,function(_0x2ff8b9){if(_0x2ff8b9[_0xaddd('0x4b')]!==_0xaddd('0x4c')){var _0x3cb08b={};_0x3cb08b[_0x2ff8b9[_0xaddd('0x27')]]={'$like':'%'+_0x52b269[_0xaddd('0x2d')][_0xaddd('0x49')]+'%'};return _0x3cb08b;}})});}_0x2783d2=_['merge']({},_0x2783d2,_0x52b269['options']);var _0xebcdaa={'where':_0x2783d2[_0xaddd('0x47')]};return db[_0xaddd('0x2a')][_0xaddd('0x1f')](_0xebcdaa)[_0xaddd('0x24')](function(_0x23e1c3){_0x5efc68[_0xaddd('0x1f')]=_0x23e1c3;if(_0x52b269[_0xaddd('0x2d')][_0xaddd('0x4d')]){_0x2783d2['include']=[{'all':!![]}];}return db[_0xaddd('0x2a')][_0xaddd('0x4e')](_0x2783d2);})[_0xaddd('0x24')](function(_0x11ac29){_0x5efc68[_0xaddd('0x4f')]=_0x11ac29;return _0x5efc68;})[_0xaddd('0x24')](respondWithFilteredResult(_0x22b5f9,_0x2783d2))[_0xaddd('0x50')](handleError(_0x22b5f9,null));};exports[_0xaddd('0x51')]=function(_0x5aa956,_0x187d57){var _0x3d7836={'raw':!![],'where':{'id':_0x5aa956[_0xaddd('0x52')]['id']}},_0x4f1e90={};_0x4f1e90[_0xaddd('0x2c')]=_[_0xaddd('0x53')](db[_0xaddd('0x2a')][_0xaddd('0x54')]);_0x4f1e90[_0xaddd('0x2d')]=_[_0xaddd('0x53')](_0x5aa956['query']);_0x4f1e90[_0xaddd('0x2e')]=_[_0xaddd('0x41')](_0x4f1e90[_0xaddd('0x2c')],_0x4f1e90['query']);_0x3d7836[_0xaddd('0x40')]=_['intersection'](_0x4f1e90['model'],qs['fields'](_0x5aa956[_0xaddd('0x2d')][_0xaddd('0x42')]));_0x3d7836['attributes']=_0x3d7836[_0xaddd('0x40')]['length']?_0x3d7836[_0xaddd('0x40')]:_0x4f1e90[_0xaddd('0x2c')];if(_0x5aa956[_0xaddd('0x2d')][_0xaddd('0x4d')]){_0x3d7836[_0xaddd('0x55')]=[{'all':!![]}];}_0x3d7836=_['merge']({},_0x3d7836,_0x5aa956[_0xaddd('0x56')]);return db[_0xaddd('0x2a')][_0xaddd('0x57')](_0x3d7836)[_0xaddd('0x24')](handleEntityNotFound(_0x187d57,null))[_0xaddd('0x24')](respondWithResult(_0x187d57,null))['catch'](handleError(_0x187d57,null));};exports[_0xaddd('0x58')]=function(_0x4cd686,_0x352001){return db[_0xaddd('0x2a')][_0xaddd('0x58')](_0x4cd686['body'],{})[_0xaddd('0x24')](respondWithResult(_0x352001,0xc9))[_0xaddd('0x50')](handleError(_0x352001,null));};exports['update']=function(_0x28f3cd,_0x413fca){if(_0x28f3cd[_0xaddd('0x59')]['id']){delete _0x28f3cd[_0xaddd('0x59')]['id'];}return db[_0xaddd('0x2a')][_0xaddd('0x57')]({'where':{'id':_0x28f3cd[_0xaddd('0x52')]['id']}})['then'](handleEntityNotFound(_0x413fca,null))[_0xaddd('0x24')](saveUpdates(_0x28f3cd['body'],null))[_0xaddd('0x24')](respondWithResult(_0x413fca,null))[_0xaddd('0x50')](handleError(_0x413fca,null));};exports[_0xaddd('0x5a')]=function(_0x740236,_0x184f69){return db[_0xaddd('0x2a')][_0xaddd('0x5a')]()[_0xaddd('0x24')](respondWithResult(_0x184f69,null))[_0xaddd('0x50')](handleError(_0x184f69,null));};exports[_0xaddd('0x5b')]=function(_0x28e9e0,_0x18eecd){var _0x54ab28;return db[_0xaddd('0x2a')]['find']({'where':{'id':_0x28e9e0[_0xaddd('0x52')]['id']}})[_0xaddd('0x24')](handleEntityNotFound(_0x18eecd,null))[_0xaddd('0x24')](function(_0x3465e8){if(_0x3465e8){return _0x3465e8[_0xaddd('0x5b')]()['then'](function(_0x8c48b4){return _0x8c48b4;});}})['then'](function(_0x57b745){_0x54ab28=_0x57b745;if(_0x57b745){if(_0x57b745[_0xaddd('0x5c')]||_0x57b745['CampaignId']){return db[_0x57b745[_0xaddd('0x5c')]?'VoiceQueue':_0xaddd('0x5d')]['find']({'where':{'id':_0x57b745[_0xaddd('0x5c')]?_0x57b745[_0xaddd('0x5c')]:_0x57b745[_0xaddd('0x5e')]},'attributes':['id',_0xaddd('0x27')],'raw':!![]});}}})[_0xaddd('0x24')](function(_0x223c20){var _0x48db16={};if(_0x223c20){_[_0xaddd('0x4a')](_0x48db16,_[_0xaddd('0x5f')](_0x54ab28[_0xaddd('0x60')],[_0xaddd('0x61'),_0xaddd('0x62'),'id']));_0x48db16[_0xaddd('0x63')]=0x15;_0x48db16['statedesc']=_0xaddd('0x64');_0x48db16[_0xaddd('0x65')]=_0x223c20[_0xaddd('0x27')];_0x48db16[_0xaddd('0x66')]=_0x28e9e0['user'][_0xaddd('0x27')];_0x48db16['UserId']=_0x28e9e0[_0xaddd('0x67')]['id'];_0x48db16[_0xaddd('0x64')]=!![];_0x48db16[_0xaddd('0x68')]=moment()[_0xaddd('0x69')](_0xaddd('0x6a'));_0x48db16[_0xaddd('0x6b')]=_0x54ab28[_0xaddd('0x6c')];_0x48db16[_0xaddd('0x6d')]=_0x54ab28[_0xaddd('0x5c')]?_0xaddd('0x6e'):_0xaddd('0x6f');return db[_0xaddd('0x70')][_0xaddd('0x57')]({'where':{'id':_0x48db16['ContactId']},'attributes':[_0xaddd('0x71'),_0xaddd('0x72')]})[_0xaddd('0x24')](function(_0x7a32e8){if(!_[_0xaddd('0x73')](_0x18eecd)&&!_[_0xaddd('0x73')](_0x7a32e8[_0xaddd('0x71')])){_0x48db16[_0xaddd('0x74')]=_0x7a32e8[_0xaddd('0x71')];if(!_['isNil'](_0x7a32e8[_0xaddd('0x72')])){_0x48db16[_0xaddd('0x74')]+='\x20'+_0x7a32e8[_0xaddd('0x72')];}}})[_0xaddd('0x75')](function(){return db[_0xaddd('0x76')][_0xaddd('0x58')](_0x48db16);});}})[_0xaddd('0x24')](function(){return _0x18eecd[_0xaddd('0x19')](0xcc)[_0xaddd('0x1a')]();})[_0xaddd('0x50')](handleError(_0x18eecd,null));};exports[_0xaddd('0x77')]=function(_0x4fae39,_0x65a697,_0xc0bab6){var _0x556f15=[];return db[_0xaddd('0x70')][_0xaddd('0x5a')]()['then'](function(_0x5c7736){_0x556f15=_[_0xaddd('0x53')](_0x5c7736);return _0x4fae39[_0xaddd('0x67')][_0xaddd('0x78')]({'where':{'type':_0xaddd('0x79'),'dialActive':!![],'dialMethod':_0xaddd('0x7a')},'attributes':['id',_0xaddd('0x7b')],'raw':!![]});})[_0xaddd('0x24')](function(_0x29cb04){if(_0x29cb04&&_0x29cb04[_0xaddd('0x43')]){return db[_0xaddd('0x7c')][_0xaddd('0x7d')](function(_0x3730a2){var _0x1aa5ba={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xaddd('0x6a'))},'VoiceQueueId':{'$in':_[_0xaddd('0x29')](_0x29cb04,'id')},'$or':[{'UserId':null},{'UserId':_0x4fae39['user']['id']}]};var _0x1fda33=[];if(_0x4fae39['body'][_0xaddd('0x7e')]&&_0x4fae39['body'][_0xaddd('0x7e')]==='prev'){if(!_[_0xaddd('0x7f')](_0x4fae39[_0xaddd('0x59')]['hopperIds'])){_0x1aa5ba['id']={'$in':_0x4fae39[_0xaddd('0x59')][_0xaddd('0x80')]};}_0x1fda33=[[_0xaddd('0x81'),_0xaddd('0x82')],[_0xaddd('0x83'),_0x29cb04[0x0][_0xaddd('0x7b')]===_0xaddd('0x82')?_0xaddd('0x84'):'ASC'],db[_0xaddd('0x7c')][_0xaddd('0x85')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0xaddd('0x7f')](_0x4fae39[_0xaddd('0x59')]['hopperIds'])){_0x1aa5ba['id']={'$notIn':_0x4fae39['body'][_0xaddd('0x80')]};}_0x1fda33=[[_0xaddd('0x81'),_0xaddd('0x84')],[_0xaddd('0x83'),_0x29cb04[0x0][_0xaddd('0x7b')]],db[_0xaddd('0x7c')][_0xaddd('0x85')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xaddd('0x82')]];}return db[_0xaddd('0x2a')][_0xaddd('0x86')]({'attributes':['id','scheduledat'],'where':_0x1aa5ba,'order':_0x1fda33,'transaction':_0x3730a2,'lock':_0x3730a2[_0xaddd('0x87')][_0xaddd('0x88')],'include':[{'model':db[_0xaddd('0x70')],'as':'Contact','attributes':_0x556f15,'include':[{'model':db[_0xaddd('0x89')],'as':_0xaddd('0x8a'),'attributes':['id',_0xaddd('0x27')]}]},{'model':db[_0xaddd('0x8b')],'as':'List','attributes':['id','name']},{'model':db[_0xaddd('0x8c')],'as':_0xaddd('0x8d'),'attributes':['id','name',_0xaddd('0x8e')]}]})[_0xaddd('0x24')](function(_0x4030f6){if(_0x4030f6){return _0x4030f6['update']({'UserId':_0x4fae39['user']['id']},{'transaction':_0x3730a2});}});});}})[_0xaddd('0x24')](handleEntityNotFound(_0x65a697,null))['then'](respondWithResult(_0x65a697,null))[_0xaddd('0x50')](handleError(_0x65a697,null));};exports[_0xaddd('0x8f')]=function(_0x1aa7d7,_0x411d4e,_0x5e56a8){return _0x1aa7d7[_0xaddd('0x67')][_0xaddd('0x78')]({'where':{'type':_0xaddd('0x79'),'dialActive':!![],'dialMethod':_0xaddd('0x7a')},'attributes':['id'],'raw':!![]})[_0xaddd('0x24')](function(_0x79f59a){if(_0x79f59a&&_0x79f59a[_0xaddd('0x43')]){return db[_0xaddd('0x2a')][_0xaddd('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xaddd('0x69')](_0xaddd('0x6a'))},'VoiceQueueId':{'$in':_[_0xaddd('0x29')](_0x79f59a,'id')},'$or':[{'UserId':null},{'UserId':_0x1aa7d7['user']['id']}]}});}return 0x0;})[_0xaddd('0x24')](function(_0x318638){if(!_[_0xaddd('0x73')](_0x318638)&&_[_0xaddd('0x90')](_0x318638)){return _0x411d4e['status'](0xc8)[_0xaddd('0x1b')]({'contacts':_0x318638});}else{logger[_0xaddd('0x91')](_0xaddd('0x92'),_0xaddd('0x8f'),0x194,_0xaddd('0x93'));_0x411d4e[_0xaddd('0x25')](0x194);}})[_0xaddd('0x50')](handleError(_0x411d4e,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index b6ce7bb..71c5c80 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 _0x1883=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x14d8d6,_0x14de81){var _0x25c22f=function(_0x37ead1){while(--_0x37ead1){_0x14d8d6['push'](_0x14d8d6['shift']());}};_0x25c22f(++_0x14de81);}(_0x1883,0xab));var _0x3188=function(_0x1c3bc6,_0x753254){_0x1c3bc6=_0x1c3bc6-0x0;var _0xe4e14b=_0x1883[_0x1c3bc6];return _0xe4e14b;};'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'));module[_0x3188('0xb')]=function(_0x408ae0,_0x33b62d){return _0x408ae0[_0x3188('0xc')](_0x3188('0xd'),attributes,{'tableName':_0x3188('0xe'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x3188('0xf')]},{'name':_0x3188('0x10'),'fields':['phone']},{'name':_0x3188('0x11'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x90b1=['priority','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x90b1,0x1bb));var _0x190b=function(_0x95a80,_0x1dd45d){_0x95a80=_0x95a80-0x0;var _0x2241b7=_0x90b1[_0x95a80];return _0x2241b7;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[{'name':_0x190b('0xa'),'fields':[_0x190b('0xa')]},{'name':_0x190b('0xb'),'fields':['phone']},{'name':_0x190b('0xc'),'fields':[_0x190b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 42ddfc7..9e42d70 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 _0x8994=['describe','transaction','findAll','order','UPDATE','CmContact','Contact','Agent','name','length','UserId','push','all','GetContactDialer','MoveContactManagedDialer','sequelize','CmHopperFinal','CountReScheduled','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','CmHopper,\x20%s,\x20%s','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','GetCmHopper','CmHopper','options','where','limit','include','map','model','attributes','ShowCmHopper','find','raw','CreateCmHopper','create','body','update','UpdateCmHopper','DestroyCmHopper','destroy'];(function(_0x52fd54,_0xaa3a45){var _0x535eea=function(_0x412985){while(--_0x412985){_0x52fd54['push'](_0x52fd54['shift']());}};_0x535eea(++_0xaa3a45);}(_0x8994,0xa6));var _0x4899=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x8994[_0x15c421];return _0x5e5ed5;};'use strict';var _=require(_0x4899('0x0'));var util=require(_0x4899('0x1'));var moment=require(_0x4899('0x2'));var BPromise=require(_0x4899('0x3'));var rs=require(_0x4899('0x4'));var fs=require('fs');var Redis=require(_0x4899('0x5'));var db=require(_0x4899('0x6'))['db'];var utils=require(_0x4899('0x7'));var logger=require(_0x4899('0x8'))(_0x4899('0x9'));var config=require(_0x4899('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4899('0xb')][_0x4899('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e6186,_0x124877,_0x3e04d5){return new BPromise(function(_0x47742c,_0x367ec0){return client[_0x4899('0xd')](_0x1e6186,_0x3e04d5)[_0x4899('0xe')](function(_0x1fec10){logger['info'](_0x4899('0xf'),_0x124877,'request\x20sent');logger[_0x4899('0x10')](_0x4899('0x11'),_0x124877,'request\x20sent',JSON[_0x4899('0x12')](_0x1fec10));if(_0x1fec10[_0x4899('0x13')]){if(_0x1fec10[_0x4899('0x13')][_0x4899('0x14')]===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x124877,_0x1fec10[_0x4899('0x13')][_0x4899('0x15')]);return _0x367ec0(_0x1fec10[_0x4899('0x13')][_0x4899('0x15')]);}logger['error'](_0x4899('0xf'),_0x124877,_0x1fec10['error']['message']);return _0x47742c(_0x1fec10[_0x4899('0x13')][_0x4899('0x15')]);}else{logger[_0x4899('0x16')](_0x4899('0xf'),_0x124877,_0x4899('0x17'));_0x47742c(_0x1fec10['result'][_0x4899('0x15')]);}})[_0x4899('0x18')](function(_0x2fa351){logger['error'](_0x4899('0xf'),_0x124877,_0x2fa351);_0x367ec0(_0x2fa351);});});}exports[_0x4899('0x19')]=function(_0x3de630){var _0x34c63a=this;return new Promise(function(_0x2bb223,_0xdd79c3){return db[_0x4899('0x1a')]['findAll']({'raw':_0x3de630[_0x4899('0x1b')]?_0x3de630[_0x4899('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3de630['options']?_0x3de630[_0x4899('0x1b')][_0x4899('0x1c')]||null:null,'attributes':_0x3de630['options']?_0x3de630[_0x4899('0x1b')]['attributes']||null:null,'limit':_0x3de630['options']?_0x3de630[_0x4899('0x1b')][_0x4899('0x1d')]||null:null,'include':_0x3de630[_0x4899('0x1b')]?_0x3de630[_0x4899('0x1b')][_0x4899('0x1e')]?_[_0x4899('0x1f')](_0x3de630[_0x4899('0x1b')][_0x4899('0x1e')],function(_0x41a7f9){return{'model':db[_0x41a7f9[_0x4899('0x20')]],'as':_0x41a7f9['as'],'attributes':_0x41a7f9[_0x4899('0x21')],'include':_0x41a7f9[_0x4899('0x1e')]?_[_0x4899('0x1f')](_0x41a7f9[_0x4899('0x1e')],function(_0x252f9e){return{'model':db[_0x252f9e[_0x4899('0x20')]],'as':_0x252f9e['as'],'attributes':_0x252f9e[_0x4899('0x21')],'include':_0x252f9e[_0x4899('0x1e')]?_['map'](_0x252f9e['include'],function(_0xd2142){return{'model':db[_0xd2142['model']],'as':_0xd2142['as'],'attributes':_0xd2142['attributes']};}):[]};}):[]};}):[]:[]})[_0x4899('0xe')](function(_0x3ff201){logger[_0x4899('0x16')]('GetCmHopper',_0x3de630);logger[_0x4899('0x10')](_0x4899('0x19'),_0x3de630,JSON[_0x4899('0x12')](_0x3ff201));_0x2bb223(_0x3ff201);})['catch'](function(_0x214866){logger[_0x4899('0x13')](_0x4899('0x19'),_0x214866[_0x4899('0x15')],_0x3de630);_0xdd79c3(_0x34c63a[_0x4899('0x13')](0x1f4,_0x214866[_0x4899('0x15')]));});});};exports[_0x4899('0x22')]=function(_0x5d635a){var _0x283c91=this;return new Promise(function(_0x3d2816,_0x577936){return db[_0x4899('0x1a')][_0x4899('0x23')]({'raw':_0x5d635a['options']?_0x5d635a[_0x4899('0x1b')][_0x4899('0x24')]===undefined?!![]:![]:!![],'where':_0x5d635a[_0x4899('0x1b')]?_0x5d635a['options'][_0x4899('0x1c')]||null:null,'attributes':_0x5d635a['options']?_0x5d635a[_0x4899('0x1b')][_0x4899('0x21')]||null:null,'include':_0x5d635a['options']?_0x5d635a['options'][_0x4899('0x1e')]?_[_0x4899('0x1f')](_0x5d635a[_0x4899('0x1b')][_0x4899('0x1e')],function(_0x1c3cb9){return{'model':db[_0x1c3cb9[_0x4899('0x20')]],'as':_0x1c3cb9['as'],'attributes':_0x1c3cb9[_0x4899('0x21')],'include':_0x1c3cb9['include']?_[_0x4899('0x1f')](_0x1c3cb9[_0x4899('0x1e')],function(_0xa9def1){return{'model':db[_0xa9def1[_0x4899('0x20')]],'as':_0xa9def1['as'],'attributes':_0xa9def1[_0x4899('0x21')],'include':_0xa9def1[_0x4899('0x1e')]?_[_0x4899('0x1f')](_0xa9def1[_0x4899('0x1e')],function(_0x56bc13){return{'model':db[_0x56bc13[_0x4899('0x20')]],'as':_0x56bc13['as'],'attributes':_0x56bc13[_0x4899('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4899('0xe')](function(_0x1faf51){logger[_0x4899('0x16')]('ShowCmHopper',_0x5d635a);logger[_0x4899('0x10')](_0x4899('0x22'),_0x5d635a,JSON['stringify'](_0x1faf51));_0x3d2816(_0x1faf51);})[_0x4899('0x18')](function(_0x3c9ece){logger[_0x4899('0x13')](_0x4899('0x22'),_0x3c9ece[_0x4899('0x15')],_0x5d635a);_0x577936(_0x283c91[_0x4899('0x13')](0x1f4,_0x3c9ece[_0x4899('0x15')]));});});};exports[_0x4899('0x25')]=function(_0x19bc74){var _0x1cfa7c=this;return new Promise(function(_0x4d2d8a,_0x1b544d){return db[_0x4899('0x1a')][_0x4899('0x26')](_0x19bc74[_0x4899('0x27')],{'raw':_0x19bc74[_0x4899('0x1b')]?_0x19bc74[_0x4899('0x1b')][_0x4899('0x24')]===undefined?!![]:![]:!![]})[_0x4899('0xe')](function(_0x54ad58){logger[_0x4899('0x16')](_0x4899('0x25'),_0x19bc74);logger['debug'](_0x4899('0x25'),_0x19bc74,JSON[_0x4899('0x12')](_0x54ad58));_0x4d2d8a(_0x54ad58);})['catch'](function(_0x58cdb5){logger['error'](_0x4899('0x25'),_0x58cdb5['message'],_0x19bc74);_0x1b544d(_0x1cfa7c[_0x4899('0x13')](0x1f4,_0x58cdb5['message']));});});};exports['UpdateCmHopper']=function(_0x279cdc){var _0x5e5f91=this;return new Promise(function(_0x597605,_0x3a98ca){return db[_0x4899('0x1a')][_0x4899('0x28')](_0x279cdc[_0x4899('0x27')],{'raw':_0x279cdc[_0x4899('0x1b')]?_0x279cdc[_0x4899('0x1b')][_0x4899('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x279cdc['options']?_0x279cdc['options'][_0x4899('0x1c')]||null:null,'attributes':_0x279cdc[_0x4899('0x1b')]?_0x279cdc[_0x4899('0x1b')]['attributes']||null:null,'limit':_0x279cdc[_0x4899('0x1b')]?_0x279cdc[_0x4899('0x1b')]['limit']||null:null})[_0x4899('0xe')](function(_0x5edf10){logger[_0x4899('0x16')]('UpdateCmHopper',_0x279cdc);logger[_0x4899('0x10')]('UpdateCmHopper',_0x279cdc,JSON[_0x4899('0x12')](_0x5edf10));_0x597605(_0x5edf10);})[_0x4899('0x18')](function(_0x20bc4c){logger['error'](_0x4899('0x29'),_0x20bc4c[_0x4899('0x15')],_0x279cdc);_0x3a98ca(_0x5e5f91[_0x4899('0x13')](0x1f4,_0x20bc4c['message']));});});};exports[_0x4899('0x2a')]=function(_0x1ddd15){var _0x88176d=this;return new Promise(function(_0x5a9286,_0x252e32){return db[_0x4899('0x1a')][_0x4899('0x2b')]({'where':_0x1ddd15[_0x4899('0x1b')]?_0x1ddd15[_0x4899('0x1b')][_0x4899('0x1c')]||null:null})[_0x4899('0xe')](function(_0x1e64ed){logger[_0x4899('0x16')](_0x4899('0x2a'),_0x1ddd15);logger[_0x4899('0x10')](_0x4899('0x2a'),_0x1ddd15,JSON[_0x4899('0x12')](_0x1e64ed));_0x5a9286(_0x1e64ed);})[_0x4899('0x18')](function(_0x402c4e){logger[_0x4899('0x13')](_0x4899('0x2a'),_0x402c4e[_0x4899('0x15')],_0x1ddd15);_0x252e32(_0x88176d['error'](0x1f4,_0x402c4e[_0x4899('0x15')]));});});};exports['GetContactDialer']=function(_0x6299fa){var _0x56a0ec=this;return new Promise(function(_0x5d281a,_0x35f55){return db['CmContact'][_0x4899('0x2c')]()[_0x4899('0xe')](function(_0x132d08){return db['sequelize'][_0x4899('0x2d')](function(_0x54414c){return db['CmHopper'][_0x4899('0x2e')]({'where':_0x6299fa[_0x4899('0x1b')]?_0x6299fa[_0x4899('0x1b')]['where']||null:null,'attributes':_0x6299fa['options']?_0x6299fa[_0x4899('0x1b')][_0x4899('0x21')]||null:null,'limit':_0x6299fa[_0x4899('0x1b')]?_0x6299fa['options'][_0x4899('0x1d')]||null:null,'order':_0x6299fa['options']?_0x6299fa[_0x4899('0x1b')][_0x4899('0x2f')]||null:null,'transaction':_0x54414c,'lock':_0x54414c['LOCK'][_0x4899('0x30')],'include':[{'model':db[_0x4899('0x31')],'as':_0x4899('0x32'),'attributes':_['keys'](_0x132d08)},{'model':db['User'],'as':_0x4899('0x33'),'attributes':['id',_0x4899('0x34'),'voicePause']}]})[_0x4899('0xe')](function(_0x43d9c7){var _0x30adf1=[];var _0x2fb7f5=[];for(var _0x1ba5f1=0x0;_0x1ba5f1<_0x43d9c7[_0x4899('0x35')];_0x1ba5f1+=0x1){var _0x1cca5f=_0x43d9c7[_0x1ba5f1][_0x4899('0x36')];if(_0x1cca5f===null){_0x30adf1[_0x4899('0x37')](_0x43d9c7[_0x1ba5f1][_0x4899('0x28')](_0x6299fa[_0x4899('0x27')],{'transaction':_0x54414c}));}else if(!_0x2fb7f5['includes'](_0x1cca5f)){_0x2fb7f5[_0x4899('0x37')](_0x1cca5f);_0x30adf1[_0x4899('0x37')](_0x43d9c7[_0x1ba5f1]['update'](_0x6299fa[_0x4899('0x27')],{'transaction':_0x54414c}));}}return BPromise[_0x4899('0x38')](_0x30adf1);});})[_0x4899('0xe')](function(_0x14544c){logger['info'](_0x4899('0x39'),_0x6299fa);logger[_0x4899('0x10')](_0x4899('0x39'),_0x6299fa,JSON['stringify'](_0x14544c));_0x5d281a(_0x14544c);})['catch'](function(_0x14894f){logger[_0x4899('0x13')](_0x4899('0x39'),_0x14894f[_0x4899('0x15')],_0x6299fa);_0x35f55(_0x56a0ec['error'](0x1f4,_0x14894f[_0x4899('0x15')]));});});});};exports[_0x4899('0x3a')]=function(_0x3c6a11){var _0x4e6386=this;return new Promise(function(_0x33cd60,_0x42ae56){return db[_0x4899('0x3b')][_0x4899('0x2d')](function(_0x3b37de){return db[_0x4899('0x3c')][_0x4899('0x26')](_0x3c6a11['body'],{'raw':_0x3c6a11['options']?_0x3c6a11[_0x4899('0x1b')][_0x4899('0x24')]===undefined?!![]:![]:!![],'transaction':_0x3b37de})[_0x4899('0xe')](function(){return db[_0x4899('0x1a')]['destroy']({'where':_0x3c6a11[_0x4899('0x1b')]?_0x3c6a11[_0x4899('0x1b')][_0x4899('0x1c')]||null:null,'transaction':_0x3b37de});});})[_0x4899('0xe')](function(_0x102fa3){logger[_0x4899('0x16')](_0x4899('0x3a'),_0x3c6a11);logger[_0x4899('0x10')](_0x4899('0x3a'),_0x3c6a11,JSON[_0x4899('0x12')](_0x102fa3));_0x33cd60(_0x102fa3);})['catch'](function(_0x854c24){logger['error'](_0x4899('0x3a'),_0x854c24[_0x4899('0x15')],_0x3c6a11);_0x42ae56(_0x4e6386['error'](0x1f4,_0x854c24[_0x4899('0x15')]));});});};exports[_0x4899('0x3d')]=function(_0x41b195){var _0x4e8d7a=this;return new Promise(function(_0x22f75f,_0x46066d){return db[_0x4899('0x1a')]['findAll']({'raw':_0x41b195[_0x4899('0x1b')]?_0x41b195[_0x4899('0x1b')][_0x4899('0x24')]===undefined?!![]:![]:!![],'where':_0x41b195[_0x4899('0x1b')]?_0x41b195['options'][_0x4899('0x1c')]||null:null,'attributes':[[db[_0x4899('0x3b')]['fn'](_0x4899('0x3e'),db[_0x4899('0x3b')]['fn']('IF',db['sequelize'][_0x4899('0x3f')]('`scheduledat`\x20>=\x20'+util[_0x4899('0x40')](_0x4899('0x41'),moment()[_0x4899('0x40')](_0x4899('0x42')))+'\x20,\x201,\x20null'))),_0x4899('0x43')]]})['then'](function(_0x91adfc){logger[_0x4899('0x16')](_0x4899('0x3d'),_0x41b195);logger[_0x4899('0x10')](_0x4899('0x3d'),_0x41b195,JSON[_0x4899('0x12')](_0x91adfc));_0x22f75f(_0x91adfc);})[_0x4899('0x18')](function(_0x8703bf){logger[_0x4899('0x13')](_0x4899('0x3d'),_0x8703bf[_0x4899('0x15')],_0x41b195);_0x46066d(_0x4e8d7a[_0x4899('0x13')](0x1f4,_0x8703bf[_0x4899('0x15')]));});});};exports[_0x4899('0x44')]=function(_0x48996e){var _0x2c6013=this;return new Promise(function(_0x5dd129,_0x444bf5){return db[_0x4899('0x31')][_0x4899('0x2c')]()[_0x4899('0xe')](function(_0x3e0b43){return db['sequelize']['transaction'](function(_0x34a43a){return db['CmHopper']['findAll']({'where':_0x48996e[_0x4899('0x1b')]?_0x48996e[_0x4899('0x1b')][_0x4899('0x1c')]||null:null,'attributes':_0x48996e[_0x4899('0x1b')]?_0x48996e[_0x4899('0x1b')][_0x4899('0x21')]||null:null,'limit':0x1,'order':_0x48996e['options']?_0x48996e['options'][_0x4899('0x2f')]||null:null,'group':db[_0x4899('0x1a')][_0x4899('0x36')],'transaction':_0x34a43a,'lock':_0x34a43a['LOCK'][_0x4899('0x30')],'include':_0x48996e[_0x4899('0x1b')]?_0x48996e[_0x4899('0x1b')]['include']?_['map'](_0x48996e[_0x4899('0x1b')]['include'],function(_0x250b61){return{'model':db[_0x250b61['model']],'as':_0x250b61['as'],'attributes':_0x250b61[_0x4899('0x21')],'include':_0x250b61['include']?_[_0x4899('0x1f')](_0x250b61[_0x4899('0x1e')],function(_0x5203e3){return{'model':db[_0x5203e3[_0x4899('0x20')]],'as':_0x5203e3['as'],'attributes':_0x5203e3['attributes'],'include':_0x5203e3[_0x4899('0x1e')]?_[_0x4899('0x1f')](_0x5203e3[_0x4899('0x1e')],function(_0x3631fa){return{'model':db[_0x3631fa['model']],'as':_0x3631fa['as'],'attributes':_0x3631fa[_0x4899('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ef53b){var _0x45a093=[];for(var _0x4a3d21=0x0;_0x4a3d21<_0x3ef53b['length'];_0x4a3d21+=0x1){_0x45a093[_0x4899('0x37')](_0x3ef53b[_0x4a3d21]['update'](_0x48996e[_0x4899('0x27')],{'transaction':_0x34a43a}));}return BPromise['all'](_0x45a093);});})[_0x4899('0xe')](function(_0x24cef1){logger[_0x4899('0x16')]('GetContactRecallMe',_0x48996e);logger[_0x4899('0x10')]('GetContactRecallMe',_0x48996e,JSON[_0x4899('0x12')](_0x24cef1));_0x5dd129(_0x24cef1);})[_0x4899('0x18')](function(_0x5e5701){logger[_0x4899('0x13')]('GetContactRecallMe',_0x5e5701[_0x4899('0x15')],_0x48996e);_0x444bf5(_0x2c6013['error'](0x1f4,_0x5e5701[_0x4899('0x15')]));});});});};exports[_0x4899('0x45')]=function(_0x1ebe83){var _0x3bd67e=this;return new Promise(function(_0x451ec9,_0xa0ff21){db[_0x4899('0x31')][_0x4899('0x2c')]()['then'](function(_0x27d274){return db[_0x4899('0x1a')][_0x4899('0x2e')]({'raw':_0x1ebe83['options']?_0x1ebe83[_0x4899('0x1b')][_0x4899('0x24')]===undefined?!![]:![]:!![],'where':_0x1ebe83['options']?_0x1ebe83[_0x4899('0x1b')][_0x4899('0x1c')]||null:null,'attributes':_0x1ebe83['options']?_0x1ebe83['options']['attributes']||null:null,'limit':_0x1ebe83[_0x4899('0x1b')]?_0x1ebe83[_0x4899('0x1b')][_0x4899('0x1d')]||null:null,'include':_0x1ebe83[_0x4899('0x1b')]?_0x1ebe83[_0x4899('0x1b')][_0x4899('0x1e')]?_[_0x4899('0x1f')](_0x1ebe83[_0x4899('0x1b')]['include'],function(_0x201e17){return{'model':db[_0x201e17[_0x4899('0x20')]],'as':_0x201e17['as'],'attributes':_0x201e17['as']==='Contact'?_['keys'](_0x27d274):_0x201e17[_0x4899('0x21')],'include':_0x201e17[_0x4899('0x1e')]?_[_0x4899('0x1f')](_0x201e17[_0x4899('0x1e')],function(_0x246112){return{'model':db[_0x246112['model']],'as':_0x246112['as'],'attributes':_0x246112[_0x4899('0x21')],'include':_0x246112[_0x4899('0x1e')]?_['map'](_0x246112[_0x4899('0x1e')],function(_0x2798fa){return{'model':db[_0x2798fa[_0x4899('0x20')]],'as':_0x2798fa['as'],'attributes':_0x2798fa[_0x4899('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4899('0xe')](function(_0x3ac3ae){logger[_0x4899('0x16')]('GetCmHopper',_0x1ebe83);logger['debug'](_0x4899('0x19'),_0x1ebe83,JSON[_0x4899('0x12')](_0x3ac3ae));_0x451ec9(_0x3ac3ae);})[_0x4899('0x18')](function(_0x533255){logger[_0x4899('0x13')](_0x4899('0x19'),_0x533255[_0x4899('0x15')],_0x1ebe83);_0xa0ff21(_0x3bd67e['error'](0x1f4,_0x533255[_0x4899('0x15')]));});});});}; \ No newline at end of file +var _0x0232=['http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCmHopper','findAll','options','where','attributes','limit','include','map','model','ShowCmHopper','CmHopper','find','raw','CreateCmHopper','create','body','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','order','LOCK','Contact','keys','User','name','voicePause','length','UserId','push','includes','update','all','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','sequelize','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UPDATE','GetCmHopperPreview','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x4a0ebf,_0x55ba40){var _0x181f1e=function(_0x3e421f){while(--_0x3e421f){_0x4a0ebf['push'](_0x4a0ebf['shift']());}};_0x181f1e(++_0x55ba40);}(_0x0232,0x11e));var _0x2023=function(_0x2d1d29,_0x472a0b){_0x2d1d29=_0x2d1d29-0x0;var _0x33b3b9=_0x0232[_0x2d1d29];return _0x33b3b9;};'use strict';var _=require(_0x2023('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2023('0x1'));var rs=require(_0x2023('0x2'));var fs=require('fs');var Redis=require(_0x2023('0x3'));var db=require(_0x2023('0x4'))['db'];var utils=require(_0x2023('0x5'));var logger=require(_0x2023('0x6'))(_0x2023('0x7'));var config=require('../../config/environment');var jayson=require(_0x2023('0x8'));var client=jayson[_0x2023('0x9')][_0x2023('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f231d,_0x40fd29,_0x174556){return new BPromise(function(_0x57a13f,_0x1dfb2f){return client[_0x2023('0xb')](_0x5f231d,_0x174556)[_0x2023('0xc')](function(_0x10de99){logger[_0x2023('0xd')](_0x2023('0xe'),_0x40fd29,_0x2023('0xf'));logger[_0x2023('0x10')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x40fd29,_0x2023('0xf'),JSON[_0x2023('0x11')](_0x10de99));if(_0x10de99[_0x2023('0x12')]){if(_0x10de99[_0x2023('0x12')][_0x2023('0x13')]===0x1f4){logger[_0x2023('0x12')](_0x2023('0xe'),_0x40fd29,_0x10de99[_0x2023('0x12')]['message']);return _0x1dfb2f(_0x10de99[_0x2023('0x12')][_0x2023('0x14')]);}logger['error'](_0x2023('0xe'),_0x40fd29,_0x10de99[_0x2023('0x12')][_0x2023('0x14')]);return _0x57a13f(_0x10de99[_0x2023('0x12')]['message']);}else{logger['info'](_0x2023('0xe'),_0x40fd29,_0x2023('0xf'));_0x57a13f(_0x10de99[_0x2023('0x15')]['message']);}})[_0x2023('0x16')](function(_0x2aa560){logger[_0x2023('0x12')](_0x2023('0xe'),_0x40fd29,_0x2aa560);_0x1dfb2f(_0x2aa560);});});}exports[_0x2023('0x17')]=function(_0x244f57){var _0x39b650=this;return new Promise(function(_0x4d5256,_0x23fb41){return db['CmHopper'][_0x2023('0x18')]({'raw':_0x244f57['options']?_0x244f57[_0x2023('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x244f57[_0x2023('0x19')]?_0x244f57[_0x2023('0x19')][_0x2023('0x1a')]||null:null,'attributes':_0x244f57[_0x2023('0x19')]?_0x244f57[_0x2023('0x19')][_0x2023('0x1b')]||null:null,'limit':_0x244f57[_0x2023('0x19')]?_0x244f57[_0x2023('0x19')][_0x2023('0x1c')]||null:null,'include':_0x244f57[_0x2023('0x19')]?_0x244f57['options'][_0x2023('0x1d')]?_['map'](_0x244f57[_0x2023('0x19')][_0x2023('0x1d')],function(_0x131051){return{'model':db[_0x131051['model']],'as':_0x131051['as'],'attributes':_0x131051[_0x2023('0x1b')],'include':_0x131051[_0x2023('0x1d')]?_[_0x2023('0x1e')](_0x131051[_0x2023('0x1d')],function(_0x1f5dcd){return{'model':db[_0x1f5dcd[_0x2023('0x1f')]],'as':_0x1f5dcd['as'],'attributes':_0x1f5dcd[_0x2023('0x1b')],'include':_0x1f5dcd[_0x2023('0x1d')]?_['map'](_0x1f5dcd[_0x2023('0x1d')],function(_0x3f3629){return{'model':db[_0x3f3629[_0x2023('0x1f')]],'as':_0x3f3629['as'],'attributes':_0x3f3629[_0x2023('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2023('0xc')](function(_0x23bd58){logger['info']('GetCmHopper',_0x244f57);logger['debug'](_0x2023('0x17'),_0x244f57,JSON[_0x2023('0x11')](_0x23bd58));_0x4d5256(_0x23bd58);})[_0x2023('0x16')](function(_0x3296d4){logger[_0x2023('0x12')](_0x2023('0x17'),_0x3296d4['message'],_0x244f57);_0x23fb41(_0x39b650['error'](0x1f4,_0x3296d4[_0x2023('0x14')]));});});};exports[_0x2023('0x20')]=function(_0x265ac7){var _0x1b09d5=this;return new Promise(function(_0x52fe07,_0x33d218){return db[_0x2023('0x21')][_0x2023('0x22')]({'raw':_0x265ac7['options']?_0x265ac7['options'][_0x2023('0x23')]===undefined?!![]:![]:!![],'where':_0x265ac7[_0x2023('0x19')]?_0x265ac7[_0x2023('0x19')][_0x2023('0x1a')]||null:null,'attributes':_0x265ac7[_0x2023('0x19')]?_0x265ac7['options'][_0x2023('0x1b')]||null:null,'include':_0x265ac7[_0x2023('0x19')]?_0x265ac7[_0x2023('0x19')]['include']?_[_0x2023('0x1e')](_0x265ac7['options'][_0x2023('0x1d')],function(_0x11a534){return{'model':db[_0x11a534[_0x2023('0x1f')]],'as':_0x11a534['as'],'attributes':_0x11a534['attributes'],'include':_0x11a534['include']?_[_0x2023('0x1e')](_0x11a534[_0x2023('0x1d')],function(_0x5e32e6){return{'model':db[_0x5e32e6['model']],'as':_0x5e32e6['as'],'attributes':_0x5e32e6['attributes'],'include':_0x5e32e6[_0x2023('0x1d')]?_[_0x2023('0x1e')](_0x5e32e6['include'],function(_0x5025f1){return{'model':db[_0x5025f1[_0x2023('0x1f')]],'as':_0x5025f1['as'],'attributes':_0x5025f1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3058a8){logger[_0x2023('0xd')](_0x2023('0x20'),_0x265ac7);logger['debug'](_0x2023('0x20'),_0x265ac7,JSON['stringify'](_0x3058a8));_0x52fe07(_0x3058a8);})[_0x2023('0x16')](function(_0x413926){logger['error'](_0x2023('0x20'),_0x413926[_0x2023('0x14')],_0x265ac7);_0x33d218(_0x1b09d5[_0x2023('0x12')](0x1f4,_0x413926[_0x2023('0x14')]));});});};exports[_0x2023('0x24')]=function(_0x37944c){var _0xd0c08a=this;return new Promise(function(_0x5dcb35,_0x557b39){return db[_0x2023('0x21')][_0x2023('0x25')](_0x37944c[_0x2023('0x26')],{'raw':_0x37944c[_0x2023('0x19')]?_0x37944c[_0x2023('0x19')][_0x2023('0x23')]===undefined?!![]:![]:!![]})[_0x2023('0xc')](function(_0x33724a){logger[_0x2023('0xd')]('CreateCmHopper',_0x37944c);logger['debug'](_0x2023('0x24'),_0x37944c,JSON[_0x2023('0x11')](_0x33724a));_0x5dcb35(_0x33724a);})[_0x2023('0x16')](function(_0x543796){logger[_0x2023('0x12')](_0x2023('0x24'),_0x543796[_0x2023('0x14')],_0x37944c);_0x557b39(_0xd0c08a[_0x2023('0x12')](0x1f4,_0x543796['message']));});});};exports['UpdateCmHopper']=function(_0x2bf893){var _0x10beb4=this;return new Promise(function(_0x1655e7,_0x58f683){return db[_0x2023('0x21')]['update'](_0x2bf893[_0x2023('0x26')],{'raw':_0x2bf893[_0x2023('0x19')]?_0x2bf893[_0x2023('0x19')][_0x2023('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bf893[_0x2023('0x19')]?_0x2bf893[_0x2023('0x19')][_0x2023('0x1a')]||null:null,'attributes':_0x2bf893[_0x2023('0x19')]?_0x2bf893[_0x2023('0x19')]['attributes']||null:null,'limit':_0x2bf893['options']?_0x2bf893[_0x2023('0x19')][_0x2023('0x1c')]||null:null})[_0x2023('0xc')](function(_0x5b5a0f){logger[_0x2023('0xd')](_0x2023('0x27'),_0x2bf893);logger[_0x2023('0x10')](_0x2023('0x27'),_0x2bf893,JSON[_0x2023('0x11')](_0x5b5a0f));_0x1655e7(_0x5b5a0f);})[_0x2023('0x16')](function(_0x5ec448){logger[_0x2023('0x12')](_0x2023('0x27'),_0x5ec448['message'],_0x2bf893);_0x58f683(_0x10beb4[_0x2023('0x12')](0x1f4,_0x5ec448[_0x2023('0x14')]));});});};exports['DestroyCmHopper']=function(_0x45b0d8){var _0x4fb62f=this;return new Promise(function(_0x3bd1de,_0x20162e){return db['CmHopper'][_0x2023('0x28')]({'where':_0x45b0d8[_0x2023('0x19')]?_0x45b0d8[_0x2023('0x19')]['where']||null:null})[_0x2023('0xc')](function(_0x5f2f09){logger['info'](_0x2023('0x29'),_0x45b0d8);logger[_0x2023('0x10')](_0x2023('0x29'),_0x45b0d8,JSON[_0x2023('0x11')](_0x5f2f09));_0x3bd1de(_0x5f2f09);})['catch'](function(_0x47ee41){logger[_0x2023('0x12')](_0x2023('0x29'),_0x47ee41[_0x2023('0x14')],_0x45b0d8);_0x20162e(_0x4fb62f['error'](0x1f4,_0x47ee41['message']));});});};exports[_0x2023('0x2a')]=function(_0x187162){var _0x219877=this;return new Promise(function(_0x43e225,_0x37944b){return db[_0x2023('0x2b')][_0x2023('0x2c')]()['then'](function(_0x8b5100){return db['sequelize'][_0x2023('0x2d')](function(_0x2602db){return db['CmHopper'][_0x2023('0x18')]({'where':_0x187162[_0x2023('0x19')]?_0x187162[_0x2023('0x19')][_0x2023('0x1a')]||null:null,'attributes':_0x187162[_0x2023('0x19')]?_0x187162[_0x2023('0x19')][_0x2023('0x1b')]||null:null,'limit':_0x187162[_0x2023('0x19')]?_0x187162['options']['limit']||null:null,'order':_0x187162['options']?_0x187162[_0x2023('0x19')][_0x2023('0x2e')]||null:null,'transaction':_0x2602db,'lock':_0x2602db[_0x2023('0x2f')]['UPDATE'],'include':[{'model':db[_0x2023('0x2b')],'as':_0x2023('0x30'),'attributes':_[_0x2023('0x31')](_0x8b5100)},{'model':db[_0x2023('0x32')],'as':'Agent','attributes':['id',_0x2023('0x33'),_0x2023('0x34')]}]})[_0x2023('0xc')](function(_0x4a8da7){var _0x2e5653=[];var _0x58845a=[];for(var _0x5110a8=0x0;_0x5110a8<_0x4a8da7[_0x2023('0x35')];_0x5110a8+=0x1){var _0x529122=_0x4a8da7[_0x5110a8][_0x2023('0x36')];if(_0x529122===null){_0x2e5653[_0x2023('0x37')](_0x4a8da7[_0x5110a8]['update'](_0x187162['body'],{'transaction':_0x2602db}));}else if(!_0x58845a[_0x2023('0x38')](_0x529122)){_0x58845a[_0x2023('0x37')](_0x529122);_0x2e5653[_0x2023('0x37')](_0x4a8da7[_0x5110a8][_0x2023('0x39')](_0x187162[_0x2023('0x26')],{'transaction':_0x2602db}));}}return BPromise[_0x2023('0x3a')](_0x2e5653);});})[_0x2023('0xc')](function(_0x10b066){logger[_0x2023('0xd')](_0x2023('0x2a'),_0x187162);logger[_0x2023('0x10')]('GetContactDialer',_0x187162,JSON[_0x2023('0x11')](_0x10b066));_0x43e225(_0x10b066);})[_0x2023('0x16')](function(_0x1faa98){logger[_0x2023('0x12')](_0x2023('0x2a'),_0x1faa98[_0x2023('0x14')],_0x187162);_0x37944b(_0x219877[_0x2023('0x12')](0x1f4,_0x1faa98[_0x2023('0x14')]));});});});};exports[_0x2023('0x3b')]=function(_0x799995){var _0x52ba27=this;return new Promise(function(_0x1550f5,_0x92841c){return db['sequelize'][_0x2023('0x2d')](function(_0x477091){return db[_0x2023('0x3c')]['create'](_0x799995[_0x2023('0x26')],{'raw':_0x799995['options']?_0x799995[_0x2023('0x19')][_0x2023('0x23')]===undefined?!![]:![]:!![],'transaction':_0x477091})['then'](function(){return db[_0x2023('0x21')]['destroy']({'where':_0x799995[_0x2023('0x19')]?_0x799995[_0x2023('0x19')][_0x2023('0x1a')]||null:null,'transaction':_0x477091});});})['then'](function(_0x5a9839){logger['info']('MoveContactManagedDialer',_0x799995);logger[_0x2023('0x10')](_0x2023('0x3b'),_0x799995,JSON[_0x2023('0x11')](_0x5a9839));_0x1550f5(_0x5a9839);})['catch'](function(_0x531285){logger['error'](_0x2023('0x3b'),_0x531285[_0x2023('0x14')],_0x799995);_0x92841c(_0x52ba27[_0x2023('0x12')](0x1f4,_0x531285[_0x2023('0x14')]));});});};exports[_0x2023('0x3d')]=function(_0x3954e0){var _0x4c4b9a=this;return new Promise(function(_0x26b3e3,_0x91d48a){return db['CmHopper'][_0x2023('0x18')]({'raw':_0x3954e0['options']?_0x3954e0[_0x2023('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3954e0[_0x2023('0x19')]?_0x3954e0[_0x2023('0x19')][_0x2023('0x1a')]||null:null,'attributes':[[db[_0x2023('0x3e')]['fn'](_0x2023('0x3f'),db[_0x2023('0x3e')]['fn']('IF',db[_0x2023('0x3e')][_0x2023('0x40')](_0x2023('0x41')+util[_0x2023('0x42')](_0x2023('0x43'),moment()[_0x2023('0x42')](_0x2023('0x44')))+_0x2023('0x45')))),_0x2023('0x46')]]})[_0x2023('0xc')](function(_0x1c044c){logger[_0x2023('0xd')](_0x2023('0x3d'),_0x3954e0);logger['debug'](_0x2023('0x3d'),_0x3954e0,JSON[_0x2023('0x11')](_0x1c044c));_0x26b3e3(_0x1c044c);})[_0x2023('0x16')](function(_0x2ca074){logger['error'](_0x2023('0x3d'),_0x2ca074[_0x2023('0x14')],_0x3954e0);_0x91d48a(_0x4c4b9a[_0x2023('0x12')](0x1f4,_0x2ca074[_0x2023('0x14')]));});});};exports[_0x2023('0x47')]=function(_0x43e942){var _0x5131f7=this;return new Promise(function(_0x4955d7,_0x19c802){return db['CmContact'][_0x2023('0x2c')]()[_0x2023('0xc')](function(_0x5f0d50){return db['sequelize'][_0x2023('0x2d')](function(_0x3f4327){return db[_0x2023('0x21')][_0x2023('0x18')]({'where':_0x43e942[_0x2023('0x19')]?_0x43e942[_0x2023('0x19')][_0x2023('0x1a')]||null:null,'attributes':_0x43e942['options']?_0x43e942[_0x2023('0x19')][_0x2023('0x1b')]||null:null,'limit':0x1,'order':_0x43e942['options']?_0x43e942['options'][_0x2023('0x2e')]||null:null,'group':db[_0x2023('0x21')][_0x2023('0x36')],'transaction':_0x3f4327,'lock':_0x3f4327[_0x2023('0x2f')][_0x2023('0x48')],'include':_0x43e942['options']?_0x43e942['options'][_0x2023('0x1d')]?_[_0x2023('0x1e')](_0x43e942[_0x2023('0x19')]['include'],function(_0x1077f2){return{'model':db[_0x1077f2[_0x2023('0x1f')]],'as':_0x1077f2['as'],'attributes':_0x1077f2[_0x2023('0x1b')],'include':_0x1077f2['include']?_[_0x2023('0x1e')](_0x1077f2['include'],function(_0x2e2a88){return{'model':db[_0x2e2a88[_0x2023('0x1f')]],'as':_0x2e2a88['as'],'attributes':_0x2e2a88[_0x2023('0x1b')],'include':_0x2e2a88['include']?_['map'](_0x2e2a88[_0x2023('0x1d')],function(_0x5dfcbe){return{'model':db[_0x5dfcbe['model']],'as':_0x5dfcbe['as'],'attributes':_0x5dfcbe['attributes']};}):[]};}):[]};}):[]:[]})[_0x2023('0xc')](function(_0x199ad6){var _0x721345=[];for(var _0x578977=0x0;_0x578977<_0x199ad6[_0x2023('0x35')];_0x578977+=0x1){_0x721345[_0x2023('0x37')](_0x199ad6[_0x578977][_0x2023('0x39')](_0x43e942[_0x2023('0x26')],{'transaction':_0x3f4327}));}return BPromise['all'](_0x721345);});})['then'](function(_0x4977d7){logger[_0x2023('0xd')](_0x2023('0x47'),_0x43e942);logger['debug'](_0x2023('0x47'),_0x43e942,JSON[_0x2023('0x11')](_0x4977d7));_0x4955d7(_0x4977d7);})[_0x2023('0x16')](function(_0x595636){logger[_0x2023('0x12')](_0x2023('0x47'),_0x595636[_0x2023('0x14')],_0x43e942);_0x19c802(_0x5131f7[_0x2023('0x12')](0x1f4,_0x595636['message']));});});});};exports[_0x2023('0x49')]=function(_0x27c917){var _0x22b7e4=this;return new Promise(function(_0x55d636,_0x444305){db['CmContact'][_0x2023('0x2c')]()[_0x2023('0xc')](function(_0x541c3d){return db[_0x2023('0x21')][_0x2023('0x18')]({'raw':_0x27c917['options']?_0x27c917[_0x2023('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x27c917[_0x2023('0x19')]?_0x27c917['options'][_0x2023('0x1a')]||null:null,'attributes':_0x27c917['options']?_0x27c917[_0x2023('0x19')]['attributes']||null:null,'limit':_0x27c917[_0x2023('0x19')]?_0x27c917[_0x2023('0x19')]['limit']||null:null,'include':_0x27c917['options']?_0x27c917[_0x2023('0x19')][_0x2023('0x1d')]?_[_0x2023('0x1e')](_0x27c917['options'][_0x2023('0x1d')],function(_0x2dffcb){return{'model':db[_0x2dffcb[_0x2023('0x1f')]],'as':_0x2dffcb['as'],'attributes':_0x2dffcb['as']===_0x2023('0x30')?_[_0x2023('0x31')](_0x541c3d):_0x2dffcb[_0x2023('0x1b')],'include':_0x2dffcb[_0x2023('0x1d')]?_[_0x2023('0x1e')](_0x2dffcb[_0x2023('0x1d')],function(_0x487c79){return{'model':db[_0x487c79['model']],'as':_0x487c79['as'],'attributes':_0x487c79[_0x2023('0x1b')],'include':_0x487c79[_0x2023('0x1d')]?_[_0x2023('0x1e')](_0x487c79[_0x2023('0x1d')],function(_0x4d4a6a){return{'model':db[_0x4d4a6a[_0x2023('0x1f')]],'as':_0x4d4a6a['as'],'attributes':_0x4d4a6a['attributes']};}):[]};}):[]};}):[]:[]})[_0x2023('0xc')](function(_0x10921f){logger['info'](_0x2023('0x17'),_0x27c917);logger[_0x2023('0x10')]('GetCmHopper',_0x27c917,JSON['stringify'](_0x10921f));_0x55d636(_0x10921f);})['catch'](function(_0xc78436){logger[_0x2023('0x12')]('GetCmHopper',_0xc78436[_0x2023('0x14')],_0x27c917);_0x444305(_0x22b7e4[_0x2023('0x12')](0x1f4,_0xc78436['message']));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 0c5fdc6..99644c7 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 _0xcba3=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','/:id','show','post','create','/preview','getPreview','put','delete','destroy','exports','util','connect-timeout'];(function(_0x3d34db,_0xfa0679){var _0x5f3249=function(_0x5ee707){while(--_0x5ee707){_0x3d34db['push'](_0x3d34db['shift']());}};_0x5f3249(++_0xfa0679);}(_0xcba3,0x157));var _0x3cba=function(_0x25ca4a,_0x42d912){_0x25ca4a=_0x25ca4a-0x0;var _0x2efb94=_0xcba3[_0x25ca4a];return _0x2efb94;};'use strict';var multer=require('multer');var util=require(_0x3cba('0x0'));var path=require('path');var timeout=require(_0x3cba('0x1'));var express=require('express');var router=express[_0x3cba('0x2')]();var fs_extra=require(_0x3cba('0x3'));var auth=require(_0x3cba('0x4'));var interaction=require(_0x3cba('0x5'));var config=require('../../config/environment');var controller=require(_0x3cba('0x6'));router[_0x3cba('0x7')]('/',auth[_0x3cba('0x8')](),controller[_0x3cba('0x9')]);router[_0x3cba('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x3cba('0xa')]);router['get'](_0x3cba('0xb'),auth[_0x3cba('0x8')](),controller[_0x3cba('0xc')]);router[_0x3cba('0x7')](_0x3cba('0xd'),auth[_0x3cba('0x8')](),controller[_0x3cba('0xe')]);router[_0x3cba('0xf')]('/',auth[_0x3cba('0x8')](),controller[_0x3cba('0x10')]);router[_0x3cba('0xf')](_0x3cba('0x11'),auth['isAuthenticated'](),controller[_0x3cba('0x12')]);router[_0x3cba('0x13')](_0x3cba('0xd'),auth[_0x3cba('0x8')](),controller['update']);router[_0x3cba('0x14')](_0x3cba('0xd'),auth['isAuthenticated'](),controller[_0x3cba('0x15')]);module[_0x3cba('0x16')]=router; \ No newline at end of file +var _0x1880=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','isAuthenticated','/describe','describe','get','/opencontacts','getOpenContacts','show','post','create','/preview','getPreview','put','/:id','update','destroy','multer'];(function(_0x56c069,_0x3be575){var _0x496821=function(_0x3290a9){while(--_0x3290a9){_0x56c069['push'](_0x56c069['shift']());}};_0x496821(++_0x3be575);}(_0x1880,0x1c1));var _0x0188=function(_0x2849d3,_0x558165){_0x2849d3=_0x2849d3-0x0;var _0x39ace3=_0x1880[_0x2849d3];return _0x39ace3;};'use strict';var multer=require(_0x0188('0x0'));var util=require(_0x0188('0x1'));var path=require(_0x0188('0x2'));var timeout=require(_0x0188('0x3'));var express=require(_0x0188('0x4'));var router=express[_0x0188('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0188('0x6'));var interaction=require(_0x0188('0x7'));var config=require(_0x0188('0x8'));var controller=require(_0x0188('0x9'));router['get']('/',auth[_0x0188('0xa')](),controller['index']);router['get'](_0x0188('0xb'),auth[_0x0188('0xa')](),controller[_0x0188('0xc')]);router[_0x0188('0xd')](_0x0188('0xe'),auth[_0x0188('0xa')](),controller[_0x0188('0xf')]);router[_0x0188('0xd')]('/:id',auth[_0x0188('0xa')](),controller[_0x0188('0x10')]);router[_0x0188('0x11')]('/',auth[_0x0188('0xa')](),controller[_0x0188('0x12')]);router[_0x0188('0x11')](_0x0188('0x13'),auth['isAuthenticated'](),controller[_0x0188('0x14')]);router[_0x0188('0x15')](_0x0188('0x16'),auth[_0x0188('0xa')](),controller[_0x0188('0x17')]);router['delete']('/:id',auth[_0x0188('0xa')](),controller[_0x0188('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index b840b50..f4a11d3 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 _0xd051=['INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x174ada,_0x477428){var _0x33ce55=function(_0x5e3341){while(--_0x5e3341){_0x174ada['push'](_0x174ada['shift']());}};_0x33ce55(++_0x477428);}(_0xd051,0xc5));var _0x1d05=function(_0x53fda3,_0x5cc847){_0x53fda3=_0x53fda3-0x0;var _0x3c0742=_0xd051[_0x53fda3];return _0x3c0742;};'use strict';var moment=require(_0x1d05('0x0'));var Sequelize=require(_0x1d05('0x1'));module[_0x1d05('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x1d05('0x3')],'unique':_0x1d05('0x4')},'ListId':{'type':Sequelize[_0x1d05('0x3')],'unique':_0x1d05('0x4')},'VoiceQueueId':{'type':Sequelize[_0x1d05('0x3')],'unique':_0x1d05('0x4')}}; \ No newline at end of file +var _0x8784=['moment','sequelize','STRING','INTEGER','contactListQueue'];(function(_0x378d18,_0x17362b){var _0x52d233=function(_0x24949a){while(--_0x24949a){_0x378d18['push'](_0x378d18['shift']());}};_0x52d233(++_0x17362b);}(_0x8784,0x172));var _0x4878=function(_0x1e05c1,_0x3cffa3){_0x1e05c1=_0x1e05c1-0x0;var _0x15f1ca=_0x8784[_0x1e05c1];return _0x15f1ca;};'use strict';var moment=require(_0x4878('0x0'));var Sequelize=require(_0x4878('0x1'));module['exports']={'phone':{'type':Sequelize[_0x4878('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x4878('0x3')],'unique':_0x4878('0x4')},'ListId':{'type':Sequelize[_0x4878('0x3')],'unique':_0x4878('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'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 67c9cb1..11498d0 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 _0x1cce=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','offset','limit','undefined','count','status','set','json','reject','save','update','then','destroy','stack','name','send','map','CmHopperBlack','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x21ae0f,_0x4cdea4){var _0x100693=function(_0x433231){while(--_0x433231){_0x21ae0f['push'](_0x21ae0f['shift']());}};_0x100693(++_0x4cdea4);}(_0x1cce,0x80));var _0xe1cc=function(_0x173452,_0x3aa870){_0x173452=_0x173452-0x0;var _0xee3fd0=_0x1cce[_0x173452];return _0xee3fd0;};'use strict';var emlformat=require(_0xe1cc('0x0'));var rimraf=require(_0xe1cc('0x1'));var zipdir=require(_0xe1cc('0x2'));var jsonpatch=require(_0xe1cc('0x3'));var rp=require(_0xe1cc('0x4'));var moment=require(_0xe1cc('0x5'));var BPromise=require(_0xe1cc('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe1cc('0x7'));var sox=require('sox');var csv=require(_0xe1cc('0x8'));var ejs=require(_0xe1cc('0x9'));var fs=require('fs');var fs_extra=require(_0xe1cc('0xa'));var _=require(_0xe1cc('0xb'));var squel=require('squel');var crypto=require(_0xe1cc('0xc'));var jsforce=require(_0xe1cc('0xd'));var deskjs=require(_0xe1cc('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe1cc('0xf'));var Papa=require(_0xe1cc('0x10'));var Redis=require('ioredis');var authService=require(_0xe1cc('0x11'));var qs=require(_0xe1cc('0x12'));var as=require(_0xe1cc('0x13'));var hardwareService=require(_0xe1cc('0x14'));var logger=require(_0xe1cc('0x15'))(_0xe1cc('0x16'));var utils=require(_0xe1cc('0x17'));var config=require(_0xe1cc('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28818a,_0xa5c960){_0xa5c960=_0xa5c960||0xcc;return function(_0x31ff7e){if(_0x31ff7e){return _0x28818a[_0xe1cc('0x19')](_0xa5c960);}return _0x28818a['status'](_0xa5c960)[_0xe1cc('0x1a')]();};}function respondWithResult(_0x83300,_0x5f4bd8){_0x5f4bd8=_0x5f4bd8||0xc8;return function(_0x20d6b8){if(_0x20d6b8){return _0x83300['status'](_0x5f4bd8)['json'](_0x20d6b8);}};}function respondWithFilteredResult(_0x4d2a79,_0x596b3f){return function(_0x546240){if(_0x546240){var _0x1f659b=typeof _0x596b3f[_0xe1cc('0x1b')]==='undefined'&&typeof _0x596b3f[_0xe1cc('0x1c')]===_0xe1cc('0x1d');var _0x3e1919=_0x546240[_0xe1cc('0x1e')];var _0x28f86e=_0x1f659b?0x0:_0x596b3f[_0xe1cc('0x1b')];var _0x109756=_0x1f659b?_0x546240[_0xe1cc('0x1e')]:_0x596b3f[_0xe1cc('0x1b')]+_0x596b3f[_0xe1cc('0x1c')];var _0x3a967d;if(_0x109756>=_0x3e1919){_0x109756=_0x3e1919;_0x3a967d=0xc8;}else{_0x3a967d=0xce;}_0x4d2a79[_0xe1cc('0x1f')](_0x3a967d);return _0x4d2a79[_0xe1cc('0x20')]('Content-Range',_0x28f86e+'-'+_0x109756+'/'+_0x3e1919)[_0xe1cc('0x21')](_0x546240);}return null;};}function patchUpdates(_0xf2b900){return function(_0x1d3fc4){try{jsonpatch['apply'](_0x1d3fc4,_0xf2b900,!![]);}catch(_0x585097){return BPromise[_0xe1cc('0x22')](_0x585097);}return _0x1d3fc4[_0xe1cc('0x23')]();};}function saveUpdates(_0x1de78c,_0x33a725){return function(_0x422a90){if(_0x422a90){return _0x422a90[_0xe1cc('0x24')](_0x1de78c)[_0xe1cc('0x25')](function(_0x34eb1c){return _0x34eb1c;});}return null;};}function removeEntity(_0x3583d1,_0x121696){return function(_0x34651e){if(_0x34651e){return _0x34651e[_0xe1cc('0x26')]()['then'](function(){_0x3583d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x27975c,_0x11b428){return function(_0x30892a){if(!_0x30892a){_0x27975c['sendStatus'](0x194);}return _0x30892a;};}function handleError(_0x24efca,_0xde9a6){_0xde9a6=_0xde9a6||0x1f4;return function(_0x303767){logger['error'](_0x303767[_0xe1cc('0x27')]);if(_0x303767[_0xe1cc('0x28')]){delete _0x303767[_0xe1cc('0x28')];}_0x24efca['status'](_0xde9a6)[_0xe1cc('0x29')](_0x303767);};}exports['index']=function(_0x15ad0b,_0x369ce7){var _0x583b96={},_0x46d35f={},_0x3c7767={'count':0x0,'rows':[]};var _0x56f214=_[_0xe1cc('0x2a')](db[_0xe1cc('0x2b')]['rawAttributes'],function(_0x1ba3bf){return{'name':_0x1ba3bf['fieldName'],'type':_0x1ba3bf[_0xe1cc('0x2c')][_0xe1cc('0x2d')]};});_0x46d35f['model']=_[_0xe1cc('0x2a')](_0x56f214,_0xe1cc('0x28'));_0x46d35f['query']=_[_0xe1cc('0x2e')](_0x15ad0b[_0xe1cc('0x2f')]);_0x46d35f[_0xe1cc('0x30')]=_[_0xe1cc('0x31')](_0x46d35f['model'],_0x46d35f[_0xe1cc('0x2f')]);_0x583b96[_0xe1cc('0x32')]=_[_0xe1cc('0x31')](_0x46d35f[_0xe1cc('0x33')],qs[_0xe1cc('0x34')](_0x15ad0b[_0xe1cc('0x2f')][_0xe1cc('0x34')]));_0x583b96[_0xe1cc('0x32')]=_0x583b96[_0xe1cc('0x32')][_0xe1cc('0x35')]?_0x583b96[_0xe1cc('0x32')]:_0x46d35f[_0xe1cc('0x33')];if(!_0x15ad0b[_0xe1cc('0x2f')][_0xe1cc('0x36')]('nolimit')){_0x583b96[_0xe1cc('0x1c')]=qs[_0xe1cc('0x1c')](_0x15ad0b[_0xe1cc('0x2f')][_0xe1cc('0x1c')]);_0x583b96[_0xe1cc('0x1b')]=qs[_0xe1cc('0x1b')](_0x15ad0b['query'][_0xe1cc('0x1b')]);}_0x583b96['order']=qs[_0xe1cc('0x37')](_0x15ad0b['query']['sort']);_0x583b96[_0xe1cc('0x38')]=qs['filters'](_[_0xe1cc('0x39')](_0x15ad0b[_0xe1cc('0x2f')],_0x46d35f['filters']),_0x56f214);if(_0x15ad0b[_0xe1cc('0x2f')][_0xe1cc('0x3a')]){_0x583b96[_0xe1cc('0x38')]=_[_0xe1cc('0x3b')](_0x583b96[_0xe1cc('0x38')],{'$or':_[_0xe1cc('0x2a')](_0x56f214,function(_0x401e22){if(_0x401e22[_0xe1cc('0x2c')]!=='VIRTUAL'){var _0x2c9886={};_0x2c9886[_0x401e22['name']]={'$like':'%'+_0x15ad0b[_0xe1cc('0x2f')][_0xe1cc('0x3a')]+'%'};return _0x2c9886;}})});}_0x583b96=_[_0xe1cc('0x3b')]({},_0x583b96,_0x15ad0b['options']);var _0x5cf0fb={'where':_0x583b96[_0xe1cc('0x38')]};return db[_0xe1cc('0x2b')][_0xe1cc('0x1e')](_0x5cf0fb)[_0xe1cc('0x25')](function(_0x2d740b){_0x3c7767[_0xe1cc('0x1e')]=_0x2d740b;if(_0x15ad0b[_0xe1cc('0x2f')][_0xe1cc('0x3c')]){_0x583b96[_0xe1cc('0x3d')]=[{'all':!![]}];}return db[_0xe1cc('0x2b')][_0xe1cc('0x3e')](_0x583b96);})[_0xe1cc('0x25')](function(_0x17a9ed){_0x3c7767[_0xe1cc('0x3f')]=_0x17a9ed;return _0x3c7767;})['then'](respondWithFilteredResult(_0x369ce7,_0x583b96))[_0xe1cc('0x40')](handleError(_0x369ce7,null));};exports[_0xe1cc('0x41')]=function(_0xc870cd,_0x23b937){var _0x57384e={'raw':!![],'where':{'id':_0xc870cd[_0xe1cc('0x42')]['id']}},_0xcb9510={};_0xcb9510['model']=_['keys'](db['CmHopperBlack'][_0xe1cc('0x43')]);_0xcb9510[_0xe1cc('0x2f')]=_[_0xe1cc('0x2e')](_0xc870cd[_0xe1cc('0x2f')]);_0xcb9510[_0xe1cc('0x30')]=_[_0xe1cc('0x31')](_0xcb9510[_0xe1cc('0x33')],_0xcb9510[_0xe1cc('0x2f')]);_0x57384e[_0xe1cc('0x32')]=_[_0xe1cc('0x31')](_0xcb9510[_0xe1cc('0x33')],qs['fields'](_0xc870cd[_0xe1cc('0x2f')]['fields']));_0x57384e[_0xe1cc('0x32')]=_0x57384e['attributes'][_0xe1cc('0x35')]?_0x57384e['attributes']:_0xcb9510[_0xe1cc('0x33')];if(_0xc870cd[_0xe1cc('0x2f')][_0xe1cc('0x3c')]){_0x57384e[_0xe1cc('0x3d')]=[{'all':!![]}];}_0x57384e=_['merge']({},_0x57384e,_0xc870cd[_0xe1cc('0x44')]);return db[_0xe1cc('0x2b')][_0xe1cc('0x45')](_0x57384e)['then'](handleEntityNotFound(_0x23b937,null))[_0xe1cc('0x25')](respondWithResult(_0x23b937,null))['catch'](handleError(_0x23b937,null));};exports[_0xe1cc('0x24')]=function(_0xd298c5,_0x147dfe){if(_0xd298c5[_0xe1cc('0x46')]['id']){delete _0xd298c5[_0xe1cc('0x46')]['id'];}return db[_0xe1cc('0x2b')][_0xe1cc('0x45')]({'where':{'id':_0xd298c5[_0xe1cc('0x42')]['id']}})['then'](handleEntityNotFound(_0x147dfe,null))[_0xe1cc('0x25')](saveUpdates(_0xd298c5[_0xe1cc('0x46')],null))[_0xe1cc('0x25')](respondWithResult(_0x147dfe,null))[_0xe1cc('0x40')](handleError(_0x147dfe,null));};exports[_0xe1cc('0x26')]=function(_0x400308,_0x518cd5){return db[_0xe1cc('0x2b')][_0xe1cc('0x45')]({'where':{'id':_0x400308[_0xe1cc('0x42')]['id']}})[_0xe1cc('0x25')](handleEntityNotFound(_0x518cd5,null))[_0xe1cc('0x25')](removeEntity(_0x518cd5,null))['catch'](handleError(_0x518cd5,null));};exports[_0xe1cc('0x47')]=function(_0x1c545c,_0x4c2618){return db['CmHopperBlack'][_0xe1cc('0x47')]()[_0xe1cc('0x25')](respondWithResult(_0x4c2618,null))['catch'](handleError(_0x4c2618,null));}; \ No newline at end of file +var _0xf17d=['end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x148e61,_0x3f2245){var _0x284ba7=function(_0x7cbe2a){while(--_0x7cbe2a){_0x148e61['push'](_0x148e61['shift']());}};_0x284ba7(++_0x3f2245);}(_0xf17d,0xd0));var _0xdf17=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf17d[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xdf17('0x0'));var rimraf=require(_0xdf17('0x1'));var zipdir=require(_0xdf17('0x2'));var jsonpatch=require(_0xdf17('0x3'));var rp=require('request-promise');var moment=require(_0xdf17('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdf17('0x5'));var util=require(_0xdf17('0x6'));var path=require(_0xdf17('0x7'));var sox=require(_0xdf17('0x8'));var csv=require(_0xdf17('0x9'));var ejs=require(_0xdf17('0xa'));var fs=require('fs');var fs_extra=require(_0xdf17('0xb'));var _=require(_0xdf17('0xc'));var squel=require('squel');var crypto=require(_0xdf17('0xd'));var jsforce=require(_0xdf17('0xe'));var deskjs=require(_0xdf17('0xf'));var toCsv=require(_0xdf17('0x9'));var querystring=require(_0xdf17('0x10'));var Papa=require(_0xdf17('0x11'));var Redis=require(_0xdf17('0x12'));var authService=require(_0xdf17('0x13'));var qs=require(_0xdf17('0x14'));var as=require(_0xdf17('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf17('0x16'))(_0xdf17('0x17'));var utils=require(_0xdf17('0x18'));var config=require(_0xdf17('0x19'));var licenseUtil=require(_0xdf17('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a42f3,_0x5afff9){_0x5afff9=_0x5afff9||0xcc;return function(_0xf5ab35){if(_0xf5ab35){return _0x4a42f3[_0xdf17('0x1b')](_0x5afff9);}return _0x4a42f3[_0xdf17('0x1c')](_0x5afff9)[_0xdf17('0x1d')]();};}function respondWithResult(_0xd4e3f,_0x520684){_0x520684=_0x520684||0xc8;return function(_0xa7e9ec){if(_0xa7e9ec){return _0xd4e3f[_0xdf17('0x1c')](_0x520684)['json'](_0xa7e9ec);}};}function respondWithFilteredResult(_0x2dd911,_0x30cbb4){return function(_0x336996){if(_0x336996){var _0x404b64=typeof _0x30cbb4[_0xdf17('0x1e')]===_0xdf17('0x1f')&&typeof _0x30cbb4[_0xdf17('0x20')]===_0xdf17('0x1f');var _0x53bc89=_0x336996[_0xdf17('0x21')];var _0x370a91=_0x404b64?0x0:_0x30cbb4[_0xdf17('0x1e')];var _0x57d075=_0x404b64?_0x336996[_0xdf17('0x21')]:_0x30cbb4['offset']+_0x30cbb4[_0xdf17('0x20')];var _0x5535b8;if(_0x57d075>=_0x53bc89){_0x57d075=_0x53bc89;_0x5535b8=0xc8;}else{_0x5535b8=0xce;}_0x2dd911[_0xdf17('0x1c')](_0x5535b8);return _0x2dd911[_0xdf17('0x22')](_0xdf17('0x23'),_0x370a91+'-'+_0x57d075+'/'+_0x53bc89)[_0xdf17('0x24')](_0x336996);}return null;};}function patchUpdates(_0x37de6d){return function(_0x42e888){try{jsonpatch[_0xdf17('0x25')](_0x42e888,_0x37de6d,!![]);}catch(_0x2c6015){return BPromise[_0xdf17('0x26')](_0x2c6015);}return _0x42e888[_0xdf17('0x27')]();};}function saveUpdates(_0x1d56bd,_0x3e5a03){return function(_0x1b303e){if(_0x1b303e){return _0x1b303e['update'](_0x1d56bd)[_0xdf17('0x28')](function(_0x218cfa){return _0x218cfa;});}return null;};}function removeEntity(_0x440139,_0x382429){return function(_0x3ebdf1){if(_0x3ebdf1){return _0x3ebdf1[_0xdf17('0x29')]()[_0xdf17('0x28')](function(){_0x440139[_0xdf17('0x1c')](0xcc)[_0xdf17('0x1d')]();});}};}function handleEntityNotFound(_0x36e247,_0x5d66f7){return function(_0x15e80c){if(!_0x15e80c){_0x36e247[_0xdf17('0x1b')](0x194);}return _0x15e80c;};}function handleError(_0x42b876,_0x48d325){_0x48d325=_0x48d325||0x1f4;return function(_0x2463a0){logger['error'](_0x2463a0[_0xdf17('0x2a')]);if(_0x2463a0[_0xdf17('0x2b')]){delete _0x2463a0[_0xdf17('0x2b')];}_0x42b876['status'](_0x48d325)[_0xdf17('0x2c')](_0x2463a0);};}exports[_0xdf17('0x2d')]=function(_0x562625,_0x48d157){var _0x4b8819={},_0x46f778={},_0x20d2db={'count':0x0,'rows':[]};var _0x45939d=_[_0xdf17('0x2e')](db[_0xdf17('0x2f')][_0xdf17('0x30')],function(_0x4dee5e){return{'name':_0x4dee5e[_0xdf17('0x31')],'type':_0x4dee5e[_0xdf17('0x32')][_0xdf17('0x33')]};});_0x46f778[_0xdf17('0x34')]=_[_0xdf17('0x2e')](_0x45939d,_0xdf17('0x2b'));_0x46f778[_0xdf17('0x35')]=_['keys'](_0x562625[_0xdf17('0x35')]);_0x46f778[_0xdf17('0x36')]=_[_0xdf17('0x37')](_0x46f778['model'],_0x46f778[_0xdf17('0x35')]);_0x4b8819[_0xdf17('0x38')]=_[_0xdf17('0x37')](_0x46f778['model'],qs[_0xdf17('0x39')](_0x562625['query']['fields']));_0x4b8819['attributes']=_0x4b8819[_0xdf17('0x38')][_0xdf17('0x3a')]?_0x4b8819[_0xdf17('0x38')]:_0x46f778[_0xdf17('0x34')];if(!_0x562625[_0xdf17('0x35')][_0xdf17('0x3b')](_0xdf17('0x3c'))){_0x4b8819[_0xdf17('0x20')]=qs[_0xdf17('0x20')](_0x562625['query'][_0xdf17('0x20')]);_0x4b8819[_0xdf17('0x1e')]=qs['offset'](_0x562625[_0xdf17('0x35')][_0xdf17('0x1e')]);}_0x4b8819[_0xdf17('0x3d')]=qs[_0xdf17('0x3e')](_0x562625[_0xdf17('0x35')]['sort']);_0x4b8819[_0xdf17('0x3f')]=qs[_0xdf17('0x36')](_[_0xdf17('0x40')](_0x562625[_0xdf17('0x35')],_0x46f778[_0xdf17('0x36')]),_0x45939d);if(_0x562625[_0xdf17('0x35')][_0xdf17('0x41')]){_0x4b8819[_0xdf17('0x3f')]=_[_0xdf17('0x42')](_0x4b8819['where'],{'$or':_[_0xdf17('0x2e')](_0x45939d,function(_0x3ebf70){if(_0x3ebf70['type']!==_0xdf17('0x43')){var _0x27249e={};_0x27249e[_0x3ebf70[_0xdf17('0x2b')]]={'$like':'%'+_0x562625[_0xdf17('0x35')][_0xdf17('0x41')]+'%'};return _0x27249e;}})});}_0x4b8819=_[_0xdf17('0x42')]({},_0x4b8819,_0x562625[_0xdf17('0x44')]);var _0x41323d={'where':_0x4b8819[_0xdf17('0x3f')]};return db[_0xdf17('0x2f')][_0xdf17('0x21')](_0x41323d)[_0xdf17('0x28')](function(_0x43f0cd){_0x20d2db[_0xdf17('0x21')]=_0x43f0cd;if(_0x562625['query'][_0xdf17('0x45')]){_0x4b8819['include']=[{'all':!![]}];}return db[_0xdf17('0x2f')][_0xdf17('0x46')](_0x4b8819);})[_0xdf17('0x28')](function(_0x1bba00){_0x20d2db['rows']=_0x1bba00;return _0x20d2db;})[_0xdf17('0x28')](respondWithFilteredResult(_0x48d157,_0x4b8819))[_0xdf17('0x47')](handleError(_0x48d157,null));};exports[_0xdf17('0x48')]=function(_0x566116,_0x3f0d63){var _0x1b53bb={'raw':!![],'where':{'id':_0x566116[_0xdf17('0x49')]['id']}},_0xd165c3={};_0xd165c3[_0xdf17('0x34')]=_[_0xdf17('0x4a')](db[_0xdf17('0x2f')][_0xdf17('0x30')]);_0xd165c3['query']=_['keys'](_0x566116[_0xdf17('0x35')]);_0xd165c3[_0xdf17('0x36')]=_[_0xdf17('0x37')](_0xd165c3[_0xdf17('0x34')],_0xd165c3['query']);_0x1b53bb[_0xdf17('0x38')]=_['intersection'](_0xd165c3[_0xdf17('0x34')],qs[_0xdf17('0x39')](_0x566116[_0xdf17('0x35')][_0xdf17('0x39')]));_0x1b53bb[_0xdf17('0x38')]=_0x1b53bb['attributes'][_0xdf17('0x3a')]?_0x1b53bb['attributes']:_0xd165c3['model'];if(_0x566116['query'][_0xdf17('0x45')]){_0x1b53bb['include']=[{'all':!![]}];}_0x1b53bb=_[_0xdf17('0x42')]({},_0x1b53bb,_0x566116[_0xdf17('0x44')]);return db[_0xdf17('0x2f')]['find'](_0x1b53bb)[_0xdf17('0x28')](handleEntityNotFound(_0x3f0d63,null))[_0xdf17('0x28')](respondWithResult(_0x3f0d63,null))[_0xdf17('0x47')](handleError(_0x3f0d63,null));};exports[_0xdf17('0x4b')]=function(_0x1fa4c3,_0x241cdd){if(_0x1fa4c3[_0xdf17('0x4c')]['id']){delete _0x1fa4c3[_0xdf17('0x4c')]['id'];}return db[_0xdf17('0x2f')][_0xdf17('0x4d')]({'where':{'id':_0x1fa4c3[_0xdf17('0x49')]['id']}})[_0xdf17('0x28')](handleEntityNotFound(_0x241cdd,null))[_0xdf17('0x28')](saveUpdates(_0x1fa4c3[_0xdf17('0x4c')],null))['then'](respondWithResult(_0x241cdd,null))[_0xdf17('0x47')](handleError(_0x241cdd,null));};exports[_0xdf17('0x29')]=function(_0x47648d,_0x419425){return db['CmHopperBlack'][_0xdf17('0x4d')]({'where':{'id':_0x47648d['params']['id']}})[_0xdf17('0x28')](handleEntityNotFound(_0x419425,null))['then'](removeEntity(_0x419425,null))[_0xdf17('0x47')](handleError(_0x419425,null));};exports[_0xdf17('0x4e')]=function(_0x3ef8d3,_0x9b3508){return db['CmHopperBlack']['describe']()[_0xdf17('0x28')](respondWithResult(_0x9b3508,null))[_0xdf17('0x47')](handleError(_0x9b3508,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index ef06d99..a00f2f0 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 _0x5d12=['CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cmHopperBlack.attributes','exports','define'];(function(_0x1dacde,_0x102cc6){var _0xfa1f=function(_0x46f0a3){while(--_0x46f0a3){_0x1dacde['push'](_0x1dacde['shift']());}};_0xfa1f(++_0x102cc6);}(_0x5d12,0x1a2));var _0x25d1=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x5d12[_0xc8a931];return _0x28bd27;};'use strict';var _=require(_0x25d1('0x0'));var util=require(_0x25d1('0x1'));var logger=require(_0x25d1('0x2'))(_0x25d1('0x3'));var moment=require(_0x25d1('0x4'));var BPromise=require(_0x25d1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x25d1('0x6'));var rimraf=require('rimraf');var config=require(_0x25d1('0x7'));var attributes=require(_0x25d1('0x8'));module[_0x25d1('0x9')]=function(_0x392799,_0x7d557b){return _0x392799[_0x25d1('0xa')](_0x25d1('0xb'),attributes,{'tableName':_0x25d1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4f1=['lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','cm_hopper_black'];(function(_0x50f146,_0x4abe95){var _0x8475b8=function(_0x39d0b4){while(--_0x39d0b4){_0x50f146['push'](_0x50f146['shift']());}};_0x8475b8(++_0x4abe95);}(_0xf4f1,0xf2));var _0x1f4f=function(_0x384a29,_0x57bab8){_0x384a29=_0x384a29-0x0;var _0x493473=_0xf4f1[_0x384a29];return _0x493473;};'use strict';var _=require(_0x1f4f('0x0'));var util=require('util');var logger=require(_0x1f4f('0x1'))(_0x1f4f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1f4f('0x3'));var fs=require('fs');var path=require(_0x1f4f('0x4'));var rimraf=require(_0x1f4f('0x5'));var config=require(_0x1f4f('0x6'));var attributes=require(_0x1f4f('0x7'));module[_0x1f4f('0x8')]=function(_0x264736,_0x5c5aaf){return _0x264736[_0x1f4f('0x9')]('CmHopperBlack',attributes,{'tableName':_0x1f4f('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 f169790..91f66a8 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 _0xd6f5=['jayson/promise','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes','limit','include','map','model','debug','body','where','UpdateCmHopperBlack','destroy','DestroyCmHopperBlack','util','moment','bluebird','randomstring','../../config/utils','../../config/environment'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0xd6f5,0xa4));var _0x5d6f=function(_0x3ff2f9,_0x544ba1){_0x3ff2f9=_0x3ff2f9-0x0;var _0x3b0913=_0xd6f5[_0x3ff2f9];return _0x3b0913;};'use strict';var _=require('lodash');var util=require(_0x5d6f('0x0'));var moment=require(_0x5d6f('0x1'));var BPromise=require(_0x5d6f('0x2'));var rs=require(_0x5d6f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5d6f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x5d6f('0x5'));var jayson=require(_0x5d6f('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2eb919,_0x1f84fc,_0x3c6066){return new BPromise(function(_0xd41856,_0x46dcee){return client[_0x5d6f('0x7')](_0x2eb919,_0x3c6066)[_0x5d6f('0x8')](function(_0x57d17d){logger[_0x5d6f('0x9')](_0x5d6f('0xa'),_0x1f84fc,_0x5d6f('0xb'));logger['debug'](_0x5d6f('0xc'),_0x1f84fc,_0x5d6f('0xb'),JSON[_0x5d6f('0xd')](_0x57d17d));if(_0x57d17d[_0x5d6f('0xe')]){if(_0x57d17d[_0x5d6f('0xe')]['code']===0x1f4){logger['error'](_0x5d6f('0xa'),_0x1f84fc,_0x57d17d['error']['message']);return _0x46dcee(_0x57d17d['error'][_0x5d6f('0xf')]);}logger[_0x5d6f('0xe')](_0x5d6f('0xa'),_0x1f84fc,_0x57d17d[_0x5d6f('0xe')][_0x5d6f('0xf')]);return _0xd41856(_0x57d17d[_0x5d6f('0xe')][_0x5d6f('0xf')]);}else{logger['info'](_0x5d6f('0xa'),_0x1f84fc,_0x5d6f('0xb'));_0xd41856(_0x57d17d[_0x5d6f('0x10')][_0x5d6f('0xf')]);}})[_0x5d6f('0x11')](function(_0x41cde2){logger[_0x5d6f('0xe')](_0x5d6f('0xa'),_0x1f84fc,_0x41cde2);_0x46dcee(_0x41cde2);});});}exports[_0x5d6f('0x12')]=function(_0x89efb6){var _0x480dde=this;return new Promise(function(_0x387c1f,_0x274c45){return db[_0x5d6f('0x13')][_0x5d6f('0x14')]({'raw':_0x89efb6[_0x5d6f('0x15')]?_0x89efb6[_0x5d6f('0x15')][_0x5d6f('0x16')]===undefined?!![]:![]:!![],'where':_0x89efb6[_0x5d6f('0x15')]?_0x89efb6['options']['where']||null:null,'attributes':_0x89efb6[_0x5d6f('0x15')]?_0x89efb6['options'][_0x5d6f('0x17')]||null:null,'limit':_0x89efb6['options']?_0x89efb6[_0x5d6f('0x15')][_0x5d6f('0x18')]||null:null,'include':_0x89efb6[_0x5d6f('0x15')]?_0x89efb6['options'][_0x5d6f('0x19')]?_[_0x5d6f('0x1a')](_0x89efb6[_0x5d6f('0x15')][_0x5d6f('0x19')],function(_0x53f763){return{'model':db[_0x53f763[_0x5d6f('0x1b')]],'as':_0x53f763['as'],'attributes':_0x53f763[_0x5d6f('0x17')],'include':_0x53f763[_0x5d6f('0x19')]?_[_0x5d6f('0x1a')](_0x53f763[_0x5d6f('0x19')],function(_0x6b5ee2){return{'model':db[_0x6b5ee2[_0x5d6f('0x1b')]],'as':_0x6b5ee2['as'],'attributes':_0x6b5ee2[_0x5d6f('0x17')],'include':_0x6b5ee2['include']?_[_0x5d6f('0x1a')](_0x6b5ee2['include'],function(_0x5c62f6){return{'model':db[_0x5c62f6[_0x5d6f('0x1b')]],'as':_0x5c62f6['as'],'attributes':_0x5c62f6[_0x5d6f('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5d6f('0x8')](function(_0xb8bfcc){logger[_0x5d6f('0x9')](_0x5d6f('0x12'),_0x89efb6);logger[_0x5d6f('0x1c')]('GetCmHopperBlack',_0x89efb6,JSON['stringify'](_0xb8bfcc));_0x387c1f(_0xb8bfcc);})[_0x5d6f('0x11')](function(_0x355a17){logger['error'](_0x5d6f('0x12'),_0x355a17[_0x5d6f('0xf')],_0x89efb6);_0x274c45(_0x480dde[_0x5d6f('0xe')](0x1f4,_0x355a17[_0x5d6f('0xf')]));});});};exports['UpdateCmHopperBlack']=function(_0x1ca650){var _0x21747c=this;return new Promise(function(_0x4c4243,_0x5b4c9c){return db[_0x5d6f('0x13')]['update'](_0x1ca650[_0x5d6f('0x1d')],{'raw':_0x1ca650[_0x5d6f('0x15')]?_0x1ca650['options'][_0x5d6f('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ca650[_0x5d6f('0x15')]?_0x1ca650[_0x5d6f('0x15')][_0x5d6f('0x1e')]||null:null,'attributes':_0x1ca650[_0x5d6f('0x15')]?_0x1ca650[_0x5d6f('0x15')][_0x5d6f('0x17')]||null:null,'limit':_0x1ca650[_0x5d6f('0x15')]?_0x1ca650[_0x5d6f('0x15')][_0x5d6f('0x18')]||null:null})['then'](function(_0x3c86e0){logger[_0x5d6f('0x9')]('UpdateCmHopperBlack',_0x1ca650);logger[_0x5d6f('0x1c')](_0x5d6f('0x1f'),_0x1ca650,JSON['stringify'](_0x3c86e0));_0x4c4243(_0x3c86e0);})[_0x5d6f('0x11')](function(_0x28948a){logger['error'](_0x5d6f('0x1f'),_0x28948a[_0x5d6f('0xf')],_0x1ca650);_0x5b4c9c(_0x21747c['error'](0x1f4,_0x28948a['message']));});});};exports['DestroyCmHopperBlack']=function(_0x40d57e){var _0xb302f=this;return new Promise(function(_0x3bd943,_0x441f16){return db[_0x5d6f('0x13')][_0x5d6f('0x20')]({'where':_0x40d57e[_0x5d6f('0x15')]?_0x40d57e[_0x5d6f('0x15')]['where']||null:null})[_0x5d6f('0x8')](function(_0x16cba7){logger[_0x5d6f('0x9')](_0x5d6f('0x21'),_0x40d57e);logger[_0x5d6f('0x1c')](_0x5d6f('0x21'),_0x40d57e,JSON[_0x5d6f('0xd')](_0x16cba7));_0x3bd943(_0x16cba7);})[_0x5d6f('0x11')](function(_0x13c3fc){logger[_0x5d6f('0xe')](_0x5d6f('0x21'),_0x13c3fc['message'],_0x40d57e);_0x441f16(_0xb302f[_0x5d6f('0xe')](0x1f4,_0x13c3fc['message']));});});}; \ No newline at end of file +var _0xbfea=['debug','update','body','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','map','include','model'];(function(_0x590da5,_0x298084){var _0x54d4c4=function(_0xf67551){while(--_0xf67551){_0x590da5['push'](_0x590da5['shift']());}};_0x54d4c4(++_0x298084);}(_0xbfea,0x136));var _0xabfe=function(_0x589949,_0x592bfb){_0x589949=_0x589949-0x0;var _0x4e4056=_0xbfea[_0x589949];return _0x4e4056;};'use strict';var _=require('lodash');var util=require(_0xabfe('0x0'));var moment=require(_0xabfe('0x1'));var BPromise=require(_0xabfe('0x2'));var rs=require(_0xabfe('0x3'));var fs=require('fs');var Redis=require(_0xabfe('0x4'));var db=require(_0xabfe('0x5'))['db'];var utils=require(_0xabfe('0x6'));var logger=require(_0xabfe('0x7'))(_0xabfe('0x8'));var config=require(_0xabfe('0x9'));var jayson=require(_0xabfe('0xa'));var client=jayson[_0xabfe('0xb')][_0xabfe('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22222a,_0x54a868,_0x33ddc1){return new BPromise(function(_0x12d40c,_0x5fba22){return client['request'](_0x22222a,_0x33ddc1)[_0xabfe('0xd')](function(_0x428465){logger[_0xabfe('0xe')](_0xabfe('0xf'),_0x54a868,_0xabfe('0x10'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x54a868,_0xabfe('0x10'),JSON[_0xabfe('0x11')](_0x428465));if(_0x428465[_0xabfe('0x12')]){if(_0x428465[_0xabfe('0x12')][_0xabfe('0x13')]===0x1f4){logger[_0xabfe('0x12')](_0xabfe('0xf'),_0x54a868,_0x428465[_0xabfe('0x12')]['message']);return _0x5fba22(_0x428465[_0xabfe('0x12')][_0xabfe('0x14')]);}logger[_0xabfe('0x12')](_0xabfe('0xf'),_0x54a868,_0x428465['error']['message']);return _0x12d40c(_0x428465[_0xabfe('0x12')][_0xabfe('0x14')]);}else{logger[_0xabfe('0xe')](_0xabfe('0xf'),_0x54a868,_0xabfe('0x10'));_0x12d40c(_0x428465['result']['message']);}})[_0xabfe('0x15')](function(_0x5c1723){logger[_0xabfe('0x12')](_0xabfe('0xf'),_0x54a868,_0x5c1723);_0x5fba22(_0x5c1723);});});}exports[_0xabfe('0x16')]=function(_0x3c17a1){var _0x8e0d86=this;return new Promise(function(_0x2adeb0,_0x3ed419){return db[_0xabfe('0x17')][_0xabfe('0x18')]({'raw':_0x3c17a1[_0xabfe('0x19')]?_0x3c17a1['options'][_0xabfe('0x1a')]===undefined?!![]:![]:!![],'where':_0x3c17a1[_0xabfe('0x19')]?_0x3c17a1['options'][_0xabfe('0x1b')]||null:null,'attributes':_0x3c17a1[_0xabfe('0x19')]?_0x3c17a1[_0xabfe('0x19')][_0xabfe('0x1c')]||null:null,'limit':_0x3c17a1[_0xabfe('0x19')]?_0x3c17a1[_0xabfe('0x19')]['limit']||null:null,'include':_0x3c17a1[_0xabfe('0x19')]?_0x3c17a1[_0xabfe('0x19')]['include']?_[_0xabfe('0x1d')](_0x3c17a1[_0xabfe('0x19')][_0xabfe('0x1e')],function(_0x46466a){return{'model':db[_0x46466a[_0xabfe('0x1f')]],'as':_0x46466a['as'],'attributes':_0x46466a[_0xabfe('0x1c')],'include':_0x46466a[_0xabfe('0x1e')]?_['map'](_0x46466a['include'],function(_0x5b4a06){return{'model':db[_0x5b4a06['model']],'as':_0x5b4a06['as'],'attributes':_0x5b4a06[_0xabfe('0x1c')],'include':_0x5b4a06[_0xabfe('0x1e')]?_[_0xabfe('0x1d')](_0x5b4a06[_0xabfe('0x1e')],function(_0x31fe64){return{'model':db[_0x31fe64['model']],'as':_0x31fe64['as'],'attributes':_0x31fe64['attributes']};}):[]};}):[]};}):[]:[]})[_0xabfe('0xd')](function(_0x4b7581){logger[_0xabfe('0xe')](_0xabfe('0x16'),_0x3c17a1);logger[_0xabfe('0x20')](_0xabfe('0x16'),_0x3c17a1,JSON[_0xabfe('0x11')](_0x4b7581));_0x2adeb0(_0x4b7581);})[_0xabfe('0x15')](function(_0x46a313){logger[_0xabfe('0x12')](_0xabfe('0x16'),_0x46a313['message'],_0x3c17a1);_0x3ed419(_0x8e0d86[_0xabfe('0x12')](0x1f4,_0x46a313['message']));});});};exports['UpdateCmHopperBlack']=function(_0x495aee){var _0x539398=this;return new Promise(function(_0x240221,_0x240dd9){return db[_0xabfe('0x17')][_0xabfe('0x21')](_0x495aee[_0xabfe('0x22')],{'raw':_0x495aee[_0xabfe('0x19')]?_0x495aee[_0xabfe('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x495aee[_0xabfe('0x19')]?_0x495aee[_0xabfe('0x19')][_0xabfe('0x1b')]||null:null,'attributes':_0x495aee['options']?_0x495aee['options'][_0xabfe('0x1c')]||null:null,'limit':_0x495aee[_0xabfe('0x19')]?_0x495aee[_0xabfe('0x19')]['limit']||null:null})[_0xabfe('0xd')](function(_0x5e5c6a){logger[_0xabfe('0xe')](_0xabfe('0x23'),_0x495aee);logger[_0xabfe('0x20')](_0xabfe('0x23'),_0x495aee,JSON['stringify'](_0x5e5c6a));_0x240221(_0x5e5c6a);})[_0xabfe('0x15')](function(_0x20baf4){logger[_0xabfe('0x12')]('UpdateCmHopperBlack',_0x20baf4[_0xabfe('0x14')],_0x495aee);_0x240dd9(_0x539398['error'](0x1f4,_0x20baf4[_0xabfe('0x14')]));});});};exports[_0xabfe('0x24')]=function(_0x408d47){var _0x247ff0=this;return new Promise(function(_0x155813,_0x292503){return db[_0xabfe('0x17')][_0xabfe('0x25')]({'where':_0x408d47[_0xabfe('0x19')]?_0x408d47[_0xabfe('0x19')][_0xabfe('0x1b')]||null:null})[_0xabfe('0xd')](function(_0x5489d7){logger[_0xabfe('0xe')]('DestroyCmHopperBlack',_0x408d47);logger[_0xabfe('0x20')](_0xabfe('0x24'),_0x408d47,JSON[_0xabfe('0x11')](_0x5489d7));_0x155813(_0x5489d7);})[_0xabfe('0x15')](function(_0x348e32){logger[_0xabfe('0x12')](_0xabfe('0x24'),_0x348e32['message'],_0x408d47);_0x292503(_0x247ff0[_0xabfe('0x12')](0x1f4,_0x348e32[_0xabfe('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index b6db5df..57ac1df 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 _0xe2fe=['/describe','describe','/:id','put','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3c7d53,_0x2826d0){var _0x2c8387=function(_0x21f0e8){while(--_0x21f0e8){_0x3c7d53['push'](_0x3c7d53['shift']());}};_0x2c8387(++_0x2826d0);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./cmHopperBlack.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0xc')](_0xee2f('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xee2f('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x687b=['isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get'];(function(_0x41f4d3,_0x5610a0){var _0x5f4808=function(_0x3d6e94){while(--_0x3d6e94){_0x41f4d3['push'](_0x41f4d3['shift']());}};_0x5f4808(++_0x5610a0);}(_0x687b,0x14a));var _0xb687=function(_0x1f3c56,_0x598757){_0x1f3c56=_0x1f3c56-0x0;var _0x569524=_0x687b[_0x1f3c56];return _0x569524;};'use strict';var multer=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var path=require(_0xb687('0x2'));var timeout=require(_0xb687('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb687('0x4'));var auth=require(_0xb687('0x5'));var interaction=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var controller=require(_0xb687('0x8'));router[_0xb687('0x9')]('/',auth[_0xb687('0xa')](),controller[_0xb687('0xb')]);router[_0xb687('0x9')](_0xb687('0xc'),auth['isAuthenticated'](),controller[_0xb687('0xd')]);router[_0xb687('0x9')]('/:id',auth[_0xb687('0xa')](),controller[_0xb687('0xe')]);router[_0xb687('0xf')](_0xb687('0x10'),auth[_0xb687('0xa')](),controller[_0xb687('0x11')]);router[_0xb687('0x12')](_0xb687('0x10'),auth[_0xb687('0xa')](),controller['destroy']);module[_0xb687('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 22fb461..31ba3e9 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 _0x4945=['seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff'];(function(_0x3f3b53,_0x3d035f){var _0x3fa180=function(_0x194ff3){while(--_0x194ff3){_0x3f3b53['push'](_0x3f3b53['shift']());}};_0x3fa180(++_0x3d035f);}(_0x4945,0x120));var _0x5494=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4945[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x5494('0x0'));var moment=require(_0x5494('0x1'));module[_0x5494('0x2')]={'state':{'type':Sequelize[_0x5494('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x5494('0x4')]},'scheduledat':{'type':Sequelize[_0x5494('0x5')]},'countbusyretry':{'type':Sequelize[_0x5494('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5494('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5494('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5494('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x5494('0x5')]},'responsetime':{'type':Sequelize[_0x5494('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x5494('0x5')]},'endtime':{'type':Sequelize[_0x5494('0x5')]},'ringtime':{'type':Sequelize[_0x5494('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5494('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5494('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5494('0x4')]},'campaign':{'type':Sequelize[_0x5494('0x4')]},'campaigntype':{'type':Sequelize[_0x5494('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x5494('0x4')]},'disposition':{'type':Sequelize[_0x5494('0x4')]},'secondDisposition':{'type':Sequelize[_0x5494('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x138077){var _0x4ebe8=this[_0x5494('0x6')](_0x5494('0x7'));if(_0x4ebe8&&_0x138077){this[_0x5494('0x8')](_0x5494('0x9'),moment(_0x138077)[_0x5494('0xa')](moment(_0x4ebe8),_0x5494('0xb')));}return this[_0x5494('0x8')]('dispositionat',_0x138077);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x5494('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x5494('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5494('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5494('0x5')]},'deleted':{'type':Sequelize[_0x5494('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x5494('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x5494('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x5494('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5494('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5494('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5494('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xfff0=['STRING','DATE','getDataValue','endtime','setDataValue','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER'];(function(_0x317bc9,_0x1c9afa){var _0x221aa2=function(_0x365bdc){while(--_0x365bdc){_0x317bc9['push'](_0x317bc9['shift']());}};_0x221aa2(++_0x1c9afa);}(_0xfff0,0x100));var _0x0fff=function(_0x59bcd7,_0x3805a4){_0x59bcd7=_0x59bcd7-0x0;var _0x5daf99=_0xfff0[_0x59bcd7];return _0x5daf99;};'use strict';var Sequelize=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));module[_0x0fff('0x2')]={'state':{'type':Sequelize[_0x0fff('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x0fff('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0fff('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x0fff('0x4')]},'calleridnum':{'type':Sequelize[_0x0fff('0x4')]},'calleridname':{'type':Sequelize[_0x0fff('0x4')]},'starttime':{'type':Sequelize[_0x0fff('0x5')]},'responsetime':{'type':Sequelize[_0x0fff('0x5')]},'answertime':{'type':Sequelize[_0x0fff('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x0fff('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x0fff('0x4')]},'campaigntype':{'type':Sequelize[_0x0fff('0x4')]},'membername':{'type':Sequelize[_0x0fff('0x4')]},'reason':{'type':Sequelize[_0x0fff('0x4')]},'disposition':{'type':Sequelize[_0x0fff('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0fff('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x4a72b7){var _0x2c559b=this[_0x0fff('0x6')](_0x0fff('0x7'));if(_0x2c559b&&_0x4a72b7){this[_0x0fff('0x8')]('followuptime',moment(_0x4a72b7)[_0x0fff('0x9')](moment(_0x2c559b),_0x0fff('0xa')));}return this[_0x0fff('0x8')](_0x0fff('0xb'),_0x4a72b7);}},'amd':{'type':Sequelize[_0x0fff('0xc')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x0fff('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x0fff('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x0fff('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0fff('0x5')]},'deleted':{'type':Sequelize[_0x0fff('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x0fff('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x0fff('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0fff('0x3')],'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 3f941f6..9f66072 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 _0x4888=['ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','NOW()','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','find','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','reject','save','then','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','CmHopperFinal','includeAll','include','rows','catch','params','options','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','COUNT','sequelize','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','createdAt','updatedAt','select','field','ANY_VALUE(ContactId)','ContactId'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0x4888,0x198));var _0x8488=function(_0x174e6d,_0x45f4d1){_0x174e6d=_0x174e6d-0x0;var _0x27a7eb=_0x4888[_0x174e6d];return _0x27a7eb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14462e,_0x3d1f7a){_0x3d1f7a=_0x3d1f7a||0xcc;return function(_0x58f83d){if(_0x58f83d){return _0x14462e['sendStatus'](_0x3d1f7a);}return _0x14462e[_0x8488('0x17')](_0x3d1f7a)['end']();};}function respondWithResult(_0x214083,_0x4e94fc){_0x4e94fc=_0x4e94fc||0xc8;return function(_0x5161a3){if(_0x5161a3){return _0x214083[_0x8488('0x17')](_0x4e94fc)[_0x8488('0x18')](_0x5161a3);}};}function respondWithFilteredResult(_0x5700b,_0x2bcb7c){return function(_0x3b3cfa){if(_0x3b3cfa){var _0x8d3b3d=typeof _0x2bcb7c[_0x8488('0x19')]==='undefined'&&typeof _0x2bcb7c[_0x8488('0x1a')]===_0x8488('0x1b');var _0x3edfe4=_0x3b3cfa[_0x8488('0x1c')];var _0x60ae2f=_0x8d3b3d?0x0:_0x2bcb7c[_0x8488('0x19')];var _0x1aedb1=_0x8d3b3d?_0x3b3cfa[_0x8488('0x1c')]:_0x2bcb7c[_0x8488('0x19')]+_0x2bcb7c[_0x8488('0x1a')];var _0x10bfd6;if(_0x1aedb1>=_0x3edfe4){_0x1aedb1=_0x3edfe4;_0x10bfd6=0xc8;}else{_0x10bfd6=0xce;}_0x5700b[_0x8488('0x17')](_0x10bfd6);return _0x5700b[_0x8488('0x1d')]('Content-Range',_0x60ae2f+'-'+_0x1aedb1+'/'+_0x3edfe4)['json'](_0x3b3cfa);}return null;};}function patchUpdates(_0x340d6b){return function(_0x12d40f){try{jsonpatch[_0x8488('0x1e')](_0x12d40f,_0x340d6b,!![]);}catch(_0x3c9fc2){return BPromise[_0x8488('0x1f')](_0x3c9fc2);}return _0x12d40f[_0x8488('0x20')]();};}function saveUpdates(_0x43b672,_0x3c078c){return function(_0x39dd43){if(_0x39dd43){return _0x39dd43['update'](_0x43b672)[_0x8488('0x21')](function(_0x4e07e1){return _0x4e07e1;});}return null;};}function removeEntity(_0x140b0b,_0x1361a6){return function(_0x290b33){if(_0x290b33){return _0x290b33['destroy']()['then'](function(){_0x140b0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x472624,_0x51fe30){return function(_0x58057a){if(!_0x58057a){_0x472624[_0x8488('0x22')](0x194);}return _0x58057a;};}function handleError(_0x2f350a,_0x2b3c97){_0x2b3c97=_0x2b3c97||0x1f4;return function(_0x6ebee0){logger[_0x8488('0x23')](_0x6ebee0['stack']);if(_0x6ebee0[_0x8488('0x24')]){delete _0x6ebee0[_0x8488('0x24')];}_0x2f350a[_0x8488('0x17')](_0x2b3c97)[_0x8488('0x25')](_0x6ebee0);};}exports[_0x8488('0x26')]=function(_0x27f5cf,_0x2c15ff){var _0x296b6c={},_0x368f9c={},_0x1d9317={'count':0x0,'rows':[]};var _0x888b24=_['map'](db['CmHopperFinal']['rawAttributes'],function(_0x292fe8){return{'name':_0x292fe8[_0x8488('0x27')],'type':_0x292fe8[_0x8488('0x28')][_0x8488('0x29')]};});_0x368f9c[_0x8488('0x2a')]=_[_0x8488('0x2b')](_0x888b24,'name');_0x368f9c[_0x8488('0x2c')]=_[_0x8488('0x2d')](_0x27f5cf[_0x8488('0x2c')]);_0x368f9c[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x368f9c['model'],_0x368f9c[_0x8488('0x2c')]);_0x296b6c[_0x8488('0x30')]=_['intersection'](_0x368f9c[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x31')]));_0x296b6c[_0x8488('0x30')]=_0x296b6c['attributes'][_0x8488('0x32')]?_0x296b6c[_0x8488('0x30')]:_0x368f9c[_0x8488('0x2a')];if(!_0x27f5cf['query'][_0x8488('0x33')]('nolimit')){_0x296b6c[_0x8488('0x1a')]=qs[_0x8488('0x1a')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x1a')]);_0x296b6c['offset']=qs[_0x8488('0x19')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x19')]);}_0x296b6c['order']=qs[_0x8488('0x34')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x34')]);_0x296b6c[_0x8488('0x35')]=qs[_0x8488('0x2e')](_[_0x8488('0x36')](_0x27f5cf[_0x8488('0x2c')],_0x368f9c[_0x8488('0x2e')]),_0x888b24);if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]){_0x296b6c[_0x8488('0x35')]=_['merge'](_0x296b6c['where'],{'$or':_[_0x8488('0x2b')](_0x888b24,function(_0x36c17a){if(_0x36c17a[_0x8488('0x28')]!==_0x8488('0x38')){var _0x2d9fa1={};_0x2d9fa1[_0x36c17a[_0x8488('0x24')]]={'$like':'%'+_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]+'%'};return _0x2d9fa1;}})});}_0x296b6c=_[_0x8488('0x39')]({},_0x296b6c,_0x27f5cf['options']);var _0xf5a0a0={'where':_0x296b6c[_0x8488('0x35')]};return db[_0x8488('0x3a')]['count'](_0xf5a0a0)[_0x8488('0x21')](function(_0xa50c4b){_0x1d9317[_0x8488('0x1c')]=_0xa50c4b;if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x3b')]){_0x296b6c[_0x8488('0x3c')]=[{'all':!![]}];}return db[_0x8488('0x3a')]['findAll'](_0x296b6c);})[_0x8488('0x21')](function(_0x1c33a1){_0x1d9317[_0x8488('0x3d')]=_0x1c33a1;return _0x1d9317;})['then'](respondWithFilteredResult(_0x2c15ff,_0x296b6c))[_0x8488('0x3e')](handleError(_0x2c15ff,null));};exports['show']=function(_0x40ee7e,_0x34b11b){var _0x5cbd11={'raw':!![],'where':{'id':_0x40ee7e[_0x8488('0x3f')]['id']}},_0x22a3f3={};_0x22a3f3[_0x8488('0x2a')]=_[_0x8488('0x2d')](db[_0x8488('0x3a')]['rawAttributes']);_0x22a3f3[_0x8488('0x2c')]=_['keys'](_0x40ee7e[_0x8488('0x2c')]);_0x22a3f3[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],_0x22a3f3[_0x8488('0x2c')]);_0x5cbd11[_0x8488('0x30')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x40ee7e[_0x8488('0x2c')][_0x8488('0x31')]));_0x5cbd11[_0x8488('0x30')]=_0x5cbd11[_0x8488('0x30')][_0x8488('0x32')]?_0x5cbd11[_0x8488('0x30')]:_0x22a3f3[_0x8488('0x2a')];if(_0x40ee7e[_0x8488('0x2c')]['includeAll']){_0x5cbd11[_0x8488('0x3c')]=[{'all':!![]}];}_0x5cbd11=_[_0x8488('0x39')]({},_0x5cbd11,_0x40ee7e[_0x8488('0x40')]);return db[_0x8488('0x3a')]['find'](_0x5cbd11)[_0x8488('0x21')](handleEntityNotFound(_0x34b11b,null))[_0x8488('0x21')](respondWithResult(_0x34b11b,null))[_0x8488('0x3e')](handleError(_0x34b11b,null));};exports[_0x8488('0x41')]=function(_0x52042c,_0x1f0516){return db[_0x8488('0x3a')][_0x8488('0x41')]()[_0x8488('0x21')](respondWithResult(_0x1f0516,null))[_0x8488('0x3e')](handleError(_0x1f0516,null));};exports[_0x8488('0x42')]=function(_0x886a9e,_0x299d8e){if(_0x886a9e[_0x8488('0x43')][_0x8488('0x44')]){delete _0x886a9e[_0x8488('0x43')][_0x8488('0x44')];}return db[_0x8488('0x3a')]['find']({'where':{'uniqueid':_0x886a9e['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x299d8e,null))[_0x8488('0x21')](saveUpdates(_0x886a9e[_0x8488('0x43')],null))[_0x8488('0x21')](respondWithResult(_0x299d8e,null))[_0x8488('0x3e')](handleError(_0x299d8e,null));};exports[_0x8488('0x45')]=function(_0x25f2dc,_0x27dfd2,_0x24fa20){return db['CmHopperFinal'][_0x8488('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x25f2dc[_0x8488('0x3f')]['id']},'attributes':[[db['sequelize']['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x8488('0x4a')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x4b')))),_0x8488('0x4c')],[db['sequelize']['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db['sequelize'][_0x8488('0x49')]('`state`\x20=\x205,\x201,\x20null'))),_0x8488('0x4d')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x208,\x201,\x20null'))),_0x8488('0x4e')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')]['literal'](_0x8488('0x4f')))),'dropContacts'],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x50')))),_0x8488('0x51')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')]['literal'](_0x8488('0x52')))),_0x8488('0x53')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')]['literal'](_0x8488('0x54')))),'answeringMachine']]})[_0x8488('0x21')](handleEntityNotFound(_0x27dfd2,null))[_0x8488('0x21')](respondWithResult(_0x27dfd2,null))[_0x8488('0x3e')](handleError(_0x27dfd2,null));};exports[_0x8488('0x55')]=function(_0x1971f3,_0x24ba2d,_0x4facfb){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x1971f3[_0x8488('0x3f')]['id']},'attributes':[[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x56')))),_0x8488('0x4a')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x4b')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db['sequelize'][_0x8488('0x49')](_0x8488('0x57')))),_0x8488('0x4e')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x8488('0x58')],[db[_0x8488('0x48')]['fn']('COUNT',db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x50')))),_0x8488('0x51')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db['sequelize'][_0x8488('0x49')](_0x8488('0x54')))),'answeringMachine']]})[_0x8488('0x21')](handleEntityNotFound(_0x24ba2d,null))['then'](respondWithResult(_0x24ba2d,null))[_0x8488('0x3e')](handleError(_0x24ba2d,null));};exports[_0x8488('0x59')]=function(_0x44a50b,_0x5815cb,_0xbee86e){return db[_0x8488('0x5a')]['find']({'where':{'id':_0x44a50b['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x5815cb,null))[_0x8488('0x21')](function(_0xfedfd2){var _0x3ab1b6;if(_0xfedfd2){_0x3ab1b6=squel[_0x8488('0x5b')]()[_0x8488('0x5c')](_0x8488('0x5d'))[_0x8488('0x5e')]([_0x8488('0x5f'),_0x8488('0x60'),'ContactId',_0x8488('0x61'),'VoiceQueueId',_0x8488('0x62'),_0x8488('0x63')],squel[_0x8488('0x64')]()[_0x8488('0x65')]('ANY_VALUE(calleridnum)',_0x8488('0x5f'))[_0x8488('0x65')]('NOW()',_0x8488('0x60'))['field'](_0x8488('0x66'),_0x8488('0x67'))[_0x8488('0x65')](_0x8488('0x68'),_0x8488('0x61'))[_0x8488('0x65')](_0x8488('0x69'),_0x8488('0x6a'))['field'](_0x8488('0x6b'),'createdAt')['field'](_0x8488('0x6b'),_0x8488('0x63'))[_0x8488('0x6c')]('cm_hopper_final')['where'](_0x8488('0x6d'),_0x44a50b[_0x8488('0x3f')]['id']['toString']())[_0x8488('0x35')](_0x8488('0x6e'),_0x44a50b[_0x8488('0x43')][_0x8488('0x6f')][_0x8488('0x70')]())[_0x8488('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x8488('0x35')](_0x8488('0x71'),squel[_0x8488('0x64')]()['field'](_0x8488('0x5f'))[_0x8488('0x6c')](_0x8488('0x5d'))['where'](_0x8488('0x6d'),_0x44a50b[_0x8488('0x3f')]['id']['toString']()))['where'](_0x8488('0x71'),squel[_0x8488('0x64')]()['field'](_0x8488('0x72'))[_0x8488('0x6c')]('cm_hopper_final')['where'](_0x8488('0x6d'),_0x44a50b['params']['id'][_0x8488('0x70')]())[_0x8488('0x35')](_0x8488('0x73')))[_0x8488('0x74')]('ContactId'))[_0x8488('0x70')]();return db['sequelize'][_0x8488('0x2c')](_0x3ab1b6);}return[];})['then'](respondWithResult(_0x5815cb,null))[_0x8488('0x3e')](handleError(_0x5815cb,null));};exports[_0x8488('0x75')]=function(_0x267401,_0x1e635a,_0x31ab35){return db[_0x8488('0x76')][_0x8488('0x77')]({'where':{'id':_0x267401[_0x8488('0x3f')]['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x1e635a,null))[_0x8488('0x21')](function(_0xce1d1a){var _0xc9c221;if(_0xce1d1a){_0xc9c221=squel[_0x8488('0x5b')]()[_0x8488('0x5c')]('cm_hopper')[_0x8488('0x5e')]([_0x8488('0x5f'),'scheduledAt',_0x8488('0x67'),_0x8488('0x61'),_0x8488('0x78'),_0x8488('0x62'),_0x8488('0x63')],squel[_0x8488('0x64')]()[_0x8488('0x65')](_0x8488('0x79'),_0x8488('0x5f'))[_0x8488('0x65')](_0x8488('0x6b'),'scheduledAt')[_0x8488('0x65')](_0x8488('0x66'),'ContactId')[_0x8488('0x65')](_0x8488('0x68'),_0x8488('0x61'))[_0x8488('0x65')](_0x8488('0x7a'),'CampaignId')['field'](_0x8488('0x6b'),_0x8488('0x62'))[_0x8488('0x65')](_0x8488('0x6b'),_0x8488('0x63'))[_0x8488('0x6c')](_0x8488('0x7b'))[_0x8488('0x35')](_0x8488('0x7c'),_0x267401[_0x8488('0x3f')]['id'][_0x8488('0x70')]())[_0x8488('0x35')](_0x8488('0x6e'),_0x267401[_0x8488('0x43')][_0x8488('0x6f')]['toString']())[_0x8488('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x8488('0x71'),squel[_0x8488('0x64')]()[_0x8488('0x65')](_0x8488('0x5f'))[_0x8488('0x6c')](_0x8488('0x5d'))[_0x8488('0x35')](_0x8488('0x7c'),_0x267401[_0x8488('0x3f')]['id'][_0x8488('0x70')]()))['where'](_0x8488('0x71'),squel[_0x8488('0x64')]()[_0x8488('0x65')](_0x8488('0x72'))[_0x8488('0x6c')](_0x8488('0x7b'))['where'](_0x8488('0x7c'),_0x267401['params']['id'][_0x8488('0x70')]())[_0x8488('0x35')]('state\x20=\x204'))['group'](_0x8488('0x67')))[_0x8488('0x70')]();return db[_0x8488('0x48')][_0x8488('0x2c')](_0xc9c221);}return[];})[_0x8488('0x21')](respondWithResult(_0x1e635a,null))['catch'](handleError(_0x1e635a,null));};exports[_0x8488('0x7d')]=function(_0x19c5c6,_0x50f773,_0x52c750){return db[_0x8488('0x7e')][_0x8488('0x7f')]({'where':{'VoiceQueueId':_0x19c5c6[_0x8488('0x43')]['VoiceQueueId'],'CampaignId':_0x19c5c6['body'][_0x8488('0x78')],'ContactId':_0x19c5c6[_0x8488('0x43')][_0x8488('0x67')]}})['then'](handleEntityNotFound(_0x50f773,null))[_0x8488('0x21')](function(_0x1e4e51){if(_0x1e4e51){return _0x1e4e51;}return null;})[_0x8488('0x21')](respondWithResult(_0x50f773,null))[_0x8488('0x3e')](handleError(_0x50f773,null));}; \ No newline at end of file +var _0xc4aa=['ContactId','ListId','ANY_VALUE(VoiceQueueId)','NOW()','createdAt','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','cm_hopper','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','phone','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','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','map','CmHopperFinal','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','describe','uniqueid','find','body','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','scheduledAt','VoiceQueueId','updatedAt','field','ANY_VALUE(calleridnum)'];(function(_0x53f218,_0x27514c){var _0x21890a=function(_0x445133){while(--_0x445133){_0x53f218['push'](_0x53f218['shift']());}};_0x21890a(++_0x27514c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xc4aa[_0x11005e];return _0x29338f;};'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);};}exports[_0xac4a('0x2a')]=function(_0x42a33c,_0x2772fe){var _0x116700={},_0x4a5a9e={},_0x47f49c={'count':0x0,'rows':[]};var _0xdb7e=_[_0xac4a('0x2b')](db[_0xac4a('0x2c')]['rawAttributes'],function(_0x4bda1f){return{'name':_0x4bda1f[_0xac4a('0x2d')],'type':_0x4bda1f[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x4a5a9e[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0xdb7e,'name');_0x4a5a9e[_0xac4a('0x31')]=_['keys'](_0x42a33c[_0xac4a('0x31')]);_0x4a5a9e['filters']=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],_0x4a5a9e[_0xac4a('0x31')]);_0x116700[_0xac4a('0x33')]=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x34')]));_0x116700[_0xac4a('0x33')]=_0x116700[_0xac4a('0x33')][_0xac4a('0x35')]?_0x116700[_0xac4a('0x33')]:_0x4a5a9e[_0xac4a('0x30')];if(!_0x42a33c['query'][_0xac4a('0x36')](_0xac4a('0x37'))){_0x116700['limit']=qs[_0xac4a('0x1d')](_0x42a33c[_0xac4a('0x31')]['limit']);_0x116700['offset']=qs[_0xac4a('0x1b')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x1b')]);}_0x116700[_0xac4a('0x38')]=qs['sort'](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x39')]);_0x116700['where']=qs[_0xac4a('0x3a')](_[_0xac4a('0x3b')](_0x42a33c[_0xac4a('0x31')],_0x4a5a9e['filters']),_0xdb7e);if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x3c')]){_0x116700[_0xac4a('0x3d')]=_['merge'](_0x116700[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2b')](_0xdb7e,function(_0x4b9faf){if(_0x4b9faf['type']!==_0xac4a('0x3e')){var _0x5e0926={};_0x5e0926[_0x4b9faf['name']]={'$like':'%'+_0x42a33c['query']['filter']+'%'};return _0x5e0926;}})});}_0x116700=_[_0xac4a('0x3f')]({},_0x116700,_0x42a33c[_0xac4a('0x40')]);var _0x37834b={'where':_0x116700[_0xac4a('0x3d')]};return db[_0xac4a('0x2c')][_0xac4a('0x1e')](_0x37834b)[_0xac4a('0x24')](function(_0x2b16f0){_0x47f49c[_0xac4a('0x1e')]=_0x2b16f0;if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x41')]){_0x116700[_0xac4a('0x42')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x116700);})['then'](function(_0x1e1cc5){_0x47f49c[_0xac4a('0x43')]=_0x1e1cc5;return _0x47f49c;})[_0xac4a('0x24')](respondWithFilteredResult(_0x2772fe,_0x116700))[_0xac4a('0x44')](handleError(_0x2772fe,null));};exports[_0xac4a('0x45')]=function(_0x411543,_0x8febf0){var _0x3441f2={'raw':!![],'where':{'id':_0x411543[_0xac4a('0x46')]['id']}},_0x3e9973={};_0x3e9973['model']=_[_0xac4a('0x47')](db[_0xac4a('0x2c')][_0xac4a('0x48')]);_0x3e9973[_0xac4a('0x31')]=_[_0xac4a('0x47')](_0x411543['query']);_0x3e9973[_0xac4a('0x3a')]=_[_0xac4a('0x32')](_0x3e9973['model'],_0x3e9973[_0xac4a('0x31')]);_0x3441f2['attributes']=_[_0xac4a('0x32')](_0x3e9973[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x411543[_0xac4a('0x31')][_0xac4a('0x34')]));_0x3441f2[_0xac4a('0x33')]=_0x3441f2[_0xac4a('0x33')][_0xac4a('0x35')]?_0x3441f2[_0xac4a('0x33')]:_0x3e9973[_0xac4a('0x30')];if(_0x411543[_0xac4a('0x31')][_0xac4a('0x41')]){_0x3441f2['include']=[{'all':!![]}];}_0x3441f2=_[_0xac4a('0x3f')]({},_0x3441f2,_0x411543[_0xac4a('0x40')]);return db[_0xac4a('0x2c')]['find'](_0x3441f2)[_0xac4a('0x24')](handleEntityNotFound(_0x8febf0,null))[_0xac4a('0x24')](respondWithResult(_0x8febf0,null))['catch'](handleError(_0x8febf0,null));};exports[_0xac4a('0x49')]=function(_0x5a7f6e,_0x244950){return db[_0xac4a('0x2c')][_0xac4a('0x49')]()['then'](respondWithResult(_0x244950,null))['catch'](handleError(_0x244950,null));};exports[_0xac4a('0x23')]=function(_0x4aaeff,_0x18ae96){if(_0x4aaeff['body'][_0xac4a('0x4a')]){delete _0x4aaeff['body'][_0xac4a('0x4a')];}return db[_0xac4a('0x2c')][_0xac4a('0x4b')]({'where':{'uniqueid':_0x4aaeff[_0xac4a('0x46')]['id']}})['then'](handleEntityNotFound(_0x18ae96,null))[_0xac4a('0x24')](saveUpdates(_0x4aaeff[_0xac4a('0x4c')],null))[_0xac4a('0x24')](respondWithResult(_0x18ae96,null))[_0xac4a('0x44')](handleError(_0x18ae96,null));};exports[_0xac4a('0x4d')]=function(_0x138876,_0x187306,_0x4e6e19){return db[_0xac4a('0x2c')][_0xac4a('0x4e')]({'raw':![],'where':{'VoiceQueueId':_0x138876['params']['id']},'attributes':[[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x51')))),_0xac4a('0x52')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')]('`state`\x20=\x203,\x201,\x20null'))),_0xac4a('0x54')],[db[_0xac4a('0x4f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')]('`state`\x20=\x205,\x201,\x20null'))),_0xac4a('0x55')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x56')))),_0xac4a('0x57')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x58')))),_0xac4a('0x59')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5a')))),_0xac4a('0x5b')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5c')))),_0xac4a('0x5d')],[db['sequelize']['fn'](_0xac4a('0x50'),db['sequelize']['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x5e')))),'answeringMachine']]})[_0xac4a('0x24')](handleEntityNotFound(_0x187306,null))['then'](respondWithResult(_0x187306,null))['catch'](handleError(_0x187306,null));};exports[_0xac4a('0x5f')]=function(_0x568ffb,_0x3bcae2,_0x3c2f84){return db[_0xac4a('0x2c')][_0xac4a('0x4e')]({'raw':![],'where':{'CampaignId':_0x568ffb['params']['id']},'attributes':[[db[_0xac4a('0x4f')]['fn']('COUNT',db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x51')))),_0xac4a('0x52')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x60')))),_0xac4a('0x54')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x61')))),_0xac4a('0x55')],[db['sequelize']['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x56')))),_0xac4a('0x57')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db['sequelize']['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x58')))),_0xac4a('0x59')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5a')))),_0xac4a('0x5b')],[db[_0xac4a('0x4f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5c')))),_0xac4a('0x5d')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5e')))),_0xac4a('0x62')]]})[_0xac4a('0x24')](handleEntityNotFound(_0x3bcae2,null))['then'](respondWithResult(_0x3bcae2,null))[_0xac4a('0x44')](handleError(_0x3bcae2,null));};exports[_0xac4a('0x63')]=function(_0x26bd31,_0x231932,_0x513976){return db[_0xac4a('0x64')]['find']({'where':{'id':_0x26bd31[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x231932,null))['then'](function(_0x5bd95b){var _0x17eac2;if(_0x5bd95b){_0x17eac2=squel[_0xac4a('0x65')]()[_0xac4a('0x66')]('cm_hopper')[_0xac4a('0x67')](['phone',_0xac4a('0x68'),'ContactId','ListId',_0xac4a('0x69'),'createdAt',_0xac4a('0x6a')],squel['select']()[_0xac4a('0x6b')](_0xac4a('0x6c'),'phone')[_0xac4a('0x6b')]('NOW()',_0xac4a('0x68'))[_0xac4a('0x6b')]('ANY_VALUE(ContactId)',_0xac4a('0x6d'))['field']('ANY_VALUE(ListId)',_0xac4a('0x6e'))['field'](_0xac4a('0x6f'),'VoiceQueueId')['field'](_0xac4a('0x70'),_0xac4a('0x71'))[_0xac4a('0x6b')]('NOW()','updatedAt')[_0xac4a('0x72')](_0xac4a('0x73'))['where']('VoiceQueueId\x20=\x20?',_0x26bd31[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x75'),_0x26bd31[_0xac4a('0x4c')][_0xac4a('0x76')][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x77'))['where'](_0xac4a('0x78'),squel[_0xac4a('0x79')]()[_0xac4a('0x6b')]('phone')[_0xac4a('0x72')](_0xac4a('0x7a'))[_0xac4a('0x3d')](_0xac4a('0x7b'),_0x26bd31[_0xac4a('0x46')]['id']['toString']()))[_0xac4a('0x3d')](_0xac4a('0x78'),squel[_0xac4a('0x79')]()[_0xac4a('0x6b')](_0xac4a('0x7c'))[_0xac4a('0x72')](_0xac4a('0x73'))['where'](_0xac4a('0x7b'),_0x26bd31[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x7d')))[_0xac4a('0x7e')]('ContactId'))[_0xac4a('0x74')]();return db[_0xac4a('0x4f')][_0xac4a('0x31')](_0x17eac2);}return[];})[_0xac4a('0x24')](respondWithResult(_0x231932,null))['catch'](handleError(_0x231932,null));};exports[_0xac4a('0x7f')]=function(_0x56a934,_0x4447b5,_0x22b718){return db['Campaign']['find']({'where':{'id':_0x56a934[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x4447b5,null))[_0xac4a('0x24')](function(_0x4bb03d){var _0x1f3f1c;if(_0x4bb03d){_0x1f3f1c=squel['insert']()[_0xac4a('0x66')](_0xac4a('0x7a'))[_0xac4a('0x67')]([_0xac4a('0x80'),_0xac4a('0x68'),'ContactId','ListId',_0xac4a('0x81'),_0xac4a('0x71'),_0xac4a('0x6a')],squel[_0xac4a('0x79')]()[_0xac4a('0x6b')](_0xac4a('0x6c'),_0xac4a('0x80'))[_0xac4a('0x6b')]('NOW()','scheduledAt')[_0xac4a('0x6b')](_0xac4a('0x82'),_0xac4a('0x6d'))[_0xac4a('0x6b')](_0xac4a('0x83'),_0xac4a('0x6e'))[_0xac4a('0x6b')](_0xac4a('0x84'),'CampaignId')['field'](_0xac4a('0x70'),_0xac4a('0x71'))[_0xac4a('0x6b')](_0xac4a('0x70'),_0xac4a('0x6a'))[_0xac4a('0x72')](_0xac4a('0x73'))['where'](_0xac4a('0x85'),_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())['where'](_0xac4a('0x75'),_0x56a934[_0xac4a('0x4c')][_0xac4a('0x76')][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x77'))[_0xac4a('0x3d')](_0xac4a('0x78'),squel[_0xac4a('0x79')]()['field'](_0xac4a('0x80'))['from'](_0xac4a('0x7a'))[_0xac4a('0x3d')](_0xac4a('0x85'),_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]()))[_0xac4a('0x3d')](_0xac4a('0x78'),squel['select']()[_0xac4a('0x6b')](_0xac4a('0x7c'))[_0xac4a('0x72')](_0xac4a('0x73'))[_0xac4a('0x3d')]('CampaignId\x20=\x20?',_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())['where']('state\x20=\x204'))[_0xac4a('0x7e')](_0xac4a('0x6d')))['toString']();return db[_0xac4a('0x4f')][_0xac4a('0x31')](_0x1f3f1c);}return[];})[_0xac4a('0x24')](respondWithResult(_0x4447b5,null))[_0xac4a('0x44')](handleError(_0x4447b5,null));};exports[_0xac4a('0x86')]=function(_0x34787c,_0x599775,_0xbdff4b){return db[_0xac4a('0x87')][_0xac4a('0x88')]({'where':{'VoiceQueueId':_0x34787c['body'][_0xac4a('0x69')],'CampaignId':_0x34787c[_0xac4a('0x4c')][_0xac4a('0x81')],'ContactId':_0x34787c[_0xac4a('0x4c')][_0xac4a('0x6d')]}})[_0xac4a('0x24')](handleEntityNotFound(_0x599775,null))['then'](function(_0xe84bf7){if(_0xe84bf7){return _0xe84bf7;}return null;})[_0xac4a('0x24')](respondWithResult(_0x599775,null))['catch'](handleError(_0x599775,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index ce7f4bb..a71b9c6 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 _0x8a62=['cm_hopper_final','calleridnum','uniqueid','lodash','moment','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal'];(function(_0x2f2027,_0x49c44a){var _0x1bea0a=function(_0x2a2c9c){while(--_0x2a2c9c){_0x2f2027['push'](_0x2f2027['shift']());}};_0x1bea0a(++_0x49c44a);}(_0x8a62,0x15f));var _0x28a6=function(_0x1375b0,_0x2c117d){_0x1375b0=_0x1375b0-0x0;var _0x2c8409=_0x8a62[_0x1375b0];return _0x2c8409;};'use strict';var _=require(_0x28a6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x28a6('0x1'));var BPromise=require('bluebird');var rp=require(_0x28a6('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x28a6('0x3'));var config=require(_0x28a6('0x4'));var attributes=require(_0x28a6('0x5'));module[_0x28a6('0x6')]=function(_0x2fa73f,_0x4fe49a){return _0x2fa73f[_0x28a6('0x7')](_0x28a6('0x8'),attributes,{'tableName':_0x28a6('0x9'),'paranoid':![],'indexes':[{'name':_0x28a6('0xa'),'fields':[_0x28a6('0xa')]},{'name':'uniqueid','fields':[_0x28a6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f5b=['util','../../config/logger','api','bluebird','rimraf','./cmHopperFinal.attributes','define','CmHopperFinal','calleridnum'];(function(_0x16eaa6,_0x363449){var _0x3695fa=function(_0x115b36){while(--_0x115b36){_0x16eaa6['push'](_0x16eaa6['shift']());}};_0x3695fa(++_0x363449);}(_0x6f5b,0x19e));var _0xb6f5=function(_0x4cfc35,_0xb52690){_0x4cfc35=_0x4cfc35-0x0;var _0x43a384=_0x6f5b[_0x4cfc35];return _0x43a384;};'use strict';var _=require('lodash');var util=require(_0xb6f5('0x0'));var logger=require(_0xb6f5('0x1'))(_0xb6f5('0x2'));var moment=require('moment');var BPromise=require(_0xb6f5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb6f5('0x4'));var config=require('../../config/environment');var attributes=require(_0xb6f5('0x5'));module['exports']=function(_0x1fcc22,_0x394222){return _0x1fcc22[_0xb6f5('0x6')](_0xb6f5('0x7'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xb6f5('0x8'),'fields':[_0xb6f5('0x8')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 5b6fcfc..9ce2855 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(_0x3de5f5,_0x1a7582){var _0x27b7f=function(_0x57846a){while(--_0x57846a){_0x3de5f5['push'](_0x3de5f5['shift']());}};_0x27b7f(++_0x1a7582);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c84a6,_0x321f95){_0x5c84a6=_0x5c84a6-0x0;var _0xb8c5f0=_0xb10b[_0x5c84a6];return _0xb8c5f0;};'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 _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(_0x51b339,_0x55597e){var _0xa86b32=function(_0x41f457){while(--_0x41f457){_0x51b339['push'](_0x51b339['shift']());}};_0xa86b32(++_0x55597e);}(_0xb10b,0x12a));var _0xbb10=function(_0x31eb98,_0x592fa2){_0x31eb98=_0x31eb98-0x0;var _0x20cf3e=_0xb10b[_0x31eb98];return _0x20cf3e;};'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 diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 85d0034..19233b1 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 _0xd386=['/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','get'];(function(_0x5c4ba1,_0x594e45){var _0x1c507d=function(_0x460b72){while(--_0x460b72){_0x5c4ba1['push'](_0x5c4ba1['shift']());}};_0x1c507d(++_0x594e45);}(_0xd386,0x10c));var _0x6d38=function(_0x5921c7,_0x4b5384){_0x5921c7=_0x5921c7-0x0;var _0x6405e9=_0xd386[_0x5921c7];return _0x6405e9;};'use strict';var multer=require(_0x6d38('0x0'));var util=require(_0x6d38('0x1'));var path=require(_0x6d38('0x2'));var timeout=require('connect-timeout');var express=require(_0x6d38('0x3'));var router=express[_0x6d38('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6d38('0x5'));var interaction=require(_0x6d38('0x6'));var config=require(_0x6d38('0x7'));var controller=require(_0x6d38('0x8'));router['get']('/',auth[_0x6d38('0x9')](),controller[_0x6d38('0xa')]);router[_0x6d38('0xb')](_0x6d38('0xc'),auth[_0x6d38('0x9')](),controller[_0x6d38('0xd')]);router['get'](_0x6d38('0xe'),auth['isAuthenticated'](),controller[_0x6d38('0xf')]);router['get'](_0x6d38('0x10'),auth[_0x6d38('0x9')](),controller[_0x6d38('0x11')]);router['get'](_0x6d38('0x12'),auth[_0x6d38('0x9')](),controller[_0x6d38('0x13')]);router['post']('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller[_0x6d38('0x14')]);router[_0x6d38('0x15')](_0x6d38('0x16'),auth[_0x6d38('0x9')](),controller[_0x6d38('0x17')]);router['post'](_0x6d38('0x18'),auth[_0x6d38('0x9')](),controller[_0x6d38('0x19')]);router[_0x6d38('0x1a')](_0x6d38('0xe'),auth[_0x6d38('0x9')](),controller[_0x6d38('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xade9=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','exports','multer'];(function(_0x3c13f0,_0x71a1d0){var _0x336364=function(_0x56c307){while(--_0x56c307){_0x3c13f0['push'](_0x3c13f0['shift']());}};_0x336364(++_0x71a1d0);}(_0xade9,0x194));var _0x9ade=function(_0x2d2a9b,_0x5870ff){_0x2d2a9b=_0x2d2a9b-0x0;var _0x3d2d49=_0xade9[_0x2d2a9b];return _0x3d2d49;};'use strict';var multer=require(_0x9ade('0x0'));var util=require(_0x9ade('0x1'));var path=require(_0x9ade('0x2'));var timeout=require('connect-timeout');var express=require(_0x9ade('0x3'));var router=express[_0x9ade('0x4')]();var fs_extra=require(_0x9ade('0x5'));var auth=require(_0x9ade('0x6'));var interaction=require(_0x9ade('0x7'));var config=require(_0x9ade('0x8'));var controller=require(_0x9ade('0x9'));router[_0x9ade('0xa')]('/',auth[_0x9ade('0xb')](),controller[_0x9ade('0xc')]);router['get'](_0x9ade('0xd'),auth[_0x9ade('0xb')](),controller[_0x9ade('0xe')]);router[_0x9ade('0xa')](_0x9ade('0xf'),auth[_0x9ade('0xb')](),controller[_0x9ade('0x10')]);router[_0x9ade('0xa')](_0x9ade('0x11'),auth[_0x9ade('0xb')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x9ade('0xa')]('/campaign/countAttributes/:id',auth[_0x9ade('0xb')](),controller[_0x9ade('0x12')]);router['post'](_0x9ade('0x13'),auth[_0x9ade('0xb')](),controller[_0x9ade('0x14')]);router[_0x9ade('0x15')](_0x9ade('0x16'),auth[_0x9ade('0xb')](),controller[_0x9ade('0x17')]);router['post']('/checkContactHopper',auth[_0x9ade('0xb')](),controller[_0x9ade('0x18')]);router[_0x9ade('0x19')]('/:id',auth['isAuthenticated'](),controller['update']);module[_0x9ade('0x1a')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 1a2f899..319b944 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 _0xcc85=['INTEGER','STRING','DATE','BOOLEAN','exports'];(function(_0x524086,_0x941f3f){var _0x552337=function(_0x55b99d){while(--_0x55b99d){_0x524086['push'](_0x524086['shift']());}};_0x552337(++_0x941f3f);}(_0xcc85,0xcc));var _0x5cc8=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0xcc85[_0xbeb808];return _0x5d6909;};'use strict';var Sequelize=require('sequelize');module[_0x5cc8('0x0')]={'state':{'type':Sequelize[_0x5cc8('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x5cc8('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x5cc8('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5cc8('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5cc8('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x5cc8('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5cc8('0x2')]},'calleridname':{'type':Sequelize[_0x5cc8('0x2')]},'starttime':{'type':Sequelize[_0x5cc8('0x3')]},'responsetime':{'type':Sequelize[_0x5cc8('0x3')]},'answertime':{'type':Sequelize[_0x5cc8('0x3')]},'droptime':{'type':Sequelize[_0x5cc8('0x3')]},'endtime':{'type':Sequelize[_0x5cc8('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5cc8('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5cc8('0x2')]},'campaign':{'type':Sequelize[_0x5cc8('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5cc8('0x2')]},'reason':{'type':Sequelize[_0x5cc8('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x5cc8('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5cc8('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5cc8('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5cc8('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5cc8('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5cc8('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd532=['STRING','DATE','BOOLEAN','sequelize','INTEGER'];(function(_0x40f92b,_0x4dfb19){var _0x37b48b=function(_0x13826f){while(--_0x13826f){_0x40f92b['push'](_0x40f92b['shift']());}};_0x37b48b(++_0x4dfb19);}(_0xd532,0x14d));var _0x2d53=function(_0x50868a,_0x38582d){_0x50868a=_0x50868a-0x0;var _0x546d89=_0xd532[_0x50868a];return _0x546d89;};'use strict';var Sequelize=require(_0x2d53('0x0'));module['exports']={'state':{'type':Sequelize[_0x2d53('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x2d53('0x2')]},'scheduledat':{'type':Sequelize[_0x2d53('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2d53('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2d53('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x2d53('0x2')]},'originatecalleridname':{'type':Sequelize[_0x2d53('0x2')]},'calleridnum':{'type':Sequelize[_0x2d53('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x2d53('0x3')]},'responsetime':{'type':Sequelize[_0x2d53('0x3')]},'answertime':{'type':Sequelize[_0x2d53('0x3')]},'droptime':{'type':Sequelize[_0x2d53('0x3')]},'endtime':{'type':Sequelize[_0x2d53('0x3')]},'ringtime':{'type':Sequelize[_0x2d53('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2d53('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2d53('0x2')]},'campaign':{'type':Sequelize[_0x2d53('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x2d53('0x2')]},'reason':{'type':Sequelize[_0x2d53('0x2')]},'amd':{'type':Sequelize[_0x2d53('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x2d53('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x2d53('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2d53('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2d53('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x2d53('0x3')]},'edited':{'type':Sequelize[_0x2d53('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x2d53('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2d53('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2d53('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2d53('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2d53('0x1')],'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 86f8b5a..f4dc338 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 _0x0edd=['fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','keys','find','catch','create','body','uniqueid','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','save','update','then','sendStatus','stack','name','send','index','map','CmHopperHistory'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x0edd,0xab));var _0xd0ed=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0edd[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0xd0ed('0x0'));var rimraf=require(_0xd0ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd0ed('0x2'));var rp=require(_0xd0ed('0x3'));var moment=require(_0xd0ed('0x4'));var BPromise=require(_0xd0ed('0x5'));var Mustache=require('mustache');var util=require(_0xd0ed('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd0ed('0x7'));var fs=require('fs');var fs_extra=require(_0xd0ed('0x8'));var _=require(_0xd0ed('0x9'));var squel=require(_0xd0ed('0xa'));var crypto=require(_0xd0ed('0xb'));var jsforce=require(_0xd0ed('0xc'));var deskjs=require(_0xd0ed('0xd'));var toCsv=require(_0xd0ed('0xe'));var querystring=require(_0xd0ed('0xf'));var Papa=require('papaparse');var Redis=require(_0xd0ed('0x10'));var authService=require(_0xd0ed('0x11'));var qs=require(_0xd0ed('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0ed('0x13'));var logger=require(_0xd0ed('0x14'))(_0xd0ed('0x15'));var utils=require('../../config/utils');var config=require(_0xd0ed('0x16'));var licenseUtil=require(_0xd0ed('0x17'));var db=require(_0xd0ed('0x18'))['db'];function respondWithStatusCode(_0x4a7fc4,_0x33fe42){_0x33fe42=_0x33fe42||0xcc;return function(_0x17996f){if(_0x17996f){return _0x4a7fc4['sendStatus'](_0x33fe42);}return _0x4a7fc4[_0xd0ed('0x19')](_0x33fe42)[_0xd0ed('0x1a')]();};}function respondWithResult(_0x532f5d,_0x14ba08){_0x14ba08=_0x14ba08||0xc8;return function(_0x52592e){if(_0x52592e){return _0x532f5d['status'](_0x14ba08)[_0xd0ed('0x1b')](_0x52592e);}};}function respondWithFilteredResult(_0x26ab19,_0xc10512){return function(_0x44c2ef){if(_0x44c2ef){var _0x51145c=typeof _0xc10512[_0xd0ed('0x1c')]===_0xd0ed('0x1d')&&typeof _0xc10512[_0xd0ed('0x1e')]===_0xd0ed('0x1d');var _0x59f588=_0x44c2ef[_0xd0ed('0x1f')];var _0x6580af=_0x51145c?0x0:_0xc10512['offset'];var _0x214417=_0x51145c?_0x44c2ef['count']:_0xc10512[_0xd0ed('0x1c')]+_0xc10512[_0xd0ed('0x1e')];var _0x4ca9d7;if(_0x214417>=_0x59f588){_0x214417=_0x59f588;_0x4ca9d7=0xc8;}else{_0x4ca9d7=0xce;}_0x26ab19['status'](_0x4ca9d7);return _0x26ab19['set']('Content-Range',_0x6580af+'-'+_0x214417+'/'+_0x59f588)[_0xd0ed('0x1b')](_0x44c2ef);}return null;};}function patchUpdates(_0x323a18){return function(_0x3d0667){try{jsonpatch['apply'](_0x3d0667,_0x323a18,!![]);}catch(_0x235aa1){return BPromise['reject'](_0x235aa1);}return _0x3d0667[_0xd0ed('0x20')]();};}function saveUpdates(_0x3c527f,_0x11dd4f){return function(_0x36785d){if(_0x36785d){return _0x36785d[_0xd0ed('0x21')](_0x3c527f)[_0xd0ed('0x22')](function(_0x5ce8d4){return _0x5ce8d4;});}return null;};}function removeEntity(_0x554b45,_0x11ffaf){return function(_0x5255ec){if(_0x5255ec){return _0x5255ec['destroy']()[_0xd0ed('0x22')](function(){_0x554b45[_0xd0ed('0x19')](0xcc)[_0xd0ed('0x1a')]();});}};}function handleEntityNotFound(_0x2ef374,_0x13f917){return function(_0x653b91){if(!_0x653b91){_0x2ef374[_0xd0ed('0x23')](0x194);}return _0x653b91;};}function handleError(_0x17fcb3,_0x55a53e){_0x55a53e=_0x55a53e||0x1f4;return function(_0x183012){logger['error'](_0x183012[_0xd0ed('0x24')]);if(_0x183012[_0xd0ed('0x25')]){delete _0x183012[_0xd0ed('0x25')];}_0x17fcb3[_0xd0ed('0x19')](_0x55a53e)[_0xd0ed('0x26')](_0x183012);};}exports[_0xd0ed('0x27')]=function(_0x2a5733,_0x10e7b0){var _0x51e1a1={},_0x4c7c43={},_0x187bb8={'count':0x0,'rows':[]};var _0x4e22e5=_[_0xd0ed('0x28')](db[_0xd0ed('0x29')]['rawAttributes'],function(_0x380d24){return{'name':_0x380d24[_0xd0ed('0x2a')],'type':_0x380d24[_0xd0ed('0x2b')]['key']};});_0x4c7c43[_0xd0ed('0x2c')]=_[_0xd0ed('0x28')](_0x4e22e5,_0xd0ed('0x25'));_0x4c7c43[_0xd0ed('0x2d')]=_['keys'](_0x2a5733['query']);_0x4c7c43[_0xd0ed('0x2e')]=_['intersection'](_0x4c7c43['model'],_0x4c7c43[_0xd0ed('0x2d')]);_0x51e1a1['attributes']=_[_0xd0ed('0x2f')](_0x4c7c43['model'],qs[_0xd0ed('0x30')](_0x2a5733[_0xd0ed('0x2d')]['fields']));_0x51e1a1[_0xd0ed('0x31')]=_0x51e1a1[_0xd0ed('0x31')][_0xd0ed('0x32')]?_0x51e1a1[_0xd0ed('0x31')]:_0x4c7c43['model'];if(!_0x2a5733[_0xd0ed('0x2d')][_0xd0ed('0x33')](_0xd0ed('0x34'))){_0x51e1a1[_0xd0ed('0x1e')]=qs[_0xd0ed('0x1e')](_0x2a5733[_0xd0ed('0x2d')][_0xd0ed('0x1e')]);_0x51e1a1[_0xd0ed('0x1c')]=qs[_0xd0ed('0x1c')](_0x2a5733[_0xd0ed('0x2d')][_0xd0ed('0x1c')]);}_0x51e1a1[_0xd0ed('0x35')]=qs[_0xd0ed('0x36')](_0x2a5733[_0xd0ed('0x2d')]['sort']);_0x51e1a1[_0xd0ed('0x37')]=qs['filters'](_[_0xd0ed('0x38')](_0x2a5733[_0xd0ed('0x2d')],_0x4c7c43[_0xd0ed('0x2e')]),_0x4e22e5);if(_0x2a5733['query'][_0xd0ed('0x39')]){_0x51e1a1[_0xd0ed('0x37')]=_['merge'](_0x51e1a1[_0xd0ed('0x37')],{'$or':_[_0xd0ed('0x28')](_0x4e22e5,function(_0x529a49){if(_0x529a49['type']!==_0xd0ed('0x3a')){var _0x33c0c7={};_0x33c0c7[_0x529a49['name']]={'$like':'%'+_0x2a5733['query'][_0xd0ed('0x39')]+'%'};return _0x33c0c7;}})});}_0x51e1a1=_[_0xd0ed('0x3b')]({},_0x51e1a1,_0x2a5733[_0xd0ed('0x3c')]);var _0x37b047={'where':_0x51e1a1[_0xd0ed('0x37')]};return db[_0xd0ed('0x29')][_0xd0ed('0x1f')](_0x37b047)[_0xd0ed('0x22')](function(_0x5b5e63){_0x187bb8[_0xd0ed('0x1f')]=_0x5b5e63;if(_0x2a5733['query'][_0xd0ed('0x3d')]){_0x51e1a1['include']=[{'all':!![]}];}return db[_0xd0ed('0x29')][_0xd0ed('0x3e')](_0x51e1a1);})['then'](function(_0x2dcdb7){_0x187bb8[_0xd0ed('0x3f')]=_0x2dcdb7;return _0x187bb8;})[_0xd0ed('0x22')](respondWithFilteredResult(_0x10e7b0,_0x51e1a1))['catch'](handleError(_0x10e7b0,null));};exports[_0xd0ed('0x40')]=function(_0x17cfcd,_0x22fe95){var _0x75b1e8={'raw':!![],'where':{'id':_0x17cfcd['params']['id']}},_0x594e18={};_0x594e18[_0xd0ed('0x2c')]=_[_0xd0ed('0x41')](db[_0xd0ed('0x29')]['rawAttributes']);_0x594e18[_0xd0ed('0x2d')]=_[_0xd0ed('0x41')](_0x17cfcd[_0xd0ed('0x2d')]);_0x594e18['filters']=_[_0xd0ed('0x2f')](_0x594e18[_0xd0ed('0x2c')],_0x594e18['query']);_0x75b1e8[_0xd0ed('0x31')]=_[_0xd0ed('0x2f')](_0x594e18['model'],qs[_0xd0ed('0x30')](_0x17cfcd[_0xd0ed('0x2d')][_0xd0ed('0x30')]));_0x75b1e8['attributes']=_0x75b1e8[_0xd0ed('0x31')][_0xd0ed('0x32')]?_0x75b1e8[_0xd0ed('0x31')]:_0x594e18[_0xd0ed('0x2c')];if(_0x17cfcd[_0xd0ed('0x2d')][_0xd0ed('0x3d')]){_0x75b1e8['include']=[{'all':!![]}];}_0x75b1e8=_['merge']({},_0x75b1e8,_0x17cfcd['options']);return db[_0xd0ed('0x29')][_0xd0ed('0x42')](_0x75b1e8)['then'](handleEntityNotFound(_0x22fe95,null))['then'](respondWithResult(_0x22fe95,null))[_0xd0ed('0x43')](handleError(_0x22fe95,null));};exports[_0xd0ed('0x44')]=function(_0x26546b,_0x3261c5){return db['CmHopperHistory'][_0xd0ed('0x44')](_0x26546b[_0xd0ed('0x45')],{})[_0xd0ed('0x22')](respondWithResult(_0x3261c5,0xc9))[_0xd0ed('0x43')](handleError(_0x3261c5,null));};exports['describe']=function(_0x5f744b,_0x410d75){return db[_0xd0ed('0x29')]['describe']()[_0xd0ed('0x22')](respondWithResult(_0x410d75,null))['catch'](handleError(_0x410d75,null));};exports[_0xd0ed('0x21')]=function(_0x3fb899,_0x1eab4f){if(_0x3fb899[_0xd0ed('0x45')][_0xd0ed('0x46')]){delete _0x3fb899[_0xd0ed('0x45')][_0xd0ed('0x46')];}return db[_0xd0ed('0x29')]['find']({'where':{'uniqueid':_0x3fb899['params']['id']}})[_0xd0ed('0x22')](handleEntityNotFound(_0x1eab4f,null))[_0xd0ed('0x22')](saveUpdates(_0x3fb899[_0xd0ed('0x45')],null))[_0xd0ed('0x22')](respondWithResult(_0x1eab4f,null))[_0xd0ed('0x43')](handleError(_0x1eab4f,null));}; \ No newline at end of file +var _0x566a=['Content-Range','reject','save','destroy','error','name','send','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','pick','merge','where','VIRTUAL','filter','options','then','includeAll','rows','catch','show','length','find','create','body','describe','update','uniqueid','params','eml-format','fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','offset','count','set'];(function(_0x38325,_0x262d3c){var _0x2994d6=function(_0x48af6e){while(--_0x48af6e){_0x38325['push'](_0x38325['shift']());}};_0x2994d6(++_0x262d3c);}(_0x566a,0xf5));var _0xa566=function(_0x10637c,_0x47ec3e){_0x10637c=_0x10637c-0x0;var _0x3a1329=_0x566a[_0x10637c];return _0x3a1329;};'use strict';var emlformat=require(_0xa566('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa566('0x1'));var rp=require('request-promise');var moment=require(_0xa566('0x2'));var BPromise=require(_0xa566('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa566('0x4'));var sox=require(_0xa566('0x5'));var csv=require(_0xa566('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa566('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa566('0x8'));var jsforce=require(_0xa566('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa566('0xa'));var authService=require(_0xa566('0xb'));var qs=require(_0xa566('0xc'));var as=require(_0xa566('0xd'));var hardwareService=require(_0xa566('0xe'));var logger=require('../../config/logger')(_0xa566('0xf'));var utils=require(_0xa566('0x10'));var config=require(_0xa566('0x11'));var licenseUtil=require(_0xa566('0x12'));var db=require(_0xa566('0x13'))['db'];function respondWithStatusCode(_0x1769ae,_0x2e45f1){_0x2e45f1=_0x2e45f1||0xcc;return function(_0xef4134){if(_0xef4134){return _0x1769ae['sendStatus'](_0x2e45f1);}return _0x1769ae[_0xa566('0x14')](_0x2e45f1)[_0xa566('0x15')]();};}function respondWithResult(_0x1e1c9b,_0x16da33){_0x16da33=_0x16da33||0xc8;return function(_0xc00e0e){if(_0xc00e0e){return _0x1e1c9b['status'](_0x16da33)['json'](_0xc00e0e);}};}function respondWithFilteredResult(_0x32a3a6,_0x2534e2){return function(_0x21d7ee){if(_0x21d7ee){var _0x231130=typeof _0x2534e2['offset']===_0xa566('0x16')&&typeof _0x2534e2[_0xa566('0x17')]===_0xa566('0x16');var _0x375f07=_0x21d7ee['count'];var _0x1ffce6=_0x231130?0x0:_0x2534e2[_0xa566('0x18')];var _0x349efb=_0x231130?_0x21d7ee[_0xa566('0x19')]:_0x2534e2[_0xa566('0x18')]+_0x2534e2[_0xa566('0x17')];var _0x3b5420;if(_0x349efb>=_0x375f07){_0x349efb=_0x375f07;_0x3b5420=0xc8;}else{_0x3b5420=0xce;}_0x32a3a6['status'](_0x3b5420);return _0x32a3a6[_0xa566('0x1a')](_0xa566('0x1b'),_0x1ffce6+'-'+_0x349efb+'/'+_0x375f07)['json'](_0x21d7ee);}return null;};}function patchUpdates(_0x2038d3){return function(_0x4a3717){try{jsonpatch['apply'](_0x4a3717,_0x2038d3,!![]);}catch(_0x37ca97){return BPromise[_0xa566('0x1c')](_0x37ca97);}return _0x4a3717[_0xa566('0x1d')]();};}function saveUpdates(_0x3a8343,_0x880ae9){return function(_0x3a0dd1){if(_0x3a0dd1){return _0x3a0dd1['update'](_0x3a8343)['then'](function(_0x5a3325){return _0x5a3325;});}return null;};}function removeEntity(_0x4ffc03,_0x4d4086){return function(_0x8c8877){if(_0x8c8877){return _0x8c8877[_0xa566('0x1e')]()['then'](function(){_0x4ffc03[_0xa566('0x14')](0xcc)[_0xa566('0x15')]();});}};}function handleEntityNotFound(_0x40297b,_0x20ee28){return function(_0x3d1d7e){if(!_0x3d1d7e){_0x40297b['sendStatus'](0x194);}return _0x3d1d7e;};}function handleError(_0x39ed7b,_0x29f71c){_0x29f71c=_0x29f71c||0x1f4;return function(_0x34935d){logger[_0xa566('0x1f')](_0x34935d['stack']);if(_0x34935d[_0xa566('0x20')]){delete _0x34935d[_0xa566('0x20')];}_0x39ed7b[_0xa566('0x14')](_0x29f71c)[_0xa566('0x21')](_0x34935d);};}exports['index']=function(_0x12a661,_0x12e434){var _0x223539={},_0x236e0a={},_0x4a19b8={'count':0x0,'rows':[]};var _0x1a314e=_[_0xa566('0x22')](db[_0xa566('0x23')][_0xa566('0x24')],function(_0x2305a3){return{'name':_0x2305a3[_0xa566('0x25')],'type':_0x2305a3[_0xa566('0x26')][_0xa566('0x27')]};});_0x236e0a[_0xa566('0x28')]=_[_0xa566('0x22')](_0x1a314e,_0xa566('0x20'));_0x236e0a[_0xa566('0x29')]=_[_0xa566('0x2a')](_0x12a661[_0xa566('0x29')]);_0x236e0a[_0xa566('0x2b')]=_[_0xa566('0x2c')](_0x236e0a[_0xa566('0x28')],_0x236e0a[_0xa566('0x29')]);_0x223539[_0xa566('0x2d')]=_[_0xa566('0x2c')](_0x236e0a[_0xa566('0x28')],qs['fields'](_0x12a661['query'][_0xa566('0x2e')]));_0x223539['attributes']=_0x223539['attributes']['length']?_0x223539[_0xa566('0x2d')]:_0x236e0a[_0xa566('0x28')];if(!_0x12a661[_0xa566('0x29')]['hasOwnProperty'](_0xa566('0x2f'))){_0x223539['limit']=qs[_0xa566('0x17')](_0x12a661[_0xa566('0x29')][_0xa566('0x17')]);_0x223539[_0xa566('0x18')]=qs[_0xa566('0x18')](_0x12a661[_0xa566('0x29')][_0xa566('0x18')]);}_0x223539[_0xa566('0x30')]=qs['sort'](_0x12a661[_0xa566('0x29')]['sort']);_0x223539['where']=qs[_0xa566('0x2b')](_[_0xa566('0x31')](_0x12a661[_0xa566('0x29')],_0x236e0a['filters']),_0x1a314e);if(_0x12a661[_0xa566('0x29')]['filter']){_0x223539['where']=_[_0xa566('0x32')](_0x223539[_0xa566('0x33')],{'$or':_[_0xa566('0x22')](_0x1a314e,function(_0x5c0e89){if(_0x5c0e89[_0xa566('0x26')]!==_0xa566('0x34')){var _0xddbaa3={};_0xddbaa3[_0x5c0e89['name']]={'$like':'%'+_0x12a661[_0xa566('0x29')][_0xa566('0x35')]+'%'};return _0xddbaa3;}})});}_0x223539=_['merge']({},_0x223539,_0x12a661[_0xa566('0x36')]);var _0x50e766={'where':_0x223539['where']};return db['CmHopperHistory'][_0xa566('0x19')](_0x50e766)[_0xa566('0x37')](function(_0xcc157b){_0x4a19b8[_0xa566('0x19')]=_0xcc157b;if(_0x12a661['query'][_0xa566('0x38')]){_0x223539['include']=[{'all':!![]}];}return db[_0xa566('0x23')]['findAll'](_0x223539);})[_0xa566('0x37')](function(_0x10df7a){_0x4a19b8[_0xa566('0x39')]=_0x10df7a;return _0x4a19b8;})['then'](respondWithFilteredResult(_0x12e434,_0x223539))[_0xa566('0x3a')](handleError(_0x12e434,null));};exports[_0xa566('0x3b')]=function(_0x3d10d9,_0x26855e){var _0x2ee8a5={'raw':!![],'where':{'id':_0x3d10d9['params']['id']}},_0x3eb65b={};_0x3eb65b[_0xa566('0x28')]=_[_0xa566('0x2a')](db['CmHopperHistory']['rawAttributes']);_0x3eb65b[_0xa566('0x29')]=_[_0xa566('0x2a')](_0x3d10d9['query']);_0x3eb65b[_0xa566('0x2b')]=_[_0xa566('0x2c')](_0x3eb65b['model'],_0x3eb65b[_0xa566('0x29')]);_0x2ee8a5[_0xa566('0x2d')]=_[_0xa566('0x2c')](_0x3eb65b[_0xa566('0x28')],qs[_0xa566('0x2e')](_0x3d10d9[_0xa566('0x29')]['fields']));_0x2ee8a5[_0xa566('0x2d')]=_0x2ee8a5['attributes'][_0xa566('0x3c')]?_0x2ee8a5[_0xa566('0x2d')]:_0x3eb65b[_0xa566('0x28')];if(_0x3d10d9['query']['includeAll']){_0x2ee8a5['include']=[{'all':!![]}];}_0x2ee8a5=_[_0xa566('0x32')]({},_0x2ee8a5,_0x3d10d9[_0xa566('0x36')]);return db[_0xa566('0x23')][_0xa566('0x3d')](_0x2ee8a5)['then'](handleEntityNotFound(_0x26855e,null))[_0xa566('0x37')](respondWithResult(_0x26855e,null))[_0xa566('0x3a')](handleError(_0x26855e,null));};exports[_0xa566('0x3e')]=function(_0xdda13a,_0x29faf7){return db[_0xa566('0x23')]['create'](_0xdda13a[_0xa566('0x3f')],{})[_0xa566('0x37')](respondWithResult(_0x29faf7,0xc9))[_0xa566('0x3a')](handleError(_0x29faf7,null));};exports[_0xa566('0x40')]=function(_0x42ad62,_0x102fe9){return db[_0xa566('0x23')][_0xa566('0x40')]()['then'](respondWithResult(_0x102fe9,null))[_0xa566('0x3a')](handleError(_0x102fe9,null));};exports[_0xa566('0x41')]=function(_0x14c384,_0x4818d4){if(_0x14c384['body'][_0xa566('0x42')]){delete _0x14c384[_0xa566('0x3f')][_0xa566('0x42')];}return db['CmHopperHistory'][_0xa566('0x3d')]({'where':{'uniqueid':_0x14c384[_0xa566('0x43')]['id']}})[_0xa566('0x37')](handleEntityNotFound(_0x4818d4,null))[_0xa566('0x37')](saveUpdates(_0x14c384[_0xa566('0x3f')],null))[_0xa566('0x37')](respondWithResult(_0x4818d4,null))[_0xa566('0x3a')](handleError(_0x4818d4,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index bf2ec99..3cad21b 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 _0xfc4f=['bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','uniqueid','util','../../config/logger','api','moment'];(function(_0x1b342d,_0x594452){var _0x25a0f0=function(_0x3568ba){while(--_0x3568ba){_0x1b342d['push'](_0x1b342d['shift']());}};_0x25a0f0(++_0x594452);}(_0xfc4f,0x192));var _0xffc4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfc4f[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xffc4('0x0'));var logger=require(_0xffc4('0x1'))(_0xffc4('0x2'));var moment=require(_0xffc4('0x3'));var BPromise=require(_0xffc4('0x4'));var rp=require(_0xffc4('0x5'));var fs=require('fs');var path=require(_0xffc4('0x6'));var rimraf=require('rimraf');var config=require(_0xffc4('0x7'));var attributes=require(_0xffc4('0x8'));module[_0xffc4('0x9')]=function(_0x2efa5f,_0x4cd469){return _0x2efa5f[_0xffc4('0xa')](_0xffc4('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xffc4('0xc'),'fields':[_0xffc4('0xc')]},{'name':_0xffc4('0xd'),'fields':[_0xffc4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1f81=['cm_hopper_history','endtime','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory'];(function(_0x1261f8,_0x162674){var _0x3a4de9=function(_0x5bbb54){while(--_0x5bbb54){_0x1261f8['push'](_0x1261f8['shift']());}};_0x3a4de9(++_0x162674);}(_0x1f81,0xab));var _0x11f8=function(_0x5e7514,_0x30c2e1){_0x5e7514=_0x5e7514-0x0;var _0x12f472=_0x1f81[_0x5e7514];return _0x12f472;};'use strict';var _=require(_0x11f8('0x0'));var util=require(_0x11f8('0x1'));var logger=require('../../config/logger')(_0x11f8('0x2'));var moment=require(_0x11f8('0x3'));var BPromise=require('bluebird');var rp=require(_0x11f8('0x4'));var fs=require('fs');var path=require(_0x11f8('0x5'));var rimraf=require(_0x11f8('0x6'));var config=require(_0x11f8('0x7'));var attributes=require(_0x11f8('0x8'));module[_0x11f8('0x9')]=function(_0x1a16e9,_0xe63071){return _0x1a16e9['define'](_0x11f8('0xa'),attributes,{'tableName':_0x11f8('0xb'),'paranoid':![],'indexes':[{'name':_0x11f8('0xc'),'fields':[_0x11f8('0xc')]},{'name':_0x11f8('0xd'),'fields':[_0x11f8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 3d0aa36..772911b 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 _0xc547=['`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','findAll','ivrTotalCallsDays','`state`\x20=\x204,\x201,\x20null','ivrAnswerCallsDay','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','CmHopperHistory,\x20%s,\x20%s','message','CreateCmHopperHistory','create','options','raw','catch','AvgHandleTime','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','stringify','GetVoiceQueueHopperHistory','CmHopperHistory','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit'];(function(_0xa4ba02,_0x227f33){var _0x164a49=function(_0x21d485){while(--_0x21d485){_0xa4ba02['push'](_0xa4ba02['shift']());}};_0x164a49(++_0x227f33);}(_0xc547,0x153));var _0x7c54=function(_0x57ff54,_0x4bf283){_0x57ff54=_0x57ff54-0x0;var _0x3b00f5=_0xc547[_0x57ff54];return _0x3b00f5;};'use strict';var _=require('lodash');var util=require(_0x7c54('0x0'));var moment=require('moment');var BPromise=require(_0x7c54('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c54('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7c54('0x3'))(_0x7c54('0x4'));var config=require(_0x7c54('0x5'));var jayson=require(_0x7c54('0x6'));var client=jayson[_0x7c54('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c6674,_0x2f7af6,_0x47760f){return new BPromise(function(_0x1040f0,_0x28d46d){return client['request'](_0x4c6674,_0x47760f)[_0x7c54('0x8')](function(_0x5f392e){logger[_0x7c54('0x9')]('CmHopperHistory,\x20%s,\x20%s',_0x2f7af6,_0x7c54('0xa'));logger[_0x7c54('0xb')](_0x7c54('0xc'),_0x2f7af6,_0x7c54('0xa'),JSON['stringify'](_0x5f392e));if(_0x5f392e[_0x7c54('0xd')]){if(_0x5f392e[_0x7c54('0xd')]['code']===0x1f4){logger['error'](_0x7c54('0xe'),_0x2f7af6,_0x5f392e[_0x7c54('0xd')][_0x7c54('0xf')]);return _0x28d46d(_0x5f392e['error']['message']);}logger['error'](_0x7c54('0xe'),_0x2f7af6,_0x5f392e['error'][_0x7c54('0xf')]);return _0x1040f0(_0x5f392e['error'][_0x7c54('0xf')]);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x2f7af6,_0x7c54('0xa'));_0x1040f0(_0x5f392e['result'][_0x7c54('0xf')]);}})['catch'](function(_0x57bf21){logger[_0x7c54('0xd')](_0x7c54('0xe'),_0x2f7af6,_0x57bf21);_0x28d46d(_0x57bf21);});});}exports[_0x7c54('0x10')]=function(_0x44a7dc){var _0x2234d7=this;return new Promise(function(_0xed7452,_0x18a9c2){return db['CmHopperHistory'][_0x7c54('0x11')](_0x44a7dc['body'],{'raw':_0x44a7dc['options']?_0x44a7dc[_0x7c54('0x12')][_0x7c54('0x13')]===undefined?!![]:![]:!![]})[_0x7c54('0x8')](function(_0x70c03a){logger['info'](_0x7c54('0x10'),_0x44a7dc);logger['debug']('CreateCmHopperHistory',_0x44a7dc,JSON['stringify'](_0x70c03a));_0xed7452(_0x70c03a);})[_0x7c54('0x14')](function(_0x1270e6){logger[_0x7c54('0xd')]('CreateCmHopperHistory',_0x1270e6[_0x7c54('0xf')],_0x44a7dc);_0x18a9c2(_0x2234d7[_0x7c54('0xd')](0x1f4,_0x1270e6[_0x7c54('0xf')]));});});};exports[_0x7c54('0x15')]=function(_0x525eb9){var _0x55f5e2=this;return new Promise(function(_0x427941,_0x338e37){return db['CmHopperHistory']['findAll']({'raw':_0x525eb9['options']?_0x525eb9['options'][_0x7c54('0x13')]===undefined?!![]:![]:!![],'where':_0x525eb9['options']?_0x525eb9[_0x7c54('0x12')]['where']||null:null,'attributes':[[db[_0x7c54('0x16')]['fn']('COUNT',db[_0x7c54('0x16')][_0x7c54('0x17')]('id')),_0x7c54('0x18')],[db[_0x7c54('0x16')]['fn'](_0x7c54('0x19'),db[_0x7c54('0x16')]['fn']('IF',db[_0x7c54('0x16')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn'](_0x7c54('0x19'),db[_0x7c54('0x16')]['fn']('IF',db[_0x7c54('0x16')][_0x7c54('0x1a')](_0x7c54('0x1b')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x7c54('0x16')]['fn'](_0x7c54('0x19'),db[_0x7c54('0x16')]['fn']('IF',db[_0x7c54('0x16')][_0x7c54('0x1a')](_0x7c54('0x1c')))),_0x7c54('0x1d')],[db[_0x7c54('0x16')]['fn']('AVG',db[_0x7c54('0x16')]['fn']('IF',db[_0x7c54('0x16')][_0x7c54('0x1a')](_0x7c54('0x1e')))),_0x7c54('0x1f')],[db[_0x7c54('0x16')]['fn'](_0x7c54('0x20'),db['sequelize']['fn']('IF',db[_0x7c54('0x16')][_0x7c54('0x1a')](_0x7c54('0x21')))),_0x7c54('0x22')]]})['then'](function(_0x4acb3b){logger[_0x7c54('0x9')](_0x7c54('0x15'),_0x525eb9);logger[_0x7c54('0xb')](_0x7c54('0x15'),_0x525eb9,JSON[_0x7c54('0x23')](_0x4acb3b));_0x427941(_0x4acb3b);})['catch'](function(_0x1400c8){logger[_0x7c54('0xd')]('AvgHandleTime',_0x1400c8[_0x7c54('0xf')],_0x525eb9);_0x338e37(_0x55f5e2['error'](0x1f4,_0x1400c8[_0x7c54('0xf')]));});});};exports[_0x7c54('0x24')]=function(_0xd3962a){var _0x5dd395=this;return new Promise(function(_0x51007d,_0x3b429b){return db[_0x7c54('0x25')]['findAll']({'raw':_0xd3962a['options']?_0xd3962a[_0x7c54('0x12')][_0x7c54('0x13')]===undefined?!![]:![]:!![],'where':_0xd3962a['options']?_0xd3962a['options'][_0x7c54('0x26')]||null:null,'attributes':[[_0x7c54('0x27'),_0x7c54('0x28')],[db['sequelize']['fn'](_0x7c54('0x19'),db['sequelize']['fn']('IF',db[_0x7c54('0x16')][_0x7c54('0x1a')](_0x7c54('0x29')))),_0x7c54('0x2a')],[db[_0x7c54('0x16')]['fn'](_0x7c54('0x19'),db['sequelize']['fn']('IF',db[_0x7c54('0x16')][_0x7c54('0x1a')](_0x7c54('0x2b')))),_0x7c54('0x2c')],[db[_0x7c54('0x16')]['fn'](_0x7c54('0x19'),db[_0x7c54('0x16')]['fn']('IF',db[_0x7c54('0x16')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x7c54('0x2d')],[db['sequelize']['fn'](_0x7c54('0x19'),db[_0x7c54('0x16')]['fn']('IF',db['sequelize'][_0x7c54('0x1a')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0x7c54('0x16')]['fn']('COUNT',db[_0x7c54('0x16')]['fn']('IF',db[_0x7c54('0x16')][_0x7c54('0x1a')](_0x7c54('0x2e')))),_0x7c54('0x2f')],[db[_0x7c54('0x16')]['fn']('COUNT',db[_0x7c54('0x16')]['fn']('IF',db[_0x7c54('0x16')][_0x7c54('0x1a')](_0x7c54('0x30')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0x7c54('0x19'),db[_0x7c54('0x16')]['fn']('IF',db['sequelize'][_0x7c54('0x1a')](_0x7c54('0x31')))),_0x7c54('0x32')],[db[_0x7c54('0x16')]['fn'](_0x7c54('0x19'),db[_0x7c54('0x16')]['fn']('IF',db[_0x7c54('0x16')][_0x7c54('0x1a')]('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db[_0x7c54('0x16')]['fn'](_0x7c54('0x19'),db[_0x7c54('0x16')]['fn']('IF',db['sequelize'][_0x7c54('0x1a')](_0x7c54('0x33')))),'outboundBlacklistCallsDay'],[db[_0x7c54('0x16')]['fn'](_0x7c54('0x19'),db[_0x7c54('0x16')]['fn']('IF',db[_0x7c54('0x16')][_0x7c54('0x1a')](_0x7c54('0x34')))),_0x7c54('0x35')],[db[_0x7c54('0x16')]['fn'](_0x7c54('0x19'),db[_0x7c54('0x16')]['fn']('IF',db['sequelize']['literal'](_0x7c54('0x36')))),_0x7c54('0x37')],[db[_0x7c54('0x16')]['fn'](_0x7c54('0x19'),db[_0x7c54('0x16')]['fn']('IF',db[_0x7c54('0x16')]['literal'](_0x7c54('0x38')))),_0x7c54('0x39')],[db[_0x7c54('0x16')]['fn']('COUNT',db[_0x7c54('0x16')]['fn']('IF',db[_0x7c54('0x16')][_0x7c54('0x1a')](_0x7c54('0x3a')))),_0x7c54('0x37')],[db['sequelize']['fn'](_0x7c54('0x19'),db[_0x7c54('0x16')]['fn']('IF',db[_0x7c54('0x16')]['literal'](_0x7c54('0x3b')))),'outboundReCallsDay']],'group':[_0x7c54('0x27')]})[_0x7c54('0x8')](function(_0x301415){logger[_0x7c54('0x9')](_0x7c54('0x24'),_0xd3962a);logger[_0x7c54('0xb')](_0x7c54('0x24'),_0xd3962a,JSON['stringify'](_0x301415));_0x51007d(_0x301415);})['catch'](function(_0x394a10){logger[_0x7c54('0xd')](_0x7c54('0x24'),_0x394a10[_0x7c54('0xf')],_0xd3962a);_0x3b429b(_0x5dd395[_0x7c54('0xd')](0x1f4,_0x394a10[_0x7c54('0xf')]));});});};exports[_0x7c54('0x3c')]=function(_0x350635){var _0x5222da=this;return new Promise(function(_0x4e9f6c,_0x3bb952){return db[_0x7c54('0x25')][_0x7c54('0x3d')]({'raw':_0x350635['options']?_0x350635[_0x7c54('0x12')][_0x7c54('0x13')]===undefined?!![]:![]:!![],'where':_0x350635[_0x7c54('0x12')]?_0x350635[_0x7c54('0x12')][_0x7c54('0x26')]||null:null,'attributes':[['campaign',_0x7c54('0x28')],[db[_0x7c54('0x16')]['fn'](_0x7c54('0x19'),db[_0x7c54('0x16')]['col']('id')),_0x7c54('0x3e')],[db[_0x7c54('0x16')]['fn'](_0x7c54('0x19'),db[_0x7c54('0x16')]['fn']('IF',db[_0x7c54('0x16')][_0x7c54('0x1a')](_0x7c54('0x3f')))),_0x7c54('0x40')]],'group':[_0x7c54('0x27')]})['then'](function(_0x437ade){logger[_0x7c54('0x9')](_0x7c54('0x3c'),_0x350635);logger['debug'](_0x7c54('0x3c'),_0x350635,JSON[_0x7c54('0x23')](_0x437ade));_0x4e9f6c(_0x437ade);})[_0x7c54('0x14')](function(_0x2e973c){logger[_0x7c54('0xd')](_0x7c54('0x3c'),_0x2e973c['message'],_0x350635);_0x3bb952(_0x5222da[_0x7c54('0xd')](0x1f4,_0x2e973c[_0x7c54('0xf')]));});});}; \ No newline at end of file +var _0xd845=['outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','debug','AvgHandleTime','findAll','raw','where','COUNT','sequelize','col','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null'];(function(_0x40d5cc,_0xf9d2c7){var _0x6950af=function(_0x295221){while(--_0x295221){_0x40d5cc['push'](_0x40d5cc['shift']());}};_0x6950af(++_0xf9d2c7);}(_0xd845,0x135));var _0x5d84=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd845[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x5d84('0x0'));var util=require(_0x5d84('0x1'));var moment=require(_0x5d84('0x2'));var BPromise=require(_0x5d84('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d84('0x4'));var db=require(_0x5d84('0x5'))['db'];var utils=require(_0x5d84('0x6'));var logger=require(_0x5d84('0x7'))('rpc');var config=require(_0x5d84('0x8'));var jayson=require(_0x5d84('0x9'));var client=jayson[_0x5d84('0xa')][_0x5d84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1712cb,_0x3f0541,_0x537d0e){return new BPromise(function(_0x135c45,_0x493231){return client[_0x5d84('0xc')](_0x1712cb,_0x537d0e)[_0x5d84('0xd')](function(_0x579df0){logger[_0x5d84('0xe')](_0x5d84('0xf'),_0x3f0541,'request\x20sent');logger['debug'](_0x5d84('0x10'),_0x3f0541,_0x5d84('0x11'),JSON[_0x5d84('0x12')](_0x579df0));if(_0x579df0[_0x5d84('0x13')]){if(_0x579df0[_0x5d84('0x13')]['code']===0x1f4){logger[_0x5d84('0x13')](_0x5d84('0xf'),_0x3f0541,_0x579df0[_0x5d84('0x13')][_0x5d84('0x14')]);return _0x493231(_0x579df0[_0x5d84('0x13')][_0x5d84('0x14')]);}logger['error'](_0x5d84('0xf'),_0x3f0541,_0x579df0['error'][_0x5d84('0x14')]);return _0x135c45(_0x579df0[_0x5d84('0x13')][_0x5d84('0x14')]);}else{logger['info'](_0x5d84('0xf'),_0x3f0541,_0x5d84('0x11'));_0x135c45(_0x579df0[_0x5d84('0x15')][_0x5d84('0x14')]);}})[_0x5d84('0x16')](function(_0x4c4dc6){logger[_0x5d84('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x3f0541,_0x4c4dc6);_0x493231(_0x4c4dc6);});});}exports[_0x5d84('0x17')]=function(_0x59a6be){var _0x3b3f63=this;return new Promise(function(_0x2494cd,_0x2ba609){return db[_0x5d84('0x18')][_0x5d84('0x19')](_0x59a6be[_0x5d84('0x1a')],{'raw':_0x59a6be[_0x5d84('0x1b')]?_0x59a6be['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x254ac6){logger[_0x5d84('0xe')](_0x5d84('0x17'),_0x59a6be);logger[_0x5d84('0x1c')](_0x5d84('0x17'),_0x59a6be,JSON[_0x5d84('0x12')](_0x254ac6));_0x2494cd(_0x254ac6);})[_0x5d84('0x16')](function(_0x554d80){logger['error']('CreateCmHopperHistory',_0x554d80['message'],_0x59a6be);_0x2ba609(_0x3b3f63[_0x5d84('0x13')](0x1f4,_0x554d80['message']));});});};exports[_0x5d84('0x1d')]=function(_0x37a075){var _0x2b8054=this;return new Promise(function(_0x3a8d96,_0x1f9a16){return db['CmHopperHistory'][_0x5d84('0x1e')]({'raw':_0x37a075[_0x5d84('0x1b')]?_0x37a075['options'][_0x5d84('0x1f')]===undefined?!![]:![]:!![],'where':_0x37a075[_0x5d84('0x1b')]?_0x37a075['options'][_0x5d84('0x20')]||null:null,'attributes':[[db['sequelize']['fn'](_0x5d84('0x21'),db[_0x5d84('0x22')][_0x5d84('0x23')]('id')),'predictiveIntervalTotalCalls'],[db[_0x5d84('0x22')]['fn'](_0x5d84('0x21'),db[_0x5d84('0x22')]['fn']('IF',db[_0x5d84('0x22')]['literal'](_0x5d84('0x24')))),_0x5d84('0x25')],[db[_0x5d84('0x22')]['fn']('COUNT',db[_0x5d84('0x22')]['fn']('IF',db['sequelize'][_0x5d84('0x26')]('`state`\x20=\x2010,\x201,\x20null'))),_0x5d84('0x27')],[db[_0x5d84('0x22')]['fn'](_0x5d84('0x21'),db[_0x5d84('0x22')]['fn']('IF',db['sequelize'][_0x5d84('0x26')](_0x5d84('0x28')))),_0x5d84('0x29')],[db[_0x5d84('0x22')]['fn'](_0x5d84('0x2a'),db[_0x5d84('0x22')]['fn']('IF',db[_0x5d84('0x22')][_0x5d84('0x26')](_0x5d84('0x2b')))),_0x5d84('0x2c')],[db[_0x5d84('0x22')]['fn'](_0x5d84('0x2a'),db[_0x5d84('0x22')]['fn']('IF',db['sequelize'][_0x5d84('0x26')](_0x5d84('0x2d')))),'predictiveIntervalAvgTalktime']]})[_0x5d84('0xd')](function(_0x53ac22){logger[_0x5d84('0xe')](_0x5d84('0x1d'),_0x37a075);logger[_0x5d84('0x1c')](_0x5d84('0x1d'),_0x37a075,JSON[_0x5d84('0x12')](_0x53ac22));_0x3a8d96(_0x53ac22);})[_0x5d84('0x16')](function(_0x14eacc){logger[_0x5d84('0x13')](_0x5d84('0x1d'),_0x14eacc[_0x5d84('0x14')],_0x37a075);_0x1f9a16(_0x2b8054['error'](0x1f4,_0x14eacc[_0x5d84('0x14')]));});});};exports[_0x5d84('0x2e')]=function(_0x329f08){var _0x275fe9=this;return new Promise(function(_0x24e7d9,_0x1d9b7e){return db[_0x5d84('0x18')]['findAll']({'raw':_0x329f08['options']?_0x329f08[_0x5d84('0x1b')][_0x5d84('0x1f')]===undefined?!![]:![]:!![],'where':_0x329f08[_0x5d84('0x1b')]?_0x329f08[_0x5d84('0x1b')][_0x5d84('0x20')]||null:null,'attributes':[[_0x5d84('0x2f'),_0x5d84('0x30')],[db['sequelize']['fn']('COUNT',db[_0x5d84('0x22')]['fn']('IF',db['sequelize'][_0x5d84('0x26')](_0x5d84('0x31')))),_0x5d84('0x32')],[db[_0x5d84('0x22')]['fn']('COUNT',db[_0x5d84('0x22')]['fn']('IF',db[_0x5d84('0x22')]['literal'](_0x5d84('0x33')))),_0x5d84('0x34')],[db[_0x5d84('0x22')]['fn'](_0x5d84('0x21'),db[_0x5d84('0x22')]['fn']('IF',db[_0x5d84('0x22')][_0x5d84('0x26')](_0x5d84('0x24')))),_0x5d84('0x35')],[db[_0x5d84('0x22')]['fn'](_0x5d84('0x21'),db[_0x5d84('0x22')]['fn']('IF',db[_0x5d84('0x22')][_0x5d84('0x26')](_0x5d84('0x36')))),_0x5d84('0x37')],[db[_0x5d84('0x22')]['fn'](_0x5d84('0x21'),db[_0x5d84('0x22')]['fn']('IF',db[_0x5d84('0x22')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x5d84('0x38')],[db['sequelize']['fn']('COUNT',db[_0x5d84('0x22')]['fn']('IF',db['sequelize'][_0x5d84('0x26')](_0x5d84('0x39')))),'outboundDropCallsDayTimeout'],[db[_0x5d84('0x22')]['fn'](_0x5d84('0x21'),db[_0x5d84('0x22')]['fn']('IF',db['sequelize'][_0x5d84('0x26')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5d84('0x3a')],[db[_0x5d84('0x22')]['fn'](_0x5d84('0x21'),db['sequelize']['fn']('IF',db[_0x5d84('0x22')][_0x5d84('0x26')](_0x5d84('0x3b')))),_0x5d84('0x3c')],[db[_0x5d84('0x22')]['fn']('COUNT',db[_0x5d84('0x22')]['fn']('IF',db[_0x5d84('0x22')][_0x5d84('0x26')](_0x5d84('0x3d')))),_0x5d84('0x3e')],[db[_0x5d84('0x22')]['fn'](_0x5d84('0x21'),db['sequelize']['fn']('IF',db[_0x5d84('0x22')][_0x5d84('0x26')](_0x5d84('0x3f')))),_0x5d84('0x40')],[db[_0x5d84('0x22')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5d84('0x22')][_0x5d84('0x26')](_0x5d84('0x41')))),_0x5d84('0x42')],[db[_0x5d84('0x22')]['fn'](_0x5d84('0x21'),db['sequelize']['fn']('IF',db[_0x5d84('0x22')][_0x5d84('0x26')](_0x5d84('0x43')))),_0x5d84('0x44')],[db['sequelize']['fn']('COUNT',db[_0x5d84('0x22')]['fn']('IF',db[_0x5d84('0x22')][_0x5d84('0x26')](_0x5d84('0x45')))),_0x5d84('0x42')],[db[_0x5d84('0x22')]['fn'](_0x5d84('0x21'),db[_0x5d84('0x22')]['fn']('IF',db[_0x5d84('0x22')][_0x5d84('0x26')](_0x5d84('0x46')))),_0x5d84('0x47')]],'group':[_0x5d84('0x2f')]})[_0x5d84('0xd')](function(_0x3c99fc){logger[_0x5d84('0xe')]('GetVoiceQueueHopperHistory',_0x329f08);logger['debug'](_0x5d84('0x2e'),_0x329f08,JSON[_0x5d84('0x12')](_0x3c99fc));_0x24e7d9(_0x3c99fc);})[_0x5d84('0x16')](function(_0x4c8332){logger[_0x5d84('0x13')]('GetVoiceQueueHopperHistory',_0x4c8332[_0x5d84('0x14')],_0x329f08);_0x1d9b7e(_0x275fe9[_0x5d84('0x13')](0x1f4,_0x4c8332[_0x5d84('0x14')]));});});};exports[_0x5d84('0x48')]=function(_0x3a0a54){var _0x5cc313=this;return new Promise(function(_0x46c1cb,_0x1a7a87){return db[_0x5d84('0x18')][_0x5d84('0x1e')]({'raw':_0x3a0a54[_0x5d84('0x1b')]?_0x3a0a54['options'][_0x5d84('0x1f')]===undefined?!![]:![]:!![],'where':_0x3a0a54[_0x5d84('0x1b')]?_0x3a0a54['options']['where']||null:null,'attributes':[[_0x5d84('0x2f'),_0x5d84('0x30')],[db[_0x5d84('0x22')]['fn']('COUNT',db[_0x5d84('0x22')]['col']('id')),_0x5d84('0x49')],[db[_0x5d84('0x22')]['fn']('COUNT',db[_0x5d84('0x22')]['fn']('IF',db['sequelize'][_0x5d84('0x26')]('`state`\x20=\x204,\x201,\x20null'))),_0x5d84('0x4a')]],'group':[_0x5d84('0x2f')]})[_0x5d84('0xd')](function(_0x17e270){logger['info'](_0x5d84('0x48'),_0x3a0a54);logger[_0x5d84('0x1c')](_0x5d84('0x48'),_0x3a0a54,JSON[_0x5d84('0x12')](_0x17e270));_0x46c1cb(_0x17e270);})[_0x5d84('0x16')](function(_0x4de607){logger[_0x5d84('0x13')](_0x5d84('0x48'),_0x4de607[_0x5d84('0x14')],_0x3a0a54);_0x1a7a87(_0x5cc313[_0x5d84('0x13')](0x1f4,_0x4de607[_0x5d84('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index de9628e..08edd60 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 _0xe066=['express','fs-extra','../../components/auth/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','show','post','/:id','update','multer','util','path','connect-timeout'];(function(_0x1c1f8d,_0x1ce8ff){var _0x55984e=function(_0x2c3792){while(--_0x2c3792){_0x1c1f8d['push'](_0x1c1f8d['shift']());}};_0x55984e(++_0x1ce8ff);}(_0xe066,0x1e9));var _0x6e06=function(_0x788a54,_0x12450b){_0x788a54=_0x788a54-0x0;var _0x8b73a4=_0xe066[_0x788a54];return _0x8b73a4;};'use strict';var multer=require(_0x6e06('0x0'));var util=require(_0x6e06('0x1'));var path=require(_0x6e06('0x2'));var timeout=require(_0x6e06('0x3'));var express=require(_0x6e06('0x4'));var router=express['Router']();var fs_extra=require(_0x6e06('0x5'));var auth=require(_0x6e06('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6e06('0x7'));router[_0x6e06('0x8')]('/',auth[_0x6e06('0x9')](),controller[_0x6e06('0xa')]);router['get'](_0x6e06('0xb'),auth[_0x6e06('0x9')](),controller[_0x6e06('0xc')]);router[_0x6e06('0x8')]('/:id',auth[_0x6e06('0x9')](),controller[_0x6e06('0xd')]);router[_0x6e06('0xe')]('/',auth[_0x6e06('0x9')](),controller['create']);router['put'](_0x6e06('0xf'),auth[_0x6e06('0x9')](),controller[_0x6e06('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf6ac=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/describe','isAuthenticated','show','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xa9d59d,_0x244daa){var _0x262a1a=function(_0x488853){while(--_0x488853){_0xa9d59d['push'](_0xa9d59d['shift']());}};_0x262a1a(++_0x244daa);}(_0xf6ac,0x92));var _0xcf6a=function(_0x4b90c2,_0xaae537){_0x4b90c2=_0x4b90c2-0x0;var _0x59b4c0=_0xf6ac[_0x4b90c2];return _0x59b4c0;};'use strict';var multer=require(_0xcf6a('0x0'));var util=require(_0xcf6a('0x1'));var path=require(_0xcf6a('0x2'));var timeout=require(_0xcf6a('0x3'));var express=require(_0xcf6a('0x4'));var router=express[_0xcf6a('0x5')]();var fs_extra=require(_0xcf6a('0x6'));var auth=require(_0xcf6a('0x7'));var interaction=require(_0xcf6a('0x8'));var config=require(_0xcf6a('0x9'));var controller=require('./cmHopperHistory.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xcf6a('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xcf6a('0xb')](),controller[_0xcf6a('0xc')]);router[_0xcf6a('0xd')]('/',auth['isAuthenticated'](),controller[_0xcf6a('0xe')]);router[_0xcf6a('0xf')](_0xcf6a('0x10'),auth[_0xcf6a('0xb')](),controller[_0xcf6a('0x11')]);module[_0xcf6a('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index cf641dd..acc4aaa 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 _0xe107=['STRING','name','sequelize'];(function(_0x1399d6,_0x2c1661){var _0x4a9db4=function(_0x4666b8){while(--_0x4666b8){_0x1399d6['push'](_0x1399d6['shift']());}};_0x4a9db4(++_0x2c1661);}(_0xe107,0xb3));var _0x7e10=function(_0x1aa0df,_0x104a59){_0x1aa0df=_0x1aa0df-0x0;var _0x2f51c8=_0xe107[_0x1aa0df];return _0x2f51c8;};'use strict';var Sequelize=require(_0x7e10('0x0'));module['exports']={'name':{'type':Sequelize[_0x7e10('0x1')],'unique':_0x7e10('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7e10('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x536e=['name','sequelize','exports','STRING'];(function(_0x4af3cd,_0x12f492){var _0x74bd34=function(_0x4c7b90){while(--_0x4c7b90){_0x4af3cd['push'](_0x4af3cd['shift']());}};_0x74bd34(++_0x12f492);}(_0x536e,0x155));var _0xe536=function(_0x5cb7a8,_0x269783){_0x5cb7a8=_0x5cb7a8-0x0;var _0x2a26df=_0x536e[_0x5cb7a8];return _0x2a26df;};'use strict';var Sequelize=require(_0xe536('0x0'));module[_0xe536('0x1')]={'name':{'type':Sequelize[_0xe536('0x2')],'unique':_0xe536('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe536('0x2')]},'dialPrefix':{'type':Sequelize[_0xe536('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index bed5613..494c3e3 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 _0xa198=['crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./cmList.socket','register','sendStatus','status','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','filter','includeAll','findAll','catch','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ListId','getDispositions','findOne','Disposition','options','include','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','push','each','dataValues','errors','json','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','cf_%d','order','raw','getContactsCsv','CmCustomField','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','INTEGER','BOOLEAN','defaultValue','queryInterface','cm_contacts','getCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel'];(function(_0x13dc16,_0x2e0c94){var _0x3d5801=function(_0x14c8c5){while(--_0x14c8c5){_0x13dc16['push'](_0x13dc16['shift']());}};_0x3d5801(++_0x2e0c94);}(_0xa198,0x7f));var _0x8a19=function(_0x21a1d9,_0x27a852){_0x21a1d9=_0x21a1d9-0x0;var _0x2903ee=_0xa198[_0x21a1d9];return _0x2903ee;};'use strict';var emlformat=require(_0x8a19('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8a19('0x1'));var rp=require(_0x8a19('0x2'));var moment=require(_0x8a19('0x3'));var BPromise=require(_0x8a19('0x4'));var Mustache=require(_0x8a19('0x5'));var util=require(_0x8a19('0x6'));var path=require(_0x8a19('0x7'));var sox=require(_0x8a19('0x8'));var csv=require(_0x8a19('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a19('0xa'));var _=require('lodash');var squel=require(_0x8a19('0xb'));var crypto=require(_0x8a19('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8a19('0xd'));var toCsv=require(_0x8a19('0x9'));var querystring=require(_0x8a19('0xe'));var Papa=require('papaparse');var Redis=require(_0x8a19('0xf'));var authService=require(_0x8a19('0x10'));var qs=require(_0x8a19('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a19('0x12'));var logger=require('../../config/logger')(_0x8a19('0x13'));var utils=require(_0x8a19('0x14'));var config=require(_0x8a19('0x15'));var licenseUtil=require(_0x8a19('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8a19('0x17')](config[_0x8a19('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x8a19('0x19'))(new Redis(config[_0x8a19('0x18')]));require(_0x8a19('0x1a'))[_0x8a19('0x1b')](socket);function respondWithStatusCode(_0xbff7f0,_0xa0bfd0){_0xa0bfd0=_0xa0bfd0||0xcc;return function(_0x62a804){if(_0x62a804){return _0xbff7f0[_0x8a19('0x1c')](_0xa0bfd0);}return _0xbff7f0[_0x8a19('0x1d')](_0xa0bfd0)['end']();};}function respondWithResult(_0x7743c6,_0x17da4a){_0x17da4a=_0x17da4a||0xc8;return function(_0x849c41){if(_0x849c41){return _0x7743c6['status'](_0x17da4a)['json'](_0x849c41);}};}function respondWithFilteredResult(_0x57e5f4,_0x49dcb4){return function(_0x35a692){if(_0x35a692){var _0x2dc314=typeof _0x49dcb4[_0x8a19('0x1e')]==='undefined'&&typeof _0x49dcb4['limit']===_0x8a19('0x1f');var _0x44f2a9=_0x35a692[_0x8a19('0x20')];var _0x19b82c=_0x2dc314?0x0:_0x49dcb4['offset'];var _0x135799=_0x2dc314?_0x35a692['count']:_0x49dcb4[_0x8a19('0x1e')]+_0x49dcb4['limit'];var _0x14dd0f;if(_0x135799>=_0x44f2a9){_0x135799=_0x44f2a9;_0x14dd0f=0xc8;}else{_0x14dd0f=0xce;}_0x57e5f4[_0x8a19('0x1d')](_0x14dd0f);return _0x57e5f4[_0x8a19('0x21')](_0x8a19('0x22'),_0x19b82c+'-'+_0x135799+'/'+_0x44f2a9)['json'](_0x35a692);}return null;};}function patchUpdates(_0x3f26ef){return function(_0x133761){try{jsonpatch[_0x8a19('0x23')](_0x133761,_0x3f26ef,!![]);}catch(_0x17d0e0){return BPromise['reject'](_0x17d0e0);}return _0x133761[_0x8a19('0x24')]();};}function saveUpdates(_0x16a969,_0x2bd41a){return function(_0x6f2f7c){if(_0x6f2f7c){return _0x6f2f7c[_0x8a19('0x25')](_0x16a969)[_0x8a19('0x26')](function(_0x39e0d3){return _0x39e0d3;});}return null;};}function removeEntity(_0x59da22,_0x31af59){return function(_0x30a0f5){if(_0x30a0f5){return _0x30a0f5[_0x8a19('0x27')]()['then'](function(){var _0x53ef69=_0x30a0f5[_0x8a19('0x28')]({'plain':!![]});var _0x11a779=_0x8a19('0x29');return db[_0x8a19('0x2a')][_0x8a19('0x27')]({'where':{'type':_0x11a779,'resourceId':_0x53ef69['id']}})['then'](function(){return _0x30a0f5;});})[_0x8a19('0x26')](function(){_0x59da22[_0x8a19('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x587bc2,_0x3bdc21){return function(_0x64b267){if(!_0x64b267){_0x587bc2['sendStatus'](0x194);}return _0x64b267;};}function handleError(_0x39a889,_0x3baa88){_0x3baa88=_0x3baa88||0x1f4;return function(_0x7af7c6){logger[_0x8a19('0x2b')](_0x7af7c6[_0x8a19('0x2c')]);if(_0x7af7c6[_0x8a19('0x2d')]){delete _0x7af7c6[_0x8a19('0x2d')];}_0x39a889[_0x8a19('0x1d')](_0x3baa88)['send'](_0x7af7c6);};}exports['index']=function(_0x20d442,_0x1940dc){var _0x61bf0={},_0x1bd18f={},_0x199bb3={'count':0x0,'rows':[]};var _0x489c51=_[_0x8a19('0x2e')](db[_0x8a19('0x2f')][_0x8a19('0x30')],function(_0x4a059e){return{'name':_0x4a059e[_0x8a19('0x31')],'type':_0x4a059e[_0x8a19('0x32')][_0x8a19('0x33')]};});_0x1bd18f[_0x8a19('0x34')]=_[_0x8a19('0x2e')](_0x489c51,_0x8a19('0x2d'));_0x1bd18f[_0x8a19('0x35')]=_[_0x8a19('0x36')](_0x20d442[_0x8a19('0x35')]);_0x1bd18f[_0x8a19('0x37')]=_[_0x8a19('0x38')](_0x1bd18f[_0x8a19('0x34')],_0x1bd18f[_0x8a19('0x35')]);_0x61bf0[_0x8a19('0x39')]=_['intersection'](_0x1bd18f[_0x8a19('0x34')],qs[_0x8a19('0x3a')](_0x20d442[_0x8a19('0x35')][_0x8a19('0x3a')]));_0x61bf0[_0x8a19('0x39')]=_0x61bf0['attributes'][_0x8a19('0x3b')]?_0x61bf0[_0x8a19('0x39')]:_0x1bd18f['model'];if(!_0x20d442[_0x8a19('0x35')][_0x8a19('0x3c')](_0x8a19('0x3d'))){_0x61bf0[_0x8a19('0x3e')]=qs[_0x8a19('0x3e')](_0x20d442[_0x8a19('0x35')][_0x8a19('0x3e')]);_0x61bf0[_0x8a19('0x1e')]=qs[_0x8a19('0x1e')](_0x20d442['query'][_0x8a19('0x1e')]);}_0x61bf0['order']=qs[_0x8a19('0x3f')](_0x20d442[_0x8a19('0x35')][_0x8a19('0x3f')]);_0x61bf0[_0x8a19('0x40')]=qs[_0x8a19('0x37')](_[_0x8a19('0x41')](_0x20d442[_0x8a19('0x35')],_0x1bd18f[_0x8a19('0x37')]),_0x489c51);if(_0x20d442['query']['filter']){_0x61bf0[_0x8a19('0x40')]=_[_0x8a19('0x42')](_0x61bf0[_0x8a19('0x40')],{'$or':_[_0x8a19('0x2e')](_0x489c51,function(_0x27abc4){if(_0x27abc4[_0x8a19('0x32')]!=='VIRTUAL'){var _0x4ed914={};_0x4ed914[_0x27abc4['name']]={'$like':'%'+_0x20d442[_0x8a19('0x35')][_0x8a19('0x43')]+'%'};return _0x4ed914;}})});}_0x61bf0=_[_0x8a19('0x42')]({},_0x61bf0,_0x20d442['options']);var _0x293097={'where':_0x61bf0[_0x8a19('0x40')]};return db[_0x8a19('0x2f')]['count'](_0x293097)[_0x8a19('0x26')](function(_0x36c579){_0x199bb3[_0x8a19('0x20')]=_0x36c579;if(_0x20d442[_0x8a19('0x35')][_0x8a19('0x44')]){_0x61bf0['include']=[{'all':!![]}];}return db[_0x8a19('0x2f')][_0x8a19('0x45')](_0x61bf0);})[_0x8a19('0x26')](function(_0x2058f9){_0x199bb3['rows']=_0x2058f9;return _0x199bb3;})[_0x8a19('0x26')](respondWithFilteredResult(_0x1940dc,_0x61bf0))[_0x8a19('0x46')](handleError(_0x1940dc,null));};exports['show']=function(_0x3ba79a,_0x520fd1){var _0xc694aa={'raw':![],'where':{'id':_0x3ba79a['params']['id']}},_0x11d52d={};_0x11d52d[_0x8a19('0x34')]=_[_0x8a19('0x36')](db['CmList'][_0x8a19('0x30')]);_0x11d52d['query']=_[_0x8a19('0x36')](_0x3ba79a[_0x8a19('0x35')]);_0x11d52d['filters']=_[_0x8a19('0x38')](_0x11d52d[_0x8a19('0x34')],_0x11d52d[_0x8a19('0x35')]);_0xc694aa[_0x8a19('0x39')]=_[_0x8a19('0x38')](_0x11d52d[_0x8a19('0x34')],qs['fields'](_0x3ba79a[_0x8a19('0x35')][_0x8a19('0x3a')]));_0xc694aa[_0x8a19('0x39')]=_0xc694aa[_0x8a19('0x39')]['length']?_0xc694aa[_0x8a19('0x39')]:_0x11d52d[_0x8a19('0x34')];if(_0x3ba79a[_0x8a19('0x35')][_0x8a19('0x44')]){_0xc694aa['include']=[{'all':!![]}];}_0xc694aa=_[_0x8a19('0x42')]({},_0xc694aa,_0x3ba79a['options']);return db[_0x8a19('0x2f')][_0x8a19('0x47')](_0xc694aa)[_0x8a19('0x26')](handleEntityNotFound(_0x520fd1,null))[_0x8a19('0x26')](respondWithResult(_0x520fd1,null))[_0x8a19('0x46')](handleError(_0x520fd1,null));};exports[_0x8a19('0x48')]=function(_0xb4c3f2,_0xaa69ca){return db[_0x8a19('0x2f')][_0x8a19('0x48')](_0xb4c3f2['body'],{})['then'](function(_0x32f1ca){var _0x549f79=_0xb4c3f2[_0x8a19('0x49')][_0x8a19('0x28')]({'plain':!![]});if(!_0x549f79)throw new Error(_0x8a19('0x4a'));if(_0x549f79[_0x8a19('0x4b')]===_0x8a19('0x49')){var _0xefd924=_0x32f1ca[_0x8a19('0x28')]({'plain':!![]});var _0x45f02f=_0x8a19('0x29');return db[_0x8a19('0x4c')]['find']({'where':{'name':_0x45f02f,'userProfileId':_0x549f79['userProfileId']},'raw':!![]})['then'](function(_0x45a03d){if(_0x45a03d&&_0x45a03d['autoAssociation']===0x0){return db[_0x8a19('0x2a')][_0x8a19('0x48')]({'name':_0xefd924[_0x8a19('0x2d')],'resourceId':_0xefd924['id'],'type':_0x45a03d['name'],'sectionId':_0x45a03d['id']},{})[_0x8a19('0x26')](function(){return _0x32f1ca;});}else{return _0x32f1ca;}})['catch'](function(_0x4454e9){logger[_0x8a19('0x2b')](_0x8a19('0x4d'),_0x4454e9);throw _0x4454e9;});}return _0x32f1ca;})['then'](respondWithResult(_0xaa69ca,0xc9))[_0x8a19('0x46')](handleError(_0xaa69ca,null));};exports[_0x8a19('0x25')]=function(_0x407c8a,_0x25f06c){if(_0x407c8a[_0x8a19('0x4e')]['id']){delete _0x407c8a[_0x8a19('0x4e')]['id'];}return db[_0x8a19('0x2f')][_0x8a19('0x47')]({'where':{'id':_0x407c8a[_0x8a19('0x4f')]['id']}})[_0x8a19('0x26')](handleEntityNotFound(_0x25f06c,null))['then'](saveUpdates(_0x407c8a[_0x8a19('0x4e')],null))[_0x8a19('0x26')](respondWithResult(_0x25f06c,null))[_0x8a19('0x46')](handleError(_0x25f06c,null));};exports[_0x8a19('0x27')]=function(_0xe4fe80,_0x577210){return db[_0x8a19('0x2f')][_0x8a19('0x47')]({'where':{'id':_0xe4fe80[_0x8a19('0x4f')]['id']}})[_0x8a19('0x26')](handleEntityNotFound(_0x577210,null))[_0x8a19('0x26')](removeEntity(_0x577210,null))[_0x8a19('0x46')](handleError(_0x577210,null));};exports[_0x8a19('0x50')]=function(_0x46f6ff,_0x200b3b){return db[_0x8a19('0x2f')][_0x8a19('0x50')]()[_0x8a19('0x26')](respondWithResult(_0x200b3b,null))[_0x8a19('0x46')](handleError(_0x200b3b,null));};exports[_0x8a19('0x51')]=function(_0x532cac,_0x25b8b4,_0x1ed7b9){if(_0x532cac[_0x8a19('0x4e')]['id']){delete _0x532cac[_0x8a19('0x4e')]['id'];}return db[_0x8a19('0x2f')]['find']({'where':{'id':_0x532cac[_0x8a19('0x4f')]['id']}})[_0x8a19('0x26')](handleEntityNotFound(_0x25b8b4,null))[_0x8a19('0x26')](function(_0x3a766a){if(_0x3a766a){_0x532cac[_0x8a19('0x4e')][_0x8a19('0x52')]=_0x3a766a['id'];return db['Disposition'][_0x8a19('0x48')](_0x532cac[_0x8a19('0x4e')]);}})[_0x8a19('0x26')](respondWithResult(_0x25b8b4,null))[_0x8a19('0x46')](handleError(_0x25b8b4,null));};exports[_0x8a19('0x53')]=function(_0x5a27e8,_0x5cb90b,_0x4fea6a){var _0x54493a={'raw':![],'where':{}};var _0x1649bc={};var _0x2800d0={'count':0x0,'rows':[]};return db[_0x8a19('0x2f')][_0x8a19('0x54')]({'where':{'id':_0x5a27e8[_0x8a19('0x4f')]['id']}})[_0x8a19('0x26')](handleEntityNotFound(_0x5cb90b,null))[_0x8a19('0x26')](function(_0x535b77){if(_0x535b77){_0x1649bc['model']=_[_0x8a19('0x36')](db[_0x8a19('0x55')][_0x8a19('0x30')]);_0x1649bc['query']=_[_0x8a19('0x36')](_0x5a27e8[_0x8a19('0x35')]);_0x1649bc[_0x8a19('0x37')]=_[_0x8a19('0x38')](_0x1649bc[_0x8a19('0x34')],_0x1649bc[_0x8a19('0x35')]);_0x54493a['attributes']=_[_0x8a19('0x38')](_0x1649bc[_0x8a19('0x34')],qs[_0x8a19('0x3a')](_0x5a27e8[_0x8a19('0x35')][_0x8a19('0x3a')]));_0x54493a[_0x8a19('0x39')]=_0x54493a[_0x8a19('0x39')][_0x8a19('0x3b')]?_0x54493a[_0x8a19('0x39')]:_0x1649bc[_0x8a19('0x34')];if(!_0x5a27e8['query'][_0x8a19('0x3c')](_0x8a19('0x3d'))){_0x54493a[_0x8a19('0x3e')]=qs[_0x8a19('0x3e')](_0x5a27e8[_0x8a19('0x35')][_0x8a19('0x3e')]);_0x54493a[_0x8a19('0x1e')]=qs[_0x8a19('0x1e')](_0x5a27e8[_0x8a19('0x35')][_0x8a19('0x1e')]);}_0x54493a['order']=qs['sort'](_0x5a27e8[_0x8a19('0x35')][_0x8a19('0x3f')]);_0x54493a[_0x8a19('0x40')]=qs['filters'](_[_0x8a19('0x41')](_0x5a27e8[_0x8a19('0x35')],_0x1649bc[_0x8a19('0x37')]));_0x54493a[_0x8a19('0x40')][_0x8a19('0x52')]=_0x535b77['id'];if(_0x5a27e8['query'][_0x8a19('0x43')]){_0x54493a['where']=_[_0x8a19('0x42')](_0x54493a[_0x8a19('0x40')],{'$or':_[_0x8a19('0x2e')](_0x54493a[_0x8a19('0x39')],function(_0x332afb){var _0x48f82b={};_0x48f82b[_0x332afb]={'$like':'%'+_0x5a27e8[_0x8a19('0x35')][_0x8a19('0x43')]+'%'};return _0x48f82b;})});}_0x54493a=_['merge']({},_0x54493a,_0x5a27e8[_0x8a19('0x56')]);return db[_0x8a19('0x55')][_0x8a19('0x20')]({'where':_0x54493a[_0x8a19('0x40')]})['then'](function(_0x59e25d){_0x2800d0[_0x8a19('0x20')]=_0x59e25d;if(_0x5a27e8[_0x8a19('0x35')][_0x8a19('0x44')]){_0x54493a[_0x8a19('0x57')]=[{'all':!![]}];}return db[_0x8a19('0x55')][_0x8a19('0x45')](_0x54493a);})[_0x8a19('0x26')](function(_0xb574d2){_0x2800d0[_0x8a19('0x58')]=_0xb574d2;return _0x2800d0;});}})[_0x8a19('0x26')](respondWithFilteredResult(_0x5cb90b,_0x54493a))[_0x8a19('0x46')](handleError(_0x5cb90b,null));};exports[_0x8a19('0x59')]=function(_0x201ba9,_0xd57e7,_0x4254ba){return db['CmList'][_0x8a19('0x47')]({'where':{'id':_0x201ba9['params']['id']}})[_0x8a19('0x26')](handleEntityNotFound(_0xd57e7,null))[_0x8a19('0x26')](function(_0x5167be){if(_0x5167be){return _0x5167be[_0x8a19('0x59')](_0x201ba9['query'][_0x8a19('0x5a')]);}})[_0x8a19('0x26')](respondWithStatusCode(_0xd57e7,null))[_0x8a19('0x46')](handleError(_0xd57e7,null));};exports[_0x8a19('0x5b')]=function(_0x40629c,_0x44860b,_0xd9e8f5){return db[_0x8a19('0x2f')][_0x8a19('0x47')]({'where':{'id':_0x40629c['params']['id']}})['then'](handleEntityNotFound(_0x44860b,null))[_0x8a19('0x26')](function(_0x7b01f3){if(_0x7b01f3){var _0x450f07=[];var _0x329076={'success':[],'errors':[]};return db[_0x8a19('0x5c')][_0x8a19('0x50')]()[_0x8a19('0x26')](function(_0x14c745){if(_0x40629c[_0x8a19('0x4e')][_0x8a19('0x5d')]&&_['isArray'](_0x40629c['body'][_0x8a19('0x5d')])){if(_0x40629c[_0x8a19('0x4e')][_0x8a19('0x5d')]['length']){_0x40629c[_0x8a19('0x4e')][_0x8a19('0x5d')]=_0x40629c[_0x8a19('0x4e')][_0x8a19('0x5d')]['join'](';')+';';}else{_0x40629c['body'][_0x8a19('0x5d')]=null;}}else{_0x40629c[_0x8a19('0x4e')]['tags']=null;}if(_0x40629c[_0x8a19('0x4e')]&&_[_0x8a19('0x5e')](_0x40629c[_0x8a19('0x4e')])){for(var _0x29ca21=0x0;_0x29ca21<_0x40629c['body']['length'];_0x29ca21+=0x1){_0x40629c[_0x8a19('0x4e')][_0x29ca21][_0x8a19('0x52')]=_0x40629c[_0x8a19('0x4f')]['id'];_0x450f07[_0x8a19('0x5f')](_0x40629c['body'][_0x29ca21]);}return BPromise[_0x8a19('0x60')](_0x450f07,function(_0x49101f){return db[_0x8a19('0x5c')]['create'](_['omit'](_0x49101f,[_0x8a19('0x5a'),'id'])||{},{'fields':_[_0x8a19('0x36')](_0x14c745),'raw':!![]})[_0x8a19('0x26')](function(_0x1590fe){_0x329076['success'][_0x8a19('0x5f')](_0x1590fe[_0x8a19('0x61')]);})[_0x8a19('0x46')](function(_0x3fba6e){_0x329076[_0x8a19('0x62')][_0x8a19('0x5f')]({'data':_0x49101f,'error':_0x3fba6e['message']});});})[_0x8a19('0x26')](function(_0x43a005){return _0x329076;})[_0x8a19('0x46')](function(_0x41e867){return _0x41e867;});}else{_0x44860b[_0x8a19('0x1d')](0x190)[_0x8a19('0x63')]({'message':_0x8a19('0x64')});}});}})['then'](respondWithResult(_0x44860b,null))[_0x8a19('0x46')](handleError(_0x44860b,null));};exports[_0x8a19('0x65')]=function(_0x5452b5,_0x176bbb,_0x85fdf){var _0x481c0e;return db[_0x8a19('0x2f')][_0x8a19('0x47')]({'where':{'id':_0x5452b5[_0x8a19('0x4f')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x8a19('0x66')}]})[_0x8a19('0x26')](handleEntityNotFound(_0x176bbb,null))[_0x8a19('0x26')](function(_0x446db0){if(_0x446db0){_0x481c0e=_0x446db0;return db['CmContact']['rawAttributes'];}})[_0x8a19('0x26')](function(_0x35be71){if(_0x35be71){var _0x3982a7={};var _0x1a1536={};_0x1a1536['model']=_[_0x8a19('0x67')](_[_0x8a19('0x36')](_0x35be71),_[_0x8a19('0x2e')](_0x481c0e[_0x8a19('0x66')],function(_0x20ae0a){return util[_0x8a19('0x68')](_0x8a19('0x69'),_0x20ae0a['id']);}));_0x1a1536[_0x8a19('0x35')]=_[_0x8a19('0x36')](_0x5452b5['query']);_0x1a1536[_0x8a19('0x37')]=_[_0x8a19('0x38')](_0x1a1536['model'],_0x1a1536[_0x8a19('0x35')]);_0x3982a7[_0x8a19('0x39')]=_['intersection'](_0x1a1536['model'],qs[_0x8a19('0x3a')](_0x5452b5[_0x8a19('0x35')]['fields']));_0x3982a7[_0x8a19('0x39')]=_0x3982a7[_0x8a19('0x39')][_0x8a19('0x3b')]?_0x3982a7['attributes']:_0x1a1536[_0x8a19('0x34')];if(!_0x5452b5[_0x8a19('0x35')][_0x8a19('0x3c')](_0x8a19('0x3d'))){_0x3982a7[_0x8a19('0x3e')]=qs[_0x8a19('0x3e')](_0x5452b5['query'][_0x8a19('0x3e')]);_0x3982a7[_0x8a19('0x1e')]=qs[_0x8a19('0x1e')](_0x5452b5[_0x8a19('0x35')]['offset']);}_0x3982a7[_0x8a19('0x6a')]=qs[_0x8a19('0x3f')](_0x5452b5['query']['sort']);_0x3982a7['where']=qs['filters'](_[_0x8a19('0x41')](_0x5452b5[_0x8a19('0x35')],_0x1a1536[_0x8a19('0x37')]));_0x3982a7[_0x8a19('0x6b')]=!![];if(_0x5452b5[_0x8a19('0x35')][_0x8a19('0x43')]){_0x3982a7[_0x8a19('0x40')]=_[_0x8a19('0x42')](_0x3982a7[_0x8a19('0x40')],{'$or':_[_0x8a19('0x2e')](_0x3982a7[_0x8a19('0x39')],function(_0x3293fe){var _0x58ccb4={};_0x58ccb4[_0x3293fe]={'$like':'%'+_0x5452b5[_0x8a19('0x35')][_0x8a19('0x43')]+'%'};return _0x58ccb4;})});}_0x3982a7=_[_0x8a19('0x42')]({},_0x3982a7,_0x5452b5[_0x8a19('0x56')]);return _0x481c0e[_0x8a19('0x65')](_0x3982a7);}})[_0x8a19('0x26')](respondWithResult(_0x176bbb,null))[_0x8a19('0x46')](handleError(_0x176bbb,null));};exports[_0x8a19('0x6c')]=function(_0x47843d,_0x35623b,_0x444814){var _0x213705;return db[_0x8a19('0x2f')][_0x8a19('0x47')]({'where':{'id':_0x47843d[_0x8a19('0x4f')]['id']},'include':[{'model':db[_0x8a19('0x6d')],'as':'CustomFields'}]})[_0x8a19('0x26')](handleEntityNotFound(_0x35623b,null))[_0x8a19('0x26')](function(_0x53ce90){if(_0x53ce90){_0x213705=_0x53ce90;return db['CmContact'][_0x8a19('0x30')];}})[_0x8a19('0x26')](function(_0x2bf6a2){if(_0x2bf6a2){var _0x448219={};var _0xb9a9bc={};_0xb9a9bc['model']=_[_0x8a19('0x67')](_[_0x8a19('0x36')](_0x2bf6a2),_[_0x8a19('0x2e')](_0x213705[_0x8a19('0x66')],function(_0x39cce5){return util[_0x8a19('0x68')](_0x8a19('0x69'),_0x39cce5['id']);}));_0xb9a9bc[_0x8a19('0x35')]=_[_0x8a19('0x36')](_0x47843d['query']);_0xb9a9bc[_0x8a19('0x37')]=_['intersection'](_0xb9a9bc[_0x8a19('0x34')],_0xb9a9bc[_0x8a19('0x35')]);_0x448219[_0x8a19('0x39')]=_[_0x8a19('0x38')](_0xb9a9bc[_0x8a19('0x34')],qs[_0x8a19('0x3a')](_0x47843d[_0x8a19('0x35')][_0x8a19('0x3a')]));_0x448219[_0x8a19('0x39')]=_0x448219[_0x8a19('0x39')][_0x8a19('0x3b')]?_0x448219[_0x8a19('0x39')]:_0xb9a9bc[_0x8a19('0x34')];if(!_0x47843d[_0x8a19('0x35')]['hasOwnProperty'](_0x8a19('0x3d'))){_0x448219['limit']=qs[_0x8a19('0x3e')](_0x47843d[_0x8a19('0x35')][_0x8a19('0x3e')]);_0x448219[_0x8a19('0x1e')]=qs[_0x8a19('0x1e')](_0x47843d[_0x8a19('0x35')][_0x8a19('0x1e')]);}_0x448219[_0x8a19('0x6a')]=qs[_0x8a19('0x3f')](_0x47843d['query'][_0x8a19('0x3f')]);_0x448219[_0x8a19('0x40')]=qs[_0x8a19('0x37')](_[_0x8a19('0x41')](_0x47843d[_0x8a19('0x35')],_0xb9a9bc[_0x8a19('0x37')]));_0x448219[_0x8a19('0x6b')]=!![];if(_0x47843d[_0x8a19('0x35')][_0x8a19('0x43')]){_0x448219[_0x8a19('0x40')]=_[_0x8a19('0x42')](_0x448219['where'],{'$or':_[_0x8a19('0x2e')](_0x448219[_0x8a19('0x39')],function(_0x4df259){var _0x2163c9={};_0x2163c9[_0x4df259]={'$like':'%'+_0x47843d[_0x8a19('0x35')][_0x8a19('0x43')]+'%'};return _0x2163c9;})});}_0x448219=_[_0x8a19('0x42')]({},_0x448219,_0x47843d[_0x8a19('0x56')]);return _0x213705['getContacts'](_0x448219);}})['then'](function(_0x1e1ff1){if(!_[_0x8a19('0x6e')](_0x1e1ff1)){var _0x3ca888=toCsv(_0x1e1ff1);var _0x45126c=Date[_0x8a19('0x6f')]();fs[_0x8a19('0x70')](util[_0x8a19('0x68')](_0x8a19('0x71'),_0x213705['id'],_0x45126c),_0x3ca888);_0x35623b['setHeader']('Content-disposition',_0x8a19('0x72')+util[_0x8a19('0x68')](_0x8a19('0x73'),_0x213705['id'],_0x45126c));_0x35623b[_0x8a19('0x74')](_0x8a19('0x75'),_0x8a19('0x76'));return _0x35623b[_0x8a19('0x77')](util[_0x8a19('0x68')](_0x8a19('0x71'),_0x213705['id'],_0x45126c));}else{return _0x35623b[_0x8a19('0x1c')](0xcc);}})[_0x8a19('0x46')](handleError(_0x35623b,null));};exports[_0x8a19('0x78')]=function(_0x1ef2ce,_0x4c9067,_0x574e44){var _0x4e42b2;delete _0x1ef2ce[_0x8a19('0x4e')]['id'];return db[_0x8a19('0x2f')][_0x8a19('0x54')]({'where':{'id':_0x1ef2ce[_0x8a19('0x4f')]['id']}})[_0x8a19('0x26')](handleEntityNotFound(_0x4c9067,null))[_0x8a19('0x26')](function(_0x420f22){if(_0x420f22){return db[_0x8a19('0x79')][_0x8a19('0x7a')](function(_0x151961){return db['CmCustomField'][_0x8a19('0x48')](_0x1ef2ce[_0x8a19('0x4e')],{'transaction':_0x151961})['then'](function(_0xa7194e){_0x4e42b2=_0xa7194e;return _0x420f22[_0x8a19('0x7b')](_0xa7194e,{'transaction':_0x151961});})[_0x8a19('0x26')](function(){var _0x2e0b21={'type':db[_0x8a19('0x7c')][_0x8a19('0x7d')],'transaction':_0x151961};switch(_0x1ef2ce['body'][_0x8a19('0x32')]){case _0x8a19('0x7e'):_0x2e0b21[_0x8a19('0x32')]=db[_0x8a19('0x7c')][_0x8a19('0x7d')];break;case'number':_0x2e0b21[_0x8a19('0x32')]=db[_0x8a19('0x7c')][_0x8a19('0x7f')];break;case'switch':_0x2e0b21[_0x8a19('0x32')]=db[_0x8a19('0x7c')][_0x8a19('0x80')];_0x2e0b21[_0x8a19('0x81')]=![];break;default:}return db['sequelize'][_0x8a19('0x82')]['addColumn'](_0x8a19('0x83'),util[_0x8a19('0x68')]('cf_%s',_0x4e42b2['id']),_0x2e0b21);})[_0x8a19('0x26')](function(){return _0x4e42b2;});});}})[_0x8a19('0x26')](respondWithResult(_0x4c9067,null))['catch'](handleError(_0x4c9067,null));};exports[_0x8a19('0x84')]=function(_0x43759e,_0x40b3f4,_0x178377){var _0x26816b={};var _0x114e95={};var _0x33099e;var _0x4799ae;return db[_0x8a19('0x2f')][_0x8a19('0x54')]({'where':{'id':_0x43759e[_0x8a19('0x4f')]['id']}})[_0x8a19('0x26')](handleEntityNotFound(_0x40b3f4,null))[_0x8a19('0x26')](function(_0x2b40ce){if(_0x2b40ce){_0x33099e=_0x2b40ce;_0x114e95['model']=_[_0x8a19('0x36')](db[_0x8a19('0x6d')][_0x8a19('0x30')]);_0x114e95[_0x8a19('0x35')]=_[_0x8a19('0x36')](_0x43759e[_0x8a19('0x35')]);_0x114e95['filters']=_[_0x8a19('0x38')](_0x114e95[_0x8a19('0x34')],_0x114e95[_0x8a19('0x35')]);_0x26816b[_0x8a19('0x39')]=_[_0x8a19('0x38')](_0x114e95['model'],qs[_0x8a19('0x3a')](_0x43759e[_0x8a19('0x35')][_0x8a19('0x3a')]));_0x26816b['attributes']=_0x26816b[_0x8a19('0x39')]['length']?_0x26816b['attributes']:_0x114e95[_0x8a19('0x34')];_0x26816b['order']=qs[_0x8a19('0x3f')](_0x43759e[_0x8a19('0x35')][_0x8a19('0x3f')]);_0x26816b[_0x8a19('0x40')]=qs[_0x8a19('0x37')](_[_0x8a19('0x41')](_0x43759e[_0x8a19('0x35')],_0x114e95[_0x8a19('0x37')]));_0x26816b[_0x8a19('0x40')]=_[_0x8a19('0x42')](_0x26816b[_0x8a19('0x40')],{'$or':[{'ListId':_0x2b40ce['id']},{'ListId':null}]});if(_0x43759e[_0x8a19('0x35')]['filter']){_0x26816b[_0x8a19('0x40')]=_['merge'](_0x26816b[_0x8a19('0x40')],{'$or':_['map'](_0x26816b[_0x8a19('0x39')],function(_0x42e44e){var _0x49f1cf={};_0x49f1cf[_0x42e44e]={'$like':'%'+_0x43759e['query'][_0x8a19('0x43')]+'%'};return _0x49f1cf;})});}_0x26816b=_[_0x8a19('0x42')]({},_0x26816b,_0x43759e[_0x8a19('0x56')]);return db[_0x8a19('0x6d')]['findAndCountAll'](_0x26816b);}})[_0x8a19('0x26')](respondWithResult(_0x40b3f4,null))[_0x8a19('0x46')](handleError(_0x40b3f4,null));};exports['addAgents']=function(_0x4083d8,_0x4e9d09,_0x21ede9){return db['CmList']['find']({'where':{'id':_0x4083d8[_0x8a19('0x4f')]['id']}})[_0x8a19('0x26')](handleEntityNotFound(_0x4e9d09,null))[_0x8a19('0x26')](function(_0x3d8dcf){if(_0x3d8dcf){return _0x3d8dcf[_0x8a19('0x85')](_0x4083d8[_0x8a19('0x4e')][_0x8a19('0x5a')],_['omit'](_0x4083d8[_0x8a19('0x4e')],[_0x8a19('0x5a'),'id'])||{})[_0x8a19('0x86')](function(_0x2303b5){for(var _0x2596d6=0x0;_0x2596d6<_0x4083d8[_0x8a19('0x4e')][_0x8a19('0x5a')][_0x8a19('0x3b')];_0x2596d6+=0x1){socket[_0x8a19('0x87')]('userCmList:save',{'UserId':Number(_0x4083d8[_0x8a19('0x4e')][_0x8a19('0x5a')][_0x2596d6]),'CmListId':Number(_0x4083d8[_0x8a19('0x4f')]['id'])});}return _0x2303b5;});}})['then'](respondWithResult(_0x4e9d09,null))[_0x8a19('0x46')](handleError(_0x4e9d09,null));};exports[_0x8a19('0x88')]=function(_0x56053d,_0x2c15f7,_0x305bba){return db['CmList'][_0x8a19('0x47')]({'where':{'id':_0x56053d[_0x8a19('0x4f')]['id']}})[_0x8a19('0x26')](handleEntityNotFound(_0x2c15f7,null))[_0x8a19('0x26')](function(_0xea25e){if(_0xea25e){return _0xea25e['removeAgents'](_0x56053d[_0x8a19('0x35')]['ids'])['then'](function(){if(_['isArray'](_0x56053d[_0x8a19('0x35')][_0x8a19('0x5a')])){for(var _0x2e4907=0x0;_0x2e4907<_0x56053d[_0x8a19('0x35')][_0x8a19('0x5a')][_0x8a19('0x3b')];_0x2e4907+=0x1){socket['emit'](_0x8a19('0x89'),{'UserId':Number(_0x56053d[_0x8a19('0x35')]['ids'][_0x2e4907]),'CmListId':Number(_0x56053d[_0x8a19('0x4f')]['id'])});}}else{socket[_0x8a19('0x87')](_0x8a19('0x89'),{'UserId':Number(_0x56053d['query']['ids']),'CmListId':Number(_0x56053d[_0x8a19('0x4f')]['id'])});}});}})[_0x8a19('0x26')](respondWithStatusCode(_0x2c15f7,null))[_0x8a19('0x46')](handleError(_0x2c15f7,null));};exports[_0x8a19('0x8a')]=function(_0x4719ab,_0x3538da,_0x577a5f){var _0x527e38={};var _0x5208de={};var _0x3e699f;var _0x4d564f;return db[_0x8a19('0x2f')][_0x8a19('0x54')]({'where':{'id':_0x4719ab[_0x8a19('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3538da,null))[_0x8a19('0x26')](function(_0x316f0d){if(_0x316f0d){_0x3e699f=_0x316f0d;_0x5208de['model']=_[_0x8a19('0x36')](db['User'][_0x8a19('0x30')]);_0x5208de[_0x8a19('0x35')]=_[_0x8a19('0x36')](_0x4719ab['query']);_0x5208de['filters']=_['intersection'](_0x5208de['model'],_0x5208de['query']);_0x527e38[_0x8a19('0x39')]=_[_0x8a19('0x38')](_0x5208de['model'],qs[_0x8a19('0x3a')](_0x4719ab['query'][_0x8a19('0x3a')]));_0x527e38[_0x8a19('0x39')]=_0x527e38[_0x8a19('0x39')][_0x8a19('0x3b')]?_0x527e38['attributes']:_0x5208de[_0x8a19('0x34')];_0x527e38[_0x8a19('0x6a')]=qs[_0x8a19('0x3f')](_0x4719ab['query'][_0x8a19('0x3f')]);_0x527e38[_0x8a19('0x40')]=qs['filters'](_[_0x8a19('0x41')](_0x4719ab[_0x8a19('0x35')],_0x5208de[_0x8a19('0x37')]));if(_0x4719ab[_0x8a19('0x35')][_0x8a19('0x43')]){_0x527e38['where']=_['merge'](_0x527e38[_0x8a19('0x40')],{'$or':_['map'](_0x527e38[_0x8a19('0x39')],function(_0xe43cf9){var _0x4f9904={};_0x4f9904[_0xe43cf9]={'$like':'%'+_0x4719ab[_0x8a19('0x35')][_0x8a19('0x43')]+'%'};return _0x4f9904;})});}_0x527e38=_['merge']({},_0x527e38,_0x4719ab[_0x8a19('0x56')]);return _0x3e699f[_0x8a19('0x8a')](_0x527e38);}})[_0x8a19('0x26')](function(_0x164a32){if(_0x164a32){_0x4d564f=_0x164a32[_0x8a19('0x3b')];if(!_0x4719ab['query'][_0x8a19('0x3c')]('nolimit')){_0x527e38[_0x8a19('0x3e')]=qs[_0x8a19('0x3e')](_0x4719ab[_0x8a19('0x35')][_0x8a19('0x3e')]);_0x527e38[_0x8a19('0x1e')]=qs['offset'](_0x4719ab['query'][_0x8a19('0x1e')]);}return _0x3e699f[_0x8a19('0x8a')](_0x527e38);}})[_0x8a19('0x26')](function(_0x1c2b98){if(_0x1c2b98){return _0x1c2b98?{'count':_0x4d564f,'rows':_0x1c2b98}:null;}})['then'](respondWithResult(_0x3538da,null))['catch'](handleError(_0x3538da,null));}; \ No newline at end of file +var _0x944e=['addCustomField','sequelize','transaction','addCustomFields','TEXT','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','save','update','then','Lists','UserProfileResource','destroy','stack','name','send','index','map','CmList','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','pick','ListId','rows','removeDispositions','addContacts','CmContact','tags','isArray','join','push','each','omit','ids','success','dataValues','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','cf_%d','raw','getContactsCsv','concat','format','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','download'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x944e,0x1df));var _0xe944=function(_0x263ffd,_0x4d0f41){_0x263ffd=_0x263ffd-0x0;var _0x28db75=_0x944e[_0x263ffd];return _0x28db75;};'use strict';var emlformat=require(_0xe944('0x0'));var rimraf=require(_0xe944('0x1'));var zipdir=require(_0xe944('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe944('0x3'));var moment=require(_0xe944('0x4'));var BPromise=require(_0xe944('0x5'));var Mustache=require(_0xe944('0x6'));var util=require(_0xe944('0x7'));var path=require(_0xe944('0x8'));var sox=require(_0xe944('0x9'));var csv=require(_0xe944('0xa'));var ejs=require(_0xe944('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe944('0xc'));var squel=require('squel');var crypto=require(_0xe944('0xd'));var jsforce=require(_0xe944('0xe'));var deskjs=require(_0xe944('0xf'));var toCsv=require(_0xe944('0xa'));var querystring=require(_0xe944('0x10'));var Papa=require(_0xe944('0x11'));var Redis=require('ioredis');var authService=require(_0xe944('0x12'));var qs=require(_0xe944('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe944('0x14'));var logger=require(_0xe944('0x15'))(_0xe944('0x16'));var utils=require(_0xe944('0x17'));var config=require(_0xe944('0x18'));var licenseUtil=require(_0xe944('0x19'));var db=require(_0xe944('0x1a'))['db'];config['redis']=_[_0xe944('0x1b')](config[_0xe944('0x1c')],{'host':_0xe944('0x1d'),'port':0x18eb});var socket=require(_0xe944('0x1e'))(new Redis(config['redis']));require(_0xe944('0x1f'))[_0xe944('0x20')](socket);function respondWithStatusCode(_0x29ba2a,_0x58c039){_0x58c039=_0x58c039||0xcc;return function(_0x28949e){if(_0x28949e){return _0x29ba2a[_0xe944('0x21')](_0x58c039);}return _0x29ba2a[_0xe944('0x22')](_0x58c039)[_0xe944('0x23')]();};}function respondWithResult(_0x37693b,_0x2be55b){_0x2be55b=_0x2be55b||0xc8;return function(_0x22e423){if(_0x22e423){return _0x37693b['status'](_0x2be55b)[_0xe944('0x24')](_0x22e423);}};}function respondWithFilteredResult(_0x2a99cd,_0x262425){return function(_0x629028){if(_0x629028){var _0x41fe31=typeof _0x262425['offset']===_0xe944('0x25')&&typeof _0x262425[_0xe944('0x26')]==='undefined';var _0x7e8f2d=_0x629028['count'];var _0x4e4140=_0x41fe31?0x0:_0x262425['offset'];var _0x3678c3=_0x41fe31?_0x629028['count']:_0x262425[_0xe944('0x27')]+_0x262425[_0xe944('0x26')];var _0x1d118b;if(_0x3678c3>=_0x7e8f2d){_0x3678c3=_0x7e8f2d;_0x1d118b=0xc8;}else{_0x1d118b=0xce;}_0x2a99cd[_0xe944('0x22')](_0x1d118b);return _0x2a99cd[_0xe944('0x28')](_0xe944('0x29'),_0x4e4140+'-'+_0x3678c3+'/'+_0x7e8f2d)['json'](_0x629028);}return null;};}function patchUpdates(_0x387d00){return function(_0x1ef0b8){try{jsonpatch['apply'](_0x1ef0b8,_0x387d00,!![]);}catch(_0x52d897){return BPromise['reject'](_0x52d897);}return _0x1ef0b8[_0xe944('0x2a')]();};}function saveUpdates(_0x3bd2f1,_0x42bc9f){return function(_0xf07df8){if(_0xf07df8){return _0xf07df8[_0xe944('0x2b')](_0x3bd2f1)[_0xe944('0x2c')](function(_0xd01959){return _0xd01959;});}return null;};}function removeEntity(_0x5211ae,_0x5755c8){return function(_0x529d31){if(_0x529d31){return _0x529d31['destroy']()['then'](function(){var _0x3a80e4=_0x529d31['get']({'plain':!![]});var _0x30888a=_0xe944('0x2d');return db[_0xe944('0x2e')][_0xe944('0x2f')]({'where':{'type':_0x30888a,'resourceId':_0x3a80e4['id']}})['then'](function(){return _0x529d31;});})['then'](function(){_0x5211ae[_0xe944('0x22')](0xcc)[_0xe944('0x23')]();});}};}function handleEntityNotFound(_0x5149ec,_0x12f055){return function(_0x7af0e3){if(!_0x7af0e3){_0x5149ec[_0xe944('0x21')](0x194);}return _0x7af0e3;};}function handleError(_0x1f057a,_0x3cb253){_0x3cb253=_0x3cb253||0x1f4;return function(_0x6cc106){logger['error'](_0x6cc106[_0xe944('0x30')]);if(_0x6cc106[_0xe944('0x31')]){delete _0x6cc106[_0xe944('0x31')];}_0x1f057a[_0xe944('0x22')](_0x3cb253)[_0xe944('0x32')](_0x6cc106);};}exports[_0xe944('0x33')]=function(_0x1b9fac,_0x44b24c){var _0x21f85c={},_0x1b2549={},_0x2bafee={'count':0x0,'rows':[]};var _0x476d36=_[_0xe944('0x34')](db[_0xe944('0x35')][_0xe944('0x36')],function(_0x3e3aaa){return{'name':_0x3e3aaa['fieldName'],'type':_0x3e3aaa[_0xe944('0x37')][_0xe944('0x38')]};});_0x1b2549[_0xe944('0x39')]=_[_0xe944('0x34')](_0x476d36,_0xe944('0x31'));_0x1b2549[_0xe944('0x3a')]=_[_0xe944('0x3b')](_0x1b9fac[_0xe944('0x3a')]);_0x1b2549[_0xe944('0x3c')]=_['intersection'](_0x1b2549[_0xe944('0x39')],_0x1b2549[_0xe944('0x3a')]);_0x21f85c['attributes']=_[_0xe944('0x3d')](_0x1b2549[_0xe944('0x39')],qs[_0xe944('0x3e')](_0x1b9fac[_0xe944('0x3a')]['fields']));_0x21f85c[_0xe944('0x3f')]=_0x21f85c[_0xe944('0x3f')][_0xe944('0x40')]?_0x21f85c[_0xe944('0x3f')]:_0x1b2549[_0xe944('0x39')];if(!_0x1b9fac[_0xe944('0x3a')][_0xe944('0x41')](_0xe944('0x42'))){_0x21f85c[_0xe944('0x26')]=qs['limit'](_0x1b9fac[_0xe944('0x3a')][_0xe944('0x26')]);_0x21f85c[_0xe944('0x27')]=qs[_0xe944('0x27')](_0x1b9fac[_0xe944('0x3a')][_0xe944('0x27')]);}_0x21f85c[_0xe944('0x43')]=qs['sort'](_0x1b9fac[_0xe944('0x3a')][_0xe944('0x44')]);_0x21f85c[_0xe944('0x45')]=qs[_0xe944('0x3c')](_['pick'](_0x1b9fac[_0xe944('0x3a')],_0x1b2549[_0xe944('0x3c')]),_0x476d36);if(_0x1b9fac[_0xe944('0x3a')][_0xe944('0x46')]){_0x21f85c[_0xe944('0x45')]=_[_0xe944('0x47')](_0x21f85c[_0xe944('0x45')],{'$or':_[_0xe944('0x34')](_0x476d36,function(_0x12ce84){if(_0x12ce84[_0xe944('0x37')]!==_0xe944('0x48')){var _0x3c3f0a={};_0x3c3f0a[_0x12ce84[_0xe944('0x31')]]={'$like':'%'+_0x1b9fac[_0xe944('0x3a')][_0xe944('0x46')]+'%'};return _0x3c3f0a;}})});}_0x21f85c=_[_0xe944('0x47')]({},_0x21f85c,_0x1b9fac[_0xe944('0x49')]);var _0x41baeb={'where':_0x21f85c[_0xe944('0x45')]};return db[_0xe944('0x35')][_0xe944('0x4a')](_0x41baeb)['then'](function(_0x256497){_0x2bafee[_0xe944('0x4a')]=_0x256497;if(_0x1b9fac['query'][_0xe944('0x4b')]){_0x21f85c[_0xe944('0x4c')]=[{'all':!![]}];}return db[_0xe944('0x35')][_0xe944('0x4d')](_0x21f85c);})[_0xe944('0x2c')](function(_0xadaf49){_0x2bafee['rows']=_0xadaf49;return _0x2bafee;})[_0xe944('0x2c')](respondWithFilteredResult(_0x44b24c,_0x21f85c))[_0xe944('0x4e')](handleError(_0x44b24c,null));};exports['show']=function(_0x3c05de,_0x52a286){var _0x1c95bd={'raw':![],'where':{'id':_0x3c05de[_0xe944('0x4f')]['id']}},_0xc1c00f={};_0xc1c00f[_0xe944('0x39')]=_[_0xe944('0x3b')](db[_0xe944('0x35')][_0xe944('0x36')]);_0xc1c00f['query']=_[_0xe944('0x3b')](_0x3c05de['query']);_0xc1c00f[_0xe944('0x3c')]=_['intersection'](_0xc1c00f[_0xe944('0x39')],_0xc1c00f[_0xe944('0x3a')]);_0x1c95bd[_0xe944('0x3f')]=_['intersection'](_0xc1c00f[_0xe944('0x39')],qs[_0xe944('0x3e')](_0x3c05de[_0xe944('0x3a')]['fields']));_0x1c95bd[_0xe944('0x3f')]=_0x1c95bd[_0xe944('0x3f')][_0xe944('0x40')]?_0x1c95bd[_0xe944('0x3f')]:_0xc1c00f[_0xe944('0x39')];if(_0x3c05de['query'][_0xe944('0x4b')]){_0x1c95bd[_0xe944('0x4c')]=[{'all':!![]}];}_0x1c95bd=_[_0xe944('0x47')]({},_0x1c95bd,_0x3c05de[_0xe944('0x49')]);return db[_0xe944('0x35')][_0xe944('0x50')](_0x1c95bd)[_0xe944('0x2c')](handleEntityNotFound(_0x52a286,null))[_0xe944('0x2c')](respondWithResult(_0x52a286,null))[_0xe944('0x4e')](handleError(_0x52a286,null));};exports[_0xe944('0x51')]=function(_0x5dbad0,_0x4793be){return db[_0xe944('0x35')]['create'](_0x5dbad0[_0xe944('0x52')],{})['then'](function(_0x1549aa){var _0x2b1387=_0x5dbad0[_0xe944('0x53')]['get']({'plain':!![]});if(!_0x2b1387)throw new Error(_0xe944('0x54'));if(_0x2b1387['role']===_0xe944('0x53')){var _0x5cfe4b=_0x1549aa[_0xe944('0x55')]({'plain':!![]});var _0x133726=_0xe944('0x2d');return db[_0xe944('0x56')][_0xe944('0x50')]({'where':{'name':_0x133726,'userProfileId':_0x2b1387[_0xe944('0x57')]},'raw':!![]})['then'](function(_0x444dda){if(_0x444dda&&_0x444dda[_0xe944('0x58')]===0x0){return db[_0xe944('0x2e')][_0xe944('0x51')]({'name':_0x5cfe4b['name'],'resourceId':_0x5cfe4b['id'],'type':_0x444dda[_0xe944('0x31')],'sectionId':_0x444dda['id']},{})[_0xe944('0x2c')](function(){return _0x1549aa;});}else{return _0x1549aa;}})[_0xe944('0x4e')](function(_0x534b5a){logger[_0xe944('0x59')](_0xe944('0x5a'),_0x534b5a);throw _0x534b5a;});}return _0x1549aa;})[_0xe944('0x2c')](respondWithResult(_0x4793be,0xc9))[_0xe944('0x4e')](handleError(_0x4793be,null));};exports['update']=function(_0x4dd14b,_0x6288c9){if(_0x4dd14b['body']['id']){delete _0x4dd14b[_0xe944('0x52')]['id'];}return db[_0xe944('0x35')][_0xe944('0x50')]({'where':{'id':_0x4dd14b[_0xe944('0x4f')]['id']}})[_0xe944('0x2c')](handleEntityNotFound(_0x6288c9,null))[_0xe944('0x2c')](saveUpdates(_0x4dd14b[_0xe944('0x52')],null))[_0xe944('0x2c')](respondWithResult(_0x6288c9,null))[_0xe944('0x4e')](handleError(_0x6288c9,null));};exports['destroy']=function(_0x53a853,_0x25c538){return db[_0xe944('0x35')][_0xe944('0x50')]({'where':{'id':_0x53a853['params']['id']}})[_0xe944('0x2c')](handleEntityNotFound(_0x25c538,null))[_0xe944('0x2c')](removeEntity(_0x25c538,null))[_0xe944('0x4e')](handleError(_0x25c538,null));};exports[_0xe944('0x5b')]=function(_0x29b951,_0x45276a){return db[_0xe944('0x35')][_0xe944('0x5b')]()[_0xe944('0x2c')](respondWithResult(_0x45276a,null))[_0xe944('0x4e')](handleError(_0x45276a,null));};exports['addDisposition']=function(_0x81393f,_0x2f4e66,_0xcba925){if(_0x81393f['body']['id']){delete _0x81393f['body']['id'];}return db[_0xe944('0x35')][_0xe944('0x50')]({'where':{'id':_0x81393f['params']['id']}})[_0xe944('0x2c')](handleEntityNotFound(_0x2f4e66,null))[_0xe944('0x2c')](function(_0x1b91db){if(_0x1b91db){_0x81393f[_0xe944('0x52')]['ListId']=_0x1b91db['id'];return db[_0xe944('0x5c')][_0xe944('0x51')](_0x81393f[_0xe944('0x52')]);}})[_0xe944('0x2c')](respondWithResult(_0x2f4e66,null))['catch'](handleError(_0x2f4e66,null));};exports[_0xe944('0x5d')]=function(_0x8067b2,_0x2f45d4,_0x46f3f3){var _0x296ded={'raw':![],'where':{}};var _0x12f1d6={};var _0x5116e3={'count':0x0,'rows':[]};return db[_0xe944('0x35')][_0xe944('0x5e')]({'where':{'id':_0x8067b2[_0xe944('0x4f')]['id']}})[_0xe944('0x2c')](handleEntityNotFound(_0x2f45d4,null))['then'](function(_0x3235a0){if(_0x3235a0){_0x12f1d6[_0xe944('0x39')]=_[_0xe944('0x3b')](db[_0xe944('0x5c')][_0xe944('0x36')]);_0x12f1d6[_0xe944('0x3a')]=_['keys'](_0x8067b2['query']);_0x12f1d6[_0xe944('0x3c')]=_[_0xe944('0x3d')](_0x12f1d6['model'],_0x12f1d6[_0xe944('0x3a')]);_0x296ded[_0xe944('0x3f')]=_[_0xe944('0x3d')](_0x12f1d6['model'],qs[_0xe944('0x3e')](_0x8067b2['query'][_0xe944('0x3e')]));_0x296ded[_0xe944('0x3f')]=_0x296ded[_0xe944('0x3f')][_0xe944('0x40')]?_0x296ded['attributes']:_0x12f1d6[_0xe944('0x39')];if(!_0x8067b2['query'][_0xe944('0x41')](_0xe944('0x42'))){_0x296ded['limit']=qs[_0xe944('0x26')](_0x8067b2['query'][_0xe944('0x26')]);_0x296ded[_0xe944('0x27')]=qs[_0xe944('0x27')](_0x8067b2[_0xe944('0x3a')][_0xe944('0x27')]);}_0x296ded[_0xe944('0x43')]=qs[_0xe944('0x44')](_0x8067b2[_0xe944('0x3a')][_0xe944('0x44')]);_0x296ded[_0xe944('0x45')]=qs[_0xe944('0x3c')](_[_0xe944('0x5f')](_0x8067b2[_0xe944('0x3a')],_0x12f1d6['filters']));_0x296ded[_0xe944('0x45')][_0xe944('0x60')]=_0x3235a0['id'];if(_0x8067b2['query'][_0xe944('0x46')]){_0x296ded[_0xe944('0x45')]=_[_0xe944('0x47')](_0x296ded[_0xe944('0x45')],{'$or':_[_0xe944('0x34')](_0x296ded[_0xe944('0x3f')],function(_0xaaf969){var _0x51418e={};_0x51418e[_0xaaf969]={'$like':'%'+_0x8067b2[_0xe944('0x3a')][_0xe944('0x46')]+'%'};return _0x51418e;})});}_0x296ded=_['merge']({},_0x296ded,_0x8067b2[_0xe944('0x49')]);return db[_0xe944('0x5c')]['count']({'where':_0x296ded[_0xe944('0x45')]})[_0xe944('0x2c')](function(_0x3efa48){_0x5116e3[_0xe944('0x4a')]=_0x3efa48;if(_0x8067b2[_0xe944('0x3a')][_0xe944('0x4b')]){_0x296ded[_0xe944('0x4c')]=[{'all':!![]}];}return db[_0xe944('0x5c')][_0xe944('0x4d')](_0x296ded);})[_0xe944('0x2c')](function(_0x48cbb3){_0x5116e3[_0xe944('0x61')]=_0x48cbb3;return _0x5116e3;});}})['then'](respondWithFilteredResult(_0x2f45d4,_0x296ded))[_0xe944('0x4e')](handleError(_0x2f45d4,null));};exports[_0xe944('0x62')]=function(_0x123100,_0x195241,_0x5c59c5){return db[_0xe944('0x35')]['find']({'where':{'id':_0x123100[_0xe944('0x4f')]['id']}})['then'](handleEntityNotFound(_0x195241,null))['then'](function(_0x4364bb){if(_0x4364bb){return _0x4364bb[_0xe944('0x62')](_0x123100[_0xe944('0x3a')]['ids']);}})['then'](respondWithStatusCode(_0x195241,null))[_0xe944('0x4e')](handleError(_0x195241,null));};exports[_0xe944('0x63')]=function(_0x39b925,_0x52cab4,_0x4a1e37){return db['CmList'][_0xe944('0x50')]({'where':{'id':_0x39b925[_0xe944('0x4f')]['id']}})[_0xe944('0x2c')](handleEntityNotFound(_0x52cab4,null))['then'](function(_0x8a061c){if(_0x8a061c){var _0x37f3ca=[];var _0x2a957b={'success':[],'errors':[]};return db[_0xe944('0x64')][_0xe944('0x5b')]()[_0xe944('0x2c')](function(_0x107af0){if(_0x39b925['body'][_0xe944('0x65')]&&_[_0xe944('0x66')](_0x39b925['body'][_0xe944('0x65')])){if(_0x39b925['body']['tags']['length']){_0x39b925[_0xe944('0x52')]['tags']=_0x39b925[_0xe944('0x52')]['tags'][_0xe944('0x67')](';')+';';}else{_0x39b925['body']['tags']=null;}}else{_0x39b925[_0xe944('0x52')][_0xe944('0x65')]=null;}if(_0x39b925[_0xe944('0x52')]&&_['isArray'](_0x39b925[_0xe944('0x52')])){for(var _0x397a66=0x0;_0x397a66<_0x39b925[_0xe944('0x52')][_0xe944('0x40')];_0x397a66+=0x1){_0x39b925[_0xe944('0x52')][_0x397a66][_0xe944('0x60')]=_0x39b925[_0xe944('0x4f')]['id'];_0x37f3ca[_0xe944('0x68')](_0x39b925[_0xe944('0x52')][_0x397a66]);}return BPromise[_0xe944('0x69')](_0x37f3ca,function(_0x14044d){return db[_0xe944('0x64')][_0xe944('0x51')](_[_0xe944('0x6a')](_0x14044d,[_0xe944('0x6b'),'id'])||{},{'fields':_[_0xe944('0x3b')](_0x107af0),'raw':!![]})[_0xe944('0x2c')](function(_0x2728b0){_0x2a957b[_0xe944('0x6c')][_0xe944('0x68')](_0x2728b0[_0xe944('0x6d')]);})[_0xe944('0x4e')](function(_0x532e16){_0x2a957b['errors'][_0xe944('0x68')]({'data':_0x14044d,'error':_0x532e16['message']});});})[_0xe944('0x2c')](function(_0x3e5a91){return _0x2a957b;})[_0xe944('0x4e')](function(_0x1fc192){return _0x1fc192;});}else{_0x52cab4['status'](0x190)[_0xe944('0x24')]({'message':_0xe944('0x6e')});}});}})[_0xe944('0x2c')](respondWithResult(_0x52cab4,null))['catch'](handleError(_0x52cab4,null));};exports[_0xe944('0x6f')]=function(_0x20ff91,_0x409566,_0x28467c){var _0x55726b;return db[_0xe944('0x35')][_0xe944('0x50')]({'where':{'id':_0x20ff91[_0xe944('0x4f')]['id']},'include':[{'model':db[_0xe944('0x70')],'as':_0xe944('0x71')}]})[_0xe944('0x2c')](handleEntityNotFound(_0x409566,null))[_0xe944('0x2c')](function(_0x3ce71f){if(_0x3ce71f){_0x55726b=_0x3ce71f;return db[_0xe944('0x64')][_0xe944('0x36')];}})[_0xe944('0x2c')](function(_0x4eab45){if(_0x4eab45){var _0x1632fb={};var _0x2e388a={};_0x2e388a[_0xe944('0x39')]=_['concat'](_[_0xe944('0x3b')](_0x4eab45),_[_0xe944('0x34')](_0x55726b[_0xe944('0x71')],function(_0x237c01){return util['format'](_0xe944('0x72'),_0x237c01['id']);}));_0x2e388a[_0xe944('0x3a')]=_[_0xe944('0x3b')](_0x20ff91[_0xe944('0x3a')]);_0x2e388a[_0xe944('0x3c')]=_['intersection'](_0x2e388a[_0xe944('0x39')],_0x2e388a[_0xe944('0x3a')]);_0x1632fb[_0xe944('0x3f')]=_[_0xe944('0x3d')](_0x2e388a[_0xe944('0x39')],qs[_0xe944('0x3e')](_0x20ff91[_0xe944('0x3a')][_0xe944('0x3e')]));_0x1632fb['attributes']=_0x1632fb['attributes'][_0xe944('0x40')]?_0x1632fb['attributes']:_0x2e388a['model'];if(!_0x20ff91[_0xe944('0x3a')][_0xe944('0x41')](_0xe944('0x42'))){_0x1632fb['limit']=qs['limit'](_0x20ff91['query'][_0xe944('0x26')]);_0x1632fb['offset']=qs[_0xe944('0x27')](_0x20ff91[_0xe944('0x3a')][_0xe944('0x27')]);}_0x1632fb[_0xe944('0x43')]=qs[_0xe944('0x44')](_0x20ff91[_0xe944('0x3a')][_0xe944('0x44')]);_0x1632fb[_0xe944('0x45')]=qs[_0xe944('0x3c')](_[_0xe944('0x5f')](_0x20ff91[_0xe944('0x3a')],_0x2e388a['filters']));_0x1632fb[_0xe944('0x73')]=!![];if(_0x20ff91[_0xe944('0x3a')][_0xe944('0x46')]){_0x1632fb[_0xe944('0x45')]=_['merge'](_0x1632fb[_0xe944('0x45')],{'$or':_[_0xe944('0x34')](_0x1632fb[_0xe944('0x3f')],function(_0x40bbc5){var _0x10ff1e={};_0x10ff1e[_0x40bbc5]={'$like':'%'+_0x20ff91[_0xe944('0x3a')][_0xe944('0x46')]+'%'};return _0x10ff1e;})});}_0x1632fb=_['merge']({},_0x1632fb,_0x20ff91[_0xe944('0x49')]);return _0x55726b['getContacts'](_0x1632fb);}})['then'](respondWithResult(_0x409566,null))[_0xe944('0x4e')](handleError(_0x409566,null));};exports[_0xe944('0x74')]=function(_0x508457,_0x50800a,_0x1bc4e2){var _0xf1d14;return db[_0xe944('0x35')][_0xe944('0x50')]({'where':{'id':_0x508457[_0xe944('0x4f')]['id']},'include':[{'model':db[_0xe944('0x70')],'as':_0xe944('0x71')}]})[_0xe944('0x2c')](handleEntityNotFound(_0x50800a,null))[_0xe944('0x2c')](function(_0x16aaf8){if(_0x16aaf8){_0xf1d14=_0x16aaf8;return db[_0xe944('0x64')][_0xe944('0x36')];}})[_0xe944('0x2c')](function(_0x28c819){if(_0x28c819){var _0x5aa93a={};var _0x586878={};_0x586878[_0xe944('0x39')]=_[_0xe944('0x75')](_[_0xe944('0x3b')](_0x28c819),_['map'](_0xf1d14[_0xe944('0x71')],function(_0x172eb5){return util[_0xe944('0x76')](_0xe944('0x72'),_0x172eb5['id']);}));_0x586878[_0xe944('0x3a')]=_[_0xe944('0x3b')](_0x508457['query']);_0x586878[_0xe944('0x3c')]=_['intersection'](_0x586878[_0xe944('0x39')],_0x586878[_0xe944('0x3a')]);_0x5aa93a[_0xe944('0x3f')]=_['intersection'](_0x586878[_0xe944('0x39')],qs['fields'](_0x508457[_0xe944('0x3a')]['fields']));_0x5aa93a[_0xe944('0x3f')]=_0x5aa93a[_0xe944('0x3f')][_0xe944('0x40')]?_0x5aa93a[_0xe944('0x3f')]:_0x586878[_0xe944('0x39')];if(!_0x508457[_0xe944('0x3a')][_0xe944('0x41')]('nolimit')){_0x5aa93a[_0xe944('0x26')]=qs[_0xe944('0x26')](_0x508457[_0xe944('0x3a')][_0xe944('0x26')]);_0x5aa93a[_0xe944('0x27')]=qs[_0xe944('0x27')](_0x508457['query'][_0xe944('0x27')]);}_0x5aa93a[_0xe944('0x43')]=qs[_0xe944('0x44')](_0x508457[_0xe944('0x3a')][_0xe944('0x44')]);_0x5aa93a[_0xe944('0x45')]=qs['filters'](_['pick'](_0x508457['query'],_0x586878[_0xe944('0x3c')]));_0x5aa93a[_0xe944('0x73')]=!![];if(_0x508457[_0xe944('0x3a')][_0xe944('0x46')]){_0x5aa93a['where']=_[_0xe944('0x47')](_0x5aa93a[_0xe944('0x45')],{'$or':_[_0xe944('0x34')](_0x5aa93a['attributes'],function(_0x1b1a4b){var _0x530366={};_0x530366[_0x1b1a4b]={'$like':'%'+_0x508457[_0xe944('0x3a')][_0xe944('0x46')]+'%'};return _0x530366;})});}_0x5aa93a=_[_0xe944('0x47')]({},_0x5aa93a,_0x508457['options']);return _0xf1d14[_0xe944('0x6f')](_0x5aa93a);}})['then'](function(_0x5664d5){if(!_[_0xe944('0x77')](_0x5664d5)){var _0x2707a4=toCsv(_0x5664d5);var _0x5ce530=Date[_0xe944('0x78')]();fs[_0xe944('0x79')](util[_0xe944('0x76')](_0xe944('0x7a'),_0xf1d14['id'],_0x5ce530),_0x2707a4);_0x50800a[_0xe944('0x7b')](_0xe944('0x7c'),_0xe944('0x7d')+util[_0xe944('0x76')](_0xe944('0x7e'),_0xf1d14['id'],_0x5ce530));_0x50800a[_0xe944('0x7b')](_0xe944('0x7f'),'text/csv');return _0x50800a[_0xe944('0x80')](util[_0xe944('0x76')](_0xe944('0x7a'),_0xf1d14['id'],_0x5ce530));}else{return _0x50800a[_0xe944('0x21')](0xcc);}})[_0xe944('0x4e')](handleError(_0x50800a,null));};exports[_0xe944('0x81')]=function(_0x369a41,_0x99b571,_0x7f54a2){var _0x3443fb;delete _0x369a41['body']['id'];return db['CmList'][_0xe944('0x5e')]({'where':{'id':_0x369a41[_0xe944('0x4f')]['id']}})[_0xe944('0x2c')](handleEntityNotFound(_0x99b571,null))[_0xe944('0x2c')](function(_0x6e9322){if(_0x6e9322){return db[_0xe944('0x82')][_0xe944('0x83')](function(_0x11970a){return db['CmCustomField'][_0xe944('0x51')](_0x369a41['body'],{'transaction':_0x11970a})['then'](function(_0x489506){_0x3443fb=_0x489506;return _0x6e9322[_0xe944('0x84')](_0x489506,{'transaction':_0x11970a});})[_0xe944('0x2c')](function(){var _0x5b912b={'type':db['Sequelize'][_0xe944('0x85')],'transaction':_0x11970a};switch(_0x369a41['body'][_0xe944('0x37')]){case'text':_0x5b912b[_0xe944('0x37')]=db['Sequelize'][_0xe944('0x85')];break;case'number':_0x5b912b[_0xe944('0x37')]=db[_0xe944('0x86')][_0xe944('0x87')];break;case _0xe944('0x88'):_0x5b912b['type']=db['Sequelize'][_0xe944('0x89')];_0x5b912b[_0xe944('0x8a')]=![];break;default:}return db[_0xe944('0x82')][_0xe944('0x8b')][_0xe944('0x8c')](_0xe944('0x8d'),util['format']('cf_%s',_0x3443fb['id']),_0x5b912b);})['then'](function(){return _0x3443fb;});});}})['then'](respondWithResult(_0x99b571,null))['catch'](handleError(_0x99b571,null));};exports[_0xe944('0x8e')]=function(_0x3cb7cb,_0x568be5,_0x5d67f1){var _0x13350e={};var _0x1a9119={};var _0x29a1cc;var _0x481281;return db[_0xe944('0x35')]['findOne']({'where':{'id':_0x3cb7cb['params']['id']}})[_0xe944('0x2c')](handleEntityNotFound(_0x568be5,null))['then'](function(_0x22fa95){if(_0x22fa95){_0x29a1cc=_0x22fa95;_0x1a9119['model']=_[_0xe944('0x3b')](db['CmCustomField']['rawAttributes']);_0x1a9119[_0xe944('0x3a')]=_['keys'](_0x3cb7cb['query']);_0x1a9119[_0xe944('0x3c')]=_[_0xe944('0x3d')](_0x1a9119[_0xe944('0x39')],_0x1a9119[_0xe944('0x3a')]);_0x13350e['attributes']=_['intersection'](_0x1a9119[_0xe944('0x39')],qs[_0xe944('0x3e')](_0x3cb7cb['query'][_0xe944('0x3e')]));_0x13350e['attributes']=_0x13350e['attributes']['length']?_0x13350e[_0xe944('0x3f')]:_0x1a9119[_0xe944('0x39')];_0x13350e[_0xe944('0x43')]=qs[_0xe944('0x44')](_0x3cb7cb['query'][_0xe944('0x44')]);_0x13350e[_0xe944('0x45')]=qs[_0xe944('0x3c')](_[_0xe944('0x5f')](_0x3cb7cb[_0xe944('0x3a')],_0x1a9119['filters']));_0x13350e[_0xe944('0x45')]=_['merge'](_0x13350e['where'],{'$or':[{'ListId':_0x22fa95['id']},{'ListId':null}]});if(_0x3cb7cb[_0xe944('0x3a')]['filter']){_0x13350e['where']=_[_0xe944('0x47')](_0x13350e[_0xe944('0x45')],{'$or':_[_0xe944('0x34')](_0x13350e['attributes'],function(_0x2fccc7){var _0x5a9c3a={};_0x5a9c3a[_0x2fccc7]={'$like':'%'+_0x3cb7cb[_0xe944('0x3a')][_0xe944('0x46')]+'%'};return _0x5a9c3a;})});}_0x13350e=_['merge']({},_0x13350e,_0x3cb7cb['options']);return db[_0xe944('0x70')][_0xe944('0x8f')](_0x13350e);}})['then'](respondWithResult(_0x568be5,null))['catch'](handleError(_0x568be5,null));};exports[_0xe944('0x90')]=function(_0x33612f,_0x35eb27,_0x4f2a6d){return db[_0xe944('0x35')]['find']({'where':{'id':_0x33612f[_0xe944('0x4f')]['id']}})[_0xe944('0x2c')](handleEntityNotFound(_0x35eb27,null))['then'](function(_0x5b7b90){if(_0x5b7b90){return _0x5b7b90[_0xe944('0x90')](_0x33612f[_0xe944('0x52')][_0xe944('0x6b')],_['omit'](_0x33612f[_0xe944('0x52')],[_0xe944('0x6b'),'id'])||{})[_0xe944('0x91')](function(_0x36cf5a){for(var _0xf4d73f=0x0;_0xf4d73f<_0x33612f[_0xe944('0x52')]['ids'][_0xe944('0x40')];_0xf4d73f+=0x1){socket[_0xe944('0x92')](_0xe944('0x93'),{'UserId':Number(_0x33612f[_0xe944('0x52')][_0xe944('0x6b')][_0xf4d73f]),'CmListId':Number(_0x33612f['params']['id'])});}return _0x36cf5a;});}})[_0xe944('0x2c')](respondWithResult(_0x35eb27,null))['catch'](handleError(_0x35eb27,null));};exports[_0xe944('0x94')]=function(_0x3d2db5,_0x3041ea,_0x1b9213){return db[_0xe944('0x35')][_0xe944('0x50')]({'where':{'id':_0x3d2db5['params']['id']}})['then'](handleEntityNotFound(_0x3041ea,null))[_0xe944('0x2c')](function(_0x10a972){if(_0x10a972){return _0x10a972[_0xe944('0x94')](_0x3d2db5[_0xe944('0x3a')]['ids'])[_0xe944('0x2c')](function(){if(_[_0xe944('0x66')](_0x3d2db5[_0xe944('0x3a')][_0xe944('0x6b')])){for(var _0x487594=0x0;_0x487594<_0x3d2db5[_0xe944('0x3a')][_0xe944('0x6b')][_0xe944('0x40')];_0x487594+=0x1){socket[_0xe944('0x92')](_0xe944('0x95'),{'UserId':Number(_0x3d2db5[_0xe944('0x3a')]['ids'][_0x487594]),'CmListId':Number(_0x3d2db5[_0xe944('0x4f')]['id'])});}}else{socket[_0xe944('0x92')]('userCmList:remove',{'UserId':Number(_0x3d2db5[_0xe944('0x3a')][_0xe944('0x6b')]),'CmListId':Number(_0x3d2db5['params']['id'])});}});}})[_0xe944('0x2c')](respondWithStatusCode(_0x3041ea,null))['catch'](handleError(_0x3041ea,null));};exports['getAgents']=function(_0x3baae7,_0x364063,_0x2025bb){var _0x2235eb={};var _0x5146df={};var _0x427f73;var _0xd7053e;return db[_0xe944('0x35')][_0xe944('0x5e')]({'where':{'id':_0x3baae7[_0xe944('0x4f')]['id']}})[_0xe944('0x2c')](handleEntityNotFound(_0x364063,null))[_0xe944('0x2c')](function(_0x1bea59){if(_0x1bea59){_0x427f73=_0x1bea59;_0x5146df[_0xe944('0x39')]=_[_0xe944('0x3b')](db[_0xe944('0x96')][_0xe944('0x36')]);_0x5146df[_0xe944('0x3a')]=_[_0xe944('0x3b')](_0x3baae7[_0xe944('0x3a')]);_0x5146df[_0xe944('0x3c')]=_['intersection'](_0x5146df[_0xe944('0x39')],_0x5146df[_0xe944('0x3a')]);_0x2235eb[_0xe944('0x3f')]=_[_0xe944('0x3d')](_0x5146df[_0xe944('0x39')],qs[_0xe944('0x3e')](_0x3baae7[_0xe944('0x3a')][_0xe944('0x3e')]));_0x2235eb[_0xe944('0x3f')]=_0x2235eb[_0xe944('0x3f')]['length']?_0x2235eb[_0xe944('0x3f')]:_0x5146df['model'];_0x2235eb[_0xe944('0x43')]=qs[_0xe944('0x44')](_0x3baae7[_0xe944('0x3a')]['sort']);_0x2235eb[_0xe944('0x45')]=qs[_0xe944('0x3c')](_[_0xe944('0x5f')](_0x3baae7[_0xe944('0x3a')],_0x5146df['filters']));if(_0x3baae7[_0xe944('0x3a')][_0xe944('0x46')]){_0x2235eb['where']=_[_0xe944('0x47')](_0x2235eb[_0xe944('0x45')],{'$or':_['map'](_0x2235eb[_0xe944('0x3f')],function(_0x1597df){var _0x1ec6fb={};_0x1ec6fb[_0x1597df]={'$like':'%'+_0x3baae7[_0xe944('0x3a')][_0xe944('0x46')]+'%'};return _0x1ec6fb;})});}_0x2235eb=_[_0xe944('0x47')]({},_0x2235eb,_0x3baae7['options']);return _0x427f73[_0xe944('0x97')](_0x2235eb);}})[_0xe944('0x2c')](function(_0x515b4c){if(_0x515b4c){_0xd7053e=_0x515b4c['length'];if(!_0x3baae7[_0xe944('0x3a')][_0xe944('0x41')](_0xe944('0x42'))){_0x2235eb[_0xe944('0x26')]=qs[_0xe944('0x26')](_0x3baae7[_0xe944('0x3a')][_0xe944('0x26')]);_0x2235eb[_0xe944('0x27')]=qs[_0xe944('0x27')](_0x3baae7[_0xe944('0x3a')][_0xe944('0x27')]);}return _0x427f73[_0xe944('0x97')](_0x2235eb);}})[_0xe944('0x2c')](function(_0x41a147){if(_0x41a147){return _0x41a147?{'count':_0xd7053e,'rows':_0x41a147}:null;}})[_0xe944('0x2c')](respondWithResult(_0x364063,null))['catch'](handleError(_0x364063,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 47aa200..bee6e99 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(_0x400497,_0x1b51ab){var _0x50dc18=function(_0x300ed3){while(--_0x300ed3){_0x400497['push'](_0x400497['shift']());}};_0x50dc18(++_0x1b51ab);}(_0x814b,0x1a2));var _0xb814=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x814b[_0x49b207];return _0x2dc8fa;};'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 _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x5fc3,0xa8));var _0x35fc=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x5fc3[_0x42245d];return _0x4b211a;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index e04dddd..9fb8249 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 _0x6324=['define','cm_lists','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports'];(function(_0x5f4c5c,_0x41e95c){var _0x1460d5=function(_0x5115c7){while(--_0x5115c7){_0x5f4c5c['push'](_0x5f4c5c['shift']());}};_0x1460d5(++_0x41e95c);}(_0x6324,0x142));var _0x4632=function(_0x16b47f,_0x56cdd5){_0x16b47f=_0x16b47f-0x0;var _0x2070d4=_0x6324[_0x16b47f];return _0x2070d4;};'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 +var _0x6324=['define','cm_lists','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports'];(function(_0x46b712,_0x54c51d){var _0x84f82=function(_0x2d6a05){while(--_0x2d6a05){_0x46b712['push'](_0x46b712['shift']());}};_0x84f82(++_0x54c51d);}(_0x6324,0x142));var _0x4632=function(_0x1e1b5a,_0x13b534){_0x1e1b5a=_0x1e1b5a-0x0;var _0x3206db=_0x6324[_0x1e1b5a];return _0x3206db;};'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 9f0dbbd..df3f6bb 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 _0xfa1a=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa1a,0x1a6));var _0xafa1=function(_0x531cb8,_0x8ef36f){_0x531cb8=_0x531cb8-0x0;var _0x5cf297=_0xfa1a[_0x531cb8];return _0x5cf297;};'use strict';var _=require(_0xafa1('0x0'));var util=require(_0xafa1('0x1'));var moment=require(_0xafa1('0x2'));var BPromise=require(_0xafa1('0x3'));var rs=require(_0xafa1('0x4'));var fs=require('fs');var Redis=require(_0xafa1('0x5'));var db=require(_0xafa1('0x6'))['db'];var utils=require(_0xafa1('0x7'));var logger=require(_0xafa1('0x8'))(_0xafa1('0x9'));var config=require('../../config/environment');var jayson=require(_0xafa1('0xa'));var client=jayson[_0xafa1('0xb')][_0xafa1('0xc')]({'port':0x232a});config[_0xafa1('0xd')]=_[_0xafa1('0xe')](config[_0xafa1('0xd')],{'host':_0xafa1('0xf'),'port':0x18eb});var socket=require(_0xafa1('0x10'))(new Redis(config[_0xafa1('0xd')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x3321a5,_0x5abd07,_0xf02e52){return new BPromise(function(_0x3b8a12,_0x115870){return client[_0xafa1('0x11')](_0x3321a5,_0xf02e52)[_0xafa1('0x12')](function(_0x398c7a){logger['info'](_0xafa1('0x13'),_0x5abd07,_0xafa1('0x14'));logger[_0xafa1('0x15')](_0xafa1('0x16'),_0x5abd07,_0xafa1('0x14'),JSON[_0xafa1('0x17')](_0x398c7a));if(_0x398c7a['error']){if(_0x398c7a[_0xafa1('0x18')][_0xafa1('0x19')]===0x1f4){logger[_0xafa1('0x18')]('CmList,\x20%s,\x20%s',_0x5abd07,_0x398c7a['error']['message']);return _0x115870(_0x398c7a[_0xafa1('0x18')][_0xafa1('0x1a')]);}logger['error'](_0xafa1('0x13'),_0x5abd07,_0x398c7a['error'][_0xafa1('0x1a')]);return _0x3b8a12(_0x398c7a['error'][_0xafa1('0x1a')]);}else{logger['info'](_0xafa1('0x13'),_0x5abd07,'request\x20sent');_0x3b8a12(_0x398c7a['result'][_0xafa1('0x1a')]);}})[_0xafa1('0x1b')](function(_0x35ff11){logger[_0xafa1('0x18')](_0xafa1('0x13'),_0x5abd07,_0x35ff11);_0x115870(_0x35ff11);});});} \ No newline at end of file +var _0xa4b6=['debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s'];(function(_0x20a9f9,_0x7a442e){var _0x2f714e=function(_0xaa29cc){while(--_0xaa29cc){_0x20a9f9['push'](_0x20a9f9['shift']());}};_0x2f714e(++_0x7a442e);}(_0xa4b6,0x168));var _0x6a4b=function(_0x2eb98c,_0x141205){_0x2eb98c=_0x2eb98c-0x0;var _0x2754ed=_0xa4b6[_0x2eb98c];return _0x2754ed;};'use strict';var _=require('lodash');var util=require(_0x6a4b('0x0'));var moment=require(_0x6a4b('0x1'));var BPromise=require(_0x6a4b('0x2'));var rs=require(_0x6a4b('0x3'));var fs=require('fs');var Redis=require(_0x6a4b('0x4'));var db=require(_0x6a4b('0x5'))['db'];var utils=require(_0x6a4b('0x6'));var logger=require(_0x6a4b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6a4b('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x6a4b('0x9')]=_[_0x6a4b('0xa')](config[_0x6a4b('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x6a4b('0xb'))(new Redis(config[_0x6a4b('0x9')]));require(_0x6a4b('0xc'))[_0x6a4b('0xd')](socket);function respondWithRpcPromise(_0xed91fd,_0x4cf727,_0x3fb45a){return new BPromise(function(_0x142f99,_0x748920){return client[_0x6a4b('0xe')](_0xed91fd,_0x3fb45a)[_0x6a4b('0xf')](function(_0x18c7ac){logger[_0x6a4b('0x10')](_0x6a4b('0x11'),_0x4cf727,'request\x20sent');logger[_0x6a4b('0x12')](_0x6a4b('0x13'),_0x4cf727,'request\x20sent',JSON[_0x6a4b('0x14')](_0x18c7ac));if(_0x18c7ac[_0x6a4b('0x15')]){if(_0x18c7ac[_0x6a4b('0x15')][_0x6a4b('0x16')]===0x1f4){logger[_0x6a4b('0x15')](_0x6a4b('0x11'),_0x4cf727,_0x18c7ac[_0x6a4b('0x15')][_0x6a4b('0x17')]);return _0x748920(_0x18c7ac[_0x6a4b('0x15')][_0x6a4b('0x17')]);}logger['error'](_0x6a4b('0x11'),_0x4cf727,_0x18c7ac[_0x6a4b('0x15')][_0x6a4b('0x17')]);return _0x142f99(_0x18c7ac['error'][_0x6a4b('0x17')]);}else{logger[_0x6a4b('0x10')](_0x6a4b('0x11'),_0x4cf727,_0x6a4b('0x18'));_0x142f99(_0x18c7ac[_0x6a4b('0x19')]['message']);}})[_0x6a4b('0x1a')](function(_0x8f5cfb){logger[_0x6a4b('0x15')]('CmList,\x20%s,\x20%s',_0x4cf727,_0x8f5cfb);_0x748920(_0x8f5cfb);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 70a0f89..753d348 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 _0xad37=['cmList:','./cmList.events','remove','update','length'];(function(_0x4c301d,_0x38c825){var _0x50e818=function(_0xbf5eba){while(--_0xbf5eba){_0x4c301d['push'](_0x4c301d['shift']());}};_0x50e818(++_0x38c825);}(_0xad37,0xd3));var _0x7ad3=function(_0x101328,_0x52baad){_0x101328=_0x101328-0x0;var _0x251b0b=_0xad37[_0x101328];return _0x251b0b;};'use strict';var CmListEvents=require(_0x7ad3('0x0'));var events=['save',_0x7ad3('0x1'),_0x7ad3('0x2')];function createListener(_0x5178bc,_0x1daa2b){return function(_0x26d553){_0x1daa2b['emit'](_0x5178bc,_0x26d553);};}function removeListener(_0x4e028b,_0x551397){return function(){CmListEvents['removeListener'](_0x4e028b,_0x551397);};}exports['register']=function(_0x3f053a){for(var _0x4ad6c2=0x0,_0x4a31dc=events[_0x7ad3('0x3')];_0x4ad6c2<_0x4a31dc;_0x4ad6c2++){var _0x496fcf=events[_0x4ad6c2];var _0x434899=createListener(_0x7ad3('0x4')+_0x496fcf,_0x3f053a);CmListEvents['on'](_0x496fcf,_0x434899);}}; \ No newline at end of file +var _0xd3aa=['emit','removeListener','length','cmList:','save','remove','update'];(function(_0x371cfa,_0x485a7a){var _0x37ea75=function(_0x3e93da){while(--_0x3e93da){_0x371cfa['push'](_0x371cfa['shift']());}};_0x37ea75(++_0x485a7a);}(_0xd3aa,0x1a8));var _0xad3a=function(_0x158f01,_0x12af3e){_0x158f01=_0x158f01-0x0;var _0x5ef74e=_0xd3aa[_0x158f01];return _0x5ef74e;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xad3a('0x0'),_0xad3a('0x1'),_0xad3a('0x2')];function createListener(_0x27bbf1,_0x462ad1){return function(_0x5ca24f){_0x462ad1[_0xad3a('0x3')](_0x27bbf1,_0x5ca24f);};}function removeListener(_0x43af88,_0x42a870){return function(){CmListEvents[_0xad3a('0x4')](_0x43af88,_0x42a870);};}exports['register']=function(_0x40df5b){for(var _0x20ea7f=0x0,_0x58a3b5=events[_0xad3a('0x5')];_0x20ea7f<_0x58a3b5;_0x20ea7f++){var _0x3a2f6e=events[_0x20ea7f];var _0x270ef9=createListener(_0xad3a('0x6')+_0x3a2f6e,_0x40df5b);CmListEvents['on'](_0x3a2f6e,_0x270ef9);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 01c86af..fb3a242 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 _0x9ff9=['create','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post'];(function(_0x32ad2d,_0x188218){var _0x2e5aa2=function(_0x550366){while(--_0x550366){_0x32ad2d['push'](_0x32ad2d['shift']());}};_0x2e5aa2(++_0x188218);}(_0x9ff9,0x1c7));var _0x99ff=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x9ff9[_0x34021d];return _0x16597b;};'use strict';var multer=require(_0x99ff('0x0'));var util=require(_0x99ff('0x1'));var path=require(_0x99ff('0x2'));var timeout=require('connect-timeout');var express=require(_0x99ff('0x3'));var router=express['Router']();var fs_extra=require(_0x99ff('0x4'));var auth=require(_0x99ff('0x5'));var interaction=require(_0x99ff('0x6'));var config=require(_0x99ff('0x7'));var controller=require(_0x99ff('0x8'));router['get']('/',auth[_0x99ff('0x9')](),controller[_0x99ff('0xa')]);router[_0x99ff('0xb')](_0x99ff('0xc'),auth['isAuthenticated'](),controller[_0x99ff('0xd')]);router[_0x99ff('0xb')](_0x99ff('0xe'),auth[_0x99ff('0x9')](),controller[_0x99ff('0xf')]);router[_0x99ff('0xb')](_0x99ff('0x10'),auth[_0x99ff('0x9')](),controller[_0x99ff('0x11')]);router[_0x99ff('0xb')](_0x99ff('0x12'),auth[_0x99ff('0x9')](),controller[_0x99ff('0x13')]);router['get'](_0x99ff('0x14'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0x99ff('0xb')](_0x99ff('0x15'),auth[_0x99ff('0x9')](),controller[_0x99ff('0x16')]);router[_0x99ff('0xb')](_0x99ff('0x17'),auth[_0x99ff('0x9')](),controller[_0x99ff('0x18')]);router[_0x99ff('0x19')]('/',auth[_0x99ff('0x9')](),controller[_0x99ff('0x1a')]);router['post'](_0x99ff('0x10'),auth[_0x99ff('0x9')](),controller['addDisposition']);router[_0x99ff('0x19')](_0x99ff('0x12'),auth['isAuthenticated'](),controller[_0x99ff('0x1b')]);router[_0x99ff('0x19')](_0x99ff('0x15'),auth[_0x99ff('0x9')](),controller[_0x99ff('0x1c')]);router[_0x99ff('0x19')](_0x99ff('0x17'),auth['isAuthenticated'](),controller[_0x99ff('0x1d')]);router[_0x99ff('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0x99ff('0x1f')]);router[_0x99ff('0x20')](_0x99ff('0xe'),auth[_0x99ff('0x9')](),controller[_0x99ff('0x21')]);router[_0x99ff('0x20')](_0x99ff('0x10'),auth[_0x99ff('0x9')](),controller[_0x99ff('0x22')]);router['delete'](_0x99ff('0x17'),auth[_0x99ff('0x9')](),controller[_0x99ff('0x23')]);module[_0x99ff('0x24')]=router; \ No newline at end of file +var _0x6f5a=['../../config/environment','./cmList.controller','get','index','isAuthenticated','describe','show','/:id/dispositions','getDispositions','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addAgents','put','update','delete','/:id','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service'];(function(_0x155579,_0x26aca0){var _0x19d7ef=function(_0xe78c4){while(--_0xe78c4){_0x155579['push'](_0x155579['shift']());}};_0x19d7ef(++_0x26aca0);}(_0x6f5a,0x1cb));var _0xa6f5=function(_0x5efa68,_0x2e2f9f){_0x5efa68=_0x5efa68-0x0;var _0x49ceee=_0x6f5a[_0x5efa68];return _0x49ceee;};'use strict';var multer=require(_0xa6f5('0x0'));var util=require(_0xa6f5('0x1'));var path=require(_0xa6f5('0x2'));var timeout=require('connect-timeout');var express=require(_0xa6f5('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa6f5('0x4'));var interaction=require(_0xa6f5('0x5'));var config=require(_0xa6f5('0x6'));var controller=require(_0xa6f5('0x7'));router[_0xa6f5('0x8')]('/',auth['isAuthenticated'](),controller[_0xa6f5('0x9')]);router[_0xa6f5('0x8')]('/describe',auth[_0xa6f5('0xa')](),controller[_0xa6f5('0xb')]);router[_0xa6f5('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xa6f5('0xc')]);router[_0xa6f5('0x8')](_0xa6f5('0xd'),auth[_0xa6f5('0xa')](),controller[_0xa6f5('0xe')]);router[_0xa6f5('0x8')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xa6f5('0xf')]);router['get']('/:id/contacts/csv',auth[_0xa6f5('0xa')](),controller[_0xa6f5('0x10')]);router[_0xa6f5('0x8')](_0xa6f5('0x11'),auth[_0xa6f5('0xa')](),controller[_0xa6f5('0x12')]);router['get'](_0xa6f5('0x13'),auth[_0xa6f5('0xa')](),controller[_0xa6f5('0x14')]);router[_0xa6f5('0x15')]('/',auth[_0xa6f5('0xa')](),controller[_0xa6f5('0x16')]);router[_0xa6f5('0x15')](_0xa6f5('0xd'),auth['isAuthenticated'](),controller[_0xa6f5('0x17')]);router[_0xa6f5('0x15')]('/:id/contacts',auth[_0xa6f5('0xa')](),controller[_0xa6f5('0x18')]);router[_0xa6f5('0x15')](_0xa6f5('0x11'),auth['isAuthenticated'](),controller['addCustomField']);router['post'](_0xa6f5('0x13'),auth[_0xa6f5('0xa')](),controller[_0xa6f5('0x19')]);router[_0xa6f5('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0xa6f5('0x1b')]);router[_0xa6f5('0x1c')](_0xa6f5('0x1d'),auth[_0xa6f5('0xa')](),controller[_0xa6f5('0x1e')]);router[_0xa6f5('0x1c')](_0xa6f5('0xd'),auth[_0xa6f5('0xa')](),controller['removeDispositions']);router[_0xa6f5('0x1c')](_0xa6f5('0x13'),auth['isAuthenticated'](),controller['removeAgents']);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 97dc4d7..d29b011 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 _0x1cb8=['sequelize','exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x416a64,_0x275ade){var _0x270816=function(_0x5ce2fd){while(--_0x5ce2fd){_0x416a64['push'](_0x416a64['shift']());}};_0x270816(++_0x275ade);}(_0x1cb8,0x8a));var _0x81cb=function(_0x5c1783,_0x2d808c){_0x5c1783=_0x5c1783-0x0;var _0x5deb8c=_0x1cb8[_0x5c1783];return _0x5deb8c;};'use strict';var Sequelize=require(_0x81cb('0x0'));module[_0x81cb('0x1')]={'name':{'type':Sequelize[_0x81cb('0x2')],'get':function(_0x5eca93){return this[_0x81cb('0x3')](_0x81cb('0x4'));}},'field':{'type':Sequelize[_0x81cb('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x81cb('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0x81cb('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0xaeb8=['exports','VIRTUAL','getDataValue','STRING','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xaeb8,0xf9));var _0x8aeb=function(_0x454589,_0x3e852e){_0x454589=_0x454589-0x0;var _0x468c5c=_0xaeb8[_0x454589];return _0x468c5c;};'use strict';var Sequelize=require(_0x8aeb('0x0'));module[_0x8aeb('0x1')]={'name':{'type':Sequelize[_0x8aeb('0x2')],'get':function(_0x2eac21){return this[_0x8aeb('0x3')]('field');}},'field':{'type':Sequelize[_0x8aeb('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x8aeb('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x8aeb('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index b9f108f..00a0fa6 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 _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(_0xd67c88,_0x452539){var _0x326324=function(_0xf47a3f){while(--_0xf47a3f){_0xd67c88['push'](_0xd67c88['shift']());}};_0x326324(++_0x452539);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 +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(_0x8ae442,_0x306ae7){var _0x5743c4=function(_0x12414f){while(--_0x12414f){_0x8ae442['push'](_0x8ae442['shift']());}};_0x5743c4(++_0x306ae7);}(_0x7a54,0x106));var _0x47a5=function(_0x490be2,_0x1c0ce8){_0x490be2=_0x490be2-0x0;var _0x129601=_0x7a54[_0x490be2];return _0x129601;};'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 diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 47780c7..e64cb1b 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 _0xbdd7=['define','Condition','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes'];(function(_0x12a2c4,_0x22a37b){var _0x5a278c=function(_0xfdd3dd){while(--_0xfdd3dd){_0x12a2c4['push'](_0x12a2c4['shift']());}};_0x5a278c(++_0x22a37b);}(_0xbdd7,0x1b2));var _0x7bdd=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbdd7[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7bdd('0x0'));var util=require('util');var logger=require(_0x7bdd('0x1'))(_0x7bdd('0x2'));var moment=require(_0x7bdd('0x3'));var BPromise=require(_0x7bdd('0x4'));var rp=require(_0x7bdd('0x5'));var fs=require('fs');var path=require(_0x7bdd('0x6'));var rimraf=require(_0x7bdd('0x7'));var config=require(_0x7bdd('0x8'));var attributes=require(_0x7bdd('0x9'));module['exports']=function(_0x341ea4,_0x2b0145){return _0x341ea4[_0x7bdd('0xa')](_0x7bdd('0xb'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb16=['bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','tools_conditions','lodash','api','moment'];(function(_0x3134fa,_0x35833b){var _0x52396a=function(_0x232e9b){while(--_0x232e9b){_0x3134fa['push'](_0x3134fa['shift']());}};_0x52396a(++_0x35833b);}(_0xcb16,0x133));var _0x6cb1=function(_0x28852a,_0x22f72a){_0x28852a=_0x28852a-0x0;var _0x1d7100=_0xcb16[_0x28852a];return _0x1d7100;};'use strict';var _=require(_0x6cb1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6cb1('0x1'));var moment=require(_0x6cb1('0x2'));var BPromise=require(_0x6cb1('0x3'));var rp=require(_0x6cb1('0x4'));var fs=require('fs');var path=require(_0x6cb1('0x5'));var rimraf=require(_0x6cb1('0x6'));var config=require(_0x6cb1('0x7'));var attributes=require(_0x6cb1('0x8'));module['exports']=function(_0x2de2ee,_0x41f6ca){return _0x2de2ee['define']('Condition',attributes,{'tableName':_0x6cb1('0x9'),'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 43ed82b..d077e10 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 _0xbde0=['catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0xff9384,_0xfa9bdd){var _0x2e5ebb=function(_0x5e9449){while(--_0x5e9449){_0xff9384['push'](_0xff9384['shift']());}};_0x2e5ebb(++_0xfa9bdd);}(_0xbde0,0xb9));var _0x0bde=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xbde0[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var util=require(_0x0bde('0x0'));var moment=require(_0x0bde('0x1'));var BPromise=require(_0x0bde('0x2'));var rs=require(_0x0bde('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0bde('0x4'))['db'];var utils=require(_0x0bde('0x5'));var logger=require(_0x0bde('0x6'))(_0x0bde('0x7'));var config=require(_0x0bde('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0bde('0x9')][_0x0bde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1aa8be,_0xe6b6aa,_0x7aada5){return new BPromise(function(_0x1e02ac,_0x2492d3){return client['request'](_0x1aa8be,_0x7aada5)[_0x0bde('0xb')](function(_0x395719){logger[_0x0bde('0xc')](_0x0bde('0xd'),_0xe6b6aa,'request\x20sent');logger[_0x0bde('0xe')](_0x0bde('0xf'),_0xe6b6aa,_0x0bde('0x10'),JSON[_0x0bde('0x11')](_0x395719));if(_0x395719['error']){if(_0x395719[_0x0bde('0x12')][_0x0bde('0x13')]===0x1f4){logger['error'](_0x0bde('0xd'),_0xe6b6aa,_0x395719[_0x0bde('0x12')]['message']);return _0x2492d3(_0x395719[_0x0bde('0x12')][_0x0bde('0x14')]);}logger[_0x0bde('0x12')](_0x0bde('0xd'),_0xe6b6aa,_0x395719[_0x0bde('0x12')][_0x0bde('0x14')]);return _0x1e02ac(_0x395719[_0x0bde('0x12')][_0x0bde('0x14')]);}else{logger[_0x0bde('0xc')](_0x0bde('0xd'),_0xe6b6aa,_0x0bde('0x10'));_0x1e02ac(_0x395719[_0x0bde('0x15')][_0x0bde('0x14')]);}})[_0x0bde('0x16')](function(_0x26572c){logger['error'](_0x0bde('0xd'),_0xe6b6aa,_0x26572c);_0x2492d3(_0x26572c);});});} \ No newline at end of file +var _0x5f50=['client','request','then','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','Condition,\x20%s,\x20%s','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0x5f50,0xde));var _0x05f5=function(_0x79d4b8,_0x32c08d){_0x79d4b8=_0x79d4b8-0x0;var _0x522d6d=_0x5f50[_0x79d4b8];return _0x522d6d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x05f5('0x0'));var BPromise=require(_0x05f5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x05f5('0x2'));var db=require(_0x05f5('0x3'))['db'];var utils=require(_0x05f5('0x4'));var logger=require(_0x05f5('0x5'))(_0x05f5('0x6'));var config=require(_0x05f5('0x7'));var jayson=require(_0x05f5('0x8'));var client=jayson[_0x05f5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7619c0,_0x9cfe99,_0x456eed){return new BPromise(function(_0x58676f,_0x5e3220){return client[_0x05f5('0xa')](_0x7619c0,_0x456eed)[_0x05f5('0xb')](function(_0x2ffb95){logger['info']('Condition,\x20%s,\x20%s',_0x9cfe99,'request\x20sent');logger[_0x05f5('0xc')](_0x05f5('0xd'),_0x9cfe99,_0x05f5('0xe'),JSON['stringify'](_0x2ffb95));if(_0x2ffb95[_0x05f5('0xf')]){if(_0x2ffb95[_0x05f5('0xf')]['code']===0x1f4){logger[_0x05f5('0xf')]('Condition,\x20%s,\x20%s',_0x9cfe99,_0x2ffb95[_0x05f5('0xf')][_0x05f5('0x10')]);return _0x5e3220(_0x2ffb95[_0x05f5('0xf')][_0x05f5('0x10')]);}logger[_0x05f5('0xf')]('Condition,\x20%s,\x20%s',_0x9cfe99,_0x2ffb95[_0x05f5('0xf')][_0x05f5('0x10')]);return _0x58676f(_0x2ffb95[_0x05f5('0xf')][_0x05f5('0x10')]);}else{logger[_0x05f5('0x11')]('Condition,\x20%s,\x20%s',_0x9cfe99,'request\x20sent');_0x58676f(_0x2ffb95[_0x05f5('0x12')][_0x05f5('0x10')]);}})[_0x05f5('0x13')](function(_0x29f4a6){logger[_0x05f5('0xf')](_0x05f5('0x14'),_0x9cfe99,_0x29f4a6);_0x5e3220(_0x29f4a6);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 8901e19..cb0d902 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 _0x6333=['exports','connect-timeout','Router','fs-extra','../../components/interaction/service','./condition.controller','put','update','delete','/:id'];(function(_0x588c0f,_0x14afad){var _0x34ffd4=function(_0x40ee5e){while(--_0x40ee5e){_0x588c0f['push'](_0x588c0f['shift']());}};_0x34ffd4(++_0x14afad);}(_0x6333,0x83));var _0x3633=function(_0x1b8244,_0x37c394){_0x1b8244=_0x1b8244-0x0;var _0xaca3fa=_0x6333[_0x1b8244];return _0xaca3fa;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3633('0x0'));var express=require('express');var router=express[_0x3633('0x1')]();var fs_extra=require(_0x3633('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x3633('0x3'));var config=require('../../config/environment');var controller=require(_0x3633('0x4'));router[_0x3633('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x3633('0x6')]);router[_0x3633('0x7')](_0x3633('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x3633('0x9')]=router; \ No newline at end of file +var _0x1ccb=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x1ccb,0x1d9));var _0xb1cc=function(_0x15ede0,_0x2e955e){_0x15ede0=_0x15ede0-0x0;var _0x2473f9=_0x1ccb[_0x15ede0];return _0x2473f9;};'use strict';var multer=require(_0xb1cc('0x0'));var util=require(_0xb1cc('0x1'));var path=require(_0xb1cc('0x2'));var timeout=require('connect-timeout');var express=require(_0xb1cc('0x3'));var router=express[_0xb1cc('0x4')]();var fs_extra=require(_0xb1cc('0x5'));var auth=require(_0xb1cc('0x6'));var interaction=require(_0xb1cc('0x7'));var config=require(_0xb1cc('0x8'));var controller=require(_0xb1cc('0x9'));router[_0xb1cc('0xa')](_0xb1cc('0xb'),auth[_0xb1cc('0xc')](),controller[_0xb1cc('0xd')]);router[_0xb1cc('0xe')](_0xb1cc('0xb'),auth[_0xb1cc('0xc')](),controller[_0xb1cc('0xf')]);module[_0xb1cc('0x10')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 4ee30e9..7b352e5 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 _0x0713=['STRING','name'];(function(_0xf858e,_0x51b0f1){var _0x5344d8=function(_0x5219d6){while(--_0x5219d6){_0xf858e['push'](_0xf858e['shift']());}};_0x5344d8(++_0x51b0f1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0xcfeff4,_0x3f2e19){var _0xb2fadc=function(_0x4cd013){while(--_0x4cd013){_0xcfeff4['push'](_0xcfeff4['shift']());}};_0xb2fadc(++_0x3f2e19);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 36de94c..dc00d83 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 _0xdaf2=['Content-Range','save','update','destroy','then','get','CustomDashboards','UserProfileResource','end','error','name','send','index','Dashboard','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','autoAssociation','iframe','attrUrl','attrs','value','https://','custom','attrPath','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','stringify','DashboardId','getItems','findOne','DashboardItem','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','json','limit','undefined','count','offset'];(function(_0x3bc298,_0x583d14){var _0x31bf58=function(_0x24563b){while(--_0x24563b){_0x3bc298['push'](_0x3bc298['shift']());}};_0x31bf58(++_0x583d14);}(_0xdaf2,0x13b));var _0x2daf=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xdaf2[_0x456fb1];return _0x4083d6;};'use strict';var emlformat=require(_0x2daf('0x0'));var rimraf=require(_0x2daf('0x1'));var zipdir=require(_0x2daf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2daf('0x3'));var Mustache=require(_0x2daf('0x4'));var util=require(_0x2daf('0x5'));var path=require(_0x2daf('0x6'));var sox=require('sox');var csv=require(_0x2daf('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2daf('0x8'));var _=require(_0x2daf('0x9'));var squel=require('squel');var crypto=require(_0x2daf('0xa'));var jsforce=require(_0x2daf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2daf('0x7'));var querystring=require(_0x2daf('0xc'));var Papa=require('papaparse');var Redis=require(_0x2daf('0xd'));var authService=require(_0x2daf('0xe'));var qs=require(_0x2daf('0xf'));var as=require(_0x2daf('0x10'));var hardwareService=require(_0x2daf('0x11'));var logger=require(_0x2daf('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x2daf('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2daf('0x14'))['db'];config[_0x2daf('0x15')]=_[_0x2daf('0x16')](config[_0x2daf('0x15')],{'host':_0x2daf('0x17'),'port':0x18eb});var socket=require(_0x2daf('0x18'))(new Redis(config[_0x2daf('0x15')]));require(_0x2daf('0x19'))['register'](socket);function respondWithStatusCode(_0x4fb573,_0x1f6d57){_0x1f6d57=_0x1f6d57||0xcc;return function(_0x471de3){if(_0x471de3){return _0x4fb573[_0x2daf('0x1a')](_0x1f6d57);}return _0x4fb573[_0x2daf('0x1b')](_0x1f6d57)['end']();};}function respondWithResult(_0x14a5c3,_0x3ecb95){_0x3ecb95=_0x3ecb95||0xc8;return function(_0x4203d2){if(_0x4203d2){return _0x14a5c3[_0x2daf('0x1b')](_0x3ecb95)[_0x2daf('0x1c')](_0x4203d2);}};}function respondWithFilteredResult(_0x4e3475,_0x5e699f){return function(_0x1b56ca){if(_0x1b56ca){var _0x33a642=typeof _0x5e699f['offset']==='undefined'&&typeof _0x5e699f[_0x2daf('0x1d')]===_0x2daf('0x1e');var _0x5dfcaa=_0x1b56ca[_0x2daf('0x1f')];var _0x3b44c1=_0x33a642?0x0:_0x5e699f[_0x2daf('0x20')];var _0x40b407=_0x33a642?_0x1b56ca['count']:_0x5e699f[_0x2daf('0x20')]+_0x5e699f['limit'];var _0x45ae43;if(_0x40b407>=_0x5dfcaa){_0x40b407=_0x5dfcaa;_0x45ae43=0xc8;}else{_0x45ae43=0xce;}_0x4e3475[_0x2daf('0x1b')](_0x45ae43);return _0x4e3475['set'](_0x2daf('0x21'),_0x3b44c1+'-'+_0x40b407+'/'+_0x5dfcaa)[_0x2daf('0x1c')](_0x1b56ca);}return null;};}function patchUpdates(_0x351a08){return function(_0x3f8113){try{jsonpatch['apply'](_0x3f8113,_0x351a08,!![]);}catch(_0x443aff){return BPromise['reject'](_0x443aff);}return _0x3f8113[_0x2daf('0x22')]();};}function saveUpdates(_0x43d227,_0x40fc30){return function(_0x4c371f){if(_0x4c371f){return _0x4c371f[_0x2daf('0x23')](_0x43d227)['then'](function(_0x5ea05f){return _0x5ea05f;});}return null;};}function removeEntity(_0x357d12,_0x44cf59){return function(_0x4f88a8){if(_0x4f88a8){return _0x4f88a8[_0x2daf('0x24')]()[_0x2daf('0x25')](function(){var _0x3c0300=_0x4f88a8[_0x2daf('0x26')]({'plain':!![]});var _0x5dd11f=_0x2daf('0x27');return db[_0x2daf('0x28')][_0x2daf('0x24')]({'where':{'type':_0x5dd11f,'resourceId':_0x3c0300['id']}})[_0x2daf('0x25')](function(){return _0x4f88a8;});})['then'](function(){_0x357d12[_0x2daf('0x1b')](0xcc)[_0x2daf('0x29')]();});}};}function handleEntityNotFound(_0x4788ba,_0x1b010b){return function(_0x2a2203){if(!_0x2a2203){_0x4788ba['sendStatus'](0x194);}return _0x2a2203;};}function handleError(_0x48ad50,_0x2573ae){_0x2573ae=_0x2573ae||0x1f4;return function(_0x3abf45){logger[_0x2daf('0x2a')](_0x3abf45['stack']);if(_0x3abf45[_0x2daf('0x2b')]){delete _0x3abf45[_0x2daf('0x2b')];}_0x48ad50[_0x2daf('0x1b')](_0x2573ae)[_0x2daf('0x2c')](_0x3abf45);};}exports[_0x2daf('0x2d')]=function(_0xec02ae,_0x527f34){var _0x1a6a30={},_0x1d900c={},_0x1b8d43={'count':0x0,'rows':[]};var _0x21def8=_['map'](db[_0x2daf('0x2e')][_0x2daf('0x2f')],function(_0xfb80b3){return{'name':_0xfb80b3[_0x2daf('0x30')],'type':_0xfb80b3[_0x2daf('0x31')]['key']};});_0x1d900c['model']=_[_0x2daf('0x32')](_0x21def8,_0x2daf('0x2b'));_0x1d900c[_0x2daf('0x33')]=_[_0x2daf('0x34')](_0xec02ae[_0x2daf('0x33')]);_0x1d900c[_0x2daf('0x35')]=_[_0x2daf('0x36')](_0x1d900c['model'],_0x1d900c[_0x2daf('0x33')]);_0x1a6a30['attributes']=_[_0x2daf('0x36')](_0x1d900c[_0x2daf('0x37')],qs['fields'](_0xec02ae[_0x2daf('0x33')][_0x2daf('0x38')]));_0x1a6a30['attributes']=_0x1a6a30[_0x2daf('0x39')]['length']?_0x1a6a30['attributes']:_0x1d900c[_0x2daf('0x37')];if(!_0xec02ae[_0x2daf('0x33')][_0x2daf('0x3a')](_0x2daf('0x3b'))){_0x1a6a30[_0x2daf('0x1d')]=qs[_0x2daf('0x1d')](_0xec02ae[_0x2daf('0x33')][_0x2daf('0x1d')]);_0x1a6a30[_0x2daf('0x20')]=qs[_0x2daf('0x20')](_0xec02ae[_0x2daf('0x33')][_0x2daf('0x20')]);}_0x1a6a30[_0x2daf('0x3c')]=qs[_0x2daf('0x3d')](_0xec02ae['query'][_0x2daf('0x3d')]);_0x1a6a30[_0x2daf('0x3e')]=qs[_0x2daf('0x35')](_['pick'](_0xec02ae[_0x2daf('0x33')],_0x1d900c[_0x2daf('0x35')]),_0x21def8);if(_0xec02ae[_0x2daf('0x33')][_0x2daf('0x3f')]){_0x1a6a30['where']=_[_0x2daf('0x40')](_0x1a6a30[_0x2daf('0x3e')],{'$or':_[_0x2daf('0x32')](_0x21def8,function(_0x45b7e6){if(_0x45b7e6[_0x2daf('0x31')]!==_0x2daf('0x41')){var _0x31e039={};_0x31e039[_0x45b7e6[_0x2daf('0x2b')]]={'$like':'%'+_0xec02ae['query']['filter']+'%'};return _0x31e039;}})});}_0x1a6a30=_[_0x2daf('0x40')]({},_0x1a6a30,_0xec02ae['options']);var _0x3bf1b6={'where':_0x1a6a30['where']};return db[_0x2daf('0x2e')]['count'](_0x3bf1b6)[_0x2daf('0x25')](function(_0x20cbfe){_0x1b8d43[_0x2daf('0x1f')]=_0x20cbfe;if(_0xec02ae[_0x2daf('0x33')][_0x2daf('0x42')]){_0x1a6a30[_0x2daf('0x43')]=[{'all':!![]}];}return db[_0x2daf('0x2e')][_0x2daf('0x44')](_0x1a6a30);})[_0x2daf('0x25')](function(_0x351346){_0x1b8d43[_0x2daf('0x45')]=_0x351346;return _0x1b8d43;})[_0x2daf('0x25')](respondWithFilteredResult(_0x527f34,_0x1a6a30))[_0x2daf('0x46')](handleError(_0x527f34,null));};exports['show']=function(_0x1f006d,_0x5b3038){var _0x40df9e={'raw':![],'where':{'id':_0x1f006d[_0x2daf('0x47')]['id']}},_0xcc219f={};_0xcc219f[_0x2daf('0x37')]=_[_0x2daf('0x34')](db[_0x2daf('0x2e')]['rawAttributes']);_0xcc219f[_0x2daf('0x33')]=_[_0x2daf('0x34')](_0x1f006d[_0x2daf('0x33')]);_0xcc219f['filters']=_[_0x2daf('0x36')](_0xcc219f[_0x2daf('0x37')],_0xcc219f['query']);_0x40df9e['attributes']=_['intersection'](_0xcc219f[_0x2daf('0x37')],qs[_0x2daf('0x38')](_0x1f006d['query'][_0x2daf('0x38')]));_0x40df9e[_0x2daf('0x39')]=_0x40df9e['attributes'][_0x2daf('0x48')]?_0x40df9e[_0x2daf('0x39')]:_0xcc219f[_0x2daf('0x37')];if(_0x1f006d['query'][_0x2daf('0x42')]){_0x40df9e['include']=[{'all':!![]}];}_0x40df9e=_[_0x2daf('0x40')]({},_0x40df9e,_0x1f006d[_0x2daf('0x49')]);return db[_0x2daf('0x2e')][_0x2daf('0x4a')](_0x40df9e)[_0x2daf('0x25')](handleEntityNotFound(_0x5b3038,null))['then'](respondWithResult(_0x5b3038,null))[_0x2daf('0x46')](handleError(_0x5b3038,null));};exports[_0x2daf('0x4b')]=function(_0x1d80b8,_0x5ad21b){return db[_0x2daf('0x2e')][_0x2daf('0x4b')](_0x1d80b8[_0x2daf('0x4c')],{})[_0x2daf('0x25')](function(_0x49cfd8){var _0x1b175e=_0x1d80b8[_0x2daf('0x4d')][_0x2daf('0x26')]({'plain':!![]});if(!_0x1b175e)throw new Error(_0x2daf('0x4e'));if(_0x1b175e[_0x2daf('0x4f')]===_0x2daf('0x4d')){var _0x27ff9c=_0x49cfd8['get']({'plain':!![]});var _0x986d4=_0x2daf('0x27');return db['UserProfileSection'][_0x2daf('0x4a')]({'where':{'name':_0x986d4,'userProfileId':_0x1b175e[_0x2daf('0x50')]},'raw':!![]})[_0x2daf('0x25')](function(_0xade194){if(_0xade194&&_0xade194['autoAssociation']===0x0){return db[_0x2daf('0x28')][_0x2daf('0x4b')]({'name':_0x27ff9c['name'],'resourceId':_0x27ff9c['id'],'type':_0xade194[_0x2daf('0x2b')],'sectionId':_0xade194['id']},{})[_0x2daf('0x25')](function(){return _0x49cfd8;});}else{return _0x49cfd8;}})[_0x2daf('0x46')](function(_0xa33f72){logger[_0x2daf('0x2a')](_0x2daf('0x51'),_0xa33f72);throw _0xa33f72;});}return _0x49cfd8;})['then'](respondWithResult(_0x5ad21b,0xc9))[_0x2daf('0x46')](handleError(_0x5ad21b,null));};exports[_0x2daf('0x52')]=function(_0x191fdd,_0x5c969f){var _0x5e9317={'where':{'id':_0x191fdd[_0x2daf('0x47')]['id']}},_0x12bab3={};_0x12bab3[_0x2daf('0x37')]=_[_0x2daf('0x34')](db[_0x2daf('0x2e')]['rawAttributes']);_0x5e9317[_0x2daf('0x39')]=_[_0x2daf('0x36')](_0x12bab3[_0x2daf('0x37')],qs[_0x2daf('0x38')](_0x191fdd[_0x2daf('0x33')][_0x2daf('0x38')]));_0x5e9317['attributes']=_0x5e9317[_0x2daf('0x39')][_0x2daf('0x48')]?_0x5e9317['attributes']:_0x12bab3['model'];if(_0x191fdd[_0x2daf('0x33')][_0x2daf('0x42')]){_0x5e9317['include']=[{'all':!![]}];}_0x5e9317=_[_0x2daf('0x40')]({},_0x5e9317,_0x191fdd[_0x2daf('0x49')]);return db[_0x2daf('0x2e')]['find'](_0x5e9317)[_0x2daf('0x25')](handleEntityNotFound(_0x5c969f,null))[_0x2daf('0x25')](function(_0x4e2d92){if(_0x4e2d92){var _0x37f1d5=_0x4e2d92['get']({'plain':!![]});_0x37f1d5=qs[_0x2daf('0x53')](_0x37f1d5,['id',_0x2daf('0x54'),_0x2daf('0x55')]);_0x191fdd[_0x2daf('0x4c')]=_[_0x2daf('0x53')](_0x191fdd[_0x2daf('0x4c')],['id','createdAt','updatedAt']);return db[_0x2daf('0x2e')]['create'](_[_0x2daf('0x40')](_0x37f1d5,_0x191fdd[_0x2daf('0x4c')]),{'include':_0x191fdd[_0x2daf('0x33')][_0x2daf('0x42')]?[{'all':!![]}]:undefined})[_0x2daf('0x25')](function(_0x1515c7){var _0x8c4b1f=_0x191fdd[_0x2daf('0x4d')][_0x2daf('0x26')]({'plain':!![]});if(!_0x8c4b1f)throw new Error(_0x2daf('0x4e'));if(_0x8c4b1f['role']===_0x2daf('0x4d')){var _0x47288e=_0x1515c7[_0x2daf('0x26')]({'plain':!![]});var _0x44e936=_0x2daf('0x27');return db[_0x2daf('0x56')][_0x2daf('0x4a')]({'where':{'name':_0x44e936,'userProfileId':_0x8c4b1f[_0x2daf('0x50')]},'raw':!![]})[_0x2daf('0x25')](function(_0x3c8d22){if(_0x3c8d22&&_0x3c8d22[_0x2daf('0x57')]===0x0){return db[_0x2daf('0x28')][_0x2daf('0x4b')]({'name':_0x47288e[_0x2daf('0x2b')],'resourceId':_0x47288e['id'],'type':_0x3c8d22[_0x2daf('0x2b')],'sectionId':_0x3c8d22['id']},{})[_0x2daf('0x25')](function(){return _0x1515c7;});}else{return _0x1515c7;}})[_0x2daf('0x46')](function(_0x583d2e){logger[_0x2daf('0x2a')](_0x2daf('0x51'),_0x583d2e);throw _0x583d2e;});}return _0x1515c7;});}})['then'](respondWithResult(_0x5c969f,0xc9))[_0x2daf('0x46')](handleError(_0x5c969f,null));};exports[_0x2daf('0x23')]=function(_0x478351,_0x105e0d){if(_0x478351[_0x2daf('0x4c')]['id']){delete _0x478351['body']['id'];}return db[_0x2daf('0x2e')][_0x2daf('0x4a')]({'where':{'id':_0x478351[_0x2daf('0x47')]['id']}})[_0x2daf('0x25')](handleEntityNotFound(_0x105e0d,null))['then'](saveUpdates(_0x478351['body'],null))[_0x2daf('0x25')](respondWithResult(_0x105e0d,null))['catch'](handleError(_0x105e0d,null));};exports[_0x2daf('0x24')]=function(_0x1f5b8e,_0x597975){return db[_0x2daf('0x2e')][_0x2daf('0x4a')]({'where':{'id':_0x1f5b8e[_0x2daf('0x47')]['id']}})[_0x2daf('0x25')](handleEntityNotFound(_0x597975,null))[_0x2daf('0x25')](removeEntity(_0x597975,null))['catch'](handleError(_0x597975,null));};function widgetAttributes(_0x446736){try{switch(_0x446736[_0x2daf('0x31')]){case _0x2daf('0x58'):return[{'name':_0x2daf('0x59'),'value':_0x446736['attrUrl']||(_0x446736[_0x2daf('0x5a')]&&_0x446736[_0x2daf('0x5a')][0x0]?_0x446736['attrs'][0x0][_0x2daf('0x5b')]:undefined)||_0x2daf('0x5c')}];case _0x2daf('0x5d'):return[{'name':'attrPath','value':_0x446736[_0x2daf('0x5e')]||(_0x446736[_0x2daf('0x5a')]&&_0x446736['attrs'][0x0]?_0x446736[_0x2daf('0x5a')][0x0][_0x2daf('0x5b')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x446736['attrHourFormat']||(_0x446736[_0x2daf('0x5a')]&&_0x446736[_0x2daf('0x5a')][0x0]?_0x446736[_0x2daf('0x5a')][0x0][_0x2daf('0x5b')]:undefined)||_0x2daf('0x5f')},{'name':_0x2daf('0x60'),'value':_0x446736[_0x2daf('0x60')]||(_0x446736[_0x2daf('0x5a')]&&_0x446736[_0x2daf('0x5a')][0x1]?_0x446736[_0x2daf('0x5a')][0x1][_0x2daf('0x5b')]:undefined)||_0x2daf('0x61')},{'name':_0x2daf('0x62'),'value':_0x446736[_0x2daf('0x62')]||(_0x446736[_0x2daf('0x5a')]&&_0x446736[_0x2daf('0x5a')][0x2]?_0x446736[_0x2daf('0x5a')][0x2][_0x2daf('0x5b')]:undefined)||0xc}];case _0x2daf('0x63'):return[{'name':_0x2daf('0x64'),'value':_0x446736[_0x2daf('0x64')]||(_0x446736[_0x2daf('0x5a')]&&_0x446736['attrs'][0x0]?_0x446736[_0x2daf('0x5a')][0x0]['value']:undefined)||_0x2daf('0x65')},{'name':_0x2daf('0x66'),'value':_0x446736[_0x2daf('0x66')]||(_0x446736[_0x2daf('0x5a')]&&_0x446736[_0x2daf('0x5a')][0x1]?_0x446736['attrs'][0x1][_0x2daf('0x5b')]:undefined)||[]},{'name':_0x2daf('0x62'),'value':_0x446736[_0x2daf('0x62')]||(_0x446736[_0x2daf('0x5a')]&&_0x446736[_0x2daf('0x5a')][0x2]?_0x446736[_0x2daf('0x5a')][0x2][_0x2daf('0x5b')]:undefined)||0x14}];case _0x2daf('0x67'):case _0x2daf('0x68'):return[{'name':_0x2daf('0x69'),'value':_0x446736[_0x2daf('0x69')]||(_0x446736[_0x2daf('0x5a')]&&_0x446736['attrs'][0x0]?_0x446736[_0x2daf('0x5a')][0x0][_0x2daf('0x5b')]:undefined)||_0x2daf('0x65')},{'name':_0x2daf('0x6a'),'value':_0x446736['attrSerie2']||(_0x446736[_0x2daf('0x5a')]&&_0x446736['attrs'][0x1]?_0x446736['attrs'][0x1][_0x2daf('0x5b')]:undefined)||null},{'name':_0x2daf('0x6b'),'value':_0x446736[_0x2daf('0x6b')]||(_0x446736[_0x2daf('0x5a')]&&_0x446736[_0x2daf('0x5a')][0x2]?_0x446736[_0x2daf('0x5a')][0x2][_0x2daf('0x5b')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x446736[_0x2daf('0x66')]||(_0x446736[_0x2daf('0x5a')]&&_0x446736[_0x2daf('0x5a')][0x3]?_0x446736[_0x2daf('0x5a')][0x3]['value']:undefined)||[]}];case _0x2daf('0x6c'):return[{'name':_0x2daf('0x6d'),'type':_0x446736['reportType']||(_0x446736[_0x2daf('0x5a')]&&_0x446736[_0x2daf('0x5a')][0x0]?_0x446736[_0x2daf('0x5a')][0x0][_0x2daf('0x31')]:undefined)||null,'value':_0x446736[_0x2daf('0x6d')]||(_0x446736[_0x2daf('0x5a')]&&_0x446736['attrs'][0x0]?_0x446736[_0x2daf('0x5a')][0x0][_0x2daf('0x5b')]:undefined)||null},{'name':_0x2daf('0x6e'),'value':_0x446736[_0x2daf('0x6e')]||(_0x446736[_0x2daf('0x5a')]&&_0x446736[_0x2daf('0x5a')][0x1]?_0x446736[_0x2daf('0x5a')][0x1][_0x2daf('0x5b')]:undefined)||0x0}];default:return[];}}catch(_0x28bb07){logger[_0x2daf('0x2a')]('widgetAttributes:\x20%s',JSON[_0x2daf('0x6f')](_0x28bb07));return[];}}exports['addItem']=function(_0x56d0cb,_0x8f1a42,_0x56236a){if(_0x56d0cb[_0x2daf('0x4c')]['id']){delete _0x56d0cb['body']['id'];}return db[_0x2daf('0x2e')]['find']({'where':{'id':_0x56d0cb['params']['id']}})[_0x2daf('0x25')](handleEntityNotFound(_0x8f1a42,null))[_0x2daf('0x25')](function(_0x51f543){if(_0x51f543){_0x56d0cb[_0x2daf('0x4c')][_0x2daf('0x70')]=_0x51f543['id'];_0x56d0cb[_0x2daf('0x4c')]['attrs']=widgetAttributes(_0x56d0cb[_0x2daf('0x4c')]);return db['DashboardItem']['create'](_0x56d0cb[_0x2daf('0x4c')]);}})[_0x2daf('0x25')](respondWithResult(_0x8f1a42,null))['catch'](handleError(_0x8f1a42,null));};exports[_0x2daf('0x71')]=function(_0x1e715b,_0x4c98c0,_0x5455c7){var _0x5dc938={};var _0x33045b={};var _0x1dbcda;var _0x40f550;return db['Dashboard'][_0x2daf('0x72')]({'where':{'id':_0x1e715b[_0x2daf('0x47')]['id']}})[_0x2daf('0x25')](handleEntityNotFound(_0x4c98c0,null))[_0x2daf('0x25')](function(_0x5235b9){if(_0x5235b9){_0x1dbcda=_0x5235b9;_0x33045b[_0x2daf('0x37')]=_[_0x2daf('0x34')](db[_0x2daf('0x73')][_0x2daf('0x2f')]);_0x33045b[_0x2daf('0x33')]=_[_0x2daf('0x34')](_0x1e715b[_0x2daf('0x33')]);_0x33045b[_0x2daf('0x35')]=_[_0x2daf('0x36')](_0x33045b[_0x2daf('0x37')],_0x33045b['query']);_0x5dc938[_0x2daf('0x39')]=_[_0x2daf('0x36')](_0x33045b[_0x2daf('0x37')],qs['fields'](_0x1e715b['query'][_0x2daf('0x38')]));_0x5dc938[_0x2daf('0x39')]=_0x5dc938['attributes'][_0x2daf('0x48')]?_0x5dc938['attributes']:_0x33045b['model'];_0x5dc938['order']=qs[_0x2daf('0x3d')](_0x1e715b['query']['sort']);_0x5dc938['where']=qs[_0x2daf('0x35')](_['pick'](_0x1e715b['query'],_0x33045b[_0x2daf('0x35')]));if(_0x1e715b[_0x2daf('0x33')][_0x2daf('0x3f')]){_0x5dc938[_0x2daf('0x3e')]=_[_0x2daf('0x40')](_0x5dc938['where'],{'$or':_['map'](_0x5dc938[_0x2daf('0x39')],function(_0x184100){var _0x3573c8={};_0x3573c8[_0x184100]={'$like':'%'+_0x1e715b[_0x2daf('0x33')][_0x2daf('0x3f')]+'%'};return _0x3573c8;})});}_0x5dc938=_[_0x2daf('0x40')]({},_0x5dc938,_0x1e715b[_0x2daf('0x49')]);return _0x1dbcda[_0x2daf('0x71')](_0x5dc938);}})['then'](function(_0x4a4438){if(_0x4a4438){_0x40f550=_0x4a4438['length'];if(!_0x1e715b[_0x2daf('0x33')][_0x2daf('0x3a')](_0x2daf('0x3b'))){_0x5dc938['limit']=qs[_0x2daf('0x1d')](_0x1e715b[_0x2daf('0x33')][_0x2daf('0x1d')]);_0x5dc938['offset']=qs[_0x2daf('0x20')](_0x1e715b[_0x2daf('0x33')][_0x2daf('0x20')]);}return _0x1dbcda[_0x2daf('0x71')](_0x5dc938);}})[_0x2daf('0x25')](function(_0x2c031e){if(_0x2c031e){return _0x2c031e?{'count':_0x40f550,'rows':_0x2c031e}:null;}})[_0x2daf('0x25')](respondWithResult(_0x4c98c0,null))[_0x2daf('0x46')](handleError(_0x4c98c0,null));}; \ No newline at end of file +var _0x95e7=['autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','iframe','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','getItems','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/license/util','redis','defaults','./dashboard.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','Dashboard','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','find','create','body','user','UserProfileSection','userProfileId'];(function(_0xf6227e,_0xa582e3){var _0x5beb5d=function(_0x2f8d75){while(--_0x2f8d75){_0xf6227e['push'](_0xf6227e['shift']());}};_0x5beb5d(++_0xa582e3);}(_0x95e7,0xa1));var _0x795e=function(_0x176acf,_0x48962b){_0x176acf=_0x176acf-0x0;var _0x452af8=_0x95e7[_0x176acf];return _0x452af8;};'use strict';var emlformat=require(_0x795e('0x0'));var rimraf=require(_0x795e('0x1'));var zipdir=require(_0x795e('0x2'));var jsonpatch=require(_0x795e('0x3'));var rp=require('request-promise');var moment=require(_0x795e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x795e('0x5'));var sox=require(_0x795e('0x6'));var csv=require(_0x795e('0x7'));var ejs=require(_0x795e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x795e('0x9'));var squel=require(_0x795e('0xa'));var crypto=require(_0x795e('0xb'));var jsforce=require(_0x795e('0xc'));var deskjs=require(_0x795e('0xd'));var toCsv=require(_0x795e('0x7'));var querystring=require('querystring');var Papa=require(_0x795e('0xe'));var Redis=require(_0x795e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x795e('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x795e('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x795e('0x12'));var db=require('../../mysqldb')['db'];config[_0x795e('0x13')]=_[_0x795e('0x14')](config[_0x795e('0x13')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x795e('0x15'))[_0x795e('0x16')](socket);function respondWithStatusCode(_0x78837c,_0x3c510f){_0x3c510f=_0x3c510f||0xcc;return function(_0x435221){if(_0x435221){return _0x78837c[_0x795e('0x17')](_0x3c510f);}return _0x78837c[_0x795e('0x18')](_0x3c510f)[_0x795e('0x19')]();};}function respondWithResult(_0x1ac04e,_0x4d9748){_0x4d9748=_0x4d9748||0xc8;return function(_0x161132){if(_0x161132){return _0x1ac04e[_0x795e('0x18')](_0x4d9748)[_0x795e('0x1a')](_0x161132);}};}function respondWithFilteredResult(_0xaaabc5,_0x45a1b1){return function(_0x382e54){if(_0x382e54){var _0x2208aa=typeof _0x45a1b1[_0x795e('0x1b')]==='undefined'&&typeof _0x45a1b1[_0x795e('0x1c')]===_0x795e('0x1d');var _0x284837=_0x382e54['count'];var _0x368b30=_0x2208aa?0x0:_0x45a1b1[_0x795e('0x1b')];var _0x34c903=_0x2208aa?_0x382e54[_0x795e('0x1e')]:_0x45a1b1[_0x795e('0x1b')]+_0x45a1b1['limit'];var _0x3e3888;if(_0x34c903>=_0x284837){_0x34c903=_0x284837;_0x3e3888=0xc8;}else{_0x3e3888=0xce;}_0xaaabc5['status'](_0x3e3888);return _0xaaabc5[_0x795e('0x1f')](_0x795e('0x20'),_0x368b30+'-'+_0x34c903+'/'+_0x284837)[_0x795e('0x1a')](_0x382e54);}return null;};}function patchUpdates(_0x1baae2){return function(_0x4ca138){try{jsonpatch[_0x795e('0x21')](_0x4ca138,_0x1baae2,!![]);}catch(_0x1f1426){return BPromise[_0x795e('0x22')](_0x1f1426);}return _0x4ca138[_0x795e('0x23')]();};}function saveUpdates(_0x3e7ef8,_0x5e1744){return function(_0x2d8760){if(_0x2d8760){return _0x2d8760[_0x795e('0x24')](_0x3e7ef8)[_0x795e('0x25')](function(_0x496e71){return _0x496e71;});}return null;};}function removeEntity(_0x3c0145,_0x95e764){return function(_0x598a62){if(_0x598a62){return _0x598a62[_0x795e('0x26')]()['then'](function(){var _0x54f541=_0x598a62[_0x795e('0x27')]({'plain':!![]});var _0x4c1b75='CustomDashboards';return db[_0x795e('0x28')][_0x795e('0x26')]({'where':{'type':_0x4c1b75,'resourceId':_0x54f541['id']}})['then'](function(){return _0x598a62;});})[_0x795e('0x25')](function(){_0x3c0145[_0x795e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e396a,_0xd886b3){return function(_0x3de425){if(!_0x3de425){_0x5e396a[_0x795e('0x17')](0x194);}return _0x3de425;};}function handleError(_0x449f0f,_0x1ee047){_0x1ee047=_0x1ee047||0x1f4;return function(_0x9d3528){logger['error'](_0x9d3528[_0x795e('0x29')]);if(_0x9d3528[_0x795e('0x2a')]){delete _0x9d3528[_0x795e('0x2a')];}_0x449f0f[_0x795e('0x18')](_0x1ee047)[_0x795e('0x2b')](_0x9d3528);};}exports[_0x795e('0x2c')]=function(_0x481035,_0x594773){var _0x2ee759={},_0x5a6a88={},_0x2f4d3a={'count':0x0,'rows':[]};var _0x56c402=_[_0x795e('0x2d')](db[_0x795e('0x2e')][_0x795e('0x2f')],function(_0x4c5699){return{'name':_0x4c5699['fieldName'],'type':_0x4c5699['type'][_0x795e('0x30')]};});_0x5a6a88[_0x795e('0x31')]=_[_0x795e('0x2d')](_0x56c402,_0x795e('0x2a'));_0x5a6a88[_0x795e('0x32')]=_[_0x795e('0x33')](_0x481035['query']);_0x5a6a88[_0x795e('0x34')]=_[_0x795e('0x35')](_0x5a6a88[_0x795e('0x31')],_0x5a6a88[_0x795e('0x32')]);_0x2ee759['attributes']=_[_0x795e('0x35')](_0x5a6a88[_0x795e('0x31')],qs[_0x795e('0x36')](_0x481035[_0x795e('0x32')][_0x795e('0x36')]));_0x2ee759[_0x795e('0x37')]=_0x2ee759[_0x795e('0x37')][_0x795e('0x38')]?_0x2ee759['attributes']:_0x5a6a88['model'];if(!_0x481035[_0x795e('0x32')][_0x795e('0x39')](_0x795e('0x3a'))){_0x2ee759[_0x795e('0x1c')]=qs[_0x795e('0x1c')](_0x481035[_0x795e('0x32')][_0x795e('0x1c')]);_0x2ee759[_0x795e('0x1b')]=qs[_0x795e('0x1b')](_0x481035[_0x795e('0x32')]['offset']);}_0x2ee759[_0x795e('0x3b')]=qs['sort'](_0x481035['query'][_0x795e('0x3c')]);_0x2ee759[_0x795e('0x3d')]=qs[_0x795e('0x34')](_[_0x795e('0x3e')](_0x481035['query'],_0x5a6a88[_0x795e('0x34')]),_0x56c402);if(_0x481035[_0x795e('0x32')][_0x795e('0x3f')]){_0x2ee759['where']=_['merge'](_0x2ee759['where'],{'$or':_['map'](_0x56c402,function(_0x1fdde0){if(_0x1fdde0[_0x795e('0x40')]!==_0x795e('0x41')){var _0xb257ab={};_0xb257ab[_0x1fdde0['name']]={'$like':'%'+_0x481035[_0x795e('0x32')][_0x795e('0x3f')]+'%'};return _0xb257ab;}})});}_0x2ee759=_[_0x795e('0x42')]({},_0x2ee759,_0x481035[_0x795e('0x43')]);var _0x269a9d={'where':_0x2ee759[_0x795e('0x3d')]};return db['Dashboard']['count'](_0x269a9d)[_0x795e('0x25')](function(_0x250730){_0x2f4d3a[_0x795e('0x1e')]=_0x250730;if(_0x481035[_0x795e('0x32')][_0x795e('0x44')]){_0x2ee759['include']=[{'all':!![]}];}return db[_0x795e('0x2e')][_0x795e('0x45')](_0x2ee759);})['then'](function(_0x21b737){_0x2f4d3a[_0x795e('0x46')]=_0x21b737;return _0x2f4d3a;})['then'](respondWithFilteredResult(_0x594773,_0x2ee759))['catch'](handleError(_0x594773,null));};exports[_0x795e('0x47')]=function(_0x4024fd,_0x5a8ef3){var _0x41ad53={'raw':![],'where':{'id':_0x4024fd[_0x795e('0x48')]['id']}},_0x9fde8b={};_0x9fde8b[_0x795e('0x31')]=_[_0x795e('0x33')](db['Dashboard'][_0x795e('0x2f')]);_0x9fde8b[_0x795e('0x32')]=_[_0x795e('0x33')](_0x4024fd[_0x795e('0x32')]);_0x9fde8b[_0x795e('0x34')]=_[_0x795e('0x35')](_0x9fde8b[_0x795e('0x31')],_0x9fde8b[_0x795e('0x32')]);_0x41ad53[_0x795e('0x37')]=_['intersection'](_0x9fde8b['model'],qs[_0x795e('0x36')](_0x4024fd['query'][_0x795e('0x36')]));_0x41ad53['attributes']=_0x41ad53[_0x795e('0x37')][_0x795e('0x38')]?_0x41ad53[_0x795e('0x37')]:_0x9fde8b[_0x795e('0x31')];if(_0x4024fd[_0x795e('0x32')][_0x795e('0x44')]){_0x41ad53['include']=[{'all':!![]}];}_0x41ad53=_['merge']({},_0x41ad53,_0x4024fd['options']);return db[_0x795e('0x2e')][_0x795e('0x49')](_0x41ad53)[_0x795e('0x25')](handleEntityNotFound(_0x5a8ef3,null))[_0x795e('0x25')](respondWithResult(_0x5a8ef3,null))['catch'](handleError(_0x5a8ef3,null));};exports['create']=function(_0x1765c0,_0x37fd55){return db[_0x795e('0x2e')][_0x795e('0x4a')](_0x1765c0[_0x795e('0x4b')],{})['then'](function(_0x38b5f5){var _0x3e8329=_0x1765c0[_0x795e('0x4c')]['get']({'plain':!![]});if(!_0x3e8329)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e8329['role']==='user'){var _0x2bc92d=_0x38b5f5[_0x795e('0x27')]({'plain':!![]});var _0x1fe252='CustomDashboards';return db[_0x795e('0x4d')][_0x795e('0x49')]({'where':{'name':_0x1fe252,'userProfileId':_0x3e8329[_0x795e('0x4e')]},'raw':!![]})[_0x795e('0x25')](function(_0x5e40c6){if(_0x5e40c6&&_0x5e40c6[_0x795e('0x4f')]===0x0){return db['UserProfileResource'][_0x795e('0x4a')]({'name':_0x2bc92d[_0x795e('0x2a')],'resourceId':_0x2bc92d['id'],'type':_0x5e40c6[_0x795e('0x2a')],'sectionId':_0x5e40c6['id']},{})[_0x795e('0x25')](function(){return _0x38b5f5;});}else{return _0x38b5f5;}})[_0x795e('0x50')](function(_0x1e19cf){logger[_0x795e('0x51')](_0x795e('0x52'),_0x1e19cf);throw _0x1e19cf;});}return _0x38b5f5;})[_0x795e('0x25')](respondWithResult(_0x37fd55,0xc9))[_0x795e('0x50')](handleError(_0x37fd55,null));};exports[_0x795e('0x53')]=function(_0x41daa9,_0x124646){var _0x200f16={'where':{'id':_0x41daa9[_0x795e('0x48')]['id']}},_0xacccf8={};_0xacccf8[_0x795e('0x31')]=_['keys'](db[_0x795e('0x2e')][_0x795e('0x2f')]);_0x200f16[_0x795e('0x37')]=_[_0x795e('0x35')](_0xacccf8['model'],qs[_0x795e('0x36')](_0x41daa9[_0x795e('0x32')][_0x795e('0x36')]));_0x200f16[_0x795e('0x37')]=_0x200f16[_0x795e('0x37')][_0x795e('0x38')]?_0x200f16[_0x795e('0x37')]:_0xacccf8[_0x795e('0x31')];if(_0x41daa9['query'][_0x795e('0x44')]){_0x200f16[_0x795e('0x54')]=[{'all':!![]}];}_0x200f16=_[_0x795e('0x42')]({},_0x200f16,_0x41daa9['options']);return db[_0x795e('0x2e')][_0x795e('0x49')](_0x200f16)[_0x795e('0x25')](handleEntityNotFound(_0x124646,null))['then'](function(_0xe65546){if(_0xe65546){var _0x4cac0d=_0xe65546['get']({'plain':!![]});_0x4cac0d=qs[_0x795e('0x55')](_0x4cac0d,['id',_0x795e('0x56'),_0x795e('0x57')]);_0x41daa9[_0x795e('0x4b')]=_[_0x795e('0x55')](_0x41daa9[_0x795e('0x4b')],['id','createdAt','updatedAt']);return db[_0x795e('0x2e')]['create'](_[_0x795e('0x42')](_0x4cac0d,_0x41daa9[_0x795e('0x4b')]),{'include':_0x41daa9[_0x795e('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0x795e('0x25')](function(_0x9b9391){var _0x47ca8f=_0x41daa9[_0x795e('0x4c')][_0x795e('0x27')]({'plain':!![]});if(!_0x47ca8f)throw new Error(_0x795e('0x58'));if(_0x47ca8f[_0x795e('0x59')]==='user'){var _0x413c4d=_0x9b9391['get']({'plain':!![]});var _0x1b2f14=_0x795e('0x5a');return db[_0x795e('0x4d')][_0x795e('0x49')]({'where':{'name':_0x1b2f14,'userProfileId':_0x47ca8f['userProfileId']},'raw':!![]})[_0x795e('0x25')](function(_0x1fa16a){if(_0x1fa16a&&_0x1fa16a[_0x795e('0x4f')]===0x0){return db[_0x795e('0x28')][_0x795e('0x4a')]({'name':_0x413c4d['name'],'resourceId':_0x413c4d['id'],'type':_0x1fa16a[_0x795e('0x2a')],'sectionId':_0x1fa16a['id']},{})[_0x795e('0x25')](function(){return _0x9b9391;});}else{return _0x9b9391;}})[_0x795e('0x50')](function(_0x9098a6){logger['error'](_0x795e('0x52'),_0x9098a6);throw _0x9098a6;});}return _0x9b9391;});}})['then'](respondWithResult(_0x124646,0xc9))['catch'](handleError(_0x124646,null));};exports[_0x795e('0x24')]=function(_0x151419,_0x5d97f7){if(_0x151419[_0x795e('0x4b')]['id']){delete _0x151419[_0x795e('0x4b')]['id'];}return db[_0x795e('0x2e')][_0x795e('0x49')]({'where':{'id':_0x151419[_0x795e('0x48')]['id']}})['then'](handleEntityNotFound(_0x5d97f7,null))[_0x795e('0x25')](saveUpdates(_0x151419['body'],null))[_0x795e('0x25')](respondWithResult(_0x5d97f7,null))[_0x795e('0x50')](handleError(_0x5d97f7,null));};exports[_0x795e('0x26')]=function(_0x41ffd7,_0x594e3a){return db['Dashboard'][_0x795e('0x49')]({'where':{'id':_0x41ffd7['params']['id']}})[_0x795e('0x25')](handleEntityNotFound(_0x594e3a,null))[_0x795e('0x25')](removeEntity(_0x594e3a,null))[_0x795e('0x50')](handleError(_0x594e3a,null));};function widgetAttributes(_0x5d0e59){try{switch(_0x5d0e59[_0x795e('0x40')]){case _0x795e('0x5b'):return[{'name':_0x795e('0x5c'),'value':_0x5d0e59[_0x795e('0x5c')]||(_0x5d0e59['attrs']&&_0x5d0e59[_0x795e('0x5d')][0x0]?_0x5d0e59[_0x795e('0x5d')][0x0]['value']:undefined)||_0x795e('0x5e')}];case'custom':return[{'name':_0x795e('0x5f'),'value':_0x5d0e59[_0x795e('0x5f')]||(_0x5d0e59['attrs']&&_0x5d0e59['attrs'][0x0]?_0x5d0e59[_0x795e('0x5d')][0x0][_0x795e('0x60')]:undefined)||''}];case _0x795e('0x61'):return[{'name':_0x795e('0x62'),'value':_0x5d0e59[_0x795e('0x62')]||(_0x5d0e59[_0x795e('0x5d')]&&_0x5d0e59[_0x795e('0x5d')][0x0]?_0x5d0e59[_0x795e('0x5d')][0x0][_0x795e('0x60')]:undefined)||_0x795e('0x63')},{'name':_0x795e('0x64'),'value':_0x5d0e59['attrTimezone']||(_0x5d0e59[_0x795e('0x5d')]&&_0x5d0e59[_0x795e('0x5d')][0x1]?_0x5d0e59[_0x795e('0x5d')][0x1][_0x795e('0x60')]:undefined)||_0x795e('0x65')},{'name':_0x795e('0x66'),'value':_0x5d0e59[_0x795e('0x66')]||(_0x5d0e59[_0x795e('0x5d')]&&_0x5d0e59[_0x795e('0x5d')][0x2]?_0x5d0e59[_0x795e('0x5d')][0x2][_0x795e('0x60')]:undefined)||0xc}];case _0x795e('0x67'):return[{'name':'attrMetric','value':_0x5d0e59[_0x795e('0x68')]||(_0x5d0e59[_0x795e('0x5d')]&&_0x5d0e59['attrs'][0x0]?_0x5d0e59[_0x795e('0x5d')][0x0][_0x795e('0x60')]:undefined)||'total'},{'name':_0x795e('0x69'),'value':_0x5d0e59[_0x795e('0x69')]||(_0x5d0e59[_0x795e('0x5d')]&&_0x5d0e59['attrs'][0x1]?_0x5d0e59['attrs'][0x1][_0x795e('0x60')]:undefined)||[]},{'name':_0x795e('0x66'),'value':_0x5d0e59[_0x795e('0x66')]||(_0x5d0e59[_0x795e('0x5d')]&&_0x5d0e59[_0x795e('0x5d')][0x2]?_0x5d0e59[_0x795e('0x5d')][0x2][_0x795e('0x60')]:undefined)||0x14}];case _0x795e('0x6a'):case'pie-chart':return[{'name':_0x795e('0x6b'),'value':_0x5d0e59[_0x795e('0x6b')]||(_0x5d0e59[_0x795e('0x5d')]&&_0x5d0e59[_0x795e('0x5d')][0x0]?_0x5d0e59[_0x795e('0x5d')][0x0][_0x795e('0x60')]:undefined)||'total'},{'name':_0x795e('0x6c'),'value':_0x5d0e59[_0x795e('0x6c')]||(_0x5d0e59[_0x795e('0x5d')]&&_0x5d0e59['attrs'][0x1]?_0x5d0e59[_0x795e('0x5d')][0x1][_0x795e('0x60')]:undefined)||null},{'name':'attrSerie3','value':_0x5d0e59[_0x795e('0x6d')]||(_0x5d0e59[_0x795e('0x5d')]&&_0x5d0e59[_0x795e('0x5d')][0x2]?_0x5d0e59[_0x795e('0x5d')][0x2]['value']:undefined)||null},{'name':_0x795e('0x69'),'value':_0x5d0e59[_0x795e('0x69')]||(_0x5d0e59[_0x795e('0x5d')]&&_0x5d0e59[_0x795e('0x5d')][0x3]?_0x5d0e59[_0x795e('0x5d')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':_0x795e('0x6e'),'type':_0x5d0e59[_0x795e('0x6f')]||(_0x5d0e59[_0x795e('0x5d')]&&_0x5d0e59[_0x795e('0x5d')][0x0]?_0x5d0e59[_0x795e('0x5d')][0x0][_0x795e('0x40')]:undefined)||null,'value':_0x5d0e59['attrReport']||(_0x5d0e59[_0x795e('0x5d')]&&_0x5d0e59[_0x795e('0x5d')][0x0]?_0x5d0e59[_0x795e('0x5d')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x5d0e59[_0x795e('0x70')]||(_0x5d0e59['attrs']&&_0x5d0e59[_0x795e('0x5d')][0x1]?_0x5d0e59['attrs'][0x1][_0x795e('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x2947b3){logger[_0x795e('0x51')](_0x795e('0x71'),JSON[_0x795e('0x72')](_0x2947b3));return[];}}exports[_0x795e('0x73')]=function(_0x5bf737,_0x4d40c8,_0x605ade){if(_0x5bf737[_0x795e('0x4b')]['id']){delete _0x5bf737[_0x795e('0x4b')]['id'];}return db[_0x795e('0x2e')][_0x795e('0x49')]({'where':{'id':_0x5bf737[_0x795e('0x48')]['id']}})[_0x795e('0x25')](handleEntityNotFound(_0x4d40c8,null))['then'](function(_0x549551){if(_0x549551){_0x5bf737['body'][_0x795e('0x74')]=_0x549551['id'];_0x5bf737[_0x795e('0x4b')]['attrs']=widgetAttributes(_0x5bf737[_0x795e('0x4b')]);return db[_0x795e('0x75')][_0x795e('0x4a')](_0x5bf737[_0x795e('0x4b')]);}})[_0x795e('0x25')](respondWithResult(_0x4d40c8,null))[_0x795e('0x50')](handleError(_0x4d40c8,null));};exports['getItems']=function(_0x302657,_0x182acb,_0x47fb02){var _0x4a5cab={};var _0xe0bda3={};var _0x455d5d;var _0x3e5c90;return db[_0x795e('0x2e')][_0x795e('0x76')]({'where':{'id':_0x302657[_0x795e('0x48')]['id']}})[_0x795e('0x25')](handleEntityNotFound(_0x182acb,null))[_0x795e('0x25')](function(_0x65e9e3){if(_0x65e9e3){_0x455d5d=_0x65e9e3;_0xe0bda3[_0x795e('0x31')]=_[_0x795e('0x33')](db[_0x795e('0x75')]['rawAttributes']);_0xe0bda3[_0x795e('0x32')]=_[_0x795e('0x33')](_0x302657[_0x795e('0x32')]);_0xe0bda3[_0x795e('0x34')]=_[_0x795e('0x35')](_0xe0bda3['model'],_0xe0bda3[_0x795e('0x32')]);_0x4a5cab['attributes']=_[_0x795e('0x35')](_0xe0bda3[_0x795e('0x31')],qs[_0x795e('0x36')](_0x302657[_0x795e('0x32')]['fields']));_0x4a5cab[_0x795e('0x37')]=_0x4a5cab[_0x795e('0x37')]['length']?_0x4a5cab[_0x795e('0x37')]:_0xe0bda3[_0x795e('0x31')];_0x4a5cab[_0x795e('0x3b')]=qs[_0x795e('0x3c')](_0x302657[_0x795e('0x32')][_0x795e('0x3c')]);_0x4a5cab[_0x795e('0x3d')]=qs[_0x795e('0x34')](_[_0x795e('0x3e')](_0x302657[_0x795e('0x32')],_0xe0bda3[_0x795e('0x34')]));if(_0x302657['query'][_0x795e('0x3f')]){_0x4a5cab['where']=_[_0x795e('0x42')](_0x4a5cab[_0x795e('0x3d')],{'$or':_[_0x795e('0x2d')](_0x4a5cab[_0x795e('0x37')],function(_0x208cae){var _0x5c4f66={};_0x5c4f66[_0x208cae]={'$like':'%'+_0x302657[_0x795e('0x32')][_0x795e('0x3f')]+'%'};return _0x5c4f66;})});}_0x4a5cab=_['merge']({},_0x4a5cab,_0x302657['options']);return _0x455d5d[_0x795e('0x77')](_0x4a5cab);}})['then'](function(_0x22e202){if(_0x22e202){_0x3e5c90=_0x22e202[_0x795e('0x38')];if(!_0x302657[_0x795e('0x32')][_0x795e('0x39')](_0x795e('0x3a'))){_0x4a5cab[_0x795e('0x1c')]=qs[_0x795e('0x1c')](_0x302657[_0x795e('0x32')][_0x795e('0x1c')]);_0x4a5cab['offset']=qs[_0x795e('0x1b')](_0x302657[_0x795e('0x32')]['offset']);}return _0x455d5d['getItems'](_0x4a5cab);}})[_0x795e('0x25')](function(_0xc0bc6c){if(_0xc0bc6c){return _0xc0bc6c?{'count':_0x3e5c90,'rows':_0xc0bc6c}:null;}})[_0x795e('0x25')](respondWithResult(_0x182acb,null))['catch'](handleError(_0x182acb,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 90b4a7e..1567ad6 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 _0xda15=['events','Dashboard','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x41d881,_0x5efb4e){var _0x38ff6a=function(_0x5ad609){while(--_0x5ad609){_0x41d881['push'](_0x41d881['shift']());}};_0x38ff6a(++_0x5efb4e);}(_0xda15,0xf8));var _0x5da1=function(_0x28eaa0,_0x337339){_0x28eaa0=_0x28eaa0-0x0;var _0x4ae58f=_0xda15[_0x28eaa0];return _0x4ae58f;};'use strict';var EventEmitter=require(_0x5da1('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x5da1('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5da1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5da1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x21acab){return function(_0x1a8b42,_0x452bc9,_0xca037c){DashboardEvents[_0x5da1('0x4')](_0x21acab+':'+_0x1a8b42['id'],_0x1a8b42);DashboardEvents[_0x5da1('0x4')](_0x21acab,_0x1a8b42);_0xca037c(null);};}for(var e in events){if(events[_0x5da1('0x5')](e)){var event=events[e];Dashboard[_0x5da1('0x6')](e,emitEvent(event));}}module[_0x5da1('0x7')]=DashboardEvents; \ No newline at end of file +var _0x8c09=['update','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x24eb2f,_0x361426){var _0x231c1b=function(_0x49cc7d){while(--_0x49cc7d){_0x24eb2f['push'](_0x24eb2f['shift']());}};_0x231c1b(++_0x361426);}(_0x8c09,0xbc));var _0x98c0=function(_0x594979,_0x2a3773){_0x594979=_0x594979-0x0;var _0x1955ad=_0x8c09[_0x594979];return _0x1955ad;};'use strict';var EventEmitter=require(_0x98c0('0x0'));var Dashboard=require(_0x98c0('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x98c0('0x2')](0x0);var events={'afterCreate':_0x98c0('0x3'),'afterUpdate':_0x98c0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1417c0){return function(_0x44bfde,_0x3086d8,_0xa56bad){DashboardEvents['emit'](_0x1417c0+':'+_0x44bfde['id'],_0x44bfde);DashboardEvents[_0x98c0('0x5')](_0x1417c0,_0x44bfde);_0xa56bad(null);};}for(var e in events){if(events[_0x98c0('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x98c0('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 f9487f7..0ff7b38 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 _0x4024=['define','dashboards','lodash','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x3c3024,_0x199b40){var _0x35247d=function(_0x442b6e){while(--_0x442b6e){_0x3c3024['push'](_0x3c3024['shift']());}};_0x35247d(++_0x199b40);}(_0x4024,0x89));var _0x4402=function(_0x1974b2,_0x3e0f48){_0x1974b2=_0x1974b2-0x0;var _0x39b962=_0x4024[_0x1974b2];return _0x39b962;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var logger=require('../../config/logger')(_0x4402('0x2'));var moment=require(_0x4402('0x3'));var BPromise=require('bluebird');var rp=require(_0x4402('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x17699b,_0x346ddc){return _0x17699b[_0x4402('0x7')]('Dashboard',attributes,{'tableName':_0x4402('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ff8=['moment','bluebird','request-promise','path','../../config/environment','./dashboard.attributes','define','dashboards','lodash','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5ff8,0x13e));var _0x85ff=function(_0x532a51,_0x5cfc2d){_0x532a51=_0x532a51-0x0;var _0xbe338a=_0x5ff8[_0x532a51];return _0xbe338a;};'use strict';var _=require(_0x85ff('0x0'));var util=require(_0x85ff('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x85ff('0x2'));var BPromise=require(_0x85ff('0x3'));var rp=require(_0x85ff('0x4'));var fs=require('fs');var path=require(_0x85ff('0x5'));var rimraf=require('rimraf');var config=require(_0x85ff('0x6'));var attributes=require(_0x85ff('0x7'));module['exports']=function(_0x49cb59,_0x3cc2d7){return _0x49cb59[_0x85ff('0x8')]('Dashboard',attributes,{'tableName':_0x85ff('0x9'),'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 06342d5..cb53d5e 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 _0x39f1=['../../config/environment','jayson/promise','http','defaults','redis','./dashboard.socket','request','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc'];(function(_0x3c1d71,_0x475067){var _0x2adf55=function(_0x49c7d6){while(--_0x49c7d6){_0x3c1d71['push'](_0x3c1d71['shift']());}};_0x2adf55(++_0x475067);}(_0x39f1,0x84));var _0x139f=function(_0x4adb86,_0x22f5d3){_0x4adb86=_0x4adb86-0x0;var _0x289386=_0x39f1[_0x4adb86];return _0x289386;};'use strict';var _=require(_0x139f('0x0'));var util=require('util');var moment=require(_0x139f('0x1'));var BPromise=require(_0x139f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x139f('0x3'));var logger=require(_0x139f('0x4'))(_0x139f('0x5'));var config=require(_0x139f('0x6'));var jayson=require(_0x139f('0x7'));var client=jayson['client'][_0x139f('0x8')]({'port':0x232a});config['redis']=_[_0x139f('0x9')](config[_0x139f('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x139f('0xa')]));require(_0x139f('0xb'))['register'](socket);function respondWithRpcPromise(_0x2deb3a,_0x5c9067,_0x240556){return new BPromise(function(_0xc67a28,_0x3513a6){return client[_0x139f('0xc')](_0x2deb3a,_0x240556)['then'](function(_0x38fb40){logger[_0x139f('0xd')]('Dashboard,\x20%s,\x20%s',_0x5c9067,_0x139f('0xe'));logger[_0x139f('0xf')](_0x139f('0x10'),_0x5c9067,_0x139f('0xe'),JSON[_0x139f('0x11')](_0x38fb40));if(_0x38fb40[_0x139f('0x12')]){if(_0x38fb40['error'][_0x139f('0x13')]===0x1f4){logger['error'](_0x139f('0x14'),_0x5c9067,_0x38fb40[_0x139f('0x12')][_0x139f('0x15')]);return _0x3513a6(_0x38fb40[_0x139f('0x12')][_0x139f('0x15')]);}logger[_0x139f('0x12')](_0x139f('0x14'),_0x5c9067,_0x38fb40[_0x139f('0x12')][_0x139f('0x15')]);return _0xc67a28(_0x38fb40[_0x139f('0x12')]['message']);}else{logger['info'](_0x139f('0x14'),_0x5c9067,_0x139f('0xe'));_0xc67a28(_0x38fb40[_0x139f('0x16')][_0x139f('0x15')]);}})['catch'](function(_0xb5e281){logger[_0x139f('0x12')]('Dashboard,\x20%s,\x20%s',_0x5c9067,_0xb5e281);_0x3513a6(_0xb5e281);});});} \ No newline at end of file +var _0xa861=['code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa861,0x1c4));var _0x1a86=function(_0x51bda1,_0x44f80d){_0x51bda1=_0x51bda1-0x0;var _0x1ce08c=_0xa861[_0x51bda1];return _0x1ce08c;};'use strict';var _=require(_0x1a86('0x0'));var util=require(_0x1a86('0x1'));var moment=require(_0x1a86('0x2'));var BPromise=require('bluebird');var rs=require(_0x1a86('0x3'));var fs=require('fs');var Redis=require(_0x1a86('0x4'));var db=require(_0x1a86('0x5'))['db'];var utils=require(_0x1a86('0x6'));var logger=require(_0x1a86('0x7'))(_0x1a86('0x8'));var config=require(_0x1a86('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1a86('0xa')]['http']({'port':0x232a});config['redis']=_[_0x1a86('0xb')](config[_0x1a86('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1a86('0xd'))(new Redis(config[_0x1a86('0xc')]));require(_0x1a86('0xe'))[_0x1a86('0xf')](socket);function respondWithRpcPromise(_0x1e6d2e,_0x29302a,_0x22f55d){return new BPromise(function(_0x44f7c3,_0x2cfc72){return client[_0x1a86('0x10')](_0x1e6d2e,_0x22f55d)[_0x1a86('0x11')](function(_0x3d3710){logger[_0x1a86('0x12')](_0x1a86('0x13'),_0x29302a,_0x1a86('0x14'));logger[_0x1a86('0x15')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x29302a,_0x1a86('0x14'),JSON['stringify'](_0x3d3710));if(_0x3d3710[_0x1a86('0x16')]){if(_0x3d3710[_0x1a86('0x16')][_0x1a86('0x17')]===0x1f4){logger['error'](_0x1a86('0x13'),_0x29302a,_0x3d3710[_0x1a86('0x16')]['message']);return _0x2cfc72(_0x3d3710[_0x1a86('0x16')][_0x1a86('0x18')]);}logger[_0x1a86('0x16')](_0x1a86('0x13'),_0x29302a,_0x3d3710[_0x1a86('0x16')][_0x1a86('0x18')]);return _0x44f7c3(_0x3d3710[_0x1a86('0x16')][_0x1a86('0x18')]);}else{logger[_0x1a86('0x12')](_0x1a86('0x13'),_0x29302a,_0x1a86('0x14'));_0x44f7c3(_0x3d3710['result'][_0x1a86('0x18')]);}})['catch'](function(_0x129d2c){logger[_0x1a86('0x16')](_0x1a86('0x13'),_0x29302a,_0x129d2c);_0x2cfc72(_0x129d2c);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index f3a7e6b..e35ab0a 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 _0xf8a1=['remove','update','emit','removeListener','register','length','dashboard:','./dashboard.events','save'];(function(_0x9edfd5,_0x286486){var _0x330738=function(_0x4aceb3){while(--_0x4aceb3){_0x9edfd5['push'](_0x9edfd5['shift']());}};_0x330738(++_0x286486);}(_0xf8a1,0x15d));var _0x1f8a=function(_0x5abe78,_0x574b05){_0x5abe78=_0x5abe78-0x0;var _0x2193d8=_0xf8a1[_0x5abe78];return _0x2193d8;};'use strict';var DashboardEvents=require(_0x1f8a('0x0'));var events=[_0x1f8a('0x1'),_0x1f8a('0x2'),_0x1f8a('0x3')];function createListener(_0x2149d3,_0x20c9a9){return function(_0x391909){_0x20c9a9[_0x1f8a('0x4')](_0x2149d3,_0x391909);};}function removeListener(_0x6b71b4,_0x1d9995){return function(){DashboardEvents[_0x1f8a('0x5')](_0x6b71b4,_0x1d9995);};}exports[_0x1f8a('0x6')]=function(_0x3b2d2c){for(var _0x236382=0x0,_0x45a825=events[_0x1f8a('0x7')];_0x236382<_0x45a825;_0x236382++){var _0x4e170d=events[_0x236382];var _0x112292=createListener(_0x1f8a('0x8')+_0x4e170d,_0x3b2d2c);DashboardEvents['on'](_0x4e170d,_0x112292);}}; \ No newline at end of file +var _0xa25c=['./dashboard.events','save','remove','update','emit','removeListener','length','dashboard:'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xa25c,0xf0));var _0xca25=function(_0x31dd7d,_0x41e269){_0x31dd7d=_0x31dd7d-0x0;var _0x3f8100=_0xa25c[_0x31dd7d];return _0x3f8100;};'use strict';var DashboardEvents=require(_0xca25('0x0'));var events=[_0xca25('0x1'),_0xca25('0x2'),_0xca25('0x3')];function createListener(_0x36fd8d,_0xfa60fc){return function(_0x3462a9){_0xfa60fc[_0xca25('0x4')](_0x36fd8d,_0x3462a9);};}function removeListener(_0xd3e72a,_0x46adbe){return function(){DashboardEvents[_0xca25('0x5')](_0xd3e72a,_0x46adbe);};}exports['register']=function(_0x416e8a){for(var _0x1efc5a=0x0,_0x148ca0=events[_0xca25('0x6')];_0x1efc5a<_0x148ca0;_0x1efc5a++){var _0x505849=events[_0x1efc5a];var _0xc1ed26=createListener(_0xca25('0x7')+_0x505849,_0x416e8a);DashboardEvents['on'](_0x505849,_0xc1ed26);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 8fbcd57..a667927 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 _0x60d7=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/items','getItems','/:id/clone','clone','post','addItem','delete','destroy','exports','multer','util','path','express'];(function(_0x562ec5,_0x36b5a4){var _0x279c8c=function(_0x2de373){while(--_0x2de373){_0x562ec5['push'](_0x562ec5['shift']());}};_0x279c8c(++_0x36b5a4);}(_0x60d7,0x80));var _0x760d=function(_0x517a39,_0x5f4c0b){_0x517a39=_0x517a39-0x0;var _0x542f43=_0x60d7[_0x517a39];return _0x542f43;};'use strict';var multer=require(_0x760d('0x0'));var util=require(_0x760d('0x1'));var path=require(_0x760d('0x2'));var timeout=require('connect-timeout');var express=require(_0x760d('0x3'));var router=express[_0x760d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x760d('0x5'));var interaction=require(_0x760d('0x6'));var config=require(_0x760d('0x7'));var controller=require('./dashboard.controller');router[_0x760d('0x8')]('/',auth[_0x760d('0x9')](),controller[_0x760d('0xa')]);router[_0x760d('0x8')](_0x760d('0xb'),auth[_0x760d('0x9')](),controller[_0x760d('0xc')]);router[_0x760d('0x8')](_0x760d('0xd'),auth[_0x760d('0x9')](),controller[_0x760d('0xe')]);router['post']('/',auth[_0x760d('0x9')](),controller['create']);router['post'](_0x760d('0xf'),auth['isAuthenticated'](),controller[_0x760d('0x10')]);router[_0x760d('0x11')](_0x760d('0xd'),auth[_0x760d('0x9')](),controller[_0x760d('0x12')]);router['put'](_0x760d('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x760d('0x13')](_0x760d('0xb'),auth['isAuthenticated'](),controller[_0x760d('0x14')]);module[_0x760d('0x15')]=router; \ No newline at end of file +var _0x482b=['/:id/clone','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create'];(function(_0x53a1be,_0x42dff2){var _0x38ae84=function(_0x51fa5c){while(--_0x51fa5c){_0x53a1be['push'](_0x53a1be['shift']());}};_0x38ae84(++_0x42dff2);}(_0x482b,0x12a));var _0xb482=function(_0x301d8b,_0xe56727){_0x301d8b=_0x301d8b-0x0;var _0x90280a=_0x482b[_0x301d8b];return _0x90280a;};'use strict';var multer=require(_0xb482('0x0'));var util=require(_0xb482('0x1'));var path=require(_0xb482('0x2'));var timeout=require('connect-timeout');var express=require(_0xb482('0x3'));var router=express['Router']();var fs_extra=require(_0xb482('0x4'));var auth=require(_0xb482('0x5'));var interaction=require(_0xb482('0x6'));var config=require(_0xb482('0x7'));var controller=require('./dashboard.controller');router[_0xb482('0x8')]('/',auth[_0xb482('0x9')](),controller[_0xb482('0xa')]);router[_0xb482('0x8')](_0xb482('0xb'),auth[_0xb482('0x9')](),controller[_0xb482('0xc')]);router[_0xb482('0x8')](_0xb482('0xd'),auth[_0xb482('0x9')](),controller[_0xb482('0xe')]);router[_0xb482('0xf')]('/',auth['isAuthenticated'](),controller[_0xb482('0x10')]);router[_0xb482('0xf')](_0xb482('0x11'),auth[_0xb482('0x9')](),controller['clone']);router['post'](_0xb482('0xd'),auth['isAuthenticated'](),controller['addItem']);router['put'](_0xb482('0xb'),auth[_0xb482('0x9')](),controller[_0xb482('0x12')]);router['delete'](_0xb482('0xb'),auth[_0xb482('0x9')](),controller[_0xb482('0x13')]);module[_0xb482('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 0420329..acb34a7 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 _0xe2fe=['setDataValue','INTEGER','sequelize','exports','STRING','TEXT','long','parse','getDataValue','attrs','stringify'];(function(_0x56b3d5,_0x40a568){var _0x47b198=function(_0x21aa5e){while(--_0x21aa5e){_0x56b3d5['push'](_0x56b3d5['shift']());}};_0x47b198(++_0x40a568);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xee2f('0x0'));var squel=require('squel');var _=require('lodash');module[_0xee2f('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xee2f('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xee2f('0x3')](_0xee2f('0x4')),'get':function(){try{return JSON[_0xee2f('0x5')](this[_0xee2f('0x6')]('attrs'));}catch(_0x311a2f){return[];}},'set':function(_0x2b7e7c){try{this['setDataValue'](_0xee2f('0x7'),JSON[_0xee2f('0x8')](_0x2b7e7c));}catch(_0x5a7975){this[_0xee2f('0x9')]('attrs',JSON[_0xee2f('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xee2f('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xee2f('0xa')]},'col':{'type':Sequelize[_0xee2f('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xee2f('0x2')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x326f=['#2196f3','sequelize','exports','STRING','TEXT','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff'];(function(_0x1467d8,_0x5d5c6f){var _0x1f8b36=function(_0x3b3c6b){while(--_0x3b3c6b){_0x1467d8['push'](_0x1467d8['shift']());}};_0x1f8b36(++_0x5d5c6f);}(_0x326f,0xd1));var _0xf326=function(_0x42eb8e,_0x137235){_0x42eb8e=_0x42eb8e-0x0;var _0x10a493=_0x326f[_0x42eb8e];return _0x10a493;};'use strict';var Sequelize=require(_0xf326('0x0'));var squel=require('squel');var _=require('lodash');module[_0xf326('0x1')]={'title':{'type':Sequelize[_0xf326('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf326('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xf326('0x3')](_0xf326('0x4')),'get':function(){try{return JSON[_0xf326('0x5')](this[_0xf326('0x6')](_0xf326('0x7')));}catch(_0x1b5a56){return[];}},'set':function(_0x3ace29){try{this['setDataValue'](_0xf326('0x7'),JSON[_0xf326('0x8')](_0x3ace29));}catch(_0x165f95){this[_0xf326('0x9')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xf326('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xf326('0xa')]},'col':{'type':Sequelize[_0xf326('0xa')]},'background':{'type':Sequelize[_0xf326('0x2')],'allowNull':![],'defaultValue':_0xf326('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf326('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xf326('0xa')],'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 1412fdf..9f55dd7 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 _0x930d=['to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','show','params','model','DashboardItem','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x27d748,_0x1a1886){var _0x627909=function(_0x263a7d){while(--_0x263a7d){_0x27d748['push'](_0x27d748['shift']());}};_0x627909(++_0x1a1886);}(_0x930d,0xb4));var _0xd930=function(_0x272d90,_0x5e70ff){_0x272d90=_0x272d90-0x0;var _0x2bf4a2=_0x930d[_0x272d90];return _0x2bf4a2;};'use strict';var emlformat=require(_0xd930('0x0'));var rimraf=require(_0xd930('0x1'));var zipdir=require(_0xd930('0x2'));var jsonpatch=require(_0xd930('0x3'));var rp=require(_0xd930('0x4'));var moment=require('moment');var BPromise=require(_0xd930('0x5'));var Mustache=require(_0xd930('0x6'));var util=require(_0xd930('0x7'));var path=require(_0xd930('0x8'));var sox=require(_0xd930('0x9'));var csv=require(_0xd930('0xa'));var ejs=require(_0xd930('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd930('0xc'));var squel=require(_0xd930('0xd'));var crypto=require(_0xd930('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd930('0xf'));var toCsv=require(_0xd930('0xa'));var querystring=require(_0xd930('0x10'));var Papa=require('papaparse');var Redis=require(_0xd930('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd930('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd930('0x13'));var logger=require(_0xd930('0x14'))(_0xd930('0x15'));var utils=require('../../config/utils');var config=require(_0xd930('0x16'));var licenseUtil=require(_0xd930('0x17'));var db=require(_0xd930('0x18'))['db'];config[_0xd930('0x19')]=_[_0xd930('0x1a')](config[_0xd930('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xd930('0x1b'))(new Redis(config[_0xd930('0x19')]));require(_0xd930('0x1c'))['register'](socket);function respondWithStatusCode(_0x5bb678,_0x485951){_0x485951=_0x485951||0xcc;return function(_0x2dbcfc){if(_0x2dbcfc){return _0x5bb678[_0xd930('0x1d')](_0x485951);}return _0x5bb678[_0xd930('0x1e')](_0x485951)['end']();};}function respondWithResult(_0x272cd7,_0x3d5c1f){_0x3d5c1f=_0x3d5c1f||0xc8;return function(_0x2d8cc5){if(_0x2d8cc5){return _0x272cd7['status'](_0x3d5c1f)[_0xd930('0x1f')](_0x2d8cc5);}};}function respondWithFilteredResult(_0x16541f,_0x3b6294){return function(_0x224446){if(_0x224446){var _0x2d0cbd=typeof _0x3b6294['offset']===_0xd930('0x20')&&typeof _0x3b6294[_0xd930('0x21')]===_0xd930('0x20');var _0x136276=_0x224446[_0xd930('0x22')];var _0x1aa8c1=_0x2d0cbd?0x0:_0x3b6294[_0xd930('0x23')];var _0x30b262=_0x2d0cbd?_0x224446[_0xd930('0x22')]:_0x3b6294['offset']+_0x3b6294[_0xd930('0x21')];var _0x4cfb3e;if(_0x30b262>=_0x136276){_0x30b262=_0x136276;_0x4cfb3e=0xc8;}else{_0x4cfb3e=0xce;}_0x16541f[_0xd930('0x1e')](_0x4cfb3e);return _0x16541f[_0xd930('0x24')](_0xd930('0x25'),_0x1aa8c1+'-'+_0x30b262+'/'+_0x136276)[_0xd930('0x1f')](_0x224446);}return null;};}function patchUpdates(_0x47f6ab){return function(_0x902d00){try{jsonpatch[_0xd930('0x26')](_0x902d00,_0x47f6ab,!![]);}catch(_0x139750){return BPromise[_0xd930('0x27')](_0x139750);}return _0x902d00[_0xd930('0x28')]();};}function saveUpdates(_0x1f7e4f,_0x33d51d){return function(_0x4f3a59){if(_0x4f3a59){return _0x4f3a59['update'](_0x1f7e4f)[_0xd930('0x29')](function(_0x44ef81){return _0x44ef81;});}return null;};}function removeEntity(_0xa3a181,_0x19797b){return function(_0xabb4fc){if(_0xabb4fc){return _0xabb4fc[_0xd930('0x2a')]()[_0xd930('0x29')](function(){_0xa3a181[_0xd930('0x1e')](0xcc)[_0xd930('0x2b')]();});}};}function handleEntityNotFound(_0x26fb31,_0x507a7a){return function(_0x3561c5){if(!_0x3561c5){_0x26fb31[_0xd930('0x1d')](0x194);}return _0x3561c5;};}function handleError(_0x7bfe62,_0x3c3624){_0x3c3624=_0x3c3624||0x1f4;return function(_0x5b7781){logger[_0xd930('0x2c')](_0x5b7781[_0xd930('0x2d')]);if(_0x5b7781[_0xd930('0x2e')]){delete _0x5b7781[_0xd930('0x2e')];}_0x7bfe62[_0xd930('0x1e')](_0x3c3624)[_0xd930('0x2f')](_0x5b7781);};}exports[_0xd930('0x30')]=function(_0x41b290,_0x4deeae){var _0x60862b={'raw':![],'where':{'id':_0x41b290[_0xd930('0x31')]['id']}},_0x150ed9={};_0x150ed9[_0xd930('0x32')]=_['keys'](db[_0xd930('0x33')][_0xd930('0x34')]);_0x150ed9[_0xd930('0x35')]=_[_0xd930('0x36')](_0x41b290[_0xd930('0x35')]);_0x150ed9[_0xd930('0x37')]=_[_0xd930('0x38')](_0x150ed9['model'],_0x150ed9[_0xd930('0x35')]);_0x60862b[_0xd930('0x39')]=_['intersection'](_0x150ed9[_0xd930('0x32')],qs[_0xd930('0x3a')](_0x41b290['query'][_0xd930('0x3a')]));_0x60862b[_0xd930('0x39')]=_0x60862b[_0xd930('0x39')][_0xd930('0x3b')]?_0x60862b[_0xd930('0x39')]:_0x150ed9[_0xd930('0x32')];if(_0x41b290[_0xd930('0x35')][_0xd930('0x3c')]){_0x60862b[_0xd930('0x3d')]=[{'all':!![]}];}_0x60862b=_[_0xd930('0x3e')]({},_0x60862b,_0x41b290[_0xd930('0x3f')]);return db[_0xd930('0x33')][_0xd930('0x40')](_0x60862b)[_0xd930('0x29')](handleEntityNotFound(_0x4deeae,null))[_0xd930('0x29')](respondWithResult(_0x4deeae,null))['catch'](handleError(_0x4deeae,null));};exports['destroy']=function(_0x48a1ec,_0x35a262){return db[_0xd930('0x33')][_0xd930('0x40')]({'where':{'id':_0x48a1ec[_0xd930('0x31')]['id']}})[_0xd930('0x29')](handleEntityNotFound(_0x35a262,null))['then'](removeEntity(_0x35a262,null))[_0xd930('0x41')](handleError(_0x35a262,null));};function widgetAttributes(_0x3b70c1){try{switch(_0x3b70c1['type']){case _0xd930('0x42'):return[{'name':_0xd930('0x43'),'value':_0x3b70c1['attrUrl']||(_0x3b70c1[_0xd930('0x44')]&&_0x3b70c1['attrs'][0x0]?_0x3b70c1[_0xd930('0x44')][0x0][_0xd930('0x45')]:undefined)||_0xd930('0x46')}];case _0xd930('0x47'):return[{'name':_0xd930('0x48'),'value':_0x3b70c1[_0xd930('0x48')]||(_0x3b70c1[_0xd930('0x44')]&&_0x3b70c1['attrs'][0x0]?_0x3b70c1['attrs'][0x0]['value']:undefined)||''}];case _0xd930('0x49'):return[{'name':_0xd930('0x4a'),'value':_0x3b70c1[_0xd930('0x4a')]||(_0x3b70c1[_0xd930('0x44')]&&_0x3b70c1['attrs'][0x0]?_0x3b70c1[_0xd930('0x44')][0x0]['value']:undefined)||_0xd930('0x4b')},{'name':_0xd930('0x4c'),'value':_0x3b70c1['attrTimezone']||(_0x3b70c1[_0xd930('0x44')]&&_0x3b70c1[_0xd930('0x44')][0x1]?_0x3b70c1['attrs'][0x1]['value']:undefined)||_0xd930('0x4d')},{'name':_0xd930('0x4e'),'value':_0x3b70c1[_0xd930('0x4e')]||(_0x3b70c1[_0xd930('0x44')]&&_0x3b70c1[_0xd930('0x44')][0x2]?_0x3b70c1[_0xd930('0x44')][0x2][_0xd930('0x45')]:undefined)||0xc}];case _0xd930('0x4f'):return[{'name':'attrMetric','value':_0x3b70c1[_0xd930('0x50')]||(_0x3b70c1[_0xd930('0x44')]&&_0x3b70c1[_0xd930('0x44')][0x0]?_0x3b70c1[_0xd930('0x44')][0x0][_0xd930('0x45')]:undefined)||_0xd930('0x51')},{'name':_0xd930('0x52'),'value':_0x3b70c1[_0xd930('0x52')]||(_0x3b70c1[_0xd930('0x44')]&&_0x3b70c1[_0xd930('0x44')][0x1]?_0x3b70c1['attrs'][0x1][_0xd930('0x45')]:undefined)||[]},{'name':_0xd930('0x4e'),'value':_0x3b70c1[_0xd930('0x4e')]||(_0x3b70c1[_0xd930('0x44')]&&_0x3b70c1[_0xd930('0x44')][0x2]?_0x3b70c1['attrs'][0x2][_0xd930('0x45')]:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':'attrSerie1','value':_0x3b70c1['attrSerie1']||(_0x3b70c1[_0xd930('0x44')]&&_0x3b70c1['attrs'][0x0]?_0x3b70c1[_0xd930('0x44')][0x0]['value']:undefined)||_0xd930('0x51')},{'name':_0xd930('0x53'),'value':_0x3b70c1['attrSerie2']||(_0x3b70c1[_0xd930('0x44')]&&_0x3b70c1[_0xd930('0x44')][0x1]?_0x3b70c1[_0xd930('0x44')][0x1][_0xd930('0x45')]:undefined)||null},{'name':'attrSerie3','value':_0x3b70c1[_0xd930('0x54')]||(_0x3b70c1['attrs']&&_0x3b70c1['attrs'][0x2]?_0x3b70c1[_0xd930('0x44')][0x2][_0xd930('0x45')]:undefined)||null},{'name':_0xd930('0x52'),'value':_0x3b70c1['attrVoiceQueues']||(_0x3b70c1['attrs']&&_0x3b70c1[_0xd930('0x44')][0x3]?_0x3b70c1[_0xd930('0x44')][0x3][_0xd930('0x45')]:undefined)||[]}];case _0xd930('0x55'):return[{'name':_0xd930('0x56'),'type':_0x3b70c1[_0xd930('0x57')]||(_0x3b70c1[_0xd930('0x44')]&&_0x3b70c1[_0xd930('0x44')][0x0]?_0x3b70c1[_0xd930('0x44')][0x0][_0xd930('0x58')]:undefined)||null,'value':_0x3b70c1[_0xd930('0x56')]||(_0x3b70c1['attrs']&&_0x3b70c1[_0xd930('0x44')][0x0]?_0x3b70c1[_0xd930('0x44')][0x0][_0xd930('0x45')]:undefined)||null},{'name':'attrRefresh','value':_0x3b70c1[_0xd930('0x59')]||(_0x3b70c1['attrs']&&_0x3b70c1['attrs'][0x1]?_0x3b70c1[_0xd930('0x44')][0x1][_0xd930('0x45')]:undefined)||0x0}];default:return[];}}catch(_0x170784){logger[_0xd930('0x2c')](_0xd930('0x5a'),JSON[_0xd930('0x5b')](_0x170784));return[];}}exports[_0xd930('0x5c')]=function(_0x28bc5e,_0x3ce6ab){if(_0x28bc5e[_0xd930('0x5d')]){_0x28bc5e[_0xd930('0x5d')]['attrs']=widgetAttributes(_0x28bc5e[_0xd930('0x5d')]);}return db[_0xd930('0x33')]['create'](_0x28bc5e[_0xd930('0x5d')],{})[_0xd930('0x29')](respondWithResult(_0x3ce6ab,0xc9))[_0xd930('0x41')](handleError(_0x3ce6ab,null));};exports[_0xd930('0x5e')]=function(_0x5284a7,_0x5134a6){if(_0x5284a7['body']['id']){delete _0x5284a7[_0xd930('0x5d')]['id'];}_0x5284a7[_0xd930('0x5d')]['attrs']=widgetAttributes(_0x5284a7[_0xd930('0x5d')]);return db[_0xd930('0x33')][_0xd930('0x40')]({'where':{'id':_0x5284a7[_0xd930('0x31')]['id']}})[_0xd930('0x29')](handleEntityNotFound(_0x5134a6,null))[_0xd930('0x29')](saveUpdates(_0x5284a7[_0xd930('0x5d')],null))['then'](respondWithResult(_0x5134a6,null))[_0xd930('0x41')](handleError(_0x5134a6,null));}; \ No newline at end of file +var _0x8cd9=['sendStatus','end','limit','undefined','offset','count','status','set','json','apply','reject','save','update','then','destroy','error','send','show','params','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','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','../../mysqldb','redis','localhost','socket.io-emitter','register'];(function(_0x4b63bd,_0x339a0f){var _0x387b1a=function(_0x5e9a26){while(--_0x5e9a26){_0x4b63bd['push'](_0x4b63bd['shift']());}};_0x387b1a(++_0x339a0f);}(_0x8cd9,0xea));var _0x98cd=function(_0x350e06,_0x2031ec){_0x350e06=_0x350e06-0x0;var _0x314b2d=_0x8cd9[_0x350e06];return _0x314b2d;};'use strict';var emlformat=require(_0x98cd('0x0'));var rimraf=require(_0x98cd('0x1'));var zipdir=require(_0x98cd('0x2'));var jsonpatch=require(_0x98cd('0x3'));var rp=require('request-promise');var moment=require(_0x98cd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x98cd('0x5'));var util=require('util');var path=require(_0x98cd('0x6'));var sox=require(_0x98cd('0x7'));var csv=require('to-csv');var ejs=require(_0x98cd('0x8'));var fs=require('fs');var fs_extra=require(_0x98cd('0x9'));var _=require(_0x98cd('0xa'));var squel=require(_0x98cd('0xb'));var crypto=require(_0x98cd('0xc'));var jsforce=require(_0x98cd('0xd'));var deskjs=require(_0x98cd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x98cd('0xf'));var Papa=require(_0x98cd('0x10'));var Redis=require(_0x98cd('0x11'));var authService=require(_0x98cd('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98cd('0x13'));var logger=require(_0x98cd('0x14'))(_0x98cd('0x15'));var utils=require(_0x98cd('0x16'));var config=require(_0x98cd('0x17'));var licenseUtil=require(_0x98cd('0x18'));var db=require(_0x98cd('0x19'))['db'];config['redis']=_['defaults'](config[_0x98cd('0x1a')],{'host':_0x98cd('0x1b'),'port':0x18eb});var socket=require(_0x98cd('0x1c'))(new Redis(config[_0x98cd('0x1a')]));require('./dashboardItem.socket')[_0x98cd('0x1d')](socket);function respondWithStatusCode(_0x1d547f,_0x451113){_0x451113=_0x451113||0xcc;return function(_0x5a8483){if(_0x5a8483){return _0x1d547f[_0x98cd('0x1e')](_0x451113);}return _0x1d547f['status'](_0x451113)[_0x98cd('0x1f')]();};}function respondWithResult(_0x3f4743,_0x4d461e){_0x4d461e=_0x4d461e||0xc8;return function(_0x548b81){if(_0x548b81){return _0x3f4743['status'](_0x4d461e)['json'](_0x548b81);}};}function respondWithFilteredResult(_0x12ba0c,_0x2fe4a4){return function(_0x468dc4){if(_0x468dc4){var _0x2937bd=typeof _0x2fe4a4['offset']==='undefined'&&typeof _0x2fe4a4[_0x98cd('0x20')]===_0x98cd('0x21');var _0x33054f=_0x468dc4['count'];var _0x39bec8=_0x2937bd?0x0:_0x2fe4a4[_0x98cd('0x22')];var _0x4541ff=_0x2937bd?_0x468dc4[_0x98cd('0x23')]:_0x2fe4a4[_0x98cd('0x22')]+_0x2fe4a4[_0x98cd('0x20')];var _0x1c04ac;if(_0x4541ff>=_0x33054f){_0x4541ff=_0x33054f;_0x1c04ac=0xc8;}else{_0x1c04ac=0xce;}_0x12ba0c[_0x98cd('0x24')](_0x1c04ac);return _0x12ba0c[_0x98cd('0x25')]('Content-Range',_0x39bec8+'-'+_0x4541ff+'/'+_0x33054f)[_0x98cd('0x26')](_0x468dc4);}return null;};}function patchUpdates(_0x513c57){return function(_0x1e6436){try{jsonpatch[_0x98cd('0x27')](_0x1e6436,_0x513c57,!![]);}catch(_0xa7833f){return BPromise[_0x98cd('0x28')](_0xa7833f);}return _0x1e6436[_0x98cd('0x29')]();};}function saveUpdates(_0x4464cc,_0x2ea879){return function(_0x401bbc){if(_0x401bbc){return _0x401bbc[_0x98cd('0x2a')](_0x4464cc)[_0x98cd('0x2b')](function(_0x5bc6df){return _0x5bc6df;});}return null;};}function removeEntity(_0x28a785,_0x36e340){return function(_0x1f528d){if(_0x1f528d){return _0x1f528d[_0x98cd('0x2c')]()['then'](function(){_0x28a785[_0x98cd('0x24')](0xcc)[_0x98cd('0x1f')]();});}};}function handleEntityNotFound(_0xe75a60,_0x382263){return function(_0x448f75){if(!_0x448f75){_0xe75a60[_0x98cd('0x1e')](0x194);}return _0x448f75;};}function handleError(_0x54fdbe,_0x3e9376){_0x3e9376=_0x3e9376||0x1f4;return function(_0x30b62a){logger[_0x98cd('0x2d')](_0x30b62a['stack']);if(_0x30b62a['name']){delete _0x30b62a['name'];}_0x54fdbe[_0x98cd('0x24')](_0x3e9376)[_0x98cd('0x2e')](_0x30b62a);};}exports[_0x98cd('0x2f')]=function(_0x5b0dd9,_0x457804){var _0x4378d4={'raw':![],'where':{'id':_0x5b0dd9[_0x98cd('0x30')]['id']}},_0x48043e={};_0x48043e[_0x98cd('0x31')]=_[_0x98cd('0x32')](db[_0x98cd('0x33')][_0x98cd('0x34')]);_0x48043e['query']=_[_0x98cd('0x32')](_0x5b0dd9[_0x98cd('0x35')]);_0x48043e['filters']=_[_0x98cd('0x36')](_0x48043e['model'],_0x48043e[_0x98cd('0x35')]);_0x4378d4[_0x98cd('0x37')]=_['intersection'](_0x48043e['model'],qs[_0x98cd('0x38')](_0x5b0dd9['query']['fields']));_0x4378d4['attributes']=_0x4378d4[_0x98cd('0x37')][_0x98cd('0x39')]?_0x4378d4['attributes']:_0x48043e[_0x98cd('0x31')];if(_0x5b0dd9['query']['includeAll']){_0x4378d4[_0x98cd('0x3a')]=[{'all':!![]}];}_0x4378d4=_[_0x98cd('0x3b')]({},_0x4378d4,_0x5b0dd9[_0x98cd('0x3c')]);return db['DashboardItem'][_0x98cd('0x3d')](_0x4378d4)['then'](handleEntityNotFound(_0x457804,null))[_0x98cd('0x2b')](respondWithResult(_0x457804,null))[_0x98cd('0x3e')](handleError(_0x457804,null));};exports[_0x98cd('0x2c')]=function(_0x594851,_0x92d967){return db[_0x98cd('0x33')][_0x98cd('0x3d')]({'where':{'id':_0x594851['params']['id']}})['then'](handleEntityNotFound(_0x92d967,null))[_0x98cd('0x2b')](removeEntity(_0x92d967,null))[_0x98cd('0x3e')](handleError(_0x92d967,null));};function widgetAttributes(_0x41fd0e){try{switch(_0x41fd0e[_0x98cd('0x3f')]){case _0x98cd('0x40'):return[{'name':_0x98cd('0x41'),'value':_0x41fd0e['attrUrl']||(_0x41fd0e[_0x98cd('0x42')]&&_0x41fd0e['attrs'][0x0]?_0x41fd0e[_0x98cd('0x42')][0x0][_0x98cd('0x43')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x41fd0e[_0x98cd('0x44')]||(_0x41fd0e['attrs']&&_0x41fd0e[_0x98cd('0x42')][0x0]?_0x41fd0e['attrs'][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x98cd('0x45'),'value':_0x41fd0e[_0x98cd('0x45')]||(_0x41fd0e['attrs']&&_0x41fd0e[_0x98cd('0x42')][0x0]?_0x41fd0e['attrs'][0x0]['value']:undefined)||_0x98cd('0x46')},{'name':_0x98cd('0x47'),'value':_0x41fd0e[_0x98cd('0x47')]||(_0x41fd0e[_0x98cd('0x42')]&&_0x41fd0e[_0x98cd('0x42')][0x1]?_0x41fd0e['attrs'][0x1]['value']:undefined)||_0x98cd('0x48')},{'name':_0x98cd('0x49'),'value':_0x41fd0e[_0x98cd('0x49')]||(_0x41fd0e[_0x98cd('0x42')]&&_0x41fd0e['attrs'][0x2]?_0x41fd0e[_0x98cd('0x42')][0x2][_0x98cd('0x43')]:undefined)||0xc}];case _0x98cd('0x4a'):return[{'name':'attrMetric','value':_0x41fd0e[_0x98cd('0x4b')]||(_0x41fd0e[_0x98cd('0x42')]&&_0x41fd0e['attrs'][0x0]?_0x41fd0e[_0x98cd('0x42')][0x0]['value']:undefined)||_0x98cd('0x4c')},{'name':_0x98cd('0x4d'),'value':_0x41fd0e['attrVoiceQueues']||(_0x41fd0e[_0x98cd('0x42')]&&_0x41fd0e['attrs'][0x1]?_0x41fd0e['attrs'][0x1][_0x98cd('0x43')]:undefined)||[]},{'name':_0x98cd('0x49'),'value':_0x41fd0e[_0x98cd('0x49')]||(_0x41fd0e[_0x98cd('0x42')]&&_0x41fd0e[_0x98cd('0x42')][0x2]?_0x41fd0e['attrs'][0x2][_0x98cd('0x43')]:undefined)||0x14}];case _0x98cd('0x4e'):case'pie-chart':return[{'name':_0x98cd('0x4f'),'value':_0x41fd0e[_0x98cd('0x4f')]||(_0x41fd0e[_0x98cd('0x42')]&&_0x41fd0e[_0x98cd('0x42')][0x0]?_0x41fd0e['attrs'][0x0][_0x98cd('0x43')]:undefined)||_0x98cd('0x4c')},{'name':_0x98cd('0x50'),'value':_0x41fd0e[_0x98cd('0x50')]||(_0x41fd0e[_0x98cd('0x42')]&&_0x41fd0e['attrs'][0x1]?_0x41fd0e[_0x98cd('0x42')][0x1][_0x98cd('0x43')]:undefined)||null},{'name':_0x98cd('0x51'),'value':_0x41fd0e[_0x98cd('0x51')]||(_0x41fd0e[_0x98cd('0x42')]&&_0x41fd0e[_0x98cd('0x42')][0x2]?_0x41fd0e[_0x98cd('0x42')][0x2]['value']:undefined)||null},{'name':_0x98cd('0x4d'),'value':_0x41fd0e[_0x98cd('0x4d')]||(_0x41fd0e[_0x98cd('0x42')]&&_0x41fd0e[_0x98cd('0x42')][0x3]?_0x41fd0e['attrs'][0x3][_0x98cd('0x43')]:undefined)||[]}];case _0x98cd('0x52'):return[{'name':'attrReport','type':_0x41fd0e['reportType']||(_0x41fd0e[_0x98cd('0x42')]&&_0x41fd0e[_0x98cd('0x42')][0x0]?_0x41fd0e[_0x98cd('0x42')][0x0]['type']:undefined)||null,'value':_0x41fd0e[_0x98cd('0x53')]||(_0x41fd0e[_0x98cd('0x42')]&&_0x41fd0e['attrs'][0x0]?_0x41fd0e[_0x98cd('0x42')][0x0][_0x98cd('0x43')]:undefined)||null},{'name':'attrRefresh','value':_0x41fd0e['attrRefresh']||(_0x41fd0e[_0x98cd('0x42')]&&_0x41fd0e[_0x98cd('0x42')][0x1]?_0x41fd0e['attrs'][0x1][_0x98cd('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x37ee34){logger[_0x98cd('0x2d')](_0x98cd('0x54'),JSON[_0x98cd('0x55')](_0x37ee34));return[];}}exports[_0x98cd('0x56')]=function(_0x11f3cd,_0x2171b1){if(_0x11f3cd[_0x98cd('0x57')]){_0x11f3cd[_0x98cd('0x57')]['attrs']=widgetAttributes(_0x11f3cd[_0x98cd('0x57')]);}return db['DashboardItem'][_0x98cd('0x56')](_0x11f3cd[_0x98cd('0x57')],{})['then'](respondWithResult(_0x2171b1,0xc9))['catch'](handleError(_0x2171b1,null));};exports['update']=function(_0x487762,_0x13d5c3){if(_0x487762['body']['id']){delete _0x487762[_0x98cd('0x57')]['id'];}_0x487762[_0x98cd('0x57')][_0x98cd('0x42')]=widgetAttributes(_0x487762[_0x98cd('0x57')]);return db['DashboardItem'][_0x98cd('0x3d')]({'where':{'id':_0x487762[_0x98cd('0x30')]['id']}})['then'](handleEntityNotFound(_0x13d5c3,null))[_0x98cd('0x2b')](saveUpdates(_0x487762[_0x98cd('0x57')],null))[_0x98cd('0x2b')](respondWithResult(_0x13d5c3,null))[_0x98cd('0x3e')](handleError(_0x13d5c3,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 9d6bc0d..6e653e5 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 _0x0298=['hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit'];(function(_0x3f6b1b,_0x58d3d6){var _0x4a3d2b=function(_0x5648f0){while(--_0x5648f0){_0x3f6b1b['push'](_0x3f6b1b['shift']());}};_0x4a3d2b(++_0x58d3d6);}(_0x0298,0x1bb));var _0x8029=function(_0x5edef8,_0x7af9a9){_0x5edef8=_0x5edef8-0x0;var _0x5438f6=_0x0298[_0x5edef8];return _0x5438f6;};'use strict';var EventEmitter=require(_0x8029('0x0'));var DashboardItem=require(_0x8029('0x1'))['db'][_0x8029('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x8029('0x3')](0x0);var events={'afterCreate':_0x8029('0x4'),'afterUpdate':_0x8029('0x5'),'afterDestroy':_0x8029('0x6')};function emitEvent(_0x5c4fe7){return function(_0x46de94,_0x1df48e,_0x1ad32c){DashboardItemEvents[_0x8029('0x7')](_0x5c4fe7+':'+_0x46de94['id'],_0x46de94);DashboardItemEvents[_0x8029('0x7')](_0x5c4fe7,_0x46de94);_0x1ad32c(null);};}for(var e in events){if(events[_0x8029('0x8')](e)){var event=events[e];DashboardItem[_0x8029('0x9')](e,emitEvent(event));}}module[_0x8029('0xa')]=DashboardItemEvents; \ No newline at end of file +var _0x68c7=['emit','exports','events','../../mysqldb','remove'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x68c7,0x16a));var _0x768c=function(_0x275726,_0x4e8fa1){_0x275726=_0x275726-0x0;var _0x42da70=_0x68c7[_0x275726];return _0x42da70;};'use strict';var EventEmitter=require(_0x768c('0x0'));var DashboardItem=require(_0x768c('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x768c('0x2')};function emitEvent(_0xc4b8e1){return function(_0x37bd43,_0x53bd8c,_0x79fc47){DashboardItemEvents[_0x768c('0x3')](_0xc4b8e1+':'+_0x37bd43['id'],_0x37bd43);DashboardItemEvents[_0x768c('0x3')](_0xc4b8e1,_0x37bd43);_0x79fc47(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x768c('0x4')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index be1bddb..d96de76 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 _0x7a43=['../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x421e36,_0x18776e){var _0x20b3e3=function(_0x767de4){while(--_0x767de4){_0x421e36['push'](_0x421e36['shift']());}};_0x20b3e3(++_0x18776e);}(_0x7a43,0x13e));var _0x37a4=function(_0x4af9e8,_0x3f52a7){_0x4af9e8=_0x4af9e8-0x0;var _0x1e104a=_0x7a43[_0x4af9e8];return _0x1e104a;};'use strict';var _=require('lodash');var util=require(_0x37a4('0x0'));var logger=require(_0x37a4('0x1'))(_0x37a4('0x2'));var moment=require(_0x37a4('0x3'));var BPromise=require(_0x37a4('0x4'));var rp=require(_0x37a4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x37a4('0x6'));var config=require(_0x37a4('0x7'));var attributes=require(_0x37a4('0x8'));module[_0x37a4('0x9')]=function(_0x268bbf,_0x10dc66){return _0x268bbf[_0x37a4('0xa')](_0x37a4('0xb'),attributes,{'tableName':_0x37a4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8deb=['api','moment','request-promise','rimraf','../../config/environment','exports','define','DashboardItem','dashboard_items','lodash','util'];(function(_0x478c8a,_0x9afc92){var _0x3b6b3e=function(_0x37634e){while(--_0x37634e){_0x478c8a['push'](_0x478c8a['shift']());}};_0x3b6b3e(++_0x9afc92);}(_0x8deb,0xf0));var _0xb8de=function(_0x203cf5,_0x8421e0){_0x203cf5=_0x203cf5-0x0;var _0x17a51d=_0x8deb[_0x203cf5];return _0x17a51d;};'use strict';var _=require(_0xb8de('0x0'));var util=require(_0xb8de('0x1'));var logger=require('../../config/logger')(_0xb8de('0x2'));var moment=require(_0xb8de('0x3'));var BPromise=require('bluebird');var rp=require(_0xb8de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb8de('0x5'));var config=require(_0xb8de('0x6'));var attributes=require('./dashboardItem.attributes');module[_0xb8de('0x7')]=function(_0x17a743,_0x1cfcd4){return _0x17a743[_0xb8de('0x8')](_0xb8de('0x9'),attributes,{'tableName':_0xb8de('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 03373ba..02b949b 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 _0x0370=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboardItem.socket','register','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x51a6d6,_0x3c9c49){var _0x5ef1a8=function(_0x8ff84a){while(--_0x8ff84a){_0x51a6d6['push'](_0x51a6d6['shift']());}};_0x5ef1a8(++_0x3c9c49);}(_0x0370,0x1e6));var _0x0037=function(_0x5729bc,_0xd5e521){_0x5729bc=_0x5729bc-0x0;var _0x2f6218=_0x0370[_0x5729bc];return _0x2f6218;};'use strict';var _=require(_0x0037('0x0'));var util=require(_0x0037('0x1'));var moment=require(_0x0037('0x2'));var BPromise=require(_0x0037('0x3'));var rs=require(_0x0037('0x4'));var fs=require('fs');var Redis=require(_0x0037('0x5'));var db=require(_0x0037('0x6'))['db'];var utils=require(_0x0037('0x7'));var logger=require(_0x0037('0x8'))(_0x0037('0x9'));var config=require(_0x0037('0xa'));var jayson=require(_0x0037('0xb'));var client=jayson[_0x0037('0xc')][_0x0037('0xd')]({'port':0x232a});config[_0x0037('0xe')]=_[_0x0037('0xf')](config[_0x0037('0xe')],{'host':_0x0037('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0037('0xe')]));require(_0x0037('0x11'))[_0x0037('0x12')](socket);function respondWithRpcPromise(_0x104a81,_0x3562ba,_0x2dabea){return new BPromise(function(_0x557ed0,_0x34b5a3){return client['request'](_0x104a81,_0x2dabea)['then'](function(_0x1d69bd){logger['info'](_0x0037('0x13'),_0x3562ba,_0x0037('0x14'));logger['debug'](_0x0037('0x15'),_0x3562ba,'request\x20sent',JSON[_0x0037('0x16')](_0x1d69bd));if(_0x1d69bd[_0x0037('0x17')]){if(_0x1d69bd[_0x0037('0x17')]['code']===0x1f4){logger[_0x0037('0x17')](_0x0037('0x13'),_0x3562ba,_0x1d69bd[_0x0037('0x17')]['message']);return _0x34b5a3(_0x1d69bd[_0x0037('0x17')][_0x0037('0x18')]);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x3562ba,_0x1d69bd[_0x0037('0x17')][_0x0037('0x18')]);return _0x557ed0(_0x1d69bd[_0x0037('0x17')][_0x0037('0x18')]);}else{logger[_0x0037('0x19')](_0x0037('0x13'),_0x3562ba,_0x0037('0x14'));_0x557ed0(_0x1d69bd[_0x0037('0x1a')][_0x0037('0x18')]);}})['catch'](function(_0x25b173){logger['error']('DashboardItem,\x20%s,\x20%s',_0x3562ba,_0x25b173);_0x34b5a3(_0x25b173);});});} \ No newline at end of file +var _0x0326=['redis','defaults','localhost','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x4207a6,_0x3a3110){var _0x42b37a=function(_0x574360){while(--_0x574360){_0x4207a6['push'](_0x4207a6['shift']());}};_0x42b37a(++_0x3a3110);}(_0x0326,0x1a6));var _0x6032=function(_0x1c7fc2,_0x5eff2b){_0x1c7fc2=_0x1c7fc2-0x0;var _0x5d94da=_0x0326[_0x1c7fc2];return _0x5d94da;};'use strict';var _=require(_0x6032('0x0'));var util=require(_0x6032('0x1'));var moment=require(_0x6032('0x2'));var BPromise=require(_0x6032('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6032('0x4'));var db=require(_0x6032('0x5'))['db'];var utils=require(_0x6032('0x6'));var logger=require('../../config/logger')(_0x6032('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6032('0x8')][_0x6032('0x9')]({'port':0x232a});config[_0x6032('0xa')]=_[_0x6032('0xb')](config[_0x6032('0xa')],{'host':_0x6032('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6032('0xa')]));require(_0x6032('0xd'))['register'](socket);function respondWithRpcPromise(_0x5e4155,_0x437d5a,_0x109735){return new BPromise(function(_0x2c9036,_0x4850aa){return client[_0x6032('0xe')](_0x5e4155,_0x109735)[_0x6032('0xf')](function(_0xcafcf4){logger[_0x6032('0x10')](_0x6032('0x11'),_0x437d5a,_0x6032('0x12'));logger[_0x6032('0x13')](_0x6032('0x14'),_0x437d5a,'request\x20sent',JSON[_0x6032('0x15')](_0xcafcf4));if(_0xcafcf4[_0x6032('0x16')]){if(_0xcafcf4[_0x6032('0x16')][_0x6032('0x17')]===0x1f4){logger[_0x6032('0x16')]('DashboardItem,\x20%s,\x20%s',_0x437d5a,_0xcafcf4[_0x6032('0x16')]['message']);return _0x4850aa(_0xcafcf4[_0x6032('0x16')][_0x6032('0x18')]);}logger[_0x6032('0x16')](_0x6032('0x11'),_0x437d5a,_0xcafcf4[_0x6032('0x16')][_0x6032('0x18')]);return _0x2c9036(_0xcafcf4[_0x6032('0x16')][_0x6032('0x18')]);}else{logger['info'](_0x6032('0x11'),_0x437d5a,_0x6032('0x12'));_0x2c9036(_0xcafcf4[_0x6032('0x19')][_0x6032('0x18')]);}})[_0x6032('0x1a')](function(_0x458642){logger['error'](_0x6032('0x11'),_0x437d5a,_0x458642);_0x4850aa(_0x458642);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index f0e2369..0b61788 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 _0xd314=['save','update','emit','removeListener','register','length','dashboardItem:','./dashboardItem.events'];(function(_0x3f3297,_0x680e2b){var _0x57b009=function(_0x89814){while(--_0x89814){_0x3f3297['push'](_0x3f3297['shift']());}};_0x57b009(++_0x680e2b);}(_0xd314,0x1e7));var _0x4d31=function(_0x52877a,_0x18174e){_0x52877a=_0x52877a-0x0;var _0x1859d7=_0xd314[_0x52877a];return _0x1859d7;};'use strict';var DashboardItemEvents=require(_0x4d31('0x0'));var events=[_0x4d31('0x1'),'remove',_0x4d31('0x2')];function createListener(_0x4fdf3b,_0x137768){return function(_0x5b6d34){_0x137768[_0x4d31('0x3')](_0x4fdf3b,_0x5b6d34);};}function removeListener(_0x53f6e6,_0x2b8edd){return function(){DashboardItemEvents[_0x4d31('0x4')](_0x53f6e6,_0x2b8edd);};}exports[_0x4d31('0x5')]=function(_0x3599f3){for(var _0xb7ac6a=0x0,_0x3809ad=events[_0x4d31('0x6')];_0xb7ac6a<_0x3809ad;_0xb7ac6a++){var _0x5c84e8=events[_0xb7ac6a];var _0x382201=createListener(_0x4d31('0x7')+_0x5c84e8,_0x3599f3);DashboardItemEvents['on'](_0x5c84e8,_0x382201);}}; \ No newline at end of file +var _0x9cc5=['update','emit','removeListener','register','length','./dashboardItem.events','save','remove'];(function(_0x1c1780,_0x93cb2){var _0x5eb4ae=function(_0x11a831){while(--_0x11a831){_0x1c1780['push'](_0x1c1780['shift']());}};_0x5eb4ae(++_0x93cb2);}(_0x9cc5,0x18d));var _0x59cc=function(_0x33a228,_0xd0b445){_0x33a228=_0x33a228-0x0;var _0xf7b87d=_0x9cc5[_0x33a228];return _0xf7b87d;};'use strict';var DashboardItemEvents=require(_0x59cc('0x0'));var events=[_0x59cc('0x1'),_0x59cc('0x2'),_0x59cc('0x3')];function createListener(_0x5b55b9,_0x4db7a5){return function(_0x1cb00a){_0x4db7a5[_0x59cc('0x4')](_0x5b55b9,_0x1cb00a);};}function removeListener(_0xb24986,_0x689e59){return function(){DashboardItemEvents[_0x59cc('0x5')](_0xb24986,_0x689e59);};}exports[_0x59cc('0x6')]=function(_0x152f96){for(var _0x41a481=0x0,_0x494526=events[_0x59cc('0x7')];_0x41a481<_0x494526;_0x41a481++){var _0x5cd73c=events[_0x41a481];var _0x3ee825=createListener('dashboardItem:'+_0x5cd73c,_0x152f96);DashboardItemEvents['on'](_0x5cd73c,_0x3ee825);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index d1675b4..3fd1077 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 _0xcbbe=['../../components/interaction/service','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','util','path','express','Router','../../components/auth/service'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0xcbbe,0xaf));var _0xecbb=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xcbbe[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0xecbb('0x0'));var path=require(_0xecbb('0x1'));var timeout=require('connect-timeout');var express=require(_0xecbb('0x2'));var router=express[_0xecbb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xecbb('0x4'));var interaction=require(_0xecbb('0x5'));var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router['get'](_0xecbb('0x6'),auth[_0xecbb('0x7')](),controller[_0xecbb('0x8')]);router[_0xecbb('0x9')]('/',auth[_0xecbb('0x7')](),controller[_0xecbb('0xa')]);router[_0xecbb('0xb')](_0xecbb('0x6'),auth[_0xecbb('0x7')](),controller[_0xecbb('0xc')]);router['delete'](_0xecbb('0x6'),auth[_0xecbb('0x7')](),controller[_0xecbb('0xd')]);module[_0xecbb('0xe')]=router; \ No newline at end of file +var _0x6b22=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','show','post','create','update','delete','path','connect-timeout','express'];(function(_0x14d3a3,_0x2cfbe9){var _0x2c0233=function(_0x430f21){while(--_0x430f21){_0x14d3a3['push'](_0x14d3a3['shift']());}};_0x2c0233(++_0x2cfbe9);}(_0x6b22,0x1a1));var _0x26b2=function(_0x313ea1,_0x2d2f67){_0x313ea1=_0x313ea1-0x0;var _0x17dcfe=_0x6b22[_0x313ea1];return _0x17dcfe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x26b2('0x0'));var timeout=require(_0x26b2('0x1'));var express=require(_0x26b2('0x2'));var router=express['Router']();var fs_extra=require(_0x26b2('0x3'));var auth=require(_0x26b2('0x4'));var interaction=require(_0x26b2('0x5'));var config=require(_0x26b2('0x6'));var controller=require(_0x26b2('0x7'));router['get'](_0x26b2('0x8'),auth[_0x26b2('0x9')](),controller[_0x26b2('0xa')]);router[_0x26b2('0xb')]('/',auth[_0x26b2('0x9')](),controller[_0x26b2('0xc')]);router['put']('/:id',auth[_0x26b2('0x9')](),controller[_0x26b2('0xd')]);router[_0x26b2('0xe')](_0x26b2('0x8'),auth[_0x26b2('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index f001d72..d4507af 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 _0x95a9=['third','exports','STRING','first','second'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x95a9,0x17d));var _0x995a=function(_0x1aa4c8,_0x3e4c6d){_0x1aa4c8=_0x1aa4c8-0x0;var _0x35edc5=_0x95a9[_0x1aa4c8];return _0x35edc5;};'use strict';var Sequelize=require('sequelize');module[_0x995a('0x0')]={'name':{'type':Sequelize[_0x995a('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x995a('0x2'),_0x995a('0x3'),_0x995a('0x4')),'allowNull':![],'defaultValue':_0x995a('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0832=['sequelize','exports','STRING','ENUM','first','second','third'];(function(_0x42dbdb,_0x9becea){var _0x4a5ca6=function(_0x2b991c){while(--_0x2b991c){_0x42dbdb['push'](_0x42dbdb['shift']());}};_0x4a5ca6(++_0x9becea);}(_0x0832,0x15e));var _0x2083=function(_0x1a3625,_0x3c9158){_0x1a3625=_0x1a3625-0x0;var _0x1adcbc=_0x0832[_0x1a3625];return _0x1adcbc;};'use strict';var Sequelize=require(_0x2083('0x0'));module[_0x2083('0x1')]={'name':{'type':Sequelize[_0x2083('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x2083('0x3')](_0x2083('0x4'),_0x2083('0x5'),_0x2083('0x6')),'allowNull':![],'defaultValue':_0x2083('0x4')},'description':{'type':Sequelize[_0x2083('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 31d60e4..e239dc7 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 _0x613e=['key','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','includeAll','findAll','catch','show','intersection','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','save','then','destroy','Dispositions','end','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x613e,0x1e1));var _0xe613=function(_0x4ced65,_0x30df8f){_0x4ced65=_0x4ced65-0x0;var _0x33868d=_0x613e[_0x4ced65];return _0x33868d;};'use strict';var emlformat=require(_0xe613('0x0'));var rimraf=require(_0xe613('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe613('0x2'));var moment=require('moment');var BPromise=require(_0xe613('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe613('0x4'));var sox=require(_0xe613('0x5'));var csv=require(_0xe613('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe613('0x7'));var _=require(_0xe613('0x8'));var squel=require(_0xe613('0x9'));var crypto=require(_0xe613('0xa'));var jsforce=require(_0xe613('0xb'));var deskjs=require(_0xe613('0xc'));var toCsv=require(_0xe613('0x6'));var querystring=require(_0xe613('0xd'));var Papa=require('papaparse');var Redis=require(_0xe613('0xe'));var authService=require(_0xe613('0xf'));var qs=require(_0xe613('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe613('0x11'))(_0xe613('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe613('0x13'));var db=require(_0xe613('0x14'))['db'];function respondWithStatusCode(_0xed7fc7,_0x2ecda1){_0x2ecda1=_0x2ecda1||0xcc;return function(_0x26cd94){if(_0x26cd94){return _0xed7fc7[_0xe613('0x15')](_0x2ecda1);}return _0xed7fc7['status'](_0x2ecda1)['end']();};}function respondWithResult(_0x1b60b4,_0x38db59){_0x38db59=_0x38db59||0xc8;return function(_0x31e864){if(_0x31e864){return _0x1b60b4[_0xe613('0x16')](_0x38db59)[_0xe613('0x17')](_0x31e864);}};}function respondWithFilteredResult(_0x353df7,_0x235639){return function(_0x47d4ac){if(_0x47d4ac){var _0x563fe9=typeof _0x235639[_0xe613('0x18')]==='undefined'&&typeof _0x235639[_0xe613('0x19')]===_0xe613('0x1a');var _0x55faa2=_0x47d4ac[_0xe613('0x1b')];var _0x7af6d5=_0x563fe9?0x0:_0x235639['offset'];var _0x2a3049=_0x563fe9?_0x47d4ac[_0xe613('0x1b')]:_0x235639[_0xe613('0x18')]+_0x235639['limit'];var _0x35dad7;if(_0x2a3049>=_0x55faa2){_0x2a3049=_0x55faa2;_0x35dad7=0xc8;}else{_0x35dad7=0xce;}_0x353df7['status'](_0x35dad7);return _0x353df7[_0xe613('0x1c')]('Content-Range',_0x7af6d5+'-'+_0x2a3049+'/'+_0x55faa2)[_0xe613('0x17')](_0x47d4ac);}return null;};}function patchUpdates(_0x5104c0){return function(_0xb7f59c){try{jsonpatch['apply'](_0xb7f59c,_0x5104c0,!![]);}catch(_0x434758){return BPromise['reject'](_0x434758);}return _0xb7f59c[_0xe613('0x1d')]();};}function saveUpdates(_0x195b91,_0x48c348){return function(_0xdc0601){if(_0xdc0601){return _0xdc0601['update'](_0x195b91)[_0xe613('0x1e')](function(_0x83a00f){return _0x83a00f;});}return null;};}function removeEntity(_0x449efb,_0x10c975){return function(_0x50d3dc){if(_0x50d3dc){return _0x50d3dc[_0xe613('0x1f')]()[_0xe613('0x1e')](function(){var _0x2670ab=_0x50d3dc['get']({'plain':!![]});var _0xce5151=_0xe613('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0xce5151,'resourceId':_0x2670ab['id']}})[_0xe613('0x1e')](function(){return _0x50d3dc;});})[_0xe613('0x1e')](function(){_0x449efb['status'](0xcc)[_0xe613('0x21')]();});}};}function handleEntityNotFound(_0x2fecc4,_0x29ac2f){return function(_0x42b5eb){if(!_0x42b5eb){_0x2fecc4[_0xe613('0x15')](0x194);}return _0x42b5eb;};}function handleError(_0x4e1aa5,_0x11f461){_0x11f461=_0x11f461||0x1f4;return function(_0x68bb16){logger[_0xe613('0x22')](_0x68bb16[_0xe613('0x23')]);if(_0x68bb16[_0xe613('0x24')]){delete _0x68bb16[_0xe613('0x24')];}_0x4e1aa5[_0xe613('0x16')](_0x11f461)[_0xe613('0x25')](_0x68bb16);};}exports[_0xe613('0x26')]=function(_0x54b055,_0x2b718f){var _0x5defa7={},_0x418a79={},_0x306fc5={'count':0x0,'rows':[]};var _0xc11152=_[_0xe613('0x27')](db[_0xe613('0x28')][_0xe613('0x29')],function(_0x11a872){return{'name':_0x11a872[_0xe613('0x2a')],'type':_0x11a872[_0xe613('0x2b')][_0xe613('0x2c')]};});_0x418a79[_0xe613('0x2d')]=_['map'](_0xc11152,'name');_0x418a79[_0xe613('0x2e')]=_[_0xe613('0x2f')](_0x54b055[_0xe613('0x2e')]);_0x418a79[_0xe613('0x30')]=_['intersection'](_0x418a79[_0xe613('0x2d')],_0x418a79['query']);_0x5defa7['attributes']=_['intersection'](_0x418a79[_0xe613('0x2d')],qs['fields'](_0x54b055[_0xe613('0x2e')][_0xe613('0x31')]));_0x5defa7['attributes']=_0x5defa7[_0xe613('0x32')]['length']?_0x5defa7[_0xe613('0x32')]:_0x418a79['model'];if(!_0x54b055[_0xe613('0x2e')][_0xe613('0x33')](_0xe613('0x34'))){_0x5defa7[_0xe613('0x19')]=qs[_0xe613('0x19')](_0x54b055[_0xe613('0x2e')][_0xe613('0x19')]);_0x5defa7[_0xe613('0x18')]=qs[_0xe613('0x18')](_0x54b055[_0xe613('0x2e')][_0xe613('0x18')]);}_0x5defa7['order']=qs['sort'](_0x54b055[_0xe613('0x2e')][_0xe613('0x35')]);_0x5defa7[_0xe613('0x36')]=qs['filters'](_['pick'](_0x54b055[_0xe613('0x2e')],_0x418a79[_0xe613('0x30')]),_0xc11152);if(_0x54b055[_0xe613('0x2e')][_0xe613('0x37')]){_0x5defa7[_0xe613('0x36')]=_[_0xe613('0x38')](_0x5defa7[_0xe613('0x36')],{'$or':_[_0xe613('0x27')](_0xc11152,function(_0x499bc5){if(_0x499bc5['type']!=='VIRTUAL'){var _0x423384={};_0x423384[_0x499bc5[_0xe613('0x24')]]={'$like':'%'+_0x54b055[_0xe613('0x2e')][_0xe613('0x37')]+'%'};return _0x423384;}})});}_0x5defa7=_[_0xe613('0x38')]({},_0x5defa7,_0x54b055['options']);var _0x45c438={'where':_0x5defa7[_0xe613('0x36')]};return db['Disposition'][_0xe613('0x1b')](_0x45c438)['then'](function(_0x300fc1){_0x306fc5['count']=_0x300fc1;if(_0x54b055[_0xe613('0x2e')][_0xe613('0x39')]){_0x5defa7['include']=[{'all':!![]}];}return db[_0xe613('0x28')][_0xe613('0x3a')](_0x5defa7);})[_0xe613('0x1e')](function(_0x3ad4ba){_0x306fc5['rows']=_0x3ad4ba;return _0x306fc5;})['then'](respondWithFilteredResult(_0x2b718f,_0x5defa7))[_0xe613('0x3b')](handleError(_0x2b718f,null));};exports[_0xe613('0x3c')]=function(_0xa5972b,_0x1c6677){var _0x1c6847={'raw':!![],'where':{'id':_0xa5972b['params']['id']}},_0x2c3519={};_0x2c3519[_0xe613('0x2d')]=_['keys'](db['Disposition'][_0xe613('0x29')]);_0x2c3519[_0xe613('0x2e')]=_['keys'](_0xa5972b['query']);_0x2c3519[_0xe613('0x30')]=_[_0xe613('0x3d')](_0x2c3519[_0xe613('0x2d')],_0x2c3519[_0xe613('0x2e')]);_0x1c6847['attributes']=_[_0xe613('0x3d')](_0x2c3519[_0xe613('0x2d')],qs['fields'](_0xa5972b[_0xe613('0x2e')][_0xe613('0x31')]));_0x1c6847[_0xe613('0x32')]=_0x1c6847[_0xe613('0x32')]['length']?_0x1c6847['attributes']:_0x2c3519[_0xe613('0x2d')];if(_0xa5972b[_0xe613('0x2e')][_0xe613('0x39')]){_0x1c6847[_0xe613('0x3e')]=[{'all':!![]}];}_0x1c6847=_[_0xe613('0x38')]({},_0x1c6847,_0xa5972b['options']);return db[_0xe613('0x28')][_0xe613('0x3f')](_0x1c6847)['then'](handleEntityNotFound(_0x1c6677,null))[_0xe613('0x1e')](respondWithResult(_0x1c6677,null))[_0xe613('0x3b')](handleError(_0x1c6677,null));};exports[_0xe613('0x40')]=function(_0x597b26,_0x4734a3){return db[_0xe613('0x28')][_0xe613('0x40')](_0x597b26[_0xe613('0x41')],{})[_0xe613('0x1e')](function(_0x2af763){var _0x18f81d=_0x597b26[_0xe613('0x42')][_0xe613('0x43')]({'plain':!![]});if(!_0x18f81d)throw new Error(_0xe613('0x44'));if(_0x18f81d[_0xe613('0x45')]===_0xe613('0x42')){var _0x1c2965=_0x2af763[_0xe613('0x43')]({'plain':!![]});var _0x1c1be5='Dispositions';return db['UserProfileSection'][_0xe613('0x3f')]({'where':{'name':_0x1c1be5,'userProfileId':_0x18f81d[_0xe613('0x46')]},'raw':!![]})['then'](function(_0x4b239e){if(_0x4b239e&&_0x4b239e['autoAssociation']===0x0){return db[_0xe613('0x47')]['create']({'name':_0x1c2965[_0xe613('0x24')],'resourceId':_0x1c2965['id'],'type':_0x4b239e[_0xe613('0x24')],'sectionId':_0x4b239e['id']},{})[_0xe613('0x1e')](function(){return _0x2af763;});}else{return _0x2af763;}})[_0xe613('0x3b')](function(_0x183482){logger[_0xe613('0x22')](_0xe613('0x48'),_0x183482);throw _0x183482;});}return _0x2af763;})[_0xe613('0x1e')](respondWithResult(_0x4734a3,0xc9))[_0xe613('0x3b')](handleError(_0x4734a3,null));};exports[_0xe613('0x49')]=function(_0x1fbc0f,_0x335bc4){if(_0x1fbc0f[_0xe613('0x41')]['id']){delete _0x1fbc0f[_0xe613('0x41')]['id'];}return db[_0xe613('0x28')]['find']({'where':{'id':_0x1fbc0f[_0xe613('0x4a')]['id']}})[_0xe613('0x1e')](handleEntityNotFound(_0x335bc4,null))[_0xe613('0x1e')](saveUpdates(_0x1fbc0f[_0xe613('0x41')],null))[_0xe613('0x1e')](respondWithResult(_0x335bc4,null))[_0xe613('0x3b')](handleError(_0x335bc4,null));};exports[_0xe613('0x1f')]=function(_0x2b17ba,_0x287ccf){return db[_0xe613('0x28')][_0xe613('0x3f')]({'where':{'id':_0x2b17ba[_0xe613('0x4a')]['id']}})[_0xe613('0x1e')](handleEntityNotFound(_0x287ccf,null))[_0xe613('0x1e')](removeEntity(_0x287ccf,null))[_0xe613('0x3b')](handleError(_0x287ccf,null));}; \ No newline at end of file +var _0x196b=['lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','Content-Range','reject','save','get','Dispositions','UserProfileResource','destroy','then','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','findAll','rows','catch','params','keys','length','includeAll','include','options','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','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x5499e6,_0x3b73d0){var _0x3152d6=function(_0x26f5f7){while(--_0x26f5f7){_0x5499e6['push'](_0x5499e6['shift']());}};_0x3152d6(++_0x3b73d0);}(_0x196b,0x9d));var _0xb196=function(_0x22ea74,_0x5c937b){_0x22ea74=_0x22ea74-0x0;var _0x426260=_0x196b[_0x22ea74];return _0x426260;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb196('0x0'));var jsonpatch=require(_0xb196('0x1'));var rp=require(_0xb196('0x2'));var moment=require(_0xb196('0x3'));var BPromise=require(_0xb196('0x4'));var Mustache=require(_0xb196('0x5'));var util=require(_0xb196('0x6'));var path=require(_0xb196('0x7'));var sox=require(_0xb196('0x8'));var csv=require('to-csv');var ejs=require(_0xb196('0x9'));var fs=require('fs');var fs_extra=require(_0xb196('0xa'));var _=require(_0xb196('0xb'));var squel=require(_0xb196('0xc'));var crypto=require('crypto');var jsforce=require(_0xb196('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb196('0xe'));var querystring=require(_0xb196('0xf'));var Papa=require(_0xb196('0x10'));var Redis=require(_0xb196('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb196('0x12'));var as=require(_0xb196('0x13'));var hardwareService=require(_0xb196('0x14'));var logger=require(_0xb196('0x15'))('api');var utils=require(_0xb196('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb196('0x17'));var db=require(_0xb196('0x18'))['db'];function respondWithStatusCode(_0x292915,_0x3deb0f){_0x3deb0f=_0x3deb0f||0xcc;return function(_0x30dd59){if(_0x30dd59){return _0x292915['sendStatus'](_0x3deb0f);}return _0x292915[_0xb196('0x19')](_0x3deb0f)[_0xb196('0x1a')]();};}function respondWithResult(_0x1473f3,_0x44b7fa){_0x44b7fa=_0x44b7fa||0xc8;return function(_0x184886){if(_0x184886){return _0x1473f3[_0xb196('0x19')](_0x44b7fa)[_0xb196('0x1b')](_0x184886);}};}function respondWithFilteredResult(_0x24b266,_0x5d059f){return function(_0x3e8cb1){if(_0x3e8cb1){var _0x411dc0=typeof _0x5d059f[_0xb196('0x1c')]===_0xb196('0x1d')&&typeof _0x5d059f['limit']===_0xb196('0x1d');var _0x32402f=_0x3e8cb1['count'];var _0x2a85c4=_0x411dc0?0x0:_0x5d059f[_0xb196('0x1c')];var _0x3f8adf=_0x411dc0?_0x3e8cb1[_0xb196('0x1e')]:_0x5d059f[_0xb196('0x1c')]+_0x5d059f['limit'];var _0x28d593;if(_0x3f8adf>=_0x32402f){_0x3f8adf=_0x32402f;_0x28d593=0xc8;}else{_0x28d593=0xce;}_0x24b266[_0xb196('0x19')](_0x28d593);return _0x24b266['set'](_0xb196('0x1f'),_0x2a85c4+'-'+_0x3f8adf+'/'+_0x32402f)[_0xb196('0x1b')](_0x3e8cb1);}return null;};}function patchUpdates(_0x2d0519){return function(_0x3f3ac2){try{jsonpatch['apply'](_0x3f3ac2,_0x2d0519,!![]);}catch(_0x5ba94d){return BPromise[_0xb196('0x20')](_0x5ba94d);}return _0x3f3ac2[_0xb196('0x21')]();};}function saveUpdates(_0x3d3f69,_0x290296){return function(_0x3839f0){if(_0x3839f0){return _0x3839f0['update'](_0x3d3f69)['then'](function(_0x585176){return _0x585176;});}return null;};}function removeEntity(_0x4deb2b,_0x342745){return function(_0x349c5e){if(_0x349c5e){return _0x349c5e['destroy']()['then'](function(){var _0x4ebf7c=_0x349c5e[_0xb196('0x22')]({'plain':!![]});var _0x8209ac=_0xb196('0x23');return db[_0xb196('0x24')][_0xb196('0x25')]({'where':{'type':_0x8209ac,'resourceId':_0x4ebf7c['id']}})[_0xb196('0x26')](function(){return _0x349c5e;});})[_0xb196('0x26')](function(){_0x4deb2b[_0xb196('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ff1f9,_0x5e4e6c){return function(_0x50f52c){if(!_0x50f52c){_0x1ff1f9['sendStatus'](0x194);}return _0x50f52c;};}function handleError(_0x1a53cc,_0x149d4f){_0x149d4f=_0x149d4f||0x1f4;return function(_0x16dd6d){logger[_0xb196('0x27')](_0x16dd6d[_0xb196('0x28')]);if(_0x16dd6d['name']){delete _0x16dd6d[_0xb196('0x29')];}_0x1a53cc[_0xb196('0x19')](_0x149d4f)[_0xb196('0x2a')](_0x16dd6d);};}exports[_0xb196('0x2b')]=function(_0x31b214,_0x1988af){var _0x4e678d={},_0x300838={},_0x3a315f={'count':0x0,'rows':[]};var _0x8f6a36=_[_0xb196('0x2c')](db[_0xb196('0x2d')][_0xb196('0x2e')],function(_0x56f15e){return{'name':_0x56f15e[_0xb196('0x2f')],'type':_0x56f15e[_0xb196('0x30')][_0xb196('0x31')]};});_0x300838[_0xb196('0x32')]=_[_0xb196('0x2c')](_0x8f6a36,_0xb196('0x29'));_0x300838[_0xb196('0x33')]=_['keys'](_0x31b214['query']);_0x300838[_0xb196('0x34')]=_[_0xb196('0x35')](_0x300838[_0xb196('0x32')],_0x300838[_0xb196('0x33')]);_0x4e678d[_0xb196('0x36')]=_[_0xb196('0x35')](_0x300838['model'],qs[_0xb196('0x37')](_0x31b214[_0xb196('0x33')][_0xb196('0x37')]));_0x4e678d['attributes']=_0x4e678d[_0xb196('0x36')]['length']?_0x4e678d[_0xb196('0x36')]:_0x300838[_0xb196('0x32')];if(!_0x31b214[_0xb196('0x33')][_0xb196('0x38')](_0xb196('0x39'))){_0x4e678d[_0xb196('0x3a')]=qs['limit'](_0x31b214[_0xb196('0x33')][_0xb196('0x3a')]);_0x4e678d[_0xb196('0x1c')]=qs['offset'](_0x31b214['query'][_0xb196('0x1c')]);}_0x4e678d['order']=qs[_0xb196('0x3b')](_0x31b214[_0xb196('0x33')][_0xb196('0x3b')]);_0x4e678d[_0xb196('0x3c')]=qs[_0xb196('0x34')](_['pick'](_0x31b214[_0xb196('0x33')],_0x300838[_0xb196('0x34')]),_0x8f6a36);if(_0x31b214[_0xb196('0x33')][_0xb196('0x3d')]){_0x4e678d['where']=_[_0xb196('0x3e')](_0x4e678d[_0xb196('0x3c')],{'$or':_[_0xb196('0x2c')](_0x8f6a36,function(_0x11b48b){if(_0x11b48b[_0xb196('0x30')]!==_0xb196('0x3f')){var _0x5d9c49={};_0x5d9c49[_0x11b48b[_0xb196('0x29')]]={'$like':'%'+_0x31b214[_0xb196('0x33')][_0xb196('0x3d')]+'%'};return _0x5d9c49;}})});}_0x4e678d=_[_0xb196('0x3e')]({},_0x4e678d,_0x31b214['options']);var _0x1e2b99={'where':_0x4e678d[_0xb196('0x3c')]};return db[_0xb196('0x2d')]['count'](_0x1e2b99)['then'](function(_0x390f7d){_0x3a315f[_0xb196('0x1e')]=_0x390f7d;if(_0x31b214[_0xb196('0x33')]['includeAll']){_0x4e678d['include']=[{'all':!![]}];}return db[_0xb196('0x2d')][_0xb196('0x40')](_0x4e678d);})[_0xb196('0x26')](function(_0x12a460){_0x3a315f[_0xb196('0x41')]=_0x12a460;return _0x3a315f;})[_0xb196('0x26')](respondWithFilteredResult(_0x1988af,_0x4e678d))[_0xb196('0x42')](handleError(_0x1988af,null));};exports['show']=function(_0x184ddf,_0x38bdd6){var _0x2ad64f={'raw':!![],'where':{'id':_0x184ddf[_0xb196('0x43')]['id']}},_0x3171c1={};_0x3171c1[_0xb196('0x32')]=_[_0xb196('0x44')](db['Disposition'][_0xb196('0x2e')]);_0x3171c1['query']=_[_0xb196('0x44')](_0x184ddf[_0xb196('0x33')]);_0x3171c1[_0xb196('0x34')]=_[_0xb196('0x35')](_0x3171c1[_0xb196('0x32')],_0x3171c1['query']);_0x2ad64f[_0xb196('0x36')]=_['intersection'](_0x3171c1['model'],qs[_0xb196('0x37')](_0x184ddf[_0xb196('0x33')][_0xb196('0x37')]));_0x2ad64f[_0xb196('0x36')]=_0x2ad64f[_0xb196('0x36')][_0xb196('0x45')]?_0x2ad64f[_0xb196('0x36')]:_0x3171c1[_0xb196('0x32')];if(_0x184ddf['query'][_0xb196('0x46')]){_0x2ad64f[_0xb196('0x47')]=[{'all':!![]}];}_0x2ad64f=_['merge']({},_0x2ad64f,_0x184ddf[_0xb196('0x48')]);return db[_0xb196('0x2d')][_0xb196('0x49')](_0x2ad64f)['then'](handleEntityNotFound(_0x38bdd6,null))[_0xb196('0x26')](respondWithResult(_0x38bdd6,null))[_0xb196('0x42')](handleError(_0x38bdd6,null));};exports[_0xb196('0x4a')]=function(_0x5f2be5,_0x56d4a8){return db[_0xb196('0x2d')][_0xb196('0x4a')](_0x5f2be5[_0xb196('0x4b')],{})[_0xb196('0x26')](function(_0x1d8e7e){var _0x879b53=_0x5f2be5[_0xb196('0x4c')][_0xb196('0x22')]({'plain':!![]});if(!_0x879b53)throw new Error(_0xb196('0x4d'));if(_0x879b53[_0xb196('0x4e')]===_0xb196('0x4c')){var _0x37bf20=_0x1d8e7e[_0xb196('0x22')]({'plain':!![]});var _0xebfec=_0xb196('0x23');return db[_0xb196('0x4f')]['find']({'where':{'name':_0xebfec,'userProfileId':_0x879b53[_0xb196('0x50')]},'raw':!![]})[_0xb196('0x26')](function(_0x34144f){if(_0x34144f&&_0x34144f[_0xb196('0x51')]===0x0){return db[_0xb196('0x24')][_0xb196('0x4a')]({'name':_0x37bf20[_0xb196('0x29')],'resourceId':_0x37bf20['id'],'type':_0x34144f[_0xb196('0x29')],'sectionId':_0x34144f['id']},{})[_0xb196('0x26')](function(){return _0x1d8e7e;});}else{return _0x1d8e7e;}})['catch'](function(_0x1515ea){logger[_0xb196('0x27')](_0xb196('0x52'),_0x1515ea);throw _0x1515ea;});}return _0x1d8e7e;})[_0xb196('0x26')](respondWithResult(_0x56d4a8,0xc9))[_0xb196('0x42')](handleError(_0x56d4a8,null));};exports[_0xb196('0x53')]=function(_0x1b5e0f,_0x14ca9a){if(_0x1b5e0f[_0xb196('0x4b')]['id']){delete _0x1b5e0f[_0xb196('0x4b')]['id'];}return db['Disposition'][_0xb196('0x49')]({'where':{'id':_0x1b5e0f['params']['id']}})[_0xb196('0x26')](handleEntityNotFound(_0x14ca9a,null))[_0xb196('0x26')](saveUpdates(_0x1b5e0f[_0xb196('0x4b')],null))[_0xb196('0x26')](respondWithResult(_0x14ca9a,null))[_0xb196('0x42')](handleError(_0x14ca9a,null));};exports[_0xb196('0x25')]=function(_0x543296,_0x5ecbb9){return db[_0xb196('0x2d')]['find']({'where':{'id':_0x543296[_0xb196('0x43')]['id']}})[_0xb196('0x26')](handleEntityNotFound(_0x5ecbb9,null))[_0xb196('0x26')](removeEntity(_0x5ecbb9,null))[_0xb196('0x42')](handleError(_0x5ecbb9,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 6931b1c..4625ce4 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 _0x7257=['moment','bluebird','path','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','util','../../config/logger','api'];(function(_0x3a2974,_0x417172){var _0x2b9914=function(_0x4a32de){while(--_0x4a32de){_0x3a2974['push'](_0x3a2974['shift']());}};_0x2b9914(++_0x417172);}(_0x7257,0x1ac));var _0x7725=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0x7257[_0x2ca9d4];return _0x258956;};'use strict';var _=require(_0x7725('0x0'));var util=require(_0x7725('0x1'));var logger=require(_0x7725('0x2'))(_0x7725('0x3'));var moment=require(_0x7725('0x4'));var BPromise=require(_0x7725('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7725('0x6'));var rimraf=require(_0x7725('0x7'));var config=require(_0x7725('0x8'));var attributes=require(_0x7725('0x9'));module[_0x7725('0xa')]=function(_0x4b7ebf,_0x377306){return _0x4b7ebf['define'](_0x7725('0xb'),attributes,{'tableName':_0x7725('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x7725('0xd'),'fields':['name',_0x7725('0xe')]},{'unique':!![],'name':_0x7725('0xf'),'fields':[_0x7725('0x10'),_0x7725('0x11')]},{'unique':!![],'name':_0x7725('0x12'),'fields':['name',_0x7725('0x13')]},{'unique':!![],'name':_0x7725('0x14'),'fields':[_0x7725('0x10'),_0x7725('0x15')]},{'unique':!![],'name':_0x7725('0x16'),'fields':[_0x7725('0x10'),_0x7725('0x17')]},{'unique':!![],'name':_0x7725('0x18'),'fields':[_0x7725('0x10'),_0x7725('0x19')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x7725('0x10'),_0x7725('0x1a')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4e5a=['bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name_chat','name','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','../../config/logger'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x4e5a,0xcd));var _0xa4e5=function(_0x44b91c,_0x483ee5){_0x44b91c=_0x44b91c-0x0;var _0x2a3356=_0x4e5a[_0x44b91c];return _0x2a3356;};'use strict';var _=require('lodash');var util=require(_0xa4e5('0x0'));var logger=require(_0xa4e5('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa4e5('0x2'));var rp=require(_0xa4e5('0x3'));var fs=require('fs');var path=require(_0xa4e5('0x4'));var rimraf=require('rimraf');var config=require(_0xa4e5('0x5'));var attributes=require(_0xa4e5('0x6'));module[_0xa4e5('0x7')]=function(_0x48b419,_0x17afd0){return _0x48b419[_0xa4e5('0x8')](_0xa4e5('0x9'),attributes,{'tableName':_0xa4e5('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xa4e5('0xb'),'fields':['name','ListId']},{'unique':!![],'name':_0xa4e5('0xc'),'fields':[_0xa4e5('0xd'),_0xa4e5('0xe')]},{'unique':!![],'name':'name_mail','fields':[_0xa4e5('0xd'),_0xa4e5('0xf')]},{'unique':!![],'name':_0xa4e5('0x10'),'fields':[_0xa4e5('0xd'),_0xa4e5('0x11')]},{'unique':!![],'name':_0xa4e5('0x12'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0xa4e5('0x13'),'fields':[_0xa4e5('0xd'),_0xa4e5('0x14')]},{'unique':!![],'name':_0xa4e5('0x15'),'fields':['name',_0xa4e5('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index be0c9a2..9730946 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(_0x49f806,_0x10368f){var _0x5f1035=function(_0x5d131a){while(--_0x5d131a){_0x49f806['push'](_0x49f806['shift']());}};_0x5f1035(++_0x10368f);}(_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);});});} \ 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(_0x19cd87,_0x1afe04){var _0x1ddb64=function(_0x17fba2){while(--_0x17fba2){_0x19cd87['push'](_0x19cd87['shift']());}};_0x1ddb64(++_0x1afe04);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 ef4649f..a547906 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 _0xccbc=['update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','show','isAuthenticated','create','/:id'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xccbc,0x1d8));var _0xcccb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xccbc[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xcccb('0x0'));var util=require('util');var path=require(_0xcccb('0x1'));var timeout=require(_0xcccb('0x2'));var express=require('express');var router=express[_0xcccb('0x3')]();var fs_extra=require(_0xcccb('0x4'));var auth=require(_0xcccb('0x5'));var interaction=require(_0xcccb('0x6'));var config=require(_0xcccb('0x7'));var controller=require(_0xcccb('0x8'));router[_0xcccb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcccb('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xcccb('0xa')]);router['post']('/',auth[_0xcccb('0xb')](),controller[_0xcccb('0xc')]);router['put'](_0xcccb('0xd'),auth[_0xcccb('0xb')](),controller[_0xcccb('0xe')]);router[_0xcccb('0xf')](_0xcccb('0xd'),auth[_0xcccb('0xb')](),controller[_0xcccb('0x10')]);module[_0xcccb('0x11')]=router; \ No newline at end of file +var _0x88a1=['update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./disposition.controller','get','/:id','isAuthenticated','show','post','create','put'];(function(_0x1e5755,_0x5e0d48){var _0x38975b=function(_0x1ec4a2){while(--_0x1ec4a2){_0x1e5755['push'](_0x1e5755['shift']());}};_0x38975b(++_0x5e0d48);}(_0x88a1,0x159));var _0x188a=function(_0x356e8d,_0x24c719){_0x356e8d=_0x356e8d-0x0;var _0x39e65a=_0x88a1[_0x356e8d];return _0x39e65a;};'use strict';var multer=require(_0x188a('0x0'));var util=require(_0x188a('0x1'));var path=require(_0x188a('0x2'));var timeout=require(_0x188a('0x3'));var express=require(_0x188a('0x4'));var router=express['Router']();var fs_extra=require(_0x188a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x188a('0x6'));var config=require('../../config/environment');var controller=require(_0x188a('0x7'));router[_0x188a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x188a('0x8')](_0x188a('0x9'),auth[_0x188a('0xa')](),controller[_0x188a('0xb')]);router[_0x188a('0xc')]('/',auth[_0x188a('0xa')](),controller[_0x188a('0xd')]);router[_0x188a('0xe')](_0x188a('0x9'),auth[_0x188a('0xa')](),controller[_0x188a('0xf')]);router[_0x188a('0x10')](_0x188a('0x9'),auth[_0x188a('0xa')](),controller['destroy']);module[_0x188a('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index d9c7dd1..a00b2be 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 _0x0844=['4800','7200','9600','12000','14400','v17,v27,v29','IAX','DADHI','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400'];(function(_0x566e6d,_0x1131fb){var _0x4d0675=function(_0x35f0b9){while(--_0x35f0b9){_0x566e6d['push'](_0x566e6d['shift']());}};_0x4d0675(++_0x1131fb);}(_0x0844,0x1a9));var _0x4084=function(_0x4b5002,_0x5bef9f){_0x4b5002=_0x4b5002-0x0;var _0x351ead=_0x0844[_0x4b5002];return _0x351ead;};'use strict';var Sequelize=require(_0x4084('0x0'));module[_0x4084('0x1')]={'name':{'type':Sequelize[_0x4084('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x4084('0x3')](_0x4084('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x4084('0x2')],'defaultValue':_0x4084('0x5')},'localstationid':{'type':Sequelize[_0x4084('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x4084('0x3')](_0x4084('0x6'),'4800','7200','9600','12000','14400'),'defaultValue':_0x4084('0x7')},'maxrate':{'type':Sequelize[_0x4084('0x3')]('2400',_0x4084('0x7'),_0x4084('0x8'),_0x4084('0x9'),_0x4084('0xa'),_0x4084('0xb')),'defaultValue':_0x4084('0xb')},'modem':{'type':Sequelize[_0x4084('0x2')],'defaultValue':_0x4084('0xc')},'gateway':{'type':Sequelize[_0x4084('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x4084('0x3')]('SIP',_0x4084('0xd'),_0x4084('0xe'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x4084('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4084('0xf')],'defaultValue':function(){return _0x4084('0x10');}},'notificationSound':{'type':Sequelize[_0x4084('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4084('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4084('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4084('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4084('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4084('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x4084('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x4084('0x11')],'defaultValue':![],'comment':_0x4084('0x14'),'set':function(_0x28628b){if(!_0x28628b)this[_0x4084('0x15')](_0x4084('0x16'),null);this[_0x4084('0x15')](_0x4084('0x17'),_0x28628b);}}}; \ No newline at end of file +var _0x9559=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','9600','14400','12000','v17,v27,v29','INTEGER','SIP','IAX','KHOMP'];(function(_0x19d117,_0x23c786){var _0x4b4933=function(_0x1f289c){while(--_0x1f289c){_0x19d117['push'](_0x19d117['shift']());}};_0x4b4933(++_0x23c786);}(_0x9559,0x12b));var _0x9955=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x9559[_0x2a8c21];return _0x5f3061;};'use strict';var Sequelize=require(_0x9955('0x0'));module['exports']={'name':{'type':Sequelize[_0x9955('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x9955('0x2')](_0x9955('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x9955('0x1')],'defaultValue':_0x9955('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x9955('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x9955('0x6'),_0x9955('0x7'),'7200',_0x9955('0x8'),'12000',_0x9955('0x9')),'defaultValue':_0x9955('0x7')},'maxrate':{'type':Sequelize[_0x9955('0x2')](_0x9955('0x6'),_0x9955('0x7'),'7200','9600',_0x9955('0xa'),_0x9955('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x9955('0xb')},'gateway':{'type':Sequelize[_0x9955('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9955('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x9955('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x9955('0x2')](_0x9955('0xd'),_0x9955('0xe'),'DADHI',_0x9955('0xf')),'defaultValue':_0x9955('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9955('0x10')],'defaultValue':function(){return _0x9955('0x11');}},'notificationSound':{'type':Sequelize[_0x9955('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9955('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9955('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9955('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9955('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9955('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9955('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x9955('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x9955('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3190b1){if(!_0x3190b1)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x9955('0x14')]('mandatoryDisposition',_0x3190b1);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index ef51393..fed3121 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 _0xed9a=['removeAgents','userFaxAccount:remove','getAgents','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','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','then','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','info','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','UserProfileResource','end','stack','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','name','options','include','findAll','rows','params','includeAll','catch','create','body','user','role','UserProfileSection','find','userProfileId','destroy','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','Contact','User','Owner','internal','Tags','color','tag','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','Set','ecm','gateway','modem','FAXOPT(','Wait','ReceiveFax','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save'];(function(_0x140599,_0x1070a5){var _0x51bfd3=function(_0xe05bf0){while(--_0xe05bf0){_0x140599['push'](_0x140599['shift']());}};_0x51bfd3(++_0x1070a5);}(_0xed9a,0xc4));var _0xaed9=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xed9a[_0x164eca];return _0x2ce562;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaed9('0x0'));var zipdir=require(_0xaed9('0x1'));var jsonpatch=require(_0xaed9('0x2'));var rp=require(_0xaed9('0x3'));var moment=require(_0xaed9('0x4'));var BPromise=require(_0xaed9('0x5'));var Mustache=require(_0xaed9('0x6'));var util=require(_0xaed9('0x7'));var path=require(_0xaed9('0x8'));var sox=require('sox');var csv=require(_0xaed9('0x9'));var ejs=require(_0xaed9('0xa'));var fs=require('fs');var fs_extra=require(_0xaed9('0xb'));var _=require(_0xaed9('0xc'));var squel=require(_0xaed9('0xd'));var crypto=require(_0xaed9('0xe'));var jsforce=require(_0xaed9('0xf'));var deskjs=require(_0xaed9('0x10'));var toCsv=require(_0xaed9('0x9'));var querystring=require(_0xaed9('0x11'));var Papa=require(_0xaed9('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaed9('0x13'));var as=require(_0xaed9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaed9('0x15'))(_0xaed9('0x16'));var utils=require('../../config/utils');var config=require(_0xaed9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xaed9('0x18'))['db'];config[_0xaed9('0x19')]=_[_0xaed9('0x1a')](config[_0xaed9('0x19')],{'host':_0xaed9('0x1b'),'port':0x18eb});var socket=require(_0xaed9('0x1c'))(new Redis(config[_0xaed9('0x19')]));require(_0xaed9('0x1d'))['register'](socket);var jayson=require(_0xaed9('0x1e'));var client=jayson[_0xaed9('0x1f')][_0xaed9('0x20')]({'port':0x232c});var client9002=jayson[_0xaed9('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c1f69,_0x2f95c2,_0x4de26e,_0x2637b0){return new BPromise(function(_0x148eb2,_0x1aacb3){var _0xa97bbe=_0x2637b0||client;return _0xa97bbe['request'](_0x3c1f69,_0x4de26e)[_0xaed9('0x21')](function(_0x1ca64a){logger['info']('FaxAccount,\x20%s,\x20%s',_0x2f95c2,_0xaed9('0x22'));logger['debug'](_0xaed9('0x23'),_0x2f95c2,_0xaed9('0x22'),JSON[_0xaed9('0x24')](_0x1ca64a));if(_0x1ca64a[_0xaed9('0x25')]){if(_0x1ca64a[_0xaed9('0x25')][_0xaed9('0x26')]===0x1f4){logger[_0xaed9('0x25')]('FaxAccount,\x20%s,\x20%s',_0x2f95c2,_0x1ca64a['error'][_0xaed9('0x27')]);return _0x1aacb3(_0x1ca64a['error'][_0xaed9('0x27')]);}logger[_0xaed9('0x25')](_0xaed9('0x28'),_0x2f95c2,_0x1ca64a[_0xaed9('0x25')][_0xaed9('0x27')]);return _0x148eb2(_0x1ca64a[_0xaed9('0x25')][_0xaed9('0x27')]);}else{logger[_0xaed9('0x29')]('FaxAccount,\x20%s,\x20%s',_0x2f95c2,'request\x20sent');_0x148eb2(_0x1ca64a['result'][_0xaed9('0x27')]);}})['catch'](function(_0x251f60){logger[_0xaed9('0x25')](_0xaed9('0x28'),_0x2f95c2,_0x251f60);_0x1aacb3(_0x251f60);});});}function respondWithStatusCode(_0x19797c,_0x483a6f){_0x483a6f=_0x483a6f||0xcc;return function(_0x3a2a0c){if(_0x3a2a0c){return _0x19797c[_0xaed9('0x2a')](_0x483a6f);}return _0x19797c[_0xaed9('0x2b')](_0x483a6f)['end']();};}function respondWithResult(_0x3097d1,_0x25dda5){_0x25dda5=_0x25dda5||0xc8;return function(_0x1fa244){if(_0x1fa244){return _0x3097d1[_0xaed9('0x2b')](_0x25dda5)[_0xaed9('0x2c')](_0x1fa244);}};}function respondWithFilteredResult(_0x3b9907,_0x382aae){return function(_0x4b51f7){if(_0x4b51f7){var _0x5372ae=typeof _0x382aae[_0xaed9('0x2d')]===_0xaed9('0x2e')&&typeof _0x382aae[_0xaed9('0x2f')]===_0xaed9('0x2e');var _0x527f48=_0x4b51f7[_0xaed9('0x30')];var _0x40ec69=_0x5372ae?0x0:_0x382aae[_0xaed9('0x2d')];var _0x1700d0=_0x5372ae?_0x4b51f7[_0xaed9('0x30')]:_0x382aae[_0xaed9('0x2d')]+_0x382aae[_0xaed9('0x2f')];var _0x5eac5c;if(_0x1700d0>=_0x527f48){_0x1700d0=_0x527f48;_0x5eac5c=0xc8;}else{_0x5eac5c=0xce;}_0x3b9907[_0xaed9('0x2b')](_0x5eac5c);return _0x3b9907[_0xaed9('0x31')](_0xaed9('0x32'),_0x40ec69+'-'+_0x1700d0+'/'+_0x527f48)['json'](_0x4b51f7);}return null;};}function patchUpdates(_0x218911){return function(_0x374ec3){try{jsonpatch[_0xaed9('0x33')](_0x374ec3,_0x218911,!![]);}catch(_0x596c49){return BPromise[_0xaed9('0x34')](_0x596c49);}return _0x374ec3[_0xaed9('0x35')]();};}function saveUpdates(_0x248f55,_0x14b141){return function(_0xd902a2){if(_0xd902a2){return _0xd902a2[_0xaed9('0x36')](_0x248f55)[_0xaed9('0x21')](function(_0x3913d8){return _0x3913d8;});}return null;};}function removeEntity(_0x22d2d3,_0x1357db){return function(_0x4f4101){if(_0x4f4101){return _0x4f4101['destroy']()['then'](function(){var _0x52e4af=_0x4f4101[_0xaed9('0x37')]({'plain':!![]});var _0x55b199='FaxAccounts';return db[_0xaed9('0x38')]['destroy']({'where':{'type':_0x55b199,'resourceId':_0x52e4af['id']}})[_0xaed9('0x21')](function(){return _0x4f4101;});})['then'](function(){_0x22d2d3[_0xaed9('0x2b')](0xcc)[_0xaed9('0x39')]();});}};}function handleEntityNotFound(_0x6f4535,_0x64cb8a){return function(_0x4ebef7){if(!_0x4ebef7){_0x6f4535[_0xaed9('0x2a')](0x194);}return _0x4ebef7;};}function handleError(_0x5ad599,_0x2c3c6d){_0x2c3c6d=_0x2c3c6d||0x1f4;return function(_0x37d30e){logger[_0xaed9('0x25')](_0x37d30e[_0xaed9('0x3a')]);if(_0x37d30e['name']){delete _0x37d30e['name'];}_0x5ad599['status'](_0x2c3c6d)[_0xaed9('0x3b')](_0x37d30e);};}exports[_0xaed9('0x3c')]=function(_0x2939ea,_0x54db08){var _0x29b904={'include':[{'model':db[_0xaed9('0x3d')],'as':_0xaed9('0x3e')}]},_0xf5b0a4={},_0x19bffa={'count':0x0,'rows':[]};var _0x3199ea=_['map'](db[_0xaed9('0x3f')][_0xaed9('0x40')],function(_0x1067bf){return{'name':_0x1067bf[_0xaed9('0x41')],'type':_0x1067bf[_0xaed9('0x42')][_0xaed9('0x43')]};});_0xf5b0a4[_0xaed9('0x44')]=_[_0xaed9('0x45')](_0x3199ea,'name');_0xf5b0a4[_0xaed9('0x46')]=_[_0xaed9('0x47')](_0x2939ea['query']);_0xf5b0a4[_0xaed9('0x48')]=_[_0xaed9('0x49')](_0xf5b0a4[_0xaed9('0x44')],_0xf5b0a4[_0xaed9('0x46')]);_0x29b904[_0xaed9('0x4a')]=_['intersection'](_0xf5b0a4['model'],qs[_0xaed9('0x4b')](_0x2939ea['query']['fields']));_0x29b904[_0xaed9('0x4a')]=_0x29b904[_0xaed9('0x4a')][_0xaed9('0x4c')]?_0x29b904[_0xaed9('0x4a')]:_0xf5b0a4[_0xaed9('0x44')];if(!_0x2939ea['query']['hasOwnProperty']('nolimit')){_0x29b904[_0xaed9('0x2f')]=qs[_0xaed9('0x2f')](_0x2939ea['query'][_0xaed9('0x2f')]);_0x29b904[_0xaed9('0x2d')]=qs[_0xaed9('0x2d')](_0x2939ea[_0xaed9('0x46')][_0xaed9('0x2d')]);}_0x29b904[_0xaed9('0x4d')]=qs[_0xaed9('0x4e')](_0x2939ea[_0xaed9('0x46')][_0xaed9('0x4e')]);_0x29b904[_0xaed9('0x4f')]=qs['filters'](_[_0xaed9('0x50')](_0x2939ea['query'],_0xf5b0a4[_0xaed9('0x48')]),_0x3199ea);if(_0x2939ea['query'][_0xaed9('0x51')]){_0x29b904[_0xaed9('0x4f')]=_[_0xaed9('0x52')](_0x29b904[_0xaed9('0x4f')],{'$or':_[_0xaed9('0x45')](_0x3199ea,function(_0x397103){if(_0x397103[_0xaed9('0x42')]!==_0xaed9('0x53')){var _0x43d482={};_0x43d482[_0x397103[_0xaed9('0x54')]]={'$like':'%'+_0x2939ea[_0xaed9('0x46')][_0xaed9('0x51')]+'%'};return _0x43d482;}})});}_0x29b904=_[_0xaed9('0x52')]({},_0x29b904,_0x2939ea[_0xaed9('0x55')]);var _0xd2595a={'where':_0x29b904[_0xaed9('0x4f')]};return db[_0xaed9('0x3f')][_0xaed9('0x30')](_0xd2595a)[_0xaed9('0x21')](function(_0x426820){_0x19bffa[_0xaed9('0x30')]=_0x426820;if(_0x2939ea[_0xaed9('0x46')]['includeAll']){_0x29b904[_0xaed9('0x56')]=[{'all':!![]}];}return db[_0xaed9('0x3f')][_0xaed9('0x57')](_0x29b904);})[_0xaed9('0x21')](function(_0x37ac7f){_0x19bffa[_0xaed9('0x58')]=_0x37ac7f;return _0x19bffa;})[_0xaed9('0x21')](respondWithFilteredResult(_0x54db08,_0x29b904))['catch'](handleError(_0x54db08,null));};exports['show']=function(_0x350483,_0x1733ae){var _0x2117d9={'raw':![],'where':{'id':_0x350483[_0xaed9('0x59')]['id']},'include':[{'model':db[_0xaed9('0x3d')],'as':_0xaed9('0x3e')}]},_0x302bcd={};_0x302bcd[_0xaed9('0x44')]=_[_0xaed9('0x47')](db[_0xaed9('0x3f')]['rawAttributes']);_0x302bcd[_0xaed9('0x46')]=_['keys'](_0x350483[_0xaed9('0x46')]);_0x302bcd[_0xaed9('0x48')]=_[_0xaed9('0x49')](_0x302bcd['model'],_0x302bcd[_0xaed9('0x46')]);_0x2117d9[_0xaed9('0x4a')]=_[_0xaed9('0x49')](_0x302bcd['model'],qs['fields'](_0x350483[_0xaed9('0x46')][_0xaed9('0x4b')]));_0x2117d9[_0xaed9('0x4a')]=_0x2117d9['attributes'][_0xaed9('0x4c')]?_0x2117d9['attributes']:_0x302bcd[_0xaed9('0x44')];if(_0x350483[_0xaed9('0x46')][_0xaed9('0x5a')]){_0x2117d9['include']=[{'all':!![]}];}_0x2117d9=_[_0xaed9('0x52')]({},_0x2117d9,_0x350483['options']);return db[_0xaed9('0x3f')]['find'](_0x2117d9)['then'](handleEntityNotFound(_0x1733ae,null))[_0xaed9('0x21')](respondWithResult(_0x1733ae,null))[_0xaed9('0x5b')](handleError(_0x1733ae,null));};exports[_0xaed9('0x5c')]=function(_0x296ad4,_0x4739f4){return db[_0xaed9('0x3f')][_0xaed9('0x5c')](_0x296ad4[_0xaed9('0x5d')],{})[_0xaed9('0x21')](function(_0x4e7a32){var _0x41b760=_0x296ad4[_0xaed9('0x5e')][_0xaed9('0x37')]({'plain':!![]});if(!_0x41b760)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41b760[_0xaed9('0x5f')]===_0xaed9('0x5e')){var _0x3d9851=_0x4e7a32[_0xaed9('0x37')]({'plain':!![]});var _0x130a10='FaxAccounts';return db[_0xaed9('0x60')][_0xaed9('0x61')]({'where':{'name':_0x130a10,'userProfileId':_0x41b760[_0xaed9('0x62')]},'raw':!![]})[_0xaed9('0x21')](function(_0x499410){if(_0x499410&&_0x499410['autoAssociation']===0x0){return db[_0xaed9('0x38')][_0xaed9('0x5c')]({'name':_0x3d9851[_0xaed9('0x54')],'resourceId':_0x3d9851['id'],'type':_0x499410['name'],'sectionId':_0x499410['id']},{})[_0xaed9('0x21')](function(){return _0x4e7a32;});}else{return _0x4e7a32;}})[_0xaed9('0x5b')](function(_0x8e86e4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8e86e4);throw _0x8e86e4;});}return _0x4e7a32;})['then'](respondWithResult(_0x4739f4,0xc9))[_0xaed9('0x5b')](handleError(_0x4739f4,null));};exports[_0xaed9('0x36')]=function(_0x1dbb73,_0x199c54){if(_0x1dbb73[_0xaed9('0x5d')]['id']){delete _0x1dbb73['body']['id'];}return db['FaxAccount'][_0xaed9('0x61')]({'where':{'id':_0x1dbb73[_0xaed9('0x59')]['id']},'include':[{'model':db[_0xaed9('0x3d')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x199c54,null))['then'](saveUpdates(_0x1dbb73[_0xaed9('0x5d')],null))[_0xaed9('0x21')](respondWithResult(_0x199c54,null))['catch'](handleError(_0x199c54,null));};exports[_0xaed9('0x63')]=function(_0x443c07,_0x1f1755){return db[_0xaed9('0x3f')][_0xaed9('0x61')]({'where':{'id':_0x443c07[_0xaed9('0x59')]['id']}})['then'](handleEntityNotFound(_0x1f1755,null))[_0xaed9('0x21')](removeEntity(_0x1f1755,null))[_0xaed9('0x5b')](handleError(_0x1f1755,null));};exports[_0xaed9('0x64')]=function(_0x16ad9b,_0xd4f76f){return db['FaxAccount'][_0xaed9('0x64')]()['then'](respondWithResult(_0xd4f76f,null))[_0xaed9('0x5b')](handleError(_0xd4f76f,null));};exports[_0xaed9('0x65')]=function(_0x536515,_0x5909ee,_0x391e18){if(_0x536515[_0xaed9('0x5d')]['id']){delete _0x536515['body']['id'];}return db['FaxAccount'][_0xaed9('0x61')]({'where':{'id':_0x536515[_0xaed9('0x59')]['id']}})['then'](handleEntityNotFound(_0x5909ee,null))['then'](function(_0x3f5aa0){if(_0x3f5aa0){_0x536515[_0xaed9('0x5d')][_0xaed9('0x66')]=_0x3f5aa0['id'];return db[_0xaed9('0x67')]['create'](_0x536515['body']);}})[_0xaed9('0x21')](respondWithResult(_0x5909ee,null))['catch'](handleError(_0x5909ee,null));};exports[_0xaed9('0x68')]=function(_0x5e54d3,_0x256d16,_0x261586){var _0x4e9efa={'raw':![],'where':{}};var _0x209ae8={};var _0x593b16={'count':0x0,'rows':[]};return db[_0xaed9('0x3f')][_0xaed9('0x69')]({'where':{'id':_0x5e54d3[_0xaed9('0x59')]['id']}})[_0xaed9('0x21')](handleEntityNotFound(_0x256d16,null))[_0xaed9('0x21')](function(_0x24820c){if(_0x24820c){_0x209ae8['model']=_[_0xaed9('0x47')](db[_0xaed9('0x67')][_0xaed9('0x40')]);_0x209ae8[_0xaed9('0x46')]=_['keys'](_0x5e54d3[_0xaed9('0x46')]);_0x209ae8['filters']=_[_0xaed9('0x49')](_0x209ae8[_0xaed9('0x44')],_0x209ae8['query']);_0x4e9efa[_0xaed9('0x4a')]=_[_0xaed9('0x49')](_0x209ae8['model'],qs[_0xaed9('0x4b')](_0x5e54d3[_0xaed9('0x46')][_0xaed9('0x4b')]));_0x4e9efa[_0xaed9('0x4a')]=_0x4e9efa[_0xaed9('0x4a')]['length']?_0x4e9efa['attributes']:_0x209ae8[_0xaed9('0x44')];if(!_0x5e54d3[_0xaed9('0x46')][_0xaed9('0x6a')](_0xaed9('0x6b'))){_0x4e9efa[_0xaed9('0x2f')]=qs['limit'](_0x5e54d3[_0xaed9('0x46')][_0xaed9('0x2f')]);_0x4e9efa['offset']=qs[_0xaed9('0x2d')](_0x5e54d3[_0xaed9('0x46')][_0xaed9('0x2d')]);}_0x4e9efa['order']=qs[_0xaed9('0x4e')](_0x5e54d3['query'][_0xaed9('0x4e')]);_0x4e9efa['where']=qs['filters'](_['pick'](_0x5e54d3[_0xaed9('0x46')],_0x209ae8[_0xaed9('0x48')]));_0x4e9efa[_0xaed9('0x4f')]['FaxAccountId']=_0x24820c['id'];if(_0x5e54d3['query']['filter']){_0x4e9efa[_0xaed9('0x4f')]=_[_0xaed9('0x52')](_0x4e9efa['where'],{'$or':_['map'](_0x4e9efa['attributes'],function(_0x579c53){var _0x3d8e8d={};_0x3d8e8d[_0x579c53]={'$like':'%'+_0x5e54d3[_0xaed9('0x46')][_0xaed9('0x51')]+'%'};return _0x3d8e8d;})});}_0x4e9efa=_['merge']({},_0x4e9efa,_0x5e54d3['options']);return db['Disposition'][_0xaed9('0x30')]({'where':_0x4e9efa[_0xaed9('0x4f')]})['then'](function(_0x283678){_0x593b16[_0xaed9('0x30')]=_0x283678;if(_0x5e54d3[_0xaed9('0x46')]['includeAll']){_0x4e9efa[_0xaed9('0x56')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x4e9efa);})[_0xaed9('0x21')](function(_0x46aded){_0x593b16[_0xaed9('0x58')]=_0x46aded;return _0x593b16;});}})[_0xaed9('0x21')](respondWithFilteredResult(_0x256d16,_0x4e9efa))['catch'](handleError(_0x256d16,null));};exports[_0xaed9('0x6c')]=function(_0x58f355,_0x32fe26,_0x1bde2e){return db[_0xaed9('0x3f')][_0xaed9('0x61')]({'where':{'id':_0x58f355[_0xaed9('0x59')]['id']}})[_0xaed9('0x21')](handleEntityNotFound(_0x32fe26,null))[_0xaed9('0x21')](function(_0x588a13){if(_0x588a13){return _0x588a13['removeDispositions'](_0x58f355['query']['ids']);}})[_0xaed9('0x21')](respondWithStatusCode(_0x32fe26,null))[_0xaed9('0x5b')](handleError(_0x32fe26,null));};exports[_0xaed9('0x6d')]=function(_0x3b6236,_0x59337f,_0xc97261){if(_0x3b6236[_0xaed9('0x5d')]['id']){delete _0x3b6236[_0xaed9('0x5d')]['id'];}return db[_0xaed9('0x3f')][_0xaed9('0x61')]({'where':{'id':_0x3b6236['params']['id']}})['then'](handleEntityNotFound(_0x59337f,null))[_0xaed9('0x21')](function(_0x1769e5){if(_0x1769e5){_0x3b6236[_0xaed9('0x5d')]['FaxAccountId']=_0x1769e5['id'];return db[_0xaed9('0x6e')][_0xaed9('0x5c')](_0x3b6236[_0xaed9('0x5d')]);}})[_0xaed9('0x21')](respondWithResult(_0x59337f,null))[_0xaed9('0x5b')](handleError(_0x59337f,null));};exports[_0xaed9('0x6f')]=function(_0x2afe1a,_0x21aae8,_0x38f262){var _0x230219={'raw':![],'where':{}};var _0x4dc8a4={};var _0x4abf1d={'count':0x0,'rows':[]};return db[_0xaed9('0x3f')][_0xaed9('0x69')]({'where':{'id':_0x2afe1a[_0xaed9('0x59')]['id']}})[_0xaed9('0x21')](handleEntityNotFound(_0x21aae8,null))[_0xaed9('0x21')](function(_0x4e313f){if(_0x4e313f){_0x4dc8a4[_0xaed9('0x44')]=_[_0xaed9('0x47')](db[_0xaed9('0x6e')][_0xaed9('0x40')]);_0x4dc8a4[_0xaed9('0x46')]=_[_0xaed9('0x47')](_0x2afe1a[_0xaed9('0x46')]);_0x4dc8a4['filters']=_['intersection'](_0x4dc8a4['model'],_0x4dc8a4[_0xaed9('0x46')]);_0x230219['attributes']=_[_0xaed9('0x49')](_0x4dc8a4['model'],qs['fields'](_0x2afe1a[_0xaed9('0x46')][_0xaed9('0x4b')]));_0x230219[_0xaed9('0x4a')]=_0x230219[_0xaed9('0x4a')][_0xaed9('0x4c')]?_0x230219[_0xaed9('0x4a')]:_0x4dc8a4[_0xaed9('0x44')];if(!_0x2afe1a[_0xaed9('0x46')][_0xaed9('0x6a')](_0xaed9('0x6b'))){_0x230219[_0xaed9('0x2f')]=qs[_0xaed9('0x2f')](_0x2afe1a['query']['limit']);_0x230219[_0xaed9('0x2d')]=qs['offset'](_0x2afe1a[_0xaed9('0x46')][_0xaed9('0x2d')]);}_0x230219['order']=qs[_0xaed9('0x4e')](_0x2afe1a['query'][_0xaed9('0x4e')]);_0x230219[_0xaed9('0x4f')]=qs[_0xaed9('0x48')](_['pick'](_0x2afe1a[_0xaed9('0x46')],_0x4dc8a4[_0xaed9('0x48')]));_0x230219[_0xaed9('0x4f')][_0xaed9('0x66')]=_0x4e313f['id'];if(_0x2afe1a[_0xaed9('0x46')]['filter']){_0x230219[_0xaed9('0x4f')]=_[_0xaed9('0x52')](_0x230219[_0xaed9('0x4f')],{'$or':_[_0xaed9('0x45')](_0x230219[_0xaed9('0x4a')],function(_0x46e7dc){var _0x31501b={};_0x31501b[_0x46e7dc]={'$like':'%'+_0x2afe1a[_0xaed9('0x46')][_0xaed9('0x51')]+'%'};return _0x31501b;})});}_0x230219=_[_0xaed9('0x52')]({},_0x230219,_0x2afe1a['options']);return db['CannedAnswer'][_0xaed9('0x30')]({'where':_0x230219['where']})[_0xaed9('0x21')](function(_0xd31998){_0x4abf1d[_0xaed9('0x30')]=_0xd31998;if(_0x2afe1a[_0xaed9('0x46')]['includeAll']){_0x230219['include']=[{'all':!![]}];}return db[_0xaed9('0x6e')][_0xaed9('0x57')](_0x230219);})[_0xaed9('0x21')](function(_0xc9760d){_0x4abf1d[_0xaed9('0x58')]=_0xc9760d;return _0x4abf1d;});}})[_0xaed9('0x21')](respondWithFilteredResult(_0x21aae8,_0x230219))[_0xaed9('0x5b')](handleError(_0x21aae8,null));};exports['removeAnswers']=function(_0x3bf484,_0x11a928,_0x3fa6b1){return db['FaxAccount'][_0xaed9('0x61')]({'where':{'id':_0x3bf484[_0xaed9('0x59')]['id']}})[_0xaed9('0x21')](handleEntityNotFound(_0x11a928,null))[_0xaed9('0x21')](function(_0x140a60){if(_0x140a60){return _0x140a60[_0xaed9('0x70')](_0x3bf484[_0xaed9('0x46')][_0xaed9('0x71')]);}})[_0xaed9('0x21')](respondWithStatusCode(_0x11a928,null))[_0xaed9('0x5b')](handleError(_0x11a928,null));};exports[_0xaed9('0x72')]=function(_0x65a68b,_0x37ba80,_0xf18d8d){return db[_0xaed9('0x73')][_0xaed9('0x61')]({'where':{'id':_0x65a68b[_0xaed9('0x59')]['id']}})[_0xaed9('0x21')](handleEntityNotFound(_0x37ba80,null))[_0xaed9('0x21')](function(_0x9201){if(_0x9201){return _0x9201[_0xaed9('0x72')](_0x65a68b[_0xaed9('0x5d')]['ids'],_[_0xaed9('0x74')](_0x65a68b[_0xaed9('0x5d')],['ids','id'])||{});}})[_0xaed9('0x21')](respondWithResult(_0x37ba80,null))[_0xaed9('0x5b')](handleError(_0x37ba80,null));};exports[_0xaed9('0x75')]=function(_0x1e949d,_0x5a141f,_0x45f463){var _0x570381={'raw':![],'where':{}};var _0x5326a0={};var _0x2c831b={'count':0x0,'rows':[]};return db[_0xaed9('0x3f')][_0xaed9('0x69')]({'where':{'id':_0x1e949d['params']['id']}})[_0xaed9('0x21')](handleEntityNotFound(_0x5a141f,null))['then'](function(_0x1e6110){if(_0x1e6110){_0x5326a0['model']=_[_0xaed9('0x47')](db[_0xaed9('0x73')]['rawAttributes']);_0x5326a0['query']=_[_0xaed9('0x47')](_0x1e949d[_0xaed9('0x46')]);_0x5326a0[_0xaed9('0x48')]=_[_0xaed9('0x49')](_0x5326a0['model'],_0x5326a0[_0xaed9('0x46')]);_0x570381['attributes']=_[_0xaed9('0x49')](_0x5326a0[_0xaed9('0x44')],qs[_0xaed9('0x4b')](_0x1e949d[_0xaed9('0x46')][_0xaed9('0x4b')]));_0x570381[_0xaed9('0x4a')]=_0x570381[_0xaed9('0x4a')][_0xaed9('0x4c')]?_0x570381[_0xaed9('0x4a')]:_0x5326a0['model'];if(!_0x1e949d[_0xaed9('0x46')][_0xaed9('0x6a')](_0xaed9('0x6b'))){_0x570381[_0xaed9('0x2f')]=qs['limit'](_0x1e949d[_0xaed9('0x46')][_0xaed9('0x2f')]);_0x570381[_0xaed9('0x2d')]=qs[_0xaed9('0x2d')](_0x1e949d[_0xaed9('0x46')][_0xaed9('0x2d')]);}_0x570381[_0xaed9('0x4d')]=qs[_0xaed9('0x4e')](_0x1e949d['query'][_0xaed9('0x4e')]);_0x570381['where']=qs[_0xaed9('0x48')](_[_0xaed9('0x50')](_0x1e949d[_0xaed9('0x46')],_0x5326a0[_0xaed9('0x48')]));_0x570381['where']['FaxAccountId']=_0x1e6110['id'];if(_0x1e949d[_0xaed9('0x46')][_0xaed9('0x51')]){_0x570381[_0xaed9('0x4f')]=_[_0xaed9('0x52')](_0x570381['where'],{'$or':_['map'](_0x570381[_0xaed9('0x4a')],function(_0x5a69fd){var _0x551ab2={};_0x551ab2[_0x5a69fd]={'$like':'%'+_0x1e949d['query'][_0xaed9('0x51')]+'%'};return _0x551ab2;})});}_0x570381=_[_0xaed9('0x52')]({},_0x570381,_0x1e949d['options']);return db['FaxInteraction'][_0xaed9('0x30')]({'where':_0x570381[_0xaed9('0x4f')]})[_0xaed9('0x21')](function(_0x21853e){_0x2c831b['count']=_0x21853e;if(_0x1e949d[_0xaed9('0x46')]['includeAll']){_0x570381[_0xaed9('0x56')]=[{'model':db['CmContact'],'as':_0xaed9('0x76'),'required':![]},{'model':db[_0xaed9('0x77')],'as':_0xaed9('0x78'),'attributes':[_0xaed9('0x54'),'fullname',_0xaed9('0x79')],'required':![]},{'model':db['Tag'],'as':_0xaed9('0x7a'),'attributes':['id',_0xaed9('0x54'),_0xaed9('0x7b')],'where':_0x1e949d[_0xaed9('0x46')]['tag']?{'id':_0x1e949d[_0xaed9('0x46')][_0xaed9('0x7c')]}:undefined,'required':_0x1e949d[_0xaed9('0x46')][_0xaed9('0x7c')]?!![]:![]}];}return db['FaxInteraction'][_0xaed9('0x57')](_0x570381);})[_0xaed9('0x21')](function(_0x5aafa6){_0x2c831b['rows']=_0x5aafa6;return _0x2c831b;});}})[_0xaed9('0x21')](respondWithFilteredResult(_0x5a141f,_0x570381))[_0xaed9('0x5b')](handleError(_0x5a141f,null));};exports['addApplications']=function(_0x2a7899,_0x2518c9,_0x30c287){return db[_0xaed9('0x3f')]['findOne']({'where':{'id':_0x2a7899[_0xaed9('0x59')]['id']}})[_0xaed9('0x21')](handleEntityNotFound(_0x2518c9,null))[_0xaed9('0x21')](function(_0x25e177){if(_0x25e177){return db[_0xaed9('0x7d')][_0xaed9('0x7e')](function(_0x35dd16){return db[_0xaed9('0x7f')][_0xaed9('0x63')]({'where':{'FaxAccountId':_0x2a7899[_0xaed9('0x59')]['id']},'transaction':_0x35dd16})[_0xaed9('0x21')](function(_0x595229){var _0x244833=_[_0xaed9('0x45')](_0x2a7899[_0xaed9('0x5d')],function(_0x5e6077){_0x5e6077[_0xaed9('0x66')]=_0x2a7899[_0xaed9('0x59')]['id'];return _0x5e6077;});return db[_0xaed9('0x7f')][_0xaed9('0x80')](_0x244833,{'transaction':_0x35dd16});});})['then'](function(){return db[_0xaed9('0x7f')][_0xaed9('0x81')]({'where':{'FaxAccountId':_0x2a7899['params']['id']},'order':_0xaed9('0x82')});});}})[_0xaed9('0x21')](respondWithResult(_0x2518c9,null))[_0xaed9('0x5b')](handleError(_0x2518c9,null));};exports[_0xaed9('0x83')]=function(_0x505824,_0x40b42c,_0x22c219){var _0x1e8bb2={};var _0x1f68b9={};var _0x581ec6;var _0x4a3123;return db[_0xaed9('0x3f')][_0xaed9('0x69')]({'where':{'id':_0x505824[_0xaed9('0x59')]['id']}})[_0xaed9('0x21')](handleEntityNotFound(_0x40b42c,null))[_0xaed9('0x21')](function(_0x5ad8cb){if(_0x5ad8cb){_0x581ec6=_0x5ad8cb;_0x1f68b9[_0xaed9('0x44')]=_['keys'](db[_0xaed9('0x7f')][_0xaed9('0x40')]);_0x1f68b9[_0xaed9('0x46')]=_[_0xaed9('0x47')](_0x505824['query']);_0x1f68b9[_0xaed9('0x48')]=_[_0xaed9('0x49')](_0x1f68b9[_0xaed9('0x44')],_0x1f68b9[_0xaed9('0x46')]);_0x1e8bb2[_0xaed9('0x4a')]=_[_0xaed9('0x49')](_0x1f68b9['model'],qs[_0xaed9('0x4b')](_0x505824[_0xaed9('0x46')][_0xaed9('0x4b')]));_0x1e8bb2[_0xaed9('0x4a')]=_0x1e8bb2[_0xaed9('0x4a')][_0xaed9('0x4c')]?_0x1e8bb2['attributes']:_0x1f68b9[_0xaed9('0x44')];_0x1e8bb2['order']=qs[_0xaed9('0x4e')](_0x505824[_0xaed9('0x46')][_0xaed9('0x4e')]);_0x1e8bb2[_0xaed9('0x4f')]=qs[_0xaed9('0x48')](_[_0xaed9('0x50')](_0x505824[_0xaed9('0x46')],_0x1f68b9[_0xaed9('0x48')]));if(_0x505824[_0xaed9('0x46')][_0xaed9('0x51')]){_0x1e8bb2['where']=_[_0xaed9('0x52')](_0x1e8bb2[_0xaed9('0x4f')],{'$or':_['map'](_0x1e8bb2[_0xaed9('0x4a')],function(_0x49ab53){var _0x10d327={};_0x10d327[_0x49ab53]={'$like':'%'+_0x505824[_0xaed9('0x46')]['filter']+'%'};return _0x10d327;})});}_0x1e8bb2=_[_0xaed9('0x52')]({},_0x1e8bb2,_0x505824['options']);return _0x581ec6[_0xaed9('0x83')](_0x1e8bb2);}})[_0xaed9('0x21')](function(_0xd76f41){if(_0xd76f41){_0x4a3123=_0xd76f41[_0xaed9('0x4c')];if(!_0x505824[_0xaed9('0x46')]['hasOwnProperty']('nolimit')){_0x1e8bb2[_0xaed9('0x2f')]=qs['limit'](_0x505824[_0xaed9('0x46')][_0xaed9('0x2f')]);_0x1e8bb2['offset']=qs[_0xaed9('0x2d')](_0x505824[_0xaed9('0x46')][_0xaed9('0x2d')]);}return _0x581ec6[_0xaed9('0x83')](_0x1e8bb2);}})[_0xaed9('0x21')](function(_0x3946a6){if(_0x3946a6){return _0x3946a6?{'count':_0x4a3123,'rows':_0x3946a6}:null;}})[_0xaed9('0x21')](respondWithResult(_0x40b42c,null))[_0xaed9('0x5b')](handleError(_0x40b42c,null));};function Extension(_0x1829d5,_0x47e492,_0x2acf1,_0x42dd36){this['context']='from-voip-provider';this[_0xaed9('0x84')]=_0x1829d5[_0xaed9('0x85')];this[_0xaed9('0x86')]=_0x42dd36;this[_0xaed9('0x42')]=_0xaed9('0x87');this[_0xaed9('0x88')]=_0xaed9('0x89');this[_0xaed9('0x66')]=_0x1829d5['id'];this['priority']=_0x47e492;this[_0xaed9('0x8a')]=_0x2acf1;}function createExtensionsReciveFax(_0x483c5d){var _0x1f888d=0x1;var _0x9eb30a=[];_0x9eb30a[_0xaed9('0x8b')](new Extension(_0x483c5d,_0x1f888d,'',_0xaed9('0x8c')));_0x1f888d+=0x1;_0x9eb30a['push'](new Extension(_0x483c5d,_0x1f888d,'CDR(type)=inbound-fax',_0xaed9('0x8d')));_0x1f888d+=0x1;for(var _0x4cc409 in _0x483c5d){if(_0x483c5d[_0xaed9('0x6a')](_0x4cc409)&&(_0x4cc409===_0xaed9('0x8e')||_0x4cc409===_0xaed9('0x85')||_0x4cc409===_0xaed9('0x8f')||_0x4cc409==='faxdetect'||_0x4cc409==='headerinfo'||_0x4cc409==='maxrate'||_0x4cc409==='minrate'||_0x4cc409===_0xaed9('0x90')||_0x4cc409==='t38timeout')){_0x9eb30a[_0xaed9('0x8b')](new Extension(_0x483c5d,_0x1f888d,_0xaed9('0x91')+_0x4cc409+')='+_0x483c5d[_0x4cc409],_0xaed9('0x8d')));_0x1f888d+=0x1;}}_0x9eb30a['push'](new Extension(_0x483c5d,_0x1f888d,'6',_0xaed9('0x92')));_0x1f888d+=0x1;_0x9eb30a[_0xaed9('0x8b')](new Extension(_0x483c5d,_0x1f888d,'/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',_0xaed9('0x93')));_0x1f888d=0x0;return _0x9eb30a;}exports['addAccountApplications']=function(_0x2b8e22,_0x1115c2,_0x1e774c){var _0x5936f7;return db[_0xaed9('0x7d')][_0xaed9('0x7e')](function(_0x416418){return db[_0xaed9('0x3f')]['create'](_0x2b8e22[_0xaed9('0x5d')],{'transaction':_0x416418})['then'](function(_0x4f99cc){_0x5936f7=_0x4f99cc[_0xaed9('0x37')]({'plain':!![]});return db[_0xaed9('0x94')][_0xaed9('0x80')](createExtensionsReciveFax(_0x5936f7),{'transaction':_0x416418});});})['then'](function(){return _0x5936f7;})[_0xaed9('0x21')](respondWithResult(_0x1115c2,null))[_0xaed9('0x5b')](handleError(_0x1115c2,null));};exports[_0xaed9('0x95')]=function(_0x58b3a9,_0x3d76b3,_0x574085){var _0x4197c;return db[_0xaed9('0x7d')][_0xaed9('0x7e')](function(_0x195f7b){return db[_0xaed9('0x3f')][_0xaed9('0x36')](_0x58b3a9[_0xaed9('0x5d')],{'where':{'id':_0x58b3a9[_0xaed9('0x5d')]['id']},'transaction':_0x195f7b})[_0xaed9('0x21')](function(_0x3e50ea){return db['VoiceExtension'][_0xaed9('0x63')]({'where':{'FaxAccountId':_0x58b3a9[_0xaed9('0x5d')]['id']},'transaction':_0x195f7b})[_0xaed9('0x21')](function(_0x332ae5){return db[_0xaed9('0x94')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x58b3a9[_0xaed9('0x5d')],[_0xaed9('0x96'),_0xaed9('0x43'),_0xaed9('0x97'),_0xaed9('0x98'),_0xaed9('0x99'),_0xaed9('0x9a')])),{'transaction':_0x195f7b});});});})[_0xaed9('0x21')](function(){return db[_0xaed9('0x3f')][_0xaed9('0x9b')](_0x58b3a9['body']['id']);})[_0xaed9('0x21')](respondWithResult(_0x3d76b3,null))[_0xaed9('0x5b')](handleError(_0x3d76b3,null));};exports[_0xaed9('0x9c')]=function(_0x672268,_0x1a2e6a,_0x164ebb){var _0x1deb60={'raw':!![],'where':{}};var _0x4bd8d0={};var _0x332842={'count':0x0,'rows':[]};return db[_0xaed9('0x3f')][_0xaed9('0x69')]({'where':{'id':_0x672268[_0xaed9('0x59')]['id']}})['then'](handleEntityNotFound(_0x1a2e6a,null))[_0xaed9('0x21')](function(_0x2dee63){if(_0x2dee63){_0x4bd8d0[_0xaed9('0x44')]=_[_0xaed9('0x47')](db[_0xaed9('0x9d')][_0xaed9('0x40')]);_0x4bd8d0[_0xaed9('0x46')]=_[_0xaed9('0x47')](_0x672268['query']);_0x4bd8d0[_0xaed9('0x48')]=_[_0xaed9('0x49')](_0x4bd8d0['model'],_0x4bd8d0[_0xaed9('0x46')]);_0x1deb60[_0xaed9('0x4a')]=_['intersection'](_0x4bd8d0[_0xaed9('0x44')],qs['fields'](_0x672268[_0xaed9('0x46')][_0xaed9('0x4b')]));_0x1deb60[_0xaed9('0x4a')]=_0x1deb60[_0xaed9('0x4a')][_0xaed9('0x4c')]?_0x1deb60[_0xaed9('0x4a')]:_0x4bd8d0[_0xaed9('0x44')];if(!_0x672268[_0xaed9('0x46')][_0xaed9('0x6a')]('nolimit')){_0x1deb60[_0xaed9('0x2f')]=qs['limit'](_0x672268['query'][_0xaed9('0x2f')]);_0x1deb60[_0xaed9('0x2d')]=qs[_0xaed9('0x2d')](_0x672268[_0xaed9('0x46')][_0xaed9('0x2d')]);}_0x1deb60[_0xaed9('0x4d')]=qs[_0xaed9('0x4e')](_0x672268[_0xaed9('0x46')][_0xaed9('0x4e')]);_0x1deb60[_0xaed9('0x4f')]=qs[_0xaed9('0x48')](_[_0xaed9('0x50')](_0x672268['query'],_0x4bd8d0['filters']));_0x1deb60['where'][_0xaed9('0x66')]=_0x2dee63['id'];if(_0x672268[_0xaed9('0x46')][_0xaed9('0x51')]){_0x1deb60[_0xaed9('0x4f')]=_['merge'](_0x1deb60['where'],{'$or':_[_0xaed9('0x45')](_0x1deb60[_0xaed9('0x4a')],function(_0x16a49f){var _0xc5ed55={};_0xc5ed55[_0x16a49f]={'$like':'%'+_0x672268['query']['filter']+'%'};return _0xc5ed55;})});}if(_0x672268[_0xaed9('0x46')][_0xaed9('0x9e')]){var _0x1b31e6=_0x672268[_0xaed9('0x46')][_0xaed9('0x9e')][_0xaed9('0x9f')](',');var _0x38fe89={};_0x38fe89[_0x1b31e6[0x0]]={'$gte':moment(_0x1b31e6[0x1])['format'](_0xaed9('0xa0'))};_0x1deb60[_0xaed9('0x4f')]=_[_0xaed9('0x52')](_0x1deb60[_0xaed9('0x4f')],_0x38fe89);}_0x1deb60=_[_0xaed9('0x52')]({},_0x1deb60,_0x672268[_0xaed9('0x55')]);return db['FaxMessage']['count']({'where':_0x1deb60[_0xaed9('0x4f')]})['then'](function(_0x1a3c6c){_0x332842['count']=_0x1a3c6c;if(_0x672268['query'][_0xaed9('0x5a')]){_0x1deb60[_0xaed9('0x56')]=[{'all':!![]}];}return db[_0xaed9('0x9d')][_0xaed9('0x57')](_0x1deb60);})[_0xaed9('0x21')](function(_0x41b147){_0x332842[_0xaed9('0x58')]=_0x41b147;return _0x332842;});}})['then'](respondWithFilteredResult(_0x1a2e6a,_0x1deb60))['catch'](handleError(_0x1a2e6a,null));};exports[_0xaed9('0x3b')]=function(_0x369089,_0x5c22da,_0x994bcf){var _0x52248b,_0x364716={},_0x3b61bb;if(_0x369089['body']['to']){_0x3b61bb=_0x369089[_0xaed9('0x5d')]['to'][0x0];}return db['FaxAccount'][_0xaed9('0x61')]({'where':{'id':_0x369089['params']['id']},'include':[{'model':db[_0xaed9('0xa1')],'as':_0xaed9('0xa2'),'include':[{'model':db[_0xaed9('0xa3')],'as':_0xaed9('0xa4'),'where':{'fax':_0x3b61bb},'limit':0x1,'order':[['updatedAt',_0xaed9('0xa5')]]}]}]})[_0xaed9('0x21')](handleEntityNotFound(_0x5c22da,null))[_0xaed9('0x21')](function(_0x5e2e77){_0x52248b=_0x5e2e77;if(_0x369089[_0xaed9('0x5d')]['attachments']&&_0x369089[_0xaed9('0x5d')][_0xaed9('0xa6')][_0xaed9('0x4c')]){for(var _0x2e7807=0x0;_0x2e7807<_0x369089['body']['attachments'][_0xaed9('0x4c')];_0x2e7807+=0x1){_0x369089[_0xaed9('0x5d')][_0xaed9('0xa6')][_0x2e7807]={'filename':_0x369089[_0xaed9('0x5d')][_0xaed9('0xa6')][_0x2e7807]['name'],'id':_0x369089[_0xaed9('0x5d')][_0xaed9('0xa6')][_0x2e7807]['id'],'path':path[_0xaed9('0xa7')](config[_0xaed9('0xa8')],_0xaed9('0xa9'),_0x369089['body']['attachments'][_0x2e7807][_0xaed9('0xaa')])};}}return respondWithRpcPromise('CheckAfterSend',_0xaed9('0xab'),{'FaxAccountId':_[_0xaed9('0xac')](_0x369089[_0xaed9('0x59')]['id'])?undefined:_0x369089[_0xaed9('0x59')]['id'],'path':_[_0xaed9('0xac')](_0x369089[_0xaed9('0x5d')][_0xaed9('0xa6')][0x0][_0xaed9('0x8')])?undefined:_0x369089[_0xaed9('0x5d')][_0xaed9('0xa6')][0x0]['path'],'fax':_[_0xaed9('0xac')](_0x369089[_0xaed9('0x5d')]['to'][0x0])?undefined:_0x369089[_0xaed9('0x5d')]['to'][0x0]},client9002);})['then'](function(){if(_0x52248b){if(_[_0xaed9('0xac')](_0x369089[_0xaed9('0x5d')][_0xaed9('0xad')])){_0x369089[_0xaed9('0x5d')][_0xaed9('0xad')]=util['format'](_0xaed9('0xae'),_0x52248b['name'],_0x52248b[_0xaed9('0xaf')]);}if(_0x52248b[_0xaed9('0xa2')]){if(_0x52248b[_0xaed9('0xa2')][_0xaed9('0xa4')]['length']){return _0x52248b['List'][_0xaed9('0xa4')][0x0];}else{return db[_0xaed9('0xa3')]['create'](_[_0xaed9('0x1a')](_0x369089[_0xaed9('0x5d')],{'firstName':_0x369089['body']['to'][0x0],'phone':_0x369089[_0xaed9('0x5d')]['to'][0x0],'fax':_0x369089[_0xaed9('0x5d')]['to'][0x0],'ListId':_0x52248b[_0xaed9('0x9a')]}));}}else{throw new Error(_0xaed9('0xb0'));}}else{throw new Error(_0xaed9('0xb1'));}})[_0xaed9('0x21')](function(_0x14f680){if(_0x14f680){return db[_0xaed9('0x73')][_0xaed9('0x61')]({'where':{'ContactId':_0x14f680['id'],'closed':![],'FaxAccountId':_0x52248b['id']}})['then'](function(_0x26a128){if(_0x26a128){return[_0x26a128,![]];}return db[_0xaed9('0x73')][_0xaed9('0x5c')]({'UserId':_0x369089['user']['id'],'ContactId':_0x14f680['id'],'FaxAccountId':_0x52248b['id'],'fax':_0x369089['body']['to'][0x0],'firstMsgDirection':_0xaed9('0xb2'),'Messages':[_['merge'](_0x369089[_0xaed9('0x5d')],{'read':![],'body':_0x369089[_0xaed9('0x5d')][_0xaed9('0xa6')][0x0]['filename'],'FaxAccountId':_0x52248b['id'],'UserId':_0x369089[_0xaed9('0x5e')]['id'],'ContactId':_0x14f680['id'],'AttachmentId':_0x369089[_0xaed9('0x5d')][_0xaed9('0xa6')][0x0]['id']})]},{'include':[{'model':db[_0xaed9('0x9d')],'as':_0xaed9('0xb3')}]})['then'](function(_0x1e17da){return[_0x1e17da,!![]];});});}else{throw new Error(_0xaed9('0xb4'));}})[_0xaed9('0xb5')](function(_0x596234,_0x2e8754){if(_0x2e8754){return _0x596234;}return db[_0xaed9('0x9d')][_0xaed9('0x5c')]({'direction':_0xaed9('0xb2'),'read':![],'body':_0x369089[_0xaed9('0x5d')][_0xaed9('0xa6')][0x0][_0xaed9('0xb6')],'FaxAccountId':_0x52248b['id'],'FaxInteractionId':_0x596234['id'],'UserId':_0x369089[_0xaed9('0x5e')]['id'],'ContactId':_0x596234[_0xaed9('0xb7')],'AttachmentId':_0x369089['body'][_0xaed9('0xa6')][0x0]['id']})[_0xaed9('0x21')](function(_0x5793f8){_0x596234[_0xaed9('0xb8')][_0xaed9('0xb3')]=[];_0x596234[_0xaed9('0xb8')][_0xaed9('0xb3')][_0xaed9('0x8b')](_0x5793f8[_0xaed9('0xb8')]);return _0x596234;});})[_0xaed9('0x21')](function(_0x4fc21f){respondWithRpcPromise(_0xaed9('0xb9'),_0xaed9('0xb9'),{'FaxAccountId':_[_0xaed9('0xac')](_0x369089[_0xaed9('0x59')]['id'])?undefined:_0x369089[_0xaed9('0x59')]['id'],'path':_[_0xaed9('0xac')](_0x369089[_0xaed9('0x5d')][_0xaed9('0xa6')][0x0][_0xaed9('0x8')])?undefined:_0x369089[_0xaed9('0x5d')][_0xaed9('0xa6')][0x0][_0xaed9('0x8')],'fax':_[_0xaed9('0xac')](_0x369089[_0xaed9('0x5d')]['to'][0x0])?undefined:_0x369089[_0xaed9('0x5d')]['to'][0x0],'AttachmentId':_0x369089['body']['attachments'][0x0]['id']},client9002)[_0xaed9('0x21')](function(_0xcb139e){logger[_0xaed9('0x29')]('SendFaxRpc,\x20%s',_0xcb139e);})[_0xaed9('0x5b')](function(_0x1bde44){logger['info'](_0xaed9('0xba'),_0x1bde44);});return _0x4fc21f;})[_0xaed9('0x21')](respondWithResult(_0x5c22da,null))[_0xaed9('0x5b')](handleError(_0x5c22da,null));};exports['addAgents']=function(_0x46816a,_0x253e05,_0x4442c1){return db[_0xaed9('0x3f')][_0xaed9('0x61')]({'where':{'id':_0x46816a['params']['id']}})[_0xaed9('0x21')](handleEntityNotFound(_0x253e05,null))[_0xaed9('0x21')](function(_0x4a5be5){if(_0x4a5be5){return _0x4a5be5[_0xaed9('0xbb')](_0x46816a[_0xaed9('0x5d')]['ids'],_[_0xaed9('0x74')](_0x46816a[_0xaed9('0x5d')],[_0xaed9('0x71'),'id'])||{})[_0xaed9('0xb5')](function(_0x42e534){for(var _0x290357=0x0;_0x290357<_0x46816a[_0xaed9('0x5d')][_0xaed9('0x71')][_0xaed9('0x4c')];_0x290357+=0x1){socket[_0xaed9('0xbc')](_0xaed9('0xbd'),{'UserId':Number(_0x46816a['body']['ids'][_0x290357]),'FaxAccountId':Number(_0x46816a[_0xaed9('0x59')]['id'])});}return _0x42e534;});}})[_0xaed9('0x21')](respondWithResult(_0x253e05,null))[_0xaed9('0x5b')](handleError(_0x253e05,null));};exports[_0xaed9('0xbe')]=function(_0x3665d0,_0x65ae7,_0x536d4){return db[_0xaed9('0x3f')][_0xaed9('0x61')]({'where':{'id':_0x3665d0[_0xaed9('0x59')]['id']}})[_0xaed9('0x21')](handleEntityNotFound(_0x65ae7,null))['then'](function(_0x38e90e){if(_0x38e90e){return _0x38e90e[_0xaed9('0xbe')](_0x3665d0['query'][_0xaed9('0x71')])[_0xaed9('0x21')](function(){if(_['isArray'](_0x3665d0[_0xaed9('0x46')][_0xaed9('0x71')])){for(var _0x42c4af=0x0;_0x42c4af<_0x3665d0[_0xaed9('0x46')][_0xaed9('0x71')][_0xaed9('0x4c')];_0x42c4af+=0x1){socket[_0xaed9('0xbc')](_0xaed9('0xbf'),{'UserId':Number(_0x3665d0[_0xaed9('0x46')][_0xaed9('0x71')][_0x42c4af]),'FaxAccountId':Number(_0x3665d0['params']['id'])});}}else{socket[_0xaed9('0xbc')]('userFaxAccount:remove',{'UserId':Number(_0x3665d0[_0xaed9('0x46')][_0xaed9('0x71')]),'FaxAccountId':Number(_0x3665d0[_0xaed9('0x59')]['id'])});}});}})[_0xaed9('0x21')](respondWithStatusCode(_0x65ae7,null))[_0xaed9('0x5b')](handleError(_0x65ae7,null));};exports[_0xaed9('0xc0')]=function(_0x3814b7,_0x59d073,_0x496fb1){var _0x574ffb={};var _0x377681={};var _0x8bc4ce;var _0x181423;return db[_0xaed9('0x3f')][_0xaed9('0x69')]({'where':{'id':_0x3814b7[_0xaed9('0x59')]['id']}})[_0xaed9('0x21')](handleEntityNotFound(_0x59d073,null))[_0xaed9('0x21')](function(_0x434e41){if(_0x434e41){_0x8bc4ce=_0x434e41;_0x377681[_0xaed9('0x44')]=_[_0xaed9('0x47')](db[_0xaed9('0x77')][_0xaed9('0x40')]);_0x377681[_0xaed9('0x46')]=_[_0xaed9('0x47')](_0x3814b7[_0xaed9('0x46')]);_0x377681[_0xaed9('0x48')]=_[_0xaed9('0x49')](_0x377681['model'],_0x377681['query']);_0x574ffb[_0xaed9('0x4a')]=_[_0xaed9('0x49')](_0x377681[_0xaed9('0x44')],qs[_0xaed9('0x4b')](_0x3814b7[_0xaed9('0x46')][_0xaed9('0x4b')]));_0x574ffb[_0xaed9('0x4a')]=_0x574ffb[_0xaed9('0x4a')][_0xaed9('0x4c')]?_0x574ffb['attributes']:_0x377681[_0xaed9('0x44')];_0x574ffb[_0xaed9('0x4d')]=qs['sort'](_0x3814b7[_0xaed9('0x46')]['sort']);_0x574ffb[_0xaed9('0x4f')]=qs[_0xaed9('0x48')](_[_0xaed9('0x50')](_0x3814b7[_0xaed9('0x46')],_0x377681['filters']));if(_0x3814b7[_0xaed9('0x46')][_0xaed9('0x51')]){_0x574ffb[_0xaed9('0x4f')]=_[_0xaed9('0x52')](_0x574ffb[_0xaed9('0x4f')],{'$or':_[_0xaed9('0x45')](_0x574ffb['attributes'],function(_0x73b0ae){var _0x25f310={};_0x25f310[_0x73b0ae]={'$like':'%'+_0x3814b7[_0xaed9('0x46')][_0xaed9('0x51')]+'%'};return _0x25f310;})});}_0x574ffb=_[_0xaed9('0x52')]({},_0x574ffb,_0x3814b7[_0xaed9('0x55')]);return _0x8bc4ce[_0xaed9('0xc0')](_0x574ffb);}})[_0xaed9('0x21')](function(_0x4a5ba0){if(_0x4a5ba0){_0x181423=_0x4a5ba0[_0xaed9('0x4c')];if(!_0x3814b7[_0xaed9('0x46')][_0xaed9('0x6a')](_0xaed9('0x6b'))){_0x574ffb[_0xaed9('0x2f')]=qs[_0xaed9('0x2f')](_0x3814b7[_0xaed9('0x46')][_0xaed9('0x2f')]);_0x574ffb[_0xaed9('0x2d')]=qs['offset'](_0x3814b7[_0xaed9('0x46')][_0xaed9('0x2d')]);}return _0x8bc4ce['getAgents'](_0x574ffb);}})[_0xaed9('0x21')](function(_0x1c095a){if(_0x1c095a){return _0x1c095a?{'count':_0x181423,'rows':_0x1c095a}:null;}})[_0xaed9('0x21')](respondWithResult(_0x59d073,null))[_0xaed9('0x5b')](handleError(_0x59d073,null));}; \ No newline at end of file +var _0xc928=['DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','Contacts','List\x20not\x20found','out','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','addAgents','userFaxAccount:save','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','FaxAccount,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','name','send','index','Pause','map','FaxAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','order','pick','filter','where','VIRTUAL','merge','options','includeAll','catch','mandatoryDispositionPause','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','hasOwnProperty','nolimit','sort','FaxAccountId','include','rows','CannedAnswer','getAnswers','findOne','findAll','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','User','Owner','fullname','internal','color','tag','addApplications','sequelize','transaction','FaxApplication','findAndCountAll','priority','getApplications','context','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','minrate','modem','t38timeout','/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','VoiceExtension','updateAccountApplications','bulkCreate','tech','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','List','CmContact'];(function(_0x51f4fc,_0x1fe3ef){var _0x4d96fc=function(_0xddc9){while(--_0xddc9){_0x51f4fc['push'](_0x51f4fc['shift']());}};_0x4d96fc(++_0x1fe3ef);}(_0xc928,0x198));var _0x8c92=function(_0x45659d,_0x21f454){_0x45659d=_0x45659d-0x0;var _0x4a9e47=_0xc928[_0x45659d];return _0x4a9e47;};'use strict';var emlformat=require(_0x8c92('0x0'));var rimraf=require(_0x8c92('0x1'));var zipdir=require(_0x8c92('0x2'));var jsonpatch=require(_0x8c92('0x3'));var rp=require(_0x8c92('0x4'));var moment=require(_0x8c92('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8c92('0x6'));var path=require(_0x8c92('0x7'));var sox=require(_0x8c92('0x8'));var csv=require('to-csv');var ejs=require(_0x8c92('0x9'));var fs=require('fs');var fs_extra=require(_0x8c92('0xa'));var _=require('lodash');var squel=require(_0x8c92('0xb'));var crypto=require(_0x8c92('0xc'));var jsforce=require(_0x8c92('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8c92('0xe'));var Papa=require(_0x8c92('0xf'));var Redis=require(_0x8c92('0x10'));var authService=require(_0x8c92('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8c92('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c92('0x13'))(_0x8c92('0x14'));var utils=require(_0x8c92('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8c92('0x16'));var db=require('../../mysqldb')['db'];config[_0x8c92('0x17')]=_[_0x8c92('0x18')](config[_0x8c92('0x17')],{'host':_0x8c92('0x19'),'port':0x18eb});var socket=require(_0x8c92('0x1a'))(new Redis(config[_0x8c92('0x17')]));require(_0x8c92('0x1b'))[_0x8c92('0x1c')](socket);var jayson=require(_0x8c92('0x1d'));var client=jayson[_0x8c92('0x1e')][_0x8c92('0x1f')]({'port':0x232c});var client9002=jayson[_0x8c92('0x1e')][_0x8c92('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xc55bb0,_0x20ae44,_0x374dcf,_0x3efd52){return new BPromise(function(_0x506431,_0x5198c1){var _0x2daaef=_0x3efd52||client;return _0x2daaef[_0x8c92('0x20')](_0xc55bb0,_0x374dcf)[_0x8c92('0x21')](function(_0x44b7ed){logger['info']('FaxAccount,\x20%s,\x20%s',_0x20ae44,_0x8c92('0x22'));logger[_0x8c92('0x23')](_0x8c92('0x24'),_0x20ae44,_0x8c92('0x22'),JSON[_0x8c92('0x25')](_0x44b7ed));if(_0x44b7ed[_0x8c92('0x26')]){if(_0x44b7ed[_0x8c92('0x26')]['code']===0x1f4){logger[_0x8c92('0x26')](_0x8c92('0x27'),_0x20ae44,_0x44b7ed[_0x8c92('0x26')][_0x8c92('0x28')]);return _0x5198c1(_0x44b7ed[_0x8c92('0x26')]['message']);}logger[_0x8c92('0x26')]('FaxAccount,\x20%s,\x20%s',_0x20ae44,_0x44b7ed['error'][_0x8c92('0x28')]);return _0x506431(_0x44b7ed['error'][_0x8c92('0x28')]);}else{logger[_0x8c92('0x29')]('FaxAccount,\x20%s,\x20%s',_0x20ae44,_0x8c92('0x22'));_0x506431(_0x44b7ed[_0x8c92('0x2a')][_0x8c92('0x28')]);}})['catch'](function(_0xa4e0c0){logger[_0x8c92('0x26')]('FaxAccount,\x20%s,\x20%s',_0x20ae44,_0xa4e0c0);_0x5198c1(_0xa4e0c0);});});}function respondWithStatusCode(_0x4f16ef,_0x26f38f){_0x26f38f=_0x26f38f||0xcc;return function(_0xc08c8b){if(_0xc08c8b){return _0x4f16ef[_0x8c92('0x2b')](_0x26f38f);}return _0x4f16ef[_0x8c92('0x2c')](_0x26f38f)[_0x8c92('0x2d')]();};}function respondWithResult(_0xfc180d,_0x1a25b7){_0x1a25b7=_0x1a25b7||0xc8;return function(_0x4cea4c){if(_0x4cea4c){return _0xfc180d[_0x8c92('0x2c')](_0x1a25b7)[_0x8c92('0x2e')](_0x4cea4c);}};}function respondWithFilteredResult(_0x432c3e,_0x560d07){return function(_0x945b65){if(_0x945b65){var _0x3d6824=typeof _0x560d07[_0x8c92('0x2f')]===_0x8c92('0x30')&&typeof _0x560d07[_0x8c92('0x31')]==='undefined';var _0x4a4278=_0x945b65['count'];var _0x191684=_0x3d6824?0x0:_0x560d07[_0x8c92('0x2f')];var _0x5cac6f=_0x3d6824?_0x945b65[_0x8c92('0x32')]:_0x560d07[_0x8c92('0x2f')]+_0x560d07['limit'];var _0x5513bc;if(_0x5cac6f>=_0x4a4278){_0x5cac6f=_0x4a4278;_0x5513bc=0xc8;}else{_0x5513bc=0xce;}_0x432c3e[_0x8c92('0x2c')](_0x5513bc);return _0x432c3e[_0x8c92('0x33')](_0x8c92('0x34'),_0x191684+'-'+_0x5cac6f+'/'+_0x4a4278)['json'](_0x945b65);}return null;};}function patchUpdates(_0x211c29){return function(_0x4613df){try{jsonpatch[_0x8c92('0x35')](_0x4613df,_0x211c29,!![]);}catch(_0x44876d){return BPromise[_0x8c92('0x36')](_0x44876d);}return _0x4613df[_0x8c92('0x37')]();};}function saveUpdates(_0x157472,_0x5d3dea){return function(_0x2029e7){if(_0x2029e7){return _0x2029e7[_0x8c92('0x38')](_0x157472)[_0x8c92('0x21')](function(_0x1696d8){return _0x1696d8;});}return null;};}function removeEntity(_0x3e0ea0,_0x18def2){return function(_0x1a761b){if(_0x1a761b){return _0x1a761b[_0x8c92('0x39')]()['then'](function(){var _0x3f57fd=_0x1a761b[_0x8c92('0x3a')]({'plain':!![]});var _0x175234=_0x8c92('0x3b');return db[_0x8c92('0x3c')][_0x8c92('0x39')]({'where':{'type':_0x175234,'resourceId':_0x3f57fd['id']}})[_0x8c92('0x21')](function(){return _0x1a761b;});})['then'](function(){_0x3e0ea0[_0x8c92('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fa40b,_0x926eb7){return function(_0xf6ad94){if(!_0xf6ad94){_0x1fa40b[_0x8c92('0x2b')](0x194);}return _0xf6ad94;};}function handleError(_0x471d33,_0x4dc72c){_0x4dc72c=_0x4dc72c||0x1f4;return function(_0xc30782){logger[_0x8c92('0x26')](_0xc30782['stack']);if(_0xc30782[_0x8c92('0x3d')]){delete _0xc30782['name'];}_0x471d33[_0x8c92('0x2c')](_0x4dc72c)[_0x8c92('0x3e')](_0xc30782);};}exports[_0x8c92('0x3f')]=function(_0x45b1eb,_0x398c18){var _0x1bc77e={'include':[{'model':db[_0x8c92('0x40')],'as':'mandatoryDispositionPause'}]},_0x20b7ab={},_0x46c264={'count':0x0,'rows':[]};var _0x3738ec=_[_0x8c92('0x41')](db[_0x8c92('0x42')][_0x8c92('0x43')],function(_0x5333b6){return{'name':_0x5333b6[_0x8c92('0x44')],'type':_0x5333b6[_0x8c92('0x45')][_0x8c92('0x46')]};});_0x20b7ab[_0x8c92('0x47')]=_['map'](_0x3738ec,'name');_0x20b7ab['query']=_[_0x8c92('0x48')](_0x45b1eb[_0x8c92('0x49')]);_0x20b7ab[_0x8c92('0x4a')]=_[_0x8c92('0x4b')](_0x20b7ab['model'],_0x20b7ab['query']);_0x1bc77e[_0x8c92('0x4c')]=_[_0x8c92('0x4b')](_0x20b7ab['model'],qs[_0x8c92('0x4d')](_0x45b1eb[_0x8c92('0x49')][_0x8c92('0x4d')]));_0x1bc77e[_0x8c92('0x4c')]=_0x1bc77e[_0x8c92('0x4c')]['length']?_0x1bc77e['attributes']:_0x20b7ab[_0x8c92('0x47')];if(!_0x45b1eb[_0x8c92('0x49')]['hasOwnProperty']('nolimit')){_0x1bc77e[_0x8c92('0x31')]=qs[_0x8c92('0x31')](_0x45b1eb[_0x8c92('0x49')][_0x8c92('0x31')]);_0x1bc77e[_0x8c92('0x2f')]=qs[_0x8c92('0x2f')](_0x45b1eb[_0x8c92('0x49')]['offset']);}_0x1bc77e[_0x8c92('0x4e')]=qs['sort'](_0x45b1eb[_0x8c92('0x49')]['sort']);_0x1bc77e['where']=qs[_0x8c92('0x4a')](_[_0x8c92('0x4f')](_0x45b1eb['query'],_0x20b7ab[_0x8c92('0x4a')]),_0x3738ec);if(_0x45b1eb['query'][_0x8c92('0x50')]){_0x1bc77e[_0x8c92('0x51')]=_['merge'](_0x1bc77e[_0x8c92('0x51')],{'$or':_[_0x8c92('0x41')](_0x3738ec,function(_0x4a315a){if(_0x4a315a[_0x8c92('0x45')]!==_0x8c92('0x52')){var _0x1669d9={};_0x1669d9[_0x4a315a['name']]={'$like':'%'+_0x45b1eb[_0x8c92('0x49')][_0x8c92('0x50')]+'%'};return _0x1669d9;}})});}_0x1bc77e=_[_0x8c92('0x53')]({},_0x1bc77e,_0x45b1eb[_0x8c92('0x54')]);var _0xccc542={'where':_0x1bc77e['where']};return db[_0x8c92('0x42')][_0x8c92('0x32')](_0xccc542)[_0x8c92('0x21')](function(_0x2e63fe){_0x46c264[_0x8c92('0x32')]=_0x2e63fe;if(_0x45b1eb[_0x8c92('0x49')][_0x8c92('0x55')]){_0x1bc77e['include']=[{'all':!![]}];}return db[_0x8c92('0x42')]['findAll'](_0x1bc77e);})['then'](function(_0x57da01){_0x46c264['rows']=_0x57da01;return _0x46c264;})[_0x8c92('0x21')](respondWithFilteredResult(_0x398c18,_0x1bc77e))[_0x8c92('0x56')](handleError(_0x398c18,null));};exports['show']=function(_0x29b332,_0x19cccc){var _0x24a636={'raw':![],'where':{'id':_0x29b332['params']['id']},'include':[{'model':db[_0x8c92('0x40')],'as':_0x8c92('0x57')}]},_0x1156d5={};_0x1156d5[_0x8c92('0x47')]=_[_0x8c92('0x48')](db[_0x8c92('0x42')][_0x8c92('0x43')]);_0x1156d5[_0x8c92('0x49')]=_[_0x8c92('0x48')](_0x29b332['query']);_0x1156d5[_0x8c92('0x4a')]=_[_0x8c92('0x4b')](_0x1156d5['model'],_0x1156d5['query']);_0x24a636[_0x8c92('0x4c')]=_[_0x8c92('0x4b')](_0x1156d5[_0x8c92('0x47')],qs['fields'](_0x29b332[_0x8c92('0x49')][_0x8c92('0x4d')]));_0x24a636['attributes']=_0x24a636[_0x8c92('0x4c')][_0x8c92('0x58')]?_0x24a636[_0x8c92('0x4c')]:_0x1156d5[_0x8c92('0x47')];if(_0x29b332[_0x8c92('0x49')][_0x8c92('0x55')]){_0x24a636['include']=[{'all':!![]}];}_0x24a636=_['merge']({},_0x24a636,_0x29b332[_0x8c92('0x54')]);return db[_0x8c92('0x42')][_0x8c92('0x59')](_0x24a636)[_0x8c92('0x21')](handleEntityNotFound(_0x19cccc,null))['then'](respondWithResult(_0x19cccc,null))[_0x8c92('0x56')](handleError(_0x19cccc,null));};exports['create']=function(_0x3791e7,_0x1c5011){return db['FaxAccount'][_0x8c92('0x5a')](_0x3791e7[_0x8c92('0x5b')],{})['then'](function(_0x47bef0){var _0x2d8250=_0x3791e7[_0x8c92('0x5c')][_0x8c92('0x3a')]({'plain':!![]});if(!_0x2d8250)throw new Error(_0x8c92('0x5d'));if(_0x2d8250['role']===_0x8c92('0x5c')){var _0x270e77=_0x47bef0[_0x8c92('0x3a')]({'plain':!![]});var _0x5b0f7e=_0x8c92('0x3b');return db[_0x8c92('0x5e')][_0x8c92('0x59')]({'where':{'name':_0x5b0f7e,'userProfileId':_0x2d8250[_0x8c92('0x5f')]},'raw':!![]})[_0x8c92('0x21')](function(_0xd0195b){if(_0xd0195b&&_0xd0195b[_0x8c92('0x60')]===0x0){return db[_0x8c92('0x3c')][_0x8c92('0x5a')]({'name':_0x270e77['name'],'resourceId':_0x270e77['id'],'type':_0xd0195b['name'],'sectionId':_0xd0195b['id']},{})[_0x8c92('0x21')](function(){return _0x47bef0;});}else{return _0x47bef0;}})['catch'](function(_0x33510f){logger['error'](_0x8c92('0x61'),_0x33510f);throw _0x33510f;});}return _0x47bef0;})[_0x8c92('0x21')](respondWithResult(_0x1c5011,0xc9))[_0x8c92('0x56')](handleError(_0x1c5011,null));};exports[_0x8c92('0x38')]=function(_0x26a677,_0x4c4f6a){if(_0x26a677[_0x8c92('0x5b')]['id']){delete _0x26a677[_0x8c92('0x5b')]['id'];}return db[_0x8c92('0x42')]['find']({'where':{'id':_0x26a677[_0x8c92('0x62')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x8c92('0x21')](handleEntityNotFound(_0x4c4f6a,null))[_0x8c92('0x21')](saveUpdates(_0x26a677[_0x8c92('0x5b')],null))['then'](respondWithResult(_0x4c4f6a,null))[_0x8c92('0x56')](handleError(_0x4c4f6a,null));};exports[_0x8c92('0x39')]=function(_0x3987c6,_0x22ee65){return db[_0x8c92('0x42')][_0x8c92('0x59')]({'where':{'id':_0x3987c6[_0x8c92('0x62')]['id']}})[_0x8c92('0x21')](handleEntityNotFound(_0x22ee65,null))[_0x8c92('0x21')](removeEntity(_0x22ee65,null))[_0x8c92('0x56')](handleError(_0x22ee65,null));};exports[_0x8c92('0x63')]=function(_0x54ba0e,_0x189bb8){return db[_0x8c92('0x42')]['describe']()['then'](respondWithResult(_0x189bb8,null))['catch'](handleError(_0x189bb8,null));};exports[_0x8c92('0x64')]=function(_0x29b324,_0x464c5e,_0x51bb19){if(_0x29b324[_0x8c92('0x5b')]['id']){delete _0x29b324[_0x8c92('0x5b')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x29b324[_0x8c92('0x62')]['id']}})['then'](handleEntityNotFound(_0x464c5e,null))[_0x8c92('0x21')](function(_0x43287d){if(_0x43287d){_0x29b324[_0x8c92('0x5b')]['FaxAccountId']=_0x43287d['id'];return db[_0x8c92('0x65')]['create'](_0x29b324['body']);}})['then'](respondWithResult(_0x464c5e,null))[_0x8c92('0x56')](handleError(_0x464c5e,null));};exports[_0x8c92('0x66')]=function(_0x20a725,_0x4607bf,_0x5c1570){var _0x58e84e={'raw':![],'where':{}};var _0x455d17={};var _0x46c0ed={'count':0x0,'rows':[]};return db[_0x8c92('0x42')]['findOne']({'where':{'id':_0x20a725[_0x8c92('0x62')]['id']}})[_0x8c92('0x21')](handleEntityNotFound(_0x4607bf,null))['then'](function(_0x390421){if(_0x390421){_0x455d17[_0x8c92('0x47')]=_['keys'](db[_0x8c92('0x65')][_0x8c92('0x43')]);_0x455d17[_0x8c92('0x49')]=_['keys'](_0x20a725[_0x8c92('0x49')]);_0x455d17['filters']=_['intersection'](_0x455d17[_0x8c92('0x47')],_0x455d17[_0x8c92('0x49')]);_0x58e84e[_0x8c92('0x4c')]=_[_0x8c92('0x4b')](_0x455d17[_0x8c92('0x47')],qs[_0x8c92('0x4d')](_0x20a725[_0x8c92('0x49')][_0x8c92('0x4d')]));_0x58e84e[_0x8c92('0x4c')]=_0x58e84e[_0x8c92('0x4c')][_0x8c92('0x58')]?_0x58e84e[_0x8c92('0x4c')]:_0x455d17['model'];if(!_0x20a725[_0x8c92('0x49')][_0x8c92('0x67')](_0x8c92('0x68'))){_0x58e84e[_0x8c92('0x31')]=qs[_0x8c92('0x31')](_0x20a725[_0x8c92('0x49')][_0x8c92('0x31')]);_0x58e84e[_0x8c92('0x2f')]=qs['offset'](_0x20a725['query']['offset']);}_0x58e84e[_0x8c92('0x4e')]=qs[_0x8c92('0x69')](_0x20a725['query']['sort']);_0x58e84e[_0x8c92('0x51')]=qs['filters'](_[_0x8c92('0x4f')](_0x20a725['query'],_0x455d17['filters']));_0x58e84e[_0x8c92('0x51')][_0x8c92('0x6a')]=_0x390421['id'];if(_0x20a725['query'][_0x8c92('0x50')]){_0x58e84e[_0x8c92('0x51')]=_[_0x8c92('0x53')](_0x58e84e[_0x8c92('0x51')],{'$or':_[_0x8c92('0x41')](_0x58e84e['attributes'],function(_0x125f1c){var _0x1e1b18={};_0x1e1b18[_0x125f1c]={'$like':'%'+_0x20a725['query'][_0x8c92('0x50')]+'%'};return _0x1e1b18;})});}_0x58e84e=_['merge']({},_0x58e84e,_0x20a725['options']);return db[_0x8c92('0x65')]['count']({'where':_0x58e84e['where']})[_0x8c92('0x21')](function(_0x3572f4){_0x46c0ed[_0x8c92('0x32')]=_0x3572f4;if(_0x20a725['query']['includeAll']){_0x58e84e[_0x8c92('0x6b')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x58e84e);})[_0x8c92('0x21')](function(_0x61c13e){_0x46c0ed[_0x8c92('0x6c')]=_0x61c13e;return _0x46c0ed;});}})[_0x8c92('0x21')](respondWithFilteredResult(_0x4607bf,_0x58e84e))[_0x8c92('0x56')](handleError(_0x4607bf,null));};exports['removeDispositions']=function(_0xa179e3,_0x146fb9,_0x537110){return db[_0x8c92('0x42')][_0x8c92('0x59')]({'where':{'id':_0xa179e3[_0x8c92('0x62')]['id']}})[_0x8c92('0x21')](handleEntityNotFound(_0x146fb9,null))[_0x8c92('0x21')](function(_0x3791a7){if(_0x3791a7){return _0x3791a7['removeDispositions'](_0xa179e3[_0x8c92('0x49')]['ids']);}})['then'](respondWithStatusCode(_0x146fb9,null))[_0x8c92('0x56')](handleError(_0x146fb9,null));};exports['addAnswer']=function(_0x99c8e3,_0x5a3c22,_0x360ccd){if(_0x99c8e3[_0x8c92('0x5b')]['id']){delete _0x99c8e3[_0x8c92('0x5b')]['id'];}return db[_0x8c92('0x42')][_0x8c92('0x59')]({'where':{'id':_0x99c8e3['params']['id']}})[_0x8c92('0x21')](handleEntityNotFound(_0x5a3c22,null))[_0x8c92('0x21')](function(_0x511d01){if(_0x511d01){_0x99c8e3[_0x8c92('0x5b')][_0x8c92('0x6a')]=_0x511d01['id'];return db[_0x8c92('0x6d')][_0x8c92('0x5a')](_0x99c8e3[_0x8c92('0x5b')]);}})[_0x8c92('0x21')](respondWithResult(_0x5a3c22,null))[_0x8c92('0x56')](handleError(_0x5a3c22,null));};exports[_0x8c92('0x6e')]=function(_0x1ecae1,_0x4c65f8,_0x42604e){var _0xe80e5a={'raw':![],'where':{}};var _0x7e0f39={};var _0x81457d={'count':0x0,'rows':[]};return db[_0x8c92('0x42')][_0x8c92('0x6f')]({'where':{'id':_0x1ecae1[_0x8c92('0x62')]['id']}})[_0x8c92('0x21')](handleEntityNotFound(_0x4c65f8,null))['then'](function(_0xd1ad44){if(_0xd1ad44){_0x7e0f39['model']=_[_0x8c92('0x48')](db[_0x8c92('0x6d')]['rawAttributes']);_0x7e0f39[_0x8c92('0x49')]=_['keys'](_0x1ecae1[_0x8c92('0x49')]);_0x7e0f39[_0x8c92('0x4a')]=_[_0x8c92('0x4b')](_0x7e0f39[_0x8c92('0x47')],_0x7e0f39[_0x8c92('0x49')]);_0xe80e5a[_0x8c92('0x4c')]=_[_0x8c92('0x4b')](_0x7e0f39[_0x8c92('0x47')],qs[_0x8c92('0x4d')](_0x1ecae1[_0x8c92('0x49')][_0x8c92('0x4d')]));_0xe80e5a[_0x8c92('0x4c')]=_0xe80e5a[_0x8c92('0x4c')][_0x8c92('0x58')]?_0xe80e5a[_0x8c92('0x4c')]:_0x7e0f39['model'];if(!_0x1ecae1['query']['hasOwnProperty'](_0x8c92('0x68'))){_0xe80e5a[_0x8c92('0x31')]=qs[_0x8c92('0x31')](_0x1ecae1[_0x8c92('0x49')]['limit']);_0xe80e5a[_0x8c92('0x2f')]=qs[_0x8c92('0x2f')](_0x1ecae1[_0x8c92('0x49')]['offset']);}_0xe80e5a[_0x8c92('0x4e')]=qs[_0x8c92('0x69')](_0x1ecae1[_0x8c92('0x49')][_0x8c92('0x69')]);_0xe80e5a[_0x8c92('0x51')]=qs[_0x8c92('0x4a')](_[_0x8c92('0x4f')](_0x1ecae1['query'],_0x7e0f39['filters']));_0xe80e5a[_0x8c92('0x51')][_0x8c92('0x6a')]=_0xd1ad44['id'];if(_0x1ecae1['query'][_0x8c92('0x50')]){_0xe80e5a['where']=_[_0x8c92('0x53')](_0xe80e5a[_0x8c92('0x51')],{'$or':_[_0x8c92('0x41')](_0xe80e5a[_0x8c92('0x4c')],function(_0x317470){var _0x51dc6e={};_0x51dc6e[_0x317470]={'$like':'%'+_0x1ecae1[_0x8c92('0x49')][_0x8c92('0x50')]+'%'};return _0x51dc6e;})});}_0xe80e5a=_[_0x8c92('0x53')]({},_0xe80e5a,_0x1ecae1['options']);return db['CannedAnswer'][_0x8c92('0x32')]({'where':_0xe80e5a['where']})[_0x8c92('0x21')](function(_0x47cce0){_0x81457d['count']=_0x47cce0;if(_0x1ecae1['query']['includeAll']){_0xe80e5a[_0x8c92('0x6b')]=[{'all':!![]}];}return db['CannedAnswer'][_0x8c92('0x70')](_0xe80e5a);})[_0x8c92('0x21')](function(_0x1ac247){_0x81457d['rows']=_0x1ac247;return _0x81457d;});}})[_0x8c92('0x21')](respondWithFilteredResult(_0x4c65f8,_0xe80e5a))['catch'](handleError(_0x4c65f8,null));};exports[_0x8c92('0x71')]=function(_0x2d4b11,_0x3144e4,_0x551c69){return db['FaxAccount']['find']({'where':{'id':_0x2d4b11[_0x8c92('0x62')]['id']}})[_0x8c92('0x21')](handleEntityNotFound(_0x3144e4,null))[_0x8c92('0x21')](function(_0x32cb8a){if(_0x32cb8a){return _0x32cb8a[_0x8c92('0x71')](_0x2d4b11[_0x8c92('0x49')][_0x8c92('0x72')]);}})[_0x8c92('0x21')](respondWithStatusCode(_0x3144e4,null))[_0x8c92('0x56')](handleError(_0x3144e4,null));};exports[_0x8c92('0x73')]=function(_0x247f91,_0x44b2be,_0x312f54){return db[_0x8c92('0x74')]['find']({'where':{'id':_0x247f91[_0x8c92('0x62')]['id']}})[_0x8c92('0x21')](handleEntityNotFound(_0x44b2be,null))[_0x8c92('0x21')](function(_0x356751){if(_0x356751){return _0x356751[_0x8c92('0x73')](_0x247f91[_0x8c92('0x5b')][_0x8c92('0x72')],_[_0x8c92('0x75')](_0x247f91[_0x8c92('0x5b')],[_0x8c92('0x72'),'id'])||{});}})[_0x8c92('0x21')](respondWithResult(_0x44b2be,null))[_0x8c92('0x56')](handleError(_0x44b2be,null));};exports[_0x8c92('0x76')]=function(_0x5b36c1,_0x62e617,_0x3eb422){var _0x43a08a={'raw':![],'where':{}};var _0x5d37d4={};var _0x4993e5={'count':0x0,'rows':[]};return db[_0x8c92('0x42')][_0x8c92('0x6f')]({'where':{'id':_0x5b36c1[_0x8c92('0x62')]['id']}})[_0x8c92('0x21')](handleEntityNotFound(_0x62e617,null))[_0x8c92('0x21')](function(_0x2e0afa){if(_0x2e0afa){_0x5d37d4[_0x8c92('0x47')]=_[_0x8c92('0x48')](db['FaxInteraction'][_0x8c92('0x43')]);_0x5d37d4[_0x8c92('0x49')]=_['keys'](_0x5b36c1[_0x8c92('0x49')]);_0x5d37d4[_0x8c92('0x4a')]=_[_0x8c92('0x4b')](_0x5d37d4['model'],_0x5d37d4[_0x8c92('0x49')]);_0x43a08a[_0x8c92('0x4c')]=_['intersection'](_0x5d37d4[_0x8c92('0x47')],qs[_0x8c92('0x4d')](_0x5b36c1[_0x8c92('0x49')][_0x8c92('0x4d')]));_0x43a08a[_0x8c92('0x4c')]=_0x43a08a[_0x8c92('0x4c')][_0x8c92('0x58')]?_0x43a08a['attributes']:_0x5d37d4['model'];if(!_0x5b36c1[_0x8c92('0x49')][_0x8c92('0x67')](_0x8c92('0x68'))){_0x43a08a[_0x8c92('0x31')]=qs['limit'](_0x5b36c1[_0x8c92('0x49')][_0x8c92('0x31')]);_0x43a08a['offset']=qs['offset'](_0x5b36c1[_0x8c92('0x49')][_0x8c92('0x2f')]);}_0x43a08a[_0x8c92('0x4e')]=qs[_0x8c92('0x69')](_0x5b36c1[_0x8c92('0x49')]['sort']);_0x43a08a[_0x8c92('0x51')]=qs[_0x8c92('0x4a')](_[_0x8c92('0x4f')](_0x5b36c1['query'],_0x5d37d4[_0x8c92('0x4a')]));_0x43a08a['where'][_0x8c92('0x6a')]=_0x2e0afa['id'];if(_0x5b36c1['query'][_0x8c92('0x50')]){_0x43a08a[_0x8c92('0x51')]=_[_0x8c92('0x53')](_0x43a08a[_0x8c92('0x51')],{'$or':_[_0x8c92('0x41')](_0x43a08a['attributes'],function(_0x596060){var _0xe78291={};_0xe78291[_0x596060]={'$like':'%'+_0x5b36c1[_0x8c92('0x49')]['filter']+'%'};return _0xe78291;})});}_0x43a08a=_[_0x8c92('0x53')]({},_0x43a08a,_0x5b36c1['options']);return db[_0x8c92('0x74')][_0x8c92('0x32')]({'where':_0x43a08a[_0x8c92('0x51')]})[_0x8c92('0x21')](function(_0x10607c){_0x4993e5[_0x8c92('0x32')]=_0x10607c;if(_0x5b36c1[_0x8c92('0x49')][_0x8c92('0x55')]){_0x43a08a['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x8c92('0x77')],'as':_0x8c92('0x78'),'attributes':[_0x8c92('0x3d'),_0x8c92('0x79'),_0x8c92('0x7a')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x8c92('0x7b')],'where':_0x5b36c1[_0x8c92('0x49')][_0x8c92('0x7c')]?{'id':_0x5b36c1['query'][_0x8c92('0x7c')]}:undefined,'required':_0x5b36c1[_0x8c92('0x49')][_0x8c92('0x7c')]?!![]:![]}];}return db[_0x8c92('0x74')]['findAll'](_0x43a08a);})[_0x8c92('0x21')](function(_0x381b6f){_0x4993e5[_0x8c92('0x6c')]=_0x381b6f;return _0x4993e5;});}})['then'](respondWithFilteredResult(_0x62e617,_0x43a08a))['catch'](handleError(_0x62e617,null));};exports[_0x8c92('0x7d')]=function(_0x560a51,_0x5bc776,_0x48022b){return db[_0x8c92('0x42')][_0x8c92('0x6f')]({'where':{'id':_0x560a51[_0x8c92('0x62')]['id']}})['then'](handleEntityNotFound(_0x5bc776,null))[_0x8c92('0x21')](function(_0x366ded){if(_0x366ded){return db[_0x8c92('0x7e')][_0x8c92('0x7f')](function(_0x705785){return db[_0x8c92('0x80')][_0x8c92('0x39')]({'where':{'FaxAccountId':_0x560a51[_0x8c92('0x62')]['id']},'transaction':_0x705785})[_0x8c92('0x21')](function(_0x5bf5c4){var _0x1da281=_[_0x8c92('0x41')](_0x560a51[_0x8c92('0x5b')],function(_0x105974){_0x105974[_0x8c92('0x6a')]=_0x560a51[_0x8c92('0x62')]['id'];return _0x105974;});return db[_0x8c92('0x80')]['bulkCreate'](_0x1da281,{'transaction':_0x705785});});})[_0x8c92('0x21')](function(){return db[_0x8c92('0x80')][_0x8c92('0x81')]({'where':{'FaxAccountId':_0x560a51[_0x8c92('0x62')]['id']},'order':_0x8c92('0x82')});});}})[_0x8c92('0x21')](respondWithResult(_0x5bc776,null))[_0x8c92('0x56')](handleError(_0x5bc776,null));};exports['getApplications']=function(_0x46e032,_0x13a082,_0x50d46b){var _0x4f3dde={};var _0x34344d={};var _0x289aba;var _0x4d1f49;return db[_0x8c92('0x42')][_0x8c92('0x6f')]({'where':{'id':_0x46e032[_0x8c92('0x62')]['id']}})[_0x8c92('0x21')](handleEntityNotFound(_0x13a082,null))[_0x8c92('0x21')](function(_0x3876a6){if(_0x3876a6){_0x289aba=_0x3876a6;_0x34344d[_0x8c92('0x47')]=_[_0x8c92('0x48')](db[_0x8c92('0x80')][_0x8c92('0x43')]);_0x34344d['query']=_[_0x8c92('0x48')](_0x46e032[_0x8c92('0x49')]);_0x34344d[_0x8c92('0x4a')]=_[_0x8c92('0x4b')](_0x34344d[_0x8c92('0x47')],_0x34344d[_0x8c92('0x49')]);_0x4f3dde[_0x8c92('0x4c')]=_[_0x8c92('0x4b')](_0x34344d['model'],qs[_0x8c92('0x4d')](_0x46e032[_0x8c92('0x49')]['fields']));_0x4f3dde[_0x8c92('0x4c')]=_0x4f3dde['attributes']['length']?_0x4f3dde['attributes']:_0x34344d[_0x8c92('0x47')];_0x4f3dde[_0x8c92('0x4e')]=qs[_0x8c92('0x69')](_0x46e032[_0x8c92('0x49')][_0x8c92('0x69')]);_0x4f3dde[_0x8c92('0x51')]=qs[_0x8c92('0x4a')](_[_0x8c92('0x4f')](_0x46e032[_0x8c92('0x49')],_0x34344d['filters']));if(_0x46e032[_0x8c92('0x49')][_0x8c92('0x50')]){_0x4f3dde[_0x8c92('0x51')]=_[_0x8c92('0x53')](_0x4f3dde[_0x8c92('0x51')],{'$or':_['map'](_0x4f3dde['attributes'],function(_0x45bf57){var _0x3c37de={};_0x3c37de[_0x45bf57]={'$like':'%'+_0x46e032['query']['filter']+'%'};return _0x3c37de;})});}_0x4f3dde=_[_0x8c92('0x53')]({},_0x4f3dde,_0x46e032[_0x8c92('0x54')]);return _0x289aba[_0x8c92('0x83')](_0x4f3dde);}})[_0x8c92('0x21')](function(_0x298939){if(_0x298939){_0x4d1f49=_0x298939[_0x8c92('0x58')];if(!_0x46e032[_0x8c92('0x49')]['hasOwnProperty']('nolimit')){_0x4f3dde[_0x8c92('0x31')]=qs[_0x8c92('0x31')](_0x46e032[_0x8c92('0x49')][_0x8c92('0x31')]);_0x4f3dde[_0x8c92('0x2f')]=qs['offset'](_0x46e032[_0x8c92('0x49')][_0x8c92('0x2f')]);}return _0x289aba['getApplications'](_0x4f3dde);}})[_0x8c92('0x21')](function(_0x4db212){if(_0x4db212){return _0x4db212?{'count':_0x4d1f49,'rows':_0x4db212}:null;}})[_0x8c92('0x21')](respondWithResult(_0x13a082,null))['catch'](handleError(_0x13a082,null));};function Extension(_0x10f107,_0x11de27,_0x3c1109,_0x21d046){this[_0x8c92('0x84')]='from-voip-provider';this[_0x8c92('0x85')]=_0x10f107[_0x8c92('0x86')];this[_0x8c92('0x87')]=_0x21d046;this[_0x8c92('0x45')]=_0x8c92('0x88');this[_0x8c92('0x89')]=_0x8c92('0x8a');this['FaxAccountId']=_0x10f107['id'];this[_0x8c92('0x82')]=_0x11de27;this[_0x8c92('0x8b')]=_0x3c1109;}function createExtensionsReciveFax(_0x29f72d){var _0x40c0e4=0x1;var _0x9ef0d5=[];_0x9ef0d5[_0x8c92('0x8c')](new Extension(_0x29f72d,_0x40c0e4,'',_0x8c92('0x8d')));_0x40c0e4+=0x1;_0x9ef0d5[_0x8c92('0x8c')](new Extension(_0x29f72d,_0x40c0e4,_0x8c92('0x8e'),_0x8c92('0x8f')));_0x40c0e4+=0x1;for(var _0x41a7f0 in _0x29f72d){if(_0x29f72d['hasOwnProperty'](_0x41a7f0)&&(_0x41a7f0===_0x8c92('0x90')||_0x41a7f0==='localstationid'||_0x41a7f0===_0x8c92('0x91')||_0x41a7f0==='faxdetect'||_0x41a7f0===_0x8c92('0x92')||_0x41a7f0==='maxrate'||_0x41a7f0===_0x8c92('0x93')||_0x41a7f0===_0x8c92('0x94')||_0x41a7f0===_0x8c92('0x95'))){_0x9ef0d5[_0x8c92('0x8c')](new Extension(_0x29f72d,_0x40c0e4,'FAXOPT('+_0x41a7f0+')='+_0x29f72d[_0x41a7f0],_0x8c92('0x8f')));_0x40c0e4+=0x1;}}_0x9ef0d5[_0x8c92('0x8c')](new Extension(_0x29f72d,_0x40c0e4,'6','Wait'));_0x40c0e4+=0x1;_0x9ef0d5[_0x8c92('0x8c')](new Extension(_0x29f72d,_0x40c0e4,_0x8c92('0x96'),_0x8c92('0x97')));_0x40c0e4=0x0;return _0x9ef0d5;}exports[_0x8c92('0x98')]=function(_0x3e07b5,_0x48933b,_0x205be9){var _0x2ffa3e;return db['sequelize']['transaction'](function(_0x108125){return db[_0x8c92('0x42')][_0x8c92('0x5a')](_0x3e07b5[_0x8c92('0x5b')],{'transaction':_0x108125})['then'](function(_0x2e822a){_0x2ffa3e=_0x2e822a[_0x8c92('0x3a')]({'plain':!![]});return db[_0x8c92('0x99')]['bulkCreate'](createExtensionsReciveFax(_0x2ffa3e),{'transaction':_0x108125});});})[_0x8c92('0x21')](function(){return _0x2ffa3e;})[_0x8c92('0x21')](respondWithResult(_0x48933b,null))['catch'](handleError(_0x48933b,null));};exports[_0x8c92('0x9a')]=function(_0x160723,_0x5d0bf0,_0x49ca7f){var _0x544611;return db[_0x8c92('0x7e')][_0x8c92('0x7f')](function(_0x88cc06){return db[_0x8c92('0x42')][_0x8c92('0x38')](_0x160723[_0x8c92('0x5b')],{'where':{'id':_0x160723['body']['id']},'transaction':_0x88cc06})['then'](function(_0x877a59){return db[_0x8c92('0x99')]['destroy']({'where':{'FaxAccountId':_0x160723[_0x8c92('0x5b')]['id']},'transaction':_0x88cc06})['then'](function(_0x4d5ffb){return db[_0x8c92('0x99')][_0x8c92('0x9b')](createExtensionsReciveFax(_[_0x8c92('0x75')](_0x160723[_0x8c92('0x5b')],[_0x8c92('0x9c'),'key',_0x8c92('0x9d'),'updatedAt',_0x8c92('0x9e'),_0x8c92('0x9f')])),{'transaction':_0x88cc06});});});})[_0x8c92('0x21')](function(){return db[_0x8c92('0x42')][_0x8c92('0xa0')](_0x160723[_0x8c92('0x5b')]['id']);})[_0x8c92('0x21')](respondWithResult(_0x5d0bf0,null))[_0x8c92('0x56')](handleError(_0x5d0bf0,null));};exports[_0x8c92('0xa1')]=function(_0x15bb78,_0x214479,_0x109b24){var _0x3f86c2={'raw':!![],'where':{}};var _0x4ba63d={};var _0x5ef55d={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x15bb78[_0x8c92('0x62')]['id']}})[_0x8c92('0x21')](handleEntityNotFound(_0x214479,null))[_0x8c92('0x21')](function(_0x413fa5){if(_0x413fa5){_0x4ba63d[_0x8c92('0x47')]=_[_0x8c92('0x48')](db[_0x8c92('0xa2')][_0x8c92('0x43')]);_0x4ba63d[_0x8c92('0x49')]=_[_0x8c92('0x48')](_0x15bb78[_0x8c92('0x49')]);_0x4ba63d[_0x8c92('0x4a')]=_[_0x8c92('0x4b')](_0x4ba63d['model'],_0x4ba63d[_0x8c92('0x49')]);_0x3f86c2[_0x8c92('0x4c')]=_[_0x8c92('0x4b')](_0x4ba63d[_0x8c92('0x47')],qs['fields'](_0x15bb78['query'][_0x8c92('0x4d')]));_0x3f86c2[_0x8c92('0x4c')]=_0x3f86c2[_0x8c92('0x4c')]['length']?_0x3f86c2[_0x8c92('0x4c')]:_0x4ba63d[_0x8c92('0x47')];if(!_0x15bb78['query']['hasOwnProperty'](_0x8c92('0x68'))){_0x3f86c2[_0x8c92('0x31')]=qs[_0x8c92('0x31')](_0x15bb78[_0x8c92('0x49')]['limit']);_0x3f86c2['offset']=qs[_0x8c92('0x2f')](_0x15bb78['query']['offset']);}_0x3f86c2[_0x8c92('0x4e')]=qs[_0x8c92('0x69')](_0x15bb78[_0x8c92('0x49')][_0x8c92('0x69')]);_0x3f86c2[_0x8c92('0x51')]=qs[_0x8c92('0x4a')](_[_0x8c92('0x4f')](_0x15bb78['query'],_0x4ba63d[_0x8c92('0x4a')]));_0x3f86c2[_0x8c92('0x51')][_0x8c92('0x6a')]=_0x413fa5['id'];if(_0x15bb78[_0x8c92('0x49')]['filter']){_0x3f86c2[_0x8c92('0x51')]=_[_0x8c92('0x53')](_0x3f86c2[_0x8c92('0x51')],{'$or':_[_0x8c92('0x41')](_0x3f86c2[_0x8c92('0x4c')],function(_0x5532af){var _0x1ecd10={};_0x1ecd10[_0x5532af]={'$like':'%'+_0x15bb78[_0x8c92('0x49')][_0x8c92('0x50')]+'%'};return _0x1ecd10;})});}if(_0x15bb78['query'][_0x8c92('0xa3')]){var _0xf7da6b=_0x15bb78[_0x8c92('0x49')]['$gte'][_0x8c92('0xa4')](',');var _0x3a0f5e={};_0x3a0f5e[_0xf7da6b[0x0]]={'$gte':moment(_0xf7da6b[0x1])[_0x8c92('0xa5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3f86c2[_0x8c92('0x51')]=_['merge'](_0x3f86c2['where'],_0x3a0f5e);}_0x3f86c2=_[_0x8c92('0x53')]({},_0x3f86c2,_0x15bb78['options']);return db['FaxMessage'][_0x8c92('0x32')]({'where':_0x3f86c2['where']})[_0x8c92('0x21')](function(_0x15e3cb){_0x5ef55d['count']=_0x15e3cb;if(_0x15bb78[_0x8c92('0x49')][_0x8c92('0x55')]){_0x3f86c2['include']=[{'all':!![]}];}return db[_0x8c92('0xa2')][_0x8c92('0x70')](_0x3f86c2);})[_0x8c92('0x21')](function(_0x3cec5d){_0x5ef55d[_0x8c92('0x6c')]=_0x3cec5d;return _0x5ef55d;});}})[_0x8c92('0x21')](respondWithFilteredResult(_0x214479,_0x3f86c2))[_0x8c92('0x56')](handleError(_0x214479,null));};exports[_0x8c92('0x3e')]=function(_0x527e2c,_0x4d34d5,_0x54e4c3){var _0x352bec,_0x3f3187={},_0x2edc9d;if(_0x527e2c[_0x8c92('0x5b')]['to']){_0x2edc9d=_0x527e2c[_0x8c92('0x5b')]['to'][0x0];}return db[_0x8c92('0x42')][_0x8c92('0x59')]({'where':{'id':_0x527e2c[_0x8c92('0x62')]['id']},'include':[{'model':db['CmList'],'as':_0x8c92('0xa6'),'include':[{'model':db[_0x8c92('0xa7')],'as':'Contacts','where':{'fax':_0x2edc9d},'limit':0x1,'order':[['updatedAt',_0x8c92('0xa8')]]}]}]})[_0x8c92('0x21')](handleEntityNotFound(_0x4d34d5,null))[_0x8c92('0x21')](function(_0xaef24a){_0x352bec=_0xaef24a;if(_0x527e2c['body'][_0x8c92('0xa9')]&&_0x527e2c['body'][_0x8c92('0xa9')][_0x8c92('0x58')]){for(var _0x2d9066=0x0;_0x2d9066<_0x527e2c[_0x8c92('0x5b')][_0x8c92('0xa9')][_0x8c92('0x58')];_0x2d9066+=0x1){_0x527e2c[_0x8c92('0x5b')]['attachments'][_0x2d9066]={'filename':_0x527e2c[_0x8c92('0x5b')]['attachments'][_0x2d9066][_0x8c92('0x3d')],'id':_0x527e2c['body']['attachments'][_0x2d9066]['id'],'path':path[_0x8c92('0xaa')](config[_0x8c92('0xab')],_0x8c92('0xac'),_0x527e2c[_0x8c92('0x5b')][_0x8c92('0xa9')][_0x2d9066][_0x8c92('0xad')])};}}return respondWithRpcPromise(_0x8c92('0xae'),_0x8c92('0xae'),{'FaxAccountId':_[_0x8c92('0xaf')](_0x527e2c['params']['id'])?undefined:_0x527e2c['params']['id'],'path':_[_0x8c92('0xaf')](_0x527e2c[_0x8c92('0x5b')][_0x8c92('0xa9')][0x0]['path'])?undefined:_0x527e2c[_0x8c92('0x5b')][_0x8c92('0xa9')][0x0][_0x8c92('0x7')],'fax':_[_0x8c92('0xaf')](_0x527e2c[_0x8c92('0x5b')]['to'][0x0])?undefined:_0x527e2c['body']['to'][0x0]},client9002);})[_0x8c92('0x21')](function(){if(_0x352bec){if(_[_0x8c92('0xaf')](_0x527e2c[_0x8c92('0x5b')][_0x8c92('0xb0')])){_0x527e2c[_0x8c92('0x5b')][_0x8c92('0xb0')]=util['format'](_0x8c92('0xb1'),_0x352bec['name'],_0x352bec['fax']);}if(_0x352bec[_0x8c92('0xa6')]){if(_0x352bec['List'][_0x8c92('0xb2')][_0x8c92('0x58')]){return _0x352bec['List'][_0x8c92('0xb2')][0x0];}else{return db[_0x8c92('0xa7')]['create'](_['defaults'](_0x527e2c[_0x8c92('0x5b')],{'firstName':_0x527e2c[_0x8c92('0x5b')]['to'][0x0],'phone':_0x527e2c['body']['to'][0x0],'fax':_0x527e2c[_0x8c92('0x5b')]['to'][0x0],'ListId':_0x352bec[_0x8c92('0x9f')]}));}}else{throw new Error(_0x8c92('0xb3'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x8c92('0x21')](function(_0x1698c3){if(_0x1698c3){return db[_0x8c92('0x74')][_0x8c92('0x59')]({'where':{'ContactId':_0x1698c3['id'],'closed':![],'FaxAccountId':_0x352bec['id']}})[_0x8c92('0x21')](function(_0x5d91e3){if(_0x5d91e3){return[_0x5d91e3,![]];}return db['FaxInteraction']['create']({'UserId':_0x527e2c[_0x8c92('0x5c')]['id'],'ContactId':_0x1698c3['id'],'FaxAccountId':_0x352bec['id'],'fax':_0x527e2c[_0x8c92('0x5b')]['to'][0x0],'firstMsgDirection':_0x8c92('0xb4'),'Messages':[_['merge'](_0x527e2c[_0x8c92('0x5b')],{'read':![],'body':_0x527e2c[_0x8c92('0x5b')]['attachments'][0x0]['filename'],'FaxAccountId':_0x352bec['id'],'UserId':_0x527e2c[_0x8c92('0x5c')]['id'],'ContactId':_0x1698c3['id'],'AttachmentId':_0x527e2c[_0x8c92('0x5b')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x8c92('0xa2')],'as':_0x8c92('0xb5')}]})[_0x8c92('0x21')](function(_0x5e41c1){return[_0x5e41c1,!![]];});});}else{throw new Error(_0x8c92('0xb6'));}})[_0x8c92('0xb7')](function(_0x8fbb9f,_0x4547fa){if(_0x4547fa){return _0x8fbb9f;}return db['FaxMessage'][_0x8c92('0x5a')]({'direction':_0x8c92('0xb4'),'read':![],'body':_0x527e2c[_0x8c92('0x5b')][_0x8c92('0xa9')][0x0]['filename'],'FaxAccountId':_0x352bec['id'],'FaxInteractionId':_0x8fbb9f['id'],'UserId':_0x527e2c[_0x8c92('0x5c')]['id'],'ContactId':_0x8fbb9f['ContactId'],'AttachmentId':_0x527e2c[_0x8c92('0x5b')][_0x8c92('0xa9')][0x0]['id']})[_0x8c92('0x21')](function(_0x47e088){_0x8fbb9f[_0x8c92('0xb8')][_0x8c92('0xb5')]=[];_0x8fbb9f[_0x8c92('0xb8')][_0x8c92('0xb5')][_0x8c92('0x8c')](_0x47e088['dataValues']);return _0x8fbb9f;});})['then'](function(_0x3928d2){respondWithRpcPromise('SendFax',_0x8c92('0xb9'),{'FaxAccountId':_[_0x8c92('0xaf')](_0x527e2c[_0x8c92('0x62')]['id'])?undefined:_0x527e2c[_0x8c92('0x62')]['id'],'path':_[_0x8c92('0xaf')](_0x527e2c[_0x8c92('0x5b')][_0x8c92('0xa9')][0x0]['path'])?undefined:_0x527e2c[_0x8c92('0x5b')][_0x8c92('0xa9')][0x0][_0x8c92('0x7')],'fax':_['isNil'](_0x527e2c[_0x8c92('0x5b')]['to'][0x0])?undefined:_0x527e2c[_0x8c92('0x5b')]['to'][0x0],'AttachmentId':_0x527e2c[_0x8c92('0x5b')][_0x8c92('0xa9')][0x0]['id']},client9002)[_0x8c92('0x21')](function(_0x1b4d92){logger[_0x8c92('0x29')]('SendFaxRpc,\x20%s',_0x1b4d92);})[_0x8c92('0x56')](function(_0x233ff6){logger[_0x8c92('0x29')]('SendFaxRpc,\x20%s',_0x233ff6);});return _0x3928d2;})[_0x8c92('0x21')](respondWithResult(_0x4d34d5,null))[_0x8c92('0x56')](handleError(_0x4d34d5,null));};exports[_0x8c92('0xba')]=function(_0x311387,_0xd9b489,_0x5dfb12){return db[_0x8c92('0x42')][_0x8c92('0x59')]({'where':{'id':_0x311387[_0x8c92('0x62')]['id']}})[_0x8c92('0x21')](handleEntityNotFound(_0xd9b489,null))[_0x8c92('0x21')](function(_0x29545f){if(_0x29545f){return _0x29545f['addAgents'](_0x311387[_0x8c92('0x5b')][_0x8c92('0x72')],_['omit'](_0x311387[_0x8c92('0x5b')],[_0x8c92('0x72'),'id'])||{})[_0x8c92('0xb7')](function(_0x17a9c6){for(var _0x97361=0x0;_0x97361<_0x311387[_0x8c92('0x5b')]['ids'][_0x8c92('0x58')];_0x97361+=0x1){socket['emit'](_0x8c92('0xbb'),{'UserId':Number(_0x311387[_0x8c92('0x5b')][_0x8c92('0x72')][_0x97361]),'FaxAccountId':Number(_0x311387[_0x8c92('0x62')]['id'])});}return _0x17a9c6;});}})[_0x8c92('0x21')](respondWithResult(_0xd9b489,null))[_0x8c92('0x56')](handleError(_0xd9b489,null));};exports['removeAgents']=function(_0x57226a,_0xc6821f,_0xfccc37){return db[_0x8c92('0x42')][_0x8c92('0x59')]({'where':{'id':_0x57226a[_0x8c92('0x62')]['id']}})[_0x8c92('0x21')](handleEntityNotFound(_0xc6821f,null))['then'](function(_0x27685c){if(_0x27685c){return _0x27685c['removeAgents'](_0x57226a['query'][_0x8c92('0x72')])[_0x8c92('0x21')](function(){if(_[_0x8c92('0xbc')](_0x57226a[_0x8c92('0x49')][_0x8c92('0x72')])){for(var _0x53ed9f=0x0;_0x53ed9f<_0x57226a[_0x8c92('0x49')][_0x8c92('0x72')][_0x8c92('0x58')];_0x53ed9f+=0x1){socket[_0x8c92('0xbd')](_0x8c92('0xbe'),{'UserId':Number(_0x57226a['query'][_0x8c92('0x72')][_0x53ed9f]),'FaxAccountId':Number(_0x57226a[_0x8c92('0x62')]['id'])});}}else{socket[_0x8c92('0xbd')](_0x8c92('0xbe'),{'UserId':Number(_0x57226a[_0x8c92('0x49')][_0x8c92('0x72')]),'FaxAccountId':Number(_0x57226a[_0x8c92('0x62')]['id'])});}});}})[_0x8c92('0x21')](respondWithStatusCode(_0xc6821f,null))[_0x8c92('0x56')](handleError(_0xc6821f,null));};exports[_0x8c92('0xbf')]=function(_0x494090,_0x2d772f,_0x34f275){var _0x4b0f4c={};var _0x525111={};var _0x174977;var _0x654674;return db[_0x8c92('0x42')][_0x8c92('0x6f')]({'where':{'id':_0x494090[_0x8c92('0x62')]['id']}})[_0x8c92('0x21')](handleEntityNotFound(_0x2d772f,null))[_0x8c92('0x21')](function(_0x163c47){if(_0x163c47){_0x174977=_0x163c47;_0x525111[_0x8c92('0x47')]=_[_0x8c92('0x48')](db[_0x8c92('0x77')][_0x8c92('0x43')]);_0x525111[_0x8c92('0x49')]=_['keys'](_0x494090['query']);_0x525111['filters']=_[_0x8c92('0x4b')](_0x525111[_0x8c92('0x47')],_0x525111[_0x8c92('0x49')]);_0x4b0f4c[_0x8c92('0x4c')]=_[_0x8c92('0x4b')](_0x525111[_0x8c92('0x47')],qs['fields'](_0x494090[_0x8c92('0x49')]['fields']));_0x4b0f4c[_0x8c92('0x4c')]=_0x4b0f4c[_0x8c92('0x4c')][_0x8c92('0x58')]?_0x4b0f4c[_0x8c92('0x4c')]:_0x525111[_0x8c92('0x47')];_0x4b0f4c[_0x8c92('0x4e')]=qs[_0x8c92('0x69')](_0x494090['query'][_0x8c92('0x69')]);_0x4b0f4c[_0x8c92('0x51')]=qs[_0x8c92('0x4a')](_[_0x8c92('0x4f')](_0x494090[_0x8c92('0x49')],_0x525111[_0x8c92('0x4a')]));if(_0x494090[_0x8c92('0x49')][_0x8c92('0x50')]){_0x4b0f4c[_0x8c92('0x51')]=_[_0x8c92('0x53')](_0x4b0f4c['where'],{'$or':_[_0x8c92('0x41')](_0x4b0f4c[_0x8c92('0x4c')],function(_0x5bc75f){var _0xedfa63={};_0xedfa63[_0x5bc75f]={'$like':'%'+_0x494090[_0x8c92('0x49')][_0x8c92('0x50')]+'%'};return _0xedfa63;})});}_0x4b0f4c=_[_0x8c92('0x53')]({},_0x4b0f4c,_0x494090[_0x8c92('0x54')]);return _0x174977['getAgents'](_0x4b0f4c);}})['then'](function(_0x17c868){if(_0x17c868){_0x654674=_0x17c868['length'];if(!_0x494090[_0x8c92('0x49')][_0x8c92('0x67')](_0x8c92('0x68'))){_0x4b0f4c['limit']=qs[_0x8c92('0x31')](_0x494090['query']['limit']);_0x4b0f4c[_0x8c92('0x2f')]=qs[_0x8c92('0x2f')](_0x494090[_0x8c92('0x49')][_0x8c92('0x2f')]);}return _0x174977[_0x8c92('0xbf')](_0x4b0f4c);}})['then'](function(_0xbf0110){if(_0xbf0110){return _0xbf0110?{'count':_0x654674,'rows':_0xbf0110}:null;}})['then'](respondWithResult(_0x2d772f,null))[_0x8c92('0x56')](handleError(_0x2d772f,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index e4ab1b1..f742cb5 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 _0xeeaf=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','update'];(function(_0x5da20a,_0x3b8cd1){var _0x20522f=function(_0x221262){while(--_0x221262){_0x5da20a['push'](_0x5da20a['shift']());}};_0x20522f(++_0x3b8cd1);}(_0xeeaf,0x159));var _0xfeea=function(_0x490058,_0x931952){_0x490058=_0x490058-0x0;var _0x44423f=_0xeeaf[_0x490058];return _0x44423f;};'use strict';var EventEmitter=require(_0xfeea('0x0'));var FaxAccount=require(_0xfeea('0x1'))['db'][_0xfeea('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xfeea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfeea('0x4'),'afterDestroy':_0xfeea('0x5')};function emitEvent(_0x84cb4a){return function(_0x52506f,_0x1bbaf8,_0x222234){FaxAccountEvents['emit'](_0x84cb4a+':'+_0x52506f['id'],_0x52506f);FaxAccountEvents[_0xfeea('0x6')](_0x84cb4a,_0x52506f);_0x222234(null);};}for(var e in events){if(events[_0xfeea('0x7')](e)){var event=events[e];FaxAccount[_0xfeea('0x8')](e,emitEvent(event));}}module[_0xfeea('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x3563=['exports','events','FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0xec53d3,_0x3dd596){var _0x3d9888=function(_0x3411b5){while(--_0x3411b5){_0xec53d3['push'](_0xec53d3['shift']());}};_0x3d9888(++_0x3dd596);}(_0x3563,0x17b));var _0x3356=function(_0x15c15c,_0x248598){_0x15c15c=_0x15c15c-0x0;var _0xf37a17=_0x3563[_0x15c15c];return _0xf37a17;};'use strict';var EventEmitter=require(_0x3356('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x3356('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x3356('0x2')](0x0);var events={'afterCreate':_0x3356('0x3'),'afterUpdate':_0x3356('0x4'),'afterDestroy':_0x3356('0x5')};function emitEvent(_0x4c76a2){return function(_0x48b625,_0x41ab33,_0x5ceefc){FaxAccountEvents[_0x3356('0x6')](_0x4c76a2+':'+_0x48b625['id'],_0x48b625);FaxAccountEvents['emit'](_0x4c76a2,_0x48b625);_0x5ceefc(null);};}for(var e in events){if(events[_0x3356('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x3356('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 671130a..662cc1f 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 _0xaae4=['exports','FaxAccount','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes'];(function(_0x299a98,_0x578011){var _0x6fd85a=function(_0x139658){while(--_0x139658){_0x299a98['push'](_0x299a98['shift']());}};_0x6fd85a(++_0x578011);}(_0xaae4,0x146));var _0x4aae=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xaae4[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x4aae('0x0'));var util=require('util');var logger=require(_0x4aae('0x1'))(_0x4aae('0x2'));var moment=require(_0x4aae('0x3'));var BPromise=require(_0x4aae('0x4'));var rp=require(_0x4aae('0x5'));var fs=require('fs');var path=require(_0x4aae('0x6'));var rimraf=require(_0x4aae('0x7'));var config=require(_0x4aae('0x8'));var attributes=require(_0x4aae('0x9'));module[_0x4aae('0xa')]=function(_0x269730,_0x19943c){return _0x269730['define'](_0x4aae('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc26=['util','api','moment','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash'];(function(_0x3c09db,_0x6eaff5){var _0x598d5e=function(_0x106c35){while(--_0x106c35){_0x3c09db['push'](_0x3c09db['shift']());}};_0x598d5e(++_0x6eaff5);}(_0xcc26,0x15e));var _0x6cc2=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0xcc26[_0x1347f8];return _0x218368;};'use strict';var _=require(_0x6cc2('0x0'));var util=require(_0x6cc2('0x1'));var logger=require('../../config/logger')(_0x6cc2('0x2'));var moment=require(_0x6cc2('0x3'));var BPromise=require('bluebird');var rp=require(_0x6cc2('0x4'));var fs=require('fs');var path=require(_0x6cc2('0x5'));var rimraf=require(_0x6cc2('0x6'));var config=require(_0x6cc2('0x7'));var attributes=require(_0x6cc2('0x8'));module[_0x6cc2('0x9')]=function(_0x1462e7,_0x1e74c1){return _0x1462e7[_0x6cc2('0xa')](_0x6cc2('0xb'),attributes,{'tableName':_0x6cc2('0xc'),'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 2270108..99a3418 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 _0xb69d=['AttachmentId','interaction','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','FaxAccount','findAll','options','where','attributes','limit','include','model','GetFaxAccount','catch','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','isNil','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','from','account','CmList','List','Contacts','Applications','applications','orderBy','priority','asc','length','defaults','create','contact','find','Contact\x20not\x20found','spread','get','autoclose','push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId'];(function(_0xd30d5e,_0x1965aa){var _0x1757d3=function(_0x44067f){while(--_0x44067f){_0xd30d5e['push'](_0xd30d5e['shift']());}};_0x1757d3(++_0x1965aa);}(_0xb69d,0x111));var _0xdb69=function(_0x2d58c7,_0x19bd8b){_0x2d58c7=_0x2d58c7-0x0;var _0x5b9bb0=_0xb69d[_0x2d58c7];return _0x5b9bb0;};'use strict';var _=require('lodash');var util=require(_0xdb69('0x0'));var moment=require(_0xdb69('0x1'));var BPromise=require(_0xdb69('0x2'));var rs=require(_0xdb69('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdb69('0x4'));var logger=require(_0xdb69('0x5'))('rpc');var config=require(_0xdb69('0x6'));var jayson=require(_0xdb69('0x7'));var client=jayson['client'][_0xdb69('0x8')]({'port':0x232c});config['redis']=_['defaults'](config[_0xdb69('0x9')],{'host':_0xdb69('0xa'),'port':0x18eb});var socket=require(_0xdb69('0xb'))(new Redis(config[_0xdb69('0x9')]));require('./faxAccount.socket')[_0xdb69('0xc')](socket);function respondWithRpcPromise(_0x1f9632,_0x5a7d11,_0x3831b5){return new BPromise(function(_0x5be2ca,_0x8becc6){return client['request'](_0x1f9632,_0x3831b5)[_0xdb69('0xd')](function(_0x221e2e){logger[_0xdb69('0xe')](_0xdb69('0xf'),_0x5a7d11,_0xdb69('0x10'));logger['debug'](_0xdb69('0x11'),_0x5a7d11,_0xdb69('0x10'),JSON[_0xdb69('0x12')](_0x221e2e));if(_0x221e2e[_0xdb69('0x13')]){if(_0x221e2e[_0xdb69('0x13')]['code']===0x1f4){logger[_0xdb69('0x13')](_0xdb69('0xf'),_0x5a7d11,_0x221e2e[_0xdb69('0x13')]['message']);return _0x8becc6(_0x221e2e[_0xdb69('0x13')][_0xdb69('0x14')]);}logger[_0xdb69('0x13')]('FaxAccount,\x20%s,\x20%s',_0x5a7d11,_0x221e2e[_0xdb69('0x13')][_0xdb69('0x14')]);return _0x5be2ca(_0x221e2e[_0xdb69('0x13')]['message']);}else{logger[_0xdb69('0xe')]('FaxAccount,\x20%s,\x20%s',_0x5a7d11,_0xdb69('0x10'));_0x5be2ca(_0x221e2e[_0xdb69('0x15')][_0xdb69('0x14')]);}})['catch'](function(_0x334349){logger[_0xdb69('0x13')]('FaxAccount,\x20%s,\x20%s',_0x5a7d11,_0x334349);_0x8becc6(_0x334349);});});}exports['GetFaxAccount']=function(_0x1e908){var _0x36db02=this;return new Promise(function(_0x7b3194,_0x42a12f){return db[_0xdb69('0x16')][_0xdb69('0x17')]({'raw':_0x1e908[_0xdb69('0x18')]?_0x1e908[_0xdb69('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1e908[_0xdb69('0x18')]?_0x1e908[_0xdb69('0x18')][_0xdb69('0x19')]||null:null,'attributes':_0x1e908[_0xdb69('0x18')]?_0x1e908['options'][_0xdb69('0x1a')]||null:null,'limit':_0x1e908[_0xdb69('0x18')]?_0x1e908[_0xdb69('0x18')][_0xdb69('0x1b')]||null:null,'include':_0x1e908[_0xdb69('0x18')]?_0x1e908[_0xdb69('0x18')]['include']?_['map'](_0x1e908[_0xdb69('0x18')]['include'],function(_0x829931){return{'model':db[_0x829931['model']],'as':_0x829931['as'],'attributes':_0x829931[_0xdb69('0x1a')],'include':_0x829931[_0xdb69('0x1c')]?_['map'](_0x829931[_0xdb69('0x1c')],function(_0x54997d){return{'model':db[_0x54997d[_0xdb69('0x1d')]],'as':_0x54997d['as'],'attributes':_0x54997d[_0xdb69('0x1a')],'include':_0x54997d[_0xdb69('0x1c')]?_['map'](_0x54997d[_0xdb69('0x1c')],function(_0xf2bf9f){return{'model':db[_0xf2bf9f[_0xdb69('0x1d')]],'as':_0xf2bf9f['as'],'attributes':_0xf2bf9f[_0xdb69('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xdb69('0xd')](function(_0x1de7a1){logger['info'](_0xdb69('0x1e'),_0x1e908);logger['debug'](_0xdb69('0x1e'),_0x1e908,JSON[_0xdb69('0x12')](_0x1de7a1));_0x7b3194(_0x1de7a1);})[_0xdb69('0x1f')](function(_0xc796e2){logger['error']('GetFaxAccount',_0xc796e2[_0xdb69('0x14')],_0x1e908);_0x42a12f(_0x36db02['error'](0x1f4,_0xc796e2[_0xdb69('0x14')]));});});};exports[_0xdb69('0x20')]=function(_0x22a3fb,_0x27bcc6,_0x586a80){var _0x418c75=this;return new Promise(function(_0x15e529,_0x5b3240){var _0x158ec8={'body':_0x22a3fb[_0xdb69('0x21')],'channel':_0xdb69('0x22')};var _0x8f3184=[];var _0x47a1b9=[];var _0x56bb75={};return db[_0xdb69('0x23')][_0xdb69('0x24')]()['then'](function(_0x55ce9c){if(!_0x55ce9c){throw new db['Sequelize'][(_0xdb69('0x25'))](_0xdb69('0x26'));}_0x8f3184=_[_0xdb69('0x27')](_[_0xdb69('0x28')](_0x55ce9c),['createdAt',_0xdb69('0x29')]);_0x47a1b9=_['difference'](_[_0xdb69('0x28')](_0x55ce9c),[_0xdb69('0x2a'),_0xdb69('0x29'),_0xdb69('0x2b'),_0xdb69('0x2c')]);if(_0x22a3fb[_0xdb69('0x21')]['id']){delete _0x22a3fb[_0xdb69('0x21')]['id'];}if(_['isNil'](_0x22a3fb[_0xdb69('0x21')]['from'])){throw new db[(_0xdb69('0x2d'))]['ValidationError'](_0xdb69('0x2e'));}if(_[_0xdb69('0x2f')](_0x22a3fb[_0xdb69('0x21')][_0xdb69('0x21')])||_0x22a3fb['body']['body']===''){throw new db['Sequelize'][(_0xdb69('0x25'))](_0xdb69('0x30'));}if(_[_0xdb69('0x2f')](_0x22a3fb['body'][_0xdb69('0x31')])){throw new db[(_0xdb69('0x2d'))][(_0xdb69('0x25'))](_0xdb69('0x32')+_0x47a1b9);}if(!_[_0xdb69('0x33')](_0x47a1b9,_0x22a3fb[_0xdb69('0x21')][_0xdb69('0x31')])){throw new db['Sequelize'][(_0xdb69('0x25'))](_0xdb69('0x34')+_0x47a1b9);}_0x56bb75[_0x22a3fb['body'][_0xdb69('0x31')]]=_0x22a3fb[_0xdb69('0x21')][_0xdb69('0x35')];})['then'](function(){return db['FaxAccount']['find']({'where':{'id':_0x22a3fb[_0xdb69('0x36')]['id']},'include':[{'model':db[_0xdb69('0x37')],'as':_0xdb69('0x38'),'include':[{'model':db[_0xdb69('0x23')],'as':_0xdb69('0x39'),'where':_0x56bb75,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['FaxApplication'],'as':_0xdb69('0x3a')}]});})[_0xdb69('0xd')](function(_0x3c1275){if(_0x3c1275&&_0x3c1275[_0xdb69('0x38')]){var _0x30bdb6=_0x3c1275['get']({'plain':!![]});_0x158ec8[_0xdb69('0x36')]=_0x30bdb6;_0x158ec8[_0xdb69('0x3b')]=_0x30bdb6[_0xdb69('0x3a')];_0x158ec8['list']=_0x30bdb6[_0xdb69('0x38')];_0x158ec8[_0xdb69('0x3b')]=_[_0xdb69('0x3c')](_0x158ec8[_0xdb69('0x3b')],[_0xdb69('0x3d')],[_0xdb69('0x3e')]);if(_0x158ec8[_0xdb69('0x36')][_0xdb69('0x3a')]){delete _0x158ec8['account'][_0xdb69('0x3a')];}if(_0x158ec8['account']['List']&&_0x158ec8[_0xdb69('0x36')][_0xdb69('0x38')][_0xdb69('0x39')][_0xdb69('0x3f')]){return _0x158ec8[_0xdb69('0x36')][_0xdb69('0x38')][_0xdb69('0x39')][0x0];}var _0x578565=_[_0xdb69('0x40')](_0x22a3fb[_0xdb69('0x21')],{'firstName':_0x22a3fb[_0xdb69('0x21')]['from'],'ListId':_0x30bdb6[_0xdb69('0x2c')]});_0x578565[_0x22a3fb[_0xdb69('0x21')][_0xdb69('0x31')]]=_0x22a3fb[_0xdb69('0x21')][_0xdb69('0x35')];return db[_0xdb69('0x23')][_0xdb69('0x41')](_0x578565,{'fields':_0x8f3184,'raw':!![]});}})['then'](function(_0x40221c){_0x158ec8[_0xdb69('0x42')]=_0x40221c;if(_0x40221c){var _0x1524ae={'ContactId':_0x40221c['id'],'FaxAccountId':_0x22a3fb[_0xdb69('0x36')]['id'],'fax':_0x40221c[_0xdb69('0x22')]};return db['FaxInteraction'][_0xdb69('0x43')]({'where':{'ContactId':_0x40221c['id'],'closed':![],'FaxAccountId':_0x22a3fb[_0xdb69('0x36')]['id']}})[_0xdb69('0xd')](function(_0x582813){if(_0x582813){return[_0x582813,![]];}return db['FaxInteraction'][_0xdb69('0x41')](_0x1524ae)[_0xdb69('0xd')](function(_0x179542){return[_0x179542,!![]];});});}else{throw new Error(_0xdb69('0x44'));}})[_0xdb69('0x45')](function(_0x18923d,_0x5057ff){var _0x42fcb2=_0x18923d[_0xdb69('0x46')]({'plain':!![]});if(_0x5057ff){if(_0x158ec8[_0xdb69('0x36')][_0xdb69('0x47')]){_0x158ec8[_0xdb69('0x3b')][_0xdb69('0x48')]({'id':0x0,'priority':_0x158ec8[_0xdb69('0x3b')][_0xdb69('0x3f')]+0x1,'app':_0xdb69('0x49'),'appdata':_0xdb69('0x4a'),'interval':_0xdb69('0x4b')});}_0x42fcb2[_0xdb69('0x4c')]=!![];}else{_0x42fcb2[_0xdb69('0x4c')]=![];}_0x158ec8['interaction']=_0x42fcb2;return db[_0xdb69('0x4d')][_0xdb69('0x41')]({'body':_0x22a3fb[_0xdb69('0x21')][_0xdb69('0x21')],'FaxAccountId':_0x22a3fb[_0xdb69('0x36')]['id'],'FaxInteractionId':_0x18923d['id'],'direction':'in','ContactId':_0x18923d[_0xdb69('0x4e')],'AttachmentId':_0x22a3fb[_0xdb69('0x21')][_0xdb69('0x4f')]});})[_0xdb69('0xd')](function(_0x5f4d91){_0x158ec8['message']=_0x5f4d91;if(_0x158ec8[_0xdb69('0x50')][_0xdb69('0x51')]){return db[_0xdb69('0x52')][_0xdb69('0x43')]({'attributes':['id',_0xdb69('0x53')],'where':{'id':_0x158ec8[_0xdb69('0x50')][_0xdb69('0x51')]}})[_0xdb69('0xd')](function(_0x3c3f52){if(_0x3c3f52){_0x158ec8[_0xdb69('0x3b')]['unshift']({'id':0x0,'priority':0x0,'app':_0xdb69('0x54'),'appdata':_0x3c3f52['name']+','+(_0x158ec8[_0xdb69('0x36')][_0xdb69('0x55')]||0xa),'interval':_0xdb69('0x4b')});}return respondWithRpcPromise(_0xdb69('0x56'),'startRouting',_0x158ec8);});}return respondWithRpcPromise(_0xdb69('0x56'),_0xdb69('0x57'),_0x158ec8);})[_0xdb69('0xd')](function(_0x5273ca){_0x15e529(_0x5273ca);})[_0xdb69('0x1f')](function(_0x45c161){_0x5b3240(_0x418c75[_0xdb69('0x13')](0x1f4,_0x45c161['message']));});});}; \ No newline at end of file +var _0xb3ba=['account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','priority','asc','length','contact','fax','FaxInteraction','create','Contact\x20not\x20found','close','unmanaged','*,*,*,*','created','AttachmentId','interaction','UserId','unshift','agent','name','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','map','model','catch','NotifyFaxAccount','CmContact','describe','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','body','isNil','from','Sequelize','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','find'];(function(_0x37aec1,_0x2d1612){var _0xeb8dd4=function(_0x5e40bd){while(--_0x5e40bd){_0x37aec1['push'](_0x37aec1['shift']());}};_0xeb8dd4(++_0x2d1612);}(_0xb3ba,0x12c));var _0xab3b=function(_0x2ccf99,_0x5b7d1c){_0x2ccf99=_0x2ccf99-0x0;var _0x9b4b52=_0xb3ba[_0x2ccf99];return _0x9b4b52;};'use strict';var _=require(_0xab3b('0x0'));var util=require(_0xab3b('0x1'));var moment=require('moment');var BPromise=require(_0xab3b('0x2'));var rs=require(_0xab3b('0x3'));var fs=require('fs');var Redis=require(_0xab3b('0x4'));var db=require(_0xab3b('0x5'))['db'];var utils=require(_0xab3b('0x6'));var logger=require(_0xab3b('0x7'))(_0xab3b('0x8'));var config=require(_0xab3b('0x9'));var jayson=require(_0xab3b('0xa'));var client=jayson[_0xab3b('0xb')][_0xab3b('0xc')]({'port':0x232c});config['redis']=_[_0xab3b('0xd')](config[_0xab3b('0xe')],{'host':_0xab3b('0xf'),'port':0x18eb});var socket=require(_0xab3b('0x10'))(new Redis(config[_0xab3b('0xe')]));require('./faxAccount.socket')[_0xab3b('0x11')](socket);function respondWithRpcPromise(_0x5e1617,_0x2243aa,_0x580541){return new BPromise(function(_0x21758d,_0x895023){return client[_0xab3b('0x12')](_0x5e1617,_0x580541)[_0xab3b('0x13')](function(_0x42ac54){logger[_0xab3b('0x14')](_0xab3b('0x15'),_0x2243aa,_0xab3b('0x16'));logger[_0xab3b('0x17')](_0xab3b('0x18'),_0x2243aa,'request\x20sent',JSON[_0xab3b('0x19')](_0x42ac54));if(_0x42ac54[_0xab3b('0x1a')]){if(_0x42ac54['error'][_0xab3b('0x1b')]===0x1f4){logger[_0xab3b('0x1a')](_0xab3b('0x15'),_0x2243aa,_0x42ac54[_0xab3b('0x1a')][_0xab3b('0x1c')]);return _0x895023(_0x42ac54['error'][_0xab3b('0x1c')]);}logger['error'](_0xab3b('0x15'),_0x2243aa,_0x42ac54[_0xab3b('0x1a')]['message']);return _0x21758d(_0x42ac54[_0xab3b('0x1a')][_0xab3b('0x1c')]);}else{logger[_0xab3b('0x14')](_0xab3b('0x15'),_0x2243aa,_0xab3b('0x16'));_0x21758d(_0x42ac54['result'][_0xab3b('0x1c')]);}})['catch'](function(_0x4b05bd){logger['error']('FaxAccount,\x20%s,\x20%s',_0x2243aa,_0x4b05bd);_0x895023(_0x4b05bd);});});}exports[_0xab3b('0x1d')]=function(_0x2dac47){var _0xf98373=this;return new Promise(function(_0x1a0356,_0x232273){return db[_0xab3b('0x1e')]['findAll']({'raw':_0x2dac47[_0xab3b('0x1f')]?_0x2dac47[_0xab3b('0x1f')][_0xab3b('0x20')]===undefined?!![]:![]:!![],'where':_0x2dac47['options']?_0x2dac47['options'][_0xab3b('0x21')]||null:null,'attributes':_0x2dac47[_0xab3b('0x1f')]?_0x2dac47[_0xab3b('0x1f')][_0xab3b('0x22')]||null:null,'limit':_0x2dac47['options']?_0x2dac47[_0xab3b('0x1f')][_0xab3b('0x23')]||null:null,'include':_0x2dac47[_0xab3b('0x1f')]?_0x2dac47[_0xab3b('0x1f')][_0xab3b('0x24')]?_[_0xab3b('0x25')](_0x2dac47[_0xab3b('0x1f')][_0xab3b('0x24')],function(_0x1f2f79){return{'model':db[_0x1f2f79['model']],'as':_0x1f2f79['as'],'attributes':_0x1f2f79[_0xab3b('0x22')],'include':_0x1f2f79[_0xab3b('0x24')]?_[_0xab3b('0x25')](_0x1f2f79[_0xab3b('0x24')],function(_0x21a61e){return{'model':db[_0x21a61e[_0xab3b('0x26')]],'as':_0x21a61e['as'],'attributes':_0x21a61e[_0xab3b('0x22')],'include':_0x21a61e[_0xab3b('0x24')]?_[_0xab3b('0x25')](_0x21a61e[_0xab3b('0x24')],function(_0x2d58a7){return{'model':db[_0x2d58a7[_0xab3b('0x26')]],'as':_0x2d58a7['as'],'attributes':_0x2d58a7[_0xab3b('0x22')]};}):[]};}):[]};}):[]:[]})[_0xab3b('0x13')](function(_0x588a8b){logger[_0xab3b('0x14')]('GetFaxAccount',_0x2dac47);logger[_0xab3b('0x17')]('GetFaxAccount',_0x2dac47,JSON['stringify'](_0x588a8b));_0x1a0356(_0x588a8b);})[_0xab3b('0x27')](function(_0x5937f9){logger[_0xab3b('0x1a')](_0xab3b('0x1d'),_0x5937f9[_0xab3b('0x1c')],_0x2dac47);_0x232273(_0xf98373[_0xab3b('0x1a')](0x1f4,_0x5937f9['message']));});});};exports[_0xab3b('0x28')]=function(_0x4619fd,_0xaa67f9,_0x8c0d65){var _0x441800=this;return new Promise(function(_0x3a4454,_0x56acc3){var _0x558094={'body':_0x4619fd['body'],'channel':'fax'};var _0x3820d8=[];var _0x1ac32f=[];var _0x54f2ca={};return db[_0xab3b('0x29')][_0xab3b('0x2a')]()[_0xab3b('0x13')](function(_0x194e4f){if(!_0x194e4f){throw new db['Sequelize'][(_0xab3b('0x2b'))](_0xab3b('0x2c'));}_0x3820d8=_['difference'](_['keys'](_0x194e4f),[_0xab3b('0x2d'),_0xab3b('0x2e')]);_0x1ac32f=_[_0xab3b('0x2f')](_['keys'](_0x194e4f),[_0xab3b('0x2d'),_0xab3b('0x2e'),_0xab3b('0x30'),_0xab3b('0x31')]);if(_0x4619fd['body']['id']){delete _0x4619fd[_0xab3b('0x32')]['id'];}if(_[_0xab3b('0x33')](_0x4619fd['body'][_0xab3b('0x34')])){throw new db[(_0xab3b('0x35'))][(_0xab3b('0x2b'))](_0xab3b('0x36'));}if(_[_0xab3b('0x33')](_0x4619fd[_0xab3b('0x32')][_0xab3b('0x32')])||_0x4619fd['body'][_0xab3b('0x32')]===''){throw new db[(_0xab3b('0x35'))]['ValidationError'](_0xab3b('0x37'));}if(_[_0xab3b('0x33')](_0x4619fd[_0xab3b('0x32')][_0xab3b('0x38')])){throw new db[(_0xab3b('0x35'))][(_0xab3b('0x2b'))](_0xab3b('0x39')+_0x1ac32f);}if(!_['includes'](_0x1ac32f,_0x4619fd[_0xab3b('0x32')][_0xab3b('0x38')])){throw new db[(_0xab3b('0x35'))][(_0xab3b('0x2b'))](_0xab3b('0x3a')+_0x1ac32f);}_0x54f2ca[_0x4619fd[_0xab3b('0x32')][_0xab3b('0x38')]]=_0x4619fd['body'][_0xab3b('0x34')];})[_0xab3b('0x13')](function(){return db[_0xab3b('0x1e')][_0xab3b('0x3b')]({'where':{'id':_0x4619fd[_0xab3b('0x3c')]['id']},'include':[{'model':db[_0xab3b('0x3d')],'as':_0xab3b('0x3e'),'include':[{'model':db[_0xab3b('0x29')],'as':_0xab3b('0x3f'),'where':_0x54f2ca,'limit':0x1,'order':[[_0xab3b('0x2e'),_0xab3b('0x40')]]}]},{'model':db[_0xab3b('0x41')],'as':_0xab3b('0x42')}]});})[_0xab3b('0x13')](function(_0x24ee69){if(_0x24ee69&&_0x24ee69[_0xab3b('0x3e')]){var _0x21d0b6=_0x24ee69[_0xab3b('0x43')]({'plain':!![]});_0x558094[_0xab3b('0x3c')]=_0x21d0b6;_0x558094[_0xab3b('0x44')]=_0x21d0b6[_0xab3b('0x42')];_0x558094[_0xab3b('0x45')]=_0x21d0b6[_0xab3b('0x3e')];_0x558094[_0xab3b('0x44')]=_['orderBy'](_0x558094[_0xab3b('0x44')],[_0xab3b('0x46')],[_0xab3b('0x47')]);if(_0x558094[_0xab3b('0x3c')]['Applications']){delete _0x558094[_0xab3b('0x3c')][_0xab3b('0x42')];}if(_0x558094[_0xab3b('0x3c')]['List']&&_0x558094['account']['List'][_0xab3b('0x3f')][_0xab3b('0x48')]){return _0x558094[_0xab3b('0x3c')]['List']['Contacts'][0x0];}var _0x11ad30=_[_0xab3b('0xd')](_0x4619fd[_0xab3b('0x32')],{'firstName':_0x4619fd[_0xab3b('0x32')][_0xab3b('0x34')],'ListId':_0x21d0b6[_0xab3b('0x31')]});_0x11ad30[_0x4619fd[_0xab3b('0x32')][_0xab3b('0x38')]]=_0x4619fd[_0xab3b('0x32')]['from'];return db[_0xab3b('0x29')]['create'](_0x11ad30,{'fields':_0x3820d8,'raw':!![]});}})['then'](function(_0x533a34){_0x558094[_0xab3b('0x49')]=_0x533a34;if(_0x533a34){var _0x5dde57={'ContactId':_0x533a34['id'],'FaxAccountId':_0x4619fd[_0xab3b('0x3c')]['id'],'fax':_0x533a34[_0xab3b('0x4a')]};return db['FaxInteraction'][_0xab3b('0x3b')]({'where':{'ContactId':_0x533a34['id'],'closed':![],'FaxAccountId':_0x4619fd[_0xab3b('0x3c')]['id']}})['then'](function(_0x4657fb){if(_0x4657fb){return[_0x4657fb,![]];}return db[_0xab3b('0x4b')][_0xab3b('0x4c')](_0x5dde57)[_0xab3b('0x13')](function(_0x345cec){return[_0x345cec,!![]];});});}else{throw new Error(_0xab3b('0x4d'));}})['spread'](function(_0x36b47e,_0x4a6e9b){var _0x281c11=_0x36b47e[_0xab3b('0x43')]({'plain':!![]});if(_0x4a6e9b){if(_0x558094[_0xab3b('0x3c')]['autoclose']){_0x558094[_0xab3b('0x44')]['push']({'id':0x0,'priority':_0x558094[_0xab3b('0x44')][_0xab3b('0x48')]+0x1,'app':_0xab3b('0x4e'),'appdata':_0xab3b('0x4f'),'interval':_0xab3b('0x50')});}_0x281c11[_0xab3b('0x51')]=!![];}else{_0x281c11[_0xab3b('0x51')]=![];}_0x558094['interaction']=_0x281c11;return db['FaxMessage'][_0xab3b('0x4c')]({'body':_0x4619fd['body'][_0xab3b('0x32')],'FaxAccountId':_0x4619fd['account']['id'],'FaxInteractionId':_0x36b47e['id'],'direction':'in','ContactId':_0x36b47e['ContactId'],'AttachmentId':_0x4619fd[_0xab3b('0x32')][_0xab3b('0x52')]});})[_0xab3b('0x13')](function(_0x5939cf){_0x558094['message']=_0x5939cf;if(_0x558094[_0xab3b('0x53')][_0xab3b('0x54')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x558094[_0xab3b('0x53')]['UserId']}})[_0xab3b('0x13')](function(_0x35157e){if(_0x35157e){_0x558094['applications'][_0xab3b('0x55')]({'id':0x0,'priority':0x0,'app':_0xab3b('0x56'),'appdata':_0x35157e[_0xab3b('0x57')]+','+(_0x558094[_0xab3b('0x3c')]['waitForTheAssignedAgent']||0xa),'interval':_0xab3b('0x50')});}return respondWithRpcPromise(_0xab3b('0x58'),_0xab3b('0x59'),_0x558094);});}return respondWithRpcPromise(_0xab3b('0x58'),_0xab3b('0x59'),_0x558094);})['then'](function(_0x4d2340){_0x3a4454(_0x4d2340);})[_0xab3b('0x27')](function(_0x26451f){_0x56acc3(_0x441800[_0xab3b('0x1a')](0x1f4,_0x26451f[_0xab3b('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 5687cb9..ea7dee9 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 _0x96e7=['removeListener','register','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x1116ac,_0xcbe059){var _0x3e806b=function(_0x33b585){while(--_0x33b585){_0x1116ac['push'](_0x1116ac['shift']());}};_0x3e806b(++_0xcbe059);}(_0x96e7,0xc4));var _0x796e=function(_0xd67723,_0x1e576f){_0xd67723=_0xd67723-0x0;var _0x53b62b=_0x96e7[_0xd67723];return _0x53b62b;};'use strict';var FaxAccountEvents=require(_0x796e('0x0'));var events=[_0x796e('0x1'),_0x796e('0x2'),_0x796e('0x3')];function createListener(_0x16f7e8,_0x828fe1){return function(_0x37a9dc){_0x828fe1['emit'](_0x16f7e8,_0x37a9dc);};}function removeListener(_0x2ff82b,_0x25da03){return function(){FaxAccountEvents[_0x796e('0x4')](_0x2ff82b,_0x25da03);};}exports[_0x796e('0x5')]=function(_0x2348ce){for(var _0x3065a0=0x0,_0x290fd9=events[_0x796e('0x6')];_0x3065a0<_0x290fd9;_0x3065a0++){var _0x4b5f3a=events[_0x3065a0];var _0x3f07fb=createListener(_0x796e('0x7')+_0x4b5f3a,_0x2348ce);FaxAccountEvents['on'](_0x4b5f3a,_0x3f07fb);}}; \ No newline at end of file +var _0xee9d=['removeListener','length','faxAccount:','./faxAccount.events','save','remove','emit'];(function(_0x5f1234,_0x4971cd){var _0x586eab=function(_0xf6a0cc){while(--_0xf6a0cc){_0x5f1234['push'](_0x5f1234['shift']());}};_0x586eab(++_0x4971cd);}(_0xee9d,0x1a7));var _0xdee9=function(_0x2999d4,_0xc3af71){_0x2999d4=_0x2999d4-0x0;var _0x70dcce=_0xee9d[_0x2999d4];return _0x70dcce;};'use strict';var FaxAccountEvents=require(_0xdee9('0x0'));var events=[_0xdee9('0x1'),_0xdee9('0x2'),'update'];function createListener(_0x2cce53,_0xe5bb22){return function(_0xaf3680){_0xe5bb22[_0xdee9('0x3')](_0x2cce53,_0xaf3680);};}function removeListener(_0x3177a6,_0x37ca71){return function(){FaxAccountEvents[_0xdee9('0x4')](_0x3177a6,_0x37ca71);};}exports['register']=function(_0x4b98c8){for(var _0x2a9371=0x0,_0x39c851=events[_0xdee9('0x5')];_0x2a9371<_0x39c851;_0x2a9371++){var _0x203de8=events[_0x2a9371];var _0x3b2595=createListener(_0xdee9('0x6')+_0x203de8,_0x4b98c8);FaxAccountEvents['on'](_0x203de8,_0x3b2595);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 99d8e89..072b1e0 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(_0x4dbb1d,_0x25b965){var _0x25977d=function(_0x10be99){while(--_0x10be99){_0x4dbb1d['push'](_0x4dbb1d['shift']());}};_0x25977d(++_0x25b965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x1dd7c7,_0x3da176){var _0x178278=function(_0x38bb0f){while(--_0x38bb0f){_0x1dd7c7['push'](_0x1dd7c7['shift']());}};_0x178278(++_0x3da176);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 1a49a75..68205b7 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 _0xc681=['exports','STRING','noop','*,*,*,*','sequelize'];(function(_0x95cd45,_0x3066fd){var _0x54b069=function(_0x4beac7){while(--_0x4beac7){_0x95cd45['push'](_0x95cd45['shift']());}};_0x54b069(++_0x3066fd);}(_0xc681,0x7c));var _0x1c68=function(_0x58885e,_0x2f0dc9){_0x58885e=_0x58885e-0x0;var _0x116138=_0xc681[_0x58885e];return _0x116138;};'use strict';var Sequelize=require(_0x1c68('0x0'));module[_0x1c68('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1c68('0x2')],'allowNull':![],'defaultValue':_0x1c68('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1c68('0x2')]},'interval':{'type':Sequelize[_0x1c68('0x2')],'defaultValue':_0x1c68('0x4')}}; \ No newline at end of file +var _0xb382=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xb382,0x18d));var _0x2b38=function(_0x2e4412,_0x57cc23){_0x2e4412=_0x2e4412-0x0;var _0x2c8f10=_0xb382[_0x2e4412];return _0x2c8f10;};'use strict';var Sequelize=require('sequelize');module[_0x2b38('0x0')]={'priority':{'type':Sequelize[_0x2b38('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x2b38('0x2')],'allowNull':![],'defaultValue':_0x2b38('0x3')},'appdata':{'type':Sequelize[_0x2b38('0x4')]()},'description':{'type':Sequelize[_0x2b38('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2b38('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index dc3dafc..46441f8 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 _0xf98e=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','then','sendStatus','stack','name','map','rawAttributes','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','FaxApplication','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0xf98e,0x1ee));var _0xef98=function(_0x18851f,_0x5e8881){_0x18851f=_0x18851f-0x0;var _0x47078c=_0xf98e[_0x18851f];return _0x47078c;};'use strict';var emlformat=require(_0xef98('0x0'));var rimraf=require(_0xef98('0x1'));var zipdir=require(_0xef98('0x2'));var jsonpatch=require(_0xef98('0x3'));var rp=require(_0xef98('0x4'));var moment=require(_0xef98('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xef98('0x6'));var path=require('path');var sox=require(_0xef98('0x7'));var csv=require(_0xef98('0x8'));var ejs=require(_0xef98('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef98('0xa'));var squel=require(_0xef98('0xb'));var crypto=require(_0xef98('0xc'));var jsforce=require(_0xef98('0xd'));var deskjs=require(_0xef98('0xe'));var toCsv=require(_0xef98('0x8'));var querystring=require('querystring');var Papa=require(_0xef98('0xf'));var Redis=require(_0xef98('0x10'));var authService=require(_0xef98('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xef98('0x12'));var hardwareService=require(_0xef98('0x13'));var logger=require(_0xef98('0x14'))(_0xef98('0x15'));var utils=require('../../config/utils');var config=require(_0xef98('0x16'));var licenseUtil=require(_0xef98('0x17'));var db=require(_0xef98('0x18'))['db'];function respondWithStatusCode(_0x5808cb,_0x44de95){_0x44de95=_0x44de95||0xcc;return function(_0x3a84c0){if(_0x3a84c0){return _0x5808cb['sendStatus'](_0x44de95);}return _0x5808cb['status'](_0x44de95)[_0xef98('0x19')]();};}function respondWithResult(_0x3f93e0,_0x5d6f9c){_0x5d6f9c=_0x5d6f9c||0xc8;return function(_0x1fa7b4){if(_0x1fa7b4){return _0x3f93e0['status'](_0x5d6f9c)[_0xef98('0x1a')](_0x1fa7b4);}};}function respondWithFilteredResult(_0x35bcb1,_0x304c01){return function(_0x8599f7){if(_0x8599f7){var _0x3d5035=typeof _0x304c01['offset']===_0xef98('0x1b')&&typeof _0x304c01[_0xef98('0x1c')]===_0xef98('0x1b');var _0xf28a74=_0x8599f7[_0xef98('0x1d')];var _0x72f8a9=_0x3d5035?0x0:_0x304c01[_0xef98('0x1e')];var _0x3d2d5d=_0x3d5035?_0x8599f7[_0xef98('0x1d')]:_0x304c01[_0xef98('0x1e')]+_0x304c01[_0xef98('0x1c')];var _0xfdd086;if(_0x3d2d5d>=_0xf28a74){_0x3d2d5d=_0xf28a74;_0xfdd086=0xc8;}else{_0xfdd086=0xce;}_0x35bcb1[_0xef98('0x1f')](_0xfdd086);return _0x35bcb1[_0xef98('0x20')](_0xef98('0x21'),_0x72f8a9+'-'+_0x3d2d5d+'/'+_0xf28a74)[_0xef98('0x1a')](_0x8599f7);}return null;};}function patchUpdates(_0x1b7eda){return function(_0x300efb){try{jsonpatch[_0xef98('0x22')](_0x300efb,_0x1b7eda,!![]);}catch(_0x59849d){return BPromise[_0xef98('0x23')](_0x59849d);}return _0x300efb['save']();};}function saveUpdates(_0xf1c3bb,_0x4b01ee){return function(_0x1b32bc){if(_0x1b32bc){return _0x1b32bc['update'](_0xf1c3bb)['then'](function(_0x5848fe){return _0x5848fe;});}return null;};}function removeEntity(_0x5242d3,_0x13119d){return function(_0x229de6){if(_0x229de6){return _0x229de6['destroy']()[_0xef98('0x24')](function(){_0x5242d3[_0xef98('0x1f')](0xcc)[_0xef98('0x19')]();});}};}function handleEntityNotFound(_0x13de60,_0x37a849){return function(_0x4fa941){if(!_0x4fa941){_0x13de60[_0xef98('0x25')](0x194);}return _0x4fa941;};}function handleError(_0x452df6,_0x2ff4c6){_0x2ff4c6=_0x2ff4c6||0x1f4;return function(_0x5b4841){logger['error'](_0x5b4841[_0xef98('0x26')]);if(_0x5b4841[_0xef98('0x27')]){delete _0x5b4841['name'];}_0x452df6[_0xef98('0x1f')](_0x2ff4c6)['send'](_0x5b4841);};}exports['index']=function(_0x39c2f6,_0x17e93b){var _0x2d29ad={},_0x270a9c={},_0x3310f8={'count':0x0,'rows':[]};var _0x379074=_[_0xef98('0x28')](db['FaxApplication'][_0xef98('0x29')],function(_0xb2e62b){return{'name':_0xb2e62b['fieldName'],'type':_0xb2e62b['type']['key']};});_0x270a9c[_0xef98('0x2a')]=_[_0xef98('0x28')](_0x379074,_0xef98('0x27'));_0x270a9c[_0xef98('0x2b')]=_['keys'](_0x39c2f6[_0xef98('0x2b')]);_0x270a9c[_0xef98('0x2c')]=_['intersection'](_0x270a9c[_0xef98('0x2a')],_0x270a9c['query']);_0x2d29ad['attributes']=_[_0xef98('0x2d')](_0x270a9c[_0xef98('0x2a')],qs['fields'](_0x39c2f6[_0xef98('0x2b')][_0xef98('0x2e')]));_0x2d29ad['attributes']=_0x2d29ad[_0xef98('0x2f')]['length']?_0x2d29ad[_0xef98('0x2f')]:_0x270a9c['model'];if(!_0x39c2f6[_0xef98('0x2b')][_0xef98('0x30')](_0xef98('0x31'))){_0x2d29ad[_0xef98('0x1c')]=qs['limit'](_0x39c2f6[_0xef98('0x2b')][_0xef98('0x1c')]);_0x2d29ad['offset']=qs[_0xef98('0x1e')](_0x39c2f6['query']['offset']);}_0x2d29ad[_0xef98('0x32')]=qs[_0xef98('0x33')](_0x39c2f6['query'][_0xef98('0x33')]);_0x2d29ad[_0xef98('0x34')]=qs['filters'](_['pick'](_0x39c2f6[_0xef98('0x2b')],_0x270a9c[_0xef98('0x2c')]),_0x379074);if(_0x39c2f6[_0xef98('0x2b')][_0xef98('0x35')]){_0x2d29ad[_0xef98('0x34')]=_['merge'](_0x2d29ad[_0xef98('0x34')],{'$or':_[_0xef98('0x28')](_0x379074,function(_0x4bcd16){if(_0x4bcd16[_0xef98('0x36')]!==_0xef98('0x37')){var _0x38a6b9={};_0x38a6b9[_0x4bcd16[_0xef98('0x27')]]={'$like':'%'+_0x39c2f6[_0xef98('0x2b')][_0xef98('0x35')]+'%'};return _0x38a6b9;}})});}_0x2d29ad=_[_0xef98('0x38')]({},_0x2d29ad,_0x39c2f6[_0xef98('0x39')]);var _0x4137fb={'where':_0x2d29ad[_0xef98('0x34')]};return db[_0xef98('0x3a')][_0xef98('0x1d')](_0x4137fb)[_0xef98('0x24')](function(_0x3a8f8f){_0x3310f8['count']=_0x3a8f8f;if(_0x39c2f6[_0xef98('0x2b')][_0xef98('0x3b')]){_0x2d29ad[_0xef98('0x3c')]=[{'all':!![]}];}return db[_0xef98('0x3a')][_0xef98('0x3d')](_0x2d29ad);})[_0xef98('0x24')](function(_0xbabc65){_0x3310f8[_0xef98('0x3e')]=_0xbabc65;return _0x3310f8;})[_0xef98('0x24')](respondWithFilteredResult(_0x17e93b,_0x2d29ad))[_0xef98('0x3f')](handleError(_0x17e93b,null));};exports[_0xef98('0x40')]=function(_0x476f1b,_0x47fe89){var _0x2c560c={'raw':!![],'where':{'id':_0x476f1b[_0xef98('0x41')]['id']}},_0x2a226e={};_0x2a226e[_0xef98('0x2a')]=_[_0xef98('0x42')](db[_0xef98('0x3a')][_0xef98('0x29')]);_0x2a226e[_0xef98('0x2b')]=_[_0xef98('0x42')](_0x476f1b[_0xef98('0x2b')]);_0x2a226e[_0xef98('0x2c')]=_['intersection'](_0x2a226e[_0xef98('0x2a')],_0x2a226e[_0xef98('0x2b')]);_0x2c560c[_0xef98('0x2f')]=_[_0xef98('0x2d')](_0x2a226e[_0xef98('0x2a')],qs[_0xef98('0x2e')](_0x476f1b[_0xef98('0x2b')][_0xef98('0x2e')]));_0x2c560c[_0xef98('0x2f')]=_0x2c560c['attributes'][_0xef98('0x43')]?_0x2c560c['attributes']:_0x2a226e['model'];if(_0x476f1b[_0xef98('0x2b')][_0xef98('0x3b')]){_0x2c560c['include']=[{'all':!![]}];}_0x2c560c=_[_0xef98('0x38')]({},_0x2c560c,_0x476f1b[_0xef98('0x39')]);return db[_0xef98('0x3a')][_0xef98('0x44')](_0x2c560c)[_0xef98('0x24')](handleEntityNotFound(_0x47fe89,null))[_0xef98('0x24')](respondWithResult(_0x47fe89,null))[_0xef98('0x3f')](handleError(_0x47fe89,null));};exports[_0xef98('0x45')]=function(_0xf53ce5,_0xe9aebf){return db[_0xef98('0x3a')][_0xef98('0x45')](_0xf53ce5[_0xef98('0x46')],{})[_0xef98('0x24')](respondWithResult(_0xe9aebf,0xc9))[_0xef98('0x3f')](handleError(_0xe9aebf,null));};exports[_0xef98('0x47')]=function(_0x385c29,_0x3c1fc5){if(_0x385c29[_0xef98('0x46')]['id']){delete _0x385c29[_0xef98('0x46')]['id'];}return db[_0xef98('0x3a')][_0xef98('0x44')]({'where':{'id':_0x385c29[_0xef98('0x41')]['id']}})['then'](handleEntityNotFound(_0x3c1fc5,null))[_0xef98('0x24')](saveUpdates(_0x385c29[_0xef98('0x46')],null))[_0xef98('0x24')](respondWithResult(_0x3c1fc5,null))['catch'](handleError(_0x3c1fc5,null));};exports[_0xef98('0x48')]=function(_0x148ed2,_0x9eff12){return db[_0xef98('0x3a')][_0xef98('0x44')]({'where':{'id':_0x148ed2[_0xef98('0x41')]['id']}})['then'](handleEntityNotFound(_0x9eff12,null))['then'](removeEntity(_0x9eff12,null))[_0xef98('0x3f')](handleError(_0x9eff12,null));}; \ No newline at end of file +var _0x3d30=['merge','VIRTUAL','filter','FaxApplication','include','rows','params','includeAll','options','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','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','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','error','name','send','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x535219,_0x39c1f9){var _0x106b56=function(_0x20e66e){while(--_0x20e66e){_0x535219['push'](_0x535219['shift']());}};_0x106b56(++_0x39c1f9);}(_0x3d30,0x184));var _0x03d3=function(_0x1b8ccb,_0x1f4fa5){_0x1b8ccb=_0x1b8ccb-0x0;var _0x5c191e=_0x3d30[_0x1b8ccb];return _0x5c191e;};'use strict';var emlformat=require(_0x03d3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03d3('0x1'));var jsonpatch=require(_0x03d3('0x2'));var rp=require(_0x03d3('0x3'));var moment=require('moment');var BPromise=require(_0x03d3('0x4'));var Mustache=require(_0x03d3('0x5'));var util=require(_0x03d3('0x6'));var path=require(_0x03d3('0x7'));var sox=require('sox');var csv=require(_0x03d3('0x8'));var ejs=require(_0x03d3('0x9'));var fs=require('fs');var fs_extra=require(_0x03d3('0xa'));var _=require('lodash');var squel=require(_0x03d3('0xb'));var crypto=require(_0x03d3('0xc'));var jsforce=require(_0x03d3('0xd'));var deskjs=require(_0x03d3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x03d3('0xf'));var Papa=require(_0x03d3('0x10'));var Redis=require(_0x03d3('0x11'));var authService=require(_0x03d3('0x12'));var qs=require(_0x03d3('0x13'));var as=require(_0x03d3('0x14'));var hardwareService=require(_0x03d3('0x15'));var logger=require(_0x03d3('0x16'))(_0x03d3('0x17'));var utils=require('../../config/utils');var config=require(_0x03d3('0x18'));var licenseUtil=require(_0x03d3('0x19'));var db=require(_0x03d3('0x1a'))['db'];function respondWithStatusCode(_0x29e9d0,_0x2c9cd0){_0x2c9cd0=_0x2c9cd0||0xcc;return function(_0x30bea8){if(_0x30bea8){return _0x29e9d0[_0x03d3('0x1b')](_0x2c9cd0);}return _0x29e9d0[_0x03d3('0x1c')](_0x2c9cd0)[_0x03d3('0x1d')]();};}function respondWithResult(_0x41c9ea,_0x2806ec){_0x2806ec=_0x2806ec||0xc8;return function(_0x409d6d){if(_0x409d6d){return _0x41c9ea['status'](_0x2806ec)['json'](_0x409d6d);}};}function respondWithFilteredResult(_0x31f6dc,_0x124198){return function(_0x2ed787){if(_0x2ed787){var _0x32458b=typeof _0x124198['offset']===_0x03d3('0x1e')&&typeof _0x124198[_0x03d3('0x1f')]===_0x03d3('0x1e');var _0xd8eb8c=_0x2ed787[_0x03d3('0x20')];var _0x5d70ce=_0x32458b?0x0:_0x124198['offset'];var _0x10a3d3=_0x32458b?_0x2ed787[_0x03d3('0x20')]:_0x124198[_0x03d3('0x21')]+_0x124198[_0x03d3('0x1f')];var _0x36c4cf;if(_0x10a3d3>=_0xd8eb8c){_0x10a3d3=_0xd8eb8c;_0x36c4cf=0xc8;}else{_0x36c4cf=0xce;}_0x31f6dc['status'](_0x36c4cf);return _0x31f6dc[_0x03d3('0x22')]('Content-Range',_0x5d70ce+'-'+_0x10a3d3+'/'+_0xd8eb8c)[_0x03d3('0x23')](_0x2ed787);}return null;};}function patchUpdates(_0x11fe54){return function(_0x44f670){try{jsonpatch[_0x03d3('0x24')](_0x44f670,_0x11fe54,!![]);}catch(_0x486439){return BPromise[_0x03d3('0x25')](_0x486439);}return _0x44f670[_0x03d3('0x26')]();};}function saveUpdates(_0xac1e10,_0x1270e5){return function(_0x577c1c){if(_0x577c1c){return _0x577c1c[_0x03d3('0x27')](_0xac1e10)[_0x03d3('0x28')](function(_0x504db0){return _0x504db0;});}return null;};}function removeEntity(_0x4b9561,_0x2080ca){return function(_0x1c973c){if(_0x1c973c){return _0x1c973c[_0x03d3('0x29')]()['then'](function(){_0x4b9561[_0x03d3('0x1c')](0xcc)[_0x03d3('0x1d')]();});}};}function handleEntityNotFound(_0x333a49,_0x50ccc5){return function(_0x5b1a22){if(!_0x5b1a22){_0x333a49[_0x03d3('0x1b')](0x194);}return _0x5b1a22;};}function handleError(_0x1a543a,_0x511e57){_0x511e57=_0x511e57||0x1f4;return function(_0x4dfa68){logger[_0x03d3('0x2a')](_0x4dfa68['stack']);if(_0x4dfa68[_0x03d3('0x2b')]){delete _0x4dfa68[_0x03d3('0x2b')];}_0x1a543a[_0x03d3('0x1c')](_0x511e57)[_0x03d3('0x2c')](_0x4dfa68);};}exports['index']=function(_0x5e50af,_0x4bb7b2){var _0x585812={},_0x178f33={},_0x1ccbd5={'count':0x0,'rows':[]};var _0x434fc3=_['map'](db['FaxApplication'][_0x03d3('0x2d')],function(_0x5b9105){return{'name':_0x5b9105['fieldName'],'type':_0x5b9105[_0x03d3('0x2e')][_0x03d3('0x2f')]};});_0x178f33[_0x03d3('0x30')]=_[_0x03d3('0x31')](_0x434fc3,_0x03d3('0x2b'));_0x178f33[_0x03d3('0x32')]=_[_0x03d3('0x33')](_0x5e50af['query']);_0x178f33[_0x03d3('0x34')]=_[_0x03d3('0x35')](_0x178f33[_0x03d3('0x30')],_0x178f33['query']);_0x585812[_0x03d3('0x36')]=_['intersection'](_0x178f33[_0x03d3('0x30')],qs[_0x03d3('0x37')](_0x5e50af[_0x03d3('0x32')][_0x03d3('0x37')]));_0x585812['attributes']=_0x585812[_0x03d3('0x36')]['length']?_0x585812['attributes']:_0x178f33[_0x03d3('0x30')];if(!_0x5e50af['query'][_0x03d3('0x38')](_0x03d3('0x39'))){_0x585812[_0x03d3('0x1f')]=qs[_0x03d3('0x1f')](_0x5e50af[_0x03d3('0x32')]['limit']);_0x585812[_0x03d3('0x21')]=qs[_0x03d3('0x21')](_0x5e50af[_0x03d3('0x32')]['offset']);}_0x585812[_0x03d3('0x3a')]=qs[_0x03d3('0x3b')](_0x5e50af[_0x03d3('0x32')][_0x03d3('0x3b')]);_0x585812[_0x03d3('0x3c')]=qs['filters'](_[_0x03d3('0x3d')](_0x5e50af[_0x03d3('0x32')],_0x178f33[_0x03d3('0x34')]),_0x434fc3);if(_0x5e50af[_0x03d3('0x32')]['filter']){_0x585812[_0x03d3('0x3c')]=_[_0x03d3('0x3e')](_0x585812[_0x03d3('0x3c')],{'$or':_[_0x03d3('0x31')](_0x434fc3,function(_0x5eee78){if(_0x5eee78[_0x03d3('0x2e')]!==_0x03d3('0x3f')){var _0x355da3={};_0x355da3[_0x5eee78[_0x03d3('0x2b')]]={'$like':'%'+_0x5e50af['query'][_0x03d3('0x40')]+'%'};return _0x355da3;}})});}_0x585812=_[_0x03d3('0x3e')]({},_0x585812,_0x5e50af['options']);var _0x1e9858={'where':_0x585812[_0x03d3('0x3c')]};return db[_0x03d3('0x41')][_0x03d3('0x20')](_0x1e9858)['then'](function(_0x2a60ea){_0x1ccbd5[_0x03d3('0x20')]=_0x2a60ea;if(_0x5e50af[_0x03d3('0x32')]['includeAll']){_0x585812[_0x03d3('0x42')]=[{'all':!![]}];}return db[_0x03d3('0x41')]['findAll'](_0x585812);})[_0x03d3('0x28')](function(_0x3c0394){_0x1ccbd5[_0x03d3('0x43')]=_0x3c0394;return _0x1ccbd5;})['then'](respondWithFilteredResult(_0x4bb7b2,_0x585812))['catch'](handleError(_0x4bb7b2,null));};exports['show']=function(_0x16a6fc,_0x255fb5){var _0x2de90c={'raw':!![],'where':{'id':_0x16a6fc[_0x03d3('0x44')]['id']}},_0x5c824f={};_0x5c824f[_0x03d3('0x30')]=_[_0x03d3('0x33')](db['FaxApplication']['rawAttributes']);_0x5c824f[_0x03d3('0x32')]=_[_0x03d3('0x33')](_0x16a6fc[_0x03d3('0x32')]);_0x5c824f[_0x03d3('0x34')]=_['intersection'](_0x5c824f[_0x03d3('0x30')],_0x5c824f[_0x03d3('0x32')]);_0x2de90c['attributes']=_[_0x03d3('0x35')](_0x5c824f['model'],qs[_0x03d3('0x37')](_0x16a6fc[_0x03d3('0x32')]['fields']));_0x2de90c[_0x03d3('0x36')]=_0x2de90c[_0x03d3('0x36')]['length']?_0x2de90c[_0x03d3('0x36')]:_0x5c824f[_0x03d3('0x30')];if(_0x16a6fc[_0x03d3('0x32')][_0x03d3('0x45')]){_0x2de90c[_0x03d3('0x42')]=[{'all':!![]}];}_0x2de90c=_[_0x03d3('0x3e')]({},_0x2de90c,_0x16a6fc[_0x03d3('0x46')]);return db[_0x03d3('0x41')][_0x03d3('0x47')](_0x2de90c)[_0x03d3('0x28')](handleEntityNotFound(_0x255fb5,null))['then'](respondWithResult(_0x255fb5,null))[_0x03d3('0x48')](handleError(_0x255fb5,null));};exports[_0x03d3('0x49')]=function(_0x5cc475,_0x3192ea){return db[_0x03d3('0x41')][_0x03d3('0x49')](_0x5cc475['body'],{})[_0x03d3('0x28')](respondWithResult(_0x3192ea,0xc9))[_0x03d3('0x48')](handleError(_0x3192ea,null));};exports[_0x03d3('0x27')]=function(_0x3d3367,_0x514234){if(_0x3d3367['body']['id']){delete _0x3d3367[_0x03d3('0x4a')]['id'];}return db[_0x03d3('0x41')]['find']({'where':{'id':_0x3d3367[_0x03d3('0x44')]['id']}})[_0x03d3('0x28')](handleEntityNotFound(_0x514234,null))['then'](saveUpdates(_0x3d3367[_0x03d3('0x4a')],null))[_0x03d3('0x28')](respondWithResult(_0x514234,null))['catch'](handleError(_0x514234,null));};exports[_0x03d3('0x29')]=function(_0x3612c2,_0x177c18){return db[_0x03d3('0x41')][_0x03d3('0x47')]({'where':{'id':_0x3612c2[_0x03d3('0x44')]['id']}})[_0x03d3('0x28')](handleEntityNotFound(_0x177c18,null))[_0x03d3('0x28')](removeEntity(_0x177c18,null))[_0x03d3('0x48')](handleError(_0x177c18,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 9e5c0b3..e20156a 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 _0xf15e=['exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','./faxApplication.attributes'];(function(_0x50f1cd,_0x22a59d){var _0x1ce9e9=function(_0x25f1e4){while(--_0x25f1e4){_0x50f1cd['push'](_0x50f1cd['shift']());}};_0x1ce9e9(++_0x22a59d);}(_0xf15e,0x1bc));var _0xef15=function(_0x49b3a4,_0x578ace){_0x49b3a4=_0x49b3a4-0x0;var _0xbd4de3=_0xf15e[_0x49b3a4];return _0xbd4de3;};'use strict';var _=require(_0xef15('0x0'));var util=require('util');var logger=require(_0xef15('0x1'))('api');var moment=require(_0xef15('0x2'));var BPromise=require(_0xef15('0x3'));var rp=require(_0xef15('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef15('0x5'));var config=require('../../config/environment');var attributes=require(_0xef15('0x6'));module[_0xef15('0x7')]=function(_0x390e3d,_0x594a00){return _0x390e3d[_0xef15('0x8')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xef15('0x9'),'collate':_0xef15('0xa')});}; \ No newline at end of file +var _0xdd74=['bluebird','request-promise','path','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment'];(function(_0x1bd2a8,_0x820b5b){var _0xf58f4d=function(_0x66da9e){while(--_0x66da9e){_0x1bd2a8['push'](_0x1bd2a8['shift']());}};_0xf58f4d(++_0x820b5b);}(_0xdd74,0x99));var _0x4dd7=function(_0x35e69a,_0xd8f0ed){_0x35e69a=_0x35e69a-0x0;var _0x4efaac=_0xdd74[_0x35e69a];return _0x4efaac;};'use strict';var _=require(_0x4dd7('0x0'));var util=require(_0x4dd7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4dd7('0x2'));var BPromise=require(_0x4dd7('0x3'));var rp=require(_0x4dd7('0x4'));var fs=require('fs');var path=require(_0x4dd7('0x5'));var rimraf=require('rimraf');var config=require(_0x4dd7('0x6'));var attributes=require(_0x4dd7('0x7'));module['exports']=function(_0x28397a,_0x4f4ff4){return _0x28397a[_0x4dd7('0x8')](_0x4dd7('0x9'),attributes,{'tableName':_0x4dd7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4dd7('0xb'),'collate':_0x4dd7('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index ed26fcb..a6ba4ae 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 _0xf066=['jayson/promise','client','http','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateFaxApplication','update','body','options','raw','where','attributes','limit','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x6c419a,_0x39db56){var _0x587580=function(_0x399913){while(--_0x399913){_0x6c419a['push'](_0x6c419a['shift']());}};_0x587580(++_0x39db56);}(_0xf066,0x1a4));var _0x6f06=function(_0x4aaff3,_0x18b012){_0x4aaff3=_0x4aaff3-0x0;var _0x3a20f3=_0xf066[_0x4aaff3];return _0x3a20f3;};'use strict';var _=require('lodash');var util=require(_0x6f06('0x0'));var moment=require(_0x6f06('0x1'));var BPromise=require(_0x6f06('0x2'));var rs=require(_0x6f06('0x3'));var fs=require('fs');var Redis=require(_0x6f06('0x4'));var db=require(_0x6f06('0x5'))['db'];var utils=require(_0x6f06('0x6'));var logger=require(_0x6f06('0x7'))('rpc');var config=require(_0x6f06('0x8'));var jayson=require(_0x6f06('0x9'));var client=jayson[_0x6f06('0xa')][_0x6f06('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1452d4,_0x58db89,_0x280442){return new BPromise(function(_0x2e49e6,_0x52a196){return client[_0x6f06('0xc')](_0x1452d4,_0x280442)[_0x6f06('0xd')](function(_0x1d765d){logger['info'](_0x6f06('0xe'),_0x58db89,_0x6f06('0xf'));logger['debug'](_0x6f06('0x10'),_0x58db89,'request\x20sent',JSON[_0x6f06('0x11')](_0x1d765d));if(_0x1d765d[_0x6f06('0x12')]){if(_0x1d765d['error'][_0x6f06('0x13')]===0x1f4){logger[_0x6f06('0x12')](_0x6f06('0xe'),_0x58db89,_0x1d765d[_0x6f06('0x12')][_0x6f06('0x14')]);return _0x52a196(_0x1d765d[_0x6f06('0x12')]['message']);}logger[_0x6f06('0x12')](_0x6f06('0xe'),_0x58db89,_0x1d765d[_0x6f06('0x12')]['message']);return _0x2e49e6(_0x1d765d[_0x6f06('0x12')][_0x6f06('0x14')]);}else{logger[_0x6f06('0x15')](_0x6f06('0xe'),_0x58db89,_0x6f06('0xf'));_0x2e49e6(_0x1d765d[_0x6f06('0x16')][_0x6f06('0x14')]);}})[_0x6f06('0x17')](function(_0x15c311){logger['error'](_0x6f06('0xe'),_0x58db89,_0x15c311);_0x52a196(_0x15c311);});});}exports[_0x6f06('0x18')]=function(_0x2da046){var _0x529a49=this;return new Promise(function(_0x3df5e5,_0x438d9a){return db['FaxApplication'][_0x6f06('0x19')](_0x2da046[_0x6f06('0x1a')],{'raw':_0x2da046[_0x6f06('0x1b')]?_0x2da046[_0x6f06('0x1b')][_0x6f06('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2da046['options']?_0x2da046[_0x6f06('0x1b')][_0x6f06('0x1d')]||null:null,'attributes':_0x2da046['options']?_0x2da046[_0x6f06('0x1b')][_0x6f06('0x1e')]||null:null,'limit':_0x2da046[_0x6f06('0x1b')]?_0x2da046[_0x6f06('0x1b')][_0x6f06('0x1f')]||null:null})[_0x6f06('0xd')](function(_0x418648){logger['info'](_0x6f06('0x18'),_0x2da046);logger[_0x6f06('0x20')](_0x6f06('0x18'),_0x2da046,JSON['stringify'](_0x418648));_0x3df5e5(_0x418648);})[_0x6f06('0x17')](function(_0x4ff586){logger[_0x6f06('0x12')](_0x6f06('0x18'),_0x4ff586[_0x6f06('0x14')],_0x2da046);_0x438d9a(_0x529a49[_0x6f06('0x12')](0x1f4,_0x4ff586[_0x6f06('0x14')]));});});}; \ No newline at end of file +var _0x20ad=['raw','where','limit','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','UpdateFaxApplication','body','options'];(function(_0x3d0c2d,_0x1d4e90){var _0x17f308=function(_0x2d2701){while(--_0x2d2701){_0x3d0c2d['push'](_0x3d0c2d['shift']());}};_0x17f308(++_0x1d4e90);}(_0x20ad,0x13a));var _0xd20a=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x20ad[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xd20a('0x0'));var util=require(_0xd20a('0x1'));var moment=require(_0xd20a('0x2'));var BPromise=require(_0xd20a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd20a('0x4'));var db=require(_0xd20a('0x5'))['db'];var utils=require(_0xd20a('0x6'));var logger=require(_0xd20a('0x7'))(_0xd20a('0x8'));var config=require(_0xd20a('0x9'));var jayson=require(_0xd20a('0xa'));var client=jayson[_0xd20a('0xb')][_0xd20a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x58f33b,_0x18ca5c,_0xf47652){return new BPromise(function(_0x4c56a0,_0x2a5a70){return client[_0xd20a('0xd')](_0x58f33b,_0xf47652)[_0xd20a('0xe')](function(_0x2c418a){logger[_0xd20a('0xf')](_0xd20a('0x10'),_0x18ca5c,_0xd20a('0x11'));logger[_0xd20a('0x12')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x18ca5c,_0xd20a('0x11'),JSON['stringify'](_0x2c418a));if(_0x2c418a[_0xd20a('0x13')]){if(_0x2c418a['error'][_0xd20a('0x14')]===0x1f4){logger[_0xd20a('0x13')](_0xd20a('0x10'),_0x18ca5c,_0x2c418a[_0xd20a('0x13')][_0xd20a('0x15')]);return _0x2a5a70(_0x2c418a[_0xd20a('0x13')][_0xd20a('0x15')]);}logger[_0xd20a('0x13')]('FaxApplication,\x20%s,\x20%s',_0x18ca5c,_0x2c418a[_0xd20a('0x13')][_0xd20a('0x15')]);return _0x4c56a0(_0x2c418a[_0xd20a('0x13')]['message']);}else{logger[_0xd20a('0xf')](_0xd20a('0x10'),_0x18ca5c,_0xd20a('0x11'));_0x4c56a0(_0x2c418a[_0xd20a('0x16')]['message']);}})[_0xd20a('0x17')](function(_0x5ad81b){logger['error'](_0xd20a('0x10'),_0x18ca5c,_0x5ad81b);_0x2a5a70(_0x5ad81b);});});}exports[_0xd20a('0x18')]=function(_0x4c1dd4){var _0x5677c4=this;return new Promise(function(_0x7a0268,_0x569ba5){return db['FaxApplication']['update'](_0x4c1dd4[_0xd20a('0x19')],{'raw':_0x4c1dd4['options']?_0x4c1dd4[_0xd20a('0x1a')][_0xd20a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c1dd4[_0xd20a('0x1a')]?_0x4c1dd4[_0xd20a('0x1a')][_0xd20a('0x1c')]||null:null,'attributes':_0x4c1dd4['options']?_0x4c1dd4[_0xd20a('0x1a')]['attributes']||null:null,'limit':_0x4c1dd4[_0xd20a('0x1a')]?_0x4c1dd4[_0xd20a('0x1a')][_0xd20a('0x1d')]||null:null})[_0xd20a('0xe')](function(_0x458b4a){logger[_0xd20a('0xf')]('UpdateFaxApplication',_0x4c1dd4);logger['debug']('UpdateFaxApplication',_0x4c1dd4,JSON[_0xd20a('0x1e')](_0x458b4a));_0x7a0268(_0x458b4a);})[_0xd20a('0x17')](function(_0x140b84){logger[_0xd20a('0x13')](_0xd20a('0x18'),_0x140b84['message'],_0x4c1dd4);_0x569ba5(_0x5677c4[_0xd20a('0x13')](0x1f4,_0x140b84[_0xd20a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 0b86be2..ed61271 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 _0x7916=['/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','isAuthenticated','index'];(function(_0x48bc0d,_0x30becd){var _0x35f641=function(_0x136926){while(--_0x136926){_0x48bc0d['push'](_0x48bc0d['shift']());}};_0x35f641(++_0x30becd);}(_0x7916,0x128));var _0x6791=function(_0x11934c,_0x56d052){_0x11934c=_0x11934c-0x0;var _0x2013d3=_0x7916[_0x11934c];return _0x2013d3;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var fs_extra=require(_0x6791('0x4'));var auth=require(_0x6791('0x5'));var interaction=require(_0x6791('0x6'));var config=require('../../config/environment');var controller=require(_0x6791('0x7'));router['get']('/',auth[_0x6791('0x8')](),controller[_0x6791('0x9')]);router['get'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6791('0xc')]);router[_0x6791('0xd')]('/:id',auth[_0x6791('0x8')](),controller[_0x6791('0xe')]);router[_0x6791('0xf')]('/:id',auth[_0x6791('0x8')](),controller[_0x6791('0x10')]);module[_0x6791('0x11')]=router; \ No newline at end of file +var _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','get','show','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0xad0646,_0x3793b5){var _0x12e0c4=function(_0x4fa262){while(--_0x4fa262){_0xad0646['push'](_0xad0646['shift']());}};_0x12e0c4(++_0x3793b5);}(_0xac4a,0x13f));var _0xaac4=function(_0x12ba6c,_0x490fc4){_0x12ba6c=_0x12ba6c-0x0;var _0x5c9137=_0xac4a[_0x12ba6c];return _0x5c9137;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router['put'](_0xaac4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaac4('0xe')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 9bbc8e0..bde0711 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 _0xab32=['DATE','STRING','out','BOOLEAN'];(function(_0x525c20,_0x53dc33){var _0x4c2241=function(_0x428325){while(--_0x428325){_0x525c20['push'](_0x525c20['shift']());}};_0x4c2241(++_0x53dc33);}(_0xab32,0xe7));var _0x2ab3=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0xab32[_0x3fe6df];return _0x372a0e;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x2ab3('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2ab3('0x1')]},'disposition':{'type':Sequelize[_0x2ab3('0x2')]},'secondDisposition':{'type':Sequelize[_0x2ab3('0x2')]},'thirdDisposition':{'type':Sequelize[_0x2ab3('0x2')]},'note':{'type':Sequelize[_0x2ab3('0x2')]},'read1stAt':{'type':Sequelize[_0x2ab3('0x1')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2ab3('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2ab3('0x3')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x6ef6=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x3c3baa,_0x562321){var _0x423e8b=function(_0x224afd){while(--_0x224afd){_0x3c3baa['push'](_0x3c3baa['shift']());}};_0x423e8b(++_0x562321);}(_0x6ef6,0x97));var _0x66ef=function(_0x2a2499,_0x42643c){_0x2a2499=_0x2a2499-0x0;var _0x4b4951=_0x6ef6[_0x2a2499];return _0x4b4951;};'use strict';var Sequelize=require(_0x66ef('0x0'));module[_0x66ef('0x1')]={'closed':{'type':Sequelize[_0x66ef('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x66ef('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x66ef('0x4')]},'thirdDisposition':{'type':Sequelize[_0x66ef('0x4')]},'note':{'type':Sequelize[_0x66ef('0x4')]},'read1stAt':{'type':Sequelize[_0x66ef('0x3')]},'fax':{'type':Sequelize[_0x66ef('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x66ef('0x5')]('in',_0x66ef('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x66ef('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x66ef('0x5')]('in',_0x66ef('0x6')),'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 42c5dd0..d972d93 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 _0xa618=['push','all','rows','show','includeAll','include','options','create','body','params','describe','addMessage','ids','getMessages','findOne','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','findAll','addTags','setTags','emit','removeTags','download','join','root','server','files','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','existsSync','createReadStream','createWriteStream','basename','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./faxInteraction.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','reject','update','then','destroy','name','send','Users','map','TagIds','Tags','split','catch','FaxInteraction','rawAttributes','fieldName','key','query','model','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','cm_contacts','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','having','operator','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','start','keys','some','compact','isEmpty','forEach','FaxAccountId','i.FaxAccountId\x20IN\x20?','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','c.firstName','c.lastName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','FaxInteractionId'];(function(_0xfc0fa4,_0x5914e9){var _0x87051b=function(_0x5bdc70){while(--_0x5bdc70){_0xfc0fa4['push'](_0xfc0fa4['shift']());}};_0x87051b(++_0x5914e9);}(_0xa618,0xf0));var _0x8a61=function(_0x36e149,_0x21b4f9){_0x36e149=_0x36e149-0x0;var _0x4b1cc3=_0xa618[_0x36e149];return _0x4b1cc3;};'use strict';var emlformat=require(_0x8a61('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a61('0x1'));var jsonpatch=require(_0x8a61('0x2'));var rp=require(_0x8a61('0x3'));var moment=require(_0x8a61('0x4'));var BPromise=require(_0x8a61('0x5'));var Mustache=require('mustache');var util=require(_0x8a61('0x6'));var path=require(_0x8a61('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8a61('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8a61('0x9'));var squel=require(_0x8a61('0xa'));var crypto=require('crypto');var jsforce=require(_0x8a61('0xb'));var deskjs=require(_0x8a61('0xc'));var toCsv=require(_0x8a61('0xd'));var querystring=require(_0x8a61('0xe'));var Papa=require(_0x8a61('0xf'));var Redis=require(_0x8a61('0x10'));var authService=require(_0x8a61('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8a61('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a61('0x13'))('api');var utils=require(_0x8a61('0x14'));var config=require(_0x8a61('0x15'));var licenseUtil=require(_0x8a61('0x16'));var db=require(_0x8a61('0x17'))['db'];config['redis']=_[_0x8a61('0x18')](config['redis'],{'host':_0x8a61('0x19'),'port':0x18eb});var socket=require(_0x8a61('0x1a'))(new Redis(config[_0x8a61('0x1b')]));require(_0x8a61('0x1c'))[_0x8a61('0x1d')](socket);function respondWithStatusCode(_0x2f6d2a,_0x36cf96){_0x36cf96=_0x36cf96||0xcc;return function(_0x3236ad){if(_0x3236ad){return _0x2f6d2a[_0x8a61('0x1e')](_0x36cf96);}return _0x2f6d2a['status'](_0x36cf96)[_0x8a61('0x1f')]();};}function respondWithResult(_0x427806,_0x160085){_0x160085=_0x160085||0xc8;return function(_0x11c2f8){if(_0x11c2f8){return _0x427806[_0x8a61('0x20')](_0x160085)[_0x8a61('0x21')](_0x11c2f8);}};}function respondWithFilteredResult(_0x18ea4f,_0x4cdf27){return function(_0x57e5f3){if(_0x57e5f3){var _0x51b7b8=typeof _0x4cdf27[_0x8a61('0x22')]==='undefined'&&typeof _0x4cdf27[_0x8a61('0x23')]===_0x8a61('0x24');var _0x43231c=_0x57e5f3[_0x8a61('0x25')];var _0xfc5f42=_0x51b7b8?0x0:_0x4cdf27[_0x8a61('0x22')];var _0xa26cc1=_0x51b7b8?_0x57e5f3['count']:_0x4cdf27[_0x8a61('0x22')]+_0x4cdf27[_0x8a61('0x23')];var _0xe196ac;if(_0xa26cc1>=_0x43231c){_0xa26cc1=_0x43231c;_0xe196ac=0xc8;}else{_0xe196ac=0xce;}_0x18ea4f[_0x8a61('0x20')](_0xe196ac);return _0x18ea4f[_0x8a61('0x26')]('Content-Range',_0xfc5f42+'-'+_0xa26cc1+'/'+_0x43231c)['json'](_0x57e5f3);}return null;};}function patchUpdates(_0x413004){return function(_0x102697){try{jsonpatch['apply'](_0x102697,_0x413004,!![]);}catch(_0x56fe14){return BPromise[_0x8a61('0x27')](_0x56fe14);}return _0x102697['save']();};}function saveUpdates(_0x2a41d2,_0x4ef9d3){return function(_0x197dcd){if(_0x197dcd){return _0x197dcd[_0x8a61('0x28')](_0x2a41d2)[_0x8a61('0x29')](function(_0x5e9a29){return _0x5e9a29;});}return null;};}function removeEntity(_0x2adf5f,_0x10a968){return function(_0x1e6f08){if(_0x1e6f08){return _0x1e6f08[_0x8a61('0x2a')]()[_0x8a61('0x29')](function(){_0x2adf5f[_0x8a61('0x20')](0xcc)[_0x8a61('0x1f')]();});}};}function handleEntityNotFound(_0x47d18b,_0x5d41ce){return function(_0x1d69e6){if(!_0x1d69e6){_0x47d18b[_0x8a61('0x1e')](0x194);}return _0x1d69e6;};}function handleError(_0x2d3fae,_0x579945){_0x579945=_0x579945||0x1f4;return function(_0x1e01cd){logger['error'](_0x1e01cd['stack']);if(_0x1e01cd[_0x8a61('0x2b')]){delete _0x1e01cd[_0x8a61('0x2b')];}_0x2d3fae[_0x8a61('0x20')](_0x579945)[_0x8a61('0x2c')](_0x1e01cd);};}function getInteractionUsers(_0x41fdf6,_0x462efa){return new BPromise(function(_0x527b67,_0x1cc957){try{if(_0x462efa[_0x41fdf6['id']]){_0x41fdf6[_0x8a61('0x2d')]=_[_0x8a61('0x2e')](_0x462efa[_0x41fdf6['id']],function(_0x35abda){return{'id':_0x35abda['id'],'fullname':_0x35abda['fullname']};});}}catch(_0x3167ad){_0x1cc957(_0x3167ad);}_0x527b67(_0x41fdf6);});}function getInteractionTags(_0x4ae163,_0x4ad946){return new BPromise(function(_0x258c55,_0x3ca8e3){try{if(_0x4ae163[_0x8a61('0x2f')]){_0x4ae163[_0x8a61('0x30')]=[];_0x4ae163['TagIds'][_0x8a61('0x31')](',')['forEach'](function(_0x4568d5){_0x4ae163['Tags']['push'](_0x4ad946[_0x4568d5]);});}delete _0x4ae163['TagIds'];}catch(_0x48568e){_0x3ca8e3(_0x48568e);}_0x258c55(_0x4ae163);});}function updateFaxInteraction(_0x222635,_0x34e279,_0x2df9eb){return new BPromise(function(_0x385220,_0x1cf243){return getInteractionUsers(_0x222635,_0x2df9eb)[_0x8a61('0x29')](function(_0xce14b6){return getInteractionTags(_0xce14b6,_0x34e279);})[_0x8a61('0x29')](function(_0x1d9401){_0x385220(_0x1d9401);})[_0x8a61('0x32')](function(_0x193ab1){_0x1cf243(_0x193ab1);});});}exports['index']=function(_0x358ac8,_0x7e580d){var _0x2eeb4e={},_0xa1c34b={},_0x4259b9={'count':0x0,'rows':[]};var _0x2de9ed=_['map'](db[_0x8a61('0x33')][_0x8a61('0x34')],function(_0x1c809e){return{'name':_0x1c809e[_0x8a61('0x35')],'type':_0x1c809e['type'][_0x8a61('0x36')]};});_0xa1c34b['model']=_[_0x8a61('0x2e')](_0x2de9ed,_0x8a61('0x2b'));_0xa1c34b[_0x8a61('0x37')]=_['keys'](_0x358ac8['query']);_0xa1c34b['filters']=_['intersection'](_0xa1c34b[_0x8a61('0x38')],_0xa1c34b['query']);_0x2eeb4e['attributes']=_[_0x8a61('0x39')](_0xa1c34b['model'],qs[_0x8a61('0x3a')](_0x358ac8[_0x8a61('0x37')]['fields']));_0x2eeb4e[_0x8a61('0x3b')]=_0x2eeb4e['attributes'][_0x8a61('0x3c')]?_0x2eeb4e['attributes']:_0xa1c34b[_0x8a61('0x38')];if(!_0x358ac8['query']['hasOwnProperty'](_0x8a61('0x3d'))){_0x2eeb4e[_0x8a61('0x23')]=qs[_0x8a61('0x23')](_0x358ac8['query']['limit']);_0x2eeb4e[_0x8a61('0x22')]=qs[_0x8a61('0x22')](_0x358ac8['query'][_0x8a61('0x22')]);}_0x2eeb4e['order']=qs[_0x8a61('0x3e')](_0x358ac8[_0x8a61('0x37')]['sort']);_0x2eeb4e[_0x8a61('0x3f')]=qs[_0x8a61('0x40')](_[_0x8a61('0x41')](_0x358ac8[_0x8a61('0x37')],_0xa1c34b[_0x8a61('0x40')]),_0x2de9ed);var _0x1471fb=[];var _0x5cb5b=squel[_0x8a61('0x42')]()[_0x8a61('0x43')]('id')[_0x8a61('0x43')](_0x8a61('0x2b'))[_0x8a61('0x43')](_0x8a61('0x44'))[_0x8a61('0x45')](_0x8a61('0x46'));var _0xb0beb6=squel[_0x8a61('0x42')]()[_0x8a61('0x43')](_0x8a61('0x47'))[_0x8a61('0x43')](_0x8a61('0x48'))['field'](_0x8a61('0x49'))[_0x8a61('0x45')](_0x8a61('0x4a'),'ui')[_0x8a61('0x4b')](_0x8a61('0x4c'),'u','u.id\x20=\x20ui.UserId');var _0x83870d=squel[_0x8a61('0x42')]()[_0x8a61('0x45')]('fax_interactions','i')['left_join'](_0x8a61('0x4d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x8a61('0x4b')](_0x8a61('0x4c'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x8a61('0x4e'),'a',_0x8a61('0x4f'))[_0x8a61('0x4b')](_0x8a61('0x50'),'me','me.FaxInteractionId\x20=\x20i.id')['left_join'](_0x8a61('0x51'),'it',_0x8a61('0x52'))[_0x8a61('0x4b')](_0x8a61('0x46'),'t',_0x8a61('0x53'));var _0x25d3f6=squel['expr']();var _0x195564=[];var _0x11182a=squel[_0x8a61('0x54')]();var _0x1b6e42;if(_0x358ac8['query'][_0x8a61('0x55')]){_0x1b6e42=as[_0x8a61('0x56')](_0x358ac8[_0x8a61('0x37')][_0x8a61('0x55')]);var _0x54de31=_0x1b6e42['sqlOperator'];for(var _0x3990b1=0x0;_0x3990b1<_0x1b6e42['conditions'][_0x8a61('0x3c')];_0x3990b1++){var _0x1bb0dc=_0x1b6e42[_0x8a61('0x57')][_0x3990b1];var _0x3bf13c='i';var _0x835523=_[_0x8a61('0x58')](_0x2de9ed,[_0x8a61('0x2b'),_0x1bb0dc[_0x8a61('0x43')]]);if(!_0x835523){switch(_0x1bb0dc['field']){case'unreadMessages':if(_0x1bb0dc['value']==0x1){_0x83870d[_0x8a61('0x59')]('`'+_0x1bb0dc[_0x8a61('0x43')]+'`\x20=\x200');}else{_0x83870d[_0x8a61('0x59')]('`'+_0x1bb0dc[_0x8a61('0x43')]+'`\x20>\x200');}break;case'Contact':if(_0x1bb0dc[_0x8a61('0x5a')]===_0x8a61('0x5b')){if(_0x1bb0dc[_0x8a61('0x5c')][_0x8a61('0x31')]('\x20')[_0x8a61('0x3c')]>0x1){_0x25d3f6[_0x54de31]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8a61('0x5d')](_0x1bb0dc['value']),null);}else{var _0x5ac950='%'+_0x1bb0dc[_0x8a61('0x5c')]+'%';_0x25d3f6[_0x54de31](_0x8a61('0x5e'),_0x5ac950,_0x5ac950,_0x5ac950);}}else{_0x835523=_['find'](_0x2de9ed,[_0x8a61('0x2b'),_0x8a61('0x5f')]);_0x1bb0dc[_0x8a61('0x43')]='ContactId';_0x4a68c4=as[_0x8a61('0x60')](_0x3bf13c,_0x835523['type'],_0x1bb0dc);_0x25d3f6[_0x54de31](_0x4a68c4[_0x8a61('0x61')],_0x4a68c4[_0x8a61('0x5c')]['start'],_0x4a68c4['value'][_0x8a61('0x1f')]);}break;case _0x8a61('0x62'):var _0x57c8e1=_0x1bb0dc[_0x8a61('0x5c')][_0x8a61('0x31')](',')[_0x8a61('0x2e')](function(_0x10e04e){return Number(_0x10e04e);});_0x57c8e1['forEach'](function(_0x4c2067){_0x11182a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4c2067+',%');});_0x195564=_[_0x8a61('0x63')](_0x195564,_0x57c8e1);break;case'User':if(_0x1bb0dc['operator']===_0x8a61('0x5b')){_0x25d3f6[_0x54de31](_0x8a61('0x64'),'%'+_0x1bb0dc[_0x8a61('0x5c')]+'%',null);}else{_0x835523=_['find'](_0x2de9ed,[_0x8a61('0x2b'),_0x8a61('0x65')]);_0x1bb0dc['field']='UserId';_0x4a68c4=as[_0x8a61('0x60')](_0x3bf13c,_0x835523[_0x8a61('0x66')],_0x1bb0dc);_0x25d3f6[_0x54de31](_0x4a68c4['text'],_0x4a68c4[_0x8a61('0x5c')][_0x8a61('0x67')],_0x4a68c4[_0x8a61('0x5c')][_0x8a61('0x1f')]);}break;case'body':_0x4a68c4=as[_0x8a61('0x60')]('me',null,_0x1bb0dc);_0x25d3f6[_0x54de31](_0x4a68c4[_0x8a61('0x61')],_0x4a68c4[_0x8a61('0x5c')][_0x8a61('0x67')],_0x4a68c4[_0x8a61('0x5c')][_0x8a61('0x1f')]);break;}}else{var _0x4a68c4=as[_0x8a61('0x60')](_0x3bf13c,_0x835523[_0x8a61('0x66')],_0x1bb0dc);_0x25d3f6[_0x54de31](_0x4a68c4[_0x8a61('0x61')],_0x4a68c4[_0x8a61('0x5c')]['start'],_0x4a68c4[_0x8a61('0x5c')][_0x8a61('0x1f')]);}}}else{var _0x226cab=_(_0x358ac8['query'])[_0x8a61('0x68')]()['map'](function(_0x24708e){return _[_0x8a61('0x69')](_0x2de9ed,[_0x8a61('0x2b'),_0x24708e])?_0x24708e:undefined;})[_0x8a61('0x6a')]()[_0x8a61('0x5c')]();if(!_[_0x8a61('0x6b')](_0x226cab)){_0x226cab[_0x8a61('0x6c')](function(_0x105d6d){if(_0x105d6d===_0x8a61('0x6d')){_0x83870d[_0x8a61('0x3f')](_0x8a61('0x6e'),[]['concat'](_0x358ac8[_0x8a61('0x37')][_0x105d6d]));}else if(_0x105d6d==='createdAt'){var _0x1c56a9=JSON['parse'](_0x358ac8[_0x8a61('0x37')][_0x105d6d])['$gte'];var _0x2d78c5=JSON[_0x8a61('0x6f')](_0x358ac8[_0x8a61('0x37')][_0x105d6d])[_0x8a61('0x70')];_0x83870d['where'](_0x8a61('0x71'),_0x1c56a9,_0x2d78c5);}else{if(_0x358ac8[_0x8a61('0x37')][_0x105d6d]==='null'){_0x83870d[_0x8a61('0x3f')]('i.'+_0x105d6d+_0x8a61('0x72'));}else{_0x83870d['where']('i.'+_0x105d6d+'\x20=\x20?',_0x358ac8[_0x8a61('0x37')][_0x105d6d]);}}});}if(_0x358ac8['query'][_0x8a61('0x73')]){if(_0x358ac8['query'][_0x8a61('0x73')]==0x1){_0x83870d['having']('`unreadMessages`\x20=\x200');}else{_0x83870d[_0x8a61('0x59')](_0x8a61('0x74'));}}if(_0x358ac8[_0x8a61('0x37')][_0x8a61('0x75')]){_0x195564=_['isArray'](_0x358ac8[_0x8a61('0x37')][_0x8a61('0x75')])?_0x358ac8[_0x8a61('0x37')]['tag']:new Array(_0x358ac8[_0x8a61('0x37')]['tag']);_0x195564[_0x8a61('0x6c')](function(_0x41c77c){_0x11182a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x41c77c+',%');});}if(_0x358ac8['query']['filter']){var _0x26ff59=_0x358ac8[_0x8a61('0x37')][_0x8a61('0x76')][_0x8a61('0x77')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x26ff59)){_0x25d3f6['or'](_0x8a61('0x78'),_0x26ff59+'%')['or'](_0x8a61('0x79'),_0x26ff59+'%');}_0x25d3f6['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x26ff59+'%');}}_0x83870d[_0x8a61('0x3f')](_0x25d3f6);_0x83870d[_0x8a61('0x7a')]('i.id');var _0x37c863={'type':db[_0x8a61('0x7b')][_0x8a61('0x7c')]['SELECT'],'raw':!![]};var _0x7f0136=_0x83870d[_0x8a61('0x7d')]();_0x7f0136[_0x8a61('0x43')]('i.id');_0x7f0136[_0x8a61('0x43')](_0x8a61('0x7e'),_0x8a61('0x7f'));if(_0x2eeb4e['order']){_0x2eeb4e[_0x8a61('0x80')][_0x8a61('0x6c')](function(_0x39d682){var _0x53b6ad=_0x39d682[0x0]==='contactName'?_0x39d682[0x0]:'i.'+_0x39d682[0x0];_0x83870d[_0x8a61('0x80')](_0x53b6ad,_0x39d682[0x1]===_0x8a61('0x81')?![]:!![]);});}if(!_[_0x8a61('0x6b')](_0x195564)){_0x83870d['having'](_0x11182a);_0x7f0136[_0x8a61('0x3f')](_0x8a61('0x82'),_0x195564);}BPromise[_0x8a61('0x83')]()['then'](function(){if(!_0x1b6e42){if(_0x358ac8[_0x8a61('0x37')][_0x8a61('0x6d')])return;_0x7f0136[_0x8a61('0x3f')](_0x8a61('0x84'));_0x83870d[_0x8a61('0x3f')](_0x8a61('0x84'));return;}if(_0x358ac8[_0x8a61('0x85')][_0x8a61('0x86')]!=='agent')return;return _0x358ac8[_0x8a61('0x85')][_0x8a61('0x87')]({'attributes':['id'],'raw':!![]})['then'](function(_0x408c14){if(_[_0x8a61('0x6b')](_0x408c14)){_0x7f0136[_0x8a61('0x3f')]('i.FaxAccountId\x20IS\x20NULL');_0x83870d[_0x8a61('0x3f')](_0x8a61('0x88'));}else{_0x7f0136[_0x8a61('0x3f')](_0x8a61('0x6e'),_[_0x8a61('0x2e')](_0x408c14,'id'));_0x83870d[_0x8a61('0x3f')]('i.FaxAccountId\x20IN\x20?',_[_0x8a61('0x2e')](_0x408c14,'id'));}});})[_0x8a61('0x29')](function(){if(_0x358ac8[_0x8a61('0x85')][_0x8a61('0x86')]===_0x8a61('0x89')&&!_0x1b6e42&&!_0x358ac8[_0x8a61('0x37')]['FaxAccountId'])return[];return db[_0x8a61('0x8a')][_0x8a61('0x37')](_0x7f0136[_0x8a61('0x8b')](),_0x37c863);})[_0x8a61('0x29')](function(_0x5654bc){_0x4259b9[_0x8a61('0x25')]=_0x5654bc[_0x8a61('0x3c')];if(_0x4259b9['count']===0x0)return[];return db['sequelize'][_0x8a61('0x37')](_0x5cb5b[_0x8a61('0x8b')](),_0x37c863)[_0x8a61('0x29')](function(_0x450581){_0x1471fb=_['keyBy'](_0x450581,'id');_0x37c863=_[_0x8a61('0x8c')](_0x37c863,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x358ac8[_0x8a61('0x37')][_0x8a61('0x3a')]){_0x2eeb4e[_0x8a61('0x3b')][_0x8a61('0x6c')](function(_0x517d5f){_0x83870d[_0x8a61('0x43')]('i.'+_0x517d5f);});}else{_0x83870d[_0x8a61('0x43')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8a61('0x7f'));_0x83870d[_0x8a61('0x43')](_0x8a61('0x8d'),_0x8a61('0x8e'));_0x83870d['field'](_0x8a61('0x8f'),_0x8a61('0x90'));_0x83870d[_0x8a61('0x43')]('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',_0x8a61('0x91'));_0x83870d[_0x8a61('0x43')]('i.*');_0x83870d[_0x8a61('0x43')](_0x8a61('0x92'),'Contact.firstName');_0x83870d[_0x8a61('0x43')](_0x8a61('0x93'),_0x8a61('0x94'));_0x83870d[_0x8a61('0x43')]('c.email',_0x8a61('0x95'));_0x83870d[_0x8a61('0x43')]('c.phone',_0x8a61('0x96'));_0x83870d[_0x8a61('0x43')](_0x8a61('0x97'),_0x8a61('0x98'));_0x83870d[_0x8a61('0x43')](_0x8a61('0x99'),_0x8a61('0x9a'));_0x83870d[_0x8a61('0x43')](_0x8a61('0x9b'),'Owner.fullname');_0x83870d[_0x8a61('0x43')](_0x8a61('0x9c'),'Owner.internal');_0x83870d[_0x8a61('0x43')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x8a61('0x2f'));}if(_0x2eeb4e[_0x8a61('0x23')])_0x83870d[_0x8a61('0x23')](_0x2eeb4e['limit']);if(_0x2eeb4e['offset'])_0x83870d[_0x8a61('0x22')](_0x2eeb4e[_0x8a61('0x22')]);return db['sequelize'][_0x8a61('0x37')](_0x83870d[_0x8a61('0x8b')](),_0x37c863);})[_0x8a61('0x29')](function(_0x222f96){if(_0x222f96[_0x8a61('0x3c')]>0x0)_0xb0beb6['where']('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x222f96,'id'));return db[_0x8a61('0x8a')][_0x8a61('0x37')](_0xb0beb6[_0x8a61('0x8b')](),_0x37c863)['then'](function(_0x41c2e7){var _0x2d97f0=_['groupBy'](_0x41c2e7,_0x8a61('0x9d'));var _0x3bf341=[];_0x222f96['forEach'](function(_0x53e550){_0x3bf341[_0x8a61('0x9e')](updateFaxInteraction(_0x53e550,_0x1471fb,_0x2d97f0));});return BPromise[_0x8a61('0x9f')](_0x3bf341);});});})[_0x8a61('0x29')](function(_0xb2df54){_0x4259b9[_0x8a61('0xa0')]=_0xb2df54;return _0x4259b9;})[_0x8a61('0x29')](respondWithFilteredResult(_0x7e580d,_0x2eeb4e))[_0x8a61('0x32')](handleError(_0x7e580d,null));};exports[_0x8a61('0xa1')]=function(_0x86fa4a,_0x557a11){var _0x5952c5={'raw':![],'where':{'id':_0x86fa4a['params']['id']}},_0x44f36c={};_0x44f36c[_0x8a61('0x38')]=_[_0x8a61('0x68')](db[_0x8a61('0x33')][_0x8a61('0x34')]);_0x44f36c['query']=_[_0x8a61('0x68')](_0x86fa4a[_0x8a61('0x37')]);_0x44f36c['filters']=_[_0x8a61('0x39')](_0x44f36c[_0x8a61('0x38')],_0x44f36c[_0x8a61('0x37')]);_0x5952c5[_0x8a61('0x3b')]=_[_0x8a61('0x39')](_0x44f36c[_0x8a61('0x38')],qs[_0x8a61('0x3a')](_0x86fa4a['query'][_0x8a61('0x3a')]));_0x5952c5[_0x8a61('0x3b')]=_0x5952c5['attributes']['length']?_0x5952c5[_0x8a61('0x3b')]:_0x44f36c['model'];if(_0x86fa4a[_0x8a61('0x37')][_0x8a61('0xa2')]){_0x5952c5[_0x8a61('0xa3')]=[{'all':!![]}];}_0x5952c5=_[_0x8a61('0x8c')]({},_0x5952c5,_0x86fa4a[_0x8a61('0xa4')]);return db['FaxInteraction'][_0x8a61('0x58')](_0x5952c5)[_0x8a61('0x29')](handleEntityNotFound(_0x557a11,null))['then'](respondWithResult(_0x557a11,null))['catch'](handleError(_0x557a11,null));};exports['create']=function(_0x581e6d,_0x4a2c65){return db[_0x8a61('0x33')][_0x8a61('0xa5')](_0x581e6d[_0x8a61('0xa6')],{})['then'](respondWithResult(_0x4a2c65,0xc9))[_0x8a61('0x32')](handleError(_0x4a2c65,null));};exports[_0x8a61('0x28')]=function(_0x52987c,_0x52c1b5){if(_0x52987c[_0x8a61('0xa6')]['id']){delete _0x52987c[_0x8a61('0xa6')]['id'];}return db[_0x8a61('0x33')][_0x8a61('0x58')]({'where':{'id':_0x52987c['params']['id']}})[_0x8a61('0x29')](handleEntityNotFound(_0x52c1b5,null))[_0x8a61('0x29')](saveUpdates(_0x52987c[_0x8a61('0xa6')],null))[_0x8a61('0x29')](respondWithResult(_0x52c1b5,null))[_0x8a61('0x32')](handleError(_0x52c1b5,null));};exports[_0x8a61('0x2a')]=function(_0x1ba76c,_0x8b8474){return db[_0x8a61('0x33')][_0x8a61('0x58')]({'where':{'id':_0x1ba76c[_0x8a61('0xa7')]['id']}})['then'](handleEntityNotFound(_0x8b8474,null))[_0x8a61('0x29')](removeEntity(_0x8b8474,null))[_0x8a61('0x32')](handleError(_0x8b8474,null));};exports['describe']=function(_0x35bcce,_0x1f8032){return db[_0x8a61('0x33')][_0x8a61('0xa8')]()[_0x8a61('0x29')](respondWithResult(_0x1f8032,null))[_0x8a61('0x32')](handleError(_0x1f8032,null));};exports[_0x8a61('0xa9')]=function(_0x28fadc,_0x400000,_0x244a9d){return db['FaxMessage'][_0x8a61('0x58')]({'where':{'id':_0x28fadc[_0x8a61('0xa7')]['id']}})[_0x8a61('0x29')](handleEntityNotFound(_0x400000,null))[_0x8a61('0x29')](function(_0x1c4c1c){if(_0x1c4c1c){return _0x1c4c1c[_0x8a61('0xa9')](_0x28fadc['body'][_0x8a61('0xaa')],_['omit'](_0x28fadc[_0x8a61('0xa6')],['ids','id'])||{});}})[_0x8a61('0x29')](respondWithResult(_0x400000,null))[_0x8a61('0x32')](handleError(_0x400000,null));};exports[_0x8a61('0xab')]=function(_0x40606c,_0x2fb3d8,_0x4a62c8){var _0x43451d={'raw':![],'where':{}};var _0x311ad6={};var _0x1ac001={'count':0x0,'rows':[]};return db[_0x8a61('0x33')][_0x8a61('0xac')]({'where':{'id':_0x40606c['params']['id']}})['then'](handleEntityNotFound(_0x2fb3d8,null))['then'](function(_0x3ac0ea){if(_0x3ac0ea){_0x311ad6[_0x8a61('0x38')]=_[_0x8a61('0x68')](db['FaxMessage'][_0x8a61('0x34')]);_0x311ad6['query']=_[_0x8a61('0x68')](_0x40606c[_0x8a61('0x37')]);_0x311ad6[_0x8a61('0x40')]=_['intersection'](_0x311ad6[_0x8a61('0x38')],_0x311ad6['query']);_0x43451d[_0x8a61('0x3b')]=_['intersection'](_0x311ad6['model'],qs[_0x8a61('0x3a')](_0x40606c[_0x8a61('0x37')][_0x8a61('0x3a')]));_0x43451d['attributes']=_0x43451d['attributes']['length']?_0x43451d[_0x8a61('0x3b')]:_0x311ad6[_0x8a61('0x38')];if(!_0x40606c['query'][_0x8a61('0xad')](_0x8a61('0x3d'))){_0x43451d['limit']=qs[_0x8a61('0x23')](_0x40606c[_0x8a61('0x37')]['limit']);_0x43451d['offset']=qs[_0x8a61('0x22')](_0x40606c['query'][_0x8a61('0x22')]);}_0x43451d[_0x8a61('0x80')]=qs[_0x8a61('0x3e')](_0x40606c[_0x8a61('0x37')][_0x8a61('0x3e')]);_0x43451d[_0x8a61('0x3f')]=qs[_0x8a61('0x40')](_[_0x8a61('0x41')](_0x40606c[_0x8a61('0x37')],_0x311ad6[_0x8a61('0x40')]));_0x43451d['where']['FaxInteractionId']=_0x3ac0ea['id'];if(_0x40606c[_0x8a61('0x37')][_0x8a61('0x76')]){_0x43451d['where']=_[_0x8a61('0x8c')](_0x43451d[_0x8a61('0x3f')],{'$or':_[_0x8a61('0x2e')](_0x43451d['attributes'],function(_0x146fc3){var _0x13fcf9={};_0x13fcf9[_0x146fc3]={'$like':'%'+_0x40606c[_0x8a61('0x37')][_0x8a61('0x76')]+'%'};return _0x13fcf9;})});}if(_0x40606c[_0x8a61('0x37')]['$gte']){var _0x271f05=_0x40606c['query']['$gte'][_0x8a61('0x31')](',');var _0x124604={};_0x124604[_0x271f05[0x0]]={'$gte':moment(_0x271f05[0x1])[_0x8a61('0xae')](_0x8a61('0xaf'))};_0x43451d[_0x8a61('0x3f')]=_['merge'](_0x43451d[_0x8a61('0x3f')],_0x124604);}_0x43451d=_[_0x8a61('0x8c')]({},_0x43451d,_0x40606c[_0x8a61('0xa4')]);return db[_0x8a61('0xb0')][_0x8a61('0x25')]({'where':_0x43451d[_0x8a61('0x3f')]})[_0x8a61('0x29')](function(_0x4142dc){_0x1ac001[_0x8a61('0x25')]=_0x4142dc;if(_0x40606c[_0x8a61('0x37')][_0x8a61('0xa2')]){_0x43451d[_0x8a61('0xa3')]=[{'all':!![]}];}return db[_0x8a61('0xb0')][_0x8a61('0xb1')](_0x43451d);})['then'](function(_0xa7148d){_0x1ac001[_0x8a61('0xa0')]=_0xa7148d;return _0x1ac001;});}})[_0x8a61('0x29')](respondWithFilteredResult(_0x2fb3d8,_0x43451d))[_0x8a61('0x32')](handleError(_0x2fb3d8,null));};exports[_0x8a61('0xb2')]=function(_0x475807,_0x19de0d,_0x1d58fb){return db[_0x8a61('0x33')][_0x8a61('0x58')]({'where':{'id':_0x475807[_0x8a61('0xa7')]['id']}})[_0x8a61('0x29')](handleEntityNotFound(_0x19de0d,null))['then'](function(_0x5c8a16){if(_0x5c8a16){return _0x5c8a16[_0x8a61('0xb3')](_0x475807['body'][_0x8a61('0xaa')],_['omit'](_0x475807[_0x8a61('0xa6')],[_0x8a61('0xaa'),'id'])||{})['spread'](function(){return db[_0x8a61('0x62')][_0x8a61('0xb1')]({'attributes':['id',_0x8a61('0x2b'),_0x8a61('0x44')],'where':{'id':_0x475807[_0x8a61('0xa6')][_0x8a61('0xaa')]}});})[_0x8a61('0x29')](function(_0x7486e2){socket[_0x8a61('0xb4')]('faxInteractionTags:save',{'id':Number(_0x475807[_0x8a61('0xa7')]['id']),'tags':_0x7486e2||[]});return{'id':Number(_0x475807[_0x8a61('0xa7')]['id']),'tags':_0x7486e2||[]};});}})[_0x8a61('0x29')](respondWithResult(_0x19de0d,null))['catch'](handleError(_0x19de0d,null));};exports[_0x8a61('0xb5')]=function(_0x3fdf05,_0x793d47,_0x2e2a1d){return db[_0x8a61('0x33')]['find']({'where':{'id':_0x3fdf05[_0x8a61('0xa7')]['id']}})[_0x8a61('0x29')](handleEntityNotFound(_0x793d47,null))[_0x8a61('0x29')](function(_0x1befa5){if(_0x1befa5){return _0x1befa5['removeTags'](_0x3fdf05[_0x8a61('0x37')][_0x8a61('0xaa')]);}})[_0x8a61('0x29')](respondWithStatusCode(_0x793d47,null))[_0x8a61('0x32')](handleError(_0x793d47,null));};exports[_0x8a61('0xb6')]=function(_0x9bdee3,_0x592436){var _0x5bd60d=moment()['unix']()[_0x8a61('0x8b')]();var _0x1e28dd=path[_0x8a61('0xb7')](config[_0x8a61('0xb8')],_0x8a61('0xb9'),_0x8a61('0xba'),'tmp');var _0x4e10ec=path[_0x8a61('0xb7')](config[_0x8a61('0xb8')],_0x8a61('0xb9'),_0x8a61('0xba'),'attachments');var _0x23826c=path['join'](_0x1e28dd,_0x5bd60d);var _0x1ca95c=util['format'](_0x8a61('0xbb'),_0x9bdee3[_0x8a61('0xa7')]['id'],_0x5bd60d);var _0x30fc4b=path['join'](_0x1e28dd,_0x1ca95c);var _0x3b3e1a=[];_0x3b3e1a['push']({'model':db[_0x8a61('0xbc')],'as':'Attachment','raw':!![]});var _0x178b16=[{'model':db[_0x8a61('0xb0')],'as':_0x8a61('0xbd'),'attributes':['id','body',_0x8a61('0xbe')],'include':_0x3b3e1a}];return db['FaxInteraction'][_0x8a61('0x58')]({'where':{'id':_0x9bdee3[_0x8a61('0xa7')]['id']},'include':_0x178b16})['then'](handleEntityNotFound(_0x592436,null))[_0x8a61('0x29')](function(_0x255c2f){if(_0x255c2f&&_0x255c2f[_0x8a61('0xbd')]){var _0x2f1a78=_0x255c2f[_0x8a61('0xbf')]({'plain':!![]});fs[_0x8a61('0xc0')](_0x23826c);for(var _0x173859=0x0;_0x173859<_0x2f1a78[_0x8a61('0xbd')][_0x8a61('0x3c')];_0x173859++){var _0x15c5cf=_0x2f1a78['Messages'][_0x173859][_0x8a61('0xbc')];if(_0x15c5cf){var _0x2e0858=path[_0x8a61('0xb7')](_0x4e10ec,_0x15c5cf['basename']);if(fs[_0x8a61('0xc1')](_0x2e0858)){fs[_0x8a61('0xc2')](_0x2e0858)['pipe'](fs[_0x8a61('0xc3')](path['join'](_0x23826c,_0x15c5cf[_0x8a61('0xc4')])));}}}return BPromise[_0x8a61('0x83')]()[_0x8a61('0x29')](function(){return new BPromise(function(_0x43f08c,_0x2fca8f){zipdir(_0x23826c,{'saveTo':_0x30fc4b},function(_0x311e3c,_0x571e9c){if(_0x311e3c)return _0x2fca8f(_0x311e3c);return _0x43f08c(_0x571e9c);});})[_0x8a61('0x29')](function(){return new BPromise(function(_0x5ede0f,_0x38c82c){rimraf(_0x23826c,function(_0x356fa4){if(_0x356fa4)_0x38c82c(_0x356fa4);return _0x5ede0f();});});})[_0x8a61('0x29')](function(){return _0x592436[_0x8a61('0xb6')](_0x30fc4b,_0x1ca95c,function(_0x562d80){if(_0x562d80){console['log'](_0x8a61('0xc5'),_0x562d80);}else{fs[_0x8a61('0xc6')](_0x30fc4b);}});});});}else{return _0x592436['sendStatus'](0xc8);}})[_0x8a61('0x32')](handleError(_0x592436,null));}; \ No newline at end of file +var _0xd661=['sequelize','toString','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','Contact.firstName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','show','params','includeAll','include','options','destroy','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','keys','rawAttributes','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','emit','faxInteractionTags:save','removeTags','download','join','root','server','files','attachments','format','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','json','offset','undefined','limit','count','set','apply','reject','update','end','sendStatus','error','name','send','TagIds','Tags','split','forEach','push','then','catch','index','map','FaxInteraction','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','select','field','color','u.id','u.fullname','ui.FaxInteractionId','from','left_join','users','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','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?','UserId','text','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent'];(function(_0x27c938,_0x25ed17){var _0x102a81=function(_0x33d424){while(--_0x33d424){_0x27c938['push'](_0x27c938['shift']());}};_0x102a81(++_0x25ed17);}(_0xd661,0x11d));var _0x1d66=function(_0x5526b4,_0x3c914f){_0x5526b4=_0x5526b4-0x0;var _0x1491d3=_0xd661[_0x5526b4];return _0x1491d3;};'use strict';var emlformat=require(_0x1d66('0x0'));var rimraf=require(_0x1d66('0x1'));var zipdir=require(_0x1d66('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d66('0x3'));var moment=require(_0x1d66('0x4'));var BPromise=require(_0x1d66('0x5'));var Mustache=require(_0x1d66('0x6'));var util=require(_0x1d66('0x7'));var path=require(_0x1d66('0x8'));var sox=require(_0x1d66('0x9'));var csv=require('to-csv');var ejs=require(_0x1d66('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d66('0xb'));var squel=require(_0x1d66('0xc'));var crypto=require(_0x1d66('0xd'));var jsforce=require(_0x1d66('0xe'));var deskjs=require(_0x1d66('0xf'));var toCsv=require(_0x1d66('0x10'));var querystring=require(_0x1d66('0x11'));var Papa=require(_0x1d66('0x12'));var Redis=require(_0x1d66('0x13'));var authService=require(_0x1d66('0x14'));var qs=require(_0x1d66('0x15'));var as=require(_0x1d66('0x16'));var hardwareService=require(_0x1d66('0x17'));var logger=require('../../config/logger')(_0x1d66('0x18'));var utils=require('../../config/utils');var config=require(_0x1d66('0x19'));var licenseUtil=require(_0x1d66('0x1a'));var db=require(_0x1d66('0x1b'))['db'];config[_0x1d66('0x1c')]=_[_0x1d66('0x1d')](config[_0x1d66('0x1c')],{'host':_0x1d66('0x1e'),'port':0x18eb});var socket=require(_0x1d66('0x1f'))(new Redis(config[_0x1d66('0x1c')]));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x2921c2,_0x446088){_0x446088=_0x446088||0xcc;return function(_0xb7dece){if(_0xb7dece){return _0x2921c2['sendStatus'](_0x446088);}return _0x2921c2[_0x1d66('0x20')](_0x446088)['end']();};}function respondWithResult(_0x4d4add,_0x44f37e){_0x44f37e=_0x44f37e||0xc8;return function(_0x2c736c){if(_0x2c736c){return _0x4d4add[_0x1d66('0x20')](_0x44f37e)[_0x1d66('0x21')](_0x2c736c);}};}function respondWithFilteredResult(_0x192ede,_0x393ca9){return function(_0x1fd79c){if(_0x1fd79c){var _0x227a5d=typeof _0x393ca9[_0x1d66('0x22')]===_0x1d66('0x23')&&typeof _0x393ca9[_0x1d66('0x24')]==='undefined';var _0x43aa72=_0x1fd79c[_0x1d66('0x25')];var _0xc8132d=_0x227a5d?0x0:_0x393ca9[_0x1d66('0x22')];var _0x32db5d=_0x227a5d?_0x1fd79c['count']:_0x393ca9[_0x1d66('0x22')]+_0x393ca9[_0x1d66('0x24')];var _0x87e4cb;if(_0x32db5d>=_0x43aa72){_0x32db5d=_0x43aa72;_0x87e4cb=0xc8;}else{_0x87e4cb=0xce;}_0x192ede[_0x1d66('0x20')](_0x87e4cb);return _0x192ede[_0x1d66('0x26')]('Content-Range',_0xc8132d+'-'+_0x32db5d+'/'+_0x43aa72)['json'](_0x1fd79c);}return null;};}function patchUpdates(_0x2a0b2a){return function(_0x3b44e9){try{jsonpatch[_0x1d66('0x27')](_0x3b44e9,_0x2a0b2a,!![]);}catch(_0xf59ef1){return BPromise[_0x1d66('0x28')](_0xf59ef1);}return _0x3b44e9['save']();};}function saveUpdates(_0x1a2f44,_0x14716f){return function(_0x400509){if(_0x400509){return _0x400509[_0x1d66('0x29')](_0x1a2f44)['then'](function(_0x3e3df3){return _0x3e3df3;});}return null;};}function removeEntity(_0x434822,_0x2db168){return function(_0x24bcf1){if(_0x24bcf1){return _0x24bcf1['destroy']()['then'](function(){_0x434822[_0x1d66('0x20')](0xcc)[_0x1d66('0x2a')]();});}};}function handleEntityNotFound(_0x141dab,_0x119f91){return function(_0x5736a2){if(!_0x5736a2){_0x141dab[_0x1d66('0x2b')](0x194);}return _0x5736a2;};}function handleError(_0x1cc7f9,_0x136961){_0x136961=_0x136961||0x1f4;return function(_0x5372d4){logger[_0x1d66('0x2c')](_0x5372d4['stack']);if(_0x5372d4['name']){delete _0x5372d4[_0x1d66('0x2d')];}_0x1cc7f9[_0x1d66('0x20')](_0x136961)[_0x1d66('0x2e')](_0x5372d4);};}function getInteractionUsers(_0x114d38,_0x30fb36){return new BPromise(function(_0x3a8209,_0x2015a1){try{if(_0x30fb36[_0x114d38['id']]){_0x114d38['Users']=_['map'](_0x30fb36[_0x114d38['id']],function(_0x3aab1e){return{'id':_0x3aab1e['id'],'fullname':_0x3aab1e['fullname']};});}}catch(_0x2781c3){_0x2015a1(_0x2781c3);}_0x3a8209(_0x114d38);});}function getInteractionTags(_0x26cef2,_0x12d972){return new BPromise(function(_0x3e2af5,_0x5d7dcd){try{if(_0x26cef2[_0x1d66('0x2f')]){_0x26cef2[_0x1d66('0x30')]=[];_0x26cef2['TagIds'][_0x1d66('0x31')](',')[_0x1d66('0x32')](function(_0x372225){_0x26cef2['Tags'][_0x1d66('0x33')](_0x12d972[_0x372225]);});}delete _0x26cef2[_0x1d66('0x2f')];}catch(_0x167a83){_0x5d7dcd(_0x167a83);}_0x3e2af5(_0x26cef2);});}function updateFaxInteraction(_0x161075,_0x5dcb7d,_0x680001){return new BPromise(function(_0x22a7f6,_0xf54fe3){return getInteractionUsers(_0x161075,_0x680001)[_0x1d66('0x34')](function(_0x48565b){return getInteractionTags(_0x48565b,_0x5dcb7d);})[_0x1d66('0x34')](function(_0x160ceb){_0x22a7f6(_0x160ceb);})[_0x1d66('0x35')](function(_0x491ee2){_0xf54fe3(_0x491ee2);});});}exports[_0x1d66('0x36')]=function(_0x273177,_0x322cf8){var _0x32a614={},_0x32cbc9={},_0x2ffa95={'count':0x0,'rows':[]};var _0x521778=_[_0x1d66('0x37')](db[_0x1d66('0x38')]['rawAttributes'],function(_0x26f1e4){return{'name':_0x26f1e4[_0x1d66('0x39')],'type':_0x26f1e4[_0x1d66('0x3a')][_0x1d66('0x3b')]};});_0x32cbc9[_0x1d66('0x3c')]=_[_0x1d66('0x37')](_0x521778,_0x1d66('0x2d'));_0x32cbc9[_0x1d66('0x3d')]=_['keys'](_0x273177[_0x1d66('0x3d')]);_0x32cbc9['filters']=_[_0x1d66('0x3e')](_0x32cbc9[_0x1d66('0x3c')],_0x32cbc9[_0x1d66('0x3d')]);_0x32a614[_0x1d66('0x3f')]=_['intersection'](_0x32cbc9[_0x1d66('0x3c')],qs['fields'](_0x273177['query'][_0x1d66('0x40')]));_0x32a614[_0x1d66('0x3f')]=_0x32a614['attributes'][_0x1d66('0x41')]?_0x32a614['attributes']:_0x32cbc9[_0x1d66('0x3c')];if(!_0x273177['query'][_0x1d66('0x42')](_0x1d66('0x43'))){_0x32a614[_0x1d66('0x24')]=qs[_0x1d66('0x24')](_0x273177['query'][_0x1d66('0x24')]);_0x32a614[_0x1d66('0x22')]=qs[_0x1d66('0x22')](_0x273177[_0x1d66('0x3d')][_0x1d66('0x22')]);}_0x32a614['order']=qs[_0x1d66('0x44')](_0x273177[_0x1d66('0x3d')][_0x1d66('0x44')]);_0x32a614['where']=qs[_0x1d66('0x45')](_['pick'](_0x273177[_0x1d66('0x3d')],_0x32cbc9[_0x1d66('0x45')]),_0x521778);var _0x2143e0=[];var _0x85acfd=squel[_0x1d66('0x46')]()[_0x1d66('0x47')]('id')[_0x1d66('0x47')](_0x1d66('0x2d'))[_0x1d66('0x47')](_0x1d66('0x48'))['from']('tools_tags');var _0x49fdc4=squel['select']()[_0x1d66('0x47')](_0x1d66('0x49'))[_0x1d66('0x47')](_0x1d66('0x4a'))[_0x1d66('0x47')](_0x1d66('0x4b'))[_0x1d66('0x4c')]('user_has_fax_interactions','ui')[_0x1d66('0x4d')](_0x1d66('0x4e'),'u','u.id\x20=\x20ui.UserId');var _0x1fe4a6=squel['select']()['from'](_0x1d66('0x4f'),'i')[_0x1d66('0x4d')]('cm_contacts','c',_0x1d66('0x50'))[_0x1d66('0x4d')](_0x1d66('0x4e'),'o',_0x1d66('0x51'))[_0x1d66('0x4d')](_0x1d66('0x52'),'a','a.id\x20=\x20i.FaxAccountId')[_0x1d66('0x4d')](_0x1d66('0x53'),'me',_0x1d66('0x54'))[_0x1d66('0x4d')](_0x1d66('0x55'),'it',_0x1d66('0x56'))[_0x1d66('0x4d')](_0x1d66('0x57'),'t',_0x1d66('0x58'));var _0x53a7b0=squel[_0x1d66('0x59')]();var _0x32125f=[];var _0x408ed5=squel[_0x1d66('0x59')]();var _0x17dab1;if(_0x273177[_0x1d66('0x3d')][_0x1d66('0x5a')]){_0x17dab1=as['parseSearch'](_0x273177[_0x1d66('0x3d')][_0x1d66('0x5a')]);var _0x19af05=_0x17dab1[_0x1d66('0x5b')];for(var _0x5ff6d2=0x0;_0x5ff6d2<_0x17dab1[_0x1d66('0x5c')]['length'];_0x5ff6d2++){var _0x5dad34=_0x17dab1[_0x1d66('0x5c')][_0x5ff6d2];var _0x55e2ed='i';var _0x186a88=_[_0x1d66('0x5d')](_0x521778,['name',_0x5dad34[_0x1d66('0x47')]]);if(!_0x186a88){switch(_0x5dad34[_0x1d66('0x47')]){case _0x1d66('0x5e'):if(_0x5dad34[_0x1d66('0x5f')]==0x1){_0x1fe4a6['having']('`'+_0x5dad34[_0x1d66('0x47')]+_0x1d66('0x60'));}else{_0x1fe4a6[_0x1d66('0x61')]('`'+_0x5dad34['field']+_0x1d66('0x62'));}break;case _0x1d66('0x63'):if(_0x5dad34[_0x1d66('0x64')]===_0x1d66('0x65')){if(_0x5dad34[_0x1d66('0x5f')][_0x1d66('0x31')]('\x20')[_0x1d66('0x41')]>0x1){_0x53a7b0[_0x19af05]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5dad34[_0x1d66('0x5f')]),null);}else{var _0x217925='%'+_0x5dad34[_0x1d66('0x5f')]+'%';_0x53a7b0[_0x19af05](_0x1d66('0x66'),_0x217925,_0x217925,_0x217925);}}else{_0x186a88=_[_0x1d66('0x5d')](_0x521778,[_0x1d66('0x2d'),_0x1d66('0x67')]);_0x5dad34[_0x1d66('0x47')]=_0x1d66('0x67');_0x470e5d=as[_0x1d66('0x68')](_0x55e2ed,_0x186a88[_0x1d66('0x3a')],_0x5dad34);_0x53a7b0[_0x19af05](_0x470e5d['text'],_0x470e5d[_0x1d66('0x5f')][_0x1d66('0x69')],_0x470e5d[_0x1d66('0x5f')][_0x1d66('0x2a')]);}break;case _0x1d66('0x6a'):var _0x585727=_0x5dad34[_0x1d66('0x5f')]['split'](',')[_0x1d66('0x37')](function(_0xe0f595){return Number(_0xe0f595);});_0x585727['forEach'](function(_0x56fdec){_0x408ed5['or'](_0x1d66('0x6b'),'%,'+_0x56fdec+',%');});_0x32125f=_[_0x1d66('0x6c')](_0x32125f,_0x585727);break;case _0x1d66('0x6d'):if(_0x5dad34['operator']===_0x1d66('0x65')){_0x53a7b0[_0x19af05](_0x1d66('0x6e'),'%'+_0x5dad34[_0x1d66('0x5f')]+'%',null);}else{_0x186a88=_[_0x1d66('0x5d')](_0x521778,[_0x1d66('0x2d'),_0x1d66('0x6f')]);_0x5dad34[_0x1d66('0x47')]='UserId';_0x470e5d=as[_0x1d66('0x68')](_0x55e2ed,_0x186a88[_0x1d66('0x3a')],_0x5dad34);_0x53a7b0[_0x19af05](_0x470e5d[_0x1d66('0x70')],_0x470e5d[_0x1d66('0x5f')][_0x1d66('0x69')],_0x470e5d['value']['end']);}break;case _0x1d66('0x71'):_0x470e5d=as[_0x1d66('0x68')]('me',null,_0x5dad34);_0x53a7b0[_0x19af05](_0x470e5d[_0x1d66('0x70')],_0x470e5d['value'][_0x1d66('0x69')],_0x470e5d[_0x1d66('0x5f')][_0x1d66('0x2a')]);break;}}else{var _0x470e5d=as[_0x1d66('0x68')](_0x55e2ed,_0x186a88['type'],_0x5dad34);_0x53a7b0[_0x19af05](_0x470e5d[_0x1d66('0x70')],_0x470e5d[_0x1d66('0x5f')]['start'],_0x470e5d[_0x1d66('0x5f')]['end']);}}}else{var _0x57565c=_(_0x273177[_0x1d66('0x3d')])['keys']()[_0x1d66('0x37')](function(_0x392544){return _[_0x1d66('0x72')](_0x521778,[_0x1d66('0x2d'),_0x392544])?_0x392544:undefined;})[_0x1d66('0x73')]()[_0x1d66('0x5f')]();if(!_[_0x1d66('0x74')](_0x57565c)){_0x57565c[_0x1d66('0x32')](function(_0x22cee4){if(_0x22cee4===_0x1d66('0x75')){_0x1fe4a6['where'](_0x1d66('0x76'),[][_0x1d66('0x77')](_0x273177['query'][_0x22cee4]));}else if(_0x22cee4===_0x1d66('0x78')){var _0x190a00=JSON[_0x1d66('0x79')](_0x273177[_0x1d66('0x3d')][_0x22cee4])[_0x1d66('0x7a')];var _0x3fce59=JSON[_0x1d66('0x79')](_0x273177[_0x1d66('0x3d')][_0x22cee4])[_0x1d66('0x7b')];_0x1fe4a6[_0x1d66('0x7c')](_0x1d66('0x7d'),_0x190a00,_0x3fce59);}else{if(_0x273177[_0x1d66('0x3d')][_0x22cee4]==='null'){_0x1fe4a6[_0x1d66('0x7c')]('i.'+_0x22cee4+_0x1d66('0x7e'));}else{_0x1fe4a6[_0x1d66('0x7c')]('i.'+_0x22cee4+_0x1d66('0x7f'),_0x273177[_0x1d66('0x3d')][_0x22cee4]);}}});}if(_0x273177[_0x1d66('0x3d')][_0x1d66('0x80')]){if(_0x273177[_0x1d66('0x3d')][_0x1d66('0x80')]==0x1){_0x1fe4a6[_0x1d66('0x61')](_0x1d66('0x81'));}else{_0x1fe4a6[_0x1d66('0x61')](_0x1d66('0x82'));}}if(_0x273177['query']['tag']){_0x32125f=_['isArray'](_0x273177[_0x1d66('0x3d')][_0x1d66('0x83')])?_0x273177[_0x1d66('0x3d')]['tag']:new Array(_0x273177[_0x1d66('0x3d')][_0x1d66('0x83')]);_0x32125f[_0x1d66('0x32')](function(_0x216fd1){_0x408ed5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x216fd1+',%');});}if(_0x273177[_0x1d66('0x3d')][_0x1d66('0x84')]){var _0x165780=_0x273177[_0x1d66('0x3d')]['filter'][_0x1d66('0x85')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x165780)){_0x53a7b0['or'](_0x1d66('0x86'),_0x165780+'%')['or'](_0x1d66('0x87'),_0x165780+'%');}_0x53a7b0['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x165780+'%');}}_0x1fe4a6[_0x1d66('0x7c')](_0x53a7b0);_0x1fe4a6[_0x1d66('0x88')]('i.id');var _0x5b86f4={'type':db['Sequelize']['QueryTypes'][_0x1d66('0x89')],'raw':!![]};var _0x423e28=_0x1fe4a6[_0x1d66('0x8a')]();_0x423e28[_0x1d66('0x47')](_0x1d66('0x8b'));_0x423e28['field'](_0x1d66('0x8c'),_0x1d66('0x5e'));if(_0x32a614[_0x1d66('0x8d')]){_0x32a614['order'][_0x1d66('0x32')](function(_0x26ef45){var _0x10fb4a=_0x26ef45[0x0]===_0x1d66('0x8e')?_0x26ef45[0x0]:'i.'+_0x26ef45[0x0];_0x1fe4a6[_0x1d66('0x8d')](_0x10fb4a,_0x26ef45[0x1]===_0x1d66('0x8f')?![]:!![]);});}if(!_[_0x1d66('0x74')](_0x32125f)){_0x1fe4a6['having'](_0x408ed5);_0x423e28[_0x1d66('0x7c')]('t.id\x20IN\x20?',_0x32125f);}BPromise[_0x1d66('0x90')]()[_0x1d66('0x34')](function(){if(!_0x17dab1){if(_0x273177[_0x1d66('0x3d')][_0x1d66('0x75')])return;_0x423e28['where'](_0x1d66('0x91'));_0x1fe4a6[_0x1d66('0x7c')](_0x1d66('0x91'));return;}if(_0x273177[_0x1d66('0x92')][_0x1d66('0x93')]!=='agent')return;return _0x273177[_0x1d66('0x92')][_0x1d66('0x94')]({'attributes':['id'],'raw':!![]})[_0x1d66('0x34')](function(_0x2cc18f){if(_[_0x1d66('0x74')](_0x2cc18f)){_0x423e28['where'](_0x1d66('0x95'));_0x1fe4a6[_0x1d66('0x7c')](_0x1d66('0x95'));}else{_0x423e28[_0x1d66('0x7c')](_0x1d66('0x76'),_['map'](_0x2cc18f,'id'));_0x1fe4a6[_0x1d66('0x7c')](_0x1d66('0x76'),_['map'](_0x2cc18f,'id'));}});})[_0x1d66('0x34')](function(){if(_0x273177[_0x1d66('0x92')][_0x1d66('0x93')]===_0x1d66('0x96')&&!_0x17dab1&&!_0x273177[_0x1d66('0x3d')][_0x1d66('0x75')])return[];return db[_0x1d66('0x97')][_0x1d66('0x3d')](_0x423e28[_0x1d66('0x98')](),_0x5b86f4);})[_0x1d66('0x34')](function(_0x38b5c7){_0x2ffa95[_0x1d66('0x25')]=_0x38b5c7[_0x1d66('0x41')];if(_0x2ffa95['count']===0x0)return[];return db['sequelize'][_0x1d66('0x3d')](_0x85acfd['toString'](),_0x5b86f4)[_0x1d66('0x34')](function(_0x54e282){_0x2143e0=_['keyBy'](_0x54e282,'id');_0x5b86f4=_[_0x1d66('0x99')](_0x5b86f4,{'model':db[_0x1d66('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x273177['query'][_0x1d66('0x40')]){_0x32a614[_0x1d66('0x3f')]['forEach'](function(_0x1f515c){_0x1fe4a6['field']('i.'+_0x1f515c);});}else{_0x1fe4a6[_0x1d66('0x47')](_0x1d66('0x8c'),_0x1d66('0x5e'));_0x1fe4a6[_0x1d66('0x47')](_0x1d66('0x9a'),_0x1d66('0x9b'));_0x1fe4a6[_0x1d66('0x47')](_0x1d66('0x9c'),_0x1d66('0x9d'));_0x1fe4a6[_0x1d66('0x47')](_0x1d66('0x9e'),_0x1d66('0x8e'));_0x1fe4a6[_0x1d66('0x47')](_0x1d66('0x9f'));_0x1fe4a6['field'](_0x1d66('0xa0'),_0x1d66('0xa1'));_0x1fe4a6['field']('c.lastName','Contact.lastName');_0x1fe4a6['field'](_0x1d66('0xa2'),_0x1d66('0xa3'));_0x1fe4a6[_0x1d66('0x47')]('c.phone',_0x1d66('0xa4'));_0x1fe4a6['field'](_0x1d66('0xa5'),_0x1d66('0xa6'));_0x1fe4a6[_0x1d66('0x47')](_0x1d66('0xa7'),_0x1d66('0xa8'));_0x1fe4a6['field'](_0x1d66('0xa9'),'Owner.fullname');_0x1fe4a6[_0x1d66('0x47')](_0x1d66('0xaa'),_0x1d66('0xab'));_0x1fe4a6[_0x1d66('0x47')](_0x1d66('0xac'),_0x1d66('0x2f'));}if(_0x32a614[_0x1d66('0x24')])_0x1fe4a6[_0x1d66('0x24')](_0x32a614['limit']);if(_0x32a614[_0x1d66('0x22')])_0x1fe4a6[_0x1d66('0x22')](_0x32a614[_0x1d66('0x22')]);return db[_0x1d66('0x97')][_0x1d66('0x3d')](_0x1fe4a6[_0x1d66('0x98')](),_0x5b86f4);})[_0x1d66('0x34')](function(_0x36af6f){if(_0x36af6f[_0x1d66('0x41')]>0x0)_0x49fdc4[_0x1d66('0x7c')](_0x1d66('0xad'),_[_0x1d66('0x37')](_0x36af6f,'id'));return db['sequelize']['query'](_0x49fdc4[_0x1d66('0x98')](),_0x5b86f4)['then'](function(_0x319ce2){var _0x4da4c6=_['groupBy'](_0x319ce2,_0x1d66('0xae'));var _0x1148d9=[];_0x36af6f[_0x1d66('0x32')](function(_0x3e00a2){_0x1148d9['push'](updateFaxInteraction(_0x3e00a2,_0x2143e0,_0x4da4c6));});return BPromise[_0x1d66('0xaf')](_0x1148d9);});});})[_0x1d66('0x34')](function(_0x182bbb){_0x2ffa95['rows']=_0x182bbb;return _0x2ffa95;})[_0x1d66('0x34')](respondWithFilteredResult(_0x322cf8,_0x32a614))[_0x1d66('0x35')](handleError(_0x322cf8,null));};exports[_0x1d66('0xb0')]=function(_0x2de2fd,_0xa050b){var _0x3a9606={'raw':![],'where':{'id':_0x2de2fd[_0x1d66('0xb1')]['id']}},_0x465975={};_0x465975[_0x1d66('0x3c')]=_['keys'](db[_0x1d66('0x38')]['rawAttributes']);_0x465975[_0x1d66('0x3d')]=_['keys'](_0x2de2fd[_0x1d66('0x3d')]);_0x465975[_0x1d66('0x45')]=_[_0x1d66('0x3e')](_0x465975[_0x1d66('0x3c')],_0x465975[_0x1d66('0x3d')]);_0x3a9606[_0x1d66('0x3f')]=_['intersection'](_0x465975[_0x1d66('0x3c')],qs[_0x1d66('0x40')](_0x2de2fd[_0x1d66('0x3d')]['fields']));_0x3a9606[_0x1d66('0x3f')]=_0x3a9606[_0x1d66('0x3f')][_0x1d66('0x41')]?_0x3a9606[_0x1d66('0x3f')]:_0x465975[_0x1d66('0x3c')];if(_0x2de2fd[_0x1d66('0x3d')][_0x1d66('0xb2')]){_0x3a9606[_0x1d66('0xb3')]=[{'all':!![]}];}_0x3a9606=_[_0x1d66('0x99')]({},_0x3a9606,_0x2de2fd[_0x1d66('0xb4')]);return db[_0x1d66('0x38')][_0x1d66('0x5d')](_0x3a9606)[_0x1d66('0x34')](handleEntityNotFound(_0xa050b,null))[_0x1d66('0x34')](respondWithResult(_0xa050b,null))[_0x1d66('0x35')](handleError(_0xa050b,null));};exports['create']=function(_0x61f241,_0xaa1173){return db['FaxInteraction']['create'](_0x61f241[_0x1d66('0x71')],{})[_0x1d66('0x34')](respondWithResult(_0xaa1173,0xc9))['catch'](handleError(_0xaa1173,null));};exports[_0x1d66('0x29')]=function(_0x36f04a,_0x672660){if(_0x36f04a[_0x1d66('0x71')]['id']){delete _0x36f04a['body']['id'];}return db[_0x1d66('0x38')][_0x1d66('0x5d')]({'where':{'id':_0x36f04a[_0x1d66('0xb1')]['id']}})[_0x1d66('0x34')](handleEntityNotFound(_0x672660,null))[_0x1d66('0x34')](saveUpdates(_0x36f04a[_0x1d66('0x71')],null))['then'](respondWithResult(_0x672660,null))['catch'](handleError(_0x672660,null));};exports[_0x1d66('0xb5')]=function(_0x47a8fc,_0x26cd16){return db[_0x1d66('0x38')][_0x1d66('0x5d')]({'where':{'id':_0x47a8fc['params']['id']}})['then'](handleEntityNotFound(_0x26cd16,null))[_0x1d66('0x34')](removeEntity(_0x26cd16,null))[_0x1d66('0x35')](handleError(_0x26cd16,null));};exports[_0x1d66('0xb6')]=function(_0x216744,_0x5e8cf3){return db[_0x1d66('0x38')]['describe']()[_0x1d66('0x34')](respondWithResult(_0x5e8cf3,null))['catch'](handleError(_0x5e8cf3,null));};exports[_0x1d66('0xb7')]=function(_0x11d4fe,_0x27cd6c,_0x58b5fa){return db[_0x1d66('0xb8')][_0x1d66('0x5d')]({'where':{'id':_0x11d4fe['params']['id']}})['then'](handleEntityNotFound(_0x27cd6c,null))[_0x1d66('0x34')](function(_0x2c2ed4){if(_0x2c2ed4){return _0x2c2ed4[_0x1d66('0xb7')](_0x11d4fe[_0x1d66('0x71')][_0x1d66('0xb9')],_[_0x1d66('0xba')](_0x11d4fe[_0x1d66('0x71')],[_0x1d66('0xb9'),'id'])||{});}})[_0x1d66('0x34')](respondWithResult(_0x27cd6c,null))[_0x1d66('0x35')](handleError(_0x27cd6c,null));};exports[_0x1d66('0xbb')]=function(_0x39d6c7,_0x3296f5,_0xebe333){var _0x261ebb={'raw':![],'where':{}};var _0x498a7f={};var _0x19c7f9={'count':0x0,'rows':[]};return db[_0x1d66('0x38')][_0x1d66('0xbc')]({'where':{'id':_0x39d6c7['params']['id']}})[_0x1d66('0x34')](handleEntityNotFound(_0x3296f5,null))[_0x1d66('0x34')](function(_0x27064d){if(_0x27064d){_0x498a7f['model']=_[_0x1d66('0xbd')](db[_0x1d66('0xb8')][_0x1d66('0xbe')]);_0x498a7f[_0x1d66('0x3d')]=_[_0x1d66('0xbd')](_0x39d6c7[_0x1d66('0x3d')]);_0x498a7f[_0x1d66('0x45')]=_[_0x1d66('0x3e')](_0x498a7f[_0x1d66('0x3c')],_0x498a7f['query']);_0x261ebb[_0x1d66('0x3f')]=_[_0x1d66('0x3e')](_0x498a7f['model'],qs[_0x1d66('0x40')](_0x39d6c7[_0x1d66('0x3d')][_0x1d66('0x40')]));_0x261ebb[_0x1d66('0x3f')]=_0x261ebb[_0x1d66('0x3f')]['length']?_0x261ebb[_0x1d66('0x3f')]:_0x498a7f['model'];if(!_0x39d6c7[_0x1d66('0x3d')]['hasOwnProperty'](_0x1d66('0x43'))){_0x261ebb['limit']=qs[_0x1d66('0x24')](_0x39d6c7['query'][_0x1d66('0x24')]);_0x261ebb['offset']=qs[_0x1d66('0x22')](_0x39d6c7[_0x1d66('0x3d')][_0x1d66('0x22')]);}_0x261ebb[_0x1d66('0x8d')]=qs[_0x1d66('0x44')](_0x39d6c7[_0x1d66('0x3d')]['sort']);_0x261ebb[_0x1d66('0x7c')]=qs[_0x1d66('0x45')](_[_0x1d66('0xbf')](_0x39d6c7[_0x1d66('0x3d')],_0x498a7f[_0x1d66('0x45')]));_0x261ebb['where'][_0x1d66('0xae')]=_0x27064d['id'];if(_0x39d6c7[_0x1d66('0x3d')][_0x1d66('0x84')]){_0x261ebb[_0x1d66('0x7c')]=_[_0x1d66('0x99')](_0x261ebb['where'],{'$or':_['map'](_0x261ebb[_0x1d66('0x3f')],function(_0x18a574){var _0x22d94b={};_0x22d94b[_0x18a574]={'$like':'%'+_0x39d6c7[_0x1d66('0x3d')][_0x1d66('0x84')]+'%'};return _0x22d94b;})});}if(_0x39d6c7['query'][_0x1d66('0x7a')]){var _0x4197a7=_0x39d6c7[_0x1d66('0x3d')]['$gte'][_0x1d66('0x31')](',');var _0xd078e6={};_0xd078e6[_0x4197a7[0x0]]={'$gte':moment(_0x4197a7[0x1])['format'](_0x1d66('0xc0'))};_0x261ebb[_0x1d66('0x7c')]=_[_0x1d66('0x99')](_0x261ebb[_0x1d66('0x7c')],_0xd078e6);}_0x261ebb=_['merge']({},_0x261ebb,_0x39d6c7[_0x1d66('0xb4')]);return db[_0x1d66('0xb8')]['count']({'where':_0x261ebb['where']})[_0x1d66('0x34')](function(_0x366404){_0x19c7f9['count']=_0x366404;if(_0x39d6c7[_0x1d66('0x3d')][_0x1d66('0xb2')]){_0x261ebb['include']=[{'all':!![]}];}return db[_0x1d66('0xb8')][_0x1d66('0xc1')](_0x261ebb);})[_0x1d66('0x34')](function(_0x810aa){_0x19c7f9['rows']=_0x810aa;return _0x19c7f9;});}})[_0x1d66('0x34')](respondWithFilteredResult(_0x3296f5,_0x261ebb))['catch'](handleError(_0x3296f5,null));};exports[_0x1d66('0xc2')]=function(_0x49d26e,_0x1984fd,_0x6cce45){return db['FaxInteraction'][_0x1d66('0x5d')]({'where':{'id':_0x49d26e[_0x1d66('0xb1')]['id']}})[_0x1d66('0x34')](handleEntityNotFound(_0x1984fd,null))[_0x1d66('0x34')](function(_0x4ad142){if(_0x4ad142){return _0x4ad142[_0x1d66('0xc3')](_0x49d26e[_0x1d66('0x71')]['ids'],_[_0x1d66('0xba')](_0x49d26e[_0x1d66('0x71')],['ids','id'])||{})['spread'](function(){return db[_0x1d66('0x6a')][_0x1d66('0xc1')]({'attributes':['id','name',_0x1d66('0x48')],'where':{'id':_0x49d26e[_0x1d66('0x71')][_0x1d66('0xb9')]}});})[_0x1d66('0x34')](function(_0x43f732){socket[_0x1d66('0xc4')](_0x1d66('0xc5'),{'id':Number(_0x49d26e[_0x1d66('0xb1')]['id']),'tags':_0x43f732||[]});return{'id':Number(_0x49d26e['params']['id']),'tags':_0x43f732||[]};});}})[_0x1d66('0x34')](respondWithResult(_0x1984fd,null))[_0x1d66('0x35')](handleError(_0x1984fd,null));};exports[_0x1d66('0xc6')]=function(_0x2653fc,_0x5d98c3,_0x1aca21){return db[_0x1d66('0x38')][_0x1d66('0x5d')]({'where':{'id':_0x2653fc[_0x1d66('0xb1')]['id']}})[_0x1d66('0x34')](handleEntityNotFound(_0x5d98c3,null))[_0x1d66('0x34')](function(_0x31f29e){if(_0x31f29e){return _0x31f29e['removeTags'](_0x2653fc[_0x1d66('0x3d')][_0x1d66('0xb9')]);}})[_0x1d66('0x34')](respondWithStatusCode(_0x5d98c3,null))[_0x1d66('0x35')](handleError(_0x5d98c3,null));};exports[_0x1d66('0xc7')]=function(_0x49b7ab,_0x217033){var _0x59f95a=moment()['unix']()[_0x1d66('0x98')]();var _0x2182de=path[_0x1d66('0xc8')](config[_0x1d66('0xc9')],_0x1d66('0xca'),_0x1d66('0xcb'),'tmp');var _0x173d9d=path['join'](config[_0x1d66('0xc9')],_0x1d66('0xca'),_0x1d66('0xcb'),_0x1d66('0xcc'));var _0x5a4a14=path[_0x1d66('0xc8')](_0x2182de,_0x59f95a);var _0x49857f=util[_0x1d66('0xcd')](_0x1d66('0xce'),_0x49b7ab[_0x1d66('0xb1')]['id'],_0x59f95a);var _0x1df3e0=path[_0x1d66('0xc8')](_0x2182de,_0x49857f);var _0x4dc970=[];_0x4dc970[_0x1d66('0x33')]({'model':db[_0x1d66('0xcf')],'as':_0x1d66('0xcf'),'raw':!![]});var _0x15b177=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id','body',_0x1d66('0x78')],'include':_0x4dc970}];return db[_0x1d66('0x38')][_0x1d66('0x5d')]({'where':{'id':_0x49b7ab[_0x1d66('0xb1')]['id']},'include':_0x15b177})['then'](handleEntityNotFound(_0x217033,null))['then'](function(_0x3c23a2){if(_0x3c23a2&&_0x3c23a2[_0x1d66('0xd0')]){var _0x35c9cb=_0x3c23a2[_0x1d66('0xd1')]({'plain':!![]});fs[_0x1d66('0xd2')](_0x5a4a14);for(var _0x3e8ff4=0x0;_0x3e8ff4<_0x35c9cb[_0x1d66('0xd0')][_0x1d66('0x41')];_0x3e8ff4++){var _0x5f559d=_0x35c9cb[_0x1d66('0xd0')][_0x3e8ff4][_0x1d66('0xcf')];if(_0x5f559d){var _0x16b2fe=path[_0x1d66('0xc8')](_0x173d9d,_0x5f559d[_0x1d66('0xd3')]);if(fs[_0x1d66('0xd4')](_0x16b2fe)){fs[_0x1d66('0xd5')](_0x16b2fe)[_0x1d66('0xd6')](fs['createWriteStream'](path[_0x1d66('0xc8')](_0x5a4a14,_0x5f559d['basename'])));}}}return BPromise['resolve']()[_0x1d66('0x34')](function(){return new BPromise(function(_0x3400d3,_0x2b178b){zipdir(_0x5a4a14,{'saveTo':_0x1df3e0},function(_0x48fa48,_0x81f535){if(_0x48fa48)return _0x2b178b(_0x48fa48);return _0x3400d3(_0x81f535);});})[_0x1d66('0x34')](function(){return new BPromise(function(_0x282ebe,_0x256577){rimraf(_0x5a4a14,function(_0x42306a){if(_0x42306a)_0x256577(_0x42306a);return _0x282ebe();});});})[_0x1d66('0x34')](function(){return _0x217033[_0x1d66('0xc7')](_0x1df3e0,_0x49857f,function(_0x158240){if(_0x158240){console[_0x1d66('0xd7')](_0x1d66('0xd8'),_0x158240);}else{fs[_0x1d66('0xd9')](_0x1df3e0);}});});});}else{return _0x217033[_0x1d66('0x2b')](0xc8);}})[_0x1d66('0x35')](handleError(_0x217033,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index e2a8bc2..c3373c8 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 _0x6123=['emit','catch','hasOwnProperty','events','../../mysqldb','FaxInteraction','setMaxListeners','save','remove','getUsers','setDataValue','Users','map','findAll','length'];(function(_0x62f1fb,_0x538480){var _0x1cc8cd=function(_0x234716){while(--_0x234716){_0x62f1fb['push'](_0x62f1fb['shift']());}};_0x1cc8cd(++_0x538480);}(_0x6123,0x1a7));var _0x3612=function(_0x5182a6,_0x34d561){_0x5182a6=_0x5182a6-0x0;var _0xdf4b41=_0x6123[_0x5182a6];return _0xdf4b41;};'use strict';var EventEmitter=require(_0x3612('0x0'));var FaxInteraction=require(_0x3612('0x1'))['db'][_0x3612('0x2')];var FaxMessage=require(_0x3612('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x3612('0x3')](0x0);var events={'afterCreate':_0x3612('0x4'),'afterUpdate':'update','afterDestroy':_0x3612('0x5')};function emitEvent(_0x5f422f){return function(_0x487bfb,_0x412c17,_0x40180a){_0x487bfb[_0x3612('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x113754){_0x487bfb[_0x3612('0x7')](_0x3612('0x8'),_0x113754[_0x3612('0x9')](function(_0x396f35){return{'id':_0x396f35['id']};}));return FaxMessage[_0x3612('0xa')]({'where':{'FaxInteractionId':_0x487bfb['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2e32a3){_0x487bfb[_0x3612('0x7')]('unreadMessages',_0x2e32a3[_0x3612('0xb')]);FaxInteractionEvents[_0x3612('0xc')](_0x5f422f+':'+_0x487bfb['id'],_0x487bfb);FaxInteractionEvents['emit'](_0x5f422f,_0x487bfb);_0x40180a(null);})[_0x3612('0xd')](_0x40180a(null));};}for(var e in events){if(events[_0x3612('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x0806=['setDataValue','Users','map','unreadMessages','length','emit','exports','events','../../mysqldb','FaxMessage','save','update','remove','getUsers','then'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x0806,0x1ab));var _0x6080=function(_0x48fb49,_0x150fd1){_0x48fb49=_0x48fb49-0x0;var _0x5441c0=_0x0806[_0x48fb49];return _0x5441c0;};'use strict';var EventEmitter=require(_0x6080('0x0'));var FaxInteraction=require(_0x6080('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x6080('0x1'))['db'][_0x6080('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6080('0x3'),'afterUpdate':_0x6080('0x4'),'afterDestroy':_0x6080('0x5')};function emitEvent(_0x32bcc2){return function(_0x473e84,_0x138177,_0x358b00){_0x473e84[_0x6080('0x6')]({'attributes':['id'],'raw':!![]})[_0x6080('0x7')](function(_0x1daae8){_0x473e84[_0x6080('0x8')](_0x6080('0x9'),_0x1daae8[_0x6080('0xa')](function(_0x4aa5e5){return{'id':_0x4aa5e5['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x473e84['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x72d7b9){_0x473e84[_0x6080('0x8')](_0x6080('0xb'),_0x72d7b9[_0x6080('0xc')]);FaxInteractionEvents[_0x6080('0xd')](_0x32bcc2+':'+_0x473e84['id'],_0x473e84);FaxInteractionEvents[_0x6080('0xd')](_0x32bcc2,_0x473e84);_0x358b00(null);})['catch'](_0x358b00(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x6080('0xe')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 514feb4..55b625b 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 _0x36a5=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','changed'];(function(_0x13a780,_0xa04108){var _0x50a464=function(_0x29404b){while(--_0x29404b){_0x13a780['push'](_0x13a780['shift']());}};_0x50a464(++_0xa04108);}(_0x36a5,0xb4));var _0x536a=function(_0x2e8f44,_0x233cd7){_0x2e8f44=_0x2e8f44-0x0;var _0x37a41e=_0x36a5[_0x2e8f44];return _0x37a41e;};'use strict';var _=require(_0x536a('0x0'));var util=require(_0x536a('0x1'));var logger=require(_0x536a('0x2'))('api');var moment=require(_0x536a('0x3'));var BPromise=require(_0x536a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x536a('0x5'));var rimraf=require('rimraf');var config=require(_0x536a('0x6'));var attributes=require(_0x536a('0x7'));module[_0x536a('0x8')]=function(_0xc5e81c,_0xbc930d){return _0xc5e81c['define'](_0x536a('0x9'),attributes,{'tableName':_0x536a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x141270,_0x14dad2,_0x576b08){if(_0x141270[_0x536a('0xb')](_0x536a('0xc'))){_0x141270[_0x536a('0xd')]=moment()[_0x536a('0xe')](_0x536a('0xf'));}_0x576b08(null,_0x141270);}}});}; \ No newline at end of file +var _0x961e=['fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','FaxInteraction'];(function(_0xfcba24,_0x119c2c){var _0x3e1d44=function(_0x1e6db2){while(--_0x1e6db2){_0xfcba24['push'](_0xfcba24['shift']());}};_0x3e1d44(++_0x119c2c);}(_0x961e,0xd2));var _0xe961=function(_0x47f37d,_0x378175){_0x47f37d=_0x47f37d-0x0;var _0x2326e7=_0x961e[_0x47f37d];return _0x2326e7;};'use strict';var _=require(_0xe961('0x0'));var util=require(_0xe961('0x1'));var logger=require(_0xe961('0x2'))(_0xe961('0x3'));var moment=require(_0xe961('0x4'));var BPromise=require(_0xe961('0x5'));var rp=require(_0xe961('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe961('0x7'));var attributes=require('./faxInteraction.attributes');module[_0xe961('0x8')]=function(_0x5c33dc,_0x4d913d){return _0x5c33dc[_0xe961('0x9')](_0xe961('0xa'),attributes,{'tableName':_0xe961('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x141fec,_0x3c9bb6,_0x21bfb1){if(_0x141fec[_0xe961('0xc')](_0xe961('0xd'))){_0x141fec[_0xe961('0xe')]=moment()[_0xe961('0xf')](_0xe961('0x10'));}_0x21bfb1(null,_0x141fec);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 1fd08c2..2f345f7 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 _0x0aa2=['FaxInteraction','update','body','options','raw','where','attributes','stringify','find','addTags','ids','spread','AddTags','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateFaxInteraction'];(function(_0x3b87f4,_0x112243){var _0x63d16e=function(_0x3e7323){while(--_0x3e7323){_0x3b87f4['push'](_0x3b87f4['shift']());}};_0x63d16e(++_0x112243);}(_0x0aa2,0xf7));var _0x20aa=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0aa2[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x20aa('0x0'));var util=require(_0x20aa('0x1'));var moment=require(_0x20aa('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(_0x20aa('0x3'));var logger=require(_0x20aa('0x4'))(_0x20aa('0x5'));var config=require(_0x20aa('0x6'));var jayson=require(_0x20aa('0x7'));var client=jayson[_0x20aa('0x8')][_0x20aa('0x9')]({'port':0x232a});config[_0x20aa('0xa')]=_['defaults'](config[_0x20aa('0xa')],{'host':_0x20aa('0xb'),'port':0x18eb});var socket=require(_0x20aa('0xc'))(new Redis(config[_0x20aa('0xa')]));require(_0x20aa('0xd'))['register'](socket);function respondWithRpcPromise(_0x5b7e1f,_0x2b60d8,_0x3c9e37){return new BPromise(function(_0x478ea7,_0x4c00ce){return client[_0x20aa('0xe')](_0x5b7e1f,_0x3c9e37)[_0x20aa('0xf')](function(_0x1067cc){logger[_0x20aa('0x10')](_0x20aa('0x11'),_0x2b60d8,_0x20aa('0x12'));logger[_0x20aa('0x13')](_0x20aa('0x14'),_0x2b60d8,'request\x20sent',JSON['stringify'](_0x1067cc));if(_0x1067cc[_0x20aa('0x15')]){if(_0x1067cc['error']['code']===0x1f4){logger['error'](_0x20aa('0x11'),_0x2b60d8,_0x1067cc[_0x20aa('0x15')][_0x20aa('0x16')]);return _0x4c00ce(_0x1067cc[_0x20aa('0x15')][_0x20aa('0x16')]);}logger[_0x20aa('0x15')](_0x20aa('0x11'),_0x2b60d8,_0x1067cc['error'][_0x20aa('0x16')]);return _0x478ea7(_0x1067cc['error'][_0x20aa('0x16')]);}else{logger[_0x20aa('0x10')](_0x20aa('0x11'),_0x2b60d8,'request\x20sent');_0x478ea7(_0x1067cc[_0x20aa('0x17')][_0x20aa('0x16')]);}})[_0x20aa('0x18')](function(_0x3c2e9e){logger['error'](_0x20aa('0x11'),_0x2b60d8,_0x3c2e9e);_0x4c00ce(_0x3c2e9e);});});}exports[_0x20aa('0x19')]=function(_0x2583f3){var _0x3b5947=this;return new Promise(function(_0x24f775,_0x590a96){return db[_0x20aa('0x1a')][_0x20aa('0x1b')](_0x2583f3[_0x20aa('0x1c')],{'raw':_0x2583f3[_0x20aa('0x1d')]?_0x2583f3[_0x20aa('0x1d')][_0x20aa('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2583f3['options']?_0x2583f3[_0x20aa('0x1d')][_0x20aa('0x1f')]||null:null,'attributes':_0x2583f3[_0x20aa('0x1d')]?_0x2583f3['options'][_0x20aa('0x20')]||null:null,'limit':_0x2583f3[_0x20aa('0x1d')]?_0x2583f3['options']['limit']||null:null})['then'](function(_0x2ad90c){logger[_0x20aa('0x10')](_0x20aa('0x19'),_0x2583f3);logger['debug'](_0x20aa('0x19'),_0x2583f3,JSON[_0x20aa('0x21')](_0x2ad90c));_0x24f775(_0x2ad90c);})[_0x20aa('0x18')](function(_0x4b403d){logger[_0x20aa('0x15')](_0x20aa('0x19'),_0x4b403d[_0x20aa('0x16')],_0x2583f3);_0x590a96(_0x3b5947[_0x20aa('0x15')](0x1f4,_0x4b403d[_0x20aa('0x16')]));});});};exports['AddTagsToFaxInteraction']=function(_0x126f75){return new Promise(function(_0x309b0e,_0x3c8ab0){return db['FaxInteraction'][_0x20aa('0x22')]({'where':_0x126f75[_0x20aa('0x1d')]?_0x126f75[_0x20aa('0x1d')][_0x20aa('0x1f')]||null:null})[_0x20aa('0xf')](function(_0x246943){if(_0x246943){return _0x246943[_0x20aa('0x23')](_0x126f75[_0x20aa('0x1c')]['ids'],_['omit'](_0x126f75[_0x20aa('0x1c')],[_0x20aa('0x24'),'id'])||{});}})[_0x20aa('0x25')](function(_0x126ffc){logger['info'](_0x20aa('0x26'),_0x126f75);logger[_0x20aa('0x13')](_0x20aa('0x26'),_0x126f75,JSON[_0x20aa('0x21')](_0x126ffc));_0x309b0e(_0x126ffc);})[_0x20aa('0x18')](function(_0xac1a4e){logger[_0x20aa('0x15')]('AddTags',_0xac1a4e['message'],_0x126f75);_0x3c8ab0(_this[_0x20aa('0x15')](0x1f4,_0xac1a4e[_0x20aa('0x16')]));});});}; \ No newline at end of file +var _0xfe89=['../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','./faxInteraction.socket','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','update','body','options','raw','attributes','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','FaxInteraction','find','where','then','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe89,0xf6));var _0x9fe8=function(_0xb45bd5,_0x18706c){_0xb45bd5=_0xb45bd5-0x0;var _0x262459=_0xfe89[_0xb45bd5];return _0x262459;};'use strict';var _=require(_0x9fe8('0x0'));var util=require(_0x9fe8('0x1'));var moment=require('moment');var BPromise=require(_0x9fe8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9fe8('0x3'));var db=require(_0x9fe8('0x4'))['db'];var utils=require(_0x9fe8('0x5'));var logger=require(_0x9fe8('0x6'))(_0x9fe8('0x7'));var config=require('../../config/environment');var jayson=require(_0x9fe8('0x8'));var client=jayson['client'][_0x9fe8('0x9')]({'port':0x232a});config[_0x9fe8('0xa')]=_[_0x9fe8('0xb')](config[_0x9fe8('0xa')],{'host':_0x9fe8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9fe8('0xa')]));require(_0x9fe8('0xd'))['register'](socket);function respondWithRpcPromise(_0x78c990,_0x4b31e2,_0x36c371){return new BPromise(function(_0x1d03db,_0x2bb47f){return client['request'](_0x78c990,_0x36c371)['then'](function(_0x5bc563){logger['info'](_0x9fe8('0xe'),_0x4b31e2,_0x9fe8('0xf'));logger[_0x9fe8('0x10')](_0x9fe8('0x11'),_0x4b31e2,'request\x20sent',JSON[_0x9fe8('0x12')](_0x5bc563));if(_0x5bc563['error']){if(_0x5bc563[_0x9fe8('0x13')][_0x9fe8('0x14')]===0x1f4){logger[_0x9fe8('0x13')](_0x9fe8('0xe'),_0x4b31e2,_0x5bc563['error']['message']);return _0x2bb47f(_0x5bc563[_0x9fe8('0x13')]['message']);}logger[_0x9fe8('0x13')](_0x9fe8('0xe'),_0x4b31e2,_0x5bc563['error'][_0x9fe8('0x15')]);return _0x1d03db(_0x5bc563[_0x9fe8('0x13')][_0x9fe8('0x15')]);}else{logger[_0x9fe8('0x16')](_0x9fe8('0xe'),_0x4b31e2,_0x9fe8('0xf'));_0x1d03db(_0x5bc563[_0x9fe8('0x17')][_0x9fe8('0x15')]);}})[_0x9fe8('0x18')](function(_0x387de9){logger[_0x9fe8('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x4b31e2,_0x387de9);_0x2bb47f(_0x387de9);});});}exports['UpdateFaxInteraction']=function(_0x11140b){var _0x25b385=this;return new Promise(function(_0x2ebf3e,_0x218e0c){return db['FaxInteraction'][_0x9fe8('0x19')](_0x11140b[_0x9fe8('0x1a')],{'raw':_0x11140b[_0x9fe8('0x1b')]?_0x11140b['options'][_0x9fe8('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11140b['options']?_0x11140b[_0x9fe8('0x1b')]['where']||null:null,'attributes':_0x11140b[_0x9fe8('0x1b')]?_0x11140b[_0x9fe8('0x1b')][_0x9fe8('0x1d')]||null:null,'limit':_0x11140b[_0x9fe8('0x1b')]?_0x11140b[_0x9fe8('0x1b')][_0x9fe8('0x1e')]||null:null})['then'](function(_0x4eb28a){logger[_0x9fe8('0x16')](_0x9fe8('0x1f'),_0x11140b);logger[_0x9fe8('0x10')](_0x9fe8('0x1f'),_0x11140b,JSON[_0x9fe8('0x12')](_0x4eb28a));_0x2ebf3e(_0x4eb28a);})[_0x9fe8('0x18')](function(_0x9bcce2){logger[_0x9fe8('0x13')](_0x9fe8('0x1f'),_0x9bcce2[_0x9fe8('0x15')],_0x11140b);_0x218e0c(_0x25b385['error'](0x1f4,_0x9bcce2[_0x9fe8('0x15')]));});});};exports[_0x9fe8('0x20')]=function(_0x495a25){return new Promise(function(_0x32304e,_0x2b417b){return db[_0x9fe8('0x21')][_0x9fe8('0x22')]({'where':_0x495a25['options']?_0x495a25['options'][_0x9fe8('0x23')]||null:null})[_0x9fe8('0x24')](function(_0x5a7f7c){if(_0x5a7f7c){return _0x5a7f7c[_0x9fe8('0x25')](_0x495a25[_0x9fe8('0x1a')][_0x9fe8('0x26')],_[_0x9fe8('0x27')](_0x495a25[_0x9fe8('0x1a')],[_0x9fe8('0x26'),'id'])||{});}})[_0x9fe8('0x28')](function(_0x54a368){logger['info'](_0x9fe8('0x29'),_0x495a25);logger[_0x9fe8('0x10')](_0x9fe8('0x29'),_0x495a25,JSON[_0x9fe8('0x12')](_0x54a368));_0x32304e(_0x54a368);})[_0x9fe8('0x18')](function(_0x454dd5){logger[_0x9fe8('0x13')](_0x9fe8('0x29'),_0x454dd5[_0x9fe8('0x15')],_0x495a25);_0x2b417b(_this[_0x9fe8('0x13')](0x1f4,_0x454dd5[_0x9fe8('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 4074dca..4ee1482 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 _0xf7a4=['emit','removeListener','register','length','faxInteraction:','update'];(function(_0x11e08a,_0x4e068a){var _0x143ddb=function(_0x307058){while(--_0x307058){_0x11e08a['push'](_0x11e08a['shift']());}};_0x143ddb(++_0x4e068a);}(_0xf7a4,0x185));var _0x4f7a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xf7a4[_0x565ed7];return _0x183ad7;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save','remove',_0x4f7a('0x0')];function createListener(_0xcd1d48,_0x7a2959){return function(_0x19c3ea){_0x7a2959[_0x4f7a('0x1')](_0xcd1d48,_0x19c3ea);};}function removeListener(_0x39a31b,_0x17cd98){return function(){FaxInteractionEvents[_0x4f7a('0x2')](_0x39a31b,_0x17cd98);};}exports[_0x4f7a('0x3')]=function(_0x45f684){for(var _0x38fcfe=0x0,_0x3cce64=events[_0x4f7a('0x4')];_0x38fcfe<_0x3cce64;_0x38fcfe++){var _0x5703b3=events[_0x38fcfe];var _0x959256=createListener(_0x4f7a('0x5')+_0x5703b3,_0x45f684);FaxInteractionEvents['on'](_0x5703b3,_0x959256);}}; \ No newline at end of file +var _0x0a18=['register','faxInteraction:','save','remove','update','emit'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x0a18,0x74));var _0x80a1=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x0a18[_0x486f4a];return _0x135d99;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x80a1('0x0'),_0x80a1('0x1'),_0x80a1('0x2')];function createListener(_0x39287f,_0x4341f6){return function(_0x401bdb){_0x4341f6[_0x80a1('0x3')](_0x39287f,_0x401bdb);};}function removeListener(_0x238267,_0x2c7e91){return function(){FaxInteractionEvents['removeListener'](_0x238267,_0x2c7e91);};}exports[_0x80a1('0x4')]=function(_0x216dcb){for(var _0x701e27=0x0,_0x295760=events['length'];_0x701e27<_0x295760;_0x701e27++){var _0x11a271=events[_0x701e27];var _0x231c22=createListener(_0x80a1('0x5')+_0x11a271,_0x216dcb);FaxInteractionEvents['on'](_0x11a271,_0x231c22);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 9ee813c..586eb82 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 _0x684d=['/:id','show','/:id/messages','getMessages','download','create','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','update','delete','faxinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe'];(function(_0xe1593e,_0x9967ab){var _0x3e558a=function(_0x1e699d){while(--_0x1e699d){_0xe1593e['push'](_0xe1593e['shift']());}};_0x3e558a(++_0x9967ab);}(_0x684d,0x174));var _0xd684=function(_0x8b3b4,_0x4b901f){_0x8b3b4=_0x8b3b4-0x0;var _0x479bcb=_0x684d[_0x8b3b4];return _0x479bcb;};'use strict';var multer=require('multer');var util=require(_0xd684('0x0'));var path=require(_0xd684('0x1'));var timeout=require(_0xd684('0x2'));var express=require('express');var router=express[_0xd684('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd684('0x4'));var interaction=require(_0xd684('0x5'));var config=require(_0xd684('0x6'));var controller=require('./faxInteraction.controller');router[_0xd684('0x7')]('/',auth['isAuthenticated'](),controller[_0xd684('0x8')]);router['get'](_0xd684('0x9'),auth[_0xd684('0xa')](),controller[_0xd684('0xb')]);router['get'](_0xd684('0xc'),auth['isAuthenticated'](),controller[_0xd684('0xd')]);router[_0xd684('0x7')](_0xd684('0xe'),auth[_0xd684('0xa')](),controller[_0xd684('0xf')]);router['get']('/:id/download',auth[_0xd684('0xa')](),controller[_0xd684('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd684('0x11')]);router[_0xd684('0x12')]('/:id/messages',auth[_0xd684('0xa')](),controller[_0xd684('0x13')]);router[_0xd684('0x12')](_0xd684('0x14'),auth[_0xd684('0xa')](),interaction[_0xd684('0x15')](_0xd684('0x16'),_0xd684('0x17')),controller[_0xd684('0x18')]);router[_0xd684('0x19')]('/:id',auth[_0xd684('0xa')](),interaction['tracked'](_0xd684('0x16'),'faxinteraction:update'),controller[_0xd684('0x1a')]);router[_0xd684('0x1b')](_0xd684('0xc'),auth[_0xd684('0xa')](),interaction[_0xd684('0x15')](_0xd684('0x16'),_0xd684('0x1c')),controller[_0xd684('0x1d')]);router[_0xd684('0x1b')](_0xd684('0x14'),auth[_0xd684('0xa')](),controller[_0xd684('0x1e')]);module[_0xd684('0x1f')]=router; \ No newline at end of file +var _0x7859=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','tracked','faxinteraction:destroy','destroy','/:id/tags','multer'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x7859,0x1ef));var _0x9785=function(_0x529592,_0x911272){_0x529592=_0x529592-0x0;var _0x5dfe7e=_0x7859[_0x529592];return _0x5dfe7e;};'use strict';var multer=require(_0x9785('0x0'));var util=require(_0x9785('0x1'));var path=require(_0x9785('0x2'));var timeout=require(_0x9785('0x3'));var express=require(_0x9785('0x4'));var router=express[_0x9785('0x5')]();var fs_extra=require(_0x9785('0x6'));var auth=require(_0x9785('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9785('0x8'));var controller=require(_0x9785('0x9'));router[_0x9785('0xa')]('/',auth[_0x9785('0xb')](),controller[_0x9785('0xc')]);router[_0x9785('0xa')]('/describe',auth[_0x9785('0xb')](),controller[_0x9785('0xd')]);router['get'](_0x9785('0xe'),auth['isAuthenticated'](),controller[_0x9785('0xf')]);router['get'](_0x9785('0x10'),auth[_0x9785('0xb')](),controller[_0x9785('0x11')]);router['get'](_0x9785('0x12'),auth[_0x9785('0xb')](),controller['download']);router[_0x9785('0x13')]('/',auth[_0x9785('0xb')](),controller['create']);router[_0x9785('0x13')]('/:id/messages',auth[_0x9785('0xb')](),controller['addMessage']);router['post']('/:id/tags',auth[_0x9785('0xb')](),interaction['tracked'](_0x9785('0x14'),_0x9785('0x15')),controller[_0x9785('0x16')]);router[_0x9785('0x17')](_0x9785('0xe'),auth[_0x9785('0xb')](),interaction['tracked'](_0x9785('0x14'),_0x9785('0x18')),controller[_0x9785('0x19')]);router[_0x9785('0x1a')](_0x9785('0xe'),auth[_0x9785('0xb')](),interaction[_0x9785('0x1b')](_0x9785('0x14'),_0x9785('0x1c')),controller[_0x9785('0x1d')]);router[_0x9785('0x1a')](_0x9785('0x1e'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index ed1f95b..44c6fbd 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 _0xdd0c=['ENUM','out','DATE','exports','TEXT','medium'];(function(_0x3c3698,_0x54c21a){var _0x50b9ae=function(_0x1625d0){while(--_0x1625d0){_0x3c3698['push'](_0x3c3698['shift']());}};_0x50b9ae(++_0x54c21a);}(_0xdd0c,0x165));var _0xcdd0=function(_0x5eb03c,_0x24da35){_0x5eb03c=_0x5eb03c-0x0;var _0x2ae159=_0xdd0c[_0x5eb03c];return _0x2ae159;};'use strict';var Sequelize=require('sequelize');module[_0xcdd0('0x0')]={'body':{'type':Sequelize[_0xcdd0('0x1')](_0xcdd0('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xcdd0('0x3')]('in','out'),'defaultValue':_0xcdd0('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xcdd0('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xcdd0('0x5')]}}; \ No newline at end of file +var _0xa9e0=['ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x419a27,_0x36be0b){var _0x458466=function(_0x447e78){while(--_0x447e78){_0x419a27['push'](_0x419a27['shift']());}};_0x458466(++_0x36be0b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'body':{'type':Sequelize[_0x0a9e('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0a9e('0x3')]('in','out'),'defaultValue':_0x0a9e('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x0a9e('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index d72e146..5fc2631 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 _0x047c=['sequelize','Sequelize','SELECT','contact','fullname','manual','SIP/%s','channel','event','EventManager','acceptmessage','reject','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','interface','create','CmContact','findOne','isNil','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','server','files','join','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../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','./faxMessage.socket','jayson/promise','http','client','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','FaxMessage,\x20%s,\x20%s','message','sendStatus','end','status','json','offset','limit','undefined','set','Content-Range','apply','save','update','then','destroy','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','FaxMessage','count','includeAll','include','findAll','show','params','options','find','catch','body','describe','fax-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteractionId','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','acceptMessage','ContactId'];(function(_0x794140,_0x58fa52){var _0x1dc632=function(_0x24d181){while(--_0x24d181){_0x794140['push'](_0x794140['shift']());}};_0x1dc632(++_0x58fa52);}(_0x047c,0x137));var _0xc047=function(_0x32a52d,_0x7e159f){_0x32a52d=_0x32a52d-0x0;var _0x15a25c=_0x047c[_0x32a52d];return _0x15a25c;};'use strict';var emlformat=require(_0xc047('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc047('0x1'));var rp=require('request-promise');var moment=require(_0xc047('0x2'));var BPromise=require(_0xc047('0x3'));var Mustache=require(_0xc047('0x4'));var util=require(_0xc047('0x5'));var path=require(_0xc047('0x6'));var sox=require('sox');var csv=require(_0xc047('0x7'));var ejs=require(_0xc047('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc047('0x9'));var jsforce=require(_0xc047('0xa'));var deskjs=require(_0xc047('0xb'));var toCsv=require(_0xc047('0x7'));var querystring=require(_0xc047('0xc'));var Papa=require(_0xc047('0xd'));var Redis=require('ioredis');var authService=require(_0xc047('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc047('0xf'));var hardwareService=require(_0xc047('0x10'));var logger=require(_0xc047('0x11'))(_0xc047('0x12'));var utils=require(_0xc047('0x13'));var config=require(_0xc047('0x14'));var licenseUtil=require(_0xc047('0x15'));var db=require(_0xc047('0x16'))['db'];config[_0xc047('0x17')]=_[_0xc047('0x18')](config[_0xc047('0x17')],{'host':_0xc047('0x19'),'port':0x18eb});var socket=require(_0xc047('0x1a'))(new Redis(config[_0xc047('0x17')]));require(_0xc047('0x1b'))['register'](socket);var jayson=require(_0xc047('0x1c'));var client=jayson['client'][_0xc047('0x1d')]({'port':0x232c});var client9002=jayson[_0xc047('0x1e')][_0xc047('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3a07dd,_0x4c7ceb,_0x185135,_0x42a99d){return new BPromise(function(_0x40221a,_0xf9b322){var _0x10008a=_0x42a99d||client;return _0x10008a[_0xc047('0x1f')](_0x3a07dd,_0x185135)['then'](function(_0x31ea40){logger[_0xc047('0x20')]('FaxMessage,\x20%s,\x20%s',_0x4c7ceb,_0xc047('0x21'));logger[_0xc047('0x22')](_0xc047('0x23'),_0x4c7ceb,_0xc047('0x21'),JSON[_0xc047('0x24')](_0x31ea40));if(_0x31ea40['error']){if(_0x31ea40[_0xc047('0x25')]['code']===0x1f4){logger[_0xc047('0x25')](_0xc047('0x26'),_0x4c7ceb,_0x31ea40[_0xc047('0x25')][_0xc047('0x27')]);return _0xf9b322(_0x31ea40[_0xc047('0x25')]['message']);}logger[_0xc047('0x25')](_0xc047('0x26'),_0x4c7ceb,_0x31ea40[_0xc047('0x25')]['message']);return _0x40221a(_0x31ea40[_0xc047('0x25')]['message']);}else{logger[_0xc047('0x20')]('FaxMessage,\x20%s,\x20%s',_0x4c7ceb,_0xc047('0x21'));_0x40221a(_0x31ea40['result'][_0xc047('0x27')]);}})['catch'](function(_0x4a130e){logger[_0xc047('0x25')]('FaxMessage,\x20%s,\x20%s',_0x4c7ceb,_0x4a130e);_0xf9b322(_0x4a130e);});});}function respondWithStatusCode(_0x335fa3,_0x217e97){_0x217e97=_0x217e97||0xcc;return function(_0x11f15c){if(_0x11f15c){return _0x335fa3[_0xc047('0x28')](_0x217e97);}return _0x335fa3['status'](_0x217e97)[_0xc047('0x29')]();};}function respondWithResult(_0x4e4bed,_0x426ec9){_0x426ec9=_0x426ec9||0xc8;return function(_0x32c689){if(_0x32c689){return _0x4e4bed[_0xc047('0x2a')](_0x426ec9)[_0xc047('0x2b')](_0x32c689);}};}function respondWithFilteredResult(_0x115db,_0x24814a){return function(_0x2fa789){if(_0x2fa789){var _0x198b5c=typeof _0x24814a[_0xc047('0x2c')]==='undefined'&&typeof _0x24814a[_0xc047('0x2d')]===_0xc047('0x2e');var _0x26feeb=_0x2fa789['count'];var _0x387643=_0x198b5c?0x0:_0x24814a['offset'];var _0x547224=_0x198b5c?_0x2fa789['count']:_0x24814a['offset']+_0x24814a[_0xc047('0x2d')];var _0x4fcdbd;if(_0x547224>=_0x26feeb){_0x547224=_0x26feeb;_0x4fcdbd=0xc8;}else{_0x4fcdbd=0xce;}_0x115db[_0xc047('0x2a')](_0x4fcdbd);return _0x115db[_0xc047('0x2f')](_0xc047('0x30'),_0x387643+'-'+_0x547224+'/'+_0x26feeb)['json'](_0x2fa789);}return null;};}function patchUpdates(_0x453484){return function(_0x94cef5){try{jsonpatch[_0xc047('0x31')](_0x94cef5,_0x453484,!![]);}catch(_0x4ebbfa){return BPromise['reject'](_0x4ebbfa);}return _0x94cef5[_0xc047('0x32')]();};}function saveUpdates(_0x11cd29,_0x5769d9){return function(_0x5388f8){if(_0x5388f8){return _0x5388f8[_0xc047('0x33')](_0x11cd29)[_0xc047('0x34')](function(_0x54686e){return _0x54686e;});}return null;};}function removeEntity(_0x4718e1,_0x2d2389){return function(_0xe35fe6){if(_0xe35fe6){return _0xe35fe6[_0xc047('0x35')]()[_0xc047('0x34')](function(){_0x4718e1[_0xc047('0x2a')](0xcc)[_0xc047('0x29')]();});}};}function handleEntityNotFound(_0x30aa83,_0x503944){return function(_0x5617e4){if(!_0x5617e4){_0x30aa83[_0xc047('0x28')](0x194);}return _0x5617e4;};}function handleError(_0x1b50ab,_0x543b54){_0x543b54=_0x543b54||0x1f4;return function(_0x46dadb){logger['error'](_0x46dadb[_0xc047('0x36')]);if(_0x46dadb[_0xc047('0x37')]){delete _0x46dadb['name'];}_0x1b50ab['status'](_0x543b54)[_0xc047('0x38')](_0x46dadb);};}exports['index']=function(_0x646480,_0xbcf2bd){var _0x4b456={},_0x124910={},_0x2a82f6={'count':0x0,'rows':[]};var _0x556e5a=_['map'](db['FaxMessage'][_0xc047('0x39')],function(_0x3b2fd3){return{'name':_0x3b2fd3[_0xc047('0x3a')],'type':_0x3b2fd3[_0xc047('0x3b')][_0xc047('0x3c')]};});_0x124910[_0xc047('0x3d')]=_[_0xc047('0x3e')](_0x556e5a,'name');_0x124910[_0xc047('0x3f')]=_[_0xc047('0x40')](_0x646480[_0xc047('0x3f')]);_0x124910[_0xc047('0x41')]=_[_0xc047('0x42')](_0x124910[_0xc047('0x3d')],_0x124910[_0xc047('0x3f')]);_0x4b456['attributes']=_['intersection'](_0x124910[_0xc047('0x3d')],qs[_0xc047('0x43')](_0x646480['query'][_0xc047('0x43')]));_0x4b456[_0xc047('0x44')]=_0x4b456[_0xc047('0x44')][_0xc047('0x45')]?_0x4b456[_0xc047('0x44')]:_0x124910[_0xc047('0x3d')];if(!_0x646480[_0xc047('0x3f')][_0xc047('0x46')](_0xc047('0x47'))){_0x4b456['limit']=qs[_0xc047('0x2d')](_0x646480[_0xc047('0x3f')]['limit']);_0x4b456[_0xc047('0x2c')]=qs[_0xc047('0x2c')](_0x646480[_0xc047('0x3f')][_0xc047('0x2c')]);}_0x4b456[_0xc047('0x48')]=qs['sort'](_0x646480[_0xc047('0x3f')]['sort']);_0x4b456[_0xc047('0x49')]=qs[_0xc047('0x41')](_[_0xc047('0x4a')](_0x646480[_0xc047('0x3f')],_0x124910[_0xc047('0x41')]),_0x556e5a);if(_0x646480['query'][_0xc047('0x4b')]){_0x4b456[_0xc047('0x49')]=_[_0xc047('0x4c')](_0x4b456['where'],{'$or':_[_0xc047('0x3e')](_0x556e5a,function(_0x39569c){if(_0x39569c[_0xc047('0x3b')]!==_0xc047('0x4d')){var _0x3061fe={};_0x3061fe[_0x39569c['name']]={'$like':'%'+_0x646480[_0xc047('0x3f')][_0xc047('0x4b')]+'%'};return _0x3061fe;}})});}_0x4b456=_[_0xc047('0x4c')]({},_0x4b456,_0x646480['options']);var _0x574622={'where':_0x4b456['where']};return db[_0xc047('0x4e')][_0xc047('0x4f')](_0x574622)[_0xc047('0x34')](function(_0x14dafc){_0x2a82f6[_0xc047('0x4f')]=_0x14dafc;if(_0x646480[_0xc047('0x3f')][_0xc047('0x50')]){_0x4b456[_0xc047('0x51')]=[{'all':!![]}];}return db[_0xc047('0x4e')][_0xc047('0x52')](_0x4b456);})[_0xc047('0x34')](function(_0x4e5b8d){_0x2a82f6['rows']=_0x4e5b8d;return _0x2a82f6;})[_0xc047('0x34')](respondWithFilteredResult(_0xbcf2bd,_0x4b456))['catch'](handleError(_0xbcf2bd,null));};exports[_0xc047('0x53')]=function(_0x4c5be3,_0x5050f8){var _0xaa578b={'raw':!![],'where':{'id':_0x4c5be3[_0xc047('0x54')]['id']}},_0x575854={};_0x575854[_0xc047('0x3d')]=_[_0xc047('0x40')](db[_0xc047('0x4e')][_0xc047('0x39')]);_0x575854[_0xc047('0x3f')]=_[_0xc047('0x40')](_0x4c5be3[_0xc047('0x3f')]);_0x575854[_0xc047('0x41')]=_[_0xc047('0x42')](_0x575854['model'],_0x575854[_0xc047('0x3f')]);_0xaa578b[_0xc047('0x44')]=_[_0xc047('0x42')](_0x575854[_0xc047('0x3d')],qs[_0xc047('0x43')](_0x4c5be3[_0xc047('0x3f')][_0xc047('0x43')]));_0xaa578b[_0xc047('0x44')]=_0xaa578b[_0xc047('0x44')][_0xc047('0x45')]?_0xaa578b['attributes']:_0x575854['model'];if(_0x4c5be3[_0xc047('0x3f')]['includeAll']){_0xaa578b[_0xc047('0x51')]=[{'all':!![]}];}_0xaa578b=_[_0xc047('0x4c')]({},_0xaa578b,_0x4c5be3[_0xc047('0x55')]);return db['FaxMessage'][_0xc047('0x56')](_0xaa578b)[_0xc047('0x34')](handleEntityNotFound(_0x5050f8,null))[_0xc047('0x34')](respondWithResult(_0x5050f8,null))[_0xc047('0x57')](handleError(_0x5050f8,null));};exports['update']=function(_0x210123,_0x119a91){if(_0x210123[_0xc047('0x58')]['id']){delete _0x210123[_0xc047('0x58')]['id'];}return db[_0xc047('0x4e')][_0xc047('0x56')]({'where':{'id':_0x210123[_0xc047('0x54')]['id']}})[_0xc047('0x34')](handleEntityNotFound(_0x119a91,null))[_0xc047('0x34')](saveUpdates(_0x210123[_0xc047('0x58')],null))['then'](respondWithResult(_0x119a91,null))[_0xc047('0x57')](handleError(_0x119a91,null));};exports['destroy']=function(_0x2606ee,_0x698c99){return db['FaxMessage'][_0xc047('0x56')]({'where':{'id':_0x2606ee[_0xc047('0x54')]['id']}})[_0xc047('0x34')](handleEntityNotFound(_0x698c99,null))['then'](removeEntity(_0x698c99,null))[_0xc047('0x57')](handleError(_0x698c99,null));};exports[_0xc047('0x59')]=function(_0x41c978,_0x289a64){return db['FaxMessage']['describe']()[_0xc047('0x34')](respondWithResult(_0x289a64,null))['catch'](handleError(_0x289a64,null));};var interaction_log=require(_0xc047('0x11'))(_0xc047('0x5a'));exports[_0xc047('0x5b')]=function(_0x442c76,_0x4f42ce,_0x3c59a5){var _0x2fdacb={'agent':{},'channel':'fax'};if(_0x442c76[_0xc047('0x58')]['id']){delete _0x442c76[_0xc047('0x58')]['id'];}_0x442c76[_0xc047('0x58')][_0xc047('0x5c')]=!![];_0x442c76['body']['readAt']=moment()[_0xc047('0x5d')](_0xc047('0x5e'));_0x442c76[_0xc047('0x58')][_0xc047('0x5f')]=_0x442c76[_0xc047('0x58')][_0xc047('0x5f')]||_0x442c76['user']['id'];_0x2fdacb[_0xc047('0x60')]['id']=_0x442c76[_0xc047('0x58')]['UserId'];return db[_0xc047('0x4e')]['find']({'where':{'id':_0x442c76['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4f42ce,null))[_0xc047('0x34')](saveUpdates(_0x442c76[_0xc047('0x58')],null))[_0xc047('0x34')](function(_0x1a0e77){if(_0x1a0e77){_0x2fdacb[_0xc047('0x27')]=_0x1a0e77[_0xc047('0x61')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x1a0e77[_0xc047('0x62')]}});}return null;})[_0xc047('0x34')](handleEntityNotFound(_0x4f42ce,null))[_0xc047('0x34')](function(_0x5dce5c){if(_0x5dce5c){return _0x5dce5c['update']({'UserId':_0x442c76[_0xc047('0x58')][_0xc047('0x5f')],'read1stAt':_['isNil'](_0x5dce5c[_0xc047('0x63')])?moment()[_0xc047('0x5d')](_0xc047('0x5e')):undefined});}return null;})[_0xc047('0x34')](function(_0x15ec9d){if(_0x15ec9d){_0x2fdacb['interaction']=_0x15ec9d['get']({'plain':!![]});interaction_log[_0xc047('0x20')](_0xc047('0x64'),_0x442c76['user']['id'],_0x442c76['user'][_0xc047('0x37')],_0x442c76[_0xc047('0x65')][_0xc047('0x66')],_0x2fdacb[_0xc047('0x67')]['id'],_0x442c76[_0xc047('0x58')]?JSON['stringify'](_0x442c76['body']):'null');return respondWithRpcPromise('AcceptMessage',_0xc047('0x68'),_0x2fdacb);}return null;})[_0xc047('0x34')](function(_0x441dd8){var _0x4d90d9='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x441dd8[_0xc047('0x27')][_0xc047('0x69')];return db[_0xc047('0x6a')][_0xc047('0x3f')](_0x4d90d9,{'type':db[_0xc047('0x6b')]['QueryTypes'][_0xc047('0x6c')],'raw':!![]})[_0xc047('0x34')](function(_0x2c7068){return _0x2c7068;});})[_0xc047('0x34')](function(_0x46aafc){if(_0x46aafc){_0x2fdacb[_0xc047('0x27')][_0xc047('0x6d')]=_0x46aafc[0x0];if(!_0x442c76[_0xc047('0x58')][_0xc047('0x5f')])return;return db['User'][_0xc047('0x56')]({'where':{'id':_0x442c76['body'][_0xc047('0x5f')],'role':_0xc047('0x60')},'attributes':['id','name',_0xc047('0x6e'),'email','internal'],'raw':!![]});}return null;})[_0xc047('0x34')](function(_0x554963){if(!_0x554963)return null;_0x2fdacb[_0xc047('0x27')][_0xc047('0x60')]=_0x554963;return _0x2fdacb;})[_0xc047('0x34')](function(_0x22a40d){if(_0x22a40d){if(_0x442c76[_0xc047('0x58')][_0xc047('0x6f')]){_0x2fdacb[_0xc047('0x27')]['interface']=util[_0xc047('0x5d')](_0xc047('0x70'),_0x442c76[_0xc047('0x65')][_0xc047('0x37')]);_0x2fdacb['message'][_0xc047('0x71')]=_0x2fdacb[_0xc047('0x71')];_0x2fdacb['message']['motionChannel']=_0x2fdacb[_0xc047('0x71')];_0x2fdacb[_0xc047('0x27')][_0xc047('0x72')]='accept';return respondWithRpcPromise(_0xc047('0x73'),_0xc047('0x73'),{'event':_0xc047('0x74'),'message':_0x2fdacb[_0xc047('0x27')]},client9002)[_0xc047('0x34')](function(){return _0x2fdacb;});}return _0x2fdacb;}return null;})[_0xc047('0x34')](respondWithResult(_0x4f42ce,null))[_0xc047('0x57')](handleError(_0x4f42ce,null));};var interaction_log=require(_0xc047('0x11'))(_0xc047('0x5a'));exports[_0xc047('0x75')]=function(_0x4e925d,_0x39e62b,_0x5dac26){var _0x27c118={'agent':{},'channel':_0xc047('0x76')};if(_0x4e925d[_0xc047('0x58')]['id']){delete _0x4e925d['body']['id'];}_0x4e925d['body']['UserId']=_0x4e925d[_0xc047('0x58')][_0xc047('0x5f')]||_0x4e925d['user']['id'];_0x27c118[_0xc047('0x60')]['id']=_0x4e925d[_0xc047('0x58')][_0xc047('0x5f')];return db['FaxMessage'][_0xc047('0x56')]({'where':{'id':_0x4e925d[_0xc047('0x54')]['id'],'UserId':null}})[_0xc047('0x34')](handleEntityNotFound(_0x39e62b,null))[_0xc047('0x34')](function(_0x3952a9){if(_0x3952a9){_0x27c118[_0xc047('0x27')]=_0x3952a9[_0xc047('0x61')]({'plain':!![]});return db['FaxInteraction'][_0xc047('0x56')]({'where':{'id':_0x3952a9[_0xc047('0x62')]}});}return null;})[_0xc047('0x34')](handleEntityNotFound(_0x39e62b,null))[_0xc047('0x34')](function(_0xdb97ea){if(_0xdb97ea){_0x27c118[_0xc047('0x67')]=_0xdb97ea[_0xc047('0x61')]({'plain':!![]});interaction_log[_0xc047('0x20')](_0xc047('0x77'),_0x4e925d[_0xc047('0x65')]['id'],_0x4e925d[_0xc047('0x65')]['name'],_0x4e925d[_0xc047('0x65')][_0xc047('0x66')],_0x27c118['interaction']['id'],_0x4e925d[_0xc047('0x58')]?JSON[_0xc047('0x24')](_0x4e925d[_0xc047('0x58')]):'null');return respondWithRpcPromise(_0xc047('0x78'),_0xc047('0x79'),_0x27c118);}return null;})[_0xc047('0x34')](function(_0x30e881){var _0x1ff7a9=_0xc047('0x7a')+_0x30e881[_0xc047('0x27')][_0xc047('0x69')];return db[_0xc047('0x6a')][_0xc047('0x3f')](_0x1ff7a9,{'type':db[_0xc047('0x6b')]['QueryTypes']['SELECT'],'raw':!![]})[_0xc047('0x34')](function(_0x908350){return _0x908350;});})['then'](function(_0x4e6ba1){if(_0x4e6ba1){_0x27c118['message'][_0xc047('0x6d')]=_0x4e6ba1[0x0];if(!_0x4e925d[_0xc047('0x58')]['UserId'])return;return db['User'][_0xc047('0x56')]({'where':{'id':_0x4e925d[_0xc047('0x58')]['UserId'],'role':_0xc047('0x60')},'attributes':['id',_0xc047('0x37'),'fullname','email',_0xc047('0x7b')],'raw':!![]});}return null;})[_0xc047('0x34')](function(_0x144187){if(!_0x144187)return null;_0x27c118[_0xc047('0x27')]['agent']=_0x144187;return _0x27c118;})[_0xc047('0x34')](function(_0x49569c){if(_0x49569c){_0x49569c[_0xc047('0x27')][_0xc047('0x7c')]=util[_0xc047('0x5d')](_0xc047('0x70'),_0x4e925d[_0xc047('0x65')][_0xc047('0x37')]);_0x49569c[_0xc047('0x27')][_0xc047('0x71')]=_0x27c118['channel'];_0x49569c['message']['motionChannel']=_0x27c118[_0xc047('0x71')];_0x49569c[_0xc047('0x27')][_0xc047('0x72')]=_0xc047('0x75');respondWithRpcPromise('EventManager',_0xc047('0x73'),{'event':'rejectmessage','message':_0x49569c[_0xc047('0x27')]},client9002);return _0x27c118;}return null;})[_0xc047('0x34')](respondWithResult(_0x39e62b,null))[_0xc047('0x57')](handleError(_0x39e62b,null));};exports[_0xc047('0x7d')]=function(_0x1f64ff,_0x4ec363){var _0x1a90b3;return db[_0xc047('0x4e')]['create'](_0x1f64ff[_0xc047('0x58')],{})[_0xc047('0x34')](function(_0x221c60){_0x1a90b3=_0x221c60;return db[_0xc047('0x7e')][_0xc047('0x7f')]({'where':{'id':_0x1a90b3[_0xc047('0x69')]}});})[_0xc047('0x34')](function(_0x26636e){if(_[_0xc047('0x80')](_0x26636e)){return;}else{_0x1a90b3['fax']=_0x26636e[_0xc047('0x76')];return db[_0xc047('0x81')][_0xc047('0x7f')]({'where':{'id':_0x1a90b3['AttachmentId']}});}})[_0xc047('0x34')](function(_0x5b68b0){return respondWithRpcPromise('SendFax',_0xc047('0x82'),{'FaxAccountId':_[_0xc047('0x80')](_0x1f64ff[_0xc047('0x58')])?undefined:_0x1f64ff[_0xc047('0x58')][_0xc047('0x83')],'path':_[_0xc047('0x80')](_0x5b68b0)?undefined:util[_0xc047('0x5d')](_0xc047('0x84'),_0x5b68b0[_0xc047('0x85')]),'fax':_[_0xc047('0x80')](_0x1a90b3[_0xc047('0x76')])?undefined:_0x1a90b3[_0xc047('0x76')],'AttachmentId':_0x1a90b3[_0xc047('0x86')]},client9002);})['then'](respondWithResult(_0x4ec363,0xc9))[_0xc047('0x57')](handleError(_0x4ec363,null));};exports[_0xc047('0x87')]=function(_0x336663,_0x3a87dd){var _0x4b504f=path['join'](config['root'],_0xc047('0x88'),_0xc047('0x89'),'attachments');return db[_0xc047('0x4e')][_0xc047('0x56')]({'where':{'id':_0x336663[_0xc047('0x54')]['id']},'include':[{'model':db[_0xc047('0x81')],'as':_0xc047('0x81')}]})[_0xc047('0x34')](handleEntityNotFound(_0x3a87dd,null))[_0xc047('0x34')](function(_0x42700b){if(_0x42700b){return _0x3a87dd[_0xc047('0x87')](path[_0xc047('0x8a')](_0x4b504f,_0x42700b[_0xc047('0x81')][_0xc047('0x85')]));}})[_0xc047('0x57')](handleError(_0x3a87dd,null));}; \ No newline at end of file +var _0xad54=['params','describe','accept','fax','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','fax-interactions','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','root','files','attachments','download','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','name','send','index','map','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','order','sort','filters','filter','where','options','FaxMessage','includeAll','include','findAll','rows','show','keys','rawAttributes','length','find','body'];(function(_0x587579,_0x57bae0){var _0x50cc20=function(_0x47aa6e){while(--_0x47aa6e){_0x587579['push'](_0x587579['shift']());}};_0x50cc20(++_0x57bae0);}(_0xad54,0x156));var _0x4ad5=function(_0x5bd1a9,_0x313714){_0x5bd1a9=_0x5bd1a9-0x0;var _0x2ba345=_0xad54[_0x5bd1a9];return _0x2ba345;};'use strict';var emlformat=require(_0x4ad5('0x0'));var rimraf=require(_0x4ad5('0x1'));var zipdir=require(_0x4ad5('0x2'));var jsonpatch=require(_0x4ad5('0x3'));var rp=require(_0x4ad5('0x4'));var moment=require(_0x4ad5('0x5'));var BPromise=require(_0x4ad5('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4ad5('0x7'));var sox=require(_0x4ad5('0x8'));var csv=require(_0x4ad5('0x9'));var ejs=require(_0x4ad5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ad5('0xb'));var squel=require(_0x4ad5('0xc'));var crypto=require(_0x4ad5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4ad5('0xe'));var toCsv=require(_0x4ad5('0x9'));var querystring=require(_0x4ad5('0xf'));var Papa=require('papaparse');var Redis=require(_0x4ad5('0x10'));var authService=require(_0x4ad5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4ad5('0x12'));var hardwareService=require(_0x4ad5('0x13'));var logger=require(_0x4ad5('0x14'))('api');var utils=require(_0x4ad5('0x15'));var config=require(_0x4ad5('0x16'));var licenseUtil=require(_0x4ad5('0x17'));var db=require(_0x4ad5('0x18'))['db'];config[_0x4ad5('0x19')]=_['defaults'](config[_0x4ad5('0x19')],{'host':_0x4ad5('0x1a'),'port':0x18eb});var socket=require(_0x4ad5('0x1b'))(new Redis(config[_0x4ad5('0x19')]));require(_0x4ad5('0x1c'))[_0x4ad5('0x1d')](socket);var jayson=require(_0x4ad5('0x1e'));var client=jayson[_0x4ad5('0x1f')][_0x4ad5('0x20')]({'port':0x232c});var client9002=jayson[_0x4ad5('0x1f')][_0x4ad5('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x568068,_0x5f2683,_0x15a3c3,_0x3ea652){return new BPromise(function(_0xde2a54,_0x1e6acd){var _0x40e976=_0x3ea652||client;return _0x40e976[_0x4ad5('0x21')](_0x568068,_0x15a3c3)['then'](function(_0x901999){logger['info'](_0x4ad5('0x22'),_0x5f2683,'request\x20sent');logger[_0x4ad5('0x23')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5f2683,_0x4ad5('0x24'),JSON['stringify'](_0x901999));if(_0x901999[_0x4ad5('0x25')]){if(_0x901999[_0x4ad5('0x25')][_0x4ad5('0x26')]===0x1f4){logger[_0x4ad5('0x25')]('FaxMessage,\x20%s,\x20%s',_0x5f2683,_0x901999['error'][_0x4ad5('0x27')]);return _0x1e6acd(_0x901999['error']['message']);}logger[_0x4ad5('0x25')]('FaxMessage,\x20%s,\x20%s',_0x5f2683,_0x901999[_0x4ad5('0x25')]['message']);return _0xde2a54(_0x901999[_0x4ad5('0x25')][_0x4ad5('0x27')]);}else{logger[_0x4ad5('0x28')](_0x4ad5('0x22'),_0x5f2683,_0x4ad5('0x24'));_0xde2a54(_0x901999[_0x4ad5('0x29')][_0x4ad5('0x27')]);}})[_0x4ad5('0x2a')](function(_0x4b95a7){logger[_0x4ad5('0x25')](_0x4ad5('0x22'),_0x5f2683,_0x4b95a7);_0x1e6acd(_0x4b95a7);});});}function respondWithStatusCode(_0x428090,_0x388578){_0x388578=_0x388578||0xcc;return function(_0x11006f){if(_0x11006f){return _0x428090[_0x4ad5('0x2b')](_0x388578);}return _0x428090[_0x4ad5('0x2c')](_0x388578)[_0x4ad5('0x2d')]();};}function respondWithResult(_0x20396d,_0xc34cd7){_0xc34cd7=_0xc34cd7||0xc8;return function(_0x401b7d){if(_0x401b7d){return _0x20396d[_0x4ad5('0x2c')](_0xc34cd7)[_0x4ad5('0x2e')](_0x401b7d);}};}function respondWithFilteredResult(_0x2744f2,_0x54aabe){return function(_0x21648e){if(_0x21648e){var _0x2f4084=typeof _0x54aabe[_0x4ad5('0x2f')]===_0x4ad5('0x30')&&typeof _0x54aabe[_0x4ad5('0x31')]===_0x4ad5('0x30');var _0x599603=_0x21648e[_0x4ad5('0x32')];var _0xe3951b=_0x2f4084?0x0:_0x54aabe[_0x4ad5('0x2f')];var _0x21ef7e=_0x2f4084?_0x21648e[_0x4ad5('0x32')]:_0x54aabe['offset']+_0x54aabe[_0x4ad5('0x31')];var _0x2f242c;if(_0x21ef7e>=_0x599603){_0x21ef7e=_0x599603;_0x2f242c=0xc8;}else{_0x2f242c=0xce;}_0x2744f2[_0x4ad5('0x2c')](_0x2f242c);return _0x2744f2['set'](_0x4ad5('0x33'),_0xe3951b+'-'+_0x21ef7e+'/'+_0x599603)['json'](_0x21648e);}return null;};}function patchUpdates(_0x668e6c){return function(_0x192e9f){try{jsonpatch[_0x4ad5('0x34')](_0x192e9f,_0x668e6c,!![]);}catch(_0x440f5b){return BPromise[_0x4ad5('0x35')](_0x440f5b);}return _0x192e9f['save']();};}function saveUpdates(_0x36272d,_0x16bd15){return function(_0x1a329d){if(_0x1a329d){return _0x1a329d[_0x4ad5('0x36')](_0x36272d)[_0x4ad5('0x37')](function(_0x20d262){return _0x20d262;});}return null;};}function removeEntity(_0x46a1d1,_0x31a581){return function(_0x209abb){if(_0x209abb){return _0x209abb[_0x4ad5('0x38')]()[_0x4ad5('0x37')](function(){_0x46a1d1[_0x4ad5('0x2c')](0xcc)[_0x4ad5('0x2d')]();});}};}function handleEntityNotFound(_0x2f9e1,_0x2247c1){return function(_0x21a086){if(!_0x21a086){_0x2f9e1[_0x4ad5('0x2b')](0x194);}return _0x21a086;};}function handleError(_0x5619b5,_0x4fad48){_0x4fad48=_0x4fad48||0x1f4;return function(_0x271291){logger[_0x4ad5('0x25')](_0x271291['stack']);if(_0x271291[_0x4ad5('0x39')]){delete _0x271291[_0x4ad5('0x39')];}_0x5619b5[_0x4ad5('0x2c')](_0x4fad48)[_0x4ad5('0x3a')](_0x271291);};}exports[_0x4ad5('0x3b')]=function(_0x56b0da,_0x418409){var _0x521cff={},_0x2b571e={},_0x2b56f9={'count':0x0,'rows':[]};var _0xda1630=_[_0x4ad5('0x3c')](db['FaxMessage']['rawAttributes'],function(_0x44f0f7){return{'name':_0x44f0f7[_0x4ad5('0x3d')],'type':_0x44f0f7[_0x4ad5('0x3e')][_0x4ad5('0x3f')]};});_0x2b571e[_0x4ad5('0x40')]=_['map'](_0xda1630,_0x4ad5('0x39'));_0x2b571e[_0x4ad5('0x41')]=_['keys'](_0x56b0da[_0x4ad5('0x41')]);_0x2b571e['filters']=_[_0x4ad5('0x42')](_0x2b571e[_0x4ad5('0x40')],_0x2b571e['query']);_0x521cff[_0x4ad5('0x43')]=_['intersection'](_0x2b571e[_0x4ad5('0x40')],qs[_0x4ad5('0x44')](_0x56b0da[_0x4ad5('0x41')][_0x4ad5('0x44')]));_0x521cff[_0x4ad5('0x43')]=_0x521cff['attributes']['length']?_0x521cff['attributes']:_0x2b571e[_0x4ad5('0x40')];if(!_0x56b0da[_0x4ad5('0x41')][_0x4ad5('0x45')]('nolimit')){_0x521cff[_0x4ad5('0x31')]=qs[_0x4ad5('0x31')](_0x56b0da[_0x4ad5('0x41')]['limit']);_0x521cff['offset']=qs['offset'](_0x56b0da[_0x4ad5('0x41')][_0x4ad5('0x2f')]);}_0x521cff[_0x4ad5('0x46')]=qs[_0x4ad5('0x47')](_0x56b0da[_0x4ad5('0x41')]['sort']);_0x521cff['where']=qs[_0x4ad5('0x48')](_['pick'](_0x56b0da[_0x4ad5('0x41')],_0x2b571e[_0x4ad5('0x48')]),_0xda1630);if(_0x56b0da[_0x4ad5('0x41')][_0x4ad5('0x49')]){_0x521cff['where']=_['merge'](_0x521cff[_0x4ad5('0x4a')],{'$or':_['map'](_0xda1630,function(_0x2fd220){if(_0x2fd220['type']!=='VIRTUAL'){var _0x363994={};_0x363994[_0x2fd220[_0x4ad5('0x39')]]={'$like':'%'+_0x56b0da[_0x4ad5('0x41')][_0x4ad5('0x49')]+'%'};return _0x363994;}})});}_0x521cff=_['merge']({},_0x521cff,_0x56b0da[_0x4ad5('0x4b')]);var _0x404895={'where':_0x521cff[_0x4ad5('0x4a')]};return db[_0x4ad5('0x4c')][_0x4ad5('0x32')](_0x404895)[_0x4ad5('0x37')](function(_0x1afec9){_0x2b56f9[_0x4ad5('0x32')]=_0x1afec9;if(_0x56b0da['query'][_0x4ad5('0x4d')]){_0x521cff[_0x4ad5('0x4e')]=[{'all':!![]}];}return db[_0x4ad5('0x4c')][_0x4ad5('0x4f')](_0x521cff);})[_0x4ad5('0x37')](function(_0x383666){_0x2b56f9[_0x4ad5('0x50')]=_0x383666;return _0x2b56f9;})['then'](respondWithFilteredResult(_0x418409,_0x521cff))[_0x4ad5('0x2a')](handleError(_0x418409,null));};exports[_0x4ad5('0x51')]=function(_0x1cfe75,_0x2729d0){var _0x59af2d={'raw':!![],'where':{'id':_0x1cfe75['params']['id']}},_0x5053bf={};_0x5053bf[_0x4ad5('0x40')]=_[_0x4ad5('0x52')](db[_0x4ad5('0x4c')][_0x4ad5('0x53')]);_0x5053bf[_0x4ad5('0x41')]=_[_0x4ad5('0x52')](_0x1cfe75[_0x4ad5('0x41')]);_0x5053bf[_0x4ad5('0x48')]=_[_0x4ad5('0x42')](_0x5053bf[_0x4ad5('0x40')],_0x5053bf[_0x4ad5('0x41')]);_0x59af2d[_0x4ad5('0x43')]=_[_0x4ad5('0x42')](_0x5053bf[_0x4ad5('0x40')],qs[_0x4ad5('0x44')](_0x1cfe75[_0x4ad5('0x41')][_0x4ad5('0x44')]));_0x59af2d[_0x4ad5('0x43')]=_0x59af2d[_0x4ad5('0x43')][_0x4ad5('0x54')]?_0x59af2d[_0x4ad5('0x43')]:_0x5053bf[_0x4ad5('0x40')];if(_0x1cfe75[_0x4ad5('0x41')][_0x4ad5('0x4d')]){_0x59af2d['include']=[{'all':!![]}];}_0x59af2d=_['merge']({},_0x59af2d,_0x1cfe75[_0x4ad5('0x4b')]);return db[_0x4ad5('0x4c')][_0x4ad5('0x55')](_0x59af2d)[_0x4ad5('0x37')](handleEntityNotFound(_0x2729d0,null))['then'](respondWithResult(_0x2729d0,null))[_0x4ad5('0x2a')](handleError(_0x2729d0,null));};exports[_0x4ad5('0x36')]=function(_0x1f60bf,_0x476efe){if(_0x1f60bf[_0x4ad5('0x56')]['id']){delete _0x1f60bf[_0x4ad5('0x56')]['id'];}return db[_0x4ad5('0x4c')][_0x4ad5('0x55')]({'where':{'id':_0x1f60bf[_0x4ad5('0x57')]['id']}})[_0x4ad5('0x37')](handleEntityNotFound(_0x476efe,null))['then'](saveUpdates(_0x1f60bf[_0x4ad5('0x56')],null))[_0x4ad5('0x37')](respondWithResult(_0x476efe,null))[_0x4ad5('0x2a')](handleError(_0x476efe,null));};exports[_0x4ad5('0x38')]=function(_0x1e6998,_0x5083da){return db[_0x4ad5('0x4c')][_0x4ad5('0x55')]({'where':{'id':_0x1e6998[_0x4ad5('0x57')]['id']}})[_0x4ad5('0x37')](handleEntityNotFound(_0x5083da,null))[_0x4ad5('0x37')](removeEntity(_0x5083da,null))['catch'](handleError(_0x5083da,null));};exports[_0x4ad5('0x58')]=function(_0x199933,_0xf852bf){return db['FaxMessage'][_0x4ad5('0x58')]()[_0x4ad5('0x37')](respondWithResult(_0xf852bf,null))[_0x4ad5('0x2a')](handleError(_0xf852bf,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x4ad5('0x59')]=function(_0x140f5d,_0x2d4d8f,_0x2ba51c){var _0x165966={'agent':{},'channel':_0x4ad5('0x5a')};if(_0x140f5d[_0x4ad5('0x56')]['id']){delete _0x140f5d[_0x4ad5('0x56')]['id'];}_0x140f5d[_0x4ad5('0x56')]['read']=!![];_0x140f5d[_0x4ad5('0x56')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x140f5d['body'][_0x4ad5('0x5b')]=_0x140f5d['body']['UserId']||_0x140f5d[_0x4ad5('0x5c')]['id'];_0x165966[_0x4ad5('0x5d')]['id']=_0x140f5d[_0x4ad5('0x56')][_0x4ad5('0x5b')];return db[_0x4ad5('0x4c')]['find']({'where':{'id':_0x140f5d[_0x4ad5('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2d4d8f,null))[_0x4ad5('0x37')](saveUpdates(_0x140f5d['body'],null))['then'](function(_0x35c8b9){if(_0x35c8b9){_0x165966['message']=_0x35c8b9[_0x4ad5('0x5e')]({'plain':!![]});return db[_0x4ad5('0x5f')][_0x4ad5('0x55')]({'where':{'id':_0x35c8b9[_0x4ad5('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x2d4d8f,null))[_0x4ad5('0x37')](function(_0x3d7a56){if(_0x3d7a56){return _0x3d7a56[_0x4ad5('0x36')]({'UserId':_0x140f5d[_0x4ad5('0x56')][_0x4ad5('0x5b')],'read1stAt':_[_0x4ad5('0x61')](_0x3d7a56[_0x4ad5('0x62')])?moment()[_0x4ad5('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x4ad5('0x37')](function(_0x2d7f35){if(_0x2d7f35){_0x165966[_0x4ad5('0x64')]=_0x2d7f35[_0x4ad5('0x5e')]({'plain':!![]});interaction_log['info'](_0x4ad5('0x65'),_0x140f5d[_0x4ad5('0x5c')]['id'],_0x140f5d[_0x4ad5('0x5c')][_0x4ad5('0x39')],_0x140f5d[_0x4ad5('0x5c')]['role'],_0x165966[_0x4ad5('0x64')]['id'],_0x140f5d[_0x4ad5('0x56')]?JSON[_0x4ad5('0x66')](_0x140f5d[_0x4ad5('0x56')]):_0x4ad5('0x67'));return respondWithRpcPromise('AcceptMessage',_0x4ad5('0x68'),_0x165966);}return null;})[_0x4ad5('0x37')](function(_0x12f15b){var _0xc6a378='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x12f15b['message'][_0x4ad5('0x69')];return db[_0x4ad5('0x6a')]['query'](_0xc6a378,{'type':db[_0x4ad5('0x6b')][_0x4ad5('0x6c')][_0x4ad5('0x6d')],'raw':!![]})['then'](function(_0x22925f){return _0x22925f;});})[_0x4ad5('0x37')](function(_0x55f489){if(_0x55f489){_0x165966[_0x4ad5('0x27')][_0x4ad5('0x6e')]=_0x55f489[0x0];if(!_0x140f5d[_0x4ad5('0x56')]['UserId'])return;return db[_0x4ad5('0x6f')][_0x4ad5('0x55')]({'where':{'id':_0x140f5d['body'][_0x4ad5('0x5b')],'role':_0x4ad5('0x5d')},'attributes':['id',_0x4ad5('0x39'),_0x4ad5('0x70'),_0x4ad5('0x71'),'internal'],'raw':!![]});}return null;})[_0x4ad5('0x37')](function(_0x28fe76){if(!_0x28fe76)return null;_0x165966['message'][_0x4ad5('0x5d')]=_0x28fe76;return _0x165966;})['then'](function(_0x2bc26b){if(_0x2bc26b){if(_0x140f5d[_0x4ad5('0x56')][_0x4ad5('0x72')]){_0x165966[_0x4ad5('0x27')][_0x4ad5('0x73')]=util['format'](_0x4ad5('0x74'),_0x140f5d[_0x4ad5('0x5c')][_0x4ad5('0x39')]);_0x165966[_0x4ad5('0x27')]['channel']=_0x165966[_0x4ad5('0x75')];_0x165966['message'][_0x4ad5('0x76')]=_0x165966[_0x4ad5('0x75')];_0x165966['message'][_0x4ad5('0x77')]='accept';return respondWithRpcPromise('EventManager',_0x4ad5('0x78'),{'event':_0x4ad5('0x79'),'message':_0x165966[_0x4ad5('0x27')]},client9002)[_0x4ad5('0x37')](function(){return _0x165966;});}return _0x165966;}return null;})['then'](respondWithResult(_0x2d4d8f,null))['catch'](handleError(_0x2d4d8f,null));};var interaction_log=require('../../config/logger')(_0x4ad5('0x7a'));exports['reject']=function(_0x2fac17,_0x18c025,_0x28ed2d){var _0x2412ff={'agent':{},'channel':_0x4ad5('0x5a')};if(_0x2fac17['body']['id']){delete _0x2fac17[_0x4ad5('0x56')]['id'];}_0x2fac17[_0x4ad5('0x56')][_0x4ad5('0x5b')]=_0x2fac17[_0x4ad5('0x56')][_0x4ad5('0x5b')]||_0x2fac17[_0x4ad5('0x5c')]['id'];_0x2412ff[_0x4ad5('0x5d')]['id']=_0x2fac17[_0x4ad5('0x56')][_0x4ad5('0x5b')];return db[_0x4ad5('0x4c')]['find']({'where':{'id':_0x2fac17[_0x4ad5('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x18c025,null))[_0x4ad5('0x37')](function(_0x1801bd){if(_0x1801bd){_0x2412ff[_0x4ad5('0x27')]=_0x1801bd['get']({'plain':!![]});return db[_0x4ad5('0x5f')][_0x4ad5('0x55')]({'where':{'id':_0x1801bd[_0x4ad5('0x60')]}});}return null;})[_0x4ad5('0x37')](handleEntityNotFound(_0x18c025,null))[_0x4ad5('0x37')](function(_0x1eecb5){if(_0x1eecb5){_0x2412ff['interaction']=_0x1eecb5[_0x4ad5('0x5e')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2fac17[_0x4ad5('0x5c')]['id'],_0x2fac17[_0x4ad5('0x5c')]['name'],_0x2fac17[_0x4ad5('0x5c')][_0x4ad5('0x7b')],_0x2412ff[_0x4ad5('0x64')]['id'],_0x2fac17['body']?JSON[_0x4ad5('0x66')](_0x2fac17[_0x4ad5('0x56')]):_0x4ad5('0x67'));return respondWithRpcPromise(_0x4ad5('0x7c'),_0x4ad5('0x7d'),_0x2412ff);}return null;})['then'](function(_0x2f53ec){var _0x32aa38=_0x4ad5('0x7e')+_0x2f53ec['message'][_0x4ad5('0x69')];return db['sequelize'][_0x4ad5('0x41')](_0x32aa38,{'type':db[_0x4ad5('0x6b')][_0x4ad5('0x6c')][_0x4ad5('0x6d')],'raw':!![]})[_0x4ad5('0x37')](function(_0x5d47e5){return _0x5d47e5;});})[_0x4ad5('0x37')](function(_0xc62b53){if(_0xc62b53){_0x2412ff[_0x4ad5('0x27')][_0x4ad5('0x6e')]=_0xc62b53[0x0];if(!_0x2fac17[_0x4ad5('0x56')][_0x4ad5('0x5b')])return;return db[_0x4ad5('0x6f')]['find']({'where':{'id':_0x2fac17[_0x4ad5('0x56')][_0x4ad5('0x5b')],'role':_0x4ad5('0x5d')},'attributes':['id',_0x4ad5('0x39'),_0x4ad5('0x70'),_0x4ad5('0x71'),_0x4ad5('0x7f')],'raw':!![]});}return null;})[_0x4ad5('0x37')](function(_0x5f1521){if(!_0x5f1521)return null;_0x2412ff[_0x4ad5('0x27')]['agent']=_0x5f1521;return _0x2412ff;})[_0x4ad5('0x37')](function(_0x3584a0){if(_0x3584a0){_0x3584a0[_0x4ad5('0x27')]['interface']=util[_0x4ad5('0x63')](_0x4ad5('0x74'),_0x2fac17[_0x4ad5('0x5c')][_0x4ad5('0x39')]);_0x3584a0[_0x4ad5('0x27')][_0x4ad5('0x75')]=_0x2412ff[_0x4ad5('0x75')];_0x3584a0[_0x4ad5('0x27')][_0x4ad5('0x76')]=_0x2412ff[_0x4ad5('0x75')];_0x3584a0['message'][_0x4ad5('0x77')]=_0x4ad5('0x35');respondWithRpcPromise(_0x4ad5('0x78'),'EventManager',{'event':_0x4ad5('0x80'),'message':_0x3584a0[_0x4ad5('0x27')]},client9002);return _0x2412ff;}return null;})['then'](respondWithResult(_0x18c025,null))[_0x4ad5('0x2a')](handleError(_0x18c025,null));};exports[_0x4ad5('0x81')]=function(_0x920422,_0x49c859){var _0x48f2a2;return db['FaxMessage'][_0x4ad5('0x81')](_0x920422[_0x4ad5('0x56')],{})['then'](function(_0x225699){_0x48f2a2=_0x225699;return db[_0x4ad5('0x82')][_0x4ad5('0x83')]({'where':{'id':_0x48f2a2[_0x4ad5('0x69')]}});})[_0x4ad5('0x37')](function(_0x49225d){if(_[_0x4ad5('0x61')](_0x49225d)){return;}else{_0x48f2a2[_0x4ad5('0x5a')]=_0x49225d[_0x4ad5('0x5a')];return db[_0x4ad5('0x84')]['findOne']({'where':{'id':_0x48f2a2[_0x4ad5('0x85')]}});}})[_0x4ad5('0x37')](function(_0x5a1318){return respondWithRpcPromise(_0x4ad5('0x86'),_0x4ad5('0x86'),{'FaxAccountId':_[_0x4ad5('0x61')](_0x920422[_0x4ad5('0x56')])?undefined:_0x920422['body'][_0x4ad5('0x87')],'path':_[_0x4ad5('0x61')](_0x5a1318)?undefined:util[_0x4ad5('0x63')](_0x4ad5('0x88'),_0x5a1318[_0x4ad5('0x89')]),'fax':_[_0x4ad5('0x61')](_0x48f2a2[_0x4ad5('0x5a')])?undefined:_0x48f2a2[_0x4ad5('0x5a')],'AttachmentId':_0x48f2a2[_0x4ad5('0x85')]},client9002);})['then'](respondWithResult(_0x49c859,0xc9))[_0x4ad5('0x2a')](handleError(_0x49c859,null));};exports['download']=function(_0x2dd9da,_0x5d27a0){var _0x117db0=path['join'](config[_0x4ad5('0x8a')],'server',_0x4ad5('0x8b'),_0x4ad5('0x8c'));return db[_0x4ad5('0x4c')][_0x4ad5('0x55')]({'where':{'id':_0x2dd9da[_0x4ad5('0x57')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x4ad5('0x37')](handleEntityNotFound(_0x5d27a0,null))[_0x4ad5('0x37')](function(_0x31fd7c){if(_0x31fd7c){return _0x5d27a0[_0x4ad5('0x8d')](path[_0x4ad5('0x8e')](_0x117db0,_0x31fd7c[_0x4ad5('0x84')][_0x4ad5('0x89')]));}})['catch'](handleError(_0x5d27a0,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index f652951..33bdacb 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 _0x34f0=['events','../../mysqldb','setMaxListeners','update','remove','emit','hook'];(function(_0x2d7fbe,_0x44b669){var _0x3a93ac=function(_0x101520){while(--_0x101520){_0x2d7fbe['push'](_0x2d7fbe['shift']());}};_0x3a93ac(++_0x44b669);}(_0x34f0,0x13b));var _0x034f=function(_0x30c071,_0x2a93b9){_0x30c071=_0x30c071-0x0;var _0x5a136f=_0x34f0[_0x30c071];return _0x5a136f;};'use strict';var EventEmitter=require(_0x034f('0x0'));var FaxMessage=require(_0x034f('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x034f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x034f('0x3'),'afterDestroy':_0x034f('0x4')};function emitEvent(_0x30e99f){return function(_0x1f0c8a,_0x2bd6d1,_0x5011cd){FaxMessageEvents[_0x034f('0x5')](_0x30e99f+':'+_0x1f0c8a['id'],_0x1f0c8a);FaxMessageEvents[_0x034f('0x5')](_0x30e99f,_0x1f0c8a);_0x5011cd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x034f('0x6')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x16a6=['save','update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0xe5287b,_0x26b8ab){var _0x346f77=function(_0x4d52d7){while(--_0x4d52d7){_0xe5287b['push'](_0xe5287b['shift']());}};_0x346f77(++_0x26b8ab);}(_0x16a6,0x15c));var _0x616a=function(_0x786e9,_0x1a029){_0x786e9=_0x786e9-0x0;var _0x1f891b=_0x16a6[_0x786e9];return _0x1f891b;};'use strict';var EventEmitter=require(_0x616a('0x0'));var FaxMessage=require(_0x616a('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x616a('0x2')](0x0);var events={'afterCreate':_0x616a('0x3'),'afterUpdate':_0x616a('0x4'),'afterDestroy':_0x616a('0x5')};function emitEvent(_0x43e20b){return function(_0x13cbc6,_0x59fc7e,_0x41fbfa){FaxMessageEvents[_0x616a('0x6')](_0x43e20b+':'+_0x13cbc6['id'],_0x13cbc6);FaxMessageEvents['emit'](_0x43e20b,_0x13cbc6);_0x41fbfa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x616a('0x7')](e,emitEvent(event));}}module[_0x616a('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 0bbe92e..49f0cf7 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 _0xed32=['update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','models','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','then'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xed32,0x156));var _0x2ed3=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xed32[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0x2ed3('0x0'));var util=require(_0x2ed3('0x1'));var logger=require(_0x2ed3('0x2'))(_0x2ed3('0x3'));var moment=require(_0x2ed3('0x4'));var BPromise=require('bluebird');var rp=require(_0x2ed3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2ed3('0x6'));var attributes=require('./faxMessage.attributes');module[_0x2ed3('0x7')]=function(_0x16188c,_0xaf8d08){return _0x16188c[_0x2ed3('0x8')](_0x2ed3('0x9'),attributes,{'tableName':_0x2ed3('0xa'),'paranoid':![],'indexes':[{'name':_0x2ed3('0xb'),'fields':[_0x2ed3('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a6768,_0x3640e5,_0x38567d){var _0x436ba3=_0x16188c[_0x2ed3('0xd')];var _0xd0a64=_0x5a6768['get']({'plain':!![]});if(_0xd0a64[_0x2ed3('0xe')]['toLowerCase']()==='in'||_0xd0a64[_0x2ed3('0xe')][_0x2ed3('0xf')]()==='out'&&!_0xd0a64[_0x2ed3('0x10')]&&!_[_0x2ed3('0x11')](_0xd0a64[_0x2ed3('0x12')])){_0x436ba3[_0x2ed3('0x13')][_0x2ed3('0x14')]({'where':{'id':_0xd0a64['FaxInteractionId']}})[_0x2ed3('0x15')](function(_0x285ef6){if(_0x285ef6){_0x285ef6[_0x2ed3('0x16')]({'lastMsgAt':_0xd0a64[_0x2ed3('0x17')],'lastMsgDirection':_0xd0a64[_0x2ed3('0xe')]['toLowerCase']()});}})[_0x2ed3('0x18')](function(_0x3066bf){console[_0x2ed3('0x19')](_0x3066bf);});}_0x38567d();}},'charset':_0x2ed3('0x1a'),'collate':_0x2ed3('0x1b')});}; \ No newline at end of file +var _0xbc15=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','UserId','FaxInteraction','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3fc8ee,_0x467272){var _0x28bf2b=function(_0x177c2b){while(--_0x177c2b){_0x3fc8ee['push'](_0x3fc8ee['shift']());}};_0x28bf2b(++_0x467272);}(_0xbc15,0x1dc));var _0x5bc1=function(_0x12f138,_0x444d6b){_0x12f138=_0x12f138-0x0;var _0xf89d85=_0xbc15[_0x12f138];return _0xf89d85;};'use strict';var _=require(_0x5bc1('0x0'));var util=require(_0x5bc1('0x1'));var logger=require('../../config/logger')(_0x5bc1('0x2'));var moment=require(_0x5bc1('0x3'));var BPromise=require(_0x5bc1('0x4'));var rp=require(_0x5bc1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5bc1('0x6'));var config=require(_0x5bc1('0x7'));var attributes=require(_0x5bc1('0x8'));module[_0x5bc1('0x9')]=function(_0x217c1e,_0x57e59b){return _0x217c1e['define'](_0x5bc1('0xa'),attributes,{'tableName':_0x5bc1('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x5bc1('0xc')],'type':_0x5bc1('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x32277c,_0x44ec5b,_0x308b65){var _0x140350=_0x217c1e[_0x5bc1('0xe')];var _0x24b64c=_0x32277c[_0x5bc1('0xf')]({'plain':!![]});if(_0x24b64c[_0x5bc1('0x10')][_0x5bc1('0x11')]()==='in'||_0x24b64c[_0x5bc1('0x10')]['toLowerCase']()==='out'&&!_0x24b64c['secret']&&!_['isNil'](_0x24b64c[_0x5bc1('0x12')])){_0x140350[_0x5bc1('0x13')]['findOne']({'where':{'id':_0x24b64c[_0x5bc1('0x14')]}})[_0x5bc1('0x15')](function(_0x3fafb7){if(_0x3fafb7){_0x3fafb7[_0x5bc1('0x16')]({'lastMsgAt':_0x24b64c[_0x5bc1('0x17')],'lastMsgDirection':_0x24b64c[_0x5bc1('0x10')][_0x5bc1('0x11')]()});}})[_0x5bc1('0x18')](function(_0x19d7e0){console[_0x5bc1('0x19')](_0x19d7e0);});}_0x308b65();}},'charset':_0x5bc1('0x1a'),'collate':_0x5bc1('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 3b18e70..a452151 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 _0x4c4e=['localhost','socket.io-emitter','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','then','debug','stringify','attributes','limit','UpdateFaxMessage','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults'];(function(_0x43aed5,_0x4f6fbf){var _0x4458ac=function(_0x2a1f4e){while(--_0x2a1f4e){_0x43aed5['push'](_0x43aed5['shift']());}};_0x4458ac(++_0x4f6fbf);}(_0x4c4e,0x152));var _0xe4c4=function(_0x57ead2,_0x5eb77b){_0x57ead2=_0x57ead2-0x0;var _0x57c07f=_0x4c4e[_0x57ead2];return _0x57c07f;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});config[_0xe4c4('0xa')]=_[_0xe4c4('0xb')](config[_0xe4c4('0xa')],{'host':_0xe4c4('0xc'),'port':0x18eb});var socket=require(_0xe4c4('0xd'))(new Redis(config[_0xe4c4('0xa')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x31f879,_0x6f2545,_0x27ad42){return new BPromise(function(_0x1bc786,_0x333c08){return client[_0xe4c4('0xe')](_0x31f879,_0x27ad42)['then'](function(_0x303d89){logger[_0xe4c4('0xf')](_0xe4c4('0x10'),_0x6f2545,_0xe4c4('0x11'));logger['debug'](_0xe4c4('0x12'),_0x6f2545,_0xe4c4('0x11'),JSON['stringify'](_0x303d89));if(_0x303d89[_0xe4c4('0x13')]){if(_0x303d89[_0xe4c4('0x13')]['code']===0x1f4){logger[_0xe4c4('0x13')](_0xe4c4('0x10'),_0x6f2545,_0x303d89['error'][_0xe4c4('0x14')]);return _0x333c08(_0x303d89[_0xe4c4('0x13')][_0xe4c4('0x14')]);}logger[_0xe4c4('0x13')](_0xe4c4('0x10'),_0x6f2545,_0x303d89[_0xe4c4('0x13')][_0xe4c4('0x14')]);return _0x1bc786(_0x303d89[_0xe4c4('0x13')][_0xe4c4('0x14')]);}else{logger[_0xe4c4('0xf')](_0xe4c4('0x10'),_0x6f2545,_0xe4c4('0x11'));_0x1bc786(_0x303d89[_0xe4c4('0x15')][_0xe4c4('0x14')]);}})[_0xe4c4('0x16')](function(_0x5a32b5){logger[_0xe4c4('0x13')](_0xe4c4('0x10'),_0x6f2545,_0x5a32b5);_0x333c08(_0x5a32b5);});});}exports[_0xe4c4('0x17')]=function(_0x317cc8){var _0x5da165=this;return new Promise(function(_0x3d5856,_0x1cad5d){return db[_0xe4c4('0x18')][_0xe4c4('0x19')](_0x317cc8[_0xe4c4('0x1a')],{'raw':_0x317cc8[_0xe4c4('0x1b')]?_0x317cc8[_0xe4c4('0x1b')][_0xe4c4('0x1c')]===undefined?!![]:![]:!![]})[_0xe4c4('0x1d')](function(_0x1a7690){logger[_0xe4c4('0xf')](_0xe4c4('0x17'),_0x317cc8);logger[_0xe4c4('0x1e')](_0xe4c4('0x17'),_0x317cc8,JSON[_0xe4c4('0x1f')](_0x1a7690));_0x3d5856(_0x1a7690);})['catch'](function(_0x49cadc){logger[_0xe4c4('0x13')]('CreateFaxMessage',_0x49cadc[_0xe4c4('0x14')],_0x317cc8);_0x1cad5d(_0x5da165['error'](0x1f4,_0x49cadc[_0xe4c4('0x14')]));});});};exports['UpdateFaxMessage']=function(_0x34d667){var _0x583393=this;return new Promise(function(_0xba53ef,_0x4a0199){return db['FaxMessage']['update'](_0x34d667['body'],{'raw':_0x34d667[_0xe4c4('0x1b')]?_0x34d667['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34d667[_0xe4c4('0x1b')]?_0x34d667[_0xe4c4('0x1b')]['where']||null:null,'attributes':_0x34d667['options']?_0x34d667[_0xe4c4('0x1b')][_0xe4c4('0x20')]||null:null,'limit':_0x34d667['options']?_0x34d667[_0xe4c4('0x1b')][_0xe4c4('0x21')]||null:null})[_0xe4c4('0x1d')](function(_0x48060e){logger['info'](_0xe4c4('0x22'),_0x34d667);logger[_0xe4c4('0x1e')](_0xe4c4('0x22'),_0x34d667,JSON[_0xe4c4('0x1f')](_0x48060e));_0xba53ef(_0x48060e);})['catch'](function(_0x49c913){logger[_0xe4c4('0x13')](_0xe4c4('0x22'),_0x49c913['message'],_0x34d667);_0x4a0199(_0x583393[_0xe4c4('0x13')](0x1f4,_0x49c913[_0xe4c4('0x14')]));});});}; \ No newline at end of file +var _0xa41a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./faxMessage.socket','register','request','info','debug','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage','body','options','raw','then','FaxMessage','update','where','attributes','UpdateFaxMessage','lodash','util','bluebird','randomstring'];(function(_0x53c36c,_0x5a2c25){var _0x5d8df8=function(_0x2c58fc){while(--_0x2c58fc){_0x53c36c['push'](_0x53c36c['shift']());}};_0x5d8df8(++_0x5a2c25);}(_0xa41a,0x6b));var _0xaa41=function(_0x4e543d,_0x133335){_0x4e543d=_0x4e543d-0x0;var _0x3dec89=_0xa41a[_0x4e543d];return _0x3dec89;};'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});config['redis']=_['defaults'](config[_0xaa41('0xc')],{'host':_0xaa41('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa41('0xc')]));require(_0xaa41('0xe'))[_0xaa41('0xf')](socket);function respondWithRpcPromise(_0x1cc344,_0x4263d6,_0x38d930){return new BPromise(function(_0x806f08,_0x423a19){return client[_0xaa41('0x10')](_0x1cc344,_0x38d930)['then'](function(_0x1d3aac){logger[_0xaa41('0x11')]('FaxMessage,\x20%s,\x20%s',_0x4263d6,'request\x20sent');logger[_0xaa41('0x12')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x4263d6,_0xaa41('0x13'),JSON[_0xaa41('0x14')](_0x1d3aac));if(_0x1d3aac[_0xaa41('0x15')]){if(_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x16')]===0x1f4){logger['error'](_0xaa41('0x17'),_0x4263d6,_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x18')]);return _0x423a19(_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x18')]);}logger[_0xaa41('0x15')](_0xaa41('0x17'),_0x4263d6,_0x1d3aac['error'][_0xaa41('0x18')]);return _0x806f08(_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x18')]);}else{logger[_0xaa41('0x11')](_0xaa41('0x17'),_0x4263d6,_0xaa41('0x13'));_0x806f08(_0x1d3aac[_0xaa41('0x19')][_0xaa41('0x18')]);}})[_0xaa41('0x1a')](function(_0x4fe1a4){logger['error'](_0xaa41('0x17'),_0x4263d6,_0x4fe1a4);_0x423a19(_0x4fe1a4);});});}exports[_0xaa41('0x1b')]=function(_0x35c753){var _0x54c488=this;return new Promise(function(_0x2bf794,_0x1f692b){return db['FaxMessage']['create'](_0x35c753[_0xaa41('0x1c')],{'raw':_0x35c753['options']?_0x35c753[_0xaa41('0x1d')][_0xaa41('0x1e')]===undefined?!![]:![]:!![]})[_0xaa41('0x1f')](function(_0x1f27f3){logger[_0xaa41('0x11')]('CreateFaxMessage',_0x35c753);logger[_0xaa41('0x12')](_0xaa41('0x1b'),_0x35c753,JSON[_0xaa41('0x14')](_0x1f27f3));_0x2bf794(_0x1f27f3);})[_0xaa41('0x1a')](function(_0x274630){logger[_0xaa41('0x15')]('CreateFaxMessage',_0x274630['message'],_0x35c753);_0x1f692b(_0x54c488[_0xaa41('0x15')](0x1f4,_0x274630['message']));});});};exports['UpdateFaxMessage']=function(_0x12e362){var _0x59707f=this;return new Promise(function(_0x536bed,_0x2d0ac0){return db[_0xaa41('0x20')][_0xaa41('0x21')](_0x12e362[_0xaa41('0x1c')],{'raw':_0x12e362[_0xaa41('0x1d')]?_0x12e362[_0xaa41('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12e362[_0xaa41('0x1d')]?_0x12e362[_0xaa41('0x1d')][_0xaa41('0x22')]||null:null,'attributes':_0x12e362[_0xaa41('0x1d')]?_0x12e362[_0xaa41('0x1d')][_0xaa41('0x23')]||null:null,'limit':_0x12e362[_0xaa41('0x1d')]?_0x12e362[_0xaa41('0x1d')]['limit']||null:null})[_0xaa41('0x1f')](function(_0x48b48b){logger['info'](_0xaa41('0x24'),_0x12e362);logger[_0xaa41('0x12')]('UpdateFaxMessage',_0x12e362,JSON[_0xaa41('0x14')](_0x48b48b));_0x536bed(_0x48b48b);})[_0xaa41('0x1a')](function(_0x4e3b44){logger['error']('UpdateFaxMessage',_0x4e3b44[_0xaa41('0x18')],_0x12e362);_0x2d0ac0(_0x59707f[_0xaa41('0x15')](0x1f4,_0x4e3b44[_0xaa41('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 571c646..92fcb18 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 _0xc2db=['removeListener','register','length','./faxMessage.events','save','remove','update'];(function(_0x35f7d1,_0x39d318){var _0x53ac5f=function(_0x30b171){while(--_0x30b171){_0x35f7d1['push'](_0x35f7d1['shift']());}};_0x53ac5f(++_0x39d318);}(_0xc2db,0x161));var _0xbc2d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xc2db[_0x13d07a];return _0x5ee0ee;};'use strict';var FaxMessageEvents=require(_0xbc2d('0x0'));var events=[_0xbc2d('0x1'),_0xbc2d('0x2'),_0xbc2d('0x3')];function createListener(_0x423b0e,_0x231cce){return function(_0x4a66fb){_0x231cce['emit'](_0x423b0e,_0x4a66fb);};}function removeListener(_0x6f24f5,_0x2b29fd){return function(){FaxMessageEvents[_0xbc2d('0x4')](_0x6f24f5,_0x2b29fd);};}exports[_0xbc2d('0x5')]=function(_0x455903){for(var _0x12b9f7=0x0,_0x438b37=events[_0xbc2d('0x6')];_0x12b9f7<_0x438b37;_0x12b9f7++){var _0x2ddd33=events[_0x12b9f7];var _0x1524ca=createListener('faxMessage:'+_0x2ddd33,_0x455903);FaxMessageEvents['on'](_0x2ddd33,_0x1524ca);}}; \ No newline at end of file +var _0x43e3=['faxMessage:','./faxMessage.events','save','remove','update','emit','register'];(function(_0x1b8b95,_0x3ea343){var _0x3657ae=function(_0x3703e1){while(--_0x3703e1){_0x1b8b95['push'](_0x1b8b95['shift']());}};_0x3657ae(++_0x3ea343);}(_0x43e3,0xb7));var _0x343e=function(_0x10d39e,_0x260735){_0x10d39e=_0x10d39e-0x0;var _0x27a17d=_0x43e3[_0x10d39e];return _0x27a17d;};'use strict';var FaxMessageEvents=require(_0x343e('0x0'));var events=[_0x343e('0x1'),_0x343e('0x2'),_0x343e('0x3')];function createListener(_0x121817,_0x377857){return function(_0x5be67b){_0x377857[_0x343e('0x4')](_0x121817,_0x5be67b);};}function removeListener(_0x5dbc8c,_0xf44427){return function(){FaxMessageEvents['removeListener'](_0x5dbc8c,_0xf44427);};}exports[_0x343e('0x5')]=function(_0x2502cd){for(var _0x53dd2b=0x0,_0x5731ba=events['length'];_0x53dd2b<_0x5731ba;_0x53dd2b++){var _0x2af912=events[_0x53dd2b];var _0x1fe035=createListener(_0x343e('0x6')+_0x2af912,_0x2502cd);FaxMessageEvents['on'](_0x2af912,_0x1fe035);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index f579386..252935e 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 _0x6e6c=['reject','/:id','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id/download','download','post','tracked','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var path=require('path');var timeout=require(_0xc6e6('0x2'));var express=require(_0xc6e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc6e6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6e6('0x5'));var controller=require('./faxMessage.controller');router[_0xc6e6('0x6')]('/',auth[_0xc6e6('0x7')](),controller['index']);router[_0xc6e6('0x6')](_0xc6e6('0x8'),auth['isAuthenticated'](),controller[_0xc6e6('0x9')]);router[_0xc6e6('0x6')]('/:id',auth[_0xc6e6('0x7')](),controller['show']);router[_0xc6e6('0x6')](_0xc6e6('0xa'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xb')]);router[_0xc6e6('0xc')]('/',auth[_0xc6e6('0x7')](),interaction[_0xc6e6('0xd')](_0xc6e6('0xe'),_0xc6e6('0xf')),controller['create']);router[_0xc6e6('0x10')]('/:id',auth[_0xc6e6('0x7')](),controller[_0xc6e6('0x11')]);router[_0xc6e6('0x10')](_0xc6e6('0x12'),auth['isAuthenticated'](),controller[_0xc6e6('0x13')]);router[_0xc6e6('0x10')](_0xc6e6('0x14'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0x15')]);router['delete'](_0xc6e6('0x16'),auth[_0xc6e6('0x7')](),controller['destroy']);module[_0xc6e6('0x17')]=router; \ No newline at end of file +var _0x1339=['/describe','describe','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','create','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4fcacc,_0x6e3b4){var _0x5e5678=function(_0x3d8f22){while(--_0x3d8f22){_0x4fcacc['push'](_0x4fcacc['shift']());}};_0x5e5678(++_0x6e3b4);}(_0x1339,0x1ed));var _0x9133=function(_0x27839a,_0x507e55){_0x27839a=_0x27839a-0x0;var _0x17ce15=_0x1339[_0x27839a];return _0x17ce15;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9133('0x0'));var timeout=require(_0x9133('0x1'));var express=require(_0x9133('0x2'));var router=express[_0x9133('0x3')]();var fs_extra=require(_0x9133('0x4'));var auth=require(_0x9133('0x5'));var interaction=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var controller=require('./faxMessage.controller');router[_0x9133('0x8')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0xa')]);router['get'](_0x9133('0xb'),auth[_0x9133('0x9')](),controller[_0x9133('0xc')]);router[_0x9133('0x8')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0xe')]);router[_0x9133('0x8')](_0x9133('0xf'),auth[_0x9133('0x9')](),controller['download']);router[_0x9133('0x10')]('/',auth[_0x9133('0x9')](),interaction[_0x9133('0x11')](_0x9133('0x12'),_0x9133('0x13')),controller[_0x9133('0x14')]);router['put'](_0x9133('0xd'),auth[_0x9133('0x9')](),controller['update']);router['put'](_0x9133('0x15'),auth['isAuthenticated'](),controller[_0x9133('0x16')]);router[_0x9133('0x17')](_0x9133('0x18'),auth[_0x9133('0x9')](),controller[_0x9133('0x19')]);router[_0x9133('0x1a')]('/:id',auth[_0x9133('0x9')](),controller[_0x9133('0x1b')]);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 0738790..fbc811a 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 _0x8b5f=['INTEGER','rrmemory','beepall','roundrobin','STRING','name'];(function(_0x59947a,_0x59ce0e){var _0x1790b0=function(_0x25d3c1){while(--_0x25d3c1){_0x59947a['push'](_0x59947a['shift']());}};_0x1790b0(++_0x59ce0e);}(_0x8b5f,0x106));var _0xf8b5=function(_0x3900bc,_0x5427aa){_0x3900bc=_0x3900bc-0x0;var _0x5e663b=_0x8b5f[_0x3900bc];return _0x5e663b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf8b5('0x0')],'unique':_0xf8b5('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf8b5('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf8b5('0x3'),_0xf8b5('0x4'),_0xf8b5('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xf8b5('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1250=['sequelize','STRING','name','INTEGER','ENUM','roundrobin'];(function(_0x3fc60c,_0xc669aa){var _0x10e498=function(_0x1d95c3){while(--_0x1d95c3){_0x3fc60c['push'](_0x3fc60c['shift']());}};_0x10e498(++_0xc669aa);}(_0x1250,0xde));var _0x0125=function(_0x46e891,_0x5bc0f1){_0x46e891=_0x46e891-0x0;var _0x39ef19=_0x1250[_0x46e891];return _0x39ef19;};'use strict';var Sequelize=require(_0x0125('0x0'));module['exports']={'name':{'type':Sequelize[_0x0125('0x1')],'unique':_0x0125('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0125('0x1')]},'timeout':{'type':Sequelize[_0x0125('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0125('0x4')]('rrmemory','beepall',_0x0125('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x0125('0x3')],'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 8b249ba..b69e398 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 _0xbbea=['clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','compact','value','ids','isEmpty','removeAgents','addAgents','omit','isArray','userFaxQueue:remove','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','FaxQueues','stack','name','send','index','map','FaxQueue','rawAttributes','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','include','rows','show','params','intersection','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserFaxQueue','pick','FaxQueueId','findAll','User','findAndCountAll','UserId','faxPause','createdAt','%s/%s','SIP','getTeams','addTeams','Team','online','voicePause','interface','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId'];(function(_0x30d1d4,_0x1b61c1){var _0x3a88cd=function(_0x21f8ec){while(--_0x21f8ec){_0x30d1d4['push'](_0x30d1d4['shift']());}};_0x3a88cd(++_0x1b61c1);}(_0xbbea,0x9b));var _0xabbe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbea[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xabbe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabbe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xabbe('0x2'));var moment=require(_0xabbe('0x3'));var BPromise=require(_0xabbe('0x4'));var Mustache=require(_0xabbe('0x5'));var util=require(_0xabbe('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xabbe('0x7'));var ejs=require(_0xabbe('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xabbe('0x9'));var squel=require(_0xabbe('0xa'));var crypto=require(_0xabbe('0xb'));var jsforce=require(_0xabbe('0xc'));var deskjs=require(_0xabbe('0xd'));var toCsv=require(_0xabbe('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xabbe('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xabbe('0xf'));var as=require(_0xabbe('0x10'));var hardwareService=require(_0xabbe('0x11'));var logger=require(_0xabbe('0x12'))(_0xabbe('0x13'));var utils=require(_0xabbe('0x14'));var config=require(_0xabbe('0x15'));var licenseUtil=require(_0xabbe('0x16'));var db=require('../../mysqldb')['db'];config[_0xabbe('0x17')]=_[_0xabbe('0x18')](config[_0xabbe('0x17')],{'host':_0xabbe('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x3abf61,_0x4c459f){_0x4c459f=_0x4c459f||0xcc;return function(_0x53051b){if(_0x53051b){return _0x3abf61[_0xabbe('0x1a')](_0x4c459f);}return _0x3abf61[_0xabbe('0x1b')](_0x4c459f)[_0xabbe('0x1c')]();};}function respondWithResult(_0x91b568,_0x302db8){_0x302db8=_0x302db8||0xc8;return function(_0x48bf3d){if(_0x48bf3d){return _0x91b568[_0xabbe('0x1b')](_0x302db8)[_0xabbe('0x1d')](_0x48bf3d);}};}function respondWithFilteredResult(_0x6b020,_0x53c9fe){return function(_0x542f34){if(_0x542f34){var _0x22e2f2=typeof _0x53c9fe[_0xabbe('0x1e')]===_0xabbe('0x1f')&&typeof _0x53c9fe[_0xabbe('0x20')]===_0xabbe('0x1f');var _0x57213c=_0x542f34[_0xabbe('0x21')];var _0x20e690=_0x22e2f2?0x0:_0x53c9fe[_0xabbe('0x1e')];var _0x11484d=_0x22e2f2?_0x542f34[_0xabbe('0x21')]:_0x53c9fe[_0xabbe('0x1e')]+_0x53c9fe[_0xabbe('0x20')];var _0x476be9;if(_0x11484d>=_0x57213c){_0x11484d=_0x57213c;_0x476be9=0xc8;}else{_0x476be9=0xce;}_0x6b020['status'](_0x476be9);return _0x6b020['set']('Content-Range',_0x20e690+'-'+_0x11484d+'/'+_0x57213c)[_0xabbe('0x1d')](_0x542f34);}return null;};}function patchUpdates(_0x2829e2){return function(_0x1b832e){try{jsonpatch[_0xabbe('0x22')](_0x1b832e,_0x2829e2,!![]);}catch(_0x4d742e){return BPromise[_0xabbe('0x23')](_0x4d742e);}return _0x1b832e['save']();};}function saveUpdates(_0x2a3a03,_0x34c823){return function(_0x1814c4){if(_0x1814c4){return _0x1814c4[_0xabbe('0x24')](_0x2a3a03)[_0xabbe('0x25')](function(_0x4a80ae){return _0x4a80ae;});}return null;};}function removeEntity(_0x5aef2b,_0x27dfa9){return function(_0x2210fe){if(_0x2210fe){return _0x2210fe[_0xabbe('0x26')]()[_0xabbe('0x25')](function(){var _0x4bf7c3=_0x2210fe['get']({'plain':!![]});var _0x2286d0=_0xabbe('0x27');return db['UserProfileResource'][_0xabbe('0x26')]({'where':{'type':_0x2286d0,'resourceId':_0x4bf7c3['id']}})[_0xabbe('0x25')](function(){return _0x2210fe;});})['then'](function(){_0x5aef2b[_0xabbe('0x1b')](0xcc)[_0xabbe('0x1c')]();});}};}function handleEntityNotFound(_0x43be3d,_0x5645d4){return function(_0x19510d){if(!_0x19510d){_0x43be3d[_0xabbe('0x1a')](0x194);}return _0x19510d;};}function handleError(_0x4e071e,_0x13186d){_0x13186d=_0x13186d||0x1f4;return function(_0x1b46b7){logger['error'](_0x1b46b7[_0xabbe('0x28')]);if(_0x1b46b7[_0xabbe('0x29')]){delete _0x1b46b7[_0xabbe('0x29')];}_0x4e071e['status'](_0x13186d)[_0xabbe('0x2a')](_0x1b46b7);};}exports[_0xabbe('0x2b')]=function(_0x2817d4,_0x971274){var _0x35780a={},_0x42d8f9={},_0x1b6cd9={'count':0x0,'rows':[]};var _0x4f1c22=_[_0xabbe('0x2c')](db[_0xabbe('0x2d')][_0xabbe('0x2e')],function(_0x732713){return{'name':_0x732713['fieldName'],'type':_0x732713[_0xabbe('0x2f')][_0xabbe('0x30')]};});_0x42d8f9[_0xabbe('0x31')]=_[_0xabbe('0x2c')](_0x4f1c22,_0xabbe('0x29'));_0x42d8f9[_0xabbe('0x32')]=_[_0xabbe('0x33')](_0x2817d4['query']);_0x42d8f9['filters']=_['intersection'](_0x42d8f9[_0xabbe('0x31')],_0x42d8f9[_0xabbe('0x32')]);_0x35780a[_0xabbe('0x34')]=_['intersection'](_0x42d8f9['model'],qs[_0xabbe('0x35')](_0x2817d4[_0xabbe('0x32')][_0xabbe('0x35')]));_0x35780a[_0xabbe('0x34')]=_0x35780a[_0xabbe('0x34')][_0xabbe('0x36')]?_0x35780a[_0xabbe('0x34')]:_0x42d8f9[_0xabbe('0x31')];if(!_0x2817d4[_0xabbe('0x32')][_0xabbe('0x37')](_0xabbe('0x38'))){_0x35780a[_0xabbe('0x20')]=qs[_0xabbe('0x20')](_0x2817d4[_0xabbe('0x32')][_0xabbe('0x20')]);_0x35780a[_0xabbe('0x1e')]=qs['offset'](_0x2817d4[_0xabbe('0x32')]['offset']);}_0x35780a[_0xabbe('0x39')]=qs[_0xabbe('0x3a')](_0x2817d4['query'][_0xabbe('0x3a')]);_0x35780a[_0xabbe('0x3b')]=qs['filters'](_['pick'](_0x2817d4[_0xabbe('0x32')],_0x42d8f9[_0xabbe('0x3c')]),_0x4f1c22);if(_0x2817d4[_0xabbe('0x32')]['filter']){_0x35780a[_0xabbe('0x3b')]=_['merge'](_0x35780a[_0xabbe('0x3b')],{'$or':_[_0xabbe('0x2c')](_0x4f1c22,function(_0x1cf544){if(_0x1cf544[_0xabbe('0x2f')]!==_0xabbe('0x3d')){var _0x2c9636={};_0x2c9636[_0x1cf544[_0xabbe('0x29')]]={'$like':'%'+_0x2817d4[_0xabbe('0x32')][_0xabbe('0x3e')]+'%'};return _0x2c9636;}})});}_0x35780a=_[_0xabbe('0x3f')]({},_0x35780a,_0x2817d4[_0xabbe('0x40')]);var _0x8d98af={'where':_0x35780a[_0xabbe('0x3b')]};return db[_0xabbe('0x2d')][_0xabbe('0x21')](_0x8d98af)[_0xabbe('0x25')](function(_0x160b25){_0x1b6cd9['count']=_0x160b25;if(_0x2817d4['query'][_0xabbe('0x41')]){_0x35780a[_0xabbe('0x42')]=[{'all':!![]}];}return db[_0xabbe('0x2d')]['findAll'](_0x35780a);})['then'](function(_0x10affd){_0x1b6cd9[_0xabbe('0x43')]=_0x10affd;return _0x1b6cd9;})[_0xabbe('0x25')](respondWithFilteredResult(_0x971274,_0x35780a))['catch'](handleError(_0x971274,null));};exports[_0xabbe('0x44')]=function(_0x4e8199,_0x547235){var _0x3328ac={'raw':!![],'where':{'id':_0x4e8199[_0xabbe('0x45')]['id']}},_0xc078ff={};_0xc078ff[_0xabbe('0x31')]=_['keys'](db[_0xabbe('0x2d')]['rawAttributes']);_0xc078ff[_0xabbe('0x32')]=_['keys'](_0x4e8199[_0xabbe('0x32')]);_0xc078ff[_0xabbe('0x3c')]=_[_0xabbe('0x46')](_0xc078ff[_0xabbe('0x31')],_0xc078ff[_0xabbe('0x32')]);_0x3328ac[_0xabbe('0x34')]=_[_0xabbe('0x46')](_0xc078ff[_0xabbe('0x31')],qs[_0xabbe('0x35')](_0x4e8199[_0xabbe('0x32')]['fields']));_0x3328ac[_0xabbe('0x34')]=_0x3328ac[_0xabbe('0x34')]['length']?_0x3328ac[_0xabbe('0x34')]:_0xc078ff[_0xabbe('0x31')];if(_0x4e8199['query'][_0xabbe('0x41')]){_0x3328ac['include']=[{'all':!![]}];}_0x3328ac=_[_0xabbe('0x3f')]({},_0x3328ac,_0x4e8199['options']);return db[_0xabbe('0x2d')][_0xabbe('0x47')](_0x3328ac)['then'](handleEntityNotFound(_0x547235,null))['then'](respondWithResult(_0x547235,null))['catch'](handleError(_0x547235,null));};exports[_0xabbe('0x48')]=function(_0x1f27cd,_0x2bf0eb){return db['FaxQueue']['create'](_0x1f27cd['body'],{})[_0xabbe('0x25')](function(_0x57447c){var _0x29ecc1=_0x1f27cd[_0xabbe('0x49')][_0xabbe('0x4a')]({'plain':!![]});if(!_0x29ecc1)throw new Error(_0xabbe('0x4b'));if(_0x29ecc1['role']===_0xabbe('0x49')){var _0x1af3b9=_0x57447c[_0xabbe('0x4a')]({'plain':!![]});var _0x44121c='FaxQueues';return db['UserProfileSection'][_0xabbe('0x47')]({'where':{'name':_0x44121c,'userProfileId':_0x29ecc1['userProfileId']},'raw':!![]})[_0xabbe('0x25')](function(_0x3e2e52){if(_0x3e2e52&&_0x3e2e52[_0xabbe('0x4c')]===0x0){return db[_0xabbe('0x4d')][_0xabbe('0x48')]({'name':_0x1af3b9[_0xabbe('0x29')],'resourceId':_0x1af3b9['id'],'type':_0x3e2e52['name'],'sectionId':_0x3e2e52['id']},{})[_0xabbe('0x25')](function(){return _0x57447c;});}else{return _0x57447c;}})[_0xabbe('0x4e')](function(_0x1cbd6a){logger[_0xabbe('0x4f')](_0xabbe('0x50'),_0x1cbd6a);throw _0x1cbd6a;});}return _0x57447c;})[_0xabbe('0x25')](respondWithResult(_0x2bf0eb,0xc9))[_0xabbe('0x4e')](handleError(_0x2bf0eb,null));};exports['update']=function(_0x2a65b2,_0x223498){if(_0x2a65b2[_0xabbe('0x51')]['id']){delete _0x2a65b2[_0xabbe('0x51')]['id'];}return db[_0xabbe('0x2d')][_0xabbe('0x47')]({'where':{'id':_0x2a65b2['params']['id']}})[_0xabbe('0x25')](handleEntityNotFound(_0x223498,null))['then'](saveUpdates(_0x2a65b2[_0xabbe('0x51')],null))[_0xabbe('0x25')](respondWithResult(_0x223498,null))['catch'](handleError(_0x223498,null));};exports[_0xabbe('0x26')]=function(_0x3b95b8,_0x21bf08){return db['FaxQueue'][_0xabbe('0x47')]({'where':{'id':_0x3b95b8['params']['id']}})['then'](handleEntityNotFound(_0x21bf08,null))[_0xabbe('0x25')](removeEntity(_0x21bf08,null))['catch'](handleError(_0x21bf08,null));};exports[_0xabbe('0x52')]=function(_0x1640ba,_0x302733){return db['FaxQueue'][_0xabbe('0x52')]()['then'](respondWithResult(_0x302733,null))[_0xabbe('0x4e')](handleError(_0x302733,null));};exports['getMembers']=function(_0x85fa73,_0x4908ad,_0xd4a92b){var _0x4becb4={'raw':!![],'where':{}},_0x2575a0={},_0xaba325;return db['FaxQueue'][_0xabbe('0x53')]({'where':{'id':_0x85fa73[_0xabbe('0x45')]['id']}})[_0xabbe('0x25')](handleEntityNotFound(_0x4908ad,null))[_0xabbe('0x25')](function(_0x27c16e){if(_0x27c16e){_0xaba325=_0x27c16e[_0xabbe('0x4a')]({'plain':!![]});_0x2575a0[_0xabbe('0x31')]=_[_0xabbe('0x33')](db[_0xabbe('0x54')][_0xabbe('0x2e')]);_0x2575a0[_0xabbe('0x32')]=_[_0xabbe('0x33')](_0x85fa73[_0xabbe('0x32')]);_0x2575a0[_0xabbe('0x3c')]=_[_0xabbe('0x46')](_0x2575a0['model'],_0x2575a0[_0xabbe('0x32')]);_0x4becb4[_0xabbe('0x34')]=_[_0xabbe('0x46')](_0x2575a0[_0xabbe('0x31')],qs[_0xabbe('0x35')](_0x85fa73[_0xabbe('0x32')][_0xabbe('0x35')]));_0x4becb4['attributes']=_0x4becb4[_0xabbe('0x34')][_0xabbe('0x36')]?_0x4becb4[_0xabbe('0x34')]:_0x2575a0[_0xabbe('0x31')];if(!_0x85fa73['query'][_0xabbe('0x37')]('nolimit')){_0x4becb4[_0xabbe('0x20')]=qs[_0xabbe('0x20')](_0x85fa73['query']['limit']);_0x4becb4[_0xabbe('0x1e')]=qs['offset'](_0x85fa73[_0xabbe('0x32')][_0xabbe('0x1e')]);}_0x4becb4[_0xabbe('0x39')]=qs['sort'](_0x85fa73[_0xabbe('0x32')][_0xabbe('0x3a')]);_0x4becb4['where']=qs[_0xabbe('0x3c')](_[_0xabbe('0x55')](_0x85fa73['query'],_0x2575a0[_0xabbe('0x3c')]));_0x4becb4[_0xabbe('0x3b')][_0xabbe('0x56')]=_0x27c16e['id'];if(_0x85fa73[_0xabbe('0x32')][_0xabbe('0x3e')]){_0x4becb4[_0xabbe('0x3b')]=_[_0xabbe('0x3f')](_0x4becb4[_0xabbe('0x3b')],{'$or':_['map'](_0x4becb4[_0xabbe('0x34')],function(_0x1b56af){var _0x3cab80={};_0x3cab80[_0x1b56af]={'$like':'%'+_0x85fa73['query'][_0xabbe('0x3e')]+'%'};return _0x3cab80;})});}_0x4becb4=_['merge']({},_0x4becb4,_0x85fa73[_0xabbe('0x40')]);return db[_0xabbe('0x54')][_0xabbe('0x57')](_0x4becb4);}})[_0xabbe('0x25')](function(_0x2aadc7){if(_0x2aadc7){return db[_0xabbe('0x58')][_0xabbe('0x59')]({'where':{'id':_[_0xabbe('0x2c')](_0x2aadc7,_0xabbe('0x5a')),'role':'agent'},'attributes':['id','name',_0xabbe('0x5b'),'updatedAt',_0xabbe('0x5c')]});}})[_0xabbe('0x25')](function(_0x1b16c7){if(_0x1b16c7){return{'count':_0x1b16c7['count'],'rows':_[_0xabbe('0x2c')](_0x1b16c7[_0xabbe('0x43')],function(_0xd94618){return{'membername':_0xd94618[_0xabbe('0x29')],'UserId':_0xd94618['id'],'queue_name':_0xaba325[_0xabbe('0x29')],'FaxQueueId':_0xaba325['id'],'interface':util['format'](_0xabbe('0x5d'),_0xabbe('0x5e'),_0xd94618[_0xabbe('0x29')]),'penalty':0x0,'paused':_0xd94618[_0xabbe('0x5b')],'createdAt':_0xd94618[_0xabbe('0x5c')],'updatedAt':_0xd94618['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4908ad,_0x4becb4))[_0xabbe('0x4e')](handleError(_0x4908ad,null));};exports[_0xabbe('0x5f')]=function(_0x140bb3,_0x4723c2,_0x2d3244){var _0x21d9b1={};var _0x492dd6={};var _0x3e93bc;var _0x2115fb;return db[_0xabbe('0x2d')][_0xabbe('0x53')]({'where':{'id':_0x140bb3[_0xabbe('0x45')]['id']}})['then'](handleEntityNotFound(_0x4723c2,null))['then'](function(_0x5b0b04){if(_0x5b0b04){_0x3e93bc=_0x5b0b04;_0x492dd6['model']=_['keys'](db['Team'][_0xabbe('0x2e')]);_0x492dd6[_0xabbe('0x32')]=_['keys'](_0x140bb3['query']);_0x492dd6['filters']=_['intersection'](_0x492dd6[_0xabbe('0x31')],_0x492dd6[_0xabbe('0x32')]);_0x21d9b1['attributes']=_['intersection'](_0x492dd6[_0xabbe('0x31')],qs[_0xabbe('0x35')](_0x140bb3[_0xabbe('0x32')][_0xabbe('0x35')]));_0x21d9b1[_0xabbe('0x34')]=_0x21d9b1[_0xabbe('0x34')][_0xabbe('0x36')]?_0x21d9b1[_0xabbe('0x34')]:_0x492dd6[_0xabbe('0x31')];_0x21d9b1['order']=qs['sort'](_0x140bb3[_0xabbe('0x32')]['sort']);_0x21d9b1[_0xabbe('0x3b')]=qs[_0xabbe('0x3c')](_[_0xabbe('0x55')](_0x140bb3[_0xabbe('0x32')],_0x492dd6[_0xabbe('0x3c')]));if(_0x140bb3[_0xabbe('0x32')]['filter']){_0x21d9b1[_0xabbe('0x3b')]=_[_0xabbe('0x3f')](_0x21d9b1[_0xabbe('0x3b')],{'$or':_[_0xabbe('0x2c')](_0x21d9b1[_0xabbe('0x34')],function(_0x161def){var _0x765c96={};_0x765c96[_0x161def]={'$like':'%'+_0x140bb3['query'][_0xabbe('0x3e')]+'%'};return _0x765c96;})});}_0x21d9b1=_[_0xabbe('0x3f')]({},_0x21d9b1,_0x140bb3['options']);return _0x3e93bc[_0xabbe('0x5f')](_0x21d9b1);}})[_0xabbe('0x25')](function(_0xaa9abf){if(_0xaa9abf){_0x2115fb=_0xaa9abf[_0xabbe('0x36')];if(!_0x140bb3[_0xabbe('0x32')]['hasOwnProperty'](_0xabbe('0x38'))){_0x21d9b1['limit']=qs[_0xabbe('0x20')](_0x140bb3['query']['limit']);_0x21d9b1[_0xabbe('0x1e')]=qs['offset'](_0x140bb3[_0xabbe('0x32')]['offset']);}return _0x3e93bc[_0xabbe('0x5f')](_0x21d9b1);}})[_0xabbe('0x25')](function(_0x28f193){if(_0x28f193){return _0x28f193?{'count':_0x2115fb,'rows':_0x28f193}:null;}})[_0xabbe('0x25')](respondWithResult(_0x4723c2,null))[_0xabbe('0x4e')](handleError(_0x4723c2,null));};exports[_0xabbe('0x60')]=function(_0x175944,_0x3034d5,_0x2df893){var _0x381e30=_0x175944['body']['ids'];return db[_0xabbe('0x61')][_0xabbe('0x57')]({'where':{'id':_0x381e30},'attributes':['id'],'include':[{'model':db[_0xabbe('0x58')],'as':'Agents','attributes':['id',_0xabbe('0x29'),_0xabbe('0x62'),_0xabbe('0x63'),_0xabbe('0x64')],'raw':!![]}]})[_0xabbe('0x25')](function(_0x266183){if(_0x266183){var _0x57d511=_[_0xabbe('0x65')](_0x266183,function(_0x10991b){var _0x1b1bb8=_0x10991b['get']({'plain':!![]});return _0x1b1bb8[_0xabbe('0x66')];});return db['FaxQueue']['find']({'where':{'id':_0x175944[_0xabbe('0x45')]['id']}})['then'](function(_0x3c0f01){return db[_0xabbe('0x67')][_0xabbe('0x68')](function(_0x3ccffd){return _0x3c0f01[_0xabbe('0x60')](_0x381e30,{'transaction':_0x3ccffd})[_0xabbe('0x25')](function(){return BPromise['each'](_0x57d511,function(_0x145f35){return db[_0xabbe('0x54')][_0xabbe('0x69')]({'where':{'UserId':_0x145f35['id'],'FaxQueueId':_0x175944[_0xabbe('0x45')]['id']},'transaction':_0x3ccffd});});})['then'](function(){_0x57d511[_0xabbe('0x6a')](function(_0x313371){socket[_0xabbe('0x6b')](_0xabbe('0x6c'),{'UserId':_0x313371['id'],'FaxQueueId':_0x3c0f01['id']});});});});});}})[_0xabbe('0x25')](respondWithStatusCode(_0x3034d5,null))['catch'](handleError(_0x3034d5,null));};exports[_0xabbe('0x6d')]=function(_0x5ddbcb,_0x411bc7,_0x2b7bda){return db[_0xabbe('0x61')][_0xabbe('0x57')]({'where':{'id':_0x5ddbcb[_0xabbe('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0xabbe('0x58')],'as':_0xabbe('0x66'),'attributes':['id'],'raw':!![]}]})[_0xabbe('0x25')](handleEntityNotFound(_0x411bc7,null))[_0xabbe('0x25')](function(_0x564989){var _0x201c2e=_[_0xabbe('0x2c')](_0x564989,'id');var _0x531dc7=[];var _0x55a8c0=[];var _0x7b7bc=squel[_0xabbe('0x6e')]();_0x7b7bc[_0xabbe('0x6f')](_0xabbe('0x70'))[_0xabbe('0x71')](_0xabbe('0x72'),'tq')[_0xabbe('0x73')]('user_has_teams','ut',_0xabbe('0x74'))[_0xabbe('0x3b')]('FaxQueueId\x20=\x20?',_0x5ddbcb[_0xabbe('0x45')]['id']);for(var _0x114505=0x0;_0x114505<_0x564989[_0xabbe('0x36')];_0x114505+=0x1){let _0x49c15a=_0x564989[_0x114505];for(var _0x112084=0x0;_0x112084<_0x49c15a[_0xabbe('0x66')][_0xabbe('0x36')];_0x112084+=0x1){let _0x17b26f=_0x49c15a[_0xabbe('0x66')][_0x112084];var _0x42a355=_0x7b7bc[_0xabbe('0x75')]();_0x42a355[_0xabbe('0x3b')](_0xabbe('0x76'),_0x17b26f['id']);_0x55a8c0[_0xabbe('0x77')](db[_0xabbe('0x67')][_0xabbe('0x32')](_0x42a355[_0xabbe('0x78')](),{'type':db[_0xabbe('0x67')][_0xabbe('0x79')]['SELECT']})['then'](function(_0x2c74bc){if(_0x2c74bc[_0xabbe('0x36')]===0x1){return _0x17b26f['id'];}else{var _0xeccf24=_[_0xabbe('0x7a')](_[_0xabbe('0x2c')](_0x2c74bc,'TeamId'),function(_0x429ced){return _[_0xabbe('0x7b')](_0x201c2e,_0x429ced);});if(_0xeccf24){return _0x17b26f['id'];}}}));}}return BPromise[_0xabbe('0x7c')](_0x55a8c0)[_0xabbe('0x25')](function(_0x4871eb){_0x531dc7=_(_0x531dc7)[_0xabbe('0x7d')](_0x4871eb)[_0xabbe('0x7e')]()[_0xabbe('0x7f')]();return db[_0xabbe('0x2d')][_0xabbe('0x47')]({'where':{'id':_0x5ddbcb[_0xabbe('0x45')]['id']}})['then'](function(_0x2b2691){return db['sequelize'][_0xabbe('0x68')](function(_0x41e790){return _0x2b2691[_0xabbe('0x6d')](_0x5ddbcb[_0xabbe('0x32')][_0xabbe('0x80')],{'transaction':_0x41e790})['then'](function(){if(!_[_0xabbe('0x81')](_0x531dc7)){return _0x2b2691[_0xabbe('0x82')](_0x531dc7,{'transaction':_0x41e790});}})[_0xabbe('0x25')](function(){_0x531dc7[_0xabbe('0x6a')](function(_0x1c4610){socket['emit']('userFaxQueue:remove',{'UserId':_0x1c4610,'FaxQueueId':_0x2b2691['id']});});});});});});})[_0xabbe('0x25')](respondWithStatusCode(_0x411bc7,null))[_0xabbe('0x4e')](handleError(_0x411bc7,null));};exports['addAgents']=function(_0x2ffd70,_0x2fdcbd,_0x5e94f8){return db[_0xabbe('0x2d')][_0xabbe('0x47')]({'where':{'id':_0x2ffd70[_0xabbe('0x45')]['id']}})[_0xabbe('0x25')](handleEntityNotFound(_0x2fdcbd,null))[_0xabbe('0x25')](function(_0xba50d7){if(_0xba50d7){return _0xba50d7[_0xabbe('0x83')](_0x2ffd70[_0xabbe('0x51')][_0xabbe('0x80')],_[_0xabbe('0x84')](_0x2ffd70[_0xabbe('0x51')],[_0xabbe('0x80'),'id'])||{})['spread'](function(_0x298d17){for(var _0x2cde1c=0x0;_0x2cde1c<_0x2ffd70[_0xabbe('0x51')][_0xabbe('0x80')][_0xabbe('0x36')];_0x2cde1c+=0x1){socket[_0xabbe('0x6b')]('userFaxQueue:save',{'UserId':Number(_0x2ffd70['body']['ids'][_0x2cde1c]),'FaxQueueId':Number(_0x2ffd70['params']['id'])});}return _0x298d17;});}})[_0xabbe('0x25')](respondWithResult(_0x2fdcbd,null))[_0xabbe('0x4e')](handleError(_0x2fdcbd,null));};exports['removeAgents']=function(_0x2b310c,_0x271438,_0x56d389){return db['FaxQueue']['find']({'where':{'id':_0x2b310c['params']['id']}})[_0xabbe('0x25')](handleEntityNotFound(_0x271438,null))[_0xabbe('0x25')](function(_0x469d0a){if(_0x469d0a){return _0x469d0a[_0xabbe('0x82')](_0x2b310c[_0xabbe('0x32')][_0xabbe('0x80')])['then'](function(){if(_[_0xabbe('0x85')](_0x2b310c[_0xabbe('0x32')][_0xabbe('0x80')])){for(var _0x3a7385=0x0;_0x3a7385<_0x2b310c[_0xabbe('0x32')][_0xabbe('0x80')]['length'];_0x3a7385+=0x1){socket['emit'](_0xabbe('0x86'),{'UserId':Number(_0x2b310c[_0xabbe('0x32')][_0xabbe('0x80')][_0x3a7385]),'FaxQueueId':Number(_0x2b310c[_0xabbe('0x45')]['id'])});}}else{socket[_0xabbe('0x6b')]('userFaxQueue:remove',{'UserId':Number(_0x2b310c[_0xabbe('0x32')][_0xabbe('0x80')]),'FaxQueueId':Number(_0x2b310c[_0xabbe('0x45')]['id'])});}});}})[_0xabbe('0x25')](respondWithStatusCode(_0x271438,null))[_0xabbe('0x4e')](handleError(_0x271438,null));};exports[_0xabbe('0x87')]=function(_0x2daf90,_0x5a939e,_0x2ae778){var _0x29547d={};var _0x2acbe1={};var _0x3580ae;var _0x203366;return db[_0xabbe('0x2d')][_0xabbe('0x53')]({'where':{'id':_0x2daf90[_0xabbe('0x45')]['id']}})[_0xabbe('0x25')](handleEntityNotFound(_0x5a939e,null))[_0xabbe('0x25')](function(_0x4ce863){if(_0x4ce863){_0x3580ae=_0x4ce863;_0x2acbe1[_0xabbe('0x31')]=_[_0xabbe('0x33')](db[_0xabbe('0x58')][_0xabbe('0x2e')]);_0x2acbe1['query']=_['keys'](_0x2daf90[_0xabbe('0x32')]);_0x2acbe1[_0xabbe('0x3c')]=_['intersection'](_0x2acbe1[_0xabbe('0x31')],_0x2acbe1['query']);_0x29547d[_0xabbe('0x34')]=_['intersection'](_0x2acbe1[_0xabbe('0x31')],qs['fields'](_0x2daf90['query'][_0xabbe('0x35')]));_0x29547d[_0xabbe('0x34')]=_0x29547d[_0xabbe('0x34')]['length']?_0x29547d[_0xabbe('0x34')]:_0x2acbe1[_0xabbe('0x31')];_0x29547d[_0xabbe('0x39')]=qs['sort'](_0x2daf90[_0xabbe('0x32')]['sort']);_0x29547d[_0xabbe('0x3b')]=qs['filters'](_[_0xabbe('0x55')](_0x2daf90['query'],_0x2acbe1[_0xabbe('0x3c')]));if(_0x2daf90[_0xabbe('0x32')][_0xabbe('0x3e')]){_0x29547d['where']=_[_0xabbe('0x3f')](_0x29547d[_0xabbe('0x3b')],{'$or':_['map'](_0x29547d[_0xabbe('0x34')],function(_0x3bc5cf){var _0x34f630={};_0x34f630[_0x3bc5cf]={'$like':'%'+_0x2daf90[_0xabbe('0x32')][_0xabbe('0x3e')]+'%'};return _0x34f630;})});}_0x29547d=_[_0xabbe('0x3f')]({},_0x29547d,_0x2daf90['options']);return _0x3580ae[_0xabbe('0x87')](_0x29547d);}})[_0xabbe('0x25')](function(_0x243ace){if(_0x243ace){_0x203366=_0x243ace[_0xabbe('0x36')];if(!_0x2daf90[_0xabbe('0x32')][_0xabbe('0x37')]('nolimit')){_0x29547d[_0xabbe('0x20')]=qs[_0xabbe('0x20')](_0x2daf90[_0xabbe('0x32')][_0xabbe('0x20')]);_0x29547d[_0xabbe('0x1e')]=qs['offset'](_0x2daf90[_0xabbe('0x32')][_0xabbe('0x1e')]);}return _0x3580ae[_0xabbe('0x87')](_0x29547d);}})[_0xabbe('0x25')](function(_0x2a7637){if(_0x2a7637){return _0x2a7637?{'count':_0x203366,'rows':_0x2a7637}:null;}})[_0xabbe('0x25')](respondWithResult(_0x5a939e,null))['catch'](handleError(_0x5a939e,null));}; \ No newline at end of file +var _0xbbc4=['set','json','apply','reject','save','then','get','FaxQueues','UserProfileResource','destroy','error','stack','name','index','map','FaxQueue','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','length','nolimit','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','format','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','transaction','each','emit','userFaxQueue:save','removeTeams','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','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','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','count','limit'];(function(_0x2fcf18,_0x10009a){var _0x4c68cc=function(_0x444002){while(--_0x444002){_0x2fcf18['push'](_0x2fcf18['shift']());}};_0x4c68cc(++_0x10009a);}(_0xbbc4,0x177));var _0x4bbc=function(_0x3e2775,_0x15504f){_0x3e2775=_0x3e2775-0x0;var _0x3bd340=_0xbbc4[_0x3e2775];return _0x3bd340;};'use strict';var emlformat=require(_0x4bbc('0x0'));var rimraf=require(_0x4bbc('0x1'));var zipdir=require(_0x4bbc('0x2'));var jsonpatch=require(_0x4bbc('0x3'));var rp=require('request-promise');var moment=require(_0x4bbc('0x4'));var BPromise=require(_0x4bbc('0x5'));var Mustache=require(_0x4bbc('0x6'));var util=require(_0x4bbc('0x7'));var path=require('path');var sox=require(_0x4bbc('0x8'));var csv=require(_0x4bbc('0x9'));var ejs=require(_0x4bbc('0xa'));var fs=require('fs');var fs_extra=require(_0x4bbc('0xb'));var _=require(_0x4bbc('0xc'));var squel=require(_0x4bbc('0xd'));var crypto=require(_0x4bbc('0xe'));var jsforce=require(_0x4bbc('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4bbc('0x9'));var querystring=require(_0x4bbc('0x10'));var Papa=require(_0x4bbc('0x11'));var Redis=require('ioredis');var authService=require(_0x4bbc('0x12'));var qs=require(_0x4bbc('0x13'));var as=require(_0x4bbc('0x14'));var hardwareService=require(_0x4bbc('0x15'));var logger=require(_0x4bbc('0x16'))(_0x4bbc('0x17'));var utils=require(_0x4bbc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4bbc('0x19'));var db=require('../../mysqldb')['db'];config[_0x4bbc('0x1a')]=_['defaults'](config[_0x4bbc('0x1a')],{'host':_0x4bbc('0x1b'),'port':0x18eb});var socket=require(_0x4bbc('0x1c'))(new Redis(config['redis']));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x3496b0,_0x4731d8){_0x4731d8=_0x4731d8||0xcc;return function(_0x577182){if(_0x577182){return _0x3496b0[_0x4bbc('0x1d')](_0x4731d8);}return _0x3496b0[_0x4bbc('0x1e')](_0x4731d8)[_0x4bbc('0x1f')]();};}function respondWithResult(_0x20ed12,_0x33da86){_0x33da86=_0x33da86||0xc8;return function(_0xf7cf7){if(_0xf7cf7){return _0x20ed12[_0x4bbc('0x1e')](_0x33da86)['json'](_0xf7cf7);}};}function respondWithFilteredResult(_0x239cf4,_0x398c38){return function(_0xdbc085){if(_0xdbc085){var _0x257a0c=typeof _0x398c38[_0x4bbc('0x20')]===_0x4bbc('0x21')&&typeof _0x398c38['limit']===_0x4bbc('0x21');var _0x384737=_0xdbc085[_0x4bbc('0x22')];var _0x584d61=_0x257a0c?0x0:_0x398c38[_0x4bbc('0x20')];var _0x5383fe=_0x257a0c?_0xdbc085[_0x4bbc('0x22')]:_0x398c38[_0x4bbc('0x20')]+_0x398c38[_0x4bbc('0x23')];var _0x2be9a2;if(_0x5383fe>=_0x384737){_0x5383fe=_0x384737;_0x2be9a2=0xc8;}else{_0x2be9a2=0xce;}_0x239cf4['status'](_0x2be9a2);return _0x239cf4[_0x4bbc('0x24')]('Content-Range',_0x584d61+'-'+_0x5383fe+'/'+_0x384737)[_0x4bbc('0x25')](_0xdbc085);}return null;};}function patchUpdates(_0x3edd26){return function(_0x5113da){try{jsonpatch[_0x4bbc('0x26')](_0x5113da,_0x3edd26,!![]);}catch(_0x32b606){return BPromise[_0x4bbc('0x27')](_0x32b606);}return _0x5113da[_0x4bbc('0x28')]();};}function saveUpdates(_0x3f92a6,_0x1acbfc){return function(_0xd0bf05){if(_0xd0bf05){return _0xd0bf05['update'](_0x3f92a6)[_0x4bbc('0x29')](function(_0x339633){return _0x339633;});}return null;};}function removeEntity(_0x31b1f8,_0x19d012){return function(_0x497114){if(_0x497114){return _0x497114['destroy']()[_0x4bbc('0x29')](function(){var _0x3508ed=_0x497114[_0x4bbc('0x2a')]({'plain':!![]});var _0x53347b=_0x4bbc('0x2b');return db[_0x4bbc('0x2c')][_0x4bbc('0x2d')]({'where':{'type':_0x53347b,'resourceId':_0x3508ed['id']}})[_0x4bbc('0x29')](function(){return _0x497114;});})['then'](function(){_0x31b1f8['status'](0xcc)[_0x4bbc('0x1f')]();});}};}function handleEntityNotFound(_0x21ddc9,_0x4e2a09){return function(_0x40b983){if(!_0x40b983){_0x21ddc9['sendStatus'](0x194);}return _0x40b983;};}function handleError(_0x3ef24e,_0x2dd429){_0x2dd429=_0x2dd429||0x1f4;return function(_0x5b0b1f){logger[_0x4bbc('0x2e')](_0x5b0b1f[_0x4bbc('0x2f')]);if(_0x5b0b1f['name']){delete _0x5b0b1f[_0x4bbc('0x30')];}_0x3ef24e[_0x4bbc('0x1e')](_0x2dd429)['send'](_0x5b0b1f);};}exports[_0x4bbc('0x31')]=function(_0x179129,_0x41ee9b){var _0x1ec80c={},_0x31f9bb={},_0x4f9216={'count':0x0,'rows':[]};var _0x3e3c88=_[_0x4bbc('0x32')](db[_0x4bbc('0x33')]['rawAttributes'],function(_0x5d7f23){return{'name':_0x5d7f23[_0x4bbc('0x34')],'type':_0x5d7f23['type']['key']};});_0x31f9bb[_0x4bbc('0x35')]=_[_0x4bbc('0x32')](_0x3e3c88,_0x4bbc('0x30'));_0x31f9bb[_0x4bbc('0x36')]=_[_0x4bbc('0x37')](_0x179129[_0x4bbc('0x36')]);_0x31f9bb[_0x4bbc('0x38')]=_[_0x4bbc('0x39')](_0x31f9bb[_0x4bbc('0x35')],_0x31f9bb[_0x4bbc('0x36')]);_0x1ec80c[_0x4bbc('0x3a')]=_[_0x4bbc('0x39')](_0x31f9bb[_0x4bbc('0x35')],qs[_0x4bbc('0x3b')](_0x179129[_0x4bbc('0x36')][_0x4bbc('0x3b')]));_0x1ec80c[_0x4bbc('0x3a')]=_0x1ec80c[_0x4bbc('0x3a')]['length']?_0x1ec80c[_0x4bbc('0x3a')]:_0x31f9bb[_0x4bbc('0x35')];if(!_0x179129[_0x4bbc('0x36')][_0x4bbc('0x3c')]('nolimit')){_0x1ec80c[_0x4bbc('0x23')]=qs[_0x4bbc('0x23')](_0x179129[_0x4bbc('0x36')][_0x4bbc('0x23')]);_0x1ec80c[_0x4bbc('0x20')]=qs[_0x4bbc('0x20')](_0x179129['query'][_0x4bbc('0x20')]);}_0x1ec80c[_0x4bbc('0x3d')]=qs[_0x4bbc('0x3e')](_0x179129[_0x4bbc('0x36')][_0x4bbc('0x3e')]);_0x1ec80c[_0x4bbc('0x3f')]=qs['filters'](_[_0x4bbc('0x40')](_0x179129[_0x4bbc('0x36')],_0x31f9bb[_0x4bbc('0x38')]),_0x3e3c88);if(_0x179129[_0x4bbc('0x36')][_0x4bbc('0x41')]){_0x1ec80c[_0x4bbc('0x3f')]=_[_0x4bbc('0x42')](_0x1ec80c[_0x4bbc('0x3f')],{'$or':_[_0x4bbc('0x32')](_0x3e3c88,function(_0x409f97){if(_0x409f97['type']!=='VIRTUAL'){var _0x5b2ddd={};_0x5b2ddd[_0x409f97[_0x4bbc('0x30')]]={'$like':'%'+_0x179129[_0x4bbc('0x36')][_0x4bbc('0x41')]+'%'};return _0x5b2ddd;}})});}_0x1ec80c=_['merge']({},_0x1ec80c,_0x179129[_0x4bbc('0x43')]);var _0x3719a6={'where':_0x1ec80c[_0x4bbc('0x3f')]};return db[_0x4bbc('0x33')][_0x4bbc('0x22')](_0x3719a6)[_0x4bbc('0x29')](function(_0x44b47f){_0x4f9216['count']=_0x44b47f;if(_0x179129[_0x4bbc('0x36')][_0x4bbc('0x44')]){_0x1ec80c[_0x4bbc('0x45')]=[{'all':!![]}];}return db[_0x4bbc('0x33')][_0x4bbc('0x46')](_0x1ec80c);})[_0x4bbc('0x29')](function(_0xb94382){_0x4f9216[_0x4bbc('0x47')]=_0xb94382;return _0x4f9216;})['then'](respondWithFilteredResult(_0x41ee9b,_0x1ec80c))[_0x4bbc('0x48')](handleError(_0x41ee9b,null));};exports[_0x4bbc('0x49')]=function(_0x370c2b,_0x21724c){var _0x1942ae={'raw':!![],'where':{'id':_0x370c2b[_0x4bbc('0x4a')]['id']}},_0x781a1e={};_0x781a1e['model']=_[_0x4bbc('0x37')](db['FaxQueue'][_0x4bbc('0x4b')]);_0x781a1e[_0x4bbc('0x36')]=_[_0x4bbc('0x37')](_0x370c2b['query']);_0x781a1e[_0x4bbc('0x38')]=_['intersection'](_0x781a1e['model'],_0x781a1e['query']);_0x1942ae[_0x4bbc('0x3a')]=_['intersection'](_0x781a1e[_0x4bbc('0x35')],qs[_0x4bbc('0x3b')](_0x370c2b[_0x4bbc('0x36')]['fields']));_0x1942ae[_0x4bbc('0x3a')]=_0x1942ae[_0x4bbc('0x3a')]['length']?_0x1942ae[_0x4bbc('0x3a')]:_0x781a1e['model'];if(_0x370c2b[_0x4bbc('0x36')][_0x4bbc('0x44')]){_0x1942ae[_0x4bbc('0x45')]=[{'all':!![]}];}_0x1942ae=_['merge']({},_0x1942ae,_0x370c2b[_0x4bbc('0x43')]);return db['FaxQueue'][_0x4bbc('0x4c')](_0x1942ae)['then'](handleEntityNotFound(_0x21724c,null))['then'](respondWithResult(_0x21724c,null))[_0x4bbc('0x48')](handleError(_0x21724c,null));};exports[_0x4bbc('0x4d')]=function(_0x5d1ab6,_0x440d2f){return db[_0x4bbc('0x33')]['create'](_0x5d1ab6[_0x4bbc('0x4e')],{})[_0x4bbc('0x29')](function(_0x28096b){var _0x1bea5d=_0x5d1ab6[_0x4bbc('0x4f')]['get']({'plain':!![]});if(!_0x1bea5d)throw new Error(_0x4bbc('0x50'));if(_0x1bea5d['role']===_0x4bbc('0x4f')){var _0xb8b27e=_0x28096b[_0x4bbc('0x2a')]({'plain':!![]});var _0x199835='FaxQueues';return db['UserProfileSection'][_0x4bbc('0x4c')]({'where':{'name':_0x199835,'userProfileId':_0x1bea5d['userProfileId']},'raw':!![]})[_0x4bbc('0x29')](function(_0x2ebb24){if(_0x2ebb24&&_0x2ebb24[_0x4bbc('0x51')]===0x0){return db[_0x4bbc('0x2c')][_0x4bbc('0x4d')]({'name':_0xb8b27e[_0x4bbc('0x30')],'resourceId':_0xb8b27e['id'],'type':_0x2ebb24[_0x4bbc('0x30')],'sectionId':_0x2ebb24['id']},{})[_0x4bbc('0x29')](function(){return _0x28096b;});}else{return _0x28096b;}})[_0x4bbc('0x48')](function(_0xa68bfe){logger['error'](_0x4bbc('0x52'),_0xa68bfe);throw _0xa68bfe;});}return _0x28096b;})[_0x4bbc('0x29')](respondWithResult(_0x440d2f,0xc9))[_0x4bbc('0x48')](handleError(_0x440d2f,null));};exports['update']=function(_0xc99892,_0x2343f5){if(_0xc99892[_0x4bbc('0x4e')]['id']){delete _0xc99892['body']['id'];}return db[_0x4bbc('0x33')][_0x4bbc('0x4c')]({'where':{'id':_0xc99892[_0x4bbc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2343f5,null))[_0x4bbc('0x29')](saveUpdates(_0xc99892[_0x4bbc('0x4e')],null))['then'](respondWithResult(_0x2343f5,null))['catch'](handleError(_0x2343f5,null));};exports[_0x4bbc('0x2d')]=function(_0x17752f,_0x372099){return db[_0x4bbc('0x33')][_0x4bbc('0x4c')]({'where':{'id':_0x17752f[_0x4bbc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x372099,null))['then'](removeEntity(_0x372099,null))[_0x4bbc('0x48')](handleError(_0x372099,null));};exports['describe']=function(_0x4ee8f0,_0x263660){return db['FaxQueue'][_0x4bbc('0x53')]()['then'](respondWithResult(_0x263660,null))[_0x4bbc('0x48')](handleError(_0x263660,null));};exports[_0x4bbc('0x54')]=function(_0x5362b4,_0x452ecc,_0x5a1170){var _0x58fe32={'raw':!![],'where':{}},_0x438fe2={},_0x4348e6;return db[_0x4bbc('0x33')][_0x4bbc('0x55')]({'where':{'id':_0x5362b4[_0x4bbc('0x4a')]['id']}})[_0x4bbc('0x29')](handleEntityNotFound(_0x452ecc,null))[_0x4bbc('0x29')](function(_0xf2aa37){if(_0xf2aa37){_0x4348e6=_0xf2aa37[_0x4bbc('0x2a')]({'plain':!![]});_0x438fe2[_0x4bbc('0x35')]=_[_0x4bbc('0x37')](db[_0x4bbc('0x56')][_0x4bbc('0x4b')]);_0x438fe2['query']=_[_0x4bbc('0x37')](_0x5362b4[_0x4bbc('0x36')]);_0x438fe2[_0x4bbc('0x38')]=_['intersection'](_0x438fe2[_0x4bbc('0x35')],_0x438fe2[_0x4bbc('0x36')]);_0x58fe32[_0x4bbc('0x3a')]=_[_0x4bbc('0x39')](_0x438fe2['model'],qs[_0x4bbc('0x3b')](_0x5362b4['query'][_0x4bbc('0x3b')]));_0x58fe32[_0x4bbc('0x3a')]=_0x58fe32[_0x4bbc('0x3a')][_0x4bbc('0x57')]?_0x58fe32[_0x4bbc('0x3a')]:_0x438fe2['model'];if(!_0x5362b4[_0x4bbc('0x36')]['hasOwnProperty'](_0x4bbc('0x58'))){_0x58fe32[_0x4bbc('0x23')]=qs[_0x4bbc('0x23')](_0x5362b4[_0x4bbc('0x36')][_0x4bbc('0x23')]);_0x58fe32[_0x4bbc('0x20')]=qs[_0x4bbc('0x20')](_0x5362b4[_0x4bbc('0x36')]['offset']);}_0x58fe32[_0x4bbc('0x3d')]=qs[_0x4bbc('0x3e')](_0x5362b4[_0x4bbc('0x36')][_0x4bbc('0x3e')]);_0x58fe32[_0x4bbc('0x3f')]=qs[_0x4bbc('0x38')](_[_0x4bbc('0x40')](_0x5362b4[_0x4bbc('0x36')],_0x438fe2[_0x4bbc('0x38')]));_0x58fe32[_0x4bbc('0x3f')]['FaxQueueId']=_0xf2aa37['id'];if(_0x5362b4['query'][_0x4bbc('0x41')]){_0x58fe32[_0x4bbc('0x3f')]=_[_0x4bbc('0x42')](_0x58fe32[_0x4bbc('0x3f')],{'$or':_[_0x4bbc('0x32')](_0x58fe32[_0x4bbc('0x3a')],function(_0x4aeca6){var _0x15197a={};_0x15197a[_0x4aeca6]={'$like':'%'+_0x5362b4[_0x4bbc('0x36')][_0x4bbc('0x41')]+'%'};return _0x15197a;})});}_0x58fe32=_['merge']({},_0x58fe32,_0x5362b4[_0x4bbc('0x43')]);return db['UserFaxQueue'][_0x4bbc('0x46')](_0x58fe32);}})[_0x4bbc('0x29')](function(_0x104bdf){if(_0x104bdf){return db[_0x4bbc('0x59')][_0x4bbc('0x5a')]({'where':{'id':_[_0x4bbc('0x32')](_0x104bdf,_0x4bbc('0x5b')),'role':'agent'},'attributes':['id',_0x4bbc('0x30'),_0x4bbc('0x5c'),_0x4bbc('0x5d'),_0x4bbc('0x5e')]});}})[_0x4bbc('0x29')](function(_0x59811f){if(_0x59811f){return{'count':_0x59811f[_0x4bbc('0x22')],'rows':_[_0x4bbc('0x32')](_0x59811f[_0x4bbc('0x47')],function(_0x39874f){return{'membername':_0x39874f[_0x4bbc('0x30')],'UserId':_0x39874f['id'],'queue_name':_0x4348e6[_0x4bbc('0x30')],'FaxQueueId':_0x4348e6['id'],'interface':util[_0x4bbc('0x5f')]('%s/%s','SIP',_0x39874f[_0x4bbc('0x30')]),'penalty':0x0,'paused':_0x39874f[_0x4bbc('0x5c')],'createdAt':_0x39874f[_0x4bbc('0x5e')],'updatedAt':_0x39874f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x4bbc('0x29')](respondWithFilteredResult(_0x452ecc,_0x58fe32))['catch'](handleError(_0x452ecc,null));};exports[_0x4bbc('0x60')]=function(_0x303e1f,_0x4ea129,_0x5c228f){var _0x52db97={};var _0x431ac2={};var _0x2f3dd5;var _0xe88071;return db[_0x4bbc('0x33')][_0x4bbc('0x55')]({'where':{'id':_0x303e1f['params']['id']}})[_0x4bbc('0x29')](handleEntityNotFound(_0x4ea129,null))['then'](function(_0xc1d1b2){if(_0xc1d1b2){_0x2f3dd5=_0xc1d1b2;_0x431ac2[_0x4bbc('0x35')]=_[_0x4bbc('0x37')](db['Team'][_0x4bbc('0x4b')]);_0x431ac2[_0x4bbc('0x36')]=_[_0x4bbc('0x37')](_0x303e1f[_0x4bbc('0x36')]);_0x431ac2['filters']=_['intersection'](_0x431ac2[_0x4bbc('0x35')],_0x431ac2[_0x4bbc('0x36')]);_0x52db97[_0x4bbc('0x3a')]=_[_0x4bbc('0x39')](_0x431ac2['model'],qs[_0x4bbc('0x3b')](_0x303e1f[_0x4bbc('0x36')][_0x4bbc('0x3b')]));_0x52db97[_0x4bbc('0x3a')]=_0x52db97[_0x4bbc('0x3a')][_0x4bbc('0x57')]?_0x52db97['attributes']:_0x431ac2['model'];_0x52db97[_0x4bbc('0x3d')]=qs[_0x4bbc('0x3e')](_0x303e1f[_0x4bbc('0x36')]['sort']);_0x52db97[_0x4bbc('0x3f')]=qs['filters'](_['pick'](_0x303e1f[_0x4bbc('0x36')],_0x431ac2[_0x4bbc('0x38')]));if(_0x303e1f[_0x4bbc('0x36')]['filter']){_0x52db97['where']=_['merge'](_0x52db97[_0x4bbc('0x3f')],{'$or':_['map'](_0x52db97[_0x4bbc('0x3a')],function(_0x854779){var _0x52dad1={};_0x52dad1[_0x854779]={'$like':'%'+_0x303e1f['query'][_0x4bbc('0x41')]+'%'};return _0x52dad1;})});}_0x52db97=_[_0x4bbc('0x42')]({},_0x52db97,_0x303e1f[_0x4bbc('0x43')]);return _0x2f3dd5[_0x4bbc('0x60')](_0x52db97);}})[_0x4bbc('0x29')](function(_0x429fa3){if(_0x429fa3){_0xe88071=_0x429fa3[_0x4bbc('0x57')];if(!_0x303e1f[_0x4bbc('0x36')]['hasOwnProperty'](_0x4bbc('0x58'))){_0x52db97[_0x4bbc('0x23')]=qs[_0x4bbc('0x23')](_0x303e1f[_0x4bbc('0x36')]['limit']);_0x52db97[_0x4bbc('0x20')]=qs['offset'](_0x303e1f[_0x4bbc('0x36')][_0x4bbc('0x20')]);}return _0x2f3dd5[_0x4bbc('0x60')](_0x52db97);}})['then'](function(_0x400590){if(_0x400590){return _0x400590?{'count':_0xe88071,'rows':_0x400590}:null;}})['then'](respondWithResult(_0x4ea129,null))[_0x4bbc('0x48')](handleError(_0x4ea129,null));};exports[_0x4bbc('0x61')]=function(_0x5938ab,_0x1c92b1,_0x456111){var _0x3a2b9c=_0x5938ab['body'][_0x4bbc('0x62')];return db[_0x4bbc('0x63')][_0x4bbc('0x46')]({'where':{'id':_0x3a2b9c},'attributes':['id'],'include':[{'model':db[_0x4bbc('0x59')],'as':_0x4bbc('0x64'),'attributes':['id','name',_0x4bbc('0x65'),_0x4bbc('0x66'),_0x4bbc('0x67')],'raw':!![]}]})[_0x4bbc('0x29')](function(_0x3b48fd){if(_0x3b48fd){var _0xdcc79e=_[_0x4bbc('0x68')](_0x3b48fd,function(_0x15857c){var _0x16fa6b=_0x15857c[_0x4bbc('0x2a')]({'plain':!![]});return _0x16fa6b['Agents'];});return db[_0x4bbc('0x33')][_0x4bbc('0x4c')]({'where':{'id':_0x5938ab[_0x4bbc('0x4a')]['id']}})[_0x4bbc('0x29')](function(_0x9ccfc9){return db['sequelize'][_0x4bbc('0x69')](function(_0x29e9b3){return _0x9ccfc9['addTeams'](_0x3a2b9c,{'transaction':_0x29e9b3})[_0x4bbc('0x29')](function(){return BPromise[_0x4bbc('0x6a')](_0xdcc79e,function(_0x2a3bd5){return db[_0x4bbc('0x56')]['findOrCreate']({'where':{'UserId':_0x2a3bd5['id'],'FaxQueueId':_0x5938ab[_0x4bbc('0x4a')]['id']},'transaction':_0x29e9b3});});})[_0x4bbc('0x29')](function(){_0xdcc79e['forEach'](function(_0x559481){socket[_0x4bbc('0x6b')](_0x4bbc('0x6c'),{'UserId':_0x559481['id'],'FaxQueueId':_0x9ccfc9['id']});});});});});}})['then'](respondWithStatusCode(_0x1c92b1,null))[_0x4bbc('0x48')](handleError(_0x1c92b1,null));};exports[_0x4bbc('0x6d')]=function(_0x3f3430,_0x4e684d,_0x39e5bf){return db['Team']['findAll']({'where':{'id':_0x3f3430[_0x4bbc('0x36')][_0x4bbc('0x62')]},'attributes':['id'],'include':[{'model':db[_0x4bbc('0x59')],'as':_0x4bbc('0x64'),'attributes':['id'],'raw':!![]}]})[_0x4bbc('0x29')](handleEntityNotFound(_0x4e684d,null))[_0x4bbc('0x29')](function(_0x4c3b64){var _0x133d33=_[_0x4bbc('0x32')](_0x4c3b64,'id');var _0x2cfaa8=[];var _0x1da087=[];var _0x1cecec=squel[_0x4bbc('0x6e')]();_0x1cecec['field'](_0x4bbc('0x6f'))[_0x4bbc('0x70')](_0x4bbc('0x71'),'tq')[_0x4bbc('0x72')](_0x4bbc('0x73'),'ut',_0x4bbc('0x74'))['where'](_0x4bbc('0x75'),_0x3f3430[_0x4bbc('0x4a')]['id']);for(var _0x420213=0x0;_0x420213<_0x4c3b64['length'];_0x420213+=0x1){let _0x9d0959=_0x4c3b64[_0x420213];for(var _0x563eba=0x0;_0x563eba<_0x9d0959[_0x4bbc('0x64')][_0x4bbc('0x57')];_0x563eba+=0x1){let _0x2c4c25=_0x9d0959[_0x4bbc('0x64')][_0x563eba];var _0x4feb3e=_0x1cecec[_0x4bbc('0x76')]();_0x4feb3e[_0x4bbc('0x3f')](_0x4bbc('0x77'),_0x2c4c25['id']);_0x1da087['push'](db[_0x4bbc('0x78')][_0x4bbc('0x36')](_0x4feb3e[_0x4bbc('0x79')](),{'type':db[_0x4bbc('0x78')]['QueryTypes']['SELECT']})[_0x4bbc('0x29')](function(_0x2c0d12){if(_0x2c0d12[_0x4bbc('0x57')]===0x1){return _0x2c4c25['id'];}else{var _0x2c85bc=_[_0x4bbc('0x7a')](_['map'](_0x2c0d12,_0x4bbc('0x7b')),function(_0x63796b){return _[_0x4bbc('0x7c')](_0x133d33,_0x63796b);});if(_0x2c85bc){return _0x2c4c25['id'];}}}));}}return BPromise[_0x4bbc('0x7d')](_0x1da087)[_0x4bbc('0x29')](function(_0x1f809b){_0x2cfaa8=_(_0x2cfaa8)[_0x4bbc('0x7e')](_0x1f809b)[_0x4bbc('0x7f')]()[_0x4bbc('0x80')]();return db[_0x4bbc('0x33')][_0x4bbc('0x4c')]({'where':{'id':_0x3f3430['params']['id']}})['then'](function(_0x46db8c){return db[_0x4bbc('0x78')]['transaction'](function(_0x39a3c4){return _0x46db8c['removeTeams'](_0x3f3430[_0x4bbc('0x36')]['ids'],{'transaction':_0x39a3c4})['then'](function(){if(!_[_0x4bbc('0x81')](_0x2cfaa8)){return _0x46db8c[_0x4bbc('0x82')](_0x2cfaa8,{'transaction':_0x39a3c4});}})['then'](function(){_0x2cfaa8[_0x4bbc('0x83')](function(_0x49ed98){socket['emit'](_0x4bbc('0x84'),{'UserId':_0x49ed98,'FaxQueueId':_0x46db8c['id']});});});});});});})[_0x4bbc('0x29')](respondWithStatusCode(_0x4e684d,null))['catch'](handleError(_0x4e684d,null));};exports[_0x4bbc('0x85')]=function(_0x338f39,_0x192648,_0x2dc920){return db[_0x4bbc('0x33')][_0x4bbc('0x4c')]({'where':{'id':_0x338f39[_0x4bbc('0x4a')]['id']}})[_0x4bbc('0x29')](handleEntityNotFound(_0x192648,null))['then'](function(_0x5ef7d3){if(_0x5ef7d3){return _0x5ef7d3['addAgents'](_0x338f39[_0x4bbc('0x4e')][_0x4bbc('0x62')],_[_0x4bbc('0x86')](_0x338f39[_0x4bbc('0x4e')],[_0x4bbc('0x62'),'id'])||{})[_0x4bbc('0x87')](function(_0x1f274f){for(var _0x3341ec=0x0;_0x3341ec<_0x338f39['body']['ids'][_0x4bbc('0x57')];_0x3341ec+=0x1){socket['emit'](_0x4bbc('0x6c'),{'UserId':Number(_0x338f39[_0x4bbc('0x4e')][_0x4bbc('0x62')][_0x3341ec]),'FaxQueueId':Number(_0x338f39[_0x4bbc('0x4a')]['id'])});}return _0x1f274f;});}})[_0x4bbc('0x29')](respondWithResult(_0x192648,null))[_0x4bbc('0x48')](handleError(_0x192648,null));};exports['removeAgents']=function(_0x1cde78,_0x19c3fe,_0x34b85a){return db[_0x4bbc('0x33')][_0x4bbc('0x4c')]({'where':{'id':_0x1cde78['params']['id']}})[_0x4bbc('0x29')](handleEntityNotFound(_0x19c3fe,null))[_0x4bbc('0x29')](function(_0x182952){if(_0x182952){return _0x182952[_0x4bbc('0x82')](_0x1cde78[_0x4bbc('0x36')][_0x4bbc('0x62')])['then'](function(){if(_['isArray'](_0x1cde78['query'][_0x4bbc('0x62')])){for(var _0x42e214=0x0;_0x42e214<_0x1cde78[_0x4bbc('0x36')]['ids']['length'];_0x42e214+=0x1){socket[_0x4bbc('0x6b')](_0x4bbc('0x84'),{'UserId':Number(_0x1cde78[_0x4bbc('0x36')]['ids'][_0x42e214]),'FaxQueueId':Number(_0x1cde78['params']['id'])});}}else{socket[_0x4bbc('0x6b')](_0x4bbc('0x84'),{'UserId':Number(_0x1cde78[_0x4bbc('0x36')]['ids']),'FaxQueueId':Number(_0x1cde78[_0x4bbc('0x4a')]['id'])});}});}})[_0x4bbc('0x29')](respondWithStatusCode(_0x19c3fe,null))[_0x4bbc('0x48')](handleError(_0x19c3fe,null));};exports[_0x4bbc('0x88')]=function(_0x20f4a8,_0x2c6284,_0x1cff97){var _0x51a7ed={};var _0x1bf0f4={};var _0x12d074;var _0xecb5bd;return db[_0x4bbc('0x33')]['findOne']({'where':{'id':_0x20f4a8[_0x4bbc('0x4a')]['id']}})[_0x4bbc('0x29')](handleEntityNotFound(_0x2c6284,null))[_0x4bbc('0x29')](function(_0x3d7acf){if(_0x3d7acf){_0x12d074=_0x3d7acf;_0x1bf0f4[_0x4bbc('0x35')]=_['keys'](db[_0x4bbc('0x59')][_0x4bbc('0x4b')]);_0x1bf0f4[_0x4bbc('0x36')]=_[_0x4bbc('0x37')](_0x20f4a8[_0x4bbc('0x36')]);_0x1bf0f4[_0x4bbc('0x38')]=_[_0x4bbc('0x39')](_0x1bf0f4[_0x4bbc('0x35')],_0x1bf0f4[_0x4bbc('0x36')]);_0x51a7ed[_0x4bbc('0x3a')]=_['intersection'](_0x1bf0f4[_0x4bbc('0x35')],qs[_0x4bbc('0x3b')](_0x20f4a8[_0x4bbc('0x36')][_0x4bbc('0x3b')]));_0x51a7ed[_0x4bbc('0x3a')]=_0x51a7ed[_0x4bbc('0x3a')][_0x4bbc('0x57')]?_0x51a7ed[_0x4bbc('0x3a')]:_0x1bf0f4[_0x4bbc('0x35')];_0x51a7ed[_0x4bbc('0x3d')]=qs[_0x4bbc('0x3e')](_0x20f4a8[_0x4bbc('0x36')][_0x4bbc('0x3e')]);_0x51a7ed['where']=qs[_0x4bbc('0x38')](_[_0x4bbc('0x40')](_0x20f4a8[_0x4bbc('0x36')],_0x1bf0f4[_0x4bbc('0x38')]));if(_0x20f4a8['query'][_0x4bbc('0x41')]){_0x51a7ed[_0x4bbc('0x3f')]=_['merge'](_0x51a7ed[_0x4bbc('0x3f')],{'$or':_[_0x4bbc('0x32')](_0x51a7ed[_0x4bbc('0x3a')],function(_0x473472){var _0x4ab0f9={};_0x4ab0f9[_0x473472]={'$like':'%'+_0x20f4a8['query'][_0x4bbc('0x41')]+'%'};return _0x4ab0f9;})});}_0x51a7ed=_[_0x4bbc('0x42')]({},_0x51a7ed,_0x20f4a8[_0x4bbc('0x43')]);return _0x12d074[_0x4bbc('0x88')](_0x51a7ed);}})[_0x4bbc('0x29')](function(_0x2d79d6){if(_0x2d79d6){_0xecb5bd=_0x2d79d6[_0x4bbc('0x57')];if(!_0x20f4a8['query']['hasOwnProperty'](_0x4bbc('0x58'))){_0x51a7ed[_0x4bbc('0x23')]=qs[_0x4bbc('0x23')](_0x20f4a8['query'][_0x4bbc('0x23')]);_0x51a7ed[_0x4bbc('0x20')]=qs['offset'](_0x20f4a8[_0x4bbc('0x36')][_0x4bbc('0x20')]);}return _0x12d074[_0x4bbc('0x88')](_0x51a7ed);}})[_0x4bbc('0x29')](function(_0x327449){if(_0x327449){return _0x327449?{'count':_0xecb5bd,'rows':_0x327449}:null;}})['then'](respondWithResult(_0x2c6284,null))[_0x4bbc('0x48')](handleError(_0x2c6284,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index ce4eb00..7a5f91f 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 _0x19d2=['../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x1316a4,_0x4238f){var _0x3d2723=function(_0x4ed72e){while(--_0x4ed72e){_0x1316a4['push'](_0x1316a4['shift']());}};_0x3d2723(++_0x4238f);}(_0x19d2,0x121));var _0x219d=function(_0x394153,_0x3cad4f){_0x394153=_0x394153-0x0;var _0x1025e9=_0x19d2[_0x394153];return _0x1025e9;};'use strict';var EventEmitter=require(_0x219d('0x0'));var FaxQueue=require(_0x219d('0x1'))['db'][_0x219d('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x219d('0x3')](0x0);var events={'afterCreate':_0x219d('0x4'),'afterUpdate':_0x219d('0x5'),'afterDestroy':_0x219d('0x6')};function emitEvent(_0x242c17){return function(_0x58f617,_0x12e925,_0x3bad2e){FaxQueueEvents[_0x219d('0x7')](_0x242c17+':'+_0x58f617['id'],_0x58f617);FaxQueueEvents[_0x219d('0x7')](_0x242c17,_0x58f617);_0x3bad2e(null);};}for(var e in events){if(events[_0x219d('0x8')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x219d('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0xe4fe=['hook','exports','FaxQueue','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x57975f,_0x388556){var _0x4793b8=function(_0x652c05){while(--_0x652c05){_0x57975f['push'](_0x57975f['shift']());}};_0x4793b8(++_0x388556);}(_0xe4fe,0x1ca));var _0xee4f=function(_0x59ed8c,_0x497c0f){_0x59ed8c=_0x59ed8c-0x0;var _0x2ae760=_0xe4fe[_0x59ed8c];return _0x2ae760;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db'][_0xee4f('0x0')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xee4f('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xee4f('0x2'),'afterDestroy':_0xee4f('0x3')};function emitEvent(_0x4c4f0b){return function(_0x5698df,_0x285b36,_0x984c39){FaxQueueEvents[_0xee4f('0x4')](_0x4c4f0b+':'+_0x5698df['id'],_0x5698df);FaxQueueEvents[_0xee4f('0x4')](_0x4c4f0b,_0x5698df);_0x984c39(null);};}for(var e in events){if(events[_0xee4f('0x5')](e)){var event=events[e];FaxQueue[_0xee4f('0x6')](e,emitEvent(event));}}module[_0xee4f('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 9753da6..deb6d92 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 _0xdf73=['define','FaxQueue','lodash','util','api','bluebird','path','rimraf','../../config/environment'];(function(_0x4fc08f,_0x2b50ec){var _0x148d8c=function(_0x5c024e){while(--_0x5c024e){_0x4fc08f['push'](_0x4fc08f['shift']());}};_0x148d8c(++_0x2b50ec);}(_0xdf73,0x1b2));var _0x3df7=function(_0x55fe70,_0x54eec0){_0x55fe70=_0x55fe70-0x0;var _0xcb40af=_0xdf73[_0x55fe70];return _0xcb40af;};'use strict';var _=require(_0x3df7('0x0'));var util=require(_0x3df7('0x1'));var logger=require('../../config/logger')(_0x3df7('0x2'));var moment=require('moment');var BPromise=require(_0x3df7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3df7('0x4'));var rimraf=require(_0x3df7('0x5'));var config=require(_0x3df7('0x6'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0x242767,_0x31ebaa){return _0x242767[_0x3df7('0x7')](_0x3df7('0x8'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46a8=['exports','FaxQueue','fax_queues','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x14a875,_0x5094dd){var _0x193b84=function(_0xda2c26){while(--_0xda2c26){_0x14a875['push'](_0x14a875['shift']());}};_0x193b84(++_0x5094dd);}(_0x46a8,0x179));var _0x846a=function(_0x40752c,_0x3cbdb7){_0x40752c=_0x40752c-0x0;var _0x10b5cc=_0x46a8[_0x40752c];return _0x10b5cc;};'use strict';var _=require(_0x846a('0x0'));var util=require(_0x846a('0x1'));var logger=require(_0x846a('0x2'))('api');var moment=require(_0x846a('0x3'));var BPromise=require(_0x846a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x846a('0x5'));var rimraf=require(_0x846a('0x6'));var config=require(_0x846a('0x7'));var attributes=require('./faxQueue.attributes');module[_0x846a('0x8')]=function(_0x370dda,_0xde326f){return _0x370dda['define'](_0x846a('0x9'),attributes,{'tableName':_0x846a('0xa'),'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 fb3b097..001cec6 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 _0x9bdf=['options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','findAll'];(function(_0x5eba98,_0x48365f){var _0x5e3a5b=function(_0x4aa40c){while(--_0x4aa40c){_0x5eba98['push'](_0x5eba98['shift']());}};_0x5e3a5b(++_0x48365f);}(_0x9bdf,0x82));var _0xf9bd=function(_0x3086ec,_0x200f1b){_0x3086ec=_0x3086ec-0x0;var _0x35da33=_0x9bdf[_0x3086ec];return _0x35da33;};'use strict';var _=require(_0xf9bd('0x0'));var util=require(_0xf9bd('0x1'));var moment=require(_0xf9bd('0x2'));var BPromise=require('bluebird');var rs=require(_0xf9bd('0x3'));var fs=require('fs');var Redis=require(_0xf9bd('0x4'));var db=require(_0xf9bd('0x5'))['db'];var utils=require(_0xf9bd('0x6'));var logger=require('../../config/logger')(_0xf9bd('0x7'));var config=require(_0xf9bd('0x8'));var jayson=require(_0xf9bd('0x9'));var client=jayson[_0xf9bd('0xa')]['http']({'port':0x232a});config[_0xf9bd('0xb')]=_[_0xf9bd('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf9bd('0xd'))(new Redis(config[_0xf9bd('0xb')]));require(_0xf9bd('0xe'))[_0xf9bd('0xf')](socket);function respondWithRpcPromise(_0x52d01f,_0x3ceeb5,_0x4336ce){return new BPromise(function(_0x143dea,_0x2beae5){return client[_0xf9bd('0x10')](_0x52d01f,_0x4336ce)[_0xf9bd('0x11')](function(_0x546589){logger[_0xf9bd('0x12')](_0xf9bd('0x13'),_0x3ceeb5,_0xf9bd('0x14'));logger[_0xf9bd('0x15')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x3ceeb5,_0xf9bd('0x14'),JSON[_0xf9bd('0x16')](_0x546589));if(_0x546589['error']){if(_0x546589[_0xf9bd('0x17')][_0xf9bd('0x18')]===0x1f4){logger[_0xf9bd('0x17')](_0xf9bd('0x13'),_0x3ceeb5,_0x546589[_0xf9bd('0x17')]['message']);return _0x2beae5(_0x546589['error']['message']);}logger[_0xf9bd('0x17')](_0xf9bd('0x13'),_0x3ceeb5,_0x546589[_0xf9bd('0x17')][_0xf9bd('0x19')]);return _0x143dea(_0x546589['error']['message']);}else{logger[_0xf9bd('0x12')](_0xf9bd('0x13'),_0x3ceeb5,'request\x20sent');_0x143dea(_0x546589['result'][_0xf9bd('0x19')]);}})[_0xf9bd('0x1a')](function(_0x35df31){logger[_0xf9bd('0x17')](_0xf9bd('0x13'),_0x3ceeb5,_0x35df31);_0x2beae5(_0x35df31);});});}exports[_0xf9bd('0x1b')]=function(_0x347ce5){var _0xc5786e=this;return new Promise(function(_0x5abd99,_0x513688){return db[_0xf9bd('0x1c')][_0xf9bd('0x1d')]({'raw':_0x347ce5[_0xf9bd('0x1e')]?_0x347ce5['options'][_0xf9bd('0x1f')]===undefined?!![]:![]:!![],'where':_0x347ce5['options']?_0x347ce5[_0xf9bd('0x1e')][_0xf9bd('0x20')]||null:null,'attributes':_0x347ce5[_0xf9bd('0x1e')]?_0x347ce5[_0xf9bd('0x1e')][_0xf9bd('0x21')]||null:null,'limit':_0x347ce5[_0xf9bd('0x1e')]?_0x347ce5[_0xf9bd('0x1e')][_0xf9bd('0x22')]||null:null,'include':_0x347ce5[_0xf9bd('0x1e')]?_0x347ce5[_0xf9bd('0x1e')][_0xf9bd('0x23')]?_[_0xf9bd('0x24')](_0x347ce5[_0xf9bd('0x1e')][_0xf9bd('0x23')],function(_0x5dee11){return{'model':db[_0x5dee11['model']],'as':_0x5dee11['as'],'attributes':_0x5dee11[_0xf9bd('0x21')],'include':_0x5dee11['include']?_['map'](_0x5dee11[_0xf9bd('0x23')],function(_0x1d7b87){return{'model':db[_0x1d7b87[_0xf9bd('0x25')]],'as':_0x1d7b87['as'],'attributes':_0x1d7b87[_0xf9bd('0x21')],'include':_0x1d7b87[_0xf9bd('0x23')]?_['map'](_0x1d7b87[_0xf9bd('0x23')],function(_0x52ce0f){return{'model':db[_0x52ce0f[_0xf9bd('0x25')]],'as':_0x52ce0f['as'],'attributes':_0x52ce0f['attributes']};}):[]};}):[]};}):[]:[]})[_0xf9bd('0x11')](function(_0x576485){logger[_0xf9bd('0x12')](_0xf9bd('0x1b'),_0x347ce5);logger[_0xf9bd('0x15')](_0xf9bd('0x1b'),_0x347ce5,JSON[_0xf9bd('0x16')](_0x576485));_0x5abd99(_0x576485);})[_0xf9bd('0x1a')](function(_0x1209e1){logger[_0xf9bd('0x17')]('GetFaxQueue',_0x1209e1[_0xf9bd('0x19')],_0x347ce5);_0x513688(_0xc5786e[_0xf9bd('0x17')](0x1f4,_0x1209e1[_0xf9bd('0x19')]));});});};exports[_0xf9bd('0x26')]=function(_0x3304e0){var _0x3a7954=this;return new Promise(function(_0x686a8,_0xb36ba8){return db[_0xf9bd('0x1c')][_0xf9bd('0x27')]({'raw':_0x3304e0[_0xf9bd('0x1e')]?_0x3304e0['options'][_0xf9bd('0x1f')]===undefined?!![]:![]:!![],'where':_0x3304e0[_0xf9bd('0x1e')]?_0x3304e0[_0xf9bd('0x1e')]['where']||null:null,'attributes':_0x3304e0[_0xf9bd('0x1e')]?_0x3304e0['options'][_0xf9bd('0x21')]||null:null,'include':_0x3304e0[_0xf9bd('0x1e')]?_0x3304e0[_0xf9bd('0x1e')][_0xf9bd('0x23')]?_['map'](_0x3304e0[_0xf9bd('0x1e')][_0xf9bd('0x23')],function(_0x1ffc5d){return{'model':db[_0x1ffc5d[_0xf9bd('0x25')]],'as':_0x1ffc5d['as'],'attributes':_0x1ffc5d[_0xf9bd('0x21')],'include':_0x1ffc5d[_0xf9bd('0x23')]?_['map'](_0x1ffc5d[_0xf9bd('0x23')],function(_0x5512c4){return{'model':db[_0x5512c4[_0xf9bd('0x25')]],'as':_0x5512c4['as'],'attributes':_0x5512c4[_0xf9bd('0x21')],'include':_0x5512c4[_0xf9bd('0x23')]?_[_0xf9bd('0x24')](_0x5512c4[_0xf9bd('0x23')],function(_0x697723){return{'model':db[_0x697723[_0xf9bd('0x25')]],'as':_0x697723['as'],'attributes':_0x697723['attributes']};}):[]};}):[]};}):[]:[]})[_0xf9bd('0x11')](function(_0x3d2d02){logger[_0xf9bd('0x12')](_0xf9bd('0x26'),_0x3304e0);logger[_0xf9bd('0x15')](_0xf9bd('0x26'),_0x3304e0,JSON[_0xf9bd('0x16')](_0x3d2d02));_0x686a8(_0x3d2d02);})[_0xf9bd('0x1a')](function(_0x7e8512){logger[_0xf9bd('0x17')](_0xf9bd('0x26'),_0x7e8512['message'],_0x3304e0);_0xb36ba8(_0x3a7954['error'](0x1f4,_0x7e8512[_0xf9bd('0x19')]));});});}; \ No newline at end of file +var _0xd3eb=['error','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','include','map','model','ShowFaxQueue','find','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','request','then','info','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code'];(function(_0x31bd4e,_0x2e7bb4){var _0x32c4e8=function(_0x25f959){while(--_0x25f959){_0x31bd4e['push'](_0x31bd4e['shift']());}};_0x32c4e8(++_0x2e7bb4);}(_0xd3eb,0x121));var _0xbd3e=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0xd3eb[_0x16629d];return _0x56ccee;};'use strict';var _=require('lodash');var util=require(_0xbd3e('0x0'));var moment=require(_0xbd3e('0x1'));var BPromise=require(_0xbd3e('0x2'));var rs=require(_0xbd3e('0x3'));var fs=require('fs');var Redis=require(_0xbd3e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbd3e('0x5'))(_0xbd3e('0x6'));var config=require(_0xbd3e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbd3e('0x8')][_0xbd3e('0x9')]({'port':0x232a});config[_0xbd3e('0xa')]=_[_0xbd3e('0xb')](config[_0xbd3e('0xa')],{'host':_0xbd3e('0xc'),'port':0x18eb});var socket=require(_0xbd3e('0xd'))(new Redis(config[_0xbd3e('0xa')]));require(_0xbd3e('0xe'))['register'](socket);function respondWithRpcPromise(_0x5bfb6d,_0x332b4d,_0x96d57b){return new BPromise(function(_0x2788f0,_0x3a423e){return client[_0xbd3e('0xf')](_0x5bfb6d,_0x96d57b)[_0xbd3e('0x10')](function(_0x57ae9a){logger[_0xbd3e('0x11')]('FaxQueue,\x20%s,\x20%s',_0x332b4d,'request\x20sent');logger[_0xbd3e('0x12')](_0xbd3e('0x13'),_0x332b4d,_0xbd3e('0x14'),JSON[_0xbd3e('0x15')](_0x57ae9a));if(_0x57ae9a['error']){if(_0x57ae9a['error'][_0xbd3e('0x16')]===0x1f4){logger[_0xbd3e('0x17')](_0xbd3e('0x18'),_0x332b4d,_0x57ae9a[_0xbd3e('0x17')][_0xbd3e('0x19')]);return _0x3a423e(_0x57ae9a[_0xbd3e('0x17')][_0xbd3e('0x19')]);}logger['error'](_0xbd3e('0x18'),_0x332b4d,_0x57ae9a[_0xbd3e('0x17')][_0xbd3e('0x19')]);return _0x2788f0(_0x57ae9a[_0xbd3e('0x17')]['message']);}else{logger[_0xbd3e('0x11')](_0xbd3e('0x18'),_0x332b4d,_0xbd3e('0x14'));_0x2788f0(_0x57ae9a[_0xbd3e('0x1a')][_0xbd3e('0x19')]);}})[_0xbd3e('0x1b')](function(_0x4ccae3){logger[_0xbd3e('0x17')](_0xbd3e('0x18'),_0x332b4d,_0x4ccae3);_0x3a423e(_0x4ccae3);});});}exports[_0xbd3e('0x1c')]=function(_0xb979da){var _0xf9fe88=this;return new Promise(function(_0x3ef393,_0x134539){return db[_0xbd3e('0x1d')]['findAll']({'raw':_0xb979da[_0xbd3e('0x1e')]?_0xb979da['options'][_0xbd3e('0x1f')]===undefined?!![]:![]:!![],'where':_0xb979da['options']?_0xb979da[_0xbd3e('0x1e')][_0xbd3e('0x20')]||null:null,'attributes':_0xb979da[_0xbd3e('0x1e')]?_0xb979da[_0xbd3e('0x1e')][_0xbd3e('0x21')]||null:null,'limit':_0xb979da['options']?_0xb979da[_0xbd3e('0x1e')]['limit']||null:null,'include':_0xb979da[_0xbd3e('0x1e')]?_0xb979da['options'][_0xbd3e('0x22')]?_[_0xbd3e('0x23')](_0xb979da[_0xbd3e('0x1e')][_0xbd3e('0x22')],function(_0x4d3f8a){return{'model':db[_0x4d3f8a[_0xbd3e('0x24')]],'as':_0x4d3f8a['as'],'attributes':_0x4d3f8a[_0xbd3e('0x21')],'include':_0x4d3f8a[_0xbd3e('0x22')]?_[_0xbd3e('0x23')](_0x4d3f8a[_0xbd3e('0x22')],function(_0xe93c06){return{'model':db[_0xe93c06['model']],'as':_0xe93c06['as'],'attributes':_0xe93c06[_0xbd3e('0x21')],'include':_0xe93c06[_0xbd3e('0x22')]?_[_0xbd3e('0x23')](_0xe93c06[_0xbd3e('0x22')],function(_0x57f012){return{'model':db[_0x57f012[_0xbd3e('0x24')]],'as':_0x57f012['as'],'attributes':_0x57f012[_0xbd3e('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbd3e('0x10')](function(_0x29597f){logger[_0xbd3e('0x11')](_0xbd3e('0x1c'),_0xb979da);logger[_0xbd3e('0x12')]('GetFaxQueue',_0xb979da,JSON[_0xbd3e('0x15')](_0x29597f));_0x3ef393(_0x29597f);})[_0xbd3e('0x1b')](function(_0x1b86e7){logger[_0xbd3e('0x17')](_0xbd3e('0x1c'),_0x1b86e7['message'],_0xb979da);_0x134539(_0xf9fe88[_0xbd3e('0x17')](0x1f4,_0x1b86e7['message']));});});};exports[_0xbd3e('0x25')]=function(_0x819d84){var _0x202ef4=this;return new Promise(function(_0x3f8753,_0x2f8ffc){return db[_0xbd3e('0x1d')][_0xbd3e('0x26')]({'raw':_0x819d84[_0xbd3e('0x1e')]?_0x819d84[_0xbd3e('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x819d84[_0xbd3e('0x1e')]?_0x819d84['options']['where']||null:null,'attributes':_0x819d84[_0xbd3e('0x1e')]?_0x819d84['options'][_0xbd3e('0x21')]||null:null,'include':_0x819d84[_0xbd3e('0x1e')]?_0x819d84[_0xbd3e('0x1e')][_0xbd3e('0x22')]?_[_0xbd3e('0x23')](_0x819d84[_0xbd3e('0x1e')]['include'],function(_0x371d2b){return{'model':db[_0x371d2b[_0xbd3e('0x24')]],'as':_0x371d2b['as'],'attributes':_0x371d2b['attributes'],'include':_0x371d2b[_0xbd3e('0x22')]?_[_0xbd3e('0x23')](_0x371d2b[_0xbd3e('0x22')],function(_0x532ded){return{'model':db[_0x532ded[_0xbd3e('0x24')]],'as':_0x532ded['as'],'attributes':_0x532ded[_0xbd3e('0x21')],'include':_0x532ded[_0xbd3e('0x22')]?_[_0xbd3e('0x23')](_0x532ded[_0xbd3e('0x22')],function(_0xeb09d6){return{'model':db[_0xeb09d6['model']],'as':_0xeb09d6['as'],'attributes':_0xeb09d6['attributes']};}):[]};}):[]};}):[]:[]})[_0xbd3e('0x10')](function(_0x3536ec){logger[_0xbd3e('0x11')](_0xbd3e('0x25'),_0x819d84);logger['debug']('ShowFaxQueue',_0x819d84,JSON[_0xbd3e('0x15')](_0x3536ec));_0x3f8753(_0x3536ec);})[_0xbd3e('0x1b')](function(_0x3fe3a5){logger['error'](_0xbd3e('0x25'),_0x3fe3a5[_0xbd3e('0x19')],_0x819d84);_0x2f8ffc(_0x202ef4['error'](0x1f4,_0x3fe3a5[_0xbd3e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index eca1bcb..db0fe62 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 _0x897a=['register','length','faxQueue:','./faxQueue.events','update','emit','removeListener'];(function(_0x4ad0f7,_0x1920b0){var _0x30f5c8=function(_0x2aa6b6){while(--_0x2aa6b6){_0x4ad0f7['push'](_0x4ad0f7['shift']());}};_0x30f5c8(++_0x1920b0);}(_0x897a,0xe3));var _0xa897=function(_0x5ccec3,_0x3ad49c){_0x5ccec3=_0x5ccec3-0x0;var _0x2f87d3=_0x897a[_0x5ccec3];return _0x2f87d3;};'use strict';var FaxQueueEvents=require(_0xa897('0x0'));var events=['save','remove',_0xa897('0x1')];function createListener(_0x1facff,_0x13bf66){return function(_0x361699){_0x13bf66[_0xa897('0x2')](_0x1facff,_0x361699);};}function removeListener(_0x576ec9,_0x3d25fb){return function(){FaxQueueEvents[_0xa897('0x3')](_0x576ec9,_0x3d25fb);};}exports[_0xa897('0x4')]=function(_0x377883){for(var _0x347735=0x0,_0x41d2d2=events[_0xa897('0x5')];_0x347735<_0x41d2d2;_0x347735++){var _0x3761c3=events[_0x347735];var _0x133f59=createListener(_0xa897('0x6')+_0x3761c3,_0x377883);FaxQueueEvents['on'](_0x3761c3,_0x133f59);}}; \ No newline at end of file +var _0xe852=['removeListener','register','length','faxQueue:','save','remove','update'];(function(_0x584b9d,_0x1cb5c5){var _0x172053=function(_0x5036ec){while(--_0x5036ec){_0x584b9d['push'](_0x584b9d['shift']());}};_0x172053(++_0x1cb5c5);}(_0xe852,0x123));var _0x2e85=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xe852[_0x4e9628];return _0x27bc8c;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x2e85('0x0'),_0x2e85('0x1'),_0x2e85('0x2')];function createListener(_0x2df40e,_0x184010){return function(_0x5f0ff7){_0x184010['emit'](_0x2df40e,_0x5f0ff7);};}function removeListener(_0xefa89f,_0x44a400){return function(){FaxQueueEvents[_0x2e85('0x3')](_0xefa89f,_0x44a400);};}exports[_0x2e85('0x4')]=function(_0x2ca9f5){for(var _0x26cc44=0x0,_0x37ad7a=events[_0x2e85('0x5')];_0x26cc44<_0x37ad7a;_0x26cc44++){var _0x5b6dcb=events[_0x26cc44];var _0x113029=createListener(_0x2e85('0x6')+_0x5b6dcb,_0x2ca9f5);FaxQueueEvents['on'](_0x5b6dcb,_0x113029);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 2cde30f..bf64ff3 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 _0x4ccb=['index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/users','/:id/teams','post','put','update','delete','destroy','removeTeams','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2fca5e,_0x573f12){var _0x488038=function(_0x3f2b5a){while(--_0x3f2b5a){_0x2fca5e['push'](_0x2fca5e['shift']());}};_0x488038(++_0x573f12);}(_0x4ccb,0x196));var _0xb4cc=function(_0x5d78cf,_0x4c5f96){_0x5d78cf=_0x5d78cf-0x0;var _0x1e2f8b=_0x4ccb[_0x5d78cf];return _0x1e2f8b;};'use strict';var multer=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var path=require(_0xb4cc('0x2'));var timeout=require('connect-timeout');var express=require(_0xb4cc('0x3'));var router=express[_0xb4cc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb4cc('0x5'));var interaction=require(_0xb4cc('0x6'));var config=require(_0xb4cc('0x7'));var controller=require('./faxQueue.controller');router[_0xb4cc('0x8')]('/',auth[_0xb4cc('0x9')](),controller[_0xb4cc('0xa')]);router['get'](_0xb4cc('0xb'),auth[_0xb4cc('0x9')](),controller[_0xb4cc('0xc')]);router['get'](_0xb4cc('0xd'),auth[_0xb4cc('0x9')](),controller[_0xb4cc('0xe')]);router[_0xb4cc('0x8')](_0xb4cc('0xf'),auth['isAuthenticated'](),controller[_0xb4cc('0x10')]);router[_0xb4cc('0x8')]('/:id/teams',auth[_0xb4cc('0x9')](),controller['getTeams']);router[_0xb4cc('0x8')](_0xb4cc('0x11'),auth[_0xb4cc('0x9')](),controller['getAgents']);router['post']('/',auth[_0xb4cc('0x9')](),controller['create']);router['post'](_0xb4cc('0x12'),auth['isAuthenticated'](),controller['addTeams']);router[_0xb4cc('0x13')](_0xb4cc('0x11'),auth[_0xb4cc('0x9')](),controller['addAgents']);router[_0xb4cc('0x14')](_0xb4cc('0xd'),auth[_0xb4cc('0x9')](),controller[_0xb4cc('0x15')]);router[_0xb4cc('0x16')]('/:id',auth[_0xb4cc('0x9')](),controller[_0xb4cc('0x17')]);router[_0xb4cc('0x16')]('/:id/teams',auth[_0xb4cc('0x9')](),controller[_0xb4cc('0x18')]);router[_0xb4cc('0x16')](_0xb4cc('0x11'),auth[_0xb4cc('0x9')](),controller['removeAgents']);module[_0xb4cc('0x19')]=router; \ No newline at end of file +var _0xe5af=['util','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id/members','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents'];(function(_0x3177d2,_0x3d5beb){var _0x37fa5a=function(_0x12144c){while(--_0x12144c){_0x3177d2['push'](_0x3177d2['shift']());}};_0x37fa5a(++_0x3d5beb);}(_0xe5af,0x9c));var _0xfe5a=function(_0x3a800d,_0x4e713f){_0x3a800d=_0x3a800d-0x0;var _0x91745f=_0xe5af[_0x3a800d];return _0x91745f;};'use strict';var multer=require('multer');var util=require(_0xfe5a('0x0'));var path=require(_0xfe5a('0x1'));var timeout=require('connect-timeout');var express=require(_0xfe5a('0x2'));var router=express[_0xfe5a('0x3')]();var fs_extra=require(_0xfe5a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfe5a('0x5'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0xfe5a('0x6')]('/',auth[_0xfe5a('0x7')](),controller['index']);router['get'](_0xfe5a('0x8'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x9')]);router[_0xfe5a('0x6')]('/:id',auth[_0xfe5a('0x7')](),controller['show']);router['get'](_0xfe5a('0xa'),auth[_0xfe5a('0x7')](),controller['getMembers']);router[_0xfe5a('0x6')](_0xfe5a('0xb'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xc')]);router[_0xfe5a('0x6')]('/:id/users',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xd')]);router[_0xfe5a('0xe')]('/',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xf')]);router['post'](_0xfe5a('0xb'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x10')]);router[_0xfe5a('0xe')](_0xfe5a('0x11'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x12')]);router[_0xfe5a('0x13')](_0xfe5a('0x14'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x15')]);router[_0xfe5a('0x16')](_0xfe5a('0x14'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x17')]);router[_0xfe5a('0x16')]('/:id/teams',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x18')]);router['delete'](_0xfe5a('0x11'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index dfa0ebe..6ef1b8f 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 _0x1259=['sequelize','exports','STRING','DATE','moment'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x1259,0x1f3));var _0x9125=function(_0xedc5db,_0x210b81){_0xedc5db=_0xedc5db-0x0;var _0x319879=_0x1259[_0xedc5db];return _0x319879;};'use strict';var moment=require(_0x9125('0x0'));var Sequelize=require(_0x9125('0x1'));module[_0x9125('0x2')]={'uniqueid':{'type':Sequelize[_0x9125('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9125('0x3')]},'joinAt':{'type':Sequelize[_0x9125('0x4')]},'leaveAt':{'type':Sequelize[_0x9125('0x4')]},'acceptAt':{'type':Sequelize[_0x9125('0x4')]},'exitAt':{'type':Sequelize[_0x9125('0x4')]},'reason':{'type':Sequelize[_0x9125('0x3')]}}; \ No newline at end of file +var _0x296c=['exports','STRING','DATE','moment','sequelize'];(function(_0x3b8f2e,_0x5a99a8){var _0x1433d5=function(_0x5e0353){while(--_0x5e0353){_0x3b8f2e['push'](_0x3b8f2e['shift']());}};_0x1433d5(++_0x5a99a8);}(_0x296c,0x8f));var _0xc296=function(_0x42bc8d,_0x546176){_0x42bc8d=_0x42bc8d-0x0;var _0x311c31=_0x296c[_0x42bc8d];return _0x311c31;};'use strict';var moment=require(_0xc296('0x0'));var Sequelize=require(_0xc296('0x1'));module[_0xc296('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xc296('0x3')]},'joinAt':{'type':Sequelize[_0xc296('0x4')]},'leaveAt':{'type':Sequelize[_0xc296('0x4')]},'acceptAt':{'type':Sequelize[_0xc296('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc296('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 0af8155..41a87c1 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 _0xd691=['destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','include','find','update','body'];(function(_0x1b8524,_0x1bb669){var _0x81418d=function(_0x5f5795){while(--_0x5f5795){_0x1b8524['push'](_0x1b8524['shift']());}};_0x81418d(++_0x1bb669);}(_0xd691,0xe6));var _0x1d69=function(_0x2355a4,_0xc0b80d){_0x2355a4=_0x2355a4-0x0;var _0xe22dd=_0xd691[_0x2355a4];return _0xe22dd;};'use strict';var emlformat=require(_0x1d69('0x0'));var rimraf=require(_0x1d69('0x1'));var zipdir=require(_0x1d69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d69('0x3'));var moment=require(_0x1d69('0x4'));var BPromise=require(_0x1d69('0x5'));var Mustache=require(_0x1d69('0x6'));var util=require(_0x1d69('0x7'));var path=require(_0x1d69('0x8'));var sox=require(_0x1d69('0x9'));var csv=require(_0x1d69('0xa'));var ejs=require(_0x1d69('0xb'));var fs=require('fs');var fs_extra=require(_0x1d69('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1d69('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1d69('0xe'));var toCsv=require(_0x1d69('0xa'));var querystring=require(_0x1d69('0xf'));var Papa=require(_0x1d69('0x10'));var Redis=require('ioredis');var authService=require(_0x1d69('0x11'));var qs=require(_0x1d69('0x12'));var as=require(_0x1d69('0x13'));var hardwareService=require(_0x1d69('0x14'));var logger=require(_0x1d69('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x1d69('0x16'));var licenseUtil=require(_0x1d69('0x17'));var db=require(_0x1d69('0x18'))['db'];function respondWithStatusCode(_0x36ca70,_0x3f703a){_0x3f703a=_0x3f703a||0xcc;return function(_0x78b25d){if(_0x78b25d){return _0x36ca70[_0x1d69('0x19')](_0x3f703a);}return _0x36ca70[_0x1d69('0x1a')](_0x3f703a)[_0x1d69('0x1b')]();};}function respondWithResult(_0x7121cb,_0x292721){_0x292721=_0x292721||0xc8;return function(_0x1f4271){if(_0x1f4271){return _0x7121cb[_0x1d69('0x1a')](_0x292721)['json'](_0x1f4271);}};}function respondWithFilteredResult(_0x52f53d,_0x12e7cd){return function(_0x3fb5d2){if(_0x3fb5d2){var _0x29dd32=typeof _0x12e7cd[_0x1d69('0x1c')]===_0x1d69('0x1d')&&typeof _0x12e7cd[_0x1d69('0x1e')]==='undefined';var _0xb7f031=_0x3fb5d2[_0x1d69('0x1f')];var _0x34f6d4=_0x29dd32?0x0:_0x12e7cd['offset'];var _0x4cebea=_0x29dd32?_0x3fb5d2[_0x1d69('0x1f')]:_0x12e7cd[_0x1d69('0x1c')]+_0x12e7cd[_0x1d69('0x1e')];var _0x57bb5d;if(_0x4cebea>=_0xb7f031){_0x4cebea=_0xb7f031;_0x57bb5d=0xc8;}else{_0x57bb5d=0xce;}_0x52f53d[_0x1d69('0x1a')](_0x57bb5d);return _0x52f53d[_0x1d69('0x20')](_0x1d69('0x21'),_0x34f6d4+'-'+_0x4cebea+'/'+_0xb7f031)[_0x1d69('0x22')](_0x3fb5d2);}return null;};}function patchUpdates(_0x3ef4dc){return function(_0x24feaa){try{jsonpatch[_0x1d69('0x23')](_0x24feaa,_0x3ef4dc,!![]);}catch(_0x62968f){return BPromise['reject'](_0x62968f);}return _0x24feaa[_0x1d69('0x24')]();};}function saveUpdates(_0x122238,_0x1786e1){return function(_0x228d18){if(_0x228d18){return _0x228d18['update'](_0x122238)[_0x1d69('0x25')](function(_0x411ca0){return _0x411ca0;});}return null;};}function removeEntity(_0x2b9a7a,_0x54783d){return function(_0x5352d3){if(_0x5352d3){return _0x5352d3['destroy']()[_0x1d69('0x25')](function(){_0x2b9a7a[_0x1d69('0x1a')](0xcc)[_0x1d69('0x1b')]();});}};}function handleEntityNotFound(_0x1c91bf,_0x4f4449){return function(_0x3af518){if(!_0x3af518){_0x1c91bf[_0x1d69('0x19')](0x194);}return _0x3af518;};}function handleError(_0x51e91b,_0x377913){_0x377913=_0x377913||0x1f4;return function(_0x2dc73f){logger[_0x1d69('0x26')](_0x2dc73f[_0x1d69('0x27')]);if(_0x2dc73f[_0x1d69('0x28')]){delete _0x2dc73f[_0x1d69('0x28')];}_0x51e91b['status'](_0x377913)[_0x1d69('0x29')](_0x2dc73f);};}exports[_0x1d69('0x2a')]=function(_0x3c6b2b,_0x1d521b){var _0x3c0962={},_0x1e5818={},_0x2fd8d3={'count':0x0,'rows':[]};var _0x215052=_[_0x1d69('0x2b')](db[_0x1d69('0x2c')][_0x1d69('0x2d')],function(_0x5e8e8e){return{'name':_0x5e8e8e[_0x1d69('0x2e')],'type':_0x5e8e8e['type'][_0x1d69('0x2f')]};});_0x1e5818[_0x1d69('0x30')]=_[_0x1d69('0x2b')](_0x215052,_0x1d69('0x28'));_0x1e5818['query']=_['keys'](_0x3c6b2b[_0x1d69('0x31')]);_0x1e5818['filters']=_[_0x1d69('0x32')](_0x1e5818[_0x1d69('0x30')],_0x1e5818[_0x1d69('0x31')]);_0x3c0962[_0x1d69('0x33')]=_[_0x1d69('0x32')](_0x1e5818[_0x1d69('0x30')],qs[_0x1d69('0x34')](_0x3c6b2b[_0x1d69('0x31')][_0x1d69('0x34')]));_0x3c0962[_0x1d69('0x33')]=_0x3c0962[_0x1d69('0x33')][_0x1d69('0x35')]?_0x3c0962[_0x1d69('0x33')]:_0x1e5818[_0x1d69('0x30')];if(!_0x3c6b2b['query'][_0x1d69('0x36')](_0x1d69('0x37'))){_0x3c0962[_0x1d69('0x1e')]=qs[_0x1d69('0x1e')](_0x3c6b2b[_0x1d69('0x31')]['limit']);_0x3c0962[_0x1d69('0x1c')]=qs[_0x1d69('0x1c')](_0x3c6b2b[_0x1d69('0x31')][_0x1d69('0x1c')]);}_0x3c0962['order']=qs[_0x1d69('0x38')](_0x3c6b2b[_0x1d69('0x31')][_0x1d69('0x38')]);_0x3c0962[_0x1d69('0x39')]=qs[_0x1d69('0x3a')](_['pick'](_0x3c6b2b['query'],_0x1e5818['filters']),_0x215052);if(_0x3c6b2b[_0x1d69('0x31')][_0x1d69('0x3b')]){_0x3c0962['where']=_[_0x1d69('0x3c')](_0x3c0962[_0x1d69('0x39')],{'$or':_[_0x1d69('0x2b')](_0x215052,function(_0x497e02){if(_0x497e02[_0x1d69('0x3d')]!==_0x1d69('0x3e')){var _0x1a8ba4={};_0x1a8ba4[_0x497e02[_0x1d69('0x28')]]={'$like':'%'+_0x3c6b2b['query'][_0x1d69('0x3b')]+'%'};return _0x1a8ba4;}})});}_0x3c0962=_[_0x1d69('0x3c')]({},_0x3c0962,_0x3c6b2b[_0x1d69('0x3f')]);var _0x3c09bb={'where':_0x3c0962['where']};return db[_0x1d69('0x2c')][_0x1d69('0x1f')](_0x3c09bb)[_0x1d69('0x25')](function(_0x38306a){_0x2fd8d3[_0x1d69('0x1f')]=_0x38306a;if(_0x3c6b2b[_0x1d69('0x31')][_0x1d69('0x40')]){_0x3c0962['include']=[{'all':!![]}];}return db[_0x1d69('0x2c')][_0x1d69('0x41')](_0x3c0962);})['then'](function(_0x3d68c3){_0x2fd8d3['rows']=_0x3d68c3;return _0x2fd8d3;})[_0x1d69('0x25')](respondWithFilteredResult(_0x1d521b,_0x3c0962))[_0x1d69('0x42')](handleError(_0x1d521b,null));};exports[_0x1d69('0x43')]=function(_0xc052d6,_0x5b0a74){var _0x1d6fee={'raw':!![],'where':{'id':_0xc052d6[_0x1d69('0x44')]['id']}},_0x21dfc2={};_0x21dfc2['model']=_[_0x1d69('0x45')](db['FaxQueueReport']['rawAttributes']);_0x21dfc2[_0x1d69('0x31')]=_[_0x1d69('0x45')](_0xc052d6['query']);_0x21dfc2[_0x1d69('0x3a')]=_['intersection'](_0x21dfc2[_0x1d69('0x30')],_0x21dfc2[_0x1d69('0x31')]);_0x1d6fee['attributes']=_[_0x1d69('0x32')](_0x21dfc2[_0x1d69('0x30')],qs[_0x1d69('0x34')](_0xc052d6['query'][_0x1d69('0x34')]));_0x1d6fee[_0x1d69('0x33')]=_0x1d6fee[_0x1d69('0x33')][_0x1d69('0x35')]?_0x1d6fee[_0x1d69('0x33')]:_0x21dfc2[_0x1d69('0x30')];if(_0xc052d6[_0x1d69('0x31')][_0x1d69('0x40')]){_0x1d6fee[_0x1d69('0x46')]=[{'all':!![]}];}_0x1d6fee=_[_0x1d69('0x3c')]({},_0x1d6fee,_0xc052d6[_0x1d69('0x3f')]);return db[_0x1d69('0x2c')][_0x1d69('0x47')](_0x1d6fee)[_0x1d69('0x25')](handleEntityNotFound(_0x5b0a74,null))[_0x1d69('0x25')](respondWithResult(_0x5b0a74,null))[_0x1d69('0x42')](handleError(_0x5b0a74,null));};exports['create']=function(_0x438b3a,_0x11cf7c){return db[_0x1d69('0x2c')]['create'](_0x438b3a['body'],{})[_0x1d69('0x25')](respondWithResult(_0x11cf7c,0xc9))['catch'](handleError(_0x11cf7c,null));};exports[_0x1d69('0x48')]=function(_0x370645,_0x131304){if(_0x370645['body']['id']){delete _0x370645['body']['id'];}return db[_0x1d69('0x2c')]['find']({'where':{'id':_0x370645[_0x1d69('0x44')]['id']}})['then'](handleEntityNotFound(_0x131304,null))['then'](saveUpdates(_0x370645[_0x1d69('0x49')],null))[_0x1d69('0x25')](respondWithResult(_0x131304,null))[_0x1d69('0x42')](handleError(_0x131304,null));};exports[_0x1d69('0x4a')]=function(_0x442041,_0x4e6453){return db[_0x1d69('0x2c')][_0x1d69('0x47')]({'where':{'id':_0x442041['params']['id']}})[_0x1d69('0x25')](handleEntityNotFound(_0x4e6453,null))[_0x1d69('0x25')](removeEntity(_0x4e6453,null))[_0x1d69('0x42')](handleError(_0x4e6453,null));};exports[_0x1d69('0x4b')]=function(_0x4d17b7,_0x10d730){return db['FaxQueueReport'][_0x1d69('0x4b')]()[_0x1d69('0x25')](respondWithResult(_0x10d730,null))[_0x1d69('0x42')](handleError(_0x10d730,null));}; \ No newline at end of file +var _0x3299=['fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','name','map','FaxQueueReport','fieldName','key','model','filters','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','order','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','destroy','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x1e4993,_0x332ca1){var _0x331388=function(_0x1795cc){while(--_0x1795cc){_0x1e4993['push'](_0x1e4993['shift']());}};_0x331388(++_0x332ca1);}(_0x3299,0x1bc));var _0x9329=function(_0x5315c6,_0x475c5e){_0x5315c6=_0x5315c6-0x0;var _0x10d933=_0x3299[_0x5315c6];return _0x10d933;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9329('0x0'));var zipdir=require(_0x9329('0x1'));var jsonpatch=require(_0x9329('0x2'));var rp=require(_0x9329('0x3'));var moment=require(_0x9329('0x4'));var BPromise=require(_0x9329('0x5'));var Mustache=require(_0x9329('0x6'));var util=require(_0x9329('0x7'));var path=require(_0x9329('0x8'));var sox=require(_0x9329('0x9'));var csv=require(_0x9329('0xa'));var ejs=require(_0x9329('0xb'));var fs=require('fs');var fs_extra=require(_0x9329('0xc'));var _=require(_0x9329('0xd'));var squel=require(_0x9329('0xe'));var crypto=require(_0x9329('0xf'));var jsforce=require(_0x9329('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9329('0xa'));var querystring=require(_0x9329('0x11'));var Papa=require(_0x9329('0x12'));var Redis=require(_0x9329('0x13'));var authService=require(_0x9329('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9329('0x15'));var hardwareService=require(_0x9329('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9329('0x17'));var licenseUtil=require(_0x9329('0x18'));var db=require(_0x9329('0x19'))['db'];function respondWithStatusCode(_0x1302e8,_0x293b04){_0x293b04=_0x293b04||0xcc;return function(_0x523aff){if(_0x523aff){return _0x1302e8[_0x9329('0x1a')](_0x293b04);}return _0x1302e8[_0x9329('0x1b')](_0x293b04)[_0x9329('0x1c')]();};}function respondWithResult(_0x4cc89c,_0x1ee23e){_0x1ee23e=_0x1ee23e||0xc8;return function(_0x2a7c38){if(_0x2a7c38){return _0x4cc89c['status'](_0x1ee23e)[_0x9329('0x1d')](_0x2a7c38);}};}function respondWithFilteredResult(_0x1b2b98,_0x4adc7e){return function(_0x5e21ad){if(_0x5e21ad){var _0x73ec60=typeof _0x4adc7e[_0x9329('0x1e')]===_0x9329('0x1f')&&typeof _0x4adc7e['limit']===_0x9329('0x1f');var _0x522094=_0x5e21ad[_0x9329('0x20')];var _0x1b5eed=_0x73ec60?0x0:_0x4adc7e['offset'];var _0x41db73=_0x73ec60?_0x5e21ad[_0x9329('0x20')]:_0x4adc7e['offset']+_0x4adc7e[_0x9329('0x21')];var _0x4f5d6c;if(_0x41db73>=_0x522094){_0x41db73=_0x522094;_0x4f5d6c=0xc8;}else{_0x4f5d6c=0xce;}_0x1b2b98[_0x9329('0x1b')](_0x4f5d6c);return _0x1b2b98['set'](_0x9329('0x22'),_0x1b5eed+'-'+_0x41db73+'/'+_0x522094)['json'](_0x5e21ad);}return null;};}function patchUpdates(_0x6676d7){return function(_0x1af29b){try{jsonpatch[_0x9329('0x23')](_0x1af29b,_0x6676d7,!![]);}catch(_0x1dbebc){return BPromise[_0x9329('0x24')](_0x1dbebc);}return _0x1af29b[_0x9329('0x25')]();};}function saveUpdates(_0x4a7039,_0x1fa600){return function(_0x4f895c){if(_0x4f895c){return _0x4f895c[_0x9329('0x26')](_0x4a7039)[_0x9329('0x27')](function(_0x26f8a7){return _0x26f8a7;});}return null;};}function removeEntity(_0x59fb85,_0x22caa4){return function(_0x46019b){if(_0x46019b){return _0x46019b['destroy']()[_0x9329('0x27')](function(){_0x59fb85[_0x9329('0x1b')](0xcc)[_0x9329('0x1c')]();});}};}function handleEntityNotFound(_0x2da39d,_0x5584ae){return function(_0x49575f){if(!_0x49575f){_0x2da39d[_0x9329('0x1a')](0x194);}return _0x49575f;};}function handleError(_0x156626,_0x4419fc){_0x4419fc=_0x4419fc||0x1f4;return function(_0x4f5fbf){logger[_0x9329('0x28')](_0x4f5fbf['stack']);if(_0x4f5fbf[_0x9329('0x29')]){delete _0x4f5fbf[_0x9329('0x29')];}_0x156626[_0x9329('0x1b')](_0x4419fc)['send'](_0x4f5fbf);};}exports['index']=function(_0x36765a,_0x49d501){var _0x269964={},_0x4a5d27={},_0x1d2479={'count':0x0,'rows':[]};var _0x4a3c13=_[_0x9329('0x2a')](db[_0x9329('0x2b')]['rawAttributes'],function(_0x15c27b){return{'name':_0x15c27b[_0x9329('0x2c')],'type':_0x15c27b['type'][_0x9329('0x2d')]};});_0x4a5d27[_0x9329('0x2e')]=_[_0x9329('0x2a')](_0x4a3c13,_0x9329('0x29'));_0x4a5d27['query']=_['keys'](_0x36765a['query']);_0x4a5d27[_0x9329('0x2f')]=_['intersection'](_0x4a5d27[_0x9329('0x2e')],_0x4a5d27['query']);_0x269964[_0x9329('0x30')]=_[_0x9329('0x31')](_0x4a5d27['model'],qs[_0x9329('0x32')](_0x36765a[_0x9329('0x33')][_0x9329('0x32')]));_0x269964[_0x9329('0x30')]=_0x269964['attributes'][_0x9329('0x34')]?_0x269964[_0x9329('0x30')]:_0x4a5d27[_0x9329('0x2e')];if(!_0x36765a[_0x9329('0x33')][_0x9329('0x35')](_0x9329('0x36'))){_0x269964['limit']=qs[_0x9329('0x21')](_0x36765a[_0x9329('0x33')][_0x9329('0x21')]);_0x269964[_0x9329('0x1e')]=qs[_0x9329('0x1e')](_0x36765a[_0x9329('0x33')][_0x9329('0x1e')]);}_0x269964[_0x9329('0x37')]=qs['sort'](_0x36765a[_0x9329('0x33')]['sort']);_0x269964[_0x9329('0x38')]=qs[_0x9329('0x2f')](_[_0x9329('0x39')](_0x36765a[_0x9329('0x33')],_0x4a5d27[_0x9329('0x2f')]),_0x4a3c13);if(_0x36765a[_0x9329('0x33')]['filter']){_0x269964['where']=_[_0x9329('0x3a')](_0x269964[_0x9329('0x38')],{'$or':_[_0x9329('0x2a')](_0x4a3c13,function(_0xc748ff){if(_0xc748ff[_0x9329('0x3b')]!==_0x9329('0x3c')){var _0x3a9e91={};_0x3a9e91[_0xc748ff[_0x9329('0x29')]]={'$like':'%'+_0x36765a['query'][_0x9329('0x3d')]+'%'};return _0x3a9e91;}})});}_0x269964=_[_0x9329('0x3a')]({},_0x269964,_0x36765a[_0x9329('0x3e')]);var _0x302a27={'where':_0x269964['where']};return db[_0x9329('0x2b')]['count'](_0x302a27)[_0x9329('0x27')](function(_0x52bdeb){_0x1d2479[_0x9329('0x20')]=_0x52bdeb;if(_0x36765a['query'][_0x9329('0x3f')]){_0x269964[_0x9329('0x40')]=[{'all':!![]}];}return db[_0x9329('0x2b')][_0x9329('0x41')](_0x269964);})['then'](function(_0x1375d8){_0x1d2479[_0x9329('0x42')]=_0x1375d8;return _0x1d2479;})[_0x9329('0x27')](respondWithFilteredResult(_0x49d501,_0x269964))[_0x9329('0x43')](handleError(_0x49d501,null));};exports[_0x9329('0x44')]=function(_0x29d200,_0x44aa65){var _0x4df2fe={'raw':!![],'where':{'id':_0x29d200[_0x9329('0x45')]['id']}},_0x22543f={};_0x22543f[_0x9329('0x2e')]=_[_0x9329('0x46')](db[_0x9329('0x2b')]['rawAttributes']);_0x22543f[_0x9329('0x33')]=_[_0x9329('0x46')](_0x29d200[_0x9329('0x33')]);_0x22543f[_0x9329('0x2f')]=_[_0x9329('0x31')](_0x22543f[_0x9329('0x2e')],_0x22543f[_0x9329('0x33')]);_0x4df2fe[_0x9329('0x30')]=_['intersection'](_0x22543f['model'],qs[_0x9329('0x32')](_0x29d200['query'][_0x9329('0x32')]));_0x4df2fe[_0x9329('0x30')]=_0x4df2fe[_0x9329('0x30')][_0x9329('0x34')]?_0x4df2fe[_0x9329('0x30')]:_0x22543f[_0x9329('0x2e')];if(_0x29d200[_0x9329('0x33')][_0x9329('0x3f')]){_0x4df2fe[_0x9329('0x40')]=[{'all':!![]}];}_0x4df2fe=_[_0x9329('0x3a')]({},_0x4df2fe,_0x29d200[_0x9329('0x3e')]);return db[_0x9329('0x2b')]['find'](_0x4df2fe)['then'](handleEntityNotFound(_0x44aa65,null))[_0x9329('0x27')](respondWithResult(_0x44aa65,null))['catch'](handleError(_0x44aa65,null));};exports[_0x9329('0x47')]=function(_0x263464,_0x4eb931){return db[_0x9329('0x2b')][_0x9329('0x47')](_0x263464[_0x9329('0x48')],{})['then'](respondWithResult(_0x4eb931,0xc9))[_0x9329('0x43')](handleError(_0x4eb931,null));};exports[_0x9329('0x26')]=function(_0x21d9c6,_0x5a4adb){if(_0x21d9c6[_0x9329('0x48')]['id']){delete _0x21d9c6[_0x9329('0x48')]['id'];}return db[_0x9329('0x2b')]['find']({'where':{'id':_0x21d9c6[_0x9329('0x45')]['id']}})[_0x9329('0x27')](handleEntityNotFound(_0x5a4adb,null))[_0x9329('0x27')](saveUpdates(_0x21d9c6[_0x9329('0x48')],null))[_0x9329('0x27')](respondWithResult(_0x5a4adb,null))['catch'](handleError(_0x5a4adb,null));};exports[_0x9329('0x49')]=function(_0x421542,_0x6d464b){return db[_0x9329('0x2b')][_0x9329('0x4a')]({'where':{'id':_0x421542[_0x9329('0x45')]['id']}})[_0x9329('0x27')](handleEntityNotFound(_0x6d464b,null))[_0x9329('0x27')](removeEntity(_0x6d464b,null))[_0x9329('0x43')](handleError(_0x6d464b,null));};exports['describe']=function(_0x1a5c5f,_0x19e072){return db[_0x9329('0x2b')][_0x9329('0x4b')]()[_0x9329('0x27')](respondWithResult(_0x19e072,null))[_0x9329('0x43')](handleError(_0x19e072,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 7dec428..7125a3d 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 _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1a90e8,_0x2129b3){_0x1a90e8=_0x1a90e8-0x0;var _0x29968f=_0x1cb9[_0x1a90e8];return _0x29968f;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x155d81,_0x490970){var _0x354e20=function(_0x20a703){while(--_0x20a703){_0x155d81['push'](_0x155d81['shift']());}};_0x354e20(++_0x490970);}(_0x53ec,0x192));var _0xc53e=function(_0x96cefd,_0x25cb5d){_0x96cefd=_0x96cefd-0x0;var _0x4310c1=_0x53ec[_0x96cefd];return _0x4310c1;};'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 diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 5e8361d..9ea876e 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 _0xfaf9=['client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x45b115,_0x36e78e){var _0x2f7308=function(_0x23d4ec){while(--_0x23d4ec){_0x45b115['push'](_0x45b115['shift']());}};_0x2f7308(++_0x36e78e);}(_0xfaf9,0x19a));var _0x9faf=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xfaf9[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x9faf('0x0'));var util=require(_0x9faf('0x1'));var moment=require(_0x9faf('0x2'));var BPromise=require(_0x9faf('0x3'));var rs=require(_0x9faf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9faf('0x5'));var logger=require(_0x9faf('0x6'))(_0x9faf('0x7'));var config=require(_0x9faf('0x8'));var jayson=require(_0x9faf('0x9'));var client=jayson[_0x9faf('0xa')][_0x9faf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe75653,_0x1df969,_0x16d407){return new BPromise(function(_0x53c340,_0x5bb425){return client[_0x9faf('0xc')](_0xe75653,_0x16d407)[_0x9faf('0xd')](function(_0x376760){logger[_0x9faf('0xe')](_0x9faf('0xf'),_0x1df969,_0x9faf('0x10'));logger[_0x9faf('0x11')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x1df969,_0x9faf('0x10'),JSON[_0x9faf('0x12')](_0x376760));if(_0x376760[_0x9faf('0x13')]){if(_0x376760[_0x9faf('0x13')][_0x9faf('0x14')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x1df969,_0x376760[_0x9faf('0x13')][_0x9faf('0x15')]);return _0x5bb425(_0x376760['error'][_0x9faf('0x15')]);}logger[_0x9faf('0x13')](_0x9faf('0xf'),_0x1df969,_0x376760[_0x9faf('0x13')][_0x9faf('0x15')]);return _0x53c340(_0x376760[_0x9faf('0x13')][_0x9faf('0x15')]);}else{logger[_0x9faf('0xe')](_0x9faf('0xf'),_0x1df969,'request\x20sent');_0x53c340(_0x376760[_0x9faf('0x16')]['message']);}})[_0x9faf('0x17')](function(_0x4f9525){logger[_0x9faf('0x13')](_0x9faf('0xf'),_0x1df969,_0x4f9525);_0x5bb425(_0x4f9525);});});}exports[_0x9faf('0x18')]=function(_0x44379e){var _0x49a3c5=this;return new Promise(function(_0x18b0c7,_0x36fbe3){return db[_0x9faf('0x19')][_0x9faf('0x1a')](_0x44379e[_0x9faf('0x1b')],{'raw':_0x44379e[_0x9faf('0x1c')]?_0x44379e[_0x9faf('0x1c')][_0x9faf('0x1d')]===undefined?!![]:![]:!![]})[_0x9faf('0xd')](function(_0x35aa1b){logger[_0x9faf('0xe')]('CreateFaxQueueReport',_0x44379e);logger[_0x9faf('0x11')]('CreateFaxQueueReport',_0x44379e,JSON[_0x9faf('0x12')](_0x35aa1b));_0x18b0c7(_0x35aa1b);})[_0x9faf('0x17')](function(_0x271610){logger[_0x9faf('0x13')](_0x9faf('0x18'),_0x271610[_0x9faf('0x15')],_0x44379e);_0x36fbe3(_0x49a3c5[_0x9faf('0x13')](0x1f4,_0x271610['message']));});});};exports[_0x9faf('0x1e')]=function(_0x229da4){var _0x5531fa=this;return new Promise(function(_0x490daa,_0x1b0c2a){return db[_0x9faf('0x19')][_0x9faf('0x1f')](_0x229da4['body'],{'raw':_0x229da4[_0x9faf('0x1c')]?_0x229da4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x229da4[_0x9faf('0x1c')]?_0x229da4[_0x9faf('0x1c')][_0x9faf('0x20')]||null:null,'attributes':_0x229da4['options']?_0x229da4[_0x9faf('0x1c')][_0x9faf('0x21')]||null:null,'limit':_0x229da4['options']?_0x229da4['options'][_0x9faf('0x22')]||null:null})[_0x9faf('0xd')](function(_0x1750d0){logger['info'](_0x9faf('0x1e'),_0x229da4);logger[_0x9faf('0x11')](_0x9faf('0x1e'),_0x229da4,JSON[_0x9faf('0x12')](_0x1750d0));_0x490daa(_0x1750d0);})['catch'](function(_0x1e022a){logger[_0x9faf('0x13')](_0x9faf('0x1e'),_0x1e022a['message'],_0x229da4);_0x1b0c2a(_0x5531fa[_0x9faf('0x13')](0x1f4,_0x1e022a[_0x9faf('0x15')]));});});}; \ No newline at end of file +var _0x75c9=['message','result','catch','CreateFaxQueueReport','create','options','raw','UpdateFaxQueueReport','FaxQueueReport','update','where','attributes','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1e474e,_0xa5ba6){var _0x4e2460=function(_0x151b36){while(--_0x151b36){_0x1e474e['push'](_0x1e474e['shift']());}};_0x4e2460(++_0xa5ba6);}(_0x75c9,0xec));var _0x975c=function(_0x2ec2bf,_0x64e983){_0x2ec2bf=_0x2ec2bf-0x0;var _0x2c279c=_0x75c9[_0x2ec2bf];return _0x2c279c;};'use strict';var _=require('lodash');var util=require(_0x975c('0x0'));var moment=require(_0x975c('0x1'));var BPromise=require(_0x975c('0x2'));var rs=require(_0x975c('0x3'));var fs=require('fs');var Redis=require(_0x975c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x975c('0x5'));var logger=require('../../config/logger')(_0x975c('0x6'));var config=require(_0x975c('0x7'));var jayson=require(_0x975c('0x8'));var client=jayson[_0x975c('0x9')][_0x975c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x198fbe,_0x21f878,_0x4b994c){return new BPromise(function(_0x22a167,_0x316624){return client[_0x975c('0xb')](_0x198fbe,_0x4b994c)[_0x975c('0xc')](function(_0x4e0d1e){logger[_0x975c('0xd')](_0x975c('0xe'),_0x21f878,_0x975c('0xf'));logger[_0x975c('0x10')](_0x975c('0x11'),_0x21f878,_0x975c('0xf'),JSON[_0x975c('0x12')](_0x4e0d1e));if(_0x4e0d1e[_0x975c('0x13')]){if(_0x4e0d1e[_0x975c('0x13')]['code']===0x1f4){logger[_0x975c('0x13')](_0x975c('0xe'),_0x21f878,_0x4e0d1e['error'][_0x975c('0x14')]);return _0x316624(_0x4e0d1e['error'][_0x975c('0x14')]);}logger[_0x975c('0x13')](_0x975c('0xe'),_0x21f878,_0x4e0d1e['error'][_0x975c('0x14')]);return _0x22a167(_0x4e0d1e[_0x975c('0x13')][_0x975c('0x14')]);}else{logger['info'](_0x975c('0xe'),_0x21f878,_0x975c('0xf'));_0x22a167(_0x4e0d1e[_0x975c('0x15')]['message']);}})[_0x975c('0x16')](function(_0x24e36f){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x21f878,_0x24e36f);_0x316624(_0x24e36f);});});}exports[_0x975c('0x17')]=function(_0x10e951){var _0x6041a4=this;return new Promise(function(_0x3edd36,_0x277417){return db['FaxQueueReport'][_0x975c('0x18')](_0x10e951['body'],{'raw':_0x10e951['options']?_0x10e951[_0x975c('0x19')][_0x975c('0x1a')]===undefined?!![]:![]:!![]})[_0x975c('0xc')](function(_0x2faa94){logger['info'](_0x975c('0x17'),_0x10e951);logger[_0x975c('0x10')]('CreateFaxQueueReport',_0x10e951,JSON[_0x975c('0x12')](_0x2faa94));_0x3edd36(_0x2faa94);})['catch'](function(_0x2ae646){logger['error'](_0x975c('0x17'),_0x2ae646[_0x975c('0x14')],_0x10e951);_0x277417(_0x6041a4[_0x975c('0x13')](0x1f4,_0x2ae646['message']));});});};exports[_0x975c('0x1b')]=function(_0x999c80){var _0x9cde7c=this;return new Promise(function(_0x441d9b,_0x3aeb0f){return db[_0x975c('0x1c')][_0x975c('0x1d')](_0x999c80['body'],{'raw':_0x999c80['options']?_0x999c80[_0x975c('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x999c80[_0x975c('0x19')]?_0x999c80[_0x975c('0x19')][_0x975c('0x1e')]||null:null,'attributes':_0x999c80[_0x975c('0x19')]?_0x999c80[_0x975c('0x19')][_0x975c('0x1f')]||null:null,'limit':_0x999c80[_0x975c('0x19')]?_0x999c80[_0x975c('0x19')]['limit']||null:null})[_0x975c('0xc')](function(_0x111a18){logger[_0x975c('0xd')](_0x975c('0x1b'),_0x999c80);logger['debug']('UpdateFaxQueueReport',_0x999c80,JSON['stringify'](_0x111a18));_0x441d9b(_0x111a18);})['catch'](function(_0x35c0e9){logger[_0x975c('0x13')](_0x975c('0x1b'),_0x35c0e9['message'],_0x999c80);_0x3aeb0f(_0x9cde7c[_0x975c('0x13')](0x1f4,_0x35c0e9[_0x975c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 1078952..a8b23c4 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 _0xe9ba=['../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','destroy','util','path','connect-timeout','express'];(function(_0x10119d,_0x232452){var _0x13b4ee=function(_0x2dcd53){while(--_0x2dcd53){_0x10119d['push'](_0x10119d['shift']());}};_0x13b4ee(++_0x232452);}(_0xe9ba,0xf8));var _0xae9b=function(_0xab4642,_0xc56b1){_0xab4642=_0xab4642-0x0;var _0x803b4e=_0xe9ba[_0xab4642];return _0x803b4e;};'use strict';var multer=require('multer');var util=require(_0xae9b('0x0'));var path=require(_0xae9b('0x1'));var timeout=require(_0xae9b('0x2'));var express=require(_0xae9b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xae9b('0x4'));var config=require(_0xae9b('0x5'));var controller=require(_0xae9b('0x6'));router[_0xae9b('0x7')]('/',auth[_0xae9b('0x8')](),controller[_0xae9b('0x9')]);router['get'](_0xae9b('0xa'),auth[_0xae9b('0x8')](),controller[_0xae9b('0xb')]);router[_0xae9b('0x7')](_0xae9b('0xc'),auth[_0xae9b('0x8')](),controller['show']);router[_0xae9b('0xd')]('/',auth[_0xae9b('0x8')](),controller[_0xae9b('0xe')]);router[_0xae9b('0xf')](_0xae9b('0xc'),auth[_0xae9b('0x8')](),controller[_0xae9b('0x10')]);router['delete'](_0xae9b('0xc'),auth[_0xae9b('0x8')](),controller[_0xae9b('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe846=['index','get','/describe','/:id','show','post','create','delete','destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xe846,0xd5));var _0x6e84=function(_0x47c9ba,_0x10ab4f){_0x47c9ba=_0x47c9ba-0x0;var _0x4c95c2=_0xe846[_0x47c9ba];return _0x4c95c2;};'use strict';var multer=require(_0x6e84('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6e84('0x1'));var express=require(_0x6e84('0x2'));var router=express['Router']();var fs_extra=require(_0x6e84('0x3'));var auth=require(_0x6e84('0x4'));var interaction=require(_0x6e84('0x5'));var config=require(_0x6e84('0x6'));var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0x6e84('0x7')](),controller[_0x6e84('0x8')]);router[_0x6e84('0x9')](_0x6e84('0xa'),auth[_0x6e84('0x7')](),controller['describe']);router['get'](_0x6e84('0xb'),auth[_0x6e84('0x7')](),controller[_0x6e84('0xc')]);router[_0x6e84('0xd')]('/',auth[_0x6e84('0x7')](),controller[_0x6e84('0xe')]);router['put'](_0x6e84('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x6e84('0xf')](_0x6e84('0xb'),auth[_0x6e84('0x7')](),controller[_0x6e84('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 4551e74..a9a3354 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x139aee,_0x1e85c1){var _0x2fddfb=function(_0x4c68e1){while(--_0x4c68e1){_0x139aee['push'](_0x139aee['shift']());}};_0x2fddfb(++_0x1e85c1);}(_0x00bb,0x1d8));var _0xb00b=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x00bb[_0x491a7f];return _0x3d8f44;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x175f0d,_0x39f0eb){var _0x35bcc8=function(_0x2179ea){while(--_0x2179ea){_0x175f0d['push'](_0x175f0d['shift']());}};_0x35bcc8(++_0x39f0eb);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5cfb92,_0x5797e6){_0x5cfb92=_0x5cfb92-0x0;var _0x1cd7c2=_0xf3cd[_0x5cfb92];return _0x1cd7c2;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'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 e8b7407..31335b6 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 _0x4cfe=['jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','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','lodash','squel','crypto'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4cfe,0xdb));var _0xe4cf=function(_0x4a9ddf,_0x5347d3){_0x4a9ddf=_0x4a9ddf-0x0;var _0x4080b7=_0x4cfe[_0x4a9ddf];return _0x4080b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4cf('0x0'));var zipdir=require(_0xe4cf('0x1'));var jsonpatch=require(_0xe4cf('0x2'));var rp=require(_0xe4cf('0x3'));var moment=require(_0xe4cf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe4cf('0x5'));var util=require(_0xe4cf('0x6'));var path=require(_0xe4cf('0x7'));var sox=require(_0xe4cf('0x8'));var csv=require(_0xe4cf('0x9'));var ejs=require(_0xe4cf('0xa'));var fs=require('fs');var fs_extra=require(_0xe4cf('0xb'));var _=require(_0xe4cf('0xc'));var squel=require(_0xe4cf('0xd'));var crypto=require(_0xe4cf('0xe'));var jsforce=require(_0xe4cf('0xf'));var deskjs=require(_0xe4cf('0x10'));var toCsv=require(_0xe4cf('0x9'));var querystring=require(_0xe4cf('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe4cf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe4cf('0x13'));var hardwareService=require(_0xe4cf('0x14'));var logger=require(_0xe4cf('0x15'))(_0xe4cf('0x16'));var utils=require(_0xe4cf('0x17'));var config=require(_0xe4cf('0x18'));var licenseUtil=require(_0xe4cf('0x19'));var db=require(_0xe4cf('0x1a'))['db'];function respondWithStatusCode(_0x10eb7f,_0x55d9f3){_0x55d9f3=_0x55d9f3||0xcc;return function(_0x199826){if(_0x199826){return _0x10eb7f[_0xe4cf('0x1b')](_0x55d9f3);}return _0x10eb7f['status'](_0x55d9f3)[_0xe4cf('0x1c')]();};}function respondWithResult(_0x4a6c75,_0x22f2cf){_0x22f2cf=_0x22f2cf||0xc8;return function(_0x46f212){if(_0x46f212){return _0x4a6c75[_0xe4cf('0x1d')](_0x22f2cf)[_0xe4cf('0x1e')](_0x46f212);}};}function respondWithFilteredResult(_0x342afe,_0x45d9f8){return function(_0x15a516){if(_0x15a516){var _0x1c57fe=typeof _0x45d9f8[_0xe4cf('0x1f')]==='undefined'&&typeof _0x45d9f8[_0xe4cf('0x20')]===_0xe4cf('0x21');var _0x5754aa=_0x15a516['count'];var _0xf51b5=_0x1c57fe?0x0:_0x45d9f8['offset'];var _0x453fc6=_0x1c57fe?_0x15a516[_0xe4cf('0x22')]:_0x45d9f8[_0xe4cf('0x1f')]+_0x45d9f8[_0xe4cf('0x20')];var _0x2eaf9c;if(_0x453fc6>=_0x5754aa){_0x453fc6=_0x5754aa;_0x2eaf9c=0xc8;}else{_0x2eaf9c=0xce;}_0x342afe[_0xe4cf('0x1d')](_0x2eaf9c);return _0x342afe[_0xe4cf('0x23')](_0xe4cf('0x24'),_0xf51b5+'-'+_0x453fc6+'/'+_0x5754aa)['json'](_0x15a516);}return null;};}function patchUpdates(_0x360a07){return function(_0x3bedeb){try{jsonpatch[_0xe4cf('0x25')](_0x3bedeb,_0x360a07,!![]);}catch(_0xbeecf1){return BPromise[_0xe4cf('0x26')](_0xbeecf1);}return _0x3bedeb[_0xe4cf('0x27')]();};}function saveUpdates(_0x278fa8,_0x344042){return function(_0x54c269){if(_0x54c269){return _0x54c269[_0xe4cf('0x28')](_0x278fa8)['then'](function(_0x19d8ee){return _0x19d8ee;});}return null;};}function removeEntity(_0x23bcde,_0x2b919a){return function(_0x3771bb){if(_0x3771bb){return _0x3771bb[_0xe4cf('0x29')]()[_0xe4cf('0x2a')](function(){_0x23bcde['status'](0xcc)[_0xe4cf('0x1c')]();});}};}function handleEntityNotFound(_0x19d4b2,_0x51dfdf){return function(_0x2976fa){if(!_0x2976fa){_0x19d4b2[_0xe4cf('0x1b')](0x194);}return _0x2976fa;};}function handleError(_0x39d9fc,_0x2f9850){_0x2f9850=_0x2f9850||0x1f4;return function(_0x2db869){logger[_0xe4cf('0x2b')](_0x2db869[_0xe4cf('0x2c')]);if(_0x2db869[_0xe4cf('0x2d')]){delete _0x2db869['name'];}_0x39d9fc[_0xe4cf('0x1d')](_0x2f9850)[_0xe4cf('0x2e')](_0x2db869);};}exports[_0xe4cf('0x2f')]=function(_0xeab403,_0x7d1b24){var _0xf663b4={},_0x2cdb61={},_0x5cdd52={'count':0x0,'rows':[]};var _0x2057d7=_[_0xe4cf('0x30')](db[_0xe4cf('0x31')][_0xe4cf('0x32')],function(_0x14a970){return{'name':_0x14a970[_0xe4cf('0x33')],'type':_0x14a970[_0xe4cf('0x34')]['key']};});_0x2cdb61[_0xe4cf('0x35')]=_[_0xe4cf('0x30')](_0x2057d7,_0xe4cf('0x2d'));_0x2cdb61[_0xe4cf('0x36')]=_[_0xe4cf('0x37')](_0xeab403['query']);_0x2cdb61[_0xe4cf('0x38')]=_[_0xe4cf('0x39')](_0x2cdb61['model'],_0x2cdb61[_0xe4cf('0x36')]);_0xf663b4[_0xe4cf('0x3a')]=_[_0xe4cf('0x39')](_0x2cdb61[_0xe4cf('0x35')],qs[_0xe4cf('0x3b')](_0xeab403[_0xe4cf('0x36')][_0xe4cf('0x3b')]));_0xf663b4[_0xe4cf('0x3a')]=_0xf663b4[_0xe4cf('0x3a')][_0xe4cf('0x3c')]?_0xf663b4['attributes']:_0x2cdb61[_0xe4cf('0x35')];if(!_0xeab403[_0xe4cf('0x36')][_0xe4cf('0x3d')]('nolimit')){_0xf663b4[_0xe4cf('0x20')]=qs[_0xe4cf('0x20')](_0xeab403['query'][_0xe4cf('0x20')]);_0xf663b4[_0xe4cf('0x1f')]=qs[_0xe4cf('0x1f')](_0xeab403[_0xe4cf('0x36')][_0xe4cf('0x1f')]);}_0xf663b4['order']=qs[_0xe4cf('0x3e')](_0xeab403[_0xe4cf('0x36')][_0xe4cf('0x3e')]);_0xf663b4[_0xe4cf('0x3f')]=qs[_0xe4cf('0x38')](_[_0xe4cf('0x40')](_0xeab403[_0xe4cf('0x36')],_0x2cdb61['filters']),_0x2057d7);if(_0xeab403['query'][_0xe4cf('0x41')]){_0xf663b4['where']=_[_0xe4cf('0x42')](_0xf663b4['where'],{'$or':_[_0xe4cf('0x30')](_0x2057d7,function(_0xc8e4cb){if(_0xc8e4cb['type']!=='VIRTUAL'){var _0x39d162={};_0x39d162[_0xc8e4cb[_0xe4cf('0x2d')]]={'$like':'%'+_0xeab403[_0xe4cf('0x36')][_0xe4cf('0x41')]+'%'};return _0x39d162;}})});}_0xf663b4=_[_0xe4cf('0x42')]({},_0xf663b4,_0xeab403[_0xe4cf('0x43')]);var _0x2437c8={'where':_0xf663b4[_0xe4cf('0x3f')]};return db['FaxTransferReport'][_0xe4cf('0x22')](_0x2437c8)[_0xe4cf('0x2a')](function(_0x3b6ac3){_0x5cdd52['count']=_0x3b6ac3;if(_0xeab403[_0xe4cf('0x36')][_0xe4cf('0x44')]){_0xf663b4[_0xe4cf('0x45')]=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0xf663b4);})['then'](function(_0x272383){_0x5cdd52[_0xe4cf('0x46')]=_0x272383;return _0x5cdd52;})[_0xe4cf('0x2a')](respondWithFilteredResult(_0x7d1b24,_0xf663b4))[_0xe4cf('0x47')](handleError(_0x7d1b24,null));};exports[_0xe4cf('0x48')]=function(_0x48cca,_0x38d1c8){var _0x427c75={'raw':!![],'where':{'id':_0x48cca[_0xe4cf('0x49')]['id']}},_0x562de4={};_0x562de4[_0xe4cf('0x35')]=_[_0xe4cf('0x37')](db[_0xe4cf('0x31')][_0xe4cf('0x32')]);_0x562de4['query']=_[_0xe4cf('0x37')](_0x48cca['query']);_0x562de4[_0xe4cf('0x38')]=_[_0xe4cf('0x39')](_0x562de4[_0xe4cf('0x35')],_0x562de4[_0xe4cf('0x36')]);_0x427c75[_0xe4cf('0x3a')]=_[_0xe4cf('0x39')](_0x562de4[_0xe4cf('0x35')],qs[_0xe4cf('0x3b')](_0x48cca[_0xe4cf('0x36')][_0xe4cf('0x3b')]));_0x427c75[_0xe4cf('0x3a')]=_0x427c75[_0xe4cf('0x3a')]['length']?_0x427c75['attributes']:_0x562de4[_0xe4cf('0x35')];if(_0x48cca[_0xe4cf('0x36')][_0xe4cf('0x44')]){_0x427c75[_0xe4cf('0x45')]=[{'all':!![]}];}_0x427c75=_['merge']({},_0x427c75,_0x48cca[_0xe4cf('0x43')]);return db['FaxTransferReport'][_0xe4cf('0x4a')](_0x427c75)[_0xe4cf('0x2a')](handleEntityNotFound(_0x38d1c8,null))[_0xe4cf('0x2a')](respondWithResult(_0x38d1c8,null))[_0xe4cf('0x47')](handleError(_0x38d1c8,null));};exports['create']=function(_0x40236f,_0x2f06f4){return db[_0xe4cf('0x31')][_0xe4cf('0x4b')](_0x40236f[_0xe4cf('0x4c')],{})[_0xe4cf('0x2a')](respondWithResult(_0x2f06f4,0xc9))[_0xe4cf('0x47')](handleError(_0x2f06f4,null));};exports[_0xe4cf('0x28')]=function(_0x56ae58,_0x26b1d8){if(_0x56ae58['body']['id']){delete _0x56ae58[_0xe4cf('0x4c')]['id'];}return db['FaxTransferReport'][_0xe4cf('0x4a')]({'where':{'id':_0x56ae58[_0xe4cf('0x49')]['id']}})[_0xe4cf('0x2a')](handleEntityNotFound(_0x26b1d8,null))['then'](saveUpdates(_0x56ae58[_0xe4cf('0x4c')],null))['then'](respondWithResult(_0x26b1d8,null))[_0xe4cf('0x47')](handleError(_0x26b1d8,null));};exports[_0xe4cf('0x29')]=function(_0x4ab079,_0x5378a0){return db['FaxTransferReport'][_0xe4cf('0x4a')]({'where':{'id':_0x4ab079['params']['id']}})[_0xe4cf('0x2a')](handleEntityNotFound(_0x5378a0,null))['then'](removeEntity(_0x5378a0,null))[_0xe4cf('0x47')](handleError(_0x5378a0,null));};exports[_0xe4cf('0x4d')]=function(_0x6ce505,_0x1e73ad){return db['FaxTransferReport'][_0xe4cf('0x4d')]()[_0xe4cf('0x2a')](respondWithResult(_0x1e73ad,null))[_0xe4cf('0x47')](handleError(_0x1e73ad,null));}; \ No newline at end of file +var _0x6736=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','FaxTransferReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','order','sort','filter','where','VIRTUAL','options','include','rows','catch','show','params','keys','length','merge','create','body','find','destroy','describe','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x40268e,_0x1233bc){var _0x270f28=function(_0x141612){while(--_0x141612){_0x40268e['push'](_0x40268e['shift']());}};_0x270f28(++_0x1233bc);}(_0x6736,0x1e6));var _0x6673=function(_0x2cdcfc,_0x1d67ff){_0x2cdcfc=_0x2cdcfc-0x0;var _0x2579fa=_0x6736[_0x2cdcfc];return _0x2579fa;};'use strict';var emlformat=require(_0x6673('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6673('0x1'));var jsonpatch=require(_0x6673('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6673('0x3'));var Mustache=require('mustache');var util=require(_0x6673('0x4'));var path=require(_0x6673('0x5'));var sox=require(_0x6673('0x6'));var csv=require(_0x6673('0x7'));var ejs=require(_0x6673('0x8'));var fs=require('fs');var fs_extra=require(_0x6673('0x9'));var _=require(_0x6673('0xa'));var squel=require('squel');var crypto=require(_0x6673('0xb'));var jsforce=require(_0x6673('0xc'));var deskjs=require(_0x6673('0xd'));var toCsv=require(_0x6673('0x7'));var querystring=require(_0x6673('0xe'));var Papa=require('papaparse');var Redis=require(_0x6673('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6673('0x10'));var as=require(_0x6673('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6673('0x12'))(_0x6673('0x13'));var utils=require('../../config/utils');var config=require(_0x6673('0x14'));var licenseUtil=require(_0x6673('0x15'));var db=require(_0x6673('0x16'))['db'];function respondWithStatusCode(_0x16d32e,_0x1a9d35){_0x1a9d35=_0x1a9d35||0xcc;return function(_0x34edf0){if(_0x34edf0){return _0x16d32e[_0x6673('0x17')](_0x1a9d35);}return _0x16d32e[_0x6673('0x18')](_0x1a9d35)[_0x6673('0x19')]();};}function respondWithResult(_0x28537e,_0x3416d7){_0x3416d7=_0x3416d7||0xc8;return function(_0x10d253){if(_0x10d253){return _0x28537e[_0x6673('0x18')](_0x3416d7)[_0x6673('0x1a')](_0x10d253);}};}function respondWithFilteredResult(_0x9ce6e7,_0x179ab9){return function(_0x261e98){if(_0x261e98){var _0x1305f2=typeof _0x179ab9[_0x6673('0x1b')]===_0x6673('0x1c')&&typeof _0x179ab9[_0x6673('0x1d')]===_0x6673('0x1c');var _0x49ba7e=_0x261e98['count'];var _0x275864=_0x1305f2?0x0:_0x179ab9[_0x6673('0x1b')];var _0x28df4f=_0x1305f2?_0x261e98[_0x6673('0x1e')]:_0x179ab9[_0x6673('0x1b')]+_0x179ab9[_0x6673('0x1d')];var _0x36e852;if(_0x28df4f>=_0x49ba7e){_0x28df4f=_0x49ba7e;_0x36e852=0xc8;}else{_0x36e852=0xce;}_0x9ce6e7[_0x6673('0x18')](_0x36e852);return _0x9ce6e7[_0x6673('0x1f')](_0x6673('0x20'),_0x275864+'-'+_0x28df4f+'/'+_0x49ba7e)[_0x6673('0x1a')](_0x261e98);}return null;};}function patchUpdates(_0x60182a){return function(_0x3a58be){try{jsonpatch[_0x6673('0x21')](_0x3a58be,_0x60182a,!![]);}catch(_0x114a28){return BPromise[_0x6673('0x22')](_0x114a28);}return _0x3a58be[_0x6673('0x23')]();};}function saveUpdates(_0x186678,_0x2103b9){return function(_0x316ad6){if(_0x316ad6){return _0x316ad6[_0x6673('0x24')](_0x186678)['then'](function(_0x52c8b3){return _0x52c8b3;});}return null;};}function removeEntity(_0x1aada9,_0x599c34){return function(_0x3f02d3){if(_0x3f02d3){return _0x3f02d3['destroy']()[_0x6673('0x25')](function(){_0x1aada9['status'](0xcc)[_0x6673('0x19')]();});}};}function handleEntityNotFound(_0x241c35,_0x46cfc6){return function(_0x4007af){if(!_0x4007af){_0x241c35['sendStatus'](0x194);}return _0x4007af;};}function handleError(_0x33555c,_0x2ba4a7){_0x2ba4a7=_0x2ba4a7||0x1f4;return function(_0x1f824c){logger[_0x6673('0x26')](_0x1f824c[_0x6673('0x27')]);if(_0x1f824c[_0x6673('0x28')]){delete _0x1f824c[_0x6673('0x28')];}_0x33555c[_0x6673('0x18')](_0x2ba4a7)['send'](_0x1f824c);};}exports[_0x6673('0x29')]=function(_0x3f6493,_0x1cb4ee){var _0x749a2c={},_0x122fe2={},_0x2af831={'count':0x0,'rows':[]};var _0x19c1a1=_['map'](db[_0x6673('0x2a')][_0x6673('0x2b')],function(_0x215ccc){return{'name':_0x215ccc[_0x6673('0x2c')],'type':_0x215ccc[_0x6673('0x2d')][_0x6673('0x2e')]};});_0x122fe2[_0x6673('0x2f')]=_[_0x6673('0x30')](_0x19c1a1,_0x6673('0x28'));_0x122fe2[_0x6673('0x31')]=_['keys'](_0x3f6493[_0x6673('0x31')]);_0x122fe2[_0x6673('0x32')]=_[_0x6673('0x33')](_0x122fe2[_0x6673('0x2f')],_0x122fe2[_0x6673('0x31')]);_0x749a2c[_0x6673('0x34')]=_[_0x6673('0x33')](_0x122fe2[_0x6673('0x2f')],qs['fields'](_0x3f6493[_0x6673('0x31')][_0x6673('0x35')]));_0x749a2c[_0x6673('0x34')]=_0x749a2c[_0x6673('0x34')]['length']?_0x749a2c[_0x6673('0x34')]:_0x122fe2[_0x6673('0x2f')];if(!_0x3f6493['query']['hasOwnProperty']('nolimit')){_0x749a2c[_0x6673('0x1d')]=qs[_0x6673('0x1d')](_0x3f6493[_0x6673('0x31')]['limit']);_0x749a2c[_0x6673('0x1b')]=qs[_0x6673('0x1b')](_0x3f6493[_0x6673('0x31')][_0x6673('0x1b')]);}_0x749a2c[_0x6673('0x36')]=qs[_0x6673('0x37')](_0x3f6493[_0x6673('0x31')][_0x6673('0x37')]);_0x749a2c['where']=qs[_0x6673('0x32')](_['pick'](_0x3f6493[_0x6673('0x31')],_0x122fe2['filters']),_0x19c1a1);if(_0x3f6493[_0x6673('0x31')][_0x6673('0x38')]){_0x749a2c[_0x6673('0x39')]=_['merge'](_0x749a2c[_0x6673('0x39')],{'$or':_['map'](_0x19c1a1,function(_0x18c7f2){if(_0x18c7f2[_0x6673('0x2d')]!==_0x6673('0x3a')){var _0xc8c0dd={};_0xc8c0dd[_0x18c7f2[_0x6673('0x28')]]={'$like':'%'+_0x3f6493['query']['filter']+'%'};return _0xc8c0dd;}})});}_0x749a2c=_['merge']({},_0x749a2c,_0x3f6493[_0x6673('0x3b')]);var _0x3e6ece={'where':_0x749a2c[_0x6673('0x39')]};return db[_0x6673('0x2a')]['count'](_0x3e6ece)[_0x6673('0x25')](function(_0x2114a5){_0x2af831['count']=_0x2114a5;if(_0x3f6493['query']['includeAll']){_0x749a2c[_0x6673('0x3c')]=[{'all':!![]}];}return db[_0x6673('0x2a')]['findAll'](_0x749a2c);})['then'](function(_0x1bbc53){_0x2af831[_0x6673('0x3d')]=_0x1bbc53;return _0x2af831;})[_0x6673('0x25')](respondWithFilteredResult(_0x1cb4ee,_0x749a2c))[_0x6673('0x3e')](handleError(_0x1cb4ee,null));};exports[_0x6673('0x3f')]=function(_0x5441d4,_0x19fbcd){var _0x87733f={'raw':!![],'where':{'id':_0x5441d4[_0x6673('0x40')]['id']}},_0x522b35={};_0x522b35[_0x6673('0x2f')]=_['keys'](db[_0x6673('0x2a')]['rawAttributes']);_0x522b35[_0x6673('0x31')]=_[_0x6673('0x41')](_0x5441d4['query']);_0x522b35[_0x6673('0x32')]=_['intersection'](_0x522b35[_0x6673('0x2f')],_0x522b35[_0x6673('0x31')]);_0x87733f['attributes']=_['intersection'](_0x522b35[_0x6673('0x2f')],qs[_0x6673('0x35')](_0x5441d4[_0x6673('0x31')][_0x6673('0x35')]));_0x87733f[_0x6673('0x34')]=_0x87733f[_0x6673('0x34')][_0x6673('0x42')]?_0x87733f[_0x6673('0x34')]:_0x522b35[_0x6673('0x2f')];if(_0x5441d4['query']['includeAll']){_0x87733f[_0x6673('0x3c')]=[{'all':!![]}];}_0x87733f=_[_0x6673('0x43')]({},_0x87733f,_0x5441d4['options']);return db[_0x6673('0x2a')]['find'](_0x87733f)[_0x6673('0x25')](handleEntityNotFound(_0x19fbcd,null))[_0x6673('0x25')](respondWithResult(_0x19fbcd,null))[_0x6673('0x3e')](handleError(_0x19fbcd,null));};exports[_0x6673('0x44')]=function(_0x1b94dd,_0x1460cc){return db['FaxTransferReport']['create'](_0x1b94dd['body'],{})['then'](respondWithResult(_0x1460cc,0xc9))['catch'](handleError(_0x1460cc,null));};exports[_0x6673('0x24')]=function(_0x4cc4bc,_0x4c6844){if(_0x4cc4bc[_0x6673('0x45')]['id']){delete _0x4cc4bc[_0x6673('0x45')]['id'];}return db[_0x6673('0x2a')][_0x6673('0x46')]({'where':{'id':_0x4cc4bc[_0x6673('0x40')]['id']}})[_0x6673('0x25')](handleEntityNotFound(_0x4c6844,null))[_0x6673('0x25')](saveUpdates(_0x4cc4bc['body'],null))[_0x6673('0x25')](respondWithResult(_0x4c6844,null))[_0x6673('0x3e')](handleError(_0x4c6844,null));};exports[_0x6673('0x47')]=function(_0x52ff4b,_0x40ce88){return db[_0x6673('0x2a')][_0x6673('0x46')]({'where':{'id':_0x52ff4b['params']['id']}})[_0x6673('0x25')](handleEntityNotFound(_0x40ce88,null))[_0x6673('0x25')](removeEntity(_0x40ce88,null))[_0x6673('0x3e')](handleError(_0x40ce88,null));};exports[_0x6673('0x48')]=function(_0x118fb5,_0x344382){return db['FaxTransferReport'][_0x6673('0x48')]()[_0x6673('0x25')](respondWithResult(_0x344382,null))['catch'](handleError(_0x344382,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index c4a0e79..0c7cc53 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 _0xd763=['bluebird','request-promise','path','rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','api','moment'];(function(_0xfe17db,_0x3e0fb7){var _0x14880c=function(_0x37fda8){while(--_0x37fda8){_0xfe17db['push'](_0xfe17db['shift']());}};_0x14880c(++_0x3e0fb7);}(_0xd763,0xda));var _0x3d76=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xd763[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x3d76('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3d76('0x1'));var moment=require(_0x3d76('0x2'));var BPromise=require(_0x3d76('0x3'));var rp=require(_0x3d76('0x4'));var fs=require('fs');var path=require(_0x3d76('0x5'));var rimraf=require(_0x3d76('0x6'));var config=require('../../config/environment');var attributes=require(_0x3d76('0x7'));module[_0x3d76('0x8')]=function(_0x1b713a,_0x5ac033){return _0x1b713a[_0x3d76('0x9')](_0x3d76('0xa'),attributes,{'tableName':_0x3d76('0xb'),'paranoid':![],'indexes':[{'name':_0x3d76('0xc'),'fields':[_0x3d76('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d62=['bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','util','../../config/logger','api','moment'];(function(_0x49dcac,_0x3f3ea3){var _0x5f2884=function(_0x34615d){while(--_0x34615d){_0x49dcac['push'](_0x49dcac['shift']());}};_0x5f2884(++_0x3f3ea3);}(_0x8d62,0xf8));var _0x28d6=function(_0x121e96,_0x4ab90e){_0x121e96=_0x121e96-0x0;var _0x48d23f=_0x8d62[_0x121e96];return _0x48d23f;};'use strict';var _=require('lodash');var util=require(_0x28d6('0x0'));var logger=require(_0x28d6('0x1'))(_0x28d6('0x2'));var moment=require(_0x28d6('0x3'));var BPromise=require(_0x28d6('0x4'));var rp=require(_0x28d6('0x5'));var fs=require('fs');var path=require(_0x28d6('0x6'));var rimraf=require(_0x28d6('0x7'));var config=require(_0x28d6('0x8'));var attributes=require(_0x28d6('0x9'));module[_0x28d6('0xa')]=function(_0x4385ba,_0x3c827b){return _0x4385ba[_0x28d6('0xb')]('FaxTransferReport',attributes,{'tableName':_0x28d6('0xc'),'paranoid':![],'indexes':[{'name':_0x28d6('0xd'),'fields':[_0x28d6('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 cf0ba47..593dc79 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 _0x88ae=['../../config/environment','http','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x33c3f2,_0x2d932f){var _0x581f85=function(_0x54111b){while(--_0x54111b){_0x33c3f2['push'](_0x33c3f2['shift']());}};_0x581f85(++_0x2d932f);}(_0x88ae,0x1df));var _0xe88a=function(_0x6a56dd,_0x5bf4fa){_0x6a56dd=_0x6a56dd-0x0;var _0x3785c7=_0x88ae[_0x6a56dd];return _0x3785c7;};'use strict';var _=require(_0xe88a('0x0'));var util=require(_0xe88a('0x1'));var moment=require(_0xe88a('0x2'));var BPromise=require('bluebird');var rs=require(_0xe88a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe88a('0x4'));var logger=require(_0xe88a('0x5'))(_0xe88a('0x6'));var config=require(_0xe88a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe88a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd01652,_0x2e5bcb,_0x7d5a09){return new BPromise(function(_0xde270f,_0xb7f681){return client['request'](_0xd01652,_0x7d5a09)['then'](function(_0x17be04){logger[_0xe88a('0x9')](_0xe88a('0xa'),_0x2e5bcb,'request\x20sent');logger[_0xe88a('0xb')](_0xe88a('0xc'),_0x2e5bcb,_0xe88a('0xd'),JSON['stringify'](_0x17be04));if(_0x17be04[_0xe88a('0xe')]){if(_0x17be04[_0xe88a('0xe')][_0xe88a('0xf')]===0x1f4){logger[_0xe88a('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x2e5bcb,_0x17be04[_0xe88a('0xe')]['message']);return _0xb7f681(_0x17be04[_0xe88a('0xe')]['message']);}logger['error'](_0xe88a('0xa'),_0x2e5bcb,_0x17be04[_0xe88a('0xe')][_0xe88a('0x10')]);return _0xde270f(_0x17be04['error'][_0xe88a('0x10')]);}else{logger[_0xe88a('0x9')](_0xe88a('0xa'),_0x2e5bcb,_0xe88a('0xd'));_0xde270f(_0x17be04[_0xe88a('0x11')][_0xe88a('0x10')]);}})['catch'](function(_0x34d995){logger[_0xe88a('0xe')](_0xe88a('0xa'),_0x2e5bcb,_0x34d995);_0xb7f681(_0x34d995);});});} \ No newline at end of file +var _0xc953=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x4a1724,_0x581e12){var _0x124874=function(_0xc86215){while(--_0xc86215){_0x4a1724['push'](_0x4a1724['shift']());}};_0x124874(++_0x581e12);}(_0xc953,0x6d));var _0x3c95=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0xc953[_0x4099ee];return _0x1b7bfc;};'use strict';var _=require(_0x3c95('0x0'));var util=require(_0x3c95('0x1'));var moment=require(_0x3c95('0x2'));var BPromise=require(_0x3c95('0x3'));var rs=require(_0x3c95('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c95('0x5'))['db'];var utils=require(_0x3c95('0x6'));var logger=require(_0x3c95('0x7'))(_0x3c95('0x8'));var config=require(_0x3c95('0x9'));var jayson=require(_0x3c95('0xa'));var client=jayson[_0x3c95('0xb')][_0x3c95('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x29e50c,_0x306650,_0x100959){return new BPromise(function(_0x1cf65c,_0x58ea69){return client['request'](_0x29e50c,_0x100959)[_0x3c95('0xd')](function(_0x4e2d6a){logger[_0x3c95('0xe')](_0x3c95('0xf'),_0x306650,'request\x20sent');logger[_0x3c95('0x10')](_0x3c95('0x11'),_0x306650,_0x3c95('0x12'),JSON['stringify'](_0x4e2d6a));if(_0x4e2d6a[_0x3c95('0x13')]){if(_0x4e2d6a['error']['code']===0x1f4){logger[_0x3c95('0x13')](_0x3c95('0xf'),_0x306650,_0x4e2d6a[_0x3c95('0x13')][_0x3c95('0x14')]);return _0x58ea69(_0x4e2d6a[_0x3c95('0x13')][_0x3c95('0x14')]);}logger[_0x3c95('0x13')](_0x3c95('0xf'),_0x306650,_0x4e2d6a[_0x3c95('0x13')][_0x3c95('0x14')]);return _0x1cf65c(_0x4e2d6a[_0x3c95('0x13')][_0x3c95('0x14')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x306650,_0x3c95('0x12'));_0x1cf65c(_0x4e2d6a[_0x3c95('0x15')][_0x3c95('0x14')]);}})[_0x3c95('0x16')](function(_0x3aea14){logger[_0x3c95('0x13')](_0x3c95('0xf'),_0x306650,_0x3aea14);_0x58ea69(_0x3aea14);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 6da5945..c3e7c8f 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 _0x5380=['index','/describe','describe','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get'];(function(_0x49f8c2,_0x5166b7){var _0x3e63ec=function(_0x575c26){while(--_0x575c26){_0x49f8c2['push'](_0x49f8c2['shift']());}};_0x3e63ec(++_0x5166b7);}(_0x5380,0x115));var _0x0538=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5380[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x0538('0x0'));var util=require(_0x0538('0x1'));var path=require(_0x0538('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0538('0x3'));var auth=require(_0x0538('0x4'));var interaction=require(_0x0538('0x5'));var config=require(_0x0538('0x6'));var controller=require(_0x0538('0x7'));router[_0x0538('0x8')]('/',auth['isAuthenticated'](),controller[_0x0538('0x9')]);router[_0x0538('0x8')](_0x0538('0xa'),auth['isAuthenticated'](),controller[_0x0538('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0538('0xc')]);router[_0x0538('0xd')]('/',auth[_0x0538('0xe')](),controller[_0x0538('0xf')]);router[_0x0538('0x10')](_0x0538('0x11'),auth['isAuthenticated'](),controller[_0x0538('0x12')]);router[_0x0538('0x13')](_0x0538('0x11'),auth[_0x0538('0xe')](),controller[_0x0538('0x14')]);module[_0x0538('0x15')]=router; \ No newline at end of file +var _0x7878=['/:id','post','create','put','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x5868b9,_0x3cbf81){var _0x4899b1=function(_0x5d9b83){while(--_0x5d9b83){_0x5868b9['push'](_0x5868b9['shift']());}};_0x4899b1(++_0x3cbf81);}(_0x7878,0x16a));var _0x8787=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7878[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8787('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8787('0x1'));var express=require(_0x8787('0x2'));var router=express['Router']();var fs_extra=require(_0x8787('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8787('0x4'));var config=require(_0x8787('0x5'));var controller=require(_0x8787('0x6'));router[_0x8787('0x7')]('/',auth[_0x8787('0x8')](),controller[_0x8787('0x9')]);router[_0x8787('0x7')](_0x8787('0xa'),auth[_0x8787('0x8')](),controller[_0x8787('0xb')]);router[_0x8787('0x7')](_0x8787('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x8787('0xd')]('/',auth['isAuthenticated'](),controller[_0x8787('0xe')]);router[_0x8787('0xf')]('/:id',auth[_0x8787('0x8')](),controller['update']);router['delete'](_0x8787('0xc'),auth[_0x8787('0x8')](),controller['destroy']);module[_0x8787('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 0a122cd..2f3de66 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 _0x1fcb=['isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','addConfiguration','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller'];(function(_0x3460c9,_0x565510){var _0x1d8283=function(_0x8a51bd){while(--_0x8a51bd){_0x3460c9['push'](_0x3460c9['shift']());}};_0x1d8283(++_0x565510);}(_0x1fcb,0x1af));var _0xb1fc=function(_0x230e87,_0x59f679){_0x230e87=_0x230e87-0x0;var _0x4e63aa=_0x1fcb[_0x230e87];return _0x4e63aa;};'use strict';var multer=require('multer');var util=require(_0xb1fc('0x0'));var path=require(_0xb1fc('0x1'));var timeout=require(_0xb1fc('0x2'));var express=require(_0xb1fc('0x3'));var router=express['Router']();var fs_extra=require(_0xb1fc('0x4'));var auth=require(_0xb1fc('0x5'));var interaction=require(_0xb1fc('0x6'));var config=require(_0xb1fc('0x7'));var controller=require(_0xb1fc('0x8'));router['get']('/',auth[_0xb1fc('0x9')](),controller[_0xb1fc('0xa')]);router[_0xb1fc('0xb')](_0xb1fc('0xc'),auth['isAuthenticated'](),controller[_0xb1fc('0xd')]);router[_0xb1fc('0xb')](_0xb1fc('0xe'),auth[_0xb1fc('0x9')](),controller[_0xb1fc('0xf')]);router[_0xb1fc('0xb')](_0xb1fc('0x10'),auth[_0xb1fc('0x9')](),controller['getFields']);router['post']('/',auth[_0xb1fc('0x9')](),controller[_0xb1fc('0x11')]);router['post'](_0xb1fc('0xe'),auth[_0xb1fc('0x9')](),controller[_0xb1fc('0x12')]);router['put'](_0xb1fc('0xc'),auth[_0xb1fc('0x9')](),controller[_0xb1fc('0x13')]);router['delete'](_0xb1fc('0xc'),auth[_0xb1fc('0x9')](),controller[_0xb1fc('0x14')]);module[_0xb1fc('0x15')]=router; \ No newline at end of file +var _0x6a2c=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x221428,_0x33540b){var _0x174dcb=function(_0x30ab7e){while(--_0x30ab7e){_0x221428['push'](_0x221428['shift']());}};_0x174dcb(++_0x33540b);}(_0x6a2c,0x17b));var _0xc6a2=function(_0x278e78,_0x482823){_0x278e78=_0x278e78-0x0;var _0x1228a0=_0x6a2c[_0x278e78];return _0x1228a0;};'use strict';var multer=require(_0xc6a2('0x0'));var util=require(_0xc6a2('0x1'));var path=require('path');var timeout=require(_0xc6a2('0x2'));var express=require(_0xc6a2('0x3'));var router=express[_0xc6a2('0x4')]();var fs_extra=require(_0xc6a2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc6a2('0x6'));var config=require(_0xc6a2('0x7'));var controller=require(_0xc6a2('0x8'));router[_0xc6a2('0x9')]('/',auth[_0xc6a2('0xa')](),controller[_0xc6a2('0xb')]);router[_0xc6a2('0x9')](_0xc6a2('0xc'),auth[_0xc6a2('0xa')](),controller['show']);router[_0xc6a2('0x9')](_0xc6a2('0xd'),auth[_0xc6a2('0xa')](),controller[_0xc6a2('0xe')]);router['get'](_0xc6a2('0xf'),auth['isAuthenticated'](),controller[_0xc6a2('0x10')]);router[_0xc6a2('0x11')]('/',auth['isAuthenticated'](),controller[_0xc6a2('0x12')]);router[_0xc6a2('0x11')](_0xc6a2('0xd'),auth[_0xc6a2('0xa')](),controller[_0xc6a2('0x13')]);router[_0xc6a2('0x14')](_0xc6a2('0xc'),auth[_0xc6a2('0xa')](),controller[_0xc6a2('0x15')]);router[_0xc6a2('0x16')](_0xc6a2('0xc'),auth[_0xc6a2('0xa')](),controller[_0xc6a2('0x17')]);module[_0xc6a2('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 5d5dccd..aec140e 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 _0xf559=['STRING','ENUM','basic','integrationTab','newTab','exports'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xf559,0x65));var _0x9f55=function(_0x3a6e5c,_0xad63c4){_0x3a6e5c=_0x3a6e5c-0x0;var _0x43e6c7=_0xf559[_0x3a6e5c];return _0x43e6c7;};'use strict';var Sequelize=require('sequelize');module[_0x9f55('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9f55('0x1')]},'username':{'type':Sequelize[_0x9f55('0x1')]},'remoteUri':{'type':Sequelize[_0x9f55('0x1')]},'authType':{'type':Sequelize[_0x9f55('0x2')]('basic'),'defaultValue':_0x9f55('0x3')},'password':{'type':Sequelize[_0x9f55('0x1')]},'consumerKey':{'type':Sequelize[_0x9f55('0x1')]},'consumerSecret':{'type':Sequelize[_0x9f55('0x1')]},'token':{'type':Sequelize[_0x9f55('0x1')]},'tokenSecret':{'type':Sequelize[_0x9f55('0x1')]},'serverUrl':{'type':Sequelize[_0x9f55('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x9f55('0x4'),_0x9f55('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x59f7=['integrationTab','newTab','sequelize','exports','STRING','basic','ENUM'];(function(_0x54ff9f,_0x1bb930){var _0x379293=function(_0x4bdeae){while(--_0x4bdeae){_0x54ff9f['push'](_0x54ff9f['shift']());}};_0x379293(++_0x1bb930);}(_0x59f7,0x18a));var _0x759f=function(_0x43286a,_0x53bc8d){_0x43286a=_0x43286a-0x0;var _0x191174=_0x59f7[_0x43286a];return _0x191174;};'use strict';var Sequelize=require(_0x759f('0x0'));module[_0x759f('0x1')]={'name':{'type':Sequelize[_0x759f('0x2')]},'description':{'type':Sequelize[_0x759f('0x2')]},'username':{'type':Sequelize[_0x759f('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0x759f('0x3')),'defaultValue':_0x759f('0x3')},'password':{'type':Sequelize[_0x759f('0x2')]},'consumerKey':{'type':Sequelize[_0x759f('0x2')]},'consumerSecret':{'type':Sequelize[_0x759f('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x759f('0x2')]},'serverUrl':{'type':Sequelize[_0x759f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x759f('0x4')](_0x759f('0x5'),_0x759f('0x6')),'defaultValue':_0x759f('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index a1102f8..0894cf0 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 _0xee74=['authType','username','consumerKey','token','tokenSecret','remoteUri','slice','GET','application/json','basic','headers','Authorization','Basic\x20%s','format','%s:%s','password','base64','concat','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','send','index','map','DeskAccount','rawAttributes','fieldName','type','model','name','query','intersection','fields','attributes','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','length','find','catch','create','body','params','findOne','DeskConfiguration','filter','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xee74,0xf2));var _0x4ee7=function(_0x5a7e27,_0x5b6462){_0x5a7e27=_0x5a7e27-0x0;var _0x3aec2a=_0xee74[_0x5a7e27];return _0x3aec2a;};'use strict';var emlformat=require(_0x4ee7('0x0'));var rimraf=require(_0x4ee7('0x1'));var zipdir=require(_0x4ee7('0x2'));var jsonpatch=require(_0x4ee7('0x3'));var rp=require(_0x4ee7('0x4'));var moment=require('moment');var BPromise=require(_0x4ee7('0x5'));var Mustache=require(_0x4ee7('0x6'));var util=require(_0x4ee7('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4ee7('0x8'));var ejs=require(_0x4ee7('0x9'));var fs=require('fs');var fs_extra=require(_0x4ee7('0xa'));var _=require(_0x4ee7('0xb'));var squel=require(_0x4ee7('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4ee7('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4ee7('0xe'));var Papa=require('papaparse');var Redis=require(_0x4ee7('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ee7('0x10'));var logger=require(_0x4ee7('0x11'))(_0x4ee7('0x12'));var utils=require(_0x4ee7('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4ee7('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4ee7('0x15'));function respondWithStatusCode(_0x1abb17,_0x401afe){_0x401afe=_0x401afe||0xcc;return function(_0x4c3f41){if(_0x4c3f41){return _0x1abb17[_0x4ee7('0x16')](_0x401afe);}return _0x1abb17[_0x4ee7('0x17')](_0x401afe)[_0x4ee7('0x18')]();};}function respondWithResult(_0x15b1f9,_0xff20f9){_0xff20f9=_0xff20f9||0xc8;return function(_0x16af84){if(_0x16af84){return _0x15b1f9['status'](_0xff20f9)[_0x4ee7('0x19')](_0x16af84);}};}function respondWithFilteredResult(_0x229b25,_0x55701c){return function(_0x53fed6){if(_0x53fed6){var _0x304479=typeof _0x55701c[_0x4ee7('0x1a')]==='undefined'&&typeof _0x55701c['limit']===_0x4ee7('0x1b');var _0x27912d=_0x53fed6[_0x4ee7('0x1c')];var _0x277c1f=_0x304479?0x0:_0x55701c[_0x4ee7('0x1a')];var _0x512dde=_0x304479?_0x53fed6[_0x4ee7('0x1c')]:_0x55701c[_0x4ee7('0x1a')]+_0x55701c[_0x4ee7('0x1d')];var _0x2fcd6f;if(_0x512dde>=_0x27912d){_0x512dde=_0x27912d;_0x2fcd6f=0xc8;}else{_0x2fcd6f=0xce;}_0x229b25['status'](_0x2fcd6f);return _0x229b25[_0x4ee7('0x1e')](_0x4ee7('0x1f'),_0x277c1f+'-'+_0x512dde+'/'+_0x27912d)[_0x4ee7('0x19')](_0x53fed6);}return null;};}function patchUpdates(_0x5f08ef){return function(_0x5cfd7b){try{jsonpatch['apply'](_0x5cfd7b,_0x5f08ef,!![]);}catch(_0x351a3c){return BPromise[_0x4ee7('0x20')](_0x351a3c);}return _0x5cfd7b['save']();};}function saveUpdates(_0x50d23d,_0x3db82a){return function(_0x4ea6a0){if(_0x4ea6a0){return _0x4ea6a0[_0x4ee7('0x21')](_0x50d23d)[_0x4ee7('0x22')](function(_0x39e5af){return _0x39e5af;});}return null;};}function removeEntity(_0xfe8472,_0x5671dc){return function(_0x4d5a05){if(_0x4d5a05){return _0x4d5a05[_0x4ee7('0x23')]()[_0x4ee7('0x22')](function(){_0xfe8472[_0x4ee7('0x17')](0xcc)[_0x4ee7('0x18')]();});}};}function handleEntityNotFound(_0x2ac0bb,_0x23aeb3){return function(_0x4bd6d2){if(!_0x4bd6d2){_0x2ac0bb['sendStatus'](0x194);}return _0x4bd6d2;};}function handleError(_0x2c3f15,_0x42bc0f){_0x42bc0f=_0x42bc0f||0x1f4;return function(_0xc8c3e8){logger[_0x4ee7('0x24')](_0xc8c3e8[_0x4ee7('0x25')]);if(_0xc8c3e8['name']){delete _0xc8c3e8['name'];}_0x2c3f15[_0x4ee7('0x17')](_0x42bc0f)[_0x4ee7('0x26')](_0xc8c3e8);};}exports[_0x4ee7('0x27')]=function(_0x22f7f9,_0x3c6a25){var _0x7f0585={},_0x10b30a={},_0x1505c1={'count':0x0,'rows':[]};var _0x458416=_[_0x4ee7('0x28')](db[_0x4ee7('0x29')][_0x4ee7('0x2a')],function(_0x30e65d){return{'name':_0x30e65d[_0x4ee7('0x2b')],'type':_0x30e65d[_0x4ee7('0x2c')]['key']};});_0x10b30a[_0x4ee7('0x2d')]=_[_0x4ee7('0x28')](_0x458416,_0x4ee7('0x2e'));_0x10b30a[_0x4ee7('0x2f')]=_['keys'](_0x22f7f9['query']);_0x10b30a['filters']=_['intersection'](_0x10b30a[_0x4ee7('0x2d')],_0x10b30a[_0x4ee7('0x2f')]);_0x7f0585['attributes']=_[_0x4ee7('0x30')](_0x10b30a['model'],qs['fields'](_0x22f7f9[_0x4ee7('0x2f')][_0x4ee7('0x31')]));_0x7f0585[_0x4ee7('0x32')]=_0x7f0585[_0x4ee7('0x32')]['length']?_0x7f0585[_0x4ee7('0x32')]:_0x10b30a['model'];if(!_0x22f7f9[_0x4ee7('0x2f')]['hasOwnProperty'](_0x4ee7('0x33'))){_0x7f0585['limit']=qs[_0x4ee7('0x1d')](_0x22f7f9[_0x4ee7('0x2f')][_0x4ee7('0x1d')]);_0x7f0585[_0x4ee7('0x1a')]=qs['offset'](_0x22f7f9[_0x4ee7('0x2f')]['offset']);}_0x7f0585['order']=qs[_0x4ee7('0x34')](_0x22f7f9['query'][_0x4ee7('0x34')]);_0x7f0585[_0x4ee7('0x35')]=qs[_0x4ee7('0x36')](_[_0x4ee7('0x37')](_0x22f7f9[_0x4ee7('0x2f')],_0x10b30a[_0x4ee7('0x36')]),_0x458416);if(_0x22f7f9[_0x4ee7('0x2f')]['filter']){_0x7f0585['where']=_[_0x4ee7('0x38')](_0x7f0585[_0x4ee7('0x35')],{'$or':_[_0x4ee7('0x28')](_0x458416,function(_0x13594f){if(_0x13594f['type']!==_0x4ee7('0x39')){var _0x9916bf={};_0x9916bf[_0x13594f[_0x4ee7('0x2e')]]={'$like':'%'+_0x22f7f9[_0x4ee7('0x2f')]['filter']+'%'};return _0x9916bf;}})});}_0x7f0585=_[_0x4ee7('0x38')]({},_0x7f0585,_0x22f7f9[_0x4ee7('0x3a')]);var _0x501598={'where':_0x7f0585[_0x4ee7('0x35')]};return db[_0x4ee7('0x29')][_0x4ee7('0x1c')](_0x501598)[_0x4ee7('0x22')](function(_0x49fb5b){_0x1505c1[_0x4ee7('0x1c')]=_0x49fb5b;if(_0x22f7f9[_0x4ee7('0x2f')][_0x4ee7('0x3b')]){_0x7f0585[_0x4ee7('0x3c')]=[{'all':!![]}];}return db[_0x4ee7('0x29')][_0x4ee7('0x3d')](_0x7f0585);})[_0x4ee7('0x22')](function(_0x1eb126){_0x1505c1[_0x4ee7('0x3e')]=_0x1eb126;return _0x1505c1;})[_0x4ee7('0x22')](respondWithFilteredResult(_0x3c6a25,_0x7f0585))['catch'](handleError(_0x3c6a25,null));};exports[_0x4ee7('0x3f')]=function(_0x169dd9,_0x3636df){var _0x7f98ac={'raw':![],'where':{'id':_0x169dd9['params']['id']}},_0x3b24c3={};_0x3b24c3[_0x4ee7('0x2d')]=_[_0x4ee7('0x40')](db[_0x4ee7('0x29')][_0x4ee7('0x2a')]);_0x3b24c3[_0x4ee7('0x2f')]=_[_0x4ee7('0x40')](_0x169dd9[_0x4ee7('0x2f')]);_0x3b24c3[_0x4ee7('0x36')]=_[_0x4ee7('0x30')](_0x3b24c3[_0x4ee7('0x2d')],_0x3b24c3[_0x4ee7('0x2f')]);_0x7f98ac[_0x4ee7('0x32')]=_[_0x4ee7('0x30')](_0x3b24c3[_0x4ee7('0x2d')],qs[_0x4ee7('0x31')](_0x169dd9[_0x4ee7('0x2f')]['fields']));_0x7f98ac[_0x4ee7('0x32')]=_0x7f98ac[_0x4ee7('0x32')][_0x4ee7('0x41')]?_0x7f98ac[_0x4ee7('0x32')]:_0x3b24c3[_0x4ee7('0x2d')];if(_0x169dd9[_0x4ee7('0x2f')]['includeAll']){_0x7f98ac['include']=[{'all':!![]}];}_0x7f98ac=_[_0x4ee7('0x38')]({},_0x7f98ac,_0x169dd9[_0x4ee7('0x3a')]);return db['DeskAccount'][_0x4ee7('0x42')](_0x7f98ac)[_0x4ee7('0x22')](handleEntityNotFound(_0x3636df,null))[_0x4ee7('0x22')](respondWithResult(_0x3636df,null))[_0x4ee7('0x43')](handleError(_0x3636df,null));};exports[_0x4ee7('0x44')]=function(_0x7dc9a7,_0x2352ce){return db[_0x4ee7('0x29')][_0x4ee7('0x44')](_0x7dc9a7[_0x4ee7('0x45')],{})[_0x4ee7('0x22')](respondWithResult(_0x2352ce,0xc9))[_0x4ee7('0x43')](handleError(_0x2352ce,null));};exports['update']=function(_0x3746b2,_0x16a218){if(_0x3746b2[_0x4ee7('0x45')]['id']){delete _0x3746b2[_0x4ee7('0x45')]['id'];}return db[_0x4ee7('0x29')][_0x4ee7('0x42')]({'where':{'id':_0x3746b2[_0x4ee7('0x46')]['id']}})[_0x4ee7('0x22')](handleEntityNotFound(_0x16a218,null))[_0x4ee7('0x22')](saveUpdates(_0x3746b2[_0x4ee7('0x45')],null))[_0x4ee7('0x22')](respondWithResult(_0x16a218,null))[_0x4ee7('0x43')](handleError(_0x16a218,null));};exports[_0x4ee7('0x23')]=function(_0x138d3c,_0x2790bf){return db[_0x4ee7('0x29')][_0x4ee7('0x42')]({'where':{'id':_0x138d3c[_0x4ee7('0x46')]['id']}})['then'](handleEntityNotFound(_0x2790bf,null))[_0x4ee7('0x22')](removeEntity(_0x2790bf,null))[_0x4ee7('0x43')](handleError(_0x2790bf,null));};exports['getConfigurations']=function(_0x386cb0,_0x2566b4,_0x4f82d3){var _0x4acb99={};var _0x427805={};var _0xea6b7d;var _0xf8efb5;return db['DeskAccount'][_0x4ee7('0x47')]({'where':{'id':_0x386cb0[_0x4ee7('0x46')]['id']}})['then'](handleEntityNotFound(_0x2566b4,null))[_0x4ee7('0x22')](function(_0x143858){if(_0x143858){_0xea6b7d=_0x143858;_0x427805[_0x4ee7('0x2d')]=_[_0x4ee7('0x40')](db[_0x4ee7('0x48')]['rawAttributes']);_0x427805[_0x4ee7('0x2f')]=_['keys'](_0x386cb0[_0x4ee7('0x2f')]);_0x427805[_0x4ee7('0x36')]=_[_0x4ee7('0x30')](_0x427805['model'],_0x427805[_0x4ee7('0x2f')]);_0x4acb99[_0x4ee7('0x32')]=_[_0x4ee7('0x30')](_0x427805[_0x4ee7('0x2d')],qs['fields'](_0x386cb0[_0x4ee7('0x2f')][_0x4ee7('0x31')]));_0x4acb99[_0x4ee7('0x32')]=_0x4acb99[_0x4ee7('0x32')][_0x4ee7('0x41')]?_0x4acb99[_0x4ee7('0x32')]:_0x427805[_0x4ee7('0x2d')];_0x4acb99['order']=qs[_0x4ee7('0x34')](_0x386cb0[_0x4ee7('0x2f')][_0x4ee7('0x34')]);_0x4acb99[_0x4ee7('0x35')]=qs[_0x4ee7('0x36')](_[_0x4ee7('0x37')](_0x386cb0[_0x4ee7('0x2f')],_0x427805[_0x4ee7('0x36')]));if(_0x386cb0[_0x4ee7('0x2f')][_0x4ee7('0x49')]){_0x4acb99['where']=_[_0x4ee7('0x38')](_0x4acb99['where'],{'$or':_['map'](_0x4acb99[_0x4ee7('0x32')],function(_0x56bea8){var _0x4bb93b={};_0x4bb93b[_0x56bea8]={'$like':'%'+_0x386cb0[_0x4ee7('0x2f')][_0x4ee7('0x49')]+'%'};return _0x4bb93b;})});}_0x4acb99=_['merge']({},_0x4acb99,_0x386cb0['options']);return _0xea6b7d[_0x4ee7('0x4a')](_0x4acb99);}})[_0x4ee7('0x22')](function(_0x41d2cc){if(_0x41d2cc){_0xf8efb5=_0x41d2cc[_0x4ee7('0x41')];if(!_0x386cb0['query'][_0x4ee7('0x4b')]('nolimit')){_0x4acb99[_0x4ee7('0x1d')]=qs['limit'](_0x386cb0['query'][_0x4ee7('0x1d')]);_0x4acb99['offset']=qs[_0x4ee7('0x1a')](_0x386cb0[_0x4ee7('0x2f')][_0x4ee7('0x1a')]);}return _0xea6b7d['getConfigurations'](_0x4acb99);}})[_0x4ee7('0x22')](function(_0xe5e86a){if(_0xe5e86a){return _0xe5e86a?{'count':_0xf8efb5,'rows':_0xe5e86a}:null;}})[_0x4ee7('0x22')](respondWithResult(_0x2566b4,null))['catch'](handleError(_0x2566b4,null));};exports[_0x4ee7('0x4c')]=function(_0x2a8578,_0x47790d,_0x4480f2){if(_0x2a8578[_0x4ee7('0x45')]['id']){delete _0x2a8578[_0x4ee7('0x45')]['id'];}return db[_0x4ee7('0x29')][_0x4ee7('0x47')]({'where':{'id':_0x2a8578['params']['id']}})[_0x4ee7('0x22')](handleEntityNotFound(_0x47790d,null))[_0x4ee7('0x22')](function(_0x65f0e2){if(_0x65f0e2){_0x2a8578[_0x4ee7('0x45')][_0x4ee7('0x4d')]=_0x65f0e2['id'];_0x2a8578[_0x4ee7('0x45')][_0x4ee7('0x4e')]=integrations['getSubjects'](_0x2a8578['body'][_0x4ee7('0x4f')],_0x2a8578['body'][_0x4ee7('0x2c')]);_0x2a8578[_0x4ee7('0x45')][_0x4ee7('0x50')]=integrations[_0x4ee7('0x51')](_0x2a8578[_0x4ee7('0x45')][_0x4ee7('0x4f')],_0x2a8578[_0x4ee7('0x45')][_0x4ee7('0x2c')]);return db['DeskConfiguration']['create'](_0x2a8578[_0x4ee7('0x45')],{'include':[{'model':db['DeskField'],'as':_0x4ee7('0x4e')},{'model':db[_0x4ee7('0x52')],'as':_0x4ee7('0x50')}]});}return null;})[_0x4ee7('0x22')](respondWithResult(_0x47790d,null))['catch'](handleError(_0x47790d,null));};exports[_0x4ee7('0x53')]=function(_0x533fc1,_0x2f0b6f,_0x3b29b3){var _0x5588fa=[{'name':_0x4ee7('0x54'),'label':_0x4ee7('0x54'),'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 _0x3ba733='';return db[_0x4ee7('0x29')][_0x4ee7('0x47')]({'where':{'id':_0x533fc1['params']['id']},'attributes':['id','remoteUri',_0x4ee7('0x55'),_0x4ee7('0x56'),'password',_0x4ee7('0x57'),'consumerSecret',_0x4ee7('0x58'),_0x4ee7('0x59')]})[_0x4ee7('0x22')](handleEntityNotFound(_0x2f0b6f,null))[_0x4ee7('0x22')](function(_0x4b74f5){if(_0x4b74f5){_0x3ba733=_0x4b74f5[_0x4ee7('0x5a')];var _0x1a6cb8=_0x3ba733[_0x4ee7('0x5b')](-0x1);if(_0x1a6cb8==='/'){_0x3ba733=_0x3ba733['substring'](0x0,_0x3ba733['lastIndexOf'](_0x1a6cb8));}var _0x303f95={'method':_0x4ee7('0x5c'),'uri':util['format']('%s/custom_fields',_0x3ba733),'headers':{'Content-Type':_0x4ee7('0x5d'),'Accept':'application/json'},'json':!![]};if(_0x4b74f5[_0x4ee7('0x55')]===_0x4ee7('0x5e')){_0x303f95[_0x4ee7('0x5f')][_0x4ee7('0x60')]=util['format'](_0x4ee7('0x61'),new Buffer(util[_0x4ee7('0x62')](_0x4ee7('0x63'),_0x4b74f5[_0x4ee7('0x56')],_0x4b74f5[_0x4ee7('0x64')]))['toString'](_0x4ee7('0x65')));}return rp(_0x303f95)[_0x4ee7('0x22')](function(_0x22cade){return _0x5588fa[_0x4ee7('0x66')](_[_0x4ee7('0x28')](_0x22cade['_embedded']['entries'],function(_0x1c1bb8){return{'id':_0x1c1bb8['name'],'name':_0x1c1bb8[_0x4ee7('0x2e')],'type':_0x1c1bb8[_0x4ee7('0x2c')],'active':_0x1c1bb8[_0x4ee7('0x67')],'label':_0x1c1bb8['label'],'custom':!![]};}));});}})[_0x4ee7('0x22')](function(_0xc74116){return{'count':_0xc74116[_0x4ee7('0x41')],'rows':_0xc74116};})[_0x4ee7('0x22')](respondWithResult(_0x2f0b6f,null))['catch'](function(_0x37915e){var _0xf0062e=_0x533fc1['query'][_0x4ee7('0x68')]?0x1f4:_0x37915e[_0x4ee7('0x69')]||0x1f4;logger[_0x4ee7('0x24')](_0x4ee7('0x6a'),_0x4ee7('0x53'),_0xf0062e,JSON[_0x4ee7('0x6b')](_0x37915e));delete _0x37915e[_0x4ee7('0x2e')];if(_0xf0062e===0x191){_0xf0062e=0x190;}_0x2f0b6f[_0x4ee7('0x17')](_0xf0062e)[_0x4ee7('0x26')](_0x533fc1[_0x4ee7('0x2f')][_0x4ee7('0x68')]?{'message':_0x4ee7('0x6c'),'statusCode':_0x37915e[_0x4ee7('0x69')]}:_0x37915e);});}; \ No newline at end of file +var _0xf0ff=['sendStatus','error','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','then','rows','show','params','keys','find','create','body','catch','destroy','findOne','DeskConfiguration','merge','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','authType','username','password','consumerKey','consumerSecret','remoteUri','slice','GET','%s/custom_fields','application/json','basic','headers','format','%s:%s','toString','base64','_embedded','entries','label','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','limit','undefined','count','offset','json','apply','reject','save','update'];(function(_0x5bfb2d,_0x26d833){var _0x17b624=function(_0x4a98da){while(--_0x4a98da){_0x5bfb2d['push'](_0x5bfb2d['shift']());}};_0x17b624(++_0x26d833);}(_0xf0ff,0x194));var _0xff0f=function(_0x455e92,_0x3a4c20){_0x455e92=_0x455e92-0x0;var _0x2a3a61=_0xf0ff[_0x455e92];return _0x2a3a61;};'use strict';var emlformat=require(_0xff0f('0x0'));var rimraf=require(_0xff0f('0x1'));var zipdir=require(_0xff0f('0x2'));var jsonpatch=require(_0xff0f('0x3'));var rp=require(_0xff0f('0x4'));var moment=require(_0xff0f('0x5'));var BPromise=require(_0xff0f('0x6'));var Mustache=require(_0xff0f('0x7'));var util=require(_0xff0f('0x8'));var path=require(_0xff0f('0x9'));var sox=require(_0xff0f('0xa'));var csv=require(_0xff0f('0xb'));var ejs=require(_0xff0f('0xc'));var fs=require('fs');var fs_extra=require(_0xff0f('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xff0f('0xe'));var toCsv=require(_0xff0f('0xb'));var querystring=require(_0xff0f('0xf'));var Papa=require('papaparse');var Redis=require(_0xff0f('0x10'));var authService=require(_0xff0f('0x11'));var qs=require(_0xff0f('0x12'));var as=require(_0xff0f('0x13'));var hardwareService=require(_0xff0f('0x14'));var logger=require('../../config/logger')(_0xff0f('0x15'));var utils=require(_0xff0f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xff0f('0x17'));var db=require(_0xff0f('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3cdc38,_0x530936){_0x530936=_0x530936||0xcc;return function(_0xbf441e){if(_0xbf441e){return _0x3cdc38['sendStatus'](_0x530936);}return _0x3cdc38[_0xff0f('0x19')](_0x530936)[_0xff0f('0x1a')]();};}function respondWithResult(_0x212002,_0x386c82){_0x386c82=_0x386c82||0xc8;return function(_0x423dec){if(_0x423dec){return _0x212002[_0xff0f('0x19')](_0x386c82)['json'](_0x423dec);}};}function respondWithFilteredResult(_0x489bd8,_0x42df53){return function(_0x3b2a8e){if(_0x3b2a8e){var _0x57a2da=typeof _0x42df53['offset']==='undefined'&&typeof _0x42df53[_0xff0f('0x1b')]===_0xff0f('0x1c');var _0x499a4e=_0x3b2a8e[_0xff0f('0x1d')];var _0x302c9d=_0x57a2da?0x0:_0x42df53[_0xff0f('0x1e')];var _0x719dc2=_0x57a2da?_0x3b2a8e[_0xff0f('0x1d')]:_0x42df53[_0xff0f('0x1e')]+_0x42df53['limit'];var _0x11c05d;if(_0x719dc2>=_0x499a4e){_0x719dc2=_0x499a4e;_0x11c05d=0xc8;}else{_0x11c05d=0xce;}_0x489bd8[_0xff0f('0x19')](_0x11c05d);return _0x489bd8['set']('Content-Range',_0x302c9d+'-'+_0x719dc2+'/'+_0x499a4e)[_0xff0f('0x1f')](_0x3b2a8e);}return null;};}function patchUpdates(_0x59726c){return function(_0x453203){try{jsonpatch[_0xff0f('0x20')](_0x453203,_0x59726c,!![]);}catch(_0x322b03){return BPromise[_0xff0f('0x21')](_0x322b03);}return _0x453203[_0xff0f('0x22')]();};}function saveUpdates(_0x4314df,_0x17bc94){return function(_0x5da8cd){if(_0x5da8cd){return _0x5da8cd[_0xff0f('0x23')](_0x4314df)['then'](function(_0x4bc37c){return _0x4bc37c;});}return null;};}function removeEntity(_0x23bec5,_0x2bf3b8){return function(_0x338cc0){if(_0x338cc0){return _0x338cc0['destroy']()['then'](function(){_0x23bec5[_0xff0f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42586c,_0x2db633){return function(_0x2e2b59){if(!_0x2e2b59){_0x42586c[_0xff0f('0x24')](0x194);}return _0x2e2b59;};}function handleError(_0x4d9129,_0x4afcaf){_0x4afcaf=_0x4afcaf||0x1f4;return function(_0x2e2b02){logger[_0xff0f('0x25')](_0x2e2b02[_0xff0f('0x26')]);if(_0x2e2b02[_0xff0f('0x27')]){delete _0x2e2b02['name'];}_0x4d9129[_0xff0f('0x19')](_0x4afcaf)[_0xff0f('0x28')](_0x2e2b02);};}exports[_0xff0f('0x29')]=function(_0x46ea9b,_0x47aad4){var _0xac1133={},_0x3cf917={},_0x21df4d={'count':0x0,'rows':[]};var _0x140d91=_[_0xff0f('0x2a')](db[_0xff0f('0x2b')][_0xff0f('0x2c')],function(_0x405aa0){return{'name':_0x405aa0[_0xff0f('0x2d')],'type':_0x405aa0[_0xff0f('0x2e')]['key']};});_0x3cf917[_0xff0f('0x2f')]=_[_0xff0f('0x2a')](_0x140d91,_0xff0f('0x27'));_0x3cf917['query']=_['keys'](_0x46ea9b[_0xff0f('0x30')]);_0x3cf917[_0xff0f('0x31')]=_[_0xff0f('0x32')](_0x3cf917[_0xff0f('0x2f')],_0x3cf917[_0xff0f('0x30')]);_0xac1133[_0xff0f('0x33')]=_[_0xff0f('0x32')](_0x3cf917[_0xff0f('0x2f')],qs['fields'](_0x46ea9b[_0xff0f('0x30')][_0xff0f('0x34')]));_0xac1133[_0xff0f('0x33')]=_0xac1133['attributes'][_0xff0f('0x35')]?_0xac1133[_0xff0f('0x33')]:_0x3cf917['model'];if(!_0x46ea9b[_0xff0f('0x30')][_0xff0f('0x36')](_0xff0f('0x37'))){_0xac1133['limit']=qs[_0xff0f('0x1b')](_0x46ea9b[_0xff0f('0x30')][_0xff0f('0x1b')]);_0xac1133[_0xff0f('0x1e')]=qs[_0xff0f('0x1e')](_0x46ea9b[_0xff0f('0x30')][_0xff0f('0x1e')]);}_0xac1133[_0xff0f('0x38')]=qs[_0xff0f('0x39')](_0x46ea9b[_0xff0f('0x30')]['sort']);_0xac1133['where']=qs['filters'](_[_0xff0f('0x3a')](_0x46ea9b['query'],_0x3cf917[_0xff0f('0x31')]),_0x140d91);if(_0x46ea9b[_0xff0f('0x30')][_0xff0f('0x3b')]){_0xac1133['where']=_['merge'](_0xac1133[_0xff0f('0x3c')],{'$or':_[_0xff0f('0x2a')](_0x140d91,function(_0x40cf09){if(_0x40cf09['type']!==_0xff0f('0x3d')){var _0x312aca={};_0x312aca[_0x40cf09[_0xff0f('0x27')]]={'$like':'%'+_0x46ea9b[_0xff0f('0x30')]['filter']+'%'};return _0x312aca;}})});}_0xac1133=_['merge']({},_0xac1133,_0x46ea9b[_0xff0f('0x3e')]);var _0x3fcd6b={'where':_0xac1133['where']};return db['DeskAccount'][_0xff0f('0x1d')](_0x3fcd6b)['then'](function(_0x386ff5){_0x21df4d['count']=_0x386ff5;if(_0x46ea9b['query'][_0xff0f('0x3f')]){_0xac1133[_0xff0f('0x40')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0xac1133);})[_0xff0f('0x41')](function(_0x494c27){_0x21df4d[_0xff0f('0x42')]=_0x494c27;return _0x21df4d;})[_0xff0f('0x41')](respondWithFilteredResult(_0x47aad4,_0xac1133))['catch'](handleError(_0x47aad4,null));};exports[_0xff0f('0x43')]=function(_0x36e85e,_0x349a90){var _0x4201d8={'raw':![],'where':{'id':_0x36e85e[_0xff0f('0x44')]['id']}},_0x194cde={};_0x194cde[_0xff0f('0x2f')]=_[_0xff0f('0x45')](db[_0xff0f('0x2b')]['rawAttributes']);_0x194cde[_0xff0f('0x30')]=_['keys'](_0x36e85e['query']);_0x194cde[_0xff0f('0x31')]=_['intersection'](_0x194cde[_0xff0f('0x2f')],_0x194cde[_0xff0f('0x30')]);_0x4201d8[_0xff0f('0x33')]=_[_0xff0f('0x32')](_0x194cde[_0xff0f('0x2f')],qs[_0xff0f('0x34')](_0x36e85e[_0xff0f('0x30')][_0xff0f('0x34')]));_0x4201d8[_0xff0f('0x33')]=_0x4201d8['attributes'][_0xff0f('0x35')]?_0x4201d8['attributes']:_0x194cde[_0xff0f('0x2f')];if(_0x36e85e[_0xff0f('0x30')][_0xff0f('0x3f')]){_0x4201d8[_0xff0f('0x40')]=[{'all':!![]}];}_0x4201d8=_['merge']({},_0x4201d8,_0x36e85e[_0xff0f('0x3e')]);return db[_0xff0f('0x2b')][_0xff0f('0x46')](_0x4201d8)[_0xff0f('0x41')](handleEntityNotFound(_0x349a90,null))['then'](respondWithResult(_0x349a90,null))['catch'](handleError(_0x349a90,null));};exports[_0xff0f('0x47')]=function(_0x4fba0a,_0x201e2e){return db[_0xff0f('0x2b')][_0xff0f('0x47')](_0x4fba0a[_0xff0f('0x48')],{})['then'](respondWithResult(_0x201e2e,0xc9))[_0xff0f('0x49')](handleError(_0x201e2e,null));};exports[_0xff0f('0x23')]=function(_0x4db0fb,_0x388d8b){if(_0x4db0fb[_0xff0f('0x48')]['id']){delete _0x4db0fb['body']['id'];}return db[_0xff0f('0x2b')][_0xff0f('0x46')]({'where':{'id':_0x4db0fb[_0xff0f('0x44')]['id']}})['then'](handleEntityNotFound(_0x388d8b,null))[_0xff0f('0x41')](saveUpdates(_0x4db0fb[_0xff0f('0x48')],null))['then'](respondWithResult(_0x388d8b,null))[_0xff0f('0x49')](handleError(_0x388d8b,null));};exports[_0xff0f('0x4a')]=function(_0x19f051,_0x215b1b){return db['DeskAccount'][_0xff0f('0x46')]({'where':{'id':_0x19f051[_0xff0f('0x44')]['id']}})[_0xff0f('0x41')](handleEntityNotFound(_0x215b1b,null))[_0xff0f('0x41')](removeEntity(_0x215b1b,null))[_0xff0f('0x49')](handleError(_0x215b1b,null));};exports['getConfigurations']=function(_0x54d4ff,_0x1b1125,_0x3827b5){var _0x200142={};var _0x17b02a={};var _0x3f1cf4;var _0x47df42;return db[_0xff0f('0x2b')][_0xff0f('0x4b')]({'where':{'id':_0x54d4ff[_0xff0f('0x44')]['id']}})[_0xff0f('0x41')](handleEntityNotFound(_0x1b1125,null))[_0xff0f('0x41')](function(_0x543ba5){if(_0x543ba5){_0x3f1cf4=_0x543ba5;_0x17b02a[_0xff0f('0x2f')]=_['keys'](db[_0xff0f('0x4c')][_0xff0f('0x2c')]);_0x17b02a['query']=_[_0xff0f('0x45')](_0x54d4ff[_0xff0f('0x30')]);_0x17b02a['filters']=_[_0xff0f('0x32')](_0x17b02a[_0xff0f('0x2f')],_0x17b02a['query']);_0x200142['attributes']=_['intersection'](_0x17b02a[_0xff0f('0x2f')],qs['fields'](_0x54d4ff[_0xff0f('0x30')][_0xff0f('0x34')]));_0x200142['attributes']=_0x200142[_0xff0f('0x33')][_0xff0f('0x35')]?_0x200142[_0xff0f('0x33')]:_0x17b02a[_0xff0f('0x2f')];_0x200142[_0xff0f('0x38')]=qs[_0xff0f('0x39')](_0x54d4ff[_0xff0f('0x30')][_0xff0f('0x39')]);_0x200142[_0xff0f('0x3c')]=qs[_0xff0f('0x31')](_[_0xff0f('0x3a')](_0x54d4ff['query'],_0x17b02a[_0xff0f('0x31')]));if(_0x54d4ff[_0xff0f('0x30')]['filter']){_0x200142[_0xff0f('0x3c')]=_[_0xff0f('0x4d')](_0x200142[_0xff0f('0x3c')],{'$or':_['map'](_0x200142[_0xff0f('0x33')],function(_0x28d5ce){var _0x551898={};_0x551898[_0x28d5ce]={'$like':'%'+_0x54d4ff[_0xff0f('0x30')][_0xff0f('0x3b')]+'%'};return _0x551898;})});}_0x200142=_[_0xff0f('0x4d')]({},_0x200142,_0x54d4ff[_0xff0f('0x3e')]);return _0x3f1cf4[_0xff0f('0x4e')](_0x200142);}})['then'](function(_0x2eab2d){if(_0x2eab2d){_0x47df42=_0x2eab2d[_0xff0f('0x35')];if(!_0x54d4ff['query'][_0xff0f('0x36')]('nolimit')){_0x200142['limit']=qs[_0xff0f('0x1b')](_0x54d4ff[_0xff0f('0x30')][_0xff0f('0x1b')]);_0x200142[_0xff0f('0x1e')]=qs[_0xff0f('0x1e')](_0x54d4ff[_0xff0f('0x30')][_0xff0f('0x1e')]);}return _0x3f1cf4[_0xff0f('0x4e')](_0x200142);}})['then'](function(_0x144776){if(_0x144776){return _0x144776?{'count':_0x47df42,'rows':_0x144776}:null;}})['then'](respondWithResult(_0x1b1125,null))[_0xff0f('0x49')](handleError(_0x1b1125,null));};exports[_0xff0f('0x4f')]=function(_0x377ce0,_0x498c71,_0x46ef38){if(_0x377ce0['body']['id']){delete _0x377ce0['body']['id'];}return db[_0xff0f('0x2b')][_0xff0f('0x4b')]({'where':{'id':_0x377ce0[_0xff0f('0x44')]['id']}})[_0xff0f('0x41')](handleEntityNotFound(_0x498c71,null))[_0xff0f('0x41')](function(_0x2c4e91){if(_0x2c4e91){_0x377ce0['body'][_0xff0f('0x50')]=_0x2c4e91['id'];_0x377ce0[_0xff0f('0x48')]['Subjects']=integrations[_0xff0f('0x51')](_0x377ce0[_0xff0f('0x48')][_0xff0f('0x52')],_0x377ce0[_0xff0f('0x48')][_0xff0f('0x2e')]);_0x377ce0[_0xff0f('0x48')][_0xff0f('0x53')]=integrations[_0xff0f('0x54')](_0x377ce0[_0xff0f('0x48')][_0xff0f('0x52')],_0x377ce0[_0xff0f('0x48')][_0xff0f('0x2e')]);return db['DeskConfiguration']['create'](_0x377ce0[_0xff0f('0x48')],{'include':[{'model':db[_0xff0f('0x55')],'as':'Subjects'},{'model':db[_0xff0f('0x55')],'as':_0xff0f('0x53')}]});}return null;})[_0xff0f('0x41')](respondWithResult(_0x498c71,null))[_0xff0f('0x49')](handleError(_0x498c71,null));};exports[_0xff0f('0x56')]=function(_0x22eb21,_0x53e8e9,_0x3fcdaf){var _0xa6ff4b=[{'name':_0xff0f('0x57'),'label':_0xff0f('0x57'),'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 _0x45bd23='';return db[_0xff0f('0x2b')][_0xff0f('0x4b')]({'where':{'id':_0x22eb21[_0xff0f('0x44')]['id']},'attributes':['id','remoteUri',_0xff0f('0x58'),_0xff0f('0x59'),_0xff0f('0x5a'),_0xff0f('0x5b'),_0xff0f('0x5c'),'token','tokenSecret']})['then'](handleEntityNotFound(_0x53e8e9,null))['then'](function(_0x23707b){if(_0x23707b){_0x45bd23=_0x23707b[_0xff0f('0x5d')];var _0x440fc6=_0x45bd23[_0xff0f('0x5e')](-0x1);if(_0x440fc6==='/'){_0x45bd23=_0x45bd23['substring'](0x0,_0x45bd23['lastIndexOf'](_0x440fc6));}var _0x387a05={'method':_0xff0f('0x5f'),'uri':util['format'](_0xff0f('0x60'),_0x45bd23),'headers':{'Content-Type':_0xff0f('0x61'),'Accept':_0xff0f('0x61')},'json':!![]};if(_0x23707b[_0xff0f('0x58')]===_0xff0f('0x62')){_0x387a05[_0xff0f('0x63')]['Authorization']=util[_0xff0f('0x64')]('Basic\x20%s',new Buffer(util[_0xff0f('0x64')](_0xff0f('0x65'),_0x23707b[_0xff0f('0x59')],_0x23707b[_0xff0f('0x5a')]))[_0xff0f('0x66')](_0xff0f('0x67')));}return rp(_0x387a05)[_0xff0f('0x41')](function(_0x20bed7){return _0xa6ff4b['concat'](_['map'](_0x20bed7[_0xff0f('0x68')][_0xff0f('0x69')],function(_0xf07a61){return{'id':_0xf07a61['name'],'name':_0xf07a61[_0xff0f('0x27')],'type':_0xf07a61[_0xff0f('0x2e')],'active':_0xf07a61['active'],'label':_0xf07a61[_0xff0f('0x6a')],'custom':!![]};}));});}})[_0xff0f('0x41')](function(_0x338327){return{'count':_0x338327['length'],'rows':_0x338327};})[_0xff0f('0x41')](respondWithResult(_0x53e8e9,null))['catch'](function(_0x26a47b){var _0x3bbb9e=_0x22eb21['query']['test']?0x1f4:_0x26a47b['statusCode']||0x1f4;logger[_0xff0f('0x25')](_0xff0f('0x6b'),_0xff0f('0x56'),_0x3bbb9e,JSON[_0xff0f('0x6c')](_0x26a47b));delete _0x26a47b[_0xff0f('0x27')];if(_0x3bbb9e===0x191){_0x3bbb9e=0x190;}_0x53e8e9[_0xff0f('0x19')](_0x3bbb9e)['send'](_0x22eb21[_0xff0f('0x30')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x26a47b[_0xff0f('0x6d')]}:_0x26a47b);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 3dd57e6..739913a 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 _0x0831=['int_desk_accounts','lodash','util','bluebird','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x40ff3b,_0x238af7){var _0x3ccf4f=function(_0x397ae0){while(--_0x397ae0){_0x40ff3b['push'](_0x40ff3b['shift']());}};_0x3ccf4f(++_0x238af7);}(_0x0831,0x1cc));var _0x1083=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0x0831[_0x16de68];return _0x1c277e;};'use strict';var _=require(_0x1083('0x0'));var util=require(_0x1083('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1083('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1083('0x3'));var rimraf=require('rimraf');var config=require(_0x1083('0x4'));var attributes=require(_0x1083('0x5'));var integrations=require(_0x1083('0x6'));module[_0x1083('0x7')]=function(_0x4f4d3b,_0x373faf){return _0x4f4d3b['define']('DeskAccount',attributes,{'tableName':_0x1083('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf23c=['lodash','util','../../config/logger','api','request-promise','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount'];(function(_0x2be2b5,_0x577288){var _0x1cf9f9=function(_0x4ea68e){while(--_0x4ea68e){_0x2be2b5['push'](_0x2be2b5['shift']());}};_0x1cf9f9(++_0x577288);}(_0xf23c,0x15e));var _0xcf23=function(_0x565fed,_0xb85768){_0x565fed=_0x565fed-0x0;var _0x3e018f=_0xf23c[_0x565fed];return _0x3e018f;};'use strict';var _=require(_0xcf23('0x0'));var util=require(_0xcf23('0x1'));var logger=require(_0xcf23('0x2'))(_0xcf23('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcf23('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcf23('0x5'));var attributes=require(_0xcf23('0x6'));var integrations=require(_0xcf23('0x7'));module['exports']=function(_0x29bf5f,_0x3d671b){return _0x29bf5f[_0xcf23('0x8')](_0xcf23('0x9'),attributes,{'tableName':'int_desk_accounts','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 9f4954e..50bd127 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 _0x1260=['error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','include','map','model','then','where','ShowDeskAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0x1260,0xe5));var _0x0126=function(_0x2706c3,_0x191223){_0x2706c3=_0x2706c3-0x0;var _0x362c3e=_0x1260[_0x2706c3];return _0x362c3e;};'use strict';var _=require(_0x0126('0x0'));var util=require(_0x0126('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0126('0x2'));var fs=require('fs');var Redis=require(_0x0126('0x3'));var db=require(_0x0126('0x4'))['db'];var utils=require(_0x0126('0x5'));var logger=require('../../config/logger')(_0x0126('0x6'));var config=require('../../config/environment');var jayson=require(_0x0126('0x7'));var client=jayson[_0x0126('0x8')][_0x0126('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e07ce,_0x4fc349,_0x4be3c5){return new BPromise(function(_0x44a940,_0x3fd483){return client[_0x0126('0xa')](_0x5e07ce,_0x4be3c5)['then'](function(_0x549747){logger[_0x0126('0xb')]('DeskAccount,\x20%s,\x20%s',_0x4fc349,_0x0126('0xc'));logger[_0x0126('0xd')](_0x0126('0xe'),_0x4fc349,'request\x20sent',JSON[_0x0126('0xf')](_0x549747));if(_0x549747[_0x0126('0x10')]){if(_0x549747[_0x0126('0x10')][_0x0126('0x11')]===0x1f4){logger[_0x0126('0x10')](_0x0126('0x12'),_0x4fc349,_0x549747[_0x0126('0x10')][_0x0126('0x13')]);return _0x3fd483(_0x549747[_0x0126('0x10')]['message']);}logger[_0x0126('0x10')](_0x0126('0x12'),_0x4fc349,_0x549747[_0x0126('0x10')][_0x0126('0x13')]);return _0x44a940(_0x549747[_0x0126('0x10')][_0x0126('0x13')]);}else{logger[_0x0126('0xb')](_0x0126('0x12'),_0x4fc349,_0x0126('0xc'));_0x44a940(_0x549747[_0x0126('0x14')][_0x0126('0x13')]);}})[_0x0126('0x15')](function(_0x5d9b40){logger[_0x0126('0x10')](_0x0126('0x12'),_0x4fc349,_0x5d9b40);_0x3fd483(_0x5d9b40);});});}exports[_0x0126('0x16')]=function(_0x306560){var _0x31a97d=this;return new Promise(function(_0x5af5e1,_0x7b285e){return db[_0x0126('0x17')][_0x0126('0x18')]({'raw':_0x306560['options']?_0x306560[_0x0126('0x19')][_0x0126('0x1a')]===undefined?!![]:![]:!![],'where':_0x306560[_0x0126('0x19')]?_0x306560['options']['where']||null:null,'attributes':_0x306560[_0x0126('0x19')]?_0x306560[_0x0126('0x19')][_0x0126('0x1b')]||null:null,'limit':_0x306560[_0x0126('0x19')]?_0x306560[_0x0126('0x19')][_0x0126('0x1c')]||null:null,'include':_0x306560['options']?_0x306560[_0x0126('0x19')][_0x0126('0x1d')]?_[_0x0126('0x1e')](_0x306560[_0x0126('0x19')]['include'],function(_0x480be1){return{'model':db[_0x480be1[_0x0126('0x1f')]],'as':_0x480be1['as'],'attributes':_0x480be1[_0x0126('0x1b')],'include':_0x480be1[_0x0126('0x1d')]?_['map'](_0x480be1['include'],function(_0x5792e4){return{'model':db[_0x5792e4[_0x0126('0x1f')]],'as':_0x5792e4['as'],'attributes':_0x5792e4[_0x0126('0x1b')],'include':_0x5792e4['include']?_[_0x0126('0x1e')](_0x5792e4[_0x0126('0x1d')],function(_0x2a3c61){return{'model':db[_0x2a3c61[_0x0126('0x1f')]],'as':_0x2a3c61['as'],'attributes':_0x2a3c61[_0x0126('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0126('0x20')](function(_0x25298d){logger['info'](_0x0126('0x16'),_0x306560);logger['debug'](_0x0126('0x16'),_0x306560,JSON[_0x0126('0xf')](_0x25298d));_0x5af5e1(_0x25298d);})[_0x0126('0x15')](function(_0x3b4584){logger[_0x0126('0x10')]('GetDeskAccount',_0x3b4584[_0x0126('0x13')],_0x306560);_0x7b285e(_0x31a97d[_0x0126('0x10')](0x1f4,_0x3b4584[_0x0126('0x13')]));});});};exports['ShowDeskAccount']=function(_0x6d19ee){var _0x49be5d=this;return new Promise(function(_0x5ab269,_0x3d8eeb){return db[_0x0126('0x17')]['find']({'raw':_0x6d19ee[_0x0126('0x19')]?_0x6d19ee['options']['raw']===undefined?!![]:![]:!![],'where':_0x6d19ee[_0x0126('0x19')]?_0x6d19ee['options'][_0x0126('0x21')]||null:null,'attributes':_0x6d19ee[_0x0126('0x19')]?_0x6d19ee[_0x0126('0x19')][_0x0126('0x1b')]||null:null,'include':_0x6d19ee['options']?_0x6d19ee[_0x0126('0x19')]['include']?_['map'](_0x6d19ee[_0x0126('0x19')][_0x0126('0x1d')],function(_0x8c27f5){return{'model':db[_0x8c27f5[_0x0126('0x1f')]],'as':_0x8c27f5['as'],'attributes':_0x8c27f5[_0x0126('0x1b')],'include':_0x8c27f5['include']?_['map'](_0x8c27f5[_0x0126('0x1d')],function(_0x382771){return{'model':db[_0x382771[_0x0126('0x1f')]],'as':_0x382771['as'],'attributes':_0x382771[_0x0126('0x1b')],'include':_0x382771[_0x0126('0x1d')]?_[_0x0126('0x1e')](_0x382771['include'],function(_0xa784c0){return{'model':db[_0xa784c0[_0x0126('0x1f')]],'as':_0xa784c0['as'],'attributes':_0xa784c0[_0x0126('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0126('0x20')](function(_0x15201d){logger['info'](_0x0126('0x22'),_0x6d19ee);logger[_0x0126('0xd')](_0x0126('0x22'),_0x6d19ee,JSON['stringify'](_0x15201d));_0x5ab269(_0x15201d);})['catch'](function(_0x5d4e3e){logger[_0x0126('0x10')](_0x0126('0x22'),_0x5d4e3e[_0x0126('0x13')],_0x6d19ee);_0x3d8eeb(_0x49be5d[_0x0126('0x10')](0x1f4,_0x5d4e3e[_0x0126('0x13')]));});});}; \ No newline at end of file +var _0xae16=['raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','info','request\x20sent','error','message','DeskAccount,\x20%s,\x20%s','result','catch','GetDeskAccount','DeskAccount','options','where','attributes','limit','include','map','model','debug','stringify','ShowDeskAccount','find'];(function(_0x2a2a25,_0xe403a4){var _0x57b888=function(_0x5d5b48){while(--_0x5d5b48){_0x2a2a25['push'](_0x2a2a25['shift']());}};_0x57b888(++_0xe403a4);}(_0xae16,0x181));var _0x6ae1=function(_0x3192fa,_0x3d58b5){_0x3192fa=_0x3192fa-0x0;var _0x283db5=_0xae16[_0x3192fa];return _0x283db5;};'use strict';var _=require('lodash');var util=require(_0x6ae1('0x0'));var moment=require(_0x6ae1('0x1'));var BPromise=require(_0x6ae1('0x2'));var rs=require(_0x6ae1('0x3'));var fs=require('fs');var Redis=require(_0x6ae1('0x4'));var db=require(_0x6ae1('0x5'))['db'];var utils=require(_0x6ae1('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6ae1('0x7'));var jayson=require(_0x6ae1('0x8'));var client=jayson[_0x6ae1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x241ec5,_0x8c32bf,_0x513ee1){return new BPromise(function(_0x3ebc31,_0x5755da){return client['request'](_0x241ec5,_0x513ee1)[_0x6ae1('0xa')](function(_0x33f1b0){logger[_0x6ae1('0xb')]('DeskAccount,\x20%s,\x20%s',_0x8c32bf,_0x6ae1('0xc'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x8c32bf,_0x6ae1('0xc'),JSON['stringify'](_0x33f1b0));if(_0x33f1b0[_0x6ae1('0xd')]){if(_0x33f1b0[_0x6ae1('0xd')]['code']===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x8c32bf,_0x33f1b0['error']['message']);return _0x5755da(_0x33f1b0[_0x6ae1('0xd')][_0x6ae1('0xe')]);}logger[_0x6ae1('0xd')](_0x6ae1('0xf'),_0x8c32bf,_0x33f1b0['error'][_0x6ae1('0xe')]);return _0x3ebc31(_0x33f1b0[_0x6ae1('0xd')][_0x6ae1('0xe')]);}else{logger[_0x6ae1('0xb')](_0x6ae1('0xf'),_0x8c32bf,'request\x20sent');_0x3ebc31(_0x33f1b0[_0x6ae1('0x10')][_0x6ae1('0xe')]);}})[_0x6ae1('0x11')](function(_0x48a334){logger[_0x6ae1('0xd')](_0x6ae1('0xf'),_0x8c32bf,_0x48a334);_0x5755da(_0x48a334);});});}exports[_0x6ae1('0x12')]=function(_0x3f7eb0){var _0x125018=this;return new Promise(function(_0x56b279,_0x10cc2d){return db[_0x6ae1('0x13')]['findAll']({'raw':_0x3f7eb0[_0x6ae1('0x14')]?_0x3f7eb0['options']['raw']===undefined?!![]:![]:!![],'where':_0x3f7eb0['options']?_0x3f7eb0['options'][_0x6ae1('0x15')]||null:null,'attributes':_0x3f7eb0['options']?_0x3f7eb0[_0x6ae1('0x14')][_0x6ae1('0x16')]||null:null,'limit':_0x3f7eb0[_0x6ae1('0x14')]?_0x3f7eb0['options'][_0x6ae1('0x17')]||null:null,'include':_0x3f7eb0[_0x6ae1('0x14')]?_0x3f7eb0[_0x6ae1('0x14')][_0x6ae1('0x18')]?_[_0x6ae1('0x19')](_0x3f7eb0['options'][_0x6ae1('0x18')],function(_0x212cd4){return{'model':db[_0x212cd4['model']],'as':_0x212cd4['as'],'attributes':_0x212cd4['attributes'],'include':_0x212cd4[_0x6ae1('0x18')]?_[_0x6ae1('0x19')](_0x212cd4[_0x6ae1('0x18')],function(_0x1ec97d){return{'model':db[_0x1ec97d[_0x6ae1('0x1a')]],'as':_0x1ec97d['as'],'attributes':_0x1ec97d['attributes'],'include':_0x1ec97d[_0x6ae1('0x18')]?_['map'](_0x1ec97d[_0x6ae1('0x18')],function(_0x5832bb){return{'model':db[_0x5832bb[_0x6ae1('0x1a')]],'as':_0x5832bb['as'],'attributes':_0x5832bb[_0x6ae1('0x16')]};}):[]};}):[]};}):[]:[]})[_0x6ae1('0xa')](function(_0x3022aa){logger[_0x6ae1('0xb')](_0x6ae1('0x12'),_0x3f7eb0);logger[_0x6ae1('0x1b')]('GetDeskAccount',_0x3f7eb0,JSON[_0x6ae1('0x1c')](_0x3022aa));_0x56b279(_0x3022aa);})[_0x6ae1('0x11')](function(_0xd67e36){logger[_0x6ae1('0xd')](_0x6ae1('0x12'),_0xd67e36['message'],_0x3f7eb0);_0x10cc2d(_0x125018[_0x6ae1('0xd')](0x1f4,_0xd67e36[_0x6ae1('0xe')]));});});};exports[_0x6ae1('0x1d')]=function(_0x431297){var _0x54f183=this;return new Promise(function(_0x556f2b,_0x478008){return db[_0x6ae1('0x13')][_0x6ae1('0x1e')]({'raw':_0x431297['options']?_0x431297['options'][_0x6ae1('0x1f')]===undefined?!![]:![]:!![],'where':_0x431297[_0x6ae1('0x14')]?_0x431297[_0x6ae1('0x14')]['where']||null:null,'attributes':_0x431297['options']?_0x431297[_0x6ae1('0x14')]['attributes']||null:null,'include':_0x431297[_0x6ae1('0x14')]?_0x431297['options'][_0x6ae1('0x18')]?_['map'](_0x431297[_0x6ae1('0x14')]['include'],function(_0x501c47){return{'model':db[_0x501c47[_0x6ae1('0x1a')]],'as':_0x501c47['as'],'attributes':_0x501c47['attributes'],'include':_0x501c47['include']?_[_0x6ae1('0x19')](_0x501c47[_0x6ae1('0x18')],function(_0x49f9e6){return{'model':db[_0x49f9e6['model']],'as':_0x49f9e6['as'],'attributes':_0x49f9e6['attributes'],'include':_0x49f9e6['include']?_[_0x6ae1('0x19')](_0x49f9e6[_0x6ae1('0x18')],function(_0x33c33e){return{'model':db[_0x33c33e['model']],'as':_0x33c33e['as'],'attributes':_0x33c33e[_0x6ae1('0x16')]};}):[]};}):[]};}):[]:[]})[_0x6ae1('0xa')](function(_0x46a984){logger['info']('ShowDeskAccount',_0x431297);logger[_0x6ae1('0x1b')]('ShowDeskAccount',_0x431297,JSON[_0x6ae1('0x1c')](_0x46a984));_0x556f2b(_0x46a984);})['catch'](function(_0x34b1c0){logger[_0x6ae1('0xd')](_0x6ae1('0x1d'),_0x34b1c0[_0x6ae1('0xe')],_0x431297);_0x478008(_0x54f183[_0x6ae1('0xd')](0x1f4,_0x34b1c0[_0x6ae1('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 6018b0c..91c13cf 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 _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x105249,_0x2ade86){var _0x598baf=function(_0x2eeb63){while(--_0x2eeb63){_0x105249['push'](_0x105249['shift']());}};_0x598baf(++_0x2ade86);}(_0x008c,0x188));var _0xc008=function(_0x11ba83,_0xd5611a){_0x11ba83=_0x11ba83-0x0;var _0x3f3925=_0x008c[_0x11ba83];return _0x3f3925;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x356127,_0x4873ac){var _0x5d4c75=function(_0x4fe60c){while(--_0x4fe60c){_0x356127['push'](_0x356127['shift']());}};_0x5d4c75(++_0x4873ac);}(_0x55ca,0x126));var _0xa55c=function(_0x2bbbc2,_0x2fd8b9){_0x2bbbc2=_0x2bbbc2-0x0;var _0x1f0319=_0x55ca[_0x2bbbc2];return _0x1f0319;};'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['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 12aeba1..24dd686 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 _0xeb99=['exports','STRING','sequelize'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0xeb99,0x74));var _0x9eb9=function(_0xb0db87,_0x5c8d71){_0xb0db87=_0xb0db87-0x0;var _0x4a68e1=_0xeb99[_0xb0db87];return _0x4a68e1;};'use strict';var Sequelize=require(_0x9eb9('0x0'));module[_0x9eb9('0x1')]={'name':{'type':Sequelize[_0x9eb9('0x2')]},'description':{'type':Sequelize[_0x9eb9('0x2')]}}; \ No newline at end of file +var _0x097e=['sequelize','exports','STRING'];(function(_0x43805e,_0x2170b2){var _0x4d091a=function(_0x52bd8e){while(--_0x52bd8e){_0x43805e['push'](_0x43805e['shift']());}};_0x4d091a(++_0x2170b2);}(_0x097e,0x108));var _0xe097=function(_0x4348a9,_0x196c75){_0x4348a9=_0x4348a9-0x0;var _0x516cc6=_0x097e[_0x4348a9];return _0x516cc6;};'use strict';var Sequelize=require(_0xe097('0x0'));module[_0xe097('0x1')]={'name':{'type':Sequelize[_0xe097('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 67271af..9ded7b5 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 _0x4290=['moment','mustache','sox','fs-extra','lodash','squel','crypto','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','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','DeskConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','getFields','DeskField','nolimit','findOne','getSubjects','getTags','Tag','setTags','ids','eml-format','zip-dir','request-promise'];(function(_0x21bfaf,_0x32fd3e){var _0x1f2eef=function(_0x3b58f8){while(--_0x3b58f8){_0x21bfaf['push'](_0x21bfaf['shift']());}};_0x1f2eef(++_0x32fd3e);}(_0x4290,0xf9));var _0x0429=function(_0x31d353,_0x438585){_0x31d353=_0x31d353-0x0;var _0x46ace9=_0x4290[_0x31d353];return _0x46ace9;};'use strict';var emlformat=require(_0x0429('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0429('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0429('0x2'));var moment=require(_0x0429('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0429('0x4'));var util=require('util');var path=require('path');var sox=require(_0x0429('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0429('0x6'));var _=require(_0x0429('0x7'));var squel=require(_0x0429('0x8'));var crypto=require(_0x0429('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x0429('0xa'));var toCsv=require('to-csv');var querystring=require(_0x0429('0xb'));var Papa=require(_0x0429('0xc'));var Redis=require(_0x0429('0xd'));var authService=require(_0x0429('0xe'));var qs=require(_0x0429('0xf'));var as=require(_0x0429('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0429('0x11'))(_0x0429('0x12'));var utils=require(_0x0429('0x13'));var config=require(_0x0429('0x14'));var licenseUtil=require(_0x0429('0x15'));var db=require(_0x0429('0x16'))['db'];function respondWithStatusCode(_0x5b6868,_0x46a131){_0x46a131=_0x46a131||0xcc;return function(_0x32aaf1){if(_0x32aaf1){return _0x5b6868['sendStatus'](_0x46a131);}return _0x5b6868[_0x0429('0x17')](_0x46a131)[_0x0429('0x18')]();};}function respondWithResult(_0x54e927,_0x1696c5){_0x1696c5=_0x1696c5||0xc8;return function(_0x2f4c18){if(_0x2f4c18){return _0x54e927[_0x0429('0x17')](_0x1696c5)[_0x0429('0x19')](_0x2f4c18);}};}function respondWithFilteredResult(_0x1843c7,_0x4ca3b8){return function(_0x2cba59){if(_0x2cba59){var _0x4a073d=typeof _0x4ca3b8[_0x0429('0x1a')]===_0x0429('0x1b')&&typeof _0x4ca3b8['limit']==='undefined';var _0x956bf8=_0x2cba59[_0x0429('0x1c')];var _0xc98e54=_0x4a073d?0x0:_0x4ca3b8[_0x0429('0x1a')];var _0x11044c=_0x4a073d?_0x2cba59[_0x0429('0x1c')]:_0x4ca3b8['offset']+_0x4ca3b8[_0x0429('0x1d')];var _0x2988ea;if(_0x11044c>=_0x956bf8){_0x11044c=_0x956bf8;_0x2988ea=0xc8;}else{_0x2988ea=0xce;}_0x1843c7[_0x0429('0x17')](_0x2988ea);return _0x1843c7[_0x0429('0x1e')](_0x0429('0x1f'),_0xc98e54+'-'+_0x11044c+'/'+_0x956bf8)[_0x0429('0x19')](_0x2cba59);}return null;};}function patchUpdates(_0x3b6c8e){return function(_0x5d2afd){try{jsonpatch[_0x0429('0x20')](_0x5d2afd,_0x3b6c8e,!![]);}catch(_0x11163d){return BPromise[_0x0429('0x21')](_0x11163d);}return _0x5d2afd[_0x0429('0x22')]();};}function saveUpdates(_0x579938,_0x3025ad){return function(_0x13e253){if(_0x13e253){return _0x13e253['update'](_0x579938)[_0x0429('0x23')](function(_0x475957){return _0x475957;});}return null;};}function removeEntity(_0x216c6d,_0xf886dd){return function(_0x22321d){if(_0x22321d){return _0x22321d['destroy']()[_0x0429('0x23')](function(){_0x216c6d[_0x0429('0x17')](0xcc)[_0x0429('0x18')]();});}};}function handleEntityNotFound(_0x2221ea,_0x5827a1){return function(_0x686ff0){if(!_0x686ff0){_0x2221ea[_0x0429('0x24')](0x194);}return _0x686ff0;};}function handleError(_0x4408f8,_0xaca449){_0xaca449=_0xaca449||0x1f4;return function(_0x1dbc5a){logger[_0x0429('0x25')](_0x1dbc5a[_0x0429('0x26')]);if(_0x1dbc5a[_0x0429('0x27')]){delete _0x1dbc5a['name'];}_0x4408f8[_0x0429('0x17')](_0xaca449)[_0x0429('0x28')](_0x1dbc5a);};}exports['index']=function(_0x5648a8,_0x4740f7){var _0x22dc4a={},_0x465c09={},_0x63e41f={'count':0x0,'rows':[]};var _0x2878d3=_['map'](db[_0x0429('0x29')][_0x0429('0x2a')],function(_0x326548){return{'name':_0x326548[_0x0429('0x2b')],'type':_0x326548[_0x0429('0x2c')][_0x0429('0x2d')]};});_0x465c09[_0x0429('0x2e')]=_[_0x0429('0x2f')](_0x2878d3,_0x0429('0x27'));_0x465c09['query']=_[_0x0429('0x30')](_0x5648a8[_0x0429('0x31')]);_0x465c09[_0x0429('0x32')]=_[_0x0429('0x33')](_0x465c09[_0x0429('0x2e')],_0x465c09[_0x0429('0x31')]);_0x22dc4a['attributes']=_[_0x0429('0x33')](_0x465c09[_0x0429('0x2e')],qs[_0x0429('0x34')](_0x5648a8[_0x0429('0x31')][_0x0429('0x34')]));_0x22dc4a[_0x0429('0x35')]=_0x22dc4a[_0x0429('0x35')]['length']?_0x22dc4a[_0x0429('0x35')]:_0x465c09[_0x0429('0x2e')];if(!_0x5648a8[_0x0429('0x31')][_0x0429('0x36')]('nolimit')){_0x22dc4a[_0x0429('0x1d')]=qs[_0x0429('0x1d')](_0x5648a8[_0x0429('0x31')][_0x0429('0x1d')]);_0x22dc4a[_0x0429('0x1a')]=qs[_0x0429('0x1a')](_0x5648a8[_0x0429('0x31')][_0x0429('0x1a')]);}_0x22dc4a[_0x0429('0x37')]=qs[_0x0429('0x38')](_0x5648a8[_0x0429('0x31')][_0x0429('0x38')]);_0x22dc4a['where']=qs[_0x0429('0x32')](_[_0x0429('0x39')](_0x5648a8[_0x0429('0x31')],_0x465c09[_0x0429('0x32')]),_0x2878d3);if(_0x5648a8[_0x0429('0x31')][_0x0429('0x3a')]){_0x22dc4a['where']=_[_0x0429('0x3b')](_0x22dc4a[_0x0429('0x3c')],{'$or':_[_0x0429('0x2f')](_0x2878d3,function(_0x4a27f2){if(_0x4a27f2[_0x0429('0x2c')]!==_0x0429('0x3d')){var _0xa63b18={};_0xa63b18[_0x4a27f2['name']]={'$like':'%'+_0x5648a8[_0x0429('0x31')][_0x0429('0x3a')]+'%'};return _0xa63b18;}})});}_0x22dc4a=_[_0x0429('0x3b')]({},_0x22dc4a,_0x5648a8[_0x0429('0x3e')]);var _0x3ec3fa={'where':_0x22dc4a['where']};return db[_0x0429('0x29')][_0x0429('0x1c')](_0x3ec3fa)[_0x0429('0x23')](function(_0x60a89d){_0x63e41f[_0x0429('0x1c')]=_0x60a89d;if(_0x5648a8[_0x0429('0x31')][_0x0429('0x3f')]){_0x22dc4a[_0x0429('0x40')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x0429('0x41')](_0x22dc4a);})[_0x0429('0x23')](function(_0x1d0152){_0x63e41f[_0x0429('0x42')]=_0x1d0152;return _0x63e41f;})[_0x0429('0x23')](respondWithFilteredResult(_0x4740f7,_0x22dc4a))[_0x0429('0x43')](handleError(_0x4740f7,null));};exports[_0x0429('0x44')]=function(_0x59c38,_0x3626f4){var _0x37bce5={'raw':![],'where':{'id':_0x59c38[_0x0429('0x45')]['id']}},_0x49daa9={};_0x49daa9[_0x0429('0x2e')]=_[_0x0429('0x30')](db[_0x0429('0x29')][_0x0429('0x2a')]);_0x49daa9[_0x0429('0x31')]=_[_0x0429('0x30')](_0x59c38['query']);_0x49daa9[_0x0429('0x32')]=_[_0x0429('0x33')](_0x49daa9['model'],_0x49daa9['query']);_0x37bce5[_0x0429('0x35')]=_['intersection'](_0x49daa9['model'],qs[_0x0429('0x34')](_0x59c38['query'][_0x0429('0x34')]));_0x37bce5[_0x0429('0x35')]=_0x37bce5[_0x0429('0x35')][_0x0429('0x46')]?_0x37bce5[_0x0429('0x35')]:_0x49daa9[_0x0429('0x2e')];if(_0x59c38[_0x0429('0x31')][_0x0429('0x3f')]){_0x37bce5[_0x0429('0x40')]=[{'all':!![]}];}_0x37bce5=_[_0x0429('0x3b')]({},_0x37bce5,_0x59c38[_0x0429('0x3e')]);return db[_0x0429('0x29')][_0x0429('0x47')](_0x37bce5)[_0x0429('0x23')](handleEntityNotFound(_0x3626f4,null))[_0x0429('0x23')](respondWithResult(_0x3626f4,null))[_0x0429('0x43')](handleError(_0x3626f4,null));};exports['create']=function(_0x4bd5e6,_0x7ef492){return db['DeskConfiguration'][_0x0429('0x48')](_0x4bd5e6[_0x0429('0x49')],{})[_0x0429('0x23')](respondWithResult(_0x7ef492,0xc9))[_0x0429('0x43')](handleError(_0x7ef492,null));};exports[_0x0429('0x4a')]=function(_0x259045,_0x7b9103){if(_0x259045[_0x0429('0x49')]['id']){delete _0x259045[_0x0429('0x49')]['id'];}return db['DeskConfiguration'][_0x0429('0x47')]({'where':{'id':_0x259045[_0x0429('0x45')]['id']}})[_0x0429('0x23')](handleEntityNotFound(_0x7b9103,null))[_0x0429('0x23')](saveUpdates(_0x259045[_0x0429('0x49')],null))[_0x0429('0x23')](respondWithResult(_0x7b9103,null))[_0x0429('0x43')](handleError(_0x7b9103,null));};exports['destroy']=function(_0x12881c,_0x542596){return db[_0x0429('0x29')]['find']({'where':{'id':_0x12881c[_0x0429('0x45')]['id']}})[_0x0429('0x23')](handleEntityNotFound(_0x542596,null))['then'](removeEntity(_0x542596,null))['catch'](handleError(_0x542596,null));};exports[_0x0429('0x4b')]=function(_0x275806,_0x5d1820,_0xd3d007){var _0x40b2b7={};var _0x575ea4={};var _0x2102a7;var _0x22180f;return db[_0x0429('0x29')]['findOne']({'where':{'id':_0x275806[_0x0429('0x45')]['id']}})[_0x0429('0x23')](handleEntityNotFound(_0x5d1820,null))[_0x0429('0x23')](function(_0xbce0e7){if(_0xbce0e7){_0x2102a7=_0xbce0e7;_0x575ea4[_0x0429('0x2e')]=_[_0x0429('0x30')](db[_0x0429('0x4c')][_0x0429('0x2a')]);_0x575ea4[_0x0429('0x31')]=_[_0x0429('0x30')](_0x275806[_0x0429('0x31')]);_0x575ea4[_0x0429('0x32')]=_[_0x0429('0x33')](_0x575ea4[_0x0429('0x2e')],_0x575ea4[_0x0429('0x31')]);_0x40b2b7['attributes']=_[_0x0429('0x33')](_0x575ea4[_0x0429('0x2e')],qs[_0x0429('0x34')](_0x275806[_0x0429('0x31')][_0x0429('0x34')]));_0x40b2b7[_0x0429('0x35')]=_0x40b2b7[_0x0429('0x35')][_0x0429('0x46')]?_0x40b2b7[_0x0429('0x35')]:_0x575ea4[_0x0429('0x2e')];_0x40b2b7[_0x0429('0x37')]=qs['sort'](_0x275806[_0x0429('0x31')]['sort']);_0x40b2b7[_0x0429('0x3c')]=qs[_0x0429('0x32')](_[_0x0429('0x39')](_0x275806['query'],_0x575ea4['filters']));if(_0x275806[_0x0429('0x31')][_0x0429('0x3a')]){_0x40b2b7[_0x0429('0x3c')]=_[_0x0429('0x3b')](_0x40b2b7['where'],{'$or':_[_0x0429('0x2f')](_0x40b2b7[_0x0429('0x35')],function(_0x3f6589){var _0x3b596f={};_0x3b596f[_0x3f6589]={'$like':'%'+_0x275806[_0x0429('0x31')]['filter']+'%'};return _0x3b596f;})});}_0x40b2b7=_[_0x0429('0x3b')]({},_0x40b2b7,_0x275806[_0x0429('0x3e')]);return _0x2102a7[_0x0429('0x4b')](_0x40b2b7);}})[_0x0429('0x23')](function(_0xb88c9){if(_0xb88c9){_0x22180f=_0xb88c9[_0x0429('0x46')];if(!_0x275806['query']['hasOwnProperty'](_0x0429('0x4d'))){_0x40b2b7[_0x0429('0x1d')]=qs[_0x0429('0x1d')](_0x275806[_0x0429('0x31')][_0x0429('0x1d')]);_0x40b2b7[_0x0429('0x1a')]=qs[_0x0429('0x1a')](_0x275806[_0x0429('0x31')]['offset']);}return _0x2102a7[_0x0429('0x4b')](_0x40b2b7);}})['then'](function(_0x487c70){if(_0x487c70){return _0x487c70?{'count':_0x22180f,'rows':_0x487c70}:null;}})[_0x0429('0x23')](respondWithResult(_0x5d1820,null))[_0x0429('0x43')](handleError(_0x5d1820,null));};exports['getSubjects']=function(_0x27be6c,_0x548371,_0x4e1ff6){var _0xf768e7={};var _0x17be82={};var _0x2db0cc;var _0x4bb8b2;return db['DeskConfiguration'][_0x0429('0x4e')]({'where':{'id':_0x27be6c[_0x0429('0x45')]['id']}})[_0x0429('0x23')](handleEntityNotFound(_0x548371,null))[_0x0429('0x23')](function(_0x1d25b3){if(_0x1d25b3){_0x2db0cc=_0x1d25b3;_0x17be82[_0x0429('0x2e')]=_[_0x0429('0x30')](db[_0x0429('0x4c')][_0x0429('0x2a')]);_0x17be82[_0x0429('0x31')]=_[_0x0429('0x30')](_0x27be6c[_0x0429('0x31')]);_0x17be82[_0x0429('0x32')]=_[_0x0429('0x33')](_0x17be82['model'],_0x17be82[_0x0429('0x31')]);_0xf768e7['attributes']=_[_0x0429('0x33')](_0x17be82['model'],qs['fields'](_0x27be6c[_0x0429('0x31')][_0x0429('0x34')]));_0xf768e7[_0x0429('0x35')]=_0xf768e7['attributes'][_0x0429('0x46')]?_0xf768e7['attributes']:_0x17be82[_0x0429('0x2e')];_0xf768e7['order']=qs[_0x0429('0x38')](_0x27be6c['query'][_0x0429('0x38')]);_0xf768e7[_0x0429('0x3c')]=qs[_0x0429('0x32')](_[_0x0429('0x39')](_0x27be6c[_0x0429('0x31')],_0x17be82[_0x0429('0x32')]));if(_0x27be6c[_0x0429('0x31')][_0x0429('0x3a')]){_0xf768e7[_0x0429('0x3c')]=_[_0x0429('0x3b')](_0xf768e7[_0x0429('0x3c')],{'$or':_[_0x0429('0x2f')](_0xf768e7[_0x0429('0x35')],function(_0x4f457f){var _0x2d9006={};_0x2d9006[_0x4f457f]={'$like':'%'+_0x27be6c[_0x0429('0x31')]['filter']+'%'};return _0x2d9006;})});}_0xf768e7=_['merge']({},_0xf768e7,_0x27be6c[_0x0429('0x3e')]);return _0x2db0cc[_0x0429('0x4f')](_0xf768e7);}})[_0x0429('0x23')](function(_0x228b35){if(_0x228b35){_0x4bb8b2=_0x228b35[_0x0429('0x46')];if(!_0x27be6c[_0x0429('0x31')]['hasOwnProperty'](_0x0429('0x4d'))){_0xf768e7[_0x0429('0x1d')]=qs[_0x0429('0x1d')](_0x27be6c[_0x0429('0x31')]['limit']);_0xf768e7[_0x0429('0x1a')]=qs['offset'](_0x27be6c[_0x0429('0x31')][_0x0429('0x1a')]);}return _0x2db0cc[_0x0429('0x4f')](_0xf768e7);}})['then'](function(_0x47fa37){if(_0x47fa37){return _0x47fa37?{'count':_0x4bb8b2,'rows':_0x47fa37}:null;}})['then'](respondWithResult(_0x548371,null))[_0x0429('0x43')](handleError(_0x548371,null));};exports['getDescriptions']=function(_0x131c0e,_0x30aad0,_0x34535d){var _0x5ac1d9={};var _0xfb7ef8={};var _0x1a55e3;var _0x317614;return db[_0x0429('0x29')]['findOne']({'where':{'id':_0x131c0e[_0x0429('0x45')]['id']}})[_0x0429('0x23')](handleEntityNotFound(_0x30aad0,null))[_0x0429('0x23')](function(_0x38396c){if(_0x38396c){_0x1a55e3=_0x38396c;_0xfb7ef8['model']=_[_0x0429('0x30')](db[_0x0429('0x4c')][_0x0429('0x2a')]);_0xfb7ef8[_0x0429('0x31')]=_[_0x0429('0x30')](_0x131c0e[_0x0429('0x31')]);_0xfb7ef8[_0x0429('0x32')]=_[_0x0429('0x33')](_0xfb7ef8[_0x0429('0x2e')],_0xfb7ef8[_0x0429('0x31')]);_0x5ac1d9[_0x0429('0x35')]=_['intersection'](_0xfb7ef8[_0x0429('0x2e')],qs[_0x0429('0x34')](_0x131c0e[_0x0429('0x31')]['fields']));_0x5ac1d9['attributes']=_0x5ac1d9[_0x0429('0x35')][_0x0429('0x46')]?_0x5ac1d9['attributes']:_0xfb7ef8[_0x0429('0x2e')];_0x5ac1d9[_0x0429('0x37')]=qs[_0x0429('0x38')](_0x131c0e['query'][_0x0429('0x38')]);_0x5ac1d9['where']=qs[_0x0429('0x32')](_['pick'](_0x131c0e[_0x0429('0x31')],_0xfb7ef8[_0x0429('0x32')]));if(_0x131c0e['query'][_0x0429('0x3a')]){_0x5ac1d9[_0x0429('0x3c')]=_[_0x0429('0x3b')](_0x5ac1d9[_0x0429('0x3c')],{'$or':_[_0x0429('0x2f')](_0x5ac1d9[_0x0429('0x35')],function(_0x10815b){var _0x518a77={};_0x518a77[_0x10815b]={'$like':'%'+_0x131c0e['query'][_0x0429('0x3a')]+'%'};return _0x518a77;})});}_0x5ac1d9=_['merge']({},_0x5ac1d9,_0x131c0e[_0x0429('0x3e')]);return _0x1a55e3['getDescriptions'](_0x5ac1d9);}})[_0x0429('0x23')](function(_0x34f69c){if(_0x34f69c){_0x317614=_0x34f69c['length'];if(!_0x131c0e['query'][_0x0429('0x36')](_0x0429('0x4d'))){_0x5ac1d9[_0x0429('0x1d')]=qs[_0x0429('0x1d')](_0x131c0e[_0x0429('0x31')][_0x0429('0x1d')]);_0x5ac1d9[_0x0429('0x1a')]=qs['offset'](_0x131c0e['query']['offset']);}return _0x1a55e3['getDescriptions'](_0x5ac1d9);}})[_0x0429('0x23')](function(_0x2a266b){if(_0x2a266b){return _0x2a266b?{'count':_0x317614,'rows':_0x2a266b}:null;}})[_0x0429('0x23')](respondWithResult(_0x30aad0,null))[_0x0429('0x43')](handleError(_0x30aad0,null));};exports[_0x0429('0x50')]=function(_0x44d006,_0x341f89,_0x54f655){var _0x2bc8fa={};var _0x2424a1={};var _0x1ce97;var _0x32913d;return db[_0x0429('0x29')][_0x0429('0x4e')]({'where':{'id':_0x44d006[_0x0429('0x45')]['id']}})['then'](handleEntityNotFound(_0x341f89,null))['then'](function(_0x426bc4){if(_0x426bc4){_0x1ce97=_0x426bc4;_0x2424a1[_0x0429('0x2e')]=_[_0x0429('0x30')](db[_0x0429('0x51')][_0x0429('0x2a')]);_0x2424a1['query']=_[_0x0429('0x30')](_0x44d006[_0x0429('0x31')]);_0x2424a1[_0x0429('0x32')]=_[_0x0429('0x33')](_0x2424a1[_0x0429('0x2e')],_0x2424a1[_0x0429('0x31')]);_0x2bc8fa[_0x0429('0x35')]=_['intersection'](_0x2424a1[_0x0429('0x2e')],qs[_0x0429('0x34')](_0x44d006['query'][_0x0429('0x34')]));_0x2bc8fa['attributes']=_0x2bc8fa['attributes'][_0x0429('0x46')]?_0x2bc8fa[_0x0429('0x35')]:_0x2424a1[_0x0429('0x2e')];_0x2bc8fa[_0x0429('0x37')]=qs[_0x0429('0x38')](_0x44d006[_0x0429('0x31')][_0x0429('0x38')]);_0x2bc8fa[_0x0429('0x3c')]=qs[_0x0429('0x32')](_[_0x0429('0x39')](_0x44d006['query'],_0x2424a1[_0x0429('0x32')]));if(_0x44d006[_0x0429('0x31')]['filter']){_0x2bc8fa[_0x0429('0x3c')]=_[_0x0429('0x3b')](_0x2bc8fa['where'],{'$or':_['map'](_0x2bc8fa[_0x0429('0x35')],function(_0x4c4b9a){var _0x4f5b97={};_0x4f5b97[_0x4c4b9a]={'$like':'%'+_0x44d006[_0x0429('0x31')]['filter']+'%'};return _0x4f5b97;})});}_0x2bc8fa=_[_0x0429('0x3b')]({},_0x2bc8fa,_0x44d006[_0x0429('0x3e')]);return _0x1ce97[_0x0429('0x50')](_0x2bc8fa);}})[_0x0429('0x23')](function(_0x6ba24c){if(_0x6ba24c){_0x32913d=_0x6ba24c[_0x0429('0x46')];if(!_0x44d006[_0x0429('0x31')]['hasOwnProperty']('nolimit')){_0x2bc8fa[_0x0429('0x1d')]=qs['limit'](_0x44d006['query']['limit']);_0x2bc8fa[_0x0429('0x1a')]=qs[_0x0429('0x1a')](_0x44d006['query'][_0x0429('0x1a')]);}return _0x1ce97['getTags'](_0x2bc8fa);}})[_0x0429('0x23')](function(_0x4fb2d7){if(_0x4fb2d7){return _0x4fb2d7?{'count':_0x32913d,'rows':_0x4fb2d7}:null;}})['then'](respondWithResult(_0x341f89,null))[_0x0429('0x43')](handleError(_0x341f89,null));};exports[_0x0429('0x52')]=function(_0x5f59a1,_0x50707e,_0x4cce93){if(_0x5f59a1['body']['id']){delete _0x5f59a1['body']['id'];}return db[_0x0429('0x29')][_0x0429('0x4e')]({'where':{'id':_0x5f59a1[_0x0429('0x45')]['id']}})[_0x0429('0x23')](handleEntityNotFound(_0x50707e,null))[_0x0429('0x23')](function(_0x3ed305){if(_0x3ed305){return _0x3ed305[_0x0429('0x52')](_0x5f59a1['body'][_0x0429('0x53')]||[]);}return null;})['then'](respondWithResult(_0x50707e,null))['catch'](handleError(_0x50707e,null));}; \ No newline at end of file +var _0x394e=['undefined','limit','count','Content-Range','apply','reject','save','update','destroy','sendStatus','error','name','send','index','map','DeskConfiguration','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','include','rows','catch','params','keys','includeAll','find','body','getFields','DeskField','getSubjects','findOne','getDescriptions','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x4c3244,_0xd2f7e4){var _0x395565=function(_0x5626ca){while(--_0x5626ca){_0x4c3244['push'](_0x4c3244['shift']());}};_0x395565(++_0xd2f7e4);}(_0x394e,0x88));var _0xe394=function(_0x3fd165,_0x5e2e2f){_0x3fd165=_0x3fd165-0x0;var _0x50f970=_0x394e[_0x3fd165];return _0x50f970;};'use strict';var emlformat=require(_0xe394('0x0'));var rimraf=require(_0xe394('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe394('0x2'));var rp=require(_0xe394('0x3'));var moment=require(_0xe394('0x4'));var BPromise=require(_0xe394('0x5'));var Mustache=require('mustache');var util=require(_0xe394('0x6'));var path=require(_0xe394('0x7'));var sox=require(_0xe394('0x8'));var csv=require(_0xe394('0x9'));var ejs=require(_0xe394('0xa'));var fs=require('fs');var fs_extra=require(_0xe394('0xb'));var _=require(_0xe394('0xc'));var squel=require(_0xe394('0xd'));var crypto=require(_0xe394('0xe'));var jsforce=require(_0xe394('0xf'));var deskjs=require(_0xe394('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe394('0x11'));var authService=require(_0xe394('0x12'));var qs=require(_0xe394('0x13'));var as=require(_0xe394('0x14'));var hardwareService=require(_0xe394('0x15'));var logger=require(_0xe394('0x16'))(_0xe394('0x17'));var utils=require(_0xe394('0x18'));var config=require(_0xe394('0x19'));var licenseUtil=require(_0xe394('0x1a'));var db=require(_0xe394('0x1b'))['db'];function respondWithStatusCode(_0x383e2c,_0x575a03){_0x575a03=_0x575a03||0xcc;return function(_0x5730b5){if(_0x5730b5){return _0x383e2c['sendStatus'](_0x575a03);}return _0x383e2c[_0xe394('0x1c')](_0x575a03)[_0xe394('0x1d')]();};}function respondWithResult(_0x4f1bf8,_0x996771){_0x996771=_0x996771||0xc8;return function(_0x61e157){if(_0x61e157){return _0x4f1bf8[_0xe394('0x1c')](_0x996771)[_0xe394('0x1e')](_0x61e157);}};}function respondWithFilteredResult(_0x1f4f71,_0x1c26db){return function(_0x56aafa){if(_0x56aafa){var _0x47afc4=typeof _0x1c26db[_0xe394('0x1f')]===_0xe394('0x20')&&typeof _0x1c26db[_0xe394('0x21')]===_0xe394('0x20');var _0x4a7a5b=_0x56aafa[_0xe394('0x22')];var _0x4b0d41=_0x47afc4?0x0:_0x1c26db[_0xe394('0x1f')];var _0x25c3b1=_0x47afc4?_0x56aafa[_0xe394('0x22')]:_0x1c26db['offset']+_0x1c26db[_0xe394('0x21')];var _0x28ab96;if(_0x25c3b1>=_0x4a7a5b){_0x25c3b1=_0x4a7a5b;_0x28ab96=0xc8;}else{_0x28ab96=0xce;}_0x1f4f71[_0xe394('0x1c')](_0x28ab96);return _0x1f4f71['set'](_0xe394('0x23'),_0x4b0d41+'-'+_0x25c3b1+'/'+_0x4a7a5b)[_0xe394('0x1e')](_0x56aafa);}return null;};}function patchUpdates(_0x1066a3){return function(_0x203a91){try{jsonpatch[_0xe394('0x24')](_0x203a91,_0x1066a3,!![]);}catch(_0x1a9004){return BPromise[_0xe394('0x25')](_0x1a9004);}return _0x203a91[_0xe394('0x26')]();};}function saveUpdates(_0x39ce6d,_0x36ef72){return function(_0x402fd5){if(_0x402fd5){return _0x402fd5[_0xe394('0x27')](_0x39ce6d)['then'](function(_0x133c8b){return _0x133c8b;});}return null;};}function removeEntity(_0x459bfe,_0x11c795){return function(_0x1b766c){if(_0x1b766c){return _0x1b766c[_0xe394('0x28')]()['then'](function(){_0x459bfe[_0xe394('0x1c')](0xcc)[_0xe394('0x1d')]();});}};}function handleEntityNotFound(_0x156f6b,_0x44c3e7){return function(_0x4ebf7d){if(!_0x4ebf7d){_0x156f6b[_0xe394('0x29')](0x194);}return _0x4ebf7d;};}function handleError(_0x446a53,_0x22597b){_0x22597b=_0x22597b||0x1f4;return function(_0xc6cb2d){logger[_0xe394('0x2a')](_0xc6cb2d['stack']);if(_0xc6cb2d[_0xe394('0x2b')]){delete _0xc6cb2d[_0xe394('0x2b')];}_0x446a53[_0xe394('0x1c')](_0x22597b)[_0xe394('0x2c')](_0xc6cb2d);};}exports[_0xe394('0x2d')]=function(_0x24146d,_0x3d7693){var _0xdd67a6={},_0x1abc74={},_0x50e2ff={'count':0x0,'rows':[]};var _0xab58d1=_[_0xe394('0x2e')](db[_0xe394('0x2f')][_0xe394('0x30')],function(_0xeca5ca){return{'name':_0xeca5ca['fieldName'],'type':_0xeca5ca['type'][_0xe394('0x31')]};});_0x1abc74[_0xe394('0x32')]=_[_0xe394('0x2e')](_0xab58d1,'name');_0x1abc74[_0xe394('0x33')]=_['keys'](_0x24146d['query']);_0x1abc74[_0xe394('0x34')]=_[_0xe394('0x35')](_0x1abc74[_0xe394('0x32')],_0x1abc74[_0xe394('0x33')]);_0xdd67a6[_0xe394('0x36')]=_[_0xe394('0x35')](_0x1abc74[_0xe394('0x32')],qs[_0xe394('0x37')](_0x24146d[_0xe394('0x33')][_0xe394('0x37')]));_0xdd67a6[_0xe394('0x36')]=_0xdd67a6['attributes'][_0xe394('0x38')]?_0xdd67a6[_0xe394('0x36')]:_0x1abc74[_0xe394('0x32')];if(!_0x24146d[_0xe394('0x33')][_0xe394('0x39')](_0xe394('0x3a'))){_0xdd67a6['limit']=qs['limit'](_0x24146d[_0xe394('0x33')][_0xe394('0x21')]);_0xdd67a6[_0xe394('0x1f')]=qs[_0xe394('0x1f')](_0x24146d[_0xe394('0x33')][_0xe394('0x1f')]);}_0xdd67a6[_0xe394('0x3b')]=qs[_0xe394('0x3c')](_0x24146d[_0xe394('0x33')][_0xe394('0x3c')]);_0xdd67a6[_0xe394('0x3d')]=qs[_0xe394('0x34')](_[_0xe394('0x3e')](_0x24146d[_0xe394('0x33')],_0x1abc74[_0xe394('0x34')]),_0xab58d1);if(_0x24146d['query'][_0xe394('0x3f')]){_0xdd67a6[_0xe394('0x3d')]=_[_0xe394('0x40')](_0xdd67a6[_0xe394('0x3d')],{'$or':_[_0xe394('0x2e')](_0xab58d1,function(_0x4b7152){if(_0x4b7152['type']!==_0xe394('0x41')){var _0x4ced1c={};_0x4ced1c[_0x4b7152[_0xe394('0x2b')]]={'$like':'%'+_0x24146d[_0xe394('0x33')][_0xe394('0x3f')]+'%'};return _0x4ced1c;}})});}_0xdd67a6=_['merge']({},_0xdd67a6,_0x24146d[_0xe394('0x42')]);var _0x5a13df={'where':_0xdd67a6['where']};return db[_0xe394('0x2f')][_0xe394('0x22')](_0x5a13df)[_0xe394('0x43')](function(_0x508649){_0x50e2ff[_0xe394('0x22')]=_0x508649;if(_0x24146d[_0xe394('0x33')]['includeAll']){_0xdd67a6[_0xe394('0x44')]=[{'all':!![]}];}return db[_0xe394('0x2f')]['findAll'](_0xdd67a6);})[_0xe394('0x43')](function(_0x3b5f69){_0x50e2ff[_0xe394('0x45')]=_0x3b5f69;return _0x50e2ff;})[_0xe394('0x43')](respondWithFilteredResult(_0x3d7693,_0xdd67a6))[_0xe394('0x46')](handleError(_0x3d7693,null));};exports['show']=function(_0x3b468f,_0xf1cd5f){var _0x5c5ceb={'raw':![],'where':{'id':_0x3b468f[_0xe394('0x47')]['id']}},_0x530dc6={};_0x530dc6[_0xe394('0x32')]=_[_0xe394('0x48')](db[_0xe394('0x2f')][_0xe394('0x30')]);_0x530dc6[_0xe394('0x33')]=_[_0xe394('0x48')](_0x3b468f[_0xe394('0x33')]);_0x530dc6[_0xe394('0x34')]=_[_0xe394('0x35')](_0x530dc6['model'],_0x530dc6[_0xe394('0x33')]);_0x5c5ceb[_0xe394('0x36')]=_[_0xe394('0x35')](_0x530dc6[_0xe394('0x32')],qs['fields'](_0x3b468f['query'][_0xe394('0x37')]));_0x5c5ceb[_0xe394('0x36')]=_0x5c5ceb['attributes'][_0xe394('0x38')]?_0x5c5ceb[_0xe394('0x36')]:_0x530dc6['model'];if(_0x3b468f[_0xe394('0x33')][_0xe394('0x49')]){_0x5c5ceb[_0xe394('0x44')]=[{'all':!![]}];}_0x5c5ceb=_[_0xe394('0x40')]({},_0x5c5ceb,_0x3b468f[_0xe394('0x42')]);return db[_0xe394('0x2f')][_0xe394('0x4a')](_0x5c5ceb)[_0xe394('0x43')](handleEntityNotFound(_0xf1cd5f,null))[_0xe394('0x43')](respondWithResult(_0xf1cd5f,null))['catch'](handleError(_0xf1cd5f,null));};exports['create']=function(_0x3064bf,_0x37adb1){return db[_0xe394('0x2f')]['create'](_0x3064bf[_0xe394('0x4b')],{})['then'](respondWithResult(_0x37adb1,0xc9))['catch'](handleError(_0x37adb1,null));};exports[_0xe394('0x27')]=function(_0x3a1974,_0x4a5550){if(_0x3a1974[_0xe394('0x4b')]['id']){delete _0x3a1974['body']['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x3a1974[_0xe394('0x47')]['id']}})[_0xe394('0x43')](handleEntityNotFound(_0x4a5550,null))['then'](saveUpdates(_0x3a1974[_0xe394('0x4b')],null))['then'](respondWithResult(_0x4a5550,null))[_0xe394('0x46')](handleError(_0x4a5550,null));};exports[_0xe394('0x28')]=function(_0x1023d2,_0x26e143){return db[_0xe394('0x2f')][_0xe394('0x4a')]({'where':{'id':_0x1023d2[_0xe394('0x47')]['id']}})[_0xe394('0x43')](handleEntityNotFound(_0x26e143,null))[_0xe394('0x43')](removeEntity(_0x26e143,null))[_0xe394('0x46')](handleError(_0x26e143,null));};exports[_0xe394('0x4c')]=function(_0x324bcd,_0x288702,_0x4016f4){var _0x5dd4df={};var _0x56cdd5={};var _0x8bacdf;var _0x41eaa4;return db[_0xe394('0x2f')]['findOne']({'where':{'id':_0x324bcd['params']['id']}})['then'](handleEntityNotFound(_0x288702,null))[_0xe394('0x43')](function(_0x4c5617){if(_0x4c5617){_0x8bacdf=_0x4c5617;_0x56cdd5[_0xe394('0x32')]=_['keys'](db[_0xe394('0x4d')][_0xe394('0x30')]);_0x56cdd5[_0xe394('0x33')]=_[_0xe394('0x48')](_0x324bcd[_0xe394('0x33')]);_0x56cdd5[_0xe394('0x34')]=_[_0xe394('0x35')](_0x56cdd5[_0xe394('0x32')],_0x56cdd5[_0xe394('0x33')]);_0x5dd4df[_0xe394('0x36')]=_[_0xe394('0x35')](_0x56cdd5[_0xe394('0x32')],qs['fields'](_0x324bcd[_0xe394('0x33')][_0xe394('0x37')]));_0x5dd4df[_0xe394('0x36')]=_0x5dd4df[_0xe394('0x36')]['length']?_0x5dd4df[_0xe394('0x36')]:_0x56cdd5[_0xe394('0x32')];_0x5dd4df[_0xe394('0x3b')]=qs['sort'](_0x324bcd[_0xe394('0x33')][_0xe394('0x3c')]);_0x5dd4df['where']=qs[_0xe394('0x34')](_[_0xe394('0x3e')](_0x324bcd[_0xe394('0x33')],_0x56cdd5[_0xe394('0x34')]));if(_0x324bcd[_0xe394('0x33')][_0xe394('0x3f')]){_0x5dd4df[_0xe394('0x3d')]=_[_0xe394('0x40')](_0x5dd4df[_0xe394('0x3d')],{'$or':_['map'](_0x5dd4df[_0xe394('0x36')],function(_0x8f289d){var _0x4ad65e={};_0x4ad65e[_0x8f289d]={'$like':'%'+_0x324bcd[_0xe394('0x33')]['filter']+'%'};return _0x4ad65e;})});}_0x5dd4df=_['merge']({},_0x5dd4df,_0x324bcd['options']);return _0x8bacdf[_0xe394('0x4c')](_0x5dd4df);}})['then'](function(_0x5a4c11){if(_0x5a4c11){_0x41eaa4=_0x5a4c11[_0xe394('0x38')];if(!_0x324bcd['query'][_0xe394('0x39')](_0xe394('0x3a'))){_0x5dd4df[_0xe394('0x21')]=qs['limit'](_0x324bcd[_0xe394('0x33')]['limit']);_0x5dd4df[_0xe394('0x1f')]=qs['offset'](_0x324bcd[_0xe394('0x33')][_0xe394('0x1f')]);}return _0x8bacdf[_0xe394('0x4c')](_0x5dd4df);}})[_0xe394('0x43')](function(_0x5f29aa){if(_0x5f29aa){return _0x5f29aa?{'count':_0x41eaa4,'rows':_0x5f29aa}:null;}})['then'](respondWithResult(_0x288702,null))['catch'](handleError(_0x288702,null));};exports[_0xe394('0x4e')]=function(_0xf18224,_0x2c2b97,_0x28c8e4){var _0x170668={};var _0x25cc8a={};var _0x2eccb8;var _0x2c64a9;return db['DeskConfiguration'][_0xe394('0x4f')]({'where':{'id':_0xf18224[_0xe394('0x47')]['id']}})[_0xe394('0x43')](handleEntityNotFound(_0x2c2b97,null))[_0xe394('0x43')](function(_0x5b6f84){if(_0x5b6f84){_0x2eccb8=_0x5b6f84;_0x25cc8a[_0xe394('0x32')]=_[_0xe394('0x48')](db[_0xe394('0x4d')]['rawAttributes']);_0x25cc8a['query']=_[_0xe394('0x48')](_0xf18224[_0xe394('0x33')]);_0x25cc8a[_0xe394('0x34')]=_[_0xe394('0x35')](_0x25cc8a[_0xe394('0x32')],_0x25cc8a['query']);_0x170668[_0xe394('0x36')]=_['intersection'](_0x25cc8a[_0xe394('0x32')],qs[_0xe394('0x37')](_0xf18224[_0xe394('0x33')]['fields']));_0x170668[_0xe394('0x36')]=_0x170668[_0xe394('0x36')][_0xe394('0x38')]?_0x170668[_0xe394('0x36')]:_0x25cc8a[_0xe394('0x32')];_0x170668['order']=qs['sort'](_0xf18224[_0xe394('0x33')][_0xe394('0x3c')]);_0x170668['where']=qs[_0xe394('0x34')](_[_0xe394('0x3e')](_0xf18224['query'],_0x25cc8a[_0xe394('0x34')]));if(_0xf18224[_0xe394('0x33')][_0xe394('0x3f')]){_0x170668[_0xe394('0x3d')]=_['merge'](_0x170668[_0xe394('0x3d')],{'$or':_[_0xe394('0x2e')](_0x170668[_0xe394('0x36')],function(_0x543c1e){var _0x10c33b={};_0x10c33b[_0x543c1e]={'$like':'%'+_0xf18224[_0xe394('0x33')]['filter']+'%'};return _0x10c33b;})});}_0x170668=_[_0xe394('0x40')]({},_0x170668,_0xf18224[_0xe394('0x42')]);return _0x2eccb8[_0xe394('0x4e')](_0x170668);}})[_0xe394('0x43')](function(_0x324ce2){if(_0x324ce2){_0x2c64a9=_0x324ce2[_0xe394('0x38')];if(!_0xf18224[_0xe394('0x33')][_0xe394('0x39')](_0xe394('0x3a'))){_0x170668[_0xe394('0x21')]=qs[_0xe394('0x21')](_0xf18224[_0xe394('0x33')][_0xe394('0x21')]);_0x170668[_0xe394('0x1f')]=qs[_0xe394('0x1f')](_0xf18224[_0xe394('0x33')][_0xe394('0x1f')]);}return _0x2eccb8['getSubjects'](_0x170668);}})[_0xe394('0x43')](function(_0x4dc01f){if(_0x4dc01f){return _0x4dc01f?{'count':_0x2c64a9,'rows':_0x4dc01f}:null;}})['then'](respondWithResult(_0x2c2b97,null))[_0xe394('0x46')](handleError(_0x2c2b97,null));};exports[_0xe394('0x50')]=function(_0x13e1c6,_0x4b275f,_0x2ef874){var _0x2393c3={};var _0x3c4cef={};var _0x11ab86;var _0x3203ec;return db[_0xe394('0x2f')]['findOne']({'where':{'id':_0x13e1c6[_0xe394('0x47')]['id']}})[_0xe394('0x43')](handleEntityNotFound(_0x4b275f,null))[_0xe394('0x43')](function(_0x4c75c5){if(_0x4c75c5){_0x11ab86=_0x4c75c5;_0x3c4cef[_0xe394('0x32')]=_[_0xe394('0x48')](db[_0xe394('0x4d')][_0xe394('0x30')]);_0x3c4cef[_0xe394('0x33')]=_[_0xe394('0x48')](_0x13e1c6['query']);_0x3c4cef['filters']=_[_0xe394('0x35')](_0x3c4cef['model'],_0x3c4cef[_0xe394('0x33')]);_0x2393c3[_0xe394('0x36')]=_['intersection'](_0x3c4cef[_0xe394('0x32')],qs[_0xe394('0x37')](_0x13e1c6[_0xe394('0x33')][_0xe394('0x37')]));_0x2393c3['attributes']=_0x2393c3[_0xe394('0x36')][_0xe394('0x38')]?_0x2393c3[_0xe394('0x36')]:_0x3c4cef['model'];_0x2393c3[_0xe394('0x3b')]=qs['sort'](_0x13e1c6['query'][_0xe394('0x3c')]);_0x2393c3[_0xe394('0x3d')]=qs[_0xe394('0x34')](_[_0xe394('0x3e')](_0x13e1c6[_0xe394('0x33')],_0x3c4cef['filters']));if(_0x13e1c6[_0xe394('0x33')][_0xe394('0x3f')]){_0x2393c3['where']=_[_0xe394('0x40')](_0x2393c3[_0xe394('0x3d')],{'$or':_[_0xe394('0x2e')](_0x2393c3['attributes'],function(_0x1fc8c3){var _0x420ef4={};_0x420ef4[_0x1fc8c3]={'$like':'%'+_0x13e1c6[_0xe394('0x33')]['filter']+'%'};return _0x420ef4;})});}_0x2393c3=_[_0xe394('0x40')]({},_0x2393c3,_0x13e1c6[_0xe394('0x42')]);return _0x11ab86[_0xe394('0x50')](_0x2393c3);}})[_0xe394('0x43')](function(_0x1f1b5f){if(_0x1f1b5f){_0x3203ec=_0x1f1b5f[_0xe394('0x38')];if(!_0x13e1c6[_0xe394('0x33')][_0xe394('0x39')]('nolimit')){_0x2393c3['limit']=qs[_0xe394('0x21')](_0x13e1c6['query'][_0xe394('0x21')]);_0x2393c3[_0xe394('0x1f')]=qs[_0xe394('0x1f')](_0x13e1c6[_0xe394('0x33')][_0xe394('0x1f')]);}return _0x11ab86[_0xe394('0x50')](_0x2393c3);}})[_0xe394('0x43')](function(_0x20d4bd){if(_0x20d4bd){return _0x20d4bd?{'count':_0x3203ec,'rows':_0x20d4bd}:null;}})[_0xe394('0x43')](respondWithResult(_0x4b275f,null))[_0xe394('0x46')](handleError(_0x4b275f,null));};exports[_0xe394('0x51')]=function(_0x25d5ad,_0x4b9f84,_0x52c9b1){var _0x50225c={};var _0x5c161e={};var _0x2c408b;var _0x5b0f13;return db[_0xe394('0x2f')]['findOne']({'where':{'id':_0x25d5ad['params']['id']}})[_0xe394('0x43')](handleEntityNotFound(_0x4b9f84,null))[_0xe394('0x43')](function(_0x3a629a){if(_0x3a629a){_0x2c408b=_0x3a629a;_0x5c161e['model']=_['keys'](db['Tag'][_0xe394('0x30')]);_0x5c161e[_0xe394('0x33')]=_[_0xe394('0x48')](_0x25d5ad[_0xe394('0x33')]);_0x5c161e[_0xe394('0x34')]=_[_0xe394('0x35')](_0x5c161e['model'],_0x5c161e[_0xe394('0x33')]);_0x50225c[_0xe394('0x36')]=_['intersection'](_0x5c161e['model'],qs[_0xe394('0x37')](_0x25d5ad['query'][_0xe394('0x37')]));_0x50225c['attributes']=_0x50225c[_0xe394('0x36')][_0xe394('0x38')]?_0x50225c['attributes']:_0x5c161e[_0xe394('0x32')];_0x50225c[_0xe394('0x3b')]=qs[_0xe394('0x3c')](_0x25d5ad[_0xe394('0x33')]['sort']);_0x50225c[_0xe394('0x3d')]=qs['filters'](_[_0xe394('0x3e')](_0x25d5ad[_0xe394('0x33')],_0x5c161e[_0xe394('0x34')]));if(_0x25d5ad['query'][_0xe394('0x3f')]){_0x50225c['where']=_[_0xe394('0x40')](_0x50225c[_0xe394('0x3d')],{'$or':_[_0xe394('0x2e')](_0x50225c['attributes'],function(_0x427063){var _0xa67001={};_0xa67001[_0x427063]={'$like':'%'+_0x25d5ad[_0xe394('0x33')][_0xe394('0x3f')]+'%'};return _0xa67001;})});}_0x50225c=_[_0xe394('0x40')]({},_0x50225c,_0x25d5ad[_0xe394('0x42')]);return _0x2c408b[_0xe394('0x51')](_0x50225c);}})[_0xe394('0x43')](function(_0xeb6650){if(_0xeb6650){_0x5b0f13=_0xeb6650[_0xe394('0x38')];if(!_0x25d5ad[_0xe394('0x33')][_0xe394('0x39')]('nolimit')){_0x50225c['limit']=qs[_0xe394('0x21')](_0x25d5ad[_0xe394('0x33')]['limit']);_0x50225c[_0xe394('0x1f')]=qs['offset'](_0x25d5ad[_0xe394('0x33')][_0xe394('0x1f')]);}return _0x2c408b[_0xe394('0x51')](_0x50225c);}})[_0xe394('0x43')](function(_0x12f241){if(_0x12f241){return _0x12f241?{'count':_0x5b0f13,'rows':_0x12f241}:null;}})['then'](respondWithResult(_0x4b9f84,null))[_0xe394('0x46')](handleError(_0x4b9f84,null));};exports['setTags']=function(_0xe8a880,_0x3e52ca,_0x50dea7){if(_0xe8a880[_0xe394('0x4b')]['id']){delete _0xe8a880[_0xe394('0x4b')]['id'];}return db['DeskConfiguration'][_0xe394('0x4f')]({'where':{'id':_0xe8a880[_0xe394('0x47')]['id']}})[_0xe394('0x43')](handleEntityNotFound(_0x3e52ca,null))[_0xe394('0x43')](function(_0x5d8a98){if(_0x5d8a98){return _0x5d8a98[_0xe394('0x52')](_0xe8a880[_0xe394('0x4b')][_0xe394('0x53')]||[]);}return null;})['then'](respondWithResult(_0x3e52ca,null))[_0xe394('0x46')](handleError(_0x3e52ca,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index c7d026d..5e53504 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 _0xde1f=['path','rimraf','./intDeskConfiguration.attributes','define','DeskConfiguration','util','../../config/logger','api','moment','bluebird'];(function(_0x23f0ac,_0x1141e9){var _0x7003bc=function(_0x5b0a6e){while(--_0x5b0a6e){_0x23f0ac['push'](_0x23f0ac['shift']());}};_0x7003bc(++_0x1141e9);}(_0xde1f,0x127));var _0xfde1=function(_0x2a76fa,_0x1cee7d){_0x2a76fa=_0x2a76fa-0x0;var _0x2d2442=_0xde1f[_0x2a76fa];return _0x2d2442;};'use strict';var _=require('lodash');var util=require(_0xfde1('0x0'));var logger=require(_0xfde1('0x1'))(_0xfde1('0x2'));var moment=require(_0xfde1('0x3'));var BPromise=require(_0xfde1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfde1('0x5'));var rimraf=require(_0xfde1('0x6'));var config=require('../../config/environment');var attributes=require(_0xfde1('0x7'));module['exports']=function(_0x37be88,_0x591d9f){return _0x37be88[_0xfde1('0x8')](_0xfde1('0x9'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12c9=['define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x434f2e,_0x68493e){var _0x76c0b9=function(_0x7db698){while(--_0x7db698){_0x434f2e['push'](_0x434f2e['shift']());}};_0x76c0b9(++_0x68493e);}(_0x12c9,0x9f));var _0x912c=function(_0x573077,_0x3d9fec){_0x573077=_0x573077-0x0;var _0x13f517=_0x12c9[_0x573077];return _0x13f517;};'use strict';var _=require(_0x912c('0x0'));var util=require('util');var logger=require(_0x912c('0x1'))('api');var moment=require(_0x912c('0x2'));var BPromise=require('bluebird');var rp=require(_0x912c('0x3'));var fs=require('fs');var path=require(_0x912c('0x4'));var rimraf=require(_0x912c('0x5'));var config=require(_0x912c('0x6'));var attributes=require(_0x912c('0x7'));module[_0x912c('0x8')]=function(_0x572179,_0x5daa7d){return _0x572179[_0x912c('0x9')](_0x912c('0xa'),attributes,{'tableName':_0x912c('0xb'),'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 998e110..79003f0 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 _0x1c45=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2adaae,_0x31464f){var _0x5244a6=function(_0x2831a1){while(--_0x2831a1){_0x2adaae['push'](_0x2adaae['shift']());}};_0x5244a6(++_0x31464f);}(_0x1c45,0x1b0));var _0x51c4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1c45[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x51c4('0x0'));var util=require(_0x51c4('0x1'));var moment=require(_0x51c4('0x2'));var BPromise=require(_0x51c4('0x3'));var rs=require(_0x51c4('0x4'));var fs=require('fs');var Redis=require(_0x51c4('0x5'));var db=require(_0x51c4('0x6'))['db'];var utils=require(_0x51c4('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x51c4('0x8'));var jayson=require(_0x51c4('0x9'));var client=jayson[_0x51c4('0xa')][_0x51c4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f22a2,_0x14650b,_0x27876b){return new BPromise(function(_0x264b42,_0x1a53a9){return client['request'](_0x1f22a2,_0x27876b)['then'](function(_0x39ceec){logger[_0x51c4('0xc')](_0x51c4('0xd'),_0x14650b,_0x51c4('0xe'));logger[_0x51c4('0xf')](_0x51c4('0x10'),_0x14650b,'request\x20sent',JSON[_0x51c4('0x11')](_0x39ceec));if(_0x39ceec[_0x51c4('0x12')]){if(_0x39ceec[_0x51c4('0x12')][_0x51c4('0x13')]===0x1f4){logger[_0x51c4('0x12')](_0x51c4('0xd'),_0x14650b,_0x39ceec[_0x51c4('0x12')][_0x51c4('0x14')]);return _0x1a53a9(_0x39ceec[_0x51c4('0x12')][_0x51c4('0x14')]);}logger[_0x51c4('0x12')](_0x51c4('0xd'),_0x14650b,_0x39ceec[_0x51c4('0x12')]['message']);return _0x264b42(_0x39ceec[_0x51c4('0x12')][_0x51c4('0x14')]);}else{logger['info'](_0x51c4('0xd'),_0x14650b,_0x51c4('0xe'));_0x264b42(_0x39ceec[_0x51c4('0x15')][_0x51c4('0x14')]);}})[_0x51c4('0x16')](function(_0x260047){logger[_0x51c4('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x14650b,_0x260047);_0x1a53a9(_0x260047);});});} \ No newline at end of file +var _0xd290=['error','code','message','request\x20sent','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x32ab82,_0xa96386){var _0x383a35=function(_0x2d2fec){while(--_0x2d2fec){_0x32ab82['push'](_0x32ab82['shift']());}};_0x383a35(++_0xa96386);}(_0xd290,0x165));var _0x0d29=function(_0x5e112d,_0x41eaf1){_0x5e112d=_0x5e112d-0x0;var _0x595f80=_0xd290[_0x5e112d];return _0x595f80;};'use strict';var _=require(_0x0d29('0x0'));var util=require(_0x0d29('0x1'));var moment=require('moment');var BPromise=require(_0x0d29('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d29('0x3'))['db'];var utils=require(_0x0d29('0x4'));var logger=require(_0x0d29('0x5'))(_0x0d29('0x6'));var config=require(_0x0d29('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0d29('0x8')][_0x0d29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x151d32,_0x376d19,_0x276aeb){return new BPromise(function(_0x4edfcd,_0x3ee63c){return client[_0x0d29('0xa')](_0x151d32,_0x276aeb)[_0x0d29('0xb')](function(_0x4b876e){logger[_0x0d29('0xc')](_0x0d29('0xd'),_0x376d19,'request\x20sent');logger[_0x0d29('0xe')](_0x0d29('0xf'),_0x376d19,'request\x20sent',JSON[_0x0d29('0x10')](_0x4b876e));if(_0x4b876e['error']){if(_0x4b876e[_0x0d29('0x11')][_0x0d29('0x12')]===0x1f4){logger[_0x0d29('0x11')](_0x0d29('0xd'),_0x376d19,_0x4b876e[_0x0d29('0x11')]['message']);return _0x3ee63c(_0x4b876e[_0x0d29('0x11')][_0x0d29('0x13')]);}logger[_0x0d29('0x11')](_0x0d29('0xd'),_0x376d19,_0x4b876e[_0x0d29('0x11')]['message']);return _0x4edfcd(_0x4b876e['error']['message']);}else{logger[_0x0d29('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x376d19,_0x0d29('0x14'));_0x4edfcd(_0x4b876e['result'][_0x0d29('0x13')]);}})[_0x0d29('0x15')](function(_0x2a04d6){logger[_0x0d29('0x11')](_0x0d29('0xd'),_0x376d19,_0x2a04d6);_0x3ee63c(_0x2a04d6);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 81c55bb..d7482c4 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 _0x8555=['get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller'];(function(_0x22c684,_0x753309){var _0x39fcbb=function(_0x38b631){while(--_0x38b631){_0x22c684['push'](_0x22c684['shift']());}};_0x39fcbb(++_0x753309);}(_0x8555,0x13c));var _0x5855=function(_0x1772c9,_0x3aeb99){_0x1772c9=_0x1772c9-0x0;var _0x542a17=_0x8555[_0x1772c9];return _0x542a17;};'use strict';var multer=require(_0x5855('0x0'));var util=require('util');var path=require(_0x5855('0x1'));var timeout=require(_0x5855('0x2'));var express=require('express');var router=express[_0x5855('0x3')]();var fs_extra=require(_0x5855('0x4'));var auth=require(_0x5855('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5855('0x6'));var controller=require(_0x5855('0x7'));router[_0x5855('0x8')]('/',auth[_0x5855('0x9')](),controller[_0x5855('0xa')]);router[_0x5855('0x8')](_0x5855('0xb'),auth[_0x5855('0x9')](),controller[_0x5855('0xc')]);router[_0x5855('0xd')]('/',auth[_0x5855('0x9')](),controller[_0x5855('0xe')]);router[_0x5855('0xf')](_0x5855('0xb'),auth[_0x5855('0x9')](),controller['update']);router['delete'](_0x5855('0xb'),auth['isAuthenticated'](),controller[_0x5855('0x10')]);module[_0x5855('0x11')]=router; \ No newline at end of file +var _0xde1a=['show','post','create','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x2cb609,_0x6328be){var _0x388103=function(_0x2e7a21){while(--_0x2e7a21){_0x2cb609['push'](_0x2cb609['shift']());}};_0x388103(++_0x6328be);}(_0xde1a,0xfd));var _0xade1=function(_0x2f974e,_0x18ac8a){_0x2f974e=_0x2f974e-0x0;var _0xa41492=_0xde1a[_0x2f974e];return _0xa41492;};'use strict';var multer=require('multer');var util=require(_0xade1('0x0'));var path=require(_0xade1('0x1'));var timeout=require(_0xade1('0x2'));var express=require(_0xade1('0x3'));var router=express[_0xade1('0x4')]();var fs_extra=require(_0xade1('0x5'));var auth=require(_0xade1('0x6'));var interaction=require(_0xade1('0x7'));var config=require('../../config/environment');var controller=require(_0xade1('0x8'));router[_0xade1('0x9')]('/',auth[_0xade1('0xa')](),controller[_0xade1('0xb')]);router[_0xade1('0x9')](_0xade1('0xc'),auth['isAuthenticated'](),controller[_0xade1('0xd')]);router[_0xade1('0xe')]('/',auth[_0xade1('0xa')](),controller[_0xade1('0xf')]);router[_0xade1('0x10')](_0xade1('0xc'),auth[_0xade1('0xa')](),controller[_0xade1('0x11')]);router['delete'](_0xade1('0xc'),auth[_0xade1('0xa')](),controller['destroy']);module[_0xade1('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 8b19d67..8455629 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 _0x298c=['variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x5b5eb4,_0x117c87){var _0x42af53=function(_0xdf6fcb){while(--_0xdf6fcb){_0x5b5eb4['push'](_0x5b5eb4['shift']());}};_0x42af53(++_0x117c87);}(_0x298c,0x16d));var _0xc298=function(_0x36f30b,_0x5d5217){_0x36f30b=_0x36f30b-0x0;var _0x3ea7d2=_0x298c[_0x36f30b];return _0x3ea7d2;};'use strict';var Sequelize=require(_0xc298('0x0'));module[_0xc298('0x1')]={'type':{'type':Sequelize[_0xc298('0x2')](_0xc298('0x3'),_0xc298('0x4'),_0xc298('0x5'),'keyValue',_0xc298('0x6')),'defaultValue':_0xc298('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc298('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xc298('0x3'),_0xc298('0x4'),_0xc298('0x5'))},'keyContent':{'type':Sequelize[_0xc298('0x7')]},'idField':{'type':Sequelize[_0xc298('0x7')]},'nameField':{'type':Sequelize[_0xc298('0x7')]},'customField':{'type':Sequelize[_0xc298('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc298('0x7')]}}; \ No newline at end of file +var _0xd5c9=['exports','string','keyValue','picklist','STRING','ENUM','variable','customVariable','BOOLEAN'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd5c9,0x105));var _0x9d5c=function(_0x553c78,_0x4656c2){_0x553c78=_0x553c78-0x0;var _0x2f68c5=_0xd5c9[_0x553c78];return _0x2f68c5;};'use strict';var Sequelize=require('sequelize');module[_0x9d5c('0x0')]={'type':{'type':Sequelize['ENUM'](_0x9d5c('0x1'),'variable','customVariable',_0x9d5c('0x2'),_0x9d5c('0x3')),'defaultValue':_0x9d5c('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9d5c('0x4')]},'keyType':{'type':Sequelize[_0x9d5c('0x5')](_0x9d5c('0x1'),_0x9d5c('0x6'),_0x9d5c('0x7'))},'keyContent':{'type':Sequelize[_0x9d5c('0x4')]},'idField':{'type':Sequelize[_0x9d5c('0x4')]},'nameField':{'type':Sequelize[_0x9d5c('0x4')]},'customField':{'type':Sequelize[_0x9d5c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9d5c('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 3d6115e..47354dc 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 _0xcf30=['catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','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','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','findAll','rows','show','params','include','options'];(function(_0x55bc9f,_0x1835ea){var _0x50e04f=function(_0x16bc74){while(--_0x16bc74){_0x55bc9f['push'](_0x55bc9f['shift']());}};_0x50e04f(++_0x1835ea);}(_0xcf30,0x128));var _0x0cf3=function(_0xd45615,_0x567925){_0xd45615=_0xd45615-0x0;var _0x4917af=_0xcf30[_0xd45615];return _0x4917af;};'use strict';var emlformat=require(_0x0cf3('0x0'));var rimraf=require(_0x0cf3('0x1'));var zipdir=require(_0x0cf3('0x2'));var jsonpatch=require(_0x0cf3('0x3'));var rp=require('request-promise');var moment=require(_0x0cf3('0x4'));var BPromise=require(_0x0cf3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0cf3('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0cf3('0x7'));var squel=require(_0x0cf3('0x8'));var crypto=require(_0x0cf3('0x9'));var jsforce=require(_0x0cf3('0xa'));var deskjs=require(_0x0cf3('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0cf3('0xc'));var Papa=require('papaparse');var Redis=require(_0x0cf3('0xd'));var authService=require(_0x0cf3('0xe'));var qs=require(_0x0cf3('0xf'));var as=require(_0x0cf3('0x10'));var hardwareService=require(_0x0cf3('0x11'));var logger=require(_0x0cf3('0x12'))(_0x0cf3('0x13'));var utils=require(_0x0cf3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0cf3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50df01,_0x5ecbe5){_0x5ecbe5=_0x5ecbe5||0xcc;return function(_0x24d1d4){if(_0x24d1d4){return _0x50df01[_0x0cf3('0x16')](_0x5ecbe5);}return _0x50df01['status'](_0x5ecbe5)['end']();};}function respondWithResult(_0x4d145c,_0x33a7a3){_0x33a7a3=_0x33a7a3||0xc8;return function(_0x20b7b0){if(_0x20b7b0){return _0x4d145c[_0x0cf3('0x17')](_0x33a7a3)[_0x0cf3('0x18')](_0x20b7b0);}};}function respondWithFilteredResult(_0x41d672,_0x4a5b42){return function(_0xdcaf22){if(_0xdcaf22){var _0x86f0d5=typeof _0x4a5b42['offset']===_0x0cf3('0x19')&&typeof _0x4a5b42[_0x0cf3('0x1a')]===_0x0cf3('0x19');var _0x431fde=_0xdcaf22[_0x0cf3('0x1b')];var _0x2ab930=_0x86f0d5?0x0:_0x4a5b42[_0x0cf3('0x1c')];var _0x139325=_0x86f0d5?_0xdcaf22['count']:_0x4a5b42[_0x0cf3('0x1c')]+_0x4a5b42[_0x0cf3('0x1a')];var _0x4e06f6;if(_0x139325>=_0x431fde){_0x139325=_0x431fde;_0x4e06f6=0xc8;}else{_0x4e06f6=0xce;}_0x41d672[_0x0cf3('0x17')](_0x4e06f6);return _0x41d672[_0x0cf3('0x1d')](_0x0cf3('0x1e'),_0x2ab930+'-'+_0x139325+'/'+_0x431fde)[_0x0cf3('0x18')](_0xdcaf22);}return null;};}function patchUpdates(_0x327694){return function(_0x5bb14e){try{jsonpatch[_0x0cf3('0x1f')](_0x5bb14e,_0x327694,!![]);}catch(_0x5cf070){return BPromise[_0x0cf3('0x20')](_0x5cf070);}return _0x5bb14e[_0x0cf3('0x21')]();};}function saveUpdates(_0x306307,_0x5ed4ba){return function(_0x267c28){if(_0x267c28){return _0x267c28[_0x0cf3('0x22')](_0x306307)['then'](function(_0x46d85a){return _0x46d85a;});}return null;};}function removeEntity(_0x5b9024,_0x45ae4f){return function(_0x4a6ed1){if(_0x4a6ed1){return _0x4a6ed1[_0x0cf3('0x23')]()[_0x0cf3('0x24')](function(){_0x5b9024['status'](0xcc)[_0x0cf3('0x25')]();});}};}function handleEntityNotFound(_0x3205c0,_0x57dc10){return function(_0x28c81){if(!_0x28c81){_0x3205c0[_0x0cf3('0x16')](0x194);}return _0x28c81;};}function handleError(_0x5be8c9,_0x5aed05){_0x5aed05=_0x5aed05||0x1f4;return function(_0x2ce8d9){logger[_0x0cf3('0x26')](_0x2ce8d9[_0x0cf3('0x27')]);if(_0x2ce8d9[_0x0cf3('0x28')]){delete _0x2ce8d9['name'];}_0x5be8c9[_0x0cf3('0x17')](_0x5aed05)[_0x0cf3('0x29')](_0x2ce8d9);};}exports['index']=function(_0x1a1e94,_0x19f1cf){var _0x4b78a0={},_0x1c2c1c={},_0x38a3c9={'count':0x0,'rows':[]};var _0x23707d=_[_0x0cf3('0x2a')](db[_0x0cf3('0x2b')][_0x0cf3('0x2c')],function(_0x4bd471){return{'name':_0x4bd471[_0x0cf3('0x2d')],'type':_0x4bd471[_0x0cf3('0x2e')][_0x0cf3('0x2f')]};});_0x1c2c1c[_0x0cf3('0x30')]=_['map'](_0x23707d,_0x0cf3('0x28'));_0x1c2c1c[_0x0cf3('0x31')]=_[_0x0cf3('0x32')](_0x1a1e94[_0x0cf3('0x31')]);_0x1c2c1c[_0x0cf3('0x33')]=_[_0x0cf3('0x34')](_0x1c2c1c[_0x0cf3('0x30')],_0x1c2c1c[_0x0cf3('0x31')]);_0x4b78a0['attributes']=_[_0x0cf3('0x34')](_0x1c2c1c[_0x0cf3('0x30')],qs['fields'](_0x1a1e94[_0x0cf3('0x31')][_0x0cf3('0x35')]));_0x4b78a0['attributes']=_0x4b78a0[_0x0cf3('0x36')]['length']?_0x4b78a0['attributes']:_0x1c2c1c['model'];if(!_0x1a1e94[_0x0cf3('0x31')][_0x0cf3('0x37')]('nolimit')){_0x4b78a0['limit']=qs[_0x0cf3('0x1a')](_0x1a1e94['query']['limit']);_0x4b78a0[_0x0cf3('0x1c')]=qs[_0x0cf3('0x1c')](_0x1a1e94[_0x0cf3('0x31')][_0x0cf3('0x1c')]);}_0x4b78a0[_0x0cf3('0x38')]=qs['sort'](_0x1a1e94['query'][_0x0cf3('0x39')]);_0x4b78a0[_0x0cf3('0x3a')]=qs['filters'](_[_0x0cf3('0x3b')](_0x1a1e94['query'],_0x1c2c1c[_0x0cf3('0x33')]),_0x23707d);if(_0x1a1e94['query'][_0x0cf3('0x3c')]){_0x4b78a0[_0x0cf3('0x3a')]=_['merge'](_0x4b78a0[_0x0cf3('0x3a')],{'$or':_[_0x0cf3('0x2a')](_0x23707d,function(_0x21dd80){if(_0x21dd80[_0x0cf3('0x2e')]!=='VIRTUAL'){var _0x2c3c89={};_0x2c3c89[_0x21dd80[_0x0cf3('0x28')]]={'$like':'%'+_0x1a1e94['query'][_0x0cf3('0x3c')]+'%'};return _0x2c3c89;}})});}_0x4b78a0=_[_0x0cf3('0x3d')]({},_0x4b78a0,_0x1a1e94['options']);var _0x15ee24={'where':_0x4b78a0['where']};return db['DeskField']['count'](_0x15ee24)[_0x0cf3('0x24')](function(_0x4dac1b){_0x38a3c9[_0x0cf3('0x1b')]=_0x4dac1b;if(_0x1a1e94[_0x0cf3('0x31')][_0x0cf3('0x3e')]){_0x4b78a0['include']=[{'all':!![]}];}return db[_0x0cf3('0x2b')][_0x0cf3('0x3f')](_0x4b78a0);})[_0x0cf3('0x24')](function(_0xc6da07){_0x38a3c9[_0x0cf3('0x40')]=_0xc6da07;return _0x38a3c9;})[_0x0cf3('0x24')](respondWithFilteredResult(_0x19f1cf,_0x4b78a0))['catch'](handleError(_0x19f1cf,null));};exports[_0x0cf3('0x41')]=function(_0x434158,_0x2b29eb){var _0x4198ec={'raw':!![],'where':{'id':_0x434158[_0x0cf3('0x42')]['id']}},_0x3a487c={};_0x3a487c[_0x0cf3('0x30')]=_[_0x0cf3('0x32')](db['DeskField'][_0x0cf3('0x2c')]);_0x3a487c['query']=_['keys'](_0x434158['query']);_0x3a487c[_0x0cf3('0x33')]=_[_0x0cf3('0x34')](_0x3a487c[_0x0cf3('0x30')],_0x3a487c[_0x0cf3('0x31')]);_0x4198ec[_0x0cf3('0x36')]=_[_0x0cf3('0x34')](_0x3a487c['model'],qs[_0x0cf3('0x35')](_0x434158[_0x0cf3('0x31')][_0x0cf3('0x35')]));_0x4198ec[_0x0cf3('0x36')]=_0x4198ec[_0x0cf3('0x36')]['length']?_0x4198ec[_0x0cf3('0x36')]:_0x3a487c[_0x0cf3('0x30')];if(_0x434158[_0x0cf3('0x31')]['includeAll']){_0x4198ec[_0x0cf3('0x43')]=[{'all':!![]}];}_0x4198ec=_[_0x0cf3('0x3d')]({},_0x4198ec,_0x434158[_0x0cf3('0x44')]);return db['DeskField']['find'](_0x4198ec)['then'](handleEntityNotFound(_0x2b29eb,null))[_0x0cf3('0x24')](respondWithResult(_0x2b29eb,null))[_0x0cf3('0x45')](handleError(_0x2b29eb,null));};exports[_0x0cf3('0x46')]=function(_0x2c4819,_0xafeb5){return db['DeskField'][_0x0cf3('0x46')](_0x2c4819[_0x0cf3('0x47')],{})[_0x0cf3('0x24')](respondWithResult(_0xafeb5,0xc9))[_0x0cf3('0x45')](handleError(_0xafeb5,null));};exports['update']=function(_0x533f94,_0x1a3ef1){if(_0x533f94[_0x0cf3('0x47')]['id']){delete _0x533f94[_0x0cf3('0x47')]['id'];}return db[_0x0cf3('0x2b')][_0x0cf3('0x48')]({'where':{'id':_0x533f94['params']['id']}})[_0x0cf3('0x24')](handleEntityNotFound(_0x1a3ef1,null))[_0x0cf3('0x24')](saveUpdates(_0x533f94[_0x0cf3('0x47')],null))['then'](respondWithResult(_0x1a3ef1,null))[_0x0cf3('0x45')](handleError(_0x1a3ef1,null));};exports[_0x0cf3('0x23')]=function(_0x270a59,_0x4eb29a){return db[_0x0cf3('0x2b')][_0x0cf3('0x48')]({'where':{'id':_0x270a59[_0x0cf3('0x42')]['id']}})[_0x0cf3('0x24')](handleEntityNotFound(_0x4eb29a,null))['then'](removeEntity(_0x4eb29a,null))[_0x0cf3('0x45')](handleError(_0x4eb29a,null));}; \ No newline at end of file +var _0x0c23=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','rawAttributes','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','stack','name','map','DeskField','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x45c022,_0x552969){var _0xe7d71=function(_0x35b1a3){while(--_0x35b1a3){_0x45c022['push'](_0x45c022['shift']());}};_0xe7d71(++_0x552969);}(_0x0c23,0x13e));var _0x30c2=function(_0x1a59fe,_0x2d209f){_0x1a59fe=_0x1a59fe-0x0;var _0x428dd2=_0x0c23[_0x1a59fe];return _0x428dd2;};'use strict';var emlformat=require(_0x30c2('0x0'));var rimraf=require(_0x30c2('0x1'));var zipdir=require(_0x30c2('0x2'));var jsonpatch=require(_0x30c2('0x3'));var rp=require(_0x30c2('0x4'));var moment=require(_0x30c2('0x5'));var BPromise=require(_0x30c2('0x6'));var Mustache=require('mustache');var util=require(_0x30c2('0x7'));var path=require(_0x30c2('0x8'));var sox=require(_0x30c2('0x9'));var csv=require(_0x30c2('0xa'));var ejs=require(_0x30c2('0xb'));var fs=require('fs');var fs_extra=require(_0x30c2('0xc'));var _=require('lodash');var squel=require(_0x30c2('0xd'));var crypto=require(_0x30c2('0xe'));var jsforce=require(_0x30c2('0xf'));var deskjs=require(_0x30c2('0x10'));var toCsv=require(_0x30c2('0xa'));var querystring=require('querystring');var Papa=require(_0x30c2('0x11'));var Redis=require(_0x30c2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x30c2('0x13'));var as=require(_0x30c2('0x14'));var hardwareService=require(_0x30c2('0x15'));var logger=require(_0x30c2('0x16'))(_0x30c2('0x17'));var utils=require(_0x30c2('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fedbf,_0x2d40b8){_0x2d40b8=_0x2d40b8||0xcc;return function(_0x14be32){if(_0x14be32){return _0x2fedbf[_0x30c2('0x19')](_0x2d40b8);}return _0x2fedbf[_0x30c2('0x1a')](_0x2d40b8)[_0x30c2('0x1b')]();};}function respondWithResult(_0x2712dc,_0x4c6238){_0x4c6238=_0x4c6238||0xc8;return function(_0x1e0d4c){if(_0x1e0d4c){return _0x2712dc[_0x30c2('0x1a')](_0x4c6238)['json'](_0x1e0d4c);}};}function respondWithFilteredResult(_0x450129,_0x16256f){return function(_0x5823d1){if(_0x5823d1){var _0x301ce7=typeof _0x16256f[_0x30c2('0x1c')]===_0x30c2('0x1d')&&typeof _0x16256f[_0x30c2('0x1e')]===_0x30c2('0x1d');var _0x1d6318=_0x5823d1[_0x30c2('0x1f')];var _0x108900=_0x301ce7?0x0:_0x16256f[_0x30c2('0x1c')];var _0x549e8c=_0x301ce7?_0x5823d1[_0x30c2('0x1f')]:_0x16256f['offset']+_0x16256f['limit'];var _0xf36423;if(_0x549e8c>=_0x1d6318){_0x549e8c=_0x1d6318;_0xf36423=0xc8;}else{_0xf36423=0xce;}_0x450129[_0x30c2('0x1a')](_0xf36423);return _0x450129[_0x30c2('0x20')]('Content-Range',_0x108900+'-'+_0x549e8c+'/'+_0x1d6318)[_0x30c2('0x21')](_0x5823d1);}return null;};}function patchUpdates(_0x1d0b52){return function(_0x124140){try{jsonpatch[_0x30c2('0x22')](_0x124140,_0x1d0b52,!![]);}catch(_0x31293f){return BPromise[_0x30c2('0x23')](_0x31293f);}return _0x124140[_0x30c2('0x24')]();};}function saveUpdates(_0x3c6d51,_0x4d9b3f){return function(_0x57b861){if(_0x57b861){return _0x57b861[_0x30c2('0x25')](_0x3c6d51)[_0x30c2('0x26')](function(_0x55d4e1){return _0x55d4e1;});}return null;};}function removeEntity(_0x16f218,_0x428ce8){return function(_0x5a72f5){if(_0x5a72f5){return _0x5a72f5[_0x30c2('0x27')]()[_0x30c2('0x26')](function(){_0x16f218[_0x30c2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dca66,_0x2cbab2){return function(_0x3bbd2d){if(!_0x3bbd2d){_0x3dca66['sendStatus'](0x194);}return _0x3bbd2d;};}function handleError(_0x1ed8d8,_0x3fc548){_0x3fc548=_0x3fc548||0x1f4;return function(_0x104c6d){logger['error'](_0x104c6d[_0x30c2('0x28')]);if(_0x104c6d[_0x30c2('0x29')]){delete _0x104c6d[_0x30c2('0x29')];}_0x1ed8d8[_0x30c2('0x1a')](_0x3fc548)['send'](_0x104c6d);};}exports['index']=function(_0x12d3a3,_0x571b28){var _0x17a6b7={},_0xf3e0d2={},_0x208b54={'count':0x0,'rows':[]};var _0x5227bb=_[_0x30c2('0x2a')](db[_0x30c2('0x2b')]['rawAttributes'],function(_0x343e87){return{'name':_0x343e87[_0x30c2('0x2c')],'type':_0x343e87[_0x30c2('0x2d')][_0x30c2('0x2e')]};});_0xf3e0d2[_0x30c2('0x2f')]=_[_0x30c2('0x2a')](_0x5227bb,_0x30c2('0x29'));_0xf3e0d2[_0x30c2('0x30')]=_[_0x30c2('0x31')](_0x12d3a3[_0x30c2('0x30')]);_0xf3e0d2[_0x30c2('0x32')]=_[_0x30c2('0x33')](_0xf3e0d2[_0x30c2('0x2f')],_0xf3e0d2[_0x30c2('0x30')]);_0x17a6b7[_0x30c2('0x34')]=_[_0x30c2('0x33')](_0xf3e0d2[_0x30c2('0x2f')],qs['fields'](_0x12d3a3['query'][_0x30c2('0x35')]));_0x17a6b7['attributes']=_0x17a6b7['attributes'][_0x30c2('0x36')]?_0x17a6b7[_0x30c2('0x34')]:_0xf3e0d2['model'];if(!_0x12d3a3['query'][_0x30c2('0x37')](_0x30c2('0x38'))){_0x17a6b7[_0x30c2('0x1e')]=qs[_0x30c2('0x1e')](_0x12d3a3[_0x30c2('0x30')][_0x30c2('0x1e')]);_0x17a6b7[_0x30c2('0x1c')]=qs['offset'](_0x12d3a3[_0x30c2('0x30')][_0x30c2('0x1c')]);}_0x17a6b7[_0x30c2('0x39')]=qs['sort'](_0x12d3a3['query'][_0x30c2('0x3a')]);_0x17a6b7[_0x30c2('0x3b')]=qs[_0x30c2('0x32')](_[_0x30c2('0x3c')](_0x12d3a3[_0x30c2('0x30')],_0xf3e0d2[_0x30c2('0x32')]),_0x5227bb);if(_0x12d3a3[_0x30c2('0x30')][_0x30c2('0x3d')]){_0x17a6b7[_0x30c2('0x3b')]=_[_0x30c2('0x3e')](_0x17a6b7['where'],{'$or':_[_0x30c2('0x2a')](_0x5227bb,function(_0x1b724f){if(_0x1b724f[_0x30c2('0x2d')]!==_0x30c2('0x3f')){var _0x196465={};_0x196465[_0x1b724f[_0x30c2('0x29')]]={'$like':'%'+_0x12d3a3[_0x30c2('0x30')][_0x30c2('0x3d')]+'%'};return _0x196465;}})});}_0x17a6b7=_[_0x30c2('0x3e')]({},_0x17a6b7,_0x12d3a3[_0x30c2('0x40')]);var _0x108d47={'where':_0x17a6b7['where']};return db[_0x30c2('0x2b')][_0x30c2('0x1f')](_0x108d47)[_0x30c2('0x26')](function(_0x856029){_0x208b54[_0x30c2('0x1f')]=_0x856029;if(_0x12d3a3[_0x30c2('0x30')]['includeAll']){_0x17a6b7[_0x30c2('0x41')]=[{'all':!![]}];}return db[_0x30c2('0x2b')][_0x30c2('0x42')](_0x17a6b7);})[_0x30c2('0x26')](function(_0x3868fe){_0x208b54['rows']=_0x3868fe;return _0x208b54;})[_0x30c2('0x26')](respondWithFilteredResult(_0x571b28,_0x17a6b7))[_0x30c2('0x43')](handleError(_0x571b28,null));};exports['show']=function(_0x3fc82f,_0x2b4c86){var _0x5041e4={'raw':!![],'where':{'id':_0x3fc82f['params']['id']}},_0x3e9140={};_0x3e9140[_0x30c2('0x2f')]=_[_0x30c2('0x31')](db[_0x30c2('0x2b')][_0x30c2('0x44')]);_0x3e9140[_0x30c2('0x30')]=_[_0x30c2('0x31')](_0x3fc82f[_0x30c2('0x30')]);_0x3e9140[_0x30c2('0x32')]=_[_0x30c2('0x33')](_0x3e9140[_0x30c2('0x2f')],_0x3e9140[_0x30c2('0x30')]);_0x5041e4[_0x30c2('0x34')]=_[_0x30c2('0x33')](_0x3e9140['model'],qs[_0x30c2('0x35')](_0x3fc82f[_0x30c2('0x30')][_0x30c2('0x35')]));_0x5041e4[_0x30c2('0x34')]=_0x5041e4[_0x30c2('0x34')][_0x30c2('0x36')]?_0x5041e4[_0x30c2('0x34')]:_0x3e9140['model'];if(_0x3fc82f[_0x30c2('0x30')][_0x30c2('0x45')]){_0x5041e4[_0x30c2('0x41')]=[{'all':!![]}];}_0x5041e4=_[_0x30c2('0x3e')]({},_0x5041e4,_0x3fc82f[_0x30c2('0x40')]);return db['DeskField'][_0x30c2('0x46')](_0x5041e4)[_0x30c2('0x26')](handleEntityNotFound(_0x2b4c86,null))[_0x30c2('0x26')](respondWithResult(_0x2b4c86,null))[_0x30c2('0x43')](handleError(_0x2b4c86,null));};exports[_0x30c2('0x47')]=function(_0xbbd3fb,_0x159ce9){return db['DeskField'][_0x30c2('0x47')](_0xbbd3fb[_0x30c2('0x48')],{})['then'](respondWithResult(_0x159ce9,0xc9))[_0x30c2('0x43')](handleError(_0x159ce9,null));};exports[_0x30c2('0x25')]=function(_0x5bff09,_0x15fc53){if(_0x5bff09[_0x30c2('0x48')]['id']){delete _0x5bff09[_0x30c2('0x48')]['id'];}return db[_0x30c2('0x2b')][_0x30c2('0x46')]({'where':{'id':_0x5bff09[_0x30c2('0x49')]['id']}})[_0x30c2('0x26')](handleEntityNotFound(_0x15fc53,null))['then'](saveUpdates(_0x5bff09['body'],null))['then'](respondWithResult(_0x15fc53,null))[_0x30c2('0x43')](handleError(_0x15fc53,null));};exports[_0x30c2('0x27')]=function(_0x27d7ca,_0x24db72){return db[_0x30c2('0x2b')]['find']({'where':{'id':_0x27d7ca['params']['id']}})[_0x30c2('0x26')](handleEntityNotFound(_0x24db72,null))[_0x30c2('0x26')](removeEntity(_0x24db72,null))['catch'](handleError(_0x24db72,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 9297553..46c9deb 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 _0x4836=['idField','FieldId','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define','DeskField','int_desk_fields'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x4836,0x152));var _0x6483=function(_0x3020a3,_0x5b9671){_0x3020a3=_0x3020a3-0x0;var _0x561384=_0x4836[_0x3020a3];return _0x561384;};'use strict';var _=require('lodash');var util=require(_0x6483('0x0'));var logger=require(_0x6483('0x1'))(_0x6483('0x2'));var moment=require(_0x6483('0x3'));var BPromise=require('bluebird');var rp=require(_0x6483('0x4'));var fs=require('fs');var path=require(_0x6483('0x5'));var rimraf=require(_0x6483('0x6'));var config=require(_0x6483('0x7'));var attributes=require(_0x6483('0x8'));module['exports']=function(_0x29f138,_0x74c8e8){return _0x29f138[_0x6483('0x9')](_0x6483('0xa'),attributes,{'tableName':_0x6483('0xb'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x6483('0xc'),_0x6483('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe033=['desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intDeskField.attributes','define','DeskField','int_desk_fields'];(function(_0x54fe1c,_0x5d208c){var _0x460aaa=function(_0x430e7a){while(--_0x430e7a){_0x54fe1c['push'](_0x54fe1c['shift']());}};_0x460aaa(++_0x5d208c);}(_0xe033,0x137));var _0x3e03=function(_0x4f833a,_0x15e407){_0x4f833a=_0x4f833a-0x0;var _0x312fbf=_0xe033[_0x4f833a];return _0x312fbf;};'use strict';var _=require(_0x3e03('0x0'));var util=require(_0x3e03('0x1'));var logger=require(_0x3e03('0x2'))(_0x3e03('0x3'));var moment=require(_0x3e03('0x4'));var BPromise=require(_0x3e03('0x5'));var rp=require(_0x3e03('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3e03('0x7'));module['exports']=function(_0x42e083,_0x4fe391){return _0x42e083[_0x3e03('0x8')](_0x3e03('0x9'),attributes,{'tableName':_0x3e03('0xa'),'paranoid':![],'indexes':[{'name':_0x3e03('0xb'),'fields':[_0x3e03('0xc'),_0x3e03('0xd')],'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 fc4e8f0..b329df9 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 _0x3e5a=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x316679,_0x2dc0fe){var _0x117e50=function(_0x1e5466){while(--_0x1e5466){_0x316679['push'](_0x316679['shift']());}};_0x117e50(++_0x2dc0fe);}(_0x3e5a,0x13d));var _0xa3e5=function(_0x240ae8,_0x277f69){_0x240ae8=_0x240ae8-0x0;var _0x31e39c=_0x3e5a[_0x240ae8];return _0x31e39c;};'use strict';var _=require(_0xa3e5('0x0'));var util=require(_0xa3e5('0x1'));var moment=require(_0xa3e5('0x2'));var BPromise=require(_0xa3e5('0x3'));var rs=require(_0xa3e5('0x4'));var fs=require('fs');var Redis=require(_0xa3e5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3e5('0x6'));var logger=require(_0xa3e5('0x7'))(_0xa3e5('0x8'));var config=require(_0xa3e5('0x9'));var jayson=require(_0xa3e5('0xa'));var client=jayson[_0xa3e5('0xb')][_0xa3e5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2bb95f,_0x17cf07,_0x4b5062){return new BPromise(function(_0x12f48e,_0x5c7019){return client['request'](_0x2bb95f,_0x4b5062)[_0xa3e5('0xd')](function(_0x4ca0bc){logger[_0xa3e5('0xe')]('DeskField,\x20%s,\x20%s',_0x17cf07,_0xa3e5('0xf'));logger[_0xa3e5('0x10')](_0xa3e5('0x11'),_0x17cf07,_0xa3e5('0xf'),JSON[_0xa3e5('0x12')](_0x4ca0bc));if(_0x4ca0bc[_0xa3e5('0x13')]){if(_0x4ca0bc[_0xa3e5('0x13')][_0xa3e5('0x14')]===0x1f4){logger[_0xa3e5('0x13')]('DeskField,\x20%s,\x20%s',_0x17cf07,_0x4ca0bc[_0xa3e5('0x13')][_0xa3e5('0x15')]);return _0x5c7019(_0x4ca0bc['error'][_0xa3e5('0x15')]);}logger[_0xa3e5('0x13')]('DeskField,\x20%s,\x20%s',_0x17cf07,_0x4ca0bc[_0xa3e5('0x13')][_0xa3e5('0x15')]);return _0x12f48e(_0x4ca0bc[_0xa3e5('0x13')][_0xa3e5('0x15')]);}else{logger[_0xa3e5('0xe')](_0xa3e5('0x16'),_0x17cf07,_0xa3e5('0xf'));_0x12f48e(_0x4ca0bc[_0xa3e5('0x17')][_0xa3e5('0x15')]);}})[_0xa3e5('0x18')](function(_0x15b9ab){logger[_0xa3e5('0x13')](_0xa3e5('0x16'),_0x17cf07,_0x15b9ab);_0x5c7019(_0x15b9ab);});});} \ No newline at end of file +var _0x791b=['DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x360b7d,_0x1edf66){var _0x548e69=function(_0x1c6c96){while(--_0x1c6c96){_0x360b7d['push'](_0x360b7d['shift']());}};_0x548e69(++_0x1edf66);}(_0x791b,0x166));var _0xb791=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x791b[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xb791('0x0'));var util=require(_0xb791('0x1'));var moment=require(_0xb791('0x2'));var BPromise=require(_0xb791('0x3'));var rs=require(_0xb791('0x4'));var fs=require('fs');var Redis=require(_0xb791('0x5'));var db=require(_0xb791('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb791('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb791('0x8'));var client=jayson[_0xb791('0x9')][_0xb791('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x558586,_0x7a5e9b,_0x209eab){return new BPromise(function(_0x4c11f2,_0x1b5811){return client[_0xb791('0xb')](_0x558586,_0x209eab)[_0xb791('0xc')](function(_0xd05ba4){logger['info'](_0xb791('0xd'),_0x7a5e9b,_0xb791('0xe'));logger[_0xb791('0xf')](_0xb791('0x10'),_0x7a5e9b,_0xb791('0xe'),JSON[_0xb791('0x11')](_0xd05ba4));if(_0xd05ba4[_0xb791('0x12')]){if(_0xd05ba4[_0xb791('0x12')]['code']===0x1f4){logger[_0xb791('0x12')]('DeskField,\x20%s,\x20%s',_0x7a5e9b,_0xd05ba4['error'][_0xb791('0x13')]);return _0x1b5811(_0xd05ba4['error'][_0xb791('0x13')]);}logger[_0xb791('0x12')]('DeskField,\x20%s,\x20%s',_0x7a5e9b,_0xd05ba4[_0xb791('0x12')][_0xb791('0x13')]);return _0x4c11f2(_0xd05ba4['error'][_0xb791('0x13')]);}else{logger[_0xb791('0x14')](_0xb791('0xd'),_0x7a5e9b,'request\x20sent');_0x4c11f2(_0xd05ba4[_0xb791('0x15')][_0xb791('0x13')]);}})['catch'](function(_0x3ac81d){logger['error'](_0xb791('0xd'),_0x7a5e9b,_0x3ac81d);_0x1b5811(_0x3ac81d);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index b73426e..bd9cf87 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 _0x48b4=['isAuthenticated','index','show','/:id/configurations','getConfigurations','create','addConfiguration','put','/:id','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get'];(function(_0x5df033,_0x29458b){var _0x445829=function(_0x2c795b){while(--_0x2c795b){_0x5df033['push'](_0x5df033['shift']());}};_0x445829(++_0x29458b);}(_0x48b4,0x19a));var _0x448b=function(_0x5f192d,_0x505529){_0x5f192d=_0x5f192d-0x0;var _0x981edb=_0x48b4[_0x5f192d];return _0x981edb;};'use strict';var multer=require(_0x448b('0x0'));var util=require(_0x448b('0x1'));var path=require(_0x448b('0x2'));var timeout=require(_0x448b('0x3'));var express=require('express');var router=express[_0x448b('0x4')]();var fs_extra=require(_0x448b('0x5'));var auth=require(_0x448b('0x6'));var interaction=require(_0x448b('0x7'));var config=require('../../config/environment');var controller=require(_0x448b('0x8'));router[_0x448b('0x9')]('/',auth[_0x448b('0xa')](),controller[_0x448b('0xb')]);router[_0x448b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x448b('0xc')]);router[_0x448b('0x9')](_0x448b('0xd'),auth['isAuthenticated'](),controller[_0x448b('0xe')]);router['get']('/:id/fields',auth[_0x448b('0xa')](),controller['getFields']);router['post']('/',auth[_0x448b('0xa')](),controller[_0x448b('0xf')]);router['post'](_0x448b('0xd'),auth[_0x448b('0xa')](),controller[_0x448b('0x10')]);router[_0x448b('0x11')](_0x448b('0x12'),auth['isAuthenticated'](),controller[_0x448b('0x13')]);router[_0x448b('0x14')](_0x448b('0x12'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xba0f=['getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xba0f,0x16b));var _0xfba0=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xba0f[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xfba0('0x0'));var util=require('util');var path=require(_0xfba0('0x1'));var timeout=require(_0xfba0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfba0('0x3'));var auth=require(_0xfba0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfba0('0x5'));var controller=require('./intDynamics365Account.controller');router[_0xfba0('0x6')]('/',auth[_0xfba0('0x7')](),controller[_0xfba0('0x8')]);router['get']('/:id',auth[_0xfba0('0x7')](),controller[_0xfba0('0x9')]);router[_0xfba0('0x6')](_0xfba0('0xa'),auth[_0xfba0('0x7')](),controller[_0xfba0('0xb')]);router['get'](_0xfba0('0xc'),auth[_0xfba0('0x7')](),controller[_0xfba0('0xd')]);router[_0xfba0('0xe')]('/',auth['isAuthenticated'](),controller[_0xfba0('0xf')]);router[_0xfba0('0xe')]('/:id/configurations',auth[_0xfba0('0x7')](),controller[_0xfba0('0x10')]);router['put'](_0xfba0('0x11'),auth[_0xfba0('0x7')](),controller[_0xfba0('0x12')]);router[_0xfba0('0x13')](_0xfba0('0x11'),auth[_0xfba0('0x7')](),controller[_0xfba0('0x14')]);module[_0xfba0('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 6e257df..eb1871d 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 _0xf296=['STRING','sequelize','exports'];(function(_0x60960d,_0x4eeaaa){var _0x3c0085=function(_0x2b8c64){while(--_0x2b8c64){_0x60960d['push'](_0x60960d['shift']());}};_0x3c0085(++_0x4eeaaa);}(_0xf296,0x6a));var _0x6f29=function(_0x57834a,_0xfac574){_0x57834a=_0x57834a-0x0;var _0x5788d9=_0xf296[_0x57834a];return _0x5788d9;};'use strict';var Sequelize=require(_0x6f29('0x0'));module[_0x6f29('0x1')]={'name':{'type':Sequelize[_0x6f29('0x2')]},'username':{'type':Sequelize[_0x6f29('0x2')]},'password':{'type':Sequelize[_0x6f29('0x2')]},'remoteUri':{'type':Sequelize[_0x6f29('0x2')]},'tenantId':{'type':Sequelize[_0x6f29('0x2')]},'clientId':{'type':Sequelize[_0x6f29('0x2')]},'clientSecret':{'type':Sequelize[_0x6f29('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6f29('0x2')]}}; \ No newline at end of file +var _0x3210=['exports','STRING'];(function(_0x5b1389,_0x3f0664){var _0x559a88=function(_0x12ad09){while(--_0x12ad09){_0x5b1389['push'](_0x5b1389['shift']());}};_0x559a88(++_0x3f0664);}(_0x3210,0x198));var _0x0321=function(_0x4884ee,_0x282dde){_0x4884ee=_0x4884ee-0x0;var _0x4682a5=_0x3210[_0x4884ee];return _0x4682a5;};'use strict';var Sequelize=require('sequelize');module[_0x0321('0x0')]={'name':{'type':Sequelize[_0x0321('0x1')]},'username':{'type':Sequelize[_0x0321('0x1')]},'password':{'type':Sequelize[_0x0321('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x0321('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x0321('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x0321('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 4b4e8a4..bfe11fc 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 _0x0f9f=['includes','LogicalName','@odata.type','lastIndexOf','push','all','isNil','BooleanAttributeMetadata','MetadataId','forEach','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','send','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','index','map','Dynamics365Account','fieldName','model','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','options','includeAll','include','findAll','catch','params','keys','rawAttributes','find','create','body','getConfigurations','Dynamics365Configuration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','getFields','ticketType','incident','Incident','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','slice','substring','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove'];(function(_0x16aaef,_0x410651){var _0x1c82ef=function(_0x3d802b){while(--_0x3d802b){_0x16aaef['push'](_0x16aaef['shift']());}};_0x1c82ef(++_0x410651);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0x25402e,_0x1ab8f2){_0x25402e=_0x25402e-0x0;var _0x168dbb=_0x0f9f[_0x25402e];return _0x168dbb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf0f9('0x0'));var zipdir=require(_0xf0f9('0x1'));var jsonpatch=require(_0xf0f9('0x2'));var rp=require('request-promise');var moment=require(_0xf0f9('0x3'));var BPromise=require(_0xf0f9('0x4'));var Mustache=require(_0xf0f9('0x5'));var util=require(_0xf0f9('0x6'));var path=require(_0xf0f9('0x7'));var sox=require(_0xf0f9('0x8'));var csv=require(_0xf0f9('0x9'));var ejs=require(_0xf0f9('0xa'));var fs=require('fs');var fs_extra=require(_0xf0f9('0xb'));var _=require(_0xf0f9('0xc'));var squel=require('squel');var crypto=require(_0xf0f9('0xd'));var jsforce=require(_0xf0f9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf0f9('0x9'));var querystring=require(_0xf0f9('0xf'));var Papa=require(_0xf0f9('0x10'));var Redis=require('ioredis');var authService=require(_0xf0f9('0x11'));var qs=require(_0xf0f9('0x12'));var as=require(_0xf0f9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf0f9('0x14'));var utils=require(_0xf0f9('0x15'));var config=require(_0xf0f9('0x16'));var licenseUtil=require(_0xf0f9('0x17'));var db=require(_0xf0f9('0x18'))['db'];var integrations=require(_0xf0f9('0x19'));function respondWithStatusCode(_0x2360eb,_0x4f27c2){_0x4f27c2=_0x4f27c2||0xcc;return function(_0x2910f2){if(_0x2910f2){return _0x2360eb[_0xf0f9('0x1a')](_0x4f27c2);}return _0x2360eb[_0xf0f9('0x1b')](_0x4f27c2)[_0xf0f9('0x1c')]();};}function respondWithResult(_0x524169,_0x51d78a){_0x51d78a=_0x51d78a||0xc8;return function(_0x459c76){if(_0x459c76){return _0x524169[_0xf0f9('0x1b')](_0x51d78a)[_0xf0f9('0x1d')](_0x459c76);}};}function respondWithFilteredResult(_0x2e2955,_0x2b05e3){return function(_0x2f5bec){if(_0x2f5bec){var _0x2f75da=typeof _0x2b05e3[_0xf0f9('0x1e')]===_0xf0f9('0x1f')&&typeof _0x2b05e3[_0xf0f9('0x20')]==='undefined';var _0x526fff=_0x2f5bec[_0xf0f9('0x21')];var _0x3227cf=_0x2f75da?0x0:_0x2b05e3['offset'];var _0x178e16=_0x2f75da?_0x2f5bec['count']:_0x2b05e3['offset']+_0x2b05e3[_0xf0f9('0x20')];var _0x3d2ef8;if(_0x178e16>=_0x526fff){_0x178e16=_0x526fff;_0x3d2ef8=0xc8;}else{_0x3d2ef8=0xce;}_0x2e2955[_0xf0f9('0x1b')](_0x3d2ef8);return _0x2e2955[_0xf0f9('0x22')](_0xf0f9('0x23'),_0x3227cf+'-'+_0x178e16+'/'+_0x526fff)['json'](_0x2f5bec);}return null;};}function patchUpdates(_0x5ccbc9){return function(_0x5294ac){try{jsonpatch[_0xf0f9('0x24')](_0x5294ac,_0x5ccbc9,!![]);}catch(_0x1c8c39){return BPromise[_0xf0f9('0x25')](_0x1c8c39);}return _0x5294ac['save']();};}function saveUpdates(_0x4a8726,_0x209cd4){return function(_0x550728){if(_0x550728){return _0x550728[_0xf0f9('0x26')](_0x4a8726)[_0xf0f9('0x27')](function(_0x173c79){return _0x173c79;});}return null;};}function removeEntity(_0x570c68,_0x33dfca){return function(_0x1061ca){if(_0x1061ca){return _0x1061ca[_0xf0f9('0x28')]()['then'](function(){_0x570c68[_0xf0f9('0x1b')](0xcc)[_0xf0f9('0x1c')]();});}};}function handleEntityNotFound(_0x2879a2,_0x185e1e){return function(_0x16f639){if(!_0x16f639){_0x2879a2[_0xf0f9('0x1a')](0x194);}return _0x16f639;};}function handleError(_0x5df7f5,_0x28e1f6){_0x28e1f6=_0x28e1f6||0x1f4;return function(_0x56663e){logger[_0xf0f9('0x29')](_0x56663e[_0xf0f9('0x2a')]);if(_0x56663e['name']){delete _0x56663e['name'];}_0x5df7f5[_0xf0f9('0x1b')](_0x28e1f6)['send'](_0x56663e);};}exports[_0xf0f9('0x2b')]=function(_0x3f236e,_0x269e47){var _0x353502={},_0x3ec658={},_0x39cd34={'count':0x0,'rows':[]};var _0x1377ed=_[_0xf0f9('0x2c')](db[_0xf0f9('0x2d')]['rawAttributes'],function(_0x2e79f9){return{'name':_0x2e79f9[_0xf0f9('0x2e')],'type':_0x2e79f9['type']['key']};});_0x3ec658[_0xf0f9('0x2f')]=_['map'](_0x1377ed,'name');_0x3ec658[_0xf0f9('0x30')]=_['keys'](_0x3f236e[_0xf0f9('0x30')]);_0x3ec658[_0xf0f9('0x31')]=_['intersection'](_0x3ec658['model'],_0x3ec658[_0xf0f9('0x30')]);_0x353502[_0xf0f9('0x32')]=_[_0xf0f9('0x33')](_0x3ec658[_0xf0f9('0x2f')],qs[_0xf0f9('0x34')](_0x3f236e[_0xf0f9('0x30')][_0xf0f9('0x34')]));_0x353502[_0xf0f9('0x32')]=_0x353502[_0xf0f9('0x32')][_0xf0f9('0x35')]?_0x353502[_0xf0f9('0x32')]:_0x3ec658[_0xf0f9('0x2f')];if(!_0x3f236e[_0xf0f9('0x30')]['hasOwnProperty'](_0xf0f9('0x36'))){_0x353502['limit']=qs[_0xf0f9('0x20')](_0x3f236e[_0xf0f9('0x30')][_0xf0f9('0x20')]);_0x353502[_0xf0f9('0x1e')]=qs[_0xf0f9('0x1e')](_0x3f236e[_0xf0f9('0x30')][_0xf0f9('0x1e')]);}_0x353502['order']=qs['sort'](_0x3f236e[_0xf0f9('0x30')][_0xf0f9('0x37')]);_0x353502[_0xf0f9('0x38')]=qs[_0xf0f9('0x31')](_[_0xf0f9('0x39')](_0x3f236e['query'],_0x3ec658[_0xf0f9('0x31')]),_0x1377ed);if(_0x3f236e[_0xf0f9('0x30')][_0xf0f9('0x3a')]){_0x353502[_0xf0f9('0x38')]=_[_0xf0f9('0x3b')](_0x353502['where'],{'$or':_[_0xf0f9('0x2c')](_0x1377ed,function(_0x1fd579){if(_0x1fd579[_0xf0f9('0x3c')]!==_0xf0f9('0x3d')){var _0x7cf75a={};_0x7cf75a[_0x1fd579[_0xf0f9('0x3e')]]={'$like':'%'+_0x3f236e['query'][_0xf0f9('0x3a')]+'%'};return _0x7cf75a;}})});}_0x353502=_[_0xf0f9('0x3b')]({},_0x353502,_0x3f236e[_0xf0f9('0x3f')]);var _0x5627e8={'where':_0x353502[_0xf0f9('0x38')]};return db[_0xf0f9('0x2d')][_0xf0f9('0x21')](_0x5627e8)[_0xf0f9('0x27')](function(_0x3eca28){_0x39cd34[_0xf0f9('0x21')]=_0x3eca28;if(_0x3f236e[_0xf0f9('0x30')][_0xf0f9('0x40')]){_0x353502[_0xf0f9('0x41')]=[{'all':!![]}];}return db[_0xf0f9('0x2d')][_0xf0f9('0x42')](_0x353502);})[_0xf0f9('0x27')](function(_0x21672e){_0x39cd34['rows']=_0x21672e;return _0x39cd34;})['then'](respondWithFilteredResult(_0x269e47,_0x353502))[_0xf0f9('0x43')](handleError(_0x269e47,null));};exports['show']=function(_0x54daca,_0x4e8234){var _0x2cb95d={'raw':![],'where':{'id':_0x54daca[_0xf0f9('0x44')]['id']}},_0x3eb7e2={};_0x3eb7e2[_0xf0f9('0x2f')]=_[_0xf0f9('0x45')](db[_0xf0f9('0x2d')][_0xf0f9('0x46')]);_0x3eb7e2[_0xf0f9('0x30')]=_[_0xf0f9('0x45')](_0x54daca['query']);_0x3eb7e2[_0xf0f9('0x31')]=_[_0xf0f9('0x33')](_0x3eb7e2[_0xf0f9('0x2f')],_0x3eb7e2['query']);_0x2cb95d[_0xf0f9('0x32')]=_[_0xf0f9('0x33')](_0x3eb7e2[_0xf0f9('0x2f')],qs['fields'](_0x54daca[_0xf0f9('0x30')][_0xf0f9('0x34')]));_0x2cb95d['attributes']=_0x2cb95d[_0xf0f9('0x32')][_0xf0f9('0x35')]?_0x2cb95d[_0xf0f9('0x32')]:_0x3eb7e2[_0xf0f9('0x2f')];if(_0x54daca['query'][_0xf0f9('0x40')]){_0x2cb95d[_0xf0f9('0x41')]=[{'all':!![]}];}_0x2cb95d=_[_0xf0f9('0x3b')]({},_0x2cb95d,_0x54daca[_0xf0f9('0x3f')]);return db[_0xf0f9('0x2d')][_0xf0f9('0x47')](_0x2cb95d)['then'](handleEntityNotFound(_0x4e8234,null))[_0xf0f9('0x27')](respondWithResult(_0x4e8234,null))['catch'](handleError(_0x4e8234,null));};exports[_0xf0f9('0x48')]=function(_0x38956b,_0x130fc8){return db[_0xf0f9('0x2d')][_0xf0f9('0x48')](_0x38956b[_0xf0f9('0x49')],{})[_0xf0f9('0x27')](respondWithResult(_0x130fc8,0xc9))[_0xf0f9('0x43')](handleError(_0x130fc8,null));};exports[_0xf0f9('0x26')]=function(_0x13bb13,_0x10f956){if(_0x13bb13[_0xf0f9('0x49')]['id']){delete _0x13bb13[_0xf0f9('0x49')]['id'];}return db[_0xf0f9('0x2d')][_0xf0f9('0x47')]({'where':{'id':_0x13bb13[_0xf0f9('0x44')]['id']}})[_0xf0f9('0x27')](handleEntityNotFound(_0x10f956,null))[_0xf0f9('0x27')](saveUpdates(_0x13bb13[_0xf0f9('0x49')],null))[_0xf0f9('0x27')](respondWithResult(_0x10f956,null))[_0xf0f9('0x43')](handleError(_0x10f956,null));};exports[_0xf0f9('0x28')]=function(_0x3db0b2,_0x37a928){return db['Dynamics365Account']['find']({'where':{'id':_0x3db0b2[_0xf0f9('0x44')]['id']}})['then'](handleEntityNotFound(_0x37a928,null))[_0xf0f9('0x27')](removeEntity(_0x37a928,null))[_0xf0f9('0x43')](handleError(_0x37a928,null));};exports[_0xf0f9('0x4a')]=function(_0x542de6,_0x2b2604,_0x54fe5b){var _0x303d75={};var _0x603804={};var _0x31c17e;var _0xfe9072;return db[_0xf0f9('0x2d')]['findOne']({'where':{'id':_0x542de6[_0xf0f9('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b2604,null))[_0xf0f9('0x27')](function(_0x1b0186){if(_0x1b0186){_0x31c17e=_0x1b0186;_0x603804[_0xf0f9('0x2f')]=_[_0xf0f9('0x45')](db[_0xf0f9('0x4b')]['rawAttributes']);_0x603804[_0xf0f9('0x30')]=_[_0xf0f9('0x45')](_0x542de6[_0xf0f9('0x30')]);_0x603804[_0xf0f9('0x31')]=_[_0xf0f9('0x33')](_0x603804[_0xf0f9('0x2f')],_0x603804[_0xf0f9('0x30')]);_0x303d75[_0xf0f9('0x32')]=_[_0xf0f9('0x33')](_0x603804[_0xf0f9('0x2f')],qs[_0xf0f9('0x34')](_0x542de6[_0xf0f9('0x30')][_0xf0f9('0x34')]));_0x303d75[_0xf0f9('0x32')]=_0x303d75['attributes'][_0xf0f9('0x35')]?_0x303d75[_0xf0f9('0x32')]:_0x603804[_0xf0f9('0x2f')];_0x303d75['order']=qs[_0xf0f9('0x37')](_0x542de6[_0xf0f9('0x30')][_0xf0f9('0x37')]);_0x303d75[_0xf0f9('0x38')]=qs[_0xf0f9('0x31')](_['pick'](_0x542de6[_0xf0f9('0x30')],_0x603804[_0xf0f9('0x31')]));if(_0x542de6[_0xf0f9('0x30')][_0xf0f9('0x3a')]){_0x303d75[_0xf0f9('0x38')]=_[_0xf0f9('0x3b')](_0x303d75[_0xf0f9('0x38')],{'$or':_[_0xf0f9('0x2c')](_0x303d75[_0xf0f9('0x32')],function(_0x10e1c7){var _0x4e6d3e={};_0x4e6d3e[_0x10e1c7]={'$like':'%'+_0x542de6[_0xf0f9('0x30')][_0xf0f9('0x3a')]+'%'};return _0x4e6d3e;})});}_0x303d75=_['merge']({},_0x303d75,_0x542de6[_0xf0f9('0x3f')]);return _0x31c17e['getConfigurations'](_0x303d75);}})[_0xf0f9('0x27')](function(_0x13e8b8){if(_0x13e8b8){_0xfe9072=_0x13e8b8[_0xf0f9('0x35')];if(!_0x542de6['query'][_0xf0f9('0x4c')](_0xf0f9('0x36'))){_0x303d75[_0xf0f9('0x20')]=qs[_0xf0f9('0x20')](_0x542de6[_0xf0f9('0x30')][_0xf0f9('0x20')]);_0x303d75[_0xf0f9('0x1e')]=qs[_0xf0f9('0x1e')](_0x542de6[_0xf0f9('0x30')][_0xf0f9('0x1e')]);}return _0x31c17e[_0xf0f9('0x4a')](_0x303d75);}})[_0xf0f9('0x27')](function(_0x4a758c){if(_0x4a758c){return _0x4a758c?{'count':_0xfe9072,'rows':_0x4a758c}:null;}})[_0xf0f9('0x27')](respondWithResult(_0x2b2604,null))[_0xf0f9('0x43')](handleError(_0x2b2604,null));};exports[_0xf0f9('0x4d')]=function(_0x2db767,_0x4e43e3,_0x44dba3){if(_0x2db767[_0xf0f9('0x49')]['id']){delete _0x2db767[_0xf0f9('0x49')]['id'];}return db['Dynamics365Account'][_0xf0f9('0x4e')]({'where':{'id':_0x2db767[_0xf0f9('0x44')]['id']}})['then'](handleEntityNotFound(_0x4e43e3,null))[_0xf0f9('0x27')](function(_0x405c38){if(_0x405c38){_0x2db767['body'][_0xf0f9('0x4f')]=_0x405c38['id'];_0x2db767[_0xf0f9('0x49')][_0xf0f9('0x50')]=integrations[_0xf0f9('0x51')](_0x2db767[_0xf0f9('0x49')][_0xf0f9('0x52')],_0x2db767[_0xf0f9('0x49')]['type']);_0x2db767[_0xf0f9('0x49')][_0xf0f9('0x53')]=integrations['getDescriptions'](_0x2db767[_0xf0f9('0x49')][_0xf0f9('0x52')],_0x2db767['body'][_0xf0f9('0x3c')]);return db[_0xf0f9('0x4b')]['create'](_0x2db767[_0xf0f9('0x49')],{'include':[{'model':db['Dynamics365Field'],'as':_0xf0f9('0x50')},{'model':db[_0xf0f9('0x54')],'as':_0xf0f9('0x53')}]});}return null;})['then'](respondWithResult(_0x4e43e3,null))[_0xf0f9('0x43')](handleError(_0x4e43e3,null));};exports[_0xf0f9('0x55')]=function(_0x298371,_0x27771a,_0x4fb990){var _0x1e64a5=_0x298371[_0xf0f9('0x30')][_0xf0f9('0x56')];var _0x1541c8=_0x1e64a5===_0xf0f9('0x57')?_0xf0f9('0x58'):'PhoneCall';var _0x451346='';var _0x1eb8d2='';var _0x12bfb0='';var _0x3f8219='';var _0x54bf04='';var _0x28c540='';var _0x5022e7='';var _0x435884='';var _0x14c652=[_0xf0f9('0x59'),_0xf0f9('0x5a'),_0xf0f9('0x5b'),_0xf0f9('0x5c'),_0xf0f9('0x5d'),_0xf0f9('0x5e'),_0xf0f9('0x5f'),_0xf0f9('0x60'),_0xf0f9('0x61'),_0xf0f9('0x62')];var _0x5323cd=[_0xf0f9('0x63'),_0xf0f9('0x64'),'actualserviceunits',_0xf0f9('0x65'),_0xf0f9('0x66'),'contactidyominame','contractdetailidname',_0xf0f9('0x67'),_0xf0f9('0x68'),_0xf0f9('0x69'),_0xf0f9('0x6a'),_0xf0f9('0x6b'),_0xf0f9('0x6c'),'createdonbehalfbyname',_0xf0f9('0x6d'),_0xf0f9('0x6e'),_0xf0f9('0x6f'),_0xf0f9('0x70'),_0xf0f9('0x71'),_0xf0f9('0x72'),_0xf0f9('0x73'),_0xf0f9('0x74'),'escalatedon',_0xf0f9('0x75'),_0xf0f9('0x76'),_0xf0f9('0x77'),_0xf0f9('0x78'),'influencescore','kbarticleidname',_0xf0f9('0x79'),_0xf0f9('0x7a'),'modifiedbyexternalpartyname',_0xf0f9('0x7b'),_0xf0f9('0x7c'),_0xf0f9('0x7d'),'modifiedon',_0xf0f9('0x7e'),_0xf0f9('0x7f'),'msdyn_incidenttypename',_0xf0f9('0x80'),_0xf0f9('0x81'),'onholdtime',_0xf0f9('0x82'),_0xf0f9('0x83'),_0xf0f9('0x84'),_0xf0f9('0x85'),'parentcaseidname',_0xf0f9('0x86'),_0xf0f9('0x87'),_0xf0f9('0x88'),'productidname','productserialnumber',_0xf0f9('0x89'),'resolvebykpiidname',_0xf0f9('0x8a'),_0xf0f9('0x8b'),_0xf0f9('0x8c'),_0xf0f9('0x8d'),_0xf0f9('0x8e'),_0xf0f9('0x8f'),_0xf0f9('0x90'),_0xf0f9('0x91'),_0xf0f9('0x92'),'subjectidname',_0xf0f9('0x93'),_0xf0f9('0x94'),_0xf0f9('0x95'),_0xf0f9('0x96'),_0xf0f9('0x97'),_0xf0f9('0x98')];var _0x48420a=_0x14c652[_0xf0f9('0x99')](_0x5323cd);return db['Dynamics365Account'][_0xf0f9('0x4e')]({'where':{'id':_0x298371[_0xf0f9('0x44')]['id']},'attributes':['id',_0xf0f9('0x9a'),_0xf0f9('0x9b'),_0xf0f9('0x9c'),_0xf0f9('0x9d'),_0xf0f9('0x9e'),'clientSecret']})[_0xf0f9('0x27')](handleEntityNotFound(_0x27771a,null))['then'](function(_0x5de55d){if(_0x5de55d){_0x435884=_0x5de55d[_0xf0f9('0x9c')];var _0x4da812=_0x435884[_0xf0f9('0x9f')](-0x1);if(_0x4da812==='/'){_0x435884=_0x435884[_0xf0f9('0xa0')](0x0,_0x435884['lastIndexOf'](_0x4da812));}_0x5022e7=util[_0xf0f9('0xa1')](_0xf0f9('0xa2'),_0x435884);var _0x784e8c={'method':_0xf0f9('0xa3'),'uri':_0xf0f9('0xa4')+_0x5de55d[_0xf0f9('0x9d')]+_0xf0f9('0xa5'),'form':{'client_id':_0x5de55d[_0xf0f9('0x9e')],'resource':_0x435884,'username':_0x5de55d[_0xf0f9('0x9a')],'password':_0x5de55d[_0xf0f9('0x9b')],'grant_type':_0xf0f9('0x9b'),'client_secret':_0x5de55d['clientSecret']},'json':!![]};return rp(_0x784e8c);}})[_0xf0f9('0x27')](function(_0x394010){_0x28c540=_0x394010['access_token'];var _0x3f65d8={'method':_0xf0f9('0xa6'),'uri':encodeURI(_0x5022e7+_0xf0f9('0xa7')+_0x1541c8+'\x27'),'headers':{'Authorization':_0xf0f9('0xa8')+_0x28c540,'If-None-Match':null,'OData-Version':_0xf0f9('0xa9')},'json':!![]};return rp(_0x3f65d8);})['then'](function(_0x206922){var _0x225e34=_0x206922['value'][0x0];var _0xb9264=_0x225e34['MetadataId'];var _0x48ce87={'method':_0xf0f9('0xa6'),'uri':_0x5022e7+'EntityDefinitions('+_0xb9264+_0xf0f9('0xaa'),'headers':{'Authorization':'Bearer\x20'+_0x28c540,'If-None-Match':null,'OData-Version':_0xf0f9('0xa9')},'json':!![]};return rp(_0x48ce87);})[_0xf0f9('0x27')](function(_0x51f1cc){_0x451346=_0x51f1cc;_0x1eb8d2=_0x451346[_0xf0f9('0xab')];_0x1eb8d2=_[_0xf0f9('0xac')](_0x1eb8d2,function(_0x1655a6){return!_0x48420a[_0xf0f9('0xad')](_0x1655a6[_0xf0f9('0xae')]);});var _0x335932=[];var _0x46e05c=[];_0x1eb8d2['forEach'](function(_0x4467b8){if(_0x4467b8[_0xf0f9('0xaf')]){var _0xff28a2=_0x4467b8[_0xf0f9('0xaf')]['substring'](_0x4467b8['@odata.type'][_0xf0f9('0xb0')]('.')+0x1);if(_0xff28a2==='PicklistAttributeMetadata'){_0x335932[_0xf0f9('0xb1')](getSelectList(_0x5022e7,_0x1e64a5,_0x46e05c,_0x451346['MetadataId'],_0x4467b8['MetadataId'],_0x28c540));}}});return Promise[_0xf0f9('0xb2')](_0x335932);})[_0xf0f9('0x27')](function(_0x10f131){_0x12bfb0=_0x10f131[0x0];var _0x2c0939=[];var _0x11bca6=[];_0x1eb8d2['forEach'](function(_0x1fbad4){if(!_[_0xf0f9('0xb3')](_0x1fbad4['@odata.type'])){var _0x11f4bd=_0x1fbad4[_0xf0f9('0xaf')][_0xf0f9('0xa0')](_0x1fbad4['@odata.type'][_0xf0f9('0xb0')]('.')+0x1);if(_0x11f4bd===_0xf0f9('0xb4')){_0x2c0939[_0xf0f9('0xb1')](getBooleanList(_0x5022e7,_0x1e64a5,_0x11bca6,_0x451346[_0xf0f9('0xb5')],_0x1fbad4[_0xf0f9('0xb5')],_0x28c540));}}});return Promise[_0xf0f9('0xb2')](_0x2c0939);})['then'](function(_0x2c24e7){_0x3f8219=_0x2c24e7[0x0];var _0x3f8200=[];var _0x549a6d=[];_0x1eb8d2[_0xf0f9('0xb6')](function(_0x4b6f16){if(_0x4b6f16[_0xf0f9('0xaf')]){var _0x260c72=_0x4b6f16['@odata.type'][_0xf0f9('0xa0')](_0x4b6f16[_0xf0f9('0xaf')][_0xf0f9('0xb0')]('.')+0x1);if(_0x260c72===_0xf0f9('0xb7')||_0x260c72===_0xf0f9('0xb8')||_0x260c72===_0xf0f9('0xb9')||_0x260c72===_0xf0f9('0xba')||_0x260c72===_0xf0f9('0xbb')||_0x260c72==='DateTimeAttributeMetadata'||_0x260c72===_0xf0f9('0xbc')||_0x260c72===_0xf0f9('0xbd')||_0x260c72==='StateAttributeMetadata'||_0x260c72===_0xf0f9('0xbe')){_0x3f8200[_0xf0f9('0xb1')](getInputList(_0x5022e7,_0x1e64a5,_0x260c72,_0x549a6d,_0x451346[_0xf0f9('0xb5')],_0x4b6f16[_0xf0f9('0xb5')],_0x28c540));}}});return Promise[_0xf0f9('0xb2')](_0x3f8200);})['then'](function(_0x375590){_0x54bf04=_0x375590[0x0];var _0x2a522b=_0x12bfb0[_0xf0f9('0x99')](_0x3f8219)[_0xf0f9('0x99')](_0x54bf04);var _0x34df9d={'count':_0x2a522b[_0xf0f9('0x35')],'rows':_0x2a522b};return _0x34df9d;})['then'](respondWithResult(_0x27771a,null))[_0xf0f9('0x43')](function(_0x364349){var _0x2c61d5=_0x298371['query'][_0xf0f9('0xbf')]?0x1f4:_0x364349[_0xf0f9('0xc0')]||0x1f4;logger[_0xf0f9('0x29')](_0x364349[_0xf0f9('0x2a')]);delete _0x364349[_0xf0f9('0x3e')];if(_0x2c61d5===0x191){_0x2c61d5=0x190;}_0x27771a['status'](_0x2c61d5)[_0xf0f9('0xc1')](_0x298371[_0xf0f9('0x30')]['test']?{'message':_0xf0f9('0xc2'),'statusCode':_0x364349['statusCode']}:_0x364349);});};function getSelectList(_0xd772a7,_0x3a135b,_0x22a77c,_0x93dac8,_0x12d569,_0x501a3a){var _0x27a20c={'method':_0xf0f9('0xa6'),'uri':_0xd772a7+_0xf0f9('0xc3')+_0x93dac8+_0xf0f9('0xc4')+_0x12d569+_0xf0f9('0xc5')+_0xf0f9('0xc6'),'headers':{'Authorization':'Bearer\x20'+_0x501a3a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x27a20c)[_0xf0f9('0x27')](function(_0x18b5c3){var _0x55d63f=[];var _0x53fed3=_0x18b5c3[_0xf0f9('0xc7')][_0xf0f9('0xc8')];_0x53fed3['forEach'](function(_0x3d704b){_0x55d63f[_0xf0f9('0xb1')]({'name':_0x3d704b[_0xf0f9('0xc9')][_0xf0f9('0xca')]['Label'],'value':String(_0x3d704b[_0xf0f9('0xcb')])});});var _0x54bc81={'id':_0x3a135b+'_'+_0x18b5c3[_0xf0f9('0xae')],'name':_0x18b5c3[_0xf0f9('0xcc')][_0xf0f9('0xca')]['Label'],'custom':![],'options':_0x55d63f};_0x22a77c['push'](_0x54bc81);return _0x22a77c;});}function getBooleanList(_0x391537,_0x357cca,_0x107a60,_0x3af785,_0x4adb4b,_0x190ff1){var _0x388af1={'method':_0xf0f9('0xa6'),'uri':_0x391537+'EntityDefinitions('+_0x3af785+_0xf0f9('0xc4')+_0x4adb4b+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xf0f9('0xa8')+_0x190ff1,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x388af1)[_0xf0f9('0x27')](function(_0x4acb7c){var _0x313c6f=[];_0x313c6f[_0xf0f9('0xb1')]({'name':_0x4acb7c[_0xf0f9('0xc7')][_0xf0f9('0xcd')][_0xf0f9('0xc9')][_0xf0f9('0xca')][_0xf0f9('0xc9')],'value':_0xf0f9('0xce')},{'name':_0x4acb7c[_0xf0f9('0xc7')][_0xf0f9('0xcf')]['Label'][_0xf0f9('0xca')]['Label'],'value':_0xf0f9('0xd0')});var _0x398451={'id':_0x357cca+'_'+_0x4acb7c[_0xf0f9('0xae')],'name':_0x4acb7c[_0xf0f9('0xcc')][_0xf0f9('0xca')][_0xf0f9('0xc9')],'custom':![],'options':_0x313c6f};_0x107a60[_0xf0f9('0xb1')](_0x398451);return _0x107a60;});}function getInputList(_0x42759a,_0x381e66,_0x5099d6,_0x167d86,_0x5d7072,_0x4534b6,_0x40cd75){var _0x19ff00={'method':_0xf0f9('0xa6'),'uri':_0x42759a+_0xf0f9('0xc3')+_0x5d7072+_0xf0f9('0xc4')+_0x4534b6+_0xf0f9('0xd1')+_0x5099d6+_0xf0f9('0xd2'),'headers':{'Authorization':_0xf0f9('0xa8')+_0x40cd75,'If-None-Match':null,'OData-Version':_0xf0f9('0xa9')},'json':!![]};return rp(_0x19ff00)[_0xf0f9('0x27')](function(_0x53eb3d){var _0x297bbd={'id':_0x381e66+'_'+_0x53eb3d[_0xf0f9('0xae')],'name':_0x53eb3d[_0xf0f9('0xcc')]['UserLocalizedLabel']?_0x53eb3d[_0xf0f9('0xcc')][_0xf0f9('0xca')][_0xf0f9('0xc9')]:_0x53eb3d['LogicalName'],'custom':![],'options':[]};_0x167d86[_0xf0f9('0xb1')](_0x297bbd);return _0x167d86;});} \ No newline at end of file +var _0xb31a=['true','FalseOption','false','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','type','VIRTUAL','includeAll','include','findAll','show','params','find','catch','create','body','getConfigurations','Dynamics365Configuration','order','pick','filter','options','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','getFields','incident','Incident','PhoneCall','description','customerid','caseorigincode','subject','phonenumber','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','username','password','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','includes','LogicalName','forEach','@odata.type','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','error','Wrong\x20credentials',')/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'];(function(_0x17418d,_0x3046fd){var _0x2108c6=function(_0x3a89a1){while(--_0x3a89a1){_0x17418d['push'](_0x17418d['shift']());}};_0x2108c6(++_0x3046fd);}(_0xb31a,0xd4));var _0xab31=function(_0x1afde3,_0xc1f075){_0x1afde3=_0x1afde3-0x0;var _0x54a07c=_0xb31a[_0x1afde3];return _0x54a07c;};'use strict';var emlformat=require(_0xab31('0x0'));var rimraf=require(_0xab31('0x1'));var zipdir=require(_0xab31('0x2'));var jsonpatch=require(_0xab31('0x3'));var rp=require(_0xab31('0x4'));var moment=require(_0xab31('0x5'));var BPromise=require(_0xab31('0x6'));var Mustache=require(_0xab31('0x7'));var util=require(_0xab31('0x8'));var path=require(_0xab31('0x9'));var sox=require(_0xab31('0xa'));var csv=require(_0xab31('0xb'));var ejs=require(_0xab31('0xc'));var fs=require('fs');var fs_extra=require(_0xab31('0xd'));var _=require(_0xab31('0xe'));var squel=require('squel');var crypto=require(_0xab31('0xf'));var jsforce=require(_0xab31('0x10'));var deskjs=require(_0xab31('0x11'));var toCsv=require(_0xab31('0xb'));var querystring=require(_0xab31('0x12'));var Papa=require(_0xab31('0x13'));var Redis=require(_0xab31('0x14'));var authService=require(_0xab31('0x15'));var qs=require(_0xab31('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xab31('0x17'))(_0xab31('0x18'));var utils=require('../../config/utils');var config=require(_0xab31('0x19'));var licenseUtil=require(_0xab31('0x1a'));var db=require(_0xab31('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5065d2,_0x24f6e4){_0x24f6e4=_0x24f6e4||0xcc;return function(_0xac16ac){if(_0xac16ac){return _0x5065d2[_0xab31('0x1c')](_0x24f6e4);}return _0x5065d2[_0xab31('0x1d')](_0x24f6e4)[_0xab31('0x1e')]();};}function respondWithResult(_0xab1368,_0x3b702e){_0x3b702e=_0x3b702e||0xc8;return function(_0xbdf700){if(_0xbdf700){return _0xab1368[_0xab31('0x1d')](_0x3b702e)['json'](_0xbdf700);}};}function respondWithFilteredResult(_0x55a75c,_0x3f1da0){return function(_0x4bb592){if(_0x4bb592){var _0x1c0a9d=typeof _0x3f1da0[_0xab31('0x1f')]===_0xab31('0x20')&&typeof _0x3f1da0[_0xab31('0x21')]===_0xab31('0x20');var _0x214849=_0x4bb592[_0xab31('0x22')];var _0x4c7d92=_0x1c0a9d?0x0:_0x3f1da0[_0xab31('0x1f')];var _0x3c56a6=_0x1c0a9d?_0x4bb592[_0xab31('0x22')]:_0x3f1da0[_0xab31('0x1f')]+_0x3f1da0[_0xab31('0x21')];var _0x5bdee1;if(_0x3c56a6>=_0x214849){_0x3c56a6=_0x214849;_0x5bdee1=0xc8;}else{_0x5bdee1=0xce;}_0x55a75c[_0xab31('0x1d')](_0x5bdee1);return _0x55a75c[_0xab31('0x23')]('Content-Range',_0x4c7d92+'-'+_0x3c56a6+'/'+_0x214849)['json'](_0x4bb592);}return null;};}function patchUpdates(_0x1a83ce){return function(_0x36b57e){try{jsonpatch[_0xab31('0x24')](_0x36b57e,_0x1a83ce,!![]);}catch(_0x595052){return BPromise[_0xab31('0x25')](_0x595052);}return _0x36b57e[_0xab31('0x26')]();};}function saveUpdates(_0x4a723c,_0x57d61f){return function(_0x9c0007){if(_0x9c0007){return _0x9c0007[_0xab31('0x27')](_0x4a723c)[_0xab31('0x28')](function(_0x8b95b0){return _0x8b95b0;});}return null;};}function removeEntity(_0x4c7238,_0x3a9997){return function(_0x5db7fd){if(_0x5db7fd){return _0x5db7fd[_0xab31('0x29')]()[_0xab31('0x28')](function(){_0x4c7238['status'](0xcc)[_0xab31('0x1e')]();});}};}function handleEntityNotFound(_0x5761fe,_0x340d53){return function(_0x2363b5){if(!_0x2363b5){_0x5761fe[_0xab31('0x1c')](0x194);}return _0x2363b5;};}function handleError(_0x4efbd4,_0x3ff881){_0x3ff881=_0x3ff881||0x1f4;return function(_0x541f42){logger['error'](_0x541f42[_0xab31('0x2a')]);if(_0x541f42['name']){delete _0x541f42[_0xab31('0x2b')];}_0x4efbd4['status'](_0x3ff881)[_0xab31('0x2c')](_0x541f42);};}exports[_0xab31('0x2d')]=function(_0x30473c,_0x24d22c){var _0x429af1={},_0xa7dd3d={},_0x31d29d={'count':0x0,'rows':[]};var _0xb25176=_[_0xab31('0x2e')](db[_0xab31('0x2f')][_0xab31('0x30')],function(_0x40493c){return{'name':_0x40493c[_0xab31('0x31')],'type':_0x40493c['type'][_0xab31('0x32')]};});_0xa7dd3d[_0xab31('0x33')]=_[_0xab31('0x2e')](_0xb25176,'name');_0xa7dd3d[_0xab31('0x34')]=_[_0xab31('0x35')](_0x30473c[_0xab31('0x34')]);_0xa7dd3d[_0xab31('0x36')]=_[_0xab31('0x37')](_0xa7dd3d[_0xab31('0x33')],_0xa7dd3d[_0xab31('0x34')]);_0x429af1[_0xab31('0x38')]=_[_0xab31('0x37')](_0xa7dd3d[_0xab31('0x33')],qs[_0xab31('0x39')](_0x30473c[_0xab31('0x34')]['fields']));_0x429af1['attributes']=_0x429af1[_0xab31('0x38')][_0xab31('0x3a')]?_0x429af1['attributes']:_0xa7dd3d[_0xab31('0x33')];if(!_0x30473c[_0xab31('0x34')][_0xab31('0x3b')]('nolimit')){_0x429af1[_0xab31('0x21')]=qs[_0xab31('0x21')](_0x30473c[_0xab31('0x34')][_0xab31('0x21')]);_0x429af1['offset']=qs['offset'](_0x30473c[_0xab31('0x34')][_0xab31('0x1f')]);}_0x429af1['order']=qs[_0xab31('0x3c')](_0x30473c['query'][_0xab31('0x3c')]);_0x429af1[_0xab31('0x3d')]=qs[_0xab31('0x36')](_['pick'](_0x30473c['query'],_0xa7dd3d[_0xab31('0x36')]),_0xb25176);if(_0x30473c[_0xab31('0x34')]['filter']){_0x429af1[_0xab31('0x3d')]=_[_0xab31('0x3e')](_0x429af1['where'],{'$or':_[_0xab31('0x2e')](_0xb25176,function(_0x579e3d){if(_0x579e3d[_0xab31('0x3f')]!==_0xab31('0x40')){var _0x12d080={};_0x12d080[_0x579e3d[_0xab31('0x2b')]]={'$like':'%'+_0x30473c[_0xab31('0x34')]['filter']+'%'};return _0x12d080;}})});}_0x429af1=_[_0xab31('0x3e')]({},_0x429af1,_0x30473c['options']);var _0xdbb587={'where':_0x429af1[_0xab31('0x3d')]};return db[_0xab31('0x2f')][_0xab31('0x22')](_0xdbb587)['then'](function(_0x4890c4){_0x31d29d[_0xab31('0x22')]=_0x4890c4;if(_0x30473c[_0xab31('0x34')][_0xab31('0x41')]){_0x429af1[_0xab31('0x42')]=[{'all':!![]}];}return db[_0xab31('0x2f')][_0xab31('0x43')](_0x429af1);})[_0xab31('0x28')](function(_0x5ba385){_0x31d29d['rows']=_0x5ba385;return _0x31d29d;})[_0xab31('0x28')](respondWithFilteredResult(_0x24d22c,_0x429af1))['catch'](handleError(_0x24d22c,null));};exports[_0xab31('0x44')]=function(_0x2681fc,_0x3c9b25){var _0x4ecbf9={'raw':![],'where':{'id':_0x2681fc[_0xab31('0x45')]['id']}},_0x63499b={};_0x63499b[_0xab31('0x33')]=_['keys'](db['Dynamics365Account'][_0xab31('0x30')]);_0x63499b[_0xab31('0x34')]=_[_0xab31('0x35')](_0x2681fc['query']);_0x63499b[_0xab31('0x36')]=_['intersection'](_0x63499b['model'],_0x63499b[_0xab31('0x34')]);_0x4ecbf9[_0xab31('0x38')]=_[_0xab31('0x37')](_0x63499b[_0xab31('0x33')],qs[_0xab31('0x39')](_0x2681fc[_0xab31('0x34')][_0xab31('0x39')]));_0x4ecbf9[_0xab31('0x38')]=_0x4ecbf9[_0xab31('0x38')][_0xab31('0x3a')]?_0x4ecbf9['attributes']:_0x63499b[_0xab31('0x33')];if(_0x2681fc[_0xab31('0x34')]['includeAll']){_0x4ecbf9[_0xab31('0x42')]=[{'all':!![]}];}_0x4ecbf9=_[_0xab31('0x3e')]({},_0x4ecbf9,_0x2681fc['options']);return db[_0xab31('0x2f')][_0xab31('0x46')](_0x4ecbf9)[_0xab31('0x28')](handleEntityNotFound(_0x3c9b25,null))[_0xab31('0x28')](respondWithResult(_0x3c9b25,null))[_0xab31('0x47')](handleError(_0x3c9b25,null));};exports['create']=function(_0x11a657,_0x226fd6){return db[_0xab31('0x2f')][_0xab31('0x48')](_0x11a657[_0xab31('0x49')],{})[_0xab31('0x28')](respondWithResult(_0x226fd6,0xc9))['catch'](handleError(_0x226fd6,null));};exports[_0xab31('0x27')]=function(_0x491b5b,_0x306eb8){if(_0x491b5b['body']['id']){delete _0x491b5b[_0xab31('0x49')]['id'];}return db['Dynamics365Account'][_0xab31('0x46')]({'where':{'id':_0x491b5b[_0xab31('0x45')]['id']}})['then'](handleEntityNotFound(_0x306eb8,null))[_0xab31('0x28')](saveUpdates(_0x491b5b[_0xab31('0x49')],null))[_0xab31('0x28')](respondWithResult(_0x306eb8,null))[_0xab31('0x47')](handleError(_0x306eb8,null));};exports[_0xab31('0x29')]=function(_0x242cf9,_0x3a3c36){return db['Dynamics365Account'][_0xab31('0x46')]({'where':{'id':_0x242cf9['params']['id']}})[_0xab31('0x28')](handleEntityNotFound(_0x3a3c36,null))[_0xab31('0x28')](removeEntity(_0x3a3c36,null))[_0xab31('0x47')](handleError(_0x3a3c36,null));};exports[_0xab31('0x4a')]=function(_0x1bb8df,_0x2d1cad,_0x50f7da){var _0xaefa91={};var _0x1eaa05={};var _0x122a80;var _0x78fa85;return db[_0xab31('0x2f')]['findOne']({'where':{'id':_0x1bb8df['params']['id']}})[_0xab31('0x28')](handleEntityNotFound(_0x2d1cad,null))[_0xab31('0x28')](function(_0x65d550){if(_0x65d550){_0x122a80=_0x65d550;_0x1eaa05[_0xab31('0x33')]=_[_0xab31('0x35')](db[_0xab31('0x4b')][_0xab31('0x30')]);_0x1eaa05[_0xab31('0x34')]=_['keys'](_0x1bb8df[_0xab31('0x34')]);_0x1eaa05['filters']=_[_0xab31('0x37')](_0x1eaa05[_0xab31('0x33')],_0x1eaa05['query']);_0xaefa91[_0xab31('0x38')]=_[_0xab31('0x37')](_0x1eaa05['model'],qs[_0xab31('0x39')](_0x1bb8df[_0xab31('0x34')]['fields']));_0xaefa91[_0xab31('0x38')]=_0xaefa91['attributes'][_0xab31('0x3a')]?_0xaefa91[_0xab31('0x38')]:_0x1eaa05[_0xab31('0x33')];_0xaefa91[_0xab31('0x4c')]=qs[_0xab31('0x3c')](_0x1bb8df['query'][_0xab31('0x3c')]);_0xaefa91[_0xab31('0x3d')]=qs[_0xab31('0x36')](_[_0xab31('0x4d')](_0x1bb8df['query'],_0x1eaa05[_0xab31('0x36')]));if(_0x1bb8df[_0xab31('0x34')][_0xab31('0x4e')]){_0xaefa91[_0xab31('0x3d')]=_[_0xab31('0x3e')](_0xaefa91[_0xab31('0x3d')],{'$or':_[_0xab31('0x2e')](_0xaefa91[_0xab31('0x38')],function(_0x3b476e){var _0x4e44af={};_0x4e44af[_0x3b476e]={'$like':'%'+_0x1bb8df[_0xab31('0x34')][_0xab31('0x4e')]+'%'};return _0x4e44af;})});}_0xaefa91=_[_0xab31('0x3e')]({},_0xaefa91,_0x1bb8df[_0xab31('0x4f')]);return _0x122a80[_0xab31('0x4a')](_0xaefa91);}})[_0xab31('0x28')](function(_0x1173ff){if(_0x1173ff){_0x78fa85=_0x1173ff[_0xab31('0x3a')];if(!_0x1bb8df[_0xab31('0x34')][_0xab31('0x3b')]('nolimit')){_0xaefa91['limit']=qs[_0xab31('0x21')](_0x1bb8df[_0xab31('0x34')][_0xab31('0x21')]);_0xaefa91[_0xab31('0x1f')]=qs['offset'](_0x1bb8df['query']['offset']);}return _0x122a80[_0xab31('0x4a')](_0xaefa91);}})['then'](function(_0x2d3fc3){if(_0x2d3fc3){return _0x2d3fc3?{'count':_0x78fa85,'rows':_0x2d3fc3}:null;}})[_0xab31('0x28')](respondWithResult(_0x2d1cad,null))[_0xab31('0x47')](handleError(_0x2d1cad,null));};exports[_0xab31('0x50')]=function(_0x41733a,_0x236804,_0x5b27ab){if(_0x41733a['body']['id']){delete _0x41733a[_0xab31('0x49')]['id'];}return db[_0xab31('0x2f')][_0xab31('0x51')]({'where':{'id':_0x41733a[_0xab31('0x45')]['id']}})[_0xab31('0x28')](handleEntityNotFound(_0x236804,null))['then'](function(_0xbc00b4){if(_0xbc00b4){_0x41733a[_0xab31('0x49')][_0xab31('0x52')]=_0xbc00b4['id'];_0x41733a[_0xab31('0x49')][_0xab31('0x53')]=integrations[_0xab31('0x54')](_0x41733a[_0xab31('0x49')][_0xab31('0x55')],_0x41733a[_0xab31('0x49')]['type']);_0x41733a[_0xab31('0x49')]['Descriptions']=integrations[_0xab31('0x56')](_0x41733a[_0xab31('0x49')]['channel'],_0x41733a[_0xab31('0x49')][_0xab31('0x3f')]);return db[_0xab31('0x4b')][_0xab31('0x48')](_0x41733a[_0xab31('0x49')],{'include':[{'model':db[_0xab31('0x57')],'as':_0xab31('0x53')},{'model':db[_0xab31('0x57')],'as':_0xab31('0x58')}]});}return null;})[_0xab31('0x28')](respondWithResult(_0x236804,null))[_0xab31('0x47')](handleError(_0x236804,null));};exports[_0xab31('0x59')]=function(_0x2e628a,_0x4160b1,_0x57dca8){var _0x2765f4=_0x2e628a['query']['ticketType'];var _0x3ec75f=_0x2765f4===_0xab31('0x5a')?_0xab31('0x5b'):_0xab31('0x5c');var _0x1be3a0='';var _0x2b8f29='';var _0x2051f6='';var _0x342717='';var _0x29a5a5='';var _0x17207c='';var _0x1be045='';var _0x33fb8d='';var _0x2c3074=['title',_0xab31('0x5d'),_0xab31('0x5e'),'ownerid',_0xab31('0x5f'),_0xab31('0x60'),_0xab31('0x61'),'regardingobjectid','directioncode','phonecall_activity_parties'];var _0x4b26e0=['accountidname',_0xab31('0x62'),_0xab31('0x63'),_0xab31('0x64'),_0xab31('0x65'),_0xab31('0x66'),'contractdetailidname',_0xab31('0x67'),_0xab31('0x68'),_0xab31('0x69'),'createdbyname','createdbyyominame',_0xab31('0x6a'),_0xab31('0x6b'),_0xab31('0x6c'),'customeridname',_0xab31('0x6d'),_0xab31('0x6e'),_0xab31('0x6f'),'entitlementidname',_0xab31('0x70'),_0xab31('0x71'),_0xab31('0x72'),_0xab31('0x73'),_0xab31('0x74'),'followupby',_0xab31('0x75'),_0xab31('0x76'),_0xab31('0x77'),'lastonholdtime',_0xab31('0x78'),_0xab31('0x79'),'modifiedbyexternalpartyyominame','modifiedbyname',_0xab31('0x7a'),_0xab31('0x7b'),_0xab31('0x7c'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0xab31('0x7d'),_0xab31('0x7e'),_0xab31('0x7f'),'overriddencreatedon',_0xab31('0x80'),_0xab31('0x81'),_0xab31('0x82'),_0xab31('0x83'),_0xab31('0x84'),_0xab31('0x85'),_0xab31('0x86'),_0xab31('0x87'),'productserialnumber',_0xab31('0x88'),_0xab31('0x89'),_0xab31('0x8a'),_0xab31('0x8b'),_0xab31('0x8c'),_0xab31('0x8d'),_0xab31('0x8e'),_0xab31('0x8f'),_0xab31('0x90'),_0xab31('0x91'),_0xab31('0x92'),_0xab31('0x93'),_0xab31('0x94'),_0xab31('0x95'),_0xab31('0x96'),'traversedpath',_0xab31('0x97'),_0xab31('0x98')];var _0xf035e=_0x2c3074[_0xab31('0x99')](_0x4b26e0);return db[_0xab31('0x2f')][_0xab31('0x51')]({'where':{'id':_0x2e628a['params']['id']},'attributes':['id',_0xab31('0x9a'),_0xab31('0x9b'),'remoteUri',_0xab31('0x9c'),_0xab31('0x9d'),_0xab31('0x9e')]})[_0xab31('0x28')](handleEntityNotFound(_0x4160b1,null))[_0xab31('0x28')](function(_0x5b9783){if(_0x5b9783){_0x33fb8d=_0x5b9783['remoteUri'];var _0x1f3ce9=_0x33fb8d[_0xab31('0x9f')](-0x1);if(_0x1f3ce9==='/'){_0x33fb8d=_0x33fb8d[_0xab31('0xa0')](0x0,_0x33fb8d[_0xab31('0xa1')](_0x1f3ce9));}_0x1be045=util[_0xab31('0xa2')](_0xab31('0xa3'),_0x33fb8d);var _0x1f3ca7={'method':_0xab31('0xa4'),'uri':_0xab31('0xa5')+_0x5b9783['tenantId']+_0xab31('0xa6'),'form':{'client_id':_0x5b9783[_0xab31('0x9d')],'resource':_0x33fb8d,'username':_0x5b9783[_0xab31('0x9a')],'password':_0x5b9783[_0xab31('0x9b')],'grant_type':_0xab31('0x9b'),'client_secret':_0x5b9783[_0xab31('0x9e')]},'json':!![]};return rp(_0x1f3ca7);}})[_0xab31('0x28')](function(_0x3dc8ff){_0x17207c=_0x3dc8ff[_0xab31('0xa7')];var _0x5b670f={'method':_0xab31('0xa8'),'uri':encodeURI(_0x1be045+_0xab31('0xa9')+_0x3ec75f+'\x27'),'headers':{'Authorization':_0xab31('0xaa')+_0x17207c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5b670f);})[_0xab31('0x28')](function(_0x9a5a62){var _0x59fa43=_0x9a5a62[_0xab31('0xab')][0x0];var _0x123c07=_0x59fa43[_0xab31('0xac')];var _0x303598={'method':_0xab31('0xa8'),'uri':_0x1be045+_0xab31('0xad')+_0x123c07+_0xab31('0xae'),'headers':{'Authorization':_0xab31('0xaa')+_0x17207c,'If-None-Match':null,'OData-Version':_0xab31('0xaf')},'json':!![]};return rp(_0x303598);})[_0xab31('0x28')](function(_0x2db5e9){_0x1be3a0=_0x2db5e9;_0x2b8f29=_0x1be3a0[_0xab31('0xb0')];_0x2b8f29=_['remove'](_0x2b8f29,function(_0x56859b){return!_0xf035e[_0xab31('0xb1')](_0x56859b[_0xab31('0xb2')]);});var _0x4b4cd0=[];var _0x195f28=[];_0x2b8f29[_0xab31('0xb3')](function(_0x4519ff){if(_0x4519ff[_0xab31('0xb4')]){var _0x479965=_0x4519ff['@odata.type'][_0xab31('0xa0')](_0x4519ff['@odata.type'][_0xab31('0xa1')]('.')+0x1);if(_0x479965==='PicklistAttributeMetadata'){_0x4b4cd0['push'](getSelectList(_0x1be045,_0x2765f4,_0x195f28,_0x1be3a0[_0xab31('0xac')],_0x4519ff[_0xab31('0xac')],_0x17207c));}}});return Promise[_0xab31('0xb5')](_0x4b4cd0);})[_0xab31('0x28')](function(_0x58a680){_0x2051f6=_0x58a680[0x0];var _0x46839d=[];var _0x5dff37=[];_0x2b8f29['forEach'](function(_0x32d9f9){if(!_[_0xab31('0xb6')](_0x32d9f9[_0xab31('0xb4')])){var _0x8c3b81=_0x32d9f9[_0xab31('0xb4')][_0xab31('0xa0')](_0x32d9f9[_0xab31('0xb4')][_0xab31('0xa1')]('.')+0x1);if(_0x8c3b81===_0xab31('0xb7')){_0x46839d[_0xab31('0xb8')](getBooleanList(_0x1be045,_0x2765f4,_0x5dff37,_0x1be3a0['MetadataId'],_0x32d9f9[_0xab31('0xac')],_0x17207c));}}});return Promise[_0xab31('0xb5')](_0x46839d);})[_0xab31('0x28')](function(_0x755837){_0x342717=_0x755837[0x0];var _0xa781da=[];var _0x34ef46=[];_0x2b8f29[_0xab31('0xb3')](function(_0x477eef){if(_0x477eef[_0xab31('0xb4')]){var _0x3de882=_0x477eef[_0xab31('0xb4')][_0xab31('0xa0')](_0x477eef[_0xab31('0xb4')][_0xab31('0xa1')]('.')+0x1);if(_0x3de882===_0xab31('0xb9')||_0x3de882==='DoubleAttributeMetadata'||_0x3de882===_0xab31('0xba')||_0x3de882===_0xab31('0xbb')||_0x3de882==='MemoAttributeMetadata'||_0x3de882==='DateTimeAttributeMetadata'||_0x3de882===_0xab31('0xbc')||_0x3de882===_0xab31('0xbd')||_0x3de882===_0xab31('0xbe')||_0x3de882===_0xab31('0xbf')){_0xa781da[_0xab31('0xb8')](getInputList(_0x1be045,_0x2765f4,_0x3de882,_0x34ef46,_0x1be3a0[_0xab31('0xac')],_0x477eef[_0xab31('0xac')],_0x17207c));}}});return Promise[_0xab31('0xb5')](_0xa781da);})[_0xab31('0x28')](function(_0x394b22){_0x29a5a5=_0x394b22[0x0];var _0x32d1e1=_0x2051f6['concat'](_0x342717)[_0xab31('0x99')](_0x29a5a5);var _0x3dbc81={'count':_0x32d1e1[_0xab31('0x3a')],'rows':_0x32d1e1};return _0x3dbc81;})[_0xab31('0x28')](respondWithResult(_0x4160b1,null))[_0xab31('0x47')](function(_0x58d3bd){var _0x466a6e=_0x2e628a[_0xab31('0x34')]['test']?0x1f4:_0x58d3bd[_0xab31('0xc0')]||0x1f4;logger[_0xab31('0xc1')](_0x58d3bd[_0xab31('0x2a')]);delete _0x58d3bd[_0xab31('0x2b')];if(_0x466a6e===0x191){_0x466a6e=0x190;}_0x4160b1[_0xab31('0x1d')](_0x466a6e)[_0xab31('0x2c')](_0x2e628a[_0xab31('0x34')]['test']?{'message':_0xab31('0xc2'),'statusCode':_0x58d3bd[_0xab31('0xc0')]}:_0x58d3bd);});};function getSelectList(_0x3c2131,_0x4ebd8b,_0x151e16,_0xe5e18b,_0x191fac,_0x5ecafe){var _0x5013f5={'method':'GET','uri':_0x3c2131+_0xab31('0xad')+_0xe5e18b+_0xab31('0xc3')+_0x191fac+_0xab31('0xc4')+_0xab31('0xc5'),'headers':{'Authorization':_0xab31('0xaa')+_0x5ecafe,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5013f5)[_0xab31('0x28')](function(_0x4fb60a){var _0x24dece=[];var _0x1bf370=_0x4fb60a[_0xab31('0xc6')][_0xab31('0xc7')];_0x1bf370['forEach'](function(_0x380682){_0x24dece[_0xab31('0xb8')]({'name':_0x380682[_0xab31('0xc8')][_0xab31('0xc9')]['Label'],'value':String(_0x380682[_0xab31('0xca')])});});var _0x1f0e97={'id':_0x4ebd8b+'_'+_0x4fb60a[_0xab31('0xb2')],'name':_0x4fb60a[_0xab31('0xcb')]['UserLocalizedLabel'][_0xab31('0xc8')],'custom':![],'options':_0x24dece};_0x151e16[_0xab31('0xb8')](_0x1f0e97);return _0x151e16;});}function getBooleanList(_0x4f1c63,_0x2df79e,_0x1e225b,_0x3fb9c6,_0x551e85,_0x3480a9){var _0x3013e9={'method':'GET','uri':_0x4f1c63+'EntityDefinitions('+_0x3fb9c6+_0xab31('0xc3')+_0x551e85+_0xab31('0xcc'),'headers':{'Authorization':'Bearer\x20'+_0x3480a9,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3013e9)[_0xab31('0x28')](function(_0x577845){var _0x1762a0=[];_0x1762a0[_0xab31('0xb8')]({'name':_0x577845['OptionSet'][_0xab31('0xcd')]['Label']['UserLocalizedLabel'][_0xab31('0xc8')],'value':_0xab31('0xce')},{'name':_0x577845[_0xab31('0xc6')][_0xab31('0xcf')]['Label'][_0xab31('0xc9')][_0xab31('0xc8')],'value':_0xab31('0xd0')});var _0x45c4dc={'id':_0x2df79e+'_'+_0x577845['LogicalName'],'name':_0x577845[_0xab31('0xcb')][_0xab31('0xc9')][_0xab31('0xc8')],'custom':![],'options':_0x1762a0};_0x1e225b['push'](_0x45c4dc);return _0x1e225b;});}function getInputList(_0xe2b64f,_0x515cc8,_0x3ddd58,_0x1569b4,_0x359622,_0x5430da,_0x1d915b){var _0x1935ee={'method':_0xab31('0xa8'),'uri':_0xe2b64f+_0xab31('0xad')+_0x359622+_0xab31('0xc3')+_0x5430da+')/Microsoft.Dynamics.CRM.'+_0x3ddd58+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xab31('0xaa')+_0x1d915b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1935ee)[_0xab31('0x28')](function(_0xbeb934){var _0x18bf1c={'id':_0x515cc8+'_'+_0xbeb934[_0xab31('0xb2')],'name':_0xbeb934[_0xab31('0xcb')][_0xab31('0xc9')]?_0xbeb934[_0xab31('0xcb')][_0xab31('0xc9')]['Label']:_0xbeb934[_0xab31('0xb2')],'custom':![],'options':[]};_0x1569b4[_0xab31('0xb8')](_0x18bf1c);return _0x1569b4;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 6bb0a2a..0086244 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 _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x27439d,_0xf9af53){var _0x298879=function(_0x216db0){while(--_0x216db0){_0x27439d['push'](_0x27439d['shift']());}};_0x298879(++_0xf9af53);}(_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('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x17e078,_0x7b6acd){var _0x5bc405=function(_0x2d6498){while(--_0x2d6498){_0x17e078['push'](_0x17e078['shift']());}};_0x5bc405(++_0x7b6acd);}(_0x757a,0xde));var _0xa757=function(_0x3439ba,_0x196adb){_0x3439ba=_0x3439ba-0x0;var _0x55cd6b=_0x757a[_0x3439ba];return _0x55cd6b;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'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 d5f097f..66ee458 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 _0xd290=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','include','map','model','find','ShowDynamics365Account','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5db560,_0x2f0774){var _0x410ca0=function(_0x1e7686){while(--_0x1e7686){_0x5db560['push'](_0x5db560['shift']());}};_0x410ca0(++_0x2f0774);}(_0xd290,0x18f));var _0x0d29=function(_0xaba6aa,_0x2af73d){_0xaba6aa=_0xaba6aa-0x0;var _0x5aaa65=_0xd290[_0xaba6aa];return _0x5aaa65;};'use strict';var _=require(_0x0d29('0x0'));var util=require(_0x0d29('0x1'));var moment=require(_0x0d29('0x2'));var BPromise=require('bluebird');var rs=require(_0x0d29('0x3'));var fs=require('fs');var Redis=require(_0x0d29('0x4'));var db=require(_0x0d29('0x5'))['db'];var utils=require(_0x0d29('0x6'));var logger=require(_0x0d29('0x7'))(_0x0d29('0x8'));var config=require(_0x0d29('0x9'));var jayson=require(_0x0d29('0xa'));var client=jayson[_0x0d29('0xb')][_0x0d29('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x24d2db,_0x584ee3,_0x3ee881){return new BPromise(function(_0xd5c9b1,_0x4360c3){return client[_0x0d29('0xd')](_0x24d2db,_0x3ee881)[_0x0d29('0xe')](function(_0x1907c2){logger[_0x0d29('0xf')](_0x0d29('0x10'),_0x584ee3,_0x0d29('0x11'));logger[_0x0d29('0x12')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x584ee3,_0x0d29('0x11'),JSON[_0x0d29('0x13')](_0x1907c2));if(_0x1907c2['error']){if(_0x1907c2['error'][_0x0d29('0x14')]===0x1f4){logger[_0x0d29('0x15')](_0x0d29('0x10'),_0x584ee3,_0x1907c2[_0x0d29('0x15')][_0x0d29('0x16')]);return _0x4360c3(_0x1907c2['error'][_0x0d29('0x16')]);}logger[_0x0d29('0x15')](_0x0d29('0x10'),_0x584ee3,_0x1907c2[_0x0d29('0x15')][_0x0d29('0x16')]);return _0xd5c9b1(_0x1907c2[_0x0d29('0x15')][_0x0d29('0x16')]);}else{logger[_0x0d29('0xf')](_0x0d29('0x10'),_0x584ee3,'request\x20sent');_0xd5c9b1(_0x1907c2[_0x0d29('0x17')][_0x0d29('0x16')]);}})['catch'](function(_0x40919b){logger[_0x0d29('0x15')](_0x0d29('0x10'),_0x584ee3,_0x40919b);_0x4360c3(_0x40919b);});});}exports[_0x0d29('0x18')]=function(_0x5bb7c4){var _0x4c59c3=this;return new Promise(function(_0x69f452,_0x233e8d){return db[_0x0d29('0x19')][_0x0d29('0x1a')]({'raw':_0x5bb7c4['options']?_0x5bb7c4[_0x0d29('0x1b')][_0x0d29('0x1c')]===undefined?!![]:![]:!![],'where':_0x5bb7c4[_0x0d29('0x1b')]?_0x5bb7c4[_0x0d29('0x1b')][_0x0d29('0x1d')]||null:null,'attributes':_0x5bb7c4[_0x0d29('0x1b')]?_0x5bb7c4[_0x0d29('0x1b')][_0x0d29('0x1e')]||null:null,'limit':_0x5bb7c4['options']?_0x5bb7c4[_0x0d29('0x1b')]['limit']||null:null,'include':_0x5bb7c4[_0x0d29('0x1b')]?_0x5bb7c4[_0x0d29('0x1b')][_0x0d29('0x1f')]?_[_0x0d29('0x20')](_0x5bb7c4[_0x0d29('0x1b')]['include'],function(_0x65878d){return{'model':db[_0x65878d[_0x0d29('0x21')]],'as':_0x65878d['as'],'attributes':_0x65878d[_0x0d29('0x1e')],'include':_0x65878d[_0x0d29('0x1f')]?_[_0x0d29('0x20')](_0x65878d[_0x0d29('0x1f')],function(_0x1199c2){return{'model':db[_0x1199c2[_0x0d29('0x21')]],'as':_0x1199c2['as'],'attributes':_0x1199c2[_0x0d29('0x1e')],'include':_0x1199c2[_0x0d29('0x1f')]?_[_0x0d29('0x20')](_0x1199c2[_0x0d29('0x1f')],function(_0x3d9567){return{'model':db[_0x3d9567[_0x0d29('0x21')]],'as':_0x3d9567['as'],'attributes':_0x3d9567['attributes']};}):[]};}):[]};}):[]:[]})[_0x0d29('0xe')](function(_0x6ee750){logger[_0x0d29('0xf')](_0x0d29('0x18'),_0x5bb7c4);logger['debug']('GetDynamics365Account',_0x5bb7c4,JSON[_0x0d29('0x13')](_0x6ee750));_0x69f452(_0x6ee750);})['catch'](function(_0x2bae3a){logger[_0x0d29('0x15')]('GetDynamics365Account',_0x2bae3a[_0x0d29('0x16')],_0x5bb7c4);_0x233e8d(_0x4c59c3[_0x0d29('0x15')](0x1f4,_0x2bae3a['message']));});});};exports['ShowDynamics365Account']=function(_0xd285cc){var _0x197725=this;return new Promise(function(_0x2b94a6,_0x1cfc8b){return db[_0x0d29('0x19')][_0x0d29('0x22')]({'raw':_0xd285cc[_0x0d29('0x1b')]?_0xd285cc[_0x0d29('0x1b')][_0x0d29('0x1c')]===undefined?!![]:![]:!![],'where':_0xd285cc[_0x0d29('0x1b')]?_0xd285cc['options']['where']||null:null,'attributes':_0xd285cc['options']?_0xd285cc['options'][_0x0d29('0x1e')]||null:null,'include':_0xd285cc[_0x0d29('0x1b')]?_0xd285cc[_0x0d29('0x1b')][_0x0d29('0x1f')]?_[_0x0d29('0x20')](_0xd285cc['options'][_0x0d29('0x1f')],function(_0x1f09f7){return{'model':db[_0x1f09f7[_0x0d29('0x21')]],'as':_0x1f09f7['as'],'attributes':_0x1f09f7['attributes'],'include':_0x1f09f7[_0x0d29('0x1f')]?_[_0x0d29('0x20')](_0x1f09f7[_0x0d29('0x1f')],function(_0x25b190){return{'model':db[_0x25b190[_0x0d29('0x21')]],'as':_0x25b190['as'],'attributes':_0x25b190[_0x0d29('0x1e')],'include':_0x25b190['include']?_['map'](_0x25b190['include'],function(_0x183c80){return{'model':db[_0x183c80['model']],'as':_0x183c80['as'],'attributes':_0x183c80[_0x0d29('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0d29('0xe')](function(_0x5ba470){logger['info'](_0x0d29('0x23'),_0xd285cc);logger[_0x0d29('0x12')](_0x0d29('0x23'),_0xd285cc,JSON[_0x0d29('0x13')](_0x5ba470));_0x2b94a6(_0x5ba470);})[_0x0d29('0x24')](function(_0x38f933){logger[_0x0d29('0x15')](_0x0d29('0x23'),_0x38f933[_0x0d29('0x16')],_0xd285cc);_0x1cfc8b(_0x197725[_0x0d29('0x15')](0x1f4,_0x38f933[_0x0d29('0x16')]));});});}; \ No newline at end of file +var _0x1ee0=['model','then','debug','ShowDynamics365Account','find','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1ee0,0x182));var _0x01ee=function(_0x2d0794,_0x4215e2){_0x2d0794=_0x2d0794-0x0;var _0x5ced85=_0x1ee0[_0x2d0794];return _0x5ced85;};'use strict';var _=require(_0x01ee('0x0'));var util=require(_0x01ee('0x1'));var moment=require(_0x01ee('0x2'));var BPromise=require(_0x01ee('0x3'));var rs=require(_0x01ee('0x4'));var fs=require('fs');var Redis=require(_0x01ee('0x5'));var db=require(_0x01ee('0x6'))['db'];var utils=require(_0x01ee('0x7'));var logger=require(_0x01ee('0x8'))(_0x01ee('0x9'));var config=require(_0x01ee('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x01ee('0xb')][_0x01ee('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3baf34,_0x369a5e,_0x2dae45){return new BPromise(function(_0x5e261d,_0xb70139){return client[_0x01ee('0xd')](_0x3baf34,_0x2dae45)['then'](function(_0x5e83e7){logger[_0x01ee('0xe')](_0x01ee('0xf'),_0x369a5e,'request\x20sent');logger['debug'](_0x01ee('0x10'),_0x369a5e,_0x01ee('0x11'),JSON[_0x01ee('0x12')](_0x5e83e7));if(_0x5e83e7[_0x01ee('0x13')]){if(_0x5e83e7[_0x01ee('0x13')][_0x01ee('0x14')]===0x1f4){logger[_0x01ee('0x13')]('Dynamics365Account,\x20%s,\x20%s',_0x369a5e,_0x5e83e7['error'][_0x01ee('0x15')]);return _0xb70139(_0x5e83e7[_0x01ee('0x13')][_0x01ee('0x15')]);}logger[_0x01ee('0x13')](_0x01ee('0xf'),_0x369a5e,_0x5e83e7['error'][_0x01ee('0x15')]);return _0x5e261d(_0x5e83e7[_0x01ee('0x13')]['message']);}else{logger[_0x01ee('0xe')](_0x01ee('0xf'),_0x369a5e,'request\x20sent');_0x5e261d(_0x5e83e7['result'][_0x01ee('0x15')]);}})['catch'](function(_0x3fc16c){logger[_0x01ee('0x13')](_0x01ee('0xf'),_0x369a5e,_0x3fc16c);_0xb70139(_0x3fc16c);});});}exports[_0x01ee('0x16')]=function(_0x2fc225){var _0x11ebad=this;return new Promise(function(_0x368d12,_0x1f237b){return db[_0x01ee('0x17')][_0x01ee('0x18')]({'raw':_0x2fc225[_0x01ee('0x19')]?_0x2fc225[_0x01ee('0x19')][_0x01ee('0x1a')]===undefined?!![]:![]:!![],'where':_0x2fc225[_0x01ee('0x19')]?_0x2fc225[_0x01ee('0x19')][_0x01ee('0x1b')]||null:null,'attributes':_0x2fc225[_0x01ee('0x19')]?_0x2fc225[_0x01ee('0x19')][_0x01ee('0x1c')]||null:null,'limit':_0x2fc225[_0x01ee('0x19')]?_0x2fc225['options'][_0x01ee('0x1d')]||null:null,'include':_0x2fc225[_0x01ee('0x19')]?_0x2fc225[_0x01ee('0x19')][_0x01ee('0x1e')]?_[_0x01ee('0x1f')](_0x2fc225[_0x01ee('0x19')][_0x01ee('0x1e')],function(_0x32a66f){return{'model':db[_0x32a66f[_0x01ee('0x20')]],'as':_0x32a66f['as'],'attributes':_0x32a66f[_0x01ee('0x1c')],'include':_0x32a66f[_0x01ee('0x1e')]?_[_0x01ee('0x1f')](_0x32a66f[_0x01ee('0x1e')],function(_0x36219e){return{'model':db[_0x36219e[_0x01ee('0x20')]],'as':_0x36219e['as'],'attributes':_0x36219e[_0x01ee('0x1c')],'include':_0x36219e['include']?_[_0x01ee('0x1f')](_0x36219e[_0x01ee('0x1e')],function(_0x4305e5){return{'model':db[_0x4305e5[_0x01ee('0x20')]],'as':_0x4305e5['as'],'attributes':_0x4305e5[_0x01ee('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x01ee('0x21')](function(_0x4ecbc7){logger['info']('GetDynamics365Account',_0x2fc225);logger[_0x01ee('0x22')](_0x01ee('0x16'),_0x2fc225,JSON[_0x01ee('0x12')](_0x4ecbc7));_0x368d12(_0x4ecbc7);})['catch'](function(_0x154adf){logger[_0x01ee('0x13')](_0x01ee('0x16'),_0x154adf[_0x01ee('0x15')],_0x2fc225);_0x1f237b(_0x11ebad[_0x01ee('0x13')](0x1f4,_0x154adf[_0x01ee('0x15')]));});});};exports[_0x01ee('0x23')]=function(_0x3435ec){var _0x476206=this;return new Promise(function(_0x400b58,_0x1e3d49){return db[_0x01ee('0x17')][_0x01ee('0x24')]({'raw':_0x3435ec[_0x01ee('0x19')]?_0x3435ec[_0x01ee('0x19')][_0x01ee('0x1a')]===undefined?!![]:![]:!![],'where':_0x3435ec[_0x01ee('0x19')]?_0x3435ec[_0x01ee('0x19')][_0x01ee('0x1b')]||null:null,'attributes':_0x3435ec['options']?_0x3435ec[_0x01ee('0x19')]['attributes']||null:null,'include':_0x3435ec['options']?_0x3435ec[_0x01ee('0x19')][_0x01ee('0x1e')]?_['map'](_0x3435ec['options']['include'],function(_0x158f0e){return{'model':db[_0x158f0e[_0x01ee('0x20')]],'as':_0x158f0e['as'],'attributes':_0x158f0e[_0x01ee('0x1c')],'include':_0x158f0e['include']?_[_0x01ee('0x1f')](_0x158f0e['include'],function(_0x4cd664){return{'model':db[_0x4cd664[_0x01ee('0x20')]],'as':_0x4cd664['as'],'attributes':_0x4cd664[_0x01ee('0x1c')],'include':_0x4cd664[_0x01ee('0x1e')]?_[_0x01ee('0x1f')](_0x4cd664[_0x01ee('0x1e')],function(_0x5869c8){return{'model':db[_0x5869c8[_0x01ee('0x20')]],'as':_0x5869c8['as'],'attributes':_0x5869c8[_0x01ee('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x01ee('0x21')](function(_0x464074){logger[_0x01ee('0xe')](_0x01ee('0x23'),_0x3435ec);logger[_0x01ee('0x22')](_0x01ee('0x23'),_0x3435ec,JSON['stringify'](_0x464074));_0x400b58(_0x464074);})[_0x01ee('0x25')](function(_0x2a2874){logger['error'](_0x01ee('0x23'),_0x2a2874['message'],_0x3435ec);_0x1e3d49(_0x476206[_0x01ee('0x13')](0x1f4,_0x2a2874[_0x01ee('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 4a4bf64..a453604 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 _0xda11=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','destroy','multer'];(function(_0x13140c,_0x1f3748){var _0x3c6699=function(_0x354d41){while(--_0x354d41){_0x13140c['push'](_0x13140c['shift']());}};_0x3c6699(++_0x1f3748);}(_0xda11,0x18b));var _0x1da1=function(_0x14ce78,_0x4ab731){_0x14ce78=_0x14ce78-0x0;var _0x24d3dc=_0xda11[_0x14ce78];return _0x24d3dc;};'use strict';var multer=require(_0x1da1('0x0'));var util=require(_0x1da1('0x1'));var path=require(_0x1da1('0x2'));var timeout=require(_0x1da1('0x3'));var express=require(_0x1da1('0x4'));var router=express['Router']();var fs_extra=require(_0x1da1('0x5'));var auth=require(_0x1da1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1da1('0x7'));router[_0x1da1('0x8')]('/',auth[_0x1da1('0x9')](),controller[_0x1da1('0xa')]);router[_0x1da1('0x8')]('/:id',auth[_0x1da1('0x9')](),controller[_0x1da1('0xb')]);router[_0x1da1('0x8')]('/:id/fields',auth[_0x1da1('0x9')](),controller[_0x1da1('0xc')]);router['get'](_0x1da1('0xd'),auth[_0x1da1('0x9')](),controller['getSubjects']);router[_0x1da1('0x8')](_0x1da1('0xe'),auth['isAuthenticated'](),controller[_0x1da1('0xf')]);router[_0x1da1('0x10')]('/',auth[_0x1da1('0x9')](),controller[_0x1da1('0x11')]);router[_0x1da1('0x12')](_0x1da1('0x13'),auth[_0x1da1('0x9')](),controller[_0x1da1('0x14')]);router['delete'](_0x1da1('0x13'),auth[_0x1da1('0x9')](),controller[_0x1da1('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9265=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update'];(function(_0x106ac4,_0x205307){var _0x834b26=function(_0x25b432){while(--_0x25b432){_0x106ac4['push'](_0x106ac4['shift']());}};_0x834b26(++_0x205307);}(_0x9265,0x1b9));var _0x5926=function(_0x42ee0d,_0x5bb2d8){_0x42ee0d=_0x42ee0d-0x0;var _0x40c5e1=_0x9265[_0x42ee0d];return _0x40c5e1;};'use strict';var multer=require(_0x5926('0x0'));var util=require(_0x5926('0x1'));var path=require(_0x5926('0x2'));var timeout=require(_0x5926('0x3'));var express=require(_0x5926('0x4'));var router=express[_0x5926('0x5')]();var fs_extra=require(_0x5926('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5926('0x7'));router[_0x5926('0x8')]('/',auth[_0x5926('0x9')](),controller[_0x5926('0xa')]);router['get'](_0x5926('0xb'),auth[_0x5926('0x9')](),controller[_0x5926('0xc')]);router['get'](_0x5926('0xd'),auth[_0x5926('0x9')](),controller['getFields']);router[_0x5926('0x8')](_0x5926('0xe'),auth[_0x5926('0x9')](),controller[_0x5926('0xf')]);router['get'](_0x5926('0x10'),auth['isAuthenticated'](),controller[_0x5926('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5926('0x12')]);router[_0x5926('0x13')](_0x5926('0xb'),auth[_0x5926('0x9')](),controller[_0x5926('0x14')]);router['delete'](_0x5926('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x5926('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 50313b7..5e8177c 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 _0xf0c9=['exports','STRING','ENUM','incident','sequelize'];(function(_0x16be45,_0x453846){var _0x5426c0=function(_0x11c186){while(--_0x11c186){_0x16be45['push'](_0x16be45['shift']());}};_0x5426c0(++_0x453846);}(_0xf0c9,0x19e));var _0x9f0c=function(_0x2d13b1,_0x2678d5){_0x2d13b1=_0x2d13b1-0x0;var _0x18c844=_0xf0c9[_0x2d13b1];return _0x18c844;};'use strict';var Sequelize=require(_0x9f0c('0x0'));module[_0x9f0c('0x1')]={'name':{'type':Sequelize[_0x9f0c('0x2')]},'description':{'type':Sequelize[_0x9f0c('0x2')]},'ticketType':{'type':Sequelize[_0x9f0c('0x3')](_0x9f0c('0x4'),'phonecall'),'defaultValue':_0x9f0c('0x4')}}; \ No newline at end of file +var _0xf636=['sequelize','exports','STRING','incident','phonecall'];(function(_0x529abc,_0x17b97e){var _0x453afa=function(_0x536263){while(--_0x536263){_0x529abc['push'](_0x529abc['shift']());}};_0x453afa(++_0x17b97e);}(_0xf636,0xff));var _0x6f63=function(_0x34c1d1,_0x2b2a9d){_0x34c1d1=_0x34c1d1-0x0;var _0x2fddb2=_0xf636[_0x34c1d1];return _0x2fddb2;};'use strict';var Sequelize=require(_0x6f63('0x0'));module[_0x6f63('0x1')]={'name':{'type':Sequelize[_0x6f63('0x2')]},'description':{'type':Sequelize[_0x6f63('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x6f63('0x3'),_0x6f63('0x4')),'defaultValue':_0x6f63('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index db207e8..99190e1 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 _0x5013=['name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Dynamics365Configuration','include','rows','then','catch','show','keys','includeAll','find','body','params','destroy','findOne','Dynamics365Field','rawAttributes','getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack'];(function(_0x5d8ff8,_0x3650d4){var _0x59d862=function(_0x1ce3a7){while(--_0x1ce3a7){_0x5d8ff8['push'](_0x5d8ff8['shift']());}};_0x59d862(++_0x3650d4);}(_0x5013,0x120));var _0x3501=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x5013[_0x2cfb58];return _0xd99951;};'use strict';var emlformat=require(_0x3501('0x0'));var rimraf=require(_0x3501('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3501('0x2'));var rp=require('request-promise');var moment=require(_0x3501('0x3'));var BPromise=require(_0x3501('0x4'));var Mustache=require(_0x3501('0x5'));var util=require(_0x3501('0x6'));var path=require(_0x3501('0x7'));var sox=require(_0x3501('0x8'));var csv=require(_0x3501('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3501('0xa'));var _=require('lodash');var squel=require(_0x3501('0xb'));var crypto=require(_0x3501('0xc'));var jsforce=require(_0x3501('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3501('0x9'));var querystring=require(_0x3501('0xe'));var Papa=require(_0x3501('0xf'));var Redis=require(_0x3501('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3501('0x11'));var hardwareService=require(_0x3501('0x12'));var logger=require('../../config/logger')(_0x3501('0x13'));var utils=require(_0x3501('0x14'));var config=require(_0x3501('0x15'));var licenseUtil=require(_0x3501('0x16'));var db=require(_0x3501('0x17'))['db'];function respondWithStatusCode(_0x3b4ac0,_0x20c5fb){_0x20c5fb=_0x20c5fb||0xcc;return function(_0x363911){if(_0x363911){return _0x3b4ac0[_0x3501('0x18')](_0x20c5fb);}return _0x3b4ac0[_0x3501('0x19')](_0x20c5fb)[_0x3501('0x1a')]();};}function respondWithResult(_0x5d4ce4,_0x513793){_0x513793=_0x513793||0xc8;return function(_0x3f05f6){if(_0x3f05f6){return _0x5d4ce4['status'](_0x513793)[_0x3501('0x1b')](_0x3f05f6);}};}function respondWithFilteredResult(_0x309b90,_0x5dc61f){return function(_0x4dba48){if(_0x4dba48){var _0x10fec2=typeof _0x5dc61f[_0x3501('0x1c')]===_0x3501('0x1d')&&typeof _0x5dc61f[_0x3501('0x1e')]===_0x3501('0x1d');var _0x3d72ac=_0x4dba48[_0x3501('0x1f')];var _0x34ea99=_0x10fec2?0x0:_0x5dc61f[_0x3501('0x1c')];var _0xe6af24=_0x10fec2?_0x4dba48[_0x3501('0x1f')]:_0x5dc61f[_0x3501('0x1c')]+_0x5dc61f['limit'];var _0x3e243b;if(_0xe6af24>=_0x3d72ac){_0xe6af24=_0x3d72ac;_0x3e243b=0xc8;}else{_0x3e243b=0xce;}_0x309b90[_0x3501('0x19')](_0x3e243b);return _0x309b90[_0x3501('0x20')](_0x3501('0x21'),_0x34ea99+'-'+_0xe6af24+'/'+_0x3d72ac)[_0x3501('0x1b')](_0x4dba48);}return null;};}function patchUpdates(_0x2c174e){return function(_0x5b7654){try{jsonpatch[_0x3501('0x22')](_0x5b7654,_0x2c174e,!![]);}catch(_0x4a78aa){return BPromise[_0x3501('0x23')](_0x4a78aa);}return _0x5b7654[_0x3501('0x24')]();};}function saveUpdates(_0x57704b,_0x2b6bc0){return function(_0x2e1091){if(_0x2e1091){return _0x2e1091[_0x3501('0x25')](_0x57704b)['then'](function(_0x2aba13){return _0x2aba13;});}return null;};}function removeEntity(_0x2bcf37,_0xe50ea5){return function(_0x212c5f){if(_0x212c5f){return _0x212c5f['destroy']()['then'](function(){_0x2bcf37[_0x3501('0x19')](0xcc)[_0x3501('0x1a')]();});}};}function handleEntityNotFound(_0x4b5010,_0x1c36a8){return function(_0x262a58){if(!_0x262a58){_0x4b5010[_0x3501('0x18')](0x194);}return _0x262a58;};}function handleError(_0x276451,_0xda478a){_0xda478a=_0xda478a||0x1f4;return function(_0x16d245){logger[_0x3501('0x26')](_0x16d245[_0x3501('0x27')]);if(_0x16d245[_0x3501('0x28')]){delete _0x16d245[_0x3501('0x28')];}_0x276451[_0x3501('0x19')](_0xda478a)[_0x3501('0x29')](_0x16d245);};}exports[_0x3501('0x2a')]=function(_0x1dbd5d,_0x111a49){var _0x305e8a={},_0x59d05a={},_0x41e71a={'count':0x0,'rows':[]};var _0x2c5d1b=_[_0x3501('0x2b')](db['Dynamics365Configuration']['rawAttributes'],function(_0x234e2a){return{'name':_0x234e2a[_0x3501('0x2c')],'type':_0x234e2a[_0x3501('0x2d')][_0x3501('0x2e')]};});_0x59d05a[_0x3501('0x2f')]=_[_0x3501('0x2b')](_0x2c5d1b,_0x3501('0x28'));_0x59d05a[_0x3501('0x30')]=_['keys'](_0x1dbd5d[_0x3501('0x30')]);_0x59d05a[_0x3501('0x31')]=_[_0x3501('0x32')](_0x59d05a[_0x3501('0x2f')],_0x59d05a[_0x3501('0x30')]);_0x305e8a['attributes']=_[_0x3501('0x32')](_0x59d05a[_0x3501('0x2f')],qs[_0x3501('0x33')](_0x1dbd5d['query'][_0x3501('0x33')]));_0x305e8a[_0x3501('0x34')]=_0x305e8a['attributes'][_0x3501('0x35')]?_0x305e8a['attributes']:_0x59d05a['model'];if(!_0x1dbd5d[_0x3501('0x30')][_0x3501('0x36')](_0x3501('0x37'))){_0x305e8a[_0x3501('0x1e')]=qs['limit'](_0x1dbd5d[_0x3501('0x30')]['limit']);_0x305e8a[_0x3501('0x1c')]=qs[_0x3501('0x1c')](_0x1dbd5d[_0x3501('0x30')]['offset']);}_0x305e8a[_0x3501('0x38')]=qs[_0x3501('0x39')](_0x1dbd5d['query'][_0x3501('0x39')]);_0x305e8a[_0x3501('0x3a')]=qs[_0x3501('0x31')](_[_0x3501('0x3b')](_0x1dbd5d[_0x3501('0x30')],_0x59d05a[_0x3501('0x31')]),_0x2c5d1b);if(_0x1dbd5d[_0x3501('0x30')]['filter']){_0x305e8a['where']=_[_0x3501('0x3c')](_0x305e8a[_0x3501('0x3a')],{'$or':_[_0x3501('0x2b')](_0x2c5d1b,function(_0x161196){if(_0x161196['type']!==_0x3501('0x3d')){var _0x41796b={};_0x41796b[_0x161196[_0x3501('0x28')]]={'$like':'%'+_0x1dbd5d[_0x3501('0x30')][_0x3501('0x3e')]+'%'};return _0x41796b;}})});}_0x305e8a=_['merge']({},_0x305e8a,_0x1dbd5d[_0x3501('0x3f')]);var _0x126188={'where':_0x305e8a['where']};return db[_0x3501('0x40')][_0x3501('0x1f')](_0x126188)['then'](function(_0x128dfe){_0x41e71a[_0x3501('0x1f')]=_0x128dfe;if(_0x1dbd5d['query']['includeAll']){_0x305e8a[_0x3501('0x41')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x305e8a);})['then'](function(_0x3cb395){_0x41e71a[_0x3501('0x42')]=_0x3cb395;return _0x41e71a;})[_0x3501('0x43')](respondWithFilteredResult(_0x111a49,_0x305e8a))[_0x3501('0x44')](handleError(_0x111a49,null));};exports[_0x3501('0x45')]=function(_0x2ad7c2,_0x320414){var _0x45a5bb={'raw':![],'where':{'id':_0x2ad7c2['params']['id']}},_0x34aa81={};_0x34aa81[_0x3501('0x2f')]=_[_0x3501('0x46')](db[_0x3501('0x40')]['rawAttributes']);_0x34aa81[_0x3501('0x30')]=_[_0x3501('0x46')](_0x2ad7c2[_0x3501('0x30')]);_0x34aa81[_0x3501('0x31')]=_[_0x3501('0x32')](_0x34aa81[_0x3501('0x2f')],_0x34aa81['query']);_0x45a5bb[_0x3501('0x34')]=_[_0x3501('0x32')](_0x34aa81[_0x3501('0x2f')],qs['fields'](_0x2ad7c2[_0x3501('0x30')][_0x3501('0x33')]));_0x45a5bb[_0x3501('0x34')]=_0x45a5bb[_0x3501('0x34')][_0x3501('0x35')]?_0x45a5bb[_0x3501('0x34')]:_0x34aa81['model'];if(_0x2ad7c2[_0x3501('0x30')][_0x3501('0x47')]){_0x45a5bb[_0x3501('0x41')]=[{'all':!![]}];}_0x45a5bb=_[_0x3501('0x3c')]({},_0x45a5bb,_0x2ad7c2['options']);return db[_0x3501('0x40')][_0x3501('0x48')](_0x45a5bb)[_0x3501('0x43')](handleEntityNotFound(_0x320414,null))[_0x3501('0x43')](respondWithResult(_0x320414,null))[_0x3501('0x44')](handleError(_0x320414,null));};exports['create']=function(_0x198a45,_0x21576f){return db['Dynamics365Configuration']['create'](_0x198a45[_0x3501('0x49')],{})[_0x3501('0x43')](respondWithResult(_0x21576f,0xc9))['catch'](handleError(_0x21576f,null));};exports[_0x3501('0x25')]=function(_0x214d4b,_0x593ff7){if(_0x214d4b[_0x3501('0x49')]['id']){delete _0x214d4b[_0x3501('0x49')]['id'];}return db[_0x3501('0x40')]['find']({'where':{'id':_0x214d4b[_0x3501('0x4a')]['id']}})[_0x3501('0x43')](handleEntityNotFound(_0x593ff7,null))[_0x3501('0x43')](saveUpdates(_0x214d4b['body'],null))['then'](respondWithResult(_0x593ff7,null))['catch'](handleError(_0x593ff7,null));};exports[_0x3501('0x4b')]=function(_0x434b15,_0x104743){return db[_0x3501('0x40')]['find']({'where':{'id':_0x434b15[_0x3501('0x4a')]['id']}})[_0x3501('0x43')](handleEntityNotFound(_0x104743,null))[_0x3501('0x43')](removeEntity(_0x104743,null))[_0x3501('0x44')](handleError(_0x104743,null));};exports['getFields']=function(_0x48f457,_0x21edd1,_0x404f5b){var _0x213b72={};var _0x3b41a7={};var _0x1e303d;var _0x3b8660;return db[_0x3501('0x40')][_0x3501('0x4c')]({'where':{'id':_0x48f457[_0x3501('0x4a')]['id']}})[_0x3501('0x43')](handleEntityNotFound(_0x21edd1,null))[_0x3501('0x43')](function(_0x21127e){if(_0x21127e){_0x1e303d=_0x21127e;_0x3b41a7[_0x3501('0x2f')]=_[_0x3501('0x46')](db[_0x3501('0x4d')][_0x3501('0x4e')]);_0x3b41a7[_0x3501('0x30')]=_[_0x3501('0x46')](_0x48f457[_0x3501('0x30')]);_0x3b41a7[_0x3501('0x31')]=_[_0x3501('0x32')](_0x3b41a7['model'],_0x3b41a7[_0x3501('0x30')]);_0x213b72[_0x3501('0x34')]=_['intersection'](_0x3b41a7['model'],qs[_0x3501('0x33')](_0x48f457[_0x3501('0x30')][_0x3501('0x33')]));_0x213b72[_0x3501('0x34')]=_0x213b72[_0x3501('0x34')][_0x3501('0x35')]?_0x213b72['attributes']:_0x3b41a7[_0x3501('0x2f')];_0x213b72[_0x3501('0x38')]=qs['sort'](_0x48f457['query']['sort']);_0x213b72['where']=qs[_0x3501('0x31')](_['pick'](_0x48f457[_0x3501('0x30')],_0x3b41a7['filters']));if(_0x48f457[_0x3501('0x30')][_0x3501('0x3e')]){_0x213b72['where']=_[_0x3501('0x3c')](_0x213b72[_0x3501('0x3a')],{'$or':_[_0x3501('0x2b')](_0x213b72[_0x3501('0x34')],function(_0x3d447a){var _0x5ef83a={};_0x5ef83a[_0x3d447a]={'$like':'%'+_0x48f457[_0x3501('0x30')][_0x3501('0x3e')]+'%'};return _0x5ef83a;})});}_0x213b72=_['merge']({},_0x213b72,_0x48f457[_0x3501('0x3f')]);return _0x1e303d[_0x3501('0x4f')](_0x213b72);}})[_0x3501('0x43')](function(_0x54f551){if(_0x54f551){_0x3b8660=_0x54f551[_0x3501('0x35')];if(!_0x48f457[_0x3501('0x30')]['hasOwnProperty'](_0x3501('0x37'))){_0x213b72[_0x3501('0x1e')]=qs[_0x3501('0x1e')](_0x48f457[_0x3501('0x30')][_0x3501('0x1e')]);_0x213b72[_0x3501('0x1c')]=qs[_0x3501('0x1c')](_0x48f457[_0x3501('0x30')][_0x3501('0x1c')]);}return _0x1e303d[_0x3501('0x4f')](_0x213b72);}})[_0x3501('0x43')](function(_0x22c603){if(_0x22c603){return _0x22c603?{'count':_0x3b8660,'rows':_0x22c603}:null;}})[_0x3501('0x43')](respondWithResult(_0x21edd1,null))[_0x3501('0x44')](handleError(_0x21edd1,null));};exports[_0x3501('0x50')]=function(_0x339dc6,_0x36fe9e,_0x56527d){var _0xf3c045={};var _0x50cb85={};var _0x38cbb6;var _0x4b2d30;return db[_0x3501('0x40')]['findOne']({'where':{'id':_0x339dc6['params']['id']}})[_0x3501('0x43')](handleEntityNotFound(_0x36fe9e,null))[_0x3501('0x43')](function(_0x56c6d1){if(_0x56c6d1){_0x38cbb6=_0x56c6d1;_0x50cb85[_0x3501('0x2f')]=_['keys'](db[_0x3501('0x4d')]['rawAttributes']);_0x50cb85[_0x3501('0x30')]=_[_0x3501('0x46')](_0x339dc6[_0x3501('0x30')]);_0x50cb85['filters']=_[_0x3501('0x32')](_0x50cb85[_0x3501('0x2f')],_0x50cb85['query']);_0xf3c045[_0x3501('0x34')]=_[_0x3501('0x32')](_0x50cb85[_0x3501('0x2f')],qs['fields'](_0x339dc6[_0x3501('0x30')][_0x3501('0x33')]));_0xf3c045[_0x3501('0x34')]=_0xf3c045[_0x3501('0x34')][_0x3501('0x35')]?_0xf3c045[_0x3501('0x34')]:_0x50cb85[_0x3501('0x2f')];_0xf3c045['order']=qs['sort'](_0x339dc6[_0x3501('0x30')][_0x3501('0x39')]);_0xf3c045[_0x3501('0x3a')]=qs['filters'](_['pick'](_0x339dc6[_0x3501('0x30')],_0x50cb85[_0x3501('0x31')]));if(_0x339dc6['query']['filter']){_0xf3c045[_0x3501('0x3a')]=_['merge'](_0xf3c045[_0x3501('0x3a')],{'$or':_['map'](_0xf3c045[_0x3501('0x34')],function(_0x499219){var _0x446374={};_0x446374[_0x499219]={'$like':'%'+_0x339dc6[_0x3501('0x30')][_0x3501('0x3e')]+'%'};return _0x446374;})});}_0xf3c045=_[_0x3501('0x3c')]({},_0xf3c045,_0x339dc6['options']);return _0x38cbb6[_0x3501('0x50')](_0xf3c045);}})[_0x3501('0x43')](function(_0x13fb1a){if(_0x13fb1a){_0x4b2d30=_0x13fb1a[_0x3501('0x35')];if(!_0x339dc6[_0x3501('0x30')]['hasOwnProperty']('nolimit')){_0xf3c045['limit']=qs['limit'](_0x339dc6[_0x3501('0x30')]['limit']);_0xf3c045[_0x3501('0x1c')]=qs[_0x3501('0x1c')](_0x339dc6['query'][_0x3501('0x1c')]);}return _0x38cbb6['getSubjects'](_0xf3c045);}})[_0x3501('0x43')](function(_0x540572){if(_0x540572){return _0x540572?{'count':_0x4b2d30,'rows':_0x540572}:null;}})[_0x3501('0x43')](respondWithResult(_0x36fe9e,null))['catch'](handleError(_0x36fe9e,null));};exports[_0x3501('0x51')]=function(_0x5aa545,_0x5438c4,_0xccd8c){var _0x51dd81={};var _0x1e0ef2={};var _0xe18b6b;var _0x5d1465;return db[_0x3501('0x40')][_0x3501('0x4c')]({'where':{'id':_0x5aa545[_0x3501('0x4a')]['id']}})[_0x3501('0x43')](handleEntityNotFound(_0x5438c4,null))[_0x3501('0x43')](function(_0x58de64){if(_0x58de64){_0xe18b6b=_0x58de64;_0x1e0ef2[_0x3501('0x2f')]=_[_0x3501('0x46')](db[_0x3501('0x4d')]['rawAttributes']);_0x1e0ef2[_0x3501('0x30')]=_[_0x3501('0x46')](_0x5aa545['query']);_0x1e0ef2[_0x3501('0x31')]=_['intersection'](_0x1e0ef2[_0x3501('0x2f')],_0x1e0ef2[_0x3501('0x30')]);_0x51dd81[_0x3501('0x34')]=_[_0x3501('0x32')](_0x1e0ef2[_0x3501('0x2f')],qs['fields'](_0x5aa545[_0x3501('0x30')][_0x3501('0x33')]));_0x51dd81[_0x3501('0x34')]=_0x51dd81[_0x3501('0x34')][_0x3501('0x35')]?_0x51dd81['attributes']:_0x1e0ef2[_0x3501('0x2f')];_0x51dd81['order']=qs[_0x3501('0x39')](_0x5aa545[_0x3501('0x30')]['sort']);_0x51dd81[_0x3501('0x3a')]=qs[_0x3501('0x31')](_[_0x3501('0x3b')](_0x5aa545[_0x3501('0x30')],_0x1e0ef2[_0x3501('0x31')]));if(_0x5aa545[_0x3501('0x30')]['filter']){_0x51dd81[_0x3501('0x3a')]=_['merge'](_0x51dd81[_0x3501('0x3a')],{'$or':_[_0x3501('0x2b')](_0x51dd81[_0x3501('0x34')],function(_0x21b5a0){var _0x1e76f6={};_0x1e76f6[_0x21b5a0]={'$like':'%'+_0x5aa545[_0x3501('0x30')][_0x3501('0x3e')]+'%'};return _0x1e76f6;})});}_0x51dd81=_[_0x3501('0x3c')]({},_0x51dd81,_0x5aa545['options']);return _0xe18b6b['getDescriptions'](_0x51dd81);}})['then'](function(_0x4bd04b){if(_0x4bd04b){_0x5d1465=_0x4bd04b[_0x3501('0x35')];if(!_0x5aa545['query']['hasOwnProperty'](_0x3501('0x37'))){_0x51dd81[_0x3501('0x1e')]=qs[_0x3501('0x1e')](_0x5aa545[_0x3501('0x30')][_0x3501('0x1e')]);_0x51dd81['offset']=qs[_0x3501('0x1c')](_0x5aa545['query'][_0x3501('0x1c')]);}return _0xe18b6b[_0x3501('0x51')](_0x51dd81);}})[_0x3501('0x43')](function(_0x401fcc){if(_0x401fcc){return _0x401fcc?{'count':_0x5d1465,'rows':_0x401fcc}:null;}})['then'](respondWithResult(_0x5438c4,null))[_0x3501('0x44')](handleError(_0x5438c4,null));}; \ No newline at end of file +var _0x2acb=['filter','merge','findAll','rows','catch','show','params','length','includeAll','include','find','create','body','update','getFields','findOne','Dynamics365Field','options','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','nolimit','order','sort','where','pick'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x2acb,0x15d));var _0xb2ac=function(_0x5935de,_0x30c5e5){_0x5935de=_0x5935de-0x0;var _0x318d74=_0x2acb[_0x5935de];return _0x318d74;};'use strict';var emlformat=require(_0xb2ac('0x0'));var rimraf=require(_0xb2ac('0x1'));var zipdir=require(_0xb2ac('0x2'));var jsonpatch=require(_0xb2ac('0x3'));var rp=require('request-promise');var moment=require(_0xb2ac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb2ac('0x5'));var util=require(_0xb2ac('0x6'));var path=require('path');var sox=require(_0xb2ac('0x7'));var csv=require(_0xb2ac('0x8'));var ejs=require(_0xb2ac('0x9'));var fs=require('fs');var fs_extra=require(_0xb2ac('0xa'));var _=require(_0xb2ac('0xb'));var squel=require(_0xb2ac('0xc'));var crypto=require(_0xb2ac('0xd'));var jsforce=require(_0xb2ac('0xe'));var deskjs=require(_0xb2ac('0xf'));var toCsv=require(_0xb2ac('0x8'));var querystring=require(_0xb2ac('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb2ac('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb2ac('0x12'));var hardwareService=require(_0xb2ac('0x13'));var logger=require(_0xb2ac('0x14'))(_0xb2ac('0x15'));var utils=require('../../config/utils');var config=require(_0xb2ac('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb2ac('0x17'))['db'];function respondWithStatusCode(_0x32f8a8,_0x36ba91){_0x36ba91=_0x36ba91||0xcc;return function(_0x903d1f){if(_0x903d1f){return _0x32f8a8[_0xb2ac('0x18')](_0x36ba91);}return _0x32f8a8[_0xb2ac('0x19')](_0x36ba91)[_0xb2ac('0x1a')]();};}function respondWithResult(_0x4a982f,_0x2f1b9d){_0x2f1b9d=_0x2f1b9d||0xc8;return function(_0x39d6fb){if(_0x39d6fb){return _0x4a982f[_0xb2ac('0x19')](_0x2f1b9d)[_0xb2ac('0x1b')](_0x39d6fb);}};}function respondWithFilteredResult(_0x2cfaed,_0x3d0383){return function(_0x544493){if(_0x544493){var _0x38c573=typeof _0x3d0383[_0xb2ac('0x1c')]==='undefined'&&typeof _0x3d0383[_0xb2ac('0x1d')]===_0xb2ac('0x1e');var _0x241751=_0x544493[_0xb2ac('0x1f')];var _0x1b5ef0=_0x38c573?0x0:_0x3d0383['offset'];var _0x50a37c=_0x38c573?_0x544493['count']:_0x3d0383[_0xb2ac('0x1c')]+_0x3d0383[_0xb2ac('0x1d')];var _0x508ae8;if(_0x50a37c>=_0x241751){_0x50a37c=_0x241751;_0x508ae8=0xc8;}else{_0x508ae8=0xce;}_0x2cfaed[_0xb2ac('0x19')](_0x508ae8);return _0x2cfaed[_0xb2ac('0x20')](_0xb2ac('0x21'),_0x1b5ef0+'-'+_0x50a37c+'/'+_0x241751)[_0xb2ac('0x1b')](_0x544493);}return null;};}function patchUpdates(_0x58d980){return function(_0x1df00b){try{jsonpatch[_0xb2ac('0x22')](_0x1df00b,_0x58d980,!![]);}catch(_0xbc895e){return BPromise[_0xb2ac('0x23')](_0xbc895e);}return _0x1df00b[_0xb2ac('0x24')]();};}function saveUpdates(_0x22ed88,_0xfce5e){return function(_0x52b2b9){if(_0x52b2b9){return _0x52b2b9['update'](_0x22ed88)['then'](function(_0x340258){return _0x340258;});}return null;};}function removeEntity(_0x48eda5,_0x17f7e5){return function(_0x19e71f){if(_0x19e71f){return _0x19e71f[_0xb2ac('0x25')]()[_0xb2ac('0x26')](function(){_0x48eda5[_0xb2ac('0x19')](0xcc)[_0xb2ac('0x1a')]();});}};}function handleEntityNotFound(_0x1e310c,_0x5dfc38){return function(_0x3469bc){if(!_0x3469bc){_0x1e310c[_0xb2ac('0x18')](0x194);}return _0x3469bc;};}function handleError(_0x21c275,_0x5890fb){_0x5890fb=_0x5890fb||0x1f4;return function(_0x388ff9){logger['error'](_0x388ff9[_0xb2ac('0x27')]);if(_0x388ff9['name']){delete _0x388ff9[_0xb2ac('0x28')];}_0x21c275[_0xb2ac('0x19')](_0x5890fb)[_0xb2ac('0x29')](_0x388ff9);};}exports[_0xb2ac('0x2a')]=function(_0x4657ca,_0x460480){var _0x3e2713={},_0x219667={},_0x5a09d7={'count':0x0,'rows':[]};var _0x27fa20=_[_0xb2ac('0x2b')](db[_0xb2ac('0x2c')][_0xb2ac('0x2d')],function(_0x1a5faf){return{'name':_0x1a5faf[_0xb2ac('0x2e')],'type':_0x1a5faf[_0xb2ac('0x2f')][_0xb2ac('0x30')]};});_0x219667[_0xb2ac('0x31')]=_[_0xb2ac('0x2b')](_0x27fa20,'name');_0x219667['query']=_[_0xb2ac('0x32')](_0x4657ca['query']);_0x219667[_0xb2ac('0x33')]=_[_0xb2ac('0x34')](_0x219667[_0xb2ac('0x31')],_0x219667['query']);_0x3e2713['attributes']=_[_0xb2ac('0x34')](_0x219667[_0xb2ac('0x31')],qs['fields'](_0x4657ca[_0xb2ac('0x35')][_0xb2ac('0x36')]));_0x3e2713[_0xb2ac('0x37')]=_0x3e2713[_0xb2ac('0x37')]['length']?_0x3e2713[_0xb2ac('0x37')]:_0x219667[_0xb2ac('0x31')];if(!_0x4657ca[_0xb2ac('0x35')]['hasOwnProperty'](_0xb2ac('0x38'))){_0x3e2713[_0xb2ac('0x1d')]=qs[_0xb2ac('0x1d')](_0x4657ca['query'][_0xb2ac('0x1d')]);_0x3e2713[_0xb2ac('0x1c')]=qs[_0xb2ac('0x1c')](_0x4657ca[_0xb2ac('0x35')][_0xb2ac('0x1c')]);}_0x3e2713[_0xb2ac('0x39')]=qs[_0xb2ac('0x3a')](_0x4657ca['query']['sort']);_0x3e2713[_0xb2ac('0x3b')]=qs['filters'](_[_0xb2ac('0x3c')](_0x4657ca['query'],_0x219667['filters']),_0x27fa20);if(_0x4657ca['query'][_0xb2ac('0x3d')]){_0x3e2713[_0xb2ac('0x3b')]=_[_0xb2ac('0x3e')](_0x3e2713[_0xb2ac('0x3b')],{'$or':_[_0xb2ac('0x2b')](_0x27fa20,function(_0x3a044b){if(_0x3a044b[_0xb2ac('0x2f')]!=='VIRTUAL'){var _0x239339={};_0x239339[_0x3a044b[_0xb2ac('0x28')]]={'$like':'%'+_0x4657ca['query']['filter']+'%'};return _0x239339;}})});}_0x3e2713=_[_0xb2ac('0x3e')]({},_0x3e2713,_0x4657ca['options']);var _0x6022bb={'where':_0x3e2713[_0xb2ac('0x3b')]};return db[_0xb2ac('0x2c')][_0xb2ac('0x1f')](_0x6022bb)[_0xb2ac('0x26')](function(_0x3717f9){_0x5a09d7[_0xb2ac('0x1f')]=_0x3717f9;if(_0x4657ca[_0xb2ac('0x35')]['includeAll']){_0x3e2713['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xb2ac('0x3f')](_0x3e2713);})[_0xb2ac('0x26')](function(_0xbbecc3){_0x5a09d7[_0xb2ac('0x40')]=_0xbbecc3;return _0x5a09d7;})[_0xb2ac('0x26')](respondWithFilteredResult(_0x460480,_0x3e2713))[_0xb2ac('0x41')](handleError(_0x460480,null));};exports[_0xb2ac('0x42')]=function(_0xdfd5c1,_0x4f8f2c){var _0x2bd55c={'raw':![],'where':{'id':_0xdfd5c1[_0xb2ac('0x43')]['id']}},_0x30e4d1={};_0x30e4d1[_0xb2ac('0x31')]=_[_0xb2ac('0x32')](db[_0xb2ac('0x2c')][_0xb2ac('0x2d')]);_0x30e4d1[_0xb2ac('0x35')]=_[_0xb2ac('0x32')](_0xdfd5c1[_0xb2ac('0x35')]);_0x30e4d1[_0xb2ac('0x33')]=_[_0xb2ac('0x34')](_0x30e4d1['model'],_0x30e4d1['query']);_0x2bd55c[_0xb2ac('0x37')]=_['intersection'](_0x30e4d1[_0xb2ac('0x31')],qs['fields'](_0xdfd5c1[_0xb2ac('0x35')]['fields']));_0x2bd55c[_0xb2ac('0x37')]=_0x2bd55c['attributes'][_0xb2ac('0x44')]?_0x2bd55c[_0xb2ac('0x37')]:_0x30e4d1[_0xb2ac('0x31')];if(_0xdfd5c1['query'][_0xb2ac('0x45')]){_0x2bd55c[_0xb2ac('0x46')]=[{'all':!![]}];}_0x2bd55c=_[_0xb2ac('0x3e')]({},_0x2bd55c,_0xdfd5c1['options']);return db[_0xb2ac('0x2c')][_0xb2ac('0x47')](_0x2bd55c)[_0xb2ac('0x26')](handleEntityNotFound(_0x4f8f2c,null))[_0xb2ac('0x26')](respondWithResult(_0x4f8f2c,null))[_0xb2ac('0x41')](handleError(_0x4f8f2c,null));};exports[_0xb2ac('0x48')]=function(_0xdfad8b,_0xedfb76){return db[_0xb2ac('0x2c')]['create'](_0xdfad8b[_0xb2ac('0x49')],{})[_0xb2ac('0x26')](respondWithResult(_0xedfb76,0xc9))[_0xb2ac('0x41')](handleError(_0xedfb76,null));};exports[_0xb2ac('0x4a')]=function(_0x5a99bb,_0x3ea03d){if(_0x5a99bb[_0xb2ac('0x49')]['id']){delete _0x5a99bb['body']['id'];}return db['Dynamics365Configuration'][_0xb2ac('0x47')]({'where':{'id':_0x5a99bb[_0xb2ac('0x43')]['id']}})[_0xb2ac('0x26')](handleEntityNotFound(_0x3ea03d,null))[_0xb2ac('0x26')](saveUpdates(_0x5a99bb['body'],null))[_0xb2ac('0x26')](respondWithResult(_0x3ea03d,null))['catch'](handleError(_0x3ea03d,null));};exports['destroy']=function(_0x465087,_0x29d315){return db[_0xb2ac('0x2c')][_0xb2ac('0x47')]({'where':{'id':_0x465087[_0xb2ac('0x43')]['id']}})[_0xb2ac('0x26')](handleEntityNotFound(_0x29d315,null))['then'](removeEntity(_0x29d315,null))[_0xb2ac('0x41')](handleError(_0x29d315,null));};exports[_0xb2ac('0x4b')]=function(_0x45a241,_0xb07614,_0xab05b7){var _0x55e473={};var _0x14413b={};var _0x1908cf;var _0xadbc72;return db['Dynamics365Configuration'][_0xb2ac('0x4c')]({'where':{'id':_0x45a241['params']['id']}})[_0xb2ac('0x26')](handleEntityNotFound(_0xb07614,null))[_0xb2ac('0x26')](function(_0x195b45){if(_0x195b45){_0x1908cf=_0x195b45;_0x14413b[_0xb2ac('0x31')]=_['keys'](db[_0xb2ac('0x4d')][_0xb2ac('0x2d')]);_0x14413b[_0xb2ac('0x35')]=_[_0xb2ac('0x32')](_0x45a241['query']);_0x14413b[_0xb2ac('0x33')]=_[_0xb2ac('0x34')](_0x14413b[_0xb2ac('0x31')],_0x14413b[_0xb2ac('0x35')]);_0x55e473[_0xb2ac('0x37')]=_[_0xb2ac('0x34')](_0x14413b[_0xb2ac('0x31')],qs[_0xb2ac('0x36')](_0x45a241['query'][_0xb2ac('0x36')]));_0x55e473[_0xb2ac('0x37')]=_0x55e473[_0xb2ac('0x37')][_0xb2ac('0x44')]?_0x55e473['attributes']:_0x14413b[_0xb2ac('0x31')];_0x55e473[_0xb2ac('0x39')]=qs['sort'](_0x45a241[_0xb2ac('0x35')][_0xb2ac('0x3a')]);_0x55e473[_0xb2ac('0x3b')]=qs[_0xb2ac('0x33')](_['pick'](_0x45a241[_0xb2ac('0x35')],_0x14413b[_0xb2ac('0x33')]));if(_0x45a241[_0xb2ac('0x35')][_0xb2ac('0x3d')]){_0x55e473['where']=_[_0xb2ac('0x3e')](_0x55e473[_0xb2ac('0x3b')],{'$or':_['map'](_0x55e473[_0xb2ac('0x37')],function(_0x6d74ec){var _0xa69c17={};_0xa69c17[_0x6d74ec]={'$like':'%'+_0x45a241['query'][_0xb2ac('0x3d')]+'%'};return _0xa69c17;})});}_0x55e473=_[_0xb2ac('0x3e')]({},_0x55e473,_0x45a241[_0xb2ac('0x4e')]);return _0x1908cf[_0xb2ac('0x4b')](_0x55e473);}})['then'](function(_0x2d3381){if(_0x2d3381){_0xadbc72=_0x2d3381[_0xb2ac('0x44')];if(!_0x45a241['query'][_0xb2ac('0x4f')](_0xb2ac('0x38'))){_0x55e473[_0xb2ac('0x1d')]=qs[_0xb2ac('0x1d')](_0x45a241[_0xb2ac('0x35')]['limit']);_0x55e473[_0xb2ac('0x1c')]=qs[_0xb2ac('0x1c')](_0x45a241[_0xb2ac('0x35')][_0xb2ac('0x1c')]);}return _0x1908cf['getFields'](_0x55e473);}})[_0xb2ac('0x26')](function(_0x22638a){if(_0x22638a){return _0x22638a?{'count':_0xadbc72,'rows':_0x22638a}:null;}})[_0xb2ac('0x26')](respondWithResult(_0xb07614,null))[_0xb2ac('0x41')](handleError(_0xb07614,null));};exports[_0xb2ac('0x50')]=function(_0xb0811,_0x21f911,_0xf6eaa1){var _0x305286={};var _0x399337={};var _0x1153a0;var _0x15da7c;return db[_0xb2ac('0x2c')][_0xb2ac('0x4c')]({'where':{'id':_0xb0811[_0xb2ac('0x43')]['id']}})[_0xb2ac('0x26')](handleEntityNotFound(_0x21f911,null))['then'](function(_0x584105){if(_0x584105){_0x1153a0=_0x584105;_0x399337[_0xb2ac('0x31')]=_['keys'](db[_0xb2ac('0x4d')][_0xb2ac('0x2d')]);_0x399337[_0xb2ac('0x35')]=_[_0xb2ac('0x32')](_0xb0811[_0xb2ac('0x35')]);_0x399337[_0xb2ac('0x33')]=_[_0xb2ac('0x34')](_0x399337['model'],_0x399337[_0xb2ac('0x35')]);_0x305286[_0xb2ac('0x37')]=_[_0xb2ac('0x34')](_0x399337[_0xb2ac('0x31')],qs[_0xb2ac('0x36')](_0xb0811[_0xb2ac('0x35')]['fields']));_0x305286['attributes']=_0x305286[_0xb2ac('0x37')]['length']?_0x305286[_0xb2ac('0x37')]:_0x399337['model'];_0x305286[_0xb2ac('0x39')]=qs['sort'](_0xb0811['query'][_0xb2ac('0x3a')]);_0x305286[_0xb2ac('0x3b')]=qs['filters'](_[_0xb2ac('0x3c')](_0xb0811[_0xb2ac('0x35')],_0x399337[_0xb2ac('0x33')]));if(_0xb0811['query']['filter']){_0x305286[_0xb2ac('0x3b')]=_[_0xb2ac('0x3e')](_0x305286[_0xb2ac('0x3b')],{'$or':_[_0xb2ac('0x2b')](_0x305286[_0xb2ac('0x37')],function(_0x48f05f){var _0x1a2e5c={};_0x1a2e5c[_0x48f05f]={'$like':'%'+_0xb0811['query'][_0xb2ac('0x3d')]+'%'};return _0x1a2e5c;})});}_0x305286=_[_0xb2ac('0x3e')]({},_0x305286,_0xb0811[_0xb2ac('0x4e')]);return _0x1153a0[_0xb2ac('0x50')](_0x305286);}})['then'](function(_0x2270f8){if(_0x2270f8){_0x15da7c=_0x2270f8['length'];if(!_0xb0811[_0xb2ac('0x35')]['hasOwnProperty'](_0xb2ac('0x38'))){_0x305286[_0xb2ac('0x1d')]=qs[_0xb2ac('0x1d')](_0xb0811[_0xb2ac('0x35')][_0xb2ac('0x1d')]);_0x305286[_0xb2ac('0x1c')]=qs[_0xb2ac('0x1c')](_0xb0811[_0xb2ac('0x35')]['offset']);}return _0x1153a0['getSubjects'](_0x305286);}})[_0xb2ac('0x26')](function(_0x4e576e){if(_0x4e576e){return _0x4e576e?{'count':_0x15da7c,'rows':_0x4e576e}:null;}})[_0xb2ac('0x26')](respondWithResult(_0x21f911,null))[_0xb2ac('0x41')](handleError(_0x21f911,null));};exports[_0xb2ac('0x51')]=function(_0x113192,_0x4fdd53,_0x3132ce){var _0x2f351c={};var _0x275f9a={};var _0x374e48;var _0x21c9f9;return db[_0xb2ac('0x2c')]['findOne']({'where':{'id':_0x113192[_0xb2ac('0x43')]['id']}})['then'](handleEntityNotFound(_0x4fdd53,null))['then'](function(_0x110347){if(_0x110347){_0x374e48=_0x110347;_0x275f9a[_0xb2ac('0x31')]=_[_0xb2ac('0x32')](db[_0xb2ac('0x4d')][_0xb2ac('0x2d')]);_0x275f9a['query']=_[_0xb2ac('0x32')](_0x113192['query']);_0x275f9a['filters']=_[_0xb2ac('0x34')](_0x275f9a[_0xb2ac('0x31')],_0x275f9a[_0xb2ac('0x35')]);_0x2f351c[_0xb2ac('0x37')]=_[_0xb2ac('0x34')](_0x275f9a[_0xb2ac('0x31')],qs[_0xb2ac('0x36')](_0x113192[_0xb2ac('0x35')][_0xb2ac('0x36')]));_0x2f351c['attributes']=_0x2f351c['attributes']['length']?_0x2f351c[_0xb2ac('0x37')]:_0x275f9a['model'];_0x2f351c[_0xb2ac('0x39')]=qs['sort'](_0x113192[_0xb2ac('0x35')]['sort']);_0x2f351c[_0xb2ac('0x3b')]=qs[_0xb2ac('0x33')](_['pick'](_0x113192[_0xb2ac('0x35')],_0x275f9a[_0xb2ac('0x33')]));if(_0x113192[_0xb2ac('0x35')]['filter']){_0x2f351c[_0xb2ac('0x3b')]=_[_0xb2ac('0x3e')](_0x2f351c[_0xb2ac('0x3b')],{'$or':_[_0xb2ac('0x2b')](_0x2f351c['attributes'],function(_0x4d38d8){var _0xdc30dd={};_0xdc30dd[_0x4d38d8]={'$like':'%'+_0x113192[_0xb2ac('0x35')][_0xb2ac('0x3d')]+'%'};return _0xdc30dd;})});}_0x2f351c=_[_0xb2ac('0x3e')]({},_0x2f351c,_0x113192[_0xb2ac('0x4e')]);return _0x374e48['getDescriptions'](_0x2f351c);}})[_0xb2ac('0x26')](function(_0x196dbc){if(_0x196dbc){_0x21c9f9=_0x196dbc[_0xb2ac('0x44')];if(!_0x113192[_0xb2ac('0x35')]['hasOwnProperty'](_0xb2ac('0x38'))){_0x2f351c[_0xb2ac('0x1d')]=qs[_0xb2ac('0x1d')](_0x113192[_0xb2ac('0x35')]['limit']);_0x2f351c[_0xb2ac('0x1c')]=qs['offset'](_0x113192[_0xb2ac('0x35')][_0xb2ac('0x1c')]);}return _0x374e48[_0xb2ac('0x51')](_0x2f351c);}})[_0xb2ac('0x26')](function(_0x2f982c){if(_0x2f982c){return _0x2f982c?{'count':_0x21c9f9,'rows':_0x2f982c}:null;}})['then'](respondWithResult(_0x4fdd53,null))[_0xb2ac('0x41')](handleError(_0x4fdd53,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index fba995d..33bf56f 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 _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x9a19,0x114));var _0x99a1=function(_0x102b0c,_0x33dee4){_0x102b0c=_0x102b0c-0x0;var _0x9b15ca=_0x9a19[_0x102b0c];return _0x9b15ca;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x9a19,0x114));var _0x99a1=function(_0x5d07ff,_0x1f976f){_0x5d07ff=_0x5d07ff-0x0;var _0x5226ad=_0x9a19[_0x5d07ff];return _0x5226ad;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Dynamics365Configuration',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 14f622c..3651178 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 _0x8098=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x6c7987,_0x337b26){var _0x3a1ac7=function(_0x38b9c5){while(--_0x38b9c5){_0x6c7987['push'](_0x6c7987['shift']());}};_0x3a1ac7(++_0x337b26);}(_0x8098,0x123));var _0x8809=function(_0xecc4d,_0x421baf){_0xecc4d=_0xecc4d-0x0;var _0x393051=_0x8098[_0xecc4d];return _0x393051;};'use strict';var _=require(_0x8809('0x0'));var util=require(_0x8809('0x1'));var moment=require(_0x8809('0x2'));var BPromise=require(_0x8809('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8809('0x4'));var db=require(_0x8809('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8809('0x6'))('rpc');var config=require(_0x8809('0x7'));var jayson=require(_0x8809('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x41b5c8,_0x472e9c,_0x53e56a){return new BPromise(function(_0x2c1075,_0x59811a){return client['request'](_0x41b5c8,_0x53e56a)['then'](function(_0x16eb6e){logger[_0x8809('0x9')](_0x8809('0xa'),_0x472e9c,_0x8809('0xb'));logger[_0x8809('0xc')](_0x8809('0xd'),_0x472e9c,_0x8809('0xb'),JSON[_0x8809('0xe')](_0x16eb6e));if(_0x16eb6e[_0x8809('0xf')]){if(_0x16eb6e[_0x8809('0xf')]['code']===0x1f4){logger[_0x8809('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x472e9c,_0x16eb6e[_0x8809('0xf')][_0x8809('0x10')]);return _0x59811a(_0x16eb6e[_0x8809('0xf')]['message']);}logger['error'](_0x8809('0xa'),_0x472e9c,_0x16eb6e[_0x8809('0xf')][_0x8809('0x10')]);return _0x2c1075(_0x16eb6e[_0x8809('0xf')]['message']);}else{logger[_0x8809('0x9')]('Dynamics365Configuration,\x20%s,\x20%s',_0x472e9c,_0x8809('0xb'));_0x2c1075(_0x16eb6e[_0x8809('0x11')]['message']);}})[_0x8809('0x12')](function(_0x36fbce){logger[_0x8809('0xf')](_0x8809('0xa'),_0x472e9c,_0x36fbce);_0x59811a(_0x36fbce);});});} \ No newline at end of file +var _0x4df5=['request','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5955d6,_0x292037){var _0x437bf5=function(_0x3d956a){while(--_0x3d956a){_0x5955d6['push'](_0x5955d6['shift']());}};_0x437bf5(++_0x292037);}(_0x4df5,0x197));var _0x54df=function(_0x18efb0,_0x5d9ce0){_0x18efb0=_0x18efb0-0x0;var _0x72b1ff=_0x4df5[_0x18efb0];return _0x72b1ff;};'use strict';var _=require(_0x54df('0x0'));var util=require(_0x54df('0x1'));var moment=require('moment');var BPromise=require(_0x54df('0x2'));var rs=require(_0x54df('0x3'));var fs=require('fs');var Redis=require(_0x54df('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x54df('0x5'));var logger=require(_0x54df('0x6'))(_0x54df('0x7'));var config=require(_0x54df('0x8'));var jayson=require(_0x54df('0x9'));var client=jayson[_0x54df('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2227ba,_0xf54e27,_0x1004fc){return new BPromise(function(_0x1003e1,_0x29df02){return client[_0x54df('0xb')](_0x2227ba,_0x1004fc)['then'](function(_0x4925dc){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0xf54e27,_0x54df('0xc'));logger[_0x54df('0xd')](_0x54df('0xe'),_0xf54e27,_0x54df('0xc'),JSON[_0x54df('0xf')](_0x4925dc));if(_0x4925dc[_0x54df('0x10')]){if(_0x4925dc[_0x54df('0x10')][_0x54df('0x11')]===0x1f4){logger[_0x54df('0x10')](_0x54df('0x12'),_0xf54e27,_0x4925dc[_0x54df('0x10')][_0x54df('0x13')]);return _0x29df02(_0x4925dc[_0x54df('0x10')][_0x54df('0x13')]);}logger[_0x54df('0x10')](_0x54df('0x12'),_0xf54e27,_0x4925dc[_0x54df('0x10')][_0x54df('0x13')]);return _0x1003e1(_0x4925dc[_0x54df('0x10')][_0x54df('0x13')]);}else{logger[_0x54df('0x14')](_0x54df('0x12'),_0xf54e27,'request\x20sent');_0x1003e1(_0x4925dc[_0x54df('0x15')][_0x54df('0x13')]);}})['catch'](function(_0x57dd20){logger['error'](_0x54df('0x12'),_0xf54e27,_0x57dd20);_0x29df02(_0x57dd20);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index dbd956c..cbfad5f 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 _0x216d=['../../config/environment','isAuthenticated','index','get','show','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0x216d,0xc9));var _0xd216=function(_0x38e03f,_0x2ee717){_0x38e03f=_0x38e03f-0x0;var _0x2bbfec=_0x216d[_0x38e03f];return _0x2bbfec;};'use strict';var multer=require(_0xd216('0x0'));var util=require(_0xd216('0x1'));var path=require(_0xd216('0x2'));var timeout=require(_0xd216('0x3'));var express=require(_0xd216('0x4'));var router=express[_0xd216('0x5')]();var fs_extra=require(_0xd216('0x6'));var auth=require(_0xd216('0x7'));var interaction=require(_0xd216('0x8'));var config=require(_0xd216('0x9'));var controller=require('./intDynamics365Field.controller');router['get']('/',auth[_0xd216('0xa')](),controller[_0xd216('0xb')]);router[_0xd216('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xd216('0xd')]);router['post']('/',auth[_0xd216('0xa')](),controller[_0xd216('0xe')]);router[_0xd216('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xd216('0x10')]);router[_0xd216('0x11')](_0xd216('0x12'),auth[_0xd216('0xa')](),controller[_0xd216('0x13')]);module[_0xd216('0x14')]=router; \ No newline at end of file +var _0x58b2=['update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','post','create'];(function(_0x4ddc5c,_0x1cb036){var _0x3f0bd8=function(_0x57a9a3){while(--_0x57a9a3){_0x4ddc5c['push'](_0x4ddc5c['shift']());}};_0x3f0bd8(++_0x1cb036);}(_0x58b2,0x1e4));var _0x258b=function(_0x2a04d4,_0xa57830){_0x2a04d4=_0x2a04d4-0x0;var _0x40b2f9=_0x58b2[_0x2a04d4];return _0x40b2f9;};'use strict';var multer=require('multer');var util=require(_0x258b('0x0'));var path=require('path');var timeout=require(_0x258b('0x1'));var express=require(_0x258b('0x2'));var router=express[_0x258b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x258b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x258b('0x5'));var controller=require(_0x258b('0x6'));router[_0x258b('0x7')]('/',auth[_0x258b('0x8')](),controller['index']);router['get'](_0x258b('0x9'),auth[_0x258b('0x8')](),controller['show']);router[_0x258b('0xa')]('/',auth[_0x258b('0x8')](),controller[_0x258b('0xb')]);router['put'](_0x258b('0x9'),auth[_0x258b('0x8')](),controller[_0x258b('0xc')]);router[_0x258b('0xd')](_0x258b('0x9'),auth[_0x258b('0x8')](),controller[_0x258b('0xe')]);module[_0x258b('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 659eaa8..202bfae 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 _0x2783=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x1e88eb,_0x4d031e){var _0x23fe01=function(_0x42f79c){while(--_0x42f79c){_0x1e88eb['push'](_0x1e88eb['shift']());}};_0x23fe01(++_0x4d031e);}(_0x2783,0x1e7));var _0x3278=function(_0x38b4db,_0x3f74c7){_0x38b4db=_0x38b4db-0x0;var _0x218dce=_0x2783[_0x38b4db];return _0x218dce;};'use strict';var Sequelize=require(_0x3278('0x0'));module[_0x3278('0x1')]={'type':{'type':Sequelize[_0x3278('0x2')](_0x3278('0x3'),_0x3278('0x4'),_0x3278('0x5'),_0x3278('0x6'),_0x3278('0x7')),'defaultValue':_0x3278('0x3')},'content':{'type':Sequelize[_0x3278('0x8')]},'key':{'type':Sequelize[_0x3278('0x8')]},'keyType':{'type':Sequelize[_0x3278('0x2')](_0x3278('0x3'),_0x3278('0x4'),_0x3278('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3278('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3278('0x8')]}}; \ No newline at end of file +var _0x636e=['STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0x636e,0x1b3));var _0xe636=function(_0x12cc7d,_0x15707b){_0x12cc7d=_0x12cc7d-0x0;var _0x130508=_0x636e[_0x12cc7d];return _0x130508;};'use strict';var Sequelize=require(_0xe636('0x0'));module[_0xe636('0x1')]={'type':{'type':Sequelize[_0xe636('0x2')](_0xe636('0x3'),_0xe636('0x4'),'customVariable',_0xe636('0x5'),'picklist'),'defaultValue':_0xe636('0x3')},'content':{'type':Sequelize[_0xe636('0x6')]},'key':{'type':Sequelize[_0xe636('0x6')]},'keyType':{'type':Sequelize[_0xe636('0x2')](_0xe636('0x3'),'variable',_0xe636('0x7'))},'keyContent':{'type':Sequelize[_0xe636('0x6')]},'idField':{'type':Sequelize[_0xe636('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe636('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe636('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index d8ef19d..a6506af 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 _0xd68a=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','name','send','map','rawAttributes','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','Dynamics365Field','includeAll','findAll','rows','catch','show','keys','include','options','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x19116a,_0x5f45dd){var _0x25686d=function(_0x3c22b8){while(--_0x3c22b8){_0x19116a['push'](_0x19116a['shift']());}};_0x25686d(++_0x5f45dd);}(_0xd68a,0x15e));var _0xad68=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xd68a[_0x4ea69d];return _0x5318e0;};'use strict';var emlformat=require(_0xad68('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xad68('0x1'));var jsonpatch=require(_0xad68('0x2'));var rp=require(_0xad68('0x3'));var moment=require(_0xad68('0x4'));var BPromise=require(_0xad68('0x5'));var Mustache=require('mustache');var util=require(_0xad68('0x6'));var path=require(_0xad68('0x7'));var sox=require(_0xad68('0x8'));var csv=require(_0xad68('0x9'));var ejs=require(_0xad68('0xa'));var fs=require('fs');var fs_extra=require(_0xad68('0xb'));var _=require(_0xad68('0xc'));var squel=require(_0xad68('0xd'));var crypto=require(_0xad68('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xad68('0xf'));var Papa=require(_0xad68('0x10'));var Redis=require(_0xad68('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xad68('0x12'));var as=require(_0xad68('0x13'));var hardwareService=require(_0xad68('0x14'));var logger=require(_0xad68('0x15'))(_0xad68('0x16'));var utils=require(_0xad68('0x17'));var config=require(_0xad68('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xad68('0x19'))['db'];function respondWithStatusCode(_0x134bf1,_0x73cec7){_0x73cec7=_0x73cec7||0xcc;return function(_0x15c2ba){if(_0x15c2ba){return _0x134bf1[_0xad68('0x1a')](_0x73cec7);}return _0x134bf1[_0xad68('0x1b')](_0x73cec7)[_0xad68('0x1c')]();};}function respondWithResult(_0x5998fe,_0x5c91d2){_0x5c91d2=_0x5c91d2||0xc8;return function(_0x40b897){if(_0x40b897){return _0x5998fe[_0xad68('0x1b')](_0x5c91d2)[_0xad68('0x1d')](_0x40b897);}};}function respondWithFilteredResult(_0x16ac74,_0x3bcec0){return function(_0x1de899){if(_0x1de899){var _0x127e16=typeof _0x3bcec0[_0xad68('0x1e')]===_0xad68('0x1f')&&typeof _0x3bcec0['limit']==='undefined';var _0x463dfa=_0x1de899['count'];var _0x1685e8=_0x127e16?0x0:_0x3bcec0[_0xad68('0x1e')];var _0x5df70f=_0x127e16?_0x1de899[_0xad68('0x20')]:_0x3bcec0[_0xad68('0x1e')]+_0x3bcec0[_0xad68('0x21')];var _0x436619;if(_0x5df70f>=_0x463dfa){_0x5df70f=_0x463dfa;_0x436619=0xc8;}else{_0x436619=0xce;}_0x16ac74['status'](_0x436619);return _0x16ac74['set'](_0xad68('0x22'),_0x1685e8+'-'+_0x5df70f+'/'+_0x463dfa)[_0xad68('0x1d')](_0x1de899);}return null;};}function patchUpdates(_0x4629b2){return function(_0x56bba2){try{jsonpatch['apply'](_0x56bba2,_0x4629b2,!![]);}catch(_0x3b1f6b){return BPromise[_0xad68('0x23')](_0x3b1f6b);}return _0x56bba2[_0xad68('0x24')]();};}function saveUpdates(_0x1d00e3,_0x2ec8e8){return function(_0x5af801){if(_0x5af801){return _0x5af801[_0xad68('0x25')](_0x1d00e3)[_0xad68('0x26')](function(_0x9768b9){return _0x9768b9;});}return null;};}function removeEntity(_0x34d9fa,_0x362803){return function(_0x4d16fd){if(_0x4d16fd){return _0x4d16fd[_0xad68('0x27')]()['then'](function(){_0x34d9fa[_0xad68('0x1b')](0xcc)[_0xad68('0x1c')]();});}};}function handleEntityNotFound(_0x4b8eda,_0x3a4f25){return function(_0xf34efa){if(!_0xf34efa){_0x4b8eda[_0xad68('0x1a')](0x194);}return _0xf34efa;};}function handleError(_0x15fff8,_0x4b8966){_0x4b8966=_0x4b8966||0x1f4;return function(_0x17e669){logger['error'](_0x17e669['stack']);if(_0x17e669[_0xad68('0x28')]){delete _0x17e669['name'];}_0x15fff8['status'](_0x4b8966)[_0xad68('0x29')](_0x17e669);};}exports['index']=function(_0x34cf21,_0x6bdd70){var _0x561742={},_0x52ec18={},_0x56a2c1={'count':0x0,'rows':[]};var _0x5d8af4=_[_0xad68('0x2a')](db['Dynamics365Field'][_0xad68('0x2b')],function(_0x438300){return{'name':_0x438300[_0xad68('0x2c')],'type':_0x438300[_0xad68('0x2d')][_0xad68('0x2e')]};});_0x52ec18['model']=_[_0xad68('0x2a')](_0x5d8af4,_0xad68('0x28'));_0x52ec18[_0xad68('0x2f')]=_['keys'](_0x34cf21[_0xad68('0x2f')]);_0x52ec18['filters']=_['intersection'](_0x52ec18[_0xad68('0x30')],_0x52ec18[_0xad68('0x2f')]);_0x561742[_0xad68('0x31')]=_[_0xad68('0x32')](_0x52ec18['model'],qs[_0xad68('0x33')](_0x34cf21[_0xad68('0x2f')][_0xad68('0x33')]));_0x561742[_0xad68('0x31')]=_0x561742[_0xad68('0x31')][_0xad68('0x34')]?_0x561742[_0xad68('0x31')]:_0x52ec18[_0xad68('0x30')];if(!_0x34cf21['query'][_0xad68('0x35')]('nolimit')){_0x561742['limit']=qs['limit'](_0x34cf21[_0xad68('0x2f')]['limit']);_0x561742['offset']=qs[_0xad68('0x1e')](_0x34cf21['query'][_0xad68('0x1e')]);}_0x561742[_0xad68('0x36')]=qs[_0xad68('0x37')](_0x34cf21[_0xad68('0x2f')][_0xad68('0x37')]);_0x561742['where']=qs[_0xad68('0x38')](_[_0xad68('0x39')](_0x34cf21['query'],_0x52ec18['filters']),_0x5d8af4);if(_0x34cf21[_0xad68('0x2f')][_0xad68('0x3a')]){_0x561742[_0xad68('0x3b')]=_[_0xad68('0x3c')](_0x561742[_0xad68('0x3b')],{'$or':_[_0xad68('0x2a')](_0x5d8af4,function(_0x517929){if(_0x517929[_0xad68('0x2d')]!=='VIRTUAL'){var _0x24866b={};_0x24866b[_0x517929['name']]={'$like':'%'+_0x34cf21[_0xad68('0x2f')][_0xad68('0x3a')]+'%'};return _0x24866b;}})});}_0x561742=_['merge']({},_0x561742,_0x34cf21['options']);var _0x4c3e01={'where':_0x561742['where']};return db[_0xad68('0x3d')][_0xad68('0x20')](_0x4c3e01)[_0xad68('0x26')](function(_0x2b7748){_0x56a2c1[_0xad68('0x20')]=_0x2b7748;if(_0x34cf21[_0xad68('0x2f')][_0xad68('0x3e')]){_0x561742['include']=[{'all':!![]}];}return db[_0xad68('0x3d')][_0xad68('0x3f')](_0x561742);})[_0xad68('0x26')](function(_0x164c20){_0x56a2c1[_0xad68('0x40')]=_0x164c20;return _0x56a2c1;})['then'](respondWithFilteredResult(_0x6bdd70,_0x561742))[_0xad68('0x41')](handleError(_0x6bdd70,null));};exports[_0xad68('0x42')]=function(_0x217b4a,_0x5cb273){var _0x58beec={'raw':!![],'where':{'id':_0x217b4a['params']['id']}},_0x246f6e={};_0x246f6e['model']=_[_0xad68('0x43')](db[_0xad68('0x3d')]['rawAttributes']);_0x246f6e[_0xad68('0x2f')]=_['keys'](_0x217b4a[_0xad68('0x2f')]);_0x246f6e[_0xad68('0x38')]=_[_0xad68('0x32')](_0x246f6e[_0xad68('0x30')],_0x246f6e[_0xad68('0x2f')]);_0x58beec[_0xad68('0x31')]=_[_0xad68('0x32')](_0x246f6e[_0xad68('0x30')],qs['fields'](_0x217b4a[_0xad68('0x2f')][_0xad68('0x33')]));_0x58beec[_0xad68('0x31')]=_0x58beec['attributes'][_0xad68('0x34')]?_0x58beec['attributes']:_0x246f6e[_0xad68('0x30')];if(_0x217b4a[_0xad68('0x2f')]['includeAll']){_0x58beec[_0xad68('0x44')]=[{'all':!![]}];}_0x58beec=_[_0xad68('0x3c')]({},_0x58beec,_0x217b4a[_0xad68('0x45')]);return db['Dynamics365Field'][_0xad68('0x46')](_0x58beec)[_0xad68('0x26')](handleEntityNotFound(_0x5cb273,null))['then'](respondWithResult(_0x5cb273,null))['catch'](handleError(_0x5cb273,null));};exports[_0xad68('0x47')]=function(_0x496caf,_0x40d9e3){return db['Dynamics365Field'][_0xad68('0x47')](_0x496caf['body'],{})['then'](respondWithResult(_0x40d9e3,0xc9))['catch'](handleError(_0x40d9e3,null));};exports[_0xad68('0x25')]=function(_0x4204e8,_0x58db4b){if(_0x4204e8[_0xad68('0x48')]['id']){delete _0x4204e8[_0xad68('0x48')]['id'];}return db[_0xad68('0x3d')][_0xad68('0x46')]({'where':{'id':_0x4204e8['params']['id']}})[_0xad68('0x26')](handleEntityNotFound(_0x58db4b,null))[_0xad68('0x26')](saveUpdates(_0x4204e8['body'],null))[_0xad68('0x26')](respondWithResult(_0x58db4b,null))[_0xad68('0x41')](handleError(_0x58db4b,null));};exports[_0xad68('0x27')]=function(_0x11c12b,_0x1f3535){return db[_0xad68('0x3d')][_0xad68('0x46')]({'where':{'id':_0x11c12b[_0xad68('0x49')]['id']}})[_0xad68('0x26')](handleEntityNotFound(_0x1f3535,null))[_0xad68('0x26')](removeEntity(_0x1f3535,null))[_0xad68('0x41')](handleError(_0x1f3535,null));}; \ No newline at end of file +var _0xf870=['type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','keys','rawAttributes','include','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','error','name','send','index','Dynamics365Field','fieldName'];(function(_0x5c39a2,_0x1beee4){var _0x88abeb=function(_0x55d61d){while(--_0x55d61d){_0x5c39a2['push'](_0x5c39a2['shift']());}};_0x88abeb(++_0x1beee4);}(_0xf870,0x19e));var _0x0f87=function(_0x25e416,_0x3b2f71){_0x25e416=_0x25e416-0x0;var _0x31543a=_0xf870[_0x25e416];return _0x31543a;};'use strict';var emlformat=require(_0x0f87('0x0'));var rimraf=require(_0x0f87('0x1'));var zipdir=require(_0x0f87('0x2'));var jsonpatch=require(_0x0f87('0x3'));var rp=require(_0x0f87('0x4'));var moment=require('moment');var BPromise=require(_0x0f87('0x5'));var Mustache=require(_0x0f87('0x6'));var util=require('util');var path=require(_0x0f87('0x7'));var sox=require(_0x0f87('0x8'));var csv=require(_0x0f87('0x9'));var ejs=require(_0x0f87('0xa'));var fs=require('fs');var fs_extra=require(_0x0f87('0xb'));var _=require(_0x0f87('0xc'));var squel=require('squel');var crypto=require(_0x0f87('0xd'));var jsforce=require(_0x0f87('0xe'));var deskjs=require(_0x0f87('0xf'));var toCsv=require(_0x0f87('0x9'));var querystring=require(_0x0f87('0x10'));var Papa=require(_0x0f87('0x11'));var Redis=require(_0x0f87('0x12'));var authService=require(_0x0f87('0x13'));var qs=require(_0x0f87('0x14'));var as=require(_0x0f87('0x15'));var hardwareService=require(_0x0f87('0x16'));var logger=require(_0x0f87('0x17'))(_0x0f87('0x18'));var utils=require(_0x0f87('0x19'));var config=require(_0x0f87('0x1a'));var licenseUtil=require(_0x0f87('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e58e4,_0x560037){_0x560037=_0x560037||0xcc;return function(_0x338ff0){if(_0x338ff0){return _0x1e58e4[_0x0f87('0x1c')](_0x560037);}return _0x1e58e4[_0x0f87('0x1d')](_0x560037)[_0x0f87('0x1e')]();};}function respondWithResult(_0x5316bc,_0x35c31c){_0x35c31c=_0x35c31c||0xc8;return function(_0x1c0514){if(_0x1c0514){return _0x5316bc['status'](_0x35c31c)[_0x0f87('0x1f')](_0x1c0514);}};}function respondWithFilteredResult(_0x3b7fda,_0x4999aa){return function(_0x31a239){if(_0x31a239){var _0x34f753=typeof _0x4999aa[_0x0f87('0x20')]===_0x0f87('0x21')&&typeof _0x4999aa['limit']===_0x0f87('0x21');var _0x5378e4=_0x31a239[_0x0f87('0x22')];var _0x3a4435=_0x34f753?0x0:_0x4999aa[_0x0f87('0x20')];var _0x1dec69=_0x34f753?_0x31a239[_0x0f87('0x22')]:_0x4999aa[_0x0f87('0x20')]+_0x4999aa[_0x0f87('0x23')];var _0x1c37f7;if(_0x1dec69>=_0x5378e4){_0x1dec69=_0x5378e4;_0x1c37f7=0xc8;}else{_0x1c37f7=0xce;}_0x3b7fda['status'](_0x1c37f7);return _0x3b7fda[_0x0f87('0x24')](_0x0f87('0x25'),_0x3a4435+'-'+_0x1dec69+'/'+_0x5378e4)['json'](_0x31a239);}return null;};}function patchUpdates(_0x256fe0){return function(_0x13ad14){try{jsonpatch['apply'](_0x13ad14,_0x256fe0,!![]);}catch(_0x571477){return BPromise[_0x0f87('0x26')](_0x571477);}return _0x13ad14[_0x0f87('0x27')]();};}function saveUpdates(_0x2d805c,_0x17f71a){return function(_0xb9fc81){if(_0xb9fc81){return _0xb9fc81[_0x0f87('0x28')](_0x2d805c)['then'](function(_0x3c6577){return _0x3c6577;});}return null;};}function removeEntity(_0xd9cf2d,_0x27a332){return function(_0xa1e297){if(_0xa1e297){return _0xa1e297['destroy']()[_0x0f87('0x29')](function(){_0xd9cf2d[_0x0f87('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d09a0,_0x15d7de){return function(_0x7c4e4a){if(!_0x7c4e4a){_0x4d09a0[_0x0f87('0x1c')](0x194);}return _0x7c4e4a;};}function handleError(_0x5a6160,_0x38735c){_0x38735c=_0x38735c||0x1f4;return function(_0x425dbf){logger[_0x0f87('0x2a')](_0x425dbf['stack']);if(_0x425dbf['name']){delete _0x425dbf[_0x0f87('0x2b')];}_0x5a6160[_0x0f87('0x1d')](_0x38735c)[_0x0f87('0x2c')](_0x425dbf);};}exports[_0x0f87('0x2d')]=function(_0x181838,_0x1e95ff){var _0x17d3ec={},_0x107617={},_0x5aad0f={'count':0x0,'rows':[]};var _0x37973e=_['map'](db[_0x0f87('0x2e')]['rawAttributes'],function(_0x4ca3ec){return{'name':_0x4ca3ec[_0x0f87('0x2f')],'type':_0x4ca3ec[_0x0f87('0x30')]['key']};});_0x107617[_0x0f87('0x31')]=_[_0x0f87('0x32')](_0x37973e,_0x0f87('0x2b'));_0x107617[_0x0f87('0x33')]=_['keys'](_0x181838[_0x0f87('0x33')]);_0x107617[_0x0f87('0x34')]=_[_0x0f87('0x35')](_0x107617['model'],_0x107617[_0x0f87('0x33')]);_0x17d3ec[_0x0f87('0x36')]=_[_0x0f87('0x35')](_0x107617[_0x0f87('0x31')],qs[_0x0f87('0x37')](_0x181838[_0x0f87('0x33')]['fields']));_0x17d3ec[_0x0f87('0x36')]=_0x17d3ec['attributes'][_0x0f87('0x38')]?_0x17d3ec['attributes']:_0x107617[_0x0f87('0x31')];if(!_0x181838[_0x0f87('0x33')][_0x0f87('0x39')](_0x0f87('0x3a'))){_0x17d3ec['limit']=qs[_0x0f87('0x23')](_0x181838[_0x0f87('0x33')][_0x0f87('0x23')]);_0x17d3ec[_0x0f87('0x20')]=qs[_0x0f87('0x20')](_0x181838['query']['offset']);}_0x17d3ec['order']=qs['sort'](_0x181838[_0x0f87('0x33')][_0x0f87('0x3b')]);_0x17d3ec[_0x0f87('0x3c')]=qs[_0x0f87('0x34')](_['pick'](_0x181838['query'],_0x107617['filters']),_0x37973e);if(_0x181838[_0x0f87('0x33')][_0x0f87('0x3d')]){_0x17d3ec[_0x0f87('0x3c')]=_[_0x0f87('0x3e')](_0x17d3ec[_0x0f87('0x3c')],{'$or':_[_0x0f87('0x32')](_0x37973e,function(_0x371b7c){if(_0x371b7c[_0x0f87('0x30')]!==_0x0f87('0x3f')){var _0x1e3ffd={};_0x1e3ffd[_0x371b7c['name']]={'$like':'%'+_0x181838[_0x0f87('0x33')][_0x0f87('0x3d')]+'%'};return _0x1e3ffd;}})});}_0x17d3ec=_[_0x0f87('0x3e')]({},_0x17d3ec,_0x181838[_0x0f87('0x40')]);var _0x425ad4={'where':_0x17d3ec['where']};return db[_0x0f87('0x2e')][_0x0f87('0x22')](_0x425ad4)[_0x0f87('0x29')](function(_0x3492f6){_0x5aad0f['count']=_0x3492f6;if(_0x181838[_0x0f87('0x33')][_0x0f87('0x41')]){_0x17d3ec['include']=[{'all':!![]}];}return db[_0x0f87('0x2e')][_0x0f87('0x42')](_0x17d3ec);})[_0x0f87('0x29')](function(_0x307cca){_0x5aad0f['rows']=_0x307cca;return _0x5aad0f;})[_0x0f87('0x29')](respondWithFilteredResult(_0x1e95ff,_0x17d3ec))['catch'](handleError(_0x1e95ff,null));};exports[_0x0f87('0x43')]=function(_0x51076b,_0x5c357f){var _0x541a07={'raw':!![],'where':{'id':_0x51076b[_0x0f87('0x44')]['id']}},_0x585c0b={};_0x585c0b[_0x0f87('0x31')]=_[_0x0f87('0x45')](db[_0x0f87('0x2e')][_0x0f87('0x46')]);_0x585c0b[_0x0f87('0x33')]=_['keys'](_0x51076b[_0x0f87('0x33')]);_0x585c0b[_0x0f87('0x34')]=_[_0x0f87('0x35')](_0x585c0b[_0x0f87('0x31')],_0x585c0b[_0x0f87('0x33')]);_0x541a07['attributes']=_[_0x0f87('0x35')](_0x585c0b[_0x0f87('0x31')],qs[_0x0f87('0x37')](_0x51076b['query'][_0x0f87('0x37')]));_0x541a07[_0x0f87('0x36')]=_0x541a07[_0x0f87('0x36')][_0x0f87('0x38')]?_0x541a07[_0x0f87('0x36')]:_0x585c0b[_0x0f87('0x31')];if(_0x51076b[_0x0f87('0x33')][_0x0f87('0x41')]){_0x541a07[_0x0f87('0x47')]=[{'all':!![]}];}_0x541a07=_[_0x0f87('0x3e')]({},_0x541a07,_0x51076b[_0x0f87('0x40')]);return db[_0x0f87('0x2e')]['find'](_0x541a07)[_0x0f87('0x29')](handleEntityNotFound(_0x5c357f,null))[_0x0f87('0x29')](respondWithResult(_0x5c357f,null))[_0x0f87('0x48')](handleError(_0x5c357f,null));};exports[_0x0f87('0x49')]=function(_0x8c00e5,_0x225a6c){return db[_0x0f87('0x2e')]['create'](_0x8c00e5[_0x0f87('0x4a')],{})[_0x0f87('0x29')](respondWithResult(_0x225a6c,0xc9))['catch'](handleError(_0x225a6c,null));};exports[_0x0f87('0x28')]=function(_0x26b29f,_0x34c4a7){if(_0x26b29f[_0x0f87('0x4a')]['id']){delete _0x26b29f['body']['id'];}return db[_0x0f87('0x2e')][_0x0f87('0x4b')]({'where':{'id':_0x26b29f[_0x0f87('0x44')]['id']}})['then'](handleEntityNotFound(_0x34c4a7,null))[_0x0f87('0x29')](saveUpdates(_0x26b29f[_0x0f87('0x4a')],null))[_0x0f87('0x29')](respondWithResult(_0x34c4a7,null))[_0x0f87('0x48')](handleError(_0x34c4a7,null));};exports[_0x0f87('0x4c')]=function(_0x453b7c,_0x55127d){return db[_0x0f87('0x2e')][_0x0f87('0x4b')]({'where':{'id':_0x453b7c[_0x0f87('0x44')]['id']}})[_0x0f87('0x29')](handleEntityNotFound(_0x55127d,null))[_0x0f87('0x29')](removeEntity(_0x55127d,null))[_0x0f87('0x48')](handleError(_0x55127d,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 93d9808..6ea4cc9 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 _0xb47f=['api','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','lodash','util','../../config/logger'];(function(_0x54784f,_0x2a24d8){var _0x241e1b=function(_0x3a4cc2){while(--_0x3a4cc2){_0x54784f['push'](_0x54784f['shift']());}};_0x241e1b(++_0x2a24d8);}(_0xb47f,0x66));var _0xfb47=function(_0x5760ce,_0x36e4a3){_0x5760ce=_0x5760ce-0x0;var _0xd87900=_0xb47f[_0x5760ce];return _0xd87900;};'use strict';var _=require(_0xfb47('0x0'));var util=require(_0xfb47('0x1'));var logger=require(_0xfb47('0x2'))(_0xfb47('0x3'));var moment=require(_0xfb47('0x4'));var BPromise=require(_0xfb47('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb47('0x6'));var rimraf=require(_0xfb47('0x7'));var config=require(_0xfb47('0x8'));var attributes=require(_0xfb47('0x9'));module[_0xfb47('0xa')]=function(_0x205fa6,_0x2d5501){return _0x205fa6[_0xfb47('0xb')]('Dynamics365Field',attributes,{'tableName':_0xfb47('0xc'),'paranoid':![],'indexes':[{'name':_0xfb47('0xd'),'fields':[_0xfb47('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1f49=['define','Dynamics365Field','int_dynamics365_fields','FieldId','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./intDynamics365Field.attributes'];(function(_0x34e019,_0x369969){var _0x31a180=function(_0x98ed00){while(--_0x98ed00){_0x34e019['push'](_0x34e019['shift']());}};_0x31a180(++_0x369969);}(_0x1f49,0x70));var _0x91f4=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x1f49[_0x1cb18a];return _0x22442e;};'use strict';var _=require(_0x91f4('0x0'));var util=require(_0x91f4('0x1'));var logger=require(_0x91f4('0x2'))(_0x91f4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x91f4('0x4'));var rimraf=require(_0x91f4('0x5'));var config=require(_0x91f4('0x6'));var attributes=require(_0x91f4('0x7'));module['exports']=function(_0x28d84b,_0x1e82f9){return _0x28d84b[_0x91f4('0x8')](_0x91f4('0x9'),attributes,{'tableName':_0x91f4('0xa'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0x91f4('0xb')],'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 2ccc8f0..e1ae69d 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 _0x2898=['request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','Dynamics365Field,\x20%s,\x20%s'];(function(_0x29fc98,_0x2547e4){var _0x1f3447=function(_0x40858c){while(--_0x40858c){_0x29fc98['push'](_0x29fc98['shift']());}};_0x1f3447(++_0x2547e4);}(_0x2898,0x1bd));var _0x8289=function(_0x2714ec,_0x36daa4){_0x2714ec=_0x2714ec-0x0;var _0x2608e5=_0x2898[_0x2714ec];return _0x2608e5;};'use strict';var _=require(_0x8289('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8289('0x1'));var fs=require('fs');var Redis=require(_0x8289('0x2'));var db=require(_0x8289('0x3'))['db'];var utils=require(_0x8289('0x4'));var logger=require(_0x8289('0x5'))('rpc');var config=require(_0x8289('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8289('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49e101,_0x15e37d,_0x261db6){return new BPromise(function(_0x524099,_0x4c0dcd){return client['request'](_0x49e101,_0x261db6)[_0x8289('0x8')](function(_0x3272e8){logger[_0x8289('0x9')](_0x8289('0xa'),_0x15e37d,_0x8289('0xb'));logger[_0x8289('0xc')](_0x8289('0xd'),_0x15e37d,_0x8289('0xb'),JSON[_0x8289('0xe')](_0x3272e8));if(_0x3272e8[_0x8289('0xf')]){if(_0x3272e8[_0x8289('0xf')][_0x8289('0x10')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x15e37d,_0x3272e8[_0x8289('0xf')]['message']);return _0x4c0dcd(_0x3272e8[_0x8289('0xf')][_0x8289('0x11')]);}logger[_0x8289('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x15e37d,_0x3272e8[_0x8289('0xf')][_0x8289('0x11')]);return _0x524099(_0x3272e8[_0x8289('0xf')][_0x8289('0x11')]);}else{logger['info'](_0x8289('0xa'),_0x15e37d,_0x8289('0xb'));_0x524099(_0x3272e8[_0x8289('0x12')][_0x8289('0x11')]);}})['catch'](function(_0x5de34d){logger[_0x8289('0xf')](_0x8289('0xa'),_0x15e37d,_0x5de34d);_0x4c0dcd(_0x5de34d);});});} \ No newline at end of file +var _0xb748=['code','message','info','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3e1a03,_0x70d28b){var _0x468592=function(_0x249c0d){while(--_0x249c0d){_0x3e1a03['push'](_0x3e1a03['shift']());}};_0x468592(++_0x70d28b);}(_0xb748,0xd6));var _0x8b74=function(_0xa84669,_0x5288c0){_0xa84669=_0xa84669-0x0;var _0x3c6ba4=_0xb748[_0xa84669];return _0x3c6ba4;};'use strict';var _=require(_0x8b74('0x0'));var util=require('util');var moment=require(_0x8b74('0x1'));var BPromise=require(_0x8b74('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b74('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8b74('0x4'))(_0x8b74('0x5'));var config=require('../../config/environment');var jayson=require(_0x8b74('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ce378,_0x5af4e7,_0x2f6a34){return new BPromise(function(_0xff7f61,_0x1649b7){return client[_0x8b74('0x7')](_0x3ce378,_0x2f6a34)[_0x8b74('0x8')](function(_0x32b096){logger['info'](_0x8b74('0x9'),_0x5af4e7,_0x8b74('0xa'));logger[_0x8b74('0xb')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x5af4e7,_0x8b74('0xa'),JSON[_0x8b74('0xc')](_0x32b096));if(_0x32b096[_0x8b74('0xd')]){if(_0x32b096[_0x8b74('0xd')][_0x8b74('0xe')]===0x1f4){logger[_0x8b74('0xd')](_0x8b74('0x9'),_0x5af4e7,_0x32b096['error']['message']);return _0x1649b7(_0x32b096[_0x8b74('0xd')]['message']);}logger[_0x8b74('0xd')](_0x8b74('0x9'),_0x5af4e7,_0x32b096[_0x8b74('0xd')][_0x8b74('0xf')]);return _0xff7f61(_0x32b096[_0x8b74('0xd')][_0x8b74('0xf')]);}else{logger[_0x8b74('0x10')](_0x8b74('0x9'),_0x5af4e7,_0x8b74('0xa'));_0xff7f61(_0x32b096[_0x8b74('0x11')][_0x8b74('0xf')]);}})[_0x8b74('0x12')](function(_0x378504){logger['error'](_0x8b74('0x9'),_0x5af4e7,_0x378504);_0x1649b7(_0x378504);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 373037f..75c979e 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 _0x6ba9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x27319b,_0x53cd84){var _0x17f78b=function(_0x2f6c23){while(--_0x2f6c23){_0x27319b['push'](_0x27319b['shift']());}};_0x17f78b(++_0x53cd84);}(_0x6ba9,0x1f1));var _0x96ba=function(_0x54149e,_0x3c1fd0){_0x54149e=_0x54149e-0x0;var _0x145f18=_0x6ba9[_0x54149e];return _0x145f18;};'use strict';var multer=require(_0x96ba('0x0'));var util=require(_0x96ba('0x1'));var path=require('path');var timeout=require(_0x96ba('0x2'));var express=require('express');var router=express[_0x96ba('0x3')]();var fs_extra=require(_0x96ba('0x4'));var auth=require(_0x96ba('0x5'));var interaction=require(_0x96ba('0x6'));var config=require('../../config/environment');var controller=require(_0x96ba('0x7'));router[_0x96ba('0x8')]('/',auth[_0x96ba('0x9')](),controller[_0x96ba('0xa')]);router[_0x96ba('0x8')](_0x96ba('0xb'),auth[_0x96ba('0x9')](),controller[_0x96ba('0xc')]);router[_0x96ba('0x8')]('/:id/configurations',auth[_0x96ba('0x9')](),controller[_0x96ba('0xd')]);router[_0x96ba('0x8')](_0x96ba('0xe'),auth['isAuthenticated'](),controller[_0x96ba('0xf')]);router['post']('/',auth[_0x96ba('0x9')](),controller[_0x96ba('0x10')]);router[_0x96ba('0x11')](_0x96ba('0x12'),auth['isAuthenticated'](),controller[_0x96ba('0x13')]);router[_0x96ba('0x14')]('/:id',auth[_0x96ba('0x9')](),controller[_0x96ba('0x15')]);router[_0x96ba('0x16')](_0x96ba('0xb'),auth['isAuthenticated'](),controller[_0x96ba('0x17')]);module[_0x96ba('0x18')]=router; \ No newline at end of file +var _0xa71e=['/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x2bd408,_0x4c5659){var _0x54c9f1=function(_0x11e6e3){while(--_0x11e6e3){_0x2bd408['push'](_0x2bd408['shift']());}};_0x54c9f1(++_0x4c5659);}(_0xa71e,0x181));var _0xea71=function(_0x5c619e,_0x1bccdf){_0x5c619e=_0x5c619e-0x0;var _0x445cf8=_0xa71e[_0x5c619e];return _0x445cf8;};'use strict';var multer=require(_0xea71('0x0'));var util=require(_0xea71('0x1'));var path=require('path');var timeout=require(_0xea71('0x2'));var express=require(_0xea71('0x3'));var router=express[_0xea71('0x4')]();var fs_extra=require(_0xea71('0x5'));var auth=require(_0xea71('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xea71('0x7'));var controller=require('./intFreshdeskAccount.controller');router[_0xea71('0x8')]('/',auth[_0xea71('0x9')](),controller[_0xea71('0xa')]);router[_0xea71('0x8')](_0xea71('0xb'),auth[_0xea71('0x9')](),controller[_0xea71('0xc')]);router[_0xea71('0x8')](_0xea71('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xea71('0x8')](_0xea71('0xe'),auth[_0xea71('0x9')](),controller[_0xea71('0xf')]);router[_0xea71('0x10')]('/',auth[_0xea71('0x9')](),controller[_0xea71('0x11')]);router[_0xea71('0x10')](_0xea71('0xd'),auth[_0xea71('0x9')](),controller[_0xea71('0x12')]);router[_0xea71('0x13')](_0xea71('0xb'),auth[_0xea71('0x9')](),controller[_0xea71('0x14')]);router['delete'](_0xea71('0xb'),auth[_0xea71('0x9')](),controller[_0xea71('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 62f1d4e..fb63967 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 _0x4e2e=['username','remoteUri','exports','STRING'];(function(_0x2b05fa,_0x481073){var _0x25633c=function(_0x1698cf){while(--_0x1698cf){_0x2b05fa['push'](_0x2b05fa['shift']());}};_0x25633c(++_0x481073);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x272521,_0x2c66fe){_0x272521=_0x272521-0x0;var _0x4b5a98=_0x4e2e[_0x272521];return _0x4b5a98;};'use strict';var Sequelize=require('sequelize');module[_0xe4e2('0x0')]={'name':{'type':Sequelize[_0xe4e2('0x1')]},'description':{'type':Sequelize[_0xe4e2('0x1')]},'username':{'type':Sequelize[_0xe4e2('0x1')],'unique':_0xe4e2('0x2')},'apiKey':{'type':Sequelize[_0xe4e2('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xe4e2('0x3')},'serverUrl':{'type':Sequelize[_0xe4e2('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x77d4=['exports','STRING','username'];(function(_0x312ad6,_0x5dcca8){var _0x1069dc=function(_0x42446d){while(--_0x42446d){_0x312ad6['push'](_0x312ad6['shift']());}};_0x1069dc(++_0x5dcca8);}(_0x77d4,0x108));var _0x477d=function(_0x561e7b,_0x4bcd2e){_0x561e7b=_0x561e7b-0x0;var _0x5851ed=_0x77d4[_0x561e7b];return _0x5851ed;};'use strict';var Sequelize=require('sequelize');module[_0x477d('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x477d('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x477d('0x2')},'apiKey':{'type':Sequelize[_0x477d('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x477d('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 517e8df..3957aa7 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 _0xe189=['map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','FreshdeskAccount','findAll','catch','find','create','body','params','findOne','FreshdeskConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','apiKey','slice','substring','%s/%s','format','Basic\x20%s','%s:X','toString','base64','requester','description','priority','group','source','company','remove','includes','label','default','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','key'];(function(_0x31548e,_0x590a05){var _0x201187=function(_0x5f4ae8){while(--_0x5f4ae8){_0x31548e['push'](_0x31548e['shift']());}};_0x201187(++_0x590a05);}(_0xe189,0x194));var _0x9e18=function(_0x45d102,_0x377b5e){_0x45d102=_0x45d102-0x0;var _0x13f37d=_0xe189[_0x45d102];return _0x13f37d;};'use strict';var emlformat=require(_0x9e18('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9e18('0x1'));var rp=require(_0x9e18('0x2'));var moment=require(_0x9e18('0x3'));var BPromise=require(_0x9e18('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9e18('0x5'));var sox=require(_0x9e18('0x6'));var csv=require(_0x9e18('0x7'));var ejs=require(_0x9e18('0x8'));var fs=require('fs');var fs_extra=require(_0x9e18('0x9'));var _=require('lodash');var squel=require(_0x9e18('0xa'));var crypto=require(_0x9e18('0xb'));var jsforce=require(_0x9e18('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9e18('0x7'));var querystring=require(_0x9e18('0xd'));var Papa=require(_0x9e18('0xe'));var Redis=require('ioredis');var authService=require(_0x9e18('0xf'));var qs=require(_0x9e18('0x10'));var as=require(_0x9e18('0x11'));var hardwareService=require(_0x9e18('0x12'));var logger=require(_0x9e18('0x13'))(_0x9e18('0x14'));var utils=require(_0x9e18('0x15'));var config=require(_0x9e18('0x16'));var licenseUtil=require(_0x9e18('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9e18('0x18'));function respondWithStatusCode(_0x502513,_0x39a077){_0x39a077=_0x39a077||0xcc;return function(_0x56c209){if(_0x56c209){return _0x502513['sendStatus'](_0x39a077);}return _0x502513[_0x9e18('0x19')](_0x39a077)[_0x9e18('0x1a')]();};}function respondWithResult(_0x35c4e1,_0x97e41a){_0x97e41a=_0x97e41a||0xc8;return function(_0x566954){if(_0x566954){return _0x35c4e1[_0x9e18('0x19')](_0x97e41a)['json'](_0x566954);}};}function respondWithFilteredResult(_0x57bcd9,_0xb10405){return function(_0x4e7bcb){if(_0x4e7bcb){var _0x691a51=typeof _0xb10405[_0x9e18('0x1b')]===_0x9e18('0x1c')&&typeof _0xb10405[_0x9e18('0x1d')]==='undefined';var _0x4a5247=_0x4e7bcb[_0x9e18('0x1e')];var _0x446098=_0x691a51?0x0:_0xb10405['offset'];var _0x1aa23f=_0x691a51?_0x4e7bcb['count']:_0xb10405[_0x9e18('0x1b')]+_0xb10405['limit'];var _0x2ef267;if(_0x1aa23f>=_0x4a5247){_0x1aa23f=_0x4a5247;_0x2ef267=0xc8;}else{_0x2ef267=0xce;}_0x57bcd9[_0x9e18('0x19')](_0x2ef267);return _0x57bcd9[_0x9e18('0x1f')](_0x9e18('0x20'),_0x446098+'-'+_0x1aa23f+'/'+_0x4a5247)[_0x9e18('0x21')](_0x4e7bcb);}return null;};}function patchUpdates(_0x3fb6ba){return function(_0x21d814){try{jsonpatch[_0x9e18('0x22')](_0x21d814,_0x3fb6ba,!![]);}catch(_0x11619d){return BPromise['reject'](_0x11619d);}return _0x21d814[_0x9e18('0x23')]();};}function saveUpdates(_0x24cc43,_0x37738e){return function(_0x52039e){if(_0x52039e){return _0x52039e[_0x9e18('0x24')](_0x24cc43)['then'](function(_0x4b591){return _0x4b591;});}return null;};}function removeEntity(_0x50131d,_0x2f5a26){return function(_0x4eabe9){if(_0x4eabe9){return _0x4eabe9[_0x9e18('0x25')]()[_0x9e18('0x26')](function(){_0x50131d['status'](0xcc)[_0x9e18('0x1a')]();});}};}function handleEntityNotFound(_0x4b6ab5,_0x4c133b){return function(_0x445f10){if(!_0x445f10){_0x4b6ab5['sendStatus'](0x194);}return _0x445f10;};}function handleError(_0x4513e7,_0x49a3d6){_0x49a3d6=_0x49a3d6||0x1f4;return function(_0xcf65ba){logger[_0x9e18('0x27')](_0xcf65ba[_0x9e18('0x28')]);if(_0xcf65ba[_0x9e18('0x29')]){delete _0xcf65ba[_0x9e18('0x29')];}_0x4513e7[_0x9e18('0x19')](_0x49a3d6)[_0x9e18('0x2a')](_0xcf65ba);};}exports[_0x9e18('0x2b')]=function(_0xc75df0,_0x5e1eb2){var _0x2ee4da={},_0x2621e9={},_0x284f51={'count':0x0,'rows':[]};var _0x2325b6=_['map'](db['FreshdeskAccount'][_0x9e18('0x2c')],function(_0x1bb217){return{'name':_0x1bb217[_0x9e18('0x2d')],'type':_0x1bb217[_0x9e18('0x2e')][_0x9e18('0x2f')]};});_0x2621e9['model']=_[_0x9e18('0x30')](_0x2325b6,_0x9e18('0x29'));_0x2621e9[_0x9e18('0x31')]=_[_0x9e18('0x32')](_0xc75df0[_0x9e18('0x31')]);_0x2621e9[_0x9e18('0x33')]=_['intersection'](_0x2621e9[_0x9e18('0x34')],_0x2621e9[_0x9e18('0x31')]);_0x2ee4da[_0x9e18('0x35')]=_[_0x9e18('0x36')](_0x2621e9[_0x9e18('0x34')],qs['fields'](_0xc75df0['query'][_0x9e18('0x37')]));_0x2ee4da[_0x9e18('0x35')]=_0x2ee4da[_0x9e18('0x35')][_0x9e18('0x38')]?_0x2ee4da['attributes']:_0x2621e9[_0x9e18('0x34')];if(!_0xc75df0[_0x9e18('0x31')][_0x9e18('0x39')]('nolimit')){_0x2ee4da[_0x9e18('0x1d')]=qs['limit'](_0xc75df0[_0x9e18('0x31')]['limit']);_0x2ee4da[_0x9e18('0x1b')]=qs[_0x9e18('0x1b')](_0xc75df0[_0x9e18('0x31')][_0x9e18('0x1b')]);}_0x2ee4da[_0x9e18('0x3a')]=qs[_0x9e18('0x3b')](_0xc75df0[_0x9e18('0x31')][_0x9e18('0x3b')]);_0x2ee4da[_0x9e18('0x3c')]=qs[_0x9e18('0x33')](_[_0x9e18('0x3d')](_0xc75df0['query'],_0x2621e9[_0x9e18('0x33')]),_0x2325b6);if(_0xc75df0[_0x9e18('0x31')][_0x9e18('0x3e')]){_0x2ee4da[_0x9e18('0x3c')]=_[_0x9e18('0x3f')](_0x2ee4da[_0x9e18('0x3c')],{'$or':_[_0x9e18('0x30')](_0x2325b6,function(_0x2bfaf4){if(_0x2bfaf4[_0x9e18('0x2e')]!==_0x9e18('0x40')){var _0x258969={};_0x258969[_0x2bfaf4[_0x9e18('0x29')]]={'$like':'%'+_0xc75df0[_0x9e18('0x31')][_0x9e18('0x3e')]+'%'};return _0x258969;}})});}_0x2ee4da=_['merge']({},_0x2ee4da,_0xc75df0[_0x9e18('0x41')]);var _0x5d9ffe={'where':_0x2ee4da[_0x9e18('0x3c')]};return db['FreshdeskAccount'][_0x9e18('0x1e')](_0x5d9ffe)[_0x9e18('0x26')](function(_0x1821cb){_0x284f51[_0x9e18('0x1e')]=_0x1821cb;if(_0xc75df0[_0x9e18('0x31')][_0x9e18('0x42')]){_0x2ee4da[_0x9e18('0x43')]=[{'all':!![]}];}return db[_0x9e18('0x44')][_0x9e18('0x45')](_0x2ee4da);})[_0x9e18('0x26')](function(_0x579142){_0x284f51['rows']=_0x579142;return _0x284f51;})['then'](respondWithFilteredResult(_0x5e1eb2,_0x2ee4da))[_0x9e18('0x46')](handleError(_0x5e1eb2,null));};exports['show']=function(_0x4ad78e,_0x411317){var _0xb11dc0={'raw':![],'where':{'id':_0x4ad78e['params']['id']}},_0x2f38b9={};_0x2f38b9[_0x9e18('0x34')]=_[_0x9e18('0x32')](db[_0x9e18('0x44')][_0x9e18('0x2c')]);_0x2f38b9[_0x9e18('0x31')]=_['keys'](_0x4ad78e[_0x9e18('0x31')]);_0x2f38b9[_0x9e18('0x33')]=_[_0x9e18('0x36')](_0x2f38b9[_0x9e18('0x34')],_0x2f38b9['query']);_0xb11dc0[_0x9e18('0x35')]=_[_0x9e18('0x36')](_0x2f38b9[_0x9e18('0x34')],qs[_0x9e18('0x37')](_0x4ad78e[_0x9e18('0x31')]['fields']));_0xb11dc0[_0x9e18('0x35')]=_0xb11dc0[_0x9e18('0x35')][_0x9e18('0x38')]?_0xb11dc0[_0x9e18('0x35')]:_0x2f38b9[_0x9e18('0x34')];if(_0x4ad78e['query']['includeAll']){_0xb11dc0['include']=[{'all':!![]}];}_0xb11dc0=_['merge']({},_0xb11dc0,_0x4ad78e[_0x9e18('0x41')]);return db[_0x9e18('0x44')][_0x9e18('0x47')](_0xb11dc0)[_0x9e18('0x26')](handleEntityNotFound(_0x411317,null))[_0x9e18('0x26')](respondWithResult(_0x411317,null))['catch'](handleError(_0x411317,null));};exports[_0x9e18('0x48')]=function(_0x36eeaf,_0x375f11){return db[_0x9e18('0x44')]['create'](_0x36eeaf['body'],{})[_0x9e18('0x26')](respondWithResult(_0x375f11,0xc9))[_0x9e18('0x46')](handleError(_0x375f11,null));};exports[_0x9e18('0x24')]=function(_0x28a370,_0xda11e3){if(_0x28a370[_0x9e18('0x49')]['id']){delete _0x28a370['body']['id'];}return db[_0x9e18('0x44')]['find']({'where':{'id':_0x28a370[_0x9e18('0x4a')]['id']}})[_0x9e18('0x26')](handleEntityNotFound(_0xda11e3,null))[_0x9e18('0x26')](saveUpdates(_0x28a370[_0x9e18('0x49')],null))[_0x9e18('0x26')](respondWithResult(_0xda11e3,null))[_0x9e18('0x46')](handleError(_0xda11e3,null));};exports[_0x9e18('0x25')]=function(_0x3edade,_0x352ca5){return db[_0x9e18('0x44')][_0x9e18('0x47')]({'where':{'id':_0x3edade[_0x9e18('0x4a')]['id']}})[_0x9e18('0x26')](handleEntityNotFound(_0x352ca5,null))[_0x9e18('0x26')](removeEntity(_0x352ca5,null))[_0x9e18('0x46')](handleError(_0x352ca5,null));};exports['getConfigurations']=function(_0x210835,_0x134abb,_0x2d0811){var _0x324079={};var _0x2fe5c8={};var _0x4ce26e;var _0x2630aa;return db[_0x9e18('0x44')][_0x9e18('0x4b')]({'where':{'id':_0x210835[_0x9e18('0x4a')]['id']}})[_0x9e18('0x26')](handleEntityNotFound(_0x134abb,null))[_0x9e18('0x26')](function(_0x1db24e){if(_0x1db24e){_0x4ce26e=_0x1db24e;_0x2fe5c8[_0x9e18('0x34')]=_[_0x9e18('0x32')](db[_0x9e18('0x4c')][_0x9e18('0x2c')]);_0x2fe5c8[_0x9e18('0x31')]=_[_0x9e18('0x32')](_0x210835[_0x9e18('0x31')]);_0x2fe5c8[_0x9e18('0x33')]=_[_0x9e18('0x36')](_0x2fe5c8[_0x9e18('0x34')],_0x2fe5c8[_0x9e18('0x31')]);_0x324079[_0x9e18('0x35')]=_[_0x9e18('0x36')](_0x2fe5c8[_0x9e18('0x34')],qs[_0x9e18('0x37')](_0x210835[_0x9e18('0x31')][_0x9e18('0x37')]));_0x324079[_0x9e18('0x35')]=_0x324079[_0x9e18('0x35')][_0x9e18('0x38')]?_0x324079['attributes']:_0x2fe5c8[_0x9e18('0x34')];_0x324079[_0x9e18('0x3a')]=qs[_0x9e18('0x3b')](_0x210835[_0x9e18('0x31')][_0x9e18('0x3b')]);_0x324079[_0x9e18('0x3c')]=qs[_0x9e18('0x33')](_['pick'](_0x210835[_0x9e18('0x31')],_0x2fe5c8[_0x9e18('0x33')]));if(_0x210835[_0x9e18('0x31')][_0x9e18('0x3e')]){_0x324079[_0x9e18('0x3c')]=_[_0x9e18('0x3f')](_0x324079[_0x9e18('0x3c')],{'$or':_[_0x9e18('0x30')](_0x324079[_0x9e18('0x35')],function(_0x5f07e5){var _0x7aeac0={};_0x7aeac0[_0x5f07e5]={'$like':'%'+_0x210835[_0x9e18('0x31')]['filter']+'%'};return _0x7aeac0;})});}_0x324079=_[_0x9e18('0x3f')]({},_0x324079,_0x210835[_0x9e18('0x41')]);return _0x4ce26e[_0x9e18('0x4d')](_0x324079);}})[_0x9e18('0x26')](function(_0x4cdfe3){if(_0x4cdfe3){_0x2630aa=_0x4cdfe3[_0x9e18('0x38')];if(!_0x210835[_0x9e18('0x31')][_0x9e18('0x39')](_0x9e18('0x4e'))){_0x324079['limit']=qs[_0x9e18('0x1d')](_0x210835[_0x9e18('0x31')][_0x9e18('0x1d')]);_0x324079[_0x9e18('0x1b')]=qs['offset'](_0x210835[_0x9e18('0x31')]['offset']);}return _0x4ce26e[_0x9e18('0x4d')](_0x324079);}})[_0x9e18('0x26')](function(_0x2ee076){if(_0x2ee076){return _0x2ee076?{'count':_0x2630aa,'rows':_0x2ee076}:null;}})[_0x9e18('0x26')](respondWithResult(_0x134abb,null))[_0x9e18('0x46')](handleError(_0x134abb,null));};exports[_0x9e18('0x4f')]=function(_0x60233c,_0x212341,_0x5673dc){if(_0x60233c[_0x9e18('0x49')]['id']){delete _0x60233c[_0x9e18('0x49')]['id'];}return db[_0x9e18('0x44')][_0x9e18('0x4b')]({'where':{'id':_0x60233c['params']['id']}})['then'](handleEntityNotFound(_0x212341,null))[_0x9e18('0x26')](function(_0x21f734){if(_0x21f734){_0x60233c[_0x9e18('0x49')][_0x9e18('0x50')]=_0x21f734['id'];_0x60233c[_0x9e18('0x49')][_0x9e18('0x51')]=integrations['getSubjects'](_0x60233c['body'][_0x9e18('0x52')],_0x60233c[_0x9e18('0x49')][_0x9e18('0x2e')]);_0x60233c[_0x9e18('0x49')][_0x9e18('0x53')]=integrations[_0x9e18('0x54')](_0x60233c['body'][_0x9e18('0x52')],_0x60233c['body']['type']);return db['FreshdeskConfiguration']['create'](_0x60233c[_0x9e18('0x49')],{'include':[{'model':db[_0x9e18('0x55')],'as':_0x9e18('0x51')},{'model':db[_0x9e18('0x55')],'as':_0x9e18('0x53')}]});}return null;})[_0x9e18('0x26')](respondWithResult(_0x212341,null))[_0x9e18('0x46')](handleError(_0x212341,null));};exports['getFields']=function(_0x222366,_0x1e241d,_0x569cf5){var _0x52a6ef='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x222366[_0x9e18('0x4a')]['id']},'attributes':['id',_0x9e18('0x56'),_0x9e18('0x57')]})[_0x9e18('0x26')](handleEntityNotFound(_0x1e241d,null))['then'](function(_0x5c4d97){if(_0x5c4d97){_0x52a6ef=_0x5c4d97[_0x9e18('0x56')];var _0x40384b=_0x52a6ef[_0x9e18('0x58')](-0x1);if(_0x40384b==='/'){_0x52a6ef=_0x52a6ef[_0x9e18('0x59')](0x0,_0x52a6ef['lastIndexOf'](_0x40384b));}return rp({'method':'GET','uri':util['format'](_0x9e18('0x5a'),_0x52a6ef,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x9e18('0x5b')](_0x9e18('0x5c'),new Buffer(util[_0x9e18('0x5b')](_0x9e18('0x5d'),_0x5c4d97[_0x9e18('0x57')]))[_0x9e18('0x5e')](_0x9e18('0x5f')))},'json':!![]});}})[_0x9e18('0x26')](function(_0xf60714){if(_0xf60714){var _0x5217bd=[_0x9e18('0x60'),'subject','agent',_0x9e18('0x61'),_0x9e18('0x19'),_0x9e18('0x62'),_0x9e18('0x63'),_0x9e18('0x64'),'ticket_type',_0x9e18('0x63'),_0x9e18('0x65')];_[_0x9e18('0x66')](_0xf60714,function(_0x55f676){return _0x5217bd[_0x9e18('0x67')](_0x55f676[_0x9e18('0x29')])||!_0x55f676['default']&&_0x55f676[_0x9e18('0x2e')]!=='custom_text'&&_0x55f676['type']!=='custom_dropdown';});return{'count':_0xf60714[_0x9e18('0x38')],'rows':_[_0x9e18('0x30')](_0xf60714,function(_0x4ceeb3){return{'id':_0x4ceeb3[_0x9e18('0x29')],'name':_0x4ceeb3[_0x9e18('0x68')],'custom':!_0x4ceeb3[_0x9e18('0x69')],'options':_0x4ceeb3['choices']?_['map'](_0x4ceeb3[_0x9e18('0x6a')],function(_0x539aa9){return{'name':_[_0x9e18('0x6b')](_0x539aa9),'value':_0x539aa9};}):[]};})};}})[_0x9e18('0x26')](respondWithResult(_0x1e241d,null))['catch'](function(_0x2d8c1a){var _0x503234=_0x222366[_0x9e18('0x31')][_0x9e18('0x6c')]?0x1f4:_0x2d8c1a['statusCode']||0x1f4;logger[_0x9e18('0x27')](_0x9e18('0x6d'),'getFields',_0x503234,JSON[_0x9e18('0x6e')](_0x2d8c1a));delete _0x2d8c1a[_0x9e18('0x29')];if(_0x503234===0x191){_0x503234=0x190;}_0x1e241d[_0x9e18('0x19')](_0x503234)[_0x9e18('0x2a')](_0x222366[_0x9e18('0x31')][_0x9e18('0x6c')]?{'message':_0x9e18('0x6f'),'statusCode':_0x2d8c1a[_0x9e18('0x70')]}:_0x2d8c1a);});}; \ No newline at end of file +var _0x9990=['ticket_type','company','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','error','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','FreshdeskAccount','includeAll','include','findAll','rows','catch','params','find','create','body','getConfigurations','findOne','order','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','slice','substring','lastIndexOf','format','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','toString','base64','requester','agent','description','priority','group','source'];(function(_0x151334,_0x1e11ac){var _0x3d03da=function(_0x2099cf){while(--_0x2099cf){_0x151334['push'](_0x151334['shift']());}};_0x3d03da(++_0x1e11ac);}(_0x9990,0xf6));var _0x0999=function(_0x243e12,_0x2d7bc5){_0x243e12=_0x243e12-0x0;var _0x3fddfc=_0x9990[_0x243e12];return _0x3fddfc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0999('0x0'));var zipdir=require(_0x0999('0x1'));var jsonpatch=require(_0x0999('0x2'));var rp=require(_0x0999('0x3'));var moment=require(_0x0999('0x4'));var BPromise=require(_0x0999('0x5'));var Mustache=require(_0x0999('0x6'));var util=require(_0x0999('0x7'));var path=require('path');var sox=require(_0x0999('0x8'));var csv=require(_0x0999('0x9'));var ejs=require(_0x0999('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0999('0xb'));var squel=require(_0x0999('0xc'));var crypto=require(_0x0999('0xd'));var jsforce=require(_0x0999('0xe'));var deskjs=require(_0x0999('0xf'));var toCsv=require(_0x0999('0x9'));var querystring=require(_0x0999('0x10'));var Papa=require('papaparse');var Redis=require(_0x0999('0x11'));var authService=require(_0x0999('0x12'));var qs=require(_0x0999('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0999('0x14'));var logger=require(_0x0999('0x15'))(_0x0999('0x16'));var utils=require('../../config/utils');var config=require(_0x0999('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0999('0x18'))['db'];var integrations=require(_0x0999('0x19'));function respondWithStatusCode(_0x2ea251,_0x428b59){_0x428b59=_0x428b59||0xcc;return function(_0x1a7598){if(_0x1a7598){return _0x2ea251['sendStatus'](_0x428b59);}return _0x2ea251[_0x0999('0x1a')](_0x428b59)[_0x0999('0x1b')]();};}function respondWithResult(_0x39cba9,_0x4011bf){_0x4011bf=_0x4011bf||0xc8;return function(_0x294776){if(_0x294776){return _0x39cba9['status'](_0x4011bf)[_0x0999('0x1c')](_0x294776);}};}function respondWithFilteredResult(_0x3757ae,_0x6bf882){return function(_0x4e4e53){if(_0x4e4e53){var _0x2d0ca2=typeof _0x6bf882[_0x0999('0x1d')]===_0x0999('0x1e')&&typeof _0x6bf882['limit']===_0x0999('0x1e');var _0x335d84=_0x4e4e53['count'];var _0x107573=_0x2d0ca2?0x0:_0x6bf882[_0x0999('0x1d')];var _0x56373e=_0x2d0ca2?_0x4e4e53[_0x0999('0x1f')]:_0x6bf882[_0x0999('0x1d')]+_0x6bf882[_0x0999('0x20')];var _0x470c84;if(_0x56373e>=_0x335d84){_0x56373e=_0x335d84;_0x470c84=0xc8;}else{_0x470c84=0xce;}_0x3757ae[_0x0999('0x1a')](_0x470c84);return _0x3757ae[_0x0999('0x21')](_0x0999('0x22'),_0x107573+'-'+_0x56373e+'/'+_0x335d84)[_0x0999('0x1c')](_0x4e4e53);}return null;};}function patchUpdates(_0x8a5ef6){return function(_0x4d451b){try{jsonpatch[_0x0999('0x23')](_0x4d451b,_0x8a5ef6,!![]);}catch(_0xb6dec){return BPromise['reject'](_0xb6dec);}return _0x4d451b['save']();};}function saveUpdates(_0x19ddc0,_0xf2820c){return function(_0x2404be){if(_0x2404be){return _0x2404be[_0x0999('0x24')](_0x19ddc0)[_0x0999('0x25')](function(_0x15a7e8){return _0x15a7e8;});}return null;};}function removeEntity(_0x4d4f38,_0x20ba88){return function(_0x5f4611){if(_0x5f4611){return _0x5f4611[_0x0999('0x26')]()['then'](function(){_0x4d4f38[_0x0999('0x1a')](0xcc)[_0x0999('0x1b')]();});}};}function handleEntityNotFound(_0x273163,_0x317127){return function(_0x4ba35b){if(!_0x4ba35b){_0x273163['sendStatus'](0x194);}return _0x4ba35b;};}function handleError(_0x1cc734,_0x5e5681){_0x5e5681=_0x5e5681||0x1f4;return function(_0x353b0a){logger['error'](_0x353b0a[_0x0999('0x27')]);if(_0x353b0a[_0x0999('0x28')]){delete _0x353b0a[_0x0999('0x28')];}_0x1cc734[_0x0999('0x1a')](_0x5e5681)[_0x0999('0x29')](_0x353b0a);};}exports[_0x0999('0x2a')]=function(_0x3cf0d3,_0x5c9fb4){var _0x1df4cf={},_0x199df7={},_0x36cd03={'count':0x0,'rows':[]};var _0x24411f=_[_0x0999('0x2b')](db['FreshdeskAccount'][_0x0999('0x2c')],function(_0x1cc07f){return{'name':_0x1cc07f[_0x0999('0x2d')],'type':_0x1cc07f['type']['key']};});_0x199df7[_0x0999('0x2e')]=_[_0x0999('0x2b')](_0x24411f,'name');_0x199df7[_0x0999('0x2f')]=_[_0x0999('0x30')](_0x3cf0d3[_0x0999('0x2f')]);_0x199df7['filters']=_[_0x0999('0x31')](_0x199df7['model'],_0x199df7[_0x0999('0x2f')]);_0x1df4cf[_0x0999('0x32')]=_[_0x0999('0x31')](_0x199df7[_0x0999('0x2e')],qs[_0x0999('0x33')](_0x3cf0d3['query']['fields']));_0x1df4cf[_0x0999('0x32')]=_0x1df4cf[_0x0999('0x32')][_0x0999('0x34')]?_0x1df4cf[_0x0999('0x32')]:_0x199df7['model'];if(!_0x3cf0d3[_0x0999('0x2f')][_0x0999('0x35')]('nolimit')){_0x1df4cf[_0x0999('0x20')]=qs[_0x0999('0x20')](_0x3cf0d3[_0x0999('0x2f')][_0x0999('0x20')]);_0x1df4cf[_0x0999('0x1d')]=qs[_0x0999('0x1d')](_0x3cf0d3['query'][_0x0999('0x1d')]);}_0x1df4cf['order']=qs[_0x0999('0x36')](_0x3cf0d3[_0x0999('0x2f')][_0x0999('0x36')]);_0x1df4cf['where']=qs[_0x0999('0x37')](_[_0x0999('0x38')](_0x3cf0d3[_0x0999('0x2f')],_0x199df7[_0x0999('0x37')]),_0x24411f);if(_0x3cf0d3[_0x0999('0x2f')][_0x0999('0x39')]){_0x1df4cf[_0x0999('0x3a')]=_[_0x0999('0x3b')](_0x1df4cf[_0x0999('0x3a')],{'$or':_[_0x0999('0x2b')](_0x24411f,function(_0x485d83){if(_0x485d83[_0x0999('0x3c')]!==_0x0999('0x3d')){var _0x557358={};_0x557358[_0x485d83[_0x0999('0x28')]]={'$like':'%'+_0x3cf0d3[_0x0999('0x2f')][_0x0999('0x39')]+'%'};return _0x557358;}})});}_0x1df4cf=_[_0x0999('0x3b')]({},_0x1df4cf,_0x3cf0d3[_0x0999('0x3e')]);var _0x47ab00={'where':_0x1df4cf[_0x0999('0x3a')]};return db[_0x0999('0x3f')][_0x0999('0x1f')](_0x47ab00)['then'](function(_0x3a95d8){_0x36cd03[_0x0999('0x1f')]=_0x3a95d8;if(_0x3cf0d3[_0x0999('0x2f')][_0x0999('0x40')]){_0x1df4cf[_0x0999('0x41')]=[{'all':!![]}];}return db[_0x0999('0x3f')][_0x0999('0x42')](_0x1df4cf);})[_0x0999('0x25')](function(_0x44976d){_0x36cd03[_0x0999('0x43')]=_0x44976d;return _0x36cd03;})[_0x0999('0x25')](respondWithFilteredResult(_0x5c9fb4,_0x1df4cf))[_0x0999('0x44')](handleError(_0x5c9fb4,null));};exports['show']=function(_0xc632f4,_0x266982){var _0x47edb3={'raw':![],'where':{'id':_0xc632f4[_0x0999('0x45')]['id']}},_0x51956e={};_0x51956e['model']=_['keys'](db[_0x0999('0x3f')][_0x0999('0x2c')]);_0x51956e[_0x0999('0x2f')]=_[_0x0999('0x30')](_0xc632f4[_0x0999('0x2f')]);_0x51956e[_0x0999('0x37')]=_[_0x0999('0x31')](_0x51956e[_0x0999('0x2e')],_0x51956e[_0x0999('0x2f')]);_0x47edb3[_0x0999('0x32')]=_[_0x0999('0x31')](_0x51956e['model'],qs['fields'](_0xc632f4[_0x0999('0x2f')][_0x0999('0x33')]));_0x47edb3[_0x0999('0x32')]=_0x47edb3[_0x0999('0x32')][_0x0999('0x34')]?_0x47edb3[_0x0999('0x32')]:_0x51956e[_0x0999('0x2e')];if(_0xc632f4[_0x0999('0x2f')]['includeAll']){_0x47edb3['include']=[{'all':!![]}];}_0x47edb3=_[_0x0999('0x3b')]({},_0x47edb3,_0xc632f4[_0x0999('0x3e')]);return db['FreshdeskAccount'][_0x0999('0x46')](_0x47edb3)['then'](handleEntityNotFound(_0x266982,null))['then'](respondWithResult(_0x266982,null))[_0x0999('0x44')](handleError(_0x266982,null));};exports[_0x0999('0x47')]=function(_0x433a6d,_0xaace1c){return db[_0x0999('0x3f')][_0x0999('0x47')](_0x433a6d[_0x0999('0x48')],{})[_0x0999('0x25')](respondWithResult(_0xaace1c,0xc9))[_0x0999('0x44')](handleError(_0xaace1c,null));};exports['update']=function(_0x2ee544,_0x29879b){if(_0x2ee544[_0x0999('0x48')]['id']){delete _0x2ee544[_0x0999('0x48')]['id'];}return db[_0x0999('0x3f')][_0x0999('0x46')]({'where':{'id':_0x2ee544[_0x0999('0x45')]['id']}})[_0x0999('0x25')](handleEntityNotFound(_0x29879b,null))[_0x0999('0x25')](saveUpdates(_0x2ee544['body'],null))[_0x0999('0x25')](respondWithResult(_0x29879b,null))['catch'](handleError(_0x29879b,null));};exports[_0x0999('0x26')]=function(_0x218092,_0x318345){return db[_0x0999('0x3f')][_0x0999('0x46')]({'where':{'id':_0x218092['params']['id']}})[_0x0999('0x25')](handleEntityNotFound(_0x318345,null))[_0x0999('0x25')](removeEntity(_0x318345,null))[_0x0999('0x44')](handleError(_0x318345,null));};exports[_0x0999('0x49')]=function(_0x3f42f8,_0x3f4f33,_0x563869){var _0x1e3d89={};var _0x1a90f1={};var _0x3faafa;var _0x2113e8;return db[_0x0999('0x3f')][_0x0999('0x4a')]({'where':{'id':_0x3f42f8[_0x0999('0x45')]['id']}})['then'](handleEntityNotFound(_0x3f4f33,null))[_0x0999('0x25')](function(_0x1df925){if(_0x1df925){_0x3faafa=_0x1df925;_0x1a90f1[_0x0999('0x2e')]=_[_0x0999('0x30')](db['FreshdeskConfiguration'][_0x0999('0x2c')]);_0x1a90f1[_0x0999('0x2f')]=_[_0x0999('0x30')](_0x3f42f8['query']);_0x1a90f1[_0x0999('0x37')]=_[_0x0999('0x31')](_0x1a90f1[_0x0999('0x2e')],_0x1a90f1['query']);_0x1e3d89[_0x0999('0x32')]=_[_0x0999('0x31')](_0x1a90f1[_0x0999('0x2e')],qs[_0x0999('0x33')](_0x3f42f8[_0x0999('0x2f')][_0x0999('0x33')]));_0x1e3d89[_0x0999('0x32')]=_0x1e3d89[_0x0999('0x32')][_0x0999('0x34')]?_0x1e3d89['attributes']:_0x1a90f1[_0x0999('0x2e')];_0x1e3d89[_0x0999('0x4b')]=qs[_0x0999('0x36')](_0x3f42f8[_0x0999('0x2f')][_0x0999('0x36')]);_0x1e3d89['where']=qs['filters'](_[_0x0999('0x38')](_0x3f42f8[_0x0999('0x2f')],_0x1a90f1['filters']));if(_0x3f42f8['query']['filter']){_0x1e3d89[_0x0999('0x3a')]=_[_0x0999('0x3b')](_0x1e3d89[_0x0999('0x3a')],{'$or':_[_0x0999('0x2b')](_0x1e3d89[_0x0999('0x32')],function(_0x16614c){var _0x1eefda={};_0x1eefda[_0x16614c]={'$like':'%'+_0x3f42f8[_0x0999('0x2f')][_0x0999('0x39')]+'%'};return _0x1eefda;})});}_0x1e3d89=_['merge']({},_0x1e3d89,_0x3f42f8[_0x0999('0x3e')]);return _0x3faafa['getConfigurations'](_0x1e3d89);}})[_0x0999('0x25')](function(_0x13f9c4){if(_0x13f9c4){_0x2113e8=_0x13f9c4[_0x0999('0x34')];if(!_0x3f42f8[_0x0999('0x2f')][_0x0999('0x35')]('nolimit')){_0x1e3d89['limit']=qs[_0x0999('0x20')](_0x3f42f8[_0x0999('0x2f')][_0x0999('0x20')]);_0x1e3d89[_0x0999('0x1d')]=qs[_0x0999('0x1d')](_0x3f42f8['query'][_0x0999('0x1d')]);}return _0x3faafa[_0x0999('0x49')](_0x1e3d89);}})[_0x0999('0x25')](function(_0x27a4ae){if(_0x27a4ae){return _0x27a4ae?{'count':_0x2113e8,'rows':_0x27a4ae}:null;}})[_0x0999('0x25')](respondWithResult(_0x3f4f33,null))[_0x0999('0x44')](handleError(_0x3f4f33,null));};exports[_0x0999('0x4c')]=function(_0x2e0eda,_0x27d4ce,_0x17f0e1){if(_0x2e0eda['body']['id']){delete _0x2e0eda[_0x0999('0x48')]['id'];}return db[_0x0999('0x3f')]['findOne']({'where':{'id':_0x2e0eda[_0x0999('0x45')]['id']}})[_0x0999('0x25')](handleEntityNotFound(_0x27d4ce,null))[_0x0999('0x25')](function(_0xb953f2){if(_0xb953f2){_0x2e0eda['body'][_0x0999('0x4d')]=_0xb953f2['id'];_0x2e0eda[_0x0999('0x48')][_0x0999('0x4e')]=integrations['getSubjects'](_0x2e0eda['body'][_0x0999('0x4f')],_0x2e0eda[_0x0999('0x48')][_0x0999('0x3c')]);_0x2e0eda['body'][_0x0999('0x50')]=integrations[_0x0999('0x51')](_0x2e0eda[_0x0999('0x48')]['channel'],_0x2e0eda['body'][_0x0999('0x3c')]);return db[_0x0999('0x52')][_0x0999('0x47')](_0x2e0eda[_0x0999('0x48')],{'include':[{'model':db[_0x0999('0x53')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0x0999('0x25')](respondWithResult(_0x27d4ce,null))[_0x0999('0x44')](handleError(_0x27d4ce,null));};exports[_0x0999('0x54')]=function(_0x4b9c7e,_0x40473d,_0x2ed05d){var _0x139d36='';return db['FreshdeskAccount'][_0x0999('0x4a')]({'where':{'id':_0x4b9c7e[_0x0999('0x45')]['id']},'attributes':['id',_0x0999('0x55'),'apiKey']})['then'](handleEntityNotFound(_0x40473d,null))[_0x0999('0x25')](function(_0x576272){if(_0x576272){_0x139d36=_0x576272[_0x0999('0x55')];var _0x4dd2d4=_0x139d36[_0x0999('0x56')](-0x1);if(_0x4dd2d4==='/'){_0x139d36=_0x139d36[_0x0999('0x57')](0x0,_0x139d36[_0x0999('0x58')](_0x4dd2d4));}return rp({'method':'GET','uri':util[_0x0999('0x59')]('%s/%s',_0x139d36,_0x0999('0x5a')),'headers':{'Authorization':util[_0x0999('0x59')](_0x0999('0x5b'),new Buffer(util[_0x0999('0x59')](_0x0999('0x5c'),_0x576272[_0x0999('0x5d')]))[_0x0999('0x5e')](_0x0999('0x5f')))},'json':!![]});}})[_0x0999('0x25')](function(_0x3b046f){if(_0x3b046f){var _0xc2a04=[_0x0999('0x60'),'subject',_0x0999('0x61'),_0x0999('0x62'),'status',_0x0999('0x63'),_0x0999('0x64'),_0x0999('0x65'),_0x0999('0x66'),_0x0999('0x64'),_0x0999('0x67')];_[_0x0999('0x68')](_0x3b046f,function(_0x165d55){return _0xc2a04[_0x0999('0x69')](_0x165d55['name'])||!_0x165d55[_0x0999('0x6a')]&&_0x165d55['type']!==_0x0999('0x6b')&&_0x165d55[_0x0999('0x3c')]!==_0x0999('0x6c');});return{'count':_0x3b046f[_0x0999('0x34')],'rows':_[_0x0999('0x2b')](_0x3b046f,function(_0x48ba0d){return{'id':_0x48ba0d[_0x0999('0x28')],'name':_0x48ba0d['label'],'custom':!_0x48ba0d[_0x0999('0x6a')],'options':_0x48ba0d[_0x0999('0x6d')]?_[_0x0999('0x2b')](_0x48ba0d[_0x0999('0x6d')],function(_0xe47622){return{'name':_[_0x0999('0x6e')](_0xe47622),'value':_0xe47622};}):[]};})};}})['then'](respondWithResult(_0x40473d,null))['catch'](function(_0x443d9a){var _0x13a417=_0x4b9c7e['query'][_0x0999('0x6f')]?0x1f4:_0x443d9a[_0x0999('0x70')]||0x1f4;logger[_0x0999('0x71')]('getFields,\x20%s,\x20%s,\x20%s',_0x0999('0x54'),_0x13a417,JSON[_0x0999('0x72')](_0x443d9a));delete _0x443d9a['name'];if(_0x13a417===0x191){_0x13a417=0x190;}_0x40473d[_0x0999('0x1a')](_0x13a417)[_0x0999('0x29')](_0x4b9c7e['query'][_0x0999('0x6f')]?{'message':_0x0999('0x73'),'statusCode':_0x443d9a[_0x0999('0x70')]}:_0x443d9a);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index b48780a..3104e2b 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 _0x251d=['request-promise','path','../../config/environment','../../components/integrations/configuration','define','FreshdeskAccount','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x251d,0x1c9));var _0xd251=function(_0x572717,_0x33ef1f){_0x572717=_0x572717-0x0;var _0x46ac6e=_0x251d[_0x572717];return _0x46ac6e;};'use strict';var _=require('lodash');var util=require(_0xd251('0x0'));var logger=require(_0xd251('0x1'))(_0xd251('0x2'));var moment=require(_0xd251('0x3'));var BPromise=require(_0xd251('0x4'));var rp=require(_0xd251('0x5'));var fs=require('fs');var path=require(_0xd251('0x6'));var rimraf=require('rimraf');var config=require(_0xd251('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xd251('0x8'));module['exports']=function(_0x56e3b0,_0x393b4a){return _0x56e3b0[_0xd251('0x9')](_0xd251('0xa'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7098=['FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x2972cf,_0x343fde){var _0x4c173f=function(_0x30eb3a){while(--_0x30eb3a){_0x2972cf['push'](_0x2972cf['shift']());}};_0x4c173f(++_0x343fde);}(_0x7098,0x179));var _0x8709=function(_0x48e637,_0x52e67d){_0x48e637=_0x48e637-0x0;var _0x3378a6=_0x7098[_0x48e637];return _0x3378a6;};'use strict';var _=require('lodash');var util=require(_0x8709('0x0'));var logger=require(_0x8709('0x1'))(_0x8709('0x2'));var moment=require(_0x8709('0x3'));var BPromise=require(_0x8709('0x4'));var rp=require(_0x8709('0x5'));var fs=require('fs');var path=require(_0x8709('0x6'));var rimraf=require(_0x8709('0x7'));var config=require(_0x8709('0x8'));var attributes=require(_0x8709('0x9'));var integrations=require(_0x8709('0xa'));module[_0x8709('0xb')]=function(_0x1b2cd9,_0x524935){return _0x1b2cd9[_0x8709('0xc')](_0x8709('0xd'),attributes,{'tableName':_0x8709('0xe'),'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 1d45687..93d7679 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 _0x5636=['error','code','FreshdeskAccount,\x20%s,\x20%s','message','info','result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','include','map','GetFreshdeskAccount','stringify','ShowFreshdeskAccount','find','model','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug'];(function(_0x13b8b1,_0x42882a){var _0x467f68=function(_0x1948e0){while(--_0x1948e0){_0x13b8b1['push'](_0x13b8b1['shift']());}};_0x467f68(++_0x42882a);}(_0x5636,0x102));var _0x6563=function(_0x58b390,_0x17af6d){_0x58b390=_0x58b390-0x0;var _0x89ff57=_0x5636[_0x58b390];return _0x89ff57;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193942,_0x9884a9,_0x2d57d5){return new BPromise(function(_0x2d0d5b,_0x98fcd4){return client[_0x6563('0xa')](_0x193942,_0x2d57d5)[_0x6563('0xb')](function(_0x3ccb4e){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));logger[_0x6563('0xd')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x9884a9,'request\x20sent',JSON['stringify'](_0x3ccb4e));if(_0x3ccb4e[_0x6563('0xe')]){if(_0x3ccb4e[_0x6563('0xe')][_0x6563('0xf')]===0x1f4){logger[_0x6563('0xe')](_0x6563('0x10'),_0x9884a9,_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);return _0x98fcd4(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}logger['error'](_0x6563('0x10'),_0x9884a9,_0x3ccb4e['error'][_0x6563('0x11')]);return _0x2d0d5b(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}else{logger[_0x6563('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));_0x2d0d5b(_0x3ccb4e[_0x6563('0x13')][_0x6563('0x11')]);}})[_0x6563('0x14')](function(_0x4e7282){logger[_0x6563('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x9884a9,_0x4e7282);_0x98fcd4(_0x4e7282);});});}exports['GetFreshdeskAccount']=function(_0x47972a){var _0x14c6a6=this;return new Promise(function(_0x4f5609,_0x54e69c){return db[_0x6563('0x15')][_0x6563('0x16')]({'raw':_0x47972a[_0x6563('0x17')]?_0x47972a[_0x6563('0x17')][_0x6563('0x18')]===undefined?!![]:![]:!![],'where':_0x47972a[_0x6563('0x17')]?_0x47972a[_0x6563('0x17')][_0x6563('0x19')]||null:null,'attributes':_0x47972a[_0x6563('0x17')]?_0x47972a['options'][_0x6563('0x1a')]||null:null,'limit':_0x47972a[_0x6563('0x17')]?_0x47972a[_0x6563('0x17')]['limit']||null:null,'include':_0x47972a[_0x6563('0x17')]?_0x47972a['options'][_0x6563('0x1b')]?_[_0x6563('0x1c')](_0x47972a['options']['include'],function(_0x3ab7f6){return{'model':db[_0x3ab7f6['model']],'as':_0x3ab7f6['as'],'attributes':_0x3ab7f6[_0x6563('0x1a')],'include':_0x3ab7f6[_0x6563('0x1b')]?_[_0x6563('0x1c')](_0x3ab7f6['include'],function(_0xd860d5){return{'model':db[_0xd860d5['model']],'as':_0xd860d5['as'],'attributes':_0xd860d5[_0x6563('0x1a')],'include':_0xd860d5[_0x6563('0x1b')]?_['map'](_0xd860d5[_0x6563('0x1b')],function(_0x28252d){return{'model':db[_0x28252d['model']],'as':_0x28252d['as'],'attributes':_0x28252d[_0x6563('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fe1cb){logger['info']('GetFreshdeskAccount',_0x47972a);logger[_0x6563('0xd')](_0x6563('0x1d'),_0x47972a,JSON[_0x6563('0x1e')](_0x1fe1cb));_0x4f5609(_0x1fe1cb);})[_0x6563('0x14')](function(_0x3eb23b){logger['error'](_0x6563('0x1d'),_0x3eb23b['message'],_0x47972a);_0x54e69c(_0x14c6a6['error'](0x1f4,_0x3eb23b[_0x6563('0x11')]));});});};exports[_0x6563('0x1f')]=function(_0x1e2ecb){var _0xdbbdda=this;return new Promise(function(_0x116605,_0x305861){return db[_0x6563('0x15')][_0x6563('0x20')]({'raw':_0x1e2ecb[_0x6563('0x17')]?_0x1e2ecb[_0x6563('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1e2ecb[_0x6563('0x17')]?_0x1e2ecb[_0x6563('0x17')][_0x6563('0x19')]||null:null,'attributes':_0x1e2ecb[_0x6563('0x17')]?_0x1e2ecb[_0x6563('0x17')][_0x6563('0x1a')]||null:null,'include':_0x1e2ecb[_0x6563('0x17')]?_0x1e2ecb['options'][_0x6563('0x1b')]?_[_0x6563('0x1c')](_0x1e2ecb[_0x6563('0x17')][_0x6563('0x1b')],function(_0x3f79da){return{'model':db[_0x3f79da[_0x6563('0x21')]],'as':_0x3f79da['as'],'attributes':_0x3f79da['attributes'],'include':_0x3f79da[_0x6563('0x1b')]?_[_0x6563('0x1c')](_0x3f79da[_0x6563('0x1b')],function(_0x33aa0b){return{'model':db[_0x33aa0b[_0x6563('0x21')]],'as':_0x33aa0b['as'],'attributes':_0x33aa0b[_0x6563('0x1a')],'include':_0x33aa0b[_0x6563('0x1b')]?_['map'](_0x33aa0b[_0x6563('0x1b')],function(_0x394120){return{'model':db[_0x394120['model']],'as':_0x394120['as'],'attributes':_0x394120[_0x6563('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6563('0xb')](function(_0x5b0c9f){logger['info'](_0x6563('0x1f'),_0x1e2ecb);logger[_0x6563('0xd')](_0x6563('0x1f'),_0x1e2ecb,JSON[_0x6563('0x1e')](_0x5b0c9f));_0x116605(_0x5b0c9f);})['catch'](function(_0x2d36d4){logger[_0x6563('0xe')]('ShowFreshdeskAccount',_0x2d36d4[_0x6563('0x11')],_0x1e2ecb);_0x305861(_0xdbbdda[_0x6563('0xe')](0x1f4,_0x2d36d4[_0x6563('0x11')]));});});}; \ No newline at end of file +var _0xcb4d=['model','then','catch','raw','ShowFreshdeskAccount','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','limit','include','map'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0xcb4d,0x68));var _0xdcb4=function(_0x4a19ab,_0x39cc66){_0x4a19ab=_0x4a19ab-0x0;var _0x438850=_0xcb4d[_0x4a19ab];return _0x438850;};'use strict';var _=require(_0xdcb4('0x0'));var util=require(_0xdcb4('0x1'));var moment=require(_0xdcb4('0x2'));var BPromise=require(_0xdcb4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdcb4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdcb4('0x5'))(_0xdcb4('0x6'));var config=require(_0xdcb4('0x7'));var jayson=require(_0xdcb4('0x8'));var client=jayson['client'][_0xdcb4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e92ce,_0x5ae4c0,_0x31cc06){return new BPromise(function(_0x589043,_0x3073ed){return client['request'](_0x5e92ce,_0x31cc06)['then'](function(_0x2b78c1){logger[_0xdcb4('0xa')](_0xdcb4('0xb'),_0x5ae4c0,_0xdcb4('0xc'));logger[_0xdcb4('0xd')](_0xdcb4('0xe'),_0x5ae4c0,_0xdcb4('0xc'),JSON[_0xdcb4('0xf')](_0x2b78c1));if(_0x2b78c1[_0xdcb4('0x10')]){if(_0x2b78c1[_0xdcb4('0x10')][_0xdcb4('0x11')]===0x1f4){logger[_0xdcb4('0x10')](_0xdcb4('0xb'),_0x5ae4c0,_0x2b78c1[_0xdcb4('0x10')][_0xdcb4('0x12')]);return _0x3073ed(_0x2b78c1[_0xdcb4('0x10')]['message']);}logger[_0xdcb4('0x10')](_0xdcb4('0xb'),_0x5ae4c0,_0x2b78c1[_0xdcb4('0x10')]['message']);return _0x589043(_0x2b78c1[_0xdcb4('0x10')][_0xdcb4('0x12')]);}else{logger['info'](_0xdcb4('0xb'),_0x5ae4c0,'request\x20sent');_0x589043(_0x2b78c1['result'][_0xdcb4('0x12')]);}})['catch'](function(_0x4bdb5d){logger[_0xdcb4('0x10')](_0xdcb4('0xb'),_0x5ae4c0,_0x4bdb5d);_0x3073ed(_0x4bdb5d);});});}exports[_0xdcb4('0x13')]=function(_0x1f39e9){var _0x4e0187=this;return new Promise(function(_0x2023b2,_0x4a7e7e){return db[_0xdcb4('0x14')][_0xdcb4('0x15')]({'raw':_0x1f39e9[_0xdcb4('0x16')]?_0x1f39e9[_0xdcb4('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1f39e9[_0xdcb4('0x16')]?_0x1f39e9[_0xdcb4('0x16')][_0xdcb4('0x17')]||null:null,'attributes':_0x1f39e9['options']?_0x1f39e9[_0xdcb4('0x16')][_0xdcb4('0x18')]||null:null,'limit':_0x1f39e9[_0xdcb4('0x16')]?_0x1f39e9['options'][_0xdcb4('0x19')]||null:null,'include':_0x1f39e9['options']?_0x1f39e9[_0xdcb4('0x16')][_0xdcb4('0x1a')]?_[_0xdcb4('0x1b')](_0x1f39e9[_0xdcb4('0x16')][_0xdcb4('0x1a')],function(_0x37b4ef){return{'model':db[_0x37b4ef[_0xdcb4('0x1c')]],'as':_0x37b4ef['as'],'attributes':_0x37b4ef[_0xdcb4('0x18')],'include':_0x37b4ef[_0xdcb4('0x1a')]?_['map'](_0x37b4ef[_0xdcb4('0x1a')],function(_0x3b7204){return{'model':db[_0x3b7204['model']],'as':_0x3b7204['as'],'attributes':_0x3b7204[_0xdcb4('0x18')],'include':_0x3b7204[_0xdcb4('0x1a')]?_[_0xdcb4('0x1b')](_0x3b7204['include'],function(_0x43183c){return{'model':db[_0x43183c[_0xdcb4('0x1c')]],'as':_0x43183c['as'],'attributes':_0x43183c[_0xdcb4('0x18')]};}):[]};}):[]};}):[]:[]})[_0xdcb4('0x1d')](function(_0x3843ed){logger[_0xdcb4('0xa')]('GetFreshdeskAccount',_0x1f39e9);logger['debug'](_0xdcb4('0x13'),_0x1f39e9,JSON[_0xdcb4('0xf')](_0x3843ed));_0x2023b2(_0x3843ed);})[_0xdcb4('0x1e')](function(_0x1cf6bc){logger['error'](_0xdcb4('0x13'),_0x1cf6bc[_0xdcb4('0x12')],_0x1f39e9);_0x4a7e7e(_0x4e0187['error'](0x1f4,_0x1cf6bc[_0xdcb4('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x547995){var _0x379091=this;return new Promise(function(_0x2ad8aa,_0x32374d){return db[_0xdcb4('0x14')]['find']({'raw':_0x547995[_0xdcb4('0x16')]?_0x547995[_0xdcb4('0x16')][_0xdcb4('0x1f')]===undefined?!![]:![]:!![],'where':_0x547995[_0xdcb4('0x16')]?_0x547995[_0xdcb4('0x16')][_0xdcb4('0x17')]||null:null,'attributes':_0x547995[_0xdcb4('0x16')]?_0x547995[_0xdcb4('0x16')][_0xdcb4('0x18')]||null:null,'include':_0x547995['options']?_0x547995[_0xdcb4('0x16')][_0xdcb4('0x1a')]?_[_0xdcb4('0x1b')](_0x547995[_0xdcb4('0x16')][_0xdcb4('0x1a')],function(_0x444d3f){return{'model':db[_0x444d3f['model']],'as':_0x444d3f['as'],'attributes':_0x444d3f[_0xdcb4('0x18')],'include':_0x444d3f['include']?_[_0xdcb4('0x1b')](_0x444d3f[_0xdcb4('0x1a')],function(_0x36ebf8){return{'model':db[_0x36ebf8['model']],'as':_0x36ebf8['as'],'attributes':_0x36ebf8[_0xdcb4('0x18')],'include':_0x36ebf8['include']?_['map'](_0x36ebf8[_0xdcb4('0x1a')],function(_0x4da807){return{'model':db[_0x4da807[_0xdcb4('0x1c')]],'as':_0x4da807['as'],'attributes':_0x4da807[_0xdcb4('0x18')]};}):[]};}):[]};}):[]:[]})[_0xdcb4('0x1d')](function(_0x4a3a9b){logger[_0xdcb4('0xa')](_0xdcb4('0x20'),_0x547995);logger['debug'](_0xdcb4('0x20'),_0x547995,JSON[_0xdcb4('0xf')](_0x4a3a9b));_0x2ad8aa(_0x4a3a9b);})[_0xdcb4('0x1e')](function(_0x38e96c){logger[_0xdcb4('0x10')](_0xdcb4('0x20'),_0x38e96c[_0xdcb4('0x12')],_0x547995);_0x32374d(_0x379091[_0xdcb4('0x10')](0x1f4,_0x38e96c[_0xdcb4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 6fe22ac..a0b9c48 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 _0x82ac=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','/:id/tags','setTags','put','delete','exports','multer','util'];(function(_0x3eee9f,_0x427171){var _0x2fa63c=function(_0x1155de){while(--_0x1155de){_0x3eee9f['push'](_0x3eee9f['shift']());}};_0x2fa63c(++_0x427171);}(_0x82ac,0x102));var _0xc82a=function(_0x13b15f,_0x1d7fc4){_0x13b15f=_0x13b15f-0x0;var _0x186509=_0x82ac[_0x13b15f];return _0x186509;};'use strict';var multer=require(_0xc82a('0x0'));var util=require(_0xc82a('0x1'));var path=require(_0xc82a('0x2'));var timeout=require(_0xc82a('0x3'));var express=require('express');var router=express[_0xc82a('0x4')]();var fs_extra=require(_0xc82a('0x5'));var auth=require(_0xc82a('0x6'));var interaction=require(_0xc82a('0x7'));var config=require(_0xc82a('0x8'));var controller=require(_0xc82a('0x9'));router[_0xc82a('0xa')]('/',auth[_0xc82a('0xb')](),controller[_0xc82a('0xc')]);router[_0xc82a('0xa')](_0xc82a('0xd'),auth[_0xc82a('0xb')](),controller[_0xc82a('0xe')]);router['get']('/:id/fields',auth[_0xc82a('0xb')](),controller[_0xc82a('0xf')]);router[_0xc82a('0xa')](_0xc82a('0x10'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0xc82a('0x11'),auth['isAuthenticated'](),controller[_0xc82a('0x12')]);router[_0xc82a('0xa')]('/:id/tags',auth['isAuthenticated'](),controller['getTags']);router[_0xc82a('0x13')]('/',auth[_0xc82a('0xb')](),controller[_0xc82a('0x14')]);router[_0xc82a('0x13')](_0xc82a('0x15'),auth['isAuthenticated'](),controller[_0xc82a('0x16')]);router[_0xc82a('0x17')](_0xc82a('0xd'),auth[_0xc82a('0xb')](),controller['update']);router[_0xc82a('0x18')]('/:id',auth[_0xc82a('0xb')](),controller['destroy']);module[_0xc82a('0x19')]=router; \ No newline at end of file +var _0x7e72=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','delete','exports','multer'];(function(_0x336b01,_0x3b8647){var _0x5a3bb2=function(_0x1d62d0){while(--_0x1d62d0){_0x336b01['push'](_0x336b01['shift']());}};_0x5a3bb2(++_0x3b8647);}(_0x7e72,0x1e5));var _0x27e7=function(_0x4e956d,_0x5b3ccb){_0x4e956d=_0x4e956d-0x0;var _0x8f6fc5=_0x7e72[_0x4e956d];return _0x8f6fc5;};'use strict';var multer=require(_0x27e7('0x0'));var util=require(_0x27e7('0x1'));var path=require(_0x27e7('0x2'));var timeout=require(_0x27e7('0x3'));var express=require(_0x27e7('0x4'));var router=express[_0x27e7('0x5')]();var fs_extra=require(_0x27e7('0x6'));var auth=require(_0x27e7('0x7'));var interaction=require(_0x27e7('0x8'));var config=require(_0x27e7('0x9'));var controller=require(_0x27e7('0xa'));router[_0x27e7('0xb')]('/',auth[_0x27e7('0xc')](),controller[_0x27e7('0xd')]);router[_0x27e7('0xb')](_0x27e7('0xe'),auth[_0x27e7('0xc')](),controller['show']);router[_0x27e7('0xb')](_0x27e7('0xf'),auth[_0x27e7('0xc')](),controller[_0x27e7('0x10')]);router[_0x27e7('0xb')]('/:id/subjects',auth[_0x27e7('0xc')](),controller[_0x27e7('0x11')]);router[_0x27e7('0xb')](_0x27e7('0x12'),auth[_0x27e7('0xc')](),controller[_0x27e7('0x13')]);router[_0x27e7('0xb')](_0x27e7('0x14'),auth[_0x27e7('0xc')](),controller['getTags']);router[_0x27e7('0x15')]('/',auth[_0x27e7('0xc')](),controller[_0x27e7('0x16')]);router[_0x27e7('0x15')](_0x27e7('0x14'),auth[_0x27e7('0xc')](),controller['setTags']);router[_0x27e7('0x17')]('/:id',auth[_0x27e7('0xc')](),controller[_0x27e7('0x18')]);router[_0x27e7('0x19')]('/:id',auth[_0x27e7('0xc')](),controller['destroy']);module[_0x27e7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 2b4a637..f848265 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 _0xc790=['STRING','sequelize','exports'];(function(_0x4d3835,_0x4f5f50){var _0x823439=function(_0x25a5c6){while(--_0x25a5c6){_0x4d3835['push'](_0x4d3835['shift']());}};_0x823439(++_0x4f5f50);}(_0xc790,0x67));var _0x0c79=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xc790[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x0c79('0x0'));module[_0x0c79('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0c79('0x2')]}}; \ No newline at end of file +var _0x621c=['exports','STRING','sequelize'];(function(_0x84ac92,_0x463eda){var _0x1539d5=function(_0xb0b93){while(--_0xb0b93){_0x84ac92['push'](_0x84ac92['shift']());}};_0x1539d5(++_0x463eda);}(_0x621c,0xce));var _0xc621=function(_0x597106,_0x4a4eba){_0x597106=_0x597106-0x0;var _0x51af2d=_0x621c[_0x597106];return _0x51af2d;};'use strict';var Sequelize=require(_0xc621('0x0'));module[_0xc621('0x1')]={'name':{'type':Sequelize[_0xc621('0x2')]},'description':{'type':Sequelize[_0xc621('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index f8d6656..181ee05 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 _0x6f9f=['bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','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','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','catch','show','params','create','body','update','find','getFields','findOne','FreshdeskField','fields','order','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f9f,0xa9));var _0xf6f9=function(_0x10070e,_0x3b528b){_0x10070e=_0x10070e-0x0;var _0x574725=_0x6f9f[_0x10070e];return _0x574725;};'use strict';var emlformat=require(_0xf6f9('0x0'));var rimraf=require(_0xf6f9('0x1'));var zipdir=require(_0xf6f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf6f9('0x3'));var moment=require(_0xf6f9('0x4'));var BPromise=require(_0xf6f9('0x5'));var Mustache=require(_0xf6f9('0x6'));var util=require(_0xf6f9('0x7'));var path=require('path');var sox=require(_0xf6f9('0x8'));var csv=require('to-csv');var ejs=require(_0xf6f9('0x9'));var fs=require('fs');var fs_extra=require(_0xf6f9('0xa'));var _=require(_0xf6f9('0xb'));var squel=require(_0xf6f9('0xc'));var crypto=require('crypto');var jsforce=require(_0xf6f9('0xd'));var deskjs=require(_0xf6f9('0xe'));var toCsv=require(_0xf6f9('0xf'));var querystring=require(_0xf6f9('0x10'));var Papa=require(_0xf6f9('0x11'));var Redis=require(_0xf6f9('0x12'));var authService=require(_0xf6f9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf6f9('0x14'));var hardwareService=require(_0xf6f9('0x15'));var logger=require(_0xf6f9('0x16'))(_0xf6f9('0x17'));var utils=require(_0xf6f9('0x18'));var config=require(_0xf6f9('0x19'));var licenseUtil=require(_0xf6f9('0x1a'));var db=require(_0xf6f9('0x1b'))['db'];function respondWithStatusCode(_0x24ed1d,_0x49ebf0){_0x49ebf0=_0x49ebf0||0xcc;return function(_0x5853c2){if(_0x5853c2){return _0x24ed1d[_0xf6f9('0x1c')](_0x49ebf0);}return _0x24ed1d[_0xf6f9('0x1d')](_0x49ebf0)[_0xf6f9('0x1e')]();};}function respondWithResult(_0x121810,_0x1492b4){_0x1492b4=_0x1492b4||0xc8;return function(_0x3b95bf){if(_0x3b95bf){return _0x121810[_0xf6f9('0x1d')](_0x1492b4)['json'](_0x3b95bf);}};}function respondWithFilteredResult(_0x8c6315,_0x40505f){return function(_0x5a29b8){if(_0x5a29b8){var _0x4d103e=typeof _0x40505f[_0xf6f9('0x1f')]===_0xf6f9('0x20')&&typeof _0x40505f[_0xf6f9('0x21')]===_0xf6f9('0x20');var _0x52e039=_0x5a29b8[_0xf6f9('0x22')];var _0x55baeb=_0x4d103e?0x0:_0x40505f[_0xf6f9('0x1f')];var _0x1b0320=_0x4d103e?_0x5a29b8[_0xf6f9('0x22')]:_0x40505f[_0xf6f9('0x1f')]+_0x40505f[_0xf6f9('0x21')];var _0x3d2b7e;if(_0x1b0320>=_0x52e039){_0x1b0320=_0x52e039;_0x3d2b7e=0xc8;}else{_0x3d2b7e=0xce;}_0x8c6315[_0xf6f9('0x1d')](_0x3d2b7e);return _0x8c6315[_0xf6f9('0x23')]('Content-Range',_0x55baeb+'-'+_0x1b0320+'/'+_0x52e039)[_0xf6f9('0x24')](_0x5a29b8);}return null;};}function patchUpdates(_0x5a85a6){return function(_0x40718a){try{jsonpatch[_0xf6f9('0x25')](_0x40718a,_0x5a85a6,!![]);}catch(_0x2b9292){return BPromise[_0xf6f9('0x26')](_0x2b9292);}return _0x40718a[_0xf6f9('0x27')]();};}function saveUpdates(_0x5ba450,_0x472290){return function(_0x4b0bf8){if(_0x4b0bf8){return _0x4b0bf8['update'](_0x5ba450)[_0xf6f9('0x28')](function(_0x3c1b66){return _0x3c1b66;});}return null;};}function removeEntity(_0x2c6b1b,_0x2a07eb){return function(_0x1d90d4){if(_0x1d90d4){return _0x1d90d4[_0xf6f9('0x29')]()[_0xf6f9('0x28')](function(){_0x2c6b1b[_0xf6f9('0x1d')](0xcc)[_0xf6f9('0x1e')]();});}};}function handleEntityNotFound(_0x4e0728,_0x39974d){return function(_0x524f32){if(!_0x524f32){_0x4e0728[_0xf6f9('0x1c')](0x194);}return _0x524f32;};}function handleError(_0x442d9a,_0x41fa34){_0x41fa34=_0x41fa34||0x1f4;return function(_0x519ebe){logger['error'](_0x519ebe['stack']);if(_0x519ebe['name']){delete _0x519ebe[_0xf6f9('0x2a')];}_0x442d9a[_0xf6f9('0x1d')](_0x41fa34)[_0xf6f9('0x2b')](_0x519ebe);};}exports[_0xf6f9('0x2c')]=function(_0x371770,_0x21a37d){var _0x5d7363={},_0x5df040={},_0x456fd0={'count':0x0,'rows':[]};var _0x27ab6e=_[_0xf6f9('0x2d')](db[_0xf6f9('0x2e')][_0xf6f9('0x2f')],function(_0x3c6996){return{'name':_0x3c6996[_0xf6f9('0x30')],'type':_0x3c6996['type'][_0xf6f9('0x31')]};});_0x5df040['model']=_[_0xf6f9('0x2d')](_0x27ab6e,_0xf6f9('0x2a'));_0x5df040[_0xf6f9('0x32')]=_[_0xf6f9('0x33')](_0x371770[_0xf6f9('0x32')]);_0x5df040[_0xf6f9('0x34')]=_[_0xf6f9('0x35')](_0x5df040[_0xf6f9('0x36')],_0x5df040['query']);_0x5d7363[_0xf6f9('0x37')]=_['intersection'](_0x5df040[_0xf6f9('0x36')],qs['fields'](_0x371770[_0xf6f9('0x32')]['fields']));_0x5d7363[_0xf6f9('0x37')]=_0x5d7363[_0xf6f9('0x37')][_0xf6f9('0x38')]?_0x5d7363[_0xf6f9('0x37')]:_0x5df040[_0xf6f9('0x36')];if(!_0x371770[_0xf6f9('0x32')][_0xf6f9('0x39')](_0xf6f9('0x3a'))){_0x5d7363[_0xf6f9('0x21')]=qs[_0xf6f9('0x21')](_0x371770['query']['limit']);_0x5d7363[_0xf6f9('0x1f')]=qs[_0xf6f9('0x1f')](_0x371770[_0xf6f9('0x32')][_0xf6f9('0x1f')]);}_0x5d7363['order']=qs[_0xf6f9('0x3b')](_0x371770[_0xf6f9('0x32')][_0xf6f9('0x3b')]);_0x5d7363[_0xf6f9('0x3c')]=qs[_0xf6f9('0x34')](_[_0xf6f9('0x3d')](_0x371770[_0xf6f9('0x32')],_0x5df040[_0xf6f9('0x34')]),_0x27ab6e);if(_0x371770[_0xf6f9('0x32')][_0xf6f9('0x3e')]){_0x5d7363[_0xf6f9('0x3c')]=_[_0xf6f9('0x3f')](_0x5d7363['where'],{'$or':_[_0xf6f9('0x2d')](_0x27ab6e,function(_0x866f96){if(_0x866f96[_0xf6f9('0x40')]!=='VIRTUAL'){var _0x4df9f8={};_0x4df9f8[_0x866f96[_0xf6f9('0x2a')]]={'$like':'%'+_0x371770[_0xf6f9('0x32')][_0xf6f9('0x3e')]+'%'};return _0x4df9f8;}})});}_0x5d7363=_['merge']({},_0x5d7363,_0x371770[_0xf6f9('0x41')]);var _0x36c2fe={'where':_0x5d7363[_0xf6f9('0x3c')]};return db[_0xf6f9('0x2e')]['count'](_0x36c2fe)[_0xf6f9('0x28')](function(_0x91b778){_0x456fd0[_0xf6f9('0x22')]=_0x91b778;if(_0x371770['query'][_0xf6f9('0x42')]){_0x5d7363[_0xf6f9('0x43')]=[{'all':!![]}];}return db[_0xf6f9('0x2e')][_0xf6f9('0x44')](_0x5d7363);})[_0xf6f9('0x28')](function(_0x49cede){_0x456fd0['rows']=_0x49cede;return _0x456fd0;})[_0xf6f9('0x28')](respondWithFilteredResult(_0x21a37d,_0x5d7363))[_0xf6f9('0x45')](handleError(_0x21a37d,null));};exports[_0xf6f9('0x46')]=function(_0xbc6278,_0x53a2a3){var _0xd0a504={'raw':![],'where':{'id':_0xbc6278[_0xf6f9('0x47')]['id']}},_0x550c1f={};_0x550c1f[_0xf6f9('0x36')]=_[_0xf6f9('0x33')](db[_0xf6f9('0x2e')][_0xf6f9('0x2f')]);_0x550c1f['query']=_[_0xf6f9('0x33')](_0xbc6278['query']);_0x550c1f[_0xf6f9('0x34')]=_[_0xf6f9('0x35')](_0x550c1f[_0xf6f9('0x36')],_0x550c1f[_0xf6f9('0x32')]);_0xd0a504[_0xf6f9('0x37')]=_[_0xf6f9('0x35')](_0x550c1f[_0xf6f9('0x36')],qs['fields'](_0xbc6278[_0xf6f9('0x32')]['fields']));_0xd0a504[_0xf6f9('0x37')]=_0xd0a504[_0xf6f9('0x37')][_0xf6f9('0x38')]?_0xd0a504[_0xf6f9('0x37')]:_0x550c1f['model'];if(_0xbc6278[_0xf6f9('0x32')][_0xf6f9('0x42')]){_0xd0a504['include']=[{'all':!![]}];}_0xd0a504=_[_0xf6f9('0x3f')]({},_0xd0a504,_0xbc6278['options']);return db['FreshdeskConfiguration']['find'](_0xd0a504)[_0xf6f9('0x28')](handleEntityNotFound(_0x53a2a3,null))[_0xf6f9('0x28')](respondWithResult(_0x53a2a3,null))[_0xf6f9('0x45')](handleError(_0x53a2a3,null));};exports['create']=function(_0xf15c60,_0x17a0e8){return db[_0xf6f9('0x2e')][_0xf6f9('0x48')](_0xf15c60[_0xf6f9('0x49')],{})['then'](respondWithResult(_0x17a0e8,0xc9))[_0xf6f9('0x45')](handleError(_0x17a0e8,null));};exports[_0xf6f9('0x4a')]=function(_0x12e738,_0x51422d){if(_0x12e738[_0xf6f9('0x49')]['id']){delete _0x12e738['body']['id'];}return db[_0xf6f9('0x2e')]['find']({'where':{'id':_0x12e738[_0xf6f9('0x47')]['id']}})[_0xf6f9('0x28')](handleEntityNotFound(_0x51422d,null))[_0xf6f9('0x28')](saveUpdates(_0x12e738[_0xf6f9('0x49')],null))['then'](respondWithResult(_0x51422d,null))['catch'](handleError(_0x51422d,null));};exports[_0xf6f9('0x29')]=function(_0x42cd6e,_0x4ded3f){return db[_0xf6f9('0x2e')][_0xf6f9('0x4b')]({'where':{'id':_0x42cd6e[_0xf6f9('0x47')]['id']}})[_0xf6f9('0x28')](handleEntityNotFound(_0x4ded3f,null))['then'](removeEntity(_0x4ded3f,null))[_0xf6f9('0x45')](handleError(_0x4ded3f,null));};exports[_0xf6f9('0x4c')]=function(_0x14aa3f,_0x8b7b9b,_0xb6497){var _0x2a2d78={};var _0x530bdc={};var _0x2e759c;var _0x27517a;return db[_0xf6f9('0x2e')][_0xf6f9('0x4d')]({'where':{'id':_0x14aa3f[_0xf6f9('0x47')]['id']}})[_0xf6f9('0x28')](handleEntityNotFound(_0x8b7b9b,null))[_0xf6f9('0x28')](function(_0x5e7076){if(_0x5e7076){_0x2e759c=_0x5e7076;_0x530bdc['model']=_[_0xf6f9('0x33')](db[_0xf6f9('0x4e')][_0xf6f9('0x2f')]);_0x530bdc[_0xf6f9('0x32')]=_[_0xf6f9('0x33')](_0x14aa3f[_0xf6f9('0x32')]);_0x530bdc['filters']=_[_0xf6f9('0x35')](_0x530bdc[_0xf6f9('0x36')],_0x530bdc[_0xf6f9('0x32')]);_0x2a2d78[_0xf6f9('0x37')]=_[_0xf6f9('0x35')](_0x530bdc[_0xf6f9('0x36')],qs[_0xf6f9('0x4f')](_0x14aa3f[_0xf6f9('0x32')][_0xf6f9('0x4f')]));_0x2a2d78[_0xf6f9('0x37')]=_0x2a2d78['attributes'][_0xf6f9('0x38')]?_0x2a2d78[_0xf6f9('0x37')]:_0x530bdc[_0xf6f9('0x36')];_0x2a2d78['order']=qs['sort'](_0x14aa3f[_0xf6f9('0x32')][_0xf6f9('0x3b')]);_0x2a2d78[_0xf6f9('0x3c')]=qs[_0xf6f9('0x34')](_[_0xf6f9('0x3d')](_0x14aa3f[_0xf6f9('0x32')],_0x530bdc[_0xf6f9('0x34')]));if(_0x14aa3f[_0xf6f9('0x32')][_0xf6f9('0x3e')]){_0x2a2d78['where']=_['merge'](_0x2a2d78[_0xf6f9('0x3c')],{'$or':_[_0xf6f9('0x2d')](_0x2a2d78[_0xf6f9('0x37')],function(_0x4039e7){var _0x35f365={};_0x35f365[_0x4039e7]={'$like':'%'+_0x14aa3f['query'][_0xf6f9('0x3e')]+'%'};return _0x35f365;})});}_0x2a2d78=_[_0xf6f9('0x3f')]({},_0x2a2d78,_0x14aa3f[_0xf6f9('0x41')]);return _0x2e759c['getFields'](_0x2a2d78);}})[_0xf6f9('0x28')](function(_0x2eabae){if(_0x2eabae){_0x27517a=_0x2eabae['length'];if(!_0x14aa3f[_0xf6f9('0x32')][_0xf6f9('0x39')](_0xf6f9('0x3a'))){_0x2a2d78[_0xf6f9('0x21')]=qs[_0xf6f9('0x21')](_0x14aa3f['query']['limit']);_0x2a2d78[_0xf6f9('0x1f')]=qs[_0xf6f9('0x1f')](_0x14aa3f[_0xf6f9('0x32')]['offset']);}return _0x2e759c[_0xf6f9('0x4c')](_0x2a2d78);}})[_0xf6f9('0x28')](function(_0x5aced4){if(_0x5aced4){return _0x5aced4?{'count':_0x27517a,'rows':_0x5aced4}:null;}})[_0xf6f9('0x28')](respondWithResult(_0x8b7b9b,null))[_0xf6f9('0x45')](handleError(_0x8b7b9b,null));};exports['getSubjects']=function(_0x24f000,_0x4e5be3,_0x327b16){var _0x211386={};var _0x4fded6={};var _0x11e28b;var _0x32364a;return db[_0xf6f9('0x2e')][_0xf6f9('0x4d')]({'where':{'id':_0x24f000[_0xf6f9('0x47')]['id']}})[_0xf6f9('0x28')](handleEntityNotFound(_0x4e5be3,null))[_0xf6f9('0x28')](function(_0x287fb6){if(_0x287fb6){_0x11e28b=_0x287fb6;_0x4fded6['model']=_[_0xf6f9('0x33')](db[_0xf6f9('0x4e')]['rawAttributes']);_0x4fded6['query']=_[_0xf6f9('0x33')](_0x24f000[_0xf6f9('0x32')]);_0x4fded6['filters']=_['intersection'](_0x4fded6['model'],_0x4fded6[_0xf6f9('0x32')]);_0x211386[_0xf6f9('0x37')]=_[_0xf6f9('0x35')](_0x4fded6['model'],qs[_0xf6f9('0x4f')](_0x24f000[_0xf6f9('0x32')][_0xf6f9('0x4f')]));_0x211386[_0xf6f9('0x37')]=_0x211386['attributes'][_0xf6f9('0x38')]?_0x211386[_0xf6f9('0x37')]:_0x4fded6[_0xf6f9('0x36')];_0x211386[_0xf6f9('0x50')]=qs[_0xf6f9('0x3b')](_0x24f000[_0xf6f9('0x32')][_0xf6f9('0x3b')]);_0x211386['where']=qs[_0xf6f9('0x34')](_[_0xf6f9('0x3d')](_0x24f000[_0xf6f9('0x32')],_0x4fded6[_0xf6f9('0x34')]));if(_0x24f000[_0xf6f9('0x32')][_0xf6f9('0x3e')]){_0x211386[_0xf6f9('0x3c')]=_['merge'](_0x211386[_0xf6f9('0x3c')],{'$or':_[_0xf6f9('0x2d')](_0x211386[_0xf6f9('0x37')],function(_0x595658){var _0x58cbab={};_0x58cbab[_0x595658]={'$like':'%'+_0x24f000['query'][_0xf6f9('0x3e')]+'%'};return _0x58cbab;})});}_0x211386=_[_0xf6f9('0x3f')]({},_0x211386,_0x24f000[_0xf6f9('0x41')]);return _0x11e28b[_0xf6f9('0x51')](_0x211386);}})[_0xf6f9('0x28')](function(_0x196175){if(_0x196175){_0x32364a=_0x196175[_0xf6f9('0x38')];if(!_0x24f000[_0xf6f9('0x32')]['hasOwnProperty']('nolimit')){_0x211386[_0xf6f9('0x21')]=qs['limit'](_0x24f000[_0xf6f9('0x32')]['limit']);_0x211386[_0xf6f9('0x1f')]=qs[_0xf6f9('0x1f')](_0x24f000[_0xf6f9('0x32')][_0xf6f9('0x1f')]);}return _0x11e28b[_0xf6f9('0x51')](_0x211386);}})[_0xf6f9('0x28')](function(_0x3c6a82){if(_0x3c6a82){return _0x3c6a82?{'count':_0x32364a,'rows':_0x3c6a82}:null;}})['then'](respondWithResult(_0x4e5be3,null))[_0xf6f9('0x45')](handleError(_0x4e5be3,null));};exports['getDescriptions']=function(_0x1a8965,_0x3ac290,_0x288200){var _0x5a2fdb={};var _0xf3cd8d={};var _0x31bfa6;var _0x3a6028;return db[_0xf6f9('0x2e')][_0xf6f9('0x4d')]({'where':{'id':_0x1a8965[_0xf6f9('0x47')]['id']}})[_0xf6f9('0x28')](handleEntityNotFound(_0x3ac290,null))['then'](function(_0x16831e){if(_0x16831e){_0x31bfa6=_0x16831e;_0xf3cd8d[_0xf6f9('0x36')]=_[_0xf6f9('0x33')](db[_0xf6f9('0x4e')]['rawAttributes']);_0xf3cd8d[_0xf6f9('0x32')]=_[_0xf6f9('0x33')](_0x1a8965['query']);_0xf3cd8d[_0xf6f9('0x34')]=_[_0xf6f9('0x35')](_0xf3cd8d[_0xf6f9('0x36')],_0xf3cd8d['query']);_0x5a2fdb[_0xf6f9('0x37')]=_['intersection'](_0xf3cd8d['model'],qs[_0xf6f9('0x4f')](_0x1a8965['query'][_0xf6f9('0x4f')]));_0x5a2fdb[_0xf6f9('0x37')]=_0x5a2fdb[_0xf6f9('0x37')]['length']?_0x5a2fdb['attributes']:_0xf3cd8d['model'];_0x5a2fdb['order']=qs['sort'](_0x1a8965[_0xf6f9('0x32')][_0xf6f9('0x3b')]);_0x5a2fdb[_0xf6f9('0x3c')]=qs[_0xf6f9('0x34')](_[_0xf6f9('0x3d')](_0x1a8965[_0xf6f9('0x32')],_0xf3cd8d[_0xf6f9('0x34')]));if(_0x1a8965[_0xf6f9('0x32')][_0xf6f9('0x3e')]){_0x5a2fdb[_0xf6f9('0x3c')]=_['merge'](_0x5a2fdb[_0xf6f9('0x3c')],{'$or':_[_0xf6f9('0x2d')](_0x5a2fdb[_0xf6f9('0x37')],function(_0xee46cc){var _0x3cfa33={};_0x3cfa33[_0xee46cc]={'$like':'%'+_0x1a8965[_0xf6f9('0x32')]['filter']+'%'};return _0x3cfa33;})});}_0x5a2fdb=_[_0xf6f9('0x3f')]({},_0x5a2fdb,_0x1a8965[_0xf6f9('0x41')]);return _0x31bfa6[_0xf6f9('0x52')](_0x5a2fdb);}})[_0xf6f9('0x28')](function(_0x43e018){if(_0x43e018){_0x3a6028=_0x43e018[_0xf6f9('0x38')];if(!_0x1a8965[_0xf6f9('0x32')][_0xf6f9('0x39')]('nolimit')){_0x5a2fdb[_0xf6f9('0x21')]=qs[_0xf6f9('0x21')](_0x1a8965[_0xf6f9('0x32')][_0xf6f9('0x21')]);_0x5a2fdb['offset']=qs[_0xf6f9('0x1f')](_0x1a8965[_0xf6f9('0x32')][_0xf6f9('0x1f')]);}return _0x31bfa6['getDescriptions'](_0x5a2fdb);}})[_0xf6f9('0x28')](function(_0x172fe5){if(_0x172fe5){return _0x172fe5?{'count':_0x3a6028,'rows':_0x172fe5}:null;}})[_0xf6f9('0x28')](respondWithResult(_0x3ac290,null))[_0xf6f9('0x45')](handleError(_0x3ac290,null));};exports[_0xf6f9('0x53')]=function(_0x172352,_0x313be5,_0x13c3d7){var _0x13fe62={};var _0x449047={};var _0x46622d;var _0x46a8f5;return db[_0xf6f9('0x2e')][_0xf6f9('0x4d')]({'where':{'id':_0x172352[_0xf6f9('0x47')]['id']}})['then'](handleEntityNotFound(_0x313be5,null))['then'](function(_0x2b5720){if(_0x2b5720){_0x46622d=_0x2b5720;_0x449047[_0xf6f9('0x36')]=_[_0xf6f9('0x33')](db[_0xf6f9('0x54')][_0xf6f9('0x2f')]);_0x449047[_0xf6f9('0x32')]=_[_0xf6f9('0x33')](_0x172352[_0xf6f9('0x32')]);_0x449047[_0xf6f9('0x34')]=_[_0xf6f9('0x35')](_0x449047['model'],_0x449047[_0xf6f9('0x32')]);_0x13fe62[_0xf6f9('0x37')]=_[_0xf6f9('0x35')](_0x449047[_0xf6f9('0x36')],qs[_0xf6f9('0x4f')](_0x172352[_0xf6f9('0x32')]['fields']));_0x13fe62[_0xf6f9('0x37')]=_0x13fe62['attributes']['length']?_0x13fe62[_0xf6f9('0x37')]:_0x449047[_0xf6f9('0x36')];_0x13fe62[_0xf6f9('0x50')]=qs[_0xf6f9('0x3b')](_0x172352[_0xf6f9('0x32')][_0xf6f9('0x3b')]);_0x13fe62[_0xf6f9('0x3c')]=qs[_0xf6f9('0x34')](_[_0xf6f9('0x3d')](_0x172352[_0xf6f9('0x32')],_0x449047[_0xf6f9('0x34')]));if(_0x172352[_0xf6f9('0x32')][_0xf6f9('0x3e')]){_0x13fe62[_0xf6f9('0x3c')]=_[_0xf6f9('0x3f')](_0x13fe62[_0xf6f9('0x3c')],{'$or':_[_0xf6f9('0x2d')](_0x13fe62[_0xf6f9('0x37')],function(_0x5f5bdd){var _0x58c7be={};_0x58c7be[_0x5f5bdd]={'$like':'%'+_0x172352[_0xf6f9('0x32')]['filter']+'%'};return _0x58c7be;})});}_0x13fe62=_[_0xf6f9('0x3f')]({},_0x13fe62,_0x172352[_0xf6f9('0x41')]);return _0x46622d[_0xf6f9('0x53')](_0x13fe62);}})['then'](function(_0x146735){if(_0x146735){_0x46a8f5=_0x146735['length'];if(!_0x172352['query'][_0xf6f9('0x39')]('nolimit')){_0x13fe62[_0xf6f9('0x21')]=qs[_0xf6f9('0x21')](_0x172352[_0xf6f9('0x32')][_0xf6f9('0x21')]);_0x13fe62['offset']=qs[_0xf6f9('0x1f')](_0x172352[_0xf6f9('0x32')][_0xf6f9('0x1f')]);}return _0x46622d['getTags'](_0x13fe62);}})[_0xf6f9('0x28')](function(_0x3ac971){if(_0x3ac971){return _0x3ac971?{'count':_0x46a8f5,'rows':_0x3ac971}:null;}})[_0xf6f9('0x28')](respondWithResult(_0x313be5,null))[_0xf6f9('0x45')](handleError(_0x313be5,null));};exports[_0xf6f9('0x55')]=function(_0x2d7d11,_0x220d5f,_0xb54f2d){if(_0x2d7d11[_0xf6f9('0x49')]['id']){delete _0x2d7d11[_0xf6f9('0x49')]['id'];}return db[_0xf6f9('0x2e')][_0xf6f9('0x4d')]({'where':{'id':_0x2d7d11['params']['id']}})[_0xf6f9('0x28')](handleEntityNotFound(_0x220d5f,null))[_0xf6f9('0x28')](function(_0x3920b5){if(_0x3920b5){return _0x3920b5['setTags'](_0x2d7d11['body'][_0xf6f9('0x56')]||[]);}return null;})['then'](respondWithResult(_0x220d5f,null))[_0xf6f9('0x45')](handleError(_0x220d5f,null));}; \ No newline at end of file +var _0x8d29=['getSubjects','findOne','order','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','FreshdeskConfiguration','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','getFields','FreshdeskField'];(function(_0x4202bc,_0x2ed6cf){var _0x319148=function(_0x537d36){while(--_0x537d36){_0x4202bc['push'](_0x4202bc['shift']());}};_0x319148(++_0x2ed6cf);}(_0x8d29,0x109));var _0x98d2=function(_0x15ad07,_0x39b691){_0x15ad07=_0x15ad07-0x0;var _0x313a4b=_0x8d29[_0x15ad07];return _0x313a4b;};'use strict';var emlformat=require(_0x98d2('0x0'));var rimraf=require(_0x98d2('0x1'));var zipdir=require(_0x98d2('0x2'));var jsonpatch=require(_0x98d2('0x3'));var rp=require(_0x98d2('0x4'));var moment=require('moment');var BPromise=require(_0x98d2('0x5'));var Mustache=require(_0x98d2('0x6'));var util=require('util');var path=require(_0x98d2('0x7'));var sox=require('sox');var csv=require(_0x98d2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x98d2('0x9'));var _=require(_0x98d2('0xa'));var squel=require(_0x98d2('0xb'));var crypto=require(_0x98d2('0xc'));var jsforce=require(_0x98d2('0xd'));var deskjs=require(_0x98d2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x98d2('0xf'));var Papa=require(_0x98d2('0x10'));var Redis=require(_0x98d2('0x11'));var authService=require(_0x98d2('0x12'));var qs=require(_0x98d2('0x13'));var as=require(_0x98d2('0x14'));var hardwareService=require(_0x98d2('0x15'));var logger=require(_0x98d2('0x16'))(_0x98d2('0x17'));var utils=require(_0x98d2('0x18'));var config=require(_0x98d2('0x19'));var licenseUtil=require(_0x98d2('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32efb5,_0x212ab4){_0x212ab4=_0x212ab4||0xcc;return function(_0xd4969b){if(_0xd4969b){return _0x32efb5[_0x98d2('0x1b')](_0x212ab4);}return _0x32efb5[_0x98d2('0x1c')](_0x212ab4)['end']();};}function respondWithResult(_0x4e1c95,_0x5100c5){_0x5100c5=_0x5100c5||0xc8;return function(_0x11282e){if(_0x11282e){return _0x4e1c95[_0x98d2('0x1c')](_0x5100c5)[_0x98d2('0x1d')](_0x11282e);}};}function respondWithFilteredResult(_0x26f045,_0x5d2716){return function(_0x187425){if(_0x187425){var _0x1757e6=typeof _0x5d2716['offset']===_0x98d2('0x1e')&&typeof _0x5d2716['limit']===_0x98d2('0x1e');var _0x32b407=_0x187425[_0x98d2('0x1f')];var _0x4e00fd=_0x1757e6?0x0:_0x5d2716[_0x98d2('0x20')];var _0x5c3fd1=_0x1757e6?_0x187425['count']:_0x5d2716[_0x98d2('0x20')]+_0x5d2716['limit'];var _0x284645;if(_0x5c3fd1>=_0x32b407){_0x5c3fd1=_0x32b407;_0x284645=0xc8;}else{_0x284645=0xce;}_0x26f045['status'](_0x284645);return _0x26f045[_0x98d2('0x21')](_0x98d2('0x22'),_0x4e00fd+'-'+_0x5c3fd1+'/'+_0x32b407)[_0x98d2('0x1d')](_0x187425);}return null;};}function patchUpdates(_0x29768f){return function(_0x473a46){try{jsonpatch[_0x98d2('0x23')](_0x473a46,_0x29768f,!![]);}catch(_0x5edea0){return BPromise[_0x98d2('0x24')](_0x5edea0);}return _0x473a46[_0x98d2('0x25')]();};}function saveUpdates(_0x478a06,_0x32bb50){return function(_0x17f7eb){if(_0x17f7eb){return _0x17f7eb[_0x98d2('0x26')](_0x478a06)['then'](function(_0x498b76){return _0x498b76;});}return null;};}function removeEntity(_0x1bc562,_0x3b4cac){return function(_0x2ef8ef){if(_0x2ef8ef){return _0x2ef8ef['destroy']()[_0x98d2('0x27')](function(){_0x1bc562['status'](0xcc)[_0x98d2('0x28')]();});}};}function handleEntityNotFound(_0x48737b,_0x36ac6a){return function(_0xfceb6a){if(!_0xfceb6a){_0x48737b[_0x98d2('0x1b')](0x194);}return _0xfceb6a;};}function handleError(_0xc54c,_0x3ef204){_0x3ef204=_0x3ef204||0x1f4;return function(_0x38751a){logger[_0x98d2('0x29')](_0x38751a['stack']);if(_0x38751a[_0x98d2('0x2a')]){delete _0x38751a[_0x98d2('0x2a')];}_0xc54c[_0x98d2('0x1c')](_0x3ef204)[_0x98d2('0x2b')](_0x38751a);};}exports[_0x98d2('0x2c')]=function(_0x2bae4c,_0x482665){var _0x504205={},_0x375298={},_0x3c7682={'count':0x0,'rows':[]};var _0xfe2268=_['map'](db['FreshdeskConfiguration']['rawAttributes'],function(_0x99c5b8){return{'name':_0x99c5b8[_0x98d2('0x2d')],'type':_0x99c5b8[_0x98d2('0x2e')][_0x98d2('0x2f')]};});_0x375298[_0x98d2('0x30')]=_[_0x98d2('0x31')](_0xfe2268,_0x98d2('0x2a'));_0x375298[_0x98d2('0x32')]=_['keys'](_0x2bae4c['query']);_0x375298[_0x98d2('0x33')]=_[_0x98d2('0x34')](_0x375298[_0x98d2('0x30')],_0x375298[_0x98d2('0x32')]);_0x504205[_0x98d2('0x35')]=_['intersection'](_0x375298[_0x98d2('0x30')],qs[_0x98d2('0x36')](_0x2bae4c[_0x98d2('0x32')][_0x98d2('0x36')]));_0x504205[_0x98d2('0x35')]=_0x504205[_0x98d2('0x35')][_0x98d2('0x37')]?_0x504205[_0x98d2('0x35')]:_0x375298[_0x98d2('0x30')];if(!_0x2bae4c[_0x98d2('0x32')][_0x98d2('0x38')](_0x98d2('0x39'))){_0x504205['limit']=qs['limit'](_0x2bae4c[_0x98d2('0x32')][_0x98d2('0x3a')]);_0x504205[_0x98d2('0x20')]=qs[_0x98d2('0x20')](_0x2bae4c[_0x98d2('0x32')][_0x98d2('0x20')]);}_0x504205['order']=qs[_0x98d2('0x3b')](_0x2bae4c[_0x98d2('0x32')][_0x98d2('0x3b')]);_0x504205[_0x98d2('0x3c')]=qs[_0x98d2('0x33')](_[_0x98d2('0x3d')](_0x2bae4c['query'],_0x375298['filters']),_0xfe2268);if(_0x2bae4c[_0x98d2('0x32')]['filter']){_0x504205[_0x98d2('0x3c')]=_['merge'](_0x504205[_0x98d2('0x3c')],{'$or':_[_0x98d2('0x31')](_0xfe2268,function(_0x580e25){if(_0x580e25[_0x98d2('0x2e')]!=='VIRTUAL'){var _0x1838a1={};_0x1838a1[_0x580e25[_0x98d2('0x2a')]]={'$like':'%'+_0x2bae4c[_0x98d2('0x32')][_0x98d2('0x3e')]+'%'};return _0x1838a1;}})});}_0x504205=_[_0x98d2('0x3f')]({},_0x504205,_0x2bae4c[_0x98d2('0x40')]);var _0xd8ca63={'where':_0x504205[_0x98d2('0x3c')]};return db['FreshdeskConfiguration']['count'](_0xd8ca63)[_0x98d2('0x27')](function(_0x58fcd4){_0x3c7682[_0x98d2('0x1f')]=_0x58fcd4;if(_0x2bae4c[_0x98d2('0x32')][_0x98d2('0x41')]){_0x504205['include']=[{'all':!![]}];}return db[_0x98d2('0x42')][_0x98d2('0x43')](_0x504205);})[_0x98d2('0x27')](function(_0x4be05c){_0x3c7682[_0x98d2('0x44')]=_0x4be05c;return _0x3c7682;})['then'](respondWithFilteredResult(_0x482665,_0x504205))[_0x98d2('0x45')](handleError(_0x482665,null));};exports[_0x98d2('0x46')]=function(_0xc3a67c,_0x20a45e){var _0x4e4695={'raw':![],'where':{'id':_0xc3a67c['params']['id']}},_0x24266a={};_0x24266a['model']=_[_0x98d2('0x47')](db[_0x98d2('0x42')][_0x98d2('0x48')]);_0x24266a['query']=_[_0x98d2('0x47')](_0xc3a67c[_0x98d2('0x32')]);_0x24266a[_0x98d2('0x33')]=_[_0x98d2('0x34')](_0x24266a['model'],_0x24266a[_0x98d2('0x32')]);_0x4e4695[_0x98d2('0x35')]=_[_0x98d2('0x34')](_0x24266a[_0x98d2('0x30')],qs[_0x98d2('0x36')](_0xc3a67c[_0x98d2('0x32')]['fields']));_0x4e4695[_0x98d2('0x35')]=_0x4e4695[_0x98d2('0x35')][_0x98d2('0x37')]?_0x4e4695[_0x98d2('0x35')]:_0x24266a[_0x98d2('0x30')];if(_0xc3a67c[_0x98d2('0x32')][_0x98d2('0x41')]){_0x4e4695['include']=[{'all':!![]}];}_0x4e4695=_[_0x98d2('0x3f')]({},_0x4e4695,_0xc3a67c[_0x98d2('0x40')]);return db[_0x98d2('0x42')][_0x98d2('0x49')](_0x4e4695)[_0x98d2('0x27')](handleEntityNotFound(_0x20a45e,null))[_0x98d2('0x27')](respondWithResult(_0x20a45e,null))[_0x98d2('0x45')](handleError(_0x20a45e,null));};exports[_0x98d2('0x4a')]=function(_0x283069,_0x4c5f77){return db['FreshdeskConfiguration']['create'](_0x283069[_0x98d2('0x4b')],{})['then'](respondWithResult(_0x4c5f77,0xc9))['catch'](handleError(_0x4c5f77,null));};exports[_0x98d2('0x26')]=function(_0x182cf9,_0xc30797){if(_0x182cf9[_0x98d2('0x4b')]['id']){delete _0x182cf9[_0x98d2('0x4b')]['id'];}return db[_0x98d2('0x42')]['find']({'where':{'id':_0x182cf9[_0x98d2('0x4c')]['id']}})[_0x98d2('0x27')](handleEntityNotFound(_0xc30797,null))['then'](saveUpdates(_0x182cf9[_0x98d2('0x4b')],null))[_0x98d2('0x27')](respondWithResult(_0xc30797,null))['catch'](handleError(_0xc30797,null));};exports['destroy']=function(_0x3f9b56,_0x48cbcd){return db[_0x98d2('0x42')][_0x98d2('0x49')]({'where':{'id':_0x3f9b56[_0x98d2('0x4c')]['id']}})[_0x98d2('0x27')](handleEntityNotFound(_0x48cbcd,null))[_0x98d2('0x27')](removeEntity(_0x48cbcd,null))[_0x98d2('0x45')](handleError(_0x48cbcd,null));};exports[_0x98d2('0x4d')]=function(_0x21737f,_0x3317ab,_0x3f57b5){var _0x45d6cc={};var _0x19f721={};var _0x806136;var _0x11ff78;return db[_0x98d2('0x42')]['findOne']({'where':{'id':_0x21737f[_0x98d2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3317ab,null))[_0x98d2('0x27')](function(_0x513c6c){if(_0x513c6c){_0x806136=_0x513c6c;_0x19f721['model']=_['keys'](db[_0x98d2('0x4e')]['rawAttributes']);_0x19f721['query']=_[_0x98d2('0x47')](_0x21737f[_0x98d2('0x32')]);_0x19f721[_0x98d2('0x33')]=_[_0x98d2('0x34')](_0x19f721['model'],_0x19f721[_0x98d2('0x32')]);_0x45d6cc['attributes']=_['intersection'](_0x19f721[_0x98d2('0x30')],qs[_0x98d2('0x36')](_0x21737f[_0x98d2('0x32')][_0x98d2('0x36')]));_0x45d6cc[_0x98d2('0x35')]=_0x45d6cc[_0x98d2('0x35')][_0x98d2('0x37')]?_0x45d6cc[_0x98d2('0x35')]:_0x19f721[_0x98d2('0x30')];_0x45d6cc['order']=qs['sort'](_0x21737f[_0x98d2('0x32')][_0x98d2('0x3b')]);_0x45d6cc[_0x98d2('0x3c')]=qs[_0x98d2('0x33')](_[_0x98d2('0x3d')](_0x21737f[_0x98d2('0x32')],_0x19f721['filters']));if(_0x21737f['query'][_0x98d2('0x3e')]){_0x45d6cc[_0x98d2('0x3c')]=_[_0x98d2('0x3f')](_0x45d6cc[_0x98d2('0x3c')],{'$or':_[_0x98d2('0x31')](_0x45d6cc[_0x98d2('0x35')],function(_0x1cf75b){var _0xa3a3ca={};_0xa3a3ca[_0x1cf75b]={'$like':'%'+_0x21737f[_0x98d2('0x32')]['filter']+'%'};return _0xa3a3ca;})});}_0x45d6cc=_[_0x98d2('0x3f')]({},_0x45d6cc,_0x21737f['options']);return _0x806136[_0x98d2('0x4d')](_0x45d6cc);}})[_0x98d2('0x27')](function(_0x47e6dc){if(_0x47e6dc){_0x11ff78=_0x47e6dc['length'];if(!_0x21737f[_0x98d2('0x32')][_0x98d2('0x38')](_0x98d2('0x39'))){_0x45d6cc[_0x98d2('0x3a')]=qs[_0x98d2('0x3a')](_0x21737f['query']['limit']);_0x45d6cc[_0x98d2('0x20')]=qs[_0x98d2('0x20')](_0x21737f[_0x98d2('0x32')][_0x98d2('0x20')]);}return _0x806136['getFields'](_0x45d6cc);}})[_0x98d2('0x27')](function(_0x337e93){if(_0x337e93){return _0x337e93?{'count':_0x11ff78,'rows':_0x337e93}:null;}})[_0x98d2('0x27')](respondWithResult(_0x3317ab,null))[_0x98d2('0x45')](handleError(_0x3317ab,null));};exports[_0x98d2('0x4f')]=function(_0x27ce31,_0xa5ee72,_0x173af0){var _0x5b0bd3={};var _0xb25b6e={};var _0x51b2fc;var _0x252e81;return db[_0x98d2('0x42')][_0x98d2('0x50')]({'where':{'id':_0x27ce31[_0x98d2('0x4c')]['id']}})['then'](handleEntityNotFound(_0xa5ee72,null))[_0x98d2('0x27')](function(_0x3b9247){if(_0x3b9247){_0x51b2fc=_0x3b9247;_0xb25b6e[_0x98d2('0x30')]=_[_0x98d2('0x47')](db[_0x98d2('0x4e')][_0x98d2('0x48')]);_0xb25b6e[_0x98d2('0x32')]=_[_0x98d2('0x47')](_0x27ce31[_0x98d2('0x32')]);_0xb25b6e[_0x98d2('0x33')]=_[_0x98d2('0x34')](_0xb25b6e[_0x98d2('0x30')],_0xb25b6e[_0x98d2('0x32')]);_0x5b0bd3['attributes']=_[_0x98d2('0x34')](_0xb25b6e[_0x98d2('0x30')],qs[_0x98d2('0x36')](_0x27ce31[_0x98d2('0x32')][_0x98d2('0x36')]));_0x5b0bd3['attributes']=_0x5b0bd3[_0x98d2('0x35')][_0x98d2('0x37')]?_0x5b0bd3[_0x98d2('0x35')]:_0xb25b6e['model'];_0x5b0bd3[_0x98d2('0x51')]=qs[_0x98d2('0x3b')](_0x27ce31[_0x98d2('0x32')]['sort']);_0x5b0bd3[_0x98d2('0x3c')]=qs[_0x98d2('0x33')](_['pick'](_0x27ce31['query'],_0xb25b6e['filters']));if(_0x27ce31['query'][_0x98d2('0x3e')]){_0x5b0bd3[_0x98d2('0x3c')]=_['merge'](_0x5b0bd3[_0x98d2('0x3c')],{'$or':_[_0x98d2('0x31')](_0x5b0bd3[_0x98d2('0x35')],function(_0x4c1b68){var _0x3694a0={};_0x3694a0[_0x4c1b68]={'$like':'%'+_0x27ce31[_0x98d2('0x32')]['filter']+'%'};return _0x3694a0;})});}_0x5b0bd3=_[_0x98d2('0x3f')]({},_0x5b0bd3,_0x27ce31[_0x98d2('0x40')]);return _0x51b2fc['getSubjects'](_0x5b0bd3);}})['then'](function(_0x1fa49f){if(_0x1fa49f){_0x252e81=_0x1fa49f['length'];if(!_0x27ce31['query'][_0x98d2('0x38')]('nolimit')){_0x5b0bd3['limit']=qs[_0x98d2('0x3a')](_0x27ce31[_0x98d2('0x32')][_0x98d2('0x3a')]);_0x5b0bd3['offset']=qs[_0x98d2('0x20')](_0x27ce31['query']['offset']);}return _0x51b2fc[_0x98d2('0x4f')](_0x5b0bd3);}})[_0x98d2('0x27')](function(_0xa38145){if(_0xa38145){return _0xa38145?{'count':_0x252e81,'rows':_0xa38145}:null;}})[_0x98d2('0x27')](respondWithResult(_0xa5ee72,null))[_0x98d2('0x45')](handleError(_0xa5ee72,null));};exports[_0x98d2('0x52')]=function(_0x261d15,_0x2d6ef3,_0x229c71){var _0x2a2017={};var _0x5c1e97={};var _0x1e967f;var _0x312a2d;return db[_0x98d2('0x42')][_0x98d2('0x50')]({'where':{'id':_0x261d15[_0x98d2('0x4c')]['id']}})[_0x98d2('0x27')](handleEntityNotFound(_0x2d6ef3,null))[_0x98d2('0x27')](function(_0x25602f){if(_0x25602f){_0x1e967f=_0x25602f;_0x5c1e97[_0x98d2('0x30')]=_[_0x98d2('0x47')](db[_0x98d2('0x4e')][_0x98d2('0x48')]);_0x5c1e97[_0x98d2('0x32')]=_[_0x98d2('0x47')](_0x261d15[_0x98d2('0x32')]);_0x5c1e97[_0x98d2('0x33')]=_[_0x98d2('0x34')](_0x5c1e97[_0x98d2('0x30')],_0x5c1e97[_0x98d2('0x32')]);_0x2a2017[_0x98d2('0x35')]=_[_0x98d2('0x34')](_0x5c1e97['model'],qs[_0x98d2('0x36')](_0x261d15[_0x98d2('0x32')][_0x98d2('0x36')]));_0x2a2017[_0x98d2('0x35')]=_0x2a2017['attributes'][_0x98d2('0x37')]?_0x2a2017[_0x98d2('0x35')]:_0x5c1e97[_0x98d2('0x30')];_0x2a2017[_0x98d2('0x51')]=qs['sort'](_0x261d15[_0x98d2('0x32')][_0x98d2('0x3b')]);_0x2a2017[_0x98d2('0x3c')]=qs[_0x98d2('0x33')](_[_0x98d2('0x3d')](_0x261d15['query'],_0x5c1e97['filters']));if(_0x261d15[_0x98d2('0x32')][_0x98d2('0x3e')]){_0x2a2017[_0x98d2('0x3c')]=_['merge'](_0x2a2017[_0x98d2('0x3c')],{'$or':_[_0x98d2('0x31')](_0x2a2017[_0x98d2('0x35')],function(_0x8f2d4e){var _0x274f5f={};_0x274f5f[_0x8f2d4e]={'$like':'%'+_0x261d15[_0x98d2('0x32')][_0x98d2('0x3e')]+'%'};return _0x274f5f;})});}_0x2a2017=_[_0x98d2('0x3f')]({},_0x2a2017,_0x261d15[_0x98d2('0x40')]);return _0x1e967f[_0x98d2('0x52')](_0x2a2017);}})[_0x98d2('0x27')](function(_0x108c3d){if(_0x108c3d){_0x312a2d=_0x108c3d[_0x98d2('0x37')];if(!_0x261d15[_0x98d2('0x32')][_0x98d2('0x38')](_0x98d2('0x39'))){_0x2a2017[_0x98d2('0x3a')]=qs[_0x98d2('0x3a')](_0x261d15[_0x98d2('0x32')][_0x98d2('0x3a')]);_0x2a2017['offset']=qs[_0x98d2('0x20')](_0x261d15[_0x98d2('0x32')][_0x98d2('0x20')]);}return _0x1e967f['getDescriptions'](_0x2a2017);}})[_0x98d2('0x27')](function(_0x9fe26e){if(_0x9fe26e){return _0x9fe26e?{'count':_0x312a2d,'rows':_0x9fe26e}:null;}})[_0x98d2('0x27')](respondWithResult(_0x2d6ef3,null))[_0x98d2('0x45')](handleError(_0x2d6ef3,null));};exports['getTags']=function(_0x35a612,_0x567e92,_0xb65472){var _0x5324e8={};var _0x243a2e={};var _0x4a9d73;var _0x306452;return db['FreshdeskConfiguration'][_0x98d2('0x50')]({'where':{'id':_0x35a612[_0x98d2('0x4c')]['id']}})[_0x98d2('0x27')](handleEntityNotFound(_0x567e92,null))[_0x98d2('0x27')](function(_0x4ec1c5){if(_0x4ec1c5){_0x4a9d73=_0x4ec1c5;_0x243a2e[_0x98d2('0x30')]=_[_0x98d2('0x47')](db['Tag']['rawAttributes']);_0x243a2e[_0x98d2('0x32')]=_[_0x98d2('0x47')](_0x35a612[_0x98d2('0x32')]);_0x243a2e[_0x98d2('0x33')]=_[_0x98d2('0x34')](_0x243a2e[_0x98d2('0x30')],_0x243a2e[_0x98d2('0x32')]);_0x5324e8[_0x98d2('0x35')]=_[_0x98d2('0x34')](_0x243a2e[_0x98d2('0x30')],qs[_0x98d2('0x36')](_0x35a612[_0x98d2('0x32')][_0x98d2('0x36')]));_0x5324e8[_0x98d2('0x35')]=_0x5324e8[_0x98d2('0x35')][_0x98d2('0x37')]?_0x5324e8[_0x98d2('0x35')]:_0x243a2e[_0x98d2('0x30')];_0x5324e8['order']=qs['sort'](_0x35a612['query'][_0x98d2('0x3b')]);_0x5324e8[_0x98d2('0x3c')]=qs[_0x98d2('0x33')](_[_0x98d2('0x3d')](_0x35a612['query'],_0x243a2e[_0x98d2('0x33')]));if(_0x35a612[_0x98d2('0x32')][_0x98d2('0x3e')]){_0x5324e8[_0x98d2('0x3c')]=_[_0x98d2('0x3f')](_0x5324e8[_0x98d2('0x3c')],{'$or':_['map'](_0x5324e8[_0x98d2('0x35')],function(_0x52a4ad){var _0x3fccd1={};_0x3fccd1[_0x52a4ad]={'$like':'%'+_0x35a612[_0x98d2('0x32')]['filter']+'%'};return _0x3fccd1;})});}_0x5324e8=_[_0x98d2('0x3f')]({},_0x5324e8,_0x35a612[_0x98d2('0x40')]);return _0x4a9d73[_0x98d2('0x53')](_0x5324e8);}})[_0x98d2('0x27')](function(_0x516585){if(_0x516585){_0x306452=_0x516585['length'];if(!_0x35a612[_0x98d2('0x32')][_0x98d2('0x38')](_0x98d2('0x39'))){_0x5324e8['limit']=qs[_0x98d2('0x3a')](_0x35a612['query']['limit']);_0x5324e8['offset']=qs[_0x98d2('0x20')](_0x35a612[_0x98d2('0x32')][_0x98d2('0x20')]);}return _0x4a9d73[_0x98d2('0x53')](_0x5324e8);}})[_0x98d2('0x27')](function(_0xeb0138){if(_0xeb0138){return _0xeb0138?{'count':_0x306452,'rows':_0xeb0138}:null;}})['then'](respondWithResult(_0x567e92,null))[_0x98d2('0x45')](handleError(_0x567e92,null));};exports[_0x98d2('0x54')]=function(_0x3b376f,_0x412d6b,_0x12448c){if(_0x3b376f[_0x98d2('0x4b')]['id']){delete _0x3b376f[_0x98d2('0x4b')]['id'];}return db[_0x98d2('0x42')]['findOne']({'where':{'id':_0x3b376f[_0x98d2('0x4c')]['id']}})[_0x98d2('0x27')](handleEntityNotFound(_0x412d6b,null))[_0x98d2('0x27')](function(_0xef5238){if(_0xef5238){return _0xef5238[_0x98d2('0x54')](_0x3b376f['body'][_0x98d2('0x55')]||[]);}return null;})[_0x98d2('0x27')](respondWithResult(_0x412d6b,null))[_0x98d2('0x45')](handleError(_0x412d6b,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index a83053a..005316c 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 _0xbf6e=['bluebird','request-promise','rimraf','../../config/environment','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x226ad1,_0x2858e2){var _0x16b625=function(_0x4dc555){while(--_0x4dc555){_0x226ad1['push'](_0x226ad1['shift']());}};_0x16b625(++_0x2858e2);}(_0xbf6e,0x1dc));var _0xebf6=function(_0x4d2169,_0x353eb9){_0x4d2169=_0x4d2169-0x0;var _0x52e417=_0xbf6e[_0x4d2169];return _0x52e417;};'use strict';var _=require(_0xebf6('0x0'));var util=require(_0xebf6('0x1'));var logger=require(_0xebf6('0x2'))(_0xebf6('0x3'));var moment=require(_0xebf6('0x4'));var BPromise=require(_0xebf6('0x5'));var rp=require(_0xebf6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xebf6('0x7'));var config=require(_0xebf6('0x8'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xebf6('0x9')]=function(_0x52de33,_0x12eba9){return _0x52de33[_0xebf6('0xa')](_0xebf6('0xb'),attributes,{'tableName':_0xebf6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54f0=['rimraf','../../config/environment','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x54f0,0xfd));var _0x054f=function(_0x266de2,_0x480cb5){_0x266de2=_0x266de2-0x0;var _0xe93032=_0x54f0[_0x266de2];return _0xe93032;};'use strict';var _=require(_0x054f('0x0'));var util=require(_0x054f('0x1'));var logger=require(_0x054f('0x2'))(_0x054f('0x3'));var moment=require(_0x054f('0x4'));var BPromise=require(_0x054f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x054f('0x6'));var rimraf=require(_0x054f('0x7'));var config=require(_0x054f('0x8'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x054f('0x9')]=function(_0x1b9b0d,_0x3e610f){return _0x1b9b0d[_0x054f('0xa')](_0x054f('0xb'),attributes,{'tableName':_0x054f('0xc'),'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 d12cd04..1d6f7e3 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 _0x1aa0=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x1aa0,0x143));var _0x01aa=function(_0x20beae,_0x5eac6d){_0x20beae=_0x20beae-0x0;var _0xf5725=_0x1aa0[_0x20beae];return _0xf5725;};'use strict';var _=require(_0x01aa('0x0'));var util=require(_0x01aa('0x1'));var moment=require(_0x01aa('0x2'));var BPromise=require(_0x01aa('0x3'));var rs=require(_0x01aa('0x4'));var fs=require('fs');var Redis=require(_0x01aa('0x5'));var db=require(_0x01aa('0x6'))['db'];var utils=require(_0x01aa('0x7'));var logger=require(_0x01aa('0x8'))(_0x01aa('0x9'));var config=require(_0x01aa('0xa'));var jayson=require(_0x01aa('0xb'));var client=jayson[_0x01aa('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x193acb,_0x566b7f,_0x2ce2b9){return new BPromise(function(_0x56ab76,_0x15f599){return client[_0x01aa('0xd')](_0x193acb,_0x2ce2b9)[_0x01aa('0xe')](function(_0x332467){logger['info'](_0x01aa('0xf'),_0x566b7f,'request\x20sent');logger[_0x01aa('0x10')](_0x01aa('0x11'),_0x566b7f,_0x01aa('0x12'),JSON[_0x01aa('0x13')](_0x332467));if(_0x332467[_0x01aa('0x14')]){if(_0x332467[_0x01aa('0x14')][_0x01aa('0x15')]===0x1f4){logger[_0x01aa('0x14')](_0x01aa('0xf'),_0x566b7f,_0x332467[_0x01aa('0x14')][_0x01aa('0x16')]);return _0x15f599(_0x332467[_0x01aa('0x14')][_0x01aa('0x16')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x566b7f,_0x332467[_0x01aa('0x14')][_0x01aa('0x16')]);return _0x56ab76(_0x332467[_0x01aa('0x14')][_0x01aa('0x16')]);}else{logger[_0x01aa('0x17')](_0x01aa('0xf'),_0x566b7f,_0x01aa('0x12'));_0x56ab76(_0x332467['result']['message']);}})[_0x01aa('0x18')](function(_0x44f160){logger['error'](_0x01aa('0xf'),_0x566b7f,_0x44f160);_0x15f599(_0x44f160);});});} \ No newline at end of file +var _0x60d1=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x5d8e69,_0x249fa7){var _0x3df31b=function(_0x31a15f){while(--_0x31a15f){_0x5d8e69['push'](_0x5d8e69['shift']());}};_0x3df31b(++_0x249fa7);}(_0x60d1,0x178));var _0x160d=function(_0x2bd997,_0x31c648){_0x2bd997=_0x2bd997-0x0;var _0x5b3b21=_0x60d1[_0x2bd997];return _0x5b3b21;};'use strict';var _=require(_0x160d('0x0'));var util=require(_0x160d('0x1'));var moment=require(_0x160d('0x2'));var BPromise=require(_0x160d('0x3'));var rs=require(_0x160d('0x4'));var fs=require('fs');var Redis=require(_0x160d('0x5'));var db=require(_0x160d('0x6'))['db'];var utils=require(_0x160d('0x7'));var logger=require(_0x160d('0x8'))('rpc');var config=require(_0x160d('0x9'));var jayson=require(_0x160d('0xa'));var client=jayson[_0x160d('0xb')][_0x160d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5df0c1,_0x469c59,_0x546baa){return new BPromise(function(_0x14ba68,_0x1d3690){return client[_0x160d('0xd')](_0x5df0c1,_0x546baa)[_0x160d('0xe')](function(_0x20a496){logger[_0x160d('0xf')](_0x160d('0x10'),_0x469c59,_0x160d('0x11'));logger[_0x160d('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x469c59,'request\x20sent',JSON[_0x160d('0x13')](_0x20a496));if(_0x20a496[_0x160d('0x14')]){if(_0x20a496['error'][_0x160d('0x15')]===0x1f4){logger['error'](_0x160d('0x10'),_0x469c59,_0x20a496[_0x160d('0x14')][_0x160d('0x16')]);return _0x1d3690(_0x20a496[_0x160d('0x14')][_0x160d('0x16')]);}logger[_0x160d('0x14')](_0x160d('0x10'),_0x469c59,_0x20a496[_0x160d('0x14')][_0x160d('0x16')]);return _0x14ba68(_0x20a496['error'][_0x160d('0x16')]);}else{logger[_0x160d('0xf')](_0x160d('0x10'),_0x469c59,_0x160d('0x11'));_0x14ba68(_0x20a496[_0x160d('0x17')]['message']);}})[_0x160d('0x18')](function(_0x36e1a2){logger[_0x160d('0x14')](_0x160d('0x10'),_0x469c59,_0x36e1a2);_0x1d3690(_0x36e1a2);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 691c532..f0fd8d2 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 _0x7590=['util','path','connect-timeout','express','Router','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','multer'];(function(_0x2128b3,_0x1367c5){var _0x74335=function(_0x5de69e){while(--_0x5de69e){_0x2128b3['push'](_0x2128b3['shift']());}};_0x74335(++_0x1367c5);}(_0x7590,0xc5));var _0x0759=function(_0xcb1d60,_0x32603e){_0xcb1d60=_0xcb1d60-0x0;var _0x3beee9=_0x7590[_0xcb1d60];return _0x3beee9;};'use strict';var multer=require(_0x0759('0x0'));var util=require(_0x0759('0x1'));var path=require(_0x0759('0x2'));var timeout=require(_0x0759('0x3'));var express=require(_0x0759('0x4'));var router=express[_0x0759('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0759('0x6'));var controller=require(_0x0759('0x7'));router['get']('/',auth[_0x0759('0x8')](),controller[_0x0759('0x9')]);router[_0x0759('0xa')](_0x0759('0xb'),auth[_0x0759('0x8')](),controller[_0x0759('0xc')]);router[_0x0759('0xd')]('/',auth[_0x0759('0x8')](),controller[_0x0759('0xe')]);router[_0x0759('0xf')](_0x0759('0xb'),auth[_0x0759('0x8')](),controller[_0x0759('0x10')]);router[_0x0759('0x11')](_0x0759('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x44b6=['Router','fs-extra','./intFreshdeskField.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','exports','multer','path','express'];(function(_0x45530b,_0x556430){var _0x3c1652=function(_0x4f95e0){while(--_0x4f95e0){_0x45530b['push'](_0x45530b['shift']());}};_0x3c1652(++_0x556430);}(_0x44b6,0x1ed));var _0x644b=function(_0x5c082a,_0x19ac27){_0x5c082a=_0x5c082a-0x0;var _0x3b60ac=_0x44b6[_0x5c082a];return _0x3b60ac;};'use strict';var multer=require(_0x644b('0x0'));var util=require('util');var path=require(_0x644b('0x1'));var timeout=require('connect-timeout');var express=require(_0x644b('0x2'));var router=express[_0x644b('0x3')]();var fs_extra=require(_0x644b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x644b('0x5'));router[_0x644b('0x6')]('/',auth[_0x644b('0x7')](),controller[_0x644b('0x8')]);router[_0x644b('0x6')]('/:id',auth[_0x644b('0x7')](),controller[_0x644b('0x9')]);router[_0x644b('0xa')]('/',auth[_0x644b('0x7')](),controller[_0x644b('0xb')]);router[_0x644b('0xc')](_0x644b('0xd'),auth[_0x644b('0x7')](),controller['update']);router[_0x644b('0xe')](_0x644b('0xd'),auth[_0x644b('0x7')](),controller['destroy']);module[_0x644b('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 5b422b8..933716e 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 _0x5faa=['STRING','BOOLEAN','exports','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x30e993,_0x508e50){var _0x3ee0d0=function(_0x24e5d9){while(--_0x24e5d9){_0x30e993['push'](_0x30e993['shift']());}};_0x3ee0d0(++_0x508e50);}(_0x5faa,0x14f));var _0xa5fa=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x5faa[_0x209941];return _0x1e8729;};'use strict';var Sequelize=require('sequelize');module[_0xa5fa('0x0')]={'type':{'type':Sequelize[_0xa5fa('0x1')]('string',_0xa5fa('0x2'),_0xa5fa('0x3'),_0xa5fa('0x4'),_0xa5fa('0x5')),'defaultValue':_0xa5fa('0x6')},'content':{'type':Sequelize[_0xa5fa('0x7')]},'key':{'type':Sequelize[_0xa5fa('0x7')]},'keyType':{'type':Sequelize[_0xa5fa('0x1')](_0xa5fa('0x6'),_0xa5fa('0x2'),_0xa5fa('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa5fa('0x7')]},'nameField':{'type':Sequelize[_0xa5fa('0x7')]},'customField':{'type':Sequelize[_0xa5fa('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa5fa('0x7')]}}; \ No newline at end of file +var _0x15e5=['ENUM','BOOLEAN','exports','variable','customVariable','keyValue','picklist','string','STRING'];(function(_0x151ab8,_0x23baf9){var _0x2af2cb=function(_0x57c7b5){while(--_0x57c7b5){_0x151ab8['push'](_0x151ab8['shift']());}};_0x2af2cb(++_0x23baf9);}(_0x15e5,0xd1));var _0x515e=function(_0x344e9d,_0xe345ed){_0x344e9d=_0x344e9d-0x0;var _0x103519=_0x15e5[_0x344e9d];return _0x103519;};'use strict';var Sequelize=require('sequelize');module[_0x515e('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0x515e('0x1'),_0x515e('0x2'),_0x515e('0x3'),_0x515e('0x4')),'defaultValue':_0x515e('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x515e('0x6')]},'keyType':{'type':Sequelize[_0x515e('0x7')](_0x515e('0x5'),_0x515e('0x1'),_0x515e('0x2'))},'keyContent':{'type':Sequelize[_0x515e('0x6')]},'idField':{'type':Sequelize[_0x515e('0x6')]},'nameField':{'type':Sequelize[_0x515e('0x6')]},'customField':{'type':Sequelize[_0x515e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x515e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index e826583..9f9c693 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 _0x9354=['includeAll','include','findAll','rows','show','keys','length','find','catch','create','body','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','map','FreshdeskField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','offset','sort','filter','where','merge','type','options'];(function(_0x35ba71,_0xa2fbbd){var _0x5f04f4=function(_0x30a04f){while(--_0x30a04f){_0x35ba71['push'](_0x35ba71['shift']());}};_0x5f04f4(++_0xa2fbbd);}(_0x9354,0x96));var _0x4935=function(_0x18b191,_0x4e0684){_0x18b191=_0x18b191-0x0;var _0x43e146=_0x9354[_0x18b191];return _0x43e146;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4935('0x0'));var zipdir=require(_0x4935('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4935('0x2'));var moment=require(_0x4935('0x3'));var BPromise=require(_0x4935('0x4'));var Mustache=require(_0x4935('0x5'));var util=require('util');var path=require(_0x4935('0x6'));var sox=require(_0x4935('0x7'));var csv=require(_0x4935('0x8'));var ejs=require(_0x4935('0x9'));var fs=require('fs');var fs_extra=require(_0x4935('0xa'));var _=require(_0x4935('0xb'));var squel=require(_0x4935('0xc'));var crypto=require(_0x4935('0xd'));var jsforce=require(_0x4935('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4935('0x8'));var querystring=require('querystring');var Papa=require(_0x4935('0xf'));var Redis=require(_0x4935('0x10'));var authService=require(_0x4935('0x11'));var qs=require(_0x4935('0x12'));var as=require(_0x4935('0x13'));var hardwareService=require(_0x4935('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4935('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4935('0x16'))['db'];function respondWithStatusCode(_0x32916f,_0x3bb388){_0x3bb388=_0x3bb388||0xcc;return function(_0x1c6c22){if(_0x1c6c22){return _0x32916f[_0x4935('0x17')](_0x3bb388);}return _0x32916f[_0x4935('0x18')](_0x3bb388)[_0x4935('0x19')]();};}function respondWithResult(_0x3a7c30,_0x57549f){_0x57549f=_0x57549f||0xc8;return function(_0x237e28){if(_0x237e28){return _0x3a7c30[_0x4935('0x18')](_0x57549f)[_0x4935('0x1a')](_0x237e28);}};}function respondWithFilteredResult(_0xa41961,_0x3652c4){return function(_0x24cc99){if(_0x24cc99){var _0x395a43=typeof _0x3652c4['offset']===_0x4935('0x1b')&&typeof _0x3652c4[_0x4935('0x1c')]===_0x4935('0x1b');var _0x123300=_0x24cc99[_0x4935('0x1d')];var _0x429ef3=_0x395a43?0x0:_0x3652c4['offset'];var _0xd70eff=_0x395a43?_0x24cc99[_0x4935('0x1d')]:_0x3652c4['offset']+_0x3652c4[_0x4935('0x1c')];var _0x10407f;if(_0xd70eff>=_0x123300){_0xd70eff=_0x123300;_0x10407f=0xc8;}else{_0x10407f=0xce;}_0xa41961[_0x4935('0x18')](_0x10407f);return _0xa41961['set']('Content-Range',_0x429ef3+'-'+_0xd70eff+'/'+_0x123300)[_0x4935('0x1a')](_0x24cc99);}return null;};}function patchUpdates(_0x6b849f){return function(_0x1ae059){try{jsonpatch[_0x4935('0x1e')](_0x1ae059,_0x6b849f,!![]);}catch(_0x41d76e){return BPromise[_0x4935('0x1f')](_0x41d76e);}return _0x1ae059[_0x4935('0x20')]();};}function saveUpdates(_0xe482a5,_0x58b2f3){return function(_0x2f520a){if(_0x2f520a){return _0x2f520a[_0x4935('0x21')](_0xe482a5)[_0x4935('0x22')](function(_0x2c701f){return _0x2c701f;});}return null;};}function removeEntity(_0x52c65a,_0x53530f){return function(_0x4dc1f5){if(_0x4dc1f5){return _0x4dc1f5[_0x4935('0x23')]()[_0x4935('0x22')](function(){_0x52c65a[_0x4935('0x18')](0xcc)[_0x4935('0x19')]();});}};}function handleEntityNotFound(_0x344e51,_0x1c37ba){return function(_0x3784f9){if(!_0x3784f9){_0x344e51[_0x4935('0x17')](0x194);}return _0x3784f9;};}function handleError(_0x2e1583,_0xf4abb2){_0xf4abb2=_0xf4abb2||0x1f4;return function(_0x1d08b5){logger[_0x4935('0x24')](_0x1d08b5[_0x4935('0x25')]);if(_0x1d08b5[_0x4935('0x26')]){delete _0x1d08b5[_0x4935('0x26')];}_0x2e1583['status'](_0xf4abb2)['send'](_0x1d08b5);};}exports['index']=function(_0x1fc218,_0x76ea7d){var _0x4f1163={},_0x3f0707={},_0x20755a={'count':0x0,'rows':[]};var _0x24a3b6=_[_0x4935('0x27')](db[_0x4935('0x28')][_0x4935('0x29')],function(_0x28afc2){return{'name':_0x28afc2[_0x4935('0x2a')],'type':_0x28afc2['type'][_0x4935('0x2b')]};});_0x3f0707[_0x4935('0x2c')]=_['map'](_0x24a3b6,'name');_0x3f0707[_0x4935('0x2d')]=_['keys'](_0x1fc218[_0x4935('0x2d')]);_0x3f0707[_0x4935('0x2e')]=_[_0x4935('0x2f')](_0x3f0707['model'],_0x3f0707['query']);_0x4f1163[_0x4935('0x30')]=_[_0x4935('0x2f')](_0x3f0707['model'],qs[_0x4935('0x31')](_0x1fc218[_0x4935('0x2d')][_0x4935('0x31')]));_0x4f1163[_0x4935('0x30')]=_0x4f1163[_0x4935('0x30')]['length']?_0x4f1163['attributes']:_0x3f0707[_0x4935('0x2c')];if(!_0x1fc218[_0x4935('0x2d')]['hasOwnProperty']('nolimit')){_0x4f1163[_0x4935('0x1c')]=qs['limit'](_0x1fc218[_0x4935('0x2d')][_0x4935('0x1c')]);_0x4f1163[_0x4935('0x32')]=qs[_0x4935('0x32')](_0x1fc218[_0x4935('0x2d')][_0x4935('0x32')]);}_0x4f1163['order']=qs[_0x4935('0x33')](_0x1fc218['query'][_0x4935('0x33')]);_0x4f1163['where']=qs[_0x4935('0x2e')](_['pick'](_0x1fc218[_0x4935('0x2d')],_0x3f0707[_0x4935('0x2e')]),_0x24a3b6);if(_0x1fc218[_0x4935('0x2d')][_0x4935('0x34')]){_0x4f1163[_0x4935('0x35')]=_[_0x4935('0x36')](_0x4f1163[_0x4935('0x35')],{'$or':_['map'](_0x24a3b6,function(_0x57e1ca){if(_0x57e1ca[_0x4935('0x37')]!=='VIRTUAL'){var _0x4e8b2e={};_0x4e8b2e[_0x57e1ca[_0x4935('0x26')]]={'$like':'%'+_0x1fc218['query'][_0x4935('0x34')]+'%'};return _0x4e8b2e;}})});}_0x4f1163=_[_0x4935('0x36')]({},_0x4f1163,_0x1fc218[_0x4935('0x38')]);var _0x99b7c5={'where':_0x4f1163[_0x4935('0x35')]};return db['FreshdeskField']['count'](_0x99b7c5)[_0x4935('0x22')](function(_0x2be169){_0x20755a[_0x4935('0x1d')]=_0x2be169;if(_0x1fc218[_0x4935('0x2d')][_0x4935('0x39')]){_0x4f1163[_0x4935('0x3a')]=[{'all':!![]}];}return db[_0x4935('0x28')][_0x4935('0x3b')](_0x4f1163);})['then'](function(_0x4e94f6){_0x20755a[_0x4935('0x3c')]=_0x4e94f6;return _0x20755a;})[_0x4935('0x22')](respondWithFilteredResult(_0x76ea7d,_0x4f1163))['catch'](handleError(_0x76ea7d,null));};exports[_0x4935('0x3d')]=function(_0x157950,_0x4706eb){var _0xe5c9f5={'raw':!![],'where':{'id':_0x157950['params']['id']}},_0x52ab0c={};_0x52ab0c[_0x4935('0x2c')]=_[_0x4935('0x3e')](db['FreshdeskField'][_0x4935('0x29')]);_0x52ab0c[_0x4935('0x2d')]=_[_0x4935('0x3e')](_0x157950['query']);_0x52ab0c[_0x4935('0x2e')]=_[_0x4935('0x2f')](_0x52ab0c[_0x4935('0x2c')],_0x52ab0c[_0x4935('0x2d')]);_0xe5c9f5[_0x4935('0x30')]=_[_0x4935('0x2f')](_0x52ab0c[_0x4935('0x2c')],qs[_0x4935('0x31')](_0x157950[_0x4935('0x2d')][_0x4935('0x31')]));_0xe5c9f5[_0x4935('0x30')]=_0xe5c9f5[_0x4935('0x30')][_0x4935('0x3f')]?_0xe5c9f5[_0x4935('0x30')]:_0x52ab0c[_0x4935('0x2c')];if(_0x157950[_0x4935('0x2d')][_0x4935('0x39')]){_0xe5c9f5[_0x4935('0x3a')]=[{'all':!![]}];}_0xe5c9f5=_['merge']({},_0xe5c9f5,_0x157950[_0x4935('0x38')]);return db['FreshdeskField'][_0x4935('0x40')](_0xe5c9f5)[_0x4935('0x22')](handleEntityNotFound(_0x4706eb,null))[_0x4935('0x22')](respondWithResult(_0x4706eb,null))[_0x4935('0x41')](handleError(_0x4706eb,null));};exports['create']=function(_0x2a3404,_0x9c8bad){return db[_0x4935('0x28')][_0x4935('0x42')](_0x2a3404[_0x4935('0x43')],{})[_0x4935('0x22')](respondWithResult(_0x9c8bad,0xc9))[_0x4935('0x41')](handleError(_0x9c8bad,null));};exports[_0x4935('0x21')]=function(_0x29b932,_0x392cba){if(_0x29b932['body']['id']){delete _0x29b932[_0x4935('0x43')]['id'];}return db[_0x4935('0x28')]['find']({'where':{'id':_0x29b932[_0x4935('0x44')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x392cba,null))[_0x4935('0x22')](saveUpdates(_0x29b932[_0x4935('0x43')],null))[_0x4935('0x22')](respondWithResult(_0x392cba,null))[_0x4935('0x41')](handleError(_0x392cba,null));};exports[_0x4935('0x23')]=function(_0x471fb1,_0x4b9c70){return db[_0x4935('0x28')]['find']({'where':{'id':_0x471fb1['params']['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x4b9c70,null))[_0x4935('0x22')](removeEntity(_0x4b9c70,null))[_0x4935('0x41')](handleError(_0x4b9c70,null));}; \ No newline at end of file +var _0x6308=['path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','FreshdeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','zip-dir','moment','bluebird','mustache','util'];(function(_0x1b3892,_0x418dc2){var _0x2ba023=function(_0x4d0e1d){while(--_0x4d0e1d){_0x1b3892['push'](_0x1b3892['shift']());}};_0x2ba023(++_0x418dc2);}(_0x6308,0x1f2));var _0x8630=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x6308[_0x3ff085];return _0x2b68c3;};'use strict';var emlformat=require(_0x8630('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8630('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8630('0x2'));var BPromise=require(_0x8630('0x3'));var Mustache=require(_0x8630('0x4'));var util=require(_0x8630('0x5'));var path=require(_0x8630('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8630('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8630('0x8'));var squel=require(_0x8630('0x9'));var crypto=require(_0x8630('0xa'));var jsforce=require(_0x8630('0xb'));var deskjs=require(_0x8630('0xc'));var toCsv=require(_0x8630('0xd'));var querystring=require('querystring');var Papa=require(_0x8630('0xe'));var Redis=require('ioredis');var authService=require(_0x8630('0xf'));var qs=require(_0x8630('0x10'));var as=require(_0x8630('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8630('0x12'))(_0x8630('0x13'));var utils=require(_0x8630('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8630('0x15'));var db=require(_0x8630('0x16'))['db'];function respondWithStatusCode(_0x5b6d75,_0x54073b){_0x54073b=_0x54073b||0xcc;return function(_0x303e3a){if(_0x303e3a){return _0x5b6d75[_0x8630('0x17')](_0x54073b);}return _0x5b6d75['status'](_0x54073b)[_0x8630('0x18')]();};}function respondWithResult(_0x4db686,_0xf31c17){_0xf31c17=_0xf31c17||0xc8;return function(_0x4cc542){if(_0x4cc542){return _0x4db686[_0x8630('0x19')](_0xf31c17)['json'](_0x4cc542);}};}function respondWithFilteredResult(_0x53f236,_0x29a42d){return function(_0x86c262){if(_0x86c262){var _0x49fce1=typeof _0x29a42d['offset']===_0x8630('0x1a')&&typeof _0x29a42d['limit']===_0x8630('0x1a');var _0x18a874=_0x86c262[_0x8630('0x1b')];var _0x20f462=_0x49fce1?0x0:_0x29a42d[_0x8630('0x1c')];var _0x1e9780=_0x49fce1?_0x86c262[_0x8630('0x1b')]:_0x29a42d[_0x8630('0x1c')]+_0x29a42d[_0x8630('0x1d')];var _0x5dd2e0;if(_0x1e9780>=_0x18a874){_0x1e9780=_0x18a874;_0x5dd2e0=0xc8;}else{_0x5dd2e0=0xce;}_0x53f236['status'](_0x5dd2e0);return _0x53f236[_0x8630('0x1e')](_0x8630('0x1f'),_0x20f462+'-'+_0x1e9780+'/'+_0x18a874)['json'](_0x86c262);}return null;};}function patchUpdates(_0x5cff5c){return function(_0x1325dc){try{jsonpatch[_0x8630('0x20')](_0x1325dc,_0x5cff5c,!![]);}catch(_0x1ac046){return BPromise['reject'](_0x1ac046);}return _0x1325dc['save']();};}function saveUpdates(_0xcc7454,_0x58c0b5){return function(_0x30fb4d){if(_0x30fb4d){return _0x30fb4d[_0x8630('0x21')](_0xcc7454)[_0x8630('0x22')](function(_0x469de3){return _0x469de3;});}return null;};}function removeEntity(_0x4c2851,_0x37c224){return function(_0xf24c11){if(_0xf24c11){return _0xf24c11[_0x8630('0x23')]()[_0x8630('0x22')](function(){_0x4c2851[_0x8630('0x19')](0xcc)[_0x8630('0x18')]();});}};}function handleEntityNotFound(_0x37b7aa,_0x5c0a22){return function(_0x5b2823){if(!_0x5b2823){_0x37b7aa[_0x8630('0x17')](0x194);}return _0x5b2823;};}function handleError(_0x41b79d,_0x439b33){_0x439b33=_0x439b33||0x1f4;return function(_0xf97e31){logger[_0x8630('0x24')](_0xf97e31[_0x8630('0x25')]);if(_0xf97e31[_0x8630('0x26')]){delete _0xf97e31[_0x8630('0x26')];}_0x41b79d[_0x8630('0x19')](_0x439b33)[_0x8630('0x27')](_0xf97e31);};}exports[_0x8630('0x28')]=function(_0x41f74c,_0xc18164){var _0x4285ee={},_0xbb1a58={},_0x190216={'count':0x0,'rows':[]};var _0x2d3f0b=_['map'](db[_0x8630('0x29')][_0x8630('0x2a')],function(_0x24d85d){return{'name':_0x24d85d[_0x8630('0x2b')],'type':_0x24d85d['type'][_0x8630('0x2c')]};});_0xbb1a58[_0x8630('0x2d')]=_[_0x8630('0x2e')](_0x2d3f0b,_0x8630('0x26'));_0xbb1a58[_0x8630('0x2f')]=_[_0x8630('0x30')](_0x41f74c['query']);_0xbb1a58[_0x8630('0x31')]=_[_0x8630('0x32')](_0xbb1a58[_0x8630('0x2d')],_0xbb1a58['query']);_0x4285ee[_0x8630('0x33')]=_[_0x8630('0x32')](_0xbb1a58[_0x8630('0x2d')],qs[_0x8630('0x34')](_0x41f74c[_0x8630('0x2f')][_0x8630('0x34')]));_0x4285ee['attributes']=_0x4285ee[_0x8630('0x33')][_0x8630('0x35')]?_0x4285ee[_0x8630('0x33')]:_0xbb1a58[_0x8630('0x2d')];if(!_0x41f74c[_0x8630('0x2f')][_0x8630('0x36')](_0x8630('0x37'))){_0x4285ee[_0x8630('0x1d')]=qs[_0x8630('0x1d')](_0x41f74c[_0x8630('0x2f')][_0x8630('0x1d')]);_0x4285ee[_0x8630('0x1c')]=qs[_0x8630('0x1c')](_0x41f74c[_0x8630('0x2f')][_0x8630('0x1c')]);}_0x4285ee[_0x8630('0x38')]=qs[_0x8630('0x39')](_0x41f74c['query'][_0x8630('0x39')]);_0x4285ee[_0x8630('0x3a')]=qs['filters'](_['pick'](_0x41f74c[_0x8630('0x2f')],_0xbb1a58[_0x8630('0x31')]),_0x2d3f0b);if(_0x41f74c[_0x8630('0x2f')][_0x8630('0x3b')]){_0x4285ee[_0x8630('0x3a')]=_['merge'](_0x4285ee[_0x8630('0x3a')],{'$or':_[_0x8630('0x2e')](_0x2d3f0b,function(_0x38ee10){if(_0x38ee10[_0x8630('0x3c')]!=='VIRTUAL'){var _0xac2876={};_0xac2876[_0x38ee10[_0x8630('0x26')]]={'$like':'%'+_0x41f74c[_0x8630('0x2f')][_0x8630('0x3b')]+'%'};return _0xac2876;}})});}_0x4285ee=_[_0x8630('0x3d')]({},_0x4285ee,_0x41f74c[_0x8630('0x3e')]);var _0x2fbb8c={'where':_0x4285ee['where']};return db[_0x8630('0x29')][_0x8630('0x1b')](_0x2fbb8c)[_0x8630('0x22')](function(_0xe3f392){_0x190216[_0x8630('0x1b')]=_0xe3f392;if(_0x41f74c[_0x8630('0x2f')][_0x8630('0x3f')]){_0x4285ee[_0x8630('0x40')]=[{'all':!![]}];}return db[_0x8630('0x29')][_0x8630('0x41')](_0x4285ee);})['then'](function(_0x358431){_0x190216['rows']=_0x358431;return _0x190216;})[_0x8630('0x22')](respondWithFilteredResult(_0xc18164,_0x4285ee))[_0x8630('0x42')](handleError(_0xc18164,null));};exports[_0x8630('0x43')]=function(_0x7c3dc5,_0x193bae){var _0x2f1fec={'raw':!![],'where':{'id':_0x7c3dc5[_0x8630('0x44')]['id']}},_0x5bcf39={};_0x5bcf39[_0x8630('0x2d')]=_[_0x8630('0x30')](db['FreshdeskField'][_0x8630('0x2a')]);_0x5bcf39[_0x8630('0x2f')]=_[_0x8630('0x30')](_0x7c3dc5[_0x8630('0x2f')]);_0x5bcf39[_0x8630('0x31')]=_[_0x8630('0x32')](_0x5bcf39['model'],_0x5bcf39[_0x8630('0x2f')]);_0x2f1fec[_0x8630('0x33')]=_[_0x8630('0x32')](_0x5bcf39['model'],qs[_0x8630('0x34')](_0x7c3dc5[_0x8630('0x2f')]['fields']));_0x2f1fec[_0x8630('0x33')]=_0x2f1fec[_0x8630('0x33')][_0x8630('0x35')]?_0x2f1fec['attributes']:_0x5bcf39['model'];if(_0x7c3dc5[_0x8630('0x2f')]['includeAll']){_0x2f1fec['include']=[{'all':!![]}];}_0x2f1fec=_[_0x8630('0x3d')]({},_0x2f1fec,_0x7c3dc5['options']);return db[_0x8630('0x29')][_0x8630('0x45')](_0x2f1fec)['then'](handleEntityNotFound(_0x193bae,null))[_0x8630('0x22')](respondWithResult(_0x193bae,null))[_0x8630('0x42')](handleError(_0x193bae,null));};exports[_0x8630('0x46')]=function(_0x5d8149,_0x121e83){return db['FreshdeskField'][_0x8630('0x46')](_0x5d8149[_0x8630('0x47')],{})['then'](respondWithResult(_0x121e83,0xc9))[_0x8630('0x42')](handleError(_0x121e83,null));};exports[_0x8630('0x21')]=function(_0x3ff20b,_0x47aa03){if(_0x3ff20b[_0x8630('0x47')]['id']){delete _0x3ff20b[_0x8630('0x47')]['id'];}return db[_0x8630('0x29')][_0x8630('0x45')]({'where':{'id':_0x3ff20b[_0x8630('0x44')]['id']}})[_0x8630('0x22')](handleEntityNotFound(_0x47aa03,null))[_0x8630('0x22')](saveUpdates(_0x3ff20b[_0x8630('0x47')],null))[_0x8630('0x22')](respondWithResult(_0x47aa03,null))['catch'](handleError(_0x47aa03,null));};exports['destroy']=function(_0x1b8328,_0x13326d){return db[_0x8630('0x29')][_0x8630('0x45')]({'where':{'id':_0x1b8328[_0x8630('0x44')]['id']}})[_0x8630('0x22')](handleEntityNotFound(_0x13326d,null))[_0x8630('0x22')](removeEntity(_0x13326d,null))['catch'](handleError(_0x13326d,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index bddfe89..bdbe710 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 _0x5577=['FieldId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x5577,0x1b4));var _0x7557=function(_0x1746b2,_0xd67560){_0x1746b2=_0x1746b2-0x0;var _0x5047bb=_0x5577[_0x1746b2];return _0x5047bb;};'use strict';var _=require(_0x7557('0x0'));var util=require('util');var logger=require(_0x7557('0x1'))(_0x7557('0x2'));var moment=require('moment');var BPromise=require(_0x7557('0x3'));var rp=require(_0x7557('0x4'));var fs=require('fs');var path=require(_0x7557('0x5'));var rimraf=require(_0x7557('0x6'));var config=require(_0x7557('0x7'));var attributes=require(_0x7557('0x8'));module['exports']=function(_0x7bb8c,_0x41a4a5){return _0x7bb8c[_0x7557('0x9')](_0x7557('0xa'),attributes,{'tableName':_0x7557('0xb'),'paranoid':![],'indexes':[{'name':_0x7557('0xc'),'fields':[_0x7557('0xd'),_0x7557('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7aa2=['./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x183256,_0x1a596d){var _0x5394a2=function(_0x192025){while(--_0x192025){_0x183256['push'](_0x183256['shift']());}};_0x5394a2(++_0x1a596d);}(_0x7aa2,0x132));var _0x27aa=function(_0x487a0b,_0x33c302){_0x487a0b=_0x487a0b-0x0;var _0x4cb1ba=_0x7aa2[_0x487a0b];return _0x4cb1ba;};'use strict';var _=require(_0x27aa('0x0'));var util=require(_0x27aa('0x1'));var logger=require(_0x27aa('0x2'))(_0x27aa('0x3'));var moment=require(_0x27aa('0x4'));var BPromise=require(_0x27aa('0x5'));var rp=require(_0x27aa('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x27aa('0x7'));var config=require(_0x27aa('0x8'));var attributes=require(_0x27aa('0x9'));module['exports']=function(_0x2eb905,_0x29fcb7){return _0x2eb905[_0x27aa('0xa')](_0x27aa('0xb'),attributes,{'tableName':_0x27aa('0xc'),'paranoid':![],'indexes':[{'name':_0x27aa('0xd'),'fields':['idField',_0x27aa('0xe')],'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 d63a0c1..ae9e713 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 _0x860f=['error','code','message','info','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s'];(function(_0x2f2d88,_0x32815c){var _0x4742ee=function(_0x19b8ba){while(--_0x19b8ba){_0x2f2d88['push'](_0x2f2d88['shift']());}};_0x4742ee(++_0x32815c);}(_0x860f,0x1a8));var _0xf860=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x860f[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0xf860('0x0'));var util=require(_0xf860('0x1'));var moment=require(_0xf860('0x2'));var BPromise=require(_0xf860('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf860('0x4'))['db'];var utils=require(_0xf860('0x5'));var logger=require(_0xf860('0x6'))('rpc');var config=require(_0xf860('0x7'));var jayson=require(_0xf860('0x8'));var client=jayson[_0xf860('0x9')][_0xf860('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x446c39,_0x9e7e82,_0x271b38){return new BPromise(function(_0x19b09b,_0x3fa036){return client['request'](_0x446c39,_0x271b38)[_0xf860('0xb')](function(_0x5b6b0a){logger['info'](_0xf860('0xc'),_0x9e7e82,_0xf860('0xd'));logger[_0xf860('0xe')](_0xf860('0xf'),_0x9e7e82,'request\x20sent',JSON['stringify'](_0x5b6b0a));if(_0x5b6b0a['error']){if(_0x5b6b0a[_0xf860('0x10')][_0xf860('0x11')]===0x1f4){logger[_0xf860('0x10')](_0xf860('0xc'),_0x9e7e82,_0x5b6b0a[_0xf860('0x10')][_0xf860('0x12')]);return _0x3fa036(_0x5b6b0a['error'][_0xf860('0x12')]);}logger[_0xf860('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x9e7e82,_0x5b6b0a[_0xf860('0x10')][_0xf860('0x12')]);return _0x19b09b(_0x5b6b0a['error']['message']);}else{logger[_0xf860('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x9e7e82,'request\x20sent');_0x19b09b(_0x5b6b0a['result'][_0xf860('0x12')]);}})['catch'](function(_0x1b21dc){logger[_0xf860('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x9e7e82,_0x1b21dc);_0x3fa036(_0x1b21dc);});});} \ No newline at end of file +var _0x2abd=['then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request'];(function(_0x57d725,_0x3cb1a4){var _0x4e927c=function(_0x46da0c){while(--_0x46da0c){_0x57d725['push'](_0x57d725['shift']());}};_0x4e927c(++_0x3cb1a4);}(_0x2abd,0x1d8));var _0xd2ab=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x2abd[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0xd2ab('0x0'));var util=require('util');var moment=require(_0xd2ab('0x1'));var BPromise=require(_0xd2ab('0x2'));var rs=require(_0xd2ab('0x3'));var fs=require('fs');var Redis=require(_0xd2ab('0x4'));var db=require(_0xd2ab('0x5'))['db'];var utils=require(_0xd2ab('0x6'));var logger=require(_0xd2ab('0x7'))(_0xd2ab('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd2ab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55a928,_0x4408af,_0x8bcfa0){return new BPromise(function(_0x5503c3,_0x25d079){return client[_0xd2ab('0xa')](_0x55a928,_0x8bcfa0)[_0xd2ab('0xb')](function(_0x2a4a51){logger[_0xd2ab('0xc')](_0xd2ab('0xd'),_0x4408af,'request\x20sent');logger['debug'](_0xd2ab('0xe'),_0x4408af,_0xd2ab('0xf'),JSON[_0xd2ab('0x10')](_0x2a4a51));if(_0x2a4a51[_0xd2ab('0x11')]){if(_0x2a4a51[_0xd2ab('0x11')][_0xd2ab('0x12')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x4408af,_0x2a4a51[_0xd2ab('0x11')][_0xd2ab('0x13')]);return _0x25d079(_0x2a4a51[_0xd2ab('0x11')][_0xd2ab('0x13')]);}logger['error'](_0xd2ab('0xd'),_0x4408af,_0x2a4a51[_0xd2ab('0x11')]['message']);return _0x5503c3(_0x2a4a51[_0xd2ab('0x11')]['message']);}else{logger[_0xd2ab('0xc')](_0xd2ab('0xd'),_0x4408af,_0xd2ab('0xf'));_0x5503c3(_0x2a4a51['result'][_0xd2ab('0x13')]);}})[_0xd2ab('0x14')](function(_0x1dd51c){logger[_0xd2ab('0x11')](_0xd2ab('0xd'),_0x4408af,_0x1dd51c);_0x25d079(_0x1dd51c);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 8a62ccf..e3a13d2 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(_0x5edddd,_0x55f252){var _0x269e2b=function(_0x2e3e14){while(--_0x2e3e14){_0x5edddd['push'](_0x5edddd['shift']());}};_0x269e2b(++_0x55f252);}(_0x750a,0x140));var _0xa750=function(_0x340e99,_0x1e36dd){_0x340e99=_0x340e99-0x0;var _0x51e082=_0x750a[_0x340e99];return _0x51e082;};'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 _0x34b7=['getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x34b7,0x196));var _0x734b=function(_0x23bc85,_0x19addc){_0x23bc85=_0x23bc85-0x0;var _0x177dfd=_0x34b7[_0x23bc85];return _0x177dfd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var fs_extra=require(_0x734b('0x4'));var auth=require(_0x734b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x734b('0x6'));router[_0x734b('0x7')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x9')]);router[_0x734b('0x7')](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xb')]);router[_0x734b('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x734b('0x7')]('/:id/fields',auth[_0x734b('0x8')](),controller[_0x734b('0xc')]);router[_0x734b('0xd')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0xe')]);router[_0x734b('0xd')](_0x734b('0xf'),auth[_0x734b('0x8')](),controller[_0x734b('0x10')]);router[_0x734b('0x11')](_0x734b('0xa'),auth[_0x734b('0x8')](),controller[_0x734b('0x12')]);router[_0x734b('0x13')]('/:id',auth[_0x734b('0x8')](),controller[_0x734b('0x14')]);module[_0x734b('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index bc267df..fd4573b 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 _0x0598=['exports','STRING','sequelize'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0x0598,0x92));var _0x8059=function(_0x3b7e78,_0x140c2b){_0x3b7e78=_0x3b7e78-0x0;var _0x37c6bb=_0x0598[_0x3b7e78];return _0x37c6bb;};'use strict';var Sequelize=require(_0x8059('0x0'));module[_0x8059('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8059('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x8059('0x2')]},'remoteUri':{'type':Sequelize[_0x8059('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x5b12=['STRING','sequelize','exports'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x5b12,0xa3));var _0x25b1=function(_0x143209,_0x4b24aa){_0x143209=_0x143209-0x0;var _0x314f24=_0x5b12[_0x143209];return _0x314f24;};'use strict';var Sequelize=require(_0x25b1('0x0'));module[_0x25b1('0x1')]={'name':{'type':Sequelize[_0x25b1('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x25b1('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x25b1('0x2')]},'remoteUri':{'type':Sequelize[_0x25b1('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x25b1('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 2732f01..428d051 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 _0xd8b6=['update','then','destroy','end','sendStatus','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','rows','catch','show','params','includeAll','include','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','hasOwnProperty','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','Subjects','username','remoteUri','slice','substring','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../components/integrations/configuration','offset','undefined','count','limit','status','set','Content-Range','json','apply','reject','save'];(function(_0x512976,_0x99c175){var _0x27e45c=function(_0x1378fe){while(--_0x1378fe){_0x512976['push'](_0x512976['shift']());}};_0x27e45c(++_0x99c175);}(_0xd8b6,0x17d));var _0x6d8b=function(_0x43dcdd,_0x564ac0){_0x43dcdd=_0x43dcdd-0x0;var _0x4247bc=_0xd8b6[_0x43dcdd];return _0x4247bc;};'use strict';var emlformat=require(_0x6d8b('0x0'));var rimraf=require(_0x6d8b('0x1'));var zipdir=require(_0x6d8b('0x2'));var jsonpatch=require(_0x6d8b('0x3'));var rp=require(_0x6d8b('0x4'));var moment=require(_0x6d8b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6d8b('0x6'));var util=require(_0x6d8b('0x7'));var path=require(_0x6d8b('0x8'));var sox=require(_0x6d8b('0x9'));var csv=require(_0x6d8b('0xa'));var ejs=require(_0x6d8b('0xb'));var fs=require('fs');var fs_extra=require(_0x6d8b('0xc'));var _=require('lodash');var squel=require(_0x6d8b('0xd'));var crypto=require(_0x6d8b('0xe'));var jsforce=require(_0x6d8b('0xf'));var deskjs=require(_0x6d8b('0x10'));var toCsv=require(_0x6d8b('0xa'));var querystring=require(_0x6d8b('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6d8b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6d8b('0x13'));var hardwareService=require(_0x6d8b('0x14'));var logger=require('../../config/logger')(_0x6d8b('0x15'));var utils=require(_0x6d8b('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x6d8b('0x17'));function respondWithStatusCode(_0x36c325,_0x20c783){_0x20c783=_0x20c783||0xcc;return function(_0x4ea7e9){if(_0x4ea7e9){return _0x36c325['sendStatus'](_0x20c783);}return _0x36c325['status'](_0x20c783)['end']();};}function respondWithResult(_0x5e7bbd,_0x231180){_0x231180=_0x231180||0xc8;return function(_0x58e8c0){if(_0x58e8c0){return _0x5e7bbd['status'](_0x231180)['json'](_0x58e8c0);}};}function respondWithFilteredResult(_0x11d545,_0x205f38){return function(_0xf7243){if(_0xf7243){var _0x207598=typeof _0x205f38[_0x6d8b('0x18')]===_0x6d8b('0x19')&&typeof _0x205f38['limit']===_0x6d8b('0x19');var _0x1dbcb4=_0xf7243[_0x6d8b('0x1a')];var _0x5e44e6=_0x207598?0x0:_0x205f38[_0x6d8b('0x18')];var _0xd2cff3=_0x207598?_0xf7243[_0x6d8b('0x1a')]:_0x205f38[_0x6d8b('0x18')]+_0x205f38[_0x6d8b('0x1b')];var _0x3c0295;if(_0xd2cff3>=_0x1dbcb4){_0xd2cff3=_0x1dbcb4;_0x3c0295=0xc8;}else{_0x3c0295=0xce;}_0x11d545[_0x6d8b('0x1c')](_0x3c0295);return _0x11d545[_0x6d8b('0x1d')](_0x6d8b('0x1e'),_0x5e44e6+'-'+_0xd2cff3+'/'+_0x1dbcb4)[_0x6d8b('0x1f')](_0xf7243);}return null;};}function patchUpdates(_0x1debea){return function(_0x970bff){try{jsonpatch[_0x6d8b('0x20')](_0x970bff,_0x1debea,!![]);}catch(_0x526b30){return BPromise[_0x6d8b('0x21')](_0x526b30);}return _0x970bff[_0x6d8b('0x22')]();};}function saveUpdates(_0x5b8c17,_0x506695){return function(_0x1e0f0c){if(_0x1e0f0c){return _0x1e0f0c[_0x6d8b('0x23')](_0x5b8c17)[_0x6d8b('0x24')](function(_0x54ed1e){return _0x54ed1e;});}return null;};}function removeEntity(_0x53d5e2,_0x1c86a0){return function(_0x18a8a8){if(_0x18a8a8){return _0x18a8a8[_0x6d8b('0x25')]()[_0x6d8b('0x24')](function(){_0x53d5e2[_0x6d8b('0x1c')](0xcc)[_0x6d8b('0x26')]();});}};}function handleEntityNotFound(_0x591dd8,_0xc8490){return function(_0x2a04c8){if(!_0x2a04c8){_0x591dd8[_0x6d8b('0x27')](0x194);}return _0x2a04c8;};}function handleError(_0x511470,_0x148d3f){_0x148d3f=_0x148d3f||0x1f4;return function(_0x2d7949){logger[_0x6d8b('0x28')](_0x2d7949[_0x6d8b('0x29')]);if(_0x2d7949[_0x6d8b('0x2a')]){delete _0x2d7949[_0x6d8b('0x2a')];}_0x511470[_0x6d8b('0x1c')](_0x148d3f)[_0x6d8b('0x2b')](_0x2d7949);};}exports[_0x6d8b('0x2c')]=function(_0x44c5b4,_0x4b0b85){var _0x1ba4ef={},_0x47f377={},_0x1c24d2={'count':0x0,'rows':[]};var _0x7399e2=_[_0x6d8b('0x2d')](db[_0x6d8b('0x2e')][_0x6d8b('0x2f')],function(_0x5c7df1){return{'name':_0x5c7df1[_0x6d8b('0x30')],'type':_0x5c7df1['type'][_0x6d8b('0x31')]};});_0x47f377[_0x6d8b('0x32')]=_[_0x6d8b('0x2d')](_0x7399e2,_0x6d8b('0x2a'));_0x47f377['query']=_[_0x6d8b('0x33')](_0x44c5b4[_0x6d8b('0x34')]);_0x47f377[_0x6d8b('0x35')]=_[_0x6d8b('0x36')](_0x47f377['model'],_0x47f377['query']);_0x1ba4ef[_0x6d8b('0x37')]=_[_0x6d8b('0x36')](_0x47f377[_0x6d8b('0x32')],qs[_0x6d8b('0x38')](_0x44c5b4['query'][_0x6d8b('0x38')]));_0x1ba4ef[_0x6d8b('0x37')]=_0x1ba4ef[_0x6d8b('0x37')][_0x6d8b('0x39')]?_0x1ba4ef[_0x6d8b('0x37')]:_0x47f377[_0x6d8b('0x32')];if(!_0x44c5b4['query']['hasOwnProperty'](_0x6d8b('0x3a'))){_0x1ba4ef[_0x6d8b('0x1b')]=qs[_0x6d8b('0x1b')](_0x44c5b4[_0x6d8b('0x34')][_0x6d8b('0x1b')]);_0x1ba4ef['offset']=qs['offset'](_0x44c5b4[_0x6d8b('0x34')][_0x6d8b('0x18')]);}_0x1ba4ef[_0x6d8b('0x3b')]=qs['sort'](_0x44c5b4[_0x6d8b('0x34')][_0x6d8b('0x3c')]);_0x1ba4ef[_0x6d8b('0x3d')]=qs[_0x6d8b('0x35')](_[_0x6d8b('0x3e')](_0x44c5b4[_0x6d8b('0x34')],_0x47f377[_0x6d8b('0x35')]),_0x7399e2);if(_0x44c5b4[_0x6d8b('0x34')][_0x6d8b('0x3f')]){_0x1ba4ef['where']=_['merge'](_0x1ba4ef[_0x6d8b('0x3d')],{'$or':_[_0x6d8b('0x2d')](_0x7399e2,function(_0x81c926){if(_0x81c926[_0x6d8b('0x40')]!==_0x6d8b('0x41')){var _0x3ca8db={};_0x3ca8db[_0x81c926[_0x6d8b('0x2a')]]={'$like':'%'+_0x44c5b4[_0x6d8b('0x34')][_0x6d8b('0x3f')]+'%'};return _0x3ca8db;}})});}_0x1ba4ef=_[_0x6d8b('0x42')]({},_0x1ba4ef,_0x44c5b4[_0x6d8b('0x43')]);var _0x550049={'where':_0x1ba4ef['where']};return db[_0x6d8b('0x2e')]['count'](_0x550049)[_0x6d8b('0x24')](function(_0x4d1295){_0x1c24d2['count']=_0x4d1295;if(_0x44c5b4[_0x6d8b('0x34')]['includeAll']){_0x1ba4ef['include']=[{'all':!![]}];}return db[_0x6d8b('0x2e')]['findAll'](_0x1ba4ef);})[_0x6d8b('0x24')](function(_0x44f956){_0x1c24d2[_0x6d8b('0x44')]=_0x44f956;return _0x1c24d2;})[_0x6d8b('0x24')](respondWithFilteredResult(_0x4b0b85,_0x1ba4ef))[_0x6d8b('0x45')](handleError(_0x4b0b85,null));};exports[_0x6d8b('0x46')]=function(_0x199cd5,_0x1d6471){var _0x1c3bef={'raw':![],'where':{'id':_0x199cd5[_0x6d8b('0x47')]['id']}},_0x1f914e={};_0x1f914e[_0x6d8b('0x32')]=_[_0x6d8b('0x33')](db[_0x6d8b('0x2e')][_0x6d8b('0x2f')]);_0x1f914e['query']=_[_0x6d8b('0x33')](_0x199cd5[_0x6d8b('0x34')]);_0x1f914e['filters']=_[_0x6d8b('0x36')](_0x1f914e[_0x6d8b('0x32')],_0x1f914e[_0x6d8b('0x34')]);_0x1c3bef[_0x6d8b('0x37')]=_[_0x6d8b('0x36')](_0x1f914e[_0x6d8b('0x32')],qs[_0x6d8b('0x38')](_0x199cd5[_0x6d8b('0x34')]['fields']));_0x1c3bef[_0x6d8b('0x37')]=_0x1c3bef['attributes'][_0x6d8b('0x39')]?_0x1c3bef['attributes']:_0x1f914e['model'];if(_0x199cd5['query'][_0x6d8b('0x48')]){_0x1c3bef[_0x6d8b('0x49')]=[{'all':!![]}];}_0x1c3bef=_[_0x6d8b('0x42')]({},_0x1c3bef,_0x199cd5[_0x6d8b('0x43')]);return db[_0x6d8b('0x2e')][_0x6d8b('0x4a')](_0x1c3bef)[_0x6d8b('0x24')](handleEntityNotFound(_0x1d6471,null))[_0x6d8b('0x24')](respondWithResult(_0x1d6471,null))[_0x6d8b('0x45')](handleError(_0x1d6471,null));};exports[_0x6d8b('0x4b')]=function(_0x5f105c,_0x4e6e9f){return db[_0x6d8b('0x2e')][_0x6d8b('0x4b')](_0x5f105c[_0x6d8b('0x4c')],{})['then'](respondWithResult(_0x4e6e9f,0xc9))[_0x6d8b('0x45')](handleError(_0x4e6e9f,null));};exports[_0x6d8b('0x23')]=function(_0x415487,_0x12d174){if(_0x415487['body']['id']){delete _0x415487[_0x6d8b('0x4c')]['id'];}return db[_0x6d8b('0x2e')][_0x6d8b('0x4a')]({'where':{'id':_0x415487['params']['id']}})[_0x6d8b('0x24')](handleEntityNotFound(_0x12d174,null))[_0x6d8b('0x24')](saveUpdates(_0x415487[_0x6d8b('0x4c')],null))['then'](respondWithResult(_0x12d174,null))[_0x6d8b('0x45')](handleError(_0x12d174,null));};exports['destroy']=function(_0x5e7f97,_0x267e30){return db[_0x6d8b('0x2e')][_0x6d8b('0x4a')]({'where':{'id':_0x5e7f97[_0x6d8b('0x47')]['id']}})[_0x6d8b('0x24')](handleEntityNotFound(_0x267e30,null))[_0x6d8b('0x24')](removeEntity(_0x267e30,null))[_0x6d8b('0x45')](handleError(_0x267e30,null));};exports[_0x6d8b('0x4d')]=function(_0x4e7f40,_0x3df744,_0x41a7b2){var _0x14d736={};var _0x1df61c={};var _0x5caafb;var _0x5d9a5b;return db[_0x6d8b('0x2e')][_0x6d8b('0x4e')]({'where':{'id':_0x4e7f40[_0x6d8b('0x47')]['id']}})[_0x6d8b('0x24')](handleEntityNotFound(_0x3df744,null))[_0x6d8b('0x24')](function(_0xc23801){if(_0xc23801){_0x5caafb=_0xc23801;_0x1df61c[_0x6d8b('0x32')]=_['keys'](db[_0x6d8b('0x4f')]['rawAttributes']);_0x1df61c[_0x6d8b('0x34')]=_[_0x6d8b('0x33')](_0x4e7f40['query']);_0x1df61c[_0x6d8b('0x35')]=_[_0x6d8b('0x36')](_0x1df61c[_0x6d8b('0x32')],_0x1df61c[_0x6d8b('0x34')]);_0x14d736['attributes']=_[_0x6d8b('0x36')](_0x1df61c[_0x6d8b('0x32')],qs[_0x6d8b('0x38')](_0x4e7f40[_0x6d8b('0x34')]['fields']));_0x14d736[_0x6d8b('0x37')]=_0x14d736[_0x6d8b('0x37')][_0x6d8b('0x39')]?_0x14d736[_0x6d8b('0x37')]:_0x1df61c['model'];_0x14d736[_0x6d8b('0x3b')]=qs[_0x6d8b('0x3c')](_0x4e7f40[_0x6d8b('0x34')][_0x6d8b('0x3c')]);_0x14d736[_0x6d8b('0x3d')]=qs[_0x6d8b('0x35')](_[_0x6d8b('0x3e')](_0x4e7f40[_0x6d8b('0x34')],_0x1df61c[_0x6d8b('0x35')]));if(_0x4e7f40[_0x6d8b('0x34')][_0x6d8b('0x3f')]){_0x14d736[_0x6d8b('0x3d')]=_[_0x6d8b('0x42')](_0x14d736[_0x6d8b('0x3d')],{'$or':_[_0x6d8b('0x2d')](_0x14d736[_0x6d8b('0x37')],function(_0x131ceb){var _0x20e5d0={};_0x20e5d0[_0x131ceb]={'$like':'%'+_0x4e7f40['query'][_0x6d8b('0x3f')]+'%'};return _0x20e5d0;})});}_0x14d736=_[_0x6d8b('0x42')]({},_0x14d736,_0x4e7f40[_0x6d8b('0x43')]);return _0x5caafb[_0x6d8b('0x4d')](_0x14d736);}})[_0x6d8b('0x24')](function(_0x9007a7){if(_0x9007a7){_0x5d9a5b=_0x9007a7[_0x6d8b('0x39')];if(!_0x4e7f40['query'][_0x6d8b('0x50')](_0x6d8b('0x3a'))){_0x14d736[_0x6d8b('0x1b')]=qs[_0x6d8b('0x1b')](_0x4e7f40[_0x6d8b('0x34')][_0x6d8b('0x1b')]);_0x14d736[_0x6d8b('0x18')]=qs[_0x6d8b('0x18')](_0x4e7f40[_0x6d8b('0x34')][_0x6d8b('0x18')]);}return _0x5caafb['getConfigurations'](_0x14d736);}})['then'](function(_0x43c7bd){if(_0x43c7bd){return _0x43c7bd?{'count':_0x5d9a5b,'rows':_0x43c7bd}:null;}})[_0x6d8b('0x24')](respondWithResult(_0x3df744,null))[_0x6d8b('0x45')](handleError(_0x3df744,null));};exports['addConfiguration']=function(_0x44a1ef,_0x29f2ca,_0x2d0141){if(_0x44a1ef[_0x6d8b('0x4c')]['id']){delete _0x44a1ef[_0x6d8b('0x4c')]['id'];}return db['FreshsalesAccount'][_0x6d8b('0x4e')]({'where':{'id':_0x44a1ef[_0x6d8b('0x47')]['id']}})[_0x6d8b('0x24')](handleEntityNotFound(_0x29f2ca,null))[_0x6d8b('0x24')](function(_0x1852c9){if(_0x1852c9){_0x44a1ef['body']['AccountId']=_0x1852c9['id'];_0x44a1ef['body']['Subjects']=integrations[_0x6d8b('0x51')](_0x44a1ef['body'][_0x6d8b('0x52')],_0x44a1ef[_0x6d8b('0x4c')][_0x6d8b('0x40')]);_0x44a1ef['body'][_0x6d8b('0x53')]=integrations[_0x6d8b('0x54')](_0x44a1ef[_0x6d8b('0x4c')][_0x6d8b('0x52')],_0x44a1ef[_0x6d8b('0x4c')]['type']);return db[_0x6d8b('0x4f')][_0x6d8b('0x4b')](_0x44a1ef['body'],{'include':[{'model':db[_0x6d8b('0x55')],'as':_0x6d8b('0x56')},{'model':db[_0x6d8b('0x55')],'as':_0x6d8b('0x53')}]});}return null;})[_0x6d8b('0x24')](respondWithResult(_0x29f2ca,null))['catch'](handleError(_0x29f2ca,null));};exports['getFields']=function(_0x1c0d83,_0x2ed155,_0x1a80dd){var _0x4843dd='';var _0x24bf17='';return db[_0x6d8b('0x2e')]['findOne']({'where':{'id':_0x1c0d83[_0x6d8b('0x47')]['id']},'attributes':['id',_0x6d8b('0x57'),'remoteUri','apiKey']})['then'](handleEntityNotFound(_0x2ed155,null))[_0x6d8b('0x24')](function(_0x481428){if(_0x481428){_0x24bf17=_0x481428[_0x6d8b('0x57')];_0x4843dd=_0x481428[_0x6d8b('0x58')];var _0x5e8fd2=_0x481428[_0x6d8b('0x58')][_0x6d8b('0x59')](-0x1);if(_0x5e8fd2==='/'){_0x4843dd=_0x4843dd[_0x6d8b('0x5a')](0x0,_0x4843dd['lastIndexOf'](_0x5e8fd2));}return rp({'method':_0x6d8b('0x5b'),'uri':util[_0x6d8b('0x5c')](_0x6d8b('0x5d'),_0x4843dd,_0x6d8b('0x5e')),'headers':{'Authorization':_0x6d8b('0x5f')+_0x481428['apiKey']},'json':!![]});}})['then'](function(_0x3e4ebf){if(_0x3e4ebf){var _0x1feb06=_0x3e4ebf[_0x6d8b('0x60')];var _0x4b06cd=![];var _0x56dc7b=null;for(_0x56dc7b=0x0;_0x56dc7b<_0x1feb06[_0x6d8b('0x39')];_0x56dc7b++){if(_0x1feb06[_0x56dc7b][_0x6d8b('0x61')]===_0x24bf17){_0x4b06cd=!![];}}if(_0x4b06cd){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x6d8b('0x62')});}}})[_0x6d8b('0x24')](respondWithResult(_0x2ed155,null))[_0x6d8b('0x45')](function(_0x29e1f4){var _0x19bcbe=_0x1c0d83[_0x6d8b('0x34')][_0x6d8b('0x63')]?0x1f4:_0x29e1f4[_0x6d8b('0x64')]||0x1f4;logger[_0x6d8b('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x6d8b('0x65'),_0x19bcbe,JSON[_0x6d8b('0x66')](_0x29e1f4));delete _0x29e1f4[_0x6d8b('0x2a')];if(_0x19bcbe===0x191){_0x19bcbe=0x190;}_0x2ed155[_0x6d8b('0x1c')](_0x19bcbe)[_0x6d8b('0x2b')](_0x1c0d83[_0x6d8b('0x34')]['test']?{'message':_0x6d8b('0x67'),'statusCode':_0x29e1f4[_0x6d8b('0x64')]}:_0x29e1f4);});}; \ No newline at end of file +var _0x6264=['desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','find','create','body','FreshsalesConfiguration','order','getConfigurations','addConfiguration','findOne','AccountId','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','email','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x525940,_0x29fbe9){var _0xfccf08=function(_0x133945){while(--_0x133945){_0x525940['push'](_0x525940['shift']());}};_0xfccf08(++_0x29fbe9);}(_0x6264,0x1e3));var _0x4626=function(_0x1f703a,_0x3031b7){_0x1f703a=_0x1f703a-0x0;var _0xd7b7e1=_0x6264[_0x1f703a];return _0xd7b7e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4626('0x0'));var zipdir=require(_0x4626('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4626('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4626('0x3'));var util=require(_0x4626('0x4'));var path=require(_0x4626('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4626('0x6'));var fs=require('fs');var fs_extra=require(_0x4626('0x7'));var _=require(_0x4626('0x8'));var squel=require(_0x4626('0x9'));var crypto=require(_0x4626('0xa'));var jsforce=require(_0x4626('0xb'));var deskjs=require(_0x4626('0xc'));var toCsv=require(_0x4626('0xd'));var querystring=require(_0x4626('0xe'));var Papa=require('papaparse');var Redis=require(_0x4626('0xf'));var authService=require(_0x4626('0x10'));var qs=require(_0x4626('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4626('0x12'));var utils=require('../../config/utils');var config=require(_0x4626('0x13'));var licenseUtil=require(_0x4626('0x14'));var db=require(_0x4626('0x15'))['db'];var integrations=require(_0x4626('0x16'));function respondWithStatusCode(_0xac373a,_0x2d12fc){_0x2d12fc=_0x2d12fc||0xcc;return function(_0x10f659){if(_0x10f659){return _0xac373a[_0x4626('0x17')](_0x2d12fc);}return _0xac373a[_0x4626('0x18')](_0x2d12fc)[_0x4626('0x19')]();};}function respondWithResult(_0x267116,_0x6faa53){_0x6faa53=_0x6faa53||0xc8;return function(_0x25d036){if(_0x25d036){return _0x267116[_0x4626('0x18')](_0x6faa53)['json'](_0x25d036);}};}function respondWithFilteredResult(_0x52147d,_0x1eeac9){return function(_0x546002){if(_0x546002){var _0xeb1159=typeof _0x1eeac9[_0x4626('0x1a')]===_0x4626('0x1b')&&typeof _0x1eeac9['limit']===_0x4626('0x1b');var _0x2ee232=_0x546002[_0x4626('0x1c')];var _0x50647f=_0xeb1159?0x0:_0x1eeac9['offset'];var _0xf20ccd=_0xeb1159?_0x546002[_0x4626('0x1c')]:_0x1eeac9[_0x4626('0x1a')]+_0x1eeac9['limit'];var _0x310c9e;if(_0xf20ccd>=_0x2ee232){_0xf20ccd=_0x2ee232;_0x310c9e=0xc8;}else{_0x310c9e=0xce;}_0x52147d[_0x4626('0x18')](_0x310c9e);return _0x52147d[_0x4626('0x1d')](_0x4626('0x1e'),_0x50647f+'-'+_0xf20ccd+'/'+_0x2ee232)[_0x4626('0x1f')](_0x546002);}return null;};}function patchUpdates(_0x10d7f2){return function(_0x37195f){try{jsonpatch[_0x4626('0x20')](_0x37195f,_0x10d7f2,!![]);}catch(_0x1b0f5c){return BPromise[_0x4626('0x21')](_0x1b0f5c);}return _0x37195f['save']();};}function saveUpdates(_0x5a893e,_0x3b5ff9){return function(_0x295bbf){if(_0x295bbf){return _0x295bbf[_0x4626('0x22')](_0x5a893e)['then'](function(_0x4ee398){return _0x4ee398;});}return null;};}function removeEntity(_0x3eea97,_0x531e5f){return function(_0x2d3e6d){if(_0x2d3e6d){return _0x2d3e6d[_0x4626('0x23')]()[_0x4626('0x24')](function(){_0x3eea97[_0x4626('0x18')](0xcc)[_0x4626('0x19')]();});}};}function handleEntityNotFound(_0x3c1127,_0x41fa5b){return function(_0x23ed18){if(!_0x23ed18){_0x3c1127[_0x4626('0x17')](0x194);}return _0x23ed18;};}function handleError(_0x3aaa98,_0x99d22e){_0x99d22e=_0x99d22e||0x1f4;return function(_0xb67987){logger[_0x4626('0x25')](_0xb67987['stack']);if(_0xb67987['name']){delete _0xb67987[_0x4626('0x26')];}_0x3aaa98[_0x4626('0x18')](_0x99d22e)[_0x4626('0x27')](_0xb67987);};}exports[_0x4626('0x28')]=function(_0x32d3f2,_0x1b8f1d){var _0x5e496f={},_0x5c6650={},_0x4ceb96={'count':0x0,'rows':[]};var _0x39ac84=_[_0x4626('0x29')](db[_0x4626('0x2a')][_0x4626('0x2b')],function(_0x430df9){return{'name':_0x430df9[_0x4626('0x2c')],'type':_0x430df9[_0x4626('0x2d')][_0x4626('0x2e')]};});_0x5c6650[_0x4626('0x2f')]=_[_0x4626('0x29')](_0x39ac84,_0x4626('0x26'));_0x5c6650[_0x4626('0x30')]=_[_0x4626('0x31')](_0x32d3f2['query']);_0x5c6650[_0x4626('0x32')]=_[_0x4626('0x33')](_0x5c6650[_0x4626('0x2f')],_0x5c6650[_0x4626('0x30')]);_0x5e496f[_0x4626('0x34')]=_[_0x4626('0x33')](_0x5c6650[_0x4626('0x2f')],qs[_0x4626('0x35')](_0x32d3f2['query']['fields']));_0x5e496f[_0x4626('0x34')]=_0x5e496f[_0x4626('0x34')][_0x4626('0x36')]?_0x5e496f[_0x4626('0x34')]:_0x5c6650['model'];if(!_0x32d3f2[_0x4626('0x30')]['hasOwnProperty'](_0x4626('0x37'))){_0x5e496f['limit']=qs[_0x4626('0x38')](_0x32d3f2[_0x4626('0x30')][_0x4626('0x38')]);_0x5e496f[_0x4626('0x1a')]=qs[_0x4626('0x1a')](_0x32d3f2[_0x4626('0x30')]['offset']);}_0x5e496f['order']=qs['sort'](_0x32d3f2['query'][_0x4626('0x39')]);_0x5e496f[_0x4626('0x3a')]=qs['filters'](_[_0x4626('0x3b')](_0x32d3f2['query'],_0x5c6650[_0x4626('0x32')]),_0x39ac84);if(_0x32d3f2[_0x4626('0x30')][_0x4626('0x3c')]){_0x5e496f[_0x4626('0x3a')]=_[_0x4626('0x3d')](_0x5e496f[_0x4626('0x3a')],{'$or':_[_0x4626('0x29')](_0x39ac84,function(_0x50b904){if(_0x50b904[_0x4626('0x2d')]!=='VIRTUAL'){var _0x49490c={};_0x49490c[_0x50b904[_0x4626('0x26')]]={'$like':'%'+_0x32d3f2[_0x4626('0x30')]['filter']+'%'};return _0x49490c;}})});}_0x5e496f=_[_0x4626('0x3d')]({},_0x5e496f,_0x32d3f2[_0x4626('0x3e')]);var _0x1650b9={'where':_0x5e496f[_0x4626('0x3a')]};return db[_0x4626('0x2a')][_0x4626('0x1c')](_0x1650b9)['then'](function(_0x51fac2){_0x4ceb96[_0x4626('0x1c')]=_0x51fac2;if(_0x32d3f2[_0x4626('0x30')]['includeAll']){_0x5e496f[_0x4626('0x3f')]=[{'all':!![]}];}return db[_0x4626('0x2a')][_0x4626('0x40')](_0x5e496f);})['then'](function(_0x500aad){_0x4ceb96[_0x4626('0x41')]=_0x500aad;return _0x4ceb96;})['then'](respondWithFilteredResult(_0x1b8f1d,_0x5e496f))[_0x4626('0x42')](handleError(_0x1b8f1d,null));};exports[_0x4626('0x43')]=function(_0x48eef1,_0x3c86e7){var _0x20ea00={'raw':![],'where':{'id':_0x48eef1[_0x4626('0x44')]['id']}},_0x4ea95a={};_0x4ea95a['model']=_['keys'](db[_0x4626('0x2a')][_0x4626('0x2b')]);_0x4ea95a[_0x4626('0x30')]=_[_0x4626('0x31')](_0x48eef1[_0x4626('0x30')]);_0x4ea95a[_0x4626('0x32')]=_[_0x4626('0x33')](_0x4ea95a[_0x4626('0x2f')],_0x4ea95a['query']);_0x20ea00['attributes']=_[_0x4626('0x33')](_0x4ea95a[_0x4626('0x2f')],qs['fields'](_0x48eef1['query'][_0x4626('0x35')]));_0x20ea00['attributes']=_0x20ea00['attributes'][_0x4626('0x36')]?_0x20ea00['attributes']:_0x4ea95a[_0x4626('0x2f')];if(_0x48eef1[_0x4626('0x30')]['includeAll']){_0x20ea00['include']=[{'all':!![]}];}_0x20ea00=_[_0x4626('0x3d')]({},_0x20ea00,_0x48eef1[_0x4626('0x3e')]);return db[_0x4626('0x2a')][_0x4626('0x45')](_0x20ea00)[_0x4626('0x24')](handleEntityNotFound(_0x3c86e7,null))[_0x4626('0x24')](respondWithResult(_0x3c86e7,null))[_0x4626('0x42')](handleError(_0x3c86e7,null));};exports['create']=function(_0x480333,_0x1f2510){return db[_0x4626('0x2a')][_0x4626('0x46')](_0x480333[_0x4626('0x47')],{})['then'](respondWithResult(_0x1f2510,0xc9))['catch'](handleError(_0x1f2510,null));};exports[_0x4626('0x22')]=function(_0x572ad7,_0x36f21e){if(_0x572ad7[_0x4626('0x47')]['id']){delete _0x572ad7[_0x4626('0x47')]['id'];}return db[_0x4626('0x2a')]['find']({'where':{'id':_0x572ad7[_0x4626('0x44')]['id']}})[_0x4626('0x24')](handleEntityNotFound(_0x36f21e,null))[_0x4626('0x24')](saveUpdates(_0x572ad7[_0x4626('0x47')],null))['then'](respondWithResult(_0x36f21e,null))[_0x4626('0x42')](handleError(_0x36f21e,null));};exports[_0x4626('0x23')]=function(_0x27c77a,_0x2b462d){return db['FreshsalesAccount'][_0x4626('0x45')]({'where':{'id':_0x27c77a['params']['id']}})['then'](handleEntityNotFound(_0x2b462d,null))['then'](removeEntity(_0x2b462d,null))[_0x4626('0x42')](handleError(_0x2b462d,null));};exports['getConfigurations']=function(_0x534f68,_0x249820,_0x26f23e){var _0x2f1436={};var _0xf68972={};var _0x5e7c6d;var _0x4e157d;return db[_0x4626('0x2a')]['findOne']({'where':{'id':_0x534f68[_0x4626('0x44')]['id']}})['then'](handleEntityNotFound(_0x249820,null))[_0x4626('0x24')](function(_0x105c30){if(_0x105c30){_0x5e7c6d=_0x105c30;_0xf68972[_0x4626('0x2f')]=_[_0x4626('0x31')](db[_0x4626('0x48')]['rawAttributes']);_0xf68972[_0x4626('0x30')]=_[_0x4626('0x31')](_0x534f68[_0x4626('0x30')]);_0xf68972[_0x4626('0x32')]=_['intersection'](_0xf68972[_0x4626('0x2f')],_0xf68972['query']);_0x2f1436[_0x4626('0x34')]=_['intersection'](_0xf68972[_0x4626('0x2f')],qs[_0x4626('0x35')](_0x534f68['query'][_0x4626('0x35')]));_0x2f1436[_0x4626('0x34')]=_0x2f1436[_0x4626('0x34')][_0x4626('0x36')]?_0x2f1436[_0x4626('0x34')]:_0xf68972[_0x4626('0x2f')];_0x2f1436[_0x4626('0x49')]=qs[_0x4626('0x39')](_0x534f68[_0x4626('0x30')][_0x4626('0x39')]);_0x2f1436[_0x4626('0x3a')]=qs['filters'](_[_0x4626('0x3b')](_0x534f68[_0x4626('0x30')],_0xf68972[_0x4626('0x32')]));if(_0x534f68[_0x4626('0x30')]['filter']){_0x2f1436['where']=_[_0x4626('0x3d')](_0x2f1436[_0x4626('0x3a')],{'$or':_[_0x4626('0x29')](_0x2f1436[_0x4626('0x34')],function(_0x17edd0){var _0x5b8ce8={};_0x5b8ce8[_0x17edd0]={'$like':'%'+_0x534f68[_0x4626('0x30')][_0x4626('0x3c')]+'%'};return _0x5b8ce8;})});}_0x2f1436=_[_0x4626('0x3d')]({},_0x2f1436,_0x534f68['options']);return _0x5e7c6d['getConfigurations'](_0x2f1436);}})['then'](function(_0x5b446d){if(_0x5b446d){_0x4e157d=_0x5b446d[_0x4626('0x36')];if(!_0x534f68[_0x4626('0x30')]['hasOwnProperty']('nolimit')){_0x2f1436['limit']=qs[_0x4626('0x38')](_0x534f68[_0x4626('0x30')][_0x4626('0x38')]);_0x2f1436[_0x4626('0x1a')]=qs[_0x4626('0x1a')](_0x534f68[_0x4626('0x30')][_0x4626('0x1a')]);}return _0x5e7c6d[_0x4626('0x4a')](_0x2f1436);}})['then'](function(_0xb638e1){if(_0xb638e1){return _0xb638e1?{'count':_0x4e157d,'rows':_0xb638e1}:null;}})['then'](respondWithResult(_0x249820,null))[_0x4626('0x42')](handleError(_0x249820,null));};exports[_0x4626('0x4b')]=function(_0x4764ac,_0xf0e266,_0x28e9fd){if(_0x4764ac[_0x4626('0x47')]['id']){delete _0x4764ac[_0x4626('0x47')]['id'];}return db[_0x4626('0x2a')][_0x4626('0x4c')]({'where':{'id':_0x4764ac[_0x4626('0x44')]['id']}})[_0x4626('0x24')](handleEntityNotFound(_0xf0e266,null))[_0x4626('0x24')](function(_0x2859f8){if(_0x2859f8){_0x4764ac[_0x4626('0x47')][_0x4626('0x4d')]=_0x2859f8['id'];_0x4764ac[_0x4626('0x47')]['Subjects']=integrations[_0x4626('0x4e')](_0x4764ac['body']['channel'],_0x4764ac[_0x4626('0x47')][_0x4626('0x2d')]);_0x4764ac[_0x4626('0x47')][_0x4626('0x4f')]=integrations[_0x4626('0x50')](_0x4764ac[_0x4626('0x47')][_0x4626('0x51')],_0x4764ac[_0x4626('0x47')][_0x4626('0x2d')]);return db[_0x4626('0x48')][_0x4626('0x46')](_0x4764ac[_0x4626('0x47')],{'include':[{'model':db[_0x4626('0x52')],'as':'Subjects'},{'model':db[_0x4626('0x52')],'as':'Descriptions'}]});}return null;})[_0x4626('0x24')](respondWithResult(_0xf0e266,null))[_0x4626('0x42')](handleError(_0xf0e266,null));};exports[_0x4626('0x53')]=function(_0x1d1686,_0x182f59,_0x84492a){var _0x53e2de='';var _0x258e17='';return db['FreshsalesAccount'][_0x4626('0x4c')]({'where':{'id':_0x1d1686[_0x4626('0x44')]['id']},'attributes':['id','username',_0x4626('0x54'),_0x4626('0x55')]})['then'](handleEntityNotFound(_0x182f59,null))[_0x4626('0x24')](function(_0x418df1){if(_0x418df1){_0x258e17=_0x418df1['username'];_0x53e2de=_0x418df1[_0x4626('0x54')];var _0x2108ac=_0x418df1['remoteUri'][_0x4626('0x56')](-0x1);if(_0x2108ac==='/'){_0x53e2de=_0x53e2de[_0x4626('0x57')](0x0,_0x53e2de[_0x4626('0x58')](_0x2108ac));}return rp({'method':_0x4626('0x59'),'uri':util['format'](_0x4626('0x5a'),_0x53e2de,_0x4626('0x5b')),'headers':{'Authorization':_0x4626('0x5c')+_0x418df1[_0x4626('0x55')]},'json':!![]});}})['then'](function(_0xd88bf0){if(_0xd88bf0){var _0xae231e=_0xd88bf0['users'];var _0x4d1086=![];var _0x255294=null;for(_0x255294=0x0;_0x255294<_0xae231e[_0x4626('0x36')];_0x255294++){if(_0xae231e[_0x255294][_0x4626('0x5d')]===_0x258e17){_0x4d1086=!![];}}if(_0x4d1086){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x4626('0x24')](respondWithResult(_0x182f59,null))[_0x4626('0x42')](function(_0x32d066){var _0x18e3da=_0x1d1686[_0x4626('0x30')][_0x4626('0x5e')]?0x1f4:_0x32d066['statusCode']||0x1f4;logger[_0x4626('0x25')](_0x4626('0x5f'),_0x4626('0x53'),_0x18e3da,JSON[_0x4626('0x60')](_0x32d066));delete _0x32d066[_0x4626('0x26')];if(_0x18e3da===0x191){_0x18e3da=0x190;}_0x182f59[_0x4626('0x18')](_0x18e3da)['send'](_0x1d1686['query']['test']?{'message':_0x4626('0x61'),'statusCode':_0x32d066[_0x4626('0x62')]}:_0x32d066);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index dec458d..0df866f 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 _0x430c=['define','FreshsalesAccount','int_freshsales_accounts','lodash','api','moment','bluebird','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x104893,_0xa42017){var _0x1c2dab=function(_0x2a2ae6){while(--_0x2a2ae6){_0x104893['push'](_0x104893['shift']());}};_0x1c2dab(++_0xa42017);}(_0x430c,0x1a1));var _0xc430=function(_0x5de214,_0x107e9d){_0x5de214=_0x5de214-0x0;var _0x4df627=_0x430c[_0x5de214];return _0x4df627;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc430('0x1'));var moment=require(_0xc430('0x2'));var BPromise=require(_0xc430('0x3'));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(_0xc430('0x4'));var integrations=require(_0xc430('0x5'));module['exports']=function(_0x42aa9c,_0x4de44f){return _0x42aa9c[_0xc430('0x6')](_0xc430('0x7'),attributes,{'tableName':_0xc430('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4137=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','lodash','util','../../config/logger','api'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4137,0xf8));var _0x7413=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x4137[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var logger=require(_0x7413('0x2'))(_0x7413('0x3'));var moment=require(_0x7413('0x4'));var BPromise=require(_0x7413('0x5'));var rp=require(_0x7413('0x6'));var fs=require('fs');var path=require(_0x7413('0x7'));var rimraf=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var attributes=require(_0x7413('0xa'));var integrations=require(_0x7413('0xb'));module['exports']=function(_0xc808cd,_0x188d89){return _0xc808cd[_0x7413('0xc')](_0x7413('0xd'),attributes,{'tableName':'int_freshsales_accounts','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 1d1b494..9d74ee0 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 _0x33af=['include','map','model','ShowFreshsalesAccount','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x33af,0xec));var _0xf33a=function(_0x346645,_0x3e9d9c){_0x346645=_0x346645-0x0;var _0x32f590=_0x33af[_0x346645];return _0x32f590;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var moment=require('moment');var BPromise=require(_0xf33a('0x1'));var rs=require(_0xf33a('0x2'));var fs=require('fs');var Redis=require(_0xf33a('0x3'));var db=require(_0xf33a('0x4'))['db'];var utils=require(_0xf33a('0x5'));var logger=require(_0xf33a('0x6'))('rpc');var config=require(_0xf33a('0x7'));var jayson=require(_0xf33a('0x8'));var client=jayson['client'][_0xf33a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x384b14,_0x1b2b01,_0x2f3730){return new BPromise(function(_0x2baabb,_0x2cb169){return client['request'](_0x384b14,_0x2f3730)[_0xf33a('0xa')](function(_0x14eb0e){logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,_0xf33a('0xd'));logger[_0xf33a('0xe')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x1b2b01,'request\x20sent',JSON[_0xf33a('0xf')](_0x14eb0e));if(_0x14eb0e[_0xf33a('0x10')]){if(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x11')]===0x1f4){logger[_0xf33a('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2cb169(_0x14eb0e['error']['message']);}logger[_0xf33a('0x10')](_0xf33a('0xc'),_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2baabb(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);}else{logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,'request\x20sent');_0x2baabb(_0x14eb0e[_0xf33a('0x13')]['message']);}})[_0xf33a('0x14')](function(_0x229389){logger['error'](_0xf33a('0xc'),_0x1b2b01,_0x229389);_0x2cb169(_0x229389);});});}exports[_0xf33a('0x15')]=function(_0x524109){var _0x2946ef=this;return new Promise(function(_0x23d9e2,_0x38d69a){return db[_0xf33a('0x16')]['findAll']({'raw':_0x524109[_0xf33a('0x17')]?_0x524109[_0xf33a('0x17')][_0xf33a('0x18')]===undefined?!![]:![]:!![],'where':_0x524109[_0xf33a('0x17')]?_0x524109[_0xf33a('0x17')][_0xf33a('0x19')]||null:null,'attributes':_0x524109[_0xf33a('0x17')]?_0x524109[_0xf33a('0x17')][_0xf33a('0x1a')]||null:null,'limit':_0x524109[_0xf33a('0x17')]?_0x524109['options'][_0xf33a('0x1b')]||null:null,'include':_0x524109[_0xf33a('0x17')]?_0x524109[_0xf33a('0x17')][_0xf33a('0x1c')]?_[_0xf33a('0x1d')](_0x524109['options'][_0xf33a('0x1c')],function(_0x5882ba){return{'model':db[_0x5882ba[_0xf33a('0x1e')]],'as':_0x5882ba['as'],'attributes':_0x5882ba[_0xf33a('0x1a')],'include':_0x5882ba[_0xf33a('0x1c')]?_[_0xf33a('0x1d')](_0x5882ba[_0xf33a('0x1c')],function(_0x4b9801){return{'model':db[_0x4b9801[_0xf33a('0x1e')]],'as':_0x4b9801['as'],'attributes':_0x4b9801[_0xf33a('0x1a')],'include':_0x4b9801['include']?_['map'](_0x4b9801[_0xf33a('0x1c')],function(_0x5f0a53){return{'model':db[_0x5f0a53['model']],'as':_0x5f0a53['as'],'attributes':_0x5f0a53[_0xf33a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x79d653){logger['info'](_0xf33a('0x15'),_0x524109);logger[_0xf33a('0xe')](_0xf33a('0x15'),_0x524109,JSON[_0xf33a('0xf')](_0x79d653));_0x23d9e2(_0x79d653);})[_0xf33a('0x14')](function(_0x3068a9){logger[_0xf33a('0x10')](_0xf33a('0x15'),_0x3068a9[_0xf33a('0x12')],_0x524109);_0x38d69a(_0x2946ef[_0xf33a('0x10')](0x1f4,_0x3068a9[_0xf33a('0x12')]));});});};exports[_0xf33a('0x1f')]=function(_0x22c9f2){var _0x3f714e=this;return new Promise(function(_0x2fd098,_0x5eb14a){return db[_0xf33a('0x16')][_0xf33a('0x20')]({'raw':_0x22c9f2[_0xf33a('0x17')]?_0x22c9f2[_0xf33a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x22c9f2[_0xf33a('0x17')]?_0x22c9f2[_0xf33a('0x17')][_0xf33a('0x19')]||null:null,'attributes':_0x22c9f2[_0xf33a('0x17')]?_0x22c9f2[_0xf33a('0x17')][_0xf33a('0x1a')]||null:null,'include':_0x22c9f2['options']?_0x22c9f2[_0xf33a('0x17')][_0xf33a('0x1c')]?_[_0xf33a('0x1d')](_0x22c9f2[_0xf33a('0x17')][_0xf33a('0x1c')],function(_0x57e7be){return{'model':db[_0x57e7be['model']],'as':_0x57e7be['as'],'attributes':_0x57e7be[_0xf33a('0x1a')],'include':_0x57e7be['include']?_['map'](_0x57e7be['include'],function(_0x2c4840){return{'model':db[_0x2c4840[_0xf33a('0x1e')]],'as':_0x2c4840['as'],'attributes':_0x2c4840['attributes'],'include':_0x2c4840[_0xf33a('0x1c')]?_['map'](_0x2c4840[_0xf33a('0x1c')],function(_0x1f11b3){return{'model':db[_0x1f11b3[_0xf33a('0x1e')]],'as':_0x1f11b3['as'],'attributes':_0x1f11b3[_0xf33a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf33a('0xa')](function(_0x23c92b){logger['info'](_0xf33a('0x1f'),_0x22c9f2);logger[_0xf33a('0xe')]('ShowFreshsalesAccount',_0x22c9f2,JSON[_0xf33a('0xf')](_0x23c92b));_0x2fd098(_0x23c92b);})[_0xf33a('0x14')](function(_0x3e0a98){logger['error'](_0xf33a('0x1f'),_0x3e0a98[_0xf33a('0x12')],_0x22c9f2);_0x5eb14a(_0x3f714e[_0xf33a('0x10')](0x1f4,_0x3e0a98[_0xf33a('0x12')]));});});}; \ No newline at end of file +var _0x1261=['FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFreshsalesAccount','options','raw','limit','include','map','model','attributes','stringify','ShowFreshsalesAccount','FreshsalesAccount','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x1c96ca,_0x928f86){var _0x514090=function(_0x87d2d4){while(--_0x87d2d4){_0x1c96ca['push'](_0x1c96ca['shift']());}};_0x514090(++_0x928f86);}(_0x1261,0x144));var _0x1126=function(_0x5d917c,_0x7846a){_0x5d917c=_0x5d917c-0x0;var _0x4e850f=_0x1261[_0x5d917c];return _0x4e850f;};'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')]('FreshsalesAccount,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['FreshsalesAccount']['findAll']({'raw':_0x4a7b49[_0x1126('0x16')]?_0x4a7b49['options'][_0x1126('0x17')]===undefined?!![]:![]:!![],'where':_0x4a7b49[_0x1126('0x16')]?_0x4a7b49[_0x1126('0x16')]['where']||null:null,'attributes':_0x4a7b49[_0x1126('0x16')]?_0x4a7b49['options']['attributes']||null:null,'limit':_0x4a7b49[_0x1126('0x16')]?_0x4a7b49[_0x1126('0x16')][_0x1126('0x18')]||null:null,'include':_0x4a7b49[_0x1126('0x16')]?_0x4a7b49['options'][_0x1126('0x19')]?_[_0x1126('0x1a')](_0x4a7b49['options'][_0x1126('0x19')],function(_0x59cd8e){return{'model':db[_0x59cd8e['model']],'as':_0x59cd8e['as'],'attributes':_0x59cd8e['attributes'],'include':_0x59cd8e[_0x1126('0x19')]?_[_0x1126('0x1a')](_0x59cd8e[_0x1126('0x19')],function(_0x34bcf1){return{'model':db[_0x34bcf1[_0x1126('0x1b')]],'as':_0x34bcf1['as'],'attributes':_0x34bcf1[_0x1126('0x1c')],'include':_0x34bcf1[_0x1126('0x19')]?_[_0x1126('0x1a')](_0x34bcf1['include'],function(_0x35eec3){return{'model':db[_0x35eec3[_0x1126('0x1b')]],'as':_0x35eec3['as'],'attributes':_0x35eec3[_0x1126('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x541bc9){logger[_0x1126('0xd')](_0x1126('0x15'),_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x1d')](_0x541bc9));_0x22ae0b(_0x541bc9);})['catch'](function(_0x3fa694){logger['error'](_0x1126('0x15'),_0x3fa694['message'],_0x4a7b49);_0x2b2487(_0x4d2b38[_0x1126('0x11')](0x1f4,_0x3fa694['message']));});});};exports[_0x1126('0x1e')]=function(_0x5f2611){var _0x5252e0=this;return new Promise(function(_0x4a53ab,_0x17646e){return db[_0x1126('0x1f')][_0x1126('0x20')]({'raw':_0x5f2611['options']?_0x5f2611[_0x1126('0x16')][_0x1126('0x17')]===undefined?!![]:![]:!![],'where':_0x5f2611['options']?_0x5f2611[_0x1126('0x16')][_0x1126('0x21')]||null:null,'attributes':_0x5f2611[_0x1126('0x16')]?_0x5f2611[_0x1126('0x16')]['attributes']||null:null,'include':_0x5f2611['options']?_0x5f2611[_0x1126('0x16')][_0x1126('0x19')]?_[_0x1126('0x1a')](_0x5f2611[_0x1126('0x16')]['include'],function(_0x145314){return{'model':db[_0x145314[_0x1126('0x1b')]],'as':_0x145314['as'],'attributes':_0x145314[_0x1126('0x1c')],'include':_0x145314[_0x1126('0x19')]?_[_0x1126('0x1a')](_0x145314['include'],function(_0x2a0dfe){return{'model':db[_0x2a0dfe[_0x1126('0x1b')]],'as':_0x2a0dfe['as'],'attributes':_0x2a0dfe[_0x1126('0x1c')],'include':_0x2a0dfe[_0x1126('0x19')]?_['map'](_0x2a0dfe['include'],function(_0x22827a){return{'model':db[_0x22827a[_0x1126('0x1b')]],'as':_0x22827a['as'],'attributes':_0x22827a['attributes']};}):[]};}):[]};}):[]:[]})[_0x1126('0xc')](function(_0xf3c21b){logger[_0x1126('0xd')]('ShowFreshsalesAccount',_0x5f2611);logger['debug'](_0x1126('0x1e'),_0x5f2611,JSON[_0x1126('0x1d')](_0xf3c21b));_0x4a53ab(_0xf3c21b);})[_0x1126('0x14')](function(_0x156554){logger['error'](_0x1126('0x1e'),_0x156554['message'],_0x5f2611);_0x17646e(_0x5252e0[_0x1126('0x11')](0x1f4,_0x156554[_0x1126('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index b8f7662..e57864e 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 _0xb7f7=['get','isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','put','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xb7f7,0x157));var _0x7b7f=function(_0x1a75f3,_0x497eef){_0x1a75f3=_0x1a75f3-0x0;var _0x389324=_0xb7f7[_0x1a75f3];return _0x389324;};'use strict';var multer=require(_0x7b7f('0x0'));var util=require(_0x7b7f('0x1'));var path=require(_0x7b7f('0x2'));var timeout=require('connect-timeout');var express=require(_0x7b7f('0x3'));var router=express[_0x7b7f('0x4')]();var fs_extra=require(_0x7b7f('0x5'));var auth=require(_0x7b7f('0x6'));var interaction=require(_0x7b7f('0x7'));var config=require(_0x7b7f('0x8'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x7b7f('0x9')]('/',auth[_0x7b7f('0xa')](),controller[_0x7b7f('0xb')]);router[_0x7b7f('0x9')](_0x7b7f('0xc'),auth[_0x7b7f('0xa')](),controller[_0x7b7f('0xd')]);router[_0x7b7f('0x9')]('/:id/subjects',auth[_0x7b7f('0xa')](),controller[_0x7b7f('0xe')]);router[_0x7b7f('0x9')](_0x7b7f('0xf'),auth[_0x7b7f('0xa')](),controller[_0x7b7f('0x10')]);router[_0x7b7f('0x9')](_0x7b7f('0x11'),auth[_0x7b7f('0xa')](),controller[_0x7b7f('0x12')]);router['post']('/',auth[_0x7b7f('0xa')](),controller['create']);router[_0x7b7f('0x13')](_0x7b7f('0xc'),auth[_0x7b7f('0xa')](),controller[_0x7b7f('0x14')]);router['delete']('/:id',auth[_0x7b7f('0xa')](),controller[_0x7b7f('0x15')]);module['exports']=router; \ No newline at end of file +var _0xa1af=['getDescriptions','getFields','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','index','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions'];(function(_0x1b54f5,_0x83ee6a){var _0x3b9975=function(_0x20762a){while(--_0x20762a){_0x1b54f5['push'](_0x1b54f5['shift']());}};_0x3b9975(++_0x83ee6a);}(_0xa1af,0xe4));var _0xfa1a=function(_0x5354b0,_0x4da466){_0x5354b0=_0x5354b0-0x0;var _0x301330=_0xa1af[_0x5354b0];return _0x301330;};'use strict';var multer=require(_0xfa1a('0x0'));var util=require(_0xfa1a('0x1'));var path=require(_0xfa1a('0x2'));var timeout=require(_0xfa1a('0x3'));var express=require(_0xfa1a('0x4'));var router=express[_0xfa1a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfa1a('0x6'));var config=require('../../config/environment');var controller=require(_0xfa1a('0x7'));router[_0xfa1a('0x8')]('/',auth['isAuthenticated'](),controller[_0xfa1a('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xfa1a('0xa'),auth[_0xfa1a('0xb')](),controller[_0xfa1a('0xc')]);router[_0xfa1a('0x8')](_0xfa1a('0xd'),auth[_0xfa1a('0xb')](),controller[_0xfa1a('0xe')]);router[_0xfa1a('0x8')]('/:id/fields',auth[_0xfa1a('0xb')](),controller[_0xfa1a('0xf')]);router['post']('/',auth[_0xfa1a('0xb')](),controller[_0xfa1a('0x10')]);router[_0xfa1a('0x11')](_0xfa1a('0x12'),auth[_0xfa1a('0xb')](),controller['update']);router[_0xfa1a('0x13')](_0xfa1a('0x12'),auth[_0xfa1a('0xb')](),controller[_0xfa1a('0x14')]);module[_0xfa1a('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 a4f5a67..621a856 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 _0xc0f3=['STRING','sequelize','exports'];(function(_0x225170,_0x50c07a){var _0x4ab55c=function(_0x5cd198){while(--_0x5cd198){_0x225170['push'](_0x225170['shift']());}};_0x4ab55c(++_0x50c07a);}(_0xc0f3,0xc7));var _0x3c0f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc0f3[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x3c0f('0x0'));module[_0x3c0f('0x1')]={'name':{'type':Sequelize[_0x3c0f('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa190=['exports','STRING'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0xa190,0x16e));var _0x0a19=function(_0xf3cf27,_0x1df3c8){_0xf3cf27=_0xf3cf27-0x0;var _0x5331ac=_0xa190[_0xf3cf27];return _0x5331ac;};'use strict';var Sequelize=require('sequelize');module[_0x0a19('0x0')]={'name':{'type':Sequelize[_0x0a19('0x1')]},'description':{'type':Sequelize[_0x0a19('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index eea73fa..8edfef1 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 _0x6962=['../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','FreshsalesConfiguration','fieldName','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','keys','rawAttributes','length','find','create','body','params','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','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/license/hardware','../../config/logger','api','../../config/utils'];(function(_0xec7be7,_0xc6734){var _0x531748=function(_0x173e3f){while(--_0x173e3f){_0xec7be7['push'](_0xec7be7['shift']());}};_0x531748(++_0xc6734);}(_0x6962,0xdd));var _0x2696=function(_0x4fde60,_0x4fe98d){_0x4fde60=_0x4fde60-0x0;var _0x8721ec=_0x6962[_0x4fde60];return _0x8721ec;};'use strict';var emlformat=require(_0x2696('0x0'));var rimraf=require(_0x2696('0x1'));var zipdir=require(_0x2696('0x2'));var jsonpatch=require(_0x2696('0x3'));var rp=require('request-promise');var moment=require(_0x2696('0x4'));var BPromise=require(_0x2696('0x5'));var Mustache=require(_0x2696('0x6'));var util=require('util');var path=require(_0x2696('0x7'));var sox=require(_0x2696('0x8'));var csv=require(_0x2696('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2696('0xa'));var _=require(_0x2696('0xb'));var squel=require(_0x2696('0xc'));var crypto=require(_0x2696('0xd'));var jsforce=require(_0x2696('0xe'));var deskjs=require(_0x2696('0xf'));var toCsv=require(_0x2696('0x9'));var querystring=require(_0x2696('0x10'));var Papa=require(_0x2696('0x11'));var Redis=require(_0x2696('0x12'));var authService=require(_0x2696('0x13'));var qs=require(_0x2696('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2696('0x15'));var logger=require(_0x2696('0x16'))(_0x2696('0x17'));var utils=require(_0x2696('0x18'));var config=require(_0x2696('0x19'));var licenseUtil=require(_0x2696('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f4bca,_0x309e0c){_0x309e0c=_0x309e0c||0xcc;return function(_0x25e450){if(_0x25e450){return _0x4f4bca[_0x2696('0x1b')](_0x309e0c);}return _0x4f4bca[_0x2696('0x1c')](_0x309e0c)[_0x2696('0x1d')]();};}function respondWithResult(_0x364e42,_0x3f9e9c){_0x3f9e9c=_0x3f9e9c||0xc8;return function(_0x5d010b){if(_0x5d010b){return _0x364e42['status'](_0x3f9e9c)[_0x2696('0x1e')](_0x5d010b);}};}function respondWithFilteredResult(_0x2b4e59,_0x4a66d3){return function(_0x2c6927){if(_0x2c6927){var _0x15a529=typeof _0x4a66d3[_0x2696('0x1f')]==='undefined'&&typeof _0x4a66d3['limit']===_0x2696('0x20');var _0x385fee=_0x2c6927['count'];var _0x94ccb=_0x15a529?0x0:_0x4a66d3[_0x2696('0x1f')];var _0x364116=_0x15a529?_0x2c6927[_0x2696('0x21')]:_0x4a66d3['offset']+_0x4a66d3['limit'];var _0x2d7139;if(_0x364116>=_0x385fee){_0x364116=_0x385fee;_0x2d7139=0xc8;}else{_0x2d7139=0xce;}_0x2b4e59[_0x2696('0x1c')](_0x2d7139);return _0x2b4e59[_0x2696('0x22')](_0x2696('0x23'),_0x94ccb+'-'+_0x364116+'/'+_0x385fee)['json'](_0x2c6927);}return null;};}function patchUpdates(_0x3cbf47){return function(_0x4072f5){try{jsonpatch['apply'](_0x4072f5,_0x3cbf47,!![]);}catch(_0x73927e){return BPromise[_0x2696('0x24')](_0x73927e);}return _0x4072f5[_0x2696('0x25')]();};}function saveUpdates(_0x3c5356,_0x49b7fa){return function(_0x28530e){if(_0x28530e){return _0x28530e[_0x2696('0x26')](_0x3c5356)[_0x2696('0x27')](function(_0x26aa0d){return _0x26aa0d;});}return null;};}function removeEntity(_0x28bb3f,_0x1074e8){return function(_0x38ba99){if(_0x38ba99){return _0x38ba99[_0x2696('0x28')]()[_0x2696('0x27')](function(){_0x28bb3f[_0x2696('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57d3ea,_0x418634){return function(_0x3753e4){if(!_0x3753e4){_0x57d3ea['sendStatus'](0x194);}return _0x3753e4;};}function handleError(_0x5d8c1a,_0x176a02){_0x176a02=_0x176a02||0x1f4;return function(_0x3caae9){logger[_0x2696('0x29')](_0x3caae9[_0x2696('0x2a')]);if(_0x3caae9[_0x2696('0x2b')]){delete _0x3caae9[_0x2696('0x2b')];}_0x5d8c1a['status'](_0x176a02)['send'](_0x3caae9);};}exports[_0x2696('0x2c')]=function(_0x54c68e,_0xcd79e9){var _0x4081c7={},_0x19082d={},_0x5834be={'count':0x0,'rows':[]};var _0x47eece=_[_0x2696('0x2d')](db[_0x2696('0x2e')]['rawAttributes'],function(_0x84d014){return{'name':_0x84d014[_0x2696('0x2f')],'type':_0x84d014[_0x2696('0x30')]['key']};});_0x19082d['model']=_['map'](_0x47eece,_0x2696('0x2b'));_0x19082d[_0x2696('0x31')]=_['keys'](_0x54c68e[_0x2696('0x31')]);_0x19082d[_0x2696('0x32')]=_[_0x2696('0x33')](_0x19082d[_0x2696('0x34')],_0x19082d['query']);_0x4081c7[_0x2696('0x35')]=_[_0x2696('0x33')](_0x19082d[_0x2696('0x34')],qs[_0x2696('0x36')](_0x54c68e['query'][_0x2696('0x36')]));_0x4081c7['attributes']=_0x4081c7[_0x2696('0x35')]['length']?_0x4081c7['attributes']:_0x19082d[_0x2696('0x34')];if(!_0x54c68e[_0x2696('0x31')][_0x2696('0x37')](_0x2696('0x38'))){_0x4081c7['limit']=qs[_0x2696('0x39')](_0x54c68e[_0x2696('0x31')][_0x2696('0x39')]);_0x4081c7[_0x2696('0x1f')]=qs[_0x2696('0x1f')](_0x54c68e[_0x2696('0x31')][_0x2696('0x1f')]);}_0x4081c7[_0x2696('0x3a')]=qs['sort'](_0x54c68e['query'][_0x2696('0x3b')]);_0x4081c7[_0x2696('0x3c')]=qs['filters'](_[_0x2696('0x3d')](_0x54c68e[_0x2696('0x31')],_0x19082d[_0x2696('0x32')]),_0x47eece);if(_0x54c68e[_0x2696('0x31')][_0x2696('0x3e')]){_0x4081c7[_0x2696('0x3c')]=_[_0x2696('0x3f')](_0x4081c7[_0x2696('0x3c')],{'$or':_['map'](_0x47eece,function(_0x3cc478){if(_0x3cc478[_0x2696('0x30')]!=='VIRTUAL'){var _0x2b8d12={};_0x2b8d12[_0x3cc478[_0x2696('0x2b')]]={'$like':'%'+_0x54c68e['query'][_0x2696('0x3e')]+'%'};return _0x2b8d12;}})});}_0x4081c7=_[_0x2696('0x3f')]({},_0x4081c7,_0x54c68e[_0x2696('0x40')]);var _0x40fcdc={'where':_0x4081c7[_0x2696('0x3c')]};return db[_0x2696('0x2e')][_0x2696('0x21')](_0x40fcdc)[_0x2696('0x27')](function(_0x4a7e6f){_0x5834be[_0x2696('0x21')]=_0x4a7e6f;if(_0x54c68e[_0x2696('0x31')][_0x2696('0x41')]){_0x4081c7[_0x2696('0x42')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x4081c7);})[_0x2696('0x27')](function(_0x410b29){_0x5834be[_0x2696('0x43')]=_0x410b29;return _0x5834be;})[_0x2696('0x27')](respondWithFilteredResult(_0xcd79e9,_0x4081c7))[_0x2696('0x44')](handleError(_0xcd79e9,null));};exports[_0x2696('0x45')]=function(_0x32fd9c,_0x563617){var _0x7f280a={'raw':![],'where':{'id':_0x32fd9c['params']['id']}},_0x329cf6={};_0x329cf6['model']=_[_0x2696('0x46')](db['FreshsalesConfiguration'][_0x2696('0x47')]);_0x329cf6['query']=_[_0x2696('0x46')](_0x32fd9c[_0x2696('0x31')]);_0x329cf6[_0x2696('0x32')]=_['intersection'](_0x329cf6[_0x2696('0x34')],_0x329cf6[_0x2696('0x31')]);_0x7f280a[_0x2696('0x35')]=_[_0x2696('0x33')](_0x329cf6[_0x2696('0x34')],qs[_0x2696('0x36')](_0x32fd9c[_0x2696('0x31')][_0x2696('0x36')]));_0x7f280a['attributes']=_0x7f280a[_0x2696('0x35')][_0x2696('0x48')]?_0x7f280a[_0x2696('0x35')]:_0x329cf6['model'];if(_0x32fd9c[_0x2696('0x31')][_0x2696('0x41')]){_0x7f280a[_0x2696('0x42')]=[{'all':!![]}];}_0x7f280a=_[_0x2696('0x3f')]({},_0x7f280a,_0x32fd9c[_0x2696('0x40')]);return db['FreshsalesConfiguration'][_0x2696('0x49')](_0x7f280a)[_0x2696('0x27')](handleEntityNotFound(_0x563617,null))[_0x2696('0x27')](respondWithResult(_0x563617,null))['catch'](handleError(_0x563617,null));};exports[_0x2696('0x4a')]=function(_0x59c397,_0x31926e){return db[_0x2696('0x2e')][_0x2696('0x4a')](_0x59c397[_0x2696('0x4b')],{})['then'](respondWithResult(_0x31926e,0xc9))[_0x2696('0x44')](handleError(_0x31926e,null));};exports[_0x2696('0x26')]=function(_0x2c1d2c,_0x229d54){if(_0x2c1d2c[_0x2696('0x4b')]['id']){delete _0x2c1d2c[_0x2696('0x4b')]['id'];}return db[_0x2696('0x2e')][_0x2696('0x49')]({'where':{'id':_0x2c1d2c[_0x2696('0x4c')]['id']}})[_0x2696('0x27')](handleEntityNotFound(_0x229d54,null))[_0x2696('0x27')](saveUpdates(_0x2c1d2c[_0x2696('0x4b')],null))[_0x2696('0x27')](respondWithResult(_0x229d54,null))[_0x2696('0x44')](handleError(_0x229d54,null));};exports[_0x2696('0x28')]=function(_0x58d579,_0x3573e6){return db[_0x2696('0x2e')][_0x2696('0x49')]({'where':{'id':_0x58d579[_0x2696('0x4c')]['id']}})[_0x2696('0x27')](handleEntityNotFound(_0x3573e6,null))[_0x2696('0x27')](removeEntity(_0x3573e6,null))[_0x2696('0x44')](handleError(_0x3573e6,null));};exports[_0x2696('0x4d')]=function(_0x5322bd,_0x185659,_0x57d77f){var _0x541be2={};var _0x52d593={};var _0x34c1e4;var _0x223ae4;return db[_0x2696('0x2e')][_0x2696('0x4e')]({'where':{'id':_0x5322bd['params']['id']}})[_0x2696('0x27')](handleEntityNotFound(_0x185659,null))[_0x2696('0x27')](function(_0x1f1409){if(_0x1f1409){_0x34c1e4=_0x1f1409;_0x52d593[_0x2696('0x34')]=_[_0x2696('0x46')](db[_0x2696('0x4f')]['rawAttributes']);_0x52d593[_0x2696('0x31')]=_['keys'](_0x5322bd[_0x2696('0x31')]);_0x52d593[_0x2696('0x32')]=_[_0x2696('0x33')](_0x52d593[_0x2696('0x34')],_0x52d593[_0x2696('0x31')]);_0x541be2['attributes']=_['intersection'](_0x52d593[_0x2696('0x34')],qs[_0x2696('0x36')](_0x5322bd[_0x2696('0x31')][_0x2696('0x36')]));_0x541be2['attributes']=_0x541be2['attributes'][_0x2696('0x48')]?_0x541be2['attributes']:_0x52d593[_0x2696('0x34')];_0x541be2[_0x2696('0x3a')]=qs[_0x2696('0x3b')](_0x5322bd[_0x2696('0x31')][_0x2696('0x3b')]);_0x541be2['where']=qs[_0x2696('0x32')](_[_0x2696('0x3d')](_0x5322bd['query'],_0x52d593[_0x2696('0x32')]));if(_0x5322bd[_0x2696('0x31')][_0x2696('0x3e')]){_0x541be2[_0x2696('0x3c')]=_[_0x2696('0x3f')](_0x541be2[_0x2696('0x3c')],{'$or':_[_0x2696('0x2d')](_0x541be2['attributes'],function(_0x37bfaa){var _0x536c27={};_0x536c27[_0x37bfaa]={'$like':'%'+_0x5322bd[_0x2696('0x31')]['filter']+'%'};return _0x536c27;})});}_0x541be2=_[_0x2696('0x3f')]({},_0x541be2,_0x5322bd[_0x2696('0x40')]);return _0x34c1e4[_0x2696('0x4d')](_0x541be2);}})[_0x2696('0x27')](function(_0x60bad8){if(_0x60bad8){_0x223ae4=_0x60bad8[_0x2696('0x48')];if(!_0x5322bd['query'][_0x2696('0x37')](_0x2696('0x38'))){_0x541be2[_0x2696('0x39')]=qs[_0x2696('0x39')](_0x5322bd[_0x2696('0x31')]['limit']);_0x541be2['offset']=qs[_0x2696('0x1f')](_0x5322bd['query'][_0x2696('0x1f')]);}return _0x34c1e4[_0x2696('0x4d')](_0x541be2);}})[_0x2696('0x27')](function(_0x48f4cc){if(_0x48f4cc){return _0x48f4cc?{'count':_0x223ae4,'rows':_0x48f4cc}:null;}})[_0x2696('0x27')](respondWithResult(_0x185659,null))[_0x2696('0x44')](handleError(_0x185659,null));};exports[_0x2696('0x50')]=function(_0x4a5d08,_0x33ecec,_0x5a778e){var _0x3d52e2={};var _0xa2a838={};var _0x5baf68;var _0x22d00e;return db[_0x2696('0x2e')]['findOne']({'where':{'id':_0x4a5d08['params']['id']}})['then'](handleEntityNotFound(_0x33ecec,null))[_0x2696('0x27')](function(_0x45f26e){if(_0x45f26e){_0x5baf68=_0x45f26e;_0xa2a838[_0x2696('0x34')]=_[_0x2696('0x46')](db[_0x2696('0x4f')][_0x2696('0x47')]);_0xa2a838[_0x2696('0x31')]=_[_0x2696('0x46')](_0x4a5d08[_0x2696('0x31')]);_0xa2a838[_0x2696('0x32')]=_['intersection'](_0xa2a838[_0x2696('0x34')],_0xa2a838['query']);_0x3d52e2[_0x2696('0x35')]=_[_0x2696('0x33')](_0xa2a838[_0x2696('0x34')],qs[_0x2696('0x36')](_0x4a5d08[_0x2696('0x31')]['fields']));_0x3d52e2['attributes']=_0x3d52e2[_0x2696('0x35')][_0x2696('0x48')]?_0x3d52e2[_0x2696('0x35')]:_0xa2a838[_0x2696('0x34')];_0x3d52e2['order']=qs[_0x2696('0x3b')](_0x4a5d08['query'][_0x2696('0x3b')]);_0x3d52e2[_0x2696('0x3c')]=qs[_0x2696('0x32')](_['pick'](_0x4a5d08[_0x2696('0x31')],_0xa2a838[_0x2696('0x32')]));if(_0x4a5d08[_0x2696('0x31')][_0x2696('0x3e')]){_0x3d52e2[_0x2696('0x3c')]=_[_0x2696('0x3f')](_0x3d52e2['where'],{'$or':_[_0x2696('0x2d')](_0x3d52e2[_0x2696('0x35')],function(_0x3afca4){var _0x1c4b8b={};_0x1c4b8b[_0x3afca4]={'$like':'%'+_0x4a5d08[_0x2696('0x31')][_0x2696('0x3e')]+'%'};return _0x1c4b8b;})});}_0x3d52e2=_['merge']({},_0x3d52e2,_0x4a5d08['options']);return _0x5baf68['getDescriptions'](_0x3d52e2);}})[_0x2696('0x27')](function(_0x3f1ac8){if(_0x3f1ac8){_0x22d00e=_0x3f1ac8[_0x2696('0x48')];if(!_0x4a5d08['query'][_0x2696('0x37')]('nolimit')){_0x3d52e2[_0x2696('0x39')]=qs[_0x2696('0x39')](_0x4a5d08[_0x2696('0x31')]['limit']);_0x3d52e2[_0x2696('0x1f')]=qs[_0x2696('0x1f')](_0x4a5d08[_0x2696('0x31')]['offset']);}return _0x5baf68[_0x2696('0x50')](_0x3d52e2);}})['then'](function(_0x366118){if(_0x366118){return _0x366118?{'count':_0x22d00e,'rows':_0x366118}:null;}})[_0x2696('0x27')](respondWithResult(_0x33ecec,null))['catch'](handleError(_0x33ecec,null));};exports[_0x2696('0x51')]=function(_0x15b3f8,_0x2229ca,_0x5ada50){var _0x59a854={};var _0x250513={};var _0x26e4c7;var _0x5cff12;return db[_0x2696('0x2e')][_0x2696('0x4e')]({'where':{'id':_0x15b3f8[_0x2696('0x4c')]['id']}})[_0x2696('0x27')](handleEntityNotFound(_0x2229ca,null))[_0x2696('0x27')](function(_0x242100){if(_0x242100){_0x26e4c7=_0x242100;_0x250513[_0x2696('0x34')]=_[_0x2696('0x46')](db['FreshsalesField'][_0x2696('0x47')]);_0x250513[_0x2696('0x31')]=_[_0x2696('0x46')](_0x15b3f8[_0x2696('0x31')]);_0x250513[_0x2696('0x32')]=_[_0x2696('0x33')](_0x250513[_0x2696('0x34')],_0x250513[_0x2696('0x31')]);_0x59a854[_0x2696('0x35')]=_[_0x2696('0x33')](_0x250513['model'],qs[_0x2696('0x36')](_0x15b3f8['query'][_0x2696('0x36')]));_0x59a854[_0x2696('0x35')]=_0x59a854[_0x2696('0x35')]['length']?_0x59a854[_0x2696('0x35')]:_0x250513[_0x2696('0x34')];_0x59a854[_0x2696('0x3a')]=qs[_0x2696('0x3b')](_0x15b3f8[_0x2696('0x31')][_0x2696('0x3b')]);_0x59a854[_0x2696('0x3c')]=qs[_0x2696('0x32')](_[_0x2696('0x3d')](_0x15b3f8[_0x2696('0x31')],_0x250513[_0x2696('0x32')]));if(_0x15b3f8[_0x2696('0x31')]['filter']){_0x59a854[_0x2696('0x3c')]=_[_0x2696('0x3f')](_0x59a854['where'],{'$or':_['map'](_0x59a854[_0x2696('0x35')],function(_0x9c2cc3){var _0x3dc06f={};_0x3dc06f[_0x9c2cc3]={'$like':'%'+_0x15b3f8['query']['filter']+'%'};return _0x3dc06f;})});}_0x59a854=_[_0x2696('0x3f')]({},_0x59a854,_0x15b3f8[_0x2696('0x40')]);return _0x26e4c7[_0x2696('0x51')](_0x59a854);}})[_0x2696('0x27')](function(_0x3157e8){if(_0x3157e8){_0x5cff12=_0x3157e8[_0x2696('0x48')];if(!_0x15b3f8[_0x2696('0x31')][_0x2696('0x37')](_0x2696('0x38'))){_0x59a854[_0x2696('0x39')]=qs['limit'](_0x15b3f8[_0x2696('0x31')][_0x2696('0x39')]);_0x59a854[_0x2696('0x1f')]=qs[_0x2696('0x1f')](_0x15b3f8['query'][_0x2696('0x1f')]);}return _0x26e4c7['getFields'](_0x59a854);}})[_0x2696('0x27')](function(_0x2b8330){if(_0x2b8330){return _0x2b8330?{'count':_0x5cff12,'rows':_0x2b8330}:null;}})['then'](respondWithResult(_0x2229ca,null))[_0x2696('0x44')](handleError(_0x2229ca,null));}; \ No newline at end of file +var _0x6650=['ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','then','includeAll','rows','params','include','options','catch','create','body','update','find','destroy','findOne','FreshsalesField','getSubjects','pick','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv'];(function(_0x5b2f0a,_0x3543ea){var _0x30413a=function(_0x4e33d0){while(--_0x4e33d0){_0x5b2f0a['push'](_0x5b2f0a['shift']());}};_0x30413a(++_0x3543ea);}(_0x6650,0x96));var _0x0665=function(_0x2f3463,_0x5d0b9f){_0x2f3463=_0x2f3463-0x0;var _0x254696=_0x6650[_0x2f3463];return _0x254696;};'use strict';var emlformat=require(_0x0665('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0665('0x1'));var jsonpatch=require(_0x0665('0x2'));var rp=require(_0x0665('0x3'));var moment=require(_0x0665('0x4'));var BPromise=require(_0x0665('0x5'));var Mustache=require('mustache');var util=require(_0x0665('0x6'));var path=require(_0x0665('0x7'));var sox=require(_0x0665('0x8'));var csv=require(_0x0665('0x9'));var ejs=require(_0x0665('0xa'));var fs=require('fs');var fs_extra=require(_0x0665('0xb'));var _=require(_0x0665('0xc'));var squel=require('squel');var crypto=require(_0x0665('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0665('0xe'));var toCsv=require(_0x0665('0x9'));var querystring=require(_0x0665('0xf'));var Papa=require(_0x0665('0x10'));var Redis=require('ioredis');var authService=require(_0x0665('0x11'));var qs=require(_0x0665('0x12'));var as=require(_0x0665('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0665('0x14'))(_0x0665('0x15'));var utils=require('../../config/utils');var config=require(_0x0665('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0665('0x17'))['db'];function respondWithStatusCode(_0x16bb04,_0x134d35){_0x134d35=_0x134d35||0xcc;return function(_0x28a8f6){if(_0x28a8f6){return _0x16bb04[_0x0665('0x18')](_0x134d35);}return _0x16bb04['status'](_0x134d35)[_0x0665('0x19')]();};}function respondWithResult(_0x3f4d19,_0x5e5209){_0x5e5209=_0x5e5209||0xc8;return function(_0x1971ed){if(_0x1971ed){return _0x3f4d19['status'](_0x5e5209)[_0x0665('0x1a')](_0x1971ed);}};}function respondWithFilteredResult(_0x48fe3b,_0x1f8c0d){return function(_0x396700){if(_0x396700){var _0x5042a6=typeof _0x1f8c0d[_0x0665('0x1b')]===_0x0665('0x1c')&&typeof _0x1f8c0d['limit']===_0x0665('0x1c');var _0x2d6b8f=_0x396700[_0x0665('0x1d')];var _0x59ecef=_0x5042a6?0x0:_0x1f8c0d[_0x0665('0x1b')];var _0x121558=_0x5042a6?_0x396700[_0x0665('0x1d')]:_0x1f8c0d[_0x0665('0x1b')]+_0x1f8c0d[_0x0665('0x1e')];var _0x546169;if(_0x121558>=_0x2d6b8f){_0x121558=_0x2d6b8f;_0x546169=0xc8;}else{_0x546169=0xce;}_0x48fe3b[_0x0665('0x1f')](_0x546169);return _0x48fe3b[_0x0665('0x20')](_0x0665('0x21'),_0x59ecef+'-'+_0x121558+'/'+_0x2d6b8f)[_0x0665('0x1a')](_0x396700);}return null;};}function patchUpdates(_0x574357){return function(_0x33a633){try{jsonpatch[_0x0665('0x22')](_0x33a633,_0x574357,!![]);}catch(_0x59bb89){return BPromise[_0x0665('0x23')](_0x59bb89);}return _0x33a633[_0x0665('0x24')]();};}function saveUpdates(_0x475bd8,_0x54c1f7){return function(_0x179133){if(_0x179133){return _0x179133['update'](_0x475bd8)['then'](function(_0x33bdcb){return _0x33bdcb;});}return null;};}function removeEntity(_0x578ac9,_0x42c98f){return function(_0x3d756e){if(_0x3d756e){return _0x3d756e['destroy']()['then'](function(){_0x578ac9[_0x0665('0x1f')](0xcc)[_0x0665('0x19')]();});}};}function handleEntityNotFound(_0x4cde5e,_0x4508fa){return function(_0x509334){if(!_0x509334){_0x4cde5e['sendStatus'](0x194);}return _0x509334;};}function handleError(_0x3b5f93,_0x4913dd){_0x4913dd=_0x4913dd||0x1f4;return function(_0x4d9eed){logger[_0x0665('0x25')](_0x4d9eed[_0x0665('0x26')]);if(_0x4d9eed[_0x0665('0x27')]){delete _0x4d9eed[_0x0665('0x27')];}_0x3b5f93[_0x0665('0x1f')](_0x4913dd)[_0x0665('0x28')](_0x4d9eed);};}exports[_0x0665('0x29')]=function(_0x1c256b,_0x2aaee6){var _0x39bc9a={},_0x506d36={},_0x4e03f4={'count':0x0,'rows':[]};var _0x5bf7b3=_[_0x0665('0x2a')](db[_0x0665('0x2b')][_0x0665('0x2c')],function(_0x1033dd){return{'name':_0x1033dd['fieldName'],'type':_0x1033dd[_0x0665('0x2d')][_0x0665('0x2e')]};});_0x506d36[_0x0665('0x2f')]=_[_0x0665('0x2a')](_0x5bf7b3,'name');_0x506d36[_0x0665('0x30')]=_[_0x0665('0x31')](_0x1c256b[_0x0665('0x30')]);_0x506d36[_0x0665('0x32')]=_['intersection'](_0x506d36[_0x0665('0x2f')],_0x506d36['query']);_0x39bc9a[_0x0665('0x33')]=_[_0x0665('0x34')](_0x506d36['model'],qs[_0x0665('0x35')](_0x1c256b['query'][_0x0665('0x35')]));_0x39bc9a[_0x0665('0x33')]=_0x39bc9a[_0x0665('0x33')][_0x0665('0x36')]?_0x39bc9a['attributes']:_0x506d36[_0x0665('0x2f')];if(!_0x1c256b[_0x0665('0x30')][_0x0665('0x37')](_0x0665('0x38'))){_0x39bc9a[_0x0665('0x1e')]=qs[_0x0665('0x1e')](_0x1c256b[_0x0665('0x30')][_0x0665('0x1e')]);_0x39bc9a['offset']=qs[_0x0665('0x1b')](_0x1c256b[_0x0665('0x30')][_0x0665('0x1b')]);}_0x39bc9a[_0x0665('0x39')]=qs[_0x0665('0x3a')](_0x1c256b[_0x0665('0x30')][_0x0665('0x3a')]);_0x39bc9a[_0x0665('0x3b')]=qs[_0x0665('0x32')](_['pick'](_0x1c256b[_0x0665('0x30')],_0x506d36[_0x0665('0x32')]),_0x5bf7b3);if(_0x1c256b[_0x0665('0x30')][_0x0665('0x3c')]){_0x39bc9a['where']=_['merge'](_0x39bc9a[_0x0665('0x3b')],{'$or':_[_0x0665('0x2a')](_0x5bf7b3,function(_0x1aa208){if(_0x1aa208[_0x0665('0x2d')]!==_0x0665('0x3d')){var _0x103edb={};_0x103edb[_0x1aa208['name']]={'$like':'%'+_0x1c256b[_0x0665('0x30')][_0x0665('0x3c')]+'%'};return _0x103edb;}})});}_0x39bc9a=_[_0x0665('0x3e')]({},_0x39bc9a,_0x1c256b['options']);var _0x172d81={'where':_0x39bc9a['where']};return db[_0x0665('0x2b')][_0x0665('0x1d')](_0x172d81)[_0x0665('0x3f')](function(_0x13052e){_0x4e03f4[_0x0665('0x1d')]=_0x13052e;if(_0x1c256b[_0x0665('0x30')][_0x0665('0x40')]){_0x39bc9a['include']=[{'all':!![]}];}return db[_0x0665('0x2b')]['findAll'](_0x39bc9a);})['then'](function(_0x3ceb98){_0x4e03f4[_0x0665('0x41')]=_0x3ceb98;return _0x4e03f4;})['then'](respondWithFilteredResult(_0x2aaee6,_0x39bc9a))['catch'](handleError(_0x2aaee6,null));};exports['show']=function(_0x443021,_0x2932c2){var _0x48a62c={'raw':![],'where':{'id':_0x443021[_0x0665('0x42')]['id']}},_0x4133d6={};_0x4133d6[_0x0665('0x2f')]=_[_0x0665('0x31')](db['FreshsalesConfiguration'][_0x0665('0x2c')]);_0x4133d6[_0x0665('0x30')]=_[_0x0665('0x31')](_0x443021[_0x0665('0x30')]);_0x4133d6[_0x0665('0x32')]=_[_0x0665('0x34')](_0x4133d6[_0x0665('0x2f')],_0x4133d6[_0x0665('0x30')]);_0x48a62c[_0x0665('0x33')]=_[_0x0665('0x34')](_0x4133d6['model'],qs[_0x0665('0x35')](_0x443021[_0x0665('0x30')][_0x0665('0x35')]));_0x48a62c[_0x0665('0x33')]=_0x48a62c[_0x0665('0x33')]['length']?_0x48a62c[_0x0665('0x33')]:_0x4133d6[_0x0665('0x2f')];if(_0x443021[_0x0665('0x30')][_0x0665('0x40')]){_0x48a62c[_0x0665('0x43')]=[{'all':!![]}];}_0x48a62c=_['merge']({},_0x48a62c,_0x443021[_0x0665('0x44')]);return db['FreshsalesConfiguration']['find'](_0x48a62c)['then'](handleEntityNotFound(_0x2932c2,null))[_0x0665('0x3f')](respondWithResult(_0x2932c2,null))[_0x0665('0x45')](handleError(_0x2932c2,null));};exports[_0x0665('0x46')]=function(_0x4d8259,_0x58f6cf){return db[_0x0665('0x2b')][_0x0665('0x46')](_0x4d8259[_0x0665('0x47')],{})[_0x0665('0x3f')](respondWithResult(_0x58f6cf,0xc9))[_0x0665('0x45')](handleError(_0x58f6cf,null));};exports[_0x0665('0x48')]=function(_0x304e53,_0x3453c0){if(_0x304e53['body']['id']){delete _0x304e53[_0x0665('0x47')]['id'];}return db[_0x0665('0x2b')][_0x0665('0x49')]({'where':{'id':_0x304e53[_0x0665('0x42')]['id']}})[_0x0665('0x3f')](handleEntityNotFound(_0x3453c0,null))[_0x0665('0x3f')](saveUpdates(_0x304e53[_0x0665('0x47')],null))[_0x0665('0x3f')](respondWithResult(_0x3453c0,null))[_0x0665('0x45')](handleError(_0x3453c0,null));};exports[_0x0665('0x4a')]=function(_0x798d30,_0xaa4221){return db[_0x0665('0x2b')][_0x0665('0x49')]({'where':{'id':_0x798d30[_0x0665('0x42')]['id']}})[_0x0665('0x3f')](handleEntityNotFound(_0xaa4221,null))['then'](removeEntity(_0xaa4221,null))[_0x0665('0x45')](handleError(_0xaa4221,null));};exports['getSubjects']=function(_0x479fb4,_0x256b67,_0x1220c7){var _0x3111d9={};var _0x39ae86={};var _0x4ff295;var _0x402b4c;return db[_0x0665('0x2b')][_0x0665('0x4b')]({'where':{'id':_0x479fb4[_0x0665('0x42')]['id']}})['then'](handleEntityNotFound(_0x256b67,null))[_0x0665('0x3f')](function(_0x174eb0){if(_0x174eb0){_0x4ff295=_0x174eb0;_0x39ae86[_0x0665('0x2f')]=_['keys'](db[_0x0665('0x4c')]['rawAttributes']);_0x39ae86[_0x0665('0x30')]=_[_0x0665('0x31')](_0x479fb4['query']);_0x39ae86[_0x0665('0x32')]=_[_0x0665('0x34')](_0x39ae86[_0x0665('0x2f')],_0x39ae86[_0x0665('0x30')]);_0x3111d9[_0x0665('0x33')]=_[_0x0665('0x34')](_0x39ae86['model'],qs['fields'](_0x479fb4[_0x0665('0x30')][_0x0665('0x35')]));_0x3111d9[_0x0665('0x33')]=_0x3111d9['attributes'][_0x0665('0x36')]?_0x3111d9[_0x0665('0x33')]:_0x39ae86[_0x0665('0x2f')];_0x3111d9[_0x0665('0x39')]=qs['sort'](_0x479fb4['query'][_0x0665('0x3a')]);_0x3111d9['where']=qs[_0x0665('0x32')](_['pick'](_0x479fb4[_0x0665('0x30')],_0x39ae86['filters']));if(_0x479fb4['query'][_0x0665('0x3c')]){_0x3111d9[_0x0665('0x3b')]=_[_0x0665('0x3e')](_0x3111d9['where'],{'$or':_[_0x0665('0x2a')](_0x3111d9[_0x0665('0x33')],function(_0x51b689){var _0xe8d71d={};_0xe8d71d[_0x51b689]={'$like':'%'+_0x479fb4[_0x0665('0x30')][_0x0665('0x3c')]+'%'};return _0xe8d71d;})});}_0x3111d9=_[_0x0665('0x3e')]({},_0x3111d9,_0x479fb4[_0x0665('0x44')]);return _0x4ff295[_0x0665('0x4d')](_0x3111d9);}})[_0x0665('0x3f')](function(_0x162a74){if(_0x162a74){_0x402b4c=_0x162a74[_0x0665('0x36')];if(!_0x479fb4['query']['hasOwnProperty']('nolimit')){_0x3111d9['limit']=qs[_0x0665('0x1e')](_0x479fb4['query'][_0x0665('0x1e')]);_0x3111d9[_0x0665('0x1b')]=qs['offset'](_0x479fb4[_0x0665('0x30')][_0x0665('0x1b')]);}return _0x4ff295[_0x0665('0x4d')](_0x3111d9);}})[_0x0665('0x3f')](function(_0x1b801e){if(_0x1b801e){return _0x1b801e?{'count':_0x402b4c,'rows':_0x1b801e}:null;}})[_0x0665('0x3f')](respondWithResult(_0x256b67,null))[_0x0665('0x45')](handleError(_0x256b67,null));};exports['getDescriptions']=function(_0x39900b,_0x3071a4,_0x5078a6){var _0x445d6e={};var _0x233184={};var _0x1e1e80;var _0x100b25;return db[_0x0665('0x2b')][_0x0665('0x4b')]({'where':{'id':_0x39900b[_0x0665('0x42')]['id']}})[_0x0665('0x3f')](handleEntityNotFound(_0x3071a4,null))[_0x0665('0x3f')](function(_0x56e11d){if(_0x56e11d){_0x1e1e80=_0x56e11d;_0x233184[_0x0665('0x2f')]=_[_0x0665('0x31')](db[_0x0665('0x4c')]['rawAttributes']);_0x233184[_0x0665('0x30')]=_[_0x0665('0x31')](_0x39900b['query']);_0x233184[_0x0665('0x32')]=_[_0x0665('0x34')](_0x233184['model'],_0x233184[_0x0665('0x30')]);_0x445d6e[_0x0665('0x33')]=_[_0x0665('0x34')](_0x233184[_0x0665('0x2f')],qs[_0x0665('0x35')](_0x39900b[_0x0665('0x30')][_0x0665('0x35')]));_0x445d6e[_0x0665('0x33')]=_0x445d6e[_0x0665('0x33')][_0x0665('0x36')]?_0x445d6e[_0x0665('0x33')]:_0x233184[_0x0665('0x2f')];_0x445d6e[_0x0665('0x39')]=qs[_0x0665('0x3a')](_0x39900b[_0x0665('0x30')][_0x0665('0x3a')]);_0x445d6e['where']=qs[_0x0665('0x32')](_[_0x0665('0x4e')](_0x39900b[_0x0665('0x30')],_0x233184['filters']));if(_0x39900b[_0x0665('0x30')][_0x0665('0x3c')]){_0x445d6e[_0x0665('0x3b')]=_[_0x0665('0x3e')](_0x445d6e['where'],{'$or':_[_0x0665('0x2a')](_0x445d6e['attributes'],function(_0x2bb0c8){var _0x58cf8e={};_0x58cf8e[_0x2bb0c8]={'$like':'%'+_0x39900b['query'][_0x0665('0x3c')]+'%'};return _0x58cf8e;})});}_0x445d6e=_[_0x0665('0x3e')]({},_0x445d6e,_0x39900b[_0x0665('0x44')]);return _0x1e1e80['getDescriptions'](_0x445d6e);}})[_0x0665('0x3f')](function(_0x12cec3){if(_0x12cec3){_0x100b25=_0x12cec3[_0x0665('0x36')];if(!_0x39900b[_0x0665('0x30')][_0x0665('0x37')](_0x0665('0x38'))){_0x445d6e['limit']=qs['limit'](_0x39900b[_0x0665('0x30')][_0x0665('0x1e')]);_0x445d6e[_0x0665('0x1b')]=qs[_0x0665('0x1b')](_0x39900b[_0x0665('0x30')]['offset']);}return _0x1e1e80['getDescriptions'](_0x445d6e);}})[_0x0665('0x3f')](function(_0x5bb76a){if(_0x5bb76a){return _0x5bb76a?{'count':_0x100b25,'rows':_0x5bb76a}:null;}})[_0x0665('0x3f')](respondWithResult(_0x3071a4,null))['catch'](handleError(_0x3071a4,null));};exports[_0x0665('0x4f')]=function(_0xf52c4a,_0x2d4536,_0x3968c2){var _0x44cf5a={};var _0x3969d8={};var _0xbdb1ca;var _0x12d6e2;return db['FreshsalesConfiguration'][_0x0665('0x4b')]({'where':{'id':_0xf52c4a[_0x0665('0x42')]['id']}})['then'](handleEntityNotFound(_0x2d4536,null))[_0x0665('0x3f')](function(_0x3a9d5b){if(_0x3a9d5b){_0xbdb1ca=_0x3a9d5b;_0x3969d8['model']=_[_0x0665('0x31')](db[_0x0665('0x4c')][_0x0665('0x2c')]);_0x3969d8[_0x0665('0x30')]=_['keys'](_0xf52c4a[_0x0665('0x30')]);_0x3969d8[_0x0665('0x32')]=_[_0x0665('0x34')](_0x3969d8[_0x0665('0x2f')],_0x3969d8[_0x0665('0x30')]);_0x44cf5a[_0x0665('0x33')]=_[_0x0665('0x34')](_0x3969d8[_0x0665('0x2f')],qs[_0x0665('0x35')](_0xf52c4a[_0x0665('0x30')][_0x0665('0x35')]));_0x44cf5a[_0x0665('0x33')]=_0x44cf5a[_0x0665('0x33')][_0x0665('0x36')]?_0x44cf5a['attributes']:_0x3969d8[_0x0665('0x2f')];_0x44cf5a[_0x0665('0x39')]=qs[_0x0665('0x3a')](_0xf52c4a['query'][_0x0665('0x3a')]);_0x44cf5a[_0x0665('0x3b')]=qs['filters'](_[_0x0665('0x4e')](_0xf52c4a[_0x0665('0x30')],_0x3969d8[_0x0665('0x32')]));if(_0xf52c4a['query'][_0x0665('0x3c')]){_0x44cf5a[_0x0665('0x3b')]=_[_0x0665('0x3e')](_0x44cf5a[_0x0665('0x3b')],{'$or':_['map'](_0x44cf5a['attributes'],function(_0x4d3caa){var _0x229bd9={};_0x229bd9[_0x4d3caa]={'$like':'%'+_0xf52c4a[_0x0665('0x30')][_0x0665('0x3c')]+'%'};return _0x229bd9;})});}_0x44cf5a=_[_0x0665('0x3e')]({},_0x44cf5a,_0xf52c4a['options']);return _0xbdb1ca[_0x0665('0x4f')](_0x44cf5a);}})[_0x0665('0x3f')](function(_0x1488c3){if(_0x1488c3){_0x12d6e2=_0x1488c3['length'];if(!_0xf52c4a[_0x0665('0x30')][_0x0665('0x37')](_0x0665('0x38'))){_0x44cf5a['limit']=qs['limit'](_0xf52c4a[_0x0665('0x30')][_0x0665('0x1e')]);_0x44cf5a[_0x0665('0x1b')]=qs['offset'](_0xf52c4a[_0x0665('0x30')][_0x0665('0x1b')]);}return _0xbdb1ca[_0x0665('0x4f')](_0x44cf5a);}})[_0x0665('0x3f')](function(_0x18a029){if(_0x18a029){return _0x18a029?{'count':_0x12d6e2,'rows':_0x18a029}:null;}})[_0x0665('0x3f')](respondWithResult(_0x2d4536,null))[_0x0665('0x45')](handleError(_0x2d4536,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 26c1e54..ef7e0bb 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 _0x0f5a=['./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x379ca9,_0x268f7f){var _0x8c3467=function(_0x502132){while(--_0x502132){_0x379ca9['push'](_0x379ca9['shift']());}};_0x8c3467(++_0x268f7f);}(_0x0f5a,0xea));var _0xa0f5=function(_0xbab353,_0x37e159){_0xbab353=_0xbab353-0x0;var _0x56871e=_0x0f5a[_0xbab353];return _0x56871e;};'use strict';var _=require(_0xa0f5('0x0'));var util=require('util');var logger=require(_0xa0f5('0x1'))(_0xa0f5('0x2'));var moment=require(_0xa0f5('0x3'));var BPromise=require(_0xa0f5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0f5('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa0f5('0x6'));module[_0xa0f5('0x7')]=function(_0x2833fe,_0x4699e9){return _0x2833fe[_0xa0f5('0x8')](_0xa0f5('0x9'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4d4=['path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','util','../../config/logger','api','bluebird','request-promise'];(function(_0x478acb,_0x595555){var _0x353e6a=function(_0x249203){while(--_0x249203){_0x478acb['push'](_0x478acb['shift']());}};_0x353e6a(++_0x595555);}(_0xa4d4,0x109));var _0x4a4d=function(_0x54fa87,_0x80e050){_0x54fa87=_0x54fa87-0x0;var _0x5d73b5=_0xa4d4[_0x54fa87];return _0x5d73b5;};'use strict';var _=require('lodash');var util=require(_0x4a4d('0x0'));var logger=require(_0x4a4d('0x1'))(_0x4a4d('0x2'));var moment=require('moment');var BPromise=require(_0x4a4d('0x3'));var rp=require(_0x4a4d('0x4'));var fs=require('fs');var path=require(_0x4a4d('0x5'));var rimraf=require(_0x4a4d('0x6'));var config=require(_0x4a4d('0x7'));var attributes=require(_0x4a4d('0x8'));module['exports']=function(_0x5728b8,_0x22f2ce){return _0x5728b8[_0x4a4d('0x9')]('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 937aa4a..5072c7b 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 _0xe1b4=['message','FreshsalesConfiguration,\x20%s,\x20%s','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2a8755,_0x57376d){var _0xa6068e=function(_0x4549c3){while(--_0x4549c3){_0x2a8755['push'](_0x2a8755['shift']());}};_0xa6068e(++_0x57376d);}(_0xe1b4,0x13e));var _0x4e1b=function(_0x321cc3,_0xd7325c){_0x321cc3=_0x321cc3-0x0;var _0x5d4df2=_0xe1b4[_0x321cc3];return _0x5d4df2;};'use strict';var _=require('lodash');var util=require(_0x4e1b('0x0'));var moment=require('moment');var BPromise=require(_0x4e1b('0x1'));var rs=require(_0x4e1b('0x2'));var fs=require('fs');var Redis=require(_0x4e1b('0x3'));var db=require(_0x4e1b('0x4'))['db'];var utils=require(_0x4e1b('0x5'));var logger=require(_0x4e1b('0x6'))(_0x4e1b('0x7'));var config=require(_0x4e1b('0x8'));var jayson=require(_0x4e1b('0x9'));var client=jayson['client'][_0x4e1b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x350e24,_0x39d31a,_0x9b14c){return new BPromise(function(_0x216969,_0x1cd2a8){return client[_0x4e1b('0xb')](_0x350e24,_0x9b14c)['then'](function(_0x124425){logger[_0x4e1b('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x39d31a,_0x4e1b('0xd'));logger[_0x4e1b('0xe')](_0x4e1b('0xf'),_0x39d31a,_0x4e1b('0xd'),JSON['stringify'](_0x124425));if(_0x124425[_0x4e1b('0x10')]){if(_0x124425['error'][_0x4e1b('0x11')]===0x1f4){logger[_0x4e1b('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x39d31a,_0x124425['error']['message']);return _0x1cd2a8(_0x124425[_0x4e1b('0x10')][_0x4e1b('0x12')]);}logger[_0x4e1b('0x10')](_0x4e1b('0x13'),_0x39d31a,_0x124425['error'][_0x4e1b('0x12')]);return _0x216969(_0x124425[_0x4e1b('0x10')][_0x4e1b('0x12')]);}else{logger[_0x4e1b('0xc')](_0x4e1b('0x13'),_0x39d31a,'request\x20sent');_0x216969(_0x124425[_0x4e1b('0x14')]['message']);}})['catch'](function(_0x267b4d){logger['error'](_0x4e1b('0x13'),_0x39d31a,_0x267b4d);_0x1cd2a8(_0x267b4d);});});} \ No newline at end of file +var _0x8d03=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x1f42a4,_0x4e221f){var _0x4a6514=function(_0x55289f){while(--_0x55289f){_0x1f42a4['push'](_0x1f42a4['shift']());}};_0x4a6514(++_0x4e221f);}(_0x8d03,0x8c));var _0x38d0=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x8d03[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x38d0('0x0'));var util=require(_0x38d0('0x1'));var moment=require(_0x38d0('0x2'));var BPromise=require(_0x38d0('0x3'));var rs=require(_0x38d0('0x4'));var fs=require('fs');var Redis=require(_0x38d0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x38d0('0x6'));var logger=require(_0x38d0('0x7'))(_0x38d0('0x8'));var config=require('../../config/environment');var jayson=require(_0x38d0('0x9'));var client=jayson[_0x38d0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e48d6,_0x1004e2,_0x9819d5){return new BPromise(function(_0x45d5ce,_0x327199){return client['request'](_0x3e48d6,_0x9819d5)['then'](function(_0xe260dd){logger[_0x38d0('0xb')](_0x38d0('0xc'),_0x1004e2,_0x38d0('0xd'));logger[_0x38d0('0xe')](_0x38d0('0xf'),_0x1004e2,_0x38d0('0xd'),JSON['stringify'](_0xe260dd));if(_0xe260dd[_0x38d0('0x10')]){if(_0xe260dd[_0x38d0('0x10')][_0x38d0('0x11')]===0x1f4){logger[_0x38d0('0x10')](_0x38d0('0xc'),_0x1004e2,_0xe260dd[_0x38d0('0x10')][_0x38d0('0x12')]);return _0x327199(_0xe260dd[_0x38d0('0x10')]['message']);}logger[_0x38d0('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1004e2,_0xe260dd['error'][_0x38d0('0x12')]);return _0x45d5ce(_0xe260dd['error'][_0x38d0('0x12')]);}else{logger[_0x38d0('0xb')](_0x38d0('0xc'),_0x1004e2,_0x38d0('0xd'));_0x45d5ce(_0xe260dd['result'][_0x38d0('0x12')]);}})[_0x38d0('0x13')](function(_0x45162b){logger[_0x38d0('0x10')](_0x38d0('0xc'),_0x1004e2,_0x45162b);_0x327199(_0x45162b);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 35a354f..56c231c 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 _0x16e4=['isAuthenticated','index','get','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesField.controller'];(function(_0x332c1b,_0x28d711){var _0x21b49b=function(_0x3f00fd){while(--_0x3f00fd){_0x332c1b['push'](_0x332c1b['shift']());}};_0x21b49b(++_0x28d711);}(_0x16e4,0x97));var _0x416e=function(_0x38624e,_0x44b291){_0x38624e=_0x38624e-0x0;var _0xf92ea1=_0x16e4[_0x38624e];return _0xf92ea1;};'use strict';var multer=require(_0x416e('0x0'));var util=require(_0x416e('0x1'));var path=require(_0x416e('0x2'));var timeout=require(_0x416e('0x3'));var express=require(_0x416e('0x4'));var router=express[_0x416e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x416e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x416e('0x7'));var controller=require(_0x416e('0x8'));router['get']('/',auth[_0x416e('0x9')](),controller[_0x416e('0xa')]);router[_0x416e('0xb')](_0x416e('0xc'),auth[_0x416e('0x9')](),controller[_0x416e('0xd')]);router[_0x416e('0xe')]('/',auth[_0x416e('0x9')](),controller[_0x416e('0xf')]);router['put'](_0x416e('0xc'),auth['isAuthenticated'](),controller[_0x416e('0x10')]);router[_0x416e('0x11')](_0x416e('0xc'),auth['isAuthenticated'](),controller[_0x416e('0x12')]);module[_0x416e('0x13')]=router; \ No newline at end of file +var _0x1789=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','update','delete','/:id'];(function(_0x275f1a,_0x3c9c7d){var _0x5426fc=function(_0x3019e9){while(--_0x3019e9){_0x275f1a['push'](_0x275f1a['shift']());}};_0x5426fc(++_0x3c9c7d);}(_0x1789,0x92));var _0x9178=function(_0x530ddb,_0x3008f8){_0x530ddb=_0x530ddb-0x0;var _0x4fa295=_0x1789[_0x530ddb];return _0x4fa295;};'use strict';var multer=require(_0x9178('0x0'));var util=require(_0x9178('0x1'));var path=require(_0x9178('0x2'));var timeout=require('connect-timeout');var express=require(_0x9178('0x3'));var router=express[_0x9178('0x4')]();var fs_extra=require(_0x9178('0x5'));var auth=require(_0x9178('0x6'));var interaction=require(_0x9178('0x7'));var config=require('../../config/environment');var controller=require('./intFreshsalesField.controller');router[_0x9178('0x8')]('/',auth[_0x9178('0x9')](),controller[_0x9178('0xa')]);router[_0x9178('0x8')]('/:id',auth[_0x9178('0x9')](),controller[_0x9178('0xb')]);router[_0x9178('0xc')]('/',auth[_0x9178('0x9')](),controller['create']);router['put']('/:id',auth[_0x9178('0x9')](),controller[_0x9178('0xd')]);router[_0x9178('0xe')](_0x9178('0xf'),auth['isAuthenticated'](),controller[_0x9178('0x10')]);module[_0x9178('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index ba58a3b..d955a37 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 _0x8663=['exports','customVariable','keyValue','picklist','string','STRING','ENUM','variable','BOOLEAN','sequelize'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x8663,0x95));var _0x3866=function(_0x39572e,_0x3bff99){_0x39572e=_0x39572e-0x0;var _0x5102a7=_0x8663[_0x39572e];return _0x5102a7;};'use strict';var Sequelize=require(_0x3866('0x0'));module[_0x3866('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x3866('0x2'),_0x3866('0x3'),_0x3866('0x4')),'defaultValue':_0x3866('0x5')},'content':{'type':Sequelize[_0x3866('0x6')]},'key':{'type':Sequelize[_0x3866('0x6')]},'keyType':{'type':Sequelize[_0x3866('0x7')](_0x3866('0x5'),_0x3866('0x8'),_0x3866('0x2'))},'keyContent':{'type':Sequelize[_0x3866('0x6')]},'idField':{'type':Sequelize[_0x3866('0x6')]},'nameField':{'type':Sequelize[_0x3866('0x6')]},'customField':{'type':Sequelize[_0x3866('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3866('0x6')]}}; \ No newline at end of file +var _0xa959=['BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xa959,0x1d1));var _0x9a95=function(_0x2481c2,_0x198e94){_0x2481c2=_0x2481c2-0x0;var _0x4fd1bb=_0xa959[_0x2481c2];return _0x4fd1bb;};'use strict';var Sequelize=require(_0x9a95('0x0'));module['exports']={'type':{'type':Sequelize[_0x9a95('0x1')](_0x9a95('0x2'),_0x9a95('0x3'),_0x9a95('0x4'),_0x9a95('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x9a95('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9a95('0x1')](_0x9a95('0x2'),_0x9a95('0x3'),_0x9a95('0x4'))},'keyContent':{'type':Sequelize[_0x9a95('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9a95('0x6')]},'customField':{'type':Sequelize[_0x9a95('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9a95('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 87477c0..32dfe69 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 _0xedc5=['limit','set','apply','reject','destroy','then','sendStatus','stack','name','send','index','map','FreshsalesField','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','find','catch','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','json','offset','undefined','count'];(function(_0x46a45d,_0x268579){var _0x34b385=function(_0x57d8c8){while(--_0x57d8c8){_0x46a45d['push'](_0x46a45d['shift']());}};_0x34b385(++_0x268579);}(_0xedc5,0x100));var _0x5edc=function(_0x3fbb91,_0x5ec106){_0x3fbb91=_0x3fbb91-0x0;var _0x3eb213=_0xedc5[_0x3fbb91];return _0x3eb213;};'use strict';var emlformat=require(_0x5edc('0x0'));var rimraf=require(_0x5edc('0x1'));var zipdir=require(_0x5edc('0x2'));var jsonpatch=require(_0x5edc('0x3'));var rp=require(_0x5edc('0x4'));var moment=require(_0x5edc('0x5'));var BPromise=require(_0x5edc('0x6'));var Mustache=require(_0x5edc('0x7'));var util=require(_0x5edc('0x8'));var path=require(_0x5edc('0x9'));var sox=require(_0x5edc('0xa'));var csv=require(_0x5edc('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5edc('0xc'));var _=require(_0x5edc('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5edc('0xe'));var toCsv=require(_0x5edc('0xb'));var querystring=require(_0x5edc('0xf'));var Papa=require('papaparse');var Redis=require(_0x5edc('0x10'));var authService=require(_0x5edc('0x11'));var qs=require(_0x5edc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5edc('0x13'));var logger=require(_0x5edc('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x5edc('0x15'));var licenseUtil=require(_0x5edc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d2ada,_0x3a689c){_0x3a689c=_0x3a689c||0xcc;return function(_0x3dab00){if(_0x3dab00){return _0x5d2ada['sendStatus'](_0x3a689c);}return _0x5d2ada[_0x5edc('0x17')](_0x3a689c)['end']();};}function respondWithResult(_0x5cd50b,_0x310b12){_0x310b12=_0x310b12||0xc8;return function(_0x86aa87){if(_0x86aa87){return _0x5cd50b['status'](_0x310b12)[_0x5edc('0x18')](_0x86aa87);}};}function respondWithFilteredResult(_0x482872,_0x5f5231){return function(_0x8d39d2){if(_0x8d39d2){var _0x2d91ae=typeof _0x5f5231[_0x5edc('0x19')]==='undefined'&&typeof _0x5f5231['limit']===_0x5edc('0x1a');var _0x5b1963=_0x8d39d2[_0x5edc('0x1b')];var _0x43bf4e=_0x2d91ae?0x0:_0x5f5231[_0x5edc('0x19')];var _0x5739e7=_0x2d91ae?_0x8d39d2[_0x5edc('0x1b')]:_0x5f5231[_0x5edc('0x19')]+_0x5f5231[_0x5edc('0x1c')];var _0x2dd099;if(_0x5739e7>=_0x5b1963){_0x5739e7=_0x5b1963;_0x2dd099=0xc8;}else{_0x2dd099=0xce;}_0x482872[_0x5edc('0x17')](_0x2dd099);return _0x482872[_0x5edc('0x1d')]('Content-Range',_0x43bf4e+'-'+_0x5739e7+'/'+_0x5b1963)['json'](_0x8d39d2);}return null;};}function patchUpdates(_0x5797f9){return function(_0x3482b2){try{jsonpatch[_0x5edc('0x1e')](_0x3482b2,_0x5797f9,!![]);}catch(_0x4077db){return BPromise[_0x5edc('0x1f')](_0x4077db);}return _0x3482b2['save']();};}function saveUpdates(_0x1cfec3,_0x5a49f3){return function(_0x2fd46a){if(_0x2fd46a){return _0x2fd46a['update'](_0x1cfec3)['then'](function(_0xee9628){return _0xee9628;});}return null;};}function removeEntity(_0xf48596,_0x1db882){return function(_0x1b683c){if(_0x1b683c){return _0x1b683c[_0x5edc('0x20')]()[_0x5edc('0x21')](function(){_0xf48596[_0x5edc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ff3b1,_0x43d407){return function(_0x189978){if(!_0x189978){_0x3ff3b1[_0x5edc('0x22')](0x194);}return _0x189978;};}function handleError(_0x2ab4c8,_0x6b45e5){_0x6b45e5=_0x6b45e5||0x1f4;return function(_0x34c91c){logger['error'](_0x34c91c[_0x5edc('0x23')]);if(_0x34c91c[_0x5edc('0x24')]){delete _0x34c91c[_0x5edc('0x24')];}_0x2ab4c8[_0x5edc('0x17')](_0x6b45e5)[_0x5edc('0x25')](_0x34c91c);};}exports[_0x5edc('0x26')]=function(_0x292681,_0x1b2577){var _0x5144be={},_0x329d8f={},_0x58f0a1={'count':0x0,'rows':[]};var _0x351984=_[_0x5edc('0x27')](db[_0x5edc('0x28')][_0x5edc('0x29')],function(_0x5e617d){return{'name':_0x5e617d['fieldName'],'type':_0x5e617d['type'][_0x5edc('0x2a')]};});_0x329d8f[_0x5edc('0x2b')]=_['map'](_0x351984,_0x5edc('0x24'));_0x329d8f[_0x5edc('0x2c')]=_[_0x5edc('0x2d')](_0x292681[_0x5edc('0x2c')]);_0x329d8f[_0x5edc('0x2e')]=_[_0x5edc('0x2f')](_0x329d8f[_0x5edc('0x2b')],_0x329d8f['query']);_0x5144be[_0x5edc('0x30')]=_[_0x5edc('0x2f')](_0x329d8f['model'],qs['fields'](_0x292681[_0x5edc('0x2c')][_0x5edc('0x31')]));_0x5144be['attributes']=_0x5144be['attributes'][_0x5edc('0x32')]?_0x5144be[_0x5edc('0x30')]:_0x329d8f[_0x5edc('0x2b')];if(!_0x292681[_0x5edc('0x2c')][_0x5edc('0x33')](_0x5edc('0x34'))){_0x5144be[_0x5edc('0x1c')]=qs[_0x5edc('0x1c')](_0x292681[_0x5edc('0x2c')][_0x5edc('0x1c')]);_0x5144be[_0x5edc('0x19')]=qs['offset'](_0x292681[_0x5edc('0x2c')][_0x5edc('0x19')]);}_0x5144be[_0x5edc('0x35')]=qs[_0x5edc('0x36')](_0x292681['query'][_0x5edc('0x36')]);_0x5144be[_0x5edc('0x37')]=qs[_0x5edc('0x2e')](_['pick'](_0x292681[_0x5edc('0x2c')],_0x329d8f['filters']),_0x351984);if(_0x292681[_0x5edc('0x2c')][_0x5edc('0x38')]){_0x5144be[_0x5edc('0x37')]=_[_0x5edc('0x39')](_0x5144be[_0x5edc('0x37')],{'$or':_[_0x5edc('0x27')](_0x351984,function(_0x61c99b){if(_0x61c99b[_0x5edc('0x3a')]!==_0x5edc('0x3b')){var _0x3df3da={};_0x3df3da[_0x61c99b[_0x5edc('0x24')]]={'$like':'%'+_0x292681[_0x5edc('0x2c')][_0x5edc('0x38')]+'%'};return _0x3df3da;}})});}_0x5144be=_['merge']({},_0x5144be,_0x292681[_0x5edc('0x3c')]);var _0x8a29f9={'where':_0x5144be[_0x5edc('0x37')]};return db[_0x5edc('0x28')]['count'](_0x8a29f9)[_0x5edc('0x21')](function(_0x35c3f1){_0x58f0a1[_0x5edc('0x1b')]=_0x35c3f1;if(_0x292681[_0x5edc('0x2c')]['includeAll']){_0x5144be[_0x5edc('0x3d')]=[{'all':!![]}];}return db[_0x5edc('0x28')][_0x5edc('0x3e')](_0x5144be);})[_0x5edc('0x21')](function(_0x5179b5){_0x58f0a1[_0x5edc('0x3f')]=_0x5179b5;return _0x58f0a1;})['then'](respondWithFilteredResult(_0x1b2577,_0x5144be))['catch'](handleError(_0x1b2577,null));};exports[_0x5edc('0x40')]=function(_0x5dc7db,_0x560c12){var _0x2184e3={'raw':!![],'where':{'id':_0x5dc7db['params']['id']}},_0x65ec8c={};_0x65ec8c['model']=_[_0x5edc('0x2d')](db[_0x5edc('0x28')][_0x5edc('0x29')]);_0x65ec8c[_0x5edc('0x2c')]=_[_0x5edc('0x2d')](_0x5dc7db[_0x5edc('0x2c')]);_0x65ec8c['filters']=_[_0x5edc('0x2f')](_0x65ec8c[_0x5edc('0x2b')],_0x65ec8c['query']);_0x2184e3[_0x5edc('0x30')]=_[_0x5edc('0x2f')](_0x65ec8c[_0x5edc('0x2b')],qs['fields'](_0x5dc7db[_0x5edc('0x2c')][_0x5edc('0x31')]));_0x2184e3[_0x5edc('0x30')]=_0x2184e3[_0x5edc('0x30')][_0x5edc('0x32')]?_0x2184e3[_0x5edc('0x30')]:_0x65ec8c['model'];if(_0x5dc7db[_0x5edc('0x2c')]['includeAll']){_0x2184e3['include']=[{'all':!![]}];}_0x2184e3=_[_0x5edc('0x39')]({},_0x2184e3,_0x5dc7db[_0x5edc('0x3c')]);return db['FreshsalesField'][_0x5edc('0x41')](_0x2184e3)[_0x5edc('0x21')](handleEntityNotFound(_0x560c12,null))[_0x5edc('0x21')](respondWithResult(_0x560c12,null))[_0x5edc('0x42')](handleError(_0x560c12,null));};exports['create']=function(_0x1fde2d,_0x3f0035){return db[_0x5edc('0x28')][_0x5edc('0x43')](_0x1fde2d[_0x5edc('0x44')],{})[_0x5edc('0x21')](respondWithResult(_0x3f0035,0xc9))[_0x5edc('0x42')](handleError(_0x3f0035,null));};exports[_0x5edc('0x45')]=function(_0x4cbe23,_0x205f32){if(_0x4cbe23['body']['id']){delete _0x4cbe23['body']['id'];}return db['FreshsalesField'][_0x5edc('0x41')]({'where':{'id':_0x4cbe23[_0x5edc('0x46')]['id']}})[_0x5edc('0x21')](handleEntityNotFound(_0x205f32,null))[_0x5edc('0x21')](saveUpdates(_0x4cbe23[_0x5edc('0x44')],null))[_0x5edc('0x21')](respondWithResult(_0x205f32,null))['catch'](handleError(_0x205f32,null));};exports[_0x5edc('0x20')]=function(_0x279c00,_0x48c505){return db[_0x5edc('0x28')][_0x5edc('0x41')]({'where':{'id':_0x279c00[_0x5edc('0x46')]['id']}})[_0x5edc('0x21')](handleEntityNotFound(_0x48c505,null))[_0x5edc('0x21')](removeEntity(_0x48c505,null))[_0x5edc('0x42')](handleError(_0x48c505,null));}; \ No newline at end of file +var _0x8ead=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','destroy','rimraf','bluebird','mustache','util','path','to-csv','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','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields'];(function(_0x2af642,_0x519c58){var _0x2f807c=function(_0x25888b){while(--_0x25888b){_0x2af642['push'](_0x2af642['shift']());}};_0x2f807c(++_0x519c58);}(_0x8ead,0xb3));var _0xd8ea=function(_0x2d6593,_0x57e74a){_0x2d6593=_0x2d6593-0x0;var _0x1b2a82=_0x8ead[_0x2d6593];return _0x1b2a82;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd8ea('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd8ea('0x1'));var Mustache=require(_0xd8ea('0x2'));var util=require(_0xd8ea('0x3'));var path=require(_0xd8ea('0x4'));var sox=require('sox');var csv=require(_0xd8ea('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8ea('0x6'));var _=require(_0xd8ea('0x7'));var squel=require(_0xd8ea('0x8'));var crypto=require(_0xd8ea('0x9'));var jsforce=require(_0xd8ea('0xa'));var deskjs=require(_0xd8ea('0xb'));var toCsv=require(_0xd8ea('0x5'));var querystring=require(_0xd8ea('0xc'));var Papa=require(_0xd8ea('0xd'));var Redis=require(_0xd8ea('0xe'));var authService=require(_0xd8ea('0xf'));var qs=require(_0xd8ea('0x10'));var as=require(_0xd8ea('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd8ea('0x12'))('api');var utils=require(_0xd8ea('0x13'));var config=require(_0xd8ea('0x14'));var licenseUtil=require(_0xd8ea('0x15'));var db=require(_0xd8ea('0x16'))['db'];function respondWithStatusCode(_0xe4995c,_0x223798){_0x223798=_0x223798||0xcc;return function(_0x252a98){if(_0x252a98){return _0xe4995c['sendStatus'](_0x223798);}return _0xe4995c[_0xd8ea('0x17')](_0x223798)[_0xd8ea('0x18')]();};}function respondWithResult(_0x551155,_0x9665e7){_0x9665e7=_0x9665e7||0xc8;return function(_0x1f2d32){if(_0x1f2d32){return _0x551155[_0xd8ea('0x17')](_0x9665e7)['json'](_0x1f2d32);}};}function respondWithFilteredResult(_0x36c2ef,_0x5bec15){return function(_0x4a2bf5){if(_0x4a2bf5){var _0xd69c9a=typeof _0x5bec15[_0xd8ea('0x19')]==='undefined'&&typeof _0x5bec15[_0xd8ea('0x1a')]===_0xd8ea('0x1b');var _0xdff3aa=_0x4a2bf5[_0xd8ea('0x1c')];var _0x6d5903=_0xd69c9a?0x0:_0x5bec15[_0xd8ea('0x19')];var _0x37df48=_0xd69c9a?_0x4a2bf5[_0xd8ea('0x1c')]:_0x5bec15[_0xd8ea('0x19')]+_0x5bec15[_0xd8ea('0x1a')];var _0x1c91c9;if(_0x37df48>=_0xdff3aa){_0x37df48=_0xdff3aa;_0x1c91c9=0xc8;}else{_0x1c91c9=0xce;}_0x36c2ef['status'](_0x1c91c9);return _0x36c2ef[_0xd8ea('0x1d')](_0xd8ea('0x1e'),_0x6d5903+'-'+_0x37df48+'/'+_0xdff3aa)[_0xd8ea('0x1f')](_0x4a2bf5);}return null;};}function patchUpdates(_0xe46c25){return function(_0x5dcdf0){try{jsonpatch[_0xd8ea('0x20')](_0x5dcdf0,_0xe46c25,!![]);}catch(_0x186749){return BPromise[_0xd8ea('0x21')](_0x186749);}return _0x5dcdf0[_0xd8ea('0x22')]();};}function saveUpdates(_0x1f6b97,_0x4ca504){return function(_0x333e4a){if(_0x333e4a){return _0x333e4a[_0xd8ea('0x23')](_0x1f6b97)[_0xd8ea('0x24')](function(_0x372beb){return _0x372beb;});}return null;};}function removeEntity(_0x289986,_0x3f8108){return function(_0x33f86a){if(_0x33f86a){return _0x33f86a['destroy']()['then'](function(){_0x289986[_0xd8ea('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34de9e,_0x3624c7){return function(_0x42e518){if(!_0x42e518){_0x34de9e[_0xd8ea('0x25')](0x194);}return _0x42e518;};}function handleError(_0x1291cd,_0xc03af6){_0xc03af6=_0xc03af6||0x1f4;return function(_0x4869a5){logger[_0xd8ea('0x26')](_0x4869a5[_0xd8ea('0x27')]);if(_0x4869a5[_0xd8ea('0x28')]){delete _0x4869a5['name'];}_0x1291cd[_0xd8ea('0x17')](_0xc03af6)[_0xd8ea('0x29')](_0x4869a5);};}exports[_0xd8ea('0x2a')]=function(_0x2c28ee,_0x237508){var _0x1e5713={},_0xfefcec={},_0x41c0a2={'count':0x0,'rows':[]};var _0xbb8d77=_[_0xd8ea('0x2b')](db[_0xd8ea('0x2c')][_0xd8ea('0x2d')],function(_0x1d783c){return{'name':_0x1d783c[_0xd8ea('0x2e')],'type':_0x1d783c['type'][_0xd8ea('0x2f')]};});_0xfefcec[_0xd8ea('0x30')]=_[_0xd8ea('0x2b')](_0xbb8d77,_0xd8ea('0x28'));_0xfefcec[_0xd8ea('0x31')]=_[_0xd8ea('0x32')](_0x2c28ee[_0xd8ea('0x31')]);_0xfefcec[_0xd8ea('0x33')]=_['intersection'](_0xfefcec[_0xd8ea('0x30')],_0xfefcec[_0xd8ea('0x31')]);_0x1e5713[_0xd8ea('0x34')]=_[_0xd8ea('0x35')](_0xfefcec['model'],qs['fields'](_0x2c28ee[_0xd8ea('0x31')][_0xd8ea('0x36')]));_0x1e5713[_0xd8ea('0x34')]=_0x1e5713[_0xd8ea('0x34')][_0xd8ea('0x37')]?_0x1e5713[_0xd8ea('0x34')]:_0xfefcec['model'];if(!_0x2c28ee[_0xd8ea('0x31')][_0xd8ea('0x38')](_0xd8ea('0x39'))){_0x1e5713['limit']=qs[_0xd8ea('0x1a')](_0x2c28ee[_0xd8ea('0x31')][_0xd8ea('0x1a')]);_0x1e5713[_0xd8ea('0x19')]=qs[_0xd8ea('0x19')](_0x2c28ee[_0xd8ea('0x31')]['offset']);}_0x1e5713[_0xd8ea('0x3a')]=qs[_0xd8ea('0x3b')](_0x2c28ee[_0xd8ea('0x31')]['sort']);_0x1e5713[_0xd8ea('0x3c')]=qs[_0xd8ea('0x33')](_[_0xd8ea('0x3d')](_0x2c28ee[_0xd8ea('0x31')],_0xfefcec[_0xd8ea('0x33')]),_0xbb8d77);if(_0x2c28ee[_0xd8ea('0x31')][_0xd8ea('0x3e')]){_0x1e5713[_0xd8ea('0x3c')]=_[_0xd8ea('0x3f')](_0x1e5713['where'],{'$or':_['map'](_0xbb8d77,function(_0x118962){if(_0x118962[_0xd8ea('0x40')]!==_0xd8ea('0x41')){var _0x3bfe1c={};_0x3bfe1c[_0x118962[_0xd8ea('0x28')]]={'$like':'%'+_0x2c28ee[_0xd8ea('0x31')][_0xd8ea('0x3e')]+'%'};return _0x3bfe1c;}})});}_0x1e5713=_['merge']({},_0x1e5713,_0x2c28ee[_0xd8ea('0x42')]);var _0x46dc28={'where':_0x1e5713[_0xd8ea('0x3c')]};return db['FreshsalesField'][_0xd8ea('0x1c')](_0x46dc28)[_0xd8ea('0x24')](function(_0x6ee509){_0x41c0a2[_0xd8ea('0x1c')]=_0x6ee509;if(_0x2c28ee[_0xd8ea('0x31')]['includeAll']){_0x1e5713['include']=[{'all':!![]}];}return db[_0xd8ea('0x2c')][_0xd8ea('0x43')](_0x1e5713);})['then'](function(_0x175934){_0x41c0a2[_0xd8ea('0x44')]=_0x175934;return _0x41c0a2;})[_0xd8ea('0x24')](respondWithFilteredResult(_0x237508,_0x1e5713))[_0xd8ea('0x45')](handleError(_0x237508,null));};exports[_0xd8ea('0x46')]=function(_0x56d98d,_0x18ff08){var _0x113d45={'raw':!![],'where':{'id':_0x56d98d[_0xd8ea('0x47')]['id']}},_0x5e54ef={};_0x5e54ef[_0xd8ea('0x30')]=_[_0xd8ea('0x32')](db[_0xd8ea('0x2c')]['rawAttributes']);_0x5e54ef[_0xd8ea('0x31')]=_[_0xd8ea('0x32')](_0x56d98d[_0xd8ea('0x31')]);_0x5e54ef[_0xd8ea('0x33')]=_[_0xd8ea('0x35')](_0x5e54ef[_0xd8ea('0x30')],_0x5e54ef[_0xd8ea('0x31')]);_0x113d45[_0xd8ea('0x34')]=_[_0xd8ea('0x35')](_0x5e54ef[_0xd8ea('0x30')],qs[_0xd8ea('0x36')](_0x56d98d[_0xd8ea('0x31')][_0xd8ea('0x36')]));_0x113d45[_0xd8ea('0x34')]=_0x113d45[_0xd8ea('0x34')][_0xd8ea('0x37')]?_0x113d45[_0xd8ea('0x34')]:_0x5e54ef[_0xd8ea('0x30')];if(_0x56d98d[_0xd8ea('0x31')][_0xd8ea('0x48')]){_0x113d45[_0xd8ea('0x49')]=[{'all':!![]}];}_0x113d45=_['merge']({},_0x113d45,_0x56d98d['options']);return db[_0xd8ea('0x2c')][_0xd8ea('0x4a')](_0x113d45)[_0xd8ea('0x24')](handleEntityNotFound(_0x18ff08,null))[_0xd8ea('0x24')](respondWithResult(_0x18ff08,null))[_0xd8ea('0x45')](handleError(_0x18ff08,null));};exports[_0xd8ea('0x4b')]=function(_0x3edcc3,_0x35e9d3){return db[_0xd8ea('0x2c')][_0xd8ea('0x4b')](_0x3edcc3[_0xd8ea('0x4c')],{})[_0xd8ea('0x24')](respondWithResult(_0x35e9d3,0xc9))['catch'](handleError(_0x35e9d3,null));};exports[_0xd8ea('0x23')]=function(_0x201a87,_0x5e080f){if(_0x201a87[_0xd8ea('0x4c')]['id']){delete _0x201a87[_0xd8ea('0x4c')]['id'];}return db[_0xd8ea('0x2c')][_0xd8ea('0x4a')]({'where':{'id':_0x201a87['params']['id']}})[_0xd8ea('0x24')](handleEntityNotFound(_0x5e080f,null))[_0xd8ea('0x24')](saveUpdates(_0x201a87['body'],null))[_0xd8ea('0x24')](respondWithResult(_0x5e080f,null))[_0xd8ea('0x45')](handleError(_0x5e080f,null));};exports[_0xd8ea('0x4d')]=function(_0x1083d2,_0x40bb45){return db[_0xd8ea('0x2c')][_0xd8ea('0x4a')]({'where':{'id':_0x1083d2['params']['id']}})[_0xd8ea('0x24')](handleEntityNotFound(_0x40bb45,null))['then'](removeEntity(_0x40bb45,null))[_0xd8ea('0x45')](handleError(_0x40bb45,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index b88f85e..3665e39 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 _0x9582=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','FieldId','lodash'];(function(_0x3553b8,_0x226453){var _0x150423=function(_0x27e2e2){while(--_0x27e2e2){_0x3553b8['push'](_0x3553b8['shift']());}};_0x150423(++_0x226453);}(_0x9582,0x95));var _0x2958=function(_0x234837,_0x527b3d){_0x234837=_0x234837-0x0;var _0x2db009=_0x9582[_0x234837];return _0x2db009;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var logger=require(_0x2958('0x2'))(_0x2958('0x3'));var moment=require(_0x2958('0x4'));var BPromise=require(_0x2958('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2958('0x6'));var rimraf=require(_0x2958('0x7'));var config=require(_0x2958('0x8'));var attributes=require(_0x2958('0x9'));module[_0x2958('0xa')]=function(_0xbde128,_0x88ffaa){return _0xbde128[_0x2958('0xb')](_0x2958('0xc'),attributes,{'tableName':_0x2958('0xd'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':['idField',_0x2958('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x46c1=['api','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','idField','util','../../config/logger'];(function(_0x5ef639,_0x535c66){var _0x13216d=function(_0x5a3452){while(--_0x5a3452){_0x5ef639['push'](_0x5ef639['shift']());}};_0x13216d(++_0x535c66);}(_0x46c1,0x7c));var _0x146c=function(_0x363c5d,_0x4ac556){_0x363c5d=_0x363c5d-0x0;var _0x3e4017=_0x46c1[_0x363c5d];return _0x3e4017;};'use strict';var _=require('lodash');var util=require(_0x146c('0x0'));var logger=require(_0x146c('0x1'))(_0x146c('0x2'));var moment=require(_0x146c('0x3'));var BPromise=require(_0x146c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x146c('0x5'));var rimraf=require(_0x146c('0x6'));var config=require(_0x146c('0x7'));var attributes=require(_0x146c('0x8'));module[_0x146c('0x9')]=function(_0x49f94f,_0x5ae2f3){return _0x49f94f[_0x146c('0xa')](_0x146c('0xb'),attributes,{'tableName':_0x146c('0xc'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x146c('0xd'),'FieldId'],'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 3b2940e..d5da184 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 _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x2c13c3,_0x1e3c64){_0x2c13c3=_0x2c13c3-0x0;var _0xd88add=_0x3f8a[_0x2c13c3];return _0xd88add;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('FreshsalesField,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});} \ No newline at end of file +var _0x1261=['then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\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(_0x26bf3,_0x2707a9){var _0x48bb65=function(_0x542be){while(--_0x542be){_0x26bf3['push'](_0x26bf3['shift']());}};_0x48bb65(++_0x2707a9);}(_0x1261,0x144));var _0x1126=function(_0x15cef4,_0x448b97){_0x15cef4=_0x15cef4-0x0;var _0x384430=_0x1261[_0x15cef4];return _0x384430;};'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')]('FreshsalesField,\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 diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index fd39b16..0cbbfc8 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 _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(_0x5583c3,_0x1a02a1){var _0x5c02d1=function(_0x1b1d2b){while(--_0x1b1d2b){_0x5583c3['push'](_0x5583c3['shift']());}};_0x5c02d1(++_0x1a02a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3183a9,_0x377454){var _0x26c83=function(_0x548540){while(--_0x548540){_0x3183a9['push'](_0x3183a9['shift']());}};_0x26c83(++_0x377454);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 f7186d6..1d0f1a2 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 _0xb2ed=['newTab','sequelize','exports','STRING','username','ENUM','integrationTab'];(function(_0x396164,_0x4ccd10){var _0x561399=function(_0x5c08c9){while(--_0x5c08c9){_0x396164['push'](_0x396164['shift']());}};_0x561399(++_0x4ccd10);}(_0xb2ed,0x86));var _0xdb2e=function(_0x30a31e,_0x31f766){_0x30a31e=_0x30a31e-0x0;var _0x170879=_0xb2ed[_0x30a31e];return _0x170879;};'use strict';var Sequelize=require(_0xdb2e('0x0'));module[_0xdb2e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdb2e('0x2')]},'username':{'type':Sequelize[_0xdb2e('0x2')],'unique':_0xdb2e('0x3')},'remoteUri':{'type':Sequelize[_0xdb2e('0x2')]},'password':{'type':Sequelize[_0xdb2e('0x2')]},'clientId':{'type':Sequelize[_0xdb2e('0x2')]},'clientSecret':{'type':Sequelize[_0xdb2e('0x2')]},'securityToken':{'type':Sequelize[_0xdb2e('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xdb2e('0x4')](_0xdb2e('0x5'),_0xdb2e('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x5c21=['exports','STRING','integrationTab'];(function(_0x5ccf36,_0x599f21){var _0x3e28c0=function(_0x1b2b3a){while(--_0x1b2b3a){_0x5ccf36['push'](_0x5ccf36['shift']());}};_0x3e28c0(++_0x599f21);}(_0x5c21,0x90));var _0x15c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c21[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x15c2('0x0')]={'name':{'type':Sequelize[_0x15c2('0x1')]},'description':{'type':Sequelize[_0x15c2('0x1')]},'username':{'type':Sequelize[_0x15c2('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x15c2('0x1')]},'password':{'type':Sequelize[_0x15c2('0x1')]},'clientId':{'type':Sequelize[_0x15c2('0x1')]},'clientSecret':{'type':Sequelize[_0x15c2('0x1')]},'securityToken':{'type':Sequelize[_0x15c2('0x1')]},'serverUrl':{'type':Sequelize[_0x15c2('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x15c2('0x2'),'newTab'),'defaultValue':_0x15c2('0x2')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 78c4760..951eba7 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 _0xe01e=['pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','body','getConfigurations','SalesforceConfiguration','addConfiguration','findOne','Subjects','channel','Descriptions','getDescriptions','SalesforceField','remoteUri','clientId','clientSecret','username','password','slice','lastIndexOf','Connection','securityToken','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','int','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','true','False','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','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','limit','undefined','count','Content-Range','update','then','destroy','stack','name','send','index','SalesforceAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where'];(function(_0x492221,_0x9e2521){var _0x398bf9=function(_0x303c5b){while(--_0x303c5b){_0x492221['push'](_0x492221['shift']());}};_0x398bf9(++_0x9e2521);}(_0xe01e,0x1a7));var _0xee01=function(_0x38a536,_0x6b7015){_0x38a536=_0x38a536-0x0;var _0x1f286d=_0xe01e[_0x38a536];return _0x1f286d;};'use strict';var emlformat=require(_0xee01('0x0'));var rimraf=require(_0xee01('0x1'));var zipdir=require(_0xee01('0x2'));var jsonpatch=require(_0xee01('0x3'));var rp=require(_0xee01('0x4'));var moment=require(_0xee01('0x5'));var BPromise=require(_0xee01('0x6'));var Mustache=require(_0xee01('0x7'));var util=require(_0xee01('0x8'));var path=require(_0xee01('0x9'));var sox=require('sox');var csv=require(_0xee01('0xa'));var ejs=require(_0xee01('0xb'));var fs=require('fs');var fs_extra=require(_0xee01('0xc'));var _=require(_0xee01('0xd'));var squel=require(_0xee01('0xe'));var crypto=require(_0xee01('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xee01('0x10'));var toCsv=require(_0xee01('0xa'));var querystring=require(_0xee01('0x11'));var Papa=require('papaparse');var Redis=require(_0xee01('0x12'));var authService=require(_0xee01('0x13'));var qs=require(_0xee01('0x14'));var as=require(_0xee01('0x15'));var hardwareService=require(_0xee01('0x16'));var logger=require(_0xee01('0x17'))(_0xee01('0x18'));var utils=require(_0xee01('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xee01('0x1a'));var db=require(_0xee01('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3ee516,_0x48dc39){_0x48dc39=_0x48dc39||0xcc;return function(_0x1c5c54){if(_0x1c5c54){return _0x3ee516[_0xee01('0x1c')](_0x48dc39);}return _0x3ee516[_0xee01('0x1d')](_0x48dc39)[_0xee01('0x1e')]();};}function respondWithResult(_0x2901ec,_0x38e5a4){_0x38e5a4=_0x38e5a4||0xc8;return function(_0xe69ca8){if(_0xe69ca8){return _0x2901ec[_0xee01('0x1d')](_0x38e5a4)[_0xee01('0x1f')](_0xe69ca8);}};}function respondWithFilteredResult(_0x2b395f,_0x152fa8){return function(_0x783201){if(_0x783201){var _0x270e02=typeof _0x152fa8['offset']==='undefined'&&typeof _0x152fa8[_0xee01('0x20')]===_0xee01('0x21');var _0x19133e=_0x783201[_0xee01('0x22')];var _0x62757e=_0x270e02?0x0:_0x152fa8['offset'];var _0x37db04=_0x270e02?_0x783201[_0xee01('0x22')]:_0x152fa8['offset']+_0x152fa8[_0xee01('0x20')];var _0x264168;if(_0x37db04>=_0x19133e){_0x37db04=_0x19133e;_0x264168=0xc8;}else{_0x264168=0xce;}_0x2b395f[_0xee01('0x1d')](_0x264168);return _0x2b395f['set'](_0xee01('0x23'),_0x62757e+'-'+_0x37db04+'/'+_0x19133e)[_0xee01('0x1f')](_0x783201);}return null;};}function patchUpdates(_0x3cc39d){return function(_0x39f029){try{jsonpatch['apply'](_0x39f029,_0x3cc39d,!![]);}catch(_0x500d2f){return BPromise['reject'](_0x500d2f);}return _0x39f029['save']();};}function saveUpdates(_0x2bde30,_0x2507ae){return function(_0x498d96){if(_0x498d96){return _0x498d96[_0xee01('0x24')](_0x2bde30)[_0xee01('0x25')](function(_0x273e74){return _0x273e74;});}return null;};}function removeEntity(_0x55f262,_0x10bc24){return function(_0x57c9e0){if(_0x57c9e0){return _0x57c9e0[_0xee01('0x26')]()[_0xee01('0x25')](function(){_0x55f262[_0xee01('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1804cb,_0x5852db){return function(_0x690c38){if(!_0x690c38){_0x1804cb[_0xee01('0x1c')](0x194);}return _0x690c38;};}function handleError(_0x3c9eff,_0x122608){_0x122608=_0x122608||0x1f4;return function(_0xae3e3a){logger['error'](_0xae3e3a[_0xee01('0x27')]);if(_0xae3e3a['name']){delete _0xae3e3a[_0xee01('0x28')];}_0x3c9eff['status'](_0x122608)[_0xee01('0x29')](_0xae3e3a);};}exports[_0xee01('0x2a')]=function(_0x1d8cb6,_0x2129c2){var _0x40f715={},_0x4c229e={},_0x5ad63a={'count':0x0,'rows':[]};var _0x25779b=_['map'](db[_0xee01('0x2b')][_0xee01('0x2c')],function(_0x261905){return{'name':_0x261905['fieldName'],'type':_0x261905[_0xee01('0x2d')][_0xee01('0x2e')]};});_0x4c229e[_0xee01('0x2f')]=_[_0xee01('0x30')](_0x25779b,'name');_0x4c229e[_0xee01('0x31')]=_[_0xee01('0x32')](_0x1d8cb6[_0xee01('0x31')]);_0x4c229e[_0xee01('0x33')]=_[_0xee01('0x34')](_0x4c229e[_0xee01('0x2f')],_0x4c229e[_0xee01('0x31')]);_0x40f715[_0xee01('0x35')]=_[_0xee01('0x34')](_0x4c229e[_0xee01('0x2f')],qs[_0xee01('0x36')](_0x1d8cb6[_0xee01('0x31')][_0xee01('0x36')]));_0x40f715[_0xee01('0x35')]=_0x40f715[_0xee01('0x35')][_0xee01('0x37')]?_0x40f715['attributes']:_0x4c229e[_0xee01('0x2f')];if(!_0x1d8cb6['query'][_0xee01('0x38')]('nolimit')){_0x40f715[_0xee01('0x20')]=qs[_0xee01('0x20')](_0x1d8cb6[_0xee01('0x31')]['limit']);_0x40f715[_0xee01('0x39')]=qs[_0xee01('0x39')](_0x1d8cb6['query'][_0xee01('0x39')]);}_0x40f715[_0xee01('0x3a')]=qs['sort'](_0x1d8cb6[_0xee01('0x31')][_0xee01('0x3b')]);_0x40f715[_0xee01('0x3c')]=qs[_0xee01('0x33')](_[_0xee01('0x3d')](_0x1d8cb6['query'],_0x4c229e[_0xee01('0x33')]),_0x25779b);if(_0x1d8cb6[_0xee01('0x31')][_0xee01('0x3e')]){_0x40f715[_0xee01('0x3c')]=_[_0xee01('0x3f')](_0x40f715['where'],{'$or':_['map'](_0x25779b,function(_0x2e18cb){if(_0x2e18cb[_0xee01('0x2d')]!==_0xee01('0x40')){var _0x11ee7f={};_0x11ee7f[_0x2e18cb[_0xee01('0x28')]]={'$like':'%'+_0x1d8cb6[_0xee01('0x31')][_0xee01('0x3e')]+'%'};return _0x11ee7f;}})});}_0x40f715=_['merge']({},_0x40f715,_0x1d8cb6[_0xee01('0x41')]);var _0xe3006e={'where':_0x40f715['where']};return db[_0xee01('0x2b')]['count'](_0xe3006e)[_0xee01('0x25')](function(_0x1facc4){_0x5ad63a['count']=_0x1facc4;if(_0x1d8cb6[_0xee01('0x31')][_0xee01('0x42')]){_0x40f715[_0xee01('0x43')]=[{'all':!![]}];}return db[_0xee01('0x2b')][_0xee01('0x44')](_0x40f715);})[_0xee01('0x25')](function(_0xdc1b74){_0x5ad63a['rows']=_0xdc1b74;return _0x5ad63a;})[_0xee01('0x25')](respondWithFilteredResult(_0x2129c2,_0x40f715))['catch'](handleError(_0x2129c2,null));};exports[_0xee01('0x45')]=function(_0x481a47,_0x627806){var _0x562055={'raw':![],'where':{'id':_0x481a47[_0xee01('0x46')]['id']}},_0x1dae4a={};_0x1dae4a[_0xee01('0x2f')]=_[_0xee01('0x32')](db[_0xee01('0x2b')][_0xee01('0x2c')]);_0x1dae4a[_0xee01('0x31')]=_[_0xee01('0x32')](_0x481a47[_0xee01('0x31')]);_0x1dae4a[_0xee01('0x33')]=_[_0xee01('0x34')](_0x1dae4a['model'],_0x1dae4a['query']);_0x562055['attributes']=_[_0xee01('0x34')](_0x1dae4a[_0xee01('0x2f')],qs['fields'](_0x481a47[_0xee01('0x31')]['fields']));_0x562055[_0xee01('0x35')]=_0x562055['attributes'][_0xee01('0x37')]?_0x562055[_0xee01('0x35')]:_0x1dae4a['model'];if(_0x481a47[_0xee01('0x31')]['includeAll']){_0x562055[_0xee01('0x43')]=[{'all':!![]}];}_0x562055=_[_0xee01('0x3f')]({},_0x562055,_0x481a47[_0xee01('0x41')]);return db[_0xee01('0x2b')][_0xee01('0x47')](_0x562055)[_0xee01('0x25')](handleEntityNotFound(_0x627806,null))[_0xee01('0x25')](respondWithResult(_0x627806,null))[_0xee01('0x48')](handleError(_0x627806,null));};exports[_0xee01('0x49')]=function(_0x203f72,_0x10e57b){return db[_0xee01('0x2b')][_0xee01('0x49')](_0x203f72['body'],{})[_0xee01('0x25')](respondWithResult(_0x10e57b,0xc9))[_0xee01('0x48')](handleError(_0x10e57b,null));};exports[_0xee01('0x24')]=function(_0x37bf7d,_0x341223){if(_0x37bf7d['body']['id']){delete _0x37bf7d[_0xee01('0x4a')]['id'];}return db[_0xee01('0x2b')]['find']({'where':{'id':_0x37bf7d[_0xee01('0x46')]['id']}})[_0xee01('0x25')](handleEntityNotFound(_0x341223,null))[_0xee01('0x25')](saveUpdates(_0x37bf7d['body'],null))[_0xee01('0x25')](respondWithResult(_0x341223,null))[_0xee01('0x48')](handleError(_0x341223,null));};exports[_0xee01('0x26')]=function(_0x2b1680,_0x3cb7fa){return db[_0xee01('0x2b')]['find']({'where':{'id':_0x2b1680[_0xee01('0x46')]['id']}})['then'](handleEntityNotFound(_0x3cb7fa,null))[_0xee01('0x25')](removeEntity(_0x3cb7fa,null))[_0xee01('0x48')](handleError(_0x3cb7fa,null));};exports[_0xee01('0x4b')]=function(_0x8faccd,_0x1b8767,_0x3cc54e){var _0x3b033a={};var _0x2fd98f={};var _0x4dfb56;var _0x5156a0;return db['SalesforceAccount']['findOne']({'where':{'id':_0x8faccd['params']['id']}})[_0xee01('0x25')](handleEntityNotFound(_0x1b8767,null))[_0xee01('0x25')](function(_0x38e082){if(_0x38e082){_0x4dfb56=_0x38e082;_0x2fd98f[_0xee01('0x2f')]=_[_0xee01('0x32')](db[_0xee01('0x4c')][_0xee01('0x2c')]);_0x2fd98f['query']=_[_0xee01('0x32')](_0x8faccd['query']);_0x2fd98f[_0xee01('0x33')]=_[_0xee01('0x34')](_0x2fd98f[_0xee01('0x2f')],_0x2fd98f[_0xee01('0x31')]);_0x3b033a[_0xee01('0x35')]=_[_0xee01('0x34')](_0x2fd98f[_0xee01('0x2f')],qs[_0xee01('0x36')](_0x8faccd[_0xee01('0x31')][_0xee01('0x36')]));_0x3b033a[_0xee01('0x35')]=_0x3b033a[_0xee01('0x35')]['length']?_0x3b033a[_0xee01('0x35')]:_0x2fd98f[_0xee01('0x2f')];_0x3b033a['order']=qs[_0xee01('0x3b')](_0x8faccd[_0xee01('0x31')][_0xee01('0x3b')]);_0x3b033a[_0xee01('0x3c')]=qs[_0xee01('0x33')](_[_0xee01('0x3d')](_0x8faccd[_0xee01('0x31')],_0x2fd98f[_0xee01('0x33')]));if(_0x8faccd[_0xee01('0x31')]['filter']){_0x3b033a['where']=_[_0xee01('0x3f')](_0x3b033a[_0xee01('0x3c')],{'$or':_[_0xee01('0x30')](_0x3b033a['attributes'],function(_0x23f425){var _0x31a3c7={};_0x31a3c7[_0x23f425]={'$like':'%'+_0x8faccd['query'][_0xee01('0x3e')]+'%'};return _0x31a3c7;})});}_0x3b033a=_['merge']({},_0x3b033a,_0x8faccd[_0xee01('0x41')]);return _0x4dfb56[_0xee01('0x4b')](_0x3b033a);}})[_0xee01('0x25')](function(_0x249cc6){if(_0x249cc6){_0x5156a0=_0x249cc6[_0xee01('0x37')];if(!_0x8faccd[_0xee01('0x31')]['hasOwnProperty']('nolimit')){_0x3b033a['limit']=qs[_0xee01('0x20')](_0x8faccd[_0xee01('0x31')][_0xee01('0x20')]);_0x3b033a[_0xee01('0x39')]=qs[_0xee01('0x39')](_0x8faccd[_0xee01('0x31')][_0xee01('0x39')]);}return _0x4dfb56['getConfigurations'](_0x3b033a);}})[_0xee01('0x25')](function(_0x59cba3){if(_0x59cba3){return _0x59cba3?{'count':_0x5156a0,'rows':_0x59cba3}:null;}})[_0xee01('0x25')](respondWithResult(_0x1b8767,null))[_0xee01('0x48')](handleError(_0x1b8767,null));};exports[_0xee01('0x4d')]=function(_0xe694b1,_0xf2ee7c,_0x58a2d0){if(_0xe694b1[_0xee01('0x4a')]['id']){delete _0xe694b1[_0xee01('0x4a')]['id'];}return db['SalesforceAccount'][_0xee01('0x4e')]({'where':{'id':_0xe694b1[_0xee01('0x46')]['id']}})[_0xee01('0x25')](handleEntityNotFound(_0xf2ee7c,null))[_0xee01('0x25')](function(_0x17dbfb){if(_0x17dbfb){_0xe694b1[_0xee01('0x4a')]['AccountId']=_0x17dbfb['id'];_0xe694b1[_0xee01('0x4a')][_0xee01('0x4f')]=integrations['getSubjects'](_0xe694b1[_0xee01('0x4a')][_0xee01('0x50')],_0xe694b1[_0xee01('0x4a')][_0xee01('0x2d')]);_0xe694b1[_0xee01('0x4a')][_0xee01('0x51')]=integrations[_0xee01('0x52')](_0xe694b1[_0xee01('0x4a')][_0xee01('0x50')],_0xe694b1[_0xee01('0x4a')][_0xee01('0x2d')]);return db[_0xee01('0x4c')]['create'](_0xe694b1['body'],{'include':[{'model':db[_0xee01('0x53')],'as':'Subjects'},{'model':db['SalesforceField'],'as':_0xee01('0x51')}]});}return null;})['then'](respondWithResult(_0xf2ee7c,null))[_0xee01('0x48')](handleError(_0xf2ee7c,null));};exports['getFields']=function(_0x1ed2a7,_0x1c5525,_0x301e46){var _0x6c0d03;var _0x28569d='';var _0x520707='Task';return db[_0xee01('0x2b')][_0xee01('0x4e')]({'where':{'id':_0x1ed2a7[_0xee01('0x46')]['id']},'attributes':['id',_0xee01('0x54'),_0xee01('0x55'),_0xee01('0x56'),_0xee01('0x57'),_0xee01('0x58'),'securityToken']})[_0xee01('0x25')](handleEntityNotFound(_0x1c5525,null))['then'](function(_0x2a30d6){if(_0x2a30d6){_0x28569d=_0x2a30d6[_0xee01('0x54')];var _0x1767a2=_0x28569d[_0xee01('0x59')](-0x1);if(_0x1767a2==='/'){_0x28569d=_0x28569d['substring'](0x0,_0x28569d[_0xee01('0x5a')](_0x1767a2));}_0x6c0d03=new jsforce[(_0xee01('0x5b'))]({'oauth2':{'loginUrl':_0x28569d,'clientId':_0x2a30d6[_0xee01('0x55')],'clientSecret':_0x2a30d6['clientSecret']}});return _0x6c0d03['login'](_0x2a30d6[_0xee01('0x57')],_0x2a30d6[_0xee01('0x58')]['concat'](_0x2a30d6[_0xee01('0x5c')]));}})[_0xee01('0x25')](function(_0x1423b7){if(_0x1423b7){if(!_[_0xee01('0x5d')](_0x1ed2a7[_0xee01('0x31')]['ticketType'])){_0x520707=_0x1ed2a7[_0xee01('0x31')][_0xee01('0x5e')];}return _0x6c0d03[_0xee01('0x5f')](_0x520707)['describe']();}})['then'](function(_0x6e39a3){var _0x323ec3=[_0xee01('0x60'),_0xee01('0x61'),_0xee01('0x62'),_0xee01('0x63'),_0xee01('0x64'),_0xee01('0x65')];var _0x1e2c0e=['string',_0xee01('0x66'),_0xee01('0x67'),_0xee01('0x68'),_0xee01('0x69'),_0xee01('0x6a'),_0xee01('0x6b')];if(_0x6e39a3){_[_0xee01('0x6c')](_0x6e39a3['fields'],function(_0x308f09){return _0x323ec3[_0xee01('0x6d')](_0x308f09[_0xee01('0x28')])||!_0x1e2c0e['includes'](_0x308f09[_0xee01('0x2d')]);});return{'count':_0x6e39a3[_0xee01('0x36')][_0xee01('0x37')],'rows':_['map'](_0x6e39a3[_0xee01('0x36')],function(_0x57a0a9){return{'id':_0x57a0a9[_0xee01('0x28')],'name':_0x57a0a9[_0xee01('0x6e')],'custom':_0x57a0a9[_0xee01('0x6f')],'options':_0x57a0a9[_0xee01('0x70')][_0xee01('0x37')]>0x0?_[_0xee01('0x30')](_0x57a0a9[_0xee01('0x70')],function(_0x1639db){return{'name':_0x1639db[_0xee01('0x6e')],'value':_0x1639db[_0xee01('0x71')]};}):_0x57a0a9['type']=='boolean'?[{'name':_0xee01('0x72'),'value':_0xee01('0x73')},{'name':_0xee01('0x74'),'value':'false'}]:[]};})};}})[_0xee01('0x25')](respondWithResult(_0x1c5525,null))[_0xee01('0x48')](function(_0x41cf9c){var _0x51b75e=_0x1ed2a7['query'][_0xee01('0x75')]?0x1f4:_0x41cf9c[_0xee01('0x76')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x51b75e,JSON[_0xee01('0x77')](_0x41cf9c));delete _0x41cf9c[_0xee01('0x28')];if(_0x51b75e===0x191){_0x51b75e=0x190;}_0x1c5525['status'](_0x51b75e)['send'](_0x1ed2a7[_0xee01('0x31')][_0xee01('0x75')]?{'message':_0xee01('0x78'),'statusCode':_0x41cf9c['statusCode']}:_0x41cf9c);});}; \ No newline at end of file +var _0x9475=['papaparse','ioredis','../../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','error','name','send','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','create','body','destroy','find','getConfigurations','SalesforceConfiguration','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','login','isNil','ticketType','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','picklist','boolean','email','phone','includes','picklistValues','label','True','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','crypto','desk.js'];(function(_0x1d2f20,_0x5a4148){var _0x453e08=function(_0x1eb4bd){while(--_0x1eb4bd){_0x1d2f20['push'](_0x1d2f20['shift']());}};_0x453e08(++_0x5a4148);}(_0x9475,0x6b));var _0x5947=function(_0x5e878a,_0x336feb){_0x5e878a=_0x5e878a-0x0;var _0x3f8fff=_0x9475[_0x5e878a];return _0x3f8fff;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5947('0x0'));var jsonpatch=require(_0x5947('0x1'));var rp=require(_0x5947('0x2'));var moment=require(_0x5947('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5947('0x4'));var util=require(_0x5947('0x5'));var path=require(_0x5947('0x6'));var sox=require('sox');var csv=require(_0x5947('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5947('0x8'));var _=require(_0x5947('0x9'));var squel=require('squel');var crypto=require(_0x5947('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5947('0xb'));var toCsv=require(_0x5947('0x7'));var querystring=require('querystring');var Papa=require(_0x5947('0xc'));var Redis=require(_0x5947('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5947('0xe'));var hardwareService=require(_0x5947('0xf'));var logger=require(_0x5947('0x10'))(_0x5947('0x11'));var utils=require(_0x5947('0x12'));var config=require(_0x5947('0x13'));var licenseUtil=require(_0x5947('0x14'));var db=require(_0x5947('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x20d59c,_0x1b451e){_0x1b451e=_0x1b451e||0xcc;return function(_0x457f15){if(_0x457f15){return _0x20d59c[_0x5947('0x16')](_0x1b451e);}return _0x20d59c[_0x5947('0x17')](_0x1b451e)[_0x5947('0x18')]();};}function respondWithResult(_0x2e61a4,_0x14c739){_0x14c739=_0x14c739||0xc8;return function(_0x2073e7){if(_0x2073e7){return _0x2e61a4[_0x5947('0x17')](_0x14c739)[_0x5947('0x19')](_0x2073e7);}};}function respondWithFilteredResult(_0x138625,_0x18fc95){return function(_0x373d45){if(_0x373d45){var _0x26cf5e=typeof _0x18fc95[_0x5947('0x1a')]===_0x5947('0x1b')&&typeof _0x18fc95[_0x5947('0x1c')]===_0x5947('0x1b');var _0x123689=_0x373d45[_0x5947('0x1d')];var _0x5a46f8=_0x26cf5e?0x0:_0x18fc95[_0x5947('0x1a')];var _0x3fbc2b=_0x26cf5e?_0x373d45[_0x5947('0x1d')]:_0x18fc95[_0x5947('0x1a')]+_0x18fc95['limit'];var _0x2b9835;if(_0x3fbc2b>=_0x123689){_0x3fbc2b=_0x123689;_0x2b9835=0xc8;}else{_0x2b9835=0xce;}_0x138625[_0x5947('0x17')](_0x2b9835);return _0x138625[_0x5947('0x1e')](_0x5947('0x1f'),_0x5a46f8+'-'+_0x3fbc2b+'/'+_0x123689)['json'](_0x373d45);}return null;};}function patchUpdates(_0x2c8943){return function(_0x1152d1){try{jsonpatch[_0x5947('0x20')](_0x1152d1,_0x2c8943,!![]);}catch(_0x435e17){return BPromise[_0x5947('0x21')](_0x435e17);}return _0x1152d1[_0x5947('0x22')]();};}function saveUpdates(_0x1f10cf,_0x1b1c76){return function(_0x35759e){if(_0x35759e){return _0x35759e[_0x5947('0x23')](_0x1f10cf)['then'](function(_0x1ae7e0){return _0x1ae7e0;});}return null;};}function removeEntity(_0x5d2aaa,_0x2b6952){return function(_0x1b2fbb){if(_0x1b2fbb){return _0x1b2fbb['destroy']()[_0x5947('0x24')](function(){_0x5d2aaa[_0x5947('0x17')](0xcc)[_0x5947('0x18')]();});}};}function handleEntityNotFound(_0x2c17c9,_0x552557){return function(_0x253053){if(!_0x253053){_0x2c17c9[_0x5947('0x16')](0x194);}return _0x253053;};}function handleError(_0x3ed3e0,_0x479c2d){_0x479c2d=_0x479c2d||0x1f4;return function(_0x114d79){logger[_0x5947('0x25')](_0x114d79['stack']);if(_0x114d79[_0x5947('0x26')]){delete _0x114d79['name'];}_0x3ed3e0['status'](_0x479c2d)[_0x5947('0x27')](_0x114d79);};}exports['index']=function(_0x4c051c,_0x2767f1){var _0x16c589={},_0x52c40f={},_0x55ab05={'count':0x0,'rows':[]};var _0x43555a=_[_0x5947('0x28')](db[_0x5947('0x29')][_0x5947('0x2a')],function(_0x21881){return{'name':_0x21881[_0x5947('0x2b')],'type':_0x21881[_0x5947('0x2c')][_0x5947('0x2d')]};});_0x52c40f[_0x5947('0x2e')]=_['map'](_0x43555a,_0x5947('0x26'));_0x52c40f[_0x5947('0x2f')]=_[_0x5947('0x30')](_0x4c051c[_0x5947('0x2f')]);_0x52c40f['filters']=_['intersection'](_0x52c40f[_0x5947('0x2e')],_0x52c40f[_0x5947('0x2f')]);_0x16c589[_0x5947('0x31')]=_[_0x5947('0x32')](_0x52c40f[_0x5947('0x2e')],qs[_0x5947('0x33')](_0x4c051c[_0x5947('0x2f')][_0x5947('0x33')]));_0x16c589['attributes']=_0x16c589[_0x5947('0x31')][_0x5947('0x34')]?_0x16c589['attributes']:_0x52c40f[_0x5947('0x2e')];if(!_0x4c051c[_0x5947('0x2f')][_0x5947('0x35')](_0x5947('0x36'))){_0x16c589['limit']=qs['limit'](_0x4c051c[_0x5947('0x2f')]['limit']);_0x16c589[_0x5947('0x1a')]=qs[_0x5947('0x1a')](_0x4c051c[_0x5947('0x2f')][_0x5947('0x1a')]);}_0x16c589[_0x5947('0x37')]=qs[_0x5947('0x38')](_0x4c051c['query']['sort']);_0x16c589[_0x5947('0x39')]=qs['filters'](_[_0x5947('0x3a')](_0x4c051c[_0x5947('0x2f')],_0x52c40f[_0x5947('0x3b')]),_0x43555a);if(_0x4c051c[_0x5947('0x2f')][_0x5947('0x3c')]){_0x16c589['where']=_['merge'](_0x16c589[_0x5947('0x39')],{'$or':_['map'](_0x43555a,function(_0x3e230b){if(_0x3e230b[_0x5947('0x2c')]!==_0x5947('0x3d')){var _0x51f411={};_0x51f411[_0x3e230b[_0x5947('0x26')]]={'$like':'%'+_0x4c051c['query']['filter']+'%'};return _0x51f411;}})});}_0x16c589=_[_0x5947('0x3e')]({},_0x16c589,_0x4c051c[_0x5947('0x3f')]);var _0x42fff5={'where':_0x16c589['where']};return db[_0x5947('0x29')]['count'](_0x42fff5)[_0x5947('0x24')](function(_0x1cebc7){_0x55ab05[_0x5947('0x1d')]=_0x1cebc7;if(_0x4c051c[_0x5947('0x2f')][_0x5947('0x40')]){_0x16c589[_0x5947('0x41')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x5947('0x42')](_0x16c589);})['then'](function(_0x46d8bf){_0x55ab05[_0x5947('0x43')]=_0x46d8bf;return _0x55ab05;})[_0x5947('0x24')](respondWithFilteredResult(_0x2767f1,_0x16c589))[_0x5947('0x44')](handleError(_0x2767f1,null));};exports['show']=function(_0x1e87ab,_0x283779){var _0x26777e={'raw':![],'where':{'id':_0x1e87ab[_0x5947('0x45')]['id']}},_0x5cb653={};_0x5cb653['model']=_[_0x5947('0x30')](db[_0x5947('0x29')][_0x5947('0x2a')]);_0x5cb653['query']=_[_0x5947('0x30')](_0x1e87ab[_0x5947('0x2f')]);_0x5cb653[_0x5947('0x3b')]=_[_0x5947('0x32')](_0x5cb653[_0x5947('0x2e')],_0x5cb653[_0x5947('0x2f')]);_0x26777e['attributes']=_[_0x5947('0x32')](_0x5cb653[_0x5947('0x2e')],qs[_0x5947('0x33')](_0x1e87ab[_0x5947('0x2f')][_0x5947('0x33')]));_0x26777e[_0x5947('0x31')]=_0x26777e[_0x5947('0x31')][_0x5947('0x34')]?_0x26777e['attributes']:_0x5cb653[_0x5947('0x2e')];if(_0x1e87ab['query'][_0x5947('0x40')]){_0x26777e[_0x5947('0x41')]=[{'all':!![]}];}_0x26777e=_['merge']({},_0x26777e,_0x1e87ab['options']);return db[_0x5947('0x29')]['find'](_0x26777e)[_0x5947('0x24')](handleEntityNotFound(_0x283779,null))['then'](respondWithResult(_0x283779,null))['catch'](handleError(_0x283779,null));};exports[_0x5947('0x46')]=function(_0x21312f,_0x45a110){return db[_0x5947('0x29')][_0x5947('0x46')](_0x21312f[_0x5947('0x47')],{})[_0x5947('0x24')](respondWithResult(_0x45a110,0xc9))[_0x5947('0x44')](handleError(_0x45a110,null));};exports[_0x5947('0x23')]=function(_0x3dcdeb,_0x1d83bf){if(_0x3dcdeb[_0x5947('0x47')]['id']){delete _0x3dcdeb[_0x5947('0x47')]['id'];}return db[_0x5947('0x29')]['find']({'where':{'id':_0x3dcdeb['params']['id']}})[_0x5947('0x24')](handleEntityNotFound(_0x1d83bf,null))[_0x5947('0x24')](saveUpdates(_0x3dcdeb[_0x5947('0x47')],null))[_0x5947('0x24')](respondWithResult(_0x1d83bf,null))[_0x5947('0x44')](handleError(_0x1d83bf,null));};exports[_0x5947('0x48')]=function(_0x2dc38e,_0x29335f){return db['SalesforceAccount'][_0x5947('0x49')]({'where':{'id':_0x2dc38e[_0x5947('0x45')]['id']}})[_0x5947('0x24')](handleEntityNotFound(_0x29335f,null))[_0x5947('0x24')](removeEntity(_0x29335f,null))[_0x5947('0x44')](handleError(_0x29335f,null));};exports[_0x5947('0x4a')]=function(_0x3a12ed,_0x6c73ee,_0x50d843){var _0x45813a={};var _0x485e06={};var _0x1df29e;var _0x157d5d;return db[_0x5947('0x29')]['findOne']({'where':{'id':_0x3a12ed[_0x5947('0x45')]['id']}})[_0x5947('0x24')](handleEntityNotFound(_0x6c73ee,null))['then'](function(_0x5411fd){if(_0x5411fd){_0x1df29e=_0x5411fd;_0x485e06[_0x5947('0x2e')]=_[_0x5947('0x30')](db[_0x5947('0x4b')][_0x5947('0x2a')]);_0x485e06[_0x5947('0x2f')]=_['keys'](_0x3a12ed[_0x5947('0x2f')]);_0x485e06[_0x5947('0x3b')]=_[_0x5947('0x32')](_0x485e06[_0x5947('0x2e')],_0x485e06[_0x5947('0x2f')]);_0x45813a[_0x5947('0x31')]=_['intersection'](_0x485e06['model'],qs[_0x5947('0x33')](_0x3a12ed[_0x5947('0x2f')][_0x5947('0x33')]));_0x45813a['attributes']=_0x45813a[_0x5947('0x31')][_0x5947('0x34')]?_0x45813a[_0x5947('0x31')]:_0x485e06[_0x5947('0x2e')];_0x45813a[_0x5947('0x37')]=qs['sort'](_0x3a12ed[_0x5947('0x2f')][_0x5947('0x38')]);_0x45813a[_0x5947('0x39')]=qs[_0x5947('0x3b')](_['pick'](_0x3a12ed[_0x5947('0x2f')],_0x485e06[_0x5947('0x3b')]));if(_0x3a12ed[_0x5947('0x2f')][_0x5947('0x3c')]){_0x45813a[_0x5947('0x39')]=_[_0x5947('0x3e')](_0x45813a[_0x5947('0x39')],{'$or':_[_0x5947('0x28')](_0x45813a[_0x5947('0x31')],function(_0x25b9d2){var _0xa8c841={};_0xa8c841[_0x25b9d2]={'$like':'%'+_0x3a12ed[_0x5947('0x2f')][_0x5947('0x3c')]+'%'};return _0xa8c841;})});}_0x45813a=_[_0x5947('0x3e')]({},_0x45813a,_0x3a12ed['options']);return _0x1df29e[_0x5947('0x4a')](_0x45813a);}})[_0x5947('0x24')](function(_0x3a92a8){if(_0x3a92a8){_0x157d5d=_0x3a92a8[_0x5947('0x34')];if(!_0x3a12ed['query'][_0x5947('0x35')](_0x5947('0x36'))){_0x45813a[_0x5947('0x1c')]=qs[_0x5947('0x1c')](_0x3a12ed[_0x5947('0x2f')]['limit']);_0x45813a[_0x5947('0x1a')]=qs[_0x5947('0x1a')](_0x3a12ed['query'][_0x5947('0x1a')]);}return _0x1df29e[_0x5947('0x4a')](_0x45813a);}})[_0x5947('0x24')](function(_0x2bc63c){if(_0x2bc63c){return _0x2bc63c?{'count':_0x157d5d,'rows':_0x2bc63c}:null;}})[_0x5947('0x24')](respondWithResult(_0x6c73ee,null))[_0x5947('0x44')](handleError(_0x6c73ee,null));};exports[_0x5947('0x4c')]=function(_0x8aa60c,_0x115ede,_0x6ac19e){if(_0x8aa60c[_0x5947('0x47')]['id']){delete _0x8aa60c[_0x5947('0x47')]['id'];}return db['SalesforceAccount'][_0x5947('0x4d')]({'where':{'id':_0x8aa60c[_0x5947('0x45')]['id']}})['then'](handleEntityNotFound(_0x115ede,null))['then'](function(_0x6f897){if(_0x6f897){_0x8aa60c[_0x5947('0x47')]['AccountId']=_0x6f897['id'];_0x8aa60c[_0x5947('0x47')][_0x5947('0x4e')]=integrations[_0x5947('0x4f')](_0x8aa60c[_0x5947('0x47')][_0x5947('0x50')],_0x8aa60c[_0x5947('0x47')]['type']);_0x8aa60c[_0x5947('0x47')][_0x5947('0x51')]=integrations['getDescriptions'](_0x8aa60c[_0x5947('0x47')][_0x5947('0x50')],_0x8aa60c[_0x5947('0x47')]['type']);return db[_0x5947('0x4b')][_0x5947('0x46')](_0x8aa60c[_0x5947('0x47')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0x5947('0x52')],'as':'Descriptions'}]});}return null;})[_0x5947('0x24')](respondWithResult(_0x115ede,null))[_0x5947('0x44')](handleError(_0x115ede,null));};exports[_0x5947('0x53')]=function(_0x574dc8,_0xdade24,_0x1d0fad){var _0x4102df;var _0x278d61='';var _0x239fce=_0x5947('0x54');return db['SalesforceAccount']['findOne']({'where':{'id':_0x574dc8['params']['id']},'attributes':['id',_0x5947('0x55'),_0x5947('0x56'),_0x5947('0x57'),_0x5947('0x58'),_0x5947('0x59'),_0x5947('0x5a')]})[_0x5947('0x24')](handleEntityNotFound(_0xdade24,null))[_0x5947('0x24')](function(_0x27958f){if(_0x27958f){_0x278d61=_0x27958f[_0x5947('0x55')];var _0x27f764=_0x278d61[_0x5947('0x5b')](-0x1);if(_0x27f764==='/'){_0x278d61=_0x278d61[_0x5947('0x5c')](0x0,_0x278d61[_0x5947('0x5d')](_0x27f764));}_0x4102df=new jsforce[(_0x5947('0x5e'))]({'oauth2':{'loginUrl':_0x278d61,'clientId':_0x27958f[_0x5947('0x56')],'clientSecret':_0x27958f[_0x5947('0x57')]}});return _0x4102df[_0x5947('0x5f')](_0x27958f[_0x5947('0x58')],_0x27958f['password']['concat'](_0x27958f[_0x5947('0x5a')]));}})[_0x5947('0x24')](function(_0x294cd5){if(_0x294cd5){if(!_[_0x5947('0x60')](_0x574dc8[_0x5947('0x2f')][_0x5947('0x61')])){_0x239fce=_0x574dc8[_0x5947('0x2f')][_0x5947('0x61')];}return _0x4102df['sobject'](_0x239fce)['describe']();}})['then'](function(_0xc0a310){var _0x2295f0=[_0x5947('0x62'),_0x5947('0x63'),_0x5947('0x64'),_0x5947('0x65'),_0x5947('0x66'),_0x5947('0x67')];var _0x5842dc=['string','int',_0x5947('0x68'),_0x5947('0x69'),_0x5947('0x6a'),'textarea',_0x5947('0x6b')];if(_0xc0a310){_['remove'](_0xc0a310[_0x5947('0x33')],function(_0x38fbdb){return _0x2295f0[_0x5947('0x6c')](_0x38fbdb[_0x5947('0x26')])||!_0x5842dc[_0x5947('0x6c')](_0x38fbdb[_0x5947('0x2c')]);});return{'count':_0xc0a310[_0x5947('0x33')][_0x5947('0x34')],'rows':_[_0x5947('0x28')](_0xc0a310[_0x5947('0x33')],function(_0x161695){return{'id':_0x161695[_0x5947('0x26')],'name':_0x161695['label'],'custom':_0x161695['custom'],'options':_0x161695[_0x5947('0x6d')][_0x5947('0x34')]>0x0?_[_0x5947('0x28')](_0x161695[_0x5947('0x6d')],function(_0x16db56){return{'name':_0x16db56[_0x5947('0x6e')],'value':_0x16db56['value']};}):_0x161695['type']==_0x5947('0x69')?[{'name':_0x5947('0x6f'),'value':'true'},{'name':_0x5947('0x70'),'value':_0x5947('0x71')}]:[]};})};}})[_0x5947('0x24')](respondWithResult(_0xdade24,null))['catch'](function(_0x3c3463){var _0x14b36c=_0x574dc8['query'][_0x5947('0x72')]?0x1f4:_0x3c3463[_0x5947('0x73')]||0x1f4;logger[_0x5947('0x25')](_0x5947('0x74'),_0x5947('0x53'),_0x14b36c,JSON[_0x5947('0x75')](_0x3c3463));delete _0x3c3463['name'];if(_0x14b36c===0x191){_0x14b36c=0x190;}_0xdade24[_0x5947('0x17')](_0x14b36c)['send'](_0x574dc8[_0x5947('0x2f')][_0x5947('0x72')]?{'message':_0x5947('0x76'),'statusCode':_0x3c3463[_0x5947('0x73')]}:_0x3c3463);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index b5a0942..3720d06 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 _0x7e04=['int_salesforce_accounts','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount'];(function(_0x1d06cf,_0x430c44){var _0x5c97cc=function(_0x4d96cb){while(--_0x4d96cb){_0x1d06cf['push'](_0x1d06cf['shift']());}};_0x5c97cc(++_0x430c44);}(_0x7e04,0x1cf));var _0x47e0=function(_0x47baed,_0x55d257){_0x47baed=_0x47baed-0x0;var _0x32cd90=_0x7e04[_0x47baed];return _0x32cd90;};'use strict';var _=require(_0x47e0('0x0'));var util=require('util');var logger=require(_0x47e0('0x1'))(_0x47e0('0x2'));var moment=require(_0x47e0('0x3'));var BPromise=require('bluebird');var rp=require(_0x47e0('0x4'));var fs=require('fs');var path=require(_0x47e0('0x5'));var rimraf=require(_0x47e0('0x6'));var config=require(_0x47e0('0x7'));var attributes=require(_0x47e0('0x8'));var integrations=require(_0x47e0('0x9'));module[_0x47e0('0xa')]=function(_0x1c8d5e,_0xb409fc){return _0x1c8d5e[_0x47e0('0xb')](_0x47e0('0xc'),attributes,{'tableName':_0x47e0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83a8=['api','moment','bluebird','path','rimraf','../../config/environment','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger'];(function(_0x3c9ab1,_0x4eddcd){var _0x4e9c62=function(_0x4a4311){while(--_0x4a4311){_0x3c9ab1['push'](_0x3c9ab1['shift']());}};_0x4e9c62(++_0x4eddcd);}(_0x83a8,0xf9));var _0x883a=function(_0x3d2a88,_0xeb4a1f){_0x3d2a88=_0x3d2a88-0x0;var _0x5c35e3=_0x83a8[_0x3d2a88];return _0x5c35e3;};'use strict';var _=require(_0x883a('0x0'));var util=require(_0x883a('0x1'));var logger=require(_0x883a('0x2'))(_0x883a('0x3'));var moment=require(_0x883a('0x4'));var BPromise=require(_0x883a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x883a('0x6'));var rimraf=require(_0x883a('0x7'));var config=require(_0x883a('0x8'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3eba51,_0x66cfd9){return _0x3eba51[_0x883a('0x9')](_0x883a('0xa'),attributes,{'tableName':_0x883a('0xb'),'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 b96b898..45df414 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 _0xcc8d=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','info','result','GetSalesforceAccount','SalesforceAccount','options','where','attributes','include','map','model','then','ShowSalesforceAccount','raw','catch','lodash','util','bluebird','ioredis'];(function(_0xb787d4,_0x845690){var _0x3c5093=function(_0x59123c){while(--_0x59123c){_0xb787d4['push'](_0xb787d4['shift']());}};_0x3c5093(++_0x845690);}(_0xcc8d,0xfc));var _0xdcc8=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xcc8d[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require(_0xdcc8('0x0'));var util=require(_0xdcc8('0x1'));var moment=require('moment');var BPromise=require(_0xdcc8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdcc8('0x3'));var db=require(_0xdcc8('0x4'))['db'];var utils=require(_0xdcc8('0x5'));var logger=require(_0xdcc8('0x6'))(_0xdcc8('0x7'));var config=require('../../config/environment');var jayson=require(_0xdcc8('0x8'));var client=jayson[_0xdcc8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c5482,_0x1e7153,_0x29b045){return new BPromise(function(_0x4f3511,_0x1a94a2){return client['request'](_0x2c5482,_0x29b045)['then'](function(_0x531e96){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x1e7153,_0xdcc8('0xa'));logger[_0xdcc8('0xb')](_0xdcc8('0xc'),_0x1e7153,_0xdcc8('0xa'),JSON[_0xdcc8('0xd')](_0x531e96));if(_0x531e96[_0xdcc8('0xe')]){if(_0x531e96[_0xdcc8('0xe')][_0xdcc8('0xf')]===0x1f4){logger[_0xdcc8('0xe')](_0xdcc8('0x10'),_0x1e7153,_0x531e96[_0xdcc8('0xe')][_0xdcc8('0x11')]);return _0x1a94a2(_0x531e96[_0xdcc8('0xe')]['message']);}logger[_0xdcc8('0xe')](_0xdcc8('0x10'),_0x1e7153,_0x531e96[_0xdcc8('0xe')][_0xdcc8('0x11')]);return _0x4f3511(_0x531e96[_0xdcc8('0xe')][_0xdcc8('0x11')]);}else{logger[_0xdcc8('0x12')](_0xdcc8('0x10'),_0x1e7153,'request\x20sent');_0x4f3511(_0x531e96[_0xdcc8('0x13')][_0xdcc8('0x11')]);}})['catch'](function(_0x1e42a6){logger[_0xdcc8('0xe')](_0xdcc8('0x10'),_0x1e7153,_0x1e42a6);_0x1a94a2(_0x1e42a6);});});}exports[_0xdcc8('0x14')]=function(_0x3195c9){var _0x3c14e5=this;return new Promise(function(_0x4bad0f,_0x504c8b){return db[_0xdcc8('0x15')]['findAll']({'raw':_0x3195c9[_0xdcc8('0x16')]?_0x3195c9['options']['raw']===undefined?!![]:![]:!![],'where':_0x3195c9['options']?_0x3195c9[_0xdcc8('0x16')][_0xdcc8('0x17')]||null:null,'attributes':_0x3195c9['options']?_0x3195c9['options'][_0xdcc8('0x18')]||null:null,'limit':_0x3195c9[_0xdcc8('0x16')]?_0x3195c9['options']['limit']||null:null,'include':_0x3195c9[_0xdcc8('0x16')]?_0x3195c9[_0xdcc8('0x16')][_0xdcc8('0x19')]?_[_0xdcc8('0x1a')](_0x3195c9['options']['include'],function(_0xe74bdb){return{'model':db[_0xe74bdb[_0xdcc8('0x1b')]],'as':_0xe74bdb['as'],'attributes':_0xe74bdb[_0xdcc8('0x18')],'include':_0xe74bdb['include']?_['map'](_0xe74bdb[_0xdcc8('0x19')],function(_0x649efe){return{'model':db[_0x649efe[_0xdcc8('0x1b')]],'as':_0x649efe['as'],'attributes':_0x649efe['attributes'],'include':_0x649efe[_0xdcc8('0x19')]?_['map'](_0x649efe[_0xdcc8('0x19')],function(_0x100ec6){return{'model':db[_0x100ec6[_0xdcc8('0x1b')]],'as':_0x100ec6['as'],'attributes':_0x100ec6[_0xdcc8('0x18')]};}):[]};}):[]};}):[]:[]})[_0xdcc8('0x1c')](function(_0x12b451){logger[_0xdcc8('0x12')]('GetSalesforceAccount',_0x3195c9);logger['debug'](_0xdcc8('0x14'),_0x3195c9,JSON[_0xdcc8('0xd')](_0x12b451));_0x4bad0f(_0x12b451);})['catch'](function(_0x3abee9){logger[_0xdcc8('0xe')](_0xdcc8('0x14'),_0x3abee9[_0xdcc8('0x11')],_0x3195c9);_0x504c8b(_0x3c14e5['error'](0x1f4,_0x3abee9[_0xdcc8('0x11')]));});});};exports[_0xdcc8('0x1d')]=function(_0x5f01df){var _0x143cb0=this;return new Promise(function(_0x330a14,_0x426778){return db['SalesforceAccount']['find']({'raw':_0x5f01df[_0xdcc8('0x16')]?_0x5f01df[_0xdcc8('0x16')][_0xdcc8('0x1e')]===undefined?!![]:![]:!![],'where':_0x5f01df[_0xdcc8('0x16')]?_0x5f01df[_0xdcc8('0x16')][_0xdcc8('0x17')]||null:null,'attributes':_0x5f01df[_0xdcc8('0x16')]?_0x5f01df[_0xdcc8('0x16')][_0xdcc8('0x18')]||null:null,'include':_0x5f01df['options']?_0x5f01df[_0xdcc8('0x16')][_0xdcc8('0x19')]?_[_0xdcc8('0x1a')](_0x5f01df[_0xdcc8('0x16')][_0xdcc8('0x19')],function(_0x54e641){return{'model':db[_0x54e641[_0xdcc8('0x1b')]],'as':_0x54e641['as'],'attributes':_0x54e641[_0xdcc8('0x18')],'include':_0x54e641[_0xdcc8('0x19')]?_[_0xdcc8('0x1a')](_0x54e641[_0xdcc8('0x19')],function(_0x320278){return{'model':db[_0x320278[_0xdcc8('0x1b')]],'as':_0x320278['as'],'attributes':_0x320278[_0xdcc8('0x18')],'include':_0x320278[_0xdcc8('0x19')]?_[_0xdcc8('0x1a')](_0x320278['include'],function(_0x4fd973){return{'model':db[_0x4fd973[_0xdcc8('0x1b')]],'as':_0x4fd973['as'],'attributes':_0x4fd973[_0xdcc8('0x18')]};}):[]};}):[]};}):[]:[]})[_0xdcc8('0x1c')](function(_0x3df40f){logger['info']('ShowSalesforceAccount',_0x5f01df);logger['debug']('ShowSalesforceAccount',_0x5f01df,JSON[_0xdcc8('0xd')](_0x3df40f));_0x330a14(_0x3df40f);})[_0xdcc8('0x1f')](function(_0x141101){logger[_0xdcc8('0xe')]('ShowSalesforceAccount',_0x141101[_0xdcc8('0x11')],_0x5f01df);_0x426778(_0x143cb0[_0xdcc8('0xe')](0x1f4,_0x141101[_0xdcc8('0x11')]));});});}; \ No newline at end of file +var _0x4f58=['result','catch','GetSalesforceAccount','SalesforceAccount','options','where','attributes','limit','include','map','model','debug','ShowSalesforceAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x2943a0,_0x1e54f4){var _0x68f82e=function(_0x53f0cc){while(--_0x53f0cc){_0x2943a0['push'](_0x2943a0['shift']());}};_0x68f82e(++_0x1e54f4);}(_0x4f58,0x14a));var _0x84f5=function(_0x2e4d1b,_0x2dcda6){_0x2e4d1b=_0x2e4d1b-0x0;var _0x2cc80c=_0x4f58[_0x2e4d1b];return _0x2cc80c;};'use strict';var _=require(_0x84f5('0x0'));var util=require(_0x84f5('0x1'));var moment=require(_0x84f5('0x2'));var BPromise=require(_0x84f5('0x3'));var rs=require(_0x84f5('0x4'));var fs=require('fs');var Redis=require(_0x84f5('0x5'));var db=require(_0x84f5('0x6'))['db'];var utils=require(_0x84f5('0x7'));var logger=require(_0x84f5('0x8'))(_0x84f5('0x9'));var config=require(_0x84f5('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29b9fd,_0x305e8d,_0x6cb291){return new BPromise(function(_0x9dee45,_0x4e79f4){return client[_0x84f5('0xb')](_0x29b9fd,_0x6cb291)[_0x84f5('0xc')](function(_0x34938a){logger['info'](_0x84f5('0xd'),_0x305e8d,_0x84f5('0xe'));logger['debug'](_0x84f5('0xf'),_0x305e8d,_0x84f5('0xe'),JSON[_0x84f5('0x10')](_0x34938a));if(_0x34938a['error']){if(_0x34938a[_0x84f5('0x11')]['code']===0x1f4){logger[_0x84f5('0x11')](_0x84f5('0xd'),_0x305e8d,_0x34938a['error']['message']);return _0x4e79f4(_0x34938a[_0x84f5('0x11')]['message']);}logger[_0x84f5('0x11')](_0x84f5('0xd'),_0x305e8d,_0x34938a[_0x84f5('0x11')][_0x84f5('0x12')]);return _0x9dee45(_0x34938a[_0x84f5('0x11')][_0x84f5('0x12')]);}else{logger[_0x84f5('0x13')](_0x84f5('0xd'),_0x305e8d,'request\x20sent');_0x9dee45(_0x34938a[_0x84f5('0x14')]['message']);}})[_0x84f5('0x15')](function(_0x4e5147){logger[_0x84f5('0x11')](_0x84f5('0xd'),_0x305e8d,_0x4e5147);_0x4e79f4(_0x4e5147);});});}exports[_0x84f5('0x16')]=function(_0x1cb414){var _0xd3a30d=this;return new Promise(function(_0x6c609d,_0x49761c){return db[_0x84f5('0x17')]['findAll']({'raw':_0x1cb414[_0x84f5('0x18')]?_0x1cb414[_0x84f5('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1cb414[_0x84f5('0x18')]?_0x1cb414[_0x84f5('0x18')][_0x84f5('0x19')]||null:null,'attributes':_0x1cb414['options']?_0x1cb414[_0x84f5('0x18')][_0x84f5('0x1a')]||null:null,'limit':_0x1cb414['options']?_0x1cb414[_0x84f5('0x18')][_0x84f5('0x1b')]||null:null,'include':_0x1cb414[_0x84f5('0x18')]?_0x1cb414['options'][_0x84f5('0x1c')]?_[_0x84f5('0x1d')](_0x1cb414['options']['include'],function(_0x3fd9d0){return{'model':db[_0x3fd9d0[_0x84f5('0x1e')]],'as':_0x3fd9d0['as'],'attributes':_0x3fd9d0['attributes'],'include':_0x3fd9d0[_0x84f5('0x1c')]?_[_0x84f5('0x1d')](_0x3fd9d0[_0x84f5('0x1c')],function(_0xb0c371){return{'model':db[_0xb0c371[_0x84f5('0x1e')]],'as':_0xb0c371['as'],'attributes':_0xb0c371[_0x84f5('0x1a')],'include':_0xb0c371['include']?_['map'](_0xb0c371['include'],function(_0x1e34cf){return{'model':db[_0x1e34cf[_0x84f5('0x1e')]],'as':_0x1e34cf['as'],'attributes':_0x1e34cf[_0x84f5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x84f5('0xc')](function(_0x266b67){logger[_0x84f5('0x13')]('GetSalesforceAccount',_0x1cb414);logger[_0x84f5('0x1f')](_0x84f5('0x16'),_0x1cb414,JSON[_0x84f5('0x10')](_0x266b67));_0x6c609d(_0x266b67);})[_0x84f5('0x15')](function(_0x309c17){logger[_0x84f5('0x11')](_0x84f5('0x16'),_0x309c17['message'],_0x1cb414);_0x49761c(_0xd3a30d[_0x84f5('0x11')](0x1f4,_0x309c17['message']));});});};exports[_0x84f5('0x20')]=function(_0x55fd8d){var _0x4e0dcf=this;return new Promise(function(_0x7db4aa,_0x54ebf1){return db[_0x84f5('0x17')][_0x84f5('0x21')]({'raw':_0x55fd8d['options']?_0x55fd8d[_0x84f5('0x18')][_0x84f5('0x22')]===undefined?!![]:![]:!![],'where':_0x55fd8d[_0x84f5('0x18')]?_0x55fd8d[_0x84f5('0x18')][_0x84f5('0x19')]||null:null,'attributes':_0x55fd8d[_0x84f5('0x18')]?_0x55fd8d['options'][_0x84f5('0x1a')]||null:null,'include':_0x55fd8d[_0x84f5('0x18')]?_0x55fd8d[_0x84f5('0x18')][_0x84f5('0x1c')]?_[_0x84f5('0x1d')](_0x55fd8d[_0x84f5('0x18')]['include'],function(_0x308773){return{'model':db[_0x308773[_0x84f5('0x1e')]],'as':_0x308773['as'],'attributes':_0x308773[_0x84f5('0x1a')],'include':_0x308773[_0x84f5('0x1c')]?_['map'](_0x308773['include'],function(_0x4ffbbb){return{'model':db[_0x4ffbbb[_0x84f5('0x1e')]],'as':_0x4ffbbb['as'],'attributes':_0x4ffbbb['attributes'],'include':_0x4ffbbb[_0x84f5('0x1c')]?_[_0x84f5('0x1d')](_0x4ffbbb[_0x84f5('0x1c')],function(_0x4cc854){return{'model':db[_0x4cc854[_0x84f5('0x1e')]],'as':_0x4cc854['as'],'attributes':_0x4cc854[_0x84f5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x84f5('0xc')](function(_0x1343e6){logger[_0x84f5('0x13')](_0x84f5('0x20'),_0x55fd8d);logger[_0x84f5('0x1f')](_0x84f5('0x20'),_0x55fd8d,JSON[_0x84f5('0x10')](_0x1343e6));_0x7db4aa(_0x1343e6);})[_0x84f5('0x15')](function(_0x27872b){logger[_0x84f5('0x11')](_0x84f5('0x20'),_0x27872b[_0x84f5('0x12')],_0x55fd8d);_0x54ebf1(_0x4e0dcf[_0x84f5('0x11')](0x1f4,_0x27872b[_0x84f5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index e7c5c24..8f2d801 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(_0x5d7365,_0x5c944c){var _0x5a3f9f=function(_0x5d3f6a){while(--_0x5d3f6a){_0x5d7365['push'](_0x5d7365['shift']());}};_0x5a3f9f(++_0x5c944c);}(_0xadb5,0xad));var _0x5adb=function(_0x4fa956,_0xe028ac){_0x4fa956=_0x4fa956-0x0;var _0x3f3143=_0xadb5[_0x4fa956];return _0x3f3143;};'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 _0x2032=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','exports','util','path','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2032,0xd9));var _0x2203=function(_0x9880a0,_0x80e7a0){_0x9880a0=_0x9880a0-0x0;var _0x58a2da=_0x2032[_0x9880a0];return _0x58a2da;};'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/fields',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2203('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2203('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index ea92403..e221a45 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 _0x5aab=['STRING','ENUM','Task','contact_lead','contact','lead','account_contact_lead','account','nothing'];(function(_0x3d89b8,_0x1aa5da){var _0x241289=function(_0x4c1af7){while(--_0x4c1af7){_0x3d89b8['push'](_0x3d89b8['shift']());}};_0x241289(++_0x1aa5da);}(_0x5aab,0x90));var _0xb5aa=function(_0x464f5d,_0x163475){_0x464f5d=_0x464f5d-0x0;var _0x2605a8=_0x5aab[_0x464f5d];return _0x2605a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb5aa('0x0')]},'description':{'type':Sequelize[_0xb5aa('0x0')]},'ticketType':{'type':Sequelize[_0xb5aa('0x1')]('Task','Case'),'defaultValue':_0xb5aa('0x2')},'moduleSearch':{'type':Sequelize[_0xb5aa('0x1')](_0xb5aa('0x3'),_0xb5aa('0x4'),_0xb5aa('0x5'),_0xb5aa('0x6'),_0xb5aa('0x7')),'defaultValue':_0xb5aa('0x3')},'moduleCreate':{'type':Sequelize['ENUM'](_0xb5aa('0x8'),_0xb5aa('0x4'),_0xb5aa('0x5'),_0xb5aa('0x7')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xb5aa('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0xb5aa('0x0')]},'additionalSearchContact':{'type':Sequelize[_0xb5aa('0x0')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcc76=['contact_lead','contact','account_contact_lead','account','lead','sequelize','exports','STRING','Task','Case','ENUM'];(function(_0x43325f,_0xfc3a09){var _0x4ca95a=function(_0x56fe61){while(--_0x56fe61){_0x43325f['push'](_0x43325f['shift']());}};_0x4ca95a(++_0xfc3a09);}(_0xcc76,0x7e));var _0x6cc7=function(_0x381e63,_0x223c6c){_0x381e63=_0x381e63-0x0;var _0x508ef2=_0xcc76[_0x381e63];return _0x508ef2;};'use strict';var Sequelize=require(_0x6cc7('0x0'));module[_0x6cc7('0x1')]={'name':{'type':Sequelize[_0x6cc7('0x2')]},'description':{'type':Sequelize[_0x6cc7('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x6cc7('0x3'),_0x6cc7('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x6cc7('0x5')](_0x6cc7('0x6'),_0x6cc7('0x7'),'lead',_0x6cc7('0x8'),'account'),'defaultValue':_0x6cc7('0x6')},'moduleCreate':{'type':Sequelize[_0x6cc7('0x5')]('nothing','contact','lead',_0x6cc7('0x9')),'defaultValue':_0x6cc7('0xa')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x6cc7('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x6cc7('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index dc69210..8f8930d 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 _0x3ed8=['create','body','getFields','findOne','order','hasOwnProperty','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','SalesforceConfiguration','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','rows','catch','show','params','rawAttributes','length','include','options','find'];(function(_0x572150,_0x238fef){var _0x290703=function(_0x510145){while(--_0x510145){_0x572150['push'](_0x572150['shift']());}};_0x290703(++_0x238fef);}(_0x3ed8,0x1e3));var _0x83ed=function(_0x5ef55a,_0x2a03b1){_0x5ef55a=_0x5ef55a-0x0;var _0x20ae40=_0x3ed8[_0x5ef55a];return _0x20ae40;};'use strict';var emlformat=require(_0x83ed('0x0'));var rimraf=require(_0x83ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x83ed('0x2'));var rp=require(_0x83ed('0x3'));var moment=require(_0x83ed('0x4'));var BPromise=require(_0x83ed('0x5'));var Mustache=require(_0x83ed('0x6'));var util=require(_0x83ed('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x83ed('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x83ed('0x9'));var squel=require(_0x83ed('0xa'));var crypto=require(_0x83ed('0xb'));var jsforce=require(_0x83ed('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x83ed('0xd'));var querystring=require('querystring');var Papa=require(_0x83ed('0xe'));var Redis=require(_0x83ed('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x83ed('0x10'));var as=require(_0x83ed('0x11'));var hardwareService=require(_0x83ed('0x12'));var logger=require('../../config/logger')(_0x83ed('0x13'));var utils=require(_0x83ed('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x83ed('0x15'))['db'];function respondWithStatusCode(_0x4d521d,_0x3b69c6){_0x3b69c6=_0x3b69c6||0xcc;return function(_0x4bfde7){if(_0x4bfde7){return _0x4d521d[_0x83ed('0x16')](_0x3b69c6);}return _0x4d521d[_0x83ed('0x17')](_0x3b69c6)[_0x83ed('0x18')]();};}function respondWithResult(_0x1a0b37,_0x2bd390){_0x2bd390=_0x2bd390||0xc8;return function(_0x22777e){if(_0x22777e){return _0x1a0b37[_0x83ed('0x17')](_0x2bd390)[_0x83ed('0x19')](_0x22777e);}};}function respondWithFilteredResult(_0x10a1ec,_0x1fed51){return function(_0x53b7da){if(_0x53b7da){var _0x38c4f2=typeof _0x1fed51[_0x83ed('0x1a')]===_0x83ed('0x1b')&&typeof _0x1fed51[_0x83ed('0x1c')]===_0x83ed('0x1b');var _0x214171=_0x53b7da[_0x83ed('0x1d')];var _0xc29e05=_0x38c4f2?0x0:_0x1fed51[_0x83ed('0x1a')];var _0x294773=_0x38c4f2?_0x53b7da[_0x83ed('0x1d')]:_0x1fed51[_0x83ed('0x1a')]+_0x1fed51[_0x83ed('0x1c')];var _0x1c2a7c;if(_0x294773>=_0x214171){_0x294773=_0x214171;_0x1c2a7c=0xc8;}else{_0x1c2a7c=0xce;}_0x10a1ec[_0x83ed('0x17')](_0x1c2a7c);return _0x10a1ec['set'](_0x83ed('0x1e'),_0xc29e05+'-'+_0x294773+'/'+_0x214171)[_0x83ed('0x19')](_0x53b7da);}return null;};}function patchUpdates(_0x1d8f7e){return function(_0x8ab484){try{jsonpatch[_0x83ed('0x1f')](_0x8ab484,_0x1d8f7e,!![]);}catch(_0x1ca37d){return BPromise[_0x83ed('0x20')](_0x1ca37d);}return _0x8ab484[_0x83ed('0x21')]();};}function saveUpdates(_0x348e03,_0x342ddb){return function(_0x4155b4){if(_0x4155b4){return _0x4155b4[_0x83ed('0x22')](_0x348e03)[_0x83ed('0x23')](function(_0x315c1f){return _0x315c1f;});}return null;};}function removeEntity(_0x1f66e5,_0x446c0e){return function(_0x4551e8){if(_0x4551e8){return _0x4551e8[_0x83ed('0x24')]()[_0x83ed('0x23')](function(){_0x1f66e5[_0x83ed('0x17')](0xcc)[_0x83ed('0x18')]();});}};}function handleEntityNotFound(_0x1f7de1,_0x459430){return function(_0x2fb4bf){if(!_0x2fb4bf){_0x1f7de1['sendStatus'](0x194);}return _0x2fb4bf;};}function handleError(_0x32e1ba,_0x3b99f3){_0x3b99f3=_0x3b99f3||0x1f4;return function(_0x4d0295){logger[_0x83ed('0x25')](_0x4d0295['stack']);if(_0x4d0295[_0x83ed('0x26')]){delete _0x4d0295['name'];}_0x32e1ba[_0x83ed('0x17')](_0x3b99f3)[_0x83ed('0x27')](_0x4d0295);};}exports[_0x83ed('0x28')]=function(_0x286669,_0x50b5cc){var _0x2feee5={},_0x5b9938={},_0x5ee187={'count':0x0,'rows':[]};var _0x41e310=_[_0x83ed('0x29')](db[_0x83ed('0x2a')]['rawAttributes'],function(_0x44241a){return{'name':_0x44241a[_0x83ed('0x2b')],'type':_0x44241a[_0x83ed('0x2c')][_0x83ed('0x2d')]};});_0x5b9938[_0x83ed('0x2e')]=_[_0x83ed('0x29')](_0x41e310,_0x83ed('0x26'));_0x5b9938[_0x83ed('0x2f')]=_[_0x83ed('0x30')](_0x286669[_0x83ed('0x2f')]);_0x5b9938[_0x83ed('0x31')]=_['intersection'](_0x5b9938['model'],_0x5b9938[_0x83ed('0x2f')]);_0x2feee5[_0x83ed('0x32')]=_[_0x83ed('0x33')](_0x5b9938[_0x83ed('0x2e')],qs['fields'](_0x286669[_0x83ed('0x2f')][_0x83ed('0x34')]));_0x2feee5[_0x83ed('0x32')]=_0x2feee5[_0x83ed('0x32')]['length']?_0x2feee5[_0x83ed('0x32')]:_0x5b9938[_0x83ed('0x2e')];if(!_0x286669[_0x83ed('0x2f')]['hasOwnProperty'](_0x83ed('0x35'))){_0x2feee5[_0x83ed('0x1c')]=qs['limit'](_0x286669[_0x83ed('0x2f')][_0x83ed('0x1c')]);_0x2feee5[_0x83ed('0x1a')]=qs[_0x83ed('0x1a')](_0x286669[_0x83ed('0x2f')][_0x83ed('0x1a')]);}_0x2feee5['order']=qs[_0x83ed('0x36')](_0x286669[_0x83ed('0x2f')][_0x83ed('0x36')]);_0x2feee5[_0x83ed('0x37')]=qs[_0x83ed('0x31')](_[_0x83ed('0x38')](_0x286669[_0x83ed('0x2f')],_0x5b9938['filters']),_0x41e310);if(_0x286669[_0x83ed('0x2f')][_0x83ed('0x39')]){_0x2feee5[_0x83ed('0x37')]=_['merge'](_0x2feee5[_0x83ed('0x37')],{'$or':_['map'](_0x41e310,function(_0x47704d){if(_0x47704d['type']!==_0x83ed('0x3a')){var _0x49dd9d={};_0x49dd9d[_0x47704d[_0x83ed('0x26')]]={'$like':'%'+_0x286669['query'][_0x83ed('0x39')]+'%'};return _0x49dd9d;}})});}_0x2feee5=_[_0x83ed('0x3b')]({},_0x2feee5,_0x286669['options']);var _0x3d9ab1={'where':_0x2feee5[_0x83ed('0x37')]};return db[_0x83ed('0x2a')]['count'](_0x3d9ab1)[_0x83ed('0x23')](function(_0x50ccee){_0x5ee187[_0x83ed('0x1d')]=_0x50ccee;if(_0x286669[_0x83ed('0x2f')][_0x83ed('0x3c')]){_0x2feee5['include']=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x2feee5);})[_0x83ed('0x23')](function(_0x118bb4){_0x5ee187[_0x83ed('0x3d')]=_0x118bb4;return _0x5ee187;})[_0x83ed('0x23')](respondWithFilteredResult(_0x50b5cc,_0x2feee5))[_0x83ed('0x3e')](handleError(_0x50b5cc,null));};exports[_0x83ed('0x3f')]=function(_0x132ffa,_0x50f18b){var _0x13178b={'raw':![],'where':{'id':_0x132ffa[_0x83ed('0x40')]['id']}},_0x3606db={};_0x3606db[_0x83ed('0x2e')]=_[_0x83ed('0x30')](db[_0x83ed('0x2a')][_0x83ed('0x41')]);_0x3606db[_0x83ed('0x2f')]=_[_0x83ed('0x30')](_0x132ffa['query']);_0x3606db[_0x83ed('0x31')]=_[_0x83ed('0x33')](_0x3606db['model'],_0x3606db[_0x83ed('0x2f')]);_0x13178b['attributes']=_[_0x83ed('0x33')](_0x3606db[_0x83ed('0x2e')],qs['fields'](_0x132ffa[_0x83ed('0x2f')]['fields']));_0x13178b[_0x83ed('0x32')]=_0x13178b[_0x83ed('0x32')][_0x83ed('0x42')]?_0x13178b[_0x83ed('0x32')]:_0x3606db[_0x83ed('0x2e')];if(_0x132ffa[_0x83ed('0x2f')][_0x83ed('0x3c')]){_0x13178b[_0x83ed('0x43')]=[{'all':!![]}];}_0x13178b=_['merge']({},_0x13178b,_0x132ffa[_0x83ed('0x44')]);return db['SalesforceConfiguration'][_0x83ed('0x45')](_0x13178b)['then'](handleEntityNotFound(_0x50f18b,null))[_0x83ed('0x23')](respondWithResult(_0x50f18b,null))[_0x83ed('0x3e')](handleError(_0x50f18b,null));};exports[_0x83ed('0x46')]=function(_0x3708ee,_0x9a2b2d){return db[_0x83ed('0x2a')][_0x83ed('0x46')](_0x3708ee['body'],{})[_0x83ed('0x23')](respondWithResult(_0x9a2b2d,0xc9))[_0x83ed('0x3e')](handleError(_0x9a2b2d,null));};exports[_0x83ed('0x22')]=function(_0x4d6415,_0x4f04d1){if(_0x4d6415['body']['id']){delete _0x4d6415['body']['id'];}return db[_0x83ed('0x2a')][_0x83ed('0x45')]({'where':{'id':_0x4d6415['params']['id']}})[_0x83ed('0x23')](handleEntityNotFound(_0x4f04d1,null))[_0x83ed('0x23')](saveUpdates(_0x4d6415[_0x83ed('0x47')],null))[_0x83ed('0x23')](respondWithResult(_0x4f04d1,null))[_0x83ed('0x3e')](handleError(_0x4f04d1,null));};exports[_0x83ed('0x24')]=function(_0x255c36,_0x28987c){return db['SalesforceConfiguration']['find']({'where':{'id':_0x255c36['params']['id']}})[_0x83ed('0x23')](handleEntityNotFound(_0x28987c,null))[_0x83ed('0x23')](removeEntity(_0x28987c,null))[_0x83ed('0x3e')](handleError(_0x28987c,null));};exports[_0x83ed('0x48')]=function(_0x395e50,_0x50030e,_0x315802){var _0x29786b={};var _0x154113={};var _0x55a87e;var _0x3dafba;return db[_0x83ed('0x2a')][_0x83ed('0x49')]({'where':{'id':_0x395e50[_0x83ed('0x40')]['id']}})[_0x83ed('0x23')](handleEntityNotFound(_0x50030e,null))[_0x83ed('0x23')](function(_0x33dabf){if(_0x33dabf){_0x55a87e=_0x33dabf;_0x154113[_0x83ed('0x2e')]=_['keys'](db['SalesforceField'][_0x83ed('0x41')]);_0x154113[_0x83ed('0x2f')]=_[_0x83ed('0x30')](_0x395e50[_0x83ed('0x2f')]);_0x154113[_0x83ed('0x31')]=_['intersection'](_0x154113[_0x83ed('0x2e')],_0x154113[_0x83ed('0x2f')]);_0x29786b['attributes']=_[_0x83ed('0x33')](_0x154113[_0x83ed('0x2e')],qs['fields'](_0x395e50[_0x83ed('0x2f')][_0x83ed('0x34')]));_0x29786b[_0x83ed('0x32')]=_0x29786b['attributes']['length']?_0x29786b[_0x83ed('0x32')]:_0x154113['model'];_0x29786b[_0x83ed('0x4a')]=qs['sort'](_0x395e50[_0x83ed('0x2f')]['sort']);_0x29786b['where']=qs['filters'](_[_0x83ed('0x38')](_0x395e50[_0x83ed('0x2f')],_0x154113['filters']));if(_0x395e50[_0x83ed('0x2f')][_0x83ed('0x39')]){_0x29786b[_0x83ed('0x37')]=_[_0x83ed('0x3b')](_0x29786b[_0x83ed('0x37')],{'$or':_[_0x83ed('0x29')](_0x29786b[_0x83ed('0x32')],function(_0xe5c740){var _0x4809d0={};_0x4809d0[_0xe5c740]={'$like':'%'+_0x395e50[_0x83ed('0x2f')][_0x83ed('0x39')]+'%'};return _0x4809d0;})});}_0x29786b=_['merge']({},_0x29786b,_0x395e50[_0x83ed('0x44')]);return _0x55a87e[_0x83ed('0x48')](_0x29786b);}})[_0x83ed('0x23')](function(_0xf2dbf4){if(_0xf2dbf4){_0x3dafba=_0xf2dbf4[_0x83ed('0x42')];if(!_0x395e50[_0x83ed('0x2f')][_0x83ed('0x4b')]('nolimit')){_0x29786b[_0x83ed('0x1c')]=qs[_0x83ed('0x1c')](_0x395e50[_0x83ed('0x2f')][_0x83ed('0x1c')]);_0x29786b[_0x83ed('0x1a')]=qs[_0x83ed('0x1a')](_0x395e50[_0x83ed('0x2f')][_0x83ed('0x1a')]);}return _0x55a87e[_0x83ed('0x48')](_0x29786b);}})[_0x83ed('0x23')](function(_0x2e2c58){if(_0x2e2c58){return _0x2e2c58?{'count':_0x3dafba,'rows':_0x2e2c58}:null;}})['then'](respondWithResult(_0x50030e,null))['catch'](handleError(_0x50030e,null));};exports[_0x83ed('0x4c')]=function(_0x42e03c,_0x3586cf,_0x288b17){var _0x4db91c={};var _0xfd178e={};var _0x395507;var _0x116477;return db[_0x83ed('0x2a')][_0x83ed('0x49')]({'where':{'id':_0x42e03c[_0x83ed('0x40')]['id']}})[_0x83ed('0x23')](handleEntityNotFound(_0x3586cf,null))[_0x83ed('0x23')](function(_0x30da36){if(_0x30da36){_0x395507=_0x30da36;_0xfd178e[_0x83ed('0x2e')]=_['keys'](db[_0x83ed('0x4d')][_0x83ed('0x41')]);_0xfd178e[_0x83ed('0x2f')]=_[_0x83ed('0x30')](_0x42e03c[_0x83ed('0x2f')]);_0xfd178e[_0x83ed('0x31')]=_[_0x83ed('0x33')](_0xfd178e[_0x83ed('0x2e')],_0xfd178e[_0x83ed('0x2f')]);_0x4db91c[_0x83ed('0x32')]=_[_0x83ed('0x33')](_0xfd178e[_0x83ed('0x2e')],qs[_0x83ed('0x34')](_0x42e03c[_0x83ed('0x2f')][_0x83ed('0x34')]));_0x4db91c[_0x83ed('0x32')]=_0x4db91c[_0x83ed('0x32')][_0x83ed('0x42')]?_0x4db91c[_0x83ed('0x32')]:_0xfd178e['model'];_0x4db91c['order']=qs['sort'](_0x42e03c[_0x83ed('0x2f')][_0x83ed('0x36')]);_0x4db91c['where']=qs[_0x83ed('0x31')](_[_0x83ed('0x38')](_0x42e03c[_0x83ed('0x2f')],_0xfd178e[_0x83ed('0x31')]));if(_0x42e03c['query']['filter']){_0x4db91c['where']=_[_0x83ed('0x3b')](_0x4db91c[_0x83ed('0x37')],{'$or':_['map'](_0x4db91c[_0x83ed('0x32')],function(_0x5c62b1){var _0x3c4aa3={};_0x3c4aa3[_0x5c62b1]={'$like':'%'+_0x42e03c[_0x83ed('0x2f')][_0x83ed('0x39')]+'%'};return _0x3c4aa3;})});}_0x4db91c=_[_0x83ed('0x3b')]({},_0x4db91c,_0x42e03c['options']);return _0x395507['getSubjects'](_0x4db91c);}})[_0x83ed('0x23')](function(_0x48ab8d){if(_0x48ab8d){_0x116477=_0x48ab8d[_0x83ed('0x42')];if(!_0x42e03c[_0x83ed('0x2f')]['hasOwnProperty'](_0x83ed('0x35'))){_0x4db91c[_0x83ed('0x1c')]=qs[_0x83ed('0x1c')](_0x42e03c[_0x83ed('0x2f')][_0x83ed('0x1c')]);_0x4db91c[_0x83ed('0x1a')]=qs[_0x83ed('0x1a')](_0x42e03c[_0x83ed('0x2f')][_0x83ed('0x1a')]);}return _0x395507[_0x83ed('0x4c')](_0x4db91c);}})[_0x83ed('0x23')](function(_0xa2044f){if(_0xa2044f){return _0xa2044f?{'count':_0x116477,'rows':_0xa2044f}:null;}})[_0x83ed('0x23')](respondWithResult(_0x3586cf,null))['catch'](handleError(_0x3586cf,null));};exports['getDescriptions']=function(_0x5cadf1,_0x35870e,_0x1fe61e){var _0x291c62={};var _0x39ddb6={};var _0x88d114;var _0x30d0f8;return db[_0x83ed('0x2a')][_0x83ed('0x49')]({'where':{'id':_0x5cadf1[_0x83ed('0x40')]['id']}})[_0x83ed('0x23')](handleEntityNotFound(_0x35870e,null))[_0x83ed('0x23')](function(_0x26221e){if(_0x26221e){_0x88d114=_0x26221e;_0x39ddb6[_0x83ed('0x2e')]=_['keys'](db[_0x83ed('0x4d')][_0x83ed('0x41')]);_0x39ddb6[_0x83ed('0x2f')]=_[_0x83ed('0x30')](_0x5cadf1[_0x83ed('0x2f')]);_0x39ddb6[_0x83ed('0x31')]=_['intersection'](_0x39ddb6['model'],_0x39ddb6['query']);_0x291c62[_0x83ed('0x32')]=_[_0x83ed('0x33')](_0x39ddb6[_0x83ed('0x2e')],qs[_0x83ed('0x34')](_0x5cadf1[_0x83ed('0x2f')][_0x83ed('0x34')]));_0x291c62[_0x83ed('0x32')]=_0x291c62[_0x83ed('0x32')][_0x83ed('0x42')]?_0x291c62[_0x83ed('0x32')]:_0x39ddb6[_0x83ed('0x2e')];_0x291c62[_0x83ed('0x4a')]=qs['sort'](_0x5cadf1[_0x83ed('0x2f')][_0x83ed('0x36')]);_0x291c62[_0x83ed('0x37')]=qs[_0x83ed('0x31')](_['pick'](_0x5cadf1['query'],_0x39ddb6[_0x83ed('0x31')]));if(_0x5cadf1[_0x83ed('0x2f')][_0x83ed('0x39')]){_0x291c62[_0x83ed('0x37')]=_[_0x83ed('0x3b')](_0x291c62[_0x83ed('0x37')],{'$or':_[_0x83ed('0x29')](_0x291c62[_0x83ed('0x32')],function(_0x4a8cf4){var _0xdf74={};_0xdf74[_0x4a8cf4]={'$like':'%'+_0x5cadf1[_0x83ed('0x2f')][_0x83ed('0x39')]+'%'};return _0xdf74;})});}_0x291c62=_[_0x83ed('0x3b')]({},_0x291c62,_0x5cadf1[_0x83ed('0x44')]);return _0x88d114[_0x83ed('0x4e')](_0x291c62);}})[_0x83ed('0x23')](function(_0x23f836){if(_0x23f836){_0x30d0f8=_0x23f836[_0x83ed('0x42')];if(!_0x5cadf1[_0x83ed('0x2f')][_0x83ed('0x4b')](_0x83ed('0x35'))){_0x291c62['limit']=qs[_0x83ed('0x1c')](_0x5cadf1[_0x83ed('0x2f')]['limit']);_0x291c62[_0x83ed('0x1a')]=qs[_0x83ed('0x1a')](_0x5cadf1[_0x83ed('0x2f')]['offset']);}return _0x88d114[_0x83ed('0x4e')](_0x291c62);}})[_0x83ed('0x23')](function(_0x45e3c0){if(_0x45e3c0){return _0x45e3c0?{'count':_0x30d0f8,'rows':_0x45e3c0}:null;}})['then'](respondWithResult(_0x35870e,null))['catch'](handleError(_0x35870e,null));}; \ No newline at end of file +var _0xbf9a=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','SalesforceConfiguration','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','findOne','SalesforceField','order','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x31bcb2,_0x23cc0e){var _0x3f150c=function(_0x119f71){while(--_0x119f71){_0x31bcb2['push'](_0x31bcb2['shift']());}};_0x3f150c(++_0x23cc0e);}(_0xbf9a,0x7e));var _0xabf9=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0xbf9a[_0x46ae5a];return _0x434986;};'use strict';var emlformat=require(_0xabf9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabf9('0x1'));var jsonpatch=require(_0xabf9('0x2'));var rp=require(_0xabf9('0x3'));var moment=require('moment');var BPromise=require(_0xabf9('0x4'));var Mustache=require(_0xabf9('0x5'));var util=require(_0xabf9('0x6'));var path=require(_0xabf9('0x7'));var sox=require(_0xabf9('0x8'));var csv=require(_0xabf9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xabf9('0xa'));var _=require(_0xabf9('0xb'));var squel=require(_0xabf9('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xabf9('0xd'));var Redis=require('ioredis');var authService=require(_0xabf9('0xe'));var qs=require(_0xabf9('0xf'));var as=require(_0xabf9('0x10'));var hardwareService=require(_0xabf9('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xabf9('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xabf9('0x13'));var db=require(_0xabf9('0x14'))['db'];function respondWithStatusCode(_0x36d4c9,_0x53493b){_0x53493b=_0x53493b||0xcc;return function(_0x4e932a){if(_0x4e932a){return _0x36d4c9[_0xabf9('0x15')](_0x53493b);}return _0x36d4c9[_0xabf9('0x16')](_0x53493b)[_0xabf9('0x17')]();};}function respondWithResult(_0x115f94,_0x1fafd3){_0x1fafd3=_0x1fafd3||0xc8;return function(_0x54b6f3){if(_0x54b6f3){return _0x115f94[_0xabf9('0x16')](_0x1fafd3)[_0xabf9('0x18')](_0x54b6f3);}};}function respondWithFilteredResult(_0x501785,_0x373ce0){return function(_0x5199e9){if(_0x5199e9){var _0x5228af=typeof _0x373ce0[_0xabf9('0x19')]===_0xabf9('0x1a')&&typeof _0x373ce0[_0xabf9('0x1b')]===_0xabf9('0x1a');var _0x30362f=_0x5199e9[_0xabf9('0x1c')];var _0x3d3c48=_0x5228af?0x0:_0x373ce0[_0xabf9('0x19')];var _0x3eb254=_0x5228af?_0x5199e9[_0xabf9('0x1c')]:_0x373ce0[_0xabf9('0x19')]+_0x373ce0[_0xabf9('0x1b')];var _0x5e22f7;if(_0x3eb254>=_0x30362f){_0x3eb254=_0x30362f;_0x5e22f7=0xc8;}else{_0x5e22f7=0xce;}_0x501785[_0xabf9('0x16')](_0x5e22f7);return _0x501785[_0xabf9('0x1d')](_0xabf9('0x1e'),_0x3d3c48+'-'+_0x3eb254+'/'+_0x30362f)[_0xabf9('0x18')](_0x5199e9);}return null;};}function patchUpdates(_0x11ded1){return function(_0x4db8eb){try{jsonpatch[_0xabf9('0x1f')](_0x4db8eb,_0x11ded1,!![]);}catch(_0x4bcf76){return BPromise[_0xabf9('0x20')](_0x4bcf76);}return _0x4db8eb['save']();};}function saveUpdates(_0x3ee6a6,_0x506d5c){return function(_0x47c116){if(_0x47c116){return _0x47c116[_0xabf9('0x21')](_0x3ee6a6)[_0xabf9('0x22')](function(_0x87b919){return _0x87b919;});}return null;};}function removeEntity(_0x4057db,_0x5a9e86){return function(_0x44ec36){if(_0x44ec36){return _0x44ec36[_0xabf9('0x23')]()[_0xabf9('0x22')](function(){_0x4057db[_0xabf9('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f2434,_0x3f43e2){return function(_0x4ef7fc){if(!_0x4ef7fc){_0x3f2434[_0xabf9('0x15')](0x194);}return _0x4ef7fc;};}function handleError(_0x59b202,_0x5d8a97){_0x5d8a97=_0x5d8a97||0x1f4;return function(_0xb51548){logger['error'](_0xb51548['stack']);if(_0xb51548[_0xabf9('0x24')]){delete _0xb51548['name'];}_0x59b202[_0xabf9('0x16')](_0x5d8a97)[_0xabf9('0x25')](_0xb51548);};}exports[_0xabf9('0x26')]=function(_0x141907,_0x298051){var _0x2560b9={},_0x1a37ce={},_0x230a4c={'count':0x0,'rows':[]};var _0x30b44c=_[_0xabf9('0x27')](db['SalesforceConfiguration']['rawAttributes'],function(_0x68be46){return{'name':_0x68be46['fieldName'],'type':_0x68be46[_0xabf9('0x28')][_0xabf9('0x29')]};});_0x1a37ce[_0xabf9('0x2a')]=_['map'](_0x30b44c,'name');_0x1a37ce['query']=_[_0xabf9('0x2b')](_0x141907[_0xabf9('0x2c')]);_0x1a37ce[_0xabf9('0x2d')]=_[_0xabf9('0x2e')](_0x1a37ce[_0xabf9('0x2a')],_0x1a37ce[_0xabf9('0x2c')]);_0x2560b9[_0xabf9('0x2f')]=_[_0xabf9('0x2e')](_0x1a37ce[_0xabf9('0x2a')],qs['fields'](_0x141907['query'][_0xabf9('0x30')]));_0x2560b9[_0xabf9('0x2f')]=_0x2560b9[_0xabf9('0x2f')][_0xabf9('0x31')]?_0x2560b9[_0xabf9('0x2f')]:_0x1a37ce['model'];if(!_0x141907[_0xabf9('0x2c')][_0xabf9('0x32')](_0xabf9('0x33'))){_0x2560b9[_0xabf9('0x1b')]=qs[_0xabf9('0x1b')](_0x141907[_0xabf9('0x2c')][_0xabf9('0x1b')]);_0x2560b9[_0xabf9('0x19')]=qs[_0xabf9('0x19')](_0x141907[_0xabf9('0x2c')][_0xabf9('0x19')]);}_0x2560b9['order']=qs['sort'](_0x141907[_0xabf9('0x2c')][_0xabf9('0x34')]);_0x2560b9[_0xabf9('0x35')]=qs[_0xabf9('0x2d')](_[_0xabf9('0x36')](_0x141907['query'],_0x1a37ce[_0xabf9('0x2d')]),_0x30b44c);if(_0x141907['query'][_0xabf9('0x37')]){_0x2560b9[_0xabf9('0x35')]=_['merge'](_0x2560b9[_0xabf9('0x35')],{'$or':_['map'](_0x30b44c,function(_0x1e8f69){if(_0x1e8f69[_0xabf9('0x28')]!=='VIRTUAL'){var _0x46035b={};_0x46035b[_0x1e8f69[_0xabf9('0x24')]]={'$like':'%'+_0x141907[_0xabf9('0x2c')][_0xabf9('0x37')]+'%'};return _0x46035b;}})});}_0x2560b9=_[_0xabf9('0x38')]({},_0x2560b9,_0x141907['options']);var _0x32d357={'where':_0x2560b9['where']};return db[_0xabf9('0x39')]['count'](_0x32d357)[_0xabf9('0x22')](function(_0x44dd0e){_0x230a4c[_0xabf9('0x1c')]=_0x44dd0e;if(_0x141907[_0xabf9('0x2c')][_0xabf9('0x3a')]){_0x2560b9[_0xabf9('0x3b')]=[{'all':!![]}];}return db[_0xabf9('0x39')][_0xabf9('0x3c')](_0x2560b9);})['then'](function(_0x1b940a){_0x230a4c['rows']=_0x1b940a;return _0x230a4c;})[_0xabf9('0x22')](respondWithFilteredResult(_0x298051,_0x2560b9))[_0xabf9('0x3d')](handleError(_0x298051,null));};exports[_0xabf9('0x3e')]=function(_0x432e72,_0x3c94af){var _0x33b928={'raw':![],'where':{'id':_0x432e72[_0xabf9('0x3f')]['id']}},_0x47fec2={};_0x47fec2[_0xabf9('0x2a')]=_['keys'](db[_0xabf9('0x39')][_0xabf9('0x40')]);_0x47fec2[_0xabf9('0x2c')]=_['keys'](_0x432e72[_0xabf9('0x2c')]);_0x47fec2[_0xabf9('0x2d')]=_[_0xabf9('0x2e')](_0x47fec2[_0xabf9('0x2a')],_0x47fec2['query']);_0x33b928[_0xabf9('0x2f')]=_[_0xabf9('0x2e')](_0x47fec2[_0xabf9('0x2a')],qs['fields'](_0x432e72['query']['fields']));_0x33b928['attributes']=_0x33b928[_0xabf9('0x2f')][_0xabf9('0x31')]?_0x33b928[_0xabf9('0x2f')]:_0x47fec2['model'];if(_0x432e72[_0xabf9('0x2c')][_0xabf9('0x3a')]){_0x33b928[_0xabf9('0x3b')]=[{'all':!![]}];}_0x33b928=_[_0xabf9('0x38')]({},_0x33b928,_0x432e72[_0xabf9('0x41')]);return db[_0xabf9('0x39')][_0xabf9('0x42')](_0x33b928)['then'](handleEntityNotFound(_0x3c94af,null))[_0xabf9('0x22')](respondWithResult(_0x3c94af,null))[_0xabf9('0x3d')](handleError(_0x3c94af,null));};exports[_0xabf9('0x43')]=function(_0x134b07,_0x33eb63){return db[_0xabf9('0x39')][_0xabf9('0x43')](_0x134b07[_0xabf9('0x44')],{})[_0xabf9('0x22')](respondWithResult(_0x33eb63,0xc9))[_0xabf9('0x3d')](handleError(_0x33eb63,null));};exports[_0xabf9('0x21')]=function(_0x55085a,_0xd55aea){if(_0x55085a['body']['id']){delete _0x55085a[_0xabf9('0x44')]['id'];}return db[_0xabf9('0x39')][_0xabf9('0x42')]({'where':{'id':_0x55085a['params']['id']}})[_0xabf9('0x22')](handleEntityNotFound(_0xd55aea,null))['then'](saveUpdates(_0x55085a[_0xabf9('0x44')],null))[_0xabf9('0x22')](respondWithResult(_0xd55aea,null))[_0xabf9('0x3d')](handleError(_0xd55aea,null));};exports[_0xabf9('0x23')]=function(_0x474b6b,_0x39a979){return db[_0xabf9('0x39')][_0xabf9('0x42')]({'where':{'id':_0x474b6b[_0xabf9('0x3f')]['id']}})[_0xabf9('0x22')](handleEntityNotFound(_0x39a979,null))[_0xabf9('0x22')](removeEntity(_0x39a979,null))['catch'](handleError(_0x39a979,null));};exports['getFields']=function(_0x4a986b,_0x116056,_0xfeb74f){var _0x282d35={};var _0x4801e7={};var _0x432263;var _0x2e957f;return db[_0xabf9('0x39')][_0xabf9('0x45')]({'where':{'id':_0x4a986b[_0xabf9('0x3f')]['id']}})[_0xabf9('0x22')](handleEntityNotFound(_0x116056,null))[_0xabf9('0x22')](function(_0x39e8c6){if(_0x39e8c6){_0x432263=_0x39e8c6;_0x4801e7['model']=_[_0xabf9('0x2b')](db[_0xabf9('0x46')]['rawAttributes']);_0x4801e7[_0xabf9('0x2c')]=_[_0xabf9('0x2b')](_0x4a986b['query']);_0x4801e7[_0xabf9('0x2d')]=_[_0xabf9('0x2e')](_0x4801e7[_0xabf9('0x2a')],_0x4801e7[_0xabf9('0x2c')]);_0x282d35[_0xabf9('0x2f')]=_['intersection'](_0x4801e7['model'],qs[_0xabf9('0x30')](_0x4a986b[_0xabf9('0x2c')][_0xabf9('0x30')]));_0x282d35['attributes']=_0x282d35['attributes'][_0xabf9('0x31')]?_0x282d35[_0xabf9('0x2f')]:_0x4801e7[_0xabf9('0x2a')];_0x282d35[_0xabf9('0x47')]=qs[_0xabf9('0x34')](_0x4a986b[_0xabf9('0x2c')][_0xabf9('0x34')]);_0x282d35['where']=qs[_0xabf9('0x2d')](_[_0xabf9('0x36')](_0x4a986b[_0xabf9('0x2c')],_0x4801e7['filters']));if(_0x4a986b['query'][_0xabf9('0x37')]){_0x282d35[_0xabf9('0x35')]=_[_0xabf9('0x38')](_0x282d35[_0xabf9('0x35')],{'$or':_[_0xabf9('0x27')](_0x282d35['attributes'],function(_0x4c3aff){var _0x1e7311={};_0x1e7311[_0x4c3aff]={'$like':'%'+_0x4a986b[_0xabf9('0x2c')]['filter']+'%'};return _0x1e7311;})});}_0x282d35=_['merge']({},_0x282d35,_0x4a986b[_0xabf9('0x41')]);return _0x432263[_0xabf9('0x48')](_0x282d35);}})[_0xabf9('0x22')](function(_0xa25d1d){if(_0xa25d1d){_0x2e957f=_0xa25d1d['length'];if(!_0x4a986b['query'][_0xabf9('0x32')](_0xabf9('0x33'))){_0x282d35['limit']=qs[_0xabf9('0x1b')](_0x4a986b['query'][_0xabf9('0x1b')]);_0x282d35[_0xabf9('0x19')]=qs[_0xabf9('0x19')](_0x4a986b['query']['offset']);}return _0x432263['getFields'](_0x282d35);}})['then'](function(_0x2b842e){if(_0x2b842e){return _0x2b842e?{'count':_0x2e957f,'rows':_0x2b842e}:null;}})['then'](respondWithResult(_0x116056,null))['catch'](handleError(_0x116056,null));};exports[_0xabf9('0x49')]=function(_0x32d3e8,_0xadb286,_0x561cb4){var _0x4d462b={};var _0x435e93={};var _0x5e28e8;var _0x54d072;return db[_0xabf9('0x39')][_0xabf9('0x45')]({'where':{'id':_0x32d3e8[_0xabf9('0x3f')]['id']}})['then'](handleEntityNotFound(_0xadb286,null))[_0xabf9('0x22')](function(_0x52e29e){if(_0x52e29e){_0x5e28e8=_0x52e29e;_0x435e93[_0xabf9('0x2a')]=_['keys'](db[_0xabf9('0x46')][_0xabf9('0x40')]);_0x435e93['query']=_['keys'](_0x32d3e8[_0xabf9('0x2c')]);_0x435e93[_0xabf9('0x2d')]=_[_0xabf9('0x2e')](_0x435e93['model'],_0x435e93[_0xabf9('0x2c')]);_0x4d462b[_0xabf9('0x2f')]=_[_0xabf9('0x2e')](_0x435e93[_0xabf9('0x2a')],qs[_0xabf9('0x30')](_0x32d3e8[_0xabf9('0x2c')][_0xabf9('0x30')]));_0x4d462b[_0xabf9('0x2f')]=_0x4d462b['attributes']['length']?_0x4d462b[_0xabf9('0x2f')]:_0x435e93[_0xabf9('0x2a')];_0x4d462b[_0xabf9('0x47')]=qs['sort'](_0x32d3e8[_0xabf9('0x2c')][_0xabf9('0x34')]);_0x4d462b[_0xabf9('0x35')]=qs[_0xabf9('0x2d')](_[_0xabf9('0x36')](_0x32d3e8[_0xabf9('0x2c')],_0x435e93[_0xabf9('0x2d')]));if(_0x32d3e8[_0xabf9('0x2c')][_0xabf9('0x37')]){_0x4d462b['where']=_[_0xabf9('0x38')](_0x4d462b[_0xabf9('0x35')],{'$or':_[_0xabf9('0x27')](_0x4d462b['attributes'],function(_0x46f410){var _0x36edee={};_0x36edee[_0x46f410]={'$like':'%'+_0x32d3e8['query']['filter']+'%'};return _0x36edee;})});}_0x4d462b=_[_0xabf9('0x38')]({},_0x4d462b,_0x32d3e8[_0xabf9('0x41')]);return _0x5e28e8[_0xabf9('0x49')](_0x4d462b);}})[_0xabf9('0x22')](function(_0x4730dc){if(_0x4730dc){_0x54d072=_0x4730dc[_0xabf9('0x31')];if(!_0x32d3e8[_0xabf9('0x2c')][_0xabf9('0x32')](_0xabf9('0x33'))){_0x4d462b['limit']=qs['limit'](_0x32d3e8[_0xabf9('0x2c')][_0xabf9('0x1b')]);_0x4d462b[_0xabf9('0x19')]=qs[_0xabf9('0x19')](_0x32d3e8['query']['offset']);}return _0x5e28e8[_0xabf9('0x49')](_0x4d462b);}})[_0xabf9('0x22')](function(_0x3cdc73){if(_0x3cdc73){return _0x3cdc73?{'count':_0x54d072,'rows':_0x3cdc73}:null;}})[_0xabf9('0x22')](respondWithResult(_0xadb286,null))[_0xabf9('0x3d')](handleError(_0xadb286,null));};exports[_0xabf9('0x4a')]=function(_0x2f6432,_0x34c43a,_0x3dd614){var _0x40c65c={};var _0x1d2b3c={};var _0xacdec8;var _0x18b6d3;return db[_0xabf9('0x39')][_0xabf9('0x45')]({'where':{'id':_0x2f6432[_0xabf9('0x3f')]['id']}})['then'](handleEntityNotFound(_0x34c43a,null))[_0xabf9('0x22')](function(_0xb69bb3){if(_0xb69bb3){_0xacdec8=_0xb69bb3;_0x1d2b3c[_0xabf9('0x2a')]=_[_0xabf9('0x2b')](db[_0xabf9('0x46')][_0xabf9('0x40')]);_0x1d2b3c[_0xabf9('0x2c')]=_[_0xabf9('0x2b')](_0x2f6432['query']);_0x1d2b3c[_0xabf9('0x2d')]=_[_0xabf9('0x2e')](_0x1d2b3c['model'],_0x1d2b3c[_0xabf9('0x2c')]);_0x40c65c['attributes']=_[_0xabf9('0x2e')](_0x1d2b3c[_0xabf9('0x2a')],qs[_0xabf9('0x30')](_0x2f6432[_0xabf9('0x2c')][_0xabf9('0x30')]));_0x40c65c[_0xabf9('0x2f')]=_0x40c65c[_0xabf9('0x2f')][_0xabf9('0x31')]?_0x40c65c[_0xabf9('0x2f')]:_0x1d2b3c[_0xabf9('0x2a')];_0x40c65c[_0xabf9('0x47')]=qs[_0xabf9('0x34')](_0x2f6432[_0xabf9('0x2c')][_0xabf9('0x34')]);_0x40c65c['where']=qs[_0xabf9('0x2d')](_[_0xabf9('0x36')](_0x2f6432[_0xabf9('0x2c')],_0x1d2b3c[_0xabf9('0x2d')]));if(_0x2f6432[_0xabf9('0x2c')][_0xabf9('0x37')]){_0x40c65c[_0xabf9('0x35')]=_[_0xabf9('0x38')](_0x40c65c[_0xabf9('0x35')],{'$or':_[_0xabf9('0x27')](_0x40c65c[_0xabf9('0x2f')],function(_0x514355){var _0x53adaf={};_0x53adaf[_0x514355]={'$like':'%'+_0x2f6432[_0xabf9('0x2c')][_0xabf9('0x37')]+'%'};return _0x53adaf;})});}_0x40c65c=_[_0xabf9('0x38')]({},_0x40c65c,_0x2f6432[_0xabf9('0x41')]);return _0xacdec8['getDescriptions'](_0x40c65c);}})[_0xabf9('0x22')](function(_0x69e6ec){if(_0x69e6ec){_0x18b6d3=_0x69e6ec['length'];if(!_0x2f6432[_0xabf9('0x2c')][_0xabf9('0x32')](_0xabf9('0x33'))){_0x40c65c[_0xabf9('0x1b')]=qs[_0xabf9('0x1b')](_0x2f6432['query']['limit']);_0x40c65c[_0xabf9('0x19')]=qs[_0xabf9('0x19')](_0x2f6432[_0xabf9('0x2c')][_0xabf9('0x19')]);}return _0xacdec8[_0xabf9('0x4a')](_0x40c65c);}})[_0xabf9('0x22')](function(_0x11e349){if(_0x11e349){return _0x11e349?{'count':_0x18b6d3,'rows':_0x11e349}:null;}})[_0xabf9('0x22')](respondWithResult(_0x34c43a,null))['catch'](handleError(_0x34c43a,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index bb5c4ef..f28c91a 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 _0x41d7=['exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes'];(function(_0x5a6fba,_0x22d515){var _0x3bb2a3=function(_0x9e900c){while(--_0x9e900c){_0x5a6fba['push'](_0x5a6fba['shift']());}};_0x3bb2a3(++_0x22d515);}(_0x41d7,0x1c4));var _0x741d=function(_0x30ea21,_0x5703c9){_0x30ea21=_0x30ea21-0x0;var _0x5e016c=_0x41d7[_0x30ea21];return _0x5e016c;};'use strict';var _=require(_0x741d('0x0'));var util=require(_0x741d('0x1'));var logger=require('../../config/logger')(_0x741d('0x2'));var moment=require(_0x741d('0x3'));var BPromise=require(_0x741d('0x4'));var rp=require(_0x741d('0x5'));var fs=require('fs');var path=require(_0x741d('0x6'));var rimraf=require(_0x741d('0x7'));var config=require(_0x741d('0x8'));var attributes=require(_0x741d('0x9'));module[_0x741d('0xa')]=function(_0x1d6a65,_0x372488){return _0x1d6a65[_0x741d('0xb')](_0x741d('0xc'),attributes,{'tableName':_0x741d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8c6=['moment','bluebird','request-promise','path','rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xa8c6,0x96));var _0x6a8c=function(_0x40822a,_0x582b60){_0x40822a=_0x40822a-0x0;var _0x357420=_0xa8c6[_0x40822a];return _0x357420;};'use strict';var _=require(_0x6a8c('0x0'));var util=require(_0x6a8c('0x1'));var logger=require(_0x6a8c('0x2'))(_0x6a8c('0x3'));var moment=require(_0x6a8c('0x4'));var BPromise=require(_0x6a8c('0x5'));var rp=require(_0x6a8c('0x6'));var fs=require('fs');var path=require(_0x6a8c('0x7'));var rimraf=require(_0x6a8c('0x8'));var config=require('../../config/environment');var attributes=require(_0x6a8c('0x9'));module[_0x6a8c('0xa')]=function(_0x22362e,_0x4d6924){return _0x22362e[_0x6a8c('0xb')](_0x6a8c('0xc'),attributes,{'tableName':_0x6a8c('0xd'),'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 bc03ade..c8e77fc 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 _0x1e0f=['SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x32ca7a,_0x4a069d){var _0xab41b9=function(_0x346bfc){while(--_0x346bfc){_0x32ca7a['push'](_0x32ca7a['shift']());}};_0xab41b9(++_0x4a069d);}(_0x1e0f,0x7a));var _0xf1e0=function(_0x4ef40b,_0x565c33){_0x4ef40b=_0x4ef40b-0x0;var _0x4cda63=_0x1e0f[_0x4ef40b];return _0x4cda63;};'use strict';var _=require(_0xf1e0('0x0'));var util=require(_0xf1e0('0x1'));var moment=require('moment');var BPromise=require(_0xf1e0('0x2'));var rs=require(_0xf1e0('0x3'));var fs=require('fs');var Redis=require(_0xf1e0('0x4'));var db=require(_0xf1e0('0x5'))['db'];var utils=require(_0xf1e0('0x6'));var logger=require(_0xf1e0('0x7'))('rpc');var config=require(_0xf1e0('0x8'));var jayson=require(_0xf1e0('0x9'));var client=jayson[_0xf1e0('0xa')][_0xf1e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe4b795,_0x3edcc3,_0x3c623d){return new BPromise(function(_0x1c4a7f,_0xa84487){return client[_0xf1e0('0xc')](_0xe4b795,_0x3c623d)[_0xf1e0('0xd')](function(_0x5064c3){logger['info'](_0xf1e0('0xe'),_0x3edcc3,_0xf1e0('0xf'));logger['debug'](_0xf1e0('0x10'),_0x3edcc3,'request\x20sent',JSON[_0xf1e0('0x11')](_0x5064c3));if(_0x5064c3[_0xf1e0('0x12')]){if(_0x5064c3[_0xf1e0('0x12')]['code']===0x1f4){logger[_0xf1e0('0x12')](_0xf1e0('0xe'),_0x3edcc3,_0x5064c3[_0xf1e0('0x12')][_0xf1e0('0x13')]);return _0xa84487(_0x5064c3[_0xf1e0('0x12')][_0xf1e0('0x13')]);}logger[_0xf1e0('0x12')](_0xf1e0('0xe'),_0x3edcc3,_0x5064c3[_0xf1e0('0x12')]['message']);return _0x1c4a7f(_0x5064c3[_0xf1e0('0x12')][_0xf1e0('0x13')]);}else{logger[_0xf1e0('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3edcc3,_0xf1e0('0xf'));_0x1c4a7f(_0x5064c3[_0xf1e0('0x15')][_0xf1e0('0x13')]);}})[_0xf1e0('0x16')](function(_0x4b29a9){logger[_0xf1e0('0x12')](_0xf1e0('0xe'),_0x3edcc3,_0x4b29a9);_0xa84487(_0x4b29a9);});});} \ No newline at end of file +var _0xd58a=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x14d45f,_0x2d0dbb){var _0x176c80=function(_0x3c2046){while(--_0x3c2046){_0x14d45f['push'](_0x14d45f['shift']());}};_0x176c80(++_0x2d0dbb);}(_0xd58a,0x64));var _0xad58=function(_0x5b775c,_0x2e212b){_0x5b775c=_0x5b775c-0x0;var _0x2d206e=_0xd58a[_0x5b775c];return _0x2d206e;};'use strict';var _=require(_0xad58('0x0'));var util=require(_0xad58('0x1'));var moment=require(_0xad58('0x2'));var BPromise=require(_0xad58('0x3'));var rs=require(_0xad58('0x4'));var fs=require('fs');var Redis=require(_0xad58('0x5'));var db=require(_0xad58('0x6'))['db'];var utils=require(_0xad58('0x7'));var logger=require(_0xad58('0x8'))(_0xad58('0x9'));var config=require(_0xad58('0xa'));var jayson=require(_0xad58('0xb'));var client=jayson[_0xad58('0xc')][_0xad58('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x42a106,_0x101ba5,_0x52a760){return new BPromise(function(_0xa5f748,_0x4b6433){return client[_0xad58('0xe')](_0x42a106,_0x52a760)['then'](function(_0x4d5cb0){logger[_0xad58('0xf')](_0xad58('0x10'),_0x101ba5,_0xad58('0x11'));logger[_0xad58('0x12')](_0xad58('0x13'),_0x101ba5,_0xad58('0x11'),JSON[_0xad58('0x14')](_0x4d5cb0));if(_0x4d5cb0[_0xad58('0x15')]){if(_0x4d5cb0[_0xad58('0x15')][_0xad58('0x16')]===0x1f4){logger[_0xad58('0x15')](_0xad58('0x10'),_0x101ba5,_0x4d5cb0[_0xad58('0x15')][_0xad58('0x17')]);return _0x4b6433(_0x4d5cb0['error'][_0xad58('0x17')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x101ba5,_0x4d5cb0['error'][_0xad58('0x17')]);return _0xa5f748(_0x4d5cb0['error'][_0xad58('0x17')]);}else{logger[_0xad58('0xf')](_0xad58('0x10'),_0x101ba5,_0xad58('0x11'));_0xa5f748(_0x4d5cb0[_0xad58('0x18')][_0xad58('0x17')]);}})['catch'](function(_0x5f7a50){logger['error'](_0xad58('0x10'),_0x101ba5,_0x5f7a50);_0x4b6433(_0x5f7a50);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 67f3073..a86ff94 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 _0x11ba=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','multer'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x11ba,0xa1));var _0xa11b=function(_0x2dc3bc,_0xc186bc){_0x2dc3bc=_0x2dc3bc-0x0;var _0xae38d5=_0x11ba[_0x2dc3bc];return _0xae38d5;};'use strict';var multer=require(_0xa11b('0x0'));var util=require(_0xa11b('0x1'));var path=require(_0xa11b('0x2'));var timeout=require(_0xa11b('0x3'));var express=require(_0xa11b('0x4'));var router=express[_0xa11b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa11b('0x6'));var config=require(_0xa11b('0x7'));var controller=require('./intSalesforceField.controller');router[_0xa11b('0x8')]('/',auth[_0xa11b('0x9')](),controller[_0xa11b('0xa')]);router['get']('/:id',auth[_0xa11b('0x9')](),controller[_0xa11b('0xb')]);router[_0xa11b('0xc')]('/',auth[_0xa11b('0x9')](),controller[_0xa11b('0xd')]);router[_0xa11b('0xe')](_0xa11b('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xa11b('0x10')](_0xa11b('0xf'),auth[_0xa11b('0x9')](),controller[_0xa11b('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3184=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intSalesforceField.controller','get','show','create','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x1f4202,_0x5350da){var _0x47bb0d=function(_0x3052e9){while(--_0x3052e9){_0x1f4202['push'](_0x1f4202['shift']());}};_0x47bb0d(++_0x5350da);}(_0x3184,0xfc));var _0x4318=function(_0x3c5272,_0x1ea873){_0x3c5272=_0x3c5272-0x0;var _0x31a12a=_0x3184[_0x3c5272];return _0x31a12a;};'use strict';var multer=require(_0x4318('0x0'));var util=require(_0x4318('0x1'));var path=require(_0x4318('0x2'));var timeout=require(_0x4318('0x3'));var express=require(_0x4318('0x4'));var router=express[_0x4318('0x5')]();var fs_extra=require(_0x4318('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4318('0x7'));var config=require('../../config/environment');var controller=require(_0x4318('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4318('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4318('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4318('0xb')]);router['put'](_0x4318('0xc'),auth[_0x4318('0xd')](),controller[_0x4318('0xe')]);router[_0x4318('0xf')](_0x4318('0xc'),auth[_0x4318('0xd')](),controller[_0x4318('0x10')]);module[_0x4318('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index c95b331..3edf365 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 _0x3839=['customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x177d22,_0x48fd06){var _0xb1fc0=function(_0x399f5d){while(--_0x399f5d){_0x177d22['push'](_0x177d22['shift']());}};_0xb1fc0(++_0x48fd06);}(_0x3839,0x1bd));var _0x9383=function(_0x556dd0,_0x344003){_0x556dd0=_0x556dd0-0x0;var _0x1bd15c=_0x3839[_0x556dd0];return _0x1bd15c;};'use strict';var Sequelize=require(_0x9383('0x0'));module[_0x9383('0x1')]={'type':{'type':Sequelize[_0x9383('0x2')](_0x9383('0x3'),_0x9383('0x4'),_0x9383('0x5'),_0x9383('0x6'),_0x9383('0x7')),'defaultValue':_0x9383('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9383('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x9383('0x3'),_0x9383('0x4'),_0x9383('0x5'))},'keyContent':{'type':Sequelize[_0x9383('0x8')]},'idField':{'type':Sequelize[_0x9383('0x8')]},'variableName':{'type':Sequelize[_0x9383('0x8')]}}; \ No newline at end of file +var _0x853d=['STRING','string','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x405eaa,_0xb13aed){var _0x51af02=function(_0x22a8e0){while(--_0x22a8e0){_0x405eaa['push'](_0x405eaa['shift']());}};_0x51af02(++_0xb13aed);}(_0x853d,0x9b));var _0xd853=function(_0x4c53c2,_0x4e6d80){_0x4c53c2=_0x4c53c2-0x0;var _0x1ebf6a=_0x853d[_0x4c53c2];return _0x1ebf6a;};'use strict';var Sequelize=require(_0xd853('0x0'));module[_0xd853('0x1')]={'type':{'type':Sequelize[_0xd853('0x2')]('string',_0xd853('0x3'),_0xd853('0x4'),_0xd853('0x5'),_0xd853('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd853('0x7')]},'key':{'type':Sequelize[_0xd853('0x7')]},'keyType':{'type':Sequelize[_0xd853('0x2')](_0xd853('0x8'),'variable',_0xd853('0x4'))},'keyContent':{'type':Sequelize[_0xd853('0x7')]},'idField':{'type':Sequelize[_0xd853('0x7')]},'variableName':{'type':Sequelize[_0xd853('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index bdfc378..41a0bb0 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 _0x7eec=['options','find','catch','body','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','Content-Range','apply','reject','update','then','destroy','error','name','map','SalesforceField','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys'];(function(_0x2274be,_0x20b4e6){var _0x358328=function(_0x87411f){while(--_0x87411f){_0x2274be['push'](_0x2274be['shift']());}};_0x358328(++_0x20b4e6);}(_0x7eec,0x98));var _0xc7ee=function(_0x371c7d,_0x6f7f67){_0x371c7d=_0x371c7d-0x0;var _0x1b5f05=_0x7eec[_0x371c7d];return _0x1b5f05;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc7ee('0x0'));var jsonpatch=require(_0xc7ee('0x1'));var rp=require(_0xc7ee('0x2'));var moment=require(_0xc7ee('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc7ee('0x4'));var util=require(_0xc7ee('0x5'));var path=require(_0xc7ee('0x6'));var sox=require(_0xc7ee('0x7'));var csv=require(_0xc7ee('0x8'));var ejs=require(_0xc7ee('0x9'));var fs=require('fs');var fs_extra=require(_0xc7ee('0xa'));var _=require(_0xc7ee('0xb'));var squel=require(_0xc7ee('0xc'));var crypto=require(_0xc7ee('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc7ee('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc7ee('0xf'));var Papa=require(_0xc7ee('0x10'));var Redis=require(_0xc7ee('0x11'));var authService=require(_0xc7ee('0x12'));var qs=require(_0xc7ee('0x13'));var as=require(_0xc7ee('0x14'));var hardwareService=require(_0xc7ee('0x15'));var logger=require(_0xc7ee('0x16'))(_0xc7ee('0x17'));var utils=require(_0xc7ee('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc7ee('0x19'));var db=require(_0xc7ee('0x1a'))['db'];function respondWithStatusCode(_0x17b3b9,_0x13b3ae){_0x13b3ae=_0x13b3ae||0xcc;return function(_0x50959d){if(_0x50959d){return _0x17b3b9[_0xc7ee('0x1b')](_0x13b3ae);}return _0x17b3b9['status'](_0x13b3ae)[_0xc7ee('0x1c')]();};}function respondWithResult(_0x29ac46,_0x864320){_0x864320=_0x864320||0xc8;return function(_0x1ba9bb){if(_0x1ba9bb){return _0x29ac46[_0xc7ee('0x1d')](_0x864320)[_0xc7ee('0x1e')](_0x1ba9bb);}};}function respondWithFilteredResult(_0x2e1a65,_0x59f92a){return function(_0xa3e36e){if(_0xa3e36e){var _0x4d2c18=typeof _0x59f92a[_0xc7ee('0x1f')]==='undefined'&&typeof _0x59f92a[_0xc7ee('0x20')]==='undefined';var _0x25a819=_0xa3e36e[_0xc7ee('0x21')];var _0x55e797=_0x4d2c18?0x0:_0x59f92a[_0xc7ee('0x1f')];var _0x12c7fc=_0x4d2c18?_0xa3e36e['count']:_0x59f92a[_0xc7ee('0x1f')]+_0x59f92a[_0xc7ee('0x20')];var _0x25b6ff;if(_0x12c7fc>=_0x25a819){_0x12c7fc=_0x25a819;_0x25b6ff=0xc8;}else{_0x25b6ff=0xce;}_0x2e1a65[_0xc7ee('0x1d')](_0x25b6ff);return _0x2e1a65['set'](_0xc7ee('0x22'),_0x55e797+'-'+_0x12c7fc+'/'+_0x25a819)[_0xc7ee('0x1e')](_0xa3e36e);}return null;};}function patchUpdates(_0x585204){return function(_0x241f7d){try{jsonpatch[_0xc7ee('0x23')](_0x241f7d,_0x585204,!![]);}catch(_0x23979a){return BPromise[_0xc7ee('0x24')](_0x23979a);}return _0x241f7d['save']();};}function saveUpdates(_0x5a18e5,_0x536a13){return function(_0x14882f){if(_0x14882f){return _0x14882f[_0xc7ee('0x25')](_0x5a18e5)[_0xc7ee('0x26')](function(_0x48f7ac){return _0x48f7ac;});}return null;};}function removeEntity(_0x29c7eb,_0x5875fe){return function(_0x1a04ad){if(_0x1a04ad){return _0x1a04ad[_0xc7ee('0x27')]()[_0xc7ee('0x26')](function(){_0x29c7eb[_0xc7ee('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29b5f7,_0x49c4fa){return function(_0x460345){if(!_0x460345){_0x29b5f7['sendStatus'](0x194);}return _0x460345;};}function handleError(_0x59023f,_0xb40d66){_0xb40d66=_0xb40d66||0x1f4;return function(_0x17213f){logger[_0xc7ee('0x28')](_0x17213f['stack']);if(_0x17213f[_0xc7ee('0x29')]){delete _0x17213f[_0xc7ee('0x29')];}_0x59023f[_0xc7ee('0x1d')](_0xb40d66)['send'](_0x17213f);};}exports['index']=function(_0x9bc35a,_0x427aff){var _0x2c5bde={},_0x481a71={},_0x1d603d={'count':0x0,'rows':[]};var _0xd6be1f=_[_0xc7ee('0x2a')](db[_0xc7ee('0x2b')][_0xc7ee('0x2c')],function(_0x4b77a7){return{'name':_0x4b77a7[_0xc7ee('0x2d')],'type':_0x4b77a7[_0xc7ee('0x2e')][_0xc7ee('0x2f')]};});_0x481a71['model']=_[_0xc7ee('0x2a')](_0xd6be1f,'name');_0x481a71[_0xc7ee('0x30')]=_['keys'](_0x9bc35a[_0xc7ee('0x30')]);_0x481a71['filters']=_[_0xc7ee('0x31')](_0x481a71[_0xc7ee('0x32')],_0x481a71[_0xc7ee('0x30')]);_0x2c5bde[_0xc7ee('0x33')]=_[_0xc7ee('0x31')](_0x481a71[_0xc7ee('0x32')],qs[_0xc7ee('0x34')](_0x9bc35a[_0xc7ee('0x30')][_0xc7ee('0x34')]));_0x2c5bde[_0xc7ee('0x33')]=_0x2c5bde[_0xc7ee('0x33')][_0xc7ee('0x35')]?_0x2c5bde['attributes']:_0x481a71[_0xc7ee('0x32')];if(!_0x9bc35a[_0xc7ee('0x30')][_0xc7ee('0x36')](_0xc7ee('0x37'))){_0x2c5bde[_0xc7ee('0x20')]=qs[_0xc7ee('0x20')](_0x9bc35a[_0xc7ee('0x30')][_0xc7ee('0x20')]);_0x2c5bde[_0xc7ee('0x1f')]=qs[_0xc7ee('0x1f')](_0x9bc35a[_0xc7ee('0x30')][_0xc7ee('0x1f')]);}_0x2c5bde[_0xc7ee('0x38')]=qs[_0xc7ee('0x39')](_0x9bc35a[_0xc7ee('0x30')]['sort']);_0x2c5bde[_0xc7ee('0x3a')]=qs['filters'](_['pick'](_0x9bc35a[_0xc7ee('0x30')],_0x481a71[_0xc7ee('0x3b')]),_0xd6be1f);if(_0x9bc35a[_0xc7ee('0x30')][_0xc7ee('0x3c')]){_0x2c5bde[_0xc7ee('0x3a')]=_[_0xc7ee('0x3d')](_0x2c5bde[_0xc7ee('0x3a')],{'$or':_[_0xc7ee('0x2a')](_0xd6be1f,function(_0xde0d7a){if(_0xde0d7a['type']!==_0xc7ee('0x3e')){var _0x3ab60b={};_0x3ab60b[_0xde0d7a[_0xc7ee('0x29')]]={'$like':'%'+_0x9bc35a['query'][_0xc7ee('0x3c')]+'%'};return _0x3ab60b;}})});}_0x2c5bde=_[_0xc7ee('0x3d')]({},_0x2c5bde,_0x9bc35a['options']);var _0x34b2ee={'where':_0x2c5bde[_0xc7ee('0x3a')]};return db[_0xc7ee('0x2b')][_0xc7ee('0x21')](_0x34b2ee)[_0xc7ee('0x26')](function(_0x578b8f){_0x1d603d['count']=_0x578b8f;if(_0x9bc35a[_0xc7ee('0x30')][_0xc7ee('0x3f')]){_0x2c5bde[_0xc7ee('0x40')]=[{'all':!![]}];}return db[_0xc7ee('0x2b')][_0xc7ee('0x41')](_0x2c5bde);})[_0xc7ee('0x26')](function(_0x2c3095){_0x1d603d[_0xc7ee('0x42')]=_0x2c3095;return _0x1d603d;})[_0xc7ee('0x26')](respondWithFilteredResult(_0x427aff,_0x2c5bde))['catch'](handleError(_0x427aff,null));};exports[_0xc7ee('0x43')]=function(_0x128f16,_0x598779){var _0x393cf2={'raw':!![],'where':{'id':_0x128f16[_0xc7ee('0x44')]['id']}},_0xcce070={};_0xcce070[_0xc7ee('0x32')]=_['keys'](db[_0xc7ee('0x2b')][_0xc7ee('0x2c')]);_0xcce070[_0xc7ee('0x30')]=_[_0xc7ee('0x45')](_0x128f16[_0xc7ee('0x30')]);_0xcce070[_0xc7ee('0x3b')]=_[_0xc7ee('0x31')](_0xcce070['model'],_0xcce070[_0xc7ee('0x30')]);_0x393cf2[_0xc7ee('0x33')]=_[_0xc7ee('0x31')](_0xcce070[_0xc7ee('0x32')],qs[_0xc7ee('0x34')](_0x128f16['query']['fields']));_0x393cf2[_0xc7ee('0x33')]=_0x393cf2[_0xc7ee('0x33')][_0xc7ee('0x35')]?_0x393cf2['attributes']:_0xcce070[_0xc7ee('0x32')];if(_0x128f16[_0xc7ee('0x30')][_0xc7ee('0x3f')]){_0x393cf2[_0xc7ee('0x40')]=[{'all':!![]}];}_0x393cf2=_[_0xc7ee('0x3d')]({},_0x393cf2,_0x128f16[_0xc7ee('0x46')]);return db[_0xc7ee('0x2b')][_0xc7ee('0x47')](_0x393cf2)[_0xc7ee('0x26')](handleEntityNotFound(_0x598779,null))['then'](respondWithResult(_0x598779,null))[_0xc7ee('0x48')](handleError(_0x598779,null));};exports['create']=function(_0x43da03,_0x28614e){return db[_0xc7ee('0x2b')]['create'](_0x43da03['body'],{})[_0xc7ee('0x26')](respondWithResult(_0x28614e,0xc9))['catch'](handleError(_0x28614e,null));};exports['update']=function(_0x4a3f4f,_0x11aa42){if(_0x4a3f4f[_0xc7ee('0x49')]['id']){delete _0x4a3f4f[_0xc7ee('0x49')]['id'];}return db[_0xc7ee('0x2b')][_0xc7ee('0x47')]({'where':{'id':_0x4a3f4f[_0xc7ee('0x44')]['id']}})['then'](handleEntityNotFound(_0x11aa42,null))[_0xc7ee('0x26')](saveUpdates(_0x4a3f4f[_0xc7ee('0x49')],null))[_0xc7ee('0x26')](respondWithResult(_0x11aa42,null))[_0xc7ee('0x48')](handleError(_0x11aa42,null));};exports[_0xc7ee('0x27')]=function(_0x18d81a,_0x303847){return db[_0xc7ee('0x2b')][_0xc7ee('0x47')]({'where':{'id':_0x18d81a[_0xc7ee('0x44')]['id']}})[_0xc7ee('0x26')](handleEntityNotFound(_0x303847,null))['then'](removeEntity(_0x303847,null))[_0xc7ee('0x48')](handleError(_0x303847,null));}; \ No newline at end of file +var _0xfdb1=['query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','length','find','catch','create','body','update','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','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','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','then','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','model','keys'];(function(_0x5a1cf0,_0x5cf6ba){var _0xbf247a=function(_0x4c5510){while(--_0x4c5510){_0x5a1cf0['push'](_0x5a1cf0['shift']());}};_0xbf247a(++_0x5cf6ba);}(_0xfdb1,0x66));var _0x1fdb=function(_0x5e32be,_0x4f1458){_0x5e32be=_0x5e32be-0x0;var _0x352c27=_0xfdb1[_0x5e32be];return _0x352c27;};'use strict';var emlformat=require(_0x1fdb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1fdb('0x1'));var jsonpatch=require(_0x1fdb('0x2'));var rp=require(_0x1fdb('0x3'));var moment=require(_0x1fdb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1fdb('0x5'));var util=require('util');var path=require('path');var sox=require(_0x1fdb('0x6'));var csv=require(_0x1fdb('0x7'));var ejs=require(_0x1fdb('0x8'));var fs=require('fs');var fs_extra=require(_0x1fdb('0x9'));var _=require('lodash');var squel=require(_0x1fdb('0xa'));var crypto=require(_0x1fdb('0xb'));var jsforce=require(_0x1fdb('0xc'));var deskjs=require(_0x1fdb('0xd'));var toCsv=require(_0x1fdb('0x7'));var querystring=require(_0x1fdb('0xe'));var Papa=require(_0x1fdb('0xf'));var Redis=require(_0x1fdb('0x10'));var authService=require(_0x1fdb('0x11'));var qs=require(_0x1fdb('0x12'));var as=require(_0x1fdb('0x13'));var hardwareService=require(_0x1fdb('0x14'));var logger=require(_0x1fdb('0x15'))('api');var utils=require(_0x1fdb('0x16'));var config=require(_0x1fdb('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bef53,_0x1b0ce6){_0x1b0ce6=_0x1b0ce6||0xcc;return function(_0x520058){if(_0x520058){return _0x1bef53[_0x1fdb('0x18')](_0x1b0ce6);}return _0x1bef53[_0x1fdb('0x19')](_0x1b0ce6)[_0x1fdb('0x1a')]();};}function respondWithResult(_0x14ccc6,_0x9b5179){_0x9b5179=_0x9b5179||0xc8;return function(_0x5a9b2a){if(_0x5a9b2a){return _0x14ccc6[_0x1fdb('0x19')](_0x9b5179)[_0x1fdb('0x1b')](_0x5a9b2a);}};}function respondWithFilteredResult(_0x34d14b,_0x1f1d65){return function(_0x248c6e){if(_0x248c6e){var _0x44231f=typeof _0x1f1d65['offset']===_0x1fdb('0x1c')&&typeof _0x1f1d65[_0x1fdb('0x1d')]===_0x1fdb('0x1c');var _0x5bd24a=_0x248c6e[_0x1fdb('0x1e')];var _0x50449d=_0x44231f?0x0:_0x1f1d65[_0x1fdb('0x1f')];var _0x1e6ad3=_0x44231f?_0x248c6e[_0x1fdb('0x1e')]:_0x1f1d65[_0x1fdb('0x1f')]+_0x1f1d65[_0x1fdb('0x1d')];var _0x305f23;if(_0x1e6ad3>=_0x5bd24a){_0x1e6ad3=_0x5bd24a;_0x305f23=0xc8;}else{_0x305f23=0xce;}_0x34d14b[_0x1fdb('0x19')](_0x305f23);return _0x34d14b['set'](_0x1fdb('0x20'),_0x50449d+'-'+_0x1e6ad3+'/'+_0x5bd24a)['json'](_0x248c6e);}return null;};}function patchUpdates(_0x2ec60c){return function(_0x488ffc){try{jsonpatch[_0x1fdb('0x21')](_0x488ffc,_0x2ec60c,!![]);}catch(_0x1fe624){return BPromise[_0x1fdb('0x22')](_0x1fe624);}return _0x488ffc['save']();};}function saveUpdates(_0x99554f,_0x3276d3){return function(_0x2aa8b7){if(_0x2aa8b7){return _0x2aa8b7['update'](_0x99554f)[_0x1fdb('0x23')](function(_0x2cfe1d){return _0x2cfe1d;});}return null;};}function removeEntity(_0x2a6e4c,_0x4e047a){return function(_0x1b5579){if(_0x1b5579){return _0x1b5579['destroy']()[_0x1fdb('0x23')](function(){_0x2a6e4c[_0x1fdb('0x19')](0xcc)[_0x1fdb('0x1a')]();});}};}function handleEntityNotFound(_0x1a4190,_0x4e6847){return function(_0x52e7dd){if(!_0x52e7dd){_0x1a4190[_0x1fdb('0x18')](0x194);}return _0x52e7dd;};}function handleError(_0x719b4a,_0x215c52){_0x215c52=_0x215c52||0x1f4;return function(_0x2d4e6f){logger[_0x1fdb('0x24')](_0x2d4e6f[_0x1fdb('0x25')]);if(_0x2d4e6f[_0x1fdb('0x26')]){delete _0x2d4e6f[_0x1fdb('0x26')];}_0x719b4a[_0x1fdb('0x19')](_0x215c52)[_0x1fdb('0x27')](_0x2d4e6f);};}exports[_0x1fdb('0x28')]=function(_0xf7d7a3,_0x868425){var _0xf0be5d={},_0x12a5eb={},_0x378f0f={'count':0x0,'rows':[]};var _0x1d09af=_[_0x1fdb('0x29')](db[_0x1fdb('0x2a')][_0x1fdb('0x2b')],function(_0x4717d8){return{'name':_0x4717d8[_0x1fdb('0x2c')],'type':_0x4717d8[_0x1fdb('0x2d')]['key']};});_0x12a5eb[_0x1fdb('0x2e')]=_[_0x1fdb('0x29')](_0x1d09af,_0x1fdb('0x26'));_0x12a5eb['query']=_[_0x1fdb('0x2f')](_0xf7d7a3['query']);_0x12a5eb['filters']=_['intersection'](_0x12a5eb[_0x1fdb('0x2e')],_0x12a5eb[_0x1fdb('0x30')]);_0xf0be5d[_0x1fdb('0x31')]=_[_0x1fdb('0x32')](_0x12a5eb[_0x1fdb('0x2e')],qs[_0x1fdb('0x33')](_0xf7d7a3[_0x1fdb('0x30')]['fields']));_0xf0be5d[_0x1fdb('0x31')]=_0xf0be5d[_0x1fdb('0x31')]['length']?_0xf0be5d['attributes']:_0x12a5eb[_0x1fdb('0x2e')];if(!_0xf7d7a3[_0x1fdb('0x30')][_0x1fdb('0x34')](_0x1fdb('0x35'))){_0xf0be5d['limit']=qs['limit'](_0xf7d7a3['query']['limit']);_0xf0be5d[_0x1fdb('0x1f')]=qs['offset'](_0xf7d7a3[_0x1fdb('0x30')][_0x1fdb('0x1f')]);}_0xf0be5d[_0x1fdb('0x36')]=qs[_0x1fdb('0x37')](_0xf7d7a3[_0x1fdb('0x30')][_0x1fdb('0x37')]);_0xf0be5d[_0x1fdb('0x38')]=qs[_0x1fdb('0x39')](_[_0x1fdb('0x3a')](_0xf7d7a3['query'],_0x12a5eb['filters']),_0x1d09af);if(_0xf7d7a3[_0x1fdb('0x30')][_0x1fdb('0x3b')]){_0xf0be5d['where']=_[_0x1fdb('0x3c')](_0xf0be5d[_0x1fdb('0x38')],{'$or':_[_0x1fdb('0x29')](_0x1d09af,function(_0x8eb288){if(_0x8eb288['type']!==_0x1fdb('0x3d')){var _0x4ee6a4={};_0x4ee6a4[_0x8eb288[_0x1fdb('0x26')]]={'$like':'%'+_0xf7d7a3[_0x1fdb('0x30')]['filter']+'%'};return _0x4ee6a4;}})});}_0xf0be5d=_[_0x1fdb('0x3c')]({},_0xf0be5d,_0xf7d7a3[_0x1fdb('0x3e')]);var _0x185621={'where':_0xf0be5d[_0x1fdb('0x38')]};return db['SalesforceField'][_0x1fdb('0x1e')](_0x185621)['then'](function(_0x1585e9){_0x378f0f[_0x1fdb('0x1e')]=_0x1585e9;if(_0xf7d7a3['query'][_0x1fdb('0x3f')]){_0xf0be5d[_0x1fdb('0x40')]=[{'all':!![]}];}return db[_0x1fdb('0x2a')][_0x1fdb('0x41')](_0xf0be5d);})[_0x1fdb('0x23')](function(_0x5e28d9){_0x378f0f['rows']=_0x5e28d9;return _0x378f0f;})['then'](respondWithFilteredResult(_0x868425,_0xf0be5d))['catch'](handleError(_0x868425,null));};exports[_0x1fdb('0x42')]=function(_0x22f29c,_0x165bbb){var _0x346a39={'raw':!![],'where':{'id':_0x22f29c[_0x1fdb('0x43')]['id']}},_0xcfc2c={};_0xcfc2c[_0x1fdb('0x2e')]=_[_0x1fdb('0x2f')](db[_0x1fdb('0x2a')][_0x1fdb('0x2b')]);_0xcfc2c[_0x1fdb('0x30')]=_['keys'](_0x22f29c['query']);_0xcfc2c[_0x1fdb('0x39')]=_[_0x1fdb('0x32')](_0xcfc2c[_0x1fdb('0x2e')],_0xcfc2c[_0x1fdb('0x30')]);_0x346a39[_0x1fdb('0x31')]=_[_0x1fdb('0x32')](_0xcfc2c[_0x1fdb('0x2e')],qs['fields'](_0x22f29c[_0x1fdb('0x30')]['fields']));_0x346a39[_0x1fdb('0x31')]=_0x346a39[_0x1fdb('0x31')][_0x1fdb('0x44')]?_0x346a39[_0x1fdb('0x31')]:_0xcfc2c[_0x1fdb('0x2e')];if(_0x22f29c[_0x1fdb('0x30')][_0x1fdb('0x3f')]){_0x346a39[_0x1fdb('0x40')]=[{'all':!![]}];}_0x346a39=_['merge']({},_0x346a39,_0x22f29c[_0x1fdb('0x3e')]);return db[_0x1fdb('0x2a')][_0x1fdb('0x45')](_0x346a39)[_0x1fdb('0x23')](handleEntityNotFound(_0x165bbb,null))['then'](respondWithResult(_0x165bbb,null))[_0x1fdb('0x46')](handleError(_0x165bbb,null));};exports[_0x1fdb('0x47')]=function(_0x2d4a23,_0x1ec578){return db[_0x1fdb('0x2a')][_0x1fdb('0x47')](_0x2d4a23[_0x1fdb('0x48')],{})[_0x1fdb('0x23')](respondWithResult(_0x1ec578,0xc9))['catch'](handleError(_0x1ec578,null));};exports[_0x1fdb('0x49')]=function(_0x73aad7,_0x28eefa){if(_0x73aad7[_0x1fdb('0x48')]['id']){delete _0x73aad7['body']['id'];}return db[_0x1fdb('0x2a')][_0x1fdb('0x45')]({'where':{'id':_0x73aad7['params']['id']}})[_0x1fdb('0x23')](handleEntityNotFound(_0x28eefa,null))[_0x1fdb('0x23')](saveUpdates(_0x73aad7[_0x1fdb('0x48')],null))['then'](respondWithResult(_0x28eefa,null))[_0x1fdb('0x46')](handleError(_0x28eefa,null));};exports[_0x1fdb('0x4a')]=function(_0x495e14,_0x1dcba5){return db[_0x1fdb('0x2a')][_0x1fdb('0x45')]({'where':{'id':_0x495e14[_0x1fdb('0x43')]['id']}})[_0x1fdb('0x23')](handleEntityNotFound(_0x1dcba5,null))[_0x1fdb('0x23')](removeEntity(_0x1dcba5,null))['catch'](handleError(_0x1dcba5,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 2f4b09b..09035c0 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 _0x2953=['request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x39004a,_0x5e35e5){var _0x38f42b=function(_0x3d1a4e){while(--_0x3d1a4e){_0x39004a['push'](_0x39004a['shift']());}};_0x38f42b(++_0x5e35e5);}(_0x2953,0x1a3));var _0x3295=function(_0x589a5f,_0x8f09e){_0x589a5f=_0x589a5f-0x0;var _0x45beb2=_0x2953[_0x589a5f];return _0x45beb2;};'use strict';var _=require(_0x3295('0x0'));var util=require(_0x3295('0x1'));var logger=require(_0x3295('0x2'))(_0x3295('0x3'));var moment=require(_0x3295('0x4'));var BPromise=require(_0x3295('0x5'));var rp=require(_0x3295('0x6'));var fs=require('fs');var path=require(_0x3295('0x7'));var rimraf=require(_0x3295('0x8'));var config=require(_0x3295('0x9'));var attributes=require(_0x3295('0xa'));module['exports']=function(_0x2472e0,_0x15338c){return _0x2472e0[_0x3295('0xb')](_0x3295('0xc'),attributes,{'tableName':_0x3295('0xd'),'paranoid':![],'indexes':[{'name':_0x3295('0xe'),'fields':[_0x3295('0xf'),_0x3295('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4657=['moment','bluebird','path','rimraf','../../config/environment','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util'];(function(_0x5a356a,_0x576b0e){var _0x1f47a3=function(_0x5f5762){while(--_0x5f5762){_0x5a356a['push'](_0x5a356a['shift']());}};_0x1f47a3(++_0x576b0e);}(_0x4657,0x67));var _0x7465=function(_0x34217f,_0x4954d9){_0x34217f=_0x34217f-0x0;var _0x533721=_0x4657[_0x34217f];return _0x533721;};'use strict';var _=require('lodash');var util=require(_0x7465('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7465('0x1'));var BPromise=require(_0x7465('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7465('0x3'));var rimraf=require(_0x7465('0x4'));var config=require(_0x7465('0x5'));var attributes=require(_0x7465('0x6'));module['exports']=function(_0x3a4084,_0x21cf70){return _0x3a4084[_0x7465('0x7')](_0x7465('0x8'),attributes,{'tableName':_0x7465('0x9'),'paranoid':![],'indexes':[{'name':_0x7465('0xa'),'fields':[_0x7465('0xb'),_0x7465('0xc')],'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 be0fd0e..68c2150 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 _0x4724=['request','info','request\x20sent','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http'];(function(_0x316fb1,_0x5f0b5b){var _0xcdeede=function(_0x2816e9){while(--_0x2816e9){_0x316fb1['push'](_0x316fb1['shift']());}};_0xcdeede(++_0x5f0b5b);}(_0x4724,0x1ad));var _0x4472=function(_0x1252bf,_0x53dd51){_0x1252bf=_0x1252bf-0x0;var _0x370be2=_0x4724[_0x1252bf];return _0x370be2;};'use strict';var _=require(_0x4472('0x0'));var util=require(_0x4472('0x1'));var moment=require(_0x4472('0x2'));var BPromise=require(_0x4472('0x3'));var rs=require(_0x4472('0x4'));var fs=require('fs');var Redis=require(_0x4472('0x5'));var db=require(_0x4472('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4472('0x7'))(_0x4472('0x8'));var config=require(_0x4472('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4472('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15199e,_0x1545d4,_0x2f3745){return new BPromise(function(_0x2640ef,_0x55160c){return client[_0x4472('0xb')](_0x15199e,_0x2f3745)['then'](function(_0x285e98){logger[_0x4472('0xc')]('SalesforceField,\x20%s,\x20%s',_0x1545d4,_0x4472('0xd'));logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x1545d4,'request\x20sent',JSON[_0x4472('0xe')](_0x285e98));if(_0x285e98[_0x4472('0xf')]){if(_0x285e98['error'][_0x4472('0x10')]===0x1f4){logger[_0x4472('0xf')](_0x4472('0x11'),_0x1545d4,_0x285e98[_0x4472('0xf')][_0x4472('0x12')]);return _0x55160c(_0x285e98[_0x4472('0xf')][_0x4472('0x12')]);}logger['error'](_0x4472('0x11'),_0x1545d4,_0x285e98[_0x4472('0xf')][_0x4472('0x12')]);return _0x2640ef(_0x285e98['error'][_0x4472('0x12')]);}else{logger['info'](_0x4472('0x11'),_0x1545d4,_0x4472('0xd'));_0x2640ef(_0x285e98['result']['message']);}})[_0x4472('0x13')](function(_0x2df734){logger[_0x4472('0xf')](_0x4472('0x11'),_0x1545d4,_0x2df734);_0x55160c(_0x2df734);});});} \ No newline at end of file +var _0xa20c=['SalesforceField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa20c,0xd9));var _0xca20=function(_0x5b2783,_0x1f3362){_0x5b2783=_0x5b2783-0x0;var _0x74bfee=_0xa20c[_0x5b2783];return _0x74bfee;};'use strict';var _=require(_0xca20('0x0'));var util=require('util');var moment=require(_0xca20('0x1'));var BPromise=require(_0xca20('0x2'));var rs=require(_0xca20('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xca20('0x4'))(_0xca20('0x5'));var config=require('../../config/environment');var jayson=require(_0xca20('0x6'));var client=jayson[_0xca20('0x7')][_0xca20('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ba2c9,_0x55ffce,_0x911351){return new BPromise(function(_0x43ae78,_0x239286){return client[_0xca20('0x9')](_0x4ba2c9,_0x911351)['then'](function(_0x192ad8){logger[_0xca20('0xa')](_0xca20('0xb'),_0x55ffce,_0xca20('0xc'));logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x55ffce,_0xca20('0xc'),JSON[_0xca20('0xd')](_0x192ad8));if(_0x192ad8[_0xca20('0xe')]){if(_0x192ad8['error'][_0xca20('0xf')]===0x1f4){logger[_0xca20('0xe')](_0xca20('0xb'),_0x55ffce,_0x192ad8[_0xca20('0xe')]['message']);return _0x239286(_0x192ad8[_0xca20('0xe')][_0xca20('0x10')]);}logger[_0xca20('0xe')](_0xca20('0xb'),_0x55ffce,_0x192ad8[_0xca20('0xe')][_0xca20('0x10')]);return _0x43ae78(_0x192ad8[_0xca20('0xe')][_0xca20('0x10')]);}else{logger[_0xca20('0xa')](_0xca20('0xb'),_0x55ffce,_0xca20('0xc'));_0x43ae78(_0x192ad8[_0xca20('0x11')]['message']);}})[_0xca20('0x12')](function(_0x1268df){logger['error'](_0xca20('0xb'),_0x55ffce,_0x1268df);_0x239286(_0x1268df);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 791ce32..e801a1f 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 _0x336a=['/:id/configurations','getConfigurations','getFields','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x336a,0xa3));var _0xa336=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x336a[_0x3ea913];return _0x2b4f28;};'use strict';var multer=require(_0xa336('0x0'));var util=require(_0xa336('0x1'));var path=require(_0xa336('0x2'));var timeout=require('connect-timeout');var express=require(_0xa336('0x3'));var router=express[_0xa336('0x4')]();var fs_extra=require(_0xa336('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa336('0x6'));var config=require(_0xa336('0x7'));var controller=require(_0xa336('0x8'));router[_0xa336('0x9')]('/',auth[_0xa336('0xa')](),controller['index']);router[_0xa336('0x9')](_0xa336('0xb'),auth[_0xa336('0xa')](),controller[_0xa336('0xc')]);router[_0xa336('0x9')](_0xa336('0xd'),auth[_0xa336('0xa')](),controller[_0xa336('0xe')]);router['get']('/:id/fields',auth[_0xa336('0xa')](),controller[_0xa336('0xf')]);router[_0xa336('0x10')]('/',auth[_0xa336('0xa')](),controller[_0xa336('0x11')]);router[_0xa336('0x10')](_0xa336('0xd'),auth[_0xa336('0xa')](),controller['addConfiguration']);router[_0xa336('0x12')](_0xa336('0xb'),auth[_0xa336('0xa')](),controller[_0xa336('0x13')]);router['delete']('/:id',auth[_0xa336('0xa')](),controller[_0xa336('0x14')]);module[_0xa336('0x15')]=router; \ No newline at end of file +var _0x04d0=['path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','update','delete','destroy'];(function(_0x727619,_0x15bf40){var _0x1adabc=function(_0x58c3bc){while(--_0x58c3bc){_0x727619['push'](_0x727619['shift']());}};_0x1adabc(++_0x15bf40);}(_0x04d0,0x10a));var _0x004d=function(_0x5e97c8,_0x301ca0){_0x5e97c8=_0x5e97c8-0x0;var _0x1b9896=_0x04d0[_0x5e97c8];return _0x1b9896;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x004d('0x0'));var timeout=require(_0x004d('0x1'));var express=require(_0x004d('0x2'));var router=express[_0x004d('0x3')]();var fs_extra=require(_0x004d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x004d('0x5'));var controller=require('./intServicenowAccount.controller');router[_0x004d('0x6')]('/',auth[_0x004d('0x7')](),controller['index']);router[_0x004d('0x6')](_0x004d('0x8'),auth['isAuthenticated'](),controller[_0x004d('0x9')]);router['get'](_0x004d('0xa'),auth[_0x004d('0x7')](),controller[_0x004d('0xb')]);router['get'](_0x004d('0xc'),auth[_0x004d('0x7')](),controller['getFields']);router[_0x004d('0xd')]('/',auth['isAuthenticated'](),controller[_0x004d('0xe')]);router[_0x004d('0xd')]('/:id/configurations',auth[_0x004d('0x7')](),controller['addConfiguration']);router[_0x004d('0xf')](_0x004d('0x8'),auth[_0x004d('0x7')](),controller[_0x004d('0x10')]);router[_0x004d('0x11')](_0x004d('0x8'),auth[_0x004d('0x7')](),controller[_0x004d('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 00e97af..23e952e 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 _0x767f=['STRING','sequelize','exports'];(function(_0x1c413e,_0x51788b){var _0x1d8309=function(_0x335195){while(--_0x335195){_0x1c413e['push'](_0x1c413e['shift']());}};_0x1d8309(++_0x51788b);}(_0x767f,0x1de));var _0xf767=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x767f[_0x22b68a];return _0x1ac67a;};'use strict';var Sequelize=require(_0xf767('0x0'));module[_0xf767('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf767('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf767('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xa0fe=['STRING','remoteUri','sequelize','exports'];(function(_0x40095e,_0x29becf){var _0x1a10ec=function(_0x4e8ade){while(--_0x4e8ade){_0x40095e['push'](_0x40095e['shift']());}};_0x1a10ec(++_0x29becf);}(_0xa0fe,0x9e));var _0xea0f=function(_0x2af07b,_0x390b2f){_0x2af07b=_0x2af07b-0x0;var _0x4848e8=_0xa0fe[_0x2af07b];return _0x4848e8;};'use strict';var Sequelize=require(_0xea0f('0x0'));module[_0xea0f('0x1')]={'name':{'type':Sequelize[_0xea0f('0x2')]},'description':{'type':Sequelize[_0xea0f('0x2')]},'username':{'type':Sequelize[_0xea0f('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xea0f('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xea0f('0x3')},'serverUrl':{'type':Sequelize[_0xea0f('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index bb277ed..26a3074 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 _0x24b5=['includeAll','find','create','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','incident_state','severity','category','caused_by','watch_list','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','priority','sys_domain_path','rfc','expected_start','business_duration','group_list','work_end','resolved_at','approval_set','work_notes','short_description','correlation_display','delivery_task','assignment_group','description','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','username','email','remoteUri','serverUrl','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','forEach','internalType','label','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','test','statusCode','Wrong\x20credentials','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','request-promise','moment','bluebird','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/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length'];(function(_0xc09f9b,_0x500892){var _0x1eafc4=function(_0xa06095){while(--_0xa06095){_0xc09f9b['push'](_0xc09f9b['shift']());}};_0x1eafc4(++_0x500892);}(_0x24b5,0x1eb));var _0x524b=function(_0x47b007,_0x322a07){_0x47b007=_0x47b007-0x0;var _0x35742b=_0x24b5[_0x47b007];return _0x35742b;};'use strict';var emlformat=require(_0x524b('0x0'));var rimraf=require(_0x524b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x524b('0x2'));var moment=require(_0x524b('0x3'));var BPromise=require(_0x524b('0x4'));var Mustache=require(_0x524b('0x5'));var util=require('util');var path=require(_0x524b('0x6'));var sox=require(_0x524b('0x7'));var csv=require(_0x524b('0x8'));var ejs=require(_0x524b('0x9'));var fs=require('fs');var fs_extra=require(_0x524b('0xa'));var _=require('lodash');var squel=require(_0x524b('0xb'));var crypto=require(_0x524b('0xc'));var jsforce=require(_0x524b('0xd'));var deskjs=require(_0x524b('0xe'));var toCsv=require(_0x524b('0x8'));var querystring=require(_0x524b('0xf'));var Papa=require(_0x524b('0x10'));var Redis=require(_0x524b('0x11'));var authService=require(_0x524b('0x12'));var qs=require(_0x524b('0x13'));var as=require(_0x524b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x524b('0x15'))('api');var utils=require(_0x524b('0x16'));var config=require(_0x524b('0x17'));var licenseUtil=require(_0x524b('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x41f4fe,_0x58e93e){_0x58e93e=_0x58e93e||0xcc;return function(_0xa6d25e){if(_0xa6d25e){return _0x41f4fe[_0x524b('0x19')](_0x58e93e);}return _0x41f4fe[_0x524b('0x1a')](_0x58e93e)[_0x524b('0x1b')]();};}function respondWithResult(_0x421a15,_0x5650e8){_0x5650e8=_0x5650e8||0xc8;return function(_0x2a9509){if(_0x2a9509){return _0x421a15[_0x524b('0x1a')](_0x5650e8)[_0x524b('0x1c')](_0x2a9509);}};}function respondWithFilteredResult(_0x12f229,_0x286723){return function(_0x5283d2){if(_0x5283d2){var _0x4a5e6b=typeof _0x286723[_0x524b('0x1d')]===_0x524b('0x1e')&&typeof _0x286723[_0x524b('0x1f')]===_0x524b('0x1e');var _0x2d0f1e=_0x5283d2[_0x524b('0x20')];var _0x2012d3=_0x4a5e6b?0x0:_0x286723[_0x524b('0x1d')];var _0x314199=_0x4a5e6b?_0x5283d2[_0x524b('0x20')]:_0x286723[_0x524b('0x1d')]+_0x286723[_0x524b('0x1f')];var _0x22e1fa;if(_0x314199>=_0x2d0f1e){_0x314199=_0x2d0f1e;_0x22e1fa=0xc8;}else{_0x22e1fa=0xce;}_0x12f229[_0x524b('0x1a')](_0x22e1fa);return _0x12f229['set'](_0x524b('0x21'),_0x2012d3+'-'+_0x314199+'/'+_0x2d0f1e)[_0x524b('0x1c')](_0x5283d2);}return null;};}function patchUpdates(_0x5a0153){return function(_0x35282d){try{jsonpatch[_0x524b('0x22')](_0x35282d,_0x5a0153,!![]);}catch(_0x205b07){return BPromise[_0x524b('0x23')](_0x205b07);}return _0x35282d[_0x524b('0x24')]();};}function saveUpdates(_0x3a399c,_0xa08c1f){return function(_0x2c403b){if(_0x2c403b){return _0x2c403b[_0x524b('0x25')](_0x3a399c)[_0x524b('0x26')](function(_0x500167){return _0x500167;});}return null;};}function removeEntity(_0x1bf1e1,_0x341fb3){return function(_0x58f4ff){if(_0x58f4ff){return _0x58f4ff[_0x524b('0x27')]()[_0x524b('0x26')](function(){_0x1bf1e1['status'](0xcc)[_0x524b('0x1b')]();});}};}function handleEntityNotFound(_0x35eb2b,_0x3788c1){return function(_0x2d4089){if(!_0x2d4089){_0x35eb2b[_0x524b('0x19')](0x194);}return _0x2d4089;};}function handleError(_0x51de8a,_0x4a22c9){_0x4a22c9=_0x4a22c9||0x1f4;return function(_0x1ff02b){logger[_0x524b('0x28')](_0x1ff02b[_0x524b('0x29')]);if(_0x1ff02b[_0x524b('0x2a')]){delete _0x1ff02b['name'];}_0x51de8a[_0x524b('0x1a')](_0x4a22c9)[_0x524b('0x2b')](_0x1ff02b);};}exports['index']=function(_0x309123,_0x3614a8){var _0x23d974={},_0xaac346={},_0x25f57b={'count':0x0,'rows':[]};var _0x2ef1f2=_[_0x524b('0x2c')](db[_0x524b('0x2d')][_0x524b('0x2e')],function(_0x39552e){return{'name':_0x39552e[_0x524b('0x2f')],'type':_0x39552e[_0x524b('0x30')][_0x524b('0x31')]};});_0xaac346['model']=_[_0x524b('0x2c')](_0x2ef1f2,_0x524b('0x2a'));_0xaac346[_0x524b('0x32')]=_[_0x524b('0x33')](_0x309123['query']);_0xaac346[_0x524b('0x34')]=_[_0x524b('0x35')](_0xaac346[_0x524b('0x36')],_0xaac346['query']);_0x23d974[_0x524b('0x37')]=_[_0x524b('0x35')](_0xaac346[_0x524b('0x36')],qs[_0x524b('0x38')](_0x309123[_0x524b('0x32')][_0x524b('0x38')]));_0x23d974[_0x524b('0x37')]=_0x23d974[_0x524b('0x37')]['length']?_0x23d974['attributes']:_0xaac346[_0x524b('0x36')];if(!_0x309123[_0x524b('0x32')][_0x524b('0x39')](_0x524b('0x3a'))){_0x23d974['limit']=qs[_0x524b('0x1f')](_0x309123[_0x524b('0x32')][_0x524b('0x1f')]);_0x23d974[_0x524b('0x1d')]=qs[_0x524b('0x1d')](_0x309123['query'][_0x524b('0x1d')]);}_0x23d974[_0x524b('0x3b')]=qs[_0x524b('0x3c')](_0x309123[_0x524b('0x32')][_0x524b('0x3c')]);_0x23d974[_0x524b('0x3d')]=qs[_0x524b('0x34')](_['pick'](_0x309123[_0x524b('0x32')],_0xaac346['filters']),_0x2ef1f2);if(_0x309123[_0x524b('0x32')][_0x524b('0x3e')]){_0x23d974[_0x524b('0x3d')]=_[_0x524b('0x3f')](_0x23d974[_0x524b('0x3d')],{'$or':_['map'](_0x2ef1f2,function(_0x43db23){if(_0x43db23[_0x524b('0x30')]!==_0x524b('0x40')){var _0x2388d4={};_0x2388d4[_0x43db23[_0x524b('0x2a')]]={'$like':'%'+_0x309123['query'][_0x524b('0x3e')]+'%'};return _0x2388d4;}})});}_0x23d974=_[_0x524b('0x3f')]({},_0x23d974,_0x309123[_0x524b('0x41')]);var _0x4dd52b={'where':_0x23d974[_0x524b('0x3d')]};return db[_0x524b('0x2d')][_0x524b('0x20')](_0x4dd52b)[_0x524b('0x26')](function(_0x51f87e){_0x25f57b[_0x524b('0x20')]=_0x51f87e;if(_0x309123['query']['includeAll']){_0x23d974[_0x524b('0x42')]=[{'all':!![]}];}return db[_0x524b('0x2d')][_0x524b('0x43')](_0x23d974);})[_0x524b('0x26')](function(_0x2041a4){_0x25f57b[_0x524b('0x44')]=_0x2041a4;return _0x25f57b;})[_0x524b('0x26')](respondWithFilteredResult(_0x3614a8,_0x23d974))[_0x524b('0x45')](handleError(_0x3614a8,null));};exports[_0x524b('0x46')]=function(_0x4ef89f,_0x109a93){var _0x55be0a={'raw':![],'where':{'id':_0x4ef89f[_0x524b('0x47')]['id']}},_0x5c1354={};_0x5c1354[_0x524b('0x36')]=_[_0x524b('0x33')](db['ServicenowAccount'][_0x524b('0x2e')]);_0x5c1354[_0x524b('0x32')]=_[_0x524b('0x33')](_0x4ef89f[_0x524b('0x32')]);_0x5c1354[_0x524b('0x34')]=_[_0x524b('0x35')](_0x5c1354[_0x524b('0x36')],_0x5c1354['query']);_0x55be0a[_0x524b('0x37')]=_[_0x524b('0x35')](_0x5c1354[_0x524b('0x36')],qs[_0x524b('0x38')](_0x4ef89f['query'][_0x524b('0x38')]));_0x55be0a[_0x524b('0x37')]=_0x55be0a[_0x524b('0x37')][_0x524b('0x48')]?_0x55be0a[_0x524b('0x37')]:_0x5c1354[_0x524b('0x36')];if(_0x4ef89f[_0x524b('0x32')][_0x524b('0x49')]){_0x55be0a['include']=[{'all':!![]}];}_0x55be0a=_[_0x524b('0x3f')]({},_0x55be0a,_0x4ef89f[_0x524b('0x41')]);return db['ServicenowAccount'][_0x524b('0x4a')](_0x55be0a)[_0x524b('0x26')](handleEntityNotFound(_0x109a93,null))['then'](respondWithResult(_0x109a93,null))[_0x524b('0x45')](handleError(_0x109a93,null));};exports[_0x524b('0x4b')]=function(_0x3c6cd5,_0x41fd68){return db['ServicenowAccount'][_0x524b('0x4b')](_0x3c6cd5[_0x524b('0x4c')],{})[_0x524b('0x26')](respondWithResult(_0x41fd68,0xc9))[_0x524b('0x45')](handleError(_0x41fd68,null));};exports[_0x524b('0x25')]=function(_0x5be4f6,_0x26b2e3){if(_0x5be4f6[_0x524b('0x4c')]['id']){delete _0x5be4f6[_0x524b('0x4c')]['id'];}return db[_0x524b('0x2d')][_0x524b('0x4a')]({'where':{'id':_0x5be4f6[_0x524b('0x47')]['id']}})['then'](handleEntityNotFound(_0x26b2e3,null))[_0x524b('0x26')](saveUpdates(_0x5be4f6[_0x524b('0x4c')],null))[_0x524b('0x26')](respondWithResult(_0x26b2e3,null))[_0x524b('0x45')](handleError(_0x26b2e3,null));};exports['destroy']=function(_0x39cbe6,_0x1aa6b4){return db[_0x524b('0x2d')]['find']({'where':{'id':_0x39cbe6[_0x524b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1aa6b4,null))[_0x524b('0x26')](removeEntity(_0x1aa6b4,null))[_0x524b('0x45')](handleError(_0x1aa6b4,null));};exports[_0x524b('0x4d')]=function(_0x166380,_0x4fca8d,_0x30e0d5){var _0x5b00dd={};var _0x58e628={};var _0x2688f5;var _0x3b286e;return db[_0x524b('0x2d')][_0x524b('0x4e')]({'where':{'id':_0x166380[_0x524b('0x47')]['id']}})[_0x524b('0x26')](handleEntityNotFound(_0x4fca8d,null))[_0x524b('0x26')](function(_0x521cc2){if(_0x521cc2){_0x2688f5=_0x521cc2;_0x58e628[_0x524b('0x36')]=_[_0x524b('0x33')](db[_0x524b('0x4f')][_0x524b('0x2e')]);_0x58e628[_0x524b('0x32')]=_[_0x524b('0x33')](_0x166380[_0x524b('0x32')]);_0x58e628[_0x524b('0x34')]=_[_0x524b('0x35')](_0x58e628[_0x524b('0x36')],_0x58e628[_0x524b('0x32')]);_0x5b00dd['attributes']=_[_0x524b('0x35')](_0x58e628[_0x524b('0x36')],qs['fields'](_0x166380[_0x524b('0x32')][_0x524b('0x38')]));_0x5b00dd[_0x524b('0x37')]=_0x5b00dd['attributes'][_0x524b('0x48')]?_0x5b00dd[_0x524b('0x37')]:_0x58e628[_0x524b('0x36')];_0x5b00dd[_0x524b('0x3b')]=qs['sort'](_0x166380[_0x524b('0x32')][_0x524b('0x3c')]);_0x5b00dd['where']=qs[_0x524b('0x34')](_['pick'](_0x166380[_0x524b('0x32')],_0x58e628[_0x524b('0x34')]));if(_0x166380['query'][_0x524b('0x3e')]){_0x5b00dd['where']=_['merge'](_0x5b00dd[_0x524b('0x3d')],{'$or':_[_0x524b('0x2c')](_0x5b00dd[_0x524b('0x37')],function(_0x1ff4fc){var _0x4183c8={};_0x4183c8[_0x1ff4fc]={'$like':'%'+_0x166380[_0x524b('0x32')][_0x524b('0x3e')]+'%'};return _0x4183c8;})});}_0x5b00dd=_[_0x524b('0x3f')]({},_0x5b00dd,_0x166380[_0x524b('0x41')]);return _0x2688f5[_0x524b('0x4d')](_0x5b00dd);}})[_0x524b('0x26')](function(_0x31b779){if(_0x31b779){_0x3b286e=_0x31b779[_0x524b('0x48')];if(!_0x166380[_0x524b('0x32')]['hasOwnProperty'](_0x524b('0x3a'))){_0x5b00dd[_0x524b('0x1f')]=qs[_0x524b('0x1f')](_0x166380[_0x524b('0x32')][_0x524b('0x1f')]);_0x5b00dd[_0x524b('0x1d')]=qs[_0x524b('0x1d')](_0x166380[_0x524b('0x32')][_0x524b('0x1d')]);}return _0x2688f5[_0x524b('0x4d')](_0x5b00dd);}})[_0x524b('0x26')](function(_0xf87fdc){if(_0xf87fdc){return _0xf87fdc?{'count':_0x3b286e,'rows':_0xf87fdc}:null;}})[_0x524b('0x26')](respondWithResult(_0x4fca8d,null))[_0x524b('0x45')](handleError(_0x4fca8d,null));};exports[_0x524b('0x50')]=function(_0x9f5bc0,_0x45b99a,_0x103ca1){if(_0x9f5bc0[_0x524b('0x4c')]['id']){delete _0x9f5bc0['body']['id'];}return db[_0x524b('0x2d')][_0x524b('0x4e')]({'where':{'id':_0x9f5bc0['params']['id']}})[_0x524b('0x26')](handleEntityNotFound(_0x45b99a,null))[_0x524b('0x26')](function(_0x1d0f7a){if(_0x1d0f7a){_0x9f5bc0[_0x524b('0x4c')][_0x524b('0x51')]=_0x1d0f7a['id'];_0x9f5bc0[_0x524b('0x4c')][_0x524b('0x52')]=integrations[_0x524b('0x53')](_0x9f5bc0[_0x524b('0x4c')][_0x524b('0x54')],_0x9f5bc0[_0x524b('0x4c')][_0x524b('0x30')]);_0x9f5bc0[_0x524b('0x4c')][_0x524b('0x55')]=integrations['getDescriptions'](_0x9f5bc0['body'][_0x524b('0x54')],_0x9f5bc0['body'][_0x524b('0x30')]);return db[_0x524b('0x4f')][_0x524b('0x4b')](_0x9f5bc0['body'],{'include':[{'model':db[_0x524b('0x56')],'as':_0x524b('0x52')},{'model':db[_0x524b('0x56')],'as':_0x524b('0x55')}]});}return null;})[_0x524b('0x26')](respondWithResult(_0x45b99a,null))['catch'](handleError(_0x45b99a,null));};exports[_0x524b('0x57')]=function(_0x3e68a3,_0x56fb47,_0xd8d54a){var _0x331a96=[_0x524b('0x58'),_0x524b('0x59'),_0x524b('0x5a'),_0x524b('0x5b'),_0x524b('0x5c'),'notify',_0x524b('0x5d'),_0x524b('0x5e'),_0x524b('0x5f')];var _0x12de7f=['parent',_0x524b('0x58'),_0x524b('0x60'),_0x524b('0x61'),'upon_reject','sys_updated_on','child_incidents',_0x524b('0x59'),_0x524b('0x62'),_0x524b('0x63'),_0x524b('0x64'),_0x524b('0x65'),_0x524b('0x66'),_0x524b('0x67'),_0x524b('0x68'),_0x524b('0x69'),_0x524b('0x6a'),_0x524b('0x6b'),_0x524b('0x5a'),_0x524b('0x3b'),_0x524b('0x6c'),_0x524b('0x6d'),_0x524b('0x6e'),_0x524b('0x6f'),'impact',_0x524b('0x70'),_0x524b('0x71'),'business_service',_0x524b('0x72'),_0x524b('0x73'),_0x524b('0x74'),'time_worked',_0x524b('0x75'),'opened_at',_0x524b('0x76'),_0x524b('0x77'),_0x524b('0x78'),'reopened_time',_0x524b('0x79'),'caller_id',_0x524b('0x7a'),_0x524b('0x5b'),_0x524b('0x7b'),_0x524b('0x7c'),'close_code',_0x524b('0x7d'),_0x524b('0x7e'),'work_start',_0x524b('0x7f'),'business_stc','additional_assignee_list',_0x524b('0x80'),_0x524b('0x81'),_0x524b('0x82'),_0x524b('0x83'),_0x524b('0x84'),_0x524b('0x85'),_0x524b('0x86'),_0x524b('0x87'),_0x524b('0x88'),_0x524b('0x89'),_0x524b('0x8a'),_0x524b('0x5d'),_0x524b('0x8b'),'problem_id',_0x524b('0x8c'),_0x524b('0x8d'),_0x524b('0x8e'),_0x524b('0x8f'),'severity',_0x524b('0x90'),_0x524b('0x91'),_0x524b('0x92'),_0x524b('0x93'),_0x524b('0x94'),_0x524b('0x95'),_0x524b('0x96'),'sys_tags',_0x524b('0x97'),_0x524b('0x98'),_0x524b('0x99'),'location',_0x524b('0x5f')];var _0xd453ef='';var _0x313b53='';var _0x1cc1f8=[];var _0xafa406='';var _0x25740a='';var _0x9d30fe=[];var _0x3c966c='';var _0x49680c='';var _0x43388d={};var _0xaa102b='';return db[_0x524b('0x2d')][_0x524b('0x4e')]({'where':{'id':_0x3e68a3[_0x524b('0x47')]['id']},'attributes':['id',_0x524b('0x9a'),'password',_0x524b('0x9b'),_0x524b('0x9c'),_0x524b('0x9d')]})['then'](handleEntityNotFound(_0x56fb47,null))['then'](function(_0x249ba8){if(_0x249ba8){_0xaa102b=_0x249ba8[_0x524b('0x9c')];var _0x4b12e2=_0xaa102b['slice'](-0x1);if(_0x4b12e2==='/'){_0xaa102b=_0xaa102b['substring'](0x0,_0xaa102b[_0x524b('0x9e')](_0x4b12e2));}_0x49680c=util[_0x524b('0x9f')](_0x524b('0xa0'),_0xaa102b);_0x3c966c=util[_0x524b('0x9f')](_0x524b('0xa1'),_0xaa102b);_0x43388d={'user':_0x249ba8[_0x524b('0x9a')],'pass':_0x249ba8[_0x524b('0xa2')]};var _0x343739={'method':_0x524b('0xa3'),'uri':_0x49680c+_0x524b('0xa4'),'auth':_0x43388d,'json':!![]};return rp(_0x343739);}})[_0x524b('0x26')](function(_0x1ad71a){if(_0x1ad71a[_0x524b('0xa5')]['length']>0x0){_0xd453ef=_0x1ad71a[_0x524b('0xa5')];}console[_0x524b('0xa6')]('incident\x20table\x20objects',_0xd453ef);_0x9d30fe=[];_0x313b53=Object[_0x524b('0xa7')]([],_0xd453ef);_[_0x524b('0xa8')](_0x313b53,function(_0x33d5ff){return!_0x331a96[_0x524b('0xa9')](_0x33d5ff[_0x524b('0x2a')]);});_0x313b53[_0x524b('0xaa')](function(_0xaf22ed){var _0x241c53=createFieldObject(_0x3c966c,_0x43388d,_0xaf22ed[_0x524b('0xab')],_0xaf22ed[_0x524b('0x2a')],_0xaf22ed[_0x524b('0xac')],![]);_0x9d30fe['push'](_0x241c53);});return Promise[_0x524b('0xad')](_0x9d30fe);})[_0x524b('0x26')](function(_0x8abf7d){_0x1cc1f8=_0x8abf7d;_0xafa406=Object[_0x524b('0xa7')]([],_0xd453ef);console[_0x524b('0xa6')](_0x524b('0xae'),_0xd453ef);_[_0x524b('0xa8')](_0xafa406,function(_0x368fc8){return _0x12de7f[_0x524b('0xa9')](_0x368fc8['name']);});console[_0x524b('0xa6')](_0x524b('0xaf'),_0xafa406);_0x9d30fe=[];_0xafa406[_0x524b('0xaa')](function(_0x344ed3){var _0x563737=createFieldObject(_0x3c966c,_0x43388d,_0x344ed3[_0x524b('0xab')],_0x344ed3['name'],_0x344ed3[_0x524b('0xac')],!![]);_0x9d30fe[_0x524b('0xb0')](_0x563737);});return Promise[_0x524b('0xad')](_0x9d30fe);})[_0x524b('0x26')](function(_0x721744){_0x25740a=_0x721744;var _0x1058ca=_0x1cc1f8[_0x524b('0xb1')](_0x25740a);return{'count':_0x1058ca[_0x524b('0x48')],'rows':_0x1058ca};})[_0x524b('0x26')](respondWithResult(_0x56fb47,null))[_0x524b('0x45')](function(_0x463a12){console[_0x524b('0xa6')]('ServiceNow\x20error:\x20'+_0x463a12);var _0x1dbc10=_0x3e68a3[_0x524b('0x32')][_0x524b('0xb2')]?0x1f4:_0x463a12[_0x524b('0xb3')]||0x1f4;logger['error'](_0x463a12['stack']);delete _0x463a12[_0x524b('0x2a')];if(_0x1dbc10===0x191){_0x1dbc10=0x190;}_0x56fb47[_0x524b('0x1a')](_0x1dbc10)['send'](_0x3e68a3[_0x524b('0x32')]['test']?{'message':_0x524b('0xb4'),'statusCode':_0x463a12[_0x524b('0xb3')]}:_0x463a12);});};function createFieldObject(_0x7eca35,_0xf41025,_0x28921d,_0x5427c7,_0x4048ef,_0x3adf90){return new Promise(function(_0x45b385,_0x4d84e2){var _0x308a38={'id':_0x5427c7,'name':_0x4048ef,'custom':_0x3adf90};if(_0x28921d===_0x524b('0xb5')){_0x308a38[_0x524b('0x41')]=[{'name':_0x524b('0xb6'),'value':'true'},{'name':_0x524b('0xb7'),'value':_0x524b('0xb8')}];_0x45b385(_0x308a38);}else{var _0x3b0197={'method':_0x524b('0xa3'),'uri':_0x7eca35+_0x524b('0xb9')+_0x5427c7,'auth':_0xf41025,'json':!![]};return rp(_0x3b0197)[_0x524b('0x26')](function(_0x36d8eb){var _0x266f1c=[];if(_0x36d8eb['result'][_0x524b('0x48')]>0x0){_0x36d8eb[_0x524b('0xa5')]['forEach'](function(_0xa5bdbd){if(_0xa5bdbd[_0x524b('0xba')]===_0x524b('0xb8')){var _0x1b2c68={'name':_0xa5bdbd[_0x524b('0xac')],'value':_0xa5bdbd[_0x524b('0xbb')]};_0x266f1c[_0x524b('0xb0')](_0x1b2c68);}});}_0x308a38[_0x524b('0x41')]=_0x266f1c;if(_0x308a38[_0x524b('0x41')][_0x524b('0x48')]>0x0){_0x45b385(_0x308a38);}else{if(_0x3adf90==![]){_0x45b385();}else{_0x45b385(_0x308a38);}}});}});} \ No newline at end of file +var _0xca54=['name','ServicenowAccount','rawAttributes','type','key','model','map','keys','query','attributes','intersection','fields','length','order','sort','filters','filter','where','merge','options','includeAll','include','catch','show','find','create','body','destroy','params','ServicenowConfiguration','pick','getConfigurations','nolimit','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','close_notes','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','password','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','label','all','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','ServiceNow\x20error:\x20','test','statusCode','stack','send','False','false','sys_choice?sysparm_query=name=incident^element=','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','json','apply','reject','save','update','then','error'];(function(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0xca54,0x1eb));var _0x4ca5=function(_0x46888c,_0x2c6dcb){_0x46888c=_0x46888c-0x0;var _0x530b67=_0xca54[_0x46888c];return _0x530b67;};'use strict';var emlformat=require(_0x4ca5('0x0'));var rimraf=require(_0x4ca5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ca5('0x2'));var rp=require('request-promise');var moment=require(_0x4ca5('0x3'));var BPromise=require(_0x4ca5('0x4'));var Mustache=require(_0x4ca5('0x5'));var util=require(_0x4ca5('0x6'));var path=require('path');var sox=require(_0x4ca5('0x7'));var csv=require(_0x4ca5('0x8'));var ejs=require(_0x4ca5('0x9'));var fs=require('fs');var fs_extra=require(_0x4ca5('0xa'));var _=require(_0x4ca5('0xb'));var squel=require('squel');var crypto=require(_0x4ca5('0xc'));var jsforce=require(_0x4ca5('0xd'));var deskjs=require(_0x4ca5('0xe'));var toCsv=require(_0x4ca5('0x8'));var querystring=require('querystring');var Papa=require(_0x4ca5('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ca5('0x10'));var logger=require(_0x4ca5('0x11'))(_0x4ca5('0x12'));var utils=require(_0x4ca5('0x13'));var config=require(_0x4ca5('0x14'));var licenseUtil=require(_0x4ca5('0x15'));var db=require(_0x4ca5('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x9937b7,_0x3764df){_0x3764df=_0x3764df||0xcc;return function(_0x652e8){if(_0x652e8){return _0x9937b7[_0x4ca5('0x17')](_0x3764df);}return _0x9937b7[_0x4ca5('0x18')](_0x3764df)[_0x4ca5('0x19')]();};}function respondWithResult(_0xdb4c02,_0x4cd64c){_0x4cd64c=_0x4cd64c||0xc8;return function(_0x24f870){if(_0x24f870){return _0xdb4c02[_0x4ca5('0x18')](_0x4cd64c)['json'](_0x24f870);}};}function respondWithFilteredResult(_0xda08f2,_0x413e22){return function(_0x2348a8){if(_0x2348a8){var _0xf41883=typeof _0x413e22[_0x4ca5('0x1a')]==='undefined'&&typeof _0x413e22[_0x4ca5('0x1b')]==='undefined';var _0x3e7fc1=_0x2348a8[_0x4ca5('0x1c')];var _0x52a222=_0xf41883?0x0:_0x413e22[_0x4ca5('0x1a')];var _0x22e4d2=_0xf41883?_0x2348a8[_0x4ca5('0x1c')]:_0x413e22[_0x4ca5('0x1a')]+_0x413e22[_0x4ca5('0x1b')];var _0x6edbe;if(_0x22e4d2>=_0x3e7fc1){_0x22e4d2=_0x3e7fc1;_0x6edbe=0xc8;}else{_0x6edbe=0xce;}_0xda08f2['status'](_0x6edbe);return _0xda08f2[_0x4ca5('0x1d')]('Content-Range',_0x52a222+'-'+_0x22e4d2+'/'+_0x3e7fc1)[_0x4ca5('0x1e')](_0x2348a8);}return null;};}function patchUpdates(_0x4fa89d){return function(_0x190892){try{jsonpatch[_0x4ca5('0x1f')](_0x190892,_0x4fa89d,!![]);}catch(_0x39fc79){return BPromise[_0x4ca5('0x20')](_0x39fc79);}return _0x190892[_0x4ca5('0x21')]();};}function saveUpdates(_0x57af85,_0xf308b6){return function(_0x433c61){if(_0x433c61){return _0x433c61[_0x4ca5('0x22')](_0x57af85)[_0x4ca5('0x23')](function(_0x322817){return _0x322817;});}return null;};}function removeEntity(_0x490c9d,_0xfcada3){return function(_0x3b4310){if(_0x3b4310){return _0x3b4310['destroy']()[_0x4ca5('0x23')](function(){_0x490c9d['status'](0xcc)[_0x4ca5('0x19')]();});}};}function handleEntityNotFound(_0x10085f,_0x10f43e){return function(_0x3c20b4){if(!_0x3c20b4){_0x10085f[_0x4ca5('0x17')](0x194);}return _0x3c20b4;};}function handleError(_0x3cb16a,_0x540040){_0x540040=_0x540040||0x1f4;return function(_0x1a0a7f){logger[_0x4ca5('0x24')](_0x1a0a7f['stack']);if(_0x1a0a7f[_0x4ca5('0x25')]){delete _0x1a0a7f[_0x4ca5('0x25')];}_0x3cb16a['status'](_0x540040)['send'](_0x1a0a7f);};}exports['index']=function(_0x277915,_0x247cfb){var _0xc225d5={},_0x2e1750={},_0x5e5021={'count':0x0,'rows':[]};var _0x2a650e=_['map'](db[_0x4ca5('0x26')][_0x4ca5('0x27')],function(_0x197c79){return{'name':_0x197c79['fieldName'],'type':_0x197c79[_0x4ca5('0x28')][_0x4ca5('0x29')]};});_0x2e1750[_0x4ca5('0x2a')]=_[_0x4ca5('0x2b')](_0x2a650e,_0x4ca5('0x25'));_0x2e1750['query']=_[_0x4ca5('0x2c')](_0x277915[_0x4ca5('0x2d')]);_0x2e1750['filters']=_['intersection'](_0x2e1750[_0x4ca5('0x2a')],_0x2e1750[_0x4ca5('0x2d')]);_0xc225d5[_0x4ca5('0x2e')]=_[_0x4ca5('0x2f')](_0x2e1750[_0x4ca5('0x2a')],qs[_0x4ca5('0x30')](_0x277915['query'][_0x4ca5('0x30')]));_0xc225d5[_0x4ca5('0x2e')]=_0xc225d5[_0x4ca5('0x2e')][_0x4ca5('0x31')]?_0xc225d5[_0x4ca5('0x2e')]:_0x2e1750[_0x4ca5('0x2a')];if(!_0x277915[_0x4ca5('0x2d')]['hasOwnProperty']('nolimit')){_0xc225d5[_0x4ca5('0x1b')]=qs['limit'](_0x277915[_0x4ca5('0x2d')][_0x4ca5('0x1b')]);_0xc225d5[_0x4ca5('0x1a')]=qs[_0x4ca5('0x1a')](_0x277915['query'][_0x4ca5('0x1a')]);}_0xc225d5[_0x4ca5('0x32')]=qs[_0x4ca5('0x33')](_0x277915[_0x4ca5('0x2d')][_0x4ca5('0x33')]);_0xc225d5['where']=qs[_0x4ca5('0x34')](_['pick'](_0x277915[_0x4ca5('0x2d')],_0x2e1750['filters']),_0x2a650e);if(_0x277915['query'][_0x4ca5('0x35')]){_0xc225d5[_0x4ca5('0x36')]=_[_0x4ca5('0x37')](_0xc225d5[_0x4ca5('0x36')],{'$or':_['map'](_0x2a650e,function(_0x4d3474){if(_0x4d3474[_0x4ca5('0x28')]!=='VIRTUAL'){var _0x210d17={};_0x210d17[_0x4d3474[_0x4ca5('0x25')]]={'$like':'%'+_0x277915['query'][_0x4ca5('0x35')]+'%'};return _0x210d17;}})});}_0xc225d5=_[_0x4ca5('0x37')]({},_0xc225d5,_0x277915[_0x4ca5('0x38')]);var _0x3f0426={'where':_0xc225d5[_0x4ca5('0x36')]};return db[_0x4ca5('0x26')][_0x4ca5('0x1c')](_0x3f0426)[_0x4ca5('0x23')](function(_0x5adb72){_0x5e5021[_0x4ca5('0x1c')]=_0x5adb72;if(_0x277915['query'][_0x4ca5('0x39')]){_0xc225d5[_0x4ca5('0x3a')]=[{'all':!![]}];}return db[_0x4ca5('0x26')]['findAll'](_0xc225d5);})[_0x4ca5('0x23')](function(_0x18f441){_0x5e5021['rows']=_0x18f441;return _0x5e5021;})[_0x4ca5('0x23')](respondWithFilteredResult(_0x247cfb,_0xc225d5))[_0x4ca5('0x3b')](handleError(_0x247cfb,null));};exports[_0x4ca5('0x3c')]=function(_0xdf615,_0x36ffec){var _0x1ab28b={'raw':![],'where':{'id':_0xdf615['params']['id']}},_0x36c068={};_0x36c068['model']=_[_0x4ca5('0x2c')](db[_0x4ca5('0x26')][_0x4ca5('0x27')]);_0x36c068[_0x4ca5('0x2d')]=_[_0x4ca5('0x2c')](_0xdf615[_0x4ca5('0x2d')]);_0x36c068[_0x4ca5('0x34')]=_['intersection'](_0x36c068[_0x4ca5('0x2a')],_0x36c068[_0x4ca5('0x2d')]);_0x1ab28b[_0x4ca5('0x2e')]=_[_0x4ca5('0x2f')](_0x36c068['model'],qs[_0x4ca5('0x30')](_0xdf615[_0x4ca5('0x2d')][_0x4ca5('0x30')]));_0x1ab28b[_0x4ca5('0x2e')]=_0x1ab28b[_0x4ca5('0x2e')][_0x4ca5('0x31')]?_0x1ab28b[_0x4ca5('0x2e')]:_0x36c068['model'];if(_0xdf615[_0x4ca5('0x2d')]['includeAll']){_0x1ab28b[_0x4ca5('0x3a')]=[{'all':!![]}];}_0x1ab28b=_[_0x4ca5('0x37')]({},_0x1ab28b,_0xdf615[_0x4ca5('0x38')]);return db[_0x4ca5('0x26')][_0x4ca5('0x3d')](_0x1ab28b)[_0x4ca5('0x23')](handleEntityNotFound(_0x36ffec,null))['then'](respondWithResult(_0x36ffec,null))[_0x4ca5('0x3b')](handleError(_0x36ffec,null));};exports[_0x4ca5('0x3e')]=function(_0x2bdf49,_0x2bc956){return db['ServicenowAccount'][_0x4ca5('0x3e')](_0x2bdf49['body'],{})[_0x4ca5('0x23')](respondWithResult(_0x2bc956,0xc9))[_0x4ca5('0x3b')](handleError(_0x2bc956,null));};exports[_0x4ca5('0x22')]=function(_0x1dff0b,_0x7e30ed){if(_0x1dff0b[_0x4ca5('0x3f')]['id']){delete _0x1dff0b['body']['id'];}return db[_0x4ca5('0x26')][_0x4ca5('0x3d')]({'where':{'id':_0x1dff0b['params']['id']}})[_0x4ca5('0x23')](handleEntityNotFound(_0x7e30ed,null))['then'](saveUpdates(_0x1dff0b['body'],null))['then'](respondWithResult(_0x7e30ed,null))[_0x4ca5('0x3b')](handleError(_0x7e30ed,null));};exports[_0x4ca5('0x40')]=function(_0x4c175a,_0x451148){return db[_0x4ca5('0x26')][_0x4ca5('0x3d')]({'where':{'id':_0x4c175a[_0x4ca5('0x41')]['id']}})[_0x4ca5('0x23')](handleEntityNotFound(_0x451148,null))[_0x4ca5('0x23')](removeEntity(_0x451148,null))[_0x4ca5('0x3b')](handleError(_0x451148,null));};exports['getConfigurations']=function(_0x2db575,_0x477aa5,_0x49a312){var _0xeae8c8={};var _0x339656={};var _0x570b30;var _0x350c2c;return db['ServicenowAccount']['findOne']({'where':{'id':_0x2db575[_0x4ca5('0x41')]['id']}})[_0x4ca5('0x23')](handleEntityNotFound(_0x477aa5,null))[_0x4ca5('0x23')](function(_0x239ae2){if(_0x239ae2){_0x570b30=_0x239ae2;_0x339656[_0x4ca5('0x2a')]=_[_0x4ca5('0x2c')](db[_0x4ca5('0x42')][_0x4ca5('0x27')]);_0x339656[_0x4ca5('0x2d')]=_[_0x4ca5('0x2c')](_0x2db575[_0x4ca5('0x2d')]);_0x339656[_0x4ca5('0x34')]=_['intersection'](_0x339656[_0x4ca5('0x2a')],_0x339656[_0x4ca5('0x2d')]);_0xeae8c8[_0x4ca5('0x2e')]=_[_0x4ca5('0x2f')](_0x339656['model'],qs[_0x4ca5('0x30')](_0x2db575[_0x4ca5('0x2d')][_0x4ca5('0x30')]));_0xeae8c8['attributes']=_0xeae8c8['attributes']['length']?_0xeae8c8['attributes']:_0x339656[_0x4ca5('0x2a')];_0xeae8c8['order']=qs[_0x4ca5('0x33')](_0x2db575[_0x4ca5('0x2d')][_0x4ca5('0x33')]);_0xeae8c8[_0x4ca5('0x36')]=qs[_0x4ca5('0x34')](_[_0x4ca5('0x43')](_0x2db575[_0x4ca5('0x2d')],_0x339656[_0x4ca5('0x34')]));if(_0x2db575[_0x4ca5('0x2d')]['filter']){_0xeae8c8[_0x4ca5('0x36')]=_[_0x4ca5('0x37')](_0xeae8c8['where'],{'$or':_[_0x4ca5('0x2b')](_0xeae8c8['attributes'],function(_0xb7dc04){var _0x33985c={};_0x33985c[_0xb7dc04]={'$like':'%'+_0x2db575[_0x4ca5('0x2d')][_0x4ca5('0x35')]+'%'};return _0x33985c;})});}_0xeae8c8=_[_0x4ca5('0x37')]({},_0xeae8c8,_0x2db575['options']);return _0x570b30[_0x4ca5('0x44')](_0xeae8c8);}})[_0x4ca5('0x23')](function(_0x9856fc){if(_0x9856fc){_0x350c2c=_0x9856fc[_0x4ca5('0x31')];if(!_0x2db575[_0x4ca5('0x2d')]['hasOwnProperty'](_0x4ca5('0x45'))){_0xeae8c8[_0x4ca5('0x1b')]=qs[_0x4ca5('0x1b')](_0x2db575['query'][_0x4ca5('0x1b')]);_0xeae8c8['offset']=qs[_0x4ca5('0x1a')](_0x2db575[_0x4ca5('0x2d')]['offset']);}return _0x570b30[_0x4ca5('0x44')](_0xeae8c8);}})['then'](function(_0x1afa4b){if(_0x1afa4b){return _0x1afa4b?{'count':_0x350c2c,'rows':_0x1afa4b}:null;}})[_0x4ca5('0x23')](respondWithResult(_0x477aa5,null))['catch'](handleError(_0x477aa5,null));};exports[_0x4ca5('0x46')]=function(_0x272fc5,_0x251ef7,_0x58c976){if(_0x272fc5[_0x4ca5('0x3f')]['id']){delete _0x272fc5[_0x4ca5('0x3f')]['id'];}return db[_0x4ca5('0x26')][_0x4ca5('0x47')]({'where':{'id':_0x272fc5[_0x4ca5('0x41')]['id']}})[_0x4ca5('0x23')](handleEntityNotFound(_0x251ef7,null))[_0x4ca5('0x23')](function(_0x156391){if(_0x156391){_0x272fc5['body']['AccountId']=_0x156391['id'];_0x272fc5[_0x4ca5('0x3f')][_0x4ca5('0x48')]=integrations[_0x4ca5('0x49')](_0x272fc5[_0x4ca5('0x3f')][_0x4ca5('0x4a')],_0x272fc5[_0x4ca5('0x3f')][_0x4ca5('0x28')]);_0x272fc5[_0x4ca5('0x3f')][_0x4ca5('0x4b')]=integrations[_0x4ca5('0x4c')](_0x272fc5[_0x4ca5('0x3f')]['channel'],_0x272fc5['body'][_0x4ca5('0x28')]);return db['ServicenowConfiguration'][_0x4ca5('0x3e')](_0x272fc5['body'],{'include':[{'model':db[_0x4ca5('0x4d')],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0x4ca5('0x4b')}]});}return null;})[_0x4ca5('0x23')](respondWithResult(_0x251ef7,null))[_0x4ca5('0x3b')](handleError(_0x251ef7,null));};exports[_0x4ca5('0x4e')]=function(_0x3bda03,_0x590d56,_0x55d86d){var _0x4fa68c=[_0x4ca5('0x4f'),_0x4ca5('0x50'),'knowledge',_0x4ca5('0x51'),_0x4ca5('0x52'),_0x4ca5('0x53'),_0x4ca5('0x54'),_0x4ca5('0x55'),_0x4ca5('0x56')];var _0x1f9f39=[_0x4ca5('0x57'),'made_sla',_0x4ca5('0x58'),'watch_list',_0x4ca5('0x59'),_0x4ca5('0x5a'),_0x4ca5('0x5b'),_0x4ca5('0x50'),_0x4ca5('0x5c'),_0x4ca5('0x5d'),_0x4ca5('0x5e'),_0x4ca5('0x5f'),_0x4ca5('0x60'),_0x4ca5('0x61'),_0x4ca5('0x62'),'sys_domain','state',_0x4ca5('0x63'),_0x4ca5('0x64'),_0x4ca5('0x32'),_0x4ca5('0x65'),_0x4ca5('0x66'),_0x4ca5('0x67'),_0x4ca5('0x68'),'impact',_0x4ca5('0x69'),_0x4ca5('0x6a'),'business_service',_0x4ca5('0x6b'),_0x4ca5('0x6c'),'rfc',_0x4ca5('0x6d'),_0x4ca5('0x6e'),_0x4ca5('0x6f'),_0x4ca5('0x70'),'group_list',_0x4ca5('0x71'),_0x4ca5('0x72'),_0x4ca5('0x73'),_0x4ca5('0x74'),'approval_set',_0x4ca5('0x51'),_0x4ca5('0x75'),_0x4ca5('0x76'),_0x4ca5('0x52'),_0x4ca5('0x77'),_0x4ca5('0x78'),_0x4ca5('0x79'),_0x4ca5('0x7a'),_0x4ca5('0x7b'),_0x4ca5('0x7c'),_0x4ca5('0x7d'),'calendar_duration',_0x4ca5('0x53'),_0x4ca5('0x7e'),_0x4ca5('0x7f'),'closed_by','follow_up',_0x4ca5('0x80'),_0x4ca5('0x81'),_0x4ca5('0x82'),_0x4ca5('0x83'),_0x4ca5('0x54'),_0x4ca5('0x84'),_0x4ca5('0x85'),_0x4ca5('0x86'),'reassignment_count','activity_due','assigned_to',_0x4ca5('0x55'),_0x4ca5('0x87'),_0x4ca5('0x88'),_0x4ca5('0x89'),_0x4ca5('0x8a'),_0x4ca5('0x8b'),_0x4ca5('0x8c'),_0x4ca5('0x8d'),'sys_tags',_0x4ca5('0x8e'),_0x4ca5('0x8f'),_0x4ca5('0x90'),'location',_0x4ca5('0x56')];var _0x56b8ed='';var _0x2d4157='';var _0x2440b2=[];var _0x22d2ab='';var _0xf87561='';var _0x491840=[];var _0x2887bf='';var _0x120976='';var _0x260e1d={};var _0x1fd11e='';return db[_0x4ca5('0x26')][_0x4ca5('0x47')]({'where':{'id':_0x3bda03['params']['id']},'attributes':['id','username',_0x4ca5('0x91'),'email',_0x4ca5('0x92'),'serverUrl']})[_0x4ca5('0x23')](handleEntityNotFound(_0x590d56,null))['then'](function(_0x35c390){if(_0x35c390){_0x1fd11e=_0x35c390['remoteUri'];var _0x20a9ee=_0x1fd11e['slice'](-0x1);if(_0x20a9ee==='/'){_0x1fd11e=_0x1fd11e[_0x4ca5('0x93')](0x0,_0x1fd11e[_0x4ca5('0x94')](_0x20a9ee));}_0x120976=util[_0x4ca5('0x95')](_0x4ca5('0x96'),_0x1fd11e);_0x2887bf=util[_0x4ca5('0x95')](_0x4ca5('0x97'),_0x1fd11e);_0x260e1d={'user':_0x35c390[_0x4ca5('0x98')],'pass':_0x35c390['password']};var _0x10f0a3={'method':_0x4ca5('0x99'),'uri':_0x120976+_0x4ca5('0x9a'),'auth':_0x260e1d,'json':!![]};return rp(_0x10f0a3);}})['then'](function(_0x57ccfc){if(_0x57ccfc['result'][_0x4ca5('0x31')]>0x0){_0x56b8ed=_0x57ccfc[_0x4ca5('0x9b')];}console[_0x4ca5('0x9c')]('incident\x20table\x20objects',_0x56b8ed);_0x491840=[];_0x2d4157=Object[_0x4ca5('0x9d')]([],_0x56b8ed);_['remove'](_0x2d4157,function(_0x2bf8e7){return!_0x4fa68c[_0x4ca5('0x9e')](_0x2bf8e7[_0x4ca5('0x25')]);});_0x2d4157[_0x4ca5('0x9f')](function(_0x3758e4){var _0x281ca6=createFieldObject(_0x2887bf,_0x260e1d,_0x3758e4[_0x4ca5('0xa0')],_0x3758e4['name'],_0x3758e4[_0x4ca5('0xa1')],![]);_0x491840['push'](_0x281ca6);});return Promise[_0x4ca5('0xa2')](_0x491840);})['then'](function(_0x3efe46){_0x2440b2=_0x3efe46;_0x22d2ab=Object[_0x4ca5('0x9d')]([],_0x56b8ed);console[_0x4ca5('0x9c')](_0x4ca5('0xa3'),_0x56b8ed);_[_0x4ca5('0xa4')](_0x22d2ab,function(_0x3649ec){return _0x1f9f39[_0x4ca5('0x9e')](_0x3649ec[_0x4ca5('0x25')]);});console[_0x4ca5('0x9c')](_0x4ca5('0xa5'),_0x22d2ab);_0x491840=[];_0x22d2ab[_0x4ca5('0x9f')](function(_0xf9c2){var _0x3d5711=createFieldObject(_0x2887bf,_0x260e1d,_0xf9c2[_0x4ca5('0xa0')],_0xf9c2[_0x4ca5('0x25')],_0xf9c2['label'],!![]);_0x491840[_0x4ca5('0xa6')](_0x3d5711);});return Promise[_0x4ca5('0xa2')](_0x491840);})['then'](function(_0x68bf03){_0xf87561=_0x68bf03;var _0x2099d3=_0x2440b2[_0x4ca5('0xa7')](_0xf87561);return{'count':_0x2099d3[_0x4ca5('0x31')],'rows':_0x2099d3};})[_0x4ca5('0x23')](respondWithResult(_0x590d56,null))[_0x4ca5('0x3b')](function(_0x3a3445){console[_0x4ca5('0x9c')](_0x4ca5('0xa8')+_0x3a3445);var _0x4a01c7=_0x3bda03['query'][_0x4ca5('0xa9')]?0x1f4:_0x3a3445[_0x4ca5('0xaa')]||0x1f4;logger['error'](_0x3a3445[_0x4ca5('0xab')]);delete _0x3a3445[_0x4ca5('0x25')];if(_0x4a01c7===0x191){_0x4a01c7=0x190;}_0x590d56['status'](_0x4a01c7)[_0x4ca5('0xac')](_0x3bda03['query'][_0x4ca5('0xa9')]?{'message':'Wrong\x20credentials','statusCode':_0x3a3445['statusCode']}:_0x3a3445);});};function createFieldObject(_0x38b011,_0x1a9064,_0x101170,_0x2f3244,_0x14a86b,_0x211421){return new Promise(function(_0x4a5e0c,_0xd1fb12){var _0x473995={'id':_0x2f3244,'name':_0x14a86b,'custom':_0x211421};if(_0x101170==='boolean'){_0x473995[_0x4ca5('0x38')]=[{'name':'True','value':'true'},{'name':_0x4ca5('0xad'),'value':_0x4ca5('0xae')}];_0x4a5e0c(_0x473995);}else{var _0x482e26={'method':'GET','uri':_0x38b011+_0x4ca5('0xaf')+_0x2f3244,'auth':_0x1a9064,'json':!![]};return rp(_0x482e26)[_0x4ca5('0x23')](function(_0x3a8a2d){var _0xc33270=[];if(_0x3a8a2d[_0x4ca5('0x9b')][_0x4ca5('0x31')]>0x0){_0x3a8a2d[_0x4ca5('0x9b')][_0x4ca5('0x9f')](function(_0x31a7b6){if(_0x31a7b6['inactive']===_0x4ca5('0xae')){var _0x344c92={'name':_0x31a7b6[_0x4ca5('0xa1')],'value':_0x31a7b6['value']};_0xc33270['push'](_0x344c92);}});}_0x473995[_0x4ca5('0x38')]=_0xc33270;if(_0x473995[_0x4ca5('0x38')]['length']>0x0){_0x4a5e0c(_0x473995);}else{if(_0x211421==![]){_0x4a5e0c();}else{_0x4a5e0c(_0x473995);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 6ab0f93..054e0f8 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 _0x5d58=['request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','bluebird'];(function(_0x44c5c1,_0x4d9d55){var _0x467172=function(_0x584e24){while(--_0x584e24){_0x44c5c1['push'](_0x44c5c1['shift']());}};_0x467172(++_0x4d9d55);}(_0x5d58,0x187));var _0x85d5=function(_0x240d24,_0x3e49da){_0x240d24=_0x240d24-0x0;var _0x456a39=_0x5d58[_0x240d24];return _0x456a39;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x85d5('0x4'));module[_0x85d5('0x5')]=function(_0x578fad,_0x46e7b4){return _0x578fad['define'](_0x85d5('0x6'),attributes,{'tableName':_0x85d5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3eea=['bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','../../config/logger','api','moment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x2ec32b,_0x2cc09b){_0x2ec32b=_0x2ec32b-0x0;var _0x57fbe8=_0x3eea[_0x2ec32b];return _0x57fbe8;};'use strict';var _=require(_0xa3ee('0x0'));var util=require('util');var logger=require(_0xa3ee('0x1'))(_0xa3ee('0x2'));var moment=require(_0xa3ee('0x3'));var BPromise=require(_0xa3ee('0x4'));var rp=require(_0xa3ee('0x5'));var fs=require('fs');var path=require(_0xa3ee('0x6'));var rimraf=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var attributes=require(_0xa3ee('0x9'));var integrations=require(_0xa3ee('0xa'));module[_0xa3ee('0xb')]=function(_0x5776bb,_0x538bf9){return _0x5776bb[_0xa3ee('0xc')]('ServicenowAccount',attributes,{'tableName':_0xa3ee('0xd'),'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 845d4ab..66b3803 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 _0xcc22=['catch','GetServicenowAccount','ServicenowAccount','options','where','attributes','limit','include','model','map','ShowServicenowAccount','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','info','result'];(function(_0x2a0346,_0x2c1300){var _0x1f5232=function(_0x345c8e){while(--_0x345c8e){_0x2a0346['push'](_0x2a0346['shift']());}};_0x1f5232(++_0x2c1300);}(_0xcc22,0xbb));var _0x2cc2=function(_0x104e15,_0x548c0b){_0x104e15=_0x104e15-0x0;var _0x36ef4d=_0xcc22[_0x104e15];return _0x36ef4d;};'use strict';var _=require(_0x2cc2('0x0'));var util=require(_0x2cc2('0x1'));var moment=require(_0x2cc2('0x2'));var BPromise=require('bluebird');var rs=require(_0x2cc2('0x3'));var fs=require('fs');var Redis=require(_0x2cc2('0x4'));var db=require(_0x2cc2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cc2('0x6'))(_0x2cc2('0x7'));var config=require(_0x2cc2('0x8'));var jayson=require(_0x2cc2('0x9'));var client=jayson['client'][_0x2cc2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56e3d8,_0x34c094,_0x4813fe){return new BPromise(function(_0x1d200c,_0xc32b72){return client[_0x2cc2('0xb')](_0x56e3d8,_0x4813fe)[_0x2cc2('0xc')](function(_0x24264c){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x34c094,_0x2cc2('0xd'));logger[_0x2cc2('0xe')](_0x2cc2('0xf'),_0x34c094,_0x2cc2('0xd'),JSON[_0x2cc2('0x10')](_0x24264c));if(_0x24264c['error']){if(_0x24264c[_0x2cc2('0x11')][_0x2cc2('0x12')]===0x1f4){logger[_0x2cc2('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x34c094,_0x24264c['error'][_0x2cc2('0x13')]);return _0xc32b72(_0x24264c[_0x2cc2('0x11')][_0x2cc2('0x13')]);}logger[_0x2cc2('0x11')](_0x2cc2('0x14'),_0x34c094,_0x24264c[_0x2cc2('0x11')][_0x2cc2('0x13')]);return _0x1d200c(_0x24264c[_0x2cc2('0x11')][_0x2cc2('0x13')]);}else{logger[_0x2cc2('0x15')](_0x2cc2('0x14'),_0x34c094,_0x2cc2('0xd'));_0x1d200c(_0x24264c[_0x2cc2('0x16')][_0x2cc2('0x13')]);}})[_0x2cc2('0x17')](function(_0x2d2262){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x34c094,_0x2d2262);_0xc32b72(_0x2d2262);});});}exports[_0x2cc2('0x18')]=function(_0x3e9ec0){var _0x11b9b1=this;return new Promise(function(_0x35fd52,_0x4b22df){return db[_0x2cc2('0x19')]['findAll']({'raw':_0x3e9ec0['options']?_0x3e9ec0[_0x2cc2('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3e9ec0['options']?_0x3e9ec0[_0x2cc2('0x1a')][_0x2cc2('0x1b')]||null:null,'attributes':_0x3e9ec0[_0x2cc2('0x1a')]?_0x3e9ec0[_0x2cc2('0x1a')][_0x2cc2('0x1c')]||null:null,'limit':_0x3e9ec0[_0x2cc2('0x1a')]?_0x3e9ec0[_0x2cc2('0x1a')][_0x2cc2('0x1d')]||null:null,'include':_0x3e9ec0[_0x2cc2('0x1a')]?_0x3e9ec0[_0x2cc2('0x1a')]['include']?_['map'](_0x3e9ec0['options'][_0x2cc2('0x1e')],function(_0xc197fd){return{'model':db[_0xc197fd[_0x2cc2('0x1f')]],'as':_0xc197fd['as'],'attributes':_0xc197fd['attributes'],'include':_0xc197fd['include']?_[_0x2cc2('0x20')](_0xc197fd['include'],function(_0x156622){return{'model':db[_0x156622['model']],'as':_0x156622['as'],'attributes':_0x156622[_0x2cc2('0x1c')],'include':_0x156622[_0x2cc2('0x1e')]?_[_0x2cc2('0x20')](_0x156622['include'],function(_0x2bff08){return{'model':db[_0x2bff08[_0x2cc2('0x1f')]],'as':_0x2bff08['as'],'attributes':_0x2bff08[_0x2cc2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2cc2('0xc')](function(_0x107eb2){logger[_0x2cc2('0x15')](_0x2cc2('0x18'),_0x3e9ec0);logger['debug']('GetServicenowAccount',_0x3e9ec0,JSON['stringify'](_0x107eb2));_0x35fd52(_0x107eb2);})[_0x2cc2('0x17')](function(_0x56f2f9){logger[_0x2cc2('0x11')](_0x2cc2('0x18'),_0x56f2f9['message'],_0x3e9ec0);_0x4b22df(_0x11b9b1[_0x2cc2('0x11')](0x1f4,_0x56f2f9[_0x2cc2('0x13')]));});});};exports[_0x2cc2('0x21')]=function(_0x8e9df8){var _0x43c80b=this;return new Promise(function(_0x18aee8,_0x1a8b6b){return db['ServicenowAccount']['find']({'raw':_0x8e9df8[_0x2cc2('0x1a')]?_0x8e9df8[_0x2cc2('0x1a')][_0x2cc2('0x22')]===undefined?!![]:![]:!![],'where':_0x8e9df8[_0x2cc2('0x1a')]?_0x8e9df8[_0x2cc2('0x1a')][_0x2cc2('0x1b')]||null:null,'attributes':_0x8e9df8[_0x2cc2('0x1a')]?_0x8e9df8[_0x2cc2('0x1a')][_0x2cc2('0x1c')]||null:null,'include':_0x8e9df8['options']?_0x8e9df8[_0x2cc2('0x1a')][_0x2cc2('0x1e')]?_[_0x2cc2('0x20')](_0x8e9df8[_0x2cc2('0x1a')][_0x2cc2('0x1e')],function(_0x13c6a8){return{'model':db[_0x13c6a8[_0x2cc2('0x1f')]],'as':_0x13c6a8['as'],'attributes':_0x13c6a8[_0x2cc2('0x1c')],'include':_0x13c6a8[_0x2cc2('0x1e')]?_[_0x2cc2('0x20')](_0x13c6a8[_0x2cc2('0x1e')],function(_0x4c1079){return{'model':db[_0x4c1079['model']],'as':_0x4c1079['as'],'attributes':_0x4c1079[_0x2cc2('0x1c')],'include':_0x4c1079[_0x2cc2('0x1e')]?_[_0x2cc2('0x20')](_0x4c1079[_0x2cc2('0x1e')],function(_0x554972){return{'model':db[_0x554972[_0x2cc2('0x1f')]],'as':_0x554972['as'],'attributes':_0x554972[_0x2cc2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2cc2('0xc')](function(_0x5650c7){logger['info'](_0x2cc2('0x21'),_0x8e9df8);logger[_0x2cc2('0xe')](_0x2cc2('0x21'),_0x8e9df8,JSON[_0x2cc2('0x10')](_0x5650c7));_0x18aee8(_0x5650c7);})[_0x2cc2('0x17')](function(_0x1da4ed){logger[_0x2cc2('0x11')]('ShowServicenowAccount',_0x1da4ed[_0x2cc2('0x13')],_0x8e9df8);_0x1a8b6b(_0x43c80b['error'](0x1f4,_0x1da4ed[_0x2cc2('0x13')]));});});}; \ No newline at end of file +var _0xd15b=['ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','attributes','limit','include','map','model','debug','ShowServicenowAccount','find','where','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x196380,_0x3ee707){var _0x12cad7=function(_0x5aea3c){while(--_0x5aea3c){_0x196380['push'](_0x196380['shift']());}};_0x12cad7(++_0x3ee707);}(_0xd15b,0x195));var _0xbd15=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd15b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbd15('0x0'));var util=require(_0xbd15('0x1'));var moment=require('moment');var BPromise=require(_0xbd15('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd15('0x3'));var db=require(_0xbd15('0x4'))['db'];var utils=require(_0xbd15('0x5'));var logger=require(_0xbd15('0x6'))(_0xbd15('0x7'));var config=require('../../config/environment');var jayson=require(_0xbd15('0x8'));var client=jayson[_0xbd15('0x9')][_0xbd15('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24c769,_0x5190db,_0x4e52b2){return new BPromise(function(_0x6e982d,_0x5c5049){return client['request'](_0x24c769,_0x4e52b2)[_0xbd15('0xb')](function(_0x392d22){logger[_0xbd15('0xc')](_0xbd15('0xd'),_0x5190db,_0xbd15('0xe'));logger['debug'](_0xbd15('0xf'),_0x5190db,'request\x20sent',JSON[_0xbd15('0x10')](_0x392d22));if(_0x392d22['error']){if(_0x392d22[_0xbd15('0x11')][_0xbd15('0x12')]===0x1f4){logger[_0xbd15('0x11')](_0xbd15('0xd'),_0x5190db,_0x392d22[_0xbd15('0x11')][_0xbd15('0x13')]);return _0x5c5049(_0x392d22[_0xbd15('0x11')]['message']);}logger[_0xbd15('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x5190db,_0x392d22[_0xbd15('0x11')][_0xbd15('0x13')]);return _0x6e982d(_0x392d22[_0xbd15('0x11')]['message']);}else{logger[_0xbd15('0xc')](_0xbd15('0xd'),_0x5190db,_0xbd15('0xe'));_0x6e982d(_0x392d22[_0xbd15('0x14')][_0xbd15('0x13')]);}})[_0xbd15('0x15')](function(_0x2c2427){logger[_0xbd15('0x11')](_0xbd15('0xd'),_0x5190db,_0x2c2427);_0x5c5049(_0x2c2427);});});}exports[_0xbd15('0x16')]=function(_0x52d04b){var _0xf88c21=this;return new Promise(function(_0x1680fe,_0x53d8dc){return db[_0xbd15('0x17')]['findAll']({'raw':_0x52d04b[_0xbd15('0x18')]?_0x52d04b[_0xbd15('0x18')][_0xbd15('0x19')]===undefined?!![]:![]:!![],'where':_0x52d04b[_0xbd15('0x18')]?_0x52d04b[_0xbd15('0x18')]['where']||null:null,'attributes':_0x52d04b['options']?_0x52d04b[_0xbd15('0x18')][_0xbd15('0x1a')]||null:null,'limit':_0x52d04b[_0xbd15('0x18')]?_0x52d04b[_0xbd15('0x18')][_0xbd15('0x1b')]||null:null,'include':_0x52d04b[_0xbd15('0x18')]?_0x52d04b[_0xbd15('0x18')][_0xbd15('0x1c')]?_[_0xbd15('0x1d')](_0x52d04b[_0xbd15('0x18')]['include'],function(_0x30d020){return{'model':db[_0x30d020[_0xbd15('0x1e')]],'as':_0x30d020['as'],'attributes':_0x30d020[_0xbd15('0x1a')],'include':_0x30d020[_0xbd15('0x1c')]?_['map'](_0x30d020[_0xbd15('0x1c')],function(_0x4d9a3a){return{'model':db[_0x4d9a3a[_0xbd15('0x1e')]],'as':_0x4d9a3a['as'],'attributes':_0x4d9a3a[_0xbd15('0x1a')],'include':_0x4d9a3a['include']?_[_0xbd15('0x1d')](_0x4d9a3a['include'],function(_0x2974de){return{'model':db[_0x2974de[_0xbd15('0x1e')]],'as':_0x2974de['as'],'attributes':_0x2974de['attributes']};}):[]};}):[]};}):[]:[]})[_0xbd15('0xb')](function(_0x306be7){logger['info'](_0xbd15('0x16'),_0x52d04b);logger[_0xbd15('0x1f')](_0xbd15('0x16'),_0x52d04b,JSON['stringify'](_0x306be7));_0x1680fe(_0x306be7);})[_0xbd15('0x15')](function(_0x310b95){logger[_0xbd15('0x11')](_0xbd15('0x16'),_0x310b95[_0xbd15('0x13')],_0x52d04b);_0x53d8dc(_0xf88c21[_0xbd15('0x11')](0x1f4,_0x310b95[_0xbd15('0x13')]));});});};exports[_0xbd15('0x20')]=function(_0x385919){var _0x1dfa76=this;return new Promise(function(_0xf16c2c,_0x4019d8){return db[_0xbd15('0x17')][_0xbd15('0x21')]({'raw':_0x385919[_0xbd15('0x18')]?_0x385919[_0xbd15('0x18')][_0xbd15('0x19')]===undefined?!![]:![]:!![],'where':_0x385919[_0xbd15('0x18')]?_0x385919['options'][_0xbd15('0x22')]||null:null,'attributes':_0x385919[_0xbd15('0x18')]?_0x385919[_0xbd15('0x18')][_0xbd15('0x1a')]||null:null,'include':_0x385919['options']?_0x385919['options']['include']?_[_0xbd15('0x1d')](_0x385919[_0xbd15('0x18')][_0xbd15('0x1c')],function(_0x4d1b16){return{'model':db[_0x4d1b16[_0xbd15('0x1e')]],'as':_0x4d1b16['as'],'attributes':_0x4d1b16[_0xbd15('0x1a')],'include':_0x4d1b16[_0xbd15('0x1c')]?_[_0xbd15('0x1d')](_0x4d1b16[_0xbd15('0x1c')],function(_0x4cb1cb){return{'model':db[_0x4cb1cb[_0xbd15('0x1e')]],'as':_0x4cb1cb['as'],'attributes':_0x4cb1cb[_0xbd15('0x1a')],'include':_0x4cb1cb[_0xbd15('0x1c')]?_[_0xbd15('0x1d')](_0x4cb1cb[_0xbd15('0x1c')],function(_0x14dbf3){return{'model':db[_0x14dbf3[_0xbd15('0x1e')]],'as':_0x14dbf3['as'],'attributes':_0x14dbf3['attributes']};}):[]};}):[]};}):[]:[]})[_0xbd15('0xb')](function(_0x323fd0){logger[_0xbd15('0xc')](_0xbd15('0x20'),_0x385919);logger[_0xbd15('0x1f')](_0xbd15('0x20'),_0x385919,JSON[_0xbd15('0x10')](_0x323fd0));_0xf16c2c(_0x323fd0);})[_0xbd15('0x15')](function(_0x5791c2){logger[_0xbd15('0x11')](_0xbd15('0x20'),_0x5791c2['message'],_0x385919);_0x4019d8(_0x1dfa76['error'](0x1f4,_0x5791c2[_0xbd15('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 63eb0de..8e5a4ba 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 _0xfb1d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0xfb1d,0x9f));var _0xdfb1=function(_0x5e0283,_0x4ec1d7){_0x5e0283=_0x5e0283-0x0;var _0x2f4dde=_0xfb1d[_0x5e0283];return _0x2f4dde;};'use strict';var multer=require('multer');var util=require(_0xdfb1('0x0'));var path=require(_0xdfb1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdfb1('0x2')]();var fs_extra=require(_0xdfb1('0x3'));var auth=require(_0xdfb1('0x4'));var interaction=require(_0xdfb1('0x5'));var config=require(_0xdfb1('0x6'));var controller=require(_0xdfb1('0x7'));router[_0xdfb1('0x8')]('/',auth[_0xdfb1('0x9')](),controller[_0xdfb1('0xa')]);router[_0xdfb1('0x8')](_0xdfb1('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xdfb1('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xdfb1('0xc')]);router[_0xdfb1('0x8')](_0xdfb1('0xd'),auth[_0xdfb1('0x9')](),controller[_0xdfb1('0xe')]);router['get']('/:id/descriptions',auth[_0xdfb1('0x9')](),controller[_0xdfb1('0xf')]);router[_0xdfb1('0x10')]('/',auth[_0xdfb1('0x9')](),controller[_0xdfb1('0x11')]);router[_0xdfb1('0x12')]('/:id',auth[_0xdfb1('0x9')](),controller[_0xdfb1('0x13')]);router[_0xdfb1('0x14')](_0xdfb1('0xb'),auth[_0xdfb1('0x9')](),controller[_0xdfb1('0x15')]);module[_0xdfb1('0x16')]=router; \ No newline at end of file +var _0x54d7=['multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','/:id','exports'];(function(_0x54b39c,_0x41d31b){var _0x4d5d4c=function(_0x1480b9){while(--_0x1480b9){_0x54b39c['push'](_0x54b39c['shift']());}};_0x4d5d4c(++_0x41d31b);}(_0x54d7,0x17a));var _0x754d=function(_0x48d46f,_0x279bad){_0x48d46f=_0x48d46f-0x0;var _0x309bce=_0x54d7[_0x48d46f];return _0x309bce;};'use strict';var multer=require(_0x754d('0x0'));var util=require(_0x754d('0x1'));var path=require(_0x754d('0x2'));var timeout=require(_0x754d('0x3'));var express=require(_0x754d('0x4'));var router=express['Router']();var fs_extra=require(_0x754d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x754d('0x6'));var config=require(_0x754d('0x7'));var controller=require(_0x754d('0x8'));router[_0x754d('0x9')]('/',auth[_0x754d('0xa')](),controller['index']);router['get']('/:id',auth[_0x754d('0xa')](),controller['show']);router[_0x754d('0x9')](_0x754d('0xb'),auth[_0x754d('0xa')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x754d('0xa')](),controller[_0x754d('0xc')]);router['get'](_0x754d('0xd'),auth[_0x754d('0xa')](),controller[_0x754d('0xe')]);router[_0x754d('0xf')]('/',auth[_0x754d('0xa')](),controller[_0x754d('0x10')]);router[_0x754d('0x11')]('/:id',auth[_0x754d('0xa')](),controller[_0x754d('0x12')]);router['delete'](_0x754d('0x13'),auth[_0x754d('0xa')](),controller['destroy']);module[_0x754d('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 016c07e..1880db4 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 _0x89c7=['exports','STRING','sequelize'];(function(_0x2300f2,_0x315c5f){var _0x6bd508=function(_0x2fa0f6){while(--_0x2fa0f6){_0x2300f2['push'](_0x2300f2['shift']());}};_0x6bd508(++_0x315c5f);}(_0x89c7,0x1f4));var _0x789c=function(_0x11a422,_0x5907a5){_0x11a422=_0x11a422-0x0;var _0x547177=_0x89c7[_0x11a422];return _0x547177;};'use strict';var Sequelize=require(_0x789c('0x0'));module[_0x789c('0x1')]={'name':{'type':Sequelize[_0x789c('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe2ac=['STRING','sequelize'];(function(_0x40db41,_0x99d735){var _0x16b759=function(_0x322855){while(--_0x322855){_0x40db41['push'](_0x40db41['shift']());}};_0x16b759(++_0x99d735);}(_0xe2ac,0xf5));var _0xce2a=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0xe2ac[_0x3c4dad];return _0x1a4f49;};'use strict';var Sequelize=require(_0xce2a('0x0'));module['exports']={'name':{'type':Sequelize[_0xce2a('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 46dde68..514484d 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 _0xb5ac=['findOne','ServicenowField','length','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','save','destroy','then','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','getFields'];(function(_0x279174,_0x406685){var _0x287239=function(_0x115e37){while(--_0x115e37){_0x279174['push'](_0x279174['shift']());}};_0x287239(++_0x406685);}(_0xb5ac,0xaa));var _0xcb5a=function(_0x3a61da,_0x27e907){_0x3a61da=_0x3a61da-0x0;var _0x3ef32f=_0xb5ac[_0x3a61da];return _0x3ef32f;};'use strict';var emlformat=require(_0xcb5a('0x0'));var rimraf=require(_0xcb5a('0x1'));var zipdir=require(_0xcb5a('0x2'));var jsonpatch=require(_0xcb5a('0x3'));var rp=require(_0xcb5a('0x4'));var moment=require(_0xcb5a('0x5'));var BPromise=require(_0xcb5a('0x6'));var Mustache=require('mustache');var util=require(_0xcb5a('0x7'));var path=require(_0xcb5a('0x8'));var sox=require(_0xcb5a('0x9'));var csv=require(_0xcb5a('0xa'));var ejs=require(_0xcb5a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb5a('0xc'));var squel=require(_0xcb5a('0xd'));var crypto=require('crypto');var jsforce=require(_0xcb5a('0xe'));var deskjs=require(_0xcb5a('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcb5a('0x10'));var Redis=require(_0xcb5a('0x11'));var authService=require(_0xcb5a('0x12'));var qs=require(_0xcb5a('0x13'));var as=require(_0xcb5a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb5a('0x15'))(_0xcb5a('0x16'));var utils=require(_0xcb5a('0x17'));var config=require(_0xcb5a('0x18'));var licenseUtil=require(_0xcb5a('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4494e0,_0x539cf7){_0x539cf7=_0x539cf7||0xcc;return function(_0x290643){if(_0x290643){return _0x4494e0[_0xcb5a('0x1a')](_0x539cf7);}return _0x4494e0[_0xcb5a('0x1b')](_0x539cf7)['end']();};}function respondWithResult(_0x5ca4d1,_0x51f797){_0x51f797=_0x51f797||0xc8;return function(_0x259d60){if(_0x259d60){return _0x5ca4d1[_0xcb5a('0x1b')](_0x51f797)[_0xcb5a('0x1c')](_0x259d60);}};}function respondWithFilteredResult(_0xb02a14,_0x13fabc){return function(_0x29675c){if(_0x29675c){var _0x680b13=typeof _0x13fabc[_0xcb5a('0x1d')]==='undefined'&&typeof _0x13fabc[_0xcb5a('0x1e')]===_0xcb5a('0x1f');var _0x5e0d41=_0x29675c[_0xcb5a('0x20')];var _0x55e8d8=_0x680b13?0x0:_0x13fabc[_0xcb5a('0x1d')];var _0x559a6d=_0x680b13?_0x29675c['count']:_0x13fabc[_0xcb5a('0x1d')]+_0x13fabc[_0xcb5a('0x1e')];var _0x18684e;if(_0x559a6d>=_0x5e0d41){_0x559a6d=_0x5e0d41;_0x18684e=0xc8;}else{_0x18684e=0xce;}_0xb02a14[_0xcb5a('0x1b')](_0x18684e);return _0xb02a14['set'](_0xcb5a('0x21'),_0x55e8d8+'-'+_0x559a6d+'/'+_0x5e0d41)[_0xcb5a('0x1c')](_0x29675c);}return null;};}function patchUpdates(_0x4f892d){return function(_0xe85a3c){try{jsonpatch['apply'](_0xe85a3c,_0x4f892d,!![]);}catch(_0x31528c){return BPromise[_0xcb5a('0x22')](_0x31528c);}return _0xe85a3c[_0xcb5a('0x23')]();};}function saveUpdates(_0x52edce,_0x4a0ed9){return function(_0x1a18c9){if(_0x1a18c9){return _0x1a18c9['update'](_0x52edce)['then'](function(_0xeabe8b){return _0xeabe8b;});}return null;};}function removeEntity(_0x32f2f2,_0x582fe5){return function(_0x363ac3){if(_0x363ac3){return _0x363ac3[_0xcb5a('0x24')]()[_0xcb5a('0x25')](function(){_0x32f2f2[_0xcb5a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x148da6,_0x58576d){return function(_0x13b0c1){if(!_0x13b0c1){_0x148da6['sendStatus'](0x194);}return _0x13b0c1;};}function handleError(_0x2be99f,_0x218f47){_0x218f47=_0x218f47||0x1f4;return function(_0xb1aa70){logger[_0xcb5a('0x26')](_0xb1aa70[_0xcb5a('0x27')]);if(_0xb1aa70[_0xcb5a('0x28')]){delete _0xb1aa70[_0xcb5a('0x28')];}_0x2be99f[_0xcb5a('0x1b')](_0x218f47)[_0xcb5a('0x29')](_0xb1aa70);};}exports[_0xcb5a('0x2a')]=function(_0x48d956,_0x1579e7){var _0x54baa1={},_0x274d64={},_0x55638a={'count':0x0,'rows':[]};var _0x12d10e=_['map'](db[_0xcb5a('0x2b')][_0xcb5a('0x2c')],function(_0x4457b5){return{'name':_0x4457b5['fieldName'],'type':_0x4457b5[_0xcb5a('0x2d')][_0xcb5a('0x2e')]};});_0x274d64[_0xcb5a('0x2f')]=_[_0xcb5a('0x30')](_0x12d10e,_0xcb5a('0x28'));_0x274d64[_0xcb5a('0x31')]=_[_0xcb5a('0x32')](_0x48d956[_0xcb5a('0x31')]);_0x274d64[_0xcb5a('0x33')]=_[_0xcb5a('0x34')](_0x274d64[_0xcb5a('0x2f')],_0x274d64['query']);_0x54baa1[_0xcb5a('0x35')]=_[_0xcb5a('0x34')](_0x274d64[_0xcb5a('0x2f')],qs[_0xcb5a('0x36')](_0x48d956[_0xcb5a('0x31')]['fields']));_0x54baa1[_0xcb5a('0x35')]=_0x54baa1[_0xcb5a('0x35')]['length']?_0x54baa1['attributes']:_0x274d64[_0xcb5a('0x2f')];if(!_0x48d956[_0xcb5a('0x31')]['hasOwnProperty'](_0xcb5a('0x37'))){_0x54baa1['limit']=qs['limit'](_0x48d956[_0xcb5a('0x31')][_0xcb5a('0x1e')]);_0x54baa1[_0xcb5a('0x1d')]=qs[_0xcb5a('0x1d')](_0x48d956[_0xcb5a('0x31')][_0xcb5a('0x1d')]);}_0x54baa1[_0xcb5a('0x38')]=qs[_0xcb5a('0x39')](_0x48d956[_0xcb5a('0x31')][_0xcb5a('0x39')]);_0x54baa1[_0xcb5a('0x3a')]=qs[_0xcb5a('0x33')](_[_0xcb5a('0x3b')](_0x48d956[_0xcb5a('0x31')],_0x274d64['filters']),_0x12d10e);if(_0x48d956[_0xcb5a('0x31')][_0xcb5a('0x3c')]){_0x54baa1[_0xcb5a('0x3a')]=_[_0xcb5a('0x3d')](_0x54baa1[_0xcb5a('0x3a')],{'$or':_[_0xcb5a('0x30')](_0x12d10e,function(_0x2cc9da){if(_0x2cc9da[_0xcb5a('0x2d')]!==_0xcb5a('0x3e')){var _0x1eecd8={};_0x1eecd8[_0x2cc9da[_0xcb5a('0x28')]]={'$like':'%'+_0x48d956[_0xcb5a('0x31')][_0xcb5a('0x3c')]+'%'};return _0x1eecd8;}})});}_0x54baa1=_[_0xcb5a('0x3d')]({},_0x54baa1,_0x48d956[_0xcb5a('0x3f')]);var _0x310f7d={'where':_0x54baa1['where']};return db[_0xcb5a('0x2b')][_0xcb5a('0x20')](_0x310f7d)['then'](function(_0x5c3f04){_0x55638a[_0xcb5a('0x20')]=_0x5c3f04;if(_0x48d956[_0xcb5a('0x31')][_0xcb5a('0x40')]){_0x54baa1['include']=[{'all':!![]}];}return db[_0xcb5a('0x2b')][_0xcb5a('0x41')](_0x54baa1);})[_0xcb5a('0x25')](function(_0x438ad0){_0x55638a[_0xcb5a('0x42')]=_0x438ad0;return _0x55638a;})['then'](respondWithFilteredResult(_0x1579e7,_0x54baa1))[_0xcb5a('0x43')](handleError(_0x1579e7,null));};exports[_0xcb5a('0x44')]=function(_0x15490c,_0x3d6ed1){var _0x48353f={'raw':![],'where':{'id':_0x15490c[_0xcb5a('0x45')]['id']}},_0x5223e0={};_0x5223e0[_0xcb5a('0x2f')]=_['keys'](db[_0xcb5a('0x2b')]['rawAttributes']);_0x5223e0[_0xcb5a('0x31')]=_[_0xcb5a('0x32')](_0x15490c[_0xcb5a('0x31')]);_0x5223e0[_0xcb5a('0x33')]=_[_0xcb5a('0x34')](_0x5223e0[_0xcb5a('0x2f')],_0x5223e0[_0xcb5a('0x31')]);_0x48353f['attributes']=_[_0xcb5a('0x34')](_0x5223e0[_0xcb5a('0x2f')],qs[_0xcb5a('0x36')](_0x15490c[_0xcb5a('0x31')][_0xcb5a('0x36')]));_0x48353f[_0xcb5a('0x35')]=_0x48353f['attributes']['length']?_0x48353f[_0xcb5a('0x35')]:_0x5223e0[_0xcb5a('0x2f')];if(_0x15490c[_0xcb5a('0x31')]['includeAll']){_0x48353f[_0xcb5a('0x46')]=[{'all':!![]}];}_0x48353f=_['merge']({},_0x48353f,_0x15490c[_0xcb5a('0x3f')]);return db[_0xcb5a('0x2b')][_0xcb5a('0x47')](_0x48353f)[_0xcb5a('0x25')](handleEntityNotFound(_0x3d6ed1,null))['then'](respondWithResult(_0x3d6ed1,null))[_0xcb5a('0x43')](handleError(_0x3d6ed1,null));};exports['create']=function(_0x272caf,_0x3909e9){return db[_0xcb5a('0x2b')][_0xcb5a('0x48')](_0x272caf[_0xcb5a('0x49')],{})[_0xcb5a('0x25')](respondWithResult(_0x3909e9,0xc9))[_0xcb5a('0x43')](handleError(_0x3909e9,null));};exports[_0xcb5a('0x4a')]=function(_0x541cf5,_0x53cd7c){if(_0x541cf5[_0xcb5a('0x49')]['id']){delete _0x541cf5['body']['id'];}return db[_0xcb5a('0x2b')]['find']({'where':{'id':_0x541cf5[_0xcb5a('0x45')]['id']}})[_0xcb5a('0x25')](handleEntityNotFound(_0x53cd7c,null))['then'](saveUpdates(_0x541cf5[_0xcb5a('0x49')],null))[_0xcb5a('0x25')](respondWithResult(_0x53cd7c,null))[_0xcb5a('0x43')](handleError(_0x53cd7c,null));};exports[_0xcb5a('0x24')]=function(_0x1714b5,_0x76ccb){return db[_0xcb5a('0x2b')][_0xcb5a('0x47')]({'where':{'id':_0x1714b5[_0xcb5a('0x45')]['id']}})[_0xcb5a('0x25')](handleEntityNotFound(_0x76ccb,null))[_0xcb5a('0x25')](removeEntity(_0x76ccb,null))['catch'](handleError(_0x76ccb,null));};exports[_0xcb5a('0x4b')]=function(_0xd841bd,_0x4f31c9,_0x1ce9f1){var _0x164f5e={};var _0x416dcf={};var _0x18d485;var _0x4696bc;return db[_0xcb5a('0x2b')][_0xcb5a('0x4c')]({'where':{'id':_0xd841bd[_0xcb5a('0x45')]['id']}})['then'](handleEntityNotFound(_0x4f31c9,null))[_0xcb5a('0x25')](function(_0x2d90fb){if(_0x2d90fb){_0x18d485=_0x2d90fb;_0x416dcf[_0xcb5a('0x2f')]=_[_0xcb5a('0x32')](db[_0xcb5a('0x4d')][_0xcb5a('0x2c')]);_0x416dcf['query']=_[_0xcb5a('0x32')](_0xd841bd[_0xcb5a('0x31')]);_0x416dcf[_0xcb5a('0x33')]=_['intersection'](_0x416dcf[_0xcb5a('0x2f')],_0x416dcf[_0xcb5a('0x31')]);_0x164f5e[_0xcb5a('0x35')]=_['intersection'](_0x416dcf[_0xcb5a('0x2f')],qs[_0xcb5a('0x36')](_0xd841bd[_0xcb5a('0x31')]['fields']));_0x164f5e['attributes']=_0x164f5e[_0xcb5a('0x35')][_0xcb5a('0x4e')]?_0x164f5e[_0xcb5a('0x35')]:_0x416dcf[_0xcb5a('0x2f')];_0x164f5e[_0xcb5a('0x38')]=qs[_0xcb5a('0x39')](_0xd841bd[_0xcb5a('0x31')][_0xcb5a('0x39')]);_0x164f5e[_0xcb5a('0x3a')]=qs['filters'](_[_0xcb5a('0x3b')](_0xd841bd[_0xcb5a('0x31')],_0x416dcf['filters']));if(_0xd841bd[_0xcb5a('0x31')][_0xcb5a('0x3c')]){_0x164f5e['where']=_[_0xcb5a('0x3d')](_0x164f5e['where'],{'$or':_[_0xcb5a('0x30')](_0x164f5e[_0xcb5a('0x35')],function(_0x767315){var _0x5c5315={};_0x5c5315[_0x767315]={'$like':'%'+_0xd841bd[_0xcb5a('0x31')]['filter']+'%'};return _0x5c5315;})});}_0x164f5e=_[_0xcb5a('0x3d')]({},_0x164f5e,_0xd841bd[_0xcb5a('0x3f')]);return _0x18d485[_0xcb5a('0x4b')](_0x164f5e);}})['then'](function(_0x31ada3){if(_0x31ada3){_0x4696bc=_0x31ada3[_0xcb5a('0x4e')];if(!_0xd841bd[_0xcb5a('0x31')][_0xcb5a('0x4f')](_0xcb5a('0x37'))){_0x164f5e[_0xcb5a('0x1e')]=qs[_0xcb5a('0x1e')](_0xd841bd[_0xcb5a('0x31')][_0xcb5a('0x1e')]);_0x164f5e[_0xcb5a('0x1d')]=qs[_0xcb5a('0x1d')](_0xd841bd[_0xcb5a('0x31')]['offset']);}return _0x18d485[_0xcb5a('0x4b')](_0x164f5e);}})[_0xcb5a('0x25')](function(_0x1f627b){if(_0x1f627b){return _0x1f627b?{'count':_0x4696bc,'rows':_0x1f627b}:null;}})[_0xcb5a('0x25')](respondWithResult(_0x4f31c9,null))[_0xcb5a('0x43')](handleError(_0x4f31c9,null));};exports[_0xcb5a('0x50')]=function(_0x5e7c0e,_0x479300,_0x1e001c){var _0x2848aa={};var _0x229fa0={};var _0x5532c4;var _0x35d0cb;return db['ServicenowConfiguration'][_0xcb5a('0x4c')]({'where':{'id':_0x5e7c0e['params']['id']}})[_0xcb5a('0x25')](handleEntityNotFound(_0x479300,null))[_0xcb5a('0x25')](function(_0x4e085a){if(_0x4e085a){_0x5532c4=_0x4e085a;_0x229fa0[_0xcb5a('0x2f')]=_[_0xcb5a('0x32')](db[_0xcb5a('0x4d')][_0xcb5a('0x2c')]);_0x229fa0[_0xcb5a('0x31')]=_[_0xcb5a('0x32')](_0x5e7c0e[_0xcb5a('0x31')]);_0x229fa0[_0xcb5a('0x33')]=_[_0xcb5a('0x34')](_0x229fa0[_0xcb5a('0x2f')],_0x229fa0['query']);_0x2848aa[_0xcb5a('0x35')]=_[_0xcb5a('0x34')](_0x229fa0[_0xcb5a('0x2f')],qs[_0xcb5a('0x36')](_0x5e7c0e[_0xcb5a('0x31')][_0xcb5a('0x36')]));_0x2848aa['attributes']=_0x2848aa[_0xcb5a('0x35')][_0xcb5a('0x4e')]?_0x2848aa[_0xcb5a('0x35')]:_0x229fa0[_0xcb5a('0x2f')];_0x2848aa[_0xcb5a('0x38')]=qs['sort'](_0x5e7c0e['query'][_0xcb5a('0x39')]);_0x2848aa['where']=qs[_0xcb5a('0x33')](_[_0xcb5a('0x3b')](_0x5e7c0e[_0xcb5a('0x31')],_0x229fa0[_0xcb5a('0x33')]));if(_0x5e7c0e[_0xcb5a('0x31')][_0xcb5a('0x3c')]){_0x2848aa[_0xcb5a('0x3a')]=_[_0xcb5a('0x3d')](_0x2848aa[_0xcb5a('0x3a')],{'$or':_[_0xcb5a('0x30')](_0x2848aa['attributes'],function(_0x379a48){var _0x5e705f={};_0x5e705f[_0x379a48]={'$like':'%'+_0x5e7c0e[_0xcb5a('0x31')][_0xcb5a('0x3c')]+'%'};return _0x5e705f;})});}_0x2848aa=_[_0xcb5a('0x3d')]({},_0x2848aa,_0x5e7c0e[_0xcb5a('0x3f')]);return _0x5532c4[_0xcb5a('0x50')](_0x2848aa);}})[_0xcb5a('0x25')](function(_0x47b37e){if(_0x47b37e){_0x35d0cb=_0x47b37e[_0xcb5a('0x4e')];if(!_0x5e7c0e[_0xcb5a('0x31')][_0xcb5a('0x4f')](_0xcb5a('0x37'))){_0x2848aa[_0xcb5a('0x1e')]=qs[_0xcb5a('0x1e')](_0x5e7c0e[_0xcb5a('0x31')]['limit']);_0x2848aa[_0xcb5a('0x1d')]=qs[_0xcb5a('0x1d')](_0x5e7c0e[_0xcb5a('0x31')][_0xcb5a('0x1d')]);}return _0x5532c4[_0xcb5a('0x50')](_0x2848aa);}})[_0xcb5a('0x25')](function(_0x43b2b0){if(_0x43b2b0){return _0x43b2b0?{'count':_0x35d0cb,'rows':_0x43b2b0}:null;}})[_0xcb5a('0x25')](respondWithResult(_0x479300,null))[_0xcb5a('0x43')](handleError(_0x479300,null));};exports[_0xcb5a('0x51')]=function(_0xb26226,_0x406f94,_0xf03c5d){var _0x358bf={};var _0x114620={};var _0x2c1fb3;var _0x3f8990;return db[_0xcb5a('0x2b')][_0xcb5a('0x4c')]({'where':{'id':_0xb26226[_0xcb5a('0x45')]['id']}})[_0xcb5a('0x25')](handleEntityNotFound(_0x406f94,null))['then'](function(_0x19d703){if(_0x19d703){_0x2c1fb3=_0x19d703;_0x114620[_0xcb5a('0x2f')]=_[_0xcb5a('0x32')](db[_0xcb5a('0x4d')][_0xcb5a('0x2c')]);_0x114620[_0xcb5a('0x31')]=_['keys'](_0xb26226['query']);_0x114620[_0xcb5a('0x33')]=_['intersection'](_0x114620[_0xcb5a('0x2f')],_0x114620[_0xcb5a('0x31')]);_0x358bf['attributes']=_[_0xcb5a('0x34')](_0x114620[_0xcb5a('0x2f')],qs[_0xcb5a('0x36')](_0xb26226[_0xcb5a('0x31')][_0xcb5a('0x36')]));_0x358bf['attributes']=_0x358bf[_0xcb5a('0x35')][_0xcb5a('0x4e')]?_0x358bf['attributes']:_0x114620[_0xcb5a('0x2f')];_0x358bf[_0xcb5a('0x38')]=qs[_0xcb5a('0x39')](_0xb26226['query']['sort']);_0x358bf[_0xcb5a('0x3a')]=qs['filters'](_[_0xcb5a('0x3b')](_0xb26226[_0xcb5a('0x31')],_0x114620[_0xcb5a('0x33')]));if(_0xb26226['query'][_0xcb5a('0x3c')]){_0x358bf[_0xcb5a('0x3a')]=_[_0xcb5a('0x3d')](_0x358bf[_0xcb5a('0x3a')],{'$or':_[_0xcb5a('0x30')](_0x358bf[_0xcb5a('0x35')],function(_0x47ab16){var _0x4690ef={};_0x4690ef[_0x47ab16]={'$like':'%'+_0xb26226[_0xcb5a('0x31')][_0xcb5a('0x3c')]+'%'};return _0x4690ef;})});}_0x358bf=_[_0xcb5a('0x3d')]({},_0x358bf,_0xb26226['options']);return _0x2c1fb3['getDescriptions'](_0x358bf);}})[_0xcb5a('0x25')](function(_0x125478){if(_0x125478){_0x3f8990=_0x125478['length'];if(!_0xb26226[_0xcb5a('0x31')][_0xcb5a('0x4f')]('nolimit')){_0x358bf[_0xcb5a('0x1e')]=qs[_0xcb5a('0x1e')](_0xb26226['query'][_0xcb5a('0x1e')]);_0x358bf[_0xcb5a('0x1d')]=qs[_0xcb5a('0x1d')](_0xb26226[_0xcb5a('0x31')][_0xcb5a('0x1d')]);}return _0x2c1fb3[_0xcb5a('0x51')](_0x358bf);}})[_0xcb5a('0x25')](function(_0xdafb79){if(_0xdafb79){return _0xdafb79?{'count':_0x3f8990,'rows':_0xdafb79}:null;}})[_0xcb5a('0x25')](respondWithResult(_0x406f94,null))['catch'](handleError(_0x406f94,null));}; \ No newline at end of file +var _0xa5ad=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','index','ServicenowConfiguration','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','create','body','getFields','findOne','ServicenowField','rawAttributes','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xa5ad,0x1d4));var _0xda5a=function(_0x3a2acb,_0x1eb52d){_0x3a2acb=_0x3a2acb-0x0;var _0x5674ec=_0xa5ad[_0x3a2acb];return _0x5674ec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda5a('0x0'));var zipdir=require(_0xda5a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda5a('0x2'));var moment=require(_0xda5a('0x3'));var BPromise=require(_0xda5a('0x4'));var Mustache=require(_0xda5a('0x5'));var util=require(_0xda5a('0x6'));var path=require(_0xda5a('0x7'));var sox=require(_0xda5a('0x8'));var csv=require(_0xda5a('0x9'));var ejs=require(_0xda5a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xda5a('0xb'));var squel=require(_0xda5a('0xc'));var crypto=require(_0xda5a('0xd'));var jsforce=require(_0xda5a('0xe'));var deskjs=require(_0xda5a('0xf'));var toCsv=require(_0xda5a('0x9'));var querystring=require('querystring');var Papa=require(_0xda5a('0x10'));var Redis=require(_0xda5a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xda5a('0x12'));var as=require(_0xda5a('0x13'));var hardwareService=require(_0xda5a('0x14'));var logger=require(_0xda5a('0x15'))('api');var utils=require(_0xda5a('0x16'));var config=require(_0xda5a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xda5a('0x18'))['db'];function respondWithStatusCode(_0x32bf3e,_0x206762){_0x206762=_0x206762||0xcc;return function(_0x335838){if(_0x335838){return _0x32bf3e[_0xda5a('0x19')](_0x206762);}return _0x32bf3e[_0xda5a('0x1a')](_0x206762)[_0xda5a('0x1b')]();};}function respondWithResult(_0x5bac59,_0x216527){_0x216527=_0x216527||0xc8;return function(_0x55095d){if(_0x55095d){return _0x5bac59['status'](_0x216527)[_0xda5a('0x1c')](_0x55095d);}};}function respondWithFilteredResult(_0x153510,_0x4fc3){return function(_0x26b24e){if(_0x26b24e){var _0x1536c4=typeof _0x4fc3['offset']==='undefined'&&typeof _0x4fc3[_0xda5a('0x1d')]===_0xda5a('0x1e');var _0x5be138=_0x26b24e[_0xda5a('0x1f')];var _0x4ff849=_0x1536c4?0x0:_0x4fc3[_0xda5a('0x20')];var _0x31caad=_0x1536c4?_0x26b24e[_0xda5a('0x1f')]:_0x4fc3['offset']+_0x4fc3['limit'];var _0x443866;if(_0x31caad>=_0x5be138){_0x31caad=_0x5be138;_0x443866=0xc8;}else{_0x443866=0xce;}_0x153510[_0xda5a('0x1a')](_0x443866);return _0x153510['set']('Content-Range',_0x4ff849+'-'+_0x31caad+'/'+_0x5be138)[_0xda5a('0x1c')](_0x26b24e);}return null;};}function patchUpdates(_0x5e29f9){return function(_0x4f018e){try{jsonpatch[_0xda5a('0x21')](_0x4f018e,_0x5e29f9,!![]);}catch(_0x885c89){return BPromise[_0xda5a('0x22')](_0x885c89);}return _0x4f018e[_0xda5a('0x23')]();};}function saveUpdates(_0x180de1,_0x3d0fd3){return function(_0x3a7fd8){if(_0x3a7fd8){return _0x3a7fd8[_0xda5a('0x24')](_0x180de1)[_0xda5a('0x25')](function(_0x1af9f4){return _0x1af9f4;});}return null;};}function removeEntity(_0x28294a,_0x447abb){return function(_0x413f70){if(_0x413f70){return _0x413f70[_0xda5a('0x26')]()[_0xda5a('0x25')](function(){_0x28294a['status'](0xcc)[_0xda5a('0x1b')]();});}};}function handleEntityNotFound(_0x5aef34,_0x29b0b3){return function(_0x41663a){if(!_0x41663a){_0x5aef34[_0xda5a('0x19')](0x194);}return _0x41663a;};}function handleError(_0x1081c0,_0xf74644){_0xf74644=_0xf74644||0x1f4;return function(_0x543187){logger[_0xda5a('0x27')](_0x543187[_0xda5a('0x28')]);if(_0x543187[_0xda5a('0x29')]){delete _0x543187[_0xda5a('0x29')];}_0x1081c0['status'](_0xf74644)[_0xda5a('0x2a')](_0x543187);};}exports[_0xda5a('0x2b')]=function(_0x1ca97b,_0x487471){var _0x16447c={},_0xf1c3ae={},_0x146bad={'count':0x0,'rows':[]};var _0x500980=_['map'](db[_0xda5a('0x2c')]['rawAttributes'],function(_0x5af293){return{'name':_0x5af293[_0xda5a('0x2d')],'type':_0x5af293[_0xda5a('0x2e')]['key']};});_0xf1c3ae[_0xda5a('0x2f')]=_[_0xda5a('0x30')](_0x500980,'name');_0xf1c3ae[_0xda5a('0x31')]=_[_0xda5a('0x32')](_0x1ca97b['query']);_0xf1c3ae[_0xda5a('0x33')]=_[_0xda5a('0x34')](_0xf1c3ae[_0xda5a('0x2f')],_0xf1c3ae[_0xda5a('0x31')]);_0x16447c['attributes']=_['intersection'](_0xf1c3ae['model'],qs[_0xda5a('0x35')](_0x1ca97b[_0xda5a('0x31')][_0xda5a('0x35')]));_0x16447c[_0xda5a('0x36')]=_0x16447c['attributes']['length']?_0x16447c[_0xda5a('0x36')]:_0xf1c3ae['model'];if(!_0x1ca97b[_0xda5a('0x31')]['hasOwnProperty'](_0xda5a('0x37'))){_0x16447c['limit']=qs['limit'](_0x1ca97b[_0xda5a('0x31')][_0xda5a('0x1d')]);_0x16447c[_0xda5a('0x20')]=qs[_0xda5a('0x20')](_0x1ca97b[_0xda5a('0x31')][_0xda5a('0x20')]);}_0x16447c[_0xda5a('0x38')]=qs[_0xda5a('0x39')](_0x1ca97b['query']['sort']);_0x16447c['where']=qs[_0xda5a('0x33')](_[_0xda5a('0x3a')](_0x1ca97b['query'],_0xf1c3ae[_0xda5a('0x33')]),_0x500980);if(_0x1ca97b[_0xda5a('0x31')][_0xda5a('0x3b')]){_0x16447c[_0xda5a('0x3c')]=_[_0xda5a('0x3d')](_0x16447c[_0xda5a('0x3c')],{'$or':_[_0xda5a('0x30')](_0x500980,function(_0x12fd94){if(_0x12fd94[_0xda5a('0x2e')]!==_0xda5a('0x3e')){var _0x2ab512={};_0x2ab512[_0x12fd94['name']]={'$like':'%'+_0x1ca97b['query']['filter']+'%'};return _0x2ab512;}})});}_0x16447c=_[_0xda5a('0x3d')]({},_0x16447c,_0x1ca97b[_0xda5a('0x3f')]);var _0x88a0f8={'where':_0x16447c['where']};return db[_0xda5a('0x2c')][_0xda5a('0x1f')](_0x88a0f8)[_0xda5a('0x25')](function(_0x327ff2){_0x146bad[_0xda5a('0x1f')]=_0x327ff2;if(_0x1ca97b['query']['includeAll']){_0x16447c[_0xda5a('0x40')]=[{'all':!![]}];}return db[_0xda5a('0x2c')][_0xda5a('0x41')](_0x16447c);})[_0xda5a('0x25')](function(_0xb779d4){_0x146bad[_0xda5a('0x42')]=_0xb779d4;return _0x146bad;})[_0xda5a('0x25')](respondWithFilteredResult(_0x487471,_0x16447c))[_0xda5a('0x43')](handleError(_0x487471,null));};exports[_0xda5a('0x44')]=function(_0x4b584b,_0x4c84d4){var _0x3f563e={'raw':![],'where':{'id':_0x4b584b[_0xda5a('0x45')]['id']}},_0x1b2a2a={};_0x1b2a2a[_0xda5a('0x2f')]=_[_0xda5a('0x32')](db['ServicenowConfiguration']['rawAttributes']);_0x1b2a2a[_0xda5a('0x31')]=_[_0xda5a('0x32')](_0x4b584b[_0xda5a('0x31')]);_0x1b2a2a['filters']=_['intersection'](_0x1b2a2a[_0xda5a('0x2f')],_0x1b2a2a[_0xda5a('0x31')]);_0x3f563e[_0xda5a('0x36')]=_[_0xda5a('0x34')](_0x1b2a2a['model'],qs[_0xda5a('0x35')](_0x4b584b['query'][_0xda5a('0x35')]));_0x3f563e['attributes']=_0x3f563e[_0xda5a('0x36')][_0xda5a('0x46')]?_0x3f563e['attributes']:_0x1b2a2a['model'];if(_0x4b584b[_0xda5a('0x31')]['includeAll']){_0x3f563e['include']=[{'all':!![]}];}_0x3f563e=_[_0xda5a('0x3d')]({},_0x3f563e,_0x4b584b[_0xda5a('0x3f')]);return db[_0xda5a('0x2c')][_0xda5a('0x47')](_0x3f563e)['then'](handleEntityNotFound(_0x4c84d4,null))[_0xda5a('0x25')](respondWithResult(_0x4c84d4,null))[_0xda5a('0x43')](handleError(_0x4c84d4,null));};exports[_0xda5a('0x48')]=function(_0x17dc04,_0x556b0b){return db[_0xda5a('0x2c')][_0xda5a('0x48')](_0x17dc04[_0xda5a('0x49')],{})[_0xda5a('0x25')](respondWithResult(_0x556b0b,0xc9))[_0xda5a('0x43')](handleError(_0x556b0b,null));};exports['update']=function(_0x4c8741,_0x24f27d){if(_0x4c8741[_0xda5a('0x49')]['id']){delete _0x4c8741[_0xda5a('0x49')]['id'];}return db[_0xda5a('0x2c')][_0xda5a('0x47')]({'where':{'id':_0x4c8741[_0xda5a('0x45')]['id']}})[_0xda5a('0x25')](handleEntityNotFound(_0x24f27d,null))[_0xda5a('0x25')](saveUpdates(_0x4c8741[_0xda5a('0x49')],null))[_0xda5a('0x25')](respondWithResult(_0x24f27d,null))[_0xda5a('0x43')](handleError(_0x24f27d,null));};exports[_0xda5a('0x26')]=function(_0x2221a8,_0x108bba){return db[_0xda5a('0x2c')][_0xda5a('0x47')]({'where':{'id':_0x2221a8[_0xda5a('0x45')]['id']}})[_0xda5a('0x25')](handleEntityNotFound(_0x108bba,null))['then'](removeEntity(_0x108bba,null))[_0xda5a('0x43')](handleError(_0x108bba,null));};exports[_0xda5a('0x4a')]=function(_0x274689,_0x15a320,_0x2adeb7){var _0x26d3da={};var _0xc170be={};var _0x5e1252;var _0x1b493f;return db[_0xda5a('0x2c')][_0xda5a('0x4b')]({'where':{'id':_0x274689[_0xda5a('0x45')]['id']}})[_0xda5a('0x25')](handleEntityNotFound(_0x15a320,null))['then'](function(_0x10a34e){if(_0x10a34e){_0x5e1252=_0x10a34e;_0xc170be[_0xda5a('0x2f')]=_[_0xda5a('0x32')](db[_0xda5a('0x4c')][_0xda5a('0x4d')]);_0xc170be[_0xda5a('0x31')]=_[_0xda5a('0x32')](_0x274689[_0xda5a('0x31')]);_0xc170be[_0xda5a('0x33')]=_[_0xda5a('0x34')](_0xc170be[_0xda5a('0x2f')],_0xc170be[_0xda5a('0x31')]);_0x26d3da[_0xda5a('0x36')]=_[_0xda5a('0x34')](_0xc170be[_0xda5a('0x2f')],qs[_0xda5a('0x35')](_0x274689[_0xda5a('0x31')]['fields']));_0x26d3da[_0xda5a('0x36')]=_0x26d3da[_0xda5a('0x36')][_0xda5a('0x46')]?_0x26d3da[_0xda5a('0x36')]:_0xc170be[_0xda5a('0x2f')];_0x26d3da[_0xda5a('0x38')]=qs['sort'](_0x274689['query'][_0xda5a('0x39')]);_0x26d3da['where']=qs['filters'](_[_0xda5a('0x3a')](_0x274689[_0xda5a('0x31')],_0xc170be[_0xda5a('0x33')]));if(_0x274689[_0xda5a('0x31')]['filter']){_0x26d3da['where']=_[_0xda5a('0x3d')](_0x26d3da[_0xda5a('0x3c')],{'$or':_[_0xda5a('0x30')](_0x26d3da[_0xda5a('0x36')],function(_0x571069){var _0x25e552={};_0x25e552[_0x571069]={'$like':'%'+_0x274689[_0xda5a('0x31')]['filter']+'%'};return _0x25e552;})});}_0x26d3da=_['merge']({},_0x26d3da,_0x274689[_0xda5a('0x3f')]);return _0x5e1252[_0xda5a('0x4a')](_0x26d3da);}})[_0xda5a('0x25')](function(_0x13fb03){if(_0x13fb03){_0x1b493f=_0x13fb03[_0xda5a('0x46')];if(!_0x274689[_0xda5a('0x31')][_0xda5a('0x4e')](_0xda5a('0x37'))){_0x26d3da[_0xda5a('0x1d')]=qs[_0xda5a('0x1d')](_0x274689['query'][_0xda5a('0x1d')]);_0x26d3da[_0xda5a('0x20')]=qs[_0xda5a('0x20')](_0x274689[_0xda5a('0x31')][_0xda5a('0x20')]);}return _0x5e1252[_0xda5a('0x4a')](_0x26d3da);}})[_0xda5a('0x25')](function(_0x568318){if(_0x568318){return _0x568318?{'count':_0x1b493f,'rows':_0x568318}:null;}})['then'](respondWithResult(_0x15a320,null))[_0xda5a('0x43')](handleError(_0x15a320,null));};exports['getSubjects']=function(_0x1974bd,_0x34fee1,_0x2f57c5){var _0x2d0872={};var _0x1f4df2={};var _0x4b35f2;var _0x199ddb;return db[_0xda5a('0x2c')][_0xda5a('0x4b')]({'where':{'id':_0x1974bd['params']['id']}})[_0xda5a('0x25')](handleEntityNotFound(_0x34fee1,null))[_0xda5a('0x25')](function(_0x22a665){if(_0x22a665){_0x4b35f2=_0x22a665;_0x1f4df2[_0xda5a('0x2f')]=_['keys'](db[_0xda5a('0x4c')][_0xda5a('0x4d')]);_0x1f4df2[_0xda5a('0x31')]=_['keys'](_0x1974bd['query']);_0x1f4df2['filters']=_[_0xda5a('0x34')](_0x1f4df2[_0xda5a('0x2f')],_0x1f4df2[_0xda5a('0x31')]);_0x2d0872[_0xda5a('0x36')]=_[_0xda5a('0x34')](_0x1f4df2[_0xda5a('0x2f')],qs['fields'](_0x1974bd['query'][_0xda5a('0x35')]));_0x2d0872['attributes']=_0x2d0872[_0xda5a('0x36')]['length']?_0x2d0872[_0xda5a('0x36')]:_0x1f4df2['model'];_0x2d0872['order']=qs[_0xda5a('0x39')](_0x1974bd[_0xda5a('0x31')][_0xda5a('0x39')]);_0x2d0872[_0xda5a('0x3c')]=qs[_0xda5a('0x33')](_['pick'](_0x1974bd['query'],_0x1f4df2[_0xda5a('0x33')]));if(_0x1974bd[_0xda5a('0x31')][_0xda5a('0x3b')]){_0x2d0872[_0xda5a('0x3c')]=_[_0xda5a('0x3d')](_0x2d0872[_0xda5a('0x3c')],{'$or':_['map'](_0x2d0872['attributes'],function(_0x1f3289){var _0x2d08fa={};_0x2d08fa[_0x1f3289]={'$like':'%'+_0x1974bd[_0xda5a('0x31')]['filter']+'%'};return _0x2d08fa;})});}_0x2d0872=_[_0xda5a('0x3d')]({},_0x2d0872,_0x1974bd[_0xda5a('0x3f')]);return _0x4b35f2[_0xda5a('0x4f')](_0x2d0872);}})[_0xda5a('0x25')](function(_0x29d8db){if(_0x29d8db){_0x199ddb=_0x29d8db[_0xda5a('0x46')];if(!_0x1974bd['query'][_0xda5a('0x4e')](_0xda5a('0x37'))){_0x2d0872[_0xda5a('0x1d')]=qs[_0xda5a('0x1d')](_0x1974bd['query']['limit']);_0x2d0872['offset']=qs[_0xda5a('0x20')](_0x1974bd['query']['offset']);}return _0x4b35f2[_0xda5a('0x4f')](_0x2d0872);}})[_0xda5a('0x25')](function(_0x932932){if(_0x932932){return _0x932932?{'count':_0x199ddb,'rows':_0x932932}:null;}})[_0xda5a('0x25')](respondWithResult(_0x34fee1,null))[_0xda5a('0x43')](handleError(_0x34fee1,null));};exports[_0xda5a('0x50')]=function(_0x5b31b6,_0x39260d,_0x2daacc){var _0x4f82d2={};var _0x3724db={};var _0x6c72f5;var _0x23467a;return db[_0xda5a('0x2c')][_0xda5a('0x4b')]({'where':{'id':_0x5b31b6[_0xda5a('0x45')]['id']}})[_0xda5a('0x25')](handleEntityNotFound(_0x39260d,null))[_0xda5a('0x25')](function(_0xc09f3e){if(_0xc09f3e){_0x6c72f5=_0xc09f3e;_0x3724db[_0xda5a('0x2f')]=_['keys'](db[_0xda5a('0x4c')][_0xda5a('0x4d')]);_0x3724db[_0xda5a('0x31')]=_[_0xda5a('0x32')](_0x5b31b6['query']);_0x3724db['filters']=_[_0xda5a('0x34')](_0x3724db[_0xda5a('0x2f')],_0x3724db[_0xda5a('0x31')]);_0x4f82d2[_0xda5a('0x36')]=_[_0xda5a('0x34')](_0x3724db[_0xda5a('0x2f')],qs[_0xda5a('0x35')](_0x5b31b6['query']['fields']));_0x4f82d2[_0xda5a('0x36')]=_0x4f82d2['attributes'][_0xda5a('0x46')]?_0x4f82d2[_0xda5a('0x36')]:_0x3724db[_0xda5a('0x2f')];_0x4f82d2[_0xda5a('0x38')]=qs[_0xda5a('0x39')](_0x5b31b6[_0xda5a('0x31')][_0xda5a('0x39')]);_0x4f82d2[_0xda5a('0x3c')]=qs[_0xda5a('0x33')](_['pick'](_0x5b31b6[_0xda5a('0x31')],_0x3724db[_0xda5a('0x33')]));if(_0x5b31b6[_0xda5a('0x31')]['filter']){_0x4f82d2[_0xda5a('0x3c')]=_[_0xda5a('0x3d')](_0x4f82d2[_0xda5a('0x3c')],{'$or':_[_0xda5a('0x30')](_0x4f82d2[_0xda5a('0x36')],function(_0x297743){var _0x4ded92={};_0x4ded92[_0x297743]={'$like':'%'+_0x5b31b6['query'][_0xda5a('0x3b')]+'%'};return _0x4ded92;})});}_0x4f82d2=_[_0xda5a('0x3d')]({},_0x4f82d2,_0x5b31b6[_0xda5a('0x3f')]);return _0x6c72f5[_0xda5a('0x50')](_0x4f82d2);}})[_0xda5a('0x25')](function(_0x4e31db){if(_0x4e31db){_0x23467a=_0x4e31db[_0xda5a('0x46')];if(!_0x5b31b6[_0xda5a('0x31')][_0xda5a('0x4e')](_0xda5a('0x37'))){_0x4f82d2[_0xda5a('0x1d')]=qs[_0xda5a('0x1d')](_0x5b31b6[_0xda5a('0x31')]['limit']);_0x4f82d2[_0xda5a('0x20')]=qs['offset'](_0x5b31b6['query'][_0xda5a('0x20')]);}return _0x6c72f5['getDescriptions'](_0x4f82d2);}})[_0xda5a('0x25')](function(_0x832b84){if(_0x832b84){return _0x832b84?{'count':_0x23467a,'rows':_0x832b84}:null;}})[_0xda5a('0x25')](respondWithResult(_0x39260d,null))[_0xda5a('0x43')](handleError(_0x39260d,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 1506f60..44cc653 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 _0x8580=['api','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','util'];(function(_0x8f890f,_0x4d3b1a){var _0x109dc2=function(_0x24f554){while(--_0x24f554){_0x8f890f['push'](_0x8f890f['shift']());}};_0x109dc2(++_0x4d3b1a);}(_0x8580,0x1c7));var _0x0858=function(_0x6de86f,_0x199614){_0x6de86f=_0x6de86f-0x0;var _0x111988=_0x8580[_0x6de86f];return _0x111988;};'use strict';var _=require('lodash');var util=require(_0x0858('0x0'));var logger=require('../../config/logger')(_0x0858('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0858('0x2'));var fs=require('fs');var path=require(_0x0858('0x3'));var rimraf=require('rimraf');var config=require(_0x0858('0x4'));var attributes=require(_0x0858('0x5'));module['exports']=function(_0x2b34e0,_0x8c913d){return _0x2b34e0[_0x0858('0x6')](_0x0858('0x7'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8769=['ServicenowConfiguration','int_servicenow_configurations','lodash','util','api','bluebird','request-promise','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x3124b1,_0x3cfb61){var _0x3a6652=function(_0x15e557){while(--_0x15e557){_0x3124b1['push'](_0x3124b1['shift']());}};_0x3a6652(++_0x3cfb61);}(_0x8769,0x110));var _0x9876=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x8769[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x9876('0x0'));var util=require(_0x9876('0x1'));var logger=require('../../config/logger')(_0x9876('0x2'));var moment=require('moment');var BPromise=require(_0x9876('0x3'));var rp=require(_0x9876('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9876('0x5'));var attributes=require(_0x9876('0x6'));module['exports']=function(_0x179357,_0x5a4149){return _0x179357['define'](_0x9876('0x7'),attributes,{'tableName':_0x9876('0x8'),'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 1a31f4b..da17fe3 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 _0x035d=['stringify','error','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x123bd3,_0x1c4bef){var _0x30ec9b=function(_0xaa025f){while(--_0xaa025f){_0x123bd3['push'](_0x123bd3['shift']());}};_0x30ec9b(++_0x1c4bef);}(_0x035d,0x15a));var _0xd035=function(_0x488fc6,_0x5b8ee9){_0x488fc6=_0x488fc6-0x0;var _0x2e6936=_0x035d[_0x488fc6];return _0x2e6936;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd035('0x0'));var rs=require(_0xd035('0x1'));var fs=require('fs');var Redis=require(_0xd035('0x2'));var db=require(_0xd035('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd035('0x4'))(_0xd035('0x5'));var config=require('../../config/environment');var jayson=require(_0xd035('0x6'));var client=jayson[_0xd035('0x7')][_0xd035('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc70a0,_0x3fe189,_0x27714c){return new BPromise(function(_0x17f875,_0x48587f){return client[_0xd035('0x9')](_0xc70a0,_0x27714c)[_0xd035('0xa')](function(_0x1e5bb5){logger['info'](_0xd035('0xb'),_0x3fe189,_0xd035('0xc'));logger[_0xd035('0xd')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x3fe189,_0xd035('0xc'),JSON[_0xd035('0xe')](_0x1e5bb5));if(_0x1e5bb5[_0xd035('0xf')]){if(_0x1e5bb5[_0xd035('0xf')]['code']===0x1f4){logger['error'](_0xd035('0xb'),_0x3fe189,_0x1e5bb5[_0xd035('0xf')]['message']);return _0x48587f(_0x1e5bb5[_0xd035('0xf')][_0xd035('0x10')]);}logger[_0xd035('0xf')](_0xd035('0xb'),_0x3fe189,_0x1e5bb5[_0xd035('0xf')][_0xd035('0x10')]);return _0x17f875(_0x1e5bb5[_0xd035('0xf')][_0xd035('0x10')]);}else{logger['info'](_0xd035('0xb'),_0x3fe189,_0xd035('0xc'));_0x17f875(_0x1e5bb5['result'][_0xd035('0x10')]);}})[_0xd035('0x11')](function(_0xa37249){logger['error'](_0xd035('0xb'),_0x3fe189,_0xa37249);_0x48587f(_0xa37249);});});} \ No newline at end of file +var _0xede0=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x495c13,_0x37c38b){var _0x26c4ca=function(_0x51f3bf){while(--_0x51f3bf){_0x495c13['push'](_0x495c13['shift']());}};_0x26c4ca(++_0x37c38b);}(_0xede0,0x1ca));var _0x0ede=function(_0x5ae2d2,_0x4c66d1){_0x5ae2d2=_0x5ae2d2-0x0;var _0x454fef=_0xede0[_0x5ae2d2];return _0x454fef;};'use strict';var _=require(_0x0ede('0x0'));var util=require(_0x0ede('0x1'));var moment=require(_0x0ede('0x2'));var BPromise=require(_0x0ede('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ede('0x4'));var db=require(_0x0ede('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ede('0x6'))(_0x0ede('0x7'));var config=require(_0x0ede('0x8'));var jayson=require(_0x0ede('0x9'));var client=jayson[_0x0ede('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e4943,_0x4871f3,_0x1d8fd6){return new BPromise(function(_0x12d1e5,_0x3ffe6a){return client[_0x0ede('0xb')](_0x5e4943,_0x1d8fd6)[_0x0ede('0xc')](function(_0x236234){logger[_0x0ede('0xd')](_0x0ede('0xe'),_0x4871f3,_0x0ede('0xf'));logger['debug'](_0x0ede('0x10'),_0x4871f3,_0x0ede('0xf'),JSON['stringify'](_0x236234));if(_0x236234[_0x0ede('0x11')]){if(_0x236234[_0x0ede('0x11')][_0x0ede('0x12')]===0x1f4){logger[_0x0ede('0x11')](_0x0ede('0xe'),_0x4871f3,_0x236234[_0x0ede('0x11')][_0x0ede('0x13')]);return _0x3ffe6a(_0x236234['error'][_0x0ede('0x13')]);}logger['error'](_0x0ede('0xe'),_0x4871f3,_0x236234[_0x0ede('0x11')][_0x0ede('0x13')]);return _0x12d1e5(_0x236234['error'][_0x0ede('0x13')]);}else{logger[_0x0ede('0xd')](_0x0ede('0xe'),_0x4871f3,_0x0ede('0xf'));_0x12d1e5(_0x236234[_0x0ede('0x14')]['message']);}})['catch'](function(_0x5eb6a9){logger[_0x0ede('0x11')](_0x0ede('0xe'),_0x4871f3,_0x5eb6a9);_0x3ffe6a(_0x5eb6a9);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index bf076a2..3541795 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 _0xbc7b=['delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./intServicenowField.controller','index','get','/:id','isAuthenticated','post','put','update'];(function(_0x3a8db5,_0x31cff7){var _0x2c03cd=function(_0x47dba0){while(--_0x47dba0){_0x3a8db5['push'](_0x3a8db5['shift']());}};_0x2c03cd(++_0x31cff7);}(_0xbc7b,0x145));var _0xbbc7=function(_0xe004,_0x5a858a){_0xe004=_0xe004-0x0;var _0x24bea=_0xbc7b[_0xe004];return _0x24bea;};'use strict';var multer=require(_0xbbc7('0x0'));var util=require(_0xbbc7('0x1'));var path=require(_0xbbc7('0x2'));var timeout=require('connect-timeout');var express=require(_0xbbc7('0x3'));var router=express[_0xbbc7('0x4')]();var fs_extra=require(_0xbbc7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbbc7('0x6'));var config=require('../../config/environment');var controller=require(_0xbbc7('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xbbc7('0x8')]);router[_0xbbc7('0x9')](_0xbbc7('0xa'),auth[_0xbbc7('0xb')](),controller['show']);router[_0xbbc7('0xc')]('/',auth[_0xbbc7('0xb')](),controller['create']);router[_0xbbc7('0xd')]('/:id',auth[_0xbbc7('0xb')](),controller[_0xbbc7('0xe')]);router[_0xbbc7('0xf')]('/:id',auth[_0xbbc7('0xb')](),controller[_0xbbc7('0x10')]);module['exports']=router; \ No newline at end of file +var _0x30a1=['./intServicenowField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x57474e,_0x4178b8){var _0xfaae8c=function(_0x2e34d1){while(--_0x2e34d1){_0x57474e['push'](_0x57474e['shift']());}};_0xfaae8c(++_0x4178b8);}(_0x30a1,0x19d));var _0x130a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x30a1[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x130a('0x0'));var util=require(_0x130a('0x1'));var path=require(_0x130a('0x2'));var timeout=require(_0x130a('0x3'));var express=require(_0x130a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x130a('0x5'));var interaction=require(_0x130a('0x6'));var config=require('../../config/environment');var controller=require(_0x130a('0x7'));router[_0x130a('0x8')]('/',auth['isAuthenticated'](),controller[_0x130a('0x9')]);router[_0x130a('0x8')](_0x130a('0xa'),auth[_0x130a('0xb')](),controller[_0x130a('0xc')]);router[_0x130a('0xd')]('/',auth['isAuthenticated'](),controller[_0x130a('0xe')]);router[_0x130a('0xf')]('/:id',auth[_0x130a('0xb')](),controller[_0x130a('0x10')]);router[_0x130a('0x11')](_0x130a('0xa'),auth['isAuthenticated'](),controller[_0x130a('0x12')]);module[_0x130a('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index b782eae..8be04d4 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 _0x2a45=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','string','variable','customVariable'];(function(_0x1d155f,_0x5027a7){var _0x25e5ca=function(_0x517662){while(--_0x517662){_0x1d155f['push'](_0x1d155f['shift']());}};_0x25e5ca(++_0x5027a7);}(_0x2a45,0x16c));var _0x52a4=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x2a45[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require(_0x52a4('0x0'));module[_0x52a4('0x1')]={'type':{'type':Sequelize['ENUM'](_0x52a4('0x2'),_0x52a4('0x3'),_0x52a4('0x4'),_0x52a4('0x5'),_0x52a4('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x52a4('0x7')]},'key':{'type':Sequelize[_0x52a4('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x52a4('0x2'),_0x52a4('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x52a4('0x7')]},'customField':{'type':Sequelize[_0x52a4('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x52a4('0x7')]}}; \ No newline at end of file +var _0xd690=['STRING','BOOLEAN','sequelize','exports','string','variable','customVariable','ENUM'];(function(_0xe81b28,_0x48b460){var _0x126224=function(_0x1fcfae){while(--_0x1fcfae){_0xe81b28['push'](_0xe81b28['shift']());}};_0x126224(++_0x48b460);}(_0xd690,0x16a));var _0x0d69=function(_0x2004a9,_0x43e1cb){_0x2004a9=_0x2004a9-0x0;var _0xc7a6b0=_0xd690[_0x2004a9];return _0xc7a6b0;};'use strict';var Sequelize=require(_0x0d69('0x0'));module[_0x0d69('0x1')]={'type':{'type':Sequelize['ENUM'](_0x0d69('0x2'),_0x0d69('0x3'),_0x0d69('0x4'),'keyValue','picklist'),'defaultValue':_0x0d69('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0d69('0x5')]('string',_0x0d69('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x0d69('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0d69('0x6')]},'customField':{'type':Sequelize[_0x0d69('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0d69('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index e61c599..57a3e1b 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 _0x4a2a=['save','update','then','destroy','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x4edef1,_0xbd9020){var _0xa596aa=function(_0x4f5ab5){while(--_0x4f5ab5){_0x4edef1['push'](_0x4edef1['shift']());}};_0xa596aa(++_0xbd9020);}(_0x4a2a,0x109));var _0xa4a2=function(_0x4059c2,_0x342ebe){_0x4059c2=_0x4059c2-0x0;var _0x4cea66=_0x4a2a[_0x4059c2];return _0x4cea66;};'use strict';var emlformat=require(_0xa4a2('0x0'));var rimraf=require(_0xa4a2('0x1'));var zipdir=require(_0xa4a2('0x2'));var jsonpatch=require(_0xa4a2('0x3'));var rp=require(_0xa4a2('0x4'));var moment=require('moment');var BPromise=require(_0xa4a2('0x5'));var Mustache=require(_0xa4a2('0x6'));var util=require(_0xa4a2('0x7'));var path=require('path');var sox=require(_0xa4a2('0x8'));var csv=require(_0xa4a2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa4a2('0xa'));var _=require(_0xa4a2('0xb'));var squel=require(_0xa4a2('0xc'));var crypto=require('crypto');var jsforce=require(_0xa4a2('0xd'));var deskjs=require(_0xa4a2('0xe'));var toCsv=require(_0xa4a2('0x9'));var querystring=require('querystring');var Papa=require(_0xa4a2('0xf'));var Redis=require(_0xa4a2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa4a2('0x11'));var as=require(_0xa4a2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa4a2('0x13'))('api');var utils=require(_0xa4a2('0x14'));var config=require(_0xa4a2('0x15'));var licenseUtil=require(_0xa4a2('0x16'));var db=require(_0xa4a2('0x17'))['db'];function respondWithStatusCode(_0x343ace,_0x5e55d4){_0x5e55d4=_0x5e55d4||0xcc;return function(_0x4522a7){if(_0x4522a7){return _0x343ace[_0xa4a2('0x18')](_0x5e55d4);}return _0x343ace[_0xa4a2('0x19')](_0x5e55d4)[_0xa4a2('0x1a')]();};}function respondWithResult(_0x163cdf,_0x597d25){_0x597d25=_0x597d25||0xc8;return function(_0x2ccb50){if(_0x2ccb50){return _0x163cdf[_0xa4a2('0x19')](_0x597d25)[_0xa4a2('0x1b')](_0x2ccb50);}};}function respondWithFilteredResult(_0x12d5f0,_0x391b5d){return function(_0x2bed3b){if(_0x2bed3b){var _0x51ddd8=typeof _0x391b5d[_0xa4a2('0x1c')]===_0xa4a2('0x1d')&&typeof _0x391b5d[_0xa4a2('0x1e')]===_0xa4a2('0x1d');var _0x2fa26d=_0x2bed3b[_0xa4a2('0x1f')];var _0x2a9e22=_0x51ddd8?0x0:_0x391b5d[_0xa4a2('0x1c')];var _0x8ccb2c=_0x51ddd8?_0x2bed3b[_0xa4a2('0x1f')]:_0x391b5d[_0xa4a2('0x1c')]+_0x391b5d[_0xa4a2('0x1e')];var _0x5c12ff;if(_0x8ccb2c>=_0x2fa26d){_0x8ccb2c=_0x2fa26d;_0x5c12ff=0xc8;}else{_0x5c12ff=0xce;}_0x12d5f0[_0xa4a2('0x19')](_0x5c12ff);return _0x12d5f0[_0xa4a2('0x20')](_0xa4a2('0x21'),_0x2a9e22+'-'+_0x8ccb2c+'/'+_0x2fa26d)['json'](_0x2bed3b);}return null;};}function patchUpdates(_0x3f23c1){return function(_0x3d3811){try{jsonpatch[_0xa4a2('0x22')](_0x3d3811,_0x3f23c1,!![]);}catch(_0x2209bb){return BPromise['reject'](_0x2209bb);}return _0x3d3811[_0xa4a2('0x23')]();};}function saveUpdates(_0x31217b,_0x53f305){return function(_0x2a2b39){if(_0x2a2b39){return _0x2a2b39[_0xa4a2('0x24')](_0x31217b)[_0xa4a2('0x25')](function(_0x4ba55c){return _0x4ba55c;});}return null;};}function removeEntity(_0x140360,_0x1d1484){return function(_0x520013){if(_0x520013){return _0x520013[_0xa4a2('0x26')]()[_0xa4a2('0x25')](function(){_0x140360[_0xa4a2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18c9d6,_0x21a3e0){return function(_0x534cf3){if(!_0x534cf3){_0x18c9d6[_0xa4a2('0x18')](0x194);}return _0x534cf3;};}function handleError(_0x5256f1,_0x58354a){_0x58354a=_0x58354a||0x1f4;return function(_0x4a15e4){logger[_0xa4a2('0x27')](_0x4a15e4['stack']);if(_0x4a15e4[_0xa4a2('0x28')]){delete _0x4a15e4['name'];}_0x5256f1['status'](_0x58354a)[_0xa4a2('0x29')](_0x4a15e4);};}exports[_0xa4a2('0x2a')]=function(_0x22d738,_0x1690bc){var _0x4fb79b={},_0x5ea420={},_0x2f6318={'count':0x0,'rows':[]};var _0x53dbd7=_[_0xa4a2('0x2b')](db[_0xa4a2('0x2c')][_0xa4a2('0x2d')],function(_0x2adfb8){return{'name':_0x2adfb8[_0xa4a2('0x2e')],'type':_0x2adfb8[_0xa4a2('0x2f')][_0xa4a2('0x30')]};});_0x5ea420[_0xa4a2('0x31')]=_[_0xa4a2('0x2b')](_0x53dbd7,'name');_0x5ea420[_0xa4a2('0x32')]=_[_0xa4a2('0x33')](_0x22d738['query']);_0x5ea420[_0xa4a2('0x34')]=_[_0xa4a2('0x35')](_0x5ea420['model'],_0x5ea420[_0xa4a2('0x32')]);_0x4fb79b[_0xa4a2('0x36')]=_[_0xa4a2('0x35')](_0x5ea420[_0xa4a2('0x31')],qs[_0xa4a2('0x37')](_0x22d738[_0xa4a2('0x32')][_0xa4a2('0x37')]));_0x4fb79b[_0xa4a2('0x36')]=_0x4fb79b['attributes'][_0xa4a2('0x38')]?_0x4fb79b[_0xa4a2('0x36')]:_0x5ea420[_0xa4a2('0x31')];if(!_0x22d738['query'][_0xa4a2('0x39')](_0xa4a2('0x3a'))){_0x4fb79b['limit']=qs[_0xa4a2('0x1e')](_0x22d738[_0xa4a2('0x32')]['limit']);_0x4fb79b['offset']=qs[_0xa4a2('0x1c')](_0x22d738[_0xa4a2('0x32')][_0xa4a2('0x1c')]);}_0x4fb79b[_0xa4a2('0x3b')]=qs['sort'](_0x22d738[_0xa4a2('0x32')][_0xa4a2('0x3c')]);_0x4fb79b[_0xa4a2('0x3d')]=qs[_0xa4a2('0x34')](_['pick'](_0x22d738[_0xa4a2('0x32')],_0x5ea420[_0xa4a2('0x34')]),_0x53dbd7);if(_0x22d738['query'][_0xa4a2('0x3e')]){_0x4fb79b['where']=_[_0xa4a2('0x3f')](_0x4fb79b[_0xa4a2('0x3d')],{'$or':_[_0xa4a2('0x2b')](_0x53dbd7,function(_0x2f446a){if(_0x2f446a[_0xa4a2('0x2f')]!==_0xa4a2('0x40')){var _0x2cf4e5={};_0x2cf4e5[_0x2f446a[_0xa4a2('0x28')]]={'$like':'%'+_0x22d738[_0xa4a2('0x32')][_0xa4a2('0x3e')]+'%'};return _0x2cf4e5;}})});}_0x4fb79b=_[_0xa4a2('0x3f')]({},_0x4fb79b,_0x22d738['options']);var _0x4c9b1a={'where':_0x4fb79b['where']};return db[_0xa4a2('0x2c')]['count'](_0x4c9b1a)[_0xa4a2('0x25')](function(_0x40e671){_0x2f6318['count']=_0x40e671;if(_0x22d738[_0xa4a2('0x32')]['includeAll']){_0x4fb79b[_0xa4a2('0x41')]=[{'all':!![]}];}return db['ServicenowField'][_0xa4a2('0x42')](_0x4fb79b);})[_0xa4a2('0x25')](function(_0x2585d8){_0x2f6318[_0xa4a2('0x43')]=_0x2585d8;return _0x2f6318;})[_0xa4a2('0x25')](respondWithFilteredResult(_0x1690bc,_0x4fb79b))[_0xa4a2('0x44')](handleError(_0x1690bc,null));};exports[_0xa4a2('0x45')]=function(_0x537a22,_0x54ff1a){var _0x375a2c={'raw':!![],'where':{'id':_0x537a22['params']['id']}},_0x3687aa={};_0x3687aa[_0xa4a2('0x31')]=_[_0xa4a2('0x33')](db['ServicenowField'][_0xa4a2('0x2d')]);_0x3687aa[_0xa4a2('0x32')]=_[_0xa4a2('0x33')](_0x537a22['query']);_0x3687aa[_0xa4a2('0x34')]=_[_0xa4a2('0x35')](_0x3687aa[_0xa4a2('0x31')],_0x3687aa['query']);_0x375a2c[_0xa4a2('0x36')]=_[_0xa4a2('0x35')](_0x3687aa['model'],qs[_0xa4a2('0x37')](_0x537a22[_0xa4a2('0x32')][_0xa4a2('0x37')]));_0x375a2c[_0xa4a2('0x36')]=_0x375a2c[_0xa4a2('0x36')][_0xa4a2('0x38')]?_0x375a2c[_0xa4a2('0x36')]:_0x3687aa[_0xa4a2('0x31')];if(_0x537a22['query']['includeAll']){_0x375a2c[_0xa4a2('0x41')]=[{'all':!![]}];}_0x375a2c=_[_0xa4a2('0x3f')]({},_0x375a2c,_0x537a22[_0xa4a2('0x46')]);return db[_0xa4a2('0x2c')][_0xa4a2('0x47')](_0x375a2c)[_0xa4a2('0x25')](handleEntityNotFound(_0x54ff1a,null))[_0xa4a2('0x25')](respondWithResult(_0x54ff1a,null))[_0xa4a2('0x44')](handleError(_0x54ff1a,null));};exports[_0xa4a2('0x48')]=function(_0x567b8f,_0x4857fd){return db[_0xa4a2('0x2c')]['create'](_0x567b8f[_0xa4a2('0x49')],{})[_0xa4a2('0x25')](respondWithResult(_0x4857fd,0xc9))[_0xa4a2('0x44')](handleError(_0x4857fd,null));};exports['update']=function(_0x3fa23e,_0x357364){if(_0x3fa23e['body']['id']){delete _0x3fa23e[_0xa4a2('0x49')]['id'];}return db[_0xa4a2('0x2c')]['find']({'where':{'id':_0x3fa23e[_0xa4a2('0x4a')]['id']}})[_0xa4a2('0x25')](handleEntityNotFound(_0x357364,null))[_0xa4a2('0x25')](saveUpdates(_0x3fa23e[_0xa4a2('0x49')],null))['then'](respondWithResult(_0x357364,null))[_0xa4a2('0x44')](handleError(_0x357364,null));};exports['destroy']=function(_0x1cc704,_0x5bc8b2){return db[_0xa4a2('0x2c')][_0xa4a2('0x47')]({'where':{'id':_0x1cc704[_0xa4a2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5bc8b2,null))['then'](removeEntity(_0x5bc8b2,null))['catch'](handleError(_0x5bc8b2,null));}; \ No newline at end of file +var _0x54d5=['fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','merge','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','stack','name','send','index','ServicenowField','rawAttributes'];(function(_0x3366ca,_0x47d5ed){var _0x5a88ca=function(_0x5b52ca){while(--_0x5b52ca){_0x3366ca['push'](_0x3366ca['shift']());}};_0x5a88ca(++_0x47d5ed);}(_0x54d5,0x6a));var _0x554d=function(_0x229b92,_0x468517){_0x229b92=_0x229b92-0x0;var _0x2b0dc1=_0x54d5[_0x229b92];return _0x2b0dc1;};'use strict';var emlformat=require(_0x554d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x554d('0x1'));var jsonpatch=require(_0x554d('0x2'));var rp=require(_0x554d('0x3'));var moment=require(_0x554d('0x4'));var BPromise=require(_0x554d('0x5'));var Mustache=require('mustache');var util=require(_0x554d('0x6'));var path=require(_0x554d('0x7'));var sox=require(_0x554d('0x8'));var csv=require(_0x554d('0x9'));var ejs=require(_0x554d('0xa'));var fs=require('fs');var fs_extra=require(_0x554d('0xb'));var _=require('lodash');var squel=require(_0x554d('0xc'));var crypto=require(_0x554d('0xd'));var jsforce=require(_0x554d('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x554d('0xf'));var Papa=require(_0x554d('0x10'));var Redis=require('ioredis');var authService=require(_0x554d('0x11'));var qs=require(_0x554d('0x12'));var as=require(_0x554d('0x13'));var hardwareService=require(_0x554d('0x14'));var logger=require(_0x554d('0x15'))(_0x554d('0x16'));var utils=require(_0x554d('0x17'));var config=require(_0x554d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x554d('0x19'))['db'];function respondWithStatusCode(_0x17a781,_0x51f699){_0x51f699=_0x51f699||0xcc;return function(_0x27f9f6){if(_0x27f9f6){return _0x17a781[_0x554d('0x1a')](_0x51f699);}return _0x17a781[_0x554d('0x1b')](_0x51f699)[_0x554d('0x1c')]();};}function respondWithResult(_0xb489c7,_0x473772){_0x473772=_0x473772||0xc8;return function(_0x43a72f){if(_0x43a72f){return _0xb489c7[_0x554d('0x1b')](_0x473772)[_0x554d('0x1d')](_0x43a72f);}};}function respondWithFilteredResult(_0xca332c,_0x5c66bd){return function(_0x540ae7){if(_0x540ae7){var _0x551ecb=typeof _0x5c66bd[_0x554d('0x1e')]===_0x554d('0x1f')&&typeof _0x5c66bd[_0x554d('0x20')]==='undefined';var _0xd756c4=_0x540ae7[_0x554d('0x21')];var _0x4061f9=_0x551ecb?0x0:_0x5c66bd['offset'];var _0x25db47=_0x551ecb?_0x540ae7['count']:_0x5c66bd[_0x554d('0x1e')]+_0x5c66bd[_0x554d('0x20')];var _0x506ae5;if(_0x25db47>=_0xd756c4){_0x25db47=_0xd756c4;_0x506ae5=0xc8;}else{_0x506ae5=0xce;}_0xca332c[_0x554d('0x1b')](_0x506ae5);return _0xca332c['set'](_0x554d('0x22'),_0x4061f9+'-'+_0x25db47+'/'+_0xd756c4)['json'](_0x540ae7);}return null;};}function patchUpdates(_0x517f91){return function(_0xf482e2){try{jsonpatch['apply'](_0xf482e2,_0x517f91,!![]);}catch(_0x3e209e){return BPromise[_0x554d('0x23')](_0x3e209e);}return _0xf482e2['save']();};}function saveUpdates(_0x4cc8e5,_0x24557f){return function(_0x18484f){if(_0x18484f){return _0x18484f[_0x554d('0x24')](_0x4cc8e5)[_0x554d('0x25')](function(_0x2e78d8){return _0x2e78d8;});}return null;};}function removeEntity(_0x3c337c,_0x374c00){return function(_0x57f53a){if(_0x57f53a){return _0x57f53a[_0x554d('0x26')]()['then'](function(){_0x3c337c[_0x554d('0x1b')](0xcc)[_0x554d('0x1c')]();});}};}function handleEntityNotFound(_0x2ddda1,_0x2751fd){return function(_0x132797){if(!_0x132797){_0x2ddda1[_0x554d('0x1a')](0x194);}return _0x132797;};}function handleError(_0x1ffac2,_0x3850ff){_0x3850ff=_0x3850ff||0x1f4;return function(_0x1a5bef){logger[_0x554d('0x27')](_0x1a5bef[_0x554d('0x28')]);if(_0x1a5bef[_0x554d('0x29')]){delete _0x1a5bef[_0x554d('0x29')];}_0x1ffac2[_0x554d('0x1b')](_0x3850ff)[_0x554d('0x2a')](_0x1a5bef);};}exports[_0x554d('0x2b')]=function(_0xc8b94,_0x499e81){var _0x2726f2={},_0x5d00e3={},_0x444f6d={'count':0x0,'rows':[]};var _0xc4ab9c=_['map'](db[_0x554d('0x2c')][_0x554d('0x2d')],function(_0x7278cb){return{'name':_0x7278cb[_0x554d('0x2e')],'type':_0x7278cb[_0x554d('0x2f')][_0x554d('0x30')]};});_0x5d00e3[_0x554d('0x31')]=_[_0x554d('0x32')](_0xc4ab9c,'name');_0x5d00e3[_0x554d('0x33')]=_[_0x554d('0x34')](_0xc8b94[_0x554d('0x33')]);_0x5d00e3[_0x554d('0x35')]=_[_0x554d('0x36')](_0x5d00e3['model'],_0x5d00e3[_0x554d('0x33')]);_0x2726f2[_0x554d('0x37')]=_[_0x554d('0x36')](_0x5d00e3['model'],qs['fields'](_0xc8b94[_0x554d('0x33')][_0x554d('0x38')]));_0x2726f2[_0x554d('0x37')]=_0x2726f2[_0x554d('0x37')][_0x554d('0x39')]?_0x2726f2[_0x554d('0x37')]:_0x5d00e3[_0x554d('0x31')];if(!_0xc8b94[_0x554d('0x33')]['hasOwnProperty'](_0x554d('0x3a'))){_0x2726f2[_0x554d('0x20')]=qs['limit'](_0xc8b94[_0x554d('0x33')]['limit']);_0x2726f2[_0x554d('0x1e')]=qs[_0x554d('0x1e')](_0xc8b94[_0x554d('0x33')][_0x554d('0x1e')]);}_0x2726f2[_0x554d('0x3b')]=qs[_0x554d('0x3c')](_0xc8b94[_0x554d('0x33')][_0x554d('0x3c')]);_0x2726f2[_0x554d('0x3d')]=qs[_0x554d('0x35')](_[_0x554d('0x3e')](_0xc8b94[_0x554d('0x33')],_0x5d00e3[_0x554d('0x35')]),_0xc4ab9c);if(_0xc8b94['query'][_0x554d('0x3f')]){_0x2726f2['where']=_['merge'](_0x2726f2['where'],{'$or':_[_0x554d('0x32')](_0xc4ab9c,function(_0x1f0769){if(_0x1f0769[_0x554d('0x2f')]!==_0x554d('0x40')){var _0x2405a3={};_0x2405a3[_0x1f0769[_0x554d('0x29')]]={'$like':'%'+_0xc8b94[_0x554d('0x33')]['filter']+'%'};return _0x2405a3;}})});}_0x2726f2=_['merge']({},_0x2726f2,_0xc8b94[_0x554d('0x41')]);var _0x30a5e8={'where':_0x2726f2[_0x554d('0x3d')]};return db[_0x554d('0x2c')][_0x554d('0x21')](_0x30a5e8)[_0x554d('0x25')](function(_0x35f922){_0x444f6d[_0x554d('0x21')]=_0x35f922;if(_0xc8b94['query'][_0x554d('0x42')]){_0x2726f2[_0x554d('0x43')]=[{'all':!![]}];}return db[_0x554d('0x2c')][_0x554d('0x44')](_0x2726f2);})[_0x554d('0x25')](function(_0x158e6b){_0x444f6d[_0x554d('0x45')]=_0x158e6b;return _0x444f6d;})[_0x554d('0x25')](respondWithFilteredResult(_0x499e81,_0x2726f2))[_0x554d('0x46')](handleError(_0x499e81,null));};exports['show']=function(_0x4843c3,_0xdc5e53){var _0x31a78d={'raw':!![],'where':{'id':_0x4843c3[_0x554d('0x47')]['id']}},_0x33e299={};_0x33e299[_0x554d('0x31')]=_[_0x554d('0x34')](db[_0x554d('0x2c')][_0x554d('0x2d')]);_0x33e299[_0x554d('0x33')]=_['keys'](_0x4843c3[_0x554d('0x33')]);_0x33e299[_0x554d('0x35')]=_[_0x554d('0x36')](_0x33e299['model'],_0x33e299[_0x554d('0x33')]);_0x31a78d[_0x554d('0x37')]=_['intersection'](_0x33e299[_0x554d('0x31')],qs[_0x554d('0x38')](_0x4843c3[_0x554d('0x33')]['fields']));_0x31a78d['attributes']=_0x31a78d['attributes'][_0x554d('0x39')]?_0x31a78d[_0x554d('0x37')]:_0x33e299[_0x554d('0x31')];if(_0x4843c3[_0x554d('0x33')][_0x554d('0x42')]){_0x31a78d['include']=[{'all':!![]}];}_0x31a78d=_[_0x554d('0x48')]({},_0x31a78d,_0x4843c3[_0x554d('0x41')]);return db[_0x554d('0x2c')]['find'](_0x31a78d)['then'](handleEntityNotFound(_0xdc5e53,null))[_0x554d('0x25')](respondWithResult(_0xdc5e53,null))[_0x554d('0x46')](handleError(_0xdc5e53,null));};exports[_0x554d('0x49')]=function(_0x13fffb,_0x283a1f){return db[_0x554d('0x2c')][_0x554d('0x49')](_0x13fffb[_0x554d('0x4a')],{})['then'](respondWithResult(_0x283a1f,0xc9))[_0x554d('0x46')](handleError(_0x283a1f,null));};exports['update']=function(_0x3c597a,_0x2ce3db){if(_0x3c597a[_0x554d('0x4a')]['id']){delete _0x3c597a[_0x554d('0x4a')]['id'];}return db['ServicenowField'][_0x554d('0x4b')]({'where':{'id':_0x3c597a[_0x554d('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ce3db,null))['then'](saveUpdates(_0x3c597a[_0x554d('0x4a')],null))[_0x554d('0x25')](respondWithResult(_0x2ce3db,null))[_0x554d('0x46')](handleError(_0x2ce3db,null));};exports['destroy']=function(_0x127261,_0x3d6999){return db[_0x554d('0x2c')][_0x554d('0x4b')]({'where':{'id':_0x127261[_0x554d('0x47')]['id']}})[_0x554d('0x25')](handleEntityNotFound(_0x3d6999,null))[_0x554d('0x25')](removeEntity(_0x3d6999,null))[_0x554d('0x46')](handleError(_0x3d6999,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 0b9fc65..d668c8d 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 _0x0a25=['servicenow_unique_index','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x0a25,0x197));var _0x50a2=function(_0x10b477,_0x3f5cbf){_0x10b477=_0x10b477-0x0;var _0x311ed4=_0x0a25[_0x10b477];return _0x311ed4;};'use strict';var _=require(_0x50a2('0x0'));var util=require(_0x50a2('0x1'));var logger=require('../../config/logger')(_0x50a2('0x2'));var moment=require(_0x50a2('0x3'));var BPromise=require(_0x50a2('0x4'));var rp=require(_0x50a2('0x5'));var fs=require('fs');var path=require(_0x50a2('0x6'));var rimraf=require(_0x50a2('0x7'));var config=require(_0x50a2('0x8'));var attributes=require('./intServicenowField.attributes');module[_0x50a2('0x9')]=function(_0x4a85b8,_0x5025c8){return _0x4a85b8[_0x50a2('0xa')](_0x50a2('0xb'),attributes,{'tableName':_0x50a2('0xc'),'paranoid':![],'indexes':[{'name':_0x50a2('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5aac=['request-promise','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','api'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x5aac,0x72));var _0xc5aa=function(_0x341ec5,_0xbfc4df){_0x341ec5=_0x341ec5-0x0;var _0x56365e=_0x5aac[_0x341ec5];return _0x56365e;};'use strict';var _=require(_0xc5aa('0x0'));var util=require(_0xc5aa('0x1'));var logger=require('../../config/logger')(_0xc5aa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc5aa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc5aa('0x4'));var config=require(_0xc5aa('0x5'));var attributes=require(_0xc5aa('0x6'));module[_0xc5aa('0x7')]=function(_0x163e2c,_0x174b8d){return _0x163e2c[_0xc5aa('0x8')]('ServicenowField',attributes,{'tableName':_0xc5aa('0x9'),'paranoid':![],'indexes':[{'name':_0xc5aa('0xa'),'fields':[_0xc5aa('0xb'),_0xc5aa('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 2b6b551..af21d40 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 _0xbdb7=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ServicenowField,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x2a1b33,_0x409f50){_0x2a1b33=_0x2a1b33-0x0;var _0x4c50e7=_0xbdb7[_0x2a1b33];return _0x4c50e7;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x59625f,_0x3b2c76){var _0x498e1e=function(_0x85bb84){while(--_0x85bb84){_0x59625f['push'](_0x59625f['shift']());}};_0x498e1e(++_0x3b2c76);}(_0xf4eb,0xec));var _0xbf4e=function(_0x426cd6,_0x51fb1f){_0x426cd6=_0x426cd6-0x0;var _0x22ce05=_0xf4eb[_0x426cd6];return _0x22ce05;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 4150843..30ea1f9 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x116840,_0xe65da8){var _0x1a9cc5=function(_0x155dd7){while(--_0x155dd7){_0x116840['push'](_0x116840['shift']());}};_0x1a9cc5(++_0xe65da8);}(_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/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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0xf836dd,_0x3eb6bf){var _0xdb72a3=function(_0x295846){while(--_0x295846){_0xf836dd['push'](_0xf836dd['shift']());}};_0xdb72a3(++_0x3eb6bf);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index fd825b1..7534a4e 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(_0x124b39,_0x3e6d4f){var _0x335d79=function(_0x5b8cec){while(--_0x5b8cec){_0x124b39['push'](_0x124b39['shift']());}};_0x335d79(++_0x3e6d4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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(_0x20b32d,_0x3e42f3){var _0x3a2162=function(_0x3f59e0){while(--_0x3f59e0){_0x20b32d['push'](_0x20b32d['shift']());}};_0x3a2162(++_0x3e42f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 6cf6e08..8812ad8 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 _0xe33f=['create','body','getConfigurations','findOne','SugarcrmConfiguration','filter','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_minutes','parent_id','parent_type','parent_name','password','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','stringify','Calls','values','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','fs-extra','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','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','SugarcrmAccount','rawAttributes','type','map','query','keys','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find'];(function(_0x2b86f2,_0x312542){var _0x383901=function(_0x28482d){while(--_0x28482d){_0x2b86f2['push'](_0x2b86f2['shift']());}};_0x383901(++_0x312542);}(_0xe33f,0x11a));var _0xfe33=function(_0x3f4a29,_0x432843){_0x3f4a29=_0x3f4a29-0x0;var _0x1c2cd1=_0xe33f[_0x3f4a29];return _0x1c2cd1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe33('0x0'));var zipdir=require(_0xfe33('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe33('0x2'));var moment=require(_0xfe33('0x3'));var BPromise=require(_0xfe33('0x4'));var Mustache=require(_0xfe33('0x5'));var util=require('util');var path=require(_0xfe33('0x6'));var sox=require(_0xfe33('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe33('0x8'));var _=require('lodash');var squel=require(_0xfe33('0x9'));var crypto=require(_0xfe33('0xa'));var jsforce=require(_0xfe33('0xb'));var deskjs=require(_0xfe33('0xc'));var toCsv=require(_0xfe33('0xd'));var querystring=require(_0xfe33('0xe'));var Papa=require(_0xfe33('0xf'));var Redis=require(_0xfe33('0x10'));var authService=require(_0xfe33('0x11'));var qs=require(_0xfe33('0x12'));var as=require(_0xfe33('0x13'));var hardwareService=require(_0xfe33('0x14'));var logger=require(_0xfe33('0x15'))(_0xfe33('0x16'));var utils=require(_0xfe33('0x17'));var config=require(_0xfe33('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xfe33('0x19'));function respondWithStatusCode(_0x1c6db7,_0x394d8d){_0x394d8d=_0x394d8d||0xcc;return function(_0x16893b){if(_0x16893b){return _0x1c6db7[_0xfe33('0x1a')](_0x394d8d);}return _0x1c6db7[_0xfe33('0x1b')](_0x394d8d)[_0xfe33('0x1c')]();};}function respondWithResult(_0x413326,_0x4c0cc1){_0x4c0cc1=_0x4c0cc1||0xc8;return function(_0x53a118){if(_0x53a118){return _0x413326[_0xfe33('0x1b')](_0x4c0cc1)[_0xfe33('0x1d')](_0x53a118);}};}function respondWithFilteredResult(_0xf76c70,_0x5c72ad){return function(_0x108df5){if(_0x108df5){var _0xb1f25f=typeof _0x5c72ad[_0xfe33('0x1e')]===_0xfe33('0x1f')&&typeof _0x5c72ad[_0xfe33('0x20')]==='undefined';var _0x3748b3=_0x108df5[_0xfe33('0x21')];var _0x40b444=_0xb1f25f?0x0:_0x5c72ad['offset'];var _0x33896f=_0xb1f25f?_0x108df5[_0xfe33('0x21')]:_0x5c72ad['offset']+_0x5c72ad[_0xfe33('0x20')];var _0x2f0b4d;if(_0x33896f>=_0x3748b3){_0x33896f=_0x3748b3;_0x2f0b4d=0xc8;}else{_0x2f0b4d=0xce;}_0xf76c70[_0xfe33('0x1b')](_0x2f0b4d);return _0xf76c70['set'](_0xfe33('0x22'),_0x40b444+'-'+_0x33896f+'/'+_0x3748b3)['json'](_0x108df5);}return null;};}function patchUpdates(_0x51e5fd){return function(_0x40d8de){try{jsonpatch[_0xfe33('0x23')](_0x40d8de,_0x51e5fd,!![]);}catch(_0x5ec292){return BPromise[_0xfe33('0x24')](_0x5ec292);}return _0x40d8de[_0xfe33('0x25')]();};}function saveUpdates(_0x42fe6d,_0x78d823){return function(_0xe9f8a6){if(_0xe9f8a6){return _0xe9f8a6[_0xfe33('0x26')](_0x42fe6d)[_0xfe33('0x27')](function(_0xd05115){return _0xd05115;});}return null;};}function removeEntity(_0x573b12,_0x3a1fc3){return function(_0x453fdd){if(_0x453fdd){return _0x453fdd[_0xfe33('0x28')]()[_0xfe33('0x27')](function(){_0x573b12[_0xfe33('0x1b')](0xcc)[_0xfe33('0x1c')]();});}};}function handleEntityNotFound(_0x29b46a,_0x2c5baa){return function(_0xcb63bc){if(!_0xcb63bc){_0x29b46a['sendStatus'](0x194);}return _0xcb63bc;};}function handleError(_0x2525c4,_0x13c650){_0x13c650=_0x13c650||0x1f4;return function(_0x38afed){logger['error'](_0x38afed[_0xfe33('0x29')]);if(_0x38afed[_0xfe33('0x2a')]){delete _0x38afed[_0xfe33('0x2a')];}_0x2525c4[_0xfe33('0x1b')](_0x13c650)[_0xfe33('0x2b')](_0x38afed);};}exports['index']=function(_0xf695cb,_0x9fd98d){var _0x14c5ab={},_0x1539cc={},_0x3bf040={'count':0x0,'rows':[]};var _0x3b7979=_['map'](db[_0xfe33('0x2c')][_0xfe33('0x2d')],function(_0x1c485a){return{'name':_0x1c485a['fieldName'],'type':_0x1c485a[_0xfe33('0x2e')]['key']};});_0x1539cc['model']=_[_0xfe33('0x2f')](_0x3b7979,'name');_0x1539cc[_0xfe33('0x30')]=_[_0xfe33('0x31')](_0xf695cb['query']);_0x1539cc['filters']=_[_0xfe33('0x32')](_0x1539cc['model'],_0x1539cc[_0xfe33('0x30')]);_0x14c5ab['attributes']=_['intersection'](_0x1539cc['model'],qs['fields'](_0xf695cb[_0xfe33('0x30')][_0xfe33('0x33')]));_0x14c5ab[_0xfe33('0x34')]=_0x14c5ab['attributes'][_0xfe33('0x35')]?_0x14c5ab[_0xfe33('0x34')]:_0x1539cc[_0xfe33('0x36')];if(!_0xf695cb[_0xfe33('0x30')][_0xfe33('0x37')](_0xfe33('0x38'))){_0x14c5ab[_0xfe33('0x20')]=qs[_0xfe33('0x20')](_0xf695cb[_0xfe33('0x30')][_0xfe33('0x20')]);_0x14c5ab['offset']=qs['offset'](_0xf695cb[_0xfe33('0x30')][_0xfe33('0x1e')]);}_0x14c5ab[_0xfe33('0x39')]=qs['sort'](_0xf695cb[_0xfe33('0x30')][_0xfe33('0x3a')]);_0x14c5ab['where']=qs[_0xfe33('0x3b')](_[_0xfe33('0x3c')](_0xf695cb[_0xfe33('0x30')],_0x1539cc[_0xfe33('0x3b')]),_0x3b7979);if(_0xf695cb[_0xfe33('0x30')]['filter']){_0x14c5ab['where']=_[_0xfe33('0x3d')](_0x14c5ab[_0xfe33('0x3e')],{'$or':_[_0xfe33('0x2f')](_0x3b7979,function(_0x50d921){if(_0x50d921['type']!==_0xfe33('0x3f')){var _0x18b28a={};_0x18b28a[_0x50d921['name']]={'$like':'%'+_0xf695cb[_0xfe33('0x30')]['filter']+'%'};return _0x18b28a;}})});}_0x14c5ab=_[_0xfe33('0x3d')]({},_0x14c5ab,_0xf695cb[_0xfe33('0x40')]);var _0x32a3a0={'where':_0x14c5ab[_0xfe33('0x3e')]};return db[_0xfe33('0x2c')][_0xfe33('0x21')](_0x32a3a0)[_0xfe33('0x27')](function(_0x31b42e){_0x3bf040[_0xfe33('0x21')]=_0x31b42e;if(_0xf695cb['query'][_0xfe33('0x41')]){_0x14c5ab[_0xfe33('0x42')]=[{'all':!![]}];}return db[_0xfe33('0x2c')][_0xfe33('0x43')](_0x14c5ab);})[_0xfe33('0x27')](function(_0x5cfa3e){_0x3bf040['rows']=_0x5cfa3e;return _0x3bf040;})['then'](respondWithFilteredResult(_0x9fd98d,_0x14c5ab))[_0xfe33('0x44')](handleError(_0x9fd98d,null));};exports[_0xfe33('0x45')]=function(_0x355ae8,_0x145e3f){var _0x3df653={'raw':![],'where':{'id':_0x355ae8[_0xfe33('0x46')]['id']}},_0x5c3103={};_0x5c3103[_0xfe33('0x36')]=_[_0xfe33('0x31')](db[_0xfe33('0x2c')]['rawAttributes']);_0x5c3103[_0xfe33('0x30')]=_[_0xfe33('0x31')](_0x355ae8[_0xfe33('0x30')]);_0x5c3103['filters']=_[_0xfe33('0x32')](_0x5c3103['model'],_0x5c3103['query']);_0x3df653[_0xfe33('0x34')]=_[_0xfe33('0x32')](_0x5c3103[_0xfe33('0x36')],qs['fields'](_0x355ae8['query'][_0xfe33('0x33')]));_0x3df653['attributes']=_0x3df653[_0xfe33('0x34')][_0xfe33('0x35')]?_0x3df653[_0xfe33('0x34')]:_0x5c3103['model'];if(_0x355ae8[_0xfe33('0x30')]['includeAll']){_0x3df653[_0xfe33('0x42')]=[{'all':!![]}];}_0x3df653=_[_0xfe33('0x3d')]({},_0x3df653,_0x355ae8['options']);return db[_0xfe33('0x2c')][_0xfe33('0x47')](_0x3df653)[_0xfe33('0x27')](handleEntityNotFound(_0x145e3f,null))['then'](respondWithResult(_0x145e3f,null))[_0xfe33('0x44')](handleError(_0x145e3f,null));};exports['create']=function(_0x44eb2f,_0x2c9d63){return db['SugarcrmAccount'][_0xfe33('0x48')](_0x44eb2f[_0xfe33('0x49')],{})[_0xfe33('0x27')](respondWithResult(_0x2c9d63,0xc9))[_0xfe33('0x44')](handleError(_0x2c9d63,null));};exports[_0xfe33('0x26')]=function(_0x281262,_0xdc788a){if(_0x281262[_0xfe33('0x49')]['id']){delete _0x281262[_0xfe33('0x49')]['id'];}return db[_0xfe33('0x2c')][_0xfe33('0x47')]({'where':{'id':_0x281262['params']['id']}})[_0xfe33('0x27')](handleEntityNotFound(_0xdc788a,null))[_0xfe33('0x27')](saveUpdates(_0x281262[_0xfe33('0x49')],null))[_0xfe33('0x27')](respondWithResult(_0xdc788a,null))[_0xfe33('0x44')](handleError(_0xdc788a,null));};exports[_0xfe33('0x28')]=function(_0xea96db,_0x20fed2){return db[_0xfe33('0x2c')][_0xfe33('0x47')]({'where':{'id':_0xea96db[_0xfe33('0x46')]['id']}})[_0xfe33('0x27')](handleEntityNotFound(_0x20fed2,null))[_0xfe33('0x27')](removeEntity(_0x20fed2,null))[_0xfe33('0x44')](handleError(_0x20fed2,null));};exports[_0xfe33('0x4a')]=function(_0x15ab8b,_0x129f5a,_0x23e899){var _0x3c104f={};var _0x233937={};var _0x26a7fd;var _0x1ea098;return db[_0xfe33('0x2c')][_0xfe33('0x4b')]({'where':{'id':_0x15ab8b[_0xfe33('0x46')]['id']}})[_0xfe33('0x27')](handleEntityNotFound(_0x129f5a,null))[_0xfe33('0x27')](function(_0x240c09){if(_0x240c09){_0x26a7fd=_0x240c09;_0x233937[_0xfe33('0x36')]=_['keys'](db[_0xfe33('0x4c')][_0xfe33('0x2d')]);_0x233937[_0xfe33('0x30')]=_[_0xfe33('0x31')](_0x15ab8b[_0xfe33('0x30')]);_0x233937['filters']=_[_0xfe33('0x32')](_0x233937[_0xfe33('0x36')],_0x233937[_0xfe33('0x30')]);_0x3c104f[_0xfe33('0x34')]=_['intersection'](_0x233937[_0xfe33('0x36')],qs[_0xfe33('0x33')](_0x15ab8b['query'][_0xfe33('0x33')]));_0x3c104f[_0xfe33('0x34')]=_0x3c104f['attributes'][_0xfe33('0x35')]?_0x3c104f[_0xfe33('0x34')]:_0x233937['model'];_0x3c104f[_0xfe33('0x39')]=qs[_0xfe33('0x3a')](_0x15ab8b[_0xfe33('0x30')][_0xfe33('0x3a')]);_0x3c104f['where']=qs[_0xfe33('0x3b')](_[_0xfe33('0x3c')](_0x15ab8b['query'],_0x233937[_0xfe33('0x3b')]));if(_0x15ab8b['query']['filter']){_0x3c104f[_0xfe33('0x3e')]=_[_0xfe33('0x3d')](_0x3c104f['where'],{'$or':_[_0xfe33('0x2f')](_0x3c104f['attributes'],function(_0x2d0fa9){var _0xe14bb={};_0xe14bb[_0x2d0fa9]={'$like':'%'+_0x15ab8b[_0xfe33('0x30')][_0xfe33('0x4d')]+'%'};return _0xe14bb;})});}_0x3c104f=_[_0xfe33('0x3d')]({},_0x3c104f,_0x15ab8b['options']);return _0x26a7fd['getConfigurations'](_0x3c104f);}})[_0xfe33('0x27')](function(_0x1cee07){if(_0x1cee07){_0x1ea098=_0x1cee07[_0xfe33('0x35')];if(!_0x15ab8b[_0xfe33('0x30')][_0xfe33('0x37')](_0xfe33('0x38'))){_0x3c104f[_0xfe33('0x20')]=qs[_0xfe33('0x20')](_0x15ab8b['query']['limit']);_0x3c104f[_0xfe33('0x1e')]=qs['offset'](_0x15ab8b[_0xfe33('0x30')][_0xfe33('0x1e')]);}return _0x26a7fd[_0xfe33('0x4a')](_0x3c104f);}})[_0xfe33('0x27')](function(_0x289e35){if(_0x289e35){return _0x289e35?{'count':_0x1ea098,'rows':_0x289e35}:null;}})[_0xfe33('0x27')](respondWithResult(_0x129f5a,null))[_0xfe33('0x44')](handleError(_0x129f5a,null));};exports[_0xfe33('0x4e')]=function(_0x7a90f,_0x3ac9ba,_0x2b853a){if(_0x7a90f[_0xfe33('0x49')]['id']){delete _0x7a90f[_0xfe33('0x49')]['id'];}return db[_0xfe33('0x2c')][_0xfe33('0x4b')]({'where':{'id':_0x7a90f[_0xfe33('0x46')]['id']}})[_0xfe33('0x27')](handleEntityNotFound(_0x3ac9ba,null))[_0xfe33('0x27')](function(_0x50bdb4){if(_0x50bdb4){_0x7a90f[_0xfe33('0x49')][_0xfe33('0x4f')]=_0x50bdb4['id'];_0x7a90f['body'][_0xfe33('0x50')]=integrations[_0xfe33('0x51')](_0x7a90f[_0xfe33('0x49')][_0xfe33('0x52')],_0x7a90f['body']['type']);_0x7a90f[_0xfe33('0x49')][_0xfe33('0x53')]=integrations['getDescriptions'](_0x7a90f[_0xfe33('0x49')][_0xfe33('0x52')],_0x7a90f[_0xfe33('0x49')][_0xfe33('0x2e')]);return db[_0xfe33('0x4c')]['create'](_0x7a90f[_0xfe33('0x49')],{'include':[{'model':db[_0xfe33('0x54')],'as':_0xfe33('0x50')},{'model':db[_0xfe33('0x54')],'as':_0xfe33('0x53')}]});}return null;})['then'](respondWithResult(_0x3ac9ba,null))[_0xfe33('0x44')](handleError(_0x3ac9ba,null));};exports[_0xfe33('0x55')]=function(_0x2b628c,_0x562775,_0x530b93){var _0x58bf7='';var _0x391515=['id',_0xfe33('0x2a'),_0xfe33('0x56'),_0xfe33('0x57'),'description',_0xfe33('0x58'),'duration_hours',_0xfe33('0x59'),_0xfe33('0x5a'),_0xfe33('0x5b'),_0xfe33('0x5c'),'direction'];return db['SugarcrmAccount'][_0xfe33('0x4b')]({'where':{'id':_0x2b628c[_0xfe33('0x46')]['id']},'attributes':['id','username',_0xfe33('0x5d'),'remoteUri']})['then'](handleEntityNotFound(_0x562775,null))[_0xfe33('0x27')](function(_0x27bd79){if(_0x27bd79){_0x58bf7=_0x27bd79[_0xfe33('0x5e')];var _0x2d58ef=_0x58bf7[_0xfe33('0x5f')](-0x1);if(_0x2d58ef==='/'){_0x58bf7=_0x58bf7[_0xfe33('0x60')](0x0,_0x58bf7['lastIndexOf'](_0x2d58ef));}return rp({'method':_0xfe33('0x61'),'uri':util[_0xfe33('0x62')](_0xfe33('0x63'),_0x58bf7,_0xfe33('0x64')),'json':!![],'form':{'method':'login','input_type':_0xfe33('0x65'),'response_type':_0xfe33('0x65'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x27bd79[_0xfe33('0x66')],'password':_0x27bd79[_0xfe33('0x5d')],'encryption':_0xfe33('0x67')},'application':_0xfe33('0x68')})}});}})[_0xfe33('0x27')](function(_0x571b5e){if(_0x571b5e&&_0x571b5e['name']!==_0xfe33('0x69')&&_0x571b5e[_0xfe33('0x2a')]!=='Password\x20Expired'){return rp({'method':_0xfe33('0x61'),'uri':util[_0xfe33('0x62')]('%s%s',_0x58bf7,_0xfe33('0x64')),'json':!![],'form':{'method':_0xfe33('0x6a'),'input_type':_0xfe33('0x65'),'response_type':_0xfe33('0x65'),'rest_data':JSON[_0xfe33('0x6b')]({'session':_0x571b5e['id'],'module_name':_0xfe33('0x6c')})}})[_0xfe33('0x27')](function(_0x4303f1){if(_0x4303f1){var _0x4bacfe=_[_0xfe33('0x6d')](_0x4303f1['module_fields']);_['remove'](_0x4bacfe,function(_0x2e19de){return _0x391515[_0xfe33('0x6e')](_0x2e19de[_0xfe33('0x2a')]);});return{'count':_0x4bacfe['length'],'rows':_[_0xfe33('0x2f')](_0x4bacfe,function(_0x5c4d70){return{'id':_0x5c4d70[_0xfe33('0x2a')],'name':_0x5c4d70[_0xfe33('0x6f')],'custom':_[_0xfe33('0x70')](_0x5c4d70[_0xfe33('0x2a')],'_c')?!![]:![],'options':_0x5c4d70[_0xfe33('0x40')]?_[_0xfe33('0x2f')](_[_0xfe33('0x6d')](_0x5c4d70['options']),function(_0x13def2){return{'name':_0x13def2[_0xfe33('0x71')],'value':_0x13def2['name']};}):[]};})};}})[_0xfe33('0x27')](respondWithResult(_0x562775,null))[_0xfe33('0x44')](function(_0x1b377b){var _0x2bd227=_0x2b628c[_0xfe33('0x30')][_0xfe33('0x72')]?0x1f4:_0x1b377b[_0xfe33('0x73')]||0x1f4;logger['error'](_0xfe33('0x74'),_0xfe33('0x55'),_0x2bd227,JSON[_0xfe33('0x6b')](_0x1b377b));delete _0x1b377b['name'];if(_0x2bd227===0x191){_0x2bd227=0x190;}_0x562775[_0xfe33('0x1b')](_0x2bd227)[_0xfe33('0x2b')](_0x2b628c[_0xfe33('0x30')][_0xfe33('0x72')]?{'message':_0xfe33('0x75'),'statusCode':_0x1b377b[_0xfe33('0x73')]}:_0x1b377b);});}else{var _0x288b3b=0x1f4;_0x562775['status'](_0x288b3b)[_0xfe33('0x2b')]({'message':_0xfe33('0x75'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x1df5=['channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_type','direction','username','password','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','Calls','module_fields','remove','includes','label','endsWith','values','value','test','statusCode','error','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','findOne','SugarcrmConfiguration','pick','getConfigurations','nolimit','addConfiguration','Subjects'];(function(_0x14755e,_0x45fea2){var _0x4420f1=function(_0x19e3c7){while(--_0x19e3c7){_0x14755e['push'](_0x14755e['shift']());}};_0x4420f1(++_0x45fea2);}(_0x1df5,0xa4));var _0x51df=function(_0x2cddc9,_0x4b8828){_0x2cddc9=_0x2cddc9-0x0;var _0x1c2bd0=_0x1df5[_0x2cddc9];return _0x1c2bd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x51df('0x0'));var zipdir=require(_0x51df('0x1'));var jsonpatch=require(_0x51df('0x2'));var rp=require(_0x51df('0x3'));var moment=require(_0x51df('0x4'));var BPromise=require(_0x51df('0x5'));var Mustache=require(_0x51df('0x6'));var util=require(_0x51df('0x7'));var path=require('path');var sox=require(_0x51df('0x8'));var csv=require(_0x51df('0x9'));var ejs=require(_0x51df('0xa'));var fs=require('fs');var fs_extra=require(_0x51df('0xb'));var _=require(_0x51df('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x51df('0xd'));var toCsv=require(_0x51df('0x9'));var querystring=require('querystring');var Papa=require(_0x51df('0xe'));var Redis=require(_0x51df('0xf'));var authService=require(_0x51df('0x10'));var qs=require(_0x51df('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x51df('0x12'))(_0x51df('0x13'));var utils=require(_0x51df('0x14'));var config=require(_0x51df('0x15'));var licenseUtil=require(_0x51df('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x51df('0x17'));function respondWithStatusCode(_0x57f1e9,_0x2bd02c){_0x2bd02c=_0x2bd02c||0xcc;return function(_0x258c61){if(_0x258c61){return _0x57f1e9[_0x51df('0x18')](_0x2bd02c);}return _0x57f1e9[_0x51df('0x19')](_0x2bd02c)[_0x51df('0x1a')]();};}function respondWithResult(_0x5d5469,_0x46c933){_0x46c933=_0x46c933||0xc8;return function(_0x2fe0ad){if(_0x2fe0ad){return _0x5d5469[_0x51df('0x19')](_0x46c933)[_0x51df('0x1b')](_0x2fe0ad);}};}function respondWithFilteredResult(_0xef93b4,_0x5707d1){return function(_0x1c5562){if(_0x1c5562){var _0x456ca0=typeof _0x5707d1['offset']===_0x51df('0x1c')&&typeof _0x5707d1[_0x51df('0x1d')]===_0x51df('0x1c');var _0x3df843=_0x1c5562[_0x51df('0x1e')];var _0x4f7eca=_0x456ca0?0x0:_0x5707d1[_0x51df('0x1f')];var _0x3c71d9=_0x456ca0?_0x1c5562['count']:_0x5707d1[_0x51df('0x1f')]+_0x5707d1[_0x51df('0x1d')];var _0x2dd3bf;if(_0x3c71d9>=_0x3df843){_0x3c71d9=_0x3df843;_0x2dd3bf=0xc8;}else{_0x2dd3bf=0xce;}_0xef93b4[_0x51df('0x19')](_0x2dd3bf);return _0xef93b4[_0x51df('0x20')](_0x51df('0x21'),_0x4f7eca+'-'+_0x3c71d9+'/'+_0x3df843)[_0x51df('0x1b')](_0x1c5562);}return null;};}function patchUpdates(_0x5275cd){return function(_0x19d42b){try{jsonpatch[_0x51df('0x22')](_0x19d42b,_0x5275cd,!![]);}catch(_0x1bd704){return BPromise[_0x51df('0x23')](_0x1bd704);}return _0x19d42b['save']();};}function saveUpdates(_0x61c28,_0xa389fb){return function(_0x287421){if(_0x287421){return _0x287421[_0x51df('0x24')](_0x61c28)[_0x51df('0x25')](function(_0x544aa6){return _0x544aa6;});}return null;};}function removeEntity(_0x4e9622,_0x2b2ebc){return function(_0x179f5a){if(_0x179f5a){return _0x179f5a[_0x51df('0x26')]()[_0x51df('0x25')](function(){_0x4e9622[_0x51df('0x19')](0xcc)[_0x51df('0x1a')]();});}};}function handleEntityNotFound(_0x1d1c3f,_0x30fa74){return function(_0x2e2984){if(!_0x2e2984){_0x1d1c3f[_0x51df('0x18')](0x194);}return _0x2e2984;};}function handleError(_0x47875f,_0x1a1467){_0x1a1467=_0x1a1467||0x1f4;return function(_0x4d8a66){logger['error'](_0x4d8a66['stack']);if(_0x4d8a66['name']){delete _0x4d8a66[_0x51df('0x27')];}_0x47875f[_0x51df('0x19')](_0x1a1467)['send'](_0x4d8a66);};}exports[_0x51df('0x28')]=function(_0x152fcf,_0x2f0495){var _0x835879={},_0x5b7fd9={},_0x2452cd={'count':0x0,'rows':[]};var _0x19bb3d=_[_0x51df('0x29')](db[_0x51df('0x2a')][_0x51df('0x2b')],function(_0xe9530c){return{'name':_0xe9530c[_0x51df('0x2c')],'type':_0xe9530c[_0x51df('0x2d')][_0x51df('0x2e')]};});_0x5b7fd9['model']=_[_0x51df('0x29')](_0x19bb3d,_0x51df('0x27'));_0x5b7fd9[_0x51df('0x2f')]=_['keys'](_0x152fcf['query']);_0x5b7fd9[_0x51df('0x30')]=_[_0x51df('0x31')](_0x5b7fd9[_0x51df('0x32')],_0x5b7fd9[_0x51df('0x2f')]);_0x835879[_0x51df('0x33')]=_[_0x51df('0x31')](_0x5b7fd9['model'],qs[_0x51df('0x34')](_0x152fcf['query'][_0x51df('0x34')]));_0x835879[_0x51df('0x33')]=_0x835879[_0x51df('0x33')][_0x51df('0x35')]?_0x835879[_0x51df('0x33')]:_0x5b7fd9[_0x51df('0x32')];if(!_0x152fcf[_0x51df('0x2f')][_0x51df('0x36')]('nolimit')){_0x835879['limit']=qs['limit'](_0x152fcf[_0x51df('0x2f')][_0x51df('0x1d')]);_0x835879[_0x51df('0x1f')]=qs[_0x51df('0x1f')](_0x152fcf[_0x51df('0x2f')][_0x51df('0x1f')]);}_0x835879[_0x51df('0x37')]=qs[_0x51df('0x38')](_0x152fcf['query'][_0x51df('0x38')]);_0x835879[_0x51df('0x39')]=qs[_0x51df('0x30')](_['pick'](_0x152fcf[_0x51df('0x2f')],_0x5b7fd9[_0x51df('0x30')]),_0x19bb3d);if(_0x152fcf[_0x51df('0x2f')][_0x51df('0x3a')]){_0x835879[_0x51df('0x39')]=_['merge'](_0x835879[_0x51df('0x39')],{'$or':_[_0x51df('0x29')](_0x19bb3d,function(_0x483471){if(_0x483471[_0x51df('0x2d')]!==_0x51df('0x3b')){var _0x4a35b1={};_0x4a35b1[_0x483471['name']]={'$like':'%'+_0x152fcf['query'][_0x51df('0x3a')]+'%'};return _0x4a35b1;}})});}_0x835879=_[_0x51df('0x3c')]({},_0x835879,_0x152fcf[_0x51df('0x3d')]);var _0x4f380e={'where':_0x835879[_0x51df('0x39')]};return db[_0x51df('0x2a')]['count'](_0x4f380e)[_0x51df('0x25')](function(_0x29bde6){_0x2452cd[_0x51df('0x1e')]=_0x29bde6;if(_0x152fcf['query'][_0x51df('0x3e')]){_0x835879['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0x51df('0x3f')](_0x835879);})[_0x51df('0x25')](function(_0x251650){_0x2452cd[_0x51df('0x40')]=_0x251650;return _0x2452cd;})[_0x51df('0x25')](respondWithFilteredResult(_0x2f0495,_0x835879))[_0x51df('0x41')](handleError(_0x2f0495,null));};exports[_0x51df('0x42')]=function(_0x3dab20,_0x1d8da7){var _0x3d15e5={'raw':![],'where':{'id':_0x3dab20[_0x51df('0x43')]['id']}},_0x353637={};_0x353637[_0x51df('0x32')]=_['keys'](db[_0x51df('0x2a')]['rawAttributes']);_0x353637['query']=_[_0x51df('0x44')](_0x3dab20['query']);_0x353637['filters']=_['intersection'](_0x353637[_0x51df('0x32')],_0x353637['query']);_0x3d15e5[_0x51df('0x33')]=_[_0x51df('0x31')](_0x353637['model'],qs[_0x51df('0x34')](_0x3dab20[_0x51df('0x2f')][_0x51df('0x34')]));_0x3d15e5['attributes']=_0x3d15e5[_0x51df('0x33')][_0x51df('0x35')]?_0x3d15e5[_0x51df('0x33')]:_0x353637[_0x51df('0x32')];if(_0x3dab20[_0x51df('0x2f')]['includeAll']){_0x3d15e5[_0x51df('0x45')]=[{'all':!![]}];}_0x3d15e5=_[_0x51df('0x3c')]({},_0x3d15e5,_0x3dab20['options']);return db[_0x51df('0x2a')][_0x51df('0x46')](_0x3d15e5)[_0x51df('0x25')](handleEntityNotFound(_0x1d8da7,null))['then'](respondWithResult(_0x1d8da7,null))['catch'](handleError(_0x1d8da7,null));};exports[_0x51df('0x47')]=function(_0x36603e,_0x1c6a67){return db[_0x51df('0x2a')][_0x51df('0x47')](_0x36603e['body'],{})[_0x51df('0x25')](respondWithResult(_0x1c6a67,0xc9))[_0x51df('0x41')](handleError(_0x1c6a67,null));};exports[_0x51df('0x24')]=function(_0x4b6e41,_0x62e2f2){if(_0x4b6e41[_0x51df('0x48')]['id']){delete _0x4b6e41[_0x51df('0x48')]['id'];}return db[_0x51df('0x2a')][_0x51df('0x46')]({'where':{'id':_0x4b6e41['params']['id']}})['then'](handleEntityNotFound(_0x62e2f2,null))['then'](saveUpdates(_0x4b6e41[_0x51df('0x48')],null))[_0x51df('0x25')](respondWithResult(_0x62e2f2,null))['catch'](handleError(_0x62e2f2,null));};exports['destroy']=function(_0x44fc14,_0x5704f5){return db[_0x51df('0x2a')][_0x51df('0x46')]({'where':{'id':_0x44fc14[_0x51df('0x43')]['id']}})[_0x51df('0x25')](handleEntityNotFound(_0x5704f5,null))[_0x51df('0x25')](removeEntity(_0x5704f5,null))[_0x51df('0x41')](handleError(_0x5704f5,null));};exports['getConfigurations']=function(_0x4b6b40,_0x1214b8,_0x307719){var _0x580292={};var _0xf69a94={};var _0x1e5ed5;var _0x3ec728;return db[_0x51df('0x2a')][_0x51df('0x49')]({'where':{'id':_0x4b6b40[_0x51df('0x43')]['id']}})[_0x51df('0x25')](handleEntityNotFound(_0x1214b8,null))['then'](function(_0x1b332f){if(_0x1b332f){_0x1e5ed5=_0x1b332f;_0xf69a94['model']=_['keys'](db[_0x51df('0x4a')][_0x51df('0x2b')]);_0xf69a94[_0x51df('0x2f')]=_[_0x51df('0x44')](_0x4b6b40[_0x51df('0x2f')]);_0xf69a94[_0x51df('0x30')]=_[_0x51df('0x31')](_0xf69a94[_0x51df('0x32')],_0xf69a94['query']);_0x580292[_0x51df('0x33')]=_[_0x51df('0x31')](_0xf69a94[_0x51df('0x32')],qs['fields'](_0x4b6b40['query'][_0x51df('0x34')]));_0x580292[_0x51df('0x33')]=_0x580292['attributes'][_0x51df('0x35')]?_0x580292[_0x51df('0x33')]:_0xf69a94[_0x51df('0x32')];_0x580292[_0x51df('0x37')]=qs['sort'](_0x4b6b40[_0x51df('0x2f')]['sort']);_0x580292[_0x51df('0x39')]=qs['filters'](_[_0x51df('0x4b')](_0x4b6b40[_0x51df('0x2f')],_0xf69a94['filters']));if(_0x4b6b40[_0x51df('0x2f')]['filter']){_0x580292['where']=_['merge'](_0x580292[_0x51df('0x39')],{'$or':_['map'](_0x580292['attributes'],function(_0x3f3f63){var _0xd0b222={};_0xd0b222[_0x3f3f63]={'$like':'%'+_0x4b6b40['query']['filter']+'%'};return _0xd0b222;})});}_0x580292=_[_0x51df('0x3c')]({},_0x580292,_0x4b6b40[_0x51df('0x3d')]);return _0x1e5ed5[_0x51df('0x4c')](_0x580292);}})[_0x51df('0x25')](function(_0x4c5dfc){if(_0x4c5dfc){_0x3ec728=_0x4c5dfc[_0x51df('0x35')];if(!_0x4b6b40[_0x51df('0x2f')]['hasOwnProperty'](_0x51df('0x4d'))){_0x580292['limit']=qs[_0x51df('0x1d')](_0x4b6b40[_0x51df('0x2f')][_0x51df('0x1d')]);_0x580292[_0x51df('0x1f')]=qs[_0x51df('0x1f')](_0x4b6b40[_0x51df('0x2f')][_0x51df('0x1f')]);}return _0x1e5ed5[_0x51df('0x4c')](_0x580292);}})[_0x51df('0x25')](function(_0x4df094){if(_0x4df094){return _0x4df094?{'count':_0x3ec728,'rows':_0x4df094}:null;}})[_0x51df('0x25')](respondWithResult(_0x1214b8,null))[_0x51df('0x41')](handleError(_0x1214b8,null));};exports[_0x51df('0x4e')]=function(_0x4d4a5f,_0x5ea375,_0x4abf8e){if(_0x4d4a5f[_0x51df('0x48')]['id']){delete _0x4d4a5f[_0x51df('0x48')]['id'];}return db[_0x51df('0x2a')]['findOne']({'where':{'id':_0x4d4a5f['params']['id']}})['then'](handleEntityNotFound(_0x5ea375,null))[_0x51df('0x25')](function(_0x17741a){if(_0x17741a){_0x4d4a5f[_0x51df('0x48')]['AccountId']=_0x17741a['id'];_0x4d4a5f[_0x51df('0x48')][_0x51df('0x4f')]=integrations['getSubjects'](_0x4d4a5f[_0x51df('0x48')][_0x51df('0x50')],_0x4d4a5f[_0x51df('0x48')][_0x51df('0x2d')]);_0x4d4a5f[_0x51df('0x48')]['Descriptions']=integrations[_0x51df('0x51')](_0x4d4a5f[_0x51df('0x48')]['channel'],_0x4d4a5f[_0x51df('0x48')][_0x51df('0x2d')]);return db[_0x51df('0x4a')][_0x51df('0x47')](_0x4d4a5f[_0x51df('0x48')],{'include':[{'model':db['SugarcrmField'],'as':_0x51df('0x4f')},{'model':db[_0x51df('0x52')],'as':_0x51df('0x53')}]});}return null;})[_0x51df('0x25')](respondWithResult(_0x5ea375,null))[_0x51df('0x41')](handleError(_0x5ea375,null));};exports[_0x51df('0x54')]=function(_0x371e45,_0x31eda3,_0x5f0fef){var _0x40254b='';var _0x531188=['id',_0x51df('0x27'),_0x51df('0x55'),_0x51df('0x56'),_0x51df('0x57'),_0x51df('0x58'),'duration_hours',_0x51df('0x59'),_0x51df('0x5a'),_0x51df('0x5b'),'parent_name',_0x51df('0x5c')];return db[_0x51df('0x2a')]['findOne']({'where':{'id':_0x371e45[_0x51df('0x43')]['id']},'attributes':['id',_0x51df('0x5d'),_0x51df('0x5e'),_0x51df('0x5f')]})[_0x51df('0x25')](handleEntityNotFound(_0x31eda3,null))[_0x51df('0x25')](function(_0x125da4){if(_0x125da4){_0x40254b=_0x125da4['remoteUri'];var _0x166958=_0x40254b[_0x51df('0x60')](-0x1);if(_0x166958==='/'){_0x40254b=_0x40254b[_0x51df('0x61')](0x0,_0x40254b['lastIndexOf'](_0x166958));}return rp({'method':_0x51df('0x62'),'uri':util[_0x51df('0x63')](_0x51df('0x64'),_0x40254b,_0x51df('0x65')),'json':!![],'form':{'method':_0x51df('0x66'),'input_type':_0x51df('0x67'),'response_type':_0x51df('0x67'),'rest_data':JSON[_0x51df('0x68')]({'user_auth':{'user_name':_0x125da4[_0x51df('0x5d')],'password':_0x125da4[_0x51df('0x5e')],'encryption':_0x51df('0x69')},'application':_0x51df('0x6a')})}});}})[_0x51df('0x25')](function(_0x3b6d6e){if(_0x3b6d6e&&_0x3b6d6e[_0x51df('0x27')]!==_0x51df('0x6b')&&_0x3b6d6e['name']!==_0x51df('0x6c')){return rp({'method':_0x51df('0x62'),'uri':util[_0x51df('0x63')](_0x51df('0x64'),_0x40254b,_0x51df('0x65')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x51df('0x67'),'response_type':_0x51df('0x67'),'rest_data':JSON['stringify']({'session':_0x3b6d6e['id'],'module_name':_0x51df('0x6d')})}})['then'](function(_0x1273d0){if(_0x1273d0){var _0x219f1e=_['values'](_0x1273d0[_0x51df('0x6e')]);_[_0x51df('0x6f')](_0x219f1e,function(_0x5adf8b){return _0x531188[_0x51df('0x70')](_0x5adf8b[_0x51df('0x27')]);});return{'count':_0x219f1e['length'],'rows':_['map'](_0x219f1e,function(_0x6820d2){return{'id':_0x6820d2[_0x51df('0x27')],'name':_0x6820d2[_0x51df('0x71')],'custom':_[_0x51df('0x72')](_0x6820d2[_0x51df('0x27')],'_c')?!![]:![],'options':_0x6820d2['options']?_[_0x51df('0x29')](_[_0x51df('0x73')](_0x6820d2[_0x51df('0x3d')]),function(_0x3c734c){return{'name':_0x3c734c[_0x51df('0x74')],'value':_0x3c734c[_0x51df('0x27')]};}):[]};})};}})[_0x51df('0x25')](respondWithResult(_0x31eda3,null))[_0x51df('0x41')](function(_0x56bb7d){var _0x1641ab=_0x371e45[_0x51df('0x2f')][_0x51df('0x75')]?0x1f4:_0x56bb7d[_0x51df('0x76')]||0x1f4;logger[_0x51df('0x77')]('getFields,\x20%s,\x20%s,\x20%s',_0x51df('0x54'),_0x1641ab,JSON[_0x51df('0x68')](_0x56bb7d));delete _0x56bb7d[_0x51df('0x27')];if(_0x1641ab===0x191){_0x1641ab=0x190;}_0x31eda3[_0x51df('0x19')](_0x1641ab)[_0x51df('0x78')](_0x371e45[_0x51df('0x2f')]['test']?{'message':_0x51df('0x79'),'statusCode':_0x56bb7d[_0x51df('0x76')]}:_0x56bb7d);});}else{var _0x7187d8=0x1f4;_0x31eda3[_0x51df('0x19')](_0x7187d8)['send']({'message':_0x51df('0x79'),'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 0e1b27e..218b48e 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 _0x967b=['SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x3ddf73,_0x17fb51){var _0x5930e5=function(_0x41d4f9){while(--_0x41d4f9){_0x3ddf73['push'](_0x3ddf73['shift']());}};_0x5930e5(++_0x17fb51);}(_0x967b,0x9c));var _0xb967=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x967b[_0x4c445a];return _0x2f611c;};'use strict';var _=require(_0xb967('0x0'));var util=require(_0xb967('0x1'));var logger=require('../../config/logger')(_0xb967('0x2'));var moment=require(_0xb967('0x3'));var BPromise=require(_0xb967('0x4'));var rp=require(_0xb967('0x5'));var fs=require('fs');var path=require(_0xb967('0x6'));var rimraf=require('rimraf');var config=require(_0xb967('0x7'));var attributes=require(_0xb967('0x8'));var integrations=require(_0xb967('0x9'));module[_0xb967('0xa')]=function(_0x282fdd,_0x5a333a){return _0x282fdd[_0xb967('0xb')](_0xb967('0xc'),attributes,{'tableName':_0xb967('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1d7=['moment','rimraf','../../config/environment','./intSugarcrmAccount.attributes','define','SugarcrmAccount','int_sugarcrm_accounts','../../config/logger','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc1d7,0x1ed));var _0x7c1d=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xc1d7[_0x819464];return _0x49dcc0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7c1d('0x0'))(_0x7c1d('0x1'));var moment=require(_0x7c1d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7c1d('0x3'));var config=require(_0x7c1d('0x4'));var attributes=require(_0x7c1d('0x5'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x219d77,_0x226591){return _0x219d77[_0x7c1d('0x6')](_0x7c1d('0x7'),attributes,{'tableName':_0x7c1d('0x8'),'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 d0b9d75..a2888d4 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 _0xbc98=['request\x20sent','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','limit','include','model','attributes','map','ShowSugarcrmAccount','find','debug','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s,\x20%s'];(function(_0x183ab8,_0x4cb72d){var _0x40ef93=function(_0x119990){while(--_0x119990){_0x183ab8['push'](_0x183ab8['shift']());}};_0x40ef93(++_0x4cb72d);}(_0xbc98,0xee));var _0x8bc9=function(_0x2325bf,_0x5b6383){_0x2325bf=_0x2325bf-0x0;var _0x586680=_0xbc98[_0x2325bf];return _0x586680;};'use strict';var _=require('lodash');var util=require(_0x8bc9('0x0'));var moment=require(_0x8bc9('0x1'));var BPromise=require(_0x8bc9('0x2'));var rs=require(_0x8bc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8bc9('0x4'))(_0x8bc9('0x5'));var config=require(_0x8bc9('0x6'));var jayson=require(_0x8bc9('0x7'));var client=jayson[_0x8bc9('0x8')][_0x8bc9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1947a6,_0x3bd7bb,_0x4ec5e1){return new BPromise(function(_0x15135d,_0xbafcfd){return client[_0x8bc9('0xa')](_0x1947a6,_0x4ec5e1)[_0x8bc9('0xb')](function(_0x1d6bc6){logger[_0x8bc9('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x3bd7bb,'request\x20sent');logger['debug'](_0x8bc9('0xd'),_0x3bd7bb,_0x8bc9('0xe'),JSON[_0x8bc9('0xf')](_0x1d6bc6));if(_0x1d6bc6[_0x8bc9('0x10')]){if(_0x1d6bc6[_0x8bc9('0x10')][_0x8bc9('0x11')]===0x1f4){logger[_0x8bc9('0x10')](_0x8bc9('0x12'),_0x3bd7bb,_0x1d6bc6['error'][_0x8bc9('0x13')]);return _0xbafcfd(_0x1d6bc6[_0x8bc9('0x10')][_0x8bc9('0x13')]);}logger[_0x8bc9('0x10')](_0x8bc9('0x12'),_0x3bd7bb,_0x1d6bc6[_0x8bc9('0x10')]['message']);return _0x15135d(_0x1d6bc6['error'][_0x8bc9('0x13')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x3bd7bb,_0x8bc9('0xe'));_0x15135d(_0x1d6bc6[_0x8bc9('0x14')][_0x8bc9('0x13')]);}})[_0x8bc9('0x15')](function(_0x4a8f44){logger[_0x8bc9('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x3bd7bb,_0x4a8f44);_0xbafcfd(_0x4a8f44);});});}exports[_0x8bc9('0x16')]=function(_0x571509){var _0x21e599=this;return new Promise(function(_0x593dff,_0x67c669){return db[_0x8bc9('0x17')][_0x8bc9('0x18')]({'raw':_0x571509[_0x8bc9('0x19')]?_0x571509[_0x8bc9('0x19')][_0x8bc9('0x1a')]===undefined?!![]:![]:!![],'where':_0x571509['options']?_0x571509['options'][_0x8bc9('0x1b')]||null:null,'attributes':_0x571509[_0x8bc9('0x19')]?_0x571509[_0x8bc9('0x19')]['attributes']||null:null,'limit':_0x571509['options']?_0x571509[_0x8bc9('0x19')][_0x8bc9('0x1c')]||null:null,'include':_0x571509[_0x8bc9('0x19')]?_0x571509[_0x8bc9('0x19')][_0x8bc9('0x1d')]?_['map'](_0x571509[_0x8bc9('0x19')][_0x8bc9('0x1d')],function(_0x3de8a1){return{'model':db[_0x3de8a1[_0x8bc9('0x1e')]],'as':_0x3de8a1['as'],'attributes':_0x3de8a1[_0x8bc9('0x1f')],'include':_0x3de8a1[_0x8bc9('0x1d')]?_[_0x8bc9('0x20')](_0x3de8a1[_0x8bc9('0x1d')],function(_0x196116){return{'model':db[_0x196116['model']],'as':_0x196116['as'],'attributes':_0x196116[_0x8bc9('0x1f')],'include':_0x196116[_0x8bc9('0x1d')]?_[_0x8bc9('0x20')](_0x196116[_0x8bc9('0x1d')],function(_0x920062){return{'model':db[_0x920062[_0x8bc9('0x1e')]],'as':_0x920062['as'],'attributes':_0x920062[_0x8bc9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8bc9('0xb')](function(_0x1592bb){logger['info'](_0x8bc9('0x16'),_0x571509);logger['debug'](_0x8bc9('0x16'),_0x571509,JSON[_0x8bc9('0xf')](_0x1592bb));_0x593dff(_0x1592bb);})[_0x8bc9('0x15')](function(_0x25ff03){logger[_0x8bc9('0x10')]('GetSugarcrmAccount',_0x25ff03[_0x8bc9('0x13')],_0x571509);_0x67c669(_0x21e599['error'](0x1f4,_0x25ff03[_0x8bc9('0x13')]));});});};exports[_0x8bc9('0x21')]=function(_0x1c833a){var _0x19ce76=this;return new Promise(function(_0x1ccd04,_0x6c4032){return db[_0x8bc9('0x17')][_0x8bc9('0x22')]({'raw':_0x1c833a[_0x8bc9('0x19')]?_0x1c833a[_0x8bc9('0x19')][_0x8bc9('0x1a')]===undefined?!![]:![]:!![],'where':_0x1c833a[_0x8bc9('0x19')]?_0x1c833a[_0x8bc9('0x19')][_0x8bc9('0x1b')]||null:null,'attributes':_0x1c833a[_0x8bc9('0x19')]?_0x1c833a[_0x8bc9('0x19')][_0x8bc9('0x1f')]||null:null,'include':_0x1c833a[_0x8bc9('0x19')]?_0x1c833a[_0x8bc9('0x19')]['include']?_['map'](_0x1c833a[_0x8bc9('0x19')][_0x8bc9('0x1d')],function(_0x23737d){return{'model':db[_0x23737d['model']],'as':_0x23737d['as'],'attributes':_0x23737d[_0x8bc9('0x1f')],'include':_0x23737d[_0x8bc9('0x1d')]?_[_0x8bc9('0x20')](_0x23737d['include'],function(_0x1825d9){return{'model':db[_0x1825d9[_0x8bc9('0x1e')]],'as':_0x1825d9['as'],'attributes':_0x1825d9[_0x8bc9('0x1f')],'include':_0x1825d9[_0x8bc9('0x1d')]?_[_0x8bc9('0x20')](_0x1825d9['include'],function(_0x36216f){return{'model':db[_0x36216f[_0x8bc9('0x1e')]],'as':_0x36216f['as'],'attributes':_0x36216f[_0x8bc9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8bc9('0xb')](function(_0x1d06a7){logger[_0x8bc9('0xc')](_0x8bc9('0x21'),_0x1c833a);logger[_0x8bc9('0x23')](_0x8bc9('0x21'),_0x1c833a,JSON[_0x8bc9('0xf')](_0x1d06a7));_0x1ccd04(_0x1d06a7);})[_0x8bc9('0x15')](function(_0x1f3efb){logger[_0x8bc9('0x10')](_0x8bc9('0x21'),_0x1f3efb['message'],_0x1c833a);_0x6c4032(_0x19ce76[_0x8bc9('0x10')](0x1f4,_0x1f3efb['message']));});});}; \ No newline at end of file +var _0xc809=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSugarcrmAccount','findAll','options','raw','where','attributes','limit','map','model','include','catch','ShowSugarcrmAccount','SugarcrmAccount','find','lodash','bluebird','randomstring','ioredis'];(function(_0x2b80d1,_0x427e96){var _0x12f594=function(_0x3e6eab){while(--_0x3e6eab){_0x2b80d1['push'](_0x2b80d1['shift']());}};_0x12f594(++_0x427e96);}(_0xc809,0xf1));var _0x9c80=function(_0x31b336,_0x4e2523){_0x31b336=_0x31b336-0x0;var _0x4a8137=_0xc809[_0x31b336];return _0x4a8137;};'use strict';var _=require(_0x9c80('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9c80('0x1'));var rs=require(_0x9c80('0x2'));var fs=require('fs');var Redis=require(_0x9c80('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c80('0x4'));var logger=require(_0x9c80('0x5'))('rpc');var config=require(_0x9c80('0x6'));var jayson=require(_0x9c80('0x7'));var client=jayson[_0x9c80('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf66e15,_0x1d0c68,_0x4626b5){return new BPromise(function(_0x57b4fe,_0x213084){return client[_0x9c80('0x9')](_0xf66e15,_0x4626b5)[_0x9c80('0xa')](function(_0x4a56c9){logger[_0x9c80('0xb')](_0x9c80('0xc'),_0x1d0c68,_0x9c80('0xd'));logger[_0x9c80('0xe')](_0x9c80('0xf'),_0x1d0c68,_0x9c80('0xd'),JSON[_0x9c80('0x10')](_0x4a56c9));if(_0x4a56c9[_0x9c80('0x11')]){if(_0x4a56c9['error'][_0x9c80('0x12')]===0x1f4){logger[_0x9c80('0x11')](_0x9c80('0xc'),_0x1d0c68,_0x4a56c9[_0x9c80('0x11')][_0x9c80('0x13')]);return _0x213084(_0x4a56c9[_0x9c80('0x11')][_0x9c80('0x13')]);}logger[_0x9c80('0x11')](_0x9c80('0xc'),_0x1d0c68,_0x4a56c9[_0x9c80('0x11')][_0x9c80('0x13')]);return _0x57b4fe(_0x4a56c9[_0x9c80('0x11')][_0x9c80('0x13')]);}else{logger['info'](_0x9c80('0xc'),_0x1d0c68,'request\x20sent');_0x57b4fe(_0x4a56c9[_0x9c80('0x14')][_0x9c80('0x13')]);}})['catch'](function(_0x44ea63){logger[_0x9c80('0x11')](_0x9c80('0xc'),_0x1d0c68,_0x44ea63);_0x213084(_0x44ea63);});});}exports[_0x9c80('0x15')]=function(_0x299451){var _0x55ab67=this;return new Promise(function(_0x4aa61d,_0x406eb2){return db['SugarcrmAccount'][_0x9c80('0x16')]({'raw':_0x299451[_0x9c80('0x17')]?_0x299451['options'][_0x9c80('0x18')]===undefined?!![]:![]:!![],'where':_0x299451['options']?_0x299451[_0x9c80('0x17')][_0x9c80('0x19')]||null:null,'attributes':_0x299451[_0x9c80('0x17')]?_0x299451['options'][_0x9c80('0x1a')]||null:null,'limit':_0x299451['options']?_0x299451[_0x9c80('0x17')][_0x9c80('0x1b')]||null:null,'include':_0x299451[_0x9c80('0x17')]?_0x299451[_0x9c80('0x17')]['include']?_[_0x9c80('0x1c')](_0x299451['options']['include'],function(_0x25d7a9){return{'model':db[_0x25d7a9[_0x9c80('0x1d')]],'as':_0x25d7a9['as'],'attributes':_0x25d7a9[_0x9c80('0x1a')],'include':_0x25d7a9[_0x9c80('0x1e')]?_[_0x9c80('0x1c')](_0x25d7a9[_0x9c80('0x1e')],function(_0x293b2e){return{'model':db[_0x293b2e[_0x9c80('0x1d')]],'as':_0x293b2e['as'],'attributes':_0x293b2e[_0x9c80('0x1a')],'include':_0x293b2e[_0x9c80('0x1e')]?_[_0x9c80('0x1c')](_0x293b2e[_0x9c80('0x1e')],function(_0x2aa387){return{'model':db[_0x2aa387[_0x9c80('0x1d')]],'as':_0x2aa387['as'],'attributes':_0x2aa387['attributes']};}):[]};}):[]};}):[]:[]})[_0x9c80('0xa')](function(_0x2f1450){logger[_0x9c80('0xb')]('GetSugarcrmAccount',_0x299451);logger[_0x9c80('0xe')](_0x9c80('0x15'),_0x299451,JSON['stringify'](_0x2f1450));_0x4aa61d(_0x2f1450);})[_0x9c80('0x1f')](function(_0x412c4b){logger['error'](_0x9c80('0x15'),_0x412c4b[_0x9c80('0x13')],_0x299451);_0x406eb2(_0x55ab67[_0x9c80('0x11')](0x1f4,_0x412c4b[_0x9c80('0x13')]));});});};exports[_0x9c80('0x20')]=function(_0x19dae4){var _0x119ba9=this;return new Promise(function(_0x4051a9,_0x5659de){return db[_0x9c80('0x21')][_0x9c80('0x22')]({'raw':_0x19dae4[_0x9c80('0x17')]?_0x19dae4[_0x9c80('0x17')][_0x9c80('0x18')]===undefined?!![]:![]:!![],'where':_0x19dae4[_0x9c80('0x17')]?_0x19dae4[_0x9c80('0x17')][_0x9c80('0x19')]||null:null,'attributes':_0x19dae4[_0x9c80('0x17')]?_0x19dae4[_0x9c80('0x17')]['attributes']||null:null,'include':_0x19dae4[_0x9c80('0x17')]?_0x19dae4['options'][_0x9c80('0x1e')]?_[_0x9c80('0x1c')](_0x19dae4['options'][_0x9c80('0x1e')],function(_0x4edf36){return{'model':db[_0x4edf36[_0x9c80('0x1d')]],'as':_0x4edf36['as'],'attributes':_0x4edf36['attributes'],'include':_0x4edf36[_0x9c80('0x1e')]?_['map'](_0x4edf36['include'],function(_0x13f989){return{'model':db[_0x13f989[_0x9c80('0x1d')]],'as':_0x13f989['as'],'attributes':_0x13f989[_0x9c80('0x1a')],'include':_0x13f989[_0x9c80('0x1e')]?_[_0x9c80('0x1c')](_0x13f989[_0x9c80('0x1e')],function(_0x2151a2){return{'model':db[_0x2151a2['model']],'as':_0x2151a2['as'],'attributes':_0x2151a2[_0x9c80('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc16f2e){logger[_0x9c80('0xb')]('ShowSugarcrmAccount',_0x19dae4);logger[_0x9c80('0xe')]('ShowSugarcrmAccount',_0x19dae4,JSON[_0x9c80('0x10')](_0xc16f2e));_0x4051a9(_0xc16f2e);})[_0x9c80('0x1f')](function(_0x2bb39c){logger[_0x9c80('0x11')](_0x9c80('0x20'),_0x2bb39c[_0x9c80('0x13')],_0x19dae4);_0x5659de(_0x119ba9['error'](0x1f4,_0x2bb39c[_0x9c80('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 9ab9f5e..f19005d 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 _0x43af=['/:id','isAuthenticated','show','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0x43af,0x162));var _0xf43a=function(_0x49e880,_0x204c78){_0x49e880=_0x49e880-0x0;var _0x107725=_0x43af[_0x49e880];return _0x107725;};'use strict';var multer=require('multer');var util=require(_0xf43a('0x0'));var path=require('path');var timeout=require(_0xf43a('0x1'));var express=require('express');var router=express[_0xf43a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf43a('0x3'));var interaction=require(_0xf43a('0x4'));var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router[_0xf43a('0x5')]('/',auth['isAuthenticated'](),controller[_0xf43a('0x6')]);router[_0xf43a('0x5')](_0xf43a('0x7'),auth[_0xf43a('0x8')](),controller[_0xf43a('0x9')]);router[_0xf43a('0x5')]('/:id/fields',auth['isAuthenticated'](),controller[_0xf43a('0xa')]);router[_0xf43a('0x5')]('/:id/subjects',auth[_0xf43a('0x8')](),controller[_0xf43a('0xb')]);router[_0xf43a('0x5')](_0xf43a('0xc'),auth[_0xf43a('0x8')](),controller[_0xf43a('0xd')]);router[_0xf43a('0xe')]('/',auth['isAuthenticated'](),controller[_0xf43a('0xf')]);router[_0xf43a('0x10')](_0xf43a('0x7'),auth[_0xf43a('0x8')](),controller['update']);router['delete'](_0xf43a('0x7'),auth[_0xf43a('0x8')](),controller[_0xf43a('0x11')]);module[_0xf43a('0x12')]=router; \ No newline at end of file +var _0xd9a0=['getSubjects','/:id/descriptions','getDescriptions','create','put','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects'];(function(_0x570973,_0x51db7e){var _0x4e2c87=function(_0x1e5558){while(--_0x1e5558){_0x570973['push'](_0x570973['shift']());}};_0x4e2c87(++_0x51db7e);}(_0xd9a0,0x183));var _0x0d9a=function(_0x555d4d,_0x828096){_0x555d4d=_0x555d4d-0x0;var _0x4966ed=_0xd9a0[_0x555d4d];return _0x4966ed;};'use strict';var multer=require(_0x0d9a('0x0'));var util=require(_0x0d9a('0x1'));var path=require('path');var timeout=require(_0x0d9a('0x2'));var express=require(_0x0d9a('0x3'));var router=express['Router']();var fs_extra=require(_0x0d9a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0d9a('0x5'));var config=require('../../config/environment');var controller=require(_0x0d9a('0x6'));router[_0x0d9a('0x7')]('/',auth[_0x0d9a('0x8')](),controller[_0x0d9a('0x9')]);router['get'](_0x0d9a('0xa'),auth['isAuthenticated'](),controller[_0x0d9a('0xb')]);router[_0x0d9a('0x7')]('/:id/fields',auth[_0x0d9a('0x8')](),controller['getFields']);router[_0x0d9a('0x7')](_0x0d9a('0xc'),auth[_0x0d9a('0x8')](),controller[_0x0d9a('0xd')]);router[_0x0d9a('0x7')](_0x0d9a('0xe'),auth['isAuthenticated'](),controller[_0x0d9a('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0d9a('0x10')]);router[_0x0d9a('0x11')]('/:id',auth[_0x0d9a('0x8')](),controller['update']);router['delete'](_0x0d9a('0xa'),auth[_0x0d9a('0x8')](),controller[_0x0d9a('0x12')]);module[_0x0d9a('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 93417b1..37fe13e 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 _0xb20f=['exports','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb20f,0x149));var _0xfb20=function(_0x46feef,_0x2c7bf8){_0x46feef=_0x46feef-0x0;var _0x4d545b=_0xb20f[_0x46feef];return _0x4d545b;};'use strict';var Sequelize=require(_0xfb20('0x0'));module[_0xfb20('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x01b0=['exports'];(function(_0x413aa2,_0x46a0e1){var _0x1d3639=function(_0x53391d){while(--_0x53391d){_0x413aa2['push'](_0x413aa2['shift']());}};_0x1d3639(++_0x46a0e1);}(_0x01b0,0xb3));var _0x001b=function(_0x1bab7d,_0x422688){_0x1bab7d=_0x1bab7d-0x0;var _0x42e972=_0x01b0[_0x1bab7d];return _0x42e972;};'use strict';var Sequelize=require('sequelize');module[_0x001b('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index c4e9114..3ce0801 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 _0x041a=['model','query','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','fields','find','create','body','update','getFields','findOne','SugarcrmField','nolimit','getSubjects','getDescriptions','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','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','index','SugarcrmConfiguration','rawAttributes','fieldName','map','keys','filters','intersection'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x041a,0x16e));var _0xa041=function(_0x5bd50e,_0x4dee56){_0x5bd50e=_0x5bd50e-0x0;var _0x42f9e5=_0x041a[_0x5bd50e];return _0x42f9e5;};'use strict';var emlformat=require(_0xa041('0x0'));var rimraf=require(_0xa041('0x1'));var zipdir=require(_0xa041('0x2'));var jsonpatch=require(_0xa041('0x3'));var rp=require(_0xa041('0x4'));var moment=require(_0xa041('0x5'));var BPromise=require(_0xa041('0x6'));var Mustache=require(_0xa041('0x7'));var util=require(_0xa041('0x8'));var path=require(_0xa041('0x9'));var sox=require(_0xa041('0xa'));var csv=require('to-csv');var ejs=require(_0xa041('0xb'));var fs=require('fs');var fs_extra=require(_0xa041('0xc'));var _=require(_0xa041('0xd'));var squel=require(_0xa041('0xe'));var crypto=require(_0xa041('0xf'));var jsforce=require(_0xa041('0x10'));var deskjs=require(_0xa041('0x11'));var toCsv=require('to-csv');var querystring=require(_0xa041('0x12'));var Papa=require(_0xa041('0x13'));var Redis=require(_0xa041('0x14'));var authService=require(_0xa041('0x15'));var qs=require(_0xa041('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa041('0x17'));var logger=require(_0xa041('0x18'))('api');var utils=require(_0xa041('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xa041('0x1a'));var db=require(_0xa041('0x1b'))['db'];function respondWithStatusCode(_0x532def,_0x40afdb){_0x40afdb=_0x40afdb||0xcc;return function(_0x4b8346){if(_0x4b8346){return _0x532def['sendStatus'](_0x40afdb);}return _0x532def[_0xa041('0x1c')](_0x40afdb)['end']();};}function respondWithResult(_0x2e5661,_0x59379a){_0x59379a=_0x59379a||0xc8;return function(_0x21fd01){if(_0x21fd01){return _0x2e5661[_0xa041('0x1c')](_0x59379a)[_0xa041('0x1d')](_0x21fd01);}};}function respondWithFilteredResult(_0x283712,_0x5c8b97){return function(_0x5a514c){if(_0x5a514c){var _0x20bf8a=typeof _0x5c8b97[_0xa041('0x1e')]===_0xa041('0x1f')&&typeof _0x5c8b97[_0xa041('0x20')]==='undefined';var _0x322834=_0x5a514c[_0xa041('0x21')];var _0x403b37=_0x20bf8a?0x0:_0x5c8b97[_0xa041('0x1e')];var _0x52597e=_0x20bf8a?_0x5a514c[_0xa041('0x21')]:_0x5c8b97['offset']+_0x5c8b97[_0xa041('0x20')];var _0x680f6;if(_0x52597e>=_0x322834){_0x52597e=_0x322834;_0x680f6=0xc8;}else{_0x680f6=0xce;}_0x283712[_0xa041('0x1c')](_0x680f6);return _0x283712[_0xa041('0x22')](_0xa041('0x23'),_0x403b37+'-'+_0x52597e+'/'+_0x322834)[_0xa041('0x1d')](_0x5a514c);}return null;};}function patchUpdates(_0x25e18e){return function(_0x56b7e1){try{jsonpatch[_0xa041('0x24')](_0x56b7e1,_0x25e18e,!![]);}catch(_0x151280){return BPromise[_0xa041('0x25')](_0x151280);}return _0x56b7e1[_0xa041('0x26')]();};}function saveUpdates(_0x2baaa5,_0x3cc59d){return function(_0x1c9961){if(_0x1c9961){return _0x1c9961['update'](_0x2baaa5)[_0xa041('0x27')](function(_0x624600){return _0x624600;});}return null;};}function removeEntity(_0x1c28db,_0x24c3e8){return function(_0x3e3c72){if(_0x3e3c72){return _0x3e3c72[_0xa041('0x28')]()[_0xa041('0x27')](function(){_0x1c28db[_0xa041('0x1c')](0xcc)[_0xa041('0x29')]();});}};}function handleEntityNotFound(_0x35b711,_0x457cf2){return function(_0x56c169){if(!_0x56c169){_0x35b711[_0xa041('0x2a')](0x194);}return _0x56c169;};}function handleError(_0x50571a,_0x567541){_0x567541=_0x567541||0x1f4;return function(_0x3667ab){logger[_0xa041('0x2b')](_0x3667ab[_0xa041('0x2c')]);if(_0x3667ab[_0xa041('0x2d')]){delete _0x3667ab['name'];}_0x50571a[_0xa041('0x1c')](_0x567541)['send'](_0x3667ab);};}exports[_0xa041('0x2e')]=function(_0x2b4c45,_0x399b30){var _0x8dce40={},_0x32adfe={},_0x1e8f3f={'count':0x0,'rows':[]};var _0x4e74e5=_['map'](db[_0xa041('0x2f')][_0xa041('0x30')],function(_0x3a198e){return{'name':_0x3a198e[_0xa041('0x31')],'type':_0x3a198e['type']['key']};});_0x32adfe['model']=_[_0xa041('0x32')](_0x4e74e5,_0xa041('0x2d'));_0x32adfe['query']=_[_0xa041('0x33')](_0x2b4c45['query']);_0x32adfe[_0xa041('0x34')]=_[_0xa041('0x35')](_0x32adfe[_0xa041('0x36')],_0x32adfe[_0xa041('0x37')]);_0x8dce40[_0xa041('0x38')]=_['intersection'](_0x32adfe[_0xa041('0x36')],qs['fields'](_0x2b4c45['query']['fields']));_0x8dce40[_0xa041('0x38')]=_0x8dce40[_0xa041('0x38')][_0xa041('0x39')]?_0x8dce40['attributes']:_0x32adfe['model'];if(!_0x2b4c45[_0xa041('0x37')][_0xa041('0x3a')]('nolimit')){_0x8dce40['limit']=qs['limit'](_0x2b4c45[_0xa041('0x37')][_0xa041('0x20')]);_0x8dce40['offset']=qs[_0xa041('0x1e')](_0x2b4c45[_0xa041('0x37')][_0xa041('0x1e')]);}_0x8dce40[_0xa041('0x3b')]=qs['sort'](_0x2b4c45['query'][_0xa041('0x3c')]);_0x8dce40[_0xa041('0x3d')]=qs[_0xa041('0x34')](_[_0xa041('0x3e')](_0x2b4c45[_0xa041('0x37')],_0x32adfe[_0xa041('0x34')]),_0x4e74e5);if(_0x2b4c45['query'][_0xa041('0x3f')]){_0x8dce40['where']=_[_0xa041('0x40')](_0x8dce40[_0xa041('0x3d')],{'$or':_[_0xa041('0x32')](_0x4e74e5,function(_0xc9e6e3){if(_0xc9e6e3['type']!==_0xa041('0x41')){var _0x361ec6={};_0x361ec6[_0xc9e6e3[_0xa041('0x2d')]]={'$like':'%'+_0x2b4c45[_0xa041('0x37')][_0xa041('0x3f')]+'%'};return _0x361ec6;}})});}_0x8dce40=_[_0xa041('0x40')]({},_0x8dce40,_0x2b4c45[_0xa041('0x42')]);var _0xa82e73={'where':_0x8dce40[_0xa041('0x3d')]};return db[_0xa041('0x2f')][_0xa041('0x21')](_0xa82e73)[_0xa041('0x27')](function(_0x36b15f){_0x1e8f3f[_0xa041('0x21')]=_0x36b15f;if(_0x2b4c45[_0xa041('0x37')][_0xa041('0x43')]){_0x8dce40[_0xa041('0x44')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xa041('0x45')](_0x8dce40);})[_0xa041('0x27')](function(_0x194373){_0x1e8f3f[_0xa041('0x46')]=_0x194373;return _0x1e8f3f;})[_0xa041('0x27')](respondWithFilteredResult(_0x399b30,_0x8dce40))[_0xa041('0x47')](handleError(_0x399b30,null));};exports['show']=function(_0x26ad5c,_0x140ed1){var _0x517098={'raw':![],'where':{'id':_0x26ad5c[_0xa041('0x48')]['id']}},_0x1920ec={};_0x1920ec['model']=_[_0xa041('0x33')](db[_0xa041('0x2f')]['rawAttributes']);_0x1920ec[_0xa041('0x37')]=_[_0xa041('0x33')](_0x26ad5c[_0xa041('0x37')]);_0x1920ec[_0xa041('0x34')]=_[_0xa041('0x35')](_0x1920ec[_0xa041('0x36')],_0x1920ec[_0xa041('0x37')]);_0x517098['attributes']=_[_0xa041('0x35')](_0x1920ec[_0xa041('0x36')],qs[_0xa041('0x49')](_0x26ad5c[_0xa041('0x37')][_0xa041('0x49')]));_0x517098[_0xa041('0x38')]=_0x517098[_0xa041('0x38')][_0xa041('0x39')]?_0x517098[_0xa041('0x38')]:_0x1920ec[_0xa041('0x36')];if(_0x26ad5c[_0xa041('0x37')]['includeAll']){_0x517098[_0xa041('0x44')]=[{'all':!![]}];}_0x517098=_[_0xa041('0x40')]({},_0x517098,_0x26ad5c[_0xa041('0x42')]);return db['SugarcrmConfiguration'][_0xa041('0x4a')](_0x517098)['then'](handleEntityNotFound(_0x140ed1,null))['then'](respondWithResult(_0x140ed1,null))[_0xa041('0x47')](handleError(_0x140ed1,null));};exports[_0xa041('0x4b')]=function(_0xf04755,_0x2ba348){return db['SugarcrmConfiguration'][_0xa041('0x4b')](_0xf04755[_0xa041('0x4c')],{})[_0xa041('0x27')](respondWithResult(_0x2ba348,0xc9))[_0xa041('0x47')](handleError(_0x2ba348,null));};exports[_0xa041('0x4d')]=function(_0x42e155,_0x35ac59){if(_0x42e155[_0xa041('0x4c')]['id']){delete _0x42e155[_0xa041('0x4c')]['id'];}return db[_0xa041('0x2f')][_0xa041('0x4a')]({'where':{'id':_0x42e155[_0xa041('0x48')]['id']}})[_0xa041('0x27')](handleEntityNotFound(_0x35ac59,null))['then'](saveUpdates(_0x42e155[_0xa041('0x4c')],null))['then'](respondWithResult(_0x35ac59,null))[_0xa041('0x47')](handleError(_0x35ac59,null));};exports['destroy']=function(_0x45929c,_0x189e8c){return db['SugarcrmConfiguration'][_0xa041('0x4a')]({'where':{'id':_0x45929c[_0xa041('0x48')]['id']}})['then'](handleEntityNotFound(_0x189e8c,null))[_0xa041('0x27')](removeEntity(_0x189e8c,null))[_0xa041('0x47')](handleError(_0x189e8c,null));};exports[_0xa041('0x4e')]=function(_0x1d2e5a,_0x101d55,_0x1134ed){var _0x11b732={};var _0x220918={};var _0x321e2f;var _0x26155a;return db[_0xa041('0x2f')][_0xa041('0x4f')]({'where':{'id':_0x1d2e5a[_0xa041('0x48')]['id']}})['then'](handleEntityNotFound(_0x101d55,null))[_0xa041('0x27')](function(_0x3a2b88){if(_0x3a2b88){_0x321e2f=_0x3a2b88;_0x220918[_0xa041('0x36')]=_['keys'](db[_0xa041('0x50')][_0xa041('0x30')]);_0x220918[_0xa041('0x37')]=_[_0xa041('0x33')](_0x1d2e5a[_0xa041('0x37')]);_0x220918[_0xa041('0x34')]=_[_0xa041('0x35')](_0x220918[_0xa041('0x36')],_0x220918['query']);_0x11b732[_0xa041('0x38')]=_[_0xa041('0x35')](_0x220918['model'],qs[_0xa041('0x49')](_0x1d2e5a[_0xa041('0x37')][_0xa041('0x49')]));_0x11b732['attributes']=_0x11b732[_0xa041('0x38')][_0xa041('0x39')]?_0x11b732[_0xa041('0x38')]:_0x220918[_0xa041('0x36')];_0x11b732[_0xa041('0x3b')]=qs[_0xa041('0x3c')](_0x1d2e5a[_0xa041('0x37')][_0xa041('0x3c')]);_0x11b732['where']=qs[_0xa041('0x34')](_[_0xa041('0x3e')](_0x1d2e5a[_0xa041('0x37')],_0x220918[_0xa041('0x34')]));if(_0x1d2e5a[_0xa041('0x37')][_0xa041('0x3f')]){_0x11b732['where']=_[_0xa041('0x40')](_0x11b732[_0xa041('0x3d')],{'$or':_[_0xa041('0x32')](_0x11b732[_0xa041('0x38')],function(_0x4b7bb5){var _0x2db76b={};_0x2db76b[_0x4b7bb5]={'$like':'%'+_0x1d2e5a[_0xa041('0x37')]['filter']+'%'};return _0x2db76b;})});}_0x11b732=_['merge']({},_0x11b732,_0x1d2e5a[_0xa041('0x42')]);return _0x321e2f['getFields'](_0x11b732);}})[_0xa041('0x27')](function(_0x20e036){if(_0x20e036){_0x26155a=_0x20e036[_0xa041('0x39')];if(!_0x1d2e5a[_0xa041('0x37')]['hasOwnProperty'](_0xa041('0x51'))){_0x11b732[_0xa041('0x20')]=qs[_0xa041('0x20')](_0x1d2e5a[_0xa041('0x37')][_0xa041('0x20')]);_0x11b732[_0xa041('0x1e')]=qs[_0xa041('0x1e')](_0x1d2e5a[_0xa041('0x37')][_0xa041('0x1e')]);}return _0x321e2f['getFields'](_0x11b732);}})[_0xa041('0x27')](function(_0x30fa56){if(_0x30fa56){return _0x30fa56?{'count':_0x26155a,'rows':_0x30fa56}:null;}})[_0xa041('0x27')](respondWithResult(_0x101d55,null))[_0xa041('0x47')](handleError(_0x101d55,null));};exports[_0xa041('0x52')]=function(_0x2c5f28,_0x384965,_0x4adb34){var _0x573d1d={};var _0x110773={};var _0x39f484;var _0x1c89dd;return db[_0xa041('0x2f')][_0xa041('0x4f')]({'where':{'id':_0x2c5f28[_0xa041('0x48')]['id']}})['then'](handleEntityNotFound(_0x384965,null))[_0xa041('0x27')](function(_0x6f3a46){if(_0x6f3a46){_0x39f484=_0x6f3a46;_0x110773['model']=_[_0xa041('0x33')](db[_0xa041('0x50')][_0xa041('0x30')]);_0x110773[_0xa041('0x37')]=_[_0xa041('0x33')](_0x2c5f28[_0xa041('0x37')]);_0x110773[_0xa041('0x34')]=_['intersection'](_0x110773[_0xa041('0x36')],_0x110773[_0xa041('0x37')]);_0x573d1d['attributes']=_['intersection'](_0x110773[_0xa041('0x36')],qs[_0xa041('0x49')](_0x2c5f28[_0xa041('0x37')]['fields']));_0x573d1d[_0xa041('0x38')]=_0x573d1d[_0xa041('0x38')][_0xa041('0x39')]?_0x573d1d[_0xa041('0x38')]:_0x110773['model'];_0x573d1d[_0xa041('0x3b')]=qs['sort'](_0x2c5f28[_0xa041('0x37')][_0xa041('0x3c')]);_0x573d1d[_0xa041('0x3d')]=qs[_0xa041('0x34')](_[_0xa041('0x3e')](_0x2c5f28[_0xa041('0x37')],_0x110773[_0xa041('0x34')]));if(_0x2c5f28[_0xa041('0x37')][_0xa041('0x3f')]){_0x573d1d['where']=_[_0xa041('0x40')](_0x573d1d['where'],{'$or':_[_0xa041('0x32')](_0x573d1d[_0xa041('0x38')],function(_0x3bbe7b){var _0x35e564={};_0x35e564[_0x3bbe7b]={'$like':'%'+_0x2c5f28[_0xa041('0x37')][_0xa041('0x3f')]+'%'};return _0x35e564;})});}_0x573d1d=_[_0xa041('0x40')]({},_0x573d1d,_0x2c5f28[_0xa041('0x42')]);return _0x39f484[_0xa041('0x52')](_0x573d1d);}})[_0xa041('0x27')](function(_0xffe499){if(_0xffe499){_0x1c89dd=_0xffe499[_0xa041('0x39')];if(!_0x2c5f28['query'][_0xa041('0x3a')](_0xa041('0x51'))){_0x573d1d[_0xa041('0x20')]=qs[_0xa041('0x20')](_0x2c5f28[_0xa041('0x37')]['limit']);_0x573d1d[_0xa041('0x1e')]=qs[_0xa041('0x1e')](_0x2c5f28[_0xa041('0x37')]['offset']);}return _0x39f484['getSubjects'](_0x573d1d);}})[_0xa041('0x27')](function(_0x1c0a6b){if(_0x1c0a6b){return _0x1c0a6b?{'count':_0x1c89dd,'rows':_0x1c0a6b}:null;}})[_0xa041('0x27')](respondWithResult(_0x384965,null))[_0xa041('0x47')](handleError(_0x384965,null));};exports[_0xa041('0x53')]=function(_0xc9eaf9,_0x1b4b43,_0x1e5ce8){var _0x3e0d08={};var _0x1b3ce8={};var _0x272f8e;var _0x23a033;return db['SugarcrmConfiguration'][_0xa041('0x4f')]({'where':{'id':_0xc9eaf9[_0xa041('0x48')]['id']}})[_0xa041('0x27')](handleEntityNotFound(_0x1b4b43,null))[_0xa041('0x27')](function(_0x4a9219){if(_0x4a9219){_0x272f8e=_0x4a9219;_0x1b3ce8['model']=_[_0xa041('0x33')](db[_0xa041('0x50')][_0xa041('0x30')]);_0x1b3ce8['query']=_[_0xa041('0x33')](_0xc9eaf9[_0xa041('0x37')]);_0x1b3ce8[_0xa041('0x34')]=_[_0xa041('0x35')](_0x1b3ce8[_0xa041('0x36')],_0x1b3ce8[_0xa041('0x37')]);_0x3e0d08[_0xa041('0x38')]=_[_0xa041('0x35')](_0x1b3ce8['model'],qs[_0xa041('0x49')](_0xc9eaf9[_0xa041('0x37')]['fields']));_0x3e0d08[_0xa041('0x38')]=_0x3e0d08[_0xa041('0x38')][_0xa041('0x39')]?_0x3e0d08[_0xa041('0x38')]:_0x1b3ce8['model'];_0x3e0d08['order']=qs[_0xa041('0x3c')](_0xc9eaf9['query']['sort']);_0x3e0d08['where']=qs['filters'](_[_0xa041('0x3e')](_0xc9eaf9[_0xa041('0x37')],_0x1b3ce8[_0xa041('0x34')]));if(_0xc9eaf9[_0xa041('0x37')][_0xa041('0x3f')]){_0x3e0d08[_0xa041('0x3d')]=_[_0xa041('0x40')](_0x3e0d08['where'],{'$or':_['map'](_0x3e0d08[_0xa041('0x38')],function(_0x5738e3){var _0x10f7bc={};_0x10f7bc[_0x5738e3]={'$like':'%'+_0xc9eaf9[_0xa041('0x37')][_0xa041('0x3f')]+'%'};return _0x10f7bc;})});}_0x3e0d08=_[_0xa041('0x40')]({},_0x3e0d08,_0xc9eaf9['options']);return _0x272f8e[_0xa041('0x53')](_0x3e0d08);}})[_0xa041('0x27')](function(_0x506640){if(_0x506640){_0x23a033=_0x506640[_0xa041('0x39')];if(!_0xc9eaf9[_0xa041('0x37')][_0xa041('0x3a')]('nolimit')){_0x3e0d08['limit']=qs['limit'](_0xc9eaf9[_0xa041('0x37')][_0xa041('0x20')]);_0x3e0d08['offset']=qs['offset'](_0xc9eaf9[_0xa041('0x37')]['offset']);}return _0x272f8e['getDescriptions'](_0x3e0d08);}})['then'](function(_0x35b77b){if(_0x35b77b){return _0x35b77b?{'count':_0x23a033,'rows':_0x35b77b}:null;}})[_0xa041('0x27')](respondWithResult(_0x1b4b43,null))[_0xa041('0x47')](handleError(_0x1b4b43,null));}; \ No newline at end of file +var _0xd6d1=['set','Content-Range','update','then','destroy','error','name','send','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','getFields','findOne','SugarcrmField','nolimit','getSubjects','getDescriptions','eml-format','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset'];(function(_0x3bec69,_0x178e02){var _0x5bb4b0=function(_0x261b4c){while(--_0x261b4c){_0x3bec69['push'](_0x3bec69['shift']());}};_0x5bb4b0(++_0x178e02);}(_0xd6d1,0x195));var _0x1d6d=function(_0x5beb94,_0x489e5b){_0x5beb94=_0x5beb94-0x0;var _0x3958e2=_0xd6d1[_0x5beb94];return _0x3958e2;};'use strict';var emlformat=require(_0x1d6d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1d6d('0x1'));var moment=require(_0x1d6d('0x2'));var BPromise=require(_0x1d6d('0x3'));var Mustache=require('mustache');var util=require(_0x1d6d('0x4'));var path=require('path');var sox=require(_0x1d6d('0x5'));var csv=require('to-csv');var ejs=require(_0x1d6d('0x6'));var fs=require('fs');var fs_extra=require(_0x1d6d('0x7'));var _=require(_0x1d6d('0x8'));var squel=require('squel');var crypto=require(_0x1d6d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x1d6d('0xa'));var toCsv=require('to-csv');var querystring=require(_0x1d6d('0xb'));var Papa=require(_0x1d6d('0xc'));var Redis=require(_0x1d6d('0xd'));var authService=require(_0x1d6d('0xe'));var qs=require(_0x1d6d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d6d('0x10'))('api');var utils=require(_0x1d6d('0x11'));var config=require(_0x1d6d('0x12'));var licenseUtil=require(_0x1d6d('0x13'));var db=require(_0x1d6d('0x14'))['db'];function respondWithStatusCode(_0x1d3c53,_0xb0be9f){_0xb0be9f=_0xb0be9f||0xcc;return function(_0x5aeeba){if(_0x5aeeba){return _0x1d3c53['sendStatus'](_0xb0be9f);}return _0x1d3c53[_0x1d6d('0x15')](_0xb0be9f)[_0x1d6d('0x16')]();};}function respondWithResult(_0x573121,_0x485026){_0x485026=_0x485026||0xc8;return function(_0x8ee771){if(_0x8ee771){return _0x573121[_0x1d6d('0x15')](_0x485026)[_0x1d6d('0x17')](_0x8ee771);}};}function respondWithFilteredResult(_0x49296f,_0x537dad){return function(_0x157f1f){if(_0x157f1f){var _0x50e26f=typeof _0x537dad['offset']==='undefined'&&typeof _0x537dad[_0x1d6d('0x18')]==='undefined';var _0x39a151=_0x157f1f[_0x1d6d('0x19')];var _0x2f00d3=_0x50e26f?0x0:_0x537dad[_0x1d6d('0x1a')];var _0x4186b5=_0x50e26f?_0x157f1f[_0x1d6d('0x19')]:_0x537dad['offset']+_0x537dad[_0x1d6d('0x18')];var _0xbaa494;if(_0x4186b5>=_0x39a151){_0x4186b5=_0x39a151;_0xbaa494=0xc8;}else{_0xbaa494=0xce;}_0x49296f[_0x1d6d('0x15')](_0xbaa494);return _0x49296f[_0x1d6d('0x1b')](_0x1d6d('0x1c'),_0x2f00d3+'-'+_0x4186b5+'/'+_0x39a151)['json'](_0x157f1f);}return null;};}function patchUpdates(_0x5218cf){return function(_0x1ed3e7){try{jsonpatch['apply'](_0x1ed3e7,_0x5218cf,!![]);}catch(_0xdbdac2){return BPromise['reject'](_0xdbdac2);}return _0x1ed3e7['save']();};}function saveUpdates(_0x563ca7,_0x4f451){return function(_0x4348ae){if(_0x4348ae){return _0x4348ae[_0x1d6d('0x1d')](_0x563ca7)[_0x1d6d('0x1e')](function(_0x5ed6b1){return _0x5ed6b1;});}return null;};}function removeEntity(_0x14cb7c,_0x480187){return function(_0xb2e63e){if(_0xb2e63e){return _0xb2e63e[_0x1d6d('0x1f')]()['then'](function(){_0x14cb7c[_0x1d6d('0x15')](0xcc)[_0x1d6d('0x16')]();});}};}function handleEntityNotFound(_0x11d7aa,_0x3ec3b2){return function(_0x2ef17d){if(!_0x2ef17d){_0x11d7aa['sendStatus'](0x194);}return _0x2ef17d;};}function handleError(_0x3848ed,_0x24b637){_0x24b637=_0x24b637||0x1f4;return function(_0x388e36){logger[_0x1d6d('0x20')](_0x388e36['stack']);if(_0x388e36[_0x1d6d('0x21')]){delete _0x388e36[_0x1d6d('0x21')];}_0x3848ed[_0x1d6d('0x15')](_0x24b637)[_0x1d6d('0x22')](_0x388e36);};}exports['index']=function(_0x4c38a3,_0x47ef36){var _0x1afd23={},_0x39cb8d={},_0x39bdca={'count':0x0,'rows':[]};var _0x50153c=_[_0x1d6d('0x23')](db[_0x1d6d('0x24')][_0x1d6d('0x25')],function(_0x30ebbe){return{'name':_0x30ebbe[_0x1d6d('0x26')],'type':_0x30ebbe[_0x1d6d('0x27')][_0x1d6d('0x28')]};});_0x39cb8d[_0x1d6d('0x29')]=_[_0x1d6d('0x23')](_0x50153c,'name');_0x39cb8d['query']=_[_0x1d6d('0x2a')](_0x4c38a3[_0x1d6d('0x2b')]);_0x39cb8d[_0x1d6d('0x2c')]=_[_0x1d6d('0x2d')](_0x39cb8d[_0x1d6d('0x29')],_0x39cb8d[_0x1d6d('0x2b')]);_0x1afd23[_0x1d6d('0x2e')]=_[_0x1d6d('0x2d')](_0x39cb8d[_0x1d6d('0x29')],qs[_0x1d6d('0x2f')](_0x4c38a3[_0x1d6d('0x2b')][_0x1d6d('0x2f')]));_0x1afd23['attributes']=_0x1afd23['attributes'][_0x1d6d('0x30')]?_0x1afd23['attributes']:_0x39cb8d[_0x1d6d('0x29')];if(!_0x4c38a3[_0x1d6d('0x2b')][_0x1d6d('0x31')]('nolimit')){_0x1afd23['limit']=qs[_0x1d6d('0x18')](_0x4c38a3['query'][_0x1d6d('0x18')]);_0x1afd23[_0x1d6d('0x1a')]=qs[_0x1d6d('0x1a')](_0x4c38a3['query'][_0x1d6d('0x1a')]);}_0x1afd23[_0x1d6d('0x32')]=qs[_0x1d6d('0x33')](_0x4c38a3['query'][_0x1d6d('0x33')]);_0x1afd23[_0x1d6d('0x34')]=qs['filters'](_[_0x1d6d('0x35')](_0x4c38a3[_0x1d6d('0x2b')],_0x39cb8d[_0x1d6d('0x2c')]),_0x50153c);if(_0x4c38a3['query'][_0x1d6d('0x36')]){_0x1afd23['where']=_[_0x1d6d('0x37')](_0x1afd23['where'],{'$or':_[_0x1d6d('0x23')](_0x50153c,function(_0x490026){if(_0x490026[_0x1d6d('0x27')]!=='VIRTUAL'){var _0x135583={};_0x135583[_0x490026[_0x1d6d('0x21')]]={'$like':'%'+_0x4c38a3[_0x1d6d('0x2b')]['filter']+'%'};return _0x135583;}})});}_0x1afd23=_[_0x1d6d('0x37')]({},_0x1afd23,_0x4c38a3[_0x1d6d('0x38')]);var _0xee3500={'where':_0x1afd23[_0x1d6d('0x34')]};return db[_0x1d6d('0x24')]['count'](_0xee3500)[_0x1d6d('0x1e')](function(_0x24eee3){_0x39bdca[_0x1d6d('0x19')]=_0x24eee3;if(_0x4c38a3[_0x1d6d('0x2b')][_0x1d6d('0x39')]){_0x1afd23[_0x1d6d('0x3a')]=[{'all':!![]}];}return db[_0x1d6d('0x24')][_0x1d6d('0x3b')](_0x1afd23);})['then'](function(_0x39d365){_0x39bdca[_0x1d6d('0x3c')]=_0x39d365;return _0x39bdca;})[_0x1d6d('0x1e')](respondWithFilteredResult(_0x47ef36,_0x1afd23))['catch'](handleError(_0x47ef36,null));};exports['show']=function(_0x29476e,_0x460b67){var _0xa48d67={'raw':![],'where':{'id':_0x29476e[_0x1d6d('0x3d')]['id']}},_0x6facf5={};_0x6facf5['model']=_[_0x1d6d('0x2a')](db[_0x1d6d('0x24')][_0x1d6d('0x25')]);_0x6facf5[_0x1d6d('0x2b')]=_[_0x1d6d('0x2a')](_0x29476e[_0x1d6d('0x2b')]);_0x6facf5['filters']=_[_0x1d6d('0x2d')](_0x6facf5[_0x1d6d('0x29')],_0x6facf5[_0x1d6d('0x2b')]);_0xa48d67['attributes']=_['intersection'](_0x6facf5[_0x1d6d('0x29')],qs[_0x1d6d('0x2f')](_0x29476e[_0x1d6d('0x2b')][_0x1d6d('0x2f')]));_0xa48d67['attributes']=_0xa48d67[_0x1d6d('0x2e')][_0x1d6d('0x30')]?_0xa48d67[_0x1d6d('0x2e')]:_0x6facf5[_0x1d6d('0x29')];if(_0x29476e[_0x1d6d('0x2b')][_0x1d6d('0x39')]){_0xa48d67[_0x1d6d('0x3a')]=[{'all':!![]}];}_0xa48d67=_[_0x1d6d('0x37')]({},_0xa48d67,_0x29476e['options']);return db[_0x1d6d('0x24')][_0x1d6d('0x3e')](_0xa48d67)[_0x1d6d('0x1e')](handleEntityNotFound(_0x460b67,null))[_0x1d6d('0x1e')](respondWithResult(_0x460b67,null))[_0x1d6d('0x3f')](handleError(_0x460b67,null));};exports[_0x1d6d('0x40')]=function(_0x40f135,_0x5c4754){return db[_0x1d6d('0x24')][_0x1d6d('0x40')](_0x40f135[_0x1d6d('0x41')],{})[_0x1d6d('0x1e')](respondWithResult(_0x5c4754,0xc9))[_0x1d6d('0x3f')](handleError(_0x5c4754,null));};exports[_0x1d6d('0x1d')]=function(_0x3d2381,_0x23bd19){if(_0x3d2381[_0x1d6d('0x41')]['id']){delete _0x3d2381[_0x1d6d('0x41')]['id'];}return db[_0x1d6d('0x24')][_0x1d6d('0x3e')]({'where':{'id':_0x3d2381[_0x1d6d('0x3d')]['id']}})[_0x1d6d('0x1e')](handleEntityNotFound(_0x23bd19,null))['then'](saveUpdates(_0x3d2381[_0x1d6d('0x41')],null))['then'](respondWithResult(_0x23bd19,null))[_0x1d6d('0x3f')](handleError(_0x23bd19,null));};exports[_0x1d6d('0x1f')]=function(_0x34e0d1,_0x5f4e14){return db[_0x1d6d('0x24')][_0x1d6d('0x3e')]({'where':{'id':_0x34e0d1[_0x1d6d('0x3d')]['id']}})[_0x1d6d('0x1e')](handleEntityNotFound(_0x5f4e14,null))[_0x1d6d('0x1e')](removeEntity(_0x5f4e14,null))[_0x1d6d('0x3f')](handleError(_0x5f4e14,null));};exports[_0x1d6d('0x42')]=function(_0x44b929,_0x47c3dc,_0x21c5a5){var _0x198685={};var _0x4d4af8={};var _0x1c8cbf;var _0x5aa2a8;return db[_0x1d6d('0x24')][_0x1d6d('0x43')]({'where':{'id':_0x44b929[_0x1d6d('0x3d')]['id']}})[_0x1d6d('0x1e')](handleEntityNotFound(_0x47c3dc,null))[_0x1d6d('0x1e')](function(_0x4ef876){if(_0x4ef876){_0x1c8cbf=_0x4ef876;_0x4d4af8[_0x1d6d('0x29')]=_[_0x1d6d('0x2a')](db[_0x1d6d('0x44')][_0x1d6d('0x25')]);_0x4d4af8['query']=_[_0x1d6d('0x2a')](_0x44b929[_0x1d6d('0x2b')]);_0x4d4af8[_0x1d6d('0x2c')]=_[_0x1d6d('0x2d')](_0x4d4af8[_0x1d6d('0x29')],_0x4d4af8[_0x1d6d('0x2b')]);_0x198685[_0x1d6d('0x2e')]=_[_0x1d6d('0x2d')](_0x4d4af8[_0x1d6d('0x29')],qs[_0x1d6d('0x2f')](_0x44b929[_0x1d6d('0x2b')][_0x1d6d('0x2f')]));_0x198685[_0x1d6d('0x2e')]=_0x198685[_0x1d6d('0x2e')][_0x1d6d('0x30')]?_0x198685[_0x1d6d('0x2e')]:_0x4d4af8[_0x1d6d('0x29')];_0x198685[_0x1d6d('0x32')]=qs['sort'](_0x44b929[_0x1d6d('0x2b')]['sort']);_0x198685[_0x1d6d('0x34')]=qs[_0x1d6d('0x2c')](_['pick'](_0x44b929[_0x1d6d('0x2b')],_0x4d4af8[_0x1d6d('0x2c')]));if(_0x44b929[_0x1d6d('0x2b')][_0x1d6d('0x36')]){_0x198685[_0x1d6d('0x34')]=_[_0x1d6d('0x37')](_0x198685['where'],{'$or':_[_0x1d6d('0x23')](_0x198685[_0x1d6d('0x2e')],function(_0x102897){var _0x571155={};_0x571155[_0x102897]={'$like':'%'+_0x44b929['query'][_0x1d6d('0x36')]+'%'};return _0x571155;})});}_0x198685=_[_0x1d6d('0x37')]({},_0x198685,_0x44b929[_0x1d6d('0x38')]);return _0x1c8cbf['getFields'](_0x198685);}})[_0x1d6d('0x1e')](function(_0x15f0be){if(_0x15f0be){_0x5aa2a8=_0x15f0be[_0x1d6d('0x30')];if(!_0x44b929[_0x1d6d('0x2b')]['hasOwnProperty'](_0x1d6d('0x45'))){_0x198685['limit']=qs[_0x1d6d('0x18')](_0x44b929[_0x1d6d('0x2b')][_0x1d6d('0x18')]);_0x198685[_0x1d6d('0x1a')]=qs[_0x1d6d('0x1a')](_0x44b929[_0x1d6d('0x2b')][_0x1d6d('0x1a')]);}return _0x1c8cbf[_0x1d6d('0x42')](_0x198685);}})[_0x1d6d('0x1e')](function(_0x1da450){if(_0x1da450){return _0x1da450?{'count':_0x5aa2a8,'rows':_0x1da450}:null;}})['then'](respondWithResult(_0x47c3dc,null))[_0x1d6d('0x3f')](handleError(_0x47c3dc,null));};exports['getSubjects']=function(_0x404964,_0x35ed9c,_0x452ebf){var _0x206c50={};var _0x3f2413={};var _0x2446bd;var _0x1289fa;return db[_0x1d6d('0x24')][_0x1d6d('0x43')]({'where':{'id':_0x404964[_0x1d6d('0x3d')]['id']}})['then'](handleEntityNotFound(_0x35ed9c,null))['then'](function(_0x51ff19){if(_0x51ff19){_0x2446bd=_0x51ff19;_0x3f2413[_0x1d6d('0x29')]=_[_0x1d6d('0x2a')](db[_0x1d6d('0x44')][_0x1d6d('0x25')]);_0x3f2413[_0x1d6d('0x2b')]=_[_0x1d6d('0x2a')](_0x404964[_0x1d6d('0x2b')]);_0x3f2413[_0x1d6d('0x2c')]=_['intersection'](_0x3f2413[_0x1d6d('0x29')],_0x3f2413[_0x1d6d('0x2b')]);_0x206c50[_0x1d6d('0x2e')]=_[_0x1d6d('0x2d')](_0x3f2413['model'],qs[_0x1d6d('0x2f')](_0x404964[_0x1d6d('0x2b')][_0x1d6d('0x2f')]));_0x206c50['attributes']=_0x206c50['attributes'][_0x1d6d('0x30')]?_0x206c50['attributes']:_0x3f2413['model'];_0x206c50[_0x1d6d('0x32')]=qs[_0x1d6d('0x33')](_0x404964[_0x1d6d('0x2b')][_0x1d6d('0x33')]);_0x206c50[_0x1d6d('0x34')]=qs[_0x1d6d('0x2c')](_['pick'](_0x404964['query'],_0x3f2413[_0x1d6d('0x2c')]));if(_0x404964[_0x1d6d('0x2b')][_0x1d6d('0x36')]){_0x206c50[_0x1d6d('0x34')]=_['merge'](_0x206c50[_0x1d6d('0x34')],{'$or':_['map'](_0x206c50[_0x1d6d('0x2e')],function(_0x2a05e7){var _0x3de108={};_0x3de108[_0x2a05e7]={'$like':'%'+_0x404964[_0x1d6d('0x2b')][_0x1d6d('0x36')]+'%'};return _0x3de108;})});}_0x206c50=_['merge']({},_0x206c50,_0x404964[_0x1d6d('0x38')]);return _0x2446bd[_0x1d6d('0x46')](_0x206c50);}})[_0x1d6d('0x1e')](function(_0x48bf9b){if(_0x48bf9b){_0x1289fa=_0x48bf9b[_0x1d6d('0x30')];if(!_0x404964['query'][_0x1d6d('0x31')](_0x1d6d('0x45'))){_0x206c50[_0x1d6d('0x18')]=qs[_0x1d6d('0x18')](_0x404964['query']['limit']);_0x206c50['offset']=qs[_0x1d6d('0x1a')](_0x404964[_0x1d6d('0x2b')][_0x1d6d('0x1a')]);}return _0x2446bd['getSubjects'](_0x206c50);}})[_0x1d6d('0x1e')](function(_0x45f06b){if(_0x45f06b){return _0x45f06b?{'count':_0x1289fa,'rows':_0x45f06b}:null;}})[_0x1d6d('0x1e')](respondWithResult(_0x35ed9c,null))[_0x1d6d('0x3f')](handleError(_0x35ed9c,null));};exports[_0x1d6d('0x47')]=function(_0x1d0324,_0x2adfad,_0x403e80){var _0x41641f={};var _0x53c58e={};var _0xf86b93;var _0x45a647;return db[_0x1d6d('0x24')][_0x1d6d('0x43')]({'where':{'id':_0x1d0324['params']['id']}})[_0x1d6d('0x1e')](handleEntityNotFound(_0x2adfad,null))[_0x1d6d('0x1e')](function(_0x38b9d8){if(_0x38b9d8){_0xf86b93=_0x38b9d8;_0x53c58e[_0x1d6d('0x29')]=_['keys'](db[_0x1d6d('0x44')][_0x1d6d('0x25')]);_0x53c58e[_0x1d6d('0x2b')]=_[_0x1d6d('0x2a')](_0x1d0324[_0x1d6d('0x2b')]);_0x53c58e[_0x1d6d('0x2c')]=_['intersection'](_0x53c58e[_0x1d6d('0x29')],_0x53c58e[_0x1d6d('0x2b')]);_0x41641f[_0x1d6d('0x2e')]=_[_0x1d6d('0x2d')](_0x53c58e['model'],qs[_0x1d6d('0x2f')](_0x1d0324[_0x1d6d('0x2b')][_0x1d6d('0x2f')]));_0x41641f['attributes']=_0x41641f[_0x1d6d('0x2e')][_0x1d6d('0x30')]?_0x41641f[_0x1d6d('0x2e')]:_0x53c58e[_0x1d6d('0x29')];_0x41641f['order']=qs['sort'](_0x1d0324['query'][_0x1d6d('0x33')]);_0x41641f[_0x1d6d('0x34')]=qs[_0x1d6d('0x2c')](_[_0x1d6d('0x35')](_0x1d0324['query'],_0x53c58e[_0x1d6d('0x2c')]));if(_0x1d0324['query'][_0x1d6d('0x36')]){_0x41641f[_0x1d6d('0x34')]=_[_0x1d6d('0x37')](_0x41641f[_0x1d6d('0x34')],{'$or':_['map'](_0x41641f[_0x1d6d('0x2e')],function(_0x287e59){var _0x38e1f9={};_0x38e1f9[_0x287e59]={'$like':'%'+_0x1d0324[_0x1d6d('0x2b')][_0x1d6d('0x36')]+'%'};return _0x38e1f9;})});}_0x41641f=_[_0x1d6d('0x37')]({},_0x41641f,_0x1d0324[_0x1d6d('0x38')]);return _0xf86b93[_0x1d6d('0x47')](_0x41641f);}})[_0x1d6d('0x1e')](function(_0x3e9da0){if(_0x3e9da0){_0x45a647=_0x3e9da0[_0x1d6d('0x30')];if(!_0x1d0324[_0x1d6d('0x2b')][_0x1d6d('0x31')](_0x1d6d('0x45'))){_0x41641f[_0x1d6d('0x18')]=qs[_0x1d6d('0x18')](_0x1d0324[_0x1d6d('0x2b')][_0x1d6d('0x18')]);_0x41641f['offset']=qs[_0x1d6d('0x1a')](_0x1d0324[_0x1d6d('0x2b')][_0x1d6d('0x1a')]);}return _0xf86b93[_0x1d6d('0x47')](_0x41641f);}})[_0x1d6d('0x1e')](function(_0x486486){if(_0x486486){return _0x486486?{'count':_0x45a647,'rows':_0x486486}:null;}})[_0x1d6d('0x1e')](respondWithResult(_0x2adfad,null))[_0x1d6d('0x3f')](handleError(_0x2adfad,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 25cb6df..f06306b 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 _0xc556=['path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','api','bluebird'];(function(_0x31cc6e,_0x4da430){var _0x39a234=function(_0x3fe7cd){while(--_0x3fe7cd){_0x31cc6e['push'](_0x31cc6e['shift']());}};_0x39a234(++_0x4da430);}(_0xc556,0xbc));var _0x6c55=function(_0x456066,_0x14faf4){_0x456066=_0x456066-0x0;var _0x504cd9=_0xc556[_0x456066];return _0x504cd9;};'use strict';var _=require(_0x6c55('0x0'));var util=require(_0x6c55('0x1'));var logger=require('../../config/logger')(_0x6c55('0x2'));var moment=require('moment');var BPromise=require(_0x6c55('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c55('0x4'));var rimraf=require(_0x6c55('0x5'));var config=require(_0x6c55('0x6'));var attributes=require(_0x6c55('0x7'));module[_0x6c55('0x8')]=function(_0x218e1b,_0x57514f){return _0x218e1b[_0x6c55('0x9')](_0x6c55('0xa'),attributes,{'tableName':_0x6c55('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9968=['api','bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger'];(function(_0x4adfa4,_0x121c5a){var _0x14cec1=function(_0x4fd975){while(--_0x4fd975){_0x4adfa4['push'](_0x4adfa4['shift']());}};_0x14cec1(++_0x121c5a);}(_0x9968,0x72));var _0x8996=function(_0x2f9295,_0x4056fc){_0x2f9295=_0x2f9295-0x0;var _0x2bb94f=_0x9968[_0x2f9295];return _0x2bb94f;};'use strict';var _=require(_0x8996('0x0'));var util=require(_0x8996('0x1'));var logger=require(_0x8996('0x2'))(_0x8996('0x3'));var moment=require('moment');var BPromise=require(_0x8996('0x4'));var rp=require(_0x8996('0x5'));var fs=require('fs');var path=require(_0x8996('0x6'));var rimraf=require('rimraf');var config=require(_0x8996('0x7'));var attributes=require(_0x8996('0x8'));module[_0x8996('0x9')]=function(_0x4cd053,_0x4a073d){return _0x4cd053[_0x8996('0xa')](_0x8996('0xb'),attributes,{'tableName':_0x8996('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 30a0459..866c949 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 _0x079e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','catch','lodash','util','bluebird'];(function(_0x1f3c23,_0x389086){var _0x1b36f3=function(_0x7f0d9d){while(--_0x7f0d9d){_0x1f3c23['push'](_0x1f3c23['shift']());}};_0x1b36f3(++_0x389086);}(_0x079e,0x1e1));var _0xe079=function(_0x4f5226,_0x518f6c){_0x4f5226=_0x4f5226-0x0;var _0x42fdd5=_0x079e[_0x4f5226];return _0x42fdd5;};'use strict';var _=require(_0xe079('0x0'));var util=require(_0xe079('0x1'));var moment=require('moment');var BPromise=require(_0xe079('0x2'));var rs=require(_0xe079('0x3'));var fs=require('fs');var Redis=require(_0xe079('0x4'));var db=require(_0xe079('0x5'))['db'];var utils=require(_0xe079('0x6'));var logger=require(_0xe079('0x7'))(_0xe079('0x8'));var config=require(_0xe079('0x9'));var jayson=require(_0xe079('0xa'));var client=jayson['client'][_0xe079('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12bdfd,_0x2ab2e1,_0x59c8c2){return new BPromise(function(_0x407598,_0x2de5ef){return client[_0xe079('0xc')](_0x12bdfd,_0x59c8c2)[_0xe079('0xd')](function(_0x1ab7d4){logger[_0xe079('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2ab2e1,_0xe079('0xf'));logger[_0xe079('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x2ab2e1,_0xe079('0xf'),JSON['stringify'](_0x1ab7d4));if(_0x1ab7d4['error']){if(_0x1ab7d4[_0xe079('0x11')][_0xe079('0x12')]===0x1f4){logger['error'](_0xe079('0x13'),_0x2ab2e1,_0x1ab7d4['error'][_0xe079('0x14')]);return _0x2de5ef(_0x1ab7d4[_0xe079('0x11')][_0xe079('0x14')]);}logger['error'](_0xe079('0x13'),_0x2ab2e1,_0x1ab7d4[_0xe079('0x11')][_0xe079('0x14')]);return _0x407598(_0x1ab7d4['error'][_0xe079('0x14')]);}else{logger['info'](_0xe079('0x13'),_0x2ab2e1,_0xe079('0xf'));_0x407598(_0x1ab7d4['result']['message']);}})[_0xe079('0x15')](function(_0x268b3e){logger[_0xe079('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2ab2e1,_0x268b3e);_0x2de5ef(_0x268b3e);});});} \ No newline at end of file +var _0x7020=['../../config/logger','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x33f6be,_0x2864a6){var _0x3de6ac=function(_0x3e5c26){while(--_0x3e5c26){_0x33f6be['push'](_0x33f6be['shift']());}};_0x3de6ac(++_0x2864a6);}(_0x7020,0x84));var _0x0702=function(_0x45559d,_0x4ebfcb){_0x45559d=_0x45559d-0x0;var _0x48f984=_0x7020[_0x45559d];return _0x48f984;};'use strict';var _=require(_0x0702('0x0'));var util=require(_0x0702('0x1'));var moment=require(_0x0702('0x2'));var BPromise=require(_0x0702('0x3'));var rs=require(_0x0702('0x4'));var fs=require('fs');var Redis=require(_0x0702('0x5'));var db=require(_0x0702('0x6'))['db'];var utils=require(_0x0702('0x7'));var logger=require(_0x0702('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0702('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45fe20,_0x46f433,_0x42e5d6){return new BPromise(function(_0x1fa874,_0x5af3f6){return client['request'](_0x45fe20,_0x42e5d6)[_0x0702('0xa')](function(_0x1bed04){logger[_0x0702('0xb')](_0x0702('0xc'),_0x46f433,_0x0702('0xd'));logger[_0x0702('0xe')](_0x0702('0xf'),_0x46f433,_0x0702('0xd'),JSON[_0x0702('0x10')](_0x1bed04));if(_0x1bed04[_0x0702('0x11')]){if(_0x1bed04['error']['code']===0x1f4){logger[_0x0702('0x11')](_0x0702('0xc'),_0x46f433,_0x1bed04[_0x0702('0x11')]['message']);return _0x5af3f6(_0x1bed04[_0x0702('0x11')][_0x0702('0x12')]);}logger[_0x0702('0x11')](_0x0702('0xc'),_0x46f433,_0x1bed04['error'][_0x0702('0x12')]);return _0x1fa874(_0x1bed04[_0x0702('0x11')]['message']);}else{logger[_0x0702('0xb')](_0x0702('0xc'),_0x46f433,_0x0702('0xd'));_0x1fa874(_0x1bed04[_0x0702('0x13')][_0x0702('0x12')]);}})['catch'](function(_0x2bebb7){logger[_0x0702('0x11')](_0x0702('0xc'),_0x46f433,_0x2bebb7);_0x5af3f6(_0x2bebb7);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 1b961d4..2008a82 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 _0xf30c=['post','create','put','update','delete','destroy','exports','util','path','Router','../../components/interaction/service','./intSugarcrmField.controller','index','get','/:id','isAuthenticated','show'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xf30c,0x1b0));var _0xcf30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf30c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xcf30('0x0'));var path=require(_0xcf30('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcf30('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcf30('0x3'));var config=require('../../config/environment');var controller=require(_0xcf30('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xcf30('0x5')]);router[_0xcf30('0x6')](_0xcf30('0x7'),auth[_0xcf30('0x8')](),controller[_0xcf30('0x9')]);router[_0xcf30('0xa')]('/',auth[_0xcf30('0x8')](),controller[_0xcf30('0xb')]);router[_0xcf30('0xc')](_0xcf30('0x7'),auth[_0xcf30('0x8')](),controller[_0xcf30('0xd')]);router[_0xcf30('0xe')](_0xcf30('0x7'),auth['isAuthenticated'](),controller[_0xcf30('0xf')]);module[_0xcf30('0x10')]=router; \ No newline at end of file +var _0xa4e9=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','exports'];(function(_0x4c80d7,_0x2bef29){var _0x3c5095=function(_0x1b0e67){while(--_0x1b0e67){_0x4c80d7['push'](_0x4c80d7['shift']());}};_0x3c5095(++_0x2bef29);}(_0xa4e9,0xf7));var _0x9a4e=function(_0x31e97b,_0x5c503a){_0x31e97b=_0x31e97b-0x0;var _0x488a2c=_0xa4e9[_0x31e97b];return _0x488a2c;};'use strict';var multer=require('multer');var util=require(_0x9a4e('0x0'));var path=require(_0x9a4e('0x1'));var timeout=require(_0x9a4e('0x2'));var express=require(_0x9a4e('0x3'));var router=express['Router']();var fs_extra=require(_0x9a4e('0x4'));var auth=require(_0x9a4e('0x5'));var interaction=require(_0x9a4e('0x6'));var config=require(_0x9a4e('0x7'));var controller=require(_0x9a4e('0x8'));router['get']('/',auth[_0x9a4e('0x9')](),controller[_0x9a4e('0xa')]);router[_0x9a4e('0xb')](_0x9a4e('0xc'),auth[_0x9a4e('0x9')](),controller[_0x9a4e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9a4e('0xe')]);router[_0x9a4e('0xf')](_0x9a4e('0xc'),auth[_0x9a4e('0x9')](),controller[_0x9a4e('0x10')]);router[_0x9a4e('0x11')](_0x9a4e('0xc'),auth[_0x9a4e('0x9')](),controller['destroy']);module[_0x9a4e('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 9172e70..8954c76 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 _0xf3c8=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x4f3135,_0xebd38e){var _0x2cb3db=function(_0x259e10){while(--_0x259e10){_0x4f3135['push'](_0x4f3135['shift']());}};_0x2cb3db(++_0xebd38e);}(_0xf3c8,0x143));var _0x8f3c=function(_0x34245b,_0x41a15a){_0x34245b=_0x34245b-0x0;var _0x297dc9=_0xf3c8[_0x34245b];return _0x297dc9;};'use strict';var Sequelize=require(_0x8f3c('0x0'));module[_0x8f3c('0x1')]={'type':{'type':Sequelize[_0x8f3c('0x2')](_0x8f3c('0x3'),_0x8f3c('0x4'),_0x8f3c('0x5'),_0x8f3c('0x6'),_0x8f3c('0x7')),'defaultValue':_0x8f3c('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8f3c('0x8')]},'keyType':{'type':Sequelize['ENUM']('string',_0x8f3c('0x4'),_0x8f3c('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8f3c('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8f3c('0x8')]}}; \ No newline at end of file +var _0xaaf7=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaaf7,0x1ef));var _0x7aaf=function(_0x5eea7b,_0x2f03d0){_0x5eea7b=_0x5eea7b-0x0;var _0xb6a416=_0xaaf7[_0x5eea7b];return _0xb6a416;};'use strict';var Sequelize=require(_0x7aaf('0x0'));module[_0x7aaf('0x1')]={'type':{'type':Sequelize[_0x7aaf('0x2')](_0x7aaf('0x3'),_0x7aaf('0x4'),_0x7aaf('0x5'),_0x7aaf('0x6'),'picklist'),'defaultValue':_0x7aaf('0x3')},'content':{'type':Sequelize[_0x7aaf('0x7')]},'key':{'type':Sequelize[_0x7aaf('0x7')]},'keyType':{'type':Sequelize[_0x7aaf('0x2')](_0x7aaf('0x3'),'variable',_0x7aaf('0x5'))},'keyContent':{'type':Sequelize[_0x7aaf('0x7')]},'idField':{'type':Sequelize[_0x7aaf('0x7')]},'nameField':{'type':Sequelize[_0x7aaf('0x7')]},'customField':{'type':Sequelize[_0x7aaf('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 1d26510..974c71a 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 _0x0225=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','SugarcrmField','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','catch','show','params','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','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'];(function(_0x8a30cf,_0x40f19b){var _0x20f439=function(_0x157a5d){while(--_0x157a5d){_0x8a30cf['push'](_0x8a30cf['shift']());}};_0x20f439(++_0x40f19b);}(_0x0225,0x163));var _0x5022=function(_0x1a6c7f,_0x5aee3f){_0x1a6c7f=_0x1a6c7f-0x0;var _0x1d378d=_0x0225[_0x1a6c7f];return _0x1d378d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5022('0x0'));var zipdir=require(_0x5022('0x1'));var jsonpatch=require(_0x5022('0x2'));var rp=require(_0x5022('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5022('0x4'));var util=require(_0x5022('0x5'));var path=require('path');var sox=require(_0x5022('0x6'));var csv=require(_0x5022('0x7'));var ejs=require(_0x5022('0x8'));var fs=require('fs');var fs_extra=require(_0x5022('0x9'));var _=require(_0x5022('0xa'));var squel=require(_0x5022('0xb'));var crypto=require('crypto');var jsforce=require(_0x5022('0xc'));var deskjs=require(_0x5022('0xd'));var toCsv=require(_0x5022('0x7'));var querystring=require(_0x5022('0xe'));var Papa=require(_0x5022('0xf'));var Redis=require(_0x5022('0x10'));var authService=require(_0x5022('0x11'));var qs=require(_0x5022('0x12'));var as=require(_0x5022('0x13'));var hardwareService=require(_0x5022('0x14'));var logger=require(_0x5022('0x15'))('api');var utils=require(_0x5022('0x16'));var config=require(_0x5022('0x17'));var licenseUtil=require(_0x5022('0x18'));var db=require(_0x5022('0x19'))['db'];function respondWithStatusCode(_0x5d68a0,_0x50b39a){_0x50b39a=_0x50b39a||0xcc;return function(_0x467afe){if(_0x467afe){return _0x5d68a0['sendStatus'](_0x50b39a);}return _0x5d68a0[_0x5022('0x1a')](_0x50b39a)['end']();};}function respondWithResult(_0x18d0d2,_0x4811f4){_0x4811f4=_0x4811f4||0xc8;return function(_0x1f7fbd){if(_0x1f7fbd){return _0x18d0d2['status'](_0x4811f4)['json'](_0x1f7fbd);}};}function respondWithFilteredResult(_0x22f90a,_0x1cd6ea){return function(_0x462f5f){if(_0x462f5f){var _0x42e660=typeof _0x1cd6ea[_0x5022('0x1b')]===_0x5022('0x1c')&&typeof _0x1cd6ea[_0x5022('0x1d')]===_0x5022('0x1c');var _0x1d2020=_0x462f5f[_0x5022('0x1e')];var _0x48988b=_0x42e660?0x0:_0x1cd6ea[_0x5022('0x1b')];var _0x2bb83c=_0x42e660?_0x462f5f[_0x5022('0x1e')]:_0x1cd6ea['offset']+_0x1cd6ea[_0x5022('0x1d')];var _0x432e81;if(_0x2bb83c>=_0x1d2020){_0x2bb83c=_0x1d2020;_0x432e81=0xc8;}else{_0x432e81=0xce;}_0x22f90a[_0x5022('0x1a')](_0x432e81);return _0x22f90a[_0x5022('0x1f')](_0x5022('0x20'),_0x48988b+'-'+_0x2bb83c+'/'+_0x1d2020)[_0x5022('0x21')](_0x462f5f);}return null;};}function patchUpdates(_0x56e821){return function(_0x5118c5){try{jsonpatch[_0x5022('0x22')](_0x5118c5,_0x56e821,!![]);}catch(_0x24c12b){return BPromise[_0x5022('0x23')](_0x24c12b);}return _0x5118c5[_0x5022('0x24')]();};}function saveUpdates(_0x4bee03,_0x186ba2){return function(_0x2e871e){if(_0x2e871e){return _0x2e871e[_0x5022('0x25')](_0x4bee03)[_0x5022('0x26')](function(_0x52e177){return _0x52e177;});}return null;};}function removeEntity(_0x49237d,_0x534f63){return function(_0x2d4004){if(_0x2d4004){return _0x2d4004['destroy']()[_0x5022('0x26')](function(){_0x49237d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x428598,_0x50743f){return function(_0x1b46d7){if(!_0x1b46d7){_0x428598['sendStatus'](0x194);}return _0x1b46d7;};}function handleError(_0x3ba74d,_0x3f82b9){_0x3f82b9=_0x3f82b9||0x1f4;return function(_0x5774d7){logger['error'](_0x5774d7[_0x5022('0x27')]);if(_0x5774d7[_0x5022('0x28')]){delete _0x5774d7['name'];}_0x3ba74d[_0x5022('0x1a')](_0x3f82b9)[_0x5022('0x29')](_0x5774d7);};}exports[_0x5022('0x2a')]=function(_0x414ab3,_0x515705){var _0x10de04={},_0x581978={},_0x350830={'count':0x0,'rows':[]};var _0x5e2c4b=_['map'](db[_0x5022('0x2b')][_0x5022('0x2c')],function(_0x415413){return{'name':_0x415413[_0x5022('0x2d')],'type':_0x415413['type'][_0x5022('0x2e')]};});_0x581978[_0x5022('0x2f')]=_[_0x5022('0x30')](_0x5e2c4b,_0x5022('0x28'));_0x581978[_0x5022('0x31')]=_[_0x5022('0x32')](_0x414ab3['query']);_0x581978[_0x5022('0x33')]=_['intersection'](_0x581978['model'],_0x581978[_0x5022('0x31')]);_0x10de04[_0x5022('0x34')]=_[_0x5022('0x35')](_0x581978[_0x5022('0x2f')],qs['fields'](_0x414ab3['query'][_0x5022('0x36')]));_0x10de04['attributes']=_0x10de04[_0x5022('0x34')][_0x5022('0x37')]?_0x10de04[_0x5022('0x34')]:_0x581978[_0x5022('0x2f')];if(!_0x414ab3[_0x5022('0x31')][_0x5022('0x38')](_0x5022('0x39'))){_0x10de04['limit']=qs[_0x5022('0x1d')](_0x414ab3[_0x5022('0x31')][_0x5022('0x1d')]);_0x10de04['offset']=qs[_0x5022('0x1b')](_0x414ab3[_0x5022('0x31')][_0x5022('0x1b')]);}_0x10de04[_0x5022('0x3a')]=qs[_0x5022('0x3b')](_0x414ab3['query']['sort']);_0x10de04[_0x5022('0x3c')]=qs[_0x5022('0x33')](_[_0x5022('0x3d')](_0x414ab3['query'],_0x581978['filters']),_0x5e2c4b);if(_0x414ab3[_0x5022('0x31')][_0x5022('0x3e')]){_0x10de04[_0x5022('0x3c')]=_[_0x5022('0x3f')](_0x10de04[_0x5022('0x3c')],{'$or':_[_0x5022('0x30')](_0x5e2c4b,function(_0x2c7104){if(_0x2c7104[_0x5022('0x40')]!=='VIRTUAL'){var _0x2a488e={};_0x2a488e[_0x2c7104[_0x5022('0x28')]]={'$like':'%'+_0x414ab3[_0x5022('0x31')]['filter']+'%'};return _0x2a488e;}})});}_0x10de04=_[_0x5022('0x3f')]({},_0x10de04,_0x414ab3[_0x5022('0x41')]);var _0x297628={'where':_0x10de04[_0x5022('0x3c')]};return db[_0x5022('0x2b')][_0x5022('0x1e')](_0x297628)['then'](function(_0x40a0e0){_0x350830[_0x5022('0x1e')]=_0x40a0e0;if(_0x414ab3[_0x5022('0x31')][_0x5022('0x42')]){_0x10de04[_0x5022('0x43')]=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x10de04);})[_0x5022('0x26')](function(_0x580a3a){_0x350830['rows']=_0x580a3a;return _0x350830;})[_0x5022('0x26')](respondWithFilteredResult(_0x515705,_0x10de04))[_0x5022('0x44')](handleError(_0x515705,null));};exports[_0x5022('0x45')]=function(_0x43ab05,_0x412ea3){var _0x1512d4={'raw':!![],'where':{'id':_0x43ab05[_0x5022('0x46')]['id']}},_0x64e080={};_0x64e080[_0x5022('0x2f')]=_[_0x5022('0x32')](db[_0x5022('0x2b')][_0x5022('0x2c')]);_0x64e080['query']=_['keys'](_0x43ab05['query']);_0x64e080[_0x5022('0x33')]=_[_0x5022('0x35')](_0x64e080[_0x5022('0x2f')],_0x64e080[_0x5022('0x31')]);_0x1512d4[_0x5022('0x34')]=_[_0x5022('0x35')](_0x64e080['model'],qs['fields'](_0x43ab05[_0x5022('0x31')]['fields']));_0x1512d4['attributes']=_0x1512d4['attributes'][_0x5022('0x37')]?_0x1512d4[_0x5022('0x34')]:_0x64e080[_0x5022('0x2f')];if(_0x43ab05[_0x5022('0x31')][_0x5022('0x42')]){_0x1512d4[_0x5022('0x43')]=[{'all':!![]}];}_0x1512d4=_[_0x5022('0x3f')]({},_0x1512d4,_0x43ab05['options']);return db[_0x5022('0x2b')][_0x5022('0x47')](_0x1512d4)[_0x5022('0x26')](handleEntityNotFound(_0x412ea3,null))['then'](respondWithResult(_0x412ea3,null))[_0x5022('0x44')](handleError(_0x412ea3,null));};exports['create']=function(_0x14a413,_0xfef2f2){return db[_0x5022('0x2b')][_0x5022('0x48')](_0x14a413['body'],{})['then'](respondWithResult(_0xfef2f2,0xc9))[_0x5022('0x44')](handleError(_0xfef2f2,null));};exports[_0x5022('0x25')]=function(_0x51d1a7,_0x3a8825){if(_0x51d1a7['body']['id']){delete _0x51d1a7[_0x5022('0x49')]['id'];}return db[_0x5022('0x2b')]['find']({'where':{'id':_0x51d1a7['params']['id']}})['then'](handleEntityNotFound(_0x3a8825,null))[_0x5022('0x26')](saveUpdates(_0x51d1a7[_0x5022('0x49')],null))[_0x5022('0x26')](respondWithResult(_0x3a8825,null))['catch'](handleError(_0x3a8825,null));};exports[_0x5022('0x4a')]=function(_0x22f593,_0x64efc2){return db[_0x5022('0x2b')]['find']({'where':{'id':_0x22f593['params']['id']}})[_0x5022('0x26')](handleEntityNotFound(_0x64efc2,null))[_0x5022('0x26')](removeEntity(_0x64efc2,null))[_0x5022('0x44')](handleError(_0x64efc2,null));}; \ No newline at end of file +var _0x24a4=['nolimit','pick','filter','where','merge','map','options','findAll','rows','catch','params','attributes','length','includeAll','include','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','SugarcrmField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24a4,0xe4));var _0x424a=function(_0x5ebfa3,_0xa33fb4){_0x5ebfa3=_0x5ebfa3-0x0;var _0x355bef=_0x24a4[_0x5ebfa3];return _0x355bef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x424a('0x0'));var zipdir=require(_0x424a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x424a('0x2'));var moment=require(_0x424a('0x3'));var BPromise=require(_0x424a('0x4'));var Mustache=require(_0x424a('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x424a('0x6'));var ejs=require(_0x424a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x424a('0x8'));var squel=require(_0x424a('0x9'));var crypto=require('crypto');var jsforce=require(_0x424a('0xa'));var deskjs=require(_0x424a('0xb'));var toCsv=require(_0x424a('0x6'));var querystring=require(_0x424a('0xc'));var Papa=require(_0x424a('0xd'));var Redis=require(_0x424a('0xe'));var authService=require(_0x424a('0xf'));var qs=require(_0x424a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x424a('0x11'))('api');var utils=require(_0x424a('0x12'));var config=require(_0x424a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x424a('0x14'))['db'];function respondWithStatusCode(_0x4e4ff2,_0x189306){_0x189306=_0x189306||0xcc;return function(_0x5b141d){if(_0x5b141d){return _0x4e4ff2[_0x424a('0x15')](_0x189306);}return _0x4e4ff2['status'](_0x189306)[_0x424a('0x16')]();};}function respondWithResult(_0x6ccc91,_0x5694b7){_0x5694b7=_0x5694b7||0xc8;return function(_0x160c1e){if(_0x160c1e){return _0x6ccc91[_0x424a('0x17')](_0x5694b7)[_0x424a('0x18')](_0x160c1e);}};}function respondWithFilteredResult(_0x19ac93,_0x3277b2){return function(_0x4da761){if(_0x4da761){var _0x578ed2=typeof _0x3277b2[_0x424a('0x19')]===_0x424a('0x1a')&&typeof _0x3277b2[_0x424a('0x1b')]==='undefined';var _0x563506=_0x4da761[_0x424a('0x1c')];var _0x365c0f=_0x578ed2?0x0:_0x3277b2['offset'];var _0x3f50e5=_0x578ed2?_0x4da761[_0x424a('0x1c')]:_0x3277b2[_0x424a('0x19')]+_0x3277b2['limit'];var _0x1944fa;if(_0x3f50e5>=_0x563506){_0x3f50e5=_0x563506;_0x1944fa=0xc8;}else{_0x1944fa=0xce;}_0x19ac93['status'](_0x1944fa);return _0x19ac93[_0x424a('0x1d')](_0x424a('0x1e'),_0x365c0f+'-'+_0x3f50e5+'/'+_0x563506)[_0x424a('0x18')](_0x4da761);}return null;};}function patchUpdates(_0x2b258e){return function(_0xd39aac){try{jsonpatch[_0x424a('0x1f')](_0xd39aac,_0x2b258e,!![]);}catch(_0x30293f){return BPromise['reject'](_0x30293f);}return _0xd39aac[_0x424a('0x20')]();};}function saveUpdates(_0x224fa4,_0xb462c3){return function(_0x12522d){if(_0x12522d){return _0x12522d[_0x424a('0x21')](_0x224fa4)[_0x424a('0x22')](function(_0x4cf596){return _0x4cf596;});}return null;};}function removeEntity(_0x3acb96,_0x109ed3){return function(_0x2f33d1){if(_0x2f33d1){return _0x2f33d1[_0x424a('0x23')]()['then'](function(){_0x3acb96[_0x424a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40aae6,_0xfdf1dc){return function(_0x458951){if(!_0x458951){_0x40aae6[_0x424a('0x15')](0x194);}return _0x458951;};}function handleError(_0x250456,_0x50774f){_0x50774f=_0x50774f||0x1f4;return function(_0x27baef){logger[_0x424a('0x24')](_0x27baef[_0x424a('0x25')]);if(_0x27baef[_0x424a('0x26')]){delete _0x27baef[_0x424a('0x26')];}_0x250456[_0x424a('0x17')](_0x50774f)[_0x424a('0x27')](_0x27baef);};}exports[_0x424a('0x28')]=function(_0x40d2df,_0x345517){var _0x4e039f={},_0x293352={},_0x3315ca={'count':0x0,'rows':[]};var _0x541230=_['map'](db[_0x424a('0x29')][_0x424a('0x2a')],function(_0x149714){return{'name':_0x149714[_0x424a('0x2b')],'type':_0x149714[_0x424a('0x2c')]['key']};});_0x293352[_0x424a('0x2d')]=_['map'](_0x541230,_0x424a('0x26'));_0x293352[_0x424a('0x2e')]=_[_0x424a('0x2f')](_0x40d2df[_0x424a('0x2e')]);_0x293352[_0x424a('0x30')]=_[_0x424a('0x31')](_0x293352[_0x424a('0x2d')],_0x293352[_0x424a('0x2e')]);_0x4e039f['attributes']=_[_0x424a('0x31')](_0x293352[_0x424a('0x2d')],qs[_0x424a('0x32')](_0x40d2df[_0x424a('0x2e')][_0x424a('0x32')]));_0x4e039f['attributes']=_0x4e039f['attributes']['length']?_0x4e039f['attributes']:_0x293352[_0x424a('0x2d')];if(!_0x40d2df['query'][_0x424a('0x33')](_0x424a('0x34'))){_0x4e039f[_0x424a('0x1b')]=qs[_0x424a('0x1b')](_0x40d2df['query'][_0x424a('0x1b')]);_0x4e039f[_0x424a('0x19')]=qs[_0x424a('0x19')](_0x40d2df[_0x424a('0x2e')][_0x424a('0x19')]);}_0x4e039f['order']=qs['sort'](_0x40d2df['query']['sort']);_0x4e039f['where']=qs[_0x424a('0x30')](_[_0x424a('0x35')](_0x40d2df[_0x424a('0x2e')],_0x293352[_0x424a('0x30')]),_0x541230);if(_0x40d2df[_0x424a('0x2e')][_0x424a('0x36')]){_0x4e039f[_0x424a('0x37')]=_[_0x424a('0x38')](_0x4e039f[_0x424a('0x37')],{'$or':_[_0x424a('0x39')](_0x541230,function(_0x1fe3ed){if(_0x1fe3ed[_0x424a('0x2c')]!=='VIRTUAL'){var _0x4c5568={};_0x4c5568[_0x1fe3ed[_0x424a('0x26')]]={'$like':'%'+_0x40d2df[_0x424a('0x2e')]['filter']+'%'};return _0x4c5568;}})});}_0x4e039f=_[_0x424a('0x38')]({},_0x4e039f,_0x40d2df[_0x424a('0x3a')]);var _0x569056={'where':_0x4e039f[_0x424a('0x37')]};return db['SugarcrmField'][_0x424a('0x1c')](_0x569056)[_0x424a('0x22')](function(_0x2e72f3){_0x3315ca[_0x424a('0x1c')]=_0x2e72f3;if(_0x40d2df[_0x424a('0x2e')]['includeAll']){_0x4e039f['include']=[{'all':!![]}];}return db[_0x424a('0x29')][_0x424a('0x3b')](_0x4e039f);})[_0x424a('0x22')](function(_0xaf1539){_0x3315ca[_0x424a('0x3c')]=_0xaf1539;return _0x3315ca;})[_0x424a('0x22')](respondWithFilteredResult(_0x345517,_0x4e039f))[_0x424a('0x3d')](handleError(_0x345517,null));};exports['show']=function(_0x33d07e,_0x2f0964){var _0x19942c={'raw':!![],'where':{'id':_0x33d07e[_0x424a('0x3e')]['id']}},_0x5a9d01={};_0x5a9d01['model']=_[_0x424a('0x2f')](db[_0x424a('0x29')][_0x424a('0x2a')]);_0x5a9d01[_0x424a('0x2e')]=_[_0x424a('0x2f')](_0x33d07e[_0x424a('0x2e')]);_0x5a9d01[_0x424a('0x30')]=_['intersection'](_0x5a9d01['model'],_0x5a9d01[_0x424a('0x2e')]);_0x19942c[_0x424a('0x3f')]=_['intersection'](_0x5a9d01[_0x424a('0x2d')],qs[_0x424a('0x32')](_0x33d07e['query']['fields']));_0x19942c[_0x424a('0x3f')]=_0x19942c['attributes'][_0x424a('0x40')]?_0x19942c[_0x424a('0x3f')]:_0x5a9d01['model'];if(_0x33d07e['query'][_0x424a('0x41')]){_0x19942c[_0x424a('0x42')]=[{'all':!![]}];}_0x19942c=_[_0x424a('0x38')]({},_0x19942c,_0x33d07e[_0x424a('0x3a')]);return db[_0x424a('0x29')][_0x424a('0x43')](_0x19942c)[_0x424a('0x22')](handleEntityNotFound(_0x2f0964,null))[_0x424a('0x22')](respondWithResult(_0x2f0964,null))['catch'](handleError(_0x2f0964,null));};exports[_0x424a('0x44')]=function(_0x51a38f,_0x4e36c4){return db[_0x424a('0x29')][_0x424a('0x44')](_0x51a38f[_0x424a('0x45')],{})[_0x424a('0x22')](respondWithResult(_0x4e36c4,0xc9))[_0x424a('0x3d')](handleError(_0x4e36c4,null));};exports[_0x424a('0x21')]=function(_0x4a0447,_0x119df3){if(_0x4a0447[_0x424a('0x45')]['id']){delete _0x4a0447[_0x424a('0x45')]['id'];}return db[_0x424a('0x29')][_0x424a('0x43')]({'where':{'id':_0x4a0447[_0x424a('0x3e')]['id']}})[_0x424a('0x22')](handleEntityNotFound(_0x119df3,null))[_0x424a('0x22')](saveUpdates(_0x4a0447[_0x424a('0x45')],null))[_0x424a('0x22')](respondWithResult(_0x119df3,null))[_0x424a('0x3d')](handleError(_0x119df3,null));};exports[_0x424a('0x23')]=function(_0x4a1ae3,_0x36b0c8){return db[_0x424a('0x29')][_0x424a('0x43')]({'where':{'id':_0x4a1ae3['params']['id']}})[_0x424a('0x22')](handleEntityNotFound(_0x36b0c8,null))[_0x424a('0x22')](removeEntity(_0x36b0c8,null))[_0x424a('0x3d')](handleError(_0x36b0c8,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 7f2ecbc..3faf863 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 _0x2500=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields','sugarcrm_unique_index','idField'];(function(_0x13ff53,_0x5e1424){var _0x290228=function(_0x3e3133){while(--_0x3e3133){_0x13ff53['push'](_0x13ff53['shift']());}};_0x290228(++_0x5e1424);}(_0x2500,0xa8));var _0x0250=function(_0x152c9d,_0x371656){_0x152c9d=_0x152c9d-0x0;var _0x462f34=_0x2500[_0x152c9d];return _0x462f34;};'use strict';var _=require('lodash');var util=require(_0x0250('0x0'));var logger=require(_0x0250('0x1'))(_0x0250('0x2'));var moment=require(_0x0250('0x3'));var BPromise=require(_0x0250('0x4'));var rp=require(_0x0250('0x5'));var fs=require('fs');var path=require(_0x0250('0x6'));var rimraf=require(_0x0250('0x7'));var config=require('../../config/environment');var attributes=require(_0x0250('0x8'));module[_0x0250('0x9')]=function(_0x40060f,_0x13adde){return _0x40060f[_0x0250('0xa')]('SugarcrmField',attributes,{'tableName':_0x0250('0xb'),'paranoid':![],'indexes':[{'name':_0x0250('0xc'),'fields':[_0x0250('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x30b6=['moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','api'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x30b6,0x16d));var _0x630b=function(_0x5379b7,_0xd5be03){_0x5379b7=_0x5379b7-0x0;var _0x34bce6=_0x30b6[_0x5379b7];return _0x34bce6;};'use strict';var _=require(_0x630b('0x0'));var util=require(_0x630b('0x1'));var logger=require('../../config/logger')(_0x630b('0x2'));var moment=require(_0x630b('0x3'));var BPromise=require(_0x630b('0x4'));var rp=require(_0x630b('0x5'));var fs=require('fs');var path=require(_0x630b('0x6'));var rimraf=require('rimraf');var config=require(_0x630b('0x7'));var attributes=require(_0x630b('0x8'));module[_0x630b('0x9')]=function(_0x6779ce,_0x553455){return _0x6779ce[_0x630b('0xa')](_0x630b('0xb'),attributes,{'tableName':_0x630b('0xc'),'paranoid':![],'indexes':[{'name':_0x630b('0xd'),'fields':[_0x630b('0xe'),_0x630b('0xf')],'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 55c10a9..19d9821 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 _0x3927=['SugarcrmField,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x502821,_0x421733){var _0x512f2e=function(_0x543e2d){while(--_0x543e2d){_0x502821['push'](_0x502821['shift']());}};_0x512f2e(++_0x421733);}(_0x3927,0x8d));var _0x7392=function(_0x2917d7,_0x366c1c){_0x2917d7=_0x2917d7-0x0;var _0x4da15b=_0x3927[_0x2917d7];return _0x4da15b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7392('0x0'));var BPromise=require(_0x7392('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7392('0x2'));var db=require(_0x7392('0x3'))['db'];var utils=require(_0x7392('0x4'));var logger=require(_0x7392('0x5'))(_0x7392('0x6'));var config=require(_0x7392('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7392('0x8')][_0x7392('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c6629,_0x26af7b,_0x15f77c){return new BPromise(function(_0x369084,_0x260fbe){return client['request'](_0x5c6629,_0x15f77c)[_0x7392('0xa')](function(_0x52ae72){logger['info'](_0x7392('0xb'),_0x26af7b,'request\x20sent');logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x26af7b,'request\x20sent',JSON[_0x7392('0xc')](_0x52ae72));if(_0x52ae72['error']){if(_0x52ae72[_0x7392('0xd')][_0x7392('0xe')]===0x1f4){logger[_0x7392('0xd')](_0x7392('0xb'),_0x26af7b,_0x52ae72['error'][_0x7392('0xf')]);return _0x260fbe(_0x52ae72[_0x7392('0xd')][_0x7392('0xf')]);}logger[_0x7392('0xd')](_0x7392('0xb'),_0x26af7b,_0x52ae72[_0x7392('0xd')][_0x7392('0xf')]);return _0x369084(_0x52ae72[_0x7392('0xd')][_0x7392('0xf')]);}else{logger['info'](_0x7392('0xb'),_0x26af7b,_0x7392('0x10'));_0x369084(_0x52ae72[_0x7392('0x11')][_0x7392('0xf')]);}})[_0x7392('0x12')](function(_0x39ac0a){logger['error'](_0x7392('0xb'),_0x26af7b,_0x39ac0a);_0x260fbe(_0x39ac0a);});});} \ No newline at end of file +var _0xf3a3=['info','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x37b5be,_0x167703){var _0x4ace04=function(_0x175483){while(--_0x175483){_0x37b5be['push'](_0x37b5be['shift']());}};_0x4ace04(++_0x167703);}(_0xf3a3,0xa8));var _0x3f3a=function(_0x279d4a,_0x3cdf4d){_0x279d4a=_0x279d4a-0x0;var _0x2f8ab6=_0xf3a3[_0x279d4a];return _0x2f8ab6;};'use strict';var _=require('lodash');var util=require(_0x3f3a('0x0'));var moment=require(_0x3f3a('0x1'));var BPromise=require(_0x3f3a('0x2'));var rs=require(_0x3f3a('0x3'));var fs=require('fs');var Redis=require(_0x3f3a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f3a('0x5'));var logger=require(_0x3f3a('0x6'))(_0x3f3a('0x7'));var config=require(_0x3f3a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3f3a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc9edaf,_0x297be3,_0xf37f78){return new BPromise(function(_0x4d6ded,_0x5d2402){return client[_0x3f3a('0xa')](_0xc9edaf,_0xf37f78)[_0x3f3a('0xb')](function(_0x4ede2f){logger[_0x3f3a('0xc')](_0x3f3a('0xd'),_0x297be3,'request\x20sent');logger['debug'](_0x3f3a('0xe'),_0x297be3,'request\x20sent',JSON[_0x3f3a('0xf')](_0x4ede2f));if(_0x4ede2f[_0x3f3a('0x10')]){if(_0x4ede2f['error']['code']===0x1f4){logger[_0x3f3a('0x10')](_0x3f3a('0xd'),_0x297be3,_0x4ede2f['error'][_0x3f3a('0x11')]);return _0x5d2402(_0x4ede2f[_0x3f3a('0x10')][_0x3f3a('0x11')]);}logger[_0x3f3a('0x10')](_0x3f3a('0xd'),_0x297be3,_0x4ede2f['error'][_0x3f3a('0x11')]);return _0x4d6ded(_0x4ede2f['error'][_0x3f3a('0x11')]);}else{logger[_0x3f3a('0xc')](_0x3f3a('0xd'),_0x297be3,_0x3f3a('0x12'));_0x4d6ded(_0x4ede2f['result'][_0x3f3a('0x11')]);}})[_0x3f3a('0x13')](function(_0x415998){logger[_0x3f3a('0x10')](_0x3f3a('0xd'),_0x297be3,_0x415998);_0x5d2402(_0x415998);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 6ff9451..3771ec0 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 _0xc0aa=['/:id/fields','post','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations'];(function(_0x3c0555,_0x543d75){var _0x2713ec=function(_0x4f3367){while(--_0x4f3367){_0x3c0555['push'](_0x3c0555['shift']());}};_0x2713ec(++_0x543d75);}(_0xc0aa,0x64));var _0xac0a=function(_0x51e939,_0x37808f){_0x51e939=_0x51e939-0x0;var _0x5b825c=_0xc0aa[_0x51e939];return _0x5b825c;};'use strict';var multer=require(_0xac0a('0x0'));var util=require(_0xac0a('0x1'));var path=require(_0xac0a('0x2'));var timeout=require(_0xac0a('0x3'));var express=require(_0xac0a('0x4'));var router=express[_0xac0a('0x5')]();var fs_extra=require(_0xac0a('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac0a('0x7'));var controller=require(_0xac0a('0x8'));router[_0xac0a('0x9')]('/',auth[_0xac0a('0xa')](),controller['index']);router['get'](_0xac0a('0xb'),auth[_0xac0a('0xa')](),controller[_0xac0a('0xc')]);router[_0xac0a('0x9')](_0xac0a('0xd'),auth[_0xac0a('0xa')](),controller['getConfigurations']);router[_0xac0a('0x9')](_0xac0a('0xe'),auth[_0xac0a('0xa')](),controller['getFields']);router['post']('/',auth[_0xac0a('0xa')](),controller['create']);router[_0xac0a('0xf')](_0xac0a('0xd'),auth[_0xac0a('0xa')](),controller['addConfiguration']);router['put'](_0xac0a('0xb'),auth[_0xac0a('0xa')](),controller['update']);router[_0xac0a('0x10')](_0xac0a('0xb'),auth[_0xac0a('0xa')](),controller[_0xac0a('0x11')]);module[_0xac0a('0x12')]=router; \ No newline at end of file +var _0x03ce=['put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration'];(function(_0x1247e8,_0x1d9374){var _0x3bbb92=function(_0x5b1e46){while(--_0x5b1e46){_0x1247e8['push'](_0x1247e8['shift']());}};_0x3bbb92(++_0x1d9374);}(_0x03ce,0x1a1));var _0xe03c=function(_0x3d1717,_0x24d397){_0x3d1717=_0x3d1717-0x0;var _0x4d6633=_0x03ce[_0x3d1717];return _0x4d6633;};'use strict';var multer=require(_0xe03c('0x0'));var util=require(_0xe03c('0x1'));var path=require(_0xe03c('0x2'));var timeout=require(_0xe03c('0x3'));var express=require('express');var router=express[_0xe03c('0x4')]();var fs_extra=require(_0xe03c('0x5'));var auth=require(_0xe03c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe03c('0x7'));var controller=require(_0xe03c('0x8'));router[_0xe03c('0x9')]('/',auth[_0xe03c('0xa')](),controller[_0xe03c('0xb')]);router[_0xe03c('0x9')](_0xe03c('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xe03c('0x9')](_0xe03c('0xd'),auth[_0xe03c('0xa')](),controller[_0xe03c('0xe')]);router[_0xe03c('0x9')](_0xe03c('0xf'),auth[_0xe03c('0xa')](),controller[_0xe03c('0x10')]);router['post']('/',auth[_0xe03c('0xa')](),controller[_0xe03c('0x11')]);router[_0xe03c('0x12')]('/:id/configurations',auth[_0xe03c('0xa')](),controller[_0xe03c('0x13')]);router[_0xe03c('0x14')](_0xe03c('0xc'),auth[_0xe03c('0xa')](),controller['update']);router[_0xe03c('0x15')](_0xe03c('0xc'),auth[_0xe03c('0xa')](),controller['destroy']);module[_0xe03c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index ea36f12..0933551 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 _0x1436=['exports','STRING','sequelize'];(function(_0x39124f,_0x331250){var _0x25cc6a=function(_0x1b3857){while(--_0x1b3857){_0x39124f['push'](_0x39124f['shift']());}};_0x25cc6a(++_0x331250);}(_0x1436,0xfb));var _0x6143=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1436[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x6143('0x0'));module[_0x6143('0x1')]={'name':{'type':Sequelize[_0x6143('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6143('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x6143('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x6143('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x6143('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xdec8=['HelpDesk','STRING','sequelize'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xdec8,0x1a6));var _0x8dec=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xdec8[_0x10004e];return _0x5af990;};'use strict';var Sequelize=require(_0x8dec('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8dec('0x1')},'remoteUri':{'type':Sequelize[_0x8dec('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x8dec('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x8dec('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 d8c8c76..cece08a 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 _0x8d89=['to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','VtigerAccount','include','findAll','params','length','find','catch','create','body','getConfigurations','VtigerConfiguration','nolimit','AccountId','getSubjects','Descriptions','getDescriptions','channel','VtigerField','Subjects','md5','getFields','findOne','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','token','describe','result','autogenerated','owner','remove','includes','editable','false','label','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','util','sox'];(function(_0x2288eb,_0xacc91){var _0x237c71=function(_0x45c181){while(--_0x45c181){_0x2288eb['push'](_0x2288eb['shift']());}};_0x237c71(++_0xacc91);}(_0x8d89,0x1ce));var _0x98d8=function(_0x49bba0,_0x54eed6){_0x49bba0=_0x49bba0-0x0;var _0x4a4fde=_0x8d89[_0x49bba0];return _0x4a4fde;};'use strict';var emlformat=require(_0x98d8('0x0'));var rimraf=require(_0x98d8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x98d8('0x2'));var rp=require(_0x98d8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x98d8('0x4'));var path=require('path');var sox=require(_0x98d8('0x5'));var csv=require(_0x98d8('0x6'));var ejs=require(_0x98d8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x98d8('0x8'));var squel=require(_0x98d8('0x9'));var crypto=require(_0x98d8('0xa'));var jsforce=require(_0x98d8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x98d8('0x6'));var querystring=require(_0x98d8('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x98d8('0xd'));var qs=require(_0x98d8('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98d8('0xf'));var logger=require(_0x98d8('0x10'))(_0x98d8('0x11'));var utils=require(_0x98d8('0x12'));var config=require(_0x98d8('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x98d8('0x14'))['db'];var integrations=require(_0x98d8('0x15'));function respondWithStatusCode(_0x1ae769,_0x40fdcf){_0x40fdcf=_0x40fdcf||0xcc;return function(_0x4c242d){if(_0x4c242d){return _0x1ae769['sendStatus'](_0x40fdcf);}return _0x1ae769[_0x98d8('0x16')](_0x40fdcf)[_0x98d8('0x17')]();};}function respondWithResult(_0x55a0a5,_0xe79214){_0xe79214=_0xe79214||0xc8;return function(_0x44025a){if(_0x44025a){return _0x55a0a5[_0x98d8('0x16')](_0xe79214)[_0x98d8('0x18')](_0x44025a);}};}function respondWithFilteredResult(_0x193242,_0x3180fb){return function(_0x3b8d7f){if(_0x3b8d7f){var _0x2a74e3=typeof _0x3180fb[_0x98d8('0x19')]===_0x98d8('0x1a')&&typeof _0x3180fb[_0x98d8('0x1b')]===_0x98d8('0x1a');var _0x588d6b=_0x3b8d7f[_0x98d8('0x1c')];var _0x232342=_0x2a74e3?0x0:_0x3180fb[_0x98d8('0x19')];var _0x337372=_0x2a74e3?_0x3b8d7f[_0x98d8('0x1c')]:_0x3180fb['offset']+_0x3180fb[_0x98d8('0x1b')];var _0x4916f9;if(_0x337372>=_0x588d6b){_0x337372=_0x588d6b;_0x4916f9=0xc8;}else{_0x4916f9=0xce;}_0x193242[_0x98d8('0x16')](_0x4916f9);return _0x193242[_0x98d8('0x1d')](_0x98d8('0x1e'),_0x232342+'-'+_0x337372+'/'+_0x588d6b)['json'](_0x3b8d7f);}return null;};}function patchUpdates(_0x555dab){return function(_0x455e22){try{jsonpatch['apply'](_0x455e22,_0x555dab,!![]);}catch(_0x4b6711){return BPromise[_0x98d8('0x1f')](_0x4b6711);}return _0x455e22['save']();};}function saveUpdates(_0x29c9c5,_0x192074){return function(_0x5cf318){if(_0x5cf318){return _0x5cf318[_0x98d8('0x20')](_0x29c9c5)[_0x98d8('0x21')](function(_0x380d17){return _0x380d17;});}return null;};}function removeEntity(_0x3029c2,_0x6fcae3){return function(_0x476ece){if(_0x476ece){return _0x476ece[_0x98d8('0x22')]()[_0x98d8('0x21')](function(){_0x3029c2[_0x98d8('0x16')](0xcc)[_0x98d8('0x17')]();});}};}function handleEntityNotFound(_0x2d4173,_0x58f792){return function(_0x1ac741){if(!_0x1ac741){_0x2d4173[_0x98d8('0x23')](0x194);}return _0x1ac741;};}function handleError(_0x1db23f,_0x37837a){_0x37837a=_0x37837a||0x1f4;return function(_0x359845){logger[_0x98d8('0x24')](_0x359845[_0x98d8('0x25')]);if(_0x359845[_0x98d8('0x26')]){delete _0x359845[_0x98d8('0x26')];}_0x1db23f[_0x98d8('0x16')](_0x37837a)['send'](_0x359845);};}exports[_0x98d8('0x27')]=function(_0x405b34,_0x3b9000){var _0x38dd4f={},_0x444781={},_0xc0f0a0={'count':0x0,'rows':[]};var _0x57e4cd=_[_0x98d8('0x28')](db['VtigerAccount'][_0x98d8('0x29')],function(_0x3ffe6a){return{'name':_0x3ffe6a[_0x98d8('0x2a')],'type':_0x3ffe6a[_0x98d8('0x2b')][_0x98d8('0x2c')]};});_0x444781[_0x98d8('0x2d')]=_[_0x98d8('0x28')](_0x57e4cd,_0x98d8('0x26'));_0x444781[_0x98d8('0x2e')]=_[_0x98d8('0x2f')](_0x405b34[_0x98d8('0x2e')]);_0x444781[_0x98d8('0x30')]=_[_0x98d8('0x31')](_0x444781[_0x98d8('0x2d')],_0x444781[_0x98d8('0x2e')]);_0x38dd4f[_0x98d8('0x32')]=_[_0x98d8('0x31')](_0x444781['model'],qs[_0x98d8('0x33')](_0x405b34[_0x98d8('0x2e')][_0x98d8('0x33')]));_0x38dd4f[_0x98d8('0x32')]=_0x38dd4f[_0x98d8('0x32')]['length']?_0x38dd4f['attributes']:_0x444781['model'];if(!_0x405b34[_0x98d8('0x2e')][_0x98d8('0x34')]('nolimit')){_0x38dd4f[_0x98d8('0x1b')]=qs[_0x98d8('0x1b')](_0x405b34[_0x98d8('0x2e')][_0x98d8('0x1b')]);_0x38dd4f[_0x98d8('0x19')]=qs['offset'](_0x405b34[_0x98d8('0x2e')][_0x98d8('0x19')]);}_0x38dd4f['order']=qs['sort'](_0x405b34[_0x98d8('0x2e')][_0x98d8('0x35')]);_0x38dd4f[_0x98d8('0x36')]=qs[_0x98d8('0x30')](_[_0x98d8('0x37')](_0x405b34['query'],_0x444781[_0x98d8('0x30')]),_0x57e4cd);if(_0x405b34['query'][_0x98d8('0x38')]){_0x38dd4f[_0x98d8('0x36')]=_[_0x98d8('0x39')](_0x38dd4f[_0x98d8('0x36')],{'$or':_['map'](_0x57e4cd,function(_0x335089){if(_0x335089[_0x98d8('0x2b')]!==_0x98d8('0x3a')){var _0x153799={};_0x153799[_0x335089['name']]={'$like':'%'+_0x405b34['query'][_0x98d8('0x38')]+'%'};return _0x153799;}})});}_0x38dd4f=_[_0x98d8('0x39')]({},_0x38dd4f,_0x405b34[_0x98d8('0x3b')]);var _0x1a2820={'where':_0x38dd4f[_0x98d8('0x36')]};return db[_0x98d8('0x3c')][_0x98d8('0x1c')](_0x1a2820)['then'](function(_0x37cdbf){_0xc0f0a0[_0x98d8('0x1c')]=_0x37cdbf;if(_0x405b34[_0x98d8('0x2e')]['includeAll']){_0x38dd4f[_0x98d8('0x3d')]=[{'all':!![]}];}return db['VtigerAccount'][_0x98d8('0x3e')](_0x38dd4f);})[_0x98d8('0x21')](function(_0x584054){_0xc0f0a0['rows']=_0x584054;return _0xc0f0a0;})[_0x98d8('0x21')](respondWithFilteredResult(_0x3b9000,_0x38dd4f))['catch'](handleError(_0x3b9000,null));};exports['show']=function(_0x1691df,_0x15bdd5){var _0x16ab87={'raw':![],'where':{'id':_0x1691df[_0x98d8('0x3f')]['id']}},_0x54eb55={};_0x54eb55[_0x98d8('0x2d')]=_[_0x98d8('0x2f')](db[_0x98d8('0x3c')][_0x98d8('0x29')]);_0x54eb55[_0x98d8('0x2e')]=_[_0x98d8('0x2f')](_0x1691df[_0x98d8('0x2e')]);_0x54eb55['filters']=_[_0x98d8('0x31')](_0x54eb55['model'],_0x54eb55['query']);_0x16ab87[_0x98d8('0x32')]=_['intersection'](_0x54eb55['model'],qs[_0x98d8('0x33')](_0x1691df[_0x98d8('0x2e')][_0x98d8('0x33')]));_0x16ab87['attributes']=_0x16ab87[_0x98d8('0x32')][_0x98d8('0x40')]?_0x16ab87[_0x98d8('0x32')]:_0x54eb55[_0x98d8('0x2d')];if(_0x1691df['query']['includeAll']){_0x16ab87['include']=[{'all':!![]}];}_0x16ab87=_[_0x98d8('0x39')]({},_0x16ab87,_0x1691df['options']);return db[_0x98d8('0x3c')][_0x98d8('0x41')](_0x16ab87)[_0x98d8('0x21')](handleEntityNotFound(_0x15bdd5,null))[_0x98d8('0x21')](respondWithResult(_0x15bdd5,null))[_0x98d8('0x42')](handleError(_0x15bdd5,null));};exports[_0x98d8('0x43')]=function(_0x9444e6,_0x20132e){return db[_0x98d8('0x3c')]['create'](_0x9444e6['body'],{})[_0x98d8('0x21')](respondWithResult(_0x20132e,0xc9))[_0x98d8('0x42')](handleError(_0x20132e,null));};exports[_0x98d8('0x20')]=function(_0xa1fc06,_0x483b06){if(_0xa1fc06[_0x98d8('0x44')]['id']){delete _0xa1fc06[_0x98d8('0x44')]['id'];}return db[_0x98d8('0x3c')][_0x98d8('0x41')]({'where':{'id':_0xa1fc06[_0x98d8('0x3f')]['id']}})[_0x98d8('0x21')](handleEntityNotFound(_0x483b06,null))['then'](saveUpdates(_0xa1fc06[_0x98d8('0x44')],null))['then'](respondWithResult(_0x483b06,null))[_0x98d8('0x42')](handleError(_0x483b06,null));};exports[_0x98d8('0x22')]=function(_0x19de8a,_0x1a285b){return db[_0x98d8('0x3c')][_0x98d8('0x41')]({'where':{'id':_0x19de8a['params']['id']}})[_0x98d8('0x21')](handleEntityNotFound(_0x1a285b,null))['then'](removeEntity(_0x1a285b,null))[_0x98d8('0x42')](handleError(_0x1a285b,null));};exports[_0x98d8('0x45')]=function(_0x2ca589,_0x491520,_0x184b43){var _0x15d754={};var _0x456283={};var _0x236e8a;var _0x5ec4d0;return db[_0x98d8('0x3c')]['findOne']({'where':{'id':_0x2ca589[_0x98d8('0x3f')]['id']}})[_0x98d8('0x21')](handleEntityNotFound(_0x491520,null))['then'](function(_0x33d219){if(_0x33d219){_0x236e8a=_0x33d219;_0x456283['model']=_[_0x98d8('0x2f')](db[_0x98d8('0x46')][_0x98d8('0x29')]);_0x456283[_0x98d8('0x2e')]=_[_0x98d8('0x2f')](_0x2ca589['query']);_0x456283[_0x98d8('0x30')]=_['intersection'](_0x456283[_0x98d8('0x2d')],_0x456283[_0x98d8('0x2e')]);_0x15d754[_0x98d8('0x32')]=_[_0x98d8('0x31')](_0x456283[_0x98d8('0x2d')],qs[_0x98d8('0x33')](_0x2ca589[_0x98d8('0x2e')]['fields']));_0x15d754[_0x98d8('0x32')]=_0x15d754[_0x98d8('0x32')][_0x98d8('0x40')]?_0x15d754[_0x98d8('0x32')]:_0x456283[_0x98d8('0x2d')];_0x15d754['order']=qs[_0x98d8('0x35')](_0x2ca589[_0x98d8('0x2e')]['sort']);_0x15d754[_0x98d8('0x36')]=qs[_0x98d8('0x30')](_[_0x98d8('0x37')](_0x2ca589[_0x98d8('0x2e')],_0x456283[_0x98d8('0x30')]));if(_0x2ca589['query'][_0x98d8('0x38')]){_0x15d754[_0x98d8('0x36')]=_['merge'](_0x15d754['where'],{'$or':_['map'](_0x15d754[_0x98d8('0x32')],function(_0x274ec0){var _0xb93484={};_0xb93484[_0x274ec0]={'$like':'%'+_0x2ca589[_0x98d8('0x2e')][_0x98d8('0x38')]+'%'};return _0xb93484;})});}_0x15d754=_['merge']({},_0x15d754,_0x2ca589[_0x98d8('0x3b')]);return _0x236e8a[_0x98d8('0x45')](_0x15d754);}})[_0x98d8('0x21')](function(_0x322f05){if(_0x322f05){_0x5ec4d0=_0x322f05['length'];if(!_0x2ca589[_0x98d8('0x2e')][_0x98d8('0x34')](_0x98d8('0x47'))){_0x15d754[_0x98d8('0x1b')]=qs['limit'](_0x2ca589['query']['limit']);_0x15d754['offset']=qs['offset'](_0x2ca589[_0x98d8('0x2e')]['offset']);}return _0x236e8a['getConfigurations'](_0x15d754);}})['then'](function(_0x331612){if(_0x331612){return _0x331612?{'count':_0x5ec4d0,'rows':_0x331612}:null;}})[_0x98d8('0x21')](respondWithResult(_0x491520,null))[_0x98d8('0x42')](handleError(_0x491520,null));};exports['addConfiguration']=function(_0x4c6a6e,_0x48381f,_0x58ee51){if(_0x4c6a6e[_0x98d8('0x44')]['id']){delete _0x4c6a6e['body']['id'];}return db[_0x98d8('0x3c')]['findOne']({'where':{'id':_0x4c6a6e[_0x98d8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x48381f,null))[_0x98d8('0x21')](function(_0x16a628){if(_0x16a628){_0x4c6a6e[_0x98d8('0x44')][_0x98d8('0x48')]=_0x16a628['id'];_0x4c6a6e[_0x98d8('0x44')]['Subjects']=integrations[_0x98d8('0x49')](_0x4c6a6e[_0x98d8('0x44')]['channel'],_0x4c6a6e[_0x98d8('0x44')][_0x98d8('0x2b')]);_0x4c6a6e[_0x98d8('0x44')][_0x98d8('0x4a')]=integrations[_0x98d8('0x4b')](_0x4c6a6e['body'][_0x98d8('0x4c')],_0x4c6a6e[_0x98d8('0x44')][_0x98d8('0x2b')]);return db[_0x98d8('0x46')][_0x98d8('0x43')](_0x4c6a6e[_0x98d8('0x44')],{'include':[{'model':db[_0x98d8('0x4d')],'as':_0x98d8('0x4e')},{'model':db['VtigerField'],'as':_0x98d8('0x4a')}]});}return null;})[_0x98d8('0x21')](respondWithResult(_0x48381f,null))['catch'](handleError(_0x48381f,null));};var md5=require(_0x98d8('0x4f'));exports[_0x98d8('0x50')]=function(_0x397448,_0x33c5c5,_0x4cbc0f){var _0x5b0abb=null;var _0x3c68db=null;var _0x2c40c3=null;var _0x3c95f6=null;var _0x4baf3d='';return db[_0x98d8('0x3c')][_0x98d8('0x51')]({'where':{'id':_0x397448[_0x98d8('0x3f')]['id']},'attributes':['id',_0x98d8('0x26'),_0x98d8('0x52'),_0x98d8('0x53'),_0x98d8('0x54'),_0x98d8('0x55'),_0x98d8('0x56'),_0x98d8('0x57')]})[_0x98d8('0x21')](handleEntityNotFound(_0x33c5c5,null))['then'](function(_0x1738b8){if(_0x1738b8){_0x5b0abb=_0x1738b8[_0x98d8('0x52')];_0x3c68db=_0x1738b8[_0x98d8('0x57')];_0x2c40c3=_0x1738b8[_0x98d8('0x54')];_0x4baf3d=_0x1738b8[_0x98d8('0x55')];var _0x4c7fe9=_0x4baf3d[_0x98d8('0x58')](-0x1);if(_0x4c7fe9==='/'){_0x4baf3d=_0x4baf3d[_0x98d8('0x59')](0x0,_0x4baf3d[_0x98d8('0x5a')](_0x4c7fe9));}_0x3c95f6=util[_0x98d8('0x5b')](_0x98d8('0x5c'),_0x4baf3d);var _0x2883b7={'method':_0x98d8('0x5d'),'uri':_0x3c95f6,'qs':{'operation':_0x98d8('0x5e'),'username':_0x1738b8[_0x98d8('0x52')]},'json':!![]};return rp(_0x2883b7);}})[_0x98d8('0x21')](function(_0x2a5cde){if(_0x2a5cde[_0x98d8('0x5f')]){var _0x3414a7={'method':_0x98d8('0x60'),'uri':_0x3c95f6,'form':{'operation':'login','username':_0x5b0abb,'accessKey':md5(_0x2a5cde['result'][_0x98d8('0x61')]+_0x3c68db)},'json':!![]};return rp(_0x3414a7);}})['then'](function(_0x4d75ef){if(_0x4d75ef[_0x98d8('0x5f')]){var _0x257c55={'method':'GET','uri':_0x3c95f6,'qs':{'operation':_0x98d8('0x62'),'username':_0x5b0abb,'sessionName':_0x4d75ef[_0x98d8('0x63')]['sessionName'],'elementType':_0x2c40c3},'json':!![]};return rp(_0x257c55);}})[_0x98d8('0x21')](function(_0x48fbbc){if(_0x48fbbc[_0x98d8('0x5f')]){var _0xd1445e=[_0x98d8('0x64'),'reference',_0x98d8('0x65')];_[_0x98d8('0x66')](_0x48fbbc[_0x98d8('0x63')]['fields'],function(_0xf7e1d1){return _0xd1445e[_0x98d8('0x67')](_0xf7e1d1[_0x98d8('0x2b')][_0x98d8('0x26')]);});_[_0x98d8('0x66')](_0x48fbbc['result'][_0x98d8('0x33')],function(_0x39b785){return _0x39b785[_0x98d8('0x68')]===_0x98d8('0x69');});return{'count':_0x48fbbc[_0x98d8('0x63')][_0x98d8('0x33')][_0x98d8('0x40')],'rows':_[_0x98d8('0x28')](_0x48fbbc[_0x98d8('0x63')][_0x98d8('0x33')],function(_0x3fc125){return{'id':_0x3fc125[_0x98d8('0x26')],'name':_0x3fc125[_0x98d8('0x6a')],'custom':_[_0x98d8('0x6b')](_0x3fc125['name'],'cf_')?!![]:![],'options':_0x3fc125[_0x98d8('0x2b')]['name']===_0x98d8('0x6c')&&_0x3fc125[_0x98d8('0x2b')][_0x98d8('0x6d')][_0x98d8('0x40')]>0x0?_[_0x98d8('0x28')](_0x3fc125['type'][_0x98d8('0x6d')],function(_0x144034){return{'name':_0x144034[_0x98d8('0x6a')],'value':_0x144034[_0x98d8('0x6e')]};}):[]};})};}})[_0x98d8('0x21')](respondWithResult(_0x33c5c5,null))[_0x98d8('0x42')](function(_0x54b3dc){console[_0x98d8('0x6f')](_0x98d8('0x70')+_0x54b3dc);var _0x2e7c79=_0x397448[_0x98d8('0x2e')][_0x98d8('0x71')]?0x1f4:_0x54b3dc[_0x98d8('0x72')]||0x1f4;logger[_0x98d8('0x24')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x2e7c79,JSON[_0x98d8('0x73')](_0x54b3dc));delete _0x54b3dc[_0x98d8('0x26')];if(_0x2e7c79===0x191){_0x2e7c79=0x190;}_0x33c5c5['status'](_0x2e7c79)['send'](_0x397448['query'][_0x98d8('0x71')]?{'message':_0x98d8('0x74'),'statusCode':_0x54b3dc[_0x98d8('0x72')]}:_0x54b3dc);});}; \ No newline at end of file +var _0x88d4=['owner','remove','includes','editable','false','label','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','slice','substring','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','reference'];(function(_0x3ac066,_0x17eb7b){var _0xd6108a=function(_0x19b41b){while(--_0x19b41b){_0x3ac066['push'](_0x3ac066['shift']());}};_0xd6108a(++_0x17eb7b);}(_0x88d4,0x89));var _0x488d=function(_0x1d6e7e,_0x1ee548){_0x1d6e7e=_0x1d6e7e-0x0;var _0x2eeda1=_0x88d4[_0x1d6e7e];return _0x2eeda1;};'use strict';var emlformat=require(_0x488d('0x0'));var rimraf=require(_0x488d('0x1'));var zipdir=require(_0x488d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x488d('0x3'));var moment=require(_0x488d('0x4'));var BPromise=require(_0x488d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x488d('0x6'));var sox=require(_0x488d('0x7'));var csv=require(_0x488d('0x8'));var ejs=require(_0x488d('0x9'));var fs=require('fs');var fs_extra=require(_0x488d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x488d('0xb'));var jsforce=require(_0x488d('0xc'));var deskjs=require(_0x488d('0xd'));var toCsv=require(_0x488d('0x8'));var querystring=require(_0x488d('0xe'));var Papa=require(_0x488d('0xf'));var Redis=require('ioredis');var authService=require(_0x488d('0x10'));var qs=require(_0x488d('0x11'));var as=require(_0x488d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x488d('0x13'))(_0x488d('0x14'));var utils=require(_0x488d('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x488d('0x16'));function respondWithStatusCode(_0x3874e5,_0xba1392){_0xba1392=_0xba1392||0xcc;return function(_0x2e360a){if(_0x2e360a){return _0x3874e5[_0x488d('0x17')](_0xba1392);}return _0x3874e5[_0x488d('0x18')](_0xba1392)[_0x488d('0x19')]();};}function respondWithResult(_0xbbcf56,_0x1186aa){_0x1186aa=_0x1186aa||0xc8;return function(_0x34932a){if(_0x34932a){return _0xbbcf56[_0x488d('0x18')](_0x1186aa)['json'](_0x34932a);}};}function respondWithFilteredResult(_0x471984,_0x5db509){return function(_0x13d748){if(_0x13d748){var _0x2fd0e3=typeof _0x5db509['offset']===_0x488d('0x1a')&&typeof _0x5db509[_0x488d('0x1b')]===_0x488d('0x1a');var _0x3aacc3=_0x13d748[_0x488d('0x1c')];var _0x47fcc3=_0x2fd0e3?0x0:_0x5db509[_0x488d('0x1d')];var _0x49c99e=_0x2fd0e3?_0x13d748[_0x488d('0x1c')]:_0x5db509['offset']+_0x5db509[_0x488d('0x1b')];var _0x13b5a1;if(_0x49c99e>=_0x3aacc3){_0x49c99e=_0x3aacc3;_0x13b5a1=0xc8;}else{_0x13b5a1=0xce;}_0x471984['status'](_0x13b5a1);return _0x471984[_0x488d('0x1e')](_0x488d('0x1f'),_0x47fcc3+'-'+_0x49c99e+'/'+_0x3aacc3)[_0x488d('0x20')](_0x13d748);}return null;};}function patchUpdates(_0x7e4b06){return function(_0x53a187){try{jsonpatch[_0x488d('0x21')](_0x53a187,_0x7e4b06,!![]);}catch(_0xb14ef4){return BPromise['reject'](_0xb14ef4);}return _0x53a187[_0x488d('0x22')]();};}function saveUpdates(_0x33a204,_0x72c8bf){return function(_0x1cf279){if(_0x1cf279){return _0x1cf279[_0x488d('0x23')](_0x33a204)[_0x488d('0x24')](function(_0x2773ad){return _0x2773ad;});}return null;};}function removeEntity(_0x56bcfe,_0x1ce7f8){return function(_0x49b5d8){if(_0x49b5d8){return _0x49b5d8[_0x488d('0x25')]()[_0x488d('0x24')](function(){_0x56bcfe['status'](0xcc)[_0x488d('0x19')]();});}};}function handleEntityNotFound(_0x5e1db4,_0x3a80bc){return function(_0x291023){if(!_0x291023){_0x5e1db4[_0x488d('0x17')](0x194);}return _0x291023;};}function handleError(_0xf4cbdf,_0x26c2b5){_0x26c2b5=_0x26c2b5||0x1f4;return function(_0x50d480){logger['error'](_0x50d480['stack']);if(_0x50d480['name']){delete _0x50d480[_0x488d('0x26')];}_0xf4cbdf[_0x488d('0x18')](_0x26c2b5)[_0x488d('0x27')](_0x50d480);};}exports[_0x488d('0x28')]=function(_0x268196,_0x1dc569){var _0x307d02={},_0x3edbb4={},_0x213572={'count':0x0,'rows':[]};var _0x1d90b3=_[_0x488d('0x29')](db[_0x488d('0x2a')][_0x488d('0x2b')],function(_0x5a20b5){return{'name':_0x5a20b5[_0x488d('0x2c')],'type':_0x5a20b5[_0x488d('0x2d')][_0x488d('0x2e')]};});_0x3edbb4[_0x488d('0x2f')]=_['map'](_0x1d90b3,_0x488d('0x26'));_0x3edbb4[_0x488d('0x30')]=_[_0x488d('0x31')](_0x268196[_0x488d('0x30')]);_0x3edbb4[_0x488d('0x32')]=_[_0x488d('0x33')](_0x3edbb4[_0x488d('0x2f')],_0x3edbb4['query']);_0x307d02[_0x488d('0x34')]=_[_0x488d('0x33')](_0x3edbb4[_0x488d('0x2f')],qs[_0x488d('0x35')](_0x268196['query'][_0x488d('0x35')]));_0x307d02['attributes']=_0x307d02['attributes'][_0x488d('0x36')]?_0x307d02['attributes']:_0x3edbb4[_0x488d('0x2f')];if(!_0x268196[_0x488d('0x30')][_0x488d('0x37')](_0x488d('0x38'))){_0x307d02[_0x488d('0x1b')]=qs[_0x488d('0x1b')](_0x268196[_0x488d('0x30')][_0x488d('0x1b')]);_0x307d02[_0x488d('0x1d')]=qs[_0x488d('0x1d')](_0x268196[_0x488d('0x30')][_0x488d('0x1d')]);}_0x307d02[_0x488d('0x39')]=qs[_0x488d('0x3a')](_0x268196[_0x488d('0x30')][_0x488d('0x3a')]);_0x307d02[_0x488d('0x3b')]=qs[_0x488d('0x32')](_[_0x488d('0x3c')](_0x268196[_0x488d('0x30')],_0x3edbb4[_0x488d('0x32')]),_0x1d90b3);if(_0x268196[_0x488d('0x30')][_0x488d('0x3d')]){_0x307d02[_0x488d('0x3b')]=_[_0x488d('0x3e')](_0x307d02[_0x488d('0x3b')],{'$or':_[_0x488d('0x29')](_0x1d90b3,function(_0x456142){if(_0x456142['type']!=='VIRTUAL'){var _0x13d6ef={};_0x13d6ef[_0x456142[_0x488d('0x26')]]={'$like':'%'+_0x268196[_0x488d('0x30')]['filter']+'%'};return _0x13d6ef;}})});}_0x307d02=_[_0x488d('0x3e')]({},_0x307d02,_0x268196[_0x488d('0x3f')]);var _0x26bfa8={'where':_0x307d02['where']};return db['VtigerAccount'][_0x488d('0x1c')](_0x26bfa8)[_0x488d('0x24')](function(_0x508106){_0x213572[_0x488d('0x1c')]=_0x508106;if(_0x268196[_0x488d('0x30')][_0x488d('0x40')]){_0x307d02[_0x488d('0x41')]=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0x307d02);})['then'](function(_0x1a5fbd){_0x213572[_0x488d('0x42')]=_0x1a5fbd;return _0x213572;})[_0x488d('0x24')](respondWithFilteredResult(_0x1dc569,_0x307d02))[_0x488d('0x43')](handleError(_0x1dc569,null));};exports[_0x488d('0x44')]=function(_0x134375,_0x2f05b0){var _0x335704={'raw':![],'where':{'id':_0x134375[_0x488d('0x45')]['id']}},_0x297d88={};_0x297d88[_0x488d('0x2f')]=_[_0x488d('0x31')](db[_0x488d('0x2a')][_0x488d('0x2b')]);_0x297d88[_0x488d('0x30')]=_[_0x488d('0x31')](_0x134375[_0x488d('0x30')]);_0x297d88['filters']=_[_0x488d('0x33')](_0x297d88[_0x488d('0x2f')],_0x297d88[_0x488d('0x30')]);_0x335704['attributes']=_[_0x488d('0x33')](_0x297d88['model'],qs[_0x488d('0x35')](_0x134375[_0x488d('0x30')][_0x488d('0x35')]));_0x335704[_0x488d('0x34')]=_0x335704[_0x488d('0x34')][_0x488d('0x36')]?_0x335704[_0x488d('0x34')]:_0x297d88[_0x488d('0x2f')];if(_0x134375[_0x488d('0x30')][_0x488d('0x40')]){_0x335704[_0x488d('0x41')]=[{'all':!![]}];}_0x335704=_[_0x488d('0x3e')]({},_0x335704,_0x134375[_0x488d('0x3f')]);return db[_0x488d('0x2a')][_0x488d('0x46')](_0x335704)['then'](handleEntityNotFound(_0x2f05b0,null))[_0x488d('0x24')](respondWithResult(_0x2f05b0,null))[_0x488d('0x43')](handleError(_0x2f05b0,null));};exports[_0x488d('0x47')]=function(_0xad997d,_0x4d445f){return db[_0x488d('0x2a')]['create'](_0xad997d['body'],{})[_0x488d('0x24')](respondWithResult(_0x4d445f,0xc9))[_0x488d('0x43')](handleError(_0x4d445f,null));};exports[_0x488d('0x23')]=function(_0x484856,_0x109831){if(_0x484856[_0x488d('0x48')]['id']){delete _0x484856['body']['id'];}return db[_0x488d('0x2a')][_0x488d('0x46')]({'where':{'id':_0x484856[_0x488d('0x45')]['id']}})[_0x488d('0x24')](handleEntityNotFound(_0x109831,null))[_0x488d('0x24')](saveUpdates(_0x484856['body'],null))[_0x488d('0x24')](respondWithResult(_0x109831,null))[_0x488d('0x43')](handleError(_0x109831,null));};exports[_0x488d('0x25')]=function(_0x422bd1,_0x27eb9e){return db[_0x488d('0x2a')]['find']({'where':{'id':_0x422bd1[_0x488d('0x45')]['id']}})['then'](handleEntityNotFound(_0x27eb9e,null))[_0x488d('0x24')](removeEntity(_0x27eb9e,null))[_0x488d('0x43')](handleError(_0x27eb9e,null));};exports[_0x488d('0x49')]=function(_0x251fb5,_0x3323a3,_0x5c9df8){var _0x199b28={};var _0x53be86={};var _0x2cd814;var _0x5e4db7;return db[_0x488d('0x2a')][_0x488d('0x4a')]({'where':{'id':_0x251fb5[_0x488d('0x45')]['id']}})[_0x488d('0x24')](handleEntityNotFound(_0x3323a3,null))['then'](function(_0x242742){if(_0x242742){_0x2cd814=_0x242742;_0x53be86[_0x488d('0x2f')]=_[_0x488d('0x31')](db[_0x488d('0x4b')]['rawAttributes']);_0x53be86[_0x488d('0x30')]=_['keys'](_0x251fb5['query']);_0x53be86[_0x488d('0x32')]=_[_0x488d('0x33')](_0x53be86['model'],_0x53be86[_0x488d('0x30')]);_0x199b28[_0x488d('0x34')]=_[_0x488d('0x33')](_0x53be86[_0x488d('0x2f')],qs[_0x488d('0x35')](_0x251fb5[_0x488d('0x30')][_0x488d('0x35')]));_0x199b28[_0x488d('0x34')]=_0x199b28[_0x488d('0x34')][_0x488d('0x36')]?_0x199b28[_0x488d('0x34')]:_0x53be86[_0x488d('0x2f')];_0x199b28[_0x488d('0x39')]=qs[_0x488d('0x3a')](_0x251fb5[_0x488d('0x30')]['sort']);_0x199b28[_0x488d('0x3b')]=qs['filters'](_[_0x488d('0x3c')](_0x251fb5['query'],_0x53be86['filters']));if(_0x251fb5['query'][_0x488d('0x3d')]){_0x199b28['where']=_[_0x488d('0x3e')](_0x199b28[_0x488d('0x3b')],{'$or':_[_0x488d('0x29')](_0x199b28['attributes'],function(_0x3b5e17){var _0x3a4c38={};_0x3a4c38[_0x3b5e17]={'$like':'%'+_0x251fb5['query'][_0x488d('0x3d')]+'%'};return _0x3a4c38;})});}_0x199b28=_[_0x488d('0x3e')]({},_0x199b28,_0x251fb5[_0x488d('0x3f')]);return _0x2cd814[_0x488d('0x49')](_0x199b28);}})[_0x488d('0x24')](function(_0x299a8e){if(_0x299a8e){_0x5e4db7=_0x299a8e[_0x488d('0x36')];if(!_0x251fb5[_0x488d('0x30')][_0x488d('0x37')]('nolimit')){_0x199b28[_0x488d('0x1b')]=qs['limit'](_0x251fb5[_0x488d('0x30')][_0x488d('0x1b')]);_0x199b28[_0x488d('0x1d')]=qs[_0x488d('0x1d')](_0x251fb5[_0x488d('0x30')][_0x488d('0x1d')]);}return _0x2cd814[_0x488d('0x49')](_0x199b28);}})[_0x488d('0x24')](function(_0x310ec5){if(_0x310ec5){return _0x310ec5?{'count':_0x5e4db7,'rows':_0x310ec5}:null;}})[_0x488d('0x24')](respondWithResult(_0x3323a3,null))[_0x488d('0x43')](handleError(_0x3323a3,null));};exports[_0x488d('0x4c')]=function(_0x207fef,_0x32ac43,_0x3fabdc){if(_0x207fef[_0x488d('0x48')]['id']){delete _0x207fef[_0x488d('0x48')]['id'];}return db[_0x488d('0x2a')]['findOne']({'where':{'id':_0x207fef[_0x488d('0x45')]['id']}})[_0x488d('0x24')](handleEntityNotFound(_0x32ac43,null))['then'](function(_0x4c55af){if(_0x4c55af){_0x207fef[_0x488d('0x48')][_0x488d('0x4d')]=_0x4c55af['id'];_0x207fef[_0x488d('0x48')][_0x488d('0x4e')]=integrations[_0x488d('0x4f')](_0x207fef[_0x488d('0x48')][_0x488d('0x50')],_0x207fef['body'][_0x488d('0x2d')]);_0x207fef[_0x488d('0x48')][_0x488d('0x51')]=integrations[_0x488d('0x52')](_0x207fef[_0x488d('0x48')][_0x488d('0x50')],_0x207fef[_0x488d('0x48')][_0x488d('0x2d')]);return db['VtigerConfiguration'][_0x488d('0x47')](_0x207fef[_0x488d('0x48')],{'include':[{'model':db[_0x488d('0x53')],'as':_0x488d('0x4e')},{'model':db[_0x488d('0x53')],'as':_0x488d('0x51')}]});}return null;})[_0x488d('0x24')](respondWithResult(_0x32ac43,null))['catch'](handleError(_0x32ac43,null));};var md5=require(_0x488d('0x54'));exports[_0x488d('0x55')]=function(_0x5a9525,_0x3b9368,_0x571dc3){var _0x7ce3e8=null;var _0x3bd550=null;var _0x2400e3=null;var _0x422cd8=null;var _0x39985d='';return db[_0x488d('0x2a')]['findOne']({'where':{'id':_0x5a9525[_0x488d('0x45')]['id']},'attributes':['id',_0x488d('0x26'),_0x488d('0x56'),_0x488d('0x57'),_0x488d('0x58'),_0x488d('0x59'),_0x488d('0x5a'),'accessKey']})['then'](handleEntityNotFound(_0x3b9368,null))[_0x488d('0x24')](function(_0x28cec5){if(_0x28cec5){_0x7ce3e8=_0x28cec5['username'];_0x3bd550=_0x28cec5['accessKey'];_0x2400e3=_0x28cec5[_0x488d('0x58')];_0x39985d=_0x28cec5[_0x488d('0x59')];var _0x45164f=_0x39985d[_0x488d('0x5b')](-0x1);if(_0x45164f==='/'){_0x39985d=_0x39985d[_0x488d('0x5c')](0x0,_0x39985d['lastIndexOf'](_0x45164f));}_0x422cd8=util['format'](_0x488d('0x5d'),_0x39985d);var _0x585f32={'method':_0x488d('0x5e'),'uri':_0x422cd8,'qs':{'operation':_0x488d('0x5f'),'username':_0x28cec5[_0x488d('0x56')]},'json':!![]};return rp(_0x585f32);}})[_0x488d('0x24')](function(_0x2b83a4){if(_0x2b83a4[_0x488d('0x60')]){var _0x19c106={'method':_0x488d('0x61'),'uri':_0x422cd8,'form':{'operation':_0x488d('0x62'),'username':_0x7ce3e8,'accessKey':md5(_0x2b83a4[_0x488d('0x63')][_0x488d('0x64')]+_0x3bd550)},'json':!![]};return rp(_0x19c106);}})['then'](function(_0x261301){if(_0x261301[_0x488d('0x60')]){var _0x21a007={'method':_0x488d('0x5e'),'uri':_0x422cd8,'qs':{'operation':_0x488d('0x65'),'username':_0x7ce3e8,'sessionName':_0x261301[_0x488d('0x63')][_0x488d('0x66')],'elementType':_0x2400e3},'json':!![]};return rp(_0x21a007);}})[_0x488d('0x24')](function(_0x47d7d9){if(_0x47d7d9[_0x488d('0x60')]){var _0x2e9e21=[_0x488d('0x67'),_0x488d('0x68'),_0x488d('0x69')];_[_0x488d('0x6a')](_0x47d7d9['result'][_0x488d('0x35')],function(_0x5b2881){return _0x2e9e21[_0x488d('0x6b')](_0x5b2881['type'][_0x488d('0x26')]);});_[_0x488d('0x6a')](_0x47d7d9[_0x488d('0x63')][_0x488d('0x35')],function(_0x37a377){return _0x37a377[_0x488d('0x6c')]===_0x488d('0x6d');});return{'count':_0x47d7d9[_0x488d('0x63')][_0x488d('0x35')][_0x488d('0x36')],'rows':_['map'](_0x47d7d9[_0x488d('0x63')][_0x488d('0x35')],function(_0x2c16ef){return{'id':_0x2c16ef[_0x488d('0x26')],'name':_0x2c16ef[_0x488d('0x6e')],'custom':_[_0x488d('0x6f')](_0x2c16ef[_0x488d('0x26')],'cf_')?!![]:![],'options':_0x2c16ef[_0x488d('0x2d')][_0x488d('0x26')]===_0x488d('0x70')&&_0x2c16ef[_0x488d('0x2d')][_0x488d('0x71')][_0x488d('0x36')]>0x0?_[_0x488d('0x29')](_0x2c16ef[_0x488d('0x2d')][_0x488d('0x71')],function(_0x3d6e02){return{'name':_0x3d6e02[_0x488d('0x6e')],'value':_0x3d6e02[_0x488d('0x72')]};}):[]};})};}})[_0x488d('0x24')](respondWithResult(_0x3b9368,null))[_0x488d('0x43')](function(_0x54568c){console[_0x488d('0x73')](_0x488d('0x74')+_0x54568c);var _0x287fb5=_0x5a9525[_0x488d('0x30')][_0x488d('0x75')]?0x1f4:_0x54568c[_0x488d('0x76')]||0x1f4;logger['error'](_0x488d('0x77'),_0x488d('0x55'),_0x287fb5,JSON['stringify'](_0x54568c));delete _0x54568c[_0x488d('0x26')];if(_0x287fb5===0x191){_0x287fb5=0x190;}_0x3b9368[_0x488d('0x18')](_0x287fb5)[_0x488d('0x27')](_0x5a9525[_0x488d('0x30')][_0x488d('0x75')]?{'message':_0x488d('0x78'),'statusCode':_0x54568c[_0x488d('0x76')]}:_0x54568c);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index d1c55bb..9d93426 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 _0x7eff=['../../components/integrations/configuration','exports','define','int_vtiger_accounts','api','moment','bluebird','request-promise','../../config/environment','./intVtigerAccount.attributes'];(function(_0x3860b6,_0x147b29){var _0x5f2a28=function(_0x21aee5){while(--_0x21aee5){_0x3860b6['push'](_0x3860b6['shift']());}};_0x5f2a28(++_0x147b29);}(_0x7eff,0x1a8));var _0xf7ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7eff[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf7ef('0x0'));var moment=require(_0xf7ef('0x1'));var BPromise=require(_0xf7ef('0x2'));var rp=require(_0xf7ef('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf7ef('0x4'));var attributes=require(_0xf7ef('0x5'));var integrations=require(_0xf7ef('0x6'));module[_0xf7ef('0x7')]=function(_0x1a0b1d,_0x4a0a2d){return _0x1a0b1d[_0xf7ef('0x8')]('VtigerAccount',attributes,{'tableName':_0xf7ef('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc0a=['api','moment','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash'];(function(_0x30c578,_0x8946c2){var _0x453748=function(_0x5a9907){while(--_0x5a9907){_0x30c578['push'](_0x30c578['shift']());}};_0x453748(++_0x8946c2);}(_0xbc0a,0x10d));var _0xabc0=function(_0xfba697,_0x28149e){_0xfba697=_0xfba697-0x0;var _0x3976bc=_0xbc0a[_0xfba697];return _0x3976bc;};'use strict';var _=require(_0xabc0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xabc0('0x1'));var moment=require(_0xabc0('0x2'));var BPromise=require('bluebird');var rp=require(_0xabc0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xabc0('0x4'));var config=require(_0xabc0('0x5'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0xabc0('0x6'));module[_0xabc0('0x7')]=function(_0x47984a,_0x1fda0f){return _0x47984a[_0xabc0('0x8')]('VtigerAccount',attributes,{'tableName':_0xabc0('0x9'),'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 2ad31ed..ea17ab7 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 _0x44a3=['code','message','VtigerAccount,\x20%s,\x20%s','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error'];(function(_0x434543,_0x2fd498){var _0x3e6749=function(_0x5956f7){while(--_0x5956f7){_0x434543['push'](_0x434543['shift']());}};_0x3e6749(++_0x2fd498);}(_0x44a3,0x1a9));var _0x344a=function(_0x20a618,_0x3d1a7b){_0x20a618=_0x20a618-0x0;var _0x3be658=_0x44a3[_0x20a618];return _0x3be658;};'use strict';var _=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var moment=require(_0x344a('0x2'));var BPromise=require(_0x344a('0x3'));var rs=require(_0x344a('0x4'));var fs=require('fs');var Redis=require(_0x344a('0x5'));var db=require(_0x344a('0x6'))['db'];var utils=require(_0x344a('0x7'));var logger=require('../../config/logger')(_0x344a('0x8'));var config=require(_0x344a('0x9'));var jayson=require(_0x344a('0xa'));var client=jayson[_0x344a('0xb')][_0x344a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x504bd1,_0x553d97,_0x55ddca){return new BPromise(function(_0x484661,_0x475dab){return client[_0x344a('0xd')](_0x504bd1,_0x55ddca)[_0x344a('0xe')](function(_0x233ca1){logger[_0x344a('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x553d97,_0x344a('0x10'));logger[_0x344a('0x11')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x553d97,_0x344a('0x10'),JSON['stringify'](_0x233ca1));if(_0x233ca1[_0x344a('0x12')]){if(_0x233ca1['error'][_0x344a('0x13')]===0x1f4){logger[_0x344a('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x553d97,_0x233ca1['error'][_0x344a('0x14')]);return _0x475dab(_0x233ca1[_0x344a('0x12')][_0x344a('0x14')]);}logger[_0x344a('0x12')](_0x344a('0x15'),_0x553d97,_0x233ca1[_0x344a('0x12')]['message']);return _0x484661(_0x233ca1[_0x344a('0x12')][_0x344a('0x14')]);}else{logger[_0x344a('0xf')](_0x344a('0x15'),_0x553d97,'request\x20sent');_0x484661(_0x233ca1['result'][_0x344a('0x14')]);}})[_0x344a('0x16')](function(_0x36227e){logger[_0x344a('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x553d97,_0x36227e);_0x475dab(_0x36227e);});});}exports[_0x344a('0x17')]=function(_0x277c06){var _0x49b55f=this;return new Promise(function(_0x9fe854,_0x274016){return db[_0x344a('0x18')][_0x344a('0x19')]({'raw':_0x277c06[_0x344a('0x1a')]?_0x277c06[_0x344a('0x1a')][_0x344a('0x1b')]===undefined?!![]:![]:!![],'where':_0x277c06[_0x344a('0x1a')]?_0x277c06[_0x344a('0x1a')][_0x344a('0x1c')]||null:null,'attributes':_0x277c06['options']?_0x277c06[_0x344a('0x1a')][_0x344a('0x1d')]||null:null,'limit':_0x277c06[_0x344a('0x1a')]?_0x277c06[_0x344a('0x1a')][_0x344a('0x1e')]||null:null,'include':_0x277c06[_0x344a('0x1a')]?_0x277c06[_0x344a('0x1a')][_0x344a('0x1f')]?_[_0x344a('0x20')](_0x277c06[_0x344a('0x1a')][_0x344a('0x1f')],function(_0x3b2ab9){return{'model':db[_0x3b2ab9[_0x344a('0x21')]],'as':_0x3b2ab9['as'],'attributes':_0x3b2ab9[_0x344a('0x1d')],'include':_0x3b2ab9['include']?_[_0x344a('0x20')](_0x3b2ab9['include'],function(_0x2a5e49){return{'model':db[_0x2a5e49['model']],'as':_0x2a5e49['as'],'attributes':_0x2a5e49[_0x344a('0x1d')],'include':_0x2a5e49[_0x344a('0x1f')]?_[_0x344a('0x20')](_0x2a5e49[_0x344a('0x1f')],function(_0x26f059){return{'model':db[_0x26f059[_0x344a('0x21')]],'as':_0x26f059['as'],'attributes':_0x26f059[_0x344a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x344a('0xe')](function(_0x4f2499){logger[_0x344a('0xf')](_0x344a('0x17'),_0x277c06);logger[_0x344a('0x11')](_0x344a('0x17'),_0x277c06,JSON[_0x344a('0x22')](_0x4f2499));_0x9fe854(_0x4f2499);})[_0x344a('0x16')](function(_0x5b877d){logger[_0x344a('0x12')]('GetVtigerAccount',_0x5b877d['message'],_0x277c06);_0x274016(_0x49b55f[_0x344a('0x12')](0x1f4,_0x5b877d[_0x344a('0x14')]));});});};exports[_0x344a('0x23')]=function(_0x4803db){var _0x5cd9c6=this;return new Promise(function(_0x5cafd2,_0x16f490){return db[_0x344a('0x18')][_0x344a('0x24')]({'raw':_0x4803db['options']?_0x4803db[_0x344a('0x1a')][_0x344a('0x1b')]===undefined?!![]:![]:!![],'where':_0x4803db[_0x344a('0x1a')]?_0x4803db[_0x344a('0x1a')][_0x344a('0x1c')]||null:null,'attributes':_0x4803db[_0x344a('0x1a')]?_0x4803db[_0x344a('0x1a')]['attributes']||null:null,'include':_0x4803db[_0x344a('0x1a')]?_0x4803db['options']['include']?_['map'](_0x4803db[_0x344a('0x1a')][_0x344a('0x1f')],function(_0x2b8e71){return{'model':db[_0x2b8e71[_0x344a('0x21')]],'as':_0x2b8e71['as'],'attributes':_0x2b8e71[_0x344a('0x1d')],'include':_0x2b8e71[_0x344a('0x1f')]?_['map'](_0x2b8e71[_0x344a('0x1f')],function(_0x1fbf64){return{'model':db[_0x1fbf64[_0x344a('0x21')]],'as':_0x1fbf64['as'],'attributes':_0x1fbf64['attributes'],'include':_0x1fbf64[_0x344a('0x1f')]?_[_0x344a('0x20')](_0x1fbf64[_0x344a('0x1f')],function(_0x487a9b){return{'model':db[_0x487a9b[_0x344a('0x21')]],'as':_0x487a9b['as'],'attributes':_0x487a9b['attributes']};}):[]};}):[]};}):[]:[]})[_0x344a('0xe')](function(_0xeabc7c){logger[_0x344a('0xf')](_0x344a('0x23'),_0x4803db);logger[_0x344a('0x11')]('ShowVtigerAccount',_0x4803db,JSON[_0x344a('0x22')](_0xeabc7c));_0x5cafd2(_0xeabc7c);})[_0x344a('0x16')](function(_0x11e81f){logger[_0x344a('0x12')](_0x344a('0x23'),_0x11e81f['message'],_0x4803db);_0x16f490(_0x5cd9c6[_0x344a('0x12')](0x1f4,_0x11e81f[_0x344a('0x14')]));});});}; \ No newline at end of file +var _0x1be1=['../../config/environment','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVtigerAccount','options','raw','where','attributes','limit','include','map','model','VtigerAccount','find','ShowVtigerAccount','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5bc9ce,_0x221857){var _0x293b27=function(_0x33722b){while(--_0x33722b){_0x5bc9ce['push'](_0x5bc9ce['shift']());}};_0x293b27(++_0x221857);}(_0x1be1,0x192));var _0x11be=function(_0x36d5e3,_0x16ba58){_0x36d5e3=_0x36d5e3-0x0;var _0x6c1337=_0x1be1[_0x36d5e3];return _0x6c1337;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x11be('0x0'));var BPromise=require(_0x11be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11be('0x2'));var db=require(_0x11be('0x3'))['db'];var utils=require(_0x11be('0x4'));var logger=require(_0x11be('0x5'))('rpc');var config=require(_0x11be('0x6'));var jayson=require(_0x11be('0x7'));var client=jayson[_0x11be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe8c62,_0x497730,_0x18f661){return new BPromise(function(_0x11fc15,_0x246772){return client[_0x11be('0x9')](_0xfe8c62,_0x18f661)[_0x11be('0xa')](function(_0x5f3d04){logger[_0x11be('0xb')](_0x11be('0xc'),_0x497730,'request\x20sent');logger[_0x11be('0xd')](_0x11be('0xe'),_0x497730,_0x11be('0xf'),JSON[_0x11be('0x10')](_0x5f3d04));if(_0x5f3d04['error']){if(_0x5f3d04[_0x11be('0x11')][_0x11be('0x12')]===0x1f4){logger[_0x11be('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x497730,_0x5f3d04[_0x11be('0x11')][_0x11be('0x13')]);return _0x246772(_0x5f3d04['error'][_0x11be('0x13')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x497730,_0x5f3d04['error']['message']);return _0x11fc15(_0x5f3d04['error']['message']);}else{logger['info'](_0x11be('0xc'),_0x497730,'request\x20sent');_0x11fc15(_0x5f3d04[_0x11be('0x14')][_0x11be('0x13')]);}})[_0x11be('0x15')](function(_0x216b8c){logger['error'](_0x11be('0xc'),_0x497730,_0x216b8c);_0x246772(_0x216b8c);});});}exports[_0x11be('0x16')]=function(_0x56ab61){var _0x299f45=this;return new Promise(function(_0xc3263c,_0x23aa5f){return db['VtigerAccount']['findAll']({'raw':_0x56ab61[_0x11be('0x17')]?_0x56ab61[_0x11be('0x17')][_0x11be('0x18')]===undefined?!![]:![]:!![],'where':_0x56ab61[_0x11be('0x17')]?_0x56ab61['options'][_0x11be('0x19')]||null:null,'attributes':_0x56ab61[_0x11be('0x17')]?_0x56ab61[_0x11be('0x17')][_0x11be('0x1a')]||null:null,'limit':_0x56ab61[_0x11be('0x17')]?_0x56ab61[_0x11be('0x17')][_0x11be('0x1b')]||null:null,'include':_0x56ab61[_0x11be('0x17')]?_0x56ab61[_0x11be('0x17')][_0x11be('0x1c')]?_['map'](_0x56ab61[_0x11be('0x17')][_0x11be('0x1c')],function(_0x2fe43c){return{'model':db[_0x2fe43c['model']],'as':_0x2fe43c['as'],'attributes':_0x2fe43c['attributes'],'include':_0x2fe43c[_0x11be('0x1c')]?_[_0x11be('0x1d')](_0x2fe43c[_0x11be('0x1c')],function(_0x4cb27f){return{'model':db[_0x4cb27f[_0x11be('0x1e')]],'as':_0x4cb27f['as'],'attributes':_0x4cb27f['attributes'],'include':_0x4cb27f[_0x11be('0x1c')]?_['map'](_0x4cb27f[_0x11be('0x1c')],function(_0xb11f3d){return{'model':db[_0xb11f3d['model']],'as':_0xb11f3d['as'],'attributes':_0xb11f3d[_0x11be('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x11be('0xa')](function(_0x1d3b5c){logger[_0x11be('0xb')](_0x11be('0x16'),_0x56ab61);logger[_0x11be('0xd')](_0x11be('0x16'),_0x56ab61,JSON[_0x11be('0x10')](_0x1d3b5c));_0xc3263c(_0x1d3b5c);})[_0x11be('0x15')](function(_0x5966c5){logger[_0x11be('0x11')]('GetVtigerAccount',_0x5966c5[_0x11be('0x13')],_0x56ab61);_0x23aa5f(_0x299f45[_0x11be('0x11')](0x1f4,_0x5966c5['message']));});});};exports['ShowVtigerAccount']=function(_0x49fd5c){var _0x265fc9=this;return new Promise(function(_0x5e8f9a,_0x66316d){return db[_0x11be('0x1f')][_0x11be('0x20')]({'raw':_0x49fd5c[_0x11be('0x17')]?_0x49fd5c[_0x11be('0x17')][_0x11be('0x18')]===undefined?!![]:![]:!![],'where':_0x49fd5c['options']?_0x49fd5c[_0x11be('0x17')][_0x11be('0x19')]||null:null,'attributes':_0x49fd5c[_0x11be('0x17')]?_0x49fd5c[_0x11be('0x17')][_0x11be('0x1a')]||null:null,'include':_0x49fd5c[_0x11be('0x17')]?_0x49fd5c['options'][_0x11be('0x1c')]?_[_0x11be('0x1d')](_0x49fd5c[_0x11be('0x17')][_0x11be('0x1c')],function(_0x228bd3){return{'model':db[_0x228bd3['model']],'as':_0x228bd3['as'],'attributes':_0x228bd3[_0x11be('0x1a')],'include':_0x228bd3[_0x11be('0x1c')]?_[_0x11be('0x1d')](_0x228bd3['include'],function(_0x2c6fb2){return{'model':db[_0x2c6fb2['model']],'as':_0x2c6fb2['as'],'attributes':_0x2c6fb2['attributes'],'include':_0x2c6fb2['include']?_['map'](_0x2c6fb2[_0x11be('0x1c')],function(_0x2c5715){return{'model':db[_0x2c5715[_0x11be('0x1e')]],'as':_0x2c5715['as'],'attributes':_0x2c5715['attributes']};}):[]};}):[]};}):[]:[]})[_0x11be('0xa')](function(_0x1866d8){logger['info'](_0x11be('0x21'),_0x49fd5c);logger['debug'](_0x11be('0x21'),_0x49fd5c,JSON['stringify'](_0x1866d8));_0x5e8f9a(_0x1866d8);})[_0x11be('0x15')](function(_0xa6d724){logger[_0x11be('0x11')](_0x11be('0x21'),_0xa6d724['message'],_0x49fd5c);_0x66316d(_0x265fc9[_0x11be('0x11')](0x1f4,_0xa6d724[_0x11be('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 4fdeed2..b53fd69 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 _0xee9a=['/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xee9a,0xc9));var _0xaee9=function(_0x44d2a6,_0x3bbe45){_0x44d2a6=_0x44d2a6-0x0;var _0x7aef5=_0xee9a[_0x44d2a6];return _0x7aef5;};'use strict';var multer=require('multer');var util=require(_0xaee9('0x0'));var path=require(_0xaee9('0x1'));var timeout=require(_0xaee9('0x2'));var express=require(_0xaee9('0x3'));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(_0xaee9('0x4'));var controller=require(_0xaee9('0x5'));router[_0xaee9('0x6')]('/',auth[_0xaee9('0x7')](),controller[_0xaee9('0x8')]);router[_0xaee9('0x6')](_0xaee9('0x9'),auth[_0xaee9('0x7')](),controller[_0xaee9('0xa')]);router[_0xaee9('0x6')](_0xaee9('0xb'),auth[_0xaee9('0x7')](),controller['getFields']);router[_0xaee9('0x6')](_0xaee9('0xc'),auth[_0xaee9('0x7')](),controller[_0xaee9('0xd')]);router[_0xaee9('0x6')](_0xaee9('0xe'),auth[_0xaee9('0x7')](),controller['getDescriptions']);router[_0xaee9('0xf')]('/',auth[_0xaee9('0x7')](),controller['create']);router[_0xaee9('0x10')](_0xaee9('0x9'),auth[_0xaee9('0x7')](),controller[_0xaee9('0x11')]);router[_0xaee9('0x12')](_0xaee9('0x9'),auth[_0xaee9('0x7')](),controller[_0xaee9('0x13')]);module[_0xaee9('0x14')]=router; \ No newline at end of file +var _0x8369=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x44877c,_0x23b3e5){var _0x38cc85=function(_0x536bca){while(--_0x536bca){_0x44877c['push'](_0x44877c['shift']());}};_0x38cc85(++_0x23b3e5);}(_0x8369,0xe4));var _0x9836=function(_0x3c0724,_0x2b7f9c){_0x3c0724=_0x3c0724-0x0;var _0xc0a38f=_0x8369[_0x3c0724];return _0xc0a38f;};'use strict';var multer=require(_0x9836('0x0'));var util=require(_0x9836('0x1'));var path=require(_0x9836('0x2'));var timeout=require(_0x9836('0x3'));var express=require(_0x9836('0x4'));var router=express[_0x9836('0x5')]();var fs_extra=require(_0x9836('0x6'));var auth=require(_0x9836('0x7'));var interaction=require(_0x9836('0x8'));var config=require(_0x9836('0x9'));var controller=require(_0x9836('0xa'));router[_0x9836('0xb')]('/',auth[_0x9836('0xc')](),controller[_0x9836('0xd')]);router['get'](_0x9836('0xe'),auth['isAuthenticated'](),controller[_0x9836('0xf')]);router[_0x9836('0xb')](_0x9836('0x10'),auth[_0x9836('0xc')](),controller[_0x9836('0x11')]);router[_0x9836('0xb')](_0x9836('0x12'),auth[_0x9836('0xc')](),controller[_0x9836('0x13')]);router[_0x9836('0xb')](_0x9836('0x14'),auth[_0x9836('0xc')](),controller[_0x9836('0x15')]);router[_0x9836('0x16')]('/',auth[_0x9836('0xc')](),controller[_0x9836('0x17')]);router[_0x9836('0x18')](_0x9836('0xe'),auth[_0x9836('0xc')](),controller[_0x9836('0x19')]);router['delete'](_0x9836('0xe'),auth['isAuthenticated'](),controller[_0x9836('0x1a')]);module[_0x9836('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index de43e1e..6302910 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 _0x98a3=['sequelize','exports','STRING'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0x98a3,0xf6));var _0x398a=function(_0x3901ef,_0x4c2c6a){_0x3901ef=_0x3901ef-0x0;var _0x14bdb8=_0x98a3[_0x3901ef];return _0x14bdb8;};'use strict';var Sequelize=require(_0x398a('0x0'));module[_0x398a('0x1')]={'name':{'type':Sequelize[_0x398a('0x2')]},'description':{'type':Sequelize[_0x398a('0x2')]}}; \ No newline at end of file +var _0x7b43=['STRING','sequelize'];(function(_0x4fa5bf,_0x182171){var _0x3921da=function(_0x373a99){while(--_0x373a99){_0x4fa5bf['push'](_0x4fa5bf['shift']());}};_0x3921da(++_0x182171);}(_0x7b43,0x183));var _0x37b4=function(_0xb2d997,_0x5657b2){_0xb2d997=_0xb2d997-0x0;var _0x1ca854=_0x7b43[_0xb2d997];return _0x1ca854;};'use strict';var Sequelize=require(_0x37b4('0x0'));module['exports']={'name':{'type':Sequelize[_0x37b4('0x1')]},'description':{'type':Sequelize[_0x37b4('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index d4c275e..7d36a74 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 _0x18b8=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','filter','where','merge','VtigerConfiguration','includeAll','include','findAll','rows','catch','show','intersection','options','find','create','body','params','getFields','VtigerField','sort','pick','findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir'];(function(_0x21c4b8,_0x1171e1){var _0x49c233=function(_0x5baeb7){while(--_0x5baeb7){_0x21c4b8['push'](_0x21c4b8['shift']());}};_0x49c233(++_0x1171e1);}(_0x18b8,0xff));var _0x818b=function(_0x4cf554,_0x5c28e6){_0x4cf554=_0x4cf554-0x0;var _0x19c951=_0x18b8[_0x4cf554];return _0x19c951;};'use strict';var emlformat=require(_0x818b('0x0'));var rimraf=require(_0x818b('0x1'));var zipdir=require(_0x818b('0x2'));var jsonpatch=require(_0x818b('0x3'));var rp=require(_0x818b('0x4'));var moment=require(_0x818b('0x5'));var BPromise=require(_0x818b('0x6'));var Mustache=require(_0x818b('0x7'));var util=require(_0x818b('0x8'));var path=require(_0x818b('0x9'));var sox=require('sox');var csv=require(_0x818b('0xa'));var ejs=require(_0x818b('0xb'));var fs=require('fs');var fs_extra=require(_0x818b('0xc'));var _=require(_0x818b('0xd'));var squel=require(_0x818b('0xe'));var crypto=require(_0x818b('0xf'));var jsforce=require(_0x818b('0x10'));var deskjs=require(_0x818b('0x11'));var toCsv=require('to-csv');var querystring=require(_0x818b('0x12'));var Papa=require(_0x818b('0x13'));var Redis=require(_0x818b('0x14'));var authService=require(_0x818b('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x818b('0x16'));var hardwareService=require(_0x818b('0x17'));var logger=require(_0x818b('0x18'))(_0x818b('0x19'));var utils=require(_0x818b('0x1a'));var config=require(_0x818b('0x1b'));var licenseUtil=require(_0x818b('0x1c'));var db=require(_0x818b('0x1d'))['db'];function respondWithStatusCode(_0x415a66,_0x52c4de){_0x52c4de=_0x52c4de||0xcc;return function(_0x5ece81){if(_0x5ece81){return _0x415a66['sendStatus'](_0x52c4de);}return _0x415a66[_0x818b('0x1e')](_0x52c4de)[_0x818b('0x1f')]();};}function respondWithResult(_0x3ca607,_0x3130f1){_0x3130f1=_0x3130f1||0xc8;return function(_0xb7b77b){if(_0xb7b77b){return _0x3ca607[_0x818b('0x1e')](_0x3130f1)[_0x818b('0x20')](_0xb7b77b);}};}function respondWithFilteredResult(_0x3c21b9,_0x38da28){return function(_0x1d47af){if(_0x1d47af){var _0x526481=typeof _0x38da28[_0x818b('0x21')]===_0x818b('0x22')&&typeof _0x38da28[_0x818b('0x23')]===_0x818b('0x22');var _0xd53def=_0x1d47af['count'];var _0x3f19b4=_0x526481?0x0:_0x38da28[_0x818b('0x21')];var _0x2bc66b=_0x526481?_0x1d47af[_0x818b('0x24')]:_0x38da28[_0x818b('0x21')]+_0x38da28[_0x818b('0x23')];var _0x4558c1;if(_0x2bc66b>=_0xd53def){_0x2bc66b=_0xd53def;_0x4558c1=0xc8;}else{_0x4558c1=0xce;}_0x3c21b9[_0x818b('0x1e')](_0x4558c1);return _0x3c21b9[_0x818b('0x25')](_0x818b('0x26'),_0x3f19b4+'-'+_0x2bc66b+'/'+_0xd53def)[_0x818b('0x20')](_0x1d47af);}return null;};}function patchUpdates(_0x5571ce){return function(_0x38873a){try{jsonpatch[_0x818b('0x27')](_0x38873a,_0x5571ce,!![]);}catch(_0x2a425f){return BPromise['reject'](_0x2a425f);}return _0x38873a[_0x818b('0x28')]();};}function saveUpdates(_0x2cd9d4,_0x2293d5){return function(_0x5c3f5c){if(_0x5c3f5c){return _0x5c3f5c[_0x818b('0x29')](_0x2cd9d4)[_0x818b('0x2a')](function(_0x2f676b){return _0x2f676b;});}return null;};}function removeEntity(_0x43577d,_0x3967ef){return function(_0x63ff3a){if(_0x63ff3a){return _0x63ff3a[_0x818b('0x2b')]()[_0x818b('0x2a')](function(){_0x43577d[_0x818b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x415c89,_0x275bf3){return function(_0x3a1697){if(!_0x3a1697){_0x415c89[_0x818b('0x2c')](0x194);}return _0x3a1697;};}function handleError(_0x5e4cd9,_0x2e6335){_0x2e6335=_0x2e6335||0x1f4;return function(_0x1cb1c8){logger[_0x818b('0x2d')](_0x1cb1c8[_0x818b('0x2e')]);if(_0x1cb1c8['name']){delete _0x1cb1c8[_0x818b('0x2f')];}_0x5e4cd9['status'](_0x2e6335)[_0x818b('0x30')](_0x1cb1c8);};}exports['index']=function(_0x736c3b,_0x4bc43d){var _0x2e37e4={},_0x2454f0={},_0x532bbe={'count':0x0,'rows':[]};var _0xa29f3f=_[_0x818b('0x31')](db['VtigerConfiguration'][_0x818b('0x32')],function(_0x5bc168){return{'name':_0x5bc168[_0x818b('0x33')],'type':_0x5bc168[_0x818b('0x34')]['key']};});_0x2454f0[_0x818b('0x35')]=_[_0x818b('0x31')](_0xa29f3f,'name');_0x2454f0[_0x818b('0x36')]=_[_0x818b('0x37')](_0x736c3b[_0x818b('0x36')]);_0x2454f0[_0x818b('0x38')]=_['intersection'](_0x2454f0[_0x818b('0x35')],_0x2454f0['query']);_0x2e37e4[_0x818b('0x39')]=_['intersection'](_0x2454f0[_0x818b('0x35')],qs[_0x818b('0x3a')](_0x736c3b['query']['fields']));_0x2e37e4[_0x818b('0x39')]=_0x2e37e4[_0x818b('0x39')][_0x818b('0x3b')]?_0x2e37e4['attributes']:_0x2454f0[_0x818b('0x35')];if(!_0x736c3b['query'][_0x818b('0x3c')](_0x818b('0x3d'))){_0x2e37e4[_0x818b('0x23')]=qs[_0x818b('0x23')](_0x736c3b['query'][_0x818b('0x23')]);_0x2e37e4[_0x818b('0x21')]=qs['offset'](_0x736c3b[_0x818b('0x36')][_0x818b('0x21')]);}_0x2e37e4[_0x818b('0x3e')]=qs['sort'](_0x736c3b['query']['sort']);_0x2e37e4['where']=qs[_0x818b('0x38')](_['pick'](_0x736c3b[_0x818b('0x36')],_0x2454f0[_0x818b('0x38')]),_0xa29f3f);if(_0x736c3b[_0x818b('0x36')][_0x818b('0x3f')]){_0x2e37e4[_0x818b('0x40')]=_[_0x818b('0x41')](_0x2e37e4[_0x818b('0x40')],{'$or':_['map'](_0xa29f3f,function(_0x50b9e2){if(_0x50b9e2[_0x818b('0x34')]!=='VIRTUAL'){var _0x277780={};_0x277780[_0x50b9e2[_0x818b('0x2f')]]={'$like':'%'+_0x736c3b[_0x818b('0x36')][_0x818b('0x3f')]+'%'};return _0x277780;}})});}_0x2e37e4=_[_0x818b('0x41')]({},_0x2e37e4,_0x736c3b['options']);var _0x4c317c={'where':_0x2e37e4[_0x818b('0x40')]};return db[_0x818b('0x42')][_0x818b('0x24')](_0x4c317c)[_0x818b('0x2a')](function(_0x5b8fca){_0x532bbe['count']=_0x5b8fca;if(_0x736c3b[_0x818b('0x36')][_0x818b('0x43')]){_0x2e37e4[_0x818b('0x44')]=[{'all':!![]}];}return db[_0x818b('0x42')][_0x818b('0x45')](_0x2e37e4);})['then'](function(_0x243473){_0x532bbe[_0x818b('0x46')]=_0x243473;return _0x532bbe;})[_0x818b('0x2a')](respondWithFilteredResult(_0x4bc43d,_0x2e37e4))[_0x818b('0x47')](handleError(_0x4bc43d,null));};exports[_0x818b('0x48')]=function(_0xfe65b5,_0x970e3f){var _0x241653={'raw':![],'where':{'id':_0xfe65b5['params']['id']}},_0x2bf78a={};_0x2bf78a[_0x818b('0x35')]=_['keys'](db['VtigerConfiguration'][_0x818b('0x32')]);_0x2bf78a['query']=_[_0x818b('0x37')](_0xfe65b5[_0x818b('0x36')]);_0x2bf78a[_0x818b('0x38')]=_[_0x818b('0x49')](_0x2bf78a['model'],_0x2bf78a[_0x818b('0x36')]);_0x241653['attributes']=_['intersection'](_0x2bf78a[_0x818b('0x35')],qs['fields'](_0xfe65b5[_0x818b('0x36')][_0x818b('0x3a')]));_0x241653[_0x818b('0x39')]=_0x241653['attributes'][_0x818b('0x3b')]?_0x241653[_0x818b('0x39')]:_0x2bf78a[_0x818b('0x35')];if(_0xfe65b5[_0x818b('0x36')][_0x818b('0x43')]){_0x241653[_0x818b('0x44')]=[{'all':!![]}];}_0x241653=_['merge']({},_0x241653,_0xfe65b5[_0x818b('0x4a')]);return db[_0x818b('0x42')][_0x818b('0x4b')](_0x241653)[_0x818b('0x2a')](handleEntityNotFound(_0x970e3f,null))['then'](respondWithResult(_0x970e3f,null))['catch'](handleError(_0x970e3f,null));};exports['create']=function(_0xd690a6,_0x4ce0cf){return db[_0x818b('0x42')][_0x818b('0x4c')](_0xd690a6[_0x818b('0x4d')],{})[_0x818b('0x2a')](respondWithResult(_0x4ce0cf,0xc9))[_0x818b('0x47')](handleError(_0x4ce0cf,null));};exports[_0x818b('0x29')]=function(_0x136955,_0x235ef7){if(_0x136955['body']['id']){delete _0x136955[_0x818b('0x4d')]['id'];}return db[_0x818b('0x42')][_0x818b('0x4b')]({'where':{'id':_0x136955[_0x818b('0x4e')]['id']}})[_0x818b('0x2a')](handleEntityNotFound(_0x235ef7,null))[_0x818b('0x2a')](saveUpdates(_0x136955[_0x818b('0x4d')],null))[_0x818b('0x2a')](respondWithResult(_0x235ef7,null))[_0x818b('0x47')](handleError(_0x235ef7,null));};exports[_0x818b('0x2b')]=function(_0x6b4826,_0x1aaa00){return db[_0x818b('0x42')]['find']({'where':{'id':_0x6b4826['params']['id']}})['then'](handleEntityNotFound(_0x1aaa00,null))[_0x818b('0x2a')](removeEntity(_0x1aaa00,null))[_0x818b('0x47')](handleError(_0x1aaa00,null));};exports[_0x818b('0x4f')]=function(_0x320a30,_0xa7f207,_0x326f27){var _0x249c10={};var _0x5601cc={};var _0x51d520;var _0x4b4ed8;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x320a30[_0x818b('0x4e')]['id']}})[_0x818b('0x2a')](handleEntityNotFound(_0xa7f207,null))[_0x818b('0x2a')](function(_0x503ad6){if(_0x503ad6){_0x51d520=_0x503ad6;_0x5601cc['model']=_[_0x818b('0x37')](db[_0x818b('0x50')][_0x818b('0x32')]);_0x5601cc[_0x818b('0x36')]=_[_0x818b('0x37')](_0x320a30[_0x818b('0x36')]);_0x5601cc[_0x818b('0x38')]=_['intersection'](_0x5601cc['model'],_0x5601cc['query']);_0x249c10[_0x818b('0x39')]=_['intersection'](_0x5601cc[_0x818b('0x35')],qs[_0x818b('0x3a')](_0x320a30[_0x818b('0x36')]['fields']));_0x249c10[_0x818b('0x39')]=_0x249c10[_0x818b('0x39')][_0x818b('0x3b')]?_0x249c10[_0x818b('0x39')]:_0x5601cc[_0x818b('0x35')];_0x249c10[_0x818b('0x3e')]=qs[_0x818b('0x51')](_0x320a30[_0x818b('0x36')][_0x818b('0x51')]);_0x249c10[_0x818b('0x40')]=qs[_0x818b('0x38')](_[_0x818b('0x52')](_0x320a30[_0x818b('0x36')],_0x5601cc[_0x818b('0x38')]));if(_0x320a30[_0x818b('0x36')]['filter']){_0x249c10[_0x818b('0x40')]=_['merge'](_0x249c10['where'],{'$or':_[_0x818b('0x31')](_0x249c10[_0x818b('0x39')],function(_0x338406){var _0x1f8ac9={};_0x1f8ac9[_0x338406]={'$like':'%'+_0x320a30[_0x818b('0x36')][_0x818b('0x3f')]+'%'};return _0x1f8ac9;})});}_0x249c10=_[_0x818b('0x41')]({},_0x249c10,_0x320a30[_0x818b('0x4a')]);return _0x51d520['getFields'](_0x249c10);}})['then'](function(_0x515127){if(_0x515127){_0x4b4ed8=_0x515127['length'];if(!_0x320a30['query'][_0x818b('0x3c')](_0x818b('0x3d'))){_0x249c10[_0x818b('0x23')]=qs['limit'](_0x320a30['query'][_0x818b('0x23')]);_0x249c10[_0x818b('0x21')]=qs[_0x818b('0x21')](_0x320a30['query'][_0x818b('0x21')]);}return _0x51d520[_0x818b('0x4f')](_0x249c10);}})['then'](function(_0x331f73){if(_0x331f73){return _0x331f73?{'count':_0x4b4ed8,'rows':_0x331f73}:null;}})[_0x818b('0x2a')](respondWithResult(_0xa7f207,null))[_0x818b('0x47')](handleError(_0xa7f207,null));};exports['getSubjects']=function(_0x2a3da1,_0x40f6d9,_0x114f93){var _0x242896={};var _0x1696cd={};var _0x22d5ec;var _0x20ff67;return db[_0x818b('0x42')][_0x818b('0x53')]({'where':{'id':_0x2a3da1[_0x818b('0x4e')]['id']}})[_0x818b('0x2a')](handleEntityNotFound(_0x40f6d9,null))[_0x818b('0x2a')](function(_0x48fd8a){if(_0x48fd8a){_0x22d5ec=_0x48fd8a;_0x1696cd[_0x818b('0x35')]=_['keys'](db[_0x818b('0x50')][_0x818b('0x32')]);_0x1696cd['query']=_[_0x818b('0x37')](_0x2a3da1['query']);_0x1696cd[_0x818b('0x38')]=_[_0x818b('0x49')](_0x1696cd['model'],_0x1696cd[_0x818b('0x36')]);_0x242896['attributes']=_[_0x818b('0x49')](_0x1696cd[_0x818b('0x35')],qs[_0x818b('0x3a')](_0x2a3da1[_0x818b('0x36')]['fields']));_0x242896[_0x818b('0x39')]=_0x242896[_0x818b('0x39')][_0x818b('0x3b')]?_0x242896['attributes']:_0x1696cd[_0x818b('0x35')];_0x242896[_0x818b('0x3e')]=qs['sort'](_0x2a3da1['query'][_0x818b('0x51')]);_0x242896[_0x818b('0x40')]=qs['filters'](_['pick'](_0x2a3da1[_0x818b('0x36')],_0x1696cd[_0x818b('0x38')]));if(_0x2a3da1[_0x818b('0x36')][_0x818b('0x3f')]){_0x242896[_0x818b('0x40')]=_['merge'](_0x242896['where'],{'$or':_['map'](_0x242896['attributes'],function(_0x34057d){var _0x21a6e9={};_0x21a6e9[_0x34057d]={'$like':'%'+_0x2a3da1[_0x818b('0x36')][_0x818b('0x3f')]+'%'};return _0x21a6e9;})});}_0x242896=_['merge']({},_0x242896,_0x2a3da1[_0x818b('0x4a')]);return _0x22d5ec[_0x818b('0x54')](_0x242896);}})['then'](function(_0x44d962){if(_0x44d962){_0x20ff67=_0x44d962['length'];if(!_0x2a3da1[_0x818b('0x36')][_0x818b('0x3c')](_0x818b('0x3d'))){_0x242896[_0x818b('0x23')]=qs[_0x818b('0x23')](_0x2a3da1[_0x818b('0x36')][_0x818b('0x23')]);_0x242896['offset']=qs[_0x818b('0x21')](_0x2a3da1[_0x818b('0x36')][_0x818b('0x21')]);}return _0x22d5ec[_0x818b('0x54')](_0x242896);}})[_0x818b('0x2a')](function(_0x4ea26b){if(_0x4ea26b){return _0x4ea26b?{'count':_0x20ff67,'rows':_0x4ea26b}:null;}})['then'](respondWithResult(_0x40f6d9,null))[_0x818b('0x47')](handleError(_0x40f6d9,null));};exports[_0x818b('0x55')]=function(_0x2ecbfb,_0x2c17d0,_0x409146){var _0x4f81c7={};var _0x5eeec7={};var _0x3a7b53;var _0x41a2e8;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x2ecbfb[_0x818b('0x4e')]['id']}})[_0x818b('0x2a')](handleEntityNotFound(_0x2c17d0,null))[_0x818b('0x2a')](function(_0x4eedac){if(_0x4eedac){_0x3a7b53=_0x4eedac;_0x5eeec7['model']=_[_0x818b('0x37')](db['VtigerField'][_0x818b('0x32')]);_0x5eeec7[_0x818b('0x36')]=_[_0x818b('0x37')](_0x2ecbfb[_0x818b('0x36')]);_0x5eeec7[_0x818b('0x38')]=_[_0x818b('0x49')](_0x5eeec7[_0x818b('0x35')],_0x5eeec7[_0x818b('0x36')]);_0x4f81c7[_0x818b('0x39')]=_[_0x818b('0x49')](_0x5eeec7[_0x818b('0x35')],qs[_0x818b('0x3a')](_0x2ecbfb[_0x818b('0x36')][_0x818b('0x3a')]));_0x4f81c7[_0x818b('0x39')]=_0x4f81c7[_0x818b('0x39')][_0x818b('0x3b')]?_0x4f81c7[_0x818b('0x39')]:_0x5eeec7['model'];_0x4f81c7[_0x818b('0x3e')]=qs[_0x818b('0x51')](_0x2ecbfb[_0x818b('0x36')][_0x818b('0x51')]);_0x4f81c7[_0x818b('0x40')]=qs[_0x818b('0x38')](_[_0x818b('0x52')](_0x2ecbfb[_0x818b('0x36')],_0x5eeec7['filters']));if(_0x2ecbfb[_0x818b('0x36')][_0x818b('0x3f')]){_0x4f81c7['where']=_[_0x818b('0x41')](_0x4f81c7[_0x818b('0x40')],{'$or':_[_0x818b('0x31')](_0x4f81c7[_0x818b('0x39')],function(_0x123159){var _0x239eaf={};_0x239eaf[_0x123159]={'$like':'%'+_0x2ecbfb[_0x818b('0x36')]['filter']+'%'};return _0x239eaf;})});}_0x4f81c7=_[_0x818b('0x41')]({},_0x4f81c7,_0x2ecbfb[_0x818b('0x4a')]);return _0x3a7b53[_0x818b('0x55')](_0x4f81c7);}})[_0x818b('0x2a')](function(_0x35f883){if(_0x35f883){_0x41a2e8=_0x35f883[_0x818b('0x3b')];if(!_0x2ecbfb['query'][_0x818b('0x3c')](_0x818b('0x3d'))){_0x4f81c7[_0x818b('0x23')]=qs[_0x818b('0x23')](_0x2ecbfb[_0x818b('0x36')][_0x818b('0x23')]);_0x4f81c7[_0x818b('0x21')]=qs['offset'](_0x2ecbfb['query'][_0x818b('0x21')]);}return _0x3a7b53['getDescriptions'](_0x4f81c7);}})[_0x818b('0x2a')](function(_0xef81){if(_0xef81){return _0xef81?{'count':_0x41a2e8,'rows':_0xef81}:null;}})[_0x818b('0x2a')](respondWithResult(_0x2c17d0,null))['catch'](handleError(_0x2c17d0,null));}; \ No newline at end of file +var _0x93e9=['stack','name','send','index','map','VtigerConfiguration','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','catch','show','includeAll','create','body','find','params','getFields','findOne','VtigerField','getSubjects','getDescriptions','rawAttributes','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','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','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error'];(function(_0xca2ba8,_0xc89bd2){var _0x3d04fa=function(_0x4c2987){while(--_0x4c2987){_0xca2ba8['push'](_0xca2ba8['shift']());}};_0x3d04fa(++_0xc89bd2);}(_0x93e9,0x7b));var _0x993e=function(_0x4c0319,_0x51c814){_0x4c0319=_0x4c0319-0x0;var _0x24c27c=_0x93e9[_0x4c0319];return _0x24c27c;};'use strict';var emlformat=require(_0x993e('0x0'));var rimraf=require(_0x993e('0x1'));var zipdir=require(_0x993e('0x2'));var jsonpatch=require(_0x993e('0x3'));var rp=require(_0x993e('0x4'));var moment=require(_0x993e('0x5'));var BPromise=require(_0x993e('0x6'));var Mustache=require(_0x993e('0x7'));var util=require('util');var path=require('path');var sox=require(_0x993e('0x8'));var csv=require(_0x993e('0x9'));var ejs=require(_0x993e('0xa'));var fs=require('fs');var fs_extra=require(_0x993e('0xb'));var _=require(_0x993e('0xc'));var squel=require(_0x993e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x993e('0xe'));var toCsv=require(_0x993e('0x9'));var querystring=require(_0x993e('0xf'));var Papa=require(_0x993e('0x10'));var Redis=require(_0x993e('0x11'));var authService=require(_0x993e('0x12'));var qs=require(_0x993e('0x13'));var as=require(_0x993e('0x14'));var hardwareService=require(_0x993e('0x15'));var logger=require(_0x993e('0x16'))('api');var utils=require(_0x993e('0x17'));var config=require(_0x993e('0x18'));var licenseUtil=require(_0x993e('0x19'));var db=require(_0x993e('0x1a'))['db'];function respondWithStatusCode(_0xc1c719,_0xcbecd5){_0xcbecd5=_0xcbecd5||0xcc;return function(_0x9750dc){if(_0x9750dc){return _0xc1c719[_0x993e('0x1b')](_0xcbecd5);}return _0xc1c719[_0x993e('0x1c')](_0xcbecd5)[_0x993e('0x1d')]();};}function respondWithResult(_0x5d5b30,_0x51f14a){_0x51f14a=_0x51f14a||0xc8;return function(_0x4bdfd3){if(_0x4bdfd3){return _0x5d5b30[_0x993e('0x1c')](_0x51f14a)[_0x993e('0x1e')](_0x4bdfd3);}};}function respondWithFilteredResult(_0x5846d8,_0x1947fb){return function(_0x4a0215){if(_0x4a0215){var _0x4a02b7=typeof _0x1947fb[_0x993e('0x1f')]===_0x993e('0x20')&&typeof _0x1947fb[_0x993e('0x21')]===_0x993e('0x20');var _0x5844b3=_0x4a0215[_0x993e('0x22')];var _0x1bde7c=_0x4a02b7?0x0:_0x1947fb[_0x993e('0x1f')];var _0x39889b=_0x4a02b7?_0x4a0215['count']:_0x1947fb['offset']+_0x1947fb[_0x993e('0x21')];var _0x3c3fe3;if(_0x39889b>=_0x5844b3){_0x39889b=_0x5844b3;_0x3c3fe3=0xc8;}else{_0x3c3fe3=0xce;}_0x5846d8[_0x993e('0x1c')](_0x3c3fe3);return _0x5846d8[_0x993e('0x23')]('Content-Range',_0x1bde7c+'-'+_0x39889b+'/'+_0x5844b3)[_0x993e('0x1e')](_0x4a0215);}return null;};}function patchUpdates(_0x30c070){return function(_0x199b0a){try{jsonpatch[_0x993e('0x24')](_0x199b0a,_0x30c070,!![]);}catch(_0x906fbb){return BPromise[_0x993e('0x25')](_0x906fbb);}return _0x199b0a[_0x993e('0x26')]();};}function saveUpdates(_0x4a9292,_0x29b88d){return function(_0x495490){if(_0x495490){return _0x495490[_0x993e('0x27')](_0x4a9292)[_0x993e('0x28')](function(_0x19237d){return _0x19237d;});}return null;};}function removeEntity(_0x3135fa,_0x59a421){return function(_0x12d31a){if(_0x12d31a){return _0x12d31a[_0x993e('0x29')]()['then'](function(){_0x3135fa[_0x993e('0x1c')](0xcc)[_0x993e('0x1d')]();});}};}function handleEntityNotFound(_0x462dd7,_0x792c06){return function(_0x477cfb){if(!_0x477cfb){_0x462dd7['sendStatus'](0x194);}return _0x477cfb;};}function handleError(_0x446aaa,_0x511855){_0x511855=_0x511855||0x1f4;return function(_0x1a1994){logger[_0x993e('0x2a')](_0x1a1994[_0x993e('0x2b')]);if(_0x1a1994['name']){delete _0x1a1994[_0x993e('0x2c')];}_0x446aaa[_0x993e('0x1c')](_0x511855)[_0x993e('0x2d')](_0x1a1994);};}exports[_0x993e('0x2e')]=function(_0x3dd4c9,_0x292546){var _0x81243c={},_0xd9cc58={},_0x1c6897={'count':0x0,'rows':[]};var _0x4a83a9=_[_0x993e('0x2f')](db[_0x993e('0x30')]['rawAttributes'],function(_0x4782b5){return{'name':_0x4782b5['fieldName'],'type':_0x4782b5[_0x993e('0x31')]['key']};});_0xd9cc58['model']=_[_0x993e('0x2f')](_0x4a83a9,_0x993e('0x2c'));_0xd9cc58[_0x993e('0x32')]=_[_0x993e('0x33')](_0x3dd4c9[_0x993e('0x32')]);_0xd9cc58[_0x993e('0x34')]=_[_0x993e('0x35')](_0xd9cc58[_0x993e('0x36')],_0xd9cc58[_0x993e('0x32')]);_0x81243c[_0x993e('0x37')]=_[_0x993e('0x35')](_0xd9cc58[_0x993e('0x36')],qs['fields'](_0x3dd4c9[_0x993e('0x32')][_0x993e('0x38')]));_0x81243c[_0x993e('0x37')]=_0x81243c[_0x993e('0x37')][_0x993e('0x39')]?_0x81243c['attributes']:_0xd9cc58[_0x993e('0x36')];if(!_0x3dd4c9[_0x993e('0x32')][_0x993e('0x3a')](_0x993e('0x3b'))){_0x81243c[_0x993e('0x21')]=qs[_0x993e('0x21')](_0x3dd4c9[_0x993e('0x32')]['limit']);_0x81243c['offset']=qs[_0x993e('0x1f')](_0x3dd4c9['query'][_0x993e('0x1f')]);}_0x81243c[_0x993e('0x3c')]=qs['sort'](_0x3dd4c9[_0x993e('0x32')][_0x993e('0x3d')]);_0x81243c[_0x993e('0x3e')]=qs['filters'](_[_0x993e('0x3f')](_0x3dd4c9[_0x993e('0x32')],_0xd9cc58[_0x993e('0x34')]),_0x4a83a9);if(_0x3dd4c9[_0x993e('0x32')]['filter']){_0x81243c[_0x993e('0x3e')]=_[_0x993e('0x40')](_0x81243c['where'],{'$or':_['map'](_0x4a83a9,function(_0x72a5){if(_0x72a5[_0x993e('0x31')]!==_0x993e('0x41')){var _0x24f9ac={};_0x24f9ac[_0x72a5[_0x993e('0x2c')]]={'$like':'%'+_0x3dd4c9[_0x993e('0x32')][_0x993e('0x42')]+'%'};return _0x24f9ac;}})});}_0x81243c=_[_0x993e('0x40')]({},_0x81243c,_0x3dd4c9[_0x993e('0x43')]);var _0x390f10={'where':_0x81243c[_0x993e('0x3e')]};return db['VtigerConfiguration'][_0x993e('0x22')](_0x390f10)[_0x993e('0x28')](function(_0x2801b1){_0x1c6897[_0x993e('0x22')]=_0x2801b1;if(_0x3dd4c9[_0x993e('0x32')]['includeAll']){_0x81243c[_0x993e('0x44')]=[{'all':!![]}];}return db[_0x993e('0x30')][_0x993e('0x45')](_0x81243c);})['then'](function(_0x473ffd){_0x1c6897['rows']=_0x473ffd;return _0x1c6897;})[_0x993e('0x28')](respondWithFilteredResult(_0x292546,_0x81243c))[_0x993e('0x46')](handleError(_0x292546,null));};exports[_0x993e('0x47')]=function(_0x162d6f,_0x101ca4){var _0x1a7a75={'raw':![],'where':{'id':_0x162d6f['params']['id']}},_0x25095b={};_0x25095b['model']=_[_0x993e('0x33')](db[_0x993e('0x30')]['rawAttributes']);_0x25095b[_0x993e('0x32')]=_[_0x993e('0x33')](_0x162d6f[_0x993e('0x32')]);_0x25095b[_0x993e('0x34')]=_[_0x993e('0x35')](_0x25095b['model'],_0x25095b[_0x993e('0x32')]);_0x1a7a75[_0x993e('0x37')]=_[_0x993e('0x35')](_0x25095b[_0x993e('0x36')],qs[_0x993e('0x38')](_0x162d6f[_0x993e('0x32')]['fields']));_0x1a7a75['attributes']=_0x1a7a75[_0x993e('0x37')][_0x993e('0x39')]?_0x1a7a75['attributes']:_0x25095b[_0x993e('0x36')];if(_0x162d6f[_0x993e('0x32')][_0x993e('0x48')]){_0x1a7a75[_0x993e('0x44')]=[{'all':!![]}];}_0x1a7a75=_[_0x993e('0x40')]({},_0x1a7a75,_0x162d6f[_0x993e('0x43')]);return db[_0x993e('0x30')]['find'](_0x1a7a75)['then'](handleEntityNotFound(_0x101ca4,null))[_0x993e('0x28')](respondWithResult(_0x101ca4,null))[_0x993e('0x46')](handleError(_0x101ca4,null));};exports[_0x993e('0x49')]=function(_0x332108,_0xaac635){return db[_0x993e('0x30')][_0x993e('0x49')](_0x332108[_0x993e('0x4a')],{})['then'](respondWithResult(_0xaac635,0xc9))[_0x993e('0x46')](handleError(_0xaac635,null));};exports[_0x993e('0x27')]=function(_0x1b37bc,_0xc5086e){if(_0x1b37bc[_0x993e('0x4a')]['id']){delete _0x1b37bc['body']['id'];}return db[_0x993e('0x30')][_0x993e('0x4b')]({'where':{'id':_0x1b37bc[_0x993e('0x4c')]['id']}})[_0x993e('0x28')](handleEntityNotFound(_0xc5086e,null))['then'](saveUpdates(_0x1b37bc[_0x993e('0x4a')],null))['then'](respondWithResult(_0xc5086e,null))[_0x993e('0x46')](handleError(_0xc5086e,null));};exports['destroy']=function(_0x2f2c01,_0x436c00){return db[_0x993e('0x30')][_0x993e('0x4b')]({'where':{'id':_0x2f2c01['params']['id']}})[_0x993e('0x28')](handleEntityNotFound(_0x436c00,null))['then'](removeEntity(_0x436c00,null))[_0x993e('0x46')](handleError(_0x436c00,null));};exports[_0x993e('0x4d')]=function(_0x46d40a,_0x29191a,_0x50ecea){var _0x55f75c={};var _0xaee62a={};var _0x47acd9;var _0x449791;return db[_0x993e('0x30')][_0x993e('0x4e')]({'where':{'id':_0x46d40a[_0x993e('0x4c')]['id']}})[_0x993e('0x28')](handleEntityNotFound(_0x29191a,null))[_0x993e('0x28')](function(_0x248f0f){if(_0x248f0f){_0x47acd9=_0x248f0f;_0xaee62a[_0x993e('0x36')]=_[_0x993e('0x33')](db[_0x993e('0x4f')]['rawAttributes']);_0xaee62a[_0x993e('0x32')]=_[_0x993e('0x33')](_0x46d40a[_0x993e('0x32')]);_0xaee62a[_0x993e('0x34')]=_[_0x993e('0x35')](_0xaee62a[_0x993e('0x36')],_0xaee62a[_0x993e('0x32')]);_0x55f75c[_0x993e('0x37')]=_[_0x993e('0x35')](_0xaee62a[_0x993e('0x36')],qs[_0x993e('0x38')](_0x46d40a[_0x993e('0x32')][_0x993e('0x38')]));_0x55f75c['attributes']=_0x55f75c[_0x993e('0x37')][_0x993e('0x39')]?_0x55f75c[_0x993e('0x37')]:_0xaee62a[_0x993e('0x36')];_0x55f75c[_0x993e('0x3c')]=qs[_0x993e('0x3d')](_0x46d40a[_0x993e('0x32')]['sort']);_0x55f75c[_0x993e('0x3e')]=qs[_0x993e('0x34')](_['pick'](_0x46d40a['query'],_0xaee62a[_0x993e('0x34')]));if(_0x46d40a[_0x993e('0x32')][_0x993e('0x42')]){_0x55f75c['where']=_['merge'](_0x55f75c[_0x993e('0x3e')],{'$or':_[_0x993e('0x2f')](_0x55f75c[_0x993e('0x37')],function(_0x34ab2d){var _0x3f56dd={};_0x3f56dd[_0x34ab2d]={'$like':'%'+_0x46d40a['query'][_0x993e('0x42')]+'%'};return _0x3f56dd;})});}_0x55f75c=_[_0x993e('0x40')]({},_0x55f75c,_0x46d40a[_0x993e('0x43')]);return _0x47acd9[_0x993e('0x4d')](_0x55f75c);}})['then'](function(_0x563ead){if(_0x563ead){_0x449791=_0x563ead['length'];if(!_0x46d40a[_0x993e('0x32')][_0x993e('0x3a')]('nolimit')){_0x55f75c[_0x993e('0x21')]=qs['limit'](_0x46d40a[_0x993e('0x32')][_0x993e('0x21')]);_0x55f75c['offset']=qs['offset'](_0x46d40a['query'][_0x993e('0x1f')]);}return _0x47acd9[_0x993e('0x4d')](_0x55f75c);}})['then'](function(_0x1144dd){if(_0x1144dd){return _0x1144dd?{'count':_0x449791,'rows':_0x1144dd}:null;}})[_0x993e('0x28')](respondWithResult(_0x29191a,null))[_0x993e('0x46')](handleError(_0x29191a,null));};exports[_0x993e('0x50')]=function(_0x58eda2,_0x5646cd,_0x575c22){var _0x34ffaf={};var _0xf582f6={};var _0x42dc0e;var _0x5a38ff;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x58eda2['params']['id']}})[_0x993e('0x28')](handleEntityNotFound(_0x5646cd,null))[_0x993e('0x28')](function(_0x98b219){if(_0x98b219){_0x42dc0e=_0x98b219;_0xf582f6[_0x993e('0x36')]=_[_0x993e('0x33')](db[_0x993e('0x4f')]['rawAttributes']);_0xf582f6[_0x993e('0x32')]=_[_0x993e('0x33')](_0x58eda2[_0x993e('0x32')]);_0xf582f6['filters']=_['intersection'](_0xf582f6[_0x993e('0x36')],_0xf582f6['query']);_0x34ffaf[_0x993e('0x37')]=_['intersection'](_0xf582f6[_0x993e('0x36')],qs[_0x993e('0x38')](_0x58eda2['query'][_0x993e('0x38')]));_0x34ffaf['attributes']=_0x34ffaf[_0x993e('0x37')][_0x993e('0x39')]?_0x34ffaf[_0x993e('0x37')]:_0xf582f6[_0x993e('0x36')];_0x34ffaf[_0x993e('0x3c')]=qs[_0x993e('0x3d')](_0x58eda2[_0x993e('0x32')][_0x993e('0x3d')]);_0x34ffaf[_0x993e('0x3e')]=qs[_0x993e('0x34')](_[_0x993e('0x3f')](_0x58eda2['query'],_0xf582f6['filters']));if(_0x58eda2[_0x993e('0x32')]['filter']){_0x34ffaf['where']=_[_0x993e('0x40')](_0x34ffaf[_0x993e('0x3e')],{'$or':_[_0x993e('0x2f')](_0x34ffaf['attributes'],function(_0x175277){var _0x4ff6fe={};_0x4ff6fe[_0x175277]={'$like':'%'+_0x58eda2[_0x993e('0x32')][_0x993e('0x42')]+'%'};return _0x4ff6fe;})});}_0x34ffaf=_[_0x993e('0x40')]({},_0x34ffaf,_0x58eda2[_0x993e('0x43')]);return _0x42dc0e['getSubjects'](_0x34ffaf);}})[_0x993e('0x28')](function(_0x39c137){if(_0x39c137){_0x5a38ff=_0x39c137[_0x993e('0x39')];if(!_0x58eda2[_0x993e('0x32')][_0x993e('0x3a')](_0x993e('0x3b'))){_0x34ffaf[_0x993e('0x21')]=qs[_0x993e('0x21')](_0x58eda2[_0x993e('0x32')][_0x993e('0x21')]);_0x34ffaf[_0x993e('0x1f')]=qs['offset'](_0x58eda2[_0x993e('0x32')]['offset']);}return _0x42dc0e['getSubjects'](_0x34ffaf);}})['then'](function(_0x1e3b87){if(_0x1e3b87){return _0x1e3b87?{'count':_0x5a38ff,'rows':_0x1e3b87}:null;}})[_0x993e('0x28')](respondWithResult(_0x5646cd,null))['catch'](handleError(_0x5646cd,null));};exports[_0x993e('0x51')]=function(_0x31928f,_0x37be30,_0x459403){var _0x35696f={};var _0x279263={};var _0x3c98c0;var _0x1f53e9;return db[_0x993e('0x30')]['findOne']({'where':{'id':_0x31928f['params']['id']}})[_0x993e('0x28')](handleEntityNotFound(_0x37be30,null))[_0x993e('0x28')](function(_0x262e7a){if(_0x262e7a){_0x3c98c0=_0x262e7a;_0x279263['model']=_[_0x993e('0x33')](db[_0x993e('0x4f')][_0x993e('0x52')]);_0x279263[_0x993e('0x32')]=_['keys'](_0x31928f[_0x993e('0x32')]);_0x279263[_0x993e('0x34')]=_[_0x993e('0x35')](_0x279263[_0x993e('0x36')],_0x279263[_0x993e('0x32')]);_0x35696f[_0x993e('0x37')]=_[_0x993e('0x35')](_0x279263['model'],qs[_0x993e('0x38')](_0x31928f['query'][_0x993e('0x38')]));_0x35696f[_0x993e('0x37')]=_0x35696f[_0x993e('0x37')][_0x993e('0x39')]?_0x35696f[_0x993e('0x37')]:_0x279263[_0x993e('0x36')];_0x35696f[_0x993e('0x3c')]=qs[_0x993e('0x3d')](_0x31928f[_0x993e('0x32')][_0x993e('0x3d')]);_0x35696f[_0x993e('0x3e')]=qs[_0x993e('0x34')](_[_0x993e('0x3f')](_0x31928f[_0x993e('0x32')],_0x279263[_0x993e('0x34')]));if(_0x31928f[_0x993e('0x32')][_0x993e('0x42')]){_0x35696f[_0x993e('0x3e')]=_[_0x993e('0x40')](_0x35696f['where'],{'$or':_[_0x993e('0x2f')](_0x35696f[_0x993e('0x37')],function(_0x45cfad){var _0x2830d7={};_0x2830d7[_0x45cfad]={'$like':'%'+_0x31928f[_0x993e('0x32')][_0x993e('0x42')]+'%'};return _0x2830d7;})});}_0x35696f=_['merge']({},_0x35696f,_0x31928f['options']);return _0x3c98c0['getDescriptions'](_0x35696f);}})[_0x993e('0x28')](function(_0x4ab808){if(_0x4ab808){_0x1f53e9=_0x4ab808[_0x993e('0x39')];if(!_0x31928f[_0x993e('0x32')]['hasOwnProperty'](_0x993e('0x3b'))){_0x35696f['limit']=qs[_0x993e('0x21')](_0x31928f[_0x993e('0x32')]['limit']);_0x35696f[_0x993e('0x1f')]=qs['offset'](_0x31928f[_0x993e('0x32')][_0x993e('0x1f')]);}return _0x3c98c0[_0x993e('0x51')](_0x35696f);}})[_0x993e('0x28')](function(_0x2f01b2){if(_0x2f01b2){return _0x2f01b2?{'count':_0x1f53e9,'rows':_0x2f01b2}:null;}})[_0x993e('0x28')](respondWithResult(_0x37be30,null))[_0x993e('0x46')](handleError(_0x37be30,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 7db1208..40d963f 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 _0xcef1=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','int_vtiger_configurations','lodash'];(function(_0x396dc8,_0x5d6636){var _0x2c69de=function(_0x27e715){while(--_0x27e715){_0x396dc8['push'](_0x396dc8['shift']());}};_0x2c69de(++_0x5d6636);}(_0xcef1,0x8e));var _0x1cef=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcef1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1cef('0x0'));var util=require(_0x1cef('0x1'));var logger=require(_0x1cef('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1cef('0x3'));var rp=require(_0x1cef('0x4'));var fs=require('fs');var path=require(_0x1cef('0x5'));var rimraf=require(_0x1cef('0x6'));var config=require(_0x1cef('0x7'));var attributes=require(_0x1cef('0x8'));module['exports']=function(_0x1832c4,_0x10974c){return _0x1832c4[_0x1cef('0x9')]('VtigerConfiguration',attributes,{'tableName':_0x1cef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde5b=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xde5b,0xa8));var _0xbde5=function(_0x1e6485,_0x2920b8){_0x1e6485=_0x1e6485-0x0;var _0x3d8913=_0xde5b[_0x1e6485];return _0x3d8913;};'use strict';var _=require(_0xbde5('0x0'));var util=require(_0xbde5('0x1'));var logger=require(_0xbde5('0x2'))(_0xbde5('0x3'));var moment=require(_0xbde5('0x4'));var BPromise=require(_0xbde5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbde5('0x6'));var config=require(_0xbde5('0x7'));var attributes=require(_0xbde5('0x8'));module[_0xbde5('0x9')]=function(_0x3d44f5,_0xfae2f9){return _0x3d44f5[_0xbde5('0xa')](_0xbde5('0xb'),attributes,{'tableName':_0xbde5('0xc'),'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 e30880e..a6cd477 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 _0xaafa=['VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','debug'];(function(_0x32d174,_0x40ea6b){var _0x31fdd4=function(_0x4a4c42){while(--_0x4a4c42){_0x32d174['push'](_0x32d174['shift']());}};_0x31fdd4(++_0x40ea6b);}(_0xaafa,0x181));var _0xaaaf=function(_0x205b96,_0x51c129){_0x205b96=_0x205b96-0x0;var _0x14cb0d=_0xaafa[_0x205b96];return _0x14cb0d;};'use strict';var _=require(_0xaaaf('0x0'));var util=require(_0xaaaf('0x1'));var moment=require(_0xaaaf('0x2'));var BPromise=require(_0xaaaf('0x3'));var rs=require(_0xaaaf('0x4'));var fs=require('fs');var Redis=require(_0xaaaf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaaaf('0x6'));var logger=require('../../config/logger')(_0xaaaf('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaaaf('0x8')][_0xaaaf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58e7a0,_0xe0b040,_0x1734d3){return new BPromise(function(_0x5e5b01,_0x505dbc){return client['request'](_0x58e7a0,_0x1734d3)[_0xaaaf('0xa')](function(_0x473b89){logger[_0xaaaf('0xb')](_0xaaaf('0xc'),_0xe0b040,'request\x20sent');logger[_0xaaaf('0xd')](_0xaaaf('0xe'),_0xe0b040,_0xaaaf('0xf'),JSON[_0xaaaf('0x10')](_0x473b89));if(_0x473b89[_0xaaaf('0x11')]){if(_0x473b89[_0xaaaf('0x11')]['code']===0x1f4){logger[_0xaaaf('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0xe0b040,_0x473b89[_0xaaaf('0x11')][_0xaaaf('0x12')]);return _0x505dbc(_0x473b89['error']['message']);}logger['error'](_0xaaaf('0xc'),_0xe0b040,_0x473b89[_0xaaaf('0x11')][_0xaaaf('0x12')]);return _0x5e5b01(_0x473b89['error'][_0xaaaf('0x12')]);}else{logger[_0xaaaf('0xb')](_0xaaaf('0xc'),_0xe0b040,'request\x20sent');_0x5e5b01(_0x473b89[_0xaaaf('0x13')][_0xaaaf('0x12')]);}})[_0xaaaf('0x14')](function(_0x2f3b57){logger[_0xaaaf('0x11')](_0xaaaf('0xc'),_0xe0b040,_0x2f3b57);_0x505dbc(_0x2f3b57);});});} \ No newline at end of file +var _0x74fb=['info','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x74fb,0x1d7));var _0xb74f=function(_0x2624f7,_0x4175b9){_0x2624f7=_0x2624f7-0x0;var _0x3ea815=_0x74fb[_0x2624f7];return _0x3ea815;};'use strict';var _=require(_0xb74f('0x0'));var util=require('util');var moment=require(_0xb74f('0x1'));var BPromise=require(_0xb74f('0x2'));var rs=require(_0xb74f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb74f('0x4'))['db'];var utils=require(_0xb74f('0x5'));var logger=require(_0xb74f('0x6'))(_0xb74f('0x7'));var config=require(_0xb74f('0x8'));var jayson=require(_0xb74f('0x9'));var client=jayson[_0xb74f('0xa')][_0xb74f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8df51c,_0x11ef39,_0x42967e){return new BPromise(function(_0x163a56,_0x3ffdd7){return client[_0xb74f('0xc')](_0x8df51c,_0x42967e)['then'](function(_0x5621cc){logger[_0xb74f('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x11ef39,_0xb74f('0xe'));logger['debug'](_0xb74f('0xf'),_0x11ef39,_0xb74f('0xe'),JSON[_0xb74f('0x10')](_0x5621cc));if(_0x5621cc[_0xb74f('0x11')]){if(_0x5621cc[_0xb74f('0x11')][_0xb74f('0x12')]===0x1f4){logger['error'](_0xb74f('0x13'),_0x11ef39,_0x5621cc['error'][_0xb74f('0x14')]);return _0x3ffdd7(_0x5621cc[_0xb74f('0x11')]['message']);}logger[_0xb74f('0x11')](_0xb74f('0x13'),_0x11ef39,_0x5621cc[_0xb74f('0x11')][_0xb74f('0x14')]);return _0x163a56(_0x5621cc[_0xb74f('0x11')][_0xb74f('0x14')]);}else{logger['info'](_0xb74f('0x13'),_0x11ef39,_0xb74f('0xe'));_0x163a56(_0x5621cc['result'][_0xb74f('0x14')]);}})[_0xb74f('0x15')](function(_0x599e00){logger[_0xb74f('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x11ef39,_0x599e00);_0x3ffdd7(_0x599e00);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index d56d5d9..9443049 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 _0x690c=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','show','post','put','/:id','update','delete','destroy'];(function(_0x3381e5,_0x21a59d){var _0xe1147b=function(_0x2732ec){while(--_0x2732ec){_0x3381e5['push'](_0x3381e5['shift']());}};_0xe1147b(++_0x21a59d);}(_0x690c,0xbf));var _0xc690=function(_0x1561f6,_0x5c1905){_0x1561f6=_0x1561f6-0x0;var _0x5c948f=_0x690c[_0x1561f6];return _0x5c948f;};'use strict';var multer=require(_0xc690('0x0'));var util=require('util');var path=require(_0xc690('0x1'));var timeout=require(_0xc690('0x2'));var express=require(_0xc690('0x3'));var router=express[_0xc690('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc690('0x5'));var interaction=require(_0xc690('0x6'));var config=require(_0xc690('0x7'));var controller=require(_0xc690('0x8'));router[_0xc690('0x9')]('/',auth[_0xc690('0xa')](),controller['index']);router['get']('/:id',auth[_0xc690('0xa')](),controller[_0xc690('0xb')]);router[_0xc690('0xc')]('/',auth[_0xc690('0xa')](),controller['create']);router[_0xc690('0xd')](_0xc690('0xe'),auth[_0xc690('0xa')](),controller[_0xc690('0xf')]);router[_0xc690('0x10')](_0xc690('0xe'),auth[_0xc690('0xa')](),controller[_0xc690('0x11')]);module[_0xc690('0x12')]=router; \ No newline at end of file +var _0x5fe0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','put','update','delete','/:id','exports','multer','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5fe0,0x1e3));var _0x05fe=function(_0x2dc103,_0x30471c){_0x2dc103=_0x2dc103-0x0;var _0x24ff4c=_0x5fe0[_0x2dc103];return _0x24ff4c;};'use strict';var multer=require(_0x05fe('0x0'));var util=require(_0x05fe('0x1'));var path=require(_0x05fe('0x2'));var timeout=require(_0x05fe('0x3'));var express=require(_0x05fe('0x4'));var router=express[_0x05fe('0x5')]();var fs_extra=require(_0x05fe('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x05fe('0x7'));var config=require(_0x05fe('0x8'));var controller=require('./intVtigerField.controller');router[_0x05fe('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x05fe('0x9')]('/:id',auth[_0x05fe('0xa')](),controller[_0x05fe('0xb')]);router[_0x05fe('0xc')]('/',auth[_0x05fe('0xa')](),controller['create']);router[_0x05fe('0xd')]('/:id',auth[_0x05fe('0xa')](),controller[_0x05fe('0xe')]);router[_0x05fe('0xf')](_0x05fe('0x10'),auth[_0x05fe('0xa')](),controller['destroy']);module[_0x05fe('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 94f3aa7..8b0eccc 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 _0xb763=['string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x55a89e,_0x1a05ab){var _0x3aa2bd=function(_0x4b9d09){while(--_0x4b9d09){_0x55a89e['push'](_0x55a89e['shift']());}};_0x3aa2bd(++_0x1a05ab);}(_0xb763,0xdf));var _0x3b76=function(_0x4ac079,_0x43e97a){_0x4ac079=_0x4ac079-0x0;var _0x1522e7=_0xb763[_0x4ac079];return _0x1522e7;};'use strict';var Sequelize=require(_0x3b76('0x0'));module[_0x3b76('0x1')]={'type':{'type':Sequelize[_0x3b76('0x2')]('string',_0x3b76('0x3'),_0x3b76('0x4'),_0x3b76('0x5'),_0x3b76('0x6')),'defaultValue':_0x3b76('0x7')},'content':{'type':Sequelize[_0x3b76('0x8')]},'key':{'type':Sequelize[_0x3b76('0x8')]},'keyType':{'type':Sequelize[_0x3b76('0x2')]('string',_0x3b76('0x3'),_0x3b76('0x4'))},'keyContent':{'type':Sequelize[_0x3b76('0x8')]},'idField':{'type':Sequelize[_0x3b76('0x8')]},'nameField':{'type':Sequelize[_0x3b76('0x8')]},'customField':{'type':Sequelize[_0x3b76('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3b76('0x8')]}}; \ No newline at end of file +var _0x0a30=['keyValue','picklist','STRING','sequelize','ENUM','string','variable'];(function(_0x17b041,_0x3b2ac3){var _0x46235c=function(_0x576f54){while(--_0x576f54){_0x17b041['push'](_0x17b041['shift']());}};_0x46235c(++_0x3b2ac3);}(_0x0a30,0xa4));var _0x00a3=function(_0x20d2de,_0x51ffd8){_0x20d2de=_0x20d2de-0x0;var _0x448033=_0x0a30[_0x20d2de];return _0x448033;};'use strict';var Sequelize=require(_0x00a3('0x0'));module['exports']={'type':{'type':Sequelize[_0x00a3('0x1')](_0x00a3('0x2'),_0x00a3('0x3'),'customVariable',_0x00a3('0x4'),_0x00a3('0x5')),'defaultValue':_0x00a3('0x2')},'content':{'type':Sequelize[_0x00a3('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x00a3('0x1')](_0x00a3('0x2'),_0x00a3('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x00a3('0x6')]},'idField':{'type':Sequelize[_0x00a3('0x6')]},'nameField':{'type':Sequelize[_0x00a3('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x00a3('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index f88cb3d..035e38a 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 _0xe571=['fs-extra','squel','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','index','VtigerField','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','includeAll','find','create','body','catch','rimraf','request-promise','moment','mustache','util','path','sox','ejs'];(function(_0x574adb,_0x22f4d4){var _0x474193=function(_0x392c8b){while(--_0x392c8b){_0x574adb['push'](_0x574adb['shift']());}};_0x474193(++_0x22f4d4);}(_0xe571,0xcd));var _0x1e57=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe571[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e57('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1e57('0x1'));var moment=require(_0x1e57('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1e57('0x3'));var util=require(_0x1e57('0x4'));var path=require(_0x1e57('0x5'));var sox=require(_0x1e57('0x6'));var csv=require('to-csv');var ejs=require(_0x1e57('0x7'));var fs=require('fs');var fs_extra=require(_0x1e57('0x8'));var _=require('lodash');var squel=require(_0x1e57('0x9'));var crypto=require('crypto');var jsforce=require(_0x1e57('0xa'));var deskjs=require(_0x1e57('0xb'));var toCsv=require(_0x1e57('0xc'));var querystring=require('querystring');var Papa=require(_0x1e57('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1e57('0xe'));var as=require(_0x1e57('0xf'));var hardwareService=require(_0x1e57('0x10'));var logger=require('../../config/logger')(_0x1e57('0x11'));var utils=require(_0x1e57('0x12'));var config=require(_0x1e57('0x13'));var licenseUtil=require(_0x1e57('0x14'));var db=require(_0x1e57('0x15'))['db'];function respondWithStatusCode(_0x122a8a,_0x20ed7a){_0x20ed7a=_0x20ed7a||0xcc;return function(_0x499336){if(_0x499336){return _0x122a8a[_0x1e57('0x16')](_0x20ed7a);}return _0x122a8a[_0x1e57('0x17')](_0x20ed7a)[_0x1e57('0x18')]();};}function respondWithResult(_0x179685,_0x394af9){_0x394af9=_0x394af9||0xc8;return function(_0x3b65fe){if(_0x3b65fe){return _0x179685['status'](_0x394af9)[_0x1e57('0x19')](_0x3b65fe);}};}function respondWithFilteredResult(_0x245bda,_0x18da8e){return function(_0x1870c6){if(_0x1870c6){var _0x11bb1c=typeof _0x18da8e[_0x1e57('0x1a')]===_0x1e57('0x1b')&&typeof _0x18da8e[_0x1e57('0x1c')]===_0x1e57('0x1b');var _0xde0ca8=_0x1870c6[_0x1e57('0x1d')];var _0x563447=_0x11bb1c?0x0:_0x18da8e[_0x1e57('0x1a')];var _0x10248e=_0x11bb1c?_0x1870c6[_0x1e57('0x1d')]:_0x18da8e[_0x1e57('0x1a')]+_0x18da8e[_0x1e57('0x1c')];var _0xdd9b31;if(_0x10248e>=_0xde0ca8){_0x10248e=_0xde0ca8;_0xdd9b31=0xc8;}else{_0xdd9b31=0xce;}_0x245bda[_0x1e57('0x17')](_0xdd9b31);return _0x245bda[_0x1e57('0x1e')](_0x1e57('0x1f'),_0x563447+'-'+_0x10248e+'/'+_0xde0ca8)[_0x1e57('0x19')](_0x1870c6);}return null;};}function patchUpdates(_0x204b1d){return function(_0x12732a){try{jsonpatch[_0x1e57('0x20')](_0x12732a,_0x204b1d,!![]);}catch(_0x247bea){return BPromise[_0x1e57('0x21')](_0x247bea);}return _0x12732a['save']();};}function saveUpdates(_0x39cfe6,_0xc8c30){return function(_0x521cb5){if(_0x521cb5){return _0x521cb5[_0x1e57('0x22')](_0x39cfe6)[_0x1e57('0x23')](function(_0x1b04a3){return _0x1b04a3;});}return null;};}function removeEntity(_0x18e2a2,_0x51ce56){return function(_0x2b6c3a){if(_0x2b6c3a){return _0x2b6c3a[_0x1e57('0x24')]()['then'](function(){_0x18e2a2[_0x1e57('0x17')](0xcc)[_0x1e57('0x18')]();});}};}function handleEntityNotFound(_0x36d181,_0x274497){return function(_0x33c8a7){if(!_0x33c8a7){_0x36d181[_0x1e57('0x16')](0x194);}return _0x33c8a7;};}function handleError(_0x59668f,_0x177ddf){_0x177ddf=_0x177ddf||0x1f4;return function(_0x21e666){logger[_0x1e57('0x25')](_0x21e666['stack']);if(_0x21e666[_0x1e57('0x26')]){delete _0x21e666['name'];}_0x59668f[_0x1e57('0x17')](_0x177ddf)['send'](_0x21e666);};}exports[_0x1e57('0x27')]=function(_0x5b48c1,_0x3d12f3){var _0x4ce602={},_0x8d97ef={},_0x54445f={'count':0x0,'rows':[]};var _0x307ec7=_['map'](db[_0x1e57('0x28')][_0x1e57('0x29')],function(_0x319290){return{'name':_0x319290['fieldName'],'type':_0x319290[_0x1e57('0x2a')][_0x1e57('0x2b')]};});_0x8d97ef[_0x1e57('0x2c')]=_[_0x1e57('0x2d')](_0x307ec7,_0x1e57('0x26'));_0x8d97ef[_0x1e57('0x2e')]=_['keys'](_0x5b48c1['query']);_0x8d97ef[_0x1e57('0x2f')]=_[_0x1e57('0x30')](_0x8d97ef[_0x1e57('0x2c')],_0x8d97ef[_0x1e57('0x2e')]);_0x4ce602[_0x1e57('0x31')]=_[_0x1e57('0x30')](_0x8d97ef[_0x1e57('0x2c')],qs[_0x1e57('0x32')](_0x5b48c1[_0x1e57('0x2e')]['fields']));_0x4ce602[_0x1e57('0x31')]=_0x4ce602[_0x1e57('0x31')]['length']?_0x4ce602['attributes']:_0x8d97ef['model'];if(!_0x5b48c1['query'][_0x1e57('0x33')](_0x1e57('0x34'))){_0x4ce602[_0x1e57('0x1c')]=qs[_0x1e57('0x1c')](_0x5b48c1[_0x1e57('0x2e')]['limit']);_0x4ce602[_0x1e57('0x1a')]=qs[_0x1e57('0x1a')](_0x5b48c1[_0x1e57('0x2e')]['offset']);}_0x4ce602[_0x1e57('0x35')]=qs[_0x1e57('0x36')](_0x5b48c1[_0x1e57('0x2e')]['sort']);_0x4ce602[_0x1e57('0x37')]=qs[_0x1e57('0x2f')](_['pick'](_0x5b48c1[_0x1e57('0x2e')],_0x8d97ef[_0x1e57('0x2f')]),_0x307ec7);if(_0x5b48c1[_0x1e57('0x2e')][_0x1e57('0x38')]){_0x4ce602['where']=_[_0x1e57('0x39')](_0x4ce602[_0x1e57('0x37')],{'$or':_[_0x1e57('0x2d')](_0x307ec7,function(_0x43e83f){if(_0x43e83f[_0x1e57('0x2a')]!==_0x1e57('0x3a')){var _0x124928={};_0x124928[_0x43e83f[_0x1e57('0x26')]]={'$like':'%'+_0x5b48c1[_0x1e57('0x2e')][_0x1e57('0x38')]+'%'};return _0x124928;}})});}_0x4ce602=_['merge']({},_0x4ce602,_0x5b48c1[_0x1e57('0x3b')]);var _0x10ebe4={'where':_0x4ce602['where']};return db['VtigerField'][_0x1e57('0x1d')](_0x10ebe4)[_0x1e57('0x23')](function(_0x2ae238){_0x54445f[_0x1e57('0x1d')]=_0x2ae238;if(_0x5b48c1[_0x1e57('0x2e')]['includeAll']){_0x4ce602[_0x1e57('0x3c')]=[{'all':!![]}];}return db[_0x1e57('0x28')][_0x1e57('0x3d')](_0x4ce602);})['then'](function(_0x28eab0){_0x54445f[_0x1e57('0x3e')]=_0x28eab0;return _0x54445f;})['then'](respondWithFilteredResult(_0x3d12f3,_0x4ce602))['catch'](handleError(_0x3d12f3,null));};exports[_0x1e57('0x3f')]=function(_0x58fb00,_0xa980a4){var _0x4f6525={'raw':!![],'where':{'id':_0x58fb00[_0x1e57('0x40')]['id']}},_0x498d43={};_0x498d43[_0x1e57('0x2c')]=_['keys'](db[_0x1e57('0x28')][_0x1e57('0x29')]);_0x498d43[_0x1e57('0x2e')]=_[_0x1e57('0x41')](_0x58fb00[_0x1e57('0x2e')]);_0x498d43[_0x1e57('0x2f')]=_[_0x1e57('0x30')](_0x498d43[_0x1e57('0x2c')],_0x498d43[_0x1e57('0x2e')]);_0x4f6525['attributes']=_['intersection'](_0x498d43[_0x1e57('0x2c')],qs[_0x1e57('0x32')](_0x58fb00['query'][_0x1e57('0x32')]));_0x4f6525['attributes']=_0x4f6525[_0x1e57('0x31')]['length']?_0x4f6525[_0x1e57('0x31')]:_0x498d43[_0x1e57('0x2c')];if(_0x58fb00[_0x1e57('0x2e')][_0x1e57('0x42')]){_0x4f6525[_0x1e57('0x3c')]=[{'all':!![]}];}_0x4f6525=_[_0x1e57('0x39')]({},_0x4f6525,_0x58fb00['options']);return db[_0x1e57('0x28')][_0x1e57('0x43')](_0x4f6525)[_0x1e57('0x23')](handleEntityNotFound(_0xa980a4,null))['then'](respondWithResult(_0xa980a4,null))['catch'](handleError(_0xa980a4,null));};exports[_0x1e57('0x44')]=function(_0x1b0123,_0x306416){return db[_0x1e57('0x28')][_0x1e57('0x44')](_0x1b0123[_0x1e57('0x45')],{})[_0x1e57('0x23')](respondWithResult(_0x306416,0xc9))['catch'](handleError(_0x306416,null));};exports[_0x1e57('0x22')]=function(_0x485a64,_0x3c6095){if(_0x485a64[_0x1e57('0x45')]['id']){delete _0x485a64[_0x1e57('0x45')]['id'];}return db[_0x1e57('0x28')][_0x1e57('0x43')]({'where':{'id':_0x485a64['params']['id']}})[_0x1e57('0x23')](handleEntityNotFound(_0x3c6095,null))[_0x1e57('0x23')](saveUpdates(_0x485a64['body'],null))[_0x1e57('0x23')](respondWithResult(_0x3c6095,null))['catch'](handleError(_0x3c6095,null));};exports[_0x1e57('0x24')]=function(_0x41effa,_0x30dda5){return db['VtigerField'][_0x1e57('0x43')]({'where':{'id':_0x41effa[_0x1e57('0x40')]['id']}})['then'](handleEntityNotFound(_0x30dda5,null))[_0x1e57('0x23')](removeEntity(_0x30dda5,null))[_0x1e57('0x46')](handleError(_0x30dda5,null));}; \ No newline at end of file +var _0xa018=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','VtigerField','include','findAll','rows','catch','show','rawAttributes','options','find','body','params','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model'];(function(_0x3e3539,_0x33795a){var _0x142c73=function(_0x2d5d78){while(--_0x2d5d78){_0x3e3539['push'](_0x3e3539['shift']());}};_0x142c73(++_0x33795a);}(_0xa018,0xf2));var _0x8a01=function(_0xe64556,_0x3b940d){_0xe64556=_0xe64556-0x0;var _0x9ba36=_0xa018[_0xe64556];return _0x9ba36;};'use strict';var emlformat=require(_0x8a01('0x0'));var rimraf=require(_0x8a01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8a01('0x2'));var rp=require(_0x8a01('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8a01('0x4'));var util=require(_0x8a01('0x5'));var path=require('path');var sox=require(_0x8a01('0x6'));var csv=require(_0x8a01('0x7'));var ejs=require(_0x8a01('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8a01('0x9'));var squel=require(_0x8a01('0xa'));var crypto=require(_0x8a01('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8a01('0x7'));var querystring=require(_0x8a01('0xc'));var Papa=require('papaparse');var Redis=require(_0x8a01('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x8a01('0xe'));var as=require(_0x8a01('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a01('0x10'))(_0x8a01('0x11'));var utils=require(_0x8a01('0x12'));var config=require(_0x8a01('0x13'));var licenseUtil=require(_0x8a01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41f53b,_0x2a7307){_0x2a7307=_0x2a7307||0xcc;return function(_0x9df6c9){if(_0x9df6c9){return _0x41f53b['sendStatus'](_0x2a7307);}return _0x41f53b[_0x8a01('0x15')](_0x2a7307)[_0x8a01('0x16')]();};}function respondWithResult(_0x559f9e,_0x1fd02a){_0x1fd02a=_0x1fd02a||0xc8;return function(_0x261345){if(_0x261345){return _0x559f9e[_0x8a01('0x15')](_0x1fd02a)['json'](_0x261345);}};}function respondWithFilteredResult(_0xa4898f,_0x59bfac){return function(_0xbf2108){if(_0xbf2108){var _0x11cc12=typeof _0x59bfac[_0x8a01('0x17')]===_0x8a01('0x18')&&typeof _0x59bfac[_0x8a01('0x19')]===_0x8a01('0x18');var _0x56f121=_0xbf2108[_0x8a01('0x1a')];var _0x204792=_0x11cc12?0x0:_0x59bfac[_0x8a01('0x17')];var _0x3533b9=_0x11cc12?_0xbf2108['count']:_0x59bfac[_0x8a01('0x17')]+_0x59bfac[_0x8a01('0x19')];var _0x231bd3;if(_0x3533b9>=_0x56f121){_0x3533b9=_0x56f121;_0x231bd3=0xc8;}else{_0x231bd3=0xce;}_0xa4898f[_0x8a01('0x15')](_0x231bd3);return _0xa4898f[_0x8a01('0x1b')](_0x8a01('0x1c'),_0x204792+'-'+_0x3533b9+'/'+_0x56f121)[_0x8a01('0x1d')](_0xbf2108);}return null;};}function patchUpdates(_0xb9a377){return function(_0x37b31d){try{jsonpatch[_0x8a01('0x1e')](_0x37b31d,_0xb9a377,!![]);}catch(_0x328e95){return BPromise[_0x8a01('0x1f')](_0x328e95);}return _0x37b31d[_0x8a01('0x20')]();};}function saveUpdates(_0x3a20ef,_0x1393c2){return function(_0x2123fe){if(_0x2123fe){return _0x2123fe[_0x8a01('0x21')](_0x3a20ef)[_0x8a01('0x22')](function(_0x54c8e4){return _0x54c8e4;});}return null;};}function removeEntity(_0x41bbd3,_0xf6114){return function(_0x4765b4){if(_0x4765b4){return _0x4765b4[_0x8a01('0x23')]()['then'](function(){_0x41bbd3[_0x8a01('0x15')](0xcc)[_0x8a01('0x16')]();});}};}function handleEntityNotFound(_0x918bde,_0x2ec2d2){return function(_0xcac6e3){if(!_0xcac6e3){_0x918bde['sendStatus'](0x194);}return _0xcac6e3;};}function handleError(_0xa3d397,_0x1f210f){_0x1f210f=_0x1f210f||0x1f4;return function(_0x4e9168){logger[_0x8a01('0x24')](_0x4e9168[_0x8a01('0x25')]);if(_0x4e9168[_0x8a01('0x26')]){delete _0x4e9168['name'];}_0xa3d397[_0x8a01('0x15')](_0x1f210f)[_0x8a01('0x27')](_0x4e9168);};}exports[_0x8a01('0x28')]=function(_0x57e93c,_0x5c912b){var _0x335c1a={},_0x5f283c={},_0xd535ea={'count':0x0,'rows':[]};var _0x1c215e=_[_0x8a01('0x29')](db['VtigerField']['rawAttributes'],function(_0x2ab543){return{'name':_0x2ab543[_0x8a01('0x2a')],'type':_0x2ab543[_0x8a01('0x2b')][_0x8a01('0x2c')]};});_0x5f283c[_0x8a01('0x2d')]=_['map'](_0x1c215e,_0x8a01('0x26'));_0x5f283c[_0x8a01('0x2e')]=_[_0x8a01('0x2f')](_0x57e93c[_0x8a01('0x2e')]);_0x5f283c[_0x8a01('0x30')]=_[_0x8a01('0x31')](_0x5f283c[_0x8a01('0x2d')],_0x5f283c[_0x8a01('0x2e')]);_0x335c1a[_0x8a01('0x32')]=_[_0x8a01('0x31')](_0x5f283c['model'],qs[_0x8a01('0x33')](_0x57e93c[_0x8a01('0x2e')][_0x8a01('0x33')]));_0x335c1a['attributes']=_0x335c1a['attributes'][_0x8a01('0x34')]?_0x335c1a[_0x8a01('0x32')]:_0x5f283c['model'];if(!_0x57e93c[_0x8a01('0x2e')][_0x8a01('0x35')](_0x8a01('0x36'))){_0x335c1a[_0x8a01('0x19')]=qs[_0x8a01('0x19')](_0x57e93c['query'][_0x8a01('0x19')]);_0x335c1a[_0x8a01('0x17')]=qs[_0x8a01('0x17')](_0x57e93c[_0x8a01('0x2e')]['offset']);}_0x335c1a[_0x8a01('0x37')]=qs[_0x8a01('0x38')](_0x57e93c[_0x8a01('0x2e')][_0x8a01('0x38')]);_0x335c1a[_0x8a01('0x39')]=qs['filters'](_['pick'](_0x57e93c[_0x8a01('0x2e')],_0x5f283c[_0x8a01('0x30')]),_0x1c215e);if(_0x57e93c[_0x8a01('0x2e')][_0x8a01('0x3a')]){_0x335c1a[_0x8a01('0x39')]=_[_0x8a01('0x3b')](_0x335c1a[_0x8a01('0x39')],{'$or':_[_0x8a01('0x29')](_0x1c215e,function(_0x7e76d5){if(_0x7e76d5['type']!==_0x8a01('0x3c')){var _0x28f685={};_0x28f685[_0x7e76d5[_0x8a01('0x26')]]={'$like':'%'+_0x57e93c[_0x8a01('0x2e')]['filter']+'%'};return _0x28f685;}})});}_0x335c1a=_[_0x8a01('0x3b')]({},_0x335c1a,_0x57e93c['options']);var _0x7f1a1a={'where':_0x335c1a['where']};return db[_0x8a01('0x3d')][_0x8a01('0x1a')](_0x7f1a1a)['then'](function(_0x514b77){_0xd535ea[_0x8a01('0x1a')]=_0x514b77;if(_0x57e93c[_0x8a01('0x2e')]['includeAll']){_0x335c1a[_0x8a01('0x3e')]=[{'all':!![]}];}return db[_0x8a01('0x3d')][_0x8a01('0x3f')](_0x335c1a);})['then'](function(_0x25d612){_0xd535ea[_0x8a01('0x40')]=_0x25d612;return _0xd535ea;})[_0x8a01('0x22')](respondWithFilteredResult(_0x5c912b,_0x335c1a))[_0x8a01('0x41')](handleError(_0x5c912b,null));};exports[_0x8a01('0x42')]=function(_0x192144,_0x508054){var _0x244a43={'raw':!![],'where':{'id':_0x192144['params']['id']}},_0x3b5484={};_0x3b5484['model']=_[_0x8a01('0x2f')](db[_0x8a01('0x3d')][_0x8a01('0x43')]);_0x3b5484[_0x8a01('0x2e')]=_[_0x8a01('0x2f')](_0x192144[_0x8a01('0x2e')]);_0x3b5484['filters']=_[_0x8a01('0x31')](_0x3b5484['model'],_0x3b5484[_0x8a01('0x2e')]);_0x244a43['attributes']=_['intersection'](_0x3b5484[_0x8a01('0x2d')],qs[_0x8a01('0x33')](_0x192144['query'][_0x8a01('0x33')]));_0x244a43[_0x8a01('0x32')]=_0x244a43[_0x8a01('0x32')]['length']?_0x244a43[_0x8a01('0x32')]:_0x3b5484[_0x8a01('0x2d')];if(_0x192144['query']['includeAll']){_0x244a43[_0x8a01('0x3e')]=[{'all':!![]}];}_0x244a43=_[_0x8a01('0x3b')]({},_0x244a43,_0x192144[_0x8a01('0x44')]);return db[_0x8a01('0x3d')][_0x8a01('0x45')](_0x244a43)[_0x8a01('0x22')](handleEntityNotFound(_0x508054,null))[_0x8a01('0x22')](respondWithResult(_0x508054,null))[_0x8a01('0x41')](handleError(_0x508054,null));};exports['create']=function(_0x3949d1,_0x1f2112){return db[_0x8a01('0x3d')]['create'](_0x3949d1[_0x8a01('0x46')],{})[_0x8a01('0x22')](respondWithResult(_0x1f2112,0xc9))['catch'](handleError(_0x1f2112,null));};exports[_0x8a01('0x21')]=function(_0x2f21e6,_0x272052){if(_0x2f21e6[_0x8a01('0x46')]['id']){delete _0x2f21e6[_0x8a01('0x46')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x2f21e6[_0x8a01('0x47')]['id']}})[_0x8a01('0x22')](handleEntityNotFound(_0x272052,null))['then'](saveUpdates(_0x2f21e6[_0x8a01('0x46')],null))['then'](respondWithResult(_0x272052,null))[_0x8a01('0x41')](handleError(_0x272052,null));};exports[_0x8a01('0x23')]=function(_0x3b8310,_0x509ab2){return db[_0x8a01('0x3d')][_0x8a01('0x45')]({'where':{'id':_0x3b8310['params']['id']}})[_0x8a01('0x22')](handleEntityNotFound(_0x509ab2,null))['then'](removeEntity(_0x509ab2,null))[_0x8a01('0x41')](handleError(_0x509ab2,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 3da6131..7e17e8c 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 _0x15bd=['FieldId','lodash','api','moment','bluebird','rimraf','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x15bd,0x1bb));var _0xd15b=function(_0x42764d,_0x332a27){_0x42764d=_0x42764d-0x0;var _0x2a643c=_0x15bd[_0x42764d];return _0x2a643c;};'use strict';var _=require(_0xd15b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd15b('0x1'));var moment=require(_0xd15b('0x2'));var BPromise=require(_0xd15b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd15b('0x4'));var config=require('../../config/environment');var attributes=require(_0xd15b('0x5'));module[_0xd15b('0x6')]=function(_0x459689,_0x576065){return _0x459689[_0xd15b('0x7')](_0xd15b('0x8'),attributes,{'tableName':_0xd15b('0x9'),'paranoid':![],'indexes':[{'name':_0xd15b('0xa'),'fields':[_0xd15b('0xb'),_0xd15b('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf016=['moment','bluebird','request-promise','path','rimraf','./intVtigerField.attributes','exports','define','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x239875,_0x52a793){var _0x55a8d6=function(_0x1c48db){while(--_0x1c48db){_0x239875['push'](_0x239875['shift']());}};_0x55a8d6(++_0x52a793);}(_0xf016,0xb0));var _0x6f01=function(_0x2a826f,_0xbd49d6){_0x2a826f=_0x2a826f-0x0;var _0x346364=_0xf016[_0x2a826f];return _0x346364;};'use strict';var _=require(_0x6f01('0x0'));var util=require(_0x6f01('0x1'));var logger=require(_0x6f01('0x2'))(_0x6f01('0x3'));var moment=require(_0x6f01('0x4'));var BPromise=require(_0x6f01('0x5'));var rp=require(_0x6f01('0x6'));var fs=require('fs');var path=require(_0x6f01('0x7'));var rimraf=require(_0x6f01('0x8'));var config=require('../../config/environment');var attributes=require(_0x6f01('0x9'));module[_0x6f01('0xa')]=function(_0x4c7907,_0x3ce22f){return _0x4c7907[_0x6f01('0xb')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x6f01('0xc'),'fields':[_0x6f01('0xd'),_0x6f01('0xe')],'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 34e3fcf..55b7459 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 _0xc136=['debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent'];(function(_0x18d778,_0x15c637){var _0x4e3cbc=function(_0x2dcc06){while(--_0x2dcc06){_0x18d778['push'](_0x18d778['shift']());}};_0x4e3cbc(++_0x15c637);}(_0xc136,0x8a));var _0x6c13=function(_0x42328f,_0x2add57){_0x42328f=_0x42328f-0x0;var _0x53e3ef=_0xc136[_0x42328f];return _0x53e3ef;};'use strict';var _=require(_0x6c13('0x0'));var util=require(_0x6c13('0x1'));var moment=require(_0x6c13('0x2'));var BPromise=require(_0x6c13('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c13('0x4'));var db=require(_0x6c13('0x5'))['db'];var utils=require(_0x6c13('0x6'));var logger=require(_0x6c13('0x7'))(_0x6c13('0x8'));var config=require(_0x6c13('0x9'));var jayson=require(_0x6c13('0xa'));var client=jayson['client'][_0x6c13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x181ecb,_0xeb228b,_0x1f99e5){return new BPromise(function(_0xe738be,_0x25e78e){return client[_0x6c13('0xc')](_0x181ecb,_0x1f99e5)[_0x6c13('0xd')](function(_0x112977){logger['info'](_0x6c13('0xe'),_0xeb228b,_0x6c13('0xf'));logger[_0x6c13('0x10')](_0x6c13('0x11'),_0xeb228b,'request\x20sent',JSON[_0x6c13('0x12')](_0x112977));if(_0x112977[_0x6c13('0x13')]){if(_0x112977[_0x6c13('0x13')]['code']===0x1f4){logger['error'](_0x6c13('0xe'),_0xeb228b,_0x112977[_0x6c13('0x13')][_0x6c13('0x14')]);return _0x25e78e(_0x112977[_0x6c13('0x13')][_0x6c13('0x14')]);}logger[_0x6c13('0x13')]('VtigerField,\x20%s,\x20%s',_0xeb228b,_0x112977[_0x6c13('0x13')][_0x6c13('0x14')]);return _0xe738be(_0x112977['error'][_0x6c13('0x14')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0xeb228b,_0x6c13('0xf'));_0xe738be(_0x112977['result'][_0x6c13('0x14')]);}})[_0x6c13('0x15')](function(_0x1b53f9){logger[_0x6c13('0x13')]('VtigerField,\x20%s,\x20%s',_0xeb228b,_0x1b53f9);_0x25e78e(_0x1b53f9);});});} \ No newline at end of file +var _0x90eb=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','VtigerField,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x11973d,_0x68c443){var _0x2875e3=function(_0x597cda){while(--_0x597cda){_0x11973d['push'](_0x11973d['shift']());}};_0x2875e3(++_0x68c443);}(_0x90eb,0x82));var _0xb90e=function(_0x193751,_0x169d89){_0x193751=_0x193751-0x0;var _0x2c36b7=_0x90eb[_0x193751];return _0x2c36b7;};'use strict';var _=require(_0xb90e('0x0'));var util=require(_0xb90e('0x1'));var moment=require(_0xb90e('0x2'));var BPromise=require('bluebird');var rs=require(_0xb90e('0x3'));var fs=require('fs');var Redis=require(_0xb90e('0x4'));var db=require(_0xb90e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb90e('0x6'))(_0xb90e('0x7'));var config=require(_0xb90e('0x8'));var jayson=require(_0xb90e('0x9'));var client=jayson[_0xb90e('0xa')][_0xb90e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd89d7f,_0x59cbfc,_0x5be9bf){return new BPromise(function(_0x320c75,_0xfd43ac){return client['request'](_0xd89d7f,_0x5be9bf)[_0xb90e('0xc')](function(_0xcb5a40){logger[_0xb90e('0xd')]('VtigerField,\x20%s,\x20%s',_0x59cbfc,_0xb90e('0xe'));logger[_0xb90e('0xf')](_0xb90e('0x10'),_0x59cbfc,'request\x20sent',JSON['stringify'](_0xcb5a40));if(_0xcb5a40[_0xb90e('0x11')]){if(_0xcb5a40[_0xb90e('0x11')][_0xb90e('0x12')]===0x1f4){logger[_0xb90e('0x11')](_0xb90e('0x13'),_0x59cbfc,_0xcb5a40[_0xb90e('0x11')][_0xb90e('0x14')]);return _0xfd43ac(_0xcb5a40['error']['message']);}logger[_0xb90e('0x11')](_0xb90e('0x13'),_0x59cbfc,_0xcb5a40['error'][_0xb90e('0x14')]);return _0x320c75(_0xcb5a40[_0xb90e('0x11')][_0xb90e('0x14')]);}else{logger['info'](_0xb90e('0x13'),_0x59cbfc,_0xb90e('0xe'));_0x320c75(_0xcb5a40['result'][_0xb90e('0x14')]);}})[_0xb90e('0x15')](function(_0xc18a83){logger['error']('VtigerField,\x20%s,\x20%s',_0x59cbfc,_0xc18a83);_0xfd43ac(_0xc18a83);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index bf60720..6f31e38 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 _0xacfb=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','util','connect-timeout','express','Router','fs-extra'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xacfb,0x95));var _0xbacf=function(_0x2eb484,_0x13056a){_0x2eb484=_0x2eb484-0x0;var _0x37d177=_0xacfb[_0x2eb484];return _0x37d177;};'use strict';var multer=require('multer');var util=require(_0xbacf('0x0'));var path=require('path');var timeout=require(_0xbacf('0x1'));var express=require(_0xbacf('0x2'));var router=express[_0xbacf('0x3')]();var fs_extra=require(_0xbacf('0x4'));var auth=require(_0xbacf('0x5'));var interaction=require(_0xbacf('0x6'));var config=require(_0xbacf('0x7'));var controller=require(_0xbacf('0x8'));router[_0xbacf('0x9')]('/',auth[_0xbacf('0xa')](),controller['index']);router[_0xbacf('0x9')](_0xbacf('0xb'),auth['isAuthenticated'](),controller[_0xbacf('0xc')]);router[_0xbacf('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xbacf('0xd')]);router['get']('/:id/fields',auth[_0xbacf('0xa')](),controller[_0xbacf('0xe')]);router[_0xbacf('0xf')]('/',auth[_0xbacf('0xa')](),controller[_0xbacf('0x10')]);router['post'](_0xbacf('0x11'),auth['isAuthenticated'](),controller[_0xbacf('0x12')]);router[_0xbacf('0x13')](_0xbacf('0xb'),auth[_0xbacf('0xa')](),controller[_0xbacf('0x14')]);router[_0xbacf('0x15')](_0xbacf('0xb'),auth[_0xbacf('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5d81=['/:id/configurations','getConfigurations','/:id/fields','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x5d81,0x1c0));var _0x15d8=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x5d81[_0x307d86];return _0x361745;};'use strict';var multer=require(_0x15d8('0x0'));var util=require(_0x15d8('0x1'));var path=require(_0x15d8('0x2'));var timeout=require('connect-timeout');var express=require(_0x15d8('0x3'));var router=express[_0x15d8('0x4')]();var fs_extra=require(_0x15d8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x15d8('0x6'));var config=require('../../config/environment');var controller=require(_0x15d8('0x7'));router[_0x15d8('0x8')]('/',auth[_0x15d8('0x9')](),controller[_0x15d8('0xa')]);router[_0x15d8('0x8')](_0x15d8('0xb'),auth[_0x15d8('0x9')](),controller['show']);router[_0x15d8('0x8')](_0x15d8('0xc'),auth['isAuthenticated'](),controller[_0x15d8('0xd')]);router['get'](_0x15d8('0xe'),auth[_0x15d8('0x9')](),controller['getFields']);router['post']('/',auth[_0x15d8('0x9')](),controller[_0x15d8('0xf')]);router['post'](_0x15d8('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x15d8('0x10')]('/:id',auth[_0x15d8('0x9')](),controller[_0x15d8('0x11')]);router[_0x15d8('0x12')](_0x15d8('0xb'),auth[_0x15d8('0x9')](),controller['destroy']);module[_0x15d8('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 36d9f0e..7cf3b66 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 _0xe3da=['integrationTab','sequelize','exports','STRING','username','remoteUri','ENUM','password','token','newTab'];(function(_0x120a97,_0x4f968e){var _0x4156df=function(_0x8d2471){while(--_0x8d2471){_0x120a97['push'](_0x120a97['shift']());}};_0x4156df(++_0x4f968e);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xae3d('0x0'));module[_0xae3d('0x1')]={'name':{'type':Sequelize[_0xae3d('0x2')]},'description':{'type':Sequelize[_0xae3d('0x2')]},'username':{'type':Sequelize[_0xae3d('0x2')],'unique':_0xae3d('0x3')},'password':{'type':Sequelize[_0xae3d('0x2')]},'token':{'type':Sequelize[_0xae3d('0x2')]},'remoteUri':{'type':Sequelize[_0xae3d('0x2')],'unique':_0xae3d('0x4')},'authType':{'type':Sequelize[_0xae3d('0x5')](_0xae3d('0x6'),_0xae3d('0x7')),'defaultValue':_0xae3d('0x6')},'serverUrl':{'type':Sequelize[_0xae3d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xae3d('0x5')]('integrationTab',_0xae3d('0x8')),'defaultValue':_0xae3d('0x9')}}; \ No newline at end of file +var _0x326f=['integrationTab','newTab','sequelize','STRING','username','remoteUri','ENUM','password','token'];(function(_0x242454,_0x1cf31c){var _0x9c5f5b=function(_0x2fbf0e){while(--_0x2fbf0e){_0x242454['push'](_0x242454['shift']());}};_0x9c5f5b(++_0x1cf31c);}(_0x326f,0xd1));var _0xf326=function(_0x3a289a,_0x2e9b9f){_0x3a289a=_0x3a289a-0x0;var _0x4c9c07=_0x326f[_0x3a289a];return _0x4c9c07;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf326('0x1')]},'username':{'type':Sequelize[_0xf326('0x1')],'unique':_0xf326('0x2')},'password':{'type':Sequelize[_0xf326('0x1')]},'token':{'type':Sequelize[_0xf326('0x1')]},'remoteUri':{'type':Sequelize[_0xf326('0x1')],'unique':_0xf326('0x3')},'authType':{'type':Sequelize[_0xf326('0x4')](_0xf326('0x5'),_0xf326('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xf326('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf326('0x4')](_0xf326('0x7'),_0xf326('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 879b106..d3ef1f8 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 _0xed3c=['ZendeskAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','then','includeAll','include','findAll','rows','show','params','create','body','catch','find','getConfigurations','ZendeskConfiguration','order','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','lastIndexOf','GET','format','ticket_fields','headers','Basic\x20%s','%s:%s','base64','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','position','title','system_field_options','custom_field_options','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','error','name','send','index','map'];(function(_0x23ea5e,_0xbfadcd){var _0x52eafe=function(_0x569de7){while(--_0x569de7){_0x23ea5e['push'](_0x23ea5e['shift']());}};_0x52eafe(++_0xbfadcd);}(_0xed3c,0x1a6));var _0xced3=function(_0x56085e,_0x5c69e9){_0x56085e=_0x56085e-0x0;var _0x4de130=_0xed3c[_0x56085e];return _0x4de130;};'use strict';var emlformat=require(_0xced3('0x0'));var rimraf=require(_0xced3('0x1'));var zipdir=require(_0xced3('0x2'));var jsonpatch=require(_0xced3('0x3'));var rp=require('request-promise');var moment=require(_0xced3('0x4'));var BPromise=require(_0xced3('0x5'));var Mustache=require(_0xced3('0x6'));var util=require('util');var path=require('path');var sox=require(_0xced3('0x7'));var csv=require(_0xced3('0x8'));var ejs=require(_0xced3('0x9'));var fs=require('fs');var fs_extra=require(_0xced3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xced3('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xced3('0xc'));var Redis=require(_0xced3('0xd'));var authService=require(_0xced3('0xe'));var qs=require(_0xced3('0xf'));var as=require(_0xced3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xced3('0x11'))(_0xced3('0x12'));var utils=require(_0xced3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xced3('0x14'));var db=require(_0xced3('0x15'))['db'];var integrations=require(_0xced3('0x16'));function respondWithStatusCode(_0x3b2ac4,_0x457caf){_0x457caf=_0x457caf||0xcc;return function(_0x45d9fc){if(_0x45d9fc){return _0x3b2ac4[_0xced3('0x17')](_0x457caf);}return _0x3b2ac4['status'](_0x457caf)[_0xced3('0x18')]();};}function respondWithResult(_0x5e186e,_0xf2db6f){_0xf2db6f=_0xf2db6f||0xc8;return function(_0x435616){if(_0x435616){return _0x5e186e[_0xced3('0x19')](_0xf2db6f)[_0xced3('0x1a')](_0x435616);}};}function respondWithFilteredResult(_0x4dd4c3,_0x146a21){return function(_0x322c2d){if(_0x322c2d){var _0x4acae6=typeof _0x146a21[_0xced3('0x1b')]===_0xced3('0x1c')&&typeof _0x146a21[_0xced3('0x1d')]===_0xced3('0x1c');var _0x55dbd5=_0x322c2d[_0xced3('0x1e')];var _0x4a3afe=_0x4acae6?0x0:_0x146a21[_0xced3('0x1b')];var _0x4480a6=_0x4acae6?_0x322c2d[_0xced3('0x1e')]:_0x146a21[_0xced3('0x1b')]+_0x146a21[_0xced3('0x1d')];var _0x688c97;if(_0x4480a6>=_0x55dbd5){_0x4480a6=_0x55dbd5;_0x688c97=0xc8;}else{_0x688c97=0xce;}_0x4dd4c3[_0xced3('0x19')](_0x688c97);return _0x4dd4c3[_0xced3('0x1f')](_0xced3('0x20'),_0x4a3afe+'-'+_0x4480a6+'/'+_0x55dbd5)[_0xced3('0x1a')](_0x322c2d);}return null;};}function patchUpdates(_0x2008f2){return function(_0x59dc83){try{jsonpatch['apply'](_0x59dc83,_0x2008f2,!![]);}catch(_0x5e8c44){return BPromise[_0xced3('0x21')](_0x5e8c44);}return _0x59dc83[_0xced3('0x22')]();};}function saveUpdates(_0x21e074,_0x4bf915){return function(_0x19d15c){if(_0x19d15c){return _0x19d15c[_0xced3('0x23')](_0x21e074)['then'](function(_0x559fa2){return _0x559fa2;});}return null;};}function removeEntity(_0x3adf14,_0x101708){return function(_0x219fa8){if(_0x219fa8){return _0x219fa8[_0xced3('0x24')]()['then'](function(){_0x3adf14[_0xced3('0x19')](0xcc)[_0xced3('0x18')]();});}};}function handleEntityNotFound(_0x4fc285,_0x3fb4f9){return function(_0x4da7ce){if(!_0x4da7ce){_0x4fc285[_0xced3('0x17')](0x194);}return _0x4da7ce;};}function handleError(_0x4123ba,_0x3b728d){_0x3b728d=_0x3b728d||0x1f4;return function(_0x23a570){logger[_0xced3('0x25')](_0x23a570['stack']);if(_0x23a570['name']){delete _0x23a570[_0xced3('0x26')];}_0x4123ba['status'](_0x3b728d)[_0xced3('0x27')](_0x23a570);};}exports[_0xced3('0x28')]=function(_0x4a8e85,_0x3db664){var _0x4024fa={},_0x196956={},_0x1032d6={'count':0x0,'rows':[]};var _0x4389f8=_[_0xced3('0x29')](db[_0xced3('0x2a')][_0xced3('0x2b')],function(_0x116cc7){return{'name':_0x116cc7['fieldName'],'type':_0x116cc7[_0xced3('0x2c')][_0xced3('0x2d')]};});_0x196956[_0xced3('0x2e')]=_[_0xced3('0x29')](_0x4389f8,_0xced3('0x26'));_0x196956[_0xced3('0x2f')]=_[_0xced3('0x30')](_0x4a8e85[_0xced3('0x2f')]);_0x196956[_0xced3('0x31')]=_[_0xced3('0x32')](_0x196956[_0xced3('0x2e')],_0x196956[_0xced3('0x2f')]);_0x4024fa[_0xced3('0x33')]=_[_0xced3('0x32')](_0x196956[_0xced3('0x2e')],qs[_0xced3('0x34')](_0x4a8e85[_0xced3('0x2f')][_0xced3('0x34')]));_0x4024fa[_0xced3('0x33')]=_0x4024fa[_0xced3('0x33')][_0xced3('0x35')]?_0x4024fa['attributes']:_0x196956[_0xced3('0x2e')];if(!_0x4a8e85['query'][_0xced3('0x36')](_0xced3('0x37'))){_0x4024fa[_0xced3('0x1d')]=qs[_0xced3('0x1d')](_0x4a8e85[_0xced3('0x2f')][_0xced3('0x1d')]);_0x4024fa[_0xced3('0x1b')]=qs[_0xced3('0x1b')](_0x4a8e85[_0xced3('0x2f')][_0xced3('0x1b')]);}_0x4024fa['order']=qs[_0xced3('0x38')](_0x4a8e85[_0xced3('0x2f')]['sort']);_0x4024fa[_0xced3('0x39')]=qs[_0xced3('0x31')](_[_0xced3('0x3a')](_0x4a8e85['query'],_0x196956['filters']),_0x4389f8);if(_0x4a8e85[_0xced3('0x2f')]['filter']){_0x4024fa[_0xced3('0x39')]=_[_0xced3('0x3b')](_0x4024fa['where'],{'$or':_[_0xced3('0x29')](_0x4389f8,function(_0x15ca03){if(_0x15ca03[_0xced3('0x2c')]!=='VIRTUAL'){var _0x21c0fa={};_0x21c0fa[_0x15ca03['name']]={'$like':'%'+_0x4a8e85['query'][_0xced3('0x3c')]+'%'};return _0x21c0fa;}})});}_0x4024fa=_[_0xced3('0x3b')]({},_0x4024fa,_0x4a8e85[_0xced3('0x3d')]);var _0x4e6926={'where':_0x4024fa[_0xced3('0x39')]};return db[_0xced3('0x2a')][_0xced3('0x1e')](_0x4e6926)[_0xced3('0x3e')](function(_0x28506e){_0x1032d6[_0xced3('0x1e')]=_0x28506e;if(_0x4a8e85[_0xced3('0x2f')][_0xced3('0x3f')]){_0x4024fa[_0xced3('0x40')]=[{'all':!![]}];}return db[_0xced3('0x2a')][_0xced3('0x41')](_0x4024fa);})[_0xced3('0x3e')](function(_0x16b2c7){_0x1032d6[_0xced3('0x42')]=_0x16b2c7;return _0x1032d6;})[_0xced3('0x3e')](respondWithFilteredResult(_0x3db664,_0x4024fa))['catch'](handleError(_0x3db664,null));};exports[_0xced3('0x43')]=function(_0x2ec0ad,_0x44ff72){var _0x1a6c1f={'raw':![],'where':{'id':_0x2ec0ad[_0xced3('0x44')]['id']}},_0x1de086={};_0x1de086[_0xced3('0x2e')]=_[_0xced3('0x30')](db[_0xced3('0x2a')]['rawAttributes']);_0x1de086[_0xced3('0x2f')]=_['keys'](_0x2ec0ad[_0xced3('0x2f')]);_0x1de086[_0xced3('0x31')]=_[_0xced3('0x32')](_0x1de086['model'],_0x1de086[_0xced3('0x2f')]);_0x1a6c1f[_0xced3('0x33')]=_[_0xced3('0x32')](_0x1de086[_0xced3('0x2e')],qs['fields'](_0x2ec0ad[_0xced3('0x2f')][_0xced3('0x34')]));_0x1a6c1f[_0xced3('0x33')]=_0x1a6c1f[_0xced3('0x33')][_0xced3('0x35')]?_0x1a6c1f['attributes']:_0x1de086[_0xced3('0x2e')];if(_0x2ec0ad[_0xced3('0x2f')][_0xced3('0x3f')]){_0x1a6c1f[_0xced3('0x40')]=[{'all':!![]}];}_0x1a6c1f=_[_0xced3('0x3b')]({},_0x1a6c1f,_0x2ec0ad[_0xced3('0x3d')]);return db[_0xced3('0x2a')]['find'](_0x1a6c1f)[_0xced3('0x3e')](handleEntityNotFound(_0x44ff72,null))[_0xced3('0x3e')](respondWithResult(_0x44ff72,null))['catch'](handleError(_0x44ff72,null));};exports['create']=function(_0x140df2,_0x59b586){return db[_0xced3('0x2a')][_0xced3('0x45')](_0x140df2[_0xced3('0x46')],{})[_0xced3('0x3e')](respondWithResult(_0x59b586,0xc9))[_0xced3('0x47')](handleError(_0x59b586,null));};exports[_0xced3('0x23')]=function(_0x3700ed,_0x10cc6c){if(_0x3700ed[_0xced3('0x46')]['id']){delete _0x3700ed['body']['id'];}return db[_0xced3('0x2a')][_0xced3('0x48')]({'where':{'id':_0x3700ed[_0xced3('0x44')]['id']}})[_0xced3('0x3e')](handleEntityNotFound(_0x10cc6c,null))[_0xced3('0x3e')](saveUpdates(_0x3700ed[_0xced3('0x46')],null))['then'](respondWithResult(_0x10cc6c,null))[_0xced3('0x47')](handleError(_0x10cc6c,null));};exports[_0xced3('0x24')]=function(_0x74f70,_0x409da0){return db[_0xced3('0x2a')][_0xced3('0x48')]({'where':{'id':_0x74f70[_0xced3('0x44')]['id']}})[_0xced3('0x3e')](handleEntityNotFound(_0x409da0,null))[_0xced3('0x3e')](removeEntity(_0x409da0,null))[_0xced3('0x47')](handleError(_0x409da0,null));};exports[_0xced3('0x49')]=function(_0x3e2a19,_0x4a9111,_0x1c69df){var _0x4bd3cb={};var _0x466ffb={};var _0x27ce0b;var _0xc93e05;return db['ZendeskAccount']['findOne']({'where':{'id':_0x3e2a19[_0xced3('0x44')]['id']}})[_0xced3('0x3e')](handleEntityNotFound(_0x4a9111,null))['then'](function(_0x3f41cc){if(_0x3f41cc){_0x27ce0b=_0x3f41cc;_0x466ffb['model']=_[_0xced3('0x30')](db[_0xced3('0x4a')]['rawAttributes']);_0x466ffb[_0xced3('0x2f')]=_[_0xced3('0x30')](_0x3e2a19[_0xced3('0x2f')]);_0x466ffb['filters']=_[_0xced3('0x32')](_0x466ffb['model'],_0x466ffb[_0xced3('0x2f')]);_0x4bd3cb[_0xced3('0x33')]=_[_0xced3('0x32')](_0x466ffb[_0xced3('0x2e')],qs[_0xced3('0x34')](_0x3e2a19[_0xced3('0x2f')][_0xced3('0x34')]));_0x4bd3cb[_0xced3('0x33')]=_0x4bd3cb[_0xced3('0x33')][_0xced3('0x35')]?_0x4bd3cb[_0xced3('0x33')]:_0x466ffb['model'];_0x4bd3cb[_0xced3('0x4b')]=qs[_0xced3('0x38')](_0x3e2a19[_0xced3('0x2f')][_0xced3('0x38')]);_0x4bd3cb[_0xced3('0x39')]=qs[_0xced3('0x31')](_['pick'](_0x3e2a19[_0xced3('0x2f')],_0x466ffb[_0xced3('0x31')]));if(_0x3e2a19[_0xced3('0x2f')][_0xced3('0x3c')]){_0x4bd3cb[_0xced3('0x39')]=_[_0xced3('0x3b')](_0x4bd3cb['where'],{'$or':_[_0xced3('0x29')](_0x4bd3cb['attributes'],function(_0xc0cd87){var _0x5d9813={};_0x5d9813[_0xc0cd87]={'$like':'%'+_0x3e2a19[_0xced3('0x2f')][_0xced3('0x3c')]+'%'};return _0x5d9813;})});}_0x4bd3cb=_['merge']({},_0x4bd3cb,_0x3e2a19[_0xced3('0x3d')]);return _0x27ce0b[_0xced3('0x49')](_0x4bd3cb);}})[_0xced3('0x3e')](function(_0x3bb7d5){if(_0x3bb7d5){_0xc93e05=_0x3bb7d5[_0xced3('0x35')];if(!_0x3e2a19[_0xced3('0x2f')][_0xced3('0x36')](_0xced3('0x37'))){_0x4bd3cb[_0xced3('0x1d')]=qs[_0xced3('0x1d')](_0x3e2a19[_0xced3('0x2f')][_0xced3('0x1d')]);_0x4bd3cb[_0xced3('0x1b')]=qs['offset'](_0x3e2a19[_0xced3('0x2f')][_0xced3('0x1b')]);}return _0x27ce0b[_0xced3('0x49')](_0x4bd3cb);}})[_0xced3('0x3e')](function(_0x4f8a3f){if(_0x4f8a3f){return _0x4f8a3f?{'count':_0xc93e05,'rows':_0x4f8a3f}:null;}})[_0xced3('0x3e')](respondWithResult(_0x4a9111,null))[_0xced3('0x47')](handleError(_0x4a9111,null));};exports[_0xced3('0x4c')]=function(_0x373f31,_0x2a62f5,_0x13643c){if(_0x373f31[_0xced3('0x46')]['id']){delete _0x373f31['body']['id'];}return db[_0xced3('0x2a')][_0xced3('0x4d')]({'where':{'id':_0x373f31['params']['id']}})[_0xced3('0x3e')](handleEntityNotFound(_0x2a62f5,null))[_0xced3('0x3e')](function(_0x3a9dac){if(_0x3a9dac){_0x373f31[_0xced3('0x46')]['AccountId']=_0x3a9dac['id'];_0x373f31[_0xced3('0x46')][_0xced3('0x4e')]=integrations[_0xced3('0x4f')](_0x373f31[_0xced3('0x46')][_0xced3('0x50')],_0x373f31[_0xced3('0x46')][_0xced3('0x2c')]);_0x373f31[_0xced3('0x46')][_0xced3('0x51')]=integrations[_0xced3('0x52')](_0x373f31['body'][_0xced3('0x50')],_0x373f31[_0xced3('0x46')]['type']);return db['ZendeskConfiguration'][_0xced3('0x45')](_0x373f31['body'],{'include':[{'model':db[_0xced3('0x53')],'as':_0xced3('0x4e')},{'model':db['ZendeskField'],'as':_0xced3('0x51')}]});}return null;})[_0xced3('0x3e')](respondWithResult(_0x2a62f5,null))['catch'](handleError(_0x2a62f5,null));};exports[_0xced3('0x54')]=function(_0x52ab35,_0x39eead,_0x58b66b){var _0xf8ccc6='';return db[_0xced3('0x2a')][_0xced3('0x4d')]({'where':{'id':_0x52ab35['params']['id']},'attributes':['id',_0xced3('0x55'),_0xced3('0x56'),_0xced3('0x57'),'authType',_0xced3('0x58')]})[_0xced3('0x3e')](handleEntityNotFound(_0x39eead,null))[_0xced3('0x3e')](function(_0x227ec5){if(_0x227ec5){_0xf8ccc6=_0x227ec5['remoteUri'];var _0x4a1624=_0xf8ccc6[_0xced3('0x59')](-0x1);if(_0x4a1624==='/'){_0xf8ccc6=_0xf8ccc6[_0xced3('0x5a')](0x0,_0xf8ccc6[_0xced3('0x5b')](_0x4a1624));}var _0xcddb37={'method':_0xced3('0x5c'),'uri':util[_0xced3('0x5d')]('%s/%s',_0xf8ccc6,_0xced3('0x5e')),'json':!![]};switch(_0x227ec5['authType']){case _0xced3('0x56'):_0xcddb37[_0xced3('0x5f')]={'Authorization':util[_0xced3('0x5d')](_0xced3('0x60'),new Buffer(util['format'](_0xced3('0x61'),_0x227ec5[_0xced3('0x55')],_0x227ec5['password']))['toString'](_0xced3('0x62')))};break;case _0xced3('0x57'):_0xcddb37[_0xced3('0x5f')]={'Authorization':util[_0xced3('0x5d')](_0xced3('0x60'),new Buffer(util['format'](_0xced3('0x63'),_0x227ec5[_0xced3('0x55')],_0x227ec5[_0xced3('0x57')]))[_0xced3('0x64')]('base64'))};break;default:throw new db[(_0xced3('0x65'))][(_0xced3('0x66'))](_0xced3('0x67'));}return rp(_0xcddb37);}})[_0xced3('0x3e')](function(_0x9183af){if(_0x9183af){var _0x275c7e=[_0xced3('0x68'),_0xced3('0x69'),_0xced3('0x6a'),_0xced3('0x6b')];_['remove'](_0x9183af[_0xced3('0x5e')],function(_0x1e7ff1){return _0x275c7e['includes'](_0x1e7ff1[_0xced3('0x2c')]);});return{'count':_0x9183af[_0xced3('0x5e')][_0xced3('0x35')],'rows':_[_0xced3('0x29')](_0x9183af[_0xced3('0x5e')],function(_0x5c2302){return{'id':_0x5c2302['id'],'name':_0x5c2302[_0xced3('0x6c')]>0x7?_0x5c2302[_0xced3('0x6d')]:_0x5c2302['type'],'custom':_0x5c2302[_0xced3('0x6c')]>0x7?!![]:![],'options':_0x5c2302[_0xced3('0x6e')]?_0x5c2302[_0xced3('0x6e')]:_0x5c2302[_0xced3('0x6f')]?_0x5c2302[_0xced3('0x6f')]:[]};})};}})[_0xced3('0x3e')](respondWithResult(_0x39eead,null))['catch'](function(_0x2d9a57){var _0x3d2547=_0x52ab35[_0xced3('0x2f')][_0xced3('0x70')]?0x1f4:_0x2d9a57[_0xced3('0x71')]||0x1f4;logger[_0xced3('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x3d2547,JSON[_0xced3('0x72')](_0x2d9a57));delete _0x2d9a57[_0xced3('0x26')];if(_0x3d2547===0x191){_0x3d2547=0x190;}_0x39eead[_0xced3('0x19')](_0x3d2547)[_0xced3('0x27')](_0x52ab35[_0xced3('0x2f')][_0xced3('0x70')]?{'message':_0xced3('0x73'),'statusCode':_0x2d9a57['statusCode']}:_0x2d9a57);});}; \ No newline at end of file +var _0x02ce=['sendStatus','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','options','include','findAll','rows','catch','show','params','length','merge','find','create','body','ZendeskConfiguration','getConfigurations','addConfiguration','findOne','channel','getDescriptions','Subjects','ZendeskField','Descriptions','username','password','authType','remoteUri','GET','format','%s/%s','ticket_fields','headers','toString','base64','%s/token:%s','token','Sequelize','ValidationError','subject','description','group','assignee','remove','title','position','system_field_options','custom_field_options','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','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','../../mysqldb','../../components/integrations/configuration','end','status','offset','limit','undefined','count','set','reject','update','then','destroy'];(function(_0x5e62a0,_0xc335b9){var _0x4a070f=function(_0x33d786){while(--_0x33d786){_0x5e62a0['push'](_0x5e62a0['shift']());}};_0x4a070f(++_0xc335b9);}(_0x02ce,0x1ac));var _0xe02c=function(_0x607839,_0x675676){_0x607839=_0x607839-0x0;var _0x187307=_0x02ce[_0x607839];return _0x187307;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];var integrations=require(_0xe02c('0x1c'));function respondWithStatusCode(_0x32fc45,_0x5d6d13){_0x5d6d13=_0x5d6d13||0xcc;return function(_0x43079c){if(_0x43079c){return _0x32fc45['sendStatus'](_0x5d6d13);}return _0x32fc45['status'](_0x5d6d13)[_0xe02c('0x1d')]();};}function respondWithResult(_0x56405a,_0x221910){_0x221910=_0x221910||0xc8;return function(_0x59614c){if(_0x59614c){return _0x56405a[_0xe02c('0x1e')](_0x221910)['json'](_0x59614c);}};}function respondWithFilteredResult(_0x256311,_0x366893){return function(_0x59f2f6){if(_0x59f2f6){var _0x10a2a6=typeof _0x366893[_0xe02c('0x1f')]==='undefined'&&typeof _0x366893[_0xe02c('0x20')]===_0xe02c('0x21');var _0x5a4583=_0x59f2f6['count'];var _0x3e37bf=_0x10a2a6?0x0:_0x366893['offset'];var _0x1f8f37=_0x10a2a6?_0x59f2f6[_0xe02c('0x22')]:_0x366893[_0xe02c('0x1f')]+_0x366893[_0xe02c('0x20')];var _0x3898dc;if(_0x1f8f37>=_0x5a4583){_0x1f8f37=_0x5a4583;_0x3898dc=0xc8;}else{_0x3898dc=0xce;}_0x256311['status'](_0x3898dc);return _0x256311[_0xe02c('0x23')]('Content-Range',_0x3e37bf+'-'+_0x1f8f37+'/'+_0x5a4583)['json'](_0x59f2f6);}return null;};}function patchUpdates(_0x393621){return function(_0x4514ac){try{jsonpatch['apply'](_0x4514ac,_0x393621,!![]);}catch(_0x3fe8f7){return BPromise[_0xe02c('0x24')](_0x3fe8f7);}return _0x4514ac['save']();};}function saveUpdates(_0x38dce2,_0x45fd82){return function(_0x39b00c){if(_0x39b00c){return _0x39b00c[_0xe02c('0x25')](_0x38dce2)[_0xe02c('0x26')](function(_0x557142){return _0x557142;});}return null;};}function removeEntity(_0x3e80e3,_0xf41d4c){return function(_0xeae877){if(_0xeae877){return _0xeae877[_0xe02c('0x27')]()[_0xe02c('0x26')](function(){_0x3e80e3['status'](0xcc)[_0xe02c('0x1d')]();});}};}function handleEntityNotFound(_0x4411d8,_0x3592ca){return function(_0x14ffba){if(!_0x14ffba){_0x4411d8[_0xe02c('0x28')](0x194);}return _0x14ffba;};}function handleError(_0x303d24,_0x43dc78){_0x43dc78=_0x43dc78||0x1f4;return function(_0x1c14d6){logger['error'](_0x1c14d6[_0xe02c('0x29')]);if(_0x1c14d6[_0xe02c('0x2a')]){delete _0x1c14d6[_0xe02c('0x2a')];}_0x303d24['status'](_0x43dc78)[_0xe02c('0x2b')](_0x1c14d6);};}exports[_0xe02c('0x2c')]=function(_0x445421,_0x287f7e){var _0x1e7eab={},_0x35a309={},_0x22a285={'count':0x0,'rows':[]};var _0x1b8f21=_[_0xe02c('0x2d')](db[_0xe02c('0x2e')][_0xe02c('0x2f')],function(_0x5a2da0){return{'name':_0x5a2da0[_0xe02c('0x30')],'type':_0x5a2da0[_0xe02c('0x31')][_0xe02c('0x32')]};});_0x35a309[_0xe02c('0x33')]=_[_0xe02c('0x2d')](_0x1b8f21,_0xe02c('0x2a'));_0x35a309['query']=_[_0xe02c('0x34')](_0x445421[_0xe02c('0x35')]);_0x35a309['filters']=_[_0xe02c('0x36')](_0x35a309[_0xe02c('0x33')],_0x35a309[_0xe02c('0x35')]);_0x1e7eab[_0xe02c('0x37')]=_[_0xe02c('0x36')](_0x35a309['model'],qs['fields'](_0x445421[_0xe02c('0x35')][_0xe02c('0x38')]));_0x1e7eab['attributes']=_0x1e7eab[_0xe02c('0x37')]['length']?_0x1e7eab[_0xe02c('0x37')]:_0x35a309[_0xe02c('0x33')];if(!_0x445421[_0xe02c('0x35')][_0xe02c('0x39')](_0xe02c('0x3a'))){_0x1e7eab['limit']=qs[_0xe02c('0x20')](_0x445421['query'][_0xe02c('0x20')]);_0x1e7eab[_0xe02c('0x1f')]=qs[_0xe02c('0x1f')](_0x445421[_0xe02c('0x35')][_0xe02c('0x1f')]);}_0x1e7eab[_0xe02c('0x3b')]=qs['sort'](_0x445421[_0xe02c('0x35')][_0xe02c('0x3c')]);_0x1e7eab['where']=qs[_0xe02c('0x3d')](_[_0xe02c('0x3e')](_0x445421['query'],_0x35a309[_0xe02c('0x3d')]),_0x1b8f21);if(_0x445421['query'][_0xe02c('0x3f')]){_0x1e7eab[_0xe02c('0x40')]=_['merge'](_0x1e7eab[_0xe02c('0x40')],{'$or':_[_0xe02c('0x2d')](_0x1b8f21,function(_0x2502c8){if(_0x2502c8[_0xe02c('0x31')]!==_0xe02c('0x41')){var _0x28922a={};_0x28922a[_0x2502c8['name']]={'$like':'%'+_0x445421[_0xe02c('0x35')]['filter']+'%'};return _0x28922a;}})});}_0x1e7eab=_['merge']({},_0x1e7eab,_0x445421[_0xe02c('0x42')]);var _0x1095fb={'where':_0x1e7eab[_0xe02c('0x40')]};return db[_0xe02c('0x2e')]['count'](_0x1095fb)[_0xe02c('0x26')](function(_0x17830e){_0x22a285[_0xe02c('0x22')]=_0x17830e;if(_0x445421['query']['includeAll']){_0x1e7eab[_0xe02c('0x43')]=[{'all':!![]}];}return db[_0xe02c('0x2e')][_0xe02c('0x44')](_0x1e7eab);})[_0xe02c('0x26')](function(_0x1b0876){_0x22a285[_0xe02c('0x45')]=_0x1b0876;return _0x22a285;})[_0xe02c('0x26')](respondWithFilteredResult(_0x287f7e,_0x1e7eab))[_0xe02c('0x46')](handleError(_0x287f7e,null));};exports[_0xe02c('0x47')]=function(_0x53d123,_0xc7e935){var _0x5ef4a1={'raw':![],'where':{'id':_0x53d123[_0xe02c('0x48')]['id']}},_0x4d4be5={};_0x4d4be5[_0xe02c('0x33')]=_[_0xe02c('0x34')](db[_0xe02c('0x2e')][_0xe02c('0x2f')]);_0x4d4be5[_0xe02c('0x35')]=_[_0xe02c('0x34')](_0x53d123[_0xe02c('0x35')]);_0x4d4be5['filters']=_['intersection'](_0x4d4be5[_0xe02c('0x33')],_0x4d4be5[_0xe02c('0x35')]);_0x5ef4a1[_0xe02c('0x37')]=_['intersection'](_0x4d4be5[_0xe02c('0x33')],qs[_0xe02c('0x38')](_0x53d123[_0xe02c('0x35')][_0xe02c('0x38')]));_0x5ef4a1[_0xe02c('0x37')]=_0x5ef4a1[_0xe02c('0x37')][_0xe02c('0x49')]?_0x5ef4a1[_0xe02c('0x37')]:_0x4d4be5[_0xe02c('0x33')];if(_0x53d123[_0xe02c('0x35')]['includeAll']){_0x5ef4a1[_0xe02c('0x43')]=[{'all':!![]}];}_0x5ef4a1=_[_0xe02c('0x4a')]({},_0x5ef4a1,_0x53d123[_0xe02c('0x42')]);return db[_0xe02c('0x2e')][_0xe02c('0x4b')](_0x5ef4a1)[_0xe02c('0x26')](handleEntityNotFound(_0xc7e935,null))[_0xe02c('0x26')](respondWithResult(_0xc7e935,null))[_0xe02c('0x46')](handleError(_0xc7e935,null));};exports[_0xe02c('0x4c')]=function(_0x1176c9,_0xfed475){return db[_0xe02c('0x2e')][_0xe02c('0x4c')](_0x1176c9['body'],{})[_0xe02c('0x26')](respondWithResult(_0xfed475,0xc9))['catch'](handleError(_0xfed475,null));};exports[_0xe02c('0x25')]=function(_0x324911,_0x45a6df){if(_0x324911[_0xe02c('0x4d')]['id']){delete _0x324911[_0xe02c('0x4d')]['id'];}return db[_0xe02c('0x2e')][_0xe02c('0x4b')]({'where':{'id':_0x324911[_0xe02c('0x48')]['id']}})[_0xe02c('0x26')](handleEntityNotFound(_0x45a6df,null))[_0xe02c('0x26')](saveUpdates(_0x324911['body'],null))[_0xe02c('0x26')](respondWithResult(_0x45a6df,null))[_0xe02c('0x46')](handleError(_0x45a6df,null));};exports[_0xe02c('0x27')]=function(_0x536cf7,_0xdab6cb){return db['ZendeskAccount'][_0xe02c('0x4b')]({'where':{'id':_0x536cf7['params']['id']}})['then'](handleEntityNotFound(_0xdab6cb,null))['then'](removeEntity(_0xdab6cb,null))['catch'](handleError(_0xdab6cb,null));};exports['getConfigurations']=function(_0x5740df,_0x107f3f,_0x3ac0a5){var _0x1510aa={};var _0x35fbe2={};var _0x5d963d;var _0x274beb;return db[_0xe02c('0x2e')]['findOne']({'where':{'id':_0x5740df[_0xe02c('0x48')]['id']}})[_0xe02c('0x26')](handleEntityNotFound(_0x107f3f,null))[_0xe02c('0x26')](function(_0x51f940){if(_0x51f940){_0x5d963d=_0x51f940;_0x35fbe2['model']=_[_0xe02c('0x34')](db[_0xe02c('0x4e')][_0xe02c('0x2f')]);_0x35fbe2['query']=_[_0xe02c('0x34')](_0x5740df['query']);_0x35fbe2['filters']=_[_0xe02c('0x36')](_0x35fbe2[_0xe02c('0x33')],_0x35fbe2['query']);_0x1510aa[_0xe02c('0x37')]=_[_0xe02c('0x36')](_0x35fbe2[_0xe02c('0x33')],qs['fields'](_0x5740df[_0xe02c('0x35')][_0xe02c('0x38')]));_0x1510aa['attributes']=_0x1510aa[_0xe02c('0x37')][_0xe02c('0x49')]?_0x1510aa[_0xe02c('0x37')]:_0x35fbe2[_0xe02c('0x33')];_0x1510aa[_0xe02c('0x3b')]=qs[_0xe02c('0x3c')](_0x5740df[_0xe02c('0x35')][_0xe02c('0x3c')]);_0x1510aa[_0xe02c('0x40')]=qs['filters'](_['pick'](_0x5740df['query'],_0x35fbe2[_0xe02c('0x3d')]));if(_0x5740df[_0xe02c('0x35')][_0xe02c('0x3f')]){_0x1510aa['where']=_['merge'](_0x1510aa[_0xe02c('0x40')],{'$or':_[_0xe02c('0x2d')](_0x1510aa[_0xe02c('0x37')],function(_0xb50cfa){var _0xe02798={};_0xe02798[_0xb50cfa]={'$like':'%'+_0x5740df['query'][_0xe02c('0x3f')]+'%'};return _0xe02798;})});}_0x1510aa=_[_0xe02c('0x4a')]({},_0x1510aa,_0x5740df['options']);return _0x5d963d['getConfigurations'](_0x1510aa);}})[_0xe02c('0x26')](function(_0x566204){if(_0x566204){_0x274beb=_0x566204['length'];if(!_0x5740df['query'][_0xe02c('0x39')](_0xe02c('0x3a'))){_0x1510aa[_0xe02c('0x20')]=qs[_0xe02c('0x20')](_0x5740df[_0xe02c('0x35')][_0xe02c('0x20')]);_0x1510aa['offset']=qs[_0xe02c('0x1f')](_0x5740df['query']['offset']);}return _0x5d963d[_0xe02c('0x4f')](_0x1510aa);}})[_0xe02c('0x26')](function(_0x44ba68){if(_0x44ba68){return _0x44ba68?{'count':_0x274beb,'rows':_0x44ba68}:null;}})[_0xe02c('0x26')](respondWithResult(_0x107f3f,null))['catch'](handleError(_0x107f3f,null));};exports[_0xe02c('0x50')]=function(_0x31c287,_0x5d2119,_0xa7133f){if(_0x31c287[_0xe02c('0x4d')]['id']){delete _0x31c287['body']['id'];}return db[_0xe02c('0x2e')][_0xe02c('0x51')]({'where':{'id':_0x31c287[_0xe02c('0x48')]['id']}})[_0xe02c('0x26')](handleEntityNotFound(_0x5d2119,null))[_0xe02c('0x26')](function(_0x3a62a2){if(_0x3a62a2){_0x31c287[_0xe02c('0x4d')]['AccountId']=_0x3a62a2['id'];_0x31c287[_0xe02c('0x4d')]['Subjects']=integrations['getSubjects'](_0x31c287['body'][_0xe02c('0x52')],_0x31c287[_0xe02c('0x4d')][_0xe02c('0x31')]);_0x31c287[_0xe02c('0x4d')]['Descriptions']=integrations[_0xe02c('0x53')](_0x31c287[_0xe02c('0x4d')]['channel'],_0x31c287['body']['type']);return db[_0xe02c('0x4e')][_0xe02c('0x4c')](_0x31c287['body'],{'include':[{'model':db['ZendeskField'],'as':_0xe02c('0x54')},{'model':db[_0xe02c('0x55')],'as':_0xe02c('0x56')}]});}return null;})[_0xe02c('0x26')](respondWithResult(_0x5d2119,null))[_0xe02c('0x46')](handleError(_0x5d2119,null));};exports['getFields']=function(_0x39c7db,_0x12ac9f,_0x3f277b){var _0x2776c0='';return db[_0xe02c('0x2e')][_0xe02c('0x51')]({'where':{'id':_0x39c7db['params']['id']},'attributes':['id',_0xe02c('0x57'),_0xe02c('0x58'),'token',_0xe02c('0x59'),_0xe02c('0x5a')]})[_0xe02c('0x26')](handleEntityNotFound(_0x12ac9f,null))[_0xe02c('0x26')](function(_0x5d2455){if(_0x5d2455){_0x2776c0=_0x5d2455[_0xe02c('0x5a')];var _0x2229ae=_0x2776c0['slice'](-0x1);if(_0x2229ae==='/'){_0x2776c0=_0x2776c0['substring'](0x0,_0x2776c0['lastIndexOf'](_0x2229ae));}var _0x43977c={'method':_0xe02c('0x5b'),'uri':util[_0xe02c('0x5c')](_0xe02c('0x5d'),_0x2776c0,_0xe02c('0x5e')),'json':!![]};switch(_0x5d2455['authType']){case _0xe02c('0x58'):_0x43977c[_0xe02c('0x5f')]={'Authorization':util[_0xe02c('0x5c')]('Basic\x20%s',new Buffer(util['format']('%s:%s',_0x5d2455[_0xe02c('0x57')],_0x5d2455[_0xe02c('0x58')]))[_0xe02c('0x60')](_0xe02c('0x61')))};break;case'token':_0x43977c[_0xe02c('0x5f')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xe02c('0x5c')](_0xe02c('0x62'),_0x5d2455[_0xe02c('0x57')],_0x5d2455[_0xe02c('0x63')]))[_0xe02c('0x60')](_0xe02c('0x61')))};break;default:throw new db[(_0xe02c('0x64'))][(_0xe02c('0x65'))]('Unknown\x20authentication\x20type');}return rp(_0x43977c);}})[_0xe02c('0x26')](function(_0x21049f){if(_0x21049f){var _0x2386cf=[_0xe02c('0x66'),_0xe02c('0x67'),_0xe02c('0x68'),_0xe02c('0x69')];_[_0xe02c('0x6a')](_0x21049f[_0xe02c('0x5e')],function(_0x411cd5){return _0x2386cf['includes'](_0x411cd5['type']);});return{'count':_0x21049f[_0xe02c('0x5e')][_0xe02c('0x49')],'rows':_[_0xe02c('0x2d')](_0x21049f[_0xe02c('0x5e')],function(_0x108566){return{'id':_0x108566['id'],'name':_0x108566['position']>0x7?_0x108566[_0xe02c('0x6b')]:_0x108566[_0xe02c('0x31')],'custom':_0x108566[_0xe02c('0x6c')]>0x7?!![]:![],'options':_0x108566[_0xe02c('0x6d')]?_0x108566[_0xe02c('0x6d')]:_0x108566[_0xe02c('0x6e')]?_0x108566[_0xe02c('0x6e')]:[]};})};}})[_0xe02c('0x26')](respondWithResult(_0x12ac9f,null))[_0xe02c('0x46')](function(_0x159f58){var _0x287eca=_0x39c7db[_0xe02c('0x35')]['test']?0x1f4:_0x159f58['statusCode']||0x1f4;logger[_0xe02c('0x6f')](_0xe02c('0x70'),'getFields',_0x287eca,JSON[_0xe02c('0x71')](_0x159f58));delete _0x159f58['name'];if(_0x287eca===0x191){_0x287eca=0x190;}_0x12ac9f[_0xe02c('0x1e')](_0x287eca)['send'](_0x39c7db[_0xe02c('0x35')][_0xe02c('0x72')]?{'message':_0xe02c('0x73'),'statusCode':_0x159f58[_0xe02c('0x74')]}:_0x159f58);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index b245cfd..dda72f7 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 _0xb657=['api','moment','../../config/environment','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts','util','../../config/logger'];(function(_0x66484f,_0x58f10d){var _0x455026=function(_0x5515ec){while(--_0x5515ec){_0x66484f['push'](_0x66484f['shift']());}};_0x455026(++_0x58f10d);}(_0xb657,0xcd));var _0x7b65=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xb657[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require('lodash');var util=require(_0x7b65('0x0'));var logger=require(_0x7b65('0x1'))(_0x7b65('0x2'));var moment=require(_0x7b65('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7b65('0x4'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x7b65('0x5'));module[_0x7b65('0x6')]=function(_0x4b3c4f,_0x11d5c4){return _0x4b3c4f['define'](_0x7b65('0x7'),attributes,{'tableName':_0x7b65('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb83e=['path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x22ffbf,_0x16f31e){var _0x360c17=function(_0x40807f){while(--_0x40807f){_0x22ffbf['push'](_0x22ffbf['shift']());}};_0x360c17(++_0x16f31e);}(_0xb83e,0x1c2));var _0xeb83=function(_0x8c4b43,_0xd43984){_0x8c4b43=_0x8c4b43-0x0;var _0x56cf12=_0xb83e[_0x8c4b43];return _0x56cf12;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeb83('0x0'))(_0xeb83('0x1'));var moment=require(_0xeb83('0x2'));var BPromise=require(_0xeb83('0x3'));var rp=require(_0xeb83('0x4'));var fs=require('fs');var path=require(_0xeb83('0x5'));var rimraf=require(_0xeb83('0x6'));var config=require('../../config/environment');var attributes=require(_0xeb83('0x7'));var integrations=require(_0xeb83('0x8'));module[_0xeb83('0x9')]=function(_0x4864cb,_0x1281ef){return _0x4864cb[_0xeb83('0xa')](_0xeb83('0xb'),attributes,{'tableName':_0xeb83('0xc'),'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 946736d..03b0e65 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 _0xb416=['attributes','limit','map','include','then','GetZendeskAccount','debug','catch','find','model','ShowZendeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ZendeskAccount','findAll','options','raw','where'];(function(_0xef8ba3,_0x7b1cd8){var _0x20f9de=function(_0x2c717e){while(--_0x2c717e){_0xef8ba3['push'](_0xef8ba3['shift']());}};_0x20f9de(++_0x7b1cd8);}(_0xb416,0x173));var _0x6b41=function(_0x3ac022,_0xd33d2b){_0x3ac022=_0x3ac022-0x0;var _0x5a6b3e=_0xb416[_0x3ac022];return _0x5a6b3e;};'use strict';var _=require(_0x6b41('0x0'));var util=require(_0x6b41('0x1'));var moment=require('moment');var BPromise=require(_0x6b41('0x2'));var rs=require(_0x6b41('0x3'));var fs=require('fs');var Redis=require(_0x6b41('0x4'));var db=require(_0x6b41('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b41('0x6'))(_0x6b41('0x7'));var config=require(_0x6b41('0x8'));var jayson=require(_0x6b41('0x9'));var client=jayson[_0x6b41('0xa')][_0x6b41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5da035,_0x4195b0,_0x35cfb5){return new BPromise(function(_0x561df5,_0x537a42){return client[_0x6b41('0xc')](_0x5da035,_0x35cfb5)['then'](function(_0xb8eb92){logger[_0x6b41('0xd')](_0x6b41('0xe'),_0x4195b0,_0x6b41('0xf'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x4195b0,'request\x20sent',JSON[_0x6b41('0x10')](_0xb8eb92));if(_0xb8eb92[_0x6b41('0x11')]){if(_0xb8eb92[_0x6b41('0x11')][_0x6b41('0x12')]===0x1f4){logger[_0x6b41('0x11')](_0x6b41('0xe'),_0x4195b0,_0xb8eb92[_0x6b41('0x11')][_0x6b41('0x13')]);return _0x537a42(_0xb8eb92[_0x6b41('0x11')]['message']);}logger[_0x6b41('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x4195b0,_0xb8eb92[_0x6b41('0x11')][_0x6b41('0x13')]);return _0x561df5(_0xb8eb92['error'][_0x6b41('0x13')]);}else{logger[_0x6b41('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x4195b0,'request\x20sent');_0x561df5(_0xb8eb92['result'][_0x6b41('0x13')]);}})['catch'](function(_0x5a3412){logger['error'](_0x6b41('0xe'),_0x4195b0,_0x5a3412);_0x537a42(_0x5a3412);});});}exports['GetZendeskAccount']=function(_0x3e5e57){var _0x54be60=this;return new Promise(function(_0x510604,_0xab6248){return db[_0x6b41('0x14')][_0x6b41('0x15')]({'raw':_0x3e5e57[_0x6b41('0x16')]?_0x3e5e57[_0x6b41('0x16')][_0x6b41('0x17')]===undefined?!![]:![]:!![],'where':_0x3e5e57['options']?_0x3e5e57[_0x6b41('0x16')][_0x6b41('0x18')]||null:null,'attributes':_0x3e5e57[_0x6b41('0x16')]?_0x3e5e57[_0x6b41('0x16')][_0x6b41('0x19')]||null:null,'limit':_0x3e5e57[_0x6b41('0x16')]?_0x3e5e57[_0x6b41('0x16')][_0x6b41('0x1a')]||null:null,'include':_0x3e5e57[_0x6b41('0x16')]?_0x3e5e57[_0x6b41('0x16')]['include']?_[_0x6b41('0x1b')](_0x3e5e57[_0x6b41('0x16')][_0x6b41('0x1c')],function(_0x3a4ad7){return{'model':db[_0x3a4ad7['model']],'as':_0x3a4ad7['as'],'attributes':_0x3a4ad7[_0x6b41('0x19')],'include':_0x3a4ad7[_0x6b41('0x1c')]?_[_0x6b41('0x1b')](_0x3a4ad7['include'],function(_0x87086e){return{'model':db[_0x87086e['model']],'as':_0x87086e['as'],'attributes':_0x87086e['attributes'],'include':_0x87086e[_0x6b41('0x1c')]?_['map'](_0x87086e[_0x6b41('0x1c')],function(_0x19ff99){return{'model':db[_0x19ff99['model']],'as':_0x19ff99['as'],'attributes':_0x19ff99['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b41('0x1d')](function(_0x1f0d51){logger[_0x6b41('0xd')](_0x6b41('0x1e'),_0x3e5e57);logger[_0x6b41('0x1f')](_0x6b41('0x1e'),_0x3e5e57,JSON['stringify'](_0x1f0d51));_0x510604(_0x1f0d51);})[_0x6b41('0x20')](function(_0x1eef51){logger[_0x6b41('0x11')](_0x6b41('0x1e'),_0x1eef51[_0x6b41('0x13')],_0x3e5e57);_0xab6248(_0x54be60[_0x6b41('0x11')](0x1f4,_0x1eef51[_0x6b41('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x1aad0b){var _0x530e05=this;return new Promise(function(_0x216b8a,_0xf4814){return db[_0x6b41('0x14')][_0x6b41('0x21')]({'raw':_0x1aad0b['options']?_0x1aad0b[_0x6b41('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1aad0b[_0x6b41('0x16')]?_0x1aad0b[_0x6b41('0x16')][_0x6b41('0x18')]||null:null,'attributes':_0x1aad0b[_0x6b41('0x16')]?_0x1aad0b[_0x6b41('0x16')][_0x6b41('0x19')]||null:null,'include':_0x1aad0b['options']?_0x1aad0b[_0x6b41('0x16')][_0x6b41('0x1c')]?_[_0x6b41('0x1b')](_0x1aad0b[_0x6b41('0x16')][_0x6b41('0x1c')],function(_0x250033){return{'model':db[_0x250033[_0x6b41('0x22')]],'as':_0x250033['as'],'attributes':_0x250033[_0x6b41('0x19')],'include':_0x250033[_0x6b41('0x1c')]?_[_0x6b41('0x1b')](_0x250033[_0x6b41('0x1c')],function(_0x483233){return{'model':db[_0x483233[_0x6b41('0x22')]],'as':_0x483233['as'],'attributes':_0x483233['attributes'],'include':_0x483233[_0x6b41('0x1c')]?_[_0x6b41('0x1b')](_0x483233[_0x6b41('0x1c')],function(_0x3190a4){return{'model':db[_0x3190a4[_0x6b41('0x22')]],'as':_0x3190a4['as'],'attributes':_0x3190a4[_0x6b41('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6b41('0x1d')](function(_0xe838c5){logger[_0x6b41('0xd')]('ShowZendeskAccount',_0x1aad0b);logger['debug']('ShowZendeskAccount',_0x1aad0b,JSON['stringify'](_0xe838c5));_0x216b8a(_0xe838c5);})[_0x6b41('0x20')](function(_0x3027fc){logger[_0x6b41('0x11')](_0x6b41('0x23'),_0x3027fc[_0x6b41('0x13')],_0x1aad0b);_0xf4814(_0x530e05[_0x6b41('0x11')](0x1f4,_0x3027fc[_0x6b41('0x13')]));});});}; \ No newline at end of file +var _0x696f=['request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','ZendeskAccount','findAll','options','raw','where','attributes','map','include','model','GetZendeskAccount','debug','stringify','catch','ShowZendeskAccount','find','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s'];(function(_0x50eeb4,_0x3a5cb3){var _0x3e1369=function(_0x4a38ea){while(--_0x4a38ea){_0x50eeb4['push'](_0x50eeb4['shift']());}};_0x3e1369(++_0x3a5cb3);}(_0x696f,0x1b9));var _0xf696=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x696f[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf696('0x0'));var rs=require(_0xf696('0x1'));var fs=require('fs');var Redis=require(_0xf696('0x2'));var db=require(_0xf696('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf696('0x4'))(_0xf696('0x5'));var config=require(_0xf696('0x6'));var jayson=require(_0xf696('0x7'));var client=jayson[_0xf696('0x8')][_0xf696('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d63d9,_0x44ae1e,_0x7c5d18){return new BPromise(function(_0xbbec31,_0x55c280){return client[_0xf696('0xa')](_0x3d63d9,_0x7c5d18)[_0xf696('0xb')](function(_0x571f36){logger[_0xf696('0xc')](_0xf696('0xd'),_0x44ae1e,_0xf696('0xe'));logger['debug'](_0xf696('0xf'),_0x44ae1e,_0xf696('0xe'),JSON['stringify'](_0x571f36));if(_0x571f36[_0xf696('0x10')]){if(_0x571f36['error'][_0xf696('0x11')]===0x1f4){logger[_0xf696('0x10')](_0xf696('0xd'),_0x44ae1e,_0x571f36['error'][_0xf696('0x12')]);return _0x55c280(_0x571f36[_0xf696('0x10')][_0xf696('0x12')]);}logger[_0xf696('0x10')](_0xf696('0xd'),_0x44ae1e,_0x571f36[_0xf696('0x10')]['message']);return _0xbbec31(_0x571f36[_0xf696('0x10')][_0xf696('0x12')]);}else{logger[_0xf696('0xc')](_0xf696('0xd'),_0x44ae1e,_0xf696('0xe'));_0xbbec31(_0x571f36[_0xf696('0x13')]['message']);}})['catch'](function(_0x2f28fb){logger[_0xf696('0x10')](_0xf696('0xd'),_0x44ae1e,_0x2f28fb);_0x55c280(_0x2f28fb);});});}exports['GetZendeskAccount']=function(_0x2692c6){var _0x4ea140=this;return new Promise(function(_0x45c879,_0x2a8daf){return db[_0xf696('0x14')][_0xf696('0x15')]({'raw':_0x2692c6[_0xf696('0x16')]?_0x2692c6[_0xf696('0x16')][_0xf696('0x17')]===undefined?!![]:![]:!![],'where':_0x2692c6[_0xf696('0x16')]?_0x2692c6['options'][_0xf696('0x18')]||null:null,'attributes':_0x2692c6['options']?_0x2692c6['options'][_0xf696('0x19')]||null:null,'limit':_0x2692c6[_0xf696('0x16')]?_0x2692c6[_0xf696('0x16')]['limit']||null:null,'include':_0x2692c6[_0xf696('0x16')]?_0x2692c6[_0xf696('0x16')]['include']?_[_0xf696('0x1a')](_0x2692c6[_0xf696('0x16')][_0xf696('0x1b')],function(_0x51df48){return{'model':db[_0x51df48['model']],'as':_0x51df48['as'],'attributes':_0x51df48['attributes'],'include':_0x51df48['include']?_[_0xf696('0x1a')](_0x51df48[_0xf696('0x1b')],function(_0x2776e2){return{'model':db[_0x2776e2[_0xf696('0x1c')]],'as':_0x2776e2['as'],'attributes':_0x2776e2[_0xf696('0x19')],'include':_0x2776e2['include']?_[_0xf696('0x1a')](_0x2776e2[_0xf696('0x1b')],function(_0x3cbeac){return{'model':db[_0x3cbeac[_0xf696('0x1c')]],'as':_0x3cbeac['as'],'attributes':_0x3cbeac[_0xf696('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d7fd9){logger[_0xf696('0xc')](_0xf696('0x1d'),_0x2692c6);logger[_0xf696('0x1e')]('GetZendeskAccount',_0x2692c6,JSON[_0xf696('0x1f')](_0x4d7fd9));_0x45c879(_0x4d7fd9);})[_0xf696('0x20')](function(_0x2cb2b0){logger[_0xf696('0x10')](_0xf696('0x1d'),_0x2cb2b0[_0xf696('0x12')],_0x2692c6);_0x2a8daf(_0x4ea140[_0xf696('0x10')](0x1f4,_0x2cb2b0[_0xf696('0x12')]));});});};exports[_0xf696('0x21')]=function(_0xf9f747){var _0x4e35ae=this;return new Promise(function(_0x399344,_0x19bd39){return db[_0xf696('0x14')][_0xf696('0x22')]({'raw':_0xf9f747[_0xf696('0x16')]?_0xf9f747[_0xf696('0x16')][_0xf696('0x17')]===undefined?!![]:![]:!![],'where':_0xf9f747[_0xf696('0x16')]?_0xf9f747[_0xf696('0x16')][_0xf696('0x18')]||null:null,'attributes':_0xf9f747[_0xf696('0x16')]?_0xf9f747[_0xf696('0x16')][_0xf696('0x19')]||null:null,'include':_0xf9f747['options']?_0xf9f747[_0xf696('0x16')][_0xf696('0x1b')]?_[_0xf696('0x1a')](_0xf9f747[_0xf696('0x16')]['include'],function(_0xd87aca){return{'model':db[_0xd87aca[_0xf696('0x1c')]],'as':_0xd87aca['as'],'attributes':_0xd87aca[_0xf696('0x19')],'include':_0xd87aca['include']?_['map'](_0xd87aca['include'],function(_0x150e70){return{'model':db[_0x150e70['model']],'as':_0x150e70['as'],'attributes':_0x150e70[_0xf696('0x19')],'include':_0x150e70[_0xf696('0x1b')]?_['map'](_0x150e70[_0xf696('0x1b')],function(_0xd69a5d){return{'model':db[_0xd69a5d[_0xf696('0x1c')]],'as':_0xd69a5d['as'],'attributes':_0xd69a5d[_0xf696('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf696('0xb')](function(_0x4181ec){logger[_0xf696('0xc')](_0xf696('0x21'),_0xf9f747);logger[_0xf696('0x1e')](_0xf696('0x21'),_0xf9f747,JSON[_0xf696('0x1f')](_0x4181ec));_0x399344(_0x4181ec);})[_0xf696('0x20')](function(_0x58a279){logger[_0xf696('0x10')](_0xf696('0x21'),_0x58a279[_0xf696('0x12')],_0xf9f747);_0x19bd39(_0x4e35ae[_0xf696('0x10')](0x1f4,_0x58a279[_0xf696('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 44c4d47..2e3b51d 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 _0x7916=['getDescriptions','get','/:id/tags','getTags','post','create','setTags','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x4f0e29,_0x1f3709){var _0x310707=function(_0x5bb3da){while(--_0x5bb3da){_0x4f0e29['push'](_0x4f0e29['shift']());}};_0x310707(++_0x1f3709);}(_0x7916,0x128));var _0x6791=function(_0x3e542d,_0x16f3aa){_0x3e542d=_0x3e542d-0x0;var _0x2efb15=_0x7916[_0x3e542d];return _0x2efb15;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var fs_extra=require(_0x6791('0x4'));var auth=require(_0x6791('0x5'));var interaction=require(_0x6791('0x6'));var config=require('../../config/environment');var controller=require(_0x6791('0x7'));router['get']('/',auth[_0x6791('0x8')](),controller[_0x6791('0x9')]);router['get'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0xb')]);router['get']('/:id/fields',auth[_0x6791('0x8')](),controller[_0x6791('0xc')]);router['get'](_0x6791('0xd'),auth[_0x6791('0x8')](),controller[_0x6791('0xe')]);router['get'](_0x6791('0xf'),auth[_0x6791('0x8')](),controller[_0x6791('0x10')]);router[_0x6791('0x11')](_0x6791('0x12'),auth[_0x6791('0x8')](),controller[_0x6791('0x13')]);router[_0x6791('0x14')]('/',auth[_0x6791('0x8')](),controller[_0x6791('0x15')]);router[_0x6791('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x6791('0x16')]);router['put'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0x17')]);router[_0x6791('0x18')]('/:id',auth[_0x6791('0x8')](),controller['destroy']);module[_0x6791('0x19')]=router; \ No newline at end of file +var _0x36ee=['Router','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','getDescriptions','/:id/tags','post','create','update','delete','destroy','exports','path','express'];(function(_0x1fdb40,_0x51351c){var _0x281f93=function(_0x35eebe){while(--_0x35eebe){_0x1fdb40['push'](_0x1fdb40['shift']());}};_0x281f93(++_0x51351c);}(_0x36ee,0xe8));var _0xe36e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x36ee[_0x397e5f];return _0x5302b8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['get'](_0xe36e('0xd'),auth[_0xe36e('0x9')](),controller[_0xe36e('0xe')]);router['get'](_0xe36e('0xf'),auth['isAuthenticated'](),controller[_0xe36e('0x10')]);router[_0xe36e('0x8')](_0xe36e('0x11'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x12')]);router[_0xe36e('0x8')](_0xe36e('0x13'),auth[_0xe36e('0x9')](),controller['getTags']);router[_0xe36e('0x14')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0x15')]);router[_0xe36e('0x14')]('/:id/tags',auth[_0xe36e('0x9')](),controller['setTags']);router['put'](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x16')]);router[_0xe36e('0x17')](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x18')]);module[_0xe36e('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 7f3b32c..a52a6aa 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 _0x48c2=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48c2,0x1f0));var _0x248c=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x48c2[_0xa8883];return _0x479426;};'use strict';var Sequelize=require(_0x248c('0x0'));module[_0x248c('0x1')]={'name':{'type':Sequelize[_0x248c('0x2')]},'description':{'type':Sequelize[_0x248c('0x2')]}}; \ No newline at end of file +var _0x2191=['sequelize','exports','STRING'];(function(_0x3df223,_0x1740fc){var _0x562d11=function(_0x343009){while(--_0x343009){_0x3df223['push'](_0x3df223['shift']());}};_0x562d11(++_0x1740fc);}(_0x2191,0xbd));var _0x1219=function(_0x5b4e6b,_0x150cbd){_0x5b4e6b=_0x5b4e6b-0x0;var _0x3cd6ae=_0x2191[_0x5b4e6b];return _0x3cd6ae;};'use strict';var Sequelize=require(_0x1219('0x0'));module[_0x1219('0x1')]={'name':{'type':Sequelize[_0x1219('0x2')]},'description':{'type':Sequelize[_0x1219('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 8d4cff9..2218433 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 _0xcf47=['then','end','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','ZendeskConfiguration','count','includeAll','include','findAll','rows','keys','find','create','body','catch','params','getFields','findOne','getSubjects','ZendeskField','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save'];(function(_0x4f2a9e,_0x9a6894){var _0x32518e=function(_0x448085){while(--_0x448085){_0x4f2a9e['push'](_0x4f2a9e['shift']());}};_0x32518e(++_0x9a6894);}(_0xcf47,0x12f));var _0x7cf4=function(_0x3ba4b4,_0x27d0f2){_0x3ba4b4=_0x3ba4b4-0x0;var _0x12cad1=_0xcf47[_0x3ba4b4];return _0x12cad1;};'use strict';var emlformat=require(_0x7cf4('0x0'));var rimraf=require(_0x7cf4('0x1'));var zipdir=require(_0x7cf4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7cf4('0x3'));var moment=require('moment');var BPromise=require(_0x7cf4('0x4'));var Mustache=require(_0x7cf4('0x5'));var util=require(_0x7cf4('0x6'));var path=require(_0x7cf4('0x7'));var sox=require('sox');var csv=require(_0x7cf4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7cf4('0x9'));var _=require(_0x7cf4('0xa'));var squel=require(_0x7cf4('0xb'));var crypto=require(_0x7cf4('0xc'));var jsforce=require(_0x7cf4('0xd'));var deskjs=require(_0x7cf4('0xe'));var toCsv=require(_0x7cf4('0x8'));var querystring=require(_0x7cf4('0xf'));var Papa=require(_0x7cf4('0x10'));var Redis=require(_0x7cf4('0x11'));var authService=require(_0x7cf4('0x12'));var qs=require(_0x7cf4('0x13'));var as=require(_0x7cf4('0x14'));var hardwareService=require(_0x7cf4('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7cf4('0x16'));var config=require(_0x7cf4('0x17'));var licenseUtil=require(_0x7cf4('0x18'));var db=require(_0x7cf4('0x19'))['db'];function respondWithStatusCode(_0x3f101b,_0x26a427){_0x26a427=_0x26a427||0xcc;return function(_0x4b8525){if(_0x4b8525){return _0x3f101b[_0x7cf4('0x1a')](_0x26a427);}return _0x3f101b['status'](_0x26a427)['end']();};}function respondWithResult(_0x2c86c5,_0x5da244){_0x5da244=_0x5da244||0xc8;return function(_0x9ea756){if(_0x9ea756){return _0x2c86c5[_0x7cf4('0x1b')](_0x5da244)[_0x7cf4('0x1c')](_0x9ea756);}};}function respondWithFilteredResult(_0x38462c,_0x4c2463){return function(_0x5c190f){if(_0x5c190f){var _0x50e886=typeof _0x4c2463[_0x7cf4('0x1d')]===_0x7cf4('0x1e')&&typeof _0x4c2463[_0x7cf4('0x1f')]==='undefined';var _0x27b30f=_0x5c190f['count'];var _0x4e5450=_0x50e886?0x0:_0x4c2463['offset'];var _0xa4b748=_0x50e886?_0x5c190f['count']:_0x4c2463[_0x7cf4('0x1d')]+_0x4c2463['limit'];var _0x2d4217;if(_0xa4b748>=_0x27b30f){_0xa4b748=_0x27b30f;_0x2d4217=0xc8;}else{_0x2d4217=0xce;}_0x38462c[_0x7cf4('0x1b')](_0x2d4217);return _0x38462c[_0x7cf4('0x20')](_0x7cf4('0x21'),_0x4e5450+'-'+_0xa4b748+'/'+_0x27b30f)['json'](_0x5c190f);}return null;};}function patchUpdates(_0x4df1ce){return function(_0x47bdb0){try{jsonpatch[_0x7cf4('0x22')](_0x47bdb0,_0x4df1ce,!![]);}catch(_0x4577c2){return BPromise[_0x7cf4('0x23')](_0x4577c2);}return _0x47bdb0[_0x7cf4('0x24')]();};}function saveUpdates(_0x3c3dc6,_0x371087){return function(_0x2bb78d){if(_0x2bb78d){return _0x2bb78d['update'](_0x3c3dc6)[_0x7cf4('0x25')](function(_0x337491){return _0x337491;});}return null;};}function removeEntity(_0x7bbcbc,_0x4bff57){return function(_0x79cc07){if(_0x79cc07){return _0x79cc07['destroy']()[_0x7cf4('0x25')](function(){_0x7bbcbc[_0x7cf4('0x1b')](0xcc)[_0x7cf4('0x26')]();});}};}function handleEntityNotFound(_0x512a43,_0x3f1778){return function(_0x1c7a97){if(!_0x1c7a97){_0x512a43[_0x7cf4('0x1a')](0x194);}return _0x1c7a97;};}function handleError(_0x5a0eee,_0x40d548){_0x40d548=_0x40d548||0x1f4;return function(_0x452143){logger[_0x7cf4('0x27')](_0x452143[_0x7cf4('0x28')]);if(_0x452143[_0x7cf4('0x29')]){delete _0x452143['name'];}_0x5a0eee[_0x7cf4('0x1b')](_0x40d548)[_0x7cf4('0x2a')](_0x452143);};}exports[_0x7cf4('0x2b')]=function(_0x1ffdfa,_0x432cbe){var _0x122a28={},_0x3a82de={},_0xee1bc5={'count':0x0,'rows':[]};var _0x5b6529=_['map'](db['ZendeskConfiguration'][_0x7cf4('0x2c')],function(_0x10c709){return{'name':_0x10c709[_0x7cf4('0x2d')],'type':_0x10c709[_0x7cf4('0x2e')]['key']};});_0x3a82de[_0x7cf4('0x2f')]=_[_0x7cf4('0x30')](_0x5b6529,_0x7cf4('0x29'));_0x3a82de[_0x7cf4('0x31')]=_['keys'](_0x1ffdfa[_0x7cf4('0x31')]);_0x3a82de['filters']=_[_0x7cf4('0x32')](_0x3a82de[_0x7cf4('0x2f')],_0x3a82de[_0x7cf4('0x31')]);_0x122a28['attributes']=_[_0x7cf4('0x32')](_0x3a82de['model'],qs[_0x7cf4('0x33')](_0x1ffdfa['query'][_0x7cf4('0x33')]));_0x122a28[_0x7cf4('0x34')]=_0x122a28['attributes'][_0x7cf4('0x35')]?_0x122a28['attributes']:_0x3a82de[_0x7cf4('0x2f')];if(!_0x1ffdfa[_0x7cf4('0x31')][_0x7cf4('0x36')](_0x7cf4('0x37'))){_0x122a28['limit']=qs['limit'](_0x1ffdfa['query'][_0x7cf4('0x1f')]);_0x122a28['offset']=qs[_0x7cf4('0x1d')](_0x1ffdfa[_0x7cf4('0x31')][_0x7cf4('0x1d')]);}_0x122a28[_0x7cf4('0x38')]=qs[_0x7cf4('0x39')](_0x1ffdfa[_0x7cf4('0x31')][_0x7cf4('0x39')]);_0x122a28[_0x7cf4('0x3a')]=qs['filters'](_[_0x7cf4('0x3b')](_0x1ffdfa[_0x7cf4('0x31')],_0x3a82de[_0x7cf4('0x3c')]),_0x5b6529);if(_0x1ffdfa['query'][_0x7cf4('0x3d')]){_0x122a28['where']=_['merge'](_0x122a28[_0x7cf4('0x3a')],{'$or':_[_0x7cf4('0x30')](_0x5b6529,function(_0x233dc5){if(_0x233dc5[_0x7cf4('0x2e')]!==_0x7cf4('0x3e')){var _0x2bdf2f={};_0x2bdf2f[_0x233dc5[_0x7cf4('0x29')]]={'$like':'%'+_0x1ffdfa['query'][_0x7cf4('0x3d')]+'%'};return _0x2bdf2f;}})});}_0x122a28=_[_0x7cf4('0x3f')]({},_0x122a28,_0x1ffdfa[_0x7cf4('0x40')]);var _0x4644eb={'where':_0x122a28[_0x7cf4('0x3a')]};return db[_0x7cf4('0x41')][_0x7cf4('0x42')](_0x4644eb)['then'](function(_0x129004){_0xee1bc5[_0x7cf4('0x42')]=_0x129004;if(_0x1ffdfa['query'][_0x7cf4('0x43')]){_0x122a28[_0x7cf4('0x44')]=[{'all':!![]}];}return db[_0x7cf4('0x41')][_0x7cf4('0x45')](_0x122a28);})['then'](function(_0xe7eeaa){_0xee1bc5[_0x7cf4('0x46')]=_0xe7eeaa;return _0xee1bc5;})['then'](respondWithFilteredResult(_0x432cbe,_0x122a28))['catch'](handleError(_0x432cbe,null));};exports['show']=function(_0x1c2ba4,_0x2cd0d3){var _0x305dea={'raw':![],'where':{'id':_0x1c2ba4['params']['id']}},_0x115bed={};_0x115bed['model']=_[_0x7cf4('0x47')](db[_0x7cf4('0x41')][_0x7cf4('0x2c')]);_0x115bed[_0x7cf4('0x31')]=_[_0x7cf4('0x47')](_0x1c2ba4['query']);_0x115bed[_0x7cf4('0x3c')]=_['intersection'](_0x115bed[_0x7cf4('0x2f')],_0x115bed['query']);_0x305dea['attributes']=_[_0x7cf4('0x32')](_0x115bed[_0x7cf4('0x2f')],qs[_0x7cf4('0x33')](_0x1c2ba4[_0x7cf4('0x31')][_0x7cf4('0x33')]));_0x305dea[_0x7cf4('0x34')]=_0x305dea[_0x7cf4('0x34')][_0x7cf4('0x35')]?_0x305dea['attributes']:_0x115bed[_0x7cf4('0x2f')];if(_0x1c2ba4[_0x7cf4('0x31')]['includeAll']){_0x305dea['include']=[{'all':!![]}];}_0x305dea=_['merge']({},_0x305dea,_0x1c2ba4['options']);return db[_0x7cf4('0x41')][_0x7cf4('0x48')](_0x305dea)[_0x7cf4('0x25')](handleEntityNotFound(_0x2cd0d3,null))[_0x7cf4('0x25')](respondWithResult(_0x2cd0d3,null))['catch'](handleError(_0x2cd0d3,null));};exports[_0x7cf4('0x49')]=function(_0x41e5f1,_0x3d82b4){return db['ZendeskConfiguration'][_0x7cf4('0x49')](_0x41e5f1[_0x7cf4('0x4a')],{})[_0x7cf4('0x25')](respondWithResult(_0x3d82b4,0xc9))[_0x7cf4('0x4b')](handleError(_0x3d82b4,null));};exports['update']=function(_0x3e9598,_0x3fc9db){if(_0x3e9598['body']['id']){delete _0x3e9598['body']['id'];}return db[_0x7cf4('0x41')][_0x7cf4('0x48')]({'where':{'id':_0x3e9598['params']['id']}})[_0x7cf4('0x25')](handleEntityNotFound(_0x3fc9db,null))['then'](saveUpdates(_0x3e9598['body'],null))[_0x7cf4('0x25')](respondWithResult(_0x3fc9db,null))[_0x7cf4('0x4b')](handleError(_0x3fc9db,null));};exports['destroy']=function(_0x35236c,_0x596229){return db[_0x7cf4('0x41')][_0x7cf4('0x48')]({'where':{'id':_0x35236c[_0x7cf4('0x4c')]['id']}})[_0x7cf4('0x25')](handleEntityNotFound(_0x596229,null))['then'](removeEntity(_0x596229,null))[_0x7cf4('0x4b')](handleError(_0x596229,null));};exports[_0x7cf4('0x4d')]=function(_0x38246a,_0x2d1b8d,_0x461805){var _0x486e9c={};var _0x5ba489={};var _0x1cf16e;var _0x4e68f1;return db[_0x7cf4('0x41')][_0x7cf4('0x4e')]({'where':{'id':_0x38246a[_0x7cf4('0x4c')]['id']}})[_0x7cf4('0x25')](handleEntityNotFound(_0x2d1b8d,null))['then'](function(_0x4169c6){if(_0x4169c6){_0x1cf16e=_0x4169c6;_0x5ba489[_0x7cf4('0x2f')]=_[_0x7cf4('0x47')](db['ZendeskField']['rawAttributes']);_0x5ba489[_0x7cf4('0x31')]=_[_0x7cf4('0x47')](_0x38246a[_0x7cf4('0x31')]);_0x5ba489[_0x7cf4('0x3c')]=_['intersection'](_0x5ba489[_0x7cf4('0x2f')],_0x5ba489[_0x7cf4('0x31')]);_0x486e9c[_0x7cf4('0x34')]=_[_0x7cf4('0x32')](_0x5ba489['model'],qs[_0x7cf4('0x33')](_0x38246a[_0x7cf4('0x31')][_0x7cf4('0x33')]));_0x486e9c[_0x7cf4('0x34')]=_0x486e9c['attributes'][_0x7cf4('0x35')]?_0x486e9c[_0x7cf4('0x34')]:_0x5ba489['model'];_0x486e9c['order']=qs[_0x7cf4('0x39')](_0x38246a[_0x7cf4('0x31')]['sort']);_0x486e9c[_0x7cf4('0x3a')]=qs['filters'](_['pick'](_0x38246a['query'],_0x5ba489[_0x7cf4('0x3c')]));if(_0x38246a[_0x7cf4('0x31')]['filter']){_0x486e9c[_0x7cf4('0x3a')]=_[_0x7cf4('0x3f')](_0x486e9c[_0x7cf4('0x3a')],{'$or':_[_0x7cf4('0x30')](_0x486e9c[_0x7cf4('0x34')],function(_0x2dd527){var _0x102422={};_0x102422[_0x2dd527]={'$like':'%'+_0x38246a[_0x7cf4('0x31')][_0x7cf4('0x3d')]+'%'};return _0x102422;})});}_0x486e9c=_[_0x7cf4('0x3f')]({},_0x486e9c,_0x38246a['options']);return _0x1cf16e[_0x7cf4('0x4d')](_0x486e9c);}})[_0x7cf4('0x25')](function(_0x180f02){if(_0x180f02){_0x4e68f1=_0x180f02['length'];if(!_0x38246a[_0x7cf4('0x31')][_0x7cf4('0x36')](_0x7cf4('0x37'))){_0x486e9c[_0x7cf4('0x1f')]=qs['limit'](_0x38246a[_0x7cf4('0x31')][_0x7cf4('0x1f')]);_0x486e9c[_0x7cf4('0x1d')]=qs['offset'](_0x38246a[_0x7cf4('0x31')][_0x7cf4('0x1d')]);}return _0x1cf16e[_0x7cf4('0x4d')](_0x486e9c);}})[_0x7cf4('0x25')](function(_0x402b13){if(_0x402b13){return _0x402b13?{'count':_0x4e68f1,'rows':_0x402b13}:null;}})[_0x7cf4('0x25')](respondWithResult(_0x2d1b8d,null))[_0x7cf4('0x4b')](handleError(_0x2d1b8d,null));};exports[_0x7cf4('0x4f')]=function(_0x1b5ac1,_0x5a6b62,_0x19fc39){var _0x159c4b={};var _0x265645={};var _0x4daf4e;var _0x3aa2fe;return db[_0x7cf4('0x41')][_0x7cf4('0x4e')]({'where':{'id':_0x1b5ac1[_0x7cf4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5a6b62,null))[_0x7cf4('0x25')](function(_0x4c3dd7){if(_0x4c3dd7){_0x4daf4e=_0x4c3dd7;_0x265645[_0x7cf4('0x2f')]=_[_0x7cf4('0x47')](db[_0x7cf4('0x50')][_0x7cf4('0x2c')]);_0x265645[_0x7cf4('0x31')]=_[_0x7cf4('0x47')](_0x1b5ac1[_0x7cf4('0x31')]);_0x265645['filters']=_[_0x7cf4('0x32')](_0x265645[_0x7cf4('0x2f')],_0x265645[_0x7cf4('0x31')]);_0x159c4b[_0x7cf4('0x34')]=_[_0x7cf4('0x32')](_0x265645[_0x7cf4('0x2f')],qs['fields'](_0x1b5ac1[_0x7cf4('0x31')][_0x7cf4('0x33')]));_0x159c4b[_0x7cf4('0x34')]=_0x159c4b[_0x7cf4('0x34')][_0x7cf4('0x35')]?_0x159c4b[_0x7cf4('0x34')]:_0x265645[_0x7cf4('0x2f')];_0x159c4b[_0x7cf4('0x38')]=qs[_0x7cf4('0x39')](_0x1b5ac1[_0x7cf4('0x31')][_0x7cf4('0x39')]);_0x159c4b[_0x7cf4('0x3a')]=qs['filters'](_[_0x7cf4('0x3b')](_0x1b5ac1[_0x7cf4('0x31')],_0x265645[_0x7cf4('0x3c')]));if(_0x1b5ac1[_0x7cf4('0x31')]['filter']){_0x159c4b[_0x7cf4('0x3a')]=_[_0x7cf4('0x3f')](_0x159c4b[_0x7cf4('0x3a')],{'$or':_[_0x7cf4('0x30')](_0x159c4b['attributes'],function(_0x56d894){var _0xeca6b={};_0xeca6b[_0x56d894]={'$like':'%'+_0x1b5ac1[_0x7cf4('0x31')][_0x7cf4('0x3d')]+'%'};return _0xeca6b;})});}_0x159c4b=_[_0x7cf4('0x3f')]({},_0x159c4b,_0x1b5ac1[_0x7cf4('0x40')]);return _0x4daf4e[_0x7cf4('0x4f')](_0x159c4b);}})[_0x7cf4('0x25')](function(_0x148167){if(_0x148167){_0x3aa2fe=_0x148167[_0x7cf4('0x35')];if(!_0x1b5ac1[_0x7cf4('0x31')][_0x7cf4('0x36')]('nolimit')){_0x159c4b['limit']=qs[_0x7cf4('0x1f')](_0x1b5ac1['query'][_0x7cf4('0x1f')]);_0x159c4b[_0x7cf4('0x1d')]=qs[_0x7cf4('0x1d')](_0x1b5ac1['query'][_0x7cf4('0x1d')]);}return _0x4daf4e[_0x7cf4('0x4f')](_0x159c4b);}})['then'](function(_0x49e224){if(_0x49e224){return _0x49e224?{'count':_0x3aa2fe,'rows':_0x49e224}:null;}})[_0x7cf4('0x25')](respondWithResult(_0x5a6b62,null))[_0x7cf4('0x4b')](handleError(_0x5a6b62,null));};exports['getDescriptions']=function(_0x2ba09d,_0x4ad35b,_0x296b66){var _0x57cc06={};var _0x405e6b={};var _0x3eb734;var _0x1a20cb;return db[_0x7cf4('0x41')][_0x7cf4('0x4e')]({'where':{'id':_0x2ba09d[_0x7cf4('0x4c')]['id']}})[_0x7cf4('0x25')](handleEntityNotFound(_0x4ad35b,null))['then'](function(_0x29e324){if(_0x29e324){_0x3eb734=_0x29e324;_0x405e6b['model']=_[_0x7cf4('0x47')](db[_0x7cf4('0x50')]['rawAttributes']);_0x405e6b['query']=_[_0x7cf4('0x47')](_0x2ba09d[_0x7cf4('0x31')]);_0x405e6b[_0x7cf4('0x3c')]=_[_0x7cf4('0x32')](_0x405e6b[_0x7cf4('0x2f')],_0x405e6b[_0x7cf4('0x31')]);_0x57cc06['attributes']=_['intersection'](_0x405e6b['model'],qs[_0x7cf4('0x33')](_0x2ba09d[_0x7cf4('0x31')][_0x7cf4('0x33')]));_0x57cc06[_0x7cf4('0x34')]=_0x57cc06[_0x7cf4('0x34')]['length']?_0x57cc06['attributes']:_0x405e6b[_0x7cf4('0x2f')];_0x57cc06[_0x7cf4('0x38')]=qs['sort'](_0x2ba09d['query']['sort']);_0x57cc06[_0x7cf4('0x3a')]=qs['filters'](_[_0x7cf4('0x3b')](_0x2ba09d['query'],_0x405e6b[_0x7cf4('0x3c')]));if(_0x2ba09d[_0x7cf4('0x31')][_0x7cf4('0x3d')]){_0x57cc06[_0x7cf4('0x3a')]=_[_0x7cf4('0x3f')](_0x57cc06[_0x7cf4('0x3a')],{'$or':_['map'](_0x57cc06[_0x7cf4('0x34')],function(_0x139376){var _0x54ece2={};_0x54ece2[_0x139376]={'$like':'%'+_0x2ba09d['query'][_0x7cf4('0x3d')]+'%'};return _0x54ece2;})});}_0x57cc06=_[_0x7cf4('0x3f')]({},_0x57cc06,_0x2ba09d[_0x7cf4('0x40')]);return _0x3eb734[_0x7cf4('0x51')](_0x57cc06);}})[_0x7cf4('0x25')](function(_0x2cb42e){if(_0x2cb42e){_0x1a20cb=_0x2cb42e['length'];if(!_0x2ba09d['query'][_0x7cf4('0x36')]('nolimit')){_0x57cc06[_0x7cf4('0x1f')]=qs[_0x7cf4('0x1f')](_0x2ba09d[_0x7cf4('0x31')][_0x7cf4('0x1f')]);_0x57cc06[_0x7cf4('0x1d')]=qs['offset'](_0x2ba09d[_0x7cf4('0x31')][_0x7cf4('0x1d')]);}return _0x3eb734[_0x7cf4('0x51')](_0x57cc06);}})['then'](function(_0x51696b){if(_0x51696b){return _0x51696b?{'count':_0x1a20cb,'rows':_0x51696b}:null;}})[_0x7cf4('0x25')](respondWithResult(_0x4ad35b,null))[_0x7cf4('0x4b')](handleError(_0x4ad35b,null));};exports['getTags']=function(_0x5240eb,_0x3af901,_0x3d8439){var _0x5b0b29={};var _0x36562b={};var _0x11de78;var _0x4d825d;return db[_0x7cf4('0x41')][_0x7cf4('0x4e')]({'where':{'id':_0x5240eb[_0x7cf4('0x4c')]['id']}})[_0x7cf4('0x25')](handleEntityNotFound(_0x3af901,null))[_0x7cf4('0x25')](function(_0x2b1914){if(_0x2b1914){_0x11de78=_0x2b1914;_0x36562b[_0x7cf4('0x2f')]=_[_0x7cf4('0x47')](db['Tag'][_0x7cf4('0x2c')]);_0x36562b[_0x7cf4('0x31')]=_[_0x7cf4('0x47')](_0x5240eb[_0x7cf4('0x31')]);_0x36562b[_0x7cf4('0x3c')]=_[_0x7cf4('0x32')](_0x36562b[_0x7cf4('0x2f')],_0x36562b[_0x7cf4('0x31')]);_0x5b0b29[_0x7cf4('0x34')]=_['intersection'](_0x36562b['model'],qs[_0x7cf4('0x33')](_0x5240eb[_0x7cf4('0x31')][_0x7cf4('0x33')]));_0x5b0b29[_0x7cf4('0x34')]=_0x5b0b29['attributes']['length']?_0x5b0b29[_0x7cf4('0x34')]:_0x36562b[_0x7cf4('0x2f')];_0x5b0b29[_0x7cf4('0x38')]=qs[_0x7cf4('0x39')](_0x5240eb[_0x7cf4('0x31')]['sort']);_0x5b0b29['where']=qs[_0x7cf4('0x3c')](_[_0x7cf4('0x3b')](_0x5240eb[_0x7cf4('0x31')],_0x36562b['filters']));if(_0x5240eb[_0x7cf4('0x31')][_0x7cf4('0x3d')]){_0x5b0b29[_0x7cf4('0x3a')]=_[_0x7cf4('0x3f')](_0x5b0b29[_0x7cf4('0x3a')],{'$or':_[_0x7cf4('0x30')](_0x5b0b29[_0x7cf4('0x34')],function(_0x584bd9){var _0x5cc98f={};_0x5cc98f[_0x584bd9]={'$like':'%'+_0x5240eb[_0x7cf4('0x31')][_0x7cf4('0x3d')]+'%'};return _0x5cc98f;})});}_0x5b0b29=_['merge']({},_0x5b0b29,_0x5240eb[_0x7cf4('0x40')]);return _0x11de78[_0x7cf4('0x52')](_0x5b0b29);}})[_0x7cf4('0x25')](function(_0x425ffb){if(_0x425ffb){_0x4d825d=_0x425ffb['length'];if(!_0x5240eb[_0x7cf4('0x31')][_0x7cf4('0x36')]('nolimit')){_0x5b0b29[_0x7cf4('0x1f')]=qs['limit'](_0x5240eb['query']['limit']);_0x5b0b29[_0x7cf4('0x1d')]=qs['offset'](_0x5240eb[_0x7cf4('0x31')][_0x7cf4('0x1d')]);}return _0x11de78[_0x7cf4('0x52')](_0x5b0b29);}})[_0x7cf4('0x25')](function(_0x401692){if(_0x401692){return _0x401692?{'count':_0x4d825d,'rows':_0x401692}:null;}})[_0x7cf4('0x25')](respondWithResult(_0x3af901,null))[_0x7cf4('0x4b')](handleError(_0x3af901,null));};exports[_0x7cf4('0x53')]=function(_0x4ec357,_0x16808c,_0x3b824f){if(_0x4ec357[_0x7cf4('0x4a')]['id']){delete _0x4ec357['body']['id'];}return db[_0x7cf4('0x41')][_0x7cf4('0x4e')]({'where':{'id':_0x4ec357[_0x7cf4('0x4c')]['id']}})[_0x7cf4('0x25')](handleEntityNotFound(_0x16808c,null))[_0x7cf4('0x25')](function(_0x9bbf04){if(_0x9bbf04){return _0x9bbf04[_0x7cf4('0x53')](_0x4ec357[_0x7cf4('0x4a')][_0x7cf4('0x54')]||[]);}return null;})['then'](respondWithResult(_0x16808c,null))[_0x7cf4('0x4b')](handleError(_0x16808c,null));}; \ No newline at end of file +var _0xa9dd=['getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','options','ZendeskConfiguration','findAll','catch','show','params','includeAll','include','merge','find','create','body','getFields','findOne','ZendeskField'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xa9dd,0xb1));var _0xda9d=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0xa9dd[_0x1e4f2d];return _0xd05ce5;};'use strict';var emlformat=require(_0xda9d('0x0'));var rimraf=require(_0xda9d('0x1'));var zipdir=require(_0xda9d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda9d('0x3'));var moment=require(_0xda9d('0x4'));var BPromise=require(_0xda9d('0x5'));var Mustache=require(_0xda9d('0x6'));var util=require('util');var path=require(_0xda9d('0x7'));var sox=require(_0xda9d('0x8'));var csv=require(_0xda9d('0x9'));var ejs=require(_0xda9d('0xa'));var fs=require('fs');var fs_extra=require(_0xda9d('0xb'));var _=require(_0xda9d('0xc'));var squel=require('squel');var crypto=require(_0xda9d('0xd'));var jsforce=require(_0xda9d('0xe'));var deskjs=require(_0xda9d('0xf'));var toCsv=require(_0xda9d('0x9'));var querystring=require(_0xda9d('0x10'));var Papa=require(_0xda9d('0x11'));var Redis=require(_0xda9d('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xda9d('0x13'));var hardwareService=require(_0xda9d('0x14'));var logger=require('../../config/logger')(_0xda9d('0x15'));var utils=require(_0xda9d('0x16'));var config=require(_0xda9d('0x17'));var licenseUtil=require(_0xda9d('0x18'));var db=require(_0xda9d('0x19'))['db'];function respondWithStatusCode(_0x23f5d9,_0x5b84c8){_0x5b84c8=_0x5b84c8||0xcc;return function(_0x3ecc66){if(_0x3ecc66){return _0x23f5d9[_0xda9d('0x1a')](_0x5b84c8);}return _0x23f5d9[_0xda9d('0x1b')](_0x5b84c8)[_0xda9d('0x1c')]();};}function respondWithResult(_0x1a394b,_0x3c8445){_0x3c8445=_0x3c8445||0xc8;return function(_0x17bd55){if(_0x17bd55){return _0x1a394b[_0xda9d('0x1b')](_0x3c8445)[_0xda9d('0x1d')](_0x17bd55);}};}function respondWithFilteredResult(_0x4744ba,_0xd236a6){return function(_0x2e736c){if(_0x2e736c){var _0x37c25f=typeof _0xd236a6[_0xda9d('0x1e')]===_0xda9d('0x1f')&&typeof _0xd236a6[_0xda9d('0x20')]===_0xda9d('0x1f');var _0x11f51e=_0x2e736c[_0xda9d('0x21')];var _0x1718db=_0x37c25f?0x0:_0xd236a6[_0xda9d('0x1e')];var _0x41b700=_0x37c25f?_0x2e736c[_0xda9d('0x21')]:_0xd236a6['offset']+_0xd236a6['limit'];var _0x5c7e17;if(_0x41b700>=_0x11f51e){_0x41b700=_0x11f51e;_0x5c7e17=0xc8;}else{_0x5c7e17=0xce;}_0x4744ba[_0xda9d('0x1b')](_0x5c7e17);return _0x4744ba[_0xda9d('0x22')]('Content-Range',_0x1718db+'-'+_0x41b700+'/'+_0x11f51e)[_0xda9d('0x1d')](_0x2e736c);}return null;};}function patchUpdates(_0x3b9526){return function(_0x2b4297){try{jsonpatch[_0xda9d('0x23')](_0x2b4297,_0x3b9526,!![]);}catch(_0x135e07){return BPromise[_0xda9d('0x24')](_0x135e07);}return _0x2b4297[_0xda9d('0x25')]();};}function saveUpdates(_0xe145fe,_0xa8c618){return function(_0x41a636){if(_0x41a636){return _0x41a636[_0xda9d('0x26')](_0xe145fe)[_0xda9d('0x27')](function(_0x15110d){return _0x15110d;});}return null;};}function removeEntity(_0x7813c0,_0x1c7b83){return function(_0xa4c91e){if(_0xa4c91e){return _0xa4c91e[_0xda9d('0x28')]()[_0xda9d('0x27')](function(){_0x7813c0[_0xda9d('0x1b')](0xcc)[_0xda9d('0x1c')]();});}};}function handleEntityNotFound(_0x38e0f1,_0x10c766){return function(_0x17bd9e){if(!_0x17bd9e){_0x38e0f1['sendStatus'](0x194);}return _0x17bd9e;};}function handleError(_0x50b168,_0x5e8eea){_0x5e8eea=_0x5e8eea||0x1f4;return function(_0x2b3854){logger[_0xda9d('0x29')](_0x2b3854['stack']);if(_0x2b3854['name']){delete _0x2b3854[_0xda9d('0x2a')];}_0x50b168['status'](_0x5e8eea)[_0xda9d('0x2b')](_0x2b3854);};}exports[_0xda9d('0x2c')]=function(_0x3f0dcd,_0x578662){var _0x1d3128={},_0x22c8fc={},_0x81a282={'count':0x0,'rows':[]};var _0x14dff2=_['map'](db['ZendeskConfiguration'][_0xda9d('0x2d')],function(_0x564238){return{'name':_0x564238[_0xda9d('0x2e')],'type':_0x564238[_0xda9d('0x2f')][_0xda9d('0x30')]};});_0x22c8fc[_0xda9d('0x31')]=_[_0xda9d('0x32')](_0x14dff2,_0xda9d('0x2a'));_0x22c8fc['query']=_[_0xda9d('0x33')](_0x3f0dcd[_0xda9d('0x34')]);_0x22c8fc[_0xda9d('0x35')]=_[_0xda9d('0x36')](_0x22c8fc[_0xda9d('0x31')],_0x22c8fc[_0xda9d('0x34')]);_0x1d3128[_0xda9d('0x37')]=_[_0xda9d('0x36')](_0x22c8fc['model'],qs[_0xda9d('0x38')](_0x3f0dcd['query'][_0xda9d('0x38')]));_0x1d3128[_0xda9d('0x37')]=_0x1d3128[_0xda9d('0x37')][_0xda9d('0x39')]?_0x1d3128['attributes']:_0x22c8fc[_0xda9d('0x31')];if(!_0x3f0dcd[_0xda9d('0x34')][_0xda9d('0x3a')](_0xda9d('0x3b'))){_0x1d3128['limit']=qs['limit'](_0x3f0dcd[_0xda9d('0x34')][_0xda9d('0x20')]);_0x1d3128['offset']=qs[_0xda9d('0x1e')](_0x3f0dcd[_0xda9d('0x34')][_0xda9d('0x1e')]);}_0x1d3128[_0xda9d('0x3c')]=qs[_0xda9d('0x3d')](_0x3f0dcd['query'][_0xda9d('0x3d')]);_0x1d3128['where']=qs[_0xda9d('0x35')](_[_0xda9d('0x3e')](_0x3f0dcd[_0xda9d('0x34')],_0x22c8fc[_0xda9d('0x35')]),_0x14dff2);if(_0x3f0dcd[_0xda9d('0x34')]['filter']){_0x1d3128[_0xda9d('0x3f')]=_['merge'](_0x1d3128[_0xda9d('0x3f')],{'$or':_[_0xda9d('0x32')](_0x14dff2,function(_0x3de87c){if(_0x3de87c[_0xda9d('0x2f')]!==_0xda9d('0x40')){var _0x5bdd58={};_0x5bdd58[_0x3de87c[_0xda9d('0x2a')]]={'$like':'%'+_0x3f0dcd[_0xda9d('0x34')][_0xda9d('0x41')]+'%'};return _0x5bdd58;}})});}_0x1d3128=_['merge']({},_0x1d3128,_0x3f0dcd[_0xda9d('0x42')]);var _0x541b13={'where':_0x1d3128['where']};return db[_0xda9d('0x43')][_0xda9d('0x21')](_0x541b13)[_0xda9d('0x27')](function(_0x459663){_0x81a282[_0xda9d('0x21')]=_0x459663;if(_0x3f0dcd[_0xda9d('0x34')]['includeAll']){_0x1d3128['include']=[{'all':!![]}];}return db[_0xda9d('0x43')][_0xda9d('0x44')](_0x1d3128);})[_0xda9d('0x27')](function(_0x104332){_0x81a282['rows']=_0x104332;return _0x81a282;})['then'](respondWithFilteredResult(_0x578662,_0x1d3128))[_0xda9d('0x45')](handleError(_0x578662,null));};exports[_0xda9d('0x46')]=function(_0x2d4244,_0x19195b){var _0x2caae9={'raw':![],'where':{'id':_0x2d4244[_0xda9d('0x47')]['id']}},_0x2b8caf={};_0x2b8caf[_0xda9d('0x31')]=_[_0xda9d('0x33')](db[_0xda9d('0x43')][_0xda9d('0x2d')]);_0x2b8caf[_0xda9d('0x34')]=_[_0xda9d('0x33')](_0x2d4244[_0xda9d('0x34')]);_0x2b8caf[_0xda9d('0x35')]=_[_0xda9d('0x36')](_0x2b8caf[_0xda9d('0x31')],_0x2b8caf['query']);_0x2caae9[_0xda9d('0x37')]=_[_0xda9d('0x36')](_0x2b8caf[_0xda9d('0x31')],qs[_0xda9d('0x38')](_0x2d4244[_0xda9d('0x34')][_0xda9d('0x38')]));_0x2caae9['attributes']=_0x2caae9[_0xda9d('0x37')][_0xda9d('0x39')]?_0x2caae9[_0xda9d('0x37')]:_0x2b8caf[_0xda9d('0x31')];if(_0x2d4244[_0xda9d('0x34')][_0xda9d('0x48')]){_0x2caae9[_0xda9d('0x49')]=[{'all':!![]}];}_0x2caae9=_[_0xda9d('0x4a')]({},_0x2caae9,_0x2d4244[_0xda9d('0x42')]);return db[_0xda9d('0x43')][_0xda9d('0x4b')](_0x2caae9)['then'](handleEntityNotFound(_0x19195b,null))[_0xda9d('0x27')](respondWithResult(_0x19195b,null))['catch'](handleError(_0x19195b,null));};exports['create']=function(_0x3449c8,_0x45b9f4){return db['ZendeskConfiguration'][_0xda9d('0x4c')](_0x3449c8[_0xda9d('0x4d')],{})[_0xda9d('0x27')](respondWithResult(_0x45b9f4,0xc9))[_0xda9d('0x45')](handleError(_0x45b9f4,null));};exports['update']=function(_0x67bb72,_0x7cd11c){if(_0x67bb72['body']['id']){delete _0x67bb72[_0xda9d('0x4d')]['id'];}return db[_0xda9d('0x43')]['find']({'where':{'id':_0x67bb72[_0xda9d('0x47')]['id']}})[_0xda9d('0x27')](handleEntityNotFound(_0x7cd11c,null))[_0xda9d('0x27')](saveUpdates(_0x67bb72[_0xda9d('0x4d')],null))[_0xda9d('0x27')](respondWithResult(_0x7cd11c,null))[_0xda9d('0x45')](handleError(_0x7cd11c,null));};exports[_0xda9d('0x28')]=function(_0x4fc11f,_0x165ccc){return db[_0xda9d('0x43')][_0xda9d('0x4b')]({'where':{'id':_0x4fc11f['params']['id']}})['then'](handleEntityNotFound(_0x165ccc,null))[_0xda9d('0x27')](removeEntity(_0x165ccc,null))[_0xda9d('0x45')](handleError(_0x165ccc,null));};exports[_0xda9d('0x4e')]=function(_0x202bc4,_0x5414ad,_0x460079){var _0x21d597={};var _0x85d3cd={};var _0x1db493;var _0x4df161;return db[_0xda9d('0x43')][_0xda9d('0x4f')]({'where':{'id':_0x202bc4[_0xda9d('0x47')]['id']}})[_0xda9d('0x27')](handleEntityNotFound(_0x5414ad,null))[_0xda9d('0x27')](function(_0x5ddcfd){if(_0x5ddcfd){_0x1db493=_0x5ddcfd;_0x85d3cd[_0xda9d('0x31')]=_[_0xda9d('0x33')](db[_0xda9d('0x50')][_0xda9d('0x2d')]);_0x85d3cd[_0xda9d('0x34')]=_[_0xda9d('0x33')](_0x202bc4['query']);_0x85d3cd[_0xda9d('0x35')]=_[_0xda9d('0x36')](_0x85d3cd[_0xda9d('0x31')],_0x85d3cd['query']);_0x21d597['attributes']=_[_0xda9d('0x36')](_0x85d3cd[_0xda9d('0x31')],qs[_0xda9d('0x38')](_0x202bc4[_0xda9d('0x34')][_0xda9d('0x38')]));_0x21d597[_0xda9d('0x37')]=_0x21d597[_0xda9d('0x37')][_0xda9d('0x39')]?_0x21d597['attributes']:_0x85d3cd['model'];_0x21d597[_0xda9d('0x3c')]=qs[_0xda9d('0x3d')](_0x202bc4[_0xda9d('0x34')][_0xda9d('0x3d')]);_0x21d597[_0xda9d('0x3f')]=qs[_0xda9d('0x35')](_[_0xda9d('0x3e')](_0x202bc4[_0xda9d('0x34')],_0x85d3cd[_0xda9d('0x35')]));if(_0x202bc4[_0xda9d('0x34')]['filter']){_0x21d597[_0xda9d('0x3f')]=_[_0xda9d('0x4a')](_0x21d597[_0xda9d('0x3f')],{'$or':_[_0xda9d('0x32')](_0x21d597[_0xda9d('0x37')],function(_0x200169){var _0x532c46={};_0x532c46[_0x200169]={'$like':'%'+_0x202bc4[_0xda9d('0x34')]['filter']+'%'};return _0x532c46;})});}_0x21d597=_[_0xda9d('0x4a')]({},_0x21d597,_0x202bc4[_0xda9d('0x42')]);return _0x1db493['getFields'](_0x21d597);}})[_0xda9d('0x27')](function(_0x45eef6){if(_0x45eef6){_0x4df161=_0x45eef6[_0xda9d('0x39')];if(!_0x202bc4[_0xda9d('0x34')]['hasOwnProperty'](_0xda9d('0x3b'))){_0x21d597['limit']=qs[_0xda9d('0x20')](_0x202bc4[_0xda9d('0x34')]['limit']);_0x21d597[_0xda9d('0x1e')]=qs[_0xda9d('0x1e')](_0x202bc4['query'][_0xda9d('0x1e')]);}return _0x1db493[_0xda9d('0x4e')](_0x21d597);}})['then'](function(_0x559934){if(_0x559934){return _0x559934?{'count':_0x4df161,'rows':_0x559934}:null;}})[_0xda9d('0x27')](respondWithResult(_0x5414ad,null))['catch'](handleError(_0x5414ad,null));};exports[_0xda9d('0x51')]=function(_0x1af89e,_0x1ad9f8,_0x4b4ab1){var _0x5704b3={};var _0x31c931={};var _0x44d0da;var _0x25b352;return db[_0xda9d('0x43')]['findOne']({'where':{'id':_0x1af89e[_0xda9d('0x47')]['id']}})[_0xda9d('0x27')](handleEntityNotFound(_0x1ad9f8,null))[_0xda9d('0x27')](function(_0x5bd46e){if(_0x5bd46e){_0x44d0da=_0x5bd46e;_0x31c931[_0xda9d('0x31')]=_[_0xda9d('0x33')](db['ZendeskField'][_0xda9d('0x2d')]);_0x31c931['query']=_[_0xda9d('0x33')](_0x1af89e[_0xda9d('0x34')]);_0x31c931['filters']=_[_0xda9d('0x36')](_0x31c931['model'],_0x31c931[_0xda9d('0x34')]);_0x5704b3[_0xda9d('0x37')]=_[_0xda9d('0x36')](_0x31c931[_0xda9d('0x31')],qs['fields'](_0x1af89e[_0xda9d('0x34')][_0xda9d('0x38')]));_0x5704b3[_0xda9d('0x37')]=_0x5704b3[_0xda9d('0x37')][_0xda9d('0x39')]?_0x5704b3[_0xda9d('0x37')]:_0x31c931[_0xda9d('0x31')];_0x5704b3['order']=qs['sort'](_0x1af89e[_0xda9d('0x34')][_0xda9d('0x3d')]);_0x5704b3[_0xda9d('0x3f')]=qs[_0xda9d('0x35')](_['pick'](_0x1af89e[_0xda9d('0x34')],_0x31c931[_0xda9d('0x35')]));if(_0x1af89e['query']['filter']){_0x5704b3[_0xda9d('0x3f')]=_[_0xda9d('0x4a')](_0x5704b3[_0xda9d('0x3f')],{'$or':_['map'](_0x5704b3['attributes'],function(_0x59fbf8){var _0x5790c8={};_0x5790c8[_0x59fbf8]={'$like':'%'+_0x1af89e[_0xda9d('0x34')][_0xda9d('0x41')]+'%'};return _0x5790c8;})});}_0x5704b3=_['merge']({},_0x5704b3,_0x1af89e[_0xda9d('0x42')]);return _0x44d0da[_0xda9d('0x51')](_0x5704b3);}})[_0xda9d('0x27')](function(_0x681e50){if(_0x681e50){_0x25b352=_0x681e50[_0xda9d('0x39')];if(!_0x1af89e[_0xda9d('0x34')][_0xda9d('0x3a')](_0xda9d('0x3b'))){_0x5704b3['limit']=qs[_0xda9d('0x20')](_0x1af89e[_0xda9d('0x34')][_0xda9d('0x20')]);_0x5704b3['offset']=qs['offset'](_0x1af89e[_0xda9d('0x34')][_0xda9d('0x1e')]);}return _0x44d0da[_0xda9d('0x51')](_0x5704b3);}})[_0xda9d('0x27')](function(_0x54398d){if(_0x54398d){return _0x54398d?{'count':_0x25b352,'rows':_0x54398d}:null;}})[_0xda9d('0x27')](respondWithResult(_0x1ad9f8,null))[_0xda9d('0x45')](handleError(_0x1ad9f8,null));};exports['getDescriptions']=function(_0x5732cc,_0x4a33f7,_0x1e533a){var _0x27a0f7={};var _0x3b2845={};var _0x394515;var _0x19e0b7;return db[_0xda9d('0x43')][_0xda9d('0x4f')]({'where':{'id':_0x5732cc[_0xda9d('0x47')]['id']}})[_0xda9d('0x27')](handleEntityNotFound(_0x4a33f7,null))[_0xda9d('0x27')](function(_0x472901){if(_0x472901){_0x394515=_0x472901;_0x3b2845[_0xda9d('0x31')]=_['keys'](db[_0xda9d('0x50')][_0xda9d('0x2d')]);_0x3b2845[_0xda9d('0x34')]=_['keys'](_0x5732cc[_0xda9d('0x34')]);_0x3b2845[_0xda9d('0x35')]=_['intersection'](_0x3b2845[_0xda9d('0x31')],_0x3b2845[_0xda9d('0x34')]);_0x27a0f7[_0xda9d('0x37')]=_[_0xda9d('0x36')](_0x3b2845['model'],qs[_0xda9d('0x38')](_0x5732cc[_0xda9d('0x34')][_0xda9d('0x38')]));_0x27a0f7['attributes']=_0x27a0f7[_0xda9d('0x37')][_0xda9d('0x39')]?_0x27a0f7[_0xda9d('0x37')]:_0x3b2845[_0xda9d('0x31')];_0x27a0f7[_0xda9d('0x3c')]=qs[_0xda9d('0x3d')](_0x5732cc['query']['sort']);_0x27a0f7[_0xda9d('0x3f')]=qs[_0xda9d('0x35')](_['pick'](_0x5732cc[_0xda9d('0x34')],_0x3b2845['filters']));if(_0x5732cc[_0xda9d('0x34')][_0xda9d('0x41')]){_0x27a0f7[_0xda9d('0x3f')]=_['merge'](_0x27a0f7['where'],{'$or':_['map'](_0x27a0f7['attributes'],function(_0x32f148){var _0x134ac1={};_0x134ac1[_0x32f148]={'$like':'%'+_0x5732cc[_0xda9d('0x34')]['filter']+'%'};return _0x134ac1;})});}_0x27a0f7=_[_0xda9d('0x4a')]({},_0x27a0f7,_0x5732cc[_0xda9d('0x42')]);return _0x394515[_0xda9d('0x52')](_0x27a0f7);}})[_0xda9d('0x27')](function(_0x6b5d26){if(_0x6b5d26){_0x19e0b7=_0x6b5d26['length'];if(!_0x5732cc[_0xda9d('0x34')]['hasOwnProperty'](_0xda9d('0x3b'))){_0x27a0f7[_0xda9d('0x20')]=qs['limit'](_0x5732cc[_0xda9d('0x34')][_0xda9d('0x20')]);_0x27a0f7['offset']=qs[_0xda9d('0x1e')](_0x5732cc[_0xda9d('0x34')][_0xda9d('0x1e')]);}return _0x394515[_0xda9d('0x52')](_0x27a0f7);}})[_0xda9d('0x27')](function(_0x25effb){if(_0x25effb){return _0x25effb?{'count':_0x19e0b7,'rows':_0x25effb}:null;}})['then'](respondWithResult(_0x4a33f7,null))[_0xda9d('0x45')](handleError(_0x4a33f7,null));};exports[_0xda9d('0x53')]=function(_0x1a3ec1,_0x2d625b,_0x5b3043){var _0x26f308={};var _0x594cbd={};var _0x1000f5;var _0x30cb27;return db[_0xda9d('0x43')]['findOne']({'where':{'id':_0x1a3ec1[_0xda9d('0x47')]['id']}})[_0xda9d('0x27')](handleEntityNotFound(_0x2d625b,null))[_0xda9d('0x27')](function(_0x1d5545){if(_0x1d5545){_0x1000f5=_0x1d5545;_0x594cbd[_0xda9d('0x31')]=_['keys'](db[_0xda9d('0x54')][_0xda9d('0x2d')]);_0x594cbd['query']=_[_0xda9d('0x33')](_0x1a3ec1[_0xda9d('0x34')]);_0x594cbd['filters']=_[_0xda9d('0x36')](_0x594cbd[_0xda9d('0x31')],_0x594cbd[_0xda9d('0x34')]);_0x26f308[_0xda9d('0x37')]=_[_0xda9d('0x36')](_0x594cbd[_0xda9d('0x31')],qs[_0xda9d('0x38')](_0x1a3ec1[_0xda9d('0x34')]['fields']));_0x26f308[_0xda9d('0x37')]=_0x26f308[_0xda9d('0x37')][_0xda9d('0x39')]?_0x26f308[_0xda9d('0x37')]:_0x594cbd['model'];_0x26f308[_0xda9d('0x3c')]=qs['sort'](_0x1a3ec1[_0xda9d('0x34')][_0xda9d('0x3d')]);_0x26f308[_0xda9d('0x3f')]=qs[_0xda9d('0x35')](_[_0xda9d('0x3e')](_0x1a3ec1['query'],_0x594cbd['filters']));if(_0x1a3ec1['query'][_0xda9d('0x41')]){_0x26f308[_0xda9d('0x3f')]=_['merge'](_0x26f308[_0xda9d('0x3f')],{'$or':_[_0xda9d('0x32')](_0x26f308[_0xda9d('0x37')],function(_0x4f64a8){var _0x5b924b={};_0x5b924b[_0x4f64a8]={'$like':'%'+_0x1a3ec1['query'][_0xda9d('0x41')]+'%'};return _0x5b924b;})});}_0x26f308=_[_0xda9d('0x4a')]({},_0x26f308,_0x1a3ec1['options']);return _0x1000f5['getTags'](_0x26f308);}})['then'](function(_0x1ef311){if(_0x1ef311){_0x30cb27=_0x1ef311['length'];if(!_0x1a3ec1[_0xda9d('0x34')][_0xda9d('0x3a')](_0xda9d('0x3b'))){_0x26f308['limit']=qs[_0xda9d('0x20')](_0x1a3ec1[_0xda9d('0x34')]['limit']);_0x26f308[_0xda9d('0x1e')]=qs[_0xda9d('0x1e')](_0x1a3ec1[_0xda9d('0x34')]['offset']);}return _0x1000f5[_0xda9d('0x53')](_0x26f308);}})[_0xda9d('0x27')](function(_0x54b29d){if(_0x54b29d){return _0x54b29d?{'count':_0x30cb27,'rows':_0x54b29d}:null;}})[_0xda9d('0x27')](respondWithResult(_0x2d625b,null))[_0xda9d('0x45')](handleError(_0x2d625b,null));};exports[_0xda9d('0x55')]=function(_0x175f3f,_0x5e071c,_0x48c2f7){if(_0x175f3f[_0xda9d('0x4d')]['id']){delete _0x175f3f[_0xda9d('0x4d')]['id'];}return db[_0xda9d('0x43')][_0xda9d('0x4f')]({'where':{'id':_0x175f3f['params']['id']}})[_0xda9d('0x27')](handleEntityNotFound(_0x5e071c,null))[_0xda9d('0x27')](function(_0x5e8d30){if(_0x5e8d30){return _0x5e8d30['setTags'](_0x175f3f[_0xda9d('0x4d')]['ids']||[]);}return null;})[_0xda9d('0x27')](respondWithResult(_0x5e071c,null))[_0xda9d('0x45')](handleError(_0x5e071c,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 3948f6c..3e43e69 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 _0x13f6=['request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','lodash','util','moment','bluebird'];(function(_0x535137,_0xb95758){var _0x3b7d72=function(_0x55a149){while(--_0x55a149){_0x535137['push'](_0x535137['shift']());}};_0x3b7d72(++_0xb95758);}(_0x13f6,0x124));var _0x613f=function(_0x26e0da,_0x3e961b){_0x26e0da=_0x26e0da-0x0;var _0x221753=_0x13f6[_0x26e0da];return _0x221753;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x613f('0x2'));var BPromise=require(_0x613f('0x3'));var rp=require(_0x613f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var attributes=require(_0x613f('0x7'));module['exports']=function(_0x3f3525,_0x2367b3){return _0x3f3525['define']('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef0f=['moment','request-promise','path','rimraf','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','lodash','../../config/logger','api'];(function(_0x46bac8,_0x33ca8c){var _0x3b196c=function(_0x31f2b6){while(--_0x31f2b6){_0x46bac8['push'](_0x46bac8['shift']());}};_0x3b196c(++_0x33ca8c);}(_0xef0f,0x168));var _0xfef0=function(_0x59b07f,_0x59eb6){_0x59b07f=_0x59b07f-0x0;var _0x3d9a74=_0xef0f[_0x59b07f];return _0x3d9a74;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var logger=require(_0xfef0('0x1'))(_0xfef0('0x2'));var moment=require(_0xfef0('0x3'));var BPromise=require('bluebird');var rp=require(_0xfef0('0x4'));var fs=require('fs');var path=require(_0xfef0('0x5'));var rimraf=require(_0xfef0('0x6'));var config=require('../../config/environment');var attributes=require(_0xfef0('0x7'));module[_0xfef0('0x8')]=function(_0x2697df,_0x315a8c){return _0x2697df[_0xfef0('0x9')](_0xfef0('0xa'),attributes,{'tableName':'int_zendesk_configurations','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 8de6ae5..b7d819b 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 _0x7bb7=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x454eb9,_0x382d03){var _0x489de7=function(_0x35829d){while(--_0x35829d){_0x454eb9['push'](_0x454eb9['shift']());}};_0x489de7(++_0x382d03);}(_0x7bb7,0x115));var _0x77bb=function(_0x23c797,_0x20990f){_0x23c797=_0x23c797-0x0;var _0x445d8c=_0x7bb7[_0x23c797];return _0x445d8c;};'use strict';var _=require(_0x77bb('0x0'));var util=require(_0x77bb('0x1'));var moment=require(_0x77bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x77bb('0x3'));var fs=require('fs');var Redis=require(_0x77bb('0x4'));var db=require(_0x77bb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77bb('0x6'))(_0x77bb('0x7'));var config=require(_0x77bb('0x8'));var jayson=require(_0x77bb('0x9'));var client=jayson[_0x77bb('0xa')][_0x77bb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c5941,_0x35c08f,_0x2c8366){return new BPromise(function(_0xe3d1f9,_0x27abff){return client[_0x77bb('0xc')](_0x2c5941,_0x2c8366)[_0x77bb('0xd')](function(_0x318ceb){logger[_0x77bb('0xe')](_0x77bb('0xf'),_0x35c08f,_0x77bb('0x10'));logger[_0x77bb('0x11')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x35c08f,'request\x20sent',JSON['stringify'](_0x318ceb));if(_0x318ceb[_0x77bb('0x12')]){if(_0x318ceb['error'][_0x77bb('0x13')]===0x1f4){logger[_0x77bb('0x12')](_0x77bb('0xf'),_0x35c08f,_0x318ceb[_0x77bb('0x12')][_0x77bb('0x14')]);return _0x27abff(_0x318ceb[_0x77bb('0x12')][_0x77bb('0x14')]);}logger[_0x77bb('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x35c08f,_0x318ceb[_0x77bb('0x12')]['message']);return _0xe3d1f9(_0x318ceb[_0x77bb('0x12')][_0x77bb('0x14')]);}else{logger['info'](_0x77bb('0xf'),_0x35c08f,_0x77bb('0x10'));_0xe3d1f9(_0x318ceb[_0x77bb('0x15')]['message']);}})[_0x77bb('0x16')](function(_0x3dec32){logger['error'](_0x77bb('0xf'),_0x35c08f,_0x3dec32);_0x27abff(_0x3dec32);});});} \ No newline at end of file +var _0xb2ca=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x3ffa95,_0x326da4){var _0xbd03ff=function(_0x1138eb){while(--_0x1138eb){_0x3ffa95['push'](_0x3ffa95['shift']());}};_0xbd03ff(++_0x326da4);}(_0xb2ca,0x1b9));var _0xab2c=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xb2ca[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xab2c('0x0'));var util=require(_0xab2c('0x1'));var moment=require(_0xab2c('0x2'));var BPromise=require('bluebird');var rs=require(_0xab2c('0x3'));var fs=require('fs');var Redis=require(_0xab2c('0x4'));var db=require(_0xab2c('0x5'))['db'];var utils=require(_0xab2c('0x6'));var logger=require(_0xab2c('0x7'))(_0xab2c('0x8'));var config=require(_0xab2c('0x9'));var jayson=require(_0xab2c('0xa'));var client=jayson[_0xab2c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3eef7d,_0x86e626,_0x42392f){return new BPromise(function(_0xf83dd1,_0x120ec9){return client[_0xab2c('0xc')](_0x3eef7d,_0x42392f)['then'](function(_0x4bfa1b){logger['info'](_0xab2c('0xd'),_0x86e626,'request\x20sent');logger[_0xab2c('0xe')](_0xab2c('0xf'),_0x86e626,'request\x20sent',JSON[_0xab2c('0x10')](_0x4bfa1b));if(_0x4bfa1b['error']){if(_0x4bfa1b[_0xab2c('0x11')][_0xab2c('0x12')]===0x1f4){logger[_0xab2c('0x11')](_0xab2c('0xd'),_0x86e626,_0x4bfa1b['error'][_0xab2c('0x13')]);return _0x120ec9(_0x4bfa1b[_0xab2c('0x11')][_0xab2c('0x13')]);}logger['error'](_0xab2c('0xd'),_0x86e626,_0x4bfa1b[_0xab2c('0x11')][_0xab2c('0x13')]);return _0xf83dd1(_0x4bfa1b[_0xab2c('0x11')][_0xab2c('0x13')]);}else{logger['info'](_0xab2c('0xd'),_0x86e626,_0xab2c('0x14'));_0xf83dd1(_0x4bfa1b['result'][_0xab2c('0x13')]);}})[_0xab2c('0x15')](function(_0xdb954e){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x86e626,_0xdb954e);_0x120ec9(_0xdb954e);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 94c5421..16dad93 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 _0x5cc4=['../../components/auth/service','./intZendeskField.controller','isAuthenticated','post','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1aab47,_0x4804e3){var _0x756ce1=function(_0x1c73f3){while(--_0x1c73f3){_0x1aab47['push'](_0x1aab47['shift']());}};_0x756ce1(++_0x4804e3);}(_0x5cc4,0x1ea));var _0x45cc=function(_0x378b4,_0x5ca7fa){_0x378b4=_0x378b4-0x0;var _0x11d07b=_0x5cc4[_0x378b4];return _0x11d07b;};'use strict';var multer=require('multer');var util=require(_0x45cc('0x0'));var path=require(_0x45cc('0x1'));var timeout=require(_0x45cc('0x2'));var express=require(_0x45cc('0x3'));var router=express[_0x45cc('0x4')]();var fs_extra=require(_0x45cc('0x5'));var auth=require(_0x45cc('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x45cc('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x45cc('0x8')](),controller['show']);router[_0x45cc('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0x45cc('0xa')](_0x45cc('0xb'),auth[_0x45cc('0x8')](),controller[_0x45cc('0xc')]);router[_0x45cc('0xd')](_0x45cc('0xb'),auth[_0x45cc('0x8')](),controller[_0x45cc('0xe')]);module[_0x45cc('0xf')]=router; \ No newline at end of file +var _0x1920=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x5892bf,_0x16530c){var _0x33367a=function(_0x1f41eb){while(--_0x1f41eb){_0x5892bf['push'](_0x5892bf['shift']());}};_0x33367a(++_0x16530c);}(_0x1920,0x189));var _0x0192=function(_0x117b99,_0x2924f8){_0x117b99=_0x117b99-0x0;var _0x40bedf=_0x1920[_0x117b99];return _0x40bedf;};'use strict';var multer=require(_0x0192('0x0'));var util=require(_0x0192('0x1'));var path=require('path');var timeout=require(_0x0192('0x2'));var express=require(_0x0192('0x3'));var router=express[_0x0192('0x4')]();var fs_extra=require(_0x0192('0x5'));var auth=require(_0x0192('0x6'));var interaction=require(_0x0192('0x7'));var config=require(_0x0192('0x8'));var controller=require('./intZendeskField.controller');router[_0x0192('0x9')]('/',auth[_0x0192('0xa')](),controller[_0x0192('0xb')]);router[_0x0192('0x9')](_0x0192('0xc'),auth[_0x0192('0xa')](),controller[_0x0192('0xd')]);router[_0x0192('0xe')]('/',auth[_0x0192('0xa')](),controller[_0x0192('0xf')]);router['put'](_0x0192('0xc'),auth[_0x0192('0xa')](),controller[_0x0192('0x10')]);router['delete'](_0x0192('0xc'),auth[_0x0192('0xa')](),controller[_0x0192('0x11')]);module[_0x0192('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 5be0c15..52ca7d7 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 _0x0ab2=['string','STRING','BOOLEAN','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0xe5c259,_0x2b9b50){var _0x1a16c2=function(_0x26f8d6){while(--_0x26f8d6){_0xe5c259['push'](_0xe5c259['shift']());}};_0x1a16c2(++_0x2b9b50);}(_0x0ab2,0x12c));var _0x20ab=function(_0x453d45,_0x2c344d){_0x453d45=_0x453d45-0x0;var _0x155308=_0x0ab2[_0x453d45];return _0x155308;};'use strict';var Sequelize=require('sequelize');module[_0x20ab('0x0')]={'type':{'type':Sequelize[_0x20ab('0x1')]('string',_0x20ab('0x2'),_0x20ab('0x3'),_0x20ab('0x4'),_0x20ab('0x5')),'defaultValue':_0x20ab('0x6')},'content':{'type':Sequelize[_0x20ab('0x7')]},'key':{'type':Sequelize[_0x20ab('0x7')]},'keyType':{'type':Sequelize[_0x20ab('0x1')](_0x20ab('0x6'),'variable',_0x20ab('0x3'))},'keyContent':{'type':Sequelize[_0x20ab('0x7')]},'idField':{'type':Sequelize[_0x20ab('0x7')]},'nameField':{'type':Sequelize[_0x20ab('0x7')]},'customField':{'type':Sequelize[_0x20ab('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfb2c=['picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0xfb2c,0xd2));var _0xcfb2=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xfb2c[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0xcfb2('0x0'));module['exports']={'type':{'type':Sequelize[_0xcfb2('0x1')](_0xcfb2('0x2'),_0xcfb2('0x3'),_0xcfb2('0x4'),_0xcfb2('0x5'),_0xcfb2('0x6')),'defaultValue':_0xcfb2('0x2')},'content':{'type':Sequelize[_0xcfb2('0x7')]},'key':{'type':Sequelize[_0xcfb2('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xcfb2('0x2'),_0xcfb2('0x3'),_0xcfb2('0x4'))},'keyContent':{'type':Sequelize[_0xcfb2('0x7')]},'idField':{'type':Sequelize[_0xcfb2('0x7')]},'nameField':{'type':Sequelize[_0xcfb2('0x7')]},'customField':{'type':Sequelize[_0xcfb2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcfb2('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 6eb1b4f..62f03bc 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 _0x4f08=['model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','filter','merge','where','VIRTUAL','options','count','includeAll','include','findAll','catch','params','length','find','create','body','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','set','json','reject','update','then','destroy','end','error','stack','name','send','index','map','ZendeskField','rawAttributes','type','key'];(function(_0x2d42d5,_0x91a418){var _0x1ad892=function(_0x3cd393){while(--_0x3cd393){_0x2d42d5['push'](_0x2d42d5['shift']());}};_0x1ad892(++_0x91a418);}(_0x4f08,0xaa));var _0x84f0=function(_0x39429e,_0x37faa7){_0x39429e=_0x39429e-0x0;var _0x59ef16=_0x4f08[_0x39429e];return _0x59ef16;};'use strict';var emlformat=require(_0x84f0('0x0'));var rimraf=require(_0x84f0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x84f0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x84f0('0x3'));var Mustache=require(_0x84f0('0x4'));var util=require(_0x84f0('0x5'));var path=require(_0x84f0('0x6'));var sox=require(_0x84f0('0x7'));var csv=require(_0x84f0('0x8'));var ejs=require(_0x84f0('0x9'));var fs=require('fs');var fs_extra=require(_0x84f0('0xa'));var _=require(_0x84f0('0xb'));var squel=require('squel');var crypto=require(_0x84f0('0xc'));var jsforce=require(_0x84f0('0xd'));var deskjs=require(_0x84f0('0xe'));var toCsv=require(_0x84f0('0x8'));var querystring=require(_0x84f0('0xf'));var Papa=require(_0x84f0('0x10'));var Redis=require(_0x84f0('0x11'));var authService=require(_0x84f0('0x12'));var qs=require(_0x84f0('0x13'));var as=require(_0x84f0('0x14'));var hardwareService=require(_0x84f0('0x15'));var logger=require(_0x84f0('0x16'))('api');var utils=require(_0x84f0('0x17'));var config=require(_0x84f0('0x18'));var licenseUtil=require(_0x84f0('0x19'));var db=require(_0x84f0('0x1a'))['db'];function respondWithStatusCode(_0x597a5f,_0x47debb){_0x47debb=_0x47debb||0xcc;return function(_0x8a079d){if(_0x8a079d){return _0x597a5f[_0x84f0('0x1b')](_0x47debb);}return _0x597a5f[_0x84f0('0x1c')](_0x47debb)['end']();};}function respondWithResult(_0x16e228,_0x2f8e41){_0x2f8e41=_0x2f8e41||0xc8;return function(_0x36a567){if(_0x36a567){return _0x16e228[_0x84f0('0x1c')](_0x2f8e41)['json'](_0x36a567);}};}function respondWithFilteredResult(_0x1599ff,_0x12afb6){return function(_0x50da57){if(_0x50da57){var _0x345df4=typeof _0x12afb6['offset']===_0x84f0('0x1d')&&typeof _0x12afb6[_0x84f0('0x1e')]==='undefined';var _0x34ec35=_0x50da57['count'];var _0x2b96d9=_0x345df4?0x0:_0x12afb6[_0x84f0('0x1f')];var _0x2a6dfd=_0x345df4?_0x50da57['count']:_0x12afb6[_0x84f0('0x1f')]+_0x12afb6[_0x84f0('0x1e')];var _0x4d5d82;if(_0x2a6dfd>=_0x34ec35){_0x2a6dfd=_0x34ec35;_0x4d5d82=0xc8;}else{_0x4d5d82=0xce;}_0x1599ff[_0x84f0('0x1c')](_0x4d5d82);return _0x1599ff[_0x84f0('0x20')]('Content-Range',_0x2b96d9+'-'+_0x2a6dfd+'/'+_0x34ec35)[_0x84f0('0x21')](_0x50da57);}return null;};}function patchUpdates(_0x5093f4){return function(_0xdb3e6a){try{jsonpatch['apply'](_0xdb3e6a,_0x5093f4,!![]);}catch(_0x137fb6){return BPromise[_0x84f0('0x22')](_0x137fb6);}return _0xdb3e6a['save']();};}function saveUpdates(_0xeaac2f,_0x32d5c2){return function(_0x107c36){if(_0x107c36){return _0x107c36[_0x84f0('0x23')](_0xeaac2f)[_0x84f0('0x24')](function(_0x1f28ac){return _0x1f28ac;});}return null;};}function removeEntity(_0x5ea19b,_0x1359f2){return function(_0x332092){if(_0x332092){return _0x332092[_0x84f0('0x25')]()['then'](function(){_0x5ea19b[_0x84f0('0x1c')](0xcc)[_0x84f0('0x26')]();});}};}function handleEntityNotFound(_0x268014,_0x196d71){return function(_0x649698){if(!_0x649698){_0x268014[_0x84f0('0x1b')](0x194);}return _0x649698;};}function handleError(_0x5a44eb,_0x67b1b2){_0x67b1b2=_0x67b1b2||0x1f4;return function(_0x7679e6){logger[_0x84f0('0x27')](_0x7679e6[_0x84f0('0x28')]);if(_0x7679e6['name']){delete _0x7679e6[_0x84f0('0x29')];}_0x5a44eb[_0x84f0('0x1c')](_0x67b1b2)[_0x84f0('0x2a')](_0x7679e6);};}exports[_0x84f0('0x2b')]=function(_0x1ffcf9,_0x3dc83c){var _0x3e4f40={},_0x844c1b={},_0x3c0a8d={'count':0x0,'rows':[]};var _0x133981=_[_0x84f0('0x2c')](db[_0x84f0('0x2d')][_0x84f0('0x2e')],function(_0x189c72){return{'name':_0x189c72['fieldName'],'type':_0x189c72[_0x84f0('0x2f')][_0x84f0('0x30')]};});_0x844c1b[_0x84f0('0x31')]=_[_0x84f0('0x2c')](_0x133981,_0x84f0('0x29'));_0x844c1b[_0x84f0('0x32')]=_[_0x84f0('0x33')](_0x1ffcf9[_0x84f0('0x32')]);_0x844c1b[_0x84f0('0x34')]=_[_0x84f0('0x35')](_0x844c1b[_0x84f0('0x31')],_0x844c1b['query']);_0x3e4f40[_0x84f0('0x36')]=_[_0x84f0('0x35')](_0x844c1b[_0x84f0('0x31')],qs[_0x84f0('0x37')](_0x1ffcf9[_0x84f0('0x32')][_0x84f0('0x37')]));_0x3e4f40[_0x84f0('0x36')]=_0x3e4f40[_0x84f0('0x36')]['length']?_0x3e4f40[_0x84f0('0x36')]:_0x844c1b['model'];if(!_0x1ffcf9['query'][_0x84f0('0x38')]('nolimit')){_0x3e4f40[_0x84f0('0x1e')]=qs[_0x84f0('0x1e')](_0x1ffcf9[_0x84f0('0x32')][_0x84f0('0x1e')]);_0x3e4f40[_0x84f0('0x1f')]=qs[_0x84f0('0x1f')](_0x1ffcf9[_0x84f0('0x32')][_0x84f0('0x1f')]);}_0x3e4f40['order']=qs[_0x84f0('0x39')](_0x1ffcf9[_0x84f0('0x32')][_0x84f0('0x39')]);_0x3e4f40['where']=qs[_0x84f0('0x34')](_['pick'](_0x1ffcf9[_0x84f0('0x32')],_0x844c1b[_0x84f0('0x34')]),_0x133981);if(_0x1ffcf9[_0x84f0('0x32')][_0x84f0('0x3a')]){_0x3e4f40['where']=_[_0x84f0('0x3b')](_0x3e4f40[_0x84f0('0x3c')],{'$or':_[_0x84f0('0x2c')](_0x133981,function(_0x3439a8){if(_0x3439a8[_0x84f0('0x2f')]!==_0x84f0('0x3d')){var _0x2b04a0={};_0x2b04a0[_0x3439a8['name']]={'$like':'%'+_0x1ffcf9[_0x84f0('0x32')]['filter']+'%'};return _0x2b04a0;}})});}_0x3e4f40=_[_0x84f0('0x3b')]({},_0x3e4f40,_0x1ffcf9[_0x84f0('0x3e')]);var _0x212538={'where':_0x3e4f40[_0x84f0('0x3c')]};return db[_0x84f0('0x2d')][_0x84f0('0x3f')](_0x212538)[_0x84f0('0x24')](function(_0x1d6ddd){_0x3c0a8d[_0x84f0('0x3f')]=_0x1d6ddd;if(_0x1ffcf9['query'][_0x84f0('0x40')]){_0x3e4f40[_0x84f0('0x41')]=[{'all':!![]}];}return db[_0x84f0('0x2d')][_0x84f0('0x42')](_0x3e4f40);})['then'](function(_0x46d9dc){_0x3c0a8d['rows']=_0x46d9dc;return _0x3c0a8d;})[_0x84f0('0x24')](respondWithFilteredResult(_0x3dc83c,_0x3e4f40))[_0x84f0('0x43')](handleError(_0x3dc83c,null));};exports['show']=function(_0x23aa8e,_0x37348a){var _0x441052={'raw':!![],'where':{'id':_0x23aa8e[_0x84f0('0x44')]['id']}},_0x4bda6f={};_0x4bda6f[_0x84f0('0x31')]=_['keys'](db[_0x84f0('0x2d')][_0x84f0('0x2e')]);_0x4bda6f['query']=_[_0x84f0('0x33')](_0x23aa8e[_0x84f0('0x32')]);_0x4bda6f['filters']=_[_0x84f0('0x35')](_0x4bda6f['model'],_0x4bda6f['query']);_0x441052[_0x84f0('0x36')]=_['intersection'](_0x4bda6f[_0x84f0('0x31')],qs[_0x84f0('0x37')](_0x23aa8e[_0x84f0('0x32')][_0x84f0('0x37')]));_0x441052[_0x84f0('0x36')]=_0x441052[_0x84f0('0x36')][_0x84f0('0x45')]?_0x441052[_0x84f0('0x36')]:_0x4bda6f['model'];if(_0x23aa8e[_0x84f0('0x32')][_0x84f0('0x40')]){_0x441052[_0x84f0('0x41')]=[{'all':!![]}];}_0x441052=_[_0x84f0('0x3b')]({},_0x441052,_0x23aa8e[_0x84f0('0x3e')]);return db[_0x84f0('0x2d')][_0x84f0('0x46')](_0x441052)[_0x84f0('0x24')](handleEntityNotFound(_0x37348a,null))[_0x84f0('0x24')](respondWithResult(_0x37348a,null))['catch'](handleError(_0x37348a,null));};exports[_0x84f0('0x47')]=function(_0x4c95a9,_0x5ac202){return db['ZendeskField']['create'](_0x4c95a9[_0x84f0('0x48')],{})[_0x84f0('0x24')](respondWithResult(_0x5ac202,0xc9))[_0x84f0('0x43')](handleError(_0x5ac202,null));};exports['update']=function(_0x540ed4,_0x156a86){if(_0x540ed4[_0x84f0('0x48')]['id']){delete _0x540ed4['body']['id'];}return db['ZendeskField'][_0x84f0('0x46')]({'where':{'id':_0x540ed4[_0x84f0('0x44')]['id']}})[_0x84f0('0x24')](handleEntityNotFound(_0x156a86,null))['then'](saveUpdates(_0x540ed4[_0x84f0('0x48')],null))[_0x84f0('0x24')](respondWithResult(_0x156a86,null))[_0x84f0('0x43')](handleError(_0x156a86,null));};exports[_0x84f0('0x25')]=function(_0x349715,_0x3b1595){return db[_0x84f0('0x2d')][_0x84f0('0x46')]({'where':{'id':_0x349715[_0x84f0('0x44')]['id']}})[_0x84f0('0x24')](handleEntityNotFound(_0x3b1595,null))[_0x84f0('0x24')](removeEntity(_0x3b1595,null))[_0x84f0('0x43')](handleError(_0x3b1595,null));}; \ No newline at end of file +var _0xb56f=['ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','end','error','name','send','map','ZendeskField','rawAttributes','type','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','create','body','params','destroy','find','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0xb56f,0x113));var _0xfb56=function(_0x340b27,_0x566f75){_0x340b27=_0x340b27-0x0;var _0x28a892=_0xb56f[_0x340b27];return _0x28a892;};'use strict';var emlformat=require(_0xfb56('0x0'));var rimraf=require(_0xfb56('0x1'));var zipdir=require(_0xfb56('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb56('0x3'));var moment=require(_0xfb56('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfb56('0x5'));var util=require(_0xfb56('0x6'));var path=require('path');var sox=require(_0xfb56('0x7'));var csv=require(_0xfb56('0x8'));var ejs=require(_0xfb56('0x9'));var fs=require('fs');var fs_extra=require(_0xfb56('0xa'));var _=require(_0xfb56('0xb'));var squel=require(_0xfb56('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfb56('0xd'));var toCsv=require(_0xfb56('0x8'));var querystring=require(_0xfb56('0xe'));var Papa=require(_0xfb56('0xf'));var Redis=require(_0xfb56('0x10'));var authService=require(_0xfb56('0x11'));var qs=require(_0xfb56('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfb56('0x13'));var utils=require('../../config/utils');var config=require(_0xfb56('0x14'));var licenseUtil=require(_0xfb56('0x15'));var db=require(_0xfb56('0x16'))['db'];function respondWithStatusCode(_0x1c3d74,_0x52159b){_0x52159b=_0x52159b||0xcc;return function(_0x95b3eb){if(_0x95b3eb){return _0x1c3d74[_0xfb56('0x17')](_0x52159b);}return _0x1c3d74[_0xfb56('0x18')](_0x52159b)['end']();};}function respondWithResult(_0x1a9f3c,_0x4d2602){_0x4d2602=_0x4d2602||0xc8;return function(_0x550930){if(_0x550930){return _0x1a9f3c[_0xfb56('0x18')](_0x4d2602)[_0xfb56('0x19')](_0x550930);}};}function respondWithFilteredResult(_0xc1e894,_0xed4a16){return function(_0x1c1f80){if(_0x1c1f80){var _0x3664ac=typeof _0xed4a16[_0xfb56('0x1a')]===_0xfb56('0x1b')&&typeof _0xed4a16[_0xfb56('0x1c')]===_0xfb56('0x1b');var _0x355016=_0x1c1f80[_0xfb56('0x1d')];var _0xaa69ef=_0x3664ac?0x0:_0xed4a16[_0xfb56('0x1a')];var _0x11c7fa=_0x3664ac?_0x1c1f80[_0xfb56('0x1d')]:_0xed4a16['offset']+_0xed4a16['limit'];var _0x262672;if(_0x11c7fa>=_0x355016){_0x11c7fa=_0x355016;_0x262672=0xc8;}else{_0x262672=0xce;}_0xc1e894[_0xfb56('0x18')](_0x262672);return _0xc1e894[_0xfb56('0x1e')](_0xfb56('0x1f'),_0xaa69ef+'-'+_0x11c7fa+'/'+_0x355016)[_0xfb56('0x19')](_0x1c1f80);}return null;};}function patchUpdates(_0x116bef){return function(_0x2f64c7){try{jsonpatch['apply'](_0x2f64c7,_0x116bef,!![]);}catch(_0x2d9327){return BPromise['reject'](_0x2d9327);}return _0x2f64c7[_0xfb56('0x20')]();};}function saveUpdates(_0x999533,_0x3a1e6c){return function(_0x340d47){if(_0x340d47){return _0x340d47[_0xfb56('0x21')](_0x999533)[_0xfb56('0x22')](function(_0xb7076d){return _0xb7076d;});}return null;};}function removeEntity(_0x18d1fe,_0x189269){return function(_0x2c924c){if(_0x2c924c){return _0x2c924c['destroy']()[_0xfb56('0x22')](function(){_0x18d1fe[_0xfb56('0x18')](0xcc)[_0xfb56('0x23')]();});}};}function handleEntityNotFound(_0x158869,_0x14b6bc){return function(_0x57b4a8){if(!_0x57b4a8){_0x158869[_0xfb56('0x17')](0x194);}return _0x57b4a8;};}function handleError(_0x478c76,_0x135a43){_0x135a43=_0x135a43||0x1f4;return function(_0x4cda28){logger[_0xfb56('0x24')](_0x4cda28['stack']);if(_0x4cda28[_0xfb56('0x25')]){delete _0x4cda28[_0xfb56('0x25')];}_0x478c76[_0xfb56('0x18')](_0x135a43)[_0xfb56('0x26')](_0x4cda28);};}exports['index']=function(_0x41c6f4,_0x42fa40){var _0x589e3c={},_0x2b5eb9={},_0x41ab0d={'count':0x0,'rows':[]};var _0x15ec05=_[_0xfb56('0x27')](db[_0xfb56('0x28')][_0xfb56('0x29')],function(_0x4ead45){return{'name':_0x4ead45['fieldName'],'type':_0x4ead45[_0xfb56('0x2a')][_0xfb56('0x2b')]};});_0x2b5eb9[_0xfb56('0x2c')]=_[_0xfb56('0x27')](_0x15ec05,_0xfb56('0x25'));_0x2b5eb9[_0xfb56('0x2d')]=_['keys'](_0x41c6f4[_0xfb56('0x2d')]);_0x2b5eb9[_0xfb56('0x2e')]=_[_0xfb56('0x2f')](_0x2b5eb9['model'],_0x2b5eb9[_0xfb56('0x2d')]);_0x589e3c['attributes']=_[_0xfb56('0x2f')](_0x2b5eb9[_0xfb56('0x2c')],qs['fields'](_0x41c6f4['query'][_0xfb56('0x30')]));_0x589e3c['attributes']=_0x589e3c['attributes'][_0xfb56('0x31')]?_0x589e3c[_0xfb56('0x32')]:_0x2b5eb9['model'];if(!_0x41c6f4[_0xfb56('0x2d')][_0xfb56('0x33')]('nolimit')){_0x589e3c[_0xfb56('0x1c')]=qs[_0xfb56('0x1c')](_0x41c6f4[_0xfb56('0x2d')][_0xfb56('0x1c')]);_0x589e3c[_0xfb56('0x1a')]=qs[_0xfb56('0x1a')](_0x41c6f4[_0xfb56('0x2d')][_0xfb56('0x1a')]);}_0x589e3c[_0xfb56('0x34')]=qs[_0xfb56('0x35')](_0x41c6f4[_0xfb56('0x2d')][_0xfb56('0x35')]);_0x589e3c[_0xfb56('0x36')]=qs['filters'](_['pick'](_0x41c6f4['query'],_0x2b5eb9['filters']),_0x15ec05);if(_0x41c6f4[_0xfb56('0x2d')][_0xfb56('0x37')]){_0x589e3c['where']=_[_0xfb56('0x38')](_0x589e3c[_0xfb56('0x36')],{'$or':_[_0xfb56('0x27')](_0x15ec05,function(_0x366ad9){if(_0x366ad9['type']!==_0xfb56('0x39')){var _0x5723ff={};_0x5723ff[_0x366ad9[_0xfb56('0x25')]]={'$like':'%'+_0x41c6f4['query'][_0xfb56('0x37')]+'%'};return _0x5723ff;}})});}_0x589e3c=_[_0xfb56('0x38')]({},_0x589e3c,_0x41c6f4[_0xfb56('0x3a')]);var _0x40bdff={'where':_0x589e3c[_0xfb56('0x36')]};return db[_0xfb56('0x28')][_0xfb56('0x1d')](_0x40bdff)[_0xfb56('0x22')](function(_0xb5f36b){_0x41ab0d[_0xfb56('0x1d')]=_0xb5f36b;if(_0x41c6f4[_0xfb56('0x2d')][_0xfb56('0x3b')]){_0x589e3c[_0xfb56('0x3c')]=[{'all':!![]}];}return db[_0xfb56('0x28')][_0xfb56('0x3d')](_0x589e3c);})['then'](function(_0x370a98){_0x41ab0d[_0xfb56('0x3e')]=_0x370a98;return _0x41ab0d;})[_0xfb56('0x22')](respondWithFilteredResult(_0x42fa40,_0x589e3c))[_0xfb56('0x3f')](handleError(_0x42fa40,null));};exports[_0xfb56('0x40')]=function(_0x4f342e,_0x16b2bf){var _0x48152b={'raw':!![],'where':{'id':_0x4f342e['params']['id']}},_0x32b4e5={};_0x32b4e5[_0xfb56('0x2c')]=_[_0xfb56('0x41')](db[_0xfb56('0x28')]['rawAttributes']);_0x32b4e5[_0xfb56('0x2d')]=_[_0xfb56('0x41')](_0x4f342e[_0xfb56('0x2d')]);_0x32b4e5[_0xfb56('0x2e')]=_[_0xfb56('0x2f')](_0x32b4e5[_0xfb56('0x2c')],_0x32b4e5[_0xfb56('0x2d')]);_0x48152b[_0xfb56('0x32')]=_['intersection'](_0x32b4e5['model'],qs[_0xfb56('0x30')](_0x4f342e[_0xfb56('0x2d')][_0xfb56('0x30')]));_0x48152b[_0xfb56('0x32')]=_0x48152b[_0xfb56('0x32')]['length']?_0x48152b[_0xfb56('0x32')]:_0x32b4e5['model'];if(_0x4f342e['query']['includeAll']){_0x48152b[_0xfb56('0x3c')]=[{'all':!![]}];}_0x48152b=_[_0xfb56('0x38')]({},_0x48152b,_0x4f342e[_0xfb56('0x3a')]);return db[_0xfb56('0x28')]['find'](_0x48152b)['then'](handleEntityNotFound(_0x16b2bf,null))['then'](respondWithResult(_0x16b2bf,null))['catch'](handleError(_0x16b2bf,null));};exports[_0xfb56('0x42')]=function(_0x252681,_0x3f1986){return db[_0xfb56('0x28')][_0xfb56('0x42')](_0x252681[_0xfb56('0x43')],{})['then'](respondWithResult(_0x3f1986,0xc9))[_0xfb56('0x3f')](handleError(_0x3f1986,null));};exports[_0xfb56('0x21')]=function(_0x1450fc,_0xd6a975){if(_0x1450fc[_0xfb56('0x43')]['id']){delete _0x1450fc[_0xfb56('0x43')]['id'];}return db[_0xfb56('0x28')]['find']({'where':{'id':_0x1450fc[_0xfb56('0x44')]['id']}})[_0xfb56('0x22')](handleEntityNotFound(_0xd6a975,null))['then'](saveUpdates(_0x1450fc[_0xfb56('0x43')],null))['then'](respondWithResult(_0xd6a975,null))[_0xfb56('0x3f')](handleError(_0xd6a975,null));};exports[_0xfb56('0x45')]=function(_0x59de40,_0x46088f){return db[_0xfb56('0x28')][_0xfb56('0x46')]({'where':{'id':_0x59de40['params']['id']}})[_0xfb56('0x22')](handleEntityNotFound(_0x46088f,null))[_0xfb56('0x22')](removeEntity(_0x46088f,null))[_0xfb56('0x3f')](handleError(_0x46088f,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 3ed0e00..f150e3b 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 _0x8f41=['FieldId','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8f41,0x16d));var _0x18f4=function(_0x1736c8,_0x2290f5){_0x1736c8=_0x1736c8-0x0;var _0x32c27e=_0x8f41[_0x1736c8];return _0x32c27e;};'use strict';var _=require(_0x18f4('0x0'));var util=require(_0x18f4('0x1'));var logger=require('../../config/logger')(_0x18f4('0x2'));var moment=require(_0x18f4('0x3'));var BPromise=require(_0x18f4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x18f4('0x5'));var rimraf=require(_0x18f4('0x6'));var config=require(_0x18f4('0x7'));var attributes=require(_0x18f4('0x8'));module[_0x18f4('0x9')]=function(_0x44b6c0,_0x25f547){return _0x44b6c0[_0x18f4('0xa')]('ZendeskField',attributes,{'tableName':_0x18f4('0xb'),'paranoid':![],'indexes':[{'name':_0x18f4('0xc'),'fields':['idField',_0x18f4('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3fbd=['../../config/environment','exports','define','int_zendesk_fields','zendesk_unique_index','lodash','../../config/logger','api','moment','request-promise'];(function(_0xd4636c,_0x34dbf6){var _0x5ee17d=function(_0x223c38){while(--_0x223c38){_0xd4636c['push'](_0xd4636c['shift']());}};_0x5ee17d(++_0x34dbf6);}(_0x3fbd,0x1e5));var _0xd3fb=function(_0x1d2af6,_0x2bd90c){_0x1d2af6=_0x1d2af6-0x0;var _0x2c776a=_0x3fbd[_0x1d2af6];return _0x2c776a;};'use strict';var _=require(_0xd3fb('0x0'));var util=require('util');var logger=require(_0xd3fb('0x1'))(_0xd3fb('0x2'));var moment=require(_0xd3fb('0x3'));var BPromise=require('bluebird');var rp=require(_0xd3fb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd3fb('0x5'));var attributes=require('./intZendeskField.attributes');module[_0xd3fb('0x6')]=function(_0x469db4,_0x393132){return _0x469db4[_0xd3fb('0x7')]('ZendeskField',attributes,{'tableName':_0xd3fb('0x8'),'paranoid':![],'indexes':[{'name':_0xd3fb('0x9'),'fields':['idField','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 4b42a3c..3064d03 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 _0x4bdc=['debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskField,\x20%s,\x20%s'];(function(_0x5ad6cd,_0x5e6599){var _0x3e301b=function(_0x30015f){while(--_0x30015f){_0x5ad6cd['push'](_0x5ad6cd['shift']());}};_0x3e301b(++_0x5e6599);}(_0x4bdc,0x1d5));var _0xc4bd=function(_0x2761cc,_0x2068af){_0x2761cc=_0x2761cc-0x0;var _0x27d425=_0x4bdc[_0x2761cc];return _0x27d425;};'use strict';var _=require(_0xc4bd('0x0'));var util=require(_0xc4bd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc4bd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc4bd('0x3'))['db'];var utils=require(_0xc4bd('0x4'));var logger=require(_0xc4bd('0x5'))(_0xc4bd('0x6'));var config=require(_0xc4bd('0x7'));var jayson=require(_0xc4bd('0x8'));var client=jayson[_0xc4bd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fdcc1,_0x5885e9,_0x2549fb){return new BPromise(function(_0x2c6af2,_0x4c0c8a){return client[_0xc4bd('0xa')](_0x4fdcc1,_0x2549fb)[_0xc4bd('0xb')](function(_0x292a8d){logger[_0xc4bd('0xc')](_0xc4bd('0xd'),_0x5885e9,'request\x20sent');logger[_0xc4bd('0xe')](_0xc4bd('0xf'),_0x5885e9,_0xc4bd('0x10'),JSON[_0xc4bd('0x11')](_0x292a8d));if(_0x292a8d[_0xc4bd('0x12')]){if(_0x292a8d[_0xc4bd('0x12')][_0xc4bd('0x13')]===0x1f4){logger[_0xc4bd('0x12')]('ZendeskField,\x20%s,\x20%s',_0x5885e9,_0x292a8d[_0xc4bd('0x12')][_0xc4bd('0x14')]);return _0x4c0c8a(_0x292a8d[_0xc4bd('0x12')][_0xc4bd('0x14')]);}logger[_0xc4bd('0x12')](_0xc4bd('0xd'),_0x5885e9,_0x292a8d[_0xc4bd('0x12')][_0xc4bd('0x14')]);return _0x2c6af2(_0x292a8d[_0xc4bd('0x12')]['message']);}else{logger[_0xc4bd('0xc')](_0xc4bd('0xd'),_0x5885e9,'request\x20sent');_0x2c6af2(_0x292a8d[_0xc4bd('0x15')]['message']);}})[_0xc4bd('0x16')](function(_0xdcc323){logger[_0xc4bd('0x12')](_0xc4bd('0xd'),_0x5885e9,_0xdcc323);_0x4c0c8a(_0xdcc323);});});} \ No newline at end of file +var _0xd49c=['request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x38a335,_0x44c809){var _0x5824f4=function(_0x2ff479){while(--_0x2ff479){_0x38a335['push'](_0x38a335['shift']());}};_0x5824f4(++_0x44c809);}(_0xd49c,0x182));var _0xcd49=function(_0x5632e1,_0x310c28){_0x5632e1=_0x5632e1-0x0;var _0x4f5b42=_0xd49c[_0x5632e1];return _0x4f5b42;};'use strict';var _=require('lodash');var util=require(_0xcd49('0x0'));var moment=require(_0xcd49('0x1'));var BPromise=require(_0xcd49('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd49('0x3'))['db'];var utils=require(_0xcd49('0x4'));var logger=require(_0xcd49('0x5'))(_0xcd49('0x6'));var config=require(_0xcd49('0x7'));var jayson=require(_0xcd49('0x8'));var client=jayson['client'][_0xcd49('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a2694,_0x1676b5,_0x4cb545){return new BPromise(function(_0x374e9c,_0x35e323){return client[_0xcd49('0xa')](_0x2a2694,_0x4cb545)[_0xcd49('0xb')](function(_0x23bdd1){logger[_0xcd49('0xc')](_0xcd49('0xd'),_0x1676b5,_0xcd49('0xe'));logger[_0xcd49('0xf')](_0xcd49('0x10'),_0x1676b5,_0xcd49('0xe'),JSON['stringify'](_0x23bdd1));if(_0x23bdd1['error']){if(_0x23bdd1[_0xcd49('0x11')][_0xcd49('0x12')]===0x1f4){logger['error'](_0xcd49('0xd'),_0x1676b5,_0x23bdd1['error'][_0xcd49('0x13')]);return _0x35e323(_0x23bdd1['error'][_0xcd49('0x13')]);}logger[_0xcd49('0x11')](_0xcd49('0xd'),_0x1676b5,_0x23bdd1[_0xcd49('0x11')]['message']);return _0x374e9c(_0x23bdd1[_0xcd49('0x11')]['message']);}else{logger[_0xcd49('0xc')](_0xcd49('0xd'),_0x1676b5,_0xcd49('0xe'));_0x374e9c(_0x23bdd1[_0xcd49('0x14')][_0xcd49('0x13')]);}})[_0xcd49('0x15')](function(_0x390319){logger['error'](_0xcd49('0xd'),_0x1676b5,_0x390319);_0x35e323(_0x390319);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index e2f30d1..8b9112d 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 _0x897b=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getFields','post','create','/:id','update','delete','destroy'];(function(_0x17bc0f,_0x4e3573){var _0x43fba6=function(_0x4b2ff7){while(--_0x4b2ff7){_0x17bc0f['push'](_0x17bc0f['shift']());}};_0x43fba6(++_0x4e3573);}(_0x897b,0xa8));var _0xb897=function(_0x180dfe,_0x4f2ab4){_0x180dfe=_0x180dfe-0x0;var _0x21ae67=_0x897b[_0x180dfe];return _0x21ae67;};'use strict';var multer=require(_0xb897('0x0'));var util=require(_0xb897('0x1'));var path=require('path');var timeout=require(_0xb897('0x2'));var express=require(_0xb897('0x3'));var router=express[_0xb897('0x4')]();var fs_extra=require(_0xb897('0x5'));var auth=require(_0xb897('0x6'));var interaction=require(_0xb897('0x7'));var config=require('../../config/environment');var controller=require(_0xb897('0x8'));router[_0xb897('0x9')]('/',auth[_0xb897('0xa')](),controller[_0xb897('0xb')]);router[_0xb897('0x9')]('/:id',auth[_0xb897('0xa')](),controller[_0xb897('0xc')]);router[_0xb897('0x9')](_0xb897('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xb897('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xb897('0xe')]);router[_0xb897('0xf')]('/',auth[_0xb897('0xa')](),controller[_0xb897('0x10')]);router[_0xb897('0xf')]('/:id/configurations',auth[_0xb897('0xa')](),controller['addConfiguration']);router['put'](_0xb897('0x11'),auth[_0xb897('0xa')](),controller[_0xb897('0x12')]);router[_0xb897('0x13')](_0xb897('0x11'),auth[_0xb897('0xa')](),controller[_0xb897('0x14')]);module['exports']=router; \ No newline at end of file +var _0x747f=['/:id','update','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','post','addConfiguration','put'];(function(_0x31c555,_0x3b9d08){var _0x2323cf=function(_0x1d39fe){while(--_0x1d39fe){_0x31c555['push'](_0x31c555['shift']());}};_0x2323cf(++_0x3b9d08);}(_0x747f,0x1a5));var _0xf747=function(_0x241edf,_0x55c05a){_0x241edf=_0x241edf-0x0;var _0x4440ee=_0x747f[_0x241edf];return _0x4440ee;};'use strict';var multer=require(_0xf747('0x0'));var util=require(_0xf747('0x1'));var path=require('path');var timeout=require(_0xf747('0x2'));var express=require('express');var router=express[_0xf747('0x3')]();var fs_extra=require(_0xf747('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf747('0x5'));var config=require('../../config/environment');var controller=require(_0xf747('0x6'));router[_0xf747('0x7')]('/',auth[_0xf747('0x8')](),controller[_0xf747('0x9')]);router[_0xf747('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xf747('0xa')]);router[_0xf747('0x7')](_0xf747('0xb'),auth[_0xf747('0x8')](),controller['getConfigurations']);router[_0xf747('0x7')](_0xf747('0xc'),auth[_0xf747('0x8')](),controller['getFields']);router[_0xf747('0xd')]('/',auth[_0xf747('0x8')](),controller['create']);router[_0xf747('0xd')](_0xf747('0xb'),auth['isAuthenticated'](),controller[_0xf747('0xe')]);router[_0xf747('0xf')](_0xf747('0x10'),auth[_0xf747('0x8')](),controller[_0xf747('0x11')]);router['delete'](_0xf747('0x10'),auth[_0xf747('0x8')](),controller['destroy']);module[_0xf747('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index bf10a3b..3b891ac 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 _0xa9e0=['sequelize','exports','STRING'];(function(_0x5c0a22,_0x3e0eb3){var _0x292d8e=function(_0x28c9e6){while(--_0x28c9e6){_0x5c0a22['push'](_0x5c0a22['shift']());}};_0x292d8e(++_0x3e0eb3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x0a9e('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x0a9e('0x2')]},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x0a9e('0x2')]},'refreshToken':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file +var _0x84ab=['sequelize','exports','STRING'];(function(_0x384792,_0x9b8341){var _0x43d4b5=function(_0x55ede9){while(--_0x55ede9){_0x384792['push'](_0x384792['shift']());}};_0x43d4b5(++_0x9b8341);}(_0x84ab,0x12f));var _0xb84a=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0x84ab[_0x5ce15c];return _0x36e4f5;};'use strict';var Sequelize=require(_0xb84a('0x0'));module[_0xb84a('0x1')]={'name':{'type':Sequelize[_0xb84a('0x2')]},'description':{'type':Sequelize[_0xb84a('0x2')]},'host':{'type':Sequelize[_0xb84a('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb84a('0x2')]},'clientSecret':{'type':Sequelize[_0xb84a('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0xb84a('0x2')]},'refreshToken':{'type':Sequelize[_0xb84a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 6b31637..64ec6cd 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 _0x26ce=['key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','filter','merge','options','include','findAll','rows','catch','show','includeAll','create','body','find','params','getConfigurations','findOne','ZohoConfiguration','order','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoField','Subjects','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','getFields','host','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','push','display_label','custom_field','pick_list_values','test','statusCode','stringify','send','Wrong\x20credentials','zip-dir','request-promise','moment','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','offset','count','limit','set','reject','save','update','then','destroy','end','stack','name','index','map','ZohoAccount','rawAttributes','fieldName','type'];(function(_0x4a8663,_0x278641){var _0x3715b6=function(_0x5958cc){while(--_0x5958cc){_0x4a8663['push'](_0x4a8663['shift']());}};_0x3715b6(++_0x278641);}(_0x26ce,0x1e8));var _0xe26c=function(_0xfaf455,_0x13c0a9){_0xfaf455=_0xfaf455-0x0;var _0x5aaa60=_0x26ce[_0xfaf455];return _0x5aaa60;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe26c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe26c('0x1'));var moment=require(_0xe26c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe26c('0x3'));var util=require(_0xe26c('0x4'));var path=require('path');var sox=require(_0xe26c('0x5'));var csv=require(_0xe26c('0x6'));var ejs=require(_0xe26c('0x7'));var fs=require('fs');var fs_extra=require(_0xe26c('0x8'));var _=require(_0xe26c('0x9'));var squel=require(_0xe26c('0xa'));var crypto=require(_0xe26c('0xb'));var jsforce=require(_0xe26c('0xc'));var deskjs=require(_0xe26c('0xd'));var toCsv=require(_0xe26c('0x6'));var querystring=require(_0xe26c('0xe'));var Papa=require(_0xe26c('0xf'));var Redis=require('ioredis');var authService=require(_0xe26c('0x10'));var qs=require(_0xe26c('0x11'));var as=require(_0xe26c('0x12'));var hardwareService=require(_0xe26c('0x13'));var logger=require(_0xe26c('0x14'))('api');var utils=require(_0xe26c('0x15'));var config=require(_0xe26c('0x16'));var licenseUtil=require(_0xe26c('0x17'));var db=require(_0xe26c('0x18'))['db'];var integrations=require(_0xe26c('0x19'));function respondWithStatusCode(_0x446c55,_0xf2f60e){_0xf2f60e=_0xf2f60e||0xcc;return function(_0xc68cd4){if(_0xc68cd4){return _0x446c55[_0xe26c('0x1a')](_0xf2f60e);}return _0x446c55['status'](_0xf2f60e)['end']();};}function respondWithResult(_0x4f88d0,_0x160932){_0x160932=_0x160932||0xc8;return function(_0x1760ec){if(_0x1760ec){return _0x4f88d0[_0xe26c('0x1b')](_0x160932)[_0xe26c('0x1c')](_0x1760ec);}};}function respondWithFilteredResult(_0x2a899d,_0x50031b){return function(_0x1ba956){if(_0x1ba956){var _0x424aed=typeof _0x50031b['offset']===_0xe26c('0x1d')&&typeof _0x50031b['limit']===_0xe26c('0x1d');var _0x3cdc77=_0x1ba956['count'];var _0x410f7a=_0x424aed?0x0:_0x50031b[_0xe26c('0x1e')];var _0xca8d9b=_0x424aed?_0x1ba956[_0xe26c('0x1f')]:_0x50031b[_0xe26c('0x1e')]+_0x50031b[_0xe26c('0x20')];var _0x26d829;if(_0xca8d9b>=_0x3cdc77){_0xca8d9b=_0x3cdc77;_0x26d829=0xc8;}else{_0x26d829=0xce;}_0x2a899d[_0xe26c('0x1b')](_0x26d829);return _0x2a899d[_0xe26c('0x21')]('Content-Range',_0x410f7a+'-'+_0xca8d9b+'/'+_0x3cdc77)['json'](_0x1ba956);}return null;};}function patchUpdates(_0x304114){return function(_0x2a46d4){try{jsonpatch['apply'](_0x2a46d4,_0x304114,!![]);}catch(_0x598334){return BPromise[_0xe26c('0x22')](_0x598334);}return _0x2a46d4[_0xe26c('0x23')]();};}function saveUpdates(_0x3a8c7c,_0x1116bf){return function(_0x278b27){if(_0x278b27){return _0x278b27[_0xe26c('0x24')](_0x3a8c7c)[_0xe26c('0x25')](function(_0x1c50d8){return _0x1c50d8;});}return null;};}function removeEntity(_0x347689,_0x4a2f68){return function(_0x55bf94){if(_0x55bf94){return _0x55bf94[_0xe26c('0x26')]()['then'](function(){_0x347689[_0xe26c('0x1b')](0xcc)[_0xe26c('0x27')]();});}};}function handleEntityNotFound(_0x5e8027,_0x2c8007){return function(_0x27373e){if(!_0x27373e){_0x5e8027[_0xe26c('0x1a')](0x194);}return _0x27373e;};}function handleError(_0xc51fae,_0x243e3d){_0x243e3d=_0x243e3d||0x1f4;return function(_0x536301){logger['error'](_0x536301[_0xe26c('0x28')]);if(_0x536301['name']){delete _0x536301[_0xe26c('0x29')];}_0xc51fae[_0xe26c('0x1b')](_0x243e3d)['send'](_0x536301);};}exports[_0xe26c('0x2a')]=function(_0x496c43,_0x339d74){var _0x561da0={},_0x1a48a2={},_0x59542d={'count':0x0,'rows':[]};var _0x297964=_[_0xe26c('0x2b')](db[_0xe26c('0x2c')][_0xe26c('0x2d')],function(_0x21fbd6){return{'name':_0x21fbd6[_0xe26c('0x2e')],'type':_0x21fbd6[_0xe26c('0x2f')][_0xe26c('0x30')]};});_0x1a48a2[_0xe26c('0x31')]=_['map'](_0x297964,_0xe26c('0x29'));_0x1a48a2['query']=_[_0xe26c('0x32')](_0x496c43[_0xe26c('0x33')]);_0x1a48a2[_0xe26c('0x34')]=_[_0xe26c('0x35')](_0x1a48a2[_0xe26c('0x31')],_0x1a48a2[_0xe26c('0x33')]);_0x561da0[_0xe26c('0x36')]=_['intersection'](_0x1a48a2[_0xe26c('0x31')],qs[_0xe26c('0x37')](_0x496c43['query'][_0xe26c('0x37')]));_0x561da0[_0xe26c('0x36')]=_0x561da0[_0xe26c('0x36')][_0xe26c('0x38')]?_0x561da0[_0xe26c('0x36')]:_0x1a48a2[_0xe26c('0x31')];if(!_0x496c43[_0xe26c('0x33')][_0xe26c('0x39')](_0xe26c('0x3a'))){_0x561da0[_0xe26c('0x20')]=qs['limit'](_0x496c43['query'][_0xe26c('0x20')]);_0x561da0['offset']=qs[_0xe26c('0x1e')](_0x496c43[_0xe26c('0x33')][_0xe26c('0x1e')]);}_0x561da0['order']=qs['sort'](_0x496c43[_0xe26c('0x33')][_0xe26c('0x3b')]);_0x561da0['where']=qs[_0xe26c('0x34')](_[_0xe26c('0x3c')](_0x496c43[_0xe26c('0x33')],_0x1a48a2[_0xe26c('0x34')]),_0x297964);if(_0x496c43[_0xe26c('0x33')]['filter']){_0x561da0['where']=_['merge'](_0x561da0[_0xe26c('0x3d')],{'$or':_[_0xe26c('0x2b')](_0x297964,function(_0x29129f){if(_0x29129f[_0xe26c('0x2f')]!=='VIRTUAL'){var _0x43d765={};_0x43d765[_0x29129f[_0xe26c('0x29')]]={'$like':'%'+_0x496c43['query'][_0xe26c('0x3e')]+'%'};return _0x43d765;}})});}_0x561da0=_[_0xe26c('0x3f')]({},_0x561da0,_0x496c43[_0xe26c('0x40')]);var _0x1371a3={'where':_0x561da0['where']};return db['ZohoAccount'][_0xe26c('0x1f')](_0x1371a3)[_0xe26c('0x25')](function(_0x532ba7){_0x59542d['count']=_0x532ba7;if(_0x496c43[_0xe26c('0x33')]['includeAll']){_0x561da0[_0xe26c('0x41')]=[{'all':!![]}];}return db[_0xe26c('0x2c')][_0xe26c('0x42')](_0x561da0);})[_0xe26c('0x25')](function(_0x3b3ed0){_0x59542d[_0xe26c('0x43')]=_0x3b3ed0;return _0x59542d;})[_0xe26c('0x25')](respondWithFilteredResult(_0x339d74,_0x561da0))[_0xe26c('0x44')](handleError(_0x339d74,null));};exports[_0xe26c('0x45')]=function(_0x1f2a37,_0x2b8d87){var _0x25576d={'raw':![],'where':{'id':_0x1f2a37['params']['id']}},_0x3a16e7={};_0x3a16e7['model']=_['keys'](db[_0xe26c('0x2c')][_0xe26c('0x2d')]);_0x3a16e7['query']=_['keys'](_0x1f2a37[_0xe26c('0x33')]);_0x3a16e7[_0xe26c('0x34')]=_['intersection'](_0x3a16e7[_0xe26c('0x31')],_0x3a16e7['query']);_0x25576d['attributes']=_['intersection'](_0x3a16e7['model'],qs[_0xe26c('0x37')](_0x1f2a37['query'][_0xe26c('0x37')]));_0x25576d['attributes']=_0x25576d[_0xe26c('0x36')][_0xe26c('0x38')]?_0x25576d[_0xe26c('0x36')]:_0x3a16e7[_0xe26c('0x31')];if(_0x1f2a37[_0xe26c('0x33')][_0xe26c('0x46')]){_0x25576d[_0xe26c('0x41')]=[{'all':!![]}];}_0x25576d=_[_0xe26c('0x3f')]({},_0x25576d,_0x1f2a37['options']);return db[_0xe26c('0x2c')]['find'](_0x25576d)[_0xe26c('0x25')](handleEntityNotFound(_0x2b8d87,null))[_0xe26c('0x25')](respondWithResult(_0x2b8d87,null))[_0xe26c('0x44')](handleError(_0x2b8d87,null));};exports[_0xe26c('0x47')]=function(_0x2e80b9,_0x221043){return db[_0xe26c('0x2c')][_0xe26c('0x47')](_0x2e80b9['body'],{})[_0xe26c('0x25')](respondWithResult(_0x221043,0xc9))[_0xe26c('0x44')](handleError(_0x221043,null));};exports[_0xe26c('0x24')]=function(_0x30abe6,_0x49208a){if(_0x30abe6[_0xe26c('0x48')]['id']){delete _0x30abe6[_0xe26c('0x48')]['id'];}return db[_0xe26c('0x2c')][_0xe26c('0x49')]({'where':{'id':_0x30abe6[_0xe26c('0x4a')]['id']}})[_0xe26c('0x25')](handleEntityNotFound(_0x49208a,null))[_0xe26c('0x25')](saveUpdates(_0x30abe6[_0xe26c('0x48')],null))['then'](respondWithResult(_0x49208a,null))['catch'](handleError(_0x49208a,null));};exports[_0xe26c('0x26')]=function(_0x52c02f,_0x43db2a){return db[_0xe26c('0x2c')][_0xe26c('0x49')]({'where':{'id':_0x52c02f[_0xe26c('0x4a')]['id']}})[_0xe26c('0x25')](handleEntityNotFound(_0x43db2a,null))[_0xe26c('0x25')](removeEntity(_0x43db2a,null))[_0xe26c('0x44')](handleError(_0x43db2a,null));};exports[_0xe26c('0x4b')]=function(_0x269f8a,_0x4fa013,_0xfb830b){var _0x4160e0={};var _0x211922={};var _0x4afde6;var _0x2f6faf;return db['ZohoAccount'][_0xe26c('0x4c')]({'where':{'id':_0x269f8a[_0xe26c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4fa013,null))[_0xe26c('0x25')](function(_0xe3c7ad){if(_0xe3c7ad){_0x4afde6=_0xe3c7ad;_0x211922[_0xe26c('0x31')]=_[_0xe26c('0x32')](db[_0xe26c('0x4d')][_0xe26c('0x2d')]);_0x211922['query']=_['keys'](_0x269f8a[_0xe26c('0x33')]);_0x211922[_0xe26c('0x34')]=_[_0xe26c('0x35')](_0x211922[_0xe26c('0x31')],_0x211922[_0xe26c('0x33')]);_0x4160e0[_0xe26c('0x36')]=_[_0xe26c('0x35')](_0x211922[_0xe26c('0x31')],qs[_0xe26c('0x37')](_0x269f8a['query']['fields']));_0x4160e0[_0xe26c('0x36')]=_0x4160e0[_0xe26c('0x36')][_0xe26c('0x38')]?_0x4160e0['attributes']:_0x211922['model'];_0x4160e0[_0xe26c('0x4e')]=qs[_0xe26c('0x3b')](_0x269f8a[_0xe26c('0x33')][_0xe26c('0x3b')]);_0x4160e0['where']=qs['filters'](_['pick'](_0x269f8a[_0xe26c('0x33')],_0x211922[_0xe26c('0x34')]));if(_0x269f8a[_0xe26c('0x33')][_0xe26c('0x3e')]){_0x4160e0[_0xe26c('0x3d')]=_[_0xe26c('0x3f')](_0x4160e0[_0xe26c('0x3d')],{'$or':_[_0xe26c('0x2b')](_0x4160e0['attributes'],function(_0x470267){var _0x731b2e={};_0x731b2e[_0x470267]={'$like':'%'+_0x269f8a[_0xe26c('0x33')][_0xe26c('0x3e')]+'%'};return _0x731b2e;})});}_0x4160e0=_[_0xe26c('0x3f')]({},_0x4160e0,_0x269f8a[_0xe26c('0x40')]);return _0x4afde6[_0xe26c('0x4b')](_0x4160e0);}})[_0xe26c('0x25')](function(_0x3d4a54){if(_0x3d4a54){_0x2f6faf=_0x3d4a54[_0xe26c('0x38')];if(!_0x269f8a[_0xe26c('0x33')][_0xe26c('0x39')]('nolimit')){_0x4160e0[_0xe26c('0x20')]=qs['limit'](_0x269f8a[_0xe26c('0x33')][_0xe26c('0x20')]);_0x4160e0[_0xe26c('0x1e')]=qs['offset'](_0x269f8a[_0xe26c('0x33')][_0xe26c('0x1e')]);}return _0x4afde6['getConfigurations'](_0x4160e0);}})['then'](function(_0x566647){if(_0x566647){return _0x566647?{'count':_0x2f6faf,'rows':_0x566647}:null;}})[_0xe26c('0x25')](respondWithResult(_0x4fa013,null))[_0xe26c('0x44')](handleError(_0x4fa013,null));};exports[_0xe26c('0x4f')]=function(_0x2a2463,_0xbeabda,_0x477196){if(_0x2a2463[_0xe26c('0x48')]['id']){delete _0x2a2463[_0xe26c('0x48')]['id'];}return db[_0xe26c('0x2c')][_0xe26c('0x4c')]({'where':{'id':_0x2a2463[_0xe26c('0x4a')]['id']}})[_0xe26c('0x25')](handleEntityNotFound(_0xbeabda,null))[_0xe26c('0x25')](function(_0x1d5968){if(_0x1d5968){_0x2a2463[_0xe26c('0x48')][_0xe26c('0x50')]=_0x1d5968['id'];_0x2a2463[_0xe26c('0x48')]['Subjects']=integrations[_0xe26c('0x51')](_0x2a2463[_0xe26c('0x48')][_0xe26c('0x52')],_0x2a2463[_0xe26c('0x48')][_0xe26c('0x2f')]);_0x2a2463[_0xe26c('0x48')][_0xe26c('0x53')]=integrations[_0xe26c('0x54')](_0x2a2463[_0xe26c('0x48')][_0xe26c('0x52')],_0x2a2463[_0xe26c('0x48')]['type']);return db[_0xe26c('0x4d')][_0xe26c('0x47')](_0x2a2463['body'],{'include':[{'model':db[_0xe26c('0x55')],'as':_0xe26c('0x56')},{'model':db[_0xe26c('0x55')],'as':_0xe26c('0x53')}]});}return null;})[_0xe26c('0x25')](respondWithResult(_0xbeabda,null))[_0xe26c('0x44')](handleError(_0xbeabda,null));};function getAccessToken(_0x386bfd){return new Promise(function(_0x41d483,_0x1b3981){var _0x5dafa1;switch(_0x386bfd[_0xe26c('0x57')]){case'US':_0x5dafa1=_0xe26c('0x58');break;case'AU':_0x5dafa1=_0xe26c('0x59');break;case'EU':_0x5dafa1=_0xe26c('0x5a');break;case'IN':_0x5dafa1=_0xe26c('0x5b');break;case'CN':_0x5dafa1=_0xe26c('0x5c');break;default:_0x5dafa1=_0xe26c('0x5a');break;}var _0x351351={'method':_0xe26c('0x5d'),'uri':_0x5dafa1+_0xe26c('0x5e'),'qs':{'refresh_token':_0x386bfd[_0xe26c('0x5f')],'client_id':_0x386bfd[_0xe26c('0x60')],'client_secret':_0x386bfd[_0xe26c('0x61')],'grant_type':_0xe26c('0x62')},'json':!![]};return rp(_0x351351)['then'](function(_0x1b6c75){if(_0x1b6c75[_0xe26c('0x63')]){_0x41d483(_0x1b6c75[_0xe26c('0x63')]);}else{_0x1b3981('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xe26c('0x44')](function(_0x3ce2e8){_0x1b3981(_0x3ce2e8);});});}exports[_0xe26c('0x64')]=function(_0x53d098,_0x526de1,_0x4e310e){var _0x52c3a9,_0x5378ba,_0x20016c,_0x13760f,_0x32d1ec;return db['ZohoAccount'][_0xe26c('0x4c')]({'where':{'id':_0x53d098[_0xe26c('0x4a')]['id']},'attributes':['id',_0xe26c('0x65'),_0xe26c('0x57'),'clientId',_0xe26c('0x61'),_0xe26c('0x66'),_0xe26c('0x67'),_0xe26c('0x5f')]})[_0xe26c('0x25')](handleEntityNotFound(_0x526de1,null))['then'](function(_0x513c16){_0x32d1ec=_0x513c16;_0x52c3a9=_0x32d1ec[_0xe26c('0x65')];_0x5378ba=_0x52c3a9===_0xe26c('0x68')?'eu':_0xe26c('0x69');_0x20016c=_0x32d1ec[_0xe26c('0x66')];var _0x309e79=_0x20016c[_0xe26c('0x6a')](-0x1);if(_0x309e79==='/'||_0x309e79==='\x5c'||_0x309e79===':'){_0x20016c=_0x20016c[_0xe26c('0x6b')](0x0,_0x20016c[_0xe26c('0x6c')](_0x309e79));}if(!_0x32d1ec[_0xe26c('0x5f')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x32d1ec);})[_0xe26c('0x25')](function(_0x5dd535){if(_0x5dd535){return rp({'method':_0xe26c('0x6d'),'uri':util[_0xe26c('0x6e')](_0xe26c('0x6f'),_0x5378ba),'qs':{'module':_0xe26c('0x70')},'headers':{'Authorization':_0xe26c('0x71')+_0x5dd535},'json':!![]});}})[_0xe26c('0x25')](function(_0x122dca){if(_0x122dca){if(_0x122dca[_0xe26c('0x72')]&&_0x122dca[_0xe26c('0x72')][_0xe26c('0x73')]){throw new Error(_0x122dca[_0xe26c('0x72')][_0xe26c('0x73')][_0xe26c('0x74')]);}var _0x5a0b0c=[];var _0x25eaf6=[];var _0x1309e6=['Owner','Subject',_0xe26c('0x75'),_0xe26c('0x76'),'Call_Duration',_0xe26c('0x77'),_0xe26c('0x78'),_0xe26c('0x79')];_0x25eaf6=_[_0xe26c('0x7a')](_0x122dca[_0xe26c('0x37')],function(_0x30c6a4){return _0x1309e6[_0xe26c('0x7b')](_0x30c6a4[_0xe26c('0x7c')]);});for(var _0x9918a9=0x0;_0x9918a9<_0x25eaf6[_0xe26c('0x38')];_0x9918a9++){if(_0x25eaf6[_0x9918a9]['system_mandatory']===![]){_0x5a0b0c[_0xe26c('0x7d')]({'id':_0x25eaf6[_0x9918a9]['id'],'name':_0x25eaf6[_0x9918a9][_0xe26c('0x7e')],'custom':_0x25eaf6[_0x9918a9][_0xe26c('0x7f')],'options':_0x25eaf6[_0x9918a9]['data_type']==='picklist'&&_0x25eaf6[_0x9918a9][_0xe26c('0x80')][_0xe26c('0x38')]>-0x1?_['map'](_0x25eaf6[_0x9918a9][_0xe26c('0x80')],function(_0x4a5681){return{'name':_0x4a5681,'value':_0x4a5681};}):[]});}}return{'count':_0x5a0b0c['length'],'rows':_0x5a0b0c};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x526de1,null))['catch'](function(_0x4176b4){var _0x47fe2f=_0x53d098[_0xe26c('0x33')][_0xe26c('0x81')]?0x1f4:_0x4176b4[_0xe26c('0x82')]||0x1f4;logger[_0xe26c('0x73')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x47fe2f,JSON[_0xe26c('0x83')](_0x4176b4));delete _0x4176b4[_0xe26c('0x29')];if(_0x47fe2f===0x191){_0x47fe2f=0x190;}_0x526de1[_0xe26c('0x1b')](_0x47fe2f)[_0xe26c('0x84')](_0x53d098[_0xe26c('0x33')][_0xe26c('0x81')]?{'message':_0xe26c('0x85'),'statusCode':_0x4176b4[_0xe26c('0x82')]}:_0x4176b4);});}; \ No newline at end of file +var _0x33b7=['then','create','body','findOne','ZohoConfiguration','sort','getConfigurations','AccountId','Subjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','clientSecret','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','message','Description','Call_Duration','Call_Result','Call_Type','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','map','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','crypto','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','error','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','query','filters','attributes','model','fields','hasOwnProperty','nolimit','order','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','params','keys','intersection','length','include','find'];(function(_0x15ec4e,_0x40b7e0){var _0xb5e5dd=function(_0x42bdd7){while(--_0x42bdd7){_0x15ec4e['push'](_0x15ec4e['shift']());}};_0xb5e5dd(++_0x40b7e0);}(_0x33b7,0x1b2));var _0x733b=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x33b7[_0x2f3848];return _0x102668;};'use strict';var emlformat=require(_0x733b('0x0'));var rimraf=require(_0x733b('0x1'));var zipdir=require(_0x733b('0x2'));var jsonpatch=require(_0x733b('0x3'));var rp=require(_0x733b('0x4'));var moment=require('moment');var BPromise=require(_0x733b('0x5'));var Mustache=require(_0x733b('0x6'));var util=require(_0x733b('0x7'));var path=require(_0x733b('0x8'));var sox=require(_0x733b('0x9'));var csv=require('to-csv');var ejs=require(_0x733b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x733b('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x733b('0xc'));var querystring=require('querystring');var Papa=require(_0x733b('0xd'));var Redis=require('ioredis');var authService=require(_0x733b('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x733b('0xf'));var hardwareService=require(_0x733b('0x10'));var logger=require('../../config/logger')(_0x733b('0x11'));var utils=require('../../config/utils');var config=require(_0x733b('0x12'));var licenseUtil=require(_0x733b('0x13'));var db=require(_0x733b('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x540824,_0xe75e4b){_0xe75e4b=_0xe75e4b||0xcc;return function(_0x4a7850){if(_0x4a7850){return _0x540824[_0x733b('0x15')](_0xe75e4b);}return _0x540824[_0x733b('0x16')](_0xe75e4b)[_0x733b('0x17')]();};}function respondWithResult(_0x98f42c,_0x57e5ed){_0x57e5ed=_0x57e5ed||0xc8;return function(_0x5c99ef){if(_0x5c99ef){return _0x98f42c[_0x733b('0x16')](_0x57e5ed)[_0x733b('0x18')](_0x5c99ef);}};}function respondWithFilteredResult(_0x543630,_0x112db4){return function(_0xe57c3c){if(_0xe57c3c){var _0x43801f=typeof _0x112db4[_0x733b('0x19')]===_0x733b('0x1a')&&typeof _0x112db4[_0x733b('0x1b')]===_0x733b('0x1a');var _0x4803c3=_0xe57c3c[_0x733b('0x1c')];var _0x3864d4=_0x43801f?0x0:_0x112db4['offset'];var _0x1a0d20=_0x43801f?_0xe57c3c[_0x733b('0x1c')]:_0x112db4[_0x733b('0x19')]+_0x112db4['limit'];var _0x1652bd;if(_0x1a0d20>=_0x4803c3){_0x1a0d20=_0x4803c3;_0x1652bd=0xc8;}else{_0x1652bd=0xce;}_0x543630[_0x733b('0x16')](_0x1652bd);return _0x543630[_0x733b('0x1d')]('Content-Range',_0x3864d4+'-'+_0x1a0d20+'/'+_0x4803c3)['json'](_0xe57c3c);}return null;};}function patchUpdates(_0x4ba4e8){return function(_0x382c26){try{jsonpatch[_0x733b('0x1e')](_0x382c26,_0x4ba4e8,!![]);}catch(_0x271c98){return BPromise['reject'](_0x271c98);}return _0x382c26['save']();};}function saveUpdates(_0x59a57b,_0x527889){return function(_0x5c4c02){if(_0x5c4c02){return _0x5c4c02[_0x733b('0x1f')](_0x59a57b)['then'](function(_0x3833a0){return _0x3833a0;});}return null;};}function removeEntity(_0x50e6ec,_0xb6078a){return function(_0x197353){if(_0x197353){return _0x197353['destroy']()['then'](function(){_0x50e6ec[_0x733b('0x16')](0xcc)[_0x733b('0x17')]();});}};}function handleEntityNotFound(_0x35ac3a,_0x37fec2){return function(_0x2808b0){if(!_0x2808b0){_0x35ac3a['sendStatus'](0x194);}return _0x2808b0;};}function handleError(_0x186f24,_0x242d4c){_0x242d4c=_0x242d4c||0x1f4;return function(_0x14721d){logger[_0x733b('0x20')](_0x14721d[_0x733b('0x21')]);if(_0x14721d[_0x733b('0x22')]){delete _0x14721d[_0x733b('0x22')];}_0x186f24[_0x733b('0x16')](_0x242d4c)[_0x733b('0x23')](_0x14721d);};}exports[_0x733b('0x24')]=function(_0x1a0b78,_0x2d6ec6){var _0xa36a17={},_0x144a16={},_0x36cac2={'count':0x0,'rows':[]};var _0x59b5ea=_['map'](db[_0x733b('0x25')][_0x733b('0x26')],function(_0x53cb6f){return{'name':_0x53cb6f[_0x733b('0x27')],'type':_0x53cb6f[_0x733b('0x28')][_0x733b('0x29')]};});_0x144a16['model']=_['map'](_0x59b5ea,_0x733b('0x22'));_0x144a16[_0x733b('0x2a')]=_['keys'](_0x1a0b78[_0x733b('0x2a')]);_0x144a16[_0x733b('0x2b')]=_['intersection'](_0x144a16['model'],_0x144a16[_0x733b('0x2a')]);_0xa36a17[_0x733b('0x2c')]=_['intersection'](_0x144a16[_0x733b('0x2d')],qs['fields'](_0x1a0b78[_0x733b('0x2a')][_0x733b('0x2e')]));_0xa36a17[_0x733b('0x2c')]=_0xa36a17[_0x733b('0x2c')]['length']?_0xa36a17[_0x733b('0x2c')]:_0x144a16[_0x733b('0x2d')];if(!_0x1a0b78[_0x733b('0x2a')][_0x733b('0x2f')](_0x733b('0x30'))){_0xa36a17[_0x733b('0x1b')]=qs[_0x733b('0x1b')](_0x1a0b78[_0x733b('0x2a')]['limit']);_0xa36a17['offset']=qs['offset'](_0x1a0b78[_0x733b('0x2a')][_0x733b('0x19')]);}_0xa36a17[_0x733b('0x31')]=qs['sort'](_0x1a0b78[_0x733b('0x2a')]['sort']);_0xa36a17[_0x733b('0x32')]=qs[_0x733b('0x2b')](_[_0x733b('0x33')](_0x1a0b78[_0x733b('0x2a')],_0x144a16['filters']),_0x59b5ea);if(_0x1a0b78[_0x733b('0x2a')]['filter']){_0xa36a17[_0x733b('0x32')]=_['merge'](_0xa36a17[_0x733b('0x32')],{'$or':_['map'](_0x59b5ea,function(_0x283856){if(_0x283856[_0x733b('0x28')]!==_0x733b('0x34')){var _0x4a676a={};_0x4a676a[_0x283856[_0x733b('0x22')]]={'$like':'%'+_0x1a0b78['query'][_0x733b('0x35')]+'%'};return _0x4a676a;}})});}_0xa36a17=_[_0x733b('0x36')]({},_0xa36a17,_0x1a0b78[_0x733b('0x37')]);var _0x17c500={'where':_0xa36a17['where']};return db[_0x733b('0x25')][_0x733b('0x1c')](_0x17c500)['then'](function(_0x5d647f){_0x36cac2[_0x733b('0x1c')]=_0x5d647f;if(_0x1a0b78[_0x733b('0x2a')][_0x733b('0x38')]){_0xa36a17['include']=[{'all':!![]}];}return db[_0x733b('0x25')][_0x733b('0x39')](_0xa36a17);})['then'](function(_0x496972){_0x36cac2['rows']=_0x496972;return _0x36cac2;})['then'](respondWithFilteredResult(_0x2d6ec6,_0xa36a17))[_0x733b('0x3a')](handleError(_0x2d6ec6,null));};exports[_0x733b('0x3b')]=function(_0x5c133e,_0x46c2b1){var _0x4143b3={'raw':![],'where':{'id':_0x5c133e[_0x733b('0x3c')]['id']}},_0x353359={};_0x353359[_0x733b('0x2d')]=_['keys'](db['ZohoAccount'][_0x733b('0x26')]);_0x353359[_0x733b('0x2a')]=_[_0x733b('0x3d')](_0x5c133e[_0x733b('0x2a')]);_0x353359[_0x733b('0x2b')]=_[_0x733b('0x3e')](_0x353359[_0x733b('0x2d')],_0x353359['query']);_0x4143b3[_0x733b('0x2c')]=_['intersection'](_0x353359[_0x733b('0x2d')],qs[_0x733b('0x2e')](_0x5c133e[_0x733b('0x2a')][_0x733b('0x2e')]));_0x4143b3['attributes']=_0x4143b3[_0x733b('0x2c')][_0x733b('0x3f')]?_0x4143b3['attributes']:_0x353359['model'];if(_0x5c133e[_0x733b('0x2a')][_0x733b('0x38')]){_0x4143b3[_0x733b('0x40')]=[{'all':!![]}];}_0x4143b3=_[_0x733b('0x36')]({},_0x4143b3,_0x5c133e[_0x733b('0x37')]);return db[_0x733b('0x25')][_0x733b('0x41')](_0x4143b3)[_0x733b('0x42')](handleEntityNotFound(_0x46c2b1,null))[_0x733b('0x42')](respondWithResult(_0x46c2b1,null))[_0x733b('0x3a')](handleError(_0x46c2b1,null));};exports[_0x733b('0x43')]=function(_0x4b29a9,_0x13558f){return db['ZohoAccount'][_0x733b('0x43')](_0x4b29a9[_0x733b('0x44')],{})['then'](respondWithResult(_0x13558f,0xc9))[_0x733b('0x3a')](handleError(_0x13558f,null));};exports[_0x733b('0x1f')]=function(_0x5562fb,_0x1b3c46){if(_0x5562fb['body']['id']){delete _0x5562fb['body']['id'];}return db['ZohoAccount'][_0x733b('0x41')]({'where':{'id':_0x5562fb[_0x733b('0x3c')]['id']}})[_0x733b('0x42')](handleEntityNotFound(_0x1b3c46,null))[_0x733b('0x42')](saveUpdates(_0x5562fb['body'],null))['then'](respondWithResult(_0x1b3c46,null))['catch'](handleError(_0x1b3c46,null));};exports['destroy']=function(_0x401965,_0x286c34){return db[_0x733b('0x25')][_0x733b('0x41')]({'where':{'id':_0x401965[_0x733b('0x3c')]['id']}})[_0x733b('0x42')](handleEntityNotFound(_0x286c34,null))[_0x733b('0x42')](removeEntity(_0x286c34,null))[_0x733b('0x3a')](handleError(_0x286c34,null));};exports['getConfigurations']=function(_0x4e6d37,_0x5b14ec,_0x808968){var _0x2491b6={};var _0x4546ed={};var _0x28de54;var _0x228d40;return db[_0x733b('0x25')][_0x733b('0x45')]({'where':{'id':_0x4e6d37['params']['id']}})['then'](handleEntityNotFound(_0x5b14ec,null))[_0x733b('0x42')](function(_0x120b62){if(_0x120b62){_0x28de54=_0x120b62;_0x4546ed['model']=_[_0x733b('0x3d')](db[_0x733b('0x46')]['rawAttributes']);_0x4546ed[_0x733b('0x2a')]=_['keys'](_0x4e6d37[_0x733b('0x2a')]);_0x4546ed[_0x733b('0x2b')]=_['intersection'](_0x4546ed[_0x733b('0x2d')],_0x4546ed[_0x733b('0x2a')]);_0x2491b6[_0x733b('0x2c')]=_[_0x733b('0x3e')](_0x4546ed['model'],qs[_0x733b('0x2e')](_0x4e6d37[_0x733b('0x2a')][_0x733b('0x2e')]));_0x2491b6[_0x733b('0x2c')]=_0x2491b6[_0x733b('0x2c')]['length']?_0x2491b6[_0x733b('0x2c')]:_0x4546ed[_0x733b('0x2d')];_0x2491b6['order']=qs['sort'](_0x4e6d37[_0x733b('0x2a')][_0x733b('0x47')]);_0x2491b6['where']=qs[_0x733b('0x2b')](_[_0x733b('0x33')](_0x4e6d37['query'],_0x4546ed[_0x733b('0x2b')]));if(_0x4e6d37[_0x733b('0x2a')][_0x733b('0x35')]){_0x2491b6['where']=_['merge'](_0x2491b6['where'],{'$or':_['map'](_0x2491b6['attributes'],function(_0x4a38f6){var _0x5b8196={};_0x5b8196[_0x4a38f6]={'$like':'%'+_0x4e6d37[_0x733b('0x2a')][_0x733b('0x35')]+'%'};return _0x5b8196;})});}_0x2491b6=_[_0x733b('0x36')]({},_0x2491b6,_0x4e6d37[_0x733b('0x37')]);return _0x28de54[_0x733b('0x48')](_0x2491b6);}})['then'](function(_0x2e1a00){if(_0x2e1a00){_0x228d40=_0x2e1a00[_0x733b('0x3f')];if(!_0x4e6d37[_0x733b('0x2a')]['hasOwnProperty']('nolimit')){_0x2491b6[_0x733b('0x1b')]=qs[_0x733b('0x1b')](_0x4e6d37[_0x733b('0x2a')]['limit']);_0x2491b6[_0x733b('0x19')]=qs[_0x733b('0x19')](_0x4e6d37['query'][_0x733b('0x19')]);}return _0x28de54[_0x733b('0x48')](_0x2491b6);}})['then'](function(_0x277576){if(_0x277576){return _0x277576?{'count':_0x228d40,'rows':_0x277576}:null;}})[_0x733b('0x42')](respondWithResult(_0x5b14ec,null))['catch'](handleError(_0x5b14ec,null));};exports['addConfiguration']=function(_0x276556,_0x3f498f,_0x194c61){if(_0x276556['body']['id']){delete _0x276556['body']['id'];}return db['ZohoAccount'][_0x733b('0x45')]({'where':{'id':_0x276556['params']['id']}})[_0x733b('0x42')](handleEntityNotFound(_0x3f498f,null))['then'](function(_0x1d544a){if(_0x1d544a){_0x276556[_0x733b('0x44')][_0x733b('0x49')]=_0x1d544a['id'];_0x276556[_0x733b('0x44')][_0x733b('0x4a')]=integrations['getSubjects'](_0x276556[_0x733b('0x44')]['channel'],_0x276556[_0x733b('0x44')]['type']);_0x276556[_0x733b('0x44')][_0x733b('0x4b')]=integrations[_0x733b('0x4c')](_0x276556[_0x733b('0x44')][_0x733b('0x4d')],_0x276556[_0x733b('0x44')][_0x733b('0x28')]);return db['ZohoConfiguration'][_0x733b('0x43')](_0x276556[_0x733b('0x44')],{'include':[{'model':db[_0x733b('0x4e')],'as':_0x733b('0x4a')},{'model':db[_0x733b('0x4e')],'as':'Descriptions'}]});}return null;})[_0x733b('0x42')](respondWithResult(_0x3f498f,null))['catch'](handleError(_0x3f498f,null));};function getAccessToken(_0x21d48e){return new Promise(function(_0x57b7fc,_0x21c0e7){var _0x2365d5;switch(_0x21d48e[_0x733b('0x4f')]){case'US':_0x2365d5='https://accounts.zoho.com';break;case'AU':_0x2365d5=_0x733b('0x50');break;case'EU':_0x2365d5=_0x733b('0x51');break;case'IN':_0x2365d5=_0x733b('0x52');break;case'CN':_0x2365d5=_0x733b('0x53');break;default:_0x2365d5='https://accounts.zoho.eu';break;}var _0x317086={'method':_0x733b('0x54'),'uri':_0x2365d5+_0x733b('0x55'),'qs':{'refresh_token':_0x21d48e[_0x733b('0x56')],'client_id':_0x21d48e[_0x733b('0x57')],'client_secret':_0x21d48e['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x317086)[_0x733b('0x42')](function(_0xb37b7d){if(_0xb37b7d[_0x733b('0x58')]){_0x57b7fc(_0xb37b7d[_0x733b('0x58')]);}else{_0x21c0e7(_0x733b('0x59'));}})['catch'](function(_0x471898){_0x21c0e7(_0x471898);});});}exports['getFields']=function(_0x2e552a,_0x38cb04,_0x1e4164){var _0x1ca117,_0x2304a9,_0x13920a,_0x5c2fd8,_0x50c430;return db['ZohoAccount'][_0x733b('0x45')]({'where':{'id':_0x2e552a[_0x733b('0x3c')]['id']},'attributes':['id',_0x733b('0x5a'),'zone',_0x733b('0x57'),_0x733b('0x5b'),_0x733b('0x5c'),_0x733b('0x5d'),_0x733b('0x56')]})[_0x733b('0x42')](handleEntityNotFound(_0x38cb04,null))[_0x733b('0x42')](function(_0xd958b7){_0x50c430=_0xd958b7;_0x1ca117=_0x50c430[_0x733b('0x5a')];_0x2304a9=_0x1ca117===_0x733b('0x5e')?'eu':_0x733b('0x5f');_0x13920a=_0x50c430[_0x733b('0x5c')];var _0x98ad3f=_0x13920a[_0x733b('0x60')](-0x1);if(_0x98ad3f==='/'||_0x98ad3f==='\x5c'||_0x98ad3f===':'){_0x13920a=_0x13920a[_0x733b('0x61')](0x0,_0x13920a[_0x733b('0x62')](_0x98ad3f));}if(!_0x50c430[_0x733b('0x56')]){throw new Error(_0x733b('0x63'));}return getAccessToken(_0x50c430);})['then'](function(_0x51407b){if(_0x51407b){return rp({'method':_0x733b('0x64'),'uri':util[_0x733b('0x65')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x2304a9),'qs':{'module':_0x733b('0x66')},'headers':{'Authorization':_0x733b('0x67')+_0x51407b},'json':!![]});}})[_0x733b('0x42')](function(_0x24978c){if(_0x24978c){if(_0x24978c[_0x733b('0x68')]&&_0x24978c[_0x733b('0x68')][_0x733b('0x20')]){throw new Error(_0x24978c['response']['error'][_0x733b('0x69')]);}var _0xe4d33b=[];var _0x1a3367=[];var _0x1524a1=['Owner','Subject',_0x733b('0x6a'),'WhoId',_0x733b('0x6b'),_0x733b('0x6c'),'Call_Start_Time',_0x733b('0x6d')];_0x1a3367=_['remove'](_0x24978c[_0x733b('0x2e')],function(_0x4285bc){return _0x1524a1[_0x733b('0x6e')](_0x4285bc[_0x733b('0x6f')]);});for(var _0x2c98c6=0x0;_0x2c98c6<_0x1a3367['length'];_0x2c98c6++){if(_0x1a3367[_0x2c98c6][_0x733b('0x70')]===![]){_0xe4d33b[_0x733b('0x71')]({'id':_0x1a3367[_0x2c98c6]['id'],'name':_0x1a3367[_0x2c98c6][_0x733b('0x72')],'custom':_0x1a3367[_0x2c98c6][_0x733b('0x73')],'options':_0x1a3367[_0x2c98c6][_0x733b('0x74')]==='picklist'&&_0x1a3367[_0x2c98c6]['pick_list_values'][_0x733b('0x3f')]>-0x1?_[_0x733b('0x75')](_0x1a3367[_0x2c98c6][_0x733b('0x76')],function(_0x317a46){return{'name':_0x317a46,'value':_0x317a46};}):[]});}}return{'count':_0xe4d33b[_0x733b('0x3f')],'rows':_0xe4d33b};}else{return{'count':0x0,'rows':[]};}})[_0x733b('0x42')](respondWithResult(_0x38cb04,null))[_0x733b('0x3a')](function(_0x31fb6e){var _0x25d094=_0x2e552a['query'][_0x733b('0x77')]?0x1f4:_0x31fb6e[_0x733b('0x78')]||0x1f4;logger[_0x733b('0x20')](_0x733b('0x79'),_0x733b('0x7a'),_0x25d094,JSON[_0x733b('0x7b')](_0x31fb6e));delete _0x31fb6e['name'];if(_0x25d094===0x191){_0x25d094=0x190;}_0x38cb04[_0x733b('0x16')](_0x25d094)[_0x733b('0x23')](_0x2e552a[_0x733b('0x2a')][_0x733b('0x77')]?{'message':_0x733b('0x7c'),'statusCode':_0x31fb6e[_0x733b('0x78')]}:_0x31fb6e);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index a3a94ff..8cd609c 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 _0x6058=['api','moment','request-promise','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','format','name','error','inspect','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','zone','https://accounts.zoho.in','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','catch','lodash','../../config/logger'];(function(_0x2d0d97,_0x2d9560){var _0xfb96e9=function(_0x52a340){while(--_0x52a340){_0x2d0d97['push'](_0x2d0d97['shift']());}};_0xfb96e9(++_0x2d9560);}(_0x6058,0x79));var _0x8605=function(_0x45cd59,_0x5be7c0){_0x45cd59=_0x45cd59-0x0;var _0x39541a=_0x6058[_0x45cd59];return _0x39541a;};'use strict';var _=require(_0x8605('0x0'));var util=require('util');var logger=require(_0x8605('0x1'))(_0x8605('0x2'));var moment=require(_0x8605('0x3'));var BPromise=require('bluebird');var rp=require(_0x8605('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8605('0x5'));var integrations=require(_0x8605('0x6'));module[_0x8605('0x7')]=function(_0x3db3d3,_0x35abee){return _0x3db3d3[_0x8605('0x8')](_0x8605('0x9'),attributes,{'tableName':_0x8605('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x44fb31,_0x4da5e4,_0x1443f8){if(_0x44fb31[_0x8605('0xb')]('zone')||_0x44fb31[_0x8605('0xb')](_0x8605('0xc'))||_0x44fb31[_0x8605('0xb')](_0x8605('0xd'))||_0x44fb31[_0x8605('0xb')]('clientSecret')||_0x44fb31[_0x8605('0xb')](_0x8605('0xe'))||_0x44fb31['changed'](_0x8605('0xf'))){var _0x51d6d6,_0x1f79b6;_0x51d6d6=_0x44fb31['serverUrl'];var _0x3b8a12=_0x51d6d6[_0x8605('0x10')](-0x1);if(_0x3b8a12==='/'||_0x3b8a12==='\x5c'||_0x3b8a12===':'){_0x51d6d6=_0x51d6d6[_0x8605('0x11')](0x0,_0x51d6d6[_0x8605('0x12')](_0x3b8a12));}switch(_0x44fb31['zone']){case'US':_0x1f79b6=_0x8605('0x13');break;case'AU':_0x1f79b6=_0x8605('0x14');break;case'IN':_0x1f79b6='https://accounts.zoho.in';break;case'CN':_0x1f79b6='https://accounts.zoho.com.cn';break;default:_0x1f79b6=_0x8605('0x15');break;}var _0x191a19={'method':_0x8605('0x16'),'uri':_0x1f79b6+_0x8605('0x17'),'form':{'grant_type':_0x8605('0x18'),'client_id':_0x44fb31[_0x8605('0xd')],'client_secret':_0x44fb31[_0x8605('0x19')],'redirect_uri':_0x44fb31[_0x8605('0xc')],'code':_0x44fb31[_0x8605('0xe')]},'headers':{'Content-Type':_0x8605('0x1a')}};return rp(_0x191a19)[_0x8605('0x1b')](function(_0xd8ac86){var _0xe0103e=JSON[_0x8605('0x1c')](_0xd8ac86);if(_0xe0103e[_0x8605('0x1d')]){_0x44fb31[_0x8605('0x1e')]=_0xe0103e[_0x8605('0x1d')];logger['info'](util[_0x8605('0x1f')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x44fb31[_0x8605('0x20')],_0x44fb31['id']));}else{logger[_0x8605('0x21')](util[_0x8605('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x44fb31[_0x8605('0x20')],_0x44fb31['id']),util[_0x8605('0x22')](_0xe0103e,{'showHidden':![],'depth':null}));}return _0x1443f8(null,_0x4da5e4);})['catch'](function(_0x3a97b2){logger[_0x8605('0x21')](util[_0x8605('0x1f')](_0x8605('0x23'),_0x44fb31[_0x8605('0x20')],_0x44fb31['id']),util[_0x8605('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x1443f8(_0x3a97b2);});}else{return _0x1443f8(null,_0x4da5e4);}},'beforeUpdate':function(_0x538ff5,_0x32b061,_0x2f91ff){if(_0x538ff5[_0x8605('0xb')](_0x8605('0x24'))||_0x538ff5[_0x8605('0xb')](_0x8605('0xc'))||_0x538ff5[_0x8605('0xb')](_0x8605('0xd'))||_0x538ff5['changed']('clientSecret')||_0x538ff5['changed']('code')||_0x538ff5[_0x8605('0xb')]('host')){var _0x3c5a7b,_0x31b43c;_0x3c5a7b=_0x538ff5['serverUrl'];var _0x52ee74=_0x3c5a7b[_0x8605('0x10')](-0x1);if(_0x52ee74==='/'||_0x52ee74==='\x5c'||_0x52ee74===':'){_0x3c5a7b=_0x3c5a7b[_0x8605('0x11')](0x0,_0x3c5a7b[_0x8605('0x12')](_0x52ee74));}switch(_0x538ff5[_0x8605('0x24')]){case'US':_0x31b43c=_0x8605('0x13');break;case'AU':_0x31b43c=_0x8605('0x14');break;case'IN':_0x31b43c=_0x8605('0x25');break;case'CN':_0x31b43c='https://accounts.zoho.com.cn';break;default:_0x31b43c=_0x8605('0x15');break;}var _0x4dfac2={'method':_0x8605('0x16'),'uri':_0x31b43c+_0x8605('0x17'),'form':{'grant_type':_0x8605('0x18'),'client_id':_0x538ff5[_0x8605('0xd')],'client_secret':_0x538ff5[_0x8605('0x19')],'redirect_uri':_0x538ff5[_0x8605('0xc')],'code':_0x538ff5[_0x8605('0xe')]},'headers':{'Content-Type':_0x8605('0x1a')}};return rp(_0x4dfac2)[_0x8605('0x1b')](function(_0x25b8af){var _0x1bacd2=JSON[_0x8605('0x1c')](_0x25b8af);if(_0x1bacd2[_0x8605('0x1d')]){_0x538ff5['refreshToken']=_0x1bacd2[_0x8605('0x1d')];logger[_0x8605('0x26')](util[_0x8605('0x1f')](_0x8605('0x27'),_0x538ff5['name'],_0x538ff5['id']));}else{logger['error'](util[_0x8605('0x1f')](_0x8605('0x23'),_0x538ff5[_0x8605('0x20')],_0x538ff5['id']),util[_0x8605('0x22')](_0x1bacd2,{'showHidden':![],'depth':null}));}return _0x2f91ff(null,_0x32b061);})[_0x8605('0x28')](function(_0x256f53){logger['error'](util[_0x8605('0x1f')](_0x8605('0x23'),_0x538ff5['name'],_0x538ff5['id']),util[_0x8605('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x2f91ff(_0x256f53);});}else{return _0x2f91ff(null,_0x32b061);}}}});}; \ No newline at end of file +var _0x2b28=['rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','code','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','format','inspect','catch','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','host','https://accounts.zoho.in','POST','../../config/logger','api','moment','bluebird'];(function(_0x23c99f,_0x3c46e8){var _0x424726=function(_0x1bcd18){while(--_0x1bcd18){_0x23c99f['push'](_0x23c99f['shift']());}};_0x424726(++_0x3c46e8);}(_0x2b28,0x14c));var _0x82b2=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x2b28[_0x13ce0c];return _0x4388fb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x82b2('0x0'))(_0x82b2('0x1'));var moment=require(_0x82b2('0x2'));var BPromise=require(_0x82b2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x82b2('0x4'));var config=require('../../config/environment');var attributes=require(_0x82b2('0x5'));var integrations=require(_0x82b2('0x6'));module[_0x82b2('0x7')]=function(_0x2ca863,_0x2257e7){return _0x2ca863[_0x82b2('0x8')](_0x82b2('0x9'),attributes,{'tableName':_0x82b2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x44904d,_0x5cb747,_0x551a60){if(_0x44904d[_0x82b2('0xb')](_0x82b2('0xc'))||_0x44904d[_0x82b2('0xb')](_0x82b2('0xd'))||_0x44904d[_0x82b2('0xb')](_0x82b2('0xe'))||_0x44904d['changed']('clientSecret')||_0x44904d[_0x82b2('0xb')](_0x82b2('0xf'))||_0x44904d['changed']('host')){var _0x4529d5,_0x12c1b7;_0x4529d5=_0x44904d[_0x82b2('0xd')];var _0x98c7b6=_0x4529d5[_0x82b2('0x10')](-0x1);if(_0x98c7b6==='/'||_0x98c7b6==='\x5c'||_0x98c7b6===':'){_0x4529d5=_0x4529d5[_0x82b2('0x11')](0x0,_0x4529d5[_0x82b2('0x12')](_0x98c7b6));}switch(_0x44904d[_0x82b2('0xc')]){case'US':_0x12c1b7=_0x82b2('0x13');break;case'AU':_0x12c1b7=_0x82b2('0x14');break;case'IN':_0x12c1b7='https://accounts.zoho.in';break;case'CN':_0x12c1b7=_0x82b2('0x15');break;default:_0x12c1b7=_0x82b2('0x16');break;}var _0x57c5f4={'method':'POST','uri':_0x12c1b7+_0x82b2('0x17'),'form':{'grant_type':_0x82b2('0x18'),'client_id':_0x44904d[_0x82b2('0xe')],'client_secret':_0x44904d[_0x82b2('0x19')],'redirect_uri':_0x44904d[_0x82b2('0xd')],'code':_0x44904d[_0x82b2('0xf')]},'headers':{'Content-Type':_0x82b2('0x1a')}};return rp(_0x57c5f4)[_0x82b2('0x1b')](function(_0x335874){var _0x30511d=JSON[_0x82b2('0x1c')](_0x335874);if(_0x30511d[_0x82b2('0x1d')]){_0x44904d[_0x82b2('0x1e')]=_0x30511d[_0x82b2('0x1d')];logger[_0x82b2('0x1f')](util['format'](_0x82b2('0x20'),_0x44904d[_0x82b2('0x21')],_0x44904d['id']));}else{logger['error'](util[_0x82b2('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x44904d[_0x82b2('0x21')],_0x44904d['id']),util[_0x82b2('0x23')](_0x30511d,{'showHidden':![],'depth':null}));}return _0x551a60(null,_0x5cb747);})[_0x82b2('0x24')](function(_0x5c2b3d){logger[_0x82b2('0x25')](util[_0x82b2('0x22')](_0x82b2('0x26'),_0x44904d['name'],_0x44904d['id']),util[_0x82b2('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x551a60(_0x5c2b3d);});}else{return _0x551a60(null,_0x5cb747);}},'beforeUpdate':function(_0x4b0a8d,_0x323a8c,_0x9042e4){if(_0x4b0a8d['changed'](_0x82b2('0xc'))||_0x4b0a8d['changed']('serverUrl')||_0x4b0a8d[_0x82b2('0xb')](_0x82b2('0xe'))||_0x4b0a8d[_0x82b2('0xb')]('clientSecret')||_0x4b0a8d['changed'](_0x82b2('0xf'))||_0x4b0a8d[_0x82b2('0xb')](_0x82b2('0x27'))){var _0x28a2a0,_0x274adc;_0x28a2a0=_0x4b0a8d['serverUrl'];var _0x47681f=_0x28a2a0[_0x82b2('0x10')](-0x1);if(_0x47681f==='/'||_0x47681f==='\x5c'||_0x47681f===':'){_0x28a2a0=_0x28a2a0[_0x82b2('0x11')](0x0,_0x28a2a0[_0x82b2('0x12')](_0x47681f));}switch(_0x4b0a8d[_0x82b2('0xc')]){case'US':_0x274adc='https://accounts.zoho.com';break;case'AU':_0x274adc='https://accounts.zoho.com.au';break;case'IN':_0x274adc=_0x82b2('0x28');break;case'CN':_0x274adc=_0x82b2('0x15');break;default:_0x274adc=_0x82b2('0x16');break;}var _0x52be0f={'method':_0x82b2('0x29'),'uri':_0x274adc+'/oauth/v2/token','form':{'grant_type':_0x82b2('0x18'),'client_id':_0x4b0a8d[_0x82b2('0xe')],'client_secret':_0x4b0a8d[_0x82b2('0x19')],'redirect_uri':_0x4b0a8d[_0x82b2('0xd')],'code':_0x4b0a8d[_0x82b2('0xf')]},'headers':{'Content-Type':_0x82b2('0x1a')}};return rp(_0x52be0f)['then'](function(_0x411491){var _0x12e2d9=JSON[_0x82b2('0x1c')](_0x411491);if(_0x12e2d9[_0x82b2('0x1d')]){_0x4b0a8d['refreshToken']=_0x12e2d9[_0x82b2('0x1d')];logger[_0x82b2('0x1f')](util[_0x82b2('0x22')](_0x82b2('0x20'),_0x4b0a8d[_0x82b2('0x21')],_0x4b0a8d['id']));}else{logger[_0x82b2('0x25')](util[_0x82b2('0x22')](_0x82b2('0x26'),_0x4b0a8d[_0x82b2('0x21')],_0x4b0a8d['id']),util[_0x82b2('0x23')](_0x12e2d9,{'showHidden':![],'depth':null}));}return _0x9042e4(null,_0x323a8c);})[_0x82b2('0x24')](function(_0x7925b4){logger[_0x82b2('0x25')](util[_0x82b2('0x22')](_0x82b2('0x26'),_0x4b0a8d['name'],_0x4b0a8d['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x9042e4(_0x7925b4);});}else{return _0x9042e4(null,_0x323a8c);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 8e40906..186d806 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 _0xe3da=['then','GetZohoAccount','catch','ShowZohoAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ZohoAccount','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x244faa,_0x5d254a){var _0x24bacb=function(_0x2db314){while(--_0x2db314){_0x244faa['push'](_0x244faa['shift']());}};_0x24bacb(++_0x5d254a);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require(_0xae3d('0x2'));var BPromise=require(_0xae3d('0x3'));var rs=require(_0xae3d('0x4'));var fs=require('fs');var Redis=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var utils=require(_0xae3d('0x7'));var logger=require(_0xae3d('0x8'))(_0xae3d('0x9'));var config=require(_0xae3d('0xa'));var jayson=require(_0xae3d('0xb'));var client=jayson[_0xae3d('0xc')][_0xae3d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476579,_0x33c089,_0x583b98){return new BPromise(function(_0x2a5c45,_0x3d6650){return client['request'](_0x476579,_0x583b98)['then'](function(_0x459592){logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));logger[_0xae3d('0x11')](_0xae3d('0x12'),_0x33c089,'request\x20sent',JSON[_0xae3d('0x13')](_0x459592));if(_0x459592['error']){if(_0x459592[_0xae3d('0x14')][_0xae3d('0x15')]===0x1f4){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592['error'][_0xae3d('0x16')]);return _0x3d6650(_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);}logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);return _0x2a5c45(_0x459592['error'][_0xae3d('0x16')]);}else{logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));_0x2a5c45(_0x459592[_0xae3d('0x17')][_0xae3d('0x16')]);}})['catch'](function(_0xe925fd){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0xe925fd);_0x3d6650(_0xe925fd);});});}exports['GetZohoAccount']=function(_0x3f8cf9){var _0x4cbe4e=this;return new Promise(function(_0x558e42,_0x4d931d){return db[_0xae3d('0x18')][_0xae3d('0x19')]({'raw':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1b')]===undefined?!![]:![]:!![],'where':_0x3f8cf9['options']?_0x3f8cf9[_0xae3d('0x1a')]['where']||null:null,'attributes':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1c')]||null:null,'limit':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1d')]||null:null,'include':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1e')]?_[_0xae3d('0x1f')](_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1e')],function(_0x37f5ff){return{'model':db[_0x37f5ff[_0xae3d('0x20')]],'as':_0x37f5ff['as'],'attributes':_0x37f5ff[_0xae3d('0x1c')],'include':_0x37f5ff[_0xae3d('0x1e')]?_[_0xae3d('0x1f')](_0x37f5ff[_0xae3d('0x1e')],function(_0x2131e9){return{'model':db[_0x2131e9[_0xae3d('0x20')]],'as':_0x2131e9['as'],'attributes':_0x2131e9['attributes'],'include':_0x2131e9[_0xae3d('0x1e')]?_[_0xae3d('0x1f')](_0x2131e9[_0xae3d('0x1e')],function(_0x52df0f){return{'model':db[_0x52df0f[_0xae3d('0x20')]],'as':_0x52df0f['as'],'attributes':_0x52df0f[_0xae3d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xae3d('0x21')](function(_0x54c1e1){logger['info'](_0xae3d('0x22'),_0x3f8cf9);logger[_0xae3d('0x11')](_0xae3d('0x22'),_0x3f8cf9,JSON[_0xae3d('0x13')](_0x54c1e1));_0x558e42(_0x54c1e1);})[_0xae3d('0x23')](function(_0x561371){logger[_0xae3d('0x14')](_0xae3d('0x22'),_0x561371['message'],_0x3f8cf9);_0x4d931d(_0x4cbe4e[_0xae3d('0x14')](0x1f4,_0x561371[_0xae3d('0x16')]));});});};exports[_0xae3d('0x24')]=function(_0x46f484){var _0x432c04=this;return new Promise(function(_0x6ef13c,_0x5356d4){return db['ZohoAccount']['find']({'raw':_0x46f484[_0xae3d('0x1a')]?_0x46f484[_0xae3d('0x1a')][_0xae3d('0x1b')]===undefined?!![]:![]:!![],'where':_0x46f484[_0xae3d('0x1a')]?_0x46f484['options'][_0xae3d('0x25')]||null:null,'attributes':_0x46f484[_0xae3d('0x1a')]?_0x46f484[_0xae3d('0x1a')][_0xae3d('0x1c')]||null:null,'include':_0x46f484[_0xae3d('0x1a')]?_0x46f484[_0xae3d('0x1a')][_0xae3d('0x1e')]?_['map'](_0x46f484[_0xae3d('0x1a')]['include'],function(_0x55aae4){return{'model':db[_0x55aae4[_0xae3d('0x20')]],'as':_0x55aae4['as'],'attributes':_0x55aae4['attributes'],'include':_0x55aae4[_0xae3d('0x1e')]?_['map'](_0x55aae4['include'],function(_0x1a28b5){return{'model':db[_0x1a28b5[_0xae3d('0x20')]],'as':_0x1a28b5['as'],'attributes':_0x1a28b5[_0xae3d('0x1c')],'include':_0x1a28b5['include']?_[_0xae3d('0x1f')](_0x1a28b5['include'],function(_0xce647f){return{'model':db[_0xce647f[_0xae3d('0x20')]],'as':_0xce647f['as'],'attributes':_0xce647f[_0xae3d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xae3d('0x21')](function(_0x18c469){logger[_0xae3d('0xe')](_0xae3d('0x24'),_0x46f484);logger[_0xae3d('0x11')](_0xae3d('0x24'),_0x46f484,JSON[_0xae3d('0x13')](_0x18c469));_0x6ef13c(_0x18c469);})[_0xae3d('0x23')](function(_0x5543ee){logger['error'](_0xae3d('0x24'),_0x5543ee['message'],_0x46f484);_0x5356d4(_0x432c04[_0xae3d('0x14')](0x1f4,_0x5543ee[_0xae3d('0x16')]));});});}; \ No newline at end of file +var _0xdb7e=['info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','map','include','model','ShowZohoAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x43bf3f,_0x44719b){var _0x257e87=function(_0x17e560){while(--_0x17e560){_0x43bf3f['push'](_0x43bf3f['shift']());}};_0x257e87(++_0x44719b);}(_0xdb7e,0x11a));var _0xedb7=function(_0x3d5f5b,_0x23246b){_0x3d5f5b=_0x3d5f5b-0x0;var _0x4c2ec3=_0xdb7e[_0x3d5f5b];return _0x4c2ec3;};'use strict';var _=require(_0xedb7('0x0'));var util=require(_0xedb7('0x1'));var moment=require(_0xedb7('0x2'));var BPromise=require('bluebird');var rs=require(_0xedb7('0x3'));var fs=require('fs');var Redis=require(_0xedb7('0x4'));var db=require(_0xedb7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xedb7('0x6'))(_0xedb7('0x7'));var config=require(_0xedb7('0x8'));var jayson=require(_0xedb7('0x9'));var client=jayson[_0xedb7('0xa')][_0xedb7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x87bf4b,_0x20a7c7,_0x26774f){return new BPromise(function(_0x2ae0f7,_0x5a8650){return client[_0xedb7('0xc')](_0x87bf4b,_0x26774f)[_0xedb7('0xd')](function(_0x12c7ba){logger[_0xedb7('0xe')](_0xedb7('0xf'),_0x20a7c7,_0xedb7('0x10'));logger[_0xedb7('0x11')](_0xedb7('0x12'),_0x20a7c7,_0xedb7('0x10'),JSON[_0xedb7('0x13')](_0x12c7ba));if(_0x12c7ba[_0xedb7('0x14')]){if(_0x12c7ba[_0xedb7('0x14')][_0xedb7('0x15')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x20a7c7,_0x12c7ba[_0xedb7('0x14')][_0xedb7('0x16')]);return _0x5a8650(_0x12c7ba[_0xedb7('0x14')][_0xedb7('0x16')]);}logger[_0xedb7('0x14')](_0xedb7('0xf'),_0x20a7c7,_0x12c7ba[_0xedb7('0x14')][_0xedb7('0x16')]);return _0x2ae0f7(_0x12c7ba[_0xedb7('0x14')]['message']);}else{logger['info'](_0xedb7('0xf'),_0x20a7c7,_0xedb7('0x10'));_0x2ae0f7(_0x12c7ba[_0xedb7('0x17')]['message']);}})[_0xedb7('0x18')](function(_0x3ce7c5){logger[_0xedb7('0x14')](_0xedb7('0xf'),_0x20a7c7,_0x3ce7c5);_0x5a8650(_0x3ce7c5);});});}exports[_0xedb7('0x19')]=function(_0x50f579){var _0x5d2d6a=this;return new Promise(function(_0x3d8f2a,_0xa8aae0){return db[_0xedb7('0x1a')][_0xedb7('0x1b')]({'raw':_0x50f579['options']?_0x50f579[_0xedb7('0x1c')][_0xedb7('0x1d')]===undefined?!![]:![]:!![],'where':_0x50f579[_0xedb7('0x1c')]?_0x50f579['options'][_0xedb7('0x1e')]||null:null,'attributes':_0x50f579['options']?_0x50f579[_0xedb7('0x1c')][_0xedb7('0x1f')]||null:null,'limit':_0x50f579[_0xedb7('0x1c')]?_0x50f579['options']['limit']||null:null,'include':_0x50f579[_0xedb7('0x1c')]?_0x50f579[_0xedb7('0x1c')]['include']?_[_0xedb7('0x20')](_0x50f579[_0xedb7('0x1c')]['include'],function(_0x16d887){return{'model':db[_0x16d887['model']],'as':_0x16d887['as'],'attributes':_0x16d887['attributes'],'include':_0x16d887[_0xedb7('0x21')]?_[_0xedb7('0x20')](_0x16d887['include'],function(_0x1ad4e9){return{'model':db[_0x1ad4e9[_0xedb7('0x22')]],'as':_0x1ad4e9['as'],'attributes':_0x1ad4e9[_0xedb7('0x1f')],'include':_0x1ad4e9[_0xedb7('0x21')]?_[_0xedb7('0x20')](_0x1ad4e9[_0xedb7('0x21')],function(_0xfcc7ee){return{'model':db[_0xfcc7ee[_0xedb7('0x22')]],'as':_0xfcc7ee['as'],'attributes':_0xfcc7ee['attributes']};}):[]};}):[]};}):[]:[]})[_0xedb7('0xd')](function(_0x509106){logger['info'](_0xedb7('0x19'),_0x50f579);logger[_0xedb7('0x11')]('GetZohoAccount',_0x50f579,JSON['stringify'](_0x509106));_0x3d8f2a(_0x509106);})[_0xedb7('0x18')](function(_0x515ab1){logger[_0xedb7('0x14')](_0xedb7('0x19'),_0x515ab1[_0xedb7('0x16')],_0x50f579);_0xa8aae0(_0x5d2d6a['error'](0x1f4,_0x515ab1[_0xedb7('0x16')]));});});};exports[_0xedb7('0x23')]=function(_0x320c92){var _0x2202bd=this;return new Promise(function(_0xe9293,_0xb5a7ba){return db['ZohoAccount'][_0xedb7('0x24')]({'raw':_0x320c92['options']?_0x320c92[_0xedb7('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x320c92[_0xedb7('0x1c')]?_0x320c92['options'][_0xedb7('0x1e')]||null:null,'attributes':_0x320c92[_0xedb7('0x1c')]?_0x320c92[_0xedb7('0x1c')]['attributes']||null:null,'include':_0x320c92['options']?_0x320c92[_0xedb7('0x1c')][_0xedb7('0x21')]?_[_0xedb7('0x20')](_0x320c92['options'][_0xedb7('0x21')],function(_0x572e30){return{'model':db[_0x572e30[_0xedb7('0x22')]],'as':_0x572e30['as'],'attributes':_0x572e30[_0xedb7('0x1f')],'include':_0x572e30[_0xedb7('0x21')]?_[_0xedb7('0x20')](_0x572e30[_0xedb7('0x21')],function(_0x1c2b0c){return{'model':db[_0x1c2b0c['model']],'as':_0x1c2b0c['as'],'attributes':_0x1c2b0c[_0xedb7('0x1f')],'include':_0x1c2b0c[_0xedb7('0x21')]?_['map'](_0x1c2b0c[_0xedb7('0x21')],function(_0x251875){return{'model':db[_0x251875[_0xedb7('0x22')]],'as':_0x251875['as'],'attributes':_0x251875[_0xedb7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xedb7('0xd')](function(_0x24b2b0){logger[_0xedb7('0xe')](_0xedb7('0x23'),_0x320c92);logger[_0xedb7('0x11')](_0xedb7('0x23'),_0x320c92,JSON[_0xedb7('0x13')](_0x24b2b0));_0xe9293(_0x24b2b0);})[_0xedb7('0x18')](function(_0x262199){logger[_0xedb7('0x14')]('ShowZohoAccount',_0x262199[_0xedb7('0x16')],_0x320c92);_0xb5a7ba(_0x2202bd[_0xedb7('0x14')](0x1f4,_0x262199[_0xedb7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 06b8ad2..f098050 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 _0x61a2=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','getDescriptions','delete','exports','multer','util','path'];(function(_0x5082b7,_0x684dbb){var _0xfb30eb=function(_0x5bd460){while(--_0x5bd460){_0x5082b7['push'](_0x5082b7['shift']());}};_0xfb30eb(++_0x684dbb);}(_0x61a2,0x96));var _0x261a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x61a2[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x261a('0x0'));var util=require(_0x261a('0x1'));var path=require(_0x261a('0x2'));var timeout=require(_0x261a('0x3'));var express=require('express');var router=express[_0x261a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x261a('0x5'));var interaction=require(_0x261a('0x6'));var config=require(_0x261a('0x7'));var controller=require(_0x261a('0x8'));router[_0x261a('0x9')]('/',auth[_0x261a('0xa')](),controller['index']);router[_0x261a('0x9')](_0x261a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x261a('0x9')](_0x261a('0xc'),auth[_0x261a('0xa')](),controller[_0x261a('0xd')]);router[_0x261a('0x9')]('/:id/subjects',auth[_0x261a('0xa')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x261a('0xa')](),controller[_0x261a('0xe')]);router['post']('/',auth[_0x261a('0xa')](),controller['create']);router['put'](_0x261a('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x261a('0xf')](_0x261a('0xb'),auth[_0x261a('0xa')](),controller['destroy']);module[_0x261a('0x10')]=router; \ No newline at end of file +var _0x32fd=['/:id','update','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','post','put'];(function(_0x8a4b15,_0x9fa7c0){var _0x1c604c=function(_0x5f41f8){while(--_0x5f41f8){_0x8a4b15['push'](_0x8a4b15['shift']());}};_0x1c604c(++_0x9fa7c0);}(_0x32fd,0xf4));var _0xd32f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x32fd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd32f('0x0'));var util=require(_0xd32f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd32f('0x2'));var router=express['Router']();var fs_extra=require(_0xd32f('0x3'));var auth=require(_0xd32f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd32f('0x5'));var controller=require(_0xd32f('0x6'));router[_0xd32f('0x7')]('/',auth[_0xd32f('0x8')](),controller[_0xd32f('0x9')]);router[_0xd32f('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xd32f('0xa')]);router[_0xd32f('0x7')]('/:id/fields',auth[_0xd32f('0x8')](),controller[_0xd32f('0xb')]);router[_0xd32f('0x7')](_0xd32f('0xc'),auth[_0xd32f('0x8')](),controller[_0xd32f('0xd')]);router[_0xd32f('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xd32f('0xe')]('/',auth[_0xd32f('0x8')](),controller['create']);router[_0xd32f('0xf')](_0xd32f('0x10'),auth[_0xd32f('0x8')](),controller[_0xd32f('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd32f('0x12')]);module[_0xd32f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 0767e27..4536556 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 _0x8a81=['exports','ENUM','lead','nothing','contact_lead','contact','STRING','sequelize'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x8a81,0x10f));var _0x18a8=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8a81[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0x18a8('0x0'));module[_0x18a8('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x18a8('0x2')](_0x18a8('0x3'),'contact',_0x18a8('0x4')),'defaultValue':_0x18a8('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x18a8('0x5'),_0x18a8('0x6'),_0x18a8('0x3')),'defaultValue':_0x18a8('0x5')},'description':{'type':Sequelize[_0x18a8('0x7')]}}; \ No newline at end of file +var _0xce14=['lead','contact','ENUM','contact_lead','STRING','sequelize','exports'];(function(_0x4c03ea,_0x3465be){var _0x7a6922=function(_0xd50354){while(--_0xd50354){_0x4c03ea['push'](_0x4c03ea['shift']());}};_0x7a6922(++_0x3465be);}(_0xce14,0x124));var _0x4ce1=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xce14[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x4ce1('0x0'));module[_0x4ce1('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize['ENUM'](_0x4ce1('0x2'),_0x4ce1('0x3'),'nothing'),'defaultValue':_0x4ce1('0x2')},'moduleSearch':{'type':Sequelize[_0x4ce1('0x4')](_0x4ce1('0x5'),_0x4ce1('0x3'),_0x4ce1('0x2')),'defaultValue':_0x4ce1('0x5')},'description':{'type':Sequelize[_0x4ce1('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 37bbcc3..33f8032 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 _0x908c=['eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','apply','reject','save','update','then','end','error','name','send','index','map','rawAttributes','type','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','options','ZohoConfiguration','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','destroy','getFields','keys','ZohoField','findOne','getSubjects','getDescriptions'];(function(_0xac0d3,_0x3d1441){var _0x277107=function(_0x3fc977){while(--_0x3fc977){_0xac0d3['push'](_0xac0d3['shift']());}};_0x277107(++_0x3d1441);}(_0x908c,0x17c));var _0xc908=function(_0x37e750,_0x4141e6){_0x37e750=_0x37e750-0x0;var _0x3deb1d=_0x908c[_0x37e750];return _0x3deb1d;};'use strict';var emlformat=require(_0xc908('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc908('0x1'));var jsonpatch=require(_0xc908('0x2'));var rp=require('request-promise');var moment=require(_0xc908('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc908('0x4'));var util=require('util');var path=require(_0xc908('0x5'));var sox=require(_0xc908('0x6'));var csv=require(_0xc908('0x7'));var ejs=require(_0xc908('0x8'));var fs=require('fs');var fs_extra=require(_0xc908('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc908('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc908('0xb'));var toCsv=require(_0xc908('0x7'));var querystring=require(_0xc908('0xc'));var Papa=require('papaparse');var Redis=require(_0xc908('0xd'));var authService=require(_0xc908('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc908('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc908('0x10'))(_0xc908('0x11'));var utils=require(_0xc908('0x12'));var config=require(_0xc908('0x13'));var licenseUtil=require(_0xc908('0x14'));var db=require(_0xc908('0x15'))['db'];function respondWithStatusCode(_0x4fcd01,_0xdb63db){_0xdb63db=_0xdb63db||0xcc;return function(_0x343e00){if(_0x343e00){return _0x4fcd01[_0xc908('0x16')](_0xdb63db);}return _0x4fcd01[_0xc908('0x17')](_0xdb63db)['end']();};}function respondWithResult(_0x4c277a,_0x42255f){_0x42255f=_0x42255f||0xc8;return function(_0xe13019){if(_0xe13019){return _0x4c277a[_0xc908('0x17')](_0x42255f)[_0xc908('0x18')](_0xe13019);}};}function respondWithFilteredResult(_0x4e32d6,_0x5eeb0b){return function(_0x2163ad){if(_0x2163ad){var _0x3d1ddb=typeof _0x5eeb0b[_0xc908('0x19')]==='undefined'&&typeof _0x5eeb0b['limit']===_0xc908('0x1a');var _0x138969=_0x2163ad[_0xc908('0x1b')];var _0xa63be4=_0x3d1ddb?0x0:_0x5eeb0b['offset'];var _0x446976=_0x3d1ddb?_0x2163ad[_0xc908('0x1b')]:_0x5eeb0b[_0xc908('0x19')]+_0x5eeb0b['limit'];var _0x42f564;if(_0x446976>=_0x138969){_0x446976=_0x138969;_0x42f564=0xc8;}else{_0x42f564=0xce;}_0x4e32d6[_0xc908('0x17')](_0x42f564);return _0x4e32d6['set']('Content-Range',_0xa63be4+'-'+_0x446976+'/'+_0x138969)[_0xc908('0x18')](_0x2163ad);}return null;};}function patchUpdates(_0x2e6c23){return function(_0x4f1e5a){try{jsonpatch[_0xc908('0x1c')](_0x4f1e5a,_0x2e6c23,!![]);}catch(_0x1e3d55){return BPromise[_0xc908('0x1d')](_0x1e3d55);}return _0x4f1e5a[_0xc908('0x1e')]();};}function saveUpdates(_0x5e5e97,_0x3e9a1f){return function(_0x24a89e){if(_0x24a89e){return _0x24a89e[_0xc908('0x1f')](_0x5e5e97)[_0xc908('0x20')](function(_0x55abb7){return _0x55abb7;});}return null;};}function removeEntity(_0x177fc2,_0x20aff6){return function(_0x283ec4){if(_0x283ec4){return _0x283ec4['destroy']()['then'](function(){_0x177fc2['status'](0xcc)[_0xc908('0x21')]();});}};}function handleEntityNotFound(_0x3402d1,_0x3ff11a){return function(_0x248a55){if(!_0x248a55){_0x3402d1[_0xc908('0x16')](0x194);}return _0x248a55;};}function handleError(_0x1601a4,_0x5bd464){_0x5bd464=_0x5bd464||0x1f4;return function(_0x28cbc4){logger[_0xc908('0x22')](_0x28cbc4['stack']);if(_0x28cbc4[_0xc908('0x23')]){delete _0x28cbc4['name'];}_0x1601a4[_0xc908('0x17')](_0x5bd464)[_0xc908('0x24')](_0x28cbc4);};}exports[_0xc908('0x25')]=function(_0x154801,_0x33da4f){var _0x2ced1e={},_0x64f39={},_0x40560d={'count':0x0,'rows':[]};var _0x1b8feb=_[_0xc908('0x26')](db['ZohoConfiguration'][_0xc908('0x27')],function(_0x52019c){return{'name':_0x52019c['fieldName'],'type':_0x52019c[_0xc908('0x28')]['key']};});_0x64f39[_0xc908('0x29')]=_[_0xc908('0x26')](_0x1b8feb,_0xc908('0x23'));_0x64f39['query']=_['keys'](_0x154801['query']);_0x64f39['filters']=_[_0xc908('0x2a')](_0x64f39[_0xc908('0x29')],_0x64f39[_0xc908('0x2b')]);_0x2ced1e[_0xc908('0x2c')]=_[_0xc908('0x2a')](_0x64f39['model'],qs[_0xc908('0x2d')](_0x154801[_0xc908('0x2b')][_0xc908('0x2d')]));_0x2ced1e[_0xc908('0x2c')]=_0x2ced1e[_0xc908('0x2c')][_0xc908('0x2e')]?_0x2ced1e['attributes']:_0x64f39[_0xc908('0x29')];if(!_0x154801[_0xc908('0x2b')][_0xc908('0x2f')](_0xc908('0x30'))){_0x2ced1e[_0xc908('0x31')]=qs[_0xc908('0x31')](_0x154801[_0xc908('0x2b')][_0xc908('0x31')]);_0x2ced1e['offset']=qs['offset'](_0x154801[_0xc908('0x2b')]['offset']);}_0x2ced1e[_0xc908('0x32')]=qs['sort'](_0x154801[_0xc908('0x2b')][_0xc908('0x33')]);_0x2ced1e[_0xc908('0x34')]=qs[_0xc908('0x35')](_[_0xc908('0x36')](_0x154801[_0xc908('0x2b')],_0x64f39[_0xc908('0x35')]),_0x1b8feb);if(_0x154801[_0xc908('0x2b')][_0xc908('0x37')]){_0x2ced1e['where']=_['merge'](_0x2ced1e['where'],{'$or':_['map'](_0x1b8feb,function(_0x27583e){if(_0x27583e[_0xc908('0x28')]!=='VIRTUAL'){var _0x344f0e={};_0x344f0e[_0x27583e['name']]={'$like':'%'+_0x154801[_0xc908('0x2b')][_0xc908('0x37')]+'%'};return _0x344f0e;}})});}_0x2ced1e=_['merge']({},_0x2ced1e,_0x154801[_0xc908('0x38')]);var _0x125c95={'where':_0x2ced1e[_0xc908('0x34')]};return db[_0xc908('0x39')]['count'](_0x125c95)['then'](function(_0x267733){_0x40560d[_0xc908('0x1b')]=_0x267733;if(_0x154801[_0xc908('0x2b')][_0xc908('0x3a')]){_0x2ced1e['include']=[{'all':!![]}];}return db[_0xc908('0x39')][_0xc908('0x3b')](_0x2ced1e);})[_0xc908('0x20')](function(_0x2392f2){_0x40560d[_0xc908('0x3c')]=_0x2392f2;return _0x40560d;})['then'](respondWithFilteredResult(_0x33da4f,_0x2ced1e))[_0xc908('0x3d')](handleError(_0x33da4f,null));};exports[_0xc908('0x3e')]=function(_0x224523,_0x133a51){var _0x5dd9fb={'raw':![],'where':{'id':_0x224523[_0xc908('0x3f')]['id']}},_0x9c52fc={};_0x9c52fc[_0xc908('0x29')]=_['keys'](db[_0xc908('0x39')][_0xc908('0x27')]);_0x9c52fc[_0xc908('0x2b')]=_['keys'](_0x224523[_0xc908('0x2b')]);_0x9c52fc['filters']=_[_0xc908('0x2a')](_0x9c52fc[_0xc908('0x29')],_0x9c52fc['query']);_0x5dd9fb[_0xc908('0x2c')]=_[_0xc908('0x2a')](_0x9c52fc[_0xc908('0x29')],qs[_0xc908('0x2d')](_0x224523[_0xc908('0x2b')]['fields']));_0x5dd9fb[_0xc908('0x2c')]=_0x5dd9fb[_0xc908('0x2c')][_0xc908('0x2e')]?_0x5dd9fb['attributes']:_0x9c52fc[_0xc908('0x29')];if(_0x224523[_0xc908('0x2b')]['includeAll']){_0x5dd9fb[_0xc908('0x40')]=[{'all':!![]}];}_0x5dd9fb=_[_0xc908('0x41')]({},_0x5dd9fb,_0x224523[_0xc908('0x38')]);return db[_0xc908('0x39')][_0xc908('0x42')](_0x5dd9fb)['then'](handleEntityNotFound(_0x133a51,null))['then'](respondWithResult(_0x133a51,null))[_0xc908('0x3d')](handleError(_0x133a51,null));};exports[_0xc908('0x43')]=function(_0x3490d7,_0x4df4b9){return db[_0xc908('0x39')][_0xc908('0x43')](_0x3490d7[_0xc908('0x44')],{})[_0xc908('0x20')](respondWithResult(_0x4df4b9,0xc9))[_0xc908('0x3d')](handleError(_0x4df4b9,null));};exports[_0xc908('0x1f')]=function(_0x4663d5,_0xafbf5a){if(_0x4663d5[_0xc908('0x44')]['id']){delete _0x4663d5[_0xc908('0x44')]['id'];}return db['ZohoConfiguration'][_0xc908('0x42')]({'where':{'id':_0x4663d5[_0xc908('0x3f')]['id']}})['then'](handleEntityNotFound(_0xafbf5a,null))[_0xc908('0x20')](saveUpdates(_0x4663d5[_0xc908('0x44')],null))['then'](respondWithResult(_0xafbf5a,null))['catch'](handleError(_0xafbf5a,null));};exports[_0xc908('0x45')]=function(_0x15602b,_0x213215){return db[_0xc908('0x39')]['find']({'where':{'id':_0x15602b['params']['id']}})['then'](handleEntityNotFound(_0x213215,null))[_0xc908('0x20')](removeEntity(_0x213215,null))[_0xc908('0x3d')](handleError(_0x213215,null));};exports[_0xc908('0x46')]=function(_0x550a95,_0x17199d,_0x27da19){var _0x36da2f={};var _0x4b286d={};var _0x4dc517;var _0xb7d903;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x550a95['params']['id']}})[_0xc908('0x20')](handleEntityNotFound(_0x17199d,null))[_0xc908('0x20')](function(_0x284877){if(_0x284877){_0x4dc517=_0x284877;_0x4b286d[_0xc908('0x29')]=_[_0xc908('0x47')](db[_0xc908('0x48')][_0xc908('0x27')]);_0x4b286d['query']=_[_0xc908('0x47')](_0x550a95[_0xc908('0x2b')]);_0x4b286d[_0xc908('0x35')]=_[_0xc908('0x2a')](_0x4b286d['model'],_0x4b286d[_0xc908('0x2b')]);_0x36da2f[_0xc908('0x2c')]=_[_0xc908('0x2a')](_0x4b286d['model'],qs[_0xc908('0x2d')](_0x550a95['query'][_0xc908('0x2d')]));_0x36da2f['attributes']=_0x36da2f[_0xc908('0x2c')][_0xc908('0x2e')]?_0x36da2f[_0xc908('0x2c')]:_0x4b286d[_0xc908('0x29')];_0x36da2f[_0xc908('0x32')]=qs[_0xc908('0x33')](_0x550a95[_0xc908('0x2b')][_0xc908('0x33')]);_0x36da2f[_0xc908('0x34')]=qs[_0xc908('0x35')](_[_0xc908('0x36')](_0x550a95[_0xc908('0x2b')],_0x4b286d[_0xc908('0x35')]));if(_0x550a95['query'][_0xc908('0x37')]){_0x36da2f[_0xc908('0x34')]=_[_0xc908('0x41')](_0x36da2f['where'],{'$or':_[_0xc908('0x26')](_0x36da2f[_0xc908('0x2c')],function(_0x42dc9b){var _0x2280d2={};_0x2280d2[_0x42dc9b]={'$like':'%'+_0x550a95['query'][_0xc908('0x37')]+'%'};return _0x2280d2;})});}_0x36da2f=_['merge']({},_0x36da2f,_0x550a95[_0xc908('0x38')]);return _0x4dc517[_0xc908('0x46')](_0x36da2f);}})['then'](function(_0x5a1d19){if(_0x5a1d19){_0xb7d903=_0x5a1d19[_0xc908('0x2e')];if(!_0x550a95[_0xc908('0x2b')][_0xc908('0x2f')](_0xc908('0x30'))){_0x36da2f['limit']=qs['limit'](_0x550a95[_0xc908('0x2b')][_0xc908('0x31')]);_0x36da2f[_0xc908('0x19')]=qs[_0xc908('0x19')](_0x550a95['query']['offset']);}return _0x4dc517['getFields'](_0x36da2f);}})[_0xc908('0x20')](function(_0x18b396){if(_0x18b396){return _0x18b396?{'count':_0xb7d903,'rows':_0x18b396}:null;}})[_0xc908('0x20')](respondWithResult(_0x17199d,null))[_0xc908('0x3d')](handleError(_0x17199d,null));};exports['getSubjects']=function(_0x5d6c35,_0x2aa2ca,_0x202689){var _0x3f8555={};var _0x2eeae6={};var _0x50f51b;var _0xf32e28;return db[_0xc908('0x39')][_0xc908('0x49')]({'where':{'id':_0x5d6c35[_0xc908('0x3f')]['id']}})[_0xc908('0x20')](handleEntityNotFound(_0x2aa2ca,null))[_0xc908('0x20')](function(_0x538f8a){if(_0x538f8a){_0x50f51b=_0x538f8a;_0x2eeae6[_0xc908('0x29')]=_['keys'](db[_0xc908('0x48')][_0xc908('0x27')]);_0x2eeae6[_0xc908('0x2b')]=_[_0xc908('0x47')](_0x5d6c35[_0xc908('0x2b')]);_0x2eeae6[_0xc908('0x35')]=_[_0xc908('0x2a')](_0x2eeae6[_0xc908('0x29')],_0x2eeae6['query']);_0x3f8555[_0xc908('0x2c')]=_[_0xc908('0x2a')](_0x2eeae6['model'],qs[_0xc908('0x2d')](_0x5d6c35[_0xc908('0x2b')][_0xc908('0x2d')]));_0x3f8555[_0xc908('0x2c')]=_0x3f8555[_0xc908('0x2c')][_0xc908('0x2e')]?_0x3f8555['attributes']:_0x2eeae6['model'];_0x3f8555[_0xc908('0x32')]=qs[_0xc908('0x33')](_0x5d6c35[_0xc908('0x2b')][_0xc908('0x33')]);_0x3f8555[_0xc908('0x34')]=qs[_0xc908('0x35')](_[_0xc908('0x36')](_0x5d6c35[_0xc908('0x2b')],_0x2eeae6[_0xc908('0x35')]));if(_0x5d6c35[_0xc908('0x2b')][_0xc908('0x37')]){_0x3f8555['where']=_[_0xc908('0x41')](_0x3f8555[_0xc908('0x34')],{'$or':_[_0xc908('0x26')](_0x3f8555[_0xc908('0x2c')],function(_0x348a5c){var _0x28a998={};_0x28a998[_0x348a5c]={'$like':'%'+_0x5d6c35[_0xc908('0x2b')]['filter']+'%'};return _0x28a998;})});}_0x3f8555=_['merge']({},_0x3f8555,_0x5d6c35[_0xc908('0x38')]);return _0x50f51b[_0xc908('0x4a')](_0x3f8555);}})[_0xc908('0x20')](function(_0x33e8d1){if(_0x33e8d1){_0xf32e28=_0x33e8d1['length'];if(!_0x5d6c35[_0xc908('0x2b')][_0xc908('0x2f')](_0xc908('0x30'))){_0x3f8555[_0xc908('0x31')]=qs['limit'](_0x5d6c35[_0xc908('0x2b')][_0xc908('0x31')]);_0x3f8555['offset']=qs['offset'](_0x5d6c35[_0xc908('0x2b')][_0xc908('0x19')]);}return _0x50f51b[_0xc908('0x4a')](_0x3f8555);}})[_0xc908('0x20')](function(_0x5b2ed5){if(_0x5b2ed5){return _0x5b2ed5?{'count':_0xf32e28,'rows':_0x5b2ed5}:null;}})[_0xc908('0x20')](respondWithResult(_0x2aa2ca,null))[_0xc908('0x3d')](handleError(_0x2aa2ca,null));};exports[_0xc908('0x4b')]=function(_0x5c0d81,_0x4a9981,_0x2a4a0e){var _0x4d9180={};var _0x4bbc23={};var _0x4e6ad8;var _0x2f53be;return db[_0xc908('0x39')]['findOne']({'where':{'id':_0x5c0d81[_0xc908('0x3f')]['id']}})[_0xc908('0x20')](handleEntityNotFound(_0x4a9981,null))['then'](function(_0x15a411){if(_0x15a411){_0x4e6ad8=_0x15a411;_0x4bbc23[_0xc908('0x29')]=_[_0xc908('0x47')](db['ZohoField']['rawAttributes']);_0x4bbc23[_0xc908('0x2b')]=_['keys'](_0x5c0d81[_0xc908('0x2b')]);_0x4bbc23['filters']=_[_0xc908('0x2a')](_0x4bbc23[_0xc908('0x29')],_0x4bbc23[_0xc908('0x2b')]);_0x4d9180[_0xc908('0x2c')]=_[_0xc908('0x2a')](_0x4bbc23[_0xc908('0x29')],qs[_0xc908('0x2d')](_0x5c0d81['query'][_0xc908('0x2d')]));_0x4d9180[_0xc908('0x2c')]=_0x4d9180[_0xc908('0x2c')][_0xc908('0x2e')]?_0x4d9180['attributes']:_0x4bbc23['model'];_0x4d9180[_0xc908('0x32')]=qs[_0xc908('0x33')](_0x5c0d81[_0xc908('0x2b')][_0xc908('0x33')]);_0x4d9180[_0xc908('0x34')]=qs['filters'](_[_0xc908('0x36')](_0x5c0d81[_0xc908('0x2b')],_0x4bbc23[_0xc908('0x35')]));if(_0x5c0d81[_0xc908('0x2b')][_0xc908('0x37')]){_0x4d9180[_0xc908('0x34')]=_[_0xc908('0x41')](_0x4d9180['where'],{'$or':_[_0xc908('0x26')](_0x4d9180[_0xc908('0x2c')],function(_0x2c7cd9){var _0xa0336a={};_0xa0336a[_0x2c7cd9]={'$like':'%'+_0x5c0d81[_0xc908('0x2b')][_0xc908('0x37')]+'%'};return _0xa0336a;})});}_0x4d9180=_[_0xc908('0x41')]({},_0x4d9180,_0x5c0d81['options']);return _0x4e6ad8[_0xc908('0x4b')](_0x4d9180);}})[_0xc908('0x20')](function(_0x5e9a53){if(_0x5e9a53){_0x2f53be=_0x5e9a53['length'];if(!_0x5c0d81['query'][_0xc908('0x2f')](_0xc908('0x30'))){_0x4d9180[_0xc908('0x31')]=qs[_0xc908('0x31')](_0x5c0d81[_0xc908('0x2b')]['limit']);_0x4d9180[_0xc908('0x19')]=qs[_0xc908('0x19')](_0x5c0d81[_0xc908('0x2b')][_0xc908('0x19')]);}return _0x4e6ad8['getDescriptions'](_0x4d9180);}})['then'](function(_0x19e9f6){if(_0x19e9f6){return _0x19e9f6?{'count':_0x2f53be,'rows':_0x19e9f6}:null;}})['then'](respondWithResult(_0x4a9981,null))['catch'](handleError(_0x4a9981,null));}; \ No newline at end of file +var _0xa704=['merge','options','includeAll','include','findAll','catch','show','find','body','params','findOne','ZohoField','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter'];(function(_0x246148,_0x1358ee){var _0x453d94=function(_0x59920e){while(--_0x59920e){_0x246148['push'](_0x246148['shift']());}};_0x453d94(++_0x1358ee);}(_0xa704,0xf6));var _0x4a70=function(_0x568b93,_0x1a7f8b){_0x568b93=_0x568b93-0x0;var _0xffd843=_0xa704[_0x568b93];return _0xffd843;};'use strict';var emlformat=require(_0x4a70('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a70('0x1'));var jsonpatch=require(_0x4a70('0x2'));var rp=require(_0x4a70('0x3'));var moment=require(_0x4a70('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4a70('0x5'));var path=require(_0x4a70('0x6'));var sox=require(_0x4a70('0x7'));var csv=require(_0x4a70('0x8'));var ejs=require(_0x4a70('0x9'));var fs=require('fs');var fs_extra=require(_0x4a70('0xa'));var _=require(_0x4a70('0xb'));var squel=require(_0x4a70('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4a70('0xd'));var toCsv=require(_0x4a70('0x8'));var querystring=require(_0x4a70('0xe'));var Papa=require(_0x4a70('0xf'));var Redis=require(_0x4a70('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4a70('0x11'));var as=require(_0x4a70('0x12'));var hardwareService=require(_0x4a70('0x13'));var logger=require('../../config/logger')(_0x4a70('0x14'));var utils=require(_0x4a70('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4a70('0x16'));var db=require(_0x4a70('0x17'))['db'];function respondWithStatusCode(_0xf579ca,_0xf82933){_0xf82933=_0xf82933||0xcc;return function(_0x5be83c){if(_0x5be83c){return _0xf579ca[_0x4a70('0x18')](_0xf82933);}return _0xf579ca['status'](_0xf82933)[_0x4a70('0x19')]();};}function respondWithResult(_0x425541,_0x20dc96){_0x20dc96=_0x20dc96||0xc8;return function(_0x2db36f){if(_0x2db36f){return _0x425541[_0x4a70('0x1a')](_0x20dc96)[_0x4a70('0x1b')](_0x2db36f);}};}function respondWithFilteredResult(_0x2417d0,_0x36a37e){return function(_0xe28ff7){if(_0xe28ff7){var _0x2a332c=typeof _0x36a37e[_0x4a70('0x1c')]===_0x4a70('0x1d')&&typeof _0x36a37e['limit']==='undefined';var _0x3fdf4d=_0xe28ff7[_0x4a70('0x1e')];var _0x34af09=_0x2a332c?0x0:_0x36a37e[_0x4a70('0x1c')];var _0x1f03f9=_0x2a332c?_0xe28ff7[_0x4a70('0x1e')]:_0x36a37e[_0x4a70('0x1c')]+_0x36a37e['limit'];var _0xf54146;if(_0x1f03f9>=_0x3fdf4d){_0x1f03f9=_0x3fdf4d;_0xf54146=0xc8;}else{_0xf54146=0xce;}_0x2417d0['status'](_0xf54146);return _0x2417d0[_0x4a70('0x1f')](_0x4a70('0x20'),_0x34af09+'-'+_0x1f03f9+'/'+_0x3fdf4d)['json'](_0xe28ff7);}return null;};}function patchUpdates(_0x4bda10){return function(_0x40f12c){try{jsonpatch[_0x4a70('0x21')](_0x40f12c,_0x4bda10,!![]);}catch(_0x2e193e){return BPromise['reject'](_0x2e193e);}return _0x40f12c[_0x4a70('0x22')]();};}function saveUpdates(_0x28f2a7,_0x220bf8){return function(_0x2c4d1a){if(_0x2c4d1a){return _0x2c4d1a[_0x4a70('0x23')](_0x28f2a7)[_0x4a70('0x24')](function(_0x2cb4b2){return _0x2cb4b2;});}return null;};}function removeEntity(_0x1a115c,_0x17c7d1){return function(_0x16c2a6){if(_0x16c2a6){return _0x16c2a6['destroy']()['then'](function(){_0x1a115c['status'](0xcc)[_0x4a70('0x19')]();});}};}function handleEntityNotFound(_0x496db0,_0x5f2e13){return function(_0x44e389){if(!_0x44e389){_0x496db0['sendStatus'](0x194);}return _0x44e389;};}function handleError(_0x45b61f,_0x194319){_0x194319=_0x194319||0x1f4;return function(_0xd6a57){logger['error'](_0xd6a57['stack']);if(_0xd6a57[_0x4a70('0x25')]){delete _0xd6a57['name'];}_0x45b61f['status'](_0x194319)[_0x4a70('0x26')](_0xd6a57);};}exports[_0x4a70('0x27')]=function(_0x2bb1d7,_0x3ed192){var _0xa7676d={},_0x2cb84b={},_0x5eb6ba={'count':0x0,'rows':[]};var _0x332a96=_[_0x4a70('0x28')](db[_0x4a70('0x29')][_0x4a70('0x2a')],function(_0xefa7dc){return{'name':_0xefa7dc[_0x4a70('0x2b')],'type':_0xefa7dc[_0x4a70('0x2c')][_0x4a70('0x2d')]};});_0x2cb84b[_0x4a70('0x2e')]=_['map'](_0x332a96,_0x4a70('0x25'));_0x2cb84b[_0x4a70('0x2f')]=_[_0x4a70('0x30')](_0x2bb1d7[_0x4a70('0x2f')]);_0x2cb84b[_0x4a70('0x31')]=_[_0x4a70('0x32')](_0x2cb84b[_0x4a70('0x2e')],_0x2cb84b[_0x4a70('0x2f')]);_0xa7676d['attributes']=_[_0x4a70('0x32')](_0x2cb84b[_0x4a70('0x2e')],qs[_0x4a70('0x33')](_0x2bb1d7[_0x4a70('0x2f')][_0x4a70('0x33')]));_0xa7676d[_0x4a70('0x34')]=_0xa7676d['attributes'][_0x4a70('0x35')]?_0xa7676d[_0x4a70('0x34')]:_0x2cb84b[_0x4a70('0x2e')];if(!_0x2bb1d7['query'][_0x4a70('0x36')](_0x4a70('0x37'))){_0xa7676d[_0x4a70('0x38')]=qs[_0x4a70('0x38')](_0x2bb1d7[_0x4a70('0x2f')]['limit']);_0xa7676d[_0x4a70('0x1c')]=qs[_0x4a70('0x1c')](_0x2bb1d7['query']['offset']);}_0xa7676d[_0x4a70('0x39')]=qs[_0x4a70('0x3a')](_0x2bb1d7['query'][_0x4a70('0x3a')]);_0xa7676d[_0x4a70('0x3b')]=qs['filters'](_[_0x4a70('0x3c')](_0x2bb1d7['query'],_0x2cb84b[_0x4a70('0x31')]),_0x332a96);if(_0x2bb1d7[_0x4a70('0x2f')][_0x4a70('0x3d')]){_0xa7676d[_0x4a70('0x3b')]=_[_0x4a70('0x3e')](_0xa7676d[_0x4a70('0x3b')],{'$or':_[_0x4a70('0x28')](_0x332a96,function(_0x427aa8){if(_0x427aa8['type']!=='VIRTUAL'){var _0x15b108={};_0x15b108[_0x427aa8[_0x4a70('0x25')]]={'$like':'%'+_0x2bb1d7[_0x4a70('0x2f')][_0x4a70('0x3d')]+'%'};return _0x15b108;}})});}_0xa7676d=_[_0x4a70('0x3e')]({},_0xa7676d,_0x2bb1d7[_0x4a70('0x3f')]);var _0x4cd73a={'where':_0xa7676d['where']};return db[_0x4a70('0x29')][_0x4a70('0x1e')](_0x4cd73a)['then'](function(_0x3aef4a){_0x5eb6ba[_0x4a70('0x1e')]=_0x3aef4a;if(_0x2bb1d7['query'][_0x4a70('0x40')]){_0xa7676d[_0x4a70('0x41')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x4a70('0x42')](_0xa7676d);})[_0x4a70('0x24')](function(_0x4e21cc){_0x5eb6ba['rows']=_0x4e21cc;return _0x5eb6ba;})[_0x4a70('0x24')](respondWithFilteredResult(_0x3ed192,_0xa7676d))[_0x4a70('0x43')](handleError(_0x3ed192,null));};exports[_0x4a70('0x44')]=function(_0x514146,_0xe1503c){var _0x44fbf9={'raw':![],'where':{'id':_0x514146['params']['id']}},_0x5e95d2={};_0x5e95d2['model']=_[_0x4a70('0x30')](db[_0x4a70('0x29')][_0x4a70('0x2a')]);_0x5e95d2[_0x4a70('0x2f')]=_[_0x4a70('0x30')](_0x514146[_0x4a70('0x2f')]);_0x5e95d2['filters']=_[_0x4a70('0x32')](_0x5e95d2[_0x4a70('0x2e')],_0x5e95d2[_0x4a70('0x2f')]);_0x44fbf9[_0x4a70('0x34')]=_[_0x4a70('0x32')](_0x5e95d2[_0x4a70('0x2e')],qs[_0x4a70('0x33')](_0x514146[_0x4a70('0x2f')][_0x4a70('0x33')]));_0x44fbf9[_0x4a70('0x34')]=_0x44fbf9['attributes'][_0x4a70('0x35')]?_0x44fbf9[_0x4a70('0x34')]:_0x5e95d2[_0x4a70('0x2e')];if(_0x514146['query']['includeAll']){_0x44fbf9[_0x4a70('0x41')]=[{'all':!![]}];}_0x44fbf9=_[_0x4a70('0x3e')]({},_0x44fbf9,_0x514146[_0x4a70('0x3f')]);return db[_0x4a70('0x29')][_0x4a70('0x45')](_0x44fbf9)[_0x4a70('0x24')](handleEntityNotFound(_0xe1503c,null))[_0x4a70('0x24')](respondWithResult(_0xe1503c,null))['catch'](handleError(_0xe1503c,null));};exports['create']=function(_0x4e8dd0,_0xfeb2b6){return db[_0x4a70('0x29')]['create'](_0x4e8dd0[_0x4a70('0x46')],{})['then'](respondWithResult(_0xfeb2b6,0xc9))[_0x4a70('0x43')](handleError(_0xfeb2b6,null));};exports[_0x4a70('0x23')]=function(_0x1c02bf,_0x1dd011){if(_0x1c02bf[_0x4a70('0x46')]['id']){delete _0x1c02bf['body']['id'];}return db[_0x4a70('0x29')][_0x4a70('0x45')]({'where':{'id':_0x1c02bf[_0x4a70('0x47')]['id']}})[_0x4a70('0x24')](handleEntityNotFound(_0x1dd011,null))['then'](saveUpdates(_0x1c02bf[_0x4a70('0x46')],null))['then'](respondWithResult(_0x1dd011,null))[_0x4a70('0x43')](handleError(_0x1dd011,null));};exports['destroy']=function(_0x3ed3bd,_0x1bea7d){return db[_0x4a70('0x29')][_0x4a70('0x45')]({'where':{'id':_0x3ed3bd[_0x4a70('0x47')]['id']}})['then'](handleEntityNotFound(_0x1bea7d,null))[_0x4a70('0x24')](removeEntity(_0x1bea7d,null))[_0x4a70('0x43')](handleError(_0x1bea7d,null));};exports['getFields']=function(_0x387252,_0x247eac,_0x3a2a69){var _0x258d81={};var _0x1891e1={};var _0x14afee;var _0x36999b;return db[_0x4a70('0x29')][_0x4a70('0x48')]({'where':{'id':_0x387252[_0x4a70('0x47')]['id']}})[_0x4a70('0x24')](handleEntityNotFound(_0x247eac,null))[_0x4a70('0x24')](function(_0xe83ded){if(_0xe83ded){_0x14afee=_0xe83ded;_0x1891e1[_0x4a70('0x2e')]=_[_0x4a70('0x30')](db[_0x4a70('0x49')]['rawAttributes']);_0x1891e1['query']=_[_0x4a70('0x30')](_0x387252['query']);_0x1891e1[_0x4a70('0x31')]=_['intersection'](_0x1891e1[_0x4a70('0x2e')],_0x1891e1[_0x4a70('0x2f')]);_0x258d81[_0x4a70('0x34')]=_[_0x4a70('0x32')](_0x1891e1['model'],qs[_0x4a70('0x33')](_0x387252[_0x4a70('0x2f')]['fields']));_0x258d81[_0x4a70('0x34')]=_0x258d81['attributes'][_0x4a70('0x35')]?_0x258d81['attributes']:_0x1891e1[_0x4a70('0x2e')];_0x258d81[_0x4a70('0x39')]=qs[_0x4a70('0x3a')](_0x387252[_0x4a70('0x2f')]['sort']);_0x258d81['where']=qs['filters'](_[_0x4a70('0x3c')](_0x387252[_0x4a70('0x2f')],_0x1891e1['filters']));if(_0x387252['query'][_0x4a70('0x3d')]){_0x258d81[_0x4a70('0x3b')]=_[_0x4a70('0x3e')](_0x258d81['where'],{'$or':_[_0x4a70('0x28')](_0x258d81[_0x4a70('0x34')],function(_0x473528){var _0x1e11de={};_0x1e11de[_0x473528]={'$like':'%'+_0x387252[_0x4a70('0x2f')][_0x4a70('0x3d')]+'%'};return _0x1e11de;})});}_0x258d81=_[_0x4a70('0x3e')]({},_0x258d81,_0x387252[_0x4a70('0x3f')]);return _0x14afee[_0x4a70('0x4a')](_0x258d81);}})[_0x4a70('0x24')](function(_0x4952cd){if(_0x4952cd){_0x36999b=_0x4952cd[_0x4a70('0x35')];if(!_0x387252[_0x4a70('0x2f')][_0x4a70('0x36')](_0x4a70('0x37'))){_0x258d81[_0x4a70('0x38')]=qs[_0x4a70('0x38')](_0x387252[_0x4a70('0x2f')][_0x4a70('0x38')]);_0x258d81[_0x4a70('0x1c')]=qs[_0x4a70('0x1c')](_0x387252[_0x4a70('0x2f')]['offset']);}return _0x14afee['getFields'](_0x258d81);}})['then'](function(_0xbf1cb){if(_0xbf1cb){return _0xbf1cb?{'count':_0x36999b,'rows':_0xbf1cb}:null;}})[_0x4a70('0x24')](respondWithResult(_0x247eac,null))[_0x4a70('0x43')](handleError(_0x247eac,null));};exports['getSubjects']=function(_0x42d06d,_0x27a1fe,_0x4b8118){var _0x2893d5={};var _0x76a79d={};var _0x166992;var _0x3af313;return db[_0x4a70('0x29')][_0x4a70('0x48')]({'where':{'id':_0x42d06d[_0x4a70('0x47')]['id']}})[_0x4a70('0x24')](handleEntityNotFound(_0x27a1fe,null))[_0x4a70('0x24')](function(_0x527f86){if(_0x527f86){_0x166992=_0x527f86;_0x76a79d['model']=_[_0x4a70('0x30')](db[_0x4a70('0x49')]['rawAttributes']);_0x76a79d[_0x4a70('0x2f')]=_[_0x4a70('0x30')](_0x42d06d['query']);_0x76a79d[_0x4a70('0x31')]=_[_0x4a70('0x32')](_0x76a79d[_0x4a70('0x2e')],_0x76a79d[_0x4a70('0x2f')]);_0x2893d5['attributes']=_['intersection'](_0x76a79d[_0x4a70('0x2e')],qs['fields'](_0x42d06d[_0x4a70('0x2f')][_0x4a70('0x33')]));_0x2893d5[_0x4a70('0x34')]=_0x2893d5[_0x4a70('0x34')][_0x4a70('0x35')]?_0x2893d5[_0x4a70('0x34')]:_0x76a79d[_0x4a70('0x2e')];_0x2893d5[_0x4a70('0x39')]=qs[_0x4a70('0x3a')](_0x42d06d['query'][_0x4a70('0x3a')]);_0x2893d5[_0x4a70('0x3b')]=qs[_0x4a70('0x31')](_[_0x4a70('0x3c')](_0x42d06d[_0x4a70('0x2f')],_0x76a79d[_0x4a70('0x31')]));if(_0x42d06d['query'][_0x4a70('0x3d')]){_0x2893d5[_0x4a70('0x3b')]=_[_0x4a70('0x3e')](_0x2893d5[_0x4a70('0x3b')],{'$or':_['map'](_0x2893d5[_0x4a70('0x34')],function(_0x504fe0){var _0x117147={};_0x117147[_0x504fe0]={'$like':'%'+_0x42d06d[_0x4a70('0x2f')][_0x4a70('0x3d')]+'%'};return _0x117147;})});}_0x2893d5=_[_0x4a70('0x3e')]({},_0x2893d5,_0x42d06d[_0x4a70('0x3f')]);return _0x166992[_0x4a70('0x4b')](_0x2893d5);}})['then'](function(_0xcf1550){if(_0xcf1550){_0x3af313=_0xcf1550[_0x4a70('0x35')];if(!_0x42d06d[_0x4a70('0x2f')][_0x4a70('0x36')](_0x4a70('0x37'))){_0x2893d5[_0x4a70('0x38')]=qs[_0x4a70('0x38')](_0x42d06d[_0x4a70('0x2f')][_0x4a70('0x38')]);_0x2893d5[_0x4a70('0x1c')]=qs['offset'](_0x42d06d['query'][_0x4a70('0x1c')]);}return _0x166992['getSubjects'](_0x2893d5);}})[_0x4a70('0x24')](function(_0x1471e4){if(_0x1471e4){return _0x1471e4?{'count':_0x3af313,'rows':_0x1471e4}:null;}})[_0x4a70('0x24')](respondWithResult(_0x27a1fe,null))['catch'](handleError(_0x27a1fe,null));};exports[_0x4a70('0x4c')]=function(_0x58075,_0x1a3186,_0x56cf2f){var _0x37eadb={};var _0x41ad33={};var _0x259a79;var _0x5ea9e4;return db[_0x4a70('0x29')][_0x4a70('0x48')]({'where':{'id':_0x58075[_0x4a70('0x47')]['id']}})[_0x4a70('0x24')](handleEntityNotFound(_0x1a3186,null))[_0x4a70('0x24')](function(_0x516561){if(_0x516561){_0x259a79=_0x516561;_0x41ad33[_0x4a70('0x2e')]=_[_0x4a70('0x30')](db['ZohoField'][_0x4a70('0x2a')]);_0x41ad33[_0x4a70('0x2f')]=_[_0x4a70('0x30')](_0x58075[_0x4a70('0x2f')]);_0x41ad33['filters']=_[_0x4a70('0x32')](_0x41ad33[_0x4a70('0x2e')],_0x41ad33['query']);_0x37eadb[_0x4a70('0x34')]=_[_0x4a70('0x32')](_0x41ad33[_0x4a70('0x2e')],qs['fields'](_0x58075[_0x4a70('0x2f')][_0x4a70('0x33')]));_0x37eadb[_0x4a70('0x34')]=_0x37eadb[_0x4a70('0x34')][_0x4a70('0x35')]?_0x37eadb['attributes']:_0x41ad33[_0x4a70('0x2e')];_0x37eadb['order']=qs['sort'](_0x58075[_0x4a70('0x2f')][_0x4a70('0x3a')]);_0x37eadb[_0x4a70('0x3b')]=qs[_0x4a70('0x31')](_[_0x4a70('0x3c')](_0x58075[_0x4a70('0x2f')],_0x41ad33['filters']));if(_0x58075['query'][_0x4a70('0x3d')]){_0x37eadb[_0x4a70('0x3b')]=_[_0x4a70('0x3e')](_0x37eadb[_0x4a70('0x3b')],{'$or':_['map'](_0x37eadb['attributes'],function(_0x47ed67){var _0xd1bf53={};_0xd1bf53[_0x47ed67]={'$like':'%'+_0x58075[_0x4a70('0x2f')]['filter']+'%'};return _0xd1bf53;})});}_0x37eadb=_[_0x4a70('0x3e')]({},_0x37eadb,_0x58075[_0x4a70('0x3f')]);return _0x259a79[_0x4a70('0x4c')](_0x37eadb);}})['then'](function(_0x445535){if(_0x445535){_0x5ea9e4=_0x445535[_0x4a70('0x35')];if(!_0x58075['query'][_0x4a70('0x36')](_0x4a70('0x37'))){_0x37eadb[_0x4a70('0x38')]=qs[_0x4a70('0x38')](_0x58075[_0x4a70('0x2f')][_0x4a70('0x38')]);_0x37eadb['offset']=qs['offset'](_0x58075[_0x4a70('0x2f')][_0x4a70('0x1c')]);}return _0x259a79[_0x4a70('0x4c')](_0x37eadb);}})[_0x4a70('0x24')](function(_0x1d038c){if(_0x1d038c){return _0x1d038c?{'count':_0x5ea9e4,'rows':_0x1d038c}:null;}})[_0x4a70('0x24')](respondWithResult(_0x1a3186,null))['catch'](handleError(_0x1a3186,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 033883a..aad6d60 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 _0xa56b=['path','rimraf','int_zoho_configurations','util','../../config/logger','api','bluebird'];(function(_0x90b27e,_0x4895a6){var _0x44b746=function(_0x16630f){while(--_0x16630f){_0x90b27e['push'](_0x90b27e['shift']());}};_0x44b746(++_0x4895a6);}(_0xa56b,0xc0));var _0xba56=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xa56b[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0xba56('0x0'));var logger=require(_0xba56('0x1'))(_0xba56('0x2'));var moment=require('moment');var BPromise=require(_0xba56('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba56('0x4'));var rimraf=require(_0xba56('0x5'));var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x4fc72d,_0x18c2cc){return _0x4fc72d['define']('ZohoConfiguration',attributes,{'tableName':_0xba56('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed2c=['int_zoho_configurations','lodash','api','moment','request-promise','path','rimraf','exports','define'];(function(_0x4b97d9,_0x4c508e){var _0x511b39=function(_0x30db55){while(--_0x30db55){_0x4b97d9['push'](_0x4b97d9['shift']());}};_0x511b39(++_0x4c508e);}(_0xed2c,0xd9));var _0xced2=function(_0x3b6cc7,_0x5df0c1){_0x3b6cc7=_0x3b6cc7-0x0;var _0x37f564=_0xed2c[_0x3b6cc7];return _0x37f564;};'use strict';var _=require(_0xced2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xced2('0x1'));var moment=require(_0xced2('0x2'));var BPromise=require('bluebird');var rp=require(_0xced2('0x3'));var fs=require('fs');var path=require(_0xced2('0x4'));var rimraf=require(_0xced2('0x5'));var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module[_0xced2('0x6')]=function(_0x470152,_0x44e357){return _0x470152[_0xced2('0x7')]('ZohoConfiguration',attributes,{'tableName':_0xced2('0x8'),'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 e86a5cc..0dbec36 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 _0x76a5=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoConfiguration,\x20%s,\x20%s','result','lodash','util','moment'];(function(_0xca41dc,_0x22936e){var _0x3e125c=function(_0x1ef024){while(--_0x1ef024){_0xca41dc['push'](_0xca41dc['shift']());}};_0x3e125c(++_0x22936e);}(_0x76a5,0x156));var _0x576a=function(_0xdea555,_0x5ce0bb){_0xdea555=_0xdea555-0x0;var _0x4bc666=_0x76a5[_0xdea555];return _0x4bc666;};'use strict';var _=require(_0x576a('0x0'));var util=require(_0x576a('0x1'));var moment=require(_0x576a('0x2'));var BPromise=require(_0x576a('0x3'));var rs=require(_0x576a('0x4'));var fs=require('fs');var Redis=require(_0x576a('0x5'));var db=require(_0x576a('0x6'))['db'];var utils=require(_0x576a('0x7'));var logger=require(_0x576a('0x8'))(_0x576a('0x9'));var config=require('../../config/environment');var jayson=require(_0x576a('0xa'));var client=jayson[_0x576a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x390852,_0x540c7d,_0x3c981c){return new BPromise(function(_0x5678b1,_0x4c8798){return client[_0x576a('0xc')](_0x390852,_0x3c981c)[_0x576a('0xd')](function(_0xe76368){logger[_0x576a('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x540c7d,_0x576a('0xf'));logger['debug'](_0x576a('0x10'),_0x540c7d,_0x576a('0xf'),JSON[_0x576a('0x11')](_0xe76368));if(_0xe76368[_0x576a('0x12')]){if(_0xe76368[_0x576a('0x12')][_0x576a('0x13')]===0x1f4){logger[_0x576a('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x540c7d,_0xe76368['error'][_0x576a('0x14')]);return _0x4c8798(_0xe76368['error']['message']);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x540c7d,_0xe76368[_0x576a('0x12')][_0x576a('0x14')]);return _0x5678b1(_0xe76368[_0x576a('0x12')][_0x576a('0x14')]);}else{logger[_0x576a('0xe')](_0x576a('0x15'),_0x540c7d,_0x576a('0xf'));_0x5678b1(_0xe76368[_0x576a('0x16')]['message']);}})['catch'](function(_0x4122cd){logger[_0x576a('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x540c7d,_0x4122cd);_0x4c8798(_0x4122cd);});});} \ No newline at end of file +var _0xa740=['request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','http'];(function(_0x211d49,_0x228d0f){var _0xeea9a6=function(_0x17bacd){while(--_0x17bacd){_0x211d49['push'](_0x211d49['shift']());}};_0xeea9a6(++_0x228d0f);}(_0xa740,0x1c5));var _0x0a74=function(_0x3a7289,_0x4c91b4){_0x3a7289=_0x3a7289-0x0;var _0x303ac8=_0xa740[_0x3a7289];return _0x303ac8;};'use strict';var _=require(_0x0a74('0x0'));var util=require(_0x0a74('0x1'));var moment=require(_0x0a74('0x2'));var BPromise=require(_0x0a74('0x3'));var rs=require(_0x0a74('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a74('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a74('0x6'))('rpc');var config=require(_0x0a74('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0a74('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54127f,_0x5a1459,_0x8b9d8b){return new BPromise(function(_0x29b7a3,_0x36d4af){return client[_0x0a74('0x9')](_0x54127f,_0x8b9d8b)[_0x0a74('0xa')](function(_0x5c6012){logger[_0x0a74('0xb')](_0x0a74('0xc'),_0x5a1459,_0x0a74('0xd'));logger[_0x0a74('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x5a1459,'request\x20sent',JSON[_0x0a74('0xf')](_0x5c6012));if(_0x5c6012['error']){if(_0x5c6012['error'][_0x0a74('0x10')]===0x1f4){logger['error'](_0x0a74('0xc'),_0x5a1459,_0x5c6012[_0x0a74('0x11')][_0x0a74('0x12')]);return _0x36d4af(_0x5c6012[_0x0a74('0x11')][_0x0a74('0x12')]);}logger['error'](_0x0a74('0xc'),_0x5a1459,_0x5c6012[_0x0a74('0x11')]['message']);return _0x29b7a3(_0x5c6012[_0x0a74('0x11')][_0x0a74('0x12')]);}else{logger[_0x0a74('0xb')](_0x0a74('0xc'),_0x5a1459,_0x0a74('0xd'));_0x29b7a3(_0x5c6012[_0x0a74('0x13')][_0x0a74('0x12')]);}})[_0x0a74('0x14')](function(_0x23e692){logger[_0x0a74('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x5a1459,_0x23e692);_0x36d4af(_0x23e692);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index ae3665b..24359a5 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 _0x9791=['show','post','create','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./intZohoField.controller','get','isAuthenticated','index'];(function(_0x1a37e3,_0x5db8f6){var _0x4db78a=function(_0x15e6c1){while(--_0x15e6c1){_0x1a37e3['push'](_0x1a37e3['shift']());}};_0x4db78a(++_0x5db8f6);}(_0x9791,0x138));var _0x1979=function(_0x3d2274,_0x44bdb0){_0x3d2274=_0x3d2274-0x0;var _0x335667=_0x9791[_0x3d2274];return _0x335667;};'use strict';var multer=require(_0x1979('0x0'));var util=require(_0x1979('0x1'));var path=require(_0x1979('0x2'));var timeout=require('connect-timeout');var express=require(_0x1979('0x3'));var router=express[_0x1979('0x4')]();var fs_extra=require(_0x1979('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1979('0x6'));var controller=require(_0x1979('0x7'));router[_0x1979('0x8')]('/',auth[_0x1979('0x9')](),controller[_0x1979('0xa')]);router[_0x1979('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1979('0xb')]);router[_0x1979('0xc')]('/',auth[_0x1979('0x9')](),controller[_0x1979('0xd')]);router['put'](_0x1979('0xe'),auth[_0x1979('0x9')](),controller[_0x1979('0xf')]);router[_0x1979('0x10')](_0x1979('0xe'),auth[_0x1979('0x9')](),controller[_0x1979('0x11')]);module[_0x1979('0x12')]=router; \ No newline at end of file +var _0x89ad=['destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x5d66ba,_0x498912){var _0x1c3da0=function(_0xc49bc5){while(--_0xc49bc5){_0x5d66ba['push'](_0x5d66ba['shift']());}};_0x1c3da0(++_0x498912);}(_0x89ad,0xdd));var _0xd89a=function(_0x2553eb,_0x2f6a76){_0x2553eb=_0x2553eb-0x0;var _0x5c2ff4=_0x89ad[_0x2553eb];return _0x5c2ff4;};'use strict';var multer=require(_0xd89a('0x0'));var util=require(_0xd89a('0x1'));var path=require(_0xd89a('0x2'));var timeout=require('connect-timeout');var express=require(_0xd89a('0x3'));var router=express[_0xd89a('0x4')]();var fs_extra=require(_0xd89a('0x5'));var auth=require(_0xd89a('0x6'));var interaction=require(_0xd89a('0x7'));var config=require('../../config/environment');var controller=require(_0xd89a('0x8'));router[_0xd89a('0x9')]('/',auth[_0xd89a('0xa')](),controller[_0xd89a('0xb')]);router['get'](_0xd89a('0xc'),auth[_0xd89a('0xa')](),controller[_0xd89a('0xd')]);router[_0xd89a('0xe')]('/',auth[_0xd89a('0xa')](),controller[_0xd89a('0xf')]);router[_0xd89a('0x10')](_0xd89a('0xc'),auth[_0xd89a('0xa')](),controller[_0xd89a('0x11')]);router[_0xd89a('0x12')](_0xd89a('0xc'),auth[_0xd89a('0xa')](),controller[_0xd89a('0x13')]);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 4f2a3f5..14404f4 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 _0x0cfd=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0x4e944b,_0x3e910f){var _0x4eec32=function(_0x1c8286){while(--_0x1c8286){_0x4e944b['push'](_0x4e944b['shift']());}};_0x4eec32(++_0x3e910f);}(_0x0cfd,0x72));var _0xd0cf=function(_0x4e6731,_0x483f9e){_0x4e6731=_0x4e6731-0x0;var _0x342fe=_0x0cfd[_0x4e6731];return _0x342fe;};'use strict';var Sequelize=require(_0xd0cf('0x0'));module[_0xd0cf('0x1')]={'type':{'type':Sequelize[_0xd0cf('0x2')](_0xd0cf('0x3'),_0xd0cf('0x4'),_0xd0cf('0x5'),_0xd0cf('0x6'),_0xd0cf('0x7')),'defaultValue':_0xd0cf('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd0cf('0x8')]},'keyType':{'type':Sequelize[_0xd0cf('0x2')](_0xd0cf('0x3'),_0xd0cf('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xd0cf('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd0cf('0x8')]}}; \ No newline at end of file +var _0x794e=['keyValue','picklist','STRING','ENUM','variable','BOOLEAN','string','customVariable'];(function(_0x12005c,_0x38729e){var _0x232713=function(_0x711e86){while(--_0x711e86){_0x12005c['push'](_0x12005c['shift']());}};_0x232713(++_0x38729e);}(_0x794e,0x12e));var _0xe794=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x794e[_0x55abd9];return _0x3e5669;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0xe794('0x0'),'variable',_0xe794('0x1'),_0xe794('0x2'),_0xe794('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe794('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe794('0x5')](_0xe794('0x0'),_0xe794('0x6'),_0xe794('0x1'))},'keyContent':{'type':Sequelize[_0xe794('0x4')]},'idField':{'type':Sequelize[_0xe794('0x4')]},'nameField':{'type':Sequelize[_0xe794('0x4')]},'customField':{'type':Sequelize[_0xe794('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe794('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index aa829da..b01ccee 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 _0x7257=['../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','ZohoField','rawAttributes','type','key','map','query','filters','intersection','attributes','model','fields','length','order','sort','where','pick','filter','merge','options','include','rows','catch','keys','includeAll','find','create','body','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','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment'];(function(_0x43b13d,_0xf72700){var _0x140725=function(_0x152285){while(--_0x152285){_0x43b13d['push'](_0x43b13d['shift']());}};_0x140725(++_0xf72700);}(_0x7257,0x7b));var _0x7725=function(_0x4849f6,_0x104836){_0x4849f6=_0x4849f6-0x0;var _0x1a3dcd=_0x7257[_0x4849f6];return _0x1a3dcd;};'use strict';var emlformat=require(_0x7725('0x0'));var rimraf=require(_0x7725('0x1'));var zipdir=require(_0x7725('0x2'));var jsonpatch=require(_0x7725('0x3'));var rp=require(_0x7725('0x4'));var moment=require(_0x7725('0x5'));var BPromise=require(_0x7725('0x6'));var Mustache=require(_0x7725('0x7'));var util=require(_0x7725('0x8'));var path=require(_0x7725('0x9'));var sox=require('sox');var csv=require(_0x7725('0xa'));var ejs=require(_0x7725('0xb'));var fs=require('fs');var fs_extra=require(_0x7725('0xc'));var _=require(_0x7725('0xd'));var squel=require(_0x7725('0xe'));var crypto=require(_0x7725('0xf'));var jsforce=require(_0x7725('0x10'));var deskjs=require(_0x7725('0x11'));var toCsv=require(_0x7725('0xa'));var querystring=require('querystring');var Papa=require(_0x7725('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7725('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7725('0x14'))(_0x7725('0x15'));var utils=require('../../config/utils');var config=require(_0x7725('0x16'));var licenseUtil=require(_0x7725('0x17'));var db=require(_0x7725('0x18'))['db'];function respondWithStatusCode(_0x41f5cd,_0x4e4452){_0x4e4452=_0x4e4452||0xcc;return function(_0x2c8b59){if(_0x2c8b59){return _0x41f5cd[_0x7725('0x19')](_0x4e4452);}return _0x41f5cd[_0x7725('0x1a')](_0x4e4452)[_0x7725('0x1b')]();};}function respondWithResult(_0x3eb22b,_0x596f07){_0x596f07=_0x596f07||0xc8;return function(_0x481509){if(_0x481509){return _0x3eb22b[_0x7725('0x1a')](_0x596f07)['json'](_0x481509);}};}function respondWithFilteredResult(_0x400275,_0x42d7b8){return function(_0x821562){if(_0x821562){var _0x281f79=typeof _0x42d7b8[_0x7725('0x1c')]===_0x7725('0x1d')&&typeof _0x42d7b8[_0x7725('0x1e')]===_0x7725('0x1d');var _0x4ebc9d=_0x821562[_0x7725('0x1f')];var _0x13c324=_0x281f79?0x0:_0x42d7b8[_0x7725('0x1c')];var _0x3e0650=_0x281f79?_0x821562[_0x7725('0x1f')]:_0x42d7b8[_0x7725('0x1c')]+_0x42d7b8[_0x7725('0x1e')];var _0xcac9e;if(_0x3e0650>=_0x4ebc9d){_0x3e0650=_0x4ebc9d;_0xcac9e=0xc8;}else{_0xcac9e=0xce;}_0x400275[_0x7725('0x1a')](_0xcac9e);return _0x400275[_0x7725('0x20')](_0x7725('0x21'),_0x13c324+'-'+_0x3e0650+'/'+_0x4ebc9d)[_0x7725('0x22')](_0x821562);}return null;};}function patchUpdates(_0xb5d955){return function(_0x2f0316){try{jsonpatch[_0x7725('0x23')](_0x2f0316,_0xb5d955,!![]);}catch(_0x5810c7){return BPromise[_0x7725('0x24')](_0x5810c7);}return _0x2f0316[_0x7725('0x25')]();};}function saveUpdates(_0x105da5,_0x36cd4e){return function(_0x50d9b9){if(_0x50d9b9){return _0x50d9b9[_0x7725('0x26')](_0x105da5)[_0x7725('0x27')](function(_0x22fc04){return _0x22fc04;});}return null;};}function removeEntity(_0x345d77,_0x2117b8){return function(_0x187730){if(_0x187730){return _0x187730[_0x7725('0x28')]()[_0x7725('0x27')](function(){_0x345d77[_0x7725('0x1a')](0xcc)[_0x7725('0x1b')]();});}};}function handleEntityNotFound(_0x5a7f71,_0x1dc32f){return function(_0x2069ad){if(!_0x2069ad){_0x5a7f71[_0x7725('0x19')](0x194);}return _0x2069ad;};}function handleError(_0x227f00,_0x201ec8){_0x201ec8=_0x201ec8||0x1f4;return function(_0xdb1928){logger[_0x7725('0x29')](_0xdb1928[_0x7725('0x2a')]);if(_0xdb1928['name']){delete _0xdb1928[_0x7725('0x2b')];}_0x227f00[_0x7725('0x1a')](_0x201ec8)[_0x7725('0x2c')](_0xdb1928);};}exports[_0x7725('0x2d')]=function(_0x1ee174,_0x5b2fbb){var _0x2ba9de={},_0x5a255e={},_0x5151c5={'count':0x0,'rows':[]};var _0x28f068=_['map'](db[_0x7725('0x2e')][_0x7725('0x2f')],function(_0x20c0cf){return{'name':_0x20c0cf['fieldName'],'type':_0x20c0cf[_0x7725('0x30')][_0x7725('0x31')]};});_0x5a255e['model']=_[_0x7725('0x32')](_0x28f068,_0x7725('0x2b'));_0x5a255e['query']=_['keys'](_0x1ee174[_0x7725('0x33')]);_0x5a255e[_0x7725('0x34')]=_[_0x7725('0x35')](_0x5a255e['model'],_0x5a255e['query']);_0x2ba9de[_0x7725('0x36')]=_[_0x7725('0x35')](_0x5a255e[_0x7725('0x37')],qs[_0x7725('0x38')](_0x1ee174['query'][_0x7725('0x38')]));_0x2ba9de[_0x7725('0x36')]=_0x2ba9de['attributes'][_0x7725('0x39')]?_0x2ba9de['attributes']:_0x5a255e[_0x7725('0x37')];if(!_0x1ee174[_0x7725('0x33')]['hasOwnProperty']('nolimit')){_0x2ba9de[_0x7725('0x1e')]=qs[_0x7725('0x1e')](_0x1ee174[_0x7725('0x33')]['limit']);_0x2ba9de['offset']=qs[_0x7725('0x1c')](_0x1ee174[_0x7725('0x33')][_0x7725('0x1c')]);}_0x2ba9de[_0x7725('0x3a')]=qs['sort'](_0x1ee174[_0x7725('0x33')][_0x7725('0x3b')]);_0x2ba9de[_0x7725('0x3c')]=qs[_0x7725('0x34')](_[_0x7725('0x3d')](_0x1ee174[_0x7725('0x33')],_0x5a255e[_0x7725('0x34')]),_0x28f068);if(_0x1ee174['query'][_0x7725('0x3e')]){_0x2ba9de[_0x7725('0x3c')]=_[_0x7725('0x3f')](_0x2ba9de[_0x7725('0x3c')],{'$or':_['map'](_0x28f068,function(_0x499d92){if(_0x499d92[_0x7725('0x30')]!=='VIRTUAL'){var _0x329940={};_0x329940[_0x499d92[_0x7725('0x2b')]]={'$like':'%'+_0x1ee174[_0x7725('0x33')][_0x7725('0x3e')]+'%'};return _0x329940;}})});}_0x2ba9de=_[_0x7725('0x3f')]({},_0x2ba9de,_0x1ee174[_0x7725('0x40')]);var _0x4b5a7b={'where':_0x2ba9de[_0x7725('0x3c')]};return db[_0x7725('0x2e')][_0x7725('0x1f')](_0x4b5a7b)['then'](function(_0x5cf8d9){_0x5151c5[_0x7725('0x1f')]=_0x5cf8d9;if(_0x1ee174[_0x7725('0x33')]['includeAll']){_0x2ba9de[_0x7725('0x41')]=[{'all':!![]}];}return db[_0x7725('0x2e')]['findAll'](_0x2ba9de);})[_0x7725('0x27')](function(_0x43415e){_0x5151c5[_0x7725('0x42')]=_0x43415e;return _0x5151c5;})['then'](respondWithFilteredResult(_0x5b2fbb,_0x2ba9de))[_0x7725('0x43')](handleError(_0x5b2fbb,null));};exports['show']=function(_0x63760e,_0x681e9c){var _0x32f660={'raw':!![],'where':{'id':_0x63760e['params']['id']}},_0x179a0c={};_0x179a0c[_0x7725('0x37')]=_[_0x7725('0x44')](db[_0x7725('0x2e')][_0x7725('0x2f')]);_0x179a0c['query']=_[_0x7725('0x44')](_0x63760e[_0x7725('0x33')]);_0x179a0c[_0x7725('0x34')]=_[_0x7725('0x35')](_0x179a0c[_0x7725('0x37')],_0x179a0c[_0x7725('0x33')]);_0x32f660[_0x7725('0x36')]=_[_0x7725('0x35')](_0x179a0c['model'],qs[_0x7725('0x38')](_0x63760e[_0x7725('0x33')][_0x7725('0x38')]));_0x32f660[_0x7725('0x36')]=_0x32f660[_0x7725('0x36')][_0x7725('0x39')]?_0x32f660['attributes']:_0x179a0c['model'];if(_0x63760e['query'][_0x7725('0x45')]){_0x32f660[_0x7725('0x41')]=[{'all':!![]}];}_0x32f660=_[_0x7725('0x3f')]({},_0x32f660,_0x63760e[_0x7725('0x40')]);return db['ZohoField'][_0x7725('0x46')](_0x32f660)['then'](handleEntityNotFound(_0x681e9c,null))[_0x7725('0x27')](respondWithResult(_0x681e9c,null))[_0x7725('0x43')](handleError(_0x681e9c,null));};exports[_0x7725('0x47')]=function(_0x2b082e,_0x411d80){return db['ZohoField'][_0x7725('0x47')](_0x2b082e['body'],{})['then'](respondWithResult(_0x411d80,0xc9))[_0x7725('0x43')](handleError(_0x411d80,null));};exports[_0x7725('0x26')]=function(_0x210e39,_0x50cd2d){if(_0x210e39[_0x7725('0x48')]['id']){delete _0x210e39[_0x7725('0x48')]['id'];}return db[_0x7725('0x2e')]['find']({'where':{'id':_0x210e39['params']['id']}})['then'](handleEntityNotFound(_0x50cd2d,null))[_0x7725('0x27')](saveUpdates(_0x210e39[_0x7725('0x48')],null))[_0x7725('0x27')](respondWithResult(_0x50cd2d,null))['catch'](handleError(_0x50cd2d,null));};exports[_0x7725('0x28')]=function(_0x325541,_0x534b6b){return db[_0x7725('0x2e')]['find']({'where':{'id':_0x325541['params']['id']}})[_0x7725('0x27')](handleEntityNotFound(_0x534b6b,null))[_0x7725('0x27')](removeEntity(_0x534b6b,null))[_0x7725('0x43')](handleError(_0x534b6b,null));}; \ No newline at end of file +var _0xdba6=['moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','send','map','ZohoField','rawAttributes','fieldName','type','key','model','name','query','keys','filters','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','intersection','length','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x517d3d,_0x1f0485){var _0xb5ef19=function(_0xff5a08){while(--_0xff5a08){_0x517d3d['push'](_0x517d3d['shift']());}};_0xb5ef19(++_0x1f0485);}(_0xdba6,0x169));var _0x6dba=function(_0x1835e9,_0x483a49){_0x1835e9=_0x1835e9-0x0;var _0x2aaa0b=_0xdba6[_0x1835e9];return _0x2aaa0b;};'use strict';var emlformat=require(_0x6dba('0x0'));var rimraf=require(_0x6dba('0x1'));var zipdir=require(_0x6dba('0x2'));var jsonpatch=require(_0x6dba('0x3'));var rp=require('request-promise');var moment=require(_0x6dba('0x4'));var BPromise=require(_0x6dba('0x5'));var Mustache=require(_0x6dba('0x6'));var util=require(_0x6dba('0x7'));var path=require(_0x6dba('0x8'));var sox=require('sox');var csv=require(_0x6dba('0x9'));var ejs=require(_0x6dba('0xa'));var fs=require('fs');var fs_extra=require(_0x6dba('0xb'));var _=require(_0x6dba('0xc'));var squel=require(_0x6dba('0xd'));var crypto=require('crypto');var jsforce=require(_0x6dba('0xe'));var deskjs=require(_0x6dba('0xf'));var toCsv=require(_0x6dba('0x9'));var querystring=require(_0x6dba('0x10'));var Papa=require(_0x6dba('0x11'));var Redis=require(_0x6dba('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6dba('0x13'));var as=require(_0x6dba('0x14'));var hardwareService=require(_0x6dba('0x15'));var logger=require(_0x6dba('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x6dba('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6dba('0x18'))['db'];function respondWithStatusCode(_0xea5e36,_0x4597c2){_0x4597c2=_0x4597c2||0xcc;return function(_0x33f2d7){if(_0x33f2d7){return _0xea5e36[_0x6dba('0x19')](_0x4597c2);}return _0xea5e36['status'](_0x4597c2)[_0x6dba('0x1a')]();};}function respondWithResult(_0x2a3ff5,_0x1214b8){_0x1214b8=_0x1214b8||0xc8;return function(_0x1d14d7){if(_0x1d14d7){return _0x2a3ff5[_0x6dba('0x1b')](_0x1214b8)[_0x6dba('0x1c')](_0x1d14d7);}};}function respondWithFilteredResult(_0xe41f69,_0x266b10){return function(_0x41dcaa){if(_0x41dcaa){var _0x332ae0=typeof _0x266b10[_0x6dba('0x1d')]===_0x6dba('0x1e')&&typeof _0x266b10[_0x6dba('0x1f')]===_0x6dba('0x1e');var _0x58a88c=_0x41dcaa[_0x6dba('0x20')];var _0x6a4787=_0x332ae0?0x0:_0x266b10[_0x6dba('0x1d')];var _0x1da25c=_0x332ae0?_0x41dcaa[_0x6dba('0x20')]:_0x266b10[_0x6dba('0x1d')]+_0x266b10[_0x6dba('0x1f')];var _0x147408;if(_0x1da25c>=_0x58a88c){_0x1da25c=_0x58a88c;_0x147408=0xc8;}else{_0x147408=0xce;}_0xe41f69[_0x6dba('0x1b')](_0x147408);return _0xe41f69['set'](_0x6dba('0x21'),_0x6a4787+'-'+_0x1da25c+'/'+_0x58a88c)[_0x6dba('0x1c')](_0x41dcaa);}return null;};}function patchUpdates(_0x278f39){return function(_0x163a98){try{jsonpatch[_0x6dba('0x22')](_0x163a98,_0x278f39,!![]);}catch(_0x113bdf){return BPromise[_0x6dba('0x23')](_0x113bdf);}return _0x163a98[_0x6dba('0x24')]();};}function saveUpdates(_0x30050c,_0x1cb8cb){return function(_0x29abcc){if(_0x29abcc){return _0x29abcc[_0x6dba('0x25')](_0x30050c)[_0x6dba('0x26')](function(_0x326fcf){return _0x326fcf;});}return null;};}function removeEntity(_0x18fb8c,_0x2c7134){return function(_0x247d46){if(_0x247d46){return _0x247d46[_0x6dba('0x27')]()[_0x6dba('0x26')](function(){_0x18fb8c[_0x6dba('0x1b')](0xcc)[_0x6dba('0x1a')]();});}};}function handleEntityNotFound(_0x35483b,_0x18869d){return function(_0x53f63a){if(!_0x53f63a){_0x35483b['sendStatus'](0x194);}return _0x53f63a;};}function handleError(_0x9f368b,_0xf4c5ef){_0xf4c5ef=_0xf4c5ef||0x1f4;return function(_0x2c4ae4){logger['error'](_0x2c4ae4[_0x6dba('0x28')]);if(_0x2c4ae4['name']){delete _0x2c4ae4['name'];}_0x9f368b[_0x6dba('0x1b')](_0xf4c5ef)[_0x6dba('0x29')](_0x2c4ae4);};}exports['index']=function(_0xb67e32,_0x2e803f){var _0xc56f0a={},_0x271b34={},_0x7952e3={'count':0x0,'rows':[]};var _0x43aa22=_[_0x6dba('0x2a')](db[_0x6dba('0x2b')][_0x6dba('0x2c')],function(_0x1dd09e){return{'name':_0x1dd09e[_0x6dba('0x2d')],'type':_0x1dd09e[_0x6dba('0x2e')][_0x6dba('0x2f')]};});_0x271b34[_0x6dba('0x30')]=_['map'](_0x43aa22,_0x6dba('0x31'));_0x271b34[_0x6dba('0x32')]=_[_0x6dba('0x33')](_0xb67e32[_0x6dba('0x32')]);_0x271b34[_0x6dba('0x34')]=_['intersection'](_0x271b34['model'],_0x271b34['query']);_0xc56f0a['attributes']=_['intersection'](_0x271b34[_0x6dba('0x30')],qs['fields'](_0xb67e32['query'][_0x6dba('0x35')]));_0xc56f0a[_0x6dba('0x36')]=_0xc56f0a[_0x6dba('0x36')]['length']?_0xc56f0a[_0x6dba('0x36')]:_0x271b34['model'];if(!_0xb67e32[_0x6dba('0x32')][_0x6dba('0x37')]('nolimit')){_0xc56f0a[_0x6dba('0x1f')]=qs[_0x6dba('0x1f')](_0xb67e32[_0x6dba('0x32')][_0x6dba('0x1f')]);_0xc56f0a['offset']=qs[_0x6dba('0x1d')](_0xb67e32[_0x6dba('0x32')][_0x6dba('0x1d')]);}_0xc56f0a[_0x6dba('0x38')]=qs[_0x6dba('0x39')](_0xb67e32[_0x6dba('0x32')][_0x6dba('0x39')]);_0xc56f0a[_0x6dba('0x3a')]=qs[_0x6dba('0x34')](_['pick'](_0xb67e32['query'],_0x271b34[_0x6dba('0x34')]),_0x43aa22);if(_0xb67e32['query'][_0x6dba('0x3b')]){_0xc56f0a[_0x6dba('0x3a')]=_[_0x6dba('0x3c')](_0xc56f0a[_0x6dba('0x3a')],{'$or':_[_0x6dba('0x2a')](_0x43aa22,function(_0x16642f){if(_0x16642f[_0x6dba('0x2e')]!=='VIRTUAL'){var _0x22ea72={};_0x22ea72[_0x16642f[_0x6dba('0x31')]]={'$like':'%'+_0xb67e32[_0x6dba('0x32')][_0x6dba('0x3b')]+'%'};return _0x22ea72;}})});}_0xc56f0a=_['merge']({},_0xc56f0a,_0xb67e32[_0x6dba('0x3d')]);var _0xb9f88={'where':_0xc56f0a[_0x6dba('0x3a')]};return db[_0x6dba('0x2b')][_0x6dba('0x20')](_0xb9f88)[_0x6dba('0x26')](function(_0x3ad055){_0x7952e3[_0x6dba('0x20')]=_0x3ad055;if(_0xb67e32[_0x6dba('0x32')][_0x6dba('0x3e')]){_0xc56f0a[_0x6dba('0x3f')]=[{'all':!![]}];}return db[_0x6dba('0x2b')][_0x6dba('0x40')](_0xc56f0a);})[_0x6dba('0x26')](function(_0x2773f1){_0x7952e3[_0x6dba('0x41')]=_0x2773f1;return _0x7952e3;})['then'](respondWithFilteredResult(_0x2e803f,_0xc56f0a))[_0x6dba('0x42')](handleError(_0x2e803f,null));};exports[_0x6dba('0x43')]=function(_0x4df231,_0x376c20){var _0x4ff074={'raw':!![],'where':{'id':_0x4df231['params']['id']}},_0x480e07={};_0x480e07[_0x6dba('0x30')]=_['keys'](db['ZohoField'][_0x6dba('0x2c')]);_0x480e07[_0x6dba('0x32')]=_[_0x6dba('0x33')](_0x4df231[_0x6dba('0x32')]);_0x480e07['filters']=_[_0x6dba('0x44')](_0x480e07['model'],_0x480e07[_0x6dba('0x32')]);_0x4ff074['attributes']=_['intersection'](_0x480e07['model'],qs[_0x6dba('0x35')](_0x4df231[_0x6dba('0x32')][_0x6dba('0x35')]));_0x4ff074['attributes']=_0x4ff074[_0x6dba('0x36')][_0x6dba('0x45')]?_0x4ff074[_0x6dba('0x36')]:_0x480e07[_0x6dba('0x30')];if(_0x4df231[_0x6dba('0x32')]['includeAll']){_0x4ff074[_0x6dba('0x3f')]=[{'all':!![]}];}_0x4ff074=_['merge']({},_0x4ff074,_0x4df231['options']);return db['ZohoField']['find'](_0x4ff074)[_0x6dba('0x26')](handleEntityNotFound(_0x376c20,null))['then'](respondWithResult(_0x376c20,null))[_0x6dba('0x42')](handleError(_0x376c20,null));};exports['create']=function(_0x243978,_0xdf4852){return db[_0x6dba('0x2b')][_0x6dba('0x46')](_0x243978[_0x6dba('0x47')],{})[_0x6dba('0x26')](respondWithResult(_0xdf4852,0xc9))[_0x6dba('0x42')](handleError(_0xdf4852,null));};exports[_0x6dba('0x25')]=function(_0x519994,_0x3e4366){if(_0x519994[_0x6dba('0x47')]['id']){delete _0x519994[_0x6dba('0x47')]['id'];}return db[_0x6dba('0x2b')]['find']({'where':{'id':_0x519994[_0x6dba('0x48')]['id']}})[_0x6dba('0x26')](handleEntityNotFound(_0x3e4366,null))['then'](saveUpdates(_0x519994[_0x6dba('0x47')],null))[_0x6dba('0x26')](respondWithResult(_0x3e4366,null))[_0x6dba('0x42')](handleError(_0x3e4366,null));};exports[_0x6dba('0x27')]=function(_0x18b95a,_0x3b15e9){return db[_0x6dba('0x2b')]['find']({'where':{'id':_0x18b95a[_0x6dba('0x48')]['id']}})[_0x6dba('0x26')](handleEntityNotFound(_0x3b15e9,null))[_0x6dba('0x26')](removeEntity(_0x3b15e9,null))[_0x6dba('0x42')](handleError(_0x3b15e9,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 82b2815..56ab623 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 _0x4975=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','lodash'];(function(_0x190c81,_0x58f0bd){var _0x503a57=function(_0x32fffe){while(--_0x32fffe){_0x190c81['push'](_0x190c81['shift']());}};_0x503a57(++_0x58f0bd);}(_0x4975,0x86));var _0x5497=function(_0x406d49,_0x2ef652){_0x406d49=_0x406d49-0x0;var _0x3607d8=_0x4975[_0x406d49];return _0x3607d8;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['idField',_0x5497('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf2e3=['request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xf2e3[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x3f2e('0x0'));var util=require('util');var logger=require(_0x3f2e('0x1'))(_0x3f2e('0x2'));var moment=require(_0x3f2e('0x3'));var BPromise=require(_0x3f2e('0x4'));var rp=require(_0x3f2e('0x5'));var fs=require('fs');var path=require(_0x3f2e('0x6'));var rimraf=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var attributes=require(_0x3f2e('0x9'));module['exports']=function(_0x33a3b7,_0xdd6b3e){return _0x33a3b7[_0x3f2e('0xa')](_0x3f2e('0xb'),attributes,{'tableName':_0x3f2e('0xc'),'paranoid':![],'indexes':[{'name':_0x3f2e('0xd'),'fields':[_0x3f2e('0xe'),_0x3f2e('0xf')],'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 680ec14..1dddca6 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 _0x274c=['request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x118aba,_0x2ffb36){var _0x47515a=function(_0x442fbf){while(--_0x442fbf){_0x118aba['push'](_0x118aba['shift']());}};_0x47515a(++_0x2ffb36);}(_0x274c,0x9d));var _0xc274=function(_0x1a0daa,_0x2a4634){_0x1a0daa=_0x1a0daa-0x0;var _0x1dbe15=_0x274c[_0x1a0daa];return _0x1dbe15;};'use strict';var _=require(_0xc274('0x0'));var util=require(_0xc274('0x1'));var moment=require(_0xc274('0x2'));var BPromise=require(_0xc274('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc274('0x4'));var db=require(_0xc274('0x5'))['db'];var utils=require(_0xc274('0x6'));var logger=require(_0xc274('0x7'))('rpc');var config=require(_0xc274('0x8'));var jayson=require(_0xc274('0x9'));var client=jayson[_0xc274('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x347a54,_0x1a98e9,_0x3f7fca){return new BPromise(function(_0x263a69,_0x4f3e44){return client[_0xc274('0xb')](_0x347a54,_0x3f7fca)[_0xc274('0xc')](function(_0x2d052c){logger[_0xc274('0xd')](_0xc274('0xe'),_0x1a98e9,'request\x20sent');logger[_0xc274('0xf')](_0xc274('0x10'),_0x1a98e9,_0xc274('0x11'),JSON[_0xc274('0x12')](_0x2d052c));if(_0x2d052c[_0xc274('0x13')]){if(_0x2d052c[_0xc274('0x13')][_0xc274('0x14')]===0x1f4){logger[_0xc274('0x13')](_0xc274('0xe'),_0x1a98e9,_0x2d052c[_0xc274('0x13')]['message']);return _0x4f3e44(_0x2d052c[_0xc274('0x13')]['message']);}logger[_0xc274('0x13')](_0xc274('0xe'),_0x1a98e9,_0x2d052c[_0xc274('0x13')]['message']);return _0x263a69(_0x2d052c[_0xc274('0x13')][_0xc274('0x15')]);}else{logger[_0xc274('0xd')](_0xc274('0xe'),_0x1a98e9,'request\x20sent');_0x263a69(_0x2d052c[_0xc274('0x16')][_0xc274('0x15')]);}})[_0xc274('0x17')](function(_0x415325){logger['error'](_0xc274('0xe'),_0x1a98e9,_0x415325);_0x4f3e44(_0x415325);});});} \ No newline at end of file +var _0x9003=['request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ZohoField,\x20%s,\x20%s'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x9003,0x9b));var _0x3900=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x9003[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x3900('0x0'));var moment=require('moment');var BPromise=require(_0x3900('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3900('0x2'));var db=require(_0x3900('0x3'))['db'];var utils=require(_0x3900('0x4'));var logger=require(_0x3900('0x5'))(_0x3900('0x6'));var config=require(_0x3900('0x7'));var jayson=require(_0x3900('0x8'));var client=jayson[_0x3900('0x9')][_0x3900('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x481082,_0xf5dd60,_0x250ed6){return new BPromise(function(_0x1f6418,_0x2b618f){return client[_0x3900('0xb')](_0x481082,_0x250ed6)['then'](function(_0x35e0fc){logger['info'](_0x3900('0xc'),_0xf5dd60,_0x3900('0xd'));logger[_0x3900('0xe')](_0x3900('0xf'),_0xf5dd60,_0x3900('0xd'),JSON[_0x3900('0x10')](_0x35e0fc));if(_0x35e0fc[_0x3900('0x11')]){if(_0x35e0fc['error']['code']===0x1f4){logger[_0x3900('0x11')]('ZohoField,\x20%s,\x20%s',_0xf5dd60,_0x35e0fc['error'][_0x3900('0x12')]);return _0x2b618f(_0x35e0fc['error']['message']);}logger['error'](_0x3900('0xc'),_0xf5dd60,_0x35e0fc[_0x3900('0x11')][_0x3900('0x12')]);return _0x1f6418(_0x35e0fc[_0x3900('0x11')][_0x3900('0x12')]);}else{logger[_0x3900('0x13')](_0x3900('0xc'),_0xf5dd60,_0x3900('0xd'));_0x1f6418(_0x35e0fc['result'][_0x3900('0x12')]);}})[_0x3900('0x14')](function(_0x17ce9e){logger[_0x3900('0x11')](_0x3900('0xc'),_0xf5dd60,_0x17ce9e);_0x2b618f(_0x17ce9e);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 96c82d7..5a6f0a3 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3e97a9,_0x566ecd){var _0x202628=function(_0x3c493c){while(--_0x3c493c){_0x3e97a9['push'](_0x3e97a9['shift']());}};_0x202628(++_0x566ecd);}(_0x70e0,0x17b));var _0x070e=function(_0x5d14db,_0x402fbb){_0x5d14db=_0x5d14db-0x0;var _0x3cf683=_0x70e0[_0x5d14db];return _0x3cf683;};'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 +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4c0972,_0x115a79){var _0x37d513=function(_0x553ff9){while(--_0x553ff9){_0x4c0972['push'](_0x4c0972['shift']());}};_0x37d513(++_0x115a79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 2c18d7c..73a2c77 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 _0xb98f=['INTEGER','state','sequelize','exports','STRING','unique_name_and_version'];(function(_0x501969,_0x3b8d7a){var _0x16cc32=function(_0x132192){while(--_0x132192){_0x501969['push'](_0x501969['shift']());}};_0x16cc32(++_0x3b8d7a);}(_0xb98f,0xce));var _0xfb98=function(_0x36e0f4,_0x4ff3e3){_0x36e0f4=_0x36e0f4-0x0;var _0xecdf8a=_0xb98f[_0x36e0f4];return _0xecdf8a;};'use strict';var Sequelize=require(_0xfb98('0x0'));module[_0xfb98('0x1')]={'name':{'type':Sequelize[_0xfb98('0x2')],'allowNull':![],'unique':_0xfb98('0x3')},'version':{'type':Sequelize[_0xfb98('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xfb98('0x2')]},'path':{'type':Sequelize[_0xfb98('0x2')]},'type':{'type':Sequelize[_0xfb98('0x2')]},'size':{'type':Sequelize[_0xfb98('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xfb98('0x2')]},'logo':{'type':Sequelize[_0xfb98('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0xfb98('0x5')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0xc543=['BOOLEAN','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xc543,0x139));var _0x3c54=function(_0x3caec5,_0xde0d9e){_0x3caec5=_0x3caec5-0x0;var _0x5a66b0=_0xc543[_0x3caec5];return _0x5a66b0;};'use strict';var Sequelize=require(_0x3c54('0x0'));module[_0x3c54('0x1')]={'name':{'type':Sequelize[_0x3c54('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x3c54('0x2')],'allowNull':![],'unique':_0x3c54('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x3c54('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x3c54('0x2')]},'type':{'type':Sequelize[_0x3c54('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x3c54('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x3c54('0x2')]},'logo':{'type':Sequelize[_0x3c54('0x2')]},'state':{'type':Sequelize[_0x3c54('0x2')],'unique':'state'},'description':{'type':Sequelize[_0x3c54('0x2')]},'title':{'type':Sequelize[_0x3c54('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x3c54('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index ea82339..0cb62e7 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 _0x5496=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','Integration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','fields','include','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x5496,0x175));var _0x6549=function(_0x4d99b8,_0x584cb1){_0x4d99b8=_0x4d99b8-0x0;var _0x193fc2=_0x5496[_0x4d99b8];return _0x193fc2;};'use strict';var emlformat=require(_0x6549('0x0'));var rimraf=require(_0x6549('0x1'));var zipdir=require(_0x6549('0x2'));var jsonpatch=require(_0x6549('0x3'));var rp=require(_0x6549('0x4'));var moment=require('moment');var BPromise=require(_0x6549('0x5'));var Mustache=require('mustache');var util=require(_0x6549('0x6'));var path=require(_0x6549('0x7'));var sox=require(_0x6549('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6549('0x9'));var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var as=require(_0x6549('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6549('0x14'));var utils=require(_0x6549('0x15'));var config=require(_0x6549('0x16'));var licenseUtil=require(_0x6549('0x17'));var db=require(_0x6549('0x18'))['db'];function respondWithStatusCode(_0x5bc018,_0x4dfb06){_0x4dfb06=_0x4dfb06||0xcc;return function(_0x3f844f){if(_0x3f844f){return _0x5bc018[_0x6549('0x19')](_0x4dfb06);}return _0x5bc018['status'](_0x4dfb06)[_0x6549('0x1a')]();};}function respondWithResult(_0x150fc8,_0x195d25){_0x195d25=_0x195d25||0xc8;return function(_0x12b068){if(_0x12b068){return _0x150fc8[_0x6549('0x1b')](_0x195d25)[_0x6549('0x1c')](_0x12b068);}};}function respondWithFilteredResult(_0x55c112,_0x5db86d){return function(_0x384f75){if(_0x384f75){var _0x25da29=typeof _0x5db86d['offset']===_0x6549('0x1d')&&typeof _0x5db86d[_0x6549('0x1e')]===_0x6549('0x1d');var _0x387e60=_0x384f75[_0x6549('0x1f')];var _0x53b12b=_0x25da29?0x0:_0x5db86d['offset'];var _0x26a212=_0x25da29?_0x384f75['count']:_0x5db86d['offset']+_0x5db86d[_0x6549('0x1e')];var _0x1e5079;if(_0x26a212>=_0x387e60){_0x26a212=_0x387e60;_0x1e5079=0xc8;}else{_0x1e5079=0xce;}_0x55c112[_0x6549('0x1b')](_0x1e5079);return _0x55c112[_0x6549('0x20')](_0x6549('0x21'),_0x53b12b+'-'+_0x26a212+'/'+_0x387e60)['json'](_0x384f75);}return null;};}function patchUpdates(_0x228117){return function(_0x4b40c1){try{jsonpatch[_0x6549('0x22')](_0x4b40c1,_0x228117,!![]);}catch(_0x72322b){return BPromise[_0x6549('0x23')](_0x72322b);}return _0x4b40c1[_0x6549('0x24')]();};}function saveUpdates(_0x22bcf8,_0x12d547){return function(_0x427b47){if(_0x427b47){return _0x427b47[_0x6549('0x25')](_0x22bcf8)[_0x6549('0x26')](function(_0x6ae00c){return _0x6ae00c;});}return null;};}function removeEntity(_0x40d3f9,_0x1fbfa4){return function(_0x23c0ba){if(_0x23c0ba){return _0x23c0ba['destroy']()[_0x6549('0x26')](function(){_0x40d3f9[_0x6549('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x126967,_0x29f89e){return function(_0x3768cb){if(!_0x3768cb){_0x126967['sendStatus'](0x194);}return _0x3768cb;};}function handleError(_0x31a95,_0xfb51a1){_0xfb51a1=_0xfb51a1||0x1f4;return function(_0x14de1f){logger[_0x6549('0x27')](_0x14de1f[_0x6549('0x28')]);if(_0x14de1f[_0x6549('0x29')]){delete _0x14de1f[_0x6549('0x29')];}_0x31a95[_0x6549('0x1b')](_0xfb51a1)['send'](_0x14de1f);};}exports[_0x6549('0x2a')]=function(_0x136518,_0x17fdfb){var _0x4c605c={},_0x3f1502={},_0x4acaf5={'count':0x0,'rows':[]};var _0x4f0ad1=_['map'](db[_0x6549('0x2b')][_0x6549('0x2c')],function(_0x4f3069){return{'name':_0x4f3069[_0x6549('0x2d')],'type':_0x4f3069[_0x6549('0x2e')][_0x6549('0x2f')]};});_0x3f1502[_0x6549('0x30')]=_[_0x6549('0x31')](_0x4f0ad1,_0x6549('0x29'));_0x3f1502[_0x6549('0x32')]=_['keys'](_0x136518[_0x6549('0x32')]);_0x3f1502[_0x6549('0x33')]=_[_0x6549('0x34')](_0x3f1502[_0x6549('0x30')],_0x3f1502[_0x6549('0x32')]);_0x4c605c[_0x6549('0x35')]=_['intersection'](_0x3f1502[_0x6549('0x30')],qs['fields'](_0x136518[_0x6549('0x32')]['fields']));_0x4c605c[_0x6549('0x35')]=_0x4c605c[_0x6549('0x35')][_0x6549('0x36')]?_0x4c605c['attributes']:_0x3f1502[_0x6549('0x30')];if(!_0x136518[_0x6549('0x32')][_0x6549('0x37')](_0x6549('0x38'))){_0x4c605c['limit']=qs['limit'](_0x136518['query'][_0x6549('0x1e')]);_0x4c605c[_0x6549('0x39')]=qs['offset'](_0x136518[_0x6549('0x32')][_0x6549('0x39')]);}_0x4c605c[_0x6549('0x3a')]=qs[_0x6549('0x3b')](_0x136518[_0x6549('0x32')]['sort']);_0x4c605c['where']=qs[_0x6549('0x33')](_[_0x6549('0x3c')](_0x136518[_0x6549('0x32')],_0x3f1502[_0x6549('0x33')]),_0x4f0ad1);if(_0x136518[_0x6549('0x32')][_0x6549('0x3d')]){_0x4c605c[_0x6549('0x3e')]=_[_0x6549('0x3f')](_0x4c605c[_0x6549('0x3e')],{'$or':_[_0x6549('0x31')](_0x4f0ad1,function(_0x525f82){if(_0x525f82[_0x6549('0x2e')]!==_0x6549('0x40')){var _0x2ea977={};_0x2ea977[_0x525f82[_0x6549('0x29')]]={'$like':'%'+_0x136518[_0x6549('0x32')]['filter']+'%'};return _0x2ea977;}})});}_0x4c605c=_['merge']({},_0x4c605c,_0x136518['options']);var _0x22b919={'where':_0x4c605c[_0x6549('0x3e')]};return db[_0x6549('0x2b')][_0x6549('0x1f')](_0x22b919)['then'](function(_0x56ce9f){_0x4acaf5[_0x6549('0x1f')]=_0x56ce9f;if(_0x136518[_0x6549('0x32')][_0x6549('0x41')]){_0x4c605c['include']=[{'all':!![]}];}return db[_0x6549('0x2b')]['findAll'](_0x4c605c);})[_0x6549('0x26')](function(_0x2ec614){_0x4acaf5[_0x6549('0x42')]=_0x2ec614;return _0x4acaf5;})[_0x6549('0x26')](respondWithFilteredResult(_0x17fdfb,_0x4c605c))[_0x6549('0x43')](handleError(_0x17fdfb,null));};exports[_0x6549('0x44')]=function(_0xbbfdc9,_0x4deaab){var _0x132625={'raw':![],'where':{'id':_0xbbfdc9[_0x6549('0x45')]['id']}},_0x309f45={};_0x309f45[_0x6549('0x30')]=_[_0x6549('0x46')](db[_0x6549('0x2b')][_0x6549('0x2c')]);_0x309f45[_0x6549('0x32')]=_[_0x6549('0x46')](_0xbbfdc9[_0x6549('0x32')]);_0x309f45[_0x6549('0x33')]=_[_0x6549('0x34')](_0x309f45[_0x6549('0x30')],_0x309f45[_0x6549('0x32')]);_0x132625[_0x6549('0x35')]=_[_0x6549('0x34')](_0x309f45['model'],qs[_0x6549('0x47')](_0xbbfdc9[_0x6549('0x32')][_0x6549('0x47')]));_0x132625[_0x6549('0x35')]=_0x132625['attributes'][_0x6549('0x36')]?_0x132625['attributes']:_0x309f45[_0x6549('0x30')];if(_0xbbfdc9[_0x6549('0x32')]['includeAll']){_0x132625[_0x6549('0x48')]=[{'all':!![]}];}_0x132625=_[_0x6549('0x3f')]({},_0x132625,_0xbbfdc9[_0x6549('0x49')]);return db[_0x6549('0x2b')][_0x6549('0x4a')](_0x132625)['then'](handleEntityNotFound(_0x4deaab,null))['then'](respondWithResult(_0x4deaab,null))[_0x6549('0x43')](handleError(_0x4deaab,null));};exports[_0x6549('0x4b')]=function(_0x41d675,_0x1712f3){return db[_0x6549('0x2b')]['create'](_0x41d675[_0x6549('0x4c')],{})[_0x6549('0x26')](respondWithResult(_0x1712f3,0xc9))[_0x6549('0x43')](handleError(_0x1712f3,null));};exports[_0x6549('0x25')]=function(_0xa4c650,_0x25a6ee){if(_0xa4c650[_0x6549('0x4c')]['id']){delete _0xa4c650[_0x6549('0x4c')]['id'];}return db['Integration'][_0x6549('0x4a')]({'where':{'id':_0xa4c650['params']['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x25a6ee,null))[_0x6549('0x26')](saveUpdates(_0xa4c650[_0x6549('0x4c')],null))['then'](respondWithResult(_0x25a6ee,null))[_0x6549('0x43')](handleError(_0x25a6ee,null));};exports[_0x6549('0x4d')]=function(_0x2ef4d2,_0x5300c8){return db[_0x6549('0x2b')][_0x6549('0x4a')]({'where':{'id':_0x2ef4d2[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x5300c8,null))[_0x6549('0x26')](removeEntity(_0x5300c8,null))[_0x6549('0x43')](handleError(_0x5300c8,null));}; \ No newline at end of file +var _0xd117=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','update','body','eml-format','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/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','Integration','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length'];(function(_0xd6d18,_0x3c8c2b){var _0x28e4dc=function(_0x542193){while(--_0x542193){_0xd6d18['push'](_0xd6d18['shift']());}};_0x28e4dc(++_0x3c8c2b);}(_0xd117,0x182));var _0x7d11=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0xd117[_0x53b133];return _0x5647e0;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4767d5,_0x471f46){_0x471f46=_0x471f46||0xcc;return function(_0x5ee572){if(_0x5ee572){return _0x4767d5[_0x7d11('0x18')](_0x471f46);}return _0x4767d5[_0x7d11('0x19')](_0x471f46)['end']();};}function respondWithResult(_0x324de5,_0x16949d){_0x16949d=_0x16949d||0xc8;return function(_0x20a2df){if(_0x20a2df){return _0x324de5[_0x7d11('0x19')](_0x16949d)[_0x7d11('0x1a')](_0x20a2df);}};}function respondWithFilteredResult(_0xeae744,_0x2a269e){return function(_0xb1669e){if(_0xb1669e){var _0x4aa795=typeof _0x2a269e[_0x7d11('0x1b')]===_0x7d11('0x1c')&&typeof _0x2a269e[_0x7d11('0x1d')]===_0x7d11('0x1c');var _0x45f916=_0xb1669e['count'];var _0x456cb9=_0x4aa795?0x0:_0x2a269e[_0x7d11('0x1b')];var _0x4d1306=_0x4aa795?_0xb1669e['count']:_0x2a269e[_0x7d11('0x1b')]+_0x2a269e['limit'];var _0x1f9990;if(_0x4d1306>=_0x45f916){_0x4d1306=_0x45f916;_0x1f9990=0xc8;}else{_0x1f9990=0xce;}_0xeae744['status'](_0x1f9990);return _0xeae744[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x456cb9+'-'+_0x4d1306+'/'+_0x45f916)[_0x7d11('0x1a')](_0xb1669e);}return null;};}function patchUpdates(_0x46f662){return function(_0x30df70){try{jsonpatch[_0x7d11('0x20')](_0x30df70,_0x46f662,!![]);}catch(_0x4297f8){return BPromise[_0x7d11('0x21')](_0x4297f8);}return _0x30df70['save']();};}function saveUpdates(_0x441917,_0x4a34f4){return function(_0x58455b){if(_0x58455b){return _0x58455b['update'](_0x441917)[_0x7d11('0x22')](function(_0x3545dc){return _0x3545dc;});}return null;};}function removeEntity(_0x44476c,_0x1a7853){return function(_0x355d14){if(_0x355d14){return _0x355d14[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x44476c[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x24')](_0x180e1e[_0x7d11('0x25')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x26')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x27')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=_['map'](db[_0x7d11('0x28')]['rawAttributes'],function(_0x31866d){return{'name':_0x31866d[_0x7d11('0x29')],'type':_0x31866d[_0x7d11('0x2a')]['key']};});_0x38f1be['model']=_[_0x7d11('0x2b')](_0x1a7745,_0x7d11('0x26'));_0x38f1be['query']=_[_0x7d11('0x2c')](_0x601650[_0x7d11('0x2d')]);_0x38f1be[_0x7d11('0x2e')]=_['intersection'](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049['attributes']=_[_0x7d11('0x30')](_0x38f1be['model'],qs[_0x7d11('0x31')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]));_0x18c049[_0x7d11('0x32')]=_0x18c049['attributes'][_0x7d11('0x33')]?_0x18c049[_0x7d11('0x32')]:_0x38f1be['model'];if(!_0x601650['query'][_0x7d11('0x34')](_0x7d11('0x35'))){_0x18c049['limit']=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1b')]=qs['offset'](_0x601650['query'][_0x7d11('0x1b')]);}_0x18c049[_0x7d11('0x36')]=qs[_0x7d11('0x37')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x37')]);_0x18c049[_0x7d11('0x38')]=qs[_0x7d11('0x2e')](_[_0x7d11('0x39')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x2e')]),_0x1a7745);if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x18c049['where']=_[_0x7d11('0x3b')](_0x18c049['where'],{'$or':_[_0x7d11('0x2b')](_0x1a7745,function(_0x111e26){if(_0x111e26[_0x7d11('0x2a')]!==_0x7d11('0x3c')){var _0x4f8fd2={};_0x4f8fd2[_0x111e26[_0x7d11('0x26')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]+'%'};return _0x4f8fd2;}})});}_0x18c049=_[_0x7d11('0x3b')]({},_0x18c049,_0x601650['options']);var _0x22730e={'where':_0x18c049['where']};return db[_0x7d11('0x28')]['count'](_0x22730e)[_0x7d11('0x22')](function(_0x622725){_0x4c7d6a[_0x7d11('0x3d')]=_0x622725;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049['include']=[{'all':!![]}];}return db[_0x7d11('0x28')][_0x7d11('0x3e')](_0x18c049);})['then'](function(_0x1caef9){_0x4c7d6a[_0x7d11('0x3f')]=_0x1caef9;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x40')](handleError(_0x35a789,null));};exports[_0x7d11('0x41')]=function(_0x2e1647,_0x47e968){var _0x25b73b={'raw':![],'where':{'id':_0x2e1647[_0x7d11('0x42')]['id']}},_0x5cf6a6={};_0x5cf6a6[_0x7d11('0x2f')]=_[_0x7d11('0x2c')](db[_0x7d11('0x28')][_0x7d11('0x43')]);_0x5cf6a6[_0x7d11('0x2d')]=_['keys'](_0x2e1647['query']);_0x5cf6a6['filters']=_[_0x7d11('0x30')](_0x5cf6a6[_0x7d11('0x2f')],_0x5cf6a6[_0x7d11('0x2d')]);_0x25b73b[_0x7d11('0x32')]=_[_0x7d11('0x30')](_0x5cf6a6['model'],qs[_0x7d11('0x31')](_0x2e1647[_0x7d11('0x2d')]['fields']));_0x25b73b[_0x7d11('0x32')]=_0x25b73b[_0x7d11('0x32')][_0x7d11('0x33')]?_0x25b73b['attributes']:_0x5cf6a6[_0x7d11('0x2f')];if(_0x2e1647[_0x7d11('0x2d')][_0x7d11('0x44')]){_0x25b73b['include']=[{'all':!![]}];}_0x25b73b=_[_0x7d11('0x3b')]({},_0x25b73b,_0x2e1647['options']);return db[_0x7d11('0x28')][_0x7d11('0x45')](_0x25b73b)[_0x7d11('0x22')](handleEntityNotFound(_0x47e968,null))[_0x7d11('0x22')](respondWithResult(_0x47e968,null))[_0x7d11('0x40')](handleError(_0x47e968,null));};exports[_0x7d11('0x46')]=function(_0x161213,_0x193631){return db[_0x7d11('0x28')]['create'](_0x161213['body'],{})['then'](respondWithResult(_0x193631,0xc9))[_0x7d11('0x40')](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x20297a,_0x18ae0e){if(_0x20297a[_0x7d11('0x48')]['id']){delete _0x20297a[_0x7d11('0x48')]['id'];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'id':_0x20297a[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x18ae0e,null))[_0x7d11('0x22')](saveUpdates(_0x20297a[_0x7d11('0x48')],null))['then'](respondWithResult(_0x18ae0e,null))[_0x7d11('0x40')](handleError(_0x18ae0e,null));};exports[_0x7d11('0x23')]=function(_0x29207f,_0x553a03){return db['Integration'][_0x7d11('0x45')]({'where':{'id':_0x29207f[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x553a03,null))['then'](removeEntity(_0x553a03,null))['catch'](handleError(_0x553a03,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 97c2d75..4f287a4 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 _0x4f5c=['bluebird','request-promise','path','./integration.attributes','exports','define','Integration','integrations','util','../../config/logger','api','moment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4f5c,0x164));var _0xc4f5=function(_0x48f2ab,_0x4f1943){_0x48f2ab=_0x48f2ab-0x0;var _0xbfd253=_0x4f5c[_0x48f2ab];return _0xbfd253;};'use strict';var _=require('lodash');var util=require(_0xc4f5('0x0'));var logger=require(_0xc4f5('0x1'))(_0xc4f5('0x2'));var moment=require(_0xc4f5('0x3'));var BPromise=require(_0xc4f5('0x4'));var rp=require(_0xc4f5('0x5'));var fs=require('fs');var path=require(_0xc4f5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc4f5('0x7'));module[_0xc4f5('0x8')]=function(_0x24a1ab,_0x56c770){return _0x24a1ab[_0xc4f5('0x9')](_0xc4f5('0xa'),attributes,{'tableName':_0xc4f5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd26f=['request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x40d927,_0x7d744b){var _0x5370cf=function(_0xb854c1){while(--_0xb854c1){_0x40d927['push'](_0x40d927['shift']());}};_0x5370cf(++_0x7d744b);}(_0xd26f,0x174));var _0xfd26=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xd26f[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xfd26('0x0'));var util=require(_0xfd26('0x1'));var logger=require(_0xfd26('0x2'))(_0xfd26('0x3'));var moment=require(_0xfd26('0x4'));var BPromise=require(_0xfd26('0x5'));var rp=require(_0xfd26('0x6'));var fs=require('fs');var path=require(_0xfd26('0x7'));var rimraf=require(_0xfd26('0x8'));var config=require(_0xfd26('0x9'));var attributes=require(_0xfd26('0xa'));module[_0xfd26('0xb')]=function(_0x341454,_0x269adc){return _0x341454[_0xfd26('0xc')](_0xfd26('0xd'),attributes,{'tableName':'integrations','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 87d59db..9305460 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 _0x2542=['info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x19c845,_0x1a2a16){var _0x2745d8=function(_0x4a7139){while(--_0x4a7139){_0x19c845['push'](_0x19c845['shift']());}};_0x2745d8(++_0x1a2a16);}(_0x2542,0x169));var _0x2254=function(_0x1a4c20,_0x1c5736){_0x1a4c20=_0x1a4c20-0x0;var _0x1ff6dc=_0x2542[_0x1a4c20];return _0x1ff6dc;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file +var _0xd7d1=['info','Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0xd41825,_0x126758){_0xd41825=_0xd41825-0x0;var _0x244a6f=_0xd7d1[_0xd41825];return _0x244a6f;};'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});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('Integration,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('Integration,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 2f6ca5e..0658e27 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 _0x2ef3=['express','Router','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x9ce879,_0x1fdced){var _0x403820=function(_0xa7fda){while(--_0xa7fda){_0x9ce879['push'](_0x9ce879['shift']());}};_0x403820(++_0x1fdced);}(_0x2ef3,0xba));var _0x32ef=function(_0x520dc3,_0x1c9564){_0x520dc3=_0x520dc3-0x0;var _0x25ee96=_0x2ef3[_0x520dc3];return _0x25ee96;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')]('/',auth[_0x32ef('0xb')](),controller['create']);router['put'](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')]('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x12')]=router; \ No newline at end of file +var _0x896e=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x896e,0x1e9));var _0xe896=function(_0x2913fb,_0x21e145){_0x2913fb=_0x2913fb-0x0;var _0x51ba95=_0x896e[_0x2913fb];return _0x51ba95;};'use strict';var multer=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var path=require(_0xe896('0x2'));var timeout=require(_0xe896('0x3'));var express=require(_0xe896('0x4'));var router=express[_0xe896('0x5')]();var fs_extra=require(_0xe896('0x6'));var auth=require(_0xe896('0x7'));var interaction=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var controller=require(_0xe896('0xa'));router[_0xe896('0xb')]('/',auth['isAuthenticated'](),controller[_0xe896('0xc')]);router[_0xe896('0xb')](_0xe896('0xd'),auth[_0xe896('0xe')](),controller[_0xe896('0xf')]);router['get'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x11')]);router['post']('/',auth[_0xe896('0xe')](),controller['create']);router[_0xe896('0x12')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x13')]);router[_0xe896('0x14')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x15')]);module[_0xe896('0x16')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 9c6d711..3cc1e74 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 _0xa4cc=['exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','sequelize'];(function(_0x362e52,_0x3122e0){var _0x1dcb7d=function(_0x3c367c){while(--_0x3c367c){_0x362e52['push'](_0x362e52['shift']());}};_0x1dcb7d(++_0x3122e0);}(_0xa4cc,0x15f));var _0xca4c=function(_0x54d5c8,_0x344ce5){_0x54d5c8=_0x54d5c8-0x0;var _0x525e2e=_0xa4cc[_0x54d5c8];return _0x525e2e;};'use strict';var Sequelize=require(_0xca4c('0x0'));module[_0xca4c('0x1')]={'integration':{'type':Sequelize[_0xca4c('0x2')]},'eventChannel':{'type':Sequelize[_0xca4c('0x2')]},'exitStatus':{'type':Sequelize[_0xca4c('0x2')]},'ticketId':{'type':Sequelize[_0xca4c('0x2')]},'integrationId':{'type':Sequelize[_0xca4c('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xca4c('0x2')]},'calleridname':{'type':Sequelize[_0xca4c('0x2')]},'queue':{'type':Sequelize[_0xca4c('0x2')]},'interface':{'type':Sequelize[_0xca4c('0x2')]},'membername':{'type':Sequelize[_0xca4c('0x2')]},'agentcalledAt':{'type':Sequelize[_0xca4c('0x4')]},'agentconnectAt':{'type':Sequelize[_0xca4c('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xca4c('0x4')]},'talktime':{'type':Sequelize[_0xca4c('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xca4c('0x3')]},'reason':{'type':Sequelize[_0xca4c('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xca4c('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xca4c('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xca4c('0x4')]},'lastevent':{'type':Sequelize[_0xca4c('0x2')]},'channel':{'type':Sequelize[_0xca4c('0x2')]},'channelstate':{'type':Sequelize[_0xca4c('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xca4c('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xca4c('0x2')]},'exten':{'type':Sequelize[_0xca4c('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xca4c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xca4c('0x2')]},'destcalleridnum':{'type':Sequelize[_0xca4c('0x2')]},'destcalleridname':{'type':Sequelize[_0xca4c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xca4c('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xca4c('0x2')]},'destlanguage':{'type':Sequelize[_0xca4c('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xca4c('0x2')]},'destexten':{'type':Sequelize[_0xca4c('0x2')]},'destpriority':{'type':Sequelize[_0xca4c('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xca4c('0x2')]},'inReplyTo':{'type':Sequelize[_0xca4c('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xca4c('0x2')]},'cc':{'type':Sequelize[_0xca4c('0x2')]},'attachment':{'type':Sequelize[_0xca4c('0x6')]},'html':{'type':Sequelize[_0xca4c('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xca4c('0x7')](_0xca4c('0x8'),_0xca4c('0x9'),_0xca4c('0xa'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xca4c('0x2')]},'projectId':{'type':Sequelize[_0xca4c('0x3')]}}; \ No newline at end of file +var _0xe96e=['FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING'];(function(_0x377f50,_0x5589ba){var _0x14a9d2=function(_0x4ab38b){while(--_0x4ab38b){_0x377f50['push'](_0x377f50['shift']());}};_0x14a9d2(++_0x5589ba);}(_0xe96e,0x14b));var _0xee96=function(_0x5c2eb0,_0x2d2897){_0x5c2eb0=_0x5c2eb0-0x0;var _0x2b4fe1=_0xe96e[_0x5c2eb0];return _0x2b4fe1;};'use strict';var Sequelize=require(_0xee96('0x0'));module[_0xee96('0x1')]={'integration':{'type':Sequelize[_0xee96('0x2')]},'eventChannel':{'type':Sequelize[_0xee96('0x2')]},'exitStatus':{'type':Sequelize[_0xee96('0x2')]},'ticketId':{'type':Sequelize[_0xee96('0x2')]},'integrationId':{'type':Sequelize[_0xee96('0x3')]},'contacts':{'type':Sequelize[_0xee96('0x2')]},'uniqueid':{'type':Sequelize[_0xee96('0x2')]},'calleridnum':{'type':Sequelize[_0xee96('0x2')]},'calleridname':{'type':Sequelize[_0xee96('0x2')]},'queue':{'type':Sequelize[_0xee96('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xee96('0x4')]},'agentconnectAt':{'type':Sequelize[_0xee96('0x4')]},'holdtime':{'type':Sequelize[_0xee96('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xee96('0x3')]},'agentacw':{'type':Sequelize[_0xee96('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xee96('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xee96('0x4')]},'agentdump':{'type':Sequelize[_0xee96('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xee96('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xee96('0x2')]},'connectedlinenum':{'type':Sequelize[_0xee96('0x2')]},'connectedlinename':{'type':Sequelize[_0xee96('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xee96('0x2')]},'context':{'type':Sequelize[_0xee96('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xee96('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xee96('0x2')]},'destcalleridnum':{'type':Sequelize[_0xee96('0x2')]},'destcalleridname':{'type':Sequelize[_0xee96('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xee96('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xee96('0x2')]},'destlanguage':{'type':Sequelize[_0xee96('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xee96('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xee96('0x2')]},'messageId':{'type':Sequelize[_0xee96('0x2')]},'inReplyTo':{'type':Sequelize[_0xee96('0x2')]},'subject':{'type':Sequelize[_0xee96('0x2')]},'from':{'type':Sequelize[_0xee96('0x2')]},'to':{'type':Sequelize[_0xee96('0x2')]},'cc':{'type':Sequelize[_0xee96('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xee96('0x6')]},'text':{'type':Sequelize[_0xee96('0x6')]},'status':{'type':Sequelize[_0xee96('0x7')]('SENT',_0xee96('0x8'),'RECEIVED',_0xee96('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xee96('0x2')]},'appdata':{'type':Sequelize[_0xee96('0x2')]},'projectId':{'type':Sequelize[_0xee96('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index b64db5f..50d523b 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 _0xa981=['nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','rawAttributes','include','options','create','body','find','params','describe','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','IntegrationReport','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x11adcf,_0x2dd961){var _0x436fbb=function(_0x2cb4ac){while(--_0x2cb4ac){_0x11adcf['push'](_0x11adcf['shift']());}};_0x436fbb(++_0x2dd961);}(_0xa981,0x138));var _0x1a98=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0xa981[_0x3358ba];return _0x296e73;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1a98('0x0'));var rp=require('request-promise');var moment=require(_0x1a98('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x1a98('0x2'));var util=require('util');var path=require(_0x1a98('0x3'));var sox=require(_0x1a98('0x4'));var csv=require(_0x1a98('0x5'));var ejs=require(_0x1a98('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1a98('0x7'));var squel=require(_0x1a98('0x8'));var crypto=require(_0x1a98('0x9'));var jsforce=require(_0x1a98('0xa'));var deskjs=require(_0x1a98('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1a98('0xc'));var Redis=require(_0x1a98('0xd'));var authService=require(_0x1a98('0xe'));var qs=require(_0x1a98('0xf'));var as=require(_0x1a98('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1a98('0x11'));var licenseUtil=require(_0x1a98('0x12'));var db=require(_0x1a98('0x13'))['db'];function respondWithStatusCode(_0x74d40,_0x4179d3){_0x4179d3=_0x4179d3||0xcc;return function(_0x356385){if(_0x356385){return _0x74d40[_0x1a98('0x14')](_0x4179d3);}return _0x74d40[_0x1a98('0x15')](_0x4179d3)[_0x1a98('0x16')]();};}function respondWithResult(_0x3bf531,_0xebac68){_0xebac68=_0xebac68||0xc8;return function(_0x1da2dd){if(_0x1da2dd){return _0x3bf531['status'](_0xebac68)[_0x1a98('0x17')](_0x1da2dd);}};}function respondWithFilteredResult(_0x50e94e,_0x225868){return function(_0x1cfcdc){if(_0x1cfcdc){var _0x5eb92a=typeof _0x225868['offset']===_0x1a98('0x18')&&typeof _0x225868['limit']===_0x1a98('0x18');var _0x5d2fb8=_0x1cfcdc['count'];var _0x1af5b4=_0x5eb92a?0x0:_0x225868[_0x1a98('0x19')];var _0x5cb9fb=_0x5eb92a?_0x1cfcdc[_0x1a98('0x1a')]:_0x225868[_0x1a98('0x19')]+_0x225868['limit'];var _0x41a496;if(_0x5cb9fb>=_0x5d2fb8){_0x5cb9fb=_0x5d2fb8;_0x41a496=0xc8;}else{_0x41a496=0xce;}_0x50e94e[_0x1a98('0x15')](_0x41a496);return _0x50e94e[_0x1a98('0x1b')]('Content-Range',_0x1af5b4+'-'+_0x5cb9fb+'/'+_0x5d2fb8)['json'](_0x1cfcdc);}return null;};}function patchUpdates(_0x1ac244){return function(_0x27e4ef){try{jsonpatch[_0x1a98('0x1c')](_0x27e4ef,_0x1ac244,!![]);}catch(_0x4c7e1c){return BPromise[_0x1a98('0x1d')](_0x4c7e1c);}return _0x27e4ef[_0x1a98('0x1e')]();};}function saveUpdates(_0x56e380,_0x1cf1e8){return function(_0x117525){if(_0x117525){return _0x117525[_0x1a98('0x1f')](_0x56e380)[_0x1a98('0x20')](function(_0x4af2d9){return _0x4af2d9;});}return null;};}function removeEntity(_0x3cc153,_0x5d0504){return function(_0x3c5fda){if(_0x3c5fda){return _0x3c5fda[_0x1a98('0x21')]()[_0x1a98('0x20')](function(){_0x3cc153['status'](0xcc)[_0x1a98('0x16')]();});}};}function handleEntityNotFound(_0x3cbe43,_0x421285){return function(_0x55f2af){if(!_0x55f2af){_0x3cbe43['sendStatus'](0x194);}return _0x55f2af;};}function handleError(_0x33f178,_0x3ca2c0){_0x3ca2c0=_0x3ca2c0||0x1f4;return function(_0x4d7654){logger[_0x1a98('0x22')](_0x4d7654[_0x1a98('0x23')]);if(_0x4d7654[_0x1a98('0x24')]){delete _0x4d7654[_0x1a98('0x24')];}_0x33f178[_0x1a98('0x15')](_0x3ca2c0)[_0x1a98('0x25')](_0x4d7654);};}exports[_0x1a98('0x26')]=function(_0x544e94,_0x3cf682){var _0x5e63ba={},_0x1b3272={},_0xba0abb={'count':0x0,'rows':[]};var _0x5f33bf=_['map'](db[_0x1a98('0x27')]['rawAttributes'],function(_0x378f38){return{'name':_0x378f38[_0x1a98('0x28')],'type':_0x378f38[_0x1a98('0x29')][_0x1a98('0x2a')]};});_0x1b3272[_0x1a98('0x2b')]=_[_0x1a98('0x2c')](_0x5f33bf,'name');_0x1b3272[_0x1a98('0x2d')]=_[_0x1a98('0x2e')](_0x544e94['query']);_0x1b3272[_0x1a98('0x2f')]=_['intersection'](_0x1b3272[_0x1a98('0x2b')],_0x1b3272[_0x1a98('0x2d')]);_0x5e63ba[_0x1a98('0x30')]=_[_0x1a98('0x31')](_0x1b3272[_0x1a98('0x2b')],qs[_0x1a98('0x32')](_0x544e94['query'][_0x1a98('0x32')]));_0x5e63ba['attributes']=_0x5e63ba[_0x1a98('0x30')][_0x1a98('0x33')]?_0x5e63ba['attributes']:_0x1b3272[_0x1a98('0x2b')];if(!_0x544e94['query'][_0x1a98('0x34')](_0x1a98('0x35'))){_0x5e63ba[_0x1a98('0x36')]=qs[_0x1a98('0x36')](_0x544e94[_0x1a98('0x2d')][_0x1a98('0x36')]);_0x5e63ba[_0x1a98('0x19')]=qs[_0x1a98('0x19')](_0x544e94[_0x1a98('0x2d')][_0x1a98('0x19')]);}_0x5e63ba['order']=qs[_0x1a98('0x37')](_0x544e94[_0x1a98('0x2d')][_0x1a98('0x37')]);_0x5e63ba[_0x1a98('0x38')]=qs['filters'](_[_0x1a98('0x39')](_0x544e94[_0x1a98('0x2d')],_0x1b3272[_0x1a98('0x2f')]),_0x5f33bf);if(_0x544e94[_0x1a98('0x2d')][_0x1a98('0x3a')]){_0x5e63ba[_0x1a98('0x38')]=_[_0x1a98('0x3b')](_0x5e63ba['where'],{'$or':_[_0x1a98('0x2c')](_0x5f33bf,function(_0x5ea1b0){if(_0x5ea1b0[_0x1a98('0x29')]!==_0x1a98('0x3c')){var _0x2c3cd5={};_0x2c3cd5[_0x5ea1b0['name']]={'$like':'%'+_0x544e94[_0x1a98('0x2d')]['filter']+'%'};return _0x2c3cd5;}})});}_0x5e63ba=_[_0x1a98('0x3b')]({},_0x5e63ba,_0x544e94['options']);var _0x2f2f2b={'where':_0x5e63ba[_0x1a98('0x38')]};return db[_0x1a98('0x27')][_0x1a98('0x1a')](_0x2f2f2b)[_0x1a98('0x20')](function(_0x44ea46){_0xba0abb[_0x1a98('0x1a')]=_0x44ea46;if(_0x544e94[_0x1a98('0x2d')][_0x1a98('0x3d')]){_0x5e63ba['include']=[{'all':!![]}];}return db[_0x1a98('0x27')][_0x1a98('0x3e')](_0x5e63ba);})['then'](function(_0x284a34){_0xba0abb[_0x1a98('0x3f')]=_0x284a34;return _0xba0abb;})[_0x1a98('0x20')](respondWithFilteredResult(_0x3cf682,_0x5e63ba))[_0x1a98('0x40')](handleError(_0x3cf682,null));};exports['show']=function(_0x2f8faa,_0x261a9d){var _0x3f954d={'raw':![],'where':{'id':_0x2f8faa['params']['id']}},_0x53fbc5={};_0x53fbc5[_0x1a98('0x2b')]=_[_0x1a98('0x2e')](db[_0x1a98('0x27')][_0x1a98('0x41')]);_0x53fbc5[_0x1a98('0x2d')]=_['keys'](_0x2f8faa[_0x1a98('0x2d')]);_0x53fbc5[_0x1a98('0x2f')]=_['intersection'](_0x53fbc5['model'],_0x53fbc5[_0x1a98('0x2d')]);_0x3f954d['attributes']=_[_0x1a98('0x31')](_0x53fbc5[_0x1a98('0x2b')],qs[_0x1a98('0x32')](_0x2f8faa[_0x1a98('0x2d')]['fields']));_0x3f954d['attributes']=_0x3f954d['attributes'][_0x1a98('0x33')]?_0x3f954d[_0x1a98('0x30')]:_0x53fbc5[_0x1a98('0x2b')];if(_0x2f8faa['query'][_0x1a98('0x3d')]){_0x3f954d[_0x1a98('0x42')]=[{'all':!![]}];}_0x3f954d=_['merge']({},_0x3f954d,_0x2f8faa[_0x1a98('0x43')]);return db[_0x1a98('0x27')]['find'](_0x3f954d)['then'](handleEntityNotFound(_0x261a9d,null))['then'](respondWithResult(_0x261a9d,null))[_0x1a98('0x40')](handleError(_0x261a9d,null));};exports[_0x1a98('0x44')]=function(_0x92c2fe,_0x2d1db8){return db[_0x1a98('0x27')][_0x1a98('0x44')](_0x92c2fe[_0x1a98('0x45')],{})[_0x1a98('0x20')](respondWithResult(_0x2d1db8,0xc9))[_0x1a98('0x40')](handleError(_0x2d1db8,null));};exports[_0x1a98('0x1f')]=function(_0x4a9047,_0x1ae330){if(_0x4a9047[_0x1a98('0x45')]['id']){delete _0x4a9047['body']['id'];}return db[_0x1a98('0x27')][_0x1a98('0x46')]({'where':{'id':_0x4a9047[_0x1a98('0x47')]['id']}})[_0x1a98('0x20')](handleEntityNotFound(_0x1ae330,null))[_0x1a98('0x20')](saveUpdates(_0x4a9047[_0x1a98('0x45')],null))[_0x1a98('0x20')](respondWithResult(_0x1ae330,null))[_0x1a98('0x40')](handleError(_0x1ae330,null));};exports[_0x1a98('0x21')]=function(_0x447567,_0x272e3e){return db['IntegrationReport'][_0x1a98('0x46')]({'where':{'id':_0x447567[_0x1a98('0x47')]['id']}})[_0x1a98('0x20')](handleEntityNotFound(_0x272e3e,null))[_0x1a98('0x20')](removeEntity(_0x272e3e,null))['catch'](handleError(_0x272e3e,null));};exports[_0x1a98('0x48')]=function(_0x119dcb,_0x21540d){return db[_0x1a98('0x27')]['describe']()[_0x1a98('0x20')](respondWithResult(_0x21540d,null))[_0x1a98('0x40')](handleError(_0x21540d,null));}; \ No newline at end of file +var _0x5dd4=['mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../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','apply','save','update','then','destroy','stack','name','send','map','IntegrationReport','rawAttributes','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x4afa2c,_0x5a246f){var _0x4c7106=function(_0x32c84e){while(--_0x32c84e){_0x4afa2c['push'](_0x4afa2c['shift']());}};_0x4c7106(++_0x5a246f);}(_0x5dd4,0xd1));var _0x45dd=function(_0x3c465e,_0x3e80d1){_0x3c465e=_0x3c465e-0x0;var _0x1234c6=_0x5dd4[_0x3c465e];return _0x1234c6;};'use strict';var emlformat=require(_0x45dd('0x0'));var rimraf=require(_0x45dd('0x1'));var zipdir=require(_0x45dd('0x2'));var jsonpatch=require(_0x45dd('0x3'));var rp=require(_0x45dd('0x4'));var moment=require(_0x45dd('0x5'));var BPromise=require(_0x45dd('0x6'));var Mustache=require(_0x45dd('0x7'));var util=require(_0x45dd('0x8'));var path=require('path');var sox=require(_0x45dd('0x9'));var csv=require('to-csv');var ejs=require(_0x45dd('0xa'));var fs=require('fs');var fs_extra=require(_0x45dd('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x45dd('0xc'));var jsforce=require(_0x45dd('0xd'));var deskjs=require(_0x45dd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x45dd('0xf'));var Papa=require('papaparse');var Redis=require(_0x45dd('0x10'));var authService=require(_0x45dd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x45dd('0x12'));var hardwareService=require(_0x45dd('0x13'));var logger=require(_0x45dd('0x14'))(_0x45dd('0x15'));var utils=require(_0x45dd('0x16'));var config=require(_0x45dd('0x17'));var licenseUtil=require(_0x45dd('0x18'));var db=require(_0x45dd('0x19'))['db'];function respondWithStatusCode(_0x5ca3d9,_0xfa03){_0xfa03=_0xfa03||0xcc;return function(_0x582209){if(_0x582209){return _0x5ca3d9[_0x45dd('0x1a')](_0xfa03);}return _0x5ca3d9['status'](_0xfa03)[_0x45dd('0x1b')]();};}function respondWithResult(_0x343c90,_0x47fc7f){_0x47fc7f=_0x47fc7f||0xc8;return function(_0x1f3dd4){if(_0x1f3dd4){return _0x343c90[_0x45dd('0x1c')](_0x47fc7f)[_0x45dd('0x1d')](_0x1f3dd4);}};}function respondWithFilteredResult(_0x1f138c,_0x3f79ea){return function(_0x37a33f){if(_0x37a33f){var _0x5d7230=typeof _0x3f79ea['offset']===_0x45dd('0x1e')&&typeof _0x3f79ea[_0x45dd('0x1f')]===_0x45dd('0x1e');var _0x2e00bb=_0x37a33f[_0x45dd('0x20')];var _0x8d17f5=_0x5d7230?0x0:_0x3f79ea[_0x45dd('0x21')];var _0x1c1b5c=_0x5d7230?_0x37a33f[_0x45dd('0x20')]:_0x3f79ea[_0x45dd('0x21')]+_0x3f79ea[_0x45dd('0x1f')];var _0x3ea96d;if(_0x1c1b5c>=_0x2e00bb){_0x1c1b5c=_0x2e00bb;_0x3ea96d=0xc8;}else{_0x3ea96d=0xce;}_0x1f138c[_0x45dd('0x1c')](_0x3ea96d);return _0x1f138c[_0x45dd('0x22')](_0x45dd('0x23'),_0x8d17f5+'-'+_0x1c1b5c+'/'+_0x2e00bb)[_0x45dd('0x1d')](_0x37a33f);}return null;};}function patchUpdates(_0xb919bd){return function(_0x17764d){try{jsonpatch[_0x45dd('0x24')](_0x17764d,_0xb919bd,!![]);}catch(_0x3aec4c){return BPromise['reject'](_0x3aec4c);}return _0x17764d[_0x45dd('0x25')]();};}function saveUpdates(_0x183dfc,_0x35a1d6){return function(_0x14c089){if(_0x14c089){return _0x14c089[_0x45dd('0x26')](_0x183dfc)[_0x45dd('0x27')](function(_0x43f056){return _0x43f056;});}return null;};}function removeEntity(_0x3af520,_0x235031){return function(_0x5a171b){if(_0x5a171b){return _0x5a171b[_0x45dd('0x28')]()[_0x45dd('0x27')](function(){_0x3af520[_0x45dd('0x1c')](0xcc)[_0x45dd('0x1b')]();});}};}function handleEntityNotFound(_0x581485,_0x3a3368){return function(_0xc90327){if(!_0xc90327){_0x581485[_0x45dd('0x1a')](0x194);}return _0xc90327;};}function handleError(_0x1cc670,_0x1c56f0){_0x1c56f0=_0x1c56f0||0x1f4;return function(_0x590afa){logger['error'](_0x590afa[_0x45dd('0x29')]);if(_0x590afa[_0x45dd('0x2a')]){delete _0x590afa[_0x45dd('0x2a')];}_0x1cc670[_0x45dd('0x1c')](_0x1c56f0)[_0x45dd('0x2b')](_0x590afa);};}exports['index']=function(_0x4ae3d6,_0x578141){var _0x94654c={},_0x3ffa51={},_0x232598={'count':0x0,'rows':[]};var _0x49ab7a=_[_0x45dd('0x2c')](db[_0x45dd('0x2d')][_0x45dd('0x2e')],function(_0x55f10c){return{'name':_0x55f10c['fieldName'],'type':_0x55f10c['type']['key']};});_0x3ffa51['model']=_['map'](_0x49ab7a,_0x45dd('0x2a'));_0x3ffa51[_0x45dd('0x2f')]=_[_0x45dd('0x30')](_0x4ae3d6['query']);_0x3ffa51[_0x45dd('0x31')]=_[_0x45dd('0x32')](_0x3ffa51[_0x45dd('0x33')],_0x3ffa51['query']);_0x94654c['attributes']=_[_0x45dd('0x32')](_0x3ffa51[_0x45dd('0x33')],qs['fields'](_0x4ae3d6[_0x45dd('0x2f')]['fields']));_0x94654c[_0x45dd('0x34')]=_0x94654c[_0x45dd('0x34')][_0x45dd('0x35')]?_0x94654c['attributes']:_0x3ffa51['model'];if(!_0x4ae3d6[_0x45dd('0x2f')][_0x45dd('0x36')]('nolimit')){_0x94654c[_0x45dd('0x1f')]=qs[_0x45dd('0x1f')](_0x4ae3d6[_0x45dd('0x2f')]['limit']);_0x94654c[_0x45dd('0x21')]=qs[_0x45dd('0x21')](_0x4ae3d6[_0x45dd('0x2f')][_0x45dd('0x21')]);}_0x94654c['order']=qs[_0x45dd('0x37')](_0x4ae3d6[_0x45dd('0x2f')][_0x45dd('0x37')]);_0x94654c[_0x45dd('0x38')]=qs['filters'](_['pick'](_0x4ae3d6[_0x45dd('0x2f')],_0x3ffa51[_0x45dd('0x31')]),_0x49ab7a);if(_0x4ae3d6['query']['filter']){_0x94654c[_0x45dd('0x38')]=_['merge'](_0x94654c[_0x45dd('0x38')],{'$or':_['map'](_0x49ab7a,function(_0x2e54c9){if(_0x2e54c9['type']!==_0x45dd('0x39')){var _0x50c5ae={};_0x50c5ae[_0x2e54c9['name']]={'$like':'%'+_0x4ae3d6[_0x45dd('0x2f')]['filter']+'%'};return _0x50c5ae;}})});}_0x94654c=_[_0x45dd('0x3a')]({},_0x94654c,_0x4ae3d6[_0x45dd('0x3b')]);var _0x354ce4={'where':_0x94654c[_0x45dd('0x38')]};return db[_0x45dd('0x2d')]['count'](_0x354ce4)[_0x45dd('0x27')](function(_0x57f6eb){_0x232598['count']=_0x57f6eb;if(_0x4ae3d6['query'][_0x45dd('0x3c')]){_0x94654c[_0x45dd('0x3d')]=[{'all':!![]}];}return db[_0x45dd('0x2d')][_0x45dd('0x3e')](_0x94654c);})[_0x45dd('0x27')](function(_0x4d86ed){_0x232598[_0x45dd('0x3f')]=_0x4d86ed;return _0x232598;})['then'](respondWithFilteredResult(_0x578141,_0x94654c))[_0x45dd('0x40')](handleError(_0x578141,null));};exports[_0x45dd('0x41')]=function(_0x2af8a8,_0xce7f55){var _0x5e1b74={'raw':![],'where':{'id':_0x2af8a8[_0x45dd('0x42')]['id']}},_0x4e71d2={};_0x4e71d2[_0x45dd('0x33')]=_[_0x45dd('0x30')](db['IntegrationReport'][_0x45dd('0x2e')]);_0x4e71d2[_0x45dd('0x2f')]=_[_0x45dd('0x30')](_0x2af8a8[_0x45dd('0x2f')]);_0x4e71d2[_0x45dd('0x31')]=_[_0x45dd('0x32')](_0x4e71d2['model'],_0x4e71d2[_0x45dd('0x2f')]);_0x5e1b74[_0x45dd('0x34')]=_[_0x45dd('0x32')](_0x4e71d2[_0x45dd('0x33')],qs[_0x45dd('0x43')](_0x2af8a8[_0x45dd('0x2f')]['fields']));_0x5e1b74[_0x45dd('0x34')]=_0x5e1b74[_0x45dd('0x34')]['length']?_0x5e1b74['attributes']:_0x4e71d2['model'];if(_0x2af8a8[_0x45dd('0x2f')][_0x45dd('0x3c')]){_0x5e1b74[_0x45dd('0x3d')]=[{'all':!![]}];}_0x5e1b74=_[_0x45dd('0x3a')]({},_0x5e1b74,_0x2af8a8['options']);return db[_0x45dd('0x2d')][_0x45dd('0x44')](_0x5e1b74)['then'](handleEntityNotFound(_0xce7f55,null))[_0x45dd('0x27')](respondWithResult(_0xce7f55,null))[_0x45dd('0x40')](handleError(_0xce7f55,null));};exports['create']=function(_0x2ed13d,_0x199cb4){return db['IntegrationReport'][_0x45dd('0x45')](_0x2ed13d[_0x45dd('0x46')],{})['then'](respondWithResult(_0x199cb4,0xc9))['catch'](handleError(_0x199cb4,null));};exports[_0x45dd('0x26')]=function(_0x588d65,_0x503fdf){if(_0x588d65[_0x45dd('0x46')]['id']){delete _0x588d65[_0x45dd('0x46')]['id'];}return db['IntegrationReport'][_0x45dd('0x44')]({'where':{'id':_0x588d65['params']['id']}})[_0x45dd('0x27')](handleEntityNotFound(_0x503fdf,null))[_0x45dd('0x27')](saveUpdates(_0x588d65[_0x45dd('0x46')],null))[_0x45dd('0x27')](respondWithResult(_0x503fdf,null))[_0x45dd('0x40')](handleError(_0x503fdf,null));};exports[_0x45dd('0x28')]=function(_0x4ff3f5,_0x1e6642){return db['IntegrationReport']['find']({'where':{'id':_0x4ff3f5[_0x45dd('0x42')]['id']}})[_0x45dd('0x27')](handleEntityNotFound(_0x1e6642,null))['then'](removeEntity(_0x1e6642,null))[_0x45dd('0x40')](handleError(_0x1e6642,null));};exports['describe']=function(_0x312bba,_0x14a42e){return db[_0x45dd('0x2d')][_0x45dd('0x47')]()[_0x45dd('0x27')](respondWithResult(_0x14a42e,null))[_0x45dd('0x40')](handleError(_0x14a42e,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index b3bf231..929ab04 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 _0x005f=['bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','lodash','util','api'];(function(_0x28258a,_0x22f398){var _0x4e968e=function(_0xda8c73){while(--_0xda8c73){_0x28258a['push'](_0x28258a['shift']());}};_0x4e968e(++_0x22f398);}(_0x005f,0x1b9));var _0xf005=function(_0x53edd1,_0x581daf){_0x53edd1=_0x53edd1-0x0;var _0x2f5322=_0x005f[_0x53edd1];return _0x2f5322;};'use strict';var _=require(_0xf005('0x0'));var util=require(_0xf005('0x1'));var logger=require('../../config/logger')(_0xf005('0x2'));var moment=require('moment');var BPromise=require(_0xf005('0x3'));var rp=require(_0xf005('0x4'));var fs=require('fs');var path=require(_0xf005('0x5'));var rimraf=require(_0xf005('0x6'));var config=require(_0xf005('0x7'));var attributes=require(_0xf005('0x8'));module[_0xf005('0x9')]=function(_0x4fe27e,_0x4af197){return _0x4fe27e[_0xf005('0xa')](_0xf005('0xb'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e6f=['rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','util','../../config/logger','api','bluebird','path'];(function(_0x2d5234,_0x34ddc2){var _0x553ab2=function(_0x2cd6c9){while(--_0x2cd6c9){_0x2d5234['push'](_0x2d5234['shift']());}};_0x553ab2(++_0x34ddc2);}(_0x4e6f,0x1b3));var _0xf4e6=function(_0x22a4b5,_0x742426){_0x22a4b5=_0x22a4b5-0x0;var _0x4a2320=_0x4e6f[_0x22a4b5];return _0x4a2320;};'use strict';var _=require('lodash');var util=require(_0xf4e6('0x0'));var logger=require(_0xf4e6('0x1'))(_0xf4e6('0x2'));var moment=require('moment');var BPromise=require(_0xf4e6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4e6('0x4'));var rimraf=require(_0xf4e6('0x5'));var config=require(_0xf4e6('0x6'));var attributes=require(_0xf4e6('0x7'));module[_0xf4e6('0x8')]=function(_0xee8b97,_0x1572bc){return _0xee8b97[_0xf4e6('0x9')](_0xf4e6('0xa'),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 13301da..00bb24e 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 _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x386b03,_0x5d0000){var _0xd3d524=function(_0x474754){while(--_0x474754){_0x386b03['push'](_0x386b03['shift']());}};_0xd3d524(++_0x5d0000);}(_0x4137,0xf8));var _0x7413=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4137[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('IntegrationReport,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file +var _0x814b=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x814b,0x1a2));var _0xb814=function(_0x5e2b34,_0x58385c){_0x5e2b34=_0x5e2b34-0x0;var _0x4859f9=_0x814b[_0x5e2b34];return _0x4859f9;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 171b4b6..451f906 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 _0xc01b=['exports','multer','util','path','connect-timeout','Router','fs-extra','./interval.controller','get','/:id','isAuthenticated','show','/:id/sub_intervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete'];(function(_0x283127,_0x54d4d5){var _0x43da5d=function(_0x10947f){while(--_0x10947f){_0x283127['push'](_0x283127['shift']());}};_0x43da5d(++_0x54d4d5);}(_0xc01b,0x65));var _0xbc01=function(_0x6df7cc,_0x12d3c0){_0x6df7cc=_0x6df7cc-0x0;var _0x4bc8f2=_0xc01b[_0x6df7cc];return _0x4bc8f2;};'use strict';var multer=require(_0xbc01('0x0'));var util=require(_0xbc01('0x1'));var path=require(_0xbc01('0x2'));var timeout=require(_0xbc01('0x3'));var express=require('express');var router=express[_0xbc01('0x4')]();var fs_extra=require(_0xbc01('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbc01('0x6'));router[_0xbc01('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbc01('0x7')](_0xbc01('0x8'),auth[_0xbc01('0x9')](),controller[_0xbc01('0xa')]);router[_0xbc01('0x7')](_0xbc01('0xb'),auth[_0xbc01('0x9')](),controller['getIntervals']);router[_0xbc01('0xc')]('/',auth[_0xbc01('0x9')](),controller[_0xbc01('0xd')]);router[_0xbc01('0xc')](_0xbc01('0xb'),auth[_0xbc01('0x9')](),controller[_0xbc01('0xe')]);router[_0xbc01('0xc')](_0xbc01('0xf'),auth[_0xbc01('0x9')](),controller[_0xbc01('0x10')]);router[_0xbc01('0x11')](_0xbc01('0x8'),auth[_0xbc01('0x9')](),controller['update']);router[_0xbc01('0x12')](_0xbc01('0x8'),auth[_0xbc01('0x9')](),controller['destroy']);module[_0xbc01('0x13')]=router; \ No newline at end of file +var _0xaccc=['post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated','get','/:id','show','/:id/sub_intervals','getIntervals'];(function(_0x70ba06,_0x16503a){var _0x5c9454=function(_0x21b997){while(--_0x21b997){_0x70ba06['push'](_0x70ba06['shift']());}};_0x5c9454(++_0x16503a);}(_0xaccc,0xda));var _0xcacc=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xaccc[_0x1cb18a];return _0x22442e;};'use strict';var multer=require(_0xcacc('0x0'));var util=require(_0xcacc('0x1'));var path=require(_0xcacc('0x2'));var timeout=require(_0xcacc('0x3'));var express=require(_0xcacc('0x4'));var router=express[_0xcacc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xcacc('0x6'));var interaction=require(_0xcacc('0x7'));var config=require(_0xcacc('0x8'));var controller=require(_0xcacc('0x9'));router['get']('/',auth[_0xcacc('0xa')](),controller['index']);router[_0xcacc('0xb')](_0xcacc('0xc'),auth[_0xcacc('0xa')](),controller[_0xcacc('0xd')]);router[_0xcacc('0xb')](_0xcacc('0xe'),auth[_0xcacc('0xa')](),controller[_0xcacc('0xf')]);router[_0xcacc('0x10')]('/',auth[_0xcacc('0xa')](),controller[_0xcacc('0x11')]);router[_0xcacc('0x10')]('/:id/sub_intervals',auth[_0xcacc('0xa')](),controller[_0xcacc('0x12')]);router['post'](_0xcacc('0x13'),auth[_0xcacc('0xa')](),controller[_0xcacc('0x14')]);router[_0xcacc('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xcacc('0x16')]);router[_0xcacc('0x17')]('/:id',auth[_0xcacc('0xa')](),controller[_0xcacc('0x18')]);module[_0xcacc('0x19')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 975e4f2..f285542 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 _0x6554=['exports','STRING','sequelize'];(function(_0x57c829,_0x3bd4bc){var _0x5d2d44=function(_0x40063d){while(--_0x40063d){_0x57c829['push'](_0x57c829['shift']());}};_0x5d2d44(++_0x3bd4bc);}(_0x6554,0xe3));var _0x4655=function(_0x5a4e67,_0x1bc05c){_0x5a4e67=_0x5a4e67-0x0;var _0x42df7a=_0x6554[_0x5a4e67];return _0x42df7a;};'use strict';var Sequelize=require(_0x4655('0x0'));module[_0x4655('0x1')]={'name':{'type':Sequelize[_0x4655('0x2')]},'description':{'type':Sequelize[_0x4655('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xa6cf=['exports','STRING'];(function(_0x133b22,_0x472a6f){var _0x528e86=function(_0x499e75){while(--_0x499e75){_0x133b22['push'](_0x133b22['shift']());}};_0x528e86(++_0x472a6f);}(_0xa6cf,0xce));var _0xfa6c=function(_0x3330a6,_0x33da1f){_0x3330a6=_0x3330a6-0x0;var _0x260253=_0xa6cf[_0x3330a6];return _0x260253;};'use strict';var Sequelize=require('sequelize');module[_0xfa6c('0x0')]={'name':{'type':Sequelize[_0xfa6c('0x1')]},'description':{'type':Sequelize[_0xfa6c('0x1')]},'interval':{'type':Sequelize[_0xfa6c('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index df26ae0..4f24509 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 _0xfa69=['VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addInterval','IntervalId','getIntervals','findOne','length','options','hasOwnProperty','nolimit','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','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/utils','../../config/environment','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','Intervals','UserProfileResource','end','stack','name','send','Interval','type','key','model','query','keys','intersection','attributes','fields','order','sort','where','pick','filters','filter','map'];(function(_0x427fa3,_0x1124a5){var _0xa38b6b=function(_0x17ef41){while(--_0x17ef41){_0x427fa3['push'](_0x427fa3['shift']());}};_0xa38b6b(++_0x1124a5);}(_0xfa69,0xe5));var _0x9fa6=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xfa69[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x9fa6('0x0'));var rimraf=require(_0x9fa6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9fa6('0x2'));var rp=require(_0x9fa6('0x3'));var moment=require(_0x9fa6('0x4'));var BPromise=require(_0x9fa6('0x5'));var Mustache=require(_0x9fa6('0x6'));var util=require('util');var path=require(_0x9fa6('0x7'));var sox=require(_0x9fa6('0x8'));var csv=require(_0x9fa6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9fa6('0xa'));var _=require(_0x9fa6('0xb'));var squel=require('squel');var crypto=require(_0x9fa6('0xc'));var jsforce=require(_0x9fa6('0xd'));var deskjs=require(_0x9fa6('0xe'));var toCsv=require(_0x9fa6('0x9'));var querystring=require(_0x9fa6('0xf'));var Papa=require(_0x9fa6('0x10'));var Redis=require(_0x9fa6('0x11'));var authService=require(_0x9fa6('0x12'));var qs=require(_0x9fa6('0x13'));var as=require(_0x9fa6('0x14'));var hardwareService=require(_0x9fa6('0x15'));var logger=require(_0x9fa6('0x16'))(_0x9fa6('0x17'));var utils=require(_0x9fa6('0x18'));var config=require(_0x9fa6('0x19'));var licenseUtil=require(_0x9fa6('0x1a'));var db=require('../../mysqldb')['db'];var extensions=require(_0x9fa6('0x1b'));function respondWithStatusCode(_0x3e21ff,_0x169fa2){_0x169fa2=_0x169fa2||0xcc;return function(_0x2d5953){if(_0x2d5953){return _0x3e21ff[_0x9fa6('0x1c')](_0x169fa2);}return _0x3e21ff['status'](_0x169fa2)['end']();};}function respondWithResult(_0x4e0111,_0x15b2c0){_0x15b2c0=_0x15b2c0||0xc8;return function(_0x322f61){if(_0x322f61){return _0x4e0111[_0x9fa6('0x1d')](_0x15b2c0)[_0x9fa6('0x1e')](_0x322f61);}};}function respondWithFilteredResult(_0x50dbdb,_0x371b35){return function(_0x1b657){if(_0x1b657){var _0x15d08d=typeof _0x371b35[_0x9fa6('0x1f')]===_0x9fa6('0x20')&&typeof _0x371b35[_0x9fa6('0x21')]===_0x9fa6('0x20');var _0x43f649=_0x1b657['count'];var _0x100748=_0x15d08d?0x0:_0x371b35[_0x9fa6('0x1f')];var _0xbb624e=_0x15d08d?_0x1b657[_0x9fa6('0x22')]:_0x371b35[_0x9fa6('0x1f')]+_0x371b35[_0x9fa6('0x21')];var _0xf99fc1;if(_0xbb624e>=_0x43f649){_0xbb624e=_0x43f649;_0xf99fc1=0xc8;}else{_0xf99fc1=0xce;}_0x50dbdb[_0x9fa6('0x1d')](_0xf99fc1);return _0x50dbdb[_0x9fa6('0x23')](_0x9fa6('0x24'),_0x100748+'-'+_0xbb624e+'/'+_0x43f649)[_0x9fa6('0x1e')](_0x1b657);}return null;};}function patchUpdates(_0x43170f){return function(_0x220249){try{jsonpatch['apply'](_0x220249,_0x43170f,!![]);}catch(_0x5c889d){return BPromise[_0x9fa6('0x25')](_0x5c889d);}return _0x220249['save']();};}function saveUpdates(_0x5871d2,_0x273d9c){return function(_0x3bffcb){if(_0x3bffcb){return _0x3bffcb['update'](_0x5871d2)[_0x9fa6('0x26')](function(_0x5d4e63){return _0x5d4e63;});}return null;};}function removeEntity(_0xf5293e,_0xdfb4a0){return function(_0x2a252d){if(_0x2a252d){return _0x2a252d[_0x9fa6('0x27')]()[_0x9fa6('0x26')](function(){var _0x5f1d30=_0x2a252d['get']({'plain':!![]});var _0x464cd1=_0x9fa6('0x28');return db[_0x9fa6('0x29')][_0x9fa6('0x27')]({'where':{'type':_0x464cd1,'resourceId':_0x5f1d30['id']}})[_0x9fa6('0x26')](function(){return _0x2a252d;});})[_0x9fa6('0x26')](function(){_0xf5293e[_0x9fa6('0x1d')](0xcc)[_0x9fa6('0x2a')]();});}};}function handleEntityNotFound(_0x7b47f0,_0x1e4b99){return function(_0x51d95f){if(!_0x51d95f){_0x7b47f0[_0x9fa6('0x1c')](0x194);}return _0x51d95f;};}function handleError(_0x4ffe0b,_0x3231cf){_0x3231cf=_0x3231cf||0x1f4;return function(_0x17daa5){logger['error'](_0x17daa5[_0x9fa6('0x2b')]);if(_0x17daa5[_0x9fa6('0x2c')]){delete _0x17daa5[_0x9fa6('0x2c')];}_0x4ffe0b[_0x9fa6('0x1d')](_0x3231cf)[_0x9fa6('0x2d')](_0x17daa5);};}exports['index']=function(_0x4ec93f,_0x21537b){var _0x49d565={},_0x189bd9={},_0x39e50d={'count':0x0,'rows':[]};var _0xad28c6=_['map'](db[_0x9fa6('0x2e')]['rawAttributes'],function(_0x256d21){return{'name':_0x256d21['fieldName'],'type':_0x256d21[_0x9fa6('0x2f')][_0x9fa6('0x30')]};});_0x189bd9[_0x9fa6('0x31')]=_['map'](_0xad28c6,_0x9fa6('0x2c'));_0x189bd9[_0x9fa6('0x32')]=_[_0x9fa6('0x33')](_0x4ec93f[_0x9fa6('0x32')]);_0x189bd9['filters']=_[_0x9fa6('0x34')](_0x189bd9['model'],_0x189bd9[_0x9fa6('0x32')]);_0x49d565[_0x9fa6('0x35')]=_['intersection'](_0x189bd9[_0x9fa6('0x31')],qs['fields'](_0x4ec93f[_0x9fa6('0x32')][_0x9fa6('0x36')]));_0x49d565[_0x9fa6('0x35')]=_0x49d565['attributes']['length']?_0x49d565['attributes']:_0x189bd9[_0x9fa6('0x31')];if(!_0x4ec93f[_0x9fa6('0x32')]['hasOwnProperty']('nolimit')){_0x49d565[_0x9fa6('0x21')]=qs[_0x9fa6('0x21')](_0x4ec93f[_0x9fa6('0x32')][_0x9fa6('0x21')]);_0x49d565[_0x9fa6('0x1f')]=qs[_0x9fa6('0x1f')](_0x4ec93f[_0x9fa6('0x32')][_0x9fa6('0x1f')]);}_0x49d565[_0x9fa6('0x37')]=qs[_0x9fa6('0x38')](_0x4ec93f['query'][_0x9fa6('0x38')]);_0x49d565[_0x9fa6('0x39')]=qs['filters'](_[_0x9fa6('0x3a')](_0x4ec93f['query'],_0x189bd9[_0x9fa6('0x3b')]),_0xad28c6);if(_0x4ec93f[_0x9fa6('0x32')][_0x9fa6('0x3c')]){_0x49d565[_0x9fa6('0x39')]=_['merge'](_0x49d565[_0x9fa6('0x39')],{'$or':_[_0x9fa6('0x3d')](_0xad28c6,function(_0x5b61e3){if(_0x5b61e3[_0x9fa6('0x2f')]!==_0x9fa6('0x3e')){var _0x50cd37={};_0x50cd37[_0x5b61e3[_0x9fa6('0x2c')]]={'$like':'%'+_0x4ec93f[_0x9fa6('0x32')][_0x9fa6('0x3c')]+'%'};return _0x50cd37;}})});}_0x49d565=_[_0x9fa6('0x3f')]({},_0x49d565,_0x4ec93f['options']);var _0x6ed6eb={'where':_0x49d565[_0x9fa6('0x39')]};return db[_0x9fa6('0x2e')][_0x9fa6('0x22')](_0x6ed6eb)[_0x9fa6('0x26')](function(_0x5d91d8){_0x39e50d[_0x9fa6('0x22')]=_0x5d91d8;if(_0x4ec93f[_0x9fa6('0x32')][_0x9fa6('0x40')]){_0x49d565[_0x9fa6('0x41')]=[{'all':!![]}];}return db[_0x9fa6('0x2e')][_0x9fa6('0x42')](_0x49d565);})[_0x9fa6('0x26')](function(_0x310e57){_0x39e50d[_0x9fa6('0x43')]=_0x310e57;return _0x39e50d;})[_0x9fa6('0x26')](respondWithFilteredResult(_0x21537b,_0x49d565))[_0x9fa6('0x44')](handleError(_0x21537b,null));};exports[_0x9fa6('0x45')]=function(_0xc014c4,_0x31e8ba){var _0x5c3a2e={'raw':!![],'where':{'id':_0xc014c4[_0x9fa6('0x46')]['id']}},_0x581274={};_0x581274[_0x9fa6('0x31')]=_[_0x9fa6('0x33')](db[_0x9fa6('0x2e')][_0x9fa6('0x47')]);_0x581274[_0x9fa6('0x32')]=_['keys'](_0xc014c4['query']);_0x581274['filters']=_['intersection'](_0x581274['model'],_0x581274[_0x9fa6('0x32')]);_0x5c3a2e[_0x9fa6('0x35')]=_[_0x9fa6('0x34')](_0x581274[_0x9fa6('0x31')],qs['fields'](_0xc014c4[_0x9fa6('0x32')][_0x9fa6('0x36')]));_0x5c3a2e[_0x9fa6('0x35')]=_0x5c3a2e[_0x9fa6('0x35')]['length']?_0x5c3a2e[_0x9fa6('0x35')]:_0x581274['model'];if(_0xc014c4[_0x9fa6('0x32')][_0x9fa6('0x40')]){_0x5c3a2e['include']=[{'all':!![]}];}_0x5c3a2e=_[_0x9fa6('0x3f')]({},_0x5c3a2e,_0xc014c4['options']);return db[_0x9fa6('0x2e')][_0x9fa6('0x48')](_0x5c3a2e)[_0x9fa6('0x26')](handleEntityNotFound(_0x31e8ba,null))['then'](respondWithResult(_0x31e8ba,null))[_0x9fa6('0x44')](handleError(_0x31e8ba,null));};exports[_0x9fa6('0x49')]=function(_0x214d36,_0x346606){return db['Interval'][_0x9fa6('0x49')](_0x214d36['body'],{})[_0x9fa6('0x26')](function(_0x5a0bb2){var _0x1ff1db=_0x214d36[_0x9fa6('0x4a')]['get']({'plain':!![]});if(!_0x1ff1db)throw new Error(_0x9fa6('0x4b'));if(_0x1ff1db[_0x9fa6('0x4c')]==='user'){var _0x5f055d=_0x5a0bb2[_0x9fa6('0x4d')]({'plain':!![]});var _0xa35132=_0x9fa6('0x28');return db[_0x9fa6('0x4e')]['find']({'where':{'name':_0xa35132,'userProfileId':_0x1ff1db[_0x9fa6('0x4f')]},'raw':!![]})['then'](function(_0x29a275){if(_0x29a275&&_0x29a275[_0x9fa6('0x50')]===0x0){return db[_0x9fa6('0x29')]['create']({'name':_0x5f055d['name'],'resourceId':_0x5f055d['id'],'type':_0x29a275[_0x9fa6('0x2c')],'sectionId':_0x29a275['id']},{})[_0x9fa6('0x26')](function(){return _0x5a0bb2;});}else{return _0x5a0bb2;}})[_0x9fa6('0x44')](function(_0x5040f7){logger[_0x9fa6('0x51')](_0x9fa6('0x52'),_0x5040f7);throw _0x5040f7;});}return _0x5a0bb2;})[_0x9fa6('0x26')](respondWithResult(_0x346606,0xc9))[_0x9fa6('0x44')](handleError(_0x346606,null));};exports[_0x9fa6('0x53')]=function(_0x177b6d,_0x5d809f){if(_0x177b6d[_0x9fa6('0x54')]['id']){delete _0x177b6d[_0x9fa6('0x54')]['id'];}return db['Interval'][_0x9fa6('0x48')]({'where':{'id':_0x177b6d['params']['id']}})[_0x9fa6('0x26')](handleEntityNotFound(_0x5d809f,null))[_0x9fa6('0x26')](saveUpdates(_0x177b6d[_0x9fa6('0x54')],null))[_0x9fa6('0x26')](respondWithResult(_0x5d809f,null))[_0x9fa6('0x44')](handleError(_0x5d809f,null));};exports['destroy']=function(_0x19db0a,_0x2ccb1c){return db[_0x9fa6('0x2e')]['find']({'where':{'id':_0x19db0a[_0x9fa6('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ccb1c,null))[_0x9fa6('0x26')](removeEntity(_0x2ccb1c,null))[_0x9fa6('0x44')](handleError(_0x2ccb1c,null));};exports[_0x9fa6('0x55')]=function(_0x83eed6,_0x2962cf,_0x31d375){if(_0x83eed6[_0x9fa6('0x54')]['id']){delete _0x83eed6['body']['id'];}return db[_0x9fa6('0x2e')][_0x9fa6('0x48')]({'where':{'id':_0x83eed6[_0x9fa6('0x46')]['id']}})[_0x9fa6('0x26')](handleEntityNotFound(_0x2962cf,null))['then'](function(_0x42ae09){if(_0x42ae09){_0x83eed6['body'][_0x9fa6('0x56')]=_0x42ae09['id'];return db['Interval'][_0x9fa6('0x49')](_0x83eed6[_0x9fa6('0x54')]);}})[_0x9fa6('0x26')](respondWithResult(_0x2962cf,null))['catch'](handleError(_0x2962cf,null));};exports[_0x9fa6('0x57')]=function(_0x449331,_0x45536f,_0x258ac3){var _0x1f166e={};var _0x30fd0c={};var _0x56764d;var _0x5b792e;return db[_0x9fa6('0x2e')][_0x9fa6('0x58')]({'where':{'id':_0x449331[_0x9fa6('0x46')]['id']}})[_0x9fa6('0x26')](handleEntityNotFound(_0x45536f,null))[_0x9fa6('0x26')](function(_0x46ac40){if(_0x46ac40){_0x56764d=_0x46ac40;_0x30fd0c[_0x9fa6('0x31')]=_[_0x9fa6('0x33')](db[_0x9fa6('0x2e')]['rawAttributes']);_0x30fd0c['query']=_['keys'](_0x449331[_0x9fa6('0x32')]);_0x30fd0c['filters']=_[_0x9fa6('0x34')](_0x30fd0c[_0x9fa6('0x31')],_0x30fd0c[_0x9fa6('0x32')]);_0x1f166e[_0x9fa6('0x35')]=_[_0x9fa6('0x34')](_0x30fd0c[_0x9fa6('0x31')],qs[_0x9fa6('0x36')](_0x449331[_0x9fa6('0x32')][_0x9fa6('0x36')]));_0x1f166e[_0x9fa6('0x35')]=_0x1f166e[_0x9fa6('0x35')][_0x9fa6('0x59')]?_0x1f166e[_0x9fa6('0x35')]:_0x30fd0c['model'];_0x1f166e['order']=qs[_0x9fa6('0x38')](_0x449331[_0x9fa6('0x32')][_0x9fa6('0x38')]);_0x1f166e[_0x9fa6('0x39')]=qs['filters'](_[_0x9fa6('0x3a')](_0x449331['query'],_0x30fd0c[_0x9fa6('0x3b')]));if(_0x449331[_0x9fa6('0x32')][_0x9fa6('0x3c')]){_0x1f166e[_0x9fa6('0x39')]=_[_0x9fa6('0x3f')](_0x1f166e['where'],{'$or':_[_0x9fa6('0x3d')](_0x1f166e['attributes'],function(_0xcc1cb7){var _0x22f66b={};_0x22f66b[_0xcc1cb7]={'$like':'%'+_0x449331['query']['filter']+'%'};return _0x22f66b;})});}_0x1f166e=_[_0x9fa6('0x3f')]({},_0x1f166e,_0x449331[_0x9fa6('0x5a')]);return _0x56764d['getIntervals'](_0x1f166e);}})[_0x9fa6('0x26')](function(_0x1518c4){if(_0x1518c4){_0x5b792e=_0x1518c4[_0x9fa6('0x59')];if(!_0x449331[_0x9fa6('0x32')][_0x9fa6('0x5b')](_0x9fa6('0x5c'))){_0x1f166e[_0x9fa6('0x21')]=qs['limit'](_0x449331[_0x9fa6('0x32')]['limit']);_0x1f166e[_0x9fa6('0x1f')]=qs[_0x9fa6('0x1f')](_0x449331[_0x9fa6('0x32')][_0x9fa6('0x1f')]);}return _0x56764d[_0x9fa6('0x57')](_0x1f166e);}})[_0x9fa6('0x26')](function(_0x26632d){if(_0x26632d){return _0x26632d?{'count':_0x5b792e,'rows':_0x26632d}:null;}})[_0x9fa6('0x26')](respondWithResult(_0x45536f,null))[_0x9fa6('0x44')](handleError(_0x45536f,null));};exports[_0x9fa6('0x5d')]=function(_0x3200f2,_0x1b0105,_0x21dc1a){return db[_0x9fa6('0x2e')][_0x9fa6('0x58')]({'where':{'id':_0x3200f2['params']['id']}})['then'](handleEntityNotFound(_0x1b0105,null))[_0x9fa6('0x26')](function(_0x3459de){if(_0x3459de){return db[_0x9fa6('0x5e')][_0x9fa6('0x5f')](function(_0x52f5f1){return db['Interval'][_0x9fa6('0x27')]({'where':{'IntervalId':_0x3200f2[_0x9fa6('0x46')]['id']},'transaction':_0x52f5f1})[_0x9fa6('0x26')](function(_0x26bcbe){var _0x1211a1=_[_0x9fa6('0x3d')](_0x3200f2[_0x9fa6('0x54')],function(_0x4c07e4){delete _0x4c07e4['id'];_0x4c07e4[_0x9fa6('0x56')]=_0x3200f2['params']['id'];return _0x4c07e4;});return db[_0x9fa6('0x2e')][_0x9fa6('0x60')](_0x1211a1,{'transaction':_0x52f5f1});});})[_0x9fa6('0x26')](function(){return db[_0x9fa6('0x2e')][_0x9fa6('0x42')]({'where':{'IntervalId':_0x3200f2['params']['id']}});});}})[_0x9fa6('0x26')](respondWithResult(_0x1b0105,null))['catch'](handleError(_0x1b0105,null));}; \ No newline at end of file +var _0xce28=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','get','Intervals','UserProfileResource','destroy','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','body','IntervalId','getIntervals','findOne','filter','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xce28,0x9d));var _0x8ce2=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xce28[_0x2f45ea];return _0x485a84;};'use strict';var emlformat=require(_0x8ce2('0x0'));var rimraf=require(_0x8ce2('0x1'));var zipdir=require(_0x8ce2('0x2'));var jsonpatch=require(_0x8ce2('0x3'));var rp=require(_0x8ce2('0x4'));var moment=require('moment');var BPromise=require(_0x8ce2('0x5'));var Mustache=require(_0x8ce2('0x6'));var util=require(_0x8ce2('0x7'));var path=require(_0x8ce2('0x8'));var sox=require(_0x8ce2('0x9'));var csv=require(_0x8ce2('0xa'));var ejs=require(_0x8ce2('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ce2('0xc'));var squel=require(_0x8ce2('0xd'));var crypto=require(_0x8ce2('0xe'));var jsforce=require(_0x8ce2('0xf'));var deskjs=require(_0x8ce2('0x10'));var toCsv=require(_0x8ce2('0xa'));var querystring=require('querystring');var Papa=require(_0x8ce2('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8ce2('0x12'));var as=require(_0x8ce2('0x13'));var hardwareService=require(_0x8ce2('0x14'));var logger=require('../../config/logger')(_0x8ce2('0x15'));var utils=require(_0x8ce2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8ce2('0x17'));var db=require(_0x8ce2('0x18'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x5b8f92,_0x522626){_0x522626=_0x522626||0xcc;return function(_0x29b113){if(_0x29b113){return _0x5b8f92['sendStatus'](_0x522626);}return _0x5b8f92[_0x8ce2('0x19')](_0x522626)[_0x8ce2('0x1a')]();};}function respondWithResult(_0x219e69,_0x5ce493){_0x5ce493=_0x5ce493||0xc8;return function(_0x3bb3ff){if(_0x3bb3ff){return _0x219e69[_0x8ce2('0x19')](_0x5ce493)[_0x8ce2('0x1b')](_0x3bb3ff);}};}function respondWithFilteredResult(_0x38443b,_0x1101b7){return function(_0x2a1c07){if(_0x2a1c07){var _0x5d59af=typeof _0x1101b7[_0x8ce2('0x1c')]===_0x8ce2('0x1d')&&typeof _0x1101b7[_0x8ce2('0x1e')]===_0x8ce2('0x1d');var _0x5f119a=_0x2a1c07[_0x8ce2('0x1f')];var _0x1a5021=_0x5d59af?0x0:_0x1101b7[_0x8ce2('0x1c')];var _0xff2d85=_0x5d59af?_0x2a1c07[_0x8ce2('0x1f')]:_0x1101b7['offset']+_0x1101b7[_0x8ce2('0x1e')];var _0xad6faf;if(_0xff2d85>=_0x5f119a){_0xff2d85=_0x5f119a;_0xad6faf=0xc8;}else{_0xad6faf=0xce;}_0x38443b[_0x8ce2('0x19')](_0xad6faf);return _0x38443b['set'](_0x8ce2('0x20'),_0x1a5021+'-'+_0xff2d85+'/'+_0x5f119a)['json'](_0x2a1c07);}return null;};}function patchUpdates(_0x254005){return function(_0x2342ce){try{jsonpatch['apply'](_0x2342ce,_0x254005,!![]);}catch(_0x17ebf3){return BPromise[_0x8ce2('0x21')](_0x17ebf3);}return _0x2342ce['save']();};}function saveUpdates(_0x1d4221,_0x106ae4){return function(_0x48550b){if(_0x48550b){return _0x48550b[_0x8ce2('0x22')](_0x1d4221)[_0x8ce2('0x23')](function(_0x50d4c7){return _0x50d4c7;});}return null;};}function removeEntity(_0xad9df7,_0x1104d7){return function(_0x3e82b4){if(_0x3e82b4){return _0x3e82b4['destroy']()['then'](function(){var _0xd1025c=_0x3e82b4[_0x8ce2('0x24')]({'plain':!![]});var _0x447919=_0x8ce2('0x25');return db[_0x8ce2('0x26')][_0x8ce2('0x27')]({'where':{'type':_0x447919,'resourceId':_0xd1025c['id']}})[_0x8ce2('0x23')](function(){return _0x3e82b4;});})['then'](function(){_0xad9df7[_0x8ce2('0x19')](0xcc)[_0x8ce2('0x1a')]();});}};}function handleEntityNotFound(_0x53c671,_0x4da53b){return function(_0xe81a66){if(!_0xe81a66){_0x53c671['sendStatus'](0x194);}return _0xe81a66;};}function handleError(_0x49ccb6,_0x1b9f3c){_0x1b9f3c=_0x1b9f3c||0x1f4;return function(_0x403270){logger[_0x8ce2('0x28')](_0x403270[_0x8ce2('0x29')]);if(_0x403270[_0x8ce2('0x2a')]){delete _0x403270[_0x8ce2('0x2a')];}_0x49ccb6[_0x8ce2('0x19')](_0x1b9f3c)[_0x8ce2('0x2b')](_0x403270);};}exports[_0x8ce2('0x2c')]=function(_0x4baf86,_0x5cb671){var _0x4ccab7={},_0x27093d={},_0x347283={'count':0x0,'rows':[]};var _0x26d1be=_[_0x8ce2('0x2d')](db[_0x8ce2('0x2e')][_0x8ce2('0x2f')],function(_0x1f1e21){return{'name':_0x1f1e21[_0x8ce2('0x30')],'type':_0x1f1e21['type'][_0x8ce2('0x31')]};});_0x27093d[_0x8ce2('0x32')]=_[_0x8ce2('0x2d')](_0x26d1be,_0x8ce2('0x2a'));_0x27093d[_0x8ce2('0x33')]=_['keys'](_0x4baf86['query']);_0x27093d[_0x8ce2('0x34')]=_['intersection'](_0x27093d[_0x8ce2('0x32')],_0x27093d[_0x8ce2('0x33')]);_0x4ccab7[_0x8ce2('0x35')]=_[_0x8ce2('0x36')](_0x27093d[_0x8ce2('0x32')],qs[_0x8ce2('0x37')](_0x4baf86['query'][_0x8ce2('0x37')]));_0x4ccab7[_0x8ce2('0x35')]=_0x4ccab7[_0x8ce2('0x35')][_0x8ce2('0x38')]?_0x4ccab7[_0x8ce2('0x35')]:_0x27093d['model'];if(!_0x4baf86[_0x8ce2('0x33')][_0x8ce2('0x39')](_0x8ce2('0x3a'))){_0x4ccab7['limit']=qs[_0x8ce2('0x1e')](_0x4baf86[_0x8ce2('0x33')][_0x8ce2('0x1e')]);_0x4ccab7['offset']=qs[_0x8ce2('0x1c')](_0x4baf86[_0x8ce2('0x33')][_0x8ce2('0x1c')]);}_0x4ccab7[_0x8ce2('0x3b')]=qs[_0x8ce2('0x3c')](_0x4baf86[_0x8ce2('0x33')][_0x8ce2('0x3c')]);_0x4ccab7[_0x8ce2('0x3d')]=qs[_0x8ce2('0x34')](_[_0x8ce2('0x3e')](_0x4baf86[_0x8ce2('0x33')],_0x27093d[_0x8ce2('0x34')]),_0x26d1be);if(_0x4baf86[_0x8ce2('0x33')]['filter']){_0x4ccab7['where']=_[_0x8ce2('0x3f')](_0x4ccab7[_0x8ce2('0x3d')],{'$or':_['map'](_0x26d1be,function(_0x19157a){if(_0x19157a['type']!=='VIRTUAL'){var _0x1f2c0c={};_0x1f2c0c[_0x19157a[_0x8ce2('0x2a')]]={'$like':'%'+_0x4baf86[_0x8ce2('0x33')]['filter']+'%'};return _0x1f2c0c;}})});}_0x4ccab7=_['merge']({},_0x4ccab7,_0x4baf86[_0x8ce2('0x40')]);var _0x37369e={'where':_0x4ccab7[_0x8ce2('0x3d')]};return db[_0x8ce2('0x2e')][_0x8ce2('0x1f')](_0x37369e)['then'](function(_0x214dfb){_0x347283['count']=_0x214dfb;if(_0x4baf86[_0x8ce2('0x33')][_0x8ce2('0x41')]){_0x4ccab7[_0x8ce2('0x42')]=[{'all':!![]}];}return db[_0x8ce2('0x2e')][_0x8ce2('0x43')](_0x4ccab7);})[_0x8ce2('0x23')](function(_0x2871d3){_0x347283[_0x8ce2('0x44')]=_0x2871d3;return _0x347283;})[_0x8ce2('0x23')](respondWithFilteredResult(_0x5cb671,_0x4ccab7))[_0x8ce2('0x45')](handleError(_0x5cb671,null));};exports['show']=function(_0x2199d8,_0x122504){var _0x5588c2={'raw':!![],'where':{'id':_0x2199d8[_0x8ce2('0x46')]['id']}},_0x46c0f0={};_0x46c0f0[_0x8ce2('0x32')]=_[_0x8ce2('0x47')](db['Interval'][_0x8ce2('0x2f')]);_0x46c0f0['query']=_[_0x8ce2('0x47')](_0x2199d8[_0x8ce2('0x33')]);_0x46c0f0[_0x8ce2('0x34')]=_[_0x8ce2('0x36')](_0x46c0f0[_0x8ce2('0x32')],_0x46c0f0[_0x8ce2('0x33')]);_0x5588c2['attributes']=_[_0x8ce2('0x36')](_0x46c0f0[_0x8ce2('0x32')],qs[_0x8ce2('0x37')](_0x2199d8['query'][_0x8ce2('0x37')]));_0x5588c2[_0x8ce2('0x35')]=_0x5588c2['attributes']['length']?_0x5588c2['attributes']:_0x46c0f0['model'];if(_0x2199d8[_0x8ce2('0x33')][_0x8ce2('0x41')]){_0x5588c2[_0x8ce2('0x42')]=[{'all':!![]}];}_0x5588c2=_[_0x8ce2('0x3f')]({},_0x5588c2,_0x2199d8['options']);return db[_0x8ce2('0x2e')][_0x8ce2('0x48')](_0x5588c2)['then'](handleEntityNotFound(_0x122504,null))[_0x8ce2('0x23')](respondWithResult(_0x122504,null))[_0x8ce2('0x45')](handleError(_0x122504,null));};exports[_0x8ce2('0x49')]=function(_0x654e15,_0x52388e){return db['Interval']['create'](_0x654e15['body'],{})[_0x8ce2('0x23')](function(_0x56900b){var _0x49b5d8=_0x654e15[_0x8ce2('0x4a')][_0x8ce2('0x24')]({'plain':!![]});if(!_0x49b5d8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49b5d8[_0x8ce2('0x4b')]===_0x8ce2('0x4a')){var _0xea2e82=_0x56900b[_0x8ce2('0x24')]({'plain':!![]});var _0x4f69d6=_0x8ce2('0x25');return db[_0x8ce2('0x4c')]['find']({'where':{'name':_0x4f69d6,'userProfileId':_0x49b5d8[_0x8ce2('0x4d')]},'raw':!![]})[_0x8ce2('0x23')](function(_0x317644){if(_0x317644&&_0x317644[_0x8ce2('0x4e')]===0x0){return db[_0x8ce2('0x26')]['create']({'name':_0xea2e82['name'],'resourceId':_0xea2e82['id'],'type':_0x317644['name'],'sectionId':_0x317644['id']},{})[_0x8ce2('0x23')](function(){return _0x56900b;});}else{return _0x56900b;}})['catch'](function(_0x3de73e){logger[_0x8ce2('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3de73e);throw _0x3de73e;});}return _0x56900b;})[_0x8ce2('0x23')](respondWithResult(_0x52388e,0xc9))['catch'](handleError(_0x52388e,null));};exports[_0x8ce2('0x22')]=function(_0x1e46af,_0x5c709f){if(_0x1e46af[_0x8ce2('0x4f')]['id']){delete _0x1e46af[_0x8ce2('0x4f')]['id'];}return db[_0x8ce2('0x2e')][_0x8ce2('0x48')]({'where':{'id':_0x1e46af['params']['id']}})[_0x8ce2('0x23')](handleEntityNotFound(_0x5c709f,null))[_0x8ce2('0x23')](saveUpdates(_0x1e46af['body'],null))[_0x8ce2('0x23')](respondWithResult(_0x5c709f,null))[_0x8ce2('0x45')](handleError(_0x5c709f,null));};exports[_0x8ce2('0x27')]=function(_0x4db882,_0x50b58f){return db[_0x8ce2('0x2e')][_0x8ce2('0x48')]({'where':{'id':_0x4db882[_0x8ce2('0x46')]['id']}})[_0x8ce2('0x23')](handleEntityNotFound(_0x50b58f,null))[_0x8ce2('0x23')](removeEntity(_0x50b58f,null))[_0x8ce2('0x45')](handleError(_0x50b58f,null));};exports['addInterval']=function(_0x4b4eb0,_0x4d50cd,_0x2ade87){if(_0x4b4eb0[_0x8ce2('0x4f')]['id']){delete _0x4b4eb0[_0x8ce2('0x4f')]['id'];}return db[_0x8ce2('0x2e')][_0x8ce2('0x48')]({'where':{'id':_0x4b4eb0[_0x8ce2('0x46')]['id']}})[_0x8ce2('0x23')](handleEntityNotFound(_0x4d50cd,null))['then'](function(_0x1cda11){if(_0x1cda11){_0x4b4eb0[_0x8ce2('0x4f')][_0x8ce2('0x50')]=_0x1cda11['id'];return db[_0x8ce2('0x2e')][_0x8ce2('0x49')](_0x4b4eb0[_0x8ce2('0x4f')]);}})['then'](respondWithResult(_0x4d50cd,null))['catch'](handleError(_0x4d50cd,null));};exports[_0x8ce2('0x51')]=function(_0x277f0e,_0x72ce52,_0x320b99){var _0x45727e={};var _0x89987b={};var _0x2ca85f;var _0x486251;return db[_0x8ce2('0x2e')][_0x8ce2('0x52')]({'where':{'id':_0x277f0e[_0x8ce2('0x46')]['id']}})[_0x8ce2('0x23')](handleEntityNotFound(_0x72ce52,null))[_0x8ce2('0x23')](function(_0x93b942){if(_0x93b942){_0x2ca85f=_0x93b942;_0x89987b['model']=_[_0x8ce2('0x47')](db['Interval'][_0x8ce2('0x2f')]);_0x89987b['query']=_[_0x8ce2('0x47')](_0x277f0e[_0x8ce2('0x33')]);_0x89987b[_0x8ce2('0x34')]=_[_0x8ce2('0x36')](_0x89987b[_0x8ce2('0x32')],_0x89987b[_0x8ce2('0x33')]);_0x45727e[_0x8ce2('0x35')]=_[_0x8ce2('0x36')](_0x89987b[_0x8ce2('0x32')],qs['fields'](_0x277f0e[_0x8ce2('0x33')][_0x8ce2('0x37')]));_0x45727e[_0x8ce2('0x35')]=_0x45727e['attributes'][_0x8ce2('0x38')]?_0x45727e[_0x8ce2('0x35')]:_0x89987b[_0x8ce2('0x32')];_0x45727e[_0x8ce2('0x3b')]=qs[_0x8ce2('0x3c')](_0x277f0e[_0x8ce2('0x33')]['sort']);_0x45727e[_0x8ce2('0x3d')]=qs['filters'](_[_0x8ce2('0x3e')](_0x277f0e[_0x8ce2('0x33')],_0x89987b[_0x8ce2('0x34')]));if(_0x277f0e[_0x8ce2('0x33')]['filter']){_0x45727e[_0x8ce2('0x3d')]=_[_0x8ce2('0x3f')](_0x45727e[_0x8ce2('0x3d')],{'$or':_[_0x8ce2('0x2d')](_0x45727e['attributes'],function(_0x9e3543){var _0x2cc22a={};_0x2cc22a[_0x9e3543]={'$like':'%'+_0x277f0e[_0x8ce2('0x33')][_0x8ce2('0x53')]+'%'};return _0x2cc22a;})});}_0x45727e=_[_0x8ce2('0x3f')]({},_0x45727e,_0x277f0e['options']);return _0x2ca85f[_0x8ce2('0x51')](_0x45727e);}})[_0x8ce2('0x23')](function(_0x3821fe){if(_0x3821fe){_0x486251=_0x3821fe[_0x8ce2('0x38')];if(!_0x277f0e[_0x8ce2('0x33')][_0x8ce2('0x39')]('nolimit')){_0x45727e[_0x8ce2('0x1e')]=qs['limit'](_0x277f0e[_0x8ce2('0x33')][_0x8ce2('0x1e')]);_0x45727e[_0x8ce2('0x1c')]=qs['offset'](_0x277f0e[_0x8ce2('0x33')]['offset']);}return _0x2ca85f[_0x8ce2('0x51')](_0x45727e);}})[_0x8ce2('0x23')](function(_0x19715e){if(_0x19715e){return _0x19715e?{'count':_0x486251,'rows':_0x19715e}:null;}})[_0x8ce2('0x23')](respondWithResult(_0x72ce52,null))[_0x8ce2('0x45')](handleError(_0x72ce52,null));};exports[_0x8ce2('0x54')]=function(_0x2094dc,_0x1254e5,_0x1612db){return db[_0x8ce2('0x2e')][_0x8ce2('0x52')]({'where':{'id':_0x2094dc[_0x8ce2('0x46')]['id']}})[_0x8ce2('0x23')](handleEntityNotFound(_0x1254e5,null))[_0x8ce2('0x23')](function(_0xe1a13a){if(_0xe1a13a){return db[_0x8ce2('0x55')][_0x8ce2('0x56')](function(_0x50d5d6){return db[_0x8ce2('0x2e')]['destroy']({'where':{'IntervalId':_0x2094dc[_0x8ce2('0x46')]['id']},'transaction':_0x50d5d6})[_0x8ce2('0x23')](function(_0x38de58){var _0x3deff0=_[_0x8ce2('0x2d')](_0x2094dc[_0x8ce2('0x4f')],function(_0x10358e){delete _0x10358e['id'];_0x10358e[_0x8ce2('0x50')]=_0x2094dc[_0x8ce2('0x46')]['id'];return _0x10358e;});return db['Interval'][_0x8ce2('0x57')](_0x3deff0,{'transaction':_0x50d5d6});});})['then'](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x2094dc[_0x8ce2('0x46')]['id']}});});}})[_0x8ce2('0x23')](respondWithResult(_0x1254e5,null))[_0x8ce2('0x45')](handleError(_0x1254e5,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 6295f1d..75586f0 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 _0x3f90=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval','tools_intervals','rewrite','util','../../config/logger'];(function(_0x230da1,_0x153021){var _0x3e55f8=function(_0x2c55f5){while(--_0x2c55f5){_0x230da1['push'](_0x230da1['shift']());}};_0x3e55f8(++_0x153021);}(_0x3f90,0x175));var _0x03f9=function(_0x4d96f3,_0x24c190){_0x4d96f3=_0x4d96f3-0x0;var _0x3ae020=_0x3f90[_0x4d96f3];return _0x3ae020;};'use strict';var _=require('lodash');var util=require(_0x03f9('0x0'));var logger=require(_0x03f9('0x1'))(_0x03f9('0x2'));var moment=require(_0x03f9('0x3'));var BPromise=require(_0x03f9('0x4'));var rp=require(_0x03f9('0x5'));var fs=require('fs');var path=require(_0x03f9('0x6'));var rimraf=require(_0x03f9('0x7'));var config=require(_0x03f9('0x8'));var attributes=require(_0x03f9('0x9'));var extensions=require(_0x03f9('0xa'));module[_0x03f9('0xb')]=function(_0x27f543,_0x1e0cd5){return _0x27f543['define'](_0x03f9('0xc'),attributes,{'tableName':_0x03f9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x45d9de,_0x532e36){extensions[_0x03f9('0xe')](_0x27f543,_0x45d9de);},'afterBulkCreate':function(_0x165498,_0x59d0de,_0x2c944e){_0x2c944e();extensions[_0x03f9('0xe')](_0x27f543,_0x165498[0x0]);},'afterUpdate':function(_0x1083f9,_0x308d27){extensions[_0x03f9('0xe')](_0x27f543,_0x1083f9);},'afterDestroy':function(_0x56e4e8,_0x3a629e){extensions[_0x03f9('0xe')](_0x27f543,_0x56e4e8);}}});}; \ No newline at end of file +var _0xf524=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite'];(function(_0x48f8c4,_0x4e3dba){var _0x118849=function(_0x4f9838){while(--_0x4f9838){_0x48f8c4['push'](_0x48f8c4['shift']());}};_0x118849(++_0x4e3dba);}(_0xf524,0x14a));var _0x4f52=function(_0x2638d0,_0x52f653){_0x2638d0=_0x2638d0-0x0;var _0x411a60=_0xf524[_0x2638d0];return _0x411a60;};'use strict';var _=require(_0x4f52('0x0'));var util=require('util');var logger=require(_0x4f52('0x1'))(_0x4f52('0x2'));var moment=require(_0x4f52('0x3'));var BPromise=require(_0x4f52('0x4'));var rp=require(_0x4f52('0x5'));var fs=require('fs');var path=require(_0x4f52('0x6'));var rimraf=require(_0x4f52('0x7'));var config=require(_0x4f52('0x8'));var attributes=require('./interval.attributes');var extensions=require(_0x4f52('0x9'));module[_0x4f52('0xa')]=function(_0x45fbbd,_0x2df98a){return _0x45fbbd[_0x4f52('0xb')](_0x4f52('0xc'),attributes,{'tableName':_0x4f52('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x27aa96,_0x430790){extensions[_0x4f52('0xe')](_0x45fbbd,_0x27aa96);},'afterBulkCreate':function(_0x1476a4,_0x17b9fd,_0x4ecc24){_0x4ecc24();extensions[_0x4f52('0xe')](_0x45fbbd,_0x1476a4[0x0]);},'afterUpdate':function(_0x55f3f5,_0x568433){extensions[_0x4f52('0xe')](_0x45fbbd,_0x55f3f5);},'afterDestroy':function(_0xd6acb3,_0x326918){extensions['rewrite'](_0x45fbbd,_0xd6acb3);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 52ba290..22e4770 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(_0x1c0f3d,_0x55a9e2){var _0x4d71a8=function(_0xeff131){while(--_0xeff131){_0x1c0f3d['push'](_0x1c0f3d['shift']());}};_0x4d71a8(++_0x55a9e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 bb54333..a871ed3 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 _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3513a0,_0x3bdc88){_0x3513a0=_0x3513a0-0x0;var _0x2bdeb9=_0x0b0e[_0x3513a0];return _0x2bdeb9;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x249f9d,_0xcbf490){var _0x348e04=function(_0x422b47){while(--_0x422b47){_0x249f9d['push'](_0x249f9d['shift']());}};_0x348e04(++_0xcbf490);}(_0xdb28,0x106));var _0x8db2=function(_0x27106c,_0x56fb14){_0x27106c=_0x27106c-0x0;var _0x51375b=_0xdb28[_0x27106c];return _0x51375b;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('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 0fccc39..dd9127a 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 _0x96ff=['statusCode','json','parse','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','connection','socket','remoteAddress','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','oldToken','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','request','setEncoding','utf8','data','end'];(function(_0x514acb,_0xe345cc){var _0x1bc73e=function(_0x41c00b){while(--_0x41c00b){_0x514acb['push'](_0x514acb['shift']());}};_0x1bc73e(++_0xe345cc);}(_0x96ff,0x1bf));var _0xf96f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x96ff[_0x2641f9];return _0x585741;};'use strict';var BPromise=require('bluebird');var https=require(_0xf96f('0x0'));var logger=require(_0xf96f('0x1'))(_0xf96f('0x2'));var USERNAME=_0xf96f('0x3');var PASSWORD=_0xf96f('0x4');function openIssue(_0x468d82,_0xd132b0){var _0x4949c6={'fields':{'project':{'key':_0x468d82[_0xf96f('0x5')]||_0xf96f('0x6')},'summary':(_0x468d82[_0xf96f('0x7')]||_0xf96f('0x8'))+_0xf96f('0x9')+_0x468d82['ip'],'description':_0x468d82[_0xf96f('0xa')]||JSON[_0xf96f('0xb')](_0x468d82),'issuetype':{'name':_0x468d82[_0xf96f('0xc')]||_0xf96f('0xd')}}};_0x4949c6[_0xf96f('0xe')][_0xf96f('0xf')]=_0x468d82[_0xf96f('0x10')];_0x4949c6['fields']['customfield_11501']=_0x468d82[_0xf96f('0x11')];_0x4949c6[_0xf96f('0xe')]['customfield_11502']=_0x468d82[_0xf96f('0x12')];_0x4949c6[_0xf96f('0xe')][_0xf96f('0x13')]=_0x468d82[_0xf96f('0x14')];_0x4949c6[_0xf96f('0xe')][_0xf96f('0x15')]=_0x468d82[_0xf96f('0x16')];_0x4949c6[_0xf96f('0xe')]['customfield_10102']=_0x468d82['ip'];var _0x3e4406={'host':_0xf96f('0x17'),'port':0x1bb,'path':_0xf96f('0x18'),'method':_0xf96f('0x19'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xf96f('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0xf96f('0x1b')]('base64')}};var _0x1ed4e4=JSON[_0xf96f('0xb')](_0x4949c6);var _0x3142d4=https[_0xf96f('0x1c')](_0x3e4406,function(_0x2feb65){_0x2feb65[_0xf96f('0x1d')](_0xf96f('0x1e'));var _0x1915a4='';_0x2feb65['on'](_0xf96f('0x1f'),function(_0x20e58f){_0x1915a4+=_0x20e58f;});_0x2feb65['on'](_0xf96f('0x20'),function(){if(_0xd132b0){return _0xd132b0['status'](_0x2feb65[_0xf96f('0x21')])[_0xf96f('0x22')](JSON[_0xf96f('0x23')](_0x1915a4));}});});_0x3142d4['on'](_0xf96f('0x24'),function(_0x45adcb){if(_0xd132b0){return _0xd132b0[_0xf96f('0x25')](0x1f4)[_0xf96f('0x22')]({'errors':[{'message':_0xf96f('0x26'),'type':_0xf96f('0x27')}]});}});_0x3142d4[_0xf96f('0x28')](_0x1ed4e4);_0x3142d4['end']();}exports[_0xf96f('0x29')]=openIssue;exports[_0xf96f('0x2a')]=function(_0x7fef24,_0x401c11){_0x7fef24[_0xf96f('0x2b')]['ip']=_0x7fef24[_0xf96f('0x2c')]['x-forwarded-for']||_0x7fef24[_0xf96f('0x2d')]['remoteAddress']||_0x7fef24[_0xf96f('0x2e')][_0xf96f('0x2f')]||_0x7fef24[_0xf96f('0x2d')][_0xf96f('0x2e')][_0xf96f('0x2f')];return openIssue(_0x7fef24[_0xf96f('0x2b')],_0x401c11);}; \ No newline at end of file +var _0x1aff=['oldToken','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','utf8','data','end','status','statusCode','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','headers','x-forwarded-for','remoteAddress','socket','connection','body','bluebird','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','\x20from\x20','stringify','Bug','fields','customfield_11500','customfield_11501'];(function(_0x7e507c,_0x13ff90){var _0x304ca3=function(_0x4d7725){while(--_0x4d7725){_0x7e507c['push'](_0x7e507c['shift']());}};_0x304ca3(++_0x13ff90);}(_0x1aff,0x144));var _0xf1af=function(_0x1d8efe,_0x55ae97){_0x1d8efe=_0x1d8efe-0x0;var _0x19ca60=_0x1aff[_0x1d8efe];return _0x19ca60;};'use strict';var BPromise=require(_0xf1af('0x0'));var https=require('https');var logger=require(_0xf1af('0x1'))('api');var USERNAME=_0xf1af('0x2');var PASSWORD=_0xf1af('0x3');function openIssue(_0x2b59f2,_0x3c27ca){var _0x38bbff={'fields':{'project':{'key':_0x2b59f2[_0xf1af('0x4')]||_0xf1af('0x5')},'summary':(_0x2b59f2['summary']||'Report')+_0xf1af('0x6')+_0x2b59f2['ip'],'description':_0x2b59f2['description']||JSON[_0xf1af('0x7')](_0x2b59f2),'issuetype':{'name':_0x2b59f2['issuetype']||_0xf1af('0x8')}}};_0x38bbff[_0xf1af('0x9')][_0xf1af('0xa')]=_0x2b59f2['email'];_0x38bbff[_0xf1af('0x9')][_0xf1af('0xb')]=_0x2b59f2[_0xf1af('0xc')];_0x38bbff[_0xf1af('0x9')]['customfield_11502']=_0x2b59f2[_0xf1af('0xd')];_0x38bbff[_0xf1af('0x9')][_0xf1af('0xe')]=_0x2b59f2[_0xf1af('0xf')];_0x38bbff[_0xf1af('0x9')][_0xf1af('0x10')]=_0x2b59f2[_0xf1af('0x11')];_0x38bbff[_0xf1af('0x9')][_0xf1af('0x12')]=_0x2b59f2['ip'];var _0xa2b2ab={'host':_0xf1af('0x13'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xf1af('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0xf1af('0x15'),'Authorization':_0xf1af('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0xf1af('0x17')](_0xf1af('0x18'))}};var _0x48abe5=JSON[_0xf1af('0x7')](_0x38bbff);var _0x3d42dc=https['request'](_0xa2b2ab,function(_0x5696b5){_0x5696b5['setEncoding'](_0xf1af('0x19'));var _0x528177='';_0x5696b5['on'](_0xf1af('0x1a'),function(_0x4a4aab){_0x528177+=_0x4a4aab;});_0x5696b5['on'](_0xf1af('0x1b'),function(){if(_0x3c27ca){return _0x3c27ca[_0xf1af('0x1c')](_0x5696b5[_0xf1af('0x1d')])[_0xf1af('0x1e')](JSON['parse'](_0x528177));}});});_0x3d42dc['on']('error',function(_0x23a3dc){if(_0x3c27ca){return _0x3c27ca[_0xf1af('0x1c')](0x1f4)[_0xf1af('0x1e')]({'errors':[{'message':_0xf1af('0x1f'),'type':_0xf1af('0x20')}]});}});_0x3d42dc[_0xf1af('0x21')](_0x48abe5);_0x3d42dc[_0xf1af('0x1b')]();}exports[_0xf1af('0x22')]=openIssue;exports[_0xf1af('0x23')]=function(_0x430684,_0x5ca482){_0x430684['body']['ip']=_0x430684[_0xf1af('0x24')][_0xf1af('0x25')]||_0x430684['connection'][_0xf1af('0x26')]||_0x430684[_0xf1af('0x27')]['remoteAddress']||_0x430684[_0xf1af('0x28')][_0xf1af('0x27')][_0xf1af('0x26')];return openIssue(_0x430684[_0xf1af('0x29')],_0x5ca482);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index b60efc6..c15d446 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 _0x2dae=['show','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x2dae,0xc3));var _0xe2da=function(_0x5b3950,_0x4e5556){_0x5b3950=_0x5b3950-0x0;var _0x41e436=_0x2dae[_0x5b3950];return _0x41e436;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var timeout=require(_0xe2da('0x2'));var express=require(_0xe2da('0x3'));var router=express[_0xe2da('0x4')]();var fs_extra=require(_0xe2da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var controller=require(_0xe2da('0x8'));router[_0xe2da('0x9')]('/',auth['isAuthenticated'](),controller[_0xe2da('0xa')]);router[_0xe2da('0x9')](_0xe2da('0xb'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xd')]);router[_0xe2da('0x9')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xf')]);router['post']('/',auth[_0xe2da('0xc')](),controller[_0xe2da('0x10')]);router[_0xe2da('0x11')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0x12')]);router[_0xe2da('0x13')](_0xe2da('0xe'),auth['isAuthenticated'](),controller[_0xe2da('0x14')]);module['exports']=router; \ No newline at end of file +var _0x9f62=['../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','post','/:id','delete','util','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x429f2f,_0x8c7732){var _0x105d17=function(_0x109253){while(--_0x109253){_0x429f2f['push'](_0x429f2f['shift']());}};_0x105d17(++_0x8c7732);}(_0x9f62,0x154));var _0x29f6=function(_0x5ac521,_0x41f169){_0x5ac521=_0x5ac521-0x0;var _0x4610e6=_0x9f62[_0x5ac521];return _0x4610e6;};'use strict';var multer=require('multer');var util=require(_0x29f6('0x0'));var path=require('path');var timeout=require(_0x29f6('0x1'));var express=require(_0x29f6('0x2'));var router=express[_0x29f6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var controller=require(_0x29f6('0x6'));router[_0x29f6('0x7')]('/',auth['isAuthenticated'](),controller[_0x29f6('0x8')]);router[_0x29f6('0x7')](_0x29f6('0x9'),auth[_0x29f6('0xa')](),controller[_0x29f6('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x29f6('0xc')]('/',auth[_0x29f6('0xa')](),controller['create']);router['put'](_0x29f6('0xd'),auth[_0x29f6('0xa')](),controller['update']);router[_0x29f6('0xe')](_0x29f6('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 8c80453..d84eef9 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(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x7a54,0x106));var _0x47a5=function(_0x25e4e3,_0x3b949d){_0x25e4e3=_0x25e4e3-0x0;var _0x1edfc4=_0x7a54[_0x25e4e3];return _0x1edfc4;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7a54,0x106));var _0x47a5=function(_0x494c5b,_0x174e87){_0x494c5b=_0x494c5b-0x0;var _0x20ee04=_0x7a54[_0x494c5b];return _0x20ee04;};'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 a78bb53..6cb9101 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 _0x294b=['intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','JscriptyAnswerReport','includeAll','include','catch','params','rawAttributes','find','create','body','update','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','apply','save','then','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters'];(function(_0xeaa48c,_0x209db8){var _0x359e6f=function(_0x515c28){while(--_0x515c28){_0xeaa48c['push'](_0xeaa48c['shift']());}};_0x359e6f(++_0x209db8);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb294('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb294('0x1'));var jsonpatch=require(_0xb294('0x2'));var rp=require(_0xb294('0x3'));var moment=require(_0xb294('0x4'));var BPromise=require(_0xb294('0x5'));var Mustache=require(_0xb294('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb294('0x7'));var csv=require(_0xb294('0x8'));var ejs=require(_0xb294('0x9'));var fs=require('fs');var fs_extra=require(_0xb294('0xa'));var _=require(_0xb294('0xb'));var squel=require('squel');var crypto=require(_0xb294('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb294('0xd'));var Papa=require(_0xb294('0xe'));var Redis=require(_0xb294('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb294('0x10'));var logger=require(_0xb294('0x11'))(_0xb294('0x12'));var utils=require(_0xb294('0x13'));var config=require(_0xb294('0x14'));var licenseUtil=require(_0xb294('0x15'));var db=require(_0xb294('0x16'))['db'];function respondWithStatusCode(_0x13a3fc,_0x2b2bb5){_0x2b2bb5=_0x2b2bb5||0xcc;return function(_0x3e0fe5){if(_0x3e0fe5){return _0x13a3fc['sendStatus'](_0x2b2bb5);}return _0x13a3fc['status'](_0x2b2bb5)[_0xb294('0x17')]();};}function respondWithResult(_0x4c0959,_0x4b5996){_0x4b5996=_0x4b5996||0xc8;return function(_0x22beca){if(_0x22beca){return _0x4c0959[_0xb294('0x18')](_0x4b5996)[_0xb294('0x19')](_0x22beca);}};}function respondWithFilteredResult(_0x366f8f,_0x3f7323){return function(_0x2f3b62){if(_0x2f3b62){var _0x1a4089=typeof _0x3f7323[_0xb294('0x1a')]===_0xb294('0x1b')&&typeof _0x3f7323[_0xb294('0x1c')]===_0xb294('0x1b');var _0x51110b=_0x2f3b62[_0xb294('0x1d')];var _0x1ecc68=_0x1a4089?0x0:_0x3f7323['offset'];var _0x5e8ce6=_0x1a4089?_0x2f3b62[_0xb294('0x1d')]:_0x3f7323[_0xb294('0x1a')]+_0x3f7323[_0xb294('0x1c')];var _0x449e81;if(_0x5e8ce6>=_0x51110b){_0x5e8ce6=_0x51110b;_0x449e81=0xc8;}else{_0x449e81=0xce;}_0x366f8f[_0xb294('0x18')](_0x449e81);return _0x366f8f['set']('Content-Range',_0x1ecc68+'-'+_0x5e8ce6+'/'+_0x51110b)[_0xb294('0x19')](_0x2f3b62);}return null;};}function patchUpdates(_0x46b2ac){return function(_0x526914){try{jsonpatch[_0xb294('0x1e')](_0x526914,_0x46b2ac,!![]);}catch(_0x18e7dd){return BPromise['reject'](_0x18e7dd);}return _0x526914[_0xb294('0x1f')]();};}function saveUpdates(_0x21b9b2,_0x33c416){return function(_0x4afd48){if(_0x4afd48){return _0x4afd48['update'](_0x21b9b2)[_0xb294('0x20')](function(_0x5bdc68){return _0x5bdc68;});}return null;};}function removeEntity(_0x36b173,_0x5be6d5){return function(_0x101339){if(_0x101339){return _0x101339['destroy']()[_0xb294('0x20')](function(){_0x36b173['status'](0xcc)[_0xb294('0x17')]();});}};}function handleEntityNotFound(_0x405b66,_0x2d0c62){return function(_0xabcb26){if(!_0xabcb26){_0x405b66[_0xb294('0x21')](0x194);}return _0xabcb26;};}function handleError(_0x469647,_0x2fe3a9){_0x2fe3a9=_0x2fe3a9||0x1f4;return function(_0x52853){logger[_0xb294('0x22')](_0x52853['stack']);if(_0x52853['name']){delete _0x52853[_0xb294('0x23')];}_0x469647[_0xb294('0x18')](_0x2fe3a9)[_0xb294('0x24')](_0x52853);};}exports[_0xb294('0x25')]=function(_0x47fca9,_0x59fbde){var _0x1167e5={},_0x3c2aa5={},_0x1efdb6={'count':0x0,'rows':[]};var _0x127ddd=_['map'](db['JscriptyAnswerReport']['rawAttributes'],function(_0xbb4a10){return{'name':_0xbb4a10[_0xb294('0x26')],'type':_0xbb4a10[_0xb294('0x27')][_0xb294('0x28')]};});_0x3c2aa5[_0xb294('0x29')]=_[_0xb294('0x2a')](_0x127ddd,_0xb294('0x23'));_0x3c2aa5[_0xb294('0x2b')]=_[_0xb294('0x2c')](_0x47fca9[_0xb294('0x2b')]);_0x3c2aa5[_0xb294('0x2d')]=_[_0xb294('0x2e')](_0x3c2aa5[_0xb294('0x29')],_0x3c2aa5['query']);_0x1167e5['attributes']=_[_0xb294('0x2e')](_0x3c2aa5['model'],qs[_0xb294('0x2f')](_0x47fca9[_0xb294('0x2b')][_0xb294('0x2f')]));_0x1167e5[_0xb294('0x30')]=_0x1167e5['attributes'][_0xb294('0x31')]?_0x1167e5[_0xb294('0x30')]:_0x3c2aa5[_0xb294('0x29')];if(!_0x47fca9[_0xb294('0x2b')][_0xb294('0x32')]('nolimit')){_0x1167e5['limit']=qs['limit'](_0x47fca9[_0xb294('0x2b')][_0xb294('0x1c')]);_0x1167e5[_0xb294('0x1a')]=qs[_0xb294('0x1a')](_0x47fca9[_0xb294('0x2b')][_0xb294('0x1a')]);}_0x1167e5[_0xb294('0x33')]=qs['sort'](_0x47fca9[_0xb294('0x2b')][_0xb294('0x34')]);_0x1167e5[_0xb294('0x35')]=qs[_0xb294('0x2d')](_[_0xb294('0x36')](_0x47fca9[_0xb294('0x2b')],_0x3c2aa5[_0xb294('0x2d')]),_0x127ddd);if(_0x47fca9[_0xb294('0x2b')]['filter']){_0x1167e5['where']=_[_0xb294('0x37')](_0x1167e5['where'],{'$or':_[_0xb294('0x2a')](_0x127ddd,function(_0x565546){if(_0x565546[_0xb294('0x27')]!==_0xb294('0x38')){var _0x2c92cb={};_0x2c92cb[_0x565546[_0xb294('0x23')]]={'$like':'%'+_0x47fca9[_0xb294('0x2b')]['filter']+'%'};return _0x2c92cb;}})});}_0x1167e5=_['merge']({},_0x1167e5,_0x47fca9[_0xb294('0x39')]);var _0x2693ec={'where':_0x1167e5[_0xb294('0x35')]};return db[_0xb294('0x3a')][_0xb294('0x1d')](_0x2693ec)[_0xb294('0x20')](function(_0x4ef87e){_0x1efdb6['count']=_0x4ef87e;if(_0x47fca9[_0xb294('0x2b')][_0xb294('0x3b')]){_0x1167e5[_0xb294('0x3c')]=[{'all':!![]}];}return db[_0xb294('0x3a')]['findAll'](_0x1167e5);})['then'](function(_0x1da557){_0x1efdb6['rows']=_0x1da557;return _0x1efdb6;})[_0xb294('0x20')](respondWithFilteredResult(_0x59fbde,_0x1167e5))[_0xb294('0x3d')](handleError(_0x59fbde,null));};exports['show']=function(_0x572e98,_0x4c1f43){var _0x20b1a2={'raw':!![],'where':{'id':_0x572e98[_0xb294('0x3e')]['id']}},_0x164556={};_0x164556['model']=_[_0xb294('0x2c')](db[_0xb294('0x3a')][_0xb294('0x3f')]);_0x164556[_0xb294('0x2b')]=_[_0xb294('0x2c')](_0x572e98[_0xb294('0x2b')]);_0x164556[_0xb294('0x2d')]=_['intersection'](_0x164556['model'],_0x164556[_0xb294('0x2b')]);_0x20b1a2[_0xb294('0x30')]=_['intersection'](_0x164556['model'],qs[_0xb294('0x2f')](_0x572e98[_0xb294('0x2b')][_0xb294('0x2f')]));_0x20b1a2[_0xb294('0x30')]=_0x20b1a2['attributes'][_0xb294('0x31')]?_0x20b1a2['attributes']:_0x164556['model'];if(_0x572e98[_0xb294('0x2b')][_0xb294('0x3b')]){_0x20b1a2[_0xb294('0x3c')]=[{'all':!![]}];}_0x20b1a2=_[_0xb294('0x37')]({},_0x20b1a2,_0x572e98[_0xb294('0x39')]);return db['JscriptyAnswerReport'][_0xb294('0x40')](_0x20b1a2)[_0xb294('0x20')](handleEntityNotFound(_0x4c1f43,null))[_0xb294('0x20')](respondWithResult(_0x4c1f43,null))['catch'](handleError(_0x4c1f43,null));};exports['create']=function(_0xce4f4,_0x3cdc29){return db[_0xb294('0x3a')][_0xb294('0x41')](_0xce4f4[_0xb294('0x42')],{})['then'](respondWithResult(_0x3cdc29,0xc9))[_0xb294('0x3d')](handleError(_0x3cdc29,null));};exports[_0xb294('0x43')]=function(_0x459a69,_0x3156e2){if(_0x459a69[_0xb294('0x42')]['id']){delete _0x459a69[_0xb294('0x42')]['id'];}return db[_0xb294('0x3a')][_0xb294('0x40')]({'where':{'id':_0x459a69[_0xb294('0x3e')]['id']}})[_0xb294('0x20')](handleEntityNotFound(_0x3156e2,null))['then'](saveUpdates(_0x459a69[_0xb294('0x42')],null))['then'](respondWithResult(_0x3156e2,null))[_0xb294('0x3d')](handleError(_0x3156e2,null));};exports[_0xb294('0x44')]=function(_0x249b59,_0xd64380){return db[_0xb294('0x3a')]['find']({'where':{'id':_0x249b59['params']['id']}})[_0xb294('0x20')](handleEntityNotFound(_0xd64380,null))[_0xb294('0x20')](removeEntity(_0xd64380,null))[_0xb294('0x3d')](handleError(_0xd64380,null));};exports[_0xb294('0x45')]=function(_0x5589c3,_0x10b068){return db[_0xb294('0x3a')][_0xb294('0x45')]()[_0xb294('0x20')](respondWithResult(_0x10b068,null))[_0xb294('0x3d')](handleError(_0x10b068,null));}; \ No newline at end of file +var _0xf006=['fieldName','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','destroy','describe','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes'];(function(_0x2730da,_0x1098bd){var _0xfe9991=function(_0x2ea521){while(--_0x2ea521){_0x2730da['push'](_0x2730da['shift']());}};_0xfe9991(++_0x1098bd);}(_0xf006,0x146));var _0x6f00=function(_0x47a704,_0x72fe8c){_0x47a704=_0x47a704-0x0;var _0x22b014=_0xf006[_0x47a704];return _0x22b014;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6f00('0x0'));var jsonpatch=require(_0x6f00('0x1'));var rp=require('request-promise');var moment=require(_0x6f00('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6f00('0x3'));var util=require('util');var path=require('path');var sox=require(_0x6f00('0x4'));var csv=require(_0x6f00('0x5'));var ejs=require(_0x6f00('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f00('0x7'));var squel=require('squel');var crypto=require(_0x6f00('0x8'));var jsforce=require(_0x6f00('0x9'));var deskjs=require(_0x6f00('0xa'));var toCsv=require(_0x6f00('0x5'));var querystring=require(_0x6f00('0xb'));var Papa=require(_0x6f00('0xc'));var Redis=require(_0x6f00('0xd'));var authService=require(_0x6f00('0xe'));var qs=require(_0x6f00('0xf'));var as=require(_0x6f00('0x10'));var hardwareService=require(_0x6f00('0x11'));var logger=require(_0x6f00('0x12'))(_0x6f00('0x13'));var utils=require('../../config/utils');var config=require(_0x6f00('0x14'));var licenseUtil=require(_0x6f00('0x15'));var db=require(_0x6f00('0x16'))['db'];function respondWithStatusCode(_0x36a2ec,_0x289fe9){_0x289fe9=_0x289fe9||0xcc;return function(_0x5e3264){if(_0x5e3264){return _0x36a2ec[_0x6f00('0x17')](_0x289fe9);}return _0x36a2ec['status'](_0x289fe9)[_0x6f00('0x18')]();};}function respondWithResult(_0x5047f5,_0x324e67){_0x324e67=_0x324e67||0xc8;return function(_0x220e68){if(_0x220e68){return _0x5047f5[_0x6f00('0x19')](_0x324e67)[_0x6f00('0x1a')](_0x220e68);}};}function respondWithFilteredResult(_0xa6e7a1,_0x411203){return function(_0x46bc2c){if(_0x46bc2c){var _0x4d8aee=typeof _0x411203[_0x6f00('0x1b')]==='undefined'&&typeof _0x411203[_0x6f00('0x1c')]==='undefined';var _0x534275=_0x46bc2c[_0x6f00('0x1d')];var _0x6cf83f=_0x4d8aee?0x0:_0x411203[_0x6f00('0x1b')];var _0x340f78=_0x4d8aee?_0x46bc2c[_0x6f00('0x1d')]:_0x411203[_0x6f00('0x1b')]+_0x411203[_0x6f00('0x1c')];var _0x295640;if(_0x340f78>=_0x534275){_0x340f78=_0x534275;_0x295640=0xc8;}else{_0x295640=0xce;}_0xa6e7a1[_0x6f00('0x19')](_0x295640);return _0xa6e7a1[_0x6f00('0x1e')](_0x6f00('0x1f'),_0x6cf83f+'-'+_0x340f78+'/'+_0x534275)[_0x6f00('0x1a')](_0x46bc2c);}return null;};}function patchUpdates(_0x4e11de){return function(_0x4f3031){try{jsonpatch['apply'](_0x4f3031,_0x4e11de,!![]);}catch(_0x2a5286){return BPromise[_0x6f00('0x20')](_0x2a5286);}return _0x4f3031[_0x6f00('0x21')]();};}function saveUpdates(_0x57340f,_0xe301e5){return function(_0x9066ff){if(_0x9066ff){return _0x9066ff[_0x6f00('0x22')](_0x57340f)[_0x6f00('0x23')](function(_0x388983){return _0x388983;});}return null;};}function removeEntity(_0x1cbf1c,_0x90d74c){return function(_0x1ea061){if(_0x1ea061){return _0x1ea061['destroy']()[_0x6f00('0x23')](function(){_0x1cbf1c[_0x6f00('0x19')](0xcc)[_0x6f00('0x18')]();});}};}function handleEntityNotFound(_0x4d41ef,_0x37f062){return function(_0x4f7e29){if(!_0x4f7e29){_0x4d41ef[_0x6f00('0x17')](0x194);}return _0x4f7e29;};}function handleError(_0x511293,_0x434735){_0x434735=_0x434735||0x1f4;return function(_0x39375d){logger[_0x6f00('0x24')](_0x39375d[_0x6f00('0x25')]);if(_0x39375d[_0x6f00('0x26')]){delete _0x39375d['name'];}_0x511293[_0x6f00('0x19')](_0x434735)[_0x6f00('0x27')](_0x39375d);};}exports[_0x6f00('0x28')]=function(_0x4366a4,_0x2671fe){var _0x235a86={},_0xff36ce={},_0x451849={'count':0x0,'rows':[]};var _0x22f107=_[_0x6f00('0x29')](db[_0x6f00('0x2a')][_0x6f00('0x2b')],function(_0x29555d){return{'name':_0x29555d[_0x6f00('0x2c')],'type':_0x29555d['type']['key']};});_0xff36ce['model']=_['map'](_0x22f107,'name');_0xff36ce['query']=_[_0x6f00('0x2d')](_0x4366a4['query']);_0xff36ce[_0x6f00('0x2e')]=_[_0x6f00('0x2f')](_0xff36ce[_0x6f00('0x30')],_0xff36ce[_0x6f00('0x31')]);_0x235a86[_0x6f00('0x32')]=_[_0x6f00('0x2f')](_0xff36ce['model'],qs[_0x6f00('0x33')](_0x4366a4[_0x6f00('0x31')][_0x6f00('0x33')]));_0x235a86[_0x6f00('0x32')]=_0x235a86[_0x6f00('0x32')]['length']?_0x235a86['attributes']:_0xff36ce['model'];if(!_0x4366a4[_0x6f00('0x31')][_0x6f00('0x34')](_0x6f00('0x35'))){_0x235a86[_0x6f00('0x1c')]=qs[_0x6f00('0x1c')](_0x4366a4['query'][_0x6f00('0x1c')]);_0x235a86[_0x6f00('0x1b')]=qs[_0x6f00('0x1b')](_0x4366a4[_0x6f00('0x31')][_0x6f00('0x1b')]);}_0x235a86[_0x6f00('0x36')]=qs[_0x6f00('0x37')](_0x4366a4['query'][_0x6f00('0x37')]);_0x235a86[_0x6f00('0x38')]=qs[_0x6f00('0x2e')](_['pick'](_0x4366a4[_0x6f00('0x31')],_0xff36ce[_0x6f00('0x2e')]),_0x22f107);if(_0x4366a4[_0x6f00('0x31')]['filter']){_0x235a86[_0x6f00('0x38')]=_['merge'](_0x235a86[_0x6f00('0x38')],{'$or':_['map'](_0x22f107,function(_0x3dc8e3){if(_0x3dc8e3[_0x6f00('0x39')]!==_0x6f00('0x3a')){var _0x896b3f={};_0x896b3f[_0x3dc8e3['name']]={'$like':'%'+_0x4366a4[_0x6f00('0x31')]['filter']+'%'};return _0x896b3f;}})});}_0x235a86=_[_0x6f00('0x3b')]({},_0x235a86,_0x4366a4['options']);var _0x7785e1={'where':_0x235a86[_0x6f00('0x38')]};return db[_0x6f00('0x2a')][_0x6f00('0x1d')](_0x7785e1)['then'](function(_0x53dc8c){_0x451849[_0x6f00('0x1d')]=_0x53dc8c;if(_0x4366a4['query'][_0x6f00('0x3c')]){_0x235a86[_0x6f00('0x3d')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6f00('0x3e')](_0x235a86);})['then'](function(_0x4cac2c){_0x451849[_0x6f00('0x3f')]=_0x4cac2c;return _0x451849;})[_0x6f00('0x23')](respondWithFilteredResult(_0x2671fe,_0x235a86))[_0x6f00('0x40')](handleError(_0x2671fe,null));};exports[_0x6f00('0x41')]=function(_0x56399a,_0x38ee25){var _0x4523f2={'raw':!![],'where':{'id':_0x56399a[_0x6f00('0x42')]['id']}},_0x2bb5aa={};_0x2bb5aa[_0x6f00('0x30')]=_[_0x6f00('0x2d')](db['JscriptyAnswerReport'][_0x6f00('0x2b')]);_0x2bb5aa[_0x6f00('0x31')]=_[_0x6f00('0x2d')](_0x56399a[_0x6f00('0x31')]);_0x2bb5aa[_0x6f00('0x2e')]=_[_0x6f00('0x2f')](_0x2bb5aa['model'],_0x2bb5aa[_0x6f00('0x31')]);_0x4523f2[_0x6f00('0x32')]=_[_0x6f00('0x2f')](_0x2bb5aa['model'],qs[_0x6f00('0x33')](_0x56399a['query'][_0x6f00('0x33')]));_0x4523f2[_0x6f00('0x32')]=_0x4523f2['attributes'][_0x6f00('0x43')]?_0x4523f2['attributes']:_0x2bb5aa[_0x6f00('0x30')];if(_0x56399a[_0x6f00('0x31')][_0x6f00('0x3c')]){_0x4523f2[_0x6f00('0x3d')]=[{'all':!![]}];}_0x4523f2=_['merge']({},_0x4523f2,_0x56399a[_0x6f00('0x44')]);return db['JscriptyAnswerReport'][_0x6f00('0x45')](_0x4523f2)['then'](handleEntityNotFound(_0x38ee25,null))[_0x6f00('0x23')](respondWithResult(_0x38ee25,null))[_0x6f00('0x40')](handleError(_0x38ee25,null));};exports[_0x6f00('0x46')]=function(_0x9b003,_0x470ff3){return db[_0x6f00('0x2a')][_0x6f00('0x46')](_0x9b003[_0x6f00('0x47')],{})['then'](respondWithResult(_0x470ff3,0xc9))[_0x6f00('0x40')](handleError(_0x470ff3,null));};exports['update']=function(_0x265666,_0x31fb17){if(_0x265666[_0x6f00('0x47')]['id']){delete _0x265666['body']['id'];}return db['JscriptyAnswerReport'][_0x6f00('0x45')]({'where':{'id':_0x265666[_0x6f00('0x42')]['id']}})['then'](handleEntityNotFound(_0x31fb17,null))[_0x6f00('0x23')](saveUpdates(_0x265666['body'],null))[_0x6f00('0x23')](respondWithResult(_0x31fb17,null))['catch'](handleError(_0x31fb17,null));};exports[_0x6f00('0x48')]=function(_0x222b4c,_0x4c6e06){return db['JscriptyAnswerReport'][_0x6f00('0x45')]({'where':{'id':_0x222b4c[_0x6f00('0x42')]['id']}})['then'](handleEntityNotFound(_0x4c6e06,null))[_0x6f00('0x23')](removeEntity(_0x4c6e06,null))['catch'](handleError(_0x4c6e06,null));};exports[_0x6f00('0x49')]=function(_0x7f80ed,_0x3100ee){return db[_0x6f00('0x2a')][_0x6f00('0x49')]()[_0x6f00('0x23')](respondWithResult(_0x3100ee,null))[_0x6f00('0x40')](handleError(_0x3100ee,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index c77d53d..6dbf38e 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 _0x6056=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6056,0xbe));var _0x6605=function(_0x51e943,_0x16e9c4){_0x51e943=_0x51e943-0x0;var _0x3fa027=_0x6056[_0x51e943];return _0x3fa027;};'use strict';var _=require(_0x6605('0x0'));var util=require('util');var logger=require(_0x6605('0x1'))(_0x6605('0x2'));var moment=require(_0x6605('0x3'));var BPromise=require(_0x6605('0x4'));var rp=require(_0x6605('0x5'));var fs=require('fs');var path=require(_0x6605('0x6'));var rimraf=require(_0x6605('0x7'));var config=require(_0x6605('0x8'));var attributes=require(_0x6605('0x9'));module['exports']=function(_0xb8c2a,_0x58ac1f){return _0xb8c2a['define'](_0x6605('0xa'),attributes,{'tableName':_0x6605('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf040=['JscriptyAnswerReport','lodash','util','../../config/logger','api','bluebird','request-promise','path','define'];(function(_0x5f5694,_0x3ad2e4){var _0x5de981=function(_0x29a0c0){while(--_0x29a0c0){_0x5f5694['push'](_0x5f5694['shift']());}};_0x5de981(++_0x3ad2e4);}(_0xf040,0x17b));var _0x0f04=function(_0x2f5a56,_0x221e13){_0x2f5a56=_0x2f5a56-0x0;var _0x96bd89=_0xf040[_0x2f5a56];return _0x96bd89;};'use strict';var _=require(_0x0f04('0x0'));var util=require(_0x0f04('0x1'));var logger=require(_0x0f04('0x2'))(_0x0f04('0x3'));var moment=require('moment');var BPromise=require(_0x0f04('0x4'));var rp=require(_0x0f04('0x5'));var fs=require('fs');var path=require(_0x0f04('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x6f34fa,_0x4a119c){return _0x6f34fa[_0x0f04('0x7')](_0x0f04('0x8'),attributes,{'tableName':'report_jscripty_answers','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 70230b9..2b8cab6 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 _0xac76=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x8fb092,_0x883290){var _0xd63883=function(_0x567d8e){while(--_0x567d8e){_0x8fb092['push'](_0x8fb092['shift']());}};_0xd63883(++_0x883290);}(_0xac76,0x13e));var _0x6ac7=function(_0x4bd8e1,_0x5e9388){_0x4bd8e1=_0x4bd8e1-0x0;var _0x286282=_0xac76[_0x4bd8e1];return _0x286282;};'use strict';var _=require(_0x6ac7('0x0'));var util=require('util');var moment=require(_0x6ac7('0x1'));var BPromise=require(_0x6ac7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ac7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6ac7('0x4'))(_0x6ac7('0x5'));var config=require(_0x6ac7('0x6'));var jayson=require(_0x6ac7('0x7'));var client=jayson['client'][_0x6ac7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b3e33,_0x4ec061,_0x1f8204){return new BPromise(function(_0xb68a60,_0x1a5c9c){return client[_0x6ac7('0x9')](_0x1b3e33,_0x1f8204)[_0x6ac7('0xa')](function(_0x298353){logger[_0x6ac7('0xb')](_0x6ac7('0xc'),_0x4ec061,_0x6ac7('0xd'));logger[_0x6ac7('0xe')](_0x6ac7('0xf'),_0x4ec061,_0x6ac7('0xd'),JSON[_0x6ac7('0x10')](_0x298353));if(_0x298353[_0x6ac7('0x11')]){if(_0x298353['error'][_0x6ac7('0x12')]===0x1f4){logger[_0x6ac7('0x11')](_0x6ac7('0xc'),_0x4ec061,_0x298353[_0x6ac7('0x11')]['message']);return _0x1a5c9c(_0x298353[_0x6ac7('0x11')][_0x6ac7('0x13')]);}logger['error'](_0x6ac7('0xc'),_0x4ec061,_0x298353[_0x6ac7('0x11')][_0x6ac7('0x13')]);return _0xb68a60(_0x298353['error'][_0x6ac7('0x13')]);}else{logger[_0x6ac7('0xb')](_0x6ac7('0xc'),_0x4ec061,_0x6ac7('0xd'));_0xb68a60(_0x298353[_0x6ac7('0x14')]['message']);}})[_0x6ac7('0x15')](function(_0x316199){logger['error'](_0x6ac7('0xc'),_0x4ec061,_0x316199);_0x1a5c9c(_0x316199);});});} \ No newline at end of file +var _0x2dd3=['JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info'];(function(_0x14dfd6,_0x392fa4){var _0x36c19a=function(_0x453179){while(--_0x453179){_0x14dfd6['push'](_0x14dfd6['shift']());}};_0x36c19a(++_0x392fa4);}(_0x2dd3,0x18f));var _0x32dd=function(_0x204a27,_0x23fae5){_0x204a27=_0x204a27-0x0;var _0xe733eb=_0x2dd3[_0x204a27];return _0xe733eb;};'use strict';var _=require(_0x32dd('0x0'));var util=require(_0x32dd('0x1'));var moment=require(_0x32dd('0x2'));var BPromise=require(_0x32dd('0x3'));var rs=require(_0x32dd('0x4'));var fs=require('fs');var Redis=require(_0x32dd('0x5'));var db=require(_0x32dd('0x6'))['db'];var utils=require(_0x32dd('0x7'));var logger=require(_0x32dd('0x8'))(_0x32dd('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x32dd('0xa')][_0x32dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3963a4,_0xd0456,_0x420f5e){return new BPromise(function(_0x5c5f01,_0x26417b){return client[_0x32dd('0xc')](_0x3963a4,_0x420f5e)[_0x32dd('0xd')](function(_0x20dc2b){logger[_0x32dd('0xe')](_0x32dd('0xf'),_0xd0456,'request\x20sent');logger[_0x32dd('0x10')](_0x32dd('0x11'),_0xd0456,'request\x20sent',JSON[_0x32dd('0x12')](_0x20dc2b));if(_0x20dc2b[_0x32dd('0x13')]){if(_0x20dc2b[_0x32dd('0x13')][_0x32dd('0x14')]===0x1f4){logger[_0x32dd('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xd0456,_0x20dc2b['error'][_0x32dd('0x15')]);return _0x26417b(_0x20dc2b[_0x32dd('0x13')][_0x32dd('0x15')]);}logger['error'](_0x32dd('0xf'),_0xd0456,_0x20dc2b[_0x32dd('0x13')][_0x32dd('0x15')]);return _0x5c5f01(_0x20dc2b[_0x32dd('0x13')][_0x32dd('0x15')]);}else{logger[_0x32dd('0xe')](_0x32dd('0xf'),_0xd0456,_0x32dd('0x16'));_0x5c5f01(_0x20dc2b['result'][_0x32dd('0x15')]);}})['catch'](function(_0x44284a){logger[_0x32dd('0x13')](_0x32dd('0xf'),_0xd0456,_0x44284a);_0x26417b(_0x44284a);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 1b8ff59..28d2ae2 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 _0x8ea7=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','/:id','isAuthenticated','show','/:id/sessions','getSessions','getAnswers','/:id/summary','30s','getSummary','create','post','/:id/clone','put','update','delete','destroy','exports','multer','util'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0x8ea7,0x19e));var _0x78ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x78ea('0x0'));var util=require(_0x78ea('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x78ea('0x2')]();var fs_extra=require(_0x78ea('0x3'));var auth=require(_0x78ea('0x4'));var interaction=require(_0x78ea('0x5'));var config=require(_0x78ea('0x6'));var controller=require(_0x78ea('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x78ea('0x8')](_0x78ea('0x9'),auth[_0x78ea('0xa')](),controller[_0x78ea('0xb')]);router[_0x78ea('0x8')](_0x78ea('0xc'),auth[_0x78ea('0xa')](),controller[_0x78ea('0xd')]);router['get']('/:id/answers',auth['isAuthenticated'](),controller[_0x78ea('0xe')]);router['get'](_0x78ea('0xf'),auth[_0x78ea('0xa')](),timeout(_0x78ea('0x10')),controller[_0x78ea('0x11')]);router['post']('/',auth[_0x78ea('0xa')](),controller[_0x78ea('0x12')]);router[_0x78ea('0x13')](_0x78ea('0x14'),auth['isAuthenticated'](),controller['clone']);router[_0x78ea('0x15')](_0x78ea('0x9'),auth[_0x78ea('0xa')](),controller[_0x78ea('0x16')]);router[_0x78ea('0x17')]('/:id',auth[_0x78ea('0xa')](),controller[_0x78ea('0x18')]);module[_0x78ea('0x19')]=router; \ No newline at end of file +var _0x47fd=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','index','/:id','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','30s','getSummary','post','/:id/clone','put','update','exports'];(function(_0x418eba,_0x3a9050){var _0x507793=function(_0x557f71){while(--_0x557f71){_0x418eba['push'](_0x418eba['shift']());}};_0x507793(++_0x3a9050);}(_0x47fd,0x9a));var _0xd47f=function(_0x591d44,_0x2b43a3){_0x591d44=_0x591d44-0x0;var _0x41dd26=_0x47fd[_0x591d44];return _0x41dd26;};'use strict';var multer=require(_0xd47f('0x0'));var util=require(_0xd47f('0x1'));var path=require(_0xd47f('0x2'));var timeout=require(_0xd47f('0x3'));var express=require(_0xd47f('0x4'));var router=express[_0xd47f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd47f('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0xd47f('0x7')]('/',auth['isAuthenticated'](),controller[_0xd47f('0x8')]);router[_0xd47f('0x7')](_0xd47f('0x9'),auth[_0xd47f('0xa')](),controller[_0xd47f('0xb')]);router['get'](_0xd47f('0xc'),auth[_0xd47f('0xa')](),controller[_0xd47f('0xd')]);router['get'](_0xd47f('0xe'),auth[_0xd47f('0xa')](),controller['getAnswers']);router[_0xd47f('0x7')]('/:id/summary',auth[_0xd47f('0xa')](),timeout(_0xd47f('0xf')),controller[_0xd47f('0x10')]);router['post']('/',auth[_0xd47f('0xa')](),controller['create']);router[_0xd47f('0x11')](_0xd47f('0x12'),auth[_0xd47f('0xa')](),controller['clone']);router[_0xd47f('0x13')](_0xd47f('0x9'),auth[_0xd47f('0xa')](),controller[_0xd47f('0x14')]);router['delete'](_0xd47f('0x9'),auth[_0xd47f('0xa')](),controller['destroy']);module[_0xd47f('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index c03864e..bb8580b 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 _0x61c6=['format','getDataValue','description','BOOLEAN','sequelize','exports','STRING','name','TEXT','isObjectLike','formData','stringify','isString','setDataValue'];(function(_0xbcf787,_0x53a912){var _0x4d4fb3=function(_0x4889ba){while(--_0x4889ba){_0xbcf787['push'](_0xbcf787['shift']());}};_0x4d4fb3(++_0x53a912);}(_0x61c6,0x146));var _0x661c=function(_0x5d41d4,_0x20eed2){_0x5d41d4=_0x5d41d4-0x0;var _0x218ef1=_0x61c6[_0x5d41d4];return _0x218ef1;};'use strict';var Sequelize=require(_0x661c('0x0'));var _=require('lodash');var util=require('util');module[_0x661c('0x1')]={'name':{'type':Sequelize[_0x661c('0x2')],'unique':_0x661c('0x3')},'description':{'type':Sequelize[_0x661c('0x2')]},'formData':{'type':Sequelize[_0x661c('0x4')]('long'),'set':function(_0x2819dc){if(_[_0x661c('0x5')](_0x2819dc)){this['setDataValue'](_0x661c('0x6'),JSON[_0x661c('0x7')](_0x2819dc));}else if(_[_0x661c('0x8')](_0x2819dc)){this[_0x661c('0x9')](_0x661c('0x6'),_0x2819dc);}else{this[_0x661c('0x9')](_0x661c('0x6'),util[_0x661c('0xa')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue'](_0x661c('0x3'))||'',this[_0x661c('0xb')](_0x661c('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x661c('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0xb3f1=['name','TEXT','long','isObjectLike','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','description','BOOLEAN','sequelize','lodash','util','exports','STRING'];(function(_0x188f32,_0x2d0c86){var _0x56c2f5=function(_0x32b87f){while(--_0x32b87f){_0x188f32['push'](_0x188f32['shift']());}};_0x56c2f5(++_0x2d0c86);}(_0xb3f1,0x182));var _0x1b3f=function(_0x4dc437,_0x1704d0){_0x4dc437=_0x4dc437-0x0;var _0x5b228e=_0xb3f1[_0x4dc437];return _0x5b228e;};'use strict';var Sequelize=require(_0x1b3f('0x0'));var _=require(_0x1b3f('0x1'));var util=require(_0x1b3f('0x2'));module[_0x1b3f('0x3')]={'name':{'type':Sequelize[_0x1b3f('0x4')],'unique':_0x1b3f('0x5')},'description':{'type':Sequelize[_0x1b3f('0x4')]},'formData':{'type':Sequelize[_0x1b3f('0x6')](_0x1b3f('0x7')),'set':function(_0x2c64ea){if(_[_0x1b3f('0x8')](_0x2c64ea)){this['setDataValue'](_0x1b3f('0x9'),JSON[_0x1b3f('0xa')](_0x2c64ea));}else if(_[_0x1b3f('0xb')](_0x2c64ea)){this[_0x1b3f('0xc')]('formData',_0x2c64ea);}else{this['setDataValue'](_0x1b3f('0x9'),util[_0x1b3f('0xd')](_0x1b3f('0xe'),this['getDataValue'](_0x1b3f('0x5'))||'',this['getDataValue'](_0x1b3f('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x1b3f('0x10')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 3ba8582..d7f1f66 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 _0xcc4d=['indexOf','replace','startTime','starttime','parse','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','end','error','name','send','index','map','JscriptyProject','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileResource','getSessions','findOne','JscriptySessionReport','nolimit','JscriptyAnswerReport','ProjectId','rows','fromCharCode','toString'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0xcc4d,0x103));var _0xdcc4=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xcc4d[_0x24237f];return _0x48298e;};'use strict';var emlformat=require(_0xdcc4('0x0'));var rimraf=require(_0xdcc4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdcc4('0x2'));var moment=require(_0xdcc4('0x3'));var BPromise=require(_0xdcc4('0x4'));var Mustache=require('mustache');var util=require(_0xdcc4('0x5'));var path=require(_0xdcc4('0x6'));var sox=require(_0xdcc4('0x7'));var csv=require(_0xdcc4('0x8'));var ejs=require(_0xdcc4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdcc4('0xa'));var crypto=require(_0xdcc4('0xb'));var jsforce=require(_0xdcc4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdcc4('0x8'));var querystring=require(_0xdcc4('0xd'));var Papa=require('papaparse');var Redis=require(_0xdcc4('0xe'));var authService=require(_0xdcc4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xdcc4('0x10'));var hardwareService=require(_0xdcc4('0x11'));var logger=require(_0xdcc4('0x12'))('api');var utils=require(_0xdcc4('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xdcc4('0x14'));var db=require(_0xdcc4('0x15'))['db'];function respondWithStatusCode(_0x5926ab,_0xdc03c6){_0xdc03c6=_0xdc03c6||0xcc;return function(_0x210ae8){if(_0x210ae8){return _0x5926ab[_0xdcc4('0x16')](_0xdc03c6);}return _0x5926ab[_0xdcc4('0x17')](_0xdc03c6)['end']();};}function respondWithResult(_0x5a3704,_0xa86c8d){_0xa86c8d=_0xa86c8d||0xc8;return function(_0x4b11d3){if(_0x4b11d3){return _0x5a3704['status'](_0xa86c8d)[_0xdcc4('0x18')](_0x4b11d3);}};}function respondWithFilteredResult(_0x23e577,_0x496e57){return function(_0x576125){if(_0x576125){var _0x574603=typeof _0x496e57['offset']===_0xdcc4('0x19')&&typeof _0x496e57['limit']===_0xdcc4('0x19');var _0x815fc5=_0x576125[_0xdcc4('0x1a')];var _0x55c9bc=_0x574603?0x0:_0x496e57['offset'];var _0x1a45d3=_0x574603?_0x576125[_0xdcc4('0x1a')]:_0x496e57[_0xdcc4('0x1b')]+_0x496e57['limit'];var _0x1234f6;if(_0x1a45d3>=_0x815fc5){_0x1a45d3=_0x815fc5;_0x1234f6=0xc8;}else{_0x1234f6=0xce;}_0x23e577[_0xdcc4('0x17')](_0x1234f6);return _0x23e577[_0xdcc4('0x1c')](_0xdcc4('0x1d'),_0x55c9bc+'-'+_0x1a45d3+'/'+_0x815fc5)['json'](_0x576125);}return null;};}function patchUpdates(_0x3e95c3){return function(_0x278a90){try{jsonpatch[_0xdcc4('0x1e')](_0x278a90,_0x3e95c3,!![]);}catch(_0x2ac0e5){return BPromise[_0xdcc4('0x1f')](_0x2ac0e5);}return _0x278a90[_0xdcc4('0x20')]();};}function saveUpdates(_0x33be6b,_0x38a6f0){return function(_0xe71eb1){if(_0xe71eb1){return _0xe71eb1[_0xdcc4('0x21')](_0x33be6b)[_0xdcc4('0x22')](function(_0x5565fb){return _0x5565fb;});}return null;};}function removeEntity(_0x910b73,_0x3fb377){return function(_0xf856e0){if(_0xf856e0){return _0xf856e0[_0xdcc4('0x23')]()[_0xdcc4('0x22')](function(){var _0x4038c7=_0xf856e0[_0xdcc4('0x24')]({'plain':!![]});var _0x586284=_0xdcc4('0x25');return db['UserProfileResource'][_0xdcc4('0x23')]({'where':{'type':_0x586284,'resourceId':_0x4038c7['id']}})[_0xdcc4('0x22')](function(){return _0xf856e0;});})[_0xdcc4('0x22')](function(){_0x910b73['status'](0xcc)[_0xdcc4('0x26')]();});}};}function handleEntityNotFound(_0x51852c,_0x338002){return function(_0xb0cf50){if(!_0xb0cf50){_0x51852c['sendStatus'](0x194);}return _0xb0cf50;};}function handleError(_0x5965ba,_0x239696){_0x239696=_0x239696||0x1f4;return function(_0x30c694){logger[_0xdcc4('0x27')](_0x30c694['stack']);if(_0x30c694[_0xdcc4('0x28')]){delete _0x30c694[_0xdcc4('0x28')];}_0x5965ba[_0xdcc4('0x17')](_0x239696)[_0xdcc4('0x29')](_0x30c694);};}exports[_0xdcc4('0x2a')]=function(_0x1e87ee,_0x4a5b2e){var _0x3cdd74={},_0x14ce22={},_0x4f27c7={'count':0x0,'rows':[]};var _0x17e121=_[_0xdcc4('0x2b')](db[_0xdcc4('0x2c')][_0xdcc4('0x2d')],function(_0x15cb35){return{'name':_0x15cb35[_0xdcc4('0x2e')],'type':_0x15cb35['type'][_0xdcc4('0x2f')]};});_0x14ce22[_0xdcc4('0x30')]=_[_0xdcc4('0x2b')](_0x17e121,_0xdcc4('0x28'));_0x14ce22[_0xdcc4('0x31')]=_['keys'](_0x1e87ee[_0xdcc4('0x31')]);_0x14ce22['filters']=_['intersection'](_0x14ce22['model'],_0x14ce22[_0xdcc4('0x31')]);_0x3cdd74[_0xdcc4('0x32')]=_[_0xdcc4('0x33')](_0x14ce22[_0xdcc4('0x30')],qs[_0xdcc4('0x34')](_0x1e87ee[_0xdcc4('0x31')][_0xdcc4('0x34')]));_0x3cdd74[_0xdcc4('0x32')]=_0x3cdd74[_0xdcc4('0x32')][_0xdcc4('0x35')]?_0x3cdd74[_0xdcc4('0x32')]:_0x14ce22[_0xdcc4('0x30')];if(!_0x1e87ee[_0xdcc4('0x31')][_0xdcc4('0x36')]('nolimit')){_0x3cdd74[_0xdcc4('0x37')]=qs[_0xdcc4('0x37')](_0x1e87ee[_0xdcc4('0x31')]['limit']);_0x3cdd74[_0xdcc4('0x1b')]=qs[_0xdcc4('0x1b')](_0x1e87ee[_0xdcc4('0x31')][_0xdcc4('0x1b')]);}_0x3cdd74[_0xdcc4('0x38')]=qs[_0xdcc4('0x39')](_0x1e87ee['query'][_0xdcc4('0x39')]);_0x3cdd74[_0xdcc4('0x3a')]=qs[_0xdcc4('0x3b')](_[_0xdcc4('0x3c')](_0x1e87ee[_0xdcc4('0x31')],_0x14ce22[_0xdcc4('0x3b')]),_0x17e121);if(_0x1e87ee['query'][_0xdcc4('0x3d')]){_0x3cdd74['where']=_[_0xdcc4('0x3e')](_0x3cdd74[_0xdcc4('0x3a')],{'$or':_[_0xdcc4('0x2b')](_0x17e121,function(_0x7e671c){if(_0x7e671c[_0xdcc4('0x3f')]!==_0xdcc4('0x40')){var _0x160838={};_0x160838[_0x7e671c['name']]={'$like':'%'+_0x1e87ee[_0xdcc4('0x31')][_0xdcc4('0x3d')]+'%'};return _0x160838;}})});}_0x3cdd74=_[_0xdcc4('0x3e')]({},_0x3cdd74,_0x1e87ee['options']);var _0x5b0258={'where':_0x3cdd74['where']};return db[_0xdcc4('0x2c')][_0xdcc4('0x1a')](_0x5b0258)['then'](function(_0x20e70a){_0x4f27c7['count']=_0x20e70a;if(_0x1e87ee[_0xdcc4('0x31')][_0xdcc4('0x41')]){_0x3cdd74[_0xdcc4('0x42')]=[{'all':!![]}];}return db['JscriptyProject'][_0xdcc4('0x43')](_0x3cdd74);})[_0xdcc4('0x22')](function(_0x5f2053){_0x4f27c7['rows']=_0x5f2053;return _0x4f27c7;})[_0xdcc4('0x22')](respondWithFilteredResult(_0x4a5b2e,_0x3cdd74))[_0xdcc4('0x44')](handleError(_0x4a5b2e,null));};exports[_0xdcc4('0x45')]=function(_0x1e958e,_0xfd03e){var _0x467e4a={'raw':![],'where':{'id':_0x1e958e[_0xdcc4('0x46')]['id']}},_0x10db7e={};_0x10db7e[_0xdcc4('0x30')]=_[_0xdcc4('0x47')](db['JscriptyProject'][_0xdcc4('0x2d')]);_0x10db7e[_0xdcc4('0x31')]=_['keys'](_0x1e958e['query']);_0x10db7e[_0xdcc4('0x3b')]=_['intersection'](_0x10db7e['model'],_0x10db7e[_0xdcc4('0x31')]);_0x467e4a[_0xdcc4('0x32')]=_[_0xdcc4('0x33')](_0x10db7e[_0xdcc4('0x30')],qs[_0xdcc4('0x34')](_0x1e958e[_0xdcc4('0x31')][_0xdcc4('0x34')]));_0x467e4a[_0xdcc4('0x32')]=_0x467e4a[_0xdcc4('0x32')][_0xdcc4('0x35')]?_0x467e4a[_0xdcc4('0x32')]:_0x10db7e[_0xdcc4('0x30')];if(_0x1e958e[_0xdcc4('0x31')]['includeAll']){_0x467e4a[_0xdcc4('0x42')]=[{'all':!![]}];}_0x467e4a=_[_0xdcc4('0x3e')]({},_0x467e4a,_0x1e958e[_0xdcc4('0x48')]);return db[_0xdcc4('0x2c')][_0xdcc4('0x49')](_0x467e4a)['then'](handleEntityNotFound(_0xfd03e,null))['then'](respondWithResult(_0xfd03e,null))[_0xdcc4('0x44')](handleError(_0xfd03e,null));};exports['create']=function(_0x5aa2b8,_0x5768e1){return db[_0xdcc4('0x2c')][_0xdcc4('0x4a')](_0x5aa2b8[_0xdcc4('0x4b')],{})[_0xdcc4('0x22')](function(_0x375b91){var _0x5cc1ea=_0x5aa2b8[_0xdcc4('0x4c')]['get']({'plain':!![]});if(!_0x5cc1ea)throw new Error(_0xdcc4('0x4d'));if(_0x5cc1ea[_0xdcc4('0x4e')]===_0xdcc4('0x4c')){var _0x63c00a=_0x375b91[_0xdcc4('0x24')]({'plain':!![]});var _0x4c2197=_0xdcc4('0x25');return db['UserProfileSection'][_0xdcc4('0x49')]({'where':{'name':_0x4c2197,'userProfileId':_0x5cc1ea['userProfileId']},'raw':!![]})[_0xdcc4('0x22')](function(_0x1cb731){if(_0x1cb731&&_0x1cb731[_0xdcc4('0x4f')]===0x0){return db['UserProfileResource'][_0xdcc4('0x4a')]({'name':_0x63c00a[_0xdcc4('0x28')],'resourceId':_0x63c00a['id'],'type':_0x1cb731[_0xdcc4('0x28')],'sectionId':_0x1cb731['id']},{})['then'](function(){return _0x375b91;});}else{return _0x375b91;}})['catch'](function(_0x552a2c){logger[_0xdcc4('0x27')](_0xdcc4('0x50'),_0x552a2c);throw _0x552a2c;});}return _0x375b91;})[_0xdcc4('0x22')](respondWithResult(_0x5768e1,0xc9))['catch'](handleError(_0x5768e1,null));};exports[_0xdcc4('0x51')]=function(_0x2a434a,_0x1c58b0){var _0x27a888={'where':{'id':_0x2a434a[_0xdcc4('0x46')]['id']}},_0x569eb3={};_0x569eb3[_0xdcc4('0x30')]=_[_0xdcc4('0x47')](db['JscriptyProject'][_0xdcc4('0x2d')]);_0x27a888[_0xdcc4('0x32')]=_['intersection'](_0x569eb3[_0xdcc4('0x30')],qs[_0xdcc4('0x34')](_0x2a434a['query']['fields']));_0x27a888[_0xdcc4('0x32')]=_0x27a888['attributes'][_0xdcc4('0x35')]?_0x27a888[_0xdcc4('0x32')]:_0x569eb3['model'];if(_0x2a434a['query'][_0xdcc4('0x41')]){_0x27a888['include']=[{'all':!![]}];}_0x27a888=_[_0xdcc4('0x3e')]({},_0x27a888,_0x2a434a[_0xdcc4('0x48')]);return db['JscriptyProject'][_0xdcc4('0x49')](_0x27a888)[_0xdcc4('0x22')](handleEntityNotFound(_0x1c58b0,null))[_0xdcc4('0x22')](function(_0x3dda2c){if(_0x3dda2c){var _0x1d574c=_0x3dda2c[_0xdcc4('0x24')]({'plain':!![]});_0x1d574c=qs[_0xdcc4('0x52')](_0x1d574c,['id',_0xdcc4('0x53'),_0xdcc4('0x54')]);_0x2a434a[_0xdcc4('0x4b')]=_['omit'](_0x2a434a[_0xdcc4('0x4b')],['id',_0xdcc4('0x53'),_0xdcc4('0x54')]);return db[_0xdcc4('0x2c')][_0xdcc4('0x4a')](_[_0xdcc4('0x3e')](_0x1d574c,_0x2a434a[_0xdcc4('0x4b')]),{'include':_0x2a434a[_0xdcc4('0x31')][_0xdcc4('0x41')]?[{'all':!![]}]:undefined})[_0xdcc4('0x22')](function(_0x28f688){var _0x27d4a9=_0x2a434a['user'][_0xdcc4('0x24')]({'plain':!![]});if(!_0x27d4a9)throw new Error(_0xdcc4('0x4d'));if(_0x27d4a9['role']==='user'){var _0x546677=_0x28f688[_0xdcc4('0x24')]({'plain':!![]});var _0x2581ab='Projects';return db['UserProfileSection']['find']({'where':{'name':_0x2581ab,'userProfileId':_0x27d4a9['userProfileId']},'raw':!![]})[_0xdcc4('0x22')](function(_0x5aa0d2){if(_0x5aa0d2&&_0x5aa0d2[_0xdcc4('0x4f')]===0x0){return db[_0xdcc4('0x55')][_0xdcc4('0x4a')]({'name':_0x546677[_0xdcc4('0x28')],'resourceId':_0x546677['id'],'type':_0x5aa0d2['name'],'sectionId':_0x5aa0d2['id']},{})[_0xdcc4('0x22')](function(){return _0x28f688;});}else{return _0x28f688;}})['catch'](function(_0x5324cf){logger[_0xdcc4('0x27')](_0xdcc4('0x50'),_0x5324cf);throw _0x5324cf;});}return _0x28f688;});}})[_0xdcc4('0x22')](respondWithResult(_0x1c58b0,0xc9))[_0xdcc4('0x44')](handleError(_0x1c58b0,null));};exports['update']=function(_0x35bff5,_0x5ca006){if(_0x35bff5['body']['id']){delete _0x35bff5[_0xdcc4('0x4b')]['id'];}return db[_0xdcc4('0x2c')][_0xdcc4('0x49')]({'where':{'id':_0x35bff5[_0xdcc4('0x46')]['id']}})[_0xdcc4('0x22')](handleEntityNotFound(_0x5ca006,null))[_0xdcc4('0x22')](saveUpdates(_0x35bff5[_0xdcc4('0x4b')],null))[_0xdcc4('0x22')](respondWithResult(_0x5ca006,null))[_0xdcc4('0x44')](handleError(_0x5ca006,null));};exports['destroy']=function(_0x5d3249,_0x34713b){return db[_0xdcc4('0x2c')][_0xdcc4('0x49')]({'where':{'id':_0x5d3249[_0xdcc4('0x46')]['id']}})[_0xdcc4('0x22')](handleEntityNotFound(_0x34713b,null))[_0xdcc4('0x22')](removeEntity(_0x34713b,null))[_0xdcc4('0x44')](handleError(_0x34713b,null));};exports[_0xdcc4('0x56')]=function(_0x107fb8,_0xe8c255,_0x1c1d08){var _0x1c8f8e={'raw':!![],'where':{}};var _0x27995b={};var _0xe3ad90={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xdcc4('0x57')]({'where':{'id':_0x107fb8['params']['id']}})[_0xdcc4('0x22')](handleEntityNotFound(_0xe8c255,null))[_0xdcc4('0x22')](function(_0x436f99){if(_0x436f99){_0x27995b[_0xdcc4('0x30')]=_['keys'](db[_0xdcc4('0x58')][_0xdcc4('0x2d')]);_0x27995b[_0xdcc4('0x31')]=_[_0xdcc4('0x47')](_0x107fb8[_0xdcc4('0x31')]);_0x27995b[_0xdcc4('0x3b')]=_[_0xdcc4('0x33')](_0x27995b[_0xdcc4('0x30')],_0x27995b[_0xdcc4('0x31')]);_0x1c8f8e['attributes']=_[_0xdcc4('0x33')](_0x27995b['model'],qs[_0xdcc4('0x34')](_0x107fb8[_0xdcc4('0x31')][_0xdcc4('0x34')]));_0x1c8f8e['attributes']=_0x1c8f8e['attributes'][_0xdcc4('0x35')]?_0x1c8f8e['attributes']:_0x27995b[_0xdcc4('0x30')];if(!_0x107fb8['query'][_0xdcc4('0x36')](_0xdcc4('0x59'))){_0x1c8f8e[_0xdcc4('0x37')]=qs[_0xdcc4('0x37')](_0x107fb8[_0xdcc4('0x31')][_0xdcc4('0x37')]);_0x1c8f8e['offset']=qs['offset'](_0x107fb8[_0xdcc4('0x31')]['offset']);}_0x1c8f8e[_0xdcc4('0x38')]=qs[_0xdcc4('0x39')](_0x107fb8['query']['sort']);_0x1c8f8e[_0xdcc4('0x3a')]=qs['filters'](_[_0xdcc4('0x3c')](_0x107fb8['query'],_0x27995b[_0xdcc4('0x3b')]));_0x1c8f8e['where']['ProjectId']=_0x436f99['id'];if(_0x107fb8['query'][_0xdcc4('0x3d')]){_0x1c8f8e[_0xdcc4('0x3a')]=_['merge'](_0x1c8f8e[_0xdcc4('0x3a')],{'$or':_[_0xdcc4('0x2b')](_0x1c8f8e[_0xdcc4('0x32')],function(_0x267378){var _0x41d8d0={};_0x41d8d0[_0x267378]={'$like':'%'+_0x107fb8['query'][_0xdcc4('0x3d')]+'%'};return _0x41d8d0;})});}_0x1c8f8e=_['merge']({},_0x1c8f8e,_0x107fb8[_0xdcc4('0x48')]);return db[_0xdcc4('0x58')]['count']({'where':_0x1c8f8e[_0xdcc4('0x3a')]})[_0xdcc4('0x22')](function(_0x2614b2){_0xe3ad90[_0xdcc4('0x1a')]=_0x2614b2;if(_0x107fb8[_0xdcc4('0x31')][_0xdcc4('0x41')]){_0x1c8f8e[_0xdcc4('0x42')]=[{'all':!![]}];}return db[_0xdcc4('0x58')]['findAll'](_0x1c8f8e);})[_0xdcc4('0x22')](function(_0x4dcf92){_0xe3ad90['rows']=_0x4dcf92;return _0xe3ad90;});}})[_0xdcc4('0x22')](respondWithFilteredResult(_0xe8c255,_0x1c8f8e))[_0xdcc4('0x44')](handleError(_0xe8c255,null));};exports['getAnswers']=function(_0x4574ce,_0x5e9557,_0x269d93){var _0x542613={'raw':!![],'where':{}};var _0x1e557c={};var _0x11b6df={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xdcc4('0x57')]({'where':{'id':_0x4574ce['params']['id']}})[_0xdcc4('0x22')](handleEntityNotFound(_0x5e9557,null))[_0xdcc4('0x22')](function(_0x56d828){if(_0x56d828){_0x1e557c[_0xdcc4('0x30')]=_['keys'](db[_0xdcc4('0x5a')][_0xdcc4('0x2d')]);_0x1e557c['query']=_[_0xdcc4('0x47')](_0x4574ce[_0xdcc4('0x31')]);_0x1e557c[_0xdcc4('0x3b')]=_[_0xdcc4('0x33')](_0x1e557c[_0xdcc4('0x30')],_0x1e557c[_0xdcc4('0x31')]);_0x542613[_0xdcc4('0x32')]=_['intersection'](_0x1e557c[_0xdcc4('0x30')],qs[_0xdcc4('0x34')](_0x4574ce['query'][_0xdcc4('0x34')]));_0x542613[_0xdcc4('0x32')]=_0x542613['attributes']['length']?_0x542613['attributes']:_0x1e557c[_0xdcc4('0x30')];if(!_0x4574ce[_0xdcc4('0x31')][_0xdcc4('0x36')](_0xdcc4('0x59'))){_0x542613[_0xdcc4('0x37')]=qs[_0xdcc4('0x37')](_0x4574ce[_0xdcc4('0x31')]['limit']);_0x542613[_0xdcc4('0x1b')]=qs[_0xdcc4('0x1b')](_0x4574ce['query'][_0xdcc4('0x1b')]);}_0x542613[_0xdcc4('0x38')]=qs[_0xdcc4('0x39')](_0x4574ce[_0xdcc4('0x31')][_0xdcc4('0x39')]);_0x542613[_0xdcc4('0x3a')]=qs[_0xdcc4('0x3b')](_[_0xdcc4('0x3c')](_0x4574ce[_0xdcc4('0x31')],_0x1e557c['filters']));_0x542613[_0xdcc4('0x3a')][_0xdcc4('0x5b')]=_0x56d828['id'];if(_0x4574ce[_0xdcc4('0x31')][_0xdcc4('0x3d')]){_0x542613[_0xdcc4('0x3a')]=_['merge'](_0x542613[_0xdcc4('0x3a')],{'$or':_[_0xdcc4('0x2b')](_0x542613[_0xdcc4('0x32')],function(_0x485361){var _0x27b496={};_0x27b496[_0x485361]={'$like':'%'+_0x4574ce['query'][_0xdcc4('0x3d')]+'%'};return _0x27b496;})});}_0x542613=_['merge']({},_0x542613,_0x4574ce[_0xdcc4('0x48')]);return db['JscriptyAnswerReport'][_0xdcc4('0x1a')]({'where':_0x542613[_0xdcc4('0x3a')]})['then'](function(_0x4f07db){_0x11b6df[_0xdcc4('0x1a')]=_0x4f07db;if(_0x4574ce[_0xdcc4('0x31')][_0xdcc4('0x41')]){_0x542613[_0xdcc4('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x542613);})[_0xdcc4('0x22')](function(_0x41d664){_0x11b6df[_0xdcc4('0x5c')]=_0x41d664;return _0x11b6df;});}})['then'](respondWithFilteredResult(_0x5e9557,_0x542613))[_0xdcc4('0x44')](handleError(_0x5e9557,null));};function char(_0x55c444){return'number'===typeof _0x55c444?String[_0xdcc4('0x5d')][_0xdcc4('0x1e')](null,arguments):_0x55c444;}function needsEncapsulation(_0x1216d0){return!!_0x1216d0&&(_0x1216d0[_0xdcc4('0x5e')]()['indexOf'](char(0xd))>=0x0||_0x1216d0[_0xdcc4('0x5e')]()[_0xdcc4('0x5f')](char(0xa))>=0x0||_0x1216d0[_0xdcc4('0x5e')]()[_0xdcc4('0x5f')](char(0x2c))>=0x0||_0x1216d0[_0xdcc4('0x5e')]()[_0xdcc4('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x17ed29){var _0x8e01f4=char(0x22),_0x422410='\x5c'+char(0x22),_0x28f7f4=_0x17ed29[_0xdcc4('0x5e')]()[_0xdcc4('0x60')](new RegExp(_0x8e01f4,'g'),_0x422410);return _0x8e01f4+_0x28f7f4+_0x8e01f4;}exports['getSummary']=function(_0x103991,_0x115688,_0x3e7644){var _0x3d7878,_0x539c04;var _0x1a53ac={'where':{'ProjectId':_0x103991['params']['id']}};if(_0x103991['query'][_0xdcc4('0x61')]){_0x1a53ac[_0xdcc4('0x3a')][_0xdcc4('0x62')]=JSON[_0xdcc4('0x63')](_0x103991[_0xdcc4('0x31')][_0xdcc4('0x61')]);}return db[_0xdcc4('0x58')][_0xdcc4('0x43')](_0x1a53ac)[_0xdcc4('0x22')](handleEntityNotFound(_0x115688,null))[_0xdcc4('0x22')](function(_0x33e303){if(_0x33e303){_0x3d7878=_0x33e303;return db['JscriptyQuestionReport'][_0xdcc4('0x43')]({'where':{'SessionId':{'$in':_[_0xdcc4('0x2b')](_0x3d7878,'id')},'ProjectId':_0x103991[_0xdcc4('0x46')]['id']},'order':_0xdcc4('0x64')});}})['then'](handleEntityNotFound(_0x115688,null))[_0xdcc4('0x22')](function(_0x1382cf){if(_0x1382cf){_0x539c04=_0x1382cf;var _0x362bea={};for(var _0x25e172=0x0,_0x2cb38b=_0x539c04['length'];_0x25e172<_0x2cb38b;_0x25e172++){if(!_0x362bea['hasOwnProperty'](_0x539c04[_0x25e172][_0xdcc4('0x65')])){_0x362bea[_0x539c04[_0x25e172][_0xdcc4('0x65')]]=needsEncapsulation(_0x539c04[_0x25e172][_0xdcc4('0x66')])?encapsulate(_0x539c04[_0x25e172]['question']):_0x539c04[_0x25e172][_0xdcc4('0x66')];}}var _0x53392a=[],_0x222ed6={};for(var _0x4ca477=0x0,_0x26d48c=_0x3d7878[_0xdcc4('0x35')];_0x4ca477<_0x26d48c;_0x4ca477++){_0x222ed6={'ProjectId':_0x103991['params']['id'],'SessionId':_0x3d7878[_0x4ca477]['id'],'StartTime':moment(_0x3d7878[_0x4ca477][_0xdcc4('0x62')])['format'](_0xdcc4('0x67'))};for(var _0x16f03b=0x0,_0x275328=_0x539c04[_0xdcc4('0x35')];_0x16f03b<_0x275328;_0x16f03b++){if(_0x539c04[_0x16f03b][_0xdcc4('0x68')]==_0x3d7878[_0x4ca477]['id']&&_0x362bea[_0xdcc4('0x36')](_0x539c04[_0x16f03b]['questionId'])){_0x222ed6[_0x362bea[_0x539c04[_0x16f03b][_0xdcc4('0x65')]]]=_0x539c04[_0x16f03b][_0xdcc4('0x69')];}}for(var _0x33c51a in _0x362bea){if(!_0x222ed6['hasOwnProperty'](_0x362bea[_0x33c51a])){_0x222ed6[_0x362bea[_0x33c51a]]=null;}}_0x53392a[_0xdcc4('0x6a')](_0x222ed6);}return _0x53392a;}})[_0xdcc4('0x22')](function(_0x2bdfbb){if(!_[_0xdcc4('0x6b')](_0x2bdfbb)){var _0x567506=toCsv(_0x2bdfbb);var _0x42f914=Date[_0xdcc4('0x6c')]();fs[_0xdcc4('0x6d')](util[_0xdcc4('0x6e')](_0xdcc4('0x6f'),_0x103991[_0xdcc4('0x46')]['id'],_0x42f914),_0x567506);_0x115688[_0xdcc4('0x70')](_0xdcc4('0x71'),_0xdcc4('0x72')+util[_0xdcc4('0x6e')]('Jscripty_Project_%d_Summary_%s.csv',_0x103991['params']['id'],_0x42f914));_0x115688[_0xdcc4('0x70')](_0xdcc4('0x73'),_0xdcc4('0x74'));return _0x115688[_0xdcc4('0x75')](util[_0xdcc4('0x6e')](_0xdcc4('0x6f'),_0x103991[_0xdcc4('0x46')]['id'],_0x42f914));}else{return _0x115688['sendStatus'](0xcc);}})['catch'](handleError(_0x115688,null));}; \ No newline at end of file +var _0xbc92=['where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','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','clone','params','includeAll','omit','createdAt','getSessions','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','fromCharCode','indexOf','toString','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','isEmpty','now','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','offset','count','limit','set','apply','reject','save','update','then','destroy','Projects','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x208b83,_0x5377fd){var _0x412f2e=function(_0x312f88){while(--_0x312f88){_0x208b83['push'](_0x208b83['shift']());}};_0x412f2e(++_0x5377fd);}(_0xbc92,0xb0));var _0x2bc9=function(_0xccc0d4,_0x2f6bf7){_0xccc0d4=_0xccc0d4-0x0;var _0x27a653=_0xbc92[_0xccc0d4];return _0x27a653;};'use strict';var emlformat=require(_0x2bc9('0x0'));var rimraf=require(_0x2bc9('0x1'));var zipdir=require(_0x2bc9('0x2'));var jsonpatch=require(_0x2bc9('0x3'));var rp=require(_0x2bc9('0x4'));var moment=require(_0x2bc9('0x5'));var BPromise=require(_0x2bc9('0x6'));var Mustache=require(_0x2bc9('0x7'));var util=require(_0x2bc9('0x8'));var path=require(_0x2bc9('0x9'));var sox=require(_0x2bc9('0xa'));var csv=require(_0x2bc9('0xb'));var ejs=require(_0x2bc9('0xc'));var fs=require('fs');var fs_extra=require(_0x2bc9('0xd'));var _=require(_0x2bc9('0xe'));var squel=require(_0x2bc9('0xf'));var crypto=require('crypto');var jsforce=require(_0x2bc9('0x10'));var deskjs=require(_0x2bc9('0x11'));var toCsv=require(_0x2bc9('0xb'));var querystring=require(_0x2bc9('0x12'));var Papa=require(_0x2bc9('0x13'));var Redis=require(_0x2bc9('0x14'));var authService=require(_0x2bc9('0x15'));var qs=require(_0x2bc9('0x16'));var as=require(_0x2bc9('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2bc9('0x18'))('api');var utils=require(_0x2bc9('0x19'));var config=require(_0x2bc9('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe2a883,_0x5ec4b6){_0x5ec4b6=_0x5ec4b6||0xcc;return function(_0x413a00){if(_0x413a00){return _0xe2a883[_0x2bc9('0x1b')](_0x5ec4b6);}return _0xe2a883[_0x2bc9('0x1c')](_0x5ec4b6)[_0x2bc9('0x1d')]();};}function respondWithResult(_0x1f481a,_0x5f5236){_0x5f5236=_0x5f5236||0xc8;return function(_0x3720d4){if(_0x3720d4){return _0x1f481a[_0x2bc9('0x1c')](_0x5f5236)[_0x2bc9('0x1e')](_0x3720d4);}};}function respondWithFilteredResult(_0xbceb1c,_0x5a00bf){return function(_0x51f652){if(_0x51f652){var _0x185ff2=typeof _0x5a00bf['offset']==='undefined'&&typeof _0x5a00bf['limit']===_0x2bc9('0x1f');var _0x22c055=_0x51f652['count'];var _0x43d54b=_0x185ff2?0x0:_0x5a00bf[_0x2bc9('0x20')];var _0x1adb1b=_0x185ff2?_0x51f652[_0x2bc9('0x21')]:_0x5a00bf[_0x2bc9('0x20')]+_0x5a00bf[_0x2bc9('0x22')];var _0x3a94eb;if(_0x1adb1b>=_0x22c055){_0x1adb1b=_0x22c055;_0x3a94eb=0xc8;}else{_0x3a94eb=0xce;}_0xbceb1c[_0x2bc9('0x1c')](_0x3a94eb);return _0xbceb1c[_0x2bc9('0x23')]('Content-Range',_0x43d54b+'-'+_0x1adb1b+'/'+_0x22c055)[_0x2bc9('0x1e')](_0x51f652);}return null;};}function patchUpdates(_0x3c9d6d){return function(_0x4973a2){try{jsonpatch[_0x2bc9('0x24')](_0x4973a2,_0x3c9d6d,!![]);}catch(_0xef4726){return BPromise[_0x2bc9('0x25')](_0xef4726);}return _0x4973a2[_0x2bc9('0x26')]();};}function saveUpdates(_0x566098,_0x5a6b1b){return function(_0x3e39f3){if(_0x3e39f3){return _0x3e39f3[_0x2bc9('0x27')](_0x566098)[_0x2bc9('0x28')](function(_0x3a1526){return _0x3a1526;});}return null;};}function removeEntity(_0xe0b132,_0x1f5c57){return function(_0x8f271c){if(_0x8f271c){return _0x8f271c[_0x2bc9('0x29')]()[_0x2bc9('0x28')](function(){var _0x4a975c=_0x8f271c['get']({'plain':!![]});var _0xfa46dd=_0x2bc9('0x2a');return db['UserProfileResource'][_0x2bc9('0x29')]({'where':{'type':_0xfa46dd,'resourceId':_0x4a975c['id']}})[_0x2bc9('0x28')](function(){return _0x8f271c;});})[_0x2bc9('0x28')](function(){_0xe0b132[_0x2bc9('0x1c')](0xcc)[_0x2bc9('0x1d')]();});}};}function handleEntityNotFound(_0x4ff3a1,_0x59dda3){return function(_0x43534d){if(!_0x43534d){_0x4ff3a1[_0x2bc9('0x1b')](0x194);}return _0x43534d;};}function handleError(_0x1a39a1,_0x57fe90){_0x57fe90=_0x57fe90||0x1f4;return function(_0x4059ff){logger[_0x2bc9('0x2b')](_0x4059ff[_0x2bc9('0x2c')]);if(_0x4059ff['name']){delete _0x4059ff[_0x2bc9('0x2d')];}_0x1a39a1[_0x2bc9('0x1c')](_0x57fe90)[_0x2bc9('0x2e')](_0x4059ff);};}exports[_0x2bc9('0x2f')]=function(_0x56c005,_0xa6a648){var _0x500ae2={},_0x4e8f80={},_0x51f238={'count':0x0,'rows':[]};var _0x25c3bc=_[_0x2bc9('0x30')](db[_0x2bc9('0x31')][_0x2bc9('0x32')],function(_0x53b2fc){return{'name':_0x53b2fc[_0x2bc9('0x33')],'type':_0x53b2fc[_0x2bc9('0x34')][_0x2bc9('0x35')]};});_0x4e8f80[_0x2bc9('0x36')]=_[_0x2bc9('0x30')](_0x25c3bc,_0x2bc9('0x2d'));_0x4e8f80[_0x2bc9('0x37')]=_[_0x2bc9('0x38')](_0x56c005[_0x2bc9('0x37')]);_0x4e8f80[_0x2bc9('0x39')]=_[_0x2bc9('0x3a')](_0x4e8f80[_0x2bc9('0x36')],_0x4e8f80[_0x2bc9('0x37')]);_0x500ae2[_0x2bc9('0x3b')]=_[_0x2bc9('0x3a')](_0x4e8f80['model'],qs[_0x2bc9('0x3c')](_0x56c005[_0x2bc9('0x37')][_0x2bc9('0x3c')]));_0x500ae2[_0x2bc9('0x3b')]=_0x500ae2['attributes'][_0x2bc9('0x3d')]?_0x500ae2[_0x2bc9('0x3b')]:_0x4e8f80['model'];if(!_0x56c005['query'][_0x2bc9('0x3e')](_0x2bc9('0x3f'))){_0x500ae2['limit']=qs['limit'](_0x56c005[_0x2bc9('0x37')][_0x2bc9('0x22')]);_0x500ae2['offset']=qs[_0x2bc9('0x20')](_0x56c005[_0x2bc9('0x37')][_0x2bc9('0x20')]);}_0x500ae2[_0x2bc9('0x40')]=qs['sort'](_0x56c005[_0x2bc9('0x37')][_0x2bc9('0x41')]);_0x500ae2[_0x2bc9('0x42')]=qs['filters'](_[_0x2bc9('0x43')](_0x56c005[_0x2bc9('0x37')],_0x4e8f80[_0x2bc9('0x39')]),_0x25c3bc);if(_0x56c005[_0x2bc9('0x37')][_0x2bc9('0x44')]){_0x500ae2[_0x2bc9('0x42')]=_[_0x2bc9('0x45')](_0x500ae2[_0x2bc9('0x42')],{'$or':_['map'](_0x25c3bc,function(_0x400c80){if(_0x400c80[_0x2bc9('0x34')]!==_0x2bc9('0x46')){var _0x7b0a61={};_0x7b0a61[_0x400c80[_0x2bc9('0x2d')]]={'$like':'%'+_0x56c005[_0x2bc9('0x37')][_0x2bc9('0x44')]+'%'};return _0x7b0a61;}})});}_0x500ae2=_[_0x2bc9('0x45')]({},_0x500ae2,_0x56c005[_0x2bc9('0x47')]);var _0x4d82a5={'where':_0x500ae2[_0x2bc9('0x42')]};return db[_0x2bc9('0x31')][_0x2bc9('0x21')](_0x4d82a5)[_0x2bc9('0x28')](function(_0x330816){_0x51f238[_0x2bc9('0x21')]=_0x330816;if(_0x56c005[_0x2bc9('0x37')]['includeAll']){_0x500ae2[_0x2bc9('0x48')]=[{'all':!![]}];}return db[_0x2bc9('0x31')][_0x2bc9('0x49')](_0x500ae2);})[_0x2bc9('0x28')](function(_0x504163){_0x51f238[_0x2bc9('0x4a')]=_0x504163;return _0x51f238;})['then'](respondWithFilteredResult(_0xa6a648,_0x500ae2))[_0x2bc9('0x4b')](handleError(_0xa6a648,null));};exports['show']=function(_0x3ceab2,_0x1297cc){var _0x5d8e86={'raw':![],'where':{'id':_0x3ceab2['params']['id']}},_0x59deef={};_0x59deef[_0x2bc9('0x36')]=_['keys'](db[_0x2bc9('0x31')][_0x2bc9('0x32')]);_0x59deef['query']=_[_0x2bc9('0x38')](_0x3ceab2[_0x2bc9('0x37')]);_0x59deef[_0x2bc9('0x39')]=_[_0x2bc9('0x3a')](_0x59deef[_0x2bc9('0x36')],_0x59deef['query']);_0x5d8e86[_0x2bc9('0x3b')]=_[_0x2bc9('0x3a')](_0x59deef[_0x2bc9('0x36')],qs['fields'](_0x3ceab2['query']['fields']));_0x5d8e86[_0x2bc9('0x3b')]=_0x5d8e86['attributes']['length']?_0x5d8e86[_0x2bc9('0x3b')]:_0x59deef[_0x2bc9('0x36')];if(_0x3ceab2[_0x2bc9('0x37')]['includeAll']){_0x5d8e86['include']=[{'all':!![]}];}_0x5d8e86=_['merge']({},_0x5d8e86,_0x3ceab2[_0x2bc9('0x47')]);return db['JscriptyProject'][_0x2bc9('0x4c')](_0x5d8e86)[_0x2bc9('0x28')](handleEntityNotFound(_0x1297cc,null))['then'](respondWithResult(_0x1297cc,null))[_0x2bc9('0x4b')](handleError(_0x1297cc,null));};exports[_0x2bc9('0x4d')]=function(_0x11ec61,_0x55b343){return db['JscriptyProject'][_0x2bc9('0x4d')](_0x11ec61[_0x2bc9('0x4e')],{})[_0x2bc9('0x28')](function(_0x3ffedc){var _0x4f9d8b=_0x11ec61[_0x2bc9('0x4f')][_0x2bc9('0x50')]({'plain':!![]});if(!_0x4f9d8b)throw new Error(_0x2bc9('0x51'));if(_0x4f9d8b[_0x2bc9('0x52')]===_0x2bc9('0x4f')){var _0x379320=_0x3ffedc[_0x2bc9('0x50')]({'plain':!![]});var _0xfab269=_0x2bc9('0x2a');return db[_0x2bc9('0x53')][_0x2bc9('0x4c')]({'where':{'name':_0xfab269,'userProfileId':_0x4f9d8b[_0x2bc9('0x54')]},'raw':!![]})[_0x2bc9('0x28')](function(_0x5abab5){if(_0x5abab5&&_0x5abab5[_0x2bc9('0x55')]===0x0){return db[_0x2bc9('0x56')][_0x2bc9('0x4d')]({'name':_0x379320[_0x2bc9('0x2d')],'resourceId':_0x379320['id'],'type':_0x5abab5[_0x2bc9('0x2d')],'sectionId':_0x5abab5['id']},{})['then'](function(){return _0x3ffedc;});}else{return _0x3ffedc;}})[_0x2bc9('0x4b')](function(_0x3ebf72){logger[_0x2bc9('0x2b')](_0x2bc9('0x57'),_0x3ebf72);throw _0x3ebf72;});}return _0x3ffedc;})[_0x2bc9('0x28')](respondWithResult(_0x55b343,0xc9))[_0x2bc9('0x4b')](handleError(_0x55b343,null));};exports[_0x2bc9('0x58')]=function(_0x4fd4bb,_0x1ab910){var _0x3f1250={'where':{'id':_0x4fd4bb[_0x2bc9('0x59')]['id']}},_0x1407e6={};_0x1407e6[_0x2bc9('0x36')]=_[_0x2bc9('0x38')](db[_0x2bc9('0x31')][_0x2bc9('0x32')]);_0x3f1250[_0x2bc9('0x3b')]=_['intersection'](_0x1407e6[_0x2bc9('0x36')],qs[_0x2bc9('0x3c')](_0x4fd4bb[_0x2bc9('0x37')]['fields']));_0x3f1250[_0x2bc9('0x3b')]=_0x3f1250['attributes'][_0x2bc9('0x3d')]?_0x3f1250[_0x2bc9('0x3b')]:_0x1407e6[_0x2bc9('0x36')];if(_0x4fd4bb['query'][_0x2bc9('0x5a')]){_0x3f1250[_0x2bc9('0x48')]=[{'all':!![]}];}_0x3f1250=_['merge']({},_0x3f1250,_0x4fd4bb[_0x2bc9('0x47')]);return db[_0x2bc9('0x31')]['find'](_0x3f1250)['then'](handleEntityNotFound(_0x1ab910,null))[_0x2bc9('0x28')](function(_0x4a9800){if(_0x4a9800){var _0xb4532b=_0x4a9800[_0x2bc9('0x50')]({'plain':!![]});_0xb4532b=qs[_0x2bc9('0x5b')](_0xb4532b,['id',_0x2bc9('0x5c'),'updatedAt']);_0x4fd4bb[_0x2bc9('0x4e')]=_['omit'](_0x4fd4bb['body'],['id',_0x2bc9('0x5c'),'updatedAt']);return db[_0x2bc9('0x31')][_0x2bc9('0x4d')](_[_0x2bc9('0x45')](_0xb4532b,_0x4fd4bb[_0x2bc9('0x4e')]),{'include':_0x4fd4bb['query']['includeAll']?[{'all':!![]}]:undefined})[_0x2bc9('0x28')](function(_0x19765e){var _0x39948a=_0x4fd4bb[_0x2bc9('0x4f')]['get']({'plain':!![]});if(!_0x39948a)throw new Error(_0x2bc9('0x51'));if(_0x39948a[_0x2bc9('0x52')]===_0x2bc9('0x4f')){var _0x5d86d3=_0x19765e[_0x2bc9('0x50')]({'plain':!![]});var _0x5757cf=_0x2bc9('0x2a');return db[_0x2bc9('0x53')][_0x2bc9('0x4c')]({'where':{'name':_0x5757cf,'userProfileId':_0x39948a[_0x2bc9('0x54')]},'raw':!![]})['then'](function(_0x4a4346){if(_0x4a4346&&_0x4a4346[_0x2bc9('0x55')]===0x0){return db[_0x2bc9('0x56')][_0x2bc9('0x4d')]({'name':_0x5d86d3['name'],'resourceId':_0x5d86d3['id'],'type':_0x4a4346['name'],'sectionId':_0x4a4346['id']},{})[_0x2bc9('0x28')](function(){return _0x19765e;});}else{return _0x19765e;}})[_0x2bc9('0x4b')](function(_0x1d8e83){logger[_0x2bc9('0x2b')](_0x2bc9('0x57'),_0x1d8e83);throw _0x1d8e83;});}return _0x19765e;});}})[_0x2bc9('0x28')](respondWithResult(_0x1ab910,0xc9))[_0x2bc9('0x4b')](handleError(_0x1ab910,null));};exports[_0x2bc9('0x27')]=function(_0x3993e9,_0x9de598){if(_0x3993e9[_0x2bc9('0x4e')]['id']){delete _0x3993e9[_0x2bc9('0x4e')]['id'];}return db[_0x2bc9('0x31')][_0x2bc9('0x4c')]({'where':{'id':_0x3993e9[_0x2bc9('0x59')]['id']}})[_0x2bc9('0x28')](handleEntityNotFound(_0x9de598,null))[_0x2bc9('0x28')](saveUpdates(_0x3993e9['body'],null))[_0x2bc9('0x28')](respondWithResult(_0x9de598,null))['catch'](handleError(_0x9de598,null));};exports[_0x2bc9('0x29')]=function(_0x4d5da5,_0x466f5a){return db[_0x2bc9('0x31')][_0x2bc9('0x4c')]({'where':{'id':_0x4d5da5['params']['id']}})[_0x2bc9('0x28')](handleEntityNotFound(_0x466f5a,null))['then'](removeEntity(_0x466f5a,null))[_0x2bc9('0x4b')](handleError(_0x466f5a,null));};exports[_0x2bc9('0x5d')]=function(_0x4a75ef,_0x4cc7c8,_0x495c45){var _0x49301a={'raw':!![],'where':{}};var _0x538a82={};var _0x40ce3e={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x4a75ef['params']['id']}})[_0x2bc9('0x28')](handleEntityNotFound(_0x4cc7c8,null))[_0x2bc9('0x28')](function(_0x4cf6d4){if(_0x4cf6d4){_0x538a82[_0x2bc9('0x36')]=_[_0x2bc9('0x38')](db[_0x2bc9('0x5e')][_0x2bc9('0x32')]);_0x538a82[_0x2bc9('0x37')]=_[_0x2bc9('0x38')](_0x4a75ef[_0x2bc9('0x37')]);_0x538a82[_0x2bc9('0x39')]=_[_0x2bc9('0x3a')](_0x538a82[_0x2bc9('0x36')],_0x538a82[_0x2bc9('0x37')]);_0x49301a[_0x2bc9('0x3b')]=_[_0x2bc9('0x3a')](_0x538a82['model'],qs[_0x2bc9('0x3c')](_0x4a75ef['query'][_0x2bc9('0x3c')]));_0x49301a[_0x2bc9('0x3b')]=_0x49301a[_0x2bc9('0x3b')][_0x2bc9('0x3d')]?_0x49301a[_0x2bc9('0x3b')]:_0x538a82['model'];if(!_0x4a75ef['query'][_0x2bc9('0x3e')]('nolimit')){_0x49301a['limit']=qs[_0x2bc9('0x22')](_0x4a75ef[_0x2bc9('0x37')][_0x2bc9('0x22')]);_0x49301a[_0x2bc9('0x20')]=qs[_0x2bc9('0x20')](_0x4a75ef[_0x2bc9('0x37')][_0x2bc9('0x20')]);}_0x49301a[_0x2bc9('0x40')]=qs[_0x2bc9('0x41')](_0x4a75ef[_0x2bc9('0x37')]['sort']);_0x49301a[_0x2bc9('0x42')]=qs[_0x2bc9('0x39')](_[_0x2bc9('0x43')](_0x4a75ef[_0x2bc9('0x37')],_0x538a82['filters']));_0x49301a[_0x2bc9('0x42')][_0x2bc9('0x5f')]=_0x4cf6d4['id'];if(_0x4a75ef[_0x2bc9('0x37')][_0x2bc9('0x44')]){_0x49301a['where']=_['merge'](_0x49301a[_0x2bc9('0x42')],{'$or':_[_0x2bc9('0x30')](_0x49301a['attributes'],function(_0x59de44){var _0x3c61da={};_0x3c61da[_0x59de44]={'$like':'%'+_0x4a75ef[_0x2bc9('0x37')][_0x2bc9('0x44')]+'%'};return _0x3c61da;})});}_0x49301a=_[_0x2bc9('0x45')]({},_0x49301a,_0x4a75ef[_0x2bc9('0x47')]);return db['JscriptySessionReport'][_0x2bc9('0x21')]({'where':_0x49301a[_0x2bc9('0x42')]})[_0x2bc9('0x28')](function(_0x45eba0){_0x40ce3e[_0x2bc9('0x21')]=_0x45eba0;if(_0x4a75ef[_0x2bc9('0x37')][_0x2bc9('0x5a')]){_0x49301a[_0x2bc9('0x48')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x49301a);})['then'](function(_0x54e60d){_0x40ce3e['rows']=_0x54e60d;return _0x40ce3e;});}})[_0x2bc9('0x28')](respondWithFilteredResult(_0x4cc7c8,_0x49301a))[_0x2bc9('0x4b')](handleError(_0x4cc7c8,null));};exports[_0x2bc9('0x60')]=function(_0x30fc3d,_0x56bc0a,_0x4a4664){var _0x364857={'raw':!![],'where':{}};var _0x546a02={};var _0x5c8775={'count':0x0,'rows':[]};return db[_0x2bc9('0x31')]['findOne']({'where':{'id':_0x30fc3d['params']['id']}})[_0x2bc9('0x28')](handleEntityNotFound(_0x56bc0a,null))[_0x2bc9('0x28')](function(_0x47cf89){if(_0x47cf89){_0x546a02[_0x2bc9('0x36')]=_[_0x2bc9('0x38')](db[_0x2bc9('0x61')]['rawAttributes']);_0x546a02[_0x2bc9('0x37')]=_[_0x2bc9('0x38')](_0x30fc3d[_0x2bc9('0x37')]);_0x546a02[_0x2bc9('0x39')]=_[_0x2bc9('0x3a')](_0x546a02['model'],_0x546a02[_0x2bc9('0x37')]);_0x364857[_0x2bc9('0x3b')]=_[_0x2bc9('0x3a')](_0x546a02[_0x2bc9('0x36')],qs[_0x2bc9('0x3c')](_0x30fc3d['query'][_0x2bc9('0x3c')]));_0x364857['attributes']=_0x364857[_0x2bc9('0x3b')][_0x2bc9('0x3d')]?_0x364857[_0x2bc9('0x3b')]:_0x546a02[_0x2bc9('0x36')];if(!_0x30fc3d[_0x2bc9('0x37')][_0x2bc9('0x3e')](_0x2bc9('0x3f'))){_0x364857[_0x2bc9('0x22')]=qs[_0x2bc9('0x22')](_0x30fc3d[_0x2bc9('0x37')]['limit']);_0x364857['offset']=qs[_0x2bc9('0x20')](_0x30fc3d[_0x2bc9('0x37')][_0x2bc9('0x20')]);}_0x364857[_0x2bc9('0x40')]=qs[_0x2bc9('0x41')](_0x30fc3d['query'][_0x2bc9('0x41')]);_0x364857[_0x2bc9('0x42')]=qs['filters'](_[_0x2bc9('0x43')](_0x30fc3d[_0x2bc9('0x37')],_0x546a02[_0x2bc9('0x39')]));_0x364857[_0x2bc9('0x42')][_0x2bc9('0x5f')]=_0x47cf89['id'];if(_0x30fc3d[_0x2bc9('0x37')][_0x2bc9('0x44')]){_0x364857[_0x2bc9('0x42')]=_[_0x2bc9('0x45')](_0x364857[_0x2bc9('0x42')],{'$or':_['map'](_0x364857[_0x2bc9('0x3b')],function(_0x367ef3){var _0x54f3bd={};_0x54f3bd[_0x367ef3]={'$like':'%'+_0x30fc3d['query'][_0x2bc9('0x44')]+'%'};return _0x54f3bd;})});}_0x364857=_[_0x2bc9('0x45')]({},_0x364857,_0x30fc3d[_0x2bc9('0x47')]);return db[_0x2bc9('0x61')][_0x2bc9('0x21')]({'where':_0x364857[_0x2bc9('0x42')]})[_0x2bc9('0x28')](function(_0x1ee4d2){_0x5c8775[_0x2bc9('0x21')]=_0x1ee4d2;if(_0x30fc3d['query'][_0x2bc9('0x5a')]){_0x364857['include']=[{'all':!![]}];}return db[_0x2bc9('0x61')][_0x2bc9('0x49')](_0x364857);})['then'](function(_0x4eab2c){_0x5c8775[_0x2bc9('0x4a')]=_0x4eab2c;return _0x5c8775;});}})[_0x2bc9('0x28')](respondWithFilteredResult(_0x56bc0a,_0x364857))[_0x2bc9('0x4b')](handleError(_0x56bc0a,null));};function char(_0x9472fb){return'number'===typeof _0x9472fb?String[_0x2bc9('0x62')]['apply'](null,arguments):_0x9472fb;}function needsEncapsulation(_0x58e90a){return!!_0x58e90a&&(_0x58e90a['toString']()[_0x2bc9('0x63')](char(0xd))>=0x0||_0x58e90a[_0x2bc9('0x64')]()[_0x2bc9('0x63')](char(0xa))>=0x0||_0x58e90a[_0x2bc9('0x64')]()[_0x2bc9('0x63')](char(0x2c))>=0x0||_0x58e90a[_0x2bc9('0x64')]()[_0x2bc9('0x63')](char(0x22))>=0x0);}function encapsulate(_0x12e16b){var _0x543b94=char(0x22),_0x87afb7='\x5c'+char(0x22),_0x2210da=_0x12e16b[_0x2bc9('0x64')]()[_0x2bc9('0x65')](new RegExp(_0x543b94,'g'),_0x87afb7);return _0x543b94+_0x2210da+_0x543b94;}exports[_0x2bc9('0x66')]=function(_0x127fdf,_0x2f52c7,_0x17edb0){var _0x4abd98,_0x23dacc;var _0x280e3a={'where':{'ProjectId':_0x127fdf['params']['id']}};if(_0x127fdf['query'][_0x2bc9('0x67')]){_0x280e3a[_0x2bc9('0x42')][_0x2bc9('0x68')]=JSON[_0x2bc9('0x69')](_0x127fdf[_0x2bc9('0x37')][_0x2bc9('0x67')]);}return db[_0x2bc9('0x5e')][_0x2bc9('0x49')](_0x280e3a)[_0x2bc9('0x28')](handleEntityNotFound(_0x2f52c7,null))[_0x2bc9('0x28')](function(_0x27b001){if(_0x27b001){_0x4abd98=_0x27b001;return db[_0x2bc9('0x6a')]['findAll']({'where':{'SessionId':{'$in':_[_0x2bc9('0x30')](_0x4abd98,'id')},'ProjectId':_0x127fdf['params']['id']},'order':'-createdAt'});}})[_0x2bc9('0x28')](handleEntityNotFound(_0x2f52c7,null))[_0x2bc9('0x28')](function(_0x32c856){if(_0x32c856){_0x23dacc=_0x32c856;var _0xbb5446={};for(var _0x22fe19=0x0,_0x451678=_0x23dacc[_0x2bc9('0x3d')];_0x22fe19<_0x451678;_0x22fe19++){if(!_0xbb5446[_0x2bc9('0x3e')](_0x23dacc[_0x22fe19][_0x2bc9('0x6b')])){_0xbb5446[_0x23dacc[_0x22fe19]['questionId']]=needsEncapsulation(_0x23dacc[_0x22fe19]['question'])?encapsulate(_0x23dacc[_0x22fe19][_0x2bc9('0x6c')]):_0x23dacc[_0x22fe19]['question'];}}var _0x5e0024=[],_0x17f008={};for(var _0xc2119c=0x0,_0x16bdfe=_0x4abd98[_0x2bc9('0x3d')];_0xc2119c<_0x16bdfe;_0xc2119c++){_0x17f008={'ProjectId':_0x127fdf['params']['id'],'SessionId':_0x4abd98[_0xc2119c]['id'],'StartTime':moment(_0x4abd98[_0xc2119c]['starttime'])[_0x2bc9('0x6d')](_0x2bc9('0x6e'))};for(var _0x2e4ee3=0x0,_0x70d3d0=_0x23dacc[_0x2bc9('0x3d')];_0x2e4ee3<_0x70d3d0;_0x2e4ee3++){if(_0x23dacc[_0x2e4ee3][_0x2bc9('0x6f')]==_0x4abd98[_0xc2119c]['id']&&_0xbb5446[_0x2bc9('0x3e')](_0x23dacc[_0x2e4ee3][_0x2bc9('0x6b')])){_0x17f008[_0xbb5446[_0x23dacc[_0x2e4ee3][_0x2bc9('0x6b')]]]=_0x23dacc[_0x2e4ee3]['answer'];}}for(var _0x5db4a8 in _0xbb5446){if(!_0x17f008[_0x2bc9('0x3e')](_0xbb5446[_0x5db4a8])){_0x17f008[_0xbb5446[_0x5db4a8]]=null;}}_0x5e0024['push'](_0x17f008);}return _0x5e0024;}})[_0x2bc9('0x28')](function(_0x57d138){if(!_[_0x2bc9('0x70')](_0x57d138)){var _0x202c26=toCsv(_0x57d138);var _0x14e630=Date[_0x2bc9('0x71')]();fs['writeFileSync'](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x127fdf[_0x2bc9('0x59')]['id'],_0x14e630),_0x202c26);_0x2f52c7[_0x2bc9('0x72')](_0x2bc9('0x73'),_0x2bc9('0x74')+util[_0x2bc9('0x6d')](_0x2bc9('0x75'),_0x127fdf['params']['id'],_0x14e630));_0x2f52c7[_0x2bc9('0x72')]('Content-type',_0x2bc9('0x76'));return _0x2f52c7[_0x2bc9('0x77')](util[_0x2bc9('0x6d')](_0x2bc9('0x78'),_0x127fdf[_0x2bc9('0x59')]['id'],_0x14e630));}else{return _0x2f52c7[_0x2bc9('0x1b')](0xcc);}})[_0x2bc9('0x4b')](handleError(_0x2f52c7,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 9dee882..ea633e8 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 _0x7dee=['lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','JscriptyProject','jscripty_projects'];(function(_0x5ad0b6,_0x371db8){var _0x5318ad=function(_0x2d9d3e){while(--_0x2d9d3e){_0x5ad0b6['push'](_0x5ad0b6['shift']());}};_0x5318ad(++_0x371db8);}(_0x7dee,0xb0));var _0xe7de=function(_0x1bfe7f,_0x5ae964){_0x1bfe7f=_0x1bfe7f-0x0;var _0x209789=_0x7dee[_0x1bfe7f];return _0x209789;};'use strict';var _=require(_0xe7de('0x0'));var util=require('util');var logger=require(_0xe7de('0x1'))('api');var moment=require(_0xe7de('0x2'));var BPromise=require(_0xe7de('0x3'));var rp=require(_0xe7de('0x4'));var fs=require('fs');var path=require(_0xe7de('0x5'));var rimraf=require('rimraf');var config=require(_0xe7de('0x6'));var attributes=require('./jscriptyProject.attributes');module[_0xe7de('0x7')]=function(_0x19f79d,_0x26a524){return _0x19f79d[_0xe7de('0x8')](_0xe7de('0x9'),attributes,{'tableName':_0xe7de('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2cd3=['jscripty_projects','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./jscriptyProject.attributes','exports','define','JscriptyProject'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2cd3,0xf1));var _0x32cd=function(_0x42c118,_0x197006){_0x42c118=_0x42c118-0x0;var _0x112ebd=_0x2cd3[_0x42c118];return _0x112ebd;};'use strict';var _=require(_0x32cd('0x0'));var util=require('util');var logger=require(_0x32cd('0x1'))(_0x32cd('0x2'));var moment=require(_0x32cd('0x3'));var BPromise=require(_0x32cd('0x4'));var rp=require(_0x32cd('0x5'));var fs=require('fs');var path=require(_0x32cd('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x32cd('0x7'));module[_0x32cd('0x8')]=function(_0x1af8c8,_0x1024e0){return _0x1af8c8[_0x32cd('0x9')](_0x32cd('0xa'),attributes,{'tableName':_0x32cd('0xb'),'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 2ba6ddf..f5b841c 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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac4a,0x13f));var _0xaac4=function(_0x4a0ca0,_0x30ac58){_0x4a0ca0=_0x4a0ca0-0x0;var _0x48a6b7=_0xac4a[_0x4a0ca0];return _0x48a6b7;};'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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x50c11e,_0x5e233e){var _0xfaa6ab=function(_0x22b3c3){while(--_0x22b3c3){_0x50c11e['push'](_0x50c11e['shift']());}};_0xfaa6ab(++_0x5e233e);}(_0xb43b,0x1b2));var _0xbb43=function(_0xd83a51,_0x141a7b){_0xd83a51=_0xd83a51-0x0;var _0x1d5184=_0xb43b[_0xd83a51];return _0x1d5184;};'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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\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);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index da76555..c84da8c 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 _0xd919=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','destroy','exports','multer','util','path','connect-timeout'];(function(_0x280674,_0x5bc909){var _0x485af9=function(_0x183258){while(--_0x183258){_0x280674['push'](_0x280674['shift']());}};_0x485af9(++_0x5bc909);}(_0xd919,0x13c));var _0x9d91=function(_0x282e9c,_0x1b4c5a){_0x282e9c=_0x282e9c-0x0;var _0x5b97e4=_0xd919[_0x282e9c];return _0x5b97e4;};'use strict';var multer=require(_0x9d91('0x0'));var util=require(_0x9d91('0x1'));var path=require(_0x9d91('0x2'));var timeout=require(_0x9d91('0x3'));var express=require(_0x9d91('0x4'));var router=express[_0x9d91('0x5')]();var fs_extra=require(_0x9d91('0x6'));var auth=require(_0x9d91('0x7'));var interaction=require(_0x9d91('0x8'));var config=require(_0x9d91('0x9'));var controller=require(_0x9d91('0xa'));router['get']('/',auth[_0x9d91('0xb')](),controller[_0x9d91('0xc')]);router[_0x9d91('0xd')](_0x9d91('0xe'),auth['isAuthenticated'](),controller[_0x9d91('0xf')]);router['get'](_0x9d91('0x10'),auth[_0x9d91('0xb')](),controller[_0x9d91('0x11')]);router['post']('/',auth[_0x9d91('0xb')](),controller['create']);router['put']('/:id',auth[_0x9d91('0xb')](),controller['update']);router['delete'](_0x9d91('0x10'),auth[_0x9d91('0xb')](),controller[_0x9d91('0x12')]);module[_0x9d91('0x13')]=router; \ No newline at end of file +var _0xf23b=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','put','delete','destroy','exports'];(function(_0xef4ff0,_0x1e2014){var _0x87e5cb=function(_0x56259b){while(--_0x56259b){_0xef4ff0['push'](_0xef4ff0['shift']());}};_0x87e5cb(++_0x1e2014);}(_0xf23b,0xe4));var _0xbf23=function(_0x2a0bd4,_0x1f9bd2){_0x2a0bd4=_0x2a0bd4-0x0;var _0x295499=_0xf23b[_0x2a0bd4];return _0x295499;};'use strict';var multer=require('multer');var util=require(_0xbf23('0x0'));var path=require(_0xbf23('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf23('0x2')]();var fs_extra=require(_0xbf23('0x3'));var auth=require(_0xbf23('0x4'));var interaction=require(_0xbf23('0x5'));var config=require(_0xbf23('0x6'));var controller=require(_0xbf23('0x7'));router[_0xbf23('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xbf23('0x9'),auth[_0xbf23('0xa')](),controller[_0xbf23('0xb')]);router['get'](_0xbf23('0xc'),auth[_0xbf23('0xa')](),controller[_0xbf23('0xd')]);router[_0xbf23('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbf23('0xf')]('/:id',auth[_0xbf23('0xa')](),controller['update']);router[_0xbf23('0x10')](_0xbf23('0xc'),auth[_0xbf23('0xa')](),controller[_0xbf23('0x11')]);module[_0xbf23('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index e612176..a87dd90 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(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x7a54,0x106));var _0x47a5=function(_0x496d5b,_0x2cebb7){_0x496d5b=_0x496d5b-0x0;var _0x272556=_0x7a54[_0x496d5b];return _0x272556;};'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(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x7a54,0x106));var _0x47a5=function(_0x4dd00b,_0x11c1b8){_0x4dd00b=_0x4dd00b-0x0;var _0x26fdc8=_0x7a54[_0x4dd00b];return _0x26fdc8;};'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 8aaf71e..6a5eae1 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 _0xe1db=['index','JscriptyQuestionReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name'];(function(_0x2ee687,_0x4371d9){var _0x41bc4d=function(_0x602375){while(--_0x602375){_0x2ee687['push'](_0x2ee687['shift']());}};_0x41bc4d(++_0x4371d9);}(_0xe1db,0x106));var _0xbe1d=function(_0x790869,_0x599d42){_0x790869=_0x790869-0x0;var _0x37e8bd=_0xe1db[_0x790869];return _0x37e8bd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbe1d('0x0'));var zipdir=require(_0xbe1d('0x1'));var jsonpatch=require(_0xbe1d('0x2'));var rp=require(_0xbe1d('0x3'));var moment=require('moment');var BPromise=require(_0xbe1d('0x4'));var Mustache=require(_0xbe1d('0x5'));var util=require(_0xbe1d('0x6'));var path=require(_0xbe1d('0x7'));var sox=require(_0xbe1d('0x8'));var csv=require(_0xbe1d('0x9'));var ejs=require(_0xbe1d('0xa'));var fs=require('fs');var fs_extra=require(_0xbe1d('0xb'));var _=require(_0xbe1d('0xc'));var squel=require(_0xbe1d('0xd'));var crypto=require(_0xbe1d('0xe'));var jsforce=require(_0xbe1d('0xf'));var deskjs=require(_0xbe1d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbe1d('0x11'));var Papa=require('papaparse');var Redis=require(_0xbe1d('0x12'));var authService=require(_0xbe1d('0x13'));var qs=require(_0xbe1d('0x14'));var as=require(_0xbe1d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xbe1d('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbe1d('0x17'))['db'];function respondWithStatusCode(_0x435572,_0x4785d0){_0x4785d0=_0x4785d0||0xcc;return function(_0x4fed5a){if(_0x4fed5a){return _0x435572[_0xbe1d('0x18')](_0x4785d0);}return _0x435572[_0xbe1d('0x19')](_0x4785d0)[_0xbe1d('0x1a')]();};}function respondWithResult(_0xbc2abc,_0xd22aa0){_0xd22aa0=_0xd22aa0||0xc8;return function(_0x36f948){if(_0x36f948){return _0xbc2abc[_0xbe1d('0x19')](_0xd22aa0)['json'](_0x36f948);}};}function respondWithFilteredResult(_0x1de3db,_0x2a5ca1){return function(_0xdf594){if(_0xdf594){var _0x5bdb66=typeof _0x2a5ca1[_0xbe1d('0x1b')]===_0xbe1d('0x1c')&&typeof _0x2a5ca1[_0xbe1d('0x1d')]===_0xbe1d('0x1c');var _0x5bad9a=_0xdf594[_0xbe1d('0x1e')];var _0x3c6227=_0x5bdb66?0x0:_0x2a5ca1[_0xbe1d('0x1b')];var _0x8f01b3=_0x5bdb66?_0xdf594[_0xbe1d('0x1e')]:_0x2a5ca1[_0xbe1d('0x1b')]+_0x2a5ca1['limit'];var _0x5c8b54;if(_0x8f01b3>=_0x5bad9a){_0x8f01b3=_0x5bad9a;_0x5c8b54=0xc8;}else{_0x5c8b54=0xce;}_0x1de3db['status'](_0x5c8b54);return _0x1de3db[_0xbe1d('0x1f')](_0xbe1d('0x20'),_0x3c6227+'-'+_0x8f01b3+'/'+_0x5bad9a)[_0xbe1d('0x21')](_0xdf594);}return null;};}function patchUpdates(_0x561736){return function(_0x389ff8){try{jsonpatch[_0xbe1d('0x22')](_0x389ff8,_0x561736,!![]);}catch(_0x3fd287){return BPromise[_0xbe1d('0x23')](_0x3fd287);}return _0x389ff8[_0xbe1d('0x24')]();};}function saveUpdates(_0x347e86,_0x139aa3){return function(_0xdb812f){if(_0xdb812f){return _0xdb812f[_0xbe1d('0x25')](_0x347e86)[_0xbe1d('0x26')](function(_0x1f323b){return _0x1f323b;});}return null;};}function removeEntity(_0x162427,_0x1b738f){return function(_0x459e2e){if(_0x459e2e){return _0x459e2e[_0xbe1d('0x27')]()[_0xbe1d('0x26')](function(){_0x162427[_0xbe1d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e548d,_0x2c3b59){return function(_0x3faed7){if(!_0x3faed7){_0x4e548d[_0xbe1d('0x18')](0x194);}return _0x3faed7;};}function handleError(_0x653e58,_0x2f70c7){_0x2f70c7=_0x2f70c7||0x1f4;return function(_0xff4a63){logger[_0xbe1d('0x28')](_0xff4a63['stack']);if(_0xff4a63['name']){delete _0xff4a63[_0xbe1d('0x29')];}_0x653e58[_0xbe1d('0x19')](_0x2f70c7)['send'](_0xff4a63);};}exports[_0xbe1d('0x2a')]=function(_0x1f7fd2,_0x58b113){var _0x17daf0={},_0x5b006c={},_0x1a2549={'count':0x0,'rows':[]};var _0x3b0af4=_['map'](db[_0xbe1d('0x2b')]['rawAttributes'],function(_0xec7e0b){return{'name':_0xec7e0b[_0xbe1d('0x2c')],'type':_0xec7e0b[_0xbe1d('0x2d')][_0xbe1d('0x2e')]};});_0x5b006c[_0xbe1d('0x2f')]=_[_0xbe1d('0x30')](_0x3b0af4,_0xbe1d('0x29'));_0x5b006c[_0xbe1d('0x31')]=_[_0xbe1d('0x32')](_0x1f7fd2[_0xbe1d('0x31')]);_0x5b006c[_0xbe1d('0x33')]=_[_0xbe1d('0x34')](_0x5b006c[_0xbe1d('0x2f')],_0x5b006c[_0xbe1d('0x31')]);_0x17daf0[_0xbe1d('0x35')]=_['intersection'](_0x5b006c['model'],qs[_0xbe1d('0x36')](_0x1f7fd2['query']['fields']));_0x17daf0[_0xbe1d('0x35')]=_0x17daf0[_0xbe1d('0x35')][_0xbe1d('0x37')]?_0x17daf0[_0xbe1d('0x35')]:_0x5b006c['model'];if(!_0x1f7fd2['query'][_0xbe1d('0x38')](_0xbe1d('0x39'))){_0x17daf0[_0xbe1d('0x1d')]=qs['limit'](_0x1f7fd2[_0xbe1d('0x31')][_0xbe1d('0x1d')]);_0x17daf0[_0xbe1d('0x1b')]=qs[_0xbe1d('0x1b')](_0x1f7fd2['query'][_0xbe1d('0x1b')]);}_0x17daf0[_0xbe1d('0x3a')]=qs[_0xbe1d('0x3b')](_0x1f7fd2[_0xbe1d('0x31')][_0xbe1d('0x3b')]);_0x17daf0[_0xbe1d('0x3c')]=qs[_0xbe1d('0x33')](_['pick'](_0x1f7fd2[_0xbe1d('0x31')],_0x5b006c[_0xbe1d('0x33')]),_0x3b0af4);if(_0x1f7fd2[_0xbe1d('0x31')]['filter']){_0x17daf0[_0xbe1d('0x3c')]=_['merge'](_0x17daf0['where'],{'$or':_[_0xbe1d('0x30')](_0x3b0af4,function(_0x3a587d){if(_0x3a587d['type']!==_0xbe1d('0x3d')){var _0x48a874={};_0x48a874[_0x3a587d[_0xbe1d('0x29')]]={'$like':'%'+_0x1f7fd2['query']['filter']+'%'};return _0x48a874;}})});}_0x17daf0=_['merge']({},_0x17daf0,_0x1f7fd2[_0xbe1d('0x3e')]);var _0x122665={'where':_0x17daf0[_0xbe1d('0x3c')]};return db[_0xbe1d('0x2b')][_0xbe1d('0x1e')](_0x122665)[_0xbe1d('0x26')](function(_0x413e7b){_0x1a2549['count']=_0x413e7b;if(_0x1f7fd2[_0xbe1d('0x31')][_0xbe1d('0x3f')]){_0x17daf0[_0xbe1d('0x40')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xbe1d('0x41')](_0x17daf0);})[_0xbe1d('0x26')](function(_0x27715e){_0x1a2549[_0xbe1d('0x42')]=_0x27715e;return _0x1a2549;})[_0xbe1d('0x26')](respondWithFilteredResult(_0x58b113,_0x17daf0))[_0xbe1d('0x43')](handleError(_0x58b113,null));};exports[_0xbe1d('0x44')]=function(_0x3928fd,_0x1b17ec){var _0x5cdcca={'raw':!![],'where':{'id':_0x3928fd[_0xbe1d('0x45')]['id']}},_0x13b040={};_0x13b040[_0xbe1d('0x2f')]=_[_0xbe1d('0x32')](db[_0xbe1d('0x2b')][_0xbe1d('0x46')]);_0x13b040['query']=_['keys'](_0x3928fd[_0xbe1d('0x31')]);_0x13b040[_0xbe1d('0x33')]=_[_0xbe1d('0x34')](_0x13b040['model'],_0x13b040[_0xbe1d('0x31')]);_0x5cdcca[_0xbe1d('0x35')]=_[_0xbe1d('0x34')](_0x13b040[_0xbe1d('0x2f')],qs['fields'](_0x3928fd[_0xbe1d('0x31')]['fields']));_0x5cdcca['attributes']=_0x5cdcca[_0xbe1d('0x35')][_0xbe1d('0x37')]?_0x5cdcca['attributes']:_0x13b040[_0xbe1d('0x2f')];if(_0x3928fd[_0xbe1d('0x31')][_0xbe1d('0x3f')]){_0x5cdcca[_0xbe1d('0x40')]=[{'all':!![]}];}_0x5cdcca=_[_0xbe1d('0x47')]({},_0x5cdcca,_0x3928fd[_0xbe1d('0x3e')]);return db[_0xbe1d('0x2b')]['find'](_0x5cdcca)['then'](handleEntityNotFound(_0x1b17ec,null))[_0xbe1d('0x26')](respondWithResult(_0x1b17ec,null))['catch'](handleError(_0x1b17ec,null));};exports[_0xbe1d('0x48')]=function(_0x3b7669,_0x19e538){return db['JscriptyQuestionReport'][_0xbe1d('0x48')](_0x3b7669['body'],{})[_0xbe1d('0x26')](respondWithResult(_0x19e538,0xc9))['catch'](handleError(_0x19e538,null));};exports[_0xbe1d('0x25')]=function(_0x409c02,_0xb0aee2){if(_0x409c02['body']['id']){delete _0x409c02[_0xbe1d('0x49')]['id'];}return db[_0xbe1d('0x2b')][_0xbe1d('0x4a')]({'where':{'id':_0x409c02['params']['id']}})['then'](handleEntityNotFound(_0xb0aee2,null))['then'](saveUpdates(_0x409c02[_0xbe1d('0x49')],null))['then'](respondWithResult(_0xb0aee2,null))[_0xbe1d('0x43')](handleError(_0xb0aee2,null));};exports['destroy']=function(_0x14e2ec,_0xcacdea){return db[_0xbe1d('0x2b')][_0xbe1d('0x4a')]({'where':{'id':_0x14e2ec[_0xbe1d('0x45')]['id']}})[_0xbe1d('0x26')](handleEntityNotFound(_0xcacdea,null))[_0xbe1d('0x26')](removeEntity(_0xcacdea,null))['catch'](handleError(_0xcacdea,null));};exports[_0xbe1d('0x4b')]=function(_0x4f170f,_0x1beb58){return db[_0xbe1d('0x2b')][_0xbe1d('0x4b')]()[_0xbe1d('0x26')](respondWithResult(_0x1beb58,null))[_0xbe1d('0x43')](handleError(_0x1beb58,null));}; \ No newline at end of file +var _0x3c6e=['to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','end','status','undefined','limit','offset','count','set','Content-Range','json','update','then','destroy','sendStatus','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','merge','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox'];(function(_0x2a0b90,_0x3cd40a){var _0x59011b=function(_0x382949){while(--_0x382949){_0x2a0b90['push'](_0x2a0b90['shift']());}};_0x59011b(++_0x3cd40a);}(_0x3c6e,0x16f));var _0xe3c6=function(_0x2d9eae,_0x1fe7ef){_0x2d9eae=_0x2d9eae-0x0;var _0x33bb54=_0x3c6e[_0x2d9eae];return _0x33bb54;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe3c6('0x0'));var zipdir=require(_0xe3c6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe3c6('0x2'));var moment=require(_0xe3c6('0x3'));var BPromise=require(_0xe3c6('0x4'));var Mustache=require('mustache');var util=require(_0xe3c6('0x5'));var path=require(_0xe3c6('0x6'));var sox=require(_0xe3c6('0x7'));var csv=require(_0xe3c6('0x8'));var ejs=require(_0xe3c6('0x9'));var fs=require('fs');var fs_extra=require(_0xe3c6('0xa'));var _=require(_0xe3c6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe3c6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe3c6('0xd'));var Papa=require(_0xe3c6('0xe'));var Redis=require(_0xe3c6('0xf'));var authService=require(_0xe3c6('0x10'));var qs=require(_0xe3c6('0x11'));var as=require(_0xe3c6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe3c6('0x13'))('api');var utils=require(_0xe3c6('0x14'));var config=require(_0xe3c6('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47055a,_0x2b6f9d){_0x2b6f9d=_0x2b6f9d||0xcc;return function(_0x3b201a){if(_0x3b201a){return _0x47055a['sendStatus'](_0x2b6f9d);}return _0x47055a['status'](_0x2b6f9d)[_0xe3c6('0x16')]();};}function respondWithResult(_0x5da92c,_0x3eb30d){_0x3eb30d=_0x3eb30d||0xc8;return function(_0x41d9a7){if(_0x41d9a7){return _0x5da92c[_0xe3c6('0x17')](_0x3eb30d)['json'](_0x41d9a7);}};}function respondWithFilteredResult(_0x43da66,_0x51cd25){return function(_0x38e5c4){if(_0x38e5c4){var _0xf34953=typeof _0x51cd25['offset']===_0xe3c6('0x18')&&typeof _0x51cd25[_0xe3c6('0x19')]===_0xe3c6('0x18');var _0x59cf82=_0x38e5c4['count'];var _0x21f113=_0xf34953?0x0:_0x51cd25[_0xe3c6('0x1a')];var _0x1022b5=_0xf34953?_0x38e5c4[_0xe3c6('0x1b')]:_0x51cd25[_0xe3c6('0x1a')]+_0x51cd25[_0xe3c6('0x19')];var _0x2955c1;if(_0x1022b5>=_0x59cf82){_0x1022b5=_0x59cf82;_0x2955c1=0xc8;}else{_0x2955c1=0xce;}_0x43da66[_0xe3c6('0x17')](_0x2955c1);return _0x43da66[_0xe3c6('0x1c')](_0xe3c6('0x1d'),_0x21f113+'-'+_0x1022b5+'/'+_0x59cf82)[_0xe3c6('0x1e')](_0x38e5c4);}return null;};}function patchUpdates(_0x2063f1){return function(_0x1ca0b4){try{jsonpatch['apply'](_0x1ca0b4,_0x2063f1,!![]);}catch(_0x20be33){return BPromise['reject'](_0x20be33);}return _0x1ca0b4['save']();};}function saveUpdates(_0x4f9bd0,_0x2105eb){return function(_0x5a5885){if(_0x5a5885){return _0x5a5885[_0xe3c6('0x1f')](_0x4f9bd0)[_0xe3c6('0x20')](function(_0x57fd11){return _0x57fd11;});}return null;};}function removeEntity(_0x35f22e,_0x3d484b){return function(_0x45f106){if(_0x45f106){return _0x45f106[_0xe3c6('0x21')]()[_0xe3c6('0x20')](function(){_0x35f22e[_0xe3c6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c358a,_0x47d932){return function(_0x33ecbf){if(!_0x33ecbf){_0x4c358a[_0xe3c6('0x22')](0x194);}return _0x33ecbf;};}function handleError(_0x4090c6,_0x233aed){_0x233aed=_0x233aed||0x1f4;return function(_0x40c4a3){logger[_0xe3c6('0x23')](_0x40c4a3[_0xe3c6('0x24')]);if(_0x40c4a3[_0xe3c6('0x25')]){delete _0x40c4a3[_0xe3c6('0x25')];}_0x4090c6[_0xe3c6('0x17')](_0x233aed)[_0xe3c6('0x26')](_0x40c4a3);};}exports[_0xe3c6('0x27')]=function(_0x6e8455,_0x37b1f4){var _0x35f7b5={},_0x2b63db={},_0x29e3a6={'count':0x0,'rows':[]};var _0xa2d390=_['map'](db[_0xe3c6('0x28')][_0xe3c6('0x29')],function(_0x3e696a){return{'name':_0x3e696a[_0xe3c6('0x2a')],'type':_0x3e696a[_0xe3c6('0x2b')][_0xe3c6('0x2c')]};});_0x2b63db[_0xe3c6('0x2d')]=_[_0xe3c6('0x2e')](_0xa2d390,_0xe3c6('0x25'));_0x2b63db['query']=_[_0xe3c6('0x2f')](_0x6e8455[_0xe3c6('0x30')]);_0x2b63db[_0xe3c6('0x31')]=_[_0xe3c6('0x32')](_0x2b63db['model'],_0x2b63db[_0xe3c6('0x30')]);_0x35f7b5['attributes']=_[_0xe3c6('0x32')](_0x2b63db['model'],qs[_0xe3c6('0x33')](_0x6e8455['query']['fields']));_0x35f7b5[_0xe3c6('0x34')]=_0x35f7b5[_0xe3c6('0x34')]['length']?_0x35f7b5[_0xe3c6('0x34')]:_0x2b63db[_0xe3c6('0x2d')];if(!_0x6e8455[_0xe3c6('0x30')][_0xe3c6('0x35')](_0xe3c6('0x36'))){_0x35f7b5[_0xe3c6('0x19')]=qs[_0xe3c6('0x19')](_0x6e8455['query'][_0xe3c6('0x19')]);_0x35f7b5[_0xe3c6('0x1a')]=qs[_0xe3c6('0x1a')](_0x6e8455['query']['offset']);}_0x35f7b5[_0xe3c6('0x37')]=qs[_0xe3c6('0x38')](_0x6e8455[_0xe3c6('0x30')][_0xe3c6('0x38')]);_0x35f7b5[_0xe3c6('0x39')]=qs[_0xe3c6('0x31')](_[_0xe3c6('0x3a')](_0x6e8455['query'],_0x2b63db[_0xe3c6('0x31')]),_0xa2d390);if(_0x6e8455['query'][_0xe3c6('0x3b')]){_0x35f7b5[_0xe3c6('0x39')]=_['merge'](_0x35f7b5[_0xe3c6('0x39')],{'$or':_[_0xe3c6('0x2e')](_0xa2d390,function(_0x53815f){if(_0x53815f[_0xe3c6('0x2b')]!==_0xe3c6('0x3c')){var _0x386667={};_0x386667[_0x53815f[_0xe3c6('0x25')]]={'$like':'%'+_0x6e8455[_0xe3c6('0x30')][_0xe3c6('0x3b')]+'%'};return _0x386667;}})});}_0x35f7b5=_['merge']({},_0x35f7b5,_0x6e8455[_0xe3c6('0x3d')]);var _0x1e2ae7={'where':_0x35f7b5[_0xe3c6('0x39')]};return db[_0xe3c6('0x28')][_0xe3c6('0x1b')](_0x1e2ae7)[_0xe3c6('0x20')](function(_0xb5517a){_0x29e3a6[_0xe3c6('0x1b')]=_0xb5517a;if(_0x6e8455[_0xe3c6('0x30')][_0xe3c6('0x3e')]){_0x35f7b5[_0xe3c6('0x3f')]=[{'all':!![]}];}return db[_0xe3c6('0x28')][_0xe3c6('0x40')](_0x35f7b5);})['then'](function(_0x47eec7){_0x29e3a6[_0xe3c6('0x41')]=_0x47eec7;return _0x29e3a6;})[_0xe3c6('0x20')](respondWithFilteredResult(_0x37b1f4,_0x35f7b5))[_0xe3c6('0x42')](handleError(_0x37b1f4,null));};exports[_0xe3c6('0x43')]=function(_0x779bef,_0x28721e){var _0x5e9af5={'raw':!![],'where':{'id':_0x779bef[_0xe3c6('0x44')]['id']}},_0x3b67a0={};_0x3b67a0[_0xe3c6('0x2d')]=_[_0xe3c6('0x2f')](db[_0xe3c6('0x28')][_0xe3c6('0x29')]);_0x3b67a0[_0xe3c6('0x30')]=_[_0xe3c6('0x2f')](_0x779bef['query']);_0x3b67a0['filters']=_['intersection'](_0x3b67a0[_0xe3c6('0x2d')],_0x3b67a0[_0xe3c6('0x30')]);_0x5e9af5[_0xe3c6('0x34')]=_['intersection'](_0x3b67a0[_0xe3c6('0x2d')],qs['fields'](_0x779bef[_0xe3c6('0x30')][_0xe3c6('0x33')]));_0x5e9af5[_0xe3c6('0x34')]=_0x5e9af5['attributes'][_0xe3c6('0x45')]?_0x5e9af5[_0xe3c6('0x34')]:_0x3b67a0['model'];if(_0x779bef[_0xe3c6('0x30')][_0xe3c6('0x3e')]){_0x5e9af5[_0xe3c6('0x3f')]=[{'all':!![]}];}_0x5e9af5=_[_0xe3c6('0x46')]({},_0x5e9af5,_0x779bef['options']);return db[_0xe3c6('0x28')][_0xe3c6('0x47')](_0x5e9af5)[_0xe3c6('0x20')](handleEntityNotFound(_0x28721e,null))[_0xe3c6('0x20')](respondWithResult(_0x28721e,null))[_0xe3c6('0x42')](handleError(_0x28721e,null));};exports[_0xe3c6('0x48')]=function(_0xbe463,_0x287d8c){return db['JscriptyQuestionReport'][_0xe3c6('0x48')](_0xbe463[_0xe3c6('0x49')],{})['then'](respondWithResult(_0x287d8c,0xc9))['catch'](handleError(_0x287d8c,null));};exports[_0xe3c6('0x1f')]=function(_0x38272a,_0x381d94){if(_0x38272a['body']['id']){delete _0x38272a['body']['id'];}return db['JscriptyQuestionReport'][_0xe3c6('0x47')]({'where':{'id':_0x38272a[_0xe3c6('0x44')]['id']}})[_0xe3c6('0x20')](handleEntityNotFound(_0x381d94,null))['then'](saveUpdates(_0x38272a[_0xe3c6('0x49')],null))['then'](respondWithResult(_0x381d94,null))[_0xe3c6('0x42')](handleError(_0x381d94,null));};exports[_0xe3c6('0x21')]=function(_0x49f8de,_0x3c69f1){return db[_0xe3c6('0x28')][_0xe3c6('0x47')]({'where':{'id':_0x49f8de['params']['id']}})[_0xe3c6('0x20')](handleEntityNotFound(_0x3c69f1,null))[_0xe3c6('0x20')](removeEntity(_0x3c69f1,null))[_0xe3c6('0x42')](handleError(_0x3c69f1,null));};exports[_0xe3c6('0x4a')]=function(_0x44e05b,_0x4dda8a){return db[_0xe3c6('0x28')][_0xe3c6('0x4a')]()[_0xe3c6('0x20')](respondWithResult(_0x4dda8a,null))['catch'](handleError(_0x4dda8a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index eab6cfd..4a9af74 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 _0x91ea=['moment','bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define','report_jscripty_questions','util','../../config/logger','api'];(function(_0x496046,_0x6d5fd9){var _0x5f3e3b=function(_0x11d815){while(--_0x11d815){_0x496046['push'](_0x496046['shift']());}};_0x5f3e3b(++_0x6d5fd9);}(_0x91ea,0xd9));var _0xa91e=function(_0x386e7c,_0x254331){_0x386e7c=_0x386e7c-0x0;var _0x4bf545=_0x91ea[_0x386e7c];return _0x4bf545;};'use strict';var _=require('lodash');var util=require(_0xa91e('0x0'));var logger=require(_0xa91e('0x1'))(_0xa91e('0x2'));var moment=require(_0xa91e('0x3'));var BPromise=require(_0xa91e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa91e('0x5'));var rimraf=require(_0xa91e('0x6'));var config=require(_0xa91e('0x7'));var attributes=require(_0xa91e('0x8'));module['exports']=function(_0xe370b1,_0x39d97b){return _0xe370b1[_0xa91e('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0xa91e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x486e=['api','moment','request-promise','../../config/environment','./jscriptyQuestionReport.attributes','exports','report_jscripty_questions','util','../../config/logger'];(function(_0xf11b94,_0x168b04){var _0x5815ca=function(_0x1aa241){while(--_0x1aa241){_0xf11b94['push'](_0xf11b94['shift']());}};_0x5815ca(++_0x168b04);}(_0x486e,0x127));var _0xe486=function(_0x4e364e,_0x2ee796){_0x4e364e=_0x4e364e-0x0;var _0x279cf5=_0x486e[_0x4e364e];return _0x279cf5;};'use strict';var _=require('lodash');var util=require(_0xe486('0x0'));var logger=require(_0xe486('0x1'))(_0xe486('0x2'));var moment=require(_0xe486('0x3'));var BPromise=require('bluebird');var rp=require(_0xe486('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe486('0x5'));var attributes=require(_0xe486('0x6'));module[_0xe486('0x7')]=function(_0x101d09,_0x3a834f){return _0x101d09['define']('JscriptyQuestionReport',attributes,{'tableName':_0xe486('0x8'),'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 fb9f533..4561443 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 _0xe373=['request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe373,0x14b));var _0x3e37=function(_0x4178d2,_0x236962){_0x4178d2=_0x4178d2-0x0;var _0xd57a99=_0xe373[_0x4178d2];return _0xd57a99;};'use strict';var _=require('lodash');var util=require(_0x3e37('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3e37('0x1'));var fs=require('fs');var Redis=require(_0x3e37('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3e37('0x3'));var logger=require(_0x3e37('0x4'))('rpc');var config=require(_0x3e37('0x5'));var jayson=require(_0x3e37('0x6'));var client=jayson[_0x3e37('0x7')][_0x3e37('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3bfa02,_0x2ed655,_0x599aa1){return new BPromise(function(_0x16946d,_0x41d1ce){return client['request'](_0x3bfa02,_0x599aa1)['then'](function(_0x20cf48){logger[_0x3e37('0x9')](_0x3e37('0xa'),_0x2ed655,_0x3e37('0xb'));logger[_0x3e37('0xc')](_0x3e37('0xd'),_0x2ed655,_0x3e37('0xb'),JSON['stringify'](_0x20cf48));if(_0x20cf48[_0x3e37('0xe')]){if(_0x20cf48[_0x3e37('0xe')][_0x3e37('0xf')]===0x1f4){logger[_0x3e37('0xe')](_0x3e37('0xa'),_0x2ed655,_0x20cf48[_0x3e37('0xe')]['message']);return _0x41d1ce(_0x20cf48[_0x3e37('0xe')][_0x3e37('0x10')]);}logger[_0x3e37('0xe')](_0x3e37('0xa'),_0x2ed655,_0x20cf48[_0x3e37('0xe')][_0x3e37('0x10')]);return _0x16946d(_0x20cf48['error'][_0x3e37('0x10')]);}else{logger['info'](_0x3e37('0xa'),_0x2ed655,_0x3e37('0xb'));_0x16946d(_0x20cf48[_0x3e37('0x11')][_0x3e37('0x10')]);}})[_0x3e37('0x12')](function(_0x116ec0){logger[_0x3e37('0xe')](_0x3e37('0xa'),_0x2ed655,_0x116ec0);_0x41d1ce(_0x116ec0);});});} \ No newline at end of file +var _0xd96c=['randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x2dfd5d,_0x237cf6){var _0x5a32ba=function(_0x450727){while(--_0x450727){_0x2dfd5d['push'](_0x2dfd5d['shift']());}};_0x5a32ba(++_0x237cf6);}(_0xd96c,0x9d));var _0xcd96=function(_0x1accb5,_0x36dc61){_0x1accb5=_0x1accb5-0x0;var _0x3f6291=_0xd96c[_0x1accb5];return _0x3f6291;};'use strict';var _=require(_0xcd96('0x0'));var util=require(_0xcd96('0x1'));var moment=require(_0xcd96('0x2'));var BPromise=require(_0xcd96('0x3'));var rs=require(_0xcd96('0x4'));var fs=require('fs');var Redis=require(_0xcd96('0x5'));var db=require(_0xcd96('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xcd96('0x7'));var jayson=require(_0xcd96('0x8'));var client=jayson[_0xcd96('0x9')][_0xcd96('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe86501,_0x7d218c,_0x4f617a){return new BPromise(function(_0x23f80c,_0x38ae7c){return client[_0xcd96('0xb')](_0xe86501,_0x4f617a)[_0xcd96('0xc')](function(_0x3e8a96){logger[_0xcd96('0xd')](_0xcd96('0xe'),_0x7d218c,_0xcd96('0xf'));logger[_0xcd96('0x10')](_0xcd96('0x11'),_0x7d218c,'request\x20sent',JSON[_0xcd96('0x12')](_0x3e8a96));if(_0x3e8a96[_0xcd96('0x13')]){if(_0x3e8a96[_0xcd96('0x13')][_0xcd96('0x14')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x7d218c,_0x3e8a96[_0xcd96('0x13')][_0xcd96('0x15')]);return _0x38ae7c(_0x3e8a96['error'][_0xcd96('0x15')]);}logger[_0xcd96('0x13')](_0xcd96('0xe'),_0x7d218c,_0x3e8a96[_0xcd96('0x13')]['message']);return _0x23f80c(_0x3e8a96[_0xcd96('0x13')]['message']);}else{logger[_0xcd96('0xd')](_0xcd96('0xe'),_0x7d218c,_0xcd96('0xf'));_0x23f80c(_0x3e8a96['result'][_0xcd96('0x15')]);}})[_0xcd96('0x16')](function(_0x3e523f){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x7d218c,_0x3e523f);_0x38ae7c(_0x3e523f);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 13f2b09..a67f5b2 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 _0xc211=['../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/questions','getQuestions','post','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x460321,_0x5bc325){var _0x4a7888=function(_0x4fa503){while(--_0x4fa503){_0x460321['push'](_0x460321['shift']());}};_0x4a7888(++_0x5bc325);}(_0xc211,0x1c1));var _0x1c21=function(_0x1080b4,_0xe40a25){_0x1080b4=_0x1080b4-0x0;var _0x400509=_0xc211[_0x1080b4];return _0x400509;};'use strict';var multer=require(_0x1c21('0x0'));var util=require(_0x1c21('0x1'));var path=require(_0x1c21('0x2'));var timeout=require('connect-timeout');var express=require(_0x1c21('0x3'));var router=express[_0x1c21('0x4')]();var fs_extra=require(_0x1c21('0x5'));var auth=require(_0x1c21('0x6'));var interaction=require(_0x1c21('0x7'));var config=require(_0x1c21('0x8'));var controller=require(_0x1c21('0x9'));router[_0x1c21('0xa')]('/',auth['isAuthenticated'](),controller[_0x1c21('0xb')]);router[_0x1c21('0xa')](_0x1c21('0xc'),auth[_0x1c21('0xd')](),controller['describe']);router['get'](_0x1c21('0xe'),auth[_0x1c21('0xd')](),controller[_0x1c21('0xf')]);router['get'](_0x1c21('0x10'),auth[_0x1c21('0xd')](),controller[_0x1c21('0x11')]);router[_0x1c21('0x12')]('/',auth[_0x1c21('0xd')](),controller['create']);router[_0x1c21('0x13')](_0x1c21('0xe'),auth[_0x1c21('0xd')](),controller[_0x1c21('0x14')]);router[_0x1c21('0x15')](_0x1c21('0xe'),auth['isAuthenticated'](),controller[_0x1c21('0x16')]);module[_0x1c21('0x17')]=router; \ No newline at end of file +var _0xf0a3=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','destroy','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf0a3,0x90));var _0x3f0a=function(_0x163d61,_0x1dfedf){_0x163d61=_0x163d61-0x0;var _0x16ba8b=_0xf0a3[_0x163d61];return _0x16ba8b;};'use strict';var multer=require(_0x3f0a('0x0'));var util=require(_0x3f0a('0x1'));var path=require('path');var timeout=require(_0x3f0a('0x2'));var express=require(_0x3f0a('0x3'));var router=express['Router']();var fs_extra=require(_0x3f0a('0x4'));var auth=require(_0x3f0a('0x5'));var interaction=require(_0x3f0a('0x6'));var config=require(_0x3f0a('0x7'));var controller=require('./jscriptySessionReport.controller');router[_0x3f0a('0x8')]('/',auth[_0x3f0a('0x9')](),controller[_0x3f0a('0xa')]);router[_0x3f0a('0x8')](_0x3f0a('0xb'),auth[_0x3f0a('0x9')](),controller[_0x3f0a('0xc')]);router[_0x3f0a('0x8')](_0x3f0a('0xd'),auth[_0x3f0a('0x9')](),controller[_0x3f0a('0xe')]);router[_0x3f0a('0x8')](_0x3f0a('0xf'),auth[_0x3f0a('0x9')](),controller[_0x3f0a('0x10')]);router[_0x3f0a('0x11')]('/',auth[_0x3f0a('0x9')](),controller[_0x3f0a('0x12')]);router[_0x3f0a('0x13')](_0x3f0a('0xd'),auth[_0x3f0a('0x9')](),controller[_0x3f0a('0x14')]);router[_0x3f0a('0x15')](_0x3f0a('0xd'),auth[_0x3f0a('0x9')](),controller[_0x3f0a('0x16')]);module[_0x3f0a('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index b187cd3..e29202b 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 _0xbc26=['sequelize','exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment'];(function(_0x1b9e27,_0x24f559){var _0x3b1881=function(_0x272a04){while(--_0x272a04){_0x1b9e27['push'](_0x1b9e27['shift']());}};_0x3b1881(++_0x24f559);}(_0xbc26,0x1c1));var _0x6bc2=function(_0x3e55e0,_0xb084c4){_0x3e55e0=_0x3e55e0-0x0;var _0x32986e=_0xbc26[_0x3e55e0];return _0x32986e;};'use strict';var moment=require(_0x6bc2('0x0'));var Sequelize=require(_0x6bc2('0x1'));module[_0x6bc2('0x2')]={'starttime':{'type':Sequelize[_0x6bc2('0x3')],'set':function(_0x23c383){this[_0x6bc2('0x4')](_0x6bc2('0x5'),_0x23c383);this['setDataValue'](_0x6bc2('0x6'),moment()[_0x6bc2('0x7')](_0x6bc2('0x8')));}},'endtime':{'type':Sequelize[_0x6bc2('0x3')]},'membername':{'type':Sequelize[_0x6bc2('0x9')]},'projectname':{'type':Sequelize[_0x6bc2('0x9')]},'queue':{'type':Sequelize[_0x6bc2('0x9')]},'uniqueid':{'type':Sequelize[_0x6bc2('0x9')]},'calleridname':{'type':Sequelize[_0x6bc2('0x9')]},'calleridnum':{'type':Sequelize[_0x6bc2('0x9')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x27f7=['DATE','setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports'];(function(_0x4c68f5,_0x36ae93){var _0x1eaffd=function(_0x5de521){while(--_0x5de521){_0x4c68f5['push'](_0x4c68f5['shift']());}};_0x1eaffd(++_0x36ae93);}(_0x27f7,0x177));var _0x727f=function(_0x29c337,_0x3a0492){_0x29c337=_0x29c337-0x0;var _0x92883c=_0x27f7[_0x29c337];return _0x92883c;};'use strict';var moment=require(_0x727f('0x0'));var Sequelize=require(_0x727f('0x1'));module[_0x727f('0x2')]={'starttime':{'type':Sequelize[_0x727f('0x3')],'set':function(_0x3b7444){this[_0x727f('0x4')](_0x727f('0x5'),_0x3b7444);this['setDataValue'](_0x727f('0x6'),moment()['format'](_0x727f('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x727f('0x8')]},'projectname':{'type':Sequelize[_0x727f('0x8')]},'queue':{'type':Sequelize[_0x727f('0x8')]},'uniqueid':{'type':Sequelize[_0x727f('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x727f('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index c600585..8597127 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 _0x4fa8=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','then','end','error','stack','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','map','type','VIRTUAL','options','JscriptySessionReport','includeAll','include','findAll','catch','show','params','keys','create','body','update','find','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','pick','SessionId','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0x4fa8,0xf1));var _0x84fa=function(_0x42118e,_0x532565){_0x42118e=_0x42118e-0x0;var _0x1503bb=_0x4fa8[_0x42118e];return _0x1503bb;};'use strict';var emlformat=require(_0x84fa('0x0'));var rimraf=require(_0x84fa('0x1'));var zipdir=require(_0x84fa('0x2'));var jsonpatch=require(_0x84fa('0x3'));var rp=require(_0x84fa('0x4'));var moment=require(_0x84fa('0x5'));var BPromise=require(_0x84fa('0x6'));var Mustache=require(_0x84fa('0x7'));var util=require(_0x84fa('0x8'));var path=require(_0x84fa('0x9'));var sox=require(_0x84fa('0xa'));var csv=require(_0x84fa('0xb'));var ejs=require(_0x84fa('0xc'));var fs=require('fs');var fs_extra=require(_0x84fa('0xd'));var _=require(_0x84fa('0xe'));var squel=require(_0x84fa('0xf'));var crypto=require('crypto');var jsforce=require(_0x84fa('0x10'));var deskjs=require(_0x84fa('0x11'));var toCsv=require(_0x84fa('0xb'));var querystring=require('querystring');var Papa=require(_0x84fa('0x12'));var Redis=require('ioredis');var authService=require(_0x84fa('0x13'));var qs=require(_0x84fa('0x14'));var as=require(_0x84fa('0x15'));var hardwareService=require(_0x84fa('0x16'));var logger=require(_0x84fa('0x17'))(_0x84fa('0x18'));var utils=require('../../config/utils');var config=require(_0x84fa('0x19'));var licenseUtil=require(_0x84fa('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x365cf7,_0x1707e2){_0x1707e2=_0x1707e2||0xcc;return function(_0xb758ad){if(_0xb758ad){return _0x365cf7[_0x84fa('0x1b')](_0x1707e2);}return _0x365cf7[_0x84fa('0x1c')](_0x1707e2)['end']();};}function respondWithResult(_0x3c701d,_0x225448){_0x225448=_0x225448||0xc8;return function(_0x38c38a){if(_0x38c38a){return _0x3c701d[_0x84fa('0x1c')](_0x225448)[_0x84fa('0x1d')](_0x38c38a);}};}function respondWithFilteredResult(_0x1a0e62,_0x41abc1){return function(_0x1114dc){if(_0x1114dc){var _0x3de389=typeof _0x41abc1[_0x84fa('0x1e')]===_0x84fa('0x1f')&&typeof _0x41abc1[_0x84fa('0x20')]==='undefined';var _0x3e02f1=_0x1114dc[_0x84fa('0x21')];var _0x2d4604=_0x3de389?0x0:_0x41abc1[_0x84fa('0x1e')];var _0x2192f2=_0x3de389?_0x1114dc[_0x84fa('0x21')]:_0x41abc1[_0x84fa('0x1e')]+_0x41abc1['limit'];var _0x14dd34;if(_0x2192f2>=_0x3e02f1){_0x2192f2=_0x3e02f1;_0x14dd34=0xc8;}else{_0x14dd34=0xce;}_0x1a0e62[_0x84fa('0x1c')](_0x14dd34);return _0x1a0e62[_0x84fa('0x22')]('Content-Range',_0x2d4604+'-'+_0x2192f2+'/'+_0x3e02f1)['json'](_0x1114dc);}return null;};}function patchUpdates(_0x343bd6){return function(_0x5d2b31){try{jsonpatch['apply'](_0x5d2b31,_0x343bd6,!![]);}catch(_0x11fae6){return BPromise[_0x84fa('0x23')](_0x11fae6);}return _0x5d2b31[_0x84fa('0x24')]();};}function saveUpdates(_0x3252e9,_0x156c66){return function(_0x37bc88){if(_0x37bc88){return _0x37bc88['update'](_0x3252e9)[_0x84fa('0x25')](function(_0x26f28e){return _0x26f28e;});}return null;};}function removeEntity(_0x2ac7bc,_0x5900a4){return function(_0x5de4c0){if(_0x5de4c0){return _0x5de4c0['destroy']()[_0x84fa('0x25')](function(){_0x2ac7bc[_0x84fa('0x1c')](0xcc)[_0x84fa('0x26')]();});}};}function handleEntityNotFound(_0x1c3098,_0x2df16c){return function(_0x2664ca){if(!_0x2664ca){_0x1c3098[_0x84fa('0x1b')](0x194);}return _0x2664ca;};}function handleError(_0x506b4f,_0x452b42){_0x452b42=_0x452b42||0x1f4;return function(_0x5ad7d2){logger[_0x84fa('0x27')](_0x5ad7d2[_0x84fa('0x28')]);if(_0x5ad7d2['name']){delete _0x5ad7d2['name'];}_0x506b4f[_0x84fa('0x1c')](_0x452b42)[_0x84fa('0x29')](_0x5ad7d2);};}exports[_0x84fa('0x2a')]=function(_0x6655e3,_0x1a139d){var _0x260bfa={},_0x9b8173={},_0x4486b1={'count':0x0,'rows':[]};var _0x2987bc=_['map'](db['JscriptySessionReport'][_0x84fa('0x2b')],function(_0x2b7fbf){return{'name':_0x2b7fbf[_0x84fa('0x2c')],'type':_0x2b7fbf['type'][_0x84fa('0x2d')]};});_0x9b8173[_0x84fa('0x2e')]=_['map'](_0x2987bc,'name');_0x9b8173[_0x84fa('0x2f')]=_['keys'](_0x6655e3['query']);_0x9b8173[_0x84fa('0x30')]=_[_0x84fa('0x31')](_0x9b8173['model'],_0x9b8173[_0x84fa('0x2f')]);_0x260bfa[_0x84fa('0x32')]=_[_0x84fa('0x31')](_0x9b8173[_0x84fa('0x2e')],qs[_0x84fa('0x33')](_0x6655e3['query']['fields']));_0x260bfa['attributes']=_0x260bfa[_0x84fa('0x32')][_0x84fa('0x34')]?_0x260bfa[_0x84fa('0x32')]:_0x9b8173[_0x84fa('0x2e')];if(!_0x6655e3['query'][_0x84fa('0x35')]('nolimit')){_0x260bfa[_0x84fa('0x20')]=qs[_0x84fa('0x20')](_0x6655e3[_0x84fa('0x2f')][_0x84fa('0x20')]);_0x260bfa['offset']=qs[_0x84fa('0x1e')](_0x6655e3['query'][_0x84fa('0x1e')]);}_0x260bfa[_0x84fa('0x36')]=qs[_0x84fa('0x37')](_0x6655e3['query'][_0x84fa('0x37')]);_0x260bfa['where']=qs[_0x84fa('0x30')](_['pick'](_0x6655e3[_0x84fa('0x2f')],_0x9b8173[_0x84fa('0x30')]),_0x2987bc);if(_0x6655e3[_0x84fa('0x2f')][_0x84fa('0x38')]){_0x260bfa[_0x84fa('0x39')]=_[_0x84fa('0x3a')](_0x260bfa[_0x84fa('0x39')],{'$or':_[_0x84fa('0x3b')](_0x2987bc,function(_0x876ea0){if(_0x876ea0[_0x84fa('0x3c')]!==_0x84fa('0x3d')){var _0x34ef44={};_0x34ef44[_0x876ea0['name']]={'$like':'%'+_0x6655e3[_0x84fa('0x2f')][_0x84fa('0x38')]+'%'};return _0x34ef44;}})});}_0x260bfa=_['merge']({},_0x260bfa,_0x6655e3[_0x84fa('0x3e')]);var _0x531aed={'where':_0x260bfa[_0x84fa('0x39')]};return db[_0x84fa('0x3f')][_0x84fa('0x21')](_0x531aed)['then'](function(_0x4a9d02){_0x4486b1['count']=_0x4a9d02;if(_0x6655e3[_0x84fa('0x2f')][_0x84fa('0x40')]){_0x260bfa[_0x84fa('0x41')]=[{'all':!![]}];}return db[_0x84fa('0x3f')][_0x84fa('0x42')](_0x260bfa);})[_0x84fa('0x25')](function(_0x436e6a){_0x4486b1['rows']=_0x436e6a;return _0x4486b1;})['then'](respondWithFilteredResult(_0x1a139d,_0x260bfa))[_0x84fa('0x43')](handleError(_0x1a139d,null));};exports[_0x84fa('0x44')]=function(_0x360c49,_0x2f48b6){var _0x2991ff={'raw':!![],'where':{'id':_0x360c49[_0x84fa('0x45')]['id']}},_0x44b39e={};_0x44b39e['model']=_[_0x84fa('0x46')](db[_0x84fa('0x3f')][_0x84fa('0x2b')]);_0x44b39e[_0x84fa('0x2f')]=_[_0x84fa('0x46')](_0x360c49[_0x84fa('0x2f')]);_0x44b39e[_0x84fa('0x30')]=_[_0x84fa('0x31')](_0x44b39e[_0x84fa('0x2e')],_0x44b39e['query']);_0x2991ff[_0x84fa('0x32')]=_[_0x84fa('0x31')](_0x44b39e[_0x84fa('0x2e')],qs[_0x84fa('0x33')](_0x360c49[_0x84fa('0x2f')]['fields']));_0x2991ff[_0x84fa('0x32')]=_0x2991ff[_0x84fa('0x32')][_0x84fa('0x34')]?_0x2991ff['attributes']:_0x44b39e[_0x84fa('0x2e')];if(_0x360c49[_0x84fa('0x2f')][_0x84fa('0x40')]){_0x2991ff[_0x84fa('0x41')]=[{'all':!![]}];}_0x2991ff=_['merge']({},_0x2991ff,_0x360c49[_0x84fa('0x3e')]);return db[_0x84fa('0x3f')]['find'](_0x2991ff)[_0x84fa('0x25')](handleEntityNotFound(_0x2f48b6,null))[_0x84fa('0x25')](respondWithResult(_0x2f48b6,null))[_0x84fa('0x43')](handleError(_0x2f48b6,null));};exports[_0x84fa('0x47')]=function(_0x2e1d31,_0x574d5f){return db['JscriptySessionReport'][_0x84fa('0x47')](_0x2e1d31[_0x84fa('0x48')],{})[_0x84fa('0x25')](respondWithResult(_0x574d5f,0xc9))[_0x84fa('0x43')](handleError(_0x574d5f,null));};exports[_0x84fa('0x49')]=function(_0x6b05b4,_0x9d2aa1){if(_0x6b05b4['body']['id']){delete _0x6b05b4[_0x84fa('0x48')]['id'];}return db[_0x84fa('0x3f')][_0x84fa('0x4a')]({'where':{'id':_0x6b05b4['params']['id']}})[_0x84fa('0x25')](handleEntityNotFound(_0x9d2aa1,null))[_0x84fa('0x25')](saveUpdates(_0x6b05b4[_0x84fa('0x48')],null))[_0x84fa('0x25')](respondWithResult(_0x9d2aa1,null))[_0x84fa('0x43')](handleError(_0x9d2aa1,null));};exports[_0x84fa('0x4b')]=function(_0x463be4,_0x257643){return db[_0x84fa('0x3f')][_0x84fa('0x4a')]({'where':{'id':_0x463be4[_0x84fa('0x45')]['id']}})['then'](handleEntityNotFound(_0x257643,null))['then'](removeEntity(_0x257643,null))[_0x84fa('0x43')](handleError(_0x257643,null));};exports[_0x84fa('0x4c')]=function(_0xc68423,_0x5575d8){return db[_0x84fa('0x3f')][_0x84fa('0x4c')]()[_0x84fa('0x25')](respondWithResult(_0x5575d8,null))[_0x84fa('0x43')](handleError(_0x5575d8,null));};exports[_0x84fa('0x4d')]=function(_0x240e20,_0x40c395,_0x41d12e){var _0x35afb2={'raw':!![],'where':{}};var _0x418991={};var _0x33d350={'count':0x0,'rows':[]};return db[_0x84fa('0x3f')][_0x84fa('0x4e')]({'where':{'id':_0x240e20['params']['id']}})[_0x84fa('0x25')](handleEntityNotFound(_0x40c395,null))[_0x84fa('0x25')](function(_0x219925){if(_0x219925){_0x418991['model']=_[_0x84fa('0x46')](db[_0x84fa('0x4f')]['rawAttributes']);_0x418991[_0x84fa('0x2f')]=_[_0x84fa('0x46')](_0x240e20[_0x84fa('0x2f')]);_0x418991[_0x84fa('0x30')]=_['intersection'](_0x418991['model'],_0x418991[_0x84fa('0x2f')]);_0x35afb2[_0x84fa('0x32')]=_[_0x84fa('0x31')](_0x418991[_0x84fa('0x2e')],qs[_0x84fa('0x33')](_0x240e20[_0x84fa('0x2f')]['fields']));_0x35afb2[_0x84fa('0x32')]=_0x35afb2[_0x84fa('0x32')]['length']?_0x35afb2['attributes']:_0x418991[_0x84fa('0x2e')];if(!_0x240e20[_0x84fa('0x2f')]['hasOwnProperty'](_0x84fa('0x50'))){_0x35afb2['limit']=qs[_0x84fa('0x20')](_0x240e20['query'][_0x84fa('0x20')]);_0x35afb2[_0x84fa('0x1e')]=qs['offset'](_0x240e20['query']['offset']);}_0x35afb2[_0x84fa('0x36')]=qs[_0x84fa('0x37')](_0x240e20['query'][_0x84fa('0x37')]);_0x35afb2[_0x84fa('0x39')]=qs[_0x84fa('0x30')](_[_0x84fa('0x51')](_0x240e20[_0x84fa('0x2f')],_0x418991[_0x84fa('0x30')]));_0x35afb2[_0x84fa('0x39')][_0x84fa('0x52')]=_0x219925['id'];if(_0x240e20[_0x84fa('0x2f')]['filter']){_0x35afb2[_0x84fa('0x39')]=_['merge'](_0x35afb2[_0x84fa('0x39')],{'$or':_[_0x84fa('0x3b')](_0x35afb2['attributes'],function(_0x39b5ee){var _0xfaed5d={};_0xfaed5d[_0x39b5ee]={'$like':'%'+_0x240e20[_0x84fa('0x2f')][_0x84fa('0x38')]+'%'};return _0xfaed5d;})});}_0x35afb2=_[_0x84fa('0x3a')]({},_0x35afb2,_0x240e20[_0x84fa('0x3e')]);return db[_0x84fa('0x4f')][_0x84fa('0x21')]({'where':_0x35afb2[_0x84fa('0x39')]})[_0x84fa('0x25')](function(_0x115c56){_0x33d350[_0x84fa('0x21')]=_0x115c56;if(_0x240e20[_0x84fa('0x2f')][_0x84fa('0x40')]){_0x35afb2[_0x84fa('0x41')]=[{'all':!![]}];}return db[_0x84fa('0x4f')]['findAll'](_0x35afb2);})[_0x84fa('0x25')](function(_0x504591){_0x33d350[_0x84fa('0x53')]=_0x504591;return _0x33d350;});}})['then'](respondWithFilteredResult(_0x40c395,_0x35afb2))['catch'](handleError(_0x40c395,null));}; \ No newline at end of file +var _0x1f9e=['path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','limit','count','set','apply','reject','save','destroy','then','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','update','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','eml-format','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x2a238a,_0x1d5054){var _0xeef802=function(_0x583637){while(--_0x583637){_0x2a238a['push'](_0x2a238a['shift']());}};_0xeef802(++_0x1d5054);}(_0x1f9e,0x180));var _0xe1f9=function(_0x10dc64,_0x11bb29){_0x10dc64=_0x10dc64-0x0;var _0x9cf98d=_0x1f9e[_0x10dc64];return _0x9cf98d;};'use strict';var emlformat=require(_0xe1f9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe1f9('0x1'));var rp=require(_0xe1f9('0x2'));var moment=require(_0xe1f9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe1f9('0x4'));var util=require(_0xe1f9('0x5'));var path=require(_0xe1f9('0x6'));var sox=require(_0xe1f9('0x7'));var csv=require(_0xe1f9('0x8'));var ejs=require(_0xe1f9('0x9'));var fs=require('fs');var fs_extra=require(_0xe1f9('0xa'));var _=require('lodash');var squel=require(_0xe1f9('0xb'));var crypto=require(_0xe1f9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe1f9('0xd'));var toCsv=require(_0xe1f9('0x8'));var querystring=require(_0xe1f9('0xe'));var Papa=require(_0xe1f9('0xf'));var Redis=require(_0xe1f9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe1f9('0x11'));var as=require(_0xe1f9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe1f9('0x13'))(_0xe1f9('0x14'));var utils=require(_0xe1f9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe1f9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x280c29,_0x412107){_0x412107=_0x412107||0xcc;return function(_0x4d962d){if(_0x4d962d){return _0x280c29['sendStatus'](_0x412107);}return _0x280c29[_0xe1f9('0x17')](_0x412107)[_0xe1f9('0x18')]();};}function respondWithResult(_0x1e2438,_0x4ccc2a){_0x4ccc2a=_0x4ccc2a||0xc8;return function(_0x428485){if(_0x428485){return _0x1e2438[_0xe1f9('0x17')](_0x4ccc2a)[_0xe1f9('0x19')](_0x428485);}};}function respondWithFilteredResult(_0x117478,_0x4cc6bc){return function(_0xb5754b){if(_0xb5754b){var _0x12582d=typeof _0x4cc6bc[_0xe1f9('0x1a')]==='undefined'&&typeof _0x4cc6bc[_0xe1f9('0x1b')]==='undefined';var _0x1f5d78=_0xb5754b[_0xe1f9('0x1c')];var _0x424cc8=_0x12582d?0x0:_0x4cc6bc[_0xe1f9('0x1a')];var _0x19abc0=_0x12582d?_0xb5754b['count']:_0x4cc6bc[_0xe1f9('0x1a')]+_0x4cc6bc['limit'];var _0x12f9ba;if(_0x19abc0>=_0x1f5d78){_0x19abc0=_0x1f5d78;_0x12f9ba=0xc8;}else{_0x12f9ba=0xce;}_0x117478['status'](_0x12f9ba);return _0x117478[_0xe1f9('0x1d')]('Content-Range',_0x424cc8+'-'+_0x19abc0+'/'+_0x1f5d78)[_0xe1f9('0x19')](_0xb5754b);}return null;};}function patchUpdates(_0x28ffef){return function(_0x45bfc6){try{jsonpatch[_0xe1f9('0x1e')](_0x45bfc6,_0x28ffef,!![]);}catch(_0x5d6163){return BPromise[_0xe1f9('0x1f')](_0x5d6163);}return _0x45bfc6[_0xe1f9('0x20')]();};}function saveUpdates(_0x344b56,_0x1bc39d){return function(_0x203b47){if(_0x203b47){return _0x203b47['update'](_0x344b56)['then'](function(_0x49cc82){return _0x49cc82;});}return null;};}function removeEntity(_0x4fed80,_0x44de2a){return function(_0x200479){if(_0x200479){return _0x200479[_0xe1f9('0x21')]()[_0xe1f9('0x22')](function(){_0x4fed80[_0xe1f9('0x17')](0xcc)[_0xe1f9('0x18')]();});}};}function handleEntityNotFound(_0x207074,_0x186540){return function(_0x2d2cbd){if(!_0x2d2cbd){_0x207074['sendStatus'](0x194);}return _0x2d2cbd;};}function handleError(_0x3bce50,_0xb4b137){_0xb4b137=_0xb4b137||0x1f4;return function(_0x19c473){logger['error'](_0x19c473[_0xe1f9('0x23')]);if(_0x19c473[_0xe1f9('0x24')]){delete _0x19c473[_0xe1f9('0x24')];}_0x3bce50[_0xe1f9('0x17')](_0xb4b137)[_0xe1f9('0x25')](_0x19c473);};}exports[_0xe1f9('0x26')]=function(_0x1883b4,_0x413e44){var _0x4e8753={},_0x378390={},_0x11a5ad={'count':0x0,'rows':[]};var _0xd0485=_[_0xe1f9('0x27')](db[_0xe1f9('0x28')][_0xe1f9('0x29')],function(_0x4f95af){return{'name':_0x4f95af[_0xe1f9('0x2a')],'type':_0x4f95af[_0xe1f9('0x2b')][_0xe1f9('0x2c')]};});_0x378390[_0xe1f9('0x2d')]=_[_0xe1f9('0x27')](_0xd0485,'name');_0x378390['query']=_['keys'](_0x1883b4[_0xe1f9('0x2e')]);_0x378390['filters']=_['intersection'](_0x378390[_0xe1f9('0x2d')],_0x378390[_0xe1f9('0x2e')]);_0x4e8753[_0xe1f9('0x2f')]=_[_0xe1f9('0x30')](_0x378390[_0xe1f9('0x2d')],qs[_0xe1f9('0x31')](_0x1883b4[_0xe1f9('0x2e')][_0xe1f9('0x31')]));_0x4e8753[_0xe1f9('0x2f')]=_0x4e8753[_0xe1f9('0x2f')][_0xe1f9('0x32')]?_0x4e8753['attributes']:_0x378390[_0xe1f9('0x2d')];if(!_0x1883b4['query'][_0xe1f9('0x33')](_0xe1f9('0x34'))){_0x4e8753[_0xe1f9('0x1b')]=qs[_0xe1f9('0x1b')](_0x1883b4[_0xe1f9('0x2e')]['limit']);_0x4e8753['offset']=qs[_0xe1f9('0x1a')](_0x1883b4[_0xe1f9('0x2e')][_0xe1f9('0x1a')]);}_0x4e8753[_0xe1f9('0x35')]=qs[_0xe1f9('0x36')](_0x1883b4[_0xe1f9('0x2e')]['sort']);_0x4e8753[_0xe1f9('0x37')]=qs[_0xe1f9('0x38')](_['pick'](_0x1883b4[_0xe1f9('0x2e')],_0x378390[_0xe1f9('0x38')]),_0xd0485);if(_0x1883b4[_0xe1f9('0x2e')][_0xe1f9('0x39')]){_0x4e8753[_0xe1f9('0x37')]=_[_0xe1f9('0x3a')](_0x4e8753[_0xe1f9('0x37')],{'$or':_[_0xe1f9('0x27')](_0xd0485,function(_0xde5d90){if(_0xde5d90[_0xe1f9('0x2b')]!==_0xe1f9('0x3b')){var _0x35813f={};_0x35813f[_0xde5d90[_0xe1f9('0x24')]]={'$like':'%'+_0x1883b4[_0xe1f9('0x2e')][_0xe1f9('0x39')]+'%'};return _0x35813f;}})});}_0x4e8753=_[_0xe1f9('0x3a')]({},_0x4e8753,_0x1883b4[_0xe1f9('0x3c')]);var _0x2d4114={'where':_0x4e8753[_0xe1f9('0x37')]};return db[_0xe1f9('0x28')][_0xe1f9('0x1c')](_0x2d4114)[_0xe1f9('0x22')](function(_0x544c46){_0x11a5ad[_0xe1f9('0x1c')]=_0x544c46;if(_0x1883b4['query']['includeAll']){_0x4e8753[_0xe1f9('0x3d')]=[{'all':!![]}];}return db[_0xe1f9('0x28')][_0xe1f9('0x3e')](_0x4e8753);})['then'](function(_0xfb357c){_0x11a5ad[_0xe1f9('0x3f')]=_0xfb357c;return _0x11a5ad;})['then'](respondWithFilteredResult(_0x413e44,_0x4e8753))['catch'](handleError(_0x413e44,null));};exports[_0xe1f9('0x40')]=function(_0x290965,_0x16884f){var _0x5e60ab={'raw':!![],'where':{'id':_0x290965[_0xe1f9('0x41')]['id']}},_0x1a2d5c={};_0x1a2d5c['model']=_['keys'](db[_0xe1f9('0x28')][_0xe1f9('0x29')]);_0x1a2d5c[_0xe1f9('0x2e')]=_[_0xe1f9('0x42')](_0x290965[_0xe1f9('0x2e')]);_0x1a2d5c[_0xe1f9('0x38')]=_['intersection'](_0x1a2d5c[_0xe1f9('0x2d')],_0x1a2d5c[_0xe1f9('0x2e')]);_0x5e60ab[_0xe1f9('0x2f')]=_[_0xe1f9('0x30')](_0x1a2d5c['model'],qs[_0xe1f9('0x31')](_0x290965[_0xe1f9('0x2e')][_0xe1f9('0x31')]));_0x5e60ab[_0xe1f9('0x2f')]=_0x5e60ab[_0xe1f9('0x2f')]['length']?_0x5e60ab['attributes']:_0x1a2d5c[_0xe1f9('0x2d')];if(_0x290965[_0xe1f9('0x2e')][_0xe1f9('0x43')]){_0x5e60ab[_0xe1f9('0x3d')]=[{'all':!![]}];}_0x5e60ab=_[_0xe1f9('0x3a')]({},_0x5e60ab,_0x290965[_0xe1f9('0x3c')]);return db[_0xe1f9('0x28')][_0xe1f9('0x44')](_0x5e60ab)['then'](handleEntityNotFound(_0x16884f,null))[_0xe1f9('0x22')](respondWithResult(_0x16884f,null))[_0xe1f9('0x45')](handleError(_0x16884f,null));};exports[_0xe1f9('0x46')]=function(_0x4e9efc,_0x6ee0f){return db[_0xe1f9('0x28')]['create'](_0x4e9efc[_0xe1f9('0x47')],{})[_0xe1f9('0x22')](respondWithResult(_0x6ee0f,0xc9))[_0xe1f9('0x45')](handleError(_0x6ee0f,null));};exports[_0xe1f9('0x48')]=function(_0x380c81,_0x32582d){if(_0x380c81[_0xe1f9('0x47')]['id']){delete _0x380c81[_0xe1f9('0x47')]['id'];}return db[_0xe1f9('0x28')]['find']({'where':{'id':_0x380c81[_0xe1f9('0x41')]['id']}})[_0xe1f9('0x22')](handleEntityNotFound(_0x32582d,null))['then'](saveUpdates(_0x380c81['body'],null))[_0xe1f9('0x22')](respondWithResult(_0x32582d,null))[_0xe1f9('0x45')](handleError(_0x32582d,null));};exports[_0xe1f9('0x21')]=function(_0x9943f,_0x2e32a2){return db[_0xe1f9('0x28')][_0xe1f9('0x44')]({'where':{'id':_0x9943f[_0xe1f9('0x41')]['id']}})[_0xe1f9('0x22')](handleEntityNotFound(_0x2e32a2,null))[_0xe1f9('0x22')](removeEntity(_0x2e32a2,null))[_0xe1f9('0x45')](handleError(_0x2e32a2,null));};exports[_0xe1f9('0x49')]=function(_0xe945a1,_0x276825){return db[_0xe1f9('0x28')]['describe']()[_0xe1f9('0x22')](respondWithResult(_0x276825,null))[_0xe1f9('0x45')](handleError(_0x276825,null));};exports[_0xe1f9('0x4a')]=function(_0x1cb477,_0x5c0b08,_0x2f6551){var _0x914237={'raw':!![],'where':{}};var _0x1875e5={};var _0x5c8e8b={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xe1f9('0x4b')]({'where':{'id':_0x1cb477[_0xe1f9('0x41')]['id']}})['then'](handleEntityNotFound(_0x5c0b08,null))[_0xe1f9('0x22')](function(_0x2ab82c){if(_0x2ab82c){_0x1875e5[_0xe1f9('0x2d')]=_[_0xe1f9('0x42')](db[_0xe1f9('0x4c')][_0xe1f9('0x29')]);_0x1875e5[_0xe1f9('0x2e')]=_[_0xe1f9('0x42')](_0x1cb477['query']);_0x1875e5['filters']=_[_0xe1f9('0x30')](_0x1875e5[_0xe1f9('0x2d')],_0x1875e5[_0xe1f9('0x2e')]);_0x914237['attributes']=_[_0xe1f9('0x30')](_0x1875e5[_0xe1f9('0x2d')],qs['fields'](_0x1cb477[_0xe1f9('0x2e')]['fields']));_0x914237[_0xe1f9('0x2f')]=_0x914237[_0xe1f9('0x2f')][_0xe1f9('0x32')]?_0x914237['attributes']:_0x1875e5['model'];if(!_0x1cb477[_0xe1f9('0x2e')][_0xe1f9('0x33')]('nolimit')){_0x914237['limit']=qs[_0xe1f9('0x1b')](_0x1cb477[_0xe1f9('0x2e')]['limit']);_0x914237[_0xe1f9('0x1a')]=qs[_0xe1f9('0x1a')](_0x1cb477[_0xe1f9('0x2e')][_0xe1f9('0x1a')]);}_0x914237['order']=qs[_0xe1f9('0x36')](_0x1cb477['query']['sort']);_0x914237[_0xe1f9('0x37')]=qs[_0xe1f9('0x38')](_['pick'](_0x1cb477[_0xe1f9('0x2e')],_0x1875e5['filters']));_0x914237[_0xe1f9('0x37')][_0xe1f9('0x4d')]=_0x2ab82c['id'];if(_0x1cb477[_0xe1f9('0x2e')][_0xe1f9('0x39')]){_0x914237[_0xe1f9('0x37')]=_['merge'](_0x914237[_0xe1f9('0x37')],{'$or':_[_0xe1f9('0x27')](_0x914237[_0xe1f9('0x2f')],function(_0x2193a0){var _0x100954={};_0x100954[_0x2193a0]={'$like':'%'+_0x1cb477[_0xe1f9('0x2e')][_0xe1f9('0x39')]+'%'};return _0x100954;})});}_0x914237=_[_0xe1f9('0x3a')]({},_0x914237,_0x1cb477['options']);return db[_0xe1f9('0x4c')][_0xe1f9('0x1c')]({'where':_0x914237[_0xe1f9('0x37')]})['then'](function(_0x3cf77b){_0x5c8e8b[_0xe1f9('0x1c')]=_0x3cf77b;if(_0x1cb477[_0xe1f9('0x2e')]['includeAll']){_0x914237['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x914237);})[_0xe1f9('0x22')](function(_0x57ea37){_0x5c8e8b[_0xe1f9('0x3f')]=_0x57ea37;return _0x5c8e8b;});}})[_0xe1f9('0x22')](respondWithFilteredResult(_0x5c0b08,_0x914237))['catch'](handleError(_0x5c0b08,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 2bb76a8..645a6d4 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 _0xe2fe=['../../config/environment','exports','define','JscriptySessionReport','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'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('./jscriptySessionReport.attributes');module[_0xee2f('0x7')]=function(_0x2b7e7c,_0x49926b){return _0x2b7e7c[_0xee2f('0x8')](_0xee2f('0x9'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5075=['bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions','lodash','util','../../config/logger','api','moment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x5075,0x73));var _0x5507=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0x5075[_0x4bcf38];return _0x4a89be;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var moment=require(_0x5507('0x4'));var BPromise=require(_0x5507('0x5'));var rp=require(_0x5507('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var attributes=require(_0x5507('0x9'));module['exports']=function(_0x5b6d7f,_0x2cd9ee){return _0x5b6d7f[_0x5507('0xa')]('JscriptySessionReport',attributes,{'tableName':_0x5507('0xb'),'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 b487b28..9542e9c 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 _0xbbbc=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x13f9c3,_0x2036c0){var _0x22185a=function(_0x36a7e6){while(--_0x36a7e6){_0x13f9c3['push'](_0x13f9c3['shift']());}};_0x22185a(++_0x2036c0);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x29239b,_0x114fdf){_0x29239b=_0x29239b-0x0;var _0x4f1c69=_0xbbbc[_0x29239b];return _0x4f1c69;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));var BPromise=require(_0xcbbb('0x3'));var rs=require(_0xcbbb('0x4'));var fs=require('fs');var Redis=require(_0xcbbb('0x5'));var db=require(_0xcbbb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbbb('0x7'))(_0xcbbb('0x8'));var config=require(_0xcbbb('0x9'));var jayson=require(_0xcbbb('0xa'));var client=jayson[_0xcbbb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x388197,_0x1796b4,_0x32ec9c){return new BPromise(function(_0x6f4fd8,_0x356249){return client[_0xcbbb('0xc')](_0x388197,_0x32ec9c)[_0xcbbb('0xd')](function(_0x4ec90a){logger[_0xcbbb('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x1796b4,'request\x20sent');logger[_0xcbbb('0xf')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x1796b4,_0xcbbb('0x10'),JSON['stringify'](_0x4ec90a));if(_0x4ec90a[_0xcbbb('0x11')]){if(_0x4ec90a[_0xcbbb('0x11')]['code']===0x1f4){logger[_0xcbbb('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x1796b4,_0x4ec90a[_0xcbbb('0x11')]['message']);return _0x356249(_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);}logger[_0xcbbb('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x1796b4,_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);return _0x6f4fd8(_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x1796b4,_0xcbbb('0x10'));_0x6f4fd8(_0x4ec90a[_0xcbbb('0x13')][_0xcbbb('0x12')]);}})[_0xcbbb('0x14')](function(_0x5e25ca){logger[_0xcbbb('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x1796b4,_0x5e25ca);_0x356249(_0x5e25ca);});});} \ No newline at end of file +var _0x3e24=['info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1116ac,_0xcbe059){var _0x3e806b=function(_0x33b585){while(--_0x33b585){_0x1116ac['push'](_0x1116ac['shift']());}};_0x3e806b(++_0xcbe059);}(_0x3e24,0x167));var _0x43e2=function(_0x193fe6,_0x57d2c2){_0x193fe6=_0x193fe6-0x0;var _0x3afc4f=_0x3e24[_0x193fe6];return _0x3afc4f;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var moment=require(_0x43e2('0x2'));var BPromise=require(_0x43e2('0x3'));var rs=require(_0x43e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43e2('0x5'))['db'];var utils=require(_0x43e2('0x6'));var logger=require('../../config/logger')(_0x43e2('0x7'));var config=require(_0x43e2('0x8'));var jayson=require(_0x43e2('0x9'));var client=jayson[_0x43e2('0xa')][_0x43e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x121e2e,_0x23b2d8,_0x59956d){return new BPromise(function(_0xb75b,_0x2357bc){return client['request'](_0x121e2e,_0x59956d)[_0x43e2('0xc')](function(_0x2fdf85){logger['info'](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));logger['debug'](_0x43e2('0xf'),_0x23b2d8,'request\x20sent',JSON['stringify'](_0x2fdf85));if(_0x2fdf85['error']){if(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x11')]===0x1f4){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0x2357bc(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);}logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0xb75b(_0x2fdf85['error'][_0x43e2('0x12')]);}else{logger[_0x43e2('0x13')](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));_0xb75b(_0x2fdf85['result']['message']);}})[_0x43e2('0x14')](function(_0x417ce5){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x417ce5);_0x2357bc(_0x417ce5);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 4ca7a8a..90d68cf 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 _0x1352=['put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index'];(function(_0x5061b3,_0x351073){var _0x23a2ea=function(_0x39f7e9){while(--_0x39f7e9){_0x5061b3['push'](_0x5061b3['shift']());}};_0x23a2ea(++_0x351073);}(_0x1352,0x17a));var _0x2135=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x1352[_0x9aada2];return _0x196dff;};'use strict';var multer=require(_0x2135('0x0'));var util=require(_0x2135('0x1'));var path=require(_0x2135('0x2'));var timeout=require(_0x2135('0x3'));var express=require(_0x2135('0x4'));var router=express[_0x2135('0x5')]();var fs_extra=require(_0x2135('0x6'));var auth=require(_0x2135('0x7'));var interaction=require(_0x2135('0x8'));var config=require(_0x2135('0x9'));var controller=require(_0x2135('0xa'));router[_0x2135('0xb')]('/',controller[_0x2135('0xc')]);router[_0x2135('0xd')](_0x2135('0xe'),auth['isAuthenticated'](),controller[_0x2135('0xf')]);module[_0x2135('0x10')]=router; \ No newline at end of file +var _0xc999=['put','/:id','update','exports','util','path','connect-timeout','../../components/interaction/service','./license.controller','index'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0xc999,0x176));var _0x9c99=function(_0x5e42a7,_0x3eba35){_0x5e42a7=_0x5e42a7-0x0;var _0x36d21b=_0xc999[_0x5e42a7];return _0x36d21b;};'use strict';var multer=require('multer');var util=require(_0x9c99('0x0'));var path=require(_0x9c99('0x1'));var timeout=require(_0x9c99('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9c99('0x3'));var config=require('../../config/environment');var controller=require(_0x9c99('0x4'));router['get']('/',controller[_0x9c99('0x5')]);router[_0x9c99('0x6')](_0x9c99('0x7'),auth['isAuthenticated'](),controller[_0x9c99('0x8')]);module[_0x9c99('0x9')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index f329449..55f3231 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 _0x89fc=['INTEGER','sequelize','STRING'];(function(_0x4ae1d4,_0x4b9592){var _0x2fd61f=function(_0x4724a6){while(--_0x4724a6){_0x4ae1d4['push'](_0x4ae1d4['shift']());}};_0x2fd61f(++_0x4b9592);}(_0x89fc,0xe2));var _0xc89f=function(_0x467ac2,_0x3c586d){_0x467ac2=_0x467ac2-0x0;var _0x4de017=_0x89fc[_0x467ac2];return _0x4de017;};'use strict';var Sequelize=require(_0xc89f('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xc89f('0x1')]},'data2':{'type':Sequelize[_0xc89f('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0xc89f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdddb=['sequelize','STRING','INTEGER'];(function(_0x4c373b,_0x43c1c0){var _0x5bb23b=function(_0x548449){while(--_0x548449){_0x4c373b['push'](_0x4c373b['shift']());}};_0x5bb23b(++_0x43c1c0);}(_0xdddb,0x1ef));var _0xbddd=function(_0x3823b0,_0x375563){_0x3823b0=_0x3823b0-0x0;var _0x4ffe22=_0xdddb[_0x3823b0];return _0x4ffe22;};'use strict';var Sequelize=require(_0xbddd('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xbddd('0x1')]},'data2':{'type':Sequelize[_0xbddd('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0xbddd('0x2')],'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 f8833ea..255a63e 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 _0x0295=['demo','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','../../config/license/util','model','keys','rawAttributes','query','filters','intersection','attributes','fields','merge','options','catch','body','License','find','checkLicense','key'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x0295,0x1f0));var _0x5029=function(_0x317d61,_0x5e6335){_0x317d61=_0x317d61-0x0;var _0x3abc20=_0x0295[_0x317d61];return _0x3abc20;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}var utilLicense=require(_0x5029('0x25'));exports['index']=function(_0x32da06,_0x251f99){var _0xe5313e={'raw':!![],'where':{'id':0x1}},_0x4b6f92={};_0x4b6f92[_0x5029('0x26')]=_[_0x5029('0x27')](db['License'][_0x5029('0x28')]);_0x4b6f92[_0x5029('0x29')]=_[_0x5029('0x27')](_0x32da06[_0x5029('0x29')]);_0x4b6f92[_0x5029('0x2a')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],_0x4b6f92[_0x5029('0x29')]);_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],qs[_0x5029('0x2d')](_0x32da06['query'][_0x5029('0x2d')]));_0xe5313e['attributes']=_0xe5313e[_0x5029('0x2c')]['length']?_0xe5313e['attributes']:_0x4b6f92[_0x5029('0x26')];_0xe5313e=_[_0x5029('0x2e')]({},_0xe5313e,_0x32da06[_0x5029('0x2f')]);return utilLicense['getLicense'](_0xe5313e)[_0x5029('0x20')](respondWithResult(_0x251f99,null))[_0x5029('0x30')](handleError(_0x251f99,null));};exports[_0x5029('0x1f')]=function(_0x29c59a,_0x1bb896){if(_0x29c59a[_0x5029('0x31')]['id']){delete _0x29c59a[_0x5029('0x31')]['id'];}return db[_0x5029('0x32')][_0x5029('0x33')]({'where':{'id':_0x29c59a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bb896,null))[_0x5029('0x20')](function(_0xc110e8){var _0x1b3817=_0xc110e8['get']({'plain':!![]});return utilLicense[_0x5029('0x34')](_0x1b3817,_0x29c59a[_0x5029('0x31')][_0x5029('0x35')]);})['then'](function(_0x4904cc){if(!_0x4904cc[_0x5029('0x36')]){return saveUpdates(_0x29c59a[_0x5029('0x31')],null);}return _0x4904cc;})['then'](respondWithResult(_0x1bb896,null))['catch'](handleError(_0x1bb896,null));}; \ No newline at end of file +var _0x1261=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','index','model','License','query','intersection','fields','attributes','merge','options','getLicense','catch','body','find','params','get','key','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis'];(function(_0x2bd688,_0xa8be6b){var _0x247408=function(_0x181497){while(--_0x181497){_0x2bd688['push'](_0x2bd688['shift']());}};_0x247408(++_0xa8be6b);}(_0x1261,0x144));var _0x1126=function(_0x43db86,_0x34184b){_0x43db86=_0x43db86-0x0;var _0x27bda2=_0x1261[_0x43db86];return _0x27bda2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}var utilLicense=require('../../config/license/util');exports[_0x1126('0x29')]=function(_0x23d2bc,_0x4a334a){var _0x3fa694={'raw':!![],'where':{'id':0x1}},_0x4bf807={};_0x4bf807[_0x1126('0x2a')]=_['keys'](db[_0x1126('0x2b')]['rawAttributes']);_0x4bf807[_0x1126('0x2c')]=_['keys'](_0x23d2bc['query']);_0x4bf807['filters']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],_0x4bf807[_0x1126('0x2c')]);_0x3fa694['attributes']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],qs['fields'](_0x23d2bc[_0x1126('0x2c')][_0x1126('0x2e')]));_0x3fa694[_0x1126('0x2f')]=_0x3fa694[_0x1126('0x2f')]['length']?_0x3fa694['attributes']:_0x4bf807[_0x1126('0x2a')];_0x3fa694=_[_0x1126('0x30')]({},_0x3fa694,_0x23d2bc[_0x1126('0x31')]);return utilLicense[_0x1126('0x32')](_0x3fa694)['then'](respondWithResult(_0x4a334a,null))[_0x1126('0x33')](handleError(_0x4a334a,null));};exports[_0x1126('0x24')]=function(_0x313ebe,_0x22436c){if(_0x313ebe[_0x1126('0x34')]['id']){delete _0x313ebe['body']['id'];}return db[_0x1126('0x2b')][_0x1126('0x35')]({'where':{'id':_0x313ebe[_0x1126('0x36')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0x22436c,null))['then'](function(_0x4ca51c){var _0x22827a=_0x4ca51c[_0x1126('0x37')]({'plain':!![]});return utilLicense['checkLicense'](_0x22827a,_0x313ebe[_0x1126('0x34')][_0x1126('0x38')]);})[_0x1126('0x25')](function(_0x5c08b9){if(!_0x5c08b9['demo']){return saveUpdates(_0x313ebe[_0x1126('0x34')],null);}return _0x5c08b9;})[_0x1126('0x25')](respondWithResult(_0x22436c,null))[_0x1126('0x33')](handleError(_0x22436c,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index fec481c..f26c82d 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 _0x6570=['path','../../config/environment','./license.attributes','exports','License','license','lodash','../../config/logger','api','bluebird'];(function(_0x39acf6,_0x3b06ef){var _0x4887e6=function(_0x5ce1f6){while(--_0x5ce1f6){_0x39acf6['push'](_0x39acf6['shift']());}};_0x4887e6(++_0x3b06ef);}(_0x6570,0x88));var _0x0657=function(_0x2a90cd,_0x2b3d05){_0x2a90cd=_0x2a90cd-0x0;var _0x10425d=_0x6570[_0x2a90cd];return _0x10425d;};'use strict';var _=require(_0x0657('0x0'));var util=require('util');var logger=require(_0x0657('0x1'))(_0x0657('0x2'));var moment=require('moment');var BPromise=require(_0x0657('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0657('0x4'));var rimraf=require('rimraf');var config=require(_0x0657('0x5'));var attributes=require(_0x0657('0x6'));module[_0x0657('0x7')]=function(_0x3a74c,_0x59f5a9){return _0x3a74c['define'](_0x0657('0x8'),attributes,{'tableName':_0x0657('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x948d=['license','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./license.attributes','exports','License'];(function(_0x24aa9c,_0x5e74e0){var _0x9029d2=function(_0x48b320){while(--_0x48b320){_0x24aa9c['push'](_0x24aa9c['shift']());}};_0x9029d2(++_0x5e74e0);}(_0x948d,0x85));var _0xd948=function(_0x113363,_0x1b9554){_0x113363=_0x113363-0x0;var _0x43688a=_0x948d[_0x113363];return _0x43688a;};'use strict';var _=require(_0xd948('0x0'));var util=require('util');var logger=require(_0xd948('0x1'))(_0xd948('0x2'));var moment=require(_0xd948('0x3'));var BPromise=require(_0xd948('0x4'));var rp=require(_0xd948('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd948('0x6'));var config=require(_0xd948('0x7'));var attributes=require(_0xd948('0x8'));module[_0xd948('0x9')]=function(_0x29c54d,_0x31ccf1){return _0x29c54d['define'](_0xd948('0xa'),attributes,{'tableName':_0xd948('0xb'),'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 6d19804..773fe02 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 _0xc8e9=['code','License,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','rpc','client','http','request','then','info','request\x20sent','debug','error'];(function(_0x588a49,_0x410f29){var _0x39a4fe=function(_0x25d649){while(--_0x25d649){_0x588a49['push'](_0x588a49['shift']());}};_0x39a4fe(++_0x410f29);}(_0xc8e9,0x15b));var _0x9c8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc8e9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9c8e('0x0'));var util=require(_0x9c8e('0x1'));var moment=require('moment');var BPromise=require(_0x9c8e('0x2'));var rs=require(_0x9c8e('0x3'));var fs=require('fs');var Redis=require(_0x9c8e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9c8e('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9c8e('0x6')][_0x9c8e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x6a6a53,_0x3011da,_0x4bee83){return new BPromise(function(_0x48d26a,_0x5ce41b){return client[_0x9c8e('0x8')](_0x6a6a53,_0x4bee83)[_0x9c8e('0x9')](function(_0x2b5f08){logger[_0x9c8e('0xa')]('License,\x20%s,\x20%s',_0x3011da,_0x9c8e('0xb'));logger[_0x9c8e('0xc')]('License,\x20%s,\x20%s,\x20%s',_0x3011da,_0x9c8e('0xb'),JSON['stringify'](_0x2b5f08));if(_0x2b5f08[_0x9c8e('0xd')]){if(_0x2b5f08[_0x9c8e('0xd')][_0x9c8e('0xe')]===0x1f4){logger[_0x9c8e('0xd')](_0x9c8e('0xf'),_0x3011da,_0x2b5f08[_0x9c8e('0xd')][_0x9c8e('0x10')]);return _0x5ce41b(_0x2b5f08[_0x9c8e('0xd')][_0x9c8e('0x10')]);}logger[_0x9c8e('0xd')]('License,\x20%s,\x20%s',_0x3011da,_0x2b5f08[_0x9c8e('0xd')][_0x9c8e('0x10')]);return _0x48d26a(_0x2b5f08[_0x9c8e('0xd')][_0x9c8e('0x10')]);}else{logger[_0x9c8e('0xa')]('License,\x20%s,\x20%s',_0x3011da,'request\x20sent');_0x48d26a(_0x2b5f08[_0x9c8e('0x11')][_0x9c8e('0x10')]);}})[_0x9c8e('0x12')](function(_0x41ad5e){logger[_0x9c8e('0xd')]('License,\x20%s,\x20%s',_0x3011da,_0x41ad5e);_0x5ce41b(_0x41ad5e);});});} \ No newline at end of file +var _0xb5b7=['License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','License,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1ae509,_0x52383b){var _0x141f0f=function(_0xd50bc3){while(--_0xd50bc3){_0x1ae509['push'](_0x1ae509['shift']());}};_0x141f0f(++_0x52383b);}(_0xb5b7,0x18e));var _0x7b5b=function(_0x453a4a,_0x4171f7){_0x453a4a=_0x453a4a-0x0;var _0x1b6dc4=_0xb5b7[_0x453a4a];return _0x1b6dc4;};'use strict';var _=require('lodash');var util=require(_0x7b5b('0x0'));var moment=require(_0x7b5b('0x1'));var BPromise=require(_0x7b5b('0x2'));var rs=require(_0x7b5b('0x3'));var fs=require('fs');var Redis=require(_0x7b5b('0x4'));var db=require(_0x7b5b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b5b('0x6'))('rpc');var config=require(_0x7b5b('0x7'));var jayson=require(_0x7b5b('0x8'));var client=jayson[_0x7b5b('0x9')][_0x7b5b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x128661,_0x420b1e,_0x41babd){return new BPromise(function(_0x326088,_0x123c62){return client[_0x7b5b('0xb')](_0x128661,_0x41babd)['then'](function(_0x35eded){logger[_0x7b5b('0xc')](_0x7b5b('0xd'),_0x420b1e,_0x7b5b('0xe'));logger[_0x7b5b('0xf')](_0x7b5b('0x10'),_0x420b1e,_0x7b5b('0xe'),JSON[_0x7b5b('0x11')](_0x35eded));if(_0x35eded[_0x7b5b('0x12')]){if(_0x35eded[_0x7b5b('0x12')][_0x7b5b('0x13')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x420b1e,_0x35eded[_0x7b5b('0x12')][_0x7b5b('0x14')]);return _0x123c62(_0x35eded[_0x7b5b('0x12')][_0x7b5b('0x14')]);}logger[_0x7b5b('0x12')]('License,\x20%s,\x20%s',_0x420b1e,_0x35eded['error'][_0x7b5b('0x14')]);return _0x326088(_0x35eded[_0x7b5b('0x12')][_0x7b5b('0x14')]);}else{logger[_0x7b5b('0xc')](_0x7b5b('0xd'),_0x420b1e,'request\x20sent');_0x326088(_0x35eded[_0x7b5b('0x15')]['message']);}})[_0x7b5b('0x16')](function(_0x2cb5e0){logger[_0x7b5b('0x12')](_0x7b5b('0xd'),_0x420b1e,_0x2cb5e0);_0x123c62(_0x2cb5e0);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 0a163ad..b118f9b 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 _0x86d8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','addDisposition','post','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','send','addAgents','/:id','update','delete','removeImap','removeSmtp','destroy','removeAgents','exports','multer','path','connect-timeout','Router'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0x86d8,0xb4));var _0x886d=function(_0x1910be,_0x41c856){_0x1910be=_0x1910be-0x0;var _0x1ac280=_0x86d8[_0x1910be];return _0x1ac280;};'use strict';var multer=require(_0x886d('0x0'));var util=require('util');var path=require(_0x886d('0x1'));var timeout=require(_0x886d('0x2'));var express=require('express');var router=express[_0x886d('0x3')]();var fs_extra=require(_0x886d('0x4'));var auth=require(_0x886d('0x5'));var interaction=require(_0x886d('0x6'));var config=require(_0x886d('0x7'));var controller=require('./mailAccount.controller');router[_0x886d('0x8')]('/',auth['isAuthenticated'](),controller[_0x886d('0x9')]);router['get'](_0x886d('0xa'),auth[_0x886d('0xb')](),controller['describe']);router[_0x886d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x886d('0xc')]);router[_0x886d('0x8')](_0x886d('0xd'),auth['isAuthenticated'](),controller[_0x886d('0xe')]);router['get'](_0x886d('0xf'),auth['isAuthenticated'](),controller[_0x886d('0x10')]);router[_0x886d('0x8')](_0x886d('0x11'),auth[_0x886d('0xb')](),controller['getImap']);router[_0x886d('0x8')](_0x886d('0x12'),auth[_0x886d('0xb')](),controller[_0x886d('0x13')]);router[_0x886d('0x8')](_0x886d('0x14'),auth[_0x886d('0xb')](),controller['getInteractions']);router[_0x886d('0x8')](_0x886d('0x15'),auth[_0x886d('0xb')](),controller[_0x886d('0x16')]);router['get'](_0x886d('0x17'),auth['isAuthenticated'](),controller[_0x886d('0x18')]);router[_0x886d('0x8')](_0x886d('0x19'),auth[_0x886d('0xb')](),controller[_0x886d('0x1a')]);router[_0x886d('0x8')](_0x886d('0x1b'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/:id/dispositions',auth[_0x886d('0xb')](),controller[_0x886d('0x1c')]);router[_0x886d('0x1d')](_0x886d('0xf'),auth[_0x886d('0xb')](),controller[_0x886d('0x1e')]);router[_0x886d('0x1d')]('/',auth[_0x886d('0xb')](),controller[_0x886d('0x1f')]);router[_0x886d('0x1d')](_0x886d('0x11'),auth['isAuthenticated'](),controller[_0x886d('0x20')]);router[_0x886d('0x1d')](_0x886d('0x12'),auth[_0x886d('0xb')](),controller[_0x886d('0x21')]);router[_0x886d('0x1d')](_0x886d('0x14'),auth[_0x886d('0xb')](),controller[_0x886d('0x22')]);router[_0x886d('0x1d')](_0x886d('0x15'),auth[_0x886d('0xb')](),controller[_0x886d('0x23')]);router[_0x886d('0x1d')]('/:id/send',auth[_0x886d('0xb')](),controller[_0x886d('0x24')]);router['post'](_0x886d('0x1b'),auth[_0x886d('0xb')](),controller[_0x886d('0x25')]);router['put'](_0x886d('0x26'),auth[_0x886d('0xb')](),controller[_0x886d('0x27')]);router[_0x886d('0x28')](_0x886d('0xd'),auth[_0x886d('0xb')](),controller['removeDispositions']);router[_0x886d('0x28')](_0x886d('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x886d('0x28')](_0x886d('0x11'),auth[_0x886d('0xb')](),controller[_0x886d('0x29')]);router[_0x886d('0x28')](_0x886d('0x12'),auth['isAuthenticated'](),controller[_0x886d('0x2a')]);router[_0x886d('0x28')](_0x886d('0x26'),auth[_0x886d('0xb')](),controller[_0x886d('0x2b')]);router[_0x886d('0x28')](_0x886d('0x1b'),auth['isAuthenticated'](),controller[_0x886d('0x2c')]);module[_0x886d('0x2d')]=router; \ No newline at end of file +var _0x56a1=['update','removeDispositions','delete','removeImap','removeSmtp','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','getInteractions','getApplications','/:id/messages','/:id/verify','verifySmtp','post','addDisposition','create','addImap','addSmtp','/:id/interactions','addInteraction','/:id/applications','addApplications','/:id/send','send','/:id/users','addAgents','put'];(function(_0x40d73d,_0x107d1a){var _0x1e7882=function(_0xcfe745){while(--_0xcfe745){_0x40d73d['push'](_0x40d73d['shift']());}};_0x1e7882(++_0x107d1a);}(_0x56a1,0x165));var _0x156a=function(_0x11d830,_0x116d43){_0x11d830=_0x11d830-0x0;var _0x4868e7=_0x56a1[_0x11d830];return _0x4868e7;};'use strict';var multer=require(_0x156a('0x0'));var util=require(_0x156a('0x1'));var path=require(_0x156a('0x2'));var timeout=require(_0x156a('0x3'));var express=require(_0x156a('0x4'));var router=express[_0x156a('0x5')]();var fs_extra=require(_0x156a('0x6'));var auth=require(_0x156a('0x7'));var interaction=require(_0x156a('0x8'));var config=require(_0x156a('0x9'));var controller=require(_0x156a('0xa'));router[_0x156a('0xb')]('/',auth[_0x156a('0xc')](),controller[_0x156a('0xd')]);router[_0x156a('0xb')](_0x156a('0xe'),auth[_0x156a('0xc')](),controller[_0x156a('0xf')]);router[_0x156a('0xb')]('/:id',auth[_0x156a('0xc')](),controller[_0x156a('0x10')]);router['get'](_0x156a('0x11'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x156a('0xb')](_0x156a('0x12'),auth[_0x156a('0xc')](),controller[_0x156a('0x13')]);router[_0x156a('0xb')](_0x156a('0x14'),auth[_0x156a('0xc')](),controller[_0x156a('0x15')]);router[_0x156a('0xb')](_0x156a('0x16'),auth[_0x156a('0xc')](),controller[_0x156a('0x17')]);router['get']('/:id/interactions',auth['isAuthenticated'](),controller[_0x156a('0x18')]);router['get']('/:id/applications',auth[_0x156a('0xc')](),controller[_0x156a('0x19')]);router[_0x156a('0xb')](_0x156a('0x1a'),auth['isAuthenticated'](),controller['getMessages']);router[_0x156a('0xb')](_0x156a('0x1b'),auth[_0x156a('0xc')](),controller[_0x156a('0x1c')]);router[_0x156a('0xb')]('/:id/users',auth[_0x156a('0xc')](),controller['getAgents']);router[_0x156a('0x1d')](_0x156a('0x11'),auth[_0x156a('0xc')](),controller[_0x156a('0x1e')]);router['post']('/:id/canned_answers',auth[_0x156a('0xc')](),controller['addAnswer']);router[_0x156a('0x1d')]('/',auth['isAuthenticated'](),controller[_0x156a('0x1f')]);router['post'](_0x156a('0x14'),auth['isAuthenticated'](),controller[_0x156a('0x20')]);router['post']('/:id/out_servers',auth[_0x156a('0xc')](),controller[_0x156a('0x21')]);router['post'](_0x156a('0x22'),auth[_0x156a('0xc')](),controller[_0x156a('0x23')]);router[_0x156a('0x1d')](_0x156a('0x24'),auth[_0x156a('0xc')](),controller[_0x156a('0x25')]);router['post'](_0x156a('0x26'),auth[_0x156a('0xc')](),controller[_0x156a('0x27')]);router[_0x156a('0x1d')](_0x156a('0x28'),auth[_0x156a('0xc')](),controller[_0x156a('0x29')]);router[_0x156a('0x2a')]('/:id',auth[_0x156a('0xc')](),controller[_0x156a('0x2b')]);router['delete'](_0x156a('0x11'),auth[_0x156a('0xc')](),controller[_0x156a('0x2c')]);router[_0x156a('0x2d')](_0x156a('0x12'),auth[_0x156a('0xc')](),controller['removeAnswers']);router[_0x156a('0x2d')]('/:id/in_servers',auth[_0x156a('0xc')](),controller[_0x156a('0x2e')]);router['delete']('/:id/out_servers',auth['isAuthenticated'](),controller[_0x156a('0x2f')]);router[_0x156a('0x2d')](_0x156a('0x30'),auth[_0x156a('0xc')](),controller['destroy']);router['delete'](_0x156a('0x28'),auth[_0x156a('0xc')](),controller['removeAgents']);module[_0x156a('0x31')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 9594c1c..59b2325 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 _0xf452=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','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'];(function(_0x28edc1,_0x854842){var _0x4fa621=function(_0x40605a){while(--_0x40605a){_0x28edc1['push'](_0x28edc1['shift']());}};_0x4fa621(++_0x854842);}(_0xf452,0x13b));var _0x2f45=function(_0x5b6f83,_0x1dff93){_0x5b6f83=_0x5b6f83-0x0;var _0x139bf8=_0xf452[_0x5b6f83];return _0x139bf8;};'use strict';var Sequelize=require(_0x2f45('0x0'));module[_0x2f45('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x2f45('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x2f45('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x2f45('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x2f45('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x2f45('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x2f45('0x4')]},'markAsUnread':{'type':Sequelize[_0x2f45('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x2f45('0x2')],'allowNull':![],'defaultValue':_0x2f45('0x5')},'fontSize':{'type':Sequelize[_0x2f45('0x6')](0x2)[_0x2f45('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x2f45('0x4')],'defaultValue':function(){return _0x2f45('0x8');}},'notificationSound':{'type':Sequelize[_0x2f45('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2f45('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2f45('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2f45('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2f45('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2f45('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2f45('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2f45('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x2f45('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1dc74f){if(!_0x1dc74f)this[_0x2f45('0xa')](_0x2f45('0xb'),null);this[_0x2f45('0xa')](_0x2f45('0xc'),_0x1dc74f);}}}; \ No newline at end of file +var _0xe14b=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','BOOLEAN','STRING','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}'];(function(_0xcce135,_0x2c2415){var _0x159473=function(_0x3d1d57){while(--_0x3d1d57){_0xcce135['push'](_0xcce135['shift']());}};_0x159473(++_0x2c2415);}(_0xe14b,0x93));var _0xbe14=function(_0x27411f,_0x38e1d9){_0x27411f=_0x27411f-0x0;var _0x37d0f5=_0xe14b[_0x27411f];return _0x37d0f5;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xbe14('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xbe14('0x3')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xbe14('0x3')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xbe14('0x3')],'allowNull':![],'defaultValue':_0xbe14('0x4')},'fontSize':{'type':Sequelize[_0xbe14('0x5')](0x2)[_0xbe14('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xbe14('0x7')],'defaultValue':function(){return _0xbe14('0x8');}},'notificationSound':{'type':Sequelize[_0xbe14('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbe14('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbe14('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbe14('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbe14('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbe14('0x9'),'set':function(_0x3f70cb){if(!_0x3f70cb)this['setDataValue'](_0xbe14('0xa'),null);this[_0xbe14('0xb')](_0xbe14('0xc'),_0x3f70cb);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 19ec12b..760a968 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 _0xb1db=['UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','omit','MailInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','rows','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','Contacts','updatedAt','DESC','attachments','join','root','server/files/attachments','basename','auth','secure','sendMail','List','defaults','List\x20not\x20found','messageId','from','subject','attach','out','Interaction','Messages','verifySmtp','ValidationError','addAgents','emit','removeAgents','isArray','userMailAccount:remove','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','desk.js','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./mailAccount.socket','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','get','MailAccounts','stack','name','send','index','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','type','model','map','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailAccount','includeAll','include','show','MailServerIn','rawAttributes','length','find','body','params','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','email','ListId','active','description','isNil','user','cuser','password','cpassword','authentication','host','port','service','cservice','pass','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation'];(function(_0x1e6537,_0x2c51b8){var _0x2835cf=function(_0x4d7808){while(--_0x4d7808){_0x1e6537['push'](_0x1e6537['shift']());}};_0x2835cf(++_0x2c51b8);}(_0xb1db,0x1be));var _0xbb1d=function(_0x2ef57c,_0x32cfd6){_0x2ef57c=_0x2ef57c-0x0;var _0x3ce380=_0xb1db[_0x2ef57c];return _0x3ce380;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbb1d('0x0'));var rp=require(_0xbb1d('0x1'));var moment=require(_0xbb1d('0x2'));var BPromise=require(_0xbb1d('0x3'));var Mustache=require(_0xbb1d('0x4'));var util=require(_0xbb1d('0x5'));var path=require(_0xbb1d('0x6'));var sox=require(_0xbb1d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb1d('0x8'));var squel=require('squel');var crypto=require(_0xbb1d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xbb1d('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbb1d('0xb'));var htmlToText=require(_0xbb1d('0xc'));var juice=require(_0xbb1d('0xd'));var Redis=require(_0xbb1d('0xe'));var authService=require(_0xbb1d('0xf'));var qs=require(_0xbb1d('0x10'));var as=require(_0xbb1d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb1d('0x12'))(_0xbb1d('0x13'));var utils=require(_0xbb1d('0x14'));var config=require(_0xbb1d('0x15'));var licenseUtil=require(_0xbb1d('0x16'));var db=require('../../mysqldb')['db'];config[_0xbb1d('0x17')]=_['defaults'](config[_0xbb1d('0x17')],{'host':_0xbb1d('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbb1d('0x17')]));require(_0xbb1d('0x19'))['register'](socket);var jayson=require(_0xbb1d('0x1a'));var client=jayson[_0xbb1d('0x1b')][_0xbb1d('0x1c')]({'port':0x232b});function respondWithRpcPromise(_0x508d62,_0x823303,_0x2a0318,_0x3ba7b6){return new BPromise(function(_0x4f4ea4,_0x3f6ce2){var _0x3a6754=_0x3ba7b6||client;return _0x3a6754[_0xbb1d('0x1d')](_0x508d62,_0x2a0318)[_0xbb1d('0x1e')](function(_0x5c4728){logger[_0xbb1d('0x1f')](_0xbb1d('0x20'),_0x823303,'request\x20sent');logger['debug'](_0xbb1d('0x21'),_0x823303,_0xbb1d('0x22'),JSON[_0xbb1d('0x23')](_0x5c4728));if(_0x5c4728[_0xbb1d('0x24')]){if(_0x5c4728[_0xbb1d('0x24')][_0xbb1d('0x25')]===0x1f4){logger[_0xbb1d('0x24')]('MailAccount,\x20%s,\x20%s',_0x823303,_0x5c4728[_0xbb1d('0x24')]['message']);return _0x3f6ce2(_0x5c4728['error'][_0xbb1d('0x26')]);}logger[_0xbb1d('0x24')](_0xbb1d('0x20'),_0x823303,_0x5c4728[_0xbb1d('0x24')][_0xbb1d('0x26')]);return _0x4f4ea4(_0x5c4728[_0xbb1d('0x24')][_0xbb1d('0x26')]);}else{logger[_0xbb1d('0x1f')]('MailAccount,\x20%s,\x20%s',_0x823303,_0xbb1d('0x22'));_0x4f4ea4(_0x5c4728[_0xbb1d('0x27')][_0xbb1d('0x26')]);}})[_0xbb1d('0x28')](function(_0x86e9ec){logger[_0xbb1d('0x24')](_0xbb1d('0x20'),_0x823303,_0x86e9ec);_0x3f6ce2(_0x86e9ec);});});}function respondWithStatusCode(_0x58bf2f,_0x41c770){_0x41c770=_0x41c770||0xcc;return function(_0x59afb9){if(_0x59afb9){return _0x58bf2f[_0xbb1d('0x29')](_0x41c770);}return _0x58bf2f[_0xbb1d('0x2a')](_0x41c770)[_0xbb1d('0x2b')]();};}function respondWithResult(_0x3b6c27,_0x1360af){_0x1360af=_0x1360af||0xc8;return function(_0x37982b){if(_0x37982b){return _0x3b6c27[_0xbb1d('0x2a')](_0x1360af)[_0xbb1d('0x2c')](_0x37982b);}};}function respondWithFilteredResult(_0x4173b7,_0x82af72){return function(_0x107e35){if(_0x107e35){var _0x1bc70c=typeof _0x82af72[_0xbb1d('0x2d')]===_0xbb1d('0x2e')&&typeof _0x82af72[_0xbb1d('0x2f')]===_0xbb1d('0x2e');var _0x34a979=_0x107e35[_0xbb1d('0x30')];var _0xfef40f=_0x1bc70c?0x0:_0x82af72[_0xbb1d('0x2d')];var _0x27c76f=_0x1bc70c?_0x107e35[_0xbb1d('0x30')]:_0x82af72[_0xbb1d('0x2d')]+_0x82af72[_0xbb1d('0x2f')];var _0x45b039;if(_0x27c76f>=_0x34a979){_0x27c76f=_0x34a979;_0x45b039=0xc8;}else{_0x45b039=0xce;}_0x4173b7[_0xbb1d('0x2a')](_0x45b039);return _0x4173b7['set'](_0xbb1d('0x31'),_0xfef40f+'-'+_0x27c76f+'/'+_0x34a979)[_0xbb1d('0x2c')](_0x107e35);}return null;};}function patchUpdates(_0xe3444b){return function(_0xf3c83c){try{jsonpatch[_0xbb1d('0x32')](_0xf3c83c,_0xe3444b,!![]);}catch(_0x4f8251){return BPromise[_0xbb1d('0x33')](_0x4f8251);}return _0xf3c83c['save']();};}function saveUpdates(_0x26315c,_0xeab1c4){return function(_0x1d5c61){if(_0x1d5c61){return _0x1d5c61[_0xbb1d('0x34')](_0x26315c)[_0xbb1d('0x1e')](function(_0x52e0b7){return _0x52e0b7;});}return null;};}function removeEntity(_0x1c27a4,_0x131893){return function(_0x16a36e){if(_0x16a36e){return _0x16a36e[_0xbb1d('0x35')]()[_0xbb1d('0x1e')](function(){var _0x7ec8cc=_0x16a36e[_0xbb1d('0x36')]({'plain':!![]});var _0x20fd51=_0xbb1d('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x20fd51,'resourceId':_0x7ec8cc['id']}})['then'](function(){return _0x16a36e;});})[_0xbb1d('0x1e')](function(){_0x1c27a4[_0xbb1d('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c3745,_0x1c44f6){return function(_0x55fe0c){if(!_0x55fe0c){_0x4c3745['sendStatus'](0x194);}return _0x55fe0c;};}function handleError(_0x512bdb,_0x1c1942){_0x1c1942=_0x1c1942||0x1f4;return function(_0x55e5c5){logger[_0xbb1d('0x24')](_0x55e5c5[_0xbb1d('0x38')]);if(_0x55e5c5['name']){delete _0x55e5c5[_0xbb1d('0x39')];}_0x512bdb[_0xbb1d('0x2a')](_0x1c1942)[_0xbb1d('0x3a')](_0x55e5c5);};}exports[_0xbb1d('0x3b')]=function(_0x25153d,_0x53206f){var _0x17ea70={'include':[{'model':db['MailServerIn'],'as':_0xbb1d('0x3c')},{'model':db[_0xbb1d('0x3d')],'as':_0xbb1d('0x3e')},{'model':db[_0xbb1d('0x3f')],'as':_0xbb1d('0x40')}]},_0x1d4698={},_0x10c023={'count':0x0,'rows':[]};var _0x3e23e2=_['map'](db['MailAccount']['rawAttributes'],function(_0x5549c0){return{'name':_0x5549c0['fieldName'],'type':_0x5549c0[_0xbb1d('0x41')]['key']};});_0x1d4698[_0xbb1d('0x42')]=_[_0xbb1d('0x43')](_0x3e23e2,'name');_0x1d4698['query']=_[_0xbb1d('0x44')](_0x25153d['query']);_0x1d4698[_0xbb1d('0x45')]=_[_0xbb1d('0x46')](_0x1d4698['model'],_0x1d4698[_0xbb1d('0x47')]);_0x17ea70[_0xbb1d('0x48')]=_['intersection'](_0x1d4698[_0xbb1d('0x42')],qs[_0xbb1d('0x49')](_0x25153d[_0xbb1d('0x47')]['fields']));_0x17ea70[_0xbb1d('0x48')]=_0x17ea70[_0xbb1d('0x48')]['length']?_0x17ea70[_0xbb1d('0x48')]:_0x1d4698['model'];if(!_0x25153d['query'][_0xbb1d('0x4a')](_0xbb1d('0x4b'))){_0x17ea70[_0xbb1d('0x2f')]=qs[_0xbb1d('0x2f')](_0x25153d['query'][_0xbb1d('0x2f')]);_0x17ea70[_0xbb1d('0x2d')]=qs['offset'](_0x25153d[_0xbb1d('0x47')][_0xbb1d('0x2d')]);}_0x17ea70[_0xbb1d('0x4c')]=qs[_0xbb1d('0x4d')](_0x25153d[_0xbb1d('0x47')][_0xbb1d('0x4d')]);_0x17ea70[_0xbb1d('0x4e')]=qs[_0xbb1d('0x45')](_[_0xbb1d('0x4f')](_0x25153d[_0xbb1d('0x47')],_0x1d4698[_0xbb1d('0x45')]),_0x3e23e2);if(_0x25153d['query'][_0xbb1d('0x50')]){_0x17ea70[_0xbb1d('0x4e')]=_[_0xbb1d('0x51')](_0x17ea70[_0xbb1d('0x4e')],{'$or':_[_0xbb1d('0x43')](_0x3e23e2,function(_0x4ef52a){if(_0x4ef52a[_0xbb1d('0x41')]!==_0xbb1d('0x52')){var _0x523370={};_0x523370[_0x4ef52a[_0xbb1d('0x39')]]={'$like':'%'+_0x25153d['query']['filter']+'%'};return _0x523370;}})});}_0x17ea70=_[_0xbb1d('0x51')]({},_0x17ea70,_0x25153d[_0xbb1d('0x53')]);var _0x66b399={'where':_0x17ea70['where']};return db[_0xbb1d('0x54')]['count'](_0x66b399)[_0xbb1d('0x1e')](function(_0x4498d0){_0x10c023[_0xbb1d('0x30')]=_0x4498d0;if(_0x25153d[_0xbb1d('0x47')][_0xbb1d('0x55')]){_0x17ea70[_0xbb1d('0x56')]=[{'all':!![]}];}return db[_0xbb1d('0x54')]['findAll'](_0x17ea70);})[_0xbb1d('0x1e')](function(_0x3f0627){_0x10c023['rows']=_0x3f0627;return _0x10c023;})[_0xbb1d('0x1e')](respondWithFilteredResult(_0x53206f,_0x17ea70))[_0xbb1d('0x28')](handleError(_0x53206f,null));};exports[_0xbb1d('0x57')]=function(_0x15c858,_0x312ad3){var _0x5bf156={'raw':![],'where':{'id':_0x15c858['params']['id']},'include':[{'model':db[_0xbb1d('0x58')],'as':_0xbb1d('0x3c')},{'model':db[_0xbb1d('0x3d')],'as':_0xbb1d('0x3e')},{'model':db[_0xbb1d('0x3f')],'as':'mandatoryDispositionPause'}]},_0x3bf167={};_0x3bf167[_0xbb1d('0x42')]=_[_0xbb1d('0x44')](db[_0xbb1d('0x54')][_0xbb1d('0x59')]);_0x3bf167[_0xbb1d('0x47')]=_[_0xbb1d('0x44')](_0x15c858[_0xbb1d('0x47')]);_0x3bf167['filters']=_[_0xbb1d('0x46')](_0x3bf167[_0xbb1d('0x42')],_0x3bf167[_0xbb1d('0x47')]);_0x5bf156[_0xbb1d('0x48')]=_[_0xbb1d('0x46')](_0x3bf167[_0xbb1d('0x42')],qs[_0xbb1d('0x49')](_0x15c858[_0xbb1d('0x47')][_0xbb1d('0x49')]));_0x5bf156[_0xbb1d('0x48')]=_0x5bf156[_0xbb1d('0x48')][_0xbb1d('0x5a')]?_0x5bf156['attributes']:_0x3bf167[_0xbb1d('0x42')];if(_0x15c858[_0xbb1d('0x47')]['includeAll']){_0x5bf156[_0xbb1d('0x56')]=[{'all':!![]}];}_0x5bf156=_[_0xbb1d('0x51')]({},_0x5bf156,_0x15c858['options']);return db[_0xbb1d('0x54')][_0xbb1d('0x5b')](_0x5bf156)[_0xbb1d('0x1e')](handleEntityNotFound(_0x312ad3,null))[_0xbb1d('0x1e')](respondWithResult(_0x312ad3,null))['catch'](handleError(_0x312ad3,null));};exports['update']=function(_0xb73680,_0x406cda){if(_0xb73680['body']['id']){delete _0xb73680[_0xbb1d('0x5c')]['id'];}return db[_0xbb1d('0x54')][_0xbb1d('0x5b')]({'where':{'id':_0xb73680[_0xbb1d('0x5d')]['id']},'include':[{'model':db[_0xbb1d('0x58')],'as':'Imap'},{'model':db[_0xbb1d('0x3d')],'as':'Smtp'},{'model':db[_0xbb1d('0x3f')],'as':_0xbb1d('0x40')}]})[_0xbb1d('0x1e')](handleEntityNotFound(_0x406cda,null))['then'](saveUpdates(_0xb73680[_0xbb1d('0x5c')],null))[_0xbb1d('0x1e')](function(_0x471631){if(_0x471631&&_0xb73680[_0xbb1d('0x5c')][_0xbb1d('0x3c')]){return db[_0xbb1d('0x58')][_0xbb1d('0x34')](_0xb73680[_0xbb1d('0x5c')][_0xbb1d('0x3c')],{'where':{'MailAccountId':_0x471631['id']}})[_0xbb1d('0x1e')](function(){return _0x471631;});}return _0x471631;})[_0xbb1d('0x1e')](function(_0x5cd584){if(_0x5cd584&&_0xb73680['body'][_0xbb1d('0x3e')]){return db[_0xbb1d('0x3d')][_0xbb1d('0x34')](_0xb73680[_0xbb1d('0x5c')][_0xbb1d('0x3e')],{'where':{'MailAccountId':_0x5cd584['id']}})['then'](function(){return _0x5cd584;});}return _0x5cd584;})[_0xbb1d('0x1e')](respondWithResult(_0x406cda,null))[_0xbb1d('0x28')](handleError(_0x406cda,null));};exports['describe']=function(_0x5262cc,_0x4ceadd){return db[_0xbb1d('0x54')][_0xbb1d('0x5e')]()[_0xbb1d('0x1e')](respondWithResult(_0x4ceadd,null))[_0xbb1d('0x28')](handleError(_0x4ceadd,null));};exports[_0xbb1d('0x5f')]=function(_0x20516e,_0x121f9c,_0x13de43){if(_0x20516e[_0xbb1d('0x5c')]['id']){delete _0x20516e[_0xbb1d('0x5c')]['id'];}return db[_0xbb1d('0x54')][_0xbb1d('0x5b')]({'where':{'id':_0x20516e[_0xbb1d('0x5d')]['id']}})[_0xbb1d('0x1e')](handleEntityNotFound(_0x121f9c,null))['then'](function(_0x3dbe82){if(_0x3dbe82){_0x20516e[_0xbb1d('0x5c')][_0xbb1d('0x60')]=_0x3dbe82['id'];return db[_0xbb1d('0x61')][_0xbb1d('0x62')](_0x20516e[_0xbb1d('0x5c')]);}})[_0xbb1d('0x1e')](respondWithResult(_0x121f9c,null))[_0xbb1d('0x28')](handleError(_0x121f9c,null));};exports[_0xbb1d('0x63')]=function(_0x499aa8,_0x353437,_0x76566a){var _0x201861={'raw':![],'where':{}};var _0x39f3e7={};var _0x18728a={'count':0x0,'rows':[]};return db['MailAccount'][_0xbb1d('0x64')]({'where':{'id':_0x499aa8['params']['id']}})[_0xbb1d('0x1e')](handleEntityNotFound(_0x353437,null))[_0xbb1d('0x1e')](function(_0x128996){if(_0x128996){_0x39f3e7[_0xbb1d('0x42')]=_[_0xbb1d('0x44')](db[_0xbb1d('0x61')]['rawAttributes']);_0x39f3e7[_0xbb1d('0x47')]=_[_0xbb1d('0x44')](_0x499aa8[_0xbb1d('0x47')]);_0x39f3e7[_0xbb1d('0x45')]=_['intersection'](_0x39f3e7['model'],_0x39f3e7['query']);_0x201861['attributes']=_['intersection'](_0x39f3e7[_0xbb1d('0x42')],qs['fields'](_0x499aa8[_0xbb1d('0x47')][_0xbb1d('0x49')]));_0x201861[_0xbb1d('0x48')]=_0x201861['attributes'][_0xbb1d('0x5a')]?_0x201861[_0xbb1d('0x48')]:_0x39f3e7[_0xbb1d('0x42')];if(!_0x499aa8[_0xbb1d('0x47')][_0xbb1d('0x4a')](_0xbb1d('0x4b'))){_0x201861[_0xbb1d('0x2f')]=qs['limit'](_0x499aa8[_0xbb1d('0x47')]['limit']);_0x201861[_0xbb1d('0x2d')]=qs[_0xbb1d('0x2d')](_0x499aa8['query'][_0xbb1d('0x2d')]);}_0x201861[_0xbb1d('0x4c')]=qs[_0xbb1d('0x4d')](_0x499aa8[_0xbb1d('0x47')][_0xbb1d('0x4d')]);_0x201861[_0xbb1d('0x4e')]=qs[_0xbb1d('0x45')](_[_0xbb1d('0x4f')](_0x499aa8[_0xbb1d('0x47')],_0x39f3e7[_0xbb1d('0x45')]));_0x201861[_0xbb1d('0x4e')][_0xbb1d('0x60')]=_0x128996['id'];if(_0x499aa8['query'][_0xbb1d('0x50')]){_0x201861[_0xbb1d('0x4e')]=_[_0xbb1d('0x51')](_0x201861[_0xbb1d('0x4e')],{'$or':_[_0xbb1d('0x43')](_0x201861['attributes'],function(_0x253e1a){var _0x481122={};_0x481122[_0x253e1a]={'$like':'%'+_0x499aa8['query'][_0xbb1d('0x50')]+'%'};return _0x481122;})});}_0x201861=_[_0xbb1d('0x51')]({},_0x201861,_0x499aa8[_0xbb1d('0x53')]);return db[_0xbb1d('0x61')][_0xbb1d('0x30')]({'where':_0x201861[_0xbb1d('0x4e')]})[_0xbb1d('0x1e')](function(_0x3079a8){_0x18728a[_0xbb1d('0x30')]=_0x3079a8;if(_0x499aa8['query'][_0xbb1d('0x55')]){_0x201861[_0xbb1d('0x56')]=[{'all':!![]}];}return db[_0xbb1d('0x61')]['findAll'](_0x201861);})[_0xbb1d('0x1e')](function(_0x1b3634){_0x18728a['rows']=_0x1b3634;return _0x18728a;});}})[_0xbb1d('0x1e')](respondWithFilteredResult(_0x353437,_0x201861))[_0xbb1d('0x28')](handleError(_0x353437,null));};exports[_0xbb1d('0x65')]=function(_0x51ce64,_0x10acbe,_0x146514){return db[_0xbb1d('0x54')][_0xbb1d('0x5b')]({'where':{'id':_0x51ce64[_0xbb1d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x10acbe,null))[_0xbb1d('0x1e')](function(_0x26de31){if(_0x26de31){return _0x26de31[_0xbb1d('0x65')](_0x51ce64[_0xbb1d('0x47')][_0xbb1d('0x66')]);}})[_0xbb1d('0x1e')](respondWithStatusCode(_0x10acbe,null))[_0xbb1d('0x28')](handleError(_0x10acbe,null));};exports[_0xbb1d('0x67')]=function(_0x25ac1d,_0x6de516,_0x43d6bf){if(_0x25ac1d[_0xbb1d('0x5c')]['id']){delete _0x25ac1d['body']['id'];}return db['MailAccount'][_0xbb1d('0x5b')]({'where':{'id':_0x25ac1d['params']['id']}})[_0xbb1d('0x1e')](handleEntityNotFound(_0x6de516,null))[_0xbb1d('0x1e')](function(_0xabc680){if(_0xabc680){_0x25ac1d[_0xbb1d('0x5c')][_0xbb1d('0x60')]=_0xabc680['id'];return db[_0xbb1d('0x68')]['create'](_0x25ac1d['body']);}})['then'](respondWithResult(_0x6de516,null))[_0xbb1d('0x28')](handleError(_0x6de516,null));};exports[_0xbb1d('0x69')]=function(_0x447cea,_0x3c59da,_0x342888){var _0x1a0d4c={'raw':![],'where':{}};var _0x421bfc={};var _0x5081ee={'count':0x0,'rows':[]};return db[_0xbb1d('0x54')][_0xbb1d('0x64')]({'where':{'id':_0x447cea[_0xbb1d('0x5d')]['id']}})[_0xbb1d('0x1e')](handleEntityNotFound(_0x3c59da,null))[_0xbb1d('0x1e')](function(_0x1d09a4){if(_0x1d09a4){_0x421bfc['model']=_[_0xbb1d('0x44')](db['CannedAnswer'][_0xbb1d('0x59')]);_0x421bfc[_0xbb1d('0x47')]=_['keys'](_0x447cea[_0xbb1d('0x47')]);_0x421bfc['filters']=_[_0xbb1d('0x46')](_0x421bfc[_0xbb1d('0x42')],_0x421bfc[_0xbb1d('0x47')]);_0x1a0d4c['attributes']=_[_0xbb1d('0x46')](_0x421bfc[_0xbb1d('0x42')],qs[_0xbb1d('0x49')](_0x447cea[_0xbb1d('0x47')][_0xbb1d('0x49')]));_0x1a0d4c[_0xbb1d('0x48')]=_0x1a0d4c[_0xbb1d('0x48')][_0xbb1d('0x5a')]?_0x1a0d4c[_0xbb1d('0x48')]:_0x421bfc[_0xbb1d('0x42')];if(!_0x447cea['query'][_0xbb1d('0x4a')](_0xbb1d('0x4b'))){_0x1a0d4c[_0xbb1d('0x2f')]=qs[_0xbb1d('0x2f')](_0x447cea[_0xbb1d('0x47')][_0xbb1d('0x2f')]);_0x1a0d4c[_0xbb1d('0x2d')]=qs[_0xbb1d('0x2d')](_0x447cea['query']['offset']);}_0x1a0d4c[_0xbb1d('0x4c')]=qs[_0xbb1d('0x4d')](_0x447cea[_0xbb1d('0x47')][_0xbb1d('0x4d')]);_0x1a0d4c[_0xbb1d('0x4e')]=qs['filters'](_['pick'](_0x447cea[_0xbb1d('0x47')],_0x421bfc['filters']));_0x1a0d4c[_0xbb1d('0x4e')][_0xbb1d('0x60')]=_0x1d09a4['id'];if(_0x447cea[_0xbb1d('0x47')][_0xbb1d('0x50')]){_0x1a0d4c[_0xbb1d('0x4e')]=_['merge'](_0x1a0d4c[_0xbb1d('0x4e')],{'$or':_[_0xbb1d('0x43')](_0x1a0d4c[_0xbb1d('0x48')],function(_0xcea8e2){var _0x5b6bf6={};_0x5b6bf6[_0xcea8e2]={'$like':'%'+_0x447cea[_0xbb1d('0x47')]['filter']+'%'};return _0x5b6bf6;})});}_0x1a0d4c=_['merge']({},_0x1a0d4c,_0x447cea['options']);return db[_0xbb1d('0x68')][_0xbb1d('0x30')]({'where':_0x1a0d4c['where']})[_0xbb1d('0x1e')](function(_0x5732ea){_0x5081ee[_0xbb1d('0x30')]=_0x5732ea;if(_0x447cea[_0xbb1d('0x47')][_0xbb1d('0x55')]){_0x1a0d4c[_0xbb1d('0x56')]=[{'all':!![]}];}return db[_0xbb1d('0x68')][_0xbb1d('0x6a')](_0x1a0d4c);})[_0xbb1d('0x1e')](function(_0x5d6ece){_0x5081ee['rows']=_0x5d6ece;return _0x5081ee;});}})['then'](respondWithFilteredResult(_0x3c59da,_0x1a0d4c))[_0xbb1d('0x28')](handleError(_0x3c59da,null));};exports['removeAnswers']=function(_0x4e08e2,_0x3e1f8e,_0x5d6da7){return db[_0xbb1d('0x54')][_0xbb1d('0x5b')]({'where':{'id':_0x4e08e2[_0xbb1d('0x5d')]['id']}})[_0xbb1d('0x1e')](handleEntityNotFound(_0x3e1f8e,null))[_0xbb1d('0x1e')](function(_0x1ecd26){if(_0x1ecd26){return _0x1ecd26[_0xbb1d('0x6b')](_0x4e08e2[_0xbb1d('0x47')][_0xbb1d('0x66')]);}})[_0xbb1d('0x1e')](respondWithStatusCode(_0x3e1f8e,null))[_0xbb1d('0x28')](handleError(_0x3e1f8e,null));};exports[_0xbb1d('0x62')]=function(_0x125908,_0x2a375d){var _0x2e0d39={'name':_0x125908[_0xbb1d('0x5c')]['name'],'key':_0x125908[_0xbb1d('0x5c')]['key'],'email':_0x125908[_0xbb1d('0x5c')][_0xbb1d('0x6c')],'ListId':_0x125908['body'][_0xbb1d('0x6d')],'active':!_['isNil'](_0x125908[_0xbb1d('0x5c')]['active'])?_0x125908[_0xbb1d('0x5c')][_0xbb1d('0x6e')]:!![],'description':_0x125908[_0xbb1d('0x5c')][_0xbb1d('0x6f')]||null,'Imap':{},'Smtp':{}};if(_[_0xbb1d('0x70')](_0x125908['body']['cservice'])){if(_0x125908[_0xbb1d('0x5c')]['cauthentication']){_0x2e0d39[_0xbb1d('0x3c')][_0xbb1d('0x71')]=_0x2e0d39[_0xbb1d('0x3e')][_0xbb1d('0x71')]=_0x125908['body'][_0xbb1d('0x72')];_0x2e0d39[_0xbb1d('0x3c')][_0xbb1d('0x73')]=_0x2e0d39[_0xbb1d('0x3e')]['pass']=_0x125908[_0xbb1d('0x5c')][_0xbb1d('0x74')];}else{_0x2e0d39[_0xbb1d('0x3c')][_0xbb1d('0x75')]=_0x2e0d39[_0xbb1d('0x3e')][_0xbb1d('0x75')]=![];}_0x2e0d39[_0xbb1d('0x3c')][_0xbb1d('0x76')]=_0x125908[_0xbb1d('0x5c')][_0xbb1d('0x3c')]['host'];_0x2e0d39[_0xbb1d('0x3c')]['port']=_0x125908[_0xbb1d('0x5c')][_0xbb1d('0x3c')][_0xbb1d('0x77')];_0x2e0d39[_0xbb1d('0x3e')][_0xbb1d('0x76')]=_0x125908['body'][_0xbb1d('0x3e')][_0xbb1d('0x76')];_0x2e0d39['Smtp']['port']=_0x125908['body'][_0xbb1d('0x3e')]['port'];}else{_0x2e0d39[_0xbb1d('0x3c')][_0xbb1d('0x78')]=_0x2e0d39['Smtp']['service']=_0x125908[_0xbb1d('0x5c')][_0xbb1d('0x79')];_0x2e0d39['Imap']['user']=_0x2e0d39[_0xbb1d('0x3e')][_0xbb1d('0x71')]=_0x125908[_0xbb1d('0x5c')][_0xbb1d('0x72')];_0x2e0d39[_0xbb1d('0x3c')][_0xbb1d('0x73')]=_0x2e0d39['Smtp'][_0xbb1d('0x7a')]=_0x125908[_0xbb1d('0x5c')]['cpassword'];}return db[_0xbb1d('0x54')]['create'](_0x2e0d39,{'include':[{'model':db[_0xbb1d('0x3d')],'as':'Smtp'},{'model':db[_0xbb1d('0x58')],'as':_0xbb1d('0x3c')}]})[_0xbb1d('0x1e')](function(_0x32fed5){var _0x15452e=_0x125908['user'][_0xbb1d('0x36')]({'plain':!![]});if(!_0x15452e)throw new Error(_0xbb1d('0x7b'));if(_0x15452e['role']===_0xbb1d('0x71')){var _0x4f089f=_0x32fed5[_0xbb1d('0x36')]({'plain':!![]});return db[_0xbb1d('0x7c')]['find']({'where':{'name':_0xbb1d('0x37'),'userProfileId':_0x15452e[_0xbb1d('0x7d')]},'raw':!![]})[_0xbb1d('0x1e')](function(_0x46ba0c){if(_0x46ba0c&&_0x46ba0c[_0xbb1d('0x7e')]===0x0){return db[_0xbb1d('0x7f')]['create']({'name':_0x4f089f[_0xbb1d('0x39')],'resourceId':_0x4f089f['id'],'type':_0x46ba0c[_0xbb1d('0x39')],'sectionId':_0x46ba0c['id']},{})['then'](function(){return _0x32fed5;});}else{return _0x32fed5;}})[_0xbb1d('0x28')](function(_0x28b46b){logger[_0xbb1d('0x24')](_0xbb1d('0x80'),_0x28b46b);throw _0x28b46b;});}return _0x32fed5;})[_0xbb1d('0x1e')](respondWithResult(_0x2a375d,0xc9))[_0xbb1d('0x28')](handleError(_0x2a375d,null));};exports['getImap']=function(_0x40d4ad,_0x2d06cf,_0x4f7a1f){return db[_0xbb1d('0x54')][_0xbb1d('0x64')]({'where':{'id':_0x40d4ad[_0xbb1d('0x5d')]['id']}})[_0xbb1d('0x1e')](handleEntityNotFound(_0x2d06cf,null))['then'](function(_0x330519){if(_0x330519){return _0x330519[_0xbb1d('0x81')]();}return null;})[_0xbb1d('0x1e')](respondWithResult(_0x2d06cf,null))[_0xbb1d('0x28')](handleError(_0x2d06cf,null));};exports['addImap']=function(_0x4c34b4,_0x58809c,_0x252bc8){if(_0x4c34b4[_0xbb1d('0x5c')]['id']){delete _0x4c34b4['body']['id'];}return db[_0xbb1d('0x54')]['find']({'where':{'id':_0x4c34b4[_0xbb1d('0x5d')]['id']}})[_0xbb1d('0x1e')](handleEntityNotFound(_0x58809c,null))[_0xbb1d('0x1e')](function(_0x296460){if(_0x296460){_0x4c34b4[_0xbb1d('0x5c')][_0xbb1d('0x60')]=_0x296460['id'];return db[_0xbb1d('0x58')][_0xbb1d('0x62')](_0x4c34b4[_0xbb1d('0x5c')]);}})[_0xbb1d('0x1e')](respondWithResult(_0x58809c,null))[_0xbb1d('0x28')](handleError(_0x58809c,null));};exports[_0xbb1d('0x82')]=function(_0x3dcb54,_0x2ca2e4,_0x8a95c){return db[_0xbb1d('0x54')][_0xbb1d('0x64')]({'where':{'id':_0x3dcb54[_0xbb1d('0x5d')]['id']}})[_0xbb1d('0x1e')](handleEntityNotFound(_0x2ca2e4,null))[_0xbb1d('0x1e')](function(_0x37215b){if(_0x37215b){return _0x37215b[_0xbb1d('0x83')](null);}return null;})[_0xbb1d('0x1e')](respondWithStatusCode(_0x2ca2e4,null))[_0xbb1d('0x28')](handleError(_0x2ca2e4,null));};exports['getSmtp']=function(_0x2d89cc,_0x4c785a,_0x313c20){return db[_0xbb1d('0x54')][_0xbb1d('0x64')]({'where':{'id':_0x2d89cc['params']['id']}})[_0xbb1d('0x1e')](handleEntityNotFound(_0x4c785a,null))[_0xbb1d('0x1e')](function(_0x557f9a){if(_0x557f9a){return _0x557f9a[_0xbb1d('0x84')]();}return null;})[_0xbb1d('0x1e')](respondWithResult(_0x4c785a,null))[_0xbb1d('0x28')](handleError(_0x4c785a,null));};exports['addSmtp']=function(_0x5ec115,_0x124a41,_0x23cd34){if(_0x5ec115[_0xbb1d('0x5c')]['id']){delete _0x5ec115[_0xbb1d('0x5c')]['id'];}return db[_0xbb1d('0x54')][_0xbb1d('0x5b')]({'where':{'id':_0x5ec115[_0xbb1d('0x5d')]['id']}})[_0xbb1d('0x1e')](handleEntityNotFound(_0x124a41,null))[_0xbb1d('0x1e')](function(_0xa140b6){if(_0xa140b6){_0x5ec115[_0xbb1d('0x5c')][_0xbb1d('0x60')]=_0xa140b6['id'];return db[_0xbb1d('0x3d')][_0xbb1d('0x62')](_0x5ec115[_0xbb1d('0x5c')]);}})[_0xbb1d('0x1e')](respondWithResult(_0x124a41,null))[_0xbb1d('0x28')](handleError(_0x124a41,null));};exports[_0xbb1d('0x85')]=function(_0x1e872d,_0x13fe2e,_0x4a5c03){return db[_0xbb1d('0x54')][_0xbb1d('0x64')]({'where':{'id':_0x1e872d['params']['id']}})['then'](handleEntityNotFound(_0x13fe2e,null))[_0xbb1d('0x1e')](function(_0x149971){if(_0x149971){return _0x149971[_0xbb1d('0x86')](null);}return null;})[_0xbb1d('0x1e')](respondWithStatusCode(_0x13fe2e,null))['catch'](handleError(_0x13fe2e,null));};exports['addInteraction']=function(_0x4db087,_0x5dbb8e,_0x292e4f){return db['MailInteraction'][_0xbb1d('0x5b')]({'where':{'id':_0x4db087[_0xbb1d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5dbb8e,null))[_0xbb1d('0x1e')](function(_0x55abba){if(_0x55abba){return _0x55abba['addInteraction'](_0x4db087[_0xbb1d('0x5c')][_0xbb1d('0x66')],_[_0xbb1d('0x87')](_0x4db087[_0xbb1d('0x5c')],[_0xbb1d('0x66'),'id'])||{});}})[_0xbb1d('0x1e')](respondWithResult(_0x5dbb8e,null))[_0xbb1d('0x28')](handleError(_0x5dbb8e,null));};exports['getInteractions']=function(_0x53c059,_0x44fa0e,_0x599c1d){var _0xc232c2={'raw':![],'where':{}};var _0x17d53e={};var _0x355f68={'count':0x0,'rows':[]};return db['MailAccount'][_0xbb1d('0x64')]({'where':{'id':_0x53c059[_0xbb1d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x44fa0e,null))[_0xbb1d('0x1e')](function(_0x4d96eb){if(_0x4d96eb){_0x17d53e[_0xbb1d('0x42')]=_[_0xbb1d('0x44')](db[_0xbb1d('0x88')][_0xbb1d('0x59')]);_0x17d53e[_0xbb1d('0x47')]=_[_0xbb1d('0x44')](_0x53c059[_0xbb1d('0x47')]);_0x17d53e[_0xbb1d('0x45')]=_[_0xbb1d('0x46')](_0x17d53e[_0xbb1d('0x42')],_0x17d53e[_0xbb1d('0x47')]);_0xc232c2[_0xbb1d('0x48')]=_[_0xbb1d('0x46')](_0x17d53e['model'],qs['fields'](_0x53c059[_0xbb1d('0x47')][_0xbb1d('0x49')]));_0xc232c2[_0xbb1d('0x48')]=_0xc232c2[_0xbb1d('0x48')][_0xbb1d('0x5a')]?_0xc232c2[_0xbb1d('0x48')]:_0x17d53e[_0xbb1d('0x42')];if(!_0x53c059['query']['hasOwnProperty'](_0xbb1d('0x4b'))){_0xc232c2[_0xbb1d('0x2f')]=qs[_0xbb1d('0x2f')](_0x53c059[_0xbb1d('0x47')][_0xbb1d('0x2f')]);_0xc232c2[_0xbb1d('0x2d')]=qs[_0xbb1d('0x2d')](_0x53c059[_0xbb1d('0x47')]['offset']);}_0xc232c2['order']=qs[_0xbb1d('0x4d')](_0x53c059['query'][_0xbb1d('0x4d')]);_0xc232c2[_0xbb1d('0x4e')]=qs[_0xbb1d('0x45')](_[_0xbb1d('0x4f')](_0x53c059[_0xbb1d('0x47')],_0x17d53e['filters']));_0xc232c2['where'][_0xbb1d('0x60')]=_0x4d96eb['id'];if(_0x53c059['query']['filter']){_0xc232c2[_0xbb1d('0x4e')]=_[_0xbb1d('0x51')](_0xc232c2[_0xbb1d('0x4e')],{'$or':_[_0xbb1d('0x43')](_0xc232c2[_0xbb1d('0x48')],function(_0x1b1aa6){var _0xd33253={};_0xd33253[_0x1b1aa6]={'$like':'%'+_0x53c059['query']['filter']+'%'};return _0xd33253;})});}_0xc232c2=_[_0xbb1d('0x51')]({},_0xc232c2,_0x53c059['options']);return db['MailInteraction'][_0xbb1d('0x30')]({'where':_0xc232c2['where']})[_0xbb1d('0x1e')](function(_0x14f951){_0x355f68['count']=_0x14f951;if(_0x53c059[_0xbb1d('0x47')][_0xbb1d('0x55')]){_0xc232c2[_0xbb1d('0x56')]=[{'model':db[_0xbb1d('0x89')],'as':_0xbb1d('0x8a'),'required':![]},{'model':db[_0xbb1d('0x8b')],'as':_0xbb1d('0x8c'),'attributes':[_0xbb1d('0x39'),_0xbb1d('0x8d'),_0xbb1d('0x8e')],'required':![]},{'model':db[_0xbb1d('0x8f')],'as':_0xbb1d('0x90'),'attributes':['id',_0xbb1d('0x39'),_0xbb1d('0x91')],'where':_0x53c059[_0xbb1d('0x47')][_0xbb1d('0x92')]?{'id':_0x53c059[_0xbb1d('0x47')][_0xbb1d('0x92')]}:undefined,'required':_0x53c059['query'][_0xbb1d('0x92')]?!![]:![]}];}return db[_0xbb1d('0x88')]['findAll'](_0xc232c2);})[_0xbb1d('0x1e')](function(_0x3a93cc){_0x355f68[_0xbb1d('0x93')]=_0x3a93cc;return _0x355f68;});}})['then'](respondWithFilteredResult(_0x44fa0e,_0xc232c2))[_0xbb1d('0x28')](handleError(_0x44fa0e,null));};exports['addApplications']=function addApplications(_0xcf6a0e,_0x419a9a){var _0x2addf8=_0xcf6a0e['params']['id'];var _0x4f9ef8=_0xcf6a0e[_0xbb1d('0x5c')];var _0x16658b=0xc8;var _0x23eaf3=null;return db[_0xbb1d('0x94')][_0xbb1d('0x95')]({'isolationLevel':db['sequelize'][_0xbb1d('0x96')][_0xbb1d('0x97')][_0xbb1d('0x98')]},function(_0x1c8ea6){return db[_0xbb1d('0x54')]['findOne']({'where':{'id':_0x2addf8},'transaction':_0x1c8ea6})[_0xbb1d('0x1e')](function(_0x4a5ed8){if(_0x4a5ed8){return db[_0xbb1d('0x99')][_0xbb1d('0x35')]({'where':{'MailAccountId':_0x2addf8},'transaction':_0x1c8ea6})[_0xbb1d('0x1e')](function(){var _0x54baf6=_[_0xbb1d('0x43')](_0x4f9ef8,function(_0x3516ef){_0x3516ef[_0xbb1d('0x60')]=_0x2addf8;return _0x3516ef;});return db[_0xbb1d('0x99')]['bulkCreate'](_0x54baf6,{'transaction':_0x1c8ea6});});}else{_0x16658b=0x194;_0x23eaf3=[];}});})[_0xbb1d('0x1e')](function(){if(_0x16658b!==0x194){return db[_0xbb1d('0x99')][_0xbb1d('0x9a')]({'where':{'MailAccountId':_0x2addf8},'order':'priority'})[_0xbb1d('0x1e')](function(_0x4feb7e){_0x23eaf3=_0x4feb7e;});}})[_0xbb1d('0x28')](function(_0x24d1a4){_0x16658b=0x1f4;logger['error'](_0x24d1a4['stack']);if(_0x24d1a4[_0xbb1d('0x39')]){delete _0x24d1a4['name'];}_0x23eaf3=_0x24d1a4;})['finally'](function(){if(_0x23eaf3===null){_0x419a9a['sendStatus'](_0x16658b);}else{if(_0x16658b===0x1f4){_0x419a9a[_0xbb1d('0x2a')](_0x16658b)['send'](_0x23eaf3);}else{_0x419a9a[_0xbb1d('0x2a')](_0x16658b)['json'](_0x23eaf3);}}});};exports['getApplications']=function(_0x2767c7,_0x48e17f,_0x490e34){var _0x115bd7={};var _0x49acc0={};var _0x2185f4;var _0x3c9c1a;return db['MailAccount']['findOne']({'where':{'id':_0x2767c7[_0xbb1d('0x5d')]['id']}})[_0xbb1d('0x1e')](handleEntityNotFound(_0x48e17f,null))[_0xbb1d('0x1e')](function(_0x393c84){if(_0x393c84){_0x2185f4=_0x393c84;_0x49acc0[_0xbb1d('0x42')]=_[_0xbb1d('0x44')](db[_0xbb1d('0x99')][_0xbb1d('0x59')]);_0x49acc0[_0xbb1d('0x47')]=_['keys'](_0x2767c7[_0xbb1d('0x47')]);_0x49acc0[_0xbb1d('0x45')]=_[_0xbb1d('0x46')](_0x49acc0[_0xbb1d('0x42')],_0x49acc0[_0xbb1d('0x47')]);_0x115bd7['attributes']=_[_0xbb1d('0x46')](_0x49acc0[_0xbb1d('0x42')],qs[_0xbb1d('0x49')](_0x2767c7[_0xbb1d('0x47')][_0xbb1d('0x49')]));_0x115bd7[_0xbb1d('0x48')]=_0x115bd7[_0xbb1d('0x48')][_0xbb1d('0x5a')]?_0x115bd7['attributes']:_0x49acc0[_0xbb1d('0x42')];_0x115bd7[_0xbb1d('0x4c')]=qs[_0xbb1d('0x4d')](_0x2767c7[_0xbb1d('0x47')]['sort']);_0x115bd7['where']=qs['filters'](_[_0xbb1d('0x4f')](_0x2767c7[_0xbb1d('0x47')],_0x49acc0['filters']));if(_0x2767c7['query'][_0xbb1d('0x50')]){_0x115bd7[_0xbb1d('0x4e')]=_[_0xbb1d('0x51')](_0x115bd7['where'],{'$or':_['map'](_0x115bd7[_0xbb1d('0x48')],function(_0x44f813){var _0x45bbd1={};_0x45bbd1[_0x44f813]={'$like':'%'+_0x2767c7[_0xbb1d('0x47')][_0xbb1d('0x50')]+'%'};return _0x45bbd1;})});}_0x115bd7=_[_0xbb1d('0x51')]({},_0x115bd7,_0x2767c7['options']);return _0x2185f4[_0xbb1d('0x9b')](_0x115bd7);}})[_0xbb1d('0x1e')](function(_0xf27390){if(_0xf27390){_0x3c9c1a=_0xf27390['length'];if(!_0x2767c7[_0xbb1d('0x47')]['hasOwnProperty']('nolimit')){_0x115bd7[_0xbb1d('0x2f')]=qs[_0xbb1d('0x2f')](_0x2767c7['query']['limit']);_0x115bd7[_0xbb1d('0x2d')]=qs[_0xbb1d('0x2d')](_0x2767c7['query']['offset']);}return _0x2185f4['getApplications'](_0x115bd7);}})[_0xbb1d('0x1e')](function(_0x256a19){if(_0x256a19){return _0x256a19?{'count':_0x3c9c1a,'rows':_0x256a19}:null;}})[_0xbb1d('0x1e')](respondWithResult(_0x48e17f,null))[_0xbb1d('0x28')](handleError(_0x48e17f,null));};exports[_0xbb1d('0x9c')]=function(_0x4ebccb,_0x2dd301,_0x44ad8f){var _0xf6a549={'raw':!![],'where':{}};var _0x32b87f={};var _0x57ae7c={'count':0x0,'rows':[]};return db[_0xbb1d('0x54')]['findOne']({'where':{'id':_0x4ebccb[_0xbb1d('0x5d')]['id']}})[_0xbb1d('0x1e')](handleEntityNotFound(_0x2dd301,null))['then'](function(_0x27b16d){if(_0x27b16d){_0x32b87f['model']=_[_0xbb1d('0x44')](db[_0xbb1d('0x9d')]['rawAttributes']);_0x32b87f[_0xbb1d('0x47')]=_[_0xbb1d('0x44')](_0x4ebccb['query']);_0x32b87f[_0xbb1d('0x45')]=_['intersection'](_0x32b87f['model'],_0x32b87f[_0xbb1d('0x47')]);_0xf6a549[_0xbb1d('0x48')]=_[_0xbb1d('0x46')](_0x32b87f['model'],qs[_0xbb1d('0x49')](_0x4ebccb['query'][_0xbb1d('0x49')]));_0xf6a549[_0xbb1d('0x48')]=_0xf6a549['attributes'][_0xbb1d('0x5a')]?_0xf6a549[_0xbb1d('0x48')]:_0x32b87f[_0xbb1d('0x42')];if(!_0x4ebccb[_0xbb1d('0x47')][_0xbb1d('0x4a')]('nolimit')){_0xf6a549['limit']=qs['limit'](_0x4ebccb[_0xbb1d('0x47')]['limit']);_0xf6a549['offset']=qs['offset'](_0x4ebccb['query'][_0xbb1d('0x2d')]);}_0xf6a549[_0xbb1d('0x4c')]=qs['sort'](_0x4ebccb[_0xbb1d('0x47')][_0xbb1d('0x4d')]);_0xf6a549[_0xbb1d('0x4e')]=qs[_0xbb1d('0x45')](_[_0xbb1d('0x4f')](_0x4ebccb[_0xbb1d('0x47')],_0x32b87f[_0xbb1d('0x45')]));_0xf6a549[_0xbb1d('0x4e')][_0xbb1d('0x60')]=_0x27b16d['id'];if(_0x4ebccb[_0xbb1d('0x47')][_0xbb1d('0x50')]){_0xf6a549[_0xbb1d('0x4e')]=_['merge'](_0xf6a549[_0xbb1d('0x4e')],{'$or':_[_0xbb1d('0x43')](_0xf6a549['attributes'],function(_0x57b020){var _0x516d11={};_0x516d11[_0x57b020]={'$like':'%'+_0x4ebccb['query'][_0xbb1d('0x50')]+'%'};return _0x516d11;})});}if(_0x4ebccb[_0xbb1d('0x47')][_0xbb1d('0x9e')]){var _0x4645b3=_0x4ebccb[_0xbb1d('0x47')]['$gte'][_0xbb1d('0x9f')](',');var _0x3ae02f={};_0x3ae02f[_0x4645b3[0x0]]={'$gte':moment(_0x4645b3[0x1])[_0xbb1d('0xa0')](_0xbb1d('0xa1'))};_0xf6a549[_0xbb1d('0x4e')]=_[_0xbb1d('0x51')](_0xf6a549['where'],_0x3ae02f);}_0xf6a549=_[_0xbb1d('0x51')]({},_0xf6a549,_0x4ebccb[_0xbb1d('0x53')]);return db['MailMessage'][_0xbb1d('0x30')]({'where':_0xf6a549['where']})[_0xbb1d('0x1e')](function(_0x26fe97){_0x57ae7c[_0xbb1d('0x30')]=_0x26fe97;if(_0x4ebccb['query']['includeAll']){_0xf6a549[_0xbb1d('0x56')]=[{'all':!![]}];}return db[_0xbb1d('0x9d')][_0xbb1d('0x6a')](_0xf6a549);})['then'](function(_0x310dff){if(_0x4ebccb[_0xbb1d('0x47')][_0xbb1d('0xa2')]==='true'){for(var _0x27a9f6=0x0;_0x27a9f6<_0x310dff[_0xbb1d('0x5a')];_0x27a9f6++){_0x310dff[_0x27a9f6]['body']=juice(_0x310dff[_0x27a9f6]['body']);}}_0x57ae7c[_0xbb1d('0x93')]=_0x310dff;return _0x57ae7c;});}})['then'](respondWithFilteredResult(_0x2dd301,_0xf6a549))[_0xbb1d('0x28')](handleError(_0x2dd301,null));};exports[_0xbb1d('0x3a')]=function(_0x15f62d,_0x24692a,_0x199e7c){var _0x4da8ce,_0x3f3051={},_0x155da3;if(_0x15f62d[_0xbb1d('0x5c')]['to']){_0x155da3=_0x15f62d[_0xbb1d('0x5c')]['to']['split'](',')[0x0];}return db[_0xbb1d('0x54')][_0xbb1d('0x5b')]({'where':{'id':_0x15f62d[_0xbb1d('0x5d')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xbb1d('0xa3'),'where':{'email':_0x155da3},'limit':0x1,'order':[[_0xbb1d('0xa4'),_0xbb1d('0xa5')]]}]},{'model':db[_0xbb1d('0x3d')],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x24692a,null))[_0xbb1d('0x1e')](function(_0x3632e6){if(_0x3632e6){_0x4da8ce=_0x3632e6;if(_0x3632e6[_0xbb1d('0x3e')]){if(_['isNil'](_0x15f62d[_0xbb1d('0x5c')]['from'])){_0x15f62d[_0xbb1d('0x5c')]['from']=util[_0xbb1d('0xa0')]('%s\x20<%s>',_0x3632e6[_0xbb1d('0x39')],_0x3632e6[_0xbb1d('0x6c')]||_0x3632e6[_0xbb1d('0x3e')][_0xbb1d('0x71')]);}if(_0x15f62d[_0xbb1d('0x5c')][_0xbb1d('0xa6')]&&_0x15f62d[_0xbb1d('0x5c')][_0xbb1d('0xa6')][_0xbb1d('0x5a')]){for(var _0x547932=0x0;_0x547932<_0x15f62d[_0xbb1d('0x5c')][_0xbb1d('0xa6')][_0xbb1d('0x5a')];_0x547932+=0x1){_0x15f62d[_0xbb1d('0x5c')]['attachments'][_0x547932]={'filename':_0x15f62d[_0xbb1d('0x5c')]['attachments'][_0x547932][_0xbb1d('0x39')],'path':path[_0xbb1d('0xa7')](config[_0xbb1d('0xa8')],_0xbb1d('0xa9'),_0x15f62d['body'][_0xbb1d('0xa6')][_0x547932][_0xbb1d('0xaa')])};}}var _0x4a02b7={'tls':{'rejectUnauthorized':![]}};if(_[_0xbb1d('0x70')](_0x3632e6[_0xbb1d('0x3e')]['service'])){if(_0x3632e6[_0xbb1d('0x3e')][_0xbb1d('0x75')]){_0x4a02b7[_0xbb1d('0xab')]={'user':_0x3632e6[_0xbb1d('0x3e')][_0xbb1d('0x71')],'pass':_0x3632e6[_0xbb1d('0x3e')][_0xbb1d('0x7a')]};}_0x4a02b7[_0xbb1d('0x76')]=_0x3632e6['Smtp'][_0xbb1d('0x76')];_0x4a02b7[_0xbb1d('0x77')]=_0x3632e6[_0xbb1d('0x3e')][_0xbb1d('0x77')];_0x4a02b7['secure']=_0x3632e6[_0xbb1d('0x3e')][_0xbb1d('0xac')];}else{_0x4a02b7[_0xbb1d('0x78')]=_0x3632e6['Smtp'][_0xbb1d('0x78')];_0x4a02b7[_0xbb1d('0xab')]={'user':_0x3632e6[_0xbb1d('0x3e')][_0xbb1d('0x71')],'pass':_0x3632e6['Smtp'][_0xbb1d('0x7a')]};}return respondWithRpcPromise('SendMail',_0xbb1d('0xad'),{'account':_0x4a02b7,'message':_0x15f62d['body']});}else{throw new Error('List\x20not\x20found');}}})[_0xbb1d('0x1e')](function(_0x44c470){if(_0x44c470){_0x3f3051=_0x44c470;if(_0x4da8ce[_0xbb1d('0xae')]){if(_0x4da8ce[_0xbb1d('0xae')][_0xbb1d('0xa3')]['length']){return _0x4da8ce['List'][_0xbb1d('0xa3')][0x0];}else{return db[_0xbb1d('0x89')]['create'](_[_0xbb1d('0xaf')](_0x15f62d['body'],{'firstName':_0x15f62d[_0xbb1d('0x5c')]['to'],'email':_0x15f62d[_0xbb1d('0x5c')]['to'],'phone':_0x15f62d['body']['to'],'ListId':_0x4da8ce[_0xbb1d('0x6d')]}));}}else{throw new Error(_0xbb1d('0xb0'));}}})['then'](function(_0x2d48e6){if(_0x2d48e6){var _0x1e5d9b={'UserId':_0x15f62d[_0xbb1d('0x71')]['id'],'ContactId':_0x2d48e6['id'],'MailAccountId':_0x4da8ce['id'],'inReplyTo':_0x3f3051[_0xbb1d('0xb1')],'to':_0x15f62d[_0xbb1d('0x5c')][_0xbb1d('0xb2')],'cc':_0x15f62d['body']['cc'],'subject':_0x15f62d[_0xbb1d('0x5c')][_0xbb1d('0xb3')],'attach':_0x15f62d[_0xbb1d('0x5c')][_0xbb1d('0xb4')],'firstMsgDirection':_0xbb1d('0xb5'),'lastMsgAt':moment()[_0xbb1d('0xa0')](_0xbb1d('0xa1')),'lastMsgDirection':_0xbb1d('0xb5'),'Messages':[_['merge'](_0x15f62d[_0xbb1d('0x5c')],{'messageId':_0x3f3051[_0xbb1d('0xb1')],'sentAt':moment()[_0xbb1d('0xa0')](_0xbb1d('0xa1')),'read':!![],'MailAccountId':_0x4da8ce['id'],'UserId':_0x15f62d[_0xbb1d('0x71')]['id'],'ContactId':_0x2d48e6['id']})]};if(_0x15f62d[_0xbb1d('0x5c')][_0xbb1d('0xb6')]){_0x1e5d9b=_[_0xbb1d('0x51')](_0x1e5d9b,_0x15f62d[_0xbb1d('0x5c')]['Interaction']);}return db['MailInteraction'][_0xbb1d('0x62')](_0x1e5d9b,{'include':[{'model':db['MailMessage'],'as':_0xbb1d('0xb7')}]});}})[_0xbb1d('0x1e')](respondWithResult(_0x24692a,null))[_0xbb1d('0x28')](handleError(_0x24692a,null));};exports[_0xbb1d('0xb8')]=function(_0x226d50,_0x18e243,_0x5ccc0b){return db[_0xbb1d('0x54')]['find']({'where':{'id':_0x226d50[_0xbb1d('0x5d')]['id']},'include':[{'model':db[_0xbb1d('0x3d')],'as':_0xbb1d('0x3e'),'raw':!![]}]})[_0xbb1d('0x1e')](handleEntityNotFound(_0x18e243,null))[_0xbb1d('0x1e')](function(_0x28b52b){if(_0x28b52b&&_0x28b52b[_0xbb1d('0x3e')]){var _0x47c71b={'id':_0x28b52b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x28b52b[_0xbb1d('0x3e')]['service']){_0x47c71b[_0xbb1d('0x78')]=_0x28b52b[_0xbb1d('0x3e')]['service'];}else{_0x47c71b[_0xbb1d('0x76')]=_0x28b52b[_0xbb1d('0x3e')][_0xbb1d('0x76')];_0x47c71b['port']=_0x28b52b['Smtp'][_0xbb1d('0x77')];_0x47c71b[_0xbb1d('0xac')]=_0x28b52b['Smtp'][_0xbb1d('0xac')];}if(_0x28b52b[_0xbb1d('0x3e')][_0xbb1d('0x75')]){_0x47c71b[_0xbb1d('0xab')]={'user':_0x28b52b[_0xbb1d('0x3e')][_0xbb1d('0x71')],'pass':_0x28b52b[_0xbb1d('0x3e')]['pass']};}return respondWithRpcPromise('VerifySmtp',_0xbb1d('0xb8'),{'account':_0x47c71b});}})[_0xbb1d('0x1e')](respondWithResult(_0x18e243,null))['catch'](handleError(_0x18e243,null));};exports[_0xbb1d('0x35')]=function(_0x2df141,_0x29fa3b){return db[_0xbb1d('0x54')]['find']({'where':{'id':_0x2df141[_0xbb1d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x29fa3b,null))[_0xbb1d('0x1e')](function(_0x595257){if(_0x595257&&_0x595257[_0xbb1d('0x78')]){throw new db['Sequelize'][(_0xbb1d('0xb9'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x595257;})[_0xbb1d('0x1e')](removeEntity(_0x29fa3b,null))[_0xbb1d('0x28')](handleError(_0x29fa3b,null));};exports[_0xbb1d('0xba')]=function(_0x198ef1,_0x105f79,_0x423d86){return db['MailAccount'][_0xbb1d('0x5b')]({'where':{'id':_0x198ef1[_0xbb1d('0x5d')]['id']}})[_0xbb1d('0x1e')](handleEntityNotFound(_0x105f79,null))[_0xbb1d('0x1e')](function(_0x3364fb){if(_0x3364fb){return _0x3364fb['addAgents'](_0x198ef1[_0xbb1d('0x5c')][_0xbb1d('0x66')],_[_0xbb1d('0x87')](_0x198ef1['body'],[_0xbb1d('0x66'),'id'])||{})['spread'](function(_0xceee1f){for(var _0x249f62=0x0;_0x249f62<_0x198ef1[_0xbb1d('0x5c')][_0xbb1d('0x66')][_0xbb1d('0x5a')];_0x249f62+=0x1){socket[_0xbb1d('0xbb')]('userMailAccount:save',{'UserId':Number(_0x198ef1[_0xbb1d('0x5c')][_0xbb1d('0x66')][_0x249f62]),'MailAccountId':Number(_0x198ef1[_0xbb1d('0x5d')]['id'])});}return _0xceee1f;});}})[_0xbb1d('0x1e')](respondWithResult(_0x105f79,null))[_0xbb1d('0x28')](handleError(_0x105f79,null));};exports[_0xbb1d('0xbc')]=function(_0x15c04d,_0x9919d8,_0x503579){return db[_0xbb1d('0x54')][_0xbb1d('0x5b')]({'where':{'id':_0x15c04d[_0xbb1d('0x5d')]['id']}})[_0xbb1d('0x1e')](handleEntityNotFound(_0x9919d8,null))[_0xbb1d('0x1e')](function(_0x1742be){if(_0x1742be){return _0x1742be[_0xbb1d('0xbc')](_0x15c04d[_0xbb1d('0x47')][_0xbb1d('0x66')])['then'](function(){if(_[_0xbb1d('0xbd')](_0x15c04d[_0xbb1d('0x47')][_0xbb1d('0x66')])){for(var _0x4145e3=0x0;_0x4145e3<_0x15c04d['query'][_0xbb1d('0x66')][_0xbb1d('0x5a')];_0x4145e3+=0x1){socket[_0xbb1d('0xbb')](_0xbb1d('0xbe'),{'UserId':Number(_0x15c04d[_0xbb1d('0x47')][_0xbb1d('0x66')][_0x4145e3]),'MailAccountId':Number(_0x15c04d[_0xbb1d('0x5d')]['id'])});}}else{socket[_0xbb1d('0xbb')](_0xbb1d('0xbe'),{'UserId':Number(_0x15c04d[_0xbb1d('0x47')]['ids']),'MailAccountId':Number(_0x15c04d[_0xbb1d('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x9919d8,null))[_0xbb1d('0x28')](handleError(_0x9919d8,null));};exports['getAgents']=function(_0x20793b,_0x1ada9f,_0x56d5b3){var _0x5730a7={};var _0x15bbc7={};var _0x590a17;var _0x2be176;return db['MailAccount'][_0xbb1d('0x64')]({'where':{'id':_0x20793b['params']['id']}})[_0xbb1d('0x1e')](handleEntityNotFound(_0x1ada9f,null))[_0xbb1d('0x1e')](function(_0x4598b6){if(_0x4598b6){_0x590a17=_0x4598b6;_0x15bbc7[_0xbb1d('0x42')]=_[_0xbb1d('0x44')](db[_0xbb1d('0x8b')][_0xbb1d('0x59')]);_0x15bbc7[_0xbb1d('0x47')]=_['keys'](_0x20793b[_0xbb1d('0x47')]);_0x15bbc7[_0xbb1d('0x45')]=_[_0xbb1d('0x46')](_0x15bbc7['model'],_0x15bbc7['query']);_0x5730a7['attributes']=_[_0xbb1d('0x46')](_0x15bbc7[_0xbb1d('0x42')],qs[_0xbb1d('0x49')](_0x20793b[_0xbb1d('0x47')][_0xbb1d('0x49')]));_0x5730a7[_0xbb1d('0x48')]=_0x5730a7[_0xbb1d('0x48')]['length']?_0x5730a7[_0xbb1d('0x48')]:_0x15bbc7[_0xbb1d('0x42')];_0x5730a7['order']=qs[_0xbb1d('0x4d')](_0x20793b[_0xbb1d('0x47')][_0xbb1d('0x4d')]);_0x5730a7[_0xbb1d('0x4e')]=qs[_0xbb1d('0x45')](_['pick'](_0x20793b['query'],_0x15bbc7[_0xbb1d('0x45')]));if(_0x20793b[_0xbb1d('0x47')]['filter']){_0x5730a7[_0xbb1d('0x4e')]=_[_0xbb1d('0x51')](_0x5730a7[_0xbb1d('0x4e')],{'$or':_[_0xbb1d('0x43')](_0x5730a7[_0xbb1d('0x48')],function(_0x1d31b9){var _0x1f9622={};_0x1f9622[_0x1d31b9]={'$like':'%'+_0x20793b[_0xbb1d('0x47')][_0xbb1d('0x50')]+'%'};return _0x1f9622;})});}_0x5730a7=_[_0xbb1d('0x51')]({},_0x5730a7,_0x20793b[_0xbb1d('0x53')]);return _0x590a17['getAgents'](_0x5730a7);}})[_0xbb1d('0x1e')](function(_0x521112){if(_0x521112){_0x2be176=_0x521112[_0xbb1d('0x5a')];if(!_0x20793b['query']['hasOwnProperty'](_0xbb1d('0x4b'))){_0x5730a7[_0xbb1d('0x2f')]=qs[_0xbb1d('0x2f')](_0x20793b[_0xbb1d('0x47')][_0xbb1d('0x2f')]);_0x5730a7[_0xbb1d('0x2d')]=qs['offset'](_0x20793b[_0xbb1d('0x47')][_0xbb1d('0x2d')]);}return _0x590a17['getAgents'](_0x5730a7);}})[_0xbb1d('0x1e')](function(_0x37d445){if(_0x37d445){return _0x37d445?{'count':_0x2be176,'rows':_0x37d445}:null;}})[_0xbb1d('0x1e')](respondWithResult(_0x1ada9f,null))[_0xbb1d('0x28')](handleError(_0x1ada9f,null));}; \ No newline at end of file +var _0x865c=['destroy','MailAccounts','UserProfileResource','sendStatus','stack','name','send','index','MailServerIn','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','Imap','MailServerOut','keys','find','body','describe','addDisposition','params','MailAccountId','Disposition','create','getDispositions','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','key','email','ListId','active','description','cservice','user','cuser','password','pass','cpassword','authentication','host','port','service','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','ids','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','internal','tag','sequelize','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','split','CmList','List','Contacts','isNil','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','defaults','List\x20not\x20found','messageId','attach','out','Interaction','Messages','VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then'];(function(_0xf84870,_0x4dc38f){var _0x4541a4=function(_0x3ff5d5){while(--_0x3ff5d5){_0xf84870['push'](_0xf84870['shift']());}};_0x4541a4(++_0x4dc38f);}(_0x865c,0x91));var _0xc865=function(_0x38ce14,_0x4806f3){_0x38ce14=_0x38ce14-0x0;var _0x36879a=_0x865c[_0x38ce14];return _0x36879a;};'use strict';var emlformat=require(_0xc865('0x0'));var rimraf=require(_0xc865('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc865('0x2'));var rp=require('request-promise');var moment=require(_0xc865('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc865('0x4'));var util=require(_0xc865('0x5'));var path=require(_0xc865('0x6'));var sox=require(_0xc865('0x7'));var csv=require(_0xc865('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc865('0x9'));var _=require(_0xc865('0xa'));var squel=require(_0xc865('0xb'));var crypto=require(_0xc865('0xc'));var jsforce=require(_0xc865('0xd'));var deskjs=require(_0xc865('0xe'));var toCsv=require(_0xc865('0x8'));var querystring=require(_0xc865('0xf'));var Papa=require(_0xc865('0x10'));var htmlToText=require(_0xc865('0x11'));var juice=require(_0xc865('0x12'));var Redis=require(_0xc865('0x13'));var authService=require(_0xc865('0x14'));var qs=require(_0xc865('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc865('0x16'));var logger=require('../../config/logger')(_0xc865('0x17'));var utils=require(_0xc865('0x18'));var config=require(_0xc865('0x19'));var licenseUtil=require(_0xc865('0x1a'));var db=require('../../mysqldb')['db'];config[_0xc865('0x1b')]=_['defaults'](config[_0xc865('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xc865('0x1c'))(new Redis(config[_0xc865('0x1b')]));require(_0xc865('0x1d'))[_0xc865('0x1e')](socket);var jayson=require(_0xc865('0x1f'));var client=jayson[_0xc865('0x20')][_0xc865('0x21')]({'port':0x232b});function respondWithRpcPromise(_0x1b8db1,_0x299e72,_0x3c2bec,_0x130a0a){return new BPromise(function(_0x5c1799,_0x32dc23){var _0x396d2d=_0x130a0a||client;return _0x396d2d[_0xc865('0x22')](_0x1b8db1,_0x3c2bec)['then'](function(_0x1f4cbe){logger[_0xc865('0x23')](_0xc865('0x24'),_0x299e72,_0xc865('0x25'));logger[_0xc865('0x26')](_0xc865('0x27'),_0x299e72,'request\x20sent',JSON[_0xc865('0x28')](_0x1f4cbe));if(_0x1f4cbe['error']){if(_0x1f4cbe[_0xc865('0x29')][_0xc865('0x2a')]===0x1f4){logger[_0xc865('0x29')](_0xc865('0x24'),_0x299e72,_0x1f4cbe[_0xc865('0x29')][_0xc865('0x2b')]);return _0x32dc23(_0x1f4cbe[_0xc865('0x29')][_0xc865('0x2b')]);}logger[_0xc865('0x29')](_0xc865('0x24'),_0x299e72,_0x1f4cbe[_0xc865('0x29')]['message']);return _0x5c1799(_0x1f4cbe['error'][_0xc865('0x2b')]);}else{logger[_0xc865('0x23')]('MailAccount,\x20%s,\x20%s',_0x299e72,'request\x20sent');_0x5c1799(_0x1f4cbe[_0xc865('0x2c')]['message']);}})[_0xc865('0x2d')](function(_0x465365){logger['error']('MailAccount,\x20%s,\x20%s',_0x299e72,_0x465365);_0x32dc23(_0x465365);});});}function respondWithStatusCode(_0x79d227,_0x5b7de6){_0x5b7de6=_0x5b7de6||0xcc;return function(_0x128733){if(_0x128733){return _0x79d227['sendStatus'](_0x5b7de6);}return _0x79d227[_0xc865('0x2e')](_0x5b7de6)[_0xc865('0x2f')]();};}function respondWithResult(_0x39a101,_0x5dac43){_0x5dac43=_0x5dac43||0xc8;return function(_0x4597c7){if(_0x4597c7){return _0x39a101['status'](_0x5dac43)[_0xc865('0x30')](_0x4597c7);}};}function respondWithFilteredResult(_0x5a9ee8,_0x3166c2){return function(_0x59a6e3){if(_0x59a6e3){var _0x4cf816=typeof _0x3166c2[_0xc865('0x31')]===_0xc865('0x32')&&typeof _0x3166c2[_0xc865('0x33')]===_0xc865('0x32');var _0x4e37c9=_0x59a6e3[_0xc865('0x34')];var _0x52fc47=_0x4cf816?0x0:_0x3166c2[_0xc865('0x31')];var _0x1047fa=_0x4cf816?_0x59a6e3[_0xc865('0x34')]:_0x3166c2[_0xc865('0x31')]+_0x3166c2[_0xc865('0x33')];var _0x5bc76e;if(_0x1047fa>=_0x4e37c9){_0x1047fa=_0x4e37c9;_0x5bc76e=0xc8;}else{_0x5bc76e=0xce;}_0x5a9ee8[_0xc865('0x2e')](_0x5bc76e);return _0x5a9ee8[_0xc865('0x35')](_0xc865('0x36'),_0x52fc47+'-'+_0x1047fa+'/'+_0x4e37c9)[_0xc865('0x30')](_0x59a6e3);}return null;};}function patchUpdates(_0xaa7a9a){return function(_0x1bd55e){try{jsonpatch['apply'](_0x1bd55e,_0xaa7a9a,!![]);}catch(_0x585bc6){return BPromise[_0xc865('0x37')](_0x585bc6);}return _0x1bd55e[_0xc865('0x38')]();};}function saveUpdates(_0xc1ed93,_0xd9cdaa){return function(_0x27c654){if(_0x27c654){return _0x27c654[_0xc865('0x39')](_0xc1ed93)[_0xc865('0x3a')](function(_0x391a4e){return _0x391a4e;});}return null;};}function removeEntity(_0x434b4a,_0x28d1a3){return function(_0x4f3fd8){if(_0x4f3fd8){return _0x4f3fd8[_0xc865('0x3b')]()[_0xc865('0x3a')](function(){var _0x176de8=_0x4f3fd8['get']({'plain':!![]});var _0x399092=_0xc865('0x3c');return db[_0xc865('0x3d')][_0xc865('0x3b')]({'where':{'type':_0x399092,'resourceId':_0x176de8['id']}})[_0xc865('0x3a')](function(){return _0x4f3fd8;});})[_0xc865('0x3a')](function(){_0x434b4a[_0xc865('0x2e')](0xcc)[_0xc865('0x2f')]();});}};}function handleEntityNotFound(_0x2b3c20,_0x2d5a0c){return function(_0x61d8eb){if(!_0x61d8eb){_0x2b3c20[_0xc865('0x3e')](0x194);}return _0x61d8eb;};}function handleError(_0x48afee,_0x49392b){_0x49392b=_0x49392b||0x1f4;return function(_0x4ee128){logger['error'](_0x4ee128[_0xc865('0x3f')]);if(_0x4ee128[_0xc865('0x40')]){delete _0x4ee128[_0xc865('0x40')];}_0x48afee[_0xc865('0x2e')](_0x49392b)[_0xc865('0x41')](_0x4ee128);};}exports[_0xc865('0x42')]=function(_0x1a87a6,_0x269a15){var _0x594ec0={'include':[{'model':db[_0xc865('0x43')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0xc865('0x44')},{'model':db[_0xc865('0x45')],'as':_0xc865('0x46')}]},_0xf28c0c={},_0x21a87f={'count':0x0,'rows':[]};var _0x17b7a0=_['map'](db[_0xc865('0x47')][_0xc865('0x48')],function(_0x59a423){return{'name':_0x59a423[_0xc865('0x49')],'type':_0x59a423[_0xc865('0x4a')]['key']};});_0xf28c0c[_0xc865('0x4b')]=_[_0xc865('0x4c')](_0x17b7a0,_0xc865('0x40'));_0xf28c0c[_0xc865('0x4d')]=_['keys'](_0x1a87a6[_0xc865('0x4d')]);_0xf28c0c[_0xc865('0x4e')]=_['intersection'](_0xf28c0c[_0xc865('0x4b')],_0xf28c0c[_0xc865('0x4d')]);_0x594ec0['attributes']=_[_0xc865('0x4f')](_0xf28c0c['model'],qs[_0xc865('0x50')](_0x1a87a6[_0xc865('0x4d')]['fields']));_0x594ec0[_0xc865('0x51')]=_0x594ec0['attributes'][_0xc865('0x52')]?_0x594ec0[_0xc865('0x51')]:_0xf28c0c['model'];if(!_0x1a87a6[_0xc865('0x4d')][_0xc865('0x53')](_0xc865('0x54'))){_0x594ec0['limit']=qs['limit'](_0x1a87a6[_0xc865('0x4d')][_0xc865('0x33')]);_0x594ec0[_0xc865('0x31')]=qs[_0xc865('0x31')](_0x1a87a6[_0xc865('0x4d')][_0xc865('0x31')]);}_0x594ec0[_0xc865('0x55')]=qs['sort'](_0x1a87a6['query'][_0xc865('0x56')]);_0x594ec0[_0xc865('0x57')]=qs[_0xc865('0x4e')](_[_0xc865('0x58')](_0x1a87a6[_0xc865('0x4d')],_0xf28c0c['filters']),_0x17b7a0);if(_0x1a87a6[_0xc865('0x4d')]['filter']){_0x594ec0[_0xc865('0x57')]=_[_0xc865('0x59')](_0x594ec0[_0xc865('0x57')],{'$or':_['map'](_0x17b7a0,function(_0x590870){if(_0x590870[_0xc865('0x4a')]!==_0xc865('0x5a')){var _0x2e3469={};_0x2e3469[_0x590870[_0xc865('0x40')]]={'$like':'%'+_0x1a87a6[_0xc865('0x4d')][_0xc865('0x5b')]+'%'};return _0x2e3469;}})});}_0x594ec0=_[_0xc865('0x59')]({},_0x594ec0,_0x1a87a6[_0xc865('0x5c')]);var _0x48920d={'where':_0x594ec0[_0xc865('0x57')]};return db['MailAccount'][_0xc865('0x34')](_0x48920d)['then'](function(_0x2374a9){_0x21a87f[_0xc865('0x34')]=_0x2374a9;if(_0x1a87a6[_0xc865('0x4d')][_0xc865('0x5d')]){_0x594ec0[_0xc865('0x5e')]=[{'all':!![]}];}return db[_0xc865('0x47')][_0xc865('0x5f')](_0x594ec0);})['then'](function(_0x9e7bc5){_0x21a87f[_0xc865('0x60')]=_0x9e7bc5;return _0x21a87f;})[_0xc865('0x3a')](respondWithFilteredResult(_0x269a15,_0x594ec0))[_0xc865('0x2d')](handleError(_0x269a15,null));};exports[_0xc865('0x61')]=function(_0x3e88a0,_0x113e4d){var _0x5b6cba={'raw':![],'where':{'id':_0x3e88a0['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xc865('0x62')},{'model':db[_0xc865('0x63')],'as':_0xc865('0x44')},{'model':db[_0xc865('0x45')],'as':_0xc865('0x46')}]},_0x28362d={};_0x28362d['model']=_[_0xc865('0x64')](db['MailAccount'][_0xc865('0x48')]);_0x28362d[_0xc865('0x4d')]=_[_0xc865('0x64')](_0x3e88a0[_0xc865('0x4d')]);_0x28362d['filters']=_[_0xc865('0x4f')](_0x28362d['model'],_0x28362d['query']);_0x5b6cba[_0xc865('0x51')]=_[_0xc865('0x4f')](_0x28362d[_0xc865('0x4b')],qs[_0xc865('0x50')](_0x3e88a0[_0xc865('0x4d')]['fields']));_0x5b6cba[_0xc865('0x51')]=_0x5b6cba['attributes'][_0xc865('0x52')]?_0x5b6cba[_0xc865('0x51')]:_0x28362d[_0xc865('0x4b')];if(_0x3e88a0[_0xc865('0x4d')]['includeAll']){_0x5b6cba[_0xc865('0x5e')]=[{'all':!![]}];}_0x5b6cba=_[_0xc865('0x59')]({},_0x5b6cba,_0x3e88a0[_0xc865('0x5c')]);return db[_0xc865('0x47')][_0xc865('0x65')](_0x5b6cba)[_0xc865('0x3a')](handleEntityNotFound(_0x113e4d,null))[_0xc865('0x3a')](respondWithResult(_0x113e4d,null))[_0xc865('0x2d')](handleError(_0x113e4d,null));};exports[_0xc865('0x39')]=function(_0x447109,_0x4a467f){if(_0x447109[_0xc865('0x66')]['id']){delete _0x447109[_0xc865('0x66')]['id'];}return db[_0xc865('0x47')][_0xc865('0x65')]({'where':{'id':_0x447109['params']['id']},'include':[{'model':db[_0xc865('0x43')],'as':_0xc865('0x62')},{'model':db[_0xc865('0x63')],'as':_0xc865('0x44')},{'model':db[_0xc865('0x45')],'as':'mandatoryDispositionPause'}]})[_0xc865('0x3a')](handleEntityNotFound(_0x4a467f,null))[_0xc865('0x3a')](saveUpdates(_0x447109['body'],null))[_0xc865('0x3a')](function(_0x526ade){if(_0x526ade&&_0x447109['body']['Imap']){return db[_0xc865('0x43')][_0xc865('0x39')](_0x447109['body'][_0xc865('0x62')],{'where':{'MailAccountId':_0x526ade['id']}})[_0xc865('0x3a')](function(){return _0x526ade;});}return _0x526ade;})[_0xc865('0x3a')](function(_0x14aaa2){if(_0x14aaa2&&_0x447109['body'][_0xc865('0x44')]){return db['MailServerOut'][_0xc865('0x39')](_0x447109[_0xc865('0x66')][_0xc865('0x44')],{'where':{'MailAccountId':_0x14aaa2['id']}})[_0xc865('0x3a')](function(){return _0x14aaa2;});}return _0x14aaa2;})[_0xc865('0x3a')](respondWithResult(_0x4a467f,null))[_0xc865('0x2d')](handleError(_0x4a467f,null));};exports['describe']=function(_0x1db673,_0x5e4bbe){return db['MailAccount'][_0xc865('0x67')]()[_0xc865('0x3a')](respondWithResult(_0x5e4bbe,null))[_0xc865('0x2d')](handleError(_0x5e4bbe,null));};exports[_0xc865('0x68')]=function(_0x11dded,_0x3219e5,_0x51c883){if(_0x11dded[_0xc865('0x66')]['id']){delete _0x11dded[_0xc865('0x66')]['id'];}return db['MailAccount'][_0xc865('0x65')]({'where':{'id':_0x11dded[_0xc865('0x69')]['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0x3219e5,null))[_0xc865('0x3a')](function(_0x2c039f){if(_0x2c039f){_0x11dded['body'][_0xc865('0x6a')]=_0x2c039f['id'];return db[_0xc865('0x6b')][_0xc865('0x6c')](_0x11dded[_0xc865('0x66')]);}})[_0xc865('0x3a')](respondWithResult(_0x3219e5,null))[_0xc865('0x2d')](handleError(_0x3219e5,null));};exports[_0xc865('0x6d')]=function(_0x38008c,_0x470177,_0x1e2c10){var _0x493545={'raw':![],'where':{}};var _0x482bff={};var _0x286106={'count':0x0,'rows':[]};return db[_0xc865('0x47')]['findOne']({'where':{'id':_0x38008c['params']['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0x470177,null))[_0xc865('0x3a')](function(_0x336ad4){if(_0x336ad4){_0x482bff[_0xc865('0x4b')]=_[_0xc865('0x64')](db['Disposition'][_0xc865('0x48')]);_0x482bff[_0xc865('0x4d')]=_['keys'](_0x38008c[_0xc865('0x4d')]);_0x482bff[_0xc865('0x4e')]=_['intersection'](_0x482bff[_0xc865('0x4b')],_0x482bff[_0xc865('0x4d')]);_0x493545[_0xc865('0x51')]=_[_0xc865('0x4f')](_0x482bff['model'],qs[_0xc865('0x50')](_0x38008c['query'][_0xc865('0x50')]));_0x493545[_0xc865('0x51')]=_0x493545[_0xc865('0x51')][_0xc865('0x52')]?_0x493545[_0xc865('0x51')]:_0x482bff[_0xc865('0x4b')];if(!_0x38008c[_0xc865('0x4d')]['hasOwnProperty'](_0xc865('0x54'))){_0x493545[_0xc865('0x33')]=qs['limit'](_0x38008c[_0xc865('0x4d')][_0xc865('0x33')]);_0x493545['offset']=qs[_0xc865('0x31')](_0x38008c[_0xc865('0x4d')][_0xc865('0x31')]);}_0x493545[_0xc865('0x55')]=qs[_0xc865('0x56')](_0x38008c[_0xc865('0x4d')][_0xc865('0x56')]);_0x493545['where']=qs[_0xc865('0x4e')](_[_0xc865('0x58')](_0x38008c[_0xc865('0x4d')],_0x482bff[_0xc865('0x4e')]));_0x493545[_0xc865('0x57')][_0xc865('0x6a')]=_0x336ad4['id'];if(_0x38008c[_0xc865('0x4d')][_0xc865('0x5b')]){_0x493545['where']=_['merge'](_0x493545['where'],{'$or':_['map'](_0x493545[_0xc865('0x51')],function(_0x3dfb03){var _0x3a2c5a={};_0x3a2c5a[_0x3dfb03]={'$like':'%'+_0x38008c[_0xc865('0x4d')][_0xc865('0x5b')]+'%'};return _0x3a2c5a;})});}_0x493545=_[_0xc865('0x59')]({},_0x493545,_0x38008c[_0xc865('0x5c')]);return db[_0xc865('0x6b')][_0xc865('0x34')]({'where':_0x493545[_0xc865('0x57')]})['then'](function(_0xc3da60){_0x286106[_0xc865('0x34')]=_0xc3da60;if(_0x38008c[_0xc865('0x4d')][_0xc865('0x5d')]){_0x493545[_0xc865('0x5e')]=[{'all':!![]}];}return db[_0xc865('0x6b')][_0xc865('0x5f')](_0x493545);})[_0xc865('0x3a')](function(_0x24dbea){_0x286106[_0xc865('0x60')]=_0x24dbea;return _0x286106;});}})['then'](respondWithFilteredResult(_0x470177,_0x493545))[_0xc865('0x2d')](handleError(_0x470177,null));};exports[_0xc865('0x6e')]=function(_0xe35097,_0x15a59b,_0x3be864){return db[_0xc865('0x47')]['find']({'where':{'id':_0xe35097[_0xc865('0x69')]['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0x15a59b,null))['then'](function(_0x16617f){if(_0x16617f){return _0x16617f[_0xc865('0x6e')](_0xe35097['query']['ids']);}})['then'](respondWithStatusCode(_0x15a59b,null))[_0xc865('0x2d')](handleError(_0x15a59b,null));};exports[_0xc865('0x6f')]=function(_0x1c2751,_0x129c79,_0x1b25e0){if(_0x1c2751[_0xc865('0x66')]['id']){delete _0x1c2751[_0xc865('0x66')]['id'];}return db[_0xc865('0x47')][_0xc865('0x65')]({'where':{'id':_0x1c2751[_0xc865('0x69')]['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0x129c79,null))[_0xc865('0x3a')](function(_0x467510){if(_0x467510){_0x1c2751['body'][_0xc865('0x6a')]=_0x467510['id'];return db[_0xc865('0x70')][_0xc865('0x6c')](_0x1c2751[_0xc865('0x66')]);}})[_0xc865('0x3a')](respondWithResult(_0x129c79,null))[_0xc865('0x2d')](handleError(_0x129c79,null));};exports[_0xc865('0x71')]=function(_0x47f97f,_0x160cfc,_0x3eabef){var _0x1bedc0={'raw':![],'where':{}};var _0x31ec8b={};var _0x16f52f={'count':0x0,'rows':[]};return db[_0xc865('0x47')][_0xc865('0x72')]({'where':{'id':_0x47f97f[_0xc865('0x69')]['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0x160cfc,null))[_0xc865('0x3a')](function(_0x352167){if(_0x352167){_0x31ec8b[_0xc865('0x4b')]=_[_0xc865('0x64')](db[_0xc865('0x70')][_0xc865('0x48')]);_0x31ec8b[_0xc865('0x4d')]=_[_0xc865('0x64')](_0x47f97f[_0xc865('0x4d')]);_0x31ec8b[_0xc865('0x4e')]=_[_0xc865('0x4f')](_0x31ec8b[_0xc865('0x4b')],_0x31ec8b[_0xc865('0x4d')]);_0x1bedc0[_0xc865('0x51')]=_[_0xc865('0x4f')](_0x31ec8b['model'],qs['fields'](_0x47f97f[_0xc865('0x4d')]['fields']));_0x1bedc0[_0xc865('0x51')]=_0x1bedc0['attributes'][_0xc865('0x52')]?_0x1bedc0['attributes']:_0x31ec8b[_0xc865('0x4b')];if(!_0x47f97f[_0xc865('0x4d')]['hasOwnProperty']('nolimit')){_0x1bedc0[_0xc865('0x33')]=qs['limit'](_0x47f97f['query'][_0xc865('0x33')]);_0x1bedc0[_0xc865('0x31')]=qs['offset'](_0x47f97f[_0xc865('0x4d')]['offset']);}_0x1bedc0['order']=qs['sort'](_0x47f97f[_0xc865('0x4d')][_0xc865('0x56')]);_0x1bedc0[_0xc865('0x57')]=qs[_0xc865('0x4e')](_[_0xc865('0x58')](_0x47f97f[_0xc865('0x4d')],_0x31ec8b['filters']));_0x1bedc0[_0xc865('0x57')][_0xc865('0x6a')]=_0x352167['id'];if(_0x47f97f[_0xc865('0x4d')]['filter']){_0x1bedc0['where']=_[_0xc865('0x59')](_0x1bedc0[_0xc865('0x57')],{'$or':_[_0xc865('0x4c')](_0x1bedc0[_0xc865('0x51')],function(_0x48244b){var _0x43668b={};_0x43668b[_0x48244b]={'$like':'%'+_0x47f97f['query'][_0xc865('0x5b')]+'%'};return _0x43668b;})});}_0x1bedc0=_[_0xc865('0x59')]({},_0x1bedc0,_0x47f97f[_0xc865('0x5c')]);return db['CannedAnswer'][_0xc865('0x34')]({'where':_0x1bedc0[_0xc865('0x57')]})[_0xc865('0x3a')](function(_0x3281f2){_0x16f52f[_0xc865('0x34')]=_0x3281f2;if(_0x47f97f['query'][_0xc865('0x5d')]){_0x1bedc0[_0xc865('0x5e')]=[{'all':!![]}];}return db[_0xc865('0x70')][_0xc865('0x5f')](_0x1bedc0);})['then'](function(_0x536f3f){_0x16f52f[_0xc865('0x60')]=_0x536f3f;return _0x16f52f;});}})[_0xc865('0x3a')](respondWithFilteredResult(_0x160cfc,_0x1bedc0))[_0xc865('0x2d')](handleError(_0x160cfc,null));};exports[_0xc865('0x73')]=function(_0x7cb353,_0x4208a3,_0x1de032){return db[_0xc865('0x47')]['find']({'where':{'id':_0x7cb353[_0xc865('0x69')]['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0x4208a3,null))['then'](function(_0x25081b){if(_0x25081b){return _0x25081b[_0xc865('0x73')](_0x7cb353['query']['ids']);}})[_0xc865('0x3a')](respondWithStatusCode(_0x4208a3,null))[_0xc865('0x2d')](handleError(_0x4208a3,null));};exports[_0xc865('0x6c')]=function(_0xbf5f65,_0x20f4c9){var _0x38f266={'name':_0xbf5f65[_0xc865('0x66')][_0xc865('0x40')],'key':_0xbf5f65[_0xc865('0x66')][_0xc865('0x74')],'email':_0xbf5f65[_0xc865('0x66')][_0xc865('0x75')],'ListId':_0xbf5f65[_0xc865('0x66')][_0xc865('0x76')],'active':!_['isNil'](_0xbf5f65['body'][_0xc865('0x77')])?_0xbf5f65['body'][_0xc865('0x77')]:!![],'description':_0xbf5f65[_0xc865('0x66')][_0xc865('0x78')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0xbf5f65[_0xc865('0x66')][_0xc865('0x79')])){if(_0xbf5f65[_0xc865('0x66')]['cauthentication']){_0x38f266[_0xc865('0x62')]['user']=_0x38f266[_0xc865('0x44')][_0xc865('0x7a')]=_0xbf5f65['body'][_0xc865('0x7b')];_0x38f266['Imap'][_0xc865('0x7c')]=_0x38f266['Smtp'][_0xc865('0x7d')]=_0xbf5f65[_0xc865('0x66')][_0xc865('0x7e')];}else{_0x38f266[_0xc865('0x62')][_0xc865('0x7f')]=_0x38f266['Smtp'][_0xc865('0x7f')]=![];}_0x38f266['Imap'][_0xc865('0x80')]=_0xbf5f65[_0xc865('0x66')]['Imap'][_0xc865('0x80')];_0x38f266[_0xc865('0x62')][_0xc865('0x81')]=_0xbf5f65[_0xc865('0x66')][_0xc865('0x62')]['port'];_0x38f266[_0xc865('0x44')][_0xc865('0x80')]=_0xbf5f65['body'][_0xc865('0x44')][_0xc865('0x80')];_0x38f266[_0xc865('0x44')]['port']=_0xbf5f65[_0xc865('0x66')][_0xc865('0x44')][_0xc865('0x81')];}else{_0x38f266['Imap'][_0xc865('0x82')]=_0x38f266['Smtp'][_0xc865('0x82')]=_0xbf5f65['body'][_0xc865('0x79')];_0x38f266[_0xc865('0x62')][_0xc865('0x7a')]=_0x38f266[_0xc865('0x44')]['user']=_0xbf5f65[_0xc865('0x66')][_0xc865('0x7b')];_0x38f266[_0xc865('0x62')][_0xc865('0x7c')]=_0x38f266[_0xc865('0x44')][_0xc865('0x7d')]=_0xbf5f65['body'][_0xc865('0x7e')];}return db[_0xc865('0x47')][_0xc865('0x6c')](_0x38f266,{'include':[{'model':db[_0xc865('0x63')],'as':_0xc865('0x44')},{'model':db[_0xc865('0x43')],'as':'Imap'}]})[_0xc865('0x3a')](function(_0x265481){var _0x2fa84a=_0xbf5f65[_0xc865('0x7a')][_0xc865('0x83')]({'plain':!![]});if(!_0x2fa84a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fa84a['role']==='user'){var _0x2a5b78=_0x265481[_0xc865('0x83')]({'plain':!![]});return db[_0xc865('0x84')][_0xc865('0x65')]({'where':{'name':_0xc865('0x3c'),'userProfileId':_0x2fa84a[_0xc865('0x85')]},'raw':!![]})['then'](function(_0x55bbd8){if(_0x55bbd8&&_0x55bbd8['autoAssociation']===0x0){return db[_0xc865('0x3d')][_0xc865('0x6c')]({'name':_0x2a5b78[_0xc865('0x40')],'resourceId':_0x2a5b78['id'],'type':_0x55bbd8[_0xc865('0x40')],'sectionId':_0x55bbd8['id']},{})[_0xc865('0x3a')](function(){return _0x265481;});}else{return _0x265481;}})['catch'](function(_0x4a244c){logger['error'](_0xc865('0x86'),_0x4a244c);throw _0x4a244c;});}return _0x265481;})[_0xc865('0x3a')](respondWithResult(_0x20f4c9,0xc9))[_0xc865('0x2d')](handleError(_0x20f4c9,null));};exports[_0xc865('0x87')]=function(_0x3ae3e6,_0x5f4cba,_0xc146ab){return db['MailAccount'][_0xc865('0x72')]({'where':{'id':_0x3ae3e6[_0xc865('0x69')]['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0x5f4cba,null))[_0xc865('0x3a')](function(_0x19a9eb){if(_0x19a9eb){return _0x19a9eb['getImap']();}return null;})[_0xc865('0x3a')](respondWithResult(_0x5f4cba,null))[_0xc865('0x2d')](handleError(_0x5f4cba,null));};exports[_0xc865('0x88')]=function(_0x2052e6,_0x4b7e1a,_0x1639da){if(_0x2052e6['body']['id']){delete _0x2052e6['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x2052e6[_0xc865('0x69')]['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0x4b7e1a,null))[_0xc865('0x3a')](function(_0x1fc346){if(_0x1fc346){_0x2052e6['body'][_0xc865('0x6a')]=_0x1fc346['id'];return db[_0xc865('0x43')][_0xc865('0x6c')](_0x2052e6[_0xc865('0x66')]);}})[_0xc865('0x3a')](respondWithResult(_0x4b7e1a,null))['catch'](handleError(_0x4b7e1a,null));};exports[_0xc865('0x89')]=function(_0x5bebeb,_0x32b3d4,_0xee82ce){return db['MailAccount'][_0xc865('0x72')]({'where':{'id':_0x5bebeb[_0xc865('0x69')]['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0x32b3d4,null))['then'](function(_0x450ec6){if(_0x450ec6){return _0x450ec6[_0xc865('0x8a')](null);}return null;})[_0xc865('0x3a')](respondWithStatusCode(_0x32b3d4,null))[_0xc865('0x2d')](handleError(_0x32b3d4,null));};exports[_0xc865('0x8b')]=function(_0x132ebb,_0xfff402,_0x39034c){return db[_0xc865('0x47')][_0xc865('0x72')]({'where':{'id':_0x132ebb[_0xc865('0x69')]['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0xfff402,null))[_0xc865('0x3a')](function(_0x93ce86){if(_0x93ce86){return _0x93ce86[_0xc865('0x8b')]();}return null;})[_0xc865('0x3a')](respondWithResult(_0xfff402,null))[_0xc865('0x2d')](handleError(_0xfff402,null));};exports[_0xc865('0x8c')]=function(_0x568743,_0x1640d0,_0x3e945b){if(_0x568743['body']['id']){delete _0x568743['body']['id'];}return db[_0xc865('0x47')][_0xc865('0x65')]({'where':{'id':_0x568743[_0xc865('0x69')]['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0x1640d0,null))[_0xc865('0x3a')](function(_0x5dbc1e){if(_0x5dbc1e){_0x568743[_0xc865('0x66')][_0xc865('0x6a')]=_0x5dbc1e['id'];return db[_0xc865('0x63')][_0xc865('0x6c')](_0x568743['body']);}})['then'](respondWithResult(_0x1640d0,null))['catch'](handleError(_0x1640d0,null));};exports[_0xc865('0x8d')]=function(_0x44354e,_0x9c67ce,_0xd62171){return db['MailAccount'][_0xc865('0x72')]({'where':{'id':_0x44354e[_0xc865('0x69')]['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0x9c67ce,null))[_0xc865('0x3a')](function(_0x4b9ff4){if(_0x4b9ff4){return _0x4b9ff4[_0xc865('0x8e')](null);}return null;})[_0xc865('0x3a')](respondWithStatusCode(_0x9c67ce,null))[_0xc865('0x2d')](handleError(_0x9c67ce,null));};exports[_0xc865('0x8f')]=function(_0x5c0bbb,_0x510dd0,_0x3e658d){return db['MailInteraction']['find']({'where':{'id':_0x5c0bbb['params']['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0x510dd0,null))['then'](function(_0x41cd51){if(_0x41cd51){return _0x41cd51[_0xc865('0x8f')](_0x5c0bbb[_0xc865('0x66')][_0xc865('0x90')],_[_0xc865('0x91')](_0x5c0bbb[_0xc865('0x66')],[_0xc865('0x90'),'id'])||{});}})[_0xc865('0x3a')](respondWithResult(_0x510dd0,null))[_0xc865('0x2d')](handleError(_0x510dd0,null));};exports[_0xc865('0x92')]=function(_0x35050a,_0xfa84f,_0x18535b){var _0x1b9c03={'raw':![],'where':{}};var _0x5b806d={};var _0x35136a={'count':0x0,'rows':[]};return db[_0xc865('0x47')][_0xc865('0x72')]({'where':{'id':_0x35050a[_0xc865('0x69')]['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0xfa84f,null))['then'](function(_0x269860){if(_0x269860){_0x5b806d[_0xc865('0x4b')]=_['keys'](db[_0xc865('0x93')]['rawAttributes']);_0x5b806d[_0xc865('0x4d')]=_['keys'](_0x35050a[_0xc865('0x4d')]);_0x5b806d[_0xc865('0x4e')]=_[_0xc865('0x4f')](_0x5b806d[_0xc865('0x4b')],_0x5b806d[_0xc865('0x4d')]);_0x1b9c03[_0xc865('0x51')]=_[_0xc865('0x4f')](_0x5b806d['model'],qs[_0xc865('0x50')](_0x35050a[_0xc865('0x4d')]['fields']));_0x1b9c03[_0xc865('0x51')]=_0x1b9c03[_0xc865('0x51')][_0xc865('0x52')]?_0x1b9c03[_0xc865('0x51')]:_0x5b806d[_0xc865('0x4b')];if(!_0x35050a[_0xc865('0x4d')][_0xc865('0x53')](_0xc865('0x54'))){_0x1b9c03[_0xc865('0x33')]=qs[_0xc865('0x33')](_0x35050a[_0xc865('0x4d')][_0xc865('0x33')]);_0x1b9c03[_0xc865('0x31')]=qs[_0xc865('0x31')](_0x35050a[_0xc865('0x4d')]['offset']);}_0x1b9c03[_0xc865('0x55')]=qs['sort'](_0x35050a['query']['sort']);_0x1b9c03[_0xc865('0x57')]=qs[_0xc865('0x4e')](_[_0xc865('0x58')](_0x35050a[_0xc865('0x4d')],_0x5b806d['filters']));_0x1b9c03[_0xc865('0x57')][_0xc865('0x6a')]=_0x269860['id'];if(_0x35050a[_0xc865('0x4d')][_0xc865('0x5b')]){_0x1b9c03[_0xc865('0x57')]=_['merge'](_0x1b9c03[_0xc865('0x57')],{'$or':_['map'](_0x1b9c03[_0xc865('0x51')],function(_0xc092bb){var _0xd1f08e={};_0xd1f08e[_0xc092bb]={'$like':'%'+_0x35050a[_0xc865('0x4d')][_0xc865('0x5b')]+'%'};return _0xd1f08e;})});}_0x1b9c03=_[_0xc865('0x59')]({},_0x1b9c03,_0x35050a[_0xc865('0x5c')]);return db[_0xc865('0x93')]['count']({'where':_0x1b9c03[_0xc865('0x57')]})['then'](function(_0x250ea0){_0x35136a[_0xc865('0x34')]=_0x250ea0;if(_0x35050a[_0xc865('0x4d')][_0xc865('0x5d')]){_0x1b9c03[_0xc865('0x5e')]=[{'model':db[_0xc865('0x94')],'as':_0xc865('0x95'),'required':![]},{'model':db[_0xc865('0x96')],'as':_0xc865('0x97'),'attributes':[_0xc865('0x40'),_0xc865('0x98'),_0xc865('0x99')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name','color'],'where':_0x35050a[_0xc865('0x4d')][_0xc865('0x9a')]?{'id':_0x35050a[_0xc865('0x4d')]['tag']}:undefined,'required':_0x35050a[_0xc865('0x4d')]['tag']?!![]:![]}];}return db[_0xc865('0x93')][_0xc865('0x5f')](_0x1b9c03);})[_0xc865('0x3a')](function(_0x2bdb85){_0x35136a[_0xc865('0x60')]=_0x2bdb85;return _0x35136a;});}})[_0xc865('0x3a')](respondWithFilteredResult(_0xfa84f,_0x1b9c03))[_0xc865('0x2d')](handleError(_0xfa84f,null));};exports['addApplications']=function addApplications(_0x22818f,_0x202203){var _0x5676b7=_0x22818f[_0xc865('0x69')]['id'];var _0x57a1b8=_0x22818f['body'];var _0x514a3=0xc8;var _0x488e47=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xc865('0x9b')]['Transaction'][_0xc865('0x9c')][_0xc865('0x9d')]},function(_0x5c5db6){return db[_0xc865('0x47')][_0xc865('0x72')]({'where':{'id':_0x5676b7},'transaction':_0x5c5db6})[_0xc865('0x3a')](function(_0x4771e3){if(_0x4771e3){return db[_0xc865('0x9e')][_0xc865('0x3b')]({'where':{'MailAccountId':_0x5676b7},'transaction':_0x5c5db6})[_0xc865('0x3a')](function(){var _0x50d184=_[_0xc865('0x4c')](_0x57a1b8,function(_0x1c3ecb){_0x1c3ecb[_0xc865('0x6a')]=_0x5676b7;return _0x1c3ecb;});return db[_0xc865('0x9e')][_0xc865('0x9f')](_0x50d184,{'transaction':_0x5c5db6});});}else{_0x514a3=0x194;_0x488e47=[];}});})[_0xc865('0x3a')](function(){if(_0x514a3!==0x194){return db[_0xc865('0x9e')][_0xc865('0xa0')]({'where':{'MailAccountId':_0x5676b7},'order':_0xc865('0xa1')})['then'](function(_0x4d4888){_0x488e47=_0x4d4888;});}})[_0xc865('0x2d')](function(_0x215be8){_0x514a3=0x1f4;logger[_0xc865('0x29')](_0x215be8[_0xc865('0x3f')]);if(_0x215be8[_0xc865('0x40')]){delete _0x215be8['name'];}_0x488e47=_0x215be8;})[_0xc865('0xa2')](function(){if(_0x488e47===null){_0x202203['sendStatus'](_0x514a3);}else{if(_0x514a3===0x1f4){_0x202203['status'](_0x514a3)[_0xc865('0x41')](_0x488e47);}else{_0x202203[_0xc865('0x2e')](_0x514a3)[_0xc865('0x30')](_0x488e47);}}});};exports[_0xc865('0xa3')]=function(_0x520d5c,_0x42d115,_0xa8dfa7){var _0x10065d={};var _0x49a474={};var _0x517b9f;var _0x5dcb09;return db[_0xc865('0x47')]['findOne']({'where':{'id':_0x520d5c[_0xc865('0x69')]['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0x42d115,null))[_0xc865('0x3a')](function(_0x1f5eff){if(_0x1f5eff){_0x517b9f=_0x1f5eff;_0x49a474[_0xc865('0x4b')]=_[_0xc865('0x64')](db[_0xc865('0x9e')]['rawAttributes']);_0x49a474[_0xc865('0x4d')]=_[_0xc865('0x64')](_0x520d5c[_0xc865('0x4d')]);_0x49a474[_0xc865('0x4e')]=_['intersection'](_0x49a474[_0xc865('0x4b')],_0x49a474[_0xc865('0x4d')]);_0x10065d['attributes']=_[_0xc865('0x4f')](_0x49a474[_0xc865('0x4b')],qs['fields'](_0x520d5c['query'][_0xc865('0x50')]));_0x10065d[_0xc865('0x51')]=_0x10065d[_0xc865('0x51')][_0xc865('0x52')]?_0x10065d[_0xc865('0x51')]:_0x49a474['model'];_0x10065d[_0xc865('0x55')]=qs[_0xc865('0x56')](_0x520d5c[_0xc865('0x4d')][_0xc865('0x56')]);_0x10065d['where']=qs[_0xc865('0x4e')](_[_0xc865('0x58')](_0x520d5c[_0xc865('0x4d')],_0x49a474[_0xc865('0x4e')]));if(_0x520d5c[_0xc865('0x4d')][_0xc865('0x5b')]){_0x10065d[_0xc865('0x57')]=_[_0xc865('0x59')](_0x10065d[_0xc865('0x57')],{'$or':_['map'](_0x10065d[_0xc865('0x51')],function(_0x588fa5){var _0x11cc82={};_0x11cc82[_0x588fa5]={'$like':'%'+_0x520d5c['query'][_0xc865('0x5b')]+'%'};return _0x11cc82;})});}_0x10065d=_[_0xc865('0x59')]({},_0x10065d,_0x520d5c[_0xc865('0x5c')]);return _0x517b9f[_0xc865('0xa3')](_0x10065d);}})[_0xc865('0x3a')](function(_0x1879ad){if(_0x1879ad){_0x5dcb09=_0x1879ad[_0xc865('0x52')];if(!_0x520d5c[_0xc865('0x4d')][_0xc865('0x53')](_0xc865('0x54'))){_0x10065d[_0xc865('0x33')]=qs[_0xc865('0x33')](_0x520d5c['query'][_0xc865('0x33')]);_0x10065d['offset']=qs[_0xc865('0x31')](_0x520d5c[_0xc865('0x4d')][_0xc865('0x31')]);}return _0x517b9f[_0xc865('0xa3')](_0x10065d);}})['then'](function(_0x50dc7e){if(_0x50dc7e){return _0x50dc7e?{'count':_0x5dcb09,'rows':_0x50dc7e}:null;}})[_0xc865('0x3a')](respondWithResult(_0x42d115,null))[_0xc865('0x2d')](handleError(_0x42d115,null));};exports[_0xc865('0xa4')]=function(_0x48f585,_0x295171,_0x5139c2){var _0x3db51d={'raw':!![],'where':{}};var _0x251334={};var _0x2c54f0={'count':0x0,'rows':[]};return db['MailAccount'][_0xc865('0x72')]({'where':{'id':_0x48f585['params']['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0x295171,null))[_0xc865('0x3a')](function(_0x48b356){if(_0x48b356){_0x251334['model']=_[_0xc865('0x64')](db[_0xc865('0xa5')]['rawAttributes']);_0x251334[_0xc865('0x4d')]=_[_0xc865('0x64')](_0x48f585['query']);_0x251334[_0xc865('0x4e')]=_[_0xc865('0x4f')](_0x251334['model'],_0x251334[_0xc865('0x4d')]);_0x3db51d[_0xc865('0x51')]=_[_0xc865('0x4f')](_0x251334['model'],qs[_0xc865('0x50')](_0x48f585['query']['fields']));_0x3db51d[_0xc865('0x51')]=_0x3db51d['attributes'][_0xc865('0x52')]?_0x3db51d['attributes']:_0x251334[_0xc865('0x4b')];if(!_0x48f585[_0xc865('0x4d')]['hasOwnProperty'](_0xc865('0x54'))){_0x3db51d[_0xc865('0x33')]=qs[_0xc865('0x33')](_0x48f585[_0xc865('0x4d')]['limit']);_0x3db51d['offset']=qs[_0xc865('0x31')](_0x48f585[_0xc865('0x4d')][_0xc865('0x31')]);}_0x3db51d[_0xc865('0x55')]=qs['sort'](_0x48f585[_0xc865('0x4d')][_0xc865('0x56')]);_0x3db51d[_0xc865('0x57')]=qs['filters'](_['pick'](_0x48f585['query'],_0x251334[_0xc865('0x4e')]));_0x3db51d[_0xc865('0x57')][_0xc865('0x6a')]=_0x48b356['id'];if(_0x48f585['query']['filter']){_0x3db51d[_0xc865('0x57')]=_['merge'](_0x3db51d['where'],{'$or':_[_0xc865('0x4c')](_0x3db51d['attributes'],function(_0x5d0024){var _0x172f2b={};_0x172f2b[_0x5d0024]={'$like':'%'+_0x48f585[_0xc865('0x4d')][_0xc865('0x5b')]+'%'};return _0x172f2b;})});}if(_0x48f585[_0xc865('0x4d')][_0xc865('0xa6')]){var _0x3fca84=_0x48f585['query'][_0xc865('0xa6')]['split'](',');var _0xfd6bba={};_0xfd6bba[_0x3fca84[0x0]]={'$gte':moment(_0x3fca84[0x1])[_0xc865('0xa7')](_0xc865('0xa8'))};_0x3db51d[_0xc865('0x57')]=_[_0xc865('0x59')](_0x3db51d[_0xc865('0x57')],_0xfd6bba);}_0x3db51d=_[_0xc865('0x59')]({},_0x3db51d,_0x48f585[_0xc865('0x5c')]);return db[_0xc865('0xa5')]['count']({'where':_0x3db51d[_0xc865('0x57')]})['then'](function(_0x10a306){_0x2c54f0[_0xc865('0x34')]=_0x10a306;if(_0x48f585[_0xc865('0x4d')][_0xc865('0x5d')]){_0x3db51d[_0xc865('0x5e')]=[{'all':!![]}];}return db[_0xc865('0xa5')][_0xc865('0x5f')](_0x3db51d);})[_0xc865('0x3a')](function(_0x5b7923){if(_0x48f585[_0xc865('0x4d')][_0xc865('0xa9')]===_0xc865('0xaa')){for(var _0x256dd3=0x0;_0x256dd3<_0x5b7923[_0xc865('0x52')];_0x256dd3++){_0x5b7923[_0x256dd3][_0xc865('0x66')]=juice(_0x5b7923[_0x256dd3][_0xc865('0x66')]);}}_0x2c54f0[_0xc865('0x60')]=_0x5b7923;return _0x2c54f0;});}})[_0xc865('0x3a')](respondWithFilteredResult(_0x295171,_0x3db51d))[_0xc865('0x2d')](handleError(_0x295171,null));};exports['send']=function(_0x735e47,_0x537f26,_0x5156ba){var _0x148f5b,_0x4af9d2={},_0x120726;if(_0x735e47[_0xc865('0x66')]['to']){_0x120726=_0x735e47[_0xc865('0x66')]['to'][_0xc865('0xab')](',')[0x0];}return db[_0xc865('0x47')][_0xc865('0x65')]({'where':{'id':_0x735e47[_0xc865('0x69')]['id']},'include':[{'model':db[_0xc865('0xac')],'as':_0xc865('0xad'),'include':[{'model':db[_0xc865('0x94')],'as':_0xc865('0xae'),'where':{'email':_0x120726},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xc865('0x63')],'as':_0xc865('0x44'),'raw':!![]}]})[_0xc865('0x3a')](handleEntityNotFound(_0x537f26,null))['then'](function(_0x92a6d1){if(_0x92a6d1){_0x148f5b=_0x92a6d1;if(_0x92a6d1['Smtp']){if(_[_0xc865('0xaf')](_0x735e47[_0xc865('0x66')][_0xc865('0xb0')])){_0x735e47['body'][_0xc865('0xb0')]=util[_0xc865('0xa7')](_0xc865('0xb1'),_0x92a6d1[_0xc865('0x40')],_0x92a6d1[_0xc865('0x75')]||_0x92a6d1['Smtp']['user']);}if(_0x735e47[_0xc865('0x66')][_0xc865('0xb2')]&&_0x735e47[_0xc865('0x66')][_0xc865('0xb2')][_0xc865('0x52')]){for(var _0xcb0a24=0x0;_0xcb0a24<_0x735e47[_0xc865('0x66')][_0xc865('0xb2')][_0xc865('0x52')];_0xcb0a24+=0x1){_0x735e47[_0xc865('0x66')][_0xc865('0xb2')][_0xcb0a24]={'filename':_0x735e47['body'][_0xc865('0xb2')][_0xcb0a24][_0xc865('0x40')],'path':path['join'](config[_0xc865('0xb3')],_0xc865('0xb4'),_0x735e47[_0xc865('0x66')]['attachments'][_0xcb0a24][_0xc865('0xb5')])};}}var _0x1ef67c={'tls':{'rejectUnauthorized':![]}};if(_[_0xc865('0xaf')](_0x92a6d1['Smtp'][_0xc865('0x82')])){if(_0x92a6d1[_0xc865('0x44')][_0xc865('0x7f')]){_0x1ef67c[_0xc865('0xb6')]={'user':_0x92a6d1[_0xc865('0x44')][_0xc865('0x7a')],'pass':_0x92a6d1[_0xc865('0x44')]['pass']};}_0x1ef67c['host']=_0x92a6d1['Smtp'][_0xc865('0x80')];_0x1ef67c[_0xc865('0x81')]=_0x92a6d1[_0xc865('0x44')]['port'];_0x1ef67c[_0xc865('0xb7')]=_0x92a6d1[_0xc865('0x44')][_0xc865('0xb7')];}else{_0x1ef67c[_0xc865('0x82')]=_0x92a6d1[_0xc865('0x44')]['service'];_0x1ef67c['auth']={'user':_0x92a6d1[_0xc865('0x44')][_0xc865('0x7a')],'pass':_0x92a6d1[_0xc865('0x44')]['pass']};}return respondWithRpcPromise(_0xc865('0xb8'),_0xc865('0xb9'),{'account':_0x1ef67c,'message':_0x735e47[_0xc865('0x66')]});}else{throw new Error('List\x20not\x20found');}}})[_0xc865('0x3a')](function(_0x11439e){if(_0x11439e){_0x4af9d2=_0x11439e;if(_0x148f5b['List']){if(_0x148f5b[_0xc865('0xad')]['Contacts']['length']){return _0x148f5b[_0xc865('0xad')][_0xc865('0xae')][0x0];}else{return db[_0xc865('0x94')][_0xc865('0x6c')](_[_0xc865('0xba')](_0x735e47[_0xc865('0x66')],{'firstName':_0x735e47[_0xc865('0x66')]['to'],'email':_0x735e47[_0xc865('0x66')]['to'],'phone':_0x735e47[_0xc865('0x66')]['to'],'ListId':_0x148f5b[_0xc865('0x76')]}));}}else{throw new Error(_0xc865('0xbb'));}}})[_0xc865('0x3a')](function(_0x2050eb){if(_0x2050eb){var _0x4c3339={'UserId':_0x735e47[_0xc865('0x7a')]['id'],'ContactId':_0x2050eb['id'],'MailAccountId':_0x148f5b['id'],'inReplyTo':_0x4af9d2[_0xc865('0xbc')],'to':_0x735e47[_0xc865('0x66')][_0xc865('0xb0')],'cc':_0x735e47[_0xc865('0x66')]['cc'],'subject':_0x735e47['body']['subject'],'attach':_0x735e47[_0xc865('0x66')][_0xc865('0xbd')],'firstMsgDirection':_0xc865('0xbe'),'lastMsgAt':moment()[_0xc865('0xa7')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xc865('0xbe'),'Messages':[_['merge'](_0x735e47['body'],{'messageId':_0x4af9d2[_0xc865('0xbc')],'sentAt':moment()[_0xc865('0xa7')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x148f5b['id'],'UserId':_0x735e47[_0xc865('0x7a')]['id'],'ContactId':_0x2050eb['id']})]};if(_0x735e47[_0xc865('0x66')][_0xc865('0xbf')]){_0x4c3339=_[_0xc865('0x59')](_0x4c3339,_0x735e47[_0xc865('0x66')][_0xc865('0xbf')]);}return db[_0xc865('0x93')][_0xc865('0x6c')](_0x4c3339,{'include':[{'model':db[_0xc865('0xa5')],'as':_0xc865('0xc0')}]});}})[_0xc865('0x3a')](respondWithResult(_0x537f26,null))[_0xc865('0x2d')](handleError(_0x537f26,null));};exports['verifySmtp']=function(_0x12decd,_0x3e5f19,_0x46d1e8){return db[_0xc865('0x47')][_0xc865('0x65')]({'where':{'id':_0x12decd[_0xc865('0x69')]['id']},'include':[{'model':db[_0xc865('0x63')],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x3e5f19,null))[_0xc865('0x3a')](function(_0xc0c266){if(_0xc0c266&&_0xc0c266[_0xc865('0x44')]){var _0x54f63b={'id':_0xc0c266['id'],'tls':{'rejectUnauthorized':![]}};if(_0xc0c266[_0xc865('0x44')][_0xc865('0x82')]){_0x54f63b[_0xc865('0x82')]=_0xc0c266[_0xc865('0x44')][_0xc865('0x82')];}else{_0x54f63b[_0xc865('0x80')]=_0xc0c266['Smtp']['host'];_0x54f63b['port']=_0xc0c266['Smtp'][_0xc865('0x81')];_0x54f63b['secure']=_0xc0c266['Smtp']['secure'];}if(_0xc0c266[_0xc865('0x44')][_0xc865('0x7f')]){_0x54f63b['auth']={'user':_0xc0c266[_0xc865('0x44')][_0xc865('0x7a')],'pass':_0xc0c266[_0xc865('0x44')][_0xc865('0x7d')]};}return respondWithRpcPromise(_0xc865('0xc1'),_0xc865('0xc2'),{'account':_0x54f63b});}})[_0xc865('0x3a')](respondWithResult(_0x3e5f19,null))[_0xc865('0x2d')](handleError(_0x3e5f19,null));};exports[_0xc865('0x3b')]=function(_0x310ef5,_0x1d84e2){return db[_0xc865('0x47')][_0xc865('0x65')]({'where':{'id':_0x310ef5[_0xc865('0x69')]['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0x1d84e2,null))['then'](function(_0x1db73d){if(_0x1db73d&&_0x1db73d[_0xc865('0x82')]){throw new db[(_0xc865('0xc3'))][(_0xc865('0xc4'))](_0xc865('0xc5'));}return _0x1db73d;})[_0xc865('0x3a')](removeEntity(_0x1d84e2,null))[_0xc865('0x2d')](handleError(_0x1d84e2,null));};exports[_0xc865('0xc6')]=function(_0x1d7f6a,_0x4be25c,_0x77cca1){return db['MailAccount'][_0xc865('0x65')]({'where':{'id':_0x1d7f6a['params']['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0x4be25c,null))[_0xc865('0x3a')](function(_0x608fe1){if(_0x608fe1){return _0x608fe1[_0xc865('0xc6')](_0x1d7f6a[_0xc865('0x66')][_0xc865('0x90')],_[_0xc865('0x91')](_0x1d7f6a['body'],[_0xc865('0x90'),'id'])||{})['spread'](function(_0x1bf1c7){for(var _0x458492=0x0;_0x458492<_0x1d7f6a[_0xc865('0x66')][_0xc865('0x90')][_0xc865('0x52')];_0x458492+=0x1){socket[_0xc865('0xc7')]('userMailAccount:save',{'UserId':Number(_0x1d7f6a['body'][_0xc865('0x90')][_0x458492]),'MailAccountId':Number(_0x1d7f6a[_0xc865('0x69')]['id'])});}return _0x1bf1c7;});}})[_0xc865('0x3a')](respondWithResult(_0x4be25c,null))['catch'](handleError(_0x4be25c,null));};exports['removeAgents']=function(_0x53c780,_0x57ef75,_0x1f92a2){return db['MailAccount'][_0xc865('0x65')]({'where':{'id':_0x53c780[_0xc865('0x69')]['id']}})[_0xc865('0x3a')](handleEntityNotFound(_0x57ef75,null))[_0xc865('0x3a')](function(_0x276912){if(_0x276912){return _0x276912[_0xc865('0xc8')](_0x53c780[_0xc865('0x4d')][_0xc865('0x90')])['then'](function(){if(_[_0xc865('0xc9')](_0x53c780[_0xc865('0x4d')][_0xc865('0x90')])){for(var _0x5a415c=0x0;_0x5a415c<_0x53c780[_0xc865('0x4d')][_0xc865('0x90')][_0xc865('0x52')];_0x5a415c+=0x1){socket[_0xc865('0xc7')]('userMailAccount:remove',{'UserId':Number(_0x53c780[_0xc865('0x4d')][_0xc865('0x90')][_0x5a415c]),'MailAccountId':Number(_0x53c780['params']['id'])});}}else{socket[_0xc865('0xc7')](_0xc865('0xca'),{'UserId':Number(_0x53c780['query']['ids']),'MailAccountId':Number(_0x53c780[_0xc865('0x69')]['id'])});}});}})[_0xc865('0x3a')](respondWithStatusCode(_0x57ef75,null))[_0xc865('0x2d')](handleError(_0x57ef75,null));};exports[_0xc865('0xcb')]=function(_0x392f07,_0x494b78,_0xb3e70b){var _0x3d07ff={};var _0x8c9071={};var _0x1ecdd3;var _0x5121e6;return db['MailAccount']['findOne']({'where':{'id':_0x392f07[_0xc865('0x69')]['id']}})['then'](handleEntityNotFound(_0x494b78,null))['then'](function(_0x4bcf50){if(_0x4bcf50){_0x1ecdd3=_0x4bcf50;_0x8c9071[_0xc865('0x4b')]=_[_0xc865('0x64')](db['User'][_0xc865('0x48')]);_0x8c9071['query']=_[_0xc865('0x64')](_0x392f07['query']);_0x8c9071[_0xc865('0x4e')]=_[_0xc865('0x4f')](_0x8c9071[_0xc865('0x4b')],_0x8c9071[_0xc865('0x4d')]);_0x3d07ff[_0xc865('0x51')]=_[_0xc865('0x4f')](_0x8c9071[_0xc865('0x4b')],qs['fields'](_0x392f07[_0xc865('0x4d')][_0xc865('0x50')]));_0x3d07ff[_0xc865('0x51')]=_0x3d07ff[_0xc865('0x51')][_0xc865('0x52')]?_0x3d07ff[_0xc865('0x51')]:_0x8c9071[_0xc865('0x4b')];_0x3d07ff[_0xc865('0x55')]=qs[_0xc865('0x56')](_0x392f07[_0xc865('0x4d')][_0xc865('0x56')]);_0x3d07ff['where']=qs[_0xc865('0x4e')](_['pick'](_0x392f07[_0xc865('0x4d')],_0x8c9071[_0xc865('0x4e')]));if(_0x392f07[_0xc865('0x4d')][_0xc865('0x5b')]){_0x3d07ff[_0xc865('0x57')]=_['merge'](_0x3d07ff[_0xc865('0x57')],{'$or':_[_0xc865('0x4c')](_0x3d07ff[_0xc865('0x51')],function(_0x53f7e3){var _0x531e59={};_0x531e59[_0x53f7e3]={'$like':'%'+_0x392f07[_0xc865('0x4d')][_0xc865('0x5b')]+'%'};return _0x531e59;})});}_0x3d07ff=_[_0xc865('0x59')]({},_0x3d07ff,_0x392f07[_0xc865('0x5c')]);return _0x1ecdd3[_0xc865('0xcb')](_0x3d07ff);}})['then'](function(_0x33efaa){if(_0x33efaa){_0x5121e6=_0x33efaa[_0xc865('0x52')];if(!_0x392f07['query']['hasOwnProperty'](_0xc865('0x54'))){_0x3d07ff['limit']=qs[_0xc865('0x33')](_0x392f07[_0xc865('0x4d')][_0xc865('0x33')]);_0x3d07ff['offset']=qs[_0xc865('0x31')](_0x392f07['query'][_0xc865('0x31')]);}return _0x1ecdd3[_0xc865('0xcb')](_0x3d07ff);}})[_0xc865('0x3a')](function(_0x2856f8){if(_0x2856f8){return _0x2856f8?{'count':_0x5121e6,'rows':_0x2856f8}:null;}})[_0xc865('0x3a')](respondWithResult(_0x494b78,null))[_0xc865('0x2d')](handleError(_0x494b78,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 5193be2..cc0228b 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 _0x7e1d=['hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x101adc,_0x2e97fa){var _0x403d57=function(_0x593af4){while(--_0x593af4){_0x101adc['push'](_0x101adc['shift']());}};_0x403d57(++_0x2e97fa);}(_0x7e1d,0x15a));var _0xd7e1=function(_0x44142e,_0x2cd072){_0x44142e=_0x44142e-0x0;var _0x3bf323=_0x7e1d[_0x44142e];return _0x3bf323;};'use strict';var EventEmitter=require(_0xd7e1('0x0'));var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xd7e1('0x1')](0x0);var events={'afterCreate':_0xd7e1('0x2'),'afterUpdate':_0xd7e1('0x3'),'afterDestroy':_0xd7e1('0x4')};function emitEvent(_0x11af92){return function(_0x143b3f,_0x51424f,_0x28bddc){MailAccountEvents[_0xd7e1('0x5')](_0x11af92+':'+_0x143b3f['id'],_0x143b3f);MailAccountEvents[_0xd7e1('0x5')](_0x11af92,_0x143b3f);_0x28bddc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xd7e1('0x6')](e,emitEvent(event));}}module[_0xd7e1('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x87e5=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x87e5,0xc1));var _0x587e=function(_0x54a9b9,_0x31352f){_0x54a9b9=_0x54a9b9-0x0;var _0x2a34ef=_0x87e5[_0x54a9b9];return _0x2a34ef;};'use strict';var EventEmitter=require(_0x587e('0x0'));var MailAccount=require(_0x587e('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x587e('0x2')](0x0);var events={'afterCreate':_0x587e('0x3'),'afterUpdate':'update','afterDestroy':_0x587e('0x4')};function emitEvent(_0x753094){return function(_0xf5e6d,_0xe69b6b,_0x3ec3a3){MailAccountEvents[_0x587e('0x5')](_0x753094+':'+_0xf5e6d['id'],_0xf5e6d);MailAccountEvents['emit'](_0x753094,_0xf5e6d);_0x3ec3a3(null);};}for(var e in events){if(events[_0x587e('0x6')](e)){var event=events[e];MailAccount[_0x587e('0x7')](e,emitEvent(event));}}module[_0x587e('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 8b81815..9e0fb95 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 _0x7802=['bluebird','request-promise','path','../../config/environment','exports','MailAccount','mail_accounts','lodash','util','../../config/logger','api','moment'];(function(_0xabe726,_0x4952e7){var _0x36d3d9=function(_0x551437){while(--_0x551437){_0xabe726['push'](_0xabe726['shift']());}};_0x36d3d9(++_0x4952e7);}(_0x7802,0x16f));var _0x2780=function(_0x3cad98,_0x3a6539){_0x3cad98=_0x3cad98-0x0;var _0x53f43c=_0x7802[_0x3cad98];return _0x53f43c;};'use strict';var _=require(_0x2780('0x0'));var util=require(_0x2780('0x1'));var logger=require(_0x2780('0x2'))(_0x2780('0x3'));var moment=require(_0x2780('0x4'));var BPromise=require(_0x2780('0x5'));var rp=require(_0x2780('0x6'));var fs=require('fs');var path=require(_0x2780('0x7'));var rimraf=require('rimraf');var config=require(_0x2780('0x8'));var attributes=require('./mailAccount.attributes');module[_0x2780('0x9')]=function(_0x35e6e2,_0x59b39b){return _0x35e6e2['define'](_0x2780('0xa'),attributes,{'tableName':_0x2780('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6792=['bluebird','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','util','../../config/logger','moment'];(function(_0xdc5fb5,_0xf29632){var _0x40113b=function(_0x572278){while(--_0x572278){_0xdc5fb5['push'](_0xdc5fb5['shift']());}};_0x40113b(++_0xf29632);}(_0x6792,0x14e));var _0x2679=function(_0x2c4b47,_0x41d515){_0x2c4b47=_0x2c4b47-0x0;var _0x204e4d=_0x6792[_0x2c4b47];return _0x204e4d;};'use strict';var _=require(_0x2679('0x0'));var util=require(_0x2679('0x1'));var logger=require(_0x2679('0x2'))('api');var moment=require(_0x2679('0x3'));var BPromise=require(_0x2679('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2679('0x5'));var rimraf=require(_0x2679('0x6'));var config=require(_0x2679('0x7'));var attributes=require(_0x2679('0x8'));module[_0x2679('0x9')]=function(_0x1150be,_0xe68e68){return _0x1150be[_0x2679('0xa')](_0x2679('0xb'),attributes,{'tableName':_0x2679('0xc'),'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 0f3a0c6..5bb3ca7 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 _0x58ca=['List\x20not\x20found','contact','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailMessage','MailInteraction','Contact\x20not\x20found','format','interaction','originTo','originCc','bcc','ChatOfflineMessageId','Attachment','Attachments','UserId','name','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','model','map','stringify','catch','ShowMailAccount','find','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','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','applications','list','priority','asc','autoclose','length','close','*,*,*,*','defaults','create'];(function(_0x1ed7b0,_0x5a7052){var _0x2884d9=function(_0x13ce0c){while(--_0x13ce0c){_0x1ed7b0['push'](_0x1ed7b0['shift']());}};_0x2884d9(++_0x5a7052);}(_0x58ca,0x14f));var _0xa58c=function(_0x6dd18f,_0x2108b3){_0x6dd18f=_0x6dd18f-0x0;var _0x421d65=_0x58ca[_0x6dd18f];return _0x421d65;};'use strict';var _=require(_0xa58c('0x0'));var util=require(_0xa58c('0x1'));var moment=require('moment');var BPromise=require(_0xa58c('0x2'));var rs=require(_0xa58c('0x3'));var fs=require('fs');var Redis=require(_0xa58c('0x4'));var db=require(_0xa58c('0x5'))['db'];var utils=require(_0xa58c('0x6'));var logger=require('../../config/logger')(_0xa58c('0x7'));var config=require(_0xa58c('0x8'));var jayson=require(_0xa58c('0x9'));var client=jayson[_0xa58c('0xa')][_0xa58c('0xb')]({'port':0x232c});config[_0xa58c('0xc')]=_['defaults'](config[_0xa58c('0xc')],{'host':_0xa58c('0xd'),'port':0x18eb});var socket=require(_0xa58c('0xe'))(new Redis(config[_0xa58c('0xc')]));require(_0xa58c('0xf'))[_0xa58c('0x10')](socket);function respondWithRpcPromise(_0x22e8d1,_0x8eaac3,_0xfa83f1){return new BPromise(function(_0x33c8b4,_0x3c7628){return client[_0xa58c('0x11')](_0x22e8d1,_0xfa83f1)[_0xa58c('0x12')](function(_0x575c6a){logger[_0xa58c('0x13')](_0xa58c('0x14'),_0x8eaac3,_0xa58c('0x15'));logger[_0xa58c('0x16')](_0xa58c('0x17'),_0x8eaac3,_0xa58c('0x15'),JSON['stringify'](_0x575c6a));if(_0x575c6a[_0xa58c('0x18')]){if(_0x575c6a['error'][_0xa58c('0x19')]===0x1f4){logger[_0xa58c('0x18')](_0xa58c('0x14'),_0x8eaac3,_0x575c6a[_0xa58c('0x18')][_0xa58c('0x1a')]);return _0x3c7628(_0x575c6a['error'][_0xa58c('0x1a')]);}logger[_0xa58c('0x18')]('MailAccount,\x20%s,\x20%s',_0x8eaac3,_0x575c6a[_0xa58c('0x18')]['message']);return _0x33c8b4(_0x575c6a['error']['message']);}else{logger['info'](_0xa58c('0x14'),_0x8eaac3,_0xa58c('0x15'));_0x33c8b4(_0x575c6a[_0xa58c('0x1b')][_0xa58c('0x1a')]);}})['catch'](function(_0x5a62b7){logger[_0xa58c('0x18')](_0xa58c('0x14'),_0x8eaac3,_0x5a62b7);_0x3c7628(_0x5a62b7);});});}exports[_0xa58c('0x1c')]=function(_0x1af5e4){var _0x36a9e8=this;return new Promise(function(_0x5e69da,_0x187f07){return db[_0xa58c('0x1d')][_0xa58c('0x1e')]({'raw':_0x1af5e4[_0xa58c('0x1f')]?_0x1af5e4[_0xa58c('0x1f')][_0xa58c('0x20')]===undefined?!![]:![]:!![],'where':_0x1af5e4['options']?_0x1af5e4[_0xa58c('0x1f')][_0xa58c('0x21')]||null:null,'attributes':_0x1af5e4['options']?_0x1af5e4['options'][_0xa58c('0x22')]||null:null,'limit':_0x1af5e4[_0xa58c('0x1f')]?_0x1af5e4[_0xa58c('0x1f')]['limit']||null:null,'include':_0x1af5e4[_0xa58c('0x1f')]?_0x1af5e4[_0xa58c('0x1f')][_0xa58c('0x23')]?_['map'](_0x1af5e4[_0xa58c('0x1f')][_0xa58c('0x23')],function(_0x277159){return{'model':db[_0x277159['model']],'as':_0x277159['as'],'attributes':_0x277159['attributes'],'include':_0x277159[_0xa58c('0x23')]?_['map'](_0x277159[_0xa58c('0x23')],function(_0x3dde83){return{'model':db[_0x3dde83[_0xa58c('0x24')]],'as':_0x3dde83['as'],'attributes':_0x3dde83['attributes'],'include':_0x3dde83[_0xa58c('0x23')]?_[_0xa58c('0x25')](_0x3dde83[_0xa58c('0x23')],function(_0x12cb4f){return{'model':db[_0x12cb4f[_0xa58c('0x24')]],'as':_0x12cb4f['as'],'attributes':_0x12cb4f['attributes']};}):[]};}):[]};}):[]:[]})[_0xa58c('0x12')](function(_0x191b1e){logger[_0xa58c('0x13')](_0xa58c('0x1c'),_0x1af5e4);logger[_0xa58c('0x16')](_0xa58c('0x1c'),_0x1af5e4,JSON[_0xa58c('0x26')](_0x191b1e));_0x5e69da(_0x191b1e);})[_0xa58c('0x27')](function(_0x161d77){logger[_0xa58c('0x18')](_0xa58c('0x1c'),_0x161d77[_0xa58c('0x1a')],_0x1af5e4);_0x187f07(_0x36a9e8[_0xa58c('0x18')](0x1f4,_0x161d77['message']));});});};exports[_0xa58c('0x28')]=function(_0x44136d){var _0x212b7b=this;return new Promise(function(_0x1d09a2,_0x1c8e34){return db[_0xa58c('0x1d')][_0xa58c('0x29')]({'raw':_0x44136d[_0xa58c('0x1f')]?_0x44136d[_0xa58c('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x44136d[_0xa58c('0x1f')]?_0x44136d['options'][_0xa58c('0x21')]||null:null,'attributes':_0x44136d[_0xa58c('0x1f')]?_0x44136d[_0xa58c('0x1f')][_0xa58c('0x22')]||null:null,'include':_0x44136d[_0xa58c('0x1f')]?_0x44136d['options']['include']?_[_0xa58c('0x25')](_0x44136d['options'][_0xa58c('0x23')],function(_0x46f2a6){return{'model':db[_0x46f2a6[_0xa58c('0x24')]],'as':_0x46f2a6['as'],'attributes':_0x46f2a6[_0xa58c('0x22')],'include':_0x46f2a6['include']?_[_0xa58c('0x25')](_0x46f2a6[_0xa58c('0x23')],function(_0x5d453a){return{'model':db[_0x5d453a[_0xa58c('0x24')]],'as':_0x5d453a['as'],'attributes':_0x5d453a[_0xa58c('0x22')],'include':_0x5d453a[_0xa58c('0x23')]?_[_0xa58c('0x25')](_0x5d453a['include'],function(_0x480427){return{'model':db[_0x480427['model']],'as':_0x480427['as'],'attributes':_0x480427[_0xa58c('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa58c('0x12')](function(_0x503620){logger[_0xa58c('0x13')](_0xa58c('0x28'),_0x44136d);logger[_0xa58c('0x16')](_0xa58c('0x28'),_0x44136d,JSON[_0xa58c('0x26')](_0x503620));_0x1d09a2(_0x503620);})[_0xa58c('0x27')](function(_0x1568be){logger[_0xa58c('0x18')]('ShowMailAccount',_0x1568be['message'],_0x44136d);_0x1c8e34(_0x212b7b['error'](0x1f4,_0x1568be[_0xa58c('0x1a')]));});});};exports[_0xa58c('0x2a')]=function(_0x291ce5){var _0x3e63f9=this;return new Promise(function(_0xa87d38,_0x50eb61){var _0x48158c={'body':_0x291ce5[_0xa58c('0x2b')],'channel':_0xa58c('0x2c')};var _0x512c70=_[_0xa58c('0x2d')](_[_0xa58c('0x2e')](db[_0xa58c('0x2f')][_0xa58c('0x30')]),[_0xa58c('0x31'),'updatedAt',_0xa58c('0x32'),_0xa58c('0x33')]);var _0xe517c1=![];if(_0x291ce5[_0xa58c('0x2b')]['id']){delete _0x291ce5[_0xa58c('0x2b')]['id'];}if(_[_0xa58c('0x34')](_0x291ce5['body'][_0xa58c('0x35')])){return _0x50eb61(_0x3e63f9[_0xa58c('0x18')](0x1f4,_0xa58c('0x36')));}if(_['isNil'](_0x291ce5['body'][_0xa58c('0x2b')])||_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x2b')]===''){return _0x50eb61(_0x3e63f9[_0xa58c('0x18')](0x1f4,_0xa58c('0x37')));}if(_[_0xa58c('0x34')](_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x38')])){return _0x50eb61(_0x3e63f9['error'](0x1f4,_0xa58c('0x39')+_0x512c70));}if(!_[_0xa58c('0x3a')](_0x512c70,_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x38')])){return _0x50eb61(_0x3e63f9[_0xa58c('0x18')](0x1f4,_0xa58c('0x3b')+_0x512c70));}var _0x568862={};_0x568862[_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x38')]]=_0x291ce5['body'][_0xa58c('0x35')];return db[_0xa58c('0x1d')][_0xa58c('0x29')]({'where':{'id':_0x291ce5[_0xa58c('0x3c')]['id']},'include':[{'model':db[_0xa58c('0x3d')],'as':_0xa58c('0x3e'),'include':[{'model':db[_0xa58c('0x2f')],'as':_0xa58c('0x3f'),'where':_0x568862,'limit':0x1,'order':[['updatedAt',_0xa58c('0x40')]]}]},{'model':db[_0xa58c('0x41')],'as':_0xa58c('0x42')},{'model':db[_0xa58c('0x43')],'as':_0xa58c('0x44')}]})[_0xa58c('0x12')](function(_0x262723){if(_0x262723&&_0x262723['List']){var _0x4df6e0=_0x262723[_0xa58c('0x45')]({'plain':!![]});_0x48158c[_0xa58c('0x3c')]=_[_0xa58c('0x46')](_0x4df6e0,[_0xa58c('0x42'),_0xa58c('0x3e')]);_0x48158c[_0xa58c('0x47')]=_0x4df6e0[_0xa58c('0x42')];_0x48158c[_0xa58c('0x48')]=_0x4df6e0['List'];_0x48158c[_0xa58c('0x47')]=_['orderBy'](_0x48158c['applications'],[_0xa58c('0x49')],[_0xa58c('0x4a')]);if(_0x48158c[_0xa58c('0x3c')]&&_0x48158c[_0xa58c('0x3c')][_0xa58c('0x4b')]){_0x48158c['applications']['push']({'id':0x0,'priority':_0x48158c[_0xa58c('0x47')][_0xa58c('0x4c')]+0x1,'app':_0xa58c('0x4d'),'appdata':'autoclose','interval':_0xa58c('0x4e')});}if(_0x48158c['account'][_0xa58c('0x42')]){delete _0x48158c[_0xa58c('0x3c')][_0xa58c('0x42')];}if(_0x48158c[_0xa58c('0x3c')][_0xa58c('0x3e')]){delete _0x48158c['account']['List'];}if(_0x4df6e0[_0xa58c('0x3e')][_0xa58c('0x3f')][_0xa58c('0x4c')]){return _0x4df6e0[_0xa58c('0x3e')][_0xa58c('0x3f')][0x0];}var _0x291874=_[_0xa58c('0x4f')](_0x291ce5[_0xa58c('0x2b')],{'firstName':_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x35')],'ListId':_0x4df6e0['ListId']});_0x291874[_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x38')]]=_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x35')];return db[_0xa58c('0x2f')][_0xa58c('0x50')](_0x291874);}else{throw new Error(_0xa58c('0x51'));}})['then'](function(_0x1b8419){_0x48158c[_0xa58c('0x52')]=_0x1b8419;if(_0x1b8419){if(!_0x291ce5[_0xa58c('0x2b')]['message']['messageId']){_0x291ce5[_0xa58c('0x2b')]['message'][_0xa58c('0x53')]=rs['generate']()+'\x20'+_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x1a')][_0xa58c('0x35')];}var _0x556e5a={'ContactId':_0x1b8419['id'],'MailAccountId':_0x291ce5['account']['id'],'inReplyTo':_0x291ce5['body'][_0xa58c('0x1a')]['messageId'],'to':_0x291ce5['body'][_0xa58c('0x1a')]['from'],'cc':_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x1a')]['cc'],'subject':_0x291ce5[_0xa58c('0x2b')]['message'][_0xa58c('0x54')],'attach':_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x1a')][_0xa58c('0x55')],'lastMsgAt':moment()['format'](_0xa58c('0x56')),'lastMsgDirection':'in'};return db['MailInteraction'][_0xa58c('0x29')]({'where':{'closed':![],'MailAccountId':_0x291ce5['account']['id']},'include':[{'model':db[_0xa58c('0x57')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x291ce5['body'][_0xa58c('0x1a')]['inReplyTo']}}]})[_0xa58c('0x12')](function(_0x4be005){if(_0x4be005){return[_0x4be005,![]];}return db[_0xa58c('0x58')][_0xa58c('0x50')](_0x556e5a)['then'](function(_0x2dac25){return[_0x2dac25,!![]];});});}else{throw new Error(_0xa58c('0x59'));}})['spread'](function(_0x5c71ae,_0x283756){if(_0x5c71ae){_0xe517c1=_0x283756;if(!_0x283756){return _0x5c71ae['update']({'inReplyTo':_0x291ce5['body'][_0xa58c('0x1a')][_0xa58c('0x53')],'to':_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x1a')][_0xa58c('0x35')],'cc':_0x291ce5['body'][_0xa58c('0x1a')]['cc'],'subject':_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x1a')][_0xa58c('0x54')],'attach':_0x5c71ae['attach']?_0x5c71ae['attach']:_0x291ce5[_0xa58c('0x2b')]['message']['attach'],'substatus':null,'substatusAt':moment()[_0xa58c('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xa58c('0x5a')](_0xa58c('0x56')),'lastMsgDirection':'in'});}else{return _0x5c71ae;}}})[_0xa58c('0x12')](function(_0x2c5fe0){_0x48158c['interaction']=_0x2c5fe0[_0xa58c('0x45')]({'plain':!![]});_0x48158c[_0xa58c('0x5b')]['created']=_0xe517c1;return db['MailMessage']['create']({'body':_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x2b')],'MailAccountId':_0x291ce5[_0xa58c('0x3c')]['id'],'MailInteractionId':_0x2c5fe0['id'],'direction':'in','ContactId':_0x48158c['contact']['id'],'messageId':_0x291ce5['body'][_0xa58c('0x1a')][_0xa58c('0x53')],'from':_0x291ce5[_0xa58c('0x2b')]['message'][_0xa58c('0x35')],'to':_0x291ce5[_0xa58c('0x2b')]['message']['to'],'cc':_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x1a')]['cc'],'subject':_0x291ce5['body'][_0xa58c('0x1a')][_0xa58c('0x54')],'attach':_0x291ce5['body'][_0xa58c('0x1a')][_0xa58c('0x55')],'Attachments':_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x1a')]['attachments'],'originTo':_0x291ce5[_0xa58c('0x2b')]['message'][_0xa58c('0x5c')],'originCc':_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x1a')][_0xa58c('0x5d')],'bcc':_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x1a')][_0xa58c('0x5e')],'ChatWebsiteId':_0x291ce5['body']['message']['ChatWebsiteId']||null,'originChannel':_0x291ce5[_0xa58c('0x2b')][_0xa58c('0x1a')]['originChannel']||'Email','ChatOfflineMessageId':_0x291ce5['body'][_0xa58c('0x1a')][_0xa58c('0x5f')]||null},{'include':[{'model':db[_0xa58c('0x60')],'as':_0xa58c('0x61')}]});})[_0xa58c('0x12')](function(_0x456522){_0x48158c['message']=_0x456522;if(_0x48158c[_0xa58c('0x5b')][_0xa58c('0x62')]){return db['User'][_0xa58c('0x29')]({'attributes':['id',_0xa58c('0x63')],'where':{'id':_0x48158c[_0xa58c('0x5b')][_0xa58c('0x62')]}})[_0xa58c('0x12')](function(_0x5aa3d5){if(_0x5aa3d5){_0x48158c[_0xa58c('0x47')][_0xa58c('0x64')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5aa3d5[_0xa58c('0x63')]+','+(_0x48158c[_0xa58c('0x3c')][_0xa58c('0x65')]||0xa),'interval':_0xa58c('0x4e')});}return respondWithRpcPromise(_0xa58c('0x66'),_0xa58c('0x67'),_0x48158c);});}return respondWithRpcPromise(_0xa58c('0x66'),'startRouting',_0x48158c);})[_0xa58c('0x12')](function(_0x473e6f){_0xa87d38(_0x473e6f);})[_0xa58c('0x27')](function(_0x39bf3a){_0x50eb61(_0x3e63f9[_0xa58c('0x18')](0x1f4,_0x39bf3a[_0xa58c('0x1a')]));});});}; \ No newline at end of file +var _0xfd23=['account','CmList','List','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','applications','orderBy','autoclose','length','close','Contacts','ListId','create','List\x20not\x20found','messageId','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','attach','interaction','created','contact','attachments','originTo','originCc','originChannel','Email','Attachment','Attachments','UserId','User','name','unshift','waitForTheAssignedAgent','*,*,*,*','Start','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','findAll','options','where','include','map','model','attributes','GetMailAccount','ShowMailAccount','MailAccount','find','raw','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xfd23,0x9a));var _0x3fd2=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xfd23[_0x1b4b23];return _0x2a325b;};'use strict';var _=require(_0x3fd2('0x0'));var util=require(_0x3fd2('0x1'));var moment=require(_0x3fd2('0x2'));var BPromise=require(_0x3fd2('0x3'));var rs=require(_0x3fd2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3fd2('0x5'))['db'];var utils=require(_0x3fd2('0x6'));var logger=require('../../config/logger')(_0x3fd2('0x7'));var config=require(_0x3fd2('0x8'));var jayson=require(_0x3fd2('0x9'));var client=jayson[_0x3fd2('0xa')][_0x3fd2('0xb')]({'port':0x232c});config['redis']=_[_0x3fd2('0xc')](config[_0x3fd2('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x3fd2('0xe'))(new Redis(config[_0x3fd2('0xd')]));require(_0x3fd2('0xf'))[_0x3fd2('0x10')](socket);function respondWithRpcPromise(_0x3b6978,_0x848eee,_0x27d790){return new BPromise(function(_0x38e1da,_0x5b049a){return client[_0x3fd2('0x11')](_0x3b6978,_0x27d790)[_0x3fd2('0x12')](function(_0x5d824b){logger['info'](_0x3fd2('0x13'),_0x848eee,_0x3fd2('0x14'));logger[_0x3fd2('0x15')](_0x3fd2('0x16'),_0x848eee,_0x3fd2('0x14'),JSON[_0x3fd2('0x17')](_0x5d824b));if(_0x5d824b[_0x3fd2('0x18')]){if(_0x5d824b[_0x3fd2('0x18')][_0x3fd2('0x19')]===0x1f4){logger[_0x3fd2('0x18')]('MailAccount,\x20%s,\x20%s',_0x848eee,_0x5d824b['error'][_0x3fd2('0x1a')]);return _0x5b049a(_0x5d824b[_0x3fd2('0x18')][_0x3fd2('0x1a')]);}logger[_0x3fd2('0x18')](_0x3fd2('0x13'),_0x848eee,_0x5d824b[_0x3fd2('0x18')][_0x3fd2('0x1a')]);return _0x38e1da(_0x5d824b[_0x3fd2('0x18')][_0x3fd2('0x1a')]);}else{logger[_0x3fd2('0x1b')](_0x3fd2('0x13'),_0x848eee,_0x3fd2('0x14'));_0x38e1da(_0x5d824b[_0x3fd2('0x1c')]['message']);}})[_0x3fd2('0x1d')](function(_0x1f1ac5){logger[_0x3fd2('0x18')]('MailAccount,\x20%s,\x20%s',_0x848eee,_0x1f1ac5);_0x5b049a(_0x1f1ac5);});});}exports['GetMailAccount']=function(_0x1a31a3){var _0x5a9c60=this;return new Promise(function(_0x2a214f,_0x1edc7d){return db['MailAccount'][_0x3fd2('0x1e')]({'raw':_0x1a31a3['options']?_0x1a31a3[_0x3fd2('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1a31a3[_0x3fd2('0x1f')]?_0x1a31a3[_0x3fd2('0x1f')][_0x3fd2('0x20')]||null:null,'attributes':_0x1a31a3[_0x3fd2('0x1f')]?_0x1a31a3[_0x3fd2('0x1f')]['attributes']||null:null,'limit':_0x1a31a3[_0x3fd2('0x1f')]?_0x1a31a3[_0x3fd2('0x1f')]['limit']||null:null,'include':_0x1a31a3['options']?_0x1a31a3[_0x3fd2('0x1f')][_0x3fd2('0x21')]?_[_0x3fd2('0x22')](_0x1a31a3[_0x3fd2('0x1f')]['include'],function(_0x31d1f2){return{'model':db[_0x31d1f2[_0x3fd2('0x23')]],'as':_0x31d1f2['as'],'attributes':_0x31d1f2[_0x3fd2('0x24')],'include':_0x31d1f2['include']?_[_0x3fd2('0x22')](_0x31d1f2['include'],function(_0x472376){return{'model':db[_0x472376[_0x3fd2('0x23')]],'as':_0x472376['as'],'attributes':_0x472376[_0x3fd2('0x24')],'include':_0x472376[_0x3fd2('0x21')]?_[_0x3fd2('0x22')](_0x472376[_0x3fd2('0x21')],function(_0xfe79ff){return{'model':db[_0xfe79ff[_0x3fd2('0x23')]],'as':_0xfe79ff['as'],'attributes':_0xfe79ff['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bc2fc){logger[_0x3fd2('0x1b')](_0x3fd2('0x25'),_0x1a31a3);logger['debug'](_0x3fd2('0x25'),_0x1a31a3,JSON[_0x3fd2('0x17')](_0x1bc2fc));_0x2a214f(_0x1bc2fc);})[_0x3fd2('0x1d')](function(_0x39ac2e){logger[_0x3fd2('0x18')](_0x3fd2('0x25'),_0x39ac2e[_0x3fd2('0x1a')],_0x1a31a3);_0x1edc7d(_0x5a9c60[_0x3fd2('0x18')](0x1f4,_0x39ac2e[_0x3fd2('0x1a')]));});});};exports[_0x3fd2('0x26')]=function(_0x2e6ebb){var _0x12da8b=this;return new Promise(function(_0x444fa6,_0x15e3c3){return db[_0x3fd2('0x27')][_0x3fd2('0x28')]({'raw':_0x2e6ebb[_0x3fd2('0x1f')]?_0x2e6ebb[_0x3fd2('0x1f')][_0x3fd2('0x29')]===undefined?!![]:![]:!![],'where':_0x2e6ebb[_0x3fd2('0x1f')]?_0x2e6ebb[_0x3fd2('0x1f')][_0x3fd2('0x20')]||null:null,'attributes':_0x2e6ebb['options']?_0x2e6ebb['options'][_0x3fd2('0x24')]||null:null,'include':_0x2e6ebb[_0x3fd2('0x1f')]?_0x2e6ebb[_0x3fd2('0x1f')]['include']?_[_0x3fd2('0x22')](_0x2e6ebb[_0x3fd2('0x1f')]['include'],function(_0x40482e){return{'model':db[_0x40482e[_0x3fd2('0x23')]],'as':_0x40482e['as'],'attributes':_0x40482e[_0x3fd2('0x24')],'include':_0x40482e[_0x3fd2('0x21')]?_[_0x3fd2('0x22')](_0x40482e[_0x3fd2('0x21')],function(_0x67ecc4){return{'model':db[_0x67ecc4[_0x3fd2('0x23')]],'as':_0x67ecc4['as'],'attributes':_0x67ecc4[_0x3fd2('0x24')],'include':_0x67ecc4[_0x3fd2('0x21')]?_[_0x3fd2('0x22')](_0x67ecc4[_0x3fd2('0x21')],function(_0x5003b3){return{'model':db[_0x5003b3[_0x3fd2('0x23')]],'as':_0x5003b3['as'],'attributes':_0x5003b3[_0x3fd2('0x24')]};}):[]};}):[]};}):[]:[]})[_0x3fd2('0x12')](function(_0x60d5ed){logger['info']('ShowMailAccount',_0x2e6ebb);logger[_0x3fd2('0x15')]('ShowMailAccount',_0x2e6ebb,JSON[_0x3fd2('0x17')](_0x60d5ed));_0x444fa6(_0x60d5ed);})['catch'](function(_0x2c8a6e){logger[_0x3fd2('0x18')](_0x3fd2('0x26'),_0x2c8a6e[_0x3fd2('0x1a')],_0x2e6ebb);_0x15e3c3(_0x12da8b['error'](0x1f4,_0x2c8a6e[_0x3fd2('0x1a')]));});});};exports[_0x3fd2('0x2a')]=function(_0x2cc542){var _0x39737e=this;return new Promise(function(_0x145d51,_0x2087f1){var _0x1ceada={'body':_0x2cc542[_0x3fd2('0x2b')],'channel':_0x3fd2('0x2c')};var _0x10969a=_[_0x3fd2('0x2d')](_[_0x3fd2('0x2e')](db[_0x3fd2('0x2f')]['rawAttributes']),[_0x3fd2('0x30'),_0x3fd2('0x31'),_0x3fd2('0x32'),'ListId']);var _0x2ed225=![];if(_0x2cc542[_0x3fd2('0x2b')]['id']){delete _0x2cc542[_0x3fd2('0x2b')]['id'];}if(_[_0x3fd2('0x33')](_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x34')])){return _0x2087f1(_0x39737e[_0x3fd2('0x18')](0x1f4,_0x3fd2('0x35')));}if(_['isNil'](_0x2cc542['body'][_0x3fd2('0x2b')])||_0x2cc542[_0x3fd2('0x2b')]['body']===''){return _0x2087f1(_0x39737e['error'](0x1f4,_0x3fd2('0x36')));}if(_[_0x3fd2('0x33')](_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x37')])){return _0x2087f1(_0x39737e[_0x3fd2('0x18')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x10969a));}if(!_[_0x3fd2('0x38')](_0x10969a,_0x2cc542['body']['mapKey'])){return _0x2087f1(_0x39737e[_0x3fd2('0x18')](0x1f4,_0x3fd2('0x39')+_0x10969a));}var _0x3fddbe={};_0x3fddbe[_0x2cc542[_0x3fd2('0x2b')]['mapKey']]=_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x34')];return db[_0x3fd2('0x27')][_0x3fd2('0x28')]({'where':{'id':_0x2cc542[_0x3fd2('0x3a')]['id']},'include':[{'model':db[_0x3fd2('0x3b')],'as':_0x3fd2('0x3c'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x3fddbe,'limit':0x1,'order':[[_0x3fd2('0x31'),_0x3fd2('0x3d')]]}]},{'model':db[_0x3fd2('0x3e')],'as':_0x3fd2('0x3f')},{'model':db[_0x3fd2('0x40')],'as':_0x3fd2('0x41')}]})[_0x3fd2('0x12')](function(_0x15844c){if(_0x15844c&&_0x15844c[_0x3fd2('0x3c')]){var _0xd56a3=_0x15844c[_0x3fd2('0x42')]({'plain':!![]});_0x1ceada['account']=_[_0x3fd2('0x43')](_0xd56a3,['Applications',_0x3fd2('0x3c')]);_0x1ceada[_0x3fd2('0x44')]=_0xd56a3[_0x3fd2('0x3f')];_0x1ceada['list']=_0xd56a3[_0x3fd2('0x3c')];_0x1ceada[_0x3fd2('0x44')]=_[_0x3fd2('0x45')](_0x1ceada[_0x3fd2('0x44')],['priority'],['asc']);if(_0x1ceada['account']&&_0x1ceada[_0x3fd2('0x3a')][_0x3fd2('0x46')]){_0x1ceada[_0x3fd2('0x44')]['push']({'id':0x0,'priority':_0x1ceada[_0x3fd2('0x44')][_0x3fd2('0x47')]+0x1,'app':_0x3fd2('0x48'),'appdata':_0x3fd2('0x46'),'interval':'*,*,*,*'});}if(_0x1ceada[_0x3fd2('0x3a')][_0x3fd2('0x3f')]){delete _0x1ceada[_0x3fd2('0x3a')][_0x3fd2('0x3f')];}if(_0x1ceada[_0x3fd2('0x3a')][_0x3fd2('0x3c')]){delete _0x1ceada[_0x3fd2('0x3a')]['List'];}if(_0xd56a3['List']['Contacts'][_0x3fd2('0x47')]){return _0xd56a3[_0x3fd2('0x3c')][_0x3fd2('0x49')][0x0];}var _0x14fc81=_['defaults'](_0x2cc542[_0x3fd2('0x2b')],{'firstName':_0x2cc542['body'][_0x3fd2('0x34')],'ListId':_0xd56a3[_0x3fd2('0x4a')]});_0x14fc81[_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x37')]]=_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x34')];return db[_0x3fd2('0x2f')][_0x3fd2('0x4b')](_0x14fc81);}else{throw new Error(_0x3fd2('0x4c'));}})[_0x3fd2('0x12')](function(_0x334e78){_0x1ceada['contact']=_0x334e78;if(_0x334e78){if(!_0x2cc542['body']['message'][_0x3fd2('0x4d')]){_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x1a')][_0x3fd2('0x4d')]=rs['generate']()+'\x20'+_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x1a')]['from'];}var _0xbd74e6={'ContactId':_0x334e78['id'],'MailAccountId':_0x2cc542[_0x3fd2('0x3a')]['id'],'inReplyTo':_0x2cc542['body']['message'][_0x3fd2('0x4d')],'to':_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x1a')][_0x3fd2('0x34')],'cc':_0x2cc542[_0x3fd2('0x2b')]['message']['cc'],'subject':_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x1a')]['subject'],'attach':_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x1a')]['attach'],'lastMsgAt':moment()[_0x3fd2('0x4e')](_0x3fd2('0x4f')),'lastMsgDirection':'in'};return db[_0x3fd2('0x50')][_0x3fd2('0x28')]({'where':{'closed':![],'MailAccountId':_0x2cc542[_0x3fd2('0x3a')]['id']},'include':[{'model':db[_0x3fd2('0x51')],'as':_0x3fd2('0x52'),'attributes':[_0x3fd2('0x4d')],'where':{'messageId':_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x1a')][_0x3fd2('0x53')]}}]})[_0x3fd2('0x12')](function(_0x8eef93){if(_0x8eef93){return[_0x8eef93,![]];}return db['MailInteraction'][_0x3fd2('0x4b')](_0xbd74e6)[_0x3fd2('0x12')](function(_0x1994b6){return[_0x1994b6,!![]];});});}else{throw new Error(_0x3fd2('0x54'));}})[_0x3fd2('0x55')](function(_0x4a6f7b,_0x4b5932){if(_0x4a6f7b){_0x2ed225=_0x4b5932;if(!_0x4b5932){return _0x4a6f7b[_0x3fd2('0x56')]({'inReplyTo':_0x2cc542[_0x3fd2('0x2b')]['message']['messageId'],'to':_0x2cc542[_0x3fd2('0x2b')]['message']['from'],'cc':_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x1a')]['cc'],'subject':_0x2cc542['body'][_0x3fd2('0x1a')][_0x3fd2('0x57')],'attach':_0x4a6f7b[_0x3fd2('0x58')]?_0x4a6f7b[_0x3fd2('0x58')]:_0x2cc542['body'][_0x3fd2('0x1a')][_0x3fd2('0x58')],'substatus':null,'substatusAt':moment()[_0x3fd2('0x4e')](_0x3fd2('0x4f')),'lastMsgAt':moment()[_0x3fd2('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x4a6f7b;}}})[_0x3fd2('0x12')](function(_0x4c94fc){_0x1ceada[_0x3fd2('0x59')]=_0x4c94fc['get']({'plain':!![]});_0x1ceada[_0x3fd2('0x59')][_0x3fd2('0x5a')]=_0x2ed225;return db[_0x3fd2('0x51')][_0x3fd2('0x4b')]({'body':_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x2b')],'MailAccountId':_0x2cc542[_0x3fd2('0x3a')]['id'],'MailInteractionId':_0x4c94fc['id'],'direction':'in','ContactId':_0x1ceada[_0x3fd2('0x5b')]['id'],'messageId':_0x2cc542[_0x3fd2('0x2b')]['message'][_0x3fd2('0x4d')],'from':_0x2cc542[_0x3fd2('0x2b')]['message'][_0x3fd2('0x34')],'to':_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x1a')]['to'],'cc':_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x1a')]['cc'],'subject':_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x1a')]['subject'],'attach':_0x2cc542[_0x3fd2('0x2b')]['message'][_0x3fd2('0x58')],'Attachments':_0x2cc542[_0x3fd2('0x2b')]['message'][_0x3fd2('0x5c')],'originTo':_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x1a')][_0x3fd2('0x5d')],'originCc':_0x2cc542['body'][_0x3fd2('0x1a')][_0x3fd2('0x5e')],'bcc':_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x1a')]['bcc'],'ChatWebsiteId':_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x1a')]['ChatWebsiteId']||null,'originChannel':_0x2cc542[_0x3fd2('0x2b')][_0x3fd2('0x1a')][_0x3fd2('0x5f')]||_0x3fd2('0x60'),'ChatOfflineMessageId':_0x2cc542['body'][_0x3fd2('0x1a')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x3fd2('0x61')],'as':_0x3fd2('0x62')}]});})['then'](function(_0x597012){_0x1ceada[_0x3fd2('0x1a')]=_0x597012;if(_0x1ceada[_0x3fd2('0x59')][_0x3fd2('0x63')]){return db[_0x3fd2('0x64')]['find']({'attributes':['id',_0x3fd2('0x65')],'where':{'id':_0x1ceada[_0x3fd2('0x59')][_0x3fd2('0x63')]}})[_0x3fd2('0x12')](function(_0x2d3d9b){if(_0x2d3d9b){_0x1ceada[_0x3fd2('0x44')][_0x3fd2('0x66')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2d3d9b[_0x3fd2('0x65')]+','+(_0x1ceada[_0x3fd2('0x3a')][_0x3fd2('0x67')]||0xa),'interval':_0x3fd2('0x68')});}return respondWithRpcPromise(_0x3fd2('0x69'),'startRouting',_0x1ceada);});}return respondWithRpcPromise('Start','startRouting',_0x1ceada);})[_0x3fd2('0x12')](function(_0x31536d){_0x145d51(_0x31536d);})[_0x3fd2('0x1d')](function(_0x2202ed){_0x2087f1(_0x39737e[_0x3fd2('0x18')](0x1f4,_0x2202ed['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 2ff06e8..53e9220 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 _0x4dee=['save','remove','update','emit','removeListener','length','./mailAccount.events'];(function(_0x56cf0a,_0x5bae4b){var _0x6b3bfe=function(_0x5dd882){while(--_0x5dd882){_0x56cf0a['push'](_0x56cf0a['shift']());}};_0x6b3bfe(++_0x5bae4b);}(_0x4dee,0x172));var _0xe4de=function(_0x230471,_0x32f86d){_0x230471=_0x230471-0x0;var _0x58ed0d=_0x4dee[_0x230471];return _0x58ed0d;};'use strict';var MailAccountEvents=require(_0xe4de('0x0'));var events=[_0xe4de('0x1'),_0xe4de('0x2'),_0xe4de('0x3')];function createListener(_0xd6db74,_0x23e634){return function(_0x5bca96){_0x23e634[_0xe4de('0x4')](_0xd6db74,_0x5bca96);};}function removeListener(_0x358423,_0xfdb5a8){return function(){MailAccountEvents[_0xe4de('0x5')](_0x358423,_0xfdb5a8);};}exports['register']=function(_0x2b3bc7){for(var _0x7bc566=0x0,_0x193b79=events[_0xe4de('0x6')];_0x7bc566<_0x193b79;_0x7bc566++){var _0x5086c7=events[_0x7bc566];var _0x118616=createListener('mailAccount:'+_0x5086c7,_0x2b3bc7);MailAccountEvents['on'](_0x5086c7,_0x118616);}}; \ No newline at end of file +var _0x38f9=['mailAccount:','remove','update','removeListener','length'];(function(_0xbe7189,_0x541242){var _0x4b433e=function(_0x4c849b){while(--_0x4c849b){_0xbe7189['push'](_0xbe7189['shift']());}};_0x4b433e(++_0x541242);}(_0x38f9,0xd3));var _0x938f=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x38f9[_0x1b5aea];return _0x15cfc6;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0x938f('0x0'),_0x938f('0x1')];function createListener(_0x502c36,_0x4b9b44){return function(_0x3c30fa){_0x4b9b44['emit'](_0x502c36,_0x3c30fa);};}function removeListener(_0x5cc294,_0xfb2ab2){return function(){MailAccountEvents[_0x938f('0x2')](_0x5cc294,_0xfb2ab2);};}exports['register']=function(_0x2959d6){for(var _0x26cbd3=0x0,_0x4b3c40=events[_0x938f('0x3')];_0x26cbd3<_0x4b3c40;_0x26cbd3++){var _0x45e31c=events[_0x26cbd3];var _0x5632f9=createListener(_0x938f('0x4')+_0x45e31c,_0x2959d6);MailAccountEvents['on'](_0x45e31c,_0x5632f9);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index f08d0ea..b4e1b01 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 _0x12c7=['./mailApplication.controller','isAuthenticated','show','put','/:id','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x19cce8,_0x23a814){var _0x575f93=function(_0x515f8b){while(--_0x515f8b){_0x19cce8['push'](_0x19cce8['shift']());}};_0x575f93(++_0x23a814);}(_0x12c7,0x1db));var _0x712c=function(_0x3b0249,_0x179844){_0x3b0249=_0x3b0249-0x0;var _0x536799=_0x12c7[_0x3b0249];return _0x536799;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x712c('0x0'));var timeout=require('connect-timeout');var express=require(_0x712c('0x1'));var router=express[_0x712c('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x712c('0x3'));var interaction=require(_0x712c('0x4'));var config=require(_0x712c('0x5'));var controller=require(_0x712c('0x6'));router['get']('/:id',auth[_0x712c('0x7')](),controller[_0x712c('0x8')]);router[_0x712c('0x9')](_0x712c('0xa'),auth[_0x712c('0x7')](),controller['update']);router['delete'](_0x712c('0xa'),auth[_0x712c('0x7')](),controller[_0x712c('0xb')]);module[_0x712c('0xc')]=router; \ No newline at end of file +var _0x6d3d=['fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x344e15,_0x4deaf3){var _0x19b6d3=function(_0x4f258f){while(--_0x4f258f){_0x344e15['push'](_0x344e15['shift']());}};_0x19b6d3(++_0x4deaf3);}(_0x6d3d,0x127));var _0xd6d3=function(_0x5a3e97,_0x22957d){_0x5a3e97=_0x5a3e97-0x0;var _0x1dfd00=_0x6d3d[_0x5a3e97];return _0x1dfd00;};'use strict';var multer=require(_0xd6d3('0x0'));var util=require(_0xd6d3('0x1'));var path=require('path');var timeout=require(_0xd6d3('0x2'));var express=require(_0xd6d3('0x3'));var router=express[_0xd6d3('0x4')]();var fs_extra=require(_0xd6d3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd6d3('0x6'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0xd6d3('0x7')](_0xd6d3('0x8'),auth[_0xd6d3('0x9')](),controller['show']);router[_0xd6d3('0xa')](_0xd6d3('0x8'),auth[_0xd6d3('0x9')](),controller[_0xd6d3('0xb')]);router[_0xd6d3('0xc')](_0xd6d3('0x8'),auth[_0xd6d3('0x9')](),controller[_0xd6d3('0xd')]);module[_0xd6d3('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 27a9292..23d2fb5 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 _0xd85b=['noop','TEXT','exports','INTEGER','STRING'];(function(_0x3d9bdb,_0x44f238){var _0x3db385=function(_0x338655){while(--_0x338655){_0x3d9bdb['push'](_0x3d9bdb['shift']());}};_0x3db385(++_0x44f238);}(_0xd85b,0x10b));var _0xbd85=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd85b[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xbd85('0x0')]={'priority':{'type':Sequelize[_0xbd85('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xbd85('0x2')],'allowNull':![],'defaultValue':_0xbd85('0x3')},'appdata':{'type':Sequelize[_0xbd85('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbd85('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xbe1d=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x369889,_0x3fab14){var _0x398b84=function(_0x3313ca){while(--_0x3313ca){_0x369889['push'](_0x369889['shift']());}};_0x398b84(++_0x3fab14);}(_0xbe1d,0x113));var _0xdbe1=function(_0x38d825,_0x357fd6){_0x38d825=_0x38d825-0x0;var _0xc39a03=_0xbe1d[_0x38d825];return _0xc39a03;};'use strict';var Sequelize=require(_0xdbe1('0x0'));module[_0xdbe1('0x1')]={'priority':{'type':Sequelize[_0xdbe1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xdbe1('0x3')],'allowNull':![],'defaultValue':_0xdbe1('0x4')},'appdata':{'type':Sequelize[_0xdbe1('0x5')]()},'description':{'type':Sequelize[_0xdbe1('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xdbe1('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 17d4723..c036097 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 _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x2ad7a3,_0x455c61){var _0x212ea4=function(_0x16e7d0){while(--_0x16e7d0){_0x2ad7a3['push'](_0x2ad7a3['shift']());}};_0x212ea4(++_0x455c61);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));}; \ No newline at end of file +var _0xedd9=['query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','show','params','keys','MailApplication','rawAttributes'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0xedd9,0xfc));var _0x9edd=function(_0x247502,_0x565e72){_0x247502=_0x247502-0x0;var _0x39297d=_0xedd9[_0x247502];return _0x39297d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={'raw':!![],'where':{'id':_0x52746a[_0x9edd('0x27')]['id']}},_0x2ae8dd={};_0x2ae8dd['model']=_[_0x9edd('0x28')](db[_0x9edd('0x29')][_0x9edd('0x2a')]);_0x2ae8dd[_0x9edd('0x2b')]=_[_0x9edd('0x28')](_0x52746a[_0x9edd('0x2b')]);_0x2ae8dd[_0x9edd('0x2c')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],_0x2ae8dd[_0x9edd('0x2b')]);_0x28cfae[_0x9edd('0x2f')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],qs[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2b')]['fields']));_0x28cfae[_0x9edd('0x2f')]=_0x28cfae[_0x9edd('0x2f')][_0x9edd('0x31')]?_0x28cfae['attributes']:_0x2ae8dd[_0x9edd('0x2e')];if(_0x52746a[_0x9edd('0x2b')][_0x9edd('0x32')]){_0x28cfae[_0x9edd('0x33')]=[{'all':!![]}];}_0x28cfae=_[_0x9edd('0x34')]({},_0x28cfae,_0x52746a[_0x9edd('0x35')]);return db[_0x9edd('0x29')][_0x9edd('0x36')](_0x28cfae)[_0x9edd('0x21')](handleEntityNotFound(_0x238b22,null))[_0x9edd('0x21')](respondWithResult(_0x238b22,null))[_0x9edd('0x37')](handleError(_0x238b22,null));};exports[_0x9edd('0x38')]=function(_0x27eb7e,_0x14f780){if(_0x27eb7e['body']['id']){delete _0x27eb7e[_0x9edd('0x39')]['id'];}return db['MailApplication'][_0x9edd('0x36')]({'where':{'id':_0x27eb7e[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x14f780,null))[_0x9edd('0x21')](saveUpdates(_0x27eb7e[_0x9edd('0x39')],null))['then'](respondWithResult(_0x14f780,null))[_0x9edd('0x37')](handleError(_0x14f780,null));};exports[_0x9edd('0x3a')]=function(_0x2b3469,_0x38e9be){return db[_0x9edd('0x29')][_0x9edd('0x36')]({'where':{'id':_0x2b3469[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x38e9be,null))[_0x9edd('0x21')](removeEntity(_0x38e9be,null))[_0x9edd('0x37')](handleError(_0x38e9be,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 0408443..14376c5 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 _0xb5cf=['mail_applications','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define'];(function(_0x5c7aa7,_0x2a7a0f){var _0x42a6f6=function(_0x14544e){while(--_0x14544e){_0x5c7aa7['push'](_0x5c7aa7['shift']());}};_0x42a6f6(++_0x2a7a0f);}(_0xb5cf,0x64));var _0xfb5c=function(_0x1b1d82,_0x4add16){_0x1b1d82=_0x1b1d82-0x0;var _0x1b7c16=_0xb5cf[_0x1b1d82];return _0x1b7c16;};'use strict';var _=require(_0xfb5c('0x0'));var util=require(_0xfb5c('0x1'));var logger=require(_0xfb5c('0x2'))('api');var moment=require(_0xfb5c('0x3'));var BPromise=require(_0xfb5c('0x4'));var rp=require(_0xfb5c('0x5'));var fs=require('fs');var path=require(_0xfb5c('0x6'));var rimraf=require(_0xfb5c('0x7'));var config=require(_0xfb5c('0x8'));var attributes=require(_0xfb5c('0x9'));module[_0xfb5c('0xa')]=function(_0x519058,_0x1fad0c){return _0x519058[_0xfb5c('0xb')]('MailApplication',attributes,{'tableName':_0xfb5c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfb5c('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x391d=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3b0e33,_0x344cea){var _0x1d2acd=function(_0x3c4e3c){while(--_0x3c4e3c){_0x3b0e33['push'](_0x3b0e33['shift']());}};_0x1d2acd(++_0x344cea);}(_0x391d,0xa0));var _0xd391=function(_0x37f9fa,_0x4acb2d){_0x37f9fa=_0x37f9fa-0x0;var _0x3e4ffe=_0x391d[_0x37f9fa];return _0x3e4ffe;};'use strict';var _=require(_0xd391('0x0'));var util=require(_0xd391('0x1'));var logger=require(_0xd391('0x2'))('api');var moment=require(_0xd391('0x3'));var BPromise=require(_0xd391('0x4'));var rp=require(_0xd391('0x5'));var fs=require('fs');var path=require(_0xd391('0x6'));var rimraf=require(_0xd391('0x7'));var config=require(_0xd391('0x8'));var attributes=require(_0xd391('0x9'));module[_0xd391('0xa')]=function(_0x2c3106,_0x34eb10){return _0x2c3106[_0xd391('0xb')](_0xd391('0xc'),attributes,{'tableName':_0xd391('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd391('0xe'),'collate':_0xd391('0xf')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index ab4f852..2c99a21 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 _0x0d94=['info','debug','request\x20sent','stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','MailApplication','options','where','attributes','limit','UpdateMailApplication','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x767292,_0x59dc8f){var _0x33a6db=function(_0xa775b2){while(--_0xa775b2){_0x767292['push'](_0x767292['shift']());}};_0x33a6db(++_0x59dc8f);}(_0x0d94,0x11e));var _0x40d9=function(_0x5c81b2,_0x46590a){_0x5c81b2=_0x5c81b2-0x0;var _0x4cbed6=_0x0d94[_0x5c81b2];return _0x4cbed6;};'use strict';var _=require('lodash');var util=require(_0x40d9('0x0'));var moment=require(_0x40d9('0x1'));var BPromise=require('bluebird');var rs=require(_0x40d9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x40d9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x40d9('0x4'))(_0x40d9('0x5'));var config=require('../../config/environment');var jayson=require(_0x40d9('0x6'));var client=jayson[_0x40d9('0x7')][_0x40d9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d01be,_0x5728ad,_0x3b270a){return new BPromise(function(_0x2081a8,_0x4fc2ff){return client[_0x40d9('0x9')](_0x2d01be,_0x3b270a)[_0x40d9('0xa')](function(_0x14c456){logger[_0x40d9('0xb')]('MailApplication,\x20%s,\x20%s',_0x5728ad,'request\x20sent');logger[_0x40d9('0xc')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x5728ad,_0x40d9('0xd'),JSON[_0x40d9('0xe')](_0x14c456));if(_0x14c456[_0x40d9('0xf')]){if(_0x14c456['error'][_0x40d9('0x10')]===0x1f4){logger[_0x40d9('0xf')](_0x40d9('0x11'),_0x5728ad,_0x14c456[_0x40d9('0xf')]['message']);return _0x4fc2ff(_0x14c456[_0x40d9('0xf')][_0x40d9('0x12')]);}logger[_0x40d9('0xf')](_0x40d9('0x11'),_0x5728ad,_0x14c456[_0x40d9('0xf')][_0x40d9('0x12')]);return _0x2081a8(_0x14c456[_0x40d9('0xf')][_0x40d9('0x12')]);}else{logger[_0x40d9('0xb')]('MailApplication,\x20%s,\x20%s',_0x5728ad,_0x40d9('0xd'));_0x2081a8(_0x14c456[_0x40d9('0x13')][_0x40d9('0x12')]);}})[_0x40d9('0x14')](function(_0x4320c6){logger[_0x40d9('0xf')](_0x40d9('0x11'),_0x5728ad,_0x4320c6);_0x4fc2ff(_0x4320c6);});});}exports['UpdateMailApplication']=function(_0x485db2){var _0x4ccb40=this;return new Promise(function(_0x260551,_0x7e36eb){return db[_0x40d9('0x15')]['update'](_0x485db2['body'],{'raw':_0x485db2['options']?_0x485db2[_0x40d9('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x485db2[_0x40d9('0x16')]?_0x485db2[_0x40d9('0x16')][_0x40d9('0x17')]||null:null,'attributes':_0x485db2[_0x40d9('0x16')]?_0x485db2[_0x40d9('0x16')][_0x40d9('0x18')]||null:null,'limit':_0x485db2[_0x40d9('0x16')]?_0x485db2['options'][_0x40d9('0x19')]||null:null})[_0x40d9('0xa')](function(_0x544bf6){logger[_0x40d9('0xb')]('UpdateMailApplication',_0x485db2);logger[_0x40d9('0xc')](_0x40d9('0x1a'),_0x485db2,JSON[_0x40d9('0xe')](_0x544bf6));_0x260551(_0x544bf6);})[_0x40d9('0x14')](function(_0x41c44e){logger[_0x40d9('0xf')]('UpdateMailApplication',_0x41c44e['message'],_0x485db2);_0x7e36eb(_0x4ccb40[_0x40d9('0xf')](0x1f4,_0x41c44e['message']));});});}; \ No newline at end of file +var _0xad03=['catch','UpdateMailApplication','update','body','options','where','attributes','limit','stringify','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2b5120,_0x1330bb){var _0x1966b2=function(_0x2b2a88){while(--_0x2b2a88){_0x2b5120['push'](_0x2b5120['shift']());}};_0x1966b2(++_0x1330bb);}(_0xad03,0xe9));var _0x3ad0=function(_0x192b0b,_0x55c8d5){_0x192b0b=_0x192b0b-0x0;var _0x5dd10a=_0xad03[_0x192b0b];return _0x5dd10a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3ad0('0x0'));var BPromise=require(_0x3ad0('0x1'));var rs=require(_0x3ad0('0x2'));var fs=require('fs');var Redis=require(_0x3ad0('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3ad0('0x4'))(_0x3ad0('0x5'));var config=require(_0x3ad0('0x6'));var jayson=require(_0x3ad0('0x7'));var client=jayson['client'][_0x3ad0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bb451,_0x553db7,_0x32b53d){return new BPromise(function(_0x5a015b,_0x2f55f2){return client[_0x3ad0('0x9')](_0x1bb451,_0x32b53d)[_0x3ad0('0xa')](function(_0x90bb29){logger[_0x3ad0('0xb')](_0x3ad0('0xc'),_0x553db7,_0x3ad0('0xd'));logger[_0x3ad0('0xe')](_0x3ad0('0xf'),_0x553db7,_0x3ad0('0xd'),JSON['stringify'](_0x90bb29));if(_0x90bb29[_0x3ad0('0x10')]){if(_0x90bb29[_0x3ad0('0x10')][_0x3ad0('0x11')]===0x1f4){logger['error'](_0x3ad0('0xc'),_0x553db7,_0x90bb29[_0x3ad0('0x10')][_0x3ad0('0x12')]);return _0x2f55f2(_0x90bb29[_0x3ad0('0x10')][_0x3ad0('0x12')]);}logger['error'](_0x3ad0('0xc'),_0x553db7,_0x90bb29['error'][_0x3ad0('0x12')]);return _0x5a015b(_0x90bb29['error'][_0x3ad0('0x12')]);}else{logger['info'](_0x3ad0('0xc'),_0x553db7,_0x3ad0('0xd'));_0x5a015b(_0x90bb29['result'][_0x3ad0('0x12')]);}})[_0x3ad0('0x13')](function(_0x4e0e6f){logger[_0x3ad0('0x10')](_0x3ad0('0xc'),_0x553db7,_0x4e0e6f);_0x2f55f2(_0x4e0e6f);});});}exports[_0x3ad0('0x14')]=function(_0x182119){var _0x5d1a9a=this;return new Promise(function(_0x3e78b1,_0x153ca9){return db['MailApplication'][_0x3ad0('0x15')](_0x182119[_0x3ad0('0x16')],{'raw':_0x182119['options']?_0x182119[_0x3ad0('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x182119['options']?_0x182119[_0x3ad0('0x17')][_0x3ad0('0x18')]||null:null,'attributes':_0x182119['options']?_0x182119['options'][_0x3ad0('0x19')]||null:null,'limit':_0x182119[_0x3ad0('0x17')]?_0x182119['options'][_0x3ad0('0x1a')]||null:null})[_0x3ad0('0xa')](function(_0x733bbc){logger[_0x3ad0('0xb')](_0x3ad0('0x14'),_0x182119);logger['debug']('UpdateMailApplication',_0x182119,JSON[_0x3ad0('0x1b')](_0x733bbc));_0x3e78b1(_0x733bbc);})[_0x3ad0('0x13')](function(_0x467ee1){logger[_0x3ad0('0x10')]('UpdateMailApplication',_0x467ee1['message'],_0x182119);_0x153ca9(_0x5d1a9a[_0x3ad0('0x10')](0x1f4,_0x467ee1['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index aa1ce0d..26bd95a 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 _0x4d89=['addMessage','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','delete','destroy','exports','express','Router','../../components/auth/service','get','/describe','isAuthenticated','/:id','show','/:id/download','post','create','/:id/messages'];(function(_0x51e1a1,_0x57c233){var _0x3c8c50=function(_0xe6aa6a){while(--_0xe6aa6a){_0x51e1a1['push'](_0x51e1a1['shift']());}};_0x3c8c50(++_0x57c233);}(_0x4d89,0x1ee));var _0x94d8=function(_0x5135e2,_0x466484){_0x5135e2=_0x5135e2-0x0;var _0x3280f1=_0x4d89[_0x5135e2];return _0x3280f1;};'use strict';var express=require(_0x94d8('0x0'));var router=express[_0x94d8('0x1')]();var auth=require(_0x94d8('0x2'));var interaction=require('../../components/interaction/service');var controller=require('./mailInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x94d8('0x3')](_0x94d8('0x4'),auth[_0x94d8('0x5')](),controller['describe']);router[_0x94d8('0x3')](_0x94d8('0x6'),auth[_0x94d8('0x5')](),controller[_0x94d8('0x7')]);router['get']('/:id/messages',auth[_0x94d8('0x5')](),controller['getMessages']);router[_0x94d8('0x3')](_0x94d8('0x8'),auth[_0x94d8('0x5')](),controller['download']);router[_0x94d8('0x9')]('/',auth[_0x94d8('0x5')](),controller[_0x94d8('0xa')]);router['post'](_0x94d8('0xb'),auth[_0x94d8('0x5')](),controller[_0x94d8('0xc')]);router[_0x94d8('0x9')]('/:id/tags',auth[_0x94d8('0x5')](),interaction[_0x94d8('0xd')](_0x94d8('0xe'),_0x94d8('0xf')),controller[_0x94d8('0x10')]);router[_0x94d8('0x11')]('/:id',auth[_0x94d8('0x5')](),interaction[_0x94d8('0xd')](_0x94d8('0xe'),_0x94d8('0x12')),controller['update']);router[_0x94d8('0x13')]('/:id',auth[_0x94d8('0x5')](),interaction[_0x94d8('0xd')]('mail','mailinteraction:destroy'),controller[_0x94d8('0x14')]);router[_0x94d8('0x13')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x94d8('0x15')]=router; \ No newline at end of file +var _0x0784=['index','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','mail','mailinteraction:addtags','addTags','put','tracked','mailinteraction:update','delete','mailinteraction:destroy','destroy','exports','express','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated'];(function(_0x4f6f84,_0x31e197){var _0x20d989=function(_0x34db70){while(--_0x34db70){_0x4f6f84['push'](_0x4f6f84['shift']());}};_0x20d989(++_0x31e197);}(_0x0784,0x19a));var _0x4078=function(_0x4b73ac,_0x3e34df){_0x4b73ac=_0x4b73ac-0x0;var _0x1960ae=_0x0784[_0x4b73ac];return _0x1960ae;};'use strict';var express=require(_0x4078('0x0'));var router=express[_0x4078('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x4078('0x2'));var controller=require(_0x4078('0x3'));router[_0x4078('0x4')]('/',auth[_0x4078('0x5')](),controller[_0x4078('0x6')]);router[_0x4078('0x4')]('/describe',auth[_0x4078('0x5')](),controller[_0x4078('0x7')]);router['get'](_0x4078('0x8'),auth[_0x4078('0x5')](),controller['show']);router['get'](_0x4078('0x9'),auth['isAuthenticated'](),controller[_0x4078('0xa')]);router['get'](_0x4078('0xb'),auth[_0x4078('0x5')](),controller[_0x4078('0xc')]);router[_0x4078('0xd')]('/',auth[_0x4078('0x5')](),controller[_0x4078('0xe')]);router[_0x4078('0xd')](_0x4078('0x9'),auth['isAuthenticated'](),controller['addMessage']);router[_0x4078('0xd')](_0x4078('0xf'),auth[_0x4078('0x5')](),interaction['tracked'](_0x4078('0x10'),_0x4078('0x11')),controller[_0x4078('0x12')]);router[_0x4078('0x13')](_0x4078('0x8'),auth[_0x4078('0x5')](),interaction[_0x4078('0x14')](_0x4078('0x10'),_0x4078('0x15')),controller['update']);router[_0x4078('0x16')]('/:id',auth[_0x4078('0x5')](),interaction[_0x4078('0x14')](_0x4078('0x10'),_0x4078('0x17')),controller[_0x4078('0x18')]);router[_0x4078('0x16')](_0x4078('0xf'),auth[_0x4078('0x5')](),controller['removeTags']);module[_0x4078('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 1e5134e..edcda6c 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 _0xbd81=['sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd81,0x110));var _0x1bd8=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xbd81[_0x273c39];return _0x46d6b5;};'use strict';var Sequelize=require(_0x1bd8('0x0'));var iconv=require(_0x1bd8('0x1'));module[_0x1bd8('0x2')]={'closed':{'type':Sequelize[_0x1bd8('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1bd8('0x4')]},'disposition':{'type':Sequelize[_0x1bd8('0x5')]},'secondDisposition':{'type':Sequelize[_0x1bd8('0x5')]},'thirdDisposition':{'type':Sequelize[_0x1bd8('0x5')]},'note':{'type':Sequelize[_0x1bd8('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x1bd8('0x5')]},'cc':{'type':Sequelize[_0x1bd8('0x6')](_0x1bd8('0x7'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x1bd8('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x1bd8('0x4')]},'substatus':{'type':Sequelize[_0x1bd8('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x1bd8('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1bd8('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x1340=['sequelize','exports','DATE','STRING','long','TEXT','BOOLEAN','ENUM','out'];(function(_0x145016,_0x40ba0b){var _0x4a57e8=function(_0x11ea2a){while(--_0x11ea2a){_0x145016['push'](_0x145016['shift']());}};_0x4a57e8(++_0x40ba0b);}(_0x1340,0xab));var _0x0134=function(_0x5024a4,_0x516a8d){_0x5024a4=_0x5024a4-0x0;var _0x588f01=_0x1340[_0x5024a4];return _0x588f01;};'use strict';var Sequelize=require(_0x0134('0x0'));var iconv=require('iconv');module[_0x0134('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0134('0x2')]},'disposition':{'type':Sequelize[_0x0134('0x3')]},'secondDisposition':{'type':Sequelize[_0x0134('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0134('0x3')]},'note':{'type':Sequelize[_0x0134('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0x0134('0x4'))},'subject':{'type':Sequelize[_0x0134('0x5')]()},'attach':{'type':Sequelize[_0x0134('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x0134('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x0134('0x7')]('in',_0x0134('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0134('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x0134('0x7')]('in',_0x0134('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 7ba8033..2b69b54 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 _0xb3f8=['search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','type','compact','isEmpty','MailAccountId','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','replace','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','toString','MailInteraction','a.mandatoryDisposition','Account.mandatoryDisposition','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','MailInteractionId','enableEmailPreview','all','rows','show','params','includeAll','include','merge','create','body','update','destroy','describe','addMessage','ids','getMessages','filter','format','options','inlineCss','true','spread','findAll','emit','mailInteractionTags:save','removeTags','unix','join','root','files','tmp','server','transcript-%d-%s.zip','attachments','Attachment','Messages','bcc','mkdirSync','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','readFileSync','build','message%d.eml','unlinkSync','eml-format','rimraf','moment','bluebird','path','lodash','squel','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','html-entities','redis','localhost','socket.io-emitter','register','end','status','json','offset','undefined','count','limit','Content-Range','then','sendStatus','error','stack','name','send','map','fullname','TagIds','Tags','split','push','MailMessage','findOne','out','plainBody','trimStart','catch','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','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','mail_interactions','cm_contacts','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','expr'];(function(_0x30a811,_0x53e1d8){var _0x2b724e=function(_0x3946aa){while(--_0x3946aa){_0x30a811['push'](_0x30a811['shift']());}};_0x2b724e(++_0x53e1d8);}(_0xb3f8,0x8e));var _0x8b3f=function(_0x32cf96,_0x7502d5){_0x32cf96=_0x32cf96-0x0;var _0x125cc1=_0xb3f8[_0x32cf96];return _0x125cc1;};'use strict';var emlformat=require(_0x8b3f('0x0'));var rimraf=require(_0x8b3f('0x1'));var zipdir=require('zip-dir');var moment=require(_0x8b3f('0x2'));var BPromise=require(_0x8b3f('0x3'));var util=require('util');var path=require(_0x8b3f('0x4'));var fs=require('fs');var _=require(_0x8b3f('0x5'));var squel=require(_0x8b3f('0x6'));var juice=require('juice');var Redis=require('ioredis');var qs=require(_0x8b3f('0x7'));var as=require(_0x8b3f('0x8'));var logger=require(_0x8b3f('0x9'))(_0x8b3f('0xa'));var config=require('../../config/environment');var db=require(_0x8b3f('0xb'))['db'];var htmlEntities=require(_0x8b3f('0xc'));config[_0x8b3f('0xd')]=_['defaults'](config[_0x8b3f('0xd')],{'host':_0x8b3f('0xe'),'port':0x18eb});var socket=require(_0x8b3f('0xf'))(new Redis(config[_0x8b3f('0xd')]));require('./mailInteraction.socket')[_0x8b3f('0x10')](socket);function respondWithStatusCode(_0xad0e4d,_0x2cc203){_0x2cc203=_0x2cc203||0xcc;return function(_0x317bc3){if(_0x317bc3){return _0xad0e4d['sendStatus'](_0x2cc203);}return _0xad0e4d['status'](_0x2cc203)[_0x8b3f('0x11')]();};}function respondWithResult(_0x36f3fa,_0x57f879){_0x57f879=_0x57f879||0xc8;return function(_0x44071b){if(_0x44071b){return _0x36f3fa[_0x8b3f('0x12')](_0x57f879)[_0x8b3f('0x13')](_0x44071b);}};}function respondWithFilteredResult(_0x35dfa3,_0x301e71){return function(_0x514bff){if(_0x514bff){var _0x3c0c0b=typeof _0x301e71[_0x8b3f('0x14')]===_0x8b3f('0x15')&&typeof _0x301e71['limit']===_0x8b3f('0x15');var _0x87c2bb=_0x514bff[_0x8b3f('0x16')];var _0x3c0b6c=_0x3c0c0b?0x0:_0x301e71['offset'];var _0x1a5204=_0x3c0c0b?_0x514bff[_0x8b3f('0x16')]:_0x301e71[_0x8b3f('0x14')]+_0x301e71[_0x8b3f('0x17')];var _0x1743e7;if(_0x1a5204>=_0x87c2bb){_0x1a5204=_0x87c2bb;_0x1743e7=0xc8;}else{_0x1743e7=0xce;}_0x35dfa3[_0x8b3f('0x12')](_0x1743e7);return _0x35dfa3['set'](_0x8b3f('0x18'),_0x3c0b6c+'-'+_0x1a5204+'/'+_0x87c2bb)[_0x8b3f('0x13')](_0x514bff);}return null;};}function saveUpdates(_0x5581a3){return function(_0x4810e0){if(_0x4810e0){return _0x4810e0['update'](_0x5581a3)[_0x8b3f('0x19')](function(_0x20768a){return _0x20768a;});}return null;};}function removeEntity(_0x57b5d6){return function(_0x368070){if(_0x368070){return _0x368070['destroy']()[_0x8b3f('0x19')](function(){_0x57b5d6[_0x8b3f('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13663e){return function(_0x156d3b){if(!_0x156d3b){_0x13663e[_0x8b3f('0x1a')](0x194);}return _0x156d3b;};}function handleError(_0x4921d6,_0x386da6){_0x386da6=_0x386da6||0x1f4;return function(_0x29fdbc){logger[_0x8b3f('0x1b')](_0x29fdbc[_0x8b3f('0x1c')]);if(_0x29fdbc[_0x8b3f('0x1d')]){delete _0x29fdbc[_0x8b3f('0x1d')];}_0x4921d6[_0x8b3f('0x12')](_0x386da6)[_0x8b3f('0x1e')](_0x29fdbc);};}function getInteractionUsers(_0x4c7c7a,_0x4dbd4b){return new BPromise(function(_0x164e46,_0x4e95c1){try{if(_0x4dbd4b[_0x4c7c7a['id']]){_0x4c7c7a['Users']=_[_0x8b3f('0x1f')](_0x4dbd4b[_0x4c7c7a['id']],function(_0x1d6470){return{'id':_0x1d6470['id'],'fullname':_0x1d6470[_0x8b3f('0x20')]};});}}catch(_0x643119){_0x4e95c1(_0x643119);}_0x164e46(_0x4c7c7a);});}function getInteractionTags(_0x4f281c,_0x329812){return new BPromise(function(_0x2ec966,_0x232826){try{if(_0x4f281c[_0x8b3f('0x21')]){_0x4f281c[_0x8b3f('0x22')]=[];_0x4f281c['TagIds'][_0x8b3f('0x23')](',')['forEach'](function(_0x4981dd){_0x4f281c[_0x8b3f('0x22')][_0x8b3f('0x24')](_0x329812[_0x4981dd]);});}delete _0x4f281c[_0x8b3f('0x21')];}catch(_0xf79b6d){_0x232826(_0xf79b6d);}_0x2ec966(_0x4f281c);});}function getLastMessageText(_0x251daf){return new BPromise(function(_0x50b8e2,_0x482d2f){return db[_0x8b3f('0x25')][_0x8b3f('0x26')]({'where':{'$and':[{'MailInteractionId':_0x251daf['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x8b3f('0x27')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x8b3f('0x28')],'order':'-id','raw':!![]})[_0x8b3f('0x19')](function(_0x4b2301){if(_0x4b2301&&_0x4b2301['plainBody']){_0x251daf['lastMsgText']=_[_0x8b3f('0x29')](_0x4b2301[_0x8b3f('0x28')]);}_0x50b8e2(_0x251daf);})['catch'](function(_0x58e6f9){_0x482d2f(_0x58e6f9);});});}function updateMailInteraction(_0x4ac547,_0x4c8322,_0x423878,_0x36e7c0){return new BPromise(function(_0x2e0183,_0x1b8cbb){return getInteractionUsers(_0x4ac547,_0x423878)[_0x8b3f('0x19')](function(_0xd64285){return getInteractionTags(_0xd64285,_0x4c8322);})['then'](function(_0x491fc0){if(_0x36e7c0){_0x2e0183(getLastMessageText(_0x491fc0));}else{_0x2e0183(_0x491fc0);}})[_0x8b3f('0x2a')](function(_0x340db1){_0x1b8cbb(_0x340db1);});});}exports[_0x8b3f('0x2b')]=function(_0x5ac982,_0x288df0){var _0x1318ff={},_0x4c44ed={},_0x38f5c6={'count':0x0,'rows':[]};var _0xda2c48=_['map'](db['MailInteraction'][_0x8b3f('0x2c')],function(_0x4618a7){return{'name':_0x4618a7[_0x8b3f('0x2d')],'type':_0x4618a7['type'][_0x8b3f('0x2e')]};});_0x4c44ed[_0x8b3f('0x2f')]=_[_0x8b3f('0x1f')](_0xda2c48,_0x8b3f('0x1d'));_0x4c44ed[_0x8b3f('0x30')]=_[_0x8b3f('0x31')](_0x5ac982[_0x8b3f('0x30')]);_0x4c44ed[_0x8b3f('0x32')]=_[_0x8b3f('0x33')](_0x4c44ed[_0x8b3f('0x2f')],_0x4c44ed[_0x8b3f('0x30')]);_0x1318ff[_0x8b3f('0x34')]=_['intersection'](_0x4c44ed[_0x8b3f('0x2f')],qs[_0x8b3f('0x35')](_0x5ac982[_0x8b3f('0x30')]['fields']));_0x1318ff['attributes']=_0x1318ff[_0x8b3f('0x34')][_0x8b3f('0x36')]?_0x1318ff[_0x8b3f('0x34')]:_0x4c44ed['model'];if(!_0x5ac982[_0x8b3f('0x30')][_0x8b3f('0x37')](_0x8b3f('0x38'))){_0x1318ff[_0x8b3f('0x17')]=qs[_0x8b3f('0x17')](_0x5ac982[_0x8b3f('0x30')][_0x8b3f('0x17')]);_0x1318ff[_0x8b3f('0x14')]=qs[_0x8b3f('0x14')](_0x5ac982[_0x8b3f('0x30')]['offset']);}_0x1318ff[_0x8b3f('0x39')]=qs[_0x8b3f('0x3a')](_0x5ac982[_0x8b3f('0x30')][_0x8b3f('0x3a')]);_0x1318ff[_0x8b3f('0x3b')]=qs[_0x8b3f('0x32')](_[_0x8b3f('0x3c')](_0x5ac982[_0x8b3f('0x30')],_0x4c44ed['filters']),_0xda2c48);var _0x27b4f9=[];var _0xd66b8b=squel[_0x8b3f('0x3d')]()['field']('id')[_0x8b3f('0x3e')](_0x8b3f('0x1d'))[_0x8b3f('0x3e')](_0x8b3f('0x3f'))[_0x8b3f('0x40')](_0x8b3f('0x41'));var _0x5f16aa=squel['select']()['field'](_0x8b3f('0x42'))[_0x8b3f('0x3e')](_0x8b3f('0x43'))[_0x8b3f('0x3e')](_0x8b3f('0x44'))[_0x8b3f('0x40')](_0x8b3f('0x45'),'ui')[_0x8b3f('0x46')](_0x8b3f('0x47'),'u',_0x8b3f('0x48'));var _0x562976=squel[_0x8b3f('0x3d')]()['from'](_0x8b3f('0x49'),'i')[_0x8b3f('0x46')](_0x8b3f('0x4a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x8b3f('0x46')](_0x8b3f('0x47'),'o','o.id\x20=\x20i.UserId')[_0x8b3f('0x46')](_0x8b3f('0x4b'),'a',_0x8b3f('0x4c'))['left_join'](_0x8b3f('0x4d'),'me',_0x8b3f('0x4e'))[_0x8b3f('0x46')](_0x8b3f('0x4f'),'it',_0x8b3f('0x50'))[_0x8b3f('0x46')](_0x8b3f('0x41'),'t','t.id\x20=\x20it.TagId');var _0x336265=squel[_0x8b3f('0x51')]();var _0x2b6e66=[];var _0x1d38de=squel[_0x8b3f('0x51')]();var _0x33f76c;if(_0x5ac982[_0x8b3f('0x30')][_0x8b3f('0x52')]){_0x33f76c=as[_0x8b3f('0x53')](_0x5ac982[_0x8b3f('0x30')][_0x8b3f('0x52')]);var _0x34f4e7=_0x33f76c[_0x8b3f('0x54')];for(var _0x5a233f=0x0;_0x5a233f<_0x33f76c[_0x8b3f('0x55')][_0x8b3f('0x36')];_0x5a233f++){var _0x4fe2b5=_0x33f76c['conditions'][_0x5a233f];var _0x5c9095='i';var _0x24b77b=_[_0x8b3f('0x56')](_0xda2c48,[_0x8b3f('0x1d'),_0x4fe2b5[_0x8b3f('0x3e')]]);if(!_0x24b77b){switch(_0x4fe2b5[_0x8b3f('0x3e')]){case'unreadMessages':if(_0x4fe2b5[_0x8b3f('0x57')]==0x1){_0x562976[_0x8b3f('0x58')]('`'+_0x4fe2b5[_0x8b3f('0x3e')]+_0x8b3f('0x59'));}else{_0x562976['having']('`'+_0x4fe2b5['field']+_0x8b3f('0x5a'));}break;case _0x8b3f('0x5b'):if(_0x4fe2b5[_0x8b3f('0x5c')]===_0x8b3f('0x5d')){if(_0x4fe2b5['value']['split']('\x20')[_0x8b3f('0x36')]>0x1){_0x336265[_0x34f4e7](_0x8b3f('0x5e'),qs['getFullTextValue'](_0x4fe2b5[_0x8b3f('0x57')]),null);}else{var _0x4208e6='%'+_0x4fe2b5['value']+'%';_0x336265[_0x34f4e7]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4208e6,_0x4208e6,_0x4208e6);}}else{_0x24b77b=_[_0x8b3f('0x56')](_0xda2c48,['name',_0x8b3f('0x5f')]);_0x4fe2b5[_0x8b3f('0x3e')]=_0x8b3f('0x5f');_0x398224=as[_0x8b3f('0x60')](_0x5c9095,_0x24b77b['type'],_0x4fe2b5);_0x336265[_0x34f4e7](_0x398224[_0x8b3f('0x61')],_0x398224[_0x8b3f('0x57')][_0x8b3f('0x62')],_0x398224[_0x8b3f('0x57')]['end']);}break;case _0x8b3f('0x63'):var _0xf51935=_0x4fe2b5[_0x8b3f('0x57')]['split'](',')[_0x8b3f('0x1f')](function(_0x295954){return Number(_0x295954);});_0xf51935[_0x8b3f('0x64')](function(_0x2452ef){_0x1d38de['or'](_0x8b3f('0x65'),'%,'+_0x2452ef+',%');});_0x2b6e66=_['union'](_0x2b6e66,_0xf51935);break;case _0x8b3f('0x66'):if(_0x4fe2b5[_0x8b3f('0x5c')]==='$substring'){_0x336265[_0x34f4e7]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4fe2b5[_0x8b3f('0x57')]+'%',null);}else{_0x24b77b=_[_0x8b3f('0x56')](_0xda2c48,[_0x8b3f('0x1d'),_0x8b3f('0x67')]);_0x4fe2b5[_0x8b3f('0x3e')]=_0x8b3f('0x67');_0x398224=as[_0x8b3f('0x60')](_0x5c9095,_0x24b77b[_0x8b3f('0x68')],_0x4fe2b5);_0x336265[_0x34f4e7](_0x398224[_0x8b3f('0x61')],_0x398224[_0x8b3f('0x57')][_0x8b3f('0x62')],_0x398224[_0x8b3f('0x57')]['end']);}break;case _0x8b3f('0x28'):_0x398224=as['buildExpression']('me',null,_0x4fe2b5);_0x336265[_0x34f4e7](_0x398224['text'],_0x398224[_0x8b3f('0x57')][_0x8b3f('0x62')],_0x398224[_0x8b3f('0x57')][_0x8b3f('0x11')]);break;}}else{var _0x398224=as['buildExpression'](_0x5c9095,_0x24b77b[_0x8b3f('0x68')],_0x4fe2b5);_0x336265[_0x34f4e7](_0x398224[_0x8b3f('0x61')],_0x398224['value'][_0x8b3f('0x62')],_0x398224[_0x8b3f('0x57')][_0x8b3f('0x11')]);}}}else{var _0x22a4e2=_(_0x5ac982[_0x8b3f('0x30')])[_0x8b3f('0x31')]()['map'](function(_0x3997b2){return _['some'](_0xda2c48,[_0x8b3f('0x1d'),_0x3997b2])?_0x3997b2:undefined;})[_0x8b3f('0x69')]()[_0x8b3f('0x57')]();if(!_[_0x8b3f('0x6a')](_0x22a4e2)){_0x22a4e2[_0x8b3f('0x64')](function(_0x305352){if(_0x305352===_0x8b3f('0x6b')){_0x562976[_0x8b3f('0x3b')]('i.MailAccountId\x20IN\x20?',[]['concat'](_0x5ac982[_0x8b3f('0x30')][_0x305352]));}else if(_0x305352===_0x8b3f('0x6c')){var _0x5c5d7c=JSON[_0x8b3f('0x6d')](_0x5ac982[_0x8b3f('0x30')][_0x305352])[_0x8b3f('0x6e')];var _0xdd5d20=JSON['parse'](_0x5ac982[_0x8b3f('0x30')][_0x305352])[_0x8b3f('0x6f')];_0x562976['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5c5d7c,_0xdd5d20);}else{if(_0x5ac982[_0x8b3f('0x30')][_0x305352]===_0x8b3f('0x70')){_0x562976[_0x8b3f('0x3b')]('i.'+_0x305352+_0x8b3f('0x71'));}else{_0x562976[_0x8b3f('0x3b')]('i.'+_0x305352+_0x8b3f('0x72'),_0x5ac982['query'][_0x305352]);}}});}if(_0x5ac982[_0x8b3f('0x30')][_0x8b3f('0x73')]){if(_0x5ac982[_0x8b3f('0x30')]['read']==0x1){_0x562976[_0x8b3f('0x58')]('`unreadMessages`\x20=\x200');}else{_0x562976[_0x8b3f('0x58')](_0x8b3f('0x74'));}}if(_0x5ac982['query'][_0x8b3f('0x75')]){_0x2b6e66=_[_0x8b3f('0x76')](_0x5ac982[_0x8b3f('0x30')][_0x8b3f('0x75')])?_0x5ac982['query'][_0x8b3f('0x75')]:new Array(_0x5ac982[_0x8b3f('0x30')][_0x8b3f('0x75')]);_0x2b6e66[_0x8b3f('0x64')](function(_0x1fc3f7){_0x1d38de['or'](_0x8b3f('0x65'),'%,'+_0x1fc3f7+',%');});}if(_0x5ac982[_0x8b3f('0x30')]['filter']){var _0x185589=_0x5ac982[_0x8b3f('0x30')]['filter'][_0x8b3f('0x77')]('\x5c','\x5c\x5c')[_0x8b3f('0x77')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x185589)){_0x336265['or'](_0x8b3f('0x78'),_0x185589+'%');}else if(qs[_0x8b3f('0x79')](_0x185589)){_0x336265['or'](_0x8b3f('0x7a'),_0x185589+'%');}else{_0x336265['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x185589))['or'](_0x8b3f('0x7b'),qs[_0x8b3f('0x7c')](_0x185589));}}}_0x562976[_0x8b3f('0x3b')](_0x336265);_0x562976[_0x8b3f('0x7d')](_0x8b3f('0x7e'));var _0x4e5709={'type':db[_0x8b3f('0x7f')][_0x8b3f('0x80')]['SELECT'],'raw':!![]};var _0x384f7=_0x562976['clone']();_0x384f7[_0x8b3f('0x3e')]('i.id');_0x384f7[_0x8b3f('0x3e')](_0x8b3f('0x81'),_0x8b3f('0x82'));if(_0x1318ff[_0x8b3f('0x39')]){_0x1318ff[_0x8b3f('0x39')][_0x8b3f('0x64')](function(_0x2f228b){var _0x43a64c=_0x2f228b[0x0]===_0x8b3f('0x83')?_0x2f228b[0x0]:'i.'+_0x2f228b[0x0];_0x562976[_0x8b3f('0x39')](_0x43a64c,_0x2f228b[0x1]==='DESC'?![]:!![]);});}if(!_[_0x8b3f('0x6a')](_0x2b6e66)){_0x562976['having'](_0x1d38de);_0x384f7['where'](_0x8b3f('0x84'),_0x2b6e66);}BPromise[_0x8b3f('0x85')]()[_0x8b3f('0x19')](function(){if(!_0x33f76c){if(_0x5ac982['query'][_0x8b3f('0x6b')])return;_0x384f7['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x562976['where'](_0x8b3f('0x86'));return;}if(_0x5ac982[_0x8b3f('0x87')][_0x8b3f('0x88')]!==_0x8b3f('0x89'))return;return _0x5ac982[_0x8b3f('0x87')][_0x8b3f('0x8a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5a2f9b){if(_[_0x8b3f('0x6a')](_0x5a2f9b)){_0x384f7['where'](_0x8b3f('0x8b'));_0x562976[_0x8b3f('0x3b')](_0x8b3f('0x8b'));}else{_0x384f7['where']('i.MailAccountId\x20IN\x20?',_[_0x8b3f('0x1f')](_0x5a2f9b,'id'));_0x562976[_0x8b3f('0x3b')](_0x8b3f('0x8c'),_['map'](_0x5a2f9b,'id'));}});})['then'](function(){if(_0x5ac982[_0x8b3f('0x87')][_0x8b3f('0x88')]===_0x8b3f('0x89')&&!_0x33f76c&&!_0x5ac982[_0x8b3f('0x30')][_0x8b3f('0x6b')])return[];return db['sequelize'][_0x8b3f('0x30')](_0x384f7[_0x8b3f('0x8d')](),_0x4e5709);})[_0x8b3f('0x19')](function(_0xe776ad){_0x38f5c6[_0x8b3f('0x16')]=_0xe776ad[_0x8b3f('0x36')];if(_0x38f5c6['count']===0x0)return[];return db['sequelize']['query'](_0xd66b8b[_0x8b3f('0x8d')](),_0x4e5709)['then'](function(_0x1119aa){_0x27b4f9=_['keyBy'](_0x1119aa,'id');_0x4e5709=_['merge'](_0x4e5709,{'model':db[_0x8b3f('0x8e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5ac982[_0x8b3f('0x30')][_0x8b3f('0x35')]){_0x1318ff['attributes'][_0x8b3f('0x64')](function(_0xbd78f1){_0x562976[_0x8b3f('0x3e')]('i.'+_0xbd78f1);});}else{_0x562976['field'](_0x8b3f('0x81'),_0x8b3f('0x82'));_0x562976[_0x8b3f('0x3e')]('a.key','Account.key');_0x562976['field'](_0x8b3f('0x8f'),_0x8b3f('0x90'));_0x562976[_0x8b3f('0x3e')]('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');_0x562976['field'](_0x8b3f('0x7e'));_0x562976['field']('i.createdAt');_0x562976['field'](_0x8b3f('0x91'));_0x562976[_0x8b3f('0x3e')](_0x8b3f('0x92'));_0x562976[_0x8b3f('0x3e')](_0x8b3f('0x93'));_0x562976[_0x8b3f('0x3e')]('i.attach');_0x562976[_0x8b3f('0x3e')](_0x8b3f('0x94'));_0x562976[_0x8b3f('0x3e')](_0x8b3f('0x95'));_0x562976[_0x8b3f('0x3e')](_0x8b3f('0x96'));_0x562976[_0x8b3f('0x3e')](_0x8b3f('0x97'));_0x562976[_0x8b3f('0x3e')](_0x8b3f('0x98'));_0x562976[_0x8b3f('0x3e')](_0x8b3f('0x99'));_0x562976[_0x8b3f('0x3e')](_0x8b3f('0x9a'));_0x562976[_0x8b3f('0x3e')](_0x8b3f('0x9b'));_0x562976['field'](_0x8b3f('0x9c'));_0x562976['field'](_0x8b3f('0x9d'));_0x562976[_0x8b3f('0x3e')](_0x8b3f('0x9e'));_0x562976[_0x8b3f('0x3e')](_0x8b3f('0x9f'),_0x8b3f('0xa0'));_0x562976['field'](_0x8b3f('0xa1'),_0x8b3f('0xa2'));_0x562976[_0x8b3f('0x3e')](_0x8b3f('0xa3'),_0x8b3f('0xa4'));_0x562976[_0x8b3f('0x3e')]('c.phone','Contact.phone');_0x562976[_0x8b3f('0x3e')](_0x8b3f('0xa5'),_0x8b3f('0xa6'));_0x562976[_0x8b3f('0x3e')](_0x8b3f('0xa7'),_0x8b3f('0xa8'));_0x562976[_0x8b3f('0x3e')](_0x8b3f('0xa9'),_0x8b3f('0xaa'));_0x562976[_0x8b3f('0x3e')](_0x8b3f('0xab'),_0x8b3f('0xac'));_0x562976[_0x8b3f('0x3e')](_0x8b3f('0xad'),_0x8b3f('0x21'));}if(_0x1318ff['limit'])_0x562976['limit'](_0x1318ff[_0x8b3f('0x17')]);if(_0x1318ff[_0x8b3f('0x14')])_0x562976['offset'](_0x1318ff[_0x8b3f('0x14')]);return db['sequelize']['query'](_0x562976[_0x8b3f('0x8d')](),_0x4e5709);})['then'](function(_0x19be2f){if(_0x19be2f[_0x8b3f('0x36')]>0x0)_0x5f16aa['where']('ui.MailInteractionId\x20IN\x20?',_[_0x8b3f('0x1f')](_0x19be2f,'id'));return db['sequelize'][_0x8b3f('0x30')](_0x5f16aa[_0x8b3f('0x8d')](),_0x4e5709)[_0x8b3f('0x19')](function(_0x1df92b){var _0x25769f=_['groupBy'](_0x1df92b,_0x8b3f('0xae'));var _0x32323f=[];return db['Setting'][_0x8b3f('0x26')]({'attributes':[_0x8b3f('0xaf')],'raw':!![]})[_0x8b3f('0x19')](function(_0x438f7d){var _0x2ac7e9=_0x438f7d[_0x8b3f('0xaf')];_0x19be2f['forEach'](function(_0x287b38){_0x32323f[_0x8b3f('0x24')](updateMailInteraction(_0x287b38,_0x27b4f9,_0x25769f,_0x2ac7e9));});return BPromise[_0x8b3f('0xb0')](_0x32323f);});});});})[_0x8b3f('0x19')](function(_0x371498){_0x38f5c6[_0x8b3f('0xb1')]=_0x371498;return _0x38f5c6;})[_0x8b3f('0x19')](respondWithFilteredResult(_0x288df0,_0x1318ff))[_0x8b3f('0x2a')](handleError(_0x288df0,null));};exports[_0x8b3f('0xb2')]=function(_0x42e56,_0x12f22e){var _0x109ebe={'raw':![],'where':{'id':_0x42e56[_0x8b3f('0xb3')]['id']}},_0x4c0c4a={};_0x4c0c4a[_0x8b3f('0x2f')]=_['keys'](db[_0x8b3f('0x8e')][_0x8b3f('0x2c')]);_0x4c0c4a[_0x8b3f('0x30')]=_[_0x8b3f('0x31')](_0x42e56[_0x8b3f('0x30')]);_0x4c0c4a['filters']=_[_0x8b3f('0x33')](_0x4c0c4a[_0x8b3f('0x2f')],_0x4c0c4a['query']);_0x109ebe['attributes']=_[_0x8b3f('0x33')](_0x4c0c4a['model'],qs[_0x8b3f('0x35')](_0x42e56[_0x8b3f('0x30')][_0x8b3f('0x35')]));_0x109ebe[_0x8b3f('0x34')]=_0x109ebe['attributes']['length']?_0x109ebe[_0x8b3f('0x34')]:_0x4c0c4a[_0x8b3f('0x2f')];if(_0x42e56[_0x8b3f('0x30')][_0x8b3f('0xb4')]){_0x109ebe[_0x8b3f('0xb5')]=[{'all':!![]}];}_0x109ebe=_[_0x8b3f('0xb6')]({},_0x109ebe,_0x42e56['options']);return db[_0x8b3f('0x8e')][_0x8b3f('0x56')](_0x109ebe)[_0x8b3f('0x19')](handleEntityNotFound(_0x12f22e,null))[_0x8b3f('0x19')](respondWithResult(_0x12f22e,null))[_0x8b3f('0x2a')](handleError(_0x12f22e,null));};exports[_0x8b3f('0xb7')]=function(_0x21ce53,_0x35057a){return db[_0x8b3f('0x8e')][_0x8b3f('0xb7')](_0x21ce53[_0x8b3f('0xb8')],{})['then'](respondWithResult(_0x35057a,0xc9))[_0x8b3f('0x2a')](handleError(_0x35057a,null));};exports[_0x8b3f('0xb9')]=function(_0x51151e,_0x3fe45e){if(_0x51151e['body']['id']){delete _0x51151e['body']['id'];}return db[_0x8b3f('0x8e')][_0x8b3f('0x56')]({'where':{'id':_0x51151e[_0x8b3f('0xb3')]['id']}})['then'](handleEntityNotFound(_0x3fe45e,null))['then'](saveUpdates(_0x51151e['body'],null))[_0x8b3f('0x19')](respondWithResult(_0x3fe45e,null))['catch'](handleError(_0x3fe45e,null));};exports[_0x8b3f('0xba')]=function(_0x273331,_0x2fdee7){return db[_0x8b3f('0x8e')][_0x8b3f('0x56')]({'where':{'id':_0x273331[_0x8b3f('0xb3')]['id']}})[_0x8b3f('0x19')](handleEntityNotFound(_0x2fdee7,null))[_0x8b3f('0x19')](removeEntity(_0x2fdee7,null))[_0x8b3f('0x2a')](handleError(_0x2fdee7,null));};exports[_0x8b3f('0xbb')]=function(_0x50bfee,_0x9fb156){return db[_0x8b3f('0x8e')]['describe']()['then'](respondWithResult(_0x9fb156,null))[_0x8b3f('0x2a')](handleError(_0x9fb156,null));};exports[_0x8b3f('0xbc')]=function(_0x300c91,_0x435666){return db[_0x8b3f('0x25')][_0x8b3f('0x56')]({'where':{'id':_0x300c91['params']['id']}})[_0x8b3f('0x19')](handleEntityNotFound(_0x435666,null))[_0x8b3f('0x19')](function(_0x260cca){if(_0x260cca){return _0x260cca[_0x8b3f('0xbc')](_0x300c91[_0x8b3f('0xb8')][_0x8b3f('0xbd')],_['omit'](_0x300c91['body'],['ids','id'])||{});}})[_0x8b3f('0x19')](respondWithResult(_0x435666,null))['catch'](handleError(_0x435666,null));};exports[_0x8b3f('0xbe')]=function(_0x1c38fc,_0x82e509){var _0xaaa68b={'raw':![],'where':{}};var _0x4b6767={};var _0x570a59={'count':0x0,'rows':[]};return db['MailInteraction'][_0x8b3f('0x26')]({'where':{'id':_0x1c38fc[_0x8b3f('0xb3')]['id']}})['then'](handleEntityNotFound(_0x82e509,null))['then'](function(_0x5b32d0){if(_0x5b32d0){_0x4b6767[_0x8b3f('0x2f')]=_[_0x8b3f('0x31')](db[_0x8b3f('0x25')]['rawAttributes']);_0x4b6767[_0x8b3f('0x30')]=_['keys'](_0x1c38fc[_0x8b3f('0x30')]);_0x4b6767[_0x8b3f('0x32')]=_[_0x8b3f('0x33')](_0x4b6767[_0x8b3f('0x2f')],_0x4b6767[_0x8b3f('0x30')]);_0xaaa68b['attributes']=_[_0x8b3f('0x33')](_0x4b6767['model'],qs[_0x8b3f('0x35')](_0x1c38fc[_0x8b3f('0x30')][_0x8b3f('0x35')]));_0xaaa68b['attributes']=_0xaaa68b[_0x8b3f('0x34')][_0x8b3f('0x36')]?_0xaaa68b[_0x8b3f('0x34')]:_0x4b6767[_0x8b3f('0x2f')];if(!_0x1c38fc[_0x8b3f('0x30')][_0x8b3f('0x37')](_0x8b3f('0x38'))){_0xaaa68b[_0x8b3f('0x17')]=qs[_0x8b3f('0x17')](_0x1c38fc[_0x8b3f('0x30')][_0x8b3f('0x17')]);_0xaaa68b['offset']=qs[_0x8b3f('0x14')](_0x1c38fc[_0x8b3f('0x30')]['offset']);}_0xaaa68b[_0x8b3f('0x39')]=qs[_0x8b3f('0x3a')](_0x1c38fc[_0x8b3f('0x30')]['sort']);_0xaaa68b[_0x8b3f('0x3b')]=qs['filters'](_[_0x8b3f('0x3c')](_0x1c38fc[_0x8b3f('0x30')],_0x4b6767[_0x8b3f('0x32')]));_0xaaa68b[_0x8b3f('0x3b')][_0x8b3f('0xae')]=_0x5b32d0['id'];if(_0x1c38fc[_0x8b3f('0x30')]['filter']){_0xaaa68b['where']=_[_0x8b3f('0xb6')](_0xaaa68b[_0x8b3f('0x3b')],{'$or':_[_0x8b3f('0x1f')](_0xaaa68b[_0x8b3f('0x34')],function(_0x1f3a3d){var _0x2881bb={};_0x2881bb[_0x1f3a3d]={'$like':'%'+_0x1c38fc[_0x8b3f('0x30')][_0x8b3f('0xbf')]+'%'};return _0x2881bb;})});}if(_0x1c38fc[_0x8b3f('0x30')][_0x8b3f('0x6e')]){var _0x1bfba4=_0x1c38fc[_0x8b3f('0x30')]['$gte']['split'](',');var _0x50ab8f={};_0x50ab8f[_0x1bfba4[0x0]]={'$gte':moment(_0x1bfba4[0x1])[_0x8b3f('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')};_0xaaa68b[_0x8b3f('0x3b')]=_[_0x8b3f('0xb6')](_0xaaa68b[_0x8b3f('0x3b')],_0x50ab8f);}_0xaaa68b=_[_0x8b3f('0xb6')]({},_0xaaa68b,_0x1c38fc[_0x8b3f('0xc1')]);return db[_0x8b3f('0x25')][_0x8b3f('0x16')]({'where':_0xaaa68b[_0x8b3f('0x3b')]})[_0x8b3f('0x19')](function(_0x57df9e){_0x570a59[_0x8b3f('0x16')]=_0x57df9e;if(_0x1c38fc['query'][_0x8b3f('0xb4')]){_0xaaa68b['include']=[{'all':!![]}];}return db[_0x8b3f('0x25')]['findAll'](_0xaaa68b);})[_0x8b3f('0x19')](function(_0x4726f0){if(_0x1c38fc[_0x8b3f('0x30')][_0x8b3f('0xc2')]===_0x8b3f('0xc3')){for(var _0x3c3e8e=0x0;_0x3c3e8e<_0x4726f0[_0x8b3f('0x36')];_0x3c3e8e++){_0x4726f0[_0x3c3e8e]['body']=juice(_0x4726f0[_0x3c3e8e][_0x8b3f('0xb8')]);}}_0x570a59[_0x8b3f('0xb1')]=_0x4726f0;return _0x570a59;});}})[_0x8b3f('0x19')](respondWithFilteredResult(_0x82e509,_0xaaa68b))[_0x8b3f('0x2a')](handleError(_0x82e509,null));};exports['addTags']=function(_0x2ce5f8,_0x91a628){return db[_0x8b3f('0x8e')][_0x8b3f('0x56')]({'where':{'id':_0x2ce5f8[_0x8b3f('0xb3')]['id']}})[_0x8b3f('0x19')](handleEntityNotFound(_0x91a628,null))[_0x8b3f('0x19')](function(_0x2e4707){if(_0x2e4707){return _0x2e4707['setTags'](_0x2ce5f8[_0x8b3f('0xb8')][_0x8b3f('0xbd')],_['omit'](_0x2ce5f8[_0x8b3f('0xb8')],['ids','id'])||{})[_0x8b3f('0xc4')](function(){return db['Tag'][_0x8b3f('0xc5')]({'attributes':['id',_0x8b3f('0x1d'),'color'],'where':{'id':_0x2ce5f8['body'][_0x8b3f('0xbd')]}});})[_0x8b3f('0x19')](function(_0x4f9d10){socket[_0x8b3f('0xc6')](_0x8b3f('0xc7'),{'id':Number(_0x2ce5f8[_0x8b3f('0xb3')]['id']),'tags':_0x4f9d10||[]});return{'id':Number(_0x2ce5f8[_0x8b3f('0xb3')]['id']),'tags':_0x4f9d10||[]};});}})[_0x8b3f('0x19')](respondWithResult(_0x91a628,null))[_0x8b3f('0x2a')](handleError(_0x91a628,null));};exports[_0x8b3f('0xc8')]=function(_0x3bbe8a,_0x420d6c){return db[_0x8b3f('0x8e')][_0x8b3f('0x56')]({'where':{'id':_0x3bbe8a[_0x8b3f('0xb3')]['id']}})['then'](handleEntityNotFound(_0x420d6c,null))[_0x8b3f('0x19')](function(_0x35ca1a){if(_0x35ca1a){return _0x35ca1a[_0x8b3f('0xc8')](_0x3bbe8a[_0x8b3f('0x30')]['ids']);}})[_0x8b3f('0x19')](respondWithStatusCode(_0x420d6c,null))[_0x8b3f('0x2a')](handleError(_0x420d6c,null));};exports['download']=function(_0x4855e5,_0x4c5b70){var _0x18dcc1=moment()[_0x8b3f('0xc9')]()[_0x8b3f('0x8d')]();var _0x23dbbd=path[_0x8b3f('0xca')](config[_0x8b3f('0xcb')],'server',_0x8b3f('0xcc'),_0x8b3f('0xcd'));var _0x1c2d7c=path[_0x8b3f('0xca')](config['root'],_0x8b3f('0xce'),_0x8b3f('0xcc'),'attachments');var _0x3fd146=path[_0x8b3f('0xca')](_0x23dbbd,_0x18dcc1);var _0x1d81f0=util['format'](_0x8b3f('0xcf'),_0x4855e5['params']['id'],_0x18dcc1);var _0x1aef23=path[_0x8b3f('0xca')](_0x23dbbd,_0x1d81f0);var _0x2a49b3=[];if(_0x4855e5[_0x8b3f('0x30')][_0x8b3f('0xd0')]){_0x2a49b3['push']({'model':db[_0x8b3f('0xd1')],'as':'Attachments','raw':!![]});}var _0x24e46e=[{'model':db['MailMessage'],'as':_0x8b3f('0xd2'),'attributes':['id','body','from','to','cc',_0x8b3f('0xd3'),'subject',_0x8b3f('0x6c')],'where':{'secret':![]},'order':qs[_0x8b3f('0x3a')]('id'),'include':_0x2a49b3}];return db['MailInteraction'][_0x8b3f('0x56')]({'where':{'id':_0x4855e5[_0x8b3f('0xb3')]['id']},'include':_0x24e46e})[_0x8b3f('0x19')](handleEntityNotFound(_0x4c5b70,null))[_0x8b3f('0x19')](function(_0x32cbbc){if(_0x32cbbc&&_0x32cbbc[_0x8b3f('0xd2')]){var _0x235d43=_0x32cbbc['get']({'plain':!![]});fs[_0x8b3f('0xd4')](_0x3fd146);return BPromise['each'](_0x235d43[_0x8b3f('0xd2')],function(_0x4d337a,_0x549e68){var _0x5bf6fa={'from':_0x4d337a[_0x8b3f('0x40')],'to':_0x4d337a['to'],'subject':_0x4d337a[_0x8b3f('0xd5')],'html':htmlEntities[_0x8b3f('0xd6')](_0x4d337a[_0x8b3f('0xb8')]),'headers':{'Date':moment(_0x4d337a['createdAt'])[_0x8b3f('0xc0')](_0x8b3f('0xd7'))},'attachments':[]};if(_0x4d337a['cc']){_0x5bf6fa[_0x8b3f('0xd8')]['Cc']=_0x4d337a['cc'];}if(_0x4d337a[_0x8b3f('0xd3')]){_0x5bf6fa[_0x8b3f('0xd8')][_0x8b3f('0xd9')]=_0x4d337a[_0x8b3f('0xd3')];}return new BPromise(function(_0x5db4b8,_0x3916eb){if(_0x4d337a[_0x8b3f('0xda')]){for(var _0xdf9d4e=0x0;_0xdf9d4e<_0x4d337a[_0x8b3f('0xda')][_0x8b3f('0x36')];_0xdf9d4e++){var _0x453121=_0x4d337a[_0x8b3f('0xda')][_0xdf9d4e];var _0x1c2e95=path[_0x8b3f('0xca')](_0x1c2d7c,_0x453121['basename']);if(fs[_0x8b3f('0xdb')](_0x1c2e95)){_0x5bf6fa['attachments'][_0x8b3f('0x24')]({'name':_0x453121[_0x8b3f('0x1d')],'contentType':_0x453121['type'],'data':fs[_0x8b3f('0xdc')](_0x1c2e95)});}}}emlformat[_0x8b3f('0xdd')](_0x5bf6fa,function(_0x5d9d8a,_0x357870){if(_0x5d9d8a)return _0x3916eb(_0x5d9d8a);fs['writeFileSync'](path['join'](_0x3fd146,util[_0x8b3f('0xc0')](_0x8b3f('0xde'),_0x549e68)),_0x357870);return _0x5db4b8(_0x357870);});});})[_0x8b3f('0x19')](function(){return new BPromise(function(_0x128984,_0x5386c9){zipdir(_0x3fd146,{'saveTo':_0x1aef23},function(_0x181d1c,_0x358304){if(_0x181d1c)return _0x5386c9(_0x181d1c);return _0x128984(_0x358304);});})[_0x8b3f('0x19')](function(){return new BPromise(function(_0x2a01a0,_0x1cf022){rimraf(_0x3fd146,function(_0x40f465){if(_0x40f465)_0x1cf022(_0x40f465);return _0x2a01a0();});});})[_0x8b3f('0x19')](function(){return _0x4c5b70['download'](_0x1aef23,_0x1d81f0,function(_0x211256){if(!_0x211256)fs[_0x8b3f('0xdf')](_0x1aef23);});});});}else{return _0x4c5b70[_0x8b3f('0x1a')](0xc8);}})['catch'](handleError(_0x4c5b70,null));}; \ No newline at end of file +var _0xc3e3=['../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','name','send','Users','fullname','TagIds','Tags','forEach','MailMessage','findOne','out','-id','plainBody','trimStart','catch','index','MailInteraction','rawAttributes','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','field','color','from','tools_tags','select','u.id','u.fullname','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','Contact','value','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','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','start','some','isEmpty','where','i.MailAccountId\x20IN\x20?','concat','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','a.mandatoryDisposition','Account.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.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.substatus','i.to','i.MailAccountId','i.UserId','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','MailInteractionId','Setting','enableEmailPreview','push','all','rows','show','includeAll','include','merge','create','body','params','addMessage','ids','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','true','addTags','setTags','omit','emit','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','createdAt','get','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','type','readFileSync','build','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','lodash','squel','ioredis','../../components/parsers/qs'];(function(_0x49f67f,_0x4113a4){var _0x4779a1=function(_0x5064b0){while(--_0x5064b0){_0x49f67f['push'](_0x49f67f['shift']());}};_0x4779a1(++_0x4113a4);}(_0xc3e3,0x1c9));var _0x3c3e=function(_0x368590,_0x48ad74){_0x368590=_0x368590-0x0;var _0x5ceb60=_0xc3e3[_0x368590];return _0x5ceb60;};'use strict';var emlformat=require(_0x3c3e('0x0'));var rimraf=require(_0x3c3e('0x1'));var zipdir=require(_0x3c3e('0x2'));var moment=require(_0x3c3e('0x3'));var BPromise=require(_0x3c3e('0x4'));var util=require(_0x3c3e('0x5'));var path=require(_0x3c3e('0x6'));var fs=require('fs');var _=require(_0x3c3e('0x7'));var squel=require(_0x3c3e('0x8'));var juice=require('juice');var Redis=require(_0x3c3e('0x9'));var qs=require(_0x3c3e('0xa'));var as=require(_0x3c3e('0xb'));var logger=require(_0x3c3e('0xc'))(_0x3c3e('0xd'));var config=require('../../config/environment');var db=require(_0x3c3e('0xe'))['db'];var htmlEntities=require(_0x3c3e('0xf'));config[_0x3c3e('0x10')]=_[_0x3c3e('0x11')](config['redis'],{'host':_0x3c3e('0x12'),'port':0x18eb});var socket=require(_0x3c3e('0x13'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0x3c3e('0x14')](socket);function respondWithStatusCode(_0x614f90,_0x541652){_0x541652=_0x541652||0xcc;return function(_0x50f9db){if(_0x50f9db){return _0x614f90[_0x3c3e('0x15')](_0x541652);}return _0x614f90['status'](_0x541652)[_0x3c3e('0x16')]();};}function respondWithResult(_0xcabd2a,_0x17389f){_0x17389f=_0x17389f||0xc8;return function(_0xb65b3){if(_0xb65b3){return _0xcabd2a[_0x3c3e('0x17')](_0x17389f)[_0x3c3e('0x18')](_0xb65b3);}};}function respondWithFilteredResult(_0x844c17,_0x46e79f){return function(_0xce781a){if(_0xce781a){var _0x54c8c6=typeof _0x46e79f[_0x3c3e('0x19')]===_0x3c3e('0x1a')&&typeof _0x46e79f[_0x3c3e('0x1b')]==='undefined';var _0x450b20=_0xce781a['count'];var _0xc48672=_0x54c8c6?0x0:_0x46e79f[_0x3c3e('0x19')];var _0x2545e4=_0x54c8c6?_0xce781a[_0x3c3e('0x1c')]:_0x46e79f[_0x3c3e('0x19')]+_0x46e79f[_0x3c3e('0x1b')];var _0x3ce48d;if(_0x2545e4>=_0x450b20){_0x2545e4=_0x450b20;_0x3ce48d=0xc8;}else{_0x3ce48d=0xce;}_0x844c17[_0x3c3e('0x17')](_0x3ce48d);return _0x844c17['set'](_0x3c3e('0x1d'),_0xc48672+'-'+_0x2545e4+'/'+_0x450b20)[_0x3c3e('0x18')](_0xce781a);}return null;};}function saveUpdates(_0x348983){return function(_0x2abe3f){if(_0x2abe3f){return _0x2abe3f[_0x3c3e('0x1e')](_0x348983)[_0x3c3e('0x1f')](function(_0x5844f6){return _0x5844f6;});}return null;};}function removeEntity(_0x3a04c3){return function(_0x14e05a){if(_0x14e05a){return _0x14e05a[_0x3c3e('0x20')]()[_0x3c3e('0x1f')](function(){_0x3a04c3[_0x3c3e('0x17')](0xcc)[_0x3c3e('0x16')]();});}};}function handleEntityNotFound(_0x38c414){return function(_0x3162d5){if(!_0x3162d5){_0x38c414[_0x3c3e('0x15')](0x194);}return _0x3162d5;};}function handleError(_0x58b6b6,_0x33fc04){_0x33fc04=_0x33fc04||0x1f4;return function(_0x381840){logger[_0x3c3e('0x21')](_0x381840['stack']);if(_0x381840[_0x3c3e('0x22')]){delete _0x381840[_0x3c3e('0x22')];}_0x58b6b6[_0x3c3e('0x17')](_0x33fc04)[_0x3c3e('0x23')](_0x381840);};}function getInteractionUsers(_0x12b590,_0x49f003){return new BPromise(function(_0x3c0177,_0x3da31e){try{if(_0x49f003[_0x12b590['id']]){_0x12b590[_0x3c3e('0x24')]=_['map'](_0x49f003[_0x12b590['id']],function(_0x478984){return{'id':_0x478984['id'],'fullname':_0x478984[_0x3c3e('0x25')]};});}}catch(_0x28ea00){_0x3da31e(_0x28ea00);}_0x3c0177(_0x12b590);});}function getInteractionTags(_0x4f83f5,_0xa2b0eb){return new BPromise(function(_0x46b010,_0x33a100){try{if(_0x4f83f5[_0x3c3e('0x26')]){_0x4f83f5[_0x3c3e('0x27')]=[];_0x4f83f5[_0x3c3e('0x26')]['split'](',')[_0x3c3e('0x28')](function(_0x5eec56){_0x4f83f5[_0x3c3e('0x27')]['push'](_0xa2b0eb[_0x5eec56]);});}delete _0x4f83f5[_0x3c3e('0x26')];}catch(_0x33824a){_0x33a100(_0x33824a);}_0x46b010(_0x4f83f5);});}function getLastMessageText(_0x222ace){return new BPromise(function(_0x45d5d9,_0x4c238e){return db[_0x3c3e('0x29')][_0x3c3e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x222ace['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x3c3e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x3c3e('0x2c'),'raw':!![]})[_0x3c3e('0x1f')](function(_0x4aecac){if(_0x4aecac&&_0x4aecac[_0x3c3e('0x2d')]){_0x222ace['lastMsgText']=_[_0x3c3e('0x2e')](_0x4aecac[_0x3c3e('0x2d')]);}_0x45d5d9(_0x222ace);})[_0x3c3e('0x2f')](function(_0x28bbbc){_0x4c238e(_0x28bbbc);});});}function updateMailInteraction(_0x2d4a9b,_0xe002e5,_0x3afec4,_0x5ce861){return new BPromise(function(_0x1cea9d,_0x2ed5c3){return getInteractionUsers(_0x2d4a9b,_0x3afec4)['then'](function(_0x483a24){return getInteractionTags(_0x483a24,_0xe002e5);})[_0x3c3e('0x1f')](function(_0x356fbb){if(_0x5ce861){_0x1cea9d(getLastMessageText(_0x356fbb));}else{_0x1cea9d(_0x356fbb);}})[_0x3c3e('0x2f')](function(_0x5362c7){_0x2ed5c3(_0x5362c7);});});}exports[_0x3c3e('0x30')]=function(_0xb845f2,_0x11cecd){var _0x1c3e2={},_0x496d4a={},_0x1b7cc6={'count':0x0,'rows':[]};var _0x296bfe=_['map'](db[_0x3c3e('0x31')][_0x3c3e('0x32')],function(_0xf3a7b0){return{'name':_0xf3a7b0['fieldName'],'type':_0xf3a7b0['type']['key']};});_0x496d4a[_0x3c3e('0x33')]=_[_0x3c3e('0x34')](_0x296bfe,'name');_0x496d4a[_0x3c3e('0x35')]=_[_0x3c3e('0x36')](_0xb845f2[_0x3c3e('0x35')]);_0x496d4a[_0x3c3e('0x37')]=_['intersection'](_0x496d4a[_0x3c3e('0x33')],_0x496d4a[_0x3c3e('0x35')]);_0x1c3e2[_0x3c3e('0x38')]=_[_0x3c3e('0x39')](_0x496d4a[_0x3c3e('0x33')],qs[_0x3c3e('0x3a')](_0xb845f2[_0x3c3e('0x35')][_0x3c3e('0x3a')]));_0x1c3e2['attributes']=_0x1c3e2[_0x3c3e('0x38')][_0x3c3e('0x3b')]?_0x1c3e2['attributes']:_0x496d4a[_0x3c3e('0x33')];if(!_0xb845f2[_0x3c3e('0x35')][_0x3c3e('0x3c')]('nolimit')){_0x1c3e2['limit']=qs['limit'](_0xb845f2[_0x3c3e('0x35')][_0x3c3e('0x1b')]);_0x1c3e2[_0x3c3e('0x19')]=qs[_0x3c3e('0x19')](_0xb845f2['query'][_0x3c3e('0x19')]);}_0x1c3e2[_0x3c3e('0x3d')]=qs[_0x3c3e('0x3e')](_0xb845f2['query'][_0x3c3e('0x3e')]);_0x1c3e2['where']=qs[_0x3c3e('0x37')](_['pick'](_0xb845f2[_0x3c3e('0x35')],_0x496d4a[_0x3c3e('0x37')]),_0x296bfe);var _0x397b96=[];var _0x111634=squel['select']()['field']('id')[_0x3c3e('0x3f')](_0x3c3e('0x22'))[_0x3c3e('0x3f')](_0x3c3e('0x40'))[_0x3c3e('0x41')](_0x3c3e('0x42'));var _0x4bdce4=squel[_0x3c3e('0x43')]()[_0x3c3e('0x3f')](_0x3c3e('0x44'))[_0x3c3e('0x3f')](_0x3c3e('0x45'))['field']('ui.MailInteractionId')['from'](_0x3c3e('0x46'),'ui')[_0x3c3e('0x47')](_0x3c3e('0x48'),'u',_0x3c3e('0x49'));var _0xc9d228=squel['select']()['from'](_0x3c3e('0x4a'),'i')[_0x3c3e('0x47')](_0x3c3e('0x4b'),'c',_0x3c3e('0x4c'))[_0x3c3e('0x47')](_0x3c3e('0x48'),'o',_0x3c3e('0x4d'))[_0x3c3e('0x47')](_0x3c3e('0x4e'),'a','a.id\x20=\x20i.MailAccountId')[_0x3c3e('0x47')](_0x3c3e('0x4f'),'me',_0x3c3e('0x50'))[_0x3c3e('0x47')](_0x3c3e('0x51'),'it',_0x3c3e('0x52'))[_0x3c3e('0x47')](_0x3c3e('0x42'),'t',_0x3c3e('0x53'));var _0xbdf311=squel['expr']();var _0x3100de=[];var _0x48447e=squel[_0x3c3e('0x54')]();var _0x2c61c1;if(_0xb845f2[_0x3c3e('0x35')][_0x3c3e('0x55')]){_0x2c61c1=as[_0x3c3e('0x56')](_0xb845f2[_0x3c3e('0x35')][_0x3c3e('0x55')]);var _0x3571ee=_0x2c61c1[_0x3c3e('0x57')];for(var _0x4af8c5=0x0;_0x4af8c5<_0x2c61c1[_0x3c3e('0x58')][_0x3c3e('0x3b')];_0x4af8c5++){var _0x3ab5dd=_0x2c61c1[_0x3c3e('0x58')][_0x4af8c5];var _0x151bf9='i';var _0x4da638=_[_0x3c3e('0x59')](_0x296bfe,['name',_0x3ab5dd[_0x3c3e('0x3f')]]);if(!_0x4da638){switch(_0x3ab5dd['field']){case _0x3c3e('0x5a'):if(_0x3ab5dd['value']==0x1){_0xc9d228[_0x3c3e('0x5b')]('`'+_0x3ab5dd['field']+_0x3c3e('0x5c'));}else{_0xc9d228['having']('`'+_0x3ab5dd[_0x3c3e('0x3f')]+'`\x20>\x200');}break;case _0x3c3e('0x5d'):if(_0x3ab5dd['operator']==='$substring'){if(_0x3ab5dd[_0x3c3e('0x5e')][_0x3c3e('0x5f')]('\x20')[_0x3c3e('0x3b')]>0x1){_0xbdf311[_0x3571ee](_0x3c3e('0x60'),qs[_0x3c3e('0x61')](_0x3ab5dd['value']),null);}else{var _0x896487='%'+_0x3ab5dd[_0x3c3e('0x5e')]+'%';_0xbdf311[_0x3571ee](_0x3c3e('0x62'),_0x896487,_0x896487,_0x896487);}}else{_0x4da638=_[_0x3c3e('0x59')](_0x296bfe,[_0x3c3e('0x22'),_0x3c3e('0x63')]);_0x3ab5dd[_0x3c3e('0x3f')]=_0x3c3e('0x63');_0x393d57=as[_0x3c3e('0x64')](_0x151bf9,_0x4da638['type'],_0x3ab5dd);_0xbdf311[_0x3571ee](_0x393d57['text'],_0x393d57[_0x3c3e('0x5e')]['start'],_0x393d57['value'][_0x3c3e('0x16')]);}break;case _0x3c3e('0x65'):var _0x8af0cf=_0x3ab5dd['value']['split'](',')[_0x3c3e('0x34')](function(_0x37897a){return Number(_0x37897a);});_0x8af0cf[_0x3c3e('0x28')](function(_0x1fab80){_0x48447e['or'](_0x3c3e('0x66'),'%,'+_0x1fab80+',%');});_0x3100de=_[_0x3c3e('0x67')](_0x3100de,_0x8af0cf);break;case _0x3c3e('0x68'):if(_0x3ab5dd[_0x3c3e('0x69')]===_0x3c3e('0x6a')){_0xbdf311[_0x3571ee](_0x3c3e('0x6b'),'%'+_0x3ab5dd[_0x3c3e('0x5e')]+'%',null);}else{_0x4da638=_[_0x3c3e('0x59')](_0x296bfe,[_0x3c3e('0x22'),'UserId']);_0x3ab5dd[_0x3c3e('0x3f')]=_0x3c3e('0x6c');_0x393d57=as['buildExpression'](_0x151bf9,_0x4da638['type'],_0x3ab5dd);_0xbdf311[_0x3571ee](_0x393d57[_0x3c3e('0x6d')],_0x393d57[_0x3c3e('0x5e')][_0x3c3e('0x6e')],_0x393d57[_0x3c3e('0x5e')][_0x3c3e('0x16')]);}break;case'plainBody':_0x393d57=as[_0x3c3e('0x64')]('me',null,_0x3ab5dd);_0xbdf311[_0x3571ee](_0x393d57['text'],_0x393d57[_0x3c3e('0x5e')]['start'],_0x393d57[_0x3c3e('0x5e')][_0x3c3e('0x16')]);break;}}else{var _0x393d57=as[_0x3c3e('0x64')](_0x151bf9,_0x4da638['type'],_0x3ab5dd);_0xbdf311[_0x3571ee](_0x393d57[_0x3c3e('0x6d')],_0x393d57[_0x3c3e('0x5e')]['start'],_0x393d57[_0x3c3e('0x5e')][_0x3c3e('0x16')]);}}}else{var _0x5dc195=_(_0xb845f2[_0x3c3e('0x35')])[_0x3c3e('0x36')]()[_0x3c3e('0x34')](function(_0x3d558f){return _[_0x3c3e('0x6f')](_0x296bfe,[_0x3c3e('0x22'),_0x3d558f])?_0x3d558f:undefined;})['compact']()['value']();if(!_[_0x3c3e('0x70')](_0x5dc195)){_0x5dc195['forEach'](function(_0x47818c){if(_0x47818c==='MailAccountId'){_0xc9d228[_0x3c3e('0x71')](_0x3c3e('0x72'),[][_0x3c3e('0x73')](_0xb845f2[_0x3c3e('0x35')][_0x47818c]));}else if(_0x47818c==='createdAt'){var _0x253c1b=JSON[_0x3c3e('0x74')](_0xb845f2['query'][_0x47818c])['$gte'];var _0x3515e4=JSON[_0x3c3e('0x74')](_0xb845f2[_0x3c3e('0x35')][_0x47818c])['$lte'];_0xc9d228[_0x3c3e('0x71')](_0x3c3e('0x75'),_0x253c1b,_0x3515e4);}else{if(_0xb845f2[_0x3c3e('0x35')][_0x47818c]===_0x3c3e('0x76')){_0xc9d228[_0x3c3e('0x71')]('i.'+_0x47818c+_0x3c3e('0x77'));}else{_0xc9d228['where']('i.'+_0x47818c+_0x3c3e('0x78'),_0xb845f2[_0x3c3e('0x35')][_0x47818c]);}}});}if(_0xb845f2[_0x3c3e('0x35')][_0x3c3e('0x79')]){if(_0xb845f2[_0x3c3e('0x35')]['read']==0x1){_0xc9d228[_0x3c3e('0x5b')](_0x3c3e('0x7a'));}else{_0xc9d228[_0x3c3e('0x5b')](_0x3c3e('0x7b'));}}if(_0xb845f2[_0x3c3e('0x35')][_0x3c3e('0x7c')]){_0x3100de=_[_0x3c3e('0x7d')](_0xb845f2[_0x3c3e('0x35')]['tag'])?_0xb845f2[_0x3c3e('0x35')][_0x3c3e('0x7c')]:new Array(_0xb845f2[_0x3c3e('0x35')][_0x3c3e('0x7c')]);_0x3100de[_0x3c3e('0x28')](function(_0xd07031){_0x48447e['or'](_0x3c3e('0x66'),'%,'+_0xd07031+',%');});}if(_0xb845f2[_0x3c3e('0x35')]['filter']){var _0x3803de=_0xb845f2[_0x3c3e('0x35')][_0x3c3e('0x7e')][_0x3c3e('0x7f')]('\x5c','\x5c\x5c')[_0x3c3e('0x7f')](/'/g,'\x27\x27');if(qs[_0x3c3e('0x80')](_0x3803de)){_0xbdf311['or'](_0x3c3e('0x81'),_0x3803de+'%');}else if(qs[_0x3c3e('0x82')](_0x3803de)){_0xbdf311['or'](_0x3c3e('0x83'),_0x3803de+'%');}else{_0xbdf311['or'](_0x3c3e('0x84'),qs[_0x3c3e('0x61')](_0x3803de))['or'](_0x3c3e('0x85'),qs[_0x3c3e('0x61')](_0x3803de));}}}_0xc9d228[_0x3c3e('0x71')](_0xbdf311);_0xc9d228['group'](_0x3c3e('0x86'));var _0x440633={'type':db[_0x3c3e('0x87')][_0x3c3e('0x88')]['SELECT'],'raw':!![]};var _0x449ae6=_0xc9d228['clone']();_0x449ae6[_0x3c3e('0x3f')](_0x3c3e('0x86'));_0x449ae6[_0x3c3e('0x3f')](_0x3c3e('0x89'),_0x3c3e('0x5a'));if(_0x1c3e2[_0x3c3e('0x3d')]){_0x1c3e2['order'][_0x3c3e('0x28')](function(_0x4130bc){var _0x4755a4=_0x4130bc[0x0]===_0x3c3e('0x8a')?_0x4130bc[0x0]:'i.'+_0x4130bc[0x0];_0xc9d228['order'](_0x4755a4,_0x4130bc[0x1]==='DESC'?![]:!![]);});}if(!_[_0x3c3e('0x70')](_0x3100de)){_0xc9d228[_0x3c3e('0x5b')](_0x48447e);_0x449ae6[_0x3c3e('0x71')](_0x3c3e('0x8b'),_0x3100de);}BPromise[_0x3c3e('0x8c')]()[_0x3c3e('0x1f')](function(){if(!_0x2c61c1){if(_0xb845f2[_0x3c3e('0x35')][_0x3c3e('0x8d')])return;_0x449ae6[_0x3c3e('0x71')](_0x3c3e('0x8e'));_0xc9d228[_0x3c3e('0x71')](_0x3c3e('0x8e'));return;}if(_0xb845f2[_0x3c3e('0x8f')][_0x3c3e('0x90')]!==_0x3c3e('0x91'))return;return _0xb845f2[_0x3c3e('0x8f')][_0x3c3e('0x92')]({'attributes':['id'],'raw':!![]})[_0x3c3e('0x1f')](function(_0x5ed407){if(_['isEmpty'](_0x5ed407)){_0x449ae6[_0x3c3e('0x71')](_0x3c3e('0x93'));_0xc9d228[_0x3c3e('0x71')](_0x3c3e('0x93'));}else{_0x449ae6[_0x3c3e('0x71')]('i.MailAccountId\x20IN\x20?',_['map'](_0x5ed407,'id'));_0xc9d228[_0x3c3e('0x71')](_0x3c3e('0x72'),_[_0x3c3e('0x34')](_0x5ed407,'id'));}});})['then'](function(){if(_0xb845f2[_0x3c3e('0x8f')][_0x3c3e('0x90')]===_0x3c3e('0x91')&&!_0x2c61c1&&!_0xb845f2[_0x3c3e('0x35')]['MailAccountId'])return[];return db[_0x3c3e('0x94')][_0x3c3e('0x35')](_0x449ae6[_0x3c3e('0x95')](),_0x440633);})[_0x3c3e('0x1f')](function(_0x13a1dc){_0x1b7cc6['count']=_0x13a1dc[_0x3c3e('0x3b')];if(_0x1b7cc6['count']===0x0)return[];return db[_0x3c3e('0x94')]['query'](_0x111634['toString'](),_0x440633)['then'](function(_0x246713){_0x397b96=_[_0x3c3e('0x96')](_0x246713,'id');_0x440633=_['merge'](_0x440633,{'model':db[_0x3c3e('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xb845f2[_0x3c3e('0x35')][_0x3c3e('0x3a')]){_0x1c3e2[_0x3c3e('0x38')][_0x3c3e('0x28')](function(_0x21bcf0){_0xc9d228[_0x3c3e('0x3f')]('i.'+_0x21bcf0);});}else{_0xc9d228['field'](_0x3c3e('0x89'),_0x3c3e('0x5a'));_0xc9d228[_0x3c3e('0x3f')](_0x3c3e('0x97'),'Account.key');_0xc9d228[_0x3c3e('0x3f')](_0x3c3e('0x98'),_0x3c3e('0x99'));_0xc9d228['field'](_0x3c3e('0x9a'),'contactName');_0xc9d228[_0x3c3e('0x3f')](_0x3c3e('0x86'));_0xc9d228['field']('i.createdAt');_0xc9d228['field'](_0x3c3e('0x9b'));_0xc9d228[_0x3c3e('0x3f')](_0x3c3e('0x9c'));_0xc9d228['field'](_0x3c3e('0x9d'));_0xc9d228[_0x3c3e('0x3f')]('i.attach');_0xc9d228['field'](_0x3c3e('0x9e'));_0xc9d228[_0x3c3e('0x3f')](_0x3c3e('0x9f'));_0xc9d228['field'](_0x3c3e('0xa0'));_0xc9d228[_0x3c3e('0x3f')]('i.disposition');_0xc9d228[_0x3c3e('0x3f')](_0x3c3e('0xa1'));_0xc9d228[_0x3c3e('0x3f')]('i.thirdDisposition');_0xc9d228[_0x3c3e('0x3f')](_0x3c3e('0xa2'));_0xc9d228[_0x3c3e('0x3f')](_0x3c3e('0xa3'));_0xc9d228[_0x3c3e('0x3f')]('i.ContactId');_0xc9d228[_0x3c3e('0x3f')](_0x3c3e('0xa4'));_0xc9d228[_0x3c3e('0x3f')](_0x3c3e('0xa5'));_0xc9d228['field'](_0x3c3e('0xa6'),'Contact.firstName');_0xc9d228[_0x3c3e('0x3f')](_0x3c3e('0xa7'),_0x3c3e('0xa8'));_0xc9d228[_0x3c3e('0x3f')](_0x3c3e('0xa9'),'Contact.email');_0xc9d228[_0x3c3e('0x3f')](_0x3c3e('0xaa'),'Contact.phone');_0xc9d228[_0x3c3e('0x3f')](_0x3c3e('0xab'),'Contact.mobile');_0xc9d228['field']('c.fax',_0x3c3e('0xac'));_0xc9d228['field']('o.fullname',_0x3c3e('0xad'));_0xc9d228[_0x3c3e('0x3f')](_0x3c3e('0xae'),_0x3c3e('0xaf'));_0xc9d228['field'](_0x3c3e('0xb0'),'TagIds');}if(_0x1c3e2[_0x3c3e('0x1b')])_0xc9d228['limit'](_0x1c3e2[_0x3c3e('0x1b')]);if(_0x1c3e2[_0x3c3e('0x19')])_0xc9d228[_0x3c3e('0x19')](_0x1c3e2[_0x3c3e('0x19')]);return db[_0x3c3e('0x94')][_0x3c3e('0x35')](_0xc9d228['toString'](),_0x440633);})[_0x3c3e('0x1f')](function(_0x147436){if(_0x147436[_0x3c3e('0x3b')]>0x0)_0x4bdce4['where']('ui.MailInteractionId\x20IN\x20?',_['map'](_0x147436,'id'));return db[_0x3c3e('0x94')]['query'](_0x4bdce4[_0x3c3e('0x95')](),_0x440633)[_0x3c3e('0x1f')](function(_0x4ef048){var _0x199c48=_['groupBy'](_0x4ef048,_0x3c3e('0xb1'));var _0x2795ee=[];return db[_0x3c3e('0xb2')][_0x3c3e('0x2a')]({'attributes':[_0x3c3e('0xb3')],'raw':!![]})[_0x3c3e('0x1f')](function(_0x298472){var _0x63bc20=_0x298472['enableEmailPreview'];_0x147436[_0x3c3e('0x28')](function(_0x53c428){_0x2795ee[_0x3c3e('0xb4')](updateMailInteraction(_0x53c428,_0x397b96,_0x199c48,_0x63bc20));});return BPromise[_0x3c3e('0xb5')](_0x2795ee);});});});})[_0x3c3e('0x1f')](function(_0x429361){_0x1b7cc6[_0x3c3e('0xb6')]=_0x429361;return _0x1b7cc6;})[_0x3c3e('0x1f')](respondWithFilteredResult(_0x11cecd,_0x1c3e2))[_0x3c3e('0x2f')](handleError(_0x11cecd,null));};exports[_0x3c3e('0xb7')]=function(_0x2cbed,_0x3c107d){var _0x359f20={'raw':![],'where':{'id':_0x2cbed['params']['id']}},_0x508b0b={};_0x508b0b[_0x3c3e('0x33')]=_[_0x3c3e('0x36')](db[_0x3c3e('0x31')][_0x3c3e('0x32')]);_0x508b0b[_0x3c3e('0x35')]=_[_0x3c3e('0x36')](_0x2cbed[_0x3c3e('0x35')]);_0x508b0b[_0x3c3e('0x37')]=_[_0x3c3e('0x39')](_0x508b0b['model'],_0x508b0b[_0x3c3e('0x35')]);_0x359f20[_0x3c3e('0x38')]=_['intersection'](_0x508b0b[_0x3c3e('0x33')],qs[_0x3c3e('0x3a')](_0x2cbed[_0x3c3e('0x35')][_0x3c3e('0x3a')]));_0x359f20[_0x3c3e('0x38')]=_0x359f20[_0x3c3e('0x38')][_0x3c3e('0x3b')]?_0x359f20[_0x3c3e('0x38')]:_0x508b0b[_0x3c3e('0x33')];if(_0x2cbed['query'][_0x3c3e('0xb8')]){_0x359f20[_0x3c3e('0xb9')]=[{'all':!![]}];}_0x359f20=_[_0x3c3e('0xba')]({},_0x359f20,_0x2cbed['options']);return db[_0x3c3e('0x31')][_0x3c3e('0x59')](_0x359f20)[_0x3c3e('0x1f')](handleEntityNotFound(_0x3c107d,null))[_0x3c3e('0x1f')](respondWithResult(_0x3c107d,null))['catch'](handleError(_0x3c107d,null));};exports[_0x3c3e('0xbb')]=function(_0x26e803,_0x2e2793){return db[_0x3c3e('0x31')]['create'](_0x26e803[_0x3c3e('0xbc')],{})[_0x3c3e('0x1f')](respondWithResult(_0x2e2793,0xc9))[_0x3c3e('0x2f')](handleError(_0x2e2793,null));};exports[_0x3c3e('0x1e')]=function(_0x40c5fb,_0x7d7411){if(_0x40c5fb[_0x3c3e('0xbc')]['id']){delete _0x40c5fb[_0x3c3e('0xbc')]['id'];}return db[_0x3c3e('0x31')][_0x3c3e('0x59')]({'where':{'id':_0x40c5fb[_0x3c3e('0xbd')]['id']}})[_0x3c3e('0x1f')](handleEntityNotFound(_0x7d7411,null))[_0x3c3e('0x1f')](saveUpdates(_0x40c5fb[_0x3c3e('0xbc')],null))[_0x3c3e('0x1f')](respondWithResult(_0x7d7411,null))[_0x3c3e('0x2f')](handleError(_0x7d7411,null));};exports[_0x3c3e('0x20')]=function(_0x5036f9,_0x1febed){return db['MailInteraction'][_0x3c3e('0x59')]({'where':{'id':_0x5036f9['params']['id']}})[_0x3c3e('0x1f')](handleEntityNotFound(_0x1febed,null))[_0x3c3e('0x1f')](removeEntity(_0x1febed,null))['catch'](handleError(_0x1febed,null));};exports['describe']=function(_0x48e4f1,_0xb013eb){return db['MailInteraction']['describe']()[_0x3c3e('0x1f')](respondWithResult(_0xb013eb,null))[_0x3c3e('0x2f')](handleError(_0xb013eb,null));};exports['addMessage']=function(_0x1d94c4,_0x30857c){return db[_0x3c3e('0x29')][_0x3c3e('0x59')]({'where':{'id':_0x1d94c4[_0x3c3e('0xbd')]['id']}})[_0x3c3e('0x1f')](handleEntityNotFound(_0x30857c,null))[_0x3c3e('0x1f')](function(_0x5b069a){if(_0x5b069a){return _0x5b069a[_0x3c3e('0xbe')](_0x1d94c4[_0x3c3e('0xbc')][_0x3c3e('0xbf')],_['omit'](_0x1d94c4[_0x3c3e('0xbc')],[_0x3c3e('0xbf'),'id'])||{});}})[_0x3c3e('0x1f')](respondWithResult(_0x30857c,null))[_0x3c3e('0x2f')](handleError(_0x30857c,null));};exports[_0x3c3e('0xc0')]=function(_0x1bd8d3,_0x402678){var _0x49c7a8={'raw':![],'where':{}};var _0x340f13={};var _0x3902c2={'count':0x0,'rows':[]};return db[_0x3c3e('0x31')][_0x3c3e('0x2a')]({'where':{'id':_0x1bd8d3[_0x3c3e('0xbd')]['id']}})['then'](handleEntityNotFound(_0x402678,null))[_0x3c3e('0x1f')](function(_0x354f00){if(_0x354f00){_0x340f13['model']=_[_0x3c3e('0x36')](db['MailMessage']['rawAttributes']);_0x340f13['query']=_[_0x3c3e('0x36')](_0x1bd8d3[_0x3c3e('0x35')]);_0x340f13['filters']=_['intersection'](_0x340f13[_0x3c3e('0x33')],_0x340f13[_0x3c3e('0x35')]);_0x49c7a8['attributes']=_[_0x3c3e('0x39')](_0x340f13[_0x3c3e('0x33')],qs['fields'](_0x1bd8d3[_0x3c3e('0x35')][_0x3c3e('0x3a')]));_0x49c7a8[_0x3c3e('0x38')]=_0x49c7a8['attributes']['length']?_0x49c7a8['attributes']:_0x340f13['model'];if(!_0x1bd8d3[_0x3c3e('0x35')]['hasOwnProperty'](_0x3c3e('0xc1'))){_0x49c7a8[_0x3c3e('0x1b')]=qs[_0x3c3e('0x1b')](_0x1bd8d3[_0x3c3e('0x35')][_0x3c3e('0x1b')]);_0x49c7a8[_0x3c3e('0x19')]=qs[_0x3c3e('0x19')](_0x1bd8d3[_0x3c3e('0x35')][_0x3c3e('0x19')]);}_0x49c7a8[_0x3c3e('0x3d')]=qs['sort'](_0x1bd8d3[_0x3c3e('0x35')]['sort']);_0x49c7a8[_0x3c3e('0x71')]=qs[_0x3c3e('0x37')](_[_0x3c3e('0xc2')](_0x1bd8d3[_0x3c3e('0x35')],_0x340f13[_0x3c3e('0x37')]));_0x49c7a8[_0x3c3e('0x71')][_0x3c3e('0xb1')]=_0x354f00['id'];if(_0x1bd8d3[_0x3c3e('0x35')][_0x3c3e('0x7e')]){_0x49c7a8[_0x3c3e('0x71')]=_['merge'](_0x49c7a8[_0x3c3e('0x71')],{'$or':_[_0x3c3e('0x34')](_0x49c7a8['attributes'],function(_0x1e5b4d){var _0x494c50={};_0x494c50[_0x1e5b4d]={'$like':'%'+_0x1bd8d3[_0x3c3e('0x35')]['filter']+'%'};return _0x494c50;})});}if(_0x1bd8d3[_0x3c3e('0x35')][_0x3c3e('0xc3')]){var _0x5251c5=_0x1bd8d3['query'][_0x3c3e('0xc3')][_0x3c3e('0x5f')](',');var _0x14ece3={};_0x14ece3[_0x5251c5[0x0]]={'$gte':moment(_0x5251c5[0x1])[_0x3c3e('0xc4')](_0x3c3e('0xc5'))};_0x49c7a8[_0x3c3e('0x71')]=_[_0x3c3e('0xba')](_0x49c7a8[_0x3c3e('0x71')],_0x14ece3);}_0x49c7a8=_[_0x3c3e('0xba')]({},_0x49c7a8,_0x1bd8d3[_0x3c3e('0xc6')]);return db[_0x3c3e('0x29')][_0x3c3e('0x1c')]({'where':_0x49c7a8['where']})[_0x3c3e('0x1f')](function(_0x3e2d96){_0x3902c2[_0x3c3e('0x1c')]=_0x3e2d96;if(_0x1bd8d3[_0x3c3e('0x35')][_0x3c3e('0xb8')]){_0x49c7a8[_0x3c3e('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0x3c3e('0xc7')](_0x49c7a8);})['then'](function(_0x3739f2){if(_0x1bd8d3[_0x3c3e('0x35')]['inlineCss']===_0x3c3e('0xc8')){for(var _0x3bb170=0x0;_0x3bb170<_0x3739f2[_0x3c3e('0x3b')];_0x3bb170++){_0x3739f2[_0x3bb170][_0x3c3e('0xbc')]=juice(_0x3739f2[_0x3bb170][_0x3c3e('0xbc')]);}}_0x3902c2[_0x3c3e('0xb6')]=_0x3739f2;return _0x3902c2;});}})[_0x3c3e('0x1f')](respondWithFilteredResult(_0x402678,_0x49c7a8))[_0x3c3e('0x2f')](handleError(_0x402678,null));};exports[_0x3c3e('0xc9')]=function(_0x4255c5,_0xe41706){return db[_0x3c3e('0x31')][_0x3c3e('0x59')]({'where':{'id':_0x4255c5['params']['id']}})[_0x3c3e('0x1f')](handleEntityNotFound(_0xe41706,null))[_0x3c3e('0x1f')](function(_0x64f7b6){if(_0x64f7b6){return _0x64f7b6[_0x3c3e('0xca')](_0x4255c5['body'][_0x3c3e('0xbf')],_[_0x3c3e('0xcb')](_0x4255c5[_0x3c3e('0xbc')],[_0x3c3e('0xbf'),'id'])||{})['spread'](function(){return db['Tag'][_0x3c3e('0xc7')]({'attributes':['id',_0x3c3e('0x22'),_0x3c3e('0x40')],'where':{'id':_0x4255c5[_0x3c3e('0xbc')]['ids']}});})[_0x3c3e('0x1f')](function(_0x4821f1){socket[_0x3c3e('0xcc')]('mailInteractionTags:save',{'id':Number(_0x4255c5['params']['id']),'tags':_0x4821f1||[]});return{'id':Number(_0x4255c5['params']['id']),'tags':_0x4821f1||[]};});}})[_0x3c3e('0x1f')](respondWithResult(_0xe41706,null))['catch'](handleError(_0xe41706,null));};exports[_0x3c3e('0xcd')]=function(_0x9f5c92,_0x3eb494){return db[_0x3c3e('0x31')][_0x3c3e('0x59')]({'where':{'id':_0x9f5c92['params']['id']}})['then'](handleEntityNotFound(_0x3eb494,null))[_0x3c3e('0x1f')](function(_0x3b24de){if(_0x3b24de){return _0x3b24de['removeTags'](_0x9f5c92['query'][_0x3c3e('0xbf')]);}})[_0x3c3e('0x1f')](respondWithStatusCode(_0x3eb494,null))[_0x3c3e('0x2f')](handleError(_0x3eb494,null));};exports[_0x3c3e('0xce')]=function(_0x4b0afb,_0x42b0cd){var _0x3ffb41=moment()[_0x3c3e('0xcf')]()[_0x3c3e('0x95')]();var _0x36aa2a=path['join'](config[_0x3c3e('0xd0')],_0x3c3e('0xd1'),_0x3c3e('0xd2'),_0x3c3e('0xd3'));var _0x298256=path[_0x3c3e('0xd4')](config[_0x3c3e('0xd0')],_0x3c3e('0xd1'),_0x3c3e('0xd2'),_0x3c3e('0xd5'));var _0x51f325=path['join'](_0x36aa2a,_0x3ffb41);var _0x2d51a2=util[_0x3c3e('0xc4')](_0x3c3e('0xd6'),_0x4b0afb[_0x3c3e('0xbd')]['id'],_0x3ffb41);var _0x464055=path[_0x3c3e('0xd4')](_0x36aa2a,_0x2d51a2);var _0x1f36eb=[];if(_0x4b0afb[_0x3c3e('0x35')][_0x3c3e('0xd5')]){_0x1f36eb['push']({'model':db[_0x3c3e('0xd7')],'as':_0x3c3e('0xd8'),'raw':!![]});}var _0x11adf9=[{'model':db[_0x3c3e('0x29')],'as':_0x3c3e('0xd9'),'attributes':['id',_0x3c3e('0xbc'),_0x3c3e('0x41'),'to','cc',_0x3c3e('0xda'),_0x3c3e('0xdb'),_0x3c3e('0xdc')],'where':{'secret':![]},'order':qs[_0x3c3e('0x3e')]('id'),'include':_0x1f36eb}];return db['MailInteraction'][_0x3c3e('0x59')]({'where':{'id':_0x4b0afb[_0x3c3e('0xbd')]['id']},'include':_0x11adf9})['then'](handleEntityNotFound(_0x42b0cd,null))[_0x3c3e('0x1f')](function(_0x142c73){if(_0x142c73&&_0x142c73[_0x3c3e('0xd9')]){var _0x3ed6b7=_0x142c73[_0x3c3e('0xdd')]({'plain':!![]});fs[_0x3c3e('0xde')](_0x51f325);return BPromise[_0x3c3e('0xdf')](_0x3ed6b7[_0x3c3e('0xd9')],function(_0x38acfd,_0x27e8fa){var _0x312574={'from':_0x38acfd['from'],'to':_0x38acfd['to'],'subject':_0x38acfd[_0x3c3e('0xdb')],'html':htmlEntities[_0x3c3e('0xe0')](_0x38acfd[_0x3c3e('0xbc')]),'headers':{'Date':moment(_0x38acfd[_0x3c3e('0xdc')])[_0x3c3e('0xc4')](_0x3c3e('0xe1'))},'attachments':[]};if(_0x38acfd['cc']){_0x312574[_0x3c3e('0xe2')]['Cc']=_0x38acfd['cc'];}if(_0x38acfd[_0x3c3e('0xda')]){_0x312574['headers'][_0x3c3e('0xe3')]=_0x38acfd[_0x3c3e('0xda')];}return new BPromise(function(_0x199049,_0x238066){if(_0x38acfd[_0x3c3e('0xd8')]){for(var _0xe75ab0=0x0;_0xe75ab0<_0x38acfd['Attachments']['length'];_0xe75ab0++){var _0x3c04f5=_0x38acfd[_0x3c3e('0xd8')][_0xe75ab0];var _0x29bb45=path[_0x3c3e('0xd4')](_0x298256,_0x3c04f5['basename']);if(fs[_0x3c3e('0xe4')](_0x29bb45)){_0x312574[_0x3c3e('0xd5')][_0x3c3e('0xb4')]({'name':_0x3c04f5[_0x3c3e('0x22')],'contentType':_0x3c04f5[_0x3c3e('0xe5')],'data':fs[_0x3c3e('0xe6')](_0x29bb45)});}}}emlformat[_0x3c3e('0xe7')](_0x312574,function(_0x290fec,_0x265c82){if(_0x290fec)return _0x238066(_0x290fec);fs['writeFileSync'](path[_0x3c3e('0xd4')](_0x51f325,util['format'](_0x3c3e('0xe8'),_0x27e8fa)),_0x265c82);return _0x199049(_0x265c82);});});})[_0x3c3e('0x1f')](function(){return new BPromise(function(_0x2f258a,_0x37c964){zipdir(_0x51f325,{'saveTo':_0x464055},function(_0x110c81,_0x430b4a){if(_0x110c81)return _0x37c964(_0x110c81);return _0x2f258a(_0x430b4a);});})[_0x3c3e('0x1f')](function(){return new BPromise(function(_0x5e9c3c,_0x5f19fd){rimraf(_0x51f325,function(_0x65af03){if(_0x65af03)_0x5f19fd(_0x65af03);return _0x5e9c3c();});});})[_0x3c3e('0x1f')](function(){return _0x42b0cd[_0x3c3e('0xce')](_0x464055,_0x2d51a2,function(_0x110f4c){if(!_0x110f4c)fs[_0x3c3e('0xe9')](_0x464055);});});});}else{return _0x42b0cd[_0x3c3e('0x15')](0xc8);}})['catch'](handleError(_0x42b0cd,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 7e88c85..e64f548 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 _0xe9fa=['save','update','remove','getUsers','then','setDataValue','Users','map','length','emit','hasOwnProperty','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xe9fa,0xbb));var _0xae9f=function(_0x51ba8b,_0x177294){_0x51ba8b=_0x51ba8b-0x0;var _0x43ee20=_0xe9fa[_0x51ba8b];return _0x43ee20;};'use strict';var EventEmitter=require(_0xae9f('0x0'));var MailInteraction=require(_0xae9f('0x1'))['db'][_0xae9f('0x2')];var MailMessage=require(_0xae9f('0x1'))['db'][_0xae9f('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xae9f('0x4')](0x0);var events={'afterCreate':_0xae9f('0x5'),'afterUpdate':_0xae9f('0x6'),'afterDestroy':_0xae9f('0x7')};function emitEvent(_0x3970ba){return function(_0x8385a6,_0x4546db,_0x334fdc){_0x8385a6[_0xae9f('0x8')]({'attributes':['id'],'raw':!![]})[_0xae9f('0x9')](function(_0x22a297){_0x8385a6[_0xae9f('0xa')](_0xae9f('0xb'),_0x22a297[_0xae9f('0xc')](function(_0x1addd1){return{'id':_0x1addd1['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x8385a6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xae9f('0x9')](function(_0x3905c2){_0x8385a6[_0xae9f('0xa')]('unreadMessages',_0x3905c2[_0xae9f('0xd')]);MailInteractionEvents[_0xae9f('0xe')](_0x3970ba+':'+_0x8385a6['id'],_0x8385a6);MailInteractionEvents[_0xae9f('0xe')](_0x3970ba,_0x8385a6);_0x334fdc(null);})['catch'](_0x334fdc(null));};}for(var e in events){if(events[_0xae9f('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0xd0a1=['hook','exports','events','../../mysqldb','save','update','remove','setDataValue','map','findAll','then','length','emit','catch'];(function(_0x98f118,_0x1ac28b){var _0x39b182=function(_0x3bca7a){while(--_0x3bca7a){_0x98f118['push'](_0x98f118['shift']());}};_0x39b182(++_0x1ac28b);}(_0xd0a1,0x1d0));var _0x1d0a=function(_0x3cc651,_0x32f10e){_0x3cc651=_0x3cc651-0x0;var _0x372a5a=_0xd0a1[_0x3cc651];return _0x372a5a;};'use strict';var EventEmitter=require(_0x1d0a('0x0'));var MailInteraction=require(_0x1d0a('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1d0a('0x2'),'afterUpdate':_0x1d0a('0x3'),'afterDestroy':_0x1d0a('0x4')};function emitEvent(_0x41769e){return function(_0xbf0447,_0x324111,_0x58ec15){_0xbf0447['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x326884){_0xbf0447[_0x1d0a('0x5')]('Users',_0x326884[_0x1d0a('0x6')](function(_0x25eec2){return{'id':_0x25eec2['id']};}));return MailMessage[_0x1d0a('0x7')]({'where':{'MailInteractionId':_0xbf0447['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1d0a('0x8')](function(_0x11e8d1){_0xbf0447['setDataValue']('unreadMessages',_0x11e8d1[_0x1d0a('0x9')]);MailInteractionEvents['emit'](_0x41769e+':'+_0xbf0447['id'],_0xbf0447);MailInteractionEvents[_0x1d0a('0xa')](_0x41769e,_0xbf0447);_0x58ec15(null);})[_0x1d0a('0xb')](_0x58ec15(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x1d0a('0xc')](e,emitEvent(event));}}module[_0x1d0a('0xd')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index af9b78b..1ccb989 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 _0xe8d7=['request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','subject','FULLTEXT','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','models','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x416453,_0x3d555c){var _0x3942d7=function(_0x4d0209){while(--_0x4d0209){_0x416453['push'](_0x416453['shift']());}};_0x3942d7(++_0x3d555c);}(_0xe8d7,0xaf));var _0x7e8d=function(_0x30eea0,_0x63ad9b){_0x30eea0=_0x30eea0-0x0;var _0x4def89=_0xe8d7[_0x30eea0];return _0x4def89;};'use strict';var _=require(_0x7e8d('0x0'));var util=require('util');var logger=require(_0x7e8d('0x1'))(_0x7e8d('0x2'));var moment=require(_0x7e8d('0x3'));var BPromise=require(_0x7e8d('0x4'));var rp=require(_0x7e8d('0x5'));var fs=require('fs');var path=require(_0x7e8d('0x6'));var rimraf=require(_0x7e8d('0x7'));var config=require(_0x7e8d('0x8'));var attributes=require(_0x7e8d('0x9'));module[_0x7e8d('0xa')]=function(_0xd75ff2,_0x193369){return _0xd75ff2[_0x7e8d('0xb')]('MailInteraction',attributes,{'tableName':_0x7e8d('0xc'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x7e8d('0xd'),'to'],'type':_0x7e8d('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1b7f27,_0x5a494d,_0x575983){if(_0x1b7f27['substatus']){_0x1b7f27[_0x7e8d('0xf')]=moment()[_0x7e8d('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1b7f27[_0x7e8d('0x11')]){_0x1b7f27[_0x7e8d('0x12')]=moment()[_0x7e8d('0x10')](_0x7e8d('0x13'));}_0x575983(null,_0x5a494d);},'beforeUpdate':function(_0x53de8f,_0x38bb98,_0x37352a){if(_0x53de8f[_0x7e8d('0x14')](_0x7e8d('0x15'))){_0x53de8f[_0x7e8d('0xf')]=_0x53de8f[_0x7e8d('0x15')]?moment()[_0x7e8d('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x53de8f[_0x7e8d('0x14')](_0x7e8d('0x11'))){_0x53de8f[_0x7e8d('0x12')]=moment()[_0x7e8d('0x10')](_0x7e8d('0x13'));_0x53de8f[_0x7e8d('0x15')]=null;_0x53de8f['substatusAt']=null;}_0x37352a(null,_0x53de8f);},'afterUpdate':function(_0x5211ba,_0x4dc2aa,_0x23bbac){var _0x1090f8=_0xd75ff2[_0x7e8d('0x16')];var _0x5a2ace=_0x5211ba[_0x7e8d('0x17')]({'plain':!![]});if(_0x5a2ace['closed']){return _0x1090f8[_0x7e8d('0x18')][_0x7e8d('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x5a2ace['id']}})[_0x7e8d('0x1a')](function(){_0x23bbac();})[_0x7e8d('0x1b')](function(_0x445a88){_0x23bbac(_0x445a88);});}else{_0x23bbac();}}},'charset':_0x7e8d('0x1c'),'collate':_0x7e8d('0x1d')});}; \ No newline at end of file +var _0xe5f5=['utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','get','update','then'];(function(_0x2e082b,_0x5c7359){var _0x390c2c=function(_0xef5782){while(--_0xef5782){_0x2e082b['push'](_0x2e082b['shift']());}};_0x390c2c(++_0x5c7359);}(_0xe5f5,0x12a));var _0x5e5f=function(_0x4ff9ea,_0x177a29){_0x4ff9ea=_0x4ff9ea-0x0;var _0x3dddce=_0xe5f5[_0x4ff9ea];return _0x3dddce;};'use strict';var _=require(_0x5e5f('0x0'));var util=require(_0x5e5f('0x1'));var logger=require(_0x5e5f('0x2'))(_0x5e5f('0x3'));var moment=require(_0x5e5f('0x4'));var BPromise=require('bluebird');var rp=require(_0x5e5f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e5f('0x6'));var config=require(_0x5e5f('0x7'));var attributes=require(_0x5e5f('0x8'));module[_0x5e5f('0x9')]=function(_0x518c4c,_0x357834){return _0x518c4c[_0x5e5f('0xa')](_0x5e5f('0xb'),attributes,{'tableName':_0x5e5f('0xc'),'paranoid':![],'indexes':[{'name':_0x5e5f('0xd'),'fields':[_0x5e5f('0xe'),'to'],'type':_0x5e5f('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2c31cd,_0x41bd41,_0x2e8aa0){if(_0x2c31cd[_0x5e5f('0x10')]){_0x2c31cd[_0x5e5f('0x11')]=moment()[_0x5e5f('0x12')](_0x5e5f('0x13'));}if(_0x2c31cd[_0x5e5f('0x14')]){_0x2c31cd[_0x5e5f('0x15')]=moment()[_0x5e5f('0x12')](_0x5e5f('0x13'));}_0x2e8aa0(null,_0x41bd41);},'beforeUpdate':function(_0x3dfbeb,_0x5b450f,_0x1a5673){if(_0x3dfbeb[_0x5e5f('0x16')](_0x5e5f('0x10'))){_0x3dfbeb[_0x5e5f('0x11')]=_0x3dfbeb['substatus']?moment()['format'](_0x5e5f('0x13')):null;}if(_0x3dfbeb[_0x5e5f('0x16')](_0x5e5f('0x14'))){_0x3dfbeb[_0x5e5f('0x15')]=moment()['format'](_0x5e5f('0x13'));_0x3dfbeb['substatus']=null;_0x3dfbeb[_0x5e5f('0x11')]=null;}_0x1a5673(null,_0x3dfbeb);},'afterUpdate':function(_0x57dde6,_0x878334,_0x5cb893){var _0x237293=_0x518c4c['models'];var _0x108253=_0x57dde6[_0x5e5f('0x17')]({'plain':!![]});if(_0x108253['closed']){return _0x237293['MailMessage'][_0x5e5f('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x108253['id']}})[_0x5e5f('0x19')](function(){_0x5cb893();})['catch'](function(_0x166f20){_0x5cb893(_0x166f20);});}else{_0x5cb893();}}},'charset':_0x5e5f('0x1a'),'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 45fa3c2..b99ac18 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 _0x36fe=['AddTagsToMailInteraction','find','where','addTags','body','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','info','request\x20sent','debug','stringify','error','MailInteraction,\x20%s,\x20%s','message','catch','MailInteraction','update','options','raw','limit','UpdateMailInteraction'];(function(_0x26532d,_0x51c362){var _0x3acc27=function(_0x31ed2e){while(--_0x31ed2e){_0x26532d['push'](_0x26532d['shift']());}};_0x3acc27(++_0x51c362);}(_0x36fe,0x127));var _0xe36f=function(_0x1c30bf,_0x247c31){_0x1c30bf=_0x1c30bf-0x0;var _0x255b5e=_0x36fe[_0x1c30bf];return _0x255b5e;};'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});config[_0xe36f('0xc')]=_[_0xe36f('0xd')](config['redis'],{'host':_0xe36f('0xe'),'port':0x18eb});var socket=require(_0xe36f('0xf'))(new Redis(config['redis']));require(_0xe36f('0x10'))[_0xe36f('0x11')](socket);function respondWithRpcPromise(_0xa26c3d,_0x44bc2f,_0x3d036f){return new BPromise(function(_0x5b23ff,_0x212ff9){return client['request'](_0xa26c3d,_0x3d036f)[_0xe36f('0x12')](function(_0x2b1c1c){logger[_0xe36f('0x13')]('MailInteraction,\x20%s,\x20%s',_0x44bc2f,_0xe36f('0x14'));logger[_0xe36f('0x15')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x44bc2f,_0xe36f('0x14'),JSON[_0xe36f('0x16')](_0x2b1c1c));if(_0x2b1c1c[_0xe36f('0x17')]){if(_0x2b1c1c[_0xe36f('0x17')]['code']===0x1f4){logger[_0xe36f('0x17')](_0xe36f('0x18'),_0x44bc2f,_0x2b1c1c[_0xe36f('0x17')]['message']);return _0x212ff9(_0x2b1c1c[_0xe36f('0x17')][_0xe36f('0x19')]);}logger['error'](_0xe36f('0x18'),_0x44bc2f,_0x2b1c1c[_0xe36f('0x17')][_0xe36f('0x19')]);return _0x5b23ff(_0x2b1c1c[_0xe36f('0x17')][_0xe36f('0x19')]);}else{logger[_0xe36f('0x13')]('MailInteraction,\x20%s,\x20%s',_0x44bc2f,'request\x20sent');_0x5b23ff(_0x2b1c1c['result']['message']);}})[_0xe36f('0x1a')](function(_0x2d6409){logger[_0xe36f('0x17')](_0xe36f('0x18'),_0x44bc2f,_0x2d6409);_0x212ff9(_0x2d6409);});});}exports['UpdateMailInteraction']=function(_0x5995c8){var _0x1a85fe=this;return new Promise(function(_0x24c235,_0x1502bf){return db[_0xe36f('0x1b')][_0xe36f('0x1c')](_0x5995c8['body'],{'raw':_0x5995c8[_0xe36f('0x1d')]?_0x5995c8['options'][_0xe36f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5995c8[_0xe36f('0x1d')]?_0x5995c8[_0xe36f('0x1d')]['where']||null:null,'attributes':_0x5995c8[_0xe36f('0x1d')]?_0x5995c8[_0xe36f('0x1d')]['attributes']||null:null,'limit':_0x5995c8[_0xe36f('0x1d')]?_0x5995c8[_0xe36f('0x1d')][_0xe36f('0x1f')]||null:null})['then'](function(_0x5527e2){logger[_0xe36f('0x13')](_0xe36f('0x20'),_0x5995c8);logger['debug'](_0xe36f('0x20'),_0x5995c8,JSON['stringify'](_0x5527e2));_0x24c235(_0x5527e2);})[_0xe36f('0x1a')](function(_0x55f6d6){logger[_0xe36f('0x17')](_0xe36f('0x20'),_0x55f6d6[_0xe36f('0x19')],_0x5995c8);_0x1502bf(_0x1a85fe[_0xe36f('0x17')](0x1f4,_0x55f6d6[_0xe36f('0x19')]));});});};exports[_0xe36f('0x21')]=function(_0x4e4e7f){return new Promise(function(_0x3e9f39,_0x5aa516){return db[_0xe36f('0x1b')][_0xe36f('0x22')]({'where':_0x4e4e7f[_0xe36f('0x1d')]?_0x4e4e7f[_0xe36f('0x1d')][_0xe36f('0x23')]||null:null})['then'](function(_0x1249a5){if(_0x1249a5){return _0x1249a5[_0xe36f('0x24')](_0x4e4e7f[_0xe36f('0x25')][_0xe36f('0x26')],_[_0xe36f('0x27')](_0x4e4e7f[_0xe36f('0x25')],['ids','id'])||{});}})['spread'](function(_0x676a85){logger[_0xe36f('0x13')](_0xe36f('0x28'),_0x4e4e7f);logger['debug'](_0xe36f('0x28'),_0x4e4e7f,JSON['stringify'](_0x676a85));_0x3e9f39(_0x676a85);})[_0xe36f('0x1a')](function(_0x549f53){logger[_0xe36f('0x17')]('AddTags',_0x549f53[_0xe36f('0x19')],_0x4e4e7f);_0x5aa516(_this['error'](0x1f4,_0x549f53[_0xe36f('0x19')]));});});}; \ No newline at end of file +var _0xf2ee=['MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateMailInteraction','options','attributes','AddTagsToMailInteraction','MailInteraction','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info'];(function(_0x204568,_0x579c2b){var _0xc79786=function(_0x5181b9){while(--_0x5181b9){_0x204568['push'](_0x204568['shift']());}};_0xc79786(++_0x579c2b);}(_0xf2ee,0x110));var _0xef2e=function(_0x99b540,_0x237666){_0x99b540=_0x99b540-0x0;var _0x4b804e=_0xf2ee[_0x99b540];return _0x4b804e;};'use strict';var _=require(_0xef2e('0x0'));var util=require(_0xef2e('0x1'));var moment=require(_0xef2e('0x2'));var BPromise=require(_0xef2e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xef2e('0x4'));var logger=require('../../config/logger')(_0xef2e('0x5'));var config=require(_0xef2e('0x6'));var jayson=require(_0xef2e('0x7'));var client=jayson[_0xef2e('0x8')][_0xef2e('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xef2e('0xa')],{'host':_0xef2e('0xb'),'port':0x18eb});var socket=require(_0xef2e('0xc'))(new Redis(config[_0xef2e('0xa')]));require('./mailInteraction.socket')[_0xef2e('0xd')](socket);function respondWithRpcPromise(_0x167f6c,_0x56ac9a,_0x4d9266){return new BPromise(function(_0x501cc2,_0x2e8fd7){return client['request'](_0x167f6c,_0x4d9266)[_0xef2e('0xe')](function(_0x568765){logger[_0xef2e('0xf')](_0xef2e('0x10'),_0x56ac9a,_0xef2e('0x11'));logger[_0xef2e('0x12')](_0xef2e('0x13'),_0x56ac9a,_0xef2e('0x11'),JSON[_0xef2e('0x14')](_0x568765));if(_0x568765[_0xef2e('0x15')]){if(_0x568765[_0xef2e('0x15')]['code']===0x1f4){logger[_0xef2e('0x15')]('MailInteraction,\x20%s,\x20%s',_0x56ac9a,_0x568765[_0xef2e('0x15')][_0xef2e('0x16')]);return _0x2e8fd7(_0x568765[_0xef2e('0x15')][_0xef2e('0x16')]);}logger[_0xef2e('0x15')](_0xef2e('0x10'),_0x56ac9a,_0x568765['error'][_0xef2e('0x16')]);return _0x501cc2(_0x568765[_0xef2e('0x15')][_0xef2e('0x16')]);}else{logger[_0xef2e('0xf')](_0xef2e('0x10'),_0x56ac9a,'request\x20sent');_0x501cc2(_0x568765[_0xef2e('0x17')][_0xef2e('0x16')]);}})[_0xef2e('0x18')](function(_0x5e7a26){logger['error'](_0xef2e('0x10'),_0x56ac9a,_0x5e7a26);_0x2e8fd7(_0x5e7a26);});});}exports[_0xef2e('0x19')]=function(_0x2f2008){var _0x1dc996=this;return new Promise(function(_0x36283e,_0x5258ec){return db['MailInteraction']['update'](_0x2f2008['body'],{'raw':_0x2f2008['options']?_0x2f2008['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f2008[_0xef2e('0x1a')]?_0x2f2008[_0xef2e('0x1a')]['where']||null:null,'attributes':_0x2f2008[_0xef2e('0x1a')]?_0x2f2008[_0xef2e('0x1a')][_0xef2e('0x1b')]||null:null,'limit':_0x2f2008['options']?_0x2f2008[_0xef2e('0x1a')]['limit']||null:null})['then'](function(_0x2af42b){logger[_0xef2e('0xf')](_0xef2e('0x19'),_0x2f2008);logger[_0xef2e('0x12')](_0xef2e('0x19'),_0x2f2008,JSON[_0xef2e('0x14')](_0x2af42b));_0x36283e(_0x2af42b);})['catch'](function(_0x160ab5){logger[_0xef2e('0x15')](_0xef2e('0x19'),_0x160ab5[_0xef2e('0x16')],_0x2f2008);_0x5258ec(_0x1dc996[_0xef2e('0x15')](0x1f4,_0x160ab5[_0xef2e('0x16')]));});});};exports[_0xef2e('0x1c')]=function(_0x4193e7){return new Promise(function(_0x4f8418,_0x19d42a){return db[_0xef2e('0x1d')]['find']({'where':_0x4193e7['options']?_0x4193e7[_0xef2e('0x1a')]['where']||null:null})[_0xef2e('0xe')](function(_0x385211){if(_0x385211){return _0x385211[_0xef2e('0x1e')](_0x4193e7[_0xef2e('0x1f')][_0xef2e('0x20')],_[_0xef2e('0x21')](_0x4193e7[_0xef2e('0x1f')],[_0xef2e('0x20'),'id'])||{});}})[_0xef2e('0x22')](function(_0xc9a2b2){logger[_0xef2e('0xf')](_0xef2e('0x23'),_0x4193e7);logger['debug'](_0xef2e('0x23'),_0x4193e7,JSON['stringify'](_0xc9a2b2));_0x4f8418(_0xc9a2b2);})[_0xef2e('0x18')](function(_0x5c4b9e){logger[_0xef2e('0x15')](_0xef2e('0x23'),_0x5c4b9e[_0xef2e('0x16')],_0x4193e7);_0x19d42a(_this[_0xef2e('0x15')](0x1f4,_0x5c4b9e[_0xef2e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 742307b..75c2cab 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 _0xac1f=['update','emit','removeListener','length','mailInteraction:','save','remove'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xac1f,0x19b));var _0xfac1=function(_0x272b56,_0x4ea571){_0x272b56=_0x272b56-0x0;var _0x59df36=_0xac1f[_0x272b56];return _0x59df36;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xfac1('0x0'),_0xfac1('0x1'),_0xfac1('0x2')];function createListener(_0x182f0f,_0x1af141){return function(_0x1dfeda){_0x1af141[_0xfac1('0x3')](_0x182f0f,_0x1dfeda);};}function removeListener(_0x559425,_0x81d272){return function(){MailInteractionEvents[_0xfac1('0x4')](_0x559425,_0x81d272);};}exports['register']=function(_0x1634aa){for(var _0x1f65c0=0x0,_0x232dbb=events[_0xfac1('0x5')];_0x1f65c0<_0x232dbb;_0x1f65c0++){var _0x3c3949=events[_0x1f65c0];var _0x40ea99=createListener(_0xfac1('0x6')+_0x3c3949,_0x1634aa);MailInteractionEvents['on'](_0x3c3949,_0x40ea99);}}; \ No newline at end of file +var _0x23bd=['emit','removeListener','register','mailInteraction:','./mailInteraction.events','save','remove','update'];(function(_0x47623f,_0x148f3a){var _0x282ce8=function(_0x35bca1){while(--_0x35bca1){_0x47623f['push'](_0x47623f['shift']());}};_0x282ce8(++_0x148f3a);}(_0x23bd,0x1b4));var _0xd23b=function(_0x4f9c74,_0x5642b7){_0x4f9c74=_0x4f9c74-0x0;var _0xcbba69=_0x23bd[_0x4f9c74];return _0xcbba69;};'use strict';var MailInteractionEvents=require(_0xd23b('0x0'));var events=[_0xd23b('0x1'),_0xd23b('0x2'),_0xd23b('0x3')];function createListener(_0xc14aa8,_0x44570a){return function(_0x303792){_0x44570a[_0xd23b('0x4')](_0xc14aa8,_0x303792);};}function removeListener(_0x14892f,_0x436082){return function(){MailInteractionEvents[_0xd23b('0x5')](_0x14892f,_0x436082);};}exports[_0xd23b('0x6')]=function(_0x39cae9){for(var _0xed6bc6=0x0,_0x56b470=events['length'];_0xed6bc6<_0x56b470;_0xed6bc6++){var _0x4f6f56=events[_0xed6bc6];var _0x4f8aae=createListener(_0xd23b('0x7')+_0x4f6f56,_0x39cae9);MailInteractionEvents['on'](_0x4f6f56,_0x4f8aae);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index d28a1e9..19bad08 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 _0x565c=['describe','/:id','show','/:id/download','post','tracked','mail','mailmessage:create','create','put','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./mailMessage.controller','get','isAuthenticated'];(function(_0x5d3903,_0x3d6c3e){var _0x4b8bc9=function(_0x92b297){while(--_0x92b297){_0x5d3903['push'](_0x5d3903['shift']());}};_0x4b8bc9(++_0x3d6c3e);}(_0x565c,0x73));var _0xc565=function(_0x1443fc,_0x230ed9){_0x1443fc=_0x1443fc-0x0;var _0x15aee2=_0x565c[_0x1443fc];return _0x15aee2;};'use strict';var multer=require(_0xc565('0x0'));var util=require(_0xc565('0x1'));var path=require(_0xc565('0x2'));var timeout=require(_0xc565('0x3'));var express=require(_0xc565('0x4'));var router=express[_0xc565('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc565('0x6'));var controller=require(_0xc565('0x7'));router[_0xc565('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc565('0x8')]('/describe',auth[_0xc565('0x9')](),controller[_0xc565('0xa')]);router[_0xc565('0x8')](_0xc565('0xb'),auth[_0xc565('0x9')](),controller[_0xc565('0xc')]);router['get'](_0xc565('0xd'),auth[_0xc565('0x9')](),controller['download']);router[_0xc565('0xe')]('/',auth[_0xc565('0x9')](),interaction[_0xc565('0xf')](_0xc565('0x10'),_0xc565('0x11')),controller[_0xc565('0x12')]);router[_0xc565('0x13')](_0xc565('0xb'),auth[_0xc565('0x9')](),controller['update']);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0xc565('0x14')]);router[_0xc565('0x13')]('/:id/reject',auth[_0xc565('0x9')](),controller[_0xc565('0x15')]);router[_0xc565('0x16')](_0xc565('0xb'),auth[_0xc565('0x9')](),controller[_0xc565('0x17')]);module[_0xc565('0x18')]=router; \ No newline at end of file +var _0x3d0a=['mailmessage:create','create','accept','put','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','describe'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3d0a,0xa9));var _0xa3d0=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x3d0a[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require(_0xa3d0('0x0'));var util=require('util');var path=require(_0xa3d0('0x1'));var timeout=require(_0xa3d0('0x2'));var express=require(_0xa3d0('0x3'));var router=express[_0xa3d0('0x4')]();var fs_extra=require(_0xa3d0('0x5'));var auth=require(_0xa3d0('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailMessage.controller');router['get']('/',auth[_0xa3d0('0x7')](),controller[_0xa3d0('0x8')]);router[_0xa3d0('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xa3d0('0xa')]);router['get']('/:id',auth[_0xa3d0('0x7')](),controller['show']);router[_0xa3d0('0x9')]('/:id/download',auth[_0xa3d0('0x7')](),controller['download']);router['post']('/',auth['isAuthenticated'](),interaction['tracked']('mail',_0xa3d0('0xb')),controller[_0xa3d0('0xc')]);router['put']('/:id',auth[_0xa3d0('0x7')](),controller['update']);router['put']('/:id/accept',auth[_0xa3d0('0x7')](),controller[_0xa3d0('0xd')]);router[_0xa3d0('0xe')](_0xa3d0('0xf'),auth[_0xa3d0('0x7')](),controller[_0xa3d0('0x10')]);router[_0xa3d0('0x11')]('/:id',auth[_0xa3d0('0x7')](),controller[_0xa3d0('0x12')]);module[_0xa3d0('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 13bd07a..b2d0d49 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 _0xff2e=['DATE','INTEGER','Email','sequelize','lodash','TEXT','long','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x19240c,_0xe78bfa){var _0x644ac6=function(_0x3148d6){while(--_0x3148d6){_0x19240c['push'](_0x19240c['shift']());}};_0x644ac6(++_0xe78bfa);}(_0xff2e,0xff));var _0xeff2=function(_0xaa3b34,_0x1297aa){_0xaa3b34=_0xaa3b34-0x0;var _0x49955c=_0xff2e[_0xaa3b34];return _0x49955c;};'use strict';var Sequelize=require(_0xeff2('0x0'));var _=require(_0xeff2('0x1'));module['exports']={'body':{'type':Sequelize[_0xeff2('0x2')](_0xeff2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xeff2('0x2')](_0xeff2('0x4'))},'read':{'type':Sequelize[_0xeff2('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xeff2('0x6')]('in',_0xeff2('0x7')),'defaultValue':_0xeff2('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xeff2('0x8')](0x1fe)},'from':{'type':Sequelize[_0xeff2('0x8')]},'to':{'type':Sequelize[_0xeff2('0x2')]('long')},'cc':{'type':Sequelize[_0xeff2('0x2')](_0xeff2('0x3'))},'bcc':{'type':Sequelize[_0xeff2('0x2')](_0xeff2('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xeff2('0x9')]},'attach':{'type':Sequelize[_0xeff2('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xeff2('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xeff2('0x2')](_0xeff2('0x3'))},'originCc':{'type':Sequelize['TEXT'](_0xeff2('0x3'))},'originChannel':{'type':Sequelize[_0xeff2('0x6')](_0xeff2('0xb'),'Chat'),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x3535=['ENUM','Email','lodash','exports','long','TEXT','medium','out','STRING','DATE','INTEGER'];(function(_0x30d4c3,_0x35136d){var _0x7c7dad=function(_0x326fb0){while(--_0x326fb0){_0x30d4c3['push'](_0x30d4c3['shift']());}};_0x7c7dad(++_0x35136d);}(_0x3535,0xa7));var _0x5353=function(_0x1935b6,_0x26070c){_0x1935b6=_0x1935b6-0x0;var _0x5b5eac=_0x3535[_0x1935b6];return _0x5b5eac;};'use strict';var Sequelize=require('sequelize');var _=require(_0x5353('0x0'));module[_0x5353('0x1')]={'body':{'type':Sequelize['TEXT'](_0x5353('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5353('0x3')](_0x5353('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x5353('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5353('0x6')](0x1fe)},'from':{'type':Sequelize[_0x5353('0x6')]},'to':{'type':Sequelize[_0x5353('0x3')](_0x5353('0x2'))},'cc':{'type':Sequelize['TEXT'](_0x5353('0x2'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x5353('0x3')]},'sentAt':{'type':Sequelize[_0x5353('0x7')]},'attach':{'type':Sequelize[_0x5353('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x5353('0x7')]},'originTo':{'type':Sequelize[_0x5353('0x3')](_0x5353('0x2'))},'originCc':{'type':Sequelize['TEXT'](_0x5353('0x2'))},'originChannel':{'type':Sequelize[_0x5353('0x9')](_0x5353('0xa'),'Chat'),'defaultValue':_0x5353('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 8d2ceac..77e9d86 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 _0xc903=['query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','body','find','describe','create','secret','split','MailAccount','findOne','MailAccountId','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','user','pass','auth','attachments','join','server/files/attachments','basename','ListId','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','UserId','MailInteraction','MailInteractionId','[MAILMESSAGE: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','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','fromString','EventManager','reject','get','interaction','RejectMessage','contact','interface','event','unix','toString','root','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','headers','Bcc','existsSync','push','readFileSync','writeFileSync','download','unlinkSync','eml-format','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','html-entities','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','offset','undefined','limit','count','status','set','Content-Range','update','then','destroy','end','sendStatus','stack','name','map','MailMessage','rawAttributes','fieldName','type','model'];(function(_0x5cc094,_0x330c35){var _0x3435a3=function(_0x5af4ff){while(--_0x5af4ff){_0x5cc094['push'](_0x5cc094['shift']());}};_0x3435a3(++_0x330c35);}(_0xc903,0x71));var _0x3c90=function(_0x4ce028,_0x526d4b){_0x4ce028=_0x4ce028-0x0;var _0x583d0c=_0xc903[_0x4ce028];return _0x583d0c;};'use strict';var emlformat=require(_0x3c90('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x3c90('0x1'));var path=require(_0x3c90('0x2'));var fs=require('fs');var _=require(_0x3c90('0x3'));var Redis=require(_0x3c90('0x4'));var htmlToText=require(_0x3c90('0x5'));var qs=require(_0x3c90('0x6'));var logger=require(_0x3c90('0x7'))(_0x3c90('0x8'));var interaction_log=require(_0x3c90('0x7'))('mail-interactions');var config=require(_0x3c90('0x9'));var db=require('../../mysqldb')['db'];config[_0x3c90('0xa')]=_[_0x3c90('0xb')](config[_0x3c90('0xa')],{'host':_0x3c90('0xc'),'port':0x18eb});var socket=require(_0x3c90('0xd'))(new Redis(config[_0x3c90('0xa')]));var htmlEntities=require(_0x3c90('0xe'));require('./mailMessage.socket')[_0x3c90('0xf')](socket);var jayson=require(_0x3c90('0x10'));var client=jayson[_0x3c90('0x11')]['http']({'port':0x232c});var client9003=jayson[_0x3c90('0x11')][_0x3c90('0x12')]({'port':0x232b});var client9002=jayson['client'][_0x3c90('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x151acd,_0x5bc72c,_0xfb4f60,_0xd894a6){return new BPromise(function(_0x213b8e,_0x476d35){var _0x4fe3b7=_0xd894a6||client;return _0x4fe3b7[_0x3c90('0x13')](_0x151acd,_0xfb4f60)['then'](function(_0xd9dcf0){logger[_0x3c90('0x14')](_0x3c90('0x15'),_0x5bc72c,_0x3c90('0x16'));logger[_0x3c90('0x17')](_0x3c90('0x18'),_0x5bc72c,_0x3c90('0x16'),JSON[_0x3c90('0x19')](_0xd9dcf0));if(_0xd9dcf0['error']){if(_0xd9dcf0[_0x3c90('0x1a')][_0x3c90('0x1b')]===0x1f4){logger['error'](_0x3c90('0x15'),_0x5bc72c,_0xd9dcf0[_0x3c90('0x1a')]['message']);return _0x476d35(_0xd9dcf0[_0x3c90('0x1a')][_0x3c90('0x1c')]);}logger[_0x3c90('0x1a')]('MailMessage,\x20%s,\x20%s',_0x5bc72c,_0xd9dcf0['error'][_0x3c90('0x1c')]);return _0x213b8e(_0xd9dcf0[_0x3c90('0x1a')][_0x3c90('0x1c')]);}else{logger[_0x3c90('0x14')](_0x3c90('0x15'),_0x5bc72c,_0x3c90('0x16'));_0x213b8e(_0xd9dcf0[_0x3c90('0x1d')][_0x3c90('0x1c')]);}})['catch'](function(_0x40de5a){logger['error'](_0x3c90('0x15'),_0x5bc72c,_0x40de5a);_0x476d35(_0x40de5a);});});}function respondWithResult(_0x1e94a5,_0x90fb70){_0x90fb70=_0x90fb70||0xc8;return function(_0x38c349){if(_0x38c349){return _0x1e94a5['status'](_0x90fb70)['json'](_0x38c349);}};}function respondWithFilteredResult(_0x1cd8fd,_0x561d04){return function(_0x5be1b5){if(_0x5be1b5){var _0x26c74b=typeof _0x561d04[_0x3c90('0x1e')]===_0x3c90('0x1f')&&typeof _0x561d04[_0x3c90('0x20')]==='undefined';var _0x2239f9=_0x5be1b5[_0x3c90('0x21')];var _0x5212ea=_0x26c74b?0x0:_0x561d04['offset'];var _0x360ba1=_0x26c74b?_0x5be1b5['count']:_0x561d04['offset']+_0x561d04[_0x3c90('0x20')];var _0x3cc869;if(_0x360ba1>=_0x2239f9){_0x360ba1=_0x2239f9;_0x3cc869=0xc8;}else{_0x3cc869=0xce;}_0x1cd8fd[_0x3c90('0x22')](_0x3cc869);return _0x1cd8fd[_0x3c90('0x23')](_0x3c90('0x24'),_0x5212ea+'-'+_0x360ba1+'/'+_0x2239f9)['json'](_0x5be1b5);}return null;};}function saveUpdates(_0x4381ea){return function(_0x37113a){if(_0x37113a){return _0x37113a[_0x3c90('0x25')](_0x4381ea)[_0x3c90('0x26')](function(_0x47dc52){return _0x47dc52;});}return null;};}function removeEntity(_0x1a64a4){return function(_0x996248){if(_0x996248){return _0x996248[_0x3c90('0x27')]()[_0x3c90('0x26')](function(){_0x1a64a4['status'](0xcc)[_0x3c90('0x28')]();});}};}function handleEntityNotFound(_0x202bf1){return function(_0x41a9a8){if(!_0x41a9a8){_0x202bf1[_0x3c90('0x29')](0x194);}return _0x41a9a8;};}function handleError(_0xdb01f9,_0x4a0b25){_0x4a0b25=_0x4a0b25||0x1f4;return function(_0x185c5b){logger[_0x3c90('0x1a')](_0x185c5b[_0x3c90('0x2a')]);if(_0x185c5b[_0x3c90('0x2b')]){delete _0x185c5b['name'];}_0xdb01f9[_0x3c90('0x22')](_0x4a0b25)['send'](_0x185c5b);};}exports['index']=function(_0x33fe7f,_0x50ff07){var _0x3f576e={},_0x568f22={},_0x2667a6={'count':0x0,'rows':[]};var _0x32dcd8=_[_0x3c90('0x2c')](db[_0x3c90('0x2d')][_0x3c90('0x2e')],function(_0x26176c){return{'name':_0x26176c[_0x3c90('0x2f')],'type':_0x26176c[_0x3c90('0x30')]['key']};});_0x568f22[_0x3c90('0x31')]=_[_0x3c90('0x2c')](_0x32dcd8,'name');_0x568f22[_0x3c90('0x32')]=_[_0x3c90('0x33')](_0x33fe7f['query']);_0x568f22[_0x3c90('0x34')]=_[_0x3c90('0x35')](_0x568f22[_0x3c90('0x31')],_0x568f22['query']);_0x3f576e[_0x3c90('0x36')]=_[_0x3c90('0x35')](_0x568f22[_0x3c90('0x31')],qs[_0x3c90('0x37')](_0x33fe7f[_0x3c90('0x32')][_0x3c90('0x37')]));_0x3f576e[_0x3c90('0x36')]=_0x3f576e[_0x3c90('0x36')][_0x3c90('0x38')]?_0x3f576e[_0x3c90('0x36')]:_0x568f22[_0x3c90('0x31')];if(!_0x33fe7f[_0x3c90('0x32')]['hasOwnProperty']('nolimit')){_0x3f576e[_0x3c90('0x20')]=qs[_0x3c90('0x20')](_0x33fe7f[_0x3c90('0x32')]['limit']);_0x3f576e[_0x3c90('0x1e')]=qs[_0x3c90('0x1e')](_0x33fe7f[_0x3c90('0x32')][_0x3c90('0x1e')]);}_0x3f576e[_0x3c90('0x39')]=qs[_0x3c90('0x3a')](_0x33fe7f[_0x3c90('0x32')]['sort']);_0x3f576e[_0x3c90('0x3b')]=qs['filters'](_[_0x3c90('0x3c')](_0x33fe7f['query'],_0x568f22['filters']),_0x32dcd8);if(_0x33fe7f[_0x3c90('0x32')][_0x3c90('0x3d')]){_0x3f576e[_0x3c90('0x3b')]=_[_0x3c90('0x3e')](_0x3f576e[_0x3c90('0x3b')],{'$or':_[_0x3c90('0x2c')](_0x32dcd8,function(_0x224ea8){if(_0x224ea8[_0x3c90('0x30')]!==_0x3c90('0x3f')){var _0x35eeef={};_0x35eeef[_0x224ea8[_0x3c90('0x2b')]]={'$like':'%'+_0x33fe7f[_0x3c90('0x32')][_0x3c90('0x3d')]+'%'};return _0x35eeef;}})});}_0x3f576e=_['merge']({},_0x3f576e,_0x33fe7f[_0x3c90('0x40')]);var _0x20e858={'where':_0x3f576e['where']};return db['MailMessage']['count'](_0x20e858)[_0x3c90('0x26')](function(_0x276feb){_0x2667a6[_0x3c90('0x21')]=_0x276feb;if(_0x33fe7f[_0x3c90('0x32')]['includeAll']){_0x3f576e['include']=[{'all':!![]}];}return db[_0x3c90('0x2d')][_0x3c90('0x41')](_0x3f576e);})[_0x3c90('0x26')](function(_0x1a1770){_0x2667a6[_0x3c90('0x42')]=_0x1a1770;return _0x2667a6;})[_0x3c90('0x26')](respondWithFilteredResult(_0x50ff07,_0x3f576e))[_0x3c90('0x43')](handleError(_0x50ff07,null));};exports[_0x3c90('0x44')]=function(_0x57dc0a,_0x457d5d){var _0x2c15cc={'raw':!![],'where':{'id':_0x57dc0a[_0x3c90('0x45')]['id']}},_0x1971fc={};_0x1971fc[_0x3c90('0x31')]=_[_0x3c90('0x33')](db[_0x3c90('0x2d')][_0x3c90('0x2e')]);_0x1971fc['query']=_['keys'](_0x57dc0a[_0x3c90('0x32')]);_0x1971fc[_0x3c90('0x34')]=_[_0x3c90('0x35')](_0x1971fc[_0x3c90('0x31')],_0x1971fc['query']);_0x2c15cc['attributes']=_['intersection'](_0x1971fc[_0x3c90('0x31')],qs[_0x3c90('0x37')](_0x57dc0a['query']['fields']));_0x2c15cc['attributes']=_0x2c15cc['attributes']['length']?_0x2c15cc[_0x3c90('0x36')]:_0x1971fc['model'];if(_0x57dc0a[_0x3c90('0x32')][_0x3c90('0x46')]){_0x2c15cc[_0x3c90('0x47')]=[{'all':!![]}];}_0x2c15cc=_[_0x3c90('0x3e')]({},_0x2c15cc,_0x57dc0a[_0x3c90('0x40')]);return db[_0x3c90('0x2d')]['find'](_0x2c15cc)[_0x3c90('0x26')](handleEntityNotFound(_0x457d5d,null))[_0x3c90('0x26')](respondWithResult(_0x457d5d,null))[_0x3c90('0x43')](handleError(_0x457d5d,null));};exports[_0x3c90('0x25')]=function(_0x366ad1,_0x447f4a){if(_0x366ad1[_0x3c90('0x48')]['id']){delete _0x366ad1['body']['id'];}return db['MailMessage'][_0x3c90('0x49')]({'where':{'id':_0x366ad1[_0x3c90('0x45')]['id']}})[_0x3c90('0x26')](handleEntityNotFound(_0x447f4a,null))[_0x3c90('0x26')](saveUpdates(_0x366ad1[_0x3c90('0x48')],null))[_0x3c90('0x26')](respondWithResult(_0x447f4a,null))[_0x3c90('0x43')](handleError(_0x447f4a,null));};exports['destroy']=function(_0x576f0e,_0x4db9aa){return db[_0x3c90('0x2d')][_0x3c90('0x49')]({'where':{'id':_0x576f0e[_0x3c90('0x45')]['id']}})[_0x3c90('0x26')](handleEntityNotFound(_0x4db9aa,null))[_0x3c90('0x26')](removeEntity(_0x4db9aa,null))[_0x3c90('0x43')](handleError(_0x4db9aa,null));};exports['describe']=function(_0x38b469,_0x45b4d7){return db[_0x3c90('0x2d')][_0x3c90('0x4a')]()[_0x3c90('0x26')](respondWithResult(_0x45b4d7,null))[_0x3c90('0x43')](handleError(_0x45b4d7,null));};exports['create']=function(_0x554f9b,_0x4f5c61){return db['MailMessage'][_0x3c90('0x4b')](_0x554f9b[_0x3c90('0x48')])[_0x3c90('0x26')](function(_0x83dc51){if(_0x83dc51){if(_0x83dc51['direction']==='out'&&!_0x83dc51[_0x3c90('0x4c')]){var _0x5187c0,_0x380089,_0x302f40;if(_0x554f9b['body']['to']){_0x380089=_0x554f9b[_0x3c90('0x48')]['to'][_0x3c90('0x4d')](',')[0x0];}return db[_0x3c90('0x4e')][_0x3c90('0x4f')]({'where':{'id':_0x83dc51[_0x3c90('0x50')]},'include':[{'model':db['CmList'],'as':_0x3c90('0x51'),'include':[{'model':db[_0x3c90('0x52')],'as':_0x3c90('0x53'),'where':{'email':_0x380089},'limit':0x1,'order':[[_0x3c90('0x54'),_0x3c90('0x55')]]}]},{'model':db[_0x3c90('0x56')],'as':_0x3c90('0x57'),'raw':!![]}]})['then'](function(_0x565d56){_0x5187c0=_0x565d56;if(_0x5187c0&&_0x5187c0[_0x3c90('0x57')]){var _0x3e2a47={'tls':{'rejectUnauthorized':![]}};if(_[_0x3c90('0x58')](_0x5187c0[_0x3c90('0x57')][_0x3c90('0x59')])){_0x3e2a47['host']=_0x5187c0[_0x3c90('0x57')][_0x3c90('0x5a')];_0x3e2a47[_0x3c90('0x5b')]=_0x5187c0[_0x3c90('0x57')][_0x3c90('0x5b')];_0x3e2a47[_0x3c90('0x5c')]=_0x5187c0[_0x3c90('0x57')][_0x3c90('0x5c')];if(_0x5187c0['Smtp'][_0x3c90('0x5d')]){_0x3e2a47['auth']={'user':_0x5187c0[_0x3c90('0x57')][_0x3c90('0x5e')],'pass':_0x5187c0[_0x3c90('0x57')][_0x3c90('0x5f')]};}}else{_0x3e2a47[_0x3c90('0x59')]=_0x5187c0[_0x3c90('0x57')][_0x3c90('0x59')];_0x3e2a47[_0x3c90('0x60')]={'user':_0x5187c0['Smtp']['user'],'pass':_0x5187c0[_0x3c90('0x57')][_0x3c90('0x5f')]};_0x3e2a47['secure']=_0x5187c0[_0x3c90('0x57')][_0x3c90('0x5c')];}if(_0x554f9b['body'][_0x3c90('0x61')]&&_0x554f9b[_0x3c90('0x48')][_0x3c90('0x61')][_0x3c90('0x38')]){for(var _0x33d386=0x0;_0x33d386<_0x554f9b[_0x3c90('0x48')]['attachments'][_0x3c90('0x38')];_0x33d386+=0x1){_0x554f9b['body'][_0x3c90('0x61')][_0x33d386]={'filename':_0x554f9b[_0x3c90('0x48')][_0x3c90('0x61')][_0x33d386][_0x3c90('0x2b')],'path':path[_0x3c90('0x62')](config['root'],_0x3c90('0x63'),_0x554f9b[_0x3c90('0x48')][_0x3c90('0x61')][_0x33d386][_0x3c90('0x64')])};}}_0x302f40={'account':_0x3e2a47,'message':_0x554f9b[_0x3c90('0x48')]};return;}})[_0x3c90('0x26')](function(){if(_0x5187c0['List']){if(_0x5187c0[_0x3c90('0x51')][_0x3c90('0x53')][_0x3c90('0x38')]){return _0x5187c0[_0x3c90('0x51')][_0x3c90('0x53')][0x0];}else{return db[_0x3c90('0x52')][_0x3c90('0x4b')](_[_0x3c90('0xb')](_0x554f9b[_0x3c90('0x48')],{'firstName':_0x554f9b['body']['to'],'email':_0x554f9b[_0x3c90('0x48')]['to'],'phone':_0x554f9b['body']['to'],'ListId':_0x5187c0[_0x3c90('0x65')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x3c90('0x26')](function(){if(_0x302f40){return respondWithRpcPromise(_0x3c90('0x66'),_0x3c90('0x67'),_0x302f40,client9003)[_0x3c90('0x26')](function(_0x58d1ad){return _0x83dc51['update']({'read':!![],'messageId':_0x58d1ad[_0x3c90('0x68')],'sentAt':moment()[_0x3c90('0x69')](_0x3c90('0x6a'))});})['catch'](function(_0x52547e){logger[_0x3c90('0x1a')]('%s',JSON['stringify'](_0x52547e));return _0x83dc51;});}return _0x83dc51;});}return _0x83dc51;}})['then'](respondWithResult(_0x4f5c61,0xc9))[_0x3c90('0x43')](handleError(_0x4f5c61,null));};exports[_0x3c90('0x6b')]=function(_0x46cea1,_0x1dcc0a){var _0x32fd56={'agent':{},'channel':_0x3c90('0x6c')};if(_0x46cea1[_0x3c90('0x48')]['id']){delete _0x46cea1[_0x3c90('0x48')]['id'];}_0x46cea1[_0x3c90('0x48')]['read']=!![];_0x46cea1[_0x3c90('0x48')]['readAt']=moment()[_0x3c90('0x69')](_0x3c90('0x6a'));_0x46cea1[_0x3c90('0x48')][_0x3c90('0x6d')]=_0x46cea1[_0x3c90('0x48')][_0x3c90('0x6d')]||_0x46cea1[_0x3c90('0x5e')]['id'];_0x32fd56['agent']['id']=_0x46cea1[_0x3c90('0x48')][_0x3c90('0x6d')];return db[_0x3c90('0x2d')][_0x3c90('0x49')]({'where':{'id':_0x46cea1[_0x3c90('0x45')]['id'],'UserId':null}})[_0x3c90('0x26')](handleEntityNotFound(_0x1dcc0a,null))[_0x3c90('0x26')](saveUpdates(_0x46cea1['body'],null))['then'](function(_0x2b5394){if(_0x2b5394){_0x32fd56[_0x3c90('0x1c')]=_0x2b5394['get']({'plain':!![]});return db[_0x3c90('0x6e')]['find']({'where':{'id':_0x2b5394[_0x3c90('0x6f')]}});}return null;})[_0x3c90('0x26')](handleEntityNotFound(_0x1dcc0a,null))['then'](function(_0x1874ec){if(_0x1874ec){return _0x1874ec[_0x3c90('0x25')]({'UserId':_0x46cea1['body'][_0x3c90('0x6d')],'read1stAt':_[_0x3c90('0x58')](_0x1874ec['read1stAt'])?moment()[_0x3c90('0x69')](_0x3c90('0x6a')):undefined});}return null;})[_0x3c90('0x26')](function(_0x281773){if(_0x281773){_0x32fd56['interaction']=_0x281773['get']({'plain':!![]});interaction_log['info'](_0x3c90('0x70'),_0x46cea1[_0x3c90('0x5e')]['id'],_0x46cea1[_0x3c90('0x5e')][_0x3c90('0x2b')],_0x46cea1[_0x3c90('0x5e')][_0x3c90('0x71')],_0x32fd56['interaction']['id'],_0x46cea1[_0x3c90('0x48')]?JSON['stringify'](_0x46cea1[_0x3c90('0x48')]):_0x3c90('0x72'));return respondWithRpcPromise(_0x3c90('0x73'),_0x3c90('0x74'),_0x32fd56);}return null;})['then'](function(_0x5af03a){var _0x3ac2bd=_0x3c90('0x75')+_0x5af03a['message'][_0x3c90('0x76')];return db[_0x3c90('0x77')][_0x3c90('0x32')](_0x3ac2bd,{'type':db[_0x3c90('0x78')][_0x3c90('0x79')][_0x3c90('0x7a')],'raw':!![]})[_0x3c90('0x26')](function(_0x128a5a){return _0x128a5a;});})['then'](function(_0x214b05){if(_0x214b05){_0x32fd56[_0x3c90('0x1c')]['contact']=_0x214b05[0x0];if(!_0x46cea1[_0x3c90('0x48')][_0x3c90('0x6d')])return;return db[_0x3c90('0x7b')][_0x3c90('0x49')]({'where':{'id':_0x46cea1[_0x3c90('0x48')]['UserId'],'role':_0x3c90('0x7c')},'attributes':['id','name',_0x3c90('0x7d'),_0x3c90('0x7e'),_0x3c90('0x7f')],'raw':!![]});}return null;})[_0x3c90('0x26')](function(_0x4e8570){if(!_0x4e8570)return null;_0x32fd56[_0x3c90('0x1c')][_0x3c90('0x7c')]=_0x4e8570;return _0x32fd56;})[_0x3c90('0x26')](function(_0x58009f){if(_0x58009f){if(_0x46cea1['body'][_0x3c90('0x80')]){_0x32fd56['message']['interface']=util[_0x3c90('0x69')](_0x3c90('0x81'),_0x46cea1[_0x3c90('0x5e')][_0x3c90('0x2b')]);_0x32fd56[_0x3c90('0x1c')][_0x3c90('0x82')]=_0x32fd56[_0x3c90('0x82')];_0x32fd56['message'][_0x3c90('0x83')]=_0x32fd56[_0x3c90('0x82')];_0x32fd56[_0x3c90('0x1c')]['event']=_0x3c90('0x6b');_0x32fd56[_0x3c90('0x1c')][_0x3c90('0x48')]=htmlToText[_0x3c90('0x84')](_0x32fd56[_0x3c90('0x1c')][_0x3c90('0x48')]);return respondWithRpcPromise(_0x3c90('0x85'),_0x3c90('0x85'),{'event':'acceptmessage','message':_0x32fd56[_0x3c90('0x1c')]},client9002)[_0x3c90('0x26')](function(){return _0x32fd56;});}return _0x32fd56;}return null;})[_0x3c90('0x26')](respondWithResult(_0x1dcc0a,null))['catch'](handleError(_0x1dcc0a,null));};exports[_0x3c90('0x86')]=function(_0x5bd786,_0x438a46){var _0x585068={'agent':{},'channel':_0x3c90('0x6c')};if(_0x5bd786[_0x3c90('0x48')]['id']){delete _0x5bd786[_0x3c90('0x48')]['id'];}_0x5bd786[_0x3c90('0x48')][_0x3c90('0x6d')]=_0x5bd786['body'][_0x3c90('0x6d')]||_0x5bd786[_0x3c90('0x5e')]['id'];_0x585068[_0x3c90('0x7c')]['id']=_0x5bd786[_0x3c90('0x48')]['UserId'];return db[_0x3c90('0x2d')][_0x3c90('0x49')]({'where':{'id':_0x5bd786[_0x3c90('0x45')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x438a46,null))['then'](function(_0x5034ca){if(_0x5034ca){_0x585068[_0x3c90('0x1c')]=_0x5034ca[_0x3c90('0x87')]({'plain':!![]});return db[_0x3c90('0x6e')][_0x3c90('0x49')]({'where':{'id':_0x5034ca[_0x3c90('0x6f')]}});}return null;})[_0x3c90('0x26')](handleEntityNotFound(_0x438a46,null))['then'](function(_0x24b099){if(_0x24b099){_0x585068[_0x3c90('0x88')]=_0x24b099['get']({'plain':!![]});interaction_log[_0x3c90('0x14')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5bd786[_0x3c90('0x5e')]['id'],_0x5bd786[_0x3c90('0x5e')][_0x3c90('0x2b')],_0x5bd786['user'][_0x3c90('0x71')],_0x585068[_0x3c90('0x88')]['id'],_0x5bd786['body']?JSON[_0x3c90('0x19')](_0x5bd786[_0x3c90('0x48')]):'null');return respondWithRpcPromise(_0x3c90('0x89'),'rejectMessage',_0x585068);}return null;})[_0x3c90('0x26')](function(_0x53ee43){var _0x28ee39=_0x3c90('0x75')+_0x53ee43[_0x3c90('0x1c')]['ContactId'];return db[_0x3c90('0x77')][_0x3c90('0x32')](_0x28ee39,{'type':db['Sequelize'][_0x3c90('0x79')][_0x3c90('0x7a')],'raw':!![]})['then'](function(_0x3b7c15){return _0x3b7c15;});})['then'](function(_0x199d3f){if(_0x199d3f){_0x585068[_0x3c90('0x1c')][_0x3c90('0x8a')]=_0x199d3f[0x0];if(!_0x5bd786[_0x3c90('0x48')][_0x3c90('0x6d')])return;return db[_0x3c90('0x7b')][_0x3c90('0x49')]({'where':{'id':_0x5bd786[_0x3c90('0x48')][_0x3c90('0x6d')],'role':_0x3c90('0x7c')},'attributes':['id',_0x3c90('0x2b'),_0x3c90('0x7d'),'email',_0x3c90('0x7f')],'raw':!![]});}return null;})['then'](function(_0x5683d6){if(!_0x5683d6)return null;_0x585068[_0x3c90('0x1c')][_0x3c90('0x7c')]=_0x5683d6;return _0x585068;})[_0x3c90('0x26')](function(_0x1b807e){if(_0x1b807e){_0x1b807e['message'][_0x3c90('0x8b')]=util[_0x3c90('0x69')]('SIP/%s',_0x5bd786[_0x3c90('0x5e')]['name']);_0x1b807e['message'][_0x3c90('0x82')]=_0x585068['channel'];_0x1b807e[_0x3c90('0x1c')][_0x3c90('0x83')]=_0x585068[_0x3c90('0x82')];_0x1b807e[_0x3c90('0x1c')][_0x3c90('0x8c')]=_0x3c90('0x86');_0x1b807e[_0x3c90('0x1c')][_0x3c90('0x48')]=htmlToText[_0x3c90('0x84')](_0x585068['message'][_0x3c90('0x48')]);respondWithRpcPromise(_0x3c90('0x85'),_0x3c90('0x85'),{'event':'rejectmessage','message':_0x1b807e[_0x3c90('0x1c')]},client9002);return _0x585068;}return null;})[_0x3c90('0x26')](respondWithResult(_0x438a46,null))[_0x3c90('0x43')](handleError(_0x438a46,null));};exports['download']=function(_0x4b86e7,_0x5c5afb){var _0x835944=moment()[_0x3c90('0x8d')]()[_0x3c90('0x8e')]();var _0x3c1d11=path[_0x3c90('0x62')](config[_0x3c90('0x8f')],_0x3c90('0x90'),_0x3c90('0x91'),_0x3c90('0x92'));var _0x37abe0=path['join'](config[_0x3c90('0x8f')],_0x3c90('0x90'),'files','attachments');var _0x5d37b2=util[_0x3c90('0x69')](_0x3c90('0x93'),_0x835944);return db['MailMessage'][_0x3c90('0x49')]({'where':{'id':_0x4b86e7[_0x3c90('0x45')]['id']},'attributes':['id',_0x3c90('0x48'),_0x3c90('0x94'),'to','cc',_0x3c90('0x95'),_0x3c90('0x96'),_0x3c90('0x97')],'include':_0x4b86e7[_0x3c90('0x32')][_0x3c90('0x61')]?[{'model':db[_0x3c90('0x98')],'as':_0x3c90('0x99')}]:undefined})[_0x3c90('0x26')](handleEntityNotFound(_0x5c5afb,null))[_0x3c90('0x26')](function(_0x2b2d60){if(_0x2b2d60){var _0x4ffd82=_0x2b2d60;var _0x9d9cd0={'from':_0x4ffd82['from'],'to':_0x4ffd82['to'],'subject':_0x4ffd82[_0x3c90('0x96')],'html':htmlEntities[_0x3c90('0x9a')](_0x4ffd82[_0x3c90('0x48')]),'headers':{'Date':moment(_0x4ffd82['createdAt'])[_0x3c90('0x69')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2b2d60['cc']){_0x9d9cd0['headers']['Cc']=_0x2b2d60['cc'];}if(_0x2b2d60['bcc']){_0x9d9cd0[_0x3c90('0x9b')][_0x3c90('0x9c')]=_0x2b2d60[_0x3c90('0x95')];}return new BPromise(function(_0x10f9bf,_0x1613c0){if(_0x2b2d60['Attachments']){for(var _0x1ac578=0x0;_0x1ac578<_0x2b2d60[_0x3c90('0x99')]['length'];_0x1ac578++){var _0xf93bae=_0x2b2d60[_0x3c90('0x99')][_0x1ac578];var _0x174283=path['join'](_0x37abe0,_0xf93bae['basename']);if(fs[_0x3c90('0x9d')](_0x174283)){_0x9d9cd0[_0x3c90('0x61')][_0x3c90('0x9e')]({'name':_0xf93bae[_0x3c90('0x2b')],'contentType':_0xf93bae[_0x3c90('0x30')],'data':fs[_0x3c90('0x9f')](_0x174283)});}}}emlformat['build'](_0x9d9cd0,function(_0x5be2ef,_0x26e414){if(_0x5be2ef)return _0x1613c0(_0x5be2ef);fs[_0x3c90('0xa0')](path[_0x3c90('0x62')](_0x3c1d11,_0x5d37b2),_0x26e414);return _0x10f9bf(_0x26e414);});});}})[_0x3c90('0x26')](function(_0x9f3588){if(_0x9f3588){return _0x5c5afb[_0x3c90('0xa1')](path[_0x3c90('0x62')](_0x3c1d11,_0x5d37b2),_0x5d37b2,function(_0x342bd5){if(!_0x342bd5)fs[_0x3c90('0xa2')](path[_0x3c90('0x62')](_0x3c1d11,_0x5d37b2));});}})[_0x3c90('0x43')](handleError(_0x5c5afb,null));}; \ No newline at end of file +var _0x2ffb=['type','key','model','map','query','keys','intersection','fields','attributes','length','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','body','describe','create','direction','out','split','MailAccount','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','host','port','secure','authentication','user','pass','service','auth','attachments','join','root','server/files/attachments','basename','defaults','ListId','List\x20not\x20found','sendMail','messageId','format','stringify','mail','read','readAt','UserId','get','MailInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','internal','interface','channel','motionChannel','event','accept','fromString','EventManager','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','SIP/%s','download','unix','server','files','tmp','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','push','unlinkSync','moment','bluebird','util','path','lodash','html-to-text','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','json','offset','undefined','count','set','update','destroy','sendStatus','stack','name','send','index','MailMessage','rawAttributes','fieldName'];(function(_0x32b894,_0x14c458){var _0x1f4d76=function(_0x4737af){while(--_0x4737af){_0x32b894['push'](_0x32b894['shift']());}};_0x1f4d76(++_0x14c458);}(_0x2ffb,0x1b8));var _0xb2ff=function(_0x7a35b1,_0x925417){_0x7a35b1=_0x7a35b1-0x0;var _0x3c4535=_0x2ffb[_0x7a35b1];return _0x3c4535;};'use strict';var emlformat=require('eml-format');var moment=require(_0xb2ff('0x0'));var BPromise=require(_0xb2ff('0x1'));var util=require(_0xb2ff('0x2'));var path=require(_0xb2ff('0x3'));var fs=require('fs');var _=require(_0xb2ff('0x4'));var Redis=require('ioredis');var htmlToText=require(_0xb2ff('0x5'));var qs=require(_0xb2ff('0x6'));var logger=require('../../config/logger')('api');var interaction_log=require(_0xb2ff('0x7'))('mail-interactions');var config=require(_0xb2ff('0x8'));var db=require(_0xb2ff('0x9'))['db'];config['redis']=_['defaults'](config[_0xb2ff('0xa')],{'host':_0xb2ff('0xb'),'port':0x18eb});var socket=require(_0xb2ff('0xc'))(new Redis(config[_0xb2ff('0xa')]));var htmlEntities=require(_0xb2ff('0xd'));require(_0xb2ff('0xe'))[_0xb2ff('0xf')](socket);var jayson=require(_0xb2ff('0x10'));var client=jayson[_0xb2ff('0x11')]['http']({'port':0x232c});var client9003=jayson['client'][_0xb2ff('0x12')]({'port':0x232b});var client9002=jayson[_0xb2ff('0x11')]['http']({'port':0x232a});function respondWithRpcPromise(_0x523376,_0x11a842,_0x55a614,_0x40558a){return new BPromise(function(_0x5d6079,_0x5f31f0){var _0x51e65d=_0x40558a||client;return _0x51e65d[_0xb2ff('0x13')](_0x523376,_0x55a614)[_0xb2ff('0x14')](function(_0x21fca7){logger[_0xb2ff('0x15')](_0xb2ff('0x16'),_0x11a842,_0xb2ff('0x17'));logger[_0xb2ff('0x18')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x11a842,_0xb2ff('0x17'),JSON['stringify'](_0x21fca7));if(_0x21fca7[_0xb2ff('0x19')]){if(_0x21fca7[_0xb2ff('0x19')][_0xb2ff('0x1a')]===0x1f4){logger[_0xb2ff('0x19')](_0xb2ff('0x16'),_0x11a842,_0x21fca7[_0xb2ff('0x19')][_0xb2ff('0x1b')]);return _0x5f31f0(_0x21fca7[_0xb2ff('0x19')][_0xb2ff('0x1b')]);}logger[_0xb2ff('0x19')]('MailMessage,\x20%s,\x20%s',_0x11a842,_0x21fca7[_0xb2ff('0x19')][_0xb2ff('0x1b')]);return _0x5d6079(_0x21fca7[_0xb2ff('0x19')][_0xb2ff('0x1b')]);}else{logger[_0xb2ff('0x15')](_0xb2ff('0x16'),_0x11a842,_0xb2ff('0x17'));_0x5d6079(_0x21fca7[_0xb2ff('0x1c')][_0xb2ff('0x1b')]);}})[_0xb2ff('0x1d')](function(_0xbb3f7e){logger['error']('MailMessage,\x20%s,\x20%s',_0x11a842,_0xbb3f7e);_0x5f31f0(_0xbb3f7e);});});}function respondWithResult(_0x327694,_0x54c8ea){_0x54c8ea=_0x54c8ea||0xc8;return function(_0x14370f){if(_0x14370f){return _0x327694[_0xb2ff('0x1e')](_0x54c8ea)[_0xb2ff('0x1f')](_0x14370f);}};}function respondWithFilteredResult(_0x196fd0,_0xe899c7){return function(_0x39827f){if(_0x39827f){var _0x3a3701=typeof _0xe899c7[_0xb2ff('0x20')]===_0xb2ff('0x21')&&typeof _0xe899c7['limit']==='undefined';var _0x57732d=_0x39827f[_0xb2ff('0x22')];var _0x48c1c9=_0x3a3701?0x0:_0xe899c7['offset'];var _0x175a7e=_0x3a3701?_0x39827f[_0xb2ff('0x22')]:_0xe899c7['offset']+_0xe899c7['limit'];var _0x594017;if(_0x175a7e>=_0x57732d){_0x175a7e=_0x57732d;_0x594017=0xc8;}else{_0x594017=0xce;}_0x196fd0[_0xb2ff('0x1e')](_0x594017);return _0x196fd0[_0xb2ff('0x23')]('Content-Range',_0x48c1c9+'-'+_0x175a7e+'/'+_0x57732d)['json'](_0x39827f);}return null;};}function saveUpdates(_0x32f7a1){return function(_0x4616c7){if(_0x4616c7){return _0x4616c7[_0xb2ff('0x24')](_0x32f7a1)[_0xb2ff('0x14')](function(_0x4979bf){return _0x4979bf;});}return null;};}function removeEntity(_0x1611d1){return function(_0x6f21e2){if(_0x6f21e2){return _0x6f21e2[_0xb2ff('0x25')]()[_0xb2ff('0x14')](function(){_0x1611d1[_0xb2ff('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d5778){return function(_0x4aa00b){if(!_0x4aa00b){_0x2d5778[_0xb2ff('0x26')](0x194);}return _0x4aa00b;};}function handleError(_0xeace62,_0x4a6f0a){_0x4a6f0a=_0x4a6f0a||0x1f4;return function(_0x527a4d){logger[_0xb2ff('0x19')](_0x527a4d[_0xb2ff('0x27')]);if(_0x527a4d[_0xb2ff('0x28')]){delete _0x527a4d[_0xb2ff('0x28')];}_0xeace62[_0xb2ff('0x1e')](_0x4a6f0a)[_0xb2ff('0x29')](_0x527a4d);};}exports[_0xb2ff('0x2a')]=function(_0x29c440,_0x193af5){var _0x7f8f47={},_0x1c4557={},_0xca957d={'count':0x0,'rows':[]};var _0x545088=_['map'](db[_0xb2ff('0x2b')][_0xb2ff('0x2c')],function(_0x3c06bd){return{'name':_0x3c06bd[_0xb2ff('0x2d')],'type':_0x3c06bd[_0xb2ff('0x2e')][_0xb2ff('0x2f')]};});_0x1c4557[_0xb2ff('0x30')]=_[_0xb2ff('0x31')](_0x545088,_0xb2ff('0x28'));_0x1c4557[_0xb2ff('0x32')]=_[_0xb2ff('0x33')](_0x29c440[_0xb2ff('0x32')]);_0x1c4557['filters']=_[_0xb2ff('0x34')](_0x1c4557[_0xb2ff('0x30')],_0x1c4557['query']);_0x7f8f47['attributes']=_[_0xb2ff('0x34')](_0x1c4557[_0xb2ff('0x30')],qs['fields'](_0x29c440[_0xb2ff('0x32')][_0xb2ff('0x35')]));_0x7f8f47[_0xb2ff('0x36')]=_0x7f8f47[_0xb2ff('0x36')][_0xb2ff('0x37')]?_0x7f8f47['attributes']:_0x1c4557[_0xb2ff('0x30')];if(!_0x29c440[_0xb2ff('0x32')]['hasOwnProperty']('nolimit')){_0x7f8f47['limit']=qs[_0xb2ff('0x38')](_0x29c440[_0xb2ff('0x32')][_0xb2ff('0x38')]);_0x7f8f47[_0xb2ff('0x20')]=qs['offset'](_0x29c440['query'][_0xb2ff('0x20')]);}_0x7f8f47[_0xb2ff('0x39')]=qs[_0xb2ff('0x3a')](_0x29c440['query']['sort']);_0x7f8f47[_0xb2ff('0x3b')]=qs[_0xb2ff('0x3c')](_[_0xb2ff('0x3d')](_0x29c440[_0xb2ff('0x32')],_0x1c4557['filters']),_0x545088);if(_0x29c440['query'][_0xb2ff('0x3e')]){_0x7f8f47['where']=_['merge'](_0x7f8f47[_0xb2ff('0x3b')],{'$or':_['map'](_0x545088,function(_0x542388){if(_0x542388[_0xb2ff('0x2e')]!==_0xb2ff('0x3f')){var _0x1458be={};_0x1458be[_0x542388[_0xb2ff('0x28')]]={'$like':'%'+_0x29c440[_0xb2ff('0x32')][_0xb2ff('0x3e')]+'%'};return _0x1458be;}})});}_0x7f8f47=_[_0xb2ff('0x40')]({},_0x7f8f47,_0x29c440[_0xb2ff('0x41')]);var _0x4d1560={'where':_0x7f8f47[_0xb2ff('0x3b')]};return db[_0xb2ff('0x2b')][_0xb2ff('0x22')](_0x4d1560)[_0xb2ff('0x14')](function(_0x1bc280){_0xca957d[_0xb2ff('0x22')]=_0x1bc280;if(_0x29c440[_0xb2ff('0x32')][_0xb2ff('0x42')]){_0x7f8f47[_0xb2ff('0x43')]=[{'all':!![]}];}return db[_0xb2ff('0x2b')][_0xb2ff('0x44')](_0x7f8f47);})[_0xb2ff('0x14')](function(_0x5cc5d6){_0xca957d[_0xb2ff('0x45')]=_0x5cc5d6;return _0xca957d;})[_0xb2ff('0x14')](respondWithFilteredResult(_0x193af5,_0x7f8f47))[_0xb2ff('0x1d')](handleError(_0x193af5,null));};exports[_0xb2ff('0x46')]=function(_0x3225af,_0x157293){var _0x2d349a={'raw':!![],'where':{'id':_0x3225af[_0xb2ff('0x47')]['id']}},_0x46d719={};_0x46d719[_0xb2ff('0x30')]=_[_0xb2ff('0x33')](db[_0xb2ff('0x2b')]['rawAttributes']);_0x46d719[_0xb2ff('0x32')]=_[_0xb2ff('0x33')](_0x3225af['query']);_0x46d719[_0xb2ff('0x3c')]=_['intersection'](_0x46d719[_0xb2ff('0x30')],_0x46d719[_0xb2ff('0x32')]);_0x2d349a[_0xb2ff('0x36')]=_[_0xb2ff('0x34')](_0x46d719[_0xb2ff('0x30')],qs[_0xb2ff('0x35')](_0x3225af['query'][_0xb2ff('0x35')]));_0x2d349a[_0xb2ff('0x36')]=_0x2d349a['attributes'][_0xb2ff('0x37')]?_0x2d349a[_0xb2ff('0x36')]:_0x46d719[_0xb2ff('0x30')];if(_0x3225af['query']['includeAll']){_0x2d349a[_0xb2ff('0x43')]=[{'all':!![]}];}_0x2d349a=_[_0xb2ff('0x40')]({},_0x2d349a,_0x3225af['options']);return db['MailMessage'][_0xb2ff('0x48')](_0x2d349a)[_0xb2ff('0x14')](handleEntityNotFound(_0x157293,null))[_0xb2ff('0x14')](respondWithResult(_0x157293,null))[_0xb2ff('0x1d')](handleError(_0x157293,null));};exports[_0xb2ff('0x24')]=function(_0x3aff62,_0x4d6168){if(_0x3aff62[_0xb2ff('0x49')]['id']){delete _0x3aff62['body']['id'];}return db[_0xb2ff('0x2b')][_0xb2ff('0x48')]({'where':{'id':_0x3aff62[_0xb2ff('0x47')]['id']}})[_0xb2ff('0x14')](handleEntityNotFound(_0x4d6168,null))[_0xb2ff('0x14')](saveUpdates(_0x3aff62[_0xb2ff('0x49')],null))['then'](respondWithResult(_0x4d6168,null))[_0xb2ff('0x1d')](handleError(_0x4d6168,null));};exports[_0xb2ff('0x25')]=function(_0x5504db,_0x346241){return db[_0xb2ff('0x2b')][_0xb2ff('0x48')]({'where':{'id':_0x5504db[_0xb2ff('0x47')]['id']}})['then'](handleEntityNotFound(_0x346241,null))[_0xb2ff('0x14')](removeEntity(_0x346241,null))['catch'](handleError(_0x346241,null));};exports[_0xb2ff('0x4a')]=function(_0x6ae295,_0x1cbebc){return db[_0xb2ff('0x2b')][_0xb2ff('0x4a')]()[_0xb2ff('0x14')](respondWithResult(_0x1cbebc,null))[_0xb2ff('0x1d')](handleError(_0x1cbebc,null));};exports[_0xb2ff('0x4b')]=function(_0xfbce73,_0x1820ce){return db[_0xb2ff('0x2b')][_0xb2ff('0x4b')](_0xfbce73[_0xb2ff('0x49')])[_0xb2ff('0x14')](function(_0x596925){if(_0x596925){if(_0x596925[_0xb2ff('0x4c')]===_0xb2ff('0x4d')&&!_0x596925['secret']){var _0x23b88d,_0x3f59a2,_0x8cb9b6;if(_0xfbce73[_0xb2ff('0x49')]['to']){_0x3f59a2=_0xfbce73[_0xb2ff('0x49')]['to'][_0xb2ff('0x4e')](',')[0x0];}return db[_0xb2ff('0x4f')]['findOne']({'where':{'id':_0x596925[_0xb2ff('0x50')]},'include':[{'model':db[_0xb2ff('0x51')],'as':_0xb2ff('0x52'),'include':[{'model':db[_0xb2ff('0x53')],'as':_0xb2ff('0x54'),'where':{'email':_0x3f59a2},'limit':0x1,'order':[[_0xb2ff('0x55'),_0xb2ff('0x56')]]}]},{'model':db[_0xb2ff('0x57')],'as':'Smtp','raw':!![]}]})[_0xb2ff('0x14')](function(_0x38945e){_0x23b88d=_0x38945e;if(_0x23b88d&&_0x23b88d[_0xb2ff('0x58')]){var _0x342217={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x23b88d[_0xb2ff('0x58')]['service'])){_0x342217[_0xb2ff('0x59')]=_0x23b88d[_0xb2ff('0x58')][_0xb2ff('0x59')];_0x342217['port']=_0x23b88d[_0xb2ff('0x58')][_0xb2ff('0x5a')];_0x342217[_0xb2ff('0x5b')]=_0x23b88d['Smtp']['secure'];if(_0x23b88d[_0xb2ff('0x58')][_0xb2ff('0x5c')]){_0x342217['auth']={'user':_0x23b88d['Smtp'][_0xb2ff('0x5d')],'pass':_0x23b88d[_0xb2ff('0x58')][_0xb2ff('0x5e')]};}}else{_0x342217[_0xb2ff('0x5f')]=_0x23b88d['Smtp'][_0xb2ff('0x5f')];_0x342217[_0xb2ff('0x60')]={'user':_0x23b88d[_0xb2ff('0x58')][_0xb2ff('0x5d')],'pass':_0x23b88d[_0xb2ff('0x58')][_0xb2ff('0x5e')]};_0x342217[_0xb2ff('0x5b')]=_0x23b88d['Smtp'][_0xb2ff('0x5b')];}if(_0xfbce73[_0xb2ff('0x49')][_0xb2ff('0x61')]&&_0xfbce73[_0xb2ff('0x49')][_0xb2ff('0x61')][_0xb2ff('0x37')]){for(var _0x17146c=0x0;_0x17146c<_0xfbce73[_0xb2ff('0x49')][_0xb2ff('0x61')][_0xb2ff('0x37')];_0x17146c+=0x1){_0xfbce73[_0xb2ff('0x49')]['attachments'][_0x17146c]={'filename':_0xfbce73[_0xb2ff('0x49')][_0xb2ff('0x61')][_0x17146c][_0xb2ff('0x28')],'path':path[_0xb2ff('0x62')](config[_0xb2ff('0x63')],_0xb2ff('0x64'),_0xfbce73[_0xb2ff('0x49')][_0xb2ff('0x61')][_0x17146c][_0xb2ff('0x65')])};}}_0x8cb9b6={'account':_0x342217,'message':_0xfbce73[_0xb2ff('0x49')]};return;}})[_0xb2ff('0x14')](function(){if(_0x23b88d[_0xb2ff('0x52')]){if(_0x23b88d[_0xb2ff('0x52')][_0xb2ff('0x54')][_0xb2ff('0x37')]){return _0x23b88d[_0xb2ff('0x52')]['Contacts'][0x0];}else{return db[_0xb2ff('0x53')][_0xb2ff('0x4b')](_[_0xb2ff('0x66')](_0xfbce73[_0xb2ff('0x49')],{'firstName':_0xfbce73[_0xb2ff('0x49')]['to'],'email':_0xfbce73[_0xb2ff('0x49')]['to'],'phone':_0xfbce73[_0xb2ff('0x49')]['to'],'ListId':_0x23b88d[_0xb2ff('0x67')]}));}}else{throw new Error(_0xb2ff('0x68'));}})[_0xb2ff('0x14')](function(){if(_0x8cb9b6){return respondWithRpcPromise('SendMail',_0xb2ff('0x69'),_0x8cb9b6,client9003)[_0xb2ff('0x14')](function(_0x561c0f){return _0x596925[_0xb2ff('0x24')]({'read':!![],'messageId':_0x561c0f[_0xb2ff('0x6a')],'sentAt':moment()[_0xb2ff('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xb2ff('0x1d')](function(_0x3feb11){logger['error']('%s',JSON[_0xb2ff('0x6c')](_0x3feb11));return _0x596925;});}return _0x596925;});}return _0x596925;}})['then'](respondWithResult(_0x1820ce,0xc9))[_0xb2ff('0x1d')](handleError(_0x1820ce,null));};exports['accept']=function(_0x7a0e81,_0x467824){var _0xcb6a5b={'agent':{},'channel':_0xb2ff('0x6d')};if(_0x7a0e81[_0xb2ff('0x49')]['id']){delete _0x7a0e81[_0xb2ff('0x49')]['id'];}_0x7a0e81[_0xb2ff('0x49')][_0xb2ff('0x6e')]=!![];_0x7a0e81[_0xb2ff('0x49')][_0xb2ff('0x6f')]=moment()[_0xb2ff('0x6b')]('YYYY-MM-DD\x20HH:mm:ss');_0x7a0e81['body'][_0xb2ff('0x70')]=_0x7a0e81[_0xb2ff('0x49')]['UserId']||_0x7a0e81['user']['id'];_0xcb6a5b['agent']['id']=_0x7a0e81[_0xb2ff('0x49')]['UserId'];return db['MailMessage']['find']({'where':{'id':_0x7a0e81[_0xb2ff('0x47')]['id'],'UserId':null}})[_0xb2ff('0x14')](handleEntityNotFound(_0x467824,null))['then'](saveUpdates(_0x7a0e81[_0xb2ff('0x49')],null))['then'](function(_0x51aa4d){if(_0x51aa4d){_0xcb6a5b[_0xb2ff('0x1b')]=_0x51aa4d[_0xb2ff('0x71')]({'plain':!![]});return db['MailInteraction'][_0xb2ff('0x48')]({'where':{'id':_0x51aa4d[_0xb2ff('0x72')]}});}return null;})[_0xb2ff('0x14')](handleEntityNotFound(_0x467824,null))[_0xb2ff('0x14')](function(_0x4b6a5c){if(_0x4b6a5c){return _0x4b6a5c['update']({'UserId':_0x7a0e81[_0xb2ff('0x49')][_0xb2ff('0x70')],'read1stAt':_[_0xb2ff('0x73')](_0x4b6a5c[_0xb2ff('0x74')])?moment()[_0xb2ff('0x6b')](_0xb2ff('0x75')):undefined});}return null;})[_0xb2ff('0x14')](function(_0x61dde1){if(_0x61dde1){_0xcb6a5b[_0xb2ff('0x76')]=_0x61dde1[_0xb2ff('0x71')]({'plain':!![]});interaction_log['info'](_0xb2ff('0x77'),_0x7a0e81[_0xb2ff('0x5d')]['id'],_0x7a0e81['user'][_0xb2ff('0x28')],_0x7a0e81[_0xb2ff('0x5d')]['role'],_0xcb6a5b[_0xb2ff('0x76')]['id'],_0x7a0e81[_0xb2ff('0x49')]?JSON[_0xb2ff('0x6c')](_0x7a0e81[_0xb2ff('0x49')]):_0xb2ff('0x78'));return respondWithRpcPromise(_0xb2ff('0x79'),'acceptMessage',_0xcb6a5b);}return null;})[_0xb2ff('0x14')](function(_0x588b9f){var _0x5ee372='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x588b9f[_0xb2ff('0x1b')][_0xb2ff('0x7a')];return db[_0xb2ff('0x7b')][_0xb2ff('0x32')](_0x5ee372,{'type':db[_0xb2ff('0x7c')][_0xb2ff('0x7d')]['SELECT'],'raw':!![]})[_0xb2ff('0x14')](function(_0x3cd92){return _0x3cd92;});})['then'](function(_0x154cd7){if(_0x154cd7){_0xcb6a5b[_0xb2ff('0x1b')][_0xb2ff('0x7e')]=_0x154cd7[0x0];if(!_0x7a0e81['body'][_0xb2ff('0x70')])return;return db[_0xb2ff('0x7f')][_0xb2ff('0x48')]({'where':{'id':_0x7a0e81[_0xb2ff('0x49')][_0xb2ff('0x70')],'role':_0xb2ff('0x80')},'attributes':['id',_0xb2ff('0x28'),_0xb2ff('0x81'),_0xb2ff('0x82'),_0xb2ff('0x83')],'raw':!![]});}return null;})[_0xb2ff('0x14')](function(_0xba9eb){if(!_0xba9eb)return null;_0xcb6a5b['message']['agent']=_0xba9eb;return _0xcb6a5b;})['then'](function(_0x139514){if(_0x139514){if(_0x7a0e81['body']['manual']){_0xcb6a5b['message'][_0xb2ff('0x84')]=util[_0xb2ff('0x6b')]('SIP/%s',_0x7a0e81[_0xb2ff('0x5d')][_0xb2ff('0x28')]);_0xcb6a5b[_0xb2ff('0x1b')][_0xb2ff('0x85')]=_0xcb6a5b[_0xb2ff('0x85')];_0xcb6a5b[_0xb2ff('0x1b')][_0xb2ff('0x86')]=_0xcb6a5b['channel'];_0xcb6a5b[_0xb2ff('0x1b')][_0xb2ff('0x87')]=_0xb2ff('0x88');_0xcb6a5b[_0xb2ff('0x1b')]['body']=htmlToText[_0xb2ff('0x89')](_0xcb6a5b['message'][_0xb2ff('0x49')]);return respondWithRpcPromise(_0xb2ff('0x8a'),_0xb2ff('0x8a'),{'event':'acceptmessage','message':_0xcb6a5b[_0xb2ff('0x1b')]},client9002)[_0xb2ff('0x14')](function(){return _0xcb6a5b;});}return _0xcb6a5b;}return null;})[_0xb2ff('0x14')](respondWithResult(_0x467824,null))['catch'](handleError(_0x467824,null));};exports['reject']=function(_0x211f19,_0x3d828d){var _0x32f960={'agent':{},'channel':_0xb2ff('0x6d')};if(_0x211f19[_0xb2ff('0x49')]['id']){delete _0x211f19['body']['id'];}_0x211f19[_0xb2ff('0x49')][_0xb2ff('0x70')]=_0x211f19[_0xb2ff('0x49')]['UserId']||_0x211f19[_0xb2ff('0x5d')]['id'];_0x32f960[_0xb2ff('0x80')]['id']=_0x211f19[_0xb2ff('0x49')][_0xb2ff('0x70')];return db[_0xb2ff('0x2b')][_0xb2ff('0x48')]({'where':{'id':_0x211f19[_0xb2ff('0x47')]['id'],'UserId':null}})[_0xb2ff('0x14')](handleEntityNotFound(_0x3d828d,null))[_0xb2ff('0x14')](function(_0x47a8f1){if(_0x47a8f1){_0x32f960[_0xb2ff('0x1b')]=_0x47a8f1['get']({'plain':!![]});return db[_0xb2ff('0x8b')][_0xb2ff('0x48')]({'where':{'id':_0x47a8f1[_0xb2ff('0x72')]}});}return null;})[_0xb2ff('0x14')](handleEntityNotFound(_0x3d828d,null))[_0xb2ff('0x14')](function(_0xa01838){if(_0xa01838){_0x32f960[_0xb2ff('0x76')]=_0xa01838[_0xb2ff('0x71')]({'plain':!![]});interaction_log[_0xb2ff('0x15')](_0xb2ff('0x8c'),_0x211f19[_0xb2ff('0x5d')]['id'],_0x211f19['user'][_0xb2ff('0x28')],_0x211f19[_0xb2ff('0x5d')][_0xb2ff('0x8d')],_0x32f960[_0xb2ff('0x76')]['id'],_0x211f19[_0xb2ff('0x49')]?JSON[_0xb2ff('0x6c')](_0x211f19['body']):_0xb2ff('0x78'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x32f960);}return null;})[_0xb2ff('0x14')](function(_0x2ffa22){var _0x4d0025=_0xb2ff('0x8e')+_0x2ffa22[_0xb2ff('0x1b')][_0xb2ff('0x7a')];return db[_0xb2ff('0x7b')]['query'](_0x4d0025,{'type':db[_0xb2ff('0x7c')][_0xb2ff('0x7d')][_0xb2ff('0x8f')],'raw':!![]})['then'](function(_0x292794){return _0x292794;});})[_0xb2ff('0x14')](function(_0x1c7c36){if(_0x1c7c36){_0x32f960[_0xb2ff('0x1b')][_0xb2ff('0x7e')]=_0x1c7c36[0x0];if(!_0x211f19[_0xb2ff('0x49')][_0xb2ff('0x70')])return;return db[_0xb2ff('0x7f')][_0xb2ff('0x48')]({'where':{'id':_0x211f19['body'][_0xb2ff('0x70')],'role':'agent'},'attributes':['id','name',_0xb2ff('0x81'),'email',_0xb2ff('0x83')],'raw':!![]});}return null;})[_0xb2ff('0x14')](function(_0x590845){if(!_0x590845)return null;_0x32f960[_0xb2ff('0x1b')][_0xb2ff('0x80')]=_0x590845;return _0x32f960;})[_0xb2ff('0x14')](function(_0x32dfb9){if(_0x32dfb9){_0x32dfb9['message'][_0xb2ff('0x84')]=util[_0xb2ff('0x6b')](_0xb2ff('0x90'),_0x211f19['user'][_0xb2ff('0x28')]);_0x32dfb9['message'][_0xb2ff('0x85')]=_0x32f960['channel'];_0x32dfb9[_0xb2ff('0x1b')][_0xb2ff('0x86')]=_0x32f960[_0xb2ff('0x85')];_0x32dfb9['message'][_0xb2ff('0x87')]='reject';_0x32dfb9[_0xb2ff('0x1b')][_0xb2ff('0x49')]=htmlToText[_0xb2ff('0x89')](_0x32f960['message'][_0xb2ff('0x49')]);respondWithRpcPromise(_0xb2ff('0x8a'),'EventManager',{'event':'rejectmessage','message':_0x32dfb9[_0xb2ff('0x1b')]},client9002);return _0x32f960;}return null;})[_0xb2ff('0x14')](respondWithResult(_0x3d828d,null))[_0xb2ff('0x1d')](handleError(_0x3d828d,null));};exports[_0xb2ff('0x91')]=function(_0x17bd73,_0x614e62){var _0x4cd45b=moment()[_0xb2ff('0x92')]()['toString']();var _0x4cc735=path[_0xb2ff('0x62')](config[_0xb2ff('0x63')],_0xb2ff('0x93'),_0xb2ff('0x94'),_0xb2ff('0x95'));var _0x109dc8=path[_0xb2ff('0x62')](config[_0xb2ff('0x63')],_0xb2ff('0x93'),'files',_0xb2ff('0x61'));var _0x2a96a8=util['format'](_0xb2ff('0x96'),_0x4cd45b);return db[_0xb2ff('0x2b')][_0xb2ff('0x48')]({'where':{'id':_0x17bd73[_0xb2ff('0x47')]['id']},'attributes':['id',_0xb2ff('0x49'),_0xb2ff('0x97'),'to','cc',_0xb2ff('0x98'),'subject',_0xb2ff('0x99')],'include':_0x17bd73[_0xb2ff('0x32')][_0xb2ff('0x61')]?[{'model':db[_0xb2ff('0x9a')],'as':_0xb2ff('0x9b')}]:undefined})[_0xb2ff('0x14')](handleEntityNotFound(_0x614e62,null))['then'](function(_0x3b783a){if(_0x3b783a){var _0x27a0bd=_0x3b783a;var _0x166ffd={'from':_0x27a0bd[_0xb2ff('0x97')],'to':_0x27a0bd['to'],'subject':_0x27a0bd[_0xb2ff('0x9c')],'html':htmlEntities[_0xb2ff('0x9d')](_0x27a0bd['body']),'headers':{'Date':moment(_0x27a0bd['createdAt'])[_0xb2ff('0x6b')](_0xb2ff('0x9e'))},'attachments':[]};if(_0x3b783a['cc']){_0x166ffd[_0xb2ff('0x9f')]['Cc']=_0x3b783a['cc'];}if(_0x3b783a['bcc']){_0x166ffd[_0xb2ff('0x9f')]['Bcc']=_0x3b783a[_0xb2ff('0x98')];}return new BPromise(function(_0x13d692,_0x2bb82b){if(_0x3b783a[_0xb2ff('0x9b')]){for(var _0x591ef4=0x0;_0x591ef4<_0x3b783a[_0xb2ff('0x9b')][_0xb2ff('0x37')];_0x591ef4++){var _0x399f8c=_0x3b783a[_0xb2ff('0x9b')][_0x591ef4];var _0x4c0925=path['join'](_0x109dc8,_0x399f8c[_0xb2ff('0x65')]);if(fs['existsSync'](_0x4c0925)){_0x166ffd['attachments'][_0xb2ff('0xa0')]({'name':_0x399f8c[_0xb2ff('0x28')],'contentType':_0x399f8c[_0xb2ff('0x2e')],'data':fs['readFileSync'](_0x4c0925)});}}}emlformat['build'](_0x166ffd,function(_0x19691d,_0x33db9e){if(_0x19691d)return _0x2bb82b(_0x19691d);fs['writeFileSync'](path[_0xb2ff('0x62')](_0x4cc735,_0x2a96a8),_0x33db9e);return _0x13d692(_0x33db9e);});});}})[_0xb2ff('0x14')](function(_0x4770f1){if(_0x4770f1){return _0x614e62['download'](path['join'](_0x4cc735,_0x2a96a8),_0x2a96a8,function(_0x13d4fc){if(!_0x13d4fc)fs[_0xb2ff('0xa1')](path[_0xb2ff('0x62')](_0x4cc735,_0x2a96a8));});}})['catch'](handleError(_0x614e62,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index c3438e0..29a336e 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 _0xa1d5=['../../mysqldb','setMaxListeners','save','emit','hook','exports','events'];(function(_0x5dff05,_0x5be205){var _0x47b1f6=function(_0x115cd2){while(--_0x115cd2){_0x5dff05['push'](_0x5dff05['shift']());}};_0x47b1f6(++_0x5be205);}(_0xa1d5,0x109));var _0x5a1d=function(_0x3b7af4,_0x489cf6){_0x3b7af4=_0x3b7af4-0x0;var _0x137c34=_0xa1d5[_0x3b7af4];return _0x137c34;};'use strict';var EventEmitter=require(_0x5a1d('0x0'));var MailMessage=require(_0x5a1d('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x5a1d('0x2')](0x0);var events={'afterCreate':_0x5a1d('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x126aa3){return function(_0x5ec79b,_0x9dd17c,_0x29f391){MailMessageEvents[_0x5a1d('0x4')](_0x126aa3+':'+_0x5ec79b['id'],_0x5ec79b);MailMessageEvents[_0x5a1d('0x4')](_0x126aa3,_0x5ec79b);_0x29f391(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x5a1d('0x5')](e,emitEvent(event));}}module[_0x5a1d('0x6')]=MailMessageEvents; \ No newline at end of file +var _0x2d05=['save','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x54427d,_0x30ff8c){var _0xa6a845=function(_0x52498a){while(--_0x52498a){_0x54427d['push'](_0x54427d['shift']());}};_0xa6a845(++_0x30ff8c);}(_0x2d05,0xbc));var _0x52d0=function(_0x552d54,_0x308ca1){_0x552d54=_0x552d54-0x0;var _0x1d8f3a=_0x2d05[_0x552d54];return _0x1d8f3a;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x52d0('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x52d0('0x1'),'afterUpdate':_0x52d0('0x2'),'afterDestroy':_0x52d0('0x3')};function emitEvent(_0x4f7ac3){return function(_0x5e384b,_0x56f803,_0x37edc6){MailMessageEvents[_0x52d0('0x4')](_0x4f7ac3+':'+_0x5e384b['id'],_0x5e384b);MailMessageEvents[_0x52d0('0x4')](_0x4f7ac3,_0x5e384b);_0x37edc6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x52d0('0x5')](e,emitEvent(event));}}module[_0x52d0('0x6')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 75c6a54..dee72fb 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 _0xf02b=['path','../../config/environment','./mailMessage.attributes','exports','MailMessage','messageId','fti_mail_messages','subject','FULLTEXT','plainBody','fromString','models','get','direction','toLowerCase','out','secret','UserId','findOne','MailInteractionId','then','update','createdAt','utf8mb4','../../config/logger','api','bluebird','request-promise'];(function(_0x3510e6,_0x26dd3f){var _0x55090a=function(_0x2a75b8){while(--_0x2a75b8){_0x3510e6['push'](_0x3510e6['shift']());}};_0x55090a(++_0x26dd3f);}(_0xf02b,0xa4));var _0xbf02=function(_0x11447e,_0x33dab2){_0x11447e=_0x11447e-0x0;var _0x45a214=_0xf02b[_0x11447e];return _0x45a214;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf02('0x0'))(_0xbf02('0x1'));var moment=require('moment');var BPromise=require(_0xbf02('0x2'));var rp=require(_0xbf02('0x3'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xbf02('0x4'));var rimraf=require('rimraf');var config=require(_0xbf02('0x5'));var attributes=require(_0xbf02('0x6'));module[_0xbf02('0x7')]=function(_0x27cab8,_0x25eb74){return _0x27cab8['define'](_0xbf02('0x8'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xbf02('0x9'),'fields':['messageId']},{'name':_0xbf02('0xa'),'fields':['plainBody',_0xbf02('0xb')],'type':_0xbf02('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4681f4,_0x484449,_0x4978d1){if(_0x4681f4['body']){_0x4681f4[_0xbf02('0xd')]=htmlToText[_0xbf02('0xe')](_0x4681f4['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4978d1(null,_0x484449);},'afterCreate':function(_0x294e1e,_0x2f17b2,_0x3108ec){var _0x5849a1=_0x27cab8[_0xbf02('0xf')];var _0x377206=_0x294e1e[_0xbf02('0x10')]({'plain':!![]});if(_0x377206[_0xbf02('0x11')][_0xbf02('0x12')]()==='in'||_0x377206['direction'][_0xbf02('0x12')]()===_0xbf02('0x13')&&!_0x377206[_0xbf02('0x14')]&&!_['isNil'](_0x377206[_0xbf02('0x15')])){_0x5849a1['MailInteraction'][_0xbf02('0x16')]({'where':{'id':_0x377206[_0xbf02('0x17')]}})[_0xbf02('0x18')](function(_0x37ab36){if(_0x37ab36){_0x37ab36[_0xbf02('0x19')]({'lastMsgAt':_0x377206[_0xbf02('0x1a')],'lastMsgDirection':_0x377206[_0xbf02('0x11')][_0xbf02('0x12')]()});}})['catch'](function(_0x15c1d2){console['error'](_0x15c1d2);});}_0x3108ec();}},'charset':_0xbf02('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x076a=['../../config/environment','exports','mail_messages','messageId','fti_mail_messages','subject','body','plainBody','fromString','direction','toLowerCase','out','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','lodash','../../config/logger','moment','bluebird','request-promise','html-to-text','path','rimraf'];(function(_0x4e7c1c,_0x56eafd){var _0x47adb2=function(_0x346135){while(--_0x346135){_0x4e7c1c['push'](_0x4e7c1c['shift']());}};_0x47adb2(++_0x56eafd);}(_0x076a,0x8e));var _0xa076=function(_0x616fb8,_0x177e11){_0x616fb8=_0x616fb8-0x0;var _0x739e20=_0x076a[_0x616fb8];return _0x739e20;};'use strict';var _=require(_0xa076('0x0'));var util=require('util');var logger=require(_0xa076('0x1'))('api');var moment=require(_0xa076('0x2'));var BPromise=require(_0xa076('0x3'));var rp=require(_0xa076('0x4'));var htmlToText=require(_0xa076('0x5'));var fs=require('fs');var path=require(_0xa076('0x6'));var rimraf=require(_0xa076('0x7'));var config=require(_0xa076('0x8'));var attributes=require('./mailMessage.attributes');module[_0xa076('0x9')]=function(_0x188ec8,_0x477432){return _0x188ec8['define']('MailMessage',attributes,{'tableName':_0xa076('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xa076('0xb')]},{'name':_0xa076('0xc'),'fields':['plainBody',_0xa076('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2765fa,_0x28d3ad,_0x246ba5){if(_0x2765fa[_0xa076('0xe')]){_0x2765fa[_0xa076('0xf')]=htmlToText[_0xa076('0x10')](_0x2765fa[_0xa076('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x246ba5(null,_0x28d3ad);},'afterCreate':function(_0x2a6785,_0x574d69,_0x211f80){var _0x49215d=_0x188ec8['models'];var _0x37050c=_0x2a6785['get']({'plain':!![]});if(_0x37050c[_0xa076('0x11')][_0xa076('0x12')]()==='in'||_0x37050c[_0xa076('0x11')][_0xa076('0x12')]()===_0xa076('0x13')&&!_0x37050c['secret']&&!_[_0xa076('0x14')](_0x37050c[_0xa076('0x15')])){_0x49215d[_0xa076('0x16')][_0xa076('0x17')]({'where':{'id':_0x37050c[_0xa076('0x18')]}})[_0xa076('0x19')](function(_0x3df250){if(_0x3df250){_0x3df250[_0xa076('0x1a')]({'lastMsgAt':_0x37050c[_0xa076('0x1b')],'lastMsgDirection':_0x37050c[_0xa076('0x11')][_0xa076('0x12')]()});}})[_0xa076('0x1c')](function(_0x5248d3){console[_0xa076('0x1d')](_0x5248d3);});}_0x211f80();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 937bab3..d1d7f71 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 _0x63a5=['error','message','result','catch','body','options','raw','CreateMailMessage','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1e6fd8,_0x287312){var _0x4b79d7=function(_0x1ccace){while(--_0x1ccace){_0x1e6fd8['push'](_0x1e6fd8['shift']());}};_0x4b79d7(++_0x287312);}(_0x63a5,0x18e));var _0x563a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x63a5[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var moment=require(_0x563a('0x2'));var BPromise=require('bluebird');var rs=require(_0x563a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x563a('0x4'))['db'];var utils=require(_0x563a('0x5'));var logger=require(_0x563a('0x6'))(_0x563a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x563a('0x8')]['http']({'port':0x232a});config[_0x563a('0x9')]=_[_0x563a('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x563a('0xb'))(new Redis(config[_0x563a('0x9')]));require(_0x563a('0xc'))[_0x563a('0xd')](socket);function respondWithRpcPromise(_0x255922,_0xa61ffa,_0xd1b480){return new BPromise(function(_0x381fab,_0x3e97a8){return client[_0x563a('0xe')](_0x255922,_0xd1b480)[_0x563a('0xf')](function(_0x2361dd){logger[_0x563a('0x10')](_0x563a('0x11'),_0xa61ffa,'request\x20sent');logger[_0x563a('0x12')](_0x563a('0x13'),_0xa61ffa,_0x563a('0x14'),JSON[_0x563a('0x15')](_0x2361dd));if(_0x2361dd[_0x563a('0x16')]){if(_0x2361dd[_0x563a('0x16')]['code']===0x1f4){logger[_0x563a('0x16')](_0x563a('0x11'),_0xa61ffa,_0x2361dd[_0x563a('0x16')][_0x563a('0x17')]);return _0x3e97a8(_0x2361dd['error']['message']);}logger[_0x563a('0x16')](_0x563a('0x11'),_0xa61ffa,_0x2361dd['error'][_0x563a('0x17')]);return _0x381fab(_0x2361dd[_0x563a('0x16')][_0x563a('0x17')]);}else{logger[_0x563a('0x10')]('MailMessage,\x20%s,\x20%s',_0xa61ffa,'request\x20sent');_0x381fab(_0x2361dd[_0x563a('0x18')][_0x563a('0x17')]);}})[_0x563a('0x19')](function(_0x526a51){logger['error']('MailMessage,\x20%s,\x20%s',_0xa61ffa,_0x526a51);_0x3e97a8(_0x526a51);});});}exports['CreateMailMessage']=function(_0x40916a){var _0x300956=this;return new Promise(function(_0x26061f,_0x43b7a8){return db['MailMessage']['create'](_0x40916a[_0x563a('0x1a')],{'raw':_0x40916a[_0x563a('0x1b')]?_0x40916a[_0x563a('0x1b')][_0x563a('0x1c')]===undefined?!![]:![]:!![]})[_0x563a('0xf')](function(_0x2dc7e2){logger[_0x563a('0x10')](_0x563a('0x1d'),_0x40916a);logger['debug'](_0x563a('0x1d'),_0x40916a,JSON['stringify'](_0x2dc7e2));_0x26061f(_0x2dc7e2);})[_0x563a('0x19')](function(_0xd3e0ae){logger[_0x563a('0x16')](_0x563a('0x1d'),_0xd3e0ae[_0x563a('0x17')],_0x40916a);_0x43b7a8(_0x300956[_0x563a('0x16')](0x1f4,_0xd3e0ae[_0x563a('0x17')]));});});}; \ No newline at end of file +var _0xf7b4=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','MailMessage','create','body','options','raw','CreateMailMessage','lodash','bluebird'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xf7b4,0x152));var _0x4f7b=function(_0x14e551,_0x28d6bd){_0x14e551=_0x14e551-0x0;var _0x3a19f3=_0xf7b4[_0x14e551];return _0x3a19f3;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});config[_0x4f7b('0xa')]=_[_0x4f7b('0xb')](config[_0x4f7b('0xa')],{'host':_0x4f7b('0xc'),'port':0x18eb});var socket=require(_0x4f7b('0xd'))(new Redis(config[_0x4f7b('0xa')]));require('./mailMessage.socket')[_0x4f7b('0xe')](socket);function respondWithRpcPromise(_0x1016e0,_0x479208,_0xdd1aab){return new BPromise(function(_0x3a3d6c,_0x408e01){return client[_0x4f7b('0xf')](_0x1016e0,_0xdd1aab)[_0x4f7b('0x10')](function(_0x55d69f){logger[_0x4f7b('0x11')]('MailMessage,\x20%s,\x20%s',_0x479208,'request\x20sent');logger[_0x4f7b('0x12')](_0x4f7b('0x13'),_0x479208,_0x4f7b('0x14'),JSON[_0x4f7b('0x15')](_0x55d69f));if(_0x55d69f['error']){if(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x17')]===0x1f4){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x408e01(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);}logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x3a3d6c(_0x55d69f['error'][_0x4f7b('0x19')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x479208,_0x4f7b('0x14'));_0x3a3d6c(_0x55d69f[_0x4f7b('0x1a')]['message']);}})[_0x4f7b('0x1b')](function(_0x24c460){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x24c460);_0x408e01(_0x24c460);});});}exports['CreateMailMessage']=function(_0x1daa79){var _0x5adacb=this;return new Promise(function(_0x41cf36,_0x12374b){return db[_0x4f7b('0x1c')][_0x4f7b('0x1d')](_0x1daa79[_0x4f7b('0x1e')],{'raw':_0x1daa79[_0x4f7b('0x1f')]?_0x1daa79[_0x4f7b('0x1f')][_0x4f7b('0x20')]===undefined?!![]:![]:!![]})[_0x4f7b('0x10')](function(_0x5508bd){logger[_0x4f7b('0x11')](_0x4f7b('0x21'),_0x1daa79);logger[_0x4f7b('0x12')]('CreateMailMessage',_0x1daa79,JSON[_0x4f7b('0x15')](_0x5508bd));_0x41cf36(_0x5508bd);})[_0x4f7b('0x1b')](function(_0x5d22f4){logger[_0x4f7b('0x16')]('CreateMailMessage',_0x5d22f4[_0x4f7b('0x19')],_0x1daa79);_0x12374b(_0x5adacb[_0x4f7b('0x16')](0x1f4,_0x5d22f4[_0x4f7b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 462ca22..24479bc 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 _0x92df=['emit','register','length','./mailMessage.events','save','remove','update'];(function(_0x4cd846,_0x4a0f50){var _0x2f2a7d=function(_0x106507){while(--_0x106507){_0x4cd846['push'](_0x4cd846['shift']());}};_0x2f2a7d(++_0x4a0f50);}(_0x92df,0x106));var _0xf92d=function(_0xfb8cfc,_0x5550b7){_0xfb8cfc=_0xfb8cfc-0x0;var _0x35ad9b=_0x92df[_0xfb8cfc];return _0x35ad9b;};'use strict';var MailMessageEvents=require(_0xf92d('0x0'));var events=[_0xf92d('0x1'),_0xf92d('0x2'),_0xf92d('0x3')];function createListener(_0x1ad968,_0x799bdd){return function(_0x3ea3a7){_0x799bdd[_0xf92d('0x4')](_0x1ad968,_0x3ea3a7);};}function removeListener(_0x37e6b1,_0x1106a4){return function(){MailMessageEvents['removeListener'](_0x37e6b1,_0x1106a4);};}exports[_0xf92d('0x5')]=function(_0x32bda1){for(var _0x2fcee1=0x0,_0x140c97=events[_0xf92d('0x6')];_0x2fcee1<_0x140c97;_0x2fcee1++){var _0x2c9c3b=events[_0x2fcee1];var _0x367d95=createListener('mailMessage:'+_0x2c9c3b,_0x32bda1);MailMessageEvents['on'](_0x2c9c3b,_0x367d95);}}; \ No newline at end of file +var _0xcf83=['mailMessage:','./mailMessage.events','save','remove','update','removeListener','register','length'];(function(_0x2533fc,_0x1cb120){var _0x1f665b=function(_0x139cd8){while(--_0x139cd8){_0x2533fc['push'](_0x2533fc['shift']());}};_0x1f665b(++_0x1cb120);}(_0xcf83,0x101));var _0x3cf8=function(_0x4236f1,_0x67852f){_0x4236f1=_0x4236f1-0x0;var _0x1495bb=_0xcf83[_0x4236f1];return _0x1495bb;};'use strict';var MailMessageEvents=require(_0x3cf8('0x0'));var events=[_0x3cf8('0x1'),_0x3cf8('0x2'),_0x3cf8('0x3')];function createListener(_0x2ba790,_0x562799){return function(_0x3ec0d4){_0x562799['emit'](_0x2ba790,_0x3ec0d4);};}function removeListener(_0xcd28c6,_0x2372c4){return function(){MailMessageEvents[_0x3cf8('0x4')](_0xcd28c6,_0x2372c4);};}exports[_0x3cf8('0x5')]=function(_0x5aa93a){for(var _0x3f89f2=0x0,_0xafa630=events[_0x3cf8('0x6')];_0x3f89f2<_0xafa630;_0x3f89f2++){var _0xd962a1=events[_0x3f89f2];var _0x2af0f7=createListener(_0x3cf8('0x7')+_0xd962a1,_0x5aa93a);MailMessageEvents['on'](_0xd962a1,_0x2af0f7);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 81a804c..adedb51 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 _0x4aeb=['../../config/environment','index','get','isAuthenticated','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','update','delete','removeTeams','removeAgents','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4aeb,0xcb));var _0xb4ae=function(_0x1cb35f,_0x3b9b71){_0x1cb35f=_0x1cb35f-0x0;var _0x2a26ce=_0x4aeb[_0x1cb35f];return _0x2a26ce;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb4ae('0x0'));var express=require(_0xb4ae('0x1'));var router=express[_0xb4ae('0x2')]();var fs_extra=require(_0xb4ae('0x3'));var auth=require(_0xb4ae('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb4ae('0x5'));var controller=require('./mailQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb4ae('0x6')]);router[_0xb4ae('0x7')]('/describe',auth[_0xb4ae('0x8')](),controller['describe']);router[_0xb4ae('0x7')]('/:id',auth[_0xb4ae('0x8')](),controller[_0xb4ae('0x9')]);router[_0xb4ae('0x7')](_0xb4ae('0xa'),auth[_0xb4ae('0x8')](),controller['getMembers']);router[_0xb4ae('0x7')](_0xb4ae('0xb'),auth[_0xb4ae('0x8')](),controller[_0xb4ae('0xc')]);router['get'](_0xb4ae('0xd'),auth['isAuthenticated'](),controller[_0xb4ae('0xe')]);router[_0xb4ae('0xf')]('/',auth[_0xb4ae('0x8')](),controller[_0xb4ae('0x10')]);router['post'](_0xb4ae('0xb'),auth[_0xb4ae('0x8')](),controller[_0xb4ae('0x11')]);router[_0xb4ae('0xf')](_0xb4ae('0xd'),auth['isAuthenticated'](),controller[_0xb4ae('0x12')]);router[_0xb4ae('0x13')](_0xb4ae('0x14'),auth[_0xb4ae('0x8')](),controller[_0xb4ae('0x15')]);router[_0xb4ae('0x16')](_0xb4ae('0x14'),auth[_0xb4ae('0x8')](),controller['destroy']);router[_0xb4ae('0x16')]('/:id/teams',auth[_0xb4ae('0x8')](),controller[_0xb4ae('0x17')]);router[_0xb4ae('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0xb4ae('0x18')]);module[_0xb4ae('0x19')]=router; \ No newline at end of file +var _0x55a5=['get','isAuthenticated','index','/describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x55a5,0xae));var _0x555a=function(_0x3dd92b,_0x4d1139){_0x3dd92b=_0x3dd92b-0x0;var _0x5e1d23=_0x55a5[_0x3dd92b];return _0x5e1d23;};'use strict';var multer=require(_0x555a('0x0'));var util=require(_0x555a('0x1'));var path=require(_0x555a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x555a('0x3')]();var fs_extra=require(_0x555a('0x4'));var auth=require(_0x555a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x555a('0x6'));var controller=require(_0x555a('0x7'));router[_0x555a('0x8')]('/',auth[_0x555a('0x9')](),controller[_0x555a('0xa')]);router[_0x555a('0x8')](_0x555a('0xb'),auth[_0x555a('0x9')](),controller['describe']);router[_0x555a('0x8')](_0x555a('0xc'),auth[_0x555a('0x9')](),controller['show']);router[_0x555a('0x8')](_0x555a('0xd'),auth[_0x555a('0x9')](),controller['getMembers']);router[_0x555a('0x8')](_0x555a('0xe'),auth[_0x555a('0x9')](),controller[_0x555a('0xf')]);router[_0x555a('0x8')](_0x555a('0x10'),auth[_0x555a('0x9')](),controller[_0x555a('0x11')]);router[_0x555a('0x12')]('/',auth['isAuthenticated'](),controller[_0x555a('0x13')]);router[_0x555a('0x12')](_0x555a('0xe'),auth[_0x555a('0x9')](),controller[_0x555a('0x14')]);router['post'](_0x555a('0x10'),auth[_0x555a('0x9')](),controller[_0x555a('0x15')]);router[_0x555a('0x16')](_0x555a('0xc'),auth[_0x555a('0x9')](),controller['update']);router[_0x555a('0x17')](_0x555a('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x555a('0x17')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0x555a('0x17')](_0x555a('0x10'),auth[_0x555a('0x9')](),controller[_0x555a('0x18')]);module[_0x555a('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 6824618..a97b1ba 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 _0x8624=['STRING','name','ENUM','beepall','sequelize'];(function(_0x31564d,_0x310192){var _0xee2afe=function(_0x58f894){while(--_0x58f894){_0x31564d['push'](_0x31564d['shift']());}};_0xee2afe(++_0x310192);}(_0x8624,0x72));var _0x4862=function(_0x4d73b1,_0x91ab71){_0x4d73b1=_0x4d73b1-0x0;var _0xe394f9=_0x8624[_0x4d73b1];return _0xe394f9;};'use strict';var Sequelize=require(_0x4862('0x0'));module['exports']={'name':{'type':Sequelize[_0x4862('0x1')],'unique':_0x4862('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4862('0x3')]('rrmemory',_0x4862('0x4'),'roundrobin')}}; \ No newline at end of file +var _0x4e0c=['STRING','INTEGER','ENUM','beepall','roundrobin','sequelize'];(function(_0x1a4748,_0x40c46e){var _0x28ca99=function(_0x99232c){while(--_0x99232c){_0x1a4748['push'](_0x1a4748['shift']());}};_0x28ca99(++_0x40c46e);}(_0x4e0c,0x1b5));var _0xc4e0=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x4e0c[_0x556bb1];return _0x45455f;};'use strict';var Sequelize=require(_0xc4e0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc4e0('0x1')]},'timeout':{'type':Sequelize[_0xc4e0('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc4e0('0x3')]('rrmemory',_0xc4e0('0x4'),_0xc4e0('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 26ef58f..7e54f65 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 _0x9756=['mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','index','MailQueue','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserMailQueue','nolimit','MailQueueId','User','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','mailPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','sequelize','each','forEach','emit','removeTeams','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','includes','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x3f6b1b,_0x58d3d6){var _0x4a3d2b=function(_0x5648f0){while(--_0x5648f0){_0x3f6b1b['push'](_0x3f6b1b['shift']());}};_0x4a3d2b(++_0x58d3d6);}(_0x9756,0x108));var _0x6975=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x9756[_0x346737];return _0x1ade2e;};'use strict';var emlformat=require(_0x6975('0x0'));var rimraf=require(_0x6975('0x1'));var zipdir=require(_0x6975('0x2'));var jsonpatch=require(_0x6975('0x3'));var rp=require('request-promise');var moment=require(_0x6975('0x4'));var BPromise=require(_0x6975('0x5'));var Mustache=require(_0x6975('0x6'));var util=require(_0x6975('0x7'));var path=require(_0x6975('0x8'));var sox=require('sox');var csv=require(_0x6975('0x9'));var ejs=require(_0x6975('0xa'));var fs=require('fs');var fs_extra=require(_0x6975('0xb'));var _=require('lodash');var squel=require(_0x6975('0xc'));var crypto=require('crypto');var jsforce=require(_0x6975('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6975('0xe'));var Papa=require(_0x6975('0xf'));var Redis=require(_0x6975('0x10'));var authService=require(_0x6975('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6975('0x12'));var hardwareService=require(_0x6975('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6975('0x14'));var config=require(_0x6975('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6975('0x16'))['db'];config[_0x6975('0x17')]=_[_0x6975('0x18')](config[_0x6975('0x17')],{'host':_0x6975('0x19'),'port':0x18eb});var socket=require(_0x6975('0x1a'))(new Redis(config[_0x6975('0x17')]));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x1c65f6,_0x55c6ee){_0x55c6ee=_0x55c6ee||0xcc;return function(_0x384175){if(_0x384175){return _0x1c65f6[_0x6975('0x1b')](_0x55c6ee);}return _0x1c65f6['status'](_0x55c6ee)[_0x6975('0x1c')]();};}function respondWithResult(_0xf54830,_0x35c43e){_0x35c43e=_0x35c43e||0xc8;return function(_0x41af90){if(_0x41af90){return _0xf54830[_0x6975('0x1d')](_0x35c43e)[_0x6975('0x1e')](_0x41af90);}};}function respondWithFilteredResult(_0x353fa4,_0x4ef8b6){return function(_0x470121){if(_0x470121){var _0x3699b7=typeof _0x4ef8b6['offset']===_0x6975('0x1f')&&typeof _0x4ef8b6[_0x6975('0x20')]===_0x6975('0x1f');var _0x5bac6b=_0x470121[_0x6975('0x21')];var _0x448a02=_0x3699b7?0x0:_0x4ef8b6[_0x6975('0x22')];var _0x490ec7=_0x3699b7?_0x470121[_0x6975('0x21')]:_0x4ef8b6[_0x6975('0x22')]+_0x4ef8b6[_0x6975('0x20')];var _0x4346cc;if(_0x490ec7>=_0x5bac6b){_0x490ec7=_0x5bac6b;_0x4346cc=0xc8;}else{_0x4346cc=0xce;}_0x353fa4[_0x6975('0x1d')](_0x4346cc);return _0x353fa4[_0x6975('0x23')]('Content-Range',_0x448a02+'-'+_0x490ec7+'/'+_0x5bac6b)['json'](_0x470121);}return null;};}function patchUpdates(_0x5f50bf){return function(_0x4d2dfc){try{jsonpatch[_0x6975('0x24')](_0x4d2dfc,_0x5f50bf,!![]);}catch(_0x1dc1df){return BPromise[_0x6975('0x25')](_0x1dc1df);}return _0x4d2dfc[_0x6975('0x26')]();};}function saveUpdates(_0x1ff59d,_0x48e61a){return function(_0x25a527){if(_0x25a527){return _0x25a527[_0x6975('0x27')](_0x1ff59d)[_0x6975('0x28')](function(_0x2bbbcc){return _0x2bbbcc;});}return null;};}function removeEntity(_0x2d1f80,_0x22267a){return function(_0x4c548e){if(_0x4c548e){return _0x4c548e[_0x6975('0x29')]()[_0x6975('0x28')](function(){var _0x43423e=_0x4c548e[_0x6975('0x2a')]({'plain':!![]});var _0x47b76a=_0x6975('0x2b');return db[_0x6975('0x2c')]['destroy']({'where':{'type':_0x47b76a,'resourceId':_0x43423e['id']}})[_0x6975('0x28')](function(){return _0x4c548e;});})[_0x6975('0x28')](function(){_0x2d1f80['status'](0xcc)[_0x6975('0x1c')]();});}};}function handleEntityNotFound(_0x1ac67b,_0x29400b){return function(_0x5063b8){if(!_0x5063b8){_0x1ac67b[_0x6975('0x1b')](0x194);}return _0x5063b8;};}function handleError(_0x5484e6,_0x1c7793){_0x1c7793=_0x1c7793||0x1f4;return function(_0x5da553){logger[_0x6975('0x2d')](_0x5da553[_0x6975('0x2e')]);if(_0x5da553[_0x6975('0x2f')]){delete _0x5da553[_0x6975('0x2f')];}_0x5484e6[_0x6975('0x1d')](_0x1c7793)['send'](_0x5da553);};}exports[_0x6975('0x30')]=function(_0xea69ea,_0x17242a){var _0x1594a9={},_0x151378={},_0xa10113={'count':0x0,'rows':[]};var _0x6afa07=_['map'](db[_0x6975('0x31')]['rawAttributes'],function(_0x3e94d5){return{'name':_0x3e94d5[_0x6975('0x32')],'type':_0x3e94d5['type'][_0x6975('0x33')]};});_0x151378[_0x6975('0x34')]=_[_0x6975('0x35')](_0x6afa07,_0x6975('0x2f'));_0x151378[_0x6975('0x36')]=_['keys'](_0xea69ea[_0x6975('0x36')]);_0x151378['filters']=_[_0x6975('0x37')](_0x151378[_0x6975('0x34')],_0x151378['query']);_0x1594a9[_0x6975('0x38')]=_[_0x6975('0x37')](_0x151378[_0x6975('0x34')],qs[_0x6975('0x39')](_0xea69ea['query'][_0x6975('0x39')]));_0x1594a9[_0x6975('0x38')]=_0x1594a9[_0x6975('0x38')][_0x6975('0x3a')]?_0x1594a9[_0x6975('0x38')]:_0x151378[_0x6975('0x34')];if(!_0xea69ea[_0x6975('0x36')][_0x6975('0x3b')]('nolimit')){_0x1594a9['limit']=qs[_0x6975('0x20')](_0xea69ea[_0x6975('0x36')][_0x6975('0x20')]);_0x1594a9[_0x6975('0x22')]=qs['offset'](_0xea69ea[_0x6975('0x36')][_0x6975('0x22')]);}_0x1594a9[_0x6975('0x3c')]=qs[_0x6975('0x3d')](_0xea69ea[_0x6975('0x36')][_0x6975('0x3d')]);_0x1594a9[_0x6975('0x3e')]=qs[_0x6975('0x3f')](_[_0x6975('0x40')](_0xea69ea[_0x6975('0x36')],_0x151378['filters']),_0x6afa07);if(_0xea69ea[_0x6975('0x36')][_0x6975('0x41')]){_0x1594a9['where']=_[_0x6975('0x42')](_0x1594a9[_0x6975('0x3e')],{'$or':_['map'](_0x6afa07,function(_0x2b1268){if(_0x2b1268[_0x6975('0x43')]!=='VIRTUAL'){var _0x591e3b={};_0x591e3b[_0x2b1268[_0x6975('0x2f')]]={'$like':'%'+_0xea69ea[_0x6975('0x36')][_0x6975('0x41')]+'%'};return _0x591e3b;}})});}_0x1594a9=_[_0x6975('0x42')]({},_0x1594a9,_0xea69ea[_0x6975('0x44')]);var _0x4944f0={'where':_0x1594a9['where']};return db[_0x6975('0x31')]['count'](_0x4944f0)[_0x6975('0x28')](function(_0x526cdc){_0xa10113[_0x6975('0x21')]=_0x526cdc;if(_0xea69ea['query'][_0x6975('0x45')]){_0x1594a9['include']=[{'all':!![]}];}return db[_0x6975('0x31')][_0x6975('0x46')](_0x1594a9);})[_0x6975('0x28')](function(_0x9d509d){_0xa10113[_0x6975('0x47')]=_0x9d509d;return _0xa10113;})[_0x6975('0x28')](respondWithFilteredResult(_0x17242a,_0x1594a9))[_0x6975('0x48')](handleError(_0x17242a,null));};exports[_0x6975('0x49')]=function(_0x43c241,_0x5df364){var _0x4e0297={'raw':!![],'where':{'id':_0x43c241['params']['id']}},_0xcb47ed={};_0xcb47ed[_0x6975('0x34')]=_[_0x6975('0x4a')](db[_0x6975('0x31')][_0x6975('0x4b')]);_0xcb47ed[_0x6975('0x36')]=_['keys'](_0x43c241['query']);_0xcb47ed['filters']=_[_0x6975('0x37')](_0xcb47ed[_0x6975('0x34')],_0xcb47ed[_0x6975('0x36')]);_0x4e0297[_0x6975('0x38')]=_[_0x6975('0x37')](_0xcb47ed[_0x6975('0x34')],qs[_0x6975('0x39')](_0x43c241[_0x6975('0x36')][_0x6975('0x39')]));_0x4e0297[_0x6975('0x38')]=_0x4e0297[_0x6975('0x38')][_0x6975('0x3a')]?_0x4e0297[_0x6975('0x38')]:_0xcb47ed[_0x6975('0x34')];if(_0x43c241['query'][_0x6975('0x45')]){_0x4e0297[_0x6975('0x4c')]=[{'all':!![]}];}_0x4e0297=_['merge']({},_0x4e0297,_0x43c241[_0x6975('0x44')]);return db[_0x6975('0x31')]['find'](_0x4e0297)[_0x6975('0x28')](handleEntityNotFound(_0x5df364,null))[_0x6975('0x28')](respondWithResult(_0x5df364,null))[_0x6975('0x48')](handleError(_0x5df364,null));};exports[_0x6975('0x4d')]=function(_0x3eb554,_0x37164a){return db['MailQueue'][_0x6975('0x4d')](_0x3eb554[_0x6975('0x4e')],{})[_0x6975('0x28')](function(_0x30e3c5){var _0x120ce7=_0x3eb554['user'][_0x6975('0x2a')]({'plain':!![]});if(!_0x120ce7)throw new Error(_0x6975('0x4f'));if(_0x120ce7[_0x6975('0x50')]==='user'){var _0x73a704=_0x30e3c5[_0x6975('0x2a')]({'plain':!![]});var _0x164add=_0x6975('0x2b');return db[_0x6975('0x51')][_0x6975('0x52')]({'where':{'name':_0x164add,'userProfileId':_0x120ce7[_0x6975('0x53')]},'raw':!![]})[_0x6975('0x28')](function(_0x36004a){if(_0x36004a&&_0x36004a['autoAssociation']===0x0){return db[_0x6975('0x2c')]['create']({'name':_0x73a704['name'],'resourceId':_0x73a704['id'],'type':_0x36004a[_0x6975('0x2f')],'sectionId':_0x36004a['id']},{})[_0x6975('0x28')](function(){return _0x30e3c5;});}else{return _0x30e3c5;}})[_0x6975('0x48')](function(_0x44dd9d){logger[_0x6975('0x2d')](_0x6975('0x54'),_0x44dd9d);throw _0x44dd9d;});}return _0x30e3c5;})[_0x6975('0x28')](respondWithResult(_0x37164a,0xc9))['catch'](handleError(_0x37164a,null));};exports[_0x6975('0x27')]=function(_0x151966,_0x66696b){if(_0x151966[_0x6975('0x4e')]['id']){delete _0x151966[_0x6975('0x4e')]['id'];}return db[_0x6975('0x31')][_0x6975('0x52')]({'where':{'id':_0x151966[_0x6975('0x55')]['id']}})[_0x6975('0x28')](handleEntityNotFound(_0x66696b,null))[_0x6975('0x28')](saveUpdates(_0x151966['body'],null))['then'](respondWithResult(_0x66696b,null))[_0x6975('0x48')](handleError(_0x66696b,null));};exports[_0x6975('0x29')]=function(_0x3e06c5,_0x152954){return db[_0x6975('0x31')]['find']({'where':{'id':_0x3e06c5[_0x6975('0x55')]['id']}})[_0x6975('0x28')](handleEntityNotFound(_0x152954,null))[_0x6975('0x28')](removeEntity(_0x152954,null))['catch'](handleError(_0x152954,null));};exports['describe']=function(_0x3b2012,_0x448f87){return db[_0x6975('0x31')][_0x6975('0x56')]()[_0x6975('0x28')](respondWithResult(_0x448f87,null))['catch'](handleError(_0x448f87,null));};exports[_0x6975('0x57')]=function(_0x1d890f,_0x2e4d1f,_0x46b716){var _0x159b61={'raw':!![],'where':{}},_0x1a6da1={},_0x3fc901;return db[_0x6975('0x31')][_0x6975('0x58')]({'where':{'id':_0x1d890f['params']['id']}})[_0x6975('0x28')](handleEntityNotFound(_0x2e4d1f,null))[_0x6975('0x28')](function(_0x39e613){if(_0x39e613){_0x3fc901=_0x39e613[_0x6975('0x2a')]({'plain':!![]});_0x1a6da1[_0x6975('0x34')]=_[_0x6975('0x4a')](db[_0x6975('0x59')]['rawAttributes']);_0x1a6da1['query']=_['keys'](_0x1d890f[_0x6975('0x36')]);_0x1a6da1[_0x6975('0x3f')]=_['intersection'](_0x1a6da1[_0x6975('0x34')],_0x1a6da1[_0x6975('0x36')]);_0x159b61[_0x6975('0x38')]=_[_0x6975('0x37')](_0x1a6da1[_0x6975('0x34')],qs[_0x6975('0x39')](_0x1d890f[_0x6975('0x36')]['fields']));_0x159b61[_0x6975('0x38')]=_0x159b61[_0x6975('0x38')][_0x6975('0x3a')]?_0x159b61[_0x6975('0x38')]:_0x1a6da1[_0x6975('0x34')];if(!_0x1d890f[_0x6975('0x36')][_0x6975('0x3b')](_0x6975('0x5a'))){_0x159b61[_0x6975('0x20')]=qs[_0x6975('0x20')](_0x1d890f[_0x6975('0x36')][_0x6975('0x20')]);_0x159b61['offset']=qs[_0x6975('0x22')](_0x1d890f[_0x6975('0x36')][_0x6975('0x22')]);}_0x159b61[_0x6975('0x3c')]=qs[_0x6975('0x3d')](_0x1d890f['query'][_0x6975('0x3d')]);_0x159b61[_0x6975('0x3e')]=qs[_0x6975('0x3f')](_[_0x6975('0x40')](_0x1d890f[_0x6975('0x36')],_0x1a6da1[_0x6975('0x3f')]));_0x159b61['where'][_0x6975('0x5b')]=_0x39e613['id'];if(_0x1d890f[_0x6975('0x36')][_0x6975('0x41')]){_0x159b61[_0x6975('0x3e')]=_[_0x6975('0x42')](_0x159b61[_0x6975('0x3e')],{'$or':_[_0x6975('0x35')](_0x159b61[_0x6975('0x38')],function(_0x169343){var _0x5c305a={};_0x5c305a[_0x169343]={'$like':'%'+_0x1d890f[_0x6975('0x36')][_0x6975('0x41')]+'%'};return _0x5c305a;})});}_0x159b61=_[_0x6975('0x42')]({},_0x159b61,_0x1d890f[_0x6975('0x44')]);return db[_0x6975('0x59')][_0x6975('0x46')](_0x159b61);}})[_0x6975('0x28')](function(_0x2d001d){if(_0x2d001d){return db[_0x6975('0x5c')]['findAndCountAll']({'where':{'id':_[_0x6975('0x35')](_0x2d001d,_0x6975('0x5d')),'role':_0x6975('0x5e')},'attributes':['id','name','mailPause',_0x6975('0x5f'),_0x6975('0x60')]});}})[_0x6975('0x28')](function(_0x2659fb){if(_0x2659fb){return{'count':_0x2659fb['count'],'rows':_[_0x6975('0x35')](_0x2659fb[_0x6975('0x47')],function(_0x46d3e2){return{'membername':_0x46d3e2[_0x6975('0x2f')],'UserId':_0x46d3e2['id'],'queue_name':_0x3fc901[_0x6975('0x2f')],'MailQueueId':_0x3fc901['id'],'interface':util[_0x6975('0x61')](_0x6975('0x62'),_0x6975('0x63'),_0x46d3e2[_0x6975('0x2f')]),'penalty':0x0,'paused':_0x46d3e2[_0x6975('0x64')],'createdAt':_0x46d3e2['createdAt'],'updatedAt':_0x46d3e2[_0x6975('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6975('0x28')](respondWithFilteredResult(_0x2e4d1f,_0x159b61))[_0x6975('0x48')](handleError(_0x2e4d1f,null));};exports[_0x6975('0x65')]=function(_0x2fada4,_0x3ce8e9,_0x5f19d6){var _0xccef4d={};var _0x4b8b5f={};var _0x1a70e7;var _0x12f7f3;return db['MailQueue'][_0x6975('0x58')]({'where':{'id':_0x2fada4[_0x6975('0x55')]['id']}})[_0x6975('0x28')](handleEntityNotFound(_0x3ce8e9,null))['then'](function(_0x649c9e){if(_0x649c9e){_0x1a70e7=_0x649c9e;_0x4b8b5f[_0x6975('0x34')]=_[_0x6975('0x4a')](db[_0x6975('0x66')][_0x6975('0x4b')]);_0x4b8b5f[_0x6975('0x36')]=_[_0x6975('0x4a')](_0x2fada4['query']);_0x4b8b5f[_0x6975('0x3f')]=_[_0x6975('0x37')](_0x4b8b5f[_0x6975('0x34')],_0x4b8b5f[_0x6975('0x36')]);_0xccef4d[_0x6975('0x38')]=_[_0x6975('0x37')](_0x4b8b5f['model'],qs[_0x6975('0x39')](_0x2fada4['query'][_0x6975('0x39')]));_0xccef4d[_0x6975('0x38')]=_0xccef4d[_0x6975('0x38')]['length']?_0xccef4d[_0x6975('0x38')]:_0x4b8b5f[_0x6975('0x34')];_0xccef4d[_0x6975('0x3c')]=qs[_0x6975('0x3d')](_0x2fada4[_0x6975('0x36')][_0x6975('0x3d')]);_0xccef4d[_0x6975('0x3e')]=qs[_0x6975('0x3f')](_[_0x6975('0x40')](_0x2fada4[_0x6975('0x36')],_0x4b8b5f[_0x6975('0x3f')]));if(_0x2fada4[_0x6975('0x36')][_0x6975('0x41')]){_0xccef4d[_0x6975('0x3e')]=_[_0x6975('0x42')](_0xccef4d[_0x6975('0x3e')],{'$or':_['map'](_0xccef4d[_0x6975('0x38')],function(_0x4e6843){var _0xbf7d8e={};_0xbf7d8e[_0x4e6843]={'$like':'%'+_0x2fada4['query'][_0x6975('0x41')]+'%'};return _0xbf7d8e;})});}_0xccef4d=_[_0x6975('0x42')]({},_0xccef4d,_0x2fada4['options']);return _0x1a70e7['getTeams'](_0xccef4d);}})[_0x6975('0x28')](function(_0x36f2e4){if(_0x36f2e4){_0x12f7f3=_0x36f2e4[_0x6975('0x3a')];if(!_0x2fada4[_0x6975('0x36')][_0x6975('0x3b')](_0x6975('0x5a'))){_0xccef4d[_0x6975('0x20')]=qs[_0x6975('0x20')](_0x2fada4[_0x6975('0x36')][_0x6975('0x20')]);_0xccef4d[_0x6975('0x22')]=qs['offset'](_0x2fada4['query']['offset']);}return _0x1a70e7[_0x6975('0x65')](_0xccef4d);}})['then'](function(_0x49857b){if(_0x49857b){return _0x49857b?{'count':_0x12f7f3,'rows':_0x49857b}:null;}})[_0x6975('0x28')](respondWithResult(_0x3ce8e9,null))['catch'](handleError(_0x3ce8e9,null));};exports[_0x6975('0x67')]=function(_0x172db0,_0x56c26b,_0x370d20){var _0x186193=_0x172db0['body'][_0x6975('0x68')];return db[_0x6975('0x66')][_0x6975('0x46')]({'where':{'id':_0x186193},'attributes':['id'],'include':[{'model':db[_0x6975('0x5c')],'as':_0x6975('0x69'),'attributes':['id','name',_0x6975('0x6a'),_0x6975('0x6b'),'interface'],'raw':!![]}]})[_0x6975('0x28')](function(_0x3ae6af){if(_0x3ae6af){var _0x1e84cc=_['flatMap'](_0x3ae6af,function(_0x419bb6){var _0x376697=_0x419bb6[_0x6975('0x2a')]({'plain':!![]});return _0x376697[_0x6975('0x69')];});return db['MailQueue'][_0x6975('0x52')]({'where':{'id':_0x172db0[_0x6975('0x55')]['id']}})[_0x6975('0x28')](function(_0x52dc5f){return db[_0x6975('0x6c')]['transaction'](function(_0x177fa5){return _0x52dc5f[_0x6975('0x67')](_0x186193,{'transaction':_0x177fa5})[_0x6975('0x28')](function(){return BPromise[_0x6975('0x6d')](_0x1e84cc,function(_0x53262a){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x53262a['id'],'MailQueueId':_0x172db0[_0x6975('0x55')]['id']},'transaction':_0x177fa5});});})[_0x6975('0x28')](function(){_0x1e84cc[_0x6975('0x6e')](function(_0x11dcd0){socket[_0x6975('0x6f')]('userMailQueue:save',{'UserId':_0x11dcd0['id'],'MailQueueId':_0x52dc5f['id']});});});});});}})[_0x6975('0x28')](respondWithStatusCode(_0x56c26b,null))[_0x6975('0x48')](handleError(_0x56c26b,null));};exports[_0x6975('0x70')]=function(_0xf1d9f8,_0x43b595,_0x2f8a2d){return db[_0x6975('0x66')][_0x6975('0x46')]({'where':{'id':_0xf1d9f8[_0x6975('0x36')][_0x6975('0x68')]},'attributes':['id'],'include':[{'model':db[_0x6975('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6975('0x28')](handleEntityNotFound(_0x43b595,null))[_0x6975('0x28')](function(_0x4e58c1){var _0x2c5fac=_[_0x6975('0x35')](_0x4e58c1,'id');var _0x1c7704=[];var _0x5df9cc=[];var _0x1ce839=squel['select']();_0x1ce839[_0x6975('0x71')](_0x6975('0x72'))['from']('team_has_mail_queues','tq')[_0x6975('0x73')](_0x6975('0x74'),'ut',_0x6975('0x75'))[_0x6975('0x3e')](_0x6975('0x76'),_0xf1d9f8[_0x6975('0x55')]['id']);for(var _0x35b77b=0x0;_0x35b77b<_0x4e58c1[_0x6975('0x3a')];_0x35b77b+=0x1){let _0x1365f8=_0x4e58c1[_0x35b77b];for(var _0xd5f1cc=0x0;_0xd5f1cc<_0x1365f8[_0x6975('0x69')][_0x6975('0x3a')];_0xd5f1cc+=0x1){let _0x523b0d=_0x1365f8[_0x6975('0x69')][_0xd5f1cc];var _0x3ead43=_0x1ce839[_0x6975('0x77')]();_0x3ead43[_0x6975('0x3e')](_0x6975('0x78'),_0x523b0d['id']);_0x5df9cc[_0x6975('0x79')](db[_0x6975('0x6c')]['query'](_0x3ead43[_0x6975('0x7a')](),{'type':db[_0x6975('0x6c')]['QueryTypes'][_0x6975('0x7b')]})[_0x6975('0x28')](function(_0x23fe7b){if(_0x23fe7b[_0x6975('0x3a')]===0x1){return _0x523b0d['id'];}else{var _0x252040=_[_0x6975('0x7c')](_[_0x6975('0x35')](_0x23fe7b,'TeamId'),function(_0x1a90c7){return _[_0x6975('0x7d')](_0x2c5fac,_0x1a90c7);});if(_0x252040){return _0x523b0d['id'];}}}));}}return BPromise['all'](_0x5df9cc)[_0x6975('0x28')](function(_0x56d960){_0x1c7704=_(_0x1c7704)['union'](_0x56d960)[_0x6975('0x7e')]()[_0x6975('0x7f')]();return db[_0x6975('0x31')]['find']({'where':{'id':_0xf1d9f8[_0x6975('0x55')]['id']}})[_0x6975('0x28')](function(_0x5243a7){return db[_0x6975('0x6c')]['transaction'](function(_0x26592f){return _0x5243a7['removeTeams'](_0xf1d9f8[_0x6975('0x36')]['ids'],{'transaction':_0x26592f})[_0x6975('0x28')](function(){if(!_[_0x6975('0x80')](_0x1c7704)){return _0x5243a7[_0x6975('0x81')](_0x1c7704,{'transaction':_0x26592f});}})['then'](function(){_0x1c7704[_0x6975('0x6e')](function(_0x5d2c8f){socket['emit'](_0x6975('0x82'),{'UserId':_0x5d2c8f,'MailQueueId':_0x5243a7['id']});});});});});});})[_0x6975('0x28')](respondWithStatusCode(_0x43b595,null))['catch'](handleError(_0x43b595,null));};exports[_0x6975('0x83')]=function(_0x249625,_0x4f2288,_0x19effe){return db[_0x6975('0x31')][_0x6975('0x52')]({'where':{'id':_0x249625[_0x6975('0x55')]['id']}})[_0x6975('0x28')](handleEntityNotFound(_0x4f2288,null))['then'](function(_0x59c7e6){if(_0x59c7e6){return _0x59c7e6[_0x6975('0x83')](_0x249625['body']['ids'],_['omit'](_0x249625[_0x6975('0x4e')],[_0x6975('0x68'),'id'])||{})[_0x6975('0x84')](function(_0x211fd6){for(var _0x2d5605=0x0;_0x2d5605<_0x249625['body'][_0x6975('0x68')][_0x6975('0x3a')];_0x2d5605+=0x1){socket[_0x6975('0x6f')]('userMailQueue:save',{'UserId':Number(_0x249625[_0x6975('0x4e')][_0x6975('0x68')][_0x2d5605]),'MailQueueId':Number(_0x249625[_0x6975('0x55')]['id'])});}return _0x211fd6;});}})[_0x6975('0x28')](respondWithResult(_0x4f2288,null))[_0x6975('0x48')](handleError(_0x4f2288,null));};exports[_0x6975('0x81')]=function(_0x4f75ff,_0x5eefba,_0x38ccd2){return db[_0x6975('0x31')]['find']({'where':{'id':_0x4f75ff[_0x6975('0x55')]['id']}})[_0x6975('0x28')](handleEntityNotFound(_0x5eefba,null))[_0x6975('0x28')](function(_0x300d25){if(_0x300d25){return _0x300d25[_0x6975('0x81')](_0x4f75ff['query']['ids'])[_0x6975('0x28')](function(){if(_[_0x6975('0x85')](_0x4f75ff[_0x6975('0x36')][_0x6975('0x68')])){for(var _0x19892a=0x0;_0x19892a<_0x4f75ff[_0x6975('0x36')]['ids'][_0x6975('0x3a')];_0x19892a+=0x1){socket[_0x6975('0x6f')](_0x6975('0x82'),{'UserId':Number(_0x4f75ff['query'][_0x6975('0x68')][_0x19892a]),'MailQueueId':Number(_0x4f75ff['params']['id'])});}}else{socket['emit']('userMailQueue:remove',{'UserId':Number(_0x4f75ff[_0x6975('0x36')]['ids']),'MailQueueId':Number(_0x4f75ff[_0x6975('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x5eefba,null))['catch'](handleError(_0x5eefba,null));};exports[_0x6975('0x86')]=function(_0x253186,_0x3cca68,_0x323cc5){var _0x190be2={};var _0x90dafd={};var _0x2f7e0c;var _0x294f43;return db[_0x6975('0x31')]['findOne']({'where':{'id':_0x253186[_0x6975('0x55')]['id']}})[_0x6975('0x28')](handleEntityNotFound(_0x3cca68,null))[_0x6975('0x28')](function(_0x382527){if(_0x382527){_0x2f7e0c=_0x382527;_0x90dafd['model']=_[_0x6975('0x4a')](db[_0x6975('0x5c')]['rawAttributes']);_0x90dafd[_0x6975('0x36')]=_['keys'](_0x253186[_0x6975('0x36')]);_0x90dafd[_0x6975('0x3f')]=_[_0x6975('0x37')](_0x90dafd[_0x6975('0x34')],_0x90dafd[_0x6975('0x36')]);_0x190be2[_0x6975('0x38')]=_[_0x6975('0x37')](_0x90dafd[_0x6975('0x34')],qs['fields'](_0x253186[_0x6975('0x36')][_0x6975('0x39')]));_0x190be2[_0x6975('0x38')]=_0x190be2[_0x6975('0x38')][_0x6975('0x3a')]?_0x190be2[_0x6975('0x38')]:_0x90dafd[_0x6975('0x34')];_0x190be2[_0x6975('0x3c')]=qs[_0x6975('0x3d')](_0x253186[_0x6975('0x36')][_0x6975('0x3d')]);_0x190be2['where']=qs[_0x6975('0x3f')](_[_0x6975('0x40')](_0x253186[_0x6975('0x36')],_0x90dafd[_0x6975('0x3f')]));if(_0x253186[_0x6975('0x36')][_0x6975('0x41')]){_0x190be2['where']=_[_0x6975('0x42')](_0x190be2[_0x6975('0x3e')],{'$or':_['map'](_0x190be2[_0x6975('0x38')],function(_0x5655d6){var _0xfd8ecd={};_0xfd8ecd[_0x5655d6]={'$like':'%'+_0x253186[_0x6975('0x36')][_0x6975('0x41')]+'%'};return _0xfd8ecd;})});}_0x190be2=_[_0x6975('0x42')]({},_0x190be2,_0x253186[_0x6975('0x44')]);return _0x2f7e0c[_0x6975('0x86')](_0x190be2);}})['then'](function(_0x29e8e1){if(_0x29e8e1){_0x294f43=_0x29e8e1[_0x6975('0x3a')];if(!_0x253186['query'][_0x6975('0x3b')]('nolimit')){_0x190be2['limit']=qs[_0x6975('0x20')](_0x253186[_0x6975('0x36')][_0x6975('0x20')]);_0x190be2[_0x6975('0x22')]=qs[_0x6975('0x22')](_0x253186[_0x6975('0x36')]['offset']);}return _0x2f7e0c[_0x6975('0x86')](_0x190be2);}})['then'](function(_0x4b12e0){if(_0x4b12e0){return _0x4b12e0?{'count':_0x294f43,'rows':_0x4b12e0}:null;}})[_0x6975('0x28')](respondWithResult(_0x3cca68,null))[_0x6975('0x48')](handleError(_0x3cca68,null));}; \ No newline at end of file +var _0x0ec2=['./mailQueue.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','destroy','then','get','UserProfileResource','error','stack','send','map','MailQueue','rawAttributes','type','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserMailQueue','order','MailQueueId','findAll','User','findAndCountAll','UserId','agent','createdAt','%s/%s','SIP','mailPause','updatedAt','getTeams','length','addTeams','ids','Team','Agents','online','voicePause','sequelize','transaction','each','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x1327f6,_0x30921e){var _0x620902=function(_0x31b389){while(--_0x31b389){_0x1327f6['push'](_0x1327f6['shift']());}};_0x620902(++_0x30921e);}(_0x0ec2,0x72));var _0x20ec=function(_0x2f2360,_0x151089){_0x2f2360=_0x2f2360-0x0;var _0x1cc8d3=_0x0ec2[_0x2f2360];return _0x1cc8d3;};'use strict';var emlformat=require(_0x20ec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x20ec('0x1'));var jsonpatch=require(_0x20ec('0x2'));var rp=require(_0x20ec('0x3'));var moment=require(_0x20ec('0x4'));var BPromise=require(_0x20ec('0x5'));var Mustache=require(_0x20ec('0x6'));var util=require(_0x20ec('0x7'));var path=require(_0x20ec('0x8'));var sox=require(_0x20ec('0x9'));var csv=require(_0x20ec('0xa'));var ejs=require(_0x20ec('0xb'));var fs=require('fs');var fs_extra=require(_0x20ec('0xc'));var _=require(_0x20ec('0xd'));var squel=require(_0x20ec('0xe'));var crypto=require(_0x20ec('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x20ec('0x10'));var toCsv=require('to-csv');var querystring=require(_0x20ec('0x11'));var Papa=require(_0x20ec('0x12'));var Redis=require(_0x20ec('0x13'));var authService=require(_0x20ec('0x14'));var qs=require(_0x20ec('0x15'));var as=require(_0x20ec('0x16'));var hardwareService=require(_0x20ec('0x17'));var logger=require(_0x20ec('0x18'))(_0x20ec('0x19'));var utils=require(_0x20ec('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x20ec('0x1b'));var db=require(_0x20ec('0x1c'))['db'];config[_0x20ec('0x1d')]=_[_0x20ec('0x1e')](config[_0x20ec('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x20ec('0x1d')]));require(_0x20ec('0x1f'))['register'](socket);function respondWithStatusCode(_0x9ce965,_0x23e08d){_0x23e08d=_0x23e08d||0xcc;return function(_0x3674a5){if(_0x3674a5){return _0x9ce965[_0x20ec('0x20')](_0x23e08d);}return _0x9ce965[_0x20ec('0x21')](_0x23e08d)[_0x20ec('0x22')]();};}function respondWithResult(_0x2cb099,_0x2b12fe){_0x2b12fe=_0x2b12fe||0xc8;return function(_0xdfeca9){if(_0xdfeca9){return _0x2cb099[_0x20ec('0x21')](_0x2b12fe)[_0x20ec('0x23')](_0xdfeca9);}};}function respondWithFilteredResult(_0x2ff339,_0x5ad45f){return function(_0x3c113d){if(_0x3c113d){var _0x3d9227=typeof _0x5ad45f[_0x20ec('0x24')]==='undefined'&&typeof _0x5ad45f[_0x20ec('0x25')]===_0x20ec('0x26');var _0x3c16f4=_0x3c113d[_0x20ec('0x27')];var _0x50ce32=_0x3d9227?0x0:_0x5ad45f[_0x20ec('0x24')];var _0xc5604e=_0x3d9227?_0x3c113d[_0x20ec('0x27')]:_0x5ad45f[_0x20ec('0x24')]+_0x5ad45f[_0x20ec('0x25')];var _0x437bc3;if(_0xc5604e>=_0x3c16f4){_0xc5604e=_0x3c16f4;_0x437bc3=0xc8;}else{_0x437bc3=0xce;}_0x2ff339[_0x20ec('0x21')](_0x437bc3);return _0x2ff339[_0x20ec('0x28')](_0x20ec('0x29'),_0x50ce32+'-'+_0xc5604e+'/'+_0x3c16f4)[_0x20ec('0x23')](_0x3c113d);}return null;};}function patchUpdates(_0x47fb7a){return function(_0x2330be){try{jsonpatch['apply'](_0x2330be,_0x47fb7a,!![]);}catch(_0xbbff4c){return BPromise['reject'](_0xbbff4c);}return _0x2330be[_0x20ec('0x2a')]();};}function saveUpdates(_0x819c1e,_0x2b140d){return function(_0x593c74){if(_0x593c74){return _0x593c74[_0x20ec('0x2b')](_0x819c1e)['then'](function(_0x3c0ac2){return _0x3c0ac2;});}return null;};}function removeEntity(_0x350345,_0x425cf4){return function(_0x2bebf2){if(_0x2bebf2){return _0x2bebf2[_0x20ec('0x2c')]()[_0x20ec('0x2d')](function(){var _0x2a97bd=_0x2bebf2[_0x20ec('0x2e')]({'plain':!![]});var _0xa1587e='MailQueues';return db[_0x20ec('0x2f')]['destroy']({'where':{'type':_0xa1587e,'resourceId':_0x2a97bd['id']}})[_0x20ec('0x2d')](function(){return _0x2bebf2;});})['then'](function(){_0x350345[_0x20ec('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23c31c,_0x2c6558){return function(_0x1a455f){if(!_0x1a455f){_0x23c31c[_0x20ec('0x20')](0x194);}return _0x1a455f;};}function handleError(_0x165575,_0x1adcd1){_0x1adcd1=_0x1adcd1||0x1f4;return function(_0x1285e0){logger[_0x20ec('0x30')](_0x1285e0[_0x20ec('0x31')]);if(_0x1285e0['name']){delete _0x1285e0['name'];}_0x165575[_0x20ec('0x21')](_0x1adcd1)[_0x20ec('0x32')](_0x1285e0);};}exports['index']=function(_0x2373af,_0x5db4e0){var _0x2b8ff8={},_0x36bfec={},_0x4f8424={'count':0x0,'rows':[]};var _0x255a7a=_[_0x20ec('0x33')](db[_0x20ec('0x34')][_0x20ec('0x35')],function(_0x11477a){return{'name':_0x11477a['fieldName'],'type':_0x11477a[_0x20ec('0x36')][_0x20ec('0x37')]};});_0x36bfec[_0x20ec('0x38')]=_[_0x20ec('0x33')](_0x255a7a,_0x20ec('0x39'));_0x36bfec[_0x20ec('0x3a')]=_['keys'](_0x2373af[_0x20ec('0x3a')]);_0x36bfec[_0x20ec('0x3b')]=_[_0x20ec('0x3c')](_0x36bfec['model'],_0x36bfec[_0x20ec('0x3a')]);_0x2b8ff8[_0x20ec('0x3d')]=_['intersection'](_0x36bfec[_0x20ec('0x38')],qs[_0x20ec('0x3e')](_0x2373af[_0x20ec('0x3a')][_0x20ec('0x3e')]));_0x2b8ff8[_0x20ec('0x3d')]=_0x2b8ff8[_0x20ec('0x3d')]['length']?_0x2b8ff8[_0x20ec('0x3d')]:_0x36bfec[_0x20ec('0x38')];if(!_0x2373af[_0x20ec('0x3a')][_0x20ec('0x3f')](_0x20ec('0x40'))){_0x2b8ff8[_0x20ec('0x25')]=qs[_0x20ec('0x25')](_0x2373af[_0x20ec('0x3a')][_0x20ec('0x25')]);_0x2b8ff8[_0x20ec('0x24')]=qs['offset'](_0x2373af['query']['offset']);}_0x2b8ff8['order']=qs['sort'](_0x2373af[_0x20ec('0x3a')][_0x20ec('0x41')]);_0x2b8ff8[_0x20ec('0x42')]=qs[_0x20ec('0x3b')](_[_0x20ec('0x43')](_0x2373af[_0x20ec('0x3a')],_0x36bfec[_0x20ec('0x3b')]),_0x255a7a);if(_0x2373af[_0x20ec('0x3a')][_0x20ec('0x44')]){_0x2b8ff8[_0x20ec('0x42')]=_[_0x20ec('0x45')](_0x2b8ff8[_0x20ec('0x42')],{'$or':_[_0x20ec('0x33')](_0x255a7a,function(_0x3a52bb){if(_0x3a52bb[_0x20ec('0x36')]!==_0x20ec('0x46')){var _0x2c5b9d={};_0x2c5b9d[_0x3a52bb['name']]={'$like':'%'+_0x2373af[_0x20ec('0x3a')][_0x20ec('0x44')]+'%'};return _0x2c5b9d;}})});}_0x2b8ff8=_['merge']({},_0x2b8ff8,_0x2373af[_0x20ec('0x47')]);var _0x3ca6cd={'where':_0x2b8ff8[_0x20ec('0x42')]};return db[_0x20ec('0x34')][_0x20ec('0x27')](_0x3ca6cd)[_0x20ec('0x2d')](function(_0x19fc04){_0x4f8424[_0x20ec('0x27')]=_0x19fc04;if(_0x2373af['query'][_0x20ec('0x48')]){_0x2b8ff8[_0x20ec('0x49')]=[{'all':!![]}];}return db[_0x20ec('0x34')]['findAll'](_0x2b8ff8);})[_0x20ec('0x2d')](function(_0x5f2427){_0x4f8424[_0x20ec('0x4a')]=_0x5f2427;return _0x4f8424;})[_0x20ec('0x2d')](respondWithFilteredResult(_0x5db4e0,_0x2b8ff8))[_0x20ec('0x4b')](handleError(_0x5db4e0,null));};exports['show']=function(_0x42ca56,_0x5269b1){var _0x2a6217={'raw':!![],'where':{'id':_0x42ca56[_0x20ec('0x4c')]['id']}},_0x42d095={};_0x42d095[_0x20ec('0x38')]=_[_0x20ec('0x4d')](db[_0x20ec('0x34')][_0x20ec('0x35')]);_0x42d095[_0x20ec('0x3a')]=_[_0x20ec('0x4d')](_0x42ca56[_0x20ec('0x3a')]);_0x42d095[_0x20ec('0x3b')]=_['intersection'](_0x42d095[_0x20ec('0x38')],_0x42d095['query']);_0x2a6217[_0x20ec('0x3d')]=_[_0x20ec('0x3c')](_0x42d095[_0x20ec('0x38')],qs[_0x20ec('0x3e')](_0x42ca56['query']['fields']));_0x2a6217[_0x20ec('0x3d')]=_0x2a6217[_0x20ec('0x3d')]['length']?_0x2a6217[_0x20ec('0x3d')]:_0x42d095[_0x20ec('0x38')];if(_0x42ca56[_0x20ec('0x3a')][_0x20ec('0x48')]){_0x2a6217['include']=[{'all':!![]}];}_0x2a6217=_[_0x20ec('0x45')]({},_0x2a6217,_0x42ca56['options']);return db[_0x20ec('0x34')]['find'](_0x2a6217)[_0x20ec('0x2d')](handleEntityNotFound(_0x5269b1,null))[_0x20ec('0x2d')](respondWithResult(_0x5269b1,null))[_0x20ec('0x4b')](handleError(_0x5269b1,null));};exports[_0x20ec('0x4e')]=function(_0x27bf85,_0xec113){return db['MailQueue'][_0x20ec('0x4e')](_0x27bf85['body'],{})[_0x20ec('0x2d')](function(_0x2ef1dc){var _0x232919=_0x27bf85[_0x20ec('0x4f')][_0x20ec('0x2e')]({'plain':!![]});if(!_0x232919)throw new Error(_0x20ec('0x50'));if(_0x232919['role']===_0x20ec('0x4f')){var _0x3709cc=_0x2ef1dc[_0x20ec('0x2e')]({'plain':!![]});var _0x50b2c9='MailQueues';return db[_0x20ec('0x51')][_0x20ec('0x52')]({'where':{'name':_0x50b2c9,'userProfileId':_0x232919['userProfileId']},'raw':!![]})[_0x20ec('0x2d')](function(_0x300968){if(_0x300968&&_0x300968[_0x20ec('0x53')]===0x0){return db[_0x20ec('0x2f')][_0x20ec('0x4e')]({'name':_0x3709cc[_0x20ec('0x39')],'resourceId':_0x3709cc['id'],'type':_0x300968[_0x20ec('0x39')],'sectionId':_0x300968['id']},{})[_0x20ec('0x2d')](function(){return _0x2ef1dc;});}else{return _0x2ef1dc;}})[_0x20ec('0x4b')](function(_0xc6ff87){logger[_0x20ec('0x30')](_0x20ec('0x54'),_0xc6ff87);throw _0xc6ff87;});}return _0x2ef1dc;})['then'](respondWithResult(_0xec113,0xc9))[_0x20ec('0x4b')](handleError(_0xec113,null));};exports[_0x20ec('0x2b')]=function(_0x6412b7,_0x2fa74c){if(_0x6412b7[_0x20ec('0x55')]['id']){delete _0x6412b7[_0x20ec('0x55')]['id'];}return db['MailQueue'][_0x20ec('0x52')]({'where':{'id':_0x6412b7['params']['id']}})['then'](handleEntityNotFound(_0x2fa74c,null))[_0x20ec('0x2d')](saveUpdates(_0x6412b7['body'],null))[_0x20ec('0x2d')](respondWithResult(_0x2fa74c,null))['catch'](handleError(_0x2fa74c,null));};exports[_0x20ec('0x2c')]=function(_0x5e2e02,_0x132420){return db[_0x20ec('0x34')][_0x20ec('0x52')]({'where':{'id':_0x5e2e02[_0x20ec('0x4c')]['id']}})[_0x20ec('0x2d')](handleEntityNotFound(_0x132420,null))['then'](removeEntity(_0x132420,null))[_0x20ec('0x4b')](handleError(_0x132420,null));};exports[_0x20ec('0x56')]=function(_0x3c1cca,_0x3d2888){return db[_0x20ec('0x34')][_0x20ec('0x56')]()[_0x20ec('0x2d')](respondWithResult(_0x3d2888,null))[_0x20ec('0x4b')](handleError(_0x3d2888,null));};exports[_0x20ec('0x57')]=function(_0x5dd9c2,_0x1e9256,_0x421588){var _0x461ba9={'raw':!![],'where':{}},_0x5b40c7={},_0x2db3c0;return db[_0x20ec('0x34')][_0x20ec('0x58')]({'where':{'id':_0x5dd9c2[_0x20ec('0x4c')]['id']}})[_0x20ec('0x2d')](handleEntityNotFound(_0x1e9256,null))[_0x20ec('0x2d')](function(_0x29bccb){if(_0x29bccb){_0x2db3c0=_0x29bccb[_0x20ec('0x2e')]({'plain':!![]});_0x5b40c7[_0x20ec('0x38')]=_[_0x20ec('0x4d')](db[_0x20ec('0x59')]['rawAttributes']);_0x5b40c7[_0x20ec('0x3a')]=_[_0x20ec('0x4d')](_0x5dd9c2['query']);_0x5b40c7[_0x20ec('0x3b')]=_['intersection'](_0x5b40c7[_0x20ec('0x38')],_0x5b40c7[_0x20ec('0x3a')]);_0x461ba9['attributes']=_['intersection'](_0x5b40c7[_0x20ec('0x38')],qs[_0x20ec('0x3e')](_0x5dd9c2['query'][_0x20ec('0x3e')]));_0x461ba9[_0x20ec('0x3d')]=_0x461ba9[_0x20ec('0x3d')]['length']?_0x461ba9[_0x20ec('0x3d')]:_0x5b40c7['model'];if(!_0x5dd9c2[_0x20ec('0x3a')]['hasOwnProperty'](_0x20ec('0x40'))){_0x461ba9['limit']=qs[_0x20ec('0x25')](_0x5dd9c2['query'][_0x20ec('0x25')]);_0x461ba9[_0x20ec('0x24')]=qs[_0x20ec('0x24')](_0x5dd9c2[_0x20ec('0x3a')][_0x20ec('0x24')]);}_0x461ba9[_0x20ec('0x5a')]=qs[_0x20ec('0x41')](_0x5dd9c2['query'][_0x20ec('0x41')]);_0x461ba9[_0x20ec('0x42')]=qs[_0x20ec('0x3b')](_['pick'](_0x5dd9c2[_0x20ec('0x3a')],_0x5b40c7[_0x20ec('0x3b')]));_0x461ba9[_0x20ec('0x42')][_0x20ec('0x5b')]=_0x29bccb['id'];if(_0x5dd9c2[_0x20ec('0x3a')][_0x20ec('0x44')]){_0x461ba9['where']=_[_0x20ec('0x45')](_0x461ba9[_0x20ec('0x42')],{'$or':_['map'](_0x461ba9['attributes'],function(_0x38d51a){var _0x435adb={};_0x435adb[_0x38d51a]={'$like':'%'+_0x5dd9c2['query']['filter']+'%'};return _0x435adb;})});}_0x461ba9=_['merge']({},_0x461ba9,_0x5dd9c2[_0x20ec('0x47')]);return db[_0x20ec('0x59')][_0x20ec('0x5c')](_0x461ba9);}})[_0x20ec('0x2d')](function(_0x49bf1c){if(_0x49bf1c){return db[_0x20ec('0x5d')][_0x20ec('0x5e')]({'where':{'id':_[_0x20ec('0x33')](_0x49bf1c,_0x20ec('0x5f')),'role':_0x20ec('0x60')},'attributes':['id',_0x20ec('0x39'),'mailPause','updatedAt',_0x20ec('0x61')]});}})[_0x20ec('0x2d')](function(_0x17d8e2){if(_0x17d8e2){return{'count':_0x17d8e2['count'],'rows':_['map'](_0x17d8e2['rows'],function(_0x1fcef5){return{'membername':_0x1fcef5[_0x20ec('0x39')],'UserId':_0x1fcef5['id'],'queue_name':_0x2db3c0[_0x20ec('0x39')],'MailQueueId':_0x2db3c0['id'],'interface':util['format'](_0x20ec('0x62'),_0x20ec('0x63'),_0x1fcef5[_0x20ec('0x39')]),'penalty':0x0,'paused':_0x1fcef5[_0x20ec('0x64')],'createdAt':_0x1fcef5[_0x20ec('0x61')],'updatedAt':_0x1fcef5[_0x20ec('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x20ec('0x2d')](respondWithFilteredResult(_0x1e9256,_0x461ba9))[_0x20ec('0x4b')](handleError(_0x1e9256,null));};exports[_0x20ec('0x66')]=function(_0x5f3286,_0x54a85f,_0x427edc){var _0x4ae1ec={};var _0x480454={};var _0x532c49;var _0x10c252;return db[_0x20ec('0x34')][_0x20ec('0x58')]({'where':{'id':_0x5f3286[_0x20ec('0x4c')]['id']}})['then'](handleEntityNotFound(_0x54a85f,null))[_0x20ec('0x2d')](function(_0x490d02){if(_0x490d02){_0x532c49=_0x490d02;_0x480454[_0x20ec('0x38')]=_['keys'](db['Team'][_0x20ec('0x35')]);_0x480454[_0x20ec('0x3a')]=_[_0x20ec('0x4d')](_0x5f3286[_0x20ec('0x3a')]);_0x480454[_0x20ec('0x3b')]=_['intersection'](_0x480454[_0x20ec('0x38')],_0x480454['query']);_0x4ae1ec['attributes']=_['intersection'](_0x480454[_0x20ec('0x38')],qs[_0x20ec('0x3e')](_0x5f3286[_0x20ec('0x3a')][_0x20ec('0x3e')]));_0x4ae1ec[_0x20ec('0x3d')]=_0x4ae1ec['attributes']['length']?_0x4ae1ec['attributes']:_0x480454[_0x20ec('0x38')];_0x4ae1ec[_0x20ec('0x5a')]=qs[_0x20ec('0x41')](_0x5f3286[_0x20ec('0x3a')][_0x20ec('0x41')]);_0x4ae1ec['where']=qs[_0x20ec('0x3b')](_[_0x20ec('0x43')](_0x5f3286[_0x20ec('0x3a')],_0x480454[_0x20ec('0x3b')]));if(_0x5f3286[_0x20ec('0x3a')][_0x20ec('0x44')]){_0x4ae1ec[_0x20ec('0x42')]=_[_0x20ec('0x45')](_0x4ae1ec['where'],{'$or':_[_0x20ec('0x33')](_0x4ae1ec[_0x20ec('0x3d')],function(_0x202c87){var _0x42daec={};_0x42daec[_0x202c87]={'$like':'%'+_0x5f3286['query'][_0x20ec('0x44')]+'%'};return _0x42daec;})});}_0x4ae1ec=_[_0x20ec('0x45')]({},_0x4ae1ec,_0x5f3286[_0x20ec('0x47')]);return _0x532c49[_0x20ec('0x66')](_0x4ae1ec);}})[_0x20ec('0x2d')](function(_0x284069){if(_0x284069){_0x10c252=_0x284069[_0x20ec('0x67')];if(!_0x5f3286[_0x20ec('0x3a')][_0x20ec('0x3f')]('nolimit')){_0x4ae1ec[_0x20ec('0x25')]=qs['limit'](_0x5f3286[_0x20ec('0x3a')]['limit']);_0x4ae1ec['offset']=qs['offset'](_0x5f3286[_0x20ec('0x3a')]['offset']);}return _0x532c49['getTeams'](_0x4ae1ec);}})[_0x20ec('0x2d')](function(_0x5b8ed0){if(_0x5b8ed0){return _0x5b8ed0?{'count':_0x10c252,'rows':_0x5b8ed0}:null;}})['then'](respondWithResult(_0x54a85f,null))[_0x20ec('0x4b')](handleError(_0x54a85f,null));};exports[_0x20ec('0x68')]=function(_0x36cad5,_0x40d610,_0x388396){var _0x5f0415=_0x36cad5[_0x20ec('0x55')][_0x20ec('0x69')];return db[_0x20ec('0x6a')]['findAll']({'where':{'id':_0x5f0415},'attributes':['id'],'include':[{'model':db['User'],'as':_0x20ec('0x6b'),'attributes':['id',_0x20ec('0x39'),_0x20ec('0x6c'),_0x20ec('0x6d'),'interface'],'raw':!![]}]})[_0x20ec('0x2d')](function(_0x462272){if(_0x462272){var _0x3d4a89=_['flatMap'](_0x462272,function(_0x1c5ee1){var _0x56fe04=_0x1c5ee1['get']({'plain':!![]});return _0x56fe04[_0x20ec('0x6b')];});return db[_0x20ec('0x34')][_0x20ec('0x52')]({'where':{'id':_0x36cad5[_0x20ec('0x4c')]['id']}})[_0x20ec('0x2d')](function(_0x45dfdc){return db[_0x20ec('0x6e')][_0x20ec('0x6f')](function(_0x1b3271){return _0x45dfdc[_0x20ec('0x68')](_0x5f0415,{'transaction':_0x1b3271})[_0x20ec('0x2d')](function(){return BPromise[_0x20ec('0x70')](_0x3d4a89,function(_0x41d4d9){return db[_0x20ec('0x59')]['findOrCreate']({'where':{'UserId':_0x41d4d9['id'],'MailQueueId':_0x36cad5[_0x20ec('0x4c')]['id']},'transaction':_0x1b3271});});})[_0x20ec('0x2d')](function(){_0x3d4a89['forEach'](function(_0x2fe9e2){socket[_0x20ec('0x71')](_0x20ec('0x72'),{'UserId':_0x2fe9e2['id'],'MailQueueId':_0x45dfdc['id']});});});});});}})['then'](respondWithStatusCode(_0x40d610,null))[_0x20ec('0x4b')](handleError(_0x40d610,null));};exports[_0x20ec('0x73')]=function(_0x48fcea,_0x11e00c,_0x17fec8){return db[_0x20ec('0x6a')][_0x20ec('0x5c')]({'where':{'id':_0x48fcea[_0x20ec('0x3a')][_0x20ec('0x69')]},'attributes':['id'],'include':[{'model':db[_0x20ec('0x5d')],'as':_0x20ec('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x11e00c,null))[_0x20ec('0x2d')](function(_0x3e8ae7){var _0x523bfd=_[_0x20ec('0x33')](_0x3e8ae7,'id');var _0x2b6205=[];var _0x27132d=[];var _0x3c69e1=squel[_0x20ec('0x74')]();_0x3c69e1[_0x20ec('0x75')](_0x20ec('0x76'))[_0x20ec('0x77')](_0x20ec('0x78'),'tq')[_0x20ec('0x79')]('user_has_teams','ut',_0x20ec('0x7a'))['where'](_0x20ec('0x7b'),_0x48fcea[_0x20ec('0x4c')]['id']);for(var _0x474150=0x0;_0x474150<_0x3e8ae7[_0x20ec('0x67')];_0x474150+=0x1){let _0x414424=_0x3e8ae7[_0x474150];for(var _0x5d1f59=0x0;_0x5d1f59<_0x414424[_0x20ec('0x6b')][_0x20ec('0x67')];_0x5d1f59+=0x1){let _0x4bd98c=_0x414424['Agents'][_0x5d1f59];var _0x854bf8=_0x3c69e1[_0x20ec('0x7c')]();_0x854bf8[_0x20ec('0x42')](_0x20ec('0x7d'),_0x4bd98c['id']);_0x27132d[_0x20ec('0x7e')](db[_0x20ec('0x6e')]['query'](_0x854bf8[_0x20ec('0x7f')](),{'type':db[_0x20ec('0x6e')][_0x20ec('0x80')][_0x20ec('0x81')]})[_0x20ec('0x2d')](function(_0xe5828a){if(_0xe5828a[_0x20ec('0x67')]===0x1){return _0x4bd98c['id'];}else{var _0x271064=_['every'](_['map'](_0xe5828a,_0x20ec('0x82')),function(_0x4301fc){return _[_0x20ec('0x83')](_0x523bfd,_0x4301fc);});if(_0x271064){return _0x4bd98c['id'];}}}));}}return BPromise[_0x20ec('0x84')](_0x27132d)[_0x20ec('0x2d')](function(_0x422720){_0x2b6205=_(_0x2b6205)[_0x20ec('0x85')](_0x422720)[_0x20ec('0x86')]()[_0x20ec('0x87')]();return db['MailQueue'][_0x20ec('0x52')]({'where':{'id':_0x48fcea['params']['id']}})[_0x20ec('0x2d')](function(_0x5c557a){return db[_0x20ec('0x6e')]['transaction'](function(_0x48a317){return _0x5c557a[_0x20ec('0x73')](_0x48fcea[_0x20ec('0x3a')][_0x20ec('0x69')],{'transaction':_0x48a317})['then'](function(){if(!_[_0x20ec('0x88')](_0x2b6205)){return _0x5c557a[_0x20ec('0x89')](_0x2b6205,{'transaction':_0x48a317});}})[_0x20ec('0x2d')](function(){_0x2b6205[_0x20ec('0x8a')](function(_0x5d0746){socket[_0x20ec('0x71')](_0x20ec('0x8b'),{'UserId':_0x5d0746,'MailQueueId':_0x5c557a['id']});});});});});});})[_0x20ec('0x2d')](respondWithStatusCode(_0x11e00c,null))[_0x20ec('0x4b')](handleError(_0x11e00c,null));};exports[_0x20ec('0x8c')]=function(_0x18205c,_0x367b01,_0x16e2f1){return db['MailQueue'][_0x20ec('0x52')]({'where':{'id':_0x18205c[_0x20ec('0x4c')]['id']}})['then'](handleEntityNotFound(_0x367b01,null))[_0x20ec('0x2d')](function(_0x375046){if(_0x375046){return _0x375046[_0x20ec('0x8c')](_0x18205c[_0x20ec('0x55')][_0x20ec('0x69')],_[_0x20ec('0x8d')](_0x18205c[_0x20ec('0x55')],[_0x20ec('0x69'),'id'])||{})[_0x20ec('0x8e')](function(_0x3afa03){for(var _0x26e51f=0x0;_0x26e51f<_0x18205c[_0x20ec('0x55')][_0x20ec('0x69')][_0x20ec('0x67')];_0x26e51f+=0x1){socket[_0x20ec('0x71')](_0x20ec('0x72'),{'UserId':Number(_0x18205c['body'][_0x20ec('0x69')][_0x26e51f]),'MailQueueId':Number(_0x18205c[_0x20ec('0x4c')]['id'])});}return _0x3afa03;});}})[_0x20ec('0x2d')](respondWithResult(_0x367b01,null))[_0x20ec('0x4b')](handleError(_0x367b01,null));};exports[_0x20ec('0x89')]=function(_0x511ec3,_0x2cc2c6,_0x31469b){return db['MailQueue'][_0x20ec('0x52')]({'where':{'id':_0x511ec3[_0x20ec('0x4c')]['id']}})[_0x20ec('0x2d')](handleEntityNotFound(_0x2cc2c6,null))['then'](function(_0x5def9d){if(_0x5def9d){return _0x5def9d[_0x20ec('0x89')](_0x511ec3[_0x20ec('0x3a')]['ids'])[_0x20ec('0x2d')](function(){if(_[_0x20ec('0x8f')](_0x511ec3[_0x20ec('0x3a')][_0x20ec('0x69')])){for(var _0x2f3729=0x0;_0x2f3729<_0x511ec3[_0x20ec('0x3a')][_0x20ec('0x69')][_0x20ec('0x67')];_0x2f3729+=0x1){socket['emit'](_0x20ec('0x8b'),{'UserId':Number(_0x511ec3['query']['ids'][_0x2f3729]),'MailQueueId':Number(_0x511ec3[_0x20ec('0x4c')]['id'])});}}else{socket['emit']('userMailQueue:remove',{'UserId':Number(_0x511ec3[_0x20ec('0x3a')][_0x20ec('0x69')]),'MailQueueId':Number(_0x511ec3[_0x20ec('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x2cc2c6,null))[_0x20ec('0x4b')](handleError(_0x2cc2c6,null));};exports['getAgents']=function(_0x4c9eb6,_0x15ae0e,_0xf52de){var _0x1befc6={};var _0x443a16={};var _0x2d7c83;var _0x37c686;return db['MailQueue'][_0x20ec('0x58')]({'where':{'id':_0x4c9eb6[_0x20ec('0x4c')]['id']}})['then'](handleEntityNotFound(_0x15ae0e,null))[_0x20ec('0x2d')](function(_0x5e56f5){if(_0x5e56f5){_0x2d7c83=_0x5e56f5;_0x443a16[_0x20ec('0x38')]=_['keys'](db['User'][_0x20ec('0x35')]);_0x443a16[_0x20ec('0x3a')]=_['keys'](_0x4c9eb6['query']);_0x443a16['filters']=_['intersection'](_0x443a16[_0x20ec('0x38')],_0x443a16['query']);_0x1befc6[_0x20ec('0x3d')]=_[_0x20ec('0x3c')](_0x443a16[_0x20ec('0x38')],qs['fields'](_0x4c9eb6[_0x20ec('0x3a')]['fields']));_0x1befc6[_0x20ec('0x3d')]=_0x1befc6[_0x20ec('0x3d')][_0x20ec('0x67')]?_0x1befc6['attributes']:_0x443a16[_0x20ec('0x38')];_0x1befc6['order']=qs[_0x20ec('0x41')](_0x4c9eb6[_0x20ec('0x3a')][_0x20ec('0x41')]);_0x1befc6[_0x20ec('0x42')]=qs[_0x20ec('0x3b')](_[_0x20ec('0x43')](_0x4c9eb6[_0x20ec('0x3a')],_0x443a16[_0x20ec('0x3b')]));if(_0x4c9eb6['query'][_0x20ec('0x44')]){_0x1befc6[_0x20ec('0x42')]=_['merge'](_0x1befc6[_0x20ec('0x42')],{'$or':_[_0x20ec('0x33')](_0x1befc6[_0x20ec('0x3d')],function(_0x207223){var _0x15691a={};_0x15691a[_0x207223]={'$like':'%'+_0x4c9eb6[_0x20ec('0x3a')][_0x20ec('0x44')]+'%'};return _0x15691a;})});}_0x1befc6=_['merge']({},_0x1befc6,_0x4c9eb6[_0x20ec('0x47')]);return _0x2d7c83[_0x20ec('0x90')](_0x1befc6);}})['then'](function(_0x6e2e7b){if(_0x6e2e7b){_0x37c686=_0x6e2e7b['length'];if(!_0x4c9eb6[_0x20ec('0x3a')][_0x20ec('0x3f')](_0x20ec('0x40'))){_0x1befc6['limit']=qs[_0x20ec('0x25')](_0x4c9eb6[_0x20ec('0x3a')]['limit']);_0x1befc6[_0x20ec('0x24')]=qs[_0x20ec('0x24')](_0x4c9eb6['query']['offset']);}return _0x2d7c83[_0x20ec('0x90')](_0x1befc6);}})['then'](function(_0x380bbe){if(_0x380bbe){return _0x380bbe?{'count':_0x37c686,'rows':_0x380bbe}:null;}})[_0x20ec('0x2d')](respondWithResult(_0x15ae0e,null))[_0x20ec('0x4b')](handleError(_0x15ae0e,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 6d17f78..6b5de4e 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 _0x9449=['MailQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x2bcc6b,_0x20b0d2){var _0x566d6a=function(_0x360220){while(--_0x360220){_0x2bcc6b['push'](_0x2bcc6b['shift']());}};_0x566d6a(++_0x20b0d2);}(_0x9449,0x13a));var _0x9944=function(_0x3dafed,_0x140b24){_0x3dafed=_0x3dafed-0x0;var _0x1b7869=_0x9449[_0x3dafed];return _0x1b7869;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x9944('0x0'))['db'][_0x9944('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x9944('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9944('0x3'),'afterDestroy':_0x9944('0x4')};function emitEvent(_0x2ab36){return function(_0xc219d4,_0xa73b,_0x3e1a20){MailQueueEvents[_0x9944('0x5')](_0x2ab36+':'+_0xc219d4['id'],_0xc219d4);MailQueueEvents[_0x9944('0x5')](_0x2ab36,_0xc219d4);_0x3e1a20(null);};}for(var e in events){if(events[_0x9944('0x6')](e)){var event=events[e];MailQueue[_0x9944('0x7')](e,emitEvent(event));}}module[_0x9944('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x4e8e=['events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xd20708,_0x2766ea){var _0x472619=function(_0x1a95ac){while(--_0x1a95ac){_0xd20708['push'](_0xd20708['shift']());}};_0x472619(++_0x2766ea);}(_0x4e8e,0x190));var _0xe4e8=function(_0x54af90,_0x17ec71){_0x54af90=_0x54af90-0x0;var _0x37da03=_0x4e8e[_0x54af90];return _0x37da03;};'use strict';var EventEmitter=require(_0xe4e8('0x0'));var MailQueue=require(_0xe4e8('0x1'))['db'][_0xe4e8('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xe4e8('0x3')](0x0);var events={'afterCreate':_0xe4e8('0x4'),'afterUpdate':_0xe4e8('0x5'),'afterDestroy':_0xe4e8('0x6')};function emitEvent(_0x91ea90){return function(_0x3839cb,_0x24d32c,_0x5f583e){MailQueueEvents['emit'](_0x91ea90+':'+_0x3839cb['id'],_0x3839cb);MailQueueEvents[_0xe4e8('0x7')](_0x91ea90,_0x3839cb);_0x5f583e(null);};}for(var e in events){if(events[_0xe4e8('0x8')](e)){var event=events[e];MailQueue[_0xe4e8('0x9')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index bdc6d04..d9f195f 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 _0x6862=['rimraf','../../config/environment','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x6862,0xd8));var _0x2686=function(_0x503d5c,_0x3ac3d4){_0x503d5c=_0x503d5c-0x0;var _0x1c103f=_0x6862[_0x503d5c];return _0x1c103f;};'use strict';var _=require(_0x2686('0x0'));var util=require(_0x2686('0x1'));var logger=require(_0x2686('0x2'))(_0x2686('0x3'));var moment=require(_0x2686('0x4'));var BPromise=require(_0x2686('0x5'));var rp=require(_0x2686('0x6'));var fs=require('fs');var path=require(_0x2686('0x7'));var rimraf=require(_0x2686('0x8'));var config=require(_0x2686('0x9'));var attributes=require('./mailQueue.attributes');module[_0x2686('0xa')]=function(_0x1eb309,_0x366566){return _0x1eb309[_0x2686('0xb')](_0x2686('0xc'),attributes,{'tableName':_0x2686('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf806=['moment','request-promise','rimraf','define','MailQueue','mail_queues','lodash','util','../../config/logger','api'];(function(_0xf313bc,_0x534061){var _0x3f48c1=function(_0x3c7087){while(--_0x3c7087){_0xf313bc['push'](_0xf313bc['shift']());}};_0x3f48c1(++_0x534061);}(_0xf806,0x178));var _0x6f80=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf806[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6f80('0x0'));var util=require(_0x6f80('0x1'));var logger=require(_0x6f80('0x2'))(_0x6f80('0x3'));var moment=require(_0x6f80('0x4'));var BPromise=require('bluebird');var rp=require(_0x6f80('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f80('0x6'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module['exports']=function(_0x3d91de,_0x4419d4){return _0x3d91de[_0x6f80('0x7')](_0x6f80('0x8'),attributes,{'tableName':_0x6f80('0x9'),'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 f3bfd2f..8affe9c 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 _0xc48a=['socket.io-emitter','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetMailQueue','ShowMailQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x2d6676,_0x52d9b4){var _0x252e51=function(_0x587380){while(--_0x587380){_0x2d6676['push'](_0x2d6676['shift']());}};_0x252e51(++_0x52d9b4);}(_0xc48a,0x1ea));var _0xac48=function(_0x5213ac,_0x57299c){_0x5213ac=_0x5213ac-0x0;var _0x282494=_0xc48a[_0x5213ac];return _0x282494;};'use strict';var _=require('lodash');var util=require(_0xac48('0x0'));var moment=require(_0xac48('0x1'));var BPromise=require(_0xac48('0x2'));var rs=require(_0xac48('0x3'));var fs=require('fs');var Redis=require(_0xac48('0x4'));var db=require(_0xac48('0x5'))['db'];var utils=require(_0xac48('0x6'));var logger=require(_0xac48('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xac48('0x8'));var client=jayson[_0xac48('0x9')][_0xac48('0xa')]({'port':0x232a});config[_0xac48('0xb')]=_[_0xac48('0xc')](config[_0xac48('0xb')],{'host':_0xac48('0xd'),'port':0x18eb});var socket=require(_0xac48('0xe'))(new Redis(config[_0xac48('0xb')]));require('./mailQueue.socket')[_0xac48('0xf')](socket);function respondWithRpcPromise(_0x18ea5e,_0x456cb4,_0x36bb9b){return new BPromise(function(_0x48abe0,_0x12fc49){return client[_0xac48('0x10')](_0x18ea5e,_0x36bb9b)[_0xac48('0x11')](function(_0x27b094){logger[_0xac48('0x12')](_0xac48('0x13'),_0x456cb4,_0xac48('0x14'));logger[_0xac48('0x15')](_0xac48('0x16'),_0x456cb4,_0xac48('0x14'),JSON[_0xac48('0x17')](_0x27b094));if(_0x27b094['error']){if(_0x27b094[_0xac48('0x18')][_0xac48('0x19')]===0x1f4){logger[_0xac48('0x18')](_0xac48('0x13'),_0x456cb4,_0x27b094[_0xac48('0x18')]['message']);return _0x12fc49(_0x27b094[_0xac48('0x18')][_0xac48('0x1a')]);}logger[_0xac48('0x18')]('MailQueue,\x20%s,\x20%s',_0x456cb4,_0x27b094[_0xac48('0x18')][_0xac48('0x1a')]);return _0x48abe0(_0x27b094[_0xac48('0x18')][_0xac48('0x1a')]);}else{logger[_0xac48('0x12')]('MailQueue,\x20%s,\x20%s',_0x456cb4,_0xac48('0x14'));_0x48abe0(_0x27b094[_0xac48('0x1b')][_0xac48('0x1a')]);}})[_0xac48('0x1c')](function(_0x16f12a){logger[_0xac48('0x18')](_0xac48('0x13'),_0x456cb4,_0x16f12a);_0x12fc49(_0x16f12a);});});}exports['GetMailQueue']=function(_0x1214ce){var _0x558ecb=this;return new Promise(function(_0x3f02a9,_0xc16b43){return db[_0xac48('0x1d')][_0xac48('0x1e')]({'raw':_0x1214ce[_0xac48('0x1f')]?_0x1214ce[_0xac48('0x1f')][_0xac48('0x20')]===undefined?!![]:![]:!![],'where':_0x1214ce['options']?_0x1214ce[_0xac48('0x1f')][_0xac48('0x21')]||null:null,'attributes':_0x1214ce[_0xac48('0x1f')]?_0x1214ce[_0xac48('0x1f')][_0xac48('0x22')]||null:null,'limit':_0x1214ce[_0xac48('0x1f')]?_0x1214ce[_0xac48('0x1f')][_0xac48('0x23')]||null:null,'include':_0x1214ce[_0xac48('0x1f')]?_0x1214ce[_0xac48('0x1f')][_0xac48('0x24')]?_[_0xac48('0x25')](_0x1214ce['options']['include'],function(_0x43edd2){return{'model':db[_0x43edd2['model']],'as':_0x43edd2['as'],'attributes':_0x43edd2[_0xac48('0x22')],'include':_0x43edd2[_0xac48('0x24')]?_[_0xac48('0x25')](_0x43edd2[_0xac48('0x24')],function(_0x59ff74){return{'model':db[_0x59ff74['model']],'as':_0x59ff74['as'],'attributes':_0x59ff74[_0xac48('0x22')],'include':_0x59ff74['include']?_[_0xac48('0x25')](_0x59ff74[_0xac48('0x24')],function(_0x5a37c4){return{'model':db[_0x5a37c4[_0xac48('0x26')]],'as':_0x5a37c4['as'],'attributes':_0x5a37c4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x445345){logger[_0xac48('0x12')]('GetMailQueue',_0x1214ce);logger[_0xac48('0x15')](_0xac48('0x27'),_0x1214ce,JSON[_0xac48('0x17')](_0x445345));_0x3f02a9(_0x445345);})['catch'](function(_0xf1c91d){logger[_0xac48('0x18')](_0xac48('0x27'),_0xf1c91d[_0xac48('0x1a')],_0x1214ce);_0xc16b43(_0x558ecb['error'](0x1f4,_0xf1c91d['message']));});});};exports[_0xac48('0x28')]=function(_0x31ad25){var _0x2ef58d=this;return new Promise(function(_0x5f2e7d,_0x1a5a9d){return db[_0xac48('0x1d')][_0xac48('0x29')]({'raw':_0x31ad25[_0xac48('0x1f')]?_0x31ad25[_0xac48('0x1f')][_0xac48('0x20')]===undefined?!![]:![]:!![],'where':_0x31ad25[_0xac48('0x1f')]?_0x31ad25[_0xac48('0x1f')][_0xac48('0x21')]||null:null,'attributes':_0x31ad25[_0xac48('0x1f')]?_0x31ad25[_0xac48('0x1f')][_0xac48('0x22')]||null:null,'include':_0x31ad25[_0xac48('0x1f')]?_0x31ad25[_0xac48('0x1f')]['include']?_['map'](_0x31ad25[_0xac48('0x1f')][_0xac48('0x24')],function(_0x38225f){return{'model':db[_0x38225f[_0xac48('0x26')]],'as':_0x38225f['as'],'attributes':_0x38225f[_0xac48('0x22')],'include':_0x38225f[_0xac48('0x24')]?_[_0xac48('0x25')](_0x38225f[_0xac48('0x24')],function(_0x5c5d61){return{'model':db[_0x5c5d61[_0xac48('0x26')]],'as':_0x5c5d61['as'],'attributes':_0x5c5d61[_0xac48('0x22')],'include':_0x5c5d61['include']?_['map'](_0x5c5d61[_0xac48('0x24')],function(_0x3e8e15){return{'model':db[_0x3e8e15['model']],'as':_0x3e8e15['as'],'attributes':_0x3e8e15['attributes']};}):[]};}):[]};}):[]:[]})[_0xac48('0x11')](function(_0x2ffdff){logger['info'](_0xac48('0x28'),_0x31ad25);logger['debug'](_0xac48('0x28'),_0x31ad25,JSON[_0xac48('0x17')](_0x2ffdff));_0x5f2e7d(_0x2ffdff);})[_0xac48('0x1c')](function(_0x58f2cc){logger['error'](_0xac48('0x28'),_0x58f2cc[_0xac48('0x1a')],_0x31ad25);_0x1a5a9d(_0x2ef58d[_0xac48('0x18')](0x1f4,_0x58f2cc[_0xac48('0x1a')]));});});}; \ No newline at end of file +var _0x3dad=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','./mailQueue.socket','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailQueue','find','lodash','util','bluebird','ioredis'];(function(_0x304fcf,_0x646b3f){var _0x495560=function(_0x4f01b4){while(--_0x4f01b4){_0x304fcf['push'](_0x304fcf['shift']());}};_0x495560(++_0x646b3f);}(_0x3dad,0x106));var _0xd3da=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3dad[_0x432682];return _0x463d05;};'use strict';var _=require(_0xd3da('0x0'));var util=require(_0xd3da('0x1'));var moment=require('moment');var BPromise=require(_0xd3da('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3da('0x3'));var db=require(_0xd3da('0x4'))['db'];var utils=require(_0xd3da('0x5'));var logger=require(_0xd3da('0x6'))(_0xd3da('0x7'));var config=require(_0xd3da('0x8'));var jayson=require(_0xd3da('0x9'));var client=jayson[_0xd3da('0xa')][_0xd3da('0xb')]({'port':0x232a});config['redis']=_[_0xd3da('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd3da('0xd'))(new Redis(config['redis']));require(_0xd3da('0xe'))['register'](socket);function respondWithRpcPromise(_0x2eec05,_0x564213,_0x3cd96b){return new BPromise(function(_0x403102,_0x105fb9){return client[_0xd3da('0xf')](_0x2eec05,_0x3cd96b)[_0xd3da('0x10')](function(_0x42a42a){logger['info'](_0xd3da('0x11'),_0x564213,_0xd3da('0x12'));logger[_0xd3da('0x13')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x564213,_0xd3da('0x12'),JSON[_0xd3da('0x14')](_0x42a42a));if(_0x42a42a['error']){if(_0x42a42a[_0xd3da('0x15')]['code']===0x1f4){logger[_0xd3da('0x15')](_0xd3da('0x11'),_0x564213,_0x42a42a[_0xd3da('0x15')]['message']);return _0x105fb9(_0x42a42a[_0xd3da('0x15')][_0xd3da('0x16')]);}logger[_0xd3da('0x15')]('MailQueue,\x20%s,\x20%s',_0x564213,_0x42a42a[_0xd3da('0x15')][_0xd3da('0x16')]);return _0x403102(_0x42a42a[_0xd3da('0x15')][_0xd3da('0x16')]);}else{logger[_0xd3da('0x17')]('MailQueue,\x20%s,\x20%s',_0x564213,_0xd3da('0x12'));_0x403102(_0x42a42a['result'][_0xd3da('0x16')]);}})[_0xd3da('0x18')](function(_0x198e6a){logger['error'](_0xd3da('0x11'),_0x564213,_0x198e6a);_0x105fb9(_0x198e6a);});});}exports[_0xd3da('0x19')]=function(_0x49b5ab){var _0x21f2d5=this;return new Promise(function(_0x10de28,_0xbd52d){return db[_0xd3da('0x1a')][_0xd3da('0x1b')]({'raw':_0x49b5ab[_0xd3da('0x1c')]?_0x49b5ab[_0xd3da('0x1c')][_0xd3da('0x1d')]===undefined?!![]:![]:!![],'where':_0x49b5ab['options']?_0x49b5ab[_0xd3da('0x1c')][_0xd3da('0x1e')]||null:null,'attributes':_0x49b5ab[_0xd3da('0x1c')]?_0x49b5ab[_0xd3da('0x1c')][_0xd3da('0x1f')]||null:null,'limit':_0x49b5ab['options']?_0x49b5ab[_0xd3da('0x1c')][_0xd3da('0x20')]||null:null,'include':_0x49b5ab[_0xd3da('0x1c')]?_0x49b5ab[_0xd3da('0x1c')][_0xd3da('0x21')]?_[_0xd3da('0x22')](_0x49b5ab[_0xd3da('0x1c')]['include'],function(_0x7a703a){return{'model':db[_0x7a703a['model']],'as':_0x7a703a['as'],'attributes':_0x7a703a[_0xd3da('0x1f')],'include':_0x7a703a[_0xd3da('0x21')]?_[_0xd3da('0x22')](_0x7a703a[_0xd3da('0x21')],function(_0x49ec2d){return{'model':db[_0x49ec2d[_0xd3da('0x23')]],'as':_0x49ec2d['as'],'attributes':_0x49ec2d[_0xd3da('0x1f')],'include':_0x49ec2d[_0xd3da('0x21')]?_[_0xd3da('0x22')](_0x49ec2d[_0xd3da('0x21')],function(_0x7ecfdd){return{'model':db[_0x7ecfdd['model']],'as':_0x7ecfdd['as'],'attributes':_0x7ecfdd[_0xd3da('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd3da('0x10')](function(_0x527daf){logger[_0xd3da('0x17')](_0xd3da('0x19'),_0x49b5ab);logger[_0xd3da('0x13')](_0xd3da('0x19'),_0x49b5ab,JSON[_0xd3da('0x14')](_0x527daf));_0x10de28(_0x527daf);})[_0xd3da('0x18')](function(_0x297b01){logger[_0xd3da('0x15')](_0xd3da('0x19'),_0x297b01['message'],_0x49b5ab);_0xbd52d(_0x21f2d5[_0xd3da('0x15')](0x1f4,_0x297b01[_0xd3da('0x16')]));});});};exports[_0xd3da('0x24')]=function(_0x23d856){var _0x52ffbc=this;return new Promise(function(_0x37c1a1,_0x248677){return db[_0xd3da('0x1a')][_0xd3da('0x25')]({'raw':_0x23d856[_0xd3da('0x1c')]?_0x23d856[_0xd3da('0x1c')][_0xd3da('0x1d')]===undefined?!![]:![]:!![],'where':_0x23d856[_0xd3da('0x1c')]?_0x23d856[_0xd3da('0x1c')][_0xd3da('0x1e')]||null:null,'attributes':_0x23d856[_0xd3da('0x1c')]?_0x23d856[_0xd3da('0x1c')]['attributes']||null:null,'include':_0x23d856[_0xd3da('0x1c')]?_0x23d856[_0xd3da('0x1c')]['include']?_[_0xd3da('0x22')](_0x23d856[_0xd3da('0x1c')][_0xd3da('0x21')],function(_0x2198a2){return{'model':db[_0x2198a2[_0xd3da('0x23')]],'as':_0x2198a2['as'],'attributes':_0x2198a2['attributes'],'include':_0x2198a2['include']?_[_0xd3da('0x22')](_0x2198a2[_0xd3da('0x21')],function(_0x2eccac){return{'model':db[_0x2eccac[_0xd3da('0x23')]],'as':_0x2eccac['as'],'attributes':_0x2eccac[_0xd3da('0x1f')],'include':_0x2eccac['include']?_[_0xd3da('0x22')](_0x2eccac['include'],function(_0x1bf9d9){return{'model':db[_0x1bf9d9[_0xd3da('0x23')]],'as':_0x1bf9d9['as'],'attributes':_0x1bf9d9[_0xd3da('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd3da('0x10')](function(_0x5e8ab3){logger[_0xd3da('0x17')](_0xd3da('0x24'),_0x23d856);logger[_0xd3da('0x13')](_0xd3da('0x24'),_0x23d856,JSON[_0xd3da('0x14')](_0x5e8ab3));_0x37c1a1(_0x5e8ab3);})['catch'](function(_0x24560f){logger[_0xd3da('0x15')](_0xd3da('0x24'),_0x24560f['message'],_0x23d856);_0x248677(_0x52ffbc[_0xd3da('0x15')](0x1f4,_0x24560f['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index fb7e310..fb75e23 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 _0x45d3=['save','remove','update','emit','removeListener','register','length','mailQueue:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x45d3,0x148));var _0x345d=function(_0x4ea489,_0x36fcb1){_0x4ea489=_0x4ea489-0x0;var _0x4fa873=_0x45d3[_0x4ea489];return _0x4fa873;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x345d('0x0'),_0x345d('0x1'),_0x345d('0x2')];function createListener(_0x25e275,_0x27e56c){return function(_0xb04cf2){_0x27e56c[_0x345d('0x3')](_0x25e275,_0xb04cf2);};}function removeListener(_0x153443,_0xaa7b7e){return function(){MailQueueEvents[_0x345d('0x4')](_0x153443,_0xaa7b7e);};}exports[_0x345d('0x5')]=function(_0x40f2ab){for(var _0x459be2=0x0,_0x15dfe2=events[_0x345d('0x6')];_0x459be2<_0x15dfe2;_0x459be2++){var _0x5404a9=events[_0x459be2];var _0x58a743=createListener(_0x345d('0x7')+_0x5404a9,_0x40f2ab);MailQueueEvents['on'](_0x5404a9,_0x58a743);}}; \ No newline at end of file +var _0x12c1=['./mailQueue.events','save','remove','update','emit','length'];(function(_0x3dd603,_0x4eda35){var _0x3ce3aa=function(_0x1c896b){while(--_0x1c896b){_0x3dd603['push'](_0x3dd603['shift']());}};_0x3ce3aa(++_0x4eda35);}(_0x12c1,0x9c));var _0x112c=function(_0x4b7603,_0x482e94){_0x4b7603=_0x4b7603-0x0;var _0x3fe096=_0x12c1[_0x4b7603];return _0x3fe096;};'use strict';var MailQueueEvents=require(_0x112c('0x0'));var events=[_0x112c('0x1'),_0x112c('0x2'),_0x112c('0x3')];function createListener(_0x4486a7,_0x2c9530){return function(_0x31133d){_0x2c9530[_0x112c('0x4')](_0x4486a7,_0x31133d);};}function removeListener(_0x393769,_0x170de0){return function(){MailQueueEvents['removeListener'](_0x393769,_0x170de0);};}exports['register']=function(_0x2350bb){for(var _0x287485=0x0,_0x5390f2=events[_0x112c('0x5')];_0x287485<_0x5390f2;_0x287485++){var _0x4d9a52=events[_0x287485];var _0x5a9981=createListener('mailQueue:'+_0x4d9a52,_0x2350bb);MailQueueEvents['on'](_0x4d9a52,_0x5a9981);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index ad2290d..fec6ce8 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 _0x6453=['multer','util','path','connect-timeout','express','Router','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','delete','destroy','exports'];(function(_0x51bac5,_0x43760e){var _0x21d38c=function(_0xc11d8d){while(--_0xc11d8d){_0x51bac5['push'](_0x51bac5['shift']());}};_0x21d38c(++_0x43760e);}(_0x6453,0x1db));var _0x3645=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x6453[_0x5ddaac];return _0x2a9c58;};'use strict';var multer=require(_0x3645('0x0'));var util=require(_0x3645('0x1'));var path=require(_0x3645('0x2'));var timeout=require(_0x3645('0x3'));var express=require(_0x3645('0x4'));var router=express[_0x3645('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3645('0x6'));var controller=require(_0x3645('0x7'));router['get']('/',auth[_0x3645('0x8')](),controller[_0x3645('0x9')]);router[_0x3645('0xa')]('/describe',auth[_0x3645('0x8')](),controller[_0x3645('0xb')]);router[_0x3645('0xa')](_0x3645('0xc'),auth['isAuthenticated'](),controller[_0x3645('0xd')]);router[_0x3645('0xe')]('/',auth[_0x3645('0x8')](),controller[_0x3645('0xf')]);router['put'](_0x3645('0xc'),auth[_0x3645('0x8')](),controller['update']);router[_0x3645('0x10')](_0x3645('0xc'),auth[_0x3645('0x8')](),controller[_0x3645('0x11')]);module[_0x3645('0x12')]=router; \ No newline at end of file +var _0x46a4=['create','put','update','delete','destroy','multer','connect-timeout','express','Router','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','/describe','describe','get','/:id'];(function(_0x407867,_0x126b05){var _0x17e975=function(_0x366ce4){while(--_0x366ce4){_0x407867['push'](_0x407867['shift']());}};_0x17e975(++_0x126b05);}(_0x46a4,0x9e));var _0x446a=function(_0x3f00ea,_0x3f286d){_0x3f00ea=_0x3f00ea-0x0;var _0x16eff4=_0x46a4[_0x3f00ea];return _0x16eff4;};'use strict';var multer=require(_0x446a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x446a('0x1'));var express=require(_0x446a('0x2'));var router=express[_0x446a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x446a('0x4'));var controller=require(_0x446a('0x5'));router['get']('/',auth[_0x446a('0x6')](),controller[_0x446a('0x7')]);router['get'](_0x446a('0x8'),auth[_0x446a('0x6')](),controller[_0x446a('0x9')]);router[_0x446a('0xa')](_0x446a('0xb'),auth[_0x446a('0x6')](),controller['show']);router['post']('/',auth[_0x446a('0x6')](),controller[_0x446a('0xc')]);router[_0x446a('0xd')]('/:id',auth[_0x446a('0x6')](),controller[_0x446a('0xe')]);router[_0x446a('0xf')](_0x446a('0xb'),auth[_0x446a('0x6')](),controller[_0x446a('0x10')]);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 a8181f5..009b572 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 _0xcf12=['STRING','DATE','sequelize'];(function(_0x4324c2,_0x4402b5){var _0x4a9725=function(_0x31e2fb){while(--_0x31e2fb){_0x4324c2['push'](_0x4324c2['shift']());}};_0x4a9725(++_0x4402b5);}(_0xcf12,0x140));var _0x2cf1=function(_0x25d2f6,_0x306632){_0x25d2f6=_0x25d2f6-0x0;var _0xbfd476=_0xcf12[_0x25d2f6];return _0xbfd476;};'use strict';var moment=require('moment');var Sequelize=require(_0x2cf1('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x2cf1('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x2cf1('0x1')]},'joinAt':{'type':Sequelize[_0x2cf1('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2cf1('0x2')]},'exitAt':{'type':Sequelize[_0x2cf1('0x2')]},'reason':{'type':Sequelize[_0x2cf1('0x1')]}}; \ No newline at end of file +var _0x8cf5=['STRING','DATE','moment','exports'];(function(_0x4a17bb,_0x484ca9){var _0x758be=function(_0x2dc416){while(--_0x2dc416){_0x4a17bb['push'](_0x4a17bb['shift']());}};_0x758be(++_0x484ca9);}(_0x8cf5,0x1e2));var _0x58cf=function(_0x3619b9,_0x3c68cc){_0x3619b9=_0x3619b9-0x0;var _0x5724cc=_0x8cf5[_0x3619b9];return _0x5724cc;};'use strict';var moment=require(_0x58cf('0x0'));var Sequelize=require('sequelize');module[_0x58cf('0x1')]={'uniqueid':{'type':Sequelize[_0x58cf('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x58cf('0x3')]},'exitAt':{'type':Sequelize[_0x58cf('0x3')]},'reason':{'type':Sequelize[_0x58cf('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 02f7d72..3537772 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 _0x8f4c=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','merge','options','MailQueueReport','includeAll','include','findAll','catch','show','params','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x141c05,_0x319076){var _0x25fa28=function(_0x56f1c0){while(--_0x56f1c0){_0x141c05['push'](_0x141c05['shift']());}};_0x25fa28(++_0x319076);}(_0x8f4c,0x113));var _0xc8f4=function(_0x10fdc3,_0x2ac01f){_0x10fdc3=_0x10fdc3-0x0;var _0xd7c0c2=_0x8f4c[_0x10fdc3];return _0xd7c0c2;};'use strict';var emlformat=require(_0xc8f4('0x0'));var rimraf=require(_0xc8f4('0x1'));var zipdir=require(_0xc8f4('0x2'));var jsonpatch=require(_0xc8f4('0x3'));var rp=require(_0xc8f4('0x4'));var moment=require(_0xc8f4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc8f4('0x6'));var util=require(_0xc8f4('0x7'));var path=require(_0xc8f4('0x8'));var sox=require('sox');var csv=require(_0xc8f4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc8f4('0xa'));var crypto=require('crypto');var jsforce=require(_0xc8f4('0xb'));var deskjs=require(_0xc8f4('0xc'));var toCsv=require(_0xc8f4('0x9'));var querystring=require(_0xc8f4('0xd'));var Papa=require(_0xc8f4('0xe'));var Redis=require('ioredis');var authService=require(_0xc8f4('0xf'));var qs=require(_0xc8f4('0x10'));var as=require(_0xc8f4('0x11'));var hardwareService=require(_0xc8f4('0x12'));var logger=require('../../config/logger')(_0xc8f4('0x13'));var utils=require('../../config/utils');var config=require(_0xc8f4('0x14'));var licenseUtil=require(_0xc8f4('0x15'));var db=require(_0xc8f4('0x16'))['db'];function respondWithStatusCode(_0x729f8f,_0x39b785){_0x39b785=_0x39b785||0xcc;return function(_0x4e31cf){if(_0x4e31cf){return _0x729f8f[_0xc8f4('0x17')](_0x39b785);}return _0x729f8f[_0xc8f4('0x18')](_0x39b785)[_0xc8f4('0x19')]();};}function respondWithResult(_0x14bc11,_0x1dcee5){_0x1dcee5=_0x1dcee5||0xc8;return function(_0x411c5c){if(_0x411c5c){return _0x14bc11['status'](_0x1dcee5)[_0xc8f4('0x1a')](_0x411c5c);}};}function respondWithFilteredResult(_0x2c7bc1,_0x1518a6){return function(_0x46ac15){if(_0x46ac15){var _0x22c08a=typeof _0x1518a6['offset']===_0xc8f4('0x1b')&&typeof _0x1518a6['limit']==='undefined';var _0x14bc02=_0x46ac15[_0xc8f4('0x1c')];var _0x108076=_0x22c08a?0x0:_0x1518a6[_0xc8f4('0x1d')];var _0x4763c1=_0x22c08a?_0x46ac15[_0xc8f4('0x1c')]:_0x1518a6[_0xc8f4('0x1d')]+_0x1518a6[_0xc8f4('0x1e')];var _0x1982bb;if(_0x4763c1>=_0x14bc02){_0x4763c1=_0x14bc02;_0x1982bb=0xc8;}else{_0x1982bb=0xce;}_0x2c7bc1[_0xc8f4('0x18')](_0x1982bb);return _0x2c7bc1[_0xc8f4('0x1f')](_0xc8f4('0x20'),_0x108076+'-'+_0x4763c1+'/'+_0x14bc02)[_0xc8f4('0x1a')](_0x46ac15);}return null;};}function patchUpdates(_0x5f3264){return function(_0x378f56){try{jsonpatch[_0xc8f4('0x21')](_0x378f56,_0x5f3264,!![]);}catch(_0x29e52d){return BPromise[_0xc8f4('0x22')](_0x29e52d);}return _0x378f56[_0xc8f4('0x23')]();};}function saveUpdates(_0x3b42ee,_0xaeee7d){return function(_0x43eb57){if(_0x43eb57){return _0x43eb57['update'](_0x3b42ee)[_0xc8f4('0x24')](function(_0x205c41){return _0x205c41;});}return null;};}function removeEntity(_0x3195ff,_0x1d159e){return function(_0x5d54a9){if(_0x5d54a9){return _0x5d54a9[_0xc8f4('0x25')]()['then'](function(){_0x3195ff[_0xc8f4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x177a44,_0x3dd717){return function(_0x5c94c6){if(!_0x5c94c6){_0x177a44[_0xc8f4('0x17')](0x194);}return _0x5c94c6;};}function handleError(_0x21062f,_0x11f766){_0x11f766=_0x11f766||0x1f4;return function(_0x2fa052){logger['error'](_0x2fa052[_0xc8f4('0x26')]);if(_0x2fa052[_0xc8f4('0x27')]){delete _0x2fa052['name'];}_0x21062f[_0xc8f4('0x18')](_0x11f766)[_0xc8f4('0x28')](_0x2fa052);};}exports[_0xc8f4('0x29')]=function(_0x1b70bc,_0x24bef0){var _0x385e41={},_0x4a25da={},_0x45f972={'count':0x0,'rows':[]};var _0x24bb78=_[_0xc8f4('0x2a')](db['MailQueueReport'][_0xc8f4('0x2b')],function(_0x3a4b1b){return{'name':_0x3a4b1b['fieldName'],'type':_0x3a4b1b['type']['key']};});_0x4a25da[_0xc8f4('0x2c')]=_[_0xc8f4('0x2a')](_0x24bb78,_0xc8f4('0x27'));_0x4a25da[_0xc8f4('0x2d')]=_[_0xc8f4('0x2e')](_0x1b70bc[_0xc8f4('0x2d')]);_0x4a25da[_0xc8f4('0x2f')]=_[_0xc8f4('0x30')](_0x4a25da['model'],_0x4a25da[_0xc8f4('0x2d')]);_0x385e41[_0xc8f4('0x31')]=_[_0xc8f4('0x30')](_0x4a25da['model'],qs[_0xc8f4('0x32')](_0x1b70bc[_0xc8f4('0x2d')]['fields']));_0x385e41[_0xc8f4('0x31')]=_0x385e41[_0xc8f4('0x31')][_0xc8f4('0x33')]?_0x385e41['attributes']:_0x4a25da[_0xc8f4('0x2c')];if(!_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x34')]('nolimit')){_0x385e41[_0xc8f4('0x1e')]=qs[_0xc8f4('0x1e')](_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x1e')]);_0x385e41[_0xc8f4('0x1d')]=qs[_0xc8f4('0x1d')](_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x1d')]);}_0x385e41[_0xc8f4('0x35')]=qs[_0xc8f4('0x36')](_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x36')]);_0x385e41[_0xc8f4('0x37')]=qs[_0xc8f4('0x2f')](_[_0xc8f4('0x38')](_0x1b70bc[_0xc8f4('0x2d')],_0x4a25da['filters']),_0x24bb78);if(_0x1b70bc[_0xc8f4('0x2d')]['filter']){_0x385e41[_0xc8f4('0x37')]=_['merge'](_0x385e41[_0xc8f4('0x37')],{'$or':_[_0xc8f4('0x2a')](_0x24bb78,function(_0x7ef69a){if(_0x7ef69a[_0xc8f4('0x39')]!==_0xc8f4('0x3a')){var _0x724060={};_0x724060[_0x7ef69a[_0xc8f4('0x27')]]={'$like':'%'+_0x1b70bc['query'][_0xc8f4('0x3b')]+'%'};return _0x724060;}})});}_0x385e41=_[_0xc8f4('0x3c')]({},_0x385e41,_0x1b70bc[_0xc8f4('0x3d')]);var _0x14ce2e={'where':_0x385e41['where']};return db[_0xc8f4('0x3e')][_0xc8f4('0x1c')](_0x14ce2e)[_0xc8f4('0x24')](function(_0x1d0b2d){_0x45f972[_0xc8f4('0x1c')]=_0x1d0b2d;if(_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x3f')]){_0x385e41[_0xc8f4('0x40')]=[{'all':!![]}];}return db[_0xc8f4('0x3e')][_0xc8f4('0x41')](_0x385e41);})[_0xc8f4('0x24')](function(_0xd56415){_0x45f972['rows']=_0xd56415;return _0x45f972;})[_0xc8f4('0x24')](respondWithFilteredResult(_0x24bef0,_0x385e41))[_0xc8f4('0x42')](handleError(_0x24bef0,null));};exports[_0xc8f4('0x43')]=function(_0x275f4a,_0x588ff9){var _0x49da16={'raw':!![],'where':{'id':_0x275f4a[_0xc8f4('0x44')]['id']}},_0x413a55={};_0x413a55['model']=_[_0xc8f4('0x2e')](db[_0xc8f4('0x3e')]['rawAttributes']);_0x413a55['query']=_[_0xc8f4('0x2e')](_0x275f4a[_0xc8f4('0x2d')]);_0x413a55[_0xc8f4('0x2f')]=_[_0xc8f4('0x30')](_0x413a55[_0xc8f4('0x2c')],_0x413a55[_0xc8f4('0x2d')]);_0x49da16['attributes']=_['intersection'](_0x413a55[_0xc8f4('0x2c')],qs[_0xc8f4('0x32')](_0x275f4a[_0xc8f4('0x2d')]['fields']));_0x49da16['attributes']=_0x49da16['attributes']['length']?_0x49da16['attributes']:_0x413a55[_0xc8f4('0x2c')];if(_0x275f4a[_0xc8f4('0x2d')][_0xc8f4('0x3f')]){_0x49da16[_0xc8f4('0x40')]=[{'all':!![]}];}_0x49da16=_[_0xc8f4('0x3c')]({},_0x49da16,_0x275f4a[_0xc8f4('0x3d')]);return db['MailQueueReport'][_0xc8f4('0x45')](_0x49da16)[_0xc8f4('0x24')](handleEntityNotFound(_0x588ff9,null))['then'](respondWithResult(_0x588ff9,null))['catch'](handleError(_0x588ff9,null));};exports[_0xc8f4('0x46')]=function(_0x82a5e,_0x3ca0d6){return db[_0xc8f4('0x3e')]['create'](_0x82a5e['body'],{})[_0xc8f4('0x24')](respondWithResult(_0x3ca0d6,0xc9))[_0xc8f4('0x42')](handleError(_0x3ca0d6,null));};exports[_0xc8f4('0x47')]=function(_0x2bc4db,_0x141f81){if(_0x2bc4db[_0xc8f4('0x48')]['id']){delete _0x2bc4db['body']['id'];}return db['MailQueueReport'][_0xc8f4('0x45')]({'where':{'id':_0x2bc4db[_0xc8f4('0x44')]['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x141f81,null))[_0xc8f4('0x24')](saveUpdates(_0x2bc4db[_0xc8f4('0x48')],null))[_0xc8f4('0x24')](respondWithResult(_0x141f81,null))[_0xc8f4('0x42')](handleError(_0x141f81,null));};exports[_0xc8f4('0x25')]=function(_0x3d9d67,_0x5b4035){return db['MailQueueReport'][_0xc8f4('0x45')]({'where':{'id':_0x3d9d67[_0xc8f4('0x44')]['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x5b4035,null))[_0xc8f4('0x24')](removeEntity(_0x5b4035,null))[_0xc8f4('0x42')](handleError(_0x5b4035,null));};exports[_0xc8f4('0x49')]=function(_0x4715f3,_0x36c304){return db[_0xc8f4('0x3e')][_0xc8f4('0x49')]()[_0xc8f4('0x24')](respondWithResult(_0x36c304,null))[_0xc8f4('0x42')](handleError(_0x36c304,null));}; \ No newline at end of file +var _0x6050=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','jsforce','desk.js','to-csv','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','Content-Range','apply','reject','save','then','destroy','name','send','index','map','MailQueueReport','rawAttributes','type','key','model','query','keys'];(function(_0x1e74cc,_0x155e31){var _0x41ab97=function(_0x3e7012){while(--_0x3e7012){_0x1e74cc['push'](_0x1e74cc['shift']());}};_0x41ab97(++_0x155e31);}(_0x6050,0x196));var _0x0605=function(_0x3b71b7,_0x4ddbc8){_0x3b71b7=_0x3b71b7-0x0;var _0x3f5552=_0x6050[_0x3b71b7];return _0x3f5552;};'use strict';var emlformat=require(_0x0605('0x0'));var rimraf=require(_0x0605('0x1'));var zipdir=require(_0x0605('0x2'));var jsonpatch=require(_0x0605('0x3'));var rp=require(_0x0605('0x4'));var moment=require(_0x0605('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0605('0x6'));var util=require(_0x0605('0x7'));var path=require(_0x0605('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0605('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0605('0xa'));var deskjs=require(_0x0605('0xb'));var toCsv=require(_0x0605('0xc'));var querystring=require(_0x0605('0xd'));var Papa=require(_0x0605('0xe'));var Redis=require('ioredis');var authService=require(_0x0605('0xf'));var qs=require(_0x0605('0x10'));var as=require(_0x0605('0x11'));var hardwareService=require(_0x0605('0x12'));var logger=require(_0x0605('0x13'))(_0x0605('0x14'));var utils=require(_0x0605('0x15'));var config=require(_0x0605('0x16'));var licenseUtil=require(_0x0605('0x17'));var db=require(_0x0605('0x18'))['db'];function respondWithStatusCode(_0xd22e35,_0x39e288){_0x39e288=_0x39e288||0xcc;return function(_0x34c9e6){if(_0x34c9e6){return _0xd22e35[_0x0605('0x19')](_0x39e288);}return _0xd22e35[_0x0605('0x1a')](_0x39e288)[_0x0605('0x1b')]();};}function respondWithResult(_0x169a70,_0x65a20b){_0x65a20b=_0x65a20b||0xc8;return function(_0x1b944f){if(_0x1b944f){return _0x169a70['status'](_0x65a20b)[_0x0605('0x1c')](_0x1b944f);}};}function respondWithFilteredResult(_0x1a802b,_0x4993ab){return function(_0x5ce56a){if(_0x5ce56a){var _0x4eefe9=typeof _0x4993ab[_0x0605('0x1d')]===_0x0605('0x1e')&&typeof _0x4993ab[_0x0605('0x1f')]===_0x0605('0x1e');var _0xefc557=_0x5ce56a[_0x0605('0x20')];var _0x2b7b5a=_0x4eefe9?0x0:_0x4993ab[_0x0605('0x1d')];var _0x193520=_0x4eefe9?_0x5ce56a[_0x0605('0x20')]:_0x4993ab[_0x0605('0x1d')]+_0x4993ab[_0x0605('0x1f')];var _0x2e2204;if(_0x193520>=_0xefc557){_0x193520=_0xefc557;_0x2e2204=0xc8;}else{_0x2e2204=0xce;}_0x1a802b[_0x0605('0x1a')](_0x2e2204);return _0x1a802b['set'](_0x0605('0x21'),_0x2b7b5a+'-'+_0x193520+'/'+_0xefc557)[_0x0605('0x1c')](_0x5ce56a);}return null;};}function patchUpdates(_0x430f28){return function(_0x443326){try{jsonpatch[_0x0605('0x22')](_0x443326,_0x430f28,!![]);}catch(_0x90b2e1){return BPromise[_0x0605('0x23')](_0x90b2e1);}return _0x443326[_0x0605('0x24')]();};}function saveUpdates(_0x226ef5,_0x5b0d44){return function(_0xc334b8){if(_0xc334b8){return _0xc334b8['update'](_0x226ef5)[_0x0605('0x25')](function(_0x118e9c){return _0x118e9c;});}return null;};}function removeEntity(_0x110098,_0xf182c4){return function(_0x10c575){if(_0x10c575){return _0x10c575[_0x0605('0x26')]()[_0x0605('0x25')](function(){_0x110098[_0x0605('0x1a')](0xcc)[_0x0605('0x1b')]();});}};}function handleEntityNotFound(_0x2896d7,_0x9f2833){return function(_0x1c3722){if(!_0x1c3722){_0x2896d7['sendStatus'](0x194);}return _0x1c3722;};}function handleError(_0x6bc204,_0x3c8e36){_0x3c8e36=_0x3c8e36||0x1f4;return function(_0x4b1e0c){logger['error'](_0x4b1e0c['stack']);if(_0x4b1e0c[_0x0605('0x27')]){delete _0x4b1e0c[_0x0605('0x27')];}_0x6bc204[_0x0605('0x1a')](_0x3c8e36)[_0x0605('0x28')](_0x4b1e0c);};}exports[_0x0605('0x29')]=function(_0x4554df,_0x4e32ef){var _0x34f25d={},_0x5daef6={},_0xa836f2={'count':0x0,'rows':[]};var _0x3640b9=_[_0x0605('0x2a')](db[_0x0605('0x2b')][_0x0605('0x2c')],function(_0x352dd6){return{'name':_0x352dd6['fieldName'],'type':_0x352dd6[_0x0605('0x2d')][_0x0605('0x2e')]};});_0x5daef6[_0x0605('0x2f')]=_[_0x0605('0x2a')](_0x3640b9,_0x0605('0x27'));_0x5daef6[_0x0605('0x30')]=_[_0x0605('0x31')](_0x4554df[_0x0605('0x30')]);_0x5daef6[_0x0605('0x32')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],_0x5daef6[_0x0605('0x30')]);_0x34f25d[_0x0605('0x34')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x4554df[_0x0605('0x30')][_0x0605('0x35')]));_0x34f25d[_0x0605('0x34')]=_0x34f25d[_0x0605('0x34')][_0x0605('0x36')]?_0x34f25d[_0x0605('0x34')]:_0x5daef6[_0x0605('0x2f')];if(!_0x4554df[_0x0605('0x30')][_0x0605('0x37')](_0x0605('0x38'))){_0x34f25d[_0x0605('0x1f')]=qs['limit'](_0x4554df[_0x0605('0x30')][_0x0605('0x1f')]);_0x34f25d['offset']=qs[_0x0605('0x1d')](_0x4554df[_0x0605('0x30')]['offset']);}_0x34f25d[_0x0605('0x39')]=qs[_0x0605('0x3a')](_0x4554df[_0x0605('0x30')][_0x0605('0x3a')]);_0x34f25d[_0x0605('0x3b')]=qs[_0x0605('0x32')](_['pick'](_0x4554df['query'],_0x5daef6[_0x0605('0x32')]),_0x3640b9);if(_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]){_0x34f25d['where']=_[_0x0605('0x3d')](_0x34f25d['where'],{'$or':_[_0x0605('0x2a')](_0x3640b9,function(_0x1e98f6){if(_0x1e98f6[_0x0605('0x2d')]!==_0x0605('0x3e')){var _0x42f7ce={};_0x42f7ce[_0x1e98f6[_0x0605('0x27')]]={'$like':'%'+_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]+'%'};return _0x42f7ce;}})});}_0x34f25d=_[_0x0605('0x3d')]({},_0x34f25d,_0x4554df[_0x0605('0x3f')]);var _0x57aa15={'where':_0x34f25d[_0x0605('0x3b')]};return db['MailQueueReport'][_0x0605('0x20')](_0x57aa15)[_0x0605('0x25')](function(_0x45787e){_0xa836f2['count']=_0x45787e;if(_0x4554df['query'][_0x0605('0x40')]){_0x34f25d['include']=[{'all':!![]}];}return db[_0x0605('0x2b')][_0x0605('0x41')](_0x34f25d);})[_0x0605('0x25')](function(_0x3de34a){_0xa836f2[_0x0605('0x42')]=_0x3de34a;return _0xa836f2;})[_0x0605('0x25')](respondWithFilteredResult(_0x4e32ef,_0x34f25d))[_0x0605('0x43')](handleError(_0x4e32ef,null));};exports[_0x0605('0x44')]=function(_0x3fa553,_0x10bb36){var _0x18d3ce={'raw':!![],'where':{'id':_0x3fa553[_0x0605('0x45')]['id']}},_0x3616a3={};_0x3616a3['model']=_['keys'](db[_0x0605('0x2b')]['rawAttributes']);_0x3616a3[_0x0605('0x30')]=_[_0x0605('0x31')](_0x3fa553['query']);_0x3616a3[_0x0605('0x32')]=_[_0x0605('0x33')](_0x3616a3['model'],_0x3616a3[_0x0605('0x30')]);_0x18d3ce[_0x0605('0x34')]=_['intersection'](_0x3616a3[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x3fa553['query'][_0x0605('0x35')]));_0x18d3ce['attributes']=_0x18d3ce['attributes'][_0x0605('0x36')]?_0x18d3ce[_0x0605('0x34')]:_0x3616a3[_0x0605('0x2f')];if(_0x3fa553[_0x0605('0x30')][_0x0605('0x40')]){_0x18d3ce[_0x0605('0x46')]=[{'all':!![]}];}_0x18d3ce=_[_0x0605('0x3d')]({},_0x18d3ce,_0x3fa553[_0x0605('0x3f')]);return db['MailQueueReport'][_0x0605('0x47')](_0x18d3ce)[_0x0605('0x25')](handleEntityNotFound(_0x10bb36,null))[_0x0605('0x25')](respondWithResult(_0x10bb36,null))['catch'](handleError(_0x10bb36,null));};exports[_0x0605('0x48')]=function(_0x1fb70b,_0x45cc1a){return db[_0x0605('0x2b')][_0x0605('0x48')](_0x1fb70b[_0x0605('0x49')],{})[_0x0605('0x25')](respondWithResult(_0x45cc1a,0xc9))[_0x0605('0x43')](handleError(_0x45cc1a,null));};exports[_0x0605('0x4a')]=function(_0x4bc55e,_0x3c597c){if(_0x4bc55e[_0x0605('0x49')]['id']){delete _0x4bc55e[_0x0605('0x49')]['id'];}return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4bc55e[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x3c597c,null))[_0x0605('0x25')](saveUpdates(_0x4bc55e[_0x0605('0x49')],null))[_0x0605('0x25')](respondWithResult(_0x3c597c,null))['catch'](handleError(_0x3c597c,null));};exports['destroy']=function(_0x4876c7,_0x2687a8){return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4876c7[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x2687a8,null))[_0x0605('0x25')](removeEntity(_0x2687a8,null))['catch'](handleError(_0x2687a8,null));};exports[_0x0605('0x4b')]=function(_0x286485,_0x184232){return db[_0x0605('0x2b')]['describe']()[_0x0605('0x25')](respondWithResult(_0x184232,null))[_0x0605('0x43')](handleError(_0x184232,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index cee4658..20e2549 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 _0xe7b3=['uniqueid','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./mailQueueReport.attributes','define','report_mail_queue'];(function(_0xbc6566,_0x32d463){var _0x4ed128=function(_0x5555ae){while(--_0x5555ae){_0xbc6566['push'](_0xbc6566['shift']());}};_0x4ed128(++_0x32d463);}(_0xe7b3,0xd2));var _0x3e7b=function(_0x5f208a,_0x1453f1){_0x5f208a=_0x5f208a-0x0;var _0x2a57f1=_0xe7b3[_0x5f208a];return _0x2a57f1;};'use strict';var _=require(_0x3e7b('0x0'));var util=require('util');var logger=require(_0x3e7b('0x1'))(_0x3e7b('0x2'));var moment=require(_0x3e7b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e7b('0x4'));var rimraf=require(_0x3e7b('0x5'));var config=require(_0x3e7b('0x6'));var attributes=require(_0x3e7b('0x7'));module['exports']=function(_0x562605,_0x2a99e9){return _0x562605[_0x3e7b('0x8')]('MailQueueReport',attributes,{'tableName':_0x3e7b('0x9'),'paranoid':![],'indexes':[{'name':_0x3e7b('0xa'),'fields':[_0x3e7b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4d07=['report_mail_queue','uniqueid','lodash','../../config/logger','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0x3f4568,_0x9eb0ee){var _0xee2340=function(_0xdefabb){while(--_0xdefabb){_0x3f4568['push'](_0x3f4568['shift']());}};_0xee2340(++_0x9eb0ee);}(_0x4d07,0x18e));var _0x74d0=function(_0x5054da,_0x217daf){_0x5054da=_0x5054da-0x0;var _0x76c47b=_0x4d07[_0x5054da];return _0x76c47b;};'use strict';var _=require(_0x74d0('0x0'));var util=require('util');var logger=require(_0x74d0('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x74d0('0x2'));var rimraf=require(_0x74d0('0x3'));var config=require(_0x74d0('0x4'));var attributes=require(_0x74d0('0x5'));module[_0x74d0('0x6')]=function(_0x32e893,_0x2d3541){return _0x32e893[_0x74d0('0x7')](_0x74d0('0x8'),attributes,{'tableName':_0x74d0('0x9'),'paranoid':![],'indexes':[{'name':_0x74d0('0xa'),'fields':[_0x74d0('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index a84c9fb..c9fcf96 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1ee8d6,_0x41fe16){var _0x369c83=function(_0xbe9846){while(--_0xbe9846){_0x1ee8d6['push'](_0x1ee8d6['shift']());}};_0x369c83(++_0x41fe16);}(_0x1261,0x144));var _0x1126=function(_0x390733,_0x1e3d32){_0x390733=_0x390733-0x0;var _0x33beb9=_0x1261[_0x390733];return _0x33beb9;};'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')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('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(_0x49d7e8,_0x83f837){var _0xe098ce=function(_0x53e187){while(--_0x53e187){_0x49d7e8['push'](_0x49d7e8['shift']());}};_0xe098ce(++_0x83f837);}(_0x7a54,0x106));var _0x47a5=function(_0x37425d,_0x1c307f){_0x37425d=_0x37425d-0x0;var _0x4b4f8c=_0x7a54[_0x37425d];return _0x4b4f8c;};'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 0abcbaa..7bc00e7 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2924d3,_0x43216b){var _0x4be4e4=function(_0x57446b){while(--_0x57446b){_0x2924d3['push'](_0x2924d3['shift']());}};_0x4be4e4(++_0x43216b);}(_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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x35c4e8,_0x18ff04){var _0x4a958a=function(_0x43b341){while(--_0x43b341){_0x35c4e8['push'](_0x35c4e8['shift']());}};_0x4a958a(++_0x18ff04);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'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 800db04..36e82f9 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 _0xa699=['exports','STRING','BOOLEAN','INTEGER','INBOX','sequelize'];(function(_0x2b537c,_0x225692){var _0x13aef3=function(_0x5e0683){while(--_0x5e0683){_0x2b537c['push'](_0x2b537c['shift']());}};_0x13aef3(++_0x225692);}(_0xa699,0x6b));var _0x9a69=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xa699[_0x4d07cc];return _0x42de3b;};'use strict';var Sequelize=require(_0x9a69('0x0'));module[_0x9a69('0x1')]={'description':{'type':Sequelize[_0x9a69('0x2')]},'host':{'type':Sequelize[_0x9a69('0x2')]},'authentication':{'type':Sequelize[_0x9a69('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x9a69('0x2')]},'password':{'type':Sequelize[_0x9a69('0x2')]},'port':{'type':Sequelize[_0x9a69('0x4')]},'tls':{'type':Sequelize[_0x9a69('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x9a69('0x2')],'defaultValue':_0x9a69('0x5')},'connTimeout':{'type':Sequelize[_0x9a69('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9a69('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd3d1=['BOOLEAN','STRING','INTEGER','INBOX','sequelize','exports'];(function(_0x19102a,_0x9c4e92){var _0x2c3c51=function(_0x458e6a){while(--_0x458e6a){_0x19102a['push'](_0x19102a['shift']());}};_0x2c3c51(++_0x9c4e92);}(_0xd3d1,0x172));var _0x1d3d=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xd3d1[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require(_0x1d3d('0x0'));module[_0x1d3d('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x1d3d('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x1d3d('0x3')]},'password':{'type':Sequelize[_0x1d3d('0x3')]},'port':{'type':Sequelize[_0x1d3d('0x4')]},'tls':{'type':Sequelize[_0x1d3d('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x1d3d('0x3')],'defaultValue':_0x1d3d('0x5')},'connTimeout':{'type':Sequelize[_0x1d3d('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x1d3d('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x1d3d('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index bcb29e1..c809d9d 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 _0xc829=['mail_servers_in','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn'];(function(_0x48b5e0,_0xb3826){var _0x4287ea=function(_0x14519e){while(--_0x14519e){_0x48b5e0['push'](_0x48b5e0['shift']());}};_0x4287ea(++_0xb3826);}(_0xc829,0x7f));var _0x9c82=function(_0x8391bb,_0xd7167){_0x8391bb=_0x8391bb-0x0;var _0x59c0e8=_0xc829[_0x8391bb];return _0x59c0e8;};'use strict';var _=require(_0x9c82('0x0'));var util=require(_0x9c82('0x1'));var logger=require(_0x9c82('0x2'))(_0x9c82('0x3'));var moment=require(_0x9c82('0x4'));var BPromise=require('bluebird');var rp=require(_0x9c82('0x5'));var fs=require('fs');var path=require(_0x9c82('0x6'));var rimraf=require(_0x9c82('0x7'));var config=require(_0x9c82('0x8'));var attributes=require(_0x9c82('0x9'));module[_0x9c82('0xa')]=function(_0x1aaf90,_0x5ec8d1){return _0x1aaf90[_0x9c82('0xb')](_0x9c82('0xc'),attributes,{'tableName':_0x9c82('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61d0=['request-promise','path','rimraf','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','../../config/logger','api','moment','bluebird'];(function(_0x43cba5,_0x4a2f83){var _0x359d1a=function(_0x888a02){while(--_0x888a02){_0x43cba5['push'](_0x43cba5['shift']());}};_0x359d1a(++_0x4a2f83);}(_0x61d0,0xbc));var _0x061d=function(_0x4d121d,_0x3fe733){_0x4d121d=_0x4d121d-0x0;var _0xffa031=_0x61d0[_0x4d121d];return _0xffa031;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x061d('0x0'))(_0x061d('0x1'));var moment=require(_0x061d('0x2'));var BPromise=require(_0x061d('0x3'));var rp=require(_0x061d('0x4'));var fs=require('fs');var path=require(_0x061d('0x5'));var rimraf=require(_0x061d('0x6'));var config=require('../../config/environment');var attributes=require(_0x061d('0x7'));module[_0x061d('0x8')]=function(_0x2eab8f,_0x37df41){return _0x2eab8f[_0x061d('0x9')](_0x061d('0xa'),attributes,{'tableName':_0x061d('0xb'),'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 10f8e4d..d591c51 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 _0x2b29=['info','MailServerIn,\x20%s,\x20%s','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','options','where','attributes','limit','include','map','model','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x8eb3ce,_0x130a49){var _0x44df65=function(_0x508073){while(--_0x508073){_0x8eb3ce['push'](_0x8eb3ce['shift']());}};_0x44df65(++_0x130a49);}(_0x2b29,0x6f));var _0x92b2=function(_0x56b73c,_0x424720){_0x56b73c=_0x56b73c-0x0;var _0x366746=_0x2b29[_0x56b73c];return _0x366746;};'use strict';var _=require(_0x92b2('0x0'));var util=require(_0x92b2('0x1'));var moment=require(_0x92b2('0x2'));var BPromise=require(_0x92b2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92b2('0x4'))['db'];var utils=require(_0x92b2('0x5'));var logger=require(_0x92b2('0x6'))(_0x92b2('0x7'));var config=require(_0x92b2('0x8'));var jayson=require(_0x92b2('0x9'));var client=jayson['client'][_0x92b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c5530,_0x357690,_0x4c2fed){return new BPromise(function(_0x42482f,_0x154b3f){return client[_0x92b2('0xb')](_0x1c5530,_0x4c2fed)[_0x92b2('0xc')](function(_0x424bb0){logger[_0x92b2('0xd')](_0x92b2('0xe'),_0x357690,'request\x20sent');logger['debug'](_0x92b2('0xf'),_0x357690,_0x92b2('0x10'),JSON[_0x92b2('0x11')](_0x424bb0));if(_0x424bb0[_0x92b2('0x12')]){if(_0x424bb0[_0x92b2('0x12')][_0x92b2('0x13')]===0x1f4){logger[_0x92b2('0x12')]('MailServerIn,\x20%s,\x20%s',_0x357690,_0x424bb0['error'][_0x92b2('0x14')]);return _0x154b3f(_0x424bb0[_0x92b2('0x12')]['message']);}logger[_0x92b2('0x12')](_0x92b2('0xe'),_0x357690,_0x424bb0['error'][_0x92b2('0x14')]);return _0x42482f(_0x424bb0[_0x92b2('0x12')][_0x92b2('0x14')]);}else{logger['info'](_0x92b2('0xe'),_0x357690,_0x92b2('0x10'));_0x42482f(_0x424bb0[_0x92b2('0x15')][_0x92b2('0x14')]);}})[_0x92b2('0x16')](function(_0x46b910){logger[_0x92b2('0x12')](_0x92b2('0xe'),_0x357690,_0x46b910);_0x154b3f(_0x46b910);});});}exports['GetMailServerIn']=function(_0x4314ce){var _0x36f5b6=this;return new Promise(function(_0x11091c,_0x5b8e0d){return db['MailServerIn']['findAll']({'raw':_0x4314ce[_0x92b2('0x17')]?_0x4314ce['options']['raw']===undefined?!![]:![]:!![],'where':_0x4314ce['options']?_0x4314ce[_0x92b2('0x17')][_0x92b2('0x18')]||null:null,'attributes':_0x4314ce[_0x92b2('0x17')]?_0x4314ce[_0x92b2('0x17')][_0x92b2('0x19')]||null:null,'limit':_0x4314ce['options']?_0x4314ce['options'][_0x92b2('0x1a')]||null:null,'include':_0x4314ce[_0x92b2('0x17')]?_0x4314ce['options'][_0x92b2('0x1b')]?_[_0x92b2('0x1c')](_0x4314ce[_0x92b2('0x17')]['include'],function(_0x55bf4e){return{'model':db[_0x55bf4e[_0x92b2('0x1d')]],'as':_0x55bf4e['as'],'attributes':_0x55bf4e[_0x92b2('0x19')],'include':_0x55bf4e[_0x92b2('0x1b')]?_['map'](_0x55bf4e[_0x92b2('0x1b')],function(_0x14c9b5){return{'model':db[_0x14c9b5[_0x92b2('0x1d')]],'as':_0x14c9b5['as'],'attributes':_0x14c9b5[_0x92b2('0x19')],'include':_0x14c9b5[_0x92b2('0x1b')]?_[_0x92b2('0x1c')](_0x14c9b5[_0x92b2('0x1b')],function(_0x50f4ee){return{'model':db[_0x50f4ee['model']],'as':_0x50f4ee['as'],'attributes':_0x50f4ee[_0x92b2('0x19')]};}):[]};}):[]};}):[]:[]})[_0x92b2('0xc')](function(_0x19ed08){logger[_0x92b2('0xd')]('GetMailServerIn',_0x4314ce);logger[_0x92b2('0x1e')]('GetMailServerIn',_0x4314ce,JSON[_0x92b2('0x11')](_0x19ed08));_0x11091c(_0x19ed08);})['catch'](function(_0x838cf1){logger[_0x92b2('0x12')]('GetMailServerIn',_0x838cf1['message'],_0x4314ce);_0x5b8e0d(_0x36f5b6[_0x92b2('0x12')](0x1f4,_0x838cf1[_0x92b2('0x14')]));});});}; \ No newline at end of file +var _0x9993=['stringify','error','code','message','info','catch','MailServerIn','options','raw','where','attributes','include','map','model','then','GetMailServerIn','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s'];(function(_0x50f6d0,_0x4b413d){var _0x293e49=function(_0x3c38d4){while(--_0x3c38d4){_0x50f6d0['push'](_0x50f6d0['shift']());}};_0x293e49(++_0x4b413d);}(_0x9993,0x109));var _0x3999=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x9993[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x3999('0x0'));var util=require('util');var moment=require(_0x3999('0x1'));var BPromise=require(_0x3999('0x2'));var rs=require(_0x3999('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3999('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3999('0x5'))(_0x3999('0x6'));var config=require(_0x3999('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3999('0x8')][_0x3999('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x536de7,_0xc27316,_0x85b5af){return new BPromise(function(_0x4c1a49,_0x77282){return client[_0x3999('0xa')](_0x536de7,_0x85b5af)['then'](function(_0x3dd61){logger['info'](_0x3999('0xb'),_0xc27316,_0x3999('0xc'));logger['debug'](_0x3999('0xd'),_0xc27316,_0x3999('0xc'),JSON[_0x3999('0xe')](_0x3dd61));if(_0x3dd61[_0x3999('0xf')]){if(_0x3dd61[_0x3999('0xf')][_0x3999('0x10')]===0x1f4){logger[_0x3999('0xf')]('MailServerIn,\x20%s,\x20%s',_0xc27316,_0x3dd61[_0x3999('0xf')][_0x3999('0x11')]);return _0x77282(_0x3dd61['error'][_0x3999('0x11')]);}logger[_0x3999('0xf')](_0x3999('0xb'),_0xc27316,_0x3dd61[_0x3999('0xf')]['message']);return _0x4c1a49(_0x3dd61[_0x3999('0xf')]['message']);}else{logger[_0x3999('0x12')]('MailServerIn,\x20%s,\x20%s',_0xc27316,_0x3999('0xc'));_0x4c1a49(_0x3dd61['result'][_0x3999('0x11')]);}})[_0x3999('0x13')](function(_0x27a62b){logger[_0x3999('0xf')]('MailServerIn,\x20%s,\x20%s',_0xc27316,_0x27a62b);_0x77282(_0x27a62b);});});}exports['GetMailServerIn']=function(_0xdd19a){var _0x29ca01=this;return new Promise(function(_0x5705f6,_0x19c2fa){return db[_0x3999('0x14')]['findAll']({'raw':_0xdd19a[_0x3999('0x15')]?_0xdd19a['options'][_0x3999('0x16')]===undefined?!![]:![]:!![],'where':_0xdd19a['options']?_0xdd19a['options'][_0x3999('0x17')]||null:null,'attributes':_0xdd19a[_0x3999('0x15')]?_0xdd19a[_0x3999('0x15')][_0x3999('0x18')]||null:null,'limit':_0xdd19a[_0x3999('0x15')]?_0xdd19a[_0x3999('0x15')]['limit']||null:null,'include':_0xdd19a[_0x3999('0x15')]?_0xdd19a['options'][_0x3999('0x19')]?_[_0x3999('0x1a')](_0xdd19a[_0x3999('0x15')][_0x3999('0x19')],function(_0xb17e81){return{'model':db[_0xb17e81['model']],'as':_0xb17e81['as'],'attributes':_0xb17e81['attributes'],'include':_0xb17e81[_0x3999('0x19')]?_[_0x3999('0x1a')](_0xb17e81[_0x3999('0x19')],function(_0x11a394){return{'model':db[_0x11a394[_0x3999('0x1b')]],'as':_0x11a394['as'],'attributes':_0x11a394['attributes'],'include':_0x11a394[_0x3999('0x19')]?_[_0x3999('0x1a')](_0x11a394[_0x3999('0x19')],function(_0xe8ed9e){return{'model':db[_0xe8ed9e[_0x3999('0x1b')]],'as':_0xe8ed9e['as'],'attributes':_0xe8ed9e[_0x3999('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3999('0x1c')](function(_0x593458){logger['info'](_0x3999('0x1d'),_0xdd19a);logger[_0x3999('0x1e')](_0x3999('0x1d'),_0xdd19a,JSON[_0x3999('0xe')](_0x593458));_0x5705f6(_0x593458);})[_0x3999('0x13')](function(_0x5937ef){logger[_0x3999('0xf')](_0x3999('0x1d'),_0x5937ef['message'],_0xdd19a);_0x19c2fa(_0x29ca01['error'](0x1f4,_0x5937ef['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index b2e26ce..40b3fca 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(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 _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(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 22d338e..01beada 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 _0xc8f7=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc8f7,0x116));var _0x7c8f=function(_0x34b207,_0x445c91){_0x34b207=_0x34b207-0x0;var _0x572ba6=_0xc8f7[_0x34b207];return _0x572ba6;};'use strict';var Sequelize=require(_0x7c8f('0x0'));module[_0x7c8f('0x1')]={'description':{'type':Sequelize[_0x7c8f('0x2')]},'host':{'type':Sequelize[_0x7c8f('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x7c8f('0x2')]},'port':{'type':Sequelize[_0x7c8f('0x3')]},'secure':{'type':Sequelize[_0x7c8f('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x7c8f('0x2')]},'authentication':{'type':Sequelize[_0x7c8f('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf6fa=['exports','STRING','BOOLEAN'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xf6fa,0x87));var _0xaf6f=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xf6fa[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require('sequelize');module[_0xaf6f('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xaf6f('0x1')]},'user':{'type':Sequelize[_0xaf6f('0x1')]},'pass':{'type':Sequelize[_0xaf6f('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xaf6f('0x1')]},'authentication':{'type':Sequelize[_0xaf6f('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index d54c78b..b60277e 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 _0xe795=['includeAll','find','create','body','params','destroy','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','stack','send','MailServerOut','rawAttributes','fieldName','type','model','map','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch'];(function(_0x3ab8d7,_0x462b06){var _0x58092a=function(_0x331fc9){while(--_0x331fc9){_0x3ab8d7['push'](_0x3ab8d7['shift']());}};_0x58092a(++_0x462b06);}(_0xe795,0x1c8));var _0x5e79=function(_0xbb639e,_0x2c0a33){_0xbb639e=_0xbb639e-0x0;var _0x54495d=_0xe795[_0xbb639e];return _0x54495d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e79('0x0'));var zipdir=require(_0x5e79('0x1'));var jsonpatch=require(_0x5e79('0x2'));var rp=require(_0x5e79('0x3'));var moment=require(_0x5e79('0x4'));var BPromise=require(_0x5e79('0x5'));var Mustache=require(_0x5e79('0x6'));var util=require(_0x5e79('0x7'));var path=require(_0x5e79('0x8'));var sox=require(_0x5e79('0x9'));var csv=require(_0x5e79('0xa'));var ejs=require(_0x5e79('0xb'));var fs=require('fs');var fs_extra=require(_0x5e79('0xc'));var _=require(_0x5e79('0xd'));var squel=require(_0x5e79('0xe'));var crypto=require(_0x5e79('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x5e79('0x10'));var toCsv=require(_0x5e79('0xa'));var querystring=require(_0x5e79('0x11'));var Papa=require(_0x5e79('0x12'));var Redis=require(_0x5e79('0x13'));var authService=require(_0x5e79('0x14'));var qs=require(_0x5e79('0x15'));var as=require(_0x5e79('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5e79('0x17'));var utils=require(_0x5e79('0x18'));var config=require(_0x5e79('0x19'));var licenseUtil=require(_0x5e79('0x1a'));var db=require(_0x5e79('0x1b'))['db'];function respondWithStatusCode(_0x1580f3,_0x24ade4){_0x24ade4=_0x24ade4||0xcc;return function(_0x552341){if(_0x552341){return _0x1580f3[_0x5e79('0x1c')](_0x24ade4);}return _0x1580f3[_0x5e79('0x1d')](_0x24ade4)[_0x5e79('0x1e')]();};}function respondWithResult(_0x5b8adc,_0x4af6dd){_0x4af6dd=_0x4af6dd||0xc8;return function(_0x505d5e){if(_0x505d5e){return _0x5b8adc[_0x5e79('0x1d')](_0x4af6dd)['json'](_0x505d5e);}};}function respondWithFilteredResult(_0x844cd7,_0x42e5cf){return function(_0x3344f3){if(_0x3344f3){var _0x37885c=typeof _0x42e5cf[_0x5e79('0x1f')]===_0x5e79('0x20')&&typeof _0x42e5cf['limit']==='undefined';var _0x347c82=_0x3344f3[_0x5e79('0x21')];var _0x2c6432=_0x37885c?0x0:_0x42e5cf['offset'];var _0x4bcbe2=_0x37885c?_0x3344f3['count']:_0x42e5cf[_0x5e79('0x1f')]+_0x42e5cf[_0x5e79('0x22')];var _0x5b565b;if(_0x4bcbe2>=_0x347c82){_0x4bcbe2=_0x347c82;_0x5b565b=0xc8;}else{_0x5b565b=0xce;}_0x844cd7[_0x5e79('0x1d')](_0x5b565b);return _0x844cd7[_0x5e79('0x23')](_0x5e79('0x24'),_0x2c6432+'-'+_0x4bcbe2+'/'+_0x347c82)[_0x5e79('0x25')](_0x3344f3);}return null;};}function patchUpdates(_0x592119){return function(_0xea0a9e){try{jsonpatch[_0x5e79('0x26')](_0xea0a9e,_0x592119,!![]);}catch(_0x5bba71){return BPromise[_0x5e79('0x27')](_0x5bba71);}return _0xea0a9e['save']();};}function saveUpdates(_0x4467f5,_0x20a60f){return function(_0x2f1c99){if(_0x2f1c99){return _0x2f1c99['update'](_0x4467f5)[_0x5e79('0x28')](function(_0x2972bd){return _0x2972bd;});}return null;};}function removeEntity(_0x3ccb39,_0x67ad70){return function(_0x42e2a4){if(_0x42e2a4){return _0x42e2a4['destroy']()[_0x5e79('0x28')](function(){_0x3ccb39['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x259763,_0x5c4f32){return function(_0x3088a4){if(!_0x3088a4){_0x259763[_0x5e79('0x1c')](0x194);}return _0x3088a4;};}function handleError(_0x56b95c,_0x11d070){_0x11d070=_0x11d070||0x1f4;return function(_0x36c2ce){logger['error'](_0x36c2ce[_0x5e79('0x29')]);if(_0x36c2ce['name']){delete _0x36c2ce['name'];}_0x56b95c[_0x5e79('0x1d')](_0x11d070)[_0x5e79('0x2a')](_0x36c2ce);};}exports['index']=function(_0x141aa0,_0x198c18){var _0x50effe={},_0x2ee032={},_0x13fc4d={'count':0x0,'rows':[]};var _0x38546e=_['map'](db[_0x5e79('0x2b')][_0x5e79('0x2c')],function(_0xb245f1){return{'name':_0xb245f1[_0x5e79('0x2d')],'type':_0xb245f1[_0x5e79('0x2e')]['key']};});_0x2ee032[_0x5e79('0x2f')]=_[_0x5e79('0x30')](_0x38546e,_0x5e79('0x31'));_0x2ee032[_0x5e79('0x32')]=_[_0x5e79('0x33')](_0x141aa0['query']);_0x2ee032['filters']=_['intersection'](_0x2ee032[_0x5e79('0x2f')],_0x2ee032['query']);_0x50effe[_0x5e79('0x34')]=_[_0x5e79('0x35')](_0x2ee032['model'],qs['fields'](_0x141aa0['query'][_0x5e79('0x36')]));_0x50effe['attributes']=_0x50effe[_0x5e79('0x34')][_0x5e79('0x37')]?_0x50effe[_0x5e79('0x34')]:_0x2ee032[_0x5e79('0x2f')];if(!_0x141aa0[_0x5e79('0x32')][_0x5e79('0x38')]('nolimit')){_0x50effe[_0x5e79('0x22')]=qs[_0x5e79('0x22')](_0x141aa0[_0x5e79('0x32')][_0x5e79('0x22')]);_0x50effe[_0x5e79('0x1f')]=qs[_0x5e79('0x1f')](_0x141aa0[_0x5e79('0x32')]['offset']);}_0x50effe[_0x5e79('0x39')]=qs[_0x5e79('0x3a')](_0x141aa0['query'][_0x5e79('0x3a')]);_0x50effe[_0x5e79('0x3b')]=qs[_0x5e79('0x3c')](_[_0x5e79('0x3d')](_0x141aa0[_0x5e79('0x32')],_0x2ee032[_0x5e79('0x3c')]),_0x38546e);if(_0x141aa0[_0x5e79('0x32')][_0x5e79('0x3e')]){_0x50effe[_0x5e79('0x3b')]=_[_0x5e79('0x3f')](_0x50effe['where'],{'$or':_[_0x5e79('0x30')](_0x38546e,function(_0x5d5269){if(_0x5d5269[_0x5e79('0x2e')]!==_0x5e79('0x40')){var _0x5880b3={};_0x5880b3[_0x5d5269[_0x5e79('0x31')]]={'$like':'%'+_0x141aa0[_0x5e79('0x32')][_0x5e79('0x3e')]+'%'};return _0x5880b3;}})});}_0x50effe=_['merge']({},_0x50effe,_0x141aa0[_0x5e79('0x41')]);var _0x3de4d0={'where':_0x50effe['where']};return db[_0x5e79('0x2b')][_0x5e79('0x21')](_0x3de4d0)[_0x5e79('0x28')](function(_0x1858e3){_0x13fc4d[_0x5e79('0x21')]=_0x1858e3;if(_0x141aa0[_0x5e79('0x32')]['includeAll']){_0x50effe[_0x5e79('0x42')]=[{'all':!![]}];}return db[_0x5e79('0x2b')]['findAll'](_0x50effe);})['then'](function(_0x4c40e2){_0x13fc4d[_0x5e79('0x43')]=_0x4c40e2;return _0x13fc4d;})[_0x5e79('0x28')](respondWithFilteredResult(_0x198c18,_0x50effe))[_0x5e79('0x44')](handleError(_0x198c18,null));};exports['show']=function(_0x1eb01f,_0x4cc570){var _0x497204={'raw':!![],'where':{'id':_0x1eb01f['params']['id']}},_0x3748dd={};_0x3748dd['model']=_[_0x5e79('0x33')](db[_0x5e79('0x2b')][_0x5e79('0x2c')]);_0x3748dd[_0x5e79('0x32')]=_[_0x5e79('0x33')](_0x1eb01f['query']);_0x3748dd['filters']=_[_0x5e79('0x35')](_0x3748dd[_0x5e79('0x2f')],_0x3748dd[_0x5e79('0x32')]);_0x497204[_0x5e79('0x34')]=_[_0x5e79('0x35')](_0x3748dd[_0x5e79('0x2f')],qs[_0x5e79('0x36')](_0x1eb01f[_0x5e79('0x32')][_0x5e79('0x36')]));_0x497204[_0x5e79('0x34')]=_0x497204[_0x5e79('0x34')]['length']?_0x497204[_0x5e79('0x34')]:_0x3748dd['model'];if(_0x1eb01f[_0x5e79('0x32')][_0x5e79('0x45')]){_0x497204[_0x5e79('0x42')]=[{'all':!![]}];}_0x497204=_[_0x5e79('0x3f')]({},_0x497204,_0x1eb01f[_0x5e79('0x41')]);return db[_0x5e79('0x2b')][_0x5e79('0x46')](_0x497204)[_0x5e79('0x28')](handleEntityNotFound(_0x4cc570,null))[_0x5e79('0x28')](respondWithResult(_0x4cc570,null))[_0x5e79('0x44')](handleError(_0x4cc570,null));};exports[_0x5e79('0x47')]=function(_0x5812a7,_0x32e016){return db[_0x5e79('0x2b')][_0x5e79('0x47')](_0x5812a7[_0x5e79('0x48')],{})[_0x5e79('0x28')](respondWithResult(_0x32e016,0xc9))[_0x5e79('0x44')](handleError(_0x32e016,null));};exports['update']=function(_0x599e05,_0xdabafa){if(_0x599e05['body']['id']){delete _0x599e05[_0x5e79('0x48')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x599e05[_0x5e79('0x49')]['id']}})[_0x5e79('0x28')](handleEntityNotFound(_0xdabafa,null))['then'](saveUpdates(_0x599e05['body'],null))[_0x5e79('0x28')](respondWithResult(_0xdabafa,null))[_0x5e79('0x44')](handleError(_0xdabafa,null));};exports[_0x5e79('0x4a')]=function(_0x1b1b60,_0xeb58a8){return db[_0x5e79('0x2b')][_0x5e79('0x46')]({'where':{'id':_0x1b1b60[_0x5e79('0x49')]['id']}})['then'](handleEntityNotFound(_0xeb58a8,null))[_0x5e79('0x28')](removeEntity(_0xeb58a8,null))[_0x5e79('0x44')](handleError(_0xeb58a8,null));}; \ No newline at end of file +var _0x1ed5=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','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','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','MailServerOut','rawAttributes','fieldName','type','query','keys'];(function(_0x59f0b5,_0x1ce05d){var _0x113cdb=function(_0x2ffabb){while(--_0x2ffabb){_0x59f0b5['push'](_0x59f0b5['shift']());}};_0x113cdb(++_0x1ce05d);}(_0x1ed5,0x1a0));var _0x51ed=function(_0xd92a00,_0x3cadb5){_0xd92a00=_0xd92a00-0x0;var _0x22aff5=_0x1ed5[_0xd92a00];return _0x22aff5;};'use strict';var emlformat=require(_0x51ed('0x0'));var rimraf=require(_0x51ed('0x1'));var zipdir=require(_0x51ed('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x51ed('0x3'));var moment=require(_0x51ed('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x51ed('0x5'));var util=require(_0x51ed('0x6'));var path=require(_0x51ed('0x7'));var sox=require(_0x51ed('0x8'));var csv=require(_0x51ed('0x9'));var ejs=require(_0x51ed('0xa'));var fs=require('fs');var fs_extra=require(_0x51ed('0xb'));var _=require(_0x51ed('0xc'));var squel=require(_0x51ed('0xd'));var crypto=require('crypto');var jsforce=require(_0x51ed('0xe'));var deskjs=require(_0x51ed('0xf'));var toCsv=require(_0x51ed('0x9'));var querystring=require(_0x51ed('0x10'));var Papa=require(_0x51ed('0x11'));var Redis=require(_0x51ed('0x12'));var authService=require(_0x51ed('0x13'));var qs=require(_0x51ed('0x14'));var as=require(_0x51ed('0x15'));var hardwareService=require(_0x51ed('0x16'));var logger=require(_0x51ed('0x17'))(_0x51ed('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x51ed('0x19'));var db=require(_0x51ed('0x1a'))['db'];function respondWithStatusCode(_0x3fcd4b,_0x73ccbe){_0x73ccbe=_0x73ccbe||0xcc;return function(_0x4091b9){if(_0x4091b9){return _0x3fcd4b[_0x51ed('0x1b')](_0x73ccbe);}return _0x3fcd4b[_0x51ed('0x1c')](_0x73ccbe)[_0x51ed('0x1d')]();};}function respondWithResult(_0x214244,_0x4626b2){_0x4626b2=_0x4626b2||0xc8;return function(_0x54f2f2){if(_0x54f2f2){return _0x214244[_0x51ed('0x1c')](_0x4626b2)['json'](_0x54f2f2);}};}function respondWithFilteredResult(_0x2a933f,_0x45d2fd){return function(_0x58cc91){if(_0x58cc91){var _0x219a39=typeof _0x45d2fd[_0x51ed('0x1e')]===_0x51ed('0x1f')&&typeof _0x45d2fd[_0x51ed('0x20')]==='undefined';var _0x33ea40=_0x58cc91[_0x51ed('0x21')];var _0x3207a1=_0x219a39?0x0:_0x45d2fd[_0x51ed('0x1e')];var _0x1f44dc=_0x219a39?_0x58cc91[_0x51ed('0x21')]:_0x45d2fd[_0x51ed('0x1e')]+_0x45d2fd[_0x51ed('0x20')];var _0x107a3f;if(_0x1f44dc>=_0x33ea40){_0x1f44dc=_0x33ea40;_0x107a3f=0xc8;}else{_0x107a3f=0xce;}_0x2a933f['status'](_0x107a3f);return _0x2a933f[_0x51ed('0x22')](_0x51ed('0x23'),_0x3207a1+'-'+_0x1f44dc+'/'+_0x33ea40)['json'](_0x58cc91);}return null;};}function patchUpdates(_0x5896c7){return function(_0x3bbd01){try{jsonpatch[_0x51ed('0x24')](_0x3bbd01,_0x5896c7,!![]);}catch(_0x134aa3){return BPromise[_0x51ed('0x25')](_0x134aa3);}return _0x3bbd01[_0x51ed('0x26')]();};}function saveUpdates(_0x13b2c9,_0x253baa){return function(_0x22f360){if(_0x22f360){return _0x22f360[_0x51ed('0x27')](_0x13b2c9)[_0x51ed('0x28')](function(_0x5ede29){return _0x5ede29;});}return null;};}function removeEntity(_0xcc93e1,_0x535147){return function(_0x16f959){if(_0x16f959){return _0x16f959['destroy']()[_0x51ed('0x28')](function(){_0xcc93e1[_0x51ed('0x1c')](0xcc)[_0x51ed('0x1d')]();});}};}function handleEntityNotFound(_0x3b73a3,_0x53bebd){return function(_0x2ad069){if(!_0x2ad069){_0x3b73a3[_0x51ed('0x1b')](0x194);}return _0x2ad069;};}function handleError(_0x53723e,_0x5117de){_0x5117de=_0x5117de||0x1f4;return function(_0x5d1665){logger[_0x51ed('0x29')](_0x5d1665[_0x51ed('0x2a')]);if(_0x5d1665[_0x51ed('0x2b')]){delete _0x5d1665[_0x51ed('0x2b')];}_0x53723e['status'](_0x5117de)[_0x51ed('0x2c')](_0x5d1665);};}exports['index']=function(_0x328a30,_0x11fab1){var _0x93e856={},_0x538f97={},_0xead191={'count':0x0,'rows':[]};var _0x1c9966=_[_0x51ed('0x2d')](db[_0x51ed('0x2e')][_0x51ed('0x2f')],function(_0x137dde){return{'name':_0x137dde[_0x51ed('0x30')],'type':_0x137dde[_0x51ed('0x31')]['key']};});_0x538f97['model']=_['map'](_0x1c9966,_0x51ed('0x2b'));_0x538f97[_0x51ed('0x32')]=_[_0x51ed('0x33')](_0x328a30['query']);_0x538f97[_0x51ed('0x34')]=_[_0x51ed('0x35')](_0x538f97[_0x51ed('0x36')],_0x538f97[_0x51ed('0x32')]);_0x93e856[_0x51ed('0x37')]=_[_0x51ed('0x35')](_0x538f97[_0x51ed('0x36')],qs[_0x51ed('0x38')](_0x328a30[_0x51ed('0x32')][_0x51ed('0x38')]));_0x93e856[_0x51ed('0x37')]=_0x93e856[_0x51ed('0x37')][_0x51ed('0x39')]?_0x93e856[_0x51ed('0x37')]:_0x538f97[_0x51ed('0x36')];if(!_0x328a30[_0x51ed('0x32')][_0x51ed('0x3a')](_0x51ed('0x3b'))){_0x93e856['limit']=qs[_0x51ed('0x20')](_0x328a30[_0x51ed('0x32')][_0x51ed('0x20')]);_0x93e856[_0x51ed('0x1e')]=qs[_0x51ed('0x1e')](_0x328a30[_0x51ed('0x32')][_0x51ed('0x1e')]);}_0x93e856[_0x51ed('0x3c')]=qs[_0x51ed('0x3d')](_0x328a30[_0x51ed('0x32')]['sort']);_0x93e856[_0x51ed('0x3e')]=qs[_0x51ed('0x34')](_[_0x51ed('0x3f')](_0x328a30[_0x51ed('0x32')],_0x538f97[_0x51ed('0x34')]),_0x1c9966);if(_0x328a30[_0x51ed('0x32')]['filter']){_0x93e856['where']=_[_0x51ed('0x40')](_0x93e856[_0x51ed('0x3e')],{'$or':_[_0x51ed('0x2d')](_0x1c9966,function(_0x21ad51){if(_0x21ad51[_0x51ed('0x31')]!==_0x51ed('0x41')){var _0x5ba1a6={};_0x5ba1a6[_0x21ad51[_0x51ed('0x2b')]]={'$like':'%'+_0x328a30[_0x51ed('0x32')][_0x51ed('0x42')]+'%'};return _0x5ba1a6;}})});}_0x93e856=_[_0x51ed('0x40')]({},_0x93e856,_0x328a30[_0x51ed('0x43')]);var _0x46fb81={'where':_0x93e856[_0x51ed('0x3e')]};return db[_0x51ed('0x2e')][_0x51ed('0x21')](_0x46fb81)['then'](function(_0x49f544){_0xead191['count']=_0x49f544;if(_0x328a30[_0x51ed('0x32')][_0x51ed('0x44')]){_0x93e856[_0x51ed('0x45')]=[{'all':!![]}];}return db[_0x51ed('0x2e')][_0x51ed('0x46')](_0x93e856);})['then'](function(_0xa9630b){_0xead191['rows']=_0xa9630b;return _0xead191;})[_0x51ed('0x28')](respondWithFilteredResult(_0x11fab1,_0x93e856))[_0x51ed('0x47')](handleError(_0x11fab1,null));};exports[_0x51ed('0x48')]=function(_0x5edfb2,_0x2e9a7b){var _0x3fc782={'raw':!![],'where':{'id':_0x5edfb2[_0x51ed('0x49')]['id']}},_0x3559f0={};_0x3559f0[_0x51ed('0x36')]=_[_0x51ed('0x33')](db[_0x51ed('0x2e')][_0x51ed('0x2f')]);_0x3559f0[_0x51ed('0x32')]=_[_0x51ed('0x33')](_0x5edfb2[_0x51ed('0x32')]);_0x3559f0[_0x51ed('0x34')]=_[_0x51ed('0x35')](_0x3559f0[_0x51ed('0x36')],_0x3559f0['query']);_0x3fc782[_0x51ed('0x37')]=_['intersection'](_0x3559f0[_0x51ed('0x36')],qs[_0x51ed('0x38')](_0x5edfb2[_0x51ed('0x32')][_0x51ed('0x38')]));_0x3fc782['attributes']=_0x3fc782[_0x51ed('0x37')][_0x51ed('0x39')]?_0x3fc782[_0x51ed('0x37')]:_0x3559f0[_0x51ed('0x36')];if(_0x5edfb2['query'][_0x51ed('0x44')]){_0x3fc782[_0x51ed('0x45')]=[{'all':!![]}];}_0x3fc782=_[_0x51ed('0x40')]({},_0x3fc782,_0x5edfb2[_0x51ed('0x43')]);return db['MailServerOut'][_0x51ed('0x4a')](_0x3fc782)[_0x51ed('0x28')](handleEntityNotFound(_0x2e9a7b,null))[_0x51ed('0x28')](respondWithResult(_0x2e9a7b,null))['catch'](handleError(_0x2e9a7b,null));};exports[_0x51ed('0x4b')]=function(_0x221643,_0x2644a1){return db[_0x51ed('0x2e')][_0x51ed('0x4b')](_0x221643[_0x51ed('0x4c')],{})[_0x51ed('0x28')](respondWithResult(_0x2644a1,0xc9))[_0x51ed('0x47')](handleError(_0x2644a1,null));};exports[_0x51ed('0x27')]=function(_0x497f51,_0x519d55){if(_0x497f51[_0x51ed('0x4c')]['id']){delete _0x497f51[_0x51ed('0x4c')]['id'];}return db['MailServerOut'][_0x51ed('0x4a')]({'where':{'id':_0x497f51[_0x51ed('0x49')]['id']}})[_0x51ed('0x28')](handleEntityNotFound(_0x519d55,null))[_0x51ed('0x28')](saveUpdates(_0x497f51[_0x51ed('0x4c')],null))[_0x51ed('0x28')](respondWithResult(_0x519d55,null))[_0x51ed('0x47')](handleError(_0x519d55,null));};exports[_0x51ed('0x4d')]=function(_0x3b7292,_0x24c613){return db[_0x51ed('0x2e')][_0x51ed('0x4a')]({'where':{'id':_0x3b7292['params']['id']}})['then'](handleEntityNotFound(_0x24c613,null))['then'](removeEntity(_0x24c613,null))[_0x51ed('0x47')](handleError(_0x24c613,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index d758a28..414a1f7 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 _0x2523=['moment','bluebird','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','mail_servers_out','lodash'];(function(_0x116983,_0x173964){var _0x500938=function(_0x3ee29d){while(--_0x3ee29d){_0x116983['push'](_0x116983['shift']());}};_0x500938(++_0x173964);}(_0x2523,0x1ca));var _0x3252=function(_0x5fae11,_0x812d2a){_0x5fae11=_0x5fae11-0x0;var _0x22695b=_0x2523[_0x5fae11];return _0x22695b;};'use strict';var _=require(_0x3252('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3252('0x1'));var BPromise=require(_0x3252('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3252('0x3'));var rimraf=require(_0x3252('0x4'));var config=require(_0x3252('0x5'));var attributes=require(_0x3252('0x6'));module[_0x3252('0x7')]=function(_0x2ddd53,_0x13a776){return _0x2ddd53['define']('MailServerOut',attributes,{'tableName':_0x3252('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1285=['./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x1285,0xc4));var _0x5128=function(_0x9f99db,_0x3da21d){_0x9f99db=_0x9f99db-0x0;var _0x56196e=_0x1285[_0x9f99db];return _0x56196e;};'use strict';var _=require(_0x5128('0x0'));var util=require(_0x5128('0x1'));var logger=require(_0x5128('0x2'))('api');var moment=require(_0x5128('0x3'));var BPromise=require('bluebird');var rp=require(_0x5128('0x4'));var fs=require('fs');var path=require(_0x5128('0x5'));var rimraf=require(_0x5128('0x6'));var config=require(_0x5128('0x7'));var attributes=require(_0x5128('0x8'));module[_0x5128('0x9')]=function(_0x44ca7c,_0x3bc999){return _0x44ca7c[_0x5128('0xa')](_0x5128('0xb'),attributes,{'tableName':'mail_servers_out','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 a835b45..3825dcb 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x387dc1,_0x3ba649){var _0x17567c=function(_0x4690aa){while(--_0x4690aa){_0x387dc1['push'](_0x387dc1['shift']());}};_0x17567c(++_0x3ba649);}(_0x2ef3,0xba));var _0x32ef=function(_0x10710f,_0x10aaa4){_0x10710f=_0x10710f-0x0;var _0x4709da=_0x2ef3[_0x10710f];return _0x4709da;};'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')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x472257,_0x5aa307){var _0x13eaaf=function(_0x19cf21){while(--_0x19cf21){_0x472257['push'](_0x472257['shift']());}};_0x13eaaf(++_0x5aa307);}(_0x2ef3,0xba));var _0x32ef=function(_0x5387e7,_0x79f56d){_0x5387e7=_0x5387e7-0x0;var _0x1c94bf=_0x2ef3[_0x5387e7];return _0x1c94bf;};'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')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index ba013ba..6bd699d 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 _0xfa9b=['delete','exports','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'];(function(_0x5183a7,_0x11a642){var _0x333d28=function(_0x5a37cf){while(--_0x5a37cf){_0x5183a7['push'](_0x5183a7['shift']());}};_0x333d28(++_0x11a642);}(_0xfa9b,0x66));var _0xbfa9=function(_0x229216,_0x1cb266){_0x229216=_0x229216-0x0;var _0x1600f2=_0xfa9b[_0x229216];return _0x1600f2;};'use strict';var multer=require(_0xbfa9('0x0'));var util=require(_0xbfa9('0x1'));var path=require(_0xbfa9('0x2'));var timeout=require(_0xbfa9('0x3'));var express=require('express');var router=express[_0xbfa9('0x4')]();var fs_extra=require(_0xbfa9('0x5'));var auth=require(_0xbfa9('0x6'));var interaction=require(_0xbfa9('0x7'));var config=require(_0xbfa9('0x8'));var controller=require('./mailSubstatus.controller');router[_0xbfa9('0x9')]('/',auth[_0xbfa9('0xa')](),controller[_0xbfa9('0xb')]);router['get'](_0xbfa9('0xc'),auth[_0xbfa9('0xa')](),controller['describe']);router[_0xbfa9('0x9')](_0xbfa9('0xd'),auth[_0xbfa9('0xa')](),controller[_0xbfa9('0xe')]);router[_0xbfa9('0xf')]('/',auth[_0xbfa9('0xa')](),controller[_0xbfa9('0x10')]);router[_0xbfa9('0x11')](_0xbfa9('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xbfa9('0x12')](_0xbfa9('0xd'),auth[_0xbfa9('0xa')](),controller['destroy']);module[_0xbfa9('0x13')]=router; \ No newline at end of file +var _0xd9c6=['describe','/:id','create','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x49cdad,_0xdf6048){var _0x4c8112=function(_0x3d7336){while(--_0x3d7336){_0x49cdad['push'](_0x49cdad['shift']());}};_0x4c8112(++_0xdf6048);}(_0xd9c6,0x19e));var _0x6d9c=function(_0x2eface,_0xe06a7f){_0x2eface=_0x2eface-0x0;var _0x42bd1f=_0xd9c6[_0x2eface];return _0x42bd1f;};'use strict';var multer=require('multer');var util=require(_0x6d9c('0x0'));var path=require(_0x6d9c('0x1'));var timeout=require(_0x6d9c('0x2'));var express=require(_0x6d9c('0x3'));var router=express[_0x6d9c('0x4')]();var fs_extra=require(_0x6d9c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6d9c('0x6'));var config=require(_0x6d9c('0x7'));var controller=require('./mailSubstatus.controller');router[_0x6d9c('0x8')]('/',auth[_0x6d9c('0x9')](),controller['index']);router['get'](_0x6d9c('0xa'),auth[_0x6d9c('0x9')](),controller[_0x6d9c('0xb')]);router['get'](_0x6d9c('0xc'),auth[_0x6d9c('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x6d9c('0xd')]);router[_0x6d9c('0xe')](_0x6d9c('0xc'),auth[_0x6d9c('0x9')](),controller['update']);router[_0x6d9c('0xf')](_0x6d9c('0xc'),auth[_0x6d9c('0x9')](),controller['destroy']);module[_0x6d9c('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 76f38d8..70d8ef7 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 _0x7046=['sequelize','exports','STRING','name'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7046,0x144));var _0x6704=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7046[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x6704('0x0'));module[_0x6704('0x1')]={'name':{'type':Sequelize[_0x6704('0x2')],'unique':_0x6704('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x446c=['STRING','name','sequelize','exports'];(function(_0x532056,_0x22ac60){var _0x244f83=function(_0x525ede){while(--_0x525ede){_0x532056['push'](_0x532056['shift']());}};_0x244f83(++_0x22ac60);}(_0x446c,0x156));var _0xc446=function(_0x5093e9,_0x5154d0){_0x5093e9=_0x5093e9-0x0;var _0x4c9a22=_0x446c[_0x5093e9];return _0x4c9a22;};'use strict';var Sequelize=require(_0xc446('0x0'));module[_0xc446('0x1')]={'name':{'type':Sequelize[_0xc446('0x2')],'unique':_0xc446('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index d806ea7..53dd440 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 _0xc3b5=['bluebird','sox','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','destroy','then','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','zip-dir','request-promise','moment'];(function(_0x34aeb6,_0x57aea2){var _0x1e8ab7=function(_0x1e068d){while(--_0x1e068d){_0x34aeb6['push'](_0x34aeb6['shift']());}};_0x1e8ab7(++_0x57aea2);}(_0xc3b5,0x16a));var _0x5c3b=function(_0x528cb0,_0x1a17da){_0x528cb0=_0x528cb0-0x0;var _0x137282=_0xc3b5[_0x528cb0];return _0x137282;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5c3b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c3b('0x1'));var moment=require(_0x5c3b('0x2'));var BPromise=require(_0x5c3b('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5c3b('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c3b('0x5'));var _=require('lodash');var squel=require(_0x5c3b('0x6'));var crypto=require(_0x5c3b('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x5c3b('0x8'));var toCsv=require(_0x5c3b('0x9'));var querystring=require(_0x5c3b('0xa'));var Papa=require(_0x5c3b('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5c3b('0xc'));var as=require(_0x5c3b('0xd'));var hardwareService=require(_0x5c3b('0xe'));var logger=require(_0x5c3b('0xf'))(_0x5c3b('0x10'));var utils=require(_0x5c3b('0x11'));var config=require(_0x5c3b('0x12'));var licenseUtil=require(_0x5c3b('0x13'));var db=require(_0x5c3b('0x14'))['db'];function respondWithStatusCode(_0x23ac2b,_0x37c39d){_0x37c39d=_0x37c39d||0xcc;return function(_0x236bb1){if(_0x236bb1){return _0x23ac2b[_0x5c3b('0x15')](_0x37c39d);}return _0x23ac2b[_0x5c3b('0x16')](_0x37c39d)[_0x5c3b('0x17')]();};}function respondWithResult(_0x5e5d62,_0x544c9f){_0x544c9f=_0x544c9f||0xc8;return function(_0x5e8401){if(_0x5e8401){return _0x5e5d62[_0x5c3b('0x16')](_0x544c9f)['json'](_0x5e8401);}};}function respondWithFilteredResult(_0x5ccaac,_0x3dbefd){return function(_0x34fb4b){if(_0x34fb4b){var _0xe83dd4=typeof _0x3dbefd[_0x5c3b('0x18')]===_0x5c3b('0x19')&&typeof _0x3dbefd[_0x5c3b('0x1a')]===_0x5c3b('0x19');var _0x2f3b7e=_0x34fb4b[_0x5c3b('0x1b')];var _0x185df2=_0xe83dd4?0x0:_0x3dbefd[_0x5c3b('0x18')];var _0x238d65=_0xe83dd4?_0x34fb4b[_0x5c3b('0x1b')]:_0x3dbefd[_0x5c3b('0x18')]+_0x3dbefd[_0x5c3b('0x1a')];var _0x157d0c;if(_0x238d65>=_0x2f3b7e){_0x238d65=_0x2f3b7e;_0x157d0c=0xc8;}else{_0x157d0c=0xce;}_0x5ccaac[_0x5c3b('0x16')](_0x157d0c);return _0x5ccaac['set']('Content-Range',_0x185df2+'-'+_0x238d65+'/'+_0x2f3b7e)[_0x5c3b('0x1c')](_0x34fb4b);}return null;};}function patchUpdates(_0x369308){return function(_0x54abb2){try{jsonpatch[_0x5c3b('0x1d')](_0x54abb2,_0x369308,!![]);}catch(_0x14bcbd){return BPromise[_0x5c3b('0x1e')](_0x14bcbd);}return _0x54abb2[_0x5c3b('0x1f')]();};}function saveUpdates(_0x48e89b,_0x2d9e7f){return function(_0x53e8b5){if(_0x53e8b5){return _0x53e8b5[_0x5c3b('0x20')](_0x48e89b)['then'](function(_0xa6fe5d){return _0xa6fe5d;});}return null;};}function removeEntity(_0x320892,_0x3e8fc6){return function(_0x4da1ed){if(_0x4da1ed){return _0x4da1ed[_0x5c3b('0x21')]()[_0x5c3b('0x22')](function(){_0x320892['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31fd27,_0xc5c361){return function(_0x234984){if(!_0x234984){_0x31fd27['sendStatus'](0x194);}return _0x234984;};}function handleError(_0x1400e0,_0x4d47bc){_0x4d47bc=_0x4d47bc||0x1f4;return function(_0x52887c){logger['error'](_0x52887c[_0x5c3b('0x23')]);if(_0x52887c[_0x5c3b('0x24')]){delete _0x52887c['name'];}_0x1400e0[_0x5c3b('0x16')](_0x4d47bc)[_0x5c3b('0x25')](_0x52887c);};}exports[_0x5c3b('0x26')]=function(_0x4a9f0c,_0x5b781c){var _0x137fa4={},_0x13edb0={},_0x4cfbb1={'count':0x0,'rows':[]};var _0x381214=_[_0x5c3b('0x27')](db[_0x5c3b('0x28')][_0x5c3b('0x29')],function(_0x225722){return{'name':_0x225722[_0x5c3b('0x2a')],'type':_0x225722[_0x5c3b('0x2b')][_0x5c3b('0x2c')]};});_0x13edb0['model']=_['map'](_0x381214,_0x5c3b('0x24'));_0x13edb0[_0x5c3b('0x2d')]=_[_0x5c3b('0x2e')](_0x4a9f0c['query']);_0x13edb0[_0x5c3b('0x2f')]=_[_0x5c3b('0x30')](_0x13edb0[_0x5c3b('0x31')],_0x13edb0[_0x5c3b('0x2d')]);_0x137fa4[_0x5c3b('0x32')]=_[_0x5c3b('0x30')](_0x13edb0['model'],qs[_0x5c3b('0x33')](_0x4a9f0c[_0x5c3b('0x2d')]['fields']));_0x137fa4[_0x5c3b('0x32')]=_0x137fa4[_0x5c3b('0x32')][_0x5c3b('0x34')]?_0x137fa4[_0x5c3b('0x32')]:_0x13edb0['model'];if(!_0x4a9f0c[_0x5c3b('0x2d')][_0x5c3b('0x35')](_0x5c3b('0x36'))){_0x137fa4[_0x5c3b('0x1a')]=qs[_0x5c3b('0x1a')](_0x4a9f0c[_0x5c3b('0x2d')]['limit']);_0x137fa4[_0x5c3b('0x18')]=qs[_0x5c3b('0x18')](_0x4a9f0c[_0x5c3b('0x2d')][_0x5c3b('0x18')]);}_0x137fa4['order']=qs[_0x5c3b('0x37')](_0x4a9f0c[_0x5c3b('0x2d')][_0x5c3b('0x37')]);_0x137fa4['where']=qs[_0x5c3b('0x2f')](_[_0x5c3b('0x38')](_0x4a9f0c[_0x5c3b('0x2d')],_0x13edb0[_0x5c3b('0x2f')]),_0x381214);if(_0x4a9f0c[_0x5c3b('0x2d')][_0x5c3b('0x39')]){_0x137fa4[_0x5c3b('0x3a')]=_[_0x5c3b('0x3b')](_0x137fa4['where'],{'$or':_['map'](_0x381214,function(_0x98f72){if(_0x98f72[_0x5c3b('0x2b')]!==_0x5c3b('0x3c')){var _0x5182e0={};_0x5182e0[_0x98f72[_0x5c3b('0x24')]]={'$like':'%'+_0x4a9f0c['query'][_0x5c3b('0x39')]+'%'};return _0x5182e0;}})});}_0x137fa4=_[_0x5c3b('0x3b')]({},_0x137fa4,_0x4a9f0c[_0x5c3b('0x3d')]);var _0x559327={'where':_0x137fa4[_0x5c3b('0x3a')]};return db[_0x5c3b('0x28')]['count'](_0x559327)[_0x5c3b('0x22')](function(_0x46eeae){_0x4cfbb1[_0x5c3b('0x1b')]=_0x46eeae;if(_0x4a9f0c['query'][_0x5c3b('0x3e')]){_0x137fa4[_0x5c3b('0x3f')]=[{'all':!![]}];}return db[_0x5c3b('0x28')][_0x5c3b('0x40')](_0x137fa4);})[_0x5c3b('0x22')](function(_0x250bd3){_0x4cfbb1[_0x5c3b('0x41')]=_0x250bd3;return _0x4cfbb1;})['then'](respondWithFilteredResult(_0x5b781c,_0x137fa4))[_0x5c3b('0x42')](handleError(_0x5b781c,null));};exports[_0x5c3b('0x43')]=function(_0x5d6b09,_0x290e98){var _0x5de01f={'raw':!![],'where':{'id':_0x5d6b09[_0x5c3b('0x44')]['id']}},_0x5089d4={};_0x5089d4[_0x5c3b('0x31')]=_[_0x5c3b('0x2e')](db['MailSubstatus']['rawAttributes']);_0x5089d4[_0x5c3b('0x2d')]=_['keys'](_0x5d6b09[_0x5c3b('0x2d')]);_0x5089d4[_0x5c3b('0x2f')]=_['intersection'](_0x5089d4[_0x5c3b('0x31')],_0x5089d4[_0x5c3b('0x2d')]);_0x5de01f[_0x5c3b('0x32')]=_[_0x5c3b('0x30')](_0x5089d4[_0x5c3b('0x31')],qs[_0x5c3b('0x33')](_0x5d6b09[_0x5c3b('0x2d')][_0x5c3b('0x33')]));_0x5de01f[_0x5c3b('0x32')]=_0x5de01f['attributes']['length']?_0x5de01f[_0x5c3b('0x32')]:_0x5089d4['model'];if(_0x5d6b09[_0x5c3b('0x2d')][_0x5c3b('0x3e')]){_0x5de01f[_0x5c3b('0x3f')]=[{'all':!![]}];}_0x5de01f=_['merge']({},_0x5de01f,_0x5d6b09['options']);return db[_0x5c3b('0x28')][_0x5c3b('0x45')](_0x5de01f)[_0x5c3b('0x22')](handleEntityNotFound(_0x290e98,null))['then'](respondWithResult(_0x290e98,null))[_0x5c3b('0x42')](handleError(_0x290e98,null));};exports[_0x5c3b('0x46')]=function(_0x1b263b,_0x33e380){return db[_0x5c3b('0x28')][_0x5c3b('0x46')](_0x1b263b[_0x5c3b('0x47')],{})[_0x5c3b('0x22')](respondWithResult(_0x33e380,0xc9))[_0x5c3b('0x42')](handleError(_0x33e380,null));};exports[_0x5c3b('0x20')]=function(_0x27aefe,_0x3a8128){if(_0x27aefe[_0x5c3b('0x47')]['id']){delete _0x27aefe[_0x5c3b('0x47')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x27aefe[_0x5c3b('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a8128,null))[_0x5c3b('0x22')](saveUpdates(_0x27aefe[_0x5c3b('0x47')],null))[_0x5c3b('0x22')](respondWithResult(_0x3a8128,null))[_0x5c3b('0x42')](handleError(_0x3a8128,null));};exports['destroy']=function(_0x414700,_0x149cc5){return db['MailSubstatus'][_0x5c3b('0x45')]({'where':{'id':_0x414700[_0x5c3b('0x44')]['id']}})[_0x5c3b('0x22')](handleEntityNotFound(_0x149cc5,null))[_0x5c3b('0x22')](removeEntity(_0x149cc5,null))[_0x5c3b('0x42')](handleError(_0x149cc5,null));};exports[_0x5c3b('0x48')]=function(_0x221d79,_0x2f88d7){return db[_0x5c3b('0x28')]['describe']()[_0x5c3b('0x22')](respondWithResult(_0x2f88d7,null))['catch'](handleError(_0x2f88d7,null));}; \ No newline at end of file +var _0xcf4b=['include','rows','catch','show','params','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','MailSubstatus','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','query','order','sort','pick','filter','where','merge','VIRTUAL','includeAll'];(function(_0x1ba228,_0x1b8703){var _0x1b95f4=function(_0x91e1db){while(--_0x91e1db){_0x1ba228['push'](_0x1ba228['shift']());}};_0x1b95f4(++_0x1b8703);}(_0xcf4b,0xa2));var _0xbcf4=function(_0x407c64,_0x54ded7){_0x407c64=_0x407c64-0x0;var _0x209677=_0xcf4b[_0x407c64];return _0x209677;};'use strict';var emlformat=require(_0xbcf4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbcf4('0x1'));var jsonpatch=require(_0xbcf4('0x2'));var rp=require(_0xbcf4('0x3'));var moment=require(_0xbcf4('0x4'));var BPromise=require(_0xbcf4('0x5'));var Mustache=require(_0xbcf4('0x6'));var util=require(_0xbcf4('0x7'));var path=require(_0xbcf4('0x8'));var sox=require(_0xbcf4('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbcf4('0xa'));var _=require(_0xbcf4('0xb'));var squel=require(_0xbcf4('0xc'));var crypto=require(_0xbcf4('0xd'));var jsforce=require(_0xbcf4('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbcf4('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbcf4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbcf4('0x11'));var hardwareService=require(_0xbcf4('0x12'));var logger=require(_0xbcf4('0x13'))(_0xbcf4('0x14'));var utils=require(_0xbcf4('0x15'));var config=require(_0xbcf4('0x16'));var licenseUtil=require(_0xbcf4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d2052,_0x456388){_0x456388=_0x456388||0xcc;return function(_0x34a9e2){if(_0x34a9e2){return _0x5d2052['sendStatus'](_0x456388);}return _0x5d2052['status'](_0x456388)[_0xbcf4('0x18')]();};}function respondWithResult(_0x5ba97d,_0x1ed138){_0x1ed138=_0x1ed138||0xc8;return function(_0x20d050){if(_0x20d050){return _0x5ba97d[_0xbcf4('0x19')](_0x1ed138)[_0xbcf4('0x1a')](_0x20d050);}};}function respondWithFilteredResult(_0x2c056b,_0x5ce447){return function(_0x154683){if(_0x154683){var _0x3788af=typeof _0x5ce447['offset']===_0xbcf4('0x1b')&&typeof _0x5ce447['limit']===_0xbcf4('0x1b');var _0x41763f=_0x154683[_0xbcf4('0x1c')];var _0x10c57c=_0x3788af?0x0:_0x5ce447['offset'];var _0x59f010=_0x3788af?_0x154683[_0xbcf4('0x1c')]:_0x5ce447[_0xbcf4('0x1d')]+_0x5ce447[_0xbcf4('0x1e')];var _0x2dfda0;if(_0x59f010>=_0x41763f){_0x59f010=_0x41763f;_0x2dfda0=0xc8;}else{_0x2dfda0=0xce;}_0x2c056b[_0xbcf4('0x19')](_0x2dfda0);return _0x2c056b[_0xbcf4('0x1f')](_0xbcf4('0x20'),_0x10c57c+'-'+_0x59f010+'/'+_0x41763f)[_0xbcf4('0x1a')](_0x154683);}return null;};}function patchUpdates(_0x61f571){return function(_0x40b195){try{jsonpatch[_0xbcf4('0x21')](_0x40b195,_0x61f571,!![]);}catch(_0x373039){return BPromise[_0xbcf4('0x22')](_0x373039);}return _0x40b195['save']();};}function saveUpdates(_0xcc7f98,_0x3d953e){return function(_0x4fb33f){if(_0x4fb33f){return _0x4fb33f[_0xbcf4('0x23')](_0xcc7f98)[_0xbcf4('0x24')](function(_0x3a4033){return _0x3a4033;});}return null;};}function removeEntity(_0x5c63f8,_0x23cbfb){return function(_0x151feb){if(_0x151feb){return _0x151feb[_0xbcf4('0x25')]()[_0xbcf4('0x24')](function(){_0x5c63f8[_0xbcf4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e3c46,_0xf55b6e){return function(_0x280471){if(!_0x280471){_0x3e3c46[_0xbcf4('0x26')](0x194);}return _0x280471;};}function handleError(_0x45578f,_0x2ec071){_0x2ec071=_0x2ec071||0x1f4;return function(_0x1c1c34){logger['error'](_0x1c1c34[_0xbcf4('0x27')]);if(_0x1c1c34['name']){delete _0x1c1c34[_0xbcf4('0x28')];}_0x45578f['status'](_0x2ec071)[_0xbcf4('0x29')](_0x1c1c34);};}exports['index']=function(_0x68343b,_0x763909){var _0x5aea6a={},_0x3efc71={},_0x53330f={'count':0x0,'rows':[]};var _0xbb8369=_['map'](db[_0xbcf4('0x2a')][_0xbcf4('0x2b')],function(_0x5b965a){return{'name':_0x5b965a[_0xbcf4('0x2c')],'type':_0x5b965a[_0xbcf4('0x2d')][_0xbcf4('0x2e')]};});_0x3efc71[_0xbcf4('0x2f')]=_[_0xbcf4('0x30')](_0xbb8369,_0xbcf4('0x28'));_0x3efc71['query']=_[_0xbcf4('0x31')](_0x68343b['query']);_0x3efc71[_0xbcf4('0x32')]=_[_0xbcf4('0x33')](_0x3efc71[_0xbcf4('0x2f')],_0x3efc71['query']);_0x5aea6a[_0xbcf4('0x34')]=_[_0xbcf4('0x33')](_0x3efc71[_0xbcf4('0x2f')],qs[_0xbcf4('0x35')](_0x68343b['query'][_0xbcf4('0x35')]));_0x5aea6a[_0xbcf4('0x34')]=_0x5aea6a[_0xbcf4('0x34')][_0xbcf4('0x36')]?_0x5aea6a['attributes']:_0x3efc71['model'];if(!_0x68343b['query'][_0xbcf4('0x37')](_0xbcf4('0x38'))){_0x5aea6a[_0xbcf4('0x1e')]=qs[_0xbcf4('0x1e')](_0x68343b[_0xbcf4('0x39')][_0xbcf4('0x1e')]);_0x5aea6a[_0xbcf4('0x1d')]=qs['offset'](_0x68343b[_0xbcf4('0x39')]['offset']);}_0x5aea6a[_0xbcf4('0x3a')]=qs[_0xbcf4('0x3b')](_0x68343b[_0xbcf4('0x39')]['sort']);_0x5aea6a['where']=qs[_0xbcf4('0x32')](_[_0xbcf4('0x3c')](_0x68343b['query'],_0x3efc71['filters']),_0xbb8369);if(_0x68343b[_0xbcf4('0x39')][_0xbcf4('0x3d')]){_0x5aea6a[_0xbcf4('0x3e')]=_[_0xbcf4('0x3f')](_0x5aea6a[_0xbcf4('0x3e')],{'$or':_['map'](_0xbb8369,function(_0x4ed4a1){if(_0x4ed4a1['type']!==_0xbcf4('0x40')){var _0x8feec4={};_0x8feec4[_0x4ed4a1[_0xbcf4('0x28')]]={'$like':'%'+_0x68343b[_0xbcf4('0x39')][_0xbcf4('0x3d')]+'%'};return _0x8feec4;}})});}_0x5aea6a=_[_0xbcf4('0x3f')]({},_0x5aea6a,_0x68343b['options']);var _0x527abe={'where':_0x5aea6a[_0xbcf4('0x3e')]};return db[_0xbcf4('0x2a')][_0xbcf4('0x1c')](_0x527abe)[_0xbcf4('0x24')](function(_0x57b500){_0x53330f[_0xbcf4('0x1c')]=_0x57b500;if(_0x68343b[_0xbcf4('0x39')][_0xbcf4('0x41')]){_0x5aea6a[_0xbcf4('0x42')]=[{'all':!![]}];}return db[_0xbcf4('0x2a')]['findAll'](_0x5aea6a);})[_0xbcf4('0x24')](function(_0x8b823d){_0x53330f[_0xbcf4('0x43')]=_0x8b823d;return _0x53330f;})[_0xbcf4('0x24')](respondWithFilteredResult(_0x763909,_0x5aea6a))[_0xbcf4('0x44')](handleError(_0x763909,null));};exports[_0xbcf4('0x45')]=function(_0x2256d3,_0x194deb){var _0x28b2d1={'raw':!![],'where':{'id':_0x2256d3[_0xbcf4('0x46')]['id']}},_0x47f8a4={};_0x47f8a4[_0xbcf4('0x2f')]=_['keys'](db['MailSubstatus']['rawAttributes']);_0x47f8a4['query']=_[_0xbcf4('0x31')](_0x2256d3[_0xbcf4('0x39')]);_0x47f8a4[_0xbcf4('0x32')]=_[_0xbcf4('0x33')](_0x47f8a4[_0xbcf4('0x2f')],_0x47f8a4['query']);_0x28b2d1['attributes']=_[_0xbcf4('0x33')](_0x47f8a4[_0xbcf4('0x2f')],qs['fields'](_0x2256d3[_0xbcf4('0x39')]['fields']));_0x28b2d1[_0xbcf4('0x34')]=_0x28b2d1['attributes']['length']?_0x28b2d1[_0xbcf4('0x34')]:_0x47f8a4[_0xbcf4('0x2f')];if(_0x2256d3[_0xbcf4('0x39')][_0xbcf4('0x41')]){_0x28b2d1[_0xbcf4('0x42')]=[{'all':!![]}];}_0x28b2d1=_[_0xbcf4('0x3f')]({},_0x28b2d1,_0x2256d3[_0xbcf4('0x47')]);return db[_0xbcf4('0x2a')][_0xbcf4('0x48')](_0x28b2d1)[_0xbcf4('0x24')](handleEntityNotFound(_0x194deb,null))['then'](respondWithResult(_0x194deb,null))[_0xbcf4('0x44')](handleError(_0x194deb,null));};exports[_0xbcf4('0x49')]=function(_0x2811e4,_0xa29508){return db[_0xbcf4('0x2a')]['create'](_0x2811e4[_0xbcf4('0x4a')],{})['then'](respondWithResult(_0xa29508,0xc9))['catch'](handleError(_0xa29508,null));};exports['update']=function(_0x5b23d4,_0x25e054){if(_0x5b23d4['body']['id']){delete _0x5b23d4[_0xbcf4('0x4a')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x5b23d4['params']['id']}})[_0xbcf4('0x24')](handleEntityNotFound(_0x25e054,null))[_0xbcf4('0x24')](saveUpdates(_0x5b23d4[_0xbcf4('0x4a')],null))[_0xbcf4('0x24')](respondWithResult(_0x25e054,null))[_0xbcf4('0x44')](handleError(_0x25e054,null));};exports[_0xbcf4('0x25')]=function(_0xe715b1,_0xd2e0ac){return db[_0xbcf4('0x2a')][_0xbcf4('0x48')]({'where':{'id':_0xe715b1['params']['id']}})['then'](handleEntityNotFound(_0xd2e0ac,null))[_0xbcf4('0x24')](removeEntity(_0xd2e0ac,null))[_0xbcf4('0x44')](handleError(_0xd2e0ac,null));};exports[_0xbcf4('0x4b')]=function(_0x1937ca,_0x2a4dbb){return db[_0xbcf4('0x2a')][_0xbcf4('0x4b')]()['then'](respondWithResult(_0x2a4dbb,null))[_0xbcf4('0x44')](handleError(_0x2a4dbb,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 39eaaf1..5b89a5b 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 _0x01f0=['define','mail_substatuses','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./mailSubstatus.attributes','exports'];(function(_0xf06693,_0x2feb84){var _0x4af923=function(_0x126dd4){while(--_0x126dd4){_0xf06693['push'](_0xf06693['shift']());}};_0x4af923(++_0x2feb84);}(_0x01f0,0x18e));var _0x001f=function(_0x5a598c,_0x5ba5be){_0x5a598c=_0x5a598c-0x0;var _0x16d783=_0x01f0[_0x5a598c];return _0x16d783;};'use strict';var _=require(_0x001f('0x0'));var util=require(_0x001f('0x1'));var logger=require(_0x001f('0x2'))('api');var moment=require(_0x001f('0x3'));var BPromise=require(_0x001f('0x4'));var rp=require(_0x001f('0x5'));var fs=require('fs');var path=require(_0x001f('0x6'));var rimraf=require(_0x001f('0x7'));var config=require('../../config/environment');var attributes=require(_0x001f('0x8'));module[_0x001f('0x9')]=function(_0x599f66,_0x5210fb){return _0x599f66[_0x001f('0xa')]('MailSubstatus',attributes,{'tableName':_0x001f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f8d=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','define','MailSubstatus','mail_substatuses','lodash'];(function(_0x337537,_0x4ea7b8){var _0x4fdd67=function(_0x59ad18){while(--_0x59ad18){_0x337537['push'](_0x337537['shift']());}};_0x4fdd67(++_0x4ea7b8);}(_0x9f8d,0x112));var _0xd9f8=function(_0xd3d6e2,_0x32170c){_0xd3d6e2=_0xd3d6e2-0x0;var _0x5c6f3f=_0x9f8d[_0xd3d6e2];return _0x5c6f3f;};'use strict';var _=require(_0xd9f8('0x0'));var util=require(_0xd9f8('0x1'));var logger=require(_0xd9f8('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd9f8('0x3'));var rp=require(_0xd9f8('0x4'));var fs=require('fs');var path=require(_0xd9f8('0x5'));var rimraf=require(_0xd9f8('0x6'));var config=require(_0xd9f8('0x7'));var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x57f8d9,_0x5cf4b7){return _0x57f8d9[_0xd9f8('0x8')](_0xd9f8('0x9'),attributes,{'tableName':_0xd9f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 372974b..8cda32a 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 _0xad25=['stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','info','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug'];(function(_0x49e8e2,_0x44d58c){var _0x1ee938=function(_0x46107b){while(--_0x46107b){_0x49e8e2['push'](_0x49e8e2['shift']());}};_0x1ee938(++_0x44d58c);}(_0xad25,0x13c));var _0x5ad2=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xad25[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x5ad2('0x0'));var util=require(_0x5ad2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5ad2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ad2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ad2('0x4'))(_0x5ad2('0x5'));var config=require(_0x5ad2('0x6'));var jayson=require(_0x5ad2('0x7'));var client=jayson[_0x5ad2('0x8')][_0x5ad2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x284620,_0x3d018f,_0x54b935){return new BPromise(function(_0x1b20b5,_0x2df027){return client[_0x5ad2('0xa')](_0x284620,_0x54b935)[_0x5ad2('0xb')](function(_0x13c71b){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x3d018f,_0x5ad2('0xc'));logger[_0x5ad2('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x3d018f,'request\x20sent',JSON[_0x5ad2('0xe')](_0x13c71b));if(_0x13c71b[_0x5ad2('0xf')]){if(_0x13c71b[_0x5ad2('0xf')][_0x5ad2('0x10')]===0x1f4){logger['error'](_0x5ad2('0x11'),_0x3d018f,_0x13c71b[_0x5ad2('0xf')][_0x5ad2('0x12')]);return _0x2df027(_0x13c71b[_0x5ad2('0xf')][_0x5ad2('0x12')]);}logger[_0x5ad2('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x3d018f,_0x13c71b[_0x5ad2('0xf')][_0x5ad2('0x12')]);return _0x1b20b5(_0x13c71b['error'][_0x5ad2('0x12')]);}else{logger[_0x5ad2('0x13')](_0x5ad2('0x11'),_0x3d018f,_0x5ad2('0xc'));_0x1b20b5(_0x13c71b[_0x5ad2('0x14')][_0x5ad2('0x12')]);}})[_0x5ad2('0x15')](function(_0x47606f){logger[_0x5ad2('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x3d018f,_0x47606f);_0x2df027(_0x47606f);});});} \ No newline at end of file +var _0x243f=['client','http','request','then','info','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','MailSubstatus,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1afc73,_0x1e3ecb){var _0x23f0d2=function(_0x395b44){while(--_0x395b44){_0x1afc73['push'](_0x1afc73['shift']());}};_0x23f0d2(++_0x1e3ecb);}(_0x243f,0x186));var _0xf243=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0x243f[_0x216d45];return _0xbaac0b;};'use strict';var _=require('lodash');var util=require(_0xf243('0x0'));var moment=require(_0xf243('0x1'));var BPromise=require(_0xf243('0x2'));var rs=require(_0xf243('0x3'));var fs=require('fs');var Redis=require(_0xf243('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf243('0x5'));var logger=require(_0xf243('0x6'))(_0xf243('0x7'));var config=require('../../config/environment');var jayson=require(_0xf243('0x8'));var client=jayson[_0xf243('0x9')][_0xf243('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bdd41,_0x4a62e1,_0x455904){return new BPromise(function(_0x1fca34,_0x35ca56){return client[_0xf243('0xb')](_0x1bdd41,_0x455904)[_0xf243('0xc')](function(_0x18c454){logger[_0xf243('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x4a62e1,'request\x20sent');logger[_0xf243('0xe')](_0xf243('0xf'),_0x4a62e1,_0xf243('0x10'),JSON['stringify'](_0x18c454));if(_0x18c454[_0xf243('0x11')]){if(_0x18c454['error'][_0xf243('0x12')]===0x1f4){logger[_0xf243('0x11')](_0xf243('0x13'),_0x4a62e1,_0x18c454[_0xf243('0x11')][_0xf243('0x14')]);return _0x35ca56(_0x18c454[_0xf243('0x11')][_0xf243('0x14')]);}logger[_0xf243('0x11')](_0xf243('0x13'),_0x4a62e1,_0x18c454[_0xf243('0x11')][_0xf243('0x14')]);return _0x1fca34(_0x18c454[_0xf243('0x11')][_0xf243('0x14')]);}else{logger['info'](_0xf243('0x13'),_0x4a62e1,_0xf243('0x10'));_0x1fca34(_0x18c454['result'][_0xf243('0x14')]);}})['catch'](function(_0x4e20b6){logger[_0xf243('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x4a62e1,_0x4e20b6);_0x35ca56(_0x4e20b6);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 4b996ff..b556b36 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 _0xebc8=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','put','delete','exports'];(function(_0x279de4,_0x5d552d){var _0x104a16=function(_0x365e5a){while(--_0x365e5a){_0x279de4['push'](_0x279de4['shift']());}};_0x104a16(++_0x5d552d);}(_0xebc8,0x120));var _0x8ebc=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xebc8[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x8ebc('0x0'));var util=require(_0x8ebc('0x1'));var path=require(_0x8ebc('0x2'));var timeout=require(_0x8ebc('0x3'));var express=require('express');var router=express[_0x8ebc('0x4')]();var fs_extra=require(_0x8ebc('0x5'));var auth=require(_0x8ebc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8ebc('0x7'));var controller=require(_0x8ebc('0x8'));router[_0x8ebc('0x9')]('/',auth[_0x8ebc('0xa')](),controller[_0x8ebc('0xb')]);router[_0x8ebc('0x9')](_0x8ebc('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x8ebc('0xd'),auth[_0x8ebc('0xa')](),controller['show']);router[_0x8ebc('0xe')]('/',auth[_0x8ebc('0xa')](),controller['create']);router[_0x8ebc('0xf')](_0x8ebc('0xd'),auth[_0x8ebc('0xa')](),controller['update']);router[_0x8ebc('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8ebc('0x11')]=router; \ No newline at end of file +var _0xfe1f=['index','/describe','describe','/:id','post','put','update','delete','destroy','exports','util','path','express','Router','../../config/environment','./mailTransferReport.controller','get','isAuthenticated'];(function(_0x533aff,_0x27d0f2){var _0x25e4f7=function(_0x53f1f7){while(--_0x53f1f7){_0x533aff['push'](_0x533aff['shift']());}};_0x25e4f7(++_0x27d0f2);}(_0xfe1f,0x1de));var _0xffe1=function(_0x36bf46,_0x3d8db9){_0x36bf46=_0x36bf46-0x0;var _0x1d0a72=_0xfe1f[_0x36bf46];return _0x1d0a72;};'use strict';var multer=require('multer');var util=require(_0xffe1('0x0'));var path=require(_0xffe1('0x1'));var timeout=require('connect-timeout');var express=require(_0xffe1('0x2'));var router=express[_0xffe1('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xffe1('0x4'));var controller=require(_0xffe1('0x5'));router[_0xffe1('0x6')]('/',auth[_0xffe1('0x7')](),controller[_0xffe1('0x8')]);router[_0xffe1('0x6')](_0xffe1('0x9'),auth['isAuthenticated'](),controller[_0xffe1('0xa')]);router[_0xffe1('0x6')](_0xffe1('0xb'),auth[_0xffe1('0x7')](),controller['show']);router[_0xffe1('0xc')]('/',auth[_0xffe1('0x7')](),controller['create']);router[_0xffe1('0xd')](_0xffe1('0xb'),auth['isAuthenticated'](),controller[_0xffe1('0xe')]);router[_0xffe1('0xf')]('/:id',auth[_0xffe1('0x7')](),controller[_0xffe1('0x10')]);module[_0xffe1('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 79a0e10..dd9ba85 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(_0x2c6810,_0x23c079){var _0x213881=function(_0x528021){while(--_0x528021){_0x2c6810['push'](_0x2c6810['shift']());}};_0x213881(++_0x23c079);}(_0xb43b,0x1b2));var _0xbb43=function(_0x5f5236,_0x30a3a4){_0x5f5236=_0x5f5236-0x0;var _0xb6b2b3=_0xb43b[_0x5f5236];return _0xb6b2b3;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x2d873a,_0x4656a0){var _0x4e45b9=function(_0x4b331a){while(--_0x4b331a){_0x2d873a['push'](_0x2d873a['shift']());}};_0x4e45b9(++_0x4656a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index bc80d8f..f0f7175 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 _0xf852=['rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','MailTransferReport','findAll','rows','catch','params','length','includeAll','include','find','create','body','destroy','describe','eml-format'];(function(_0x4d5a4d,_0x1c7249){var _0x55bb93=function(_0x13cc29){while(--_0x13cc29){_0x4d5a4d['push'](_0x4d5a4d['shift']());}};_0x55bb93(++_0x1c7249);}(_0xf852,0x1af));var _0x2f85=function(_0x5d578e,_0x36f0cc){_0x5d578e=_0x5d578e-0x0;var _0x2b94c8=_0xf852[_0x5d578e];return _0x2b94c8;};'use strict';var emlformat=require(_0x2f85('0x0'));var rimraf=require(_0x2f85('0x1'));var zipdir=require(_0x2f85('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2f85('0x3'));var BPromise=require(_0x2f85('0x4'));var Mustache=require(_0x2f85('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2f85('0x6'));var csv=require(_0x2f85('0x7'));var ejs=require(_0x2f85('0x8'));var fs=require('fs');var fs_extra=require(_0x2f85('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2f85('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2f85('0xb'));var toCsv=require(_0x2f85('0x7'));var querystring=require(_0x2f85('0xc'));var Papa=require('papaparse');var Redis=require(_0x2f85('0xd'));var authService=require(_0x2f85('0xe'));var qs=require(_0x2f85('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2f85('0x10'));var logger=require(_0x2f85('0x11'))(_0x2f85('0x12'));var utils=require(_0x2f85('0x13'));var config=require(_0x2f85('0x14'));var licenseUtil=require(_0x2f85('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x156104,_0x2ebc72){_0x2ebc72=_0x2ebc72||0xcc;return function(_0x4b6a15){if(_0x4b6a15){return _0x156104[_0x2f85('0x16')](_0x2ebc72);}return _0x156104[_0x2f85('0x17')](_0x2ebc72)[_0x2f85('0x18')]();};}function respondWithResult(_0x1362ee,_0x4229fc){_0x4229fc=_0x4229fc||0xc8;return function(_0x5c45be){if(_0x5c45be){return _0x1362ee[_0x2f85('0x17')](_0x4229fc)[_0x2f85('0x19')](_0x5c45be);}};}function respondWithFilteredResult(_0xe69490,_0x5b937a){return function(_0x452029){if(_0x452029){var _0x2803d1=typeof _0x5b937a[_0x2f85('0x1a')]===_0x2f85('0x1b')&&typeof _0x5b937a[_0x2f85('0x1c')]===_0x2f85('0x1b');var _0x417526=_0x452029[_0x2f85('0x1d')];var _0x498d2d=_0x2803d1?0x0:_0x5b937a['offset'];var _0x4103f3=_0x2803d1?_0x452029['count']:_0x5b937a[_0x2f85('0x1a')]+_0x5b937a[_0x2f85('0x1c')];var _0x2b5fe1;if(_0x4103f3>=_0x417526){_0x4103f3=_0x417526;_0x2b5fe1=0xc8;}else{_0x2b5fe1=0xce;}_0xe69490['status'](_0x2b5fe1);return _0xe69490[_0x2f85('0x1e')]('Content-Range',_0x498d2d+'-'+_0x4103f3+'/'+_0x417526)[_0x2f85('0x19')](_0x452029);}return null;};}function patchUpdates(_0x42c8fc){return function(_0x28c95e){try{jsonpatch[_0x2f85('0x1f')](_0x28c95e,_0x42c8fc,!![]);}catch(_0x7cce6){return BPromise[_0x2f85('0x20')](_0x7cce6);}return _0x28c95e[_0x2f85('0x21')]();};}function saveUpdates(_0x4be352,_0x33ee67){return function(_0x3d79ea){if(_0x3d79ea){return _0x3d79ea[_0x2f85('0x22')](_0x4be352)[_0x2f85('0x23')](function(_0x2dedea){return _0x2dedea;});}return null;};}function removeEntity(_0x57d332,_0x407ad8){return function(_0x503ef0){if(_0x503ef0){return _0x503ef0['destroy']()[_0x2f85('0x23')](function(){_0x57d332[_0x2f85('0x17')](0xcc)[_0x2f85('0x18')]();});}};}function handleEntityNotFound(_0x47681b,_0x593475){return function(_0x2e8b96){if(!_0x2e8b96){_0x47681b[_0x2f85('0x16')](0x194);}return _0x2e8b96;};}function handleError(_0x1c290f,_0x2e14a1){_0x2e14a1=_0x2e14a1||0x1f4;return function(_0x7159cd){logger[_0x2f85('0x24')](_0x7159cd[_0x2f85('0x25')]);if(_0x7159cd['name']){delete _0x7159cd[_0x2f85('0x26')];}_0x1c290f[_0x2f85('0x17')](_0x2e14a1)[_0x2f85('0x27')](_0x7159cd);};}exports['index']=function(_0x360919,_0x2c94dd){var _0x5ee8b2={},_0x1ab082={},_0x298f92={'count':0x0,'rows':[]};var _0x4a696b=_[_0x2f85('0x28')](db['MailTransferReport'][_0x2f85('0x29')],function(_0x4f8138){return{'name':_0x4f8138['fieldName'],'type':_0x4f8138[_0x2f85('0x2a')][_0x2f85('0x2b')]};});_0x1ab082['model']=_[_0x2f85('0x28')](_0x4a696b,_0x2f85('0x26'));_0x1ab082[_0x2f85('0x2c')]=_[_0x2f85('0x2d')](_0x360919[_0x2f85('0x2c')]);_0x1ab082[_0x2f85('0x2e')]=_[_0x2f85('0x2f')](_0x1ab082[_0x2f85('0x30')],_0x1ab082[_0x2f85('0x2c')]);_0x5ee8b2[_0x2f85('0x31')]=_[_0x2f85('0x2f')](_0x1ab082[_0x2f85('0x30')],qs[_0x2f85('0x32')](_0x360919[_0x2f85('0x2c')][_0x2f85('0x32')]));_0x5ee8b2[_0x2f85('0x31')]=_0x5ee8b2[_0x2f85('0x31')]['length']?_0x5ee8b2[_0x2f85('0x31')]:_0x1ab082[_0x2f85('0x30')];if(!_0x360919[_0x2f85('0x2c')][_0x2f85('0x33')](_0x2f85('0x34'))){_0x5ee8b2[_0x2f85('0x1c')]=qs[_0x2f85('0x1c')](_0x360919[_0x2f85('0x2c')][_0x2f85('0x1c')]);_0x5ee8b2[_0x2f85('0x1a')]=qs[_0x2f85('0x1a')](_0x360919[_0x2f85('0x2c')][_0x2f85('0x1a')]);}_0x5ee8b2['order']=qs[_0x2f85('0x35')](_0x360919[_0x2f85('0x2c')]['sort']);_0x5ee8b2[_0x2f85('0x36')]=qs[_0x2f85('0x2e')](_[_0x2f85('0x37')](_0x360919[_0x2f85('0x2c')],_0x1ab082[_0x2f85('0x2e')]),_0x4a696b);if(_0x360919[_0x2f85('0x2c')][_0x2f85('0x38')]){_0x5ee8b2[_0x2f85('0x36')]=_[_0x2f85('0x39')](_0x5ee8b2[_0x2f85('0x36')],{'$or':_[_0x2f85('0x28')](_0x4a696b,function(_0x125872){if(_0x125872[_0x2f85('0x2a')]!=='VIRTUAL'){var _0x2034cd={};_0x2034cd[_0x125872[_0x2f85('0x26')]]={'$like':'%'+_0x360919[_0x2f85('0x2c')]['filter']+'%'};return _0x2034cd;}})});}_0x5ee8b2=_[_0x2f85('0x39')]({},_0x5ee8b2,_0x360919[_0x2f85('0x3a')]);var _0x1b55b2={'where':_0x5ee8b2[_0x2f85('0x36')]};return db[_0x2f85('0x3b')]['count'](_0x1b55b2)['then'](function(_0x3e582b){_0x298f92[_0x2f85('0x1d')]=_0x3e582b;if(_0x360919[_0x2f85('0x2c')]['includeAll']){_0x5ee8b2['include']=[{'all':!![]}];}return db[_0x2f85('0x3b')][_0x2f85('0x3c')](_0x5ee8b2);})[_0x2f85('0x23')](function(_0x30b7ba){_0x298f92[_0x2f85('0x3d')]=_0x30b7ba;return _0x298f92;})['then'](respondWithFilteredResult(_0x2c94dd,_0x5ee8b2))[_0x2f85('0x3e')](handleError(_0x2c94dd,null));};exports['show']=function(_0x52a880,_0x209946){var _0x14b908={'raw':!![],'where':{'id':_0x52a880[_0x2f85('0x3f')]['id']}},_0xaf4e63={};_0xaf4e63[_0x2f85('0x30')]=_[_0x2f85('0x2d')](db[_0x2f85('0x3b')][_0x2f85('0x29')]);_0xaf4e63[_0x2f85('0x2c')]=_[_0x2f85('0x2d')](_0x52a880[_0x2f85('0x2c')]);_0xaf4e63[_0x2f85('0x2e')]=_[_0x2f85('0x2f')](_0xaf4e63[_0x2f85('0x30')],_0xaf4e63['query']);_0x14b908[_0x2f85('0x31')]=_[_0x2f85('0x2f')](_0xaf4e63[_0x2f85('0x30')],qs['fields'](_0x52a880['query'][_0x2f85('0x32')]));_0x14b908[_0x2f85('0x31')]=_0x14b908[_0x2f85('0x31')][_0x2f85('0x40')]?_0x14b908[_0x2f85('0x31')]:_0xaf4e63[_0x2f85('0x30')];if(_0x52a880['query'][_0x2f85('0x41')]){_0x14b908[_0x2f85('0x42')]=[{'all':!![]}];}_0x14b908=_[_0x2f85('0x39')]({},_0x14b908,_0x52a880[_0x2f85('0x3a')]);return db[_0x2f85('0x3b')][_0x2f85('0x43')](_0x14b908)[_0x2f85('0x23')](handleEntityNotFound(_0x209946,null))[_0x2f85('0x23')](respondWithResult(_0x209946,null))[_0x2f85('0x3e')](handleError(_0x209946,null));};exports[_0x2f85('0x44')]=function(_0x20ccd3,_0x3c39b8){return db[_0x2f85('0x3b')][_0x2f85('0x44')](_0x20ccd3[_0x2f85('0x45')],{})[_0x2f85('0x23')](respondWithResult(_0x3c39b8,0xc9))['catch'](handleError(_0x3c39b8,null));};exports['update']=function(_0x305524,_0x560b85){if(_0x305524[_0x2f85('0x45')]['id']){delete _0x305524['body']['id'];}return db[_0x2f85('0x3b')][_0x2f85('0x43')]({'where':{'id':_0x305524[_0x2f85('0x3f')]['id']}})[_0x2f85('0x23')](handleEntityNotFound(_0x560b85,null))[_0x2f85('0x23')](saveUpdates(_0x305524[_0x2f85('0x45')],null))[_0x2f85('0x23')](respondWithResult(_0x560b85,null))[_0x2f85('0x3e')](handleError(_0x560b85,null));};exports[_0x2f85('0x46')]=function(_0x1be591,_0x1d4c6b){return db[_0x2f85('0x3b')][_0x2f85('0x43')]({'where':{'id':_0x1be591[_0x2f85('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1d4c6b,null))[_0x2f85('0x23')](removeEntity(_0x1d4c6b,null))[_0x2f85('0x3e')](handleError(_0x1d4c6b,null));};exports[_0x2f85('0x47')]=function(_0x51280d,_0x297cbc){return db[_0x2f85('0x3b')][_0x2f85('0x47')]()[_0x2f85('0x23')](respondWithResult(_0x297cbc,null))[_0x2f85('0x3e')](handleError(_0x297cbc,null));}; \ No newline at end of file +var _0xe754=['bluebird','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','count','limit','set','json','apply','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','MailTransferReport','include','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xe754,0x158));var _0x4e75=function(_0x3c3045,_0x126f4c){_0x3c3045=_0x3c3045-0x0;var _0x1d6f8f=_0xe754[_0x3c3045];return _0x1d6f8f;};'use strict';var emlformat=require(_0x4e75('0x0'));var rimraf=require(_0x4e75('0x1'));var zipdir=require(_0x4e75('0x2'));var jsonpatch=require(_0x4e75('0x3'));var rp=require(_0x4e75('0x4'));var moment=require(_0x4e75('0x5'));var BPromise=require(_0x4e75('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x4e75('0x7'));var csv=require(_0x4e75('0x8'));var ejs=require(_0x4e75('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4e75('0xa'));var crypto=require(_0x4e75('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4e75('0xc'));var Papa=require(_0x4e75('0xd'));var Redis=require(_0x4e75('0xe'));var authService=require(_0x4e75('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4e75('0x10'));var hardwareService=require(_0x4e75('0x11'));var logger=require(_0x4e75('0x12'))('api');var utils=require(_0x4e75('0x13'));var config=require(_0x4e75('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4eadfe,_0x17f082){_0x17f082=_0x17f082||0xcc;return function(_0x2a8a16){if(_0x2a8a16){return _0x4eadfe[_0x4e75('0x15')](_0x17f082);}return _0x4eadfe['status'](_0x17f082)['end']();};}function respondWithResult(_0x565159,_0x2c6150){_0x2c6150=_0x2c6150||0xc8;return function(_0x5d30a2){if(_0x5d30a2){return _0x565159[_0x4e75('0x16')](_0x2c6150)['json'](_0x5d30a2);}};}function respondWithFilteredResult(_0x4bb5eb,_0x119e00){return function(_0x3f225c){if(_0x3f225c){var _0x55d8ee=typeof _0x119e00[_0x4e75('0x17')]===_0x4e75('0x18')&&typeof _0x119e00['limit']===_0x4e75('0x18');var _0x349778=_0x3f225c[_0x4e75('0x19')];var _0x2161f2=_0x55d8ee?0x0:_0x119e00['offset'];var _0x440a24=_0x55d8ee?_0x3f225c[_0x4e75('0x19')]:_0x119e00[_0x4e75('0x17')]+_0x119e00[_0x4e75('0x1a')];var _0x69db50;if(_0x440a24>=_0x349778){_0x440a24=_0x349778;_0x69db50=0xc8;}else{_0x69db50=0xce;}_0x4bb5eb[_0x4e75('0x16')](_0x69db50);return _0x4bb5eb[_0x4e75('0x1b')]('Content-Range',_0x2161f2+'-'+_0x440a24+'/'+_0x349778)[_0x4e75('0x1c')](_0x3f225c);}return null;};}function patchUpdates(_0x116584){return function(_0x93f71e){try{jsonpatch[_0x4e75('0x1d')](_0x93f71e,_0x116584,!![]);}catch(_0x2c7781){return BPromise['reject'](_0x2c7781);}return _0x93f71e[_0x4e75('0x1e')]();};}function saveUpdates(_0x138de3,_0x31d352){return function(_0x179558){if(_0x179558){return _0x179558[_0x4e75('0x1f')](_0x138de3)[_0x4e75('0x20')](function(_0x3b2633){return _0x3b2633;});}return null;};}function removeEntity(_0x15d00b,_0x26ceb3){return function(_0xe514ec){if(_0xe514ec){return _0xe514ec[_0x4e75('0x21')]()[_0x4e75('0x20')](function(){_0x15d00b[_0x4e75('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd94b62,_0x1a7daa){return function(_0x8f0f42){if(!_0x8f0f42){_0xd94b62[_0x4e75('0x15')](0x194);}return _0x8f0f42;};}function handleError(_0x35705b,_0x29e40b){_0x29e40b=_0x29e40b||0x1f4;return function(_0x4d61dd){logger['error'](_0x4d61dd[_0x4e75('0x22')]);if(_0x4d61dd[_0x4e75('0x23')]){delete _0x4d61dd[_0x4e75('0x23')];}_0x35705b[_0x4e75('0x16')](_0x29e40b)[_0x4e75('0x24')](_0x4d61dd);};}exports['index']=function(_0x3607da,_0x19c9cb){var _0x16f501={},_0x35a3fb={},_0x5d8bee={'count':0x0,'rows':[]};var _0x17316a=_[_0x4e75('0x25')](db['MailTransferReport'][_0x4e75('0x26')],function(_0x54b760){return{'name':_0x54b760[_0x4e75('0x27')],'type':_0x54b760[_0x4e75('0x28')][_0x4e75('0x29')]};});_0x35a3fb[_0x4e75('0x2a')]=_['map'](_0x17316a,_0x4e75('0x23'));_0x35a3fb['query']=_[_0x4e75('0x2b')](_0x3607da[_0x4e75('0x2c')]);_0x35a3fb[_0x4e75('0x2d')]=_[_0x4e75('0x2e')](_0x35a3fb[_0x4e75('0x2a')],_0x35a3fb['query']);_0x16f501[_0x4e75('0x2f')]=_[_0x4e75('0x2e')](_0x35a3fb[_0x4e75('0x2a')],qs[_0x4e75('0x30')](_0x3607da[_0x4e75('0x2c')][_0x4e75('0x30')]));_0x16f501[_0x4e75('0x2f')]=_0x16f501[_0x4e75('0x2f')][_0x4e75('0x31')]?_0x16f501['attributes']:_0x35a3fb['model'];if(!_0x3607da[_0x4e75('0x2c')][_0x4e75('0x32')](_0x4e75('0x33'))){_0x16f501[_0x4e75('0x1a')]=qs[_0x4e75('0x1a')](_0x3607da['query'][_0x4e75('0x1a')]);_0x16f501[_0x4e75('0x17')]=qs[_0x4e75('0x17')](_0x3607da[_0x4e75('0x2c')][_0x4e75('0x17')]);}_0x16f501[_0x4e75('0x34')]=qs[_0x4e75('0x35')](_0x3607da['query']['sort']);_0x16f501[_0x4e75('0x36')]=qs['filters'](_[_0x4e75('0x37')](_0x3607da['query'],_0x35a3fb[_0x4e75('0x2d')]),_0x17316a);if(_0x3607da['query'][_0x4e75('0x38')]){_0x16f501[_0x4e75('0x36')]=_[_0x4e75('0x39')](_0x16f501['where'],{'$or':_['map'](_0x17316a,function(_0x3bd7bf){if(_0x3bd7bf[_0x4e75('0x28')]!==_0x4e75('0x3a')){var _0x5cafe6={};_0x5cafe6[_0x3bd7bf['name']]={'$like':'%'+_0x3607da['query']['filter']+'%'};return _0x5cafe6;}})});}_0x16f501=_['merge']({},_0x16f501,_0x3607da['options']);var _0x89b57e={'where':_0x16f501[_0x4e75('0x36')]};return db[_0x4e75('0x3b')][_0x4e75('0x19')](_0x89b57e)[_0x4e75('0x20')](function(_0x5d19fb){_0x5d8bee['count']=_0x5d19fb;if(_0x3607da[_0x4e75('0x2c')]['includeAll']){_0x16f501[_0x4e75('0x3c')]=[{'all':!![]}];}return db[_0x4e75('0x3b')]['findAll'](_0x16f501);})[_0x4e75('0x20')](function(_0x57b3b3){_0x5d8bee[_0x4e75('0x3d')]=_0x57b3b3;return _0x5d8bee;})[_0x4e75('0x20')](respondWithFilteredResult(_0x19c9cb,_0x16f501))[_0x4e75('0x3e')](handleError(_0x19c9cb,null));};exports[_0x4e75('0x3f')]=function(_0xd1401e,_0x5a336b){var _0x590852={'raw':!![],'where':{'id':_0xd1401e[_0x4e75('0x40')]['id']}},_0x1e44ad={};_0x1e44ad[_0x4e75('0x2a')]=_['keys'](db[_0x4e75('0x3b')][_0x4e75('0x26')]);_0x1e44ad[_0x4e75('0x2c')]=_['keys'](_0xd1401e[_0x4e75('0x2c')]);_0x1e44ad[_0x4e75('0x2d')]=_[_0x4e75('0x2e')](_0x1e44ad[_0x4e75('0x2a')],_0x1e44ad['query']);_0x590852[_0x4e75('0x2f')]=_[_0x4e75('0x2e')](_0x1e44ad[_0x4e75('0x2a')],qs['fields'](_0xd1401e['query'][_0x4e75('0x30')]));_0x590852[_0x4e75('0x2f')]=_0x590852[_0x4e75('0x2f')][_0x4e75('0x31')]?_0x590852[_0x4e75('0x2f')]:_0x1e44ad[_0x4e75('0x2a')];if(_0xd1401e[_0x4e75('0x2c')]['includeAll']){_0x590852[_0x4e75('0x3c')]=[{'all':!![]}];}_0x590852=_[_0x4e75('0x39')]({},_0x590852,_0xd1401e[_0x4e75('0x41')]);return db[_0x4e75('0x3b')][_0x4e75('0x42')](_0x590852)[_0x4e75('0x20')](handleEntityNotFound(_0x5a336b,null))[_0x4e75('0x20')](respondWithResult(_0x5a336b,null))['catch'](handleError(_0x5a336b,null));};exports[_0x4e75('0x43')]=function(_0x3274d4,_0x4e2440){return db[_0x4e75('0x3b')][_0x4e75('0x43')](_0x3274d4['body'],{})[_0x4e75('0x20')](respondWithResult(_0x4e2440,0xc9))[_0x4e75('0x3e')](handleError(_0x4e2440,null));};exports[_0x4e75('0x1f')]=function(_0x15e4eb,_0x10064a){if(_0x15e4eb[_0x4e75('0x44')]['id']){delete _0x15e4eb[_0x4e75('0x44')]['id'];}return db['MailTransferReport'][_0x4e75('0x42')]({'where':{'id':_0x15e4eb[_0x4e75('0x40')]['id']}})[_0x4e75('0x20')](handleEntityNotFound(_0x10064a,null))[_0x4e75('0x20')](saveUpdates(_0x15e4eb['body'],null))[_0x4e75('0x20')](respondWithResult(_0x10064a,null))[_0x4e75('0x3e')](handleError(_0x10064a,null));};exports[_0x4e75('0x21')]=function(_0x249373,_0x211bb4){return db['MailTransferReport'][_0x4e75('0x42')]({'where':{'id':_0x249373[_0x4e75('0x40')]['id']}})[_0x4e75('0x20')](handleEntityNotFound(_0x211bb4,null))[_0x4e75('0x20')](removeEntity(_0x211bb4,null))[_0x4e75('0x3e')](handleError(_0x211bb4,null));};exports[_0x4e75('0x45')]=function(_0x179227,_0x123bcf){return db[_0x4e75('0x3b')][_0x4e75('0x45')]()[_0x4e75('0x20')](respondWithResult(_0x123bcf,null))[_0x4e75('0x3e')](handleError(_0x123bcf,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index ac85109..90833c6 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 _0xa41a=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','report_mail_transfer','uniqueid','lodash'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xa41a,0x6b));var _0xaa41=function(_0xfea70f,_0x21e27b){_0xfea70f=_0xfea70f-0x0;var _0x18f065=_0xa41a[_0xfea70f];return _0x18f065;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var fs=require('fs');var path=require(_0xaa41('0x6'));var rimraf=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var attributes=require(_0xaa41('0x9'));module['exports']=function(_0x2122a0,_0x1ec9d4){return _0x2122a0['define']('MailTransferReport',attributes,{'tableName':_0xaa41('0xa'),'paranoid':![],'indexes':[{'name':_0xaa41('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f49=['bluebird','../../config/environment','exports','MailTransferReport','report_mail_transfer','uniqueid','util','../../config/logger','api','moment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6f49,0xa6));var _0x96f4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6f49[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x96f4('0x0'));var logger=require(_0x96f4('0x1'))(_0x96f4('0x2'));var moment=require(_0x96f4('0x3'));var BPromise=require(_0x96f4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x96f4('0x5'));var attributes=require('./mailTransferReport.attributes');module[_0x96f4('0x6')]=function(_0x1e7389,_0x67f60f){return _0x1e7389['define'](_0x96f4('0x7'),attributes,{'tableName':_0x96f4('0x8'),'paranoid':![],'indexes':[{'name':_0x96f4('0x9'),'fields':[_0x96f4('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 c397ee5..d894f15 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 _0xa158=['catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x129216,_0x5c208d){var _0x2a0306=function(_0x319d86){while(--_0x319d86){_0x129216['push'](_0x129216['shift']());}};_0x2a0306(++_0x5c208d);}(_0xa158,0xa1));var _0x8a15=function(_0x3946ac,_0x18605c){_0x3946ac=_0x3946ac-0x0;var _0xd9671=_0xa158[_0x3946ac];return _0xd9671;};'use strict';var _=require(_0x8a15('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8a15('0x1'));var rs=require(_0x8a15('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a15('0x3'))['db'];var utils=require(_0x8a15('0x4'));var logger=require('../../config/logger')(_0x8a15('0x5'));var config=require(_0x8a15('0x6'));var jayson=require(_0x8a15('0x7'));var client=jayson[_0x8a15('0x8')][_0x8a15('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b69ec,_0x44bedd,_0x1a5904){return new BPromise(function(_0x5514b1,_0x3b2b86){return client[_0x8a15('0xa')](_0x3b69ec,_0x1a5904)['then'](function(_0x233eaa){logger[_0x8a15('0xb')](_0x8a15('0xc'),_0x44bedd,_0x8a15('0xd'));logger[_0x8a15('0xe')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x44bedd,_0x8a15('0xd'),JSON[_0x8a15('0xf')](_0x233eaa));if(_0x233eaa['error']){if(_0x233eaa[_0x8a15('0x10')]['code']===0x1f4){logger[_0x8a15('0x10')](_0x8a15('0xc'),_0x44bedd,_0x233eaa[_0x8a15('0x10')][_0x8a15('0x11')]);return _0x3b2b86(_0x233eaa['error'][_0x8a15('0x11')]);}logger[_0x8a15('0x10')](_0x8a15('0xc'),_0x44bedd,_0x233eaa['error']['message']);return _0x5514b1(_0x233eaa['error'][_0x8a15('0x11')]);}else{logger[_0x8a15('0xb')](_0x8a15('0xc'),_0x44bedd,'request\x20sent');_0x5514b1(_0x233eaa[_0x8a15('0x12')]['message']);}})[_0x8a15('0x13')](function(_0x4065fb){logger[_0x8a15('0x10')](_0x8a15('0xc'),_0x44bedd,_0x4065fb);_0x3b2b86(_0x4065fb);});});} \ No newline at end of file +var _0xe136=['client','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x7fab38,_0x501063){var _0xb5c718=function(_0x471181){while(--_0x471181){_0x7fab38['push'](_0x7fab38['shift']());}};_0xb5c718(++_0x501063);}(_0xe136,0x96));var _0x6e13=function(_0x25353c,_0x1824c2){_0x25353c=_0x25353c-0x0;var _0x4c170b=_0xe136[_0x25353c];return _0x4c170b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6e13('0x0'));var BPromise=require(_0x6e13('0x1'));var rs=require(_0x6e13('0x2'));var fs=require('fs');var Redis=require(_0x6e13('0x3'));var db=require(_0x6e13('0x4'))['db'];var utils=require(_0x6e13('0x5'));var logger=require(_0x6e13('0x6'))(_0x6e13('0x7'));var config=require(_0x6e13('0x8'));var jayson=require(_0x6e13('0x9'));var client=jayson[_0x6e13('0xa')][_0x6e13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bcd10,_0x37b230,_0x33bf71){return new BPromise(function(_0x14fe31,_0x2819d5){return client[_0x6e13('0xc')](_0x1bcd10,_0x33bf71)['then'](function(_0x555d54){logger[_0x6e13('0xd')](_0x6e13('0xe'),_0x37b230,_0x6e13('0xf'));logger['debug'](_0x6e13('0x10'),_0x37b230,_0x6e13('0xf'),JSON['stringify'](_0x555d54));if(_0x555d54['error']){if(_0x555d54[_0x6e13('0x11')]['code']===0x1f4){logger['error'](_0x6e13('0xe'),_0x37b230,_0x555d54[_0x6e13('0x11')][_0x6e13('0x12')]);return _0x2819d5(_0x555d54['error']['message']);}logger[_0x6e13('0x11')](_0x6e13('0xe'),_0x37b230,_0x555d54[_0x6e13('0x11')]['message']);return _0x14fe31(_0x555d54[_0x6e13('0x11')][_0x6e13('0x12')]);}else{logger['info'](_0x6e13('0xe'),_0x37b230,_0x6e13('0xf'));_0x14fe31(_0x555d54[_0x6e13('0x13')][_0x6e13('0x12')]);}})['catch'](function(_0x1dceb8){logger[_0x6e13('0x11')](_0x6e13('0xe'),_0x37b230,_0x1dceb8);_0x2819d5(_0x1dceb8);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index bde620d..b2c67d1 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 _0xd4d4=['index','/describe','isAuthenticated','describe','/:id','show','post','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get'];(function(_0x5e28c2,_0x1e48ab){var _0x1a8cc6=function(_0x1218bf){while(--_0x1218bf){_0x5e28c2['push'](_0x5e28c2['shift']());}};_0x1a8cc6(++_0x1e48ab);}(_0xd4d4,0x8f));var _0x4d4d=function(_0x378a64,_0x4d84b9){_0x378a64=_0x378a64-0x0;var _0xeca611=_0xd4d4[_0x378a64];return _0xeca611;};'use strict';var multer=require(_0x4d4d('0x0'));var util=require(_0x4d4d('0x1'));var path=require('path');var timeout=require(_0x4d4d('0x2'));var express=require(_0x4d4d('0x3'));var router=express[_0x4d4d('0x4')]();var fs_extra=require(_0x4d4d('0x5'));var auth=require(_0x4d4d('0x6'));var interaction=require(_0x4d4d('0x7'));var config=require(_0x4d4d('0x8'));var controller=require(_0x4d4d('0x9'));router[_0x4d4d('0xa')]('/',auth['isAuthenticated'](),controller[_0x4d4d('0xb')]);router[_0x4d4d('0xa')](_0x4d4d('0xc'),auth[_0x4d4d('0xd')](),controller[_0x4d4d('0xe')]);router[_0x4d4d('0xa')](_0x4d4d('0xf'),auth['isAuthenticated'](),controller[_0x4d4d('0x10')]);router[_0x4d4d('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4d4d('0x12')](_0x4d4d('0xf'),auth[_0x4d4d('0xd')](),controller[_0x4d4d('0x13')]);router['delete'](_0x4d4d('0xf'),auth[_0x4d4d('0xd')](),controller[_0x4d4d('0x14')]);module[_0x4d4d('0x15')]=router; \ No newline at end of file +var _0x2501=['/:id','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','index','get','/describe','describe','show','post','put','delete'];(function(_0x4395be,_0x5a2f19){var _0x2982a7=function(_0x46fc4a){while(--_0x46fc4a){_0x4395be['push'](_0x4395be['shift']());}};_0x2982a7(++_0x5a2f19);}(_0x2501,0x134));var _0x1250=function(_0x5c2cb7,_0x47e8c0){_0x5c2cb7=_0x5c2cb7-0x0;var _0x20506a=_0x2501[_0x5c2cb7];return _0x20506a;};'use strict';var multer=require(_0x1250('0x0'));var util=require('util');var path=require(_0x1250('0x1'));var timeout=require('connect-timeout');var express=require(_0x1250('0x2'));var router=express[_0x1250('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1250('0x4'));var config=require(_0x1250('0x5'));var controller=require(_0x1250('0x6'));router['get']('/',auth[_0x1250('0x7')](),controller[_0x1250('0x8')]);router[_0x1250('0x9')](_0x1250('0xa'),auth['isAuthenticated'](),controller[_0x1250('0xb')]);router['get']('/:id',auth[_0x1250('0x7')](),controller[_0x1250('0xc')]);router[_0x1250('0xd')]('/',auth[_0x1250('0x7')](),controller['create']);router[_0x1250('0xe')]('/:id',auth[_0x1250('0x7')](),controller['update']);router[_0x1250('0xf')](_0x1250('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x1250('0x11')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 3943dd9..76de49f 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 _0x225c=['enterAt','diff','setDataValue','duration','talk:[start]','talk:[destination]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue'];(function(_0x2fced0,_0x454743){var _0x25b3af=function(_0x57cefa){while(--_0x57cefa){_0x2fced0['push'](_0x2fced0['shift']());}};_0x25b3af(++_0x454743);}(_0x225c,0x106));var _0xc225=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x225c[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xc225('0x0'));var moment=require(_0xc225('0x1'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xc225('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc225('0x2')],'defaultValue':_0xc225('0x3'),'comment':_0xc225('0x4')},'duration':{'type':Sequelize[_0xc225('0x5')]},'enterAt':{'type':Sequelize[_0xc225('0x6')]},'exitAt':{'type':Sequelize[_0xc225('0x6')],'set':function(_0x22d294){var _0x54be3a=moment(_0x22d294);var _0x143eab=moment(this[_0xc225('0x7')](_0xc225('0x8')));var _0x2451fd=_0x54be3a[_0xc225('0x9')](_0x143eab,'seconds');this[_0xc225('0xa')]('exitAt',_0x22d294);this[_0xc225('0xa')](_0xc225('0xb'),_0x2451fd||null);}},'data1':{'type':Sequelize[_0xc225('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xc225('0x2')],'comment':_0xc225('0xc')},'data3':{'type':Sequelize[_0xc225('0x2')],'comment':_0xc225('0xd')},'data4':{'type':Sequelize[_0xc225('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xc225('0x2')],'comment':_0xc225('0xe')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xc225('0x2')]}}; \ No newline at end of file +var _0xac65=['sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]'];(function(_0x394da3,_0x14afb1){var _0x1e13c4=function(_0x3f562e){while(--_0x3f562e){_0x394da3['push'](_0x394da3['shift']());}};_0x1e13c4(++_0x14afb1);}(_0xac65,0x11d));var _0x5ac6=function(_0x1144d9,_0x1d47e3){_0x1144d9=_0x1144d9-0x0;var _0x44608d=_0xac65[_0x1144d9];return _0x44608d;};'use strict';var Sequelize=require(_0x5ac6('0x0'));var moment=require(_0x5ac6('0x1'));module[_0x5ac6('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5ac6('0x3')]},'interface':{'type':Sequelize[_0x5ac6('0x3')]},'type':{'type':Sequelize[_0x5ac6('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x5ac6('0x4')},'duration':{'type':Sequelize[_0x5ac6('0x5')]},'enterAt':{'type':Sequelize[_0x5ac6('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x2da747){var _0x38711d=moment(_0x2da747);var _0x130661=moment(this[_0x5ac6('0x7')](_0x5ac6('0x8')));var _0x932f6f=_0x38711d[_0x5ac6('0x9')](_0x130661,_0x5ac6('0xa'));this[_0x5ac6('0xb')](_0x5ac6('0xc'),_0x2da747);this[_0x5ac6('0xb')](_0x5ac6('0xd'),_0x932f6f||null);}},'data1':{'type':Sequelize[_0x5ac6('0x3')],'comment':_0x5ac6('0xe')},'data2':{'type':Sequelize[_0x5ac6('0x3')],'comment':_0x5ac6('0xf')},'data3':{'type':Sequelize[_0x5ac6('0x3')],'comment':_0x5ac6('0x10')},'data4':{'type':Sequelize[_0x5ac6('0x3')],'comment':_0x5ac6('0x11')},'data5':{'type':Sequelize[_0x5ac6('0x3')],'comment':_0x5ac6('0x12')},'role':{'type':Sequelize[_0x5ac6('0x3')]},'internal':{'type':Sequelize[_0x5ac6('0x5')]},'uniqueid':{'type':Sequelize[_0x5ac6('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index f910c01..18f6c35 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 _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','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','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x55ca,0x126));var _0xa55c=function(_0x2b0267,_0x59cab1){_0x2b0267=_0x2b0267-0x0;var _0x289a4a=_0x55ca[_0x2b0267];return _0x289a4a;};'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('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file +var _0x34e8=['path','sox','to-csv','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/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x34e8,0x12c));var _0x834e=function(_0x550a3d,_0x34b868){_0x550a3d=_0x550a3d-0x0;var _0x49e9a3=_0x34e8[_0x550a3d];return _0x49e9a3;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 44964b0..4486ade 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 _0xe18a=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MemberReport','membername_interface','membername','interface','util','../../config/logger','api','moment'];(function(_0x1f1bf8,_0x48c57d){var _0xcefd99=function(_0xd6ae83){while(--_0xd6ae83){_0x1f1bf8['push'](_0x1f1bf8['shift']());}};_0xcefd99(++_0x48c57d);}(_0xe18a,0x10a));var _0xae18=function(_0x19bfd8,_0x16c1b9){_0x19bfd8=_0x19bfd8-0x0;var _0x1d5ed9=_0xe18a[_0x19bfd8];return _0x1d5ed9;};'use strict';var _=require('lodash');var util=require(_0xae18('0x0'));var logger=require(_0xae18('0x1'))(_0xae18('0x2'));var moment=require(_0xae18('0x3'));var BPromise=require(_0xae18('0x4'));var rp=require(_0xae18('0x5'));var fs=require('fs');var path=require(_0xae18('0x6'));var rimraf=require(_0xae18('0x7'));var config=require(_0xae18('0x8'));var attributes=require('./memberReport.attributes');module[_0xae18('0x9')]=function(_0xa3e1f3,_0x320328){return _0xa3e1f3[_0xae18('0xa')](_0xae18('0xb'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xae18('0xc'),'fields':[_0xae18('0xd'),_0xae18('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc9b1=['./memberReport.attributes','exports','MemberReport','report_member','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x301c80,_0x12b530){var _0x35b48d=function(_0x1da11c){while(--_0x1da11c){_0x301c80['push'](_0x301c80['shift']());}};_0x35b48d(++_0x12b530);}(_0xc9b1,0xb8));var _0x1c9b=function(_0x3a1a12,_0x3cc82f){_0x3a1a12=_0x3a1a12-0x0;var _0x6ab74c=_0xc9b1[_0x3a1a12];return _0x6ab74c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1c9b('0x0'))(_0x1c9b('0x1'));var moment=require(_0x1c9b('0x2'));var BPromise=require(_0x1c9b('0x3'));var rp=require(_0x1c9b('0x4'));var fs=require('fs');var path=require(_0x1c9b('0x5'));var rimraf=require(_0x1c9b('0x6'));var config=require(_0x1c9b('0x7'));var attributes=require(_0x1c9b('0x8'));module[_0x1c9b('0x9')]=function(_0x398b97,_0xdbde74){return _0x398b97['define'](_0x1c9b('0xa'),attributes,{'tableName':_0x1c9b('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 1f73ded..f4922c0 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 _0xfa9f=['catch','GetMemberReport','findAll','options','raw','attributes','limit','include','model','map','CreateMemberReport','MemberReport','create','UpdateMemberReport','update','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x2beb70,_0x264e7a){var _0x4975b9=function(_0x3dbce7){while(--_0x3dbce7){_0x2beb70['push'](_0x2beb70['shift']());}};_0x4975b9(++_0x264e7a);}(_0xfa9f,0x93));var _0xffa9=function(_0x31b9cf,_0x1a809b){_0x31b9cf=_0x31b9cf-0x0;var _0x357b8a=_0xfa9f[_0x31b9cf];return _0x357b8a;};'use strict';var _=require('lodash');var util=require(_0xffa9('0x0'));var moment=require(_0xffa9('0x1'));var BPromise=require(_0xffa9('0x2'));var rs=require(_0xffa9('0x3'));var fs=require('fs');var Redis=require(_0xffa9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xffa9('0x5'));var logger=require('../../config/logger')(_0xffa9('0x6'));var config=require(_0xffa9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xffa9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4948c0,_0x1fe01a,_0x1fe931){return new BPromise(function(_0x249501,_0x13c3d0){return client['request'](_0x4948c0,_0x1fe931)[_0xffa9('0x9')](function(_0x1685c7){logger[_0xffa9('0xa')](_0xffa9('0xb'),_0x1fe01a,_0xffa9('0xc'));logger[_0xffa9('0xd')](_0xffa9('0xe'),_0x1fe01a,_0xffa9('0xc'),JSON[_0xffa9('0xf')](_0x1685c7));if(_0x1685c7[_0xffa9('0x10')]){if(_0x1685c7[_0xffa9('0x10')]['code']===0x1f4){logger[_0xffa9('0x10')](_0xffa9('0xb'),_0x1fe01a,_0x1685c7[_0xffa9('0x10')][_0xffa9('0x11')]);return _0x13c3d0(_0x1685c7[_0xffa9('0x10')][_0xffa9('0x11')]);}logger[_0xffa9('0x10')](_0xffa9('0xb'),_0x1fe01a,_0x1685c7[_0xffa9('0x10')][_0xffa9('0x11')]);return _0x249501(_0x1685c7['error'][_0xffa9('0x11')]);}else{logger['info'](_0xffa9('0xb'),_0x1fe01a,_0xffa9('0xc'));_0x249501(_0x1685c7['result'][_0xffa9('0x11')]);}})[_0xffa9('0x12')](function(_0x1ce6c3){logger['error'](_0xffa9('0xb'),_0x1fe01a,_0x1ce6c3);_0x13c3d0(_0x1ce6c3);});});}exports[_0xffa9('0x13')]=function(_0x3cd552){var _0x2e87a8=this;return new Promise(function(_0x4fbe1c,_0x2ee445){return db['MemberReport'][_0xffa9('0x14')]({'raw':_0x3cd552[_0xffa9('0x15')]?_0x3cd552[_0xffa9('0x15')][_0xffa9('0x16')]===undefined?!![]:![]:!![],'where':_0x3cd552[_0xffa9('0x15')]?_0x3cd552[_0xffa9('0x15')]['where']||null:null,'attributes':_0x3cd552[_0xffa9('0x15')]?_0x3cd552[_0xffa9('0x15')][_0xffa9('0x17')]||null:null,'limit':_0x3cd552[_0xffa9('0x15')]?_0x3cd552[_0xffa9('0x15')][_0xffa9('0x18')]||null:null,'include':_0x3cd552[_0xffa9('0x15')]?_0x3cd552[_0xffa9('0x15')][_0xffa9('0x19')]?_['map'](_0x3cd552['options'][_0xffa9('0x19')],function(_0x19655d){return{'model':db[_0x19655d[_0xffa9('0x1a')]],'as':_0x19655d['as'],'attributes':_0x19655d['attributes'],'include':_0x19655d['include']?_[_0xffa9('0x1b')](_0x19655d[_0xffa9('0x19')],function(_0xb22ae3){return{'model':db[_0xb22ae3['model']],'as':_0xb22ae3['as'],'attributes':_0xb22ae3['attributes'],'include':_0xb22ae3[_0xffa9('0x19')]?_['map'](_0xb22ae3[_0xffa9('0x19')],function(_0x2a2ceb){return{'model':db[_0x2a2ceb[_0xffa9('0x1a')]],'as':_0x2a2ceb['as'],'attributes':_0x2a2ceb[_0xffa9('0x17')]};}):[]};}):[]};}):[]:[]})[_0xffa9('0x9')](function(_0x1aa814){logger[_0xffa9('0xa')]('GetMemberReport',_0x3cd552);logger[_0xffa9('0xd')](_0xffa9('0x13'),_0x3cd552,JSON[_0xffa9('0xf')](_0x1aa814));_0x4fbe1c(_0x1aa814);})[_0xffa9('0x12')](function(_0x5ee60d){logger[_0xffa9('0x10')]('GetMemberReport',_0x5ee60d['message'],_0x3cd552);_0x2ee445(_0x2e87a8[_0xffa9('0x10')](0x1f4,_0x5ee60d[_0xffa9('0x11')]));});});};exports[_0xffa9('0x1c')]=function(_0x45a8a4){var _0xd353c4=this;return new Promise(function(_0x1a8703,_0x70cf75){return db[_0xffa9('0x1d')][_0xffa9('0x1e')](_0x45a8a4['body'],{'raw':_0x45a8a4[_0xffa9('0x15')]?_0x45a8a4[_0xffa9('0x15')][_0xffa9('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x475eba){logger[_0xffa9('0xa')](_0xffa9('0x1c'),_0x45a8a4);logger['debug'](_0xffa9('0x1c'),_0x45a8a4,JSON[_0xffa9('0xf')](_0x475eba));_0x1a8703(_0x475eba);})[_0xffa9('0x12')](function(_0x4c06e5){logger[_0xffa9('0x10')]('CreateMemberReport',_0x4c06e5['message'],_0x45a8a4);_0x70cf75(_0xd353c4[_0xffa9('0x10')](0x1f4,_0x4c06e5['message']));});});};exports[_0xffa9('0x1f')]=function(_0x14b965){var _0x31a325=this;return new Promise(function(_0x35babd,_0x2f7cce){return db['MemberReport'][_0xffa9('0x20')](_0x14b965['body'],{'raw':_0x14b965['options']?_0x14b965[_0xffa9('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14b965[_0xffa9('0x15')]?_0x14b965[_0xffa9('0x15')]['where']||null:null,'attributes':_0x14b965['options']?_0x14b965[_0xffa9('0x15')]['attributes']||null:null,'limit':_0x14b965[_0xffa9('0x15')]?_0x14b965[_0xffa9('0x15')]['limit']||null:null})['then'](function(_0x4827a6){logger['info'](_0xffa9('0x1f'),_0x14b965);logger[_0xffa9('0xd')](_0xffa9('0x1f'),_0x14b965,JSON['stringify'](_0x4827a6));_0x35babd(_0x4827a6);})[_0xffa9('0x12')](function(_0x3d9cd7){logger[_0xffa9('0x10')](_0xffa9('0x1f'),_0x3d9cd7[_0xffa9('0x11')],_0x14b965);_0x2f7cce(_0x31a325['error'](0x1f4,_0x3d9cd7['message']));});});}; \ No newline at end of file +var _0x2dc3=['map','include','model','create','CreateMemberReport','UpdateMemberReport','update','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MemberReport,\x20%s,\x20%s','message','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit'];(function(_0x192ff1,_0x46d596){var _0x3d4bfd=function(_0x56ee39){while(--_0x56ee39){_0x192ff1['push'](_0x192ff1['shift']());}};_0x3d4bfd(++_0x46d596);}(_0x2dc3,0x127));var _0x32dc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2dc3[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x32dc('0x0'));var moment=require(_0x32dc('0x1'));var BPromise=require(_0x32dc('0x2'));var rs=require(_0x32dc('0x3'));var fs=require('fs');var Redis=require(_0x32dc('0x4'));var db=require(_0x32dc('0x5'))['db'];var utils=require(_0x32dc('0x6'));var logger=require(_0x32dc('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x32dc('0x8'));var client=jayson['client'][_0x32dc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52336b,_0x8f2cea,_0x491a56){return new BPromise(function(_0x49c416,_0x3ae9e1){return client['request'](_0x52336b,_0x491a56)[_0x32dc('0xa')](function(_0x335ab1){logger[_0x32dc('0xb')]('MemberReport,\x20%s,\x20%s',_0x8f2cea,'request\x20sent');logger[_0x32dc('0xc')](_0x32dc('0xd'),_0x8f2cea,_0x32dc('0xe'),JSON[_0x32dc('0xf')](_0x335ab1));if(_0x335ab1[_0x32dc('0x10')]){if(_0x335ab1[_0x32dc('0x10')][_0x32dc('0x11')]===0x1f4){logger['error'](_0x32dc('0x12'),_0x8f2cea,_0x335ab1['error'][_0x32dc('0x13')]);return _0x3ae9e1(_0x335ab1[_0x32dc('0x10')][_0x32dc('0x13')]);}logger['error'](_0x32dc('0x12'),_0x8f2cea,_0x335ab1[_0x32dc('0x10')]['message']);return _0x49c416(_0x335ab1[_0x32dc('0x10')]['message']);}else{logger[_0x32dc('0xb')]('MemberReport,\x20%s,\x20%s',_0x8f2cea,'request\x20sent');_0x49c416(_0x335ab1['result'][_0x32dc('0x13')]);}})[_0x32dc('0x14')](function(_0x391c13){logger['error'](_0x32dc('0x12'),_0x8f2cea,_0x391c13);_0x3ae9e1(_0x391c13);});});}exports[_0x32dc('0x15')]=function(_0x38064a){var _0x47ccb4=this;return new Promise(function(_0x36e287,_0x36389b){return db[_0x32dc('0x16')][_0x32dc('0x17')]({'raw':_0x38064a['options']?_0x38064a[_0x32dc('0x18')][_0x32dc('0x19')]===undefined?!![]:![]:!![],'where':_0x38064a[_0x32dc('0x18')]?_0x38064a[_0x32dc('0x18')][_0x32dc('0x1a')]||null:null,'attributes':_0x38064a[_0x32dc('0x18')]?_0x38064a[_0x32dc('0x18')][_0x32dc('0x1b')]||null:null,'limit':_0x38064a['options']?_0x38064a[_0x32dc('0x18')][_0x32dc('0x1c')]||null:null,'include':_0x38064a[_0x32dc('0x18')]?_0x38064a[_0x32dc('0x18')]['include']?_[_0x32dc('0x1d')](_0x38064a[_0x32dc('0x18')][_0x32dc('0x1e')],function(_0x39182b){return{'model':db[_0x39182b['model']],'as':_0x39182b['as'],'attributes':_0x39182b[_0x32dc('0x1b')],'include':_0x39182b[_0x32dc('0x1e')]?_[_0x32dc('0x1d')](_0x39182b['include'],function(_0x51af54){return{'model':db[_0x51af54[_0x32dc('0x1f')]],'as':_0x51af54['as'],'attributes':_0x51af54['attributes'],'include':_0x51af54[_0x32dc('0x1e')]?_['map'](_0x51af54['include'],function(_0x50ccf4){return{'model':db[_0x50ccf4[_0x32dc('0x1f')]],'as':_0x50ccf4['as'],'attributes':_0x50ccf4['attributes']};}):[]};}):[]};}):[]:[]})[_0x32dc('0xa')](function(_0x26e348){logger['info'](_0x32dc('0x15'),_0x38064a);logger[_0x32dc('0xc')](_0x32dc('0x15'),_0x38064a,JSON[_0x32dc('0xf')](_0x26e348));_0x36e287(_0x26e348);})[_0x32dc('0x14')](function(_0x41d845){logger[_0x32dc('0x10')]('GetMemberReport',_0x41d845[_0x32dc('0x13')],_0x38064a);_0x36389b(_0x47ccb4[_0x32dc('0x10')](0x1f4,_0x41d845['message']));});});};exports['CreateMemberReport']=function(_0x2e240f){var _0x51e50c=this;return new Promise(function(_0x46a526,_0x5b9c3a){return db[_0x32dc('0x16')][_0x32dc('0x20')](_0x2e240f['body'],{'raw':_0x2e240f[_0x32dc('0x18')]?_0x2e240f[_0x32dc('0x18')][_0x32dc('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1b2a18){logger[_0x32dc('0xb')](_0x32dc('0x21'),_0x2e240f);logger[_0x32dc('0xc')](_0x32dc('0x21'),_0x2e240f,JSON[_0x32dc('0xf')](_0x1b2a18));_0x46a526(_0x1b2a18);})[_0x32dc('0x14')](function(_0x399f88){logger[_0x32dc('0x10')](_0x32dc('0x21'),_0x399f88['message'],_0x2e240f);_0x5b9c3a(_0x51e50c[_0x32dc('0x10')](0x1f4,_0x399f88[_0x32dc('0x13')]));});});};exports[_0x32dc('0x22')]=function(_0x267fc1){var _0x29266f=this;return new Promise(function(_0x56a34c,_0x26ca1c){return db['MemberReport'][_0x32dc('0x23')](_0x267fc1['body'],{'raw':_0x267fc1[_0x32dc('0x18')]?_0x267fc1['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x267fc1[_0x32dc('0x18')]?_0x267fc1[_0x32dc('0x18')][_0x32dc('0x1a')]||null:null,'attributes':_0x267fc1[_0x32dc('0x18')]?_0x267fc1['options'][_0x32dc('0x1b')]||null:null,'limit':_0x267fc1[_0x32dc('0x18')]?_0x267fc1[_0x32dc('0x18')][_0x32dc('0x1c')]||null:null})['then'](function(_0x4410cd){logger[_0x32dc('0xb')](_0x32dc('0x22'),_0x267fc1);logger[_0x32dc('0xc')](_0x32dc('0x22'),_0x267fc1,JSON['stringify'](_0x4410cd));_0x56a34c(_0x4410cd);})['catch'](function(_0x5c1ccb){logger['error']('UpdateMemberReport',_0x5c1ccb[_0x32dc('0x13')],_0x267fc1);_0x26ca1c(_0x29266f[_0x32dc('0x10')](0x1f4,_0x5c1ccb['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index cbf97ff..ff4b2d6 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 _0xf354=['multer','util','connect-timeout','Router','fs-extra','../../config/environment','./migration.controller','get','index','exports'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xf354,0x17c));var _0x4f35=function(_0x351510,_0x122395){_0x351510=_0x351510-0x0;var _0x334b3c=_0xf354[_0x351510];return _0x334b3c;};'use strict';var multer=require(_0x4f35('0x0'));var util=require(_0x4f35('0x1'));var path=require('path');var timeout=require(_0x4f35('0x2'));var express=require('express');var router=express[_0x4f35('0x3')]();var fs_extra=require(_0x4f35('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4f35('0x5'));var controller=require(_0x4f35('0x6'));router[_0x4f35('0x7')]('/',controller[_0x4f35('0x8')]);module[_0x4f35('0x9')]=router; \ No newline at end of file +var _0xcce9=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./migration.controller','get','exports','multer','util','path','connect-timeout'];(function(_0x169742,_0x3b8408){var _0xadda3d=function(_0x49a337){while(--_0x49a337){_0x169742['push'](_0x169742['shift']());}};_0xadda3d(++_0x3b8408);}(_0xcce9,0xd4));var _0x9cce=function(_0x4b8e65,_0x4a22bb){_0x4b8e65=_0x4b8e65-0x0;var _0x273fb0=_0xcce9[_0x4b8e65];return _0x273fb0;};'use strict';var multer=require(_0x9cce('0x0'));var util=require(_0x9cce('0x1'));var path=require(_0x9cce('0x2'));var timeout=require(_0x9cce('0x3'));var express=require(_0x9cce('0x4'));var router=express[_0x9cce('0x5')]();var fs_extra=require(_0x9cce('0x6'));var auth=require(_0x9cce('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9cce('0x8'));var controller=require(_0x9cce('0x9'));router[_0x9cce('0xa')]('/',controller['index']);module[_0x9cce('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 5bb1d3c..b8f598b 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 _0x3278=['STRING','version','exports'];(function(_0x3fd7ab,_0x3dd0bc){var _0x56cb4b=function(_0x2cd862){while(--_0x2cd862){_0x3fd7ab['push'](_0x3fd7ab['shift']());}};_0x56cb4b(++_0x3dd0bc);}(_0x3278,0x13d));var _0x8327=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3278[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x8327('0x0')]={'version':{'type':Sequelize[_0x8327('0x1')],'unique':_0x8327('0x2')}}; \ No newline at end of file +var _0x1100=['STRING','version','exports'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x1100,0x1e2));var _0x0110=function(_0x2b27b8,_0x537a6e){_0x2b27b8=_0x2b27b8-0x0;var _0x48d411=_0x1100[_0x2b27b8];return _0x48d411;};'use strict';var Sequelize=require('sequelize');module[_0x0110('0x0')]={'version':{'type':Sequelize[_0x0110('0x1')],'unique':_0x0110('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index aa6a581..3d8f1d2 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 _0xc3c6=['ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../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','destroy','then','stack','name','send','index','map','Migration','type','key','query','keys','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x2c7319,_0x4a09ec){var _0x16fdcf=function(_0x36dfbd){while(--_0x36dfbd){_0x2c7319['push'](_0x2c7319['shift']());}};_0x16fdcf(++_0x4a09ec);}(_0xc3c6,0x1db));var _0x6c3c=function(_0x1580c8,_0x52273a){_0x1580c8=_0x1580c8-0x0;var _0x36cce5=_0xc3c6[_0x1580c8];return _0x36cce5;};'use strict';var emlformat=require(_0x6c3c('0x0'));var rimraf=require(_0x6c3c('0x1'));var zipdir=require(_0x6c3c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c3c('0x3'));var moment=require(_0x6c3c('0x4'));var BPromise=require(_0x6c3c('0x5'));var Mustache=require(_0x6c3c('0x6'));var util=require(_0x6c3c('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6c3c('0x8'));var fs=require('fs');var fs_extra=require(_0x6c3c('0x9'));var _=require(_0x6c3c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6c3c('0xb'));var deskjs=require(_0x6c3c('0xc'));var toCsv=require(_0x6c3c('0xd'));var querystring=require(_0x6c3c('0xe'));var Papa=require(_0x6c3c('0xf'));var Redis=require(_0x6c3c('0x10'));var authService=require(_0x6c3c('0x11'));var qs=require(_0x6c3c('0x12'));var as=require(_0x6c3c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6c3c('0x14'))(_0x6c3c('0x15'));var utils=require(_0x6c3c('0x16'));var config=require(_0x6c3c('0x17'));var licenseUtil=require(_0x6c3c('0x18'));var db=require(_0x6c3c('0x19'))['db'];function respondWithStatusCode(_0x3db51a,_0x34a885){_0x34a885=_0x34a885||0xcc;return function(_0x6515a4){if(_0x6515a4){return _0x3db51a[_0x6c3c('0x1a')](_0x34a885);}return _0x3db51a[_0x6c3c('0x1b')](_0x34a885)[_0x6c3c('0x1c')]();};}function respondWithResult(_0xdb4949,_0x3ee583){_0x3ee583=_0x3ee583||0xc8;return function(_0x23af53){if(_0x23af53){return _0xdb4949[_0x6c3c('0x1b')](_0x3ee583)[_0x6c3c('0x1d')](_0x23af53);}};}function respondWithFilteredResult(_0x56c857,_0x547e82){return function(_0x13b365){if(_0x13b365){var _0x41436c=typeof _0x547e82[_0x6c3c('0x1e')]===_0x6c3c('0x1f')&&typeof _0x547e82[_0x6c3c('0x20')]==='undefined';var _0x5d42e3=_0x13b365['count'];var _0x4f7b34=_0x41436c?0x0:_0x547e82[_0x6c3c('0x1e')];var _0x5ad556=_0x41436c?_0x13b365[_0x6c3c('0x21')]:_0x547e82['offset']+_0x547e82['limit'];var _0xd97ac2;if(_0x5ad556>=_0x5d42e3){_0x5ad556=_0x5d42e3;_0xd97ac2=0xc8;}else{_0xd97ac2=0xce;}_0x56c857[_0x6c3c('0x1b')](_0xd97ac2);return _0x56c857[_0x6c3c('0x22')](_0x6c3c('0x23'),_0x4f7b34+'-'+_0x5ad556+'/'+_0x5d42e3)[_0x6c3c('0x1d')](_0x13b365);}return null;};}function patchUpdates(_0x34d8a7){return function(_0x4b43b7){try{jsonpatch['apply'](_0x4b43b7,_0x34d8a7,!![]);}catch(_0x15ad21){return BPromise[_0x6c3c('0x24')](_0x15ad21);}return _0x4b43b7[_0x6c3c('0x25')]();};}function saveUpdates(_0x5b5fa3,_0x2ae552){return function(_0x1bcbdf){if(_0x1bcbdf){return _0x1bcbdf[_0x6c3c('0x26')](_0x5b5fa3)['then'](function(_0x52c934){return _0x52c934;});}return null;};}function removeEntity(_0x5b4c58,_0x110ee7){return function(_0x34b294){if(_0x34b294){return _0x34b294[_0x6c3c('0x27')]()[_0x6c3c('0x28')](function(){_0x5b4c58[_0x6c3c('0x1b')](0xcc)[_0x6c3c('0x1c')]();});}};}function handleEntityNotFound(_0x10faf4,_0x19b30a){return function(_0x42caab){if(!_0x42caab){_0x10faf4[_0x6c3c('0x1a')](0x194);}return _0x42caab;};}function handleError(_0xdef823,_0x3238b4){_0x3238b4=_0x3238b4||0x1f4;return function(_0x4e9dd0){logger['error'](_0x4e9dd0[_0x6c3c('0x29')]);if(_0x4e9dd0[_0x6c3c('0x2a')]){delete _0x4e9dd0[_0x6c3c('0x2a')];}_0xdef823[_0x6c3c('0x1b')](_0x3238b4)[_0x6c3c('0x2b')](_0x4e9dd0);};}exports[_0x6c3c('0x2c')]=function(_0xacadd0,_0x4bc401){var _0x424fcb={},_0x10f9be={},_0x3bab43={'count':0x0,'rows':[]};var _0x1bfb0d=_[_0x6c3c('0x2d')](db[_0x6c3c('0x2e')]['rawAttributes'],function(_0x5448fe){return{'name':_0x5448fe['fieldName'],'type':_0x5448fe[_0x6c3c('0x2f')][_0x6c3c('0x30')]};});_0x10f9be['model']=_[_0x6c3c('0x2d')](_0x1bfb0d,_0x6c3c('0x2a'));_0x10f9be[_0x6c3c('0x31')]=_[_0x6c3c('0x32')](_0xacadd0[_0x6c3c('0x31')]);_0x10f9be['filters']=_['intersection'](_0x10f9be[_0x6c3c('0x33')],_0x10f9be[_0x6c3c('0x31')]);_0x424fcb[_0x6c3c('0x34')]=_['intersection'](_0x10f9be[_0x6c3c('0x33')],qs['fields'](_0xacadd0[_0x6c3c('0x31')][_0x6c3c('0x35')]));_0x424fcb['attributes']=_0x424fcb[_0x6c3c('0x34')]['length']?_0x424fcb[_0x6c3c('0x34')]:_0x10f9be[_0x6c3c('0x33')];if(!_0xacadd0['query'][_0x6c3c('0x36')](_0x6c3c('0x37'))){_0x424fcb[_0x6c3c('0x20')]=qs[_0x6c3c('0x20')](_0xacadd0['query'][_0x6c3c('0x20')]);_0x424fcb['offset']=qs[_0x6c3c('0x1e')](_0xacadd0['query']['offset']);}_0x424fcb[_0x6c3c('0x38')]=qs[_0x6c3c('0x39')](_0xacadd0[_0x6c3c('0x31')][_0x6c3c('0x39')]);_0x424fcb[_0x6c3c('0x3a')]=qs['filters'](_['pick'](_0xacadd0[_0x6c3c('0x31')],_0x10f9be[_0x6c3c('0x3b')]),_0x1bfb0d);if(_0xacadd0['query'][_0x6c3c('0x3c')]){_0x424fcb[_0x6c3c('0x3a')]=_[_0x6c3c('0x3d')](_0x424fcb[_0x6c3c('0x3a')],{'$or':_['map'](_0x1bfb0d,function(_0xcdf3e9){if(_0xcdf3e9[_0x6c3c('0x2f')]!==_0x6c3c('0x3e')){var _0x546843={};_0x546843[_0xcdf3e9[_0x6c3c('0x2a')]]={'$like':'%'+_0xacadd0['query'][_0x6c3c('0x3c')]+'%'};return _0x546843;}})});}_0x424fcb=_[_0x6c3c('0x3d')]({},_0x424fcb,_0xacadd0[_0x6c3c('0x3f')]);var _0x3d2aef={'where':_0x424fcb[_0x6c3c('0x3a')]};return db[_0x6c3c('0x2e')][_0x6c3c('0x21')](_0x3d2aef)[_0x6c3c('0x28')](function(_0x1b6267){_0x3bab43[_0x6c3c('0x21')]=_0x1b6267;if(_0xacadd0[_0x6c3c('0x31')][_0x6c3c('0x40')]){_0x424fcb[_0x6c3c('0x41')]=[{'all':!![]}];}return db[_0x6c3c('0x2e')][_0x6c3c('0x42')](_0x424fcb);})[_0x6c3c('0x28')](function(_0x2952b7){_0x3bab43[_0x6c3c('0x43')]=_0x2952b7;return _0x3bab43;})[_0x6c3c('0x28')](respondWithFilteredResult(_0x4bc401,_0x424fcb))[_0x6c3c('0x44')](handleError(_0x4bc401,null));}; \ No newline at end of file +var _0xaf3c=['squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','index','Migration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xaf3c,0x109));var _0xcaf3=function(_0x361d7f,_0x55c073){_0x361d7f=_0x361d7f-0x0;var _0x5643ec=_0xaf3c[_0x361d7f];return _0x5643ec;};'use strict';var emlformat=require(_0xcaf3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcaf3('0x1'));var jsonpatch=require(_0xcaf3('0x2'));var rp=require(_0xcaf3('0x3'));var moment=require(_0xcaf3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcaf3('0x5'));var util=require(_0xcaf3('0x6'));var path=require(_0xcaf3('0x7'));var sox=require(_0xcaf3('0x8'));var csv=require('to-csv');var ejs=require(_0xcaf3('0x9'));var fs=require('fs');var fs_extra=require(_0xcaf3('0xa'));var _=require('lodash');var squel=require(_0xcaf3('0xb'));var crypto=require(_0xcaf3('0xc'));var jsforce=require(_0xcaf3('0xd'));var deskjs=require(_0xcaf3('0xe'));var toCsv=require(_0xcaf3('0xf'));var querystring=require('querystring');var Papa=require(_0xcaf3('0x10'));var Redis=require(_0xcaf3('0x11'));var authService=require(_0xcaf3('0x12'));var qs=require(_0xcaf3('0x13'));var as=require(_0xcaf3('0x14'));var hardwareService=require(_0xcaf3('0x15'));var logger=require('../../config/logger')(_0xcaf3('0x16'));var utils=require(_0xcaf3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xcaf3('0x18'));var db=require(_0xcaf3('0x19'))['db'];function respondWithStatusCode(_0x44f754,_0x3ee380){_0x3ee380=_0x3ee380||0xcc;return function(_0x16e10b){if(_0x16e10b){return _0x44f754['sendStatus'](_0x3ee380);}return _0x44f754[_0xcaf3('0x1a')](_0x3ee380)[_0xcaf3('0x1b')]();};}function respondWithResult(_0x1b4f0a,_0x55a5e7){_0x55a5e7=_0x55a5e7||0xc8;return function(_0x160cfc){if(_0x160cfc){return _0x1b4f0a[_0xcaf3('0x1a')](_0x55a5e7)[_0xcaf3('0x1c')](_0x160cfc);}};}function respondWithFilteredResult(_0x1072a3,_0x2059dc){return function(_0x5eb690){if(_0x5eb690){var _0xcbcb1e=typeof _0x2059dc[_0xcaf3('0x1d')]===_0xcaf3('0x1e')&&typeof _0x2059dc['limit']===_0xcaf3('0x1e');var _0x4be783=_0x5eb690[_0xcaf3('0x1f')];var _0x223b66=_0xcbcb1e?0x0:_0x2059dc[_0xcaf3('0x1d')];var _0x4ee774=_0xcbcb1e?_0x5eb690['count']:_0x2059dc[_0xcaf3('0x1d')]+_0x2059dc[_0xcaf3('0x20')];var _0x243f9f;if(_0x4ee774>=_0x4be783){_0x4ee774=_0x4be783;_0x243f9f=0xc8;}else{_0x243f9f=0xce;}_0x1072a3[_0xcaf3('0x1a')](_0x243f9f);return _0x1072a3[_0xcaf3('0x21')](_0xcaf3('0x22'),_0x223b66+'-'+_0x4ee774+'/'+_0x4be783)[_0xcaf3('0x1c')](_0x5eb690);}return null;};}function patchUpdates(_0x12a545){return function(_0xc62145){try{jsonpatch[_0xcaf3('0x23')](_0xc62145,_0x12a545,!![]);}catch(_0x5d1c88){return BPromise['reject'](_0x5d1c88);}return _0xc62145[_0xcaf3('0x24')]();};}function saveUpdates(_0x4b7a44,_0x1f59c3){return function(_0xc9d93a){if(_0xc9d93a){return _0xc9d93a[_0xcaf3('0x25')](_0x4b7a44)[_0xcaf3('0x26')](function(_0x14e92e){return _0x14e92e;});}return null;};}function removeEntity(_0x5c08c9,_0x121a44){return function(_0x6be6d0){if(_0x6be6d0){return _0x6be6d0[_0xcaf3('0x27')]()[_0xcaf3('0x26')](function(){_0x5c08c9[_0xcaf3('0x1a')](0xcc)[_0xcaf3('0x1b')]();});}};}function handleEntityNotFound(_0x24e250,_0x4b87fc){return function(_0x1be6fe){if(!_0x1be6fe){_0x24e250[_0xcaf3('0x28')](0x194);}return _0x1be6fe;};}function handleError(_0x5f374a,_0x18e833){_0x18e833=_0x18e833||0x1f4;return function(_0x7c3553){logger[_0xcaf3('0x29')](_0x7c3553[_0xcaf3('0x2a')]);if(_0x7c3553[_0xcaf3('0x2b')]){delete _0x7c3553[_0xcaf3('0x2b')];}_0x5f374a[_0xcaf3('0x1a')](_0x18e833)['send'](_0x7c3553);};}exports[_0xcaf3('0x2c')]=function(_0x3003fc,_0x38073a){var _0x4105ef={},_0x17b964={},_0x13414b={'count':0x0,'rows':[]};var _0x3d456a=_['map'](db[_0xcaf3('0x2d')][_0xcaf3('0x2e')],function(_0xdfa30b){return{'name':_0xdfa30b[_0xcaf3('0x2f')],'type':_0xdfa30b[_0xcaf3('0x30')][_0xcaf3('0x31')]};});_0x17b964[_0xcaf3('0x32')]=_[_0xcaf3('0x33')](_0x3d456a,_0xcaf3('0x2b'));_0x17b964[_0xcaf3('0x34')]=_['keys'](_0x3003fc[_0xcaf3('0x34')]);_0x17b964[_0xcaf3('0x35')]=_[_0xcaf3('0x36')](_0x17b964[_0xcaf3('0x32')],_0x17b964[_0xcaf3('0x34')]);_0x4105ef[_0xcaf3('0x37')]=_[_0xcaf3('0x36')](_0x17b964[_0xcaf3('0x32')],qs['fields'](_0x3003fc[_0xcaf3('0x34')]['fields']));_0x4105ef[_0xcaf3('0x37')]=_0x4105ef[_0xcaf3('0x37')]['length']?_0x4105ef['attributes']:_0x17b964[_0xcaf3('0x32')];if(!_0x3003fc[_0xcaf3('0x34')][_0xcaf3('0x38')](_0xcaf3('0x39'))){_0x4105ef[_0xcaf3('0x20')]=qs['limit'](_0x3003fc['query'][_0xcaf3('0x20')]);_0x4105ef[_0xcaf3('0x1d')]=qs['offset'](_0x3003fc[_0xcaf3('0x34')][_0xcaf3('0x1d')]);}_0x4105ef[_0xcaf3('0x3a')]=qs[_0xcaf3('0x3b')](_0x3003fc['query']['sort']);_0x4105ef['where']=qs[_0xcaf3('0x35')](_[_0xcaf3('0x3c')](_0x3003fc['query'],_0x17b964[_0xcaf3('0x35')]),_0x3d456a);if(_0x3003fc[_0xcaf3('0x34')][_0xcaf3('0x3d')]){_0x4105ef[_0xcaf3('0x3e')]=_[_0xcaf3('0x3f')](_0x4105ef[_0xcaf3('0x3e')],{'$or':_[_0xcaf3('0x33')](_0x3d456a,function(_0x1da7e7){if(_0x1da7e7[_0xcaf3('0x30')]!=='VIRTUAL'){var _0x3e1662={};_0x3e1662[_0x1da7e7[_0xcaf3('0x2b')]]={'$like':'%'+_0x3003fc[_0xcaf3('0x34')]['filter']+'%'};return _0x3e1662;}})});}_0x4105ef=_['merge']({},_0x4105ef,_0x3003fc[_0xcaf3('0x40')]);var _0x4345bb={'where':_0x4105ef[_0xcaf3('0x3e')]};return db[_0xcaf3('0x2d')]['count'](_0x4345bb)[_0xcaf3('0x26')](function(_0x7bec3a){_0x13414b[_0xcaf3('0x1f')]=_0x7bec3a;if(_0x3003fc[_0xcaf3('0x34')][_0xcaf3('0x41')]){_0x4105ef[_0xcaf3('0x42')]=[{'all':!![]}];}return db['Migration']['findAll'](_0x4105ef);})[_0xcaf3('0x26')](function(_0x59ab4c){_0x13414b[_0xcaf3('0x43')]=_0x59ab4c;return _0x13414b;})['then'](respondWithFilteredResult(_0x38073a,_0x4105ef))[_0xcaf3('0x44')](handleError(_0x38073a,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index cd5f720..0438744 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 _0xd5a3=['define','Migration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./migration.attributes'];(function(_0x3da7ef,_0x2b6a93){var _0x1be631=function(_0x20af34){while(--_0x20af34){_0x3da7ef['push'](_0x3da7ef['shift']());}};_0x1be631(++_0x2b6a93);}(_0xd5a3,0x9e));var _0x3d5a=function(_0x4bd748,_0x2f731d){_0x4bd748=_0x4bd748-0x0;var _0x3c9e26=_0xd5a3[_0x4bd748];return _0x3c9e26;};'use strict';var _=require(_0x3d5a('0x0'));var util=require(_0x3d5a('0x1'));var logger=require(_0x3d5a('0x2'))(_0x3d5a('0x3'));var moment=require(_0x3d5a('0x4'));var BPromise=require(_0x3d5a('0x5'));var rp=require(_0x3d5a('0x6'));var fs=require('fs');var path=require(_0x3d5a('0x7'));var rimraf=require('rimraf');var config=require(_0x3d5a('0x8'));var attributes=require(_0x3d5a('0x9'));module['exports']=function(_0x5399a8,_0x472e5f){return _0x5399a8[_0x3d5a('0xa')](_0x3d5a('0xb'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8337=['api','bluebird','path','../../config/environment','./migration.attributes','define','Migration','migrations','lodash','util'];(function(_0x170a8f,_0xc8d837){var _0x12cefd=function(_0xe15279){while(--_0xe15279){_0x170a8f['push'](_0x170a8f['shift']());}};_0x12cefd(++_0xc8d837);}(_0x8337,0x15c));var _0x7833=function(_0x41dbfd,_0x33ff74){_0x41dbfd=_0x41dbfd-0x0;var _0x5eb024=_0x8337[_0x41dbfd];return _0x5eb024;};'use strict';var _=require(_0x7833('0x0'));var util=require(_0x7833('0x1'));var logger=require('../../config/logger')(_0x7833('0x2'));var moment=require('moment');var BPromise=require(_0x7833('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7833('0x4'));var rimraf=require('rimraf');var config=require(_0x7833('0x5'));var attributes=require(_0x7833('0x6'));module['exports']=function(_0x1a63cb,_0x3cdaae){return _0x1a63cb[_0x7833('0x7')](_0x7833('0x8'),attributes,{'tableName':_0x7833('0x9'),'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 72817fd..f53681b 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 _0x4156=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','code','Migration,\x20%s,\x20%s','message','result','lodash'];(function(_0xf8f265,_0x55bff6){var _0x23065e=function(_0x36610b){while(--_0x36610b){_0xf8f265['push'](_0xf8f265['shift']());}};_0x23065e(++_0x55bff6);}(_0x4156,0xf1));var _0x6415=function(_0x31ab05,_0x41a869){_0x31ab05=_0x31ab05-0x0;var _0x4fd44c=_0x4156[_0x31ab05];return _0x4fd44c;};'use strict';var _=require(_0x6415('0x0'));var util=require(_0x6415('0x1'));var moment=require(_0x6415('0x2'));var BPromise=require(_0x6415('0x3'));var rs=require(_0x6415('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6415('0x5'))['db'];var utils=require(_0x6415('0x6'));var logger=require(_0x6415('0x7'))(_0x6415('0x8'));var config=require(_0x6415('0x9'));var jayson=require(_0x6415('0xa'));var client=jayson[_0x6415('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24cb0,_0x47ec13,_0x4045ec){return new BPromise(function(_0x266237,_0x5bc51b){return client[_0x6415('0xc')](_0x24cb0,_0x4045ec)[_0x6415('0xd')](function(_0x3383d2){logger[_0x6415('0xe')]('Migration,\x20%s,\x20%s',_0x47ec13,_0x6415('0xf'));logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x47ec13,_0x6415('0xf'),JSON[_0x6415('0x10')](_0x3383d2));if(_0x3383d2[_0x6415('0x11')]){if(_0x3383d2[_0x6415('0x11')][_0x6415('0x12')]===0x1f4){logger[_0x6415('0x11')](_0x6415('0x13'),_0x47ec13,_0x3383d2['error']['message']);return _0x5bc51b(_0x3383d2[_0x6415('0x11')][_0x6415('0x14')]);}logger[_0x6415('0x11')](_0x6415('0x13'),_0x47ec13,_0x3383d2[_0x6415('0x11')]['message']);return _0x266237(_0x3383d2['error'][_0x6415('0x14')]);}else{logger[_0x6415('0xe')]('Migration,\x20%s,\x20%s',_0x47ec13,_0x6415('0xf'));_0x266237(_0x3383d2[_0x6415('0x15')]['message']);}})['catch'](function(_0x352a04){logger[_0x6415('0x11')](_0x6415('0x13'),_0x47ec13,_0x352a04);_0x5bc51b(_0x352a04);});});} \ No newline at end of file +var _0x682e=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','debug','request\x20sent','error','code','message'];(function(_0x347541,_0x137cf){var _0x5c0e38=function(_0x32a276){while(--_0x32a276){_0x347541['push'](_0x347541['shift']());}};_0x5c0e38(++_0x137cf);}(_0x682e,0x1ce));var _0xe682=function(_0x1d5fbb,_0x1e072b){_0x1d5fbb=_0x1d5fbb-0x0;var _0x1f49bd=_0x682e[_0x1d5fbb];return _0x1f49bd;};'use strict';var _=require(_0xe682('0x0'));var util=require(_0xe682('0x1'));var moment=require(_0xe682('0x2'));var BPromise=require(_0xe682('0x3'));var rs=require(_0xe682('0x4'));var fs=require('fs');var Redis=require(_0xe682('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe682('0x6'));var logger=require(_0xe682('0x7'))(_0xe682('0x8'));var config=require(_0xe682('0x9'));var jayson=require(_0xe682('0xa'));var client=jayson[_0xe682('0xb')][_0xe682('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd6995,_0x68a2e3,_0x1ab428){return new BPromise(function(_0x4e7e7d,_0x1817bf){return client[_0xe682('0xd')](_0xd6995,_0x1ab428)[_0xe682('0xe')](function(_0x2c098f){logger[_0xe682('0xf')](_0xe682('0x10'),_0x68a2e3,'request\x20sent');logger[_0xe682('0x11')]('Migration,\x20%s,\x20%s,\x20%s',_0x68a2e3,_0xe682('0x12'),JSON['stringify'](_0x2c098f));if(_0x2c098f['error']){if(_0x2c098f[_0xe682('0x13')][_0xe682('0x14')]===0x1f4){logger[_0xe682('0x13')](_0xe682('0x10'),_0x68a2e3,_0x2c098f[_0xe682('0x13')][_0xe682('0x15')]);return _0x1817bf(_0x2c098f['error'][_0xe682('0x15')]);}logger[_0xe682('0x13')](_0xe682('0x10'),_0x68a2e3,_0x2c098f[_0xe682('0x13')][_0xe682('0x15')]);return _0x4e7e7d(_0x2c098f[_0xe682('0x13')][_0xe682('0x15')]);}else{logger[_0xe682('0xf')]('Migration,\x20%s,\x20%s',_0x68a2e3,_0xe682('0x12'));_0x4e7e7d(_0x2c098f['result']['message']);}})['catch'](function(_0x14fc2f){logger[_0xe682('0x13')](_0xe682('0x10'),_0x68a2e3,_0x14fc2f);_0x1817bf(_0x14fc2f);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index ed3963f..9614843 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 _0x539d=['exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','index','get','/:id','show','create','put','delete','destroy'];(function(_0x2ba81c,_0x4e7433){var _0x3e33ec=function(_0x5e8ba1){while(--_0x5e8ba1){_0x2ba81c['push'](_0x2ba81c['shift']());}};_0x3e33ec(++_0x4e7433);}(_0x539d,0x17b));var _0xd539=function(_0x3eff21,_0x5bf36c){_0x3eff21=_0x3eff21-0x0;var _0x1945bb=_0x539d[_0x3eff21];return _0x1945bb;};'use strict';var multer=require(_0xd539('0x0'));var util=require('util');var path=require(_0xd539('0x1'));var timeout=require(_0xd539('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd539('0x3'));var auth=require(_0xd539('0x4'));var interaction=require(_0xd539('0x5'));var config=require(_0xd539('0x6'));var controller=require(_0xd539('0x7'));router['get']('/',auth[_0xd539('0x8')](),controller[_0xd539('0x9')]);router[_0xd539('0xa')](_0xd539('0xb'),auth[_0xd539('0x8')](),controller[_0xd539('0xc')]);router['post']('/',auth[_0xd539('0x8')](),controller[_0xd539('0xd')]);router[_0xd539('0xe')](_0xd539('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xd539('0xf')](_0xd539('0xb'),auth[_0xd539('0x8')](),controller[_0xd539('0x10')]);module[_0xd539('0x11')]=router; \ No newline at end of file +var _0xef7e=['create','put','update','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x276fac,_0x8059f3){var _0x410c97=function(_0xb473d1){while(--_0xb473d1){_0x276fac['push'](_0x276fac['shift']());}};_0x410c97(++_0x8059f3);}(_0xef7e,0x194));var _0xeef7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xef7e[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xeef7('0x0'));var util=require('util');var path=require(_0xeef7('0x1'));var timeout=require(_0xeef7('0x2'));var express=require('express');var router=express[_0xeef7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xeef7('0x4'));var interaction=require(_0xeef7('0x5'));var config=require(_0xeef7('0x6'));var controller=require(_0xeef7('0x7'));router[_0xeef7('0x8')]('/',auth[_0xeef7('0x9')](),controller[_0xeef7('0xa')]);router[_0xeef7('0x8')](_0xeef7('0xb'),auth[_0xeef7('0x9')](),controller[_0xeef7('0xc')]);router[_0xeef7('0xd')]('/',auth[_0xeef7('0x9')](),controller[_0xeef7('0xe')]);router[_0xeef7('0xf')](_0xeef7('0xb'),auth['isAuthenticated'](),controller[_0xeef7('0x10')]);router['delete'](_0xeef7('0xb'),auth[_0xeef7('0x9')](),controller[_0xeef7('0x11')]);module[_0xeef7('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 91cb817..40c8038 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 _0x8a63=['localnet','externip','stun','STRING','sequelize','exports','ENUM'];(function(_0x151381,_0x97b314){var _0x2afab6=function(_0x4b3941){while(--_0x4b3941){_0x151381['push'](_0x151381['shift']());}};_0x2afab6(++_0x97b314);}(_0x8a63,0xf2));var _0x38a6=function(_0x5a2299,_0x3e2922){_0x5a2299=_0x5a2299-0x0;var _0xedff0f=_0x8a63[_0x5a2299];return _0xedff0f;};'use strict';var Sequelize=require(_0x38a6('0x0'));module[_0x38a6('0x1')]={'type':{'type':Sequelize[_0x38a6('0x2')](_0x38a6('0x3'),_0x38a6('0x4'),_0x38a6('0x5'),'turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x38a6('0x6')]},'password':{'type':Sequelize[_0x38a6('0x6')]}}; \ No newline at end of file +var _0x9dfb=['localnet','stun','STRING','exports','ENUM'];(function(_0x273056,_0x4ca997){var _0x1e1929=function(_0x14de13){while(--_0x14de13){_0x273056['push'](_0x273056['shift']());}};_0x1e1929(++_0x4ca997);}(_0x9dfb,0x71));var _0xb9df=function(_0xf9a272,_0xe5186d){_0xf9a272=_0xf9a272-0x0;var _0x12dd75=_0x9dfb[_0xf9a272];return _0x12dd75;};'use strict';var Sequelize=require('sequelize');module[_0xb9df('0x0')]={'type':{'type':Sequelize[_0xb9df('0x1')](_0xb9df('0x2'),'externip',_0xb9df('0x3'),'turn')},'value':{'type':Sequelize[_0xb9df('0x4')]},'username':{'type':Sequelize[_0xb9df('0x4')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 10dfddf..ef6c558 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 _0x45e9=['where','type','VIRTUAL','merge','options','Network','includeAll','include','findAll','rows','params','find','create','sequelize','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter'];(function(_0x2b7ee4,_0x198e48){var _0xe4bf2a=function(_0x44c79f){while(--_0x44c79f){_0x2b7ee4['push'](_0x2b7ee4['shift']());}};_0xe4bf2a(++_0x198e48);}(_0x45e9,0x1be));var _0x945e=function(_0x2b936c,_0x27d27a){_0x2b936c=_0x2b936c-0x0;var _0x4b9b4c=_0x45e9[_0x2b936c];return _0x4b9b4c;};'use strict';var emlformat=require(_0x945e('0x0'));var rimraf=require(_0x945e('0x1'));var zipdir=require(_0x945e('0x2'));var jsonpatch=require(_0x945e('0x3'));var rp=require('request-promise');var moment=require(_0x945e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x945e('0x5'));var path=require(_0x945e('0x6'));var sox=require('sox');var csv=require(_0x945e('0x7'));var ejs=require(_0x945e('0x8'));var fs=require('fs');var fs_extra=require(_0x945e('0x9'));var _=require(_0x945e('0xa'));var squel=require('squel');var crypto=require(_0x945e('0xb'));var jsforce=require(_0x945e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x945e('0xd'));var Papa=require(_0x945e('0xe'));var Redis=require(_0x945e('0xf'));var authService=require(_0x945e('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x945e('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x945e('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x945e('0x13'));var db=require(_0x945e('0x14'))['db'];var jayson=require(_0x945e('0x15'));var client=jayson[_0x945e('0x16')][_0x945e('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x23f3df,_0x18bb10,_0x48a53e,_0x20e399){return new BPromise(function(_0x5d6c0f,_0x7fddc5){var _0x4721d7=_0x20e399||client;return _0x4721d7[_0x945e('0x18')](_0x23f3df,_0x48a53e)[_0x945e('0x19')](function(_0x42f1e7){logger['info'](_0x945e('0x1a'),_0x18bb10,_0x945e('0x1b'));logger['debug'](_0x945e('0x1c'),_0x18bb10,_0x945e('0x1b'),JSON[_0x945e('0x1d')](_0x42f1e7));if(_0x42f1e7[_0x945e('0x1e')]){if(_0x42f1e7['error'][_0x945e('0x1f')]===0x1f4){logger[_0x945e('0x1e')]('Network,\x20%s,\x20%s',_0x18bb10,_0x42f1e7['error']['message']);return _0x7fddc5(_0x42f1e7[_0x945e('0x1e')][_0x945e('0x20')]);}logger['error'](_0x945e('0x1a'),_0x18bb10,_0x42f1e7[_0x945e('0x1e')]['message']);return _0x5d6c0f(_0x42f1e7[_0x945e('0x1e')][_0x945e('0x20')]);}else{logger[_0x945e('0x21')](_0x945e('0x1a'),_0x18bb10,_0x945e('0x1b'));_0x5d6c0f(_0x42f1e7[_0x945e('0x22')][_0x945e('0x20')]);}})[_0x945e('0x23')](function(_0xaf81f3){logger[_0x945e('0x1e')](_0x945e('0x1a'),_0x18bb10,_0xaf81f3);_0x7fddc5(_0xaf81f3);});});}function respondWithStatusCode(_0x18e2d5,_0x1f4177){_0x1f4177=_0x1f4177||0xcc;return function(_0x34852f){if(_0x34852f){return _0x18e2d5[_0x945e('0x24')](_0x1f4177);}return _0x18e2d5['status'](_0x1f4177)[_0x945e('0x25')]();};}function respondWithResult(_0x438457,_0x34978b){_0x34978b=_0x34978b||0xc8;return function(_0x171c0f){if(_0x171c0f){return _0x438457['status'](_0x34978b)[_0x945e('0x26')](_0x171c0f);}};}function respondWithFilteredResult(_0x1fcd1e,_0x26f884){return function(_0xe9f309){if(_0xe9f309){var _0x260419=typeof _0x26f884[_0x945e('0x27')]===_0x945e('0x28')&&typeof _0x26f884[_0x945e('0x29')]===_0x945e('0x28');var _0x4bcc77=_0xe9f309[_0x945e('0x2a')];var _0x48e76a=_0x260419?0x0:_0x26f884[_0x945e('0x27')];var _0xeb340c=_0x260419?_0xe9f309[_0x945e('0x2a')]:_0x26f884[_0x945e('0x27')]+_0x26f884[_0x945e('0x29')];var _0x2813ac;if(_0xeb340c>=_0x4bcc77){_0xeb340c=_0x4bcc77;_0x2813ac=0xc8;}else{_0x2813ac=0xce;}_0x1fcd1e[_0x945e('0x2b')](_0x2813ac);return _0x1fcd1e[_0x945e('0x2c')]('Content-Range',_0x48e76a+'-'+_0xeb340c+'/'+_0x4bcc77)[_0x945e('0x26')](_0xe9f309);}return null;};}function patchUpdates(_0x492292){return function(_0x273948){try{jsonpatch[_0x945e('0x2d')](_0x273948,_0x492292,!![]);}catch(_0x256b64){return BPromise[_0x945e('0x2e')](_0x256b64);}return _0x273948[_0x945e('0x2f')]();};}function saveUpdates(_0x3d57b9,_0x5eec8f){return function(_0x23ef8b){if(_0x23ef8b){return _0x23ef8b[_0x945e('0x30')](_0x3d57b9)['then'](function(_0xdb1bb0){return _0xdb1bb0;});}return null;};}function removeEntity(_0x17b56b,_0x4e463d){return function(_0x4fbb8){if(_0x4fbb8){return _0x4fbb8[_0x945e('0x31')]()[_0x945e('0x19')](function(){_0x17b56b['status'](0xcc)[_0x945e('0x25')]();});}};}function handleEntityNotFound(_0x24a3a7,_0x4800d7){return function(_0x3ffc34){if(!_0x3ffc34){_0x24a3a7[_0x945e('0x24')](0x194);}return _0x3ffc34;};}function handleError(_0x18a995,_0x3e30ed){_0x3e30ed=_0x3e30ed||0x1f4;return function(_0x48ba14){logger['error'](_0x48ba14['stack']);if(_0x48ba14[_0x945e('0x32')]){delete _0x48ba14[_0x945e('0x32')];}_0x18a995[_0x945e('0x2b')](_0x3e30ed)[_0x945e('0x33')](_0x48ba14);};}exports[_0x945e('0x34')]=function(_0x30f9b4,_0x363579){var _0x585224={},_0x28ad53={},_0x37fb04={'count':0x0,'rows':[]};var _0x493372=_[_0x945e('0x35')](db['Network'][_0x945e('0x36')],function(_0x24dbd0){return{'name':_0x24dbd0[_0x945e('0x37')],'type':_0x24dbd0['type'][_0x945e('0x38')]};});_0x28ad53[_0x945e('0x39')]=_[_0x945e('0x35')](_0x493372,_0x945e('0x32'));_0x28ad53[_0x945e('0x3a')]=_[_0x945e('0x3b')](_0x30f9b4[_0x945e('0x3a')]);_0x28ad53[_0x945e('0x3c')]=_[_0x945e('0x3d')](_0x28ad53[_0x945e('0x39')],_0x28ad53[_0x945e('0x3a')]);_0x585224[_0x945e('0x3e')]=_[_0x945e('0x3d')](_0x28ad53[_0x945e('0x39')],qs[_0x945e('0x3f')](_0x30f9b4[_0x945e('0x3a')][_0x945e('0x3f')]));_0x585224[_0x945e('0x3e')]=_0x585224[_0x945e('0x3e')][_0x945e('0x40')]?_0x585224[_0x945e('0x3e')]:_0x28ad53['model'];if(!_0x30f9b4[_0x945e('0x3a')]['hasOwnProperty'](_0x945e('0x41'))){_0x585224[_0x945e('0x29')]=qs[_0x945e('0x29')](_0x30f9b4[_0x945e('0x3a')]['limit']);_0x585224[_0x945e('0x27')]=qs[_0x945e('0x27')](_0x30f9b4[_0x945e('0x3a')][_0x945e('0x27')]);}_0x585224[_0x945e('0x42')]=qs[_0x945e('0x43')](_0x30f9b4[_0x945e('0x3a')][_0x945e('0x43')]);_0x585224['where']=qs[_0x945e('0x3c')](_['pick'](_0x30f9b4[_0x945e('0x3a')],_0x28ad53[_0x945e('0x3c')]),_0x493372);if(_0x30f9b4[_0x945e('0x3a')][_0x945e('0x44')]){_0x585224[_0x945e('0x45')]=_['merge'](_0x585224['where'],{'$or':_[_0x945e('0x35')](_0x493372,function(_0x1ce7dc){if(_0x1ce7dc[_0x945e('0x46')]!==_0x945e('0x47')){var _0x3c14b8={};_0x3c14b8[_0x1ce7dc[_0x945e('0x32')]]={'$like':'%'+_0x30f9b4[_0x945e('0x3a')]['filter']+'%'};return _0x3c14b8;}})});}_0x585224=_[_0x945e('0x48')]({},_0x585224,_0x30f9b4[_0x945e('0x49')]);var _0x3f1bbe={'where':_0x585224[_0x945e('0x45')]};return db[_0x945e('0x4a')][_0x945e('0x2a')](_0x3f1bbe)['then'](function(_0xa116af){_0x37fb04[_0x945e('0x2a')]=_0xa116af;if(_0x30f9b4[_0x945e('0x3a')][_0x945e('0x4b')]){_0x585224[_0x945e('0x4c')]=[{'all':!![]}];}return db[_0x945e('0x4a')][_0x945e('0x4d')](_0x585224);})['then'](function(_0x5b69d1){_0x37fb04[_0x945e('0x4e')]=_0x5b69d1;return _0x37fb04;})[_0x945e('0x19')](respondWithFilteredResult(_0x363579,_0x585224))[_0x945e('0x23')](handleError(_0x363579,null));};exports['show']=function(_0x5a9bdb,_0xbe87cb){var _0x2c49b2={'raw':!![],'where':{'id':_0x5a9bdb[_0x945e('0x4f')]['id']}},_0x27b336={};_0x27b336[_0x945e('0x39')]=_['keys'](db[_0x945e('0x4a')][_0x945e('0x36')]);_0x27b336['query']=_[_0x945e('0x3b')](_0x5a9bdb[_0x945e('0x3a')]);_0x27b336[_0x945e('0x3c')]=_[_0x945e('0x3d')](_0x27b336['model'],_0x27b336[_0x945e('0x3a')]);_0x2c49b2[_0x945e('0x3e')]=_['intersection'](_0x27b336[_0x945e('0x39')],qs['fields'](_0x5a9bdb['query'][_0x945e('0x3f')]));_0x2c49b2[_0x945e('0x3e')]=_0x2c49b2[_0x945e('0x3e')][_0x945e('0x40')]?_0x2c49b2['attributes']:_0x27b336[_0x945e('0x39')];if(_0x5a9bdb['query'][_0x945e('0x4b')]){_0x2c49b2[_0x945e('0x4c')]=[{'all':!![]}];}_0x2c49b2=_[_0x945e('0x48')]({},_0x2c49b2,_0x5a9bdb['options']);return db[_0x945e('0x4a')][_0x945e('0x50')](_0x2c49b2)[_0x945e('0x19')](handleEntityNotFound(_0xbe87cb,null))[_0x945e('0x19')](respondWithResult(_0xbe87cb,null))[_0x945e('0x23')](handleError(_0xbe87cb,null));};exports[_0x945e('0x51')]=function(_0x29ec00,_0x449d27,_0x3b8313){var _0x4eea41;return db[_0x945e('0x52')]['transaction'](function(_0x415eb5){return db[_0x945e('0x4a')][_0x945e('0x51')](_0x29ec00['body'],{'raw':!![]})[_0x945e('0x19')](function(_0x8de94e){_0x4eea41=_0x8de94e;return db[_0x945e('0x4a')][_0x945e('0x4d')]({'where':{'type':_0x29ec00[_0x945e('0x53')][_0x945e('0x46')]},'raw':!![]});})[_0x945e('0x19')](function(_0x540224){if(_0x4eea41['type'][_0x945e('0x54')]()==_0x945e('0x55')){var _0x5254bf=fs[_0x945e('0x56')](path[_0x945e('0x57')](config[_0x945e('0x58')],_0x945e('0x59')),_0x945e('0x5a'));var _0x4807a0=ejs[_0x945e('0x5b')](_0x5254bf,{'networks':_0x540224||[]});fs[_0x945e('0x5c')](_0x945e('0x5d'),_0x4807a0);return respondWithRpcPromise(_0x945e('0x5e'),'create',{'module':_0x945e('0x5f')});}else if(_0x4eea41[_0x945e('0x46')][_0x945e('0x54')]()=='TURN'){var _0x4b9d61=fs[_0x945e('0x56')](path['join'](config[_0x945e('0x58')],_0x945e('0x60')),_0x945e('0x5a'));var _0x350b75=ejs['render'](_0x4b9d61,{'networks':_0x540224||[]});fs[_0x945e('0x5c')](_0x945e('0x61'),_0x350b75);return respondWithRpcPromise(_0x945e('0x5e'),_0x945e('0x51'),{'module':'res_stun_monitor.so'});}else{var _0x99d244=fs['readFileSync'](path[_0x945e('0x57')](config[_0x945e('0x58')],_0x945e('0x62')),_0x945e('0x5a'));var _0x4d21f9=ejs[_0x945e('0x5b')](_0x99d244,{'networks':_0x540224||[]});fs[_0x945e('0x5c')](util[_0x945e('0x63')](_0x945e('0x64'),_0x29ec00[_0x945e('0x53')]['type'][_0x945e('0x65')]()),_0x4d21f9);return respondWithRpcPromise(_0x945e('0x5e'),'create',{'module':'chan_sip.so'});}return null;})[_0x945e('0x19')](function(){return _0x4eea41;});})[_0x945e('0x19')](respondWithResult(_0x449d27,0xc9))[_0x945e('0x23')](handleError(_0x449d27,null));};exports[_0x945e('0x30')]=function(_0x5d67d8,_0x498a24,_0x56c697){var _0x4b1c28;return db[_0x945e('0x52')]['transaction'](function(_0x5b943e){return db[_0x945e('0x4a')][_0x945e('0x50')]({'where':{'id':_0x5d67d8[_0x945e('0x4f')]['id']}})[_0x945e('0x19')](handleEntityNotFound(_0x498a24,null))['then'](saveUpdates(_0x5d67d8['body'],null))['then'](function(_0x331d5d){if(_0x331d5d){_0x4b1c28=_0x331d5d;return db[_0x945e('0x4a')]['findAll']({'where':{'type':_0x4b1c28[_0x945e('0x46')]},'raw':!![]});}return null;})[_0x945e('0x19')](function(_0x4163f6){if(_0x4b1c28[_0x945e('0x46')]['toUpperCase']()==_0x945e('0x55')){var _0x502e27=fs[_0x945e('0x56')](path['join'](config[_0x945e('0x58')],_0x945e('0x59')),_0x945e('0x5a'));var _0xe8c3d6=ejs['render'](_0x502e27,{'networks':_0x4163f6||[]});fs[_0x945e('0x5c')](_0x945e('0x5d'),_0xe8c3d6);return respondWithRpcPromise('Reload',_0x945e('0x30'),{'module':_0x945e('0x5f')});}else if(_0x4b1c28[_0x945e('0x46')][_0x945e('0x54')]()=='TURN'){var _0x2b9503=fs['readFileSync'](path[_0x945e('0x57')](config[_0x945e('0x58')],_0x945e('0x60')),'utf8');var _0x37ea13=ejs['render'](_0x2b9503,{'networks':_0x4163f6||[]});fs[_0x945e('0x5c')]('/etc/asterisk/turn_xcally.conf',_0x37ea13);return respondWithRpcPromise('Reload','update',{'module':_0x945e('0x5f')});}else{var _0x3cdb9e=fs['readFileSync'](path[_0x945e('0x57')](config[_0x945e('0x58')],_0x945e('0x62')),_0x945e('0x5a'));var _0x1ad037=ejs['render'](_0x3cdb9e,{'networks':_0x4163f6||[]});fs[_0x945e('0x5c')](util[_0x945e('0x63')](_0x945e('0x64'),_0x5d67d8['body'][_0x945e('0x46')]['toLowerCase']()),_0x1ad037);return respondWithRpcPromise(_0x945e('0x5e'),_0x945e('0x30'),{'module':_0x945e('0x66')});}return null;})[_0x945e('0x19')](function(_0x493f00){if(_0x493f00){return _0x4b1c28;}return null;});})[_0x945e('0x19')](respondWithResult(_0x498a24,null))[_0x945e('0x23')](handleError(_0x498a24,null));};exports[_0x945e('0x31')]=function(_0x380ce4,_0x38ff3a,_0x158c11){var _0x50225e;return db[_0x945e('0x4a')][_0x945e('0x50')]({'where':{'id':_0x380ce4[_0x945e('0x4f')]['id']}})[_0x945e('0x19')](function(_0x57c423){_0x50225e=_0x57c423;return _0x57c423;})[_0x945e('0x19')](handleEntityNotFound(_0x38ff3a,null))['then'](removeEntity(_0x38ff3a,null))[_0x945e('0x19')](function(){if(_0x50225e){return db[_0x945e('0x4a')][_0x945e('0x4d')]({'where':{'type':_0x50225e[_0x945e('0x46')]},'raw':!![]});}})[_0x945e('0x19')](function(_0x24e5b1){if(_0x50225e[_0x945e('0x46')][_0x945e('0x54')]()==_0x945e('0x55')){var _0x2c1896=fs[_0x945e('0x56')](path['join'](config[_0x945e('0x58')],'server/files/templates/stun_multiple.ejs'),_0x945e('0x5a'));var _0x38a1c8=ejs[_0x945e('0x5b')](_0x2c1896,{'networks':_0x24e5b1||[]});fs['writeFileSync'](_0x945e('0x5d'),_0x38a1c8);return respondWithRpcPromise(_0x945e('0x5e'),_0x945e('0x31'),{'module':'res_stun_monitor.so'});}else if(_0x50225e[_0x945e('0x46')][_0x945e('0x54')]()=='TURN'){var _0x410a74=fs[_0x945e('0x56')](path[_0x945e('0x57')](config[_0x945e('0x58')],_0x945e('0x60')),_0x945e('0x5a'));var _0x22c301=ejs['render'](_0x410a74,{'networks':_0x24e5b1||[]});fs[_0x945e('0x5c')](_0x945e('0x61'),_0x22c301);return respondWithRpcPromise('Reload','destroy',{'module':_0x945e('0x5f')});}else{var _0x24dd94=fs[_0x945e('0x56')](path['join'](config[_0x945e('0x58')],_0x945e('0x62')),_0x945e('0x5a'));var _0x1f2466=ejs[_0x945e('0x5b')](_0x24dd94,{'networks':_0x24e5b1||[]});fs[_0x945e('0x5c')](util[_0x945e('0x63')](_0x945e('0x64'),_0x380ce4[_0x945e('0x53')][_0x945e('0x46')][_0x945e('0x65')]()),_0x1f2466);return respondWithRpcPromise(_0x945e('0x5e'),_0x945e('0x31'),{'module':_0x945e('0x66')});}return null;})[_0x945e('0x23')](handleError(_0x38ff3a,null));}; \ No newline at end of file +var _0x96a2=['merge','VIRTUAL','count','includeAll','include','findAll','rows','show','keys','rawAttributes','intersection','options','find','create','body','toUpperCase','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','root','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','sequelize','transaction','params','TURN','server/files/templates/turn_multiple.ejs','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','Network,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','save','update','destroy','stack','name','send','index','Network','fieldName','type','key','model','query','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter'];(function(_0x4f4547,_0x2b7b2f){var _0x5541de=function(_0x48fd60){while(--_0x48fd60){_0x4f4547['push'](_0x4f4547['shift']());}};_0x5541de(++_0x2b7b2f);}(_0x96a2,0x96));var _0x296a=function(_0x1b62fa,_0x451dc2){_0x1b62fa=_0x1b62fa-0x0;var _0x11b69e=_0x96a2[_0x1b62fa];return _0x11b69e;};'use strict';var emlformat=require(_0x296a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x296a('0x1'));var jsonpatch=require(_0x296a('0x2'));var rp=require(_0x296a('0x3'));var moment=require(_0x296a('0x4'));var BPromise=require(_0x296a('0x5'));var Mustache=require(_0x296a('0x6'));var util=require(_0x296a('0x7'));var path=require(_0x296a('0x8'));var sox=require(_0x296a('0x9'));var csv=require(_0x296a('0xa'));var ejs=require(_0x296a('0xb'));var fs=require('fs');var fs_extra=require(_0x296a('0xc'));var _=require(_0x296a('0xd'));var squel=require(_0x296a('0xe'));var crypto=require(_0x296a('0xf'));var jsforce=require(_0x296a('0x10'));var deskjs=require(_0x296a('0x11'));var toCsv=require(_0x296a('0xa'));var querystring=require('querystring');var Papa=require(_0x296a('0x12'));var Redis=require(_0x296a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x296a('0x14'));var as=require(_0x296a('0x15'));var hardwareService=require(_0x296a('0x16'));var logger=require(_0x296a('0x17'))(_0x296a('0x18'));var utils=require(_0x296a('0x19'));var config=require(_0x296a('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x296a('0x1b'))['db'];var jayson=require(_0x296a('0x1c'));var client=jayson[_0x296a('0x1d')][_0x296a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x28a7ac,_0x4cedd8,_0x29f141,_0xba0fe9){return new BPromise(function(_0x495be8,_0xc1f766){var _0x1332ea=_0xba0fe9||client;return _0x1332ea[_0x296a('0x1f')](_0x28a7ac,_0x29f141)[_0x296a('0x20')](function(_0x99b163){logger[_0x296a('0x21')]('Network,\x20%s,\x20%s',_0x4cedd8,_0x296a('0x22'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x4cedd8,'request\x20sent',JSON[_0x296a('0x23')](_0x99b163));if(_0x99b163[_0x296a('0x24')]){if(_0x99b163[_0x296a('0x24')]['code']===0x1f4){logger['error'](_0x296a('0x25'),_0x4cedd8,_0x99b163['error'][_0x296a('0x26')]);return _0xc1f766(_0x99b163[_0x296a('0x24')][_0x296a('0x26')]);}logger['error'](_0x296a('0x25'),_0x4cedd8,_0x99b163[_0x296a('0x24')][_0x296a('0x26')]);return _0x495be8(_0x99b163['error'][_0x296a('0x26')]);}else{logger[_0x296a('0x21')]('Network,\x20%s,\x20%s',_0x4cedd8,'request\x20sent');_0x495be8(_0x99b163[_0x296a('0x27')][_0x296a('0x26')]);}})[_0x296a('0x28')](function(_0x37f44e){logger[_0x296a('0x24')](_0x296a('0x25'),_0x4cedd8,_0x37f44e);_0xc1f766(_0x37f44e);});});}function respondWithStatusCode(_0x2cff01,_0x2cf007){_0x2cf007=_0x2cf007||0xcc;return function(_0x37f6d4){if(_0x37f6d4){return _0x2cff01[_0x296a('0x29')](_0x2cf007);}return _0x2cff01[_0x296a('0x2a')](_0x2cf007)[_0x296a('0x2b')]();};}function respondWithResult(_0x3f430c,_0xf6b922){_0xf6b922=_0xf6b922||0xc8;return function(_0x2177df){if(_0x2177df){return _0x3f430c['status'](_0xf6b922)[_0x296a('0x2c')](_0x2177df);}};}function respondWithFilteredResult(_0x43911b,_0x526ac5){return function(_0x2c4bed){if(_0x2c4bed){var _0x2a1e83=typeof _0x526ac5[_0x296a('0x2d')]==='undefined'&&typeof _0x526ac5[_0x296a('0x2e')]===_0x296a('0x2f');var _0x502944=_0x2c4bed['count'];var _0x15e9ac=_0x2a1e83?0x0:_0x526ac5[_0x296a('0x2d')];var _0x2d7209=_0x2a1e83?_0x2c4bed['count']:_0x526ac5['offset']+_0x526ac5[_0x296a('0x2e')];var _0x327260;if(_0x2d7209>=_0x502944){_0x2d7209=_0x502944;_0x327260=0xc8;}else{_0x327260=0xce;}_0x43911b[_0x296a('0x2a')](_0x327260);return _0x43911b[_0x296a('0x30')](_0x296a('0x31'),_0x15e9ac+'-'+_0x2d7209+'/'+_0x502944)[_0x296a('0x2c')](_0x2c4bed);}return null;};}function patchUpdates(_0x20d41e){return function(_0x917bf3){try{jsonpatch[_0x296a('0x32')](_0x917bf3,_0x20d41e,!![]);}catch(_0x2eae17){return BPromise['reject'](_0x2eae17);}return _0x917bf3[_0x296a('0x33')]();};}function saveUpdates(_0x589817,_0x4214d9){return function(_0x518b73){if(_0x518b73){return _0x518b73[_0x296a('0x34')](_0x589817)[_0x296a('0x20')](function(_0x22076b){return _0x22076b;});}return null;};}function removeEntity(_0x151741,_0x2d34ca){return function(_0x4f4573){if(_0x4f4573){return _0x4f4573[_0x296a('0x35')]()[_0x296a('0x20')](function(){_0x151741[_0x296a('0x2a')](0xcc)[_0x296a('0x2b')]();});}};}function handleEntityNotFound(_0x5be6b6,_0x114173){return function(_0x47c100){if(!_0x47c100){_0x5be6b6['sendStatus'](0x194);}return _0x47c100;};}function handleError(_0x56e562,_0x1c653d){_0x1c653d=_0x1c653d||0x1f4;return function(_0x2c3c21){logger[_0x296a('0x24')](_0x2c3c21[_0x296a('0x36')]);if(_0x2c3c21['name']){delete _0x2c3c21[_0x296a('0x37')];}_0x56e562[_0x296a('0x2a')](_0x1c653d)[_0x296a('0x38')](_0x2c3c21);};}exports[_0x296a('0x39')]=function(_0x51c78b,_0x5f4447){var _0x5d0578={},_0x362672={},_0x1d26d1={'count':0x0,'rows':[]};var _0x1495a3=_['map'](db[_0x296a('0x3a')]['rawAttributes'],function(_0x5610dc){return{'name':_0x5610dc[_0x296a('0x3b')],'type':_0x5610dc[_0x296a('0x3c')][_0x296a('0x3d')]};});_0x362672[_0x296a('0x3e')]=_['map'](_0x1495a3,_0x296a('0x37'));_0x362672[_0x296a('0x3f')]=_['keys'](_0x51c78b[_0x296a('0x3f')]);_0x362672['filters']=_['intersection'](_0x362672['model'],_0x362672[_0x296a('0x3f')]);_0x5d0578[_0x296a('0x40')]=_['intersection'](_0x362672[_0x296a('0x3e')],qs[_0x296a('0x41')](_0x51c78b[_0x296a('0x3f')][_0x296a('0x41')]));_0x5d0578[_0x296a('0x40')]=_0x5d0578[_0x296a('0x40')][_0x296a('0x42')]?_0x5d0578[_0x296a('0x40')]:_0x362672[_0x296a('0x3e')];if(!_0x51c78b[_0x296a('0x3f')]['hasOwnProperty'](_0x296a('0x43'))){_0x5d0578[_0x296a('0x2e')]=qs['limit'](_0x51c78b[_0x296a('0x3f')]['limit']);_0x5d0578['offset']=qs[_0x296a('0x2d')](_0x51c78b[_0x296a('0x3f')][_0x296a('0x2d')]);}_0x5d0578[_0x296a('0x44')]=qs[_0x296a('0x45')](_0x51c78b[_0x296a('0x3f')][_0x296a('0x45')]);_0x5d0578[_0x296a('0x46')]=qs[_0x296a('0x47')](_[_0x296a('0x48')](_0x51c78b[_0x296a('0x3f')],_0x362672[_0x296a('0x47')]),_0x1495a3);if(_0x51c78b[_0x296a('0x3f')][_0x296a('0x49')]){_0x5d0578[_0x296a('0x46')]=_[_0x296a('0x4a')](_0x5d0578['where'],{'$or':_['map'](_0x1495a3,function(_0x3c9f9c){if(_0x3c9f9c['type']!==_0x296a('0x4b')){var _0x4a7828={};_0x4a7828[_0x3c9f9c[_0x296a('0x37')]]={'$like':'%'+_0x51c78b[_0x296a('0x3f')]['filter']+'%'};return _0x4a7828;}})});}_0x5d0578=_[_0x296a('0x4a')]({},_0x5d0578,_0x51c78b['options']);var _0x431ac5={'where':_0x5d0578[_0x296a('0x46')]};return db['Network'][_0x296a('0x4c')](_0x431ac5)[_0x296a('0x20')](function(_0x533607){_0x1d26d1[_0x296a('0x4c')]=_0x533607;if(_0x51c78b[_0x296a('0x3f')][_0x296a('0x4d')]){_0x5d0578[_0x296a('0x4e')]=[{'all':!![]}];}return db[_0x296a('0x3a')][_0x296a('0x4f')](_0x5d0578);})[_0x296a('0x20')](function(_0x3fcb86){_0x1d26d1[_0x296a('0x50')]=_0x3fcb86;return _0x1d26d1;})[_0x296a('0x20')](respondWithFilteredResult(_0x5f4447,_0x5d0578))[_0x296a('0x28')](handleError(_0x5f4447,null));};exports[_0x296a('0x51')]=function(_0x23ee87,_0x403e9e){var _0x23aefa={'raw':!![],'where':{'id':_0x23ee87['params']['id']}},_0x3d1115={};_0x3d1115[_0x296a('0x3e')]=_[_0x296a('0x52')](db[_0x296a('0x3a')][_0x296a('0x53')]);_0x3d1115[_0x296a('0x3f')]=_[_0x296a('0x52')](_0x23ee87[_0x296a('0x3f')]);_0x3d1115[_0x296a('0x47')]=_['intersection'](_0x3d1115[_0x296a('0x3e')],_0x3d1115[_0x296a('0x3f')]);_0x23aefa[_0x296a('0x40')]=_[_0x296a('0x54')](_0x3d1115[_0x296a('0x3e')],qs['fields'](_0x23ee87['query'][_0x296a('0x41')]));_0x23aefa[_0x296a('0x40')]=_0x23aefa[_0x296a('0x40')][_0x296a('0x42')]?_0x23aefa[_0x296a('0x40')]:_0x3d1115[_0x296a('0x3e')];if(_0x23ee87[_0x296a('0x3f')][_0x296a('0x4d')]){_0x23aefa[_0x296a('0x4e')]=[{'all':!![]}];}_0x23aefa=_['merge']({},_0x23aefa,_0x23ee87[_0x296a('0x55')]);return db[_0x296a('0x3a')][_0x296a('0x56')](_0x23aefa)['then'](handleEntityNotFound(_0x403e9e,null))[_0x296a('0x20')](respondWithResult(_0x403e9e,null))[_0x296a('0x28')](handleError(_0x403e9e,null));};exports[_0x296a('0x57')]=function(_0x165a8c,_0x46ab3e,_0x3d2019){var _0x19df68;return db['sequelize']['transaction'](function(_0x1463eb){return db['Network'][_0x296a('0x57')](_0x165a8c[_0x296a('0x58')],{'raw':!![]})[_0x296a('0x20')](function(_0x47038f){_0x19df68=_0x47038f;return db[_0x296a('0x3a')][_0x296a('0x4f')]({'where':{'type':_0x165a8c[_0x296a('0x58')][_0x296a('0x3c')]},'raw':!![]});})[_0x296a('0x20')](function(_0x401dba){if(_0x19df68['type'][_0x296a('0x59')]()==_0x296a('0x5a')){var _0x3fe627=fs[_0x296a('0x5b')](path[_0x296a('0x5c')](config['root'],_0x296a('0x5d')),_0x296a('0x5e'));var _0x2593cd=ejs[_0x296a('0x5f')](_0x3fe627,{'networks':_0x401dba||[]});fs[_0x296a('0x60')](_0x296a('0x61'),_0x2593cd);return respondWithRpcPromise(_0x296a('0x62'),_0x296a('0x57'),{'module':_0x296a('0x63')});}else if(_0x19df68[_0x296a('0x3c')]['toUpperCase']()=='TURN'){var _0x2f2ca0=fs[_0x296a('0x5b')](path['join'](config[_0x296a('0x64')],'server/files/templates/turn_multiple.ejs'),_0x296a('0x5e'));var _0x3b33df=ejs[_0x296a('0x5f')](_0x2f2ca0,{'networks':_0x401dba||[]});fs['writeFileSync'](_0x296a('0x65'),_0x3b33df);return respondWithRpcPromise('Reload',_0x296a('0x57'),{'module':_0x296a('0x63')});}else{var _0x537b07=fs[_0x296a('0x5b')](path[_0x296a('0x5c')](config[_0x296a('0x64')],_0x296a('0x66')),_0x296a('0x5e'));var _0x34bdfd=ejs['render'](_0x537b07,{'networks':_0x401dba||[]});fs[_0x296a('0x60')](util[_0x296a('0x67')](_0x296a('0x68'),_0x165a8c[_0x296a('0x58')]['type'][_0x296a('0x69')]()),_0x34bdfd);return respondWithRpcPromise(_0x296a('0x62'),_0x296a('0x57'),{'module':_0x296a('0x6a')});}return null;})[_0x296a('0x20')](function(){return _0x19df68;});})['then'](respondWithResult(_0x46ab3e,0xc9))[_0x296a('0x28')](handleError(_0x46ab3e,null));};exports[_0x296a('0x34')]=function(_0x42e09c,_0x3728e3,_0x1f73b8){var _0x91d553;return db[_0x296a('0x6b')][_0x296a('0x6c')](function(_0x50d4c6){return db['Network'][_0x296a('0x56')]({'where':{'id':_0x42e09c['params']['id']}})[_0x296a('0x20')](handleEntityNotFound(_0x3728e3,null))[_0x296a('0x20')](saveUpdates(_0x42e09c[_0x296a('0x58')],null))[_0x296a('0x20')](function(_0x13c938){if(_0x13c938){_0x91d553=_0x13c938;return db[_0x296a('0x3a')][_0x296a('0x4f')]({'where':{'type':_0x91d553[_0x296a('0x3c')]},'raw':!![]});}return null;})[_0x296a('0x20')](function(_0x5aca44){if(_0x91d553[_0x296a('0x3c')][_0x296a('0x59')]()=='STUN'){var _0x2ee722=fs[_0x296a('0x5b')](path[_0x296a('0x5c')](config[_0x296a('0x64')],_0x296a('0x5d')),_0x296a('0x5e'));var _0x63004e=ejs[_0x296a('0x5f')](_0x2ee722,{'networks':_0x5aca44||[]});fs[_0x296a('0x60')](_0x296a('0x61'),_0x63004e);return respondWithRpcPromise(_0x296a('0x62'),_0x296a('0x34'),{'module':_0x296a('0x63')});}else if(_0x91d553[_0x296a('0x3c')][_0x296a('0x59')]()=='TURN'){var _0x738980=fs[_0x296a('0x5b')](path[_0x296a('0x5c')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x296a('0x5e'));var _0x584acc=ejs[_0x296a('0x5f')](_0x738980,{'networks':_0x5aca44||[]});fs[_0x296a('0x60')](_0x296a('0x65'),_0x584acc);return respondWithRpcPromise('Reload',_0x296a('0x34'),{'module':_0x296a('0x63')});}else{var _0x1b8765=fs[_0x296a('0x5b')](path[_0x296a('0x5c')](config[_0x296a('0x64')],'server/files/templates/network.ejs'),_0x296a('0x5e'));var _0x427718=ejs['render'](_0x1b8765,{'networks':_0x5aca44||[]});fs[_0x296a('0x60')](util[_0x296a('0x67')](_0x296a('0x68'),_0x42e09c[_0x296a('0x58')][_0x296a('0x3c')][_0x296a('0x69')]()),_0x427718);return respondWithRpcPromise(_0x296a('0x62'),_0x296a('0x34'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x31d5fb){if(_0x31d5fb){return _0x91d553;}return null;});})[_0x296a('0x20')](respondWithResult(_0x3728e3,null))[_0x296a('0x28')](handleError(_0x3728e3,null));};exports[_0x296a('0x35')]=function(_0x1faa25,_0x7d3470,_0x3e6634){var _0xf7c9ff;return db[_0x296a('0x3a')]['find']({'where':{'id':_0x1faa25[_0x296a('0x6d')]['id']}})[_0x296a('0x20')](function(_0x536cb3){_0xf7c9ff=_0x536cb3;return _0x536cb3;})[_0x296a('0x20')](handleEntityNotFound(_0x7d3470,null))['then'](removeEntity(_0x7d3470,null))[_0x296a('0x20')](function(){if(_0xf7c9ff){return db[_0x296a('0x3a')][_0x296a('0x4f')]({'where':{'type':_0xf7c9ff[_0x296a('0x3c')]},'raw':!![]});}})[_0x296a('0x20')](function(_0x3a3ab0){if(_0xf7c9ff[_0x296a('0x3c')]['toUpperCase']()==_0x296a('0x5a')){var _0x24ce4d=fs['readFileSync'](path[_0x296a('0x5c')](config[_0x296a('0x64')],_0x296a('0x5d')),_0x296a('0x5e'));var _0x47ecd0=ejs[_0x296a('0x5f')](_0x24ce4d,{'networks':_0x3a3ab0||[]});fs[_0x296a('0x60')]('/etc/asterisk/stun_xcally.conf',_0x47ecd0);return respondWithRpcPromise(_0x296a('0x62'),_0x296a('0x35'),{'module':_0x296a('0x63')});}else if(_0xf7c9ff[_0x296a('0x3c')][_0x296a('0x59')]()==_0x296a('0x6e')){var _0x436e36=fs[_0x296a('0x5b')](path['join'](config[_0x296a('0x64')],_0x296a('0x6f')),_0x296a('0x5e'));var _0x470f64=ejs[_0x296a('0x5f')](_0x436e36,{'networks':_0x3a3ab0||[]});fs['writeFileSync'](_0x296a('0x65'),_0x470f64);return respondWithRpcPromise('Reload',_0x296a('0x35'),{'module':_0x296a('0x63')});}else{var _0x29804e=fs[_0x296a('0x5b')](path[_0x296a('0x5c')](config['root'],_0x296a('0x66')),_0x296a('0x5e'));var _0x59d7e2=ejs[_0x296a('0x5f')](_0x29804e,{'networks':_0x3a3ab0||[]});fs[_0x296a('0x60')](util[_0x296a('0x67')](_0x296a('0x68'),_0x1faa25[_0x296a('0x58')]['type']['toLowerCase']()),_0x59d7e2);return respondWithRpcPromise('Reload',_0x296a('0x35'),{'module':_0x296a('0x6a')});}return null;})['catch'](handleError(_0x7d3470,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 287c0ef..b298e98 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 _0x99e9=['util','../../config/logger','api','moment','request-promise','path','rimraf','./network.attributes','define','Network'];(function(_0xe68cf1,_0x3ba0d7){var _0x9f5345=function(_0x29a9aa){while(--_0x29a9aa){_0xe68cf1['push'](_0xe68cf1['shift']());}};_0x9f5345(++_0x3ba0d7);}(_0x99e9,0xb4));var _0x999e=function(_0x256b67,_0x14e47b){_0x256b67=_0x256b67-0x0;var _0x3e2d99=_0x99e9[_0x256b67];return _0x3e2d99;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var logger=require(_0x999e('0x1'))(_0x999e('0x2'));var moment=require(_0x999e('0x3'));var BPromise=require('bluebird');var rp=require(_0x999e('0x4'));var fs=require('fs');var path=require(_0x999e('0x5'));var rimraf=require(_0x999e('0x6'));var config=require('../../config/environment');var attributes=require(_0x999e('0x7'));module['exports']=function(_0x25421f,_0x1bda0a){return _0x25421f[_0x999e('0x8')](_0x999e('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57f8=['Network','network','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define'];(function(_0x5d1044,_0x18f656){var _0x3cd90e=function(_0x3c40be){while(--_0x3c40be){_0x5d1044['push'](_0x5d1044['shift']());}};_0x3cd90e(++_0x18f656);}(_0x57f8,0x198));var _0x857f=function(_0x273b7e,_0x1b642f){_0x273b7e=_0x273b7e-0x0;var _0x5df145=_0x57f8[_0x273b7e];return _0x5df145;};'use strict';var _=require('lodash');var util=require(_0x857f('0x0'));var logger=require(_0x857f('0x1'))(_0x857f('0x2'));var moment=require(_0x857f('0x3'));var BPromise=require(_0x857f('0x4'));var rp=require(_0x857f('0x5'));var fs=require('fs');var path=require(_0x857f('0x6'));var rimraf=require(_0x857f('0x7'));var config=require(_0x857f('0x8'));var attributes=require(_0x857f('0x9'));module[_0x857f('0xa')]=function(_0x369c40,_0x5d22e4){return _0x369c40[_0x857f('0xb')](_0x857f('0xc'),attributes,{'tableName':_0x857f('0xd'),'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 005f50c..26897de 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(_0x488404,_0x1b9b63){var _0x482705=function(_0x4793e6){while(--_0x4793e6){_0x488404['push'](_0x488404['shift']());}};_0x482705(++_0x1b9b63);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 _0x7a54=['info','Network,\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(_0x4c324f,_0x434f2c){_0x4c324f=_0x4c324f-0x0;var _0x202c76=_0x7a54[_0x4c324f];return _0x202c76;};'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')]('Network,\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 diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 6171a63..60cbd3a 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 _0xa34b=['/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/users','getAgents','create','post','addDisposition','/:id/notify','notify','addApplications','addAgents','/:id/send','send','delete','removeDispositions','removeAgents','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id'];(function(_0x175479,_0x461b1f){var _0x4d8163=function(_0x1bcd45){while(--_0x1bcd45){_0x175479['push'](_0x175479['shift']());}};_0x4d8163(++_0x461b1f);}(_0xa34b,0x10c));var _0xba34=function(_0x547210,_0x19a707){_0x547210=_0x547210-0x0;var _0x30182b=_0xa34b[_0x547210];return _0x30182b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xba34('0x0'));var router=express[_0xba34('0x1')]();var fs_extra=require(_0xba34('0x2'));var auth=require(_0xba34('0x3'));var interaction=require(_0xba34('0x4'));var config=require(_0xba34('0x5'));var controller=require('./openchannelAccount.controller');router[_0xba34('0x6')]('/',auth[_0xba34('0x7')](),controller[_0xba34('0x8')]);router[_0xba34('0x6')]('/describe',auth[_0xba34('0x7')](),controller[_0xba34('0x9')]);router[_0xba34('0x6')](_0xba34('0xa'),auth[_0xba34('0x7')](),controller['show']);router[_0xba34('0x6')](_0xba34('0xb'),auth[_0xba34('0x7')](),controller[_0xba34('0xc')]);router[_0xba34('0x6')](_0xba34('0xd'),auth[_0xba34('0x7')](),controller[_0xba34('0xe')]);router[_0xba34('0x6')]('/:id/applications',auth[_0xba34('0x7')](),controller['getApplications']);router[_0xba34('0x6')]('/:id/interactions',auth[_0xba34('0x7')](),controller[_0xba34('0xf')]);router[_0xba34('0x6')](_0xba34('0x10'),auth['isAuthenticated'](),controller[_0xba34('0x11')]);router['post']('/',auth[_0xba34('0x7')](),controller[_0xba34('0x12')]);router[_0xba34('0x13')](_0xba34('0xb'),auth[_0xba34('0x7')](),controller[_0xba34('0x14')]);router[_0xba34('0x13')](_0xba34('0xd'),auth[_0xba34('0x7')](),controller['addAnswer']);router[_0xba34('0x13')](_0xba34('0x15'),controller[_0xba34('0x16')]);router[_0xba34('0x13')]('/:id/applications',auth[_0xba34('0x7')](),controller[_0xba34('0x17')]);router[_0xba34('0x13')](_0xba34('0x10'),auth[_0xba34('0x7')](),controller[_0xba34('0x18')]);router[_0xba34('0x13')](_0xba34('0x19'),auth['isAuthenticated'](),controller[_0xba34('0x1a')]);router['put'](_0xba34('0xa'),auth[_0xba34('0x7')](),controller['update']);router[_0xba34('0x1b')](_0xba34('0xa'),auth[_0xba34('0x7')](),controller['destroy']);router[_0xba34('0x1b')](_0xba34('0xb'),auth[_0xba34('0x7')](),controller[_0xba34('0x1c')]);router[_0xba34('0x1b')]('/:id/canned_answers',auth[_0xba34('0x7')](),controller['removeAnswers']);router[_0xba34('0x1b')](_0xba34('0x10'),auth[_0xba34('0x7')](),controller[_0xba34('0x1d')]);module[_0xba34('0x1e')]=router; \ No newline at end of file +var _0xd867=['create','addDisposition','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','post'];(function(_0x1e175d,_0x41ff45){var _0x3a3ce5=function(_0x186001){while(--_0x186001){_0x1e175d['push'](_0x1e175d['shift']());}};_0x3a3ce5(++_0x41ff45);}(_0xd867,0x1c7));var _0x7d86=function(_0x3cfa43,_0x4bf2eb){_0x3cfa43=_0x3cfa43-0x0;var _0x1265ea=_0xd867[_0x3cfa43];return _0x1265ea;};'use strict';var multer=require(_0x7d86('0x0'));var util=require(_0x7d86('0x1'));var path=require(_0x7d86('0x2'));var timeout=require('connect-timeout');var express=require(_0x7d86('0x3'));var router=express[_0x7d86('0x4')]();var fs_extra=require(_0x7d86('0x5'));var auth=require(_0x7d86('0x6'));var interaction=require(_0x7d86('0x7'));var config=require(_0x7d86('0x8'));var controller=require('./openchannelAccount.controller');router[_0x7d86('0x9')]('/',auth[_0x7d86('0xa')](),controller[_0x7d86('0xb')]);router['get'](_0x7d86('0xc'),auth['isAuthenticated'](),controller[_0x7d86('0xd')]);router[_0x7d86('0x9')](_0x7d86('0xe'),auth[_0x7d86('0xa')](),controller[_0x7d86('0xf')]);router[_0x7d86('0x9')](_0x7d86('0x10'),auth[_0x7d86('0xa')](),controller['getDispositions']);router[_0x7d86('0x9')](_0x7d86('0x11'),auth[_0x7d86('0xa')](),controller[_0x7d86('0x12')]);router[_0x7d86('0x9')](_0x7d86('0x13'),auth['isAuthenticated'](),controller[_0x7d86('0x14')]);router[_0x7d86('0x9')](_0x7d86('0x15'),auth['isAuthenticated'](),controller[_0x7d86('0x16')]);router[_0x7d86('0x9')](_0x7d86('0x17'),auth['isAuthenticated'](),controller['getAgents']);router[_0x7d86('0x18')]('/',auth['isAuthenticated'](),controller[_0x7d86('0x19')]);router[_0x7d86('0x18')](_0x7d86('0x10'),auth[_0x7d86('0xa')](),controller[_0x7d86('0x1a')]);router['post'](_0x7d86('0x11'),auth[_0x7d86('0xa')](),controller['addAnswer']);router[_0x7d86('0x18')](_0x7d86('0x1b'),controller[_0x7d86('0x1c')]);router['post'](_0x7d86('0x13'),auth[_0x7d86('0xa')](),controller[_0x7d86('0x1d')]);router[_0x7d86('0x18')]('/:id/users',auth[_0x7d86('0xa')](),controller[_0x7d86('0x1e')]);router[_0x7d86('0x18')](_0x7d86('0x1f'),auth['isAuthenticated'](),controller[_0x7d86('0x20')]);router[_0x7d86('0x21')](_0x7d86('0xe'),auth[_0x7d86('0xa')](),controller[_0x7d86('0x22')]);router[_0x7d86('0x23')](_0x7d86('0xe'),auth['isAuthenticated'](),controller[_0x7d86('0x24')]);router[_0x7d86('0x23')](_0x7d86('0x10'),auth['isAuthenticated'](),controller[_0x7d86('0x25')]);router[_0x7d86('0x23')](_0x7d86('0x11'),auth['isAuthenticated'](),controller[_0x7d86('0x26')]);router[_0x7d86('0x23')]('/:id/users',auth[_0x7d86('0xa')](),controller['removeAgents']);module[_0x7d86('0x27')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 8fa97ee..ec6a4a0 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 _0x4766=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','name','STRING','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'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4766,0xac));var _0x6476=function(_0x241c0f,_0x10e212){_0x241c0f=_0x241c0f-0x0;var _0x15c36d=_0x4766[_0x241c0f];return _0x15c36d;};'use strict';var Sequelize=require(_0x6476('0x0'));var rs=require(_0x6476('0x1'));module[_0x6476('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x6476('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6476('0x4')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x6476('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x6476('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6476('0x5')],'defaultValue':function(){return _0x6476('0x6');}},'notificationSound':{'type':Sequelize[_0x6476('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6476('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6476('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x6476('0x4')]},'queueTransfer':{'type':Sequelize[_0x6476('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6476('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6476('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6476('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x6476('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x6476('0x7')],'defaultValue':![],'comment':_0x6476('0xa'),'set':function(_0x451967){if(!_0x451967)this[_0x6476('0xb')](_0x6476('0xc'),null);this[_0x6476('0xb')]('mandatoryDisposition',_0x451967);}}}; \ No newline at end of file +var _0xfc90=['name','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfc90,0x1ba));var _0x0fc9=function(_0x2b5cdc,_0x2f906d){_0x2b5cdc=_0x2b5cdc-0x0;var _0x4df3f3=_0xfc90[_0x2b5cdc];return _0x4df3f3;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x0fc9('0x0')]={'name':{'type':Sequelize[_0x0fc9('0x1')],'unique':_0x0fc9('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x0fc9('0x1')]},'token':{'type':Sequelize[_0x0fc9('0x1')],'defaultValue':function(){return rs[_0x0fc9('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x0fc9('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0fc9('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[_0x0fc9('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0fc9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x0fc9('0x1')]},'queueTransfer':{'type':Sequelize[_0x0fc9('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0fc9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0fc9('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0fc9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0fc9('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x0fc9('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x0fc9('0x5')],'defaultValue':![],'comment':_0x0fc9('0x8'),'set':function(_0x5dedb3){if(!_0x5dedb3)this['setDataValue'](_0x0fc9('0x9'),null);this[_0x0fc9('0xa')](_0x0fc9('0xb'),_0x5dedb3);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 77eed2b..cc777a2 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 _0x4bc0=['no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','from','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','OpenchannelApplication','List','account','applications','Applications','list','orderBy','contact','firstName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','pick','Owner','fullname','internal','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','OpenchannelMessage','Messages','dataValues','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','client','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','show','length','options','find','catch','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','describe','addDisposition','Disposition','getDispositions','findOne','order','OpenchannelAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','CmContact','Sequelize','ValidationError'];(function(_0x3f1654,_0x3ffdbb){var _0x188e10=function(_0xace116){while(--_0xace116){_0x3f1654['push'](_0x3f1654['shift']());}};_0x188e10(++_0x3ffdbb);}(_0x4bc0,0x104));var _0x04bc=function(_0x127e32,_0x2c6655){_0x127e32=_0x127e32-0x0;var _0x34e527=_0x4bc0[_0x127e32];return _0x34e527;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x04bc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x04bc('0x1'));var rp=require(_0x04bc('0x2'));var moment=require(_0x04bc('0x3'));var BPromise=require(_0x04bc('0x4'));var Mustache=require(_0x04bc('0x5'));var util=require(_0x04bc('0x6'));var path=require(_0x04bc('0x7'));var sox=require(_0x04bc('0x8'));var csv=require(_0x04bc('0x9'));var ejs=require(_0x04bc('0xa'));var fs=require('fs');var fs_extra=require(_0x04bc('0xb'));var _=require('lodash');var squel=require(_0x04bc('0xc'));var crypto=require(_0x04bc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x04bc('0xe'));var toCsv=require(_0x04bc('0x9'));var querystring=require(_0x04bc('0xf'));var Papa=require(_0x04bc('0x10'));var Redis=require(_0x04bc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x04bc('0x12'));var as=require(_0x04bc('0x13'));var hardwareService=require(_0x04bc('0x14'));var logger=require(_0x04bc('0x15'))(_0x04bc('0x16'));var utils=require(_0x04bc('0x17'));var config=require(_0x04bc('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x04bc('0x19')]=_[_0x04bc('0x1a')](config[_0x04bc('0x19')],{'host':_0x04bc('0x1b'),'port':0x18eb});var socket=require(_0x04bc('0x1c'))(new Redis(config[_0x04bc('0x19')]));require('./openchannelAccount.socket')[_0x04bc('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x04bc('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x04bc('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25d421,_0x5e118c,_0x3b4678,_0x559534){return new BPromise(function(_0x29805c,_0x2d0d54){var _0x3955d3=_0x559534||client;return _0x3955d3[_0x04bc('0x1f')](_0x25d421,_0x3b4678)['then'](function(_0x5825e6){logger['info'](_0x04bc('0x20'),_0x5e118c,_0x04bc('0x21'));logger[_0x04bc('0x22')](_0x04bc('0x23'),_0x5e118c,'request\x20sent',JSON[_0x04bc('0x24')](_0x5825e6));if(_0x5825e6[_0x04bc('0x25')]){if(_0x5825e6[_0x04bc('0x25')]['code']===0x1f4){logger[_0x04bc('0x25')](_0x04bc('0x20'),_0x5e118c,_0x5825e6['error'][_0x04bc('0x26')]);return _0x2d0d54(_0x5825e6[_0x04bc('0x25')]['message']);}logger[_0x04bc('0x25')](_0x04bc('0x20'),_0x5e118c,_0x5825e6['error'][_0x04bc('0x26')]);return _0x29805c(_0x5825e6[_0x04bc('0x25')]['message']);}else{logger[_0x04bc('0x27')](_0x04bc('0x20'),_0x5e118c,'request\x20sent');_0x29805c(_0x5825e6[_0x04bc('0x28')][_0x04bc('0x26')]);}})['catch'](function(_0x58fa0d){logger[_0x04bc('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x5e118c,_0x58fa0d);_0x2d0d54(_0x58fa0d);});});}function respondWithStatusCode(_0x2d90a3,_0x30097c){_0x30097c=_0x30097c||0xcc;return function(_0x564e23){if(_0x564e23){return _0x2d90a3['sendStatus'](_0x30097c);}return _0x2d90a3['status'](_0x30097c)[_0x04bc('0x29')]();};}function respondWithResult(_0x37000c,_0x83f1da){_0x83f1da=_0x83f1da||0xc8;return function(_0x9a2811){if(_0x9a2811){return _0x37000c[_0x04bc('0x2a')](_0x83f1da)[_0x04bc('0x2b')](_0x9a2811);}};}function respondWithFilteredResult(_0x30d7e2,_0x28f2b6){return function(_0x2fafcb){if(_0x2fafcb){var _0x571765=typeof _0x28f2b6[_0x04bc('0x2c')]===_0x04bc('0x2d')&&typeof _0x28f2b6[_0x04bc('0x2e')]===_0x04bc('0x2d');var _0x44f571=_0x2fafcb[_0x04bc('0x2f')];var _0x15fe96=_0x571765?0x0:_0x28f2b6[_0x04bc('0x2c')];var _0x215682=_0x571765?_0x2fafcb['count']:_0x28f2b6[_0x04bc('0x2c')]+_0x28f2b6['limit'];var _0x15f341;if(_0x215682>=_0x44f571){_0x215682=_0x44f571;_0x15f341=0xc8;}else{_0x15f341=0xce;}_0x30d7e2[_0x04bc('0x2a')](_0x15f341);return _0x30d7e2[_0x04bc('0x30')](_0x04bc('0x31'),_0x15fe96+'-'+_0x215682+'/'+_0x44f571)[_0x04bc('0x2b')](_0x2fafcb);}return null;};}function patchUpdates(_0x2e500b){return function(_0x4c5c2f){try{jsonpatch[_0x04bc('0x32')](_0x4c5c2f,_0x2e500b,!![]);}catch(_0x51e373){return BPromise[_0x04bc('0x33')](_0x51e373);}return _0x4c5c2f['save']();};}function saveUpdates(_0x6fc9c4,_0x5925f8){return function(_0x4dc6c9){if(_0x4dc6c9){return _0x4dc6c9[_0x04bc('0x34')](_0x6fc9c4)['then'](function(_0x19a527){return _0x19a527;});}return null;};}function removeEntity(_0x7b1380,_0x124674){return function(_0xcb0141){if(_0xcb0141){return _0xcb0141['destroy']()[_0x04bc('0x35')](function(){var _0x18eaf6=_0xcb0141[_0x04bc('0x36')]({'plain':!![]});var _0x16efca=_0x04bc('0x37');return db[_0x04bc('0x38')]['destroy']({'where':{'type':_0x16efca,'resourceId':_0x18eaf6['id']}})[_0x04bc('0x35')](function(){return _0xcb0141;});})['then'](function(){_0x7b1380['status'](0xcc)[_0x04bc('0x29')]();});}};}function handleEntityNotFound(_0x7c2230,_0x55936a){return function(_0xd1a784){if(!_0xd1a784){_0x7c2230[_0x04bc('0x39')](0x194);}return _0xd1a784;};}function handleError(_0x329a1a,_0x3429d6){_0x3429d6=_0x3429d6||0x1f4;return function(_0x2b2482){logger['error'](_0x2b2482[_0x04bc('0x3a')]);if(_0x2b2482[_0x04bc('0x3b')]){delete _0x2b2482[_0x04bc('0x3b')];}_0x329a1a[_0x04bc('0x2a')](_0x3429d6)[_0x04bc('0x3c')](_0x2b2482);};}exports[_0x04bc('0x3d')]=function(_0x7a446b,_0x57f477){var _0x56338f={'include':[{'model':db[_0x04bc('0x3e')],'as':_0x04bc('0x3f')}]},_0x22f769={},_0x5ba3f2={'count':0x0,'rows':[]};var _0x218c4e=_[_0x04bc('0x40')](db[_0x04bc('0x41')][_0x04bc('0x42')],function(_0x370f7d){return{'name':_0x370f7d[_0x04bc('0x43')],'type':_0x370f7d[_0x04bc('0x44')][_0x04bc('0x45')]};});_0x22f769[_0x04bc('0x46')]=_[_0x04bc('0x40')](_0x218c4e,_0x04bc('0x3b'));_0x22f769[_0x04bc('0x47')]=_[_0x04bc('0x48')](_0x7a446b[_0x04bc('0x47')]);_0x22f769[_0x04bc('0x49')]=_[_0x04bc('0x4a')](_0x22f769['model'],_0x22f769[_0x04bc('0x47')]);_0x56338f[_0x04bc('0x4b')]=_[_0x04bc('0x4a')](_0x22f769[_0x04bc('0x46')],qs[_0x04bc('0x4c')](_0x7a446b[_0x04bc('0x47')]['fields']));_0x56338f['attributes']=_0x56338f[_0x04bc('0x4b')]['length']?_0x56338f[_0x04bc('0x4b')]:_0x22f769['model'];if(!_0x7a446b[_0x04bc('0x47')][_0x04bc('0x4d')](_0x04bc('0x4e'))){_0x56338f['limit']=qs[_0x04bc('0x2e')](_0x7a446b[_0x04bc('0x47')][_0x04bc('0x2e')]);_0x56338f[_0x04bc('0x2c')]=qs[_0x04bc('0x2c')](_0x7a446b[_0x04bc('0x47')][_0x04bc('0x2c')]);}_0x56338f['order']=qs[_0x04bc('0x4f')](_0x7a446b[_0x04bc('0x47')][_0x04bc('0x4f')]);_0x56338f[_0x04bc('0x50')]=qs[_0x04bc('0x49')](_['pick'](_0x7a446b[_0x04bc('0x47')],_0x22f769['filters']),_0x218c4e);if(_0x7a446b[_0x04bc('0x47')]['filter']){_0x56338f[_0x04bc('0x50')]=_[_0x04bc('0x51')](_0x56338f[_0x04bc('0x50')],{'$or':_['map'](_0x218c4e,function(_0x490572){if(_0x490572['type']!==_0x04bc('0x52')){var _0x1e5ff3={};_0x1e5ff3[_0x490572[_0x04bc('0x3b')]]={'$like':'%'+_0x7a446b[_0x04bc('0x47')][_0x04bc('0x53')]+'%'};return _0x1e5ff3;}})});}_0x56338f=_[_0x04bc('0x51')]({},_0x56338f,_0x7a446b['options']);var _0x5e338d={'where':_0x56338f[_0x04bc('0x50')]};return db['OpenchannelAccount']['count'](_0x5e338d)[_0x04bc('0x35')](function(_0x2aa1a1){_0x5ba3f2[_0x04bc('0x2f')]=_0x2aa1a1;if(_0x7a446b[_0x04bc('0x47')][_0x04bc('0x54')]){_0x56338f[_0x04bc('0x55')]=[{'all':!![]}];}return db[_0x04bc('0x41')][_0x04bc('0x56')](_0x56338f);})[_0x04bc('0x35')](function(_0x54c189){_0x5ba3f2['rows']=_0x54c189;return _0x5ba3f2;})[_0x04bc('0x35')](respondWithFilteredResult(_0x57f477,_0x56338f))['catch'](handleError(_0x57f477,null));};exports[_0x04bc('0x57')]=function(_0x44ee33,_0x3433cf){var _0x759f20={'raw':![],'where':{'id':_0x44ee33['params']['id']},'include':[{'model':db[_0x04bc('0x3e')],'as':_0x04bc('0x3f')}]},_0x52a044={};_0x52a044[_0x04bc('0x46')]=_[_0x04bc('0x48')](db[_0x04bc('0x41')][_0x04bc('0x42')]);_0x52a044[_0x04bc('0x47')]=_['keys'](_0x44ee33[_0x04bc('0x47')]);_0x52a044[_0x04bc('0x49')]=_[_0x04bc('0x4a')](_0x52a044['model'],_0x52a044[_0x04bc('0x47')]);_0x759f20[_0x04bc('0x4b')]=_[_0x04bc('0x4a')](_0x52a044['model'],qs[_0x04bc('0x4c')](_0x44ee33[_0x04bc('0x47')][_0x04bc('0x4c')]));_0x759f20[_0x04bc('0x4b')]=_0x759f20[_0x04bc('0x4b')][_0x04bc('0x58')]?_0x759f20[_0x04bc('0x4b')]:_0x52a044[_0x04bc('0x46')];if(_0x44ee33[_0x04bc('0x47')][_0x04bc('0x54')]){_0x759f20['include']=[{'all':!![]}];}_0x759f20=_[_0x04bc('0x51')]({},_0x759f20,_0x44ee33[_0x04bc('0x59')]);return db[_0x04bc('0x41')][_0x04bc('0x5a')](_0x759f20)[_0x04bc('0x35')](handleEntityNotFound(_0x3433cf,null))[_0x04bc('0x35')](respondWithResult(_0x3433cf,null))[_0x04bc('0x5b')](handleError(_0x3433cf,null));};exports[_0x04bc('0x5c')]=function(_0x54e475,_0x230a29){return db[_0x04bc('0x41')]['create'](_0x54e475[_0x04bc('0x5d')],{})[_0x04bc('0x35')](function(_0x597e7b){var _0x341991=_0x54e475['user'][_0x04bc('0x36')]({'plain':!![]});if(!_0x341991)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x341991[_0x04bc('0x5e')]===_0x04bc('0x5f')){var _0x641b47=_0x597e7b['get']({'plain':!![]});var _0x1a0455=_0x04bc('0x37');return db[_0x04bc('0x60')][_0x04bc('0x5a')]({'where':{'name':_0x1a0455,'userProfileId':_0x341991[_0x04bc('0x61')]},'raw':!![]})[_0x04bc('0x35')](function(_0x59f37a){if(_0x59f37a&&_0x59f37a[_0x04bc('0x62')]===0x0){return db[_0x04bc('0x38')][_0x04bc('0x5c')]({'name':_0x641b47[_0x04bc('0x3b')],'resourceId':_0x641b47['id'],'type':_0x59f37a[_0x04bc('0x3b')],'sectionId':_0x59f37a['id']},{})[_0x04bc('0x35')](function(){return _0x597e7b;});}else{return _0x597e7b;}})[_0x04bc('0x5b')](function(_0xdb6354){logger['error'](_0x04bc('0x63'),_0xdb6354);throw _0xdb6354;});}return _0x597e7b;})[_0x04bc('0x35')](respondWithResult(_0x230a29,0xc9))[_0x04bc('0x5b')](handleError(_0x230a29,null));};exports['update']=function(_0xc13ed5,_0x4ab364){if(_0xc13ed5[_0x04bc('0x5d')]['id']){delete _0xc13ed5[_0x04bc('0x5d')]['id'];}return db[_0x04bc('0x41')][_0x04bc('0x5a')]({'where':{'id':_0xc13ed5[_0x04bc('0x64')]['id']},'include':[{'model':db[_0x04bc('0x3e')],'as':_0x04bc('0x3f')}]})['then'](handleEntityNotFound(_0x4ab364,null))[_0x04bc('0x35')](saveUpdates(_0xc13ed5[_0x04bc('0x5d')],null))[_0x04bc('0x35')](respondWithResult(_0x4ab364,null))[_0x04bc('0x5b')](handleError(_0x4ab364,null));};exports[_0x04bc('0x65')]=function(_0x127ee8,_0x1ed7fa){return db[_0x04bc('0x41')][_0x04bc('0x5a')]({'where':{'id':_0x127ee8[_0x04bc('0x64')]['id']}})[_0x04bc('0x35')](handleEntityNotFound(_0x1ed7fa,null))[_0x04bc('0x35')](removeEntity(_0x1ed7fa,null))[_0x04bc('0x5b')](handleError(_0x1ed7fa,null));};exports[_0x04bc('0x66')]=function(_0x5bf12c,_0x74fa06){return db[_0x04bc('0x41')]['describe']()['then'](respondWithResult(_0x74fa06,null))[_0x04bc('0x5b')](handleError(_0x74fa06,null));};exports[_0x04bc('0x67')]=function(_0x8666c6,_0x5194e5,_0x4726de){if(_0x8666c6[_0x04bc('0x5d')]['id']){delete _0x8666c6['body']['id'];}return db['OpenchannelAccount'][_0x04bc('0x5a')]({'where':{'id':_0x8666c6[_0x04bc('0x64')]['id']}})['then'](handleEntityNotFound(_0x5194e5,null))['then'](function(_0x5986b1){if(_0x5986b1){_0x8666c6[_0x04bc('0x5d')]['OpenchannelAccountId']=_0x5986b1['id'];return db[_0x04bc('0x68')][_0x04bc('0x5c')](_0x8666c6[_0x04bc('0x5d')]);}})['then'](respondWithResult(_0x5194e5,null))['catch'](handleError(_0x5194e5,null));};exports[_0x04bc('0x69')]=function(_0x256180,_0x273261,_0x56666e){var _0x5f49ae={'raw':![],'where':{}};var _0x17514f={};var _0x2e67b5={'count':0x0,'rows':[]};return db[_0x04bc('0x41')][_0x04bc('0x6a')]({'where':{'id':_0x256180[_0x04bc('0x64')]['id']}})[_0x04bc('0x35')](handleEntityNotFound(_0x273261,null))['then'](function(_0x831b04){if(_0x831b04){_0x17514f[_0x04bc('0x46')]=_[_0x04bc('0x48')](db[_0x04bc('0x68')][_0x04bc('0x42')]);_0x17514f[_0x04bc('0x47')]=_[_0x04bc('0x48')](_0x256180[_0x04bc('0x47')]);_0x17514f[_0x04bc('0x49')]=_[_0x04bc('0x4a')](_0x17514f['model'],_0x17514f[_0x04bc('0x47')]);_0x5f49ae[_0x04bc('0x4b')]=_['intersection'](_0x17514f[_0x04bc('0x46')],qs[_0x04bc('0x4c')](_0x256180[_0x04bc('0x47')][_0x04bc('0x4c')]));_0x5f49ae[_0x04bc('0x4b')]=_0x5f49ae[_0x04bc('0x4b')][_0x04bc('0x58')]?_0x5f49ae['attributes']:_0x17514f[_0x04bc('0x46')];if(!_0x256180[_0x04bc('0x47')][_0x04bc('0x4d')](_0x04bc('0x4e'))){_0x5f49ae[_0x04bc('0x2e')]=qs[_0x04bc('0x2e')](_0x256180[_0x04bc('0x47')]['limit']);_0x5f49ae['offset']=qs['offset'](_0x256180[_0x04bc('0x47')][_0x04bc('0x2c')]);}_0x5f49ae[_0x04bc('0x6b')]=qs[_0x04bc('0x4f')](_0x256180[_0x04bc('0x47')][_0x04bc('0x4f')]);_0x5f49ae[_0x04bc('0x50')]=qs[_0x04bc('0x49')](_['pick'](_0x256180['query'],_0x17514f[_0x04bc('0x49')]));_0x5f49ae[_0x04bc('0x50')][_0x04bc('0x6c')]=_0x831b04['id'];if(_0x256180[_0x04bc('0x47')][_0x04bc('0x53')]){_0x5f49ae['where']=_[_0x04bc('0x51')](_0x5f49ae['where'],{'$or':_[_0x04bc('0x40')](_0x5f49ae[_0x04bc('0x4b')],function(_0x4b8dae){var _0x11d33d={};_0x11d33d[_0x4b8dae]={'$like':'%'+_0x256180[_0x04bc('0x47')]['filter']+'%'};return _0x11d33d;})});}_0x5f49ae=_[_0x04bc('0x51')]({},_0x5f49ae,_0x256180['options']);return db[_0x04bc('0x68')]['count']({'where':_0x5f49ae['where']})['then'](function(_0x6ddf84){_0x2e67b5[_0x04bc('0x2f')]=_0x6ddf84;if(_0x256180['query'][_0x04bc('0x54')]){_0x5f49ae[_0x04bc('0x55')]=[{'all':!![]}];}return db[_0x04bc('0x68')][_0x04bc('0x56')](_0x5f49ae);})['then'](function(_0x2ee537){_0x2e67b5[_0x04bc('0x6d')]=_0x2ee537;return _0x2e67b5;});}})[_0x04bc('0x35')](respondWithFilteredResult(_0x273261,_0x5f49ae))[_0x04bc('0x5b')](handleError(_0x273261,null));};exports['removeDispositions']=function(_0x4d376f,_0x187929,_0x3470fb){return db[_0x04bc('0x41')][_0x04bc('0x5a')]({'where':{'id':_0x4d376f[_0x04bc('0x64')]['id']}})[_0x04bc('0x35')](handleEntityNotFound(_0x187929,null))[_0x04bc('0x35')](function(_0x299ff5){if(_0x299ff5){return _0x299ff5[_0x04bc('0x6e')](_0x4d376f[_0x04bc('0x47')][_0x04bc('0x6f')]);}})[_0x04bc('0x35')](respondWithStatusCode(_0x187929,null))[_0x04bc('0x5b')](handleError(_0x187929,null));};exports[_0x04bc('0x70')]=function(_0x572c33,_0x3fd601,_0x4016fa){if(_0x572c33[_0x04bc('0x5d')]['id']){delete _0x572c33[_0x04bc('0x5d')]['id'];}return db[_0x04bc('0x41')][_0x04bc('0x5a')]({'where':{'id':_0x572c33['params']['id']}})[_0x04bc('0x35')](handleEntityNotFound(_0x3fd601,null))[_0x04bc('0x35')](function(_0x1cd36f){if(_0x1cd36f){_0x572c33[_0x04bc('0x5d')][_0x04bc('0x6c')]=_0x1cd36f['id'];return db[_0x04bc('0x71')]['create'](_0x572c33['body']);}})[_0x04bc('0x35')](respondWithResult(_0x3fd601,null))[_0x04bc('0x5b')](handleError(_0x3fd601,null));};exports[_0x04bc('0x72')]=function(_0x45293d,_0x18ed13,_0x1cf63d){var _0x2e774a={'raw':![],'where':{}};var _0x2675cb={};var _0x383d01={'count':0x0,'rows':[]};return db[_0x04bc('0x41')][_0x04bc('0x6a')]({'where':{'id':_0x45293d[_0x04bc('0x64')]['id']}})[_0x04bc('0x35')](handleEntityNotFound(_0x18ed13,null))['then'](function(_0xe0de45){if(_0xe0de45){_0x2675cb[_0x04bc('0x46')]=_[_0x04bc('0x48')](db['CannedAnswer'][_0x04bc('0x42')]);_0x2675cb['query']=_['keys'](_0x45293d[_0x04bc('0x47')]);_0x2675cb[_0x04bc('0x49')]=_['intersection'](_0x2675cb[_0x04bc('0x46')],_0x2675cb[_0x04bc('0x47')]);_0x2e774a[_0x04bc('0x4b')]=_[_0x04bc('0x4a')](_0x2675cb[_0x04bc('0x46')],qs[_0x04bc('0x4c')](_0x45293d[_0x04bc('0x47')][_0x04bc('0x4c')]));_0x2e774a[_0x04bc('0x4b')]=_0x2e774a[_0x04bc('0x4b')]['length']?_0x2e774a[_0x04bc('0x4b')]:_0x2675cb[_0x04bc('0x46')];if(!_0x45293d[_0x04bc('0x47')][_0x04bc('0x4d')](_0x04bc('0x4e'))){_0x2e774a[_0x04bc('0x2e')]=qs[_0x04bc('0x2e')](_0x45293d[_0x04bc('0x47')][_0x04bc('0x2e')]);_0x2e774a['offset']=qs[_0x04bc('0x2c')](_0x45293d['query'][_0x04bc('0x2c')]);}_0x2e774a[_0x04bc('0x6b')]=qs['sort'](_0x45293d[_0x04bc('0x47')][_0x04bc('0x4f')]);_0x2e774a['where']=qs[_0x04bc('0x49')](_['pick'](_0x45293d[_0x04bc('0x47')],_0x2675cb[_0x04bc('0x49')]));_0x2e774a[_0x04bc('0x50')][_0x04bc('0x6c')]=_0xe0de45['id'];if(_0x45293d[_0x04bc('0x47')][_0x04bc('0x53')]){_0x2e774a[_0x04bc('0x50')]=_[_0x04bc('0x51')](_0x2e774a[_0x04bc('0x50')],{'$or':_[_0x04bc('0x40')](_0x2e774a['attributes'],function(_0x5bffaf){var _0x30fbb1={};_0x30fbb1[_0x5bffaf]={'$like':'%'+_0x45293d[_0x04bc('0x47')][_0x04bc('0x53')]+'%'};return _0x30fbb1;})});}_0x2e774a=_['merge']({},_0x2e774a,_0x45293d[_0x04bc('0x59')]);return db[_0x04bc('0x71')][_0x04bc('0x2f')]({'where':_0x2e774a['where']})[_0x04bc('0x35')](function(_0x4a9f90){_0x383d01[_0x04bc('0x2f')]=_0x4a9f90;if(_0x45293d[_0x04bc('0x47')]['includeAll']){_0x2e774a[_0x04bc('0x55')]=[{'all':!![]}];}return db[_0x04bc('0x71')]['findAll'](_0x2e774a);})[_0x04bc('0x35')](function(_0x2111ec){_0x383d01[_0x04bc('0x6d')]=_0x2111ec;return _0x383d01;});}})[_0x04bc('0x35')](respondWithFilteredResult(_0x18ed13,_0x2e774a))['catch'](handleError(_0x18ed13,null));};exports[_0x04bc('0x73')]=function(_0x3428dc,_0x5bff06,_0x2ef106){return db[_0x04bc('0x41')][_0x04bc('0x5a')]({'where':{'id':_0x3428dc[_0x04bc('0x64')]['id']}})[_0x04bc('0x35')](handleEntityNotFound(_0x5bff06,null))[_0x04bc('0x35')](function(_0x5fea66){if(_0x5fea66){return _0x5fea66[_0x04bc('0x73')](_0x3428dc[_0x04bc('0x47')][_0x04bc('0x6f')]);}})[_0x04bc('0x35')](respondWithStatusCode(_0x5bff06,null))[_0x04bc('0x5b')](handleError(_0x5bff06,null));};exports[_0x04bc('0x74')]=function(_0x607d6e,_0x50fc42,_0x290b4f){var _0x3cfc21={'body':_0x607d6e[_0x04bc('0x5d')],'channel':'openchannel'};var _0x704ee4=[];var _0x3d467f=[];var _0x5774da={};var _0x700fd=![];return db[_0x04bc('0x75')][_0x04bc('0x66')]()[_0x04bc('0x35')](function(_0x45a2a3){if(!_0x45a2a3){throw new db[(_0x04bc('0x76'))][(_0x04bc('0x77'))](_0x04bc('0x78'));}_0x704ee4=_['difference'](_[_0x04bc('0x48')](_0x45a2a3),[_0x04bc('0x79'),'updatedAt']);_0x3d467f=_[_0x04bc('0x7a')](_[_0x04bc('0x48')](_0x45a2a3),[_0x04bc('0x79'),_0x04bc('0x7b'),_0x04bc('0x7c'),_0x04bc('0x7d')]);if(_0x607d6e['body']['id']){delete _0x607d6e['body']['id'];}if(_['isNil'](_0x607d6e[_0x04bc('0x5d')][_0x04bc('0x7e')])){throw new db[(_0x04bc('0x76'))][(_0x04bc('0x77'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x607d6e[_0x04bc('0x5d')][_0x04bc('0x5d')])||_0x607d6e['body'][_0x04bc('0x5d')]===''){throw new db[(_0x04bc('0x76'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x04bc('0x7f')](_0x607d6e[_0x04bc('0x5d')][_0x04bc('0x80')])){throw new db[(_0x04bc('0x76'))][(_0x04bc('0x77'))](_0x04bc('0x81')+_0x3d467f);}if(!_[_0x04bc('0x82')](_0x3d467f,_0x607d6e[_0x04bc('0x5d')]['mapKey'])){throw new db[(_0x04bc('0x76'))][(_0x04bc('0x77'))](_0x04bc('0x83')+_0x3d467f);}_0x5774da[_0x607d6e[_0x04bc('0x5d')][_0x04bc('0x80')]]=_0x607d6e[_0x04bc('0x5d')][_0x04bc('0x7e')];})['then'](function(){return db['OpenchannelAccount'][_0x04bc('0x5a')]({'where':{'id':_0x607d6e['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x04bc('0x75')],'as':_0x04bc('0x84'),'where':_0x5774da,'limit':0x1,'order':[['updatedAt',_0x04bc('0x85')]]}]},{'model':db[_0x04bc('0x86')],'as':'Applications'}]});})[_0x04bc('0x35')](handleEntityNotFound(_0x50fc42,null))['then'](function(_0x1eb1ac){if(_0x1eb1ac&&_0x1eb1ac[_0x04bc('0x87')]){_0x3cfc21[_0x04bc('0x88')]=_0x1eb1ac;_0x3cfc21[_0x04bc('0x89')]=_0x1eb1ac[_0x04bc('0x8a')];_0x3cfc21[_0x04bc('0x8b')]=_0x1eb1ac[_0x04bc('0x87')];_0x3cfc21[_0x04bc('0x89')]=_[_0x04bc('0x8c')](_0x3cfc21[_0x04bc('0x89')],['priority'],['asc']);if(_0x3cfc21[_0x04bc('0x88')][_0x04bc('0x8a')]){delete _0x3cfc21['account'][_0x04bc('0x8a')];}if(_0x3cfc21[_0x04bc('0x88')]['List']&&_0x3cfc21['account'][_0x04bc('0x87')][_0x04bc('0x84')]['length']){return _0x3cfc21['account'][_0x04bc('0x87')][_0x04bc('0x84')][0x0];}var _0xb66734=_[_0x04bc('0x1a')](_0x607d6e[_0x04bc('0x5d')],{'firstName':_0x607d6e['body'][_0x04bc('0x7e')],'ListId':_0x1eb1ac[_0x04bc('0x7d')]});_0xb66734[_0x607d6e[_0x04bc('0x5d')]['mapKey']]=_0x607d6e[_0x04bc('0x5d')][_0x04bc('0x7e')];return db['CmContact'][_0x04bc('0x5c')](_0xb66734,{'fields':_0x704ee4,'raw':!![]});}})[_0x04bc('0x35')](handleEntityNotFound(_0x50fc42,null))['then'](function(_0x1189c0){_0x3cfc21[_0x04bc('0x8d')]=_0x1189c0;if(_0x1189c0){var _0x39e6f8={'ContactId':_0x1189c0['id'],'OpenchannelAccountId':_0x607d6e[_0x04bc('0x64')]['id'],'from':(_0x1189c0[_0x04bc('0x8e')]||'')+'\x20'+(_0x1189c0['lastName']||'')};var _0x31d3fc={'OpenchannelAccountId':_0x607d6e[_0x04bc('0x64')]['id'],'closed':![]};if(_0x607d6e[_0x04bc('0x5d')]['threadId']){_0x31d3fc[_0x04bc('0x8f')]=_0x607d6e[_0x04bc('0x5d')]['threadId'];return db[_0x04bc('0x90')][_0x04bc('0x5a')]({'where':_0x31d3fc})[_0x04bc('0x35')](function(_0x505aa7){if(_0x505aa7){return[_0x505aa7,![]];}_0x39e6f8['threadId']=_0x607d6e['body'][_0x04bc('0x8f')];_0x39e6f8[_0x04bc('0x91')]=_0x607d6e[_0x04bc('0x5d')][_0x04bc('0x91')];return db[_0x04bc('0x90')][_0x04bc('0x5c')](_0x39e6f8)['then'](function(_0x1f806c){return[_0x1f806c,!![]];});});}else{_0x31d3fc[_0x04bc('0x8f')]=null;}_0x31d3fc['ContactId']=_0x1189c0['id'];return db[_0x04bc('0x90')][_0x04bc('0x5a')]({'where':_0x31d3fc})[_0x04bc('0x35')](function(_0x2f9b42){if(_0x2f9b42){return[_0x2f9b42,![]];}return db['OpenchannelInteraction'][_0x04bc('0x5c')](_0x39e6f8)[_0x04bc('0x35')](function(_0x502787){return[_0x502787,!![]];});});}})[_0x04bc('0x92')](function(_0x4c05be,_0x452f43){if(_0x4c05be){_0x700fd=_0x452f43;if(!_0x452f43){var _0x452173={'from':(_0x3cfc21[_0x04bc('0x8d')][_0x04bc('0x8e')]||'')+'\x20'+(_0x3cfc21['contact']['lastName']||'')};if(_0x607d6e[_0x04bc('0x5d')][_0x04bc('0x8f')]&&_0x607d6e[_0x04bc('0x5d')][_0x04bc('0x93')]&&_0x607d6e[_0x04bc('0x5d')]['threadId']!=_0x607d6e['body'][_0x04bc('0x93')]){_0x452173[_0x04bc('0x8f')]=_0x607d6e[_0x04bc('0x5d')][_0x04bc('0x93')];}return _0x4c05be[_0x04bc('0x34')](_0x452173);}else{return _0x4c05be;}}})[_0x04bc('0x35')](function(_0x5551ae){_0x3cfc21[_0x04bc('0x94')]=_0x5551ae[_0x04bc('0x36')]({'plain':!![]});_0x3cfc21[_0x04bc('0x94')][_0x04bc('0x95')]=_0x700fd;if(_0x3cfc21[_0x04bc('0x94')]['created']){if(_0x3cfc21['account'][_0x04bc('0x96')]){_0x3cfc21[_0x04bc('0x89')][_0x04bc('0x97')]({'id':0x0,'priority':_0x3cfc21[_0x04bc('0x89')][_0x04bc('0x58')]+0x1,'app':'close','appdata':_0x04bc('0x98'),'interval':_0x04bc('0x99')});}}return db['OpenchannelMessage'][_0x04bc('0x5c')]({'body':_0x607d6e[_0x04bc('0x5d')][_0x04bc('0x5d')],'OpenchannelAccountId':_0x607d6e[_0x04bc('0x64')]['id'],'OpenchannelInteractionId':_0x5551ae['id'],'direction':'in','ContactId':_0x3cfc21['contact']['id'],'AttachmentId':_0x607d6e[_0x04bc('0x5d')][_0x04bc('0x9a')]});})[_0x04bc('0x35')](function(_0x440bcc){_0x3cfc21[_0x04bc('0x26')]=_0x440bcc;if(_0x3cfc21[_0x04bc('0x94')]['UserId']){return db[_0x04bc('0x9b')][_0x04bc('0x5a')]({'attributes':['id',_0x04bc('0x3b')],'where':{'id':_0x3cfc21['interaction'][_0x04bc('0x9c')]}})[_0x04bc('0x35')](function(_0x5d303c){if(_0x5d303c){_0x3cfc21[_0x04bc('0x89')][_0x04bc('0x9d')]({'id':0x0,'priority':0x0,'app':_0x04bc('0x9e'),'appdata':_0x5d303c['name']+','+(_0x3cfc21[_0x04bc('0x88')][_0x04bc('0x9f')]||0xa),'interval':'*,*,*,*'});_0x3cfc21[_0x04bc('0xa0')]=![];}return respondWithRpcPromise('Start','startRouting',_0x3cfc21);});}return respondWithRpcPromise(_0x04bc('0xa1'),_0x04bc('0xa2'),_0x3cfc21);})[_0x04bc('0x35')](function(_0xb9df25){respondWithRpcPromise(_0x04bc('0xa3'),_0x04bc('0xa3'),{'event':_0x04bc('0x74'),'message':_0xb9df25},client9002);return _0xb9df25;})['then'](respondWithResult(_0x50fc42,null))['catch'](handleError(_0x50fc42,null));};exports[_0x04bc('0xa4')]=function(_0x120f04,_0x4d7e82,_0x3a2099){return db[_0x04bc('0x41')][_0x04bc('0x6a')]({'where':{'id':_0x120f04[_0x04bc('0x64')]['id']}})[_0x04bc('0x35')](handleEntityNotFound(_0x4d7e82,null))[_0x04bc('0x35')](function(_0x640584){if(_0x640584){return db[_0x04bc('0xa5')][_0x04bc('0xa6')](function(_0x1cf972){return db[_0x04bc('0x86')][_0x04bc('0x65')]({'where':{'OpenchannelAccountId':_0x120f04['params']['id']},'transaction':_0x1cf972})[_0x04bc('0x35')](function(_0x50deb1){var _0x17efd3=_[_0x04bc('0x40')](_0x120f04[_0x04bc('0x5d')],function(_0x55b60d){_0x55b60d[_0x04bc('0x6c')]=_0x120f04['params']['id'];return _0x55b60d;});return db['OpenchannelApplication'][_0x04bc('0xa7')](_0x17efd3,{'transaction':_0x1cf972});});})[_0x04bc('0x35')](function(){return db[_0x04bc('0x86')][_0x04bc('0xa8')]({'where':{'OpenchannelAccountId':_0x120f04[_0x04bc('0x64')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x4d7e82,null))[_0x04bc('0x5b')](handleError(_0x4d7e82,null));};exports[_0x04bc('0xa9')]=function(_0x56c232,_0x1bf45e,_0x5e668a){var _0x2909b7={};var _0x465e50={};var _0xbd7f78;var _0x267750;return db[_0x04bc('0x41')][_0x04bc('0x6a')]({'where':{'id':_0x56c232['params']['id']}})[_0x04bc('0x35')](handleEntityNotFound(_0x1bf45e,null))[_0x04bc('0x35')](function(_0x3560e2){if(_0x3560e2){_0xbd7f78=_0x3560e2;_0x465e50['model']=_[_0x04bc('0x48')](db[_0x04bc('0x86')]['rawAttributes']);_0x465e50[_0x04bc('0x47')]=_[_0x04bc('0x48')](_0x56c232[_0x04bc('0x47')]);_0x465e50[_0x04bc('0x49')]=_[_0x04bc('0x4a')](_0x465e50[_0x04bc('0x46')],_0x465e50[_0x04bc('0x47')]);_0x2909b7[_0x04bc('0x4b')]=_['intersection'](_0x465e50['model'],qs[_0x04bc('0x4c')](_0x56c232[_0x04bc('0x47')]['fields']));_0x2909b7[_0x04bc('0x4b')]=_0x2909b7[_0x04bc('0x4b')]['length']?_0x2909b7['attributes']:_0x465e50['model'];_0x2909b7[_0x04bc('0x6b')]=qs[_0x04bc('0x4f')](_0x56c232[_0x04bc('0x47')][_0x04bc('0x4f')]);_0x2909b7['where']=qs[_0x04bc('0x49')](_['pick'](_0x56c232[_0x04bc('0x47')],_0x465e50['filters']));if(_0x56c232[_0x04bc('0x47')][_0x04bc('0x53')]){_0x2909b7[_0x04bc('0x50')]=_[_0x04bc('0x51')](_0x2909b7['where'],{'$or':_['map'](_0x2909b7[_0x04bc('0x4b')],function(_0x3919a9){var _0x317343={};_0x317343[_0x3919a9]={'$like':'%'+_0x56c232[_0x04bc('0x47')][_0x04bc('0x53')]+'%'};return _0x317343;})});}_0x2909b7=_[_0x04bc('0x51')]({},_0x2909b7,_0x56c232[_0x04bc('0x59')]);return _0xbd7f78[_0x04bc('0xa9')](_0x2909b7);}})[_0x04bc('0x35')](function(_0x960e18){if(_0x960e18){_0x267750=_0x960e18[_0x04bc('0x58')];if(!_0x56c232['query'][_0x04bc('0x4d')](_0x04bc('0x4e'))){_0x2909b7[_0x04bc('0x2e')]=qs['limit'](_0x56c232[_0x04bc('0x47')][_0x04bc('0x2e')]);_0x2909b7[_0x04bc('0x2c')]=qs[_0x04bc('0x2c')](_0x56c232[_0x04bc('0x47')][_0x04bc('0x2c')]);}return _0xbd7f78[_0x04bc('0xa9')](_0x2909b7);}})[_0x04bc('0x35')](function(_0x2b56e2){if(_0x2b56e2){return _0x2b56e2?{'count':_0x267750,'rows':_0x2b56e2}:null;}})[_0x04bc('0x35')](respondWithResult(_0x1bf45e,null))['catch'](handleError(_0x1bf45e,null));};exports[_0x04bc('0xaa')]=function(_0x50d8f3,_0x132253,_0x15a8c7){var _0x57b773={'raw':![],'where':{}};var _0x11088b={};var _0x20eeb9={'count':0x0,'rows':[]};return db[_0x04bc('0x41')][_0x04bc('0x6a')]({'where':{'id':_0x50d8f3[_0x04bc('0x64')]['id']}})[_0x04bc('0x35')](handleEntityNotFound(_0x132253,null))[_0x04bc('0x35')](function(_0x58b817){if(_0x58b817){_0x11088b[_0x04bc('0x46')]=_[_0x04bc('0x48')](db[_0x04bc('0x90')][_0x04bc('0x42')]);_0x11088b['query']=_['keys'](_0x50d8f3[_0x04bc('0x47')]);_0x11088b[_0x04bc('0x49')]=_[_0x04bc('0x4a')](_0x11088b[_0x04bc('0x46')],_0x11088b[_0x04bc('0x47')]);_0x57b773['attributes']=_[_0x04bc('0x4a')](_0x11088b['model'],qs['fields'](_0x50d8f3[_0x04bc('0x47')][_0x04bc('0x4c')]));_0x57b773[_0x04bc('0x4b')]=_0x57b773[_0x04bc('0x4b')]['length']?_0x57b773['attributes']:_0x11088b[_0x04bc('0x46')];if(!_0x50d8f3[_0x04bc('0x47')][_0x04bc('0x4d')](_0x04bc('0x4e'))){_0x57b773[_0x04bc('0x2e')]=qs['limit'](_0x50d8f3['query'][_0x04bc('0x2e')]);_0x57b773[_0x04bc('0x2c')]=qs[_0x04bc('0x2c')](_0x50d8f3[_0x04bc('0x47')]['offset']);}_0x57b773[_0x04bc('0x6b')]=qs[_0x04bc('0x4f')](_0x50d8f3[_0x04bc('0x47')]['sort']);_0x57b773[_0x04bc('0x50')]=qs[_0x04bc('0x49')](_[_0x04bc('0xab')](_0x50d8f3['query'],_0x11088b['filters']));_0x57b773[_0x04bc('0x50')]['OpenchannelAccountId']=_0x58b817['id'];if(_0x50d8f3['query'][_0x04bc('0x53')]){_0x57b773[_0x04bc('0x50')]=_[_0x04bc('0x51')](_0x57b773[_0x04bc('0x50')],{'$or':_[_0x04bc('0x40')](_0x57b773[_0x04bc('0x4b')],function(_0x247673){var _0x5319db={};_0x5319db[_0x247673]={'$like':'%'+_0x50d8f3[_0x04bc('0x47')][_0x04bc('0x53')]+'%'};return _0x5319db;})});}_0x57b773=_['merge']({},_0x57b773,_0x50d8f3[_0x04bc('0x59')]);return db['OpenchannelInteraction'][_0x04bc('0x2f')]({'where':_0x57b773[_0x04bc('0x50')]})['then'](function(_0x1a7da8){_0x20eeb9['count']=_0x1a7da8;if(_0x50d8f3[_0x04bc('0x47')][_0x04bc('0x54')]){_0x57b773[_0x04bc('0x55')]=[{'model':db[_0x04bc('0x75')],'as':'Contact','required':![]},{'model':db[_0x04bc('0x9b')],'as':_0x04bc('0xac'),'attributes':[_0x04bc('0x3b'),_0x04bc('0xad'),_0x04bc('0xae')],'required':![]},{'model':db['Tag'],'as':_0x04bc('0xaf'),'attributes':['id',_0x04bc('0x3b'),_0x04bc('0xb0')],'where':_0x50d8f3[_0x04bc('0x47')][_0x04bc('0xb1')]?{'id':_0x50d8f3[_0x04bc('0x47')][_0x04bc('0xb1')]}:undefined,'required':_0x50d8f3[_0x04bc('0x47')][_0x04bc('0xb1')]?!![]:![]}];}return db[_0x04bc('0x90')][_0x04bc('0x56')](_0x57b773);})[_0x04bc('0x35')](function(_0x178776){_0x20eeb9[_0x04bc('0x6d')]=_0x178776;return _0x20eeb9;});}})[_0x04bc('0x35')](respondWithFilteredResult(_0x132253,_0x57b773))[_0x04bc('0x5b')](handleError(_0x132253,null));};exports['addAgents']=function(_0x17fecc,_0x6237d4,_0x446715){return db['OpenchannelAccount'][_0x04bc('0x5a')]({'where':{'id':_0x17fecc[_0x04bc('0x64')]['id']}})[_0x04bc('0x35')](handleEntityNotFound(_0x6237d4,null))['then'](function(_0x4a9acc){if(_0x4a9acc){return _0x4a9acc[_0x04bc('0xb2')](_0x17fecc[_0x04bc('0x5d')][_0x04bc('0x6f')],_[_0x04bc('0xb3')](_0x17fecc[_0x04bc('0x5d')],[_0x04bc('0x6f'),'id'])||{})['spread'](function(_0x10f568){for(var _0xbab2e8=0x0;_0xbab2e8<_0x17fecc[_0x04bc('0x5d')][_0x04bc('0x6f')][_0x04bc('0x58')];_0xbab2e8+=0x1){socket[_0x04bc('0xb4')](_0x04bc('0xb5'),{'UserId':Number(_0x17fecc[_0x04bc('0x5d')]['ids'][_0xbab2e8]),'OpenchannelAccountId':Number(_0x17fecc[_0x04bc('0x64')]['id'])});}return _0x10f568;});}})['then'](respondWithResult(_0x6237d4,null))[_0x04bc('0x5b')](handleError(_0x6237d4,null));};exports[_0x04bc('0xb6')]=function(_0x49a46c,_0x1b868c,_0x51ec84){return db[_0x04bc('0x41')][_0x04bc('0x5a')]({'where':{'id':_0x49a46c[_0x04bc('0x64')]['id']}})[_0x04bc('0x35')](handleEntityNotFound(_0x1b868c,null))[_0x04bc('0x35')](function(_0x173e52){if(_0x173e52){return _0x173e52[_0x04bc('0xb6')](_0x49a46c[_0x04bc('0x47')][_0x04bc('0x6f')])['then'](function(){if(_[_0x04bc('0xb7')](_0x49a46c['query']['ids'])){for(var _0x396acc=0x0;_0x396acc<_0x49a46c['query'][_0x04bc('0x6f')][_0x04bc('0x58')];_0x396acc+=0x1){socket[_0x04bc('0xb4')](_0x04bc('0xb8'),{'UserId':Number(_0x49a46c[_0x04bc('0x47')]['ids'][_0x396acc]),'OpenchannelAccountId':Number(_0x49a46c['params']['id'])});}}else{socket['emit'](_0x04bc('0xb8'),{'UserId':Number(_0x49a46c[_0x04bc('0x47')][_0x04bc('0x6f')]),'OpenchannelAccountId':Number(_0x49a46c['params']['id'])});}});}})[_0x04bc('0x35')](respondWithStatusCode(_0x1b868c,null))['catch'](handleError(_0x1b868c,null));};exports[_0x04bc('0xb9')]=function(_0x3c2185,_0x1d4fce,_0x23131b){var _0x3cb291={};var _0x40508={};var _0x3775a5;var _0x47dcf8;return db[_0x04bc('0x41')][_0x04bc('0x6a')]({'where':{'id':_0x3c2185['params']['id']}})['then'](handleEntityNotFound(_0x1d4fce,null))['then'](function(_0x5f333d){if(_0x5f333d){_0x3775a5=_0x5f333d;_0x40508['model']=_[_0x04bc('0x48')](db[_0x04bc('0x9b')][_0x04bc('0x42')]);_0x40508[_0x04bc('0x47')]=_[_0x04bc('0x48')](_0x3c2185['query']);_0x40508[_0x04bc('0x49')]=_[_0x04bc('0x4a')](_0x40508[_0x04bc('0x46')],_0x40508[_0x04bc('0x47')]);_0x3cb291['attributes']=_[_0x04bc('0x4a')](_0x40508['model'],qs[_0x04bc('0x4c')](_0x3c2185['query']['fields']));_0x3cb291[_0x04bc('0x4b')]=_0x3cb291[_0x04bc('0x4b')]['length']?_0x3cb291['attributes']:_0x40508[_0x04bc('0x46')];_0x3cb291['order']=qs['sort'](_0x3c2185['query'][_0x04bc('0x4f')]);_0x3cb291[_0x04bc('0x50')]=qs[_0x04bc('0x49')](_[_0x04bc('0xab')](_0x3c2185[_0x04bc('0x47')],_0x40508[_0x04bc('0x49')]));if(_0x3c2185[_0x04bc('0x47')][_0x04bc('0x53')]){_0x3cb291[_0x04bc('0x50')]=_[_0x04bc('0x51')](_0x3cb291[_0x04bc('0x50')],{'$or':_[_0x04bc('0x40')](_0x3cb291['attributes'],function(_0x574eb3){var _0xb7bdad={};_0xb7bdad[_0x574eb3]={'$like':'%'+_0x3c2185['query']['filter']+'%'};return _0xb7bdad;})});}_0x3cb291=_[_0x04bc('0x51')]({},_0x3cb291,_0x3c2185[_0x04bc('0x59')]);return _0x3775a5[_0x04bc('0xb9')](_0x3cb291);}})['then'](function(_0x22287d){if(_0x22287d){_0x47dcf8=_0x22287d[_0x04bc('0x58')];if(!_0x3c2185[_0x04bc('0x47')][_0x04bc('0x4d')]('nolimit')){_0x3cb291[_0x04bc('0x2e')]=qs[_0x04bc('0x2e')](_0x3c2185[_0x04bc('0x47')][_0x04bc('0x2e')]);_0x3cb291['offset']=qs[_0x04bc('0x2c')](_0x3c2185[_0x04bc('0x47')]['offset']);}return _0x3775a5[_0x04bc('0xb9')](_0x3cb291);}})[_0x04bc('0x35')](function(_0x5259ef){if(_0x5259ef){return _0x5259ef?{'count':_0x47dcf8,'rows':_0x5259ef}:null;}})[_0x04bc('0x35')](respondWithResult(_0x1d4fce,null))[_0x04bc('0x5b')](handleError(_0x1d4fce,null));};exports[_0x04bc('0x3c')]=function(_0x2c485c,_0x1e9e4e,_0x2034ef){var _0x70c5e8,_0x333e8c,_0x1cf016;if(_['isNil'](_0x2c485c[_0x04bc('0x5d')][_0x04bc('0x5d')])||_0x2c485c[_0x04bc('0x5d')][_0x04bc('0x5d')]===''){throw new db['Sequelize'][(_0x04bc('0x77'))](_0x04bc('0xba'));}if(_[_0x04bc('0x7f')](_0x2c485c[_0x04bc('0x5d')]['to'])){}_0x70c5e8=_0x2c485c[_0x04bc('0x5d')]['to'];return db[_0x04bc('0x41')][_0x04bc('0x6a')]({'where':{'id':_0x2c485c[_0x04bc('0x64')]['id']}})['then'](handleEntityNotFound(_0x1e9e4e,null))['then'](function(_0x3e63ff){if(_0x3e63ff){return db['OpenchannelAccount'][_0x04bc('0x5a')]({'where':{'id':_0x3e63ff['id']},'include':[{'model':db['CmList'],'as':_0x04bc('0x87'),'include':[{'model':db[_0x04bc('0x75')],'as':'Contacts','where':{[_0x3e63ff[_0x04bc('0x80')]]:_0x70c5e8},'limit':0x1,'order':[[_0x04bc('0x7b'),_0x04bc('0x85')]]}]}]})[_0x04bc('0x35')](handleEntityNotFound(_0x1e9e4e,null))[_0x04bc('0x35')](function(_0x226019){if(_0x226019&&_0x226019[_0x04bc('0x87')]){_0x333e8c=_0x226019[_0x04bc('0x36')]({'plain':!![]});if(_0x333e8c[_0x04bc('0x87')]&&_0x333e8c['List'][_0x04bc('0x84')][_0x04bc('0x58')]){return _0x333e8c[_0x04bc('0x87')][_0x04bc('0x84')][0x0];}return db[_0x04bc('0x75')][_0x04bc('0x5c')](_['defaults'](_0x2c485c[_0x04bc('0x5d')],{'firstName':_0x70c5e8,[_0x226019['mapKey']]:_0x70c5e8,'phone':_0x70c5e8,'ListId':_0x333e8c[_0x04bc('0x7d')]}));}})[_0x04bc('0x35')](handleEntityNotFound(_0x1e9e4e,null))[_0x04bc('0x35')](function(_0xa75614){if(_0xa75614){_0x1cf016=_0xa75614;return db[_0x04bc('0x90')][_0x04bc('0x5a')]({'where':{'ContactId':_0x1cf016['id'],'closed':![],'OpenchannelAccountId':_0x333e8c['id']}})[_0x04bc('0x35')](function(_0x328088){if(_0x328088){return[_0x328088,![]];}return db[_0x04bc('0x90')][_0x04bc('0x5c')]({'UserId':_0x2c485c['user']['id'],'ContactId':_0x1cf016['id'],'OpenchannelAccountId':_0x333e8c['id'],'lastMsgDirection':'out','Messages':[_[_0x04bc('0x51')](_0x2c485c[_0x04bc('0x5d')],{'read':![],'body':_0x2c485c[_0x04bc('0x5d')][_0x04bc('0x5d')],'OpenchannelAccountId':_0x333e8c['id'],'UserId':_0x2c485c['user']['id'],'ContactId':_0x1cf016['id']})]},{'include':[{'model':db[_0x04bc('0xbb')],'as':_0x04bc('0xbc')}]})[_0x04bc('0x35')](function(_0x3b62e5){return[_0x3b62e5,!![]];});});}})[_0x04bc('0x92')](function(_0x5bf527,_0x254b7f){if(_0x254b7f){return _0x5bf527;}return db[_0x04bc('0xbb')][_0x04bc('0x5c')](_[_0x04bc('0x51')](_0x2c485c[_0x04bc('0x5d')],{'read':![],'body':_0x2c485c[_0x04bc('0x5d')][_0x04bc('0x5d')],'OpenchannelAccountId':_0x333e8c['id'],'OpenchannelInteractionId':_0x5bf527['id'],'UserId':_0x2c485c[_0x04bc('0x5f')]['id'],'ContactId':_0x1cf016['id']}))[_0x04bc('0x35')](function(_0x42ff0c){_0x5bf527[_0x04bc('0xbd')][_0x04bc('0xbc')]=[];_0x5bf527[_0x04bc('0xbd')]['Messages'][_0x04bc('0x97')](_0x42ff0c[_0x04bc('0xbd')]);return _0x5bf527;});});}})[_0x04bc('0x35')](respondWithResult(_0x1e9e4e,null))[_0x04bc('0x5b')](handleError(_0x1e9e4e,null));}; \ No newline at end of file +var _0x5158=['Pause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','show','params','mandatoryDispositionPause','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','hasOwnProperty','removeAnswers','notify','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','OpenchannelMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','sequelize','transaction','bulkCreate','getApplications','getInteractions','Owner','fullname','internal','Tags','tag','findAll','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','name','send','index'];(function(_0x49f1fd,_0x1be18a){var _0xabd89f=function(_0x784d2d){while(--_0x784d2d){_0x49f1fd['push'](_0x49f1fd['shift']());}};_0xabd89f(++_0x1be18a);}(_0x5158,0x7d));var _0x8515=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x5158[_0x5ddaac];return _0x2a9c58;};'use strict';var emlformat=require(_0x8515('0x0'));var rimraf=require(_0x8515('0x1'));var zipdir=require(_0x8515('0x2'));var jsonpatch=require(_0x8515('0x3'));var rp=require(_0x8515('0x4'));var moment=require(_0x8515('0x5'));var BPromise=require(_0x8515('0x6'));var Mustache=require('mustache');var util=require(_0x8515('0x7'));var path=require(_0x8515('0x8'));var sox=require(_0x8515('0x9'));var csv=require(_0x8515('0xa'));var ejs=require(_0x8515('0xb'));var fs=require('fs');var fs_extra=require(_0x8515('0xc'));var _=require(_0x8515('0xd'));var squel=require(_0x8515('0xe'));var crypto=require(_0x8515('0xf'));var jsforce=require(_0x8515('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x8515('0xa'));var querystring=require(_0x8515('0x11'));var Papa=require('papaparse');var Redis=require(_0x8515('0x12'));var authService=require(_0x8515('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8515('0x14'));var hardwareService=require(_0x8515('0x15'));var logger=require(_0x8515('0x16'))('api');var utils=require(_0x8515('0x17'));var config=require(_0x8515('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8515('0x19')]=_[_0x8515('0x1a')](config[_0x8515('0x19')],{'host':_0x8515('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8515('0x19')]));require('./openchannelAccount.socket')[_0x8515('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8515('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x8515('0x1d')][_0x8515('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x28ed1f,_0x3b1646,_0x5dac37,_0x1a965a){return new BPromise(function(_0x3cf427,_0x13402e){var _0x2b9b70=_0x1a965a||client;return _0x2b9b70[_0x8515('0x1f')](_0x28ed1f,_0x5dac37)[_0x8515('0x20')](function(_0x446797){logger[_0x8515('0x21')](_0x8515('0x22'),_0x3b1646,'request\x20sent');logger[_0x8515('0x23')](_0x8515('0x24'),_0x3b1646,_0x8515('0x25'),JSON[_0x8515('0x26')](_0x446797));if(_0x446797['error']){if(_0x446797[_0x8515('0x27')]['code']===0x1f4){logger[_0x8515('0x27')](_0x8515('0x22'),_0x3b1646,_0x446797['error'][_0x8515('0x28')]);return _0x13402e(_0x446797[_0x8515('0x27')]['message']);}logger[_0x8515('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x3b1646,_0x446797[_0x8515('0x27')]['message']);return _0x3cf427(_0x446797[_0x8515('0x27')][_0x8515('0x28')]);}else{logger['info'](_0x8515('0x22'),_0x3b1646,'request\x20sent');_0x3cf427(_0x446797[_0x8515('0x29')][_0x8515('0x28')]);}})[_0x8515('0x2a')](function(_0xe8fb2e){logger['error'](_0x8515('0x22'),_0x3b1646,_0xe8fb2e);_0x13402e(_0xe8fb2e);});});}function respondWithStatusCode(_0xaca919,_0x55e33a){_0x55e33a=_0x55e33a||0xcc;return function(_0x183a8d){if(_0x183a8d){return _0xaca919[_0x8515('0x2b')](_0x55e33a);}return _0xaca919[_0x8515('0x2c')](_0x55e33a)[_0x8515('0x2d')]();};}function respondWithResult(_0x2a6558,_0x11456a){_0x11456a=_0x11456a||0xc8;return function(_0x2ad5a){if(_0x2ad5a){return _0x2a6558['status'](_0x11456a)[_0x8515('0x2e')](_0x2ad5a);}};}function respondWithFilteredResult(_0x302ff5,_0x72992d){return function(_0xe873bb){if(_0xe873bb){var _0x325d4a=typeof _0x72992d[_0x8515('0x2f')]===_0x8515('0x30')&&typeof _0x72992d['limit']===_0x8515('0x30');var _0x4218fb=_0xe873bb[_0x8515('0x31')];var _0xb88197=_0x325d4a?0x0:_0x72992d[_0x8515('0x2f')];var _0x9a2174=_0x325d4a?_0xe873bb[_0x8515('0x31')]:_0x72992d[_0x8515('0x2f')]+_0x72992d[_0x8515('0x32')];var _0x52a994;if(_0x9a2174>=_0x4218fb){_0x9a2174=_0x4218fb;_0x52a994=0xc8;}else{_0x52a994=0xce;}_0x302ff5['status'](_0x52a994);return _0x302ff5[_0x8515('0x33')](_0x8515('0x34'),_0xb88197+'-'+_0x9a2174+'/'+_0x4218fb)[_0x8515('0x2e')](_0xe873bb);}return null;};}function patchUpdates(_0x5e33b2){return function(_0x356891){try{jsonpatch[_0x8515('0x35')](_0x356891,_0x5e33b2,!![]);}catch(_0x1a9c77){return BPromise[_0x8515('0x36')](_0x1a9c77);}return _0x356891[_0x8515('0x37')]();};}function saveUpdates(_0x3d676b,_0x2fe2ac){return function(_0x1d789c){if(_0x1d789c){return _0x1d789c[_0x8515('0x38')](_0x3d676b)[_0x8515('0x20')](function(_0x396ae8){return _0x396ae8;});}return null;};}function removeEntity(_0x15c729,_0x4aba74){return function(_0x3d66b9){if(_0x3d66b9){return _0x3d66b9[_0x8515('0x39')]()['then'](function(){var _0x1f5104=_0x3d66b9[_0x8515('0x3a')]({'plain':!![]});var _0x25feb8=_0x8515('0x3b');return db['UserProfileResource'][_0x8515('0x39')]({'where':{'type':_0x25feb8,'resourceId':_0x1f5104['id']}})[_0x8515('0x20')](function(){return _0x3d66b9;});})['then'](function(){_0x15c729['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xfd7089,_0x593a7e){return function(_0x301a8e){if(!_0x301a8e){_0xfd7089[_0x8515('0x2b')](0x194);}return _0x301a8e;};}function handleError(_0x1dc43c,_0x259189){_0x259189=_0x259189||0x1f4;return function(_0x2ff62a){logger[_0x8515('0x27')](_0x2ff62a['stack']);if(_0x2ff62a['name']){delete _0x2ff62a[_0x8515('0x3c')];}_0x1dc43c[_0x8515('0x2c')](_0x259189)[_0x8515('0x3d')](_0x2ff62a);};}exports[_0x8515('0x3e')]=function(_0x38a3a9,_0x1fcb33){var _0x4ae408={'include':[{'model':db[_0x8515('0x3f')],'as':'mandatoryDispositionPause'}]},_0x1b249a={},_0x16c65f={'count':0x0,'rows':[]};var _0x287c18=_[_0x8515('0x40')](db[_0x8515('0x41')][_0x8515('0x42')],function(_0x378af0){return{'name':_0x378af0[_0x8515('0x43')],'type':_0x378af0[_0x8515('0x44')][_0x8515('0x45')]};});_0x1b249a['model']=_[_0x8515('0x40')](_0x287c18,_0x8515('0x3c'));_0x1b249a[_0x8515('0x46')]=_[_0x8515('0x47')](_0x38a3a9[_0x8515('0x46')]);_0x1b249a[_0x8515('0x48')]=_[_0x8515('0x49')](_0x1b249a['model'],_0x1b249a['query']);_0x4ae408[_0x8515('0x4a')]=_[_0x8515('0x49')](_0x1b249a[_0x8515('0x4b')],qs['fields'](_0x38a3a9[_0x8515('0x46')][_0x8515('0x4c')]));_0x4ae408[_0x8515('0x4a')]=_0x4ae408['attributes'][_0x8515('0x4d')]?_0x4ae408[_0x8515('0x4a')]:_0x1b249a[_0x8515('0x4b')];if(!_0x38a3a9[_0x8515('0x46')]['hasOwnProperty'](_0x8515('0x4e'))){_0x4ae408[_0x8515('0x32')]=qs[_0x8515('0x32')](_0x38a3a9[_0x8515('0x46')][_0x8515('0x32')]);_0x4ae408[_0x8515('0x2f')]=qs[_0x8515('0x2f')](_0x38a3a9[_0x8515('0x46')]['offset']);}_0x4ae408[_0x8515('0x4f')]=qs[_0x8515('0x50')](_0x38a3a9[_0x8515('0x46')]['sort']);_0x4ae408[_0x8515('0x51')]=qs[_0x8515('0x48')](_[_0x8515('0x52')](_0x38a3a9[_0x8515('0x46')],_0x1b249a[_0x8515('0x48')]),_0x287c18);if(_0x38a3a9[_0x8515('0x46')][_0x8515('0x53')]){_0x4ae408['where']=_[_0x8515('0x54')](_0x4ae408[_0x8515('0x51')],{'$or':_[_0x8515('0x40')](_0x287c18,function(_0x21ba30){if(_0x21ba30['type']!==_0x8515('0x55')){var _0x598c38={};_0x598c38[_0x21ba30['name']]={'$like':'%'+_0x38a3a9[_0x8515('0x46')][_0x8515('0x53')]+'%'};return _0x598c38;}})});}_0x4ae408=_['merge']({},_0x4ae408,_0x38a3a9[_0x8515('0x56')]);var _0x2bfa57={'where':_0x4ae408[_0x8515('0x51')]};return db[_0x8515('0x41')][_0x8515('0x31')](_0x2bfa57)[_0x8515('0x20')](function(_0x59a01f){_0x16c65f[_0x8515('0x31')]=_0x59a01f;if(_0x38a3a9[_0x8515('0x46')]['includeAll']){_0x4ae408[_0x8515('0x57')]=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0x4ae408);})['then'](function(_0xfa7ae){_0x16c65f['rows']=_0xfa7ae;return _0x16c65f;})[_0x8515('0x20')](respondWithFilteredResult(_0x1fcb33,_0x4ae408))[_0x8515('0x2a')](handleError(_0x1fcb33,null));};exports[_0x8515('0x58')]=function(_0x5ea487,_0x2fad1c){var _0x144edf={'raw':![],'where':{'id':_0x5ea487[_0x8515('0x59')]['id']},'include':[{'model':db[_0x8515('0x3f')],'as':_0x8515('0x5a')}]},_0x2e3091={};_0x2e3091[_0x8515('0x4b')]=_[_0x8515('0x47')](db['OpenchannelAccount']['rawAttributes']);_0x2e3091[_0x8515('0x46')]=_['keys'](_0x5ea487['query']);_0x2e3091[_0x8515('0x48')]=_[_0x8515('0x49')](_0x2e3091[_0x8515('0x4b')],_0x2e3091[_0x8515('0x46')]);_0x144edf[_0x8515('0x4a')]=_[_0x8515('0x49')](_0x2e3091['model'],qs[_0x8515('0x4c')](_0x5ea487['query'][_0x8515('0x4c')]));_0x144edf[_0x8515('0x4a')]=_0x144edf[_0x8515('0x4a')]['length']?_0x144edf['attributes']:_0x2e3091[_0x8515('0x4b')];if(_0x5ea487[_0x8515('0x46')][_0x8515('0x5b')]){_0x144edf[_0x8515('0x57')]=[{'all':!![]}];}_0x144edf=_['merge']({},_0x144edf,_0x5ea487['options']);return db[_0x8515('0x41')][_0x8515('0x5c')](_0x144edf)[_0x8515('0x20')](handleEntityNotFound(_0x2fad1c,null))[_0x8515('0x20')](respondWithResult(_0x2fad1c,null))[_0x8515('0x2a')](handleError(_0x2fad1c,null));};exports[_0x8515('0x5d')]=function(_0x442444,_0x512634){return db[_0x8515('0x41')][_0x8515('0x5d')](_0x442444[_0x8515('0x5e')],{})[_0x8515('0x20')](function(_0x1db647){var _0x35b660=_0x442444[_0x8515('0x5f')][_0x8515('0x3a')]({'plain':!![]});if(!_0x35b660)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35b660[_0x8515('0x60')]==='user'){var _0x2e8117=_0x1db647[_0x8515('0x3a')]({'plain':!![]});var _0x4194fe=_0x8515('0x3b');return db[_0x8515('0x61')]['find']({'where':{'name':_0x4194fe,'userProfileId':_0x35b660[_0x8515('0x62')]},'raw':!![]})[_0x8515('0x20')](function(_0x4db465){if(_0x4db465&&_0x4db465[_0x8515('0x63')]===0x0){return db[_0x8515('0x64')][_0x8515('0x5d')]({'name':_0x2e8117['name'],'resourceId':_0x2e8117['id'],'type':_0x4db465['name'],'sectionId':_0x4db465['id']},{})[_0x8515('0x20')](function(){return _0x1db647;});}else{return _0x1db647;}})[_0x8515('0x2a')](function(_0x37b373){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37b373);throw _0x37b373;});}return _0x1db647;})[_0x8515('0x20')](respondWithResult(_0x512634,0xc9))[_0x8515('0x2a')](handleError(_0x512634,null));};exports[_0x8515('0x38')]=function(_0xbb9bcd,_0xa1d7d8){if(_0xbb9bcd['body']['id']){delete _0xbb9bcd[_0x8515('0x5e')]['id'];}return db['OpenchannelAccount'][_0x8515('0x5c')]({'where':{'id':_0xbb9bcd['params']['id']},'include':[{'model':db['Pause'],'as':_0x8515('0x5a')}]})['then'](handleEntityNotFound(_0xa1d7d8,null))[_0x8515('0x20')](saveUpdates(_0xbb9bcd['body'],null))[_0x8515('0x20')](respondWithResult(_0xa1d7d8,null))[_0x8515('0x2a')](handleError(_0xa1d7d8,null));};exports[_0x8515('0x39')]=function(_0x107069,_0x37b7de){return db[_0x8515('0x41')][_0x8515('0x5c')]({'where':{'id':_0x107069[_0x8515('0x59')]['id']}})['then'](handleEntityNotFound(_0x37b7de,null))[_0x8515('0x20')](removeEntity(_0x37b7de,null))['catch'](handleError(_0x37b7de,null));};exports[_0x8515('0x65')]=function(_0xe6915b,_0x33467b){return db['OpenchannelAccount'][_0x8515('0x65')]()['then'](respondWithResult(_0x33467b,null))['catch'](handleError(_0x33467b,null));};exports[_0x8515('0x66')]=function(_0x2a01fb,_0x3533f3,_0x478476){if(_0x2a01fb[_0x8515('0x5e')]['id']){delete _0x2a01fb[_0x8515('0x5e')]['id'];}return db[_0x8515('0x41')][_0x8515('0x5c')]({'where':{'id':_0x2a01fb[_0x8515('0x59')]['id']}})['then'](handleEntityNotFound(_0x3533f3,null))[_0x8515('0x20')](function(_0x18bea1){if(_0x18bea1){_0x2a01fb[_0x8515('0x5e')][_0x8515('0x67')]=_0x18bea1['id'];return db['Disposition'][_0x8515('0x5d')](_0x2a01fb[_0x8515('0x5e')]);}})[_0x8515('0x20')](respondWithResult(_0x3533f3,null))['catch'](handleError(_0x3533f3,null));};exports[_0x8515('0x68')]=function(_0x523c55,_0x416dd9,_0x1fc168){var _0x47afc4={'raw':![],'where':{}};var _0x2d4af5={};var _0x3c53fd={'count':0x0,'rows':[]};return db[_0x8515('0x41')][_0x8515('0x69')]({'where':{'id':_0x523c55[_0x8515('0x59')]['id']}})[_0x8515('0x20')](handleEntityNotFound(_0x416dd9,null))['then'](function(_0x18d8da){if(_0x18d8da){_0x2d4af5[_0x8515('0x4b')]=_[_0x8515('0x47')](db[_0x8515('0x6a')][_0x8515('0x42')]);_0x2d4af5[_0x8515('0x46')]=_[_0x8515('0x47')](_0x523c55[_0x8515('0x46')]);_0x2d4af5[_0x8515('0x48')]=_[_0x8515('0x49')](_0x2d4af5[_0x8515('0x4b')],_0x2d4af5[_0x8515('0x46')]);_0x47afc4[_0x8515('0x4a')]=_['intersection'](_0x2d4af5[_0x8515('0x4b')],qs[_0x8515('0x4c')](_0x523c55['query'][_0x8515('0x4c')]));_0x47afc4[_0x8515('0x4a')]=_0x47afc4[_0x8515('0x4a')][_0x8515('0x4d')]?_0x47afc4[_0x8515('0x4a')]:_0x2d4af5[_0x8515('0x4b')];if(!_0x523c55[_0x8515('0x46')]['hasOwnProperty'](_0x8515('0x4e'))){_0x47afc4[_0x8515('0x32')]=qs['limit'](_0x523c55[_0x8515('0x46')][_0x8515('0x32')]);_0x47afc4['offset']=qs[_0x8515('0x2f')](_0x523c55[_0x8515('0x46')][_0x8515('0x2f')]);}_0x47afc4[_0x8515('0x4f')]=qs[_0x8515('0x50')](_0x523c55['query']['sort']);_0x47afc4[_0x8515('0x51')]=qs[_0x8515('0x48')](_['pick'](_0x523c55[_0x8515('0x46')],_0x2d4af5[_0x8515('0x48')]));_0x47afc4['where'][_0x8515('0x67')]=_0x18d8da['id'];if(_0x523c55[_0x8515('0x46')][_0x8515('0x53')]){_0x47afc4['where']=_[_0x8515('0x54')](_0x47afc4[_0x8515('0x51')],{'$or':_['map'](_0x47afc4['attributes'],function(_0x345661){var _0x5bbef1={};_0x5bbef1[_0x345661]={'$like':'%'+_0x523c55[_0x8515('0x46')][_0x8515('0x53')]+'%'};return _0x5bbef1;})});}_0x47afc4=_[_0x8515('0x54')]({},_0x47afc4,_0x523c55[_0x8515('0x56')]);return db[_0x8515('0x6a')]['count']({'where':_0x47afc4['where']})[_0x8515('0x20')](function(_0x16bc26){_0x3c53fd[_0x8515('0x31')]=_0x16bc26;if(_0x523c55['query'][_0x8515('0x5b')]){_0x47afc4[_0x8515('0x57')]=[{'all':!![]}];}return db[_0x8515('0x6a')]['findAll'](_0x47afc4);})[_0x8515('0x20')](function(_0x4d3499){_0x3c53fd[_0x8515('0x6b')]=_0x4d3499;return _0x3c53fd;});}})['then'](respondWithFilteredResult(_0x416dd9,_0x47afc4))['catch'](handleError(_0x416dd9,null));};exports[_0x8515('0x6c')]=function(_0x2aba3f,_0x21ee50,_0x4bf63a){return db[_0x8515('0x41')][_0x8515('0x5c')]({'where':{'id':_0x2aba3f[_0x8515('0x59')]['id']}})[_0x8515('0x20')](handleEntityNotFound(_0x21ee50,null))['then'](function(_0x375ae0){if(_0x375ae0){return _0x375ae0['removeDispositions'](_0x2aba3f['query'][_0x8515('0x6d')]);}})['then'](respondWithStatusCode(_0x21ee50,null))[_0x8515('0x2a')](handleError(_0x21ee50,null));};exports[_0x8515('0x6e')]=function(_0x4133e6,_0x21fb2d,_0x16520c){if(_0x4133e6['body']['id']){delete _0x4133e6[_0x8515('0x5e')]['id'];}return db[_0x8515('0x41')][_0x8515('0x5c')]({'where':{'id':_0x4133e6[_0x8515('0x59')]['id']}})[_0x8515('0x20')](handleEntityNotFound(_0x21fb2d,null))['then'](function(_0xcbc00e){if(_0xcbc00e){_0x4133e6[_0x8515('0x5e')]['OpenchannelAccountId']=_0xcbc00e['id'];return db['CannedAnswer'][_0x8515('0x5d')](_0x4133e6[_0x8515('0x5e')]);}})[_0x8515('0x20')](respondWithResult(_0x21fb2d,null))['catch'](handleError(_0x21fb2d,null));};exports[_0x8515('0x6f')]=function(_0x385ff0,_0x66c629,_0x167365){var _0x39269d={'raw':![],'where':{}};var _0x1b752c={};var _0x445f06={'count':0x0,'rows':[]};return db[_0x8515('0x41')][_0x8515('0x69')]({'where':{'id':_0x385ff0[_0x8515('0x59')]['id']}})[_0x8515('0x20')](handleEntityNotFound(_0x66c629,null))[_0x8515('0x20')](function(_0x41c763){if(_0x41c763){_0x1b752c[_0x8515('0x4b')]=_[_0x8515('0x47')](db[_0x8515('0x70')]['rawAttributes']);_0x1b752c['query']=_[_0x8515('0x47')](_0x385ff0[_0x8515('0x46')]);_0x1b752c[_0x8515('0x48')]=_[_0x8515('0x49')](_0x1b752c[_0x8515('0x4b')],_0x1b752c[_0x8515('0x46')]);_0x39269d[_0x8515('0x4a')]=_[_0x8515('0x49')](_0x1b752c['model'],qs[_0x8515('0x4c')](_0x385ff0[_0x8515('0x46')][_0x8515('0x4c')]));_0x39269d[_0x8515('0x4a')]=_0x39269d[_0x8515('0x4a')][_0x8515('0x4d')]?_0x39269d[_0x8515('0x4a')]:_0x1b752c[_0x8515('0x4b')];if(!_0x385ff0[_0x8515('0x46')][_0x8515('0x71')](_0x8515('0x4e'))){_0x39269d['limit']=qs[_0x8515('0x32')](_0x385ff0[_0x8515('0x46')][_0x8515('0x32')]);_0x39269d[_0x8515('0x2f')]=qs[_0x8515('0x2f')](_0x385ff0['query'][_0x8515('0x2f')]);}_0x39269d[_0x8515('0x4f')]=qs[_0x8515('0x50')](_0x385ff0[_0x8515('0x46')][_0x8515('0x50')]);_0x39269d['where']=qs[_0x8515('0x48')](_[_0x8515('0x52')](_0x385ff0[_0x8515('0x46')],_0x1b752c[_0x8515('0x48')]));_0x39269d[_0x8515('0x51')]['OpenchannelAccountId']=_0x41c763['id'];if(_0x385ff0[_0x8515('0x46')][_0x8515('0x53')]){_0x39269d[_0x8515('0x51')]=_['merge'](_0x39269d[_0x8515('0x51')],{'$or':_[_0x8515('0x40')](_0x39269d[_0x8515('0x4a')],function(_0x405c03){var _0x1e5544={};_0x1e5544[_0x405c03]={'$like':'%'+_0x385ff0[_0x8515('0x46')][_0x8515('0x53')]+'%'};return _0x1e5544;})});}_0x39269d=_[_0x8515('0x54')]({},_0x39269d,_0x385ff0['options']);return db['CannedAnswer'][_0x8515('0x31')]({'where':_0x39269d[_0x8515('0x51')]})[_0x8515('0x20')](function(_0x2a14d2){_0x445f06[_0x8515('0x31')]=_0x2a14d2;if(_0x385ff0[_0x8515('0x46')]['includeAll']){_0x39269d['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x39269d);})['then'](function(_0x598174){_0x445f06[_0x8515('0x6b')]=_0x598174;return _0x445f06;});}})[_0x8515('0x20')](respondWithFilteredResult(_0x66c629,_0x39269d))['catch'](handleError(_0x66c629,null));};exports['removeAnswers']=function(_0x3a54,_0x2dde99,_0x2fd539){return db[_0x8515('0x41')]['find']({'where':{'id':_0x3a54[_0x8515('0x59')]['id']}})['then'](handleEntityNotFound(_0x2dde99,null))['then'](function(_0x48c247){if(_0x48c247){return _0x48c247[_0x8515('0x72')](_0x3a54['query'][_0x8515('0x6d')]);}})['then'](respondWithStatusCode(_0x2dde99,null))['catch'](handleError(_0x2dde99,null));};exports[_0x8515('0x73')]=function(_0x597eee,_0x2823ea,_0x2c3a87){var _0x5d7640={'body':_0x597eee[_0x8515('0x5e')],'channel':'openchannel'};var _0x1c4847=[];var _0x3bb77b=[];var _0x19f772={};var _0x568dfc=![];return db[_0x8515('0x74')]['describe']()[_0x8515('0x20')](function(_0x3bbb96){if(!_0x3bbb96){throw new db['Sequelize'][(_0x8515('0x75'))](_0x8515('0x76'));}_0x1c4847=_[_0x8515('0x77')](_[_0x8515('0x47')](_0x3bbb96),[_0x8515('0x78'),_0x8515('0x79')]);_0x3bb77b=_[_0x8515('0x77')](_['keys'](_0x3bbb96),[_0x8515('0x78'),_0x8515('0x79'),_0x8515('0x7a'),_0x8515('0x7b')]);if(_0x597eee['body']['id']){delete _0x597eee['body']['id'];}if(_[_0x8515('0x7c')](_0x597eee[_0x8515('0x5e')][_0x8515('0x7d')])){throw new db[(_0x8515('0x7e'))][(_0x8515('0x75'))](_0x8515('0x7f'));}if(_[_0x8515('0x7c')](_0x597eee[_0x8515('0x5e')]['body'])||_0x597eee[_0x8515('0x5e')]['body']===''){throw new db[(_0x8515('0x7e'))][(_0x8515('0x75'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x597eee[_0x8515('0x5e')][_0x8515('0x80')])){throw new db[(_0x8515('0x7e'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3bb77b);}if(!_[_0x8515('0x81')](_0x3bb77b,_0x597eee['body'][_0x8515('0x80')])){throw new db[(_0x8515('0x7e'))][(_0x8515('0x75'))](_0x8515('0x82')+_0x3bb77b);}_0x19f772[_0x597eee['body'][_0x8515('0x80')]]=_0x597eee['body'][_0x8515('0x7d')];})['then'](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x597eee['params']['id']},'include':[{'model':db[_0x8515('0x83')],'as':_0x8515('0x84'),'include':[{'model':db[_0x8515('0x74')],'as':_0x8515('0x85'),'where':_0x19f772,'limit':0x1,'order':[[_0x8515('0x79'),'DESC']]}]},{'model':db[_0x8515('0x86')],'as':_0x8515('0x87')}]});})[_0x8515('0x20')](handleEntityNotFound(_0x2823ea,null))[_0x8515('0x20')](function(_0x3952f4){if(_0x3952f4&&_0x3952f4[_0x8515('0x84')]){_0x5d7640[_0x8515('0x88')]=_0x3952f4;_0x5d7640[_0x8515('0x89')]=_0x3952f4[_0x8515('0x87')];_0x5d7640[_0x8515('0x8a')]=_0x3952f4[_0x8515('0x84')];_0x5d7640['applications']=_[_0x8515('0x8b')](_0x5d7640['applications'],[_0x8515('0x8c')],[_0x8515('0x8d')]);if(_0x5d7640[_0x8515('0x88')][_0x8515('0x87')]){delete _0x5d7640[_0x8515('0x88')]['Applications'];}if(_0x5d7640[_0x8515('0x88')]['List']&&_0x5d7640[_0x8515('0x88')]['List'][_0x8515('0x85')][_0x8515('0x4d')]){return _0x5d7640[_0x8515('0x88')][_0x8515('0x84')][_0x8515('0x85')][0x0];}var _0x478f84=_[_0x8515('0x1a')](_0x597eee['body'],{'firstName':_0x597eee['body']['from'],'ListId':_0x3952f4[_0x8515('0x7b')]});_0x478f84[_0x597eee[_0x8515('0x5e')][_0x8515('0x80')]]=_0x597eee[_0x8515('0x5e')][_0x8515('0x7d')];return db[_0x8515('0x74')][_0x8515('0x5d')](_0x478f84,{'fields':_0x1c4847,'raw':!![]});}})[_0x8515('0x20')](handleEntityNotFound(_0x2823ea,null))[_0x8515('0x20')](function(_0x17f217){_0x5d7640[_0x8515('0x8e')]=_0x17f217;if(_0x17f217){var _0x89c78d={'ContactId':_0x17f217['id'],'OpenchannelAccountId':_0x597eee[_0x8515('0x59')]['id'],'from':(_0x17f217[_0x8515('0x8f')]||'')+'\x20'+(_0x17f217[_0x8515('0x90')]||'')};var _0x1d7a32={'OpenchannelAccountId':_0x597eee[_0x8515('0x59')]['id'],'closed':![]};if(_0x597eee[_0x8515('0x5e')][_0x8515('0x91')]){_0x1d7a32[_0x8515('0x91')]=_0x597eee['body']['threadId'];return db['OpenchannelInteraction'][_0x8515('0x5c')]({'where':_0x1d7a32})[_0x8515('0x20')](function(_0xfebb37){if(_0xfebb37){return[_0xfebb37,![]];}_0x89c78d[_0x8515('0x91')]=_0x597eee[_0x8515('0x5e')][_0x8515('0x91')];_0x89c78d[_0x8515('0x92')]=_0x597eee[_0x8515('0x5e')]['externalUrl'];return db[_0x8515('0x93')][_0x8515('0x5d')](_0x89c78d)['then'](function(_0x15c40c){return[_0x15c40c,!![]];});});}else{_0x1d7a32[_0x8515('0x91')]=null;}_0x1d7a32[_0x8515('0x94')]=_0x17f217['id'];return db['OpenchannelInteraction'][_0x8515('0x5c')]({'where':_0x1d7a32})[_0x8515('0x20')](function(_0x34b4df){if(_0x34b4df){return[_0x34b4df,![]];}return db['OpenchannelInteraction'][_0x8515('0x5d')](_0x89c78d)[_0x8515('0x20')](function(_0x570e2e){return[_0x570e2e,!![]];});});}})[_0x8515('0x95')](function(_0x3fdc8d,_0x151f61){if(_0x3fdc8d){_0x568dfc=_0x151f61;if(!_0x151f61){var _0x2c1ca6={'from':(_0x5d7640[_0x8515('0x8e')][_0x8515('0x8f')]||'')+'\x20'+(_0x5d7640[_0x8515('0x8e')][_0x8515('0x90')]||'')};if(_0x597eee['body'][_0x8515('0x91')]&&_0x597eee[_0x8515('0x5e')][_0x8515('0x96')]&&_0x597eee[_0x8515('0x5e')][_0x8515('0x91')]!=_0x597eee[_0x8515('0x5e')][_0x8515('0x96')]){_0x2c1ca6[_0x8515('0x91')]=_0x597eee['body']['messageId'];}return _0x3fdc8d['update'](_0x2c1ca6);}else{return _0x3fdc8d;}}})['then'](function(_0xa0552d){_0x5d7640[_0x8515('0x97')]=_0xa0552d[_0x8515('0x3a')]({'plain':!![]});_0x5d7640[_0x8515('0x97')][_0x8515('0x98')]=_0x568dfc;if(_0x5d7640['interaction'][_0x8515('0x98')]){if(_0x5d7640['account'][_0x8515('0x99')]){_0x5d7640[_0x8515('0x89')][_0x8515('0x9a')]({'id':0x0,'priority':_0x5d7640[_0x8515('0x89')][_0x8515('0x4d')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x8515('0x9b')]['create']({'body':_0x597eee[_0x8515('0x5e')]['body'],'OpenchannelAccountId':_0x597eee['params']['id'],'OpenchannelInteractionId':_0xa0552d['id'],'direction':'in','ContactId':_0x5d7640[_0x8515('0x8e')]['id'],'AttachmentId':_0x597eee['body']['AttachmentId']});})['then'](function(_0x565b10){_0x5d7640['message']=_0x565b10;if(_0x5d7640['interaction'][_0x8515('0x9c')]){return db[_0x8515('0x9d')]['find']({'attributes':['id',_0x8515('0x3c')],'where':{'id':_0x5d7640[_0x8515('0x97')]['UserId']}})[_0x8515('0x20')](function(_0x1de476){if(_0x1de476){_0x5d7640[_0x8515('0x89')][_0x8515('0x9e')]({'id':0x0,'priority':0x0,'app':_0x8515('0x9f'),'appdata':_0x1de476[_0x8515('0x3c')]+','+(_0x5d7640[_0x8515('0x88')][_0x8515('0xa0')]||0xa),'interval':_0x8515('0xa1')});_0x5d7640['forcedOwnership']=![];}return respondWithRpcPromise(_0x8515('0xa2'),_0x8515('0xa3'),_0x5d7640);});}return respondWithRpcPromise(_0x8515('0xa2'),'startRouting',_0x5d7640);})[_0x8515('0x20')](function(_0x17d7e5){respondWithRpcPromise('EventManager',_0x8515('0xa4'),{'event':_0x8515('0x73'),'message':_0x17d7e5},client9002);return _0x17d7e5;})[_0x8515('0x20')](respondWithResult(_0x2823ea,null))[_0x8515('0x2a')](handleError(_0x2823ea,null));};exports['addApplications']=function(_0x64b85b,_0x12195e,_0x3470d7){return db[_0x8515('0x41')]['findOne']({'where':{'id':_0x64b85b['params']['id']}})[_0x8515('0x20')](handleEntityNotFound(_0x12195e,null))['then'](function(_0x4697b5){if(_0x4697b5){return db[_0x8515('0xa5')][_0x8515('0xa6')](function(_0x999bf6){return db[_0x8515('0x86')][_0x8515('0x39')]({'where':{'OpenchannelAccountId':_0x64b85b['params']['id']},'transaction':_0x999bf6})[_0x8515('0x20')](function(_0x26f1c3){var _0x541006=_[_0x8515('0x40')](_0x64b85b[_0x8515('0x5e')],function(_0x166da3){_0x166da3[_0x8515('0x67')]=_0x64b85b[_0x8515('0x59')]['id'];return _0x166da3;});return db[_0x8515('0x86')][_0x8515('0xa7')](_0x541006,{'transaction':_0x999bf6});});})[_0x8515('0x20')](function(){return db[_0x8515('0x86')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x64b85b[_0x8515('0x59')]['id']},'order':_0x8515('0x8c')});});}})[_0x8515('0x20')](respondWithResult(_0x12195e,null))[_0x8515('0x2a')](handleError(_0x12195e,null));};exports[_0x8515('0xa8')]=function(_0x126951,_0x5ebf37,_0x415403){var _0x1cee85={};var _0x184773={};var _0x54755c;var _0x4c044b;return db['OpenchannelAccount'][_0x8515('0x69')]({'where':{'id':_0x126951['params']['id']}})[_0x8515('0x20')](handleEntityNotFound(_0x5ebf37,null))[_0x8515('0x20')](function(_0x6406a4){if(_0x6406a4){_0x54755c=_0x6406a4;_0x184773['model']=_['keys'](db[_0x8515('0x86')][_0x8515('0x42')]);_0x184773[_0x8515('0x46')]=_[_0x8515('0x47')](_0x126951[_0x8515('0x46')]);_0x184773[_0x8515('0x48')]=_[_0x8515('0x49')](_0x184773['model'],_0x184773[_0x8515('0x46')]);_0x1cee85['attributes']=_[_0x8515('0x49')](_0x184773['model'],qs[_0x8515('0x4c')](_0x126951['query'][_0x8515('0x4c')]));_0x1cee85['attributes']=_0x1cee85[_0x8515('0x4a')][_0x8515('0x4d')]?_0x1cee85[_0x8515('0x4a')]:_0x184773[_0x8515('0x4b')];_0x1cee85['order']=qs[_0x8515('0x50')](_0x126951[_0x8515('0x46')][_0x8515('0x50')]);_0x1cee85['where']=qs['filters'](_['pick'](_0x126951[_0x8515('0x46')],_0x184773[_0x8515('0x48')]));if(_0x126951[_0x8515('0x46')][_0x8515('0x53')]){_0x1cee85['where']=_[_0x8515('0x54')](_0x1cee85['where'],{'$or':_[_0x8515('0x40')](_0x1cee85[_0x8515('0x4a')],function(_0xc77211){var _0x26e6f5={};_0x26e6f5[_0xc77211]={'$like':'%'+_0x126951['query'][_0x8515('0x53')]+'%'};return _0x26e6f5;})});}_0x1cee85=_[_0x8515('0x54')]({},_0x1cee85,_0x126951[_0x8515('0x56')]);return _0x54755c[_0x8515('0xa8')](_0x1cee85);}})[_0x8515('0x20')](function(_0x4e909d){if(_0x4e909d){_0x4c044b=_0x4e909d['length'];if(!_0x126951['query'][_0x8515('0x71')](_0x8515('0x4e'))){_0x1cee85[_0x8515('0x32')]=qs[_0x8515('0x32')](_0x126951[_0x8515('0x46')][_0x8515('0x32')]);_0x1cee85[_0x8515('0x2f')]=qs['offset'](_0x126951[_0x8515('0x46')][_0x8515('0x2f')]);}return _0x54755c[_0x8515('0xa8')](_0x1cee85);}})[_0x8515('0x20')](function(_0x2c0ecb){if(_0x2c0ecb){return _0x2c0ecb?{'count':_0x4c044b,'rows':_0x2c0ecb}:null;}})[_0x8515('0x20')](respondWithResult(_0x5ebf37,null))['catch'](handleError(_0x5ebf37,null));};exports[_0x8515('0xa9')]=function(_0x272cc,_0xe3f86c,_0x403502){var _0x195e37={'raw':![],'where':{}};var _0x468d82={};var _0x1b4f60={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x8515('0x69')]({'where':{'id':_0x272cc[_0x8515('0x59')]['id']}})['then'](handleEntityNotFound(_0xe3f86c,null))[_0x8515('0x20')](function(_0xefc6a7){if(_0xefc6a7){_0x468d82['model']=_[_0x8515('0x47')](db[_0x8515('0x93')][_0x8515('0x42')]);_0x468d82[_0x8515('0x46')]=_['keys'](_0x272cc[_0x8515('0x46')]);_0x468d82['filters']=_['intersection'](_0x468d82[_0x8515('0x4b')],_0x468d82['query']);_0x195e37[_0x8515('0x4a')]=_[_0x8515('0x49')](_0x468d82[_0x8515('0x4b')],qs[_0x8515('0x4c')](_0x272cc[_0x8515('0x46')]['fields']));_0x195e37[_0x8515('0x4a')]=_0x195e37['attributes'][_0x8515('0x4d')]?_0x195e37[_0x8515('0x4a')]:_0x468d82['model'];if(!_0x272cc['query'][_0x8515('0x71')](_0x8515('0x4e'))){_0x195e37['limit']=qs[_0x8515('0x32')](_0x272cc[_0x8515('0x46')][_0x8515('0x32')]);_0x195e37[_0x8515('0x2f')]=qs[_0x8515('0x2f')](_0x272cc[_0x8515('0x46')][_0x8515('0x2f')]);}_0x195e37[_0x8515('0x4f')]=qs[_0x8515('0x50')](_0x272cc[_0x8515('0x46')]['sort']);_0x195e37['where']=qs[_0x8515('0x48')](_[_0x8515('0x52')](_0x272cc[_0x8515('0x46')],_0x468d82['filters']));_0x195e37[_0x8515('0x51')]['OpenchannelAccountId']=_0xefc6a7['id'];if(_0x272cc[_0x8515('0x46')]['filter']){_0x195e37['where']=_[_0x8515('0x54')](_0x195e37[_0x8515('0x51')],{'$or':_['map'](_0x195e37[_0x8515('0x4a')],function(_0x215474){var _0x29e5a1={};_0x29e5a1[_0x215474]={'$like':'%'+_0x272cc['query'][_0x8515('0x53')]+'%'};return _0x29e5a1;})});}_0x195e37=_[_0x8515('0x54')]({},_0x195e37,_0x272cc[_0x8515('0x56')]);return db['OpenchannelInteraction']['count']({'where':_0x195e37[_0x8515('0x51')]})[_0x8515('0x20')](function(_0x332b36){_0x1b4f60[_0x8515('0x31')]=_0x332b36;if(_0x272cc[_0x8515('0x46')][_0x8515('0x5b')]){_0x195e37['include']=[{'model':db[_0x8515('0x74')],'as':'Contact','required':![]},{'model':db[_0x8515('0x9d')],'as':_0x8515('0xaa'),'attributes':[_0x8515('0x3c'),_0x8515('0xab'),_0x8515('0xac')],'required':![]},{'model':db['Tag'],'as':_0x8515('0xad'),'attributes':['id',_0x8515('0x3c'),'color'],'where':_0x272cc[_0x8515('0x46')][_0x8515('0xae')]?{'id':_0x272cc['query'][_0x8515('0xae')]}:undefined,'required':_0x272cc[_0x8515('0x46')][_0x8515('0xae')]?!![]:![]}];}return db[_0x8515('0x93')][_0x8515('0xaf')](_0x195e37);})['then'](function(_0x2143b1){_0x1b4f60[_0x8515('0x6b')]=_0x2143b1;return _0x1b4f60;});}})[_0x8515('0x20')](respondWithFilteredResult(_0xe3f86c,_0x195e37))[_0x8515('0x2a')](handleError(_0xe3f86c,null));};exports[_0x8515('0xb0')]=function(_0x171ad5,_0xa23f4b,_0x27a49a){return db[_0x8515('0x41')]['find']({'where':{'id':_0x171ad5[_0x8515('0x59')]['id']}})[_0x8515('0x20')](handleEntityNotFound(_0xa23f4b,null))[_0x8515('0x20')](function(_0x9fb8f1){if(_0x9fb8f1){return _0x9fb8f1[_0x8515('0xb0')](_0x171ad5[_0x8515('0x5e')]['ids'],_['omit'](_0x171ad5[_0x8515('0x5e')],[_0x8515('0x6d'),'id'])||{})[_0x8515('0x95')](function(_0x49b472){for(var _0x5ce1fa=0x0;_0x5ce1fa<_0x171ad5[_0x8515('0x5e')][_0x8515('0x6d')]['length'];_0x5ce1fa+=0x1){socket[_0x8515('0xb1')](_0x8515('0xb2'),{'UserId':Number(_0x171ad5[_0x8515('0x5e')]['ids'][_0x5ce1fa]),'OpenchannelAccountId':Number(_0x171ad5['params']['id'])});}return _0x49b472;});}})[_0x8515('0x20')](respondWithResult(_0xa23f4b,null))[_0x8515('0x2a')](handleError(_0xa23f4b,null));};exports[_0x8515('0xb3')]=function(_0x2dce3f,_0x5374ab,_0x118dfc){return db[_0x8515('0x41')][_0x8515('0x5c')]({'where':{'id':_0x2dce3f[_0x8515('0x59')]['id']}})['then'](handleEntityNotFound(_0x5374ab,null))[_0x8515('0x20')](function(_0x17317c){if(_0x17317c){return _0x17317c['removeAgents'](_0x2dce3f[_0x8515('0x46')][_0x8515('0x6d')])[_0x8515('0x20')](function(){if(_[_0x8515('0xb4')](_0x2dce3f[_0x8515('0x46')][_0x8515('0x6d')])){for(var _0x12cae5=0x0;_0x12cae5<_0x2dce3f[_0x8515('0x46')]['ids']['length'];_0x12cae5+=0x1){socket[_0x8515('0xb1')](_0x8515('0xb5'),{'UserId':Number(_0x2dce3f[_0x8515('0x46')]['ids'][_0x12cae5]),'OpenchannelAccountId':Number(_0x2dce3f['params']['id'])});}}else{socket[_0x8515('0xb1')](_0x8515('0xb5'),{'UserId':Number(_0x2dce3f[_0x8515('0x46')]['ids']),'OpenchannelAccountId':Number(_0x2dce3f[_0x8515('0x59')]['id'])});}});}})[_0x8515('0x20')](respondWithStatusCode(_0x5374ab,null))[_0x8515('0x2a')](handleError(_0x5374ab,null));};exports[_0x8515('0xb6')]=function(_0x40e6e8,_0x480445,_0x557172){var _0x1ab773={};var _0x409382={};var _0x3a6639;var _0x40df9d;return db[_0x8515('0x41')][_0x8515('0x69')]({'where':{'id':_0x40e6e8[_0x8515('0x59')]['id']}})[_0x8515('0x20')](handleEntityNotFound(_0x480445,null))[_0x8515('0x20')](function(_0x3594cb){if(_0x3594cb){_0x3a6639=_0x3594cb;_0x409382[_0x8515('0x4b')]=_[_0x8515('0x47')](db[_0x8515('0x9d')][_0x8515('0x42')]);_0x409382[_0x8515('0x46')]=_[_0x8515('0x47')](_0x40e6e8['query']);_0x409382[_0x8515('0x48')]=_[_0x8515('0x49')](_0x409382[_0x8515('0x4b')],_0x409382[_0x8515('0x46')]);_0x1ab773[_0x8515('0x4a')]=_['intersection'](_0x409382['model'],qs['fields'](_0x40e6e8[_0x8515('0x46')][_0x8515('0x4c')]));_0x1ab773[_0x8515('0x4a')]=_0x1ab773[_0x8515('0x4a')][_0x8515('0x4d')]?_0x1ab773[_0x8515('0x4a')]:_0x409382['model'];_0x1ab773['order']=qs['sort'](_0x40e6e8['query'][_0x8515('0x50')]);_0x1ab773[_0x8515('0x51')]=qs[_0x8515('0x48')](_[_0x8515('0x52')](_0x40e6e8[_0x8515('0x46')],_0x409382['filters']));if(_0x40e6e8[_0x8515('0x46')][_0x8515('0x53')]){_0x1ab773[_0x8515('0x51')]=_[_0x8515('0x54')](_0x1ab773[_0x8515('0x51')],{'$or':_[_0x8515('0x40')](_0x1ab773['attributes'],function(_0x445724){var _0x2779e5={};_0x2779e5[_0x445724]={'$like':'%'+_0x40e6e8[_0x8515('0x46')][_0x8515('0x53')]+'%'};return _0x2779e5;})});}_0x1ab773=_[_0x8515('0x54')]({},_0x1ab773,_0x40e6e8['options']);return _0x3a6639['getAgents'](_0x1ab773);}})['then'](function(_0x7b7df8){if(_0x7b7df8){_0x40df9d=_0x7b7df8['length'];if(!_0x40e6e8[_0x8515('0x46')][_0x8515('0x71')](_0x8515('0x4e'))){_0x1ab773[_0x8515('0x32')]=qs[_0x8515('0x32')](_0x40e6e8[_0x8515('0x46')][_0x8515('0x32')]);_0x1ab773[_0x8515('0x2f')]=qs[_0x8515('0x2f')](_0x40e6e8[_0x8515('0x46')][_0x8515('0x2f')]);}return _0x3a6639['getAgents'](_0x1ab773);}})[_0x8515('0x20')](function(_0x125e21){if(_0x125e21){return _0x125e21?{'count':_0x40df9d,'rows':_0x125e21}:null;}})[_0x8515('0x20')](respondWithResult(_0x480445,null))[_0x8515('0x2a')](handleError(_0x480445,null));};exports[_0x8515('0x3d')]=function(_0x432b91,_0x47495a,_0x33fd3f){var _0x594c61,_0x1641ba,_0x37a4b3;if(_[_0x8515('0x7c')](_0x432b91[_0x8515('0x5e')][_0x8515('0x5e')])||_0x432b91[_0x8515('0x5e')][_0x8515('0x5e')]===''){throw new db[(_0x8515('0x7e'))][(_0x8515('0x75'))](_0x8515('0xb7'));}if(_['isNil'](_0x432b91['body']['to'])){}_0x594c61=_0x432b91[_0x8515('0x5e')]['to'];return db['OpenchannelAccount'][_0x8515('0x69')]({'where':{'id':_0x432b91['params']['id']}})[_0x8515('0x20')](handleEntityNotFound(_0x47495a,null))[_0x8515('0x20')](function(_0x37eadf){if(_0x37eadf){return db[_0x8515('0x41')][_0x8515('0x5c')]({'where':{'id':_0x37eadf['id']},'include':[{'model':db['CmList'],'as':_0x8515('0x84'),'include':[{'model':db[_0x8515('0x74')],'as':_0x8515('0x85'),'where':{[_0x37eadf[_0x8515('0x80')]]:_0x594c61},'limit':0x1,'order':[[_0x8515('0x79'),_0x8515('0xb8')]]}]}]})[_0x8515('0x20')](handleEntityNotFound(_0x47495a,null))['then'](function(_0x4c7d6c){if(_0x4c7d6c&&_0x4c7d6c[_0x8515('0x84')]){_0x1641ba=_0x4c7d6c[_0x8515('0x3a')]({'plain':!![]});if(_0x1641ba[_0x8515('0x84')]&&_0x1641ba[_0x8515('0x84')]['Contacts']['length']){return _0x1641ba[_0x8515('0x84')][_0x8515('0x85')][0x0];}return db[_0x8515('0x74')][_0x8515('0x5d')](_[_0x8515('0x1a')](_0x432b91[_0x8515('0x5e')],{'firstName':_0x594c61,[_0x4c7d6c[_0x8515('0x80')]]:_0x594c61,'phone':_0x594c61,'ListId':_0x1641ba[_0x8515('0x7b')]}));}})[_0x8515('0x20')](handleEntityNotFound(_0x47495a,null))['then'](function(_0x2c3e51){if(_0x2c3e51){_0x37a4b3=_0x2c3e51;return db[_0x8515('0x93')][_0x8515('0x5c')]({'where':{'ContactId':_0x37a4b3['id'],'closed':![],'OpenchannelAccountId':_0x1641ba['id']}})[_0x8515('0x20')](function(_0x240c71){if(_0x240c71){return[_0x240c71,![]];}return db[_0x8515('0x93')][_0x8515('0x5d')]({'UserId':_0x432b91[_0x8515('0x5f')]['id'],'ContactId':_0x37a4b3['id'],'OpenchannelAccountId':_0x1641ba['id'],'lastMsgDirection':_0x8515('0xb9'),'Messages':[_['merge'](_0x432b91[_0x8515('0x5e')],{'read':![],'body':_0x432b91[_0x8515('0x5e')][_0x8515('0x5e')],'OpenchannelAccountId':_0x1641ba['id'],'UserId':_0x432b91[_0x8515('0x5f')]['id'],'ContactId':_0x37a4b3['id']})]},{'include':[{'model':db[_0x8515('0x9b')],'as':_0x8515('0xba')}]})[_0x8515('0x20')](function(_0x3fdb36){return[_0x3fdb36,!![]];});});}})[_0x8515('0x95')](function(_0x393d06,_0x246c18){if(_0x246c18){return _0x393d06;}return db[_0x8515('0x9b')][_0x8515('0x5d')](_[_0x8515('0x54')](_0x432b91[_0x8515('0x5e')],{'read':![],'body':_0x432b91['body']['body'],'OpenchannelAccountId':_0x1641ba['id'],'OpenchannelInteractionId':_0x393d06['id'],'UserId':_0x432b91['user']['id'],'ContactId':_0x37a4b3['id']}))[_0x8515('0x20')](function(_0x13962c){_0x393d06[_0x8515('0xbb')][_0x8515('0xba')]=[];_0x393d06[_0x8515('0xbb')][_0x8515('0xba')]['push'](_0x13962c[_0x8515('0xbb')]);return _0x393d06;});});}})[_0x8515('0x20')](respondWithResult(_0x47495a,null))[_0x8515('0x2a')](handleError(_0x47495a,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 3df8a48..3ac3154 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 _0x9348=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x13dd08,_0xb821e3){var _0x442044=function(_0x165cca){while(--_0x165cca){_0x13dd08['push'](_0x13dd08['shift']());}};_0x442044(++_0xb821e3);}(_0x9348,0x10d));var _0x8934=function(_0x45cc23,_0x210892){_0x45cc23=_0x45cc23-0x0;var _0x125bf2=_0x9348[_0x45cc23];return _0x125bf2;};'use strict';var EventEmitter=require(_0x8934('0x0'));var OpenchannelAccount=require(_0x8934('0x1'))['db'][_0x8934('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8934('0x3')](0x0);var events={'afterCreate':_0x8934('0x4'),'afterUpdate':'update','afterDestroy':_0x8934('0x5')};function emitEvent(_0x35da0b){return function(_0x5f34d7,_0x34f94c,_0x923aa3){OpenchannelAccountEvents[_0x8934('0x6')](_0x35da0b+':'+_0x5f34d7['id'],_0x5f34d7);OpenchannelAccountEvents[_0x8934('0x6')](_0x35da0b,_0x5f34d7);_0x923aa3(null);};}for(var e in events){if(events[_0x8934('0x7')](e)){var event=events[e];OpenchannelAccount[_0x8934('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xaa88=['../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','hasOwnProperty','exports','events'];(function(_0x3c4a0f,_0x2821ae){var _0x3de6b3=function(_0x1bb317){while(--_0x1bb317){_0x3c4a0f['push'](_0x3c4a0f['shift']());}};_0x3de6b3(++_0x2821ae);}(_0xaa88,0x137));var _0x8aa8=function(_0x450bf9,_0x1895de){_0x450bf9=_0x450bf9-0x0;var _0x268350=_0xaa88[_0x450bf9];return _0x268350;};'use strict';var EventEmitter=require(_0x8aa8('0x0'));var OpenchannelAccount=require(_0x8aa8('0x1'))['db'][_0x8aa8('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8aa8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8aa8('0x4'),'afterDestroy':_0x8aa8('0x5')};function emitEvent(_0x43f7e4){return function(_0x3b2c88,_0x3e3b70,_0x350e8b){OpenchannelAccountEvents['emit'](_0x43f7e4+':'+_0x3b2c88['id'],_0x3b2c88);OpenchannelAccountEvents['emit'](_0x43f7e4,_0x3b2c88);_0x350e8b(null);};}for(var e in events){if(events[_0x8aa8('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x8aa8('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 3e3066d..9748840 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(_0x2ab0f1,_0x33f475){var _0x21c9c3=function(_0x59eadf){while(--_0x59eadf){_0x2ab0f1['push'](_0x2ab0f1['shift']());}};_0x21c9c3(++_0x33f475);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x454877,_0x419192){var _0x1d621d=function(_0x2b253f){while(--_0x2b253f){_0x454877['push'](_0x454877['shift']());}};_0x1d621d(++_0x419192);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 41666c5..acb53cf 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 _0x4fc2=['rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4fc2,0x111));var _0x24fc=function(_0x525e25,_0x47c71f){_0x525e25=_0x525e25-0x0;var _0xceb2f9=_0x4fc2[_0x525e25];return _0xceb2f9;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});config['redis']=_[_0x24fc('0xb')](config[_0x24fc('0xc')],{'host':_0x24fc('0xd'),'port':0x18eb});var socket=require(_0x24fc('0xe'))(new Redis(config[_0x24fc('0xc')]));require(_0x24fc('0xf'))['register'](socket);function respondWithRpcPromise(_0x44caca,_0x1819a5,_0x1a4462){return new BPromise(function(_0x133438,_0x24998d){return client[_0x24fc('0x10')](_0x44caca,_0x1a4462)[_0x24fc('0x11')](function(_0x9a1673){logger['info'](_0x24fc('0x12'),_0x1819a5,_0x24fc('0x13'));logger['debug'](_0x24fc('0x14'),_0x1819a5,_0x24fc('0x13'),JSON[_0x24fc('0x15')](_0x9a1673));if(_0x9a1673[_0x24fc('0x16')]){if(_0x9a1673[_0x24fc('0x16')][_0x24fc('0x17')]===0x1f4){logger['error'](_0x24fc('0x12'),_0x1819a5,_0x9a1673[_0x24fc('0x16')][_0x24fc('0x18')]);return _0x24998d(_0x9a1673[_0x24fc('0x16')]['message']);}logger[_0x24fc('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x1819a5,_0x9a1673[_0x24fc('0x16')][_0x24fc('0x18')]);return _0x133438(_0x9a1673[_0x24fc('0x16')][_0x24fc('0x18')]);}else{logger[_0x24fc('0x19')]('OpenchannelAccount,\x20%s,\x20%s',_0x1819a5,_0x24fc('0x13'));_0x133438(_0x9a1673[_0x24fc('0x1a')][_0x24fc('0x18')]);}})[_0x24fc('0x1b')](function(_0x4c5a43){logger[_0x24fc('0x16')](_0x24fc('0x12'),_0x1819a5,_0x4c5a43);_0x24998d(_0x4c5a43);});});} \ No newline at end of file +var _0x9d9b=['./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x38ae00,_0x41c671){var _0x3515f9=function(_0x52683d){while(--_0x52683d){_0x38ae00['push'](_0x38ae00['shift']());}};_0x3515f9(++_0x41c671);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x4ac007,_0x3632ae){_0x4ac007=_0x4ac007-0x0;var _0x42e227=_0x9d9b[_0x4ac007];return _0x42e227;};'use strict';var _=require('lodash');var util=require(_0xb9d9('0x0'));var moment=require(_0xb9d9('0x1'));var BPromise=require('bluebird');var rs=require(_0xb9d9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9d9('0x3'))['db'];var utils=require(_0xb9d9('0x4'));var logger=require(_0xb9d9('0x5'))('rpc');var config=require(_0xb9d9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb9d9('0x7')][_0xb9d9('0x8')]({'port':0x232a});config['redis']=_[_0xb9d9('0x9')](config[_0xb9d9('0xa')],{'host':_0xb9d9('0xb'),'port':0x18eb});var socket=require(_0xb9d9('0xc'))(new Redis(config[_0xb9d9('0xa')]));require(_0xb9d9('0xd'))[_0xb9d9('0xe')](socket);function respondWithRpcPromise(_0x5a9c18,_0x5b591e,_0x5f14e7){return new BPromise(function(_0x4cde40,_0x45f507){return client[_0xb9d9('0xf')](_0x5a9c18,_0x5f14e7)[_0xb9d9('0x10')](function(_0x5e226e){logger[_0xb9d9('0x11')](_0xb9d9('0x12'),_0x5b591e,'request\x20sent');logger[_0xb9d9('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5b591e,_0xb9d9('0x14'),JSON[_0xb9d9('0x15')](_0x5e226e));if(_0x5e226e[_0xb9d9('0x16')]){if(_0x5e226e[_0xb9d9('0x16')][_0xb9d9('0x17')]===0x1f4){logger[_0xb9d9('0x16')](_0xb9d9('0x12'),_0x5b591e,_0x5e226e[_0xb9d9('0x16')]['message']);return _0x45f507(_0x5e226e['error'][_0xb9d9('0x18')]);}logger[_0xb9d9('0x16')](_0xb9d9('0x12'),_0x5b591e,_0x5e226e[_0xb9d9('0x16')]['message']);return _0x4cde40(_0x5e226e['error'][_0xb9d9('0x18')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x5b591e,_0xb9d9('0x14'));_0x4cde40(_0x5e226e[_0xb9d9('0x19')][_0xb9d9('0x18')]);}})['catch'](function(_0x473b89){logger[_0xb9d9('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x5b591e,_0x473b89);_0x45f507(_0x473b89);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 77dca97..c8c8908 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 _0x7868=['./openchannelAccount.events','remove','update','removeListener','register','length','openchannelAccount:'];(function(_0x1ba3f0,_0x3b220d){var _0x53064d=function(_0x4ac6e3){while(--_0x4ac6e3){_0x1ba3f0['push'](_0x1ba3f0['shift']());}};_0x53064d(++_0x3b220d);}(_0x7868,0x1c0));var _0x8786=function(_0x452c75,_0x344ebf){_0x452c75=_0x452c75-0x0;var _0x2ad4b1=_0x7868[_0x452c75];return _0x2ad4b1;};'use strict';var OpenchannelAccountEvents=require(_0x8786('0x0'));var events=['save',_0x8786('0x1'),_0x8786('0x2')];function createListener(_0x1e2eeb,_0x229022){return function(_0x46f3ad){_0x229022['emit'](_0x1e2eeb,_0x46f3ad);};}function removeListener(_0x45297f,_0x36369e){return function(){OpenchannelAccountEvents[_0x8786('0x3')](_0x45297f,_0x36369e);};}exports[_0x8786('0x4')]=function(_0x121ac4){for(var _0x2c786d=0x0,_0x251045=events[_0x8786('0x5')];_0x2c786d<_0x251045;_0x2c786d++){var _0xe4d300=events[_0x2c786d];var _0xe9a88d=createListener(_0x8786('0x6')+_0xe4d300,_0x121ac4);OpenchannelAccountEvents['on'](_0xe4d300,_0xe9a88d);}}; \ No newline at end of file +var _0x54ef=['remove','emit','removeListener','length','./openchannelAccount.events','save'];(function(_0x43a251,_0x2ca1b8){var _0x15f782=function(_0x8b1d41){while(--_0x8b1d41){_0x43a251['push'](_0x43a251['shift']());}};_0x15f782(++_0x2ca1b8);}(_0x54ef,0x112));var _0xf54e=function(_0x2d99b4,_0x317bf7){_0x2d99b4=_0x2d99b4-0x0;var _0x5d2904=_0x54ef[_0x2d99b4];return _0x5d2904;};'use strict';var OpenchannelAccountEvents=require(_0xf54e('0x0'));var events=[_0xf54e('0x1'),_0xf54e('0x2'),'update'];function createListener(_0xd936f7,_0x18b7d6){return function(_0x18b1cf){_0x18b7d6[_0xf54e('0x3')](_0xd936f7,_0x18b1cf);};}function removeListener(_0x8b6bb6,_0x431e36){return function(){OpenchannelAccountEvents[_0xf54e('0x4')](_0x8b6bb6,_0x431e36);};}exports['register']=function(_0x55e611){for(var _0x18e84e=0x0,_0x99cf9=events[_0xf54e('0x5')];_0x18e84e<_0x99cf9;_0x18e84e++){var _0x561870=events[_0x18e84e];var _0x27e69b=createListener('openchannelAccount:'+_0x561870,_0x55e611);OpenchannelAccountEvents['on'](_0x561870,_0x27e69b);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 6f670e1..7d2b5b7 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 _0x4e7b=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x10de89,_0xca9127){var _0xf94743=function(_0x3ff30f){while(--_0x3ff30f){_0x10de89['push'](_0x10de89['shift']());}};_0xf94743(++_0xca9127);}(_0x4e7b,0xea));var _0xb4e7=function(_0x456937,_0x32bc53){_0x456937=_0x456937-0x0;var _0x4d7636=_0x4e7b[_0x456937];return _0x4d7636;};'use strict';var multer=require('multer');var util=require(_0xb4e7('0x0'));var path=require(_0xb4e7('0x1'));var timeout=require('connect-timeout');var express=require(_0xb4e7('0x2'));var router=express['Router']();var fs_extra=require(_0xb4e7('0x3'));var auth=require(_0xb4e7('0x4'));var interaction=require(_0xb4e7('0x5'));var config=require(_0xb4e7('0x6'));var controller=require('./openchannelApplication.controller');router[_0xb4e7('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb4e7('0x7')](_0xb4e7('0x8'),auth[_0xb4e7('0x9')](),controller[_0xb4e7('0xa')]);router[_0xb4e7('0xb')]('/',auth[_0xb4e7('0x9')](),controller[_0xb4e7('0xc')]);router[_0xb4e7('0xd')](_0xb4e7('0x8'),auth[_0xb4e7('0x9')](),controller[_0xb4e7('0xe')]);router[_0xb4e7('0xf')](_0xb4e7('0x8'),auth['isAuthenticated'](),controller[_0xb4e7('0x10')]);module[_0xb4e7('0x11')]=router; \ No newline at end of file +var _0x612e=['create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','index','isAuthenticated','post'];(function(_0x37612b,_0x7338a8){var _0x1ee7e7=function(_0x2ff0b5){while(--_0x2ff0b5){_0x37612b['push'](_0x37612b['shift']());}};_0x1ee7e7(++_0x7338a8);}(_0x612e,0xef));var _0xe612=function(_0x5433d8,_0x210448){_0x5433d8=_0x5433d8-0x0;var _0x99ee3c=_0x612e[_0x5433d8];return _0x99ee3c;};'use strict';var multer=require(_0xe612('0x0'));var util=require(_0xe612('0x1'));var path=require('path');var timeout=require(_0xe612('0x2'));var express=require(_0xe612('0x3'));var router=express[_0xe612('0x4')]();var fs_extra=require(_0xe612('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe612('0x6'));var config=require(_0xe612('0x7'));var controller=require(_0xe612('0x8'));router[_0xe612('0x9')]('/',auth['isAuthenticated'](),controller[_0xe612('0xa')]);router[_0xe612('0x9')]('/:id',auth[_0xe612('0xb')](),controller['show']);router[_0xe612('0xc')]('/',auth[_0xe612('0xb')](),controller[_0xe612('0xd')]);router[_0xe612('0xe')]('/:id',auth[_0xe612('0xb')](),controller[_0xe612('0xf')]);router[_0xe612('0x10')]('/:id',auth[_0xe612('0xb')](),controller[_0xe612('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index cbc629f..de83c80 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 _0xae1c=['noop','TEXT','sequelize','STRING'];(function(_0x294ef6,_0x26f9fb){var _0x2d6ba9=function(_0x2fad19){while(--_0x2fad19){_0x294ef6['push'](_0x294ef6['shift']());}};_0x2d6ba9(++_0x26f9fb);}(_0xae1c,0x106));var _0xcae1=function(_0x57baee,_0x597799){_0x57baee=_0x57baee-0x0;var _0xc536e=_0xae1c[_0x57baee];return _0xc536e;};'use strict';var Sequelize=require(_0xcae1('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xcae1('0x1')],'allowNull':![],'defaultValue':_0xcae1('0x2')},'appdata':{'type':Sequelize[_0xcae1('0x3')]()},'description':{'type':Sequelize[_0xcae1('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xa8c0=['*,*,*,*','sequelize','exports','INTEGER','TEXT','STRING'];(function(_0x476dc4,_0x3817cd){var _0x121014=function(_0x3597a0){while(--_0x3597a0){_0x476dc4['push'](_0x476dc4['shift']());}};_0x121014(++_0x3817cd);}(_0xa8c0,0xc7));var _0x0a8c=function(_0x3f2d02,_0x2c7deb){_0x3f2d02=_0x3f2d02-0x0;var _0x54092b=_0xa8c0[_0x3f2d02];return _0x54092b;};'use strict';var Sequelize=require(_0x0a8c('0x0'));module[_0x0a8c('0x1')]={'priority':{'type':Sequelize[_0x0a8c('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0a8c('0x3')]()},'description':{'type':Sequelize[_0x0a8c('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x0a8c('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index e0f32dc..1ff44a4 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 _0x63e6=['send','OpenchannelApplication','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','merge','map','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','find','catch','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','error','stack','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63e6,0x6a));var _0x663e=function(_0x4ee73d,_0x2ac6a5){_0x4ee73d=_0x4ee73d-0x0;var _0x556b7a=_0x63e6[_0x4ee73d];return _0x556b7a;};'use strict';var emlformat=require(_0x663e('0x0'));var rimraf=require(_0x663e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x663e('0x2'));var rp=require(_0x663e('0x3'));var moment=require(_0x663e('0x4'));var BPromise=require(_0x663e('0x5'));var Mustache=require(_0x663e('0x6'));var util=require(_0x663e('0x7'));var path=require(_0x663e('0x8'));var sox=require(_0x663e('0x9'));var csv=require(_0x663e('0xa'));var ejs=require(_0x663e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x663e('0xc'));var squel=require(_0x663e('0xd'));var crypto=require('crypto');var jsforce=require(_0x663e('0xe'));var deskjs=require(_0x663e('0xf'));var toCsv=require(_0x663e('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x663e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x663e('0x11'));var as=require(_0x663e('0x12'));var hardwareService=require(_0x663e('0x13'));var logger=require(_0x663e('0x14'))(_0x663e('0x15'));var utils=require(_0x663e('0x16'));var config=require(_0x663e('0x17'));var licenseUtil=require(_0x663e('0x18'));var db=require(_0x663e('0x19'))['db'];function respondWithStatusCode(_0x49b4af,_0x417c98){_0x417c98=_0x417c98||0xcc;return function(_0x97670b){if(_0x97670b){return _0x49b4af[_0x663e('0x1a')](_0x417c98);}return _0x49b4af[_0x663e('0x1b')](_0x417c98)['end']();};}function respondWithResult(_0x32c40d,_0x173e94){_0x173e94=_0x173e94||0xc8;return function(_0x4f7d4b){if(_0x4f7d4b){return _0x32c40d[_0x663e('0x1b')](_0x173e94)[_0x663e('0x1c')](_0x4f7d4b);}};}function respondWithFilteredResult(_0x2e18f6,_0x17b670){return function(_0x36df72){if(_0x36df72){var _0x4ec4a8=typeof _0x17b670[_0x663e('0x1d')]==='undefined'&&typeof _0x17b670[_0x663e('0x1e')]===_0x663e('0x1f');var _0x1996ff=_0x36df72[_0x663e('0x20')];var _0x6c9d83=_0x4ec4a8?0x0:_0x17b670['offset'];var _0x25e037=_0x4ec4a8?_0x36df72[_0x663e('0x20')]:_0x17b670[_0x663e('0x1d')]+_0x17b670['limit'];var _0x3d1b71;if(_0x25e037>=_0x1996ff){_0x25e037=_0x1996ff;_0x3d1b71=0xc8;}else{_0x3d1b71=0xce;}_0x2e18f6['status'](_0x3d1b71);return _0x2e18f6[_0x663e('0x21')](_0x663e('0x22'),_0x6c9d83+'-'+_0x25e037+'/'+_0x1996ff)['json'](_0x36df72);}return null;};}function patchUpdates(_0x54f49a){return function(_0x1138b1){try{jsonpatch[_0x663e('0x23')](_0x1138b1,_0x54f49a,!![]);}catch(_0xde0499){return BPromise[_0x663e('0x24')](_0xde0499);}return _0x1138b1['save']();};}function saveUpdates(_0x198b94,_0x19d0cb){return function(_0x44c9a9){if(_0x44c9a9){return _0x44c9a9['update'](_0x198b94)[_0x663e('0x25')](function(_0x313b90){return _0x313b90;});}return null;};}function removeEntity(_0x2566f9,_0x50b936){return function(_0xecc457){if(_0xecc457){return _0xecc457[_0x663e('0x26')]()[_0x663e('0x25')](function(){_0x2566f9[_0x663e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e3303,_0x1957ba){return function(_0x5f03cc){if(!_0x5f03cc){_0x2e3303[_0x663e('0x1a')](0x194);}return _0x5f03cc;};}function handleError(_0x1c72f3,_0x205c58){_0x205c58=_0x205c58||0x1f4;return function(_0x397f97){logger[_0x663e('0x27')](_0x397f97[_0x663e('0x28')]);if(_0x397f97[_0x663e('0x29')]){delete _0x397f97[_0x663e('0x29')];}_0x1c72f3[_0x663e('0x1b')](_0x205c58)[_0x663e('0x2a')](_0x397f97);};}exports['index']=function(_0x4dcddf,_0x428a79){var _0x23e7d5={},_0x30357c={},_0x2c22de={'count':0x0,'rows':[]};var _0x1c9c26=_['map'](db[_0x663e('0x2b')][_0x663e('0x2c')],function(_0x7d1da6){return{'name':_0x7d1da6[_0x663e('0x2d')],'type':_0x7d1da6[_0x663e('0x2e')][_0x663e('0x2f')]};});_0x30357c['model']=_['map'](_0x1c9c26,'name');_0x30357c['query']=_[_0x663e('0x30')](_0x4dcddf[_0x663e('0x31')]);_0x30357c[_0x663e('0x32')]=_[_0x663e('0x33')](_0x30357c[_0x663e('0x34')],_0x30357c[_0x663e('0x31')]);_0x23e7d5[_0x663e('0x35')]=_[_0x663e('0x33')](_0x30357c['model'],qs['fields'](_0x4dcddf[_0x663e('0x31')][_0x663e('0x36')]));_0x23e7d5[_0x663e('0x35')]=_0x23e7d5[_0x663e('0x35')]['length']?_0x23e7d5['attributes']:_0x30357c[_0x663e('0x34')];if(!_0x4dcddf[_0x663e('0x31')]['hasOwnProperty'](_0x663e('0x37'))){_0x23e7d5['limit']=qs['limit'](_0x4dcddf['query']['limit']);_0x23e7d5[_0x663e('0x1d')]=qs[_0x663e('0x1d')](_0x4dcddf[_0x663e('0x31')][_0x663e('0x1d')]);}_0x23e7d5[_0x663e('0x38')]=qs[_0x663e('0x39')](_0x4dcddf['query'][_0x663e('0x39')]);_0x23e7d5[_0x663e('0x3a')]=qs[_0x663e('0x32')](_['pick'](_0x4dcddf[_0x663e('0x31')],_0x30357c[_0x663e('0x32')]),_0x1c9c26);if(_0x4dcddf[_0x663e('0x31')]['filter']){_0x23e7d5[_0x663e('0x3a')]=_[_0x663e('0x3b')](_0x23e7d5[_0x663e('0x3a')],{'$or':_[_0x663e('0x3c')](_0x1c9c26,function(_0x511371){if(_0x511371[_0x663e('0x2e')]!==_0x663e('0x3d')){var _0x52510e={};_0x52510e[_0x511371['name']]={'$like':'%'+_0x4dcddf[_0x663e('0x31')]['filter']+'%'};return _0x52510e;}})});}_0x23e7d5=_[_0x663e('0x3b')]({},_0x23e7d5,_0x4dcddf[_0x663e('0x3e')]);var _0x13e877={'where':_0x23e7d5['where']};return db[_0x663e('0x2b')]['count'](_0x13e877)['then'](function(_0x687e5){_0x2c22de[_0x663e('0x20')]=_0x687e5;if(_0x4dcddf[_0x663e('0x31')][_0x663e('0x3f')]){_0x23e7d5['include']=[{'all':!![]}];}return db[_0x663e('0x2b')][_0x663e('0x40')](_0x23e7d5);})[_0x663e('0x25')](function(_0x36d054){_0x2c22de[_0x663e('0x41')]=_0x36d054;return _0x2c22de;})[_0x663e('0x25')](respondWithFilteredResult(_0x428a79,_0x23e7d5))['catch'](handleError(_0x428a79,null));};exports[_0x663e('0x42')]=function(_0x2b6024,_0xc9b749){var _0x3e800e={'raw':!![],'where':{'id':_0x2b6024[_0x663e('0x43')]['id']}},_0x4cfda7={};_0x4cfda7[_0x663e('0x34')]=_[_0x663e('0x30')](db[_0x663e('0x2b')]['rawAttributes']);_0x4cfda7[_0x663e('0x31')]=_[_0x663e('0x30')](_0x2b6024[_0x663e('0x31')]);_0x4cfda7['filters']=_['intersection'](_0x4cfda7[_0x663e('0x34')],_0x4cfda7[_0x663e('0x31')]);_0x3e800e[_0x663e('0x35')]=_[_0x663e('0x33')](_0x4cfda7['model'],qs['fields'](_0x2b6024[_0x663e('0x31')][_0x663e('0x36')]));_0x3e800e['attributes']=_0x3e800e['attributes'][_0x663e('0x44')]?_0x3e800e['attributes']:_0x4cfda7[_0x663e('0x34')];if(_0x2b6024[_0x663e('0x31')][_0x663e('0x3f')]){_0x3e800e[_0x663e('0x45')]=[{'all':!![]}];}_0x3e800e=_['merge']({},_0x3e800e,_0x2b6024[_0x663e('0x3e')]);return db[_0x663e('0x2b')][_0x663e('0x46')](_0x3e800e)[_0x663e('0x25')](handleEntityNotFound(_0xc9b749,null))['then'](respondWithResult(_0xc9b749,null))[_0x663e('0x47')](handleError(_0xc9b749,null));};exports['create']=function(_0x2eaab7,_0x101d47){return db[_0x663e('0x2b')]['create'](_0x2eaab7[_0x663e('0x48')],{})[_0x663e('0x25')](respondWithResult(_0x101d47,0xc9))[_0x663e('0x47')](handleError(_0x101d47,null));};exports[_0x663e('0x49')]=function(_0x160022,_0xbff524){if(_0x160022[_0x663e('0x48')]['id']){delete _0x160022['body']['id'];}return db[_0x663e('0x2b')][_0x663e('0x46')]({'where':{'id':_0x160022['params']['id']}})['then'](handleEntityNotFound(_0xbff524,null))['then'](saveUpdates(_0x160022[_0x663e('0x48')],null))[_0x663e('0x25')](respondWithResult(_0xbff524,null))[_0x663e('0x47')](handleError(_0xbff524,null));};exports[_0x663e('0x26')]=function(_0x164b7a,_0x2c962f){return db[_0x663e('0x2b')][_0x663e('0x46')]({'where':{'id':_0x164b7a[_0x663e('0x43')]['id']}})[_0x663e('0x25')](handleEntityNotFound(_0x2c962f,null))[_0x663e('0x25')](removeEntity(_0x2c962f,null))['catch'](handleError(_0x2c962f,null));}; \ No newline at end of file +var _0x27c4=['fields','hasOwnProperty','order','sort','where','pick','filters','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','json','apply','reject','then','destroy','end','error','stack','name','send','OpenchannelApplication','rawAttributes','type','key','model','keys','query','intersection','attributes'];(function(_0x2c0434,_0x499c6a){var _0x1dbb93=function(_0x16f362){while(--_0x16f362){_0x2c0434['push'](_0x2c0434['shift']());}};_0x1dbb93(++_0x499c6a);}(_0x27c4,0x1d8));var _0x427c=function(_0x5c0bd4,_0x4874fe){_0x5c0bd4=_0x5c0bd4-0x0;var _0x57a10d=_0x27c4[_0x5c0bd4];return _0x57a10d;};'use strict';var emlformat=require(_0x427c('0x0'));var rimraf=require(_0x427c('0x1'));var zipdir=require(_0x427c('0x2'));var jsonpatch=require(_0x427c('0x3'));var rp=require(_0x427c('0x4'));var moment=require(_0x427c('0x5'));var BPromise=require(_0x427c('0x6'));var Mustache=require(_0x427c('0x7'));var util=require(_0x427c('0x8'));var path=require(_0x427c('0x9'));var sox=require(_0x427c('0xa'));var csv=require('to-csv');var ejs=require(_0x427c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x427c('0xc'));var squel=require(_0x427c('0xd'));var crypto=require(_0x427c('0xe'));var jsforce=require(_0x427c('0xf'));var deskjs=require(_0x427c('0x10'));var toCsv=require(_0x427c('0x11'));var querystring=require(_0x427c('0x12'));var Papa=require('papaparse');var Redis=require(_0x427c('0x13'));var authService=require(_0x427c('0x14'));var qs=require(_0x427c('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x427c('0x16'));var logger=require(_0x427c('0x17'))(_0x427c('0x18'));var utils=require(_0x427c('0x19'));var config=require(_0x427c('0x1a'));var licenseUtil=require(_0x427c('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33b507,_0x34872d){_0x34872d=_0x34872d||0xcc;return function(_0x59f414){if(_0x59f414){return _0x33b507[_0x427c('0x1c')](_0x34872d);}return _0x33b507['status'](_0x34872d)['end']();};}function respondWithResult(_0x18930c,_0x367497){_0x367497=_0x367497||0xc8;return function(_0x4c9753){if(_0x4c9753){return _0x18930c[_0x427c('0x1d')](_0x367497)['json'](_0x4c9753);}};}function respondWithFilteredResult(_0x56e37f,_0x8846fe){return function(_0x3183cd){if(_0x3183cd){var _0x1c7e34=typeof _0x8846fe[_0x427c('0x1e')]===_0x427c('0x1f')&&typeof _0x8846fe[_0x427c('0x20')]===_0x427c('0x1f');var _0x5a6882=_0x3183cd[_0x427c('0x21')];var _0x43d13c=_0x1c7e34?0x0:_0x8846fe[_0x427c('0x1e')];var _0x1d2152=_0x1c7e34?_0x3183cd['count']:_0x8846fe[_0x427c('0x1e')]+_0x8846fe[_0x427c('0x20')];var _0x5f31bf;if(_0x1d2152>=_0x5a6882){_0x1d2152=_0x5a6882;_0x5f31bf=0xc8;}else{_0x5f31bf=0xce;}_0x56e37f['status'](_0x5f31bf);return _0x56e37f['set']('Content-Range',_0x43d13c+'-'+_0x1d2152+'/'+_0x5a6882)[_0x427c('0x22')](_0x3183cd);}return null;};}function patchUpdates(_0x618683){return function(_0xef0e4e){try{jsonpatch[_0x427c('0x23')](_0xef0e4e,_0x618683,!![]);}catch(_0x59d0b4){return BPromise[_0x427c('0x24')](_0x59d0b4);}return _0xef0e4e['save']();};}function saveUpdates(_0x29e255,_0x5ee15b){return function(_0x85cc5f){if(_0x85cc5f){return _0x85cc5f['update'](_0x29e255)[_0x427c('0x25')](function(_0x20ec89){return _0x20ec89;});}return null;};}function removeEntity(_0x5e9fdc,_0x5c5844){return function(_0x25c750){if(_0x25c750){return _0x25c750[_0x427c('0x26')]()[_0x427c('0x25')](function(){_0x5e9fdc[_0x427c('0x1d')](0xcc)[_0x427c('0x27')]();});}};}function handleEntityNotFound(_0x120434,_0x38c16e){return function(_0x774999){if(!_0x774999){_0x120434[_0x427c('0x1c')](0x194);}return _0x774999;};}function handleError(_0x1dfae6,_0x3c2c26){_0x3c2c26=_0x3c2c26||0x1f4;return function(_0x38755e){logger[_0x427c('0x28')](_0x38755e[_0x427c('0x29')]);if(_0x38755e[_0x427c('0x2a')]){delete _0x38755e[_0x427c('0x2a')];}_0x1dfae6[_0x427c('0x1d')](_0x3c2c26)[_0x427c('0x2b')](_0x38755e);};}exports['index']=function(_0x23bd13,_0x1eaaf5){var _0x583209={},_0x38fd89={},_0x31941b={'count':0x0,'rows':[]};var _0x21a747=_['map'](db[_0x427c('0x2c')][_0x427c('0x2d')],function(_0x33fe90){return{'name':_0x33fe90['fieldName'],'type':_0x33fe90[_0x427c('0x2e')][_0x427c('0x2f')]};});_0x38fd89[_0x427c('0x30')]=_['map'](_0x21a747,_0x427c('0x2a'));_0x38fd89['query']=_[_0x427c('0x31')](_0x23bd13[_0x427c('0x32')]);_0x38fd89['filters']=_[_0x427c('0x33')](_0x38fd89[_0x427c('0x30')],_0x38fd89[_0x427c('0x32')]);_0x583209[_0x427c('0x34')]=_['intersection'](_0x38fd89[_0x427c('0x30')],qs[_0x427c('0x35')](_0x23bd13[_0x427c('0x32')][_0x427c('0x35')]));_0x583209[_0x427c('0x34')]=_0x583209[_0x427c('0x34')]['length']?_0x583209[_0x427c('0x34')]:_0x38fd89[_0x427c('0x30')];if(!_0x23bd13[_0x427c('0x32')][_0x427c('0x36')]('nolimit')){_0x583209[_0x427c('0x20')]=qs[_0x427c('0x20')](_0x23bd13[_0x427c('0x32')][_0x427c('0x20')]);_0x583209[_0x427c('0x1e')]=qs[_0x427c('0x1e')](_0x23bd13[_0x427c('0x32')][_0x427c('0x1e')]);}_0x583209[_0x427c('0x37')]=qs[_0x427c('0x38')](_0x23bd13['query'][_0x427c('0x38')]);_0x583209[_0x427c('0x39')]=qs['filters'](_[_0x427c('0x3a')](_0x23bd13[_0x427c('0x32')],_0x38fd89[_0x427c('0x3b')]),_0x21a747);if(_0x23bd13[_0x427c('0x32')][_0x427c('0x3c')]){_0x583209[_0x427c('0x39')]=_[_0x427c('0x3d')](_0x583209['where'],{'$or':_[_0x427c('0x3e')](_0x21a747,function(_0x34376d){if(_0x34376d['type']!==_0x427c('0x3f')){var _0x219cb8={};_0x219cb8[_0x34376d[_0x427c('0x2a')]]={'$like':'%'+_0x23bd13[_0x427c('0x32')][_0x427c('0x3c')]+'%'};return _0x219cb8;}})});}_0x583209=_[_0x427c('0x3d')]({},_0x583209,_0x23bd13[_0x427c('0x40')]);var _0x4169c4={'where':_0x583209[_0x427c('0x39')]};return db[_0x427c('0x2c')][_0x427c('0x21')](_0x4169c4)[_0x427c('0x25')](function(_0x332e75){_0x31941b[_0x427c('0x21')]=_0x332e75;if(_0x23bd13['query'][_0x427c('0x41')]){_0x583209['include']=[{'all':!![]}];}return db[_0x427c('0x2c')][_0x427c('0x42')](_0x583209);})[_0x427c('0x25')](function(_0x4bc75e){_0x31941b[_0x427c('0x43')]=_0x4bc75e;return _0x31941b;})['then'](respondWithFilteredResult(_0x1eaaf5,_0x583209))[_0x427c('0x44')](handleError(_0x1eaaf5,null));};exports[_0x427c('0x45')]=function(_0x199f75,_0x45a75e){var _0x45e3b6={'raw':!![],'where':{'id':_0x199f75['params']['id']}},_0x55b88d={};_0x55b88d[_0x427c('0x30')]=_[_0x427c('0x31')](db[_0x427c('0x2c')]['rawAttributes']);_0x55b88d['query']=_[_0x427c('0x31')](_0x199f75['query']);_0x55b88d[_0x427c('0x3b')]=_[_0x427c('0x33')](_0x55b88d[_0x427c('0x30')],_0x55b88d[_0x427c('0x32')]);_0x45e3b6[_0x427c('0x34')]=_[_0x427c('0x33')](_0x55b88d[_0x427c('0x30')],qs[_0x427c('0x35')](_0x199f75['query'][_0x427c('0x35')]));_0x45e3b6['attributes']=_0x45e3b6['attributes']['length']?_0x45e3b6[_0x427c('0x34')]:_0x55b88d[_0x427c('0x30')];if(_0x199f75['query'][_0x427c('0x41')]){_0x45e3b6[_0x427c('0x46')]=[{'all':!![]}];}_0x45e3b6=_[_0x427c('0x3d')]({},_0x45e3b6,_0x199f75[_0x427c('0x40')]);return db[_0x427c('0x2c')][_0x427c('0x47')](_0x45e3b6)[_0x427c('0x25')](handleEntityNotFound(_0x45a75e,null))[_0x427c('0x25')](respondWithResult(_0x45a75e,null))[_0x427c('0x44')](handleError(_0x45a75e,null));};exports[_0x427c('0x48')]=function(_0x39168a,_0x2d297a){return db[_0x427c('0x2c')][_0x427c('0x48')](_0x39168a[_0x427c('0x49')],{})[_0x427c('0x25')](respondWithResult(_0x2d297a,0xc9))[_0x427c('0x44')](handleError(_0x2d297a,null));};exports['update']=function(_0xf34076,_0x2b0e6f){if(_0xf34076[_0x427c('0x49')]['id']){delete _0xf34076[_0x427c('0x49')]['id'];}return db[_0x427c('0x2c')][_0x427c('0x47')]({'where':{'id':_0xf34076[_0x427c('0x4a')]['id']}})[_0x427c('0x25')](handleEntityNotFound(_0x2b0e6f,null))[_0x427c('0x25')](saveUpdates(_0xf34076[_0x427c('0x49')],null))[_0x427c('0x25')](respondWithResult(_0x2b0e6f,null))[_0x427c('0x44')](handleError(_0x2b0e6f,null));};exports[_0x427c('0x26')]=function(_0x35c513,_0x10b4f1){return db['OpenchannelApplication'][_0x427c('0x47')]({'where':{'id':_0x35c513[_0x427c('0x4a')]['id']}})[_0x427c('0x25')](handleEntityNotFound(_0x10b4f1,null))[_0x427c('0x25')](removeEntity(_0x10b4f1,null))[_0x427c('0x44')](handleError(_0x10b4f1,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index c7cff98..7214fa6 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 _0xd128=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','exports'];(function(_0x59b45e,_0x946091){var _0x598628=function(_0x399119){while(--_0x399119){_0x59b45e['push'](_0x59b45e['shift']());}};_0x598628(++_0x946091);}(_0xd128,0x145));var _0x8d12=function(_0xeafbff,_0x1ba785){_0xeafbff=_0xeafbff-0x0;var _0x1d01f7=_0xd128[_0xeafbff];return _0x1d01f7;};'use strict';var _=require(_0x8d12('0x0'));var util=require(_0x8d12('0x1'));var logger=require(_0x8d12('0x2'))(_0x8d12('0x3'));var moment=require(_0x8d12('0x4'));var BPromise=require(_0x8d12('0x5'));var rp=require(_0x8d12('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d12('0x7'));var config=require(_0x8d12('0x8'));var attributes=require(_0x8d12('0x9'));module[_0x8d12('0xa')]=function(_0x4d306e,_0xec8f55){return _0x4d306e['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8d12('0xb')});}; \ No newline at end of file +var _0xbcdb=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4'];(function(_0x411900,_0x113b42){var _0x373570=function(_0x279da9){while(--_0x279da9){_0x411900['push'](_0x411900['shift']());}};_0x373570(++_0x113b42);}(_0xbcdb,0xfd));var _0xbbcd=function(_0x1ffaa9,_0x240f2a){_0x1ffaa9=_0x1ffaa9-0x0;var _0xad69e9=_0xbcdb[_0x1ffaa9];return _0xad69e9;};'use strict';var _=require(_0xbbcd('0x0'));var util=require(_0xbbcd('0x1'));var logger=require(_0xbbcd('0x2'))('api');var moment=require(_0xbbcd('0x3'));var BPromise=require('bluebird');var rp=require(_0xbbcd('0x4'));var fs=require('fs');var path=require(_0xbbcd('0x5'));var rimraf=require(_0xbbcd('0x6'));var config=require(_0xbbcd('0x7'));var attributes=require(_0xbbcd('0x8'));module['exports']=function(_0x149590,_0xae4950){return _0x149590[_0xbbcd('0x9')](_0xbbcd('0xa'),attributes,{'tableName':_0xbbcd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbbcd('0xc'),'collate':_0xbbcd('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index ff77de8..fb9f2df 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 _0xb76a=['jayson/promise','client','request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','OpenchannelApplication','update','body','options','raw','where','attributes','UpdateOpenchannelApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x12c50f,_0x29be50){var _0x36dc8e=function(_0x283fad){while(--_0x283fad){_0x12c50f['push'](_0x12c50f['shift']());}};_0x36dc8e(++_0x29be50);}(_0xb76a,0x16c));var _0xab76=function(_0x387da9,_0x1dcddc){_0x387da9=_0x387da9-0x0;var _0x3097dc=_0xb76a[_0x387da9];return _0x3097dc;};'use strict';var _=require(_0xab76('0x0'));var util=require(_0xab76('0x1'));var moment=require(_0xab76('0x2'));var BPromise=require('bluebird');var rs=require(_0xab76('0x3'));var fs=require('fs');var Redis=require(_0xab76('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xab76('0x5'));var logger=require('../../config/logger')(_0xab76('0x6'));var config=require(_0xab76('0x7'));var jayson=require(_0xab76('0x8'));var client=jayson[_0xab76('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37e8f0,_0x468160,_0x5b02df){return new BPromise(function(_0x2fc0e2,_0x4635c5){return client[_0xab76('0xa')](_0x37e8f0,_0x5b02df)[_0xab76('0xb')](function(_0x5bef76){logger[_0xab76('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x468160,_0xab76('0xd'));logger[_0xab76('0xe')](_0xab76('0xf'),_0x468160,_0xab76('0xd'),JSON[_0xab76('0x10')](_0x5bef76));if(_0x5bef76[_0xab76('0x11')]){if(_0x5bef76['error'][_0xab76('0x12')]===0x1f4){logger[_0xab76('0x11')](_0xab76('0x13'),_0x468160,_0x5bef76[_0xab76('0x11')]['message']);return _0x4635c5(_0x5bef76[_0xab76('0x11')]['message']);}logger[_0xab76('0x11')](_0xab76('0x13'),_0x468160,_0x5bef76['error']['message']);return _0x2fc0e2(_0x5bef76[_0xab76('0x11')][_0xab76('0x14')]);}else{logger[_0xab76('0xc')](_0xab76('0x13'),_0x468160,_0xab76('0xd'));_0x2fc0e2(_0x5bef76[_0xab76('0x15')][_0xab76('0x14')]);}})[_0xab76('0x16')](function(_0xc9639b){logger[_0xab76('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x468160,_0xc9639b);_0x4635c5(_0xc9639b);});});}exports['UpdateOpenchannelApplication']=function(_0x395293){var _0x3a961b=this;return new Promise(function(_0x5d5756,_0x49c02b){return db[_0xab76('0x17')][_0xab76('0x18')](_0x395293[_0xab76('0x19')],{'raw':_0x395293['options']?_0x395293[_0xab76('0x1a')][_0xab76('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x395293['options']?_0x395293[_0xab76('0x1a')][_0xab76('0x1c')]||null:null,'attributes':_0x395293['options']?_0x395293['options'][_0xab76('0x1d')]||null:null,'limit':_0x395293[_0xab76('0x1a')]?_0x395293[_0xab76('0x1a')]['limit']||null:null})[_0xab76('0xb')](function(_0x4e75a9){logger[_0xab76('0xc')](_0xab76('0x1e'),_0x395293);logger[_0xab76('0xe')](_0xab76('0x1e'),_0x395293,JSON[_0xab76('0x10')](_0x4e75a9));_0x5d5756(_0x4e75a9);})[_0xab76('0x16')](function(_0x3f4ecd){logger[_0xab76('0x11')](_0xab76('0x1e'),_0x3f4ecd['message'],_0x395293);_0x49c02b(_0x3a961b[_0xab76('0x11')](0x1f4,_0x3f4ecd[_0xab76('0x14')]));});});}; \ No newline at end of file +var _0x395e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','attributes','then','debug','util','moment','randomstring'];(function(_0x1aa6cc,_0x3f85cc){var _0x3c700c=function(_0x9baa6){while(--_0x9baa6){_0x1aa6cc['push'](_0x1aa6cc['shift']());}};_0x3c700c(++_0x3f85cc);}(_0x395e,0x169));var _0xe395=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x395e[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0xe395('0x0'));var moment=require(_0xe395('0x1'));var BPromise=require('bluebird');var rs=require(_0xe395('0x2'));var fs=require('fs');var Redis=require(_0xe395('0x3'));var db=require(_0xe395('0x4'))['db'];var utils=require(_0xe395('0x5'));var logger=require(_0xe395('0x6'))('rpc');var config=require(_0xe395('0x7'));var jayson=require(_0xe395('0x8'));var client=jayson[_0xe395('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x126304,_0x3ff7b6,_0x280b0d){return new BPromise(function(_0x592ca9,_0x3bc9bb){return client[_0xe395('0xa')](_0x126304,_0x280b0d)['then'](function(_0x5d86f5){logger['info'](_0xe395('0xb'),_0x3ff7b6,'request\x20sent');logger['debug'](_0xe395('0xc'),_0x3ff7b6,_0xe395('0xd'),JSON['stringify'](_0x5d86f5));if(_0x5d86f5[_0xe395('0xe')]){if(_0x5d86f5[_0xe395('0xe')][_0xe395('0xf')]===0x1f4){logger[_0xe395('0xe')](_0xe395('0xb'),_0x3ff7b6,_0x5d86f5[_0xe395('0xe')][_0xe395('0x10')]);return _0x3bc9bb(_0x5d86f5[_0xe395('0xe')][_0xe395('0x10')]);}logger[_0xe395('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x3ff7b6,_0x5d86f5[_0xe395('0xe')]['message']);return _0x592ca9(_0x5d86f5[_0xe395('0xe')][_0xe395('0x10')]);}else{logger[_0xe395('0x11')](_0xe395('0xb'),_0x3ff7b6,'request\x20sent');_0x592ca9(_0x5d86f5[_0xe395('0x12')][_0xe395('0x10')]);}})[_0xe395('0x13')](function(_0x5ae26a){logger[_0xe395('0xe')](_0xe395('0xb'),_0x3ff7b6,_0x5ae26a);_0x3bc9bb(_0x5ae26a);});});}exports[_0xe395('0x14')]=function(_0x2b0361){var _0x5e4946=this;return new Promise(function(_0x500bb3,_0x5b4094){return db[_0xe395('0x15')][_0xe395('0x16')](_0x2b0361[_0xe395('0x17')],{'raw':_0x2b0361[_0xe395('0x18')]?_0x2b0361['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b0361[_0xe395('0x18')]?_0x2b0361[_0xe395('0x18')]['where']||null:null,'attributes':_0x2b0361[_0xe395('0x18')]?_0x2b0361['options'][_0xe395('0x19')]||null:null,'limit':_0x2b0361[_0xe395('0x18')]?_0x2b0361[_0xe395('0x18')]['limit']||null:null})[_0xe395('0x1a')](function(_0x35292e){logger['info'](_0xe395('0x14'),_0x2b0361);logger[_0xe395('0x1b')]('UpdateOpenchannelApplication',_0x2b0361,JSON['stringify'](_0x35292e));_0x500bb3(_0x35292e);})['catch'](function(_0x82f8c4){logger[_0xe395('0xe')](_0xe395('0x14'),_0x82f8c4['message'],_0x2b0361);_0x5b4094(_0x5e4946[_0xe395('0xe')](0x1f4,_0x82f8c4['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 809566a..6f8da54 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 _0xb54e=['path','connect-timeout','express','Router','../../components/auth/service','./openchannelInteraction.controller','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','get','post','create','addMessage','openchannelinteraction:addtags','addTags','tracked','openchannel','openchannelinteraction:destroy','destroy','/:id/tags','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb54e,0x85));var _0xeb54=function(_0x137bda,_0x2b4b52){_0x137bda=_0x137bda-0x0;var _0x3258d6=_0xb54e[_0x137bda];return _0x3258d6;};'use strict';var multer=require(_0xeb54('0x0'));var util=require(_0xeb54('0x1'));var path=require(_0xeb54('0x2'));var timeout=require(_0xeb54('0x3'));var express=require(_0xeb54('0x4'));var router=express[_0xeb54('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xeb54('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeb54('0x7'));router['get']('/',auth[_0xeb54('0x8')](),controller[_0xeb54('0x9')]);router['get'](_0xeb54('0xa'),auth['isAuthenticated'](),controller[_0xeb54('0xb')]);router['get'](_0xeb54('0xc'),auth[_0xeb54('0x8')](),controller[_0xeb54('0xd')]);router['get'](_0xeb54('0xe'),auth[_0xeb54('0x8')](),controller['getMessages']);router[_0xeb54('0xf')]('/:id/download',auth[_0xeb54('0x8')](),controller['download']);router[_0xeb54('0x10')]('/',auth[_0xeb54('0x8')](),controller[_0xeb54('0x11')]);router['post']('/:id/messages',auth[_0xeb54('0x8')](),controller[_0xeb54('0x12')]);router[_0xeb54('0x10')]('/:id/tags',auth[_0xeb54('0x8')](),interaction['tracked']('openchannel',_0xeb54('0x13')),controller[_0xeb54('0x14')]);router['put']('/:id',auth[_0xeb54('0x8')](),interaction[_0xeb54('0x15')]('openchannel','openchannelinteraction:update'),controller['update']);router['delete'](_0xeb54('0xc'),auth[_0xeb54('0x8')](),interaction[_0xeb54('0x15')](_0xeb54('0x16'),_0xeb54('0x17')),controller[_0xeb54('0x18')]);router['delete'](_0xeb54('0x19'),auth[_0xeb54('0x8')](),controller['removeTags']);module[_0xeb54('0x1a')]=router; \ No newline at end of file +var _0x90b6=['post','create','addMessage','/:id/tags','openchannelinteraction:addtags','addTags','tracked','openchannel','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','/:id/download'];(function(_0x2215c8,_0x32ea49){var _0x2d8d10=function(_0x43629a){while(--_0x43629a){_0x2215c8['push'](_0x2215c8['shift']());}};_0x2d8d10(++_0x32ea49);}(_0x90b6,0x1a2));var _0x690b=function(_0xace742,_0x109afb){_0xace742=_0xace742-0x0;var _0x50aa30=_0x90b6[_0xace742];return _0x50aa30;};'use strict';var multer=require(_0x690b('0x0'));var util=require(_0x690b('0x1'));var path=require(_0x690b('0x2'));var timeout=require(_0x690b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x690b('0x4'));var auth=require(_0x690b('0x5'));var interaction=require(_0x690b('0x6'));var config=require(_0x690b('0x7'));var controller=require(_0x690b('0x8'));router[_0x690b('0x9')]('/',auth[_0x690b('0xa')](),controller[_0x690b('0xb')]);router[_0x690b('0x9')](_0x690b('0xc'),auth['isAuthenticated'](),controller[_0x690b('0xd')]);router[_0x690b('0x9')](_0x690b('0xe'),auth[_0x690b('0xa')](),controller['show']);router[_0x690b('0x9')](_0x690b('0xf'),auth[_0x690b('0xa')](),controller['getMessages']);router[_0x690b('0x9')](_0x690b('0x10'),auth['isAuthenticated'](),controller['download']);router[_0x690b('0x11')]('/',auth['isAuthenticated'](),controller[_0x690b('0x12')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x690b('0x13')]);router[_0x690b('0x11')](_0x690b('0x14'),auth[_0x690b('0xa')](),interaction['tracked']('openchannel',_0x690b('0x15')),controller[_0x690b('0x16')]);router['put'](_0x690b('0xe'),auth[_0x690b('0xa')](),interaction[_0x690b('0x17')](_0x690b('0x18'),_0x690b('0x19')),controller['update']);router[_0x690b('0x1a')](_0x690b('0xe'),auth['isAuthenticated'](),interaction[_0x690b('0x17')](_0x690b('0x18'),_0x690b('0x1b')),controller[_0x690b('0x1c')]);router['delete'](_0x690b('0x14'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 4b6a454..4029fe4 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 _0x6c32=['out','sequelize','BOOLEAN','STRING','DATE','ENUM'];(function(_0x23eb8b,_0x164728){var _0x1215dd=function(_0x1493f3){while(--_0x1493f3){_0x23eb8b['push'](_0x23eb8b['shift']());}};_0x1215dd(++_0x164728);}(_0x6c32,0xb5));var _0x26c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6c32[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x26c3('0x0'));module['exports']={'closed':{'type':Sequelize[_0x26c3('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x26c3('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x26c3('0x2')]},'note':{'type':Sequelize[_0x26c3('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x26c3('0x2')]},'lastMsgAt':{'type':Sequelize[_0x26c3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x26c3('0x4')]('in',_0x26c3('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x26c3('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x26c3('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x20d7=['STRING','out','BOOLEAN','DATE'];(function(_0x319bed,_0x14a43a){var _0x2dec8f=function(_0xd3d30){while(--_0xd3d30){_0x319bed['push'](_0x319bed['shift']());}};_0x2dec8f(++_0x14a43a);}(_0x20d7,0x146));var _0x720d=function(_0x5630ad,_0x5c0d6b){_0x5630ad=_0x5630ad-0x0;var _0x1176f4=_0x20d7[_0x5630ad];return _0x1176f4;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x720d('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x720d('0x1')]},'disposition':{'type':Sequelize[_0x720d('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x720d('0x1')]},'threadId':{'type':Sequelize[_0x720d('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x720d('0x3')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x720d('0x0')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 4c37f60..dcacd63 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 _0x59bd=['some','compact','isEmpty','OpenchannelAccountId','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','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','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','show','params','rawAttributes','includeAll','include','merge','options','catch','create','body','OpenchannelMessage','addMessage','ids','omit','findOne','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','findAll','emit','removeTags','unix','join','root','server','files','attachments','CmContact','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Owner','fullname','get','mkdirSync','Openchannel','Account','N.A.','closed','disposition','threadId','Public','basename','existsSync','createReadStream','out','System','firstName','lastName','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','download','log','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','Users','Tags','forEach','push','TagIds','index','map','OpenchannelInteraction','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','from','user_has_openchannel_interactions','left_join','users','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','unreadMessages','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','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','find','UserId','text','start'];(function(_0x5179a5,_0x419746){var _0x15c8ce=function(_0x1b13c4){while(--_0x1b13c4){_0x5179a5['push'](_0x5179a5['shift']());}};_0x15c8ce(++_0x419746);}(_0x59bd,0x79));var _0xd59b=function(_0x19c939,_0x3552d1){_0x19c939=_0x19c939-0x0;var _0x96d8ef=_0x59bd[_0x19c939];return _0x96d8ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd59b('0x0'));var zipdir=require(_0xd59b('0x1'));var jsonpatch=require(_0xd59b('0x2'));var rp=require(_0xd59b('0x3'));var moment=require(_0xd59b('0x4'));var BPromise=require(_0xd59b('0x5'));var Mustache=require(_0xd59b('0x6'));var util=require(_0xd59b('0x7'));var path=require(_0xd59b('0x8'));var sox=require(_0xd59b('0x9'));var csv=require(_0xd59b('0xa'));var ejs=require(_0xd59b('0xb'));var fs=require('fs');var fs_extra=require(_0xd59b('0xc'));var _=require(_0xd59b('0xd'));var squel=require('squel');var crypto=require(_0xd59b('0xe'));var jsforce=require(_0xd59b('0xf'));var deskjs=require(_0xd59b('0x10'));var toCsv=require(_0xd59b('0xa'));var querystring=require(_0xd59b('0x11'));var Papa=require(_0xd59b('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd59b('0x13'));var pdf=require(_0xd59b('0x14'));var hardwareService=require(_0xd59b('0x15'));var logger=require(_0xd59b('0x16'))(_0xd59b('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd59b('0x18'));var db=require(_0xd59b('0x19'))['db'];config[_0xd59b('0x1a')]=_['defaults'](config[_0xd59b('0x1a')],{'host':_0xd59b('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd59b('0x1a')]));require(_0xd59b('0x1c'))[_0xd59b('0x1d')](socket);function respondWithStatusCode(_0xc652f6,_0x1302b1){_0x1302b1=_0x1302b1||0xcc;return function(_0x3ecd73){if(_0x3ecd73){return _0xc652f6[_0xd59b('0x1e')](_0x1302b1);}return _0xc652f6[_0xd59b('0x1f')](_0x1302b1)[_0xd59b('0x20')]();};}function respondWithResult(_0x2983f9,_0xdfb0b4){_0xdfb0b4=_0xdfb0b4||0xc8;return function(_0x5b731e){if(_0x5b731e){return _0x2983f9[_0xd59b('0x1f')](_0xdfb0b4)[_0xd59b('0x21')](_0x5b731e);}};}function respondWithFilteredResult(_0x35e6c0,_0x41e015){return function(_0x5ae216){if(_0x5ae216){var _0x23d2ff=typeof _0x41e015[_0xd59b('0x22')]===_0xd59b('0x23')&&typeof _0x41e015[_0xd59b('0x24')]===_0xd59b('0x23');var _0x4e8880=_0x5ae216[_0xd59b('0x25')];var _0x17bd1c=_0x23d2ff?0x0:_0x41e015[_0xd59b('0x22')];var _0x351bbf=_0x23d2ff?_0x5ae216[_0xd59b('0x25')]:_0x41e015[_0xd59b('0x22')]+_0x41e015[_0xd59b('0x24')];var _0x51bfb2;if(_0x351bbf>=_0x4e8880){_0x351bbf=_0x4e8880;_0x51bfb2=0xc8;}else{_0x51bfb2=0xce;}_0x35e6c0[_0xd59b('0x1f')](_0x51bfb2);return _0x35e6c0[_0xd59b('0x26')](_0xd59b('0x27'),_0x17bd1c+'-'+_0x351bbf+'/'+_0x4e8880)[_0xd59b('0x21')](_0x5ae216);}return null;};}function patchUpdates(_0x454776){return function(_0x4b61ac){try{jsonpatch[_0xd59b('0x28')](_0x4b61ac,_0x454776,!![]);}catch(_0x1bad58){return BPromise[_0xd59b('0x29')](_0x1bad58);}return _0x4b61ac[_0xd59b('0x2a')]();};}function saveUpdates(_0x385dff,_0x57f5ee){return function(_0xb746cd){if(_0xb746cd){return _0xb746cd[_0xd59b('0x2b')](_0x385dff)['then'](function(_0x2eae61){return _0x2eae61;});}return null;};}function removeEntity(_0x18a790,_0x160c45){return function(_0x27932d){if(_0x27932d){return _0x27932d[_0xd59b('0x2c')]()[_0xd59b('0x2d')](function(){_0x18a790[_0xd59b('0x1f')](0xcc)[_0xd59b('0x20')]();});}};}function handleEntityNotFound(_0x59c93b,_0x57ca02){return function(_0x4263c8){if(!_0x4263c8){_0x59c93b['sendStatus'](0x194);}return _0x4263c8;};}function handleError(_0x2f5226,_0x170b79){_0x170b79=_0x170b79||0x1f4;return function(_0x302ba5){logger[_0xd59b('0x2e')](_0x302ba5[_0xd59b('0x2f')]);if(_0x302ba5[_0xd59b('0x30')]){delete _0x302ba5[_0xd59b('0x30')];}_0x2f5226[_0xd59b('0x1f')](_0x170b79)[_0xd59b('0x31')](_0x302ba5);};}function getInteractionUsers(_0x521384,_0x4eaaf8){return new BPromise(function(_0x1d62e0,_0x9a310f){try{if(_0x4eaaf8[_0x521384['id']]){_0x521384[_0xd59b('0x32')]=_['map'](_0x4eaaf8[_0x521384['id']],function(_0x2437ff){return{'id':_0x2437ff['id'],'fullname':_0x2437ff['fullname']};});}}catch(_0x1b7072){_0x9a310f(_0x1b7072);}_0x1d62e0(_0x521384);});}function getInteractionTags(_0x5088ce,_0x531bf0){return new BPromise(function(_0x174fdd,_0x5c1aec){try{if(_0x5088ce['TagIds']){_0x5088ce[_0xd59b('0x33')]=[];_0x5088ce['TagIds']['split'](',')[_0xd59b('0x34')](function(_0x2f0b5f){_0x5088ce[_0xd59b('0x33')][_0xd59b('0x35')](_0x531bf0[_0x2f0b5f]);});}delete _0x5088ce[_0xd59b('0x36')];}catch(_0x25a2f9){_0x5c1aec(_0x25a2f9);}_0x174fdd(_0x5088ce);});}function updateOpenchannelInteraction(_0x4e3f39,_0x2f6cea,_0x774348){return new BPromise(function(_0x47f10c,_0x164500){return getInteractionUsers(_0x4e3f39,_0x774348)['then'](function(_0x79ebf2){return getInteractionTags(_0x79ebf2,_0x2f6cea);})['then'](function(_0x284a25){_0x47f10c(_0x284a25);})['catch'](function(_0x5e8425){_0x164500(_0x5e8425);});});}exports[_0xd59b('0x37')]=function(_0x923070,_0x3f8864){var _0x11fec5={},_0x3dc5d5={},_0x1a2b8e={'count':0x0,'rows':[]};var _0x46beb5=_[_0xd59b('0x38')](db[_0xd59b('0x39')]['rawAttributes'],function(_0x925669){return{'name':_0x925669['fieldName'],'type':_0x925669['type'][_0xd59b('0x3a')]};});_0x3dc5d5[_0xd59b('0x3b')]=_[_0xd59b('0x38')](_0x46beb5,_0xd59b('0x30'));_0x3dc5d5[_0xd59b('0x3c')]=_[_0xd59b('0x3d')](_0x923070[_0xd59b('0x3c')]);_0x3dc5d5[_0xd59b('0x3e')]=_[_0xd59b('0x3f')](_0x3dc5d5[_0xd59b('0x3b')],_0x3dc5d5[_0xd59b('0x3c')]);_0x11fec5[_0xd59b('0x40')]=_[_0xd59b('0x3f')](_0x3dc5d5['model'],qs['fields'](_0x923070[_0xd59b('0x3c')][_0xd59b('0x41')]));_0x11fec5[_0xd59b('0x40')]=_0x11fec5[_0xd59b('0x40')][_0xd59b('0x42')]?_0x11fec5['attributes']:_0x3dc5d5[_0xd59b('0x3b')];if(!_0x923070[_0xd59b('0x3c')][_0xd59b('0x43')](_0xd59b('0x44'))){_0x11fec5['limit']=qs[_0xd59b('0x24')](_0x923070[_0xd59b('0x3c')][_0xd59b('0x24')]);_0x11fec5['offset']=qs['offset'](_0x923070['query']['offset']);}_0x11fec5[_0xd59b('0x45')]=qs[_0xd59b('0x46')](_0x923070[_0xd59b('0x3c')][_0xd59b('0x46')]);_0x11fec5[_0xd59b('0x47')]=qs[_0xd59b('0x3e')](_[_0xd59b('0x48')](_0x923070[_0xd59b('0x3c')],_0x3dc5d5[_0xd59b('0x3e')]),_0x46beb5);var _0x267ae5=[];var _0x15a22f=squel[_0xd59b('0x49')]()['field']('id')[_0xd59b('0x4a')](_0xd59b('0x30'))[_0xd59b('0x4a')](_0xd59b('0x4b'))['from'](_0xd59b('0x4c'));var _0x5a6842=squel[_0xd59b('0x49')]()[_0xd59b('0x4a')](_0xd59b('0x4d'))[_0xd59b('0x4a')](_0xd59b('0x4e'))[_0xd59b('0x4a')]('ui.OpenchannelInteractionId')[_0xd59b('0x4f')](_0xd59b('0x50'),'ui')[_0xd59b('0x51')](_0xd59b('0x52'),'u','u.id\x20=\x20ui.UserId');var _0x54aa4f=squel['select']()[_0xd59b('0x4f')](_0xd59b('0x53'),'i')['left_join']('cm_contacts','c',_0xd59b('0x54'))[_0xd59b('0x51')]('users','o','o.id\x20=\x20i.UserId')[_0xd59b('0x51')](_0xd59b('0x55'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0xd59b('0x51')](_0xd59b('0x56'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0xd59b('0x51')](_0xd59b('0x57'),'it',_0xd59b('0x58'))['left_join'](_0xd59b('0x4c'),'t',_0xd59b('0x59'));var _0x1fcb33=squel[_0xd59b('0x5a')]();var _0x4c06f6=[];var _0x5425f9=squel[_0xd59b('0x5a')]();var _0xa0d203;if(_0x923070[_0xd59b('0x3c')]['search']){_0xa0d203=as[_0xd59b('0x5b')](_0x923070['query'][_0xd59b('0x5c')]);var _0x7695a0=_0xa0d203[_0xd59b('0x5d')];for(var _0x3b9381=0x0;_0x3b9381<_0xa0d203[_0xd59b('0x5e')][_0xd59b('0x42')];_0x3b9381++){var _0x3c6a9e=_0xa0d203[_0xd59b('0x5e')][_0x3b9381];var _0xf25bbe='i';var _0x122a20=_['find'](_0x46beb5,[_0xd59b('0x30'),_0x3c6a9e['field']]);if(!_0x122a20){switch(_0x3c6a9e['field']){case _0xd59b('0x5f'):if(_0x3c6a9e[_0xd59b('0x60')]==0x1){_0x54aa4f[_0xd59b('0x61')]('`'+_0x3c6a9e['field']+_0xd59b('0x62'));}else{_0x54aa4f[_0xd59b('0x61')]('`'+_0x3c6a9e[_0xd59b('0x4a')]+'`\x20>\x200');}break;case _0xd59b('0x63'):if(_0x3c6a9e[_0xd59b('0x64')]===_0xd59b('0x65')){if(_0x3c6a9e[_0xd59b('0x60')]['split']('\x20')[_0xd59b('0x42')]>0x1){_0x1fcb33[_0x7695a0](_0xd59b('0x66'),qs[_0xd59b('0x67')](_0x3c6a9e[_0xd59b('0x60')]),null);}else{var _0x137900='%'+_0x3c6a9e[_0xd59b('0x60')]+'%';_0x1fcb33[_0x7695a0](_0xd59b('0x68'),_0x137900,_0x137900,_0x137900);}}else{_0x122a20=_['find'](_0x46beb5,[_0xd59b('0x30'),'ContactId']);_0x3c6a9e[_0xd59b('0x4a')]=_0xd59b('0x69');_0x22f18d=as[_0xd59b('0x6a')](_0xf25bbe,_0x122a20[_0xd59b('0x6b')],_0x3c6a9e);_0x1fcb33[_0x7695a0](_0x22f18d['text'],_0x22f18d[_0xd59b('0x60')]['start'],_0x22f18d['value'][_0xd59b('0x20')]);}break;case _0xd59b('0x6c'):var _0x59f358=_0x3c6a9e[_0xd59b('0x60')][_0xd59b('0x6d')](',')[_0xd59b('0x38')](function(_0xf8d829){return Number(_0xf8d829);});_0x59f358[_0xd59b('0x34')](function(_0x110492){_0x5425f9['or'](_0xd59b('0x6e'),'%,'+_0x110492+',%');});_0x4c06f6=_[_0xd59b('0x6f')](_0x4c06f6,_0x59f358);break;case _0xd59b('0x70'):if(_0x3c6a9e[_0xd59b('0x64')]===_0xd59b('0x65')){_0x1fcb33[_0x7695a0]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3c6a9e[_0xd59b('0x60')]+'%',null);}else{_0x122a20=_[_0xd59b('0x71')](_0x46beb5,[_0xd59b('0x30'),_0xd59b('0x72')]);_0x3c6a9e[_0xd59b('0x4a')]=_0xd59b('0x72');_0x22f18d=as[_0xd59b('0x6a')](_0xf25bbe,_0x122a20['type'],_0x3c6a9e);_0x1fcb33[_0x7695a0](_0x22f18d[_0xd59b('0x73')],_0x22f18d[_0xd59b('0x60')][_0xd59b('0x74')],_0x22f18d[_0xd59b('0x60')][_0xd59b('0x20')]);}break;case'body':_0x22f18d=as[_0xd59b('0x6a')]('me',null,_0x3c6a9e);_0x1fcb33[_0x7695a0](_0x22f18d[_0xd59b('0x73')],_0x22f18d['value'][_0xd59b('0x74')],_0x22f18d['value']['end']);break;}}else{var _0x22f18d=as['buildExpression'](_0xf25bbe,_0x122a20['type'],_0x3c6a9e);_0x1fcb33[_0x7695a0](_0x22f18d[_0xd59b('0x73')],_0x22f18d[_0xd59b('0x60')][_0xd59b('0x74')],_0x22f18d[_0xd59b('0x60')]['end']);}}}else{var _0x23909c=_(_0x923070[_0xd59b('0x3c')])[_0xd59b('0x3d')]()[_0xd59b('0x38')](function(_0x2a953c){return _[_0xd59b('0x75')](_0x46beb5,[_0xd59b('0x30'),_0x2a953c])?_0x2a953c:undefined;})[_0xd59b('0x76')]()['value']();if(!_[_0xd59b('0x77')](_0x23909c)){_0x23909c[_0xd59b('0x34')](function(_0x273ccb){if(_0x273ccb===_0xd59b('0x78')){_0x54aa4f[_0xd59b('0x47')]('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x923070[_0xd59b('0x3c')][_0x273ccb]));}else if(_0x273ccb==='createdAt'){var _0x1eeee1=JSON[_0xd59b('0x79')](_0x923070[_0xd59b('0x3c')][_0x273ccb])[_0xd59b('0x7a')];var _0x164041=JSON[_0xd59b('0x79')](_0x923070[_0xd59b('0x3c')][_0x273ccb])[_0xd59b('0x7b')];_0x54aa4f[_0xd59b('0x47')](_0xd59b('0x7c'),_0x1eeee1,_0x164041);}else{if(_0x923070[_0xd59b('0x3c')][_0x273ccb]===_0xd59b('0x7d')){_0x54aa4f['where']('i.'+_0x273ccb+_0xd59b('0x7e'));}else{_0x54aa4f[_0xd59b('0x47')]('i.'+_0x273ccb+_0xd59b('0x7f'),_0x923070[_0xd59b('0x3c')][_0x273ccb]);}}});}if(_0x923070[_0xd59b('0x3c')]['read']){if(_0x923070['query']['read']==0x1){_0x54aa4f['having'](_0xd59b('0x80'));}else{_0x54aa4f[_0xd59b('0x61')]('`unreadMessages`\x20>\x200');}}if(_0x923070[_0xd59b('0x3c')][_0xd59b('0x81')]){_0x4c06f6=_[_0xd59b('0x82')](_0x923070[_0xd59b('0x3c')]['tag'])?_0x923070[_0xd59b('0x3c')][_0xd59b('0x81')]:new Array(_0x923070['query'][_0xd59b('0x81')]);_0x4c06f6[_0xd59b('0x34')](function(_0x16d479){_0x5425f9['or'](_0xd59b('0x6e'),'%,'+_0x16d479+',%');});}if(_0x923070[_0xd59b('0x3c')][_0xd59b('0x83')]){var _0x3a7e6c=_0x923070[_0xd59b('0x3c')][_0xd59b('0x83')][_0xd59b('0x84')]('\x5c','\x5c\x5c')[_0xd59b('0x84')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3a7e6c)){_0x1fcb33['or'](_0xd59b('0x85'),_0x3a7e6c+'%');}else{_0x1fcb33['or'](_0xd59b('0x86'),qs[_0xd59b('0x67')](_0x3a7e6c))['or'](_0xd59b('0x87'),_0x3a7e6c+'%')['or'](_0xd59b('0x88'),_0x3a7e6c+'%');}}}_0x54aa4f[_0xd59b('0x47')](_0x1fcb33);_0x54aa4f[_0xd59b('0x89')](_0xd59b('0x8a'));var _0x4470f6={'type':db[_0xd59b('0x8b')][_0xd59b('0x8c')][_0xd59b('0x8d')],'raw':!![]};var _0xb350c9=_0x54aa4f['clone']();_0xb350c9[_0xd59b('0x4a')]('i.id');_0xb350c9[_0xd59b('0x4a')](_0xd59b('0x8e'),_0xd59b('0x5f'));if(_0x11fec5[_0xd59b('0x45')]){_0x11fec5[_0xd59b('0x45')][_0xd59b('0x34')](function(_0x3ed37b){var _0x562e0a=_0x3ed37b[0x0]===_0xd59b('0x8f')?_0x3ed37b[0x0]:'i.'+_0x3ed37b[0x0];_0x54aa4f[_0xd59b('0x45')](_0x562e0a,_0x3ed37b[0x1]===_0xd59b('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x4c06f6)){_0x54aa4f[_0xd59b('0x61')](_0x5425f9);_0xb350c9[_0xd59b('0x47')](_0xd59b('0x91'),_0x4c06f6);}BPromise[_0xd59b('0x92')]()[_0xd59b('0x2d')](function(){if(!_0xa0d203){if(_0x923070[_0xd59b('0x3c')][_0xd59b('0x78')])return;_0xb350c9[_0xd59b('0x47')](_0xd59b('0x93'));_0x54aa4f[_0xd59b('0x47')](_0xd59b('0x93'));return;}if(_0x923070[_0xd59b('0x94')][_0xd59b('0x95')]!==_0xd59b('0x96'))return;return _0x923070[_0xd59b('0x94')][_0xd59b('0x97')]({'attributes':['id'],'raw':!![]})['then'](function(_0x47d2f8){if(_[_0xd59b('0x77')](_0x47d2f8)){_0xb350c9[_0xd59b('0x47')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x54aa4f[_0xd59b('0x47')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0xb350c9[_0xd59b('0x47')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x47d2f8,'id'));_0x54aa4f[_0xd59b('0x47')](_0xd59b('0x98'),_[_0xd59b('0x38')](_0x47d2f8,'id'));}});})[_0xd59b('0x2d')](function(){if(_0x923070[_0xd59b('0x94')]['role']===_0xd59b('0x96')&&!_0xa0d203&&!_0x923070[_0xd59b('0x3c')][_0xd59b('0x78')])return[];return db[_0xd59b('0x99')][_0xd59b('0x3c')](_0xb350c9[_0xd59b('0x9a')](),_0x4470f6);})['then'](function(_0x2cc4c1){_0x1a2b8e[_0xd59b('0x25')]=_0x2cc4c1[_0xd59b('0x42')];if(_0x1a2b8e[_0xd59b('0x25')]===0x0)return[];return db[_0xd59b('0x99')][_0xd59b('0x3c')](_0x15a22f['toString'](),_0x4470f6)['then'](function(_0x3b7672){_0x267ae5=_[_0xd59b('0x9b')](_0x3b7672,'id');_0x4470f6=_['merge'](_0x4470f6,{'model':db[_0xd59b('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x923070[_0xd59b('0x3c')]['fields']){_0x11fec5[_0xd59b('0x40')][_0xd59b('0x34')](function(_0x3890d8){_0x54aa4f[_0xd59b('0x4a')]('i.'+_0x3890d8);});}else{_0x54aa4f[_0xd59b('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd59b('0x5f'));_0x54aa4f[_0xd59b('0x4a')]('a.key','Account.key');_0x54aa4f[_0xd59b('0x4a')](_0xd59b('0x9c'),_0xd59b('0x9d'));_0x54aa4f[_0xd59b('0x4a')]('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',_0xd59b('0x8f'));_0x54aa4f[_0xd59b('0x4a')](_0xd59b('0x9e'));_0x54aa4f[_0xd59b('0x4a')](_0xd59b('0x9f'),'Contact.firstName');_0x54aa4f[_0xd59b('0x4a')](_0xd59b('0xa0'),_0xd59b('0xa1'));_0x54aa4f[_0xd59b('0x4a')](_0xd59b('0xa2'),_0xd59b('0xa3'));_0x54aa4f[_0xd59b('0x4a')](_0xd59b('0xa4'),_0xd59b('0xa5'));_0x54aa4f[_0xd59b('0x4a')](_0xd59b('0xa6'),_0xd59b('0xa7'));_0x54aa4f[_0xd59b('0x4a')](_0xd59b('0xa8'),_0xd59b('0xa9'));_0x54aa4f['field'](_0xd59b('0xaa'),_0xd59b('0xab'));_0x54aa4f[_0xd59b('0x4a')](_0xd59b('0xac'),_0xd59b('0xad'));_0x54aa4f[_0xd59b('0x4a')](_0xd59b('0xae'),_0xd59b('0x36'));}if(_0x11fec5[_0xd59b('0x24')])_0x54aa4f[_0xd59b('0x24')](_0x11fec5['limit']);if(_0x11fec5[_0xd59b('0x22')])_0x54aa4f['offset'](_0x11fec5[_0xd59b('0x22')]);return db[_0xd59b('0x99')][_0xd59b('0x3c')](_0x54aa4f[_0xd59b('0x9a')](),_0x4470f6);})[_0xd59b('0x2d')](function(_0x2383cb){if(_0x2383cb[_0xd59b('0x42')]>0x0)_0x5a6842['where'](_0xd59b('0xaf'),_[_0xd59b('0x38')](_0x2383cb,'id'));return db[_0xd59b('0x99')]['query'](_0x5a6842['toString'](),_0x4470f6)[_0xd59b('0x2d')](function(_0x1a607e){var _0x1e3933=_[_0xd59b('0xb0')](_0x1a607e,_0xd59b('0xb1'));var _0x45c90c=[];_0x2383cb['forEach'](function(_0x51c6c0){_0x45c90c[_0xd59b('0x35')](updateOpenchannelInteraction(_0x51c6c0,_0x267ae5,_0x1e3933));});return BPromise['all'](_0x45c90c);});});})[_0xd59b('0x2d')](function(_0x55223b){_0x1a2b8e['rows']=_0x55223b;return _0x1a2b8e;})[_0xd59b('0x2d')](respondWithFilteredResult(_0x3f8864,_0x11fec5))['catch'](handleError(_0x3f8864,null));};exports[_0xd59b('0xb2')]=function(_0x3aa3f0,_0x4a12ca){var _0x3e5006={};if(_0x3aa3f0['query'][_0xd59b('0x6b')]&&_0x3aa3f0['query'][_0xd59b('0x6b')]==='from'){_0x3e5006['from']=_0x3aa3f0[_0xd59b('0xb3')]['id'];}else{_0x3e5006['id']=_0x3aa3f0['params']['id'];}var _0x16f7a4={'raw':![],'where':_0x3e5006},_0x3b8280={};_0x3b8280['model']=_[_0xd59b('0x3d')](db[_0xd59b('0x39')][_0xd59b('0xb4')]);_0x3b8280[_0xd59b('0x3c')]=_[_0xd59b('0x3d')](_0x3aa3f0[_0xd59b('0x3c')]);_0x3b8280[_0xd59b('0x3e')]=_[_0xd59b('0x3f')](_0x3b8280[_0xd59b('0x3b')],_0x3b8280[_0xd59b('0x3c')]);_0x16f7a4[_0xd59b('0x40')]=_[_0xd59b('0x3f')](_0x3b8280['model'],qs[_0xd59b('0x41')](_0x3aa3f0[_0xd59b('0x3c')][_0xd59b('0x41')]));_0x16f7a4[_0xd59b('0x40')]=_0x16f7a4[_0xd59b('0x40')][_0xd59b('0x42')]?_0x16f7a4['attributes']:_0x3b8280['model'];if(_0x3aa3f0[_0xd59b('0x3c')][_0xd59b('0xb5')]){_0x16f7a4[_0xd59b('0xb6')]=[{'all':!![]}];}_0x16f7a4=_[_0xd59b('0xb7')]({},_0x16f7a4,_0x3aa3f0[_0xd59b('0xb8')]);return db[_0xd59b('0x39')][_0xd59b('0x71')](_0x16f7a4)['then'](handleEntityNotFound(_0x4a12ca,null))[_0xd59b('0x2d')](respondWithResult(_0x4a12ca,null))[_0xd59b('0xb9')](handleError(_0x4a12ca,null));};exports[_0xd59b('0xba')]=function(_0x1b4d4a,_0x37dae0){return db[_0xd59b('0x39')][_0xd59b('0xba')](_0x1b4d4a[_0xd59b('0xbb')],{})[_0xd59b('0x2d')](respondWithResult(_0x37dae0,0xc9))[_0xd59b('0xb9')](handleError(_0x37dae0,null));};exports[_0xd59b('0x2b')]=function(_0x451109,_0x1dc7ba){if(_0x451109['body']['id']){delete _0x451109['body']['id'];}return db[_0xd59b('0x39')]['find']({'where':{'id':_0x451109[_0xd59b('0xb3')]['id']}})[_0xd59b('0x2d')](handleEntityNotFound(_0x1dc7ba,null))[_0xd59b('0x2d')](saveUpdates(_0x451109[_0xd59b('0xbb')],null))[_0xd59b('0x2d')](respondWithResult(_0x1dc7ba,null))[_0xd59b('0xb9')](handleError(_0x1dc7ba,null));};exports[_0xd59b('0x2c')]=function(_0x3d1cc8,_0x37694a){return db[_0xd59b('0x39')][_0xd59b('0x71')]({'where':{'id':_0x3d1cc8[_0xd59b('0xb3')]['id']}})[_0xd59b('0x2d')](handleEntityNotFound(_0x37694a,null))[_0xd59b('0x2d')](removeEntity(_0x37694a,null))[_0xd59b('0xb9')](handleError(_0x37694a,null));};exports['describe']=function(_0x2d4ea6,_0x6d3165){return db['OpenchannelInteraction']['describe']()[_0xd59b('0x2d')](respondWithResult(_0x6d3165,null))[_0xd59b('0xb9')](handleError(_0x6d3165,null));};exports['addMessage']=function(_0x2ea30a,_0x42b443,_0x4fdb73){return db[_0xd59b('0xbc')][_0xd59b('0x71')]({'where':{'id':_0x2ea30a['params']['id']}})['then'](handleEntityNotFound(_0x42b443,null))[_0xd59b('0x2d')](function(_0x4d9c78){if(_0x4d9c78){return _0x4d9c78[_0xd59b('0xbd')](_0x2ea30a[_0xd59b('0xbb')][_0xd59b('0xbe')],_[_0xd59b('0xbf')](_0x2ea30a[_0xd59b('0xbb')],[_0xd59b('0xbe'),'id'])||{});}})[_0xd59b('0x2d')](respondWithResult(_0x42b443,null))[_0xd59b('0xb9')](handleError(_0x42b443,null));};exports['getMessages']=function(_0x2852bd,_0x3da1b8,_0x31bab6){var _0x316444={'raw':![],'where':{}};var _0x5a07b7={};var _0x552a6a={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xd59b('0xc0')]({'where':{'id':_0x2852bd[_0xd59b('0xb3')]['id']}})[_0xd59b('0x2d')](handleEntityNotFound(_0x3da1b8,null))['then'](function(_0x11768e){if(_0x11768e){_0x5a07b7[_0xd59b('0x3b')]=_[_0xd59b('0x3d')](db[_0xd59b('0xbc')][_0xd59b('0xb4')]);_0x5a07b7[_0xd59b('0x3c')]=_[_0xd59b('0x3d')](_0x2852bd[_0xd59b('0x3c')]);_0x5a07b7[_0xd59b('0x3e')]=_[_0xd59b('0x3f')](_0x5a07b7['model'],_0x5a07b7[_0xd59b('0x3c')]);_0x316444[_0xd59b('0x40')]=_[_0xd59b('0x3f')](_0x5a07b7[_0xd59b('0x3b')],qs[_0xd59b('0x41')](_0x2852bd['query']['fields']));_0x316444[_0xd59b('0x40')]=_0x316444[_0xd59b('0x40')][_0xd59b('0x42')]?_0x316444[_0xd59b('0x40')]:_0x5a07b7[_0xd59b('0x3b')];if(!_0x2852bd[_0xd59b('0x3c')][_0xd59b('0x43')](_0xd59b('0x44'))){_0x316444['limit']=qs[_0xd59b('0x24')](_0x2852bd[_0xd59b('0x3c')]['limit']);_0x316444['offset']=qs['offset'](_0x2852bd['query'][_0xd59b('0x22')]);}_0x316444[_0xd59b('0x45')]=qs[_0xd59b('0x46')](_0x2852bd[_0xd59b('0x3c')][_0xd59b('0x46')]);_0x316444[_0xd59b('0x47')]=qs[_0xd59b('0x3e')](_[_0xd59b('0x48')](_0x2852bd[_0xd59b('0x3c')],_0x5a07b7[_0xd59b('0x3e')]));_0x316444['where'][_0xd59b('0xb1')]=_0x11768e['id'];if(_0x2852bd['query'][_0xd59b('0x83')]){_0x316444[_0xd59b('0x47')]=_[_0xd59b('0xb7')](_0x316444[_0xd59b('0x47')],{'$or':_[_0xd59b('0x38')](_0x316444[_0xd59b('0x40')],function(_0x4f1eee){var _0x4bee50={};_0x4bee50[_0x4f1eee]={'$like':'%'+_0x2852bd[_0xd59b('0x3c')]['filter']+'%'};return _0x4bee50;})});}if(_0x2852bd['query']['$gte']){var _0x2bbf1c=_0x2852bd[_0xd59b('0x3c')][_0xd59b('0x7a')]['split'](',');var _0x12d9f1={};_0x12d9f1[_0x2bbf1c[0x0]]={'$gte':moment(_0x2bbf1c[0x1])[_0xd59b('0xc1')](_0xd59b('0xc2'))};_0x316444[_0xd59b('0x47')]=_[_0xd59b('0xb7')](_0x316444[_0xd59b('0x47')],_0x12d9f1);}_0x316444=_[_0xd59b('0xb7')]({},_0x316444,_0x2852bd[_0xd59b('0xb8')]);return db[_0xd59b('0xbc')]['count']({'where':_0x316444['where']})[_0xd59b('0x2d')](function(_0x67f902){_0x552a6a['count']=_0x67f902;if(_0x2852bd['query'][_0xd59b('0xb5')]){_0x316444[_0xd59b('0xb6')]=[{'all':!![]}];}return db[_0xd59b('0xbc')]['findAll'](_0x316444);})['then'](function(_0x27fd77){_0x552a6a['rows']=_0x27fd77;return _0x552a6a;});}})[_0xd59b('0x2d')](respondWithFilteredResult(_0x3da1b8,_0x316444))[_0xd59b('0xb9')](handleError(_0x3da1b8,null));};exports[_0xd59b('0xc3')]=function(_0x5987e4,_0x466f98,_0x1c1d62){return db['OpenchannelInteraction'][_0xd59b('0x71')]({'where':{'id':_0x5987e4['params']['id']}})[_0xd59b('0x2d')](handleEntityNotFound(_0x466f98,null))['then'](function(_0x23ac16){if(_0x23ac16){return _0x23ac16[_0xd59b('0xc4')](_0x5987e4[_0xd59b('0xbb')][_0xd59b('0xbe')],_[_0xd59b('0xbf')](_0x5987e4['body'],[_0xd59b('0xbe'),'id'])||{})['spread'](function(){return db[_0xd59b('0x6c')][_0xd59b('0xc5')]({'attributes':['id','name',_0xd59b('0x4b')],'where':{'id':_0x5987e4[_0xd59b('0xbb')][_0xd59b('0xbe')]}});})[_0xd59b('0x2d')](function(_0x4793c4){socket[_0xd59b('0xc6')]('openchannelInteractionTags:save',{'id':Number(_0x5987e4[_0xd59b('0xb3')]['id']),'tags':_0x4793c4||[]});return{'id':Number(_0x5987e4[_0xd59b('0xb3')]['id']),'tags':_0x4793c4||[]};});}})['then'](respondWithResult(_0x466f98,null))['catch'](handleError(_0x466f98,null));};exports['removeTags']=function(_0xfedb5d,_0x39e184,_0x3a37f4){return db[_0xd59b('0x39')][_0xd59b('0x71')]({'where':{'id':_0xfedb5d[_0xd59b('0xb3')]['id']}})[_0xd59b('0x2d')](handleEntityNotFound(_0x39e184,null))[_0xd59b('0x2d')](function(_0xc3fa04){if(_0xc3fa04){return _0xc3fa04[_0xd59b('0xc7')](_0xfedb5d[_0xd59b('0x3c')][_0xd59b('0xbe')]);}})[_0xd59b('0x2d')](respondWithStatusCode(_0x39e184,null))[_0xd59b('0xb9')](handleError(_0x39e184,null));};exports['download']=function(_0x3fd82c,_0x12b348){var _0x10b767=moment()[_0xd59b('0xc8')]()['toString']();var _0x2ea654=path[_0xd59b('0xc9')](config[_0xd59b('0xca')],_0xd59b('0xcb'),_0xd59b('0xcc'),'tmp');var _0x1f8c91=path[_0xd59b('0xc9')](config['root'],_0xd59b('0xcb'),_0xd59b('0xcc'),_0xd59b('0xcd'));var _0x34e495=path[_0xd59b('0xc9')](_0x2ea654,_0x10b767);var _0x8fe128=util[_0xd59b('0xc1')]('transcript-%d-%s.zip',_0x3fd82c[_0xd59b('0xb3')]['id'],_0x10b767);var _0x220c2d=path['join'](_0x2ea654,_0x8fe128);var _0x3c655f=[];_0x3c655f['push']({'model':db['User'],'as':_0xd59b('0x70'),'attributes':['id','fullname'],'raw':!![]});_0x3c655f['push']({'model':db[_0xd59b('0xce')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x3fd82c[_0xd59b('0x3c')][_0xd59b('0xcd')]){_0x3c655f[_0xd59b('0x35')]({'model':db['Attachment'],'as':_0xd59b('0xcf'),'raw':!![]});}var _0x3aee37=[{'model':db[_0xd59b('0xbc')],'as':_0xd59b('0xd0'),'attributes':['id',_0xd59b('0xbb'),_0xd59b('0xd1'),_0xd59b('0xd2'),_0xd59b('0xd3'),_0xd59b('0xd4')],'include':_0x3c655f}];_0x3aee37[_0xd59b('0x35')]({'model':db[_0xd59b('0xd5')],'as':'Account','attributes':['id','name']});_0x3aee37[_0xd59b('0x35')]({'model':db[_0xd59b('0x70')],'as':_0xd59b('0xd6'),'attributes':['id',_0xd59b('0xd7')]});return db[_0xd59b('0x39')][_0xd59b('0x71')]({'where':{'id':_0x3fd82c[_0xd59b('0xb3')]['id']},'include':_0x3aee37})['then'](handleEntityNotFound(_0x12b348,null))[_0xd59b('0x2d')](function(_0x22d4b0){if(_0x22d4b0){var _0x5130a6=_0x22d4b0[_0xd59b('0xd8')]({'plain':!![]});fs[_0xd59b('0xd9')](_0x34e495);var _0xf5de7={'channel':_0xd59b('0xda'),'account':_0x5130a6[_0xd59b('0xdb')]['name'],'agent':_0x5130a6[_0xd59b('0xd6')]?_0x5130a6['Owner'][_0xd59b('0xd7')]:_0xd59b('0xdc'),'createdAt':moment(_0x5130a6[_0xd59b('0xd1')])[_0xd59b('0xc1')](_0xd59b('0xc2'))[_0xd59b('0x9a')](),'closedAt':_0x5130a6[_0xd59b('0xdd')]?moment(_0x5130a6['closedAt'])[_0xd59b('0xc1')](_0xd59b('0xc2'))[_0xd59b('0x9a')]():'','disposition':_0x5130a6[_0xd59b('0xde')],'visibility':_0x5130a6[_0xd59b('0xdf')]?_0xd59b('0xe0'):'Private','messages':_(_0x5130a6[_0xd59b('0xd0')])[_0xd59b('0x83')]({'secret':![]})['map'](function(_0xd9cfe6){if(_0xd9cfe6[_0xd59b('0xcf')]){var _0x1a66e8=path[_0xd59b('0xc9')](_0x1f8c91,_0xd9cfe6[_0xd59b('0xcf')][_0xd59b('0xe1')]);if(fs[_0xd59b('0xe2')](_0x1a66e8)){fs[_0xd59b('0xe3')](_0x1a66e8)['pipe'](fs['createWriteStream'](path[_0xd59b('0xc9')](_0x34e495,_0xd9cfe6[_0xd59b('0xcf')]['basename'])));}}return{'date':moment(_0xd9cfe6[_0xd59b('0xd1')])['format'](_0xd59b('0xc2'))[_0xd59b('0x9a')](),'sender':_0xd9cfe6[_0xd59b('0xd2')]===_0xd59b('0xe4')?_0xd9cfe6[_0xd59b('0x70')]?_0xd9cfe6['User'][_0xd59b('0xd7')]:_0xd59b('0xe5'):_0xd9cfe6[_0xd59b('0x63')][_0xd59b('0xe6')]+(_0xd9cfe6[_0xd59b('0x63')][_0xd59b('0xe7')]?'\x20'+_0xd9cfe6[_0xd59b('0x63')][_0xd59b('0xe7')]:''),'body':_0xd9cfe6[_0xd59b('0xcf')]?_0xd9cfe6[_0xd59b('0xcf')]['basename']:_0xd9cfe6[_0xd59b('0xbb')],'direction':_0xd9cfe6[_0xd59b('0xd2')]===_0xd59b('0xe4')?'A':'C','secret':_0xd9cfe6[_0xd59b('0xd3')],'read':_0xd9cfe6['read'],'attachment':_0xd9cfe6['Attachment']};})[_0xd59b('0x60')]()};return ejs['renderFile'](path[_0xd59b('0xc9')](config[_0xd59b('0xca')],_0xd59b('0xcb'),_0xd59b('0xe8'),_0xd59b('0xe9')),{'interaction':_0xf5de7})[_0xd59b('0x2d')](function(_0x584787){var _0x1f19f9=path[_0xd59b('0xc9')](_0x34e495,_0xd59b('0xea')+_0x5130a6['id']+'-'+_0x10b767+'.pdf');var _0x426756={'path':_0x1f19f9,'channel':_0xd59b('0xda'),'interactionId':_0x5130a6['id']};return pdf[_0xd59b('0xeb')](_0x584787,_0x426756);})[_0xd59b('0x2d')](function(){return new BPromise(function(_0x4ea74f,_0x1c4217){zipdir(_0x34e495,{'saveTo':_0x220c2d},function(_0x4d3acc,_0x3b17f8){if(_0x4d3acc)return _0x1c4217(_0x4d3acc);return _0x4ea74f(_0x3b17f8);});})['then'](function(){return new BPromise(function(_0x308aea,_0x34daf4){rimraf(_0x34e495,function(_0x4d74e3){if(_0x4d74e3)_0x34daf4(_0x4d74e3);return _0x308aea();});});})['then'](function(){return _0x12b348[_0xd59b('0xec')](_0x220c2d,_0x8fe128,function(_0x2227cd){if(_0x2227cd){console[_0xd59b('0xed')]('err',_0x2227cd);}else{fs['unlinkSync'](_0x220c2d);}});});});}else{return _0x12b348['sendStatus'](0xc8);}})[_0xd59b('0xb9')](handleError(_0x12b348,null));}; \ No newline at end of file +var _0x12ab=['forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','compact','isEmpty','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.OpenchannelAccountId\x20IS\x20NULL','toString','sequelize','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','o.internal','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','params','OpenchannelInteraction','includeAll','merge','options','create','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','rawAttributes','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','removeTags','download','unix','join','root','server','tmp','attachments','User','CmContact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','createdAt','closedAt','disposition','threadId','Public','Private','basename','pipe','createWriteStream','out','System','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','Users','map','fullname','TagIds','Tags','split','push','catch','index','fieldName','type','key','model','query','filters','intersection','fields','length','attributes','order','sort','pick','field','color','from','tools_tags','select','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_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','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag'];(function(_0x2791a7,_0x169558){var _0x4bef2c=function(_0x48e86d){while(--_0x48e86d){_0x2791a7['push'](_0x2791a7['shift']());}};_0x4bef2c(++_0x169558);}(_0x12ab,0x80));var _0xb12a=function(_0x4215d7,_0x172117){_0x4215d7=_0x4215d7-0x0;var _0x4a05d4=_0x12ab[_0x4215d7];return _0x4a05d4;};'use strict';var emlformat=require(_0xb12a('0x0'));var rimraf=require(_0xb12a('0x1'));var zipdir=require(_0xb12a('0x2'));var jsonpatch=require(_0xb12a('0x3'));var rp=require('request-promise');var moment=require(_0xb12a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb12a('0x5'));var util=require(_0xb12a('0x6'));var path=require(_0xb12a('0x7'));var sox=require(_0xb12a('0x8'));var csv=require(_0xb12a('0x9'));var ejs=require(_0xb12a('0xa'));var fs=require('fs');var fs_extra=require(_0xb12a('0xb'));var _=require(_0xb12a('0xc'));var squel=require(_0xb12a('0xd'));var crypto=require(_0xb12a('0xe'));var jsforce=require(_0xb12a('0xf'));var deskjs=require(_0xb12a('0x10'));var toCsv=require(_0xb12a('0x9'));var querystring=require(_0xb12a('0x11'));var Papa=require(_0xb12a('0x12'));var Redis=require('ioredis');var authService=require(_0xb12a('0x13'));var qs=require(_0xb12a('0x14'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xb12a('0x15'));var hardwareService=require(_0xb12a('0x16'));var logger=require(_0xb12a('0x17'))(_0xb12a('0x18'));var utils=require(_0xb12a('0x19'));var config=require(_0xb12a('0x1a'));var licenseUtil=require(_0xb12a('0x1b'));var db=require(_0xb12a('0x1c'))['db'];config[_0xb12a('0x1d')]=_['defaults'](config[_0xb12a('0x1d')],{'host':_0xb12a('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb12a('0x1f'))[_0xb12a('0x20')](socket);function respondWithStatusCode(_0x23222b,_0x41174f){_0x41174f=_0x41174f||0xcc;return function(_0x40d7b3){if(_0x40d7b3){return _0x23222b[_0xb12a('0x21')](_0x41174f);}return _0x23222b[_0xb12a('0x22')](_0x41174f)[_0xb12a('0x23')]();};}function respondWithResult(_0x557b46,_0x29a3be){_0x29a3be=_0x29a3be||0xc8;return function(_0x432b1c){if(_0x432b1c){return _0x557b46[_0xb12a('0x22')](_0x29a3be)[_0xb12a('0x24')](_0x432b1c);}};}function respondWithFilteredResult(_0x2805e4,_0x5dc73b){return function(_0x150517){if(_0x150517){var _0x3d77fe=typeof _0x5dc73b[_0xb12a('0x25')]===_0xb12a('0x26')&&typeof _0x5dc73b[_0xb12a('0x27')]===_0xb12a('0x26');var _0x4e45e6=_0x150517['count'];var _0x2dc6bf=_0x3d77fe?0x0:_0x5dc73b[_0xb12a('0x25')];var _0x25f91f=_0x3d77fe?_0x150517[_0xb12a('0x28')]:_0x5dc73b['offset']+_0x5dc73b[_0xb12a('0x27')];var _0x2a6d5c;if(_0x25f91f>=_0x4e45e6){_0x25f91f=_0x4e45e6;_0x2a6d5c=0xc8;}else{_0x2a6d5c=0xce;}_0x2805e4[_0xb12a('0x22')](_0x2a6d5c);return _0x2805e4[_0xb12a('0x29')](_0xb12a('0x2a'),_0x2dc6bf+'-'+_0x25f91f+'/'+_0x4e45e6)[_0xb12a('0x24')](_0x150517);}return null;};}function patchUpdates(_0x5cfd2e){return function(_0x589902){try{jsonpatch['apply'](_0x589902,_0x5cfd2e,!![]);}catch(_0x5a4d0c){return BPromise[_0xb12a('0x2b')](_0x5a4d0c);}return _0x589902[_0xb12a('0x2c')]();};}function saveUpdates(_0x93d98,_0x353d3b){return function(_0x415095){if(_0x415095){return _0x415095[_0xb12a('0x2d')](_0x93d98)[_0xb12a('0x2e')](function(_0x521ced){return _0x521ced;});}return null;};}function removeEntity(_0x24d6bd,_0x449dc8){return function(_0xe7e009){if(_0xe7e009){return _0xe7e009[_0xb12a('0x2f')]()[_0xb12a('0x2e')](function(){_0x24d6bd[_0xb12a('0x22')](0xcc)[_0xb12a('0x23')]();});}};}function handleEntityNotFound(_0x2a83fc,_0x1965c1){return function(_0x4be15e){if(!_0x4be15e){_0x2a83fc[_0xb12a('0x21')](0x194);}return _0x4be15e;};}function handleError(_0x41b3c9,_0x5cabc2){_0x5cabc2=_0x5cabc2||0x1f4;return function(_0x21dcae){logger[_0xb12a('0x30')](_0x21dcae['stack']);if(_0x21dcae['name']){delete _0x21dcae[_0xb12a('0x31')];}_0x41b3c9[_0xb12a('0x22')](_0x5cabc2)[_0xb12a('0x32')](_0x21dcae);};}function getInteractionUsers(_0x4ec6dc,_0x222321){return new BPromise(function(_0x21da14,_0x2b46d3){try{if(_0x222321[_0x4ec6dc['id']]){_0x4ec6dc[_0xb12a('0x33')]=_[_0xb12a('0x34')](_0x222321[_0x4ec6dc['id']],function(_0x1647d7){return{'id':_0x1647d7['id'],'fullname':_0x1647d7[_0xb12a('0x35')]};});}}catch(_0x5807ff){_0x2b46d3(_0x5807ff);}_0x21da14(_0x4ec6dc);});}function getInteractionTags(_0x302b13,_0x1b66aa){return new BPromise(function(_0x19c3be,_0x4beeed){try{if(_0x302b13[_0xb12a('0x36')]){_0x302b13[_0xb12a('0x37')]=[];_0x302b13[_0xb12a('0x36')][_0xb12a('0x38')](',')['forEach'](function(_0x1f2793){_0x302b13[_0xb12a('0x37')][_0xb12a('0x39')](_0x1b66aa[_0x1f2793]);});}delete _0x302b13['TagIds'];}catch(_0x28c5db){_0x4beeed(_0x28c5db);}_0x19c3be(_0x302b13);});}function updateOpenchannelInteraction(_0xa3449e,_0x15b07e,_0x249923){return new BPromise(function(_0xa11ce5,_0xb799dc){return getInteractionUsers(_0xa3449e,_0x249923)[_0xb12a('0x2e')](function(_0x1ac65c){return getInteractionTags(_0x1ac65c,_0x15b07e);})[_0xb12a('0x2e')](function(_0x57154c){_0xa11ce5(_0x57154c);})[_0xb12a('0x3a')](function(_0x472062){_0xb799dc(_0x472062);});});}exports[_0xb12a('0x3b')]=function(_0x4ee2fc,_0x19d984){var _0x1fb26d={},_0x55f1a3={},_0x34f89b={'count':0x0,'rows':[]};var _0x54928b=_['map'](db['OpenchannelInteraction']['rawAttributes'],function(_0xeb3907){return{'name':_0xeb3907[_0xb12a('0x3c')],'type':_0xeb3907[_0xb12a('0x3d')][_0xb12a('0x3e')]};});_0x55f1a3[_0xb12a('0x3f')]=_[_0xb12a('0x34')](_0x54928b,_0xb12a('0x31'));_0x55f1a3[_0xb12a('0x40')]=_['keys'](_0x4ee2fc['query']);_0x55f1a3[_0xb12a('0x41')]=_[_0xb12a('0x42')](_0x55f1a3['model'],_0x55f1a3[_0xb12a('0x40')]);_0x1fb26d['attributes']=_[_0xb12a('0x42')](_0x55f1a3[_0xb12a('0x3f')],qs[_0xb12a('0x43')](_0x4ee2fc[_0xb12a('0x40')][_0xb12a('0x43')]));_0x1fb26d['attributes']=_0x1fb26d['attributes'][_0xb12a('0x44')]?_0x1fb26d[_0xb12a('0x45')]:_0x55f1a3[_0xb12a('0x3f')];if(!_0x4ee2fc[_0xb12a('0x40')]['hasOwnProperty']('nolimit')){_0x1fb26d['limit']=qs[_0xb12a('0x27')](_0x4ee2fc['query'][_0xb12a('0x27')]);_0x1fb26d[_0xb12a('0x25')]=qs[_0xb12a('0x25')](_0x4ee2fc[_0xb12a('0x40')][_0xb12a('0x25')]);}_0x1fb26d[_0xb12a('0x46')]=qs[_0xb12a('0x47')](_0x4ee2fc[_0xb12a('0x40')][_0xb12a('0x47')]);_0x1fb26d['where']=qs[_0xb12a('0x41')](_[_0xb12a('0x48')](_0x4ee2fc[_0xb12a('0x40')],_0x55f1a3[_0xb12a('0x41')]),_0x54928b);var _0x1d70d4=[];var _0x5c96dc=squel['select']()[_0xb12a('0x49')]('id')[_0xb12a('0x49')](_0xb12a('0x31'))[_0xb12a('0x49')](_0xb12a('0x4a'))[_0xb12a('0x4b')](_0xb12a('0x4c'));var _0x59d41c=squel[_0xb12a('0x4d')]()[_0xb12a('0x49')]('u.id')['field'](_0xb12a('0x4e'))[_0xb12a('0x49')](_0xb12a('0x4f'))[_0xb12a('0x4b')](_0xb12a('0x50'),'ui')[_0xb12a('0x51')](_0xb12a('0x52'),'u',_0xb12a('0x53'));var _0x1b8d7e=squel[_0xb12a('0x4d')]()[_0xb12a('0x4b')]('openchannel_interactions','i')[_0xb12a('0x51')](_0xb12a('0x54'),'c',_0xb12a('0x55'))['left_join'](_0xb12a('0x52'),'o',_0xb12a('0x56'))[_0xb12a('0x51')](_0xb12a('0x57'),'a',_0xb12a('0x58'))[_0xb12a('0x51')](_0xb12a('0x59'),'me',_0xb12a('0x5a'))[_0xb12a('0x51')](_0xb12a('0x5b'),'it',_0xb12a('0x5c'))[_0xb12a('0x51')](_0xb12a('0x4c'),'t','t.id\x20=\x20it.TagId');var _0x3cf41f=squel[_0xb12a('0x5d')]();var _0x26ef30=[];var _0x34417b=squel[_0xb12a('0x5d')]();var _0x21f58e;if(_0x4ee2fc[_0xb12a('0x40')][_0xb12a('0x5e')]){_0x21f58e=as[_0xb12a('0x5f')](_0x4ee2fc[_0xb12a('0x40')][_0xb12a('0x5e')]);var _0x4488f3=_0x21f58e['sqlOperator'];for(var _0xf69a95=0x0;_0xf69a95<_0x21f58e[_0xb12a('0x60')][_0xb12a('0x44')];_0xf69a95++){var _0x10e78e=_0x21f58e['conditions'][_0xf69a95];var _0x3be51b='i';var _0x5e593c=_[_0xb12a('0x61')](_0x54928b,['name',_0x10e78e[_0xb12a('0x49')]]);if(!_0x5e593c){switch(_0x10e78e[_0xb12a('0x49')]){case'unreadMessages':if(_0x10e78e[_0xb12a('0x62')]==0x1){_0x1b8d7e[_0xb12a('0x63')]('`'+_0x10e78e[_0xb12a('0x49')]+_0xb12a('0x64'));}else{_0x1b8d7e[_0xb12a('0x63')]('`'+_0x10e78e[_0xb12a('0x49')]+_0xb12a('0x65'));}break;case _0xb12a('0x66'):if(_0x10e78e[_0xb12a('0x67')]===_0xb12a('0x68')){if(_0x10e78e['value'][_0xb12a('0x38')]('\x20')[_0xb12a('0x44')]>0x1){_0x3cf41f[_0x4488f3](_0xb12a('0x69'),qs['getFullTextValue'](_0x10e78e['value']),null);}else{var _0x329a4a='%'+_0x10e78e['value']+'%';_0x3cf41f[_0x4488f3](_0xb12a('0x6a'),_0x329a4a,_0x329a4a,_0x329a4a);}}else{_0x5e593c=_[_0xb12a('0x61')](_0x54928b,[_0xb12a('0x31'),'ContactId']);_0x10e78e[_0xb12a('0x49')]=_0xb12a('0x6b');_0x30c7f3=as[_0xb12a('0x6c')](_0x3be51b,_0x5e593c[_0xb12a('0x3d')],_0x10e78e);_0x3cf41f[_0x4488f3](_0x30c7f3[_0xb12a('0x6d')],_0x30c7f3[_0xb12a('0x62')][_0xb12a('0x6e')],_0x30c7f3[_0xb12a('0x62')][_0xb12a('0x23')]);}break;case _0xb12a('0x6f'):var _0x38cfcb=_0x10e78e[_0xb12a('0x62')]['split'](',')[_0xb12a('0x34')](function(_0x515d30){return Number(_0x515d30);});_0x38cfcb[_0xb12a('0x70')](function(_0x5b3514){_0x34417b['or'](_0xb12a('0x71'),'%,'+_0x5b3514+',%');});_0x26ef30=_[_0xb12a('0x72')](_0x26ef30,_0x38cfcb);break;case'User':if(_0x10e78e[_0xb12a('0x67')]==='$substring'){_0x3cf41f[_0x4488f3](_0xb12a('0x73'),'%'+_0x10e78e[_0xb12a('0x62')]+'%',null);}else{_0x5e593c=_['find'](_0x54928b,[_0xb12a('0x31'),_0xb12a('0x74')]);_0x10e78e[_0xb12a('0x49')]=_0xb12a('0x74');_0x30c7f3=as[_0xb12a('0x6c')](_0x3be51b,_0x5e593c[_0xb12a('0x3d')],_0x10e78e);_0x3cf41f[_0x4488f3](_0x30c7f3['text'],_0x30c7f3[_0xb12a('0x62')][_0xb12a('0x6e')],_0x30c7f3[_0xb12a('0x62')]['end']);}break;case _0xb12a('0x75'):_0x30c7f3=as[_0xb12a('0x6c')]('me',null,_0x10e78e);_0x3cf41f[_0x4488f3](_0x30c7f3[_0xb12a('0x6d')],_0x30c7f3['value'][_0xb12a('0x6e')],_0x30c7f3[_0xb12a('0x62')][_0xb12a('0x23')]);break;}}else{var _0x30c7f3=as[_0xb12a('0x6c')](_0x3be51b,_0x5e593c['type'],_0x10e78e);_0x3cf41f[_0x4488f3](_0x30c7f3[_0xb12a('0x6d')],_0x30c7f3[_0xb12a('0x62')][_0xb12a('0x6e')],_0x30c7f3[_0xb12a('0x62')][_0xb12a('0x23')]);}}}else{var _0x257cd9=_(_0x4ee2fc[_0xb12a('0x40')])[_0xb12a('0x76')]()['map'](function(_0x304a32){return _['some'](_0x54928b,[_0xb12a('0x31'),_0x304a32])?_0x304a32:undefined;})[_0xb12a('0x77')]()['value']();if(!_[_0xb12a('0x78')](_0x257cd9)){_0x257cd9[_0xb12a('0x70')](function(_0x12dffa){if(_0x12dffa===_0xb12a('0x79')){_0x1b8d7e[_0xb12a('0x7a')](_0xb12a('0x7b'),[]['concat'](_0x4ee2fc[_0xb12a('0x40')][_0x12dffa]));}else if(_0x12dffa==='createdAt'){var _0x4d99ad=JSON[_0xb12a('0x7c')](_0x4ee2fc[_0xb12a('0x40')][_0x12dffa])[_0xb12a('0x7d')];var _0x355467=JSON[_0xb12a('0x7c')](_0x4ee2fc[_0xb12a('0x40')][_0x12dffa])[_0xb12a('0x7e')];_0x1b8d7e['where'](_0xb12a('0x7f'),_0x4d99ad,_0x355467);}else{if(_0x4ee2fc[_0xb12a('0x40')][_0x12dffa]===_0xb12a('0x80')){_0x1b8d7e['where']('i.'+_0x12dffa+_0xb12a('0x81'));}else{_0x1b8d7e['where']('i.'+_0x12dffa+_0xb12a('0x82'),_0x4ee2fc[_0xb12a('0x40')][_0x12dffa]);}}});}if(_0x4ee2fc[_0xb12a('0x40')][_0xb12a('0x83')]){if(_0x4ee2fc[_0xb12a('0x40')][_0xb12a('0x83')]==0x1){_0x1b8d7e['having']('`unreadMessages`\x20=\x200');}else{_0x1b8d7e['having'](_0xb12a('0x84'));}}if(_0x4ee2fc[_0xb12a('0x40')][_0xb12a('0x85')]){_0x26ef30=_[_0xb12a('0x86')](_0x4ee2fc[_0xb12a('0x40')]['tag'])?_0x4ee2fc[_0xb12a('0x40')][_0xb12a('0x85')]:new Array(_0x4ee2fc[_0xb12a('0x40')]['tag']);_0x26ef30[_0xb12a('0x70')](function(_0x53c86b){_0x34417b['or'](_0xb12a('0x71'),'%,'+_0x53c86b+',%');});}if(_0x4ee2fc[_0xb12a('0x40')][_0xb12a('0x87')]){var _0x3ece95=_0x4ee2fc[_0xb12a('0x40')][_0xb12a('0x87')][_0xb12a('0x88')]('\x5c','\x5c\x5c')[_0xb12a('0x88')](/'/g,'\x27\x27');if(qs[_0xb12a('0x89')](_0x3ece95)){_0x3cf41f['or']('i.id\x20LIKE\x20?',_0x3ece95+'%');}else{_0x3cf41f['or'](_0xb12a('0x8a'),qs[_0xb12a('0x8b')](_0x3ece95))['or']('i.from\x20LIKE\x20?',_0x3ece95+'%')['or'](_0xb12a('0x8c'),_0x3ece95+'%');}}}_0x1b8d7e[_0xb12a('0x7a')](_0x3cf41f);_0x1b8d7e[_0xb12a('0x8d')](_0xb12a('0x8e'));var _0x27a3bf={'type':db[_0xb12a('0x8f')]['QueryTypes'][_0xb12a('0x90')],'raw':!![]};var _0x55c38b=_0x1b8d7e[_0xb12a('0x91')]();_0x55c38b[_0xb12a('0x49')]('i.id');_0x55c38b['field'](_0xb12a('0x92'),_0xb12a('0x93'));if(_0x1fb26d[_0xb12a('0x46')]){_0x1fb26d[_0xb12a('0x46')][_0xb12a('0x70')](function(_0x3ec38c){var _0x3edf40=_0x3ec38c[0x0]===_0xb12a('0x94')?_0x3ec38c[0x0]:'i.'+_0x3ec38c[0x0];_0x1b8d7e[_0xb12a('0x46')](_0x3edf40,_0x3ec38c[0x1]===_0xb12a('0x95')?![]:!![]);});}if(!_['isEmpty'](_0x26ef30)){_0x1b8d7e[_0xb12a('0x63')](_0x34417b);_0x55c38b['where']('t.id\x20IN\x20?',_0x26ef30);}BPromise[_0xb12a('0x96')]()[_0xb12a('0x2e')](function(){if(!_0x21f58e){if(_0x4ee2fc[_0xb12a('0x40')][_0xb12a('0x79')])return;_0x55c38b['where'](_0xb12a('0x97'));_0x1b8d7e['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4ee2fc[_0xb12a('0x98')][_0xb12a('0x99')]!==_0xb12a('0x9a'))return;return _0x4ee2fc['user']['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x47cddf){if(_[_0xb12a('0x78')](_0x47cddf)){_0x55c38b['where'](_0xb12a('0x9b'));_0x1b8d7e[_0xb12a('0x7a')](_0xb12a('0x9b'));}else{_0x55c38b[_0xb12a('0x7a')](_0xb12a('0x7b'),_['map'](_0x47cddf,'id'));_0x1b8d7e[_0xb12a('0x7a')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xb12a('0x34')](_0x47cddf,'id'));}});})[_0xb12a('0x2e')](function(){if(_0x4ee2fc[_0xb12a('0x98')][_0xb12a('0x99')]===_0xb12a('0x9a')&&!_0x21f58e&&!_0x4ee2fc[_0xb12a('0x40')][_0xb12a('0x79')])return[];return db['sequelize']['query'](_0x55c38b[_0xb12a('0x9c')](),_0x27a3bf);})[_0xb12a('0x2e')](function(_0x2947af){_0x34f89b[_0xb12a('0x28')]=_0x2947af[_0xb12a('0x44')];if(_0x34f89b[_0xb12a('0x28')]===0x0)return[];return db[_0xb12a('0x9d')]['query'](_0x5c96dc[_0xb12a('0x9c')](),_0x27a3bf)[_0xb12a('0x2e')](function(_0x2c6a8c){_0x1d70d4=_[_0xb12a('0x9e')](_0x2c6a8c,'id');_0x27a3bf=_['merge'](_0x27a3bf,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4ee2fc[_0xb12a('0x40')]['fields']){_0x1fb26d[_0xb12a('0x45')][_0xb12a('0x70')](function(_0xb93f99){_0x1b8d7e['field']('i.'+_0xb93f99);});}else{_0x1b8d7e[_0xb12a('0x49')](_0xb12a('0x92'),_0xb12a('0x93'));_0x1b8d7e[_0xb12a('0x49')](_0xb12a('0x9f'),_0xb12a('0xa0'));_0x1b8d7e[_0xb12a('0x49')](_0xb12a('0xa1'),_0xb12a('0xa2'));_0x1b8d7e[_0xb12a('0x49')]('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','contactName');_0x1b8d7e[_0xb12a('0x49')](_0xb12a('0xa3'));_0x1b8d7e[_0xb12a('0x49')](_0xb12a('0xa4'),_0xb12a('0xa5'));_0x1b8d7e[_0xb12a('0x49')](_0xb12a('0xa6'),_0xb12a('0xa7'));_0x1b8d7e[_0xb12a('0x49')](_0xb12a('0xa8'),'Contact.email');_0x1b8d7e[_0xb12a('0x49')](_0xb12a('0xa9'),_0xb12a('0xaa'));_0x1b8d7e[_0xb12a('0x49')](_0xb12a('0xab'),_0xb12a('0xac'));_0x1b8d7e[_0xb12a('0x49')]('c.fax','Contact.fax');_0x1b8d7e[_0xb12a('0x49')](_0xb12a('0xad'),'Owner.fullname');_0x1b8d7e[_0xb12a('0x49')](_0xb12a('0xae'),_0xb12a('0xaf'));_0x1b8d7e['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xb12a('0x36'));}if(_0x1fb26d['limit'])_0x1b8d7e[_0xb12a('0x27')](_0x1fb26d[_0xb12a('0x27')]);if(_0x1fb26d['offset'])_0x1b8d7e[_0xb12a('0x25')](_0x1fb26d[_0xb12a('0x25')]);return db[_0xb12a('0x9d')][_0xb12a('0x40')](_0x1b8d7e[_0xb12a('0x9c')](),_0x27a3bf);})[_0xb12a('0x2e')](function(_0x2eead4){if(_0x2eead4['length']>0x0)_0x59d41c['where'](_0xb12a('0xb0'),_[_0xb12a('0x34')](_0x2eead4,'id'));return db[_0xb12a('0x9d')][_0xb12a('0x40')](_0x59d41c[_0xb12a('0x9c')](),_0x27a3bf)[_0xb12a('0x2e')](function(_0x5365f4){var _0x86d683=_[_0xb12a('0xb1')](_0x5365f4,_0xb12a('0xb2'));var _0x532a51=[];_0x2eead4[_0xb12a('0x70')](function(_0x248396){_0x532a51[_0xb12a('0x39')](updateOpenchannelInteraction(_0x248396,_0x1d70d4,_0x86d683));});return BPromise[_0xb12a('0xb3')](_0x532a51);});});})[_0xb12a('0x2e')](function(_0x2d56f0){_0x34f89b[_0xb12a('0xb4')]=_0x2d56f0;return _0x34f89b;})[_0xb12a('0x2e')](respondWithFilteredResult(_0x19d984,_0x1fb26d))[_0xb12a('0x3a')](handleError(_0x19d984,null));};exports['show']=function(_0x23d94d,_0x1a8661){var _0x364cca={};if(_0x23d94d['query'][_0xb12a('0x3d')]&&_0x23d94d[_0xb12a('0x40')]['type']==='from'){_0x364cca[_0xb12a('0x4b')]=_0x23d94d[_0xb12a('0xb5')]['id'];}else{_0x364cca['id']=_0x23d94d['params']['id'];}var _0x5b35fd={'raw':![],'where':_0x364cca},_0x1e83fe={};_0x1e83fe[_0xb12a('0x3f')]=_[_0xb12a('0x76')](db[_0xb12a('0xb6')]['rawAttributes']);_0x1e83fe[_0xb12a('0x40')]=_[_0xb12a('0x76')](_0x23d94d['query']);_0x1e83fe[_0xb12a('0x41')]=_['intersection'](_0x1e83fe[_0xb12a('0x3f')],_0x1e83fe[_0xb12a('0x40')]);_0x5b35fd['attributes']=_['intersection'](_0x1e83fe['model'],qs['fields'](_0x23d94d[_0xb12a('0x40')][_0xb12a('0x43')]));_0x5b35fd[_0xb12a('0x45')]=_0x5b35fd['attributes'][_0xb12a('0x44')]?_0x5b35fd['attributes']:_0x1e83fe[_0xb12a('0x3f')];if(_0x23d94d['query'][_0xb12a('0xb7')]){_0x5b35fd['include']=[{'all':!![]}];}_0x5b35fd=_[_0xb12a('0xb8')]({},_0x5b35fd,_0x23d94d[_0xb12a('0xb9')]);return db[_0xb12a('0xb6')]['find'](_0x5b35fd)['then'](handleEntityNotFound(_0x1a8661,null))[_0xb12a('0x2e')](respondWithResult(_0x1a8661,null))['catch'](handleError(_0x1a8661,null));};exports['create']=function(_0x562fe2,_0x534a6c){return db['OpenchannelInteraction'][_0xb12a('0xba')](_0x562fe2['body'],{})[_0xb12a('0x2e')](respondWithResult(_0x534a6c,0xc9))['catch'](handleError(_0x534a6c,null));};exports['update']=function(_0x3af279,_0x2a4db6){if(_0x3af279[_0xb12a('0x75')]['id']){delete _0x3af279[_0xb12a('0x75')]['id'];}return db[_0xb12a('0xb6')]['find']({'where':{'id':_0x3af279[_0xb12a('0xb5')]['id']}})['then'](handleEntityNotFound(_0x2a4db6,null))['then'](saveUpdates(_0x3af279['body'],null))['then'](respondWithResult(_0x2a4db6,null))[_0xb12a('0x3a')](handleError(_0x2a4db6,null));};exports[_0xb12a('0x2f')]=function(_0x465e0d,_0x4c09bf){return db[_0xb12a('0xb6')][_0xb12a('0x61')]({'where':{'id':_0x465e0d[_0xb12a('0xb5')]['id']}})[_0xb12a('0x2e')](handleEntityNotFound(_0x4c09bf,null))[_0xb12a('0x2e')](removeEntity(_0x4c09bf,null))['catch'](handleError(_0x4c09bf,null));};exports['describe']=function(_0x246ca6,_0x5b40d3){return db[_0xb12a('0xb6')][_0xb12a('0xbb')]()[_0xb12a('0x2e')](respondWithResult(_0x5b40d3,null))[_0xb12a('0x3a')](handleError(_0x5b40d3,null));};exports[_0xb12a('0xbc')]=function(_0x1fca30,_0x19cb4d,_0x2c624a){return db[_0xb12a('0xbd')][_0xb12a('0x61')]({'where':{'id':_0x1fca30[_0xb12a('0xb5')]['id']}})['then'](handleEntityNotFound(_0x19cb4d,null))[_0xb12a('0x2e')](function(_0x566dba){if(_0x566dba){return _0x566dba[_0xb12a('0xbc')](_0x1fca30['body'][_0xb12a('0xbe')],_[_0xb12a('0xbf')](_0x1fca30[_0xb12a('0x75')],['ids','id'])||{});}})['then'](respondWithResult(_0x19cb4d,null))['catch'](handleError(_0x19cb4d,null));};exports[_0xb12a('0xc0')]=function(_0x2ceaa6,_0x5425fa,_0x50e41e){var _0x5b68c7={'raw':![],'where':{}};var _0x4fb0c3={};var _0x3eff07={'count':0x0,'rows':[]};return db[_0xb12a('0xb6')][_0xb12a('0xc1')]({'where':{'id':_0x2ceaa6['params']['id']}})[_0xb12a('0x2e')](handleEntityNotFound(_0x5425fa,null))['then'](function(_0x1a8ef0){if(_0x1a8ef0){_0x4fb0c3[_0xb12a('0x3f')]=_['keys'](db['OpenchannelMessage'][_0xb12a('0xc2')]);_0x4fb0c3[_0xb12a('0x40')]=_[_0xb12a('0x76')](_0x2ceaa6[_0xb12a('0x40')]);_0x4fb0c3['filters']=_['intersection'](_0x4fb0c3[_0xb12a('0x3f')],_0x4fb0c3[_0xb12a('0x40')]);_0x5b68c7[_0xb12a('0x45')]=_[_0xb12a('0x42')](_0x4fb0c3['model'],qs[_0xb12a('0x43')](_0x2ceaa6[_0xb12a('0x40')][_0xb12a('0x43')]));_0x5b68c7['attributes']=_0x5b68c7[_0xb12a('0x45')]['length']?_0x5b68c7[_0xb12a('0x45')]:_0x4fb0c3[_0xb12a('0x3f')];if(!_0x2ceaa6[_0xb12a('0x40')]['hasOwnProperty'](_0xb12a('0xc3'))){_0x5b68c7[_0xb12a('0x27')]=qs['limit'](_0x2ceaa6['query'][_0xb12a('0x27')]);_0x5b68c7[_0xb12a('0x25')]=qs[_0xb12a('0x25')](_0x2ceaa6['query'][_0xb12a('0x25')]);}_0x5b68c7[_0xb12a('0x46')]=qs['sort'](_0x2ceaa6[_0xb12a('0x40')][_0xb12a('0x47')]);_0x5b68c7[_0xb12a('0x7a')]=qs[_0xb12a('0x41')](_[_0xb12a('0x48')](_0x2ceaa6[_0xb12a('0x40')],_0x4fb0c3[_0xb12a('0x41')]));_0x5b68c7['where']['OpenchannelInteractionId']=_0x1a8ef0['id'];if(_0x2ceaa6['query'][_0xb12a('0x87')]){_0x5b68c7[_0xb12a('0x7a')]=_[_0xb12a('0xb8')](_0x5b68c7[_0xb12a('0x7a')],{'$or':_[_0xb12a('0x34')](_0x5b68c7['attributes'],function(_0x45e452){var _0x1e1b1a={};_0x1e1b1a[_0x45e452]={'$like':'%'+_0x2ceaa6[_0xb12a('0x40')][_0xb12a('0x87')]+'%'};return _0x1e1b1a;})});}if(_0x2ceaa6[_0xb12a('0x40')][_0xb12a('0x7d')]){var _0xb41e9d=_0x2ceaa6['query'][_0xb12a('0x7d')][_0xb12a('0x38')](',');var _0x161c39={};_0x161c39[_0xb41e9d[0x0]]={'$gte':moment(_0xb41e9d[0x1])[_0xb12a('0xc4')](_0xb12a('0xc5'))};_0x5b68c7['where']=_[_0xb12a('0xb8')](_0x5b68c7['where'],_0x161c39);}_0x5b68c7=_[_0xb12a('0xb8')]({},_0x5b68c7,_0x2ceaa6[_0xb12a('0xb9')]);return db[_0xb12a('0xbd')][_0xb12a('0x28')]({'where':_0x5b68c7[_0xb12a('0x7a')]})[_0xb12a('0x2e')](function(_0x1c152a){_0x3eff07[_0xb12a('0x28')]=_0x1c152a;if(_0x2ceaa6[_0xb12a('0x40')][_0xb12a('0xb7')]){_0x5b68c7['include']=[{'all':!![]}];}return db[_0xb12a('0xbd')][_0xb12a('0xc6')](_0x5b68c7);})[_0xb12a('0x2e')](function(_0x23d445){_0x3eff07[_0xb12a('0xb4')]=_0x23d445;return _0x3eff07;});}})['then'](respondWithFilteredResult(_0x5425fa,_0x5b68c7))['catch'](handleError(_0x5425fa,null));};exports[_0xb12a('0xc7')]=function(_0xcb2b24,_0xcdef8c,_0x5b3bae){return db[_0xb12a('0xb6')][_0xb12a('0x61')]({'where':{'id':_0xcb2b24['params']['id']}})['then'](handleEntityNotFound(_0xcdef8c,null))[_0xb12a('0x2e')](function(_0x5ae6ff){if(_0x5ae6ff){return _0x5ae6ff['setTags'](_0xcb2b24['body'][_0xb12a('0xbe')],_['omit'](_0xcb2b24[_0xb12a('0x75')],[_0xb12a('0xbe'),'id'])||{})[_0xb12a('0xc8')](function(){return db[_0xb12a('0x6f')][_0xb12a('0xc6')]({'attributes':['id',_0xb12a('0x31'),_0xb12a('0x4a')],'where':{'id':_0xcb2b24[_0xb12a('0x75')]['ids']}});})[_0xb12a('0x2e')](function(_0x3305ec){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0xcb2b24[_0xb12a('0xb5')]['id']),'tags':_0x3305ec||[]});return{'id':Number(_0xcb2b24['params']['id']),'tags':_0x3305ec||[]};});}})['then'](respondWithResult(_0xcdef8c,null))[_0xb12a('0x3a')](handleError(_0xcdef8c,null));};exports[_0xb12a('0xc9')]=function(_0x2b9b5a,_0x3b2505,_0x399125){return db['OpenchannelInteraction'][_0xb12a('0x61')]({'where':{'id':_0x2b9b5a[_0xb12a('0xb5')]['id']}})['then'](handleEntityNotFound(_0x3b2505,null))[_0xb12a('0x2e')](function(_0x19a28e){if(_0x19a28e){return _0x19a28e[_0xb12a('0xc9')](_0x2b9b5a['query'][_0xb12a('0xbe')]);}})[_0xb12a('0x2e')](respondWithStatusCode(_0x3b2505,null))[_0xb12a('0x3a')](handleError(_0x3b2505,null));};exports[_0xb12a('0xca')]=function(_0x35a86b,_0x5e8b6d){var _0x5e2eab=moment()[_0xb12a('0xcb')]()[_0xb12a('0x9c')]();var _0x5b411d=path[_0xb12a('0xcc')](config[_0xb12a('0xcd')],_0xb12a('0xce'),'files',_0xb12a('0xcf'));var _0x35f5ff=path[_0xb12a('0xcc')](config[_0xb12a('0xcd')],_0xb12a('0xce'),'files',_0xb12a('0xd0'));var _0x5d95cd=path[_0xb12a('0xcc')](_0x5b411d,_0x5e2eab);var _0x2d4167=util[_0xb12a('0xc4')]('transcript-%d-%s.zip',_0x35a86b['params']['id'],_0x5e2eab);var _0xeccdab=path[_0xb12a('0xcc')](_0x5b411d,_0x2d4167);var _0x52a425=[];_0x52a425['push']({'model':db[_0xb12a('0xd1')],'as':_0xb12a('0xd1'),'attributes':['id',_0xb12a('0x35')],'raw':!![]});_0x52a425[_0xb12a('0x39')]({'model':db[_0xb12a('0xd2')],'as':_0xb12a('0x66'),'attributes':['id',_0xb12a('0xd3'),_0xb12a('0xd4')],'raw':!![]});if(_0x35a86b['query']['attachments']){_0x52a425[_0xb12a('0x39')]({'model':db[_0xb12a('0xd5')],'as':'Attachment','raw':!![]});}var _0x352ecf=[{'model':db['OpenchannelMessage'],'as':_0xb12a('0xd6'),'attributes':['id',_0xb12a('0x75'),'createdAt',_0xb12a('0xd7'),_0xb12a('0xd8'),_0xb12a('0x83')],'include':_0x52a425}];_0x352ecf['push']({'model':db[_0xb12a('0xd9')],'as':_0xb12a('0xda'),'attributes':['id',_0xb12a('0x31')]});_0x352ecf[_0xb12a('0x39')]({'model':db[_0xb12a('0xd1')],'as':_0xb12a('0xdb'),'attributes':['id',_0xb12a('0x35')]});return db[_0xb12a('0xb6')][_0xb12a('0x61')]({'where':{'id':_0x35a86b[_0xb12a('0xb5')]['id']},'include':_0x352ecf})['then'](handleEntityNotFound(_0x5e8b6d,null))[_0xb12a('0x2e')](function(_0x321146){if(_0x321146){var _0x1d93c5=_0x321146[_0xb12a('0xdc')]({'plain':!![]});fs[_0xb12a('0xdd')](_0x5d95cd);var _0x27363b={'channel':_0xb12a('0xde'),'account':_0x1d93c5[_0xb12a('0xda')][_0xb12a('0x31')],'agent':_0x1d93c5[_0xb12a('0xdb')]?_0x1d93c5['Owner'][_0xb12a('0x35')]:'N.A.','createdAt':moment(_0x1d93c5[_0xb12a('0xdf')])[_0xb12a('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb12a('0x9c')](),'closedAt':_0x1d93c5['closed']?moment(_0x1d93c5[_0xb12a('0xe0')])[_0xb12a('0xc4')](_0xb12a('0xc5'))[_0xb12a('0x9c')]():'','disposition':_0x1d93c5[_0xb12a('0xe1')],'visibility':_0x1d93c5[_0xb12a('0xe2')]?_0xb12a('0xe3'):_0xb12a('0xe4'),'messages':_(_0x1d93c5[_0xb12a('0xd6')])['filter']({'secret':![]})[_0xb12a('0x34')](function(_0x363530){if(_0x363530[_0xb12a('0xd5')]){var _0x4ccedd=path['join'](_0x35f5ff,_0x363530['Attachment'][_0xb12a('0xe5')]);if(fs['existsSync'](_0x4ccedd)){fs['createReadStream'](_0x4ccedd)[_0xb12a('0xe6')](fs[_0xb12a('0xe7')](path['join'](_0x5d95cd,_0x363530[_0xb12a('0xd5')][_0xb12a('0xe5')])));}}return{'date':moment(_0x363530['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xb12a('0x9c')](),'sender':_0x363530[_0xb12a('0xd7')]===_0xb12a('0xe8')?_0x363530[_0xb12a('0xd1')]?_0x363530['User'][_0xb12a('0x35')]:_0xb12a('0xe9'):_0x363530[_0xb12a('0x66')]['firstName']+(_0x363530[_0xb12a('0x66')][_0xb12a('0xd4')]?'\x20'+_0x363530[_0xb12a('0x66')][_0xb12a('0xd4')]:''),'body':_0x363530['Attachment']?_0x363530['Attachment'][_0xb12a('0xe5')]:_0x363530[_0xb12a('0x75')],'direction':_0x363530[_0xb12a('0xd7')]==='out'?'A':'C','secret':_0x363530[_0xb12a('0xd8')],'read':_0x363530['read'],'attachment':_0x363530[_0xb12a('0xd5')]};})[_0xb12a('0x62')]()};return ejs['renderFile'](path[_0xb12a('0xcc')](config[_0xb12a('0xcd')],_0xb12a('0xce'),'views',_0xb12a('0xea')),{'interaction':_0x27363b})[_0xb12a('0x2e')](function(_0x3faf38){var _0x18c557=path[_0xb12a('0xcc')](_0x5d95cd,_0xb12a('0xeb')+_0x1d93c5['id']+'-'+_0x5e2eab+_0xb12a('0xec'));var _0x431cd2={'path':_0x18c557,'channel':_0xb12a('0xde'),'interactionId':_0x1d93c5['id']};return pdf['createPdfFromHTML'](_0x3faf38,_0x431cd2);})[_0xb12a('0x2e')](function(){return new BPromise(function(_0x39affa,_0x306076){zipdir(_0x5d95cd,{'saveTo':_0xeccdab},function(_0x3a254c,_0x33ddd8){if(_0x3a254c)return _0x306076(_0x3a254c);return _0x39affa(_0x33ddd8);});})[_0xb12a('0x2e')](function(){return new BPromise(function(_0x55341e,_0x3f0038){rimraf(_0x5d95cd,function(_0x59004b){if(_0x59004b)_0x3f0038(_0x59004b);return _0x55341e();});});})['then'](function(){return _0x5e8b6d[_0xb12a('0xca')](_0xeccdab,_0x2d4167,function(_0x263e43){if(_0x263e43){console[_0xb12a('0xed')](_0xb12a('0xee'),_0x263e43);}else{fs[_0xb12a('0xef')](_0xeccdab);}});});});}else{return _0x5e8b6d[_0xb12a('0x21')](0xc8);}})[_0xb12a('0x3a')](handleError(_0x5e8b6d,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 8691171..f7b7a01 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 _0x8b58=['getUsers','setDataValue','Users','map','then','unreadMessages','length','emit','hasOwnProperty','exports','OpenchannelInteraction','../../mysqldb','setMaxListeners','update','remove'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0x8b58,0x190));var _0x88b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b58[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db'][_0x88b5('0x0')];var OpenchannelMessage=require(_0x88b5('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x88b5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x88b5('0x3'),'afterDestroy':_0x88b5('0x4')};function emitEvent(_0x3a35e8){return function(_0x19cfbd,_0x1a819a,_0x1477c0){_0x19cfbd[_0x88b5('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x444a14){_0x19cfbd[_0x88b5('0x6')](_0x88b5('0x7'),_0x444a14[_0x88b5('0x8')](function(_0x13cb97){return{'id':_0x13cb97['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x19cfbd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x88b5('0x9')](function(_0x3bf2d2){_0x19cfbd[_0x88b5('0x6')](_0x88b5('0xa'),_0x3bf2d2[_0x88b5('0xb')]);OpenchannelInteractionEvents[_0x88b5('0xc')](_0x3a35e8+':'+_0x19cfbd['id'],_0x19cfbd);OpenchannelInteractionEvents[_0x88b5('0xc')](_0x3a35e8,_0x19cfbd);_0x1477c0(null);})['catch'](_0x1477c0(null));};}for(var e in events){if(events[_0x88b5('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x88b5('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x6e52=['findAll','setDataValue','unreadMessages','emit','catch','hook','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map'];(function(_0x20ca78,_0xe6bf85){var _0x191710=function(_0x2abd7e){while(--_0x2abd7e){_0x20ca78['push'](_0x20ca78['shift']());}};_0x191710(++_0xe6bf85);}(_0x6e52,0x180));var _0x26e5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6e52[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x26e5('0x0'));var OpenchannelInteraction=require(_0x26e5('0x1'))['db'][_0x26e5('0x2')];var OpenchannelMessage=require(_0x26e5('0x1'))['db'][_0x26e5('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x26e5('0x4')](0x0);var events={'afterCreate':_0x26e5('0x5'),'afterUpdate':_0x26e5('0x6'),'afterDestroy':_0x26e5('0x7')};function emitEvent(_0x1c2309){return function(_0x44b655,_0x4dbd74,_0x385f69){_0x44b655[_0x26e5('0x8')]({'attributes':['id'],'raw':!![]})[_0x26e5('0x9')](function(_0x55decc){_0x44b655['setDataValue'](_0x26e5('0xa'),_0x55decc[_0x26e5('0xb')](function(_0x2b046a){return{'id':_0x2b046a['id']};}));return OpenchannelMessage[_0x26e5('0xc')]({'where':{'OpenchannelInteractionId':_0x44b655['id'],'direction':'in','read':![]},'raw':!![]});})[_0x26e5('0x9')](function(_0x4febf8){_0x44b655[_0x26e5('0xd')](_0x26e5('0xe'),_0x4febf8['length']);OpenchannelInteractionEvents[_0x26e5('0xf')](_0x1c2309+':'+_0x44b655['id'],_0x44b655);OpenchannelInteractionEvents[_0x26e5('0xf')](_0x1c2309,_0x44b655);_0x385f69(null);})[_0x26e5('0x10')](_0x385f69(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x26e5('0x11')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index a85f163..d45bc7c 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 _0x4615=['openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./openchannelInteraction.attributes','exports','define'];(function(_0x3ac063,_0x52424f){var _0xa682d=function(_0x47af4a){while(--_0x47af4a){_0x3ac063['push'](_0x3ac063['shift']());}};_0xa682d(++_0x52424f);}(_0x4615,0x139));var _0x5461=function(_0x4cce14,_0xf93c25){_0x4cce14=_0x4cce14-0x0;var _0x16a0b7=_0x4615[_0x4cce14];return _0x16a0b7;};'use strict';var _=require('lodash');var util=require(_0x5461('0x0'));var logger=require(_0x5461('0x1'))(_0x5461('0x2'));var moment=require(_0x5461('0x3'));var BPromise=require(_0x5461('0x4'));var rp=require(_0x5461('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5461('0x6'));var attributes=require(_0x5461('0x7'));module[_0x5461('0x8')]=function(_0x11be2b,_0x3bf0cc){return _0x11be2b[_0x5461('0x9')]('OpenchannelInteraction',attributes,{'tableName':_0x5461('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5461('0xb'),'collate':_0x5461('0xc'),'hooks':{'beforeUpdate':function(_0x23212c,_0x41df43,_0x437326){if(_0x23212c[_0x5461('0xd')](_0x5461('0xe'))){_0x23212c['closedAt']=moment()[_0x5461('0xf')](_0x5461('0x10'));}_0x437326(null,_0x23212c);}}});}; \ No newline at end of file +var _0x7522=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api'];(function(_0x5af1ce,_0x318f6e){var _0x4e7f4f=function(_0x4c4c90){while(--_0x4c4c90){_0x5af1ce['push'](_0x5af1ce['shift']());}};_0x4e7f4f(++_0x318f6e);}(_0x7522,0x12f));var _0x2752=function(_0x1b25fe,_0x5829cd){_0x1b25fe=_0x1b25fe-0x0;var _0xe5615e=_0x7522[_0x1b25fe];return _0xe5615e;};'use strict';var _=require(_0x2752('0x0'));var util=require(_0x2752('0x1'));var logger=require('../../config/logger')(_0x2752('0x2'));var moment=require(_0x2752('0x3'));var BPromise=require(_0x2752('0x4'));var rp=require(_0x2752('0x5'));var fs=require('fs');var path=require(_0x2752('0x6'));var rimraf=require(_0x2752('0x7'));var config=require(_0x2752('0x8'));var attributes=require(_0x2752('0x9'));module['exports']=function(_0x1b6616,_0x4f3fbb){return _0x1b6616[_0x2752('0xa')](_0x2752('0xb'),attributes,{'tableName':_0x2752('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2752('0xd'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x1e2ebb,_0x54c5f2,_0xcb7065){if(_0x1e2ebb[_0x2752('0xe')](_0x2752('0xf'))){_0x1e2ebb[_0x2752('0x10')]=moment()['format'](_0x2752('0x11'));}_0xcb7065(null,_0x1e2ebb);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 07e1ad3..4386100 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 _0x1526=['UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','OpenchannelInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','update','body','options','raw','where','attributes'];(function(_0x438cce,_0x404d76){var _0x31c2f7=function(_0x3ab6b9){while(--_0x3ab6b9){_0x438cce['push'](_0x438cce['shift']());}};_0x31c2f7(++_0x404d76);}(_0x1526,0x1ac));var _0x6152=function(_0x3f99ae,_0x479334){_0x3f99ae=_0x3f99ae-0x0;var _0x34b721=_0x1526[_0x3f99ae];return _0x34b721;};'use strict';var _=require(_0x6152('0x0'));var util=require(_0x6152('0x1'));var moment=require(_0x6152('0x2'));var BPromise=require(_0x6152('0x3'));var rs=require(_0x6152('0x4'));var fs=require('fs');var Redis=require(_0x6152('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6152('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6152('0x7'));var client=jayson[_0x6152('0x8')][_0x6152('0x9')]({'port':0x232a});config[_0x6152('0xa')]=_[_0x6152('0xb')](config['redis'],{'host':_0x6152('0xc'),'port':0x18eb});var socket=require(_0x6152('0xd'))(new Redis(config[_0x6152('0xa')]));require('./openchannelInteraction.socket')[_0x6152('0xe')](socket);function respondWithRpcPromise(_0x45f439,_0x46b7f0,_0x114e2c){return new BPromise(function(_0x37465e,_0x2ecb59){return client[_0x6152('0xf')](_0x45f439,_0x114e2c)[_0x6152('0x10')](function(_0x243c42){logger['info'](_0x6152('0x11'),_0x46b7f0,_0x6152('0x12'));logger[_0x6152('0x13')](_0x6152('0x14'),_0x46b7f0,_0x6152('0x12'),JSON[_0x6152('0x15')](_0x243c42));if(_0x243c42[_0x6152('0x16')]){if(_0x243c42[_0x6152('0x16')][_0x6152('0x17')]===0x1f4){logger[_0x6152('0x16')](_0x6152('0x11'),_0x46b7f0,_0x243c42[_0x6152('0x16')][_0x6152('0x18')]);return _0x2ecb59(_0x243c42[_0x6152('0x16')]['message']);}logger[_0x6152('0x16')](_0x6152('0x11'),_0x46b7f0,_0x243c42[_0x6152('0x16')]['message']);return _0x37465e(_0x243c42[_0x6152('0x16')][_0x6152('0x18')]);}else{logger[_0x6152('0x19')](_0x6152('0x11'),_0x46b7f0,_0x6152('0x12'));_0x37465e(_0x243c42[_0x6152('0x1a')][_0x6152('0x18')]);}})[_0x6152('0x1b')](function(_0x263379){logger[_0x6152('0x16')](_0x6152('0x11'),_0x46b7f0,_0x263379);_0x2ecb59(_0x263379);});});}exports['UpdateOpenchannelInteraction']=function(_0x26b3c3){var _0x58cc08=this;return new Promise(function(_0x28d184,_0x26d3f0){return db['OpenchannelInteraction'][_0x6152('0x1c')](_0x26b3c3[_0x6152('0x1d')],{'raw':_0x26b3c3[_0x6152('0x1e')]?_0x26b3c3[_0x6152('0x1e')][_0x6152('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26b3c3[_0x6152('0x1e')]?_0x26b3c3[_0x6152('0x1e')][_0x6152('0x20')]||null:null,'attributes':_0x26b3c3[_0x6152('0x1e')]?_0x26b3c3[_0x6152('0x1e')][_0x6152('0x21')]||null:null,'limit':_0x26b3c3[_0x6152('0x1e')]?_0x26b3c3[_0x6152('0x1e')]['limit']||null:null})[_0x6152('0x10')](function(_0x543ac3){logger[_0x6152('0x19')]('UpdateOpenchannelInteraction',_0x26b3c3);logger[_0x6152('0x13')](_0x6152('0x22'),_0x26b3c3,JSON[_0x6152('0x15')](_0x543ac3));_0x28d184(_0x543ac3);})['catch'](function(_0xb6d701){logger['error'](_0x6152('0x22'),_0xb6d701[_0x6152('0x18')],_0x26b3c3);_0x26d3f0(_0x58cc08[_0x6152('0x16')](0x1f4,_0xb6d701[_0x6152('0x18')]));});});};exports[_0x6152('0x23')]=function(_0x2adefe){return new Promise(function(_0x324f27,_0x2bca5a){return db[_0x6152('0x24')]['find']({'where':_0x2adefe[_0x6152('0x1e')]?_0x2adefe[_0x6152('0x1e')][_0x6152('0x20')]||null:null})[_0x6152('0x10')](function(_0x1b202a){if(_0x1b202a){return _0x1b202a[_0x6152('0x25')](_0x2adefe[_0x6152('0x1d')][_0x6152('0x26')],_[_0x6152('0x27')](_0x2adefe[_0x6152('0x1d')],[_0x6152('0x26'),'id'])||{});}})[_0x6152('0x28')](function(_0x4abae9){logger[_0x6152('0x19')](_0x6152('0x29'),_0x2adefe);logger['debug'](_0x6152('0x29'),_0x2adefe,JSON[_0x6152('0x15')](_0x4abae9));_0x324f27(_0x4abae9);})[_0x6152('0x1b')](function(_0x35be59){logger['error'](_0x6152('0x29'),_0x35be59[_0x6152('0x18')],_0x2adefe);_0x2bca5a(_this[_0x6152('0x16')](0x1f4,_0x35be59[_0x6152('0x18')]));});});}; \ No newline at end of file +var _0x59b2=['jayson/promise','client','http','redis','defaults','localhost','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','limit','then','stringify','AddTagsToOpenchannelInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x170e1e,_0xd1b2d1){var _0x232244=function(_0x45d318){while(--_0x45d318){_0x170e1e['push'](_0x170e1e['shift']());}};_0x232244(++_0xd1b2d1);}(_0x59b2,0x75));var _0x259b=function(_0x1526e1,_0x5ed5a5){_0x1526e1=_0x1526e1-0x0;var _0x249a1e=_0x59b2[_0x1526e1];return _0x249a1e;};'use strict';var _=require(_0x259b('0x0'));var util=require(_0x259b('0x1'));var moment=require(_0x259b('0x2'));var BPromise=require(_0x259b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x259b('0x4'));var db=require(_0x259b('0x5'))['db'];var utils=require(_0x259b('0x6'));var logger=require('../../config/logger')(_0x259b('0x7'));var config=require(_0x259b('0x8'));var jayson=require(_0x259b('0x9'));var client=jayson[_0x259b('0xa')][_0x259b('0xb')]({'port':0x232a});config[_0x259b('0xc')]=_[_0x259b('0xd')](config[_0x259b('0xc')],{'host':_0x259b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x259b('0xc')]));require('./openchannelInteraction.socket')[_0x259b('0xf')](socket);function respondWithRpcPromise(_0x524bb0,_0x14d2ff,_0x33a8d9){return new BPromise(function(_0x2b5a52,_0x347d0b){return client[_0x259b('0x10')](_0x524bb0,_0x33a8d9)['then'](function(_0x459f23){logger[_0x259b('0x11')](_0x259b('0x12'),_0x14d2ff,'request\x20sent');logger[_0x259b('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x14d2ff,_0x259b('0x14'),JSON['stringify'](_0x459f23));if(_0x459f23['error']){if(_0x459f23[_0x259b('0x15')][_0x259b('0x16')]===0x1f4){logger['error'](_0x259b('0x12'),_0x14d2ff,_0x459f23[_0x259b('0x15')][_0x259b('0x17')]);return _0x347d0b(_0x459f23[_0x259b('0x15')][_0x259b('0x17')]);}logger['error'](_0x259b('0x12'),_0x14d2ff,_0x459f23[_0x259b('0x15')]['message']);return _0x2b5a52(_0x459f23[_0x259b('0x15')][_0x259b('0x17')]);}else{logger[_0x259b('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x14d2ff,'request\x20sent');_0x2b5a52(_0x459f23[_0x259b('0x18')][_0x259b('0x17')]);}})[_0x259b('0x19')](function(_0x5242de){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x14d2ff,_0x5242de);_0x347d0b(_0x5242de);});});}exports[_0x259b('0x1a')]=function(_0x3abee8){var _0x4523e9=this;return new Promise(function(_0x369df5,_0xb5d685){return db[_0x259b('0x1b')]['update'](_0x3abee8[_0x259b('0x1c')],{'raw':_0x3abee8[_0x259b('0x1d')]?_0x3abee8['options'][_0x259b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3abee8[_0x259b('0x1d')]?_0x3abee8['options'][_0x259b('0x1f')]||null:null,'attributes':_0x3abee8[_0x259b('0x1d')]?_0x3abee8[_0x259b('0x1d')][_0x259b('0x20')]||null:null,'limit':_0x3abee8[_0x259b('0x1d')]?_0x3abee8[_0x259b('0x1d')][_0x259b('0x21')]||null:null})[_0x259b('0x22')](function(_0x55675b){logger[_0x259b('0x11')](_0x259b('0x1a'),_0x3abee8);logger[_0x259b('0x13')]('UpdateOpenchannelInteraction',_0x3abee8,JSON[_0x259b('0x23')](_0x55675b));_0x369df5(_0x55675b);})[_0x259b('0x19')](function(_0x178aeb){logger[_0x259b('0x15')](_0x259b('0x1a'),_0x178aeb['message'],_0x3abee8);_0xb5d685(_0x4523e9[_0x259b('0x15')](0x1f4,_0x178aeb[_0x259b('0x17')]));});});};exports[_0x259b('0x24')]=function(_0x4508cd){return new Promise(function(_0xa66ad5,_0x309240){return db['OpenchannelInteraction'][_0x259b('0x25')]({'where':_0x4508cd[_0x259b('0x1d')]?_0x4508cd[_0x259b('0x1d')][_0x259b('0x1f')]||null:null})[_0x259b('0x22')](function(_0x5649f8){if(_0x5649f8){return _0x5649f8['addTags'](_0x4508cd['body'][_0x259b('0x26')],_[_0x259b('0x27')](_0x4508cd[_0x259b('0x1c')],[_0x259b('0x26'),'id'])||{});}})[_0x259b('0x28')](function(_0x39b0d7){logger[_0x259b('0x11')](_0x259b('0x29'),_0x4508cd);logger['debug'](_0x259b('0x29'),_0x4508cd,JSON[_0x259b('0x23')](_0x39b0d7));_0xa66ad5(_0x39b0d7);})[_0x259b('0x19')](function(_0x320de2){logger[_0x259b('0x15')](_0x259b('0x29'),_0x320de2[_0x259b('0x17')],_0x4508cd);_0x309240(_this[_0x259b('0x15')](0x1f4,_0x320de2[_0x259b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 3243583..ff67964 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 _0x9b40=['save','remove','update','emit','register','length','openchannelInteraction:'];(function(_0xb9cb33,_0x1f7d84){var _0x14366a=function(_0x5d752c){while(--_0x5d752c){_0xb9cb33['push'](_0xb9cb33['shift']());}};_0x14366a(++_0x1f7d84);}(_0x9b40,0x134));var _0x09b4=function(_0x30a1b4,_0x3b98f2){_0x30a1b4=_0x30a1b4-0x0;var _0xcabc7f=_0x9b40[_0x30a1b4];return _0xcabc7f;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x09b4('0x0'),_0x09b4('0x1'),_0x09b4('0x2')];function createListener(_0x23a334,_0x1f8c0e){return function(_0x25a891){_0x1f8c0e[_0x09b4('0x3')](_0x23a334,_0x25a891);};}function removeListener(_0x3790d6,_0x2d89f4){return function(){OpenchannelInteractionEvents['removeListener'](_0x3790d6,_0x2d89f4);};}exports[_0x09b4('0x4')]=function(_0xf24009){for(var _0xb494b1=0x0,_0x3fa210=events[_0x09b4('0x5')];_0xb494b1<_0x3fa210;_0xb494b1++){var _0x1589f8=events[_0xb494b1];var _0x4d5017=createListener(_0x09b4('0x6')+_0x1589f8,_0xf24009);OpenchannelInteractionEvents['on'](_0x1589f8,_0x4d5017);}}; \ No newline at end of file +var _0x2c1c=['./openchannelInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x4f1e8d,_0x5cccc6){var _0x28d998=function(_0x3ac2f5){while(--_0x3ac2f5){_0x4f1e8d['push'](_0x4f1e8d['shift']());}};_0x28d998(++_0x5cccc6);}(_0x2c1c,0x1dc));var _0xc2c1=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x2c1c[_0x485b5a];return _0xd2b34d;};'use strict';var OpenchannelInteractionEvents=require(_0xc2c1('0x0'));var events=[_0xc2c1('0x1'),_0xc2c1('0x2'),_0xc2c1('0x3')];function createListener(_0x375934,_0x46d163){return function(_0x422c0c){_0x46d163[_0xc2c1('0x4')](_0x375934,_0x422c0c);};}function removeListener(_0x5a24f1,_0x2850c2){return function(){OpenchannelInteractionEvents[_0xc2c1('0x5')](_0x5a24f1,_0x2850c2);};}exports[_0xc2c1('0x6')]=function(_0xdb84ec){for(var _0x201b29=0x0,_0x1fbaf3=events['length'];_0x201b29<_0x1fbaf3;_0x201b29++){var _0x249263=events[_0x201b29];var _0x478d7a=createListener('openchannelInteraction:'+_0x249263,_0xdb84ec);OpenchannelInteractionEvents['on'](_0x249263,_0x478d7a);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 850e5e9..2385dc0 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 _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x55e62b,_0x4f34ac){var _0xa7162f=function(_0x178227){while(--_0x178227){_0x55e62b['push'](_0x55e62b['shift']());}};_0xa7162f(++_0x4f34ac);}(_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');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x1e35d2,_0x1f316c){var _0x3668ce=function(_0x5350ad){while(--_0x5350ad){_0x1e35d2['push'](_0x1e35d2['shift']());}};_0x3668ce(++_0x1f316c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);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 e540d6f..b64f934 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 _0x58a4=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x37004b,_0x1f0b3f){var _0x9df09a=function(_0x237ab7){while(--_0x237ab7){_0x37004b['push'](_0x37004b['shift']());}};_0x9df09a(++_0x1f0b3f);}(_0x58a4,0xbf));var _0x458a=function(_0x2e8a6e,_0x18e64f){_0x2e8a6e=_0x2e8a6e-0x0;var _0x259829=_0x58a4[_0x2e8a6e];return _0x259829;};'use strict';var Sequelize=require(_0x458a('0x0'));module[_0x458a('0x1')]={'body':{'type':Sequelize[_0x458a('0x2')](_0x458a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x458a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x458a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x458a('0x5')]('in',_0x458a('0x6')),'defaultValue':_0x458a('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x458a('0x7')]},'providerName':{'type':Sequelize[_0x458a('0x8')]},'providerResponse':{'type':Sequelize[_0x458a('0x2')]}}; \ No newline at end of file +var _0xd5fc=['sequelize','BOOLEAN','ENUM','out','DATE','TEXT'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd5fc,0xae));var _0xcd5f=function(_0x498c5a,_0x30468d){_0x498c5a=_0x498c5a-0x0;var _0x12fc81=_0xd5fc[_0x498c5a];return _0x12fc81;};'use strict';var Sequelize=require(_0xcd5f('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xcd5f('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xcd5f('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcd5f('0x2')]('in',_0xcd5f('0x3')),'defaultValue':_0xcd5f('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xcd5f('0x4')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xcd5f('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index f388bcc..90a4589 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 _0x5d4e=['catch','sendStatus','end','offset','undefined','limit','status','Content-Range','json','apply','reject','update','destroy','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','merge','where','type','VIRTUAL','filter','options','count','include','findAll','rows','show','intersection','length','includeAll','find','create','body','params','describe','openchannel-interactions','accept','openchannel','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','ContactId','contact','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','client','http','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x310966,_0x38acb8){var _0x24e9bb=function(_0x39a79e){while(--_0x39a79e){_0x310966['push'](_0x310966['shift']());}};_0x24e9bb(++_0x38acb8);}(_0x5d4e,0xda));var _0xe5d4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5d4e[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xe5d4('0x0'));var rimraf=require(_0xe5d4('0x1'));var zipdir=require(_0xe5d4('0x2'));var jsonpatch=require(_0xe5d4('0x3'));var rp=require(_0xe5d4('0x4'));var moment=require(_0xe5d4('0x5'));var BPromise=require(_0xe5d4('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe5d4('0x7'));var sox=require(_0xe5d4('0x8'));var csv=require('to-csv');var ejs=require(_0xe5d4('0x9'));var fs=require('fs');var fs_extra=require(_0xe5d4('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe5d4('0xb'));var jsforce=require(_0xe5d4('0xc'));var deskjs=require(_0xe5d4('0xd'));var toCsv=require(_0xe5d4('0xe'));var querystring=require(_0xe5d4('0xf'));var Papa=require('papaparse');var Redis=require(_0xe5d4('0x10'));var authService=require(_0xe5d4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe5d4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5d4('0x13'))(_0xe5d4('0x14'));var utils=require(_0xe5d4('0x15'));var config=require(_0xe5d4('0x16'));var licenseUtil=require(_0xe5d4('0x17'));var db=require(_0xe5d4('0x18'))['db'];config[_0xe5d4('0x19')]=_[_0xe5d4('0x1a')](config[_0xe5d4('0x19')],{'host':_0xe5d4('0x1b'),'port':0x18eb});var socket=require(_0xe5d4('0x1c'))(new Redis(config[_0xe5d4('0x19')]));require(_0xe5d4('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xe5d4('0x1e')]['http']({'port':0x232c});var client9002=jayson['client'][_0xe5d4('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2fdc87,_0x135eeb,_0x204c6c,_0x1833c4){return new BPromise(function(_0x1dd1ef,_0x5c85eb){var _0x32bd19=_0x1833c4||client;return _0x32bd19['request'](_0x2fdc87,_0x204c6c)[_0xe5d4('0x20')](function(_0x4a6ea5){logger[_0xe5d4('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x135eeb,_0xe5d4('0x22'));logger[_0xe5d4('0x23')](_0xe5d4('0x24'),_0x135eeb,'request\x20sent',JSON[_0xe5d4('0x25')](_0x4a6ea5));if(_0x4a6ea5[_0xe5d4('0x26')]){if(_0x4a6ea5[_0xe5d4('0x26')][_0xe5d4('0x27')]===0x1f4){logger[_0xe5d4('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x135eeb,_0x4a6ea5['error'][_0xe5d4('0x28')]);return _0x5c85eb(_0x4a6ea5['error'][_0xe5d4('0x28')]);}logger[_0xe5d4('0x26')](_0xe5d4('0x29'),_0x135eeb,_0x4a6ea5[_0xe5d4('0x26')]['message']);return _0x1dd1ef(_0x4a6ea5['error']['message']);}else{logger[_0xe5d4('0x21')](_0xe5d4('0x29'),_0x135eeb,_0xe5d4('0x22'));_0x1dd1ef(_0x4a6ea5['result'][_0xe5d4('0x28')]);}})[_0xe5d4('0x2a')](function(_0x3c5ea9){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x135eeb,_0x3c5ea9);_0x5c85eb(_0x3c5ea9);});});}function respondWithStatusCode(_0xb442b1,_0x56c8d4){_0x56c8d4=_0x56c8d4||0xcc;return function(_0x3f0c65){if(_0x3f0c65){return _0xb442b1[_0xe5d4('0x2b')](_0x56c8d4);}return _0xb442b1['status'](_0x56c8d4)[_0xe5d4('0x2c')]();};}function respondWithResult(_0x316383,_0x184724){_0x184724=_0x184724||0xc8;return function(_0x158900){if(_0x158900){return _0x316383['status'](_0x184724)['json'](_0x158900);}};}function respondWithFilteredResult(_0x197f0c,_0x5a3957){return function(_0x573168){if(_0x573168){var _0x551baf=typeof _0x5a3957[_0xe5d4('0x2d')]==='undefined'&&typeof _0x5a3957['limit']===_0xe5d4('0x2e');var _0x176633=_0x573168['count'];var _0x5a20a6=_0x551baf?0x0:_0x5a3957[_0xe5d4('0x2d')];var _0x3f3826=_0x551baf?_0x573168['count']:_0x5a3957[_0xe5d4('0x2d')]+_0x5a3957[_0xe5d4('0x2f')];var _0x576319;if(_0x3f3826>=_0x176633){_0x3f3826=_0x176633;_0x576319=0xc8;}else{_0x576319=0xce;}_0x197f0c[_0xe5d4('0x30')](_0x576319);return _0x197f0c['set'](_0xe5d4('0x31'),_0x5a20a6+'-'+_0x3f3826+'/'+_0x176633)[_0xe5d4('0x32')](_0x573168);}return null;};}function patchUpdates(_0x53d44b){return function(_0x34a258){try{jsonpatch[_0xe5d4('0x33')](_0x34a258,_0x53d44b,!![]);}catch(_0x5eff1b){return BPromise[_0xe5d4('0x34')](_0x5eff1b);}return _0x34a258['save']();};}function saveUpdates(_0x3a8664,_0x530f4d){return function(_0x477531){if(_0x477531){return _0x477531[_0xe5d4('0x35')](_0x3a8664)[_0xe5d4('0x20')](function(_0x4540a0){return _0x4540a0;});}return null;};}function removeEntity(_0x4d9274,_0x108cc1){return function(_0x22cbd7){if(_0x22cbd7){return _0x22cbd7[_0xe5d4('0x36')]()['then'](function(){_0x4d9274['status'](0xcc)[_0xe5d4('0x2c')]();});}};}function handleEntityNotFound(_0x63dc6,_0x3b8192){return function(_0x55cb65){if(!_0x55cb65){_0x63dc6[_0xe5d4('0x2b')](0x194);}return _0x55cb65;};}function handleError(_0xd6f6e,_0x441c4d){_0x441c4d=_0x441c4d||0x1f4;return function(_0x46025f){logger[_0xe5d4('0x26')](_0x46025f[_0xe5d4('0x37')]);if(_0x46025f[_0xe5d4('0x38')]){delete _0x46025f[_0xe5d4('0x38')];}_0xd6f6e[_0xe5d4('0x30')](_0x441c4d)[_0xe5d4('0x39')](_0x46025f);};}exports['index']=function(_0x41348c,_0x453148){var _0x229e84={},_0x11e90f={},_0x1fb627={'count':0x0,'rows':[]};var _0x214d1c=_[_0xe5d4('0x3a')](db[_0xe5d4('0x3b')][_0xe5d4('0x3c')],function(_0x1c76e8){return{'name':_0x1c76e8[_0xe5d4('0x3d')],'type':_0x1c76e8['type'][_0xe5d4('0x3e')]};});_0x11e90f[_0xe5d4('0x3f')]=_['map'](_0x214d1c,_0xe5d4('0x38'));_0x11e90f[_0xe5d4('0x40')]=_[_0xe5d4('0x41')](_0x41348c[_0xe5d4('0x40')]);_0x11e90f[_0xe5d4('0x42')]=_['intersection'](_0x11e90f[_0xe5d4('0x3f')],_0x11e90f[_0xe5d4('0x40')]);_0x229e84[_0xe5d4('0x43')]=_['intersection'](_0x11e90f[_0xe5d4('0x3f')],qs[_0xe5d4('0x44')](_0x41348c['query'][_0xe5d4('0x44')]));_0x229e84['attributes']=_0x229e84[_0xe5d4('0x43')]['length']?_0x229e84['attributes']:_0x11e90f[_0xe5d4('0x3f')];if(!_0x41348c[_0xe5d4('0x40')][_0xe5d4('0x45')](_0xe5d4('0x46'))){_0x229e84['limit']=qs[_0xe5d4('0x2f')](_0x41348c['query'][_0xe5d4('0x2f')]);_0x229e84[_0xe5d4('0x2d')]=qs[_0xe5d4('0x2d')](_0x41348c[_0xe5d4('0x40')][_0xe5d4('0x2d')]);}_0x229e84[_0xe5d4('0x47')]=qs[_0xe5d4('0x48')](_0x41348c[_0xe5d4('0x40')]['sort']);_0x229e84['where']=qs['filters'](_['pick'](_0x41348c['query'],_0x11e90f[_0xe5d4('0x42')]),_0x214d1c);if(_0x41348c[_0xe5d4('0x40')]['filter']){_0x229e84['where']=_[_0xe5d4('0x49')](_0x229e84[_0xe5d4('0x4a')],{'$or':_[_0xe5d4('0x3a')](_0x214d1c,function(_0x2a8894){if(_0x2a8894[_0xe5d4('0x4b')]!==_0xe5d4('0x4c')){var _0x46a866={};_0x46a866[_0x2a8894[_0xe5d4('0x38')]]={'$like':'%'+_0x41348c['query'][_0xe5d4('0x4d')]+'%'};return _0x46a866;}})});}_0x229e84=_['merge']({},_0x229e84,_0x41348c[_0xe5d4('0x4e')]);var _0xf9d2cf={'where':_0x229e84['where']};return db['OpenchannelMessage'][_0xe5d4('0x4f')](_0xf9d2cf)[_0xe5d4('0x20')](function(_0x380ec0){_0x1fb627[_0xe5d4('0x4f')]=_0x380ec0;if(_0x41348c['query']['includeAll']){_0x229e84[_0xe5d4('0x50')]=[{'all':!![]}];}return db[_0xe5d4('0x3b')][_0xe5d4('0x51')](_0x229e84);})[_0xe5d4('0x20')](function(_0x2aff18){_0x1fb627[_0xe5d4('0x52')]=_0x2aff18;return _0x1fb627;})[_0xe5d4('0x20')](respondWithFilteredResult(_0x453148,_0x229e84))[_0xe5d4('0x2a')](handleError(_0x453148,null));};exports[_0xe5d4('0x53')]=function(_0x5941c3,_0x4e22cf){var _0x3d5ad2={'raw':!![],'where':{'id':_0x5941c3['params']['id']}},_0x4efdbe={};_0x4efdbe[_0xe5d4('0x3f')]=_['keys'](db[_0xe5d4('0x3b')]['rawAttributes']);_0x4efdbe[_0xe5d4('0x40')]=_['keys'](_0x5941c3['query']);_0x4efdbe[_0xe5d4('0x42')]=_[_0xe5d4('0x54')](_0x4efdbe['model'],_0x4efdbe[_0xe5d4('0x40')]);_0x3d5ad2['attributes']=_[_0xe5d4('0x54')](_0x4efdbe[_0xe5d4('0x3f')],qs[_0xe5d4('0x44')](_0x5941c3[_0xe5d4('0x40')]['fields']));_0x3d5ad2[_0xe5d4('0x43')]=_0x3d5ad2['attributes'][_0xe5d4('0x55')]?_0x3d5ad2[_0xe5d4('0x43')]:_0x4efdbe[_0xe5d4('0x3f')];if(_0x5941c3[_0xe5d4('0x40')][_0xe5d4('0x56')]){_0x3d5ad2[_0xe5d4('0x50')]=[{'all':!![]}];}_0x3d5ad2=_[_0xe5d4('0x49')]({},_0x3d5ad2,_0x5941c3['options']);return db[_0xe5d4('0x3b')][_0xe5d4('0x57')](_0x3d5ad2)[_0xe5d4('0x20')](handleEntityNotFound(_0x4e22cf,null))[_0xe5d4('0x20')](respondWithResult(_0x4e22cf,null))['catch'](handleError(_0x4e22cf,null));};exports[_0xe5d4('0x58')]=function(_0x297f77,_0x5d6513){return db[_0xe5d4('0x3b')][_0xe5d4('0x58')](_0x297f77[_0xe5d4('0x59')],{})[_0xe5d4('0x20')](respondWithResult(_0x5d6513,0xc9))['catch'](handleError(_0x5d6513,null));};exports[_0xe5d4('0x35')]=function(_0x54cc90,_0x27a8e3){if(_0x54cc90['body']['id']){delete _0x54cc90['body']['id'];}return db[_0xe5d4('0x3b')][_0xe5d4('0x57')]({'where':{'id':_0x54cc90[_0xe5d4('0x5a')]['id']}})['then'](handleEntityNotFound(_0x27a8e3,null))[_0xe5d4('0x20')](saveUpdates(_0x54cc90[_0xe5d4('0x59')],null))[_0xe5d4('0x20')](respondWithResult(_0x27a8e3,null))[_0xe5d4('0x2a')](handleError(_0x27a8e3,null));};exports[_0xe5d4('0x36')]=function(_0x27365a,_0x1606c4){return db[_0xe5d4('0x3b')][_0xe5d4('0x57')]({'where':{'id':_0x27365a[_0xe5d4('0x5a')]['id']}})[_0xe5d4('0x20')](handleEntityNotFound(_0x1606c4,null))['then'](removeEntity(_0x1606c4,null))[_0xe5d4('0x2a')](handleError(_0x1606c4,null));};exports[_0xe5d4('0x5b')]=function(_0x40c449,_0x239b18){return db[_0xe5d4('0x3b')][_0xe5d4('0x5b')]()[_0xe5d4('0x20')](respondWithResult(_0x239b18,null))[_0xe5d4('0x2a')](handleError(_0x239b18,null));};var interaction_log=require('../../config/logger')(_0xe5d4('0x5c'));exports[_0xe5d4('0x5d')]=function(_0x19fab3,_0x2e3cc9,_0x2a1b12){var _0x1e421b={'agent':{},'channel':_0xe5d4('0x5e')};if(_0x19fab3['body']['id']){delete _0x19fab3[_0xe5d4('0x59')]['id'];}_0x19fab3[_0xe5d4('0x59')][_0xe5d4('0x5f')]=!![];_0x19fab3[_0xe5d4('0x59')]['readAt']=moment()['format'](_0xe5d4('0x60'));_0x19fab3['body'][_0xe5d4('0x61')]=_0x19fab3[_0xe5d4('0x59')]['UserId']||_0x19fab3[_0xe5d4('0x62')]['id'];_0x1e421b[_0xe5d4('0x63')]['id']=_0x19fab3[_0xe5d4('0x59')][_0xe5d4('0x61')];return db[_0xe5d4('0x3b')][_0xe5d4('0x57')]({'where':{'id':_0x19fab3[_0xe5d4('0x5a')]['id'],'UserId':null}})[_0xe5d4('0x20')](handleEntityNotFound(_0x2e3cc9,null))['then'](saveUpdates(_0x19fab3['body'],null))['then'](function(_0xd93e30){if(_0xd93e30){_0x1e421b[_0xe5d4('0x28')]=_0xd93e30[_0xe5d4('0x64')]({'plain':!![]});return db['OpenchannelInteraction'][_0xe5d4('0x57')]({'where':{'id':_0xd93e30['OpenchannelInteractionId']}});}return null;})[_0xe5d4('0x20')](handleEntityNotFound(_0x2e3cc9,null))[_0xe5d4('0x20')](function(_0x5c0a45){if(_0x5c0a45){return _0x5c0a45[_0xe5d4('0x35')]({'UserId':_0x19fab3['body'][_0xe5d4('0x61')],'read1stAt':_[_0xe5d4('0x65')](_0x5c0a45[_0xe5d4('0x66')])?moment()[_0xe5d4('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x365015){if(_0x365015){_0x1e421b[_0xe5d4('0x68')]=_0x365015[_0xe5d4('0x64')]({'plain':!![]});interaction_log[_0xe5d4('0x21')](_0xe5d4('0x69'),_0x19fab3[_0xe5d4('0x62')]['id'],_0x19fab3[_0xe5d4('0x62')][_0xe5d4('0x38')],_0x19fab3[_0xe5d4('0x62')][_0xe5d4('0x6a')],_0x1e421b[_0xe5d4('0x68')]['id'],_0x19fab3['body']?JSON[_0xe5d4('0x25')](_0x19fab3[_0xe5d4('0x59')]):_0xe5d4('0x6b'));return respondWithRpcPromise(_0xe5d4('0x6c'),_0xe5d4('0x6d'),_0x1e421b);}return null;})[_0xe5d4('0x20')](function(_0x32fe3f){var _0x872b09=_0xe5d4('0x6e')+_0x32fe3f[_0xe5d4('0x28')]['ContactId'];return db[_0xe5d4('0x6f')][_0xe5d4('0x40')](_0x872b09,{'type':db[_0xe5d4('0x70')][_0xe5d4('0x71')][_0xe5d4('0x72')],'raw':!![]})['then'](function(_0x27f7be){return _0x27f7be;});})[_0xe5d4('0x20')](function(_0x3a9a0e){if(_0x3a9a0e){_0x1e421b[_0xe5d4('0x28')]['contact']=_0x3a9a0e[0x0];if(!_0x19fab3[_0xe5d4('0x59')][_0xe5d4('0x61')])return;return db['User']['find']({'where':{'id':_0x19fab3[_0xe5d4('0x59')][_0xe5d4('0x61')],'role':_0xe5d4('0x63')},'attributes':['id',_0xe5d4('0x38'),_0xe5d4('0x73'),_0xe5d4('0x74'),_0xe5d4('0x75')],'raw':!![]});}return null;})[_0xe5d4('0x20')](function(_0x17d75d){if(!_0x17d75d)return null;_0x1e421b['message']['agent']=_0x17d75d;return _0x1e421b;})[_0xe5d4('0x20')](function(_0xc96e82){if(_0xc96e82){if(_0x19fab3[_0xe5d4('0x59')][_0xe5d4('0x76')]){_0x1e421b[_0xe5d4('0x28')][_0xe5d4('0x77')]=util['format']('SIP/%s',_0x19fab3[_0xe5d4('0x62')][_0xe5d4('0x38')]);_0x1e421b[_0xe5d4('0x28')][_0xe5d4('0x78')]=_0x1e421b[_0xe5d4('0x78')];_0x1e421b[_0xe5d4('0x28')][_0xe5d4('0x79')]=_0x1e421b[_0xe5d4('0x78')];_0x1e421b['message'][_0xe5d4('0x7a')]=_0xe5d4('0x5d');return respondWithRpcPromise(_0xe5d4('0x7b'),_0xe5d4('0x7b'),{'event':_0xe5d4('0x7c'),'message':_0x1e421b[_0xe5d4('0x28')]},client9002)[_0xe5d4('0x20')](function(){return _0x1e421b;});}return _0x1e421b;}return null;})['then'](respondWithResult(_0x2e3cc9,null))[_0xe5d4('0x2a')](handleError(_0x2e3cc9,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0xe5d4('0x34')]=function(_0x4f1175,_0x3a546b,_0x3c5e94){var _0x673427={'agent':{},'channel':_0xe5d4('0x5e')};if(_0x4f1175[_0xe5d4('0x59')]['id']){delete _0x4f1175[_0xe5d4('0x59')]['id'];}_0x4f1175[_0xe5d4('0x59')][_0xe5d4('0x61')]=_0x4f1175[_0xe5d4('0x59')][_0xe5d4('0x61')]||_0x4f1175[_0xe5d4('0x62')]['id'];_0x673427[_0xe5d4('0x63')]['id']=_0x4f1175[_0xe5d4('0x59')][_0xe5d4('0x61')];return db[_0xe5d4('0x3b')][_0xe5d4('0x57')]({'where':{'id':_0x4f1175[_0xe5d4('0x5a')]['id'],'UserId':null}})[_0xe5d4('0x20')](handleEntityNotFound(_0x3a546b,null))[_0xe5d4('0x20')](function(_0xf593be){if(_0xf593be){_0x673427[_0xe5d4('0x28')]=_0xf593be[_0xe5d4('0x64')]({'plain':!![]});return db['OpenchannelInteraction'][_0xe5d4('0x57')]({'where':{'id':_0xf593be[_0xe5d4('0x7d')]}});}return null;})[_0xe5d4('0x20')](handleEntityNotFound(_0x3a546b,null))[_0xe5d4('0x20')](function(_0x4e11ed){if(_0x4e11ed){_0x673427[_0xe5d4('0x68')]=_0x4e11ed[_0xe5d4('0x64')]({'plain':!![]});interaction_log[_0xe5d4('0x21')](_0xe5d4('0x7e'),_0x4f1175[_0xe5d4('0x62')]['id'],_0x4f1175['user']['name'],_0x4f1175[_0xe5d4('0x62')][_0xe5d4('0x6a')],_0x673427['interaction']['id'],_0x4f1175[_0xe5d4('0x59')]?JSON[_0xe5d4('0x25')](_0x4f1175['body']):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x673427);}return null;})[_0xe5d4('0x20')](function(_0x4b5321){var _0x595ffa=_0xe5d4('0x6e')+_0x4b5321['message'][_0xe5d4('0x7f')];return db[_0xe5d4('0x6f')][_0xe5d4('0x40')](_0x595ffa,{'type':db[_0xe5d4('0x70')]['QueryTypes'][_0xe5d4('0x72')],'raw':!![]})['then'](function(_0x495845){return _0x495845;});})[_0xe5d4('0x20')](function(_0x305a85){if(_0x305a85){_0x673427['message'][_0xe5d4('0x80')]=_0x305a85[0x0];if(!_0x4f1175[_0xe5d4('0x59')]['UserId'])return;return db['User']['find']({'where':{'id':_0x4f1175[_0xe5d4('0x59')]['UserId'],'role':_0xe5d4('0x63')},'attributes':['id',_0xe5d4('0x38'),'fullname',_0xe5d4('0x74'),_0xe5d4('0x75')],'raw':!![]});}return null;})[_0xe5d4('0x20')](function(_0x1832ef){if(!_0x1832ef)return null;_0x673427[_0xe5d4('0x28')][_0xe5d4('0x63')]=_0x1832ef;return _0x673427;})[_0xe5d4('0x20')](function(_0x4a2a67){if(_0x4a2a67){_0x4a2a67[_0xe5d4('0x28')][_0xe5d4('0x77')]=util[_0xe5d4('0x67')]('SIP/%s',_0x4f1175[_0xe5d4('0x62')][_0xe5d4('0x38')]);_0x4a2a67[_0xe5d4('0x28')]['channel']=_0x673427['channel'];_0x4a2a67[_0xe5d4('0x28')][_0xe5d4('0x79')]=_0x673427[_0xe5d4('0x78')];_0x4a2a67[_0xe5d4('0x28')][_0xe5d4('0x7a')]=_0xe5d4('0x34');respondWithRpcPromise(_0xe5d4('0x7b'),_0xe5d4('0x7b'),{'event':_0xe5d4('0x81'),'message':_0x4a2a67[_0xe5d4('0x28')]},client9002);return _0x673427;}return null;})['then'](respondWithResult(_0x3a546b,null))[_0xe5d4('0x2a')](handleError(_0x3a546b,null));}; \ No newline at end of file +var _0xbcba=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply','save','destroy','end','name','index','map','OpenchannelMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','update','describe','accept','openchannel','read','readAt','format','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','fullname','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','contact','User','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x5baf5f,_0x993a23){var _0x2dff53=function(_0xfa7e9b){while(--_0xfa7e9b){_0x5baf5f['push'](_0x5baf5f['shift']());}};_0x2dff53(++_0x993a23);}(_0xbcba,0x6d));var _0xabcb=function(_0xf9875,_0x353ac1){_0xf9875=_0xf9875-0x0;var _0x46e212=_0xbcba[_0xf9875];return _0x46e212;};'use strict';var emlformat=require(_0xabcb('0x0'));var rimraf=require(_0xabcb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xabcb('0x2'));var rp=require(_0xabcb('0x3'));var moment=require(_0xabcb('0x4'));var BPromise=require(_0xabcb('0x5'));var Mustache=require(_0xabcb('0x6'));var util=require(_0xabcb('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xabcb('0x8'));var ejs=require(_0xabcb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xabcb('0xa'));var crypto=require(_0xabcb('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xabcb('0x8'));var querystring=require('querystring');var Papa=require(_0xabcb('0xc'));var Redis=require(_0xabcb('0xd'));var authService=require(_0xabcb('0xe'));var qs=require(_0xabcb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabcb('0x10'));var logger=require(_0xabcb('0x11'))(_0xabcb('0x12'));var utils=require(_0xabcb('0x13'));var config=require(_0xabcb('0x14'));var licenseUtil=require(_0xabcb('0x15'));var db=require(_0xabcb('0x16'))['db'];config[_0xabcb('0x17')]=_['defaults'](config[_0xabcb('0x17')],{'host':_0xabcb('0x18'),'port':0x18eb});var socket=require(_0xabcb('0x19'))(new Redis(config[_0xabcb('0x17')]));require(_0xabcb('0x1a'))[_0xabcb('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xabcb('0x1c')][_0xabcb('0x1d')]({'port':0x232c});var client9002=jayson[_0xabcb('0x1c')][_0xabcb('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x29c6f4,_0x40ee1b,_0x22a10c,_0x233048){return new BPromise(function(_0x19032f,_0x25b67e){var _0x48dd27=_0x233048||client;return _0x48dd27[_0xabcb('0x1e')](_0x29c6f4,_0x22a10c)[_0xabcb('0x1f')](function(_0x314016){logger[_0xabcb('0x20')](_0xabcb('0x21'),_0x40ee1b,_0xabcb('0x22'));logger[_0xabcb('0x23')](_0xabcb('0x24'),_0x40ee1b,_0xabcb('0x22'),JSON[_0xabcb('0x25')](_0x314016));if(_0x314016[_0xabcb('0x26')]){if(_0x314016[_0xabcb('0x26')][_0xabcb('0x27')]===0x1f4){logger[_0xabcb('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x40ee1b,_0x314016['error']['message']);return _0x25b67e(_0x314016[_0xabcb('0x26')][_0xabcb('0x28')]);}logger[_0xabcb('0x26')](_0xabcb('0x21'),_0x40ee1b,_0x314016[_0xabcb('0x26')]['message']);return _0x19032f(_0x314016[_0xabcb('0x26')]['message']);}else{logger['info'](_0xabcb('0x21'),_0x40ee1b,_0xabcb('0x22'));_0x19032f(_0x314016[_0xabcb('0x29')][_0xabcb('0x28')]);}})['catch'](function(_0xf7ddfb){logger[_0xabcb('0x26')](_0xabcb('0x21'),_0x40ee1b,_0xf7ddfb);_0x25b67e(_0xf7ddfb);});});}function respondWithStatusCode(_0x117ee6,_0x4b6a46){_0x4b6a46=_0x4b6a46||0xcc;return function(_0x461866){if(_0x461866){return _0x117ee6[_0xabcb('0x2a')](_0x4b6a46);}return _0x117ee6['status'](_0x4b6a46)['end']();};}function respondWithResult(_0x1b0938,_0x5e5533){_0x5e5533=_0x5e5533||0xc8;return function(_0x1bbf15){if(_0x1bbf15){return _0x1b0938[_0xabcb('0x2b')](_0x5e5533)[_0xabcb('0x2c')](_0x1bbf15);}};}function respondWithFilteredResult(_0xe6a539,_0x342383){return function(_0x279f03){if(_0x279f03){var _0x3ce398=typeof _0x342383['offset']==='undefined'&&typeof _0x342383[_0xabcb('0x2d')]===_0xabcb('0x2e');var _0x531bae=_0x279f03[_0xabcb('0x2f')];var _0x1d848b=_0x3ce398?0x0:_0x342383[_0xabcb('0x30')];var _0xa1b649=_0x3ce398?_0x279f03[_0xabcb('0x2f')]:_0x342383[_0xabcb('0x30')]+_0x342383['limit'];var _0x18f014;if(_0xa1b649>=_0x531bae){_0xa1b649=_0x531bae;_0x18f014=0xc8;}else{_0x18f014=0xce;}_0xe6a539[_0xabcb('0x2b')](_0x18f014);return _0xe6a539['set'](_0xabcb('0x31'),_0x1d848b+'-'+_0xa1b649+'/'+_0x531bae)[_0xabcb('0x2c')](_0x279f03);}return null;};}function patchUpdates(_0x49aff7){return function(_0xf94b8a){try{jsonpatch[_0xabcb('0x32')](_0xf94b8a,_0x49aff7,!![]);}catch(_0x4e704e){return BPromise['reject'](_0x4e704e);}return _0xf94b8a[_0xabcb('0x33')]();};}function saveUpdates(_0x539d44,_0x3e1b0f){return function(_0x575c24){if(_0x575c24){return _0x575c24['update'](_0x539d44)['then'](function(_0x1d950c){return _0x1d950c;});}return null;};}function removeEntity(_0x30e963,_0x24b90c){return function(_0x54f3ab){if(_0x54f3ab){return _0x54f3ab[_0xabcb('0x34')]()[_0xabcb('0x1f')](function(){_0x30e963[_0xabcb('0x2b')](0xcc)[_0xabcb('0x35')]();});}};}function handleEntityNotFound(_0x4aea88,_0x4827d6){return function(_0x28b0f9){if(!_0x28b0f9){_0x4aea88[_0xabcb('0x2a')](0x194);}return _0x28b0f9;};}function handleError(_0x4f32f0,_0x2d415b){_0x2d415b=_0x2d415b||0x1f4;return function(_0x114c3c){logger[_0xabcb('0x26')](_0x114c3c['stack']);if(_0x114c3c[_0xabcb('0x36')]){delete _0x114c3c[_0xabcb('0x36')];}_0x4f32f0[_0xabcb('0x2b')](_0x2d415b)['send'](_0x114c3c);};}exports[_0xabcb('0x37')]=function(_0x2a1d6e,_0x3d643f){var _0x49f790={},_0x2597bb={},_0x441f16={'count':0x0,'rows':[]};var _0xfb7484=_[_0xabcb('0x38')](db[_0xabcb('0x39')]['rawAttributes'],function(_0x4421cc){return{'name':_0x4421cc[_0xabcb('0x3a')],'type':_0x4421cc[_0xabcb('0x3b')][_0xabcb('0x3c')]};});_0x2597bb[_0xabcb('0x3d')]=_['map'](_0xfb7484,_0xabcb('0x36'));_0x2597bb[_0xabcb('0x3e')]=_[_0xabcb('0x3f')](_0x2a1d6e[_0xabcb('0x3e')]);_0x2597bb[_0xabcb('0x40')]=_[_0xabcb('0x41')](_0x2597bb[_0xabcb('0x3d')],_0x2597bb[_0xabcb('0x3e')]);_0x49f790[_0xabcb('0x42')]=_[_0xabcb('0x41')](_0x2597bb[_0xabcb('0x3d')],qs[_0xabcb('0x43')](_0x2a1d6e['query']['fields']));_0x49f790[_0xabcb('0x42')]=_0x49f790['attributes'][_0xabcb('0x44')]?_0x49f790['attributes']:_0x2597bb['model'];if(!_0x2a1d6e['query'][_0xabcb('0x45')]('nolimit')){_0x49f790['limit']=qs[_0xabcb('0x2d')](_0x2a1d6e[_0xabcb('0x3e')]['limit']);_0x49f790[_0xabcb('0x30')]=qs[_0xabcb('0x30')](_0x2a1d6e[_0xabcb('0x3e')]['offset']);}_0x49f790['order']=qs[_0xabcb('0x46')](_0x2a1d6e[_0xabcb('0x3e')][_0xabcb('0x46')]);_0x49f790['where']=qs['filters'](_['pick'](_0x2a1d6e[_0xabcb('0x3e')],_0x2597bb['filters']),_0xfb7484);if(_0x2a1d6e[_0xabcb('0x3e')][_0xabcb('0x47')]){_0x49f790[_0xabcb('0x48')]=_['merge'](_0x49f790[_0xabcb('0x48')],{'$or':_['map'](_0xfb7484,function(_0xf9d2f0){if(_0xf9d2f0['type']!=='VIRTUAL'){var _0x1fa411={};_0x1fa411[_0xf9d2f0[_0xabcb('0x36')]]={'$like':'%'+_0x2a1d6e[_0xabcb('0x3e')]['filter']+'%'};return _0x1fa411;}})});}_0x49f790=_[_0xabcb('0x49')]({},_0x49f790,_0x2a1d6e[_0xabcb('0x4a')]);var _0x4cf824={'where':_0x49f790['where']};return db[_0xabcb('0x39')][_0xabcb('0x2f')](_0x4cf824)[_0xabcb('0x1f')](function(_0x5f2a3d){_0x441f16[_0xabcb('0x2f')]=_0x5f2a3d;if(_0x2a1d6e[_0xabcb('0x3e')][_0xabcb('0x4b')]){_0x49f790[_0xabcb('0x4c')]=[{'all':!![]}];}return db[_0xabcb('0x39')][_0xabcb('0x4d')](_0x49f790);})[_0xabcb('0x1f')](function(_0x4e0a33){_0x441f16['rows']=_0x4e0a33;return _0x441f16;})['then'](respondWithFilteredResult(_0x3d643f,_0x49f790))[_0xabcb('0x4e')](handleError(_0x3d643f,null));};exports['show']=function(_0x534696,_0x1a4a09){var _0x264799={'raw':!![],'where':{'id':_0x534696[_0xabcb('0x4f')]['id']}},_0x24f9d6={};_0x24f9d6['model']=_[_0xabcb('0x3f')](db[_0xabcb('0x39')][_0xabcb('0x50')]);_0x24f9d6[_0xabcb('0x3e')]=_[_0xabcb('0x3f')](_0x534696['query']);_0x24f9d6[_0xabcb('0x40')]=_['intersection'](_0x24f9d6[_0xabcb('0x3d')],_0x24f9d6[_0xabcb('0x3e')]);_0x264799[_0xabcb('0x42')]=_[_0xabcb('0x41')](_0x24f9d6[_0xabcb('0x3d')],qs[_0xabcb('0x43')](_0x534696[_0xabcb('0x3e')][_0xabcb('0x43')]));_0x264799[_0xabcb('0x42')]=_0x264799[_0xabcb('0x42')][_0xabcb('0x44')]?_0x264799['attributes']:_0x24f9d6[_0xabcb('0x3d')];if(_0x534696[_0xabcb('0x3e')]['includeAll']){_0x264799[_0xabcb('0x4c')]=[{'all':!![]}];}_0x264799=_[_0xabcb('0x49')]({},_0x264799,_0x534696[_0xabcb('0x4a')]);return db[_0xabcb('0x39')][_0xabcb('0x51')](_0x264799)['then'](handleEntityNotFound(_0x1a4a09,null))['then'](respondWithResult(_0x1a4a09,null))[_0xabcb('0x4e')](handleError(_0x1a4a09,null));};exports[_0xabcb('0x52')]=function(_0x530401,_0x3a3104){return db[_0xabcb('0x39')][_0xabcb('0x52')](_0x530401[_0xabcb('0x53')],{})['then'](respondWithResult(_0x3a3104,0xc9))[_0xabcb('0x4e')](handleError(_0x3a3104,null));};exports[_0xabcb('0x54')]=function(_0x4a0112,_0x2f1f96){if(_0x4a0112[_0xabcb('0x53')]['id']){delete _0x4a0112[_0xabcb('0x53')]['id'];}return db[_0xabcb('0x39')][_0xabcb('0x51')]({'where':{'id':_0x4a0112[_0xabcb('0x4f')]['id']}})[_0xabcb('0x1f')](handleEntityNotFound(_0x2f1f96,null))[_0xabcb('0x1f')](saveUpdates(_0x4a0112['body'],null))[_0xabcb('0x1f')](respondWithResult(_0x2f1f96,null))[_0xabcb('0x4e')](handleError(_0x2f1f96,null));};exports['destroy']=function(_0x58ed05,_0x311f5e){return db[_0xabcb('0x39')][_0xabcb('0x51')]({'where':{'id':_0x58ed05[_0xabcb('0x4f')]['id']}})[_0xabcb('0x1f')](handleEntityNotFound(_0x311f5e,null))['then'](removeEntity(_0x311f5e,null))['catch'](handleError(_0x311f5e,null));};exports[_0xabcb('0x55')]=function(_0x3e4133,_0x341eb3){return db['OpenchannelMessage'][_0xabcb('0x55')]()[_0xabcb('0x1f')](respondWithResult(_0x341eb3,null))[_0xabcb('0x4e')](handleError(_0x341eb3,null));};var interaction_log=require(_0xabcb('0x11'))('openchannel-interactions');exports[_0xabcb('0x56')]=function(_0x366eae,_0x9f4be1,_0x361cc7){var _0x13b3f4={'agent':{},'channel':_0xabcb('0x57')};if(_0x366eae['body']['id']){delete _0x366eae[_0xabcb('0x53')]['id'];}_0x366eae[_0xabcb('0x53')][_0xabcb('0x58')]=!![];_0x366eae[_0xabcb('0x53')][_0xabcb('0x59')]=moment()[_0xabcb('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x366eae['body'][_0xabcb('0x5b')]=_0x366eae['body'][_0xabcb('0x5b')]||_0x366eae[_0xabcb('0x5c')]['id'];_0x13b3f4[_0xabcb('0x5d')]['id']=_0x366eae['body'][_0xabcb('0x5b')];return db[_0xabcb('0x39')][_0xabcb('0x51')]({'where':{'id':_0x366eae['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x9f4be1,null))['then'](saveUpdates(_0x366eae[_0xabcb('0x53')],null))[_0xabcb('0x1f')](function(_0x50c6b6){if(_0x50c6b6){_0x13b3f4[_0xabcb('0x28')]=_0x50c6b6[_0xabcb('0x5e')]({'plain':!![]});return db[_0xabcb('0x5f')][_0xabcb('0x51')]({'where':{'id':_0x50c6b6[_0xabcb('0x60')]}});}return null;})[_0xabcb('0x1f')](handleEntityNotFound(_0x9f4be1,null))['then'](function(_0x4d2b77){if(_0x4d2b77){return _0x4d2b77['update']({'UserId':_0x366eae[_0xabcb('0x53')][_0xabcb('0x5b')],'read1stAt':_[_0xabcb('0x61')](_0x4d2b77[_0xabcb('0x62')])?moment()[_0xabcb('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xabcb('0x1f')](function(_0x277168){if(_0x277168){_0x13b3f4[_0xabcb('0x63')]=_0x277168[_0xabcb('0x5e')]({'plain':!![]});interaction_log[_0xabcb('0x20')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x366eae[_0xabcb('0x5c')]['id'],_0x366eae[_0xabcb('0x5c')][_0xabcb('0x36')],_0x366eae['user'][_0xabcb('0x64')],_0x13b3f4[_0xabcb('0x63')]['id'],_0x366eae[_0xabcb('0x53')]?JSON[_0xabcb('0x25')](_0x366eae[_0xabcb('0x53')]):_0xabcb('0x65'));return respondWithRpcPromise(_0xabcb('0x66'),_0xabcb('0x67'),_0x13b3f4);}return null;})[_0xabcb('0x1f')](function(_0x346bb8){var _0x30cc41='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x346bb8[_0xabcb('0x28')][_0xabcb('0x68')];return db[_0xabcb('0x69')]['query'](_0x30cc41,{'type':db[_0xabcb('0x6a')][_0xabcb('0x6b')]['SELECT'],'raw':!![]})[_0xabcb('0x1f')](function(_0x2d1427){return _0x2d1427;});})[_0xabcb('0x1f')](function(_0x5ef058){if(_0x5ef058){_0x13b3f4[_0xabcb('0x28')]['contact']=_0x5ef058[0x0];if(!_0x366eae[_0xabcb('0x53')][_0xabcb('0x5b')])return;return db['User'][_0xabcb('0x51')]({'where':{'id':_0x366eae[_0xabcb('0x53')][_0xabcb('0x5b')],'role':'agent'},'attributes':['id',_0xabcb('0x36'),_0xabcb('0x6c'),_0xabcb('0x6d'),_0xabcb('0x6e')],'raw':!![]});}return null;})[_0xabcb('0x1f')](function(_0x3f25b4){if(!_0x3f25b4)return null;_0x13b3f4[_0xabcb('0x28')][_0xabcb('0x5d')]=_0x3f25b4;return _0x13b3f4;})[_0xabcb('0x1f')](function(_0x5c9b7a){if(_0x5c9b7a){if(_0x366eae[_0xabcb('0x53')]['manual']){_0x13b3f4[_0xabcb('0x28')][_0xabcb('0x6f')]=util['format'](_0xabcb('0x70'),_0x366eae[_0xabcb('0x5c')][_0xabcb('0x36')]);_0x13b3f4[_0xabcb('0x28')][_0xabcb('0x71')]=_0x13b3f4['channel'];_0x13b3f4['message']['motionChannel']=_0x13b3f4[_0xabcb('0x71')];_0x13b3f4['message'][_0xabcb('0x72')]=_0xabcb('0x56');return respondWithRpcPromise(_0xabcb('0x73'),'EventManager',{'event':_0xabcb('0x74'),'message':_0x13b3f4[_0xabcb('0x28')]},client9002)[_0xabcb('0x1f')](function(){return _0x13b3f4;});}return _0x13b3f4;}return null;})[_0xabcb('0x1f')](respondWithResult(_0x9f4be1,null))[_0xabcb('0x4e')](handleError(_0x9f4be1,null));};var interaction_log=require(_0xabcb('0x11'))('openchannel-interactions');exports[_0xabcb('0x75')]=function(_0x3bc6ba,_0xf330ad,_0x3731e5){var _0x5cc09b={'agent':{},'channel':_0xabcb('0x57')};if(_0x3bc6ba[_0xabcb('0x53')]['id']){delete _0x3bc6ba[_0xabcb('0x53')]['id'];}_0x3bc6ba[_0xabcb('0x53')][_0xabcb('0x5b')]=_0x3bc6ba[_0xabcb('0x53')]['UserId']||_0x3bc6ba[_0xabcb('0x5c')]['id'];_0x5cc09b[_0xabcb('0x5d')]['id']=_0x3bc6ba[_0xabcb('0x53')][_0xabcb('0x5b')];return db[_0xabcb('0x39')][_0xabcb('0x51')]({'where':{'id':_0x3bc6ba[_0xabcb('0x4f')]['id'],'UserId':null}})[_0xabcb('0x1f')](handleEntityNotFound(_0xf330ad,null))[_0xabcb('0x1f')](function(_0x24672f){if(_0x24672f){_0x5cc09b['message']=_0x24672f[_0xabcb('0x5e')]({'plain':!![]});return db[_0xabcb('0x5f')][_0xabcb('0x51')]({'where':{'id':_0x24672f[_0xabcb('0x60')]}});}return null;})[_0xabcb('0x1f')](handleEntityNotFound(_0xf330ad,null))[_0xabcb('0x1f')](function(_0x5eb2a4){if(_0x5eb2a4){_0x5cc09b[_0xabcb('0x63')]=_0x5eb2a4['get']({'plain':!![]});interaction_log[_0xabcb('0x20')](_0xabcb('0x76'),_0x3bc6ba[_0xabcb('0x5c')]['id'],_0x3bc6ba[_0xabcb('0x5c')]['name'],_0x3bc6ba[_0xabcb('0x5c')]['role'],_0x5cc09b['interaction']['id'],_0x3bc6ba[_0xabcb('0x53')]?JSON[_0xabcb('0x25')](_0x3bc6ba[_0xabcb('0x53')]):_0xabcb('0x65'));return respondWithRpcPromise(_0xabcb('0x77'),_0xabcb('0x78'),_0x5cc09b);}return null;})[_0xabcb('0x1f')](function(_0x584e35){var _0x4ee15c=_0xabcb('0x79')+_0x584e35[_0xabcb('0x28')][_0xabcb('0x68')];return db[_0xabcb('0x69')]['query'](_0x4ee15c,{'type':db[_0xabcb('0x6a')][_0xabcb('0x6b')][_0xabcb('0x7a')],'raw':!![]})['then'](function(_0x404e16){return _0x404e16;});})[_0xabcb('0x1f')](function(_0x1e1e34){if(_0x1e1e34){_0x5cc09b[_0xabcb('0x28')][_0xabcb('0x7b')]=_0x1e1e34[0x0];if(!_0x3bc6ba[_0xabcb('0x53')][_0xabcb('0x5b')])return;return db[_0xabcb('0x7c')]['find']({'where':{'id':_0x3bc6ba[_0xabcb('0x53')][_0xabcb('0x5b')],'role':_0xabcb('0x5d')},'attributes':['id','name',_0xabcb('0x6c'),'email',_0xabcb('0x6e')],'raw':!![]});}return null;})[_0xabcb('0x1f')](function(_0x28fc9e){if(!_0x28fc9e)return null;_0x5cc09b[_0xabcb('0x28')][_0xabcb('0x5d')]=_0x28fc9e;return _0x5cc09b;})[_0xabcb('0x1f')](function(_0x54c404){if(_0x54c404){_0x54c404['message'][_0xabcb('0x6f')]=util[_0xabcb('0x5a')](_0xabcb('0x70'),_0x3bc6ba[_0xabcb('0x5c')][_0xabcb('0x36')]);_0x54c404[_0xabcb('0x28')][_0xabcb('0x71')]=_0x5cc09b[_0xabcb('0x71')];_0x54c404[_0xabcb('0x28')]['motionChannel']=_0x5cc09b[_0xabcb('0x71')];_0x54c404['message'][_0xabcb('0x72')]=_0xabcb('0x75');respondWithRpcPromise(_0xabcb('0x73'),_0xabcb('0x73'),{'event':_0xabcb('0x7d'),'message':_0x54c404[_0xabcb('0x28')]},client9002);return _0x5cc09b;}return null;})[_0xabcb('0x1f')](respondWithResult(_0xf330ad,null))[_0xabcb('0x4e')](handleError(_0xf330ad,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index bb39bed..5257726 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 _0xcbb2=['emit','hasOwnProperty','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove'];(function(_0x4d2993,_0x1c9473){var _0x427374=function(_0x149dfd){while(--_0x149dfd){_0x4d2993['push'](_0x4d2993['shift']());}};_0x427374(++_0x1c9473);}(_0xcbb2,0x186));var _0x2cbb=function(_0x589328,_0x348617){_0x589328=_0x589328-0x0;var _0x38dc0a=_0xcbb2[_0x589328];return _0x38dc0a;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x2cbb('0x0'))['db'][_0x2cbb('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x2cbb('0x2')](0x0);var events={'afterCreate':_0x2cbb('0x3'),'afterUpdate':_0x2cbb('0x4'),'afterDestroy':_0x2cbb('0x5')};function emitEvent(_0x3d68dc){return function(_0x5dd522,_0x2d7930,_0xbe1c01){OpenchannelMessageEvents[_0x2cbb('0x6')](_0x3d68dc+':'+_0x5dd522['id'],_0x5dd522);OpenchannelMessageEvents[_0x2cbb('0x6')](_0x3d68dc,_0x5dd522);_0xbe1c01(null);};}for(var e in events){if(events[_0x2cbb('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x2cbb('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xa69d=['exports','../../mysqldb','OpenchannelMessage','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x49536b,_0x2abe5d){var _0x30de59=function(_0xb848e3){while(--_0xb848e3){_0x49536b['push'](_0x49536b['shift']());}};_0x30de59(++_0x2abe5d);}(_0xa69d,0x1b1));var _0xda69=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa69d[_0x46aff0];return _0x9d78cf;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xda69('0x0'))['db'][_0xda69('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xda69('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xda69('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4f06b8){return function(_0x22cbb4,_0x7a0901,_0x33723f){OpenchannelMessageEvents[_0xda69('0x4')](_0x4f06b8+':'+_0x22cbb4['id'],_0x22cbb4);OpenchannelMessageEvents[_0xda69('0x4')](_0x4f06b8,_0x22cbb4);_0x33723f(null);};}for(var e in events){if(events[_0xda69('0x5')](e)){var event=events[e];OpenchannelMessage[_0xda69('0x6')](e,emitEvent(event));}}module[_0xda69('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 1649361..4ff1eab 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 _0x1eba=['format','Interaction','omit','POST','replyUri','method','GET','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','toLowerCase','direction','secret','isNil','OpenchannelInteraction','then','update','createdAt','catch','error','out','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','OpenchannelInteractionId','CmContact','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate'];(function(_0x2bdb68,_0x83669a){var _0x3583e9=function(_0x46d5c8){while(--_0x46d5c8){_0x2bdb68['push'](_0x2bdb68['shift']());}};_0x3583e9(++_0x83669a);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x1eba[_0x187ee1];return _0x388160;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var logger=require(_0xa1eb('0x2'))(_0xa1eb('0x3'));var moment=require(_0xa1eb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1eb('0x5'));var rimraf=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var attributes=require(_0xa1eb('0x8'));module[_0xa1eb('0x9')]=function(_0x2933d0,_0x1d0d67){return _0x2933d0[_0xa1eb('0xa')](_0xa1eb('0xb'),attributes,{'tableName':_0xa1eb('0xc'),'paranoid':![],'indexes':[{'name':_0xa1eb('0xd'),'fields':[_0xa1eb('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ecd20,_0x4d4aaf,_0x219802){var _0x54cdad=_0x2933d0[_0xa1eb('0xf')];var _0x5d7101=_0x1ecd20[_0xa1eb('0x10')]({'plain':!![]});if(_0x5d7101['direction'][_0xa1eb('0x11')]()==='in'||_0x5d7101[_0xa1eb('0x12')][_0xa1eb('0x11')]()==='out'&&!_0x5d7101[_0xa1eb('0x13')]&&!_[_0xa1eb('0x14')](_0x5d7101['UserId'])){_0x54cdad[_0xa1eb('0x15')]['findOne']({'where':{'id':_0x5d7101['OpenchannelInteractionId']}})[_0xa1eb('0x16')](function(_0x4c7983){if(_0x4c7983){_0x4c7983[_0xa1eb('0x17')]({'lastMsgAt':_0x5d7101[_0xa1eb('0x18')],'lastMsgDirection':_0x5d7101[_0xa1eb('0x12')][_0xa1eb('0x11')]()});}})[_0xa1eb('0x19')](function(_0x44f37d){console[_0xa1eb('0x1a')](_0x44f37d);});}if(_0x5d7101[_0xa1eb('0x12')]===_0xa1eb('0x1b')&&!_0x5d7101['secret']){var _0xbd6a6b;_0x54cdad['CmContact'][_0xa1eb('0x1c')]()[_0xa1eb('0x16')](function(_0x33c4e3){return _0x54cdad[_0xa1eb('0x1d')]['find']({'where':{'id':_0x5d7101[_0xa1eb('0x1e')]},'include':[{'model':_0x54cdad[_0xa1eb('0x15')],'as':_0xa1eb('0x1f'),'where':{'id':_0x5d7101[_0xa1eb('0x20')]},'limit':0x1,'include':[{'model':_0x54cdad[_0xa1eb('0x21')],'as':_0xa1eb('0x22'),'attributes':_[_0xa1eb('0x23')](_0x33c4e3)}]}]});})[_0xa1eb('0x16')](function(_0x4fc14a){_0xbd6a6b=_0x4fc14a[_0xa1eb('0x10')]({'plain':!![]});if(_0xbd6a6b&&_0xbd6a6b['replyUri']){logger[_0xa1eb('0x24')](_0xa1eb('0x25'),_0xa1eb('0x26'),util[_0xa1eb('0x27')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x5d7101['id'],_0xbd6a6b['replyUri']));if(_0xbd6a6b[_0xa1eb('0x1f')]&&_0xbd6a6b[_0xa1eb('0x1f')]['length']){_0x5d7101[_0xa1eb('0x28')]=_[_0xa1eb('0x29')](_0xbd6a6b[_0xa1eb('0x1f')][0x0],_0xa1eb('0x22'));_0x5d7101[_0xa1eb('0x22')]=_0xbd6a6b[_0xa1eb('0x1f')][0x0][_0xa1eb('0x22')];}var _0x4d4aaf={'method':_0xa1eb('0x2a'),'uri':encodeURI(_0xbd6a6b[_0xa1eb('0x2b')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4d4aaf[_0xa1eb('0x2c')]){case _0xa1eb('0x2d'):_0x4d4aaf['qs']=_0x5d7101;break;case'POST':_0x4d4aaf[_0xa1eb('0xe')]=_0x5d7101;break;}return rp(_0x4d4aaf)[_0xa1eb('0x16')](function(_0x491f37){logger[_0xa1eb('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0xa1eb('0x26'),util[_0xa1eb('0x27')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x5d7101['id'],_0xbd6a6b[_0xa1eb('0x2b')]));if(_0x491f37[_0xa1eb('0xe')][_0xa1eb('0x2e')]&&_0x491f37['body'][_0xa1eb('0x2e')]!=_0x5d7101[_0xa1eb('0x28')]['threadId']){return _0x54cdad[_0xa1eb('0x15')][_0xa1eb('0x17')]({'threadId':_0x491f37[_0xa1eb('0xe')][_0xa1eb('0x2e')]},{'logging':!![],'where':{'id':_0x5d7101[_0xa1eb('0x28')]['id']}});}else{return;}})['then'](function(){return _0x1ecd20[_0xa1eb('0x17')]({'read':!![]});})[_0xa1eb('0x19')](function(_0x198fdb){logger[_0xa1eb('0x1a')](_0xa1eb('0x25'),_0xa1eb('0x26'),util[_0xa1eb('0x2f')](_0x198fdb,{'showHidden':![],'depth':null}));_0x219802();});}else{_0x219802();}})[_0xa1eb('0x30')](function(){_0x219802();});}else{_0x219802();}}},'charset':_0xa1eb('0x31'),'collate':_0xa1eb('0x32')});}; \ No newline at end of file +var _0x7708=['update','createdAt','catch','error','describe','OpenchannelAccount','Interactions','CmContact','Contact','replyUri','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelMessage,\x20%s,\x20%s','finally','utf8mb4_unicode_ci','lodash','util','api','rimraf','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then'];(function(_0x427648,_0x2b3a39){var _0x228429=function(_0x466e32){while(--_0x466e32){_0x427648['push'](_0x427648['shift']());}};_0x228429(++_0x2b3a39);}(_0x7708,0x188));var _0x8770=function(_0x400b43,_0x55da4e){_0x400b43=_0x400b43-0x0;var _0x3c330f=_0x7708[_0x400b43];return _0x3c330f;};'use strict';var _=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var logger=require('../../config/logger')(_0x8770('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var attributes=require('./openchannelMessage.attributes');module[_0x8770('0x5')]=function(_0x50bab7,_0x31390d){return _0x50bab7[_0x8770('0x6')](_0x8770('0x7'),attributes,{'tableName':_0x8770('0x8'),'paranoid':![],'indexes':[{'name':_0x8770('0x9'),'fields':[_0x8770('0xa')],'type':_0x8770('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4fc512,_0x396322,_0x2ca830){var _0x3f357a=_0x50bab7['models'];var _0x390af0=_0x4fc512[_0x8770('0xc')]({'plain':!![]});if(_0x390af0[_0x8770('0xd')][_0x8770('0xe')]()==='in'||_0x390af0['direction'][_0x8770('0xe')]()===_0x8770('0xf')&&!_0x390af0[_0x8770('0x10')]&&!_['isNil'](_0x390af0[_0x8770('0x11')])){_0x3f357a[_0x8770('0x12')][_0x8770('0x13')]({'where':{'id':_0x390af0[_0x8770('0x14')]}})[_0x8770('0x15')](function(_0x12a06f){if(_0x12a06f){_0x12a06f[_0x8770('0x16')]({'lastMsgAt':_0x390af0[_0x8770('0x17')],'lastMsgDirection':_0x390af0['direction'][_0x8770('0xe')]()});}})[_0x8770('0x18')](function(_0x5dd4e7){console[_0x8770('0x19')](_0x5dd4e7);});}if(_0x390af0['direction']===_0x8770('0xf')&&!_0x390af0['secret']){var _0x5b4716;_0x3f357a['CmContact'][_0x8770('0x1a')]()[_0x8770('0x15')](function(_0x17b634){return _0x3f357a[_0x8770('0x1b')]['find']({'where':{'id':_0x390af0['OpenchannelAccountId']},'include':[{'model':_0x3f357a[_0x8770('0x12')],'as':_0x8770('0x1c'),'where':{'id':_0x390af0[_0x8770('0x14')]},'limit':0x1,'include':[{'model':_0x3f357a[_0x8770('0x1d')],'as':_0x8770('0x1e'),'attributes':_['keys'](_0x17b634)}]}]});})[_0x8770('0x15')](function(_0x1234dd){_0x5b4716=_0x1234dd[_0x8770('0xc')]({'plain':!![]});if(_0x5b4716&&_0x5b4716[_0x8770('0x1f')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x8770('0x20'),util[_0x8770('0x21')](_0x8770('0x22'),_0x390af0['id'],_0x5b4716[_0x8770('0x1f')]));if(_0x5b4716[_0x8770('0x1c')]&&_0x5b4716[_0x8770('0x1c')]['length']){_0x390af0[_0x8770('0x23')]=_[_0x8770('0x24')](_0x5b4716[_0x8770('0x1c')][0x0],_0x8770('0x1e'));_0x390af0['Contact']=_0x5b4716[_0x8770('0x1c')][0x0]['Contact'];}var _0x396322={'method':_0x8770('0x25'),'uri':encodeURI(_0x5b4716[_0x8770('0x1f')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x396322[_0x8770('0x26')]){case _0x8770('0x27'):_0x396322['qs']=_0x390af0;break;case _0x8770('0x25'):_0x396322[_0x8770('0xa')]=_0x390af0;break;}return rp(_0x396322)[_0x8770('0x15')](function(_0xb3f4aa){logger[_0x8770('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x8770('0x20'),util[_0x8770('0x21')](_0x8770('0x29'),_0x390af0['id'],_0x5b4716[_0x8770('0x1f')]));if(_0xb3f4aa[_0x8770('0xa')][_0x8770('0x2a')]&&_0xb3f4aa['body']['threadId']!=_0x390af0[_0x8770('0x23')][_0x8770('0x2a')]){return _0x3f357a[_0x8770('0x12')][_0x8770('0x16')]({'threadId':_0xb3f4aa[_0x8770('0xa')]['threadId']},{'logging':!![],'where':{'id':_0x390af0['Interaction']['id']}});}else{return;}})[_0x8770('0x15')](function(){return _0x4fc512[_0x8770('0x16')]({'read':!![]});})[_0x8770('0x18')](function(_0x2c2c77){logger['error'](_0x8770('0x2b'),'afterCreate',util['inspect'](_0x2c2c77,{'showHidden':![],'depth':null}));_0x2ca830();});}else{_0x2ca830();}})[_0x8770('0x2c')](function(){_0x2ca830();});}else{_0x2ca830();}}},'charset':'utf8mb4','collate':_0x8770('0x2d')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index e79e705..6f01e04 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 _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xeedfe1,_0x43e9f1){var _0x2ffe1c=function(_0x3dc6ba){while(--_0x3dc6ba){_0xeedfe1['push'](_0xeedfe1['shift']());}};_0x2ffe1c(++_0x43e9f1);}(_0x7a54,0x106));var _0x47a5=function(_0x478710,_0x276269){_0x478710=_0x478710-0x0;var _0x383288=_0x7a54[_0x478710];return _0x383288;};'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});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x40ce36,_0x2fdf37){var _0x75c2f8=function(_0x23e58f){while(--_0x23e58f){_0x40ce36['push'](_0x40ce36['shift']());}};_0x75c2f8(++_0x2fdf37);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index b2882fd..73b0f21 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 _0xdace=['openchannelMessage:','save','emit','removeListener','register','length'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0xdace,0xc1));var _0xedac=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0xdace[_0x1ca9e9];return _0x309f3c;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xedac('0x0'),'remove','update'];function createListener(_0x57b4f2,_0x548605){return function(_0x1736f9){_0x548605[_0xedac('0x1')](_0x57b4f2,_0x1736f9);};}function removeListener(_0x242ef0,_0x5d347f){return function(){OpenchannelMessageEvents[_0xedac('0x2')](_0x242ef0,_0x5d347f);};}exports[_0xedac('0x3')]=function(_0x400b3b){for(var _0x35db54=0x0,_0x205d95=events[_0xedac('0x4')];_0x35db54<_0x205d95;_0x35db54++){var _0x2ac06c=events[_0x35db54];var _0x4fcba9=createListener(_0xedac('0x5')+_0x2ac06c,_0x400b3b);OpenchannelMessageEvents['on'](_0x2ac06c,_0x4fcba9);}}; \ No newline at end of file +var _0x6dba=['emit','removeListener','length','openchannelMessage:','./openchannelMessage.events','save','remove','update'];(function(_0x4d1556,_0x45b703){var _0x11503c=function(_0x57a6a3){while(--_0x57a6a3){_0x4d1556['push'](_0x4d1556['shift']());}};_0x11503c(++_0x45b703);}(_0x6dba,0x13c));var _0xa6db=function(_0x3f9c5d,_0x283784){_0x3f9c5d=_0x3f9c5d-0x0;var _0x2f2c73=_0x6dba[_0x3f9c5d];return _0x2f2c73;};'use strict';var OpenchannelMessageEvents=require(_0xa6db('0x0'));var events=[_0xa6db('0x1'),_0xa6db('0x2'),_0xa6db('0x3')];function createListener(_0x42330d,_0x415569){return function(_0x2666ec){_0x415569[_0xa6db('0x4')](_0x42330d,_0x2666ec);};}function removeListener(_0x56ba78,_0xf09ca4){return function(){OpenchannelMessageEvents[_0xa6db('0x5')](_0x56ba78,_0xf09ca4);};}exports['register']=function(_0x5b2799){for(var _0x3e1f92=0x0,_0x59c6d1=events[_0xa6db('0x6')];_0x3e1f92<_0x59c6d1;_0x3e1f92++){var _0x5dee9c=events[_0x3e1f92];var _0x479aca=createListener(_0xa6db('0x7')+_0x5dee9c,_0x5b2799);OpenchannelMessageEvents['on'](_0x5dee9c,_0x479aca);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 4e1d0dc..074fe4d 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 _0xdc6c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','index','/describe','isAuthenticated','describe','get','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','put','/:id','update','delete','destroy','/:id/users','removeAgents','exports','multer','util','path'];(function(_0xdd689,_0x1e4341){var _0x5c8e16=function(_0x134575){while(--_0x134575){_0xdd689['push'](_0xdd689['shift']());}};_0x5c8e16(++_0x1e4341);}(_0xdc6c,0x171));var _0xcdc6=function(_0x1c34e7,_0x33f9a8){_0x1c34e7=_0x1c34e7-0x0;var _0x378cb1=_0xdc6c[_0x1c34e7];return _0x378cb1;};'use strict';var multer=require(_0xcdc6('0x0'));var util=require(_0xcdc6('0x1'));var path=require(_0xcdc6('0x2'));var timeout=require(_0xcdc6('0x3'));var express=require(_0xcdc6('0x4'));var router=express[_0xcdc6('0x5')]();var fs_extra=require(_0xcdc6('0x6'));var auth=require(_0xcdc6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcdc6('0x8'));var controller=require(_0xcdc6('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xcdc6('0xa')]);router['get'](_0xcdc6('0xb'),auth[_0xcdc6('0xc')](),controller[_0xcdc6('0xd')]);router[_0xcdc6('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xcdc6('0xf')]);router[_0xcdc6('0xe')](_0xcdc6('0x10'),auth[_0xcdc6('0xc')](),controller[_0xcdc6('0x11')]);router[_0xcdc6('0xe')](_0xcdc6('0x12'),auth[_0xcdc6('0xc')](),controller[_0xcdc6('0x13')]);router[_0xcdc6('0xe')]('/:id/users',auth['isAuthenticated'](),controller[_0xcdc6('0x14')]);router[_0xcdc6('0x15')]('/',auth[_0xcdc6('0xc')](),controller[_0xcdc6('0x16')]);router[_0xcdc6('0x15')](_0xcdc6('0x12'),auth[_0xcdc6('0xc')](),controller['addTeams']);router[_0xcdc6('0x15')]('/:id/users',auth[_0xcdc6('0xc')](),controller['addAgents']);router[_0xcdc6('0x17')](_0xcdc6('0x18'),auth[_0xcdc6('0xc')](),controller[_0xcdc6('0x19')]);router[_0xcdc6('0x1a')](_0xcdc6('0x18'),auth[_0xcdc6('0xc')](),controller[_0xcdc6('0x1b')]);router[_0xcdc6('0x1a')](_0xcdc6('0x12'),auth[_0xcdc6('0xc')](),controller['removeTeams']);router[_0xcdc6('0x1a')](_0xcdc6('0x1c'),auth['isAuthenticated'](),controller[_0xcdc6('0x1d')]);module[_0xcdc6('0x1e')]=router; \ No newline at end of file +var _0x4640=['index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addAgents','put','/:id','delete','removeTeams','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated'];(function(_0x44af92,_0x194173){var _0x1b4b42=function(_0xa584cb){while(--_0xa584cb){_0x44af92['push'](_0x44af92['shift']());}};_0x1b4b42(++_0x194173);}(_0x4640,0x16e));var _0x0464=function(_0x100e04,_0x2070aa){_0x100e04=_0x100e04-0x0;var _0xeee5e7=_0x4640[_0x100e04];return _0xeee5e7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0464('0x0'));var timeout=require(_0x0464('0x1'));var express=require(_0x0464('0x2'));var router=express[_0x0464('0x3')]();var fs_extra=require(_0x0464('0x4'));var auth=require(_0x0464('0x5'));var interaction=require(_0x0464('0x6'));var config=require(_0x0464('0x7'));var controller=require(_0x0464('0x8'));router[_0x0464('0x9')]('/',auth[_0x0464('0xa')](),controller[_0x0464('0xb')]);router[_0x0464('0x9')](_0x0464('0xc'),auth[_0x0464('0xa')](),controller[_0x0464('0xd')]);router['get']('/:id',auth[_0x0464('0xa')](),controller[_0x0464('0xe')]);router[_0x0464('0x9')](_0x0464('0xf'),auth[_0x0464('0xa')](),controller[_0x0464('0x10')]);router[_0x0464('0x9')](_0x0464('0x11'),auth[_0x0464('0xa')](),controller[_0x0464('0x12')]);router[_0x0464('0x9')](_0x0464('0x13'),auth[_0x0464('0xa')](),controller['getAgents']);router['post']('/',auth[_0x0464('0xa')](),controller[_0x0464('0x14')]);router[_0x0464('0x15')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x0464('0x15')](_0x0464('0x13'),auth[_0x0464('0xa')](),controller[_0x0464('0x16')]);router[_0x0464('0x17')](_0x0464('0x18'),auth[_0x0464('0xa')](),controller['update']);router[_0x0464('0x19')](_0x0464('0x18'),auth[_0x0464('0xa')](),controller['destroy']);router['delete'](_0x0464('0x11'),auth['isAuthenticated'](),controller[_0x0464('0x1a')]);router[_0x0464('0x19')](_0x0464('0x13'),auth[_0x0464('0xa')](),controller[_0x0464('0x1b')]);module[_0x0464('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 1cb34cc..e9f48a3 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 _0xbd99=['ENUM','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0xa28b1a,_0x384f4b){var _0x4c9b78=function(_0x3cf640){while(--_0x3cf640){_0xa28b1a['push'](_0xa28b1a['shift']());}};_0x4c9b78(++_0x384f4b);}(_0xbd99,0x10b));var _0x9bd9=function(_0x46cb32,_0x181aab){_0x46cb32=_0x46cb32-0x0;var _0x1f736a=_0xbd99[_0x46cb32];return _0x1f736a;};'use strict';var Sequelize=require(_0x9bd9('0x0'));module[_0x9bd9('0x1')]={'name':{'type':Sequelize[_0x9bd9('0x2')],'unique':_0x9bd9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9bd9('0x2')]},'timeout':{'type':Sequelize[_0x9bd9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9bd9('0x5')]('rrmemory',_0x9bd9('0x6'),_0x9bd9('0x7'))}}; \ No newline at end of file +var _0x8f8e=['STRING','ENUM','rrmemory','beepall','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8f8e,0x12a));var _0xe8f8=function(_0x4e4519,_0x392ae){_0x4e4519=_0x4e4519-0x0;var _0x340044=_0x8f8e[_0x4e4519];return _0x340044;};'use strict';var Sequelize=require(_0xe8f8('0x0'));module[_0xe8f8('0x1')]={'name':{'type':Sequelize[_0xe8f8('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe8f8('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe8f8('0x3')](_0xe8f8('0x4'),_0xe8f8('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 16adc70..d5b855c 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 _0x3331=['map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','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','update','params','destroy','describe','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','format','createdAt','getTeams','Team','pick','hasOwnProperty','addTeams','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','select','tq.TeamId','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','TeamId','includes','all','value','isEmpty','removeAgents','addAgents','omit','spread','userOpenchannelQueue:save','isArray','userOpenchannelQueue:remove','getAgents','findOne','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','OpenchannelQueues','UserProfileResource','error','name','send','index'];(function(_0x46a3e1,_0x202256){var _0x4d3008=function(_0x3467aa){while(--_0x3467aa){_0x46a3e1['push'](_0x46a3e1['shift']());}};_0x4d3008(++_0x202256);}(_0x3331,0x185));var _0x1333=function(_0xa4b09e,_0x26b2ef){_0xa4b09e=_0xa4b09e-0x0;var _0x5637a3=_0x3331[_0xa4b09e];return _0x5637a3;};'use strict';var emlformat=require(_0x1333('0x0'));var rimraf=require(_0x1333('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1333('0x2'));var rp=require(_0x1333('0x3'));var moment=require('moment');var BPromise=require(_0x1333('0x4'));var Mustache=require(_0x1333('0x5'));var util=require(_0x1333('0x6'));var path=require('path');var sox=require(_0x1333('0x7'));var csv=require(_0x1333('0x8'));var ejs=require(_0x1333('0x9'));var fs=require('fs');var fs_extra=require(_0x1333('0xa'));var _=require(_0x1333('0xb'));var squel=require(_0x1333('0xc'));var crypto=require(_0x1333('0xd'));var jsforce=require(_0x1333('0xe'));var deskjs=require(_0x1333('0xf'));var toCsv=require(_0x1333('0x8'));var querystring=require(_0x1333('0x10'));var Papa=require(_0x1333('0x11'));var Redis=require(_0x1333('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1333('0x13'));var hardwareService=require(_0x1333('0x14'));var logger=require(_0x1333('0x15'))(_0x1333('0x16'));var utils=require('../../config/utils');var config=require(_0x1333('0x17'));var licenseUtil=require(_0x1333('0x18'));var db=require(_0x1333('0x19'))['db'];config[_0x1333('0x1a')]=_['defaults'](config[_0x1333('0x1a')],{'host':_0x1333('0x1b'),'port':0x18eb});var socket=require(_0x1333('0x1c'))(new Redis(config[_0x1333('0x1a')]));require(_0x1333('0x1d'))[_0x1333('0x1e')](socket);function respondWithStatusCode(_0xe46dfa,_0x1dd4b1){_0x1dd4b1=_0x1dd4b1||0xcc;return function(_0x20be4f){if(_0x20be4f){return _0xe46dfa[_0x1333('0x1f')](_0x1dd4b1);}return _0xe46dfa[_0x1333('0x20')](_0x1dd4b1)[_0x1333('0x21')]();};}function respondWithResult(_0xd51b53,_0x3b623e){_0x3b623e=_0x3b623e||0xc8;return function(_0x4be89e){if(_0x4be89e){return _0xd51b53['status'](_0x3b623e)[_0x1333('0x22')](_0x4be89e);}};}function respondWithFilteredResult(_0x3f01ce,_0x337b26){return function(_0x494a57){if(_0x494a57){var _0x2bca72=typeof _0x337b26[_0x1333('0x23')]===_0x1333('0x24')&&typeof _0x337b26[_0x1333('0x25')]===_0x1333('0x24');var _0x370aae=_0x494a57['count'];var _0x50ee15=_0x2bca72?0x0:_0x337b26['offset'];var _0x315121=_0x2bca72?_0x494a57[_0x1333('0x26')]:_0x337b26[_0x1333('0x23')]+_0x337b26[_0x1333('0x25')];var _0x52401f;if(_0x315121>=_0x370aae){_0x315121=_0x370aae;_0x52401f=0xc8;}else{_0x52401f=0xce;}_0x3f01ce[_0x1333('0x20')](_0x52401f);return _0x3f01ce[_0x1333('0x27')](_0x1333('0x28'),_0x50ee15+'-'+_0x315121+'/'+_0x370aae)[_0x1333('0x22')](_0x494a57);}return null;};}function patchUpdates(_0x1794bc){return function(_0x320c37){try{jsonpatch[_0x1333('0x29')](_0x320c37,_0x1794bc,!![]);}catch(_0x2480dd){return BPromise[_0x1333('0x2a')](_0x2480dd);}return _0x320c37[_0x1333('0x2b')]();};}function saveUpdates(_0x632205,_0x30b248){return function(_0x23ea76){if(_0x23ea76){return _0x23ea76['update'](_0x632205)[_0x1333('0x2c')](function(_0xa3d6cf){return _0xa3d6cf;});}return null;};}function removeEntity(_0x1831f7,_0xdbcb02){return function(_0x3964f5){if(_0x3964f5){return _0x3964f5['destroy']()['then'](function(){var _0x4ef494=_0x3964f5[_0x1333('0x2d')]({'plain':!![]});var _0x42669c=_0x1333('0x2e');return db[_0x1333('0x2f')]['destroy']({'where':{'type':_0x42669c,'resourceId':_0x4ef494['id']}})[_0x1333('0x2c')](function(){return _0x3964f5;});})[_0x1333('0x2c')](function(){_0x1831f7['status'](0xcc)[_0x1333('0x21')]();});}};}function handleEntityNotFound(_0x506c2f,_0x53477c){return function(_0x3c886c){if(!_0x3c886c){_0x506c2f['sendStatus'](0x194);}return _0x3c886c;};}function handleError(_0x54a77e,_0x8ecad6){_0x8ecad6=_0x8ecad6||0x1f4;return function(_0x554027){logger[_0x1333('0x30')](_0x554027['stack']);if(_0x554027[_0x1333('0x31')]){delete _0x554027['name'];}_0x54a77e[_0x1333('0x20')](_0x8ecad6)[_0x1333('0x32')](_0x554027);};}exports[_0x1333('0x33')]=function(_0x2f4238,_0x308955){var _0xefdd8={},_0x4c06b3={},_0x21882e={'count':0x0,'rows':[]};var _0x357cd1=_[_0x1333('0x34')](db[_0x1333('0x35')][_0x1333('0x36')],function(_0x109e40){return{'name':_0x109e40[_0x1333('0x37')],'type':_0x109e40[_0x1333('0x38')][_0x1333('0x39')]};});_0x4c06b3[_0x1333('0x3a')]=_[_0x1333('0x34')](_0x357cd1,_0x1333('0x31'));_0x4c06b3[_0x1333('0x3b')]=_[_0x1333('0x3c')](_0x2f4238[_0x1333('0x3b')]);_0x4c06b3['filters']=_['intersection'](_0x4c06b3[_0x1333('0x3a')],_0x4c06b3[_0x1333('0x3b')]);_0xefdd8[_0x1333('0x3d')]=_[_0x1333('0x3e')](_0x4c06b3['model'],qs[_0x1333('0x3f')](_0x2f4238['query'][_0x1333('0x3f')]));_0xefdd8[_0x1333('0x3d')]=_0xefdd8[_0x1333('0x3d')][_0x1333('0x40')]?_0xefdd8[_0x1333('0x3d')]:_0x4c06b3[_0x1333('0x3a')];if(!_0x2f4238[_0x1333('0x3b')]['hasOwnProperty'](_0x1333('0x41'))){_0xefdd8[_0x1333('0x25')]=qs[_0x1333('0x25')](_0x2f4238[_0x1333('0x3b')][_0x1333('0x25')]);_0xefdd8['offset']=qs[_0x1333('0x23')](_0x2f4238[_0x1333('0x3b')][_0x1333('0x23')]);}_0xefdd8[_0x1333('0x42')]=qs[_0x1333('0x43')](_0x2f4238[_0x1333('0x3b')]['sort']);_0xefdd8[_0x1333('0x44')]=qs[_0x1333('0x45')](_['pick'](_0x2f4238[_0x1333('0x3b')],_0x4c06b3[_0x1333('0x45')]),_0x357cd1);if(_0x2f4238[_0x1333('0x3b')]['filter']){_0xefdd8['where']=_['merge'](_0xefdd8[_0x1333('0x44')],{'$or':_[_0x1333('0x34')](_0x357cd1,function(_0x45b6aa){if(_0x45b6aa['type']!==_0x1333('0x46')){var _0x5e4ebb={};_0x5e4ebb[_0x45b6aa[_0x1333('0x31')]]={'$like':'%'+_0x2f4238[_0x1333('0x3b')][_0x1333('0x47')]+'%'};return _0x5e4ebb;}})});}_0xefdd8=_[_0x1333('0x48')]({},_0xefdd8,_0x2f4238[_0x1333('0x49')]);var _0x3b78c3={'where':_0xefdd8[_0x1333('0x44')]};return db[_0x1333('0x35')][_0x1333('0x26')](_0x3b78c3)['then'](function(_0x8de558){_0x21882e[_0x1333('0x26')]=_0x8de558;if(_0x2f4238[_0x1333('0x3b')][_0x1333('0x4a')]){_0xefdd8[_0x1333('0x4b')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x1333('0x4c')](_0xefdd8);})['then'](function(_0x3e4418){_0x21882e[_0x1333('0x4d')]=_0x3e4418;return _0x21882e;})[_0x1333('0x2c')](respondWithFilteredResult(_0x308955,_0xefdd8))[_0x1333('0x4e')](handleError(_0x308955,null));};exports[_0x1333('0x4f')]=function(_0x22c0a6,_0x46d75a){var _0x467535={'raw':!![],'where':{'id':_0x22c0a6['params']['id']}},_0x5b3543={};_0x5b3543[_0x1333('0x3a')]=_[_0x1333('0x3c')](db[_0x1333('0x35')][_0x1333('0x36')]);_0x5b3543[_0x1333('0x3b')]=_[_0x1333('0x3c')](_0x22c0a6['query']);_0x5b3543[_0x1333('0x45')]=_[_0x1333('0x3e')](_0x5b3543['model'],_0x5b3543[_0x1333('0x3b')]);_0x467535[_0x1333('0x3d')]=_['intersection'](_0x5b3543[_0x1333('0x3a')],qs['fields'](_0x22c0a6[_0x1333('0x3b')][_0x1333('0x3f')]));_0x467535[_0x1333('0x3d')]=_0x467535[_0x1333('0x3d')][_0x1333('0x40')]?_0x467535[_0x1333('0x3d')]:_0x5b3543[_0x1333('0x3a')];if(_0x22c0a6[_0x1333('0x3b')][_0x1333('0x4a')]){_0x467535[_0x1333('0x4b')]=[{'all':!![]}];}_0x467535=_['merge']({},_0x467535,_0x22c0a6[_0x1333('0x49')]);return db[_0x1333('0x35')][_0x1333('0x50')](_0x467535)[_0x1333('0x2c')](handleEntityNotFound(_0x46d75a,null))[_0x1333('0x2c')](respondWithResult(_0x46d75a,null))[_0x1333('0x4e')](handleError(_0x46d75a,null));};exports['create']=function(_0x1859fa,_0x4ccf0b){return db[_0x1333('0x35')][_0x1333('0x51')](_0x1859fa[_0x1333('0x52')],{})[_0x1333('0x2c')](function(_0x1c06fa){var _0x3fbb3d=_0x1859fa[_0x1333('0x53')][_0x1333('0x2d')]({'plain':!![]});if(!_0x3fbb3d)throw new Error(_0x1333('0x54'));if(_0x3fbb3d[_0x1333('0x55')]==='user'){var _0x31783e=_0x1c06fa[_0x1333('0x2d')]({'plain':!![]});var _0x27e5b9=_0x1333('0x2e');return db[_0x1333('0x56')][_0x1333('0x50')]({'where':{'name':_0x27e5b9,'userProfileId':_0x3fbb3d[_0x1333('0x57')]},'raw':!![]})[_0x1333('0x2c')](function(_0x1727aa){if(_0x1727aa&&_0x1727aa[_0x1333('0x58')]===0x0){return db[_0x1333('0x2f')][_0x1333('0x51')]({'name':_0x31783e['name'],'resourceId':_0x31783e['id'],'type':_0x1727aa['name'],'sectionId':_0x1727aa['id']},{})[_0x1333('0x2c')](function(){return _0x1c06fa;});}else{return _0x1c06fa;}})['catch'](function(_0x560587){logger[_0x1333('0x30')](_0x1333('0x59'),_0x560587);throw _0x560587;});}return _0x1c06fa;})[_0x1333('0x2c')](respondWithResult(_0x4ccf0b,0xc9))[_0x1333('0x4e')](handleError(_0x4ccf0b,null));};exports[_0x1333('0x5a')]=function(_0x4a75fb,_0x4f5c47){if(_0x4a75fb['body']['id']){delete _0x4a75fb[_0x1333('0x52')]['id'];}return db[_0x1333('0x35')]['find']({'where':{'id':_0x4a75fb[_0x1333('0x5b')]['id']}})[_0x1333('0x2c')](handleEntityNotFound(_0x4f5c47,null))['then'](saveUpdates(_0x4a75fb['body'],null))[_0x1333('0x2c')](respondWithResult(_0x4f5c47,null))[_0x1333('0x4e')](handleError(_0x4f5c47,null));};exports[_0x1333('0x5c')]=function(_0x17df6c,_0x37245f){return db['OpenchannelQueue'][_0x1333('0x50')]({'where':{'id':_0x17df6c[_0x1333('0x5b')]['id']}})[_0x1333('0x2c')](handleEntityNotFound(_0x37245f,null))[_0x1333('0x2c')](removeEntity(_0x37245f,null))[_0x1333('0x4e')](handleError(_0x37245f,null));};exports[_0x1333('0x5d')]=function(_0x537858,_0x1e13a8){return db['OpenchannelQueue'][_0x1333('0x5d')]()['then'](respondWithResult(_0x1e13a8,null))['catch'](handleError(_0x1e13a8,null));};exports['getMembers']=function(_0xe7ed71,_0x4fbe7b,_0x9cda78){var _0x37d273={'raw':!![],'where':{}},_0x195f4e={},_0x1cc8e7;return db['OpenchannelQueue']['findOne']({'where':{'id':_0xe7ed71[_0x1333('0x5b')]['id']}})[_0x1333('0x2c')](handleEntityNotFound(_0x4fbe7b,null))[_0x1333('0x2c')](function(_0x32ffaa){if(_0x32ffaa){_0x1cc8e7=_0x32ffaa['get']({'plain':!![]});_0x195f4e['model']=_[_0x1333('0x3c')](db[_0x1333('0x5e')]['rawAttributes']);_0x195f4e[_0x1333('0x3b')]=_[_0x1333('0x3c')](_0xe7ed71[_0x1333('0x3b')]);_0x195f4e[_0x1333('0x45')]=_[_0x1333('0x3e')](_0x195f4e['model'],_0x195f4e[_0x1333('0x3b')]);_0x37d273['attributes']=_[_0x1333('0x3e')](_0x195f4e['model'],qs['fields'](_0xe7ed71[_0x1333('0x3b')][_0x1333('0x3f')]));_0x37d273[_0x1333('0x3d')]=_0x37d273[_0x1333('0x3d')][_0x1333('0x40')]?_0x37d273[_0x1333('0x3d')]:_0x195f4e['model'];if(!_0xe7ed71['query']['hasOwnProperty']('nolimit')){_0x37d273[_0x1333('0x25')]=qs[_0x1333('0x25')](_0xe7ed71[_0x1333('0x3b')][_0x1333('0x25')]);_0x37d273['offset']=qs[_0x1333('0x23')](_0xe7ed71[_0x1333('0x3b')][_0x1333('0x23')]);}_0x37d273[_0x1333('0x42')]=qs[_0x1333('0x43')](_0xe7ed71[_0x1333('0x3b')][_0x1333('0x43')]);_0x37d273[_0x1333('0x44')]=qs[_0x1333('0x45')](_['pick'](_0xe7ed71[_0x1333('0x3b')],_0x195f4e[_0x1333('0x45')]));_0x37d273[_0x1333('0x44')][_0x1333('0x5f')]=_0x32ffaa['id'];if(_0xe7ed71[_0x1333('0x3b')][_0x1333('0x47')]){_0x37d273[_0x1333('0x44')]=_['merge'](_0x37d273[_0x1333('0x44')],{'$or':_[_0x1333('0x34')](_0x37d273[_0x1333('0x3d')],function(_0x74b78){var _0x139e05={};_0x139e05[_0x74b78]={'$like':'%'+_0xe7ed71[_0x1333('0x3b')][_0x1333('0x47')]+'%'};return _0x139e05;})});}_0x37d273=_[_0x1333('0x48')]({},_0x37d273,_0xe7ed71[_0x1333('0x49')]);return db[_0x1333('0x5e')][_0x1333('0x4c')](_0x37d273);}})['then'](function(_0x2cddb4){if(_0x2cddb4){return db[_0x1333('0x60')][_0x1333('0x61')]({'where':{'id':_[_0x1333('0x34')](_0x2cddb4,_0x1333('0x62')),'role':_0x1333('0x63')},'attributes':['id',_0x1333('0x31'),_0x1333('0x64'),_0x1333('0x65'),'createdAt']});}})[_0x1333('0x2c')](function(_0x5ab7c9){if(_0x5ab7c9){return{'count':_0x5ab7c9['count'],'rows':_[_0x1333('0x34')](_0x5ab7c9[_0x1333('0x4d')],function(_0x36330f){return{'membername':_0x36330f[_0x1333('0x31')],'UserId':_0x36330f['id'],'queue_name':_0x1cc8e7[_0x1333('0x31')],'OpenchannelQueueId':_0x1cc8e7['id'],'interface':util[_0x1333('0x66')]('%s/%s','SIP',_0x36330f[_0x1333('0x31')]),'penalty':0x0,'paused':_0x36330f[_0x1333('0x64')],'createdAt':_0x36330f[_0x1333('0x67')],'updatedAt':_0x36330f[_0x1333('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1333('0x2c')](respondWithFilteredResult(_0x4fbe7b,_0x37d273))[_0x1333('0x4e')](handleError(_0x4fbe7b,null));};exports[_0x1333('0x68')]=function(_0x3a9ee0,_0x213b5d,_0x17b501){var _0x224d0b={};var _0x5ddfdd={};var _0x721d69;var _0x546ff5;return db[_0x1333('0x35')]['findOne']({'where':{'id':_0x3a9ee0['params']['id']}})[_0x1333('0x2c')](handleEntityNotFound(_0x213b5d,null))[_0x1333('0x2c')](function(_0x488036){if(_0x488036){_0x721d69=_0x488036;_0x5ddfdd[_0x1333('0x3a')]=_['keys'](db[_0x1333('0x69')][_0x1333('0x36')]);_0x5ddfdd['query']=_[_0x1333('0x3c')](_0x3a9ee0[_0x1333('0x3b')]);_0x5ddfdd[_0x1333('0x45')]=_['intersection'](_0x5ddfdd[_0x1333('0x3a')],_0x5ddfdd[_0x1333('0x3b')]);_0x224d0b['attributes']=_['intersection'](_0x5ddfdd['model'],qs[_0x1333('0x3f')](_0x3a9ee0[_0x1333('0x3b')][_0x1333('0x3f')]));_0x224d0b['attributes']=_0x224d0b['attributes'][_0x1333('0x40')]?_0x224d0b[_0x1333('0x3d')]:_0x5ddfdd[_0x1333('0x3a')];_0x224d0b[_0x1333('0x42')]=qs[_0x1333('0x43')](_0x3a9ee0['query'][_0x1333('0x43')]);_0x224d0b['where']=qs[_0x1333('0x45')](_[_0x1333('0x6a')](_0x3a9ee0[_0x1333('0x3b')],_0x5ddfdd[_0x1333('0x45')]));if(_0x3a9ee0[_0x1333('0x3b')][_0x1333('0x47')]){_0x224d0b['where']=_['merge'](_0x224d0b[_0x1333('0x44')],{'$or':_['map'](_0x224d0b[_0x1333('0x3d')],function(_0x589cef){var _0x13af67={};_0x13af67[_0x589cef]={'$like':'%'+_0x3a9ee0[_0x1333('0x3b')][_0x1333('0x47')]+'%'};return _0x13af67;})});}_0x224d0b=_[_0x1333('0x48')]({},_0x224d0b,_0x3a9ee0[_0x1333('0x49')]);return _0x721d69['getTeams'](_0x224d0b);}})[_0x1333('0x2c')](function(_0x51e13a){if(_0x51e13a){_0x546ff5=_0x51e13a[_0x1333('0x40')];if(!_0x3a9ee0['query'][_0x1333('0x6b')]('nolimit')){_0x224d0b['limit']=qs[_0x1333('0x25')](_0x3a9ee0['query']['limit']);_0x224d0b[_0x1333('0x23')]=qs[_0x1333('0x23')](_0x3a9ee0[_0x1333('0x3b')][_0x1333('0x23')]);}return _0x721d69[_0x1333('0x68')](_0x224d0b);}})[_0x1333('0x2c')](function(_0x3207a6){if(_0x3207a6){return _0x3207a6?{'count':_0x546ff5,'rows':_0x3207a6}:null;}})[_0x1333('0x2c')](respondWithResult(_0x213b5d,null))['catch'](handleError(_0x213b5d,null));};exports[_0x1333('0x6c')]=function(_0x5158ce,_0x4030cd,_0x2d2a22){var _0xfae02c=_0x5158ce[_0x1333('0x52')]['ids'];return db[_0x1333('0x69')]['findAll']({'where':{'id':_0xfae02c},'attributes':['id'],'include':[{'model':db[_0x1333('0x60')],'as':'Agents','attributes':['id',_0x1333('0x31'),_0x1333('0x6d'),_0x1333('0x6e'),_0x1333('0x6f')],'raw':!![]}]})['then'](function(_0x1734c6){if(_0x1734c6){var _0x316da2=_[_0x1333('0x70')](_0x1734c6,function(_0x5f0bb0){var _0x178aed=_0x5f0bb0[_0x1333('0x2d')]({'plain':!![]});return _0x178aed[_0x1333('0x71')];});return db[_0x1333('0x35')][_0x1333('0x50')]({'where':{'id':_0x5158ce[_0x1333('0x5b')]['id']}})[_0x1333('0x2c')](function(_0x289c38){return db['sequelize'][_0x1333('0x72')](function(_0x1b3cd7){return _0x289c38[_0x1333('0x6c')](_0xfae02c,{'transaction':_0x1b3cd7})[_0x1333('0x2c')](function(){return BPromise[_0x1333('0x73')](_0x316da2,function(_0xc609af){return db[_0x1333('0x5e')][_0x1333('0x74')]({'where':{'UserId':_0xc609af['id'],'OpenchannelQueueId':_0x5158ce['params']['id']},'transaction':_0x1b3cd7});});})['then'](function(){_0x316da2[_0x1333('0x75')](function(_0x45eb91){socket[_0x1333('0x76')]('userOpenchannelQueue:save',{'UserId':_0x45eb91['id'],'OpenchannelQueueId':_0x289c38['id']});});});});});}})[_0x1333('0x2c')](respondWithStatusCode(_0x4030cd,null))['catch'](handleError(_0x4030cd,null));};exports[_0x1333('0x77')]=function(_0x5df7af,_0x2caa93,_0x1ed642){return db[_0x1333('0x69')][_0x1333('0x4c')]({'where':{'id':_0x5df7af[_0x1333('0x3b')][_0x1333('0x78')]},'attributes':['id'],'include':[{'model':db[_0x1333('0x60')],'as':_0x1333('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2caa93,null))[_0x1333('0x2c')](function(_0x4e568f){var _0x3f88df=_[_0x1333('0x34')](_0x4e568f,'id');var _0x2a2f46=[];var _0x559c0d=[];var _0x3fdb96=squel[_0x1333('0x79')]();_0x3fdb96['field'](_0x1333('0x7a'))['from']('team_has_openchannel_queues','tq')[_0x1333('0x7b')](_0x1333('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x1333('0x44')](_0x1333('0x7d'),_0x5df7af[_0x1333('0x5b')]['id']);for(var _0x526aa7=0x0;_0x526aa7<_0x4e568f[_0x1333('0x40')];_0x526aa7+=0x1){let _0x24d1e7=_0x4e568f[_0x526aa7];for(var _0xb583f1=0x0;_0xb583f1<_0x24d1e7[_0x1333('0x71')]['length'];_0xb583f1+=0x1){let _0x4f1e53=_0x24d1e7[_0x1333('0x71')][_0xb583f1];var _0x1cfad2=_0x3fdb96[_0x1333('0x7e')]();_0x1cfad2['where'](_0x1333('0x7f'),_0x4f1e53['id']);_0x559c0d[_0x1333('0x80')](db['sequelize'][_0x1333('0x3b')](_0x1cfad2[_0x1333('0x81')](),{'type':db[_0x1333('0x82')][_0x1333('0x83')][_0x1333('0x84')]})[_0x1333('0x2c')](function(_0xf3a1de){if(_0xf3a1de['length']===0x1){return _0x4f1e53['id'];}else{var _0x293384=_['every'](_[_0x1333('0x34')](_0xf3a1de,_0x1333('0x85')),function(_0x6dac88){return _[_0x1333('0x86')](_0x3f88df,_0x6dac88);});if(_0x293384){return _0x4f1e53['id'];}}}));}}return BPromise[_0x1333('0x87')](_0x559c0d)[_0x1333('0x2c')](function(_0x5ed8c2){_0x2a2f46=_(_0x2a2f46)['union'](_0x5ed8c2)['compact']()[_0x1333('0x88')]();return db[_0x1333('0x35')][_0x1333('0x50')]({'where':{'id':_0x5df7af[_0x1333('0x5b')]['id']}})[_0x1333('0x2c')](function(_0x259001){return db[_0x1333('0x82')]['transaction'](function(_0x3ef96c){return _0x259001['removeTeams'](_0x5df7af['query']['ids'],{'transaction':_0x3ef96c})[_0x1333('0x2c')](function(){if(!_[_0x1333('0x89')](_0x2a2f46)){return _0x259001[_0x1333('0x8a')](_0x2a2f46,{'transaction':_0x3ef96c});}})[_0x1333('0x2c')](function(){_0x2a2f46['forEach'](function(_0x4ebbe0){socket[_0x1333('0x76')]('userOpenchannelQueue:remove',{'UserId':_0x4ebbe0,'OpenchannelQueueId':_0x259001['id']});});});});});});})[_0x1333('0x2c')](respondWithStatusCode(_0x2caa93,null))[_0x1333('0x4e')](handleError(_0x2caa93,null));};exports[_0x1333('0x8b')]=function(_0x26056b,_0xd049d3,_0x5811c4){return db[_0x1333('0x35')][_0x1333('0x50')]({'where':{'id':_0x26056b[_0x1333('0x5b')]['id']}})[_0x1333('0x2c')](handleEntityNotFound(_0xd049d3,null))['then'](function(_0x944cab){if(_0x944cab){return _0x944cab['addAgents'](_0x26056b[_0x1333('0x52')][_0x1333('0x78')],_[_0x1333('0x8c')](_0x26056b[_0x1333('0x52')],[_0x1333('0x78'),'id'])||{})[_0x1333('0x8d')](function(_0x2d1d30){for(var _0x543239=0x0;_0x543239<_0x26056b[_0x1333('0x52')][_0x1333('0x78')]['length'];_0x543239+=0x1){socket[_0x1333('0x76')](_0x1333('0x8e'),{'UserId':Number(_0x26056b['body'][_0x1333('0x78')][_0x543239]),'OpenchannelQueueId':Number(_0x26056b['params']['id'])});}return _0x2d1d30;});}})[_0x1333('0x2c')](respondWithResult(_0xd049d3,null))[_0x1333('0x4e')](handleError(_0xd049d3,null));};exports[_0x1333('0x8a')]=function(_0x31226e,_0x50277b,_0x652152){return db[_0x1333('0x35')]['find']({'where':{'id':_0x31226e[_0x1333('0x5b')]['id']}})[_0x1333('0x2c')](handleEntityNotFound(_0x50277b,null))['then'](function(_0x26e330){if(_0x26e330){return _0x26e330['removeAgents'](_0x31226e['query'][_0x1333('0x78')])[_0x1333('0x2c')](function(){if(_[_0x1333('0x8f')](_0x31226e['query']['ids'])){for(var _0x31d5d9=0x0;_0x31d5d9<_0x31226e[_0x1333('0x3b')]['ids'][_0x1333('0x40')];_0x31d5d9+=0x1){socket[_0x1333('0x76')](_0x1333('0x90'),{'UserId':Number(_0x31226e['query']['ids'][_0x31d5d9]),'OpenchannelQueueId':Number(_0x31226e[_0x1333('0x5b')]['id'])});}}else{socket[_0x1333('0x76')](_0x1333('0x90'),{'UserId':Number(_0x31226e[_0x1333('0x3b')]['ids']),'OpenchannelQueueId':Number(_0x31226e['params']['id'])});}});}})[_0x1333('0x2c')](respondWithStatusCode(_0x50277b,null))['catch'](handleError(_0x50277b,null));};exports[_0x1333('0x91')]=function(_0xdaef5c,_0x1f3e10,_0x24d557){var _0x36075b={};var _0x5d3b8f={};var _0x511dc1;var _0x4ec209;return db[_0x1333('0x35')][_0x1333('0x92')]({'where':{'id':_0xdaef5c[_0x1333('0x5b')]['id']}})[_0x1333('0x2c')](handleEntityNotFound(_0x1f3e10,null))[_0x1333('0x2c')](function(_0x1a7919){if(_0x1a7919){_0x511dc1=_0x1a7919;_0x5d3b8f[_0x1333('0x3a')]=_[_0x1333('0x3c')](db[_0x1333('0x60')][_0x1333('0x36')]);_0x5d3b8f[_0x1333('0x3b')]=_[_0x1333('0x3c')](_0xdaef5c[_0x1333('0x3b')]);_0x5d3b8f[_0x1333('0x45')]=_[_0x1333('0x3e')](_0x5d3b8f['model'],_0x5d3b8f[_0x1333('0x3b')]);_0x36075b[_0x1333('0x3d')]=_[_0x1333('0x3e')](_0x5d3b8f[_0x1333('0x3a')],qs[_0x1333('0x3f')](_0xdaef5c[_0x1333('0x3b')][_0x1333('0x3f')]));_0x36075b[_0x1333('0x3d')]=_0x36075b[_0x1333('0x3d')][_0x1333('0x40')]?_0x36075b[_0x1333('0x3d')]:_0x5d3b8f[_0x1333('0x3a')];_0x36075b[_0x1333('0x42')]=qs[_0x1333('0x43')](_0xdaef5c['query']['sort']);_0x36075b[_0x1333('0x44')]=qs[_0x1333('0x45')](_[_0x1333('0x6a')](_0xdaef5c[_0x1333('0x3b')],_0x5d3b8f[_0x1333('0x45')]));if(_0xdaef5c[_0x1333('0x3b')][_0x1333('0x47')]){_0x36075b[_0x1333('0x44')]=_[_0x1333('0x48')](_0x36075b[_0x1333('0x44')],{'$or':_[_0x1333('0x34')](_0x36075b['attributes'],function(_0x2d8952){var _0x2b2003={};_0x2b2003[_0x2d8952]={'$like':'%'+_0xdaef5c['query'][_0x1333('0x47')]+'%'};return _0x2b2003;})});}_0x36075b=_[_0x1333('0x48')]({},_0x36075b,_0xdaef5c[_0x1333('0x49')]);return _0x511dc1['getAgents'](_0x36075b);}})[_0x1333('0x2c')](function(_0x485452){if(_0x485452){_0x4ec209=_0x485452['length'];if(!_0xdaef5c['query'][_0x1333('0x6b')](_0x1333('0x41'))){_0x36075b[_0x1333('0x25')]=qs[_0x1333('0x25')](_0xdaef5c[_0x1333('0x3b')][_0x1333('0x25')]);_0x36075b[_0x1333('0x23')]=qs[_0x1333('0x23')](_0xdaef5c[_0x1333('0x3b')][_0x1333('0x23')]);}return _0x511dc1[_0x1333('0x91')](_0x36075b);}})[_0x1333('0x2c')](function(_0x2667d0){if(_0x2667d0){return _0x2667d0?{'count':_0x4ec209,'rows':_0x2667d0}:null;}})[_0x1333('0x2c')](respondWithResult(_0x1f3e10,null))[_0x1333('0x4e')](handleError(_0x1f3e10,null));}; \ No newline at end of file +var _0x6e08=['findOrCreate','emit','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','OpenchannelQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','ids','isEmpty','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','removeAgents','isArray','getAgents','options','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','UserProfileResource','status','end','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','rows','catch','show','params','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','create','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','order','OpenchannelQueueId','findAll','User','UserId','agent','createdAt','format','%s/%s','SIP','openchannelPause','updatedAt','getTeams','Team','addTeams','online','voicePause','interface','flatMap','Agents','sequelize','each'];(function(_0x5a6326,_0x5cb8a4){var _0x4533ea=function(_0x117094){while(--_0x117094){_0x5a6326['push'](_0x5a6326['shift']());}};_0x4533ea(++_0x5cb8a4);}(_0x6e08,0x146));var _0x86e0=function(_0x24d24e,_0x4e17a4){_0x24d24e=_0x24d24e-0x0;var _0x20e068=_0x6e08[_0x24d24e];return _0x20e068;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86e0('0x0'));var zipdir=require(_0x86e0('0x1'));var jsonpatch=require(_0x86e0('0x2'));var rp=require(_0x86e0('0x3'));var moment=require('moment');var BPromise=require(_0x86e0('0x4'));var Mustache=require('mustache');var util=require(_0x86e0('0x5'));var path=require(_0x86e0('0x6'));var sox=require(_0x86e0('0x7'));var csv=require(_0x86e0('0x8'));var ejs=require(_0x86e0('0x9'));var fs=require('fs');var fs_extra=require(_0x86e0('0xa'));var _=require(_0x86e0('0xb'));var squel=require(_0x86e0('0xc'));var crypto=require(_0x86e0('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x86e0('0x8'));var querystring=require(_0x86e0('0xe'));var Papa=require(_0x86e0('0xf'));var Redis=require(_0x86e0('0x10'));var authService=require(_0x86e0('0x11'));var qs=require(_0x86e0('0x12'));var as=require(_0x86e0('0x13'));var hardwareService=require(_0x86e0('0x14'));var logger=require(_0x86e0('0x15'))(_0x86e0('0x16'));var utils=require(_0x86e0('0x17'));var config=require(_0x86e0('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x86e0('0x19'))['db'];config[_0x86e0('0x1a')]=_[_0x86e0('0x1b')](config['redis'],{'host':_0x86e0('0x1c'),'port':0x18eb});var socket=require(_0x86e0('0x1d'))(new Redis(config['redis']));require(_0x86e0('0x1e'))['register'](socket);function respondWithStatusCode(_0x329a74,_0x583a5a){_0x583a5a=_0x583a5a||0xcc;return function(_0x323a02){if(_0x323a02){return _0x329a74[_0x86e0('0x1f')](_0x583a5a);}return _0x329a74['status'](_0x583a5a)['end']();};}function respondWithResult(_0x6247ee,_0x5435c4){_0x5435c4=_0x5435c4||0xc8;return function(_0x5c4d5a){if(_0x5c4d5a){return _0x6247ee['status'](_0x5435c4)[_0x86e0('0x20')](_0x5c4d5a);}};}function respondWithFilteredResult(_0x230483,_0x99af0a){return function(_0x135a45){if(_0x135a45){var _0x1ba2a2=typeof _0x99af0a[_0x86e0('0x21')]===_0x86e0('0x22')&&typeof _0x99af0a[_0x86e0('0x23')]===_0x86e0('0x22');var _0x3d2269=_0x135a45[_0x86e0('0x24')];var _0x15a871=_0x1ba2a2?0x0:_0x99af0a[_0x86e0('0x21')];var _0x4c1283=_0x1ba2a2?_0x135a45[_0x86e0('0x24')]:_0x99af0a[_0x86e0('0x21')]+_0x99af0a['limit'];var _0x491cdf;if(_0x4c1283>=_0x3d2269){_0x4c1283=_0x3d2269;_0x491cdf=0xc8;}else{_0x491cdf=0xce;}_0x230483['status'](_0x491cdf);return _0x230483[_0x86e0('0x25')](_0x86e0('0x26'),_0x15a871+'-'+_0x4c1283+'/'+_0x3d2269)[_0x86e0('0x20')](_0x135a45);}return null;};}function patchUpdates(_0x2a3e9b){return function(_0x1908bc){try{jsonpatch['apply'](_0x1908bc,_0x2a3e9b,!![]);}catch(_0x3dd057){return BPromise['reject'](_0x3dd057);}return _0x1908bc[_0x86e0('0x27')]();};}function saveUpdates(_0x78da6b,_0x521039){return function(_0x35cb05){if(_0x35cb05){return _0x35cb05[_0x86e0('0x28')](_0x78da6b)[_0x86e0('0x29')](function(_0x23b2dc){return _0x23b2dc;});}return null;};}function removeEntity(_0x377913,_0x39db11){return function(_0x56f84f){if(_0x56f84f){return _0x56f84f[_0x86e0('0x2a')]()['then'](function(){var _0x482f4d=_0x56f84f[_0x86e0('0x2b')]({'plain':!![]});var _0x38d658='OpenchannelQueues';return db[_0x86e0('0x2c')]['destroy']({'where':{'type':_0x38d658,'resourceId':_0x482f4d['id']}})['then'](function(){return _0x56f84f;});})[_0x86e0('0x29')](function(){_0x377913[_0x86e0('0x2d')](0xcc)[_0x86e0('0x2e')]();});}};}function handleEntityNotFound(_0x581d9b,_0x2a8620){return function(_0x5caae5){if(!_0x5caae5){_0x581d9b[_0x86e0('0x1f')](0x194);}return _0x5caae5;};}function handleError(_0x4fd1d5,_0x123e60){_0x123e60=_0x123e60||0x1f4;return function(_0x326c00){logger[_0x86e0('0x2f')](_0x326c00[_0x86e0('0x30')]);if(_0x326c00[_0x86e0('0x31')]){delete _0x326c00[_0x86e0('0x31')];}_0x4fd1d5[_0x86e0('0x2d')](_0x123e60)[_0x86e0('0x32')](_0x326c00);};}exports[_0x86e0('0x33')]=function(_0x2ca4e6,_0x286f50){var _0x427cfb={},_0x61ba51={},_0x5f48de={'count':0x0,'rows':[]};var _0x1c4832=_['map'](db[_0x86e0('0x34')][_0x86e0('0x35')],function(_0x958adf){return{'name':_0x958adf[_0x86e0('0x36')],'type':_0x958adf['type'][_0x86e0('0x37')]};});_0x61ba51[_0x86e0('0x38')]=_['map'](_0x1c4832,_0x86e0('0x31'));_0x61ba51[_0x86e0('0x39')]=_[_0x86e0('0x3a')](_0x2ca4e6[_0x86e0('0x39')]);_0x61ba51[_0x86e0('0x3b')]=_[_0x86e0('0x3c')](_0x61ba51[_0x86e0('0x38')],_0x61ba51[_0x86e0('0x39')]);_0x427cfb[_0x86e0('0x3d')]=_['intersection'](_0x61ba51['model'],qs[_0x86e0('0x3e')](_0x2ca4e6[_0x86e0('0x39')]['fields']));_0x427cfb[_0x86e0('0x3d')]=_0x427cfb[_0x86e0('0x3d')][_0x86e0('0x3f')]?_0x427cfb[_0x86e0('0x3d')]:_0x61ba51[_0x86e0('0x38')];if(!_0x2ca4e6[_0x86e0('0x39')]['hasOwnProperty'](_0x86e0('0x40'))){_0x427cfb[_0x86e0('0x23')]=qs[_0x86e0('0x23')](_0x2ca4e6['query'][_0x86e0('0x23')]);_0x427cfb['offset']=qs[_0x86e0('0x21')](_0x2ca4e6[_0x86e0('0x39')]['offset']);}_0x427cfb['order']=qs[_0x86e0('0x41')](_0x2ca4e6[_0x86e0('0x39')][_0x86e0('0x41')]);_0x427cfb[_0x86e0('0x42')]=qs[_0x86e0('0x3b')](_[_0x86e0('0x43')](_0x2ca4e6[_0x86e0('0x39')],_0x61ba51['filters']),_0x1c4832);if(_0x2ca4e6[_0x86e0('0x39')][_0x86e0('0x44')]){_0x427cfb['where']=_[_0x86e0('0x45')](_0x427cfb[_0x86e0('0x42')],{'$or':_[_0x86e0('0x46')](_0x1c4832,function(_0x34a42e){if(_0x34a42e['type']!==_0x86e0('0x47')){var _0x32a0b4={};_0x32a0b4[_0x34a42e['name']]={'$like':'%'+_0x2ca4e6[_0x86e0('0x39')]['filter']+'%'};return _0x32a0b4;}})});}_0x427cfb=_['merge']({},_0x427cfb,_0x2ca4e6['options']);var _0x2b9019={'where':_0x427cfb[_0x86e0('0x42')]};return db['OpenchannelQueue'][_0x86e0('0x24')](_0x2b9019)[_0x86e0('0x29')](function(_0x3b535b){_0x5f48de[_0x86e0('0x24')]=_0x3b535b;if(_0x2ca4e6[_0x86e0('0x39')][_0x86e0('0x48')]){_0x427cfb['include']=[{'all':!![]}];}return db[_0x86e0('0x34')]['findAll'](_0x427cfb);})[_0x86e0('0x29')](function(_0x1d6cea){_0x5f48de[_0x86e0('0x49')]=_0x1d6cea;return _0x5f48de;})[_0x86e0('0x29')](respondWithFilteredResult(_0x286f50,_0x427cfb))[_0x86e0('0x4a')](handleError(_0x286f50,null));};exports[_0x86e0('0x4b')]=function(_0x5786af,_0x8b8e01){var _0x35ce0e={'raw':!![],'where':{'id':_0x5786af[_0x86e0('0x4c')]['id']}},_0x405b8b={};_0x405b8b[_0x86e0('0x38')]=_[_0x86e0('0x3a')](db['OpenchannelQueue'][_0x86e0('0x35')]);_0x405b8b[_0x86e0('0x39')]=_[_0x86e0('0x3a')](_0x5786af[_0x86e0('0x39')]);_0x405b8b[_0x86e0('0x3b')]=_[_0x86e0('0x3c')](_0x405b8b[_0x86e0('0x38')],_0x405b8b['query']);_0x35ce0e[_0x86e0('0x3d')]=_[_0x86e0('0x3c')](_0x405b8b[_0x86e0('0x38')],qs['fields'](_0x5786af[_0x86e0('0x39')][_0x86e0('0x3e')]));_0x35ce0e[_0x86e0('0x3d')]=_0x35ce0e[_0x86e0('0x3d')][_0x86e0('0x3f')]?_0x35ce0e[_0x86e0('0x3d')]:_0x405b8b['model'];if(_0x5786af[_0x86e0('0x39')][_0x86e0('0x48')]){_0x35ce0e[_0x86e0('0x4d')]=[{'all':!![]}];}_0x35ce0e=_['merge']({},_0x35ce0e,_0x5786af['options']);return db[_0x86e0('0x34')][_0x86e0('0x4e')](_0x35ce0e)[_0x86e0('0x29')](handleEntityNotFound(_0x8b8e01,null))[_0x86e0('0x29')](respondWithResult(_0x8b8e01,null))[_0x86e0('0x4a')](handleError(_0x8b8e01,null));};exports['create']=function(_0x182a92,_0xee311f){return db[_0x86e0('0x34')]['create'](_0x182a92[_0x86e0('0x4f')],{})[_0x86e0('0x29')](function(_0x5b92d8){var _0x1e364e=_0x182a92[_0x86e0('0x50')][_0x86e0('0x2b')]({'plain':!![]});if(!_0x1e364e)throw new Error(_0x86e0('0x51'));if(_0x1e364e['role']===_0x86e0('0x50')){var _0x4434b6=_0x5b92d8['get']({'plain':!![]});var _0x3d2237='OpenchannelQueues';return db[_0x86e0('0x52')]['find']({'where':{'name':_0x3d2237,'userProfileId':_0x1e364e['userProfileId']},'raw':!![]})[_0x86e0('0x29')](function(_0xc51f55){if(_0xc51f55&&_0xc51f55[_0x86e0('0x53')]===0x0){return db[_0x86e0('0x2c')][_0x86e0('0x54')]({'name':_0x4434b6[_0x86e0('0x31')],'resourceId':_0x4434b6['id'],'type':_0xc51f55[_0x86e0('0x31')],'sectionId':_0xc51f55['id']},{})[_0x86e0('0x29')](function(){return _0x5b92d8;});}else{return _0x5b92d8;}})[_0x86e0('0x4a')](function(_0x34a0ef){logger[_0x86e0('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34a0ef);throw _0x34a0ef;});}return _0x5b92d8;})['then'](respondWithResult(_0xee311f,0xc9))[_0x86e0('0x4a')](handleError(_0xee311f,null));};exports[_0x86e0('0x28')]=function(_0x16b7a6,_0x31d491){if(_0x16b7a6[_0x86e0('0x4f')]['id']){delete _0x16b7a6['body']['id'];}return db[_0x86e0('0x34')]['find']({'where':{'id':_0x16b7a6[_0x86e0('0x4c')]['id']}})[_0x86e0('0x29')](handleEntityNotFound(_0x31d491,null))['then'](saveUpdates(_0x16b7a6[_0x86e0('0x4f')],null))['then'](respondWithResult(_0x31d491,null))['catch'](handleError(_0x31d491,null));};exports[_0x86e0('0x2a')]=function(_0x38f1ef,_0x2e5b7b){return db['OpenchannelQueue'][_0x86e0('0x4e')]({'where':{'id':_0x38f1ef[_0x86e0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2e5b7b,null))[_0x86e0('0x29')](removeEntity(_0x2e5b7b,null))[_0x86e0('0x4a')](handleError(_0x2e5b7b,null));};exports['describe']=function(_0x47fdd6,_0x217188){return db[_0x86e0('0x34')][_0x86e0('0x55')]()[_0x86e0('0x29')](respondWithResult(_0x217188,null))[_0x86e0('0x4a')](handleError(_0x217188,null));};exports[_0x86e0('0x56')]=function(_0x132166,_0x119c2e,_0x1d5c92){var _0xfe8e0c={'raw':!![],'where':{}},_0x32e5c2={},_0x49faa7;return db['OpenchannelQueue'][_0x86e0('0x57')]({'where':{'id':_0x132166[_0x86e0('0x4c')]['id']}})[_0x86e0('0x29')](handleEntityNotFound(_0x119c2e,null))[_0x86e0('0x29')](function(_0x31229e){if(_0x31229e){_0x49faa7=_0x31229e['get']({'plain':!![]});_0x32e5c2['model']=_[_0x86e0('0x3a')](db[_0x86e0('0x58')][_0x86e0('0x35')]);_0x32e5c2[_0x86e0('0x39')]=_[_0x86e0('0x3a')](_0x132166[_0x86e0('0x39')]);_0x32e5c2[_0x86e0('0x3b')]=_[_0x86e0('0x3c')](_0x32e5c2[_0x86e0('0x38')],_0x32e5c2[_0x86e0('0x39')]);_0xfe8e0c[_0x86e0('0x3d')]=_[_0x86e0('0x3c')](_0x32e5c2['model'],qs[_0x86e0('0x3e')](_0x132166[_0x86e0('0x39')][_0x86e0('0x3e')]));_0xfe8e0c[_0x86e0('0x3d')]=_0xfe8e0c[_0x86e0('0x3d')][_0x86e0('0x3f')]?_0xfe8e0c[_0x86e0('0x3d')]:_0x32e5c2['model'];if(!_0x132166[_0x86e0('0x39')][_0x86e0('0x59')]('nolimit')){_0xfe8e0c[_0x86e0('0x23')]=qs[_0x86e0('0x23')](_0x132166[_0x86e0('0x39')][_0x86e0('0x23')]);_0xfe8e0c['offset']=qs[_0x86e0('0x21')](_0x132166[_0x86e0('0x39')][_0x86e0('0x21')]);}_0xfe8e0c[_0x86e0('0x5a')]=qs['sort'](_0x132166['query']['sort']);_0xfe8e0c[_0x86e0('0x42')]=qs[_0x86e0('0x3b')](_[_0x86e0('0x43')](_0x132166['query'],_0x32e5c2[_0x86e0('0x3b')]));_0xfe8e0c['where'][_0x86e0('0x5b')]=_0x31229e['id'];if(_0x132166[_0x86e0('0x39')][_0x86e0('0x44')]){_0xfe8e0c[_0x86e0('0x42')]=_['merge'](_0xfe8e0c[_0x86e0('0x42')],{'$or':_['map'](_0xfe8e0c[_0x86e0('0x3d')],function(_0x1b7fe7){var _0x14086b={};_0x14086b[_0x1b7fe7]={'$like':'%'+_0x132166[_0x86e0('0x39')]['filter']+'%'};return _0x14086b;})});}_0xfe8e0c=_[_0x86e0('0x45')]({},_0xfe8e0c,_0x132166['options']);return db[_0x86e0('0x58')][_0x86e0('0x5c')](_0xfe8e0c);}})['then'](function(_0x32469f){if(_0x32469f){return db[_0x86e0('0x5d')]['findAndCountAll']({'where':{'id':_[_0x86e0('0x46')](_0x32469f,_0x86e0('0x5e')),'role':_0x86e0('0x5f')},'attributes':['id',_0x86e0('0x31'),'openchannelPause','updatedAt',_0x86e0('0x60')]});}})[_0x86e0('0x29')](function(_0x444694){if(_0x444694){return{'count':_0x444694[_0x86e0('0x24')],'rows':_[_0x86e0('0x46')](_0x444694[_0x86e0('0x49')],function(_0x1258e5){return{'membername':_0x1258e5[_0x86e0('0x31')],'UserId':_0x1258e5['id'],'queue_name':_0x49faa7[_0x86e0('0x31')],'OpenchannelQueueId':_0x49faa7['id'],'interface':util[_0x86e0('0x61')](_0x86e0('0x62'),_0x86e0('0x63'),_0x1258e5[_0x86e0('0x31')]),'penalty':0x0,'paused':_0x1258e5[_0x86e0('0x64')],'createdAt':_0x1258e5[_0x86e0('0x60')],'updatedAt':_0x1258e5[_0x86e0('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x86e0('0x29')](respondWithFilteredResult(_0x119c2e,_0xfe8e0c))[_0x86e0('0x4a')](handleError(_0x119c2e,null));};exports[_0x86e0('0x66')]=function(_0x3df506,_0x2ad50f,_0x4c9e1e){var _0x2610cf={};var _0x49b719={};var _0x1857f5;var _0x21ce4b;return db[_0x86e0('0x34')][_0x86e0('0x57')]({'where':{'id':_0x3df506[_0x86e0('0x4c')]['id']}})[_0x86e0('0x29')](handleEntityNotFound(_0x2ad50f,null))['then'](function(_0x2ff39f){if(_0x2ff39f){_0x1857f5=_0x2ff39f;_0x49b719[_0x86e0('0x38')]=_[_0x86e0('0x3a')](db[_0x86e0('0x67')]['rawAttributes']);_0x49b719[_0x86e0('0x39')]=_[_0x86e0('0x3a')](_0x3df506[_0x86e0('0x39')]);_0x49b719['filters']=_[_0x86e0('0x3c')](_0x49b719[_0x86e0('0x38')],_0x49b719[_0x86e0('0x39')]);_0x2610cf[_0x86e0('0x3d')]=_[_0x86e0('0x3c')](_0x49b719[_0x86e0('0x38')],qs[_0x86e0('0x3e')](_0x3df506['query'][_0x86e0('0x3e')]));_0x2610cf[_0x86e0('0x3d')]=_0x2610cf[_0x86e0('0x3d')][_0x86e0('0x3f')]?_0x2610cf[_0x86e0('0x3d')]:_0x49b719[_0x86e0('0x38')];_0x2610cf['order']=qs[_0x86e0('0x41')](_0x3df506[_0x86e0('0x39')][_0x86e0('0x41')]);_0x2610cf[_0x86e0('0x42')]=qs[_0x86e0('0x3b')](_[_0x86e0('0x43')](_0x3df506['query'],_0x49b719[_0x86e0('0x3b')]));if(_0x3df506[_0x86e0('0x39')][_0x86e0('0x44')]){_0x2610cf[_0x86e0('0x42')]=_[_0x86e0('0x45')](_0x2610cf[_0x86e0('0x42')],{'$or':_['map'](_0x2610cf[_0x86e0('0x3d')],function(_0x48494e){var _0x30baf1={};_0x30baf1[_0x48494e]={'$like':'%'+_0x3df506['query']['filter']+'%'};return _0x30baf1;})});}_0x2610cf=_[_0x86e0('0x45')]({},_0x2610cf,_0x3df506['options']);return _0x1857f5[_0x86e0('0x66')](_0x2610cf);}})['then'](function(_0x3fa644){if(_0x3fa644){_0x21ce4b=_0x3fa644['length'];if(!_0x3df506[_0x86e0('0x39')][_0x86e0('0x59')](_0x86e0('0x40'))){_0x2610cf['limit']=qs['limit'](_0x3df506[_0x86e0('0x39')][_0x86e0('0x23')]);_0x2610cf[_0x86e0('0x21')]=qs[_0x86e0('0x21')](_0x3df506[_0x86e0('0x39')][_0x86e0('0x21')]);}return _0x1857f5[_0x86e0('0x66')](_0x2610cf);}})[_0x86e0('0x29')](function(_0x170b21){if(_0x170b21){return _0x170b21?{'count':_0x21ce4b,'rows':_0x170b21}:null;}})[_0x86e0('0x29')](respondWithResult(_0x2ad50f,null))['catch'](handleError(_0x2ad50f,null));};exports[_0x86e0('0x68')]=function(_0x4b1621,_0x210a99,_0x5841d3){var _0x2d36fb=_0x4b1621[_0x86e0('0x4f')]['ids'];return db[_0x86e0('0x67')]['findAll']({'where':{'id':_0x2d36fb},'attributes':['id'],'include':[{'model':db[_0x86e0('0x5d')],'as':'Agents','attributes':['id',_0x86e0('0x31'),_0x86e0('0x69'),_0x86e0('0x6a'),_0x86e0('0x6b')],'raw':!![]}]})[_0x86e0('0x29')](function(_0x3920d1){if(_0x3920d1){var _0x5af9bb=_[_0x86e0('0x6c')](_0x3920d1,function(_0x260bd1){var _0x532d5b=_0x260bd1[_0x86e0('0x2b')]({'plain':!![]});return _0x532d5b[_0x86e0('0x6d')];});return db[_0x86e0('0x34')][_0x86e0('0x4e')]({'where':{'id':_0x4b1621[_0x86e0('0x4c')]['id']}})['then'](function(_0x26859f){return db[_0x86e0('0x6e')]['transaction'](function(_0x8e34f){return _0x26859f[_0x86e0('0x68')](_0x2d36fb,{'transaction':_0x8e34f})[_0x86e0('0x29')](function(){return BPromise[_0x86e0('0x6f')](_0x5af9bb,function(_0x514b47){return db[_0x86e0('0x58')][_0x86e0('0x70')]({'where':{'UserId':_0x514b47['id'],'OpenchannelQueueId':_0x4b1621[_0x86e0('0x4c')]['id']},'transaction':_0x8e34f});});})['then'](function(){_0x5af9bb['forEach'](function(_0x43711c){socket[_0x86e0('0x71')]('userOpenchannelQueue:save',{'UserId':_0x43711c['id'],'OpenchannelQueueId':_0x26859f['id']});});});});});}})[_0x86e0('0x29')](respondWithStatusCode(_0x210a99,null))[_0x86e0('0x4a')](handleError(_0x210a99,null));};exports[_0x86e0('0x72')]=function(_0x3734d1,_0x26bac2,_0xd2dfab){return db['Team'][_0x86e0('0x5c')]({'where':{'id':_0x3734d1[_0x86e0('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x86e0('0x5d')],'as':_0x86e0('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x86e0('0x29')](handleEntityNotFound(_0x26bac2,null))[_0x86e0('0x29')](function(_0x306201){var _0x4009ac=_[_0x86e0('0x46')](_0x306201,'id');var _0x4b0e3f=[];var _0x5b8763=[];var _0x37bc51=squel[_0x86e0('0x73')]();_0x37bc51[_0x86e0('0x74')](_0x86e0('0x75'))[_0x86e0('0x76')]('team_has_openchannel_queues','tq')[_0x86e0('0x77')](_0x86e0('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x86e0('0x42')](_0x86e0('0x79'),_0x3734d1[_0x86e0('0x4c')]['id']);for(var _0x373093=0x0;_0x373093<_0x306201[_0x86e0('0x3f')];_0x373093+=0x1){let _0xd91fcd=_0x306201[_0x373093];for(var _0xbf7952=0x0;_0xbf7952<_0xd91fcd[_0x86e0('0x6d')][_0x86e0('0x3f')];_0xbf7952+=0x1){let _0x461c2e=_0xd91fcd[_0x86e0('0x6d')][_0xbf7952];var _0x5da9dc=_0x37bc51['clone']();_0x5da9dc[_0x86e0('0x42')]('ut.UserId\x20=\x20?',_0x461c2e['id']);_0x5b8763[_0x86e0('0x7a')](db['sequelize'][_0x86e0('0x39')](_0x5da9dc[_0x86e0('0x7b')](),{'type':db[_0x86e0('0x6e')][_0x86e0('0x7c')][_0x86e0('0x7d')]})[_0x86e0('0x29')](function(_0x5c457b){if(_0x5c457b[_0x86e0('0x3f')]===0x1){return _0x461c2e['id'];}else{var _0x22cf17=_[_0x86e0('0x7e')](_[_0x86e0('0x46')](_0x5c457b,_0x86e0('0x7f')),function(_0x1fbeb1){return _[_0x86e0('0x80')](_0x4009ac,_0x1fbeb1);});if(_0x22cf17){return _0x461c2e['id'];}}}));}}return BPromise[_0x86e0('0x81')](_0x5b8763)[_0x86e0('0x29')](function(_0x3d1017){_0x4b0e3f=_(_0x4b0e3f)[_0x86e0('0x82')](_0x3d1017)[_0x86e0('0x83')]()[_0x86e0('0x84')]();return db[_0x86e0('0x34')][_0x86e0('0x4e')]({'where':{'id':_0x3734d1[_0x86e0('0x4c')]['id']}})[_0x86e0('0x29')](function(_0x5dccc3){return db[_0x86e0('0x6e')][_0x86e0('0x85')](function(_0x3f2830){return _0x5dccc3[_0x86e0('0x72')](_0x3734d1[_0x86e0('0x39')][_0x86e0('0x86')],{'transaction':_0x3f2830})[_0x86e0('0x29')](function(){if(!_[_0x86e0('0x87')](_0x4b0e3f)){return _0x5dccc3['removeAgents'](_0x4b0e3f,{'transaction':_0x3f2830});}})[_0x86e0('0x29')](function(){_0x4b0e3f[_0x86e0('0x88')](function(_0x5b4f1e){socket['emit'](_0x86e0('0x89'),{'UserId':_0x5b4f1e,'OpenchannelQueueId':_0x5dccc3['id']});});});});});});})['then'](respondWithStatusCode(_0x26bac2,null))[_0x86e0('0x4a')](handleError(_0x26bac2,null));};exports[_0x86e0('0x8a')]=function(_0x515f5e,_0x64b61b,_0x559895){return db['OpenchannelQueue'][_0x86e0('0x4e')]({'where':{'id':_0x515f5e['params']['id']}})[_0x86e0('0x29')](handleEntityNotFound(_0x64b61b,null))['then'](function(_0x16b698){if(_0x16b698){return _0x16b698[_0x86e0('0x8a')](_0x515f5e[_0x86e0('0x4f')]['ids'],_[_0x86e0('0x8b')](_0x515f5e[_0x86e0('0x4f')],[_0x86e0('0x86'),'id'])||{})[_0x86e0('0x8c')](function(_0x3910be){for(var _0x58e992=0x0;_0x58e992<_0x515f5e[_0x86e0('0x4f')][_0x86e0('0x86')][_0x86e0('0x3f')];_0x58e992+=0x1){socket['emit'](_0x86e0('0x8d'),{'UserId':Number(_0x515f5e[_0x86e0('0x4f')]['ids'][_0x58e992]),'OpenchannelQueueId':Number(_0x515f5e[_0x86e0('0x4c')]['id'])});}return _0x3910be;});}})['then'](respondWithResult(_0x64b61b,null))[_0x86e0('0x4a')](handleError(_0x64b61b,null));};exports[_0x86e0('0x8e')]=function(_0x17b510,_0x38f7b0,_0x7bbe33){return db[_0x86e0('0x34')][_0x86e0('0x4e')]({'where':{'id':_0x17b510[_0x86e0('0x4c')]['id']}})[_0x86e0('0x29')](handleEntityNotFound(_0x38f7b0,null))[_0x86e0('0x29')](function(_0x3d5bc8){if(_0x3d5bc8){return _0x3d5bc8['removeAgents'](_0x17b510[_0x86e0('0x39')]['ids'])[_0x86e0('0x29')](function(){if(_[_0x86e0('0x8f')](_0x17b510[_0x86e0('0x39')]['ids'])){for(var _0x33f0a4=0x0;_0x33f0a4<_0x17b510['query'][_0x86e0('0x86')]['length'];_0x33f0a4+=0x1){socket[_0x86e0('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x17b510[_0x86e0('0x39')]['ids'][_0x33f0a4]),'OpenchannelQueueId':Number(_0x17b510[_0x86e0('0x4c')]['id'])});}}else{socket[_0x86e0('0x71')](_0x86e0('0x89'),{'UserId':Number(_0x17b510[_0x86e0('0x39')][_0x86e0('0x86')]),'OpenchannelQueueId':Number(_0x17b510[_0x86e0('0x4c')]['id'])});}});}})[_0x86e0('0x29')](respondWithStatusCode(_0x38f7b0,null))['catch'](handleError(_0x38f7b0,null));};exports[_0x86e0('0x90')]=function(_0x2ce83a,_0x21649d,_0x4b008e){var _0x2cace3={};var _0x291421={};var _0x387369;var _0x23ad1b;return db[_0x86e0('0x34')]['findOne']({'where':{'id':_0x2ce83a[_0x86e0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x21649d,null))[_0x86e0('0x29')](function(_0x264d93){if(_0x264d93){_0x387369=_0x264d93;_0x291421[_0x86e0('0x38')]=_['keys'](db[_0x86e0('0x5d')][_0x86e0('0x35')]);_0x291421[_0x86e0('0x39')]=_[_0x86e0('0x3a')](_0x2ce83a[_0x86e0('0x39')]);_0x291421[_0x86e0('0x3b')]=_['intersection'](_0x291421['model'],_0x291421[_0x86e0('0x39')]);_0x2cace3[_0x86e0('0x3d')]=_['intersection'](_0x291421['model'],qs[_0x86e0('0x3e')](_0x2ce83a[_0x86e0('0x39')]['fields']));_0x2cace3[_0x86e0('0x3d')]=_0x2cace3['attributes'][_0x86e0('0x3f')]?_0x2cace3[_0x86e0('0x3d')]:_0x291421[_0x86e0('0x38')];_0x2cace3[_0x86e0('0x5a')]=qs[_0x86e0('0x41')](_0x2ce83a[_0x86e0('0x39')][_0x86e0('0x41')]);_0x2cace3[_0x86e0('0x42')]=qs[_0x86e0('0x3b')](_[_0x86e0('0x43')](_0x2ce83a['query'],_0x291421[_0x86e0('0x3b')]));if(_0x2ce83a[_0x86e0('0x39')][_0x86e0('0x44')]){_0x2cace3[_0x86e0('0x42')]=_[_0x86e0('0x45')](_0x2cace3[_0x86e0('0x42')],{'$or':_['map'](_0x2cace3['attributes'],function(_0x418d4a){var _0x2aefa7={};_0x2aefa7[_0x418d4a]={'$like':'%'+_0x2ce83a[_0x86e0('0x39')][_0x86e0('0x44')]+'%'};return _0x2aefa7;})});}_0x2cace3=_[_0x86e0('0x45')]({},_0x2cace3,_0x2ce83a[_0x86e0('0x91')]);return _0x387369[_0x86e0('0x90')](_0x2cace3);}})[_0x86e0('0x29')](function(_0x2b238d){if(_0x2b238d){_0x23ad1b=_0x2b238d[_0x86e0('0x3f')];if(!_0x2ce83a[_0x86e0('0x39')][_0x86e0('0x59')](_0x86e0('0x40'))){_0x2cace3[_0x86e0('0x23')]=qs[_0x86e0('0x23')](_0x2ce83a[_0x86e0('0x39')][_0x86e0('0x23')]);_0x2cace3[_0x86e0('0x21')]=qs[_0x86e0('0x21')](_0x2ce83a[_0x86e0('0x39')][_0x86e0('0x21')]);}return _0x387369[_0x86e0('0x90')](_0x2cace3);}})[_0x86e0('0x29')](function(_0x2453ce){if(_0x2453ce){return _0x2453ce?{'count':_0x23ad1b,'rows':_0x2453ce}:null;}})['then'](respondWithResult(_0x21649d,null))['catch'](handleError(_0x21649d,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 4e6eb52..b87ca8d 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 _0xb6a0=['update','remove','emit','events','OpenchannelQueue','setMaxListeners','save'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xb6a0,0x1d1));var _0x0b6a=function(_0x4c2284,_0xd4ca5c){_0x4c2284=_0x4c2284-0x0;var _0x13f079=_0xb6a0[_0x4c2284];return _0x13f079;};'use strict';var EventEmitter=require(_0x0b6a('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x0b6a('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x0b6a('0x2')](0x0);var events={'afterCreate':_0x0b6a('0x3'),'afterUpdate':_0x0b6a('0x4'),'afterDestroy':_0x0b6a('0x5')};function emitEvent(_0x18d8db){return function(_0xcae5e9,_0x534f45,_0x45bfcd){OpenchannelQueueEvents[_0x0b6a('0x6')](_0x18d8db+':'+_0xcae5e9['id'],_0xcae5e9);OpenchannelQueueEvents[_0x0b6a('0x6')](_0x18d8db,_0xcae5e9);_0x45bfcd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xd9ed=['emit','hasOwnProperty','events','setMaxListeners','save'];(function(_0x5b147d,_0x43292b){var _0x4b5afb=function(_0x1349d3){while(--_0x1349d3){_0x5b147d['push'](_0x5b147d['shift']());}};_0x4b5afb(++_0x43292b);}(_0xd9ed,0x16f));var _0xdd9e=function(_0x3058c8,_0x2ebc13){_0x3058c8=_0x3058c8-0x0;var _0x2d7799=_0xd9ed[_0x3058c8];return _0x2d7799;};'use strict';var EventEmitter=require(_0xdd9e('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xdd9e('0x1')](0x0);var events={'afterCreate':_0xdd9e('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x20232f){return function(_0xce4e7b,_0x3ce039,_0x385de9){OpenchannelQueueEvents[_0xdd9e('0x3')](_0x20232f+':'+_0xce4e7b['id'],_0xce4e7b);OpenchannelQueueEvents['emit'](_0x20232f,_0xce4e7b);_0x385de9(null);};}for(var e in events){if(events[_0xdd9e('0x4')](e)){var event=events[e];OpenchannelQueue['hook'](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 05571aa..486a906 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 _0x7a9c=['OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7a9c,0x147));var _0xc7a9=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x7a9c[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0xc7a9('0x0'));var util=require(_0xc7a9('0x1'));var logger=require(_0xc7a9('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc7a9('0x3'));var rp=require(_0xc7a9('0x4'));var fs=require('fs');var path=require(_0xc7a9('0x5'));var rimraf=require(_0xc7a9('0x6'));var config=require(_0xc7a9('0x7'));var attributes=require(_0xc7a9('0x8'));module[_0xc7a9('0x9')]=function(_0x567202,_0x37b90e){return _0x567202[_0xc7a9('0xa')](_0xc7a9('0xb'),attributes,{'tableName':_0xc7a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf60=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger'];(function(_0x22455e,_0x1562fa){var _0x38fd15=function(_0x1dd0f2){while(--_0x1dd0f2){_0x22455e['push'](_0x22455e['shift']());}};_0x38fd15(++_0x1562fa);}(_0xdf60,0x1c4));var _0x0df6=function(_0x54e4a4,_0x335886){_0x54e4a4=_0x54e4a4-0x0;var _0x2190ec=_0xdf60[_0x54e4a4];return _0x2190ec;};'use strict';var _=require(_0x0df6('0x0'));var util=require(_0x0df6('0x1'));var logger=require(_0x0df6('0x2'))('api');var moment=require(_0x0df6('0x3'));var BPromise=require(_0x0df6('0x4'));var rp=require(_0x0df6('0x5'));var fs=require('fs');var path=require(_0x0df6('0x6'));var rimraf=require(_0x0df6('0x7'));var config=require(_0x0df6('0x8'));var attributes=require(_0x0df6('0x9'));module['exports']=function(_0x24ed27,_0xe78219){return _0x24ed27[_0x0df6('0xa')](_0x0df6('0xb'),attributes,{'tableName':_0x0df6('0xc'),'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 de93f88..84e2e42 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 _0xd988=['error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','attributes','include','map','model','then','debug','ShowOpenchannelQueue','raw','info','lodash','util','../../config/utils','../../config/logger','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','OpenchannelQueue,\x20%s,\x20%s','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0xd988,0x12b));var _0x8d98=function(_0x3fa067,_0x100df8){_0x3fa067=_0x3fa067-0x0;var _0xe623fe=_0xd988[_0x3fa067];return _0xe623fe;};'use strict';var _=require(_0x8d98('0x0'));var util=require(_0x8d98('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8d98('0x2'));var logger=require(_0x8d98('0x3'))('rpc');var config=require(_0x8d98('0x4'));var jayson=require(_0x8d98('0x5'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x8d98('0x6')](config[_0x8d98('0x7')],{'host':_0x8d98('0x8'),'port':0x18eb});var socket=require(_0x8d98('0x9'))(new Redis(config[_0x8d98('0x7')]));require(_0x8d98('0xa'))['register'](socket);function respondWithRpcPromise(_0x208c96,_0x462081,_0x392609){return new BPromise(function(_0xc2e76a,_0x1db668){return client[_0x8d98('0xb')](_0x208c96,_0x392609)['then'](function(_0x163f5f){logger['info'](_0x8d98('0xc'),_0x462081,'request\x20sent');logger['debug'](_0x8d98('0xd'),_0x462081,_0x8d98('0xe'),JSON[_0x8d98('0xf')](_0x163f5f));if(_0x163f5f[_0x8d98('0x10')]){if(_0x163f5f['error'][_0x8d98('0x11')]===0x1f4){logger['error'](_0x8d98('0xc'),_0x462081,_0x163f5f[_0x8d98('0x10')][_0x8d98('0x12')]);return _0x1db668(_0x163f5f[_0x8d98('0x10')]['message']);}logger[_0x8d98('0x10')](_0x8d98('0xc'),_0x462081,_0x163f5f[_0x8d98('0x10')][_0x8d98('0x12')]);return _0xc2e76a(_0x163f5f[_0x8d98('0x10')][_0x8d98('0x12')]);}else{logger['info'](_0x8d98('0xc'),_0x462081,'request\x20sent');_0xc2e76a(_0x163f5f[_0x8d98('0x13')][_0x8d98('0x12')]);}})[_0x8d98('0x14')](function(_0x530f5e){logger['error'](_0x8d98('0xc'),_0x462081,_0x530f5e);_0x1db668(_0x530f5e);});});}exports[_0x8d98('0x15')]=function(_0xcfd6fb){var _0x336336=this;return new Promise(function(_0x2b19c1,_0x1a6370){return db[_0x8d98('0x16')][_0x8d98('0x17')]({'raw':_0xcfd6fb[_0x8d98('0x18')]?_0xcfd6fb[_0x8d98('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xcfd6fb[_0x8d98('0x18')]?_0xcfd6fb[_0x8d98('0x18')][_0x8d98('0x19')]||null:null,'attributes':_0xcfd6fb[_0x8d98('0x18')]?_0xcfd6fb['options'][_0x8d98('0x1a')]||null:null,'limit':_0xcfd6fb['options']?_0xcfd6fb['options']['limit']||null:null,'include':_0xcfd6fb['options']?_0xcfd6fb[_0x8d98('0x18')][_0x8d98('0x1b')]?_[_0x8d98('0x1c')](_0xcfd6fb[_0x8d98('0x18')]['include'],function(_0x170a0d){return{'model':db[_0x170a0d[_0x8d98('0x1d')]],'as':_0x170a0d['as'],'attributes':_0x170a0d[_0x8d98('0x1a')],'include':_0x170a0d[_0x8d98('0x1b')]?_['map'](_0x170a0d['include'],function(_0x494a45){return{'model':db[_0x494a45[_0x8d98('0x1d')]],'as':_0x494a45['as'],'attributes':_0x494a45[_0x8d98('0x1a')],'include':_0x494a45[_0x8d98('0x1b')]?_[_0x8d98('0x1c')](_0x494a45[_0x8d98('0x1b')],function(_0x154f09){return{'model':db[_0x154f09[_0x8d98('0x1d')]],'as':_0x154f09['as'],'attributes':_0x154f09[_0x8d98('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8d98('0x1e')](function(_0x2e0c00){logger['info']('GetOpenchannelQueue',_0xcfd6fb);logger[_0x8d98('0x1f')](_0x8d98('0x15'),_0xcfd6fb,JSON['stringify'](_0x2e0c00));_0x2b19c1(_0x2e0c00);})[_0x8d98('0x14')](function(_0x54d236){logger['error'](_0x8d98('0x15'),_0x54d236[_0x8d98('0x12')],_0xcfd6fb);_0x1a6370(_0x336336[_0x8d98('0x10')](0x1f4,_0x54d236[_0x8d98('0x12')]));});});};exports[_0x8d98('0x20')]=function(_0x2a114c){var _0x567905=this;return new Promise(function(_0x4f7dbd,_0x3f9a3f){return db[_0x8d98('0x16')]['find']({'raw':_0x2a114c[_0x8d98('0x18')]?_0x2a114c['options'][_0x8d98('0x21')]===undefined?!![]:![]:!![],'where':_0x2a114c[_0x8d98('0x18')]?_0x2a114c[_0x8d98('0x18')][_0x8d98('0x19')]||null:null,'attributes':_0x2a114c['options']?_0x2a114c[_0x8d98('0x18')][_0x8d98('0x1a')]||null:null,'include':_0x2a114c[_0x8d98('0x18')]?_0x2a114c[_0x8d98('0x18')]['include']?_['map'](_0x2a114c[_0x8d98('0x18')]['include'],function(_0x5a2158){return{'model':db[_0x5a2158[_0x8d98('0x1d')]],'as':_0x5a2158['as'],'attributes':_0x5a2158['attributes'],'include':_0x5a2158[_0x8d98('0x1b')]?_[_0x8d98('0x1c')](_0x5a2158[_0x8d98('0x1b')],function(_0x16f680){return{'model':db[_0x16f680['model']],'as':_0x16f680['as'],'attributes':_0x16f680[_0x8d98('0x1a')],'include':_0x16f680[_0x8d98('0x1b')]?_[_0x8d98('0x1c')](_0x16f680[_0x8d98('0x1b')],function(_0x325ec8){return{'model':db[_0x325ec8[_0x8d98('0x1d')]],'as':_0x325ec8['as'],'attributes':_0x325ec8[_0x8d98('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8d98('0x1e')](function(_0x290139){logger[_0x8d98('0x22')](_0x8d98('0x20'),_0x2a114c);logger[_0x8d98('0x1f')](_0x8d98('0x20'),_0x2a114c,JSON['stringify'](_0x290139));_0x4f7dbd(_0x290139);})[_0x8d98('0x14')](function(_0x491f2d){logger[_0x8d98('0x10')](_0x8d98('0x20'),_0x491f2d[_0x8d98('0x12')],_0x2a114c);_0x3f9a3f(_0x567905[_0x8d98('0x10')](0x1f4,_0x491f2d['message']));});});}; \ No newline at end of file +var _0x0713=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./openchannelQueue.socket','request','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowOpenchannelQueue','find','lodash'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x0713,0x12c));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3071('0x0'));var util=require(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rs=require(_0x3071('0x4'));var fs=require('fs');var Redis=require(_0x3071('0x5'));var db=require(_0x3071('0x6'))['db'];var utils=require(_0x3071('0x7'));var logger=require(_0x3071('0x8'))(_0x3071('0x9'));var config=require(_0x3071('0xa'));var jayson=require(_0x3071('0xb'));var client=jayson[_0x3071('0xc')]['http']({'port':0x232a});config[_0x3071('0xd')]=_[_0x3071('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3071('0xf'))(new Redis(config[_0x3071('0xd')]));require(_0x3071('0x10'))['register'](socket);function respondWithRpcPromise(_0x54b468,_0x4106fa,_0x3d3304){return new BPromise(function(_0x50b9e5,_0x391e41){return client[_0x3071('0x11')](_0x54b468,_0x3d3304)['then'](function(_0x2de9de){logger[_0x3071('0x12')](_0x3071('0x13'),_0x4106fa,'request\x20sent');logger[_0x3071('0x14')](_0x3071('0x15'),_0x4106fa,_0x3071('0x16'),JSON[_0x3071('0x17')](_0x2de9de));if(_0x2de9de[_0x3071('0x18')]){if(_0x2de9de['error'][_0x3071('0x19')]===0x1f4){logger[_0x3071('0x18')](_0x3071('0x13'),_0x4106fa,_0x2de9de[_0x3071('0x18')]['message']);return _0x391e41(_0x2de9de[_0x3071('0x18')][_0x3071('0x1a')]);}logger[_0x3071('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x4106fa,_0x2de9de['error'][_0x3071('0x1a')]);return _0x50b9e5(_0x2de9de[_0x3071('0x18')][_0x3071('0x1a')]);}else{logger[_0x3071('0x12')](_0x3071('0x13'),_0x4106fa,_0x3071('0x16'));_0x50b9e5(_0x2de9de[_0x3071('0x1b')][_0x3071('0x1a')]);}})[_0x3071('0x1c')](function(_0x1259ac){logger[_0x3071('0x18')](_0x3071('0x13'),_0x4106fa,_0x1259ac);_0x391e41(_0x1259ac);});});}exports[_0x3071('0x1d')]=function(_0x14a17e){var _0x5c2896=this;return new Promise(function(_0x5ac8b2,_0x299832){return db[_0x3071('0x1e')][_0x3071('0x1f')]({'raw':_0x14a17e[_0x3071('0x20')]?_0x14a17e[_0x3071('0x20')][_0x3071('0x21')]===undefined?!![]:![]:!![],'where':_0x14a17e[_0x3071('0x20')]?_0x14a17e[_0x3071('0x20')][_0x3071('0x22')]||null:null,'attributes':_0x14a17e['options']?_0x14a17e[_0x3071('0x20')][_0x3071('0x23')]||null:null,'limit':_0x14a17e[_0x3071('0x20')]?_0x14a17e[_0x3071('0x20')][_0x3071('0x24')]||null:null,'include':_0x14a17e[_0x3071('0x20')]?_0x14a17e['options'][_0x3071('0x25')]?_[_0x3071('0x26')](_0x14a17e[_0x3071('0x20')]['include'],function(_0x1b6856){return{'model':db[_0x1b6856[_0x3071('0x27')]],'as':_0x1b6856['as'],'attributes':_0x1b6856['attributes'],'include':_0x1b6856[_0x3071('0x25')]?_['map'](_0x1b6856[_0x3071('0x25')],function(_0x28a071){return{'model':db[_0x28a071[_0x3071('0x27')]],'as':_0x28a071['as'],'attributes':_0x28a071[_0x3071('0x23')],'include':_0x28a071[_0x3071('0x25')]?_['map'](_0x28a071[_0x3071('0x25')],function(_0x375488){return{'model':db[_0x375488[_0x3071('0x27')]],'as':_0x375488['as'],'attributes':_0x375488['attributes']};}):[]};}):[]};}):[]:[]})[_0x3071('0x28')](function(_0x255522){logger[_0x3071('0x12')](_0x3071('0x1d'),_0x14a17e);logger[_0x3071('0x14')](_0x3071('0x1d'),_0x14a17e,JSON['stringify'](_0x255522));_0x5ac8b2(_0x255522);})[_0x3071('0x1c')](function(_0x3e2a33){logger[_0x3071('0x18')](_0x3071('0x1d'),_0x3e2a33[_0x3071('0x1a')],_0x14a17e);_0x299832(_0x5c2896[_0x3071('0x18')](0x1f4,_0x3e2a33[_0x3071('0x1a')]));});});};exports[_0x3071('0x29')]=function(_0x9b0eeb){var _0x474e6a=this;return new Promise(function(_0x551631,_0x338e31){return db[_0x3071('0x1e')][_0x3071('0x2a')]({'raw':_0x9b0eeb[_0x3071('0x20')]?_0x9b0eeb[_0x3071('0x20')][_0x3071('0x21')]===undefined?!![]:![]:!![],'where':_0x9b0eeb[_0x3071('0x20')]?_0x9b0eeb[_0x3071('0x20')][_0x3071('0x22')]||null:null,'attributes':_0x9b0eeb[_0x3071('0x20')]?_0x9b0eeb[_0x3071('0x20')][_0x3071('0x23')]||null:null,'include':_0x9b0eeb[_0x3071('0x20')]?_0x9b0eeb[_0x3071('0x20')][_0x3071('0x25')]?_[_0x3071('0x26')](_0x9b0eeb[_0x3071('0x20')][_0x3071('0x25')],function(_0x2ac399){return{'model':db[_0x2ac399[_0x3071('0x27')]],'as':_0x2ac399['as'],'attributes':_0x2ac399[_0x3071('0x23')],'include':_0x2ac399[_0x3071('0x25')]?_['map'](_0x2ac399[_0x3071('0x25')],function(_0x28dd66){return{'model':db[_0x28dd66[_0x3071('0x27')]],'as':_0x28dd66['as'],'attributes':_0x28dd66['attributes'],'include':_0x28dd66[_0x3071('0x25')]?_[_0x3071('0x26')](_0x28dd66[_0x3071('0x25')],function(_0x206c99){return{'model':db[_0x206c99[_0x3071('0x27')]],'as':_0x206c99['as'],'attributes':_0x206c99['attributes']};}):[]};}):[]};}):[]:[]})[_0x3071('0x28')](function(_0x3fda6a){logger[_0x3071('0x12')](_0x3071('0x29'),_0x9b0eeb);logger[_0x3071('0x14')](_0x3071('0x29'),_0x9b0eeb,JSON[_0x3071('0x17')](_0x3fda6a));_0x551631(_0x3fda6a);})['catch'](function(_0x2971ed){logger[_0x3071('0x18')](_0x3071('0x29'),_0x2971ed[_0x3071('0x1a')],_0x9b0eeb);_0x338e31(_0x474e6a['error'](0x1f4,_0x2971ed[_0x3071('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 5c56642..dd9ad07 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 _0x7189=['length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x4572fc,_0x3c5f49){var _0x25f2f5=function(_0x4c6804){while(--_0x4c6804){_0x4572fc['push'](_0x4572fc['shift']());}};_0x25f2f5(++_0x3c5f49);}(_0x7189,0x134));var _0x9718=function(_0x31c133,_0x3075f7){_0x31c133=_0x31c133-0x0;var _0x596121=_0x7189[_0x31c133];return _0x596121;};'use strict';var OpenchannelQueueEvents=require(_0x9718('0x0'));var events=[_0x9718('0x1'),_0x9718('0x2'),_0x9718('0x3')];function createListener(_0x3b6c3b,_0x2facc9){return function(_0x44792c){_0x2facc9[_0x9718('0x4')](_0x3b6c3b,_0x44792c);};}function removeListener(_0x16ce31,_0x239f45){return function(){OpenchannelQueueEvents[_0x9718('0x5')](_0x16ce31,_0x239f45);};}exports[_0x9718('0x6')]=function(_0x1c0bb6){for(var _0x43fc51=0x0,_0x4103f7=events[_0x9718('0x7')];_0x43fc51<_0x4103f7;_0x43fc51++){var _0x30dbd8=events[_0x43fc51];var _0x3f8c75=createListener(_0x9718('0x8')+_0x30dbd8,_0x1c0bb6);OpenchannelQueueEvents['on'](_0x30dbd8,_0x3f8c75);}}; \ No newline at end of file +var _0x90e2=['removeListener','length','openchannelQueue:','save'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0x90e2,0x183));var _0x290e=function(_0x5e98c2,_0x49675b){_0x5e98c2=_0x5e98c2-0x0;var _0xd987d8=_0x90e2[_0x5e98c2];return _0xd987d8;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x290e('0x0'),'remove','update'];function createListener(_0x3568ed,_0x41736c){return function(_0x453caf){_0x41736c['emit'](_0x3568ed,_0x453caf);};}function removeListener(_0x26c839,_0x5a244a){return function(){OpenchannelQueueEvents[_0x290e('0x1')](_0x26c839,_0x5a244a);};}exports['register']=function(_0x502fde){for(var _0x5b3c09=0x0,_0x1e2e8b=events[_0x290e('0x2')];_0x5b3c09<_0x1e2e8b;_0x5b3c09++){var _0x27927b=events[_0x5b3c09];var _0x1727e7=createListener(_0x290e('0x3')+_0x27927b,_0x502fde);OpenchannelQueueEvents['on'](_0x27927b,_0x1727e7);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index d11086e..25062b5 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 _0x3f31=['Router','fs-extra','./openchannelQueueReport.controller','get','index','describe','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','path','connect-timeout','express'];(function(_0x24ab32,_0x20ac51){var _0x2559ef=function(_0x5a6bf3){while(--_0x5a6bf3){_0x24ab32['push'](_0x24ab32['shift']());}};_0x2559ef(++_0x20ac51);}(_0x3f31,0x7b));var _0x13f3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3f31[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x13f3('0x0'));var timeout=require(_0x13f3('0x1'));var express=require(_0x13f3('0x2'));var router=express[_0x13f3('0x3')]();var fs_extra=require(_0x13f3('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x13f3('0x5'));router[_0x13f3('0x6')]('/',auth['isAuthenticated'](),controller[_0x13f3('0x7')]);router[_0x13f3('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x13f3('0x8')]);router[_0x13f3('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x13f3('0x9')]);router[_0x13f3('0xa')]('/',auth[_0x13f3('0xb')](),controller[_0x13f3('0xc')]);router[_0x13f3('0xd')](_0x13f3('0xe'),auth[_0x13f3('0xb')](),controller[_0x13f3('0xf')]);router[_0x13f3('0x10')](_0x13f3('0xe'),auth[_0x13f3('0xb')](),controller[_0x13f3('0x11')]);module['exports']=router; \ No newline at end of file +var _0x67b1=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x67b1,0xfd));var _0x167b=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0x67b1[_0xb99421];return _0x4b3ec7;};'use strict';var multer=require('multer');var util=require(_0x167b('0x0'));var path=require(_0x167b('0x1'));var timeout=require(_0x167b('0x2'));var express=require(_0x167b('0x3'));var router=express['Router']();var fs_extra=require(_0x167b('0x4'));var auth=require(_0x167b('0x5'));var interaction=require(_0x167b('0x6'));var config=require(_0x167b('0x7'));var controller=require(_0x167b('0x8'));router[_0x167b('0x9')]('/',auth[_0x167b('0xa')](),controller[_0x167b('0xb')]);router[_0x167b('0x9')](_0x167b('0xc'),auth[_0x167b('0xa')](),controller[_0x167b('0xd')]);router[_0x167b('0x9')](_0x167b('0xe'),auth[_0x167b('0xa')](),controller[_0x167b('0xf')]);router[_0x167b('0x10')]('/',auth[_0x167b('0xa')](),controller['create']);router[_0x167b('0x11')](_0x167b('0xe'),auth[_0x167b('0xa')](),controller[_0x167b('0x12')]);router[_0x167b('0x13')](_0x167b('0xe'),auth[_0x167b('0xa')](),controller['destroy']);module[_0x167b('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 6534757..e0b044b 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 _0x2374=['moment','exports','STRING','DATE'];(function(_0x1cb9e2,_0x5733b8){var _0x7aaf1a=function(_0x119066){while(--_0x119066){_0x1cb9e2['push'](_0x1cb9e2['shift']());}};_0x7aaf1a(++_0x5733b8);}(_0x2374,0x11c));var _0x4237=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2374[_0x3bf83f];return _0x22c4a9;};'use strict';var moment=require(_0x4237('0x0'));var Sequelize=require('sequelize');module[_0x4237('0x1')]={'uniqueid':{'type':Sequelize[_0x4237('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x4237('0x2')]},'joinAt':{'type':Sequelize[_0x4237('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x4237('0x3')]},'exitAt':{'type':Sequelize[_0x4237('0x3')]},'reason':{'type':Sequelize[_0x4237('0x2')]}}; \ No newline at end of file +var _0x90fc=['STRING','DATE','sequelize','exports'];(function(_0x3370aa,_0x282cfc){var _0xa5801a=function(_0x22144e){while(--_0x22144e){_0x3370aa['push'](_0x3370aa['shift']());}};_0xa5801a(++_0x282cfc);}(_0x90fc,0x186));var _0xc90f=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x90fc[_0x88cd7b];return _0x56fcc8;};'use strict';var moment=require('moment');var Sequelize=require(_0xc90f('0x0'));module[_0xc90f('0x1')]={'uniqueid':{'type':Sequelize[_0xc90f('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc90f('0x3')]},'leaveAt':{'type':Sequelize[_0xc90f('0x3')]},'acceptAt':{'type':Sequelize[_0xc90f('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc90f('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 9855345..71696aa 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 _0xd5e7=['where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','merge','create','body','find','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','map','OpenchannelQueueReport','rawAttributes','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5f3cf4,_0x5ae4e4){var _0x386189=function(_0x4f65ab){while(--_0x4f65ab){_0x5f3cf4['push'](_0x5f3cf4['shift']());}};_0x386189(++_0x5ae4e4);}(_0xd5e7,0xef));var _0x7d5e=function(_0x933ae6,_0x4c422b){_0x933ae6=_0x933ae6-0x0;var _0x11e2e9=_0xd5e7[_0x933ae6];return _0x11e2e9;};'use strict';var emlformat=require(_0x7d5e('0x0'));var rimraf=require(_0x7d5e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7d5e('0x2'));var rp=require('request-promise');var moment=require(_0x7d5e('0x3'));var BPromise=require(_0x7d5e('0x4'));var Mustache=require(_0x7d5e('0x5'));var util=require(_0x7d5e('0x6'));var path=require(_0x7d5e('0x7'));var sox=require(_0x7d5e('0x8'));var csv=require(_0x7d5e('0x9'));var ejs=require(_0x7d5e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d5e('0xb'));var squel=require(_0x7d5e('0xc'));var crypto=require(_0x7d5e('0xd'));var jsforce=require(_0x7d5e('0xe'));var deskjs=require(_0x7d5e('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7d5e('0x10'));var Redis=require(_0x7d5e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7d5e('0x12'));var as=require(_0x7d5e('0x13'));var hardwareService=require(_0x7d5e('0x14'));var logger=require('../../config/logger')(_0x7d5e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d5e('0x16'));var db=require(_0x7d5e('0x17'))['db'];function respondWithStatusCode(_0x24d44a,_0x110182){_0x110182=_0x110182||0xcc;return function(_0x2f3487){if(_0x2f3487){return _0x24d44a['sendStatus'](_0x110182);}return _0x24d44a['status'](_0x110182)[_0x7d5e('0x18')]();};}function respondWithResult(_0xf39924,_0x523c1c){_0x523c1c=_0x523c1c||0xc8;return function(_0x109f6c){if(_0x109f6c){return _0xf39924[_0x7d5e('0x19')](_0x523c1c)['json'](_0x109f6c);}};}function respondWithFilteredResult(_0x129d67,_0x5ef51){return function(_0x239eb0){if(_0x239eb0){var _0x1edac5=typeof _0x5ef51[_0x7d5e('0x1a')]===_0x7d5e('0x1b')&&typeof _0x5ef51[_0x7d5e('0x1c')]===_0x7d5e('0x1b');var _0x42c6de=_0x239eb0[_0x7d5e('0x1d')];var _0x33cd4b=_0x1edac5?0x0:_0x5ef51[_0x7d5e('0x1a')];var _0x29acd0=_0x1edac5?_0x239eb0[_0x7d5e('0x1d')]:_0x5ef51[_0x7d5e('0x1a')]+_0x5ef51['limit'];var _0x551159;if(_0x29acd0>=_0x42c6de){_0x29acd0=_0x42c6de;_0x551159=0xc8;}else{_0x551159=0xce;}_0x129d67[_0x7d5e('0x19')](_0x551159);return _0x129d67[_0x7d5e('0x1e')](_0x7d5e('0x1f'),_0x33cd4b+'-'+_0x29acd0+'/'+_0x42c6de)['json'](_0x239eb0);}return null;};}function patchUpdates(_0x3b3a64){return function(_0x3da403){try{jsonpatch['apply'](_0x3da403,_0x3b3a64,!![]);}catch(_0x32e666){return BPromise[_0x7d5e('0x20')](_0x32e666);}return _0x3da403[_0x7d5e('0x21')]();};}function saveUpdates(_0x3c03bd,_0x1ec3b7){return function(_0x34732b){if(_0x34732b){return _0x34732b[_0x7d5e('0x22')](_0x3c03bd)[_0x7d5e('0x23')](function(_0x16e74a){return _0x16e74a;});}return null;};}function removeEntity(_0xf25faa,_0xd41898){return function(_0x2fead1){if(_0x2fead1){return _0x2fead1[_0x7d5e('0x24')]()[_0x7d5e('0x23')](function(){_0xf25faa['status'](0xcc)[_0x7d5e('0x18')]();});}};}function handleEntityNotFound(_0x1740ec,_0x106bfa){return function(_0x34fc80){if(!_0x34fc80){_0x1740ec[_0x7d5e('0x25')](0x194);}return _0x34fc80;};}function handleError(_0x1060d3,_0x3d6d3b){_0x3d6d3b=_0x3d6d3b||0x1f4;return function(_0x1af201){logger[_0x7d5e('0x26')](_0x1af201[_0x7d5e('0x27')]);if(_0x1af201['name']){delete _0x1af201['name'];}_0x1060d3['status'](_0x3d6d3b)['send'](_0x1af201);};}exports['index']=function(_0x41baa2,_0x549101){var _0x59dc1b={},_0x30ed5b={},_0xa17e71={'count':0x0,'rows':[]};var _0x12ffed=_[_0x7d5e('0x28')](db[_0x7d5e('0x29')][_0x7d5e('0x2a')],function(_0x3b745a){return{'name':_0x3b745a['fieldName'],'type':_0x3b745a['type'][_0x7d5e('0x2b')]};});_0x30ed5b[_0x7d5e('0x2c')]=_['map'](_0x12ffed,_0x7d5e('0x2d'));_0x30ed5b['query']=_[_0x7d5e('0x2e')](_0x41baa2[_0x7d5e('0x2f')]);_0x30ed5b[_0x7d5e('0x30')]=_[_0x7d5e('0x31')](_0x30ed5b['model'],_0x30ed5b[_0x7d5e('0x2f')]);_0x59dc1b[_0x7d5e('0x32')]=_[_0x7d5e('0x31')](_0x30ed5b['model'],qs[_0x7d5e('0x33')](_0x41baa2[_0x7d5e('0x2f')][_0x7d5e('0x33')]));_0x59dc1b[_0x7d5e('0x32')]=_0x59dc1b[_0x7d5e('0x32')][_0x7d5e('0x34')]?_0x59dc1b['attributes']:_0x30ed5b[_0x7d5e('0x2c')];if(!_0x41baa2[_0x7d5e('0x2f')][_0x7d5e('0x35')](_0x7d5e('0x36'))){_0x59dc1b['limit']=qs[_0x7d5e('0x1c')](_0x41baa2[_0x7d5e('0x2f')]['limit']);_0x59dc1b[_0x7d5e('0x1a')]=qs[_0x7d5e('0x1a')](_0x41baa2[_0x7d5e('0x2f')][_0x7d5e('0x1a')]);}_0x59dc1b[_0x7d5e('0x37')]=qs[_0x7d5e('0x38')](_0x41baa2[_0x7d5e('0x2f')][_0x7d5e('0x38')]);_0x59dc1b[_0x7d5e('0x39')]=qs['filters'](_[_0x7d5e('0x3a')](_0x41baa2['query'],_0x30ed5b[_0x7d5e('0x30')]),_0x12ffed);if(_0x41baa2[_0x7d5e('0x2f')][_0x7d5e('0x3b')]){_0x59dc1b[_0x7d5e('0x39')]=_['merge'](_0x59dc1b[_0x7d5e('0x39')],{'$or':_[_0x7d5e('0x28')](_0x12ffed,function(_0x179714){if(_0x179714[_0x7d5e('0x3c')]!==_0x7d5e('0x3d')){var _0x47e8d4={};_0x47e8d4[_0x179714['name']]={'$like':'%'+_0x41baa2[_0x7d5e('0x2f')][_0x7d5e('0x3b')]+'%'};return _0x47e8d4;}})});}_0x59dc1b=_['merge']({},_0x59dc1b,_0x41baa2[_0x7d5e('0x3e')]);var _0x2a7c45={'where':_0x59dc1b[_0x7d5e('0x39')]};return db[_0x7d5e('0x29')][_0x7d5e('0x1d')](_0x2a7c45)[_0x7d5e('0x23')](function(_0x47e76b){_0xa17e71[_0x7d5e('0x1d')]=_0x47e76b;if(_0x41baa2[_0x7d5e('0x2f')][_0x7d5e('0x3f')]){_0x59dc1b[_0x7d5e('0x40')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x7d5e('0x41')](_0x59dc1b);})[_0x7d5e('0x23')](function(_0x4a1a2e){_0xa17e71[_0x7d5e('0x42')]=_0x4a1a2e;return _0xa17e71;})[_0x7d5e('0x23')](respondWithFilteredResult(_0x549101,_0x59dc1b))[_0x7d5e('0x43')](handleError(_0x549101,null));};exports['show']=function(_0xa3cef4,_0x50dae6){var _0xb22b6e={'raw':!![],'where':{'id':_0xa3cef4[_0x7d5e('0x44')]['id']}},_0x2acbe4={};_0x2acbe4[_0x7d5e('0x2c')]=_[_0x7d5e('0x2e')](db['OpenchannelQueueReport'][_0x7d5e('0x2a')]);_0x2acbe4['query']=_[_0x7d5e('0x2e')](_0xa3cef4[_0x7d5e('0x2f')]);_0x2acbe4[_0x7d5e('0x30')]=_[_0x7d5e('0x31')](_0x2acbe4[_0x7d5e('0x2c')],_0x2acbe4[_0x7d5e('0x2f')]);_0xb22b6e[_0x7d5e('0x32')]=_[_0x7d5e('0x31')](_0x2acbe4[_0x7d5e('0x2c')],qs[_0x7d5e('0x33')](_0xa3cef4[_0x7d5e('0x2f')][_0x7d5e('0x33')]));_0xb22b6e['attributes']=_0xb22b6e[_0x7d5e('0x32')]['length']?_0xb22b6e[_0x7d5e('0x32')]:_0x2acbe4[_0x7d5e('0x2c')];if(_0xa3cef4[_0x7d5e('0x2f')][_0x7d5e('0x3f')]){_0xb22b6e[_0x7d5e('0x40')]=[{'all':!![]}];}_0xb22b6e=_[_0x7d5e('0x45')]({},_0xb22b6e,_0xa3cef4['options']);return db[_0x7d5e('0x29')]['find'](_0xb22b6e)[_0x7d5e('0x23')](handleEntityNotFound(_0x50dae6,null))[_0x7d5e('0x23')](respondWithResult(_0x50dae6,null))[_0x7d5e('0x43')](handleError(_0x50dae6,null));};exports[_0x7d5e('0x46')]=function(_0x58b922,_0x92450c){return db['OpenchannelQueueReport']['create'](_0x58b922['body'],{})[_0x7d5e('0x23')](respondWithResult(_0x92450c,0xc9))['catch'](handleError(_0x92450c,null));};exports[_0x7d5e('0x22')]=function(_0x14e174,_0x55d601){if(_0x14e174[_0x7d5e('0x47')]['id']){delete _0x14e174[_0x7d5e('0x47')]['id'];}return db[_0x7d5e('0x29')][_0x7d5e('0x48')]({'where':{'id':_0x14e174['params']['id']}})['then'](handleEntityNotFound(_0x55d601,null))['then'](saveUpdates(_0x14e174['body'],null))['then'](respondWithResult(_0x55d601,null))['catch'](handleError(_0x55d601,null));};exports[_0x7d5e('0x24')]=function(_0x2eeb3c,_0x23c521){return db[_0x7d5e('0x29')][_0x7d5e('0x48')]({'where':{'id':_0x2eeb3c[_0x7d5e('0x44')]['id']}})[_0x7d5e('0x23')](handleEntityNotFound(_0x23c521,null))[_0x7d5e('0x23')](removeEntity(_0x23c521,null))[_0x7d5e('0x43')](handleError(_0x23c521,null));};exports[_0x7d5e('0x49')]=function(_0x1a6fb3,_0x5bf071){return db['OpenchannelQueueReport']['describe']()['then'](respondWithResult(_0x5bf071,null))[_0x7d5e('0x43')](handleError(_0x5bf071,null));}; \ No newline at end of file +var _0x29bc=['attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','options','OpenchannelQueueReport','includeAll','include','findAll','rows','show','find','catch','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','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','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection'];(function(_0x43379c,_0x271d36){var _0x495648=function(_0x3f4652){while(--_0x3f4652){_0x43379c['push'](_0x43379c['shift']());}};_0x495648(++_0x271d36);}(_0x29bc,0x1a3));var _0xc29b=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x29bc[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0xc29b('0x0'));var rimraf=require(_0xc29b('0x1'));var zipdir=require(_0xc29b('0x2'));var jsonpatch=require(_0xc29b('0x3'));var rp=require(_0xc29b('0x4'));var moment=require(_0xc29b('0x5'));var BPromise=require(_0xc29b('0x6'));var Mustache=require(_0xc29b('0x7'));var util=require(_0xc29b('0x8'));var path=require('path');var sox=require(_0xc29b('0x9'));var csv=require(_0xc29b('0xa'));var ejs=require(_0xc29b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc29b('0xc'));var squel=require(_0xc29b('0xd'));var crypto=require('crypto');var jsforce=require(_0xc29b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc29b('0xa'));var querystring=require(_0xc29b('0xf'));var Papa=require(_0xc29b('0x10'));var Redis=require(_0xc29b('0x11'));var authService=require(_0xc29b('0x12'));var qs=require(_0xc29b('0x13'));var as=require(_0xc29b('0x14'));var hardwareService=require(_0xc29b('0x15'));var logger=require(_0xc29b('0x16'))(_0xc29b('0x17'));var utils=require(_0xc29b('0x18'));var config=require(_0xc29b('0x19'));var licenseUtil=require(_0xc29b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e6456,_0x37a580){_0x37a580=_0x37a580||0xcc;return function(_0x458074){if(_0x458074){return _0x5e6456[_0xc29b('0x1b')](_0x37a580);}return _0x5e6456[_0xc29b('0x1c')](_0x37a580)[_0xc29b('0x1d')]();};}function respondWithResult(_0xb48148,_0x44b0ad){_0x44b0ad=_0x44b0ad||0xc8;return function(_0x1cee82){if(_0x1cee82){return _0xb48148[_0xc29b('0x1c')](_0x44b0ad)[_0xc29b('0x1e')](_0x1cee82);}};}function respondWithFilteredResult(_0x3c1283,_0x3b13fd){return function(_0x5a45e0){if(_0x5a45e0){var _0x24b113=typeof _0x3b13fd[_0xc29b('0x1f')]===_0xc29b('0x20')&&typeof _0x3b13fd[_0xc29b('0x21')]===_0xc29b('0x20');var _0x4fec9f=_0x5a45e0[_0xc29b('0x22')];var _0x36b893=_0x24b113?0x0:_0x3b13fd[_0xc29b('0x1f')];var _0x6a08ed=_0x24b113?_0x5a45e0[_0xc29b('0x22')]:_0x3b13fd[_0xc29b('0x1f')]+_0x3b13fd[_0xc29b('0x21')];var _0x935bfe;if(_0x6a08ed>=_0x4fec9f){_0x6a08ed=_0x4fec9f;_0x935bfe=0xc8;}else{_0x935bfe=0xce;}_0x3c1283[_0xc29b('0x1c')](_0x935bfe);return _0x3c1283[_0xc29b('0x23')]('Content-Range',_0x36b893+'-'+_0x6a08ed+'/'+_0x4fec9f)['json'](_0x5a45e0);}return null;};}function patchUpdates(_0x13a39b){return function(_0x6bdf53){try{jsonpatch[_0xc29b('0x24')](_0x6bdf53,_0x13a39b,!![]);}catch(_0x41ad91){return BPromise[_0xc29b('0x25')](_0x41ad91);}return _0x6bdf53[_0xc29b('0x26')]();};}function saveUpdates(_0x587f3a,_0x92b5ee){return function(_0x5799dc){if(_0x5799dc){return _0x5799dc['update'](_0x587f3a)[_0xc29b('0x27')](function(_0x5c86e0){return _0x5c86e0;});}return null;};}function removeEntity(_0xf500e4,_0x569816){return function(_0x82f6da){if(_0x82f6da){return _0x82f6da[_0xc29b('0x28')]()[_0xc29b('0x27')](function(){_0xf500e4[_0xc29b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b94bf,_0xbbe28c){return function(_0x367500){if(!_0x367500){_0x2b94bf['sendStatus'](0x194);}return _0x367500;};}function handleError(_0x1a713a,_0x44e25a){_0x44e25a=_0x44e25a||0x1f4;return function(_0x600fb6){logger[_0xc29b('0x29')](_0x600fb6[_0xc29b('0x2a')]);if(_0x600fb6[_0xc29b('0x2b')]){delete _0x600fb6[_0xc29b('0x2b')];}_0x1a713a[_0xc29b('0x1c')](_0x44e25a)[_0xc29b('0x2c')](_0x600fb6);};}exports[_0xc29b('0x2d')]=function(_0x846066,_0x36278d){var _0x13954e={},_0x1f9b5a={},_0x43de27={'count':0x0,'rows':[]};var _0x255e07=_[_0xc29b('0x2e')](db['OpenchannelQueueReport'][_0xc29b('0x2f')],function(_0x7b1857){return{'name':_0x7b1857[_0xc29b('0x30')],'type':_0x7b1857[_0xc29b('0x31')][_0xc29b('0x32')]};});_0x1f9b5a[_0xc29b('0x33')]=_[_0xc29b('0x2e')](_0x255e07,'name');_0x1f9b5a[_0xc29b('0x34')]=_[_0xc29b('0x35')](_0x846066[_0xc29b('0x34')]);_0x1f9b5a['filters']=_[_0xc29b('0x36')](_0x1f9b5a['model'],_0x1f9b5a[_0xc29b('0x34')]);_0x13954e[_0xc29b('0x37')]=_[_0xc29b('0x36')](_0x1f9b5a[_0xc29b('0x33')],qs[_0xc29b('0x38')](_0x846066[_0xc29b('0x34')][_0xc29b('0x38')]));_0x13954e['attributes']=_0x13954e[_0xc29b('0x37')][_0xc29b('0x39')]?_0x13954e['attributes']:_0x1f9b5a[_0xc29b('0x33')];if(!_0x846066[_0xc29b('0x34')][_0xc29b('0x3a')]('nolimit')){_0x13954e['limit']=qs[_0xc29b('0x21')](_0x846066[_0xc29b('0x34')][_0xc29b('0x21')]);_0x13954e[_0xc29b('0x1f')]=qs[_0xc29b('0x1f')](_0x846066['query'][_0xc29b('0x1f')]);}_0x13954e['order']=qs[_0xc29b('0x3b')](_0x846066[_0xc29b('0x34')]['sort']);_0x13954e[_0xc29b('0x3c')]=qs[_0xc29b('0x3d')](_[_0xc29b('0x3e')](_0x846066[_0xc29b('0x34')],_0x1f9b5a[_0xc29b('0x3d')]),_0x255e07);if(_0x846066[_0xc29b('0x34')]['filter']){_0x13954e[_0xc29b('0x3c')]=_[_0xc29b('0x3f')](_0x13954e['where'],{'$or':_[_0xc29b('0x2e')](_0x255e07,function(_0xfee940){if(_0xfee940[_0xc29b('0x31')]!==_0xc29b('0x40')){var _0x57e21c={};_0x57e21c[_0xfee940['name']]={'$like':'%'+_0x846066[_0xc29b('0x34')][_0xc29b('0x41')]+'%'};return _0x57e21c;}})});}_0x13954e=_[_0xc29b('0x3f')]({},_0x13954e,_0x846066[_0xc29b('0x42')]);var _0x2a6d1a={'where':_0x13954e[_0xc29b('0x3c')]};return db[_0xc29b('0x43')][_0xc29b('0x22')](_0x2a6d1a)[_0xc29b('0x27')](function(_0x4b2ae4){_0x43de27[_0xc29b('0x22')]=_0x4b2ae4;if(_0x846066[_0xc29b('0x34')][_0xc29b('0x44')]){_0x13954e[_0xc29b('0x45')]=[{'all':!![]}];}return db[_0xc29b('0x43')][_0xc29b('0x46')](_0x13954e);})[_0xc29b('0x27')](function(_0x25ac8d){_0x43de27[_0xc29b('0x47')]=_0x25ac8d;return _0x43de27;})['then'](respondWithFilteredResult(_0x36278d,_0x13954e))['catch'](handleError(_0x36278d,null));};exports[_0xc29b('0x48')]=function(_0x3933e9,_0x4275d2){var _0x39f8d3={'raw':!![],'where':{'id':_0x3933e9['params']['id']}},_0x5ba3aa={};_0x5ba3aa[_0xc29b('0x33')]=_[_0xc29b('0x35')](db[_0xc29b('0x43')][_0xc29b('0x2f')]);_0x5ba3aa[_0xc29b('0x34')]=_[_0xc29b('0x35')](_0x3933e9['query']);_0x5ba3aa[_0xc29b('0x3d')]=_[_0xc29b('0x36')](_0x5ba3aa['model'],_0x5ba3aa[_0xc29b('0x34')]);_0x39f8d3[_0xc29b('0x37')]=_[_0xc29b('0x36')](_0x5ba3aa[_0xc29b('0x33')],qs[_0xc29b('0x38')](_0x3933e9['query']['fields']));_0x39f8d3['attributes']=_0x39f8d3[_0xc29b('0x37')]['length']?_0x39f8d3['attributes']:_0x5ba3aa[_0xc29b('0x33')];if(_0x3933e9[_0xc29b('0x34')][_0xc29b('0x44')]){_0x39f8d3[_0xc29b('0x45')]=[{'all':!![]}];}_0x39f8d3=_['merge']({},_0x39f8d3,_0x3933e9[_0xc29b('0x42')]);return db[_0xc29b('0x43')][_0xc29b('0x49')](_0x39f8d3)[_0xc29b('0x27')](handleEntityNotFound(_0x4275d2,null))['then'](respondWithResult(_0x4275d2,null))[_0xc29b('0x4a')](handleError(_0x4275d2,null));};exports[_0xc29b('0x4b')]=function(_0x1d6593,_0x113771){return db[_0xc29b('0x43')][_0xc29b('0x4b')](_0x1d6593['body'],{})[_0xc29b('0x27')](respondWithResult(_0x113771,0xc9))[_0xc29b('0x4a')](handleError(_0x113771,null));};exports[_0xc29b('0x4c')]=function(_0x112479,_0x223a9e){if(_0x112479['body']['id']){delete _0x112479[_0xc29b('0x4d')]['id'];}return db['OpenchannelQueueReport'][_0xc29b('0x49')]({'where':{'id':_0x112479['params']['id']}})['then'](handleEntityNotFound(_0x223a9e,null))['then'](saveUpdates(_0x112479[_0xc29b('0x4d')],null))[_0xc29b('0x27')](respondWithResult(_0x223a9e,null))[_0xc29b('0x4a')](handleError(_0x223a9e,null));};exports[_0xc29b('0x28')]=function(_0x54323a,_0xaf505e){return db[_0xc29b('0x43')]['find']({'where':{'id':_0x54323a['params']['id']}})[_0xc29b('0x27')](handleEntityNotFound(_0xaf505e,null))[_0xc29b('0x27')](removeEntity(_0xaf505e,null))['catch'](handleError(_0xaf505e,null));};exports[_0xc29b('0x4e')]=function(_0x3b1317,_0x433747){return db[_0xc29b('0x43')][_0xc29b('0x4e')]()[_0xc29b('0x27')](respondWithResult(_0x433747,null))[_0xc29b('0x4a')](handleError(_0x433747,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 27c92d3..26091de 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 _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x37ff70,_0x42c8db){var _0x200da6=function(_0x1f953f){while(--_0x1f953f){_0x37ff70['push'](_0x37ff70['shift']());}};_0x200da6(++_0x42c8db);}(_0x326f,0xd1));var _0xf326=function(_0x377ed1,_0x485abd){_0x377ed1=_0x377ed1-0x0;var _0x22d998=_0x326f[_0x377ed1];return _0x22d998;};'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':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x2143c2,_0x464d78){var _0x4a5840=function(_0x1f401d){while(--_0x1f401d){_0x2143c2['push'](_0x2143c2['shift']());}};_0x4a5840(++_0x464d78);}(_0xe14b,0x93));var _0xbe14=function(_0x395b28,_0x112ebe){_0x395b28=_0x395b28-0x0;var _0x32761b=_0xe14b[_0x395b28];return _0x32761b;};'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/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index b78dfca..ffe418b 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 _0x8cda=['catch','create','body','options','raw','then','CreateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','limit','UpdateOpenchannelQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent'];(function(_0x9d39e9,_0x3aebc9){var _0x4ac75b=function(_0x25bb25){while(--_0x25bb25){_0x9d39e9['push'](_0x9d39e9['shift']());}};_0x4ac75b(++_0x3aebc9);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa8cd('0x0'));var moment=require(_0xa8cd('0x1'));var BPromise=require(_0xa8cd('0x2'));var rs=require(_0xa8cd('0x3'));var fs=require('fs');var Redis=require(_0xa8cd('0x4'));var db=require(_0xa8cd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8cd('0x6'))(_0xa8cd('0x7'));var config=require(_0xa8cd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa8cd('0x9')][_0xa8cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1362c3,_0x273d2f,_0x2b9b51){return new BPromise(function(_0x2481ba,_0x13f394){return client[_0xa8cd('0xb')](_0x1362c3,_0x2b9b51)['then'](function(_0x50b8ee){logger['info'](_0xa8cd('0xc'),_0x273d2f,'request\x20sent');logger[_0xa8cd('0xd')](_0xa8cd('0xe'),_0x273d2f,'request\x20sent',JSON[_0xa8cd('0xf')](_0x50b8ee));if(_0x50b8ee[_0xa8cd('0x10')]){if(_0x50b8ee['error']['code']===0x1f4){logger[_0xa8cd('0x10')](_0xa8cd('0xc'),_0x273d2f,_0x50b8ee[_0xa8cd('0x10')][_0xa8cd('0x11')]);return _0x13f394(_0x50b8ee[_0xa8cd('0x10')]['message']);}logger[_0xa8cd('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x273d2f,_0x50b8ee[_0xa8cd('0x10')]['message']);return _0x2481ba(_0x50b8ee[_0xa8cd('0x10')]['message']);}else{logger[_0xa8cd('0x12')](_0xa8cd('0xc'),_0x273d2f,_0xa8cd('0x13'));_0x2481ba(_0x50b8ee['result']['message']);}})[_0xa8cd('0x14')](function(_0x6d5f40){logger[_0xa8cd('0x10')](_0xa8cd('0xc'),_0x273d2f,_0x6d5f40);_0x13f394(_0x6d5f40);});});}exports['CreateOpenchannelQueueReport']=function(_0x128a90){var _0x52252b=this;return new Promise(function(_0x1cacd5,_0x2ef224){return db['OpenchannelQueueReport'][_0xa8cd('0x15')](_0x128a90[_0xa8cd('0x16')],{'raw':_0x128a90['options']?_0x128a90[_0xa8cd('0x17')][_0xa8cd('0x18')]===undefined?!![]:![]:!![]})[_0xa8cd('0x19')](function(_0x289cb6){logger[_0xa8cd('0x12')]('CreateOpenchannelQueueReport',_0x128a90);logger[_0xa8cd('0xd')](_0xa8cd('0x1a'),_0x128a90,JSON[_0xa8cd('0xf')](_0x289cb6));_0x1cacd5(_0x289cb6);})[_0xa8cd('0x14')](function(_0x4f4093){logger[_0xa8cd('0x10')]('CreateOpenchannelQueueReport',_0x4f4093['message'],_0x128a90);_0x2ef224(_0x52252b[_0xa8cd('0x10')](0x1f4,_0x4f4093[_0xa8cd('0x11')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x1c7b31){var _0x26d35a=this;return new Promise(function(_0xfd170,_0x43462d){return db[_0xa8cd('0x1b')][_0xa8cd('0x1c')](_0x1c7b31[_0xa8cd('0x16')],{'raw':_0x1c7b31['options']?_0x1c7b31[_0xa8cd('0x17')][_0xa8cd('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c7b31[_0xa8cd('0x17')]?_0x1c7b31[_0xa8cd('0x17')][_0xa8cd('0x1d')]||null:null,'attributes':_0x1c7b31[_0xa8cd('0x17')]?_0x1c7b31['options'][_0xa8cd('0x1e')]||null:null,'limit':_0x1c7b31[_0xa8cd('0x17')]?_0x1c7b31[_0xa8cd('0x17')][_0xa8cd('0x1f')]||null:null})[_0xa8cd('0x19')](function(_0x2241f8){logger[_0xa8cd('0x12')](_0xa8cd('0x20'),_0x1c7b31);logger[_0xa8cd('0xd')](_0xa8cd('0x20'),_0x1c7b31,JSON[_0xa8cd('0xf')](_0x2241f8));_0xfd170(_0x2241f8);})[_0xa8cd('0x14')](function(_0x471052){logger[_0xa8cd('0x10')](_0xa8cd('0x20'),_0x471052[_0xa8cd('0x11')],_0x1c7b31);_0x43462d(_0x26d35a['error'](0x1f4,_0x471052['message']));});});}; \ No newline at end of file +var _0xb7e7=['moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','where','attributes','UpdateOpenchannelQueueReport','lodash'];(function(_0x5f553b,_0x39f5ce){var _0x231fae=function(_0x1955b3){while(--_0x1955b3){_0x5f553b['push'](_0x5f553b['shift']());}};_0x231fae(++_0x39f5ce);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb7e7[_0x3e5086];return _0xfeb102;};'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')]('OpenchannelQueueReport,\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);});});}exports[_0x7b7e('0x14')]=function(_0x242368){var _0x200ef7=this;return new Promise(function(_0x2acb8c,_0x429a0e){return db[_0x7b7e('0x15')][_0x7b7e('0x16')](_0x242368[_0x7b7e('0x17')],{'raw':_0x242368[_0x7b7e('0x18')]?_0x242368[_0x7b7e('0x18')][_0x7b7e('0x19')]===undefined?!![]:![]:!![]})[_0x7b7e('0x9')](function(_0x49eddb){logger[_0x7b7e('0xa')](_0x7b7e('0x14'),_0x242368);logger[_0x7b7e('0xc')]('CreateOpenchannelQueueReport',_0x242368,JSON[_0x7b7e('0xf')](_0x49eddb));_0x2acb8c(_0x49eddb);})[_0x7b7e('0x13')](function(_0x14243b){logger[_0x7b7e('0x10')](_0x7b7e('0x14'),_0x14243b[_0x7b7e('0x12')],_0x242368);_0x429a0e(_0x200ef7[_0x7b7e('0x10')](0x1f4,_0x14243b[_0x7b7e('0x12')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x5d6215){var _0x4a836a=this;return new Promise(function(_0x26ee14,_0x22598e){return db[_0x7b7e('0x15')]['update'](_0x5d6215['body'],{'raw':_0x5d6215['options']?_0x5d6215[_0x7b7e('0x18')][_0x7b7e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d6215[_0x7b7e('0x18')]?_0x5d6215[_0x7b7e('0x18')][_0x7b7e('0x1a')]||null:null,'attributes':_0x5d6215['options']?_0x5d6215[_0x7b7e('0x18')][_0x7b7e('0x1b')]||null:null,'limit':_0x5d6215['options']?_0x5d6215['options']['limit']||null:null})[_0x7b7e('0x9')](function(_0x423832){logger['info'](_0x7b7e('0x1c'),_0x5d6215);logger['debug'](_0x7b7e('0x1c'),_0x5d6215,JSON[_0x7b7e('0xf')](_0x423832));_0x26ee14(_0x423832);})[_0x7b7e('0x13')](function(_0x5515ca){logger[_0x7b7e('0x10')](_0x7b7e('0x1c'),_0x5515ca[_0x7b7e('0x12')],_0x5d6215);_0x22598e(_0x4a836a[_0x7b7e('0x10')](0x1f4,_0x5515ca[_0x7b7e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index b67c0ec..83aba3b 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 _0xaef9=['Router','fs-extra','../../components/auth/service','./openchannelTransferReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put','update','delete','util','path','connect-timeout','express'];(function(_0x6acccc,_0x46e599){var _0x306b4c=function(_0x295fd2){while(--_0x295fd2){_0x6acccc['push'](_0x6acccc['shift']());}};_0x306b4c(++_0x46e599);}(_0xaef9,0x1f4));var _0x9aef=function(_0x1587f9,_0x253d0c){_0x1587f9=_0x1587f9-0x0;var _0x3dc02e=_0xaef9[_0x1587f9];return _0x3dc02e;};'use strict';var multer=require('multer');var util=require(_0x9aef('0x0'));var path=require(_0x9aef('0x1'));var timeout=require(_0x9aef('0x2'));var express=require(_0x9aef('0x3'));var router=express[_0x9aef('0x4')]();var fs_extra=require(_0x9aef('0x5'));var auth=require(_0x9aef('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9aef('0x7'));router[_0x9aef('0x8')]('/',auth[_0x9aef('0x9')](),controller[_0x9aef('0xa')]);router[_0x9aef('0x8')]('/describe',auth[_0x9aef('0x9')](),controller[_0x9aef('0xb')]);router[_0x9aef('0x8')](_0x9aef('0xc'),auth[_0x9aef('0x9')](),controller['show']);router[_0x9aef('0xd')]('/',auth['isAuthenticated'](),controller[_0x9aef('0xe')]);router[_0x9aef('0xf')](_0x9aef('0xc'),auth[_0x9aef('0x9')](),controller[_0x9aef('0x10')]);router[_0x9aef('0x11')](_0x9aef('0xc'),auth[_0x9aef('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb72a=['isAuthenticated','index','/describe','post','put','update','/:id','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0xb72a,0x1e3));var _0xab72=function(_0x58c0fe,_0x234b20){_0x58c0fe=_0x58c0fe-0x0;var _0xbe68fd=_0xb72a[_0x58c0fe];return _0xbe68fd;};'use strict';var multer=require(_0xab72('0x0'));var util=require(_0xab72('0x1'));var path=require('path');var timeout=require(_0xab72('0x2'));var express=require(_0xab72('0x3'));var router=express[_0xab72('0x4')]();var fs_extra=require(_0xab72('0x5'));var auth=require(_0xab72('0x6'));var interaction=require(_0xab72('0x7'));var config=require(_0xab72('0x8'));var controller=require(_0xab72('0x9'));router[_0xab72('0xa')]('/',auth[_0xab72('0xb')](),controller[_0xab72('0xc')]);router[_0xab72('0xa')](_0xab72('0xd'),auth[_0xab72('0xb')](),controller['describe']);router[_0xab72('0xa')]('/:id',auth[_0xab72('0xb')](),controller['show']);router[_0xab72('0xe')]('/',auth[_0xab72('0xb')](),controller['create']);router[_0xab72('0xf')]('/:id',auth[_0xab72('0xb')](),controller[_0xab72('0x10')]);router['delete'](_0xab72('0x11'),auth[_0xab72('0xb')](),controller[_0xab72('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 6bd5cf3..bdf0db0 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x26afba,_0x96c6b0){var _0x3f7f05=function(_0x1614ff){while(--_0x1614ff){_0x26afba['push'](_0x26afba['shift']());}};_0x3f7f05(++_0x96c6b0);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4d1d2c,_0x44f4d8){_0x4d1d2c=_0x4d1d2c-0x0;var _0x2c4cb9=_0xf3cd[_0x4d1d2c];return _0x2c4cb9;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1b0431,_0x2fb4b8){var _0x2c0049=function(_0x7c072d){while(--_0x7c072d){_0x1b0431['push'](_0x1b0431['shift']());}};_0x2c0049(++_0x2fb4b8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0xcb91[_0x209fcd];return _0x501d5e;};'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 7e4d67f..d1855c3 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 _0x2411=['desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','offset','limit','undefined','count','Content-Range','json','save','destroy','then','sendStatus','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','options','includeAll','findAll','params','include','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x5c76bf,_0x5dcbc5){var _0x21d34=function(_0x220e18){while(--_0x220e18){_0x5c76bf['push'](_0x5c76bf['shift']());}};_0x21d34(++_0x5dcbc5);}(_0x2411,0xce));var _0x1241=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x2411[_0x243b59];return _0x3e1676;};'use strict';var emlformat=require(_0x1241('0x0'));var rimraf=require(_0x1241('0x1'));var zipdir=require(_0x1241('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1241('0x3'));var moment=require(_0x1241('0x4'));var BPromise=require(_0x1241('0x5'));var Mustache=require(_0x1241('0x6'));var util=require(_0x1241('0x7'));var path=require(_0x1241('0x8'));var sox=require('sox');var csv=require(_0x1241('0x9'));var ejs=require(_0x1241('0xa'));var fs=require('fs');var fs_extra=require(_0x1241('0xb'));var _=require(_0x1241('0xc'));var squel=require(_0x1241('0xd'));var crypto=require(_0x1241('0xe'));var jsforce=require(_0x1241('0xf'));var deskjs=require(_0x1241('0x10'));var toCsv=require(_0x1241('0x9'));var querystring=require(_0x1241('0x11'));var Papa=require('papaparse');var Redis=require(_0x1241('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1241('0x13'));var as=require(_0x1241('0x14'));var hardwareService=require(_0x1241('0x15'));var logger=require('../../config/logger')(_0x1241('0x16'));var utils=require(_0x1241('0x17'));var config=require(_0x1241('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a98b,_0xd6a94f){_0xd6a94f=_0xd6a94f||0xcc;return function(_0x3bf80c){if(_0x3bf80c){return _0x18a98b['sendStatus'](_0xd6a94f);}return _0x18a98b[_0x1241('0x19')](_0xd6a94f)[_0x1241('0x1a')]();};}function respondWithResult(_0x5b70d1,_0x293aab){_0x293aab=_0x293aab||0xc8;return function(_0x45aa59){if(_0x45aa59){return _0x5b70d1[_0x1241('0x19')](_0x293aab)['json'](_0x45aa59);}};}function respondWithFilteredResult(_0x2078b4,_0x33c41b){return function(_0x1aaf3f){if(_0x1aaf3f){var _0x1c7e74=typeof _0x33c41b[_0x1241('0x1b')]==='undefined'&&typeof _0x33c41b[_0x1241('0x1c')]===_0x1241('0x1d');var _0x2c8901=_0x1aaf3f[_0x1241('0x1e')];var _0x58e33d=_0x1c7e74?0x0:_0x33c41b[_0x1241('0x1b')];var _0x3be3dd=_0x1c7e74?_0x1aaf3f[_0x1241('0x1e')]:_0x33c41b[_0x1241('0x1b')]+_0x33c41b[_0x1241('0x1c')];var _0x36cd00;if(_0x3be3dd>=_0x2c8901){_0x3be3dd=_0x2c8901;_0x36cd00=0xc8;}else{_0x36cd00=0xce;}_0x2078b4[_0x1241('0x19')](_0x36cd00);return _0x2078b4['set'](_0x1241('0x1f'),_0x58e33d+'-'+_0x3be3dd+'/'+_0x2c8901)[_0x1241('0x20')](_0x1aaf3f);}return null;};}function patchUpdates(_0x373238){return function(_0xd9b02e){try{jsonpatch['apply'](_0xd9b02e,_0x373238,!![]);}catch(_0x46c6e3){return BPromise['reject'](_0x46c6e3);}return _0xd9b02e[_0x1241('0x21')]();};}function saveUpdates(_0x1a9372,_0x296d3c){return function(_0x25fee5){if(_0x25fee5){return _0x25fee5['update'](_0x1a9372)['then'](function(_0x2a9d6b){return _0x2a9d6b;});}return null;};}function removeEntity(_0x42c1c7,_0x4e72c3){return function(_0x20a566){if(_0x20a566){return _0x20a566[_0x1241('0x22')]()[_0x1241('0x23')](function(){_0x42c1c7[_0x1241('0x19')](0xcc)[_0x1241('0x1a')]();});}};}function handleEntityNotFound(_0x36f347,_0x219952){return function(_0x2227d5){if(!_0x2227d5){_0x36f347[_0x1241('0x24')](0x194);}return _0x2227d5;};}function handleError(_0x3668d0,_0x32ccfe){_0x32ccfe=_0x32ccfe||0x1f4;return function(_0x180f0b){logger[_0x1241('0x25')](_0x180f0b[_0x1241('0x26')]);if(_0x180f0b[_0x1241('0x27')]){delete _0x180f0b[_0x1241('0x27')];}_0x3668d0[_0x1241('0x19')](_0x32ccfe)[_0x1241('0x28')](_0x180f0b);};}exports[_0x1241('0x29')]=function(_0x5a2769,_0x27df8d){var _0x1d660b={},_0x222fd4={},_0x31cab4={'count':0x0,'rows':[]};var _0x571870=_[_0x1241('0x2a')](db[_0x1241('0x2b')][_0x1241('0x2c')],function(_0x41106d){return{'name':_0x41106d['fieldName'],'type':_0x41106d['type'][_0x1241('0x2d')]};});_0x222fd4[_0x1241('0x2e')]=_[_0x1241('0x2a')](_0x571870,'name');_0x222fd4[_0x1241('0x2f')]=_[_0x1241('0x30')](_0x5a2769[_0x1241('0x2f')]);_0x222fd4['filters']=_[_0x1241('0x31')](_0x222fd4[_0x1241('0x2e')],_0x222fd4['query']);_0x1d660b[_0x1241('0x32')]=_[_0x1241('0x31')](_0x222fd4[_0x1241('0x2e')],qs[_0x1241('0x33')](_0x5a2769[_0x1241('0x2f')][_0x1241('0x33')]));_0x1d660b[_0x1241('0x32')]=_0x1d660b[_0x1241('0x32')][_0x1241('0x34')]?_0x1d660b[_0x1241('0x32')]:_0x222fd4['model'];if(!_0x5a2769[_0x1241('0x2f')][_0x1241('0x35')](_0x1241('0x36'))){_0x1d660b[_0x1241('0x1c')]=qs['limit'](_0x5a2769['query'][_0x1241('0x1c')]);_0x1d660b[_0x1241('0x1b')]=qs[_0x1241('0x1b')](_0x5a2769['query'][_0x1241('0x1b')]);}_0x1d660b[_0x1241('0x37')]=qs[_0x1241('0x38')](_0x5a2769['query'][_0x1241('0x38')]);_0x1d660b['where']=qs[_0x1241('0x39')](_[_0x1241('0x3a')](_0x5a2769[_0x1241('0x2f')],_0x222fd4[_0x1241('0x39')]),_0x571870);if(_0x5a2769[_0x1241('0x2f')][_0x1241('0x3b')]){_0x1d660b[_0x1241('0x3c')]=_[_0x1241('0x3d')](_0x1d660b[_0x1241('0x3c')],{'$or':_['map'](_0x571870,function(_0x554175){if(_0x554175[_0x1241('0x3e')]!=='VIRTUAL'){var _0x1deaac={};_0x1deaac[_0x554175[_0x1241('0x27')]]={'$like':'%'+_0x5a2769[_0x1241('0x2f')][_0x1241('0x3b')]+'%'};return _0x1deaac;}})});}_0x1d660b=_[_0x1241('0x3d')]({},_0x1d660b,_0x5a2769[_0x1241('0x3f')]);var _0xd9fa80={'where':_0x1d660b[_0x1241('0x3c')]};return db[_0x1241('0x2b')][_0x1241('0x1e')](_0xd9fa80)[_0x1241('0x23')](function(_0x22f27c){_0x31cab4[_0x1241('0x1e')]=_0x22f27c;if(_0x5a2769[_0x1241('0x2f')][_0x1241('0x40')]){_0x1d660b['include']=[{'all':!![]}];}return db[_0x1241('0x2b')][_0x1241('0x41')](_0x1d660b);})[_0x1241('0x23')](function(_0x45c142){_0x31cab4['rows']=_0x45c142;return _0x31cab4;})['then'](respondWithFilteredResult(_0x27df8d,_0x1d660b))['catch'](handleError(_0x27df8d,null));};exports['show']=function(_0x3b8419,_0x4cbdbe){var _0x41e909={'raw':!![],'where':{'id':_0x3b8419[_0x1241('0x42')]['id']}},_0x24f9e3={};_0x24f9e3[_0x1241('0x2e')]=_['keys'](db[_0x1241('0x2b')][_0x1241('0x2c')]);_0x24f9e3['query']=_[_0x1241('0x30')](_0x3b8419[_0x1241('0x2f')]);_0x24f9e3[_0x1241('0x39')]=_[_0x1241('0x31')](_0x24f9e3['model'],_0x24f9e3['query']);_0x41e909['attributes']=_[_0x1241('0x31')](_0x24f9e3['model'],qs[_0x1241('0x33')](_0x3b8419[_0x1241('0x2f')][_0x1241('0x33')]));_0x41e909[_0x1241('0x32')]=_0x41e909[_0x1241('0x32')][_0x1241('0x34')]?_0x41e909['attributes']:_0x24f9e3[_0x1241('0x2e')];if(_0x3b8419[_0x1241('0x2f')][_0x1241('0x40')]){_0x41e909[_0x1241('0x43')]=[{'all':!![]}];}_0x41e909=_['merge']({},_0x41e909,_0x3b8419[_0x1241('0x3f')]);return db[_0x1241('0x2b')][_0x1241('0x44')](_0x41e909)[_0x1241('0x23')](handleEntityNotFound(_0x4cbdbe,null))[_0x1241('0x23')](respondWithResult(_0x4cbdbe,null))[_0x1241('0x45')](handleError(_0x4cbdbe,null));};exports[_0x1241('0x46')]=function(_0x5bc372,_0x44ce2d){return db[_0x1241('0x2b')][_0x1241('0x46')](_0x5bc372[_0x1241('0x47')],{})['then'](respondWithResult(_0x44ce2d,0xc9))['catch'](handleError(_0x44ce2d,null));};exports[_0x1241('0x48')]=function(_0x38888a,_0x212af7){if(_0x38888a[_0x1241('0x47')]['id']){delete _0x38888a[_0x1241('0x47')]['id'];}return db[_0x1241('0x2b')]['find']({'where':{'id':_0x38888a[_0x1241('0x42')]['id']}})[_0x1241('0x23')](handleEntityNotFound(_0x212af7,null))[_0x1241('0x23')](saveUpdates(_0x38888a['body'],null))['then'](respondWithResult(_0x212af7,null))[_0x1241('0x45')](handleError(_0x212af7,null));};exports[_0x1241('0x22')]=function(_0x1a0d15,_0x342e48){return db[_0x1241('0x2b')]['find']({'where':{'id':_0x1a0d15[_0x1241('0x42')]['id']}})[_0x1241('0x23')](handleEntityNotFound(_0x342e48,null))['then'](removeEntity(_0x342e48,null))['catch'](handleError(_0x342e48,null));};exports['describe']=function(_0x5355cb,_0x564288){return db[_0x1241('0x2b')][_0x1241('0x49')]()[_0x1241('0x23')](respondWithResult(_0x564288,null))[_0x1241('0x45')](handleError(_0x564288,null));}; \ No newline at end of file +var _0x06a1=['then','destroy','error','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','params','length','includeAll','include','find','body','eml-format','rimraf','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','save','update'];(function(_0x27b900,_0x4c3cd0){var _0x38f4ce=function(_0xae4675){while(--_0xae4675){_0x27b900['push'](_0x27b900['shift']());}};_0x38f4ce(++_0x4c3cd0);}(_0x06a1,0xad));var _0x106a=function(_0x344cf7,_0x3cad83){_0x344cf7=_0x344cf7-0x0;var _0x5b0b9e=_0x06a1[_0x344cf7];return _0x5b0b9e;};'use strict';var emlformat=require(_0x106a('0x0'));var rimraf=require(_0x106a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x106a('0x2'));var BPromise=require(_0x106a('0x3'));var Mustache=require(_0x106a('0x4'));var util=require('util');var path=require(_0x106a('0x5'));var sox=require(_0x106a('0x6'));var csv=require('to-csv');var ejs=require(_0x106a('0x7'));var fs=require('fs');var fs_extra=require(_0x106a('0x8'));var _=require(_0x106a('0x9'));var squel=require(_0x106a('0xa'));var crypto=require(_0x106a('0xb'));var jsforce=require(_0x106a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x106a('0xd'));var querystring=require('querystring');var Papa=require(_0x106a('0xe'));var Redis=require('ioredis');var authService=require(_0x106a('0xf'));var qs=require(_0x106a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x106a('0x11'));var logger=require(_0x106a('0x12'))(_0x106a('0x13'));var utils=require('../../config/utils');var config=require(_0x106a('0x14'));var licenseUtil=require(_0x106a('0x15'));var db=require(_0x106a('0x16'))['db'];function respondWithStatusCode(_0x5f4212,_0x5c8c88){_0x5c8c88=_0x5c8c88||0xcc;return function(_0x306553){if(_0x306553){return _0x5f4212[_0x106a('0x17')](_0x5c8c88);}return _0x5f4212[_0x106a('0x18')](_0x5c8c88)[_0x106a('0x19')]();};}function respondWithResult(_0x46c6b8,_0x1e89e6){_0x1e89e6=_0x1e89e6||0xc8;return function(_0x1890ae){if(_0x1890ae){return _0x46c6b8[_0x106a('0x18')](_0x1e89e6)[_0x106a('0x1a')](_0x1890ae);}};}function respondWithFilteredResult(_0x2730cc,_0x3198f0){return function(_0x1f1c28){if(_0x1f1c28){var _0x592c73=typeof _0x3198f0[_0x106a('0x1b')]===_0x106a('0x1c')&&typeof _0x3198f0['limit']===_0x106a('0x1c');var _0x3fe99a=_0x1f1c28[_0x106a('0x1d')];var _0x420af3=_0x592c73?0x0:_0x3198f0[_0x106a('0x1b')];var _0x4d8836=_0x592c73?_0x1f1c28[_0x106a('0x1d')]:_0x3198f0[_0x106a('0x1b')]+_0x3198f0[_0x106a('0x1e')];var _0x2cd774;if(_0x4d8836>=_0x3fe99a){_0x4d8836=_0x3fe99a;_0x2cd774=0xc8;}else{_0x2cd774=0xce;}_0x2730cc[_0x106a('0x18')](_0x2cd774);return _0x2730cc['set'](_0x106a('0x1f'),_0x420af3+'-'+_0x4d8836+'/'+_0x3fe99a)[_0x106a('0x1a')](_0x1f1c28);}return null;};}function patchUpdates(_0x1b00ca){return function(_0x5f4e85){try{jsonpatch['apply'](_0x5f4e85,_0x1b00ca,!![]);}catch(_0x81e948){return BPromise['reject'](_0x81e948);}return _0x5f4e85[_0x106a('0x20')]();};}function saveUpdates(_0x4cd721,_0x4230aa){return function(_0x4f12d1){if(_0x4f12d1){return _0x4f12d1[_0x106a('0x21')](_0x4cd721)[_0x106a('0x22')](function(_0x96cdc){return _0x96cdc;});}return null;};}function removeEntity(_0x579788,_0x301e6c){return function(_0x3feabf){if(_0x3feabf){return _0x3feabf[_0x106a('0x23')]()[_0x106a('0x22')](function(){_0x579788[_0x106a('0x18')](0xcc)[_0x106a('0x19')]();});}};}function handleEntityNotFound(_0x471428,_0x3cfca5){return function(_0x3fb8e4){if(!_0x3fb8e4){_0x471428[_0x106a('0x17')](0x194);}return _0x3fb8e4;};}function handleError(_0x2517da,_0x38f158){_0x38f158=_0x38f158||0x1f4;return function(_0x265844){logger[_0x106a('0x24')](_0x265844['stack']);if(_0x265844[_0x106a('0x25')]){delete _0x265844[_0x106a('0x25')];}_0x2517da[_0x106a('0x18')](_0x38f158)['send'](_0x265844);};}exports[_0x106a('0x26')]=function(_0x4d05bc,_0x350231){var _0x377f33={},_0x4ade4b={},_0x41d1ba={'count':0x0,'rows':[]};var _0x107bb0=_[_0x106a('0x27')](db[_0x106a('0x28')][_0x106a('0x29')],function(_0x3f449a){return{'name':_0x3f449a[_0x106a('0x2a')],'type':_0x3f449a[_0x106a('0x2b')][_0x106a('0x2c')]};});_0x4ade4b[_0x106a('0x2d')]=_[_0x106a('0x27')](_0x107bb0,_0x106a('0x25'));_0x4ade4b[_0x106a('0x2e')]=_[_0x106a('0x2f')](_0x4d05bc['query']);_0x4ade4b[_0x106a('0x30')]=_[_0x106a('0x31')](_0x4ade4b[_0x106a('0x2d')],_0x4ade4b[_0x106a('0x2e')]);_0x377f33[_0x106a('0x32')]=_['intersection'](_0x4ade4b[_0x106a('0x2d')],qs['fields'](_0x4d05bc[_0x106a('0x2e')][_0x106a('0x33')]));_0x377f33[_0x106a('0x32')]=_0x377f33[_0x106a('0x32')]['length']?_0x377f33[_0x106a('0x32')]:_0x4ade4b[_0x106a('0x2d')];if(!_0x4d05bc['query'][_0x106a('0x34')]('nolimit')){_0x377f33[_0x106a('0x1e')]=qs[_0x106a('0x1e')](_0x4d05bc[_0x106a('0x2e')]['limit']);_0x377f33['offset']=qs[_0x106a('0x1b')](_0x4d05bc[_0x106a('0x2e')][_0x106a('0x1b')]);}_0x377f33[_0x106a('0x35')]=qs[_0x106a('0x36')](_0x4d05bc[_0x106a('0x2e')][_0x106a('0x36')]);_0x377f33[_0x106a('0x37')]=qs['filters'](_[_0x106a('0x38')](_0x4d05bc[_0x106a('0x2e')],_0x4ade4b[_0x106a('0x30')]),_0x107bb0);if(_0x4d05bc[_0x106a('0x2e')][_0x106a('0x39')]){_0x377f33['where']=_[_0x106a('0x3a')](_0x377f33['where'],{'$or':_[_0x106a('0x27')](_0x107bb0,function(_0x55bb1c){if(_0x55bb1c[_0x106a('0x2b')]!==_0x106a('0x3b')){var _0x5b113={};_0x5b113[_0x55bb1c['name']]={'$like':'%'+_0x4d05bc['query'][_0x106a('0x39')]+'%'};return _0x5b113;}})});}_0x377f33=_[_0x106a('0x3a')]({},_0x377f33,_0x4d05bc[_0x106a('0x3c')]);var _0x47aaa2={'where':_0x377f33[_0x106a('0x37')]};return db[_0x106a('0x28')][_0x106a('0x1d')](_0x47aaa2)[_0x106a('0x22')](function(_0x2b05d9){_0x41d1ba[_0x106a('0x1d')]=_0x2b05d9;if(_0x4d05bc['query']['includeAll']){_0x377f33['include']=[{'all':!![]}];}return db[_0x106a('0x28')]['findAll'](_0x377f33);})[_0x106a('0x22')](function(_0xe2e981){_0x41d1ba[_0x106a('0x3d')]=_0xe2e981;return _0x41d1ba;})['then'](respondWithFilteredResult(_0x350231,_0x377f33))[_0x106a('0x3e')](handleError(_0x350231,null));};exports['show']=function(_0x268304,_0x467713){var _0x59c770={'raw':!![],'where':{'id':_0x268304[_0x106a('0x3f')]['id']}},_0x4a11e7={};_0x4a11e7['model']=_[_0x106a('0x2f')](db[_0x106a('0x28')][_0x106a('0x29')]);_0x4a11e7[_0x106a('0x2e')]=_[_0x106a('0x2f')](_0x268304[_0x106a('0x2e')]);_0x4a11e7[_0x106a('0x30')]=_[_0x106a('0x31')](_0x4a11e7[_0x106a('0x2d')],_0x4a11e7['query']);_0x59c770['attributes']=_[_0x106a('0x31')](_0x4a11e7[_0x106a('0x2d')],qs[_0x106a('0x33')](_0x268304[_0x106a('0x2e')][_0x106a('0x33')]));_0x59c770[_0x106a('0x32')]=_0x59c770['attributes'][_0x106a('0x40')]?_0x59c770[_0x106a('0x32')]:_0x4a11e7['model'];if(_0x268304[_0x106a('0x2e')][_0x106a('0x41')]){_0x59c770[_0x106a('0x42')]=[{'all':!![]}];}_0x59c770=_[_0x106a('0x3a')]({},_0x59c770,_0x268304[_0x106a('0x3c')]);return db[_0x106a('0x28')][_0x106a('0x43')](_0x59c770)[_0x106a('0x22')](handleEntityNotFound(_0x467713,null))[_0x106a('0x22')](respondWithResult(_0x467713,null))[_0x106a('0x3e')](handleError(_0x467713,null));};exports['create']=function(_0xd6d7d2,_0x4d2c40){return db[_0x106a('0x28')]['create'](_0xd6d7d2[_0x106a('0x44')],{})[_0x106a('0x22')](respondWithResult(_0x4d2c40,0xc9))[_0x106a('0x3e')](handleError(_0x4d2c40,null));};exports[_0x106a('0x21')]=function(_0x3524e7,_0x6d1a34){if(_0x3524e7[_0x106a('0x44')]['id']){delete _0x3524e7[_0x106a('0x44')]['id'];}return db[_0x106a('0x28')]['find']({'where':{'id':_0x3524e7[_0x106a('0x3f')]['id']}})[_0x106a('0x22')](handleEntityNotFound(_0x6d1a34,null))[_0x106a('0x22')](saveUpdates(_0x3524e7[_0x106a('0x44')],null))['then'](respondWithResult(_0x6d1a34,null))[_0x106a('0x3e')](handleError(_0x6d1a34,null));};exports[_0x106a('0x23')]=function(_0x3b6d98,_0x3d442d){return db[_0x106a('0x28')][_0x106a('0x43')]({'where':{'id':_0x3b6d98[_0x106a('0x3f')]['id']}})[_0x106a('0x22')](handleEntityNotFound(_0x3d442d,null))[_0x106a('0x22')](removeEntity(_0x3d442d,null))['catch'](handleError(_0x3d442d,null));};exports['describe']=function(_0x5b6ad6,_0x5b1a76){return db[_0x106a('0x28')]['describe']()[_0x106a('0x22')](respondWithResult(_0x5b1a76,null))['catch'](handleError(_0x5b1a76,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 7c66b8b..528f192 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 _0xaec2=['bluebird','rimraf','define','OpenchannelTransferReport','uniqueid','../../config/logger'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0xaec2,0x12b));var _0x2aec=function(_0x51c39f,_0x5bfb0b){_0x51c39f=_0x51c39f-0x0;var _0x274221=_0xaec2[_0x51c39f];return _0x274221;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2aec('0x0'))('api');var moment=require('moment');var BPromise=require(_0x2aec('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2aec('0x2'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x234bd6,_0x2c6025){return _0x234bd6[_0x2aec('0x3')](_0x2aec('0x4'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x2aec('0x5'),'fields':[_0x2aec('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf7b9=['api','moment','request-promise','path','../../config/environment','define','OpenchannelTransferReport','uniqueid','util'];(function(_0x5c418a,_0x5392ac){var _0x20f968=function(_0x4891b9){while(--_0x4891b9){_0x5c418a['push'](_0x5c418a['shift']());}};_0x20f968(++_0x5392ac);}(_0xf7b9,0xe9));var _0x9f7b=function(_0x7864a8,_0x3ab694){_0x7864a8=_0x7864a8-0x0;var _0x75ddbc=_0xf7b9[_0x7864a8];return _0x75ddbc;};'use strict';var _=require('lodash');var util=require(_0x9f7b('0x0'));var logger=require('../../config/logger')(_0x9f7b('0x1'));var moment=require(_0x9f7b('0x2'));var BPromise=require('bluebird');var rp=require(_0x9f7b('0x3'));var fs=require('fs');var path=require(_0x9f7b('0x4'));var rimraf=require('rimraf');var config=require(_0x9f7b('0x5'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x1a37b2,_0x48eb10){return _0x1a37b2[_0x9f7b('0x6')](_0x9f7b('0x7'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x9f7b('0x8'),'fields':[_0x9f7b('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 0ac6065..1accbff 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 _0x5301=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x5db99b,_0xdee23a){var _0x4b2d0e=function(_0x4deee1){while(--_0x4deee1){_0x5db99b['push'](_0x5db99b['shift']());}};_0x4b2d0e(++_0xdee23a);}(_0x5301,0x157));var _0x1530=function(_0x213e67,_0x222871){_0x213e67=_0x213e67-0x0;var _0x302eb6=_0x5301[_0x213e67];return _0x302eb6;};'use strict';var _=require('lodash');var util=require(_0x1530('0x0'));var moment=require(_0x1530('0x1'));var BPromise=require(_0x1530('0x2'));var rs=require(_0x1530('0x3'));var fs=require('fs');var Redis=require(_0x1530('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1530('0x5'));var logger=require(_0x1530('0x6'))(_0x1530('0x7'));var config=require(_0x1530('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1530('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17f435,_0x4c8496,_0xd9ff84){return new BPromise(function(_0x2c7135,_0x319d53){return client[_0x1530('0xa')](_0x17f435,_0xd9ff84)[_0x1530('0xb')](function(_0x59c4d6){logger['info'](_0x1530('0xc'),_0x4c8496,_0x1530('0xd'));logger[_0x1530('0xe')](_0x1530('0xf'),_0x4c8496,'request\x20sent',JSON[_0x1530('0x10')](_0x59c4d6));if(_0x59c4d6[_0x1530('0x11')]){if(_0x59c4d6[_0x1530('0x11')][_0x1530('0x12')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x4c8496,_0x59c4d6[_0x1530('0x11')][_0x1530('0x13')]);return _0x319d53(_0x59c4d6['error'][_0x1530('0x13')]);}logger[_0x1530('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4c8496,_0x59c4d6[_0x1530('0x11')][_0x1530('0x13')]);return _0x2c7135(_0x59c4d6[_0x1530('0x11')][_0x1530('0x13')]);}else{logger[_0x1530('0x14')](_0x1530('0xc'),_0x4c8496,_0x1530('0xd'));_0x2c7135(_0x59c4d6[_0x1530('0x15')][_0x1530('0x13')]);}})[_0x1530('0x16')](function(_0x3c5eb3){logger[_0x1530('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4c8496,_0x3c5eb3);_0x319d53(_0x3c5eb3);});});} \ No newline at end of file +var _0x972c=['../../config/environment','jayson/promise','http','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x5efd01,_0x418660){var _0x4676d0=function(_0x35387c){while(--_0x35387c){_0x5efd01['push'](_0x5efd01['shift']());}};_0x4676d0(++_0x418660);}(_0x972c,0xf2));var _0xc972=function(_0x10db26,_0xf6b817){_0x10db26=_0x10db26-0x0;var _0x16ff66=_0x972c[_0x10db26];return _0x16ff66;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc972('0x0'));var BPromise=require(_0xc972('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc972('0x2'));var db=require(_0xc972('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc972('0x4'));var config=require(_0xc972('0x5'));var jayson=require(_0xc972('0x6'));var client=jayson['client'][_0xc972('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4cff66,_0x1c1a16,_0xd8cd25){return new BPromise(function(_0x304d08,_0x5ef7c4){return client['request'](_0x4cff66,_0xd8cd25)['then'](function(_0xa1400f){logger['info'](_0xc972('0x8'),_0x1c1a16,_0xc972('0x9'));logger[_0xc972('0xa')](_0xc972('0xb'),_0x1c1a16,_0xc972('0x9'),JSON[_0xc972('0xc')](_0xa1400f));if(_0xa1400f[_0xc972('0xd')]){if(_0xa1400f['error'][_0xc972('0xe')]===0x1f4){logger[_0xc972('0xd')](_0xc972('0x8'),_0x1c1a16,_0xa1400f['error'][_0xc972('0xf')]);return _0x5ef7c4(_0xa1400f[_0xc972('0xd')][_0xc972('0xf')]);}logger['error'](_0xc972('0x8'),_0x1c1a16,_0xa1400f[_0xc972('0xd')][_0xc972('0xf')]);return _0x304d08(_0xa1400f[_0xc972('0xd')]['message']);}else{logger[_0xc972('0x10')](_0xc972('0x8'),_0x1c1a16,_0xc972('0x9'));_0x304d08(_0xa1400f[_0xc972('0x11')][_0xc972('0xf')]);}})[_0xc972('0x12')](function(_0x1e3389){logger[_0xc972('0xd')](_0xc972('0x8'),_0x1c1a16,_0x1e3389);_0x5ef7c4(_0x1e3389);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 5e929ba..60db6d6 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 _0x0fe2=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x40cc7c,_0x59c2e1){var _0x11581e=function(_0x47bacf){while(--_0x47bacf){_0x40cc7c['push'](_0x40cc7c['shift']());}};_0x11581e(++_0x59c2e1);}(_0x0fe2,0x1e3));var _0x20fe=function(_0x13b195,_0x29eaee){_0x13b195=_0x13b195-0x0;var _0x4384fd=_0x0fe2[_0x13b195];return _0x4384fd;};'use strict';var multer=require(_0x20fe('0x0'));var util=require(_0x20fe('0x1'));var path=require(_0x20fe('0x2'));var timeout=require(_0x20fe('0x3'));var express=require('express');var router=express[_0x20fe('0x4')]();var fs_extra=require(_0x20fe('0x5'));var auth=require(_0x20fe('0x6'));var interaction=require(_0x20fe('0x7'));var config=require('../../config/environment');var controller=require(_0x20fe('0x8'));router[_0x20fe('0x9')]('/',auth[_0x20fe('0xa')](),controller[_0x20fe('0xb')]);router['get'](_0x20fe('0xc'),auth[_0x20fe('0xa')](),controller[_0x20fe('0xd')]);router[_0x20fe('0xe')]('/',auth['isAuthenticated'](),controller[_0x20fe('0xf')]);router[_0x20fe('0x10')](_0x20fe('0xc'),auth[_0x20fe('0xa')](),controller[_0x20fe('0x11')]);router[_0x20fe('0x12')](_0x20fe('0xc'),auth['isAuthenticated'](),controller[_0x20fe('0x13')]);module[_0x20fe('0x14')]=router; \ No newline at end of file +var _0xee11=['destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get','/:id','create','put','update'];(function(_0x535c17,_0x206242){var _0x52d73f=function(_0xb13021){while(--_0xb13021){_0x535c17['push'](_0x535c17['shift']());}};_0x52d73f(++_0x206242);}(_0xee11,0x146));var _0x1ee1=function(_0x40e141,_0x4385ee){_0x40e141=_0x40e141-0x0;var _0x3ce15c=_0xee11[_0x40e141];return _0x3ce15c;};'use strict';var multer=require(_0x1ee1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1ee1('0x1'));var express=require(_0x1ee1('0x2'));var router=express[_0x1ee1('0x3')]();var fs_extra=require(_0x1ee1('0x4'));var auth=require(_0x1ee1('0x5'));var interaction=require(_0x1ee1('0x6'));var config=require(_0x1ee1('0x7'));var controller=require(_0x1ee1('0x8'));router['get']('/',auth[_0x1ee1('0x9')](),controller[_0x1ee1('0xa')]);router[_0x1ee1('0xb')](_0x1ee1('0xc'),auth[_0x1ee1('0x9')](),controller['show']);router['post']('/',auth[_0x1ee1('0x9')](),controller[_0x1ee1('0xd')]);router[_0x1ee1('0xe')](_0x1ee1('0xc'),auth['isAuthenticated'](),controller[_0x1ee1('0xf')]);router['delete'](_0x1ee1('0xc'),auth[_0x1ee1('0x9')](),controller[_0x1ee1('0x10')]);module[_0x1ee1('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 73a2400..1984695 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 _0x607e=['sequelize','STRING','name'];(function(_0x3d763e,_0x5d0494){var _0x33d2f9=function(_0x32bab9){while(--_0x32bab9){_0x3d763e['push'](_0x3d763e['shift']());}};_0x33d2f9(++_0x5d0494);}(_0x607e,0x1da));var _0xe607=function(_0x2cfc63,_0x2f2d2f){_0x2cfc63=_0x2cfc63-0x0;var _0x1cef43=_0x607e[_0x2cfc63];return _0x1cef43;};'use strict';var Sequelize=require(_0xe607('0x0'));module['exports']={'name':{'type':Sequelize[_0xe607('0x1')],'unique':_0xe607('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xe607('0x1')]}}; \ No newline at end of file +var _0x2947=['sequelize','STRING'];(function(_0x3591db,_0x5be15b){var _0x36f5f0=function(_0x3db7f0){while(--_0x3db7f0){_0x3591db['push'](_0x3591db['shift']());}};_0x36f5f0(++_0x5be15b);}(_0x2947,0x1e4));var _0x7294=function(_0x3caa14,_0x3316ad){_0x3caa14=_0x3caa14-0x0;var _0x5bea24=_0x2947[_0x3caa14];return _0x5bea24;};'use strict';var Sequelize=require(_0x7294('0x0'));module['exports']={'name':{'type':Sequelize[_0x7294('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 3f6f473..32220e4 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 _0xb34b=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Pauses','stack','name','send','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','merge','filter','options','includeAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api'];(function(_0x358f63,_0x114010){var _0x37e195=function(_0x926ab6){while(--_0x926ab6){_0x358f63['push'](_0x358f63['shift']());}};_0x37e195(++_0x114010);}(_0xb34b,0x179));var _0xbb34=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xb34b[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb34('0x0'));var zipdir=require(_0xbb34('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb34('0x2'));var moment=require(_0xbb34('0x3'));var BPromise=require(_0xbb34('0x4'));var Mustache=require(_0xbb34('0x5'));var util=require(_0xbb34('0x6'));var path=require(_0xbb34('0x7'));var sox=require(_0xbb34('0x8'));var csv=require(_0xbb34('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbb34('0xa'));var jsforce=require(_0xbb34('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xbb34('0x9'));var querystring=require('querystring');var Papa=require(_0xbb34('0xc'));var Redis=require(_0xbb34('0xd'));var authService=require(_0xbb34('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb34('0xf'));var logger=require(_0xbb34('0x10'))(_0xbb34('0x11'));var utils=require(_0xbb34('0x12'));var config=require(_0xbb34('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb34('0x14'))['db'];function respondWithStatusCode(_0x33ed9d,_0x21b68a){_0x21b68a=_0x21b68a||0xcc;return function(_0x4c5248){if(_0x4c5248){return _0x33ed9d[_0xbb34('0x15')](_0x21b68a);}return _0x33ed9d[_0xbb34('0x16')](_0x21b68a)[_0xbb34('0x17')]();};}function respondWithResult(_0x3159fa,_0x106907){_0x106907=_0x106907||0xc8;return function(_0x5ea6a8){if(_0x5ea6a8){return _0x3159fa[_0xbb34('0x16')](_0x106907)[_0xbb34('0x18')](_0x5ea6a8);}};}function respondWithFilteredResult(_0x2172c1,_0x59f1db){return function(_0x5f53d9){if(_0x5f53d9){var _0x208a2a=typeof _0x59f1db[_0xbb34('0x19')]===_0xbb34('0x1a')&&typeof _0x59f1db[_0xbb34('0x1b')]===_0xbb34('0x1a');var _0x4d3ffb=_0x5f53d9['count'];var _0x7db3fe=_0x208a2a?0x0:_0x59f1db[_0xbb34('0x19')];var _0x4c8383=_0x208a2a?_0x5f53d9[_0xbb34('0x1c')]:_0x59f1db['offset']+_0x59f1db[_0xbb34('0x1b')];var _0x50f3ac;if(_0x4c8383>=_0x4d3ffb){_0x4c8383=_0x4d3ffb;_0x50f3ac=0xc8;}else{_0x50f3ac=0xce;}_0x2172c1['status'](_0x50f3ac);return _0x2172c1[_0xbb34('0x1d')](_0xbb34('0x1e'),_0x7db3fe+'-'+_0x4c8383+'/'+_0x4d3ffb)[_0xbb34('0x18')](_0x5f53d9);}return null;};}function patchUpdates(_0x13b766){return function(_0x203607){try{jsonpatch[_0xbb34('0x1f')](_0x203607,_0x13b766,!![]);}catch(_0x36a069){return BPromise[_0xbb34('0x20')](_0x36a069);}return _0x203607['save']();};}function saveUpdates(_0x459a62,_0x2ab710){return function(_0x4d83e2){if(_0x4d83e2){return _0x4d83e2[_0xbb34('0x21')](_0x459a62)[_0xbb34('0x22')](function(_0x5ec22f){return _0x5ec22f;});}return null;};}function removeEntity(_0x5720f0,_0x1a19f6){return function(_0x1d52b3){if(_0x1d52b3){return _0x1d52b3[_0xbb34('0x23')]()[_0xbb34('0x22')](function(){var _0x33fe2b=_0x1d52b3[_0xbb34('0x24')]({'plain':!![]});var _0x4e7b56=_0xbb34('0x25');return db['UserProfileResource'][_0xbb34('0x23')]({'where':{'type':_0x4e7b56,'resourceId':_0x33fe2b['id']}})[_0xbb34('0x22')](function(){return _0x1d52b3;});})['then'](function(){_0x5720f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ff679,_0x1b52ae){return function(_0x4ac932){if(!_0x4ac932){_0x1ff679[_0xbb34('0x15')](0x194);}return _0x4ac932;};}function handleError(_0x5625a9,_0x579c65){_0x579c65=_0x579c65||0x1f4;return function(_0x2d8630){logger['error'](_0x2d8630[_0xbb34('0x26')]);if(_0x2d8630['name']){delete _0x2d8630[_0xbb34('0x27')];}_0x5625a9['status'](_0x579c65)[_0xbb34('0x28')](_0x2d8630);};}exports['index']=function(_0x25dabd,_0xbc7b8f){var _0x520f58={},_0x53fecb={},_0x88fbe={'count':0x0,'rows':[]};var _0x118889=_[_0xbb34('0x29')](db[_0xbb34('0x2a')][_0xbb34('0x2b')],function(_0x7b0056){return{'name':_0x7b0056[_0xbb34('0x2c')],'type':_0x7b0056[_0xbb34('0x2d')][_0xbb34('0x2e')]};});_0x53fecb[_0xbb34('0x2f')]=_[_0xbb34('0x29')](_0x118889,_0xbb34('0x27'));_0x53fecb[_0xbb34('0x30')]=_[_0xbb34('0x31')](_0x25dabd['query']);_0x53fecb['filters']=_[_0xbb34('0x32')](_0x53fecb[_0xbb34('0x2f')],_0x53fecb[_0xbb34('0x30')]);_0x520f58['attributes']=_[_0xbb34('0x32')](_0x53fecb[_0xbb34('0x2f')],qs[_0xbb34('0x33')](_0x25dabd[_0xbb34('0x30')][_0xbb34('0x33')]));_0x520f58[_0xbb34('0x34')]=_0x520f58[_0xbb34('0x34')][_0xbb34('0x35')]?_0x520f58['attributes']:_0x53fecb[_0xbb34('0x2f')];if(!_0x25dabd['query']['hasOwnProperty'](_0xbb34('0x36'))){_0x520f58[_0xbb34('0x1b')]=qs[_0xbb34('0x1b')](_0x25dabd[_0xbb34('0x30')][_0xbb34('0x1b')]);_0x520f58[_0xbb34('0x19')]=qs[_0xbb34('0x19')](_0x25dabd[_0xbb34('0x30')]['offset']);}_0x520f58[_0xbb34('0x37')]=qs[_0xbb34('0x38')](_0x25dabd[_0xbb34('0x30')][_0xbb34('0x38')]);_0x520f58[_0xbb34('0x39')]=qs[_0xbb34('0x3a')](_['pick'](_0x25dabd['query'],_0x53fecb[_0xbb34('0x3a')]),_0x118889);if(_0x25dabd[_0xbb34('0x30')]['filter']){_0x520f58['where']=_[_0xbb34('0x3b')](_0x520f58[_0xbb34('0x39')],{'$or':_['map'](_0x118889,function(_0x33ec08){if(_0x33ec08[_0xbb34('0x2d')]!=='VIRTUAL'){var _0x7814d1={};_0x7814d1[_0x33ec08[_0xbb34('0x27')]]={'$like':'%'+_0x25dabd[_0xbb34('0x30')][_0xbb34('0x3c')]+'%'};return _0x7814d1;}})});}_0x520f58=_[_0xbb34('0x3b')]({},_0x520f58,_0x25dabd[_0xbb34('0x3d')]);var _0x3a5ea1={'where':_0x520f58[_0xbb34('0x39')]};return db['Pause'][_0xbb34('0x1c')](_0x3a5ea1)[_0xbb34('0x22')](function(_0x18db7f){_0x88fbe[_0xbb34('0x1c')]=_0x18db7f;if(_0x25dabd[_0xbb34('0x30')][_0xbb34('0x3e')]){_0x520f58['include']=[{'all':!![]}];}return db[_0xbb34('0x2a')]['findAll'](_0x520f58);})[_0xbb34('0x22')](function(_0x217330){_0x88fbe[_0xbb34('0x3f')]=_0x217330;return _0x88fbe;})['then'](respondWithFilteredResult(_0xbc7b8f,_0x520f58))[_0xbb34('0x40')](handleError(_0xbc7b8f,null));};exports[_0xbb34('0x41')]=function(_0xd096bf,_0x42c444){var _0x30aede={'raw':!![],'where':{'id':_0xd096bf[_0xbb34('0x42')]['id']}},_0x58745f={};_0x58745f[_0xbb34('0x2f')]=_[_0xbb34('0x31')](db['Pause'][_0xbb34('0x2b')]);_0x58745f[_0xbb34('0x30')]=_[_0xbb34('0x31')](_0xd096bf['query']);_0x58745f[_0xbb34('0x3a')]=_[_0xbb34('0x32')](_0x58745f[_0xbb34('0x2f')],_0x58745f['query']);_0x30aede['attributes']=_['intersection'](_0x58745f[_0xbb34('0x2f')],qs[_0xbb34('0x33')](_0xd096bf[_0xbb34('0x30')][_0xbb34('0x33')]));_0x30aede[_0xbb34('0x34')]=_0x30aede[_0xbb34('0x34')][_0xbb34('0x35')]?_0x30aede['attributes']:_0x58745f[_0xbb34('0x2f')];if(_0xd096bf['query'][_0xbb34('0x3e')]){_0x30aede['include']=[{'all':!![]}];}_0x30aede=_[_0xbb34('0x3b')]({},_0x30aede,_0xd096bf['options']);return db[_0xbb34('0x2a')][_0xbb34('0x43')](_0x30aede)[_0xbb34('0x22')](handleEntityNotFound(_0x42c444,null))['then'](respondWithResult(_0x42c444,null))[_0xbb34('0x40')](handleError(_0x42c444,null));};exports[_0xbb34('0x44')]=function(_0x12d8d6,_0x3d77d2){return db[_0xbb34('0x2a')][_0xbb34('0x44')](_0x12d8d6['body'],{})[_0xbb34('0x22')](function(_0x55f12f){var _0x5937ae=_0x12d8d6[_0xbb34('0x45')][_0xbb34('0x24')]({'plain':!![]});if(!_0x5937ae)throw new Error(_0xbb34('0x46'));if(_0x5937ae[_0xbb34('0x47')]==='user'){var _0x157316=_0x55f12f[_0xbb34('0x24')]({'plain':!![]});var _0x3f7a9c='Pauses';return db[_0xbb34('0x48')]['find']({'where':{'name':_0x3f7a9c,'userProfileId':_0x5937ae[_0xbb34('0x49')]},'raw':!![]})['then'](function(_0x256e8d){if(_0x256e8d&&_0x256e8d[_0xbb34('0x4a')]===0x0){return db[_0xbb34('0x4b')][_0xbb34('0x44')]({'name':_0x157316[_0xbb34('0x27')],'resourceId':_0x157316['id'],'type':_0x256e8d[_0xbb34('0x27')],'sectionId':_0x256e8d['id']},{})['then'](function(){return _0x55f12f;});}else{return _0x55f12f;}})[_0xbb34('0x40')](function(_0xfa3d86){logger[_0xbb34('0x4c')](_0xbb34('0x4d'),_0xfa3d86);throw _0xfa3d86;});}return _0x55f12f;})[_0xbb34('0x22')](respondWithResult(_0x3d77d2,0xc9))[_0xbb34('0x40')](handleError(_0x3d77d2,null));};exports[_0xbb34('0x21')]=function(_0x1316c6,_0x419ee9){if(_0x1316c6[_0xbb34('0x4e')]['id']){delete _0x1316c6[_0xbb34('0x4e')]['id'];}return db['Pause'][_0xbb34('0x43')]({'where':{'id':_0x1316c6[_0xbb34('0x42')]['id']}})[_0xbb34('0x22')](handleEntityNotFound(_0x419ee9,null))['then'](saveUpdates(_0x1316c6[_0xbb34('0x4e')],null))[_0xbb34('0x22')](respondWithResult(_0x419ee9,null))[_0xbb34('0x40')](handleError(_0x419ee9,null));};exports[_0xbb34('0x23')]=function(_0x49562b,_0x6fc6c){return db[_0xbb34('0x2a')][_0xbb34('0x43')]({'where':{'id':_0x49562b['params']['id']}})[_0xbb34('0x22')](handleEntityNotFound(_0x6fc6c,null))[_0xbb34('0x22')](removeEntity(_0x6fc6c,null))['catch'](handleError(_0x6fc6c,null));}; \ No newline at end of file +var _0xa1fa=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','get','Pauses','UserProfileResource','error','name','send','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Pause','includeAll','include','findAll','rows','catch','show','params','find','body','role','user','UserProfileSection','userProfileId','autoAssociation','create'];(function(_0x3de7e0,_0x28cbff){var _0x11d0b3=function(_0xd95412){while(--_0xd95412){_0x3de7e0['push'](_0x3de7e0['shift']());}};_0x11d0b3(++_0x28cbff);}(_0xa1fa,0x14d));var _0xaa1f=function(_0x47655b,_0x370d89){_0x47655b=_0x47655b-0x0;var _0x57e73b=_0xa1fa[_0x47655b];return _0x57e73b;};'use strict';var emlformat=require(_0xaa1f('0x0'));var rimraf=require(_0xaa1f('0x1'));var zipdir=require(_0xaa1f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa1f('0x3'));var moment=require(_0xaa1f('0x4'));var BPromise=require(_0xaa1f('0x5'));var Mustache=require(_0xaa1f('0x6'));var util=require(_0xaa1f('0x7'));var path=require(_0xaa1f('0x8'));var sox=require(_0xaa1f('0x9'));var csv=require(_0xaa1f('0xa'));var ejs=require(_0xaa1f('0xb'));var fs=require('fs');var fs_extra=require(_0xaa1f('0xc'));var _=require(_0xaa1f('0xd'));var squel=require(_0xaa1f('0xe'));var crypto=require('crypto');var jsforce=require(_0xaa1f('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaa1f('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaa1f('0x11'));var qs=require(_0xaa1f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa1f('0x13'));var logger=require(_0xaa1f('0x14'))('api');var utils=require(_0xaa1f('0x15'));var config=require(_0xaa1f('0x16'));var licenseUtil=require(_0xaa1f('0x17'));var db=require(_0xaa1f('0x18'))['db'];function respondWithStatusCode(_0x36d2e8,_0x3a2714){_0x3a2714=_0x3a2714||0xcc;return function(_0x1a8686){if(_0x1a8686){return _0x36d2e8[_0xaa1f('0x19')](_0x3a2714);}return _0x36d2e8[_0xaa1f('0x1a')](_0x3a2714)[_0xaa1f('0x1b')]();};}function respondWithResult(_0x33367c,_0x34cc46){_0x34cc46=_0x34cc46||0xc8;return function(_0x24fba7){if(_0x24fba7){return _0x33367c[_0xaa1f('0x1a')](_0x34cc46)[_0xaa1f('0x1c')](_0x24fba7);}};}function respondWithFilteredResult(_0x1c211c,_0x5542e1){return function(_0x1da764){if(_0x1da764){var _0x4e9ffb=typeof _0x5542e1[_0xaa1f('0x1d')]==='undefined'&&typeof _0x5542e1[_0xaa1f('0x1e')]===_0xaa1f('0x1f');var _0x60920=_0x1da764[_0xaa1f('0x20')];var _0x46225a=_0x4e9ffb?0x0:_0x5542e1[_0xaa1f('0x1d')];var _0x27d99e=_0x4e9ffb?_0x1da764[_0xaa1f('0x20')]:_0x5542e1['offset']+_0x5542e1[_0xaa1f('0x1e')];var _0x7514cd;if(_0x27d99e>=_0x60920){_0x27d99e=_0x60920;_0x7514cd=0xc8;}else{_0x7514cd=0xce;}_0x1c211c[_0xaa1f('0x1a')](_0x7514cd);return _0x1c211c['set'](_0xaa1f('0x21'),_0x46225a+'-'+_0x27d99e+'/'+_0x60920)['json'](_0x1da764);}return null;};}function patchUpdates(_0x1f0337){return function(_0x474ea6){try{jsonpatch[_0xaa1f('0x22')](_0x474ea6,_0x1f0337,!![]);}catch(_0x3e2a94){return BPromise[_0xaa1f('0x23')](_0x3e2a94);}return _0x474ea6[_0xaa1f('0x24')]();};}function saveUpdates(_0x78e485,_0x5b97a2){return function(_0x44040a){if(_0x44040a){return _0x44040a['update'](_0x78e485)[_0xaa1f('0x25')](function(_0x33ff3a){return _0x33ff3a;});}return null;};}function removeEntity(_0x1db639,_0x4dbfaf){return function(_0x4492eb){if(_0x4492eb){return _0x4492eb[_0xaa1f('0x26')]()[_0xaa1f('0x25')](function(){var _0x300e81=_0x4492eb[_0xaa1f('0x27')]({'plain':!![]});var _0x3ff496=_0xaa1f('0x28');return db[_0xaa1f('0x29')][_0xaa1f('0x26')]({'where':{'type':_0x3ff496,'resourceId':_0x300e81['id']}})[_0xaa1f('0x25')](function(){return _0x4492eb;});})['then'](function(){_0x1db639[_0xaa1f('0x1a')](0xcc)[_0xaa1f('0x1b')]();});}};}function handleEntityNotFound(_0x110b8a,_0x329034){return function(_0x53d123){if(!_0x53d123){_0x110b8a[_0xaa1f('0x19')](0x194);}return _0x53d123;};}function handleError(_0x2f6f1f,_0x4222b5){_0x4222b5=_0x4222b5||0x1f4;return function(_0x3ce117){logger[_0xaa1f('0x2a')](_0x3ce117['stack']);if(_0x3ce117[_0xaa1f('0x2b')]){delete _0x3ce117[_0xaa1f('0x2b')];}_0x2f6f1f[_0xaa1f('0x1a')](_0x4222b5)[_0xaa1f('0x2c')](_0x3ce117);};}exports['index']=function(_0x537c1d,_0x2790eb){var _0xf0ced2={},_0x3a2794={},_0x456883={'count':0x0,'rows':[]};var _0xc06a64=_[_0xaa1f('0x2d')](db['Pause'][_0xaa1f('0x2e')],function(_0x9001ae){return{'name':_0x9001ae[_0xaa1f('0x2f')],'type':_0x9001ae['type'][_0xaa1f('0x30')]};});_0x3a2794['model']=_[_0xaa1f('0x2d')](_0xc06a64,'name');_0x3a2794[_0xaa1f('0x31')]=_[_0xaa1f('0x32')](_0x537c1d['query']);_0x3a2794[_0xaa1f('0x33')]=_[_0xaa1f('0x34')](_0x3a2794['model'],_0x3a2794[_0xaa1f('0x31')]);_0xf0ced2['attributes']=_[_0xaa1f('0x34')](_0x3a2794[_0xaa1f('0x35')],qs[_0xaa1f('0x36')](_0x537c1d[_0xaa1f('0x31')][_0xaa1f('0x36')]));_0xf0ced2[_0xaa1f('0x37')]=_0xf0ced2[_0xaa1f('0x37')][_0xaa1f('0x38')]?_0xf0ced2[_0xaa1f('0x37')]:_0x3a2794['model'];if(!_0x537c1d[_0xaa1f('0x31')][_0xaa1f('0x39')](_0xaa1f('0x3a'))){_0xf0ced2['limit']=qs[_0xaa1f('0x1e')](_0x537c1d[_0xaa1f('0x31')][_0xaa1f('0x1e')]);_0xf0ced2[_0xaa1f('0x1d')]=qs[_0xaa1f('0x1d')](_0x537c1d[_0xaa1f('0x31')]['offset']);}_0xf0ced2['order']=qs[_0xaa1f('0x3b')](_0x537c1d['query']['sort']);_0xf0ced2[_0xaa1f('0x3c')]=qs[_0xaa1f('0x33')](_[_0xaa1f('0x3d')](_0x537c1d[_0xaa1f('0x31')],_0x3a2794[_0xaa1f('0x33')]),_0xc06a64);if(_0x537c1d['query'][_0xaa1f('0x3e')]){_0xf0ced2['where']=_[_0xaa1f('0x3f')](_0xf0ced2[_0xaa1f('0x3c')],{'$or':_[_0xaa1f('0x2d')](_0xc06a64,function(_0x26d79c){if(_0x26d79c['type']!==_0xaa1f('0x40')){var _0x4ca950={};_0x4ca950[_0x26d79c['name']]={'$like':'%'+_0x537c1d[_0xaa1f('0x31')][_0xaa1f('0x3e')]+'%'};return _0x4ca950;}})});}_0xf0ced2=_[_0xaa1f('0x3f')]({},_0xf0ced2,_0x537c1d[_0xaa1f('0x41')]);var _0x13242f={'where':_0xf0ced2[_0xaa1f('0x3c')]};return db[_0xaa1f('0x42')][_0xaa1f('0x20')](_0x13242f)['then'](function(_0x3e33fe){_0x456883[_0xaa1f('0x20')]=_0x3e33fe;if(_0x537c1d[_0xaa1f('0x31')][_0xaa1f('0x43')]){_0xf0ced2[_0xaa1f('0x44')]=[{'all':!![]}];}return db[_0xaa1f('0x42')][_0xaa1f('0x45')](_0xf0ced2);})[_0xaa1f('0x25')](function(_0x4847f7){_0x456883[_0xaa1f('0x46')]=_0x4847f7;return _0x456883;})[_0xaa1f('0x25')](respondWithFilteredResult(_0x2790eb,_0xf0ced2))[_0xaa1f('0x47')](handleError(_0x2790eb,null));};exports[_0xaa1f('0x48')]=function(_0x2c4008,_0x53e9b9){var _0x5ca976={'raw':!![],'where':{'id':_0x2c4008[_0xaa1f('0x49')]['id']}},_0x3d3a87={};_0x3d3a87[_0xaa1f('0x35')]=_['keys'](db[_0xaa1f('0x42')]['rawAttributes']);_0x3d3a87[_0xaa1f('0x31')]=_['keys'](_0x2c4008[_0xaa1f('0x31')]);_0x3d3a87[_0xaa1f('0x33')]=_['intersection'](_0x3d3a87['model'],_0x3d3a87[_0xaa1f('0x31')]);_0x5ca976[_0xaa1f('0x37')]=_[_0xaa1f('0x34')](_0x3d3a87[_0xaa1f('0x35')],qs['fields'](_0x2c4008['query'][_0xaa1f('0x36')]));_0x5ca976[_0xaa1f('0x37')]=_0x5ca976[_0xaa1f('0x37')][_0xaa1f('0x38')]?_0x5ca976[_0xaa1f('0x37')]:_0x3d3a87[_0xaa1f('0x35')];if(_0x2c4008[_0xaa1f('0x31')][_0xaa1f('0x43')]){_0x5ca976[_0xaa1f('0x44')]=[{'all':!![]}];}_0x5ca976=_['merge']({},_0x5ca976,_0x2c4008[_0xaa1f('0x41')]);return db[_0xaa1f('0x42')][_0xaa1f('0x4a')](_0x5ca976)['then'](handleEntityNotFound(_0x53e9b9,null))[_0xaa1f('0x25')](respondWithResult(_0x53e9b9,null))[_0xaa1f('0x47')](handleError(_0x53e9b9,null));};exports['create']=function(_0x7a3482,_0x583e7f){return db[_0xaa1f('0x42')]['create'](_0x7a3482[_0xaa1f('0x4b')],{})[_0xaa1f('0x25')](function(_0x47566a){var _0x496eba=_0x7a3482['user']['get']({'plain':!![]});if(!_0x496eba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x496eba[_0xaa1f('0x4c')]===_0xaa1f('0x4d')){var _0x3d030e=_0x47566a[_0xaa1f('0x27')]({'plain':!![]});var _0x3f0e1b=_0xaa1f('0x28');return db[_0xaa1f('0x4e')]['find']({'where':{'name':_0x3f0e1b,'userProfileId':_0x496eba[_0xaa1f('0x4f')]},'raw':!![]})['then'](function(_0x46cb86){if(_0x46cb86&&_0x46cb86[_0xaa1f('0x50')]===0x0){return db[_0xaa1f('0x29')][_0xaa1f('0x51')]({'name':_0x3d030e[_0xaa1f('0x2b')],'resourceId':_0x3d030e['id'],'type':_0x46cb86[_0xaa1f('0x2b')],'sectionId':_0x46cb86['id']},{})[_0xaa1f('0x25')](function(){return _0x47566a;});}else{return _0x47566a;}})[_0xaa1f('0x47')](function(_0xa5f5d8){logger['error'](_0xaa1f('0x52'),_0xa5f5d8);throw _0xa5f5d8;});}return _0x47566a;})['then'](respondWithResult(_0x583e7f,0xc9))[_0xaa1f('0x47')](handleError(_0x583e7f,null));};exports['update']=function(_0x54e8c8,_0xe32546){if(_0x54e8c8['body']['id']){delete _0x54e8c8['body']['id'];}return db[_0xaa1f('0x42')][_0xaa1f('0x4a')]({'where':{'id':_0x54e8c8[_0xaa1f('0x49')]['id']}})[_0xaa1f('0x25')](handleEntityNotFound(_0xe32546,null))[_0xaa1f('0x25')](saveUpdates(_0x54e8c8[_0xaa1f('0x4b')],null))[_0xaa1f('0x25')](respondWithResult(_0xe32546,null))[_0xaa1f('0x47')](handleError(_0xe32546,null));};exports[_0xaa1f('0x26')]=function(_0x3f84d0,_0x211fe7){return db[_0xaa1f('0x42')][_0xaa1f('0x4a')]({'where':{'id':_0x3f84d0[_0xaa1f('0x49')]['id']}})[_0xaa1f('0x25')](handleEntityNotFound(_0x211fe7,null))[_0xaa1f('0x25')](removeEntity(_0x211fe7,null))['catch'](handleError(_0x211fe7,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index cb28224..845a9b5 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 _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x93fe8f,_0x26d80c){var _0x25296b=function(_0x25fe95){while(--_0x25fe95){_0x93fe8f['push'](_0x93fe8f['shift']());}};_0x25296b(++_0x26d80c);}(_0xe14b,0x93));var _0xbe14=function(_0x6363ce,_0x254c2d){_0x6363ce=_0x6363ce-0x0;var _0x17985a=_0xe14b[_0x6363ce];return _0x17985a;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0x5513c6,_0x5c65bb){var _0x54c18f=function(_0x2d4867){while(--_0x2d4867){_0x5513c6['push'](_0x5513c6['shift']());}};_0x54c18f(++_0x5c65bb);}(_0x814b,0x1a2));var _0xb814=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0x814b[_0x367e5b];return _0x4b909e;};'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':'tools_pauses','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 aed88dd..a543415 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 _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x47d2fe,_0x442346){var _0x186c65=function(_0x80d954){while(--_0x80d954){_0x47d2fe['push'](_0x47d2fe['shift']());}};_0x186c65(++_0x442346);}(_0x7a54,0x106));var _0x47a5=function(_0xc70ddb,_0x41555b){_0xc70ddb=_0xc70ddb-0x0;var _0x4a5fb0=_0x7a54[_0xc70ddb];return _0x4a5fb0;};'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')]('Pause,\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['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ 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(_0xcf713c,_0x9b38b5){var _0x324aa8=function(_0x11c4b8){while(--_0x11c4b8){_0xcf713c['push'](_0xcf713c['shift']());}};_0x324aa8(++_0x9b38b5);}(_0xb10b,0x12a));var _0xbb10=function(_0x460358,_0x354877){_0x460358=_0x460358-0x0;var _0xdfdfa8=_0xb10b[_0x460358];return _0xdfdfa8;};'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 98c1d12..7c4831c 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 _0x8d0e=['basename','extname','now','post','file','upload','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','index','get','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','join','root','server/files/plugins','originalname','replace'];(function(_0x2b49e7,_0xab18d3){var _0x342c10=function(_0x14e023){while(--_0x14e023){_0x2b49e7['push'](_0x2b49e7['shift']());}};_0x342c10(++_0xab18d3);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1c556d,_0x1c894d){_0x1c556d=_0x1c556d-0x0;var _0x3212b4=_0x8d0e[_0x1c556d];return _0x3212b4;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xe8d0('0xa')]);router[_0xe8d0('0xb')](_0xe8d0('0xc'),controller[_0xe8d0('0xd')]);router[_0xe8d0('0xb')](_0xe8d0('0xe'),auth[_0xe8d0('0xf')](),controller[_0xe8d0('0x10')]);router['get'](_0xe8d0('0x11'),auth[_0xe8d0('0xf')](),controller[_0xe8d0('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x580aab,_0x42e0c2,_0x25e6b8){_0x25e6b8(null,path[_0xe8d0('0x13')](config[_0xe8d0('0x14')],_0xe8d0('0x15')));},'filename':function(_0x41de69,_0x5934b2,_0x38fac0){_0x5934b2[_0xe8d0('0x16')]=_0x5934b2['originalname'][_0xe8d0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x38fac0(null,util['format']('%s-%s%s',path[_0xe8d0('0x18')](_0x5934b2[_0xe8d0('0x16')],path[_0xe8d0('0x19')](_0x5934b2[_0xe8d0('0x16')])),Date[_0xe8d0('0x1a')](),path[_0xe8d0('0x19')](_0x5934b2['originalname'])));}})});router[_0xe8d0('0x1b')]('/',upload['single'](_0xe8d0('0x1c')),controller[_0xe8d0('0x1d')]);router[_0xe8d0('0x1b')]('/webhook',controller['webhookPost']);router['put'](_0xe8d0('0xe'),auth[_0xe8d0('0xf')](),controller[_0xe8d0('0x1e')]);router[_0xe8d0('0x1f')](_0xe8d0('0xe'),auth['isAuthenticated'](),controller[_0xe8d0('0x1f')]);module[_0xe8d0('0x20')]=router; \ No newline at end of file +var _0x2d17=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','file','/webhook','put','isAuthenticated','delete','exports','multer','util'];(function(_0xaefc06,_0x5c6863){var _0x15dbe0=function(_0x2c8316){while(--_0x2c8316){_0xaefc06['push'](_0xaefc06['shift']());}};_0x15dbe0(++_0x5c6863);}(_0x2d17,0x17e));var _0x72d1=function(_0x571370,_0x11f49d){_0x571370=_0x571370-0x0;var _0x1b4e40=_0x2d17[_0x571370];return _0x1b4e40;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var fs_extra=require(_0x72d1('0x4'));var auth=require(_0x72d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72d1('0x6'));var controller=require('./plugin.controller');router[_0x72d1('0x7')]('/',auth['isAuthenticated'](),controller[_0x72d1('0x8')]);router[_0x72d1('0x7')]('/webhook',controller[_0x72d1('0x9')]);router[_0x72d1('0x7')](_0x72d1('0xa'),auth['isAuthenticated'](),controller[_0x72d1('0xb')]);router[_0x72d1('0x7')](_0x72d1('0xc'),auth['isAuthenticated'](),controller[_0x72d1('0xd')]);var upload=multer({'storage':multer[_0x72d1('0xe')]({'destination':function(_0x45eb4a,_0x14a41e,_0x3cb9c2){_0x3cb9c2(null,path[_0x72d1('0xf')](config[_0x72d1('0x10')],_0x72d1('0x11')));},'filename':function(_0x273ccf,_0x2f5a78,_0x5ad4df){_0x2f5a78[_0x72d1('0x12')]=_0x2f5a78[_0x72d1('0x12')][_0x72d1('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5ad4df(null,util[_0x72d1('0x14')](_0x72d1('0x15'),path[_0x72d1('0x16')](_0x2f5a78[_0x72d1('0x12')],path[_0x72d1('0x17')](_0x2f5a78[_0x72d1('0x12')])),Date[_0x72d1('0x18')](),path[_0x72d1('0x17')](_0x2f5a78[_0x72d1('0x12')])));}})});router[_0x72d1('0x19')]('/',upload['single'](_0x72d1('0x1a')),controller['upload']);router[_0x72d1('0x19')](_0x72d1('0x1b'),controller['webhookPost']);router[_0x72d1('0x1c')](_0x72d1('0xa'),auth[_0x72d1('0x1d')](),controller['update']);router['delete'](_0x72d1('0xa'),auth[_0x72d1('0x1d')](),controller[_0x72d1('0x1e')]);module[_0x72d1('0x1f')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index ea75dda..d2da553 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 _0x886c=['STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','adminOnly','agentOnly','always','never','sequelize'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x886c,0x196));var _0xc886=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x886c[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xc886('0x0'));module['exports']={'name':{'type':Sequelize[_0xc886('0x1')]},'type':{'type':Sequelize[_0xc886('0x2')](_0xc886('0x3'),_0xc886('0x4'))},'description':{'type':Sequelize[_0xc886('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xc886('0x1')],'comment':_0xc886('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xc886('0x2')](_0xc886('0x7'),_0xc886('0x8'),_0xc886('0x9'),_0xc886('0xa')),'defaultValue':_0xc886('0x9'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xc886('0x1')]},'agentUrl':{'type':Sequelize[_0xc886('0x1')]},'scriptName':{'type':Sequelize[_0xc886('0x1')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x69cd=['agentOnly','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0x69cd,0x9b));var _0xd69c=function(_0x9c3c56,_0x169b56){_0x9c3c56=_0x9c3c56-0x0;var _0x2dd782=_0x69cd[_0x9c3c56];return _0x2dd782;};'use strict';var Sequelize=require(_0xd69c('0x0'));module['exports']={'name':{'type':Sequelize[_0xd69c('0x1')]},'type':{'type':Sequelize['ENUM']('html','script')},'description':{'type':Sequelize[_0xd69c('0x2')]},'version':{'type':Sequelize[_0xd69c('0x2')]},'path':{'type':Sequelize[_0xd69c('0x1')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xd69c('0x3')],'defaultValue':0x0,'comment':_0xd69c('0x4')},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0xd69c('0x5'),'always',_0xd69c('0x6')),'defaultValue':'always','comment':_0xd69c('0x7')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xd69c('0x1')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xd69c('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 32cca16..eb985f9 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 _0x1821=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','name','send','index','map','Plugin','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','findAll','catch','show','params','include','options','find','server/files/plugins','%s.zip','createWriteStream','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','join','root','dirname','node_modules/**/*','basename','attachments/**/*','close','Plugin\x20not\x20found','download','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','description','sidebar','always','icon','test','plugins','agent','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','userProfileId','user','UserProfileSection','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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','endsWith','statusCode','webhookPost','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./plugin.socket','sendStatus'];(function(_0x30f9e7,_0x4b21fc){var _0x2ed68c=function(_0x28b2e2){while(--_0x28b2e2){_0x30f9e7['push'](_0x30f9e7['shift']());}};_0x2ed68c(++_0x4b21fc);}(_0x1821,0x121));var _0x1182=function(_0x141be3,_0x16a4d6){_0x141be3=_0x141be3-0x0;var _0x362ee0=_0x1821[_0x141be3];return _0x362ee0;};'use strict';var emlformat=require(_0x1182('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1182('0x1'));var jsonpatch=require(_0x1182('0x2'));var rp=require('request-promise');var moment=require(_0x1182('0x3'));var BPromise=require(_0x1182('0x4'));var Mustache=require(_0x1182('0x5'));var util=require(_0x1182('0x6'));var path=require(_0x1182('0x7'));var sox=require(_0x1182('0x8'));var csv=require(_0x1182('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1182('0xa'));var _=require(_0x1182('0xb'));var squel=require(_0x1182('0xc'));var crypto=require('crypto');var jsforce=require(_0x1182('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1182('0x9'));var querystring=require(_0x1182('0xe'));var Papa=require(_0x1182('0xf'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0x1182('0x10'));var Redis=require('ioredis');var authService=require(_0x1182('0x11'));var qs=require(_0x1182('0x12'));var as=require(_0x1182('0x13'));var hardwareService=require(_0x1182('0x14'));var logger=require(_0x1182('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x1182('0x16'));var licenseUtil=require(_0x1182('0x17'));var db=require(_0x1182('0x18'))['db'];config['redis']=_[_0x1182('0x19')](config[_0x1182('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1182('0x1a')]));require(_0x1182('0x1b'))['register'](socket);function respondWithStatusCode(_0x5749dc,_0x394e5e){_0x394e5e=_0x394e5e||0xcc;return function(_0xfcea1e){if(_0xfcea1e){return _0x5749dc[_0x1182('0x1c')](_0x394e5e);}return _0x5749dc[_0x1182('0x1d')](_0x394e5e)[_0x1182('0x1e')]();};}function respondWithResult(_0x135876,_0x4e25bc){_0x4e25bc=_0x4e25bc||0xc8;return function(_0xaa717e){if(_0xaa717e){return _0x135876[_0x1182('0x1d')](_0x4e25bc)[_0x1182('0x1f')](_0xaa717e);}};}function respondWithFilteredResult(_0x4dc15e,_0x19565d){return function(_0x2b5e5f){if(_0x2b5e5f){var _0x240e5d=typeof _0x19565d[_0x1182('0x20')]===_0x1182('0x21')&&typeof _0x19565d[_0x1182('0x22')]===_0x1182('0x21');var _0x534de4=_0x2b5e5f[_0x1182('0x23')];var _0x390d07=_0x240e5d?0x0:_0x19565d[_0x1182('0x20')];var _0x5b13ab=_0x240e5d?_0x2b5e5f[_0x1182('0x23')]:_0x19565d['offset']+_0x19565d[_0x1182('0x22')];var _0xdd73a7;if(_0x5b13ab>=_0x534de4){_0x5b13ab=_0x534de4;_0xdd73a7=0xc8;}else{_0xdd73a7=0xce;}_0x4dc15e[_0x1182('0x1d')](_0xdd73a7);return _0x4dc15e[_0x1182('0x24')](_0x1182('0x25'),_0x390d07+'-'+_0x5b13ab+'/'+_0x534de4)[_0x1182('0x1f')](_0x2b5e5f);}return null;};}function patchUpdates(_0x329dad){return function(_0x1f6e74){try{jsonpatch[_0x1182('0x26')](_0x1f6e74,_0x329dad,!![]);}catch(_0x48e3cd){return BPromise[_0x1182('0x27')](_0x48e3cd);}return _0x1f6e74[_0x1182('0x28')]();};}function saveUpdates(_0x471375,_0x430802){return function(_0x46a754){if(_0x46a754){return _0x46a754[_0x1182('0x29')](_0x471375)[_0x1182('0x2a')](function(_0x593c40){return _0x593c40;});}return null;};}function removeEntity(_0x4fbadd,_0x1cf3ae){return function(_0x5a1b35){if(_0x5a1b35){return _0x5a1b35[_0x1182('0x2b')]()[_0x1182('0x2a')](function(){var _0x2e9ad4=_0x5a1b35[_0x1182('0x2c')]({'plain':!![]});var _0x56bb91='Plugins';return db[_0x1182('0x2d')][_0x1182('0x2b')]({'where':{'type':_0x56bb91,'resourceId':_0x2e9ad4['id']}})['then'](function(){return _0x5a1b35;});})[_0x1182('0x2a')](function(){_0x4fbadd[_0x1182('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56500d,_0x360d7d){return function(_0x726dc8){if(!_0x726dc8){_0x56500d[_0x1182('0x1c')](0x194);}return _0x726dc8;};}function handleError(_0x4cc098,_0x36f69b){_0x36f69b=_0x36f69b||0x1f4;return function(_0x49e5ab){logger['error'](_0x49e5ab['stack']);if(_0x49e5ab[_0x1182('0x2e')]){delete _0x49e5ab['name'];}_0x4cc098[_0x1182('0x1d')](_0x36f69b)[_0x1182('0x2f')](_0x49e5ab);};}exports[_0x1182('0x30')]=function(_0x1e2d01,_0x23d32e){var _0x917773={},_0x4a5569={},_0xb9080b={'count':0x0,'rows':[]};var _0x1f806d=_[_0x1182('0x31')](db[_0x1182('0x32')][_0x1182('0x33')],function(_0x3453f2){return{'name':_0x3453f2['fieldName'],'type':_0x3453f2[_0x1182('0x34')][_0x1182('0x35')]};});_0x4a5569[_0x1182('0x36')]=_[_0x1182('0x31')](_0x1f806d,_0x1182('0x2e'));_0x4a5569[_0x1182('0x37')]=_[_0x1182('0x38')](_0x1e2d01[_0x1182('0x37')]);_0x4a5569['filters']=_[_0x1182('0x39')](_0x4a5569[_0x1182('0x36')],_0x4a5569[_0x1182('0x37')]);_0x917773[_0x1182('0x3a')]=_[_0x1182('0x39')](_0x4a5569[_0x1182('0x36')],qs[_0x1182('0x3b')](_0x1e2d01[_0x1182('0x37')][_0x1182('0x3b')]));_0x917773['attributes']=_0x917773[_0x1182('0x3a')][_0x1182('0x3c')]?_0x917773[_0x1182('0x3a')]:_0x4a5569[_0x1182('0x36')];if(!_0x1e2d01[_0x1182('0x37')][_0x1182('0x3d')]('nolimit')){_0x917773['limit']=qs[_0x1182('0x22')](_0x1e2d01[_0x1182('0x37')][_0x1182('0x22')]);_0x917773['offset']=qs[_0x1182('0x20')](_0x1e2d01[_0x1182('0x37')][_0x1182('0x20')]);}_0x917773[_0x1182('0x3e')]=qs[_0x1182('0x3f')](_0x1e2d01[_0x1182('0x37')][_0x1182('0x3f')]);_0x917773[_0x1182('0x40')]=qs[_0x1182('0x41')](_[_0x1182('0x42')](_0x1e2d01[_0x1182('0x37')],_0x4a5569[_0x1182('0x41')]),_0x1f806d);if(_0x1e2d01['query'][_0x1182('0x43')]){_0x917773[_0x1182('0x40')]=_[_0x1182('0x44')](_0x917773['where'],{'$or':_[_0x1182('0x31')](_0x1f806d,function(_0x409566){if(_0x409566['type']!=='VIRTUAL'){var _0x49ad4e={};_0x49ad4e[_0x409566['name']]={'$like':'%'+_0x1e2d01[_0x1182('0x37')][_0x1182('0x43')]+'%'};return _0x49ad4e;}})});}_0x917773=_['merge']({},_0x917773,_0x1e2d01['options']);var _0x40e7b7={'where':_0x917773[_0x1182('0x40')]};return db[_0x1182('0x32')][_0x1182('0x23')](_0x40e7b7)['then'](function(_0x5d2f46){_0xb9080b[_0x1182('0x23')]=_0x5d2f46;if(_0x1e2d01[_0x1182('0x37')][_0x1182('0x45')]){_0x917773['include']=[{'all':!![]}];}return db['Plugin'][_0x1182('0x46')](_0x917773);})['then'](function(_0x222aa6){_0xb9080b['rows']=_0x222aa6;return _0xb9080b;})[_0x1182('0x2a')](respondWithFilteredResult(_0x23d32e,_0x917773))[_0x1182('0x47')](handleError(_0x23d32e,null));};exports[_0x1182('0x48')]=function(_0x6d82cd,_0x840c55){var _0x3c6e4a={'raw':!![],'where':{'id':_0x6d82cd[_0x1182('0x49')]['id']}},_0x105ece={};_0x105ece[_0x1182('0x36')]=_[_0x1182('0x38')](db[_0x1182('0x32')][_0x1182('0x33')]);_0x105ece[_0x1182('0x37')]=_[_0x1182('0x38')](_0x6d82cd[_0x1182('0x37')]);_0x105ece[_0x1182('0x41')]=_[_0x1182('0x39')](_0x105ece[_0x1182('0x36')],_0x105ece[_0x1182('0x37')]);_0x3c6e4a[_0x1182('0x3a')]=_['intersection'](_0x105ece[_0x1182('0x36')],qs[_0x1182('0x3b')](_0x6d82cd['query'][_0x1182('0x3b')]));_0x3c6e4a[_0x1182('0x3a')]=_0x3c6e4a[_0x1182('0x3a')][_0x1182('0x3c')]?_0x3c6e4a[_0x1182('0x3a')]:_0x105ece[_0x1182('0x36')];if(_0x6d82cd[_0x1182('0x37')]['includeAll']){_0x3c6e4a[_0x1182('0x4a')]=[{'all':!![]}];}_0x3c6e4a=_[_0x1182('0x44')]({},_0x3c6e4a,_0x6d82cd[_0x1182('0x4b')]);return db[_0x1182('0x32')][_0x1182('0x4c')](_0x3c6e4a)['then'](handleEntityNotFound(_0x840c55,null))[_0x1182('0x2a')](respondWithResult(_0x840c55,null))['catch'](handleError(_0x840c55,null));};exports['download']=function(_0x27e2a0,_0x3a2080,_0x8de467){return db[_0x1182('0x32')][_0x1182('0x4c')]({'where':{'id':_0x27e2a0[_0x1182('0x49')]['id']},'attributes':[_0x1182('0x2e'),_0x1182('0x7')],'raw':!![]})[_0x1182('0x2a')](handleEntityNotFound(_0x3a2080,null))[_0x1182('0x2a')](function(_0x280247){if(_0x280247){var _0x3a930f=path['join'](config['root'],_0x1182('0x4d'),util['format'](_0x1182('0x4e'),path['basename'](_0x280247[_0x1182('0x7')])));var _0x6df008=fs[_0x1182('0x4f')](_0x3a930f);var _0x207755=archiver('zip',{'zlib':{'level':0x9}});_0x207755['on']('warning',function(_0x1090a6){if(_0x1090a6['code']===_0x1182('0x50')){logger[_0x1182('0x51')](_0x1090a6);}else{throw new db[(_0x1182('0x52'))][(_0x1182('0x53'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x207755['on'](_0x1182('0x51'),function(_0xaf4647){throw new db[(_0x1182('0x52'))]['Error'](_0x1182('0x54'));});_0x207755[_0x1182('0x55')](_0x6df008);_0x207755[_0x1182('0x56')]('**/*',{'cwd':path[_0x1182('0x57')](config[_0x1182('0x58')],_0x1182('0x4d'),path[_0x1182('0x59')](_0x280247[_0x1182('0x7')])),'ignore':[path[_0x1182('0x57')](path['basename'](_0x280247[_0x1182('0x7')]),_0x1182('0x5a')),path['join'](path[_0x1182('0x5b')](_0x280247[_0x1182('0x7')]),_0x1182('0x5c'))],'nodir':!![]})['finalize']();_0x6df008['on'](_0x1182('0x5d'),function(){if(!fs['existsSync'](_0x3a930f)){throw new db[(_0x1182('0x52'))]['Error'](_0x1182('0x5e'));}return _0x3a2080[_0x1182('0x5f')](_0x3a930f,util[_0x1182('0x60')](_0x1182('0x4e'),path['basename'](_0x280247[_0x1182('0x7')])),function(_0x12af1a){if(_0x12af1a){throw new db['Sequelize']['Error'](_0x1182('0x61'));}fs[_0x1182('0x62')](_0x3a930f);logger[_0x1182('0x63')]('Download\x20completed');logger[_0x1182('0x63')](_0x1182('0x64'));});});}return null;})[_0x1182('0x47')](handleError(_0x3a2080,null));};exports['upload']=function(_0x25d112,_0x39b52b,_0x2337e0){var _0x2e284e=path['basename'](_0x25d112['file'][_0x1182('0x65')],path['extname'](_0x25d112['file']['filename']));var _0x41bf95=path[_0x1182('0x57')](config[_0x1182('0x58')],_0x1182('0x4d'),_0x25d112['file']['filename']);var _0x46154e=path[_0x1182('0x57')](config[_0x1182('0x58')],'server/files/plugins',_0x2e284e);logger[_0x1182('0x63')](_0x1182('0x66'),_0x41bf95);logger['info'](_0x1182('0x67'),_0x46154e);try{fs[_0x1182('0x68')](_0x41bf95,parseInt(_0x1182('0x69'),0x8));extract(_0x41bf95,{'dir':_0x46154e},function(_0x29f25e){if(_0x29f25e){logger[_0x1182('0x51')](_0x29f25e);handleError(_0x29f25e,!![]);};var _0x4c05f3=fs['readdirSync'](_0x46154e);if(_0x4c05f3[_0x1182('0x3c')]>0x1){removeReferences(_0x41bf95,_0x46154e);logger['error'](_0x1182('0x6a'));return _0x2337e0(new Error(_0x1182('0x6a')));}var _0x123896=fs[_0x1182('0x6b')](path[_0x1182('0x57')](_0x46154e,_0x4c05f3[0x0]));if(_0x123896[_0x1182('0x6c')]()){removeReferences(_0x41bf95,_0x46154e);logger[_0x1182('0x51')](_0x1182('0x6a'));return _0x2337e0(new Error(_0x1182('0x6a')));}if(_0x123896[_0x1182('0x6d')]()){var _0x1c32fc=fs['readdirSync'](path[_0x1182('0x57')](_0x46154e,_0x4c05f3[0x0]));if(_0x1c32fc[_0x1182('0x3c')]===0x0){removeReferences(_0x41bf95,_0x46154e);logger[_0x1182('0x51')](_0x1182('0x6a'));return _0x2337e0(new Error(_0x1182('0x6a')));}var _0x10e144=_0x1c32fc[_0x1182('0x6e')](function(_0x4b7416){return _0x4b7416==='manifest.json';});if(!_0x10e144){return _0x2337e0(new Error(_0x1182('0x6f')));}var _0x2072ae=fs[_0x1182('0x70')](path[_0x1182('0x57')](_0x46154e,_0x4c05f3[0x0],_0x1182('0x71')));var _0x2c90d3=JSON['parse'](_0x2072ae);if('undefined'==typeof _0x2c90d3[_0x1182('0x2e')]){return _0x2337e0(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x1182('0x21')==typeof _0x2c90d3[_0x1182('0x34')]){return _0x2337e0(new Error('Invalid\x20manifest:\x20type\x20missing'));}if('undefined'==typeof _0x2c90d3[_0x1182('0x72')]){return _0x2337e0(new Error(_0x1182('0x73')));}if('undefined'==typeof _0x2c90d3[_0x1182('0x74')]){return _0x2337e0(new Error(_0x1182('0x75')));}if(_0x2c90d3[_0x1182('0x34')]===_0x1182('0x76')){if('undefined'==typeof _0x2c90d3[_0x1182('0x74')][_0x1182('0x77')]){return _0x2337e0(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x1182('0x21')==typeof _0x2c90d3[_0x1182('0x74')][_0x1182('0x77')][_0x1182('0x78')]&&_0x1182('0x21')==typeof _0x2c90d3[_0x1182('0x74')][_0x1182('0x77')]['agent']){return _0x2337e0(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x2c90d3[_0x1182('0x34')]==='script'){if(_0x1182('0x21')==typeof _0x2c90d3[_0x1182('0x74')][_0x1182('0x79')]){return _0x2337e0(new Error(_0x1182('0x7a')));}if(_0x1182('0x21')==typeof _0x2c90d3[_0x1182('0x74')][_0x1182('0x7b')]){return _0x2337e0(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x2337e0(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0xaa2161=_0x2c90d3['name'];var _0x1a4957=_0x2c90d3[_0x1182('0x7c')];var _0x4b72d6=_0x2c90d3['type'];var _0x2ecd27=_0x2c90d3[_0x1182('0x7d')]?_0x2c90d3[_0x1182('0x7d')]:_0x1182('0x7e');var _0x897b22=_0x2c90d3[_0x1182('0x7f')]?_0x2c90d3[_0x1182('0x7f')]:'icon-apps';var _0x2e6242='';var _0x4b8498='';var _0x4de4a9='';var _0x2e394b='';var _0x245d93=_0x2c90d3[_0x1182('0x72')];if(_0x4b72d6===_0x1182('0x76')){if(_0x1182('0x21')!=typeof _0x2c90d3[_0x1182('0x74')]['views'][_0x1182('0x78')]){var _0x2079a9=_0x2c90d3[_0x1182('0x74')][_0x1182('0x77')][_0x1182('0x78')];if(!/^(f|ht)tps?:\/\//i[_0x1182('0x80')](_0x2079a9)){_0x2e6242=path['join'](_0x1182('0x81'),_0x2e284e,_0x4c05f3[0x0],_0x2079a9);}else{_0x2e6242=_0x2079a9;}}else{logger[_0x1182('0x63')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x2c90d3[_0x1182('0x74')]['views'][_0x1182('0x82')]){var _0x2419e5=_0x2c90d3[_0x1182('0x74')][_0x1182('0x77')][_0x1182('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x1182('0x80')](_0x2419e5)){_0x4b8498=path[_0x1182('0x57')](_0x1182('0x81'),_0x2e284e,_0x4c05f3[0x0],_0x2419e5);}else{_0x4b8498=_0x2419e5;}}else{logger[_0x1182('0x63')](_0x1182('0x83'));}}else if(_0x4b72d6===_0x1182('0x84')){_0x4de4a9=_0x2c90d3[_0x1182('0x74')][_0x1182('0x79')];_0x2e394b=_0x2c90d3['parameters'][_0x1182('0x7b')];if(_0x1182('0x21')!=typeof _0x2c90d3[_0x1182('0x74')]['views']){if(_0x1182('0x21')!=typeof _0x2c90d3[_0x1182('0x74')]['views'][_0x1182('0x78')]){var _0x2079a9=_0x2c90d3['parameters'][_0x1182('0x77')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x1182('0x80')](_0x2079a9)){_0x2e6242=path[_0x1182('0x57')](_0x1182('0x81'),_0x2e284e,_0x4c05f3[0x0],_0x2079a9);}else{_0x2e6242=_0x2079a9;}}if(_0x1182('0x21')!=typeof _0x2c90d3[_0x1182('0x74')][_0x1182('0x77')][_0x1182('0x82')]){var _0x2419e5=_0x2c90d3[_0x1182('0x74')][_0x1182('0x77')][_0x1182('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x1182('0x80')](_0x2419e5)){_0x4b8498=path[_0x1182('0x57')](_0x1182('0x81'),_0x2e284e,_0x4c05f3[0x0],_0x2419e5);}else{_0x4b8498=_0x2419e5;}}}}var _0x48d711={'name':_0xaa2161,'description':_0x1a4957,'path':path[_0x1182('0x57')](_0x2e284e,_0x4c05f3[0x0]),'type':_0x4b72d6,'sidebar':_0x2ecd27,'icon':_0x897b22,'adminUrl':_0x2e6242,'agentUrl':_0x4b8498,'scriptName':_0x4de4a9,'scriptPath':_0x2e394b,'version':_0x245d93};removeReferences(_0x41bf95,null);return db[_0x1182('0x32')][_0x1182('0x85')](_0x48d711)['then'](function(_0xc4c6b8){var _0xb4e820={'role':_0x25d112[_0x1182('0x86')][_0x1182('0x87')],'userProfileId':_0x25d112[_0x1182('0x86')][_0x1182('0x88')]};if(!_0xb4e820)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb4e820[_0x1182('0x87')]===_0x1182('0x89')){var _0x49daa2=_0xc4c6b8['get']({'plain':!![]});return db[_0x1182('0x8a')][_0x1182('0x4c')]({'where':{'name':_0x1182('0x8b'),'userProfileId':_0xb4e820[_0x1182('0x88')]},'raw':!![]})['then'](function(_0x273196){if(_0x273196&&_0x273196[_0x1182('0x8c')]===0x0){return db['UserProfileResource']['create']({'name':_0x49daa2[_0x1182('0x2e')],'resourceId':_0x49daa2['id'],'type':_0x273196[_0x1182('0x2e')],'sectionId':_0x273196['id']},{})['then'](function(){return _0xc4c6b8;});}else{return _0xc4c6b8;}})[_0x1182('0x47')](function(_0x7a61c3){logger[_0x1182('0x51')](_0x1182('0x8d'),_0x7a61c3);throw _0x7a61c3;});}return _0xc4c6b8;})[_0x1182('0x2a')](respondWithResult(_0x39b52b,null))[_0x1182('0x47')](handleError(_0x39b52b,null));}});}catch(_0x4db1e9){_0x39b52b['status'](0x1f4)[_0x1182('0x2f')](_0x4db1e9);}};function removeReferences(_0x527cdc,_0x143071){try{if(_0x527cdc){fs['unlinkSync'](_0x527cdc);logger[_0x1182('0x63')]('Zip\x20archive\x20removed');}if(_0x143071){rimraf(_0x143071,function(){});logger[_0x1182('0x63')](_0x1182('0x8e'));}}catch(_0x4d4e5a){logger[_0x1182('0x51')](_0x4d4e5a);}}exports[_0x1182('0x29')]=function(_0x3329c5,_0x30f888,_0x284ff2){return db['Plugin'][_0x1182('0x4c')]({'where':{'id':_0x3329c5[_0x1182('0x49')]['id']}})['then'](handleEntityNotFound(_0x30f888,null))['then'](saveUpdates(_0x3329c5[_0x1182('0x86')],null))[_0x1182('0x2a')](respondWithResult(_0x30f888,null))[_0x1182('0x47')](handleError(_0x30f888,null));};exports['delete']=function(_0x3d71ba,_0x4b6001,_0x27caaa){return db['Plugin'][_0x1182('0x4c')]({'where':{'id':_0x3d71ba[_0x1182('0x49')]['id']}})[_0x1182('0x2a')](function(_0x24d6ef){if(_0x24d6ef){return _0x24d6ef[_0x1182('0x2b')]();}})[_0x1182('0x2a')](function(_0x4b8f40){rimraf(path[_0x1182('0x57')](config[_0x1182('0x58')],'server/files/plugins',path[_0x1182('0x59')](_0x4b8f40['path'])),function(){});return _0x4b8f40;})[_0x1182('0x2a')](handleEntityNotFound(_0x4b6001,null))[_0x1182('0x2a')](respondWithStatusCode(_0x4b6001,null))[_0x1182('0x47')](handleError(_0x4b6001,null));};exports[_0x1182('0x8f')]=function(_0x1e5155,_0x237955,_0x2637d7){return BPromise[_0x1182('0x90')]()[_0x1182('0x2a')](function(){if(!_0x1e5155[_0x1182('0x37')][_0x1182('0x7')]){throw new Error(_0x1182('0x91'));}if(!_0x1e5155['query'][_0x1182('0x92')]){throw new Error(_0x1182('0x93'));}var _0x66e14=_0x1e5155['query'][_0x1182('0x94')]?_0x1e5155['query'][_0x1182('0x94')]+':'+_0x1e5155[_0x1182('0x37')][_0x1182('0x92')]:_0x1182('0x95')+_0x1e5155[_0x1182('0x37')][_0x1182('0x92')];var _0x985541=_0x1e5155[_0x1182('0x37')][_0x1182('0x1f')]?_0x1e5155[_0x1182('0x37')][_0x1182('0x1f')]:!![];var _0x36e94e=_0x1e5155[_0x1182('0x37')][_0x1182('0x96')]?_0x1e5155[_0x1182('0x37')]['encoding']:null;var _0x47047f={'method':_0x1e5155[_0x1182('0x97')],'uri':util[_0x1182('0x60')](_0x1182('0x98'),_0x66e14,_0x1e5155[_0x1182('0x37')][_0x1182('0x7')]),'json':_0x985541,'resolveWithFullResponse':!![],'encoding':_0x36e94e,'qs':_0x1e5155[_0x1182('0x37')]};if(_0x1e5155[_0x1182('0x99')]){_0x47047f[_0x1182('0x99')]=_0x1e5155[_0x1182('0x99')];if(_0x47047f[_0x1182('0x99')]['content-length']){delete _0x47047f[_0x1182('0x99')][_0x1182('0x9a')];}}if(_0x47047f[_0x1182('0x99')][_0x1182('0x9b')]){delete _0x47047f[_0x1182('0x99')][_0x1182('0x9b')];}return rp(_0x47047f);})['then'](function(_0x19d691){if(_0x19d691){_0x237955['set'](_0x19d691[_0x1182('0x99')]);logger[_0x1182('0x63')](_0x19d691[_0x1182('0x86')]);if(_[_0x1182('0x9c')](_0x1e5155[_0x1182('0x37')][_0x1182('0x7')],_0x1182('0x5f'))&&_0x19d691['statusCode']==0x1f4){return _0x237955[_0x1182('0x1c')](_0x19d691['statusCode']);}else{return _0x237955[_0x1182('0x1d')](_0x19d691[_0x1182('0x9d')])[_0x1182('0x2f')](_0x19d691['body']);}}else{return _0x237955['sendStatus'](0xc8);}})['catch'](handleError(_0x237955,null));};exports[_0x1182('0x9e')]=function(_0x15a3f2,_0x1de497,_0xb4eb71){return BPromise[_0x1182('0x90')]()[_0x1182('0x2a')](function(){if(!_0x15a3f2[_0x1182('0x37')][_0x1182('0x7')]){throw new Error(_0x1182('0x91'));}if(!_0x15a3f2[_0x1182('0x37')]['port']){throw new Error(_0x1182('0x93'));}var _0x502d13=_0x15a3f2[_0x1182('0x37')][_0x1182('0x94')]?_0x15a3f2[_0x1182('0x37')][_0x1182('0x94')]+':'+_0x15a3f2['query']['port']:_0x1182('0x95')+_0x15a3f2[_0x1182('0x37')][_0x1182('0x92')];var _0x26af98=_0x15a3f2[_0x1182('0x37')][_0x1182('0x1f')]?_0x15a3f2[_0x1182('0x37')][_0x1182('0x1f')]:!![];var _0xb4859b=_0x15a3f2[_0x1182('0x37')][_0x1182('0x96')]?_0x15a3f2[_0x1182('0x37')][_0x1182('0x96')]:null;var _0x2d6e41={'method':_0x15a3f2['method'],'uri':util['format'](_0x1182('0x98'),_0x502d13,_0x15a3f2[_0x1182('0x37')][_0x1182('0x7')]),'json':_0x26af98,'resolveWithFullResponse':!![],'encoding':_0xb4859b,'body':_0x15a3f2['body']};if(_0x15a3f2['headers']){_0x2d6e41[_0x1182('0x99')]=_0x15a3f2[_0x1182('0x99')];if(_0x2d6e41[_0x1182('0x99')]['content-length']){delete _0x2d6e41[_0x1182('0x99')][_0x1182('0x9a')];}}if(_0x2d6e41[_0x1182('0x99')][_0x1182('0x9b')]){delete _0x2d6e41[_0x1182('0x99')]['content-type'];}return rp(_0x2d6e41);})[_0x1182('0x2a')](function(_0x140e90){if(_0x140e90){_0x1de497[_0x1182('0x24')](_0x140e90[_0x1182('0x99')]);logger[_0x1182('0x63')](_0x140e90[_0x1182('0x86')]);return _0x1de497['status'](_0x140e90[_0x1182('0x9d')])['send'](_0x140e90['body']);}else{return _0x1de497[_0x1182('0x1c')](0xc8);}})[_0x1182('0x47')](handleError(_0x1de497,null));}; \ No newline at end of file +var _0x3d4f=['include','findAll','show','params','catch','download','find','root','server/files/plugins','format','%s.zip','basename','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','join','dirname','node_modules/**/*','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','type','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Plugins','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-type','endsWith','statusCode','content-length','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','save','update','destroy','then','get','UserProfileResource','error','name','index','map','Plugin','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x43b548,_0x30ea37){var _0x37f928=function(_0x320477){while(--_0x320477){_0x43b548['push'](_0x43b548['shift']());}};_0x37f928(++_0x30ea37);}(_0x3d4f,0x1bb));var _0xf3d4=function(_0x3c9268,_0x1a0c1f){_0x3c9268=_0x3c9268-0x0;var _0x4c62e5=_0x3d4f[_0x3c9268];return _0x4c62e5;};'use strict';var emlformat=require(_0xf3d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf3d4('0x1'));var jsonpatch=require(_0xf3d4('0x2'));var rp=require(_0xf3d4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf3d4('0x4'));var util=require(_0xf3d4('0x5'));var path=require(_0xf3d4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf3d4('0x7'));var _=require(_0xf3d4('0x8'));var squel=require(_0xf3d4('0x9'));var crypto=require(_0xf3d4('0xa'));var jsforce=require(_0xf3d4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf3d4('0xc'));var querystring=require(_0xf3d4('0xd'));var Papa=require(_0xf3d4('0xe'));var extract=require('extract-zip');var rimraf=require(_0xf3d4('0xf'));var archiver=require(_0xf3d4('0x10'));var Redis=require(_0xf3d4('0x11'));var authService=require(_0xf3d4('0x12'));var qs=require(_0xf3d4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf3d4('0x14'));var logger=require(_0xf3d4('0x15'))(_0xf3d4('0x16'));var utils=require('../../config/utils');var config=require(_0xf3d4('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xf3d4('0x18')](config[_0xf3d4('0x19')],{'host':_0xf3d4('0x1a'),'port':0x18eb});var socket=require(_0xf3d4('0x1b'))(new Redis(config[_0xf3d4('0x19')]));require(_0xf3d4('0x1c'))[_0xf3d4('0x1d')](socket);function respondWithStatusCode(_0x2f3d88,_0xe8d18a){_0xe8d18a=_0xe8d18a||0xcc;return function(_0x374e39){if(_0x374e39){return _0x2f3d88[_0xf3d4('0x1e')](_0xe8d18a);}return _0x2f3d88[_0xf3d4('0x1f')](_0xe8d18a)[_0xf3d4('0x20')]();};}function respondWithResult(_0x5cc785,_0x48ec75){_0x48ec75=_0x48ec75||0xc8;return function(_0x943ca8){if(_0x943ca8){return _0x5cc785[_0xf3d4('0x1f')](_0x48ec75)[_0xf3d4('0x21')](_0x943ca8);}};}function respondWithFilteredResult(_0x514d27,_0x51e20e){return function(_0x3f52ce){if(_0x3f52ce){var _0x1e0351=typeof _0x51e20e['offset']===_0xf3d4('0x22')&&typeof _0x51e20e['limit']===_0xf3d4('0x22');var _0x1f184d=_0x3f52ce[_0xf3d4('0x23')];var _0xf1d529=_0x1e0351?0x0:_0x51e20e[_0xf3d4('0x24')];var _0x39557e=_0x1e0351?_0x3f52ce[_0xf3d4('0x23')]:_0x51e20e[_0xf3d4('0x24')]+_0x51e20e[_0xf3d4('0x25')];var _0x43c6ce;if(_0x39557e>=_0x1f184d){_0x39557e=_0x1f184d;_0x43c6ce=0xc8;}else{_0x43c6ce=0xce;}_0x514d27['status'](_0x43c6ce);return _0x514d27[_0xf3d4('0x26')]('Content-Range',_0xf1d529+'-'+_0x39557e+'/'+_0x1f184d)[_0xf3d4('0x21')](_0x3f52ce);}return null;};}function patchUpdates(_0x30f48c){return function(_0x5c7ce1){try{jsonpatch['apply'](_0x5c7ce1,_0x30f48c,!![]);}catch(_0x2b6058){return BPromise[_0xf3d4('0x27')](_0x2b6058);}return _0x5c7ce1[_0xf3d4('0x28')]();};}function saveUpdates(_0x54cc96,_0x2c859c){return function(_0x387091){if(_0x387091){return _0x387091[_0xf3d4('0x29')](_0x54cc96)['then'](function(_0x168041){return _0x168041;});}return null;};}function removeEntity(_0x45c661,_0x51ae50){return function(_0x472a1d){if(_0x472a1d){return _0x472a1d[_0xf3d4('0x2a')]()[_0xf3d4('0x2b')](function(){var _0x2ad3c0=_0x472a1d[_0xf3d4('0x2c')]({'plain':!![]});var _0x5f470a='Plugins';return db[_0xf3d4('0x2d')][_0xf3d4('0x2a')]({'where':{'type':_0x5f470a,'resourceId':_0x2ad3c0['id']}})['then'](function(){return _0x472a1d;});})[_0xf3d4('0x2b')](function(){_0x45c661[_0xf3d4('0x1f')](0xcc)[_0xf3d4('0x20')]();});}};}function handleEntityNotFound(_0x1bdf74,_0x23326d){return function(_0x1aab12){if(!_0x1aab12){_0x1bdf74['sendStatus'](0x194);}return _0x1aab12;};}function handleError(_0x2b78a6,_0x13c84c){_0x13c84c=_0x13c84c||0x1f4;return function(_0x307f32){logger[_0xf3d4('0x2e')](_0x307f32['stack']);if(_0x307f32[_0xf3d4('0x2f')]){delete _0x307f32['name'];}_0x2b78a6['status'](_0x13c84c)['send'](_0x307f32);};}exports[_0xf3d4('0x30')]=function(_0x26f89b,_0x323121){var _0x428a9c={},_0x44fd87={},_0x2c8798={'count':0x0,'rows':[]};var _0x5d98f9=_[_0xf3d4('0x31')](db[_0xf3d4('0x32')][_0xf3d4('0x33')],function(_0x4f7aa6){return{'name':_0x4f7aa6[_0xf3d4('0x34')],'type':_0x4f7aa6['type'][_0xf3d4('0x35')]};});_0x44fd87[_0xf3d4('0x36')]=_[_0xf3d4('0x31')](_0x5d98f9,'name');_0x44fd87[_0xf3d4('0x37')]=_[_0xf3d4('0x38')](_0x26f89b[_0xf3d4('0x37')]);_0x44fd87['filters']=_[_0xf3d4('0x39')](_0x44fd87[_0xf3d4('0x36')],_0x44fd87[_0xf3d4('0x37')]);_0x428a9c[_0xf3d4('0x3a')]=_[_0xf3d4('0x39')](_0x44fd87['model'],qs[_0xf3d4('0x3b')](_0x26f89b['query']['fields']));_0x428a9c[_0xf3d4('0x3a')]=_0x428a9c['attributes'][_0xf3d4('0x3c')]?_0x428a9c[_0xf3d4('0x3a')]:_0x44fd87[_0xf3d4('0x36')];if(!_0x26f89b['query'][_0xf3d4('0x3d')](_0xf3d4('0x3e'))){_0x428a9c['limit']=qs['limit'](_0x26f89b[_0xf3d4('0x37')][_0xf3d4('0x25')]);_0x428a9c[_0xf3d4('0x24')]=qs[_0xf3d4('0x24')](_0x26f89b[_0xf3d4('0x37')][_0xf3d4('0x24')]);}_0x428a9c[_0xf3d4('0x3f')]=qs[_0xf3d4('0x40')](_0x26f89b['query']['sort']);_0x428a9c[_0xf3d4('0x41')]=qs[_0xf3d4('0x42')](_[_0xf3d4('0x43')](_0x26f89b[_0xf3d4('0x37')],_0x44fd87[_0xf3d4('0x42')]),_0x5d98f9);if(_0x26f89b[_0xf3d4('0x37')][_0xf3d4('0x44')]){_0x428a9c[_0xf3d4('0x41')]=_[_0xf3d4('0x45')](_0x428a9c[_0xf3d4('0x41')],{'$or':_[_0xf3d4('0x31')](_0x5d98f9,function(_0x4648b7){if(_0x4648b7['type']!==_0xf3d4('0x46')){var _0x336585={};_0x336585[_0x4648b7[_0xf3d4('0x2f')]]={'$like':'%'+_0x26f89b[_0xf3d4('0x37')][_0xf3d4('0x44')]+'%'};return _0x336585;}})});}_0x428a9c=_[_0xf3d4('0x45')]({},_0x428a9c,_0x26f89b[_0xf3d4('0x47')]);var _0x121194={'where':_0x428a9c['where']};return db['Plugin'][_0xf3d4('0x23')](_0x121194)[_0xf3d4('0x2b')](function(_0x2e196f){_0x2c8798[_0xf3d4('0x23')]=_0x2e196f;if(_0x26f89b['query'][_0xf3d4('0x48')]){_0x428a9c[_0xf3d4('0x49')]=[{'all':!![]}];}return db[_0xf3d4('0x32')][_0xf3d4('0x4a')](_0x428a9c);})['then'](function(_0x1dc3a7){_0x2c8798['rows']=_0x1dc3a7;return _0x2c8798;})[_0xf3d4('0x2b')](respondWithFilteredResult(_0x323121,_0x428a9c))['catch'](handleError(_0x323121,null));};exports[_0xf3d4('0x4b')]=function(_0x7908f4,_0x1b79e4){var _0x153ba8={'raw':!![],'where':{'id':_0x7908f4[_0xf3d4('0x4c')]['id']}},_0x502175={};_0x502175[_0xf3d4('0x36')]=_[_0xf3d4('0x38')](db['Plugin'][_0xf3d4('0x33')]);_0x502175[_0xf3d4('0x37')]=_[_0xf3d4('0x38')](_0x7908f4[_0xf3d4('0x37')]);_0x502175[_0xf3d4('0x42')]=_['intersection'](_0x502175['model'],_0x502175[_0xf3d4('0x37')]);_0x153ba8[_0xf3d4('0x3a')]=_['intersection'](_0x502175[_0xf3d4('0x36')],qs[_0xf3d4('0x3b')](_0x7908f4[_0xf3d4('0x37')]['fields']));_0x153ba8['attributes']=_0x153ba8[_0xf3d4('0x3a')][_0xf3d4('0x3c')]?_0x153ba8['attributes']:_0x502175[_0xf3d4('0x36')];if(_0x7908f4[_0xf3d4('0x37')]['includeAll']){_0x153ba8[_0xf3d4('0x49')]=[{'all':!![]}];}_0x153ba8=_[_0xf3d4('0x45')]({},_0x153ba8,_0x7908f4[_0xf3d4('0x47')]);return db[_0xf3d4('0x32')]['find'](_0x153ba8)[_0xf3d4('0x2b')](handleEntityNotFound(_0x1b79e4,null))[_0xf3d4('0x2b')](respondWithResult(_0x1b79e4,null))[_0xf3d4('0x4d')](handleError(_0x1b79e4,null));};exports[_0xf3d4('0x4e')]=function(_0x217c69,_0x338d59,_0x158f4a){return db[_0xf3d4('0x32')][_0xf3d4('0x4f')]({'where':{'id':_0x217c69[_0xf3d4('0x4c')]['id']},'attributes':[_0xf3d4('0x2f'),_0xf3d4('0x6')],'raw':!![]})['then'](handleEntityNotFound(_0x338d59,null))[_0xf3d4('0x2b')](function(_0x59e931){if(_0x59e931){var _0x1a5e1e=path['join'](config[_0xf3d4('0x50')],_0xf3d4('0x51'),util[_0xf3d4('0x52')](_0xf3d4('0x53'),path[_0xf3d4('0x54')](_0x59e931[_0xf3d4('0x6')])));var _0x337ad5=fs['createWriteStream'](_0x1a5e1e);var _0x46070d=archiver(_0xf3d4('0x55'),{'zlib':{'level':0x9}});_0x46070d['on'](_0xf3d4('0x56'),function(_0x168a7f){if(_0x168a7f['code']===_0xf3d4('0x57')){logger[_0xf3d4('0x2e')](_0x168a7f);}else{throw new db[(_0xf3d4('0x58'))][(_0xf3d4('0x59'))](_0xf3d4('0x5a'));}});_0x46070d['on'](_0xf3d4('0x2e'),function(_0x6ada82){throw new db[(_0xf3d4('0x58'))]['Error'](_0xf3d4('0x5a'));});_0x46070d[_0xf3d4('0x5b')](_0x337ad5);_0x46070d[_0xf3d4('0x5c')]('**/*',{'cwd':path[_0xf3d4('0x5d')](config['root'],_0xf3d4('0x51'),path[_0xf3d4('0x5e')](_0x59e931[_0xf3d4('0x6')])),'ignore':[path[_0xf3d4('0x5d')](path[_0xf3d4('0x54')](_0x59e931[_0xf3d4('0x6')]),_0xf3d4('0x5f')),path[_0xf3d4('0x5d')](path['basename'](_0x59e931[_0xf3d4('0x6')]),_0xf3d4('0x60'))],'nodir':!![]})[_0xf3d4('0x61')]();_0x337ad5['on']('close',function(){if(!fs[_0xf3d4('0x62')](_0x1a5e1e)){throw new db[(_0xf3d4('0x58'))][(_0xf3d4('0x59'))](_0xf3d4('0x63'));}return _0x338d59['download'](_0x1a5e1e,util[_0xf3d4('0x52')]('%s.zip',path['basename'](_0x59e931[_0xf3d4('0x6')])),function(_0x2fe8a7){if(_0x2fe8a7){throw new db[(_0xf3d4('0x58'))]['Error'](_0xf3d4('0x64'));}fs[_0xf3d4('0x65')](_0x1a5e1e);logger[_0xf3d4('0x66')](_0xf3d4('0x67'));logger[_0xf3d4('0x66')](_0xf3d4('0x68'));});});}return null;})[_0xf3d4('0x4d')](handleError(_0x338d59,null));};exports[_0xf3d4('0x69')]=function(_0x9b4378,_0x599543,_0x411735){var _0x565902=path['basename'](_0x9b4378[_0xf3d4('0x6a')][_0xf3d4('0x6b')],path['extname'](_0x9b4378[_0xf3d4('0x6a')][_0xf3d4('0x6b')]));var _0x378b9e=path[_0xf3d4('0x5d')](config['root'],'server/files/plugins',_0x9b4378[_0xf3d4('0x6a')][_0xf3d4('0x6b')]);var _0x1d91fd=path[_0xf3d4('0x5d')](config[_0xf3d4('0x50')],_0xf3d4('0x51'),_0x565902);logger[_0xf3d4('0x66')]('Plugin\x20upload\x20filepath:\x20%s',_0x378b9e);logger[_0xf3d4('0x66')](_0xf3d4('0x6c'),_0x1d91fd);try{fs[_0xf3d4('0x6d')](_0x378b9e,parseInt(_0xf3d4('0x6e'),0x8));extract(_0x378b9e,{'dir':_0x1d91fd},function(_0x5f35d1){if(_0x5f35d1){logger['error'](_0x5f35d1);handleError(_0x5f35d1,!![]);};var _0x387d27=fs[_0xf3d4('0x6f')](_0x1d91fd);if(_0x387d27[_0xf3d4('0x3c')]>0x1){removeReferences(_0x378b9e,_0x1d91fd);logger[_0xf3d4('0x2e')](_0xf3d4('0x70'));return _0x411735(new Error('Invalid\x20plugin\x20structure'));}var _0x236a21=fs[_0xf3d4('0x71')](path['join'](_0x1d91fd,_0x387d27[0x0]));if(_0x236a21[_0xf3d4('0x72')]()){removeReferences(_0x378b9e,_0x1d91fd);logger[_0xf3d4('0x2e')]('Invalid\x20plugin\x20structure');return _0x411735(new Error(_0xf3d4('0x70')));}if(_0x236a21[_0xf3d4('0x73')]()){var _0x227dd7=fs[_0xf3d4('0x6f')](path[_0xf3d4('0x5d')](_0x1d91fd,_0x387d27[0x0]));if(_0x227dd7[_0xf3d4('0x3c')]===0x0){removeReferences(_0x378b9e,_0x1d91fd);logger[_0xf3d4('0x2e')](_0xf3d4('0x70'));return _0x411735(new Error(_0xf3d4('0x70')));}var _0x115fe8=_0x227dd7[_0xf3d4('0x74')](function(_0x5a6d5f){return _0x5a6d5f==='manifest.json';});if(!_0x115fe8){return _0x411735(new Error('Plugin\x20manifest\x20missing'));}var _0x1a95d9=fs[_0xf3d4('0x75')](path[_0xf3d4('0x5d')](_0x1d91fd,_0x387d27[0x0],_0xf3d4('0x76')));var _0x41c1f1=JSON[_0xf3d4('0x77')](_0x1a95d9);if(_0xf3d4('0x22')==typeof _0x41c1f1[_0xf3d4('0x2f')]){return _0x411735(new Error(_0xf3d4('0x78')));}if('undefined'==typeof _0x41c1f1['type']){return _0x411735(new Error(_0xf3d4('0x79')));}if(_0xf3d4('0x22')==typeof _0x41c1f1[_0xf3d4('0x7a')]){return _0x411735(new Error(_0xf3d4('0x7b')));}if(_0xf3d4('0x22')==typeof _0x41c1f1[_0xf3d4('0x7c')]){return _0x411735(new Error(_0xf3d4('0x7d')));}if(_0x41c1f1[_0xf3d4('0x7e')]===_0xf3d4('0x7f')){if('undefined'==typeof _0x41c1f1['parameters'][_0xf3d4('0x80')]){return _0x411735(new Error(_0xf3d4('0x81')));}if(_0xf3d4('0x22')==typeof _0x41c1f1['parameters'][_0xf3d4('0x80')][_0xf3d4('0x82')]&&_0xf3d4('0x22')==typeof _0x41c1f1[_0xf3d4('0x7c')][_0xf3d4('0x80')][_0xf3d4('0x83')]){return _0x411735(new Error(_0xf3d4('0x84')));}}else if(_0x41c1f1[_0xf3d4('0x7e')]===_0xf3d4('0x85')){if(_0xf3d4('0x22')==typeof _0x41c1f1[_0xf3d4('0x7c')]['scriptName']){return _0x411735(new Error(_0xf3d4('0x86')));}if(_0xf3d4('0x22')==typeof _0x41c1f1[_0xf3d4('0x7c')][_0xf3d4('0x87')]){return _0x411735(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x411735(new Error(_0xf3d4('0x88')));}var _0x22b7ea=_0x41c1f1[_0xf3d4('0x2f')];var _0x47d8ac=_0x41c1f1['description'];var _0x16e1aa=_0x41c1f1['type'];var _0x2ff1c7=_0x41c1f1[_0xf3d4('0x89')]?_0x41c1f1[_0xf3d4('0x89')]:_0xf3d4('0x8a');var _0x49fe18=_0x41c1f1['icon']?_0x41c1f1['icon']:_0xf3d4('0x8b');var _0x8d6993='';var _0x162e67='';var _0x464f29='';var _0x132b51='';var _0xfda4e5=_0x41c1f1['version'];if(_0x16e1aa===_0xf3d4('0x7f')){if(_0xf3d4('0x22')!=typeof _0x41c1f1[_0xf3d4('0x7c')][_0xf3d4('0x80')]['admin']){var _0x5b454f=_0x41c1f1[_0xf3d4('0x7c')][_0xf3d4('0x80')][_0xf3d4('0x82')];if(!/^(f|ht)tps?:\/\//i[_0xf3d4('0x8c')](_0x5b454f)){_0x8d6993=path[_0xf3d4('0x5d')](_0xf3d4('0x8d'),_0x565902,_0x387d27[0x0],_0x5b454f);}else{_0x8d6993=_0x5b454f;}}else{logger[_0xf3d4('0x66')](_0xf3d4('0x8e'));}if(_0xf3d4('0x22')!=typeof _0x41c1f1['parameters'][_0xf3d4('0x80')][_0xf3d4('0x83')]){var _0x18fec5=_0x41c1f1[_0xf3d4('0x7c')][_0xf3d4('0x80')][_0xf3d4('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x18fec5)){_0x162e67=path[_0xf3d4('0x5d')]('plugins',_0x565902,_0x387d27[0x0],_0x18fec5);}else{_0x162e67=_0x18fec5;}}else{logger['info'](_0xf3d4('0x8f'));}}else if(_0x16e1aa==='script'){_0x464f29=_0x41c1f1[_0xf3d4('0x7c')][_0xf3d4('0x90')];_0x132b51=_0x41c1f1['parameters'][_0xf3d4('0x87')];if(_0xf3d4('0x22')!=typeof _0x41c1f1[_0xf3d4('0x7c')][_0xf3d4('0x80')]){if(_0xf3d4('0x22')!=typeof _0x41c1f1['parameters'][_0xf3d4('0x80')][_0xf3d4('0x82')]){var _0x5b454f=_0x41c1f1[_0xf3d4('0x7c')][_0xf3d4('0x80')][_0xf3d4('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5b454f)){_0x8d6993=path[_0xf3d4('0x5d')](_0xf3d4('0x8d'),_0x565902,_0x387d27[0x0],_0x5b454f);}else{_0x8d6993=_0x5b454f;}}if(_0xf3d4('0x22')!=typeof _0x41c1f1[_0xf3d4('0x7c')][_0xf3d4('0x80')][_0xf3d4('0x83')]){var _0x18fec5=_0x41c1f1[_0xf3d4('0x7c')][_0xf3d4('0x80')][_0xf3d4('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xf3d4('0x8c')](_0x18fec5)){_0x162e67=path[_0xf3d4('0x5d')](_0xf3d4('0x8d'),_0x565902,_0x387d27[0x0],_0x18fec5);}else{_0x162e67=_0x18fec5;}}}}var _0x39a2d4={'name':_0x22b7ea,'description':_0x47d8ac,'path':path['join'](_0x565902,_0x387d27[0x0]),'type':_0x16e1aa,'sidebar':_0x2ff1c7,'icon':_0x49fe18,'adminUrl':_0x8d6993,'agentUrl':_0x162e67,'scriptName':_0x464f29,'scriptPath':_0x132b51,'version':_0xfda4e5};removeReferences(_0x378b9e,null);return db[_0xf3d4('0x32')]['create'](_0x39a2d4)[_0xf3d4('0x2b')](function(_0x36c04f){var _0x5f38d3={'role':_0x9b4378[_0xf3d4('0x91')][_0xf3d4('0x92')],'userProfileId':_0x9b4378[_0xf3d4('0x91')]['userProfileId']};if(!_0x5f38d3)throw new Error(_0xf3d4('0x93'));if(_0x5f38d3['role']===_0xf3d4('0x94')){var _0x44df33=_0x36c04f[_0xf3d4('0x2c')]({'plain':!![]});return db['UserProfileSection'][_0xf3d4('0x4f')]({'where':{'name':_0xf3d4('0x95'),'userProfileId':_0x5f38d3[_0xf3d4('0x96')]},'raw':!![]})[_0xf3d4('0x2b')](function(_0x293a4b){if(_0x293a4b&&_0x293a4b[_0xf3d4('0x97')]===0x0){return db[_0xf3d4('0x2d')][_0xf3d4('0x98')]({'name':_0x44df33[_0xf3d4('0x2f')],'resourceId':_0x44df33['id'],'type':_0x293a4b['name'],'sectionId':_0x293a4b['id']},{})[_0xf3d4('0x2b')](function(){return _0x36c04f;});}else{return _0x36c04f;}})['catch'](function(_0x6d37db){logger[_0xf3d4('0x2e')](_0xf3d4('0x99'),_0x6d37db);throw _0x6d37db;});}return _0x36c04f;})['then'](respondWithResult(_0x599543,null))['catch'](handleError(_0x599543,null));}});}catch(_0x5c19f0){_0x599543[_0xf3d4('0x1f')](0x1f4)[_0xf3d4('0x9a')](_0x5c19f0);}};function removeReferences(_0x5e431b,_0xc07ba1){try{if(_0x5e431b){fs['unlinkSync'](_0x5e431b);logger[_0xf3d4('0x66')](_0xf3d4('0x9b'));}if(_0xc07ba1){rimraf(_0xc07ba1,function(){});logger[_0xf3d4('0x66')](_0xf3d4('0x9c'));}}catch(_0x2ddd0f){logger[_0xf3d4('0x2e')](_0x2ddd0f);}}exports['update']=function(_0x1ef079,_0x2a970c,_0x220a3f){return db[_0xf3d4('0x32')][_0xf3d4('0x4f')]({'where':{'id':_0x1ef079[_0xf3d4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2a970c,null))[_0xf3d4('0x2b')](saveUpdates(_0x1ef079[_0xf3d4('0x91')],null))[_0xf3d4('0x2b')](respondWithResult(_0x2a970c,null))[_0xf3d4('0x4d')](handleError(_0x2a970c,null));};exports[_0xf3d4('0x9d')]=function(_0x1f96ef,_0x1074ab,_0x243084){return db[_0xf3d4('0x32')]['find']({'where':{'id':_0x1f96ef['params']['id']}})[_0xf3d4('0x2b')](function(_0x5939fc){if(_0x5939fc){return _0x5939fc[_0xf3d4('0x2a')]();}})[_0xf3d4('0x2b')](function(_0x48ec79){rimraf(path[_0xf3d4('0x5d')](config[_0xf3d4('0x50')],'server/files/plugins',path[_0xf3d4('0x5e')](_0x48ec79[_0xf3d4('0x6')])),function(){});return _0x48ec79;})[_0xf3d4('0x2b')](handleEntityNotFound(_0x1074ab,null))[_0xf3d4('0x2b')](respondWithStatusCode(_0x1074ab,null))[_0xf3d4('0x4d')](handleError(_0x1074ab,null));};exports['webhookGet']=function(_0x4c133f,_0x33cb5f,_0xdc6fe5){return BPromise[_0xf3d4('0x9e')]()[_0xf3d4('0x2b')](function(){if(!_0x4c133f[_0xf3d4('0x37')][_0xf3d4('0x6')]){throw new Error(_0xf3d4('0x9f'));}if(!_0x4c133f[_0xf3d4('0x37')][_0xf3d4('0xa0')]){throw new Error(_0xf3d4('0xa1'));}var _0x42a42c=_0x4c133f[_0xf3d4('0x37')][_0xf3d4('0xa2')]?_0x4c133f[_0xf3d4('0x37')][_0xf3d4('0xa2')]+':'+_0x4c133f[_0xf3d4('0x37')][_0xf3d4('0xa0')]:_0xf3d4('0xa3')+_0x4c133f[_0xf3d4('0x37')][_0xf3d4('0xa0')];var _0x17a39=_0x4c133f[_0xf3d4('0x37')][_0xf3d4('0x21')]?_0x4c133f[_0xf3d4('0x37')][_0xf3d4('0x21')]:!![];var _0x2b229c=_0x4c133f['query']['encoding']?_0x4c133f[_0xf3d4('0x37')][_0xf3d4('0xa4')]:null;var _0x2fb206={'method':_0x4c133f[_0xf3d4('0xa5')],'uri':util[_0xf3d4('0x52')](_0xf3d4('0xa6'),_0x42a42c,_0x4c133f[_0xf3d4('0x37')][_0xf3d4('0x6')]),'json':_0x17a39,'resolveWithFullResponse':!![],'encoding':_0x2b229c,'qs':_0x4c133f[_0xf3d4('0x37')]};if(_0x4c133f[_0xf3d4('0xa7')]){_0x2fb206[_0xf3d4('0xa7')]=_0x4c133f[_0xf3d4('0xa7')];if(_0x2fb206[_0xf3d4('0xa7')]['content-length']){delete _0x2fb206[_0xf3d4('0xa7')]['content-length'];}}if(_0x2fb206[_0xf3d4('0xa7')]['content-type']){delete _0x2fb206[_0xf3d4('0xa7')][_0xf3d4('0xa8')];}return rp(_0x2fb206);})[_0xf3d4('0x2b')](function(_0x8a3dd4){if(_0x8a3dd4){_0x33cb5f[_0xf3d4('0x26')](_0x8a3dd4['headers']);logger[_0xf3d4('0x66')](_0x8a3dd4['body']);if(_[_0xf3d4('0xa9')](_0x4c133f['query'][_0xf3d4('0x6')],_0xf3d4('0x4e'))&&_0x8a3dd4['statusCode']==0x1f4){return _0x33cb5f[_0xf3d4('0x1e')](_0x8a3dd4[_0xf3d4('0xaa')]);}else{return _0x33cb5f[_0xf3d4('0x1f')](_0x8a3dd4['statusCode'])[_0xf3d4('0x9a')](_0x8a3dd4[_0xf3d4('0x91')]);}}else{return _0x33cb5f[_0xf3d4('0x1e')](0xc8);}})[_0xf3d4('0x4d')](handleError(_0x33cb5f,null));};exports['webhookPost']=function(_0x2290a9,_0x406289,_0x5752e6){return BPromise['resolve']()[_0xf3d4('0x2b')](function(){if(!_0x2290a9[_0xf3d4('0x37')][_0xf3d4('0x6')]){throw new Error(_0xf3d4('0x9f'));}if(!_0x2290a9['query'][_0xf3d4('0xa0')]){throw new Error(_0xf3d4('0xa1'));}var _0x2b7a10=_0x2290a9[_0xf3d4('0x37')]['hostname']?_0x2290a9[_0xf3d4('0x37')]['hostname']+':'+_0x2290a9['query'][_0xf3d4('0xa0')]:_0xf3d4('0xa3')+_0x2290a9['query'][_0xf3d4('0xa0')];var _0x4f582e=_0x2290a9['query']['json']?_0x2290a9[_0xf3d4('0x37')][_0xf3d4('0x21')]:!![];var _0x3aee03=_0x2290a9['query'][_0xf3d4('0xa4')]?_0x2290a9['query'][_0xf3d4('0xa4')]:null;var _0x39efc7={'method':_0x2290a9['method'],'uri':util[_0xf3d4('0x52')](_0xf3d4('0xa6'),_0x2b7a10,_0x2290a9[_0xf3d4('0x37')][_0xf3d4('0x6')]),'json':_0x4f582e,'resolveWithFullResponse':!![],'encoding':_0x3aee03,'body':_0x2290a9[_0xf3d4('0x91')]};if(_0x2290a9[_0xf3d4('0xa7')]){_0x39efc7[_0xf3d4('0xa7')]=_0x2290a9[_0xf3d4('0xa7')];if(_0x39efc7['headers'][_0xf3d4('0xab')]){delete _0x39efc7[_0xf3d4('0xa7')][_0xf3d4('0xab')];}}if(_0x39efc7[_0xf3d4('0xa7')]['content-type']){delete _0x39efc7['headers']['content-type'];}return rp(_0x39efc7);})[_0xf3d4('0x2b')](function(_0x285c52){if(_0x285c52){_0x406289['set'](_0x285c52[_0xf3d4('0xa7')]);logger[_0xf3d4('0x66')](_0x285c52[_0xf3d4('0x91')]);return _0x406289[_0xf3d4('0x1f')](_0x285c52['statusCode'])[_0xf3d4('0x9a')](_0x285c52[_0xf3d4('0x91')]);}else{return _0x406289['sendStatus'](0xc8);}})[_0xf3d4('0x4d')](handleError(_0x406289,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 6cea5de..3955ab4 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 _0x1224=['../../mysqldb','Plugin','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x5e22cd,_0x5dfb96){var _0x4a49bc=function(_0x4ec0c2){while(--_0x4ec0c2){_0x5e22cd['push'](_0x5e22cd['shift']());}};_0x4a49bc(++_0x5dfb96);}(_0x1224,0x10d));var _0x4122=function(_0x42334c,_0x379771){_0x42334c=_0x42334c-0x0;var _0x4feed7=_0x1224[_0x42334c];return _0x4feed7;};'use strict';var EventEmitter=require(_0x4122('0x0'));var Plugin=require(_0x4122('0x1'))['db'][_0x4122('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x4122('0x3')](0x0);var events={'afterCreate':_0x4122('0x4'),'afterUpdate':_0x4122('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1b3b05){return function(_0x1f1533,_0x2f506b,_0x4d5e5b){PluginEvents[_0x4122('0x6')](_0x1b3b05+':'+_0x1f1533['id'],_0x1f1533);PluginEvents[_0x4122('0x6')](_0x1b3b05,_0x1f1533);_0x4d5e5b(null);};}for(var e in events){if(events[_0x4122('0x7')](e)){var event=events[e];Plugin[_0x4122('0x8')](e,emitEvent(event));}}module[_0x4122('0x9')]=PluginEvents; \ No newline at end of file +var _0x4975=['Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x44d869,_0x49425f){var _0x1ed521=function(_0x2c2968){while(--_0x2c2968){_0x44d869['push'](_0x44d869['shift']());}};_0x1ed521(++_0x49425f);}(_0x4975,0x86));var _0x5497=function(_0x5bdf24,_0x26a5cc){_0x5bdf24=_0x5bdf24-0x0;var _0x31252b=_0x4975[_0x5bdf24];return _0x31252b;};'use strict';var EventEmitter=require(_0x5497('0x0'));var Plugin=require('../../mysqldb')['db'][_0x5497('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x5497('0x2')](0x0);var events={'afterCreate':_0x5497('0x3'),'afterUpdate':_0x5497('0x4'),'afterDestroy':_0x5497('0x5')};function emitEvent(_0x235986){return function(_0x14cecb,_0xeb31af,_0xbb1888){PluginEvents[_0x5497('0x6')](_0x235986+':'+_0x14cecb['id'],_0x14cecb);PluginEvents['emit'](_0x235986,_0x14cecb);_0xbb1888(null);};}for(var e in events){if(events[_0x5497('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x5497('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index fc26e18..978eec4 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 _0xaac4=['./plugin.attributes','exports','define','plugins','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x29f421,_0x558b5c){var _0x5ed12b=function(_0x2b442a){while(--_0x2b442a){_0x29f421['push'](_0x29f421['shift']());}};_0x5ed12b(++_0x558b5c);}(_0xaac4,0x72));var _0x4aac=function(_0x99250c,_0x4603c0){_0x99250c=_0x99250c-0x0;var _0x3927d5=_0xaac4[_0x99250c];return _0x3927d5;};'use strict';var _=require(_0x4aac('0x0'));var util=require(_0x4aac('0x1'));var logger=require(_0x4aac('0x2'))('api');var moment=require(_0x4aac('0x3'));var BPromise=require(_0x4aac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4aac('0x5'));var rimraf=require(_0x4aac('0x6'));var config=require('../../config/environment');var attributes=require(_0x4aac('0x7'));module[_0x4aac('0x8')]=function(_0x2f043b,_0x353498){return _0x2f043b[_0x4aac('0x9')]('Plugin',attributes,{'tableName':_0x4aac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b8f=['util','../../config/logger','api','bluebird','request-promise','rimraf','./plugin.attributes','exports','define','Plugin','plugins','lodash'];(function(_0x5cc045,_0x49a9bc){var _0x1875bc=function(_0x4002de){while(--_0x4002de){_0x5cc045['push'](_0x5cc045['shift']());}};_0x1875bc(++_0x49a9bc);}(_0x9b8f,0x83));var _0xf9b8=function(_0x2a6c0d,_0x596838){_0x2a6c0d=_0x2a6c0d-0x0;var _0x4c9f43=_0x9b8f[_0x2a6c0d];return _0x4c9f43;};'use strict';var _=require(_0xf9b8('0x0'));var util=require(_0xf9b8('0x1'));var logger=require(_0xf9b8('0x2'))(_0xf9b8('0x3'));var moment=require('moment');var BPromise=require(_0xf9b8('0x4'));var rp=require(_0xf9b8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf9b8('0x6'));var config=require('../../config/environment');var attributes=require(_0xf9b8('0x7'));module[_0xf9b8('0x8')]=function(_0x4621fb,_0x1cafe9){return _0x4621fb[_0xf9b8('0x9')](_0xf9b8('0xa'),attributes,{'tableName':_0xf9b8('0xb'),'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 b285660..dd225c9 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 _0x4a33=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','Plugin,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','then','info','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x95e21d,_0x36861e){var _0x3fd266=function(_0x4857bb){while(--_0x4857bb){_0x95e21d['push'](_0x95e21d['shift']());}};_0x3fd266(++_0x36861e);}(_0x4a33,0x8a));var _0x34a3=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x4a33[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x34a3('0x0'));var util=require(_0x34a3('0x1'));var moment=require(_0x34a3('0x2'));var BPromise=require(_0x34a3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34a3('0x4'))['db'];var utils=require(_0x34a3('0x5'));var logger=require(_0x34a3('0x6'))(_0x34a3('0x7'));var config=require(_0x34a3('0x8'));var jayson=require(_0x34a3('0x9'));var client=jayson[_0x34a3('0xa')][_0x34a3('0xb')]({'port':0x232a});config[_0x34a3('0xc')]=_[_0x34a3('0xd')](config[_0x34a3('0xc')],{'host':_0x34a3('0xe'),'port':0x18eb});var socket=require(_0x34a3('0xf'))(new Redis(config[_0x34a3('0xc')]));require(_0x34a3('0x10'))[_0x34a3('0x11')](socket);function respondWithRpcPromise(_0x2a2594,_0x5c495b,_0xd2f6a8){return new BPromise(function(_0x2a4023,_0x570a2b){return client[_0x34a3('0x12')](_0x2a2594,_0xd2f6a8)['then'](function(_0x2d1fff){logger['info'](_0x34a3('0x13'),_0x5c495b,'request\x20sent');logger[_0x34a3('0x14')]('Plugin,\x20%s,\x20%s,\x20%s',_0x5c495b,_0x34a3('0x15'),JSON[_0x34a3('0x16')](_0x2d1fff));if(_0x2d1fff[_0x34a3('0x17')]){if(_0x2d1fff[_0x34a3('0x17')][_0x34a3('0x18')]===0x1f4){logger[_0x34a3('0x17')]('Plugin,\x20%s,\x20%s',_0x5c495b,_0x2d1fff[_0x34a3('0x17')][_0x34a3('0x19')]);return _0x570a2b(_0x2d1fff['error'][_0x34a3('0x19')]);}logger[_0x34a3('0x17')]('Plugin,\x20%s,\x20%s',_0x5c495b,_0x2d1fff[_0x34a3('0x17')]['message']);return _0x2a4023(_0x2d1fff[_0x34a3('0x17')]['message']);}else{logger['info'](_0x34a3('0x13'),_0x5c495b,'request\x20sent');_0x2a4023(_0x2d1fff[_0x34a3('0x1a')][_0x34a3('0x19')]);}})[_0x34a3('0x1b')](function(_0x40a18c){logger[_0x34a3('0x17')](_0x34a3('0x13'),_0x5c495b,_0x40a18c);_0x570a2b(_0x40a18c);});});}exports[_0x34a3('0x1c')]=function(_0x5da0e1){var _0x4d17dc=this;return new Promise(function(_0x37e20b,_0x3dd9bb){return db[_0x34a3('0x1d')][_0x34a3('0x1e')](_0x5da0e1[_0x34a3('0x1f')],{'raw':_0x5da0e1[_0x34a3('0x20')]?_0x5da0e1[_0x34a3('0x20')][_0x34a3('0x21')]===undefined?!![]:![]:!![]})[_0x34a3('0x22')](function(_0x495bb9){logger[_0x34a3('0x23')](_0x34a3('0x1c'),_0x5da0e1);logger[_0x34a3('0x14')](_0x34a3('0x1c'),_0x5da0e1,JSON[_0x34a3('0x16')](_0x495bb9));_0x37e20b(_0x495bb9);})[_0x34a3('0x1b')](function(_0x366c2e){logger['error'](_0x34a3('0x1c'),_0x366c2e[_0x34a3('0x19')],_0x5da0e1);_0x3dd9bb(_0x4d17dc[_0x34a3('0x17')](0x1f4,_0x366c2e['message']));});});}; \ No newline at end of file +var _0x011f=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','then','info','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','create','options','raw','debug'];(function(_0x121c3a,_0x3aed12){var _0x515ffc=function(_0x3ac662){while(--_0x3ac662){_0x121c3a['push'](_0x121c3a['shift']());}};_0x515ffc(++_0x3aed12);}(_0x011f,0x91));var _0xf011=function(_0xee3051,_0xbe4f18){_0xee3051=_0xee3051-0x0;var _0x139e81=_0x011f[_0xee3051];return _0x139e81;};'use strict';var _=require(_0xf011('0x0'));var util=require(_0xf011('0x1'));var moment=require('moment');var BPromise=require(_0xf011('0x2'));var rs=require(_0xf011('0x3'));var fs=require('fs');var Redis=require(_0xf011('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf011('0x5'));var logger=require(_0xf011('0x6'))(_0xf011('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf011('0x8')][_0xf011('0x9')]({'port':0x232a});config[_0xf011('0xa')]=_['defaults'](config[_0xf011('0xa')],{'host':_0xf011('0xb'),'port':0x18eb});var socket=require(_0xf011('0xc'))(new Redis(config[_0xf011('0xa')]));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x5dcd92,_0x25417f,_0x421248){return new BPromise(function(_0x4945c1,_0x16aad3){return client['request'](_0x5dcd92,_0x421248)[_0xf011('0xd')](function(_0x332c4b){logger[_0xf011('0xe')]('Plugin,\x20%s,\x20%s',_0x25417f,'request\x20sent');logger['debug'](_0xf011('0xf'),_0x25417f,_0xf011('0x10'),JSON[_0xf011('0x11')](_0x332c4b));if(_0x332c4b[_0xf011('0x12')]){if(_0x332c4b[_0xf011('0x12')][_0xf011('0x13')]===0x1f4){logger['error'](_0xf011('0x14'),_0x25417f,_0x332c4b[_0xf011('0x12')][_0xf011('0x15')]);return _0x16aad3(_0x332c4b[_0xf011('0x12')]['message']);}logger[_0xf011('0x12')]('Plugin,\x20%s,\x20%s',_0x25417f,_0x332c4b['error']['message']);return _0x4945c1(_0x332c4b[_0xf011('0x12')][_0xf011('0x15')]);}else{logger['info'](_0xf011('0x14'),_0x25417f,'request\x20sent');_0x4945c1(_0x332c4b[_0xf011('0x16')][_0xf011('0x15')]);}})[_0xf011('0x17')](function(_0x3cc4d0){logger[_0xf011('0x12')]('Plugin,\x20%s,\x20%s',_0x25417f,_0x3cc4d0);_0x16aad3(_0x3cc4d0);});});}exports[_0xf011('0x18')]=function(_0xf0bc44){var _0x2855cc=this;return new Promise(function(_0xf9ab7,_0x149c93){return db['Plugin'][_0xf011('0x19')](_0xf0bc44['body'],{'raw':_0xf0bc44[_0xf011('0x1a')]?_0xf0bc44[_0xf011('0x1a')][_0xf011('0x1b')]===undefined?!![]:![]:!![]})[_0xf011('0xd')](function(_0x4700dd){logger['info']('CreatePlugin',_0xf0bc44);logger[_0xf011('0x1c')](_0xf011('0x18'),_0xf0bc44,JSON[_0xf011('0x11')](_0x4700dd));_0xf9ab7(_0x4700dd);})[_0xf011('0x17')](function(_0x3a6791){logger[_0xf011('0x12')](_0xf011('0x18'),_0x3a6791[_0xf011('0x15')],_0xf0bc44);_0x149c93(_0x2855cc['error'](0x1f4,_0x3a6791[_0xf011('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 29bcaf6..cd001df 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 _0x06ff=['./plugin.events','remove','update','emit','removeListener','length','plugin:'];(function(_0x2f3521,_0x2eb040){var _0x3910e2=function(_0x349b99){while(--_0x349b99){_0x2f3521['push'](_0x2f3521['shift']());}};_0x3910e2(++_0x2eb040);}(_0x06ff,0xd9));var _0xf06f=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x06ff[_0x46698a];return _0x356db0;};'use strict';var PluginEvents=require(_0xf06f('0x0'));var events=['save',_0xf06f('0x1'),_0xf06f('0x2')];function createListener(_0x1df70a,_0x4dfb7f){return function(_0x1440c8){_0x4dfb7f[_0xf06f('0x3')](_0x1df70a,_0x1440c8);};}function removeListener(_0x447d90,_0x356bb4){return function(){PluginEvents[_0xf06f('0x4')](_0x447d90,_0x356bb4);};}exports['register']=function(_0x16a0b5){for(var _0xa021e=0x0,_0x2addaa=events[_0xf06f('0x5')];_0xa021e<_0x2addaa;_0xa021e++){var _0x3c7866=events[_0xa021e];var _0x43c91=createListener(_0xf06f('0x6')+_0x3c7866,_0x16a0b5);PluginEvents['on'](_0x3c7866,_0x43c91);}}; \ No newline at end of file +var _0x4b72=['length','plugin:','./plugin.events','save','update','emit','removeListener','register'];(function(_0x2f3ae0,_0xef2804){var _0x44bc56=function(_0x5accef){while(--_0x5accef){_0x2f3ae0['push'](_0x2f3ae0['shift']());}};_0x44bc56(++_0xef2804);}(_0x4b72,0x17a));var _0x24b7=function(_0x161670,_0x1eb5a9){_0x161670=_0x161670-0x0;var _0x172d66=_0x4b72[_0x161670];return _0x172d66;};'use strict';var PluginEvents=require(_0x24b7('0x0'));var events=[_0x24b7('0x1'),'remove',_0x24b7('0x2')];function createListener(_0xd73009,_0x59a7ce){return function(_0x439ca2){_0x59a7ce[_0x24b7('0x3')](_0xd73009,_0x439ca2);};}function removeListener(_0x33a503,_0x35eadf){return function(){PluginEvents[_0x24b7('0x4')](_0x33a503,_0x35eadf);};}exports[_0x24b7('0x5')]=function(_0x5d0877){for(var _0x5b7c02=0x0,_0x2a3468=events[_0x24b7('0x6')];_0x5b7c02<_0x2a3468;_0x5b7c02++){var _0x50f5e2=events[_0x5b7c02];var _0x5dfda2=createListener(_0x24b7('0x7')+_0x50f5e2,_0x5d0877);PluginEvents['on'](_0x50f5e2,_0x5dfda2);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index c49a140..68fdbb5 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(_0xa45f7b,_0x5448c2){var _0x3df5d1=function(_0x5a7565){while(--_0x5a7565){_0xa45f7b['push'](_0xa45f7b['shift']());}};_0x3df5d1(++_0x5448c2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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(_0x5460d2,_0x18a499){var _0x1a7f4c=function(_0x3f0b8c){while(--_0x3f0b8c){_0x5460d2['push'](_0x5460d2['shift']());}};_0x1a7f4c(++_0x18a499);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 04aa33c..504f72b 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 _0x750a=['restart','stop','Unknown\x20status','delete','Unknown\x20id','../../config/pm2','path','child_process','exec','bluebird','sendStatus','status','json','stack','name','send','npm\x20install','info','error','index','list','then','reject','express','length','describe','params','body','../../files/plugins','chdir','start','dump','catch','Missing\x20name\x20and/or\x20path','update'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x750a,0x140));var _0xa750=function(_0x5cd44c,_0x32f0e7){_0x5cd44c=_0x5cd44c-0x0;var _0x4a8197=_0x750a[_0x5cd44c];return _0x4a8197;};'use strict';var _=require('lodash');var pm2=require(_0xa750('0x0'));var logger=require('../../config/logger')('api');var path=require(_0xa750('0x1'));var exec=require(_0xa750('0x2'))[_0xa750('0x3')];var BPromise=require(_0xa750('0x4'));function handleEntityNotFound(_0x457cae,_0x43d704){return function(_0x562911){if(!_0x562911){_0x457cae[_0xa750('0x5')](0x194);;}return _0x562911;};}function respondWithResult(_0x10b4d9,_0x2497df){_0x2497df=_0x2497df||0xc8;return function(_0x197299){if(_0x197299){return _0x10b4d9[_0xa750('0x6')](_0x2497df)[_0xa750('0x7')](_0x197299);}return null;};}function handleError(_0x47a4dd,_0x53f2cb){_0x53f2cb=_0x53f2cb||0x1f4;return function(_0x2678ff){logger['error'](_0x2678ff[_0xa750('0x8')]);if(_0x2678ff[_0xa750('0x9')]){delete _0x2678ff['name'];}_0x47a4dd[_0xa750('0x6')](_0x53f2cb)[_0xa750('0xa')](_0x2678ff);};}function execChildProcess(){return new BPromise(function(_0x5870f0,_0x5aca9c){exec(_0xa750('0xb'),function(_0x4b19a1,_0x174fd0,_0x5adaae){logger['info'](_0x174fd0);logger[_0xa750('0xc')](_0x5adaae);if(_0x4b19a1){logger[_0xa750('0xd')](_0x4b19a1);return _0x5aca9c(_0x4b19a1);}return _0x5870f0(_0x174fd0);});});}exports[_0xa750('0xe')]=function(_0x567c51,_0x2f670f){return pm2[_0xa750('0xf')]()[_0xa750('0x10')](function(_0x24e48a){if(_0x24e48a){var _0xa66181=_[_0xa750('0x11')](_0x24e48a,function(_0x5806ed){return _0x5806ed[_0xa750('0x9')]===_0xa750('0x12')||_0x5806ed[_0xa750('0x9')]==='motion2';});return{'rows':_0xa66181,'count':_0xa66181[_0xa750('0x13')]};}return null;})[_0xa750('0x10')](respondWithResult(_0x2f670f,null))['catch'](handleError(_0x2f670f,null));};exports['show']=function(_0x321eb2,_0x5b1e6b){return pm2[_0xa750('0x14')](_0x321eb2[_0xa750('0x15')]['id'])['then'](respondWithResult(_0x5b1e6b,null))[_0xa750('0x10')](handleEntityNotFound(_0x5b1e6b,null))['catch'](handleError(_0x5b1e6b,null));};exports['create']=function(_0x25e335,_0x5d0935){if(_0x25e335[_0xa750('0x16')]['name']&&_0x25e335[_0xa750('0x16')]['script']){var _0x3dc7f1=path['join'](__dirname,_0xa750('0x17'),_0x25e335['body']['script']);var _0xaa9d3e=process['cwd']();process[_0xa750('0x18')](path['dirname'](_0x3dc7f1));return execChildProcess()['then'](function(_0x5b433d){process['chdir'](_0xaa9d3e);return pm2[_0xa750('0x19')]({'name':_0x25e335[_0xa750('0x16')][_0xa750('0x9')],'script':_0x3dc7f1});})[_0xa750('0x10')](function(_0x1b80a5){pm2[_0xa750('0x1a')]();return _0x1b80a5[0x0];})[_0xa750('0x10')](respondWithResult(_0x5d0935,0xc9))[_0xa750('0x1b')](handleError(_0x5d0935,null));}else{return _0x5d0935[_0xa750('0x6')](0x1f4)[_0xa750('0xa')]({'message':_0xa750('0x1c')});}};exports[_0xa750('0x1d')]=function(_0x31ea63,_0x3f7d6d){if(_0x31ea63[_0xa750('0x16')]['id']){delete _0x31ea63['body']['id'];}var _0x3d3923={'online':_0xa750('0x1e'),'stopped':_0xa750('0x1f')};if(_0x3d3923['hasOwnProperty'](_0x31ea63[_0xa750('0x16')][_0xa750('0x6')])){return pm2[_0x3d3923[_0x31ea63[_0xa750('0x16')][_0xa750('0x6')]]](_0x31ea63['params']['id'])[_0xa750('0x10')](respondWithResult(_0x3f7d6d,0xc8))[_0xa750('0x1b')](handleError(_0x3f7d6d,null));}else{return _0x3f7d6d[_0xa750('0x6')](0x1f4)[_0xa750('0xa')]({'message':_0xa750('0x20')});}};exports['destroy']=function(_0x46cc11,_0x4c2c9e){if(_0x46cc11[_0xa750('0x16')]['id']){delete _0x46cc11[_0xa750('0x16')]['id'];}if(_0x46cc11['params']['id']){return pm2[_0xa750('0x21')](_0x46cc11[_0xa750('0x15')]['id'])[_0xa750('0x10')](function(_0x314f88){pm2[_0xa750('0x1a')]();return _0x314f88[0x0];})[_0xa750('0x10')](respondWithResult(_0x4c2c9e,null))[_0xa750('0x1b')](handleError(_0x4c2c9e,null));}else{return _0x4c2c9e[_0xa750('0x6')](0x1f4)['send']({'message':_0xa750('0x22')});}}; \ No newline at end of file +var _0x54ef=['bluebird','status','error','name','send','npm\x20install','info','index','list','reject','express','motion2','catch','show','describe','params','then','create','script','join','../../files/plugins','body','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','path','child_process','exec'];(function(_0x4b7e4d,_0x82d2ab){var _0x38d6af=function(_0x227432){while(--_0x227432){_0x4b7e4d['push'](_0x4b7e4d['shift']());}};_0x38d6af(++_0x82d2ab);}(_0x54ef,0x112));var _0xf54e=function(_0x37d4b1,_0x13f768){_0x37d4b1=_0x37d4b1-0x0;var _0x51bc77=_0x54ef[_0x37d4b1];return _0x51bc77;};'use strict';var _=require(_0xf54e('0x0'));var pm2=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var path=require(_0xf54e('0x3'));var exec=require(_0xf54e('0x4'))[_0xf54e('0x5')];var BPromise=require(_0xf54e('0x6'));function handleEntityNotFound(_0x8b6bb6,_0x431e36){return function(_0x12d43f){if(!_0x12d43f){_0x8b6bb6['sendStatus'](0x194);;}return _0x12d43f;};}function respondWithResult(_0x55e611,_0x18e84e){_0x18e84e=_0x18e84e||0xc8;return function(_0x99cf9){if(_0x99cf9){return _0x55e611[_0xf54e('0x7')](_0x18e84e)['json'](_0x99cf9);}return null;};}function handleError(_0x27e69b,_0x57a1ce){_0x57a1ce=_0x57a1ce||0x1f4;return function(_0x40a75d){logger[_0xf54e('0x8')](_0x40a75d['stack']);if(_0x40a75d[_0xf54e('0x9')]){delete _0x40a75d[_0xf54e('0x9')];}_0x27e69b[_0xf54e('0x7')](_0x57a1ce)[_0xf54e('0xa')](_0x40a75d);};}function execChildProcess(){return new BPromise(function(_0x5f232a,_0x558502){exec(_0xf54e('0xb'),function(_0x143d66,_0x326eef,_0x553759){logger[_0xf54e('0xc')](_0x326eef);logger['info'](_0x553759);if(_0x143d66){logger['error'](_0x143d66);return _0x558502(_0x143d66);}return _0x5f232a(_0x326eef);});});}exports[_0xf54e('0xd')]=function(_0x2033e9,_0x28f776){return pm2[_0xf54e('0xe')]()['then'](function(_0x331732){if(_0x331732){var _0x1bbeaa=_[_0xf54e('0xf')](_0x331732,function(_0x15f639){return _0x15f639['name']===_0xf54e('0x10')||_0x15f639[_0xf54e('0x9')]===_0xf54e('0x11');});return{'rows':_0x1bbeaa,'count':_0x1bbeaa['length']};}return null;})['then'](respondWithResult(_0x28f776,null))[_0xf54e('0x12')](handleError(_0x28f776,null));};exports[_0xf54e('0x13')]=function(_0x1c02e7,_0x9647f){return pm2[_0xf54e('0x14')](_0x1c02e7[_0xf54e('0x15')]['id'])[_0xf54e('0x16')](respondWithResult(_0x9647f,null))[_0xf54e('0x16')](handleEntityNotFound(_0x9647f,null))[_0xf54e('0x12')](handleError(_0x9647f,null));};exports[_0xf54e('0x17')]=function(_0x226c96,_0x50fc66){if(_0x226c96['body'][_0xf54e('0x9')]&&_0x226c96['body'][_0xf54e('0x18')]){var _0x1bfe99=path[_0xf54e('0x19')](__dirname,_0xf54e('0x1a'),_0x226c96[_0xf54e('0x1b')][_0xf54e('0x18')]);var _0x388aa0=process[_0xf54e('0x1c')]();process[_0xf54e('0x1d')](path[_0xf54e('0x1e')](_0x1bfe99));return execChildProcess()[_0xf54e('0x16')](function(_0x5b83df){process[_0xf54e('0x1d')](_0x388aa0);return pm2['start']({'name':_0x226c96[_0xf54e('0x1b')][_0xf54e('0x9')],'script':_0x1bfe99});})[_0xf54e('0x16')](function(_0x474b61){pm2[_0xf54e('0x1f')]();return _0x474b61[0x0];})[_0xf54e('0x16')](respondWithResult(_0x50fc66,0xc9))[_0xf54e('0x12')](handleError(_0x50fc66,null));}else{return _0x50fc66[_0xf54e('0x7')](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x20')});}};exports[_0xf54e('0x21')]=function(_0x39c0ae,_0x2ea001){if(_0x39c0ae['body']['id']){delete _0x39c0ae[_0xf54e('0x1b')]['id'];}var _0x4cbf7c={'online':_0xf54e('0x22'),'stopped':'stop'};if(_0x4cbf7c[_0xf54e('0x23')](_0x39c0ae[_0xf54e('0x1b')][_0xf54e('0x7')])){return pm2[_0x4cbf7c[_0x39c0ae[_0xf54e('0x1b')][_0xf54e('0x7')]]](_0x39c0ae[_0xf54e('0x15')]['id'])[_0xf54e('0x16')](respondWithResult(_0x2ea001,0xc8))['catch'](handleError(_0x2ea001,null));}else{return _0x2ea001['status'](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x24')});}};exports[_0xf54e('0x25')]=function(_0x16d00f,_0xb2d4c4){if(_0x16d00f[_0xf54e('0x1b')]['id']){delete _0x16d00f[_0xf54e('0x1b')]['id'];}if(_0x16d00f[_0xf54e('0x15')]['id']){return pm2[_0xf54e('0x26')](_0x16d00f[_0xf54e('0x15')]['id'])['then'](function(_0x5f29d3){pm2[_0xf54e('0x1f')]();return _0x5f29d3[0x0];})[_0xf54e('0x16')](respondWithResult(_0xb2d4c4,null))['catch'](handleError(_0xb2d4c4,null));}else{return _0xb2d4c4[_0xf54e('0x7')](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x27')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 750534d..765fbed 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 _0x2542=['./realtime.controller','/queues','getQueues','exports','express','Router','../../components/auth/service'];(function(_0x479f47,_0x3d619a){var _0xc3fac2=function(_0x351634){while(--_0x351634){_0x479f47['push'](_0x479f47['shift']());}};_0xc3fac2(++_0x3d619a);}(_0x2542,0x169));var _0x2254=function(_0x3fede1,_0x24d8bf){_0x3fede1=_0x3fede1-0x0;var _0x307e77=_0x2542[_0x3fede1];return _0x307e77;};'use strict';var express=require(_0x2254('0x0'));var router=express[_0x2254('0x1')]();var auth=require(_0x2254('0x2'));var controller=require(_0x2254('0x3'));router['get'](_0x2254('0x4'),auth['isAuthenticated'](),controller[_0x2254('0x5')]);module[_0x2254('0x6')]=router; \ No newline at end of file +var _0xff4f=['express','Router','../../components/auth/service','/queues','isAuthenticated','getQueues'];(function(_0x12ee03,_0x455139){var _0x48a632=function(_0x16f9b8){while(--_0x16f9b8){_0x12ee03['push'](_0x12ee03['shift']());}};_0x48a632(++_0x455139);}(_0xff4f,0x156));var _0xfff4=function(_0x38fead,_0x1a0c68){_0x38fead=_0x38fead-0x0;var _0x1598e0=_0xff4f[_0x38fead];return _0x1598e0;};'use strict';var express=require(_0xfff4('0x0'));var router=express[_0xfff4('0x1')]();var auth=require(_0xfff4('0x2'));var controller=require('./realtime.controller');router['get'](_0xfff4('0x3'),auth[_0xfff4('0x4')](),controller[_0xfff4('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index a4735c6..6ca17f8 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 _0x437f=['toLowerCase','Invalid\x20channel','rawAttributes','type','key','user','userProfileId','QueueCampaigns','Queues','UserProfile','getResources','count','rows','all','util','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','http','undefined','offset','limit','status','set','json','error','stack','name','request','Agents','result','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','paused','outbound','push','originated','message','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','map','loggedInDb','pTalking','pick','filter','busy','some','connectedlinenum','internal','toString','find','getMembers','length','UserId','voiceStatus','online','agents','User','Queue','findAll','getQueues','mail','chat','sms','fax','whatsapp','resolve','query','channel','includes'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x437f,0x6b));var _0xf437=function(_0x3e5e03,_0x2fac27){_0x3e5e03=_0x3e5e03-0x0;var _0x45279e=_0x437f[_0x3e5e03];return _0x45279e;};'use strict';var util=require(_0xf437('0x0'));var _=require('lodash');var jayson=require(_0xf437('0x1'));var qs=require(_0xf437('0x2'));var logger=require(_0xf437('0x3'))(_0xf437('0x4'));var db=require(_0xf437('0x5'))['db'];var amiClient=jayson['client'][_0xf437('0x6')]({'port':0x232a});var routingClient=jayson['client'][_0xf437('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x56b72c,_0x12f2f7){return function(_0x41912b){if(_0x41912b){var _0x23a94a=typeof _0x12f2f7['offset']===_0xf437('0x7')&&typeof _0x12f2f7['limit']==='undefined';var _0x1c9f22=_0x41912b['count'];var _0x37ab9c=_0x23a94a?0x0:_0x12f2f7['offset'];var _0x2a9b0c=_0x23a94a?_0x41912b['count']:_0x12f2f7[_0xf437('0x8')]+_0x12f2f7[_0xf437('0x9')];var _0x54ba40;if(_0x2a9b0c>=_0x1c9f22){_0x2a9b0c=_0x1c9f22;_0x54ba40=0xc8;}else{_0x54ba40=0xce;}_0x56b72c[_0xf437('0xa')](_0x54ba40);return _0x56b72c[_0xf437('0xb')]('Content-Range',_0x37ab9c+'-'+_0x2a9b0c+'/'+_0x1c9f22)[_0xf437('0xc')](_0x41912b);}return null;};}function handleError(_0x4e3a09,_0x274543){_0x274543=_0x274543||0x1f4;return function(_0x2291fb){logger[_0xf437('0xd')](_0x2291fb[_0xf437('0xe')]);if(_0x2291fb['name']){delete _0x2291fb[_0xf437('0xf')];}_0x4e3a09[_0xf437('0xa')](_0x274543)['send'](_0x2291fb);};}function getRealtimeAgents(){return new Promise(function(_0x41f55e,_0x5c066f){return amiClient[_0xf437('0x10')](_0xf437('0x11'),{})['then'](function(_0x594675){if(_0x594675[_0xf437('0xd')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x4dc025=_0x594675[_0xf437('0x12')];return routingClient[_0xf437('0x10')]('Agents',{})[_0xf437('0x13')](function(_0x1417aa){if(_0x1417aa[_0xf437('0xd')])throw new Error(_0xf437('0x14'));var _0x1bcef4=_0x1417aa['result'];return _0x41f55e(_[_0xf437('0x15')]({},_0x4dc025,_0x1bcef4));});})[_0xf437('0x16')](function(_0x3df8c1){_0x5c066f(_0x3df8c1);});});}function getRealtimeQueues(_0x5d90a3,_0x53189c){return new Promise(function(_0x42c3a6,_0xf27a34){var _0x36004a=_0x53189c===_0xf437('0x17')?amiClient:routingClient;return _0x36004a[_0xf437('0x10')](_[_0xf437('0x18')](_0x53189c)+'Queues',_0x5d90a3)['then'](function(_0x5a0cda){if(_0x5a0cda['error'])throw new Error(util[_0xf437('0x19')](_0xf437('0x1a'),_0x53189c));return _0x42c3a6(_0x5a0cda[_0xf437('0x12')]);})[_0xf437('0x16')](function(_0x4cfe51){_0xf27a34(_0x4cfe51);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x18531a,_0x4484fe){return amiClient[_0xf437('0x10')](_0xf437('0x1b'),{})[_0xf437('0x13')](function(_0x14ca74){if(_0x14ca74[_0xf437('0xd')])throw new Error(_0xf437('0x1c'));return _0x18531a(_0x14ca74['result']);})[_0xf437('0x16')](function(_0x5e1919){_0x4484fe(_0x5e1919);});});}function initializeQueues(_0x2ba779,_0x228c23,_0x1c45ee,_0x19c811){var _0x3c464c=[_0xf437('0x1d'),_0xf437('0x1e'),_0xf437('0x1f'),_0xf437('0x20'),_0xf437('0x21')];if(_0x1c45ee==='voice'&&_0x19c811===_0xf437('0x22')){_0x3c464c[_0xf437('0x23')]('pTalking',_0xf437('0x24'),_0xf437('0x25'),'dialActive','dialMethod',_0xf437('0x26'),_0xf437('0x27'),_0xf437('0x28'),'erlangCalls',_0xf437('0x29'),_0xf437('0x2a'),_0xf437('0x2b'),_0xf437('0x2c'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable',_0xf437('0x2d'),_0xf437('0x2e'),_0xf437('0x2f'),'predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime',_0xf437('0x30'));}return _0x2ba779[_0xf437('0x31')](function(_0x426866){var _0x6230b6=_0x426866['get']({'plain':!![]});_0x6230b6['agents']=[];_0x6230b6[_0xf437('0x21')]=0x0;_0x6230b6[_0xf437('0x32')]=0x0;_0x6230b6[_0xf437('0x1d')]=0x0;_0x6230b6['available']=0x0;_0x6230b6[_0xf437('0x1f')]=0x0;if(_0x1c45ee===_0xf437('0x17')){_0x6230b6['talking']=0x0;_0x6230b6['busy']=0x0;if(_0x19c811===_0xf437('0x22')){_0x6230b6[_0xf437('0x33')]=0x0;_0x6230b6[_0xf437('0x24')]=0x0;}}var _0x4c542a=_['find'](_0x228c23,['id',_0x6230b6['id']]);if(_0x4c542a)_[_0xf437('0x15')](_0x6230b6,_[_0xf437('0x34')](_0x4c542a,_0x3c464c));return _0x6230b6;});}function updateAgentVoiceStatus(_0x41fb5c,_0x325960,_0x44e57a){var _0x47b285=_[_0xf437('0x35')](_0x44e57a,['queue',_0x325960[_0xf437('0xf')]]);if(_0x47b285['length']===0x0)return _0x41fb5c[_0xf437('0x36')]=!![];if(_[_0xf437('0x37')](_0x47b285,[_0xf437('0x38'),_0x41fb5c[_0xf437('0x39')][_0xf437('0x3a')]()]))return _0x41fb5c['talking']=!![];if(!_0x41fb5c['talking'])return _0x41fb5c[_0xf437('0x36')]=!![];}function getVoiceQueueAgents(_0x42e5fe,_0x5ad837,_0x5657c7,_0x2ae732){var _0x2ec1f3=_[_0xf437('0x3b')](_0x5ad837,['id',_0x42e5fe['id']]);if(!_0x2ec1f3)return _0x42e5fe;return _0x2ec1f3[_0xf437('0x3c')]({'raw':!![]})['then'](function(_0x297d96){for(var _0x12feba=0x0;_0x12feba<_0x297d96[_0xf437('0x3d')];_0x12feba++){var _0x2eb26e=_[_0xf437('0x3b')](_0x5657c7,['id',_0x297d96[_0x12feba]['UserId']]);if(!_0x2eb26e){_0x2eb26e={'id':_0x297d96[_0x12feba][_0xf437('0x3e')],'name':_0x297d96[_0x12feba][_0xf437('0x3e')],'accountcode':'','online':![]};}var _0x43fd62={'id':_0x2eb26e['id'],'name':_0x2eb26e['name'],'internal':_0x2eb26e['accountcode'],'online':Boolean(_0x2eb26e['online']),'paused':Boolean(_0x297d96[_0x12feba][_0xf437('0x21')])};if(_0x2eb26e[_0xf437('0x3f')]===_0xf437('0x20'))updateAgentVoiceStatus(_0x43fd62,_0x42e5fe,_0x2ae732);if(_0x43fd62[_0xf437('0x40')])_0x42e5fe['loggedInDb']++;if(_0x43fd62['busy'])_0x42e5fe[_0xf437('0x36')]++;if(_0x43fd62[_0xf437('0x21')]&&!_0x43fd62[_0xf437('0x36')]&&!_0x43fd62['talking'])_0x42e5fe['paused']++;_0x42e5fe[_0xf437('0x41')][_0xf437('0x23')](_0x43fd62);}return _0x42e5fe;});}function getQueueAgents(_0x4d6b26,_0x405956,_0x22e12d){var _0x42569e=_0xf437('0x42')+_['startCase'](_0x22e12d)+_0xf437('0x43');var _0x3370df=_0x22e12d+'Pause';return db[_0x42569e][_0xf437('0x44')]({'where':{[_['startCase'](_0x22e12d)+'QueueId']:_0x4d6b26['id']},'raw':!![]})['then'](function(_0x424b73){for(var _0x37fb47=0x0;_0x37fb47<_0x424b73[_0xf437('0x3d')];_0x37fb47++){var _0x576c34=_[_0xf437('0x3b')](_0x405956,['id',_0x424b73[_0x37fb47][_0xf437('0x3e')]]);if(!_0x576c34){_0x576c34={'id':_0x424b73[_0x37fb47][_0xf437('0x3e')],'name':_0x424b73[_0x37fb47][_0xf437('0x3e')],'online':![],['pauseField']:![]};}var _0x1a0865={'id':_0x576c34['id'],'name':_0x576c34['name'],'online':Boolean(_0x576c34[_0xf437('0x40')]),'paused':Boolean(_0x576c34[_0x3370df])};if(_0x1a0865[_0xf437('0x40')])_0x4d6b26[_0xf437('0x32')]++;_0x4d6b26['agents']['push'](_0x1a0865);}return _0x4d6b26;});}exports[_0xf437('0x45')]=function(_0x1c0bdf,_0x2e8344){var _0x4bcab0=[_0xf437('0x46'),_0xf437('0x47'),_0xf437('0x48'),'openchannel',_0xf437('0x49'),_0xf437('0x4a'),_0xf437('0x17')];var _0x1af0f5={'count':0x0,'rows':[]},_0x147877={},_0x5a1f3d,_0x51ff22,_0x41c4e8,_0x5582be,_0x260e3d;Promise[_0xf437('0x4b')]()[_0xf437('0x13')](function(){if(_0x1c0bdf[_0xf437('0x4c')][_0xf437('0x4d')]){if(!_[_0xf437('0x4e')](_0x4bcab0,_0x1c0bdf[_0xf437('0x4c')][_0xf437('0x4d')][_0xf437('0x4f')]()))throw new Error(_0xf437('0x50'));_0x5a1f3d=_0x1c0bdf[_0xf437('0x4c')][_0xf437('0x4d')][_0xf437('0x4f')]();}var _0x51fc4d=_[_0xf437('0x18')](_0x5a1f3d)+'Queue';var _0x10edba=_[_0xf437('0x31')](db[_0x51fc4d][_0xf437('0x51')],function(_0x3377d1){return{'name':_0x3377d1['fieldName'],'type':_0x3377d1[_0xf437('0x52')][_0xf437('0x53')]};});_0x147877=qs['getOptions'](_0x10edba,_0x1c0bdf);if(_0x1c0bdf['user']['role']===_0xf437('0x54')){var _0x5d3f91={'params':{'id':_0x1c0bdf['user'][_0xf437('0x55')]},'query':{'section':_0x5a1f3d==='voice'&&_0x1c0bdf[_0xf437('0x4c')]['type']===_0xf437('0x22')?_0xf437('0x56'):_[_0xf437('0x18')](_0x5a1f3d)+_0xf437('0x57'),'type':_0x1c0bdf[_0xf437('0x4c')][_0xf437('0x52')],'nolimit':!![],'sort':_0xf437('0xf'),'filter':_0x1c0bdf[_0xf437('0x4c')][_0xf437('0x35')]}};return db[_0xf437('0x58')][_0xf437('0x59')](_0x5d3f91);}return db[_0x51fc4d]['findAndCountAll'](_0x147877);})[_0xf437('0x13')](function(_0x3852ee){_0x1af0f5[_0xf437('0x5a')]=_0x3852ee[_0xf437('0x5a')];_0x51ff22=_0x3852ee[_0xf437('0x5b')];return getRealtimeQueues(_0x1c0bdf,_0x5a1f3d);})[_0xf437('0x13')](function(_0x38efdc){_0x5582be=_0x38efdc['rows'];return getRealtimeAgents();})[_0xf437('0x13')](function(_0x5e99be){_0x41c4e8=_0x5e99be[_0xf437('0x5b')];if(_0x5a1f3d!=_0xf437('0x17'))return;return getRealtimeVoiceQueueChannels();})[_0xf437('0x13')](function(_0x46efec){_0x260e3d=_0x46efec?_0x46efec[_0xf437('0x5b')]:[];return initializeQueues(_0x51ff22,_0x5582be,_0x5a1f3d,_0x1c0bdf[_0xf437('0x4c')]['type']);})[_0xf437('0x13')](function(_0x299558){var _0x57457d=_0x299558[_0xf437('0x31')](function(_0x1a574b){if(_0x5a1f3d===_0xf437('0x17'))return getVoiceQueueAgents(_0x1a574b,_0x51ff22,_0x41c4e8,_0x260e3d);else return getQueueAgents(_0x1a574b,_0x41c4e8,_0x5a1f3d);});return Promise[_0xf437('0x5c')](_0x57457d);})[_0xf437('0x13')](function(_0x2f6bea){_0x1af0f5[_0xf437('0x5b')]=_0x2f6bea;return _0x1af0f5;})['then'](respondWithFilteredResult(_0x2e8344,_0x147877))[_0xf437('0x16')](handleError(_0x2e8344,null));}; \ No newline at end of file +var _0xd1ed=['dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','agents','loggedInDb','waiting','talking','find','merge','pick','queue','length','internal','toString','busy','getMembers','UserId','accountcode','online','voiceStatus','User','Queue','findAll','QueueId','getQueues','mail','chat','sms','openchannel','fax','whatsapp','resolve','query','channel','includes','Invalid\x20channel','rawAttributes','fieldName','type','key','getOptions','user','role','userProfileId','QueueCampaigns','Queues','filter','UserProfile','getResources','findAndCountAll','rows','map','all','jayson/promise','../../components/parsers/qs','../../config/logger','../../mysqldb','client','http','offset','undefined','count','limit','status','json','error','name','request','Agents','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','startCase','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','paused','voice','outbound','push','pTalking','originated','message','dialActive'];(function(_0x4954ac,_0x27cce7){var _0x2cd669=function(_0x565eca){while(--_0x565eca){_0x4954ac['push'](_0x4954ac['shift']());}};_0x2cd669(++_0x27cce7);}(_0xd1ed,0x1c8));var _0xdd1e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd1ed[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var jayson=require(_0xdd1e('0x0'));var qs=require(_0xdd1e('0x1'));var logger=require(_0xdd1e('0x2'))('api');var db=require(_0xdd1e('0x3'))['db'];var amiClient=jayson[_0xdd1e('0x4')][_0xdd1e('0x5')]({'port':0x232a});var routingClient=jayson[_0xdd1e('0x4')][_0xdd1e('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x3bbc7d,_0x2ab015){return function(_0x160f33){if(_0x160f33){var _0x13cc1d=typeof _0x2ab015[_0xdd1e('0x6')]===_0xdd1e('0x7')&&typeof _0x2ab015['limit']==='undefined';var _0x26a7e1=_0x160f33[_0xdd1e('0x8')];var _0x499fb4=_0x13cc1d?0x0:_0x2ab015[_0xdd1e('0x6')];var _0x8f29d5=_0x13cc1d?_0x160f33['count']:_0x2ab015['offset']+_0x2ab015[_0xdd1e('0x9')];var _0x2ce5c4;if(_0x8f29d5>=_0x26a7e1){_0x8f29d5=_0x26a7e1;_0x2ce5c4=0xc8;}else{_0x2ce5c4=0xce;}_0x3bbc7d[_0xdd1e('0xa')](_0x2ce5c4);return _0x3bbc7d['set']('Content-Range',_0x499fb4+'-'+_0x8f29d5+'/'+_0x26a7e1)[_0xdd1e('0xb')](_0x160f33);}return null;};}function handleError(_0x5ce1cf,_0x346d39){_0x346d39=_0x346d39||0x1f4;return function(_0x278b7d){logger[_0xdd1e('0xc')](_0x278b7d['stack']);if(_0x278b7d[_0xdd1e('0xd')]){delete _0x278b7d[_0xdd1e('0xd')];}_0x5ce1cf[_0xdd1e('0xa')](_0x346d39)['send'](_0x278b7d);};}function getRealtimeAgents(){return new Promise(function(_0x177dea,_0x457526){return amiClient[_0xdd1e('0xe')](_0xdd1e('0xf'),{})['then'](function(_0x3ca8d8){if(_0x3ca8d8[_0xdd1e('0xc')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x378bd8=_0x3ca8d8[_0xdd1e('0x10')];return routingClient[_0xdd1e('0xe')]('Agents',{})['then'](function(_0x480e91){if(_0x480e91['error'])throw new Error(_0xdd1e('0x11'));var _0x4fc218=_0x480e91[_0xdd1e('0x10')];return _0x177dea(_['merge']({},_0x378bd8,_0x4fc218));});})[_0xdd1e('0x12')](function(_0x11dc87){_0x457526(_0x11dc87);});});}function getRealtimeQueues(_0x1c8c2a,_0x3cd05e){return new Promise(function(_0x373fa2,_0x4c5e24){var _0x88771c=_0x3cd05e==='voice'?amiClient:routingClient;return _0x88771c[_0xdd1e('0xe')](_[_0xdd1e('0x13')](_0x3cd05e)+'Queues',_0x1c8c2a)[_0xdd1e('0x14')](function(_0x2e42d0){if(_0x2e42d0[_0xdd1e('0xc')])throw new Error(util[_0xdd1e('0x15')](_0xdd1e('0x16'),_0x3cd05e));return _0x373fa2(_0x2e42d0[_0xdd1e('0x10')]);})[_0xdd1e('0x12')](function(_0x9a1224){_0x4c5e24(_0x9a1224);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x1d8238,_0x5b80d1){return amiClient[_0xdd1e('0xe')](_0xdd1e('0x17'),{})['then'](function(_0x4a462e){if(_0x4a462e[_0xdd1e('0xc')])throw new Error(_0xdd1e('0x18'));return _0x1d8238(_0x4a462e[_0xdd1e('0x10')]);})[_0xdd1e('0x12')](function(_0x4b9a86){_0x5b80d1(_0x4b9a86);});});}function initializeQueues(_0x138037,_0x4670fa,_0x2cd77f,_0x45971f){var _0x19a3b2=[_0xdd1e('0x19'),'available','waiting','talking',_0xdd1e('0x1a')];if(_0x2cd77f===_0xdd1e('0x1b')&&_0x45971f===_0xdd1e('0x1c')){_0x19a3b2[_0xdd1e('0x1d')](_0xdd1e('0x1e'),_0xdd1e('0x1f'),_0xdd1e('0x20'),_0xdd1e('0x21'),_0xdd1e('0x22'),_0xdd1e('0x23'),_0xdd1e('0x24'),'startProgressive',_0xdd1e('0x25'),_0xdd1e('0x26'),'erlangAbandonmentRate',_0xdd1e('0x27'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0xdd1e('0x28'),_0xdd1e('0x29'),_0xdd1e('0x2a'),'predictiveIntervalAnsweredCalls',_0xdd1e('0x2b'),_0xdd1e('0x2c'),_0xdd1e('0x2d'),_0xdd1e('0x2e'));}return _0x138037['map'](function(_0x161a76){var _0x526e3a=_0x161a76[_0xdd1e('0x2f')]({'plain':!![]});_0x526e3a[_0xdd1e('0x30')]=[];_0x526e3a[_0xdd1e('0x1a')]=0x0;_0x526e3a[_0xdd1e('0x31')]=0x0;_0x526e3a[_0xdd1e('0x19')]=0x0;_0x526e3a['available']=0x0;_0x526e3a[_0xdd1e('0x32')]=0x0;if(_0x2cd77f==='voice'){_0x526e3a[_0xdd1e('0x33')]=0x0;_0x526e3a['busy']=0x0;if(_0x45971f===_0xdd1e('0x1c')){_0x526e3a['pTalking']=0x0;_0x526e3a['originated']=0x0;}}var _0x19d29b=_[_0xdd1e('0x34')](_0x4670fa,['id',_0x526e3a['id']]);if(_0x19d29b)_[_0xdd1e('0x35')](_0x526e3a,_[_0xdd1e('0x36')](_0x19d29b,_0x19a3b2));return _0x526e3a;});}function updateAgentVoiceStatus(_0x3cc2f1,_0x121f19,_0x5f13e1){var _0x352ce1=_['filter'](_0x5f13e1,[_0xdd1e('0x37'),_0x121f19[_0xdd1e('0xd')]]);if(_0x352ce1[_0xdd1e('0x38')]===0x0)return _0x3cc2f1['busy']=!![];if(_['some'](_0x352ce1,['connectedlinenum',_0x3cc2f1[_0xdd1e('0x39')][_0xdd1e('0x3a')]()]))return _0x3cc2f1[_0xdd1e('0x33')]=!![];if(!_0x3cc2f1[_0xdd1e('0x33')])return _0x3cc2f1[_0xdd1e('0x3b')]=!![];}function getVoiceQueueAgents(_0x41c210,_0x59cfac,_0xc6ea1d,_0x4f8496){var _0x38eb76=_[_0xdd1e('0x34')](_0x59cfac,['id',_0x41c210['id']]);if(!_0x38eb76)return _0x41c210;return _0x38eb76[_0xdd1e('0x3c')]({'raw':!![]})[_0xdd1e('0x14')](function(_0x5c639f){for(var _0x222544=0x0;_0x222544<_0x5c639f[_0xdd1e('0x38')];_0x222544++){var _0x49a457=_['find'](_0xc6ea1d,['id',_0x5c639f[_0x222544][_0xdd1e('0x3d')]]);if(!_0x49a457){_0x49a457={'id':_0x5c639f[_0x222544]['UserId'],'name':_0x5c639f[_0x222544]['UserId'],'accountcode':'','online':![]};}var _0x21fea5={'id':_0x49a457['id'],'name':_0x49a457[_0xdd1e('0xd')],'internal':_0x49a457[_0xdd1e('0x3e')],'online':Boolean(_0x49a457[_0xdd1e('0x3f')]),'paused':Boolean(_0x5c639f[_0x222544][_0xdd1e('0x1a')])};if(_0x49a457[_0xdd1e('0x40')]===_0xdd1e('0x33'))updateAgentVoiceStatus(_0x21fea5,_0x41c210,_0x4f8496);if(_0x21fea5[_0xdd1e('0x3f')])_0x41c210['loggedInDb']++;if(_0x21fea5[_0xdd1e('0x3b')])_0x41c210[_0xdd1e('0x3b')]++;if(_0x21fea5[_0xdd1e('0x1a')]&&!_0x21fea5[_0xdd1e('0x3b')]&&!_0x21fea5[_0xdd1e('0x33')])_0x41c210['paused']++;_0x41c210['agents']['push'](_0x21fea5);}return _0x41c210;});}function getQueueAgents(_0x5d8d69,_0x231f07,_0x412cd2){var _0x3d3c2e=_0xdd1e('0x41')+_[_0xdd1e('0x13')](_0x412cd2)+_0xdd1e('0x42');var _0x2fbc77=_0x412cd2+'Pause';return db[_0x3d3c2e][_0xdd1e('0x43')]({'where':{[_['startCase'](_0x412cd2)+_0xdd1e('0x44')]:_0x5d8d69['id']},'raw':!![]})[_0xdd1e('0x14')](function(_0x11c3f2){for(var _0x374027=0x0;_0x374027<_0x11c3f2[_0xdd1e('0x38')];_0x374027++){var _0x1baa6f=_[_0xdd1e('0x34')](_0x231f07,['id',_0x11c3f2[_0x374027][_0xdd1e('0x3d')]]);if(!_0x1baa6f){_0x1baa6f={'id':_0x11c3f2[_0x374027][_0xdd1e('0x3d')],'name':_0x11c3f2[_0x374027][_0xdd1e('0x3d')],'online':![],['pauseField']:![]};}var _0x40e0eb={'id':_0x1baa6f['id'],'name':_0x1baa6f[_0xdd1e('0xd')],'online':Boolean(_0x1baa6f[_0xdd1e('0x3f')]),'paused':Boolean(_0x1baa6f[_0x2fbc77])};if(_0x40e0eb[_0xdd1e('0x3f')])_0x5d8d69[_0xdd1e('0x31')]++;_0x5d8d69[_0xdd1e('0x30')][_0xdd1e('0x1d')](_0x40e0eb);}return _0x5d8d69;});}exports[_0xdd1e('0x45')]=function(_0x18c9c2,_0x3e2d1d){var _0x5bba7d=[_0xdd1e('0x46'),_0xdd1e('0x47'),_0xdd1e('0x48'),_0xdd1e('0x49'),_0xdd1e('0x4a'),_0xdd1e('0x4b'),_0xdd1e('0x1b')];var _0x3f5e84={'count':0x0,'rows':[]},_0x39985a={},_0x5111f8,_0x18050e,_0x41b010,_0x3086a2,_0x13ba2c;Promise[_0xdd1e('0x4c')]()[_0xdd1e('0x14')](function(){if(_0x18c9c2[_0xdd1e('0x4d')][_0xdd1e('0x4e')]){if(!_[_0xdd1e('0x4f')](_0x5bba7d,_0x18c9c2[_0xdd1e('0x4d')][_0xdd1e('0x4e')]['toLowerCase']()))throw new Error(_0xdd1e('0x50'));_0x5111f8=_0x18c9c2[_0xdd1e('0x4d')][_0xdd1e('0x4e')]['toLowerCase']();}var _0x1a2c1f=_['startCase'](_0x5111f8)+_0xdd1e('0x42');var _0x41a6fa=_['map'](db[_0x1a2c1f][_0xdd1e('0x51')],function(_0x2a65bf){return{'name':_0x2a65bf[_0xdd1e('0x52')],'type':_0x2a65bf[_0xdd1e('0x53')][_0xdd1e('0x54')]};});_0x39985a=qs[_0xdd1e('0x55')](_0x41a6fa,_0x18c9c2);if(_0x18c9c2[_0xdd1e('0x56')][_0xdd1e('0x57')]===_0xdd1e('0x56')){var _0x33c10b={'params':{'id':_0x18c9c2[_0xdd1e('0x56')][_0xdd1e('0x58')]},'query':{'section':_0x5111f8===_0xdd1e('0x1b')&&_0x18c9c2['query'][_0xdd1e('0x53')]===_0xdd1e('0x1c')?_0xdd1e('0x59'):_['startCase'](_0x5111f8)+_0xdd1e('0x5a'),'type':_0x18c9c2[_0xdd1e('0x4d')][_0xdd1e('0x53')],'nolimit':!![],'sort':_0xdd1e('0xd'),'filter':_0x18c9c2[_0xdd1e('0x4d')][_0xdd1e('0x5b')]}};return db[_0xdd1e('0x5c')][_0xdd1e('0x5d')](_0x33c10b);}return db[_0x1a2c1f][_0xdd1e('0x5e')](_0x39985a);})['then'](function(_0x315299){_0x3f5e84['count']=_0x315299[_0xdd1e('0x8')];_0x18050e=_0x315299[_0xdd1e('0x5f')];return getRealtimeQueues(_0x18c9c2,_0x5111f8);})[_0xdd1e('0x14')](function(_0x5714c1){_0x3086a2=_0x5714c1[_0xdd1e('0x5f')];return getRealtimeAgents();})[_0xdd1e('0x14')](function(_0x40a94a){_0x41b010=_0x40a94a[_0xdd1e('0x5f')];if(_0x5111f8!=_0xdd1e('0x1b'))return;return getRealtimeVoiceQueueChannels();})[_0xdd1e('0x14')](function(_0x41b6d6){_0x13ba2c=_0x41b6d6?_0x41b6d6[_0xdd1e('0x5f')]:[];return initializeQueues(_0x18050e,_0x3086a2,_0x5111f8,_0x18c9c2[_0xdd1e('0x4d')][_0xdd1e('0x53')]);})['then'](function(_0x3e5d08){var _0x1cab2c=_0x3e5d08[_0xdd1e('0x60')](function(_0x492738){if(_0x5111f8==='voice')return getVoiceQueueAgents(_0x492738,_0x18050e,_0x41b010,_0x13ba2c);else return getQueueAgents(_0x492738,_0x41b010,_0x5111f8);});return Promise[_0xdd1e('0x61')](_0x1cab2c);})[_0xdd1e('0x14')](function(_0x1e3d5e){_0x3f5e84[_0xdd1e('0x5f')]=_0x1e3d5e;return _0x3f5e84;})['then'](respondWithFilteredResult(_0x3e2d1d,_0x39985a))[_0xdd1e('0x12')](handleError(_0x3e2d1d,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 50fce22..c2de82e 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3670f5,_0x260a0b){var _0x3095f3=function(_0x378e8a){while(--_0x378e8a){_0x3670f5['push'](_0x3670f5['shift']());}};_0x3095f3(++_0x260a0b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x29e3ec,_0x138a18){_0x29e3ec=_0x29e3ec-0x0;var _0x25727e=_0xcb91[_0x29e3ec];return _0x25727e;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3945f4,_0x2da4ad){var _0x2a1633=function(_0x4e31a5){while(--_0x4e31a5){_0x3945f4['push'](_0x3945f4['shift']());}};_0x2a1633(++_0x2da4ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 81fb669..bfd9042 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 _0xd991=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd991,0x115));var _0x1d99=function(_0x3795e3,_0x4d2873){_0x3795e3=_0x3795e3-0x0;var _0x473eac=_0xd991[_0x3795e3];return _0x473eac;};'use strict';var Sequelize=require(_0x1d99('0x0'));module[_0x1d99('0x1')]={'state':{'type':Sequelize[_0x1d99('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x1d99('0x3')]},'scheduledat':{'type':Sequelize[_0x1d99('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x1d99('0x4')]},'responsetime':{'type':Sequelize[_0x1d99('0x4')]},'ringtime':{'type':Sequelize[_0x1d99('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x1d99('0x3')]},'campaigntype':{'type':Sequelize[_0x1d99('0x3')]},'membername':{'type':Sequelize[_0x1d99('0x3')]}}; \ No newline at end of file +var _0x8ff3=['STRING','DATE','sequelize','exports'];(function(_0x5725e1,_0x49be96){var _0x387730=function(_0x19b210){while(--_0x19b210){_0x5725e1['push'](_0x5725e1['shift']());}};_0x387730(++_0x49be96);}(_0x8ff3,0x72));var _0x38ff=function(_0x7b28fe,_0x14b077){_0x7b28fe=_0x7b28fe-0x0;var _0x3eea1b=_0x8ff3[_0x7b28fe];return _0x3eea1b;};'use strict';var Sequelize=require(_0x38ff('0x0'));module[_0x38ff('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x38ff('0x2')]},'scheduledat':{'type':Sequelize[_0x38ff('0x3')]},'uniqueid':{'type':Sequelize[_0x38ff('0x2')]},'starttime':{'type':Sequelize[_0x38ff('0x3')]},'responsetime':{'type':Sequelize[_0x38ff('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x38ff('0x2')]},'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 d597fdc..75520fd 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 _0x94e0=['../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x218ee3,_0x2e60e9){var _0x77673d=function(_0x527822){while(--_0x527822){_0x218ee3['push'](_0x218ee3['shift']());}};_0x77673d(++_0x2e60e9);}(_0x94e0,0x10a));var _0x094e=function(_0x427217,_0x4039b1){_0x427217=_0x427217-0x0;var _0x5b28fb=_0x94e0[_0x427217];return _0x5b28fb;};'use strict';var _=require(_0x094e('0x0'));var util=require(_0x094e('0x1'));var logger=require(_0x094e('0x2'))(_0x094e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x094e('0x4'));var fs=require('fs');var path=require(_0x094e('0x5'));var rimraf=require(_0x094e('0x6'));var config=require(_0x094e('0x7'));var attributes=require(_0x094e('0x8'));module[_0x094e('0x9')]=function(_0x7afe75,_0x53c2eb){return _0x7afe75[_0x094e('0xa')](_0x094e('0xb'),attributes,{'tableName':_0x094e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8722=['moment','path','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','lodash','util','api'];(function(_0x2d60b3,_0x4ad866){var _0xd1dd56=function(_0x2fd84e){while(--_0x2fd84e){_0x2d60b3['push'](_0x2d60b3['shift']());}};_0xd1dd56(++_0x4ad866);}(_0x8722,0x129));var _0x2872=function(_0x135eb4,_0x5d00cf){_0x135eb4=_0x135eb4-0x0;var _0x3ac25d=_0x8722[_0x135eb4];return _0x3ac25d;};'use strict';var _=require(_0x2872('0x0'));var util=require(_0x2872('0x1'));var logger=require('../../config/logger')(_0x2872('0x2'));var moment=require(_0x2872('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2872('0x4'));var rimraf=require('rimraf');var config=require(_0x2872('0x5'));var attributes=require(_0x2872('0x6'));module['exports']=function(_0x36763d,_0x4f4621){return _0x36763d[_0x2872('0x7')](_0x2872('0x8'),attributes,{'tableName':_0x2872('0x9'),'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 2f21191..8ca37db 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 _0x4933=['info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateReportAgentPreview','create','body','options','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x4933,0x16e));var _0x3493=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x4933[_0x10004e];return _0x5af990;};'use strict';var _=require(_0x3493('0x0'));var util=require(_0x3493('0x1'));var moment=require('moment');var BPromise=require(_0x3493('0x2'));var rs=require(_0x3493('0x3'));var fs=require('fs');var Redis=require(_0x3493('0x4'));var db=require(_0x3493('0x5'))['db'];var utils=require(_0x3493('0x6'));var logger=require(_0x3493('0x7'))(_0x3493('0x8'));var config=require('../../config/environment');var jayson=require(_0x3493('0x9'));var client=jayson[_0x3493('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ed76e,_0x138aaa,_0x3732ea){return new BPromise(function(_0x171ab4,_0x978ccb){return client[_0x3493('0xb')](_0x2ed76e,_0x3732ea)['then'](function(_0x20d1b6){logger[_0x3493('0xc')](_0x3493('0xd'),_0x138aaa,_0x3493('0xe'));logger[_0x3493('0xf')](_0x3493('0x10'),_0x138aaa,_0x3493('0xe'),JSON[_0x3493('0x11')](_0x20d1b6));if(_0x20d1b6[_0x3493('0x12')]){if(_0x20d1b6[_0x3493('0x12')][_0x3493('0x13')]===0x1f4){logger['error'](_0x3493('0xd'),_0x138aaa,_0x20d1b6[_0x3493('0x12')]['message']);return _0x978ccb(_0x20d1b6[_0x3493('0x12')]['message']);}logger['error'](_0x3493('0xd'),_0x138aaa,_0x20d1b6[_0x3493('0x12')][_0x3493('0x14')]);return _0x171ab4(_0x20d1b6['error'][_0x3493('0x14')]);}else{logger[_0x3493('0xc')](_0x3493('0xd'),_0x138aaa,_0x3493('0xe'));_0x171ab4(_0x20d1b6[_0x3493('0x15')]['message']);}})['catch'](function(_0x474d0a){logger[_0x3493('0x12')](_0x3493('0xd'),_0x138aaa,_0x474d0a);_0x978ccb(_0x474d0a);});});}exports[_0x3493('0x16')]=function(_0x426a40){var _0x476e8a=this;return new Promise(function(_0x14256e,_0x2c70da){return db['ReportAgentPreview'][_0x3493('0x17')](_0x426a40[_0x3493('0x18')],{'raw':_0x426a40[_0x3493('0x19')]?_0x426a40[_0x3493('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x3493('0x1a')](function(_0x43d241){logger[_0x3493('0xc')]('CreateReportAgentPreview',_0x426a40);logger[_0x3493('0xf')]('CreateReportAgentPreview',_0x426a40,JSON[_0x3493('0x11')](_0x43d241));_0x14256e(_0x43d241);})['catch'](function(_0x3d0164){logger['error']('CreateReportAgentPreview',_0x3d0164[_0x3493('0x14')],_0x426a40);_0x2c70da(_0x476e8a[_0x3493('0x12')](0x1f4,_0x3d0164[_0x3493('0x14')]));});});}; \ No newline at end of file +var _0xb0c8=['jayson/promise','client','http','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xb0c8,0x6e));var _0x8b0c=function(_0x6af71c,_0x26f3d9){_0x6af71c=_0x6af71c-0x0;var _0x1ae421=_0xb0c8[_0x6af71c];return _0x1ae421;};'use strict';var _=require(_0x8b0c('0x0'));var util=require(_0x8b0c('0x1'));var moment=require(_0x8b0c('0x2'));var BPromise=require(_0x8b0c('0x3'));var rs=require(_0x8b0c('0x4'));var fs=require('fs');var Redis=require(_0x8b0c('0x5'));var db=require(_0x8b0c('0x6'))['db'];var utils=require(_0x8b0c('0x7'));var logger=require('../../config/logger')(_0x8b0c('0x8'));var config=require(_0x8b0c('0x9'));var jayson=require(_0x8b0c('0xa'));var client=jayson[_0x8b0c('0xb')][_0x8b0c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2561a1,_0x174a65,_0x571703){return new BPromise(function(_0x4b8a15,_0x263f81){return client['request'](_0x2561a1,_0x571703)[_0x8b0c('0xd')](function(_0x1b424c){logger['info'](_0x8b0c('0xe'),_0x174a65,_0x8b0c('0xf'));logger['debug'](_0x8b0c('0x10'),_0x174a65,_0x8b0c('0xf'),JSON[_0x8b0c('0x11')](_0x1b424c));if(_0x1b424c[_0x8b0c('0x12')]){if(_0x1b424c[_0x8b0c('0x12')][_0x8b0c('0x13')]===0x1f4){logger['error'](_0x8b0c('0xe'),_0x174a65,_0x1b424c[_0x8b0c('0x12')][_0x8b0c('0x14')]);return _0x263f81(_0x1b424c[_0x8b0c('0x12')]['message']);}logger[_0x8b0c('0x12')](_0x8b0c('0xe'),_0x174a65,_0x1b424c[_0x8b0c('0x12')][_0x8b0c('0x14')]);return _0x4b8a15(_0x1b424c[_0x8b0c('0x12')][_0x8b0c('0x14')]);}else{logger[_0x8b0c('0x15')]('ReportAgentPreview,\x20%s,\x20%s',_0x174a65,_0x8b0c('0xf'));_0x4b8a15(_0x1b424c[_0x8b0c('0x16')]['message']);}})[_0x8b0c('0x17')](function(_0x7a2d7f){logger[_0x8b0c('0x12')](_0x8b0c('0xe'),_0x174a65,_0x7a2d7f);_0x263f81(_0x7a2d7f);});});}exports[_0x8b0c('0x18')]=function(_0x3f33e7){var _0x33fedc=this;return new Promise(function(_0x135df5,_0x462c32){return db[_0x8b0c('0x19')][_0x8b0c('0x1a')](_0x3f33e7[_0x8b0c('0x1b')],{'raw':_0x3f33e7[_0x8b0c('0x1c')]?_0x3f33e7['options'][_0x8b0c('0x1d')]===undefined?!![]:![]:!![]})[_0x8b0c('0xd')](function(_0x5aa9e9){logger['info']('CreateReportAgentPreview',_0x3f33e7);logger['debug']('CreateReportAgentPreview',_0x3f33e7,JSON[_0x8b0c('0x11')](_0x5aa9e9));_0x135df5(_0x5aa9e9);})['catch'](function(_0x4f9d6d){logger[_0x8b0c('0x12')](_0x8b0c('0x18'),_0x4f9d6d[_0x8b0c('0x14')],_0x3f33e7);_0x462c32(_0x33fedc[_0x8b0c('0x12')](0x1f4,_0x4f9d6d[_0x8b0c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 6dd4241..352be80 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 _0x4a1e=['/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','util','express','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/chat/queues','chatQueues','/mail/queues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','/voice/queues/:id','/outbound/channels','outboundChannels','agents','put'];(function(_0x4aebe0,_0x56bc9b){var _0x21f015=function(_0x400c29){while(--_0x400c29){_0x4aebe0['push'](_0x4aebe0['shift']());}};_0x21f015(++_0x56bc9b);}(_0x4a1e,0xd0));var _0xe4a1=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0x4a1e[_0x146a97];return _0x259d5c;};'use strict';var multer=require('multer');var util=require(_0xe4a1('0x0'));var path=require('path');var express=require(_0xe4a1('0x1'));var router=express[_0xe4a1('0x2')]();var auth=require(_0xe4a1('0x3'));var controller=require(_0xe4a1('0x4'));router[_0xe4a1('0x5')]('/voice/channels',auth[_0xe4a1('0x6')](),controller['voiceChannels']);router[_0xe4a1('0x5')](_0xe4a1('0x7'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x8')]);router[_0xe4a1('0x5')](_0xe4a1('0x9'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0xa')]);router[_0xe4a1('0x5')]('/voice/queues',auth[_0xe4a1('0x6')](),controller['voiceQueues']);router[_0xe4a1('0x5')](_0xe4a1('0xb'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0xc')]);router[_0xe4a1('0x5')](_0xe4a1('0xd'),auth[_0xe4a1('0x6')](),controller['mailQueues']);router[_0xe4a1('0x5')](_0xe4a1('0xe'),auth['isAuthenticated'](),controller['mailAccounts']);router[_0xe4a1('0x5')](_0xe4a1('0xf'),auth['isAuthenticated'](),controller[_0xe4a1('0x10')]);router[_0xe4a1('0x5')](_0xe4a1('0x11'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x12')]);router['get'](_0xe4a1('0x13'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x14')]);router['get']('/fax/queues',auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x15')]);router[_0xe4a1('0x5')](_0xe4a1('0x16'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x17')]);router['get'](_0xe4a1('0x18'),auth['isAuthenticated'](),controller[_0xe4a1('0x19')]);router[_0xe4a1('0x5')](_0xe4a1('0x1a'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x1b')]);router[_0xe4a1('0x5')](_0xe4a1('0x1c'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x1d')]);router[_0xe4a1('0x5')](_0xe4a1('0x1e'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x1f')]);router[_0xe4a1('0x5')]('/voice/queues/:id',auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x20')]);router['put'](_0xe4a1('0x21'),auth[_0xe4a1('0x6')](),controller['updateVoiceQueue']);router[_0xe4a1('0x5')]('/outbound',auth['isAuthenticated'](),controller['outbound']);router[_0xe4a1('0x5')](_0xe4a1('0x22'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x23')]);router['get']('/agents',auth['isAuthenticated'](),controller[_0xe4a1('0x24')]);router[_0xe4a1('0x25')](_0xe4a1('0x26'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x27')]);router[_0xe4a1('0x5')](_0xe4a1('0x28'),auth[_0xe4a1('0x6')](),controller['telephones']);router[_0xe4a1('0x5')](_0xe4a1('0x29'),auth['isAuthenticated'](),controller[_0xe4a1('0x2a')]);router[_0xe4a1('0x5')](_0xe4a1('0x2b'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x2c')]);router[_0xe4a1('0x5')](_0xe4a1('0x2d'),auth['isAuthenticated'](),controller[_0xe4a1('0x2e')]);router[_0xe4a1('0x5')](_0xe4a1('0x2f'),auth['isAuthenticated'](),controller[_0xe4a1('0x30')]);router[_0xe4a1('0x5')](_0xe4a1('0x31'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x32')]);router[_0xe4a1('0x5')](_0xe4a1('0x33'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x34')]);router['get'](_0xe4a1('0x35'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x36')]);router['get'](_0xe4a1('0x37'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x38')]);router[_0xe4a1('0x5')]('/whatsapp/queues/waitinginteractions',auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x39')]);router[_0xe4a1('0x5')]('/fax/queues/waitinginteractions',auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x3a')]);router[_0xe4a1('0x3b')](_0xe4a1('0x3c'),auth['isAuthenticated'](),controller[_0xe4a1('0x3d')](_0xe4a1('0x3e')));router['get']('/mail/queues/:id',auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x3f')]);router['post'](_0xe4a1('0x40'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x3d')](_0xe4a1('0x41')));router[_0xe4a1('0x5')](_0xe4a1('0x42'),auth['isAuthenticated'](),controller[_0xe4a1('0x43')]);router['post'](_0xe4a1('0x44'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x3d')]('fax'));router[_0xe4a1('0x5')](_0xe4a1('0x45'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x46')]);router[_0xe4a1('0x3b')](_0xe4a1('0x47'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x3d')](_0xe4a1('0x48')));router[_0xe4a1('0x5')](_0xe4a1('0x49'),auth[_0xe4a1('0x6')](),controller['showOpenchannelQueues']);router['post'](_0xe4a1('0x4a'),auth[_0xe4a1('0x6')](),controller['queueNotify'](_0xe4a1('0x4b')));router['post']('/whatsapp/queues/:id/notify',auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x3d')]('whatsapp'));router[_0xe4a1('0x5')](_0xe4a1('0x4c'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x4d')]);router[_0xe4a1('0x5')](_0xe4a1('0x4e'),auth[_0xe4a1('0x6')](),controller['showWhatsappQueues']);router[_0xe4a1('0x3b')](_0xe4a1('0x4f'),auth[_0xe4a1('0x6')](),controller[_0xe4a1('0x50')]);module[_0xe4a1('0x51')]=router; \ No newline at end of file +var _0xc585=['/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','openchannel','/openchannel/queues/:id','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceQueues','/chat/queues','chatQueues','mailQueues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','agents','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts'];(function(_0x59dbfc,_0x5a7136){var _0x14bb78=function(_0x588f42){while(--_0x588f42){_0x59dbfc['push'](_0x59dbfc['shift']());}};_0x14bb78(++_0x5a7136);}(_0xc585,0x157));var _0x5c58=function(_0x2316c5,_0x34870b){_0x2316c5=_0x2316c5-0x0;var _0x11b909=_0xc585[_0x2316c5];return _0x11b909;};'use strict';var multer=require(_0x5c58('0x0'));var util=require(_0x5c58('0x1'));var path=require('path');var express=require(_0x5c58('0x2'));var router=express[_0x5c58('0x3')]();var auth=require(_0x5c58('0x4'));var controller=require(_0x5c58('0x5'));router[_0x5c58('0x6')](_0x5c58('0x7'),auth[_0x5c58('0x8')](),controller[_0x5c58('0x9')]);router[_0x5c58('0x6')](_0x5c58('0xa'),auth[_0x5c58('0x8')](),controller['voiceChannelMixMonitor']);router[_0x5c58('0x6')](_0x5c58('0xb'),auth[_0x5c58('0x8')](),controller['voiceChannelStopMixMonitor']);router[_0x5c58('0x6')]('/voice/queues',auth[_0x5c58('0x8')](),controller[_0x5c58('0xc')]);router[_0x5c58('0x6')](_0x5c58('0xd'),auth[_0x5c58('0x8')](),controller[_0x5c58('0xe')]);router[_0x5c58('0x6')]('/mail/queues',auth[_0x5c58('0x8')](),controller[_0x5c58('0xf')]);router[_0x5c58('0x6')]('/mail/accounts',auth[_0x5c58('0x8')](),controller[_0x5c58('0x10')]);router['get']('/openchannel/queues',auth[_0x5c58('0x8')](),controller[_0x5c58('0x11')]);router[_0x5c58('0x6')](_0x5c58('0x12'),auth[_0x5c58('0x8')](),controller[_0x5c58('0x13')]);router[_0x5c58('0x6')](_0x5c58('0x14'),auth[_0x5c58('0x8')](),controller[_0x5c58('0x15')]);router[_0x5c58('0x6')](_0x5c58('0x16'),auth['isAuthenticated'](),controller[_0x5c58('0x17')]);router[_0x5c58('0x6')](_0x5c58('0x18'),auth[_0x5c58('0x8')](),controller[_0x5c58('0x19')]);router[_0x5c58('0x6')](_0x5c58('0x1a'),auth[_0x5c58('0x8')](),controller[_0x5c58('0x1b')]);router[_0x5c58('0x6')](_0x5c58('0x1c'),auth['isAuthenticated'](),controller[_0x5c58('0x1d')]);router[_0x5c58('0x6')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x5c58('0x8')](),controller[_0x5c58('0x1e')]);router[_0x5c58('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x5c58('0x8')](),controller[_0x5c58('0x1f')]);router[_0x5c58('0x6')](_0x5c58('0x20'),auth[_0x5c58('0x8')](),controller[_0x5c58('0x21')]);router[_0x5c58('0x22')](_0x5c58('0x20'),auth['isAuthenticated'](),controller[_0x5c58('0x23')]);router[_0x5c58('0x6')](_0x5c58('0x24'),auth[_0x5c58('0x8')](),controller[_0x5c58('0x25')]);router[_0x5c58('0x6')](_0x5c58('0x26'),auth[_0x5c58('0x8')](),controller['outboundChannels']);router['get']('/agents',auth[_0x5c58('0x8')](),controller[_0x5c58('0x27')]);router['put']('/agents/:id/capacity',auth['isAuthenticated'](),controller[_0x5c58('0x28')]);router[_0x5c58('0x6')](_0x5c58('0x29'),auth[_0x5c58('0x8')](),controller['telephones']);router['get'](_0x5c58('0x2a'),auth['isAuthenticated'](),controller[_0x5c58('0x2b')]);router[_0x5c58('0x6')](_0x5c58('0x2c'),auth[_0x5c58('0x8')](),controller[_0x5c58('0x2d')]);router[_0x5c58('0x6')](_0x5c58('0x2e'),auth[_0x5c58('0x8')](),controller['faxAccounts']);router['get'](_0x5c58('0x2f'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0x5c58('0x6')](_0x5c58('0x30'),auth['isAuthenticated'](),controller[_0x5c58('0x31')]);router[_0x5c58('0x6')](_0x5c58('0x32'),auth[_0x5c58('0x8')](),controller[_0x5c58('0x33')]);router['get'](_0x5c58('0x34'),auth[_0x5c58('0x8')](),controller[_0x5c58('0x35')]);router[_0x5c58('0x6')]('/sms/queues/waitinginteractions',auth[_0x5c58('0x8')](),controller['smsQueuesWaitingInteractions']);router[_0x5c58('0x6')](_0x5c58('0x36'),auth[_0x5c58('0x8')](),controller[_0x5c58('0x37')]);router[_0x5c58('0x6')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0x5c58('0x38')](_0x5c58('0x39'),auth[_0x5c58('0x8')](),controller[_0x5c58('0x3a')]('mail'));router[_0x5c58('0x6')]('/mail/queues/:id',auth[_0x5c58('0x8')](),controller['showMailQueues']);router[_0x5c58('0x38')](_0x5c58('0x3b'),auth[_0x5c58('0x8')](),controller[_0x5c58('0x3a')](_0x5c58('0x3c')));router[_0x5c58('0x6')](_0x5c58('0x3d'),auth[_0x5c58('0x8')](),controller[_0x5c58('0x3e')]);router[_0x5c58('0x38')](_0x5c58('0x3f'),auth[_0x5c58('0x8')](),controller[_0x5c58('0x3a')](_0x5c58('0x40')));router[_0x5c58('0x6')](_0x5c58('0x41'),auth[_0x5c58('0x8')](),controller['showFaxQueues']);router[_0x5c58('0x38')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0x5c58('0x3a')](_0x5c58('0x42')));router[_0x5c58('0x6')](_0x5c58('0x43'),auth[_0x5c58('0x8')](),controller['showOpenchannelQueues']);router[_0x5c58('0x38')]('/sms/queues/:id/notify',auth[_0x5c58('0x8')](),controller[_0x5c58('0x3a')](_0x5c58('0x44')));router[_0x5c58('0x38')](_0x5c58('0x45'),auth['isAuthenticated'](),controller[_0x5c58('0x3a')](_0x5c58('0x46')));router[_0x5c58('0x6')](_0x5c58('0x47'),auth[_0x5c58('0x8')](),controller[_0x5c58('0x48')]);router[_0x5c58('0x6')](_0x5c58('0x49'),auth['isAuthenticated'](),controller[_0x5c58('0x4a')]);router['post'](_0x5c58('0x4b'),auth[_0x5c58('0x8')](),controller[_0x5c58('0x4c')]);module[_0x5c58('0x4d')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 3ac50f4..47cbd5d 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 _0xa41a=['name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','catch','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','hasOwnProperty','MemberReport','findAll','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','user','INTERACTION','interface','SIP/%s','agent','AgentCapacity','capacity','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','showMailQueues','MailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Interaction','update','MessageId','From','Account','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','Message','messageId','\x20Message\x20not\x20found','agentTransferTimeout','*,*,*,*','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','status','json','sendStatus','stack'];(function(_0x413e1e,_0x396d29){var _0x1ed0c1=function(_0x70c709){while(--_0x70c709){_0x413e1e['push'](_0x413e1e['shift']());}};_0x1ed0c1(++_0x396d29);}(_0xa41a,0x6b));var _0xaa41=function(_0x5e1e05,_0x40aebf){_0x5e1e05=_0x5e1e05-0x0;var _0x4eb094=_0xa41a[_0x5e1e05];return _0x4eb094;};'use strict';var BPromise=require(_0xaa41('0x0'));var moment=require(_0xaa41('0x1'));var _=require('lodash');var util=require(_0xaa41('0x2'));var db=require(_0xaa41('0x3'))['db'];var logger=require(_0xaa41('0x4'))(_0xaa41('0x5'));var jayson=require(_0xaa41('0x6'));var amiClient=jayson[_0xaa41('0x7')][_0xaa41('0x8')]({'port':0x232a});var mailClient=jayson[_0xaa41('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0xaa41('0x7')][_0xaa41('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){var _0x31df43=_0x179545?_0x179545:amiClient;return _0x31df43[_0xaa41('0x9')](_0x54bc5a,_0x5b1fff)[_0xaa41('0xa')](function(_0x1cc344){if(_0x1cc344[_0xaa41('0xb')]){if(_0x1cc344[_0xaa41('0xb')][_0xaa41('0xc')]===0x1f4){return _0x588ab4(_0x1cc344[_0xaa41('0xb')][_0xaa41('0xd')]);}return _0x202cce(_0x1cc344['error'][_0xaa41('0xd')]);}else{_0x202cce(_0x1cc344[_0xaa41('0xe')]);}})['catch'](function(_0x54827c){_0x588ab4(_0x54827c);});});}function respondWithResult(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xc8;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0xf')](_0x518b5b)[_0xaa41('0x10')](_0x19bd69);}return _0x1d0a54[_0xaa41('0x11')](0x194);};}function handleError(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0x1f4;return function(_0x1e9d7f){logger[_0xaa41('0xb')](_0x1e9d7f[_0xaa41('0x12')]);if(_0x1e9d7f[_0xaa41('0x13')]){delete _0x1e9d7f[_0xaa41('0x13')];}_0x6f9ade[_0xaa41('0xf')](_0x4eaf81)[_0xaa41('0x14')](_0x1e9d7f);};}function findById(_0x550ad5){return function(_0x2d868a){if(!_[_0xaa41('0x15')](_0x550ad5)&&!_[_0xaa41('0x15')](_0x2d868a)&&!_[_0xaa41('0x15')](_0x2d868a[_0xaa41('0x16')])){return _[_0xaa41('0x17')](_0x2d868a[_0xaa41('0x16')],function(_0x46e6d3){return _0x46e6d3['id']==_0x550ad5;});}return null;};}exports[_0xaa41('0x18')]=function(_0x4fe1a4,_0x5cd936){return respondWithRpcPromise(_0xaa41('0x19'),_0x4fe1a4[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5cd936,null))['catch'](handleError(_0x5cd936,null));};exports[_0xaa41('0x1b')]=function(_0x1f692b,_0x4e768e){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xaa41('0x1c')](_0x1f692b['query'],_0x1f692b[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x4e768e,null))[_0xaa41('0x1e')](handleError(_0x4e768e,null));};exports[_0xaa41('0x1f')]=function(_0x1d623c,_0x4eb01f){return respondWithRpcPromise(_0xaa41('0x20'),_[_0xaa41('0x1c')](_0x1d623c[_0xaa41('0x1a')],_0x1d623c[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x4eb01f,null))[_0xaa41('0x1e')](handleError(_0x4eb01f,null));};exports['voiceQueues']=function(_0x5795f4,_0x16aec5){return respondWithRpcPromise('VoiceQueues',_0x5795f4['query'])[_0xaa41('0xa')](respondWithResult(_0x16aec5,null))['catch'](handleError(_0x16aec5,null));};exports['showVoiceQueues']=function(_0x2d0ac0,_0x9c8c21){return respondWithRpcPromise(_0xaa41('0x21'),_0x2d0ac0[_0xaa41('0x1a')])[_0xaa41('0xa')](findById(_0x2d0ac0[_0xaa41('0x1d')]['id']))['then'](respondWithResult(_0x9c8c21,null))[_0xaa41('0x1e')](handleError(_0x9c8c21,null));};exports[_0xaa41('0x22')]=function(_0x63c18c,_0x9a16e3){return respondWithRpcPromise(_0xaa41('0x23'),_[_0xaa41('0x1c')](_0x63c18c[_0xaa41('0x24')],_0x63c18c[_0xaa41('0x1d')]))['then'](respondWithResult(_0x9a16e3,null))[_0xaa41('0x1e')](handleError(_0x9a16e3,null));};exports['voiceQueuesPreview']=function(_0x5dad80,_0x714537){return respondWithRpcPromise(_0xaa41('0x25'),_['merge'](_0x5dad80[_0xaa41('0x1a')],_0x5dad80[_0xaa41('0x1d')]))['then'](respondWithResult(_0x714537,null))['catch'](handleError(_0x714537,null));};exports['voiceQueuesChannels']=function(_0x1cf3da,_0x2f5cc0){return respondWithRpcPromise(_0xaa41('0x26'),_0x1cf3da[_0xaa41('0x1a')])['then'](respondWithResult(_0x2f5cc0,null))[_0xaa41('0x1e')](handleError(_0x2f5cc0,null));};exports[_0xaa41('0x27')]=function(_0x3e0204,_0x4de770){return respondWithRpcPromise(_0xaa41('0x28'),_[_0xaa41('0x1c')](_0x3e0204[_0xaa41('0x1a')],_0x3e0204['params']))[_0xaa41('0xa')](respondWithResult(_0x4de770,null))[_0xaa41('0x1e')](handleError(_0x4de770,null));};exports['voiceQueuesChannelHangup']=function(_0x23eb50,_0x13b6d4){return respondWithRpcPromise(_0xaa41('0x29'),_['merge'](_0x23eb50[_0xaa41('0x1a')],_0x23eb50['params']))[_0xaa41('0xa')](respondWithResult(_0x13b6d4,null))[_0xaa41('0x1e')](handleError(_0x13b6d4,null));};exports[_0xaa41('0x2a')]=function(_0x49b77a,_0x526377){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xaa41('0x1c')](_0x49b77a[_0xaa41('0x1a')],_0x49b77a[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x526377,null))['catch'](handleError(_0x526377,null));};exports['outbound']=function(_0x267999,_0x5673c){return respondWithRpcPromise(_0xaa41('0x2b'),_0x267999[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5673c,null))[_0xaa41('0x1e')](handleError(_0x5673c,null));};exports[_0xaa41('0x2c')]=function(_0x5e9879,_0x3adc28){return respondWithRpcPromise(_0xaa41('0x2d'),_0x5e9879[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x3adc28,null))['catch'](handleError(_0x3adc28,null));};exports['agents']=function(_0x42b759,_0x275fa3){var _0x5eae08;return respondWithRpcPromise(_0xaa41('0x2e'),_0x42b759['query'])[_0xaa41('0xa')](function(_0x25f2df){_0x5eae08=_0x25f2df;return respondWithRpcPromise(_0xaa41('0x2e'),_0x42b759[_0xaa41('0x1a')],routingClient);})[_0xaa41('0xa')](function(_0x12ba1a){return _[_0xaa41('0x1c')]({},_0x12ba1a,_0x5eae08);})[_0xaa41('0xa')](respondWithResult(_0x275fa3,null))['catch'](handleError(_0x275fa3,null));};exports[_0xaa41('0x2f')]=function(_0x2abf39,_0x35c685){if(_0x2abf39[_0xaa41('0x24')]&&_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')]&&_0x2abf39['user']&&_0x2abf39['user'][_0xaa41('0x13')]){for(var _0x4f9086 in _0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')]){if(_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0xaa41('0x31')](_0x4f9086)){db[_0xaa41('0x32')][_0xaa41('0x33')]({'where':{'channel':_0x4f9086,'membername':_0x2abf39['user'][_0xaa41('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x2abf39['body'][_0xaa41('0x30')][_0x4f9086]&&_0x2abf39['body']['interaction'][_0x4f9086]['length']?{'$notIn':_0x2abf39[_0xaa41('0x24')]['interaction'][_0x4f9086]}:{'$ne':null}}})[_0xaa41('0xa')](function(_0x198716){var _0x4a6882=moment()['format'](_0xaa41('0x34'));for(var _0x1b7b97=0x0,_0x1bb973=_0x198716[_0xaa41('0x35')];_0x1b7b97<_0x1bb973;_0x1b7b97+=0x1){_0x198716[_0x1b7b97][_0xaa41('0x36')]({'exitAt':_0x4a6882});}});for(var _0x337993=0x0;_0x337993<_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0xaa41('0x35')];_0x337993+=0x1){db['MemberReport'][_0xaa41('0x37')]({'where':{'channel':_0x4f9086,'membername':_0x2abf39[_0xaa41('0x38')][_0xaa41('0x13')],'type':_0xaa41('0x39'),'uniqueid':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0x337993],'exitAt':null},'defaults':{'channel':_0x4f9086,'membername':_0x2abf39['user'][_0xaa41('0x13')],'interface':_[_0xaa41('0x15')](_0x2abf39[_0xaa41('0x38')][_0xaa41('0x3a')])?util['format'](_0xaa41('0x3b'),_0x2abf39['user']['name']):_0x2abf39[_0xaa41('0x38')][_0xaa41('0x3a')],'type':_0xaa41('0x39'),'enterAt':moment()['format'](_0xaa41('0x34')),'role':_0xaa41('0x3c'),'internal':_0x2abf39[_0xaa41('0x38')]['internal'],'uniqueid':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0x337993]}});}}}}return respondWithRpcPromise(_0xaa41('0x3d'),{'id':_0x2abf39[_0xaa41('0x1d')]['id'],'capacity':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x3e')]},routingClient)[_0xaa41('0xa')](respondWithResult(_0x35c685,null))[_0xaa41('0x1e')](handleError(_0x35c685,null));};exports['telephones']=function(_0x9f0a81,_0x5bef5f){return respondWithRpcPromise('Telephones',_0x9f0a81[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5bef5f,null))[_0xaa41('0x1e')](handleError(_0x5bef5f,null));};exports[_0xaa41('0x3f')]=function(_0x14aab0,_0x288db3){return respondWithRpcPromise(_0xaa41('0x40'),_0x14aab0[_0xaa41('0x1a')])['then'](respondWithResult(_0x288db3,null))[_0xaa41('0x1e')](handleError(_0x288db3,null));};exports[_0xaa41('0x41')]=function(_0x1d518f,_0x4f9e92){return respondWithRpcPromise(_0xaa41('0x42'),_0x1d518f[_0xaa41('0x1a')])['then'](respondWithResult(_0x4f9e92,null))[_0xaa41('0x1e')](handleError(_0x4f9e92,null));};exports[_0xaa41('0x43')]=function(_0x283b3b,_0x4e5a2e){return respondWithRpcPromise(_0xaa41('0x44'),_0x283b3b[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x4e5a2e,null))['catch'](handleError(_0x4e5a2e,null));};exports[_0xaa41('0x45')]=function(_0x3cd14f,_0x3a29d2){return respondWithRpcPromise('ChatQueues',_0x3cd14f[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x3cd14f[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x3a29d2,null))[_0xaa41('0x1e')](handleError(_0x3a29d2,null));};exports['mailQueues']=function(_0x2ae70c,_0x57cb70){return respondWithRpcPromise('MailQueues',_0x2ae70c[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x57cb70,null))[_0xaa41('0x1e')](handleError(_0x57cb70,null));};exports[_0xaa41('0x46')]=function(_0x169ddf,_0x5e83e1){return respondWithRpcPromise(_0xaa41('0x47'),_0x169ddf[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x169ddf[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x5e83e1,null))[_0xaa41('0x1e')](handleError(_0x5e83e1,null));};exports[_0xaa41('0x48')]=function(_0x337059,_0x3f91f3){return respondWithRpcPromise('MailAccounts',_0x337059[_0xaa41('0x1a')],mailClient)[_0xaa41('0xa')](respondWithResult(_0x3f91f3,null))[_0xaa41('0x1e')](handleError(_0x3f91f3,null));};exports['openchannelQueues']=function(_0x3fe47a,_0x2caf5c){return respondWithRpcPromise(_0xaa41('0x49'),_0x3fe47a[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x2caf5c,null))[_0xaa41('0x1e')](handleError(_0x2caf5c,null));};exports[_0xaa41('0x4a')]=function(_0x5ea056,_0x55a85c){return respondWithRpcPromise('OpenchannelQueues',_0x5ea056['query'],routingClient)['then'](findById(_0x5ea056['params']['id']))[_0xaa41('0xa')](respondWithResult(_0x55a85c,null))['catch'](handleError(_0x55a85c,null));};exports['smsQueues']=function(_0x24c6f3,_0x40a524){return respondWithRpcPromise(_0xaa41('0x4b'),_0x24c6f3[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x40a524,null))[_0xaa41('0x1e')](handleError(_0x40a524,null));};exports[_0xaa41('0x4c')]=function(_0x1ddb6c,_0x46822f){return respondWithRpcPromise(_0xaa41('0x4b'),_0x1ddb6c[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x1ddb6c[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x46822f,null))['catch'](handleError(_0x46822f,null));};exports[_0xaa41('0x4d')]=function(_0x2d2af8,_0x50170f){return respondWithRpcPromise('WhatsappQueues',_0x2d2af8['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x50170f,null))['catch'](handleError(_0x50170f,null));};exports[_0xaa41('0x4e')]=function(_0x5c8028,_0x5423b6){return respondWithRpcPromise(_0xaa41('0x4f'),_0x5c8028['query'],routingClient)[_0xaa41('0xa')](findById(_0x5c8028[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x5423b6,null))[_0xaa41('0x1e')](handleError(_0x5423b6,null));};exports['faxQueues']=function(_0x5be61b,_0x339db3){return respondWithRpcPromise(_0xaa41('0x50'),_0x5be61b['query'],routingClient)['then'](respondWithResult(_0x339db3,null))[_0xaa41('0x1e')](handleError(_0x339db3,null));};exports[_0xaa41('0x51')]=function(_0x304694,_0xbeafb5){return respondWithRpcPromise(_0xaa41('0x50'),_0x304694['query'],routingClient)[_0xaa41('0xa')](findById(_0x304694['params']['id']))['then'](respondWithResult(_0xbeafb5,null))['catch'](handleError(_0xbeafb5,null));};exports[_0xaa41('0x52')]=function(_0x19ec63,_0x436362){return respondWithRpcPromise('FaxAccounts',_0x19ec63[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x436362,null))[_0xaa41('0x1e')](handleError(_0x436362,null));};exports[_0xaa41('0x53')]=function(_0x457515,_0x3ffbf8){return respondWithRpcPromise(_0xaa41('0x54'),_0x457515['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x3ffbf8,null))[_0xaa41('0x1e')](handleError(_0x3ffbf8,null));};exports[_0xaa41('0x55')]=function(_0x175ca9,_0x51ff61){return respondWithRpcPromise(_0xaa41('0x56'),_0x175ca9['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x51ff61,null))[_0xaa41('0x1e')](handleError(_0x51ff61,null));};exports[_0xaa41('0x57')]=function(_0x143ef0,_0x491cad){return respondWithRpcPromise(_0xaa41('0x58'),_0x143ef0[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x491cad,null))[_0xaa41('0x1e')](handleError(_0x491cad,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x140d78,_0x50197b){return respondWithRpcPromise(_0xaa41('0x58'),_0x140d78[_0xaa41('0x1a')],routingClient)['then'](function(_0x1ac05e){if(_0x140d78[_0xaa41('0x1a')][_0xaa41('0x59')]!==undefined){var _0x582d79=_(_0x1ac05e[_0xaa41('0x16')])[_0xaa41('0x5a')]([_0x140d78[_0xaa41('0x1a')][_0xaa41('0x59')],_0x140d78[_0xaa41('0x1d')]['id']])[_0xaa41('0x5b')](_0xaa41('0x5c'))['uniq']()[_0xaa41('0x5d')]();return _0x1ac05e[_0xaa41('0x16')][_0xaa41('0x5a')](function(_0x530982){return _0x582d79['indexOf'](_0x530982[_0xaa41('0x5c')])>-0x1;});}else{return _0x1ac05e[_0xaa41('0x16')]['filter'](function(_0x1ce957){return _0x1ce957[_0xaa41('0x5c')]===parseInt(_0x140d78['params']['id']);});}})[_0xaa41('0xa')](respondWithResult(_0x50197b,null))[_0xaa41('0x1e')](handleError(_0x50197b,null));};exports[_0xaa41('0x5e')]=function(_0xe8731,_0x46feb2){return respondWithRpcPromise(_0xaa41('0x5f'),_0xe8731[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x46feb2,null))['catch'](handleError(_0x46feb2,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x397526,_0x481db9){return respondWithRpcPromise(_0xaa41('0x60'),_0x397526[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x481db9,null))['catch'](handleError(_0x481db9,null));};exports[_0xaa41('0x61')]=function(_0x404c38,_0x2d7493){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x404c38[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x2d7493,null))['catch'](handleError(_0x2d7493,null));};exports[_0xaa41('0x62')]=function(_0x4de25c){return function(_0x53faf4,_0x3f6a2b){var _0x34d0e4,_0x5eded3;var _0x5a8cb0=_[_0xaa41('0x63')](_0x4de25c);var _0x1726ec=_0x4de25c===_0xaa41('0x64')?_0xaa41('0x65'):'Account';return db[_0x5a8cb0+_0xaa41('0x66')][_0xaa41('0x67')]({'raw':!![],'where':{'id':_0x53faf4[_0xaa41('0x1d')]['id']}})['then'](function(_0x1ad3aa){if(_[_0xaa41('0x15')](_0x1ad3aa)){throw new Error(_0x5a8cb0+_0xaa41('0x68'));}_0x34d0e4=_0x1ad3aa;return db[_0x5a8cb0+'Message'][_0xaa41('0x67')]({'where':{'id':_0x53faf4['body']['messageId']},'include':[{'model':db[_0x5a8cb0+_0xaa41('0x69')],'as':_0xaa41('0x69')},{'model':db[_0x5a8cb0+_0x1726ec],'as':'Account'}]});})[_0xaa41('0xa')](function(_0x9e8ebb){if(_[_0xaa41('0x15')](_0x9e8ebb)){throw new Error(_0x5a8cb0+'\x20Message\x20not\x20found');}_0x5eded3=_0x9e8ebb;return _0x9e8ebb[_0xaa41('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xaa41('0xa')](function(){var _0x1a2deb={'uniqueid':_0x4de25c+'.'+_0x5eded3['id']+'.'+_0x5eded3[_0xaa41('0x69')]['id'],'FromUserId':_0x53faf4[_0xaa41('0x38')]['id'],'type':'queue'};_0x1a2deb[_0x5a8cb0+_0xaa41('0x6b')]=_0x5eded3['id'];_0x1a2deb[_0x5a8cb0+'InteractionId']=_0x5eded3[_0xaa41('0x69')]['id'];_0x1a2deb[_0xaa41('0x6c')+_0x5a8cb0+_0x1726ec+'Id']=_0x5eded3[_0xaa41('0x6d')]['id'];_0x1a2deb['To'+_0x5a8cb0+_0xaa41('0x6e')]=_0x34d0e4['id'];return db[_0x5a8cb0+_0xaa41('0x6f')][_0xaa41('0x70')](_0x1a2deb);})[_0xaa41('0xa')](function(){return respondWithRpcPromise(_0xaa41('0x71'),{'channel':_0x4de25c,'interaction':_0x5eded3[_0xaa41('0x69')],'message':_0x5eded3,'account':_0x5eded3[_0xaa41('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0xaa41('0x72'),'appdata':_0x34d0e4['name']+','+(_0x5eded3[_0xaa41('0x6d')][_0xaa41('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xaa41('0xa')](respondWithResult(_0x3f6a2b,null))['catch'](handleError(_0x3f6a2b,null));};};exports[_0xaa41('0x74')]=function(_0xb44b1f,_0x472eb3){var _0x38d759,_0x2dc55e;if(_[_0xaa41('0x15')](_0xb44b1f[_0xaa41('0x24')]['channel'])){throw new Error(_0xaa41('0x75'));}var _0x1d50db=_0xb44b1f[_0xaa41('0x24')][_0xaa41('0x76')];var _0x585ce7=_[_0xaa41('0x63')](_0x1d50db);var _0x5c9beb=_0x1d50db===_0xaa41('0x64')?_0xaa41('0x65'):_0xaa41('0x6d');return db[_0xaa41('0x77')][_0xaa41('0x67')]({'raw':!![],'where':{'id':_0xb44b1f['params']['id'],'role':_0xaa41('0x3c')}})[_0xaa41('0xa')](function(_0x5819ac){if(_[_0xaa41('0x15')](_0x5819ac)){throw new Error(_0xaa41('0x78'));}_0x38d759=_0x5819ac;return db[_0x585ce7+_0xaa41('0x79')][_0xaa41('0x67')]({'where':{'id':_0xb44b1f[_0xaa41('0x24')][_0xaa41('0x7a')]},'include':[{'model':db[_0x585ce7+_0xaa41('0x69')],'as':_0xaa41('0x69')},{'model':db[_0x585ce7+_0x5c9beb],'as':'Account'}]});})[_0xaa41('0xa')](function(_0x39d3cc){if(_[_0xaa41('0x15')](_0x39d3cc)){throw new Error(_0x585ce7+_0xaa41('0x7b'));}_0x2dc55e=_0x39d3cc;return _0x39d3cc[_0xaa41('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xaa41('0xa')](function(){var _0x5489be={'uniqueid':_0x1d50db+'.'+_0x2dc55e['id']+'.'+_0x2dc55e['Interaction']['id'],'FromUserId':_0xb44b1f['user']['id'],'type':_0xaa41('0x72'),'ToUserId':_0x38d759['id']};_0x5489be[_0x585ce7+_0xaa41('0x6b')]=_0x2dc55e['id'];_0x5489be[_0x585ce7+'InteractionId']=_0x2dc55e[_0xaa41('0x69')]['id'];_0x5489be[_0xaa41('0x6c')+_0x585ce7+_0x5c9beb+'Id']=_0x2dc55e['Account']['id'];return db[_0x585ce7+_0xaa41('0x6f')][_0xaa41('0x70')](_0x5489be);})[_0xaa41('0xa')](function(){return respondWithRpcPromise(_0xaa41('0x71'),{'channel':_0x1d50db,'interaction':_0x2dc55e['Interaction'],'message':_0x2dc55e,'account':_0x2dc55e[_0xaa41('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x38d759[_0xaa41('0x13')]+','+(_0x2dc55e[_0xaa41('0x6d')][_0xaa41('0x7c')]||0x12c),'interval':_0xaa41('0x7d')}]},routingClient);})[_0xaa41('0xa')](respondWithResult(_0x472eb3,null))[_0xaa41('0x1e')](handleError(_0x472eb3,null));}; \ No newline at end of file +var _0x7217=['mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','rows','map','value','filter','indexOf','queue_id','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','capitalize','chat','Website','Account','Queue','Message','findOne','messageId','Interaction','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','channel','Channel\x20field\x20is\x20mandatory','\x20Message\x20not\x20found','update','agentTransferTimeout','*,*,*,*','bluebird','lodash','util','../../mysqldb','../../config/logger','api','http','client','request','then','error','code','message','result','catch','json','sendStatus','stack','send','isNil','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','name','hasOwnProperty','MemberReport','findAll','length','format','updateAttributes','findOrCreate','SIP/%s','INTERACTION','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','MailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x7217,0x19e));var _0x7721=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x7217[_0x484e36];return _0xafc85d;};'use strict';var BPromise=require(_0x7721('0x0'));var moment=require('moment');var _=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var db=require(_0x7721('0x3'))['db'];var logger=require(_0x7721('0x4'))(_0x7721('0x5'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x7721('0x6')]({'port':0x232a});var mailClient=jayson[_0x7721('0x7')][_0x7721('0x6')]({'port':0x232b});var routingClient=jayson[_0x7721('0x7')][_0x7721('0x6')]({'port':0x232c});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){var _0x3e6368=_0x21f680?_0x21f680:amiClient;return _0x3e6368[_0x7721('0x8')](_0xf7ff37,_0x18ab6b)[_0x7721('0x9')](function(_0x138740){if(_0x138740[_0x7721('0xa')]){if(_0x138740['error'][_0x7721('0xb')]===0x1f4){return _0x2f99ed(_0x138740[_0x7721('0xa')][_0x7721('0xc')]);}return _0x225610(_0x138740[_0x7721('0xa')][_0x7721('0xc')]);}else{_0x225610(_0x138740[_0x7721('0xd')]);}})[_0x7721('0xe')](function(_0x27b36b){_0x2f99ed(_0x27b36b);});});}function respondWithResult(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xc8;return function(_0x199930){if(_0x199930){return _0x55b4ca['status'](_0x2911ec)[_0x7721('0xf')](_0x199930);}return _0x55b4ca[_0x7721('0x10')](0x194);};}function handleError(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0x1f4;return function(_0x5069da){logger[_0x7721('0xa')](_0x5069da[_0x7721('0x11')]);if(_0x5069da['name']){delete _0x5069da['name'];}_0x3f01c5['status'](_0x2e9752)[_0x7721('0x12')](_0x5069da);};}function findById(_0x25a628){return function(_0x3cc909){if(!_[_0x7721('0x13')](_0x25a628)&&!_['isNil'](_0x3cc909)&&!_[_0x7721('0x13')](_0x3cc909['rows'])){return _[_0x7721('0x14')](_0x3cc909['rows'],function(_0xfec626){return _0xfec626['id']==_0x25a628;});}return null;};}exports[_0x7721('0x15')]=function(_0x3ab5a5,_0x3e140d){return respondWithRpcPromise(_0x7721('0x16'),_0x3ab5a5[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x3e140d,null))[_0x7721('0xe')](handleError(_0x3e140d,null));};exports[_0x7721('0x18')]=function(_0xaeccc4,_0x4ce1db){return respondWithRpcPromise(_0x7721('0x19'),_[_0x7721('0x1a')](_0xaeccc4[_0x7721('0x17')],_0xaeccc4[_0x7721('0x1b')]))['then'](respondWithResult(_0x4ce1db,null))[_0x7721('0xe')](handleError(_0x4ce1db,null));};exports['voiceChannelStopMixMonitor']=function(_0xb9e9dd,_0x288e3a){return respondWithRpcPromise(_0x7721('0x1c'),_[_0x7721('0x1a')](_0xb9e9dd[_0x7721('0x17')],_0xb9e9dd[_0x7721('0x1b')]))[_0x7721('0x9')](respondWithResult(_0x288e3a,null))['catch'](handleError(_0x288e3a,null));};exports[_0x7721('0x1d')]=function(_0x1abedb,_0x125564){return respondWithRpcPromise(_0x7721('0x1e'),_0x1abedb[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x125564,null))[_0x7721('0xe')](handleError(_0x125564,null));};exports[_0x7721('0x1f')]=function(_0x40f367,_0x52316e){return respondWithRpcPromise(_0x7721('0x1e'),_0x40f367['query'])['then'](findById(_0x40f367[_0x7721('0x1b')]['id']))[_0x7721('0x9')](respondWithResult(_0x52316e,null))[_0x7721('0xe')](handleError(_0x52316e,null));};exports[_0x7721('0x20')]=function(_0x1ea4d,_0x37b9f0){return respondWithRpcPromise(_0x7721('0x21'),_[_0x7721('0x1a')](_0x1ea4d['body'],_0x1ea4d[_0x7721('0x1b')]))[_0x7721('0x9')](respondWithResult(_0x37b9f0,null))['catch'](handleError(_0x37b9f0,null));};exports['voiceQueuesPreview']=function(_0xfde9ec,_0x220bbf){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x7721('0x1a')](_0xfde9ec[_0x7721('0x17')],_0xfde9ec[_0x7721('0x1b')]))['then'](respondWithResult(_0x220bbf,null))[_0x7721('0xe')](handleError(_0x220bbf,null));};exports[_0x7721('0x22')]=function(_0x1492d4,_0x3f15e2){return respondWithRpcPromise(_0x7721('0x23'),_0x1492d4['query'])[_0x7721('0x9')](respondWithResult(_0x3f15e2,null))[_0x7721('0xe')](handleError(_0x3f15e2,null));};exports[_0x7721('0x24')]=function(_0x5c5b33,_0x35de7a){return respondWithRpcPromise(_0x7721('0x25'),_['merge'](_0x5c5b33[_0x7721('0x17')],_0x5c5b33['params']))[_0x7721('0x9')](respondWithResult(_0x35de7a,null))[_0x7721('0xe')](handleError(_0x35de7a,null));};exports[_0x7721('0x26')]=function(_0x1d894b,_0x1c84c0){return respondWithRpcPromise(_0x7721('0x27'),_[_0x7721('0x1a')](_0x1d894b[_0x7721('0x17')],_0x1d894b[_0x7721('0x1b')]))[_0x7721('0x9')](respondWithResult(_0x1c84c0,null))[_0x7721('0xe')](handleError(_0x1c84c0,null));};exports['voiceQueuesChannelRedirect']=function(_0xd1df68,_0x5e6663){return respondWithRpcPromise(_0x7721('0x28'),_[_0x7721('0x1a')](_0xd1df68[_0x7721('0x17')],_0xd1df68[_0x7721('0x1b')]))[_0x7721('0x9')](respondWithResult(_0x5e6663,null))[_0x7721('0xe')](handleError(_0x5e6663,null));};exports['outbound']=function(_0x557c34,_0x4cadef){return respondWithRpcPromise('Outbound',_0x557c34[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x4cadef,null))[_0x7721('0xe')](handleError(_0x4cadef,null));};exports[_0x7721('0x29')]=function(_0x4a90ce,_0xa389fa){return respondWithRpcPromise('OutboundChannels',_0x4a90ce[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0xa389fa,null))['catch'](handleError(_0xa389fa,null));};exports[_0x7721('0x2a')]=function(_0x3a47c8,_0x4e77ff){var _0x4d0111;return respondWithRpcPromise(_0x7721('0x2b'),_0x3a47c8[_0x7721('0x17')])[_0x7721('0x9')](function(_0x15e34d){_0x4d0111=_0x15e34d;return respondWithRpcPromise('Agents',_0x3a47c8[_0x7721('0x17')],routingClient);})[_0x7721('0x9')](function(_0x40ce8c){return _[_0x7721('0x1a')]({},_0x40ce8c,_0x4d0111);})[_0x7721('0x9')](respondWithResult(_0x4e77ff,null))['catch'](handleError(_0x4e77ff,null));};exports[_0x7721('0x2c')]=function(_0x4a2c28,_0xaa3216){if(_0x4a2c28['body']&&_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')]&&_0x4a2c28[_0x7721('0x2f')]&&_0x4a2c28['user'][_0x7721('0x30')]){for(var _0x11d853 in _0x4a2c28[_0x7721('0x2d')]['interaction']){if(_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')][_0x7721('0x31')](_0x11d853)){db[_0x7721('0x32')][_0x7721('0x33')]({'where':{'channel':_0x11d853,'membername':_0x4a2c28[_0x7721('0x2f')][_0x7721('0x30')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4a2c28['body'][_0x7721('0x2e')][_0x11d853]&&_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')][_0x11d853][_0x7721('0x34')]?{'$notIn':_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')][_0x11d853]}:{'$ne':null}}})[_0x7721('0x9')](function(_0x2966fe){var _0xa601bc=moment()[_0x7721('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x578867=0x0,_0x5ed70d=_0x2966fe[_0x7721('0x34')];_0x578867<_0x5ed70d;_0x578867+=0x1){_0x2966fe[_0x578867][_0x7721('0x36')]({'exitAt':_0xa601bc});}});for(var _0x219c9f=0x0;_0x219c9f<_0x4a2c28['body'][_0x7721('0x2e')][_0x11d853][_0x7721('0x34')];_0x219c9f+=0x1){db['MemberReport'][_0x7721('0x37')]({'where':{'channel':_0x11d853,'membername':_0x4a2c28['user'][_0x7721('0x30')],'type':'INTERACTION','uniqueid':_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')][_0x11d853][_0x219c9f],'exitAt':null},'defaults':{'channel':_0x11d853,'membername':_0x4a2c28[_0x7721('0x2f')]['name'],'interface':_[_0x7721('0x13')](_0x4a2c28[_0x7721('0x2f')]['interface'])?util[_0x7721('0x35')](_0x7721('0x38'),_0x4a2c28[_0x7721('0x2f')]['name']):_0x4a2c28[_0x7721('0x2f')]['interface'],'type':_0x7721('0x39'),'enterAt':moment()[_0x7721('0x35')](_0x7721('0x3a')),'role':_0x7721('0x3b'),'internal':_0x4a2c28[_0x7721('0x2f')][_0x7721('0x3c')],'uniqueid':_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')][_0x11d853][_0x219c9f]}});}}}}return respondWithRpcPromise(_0x7721('0x3d'),{'id':_0x4a2c28[_0x7721('0x1b')]['id'],'capacity':_0x4a2c28[_0x7721('0x2d')][_0x7721('0x3e')]},routingClient)[_0x7721('0x9')](respondWithResult(_0xaa3216,null))[_0x7721('0xe')](handleError(_0xaa3216,null));};exports[_0x7721('0x3f')]=function(_0x5b741d,_0x474f32){return respondWithRpcPromise(_0x7721('0x40'),_0x5b741d[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x474f32,null))[_0x7721('0xe')](handleError(_0x474f32,null));};exports[_0x7721('0x41')]=function(_0x267f5e,_0x57484c){return respondWithRpcPromise(_0x7721('0x42'),_0x267f5e[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x57484c,null))[_0x7721('0xe')](handleError(_0x57484c,null));};exports[_0x7721('0x43')]=function(_0x9c0d4,_0x7fbd6c){return respondWithRpcPromise(_0x7721('0x44'),_0x9c0d4[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x7fbd6c,null))[_0x7721('0xe')](handleError(_0x7fbd6c,null));};exports['chatQueues']=function(_0x421c27,_0xadb365){return respondWithRpcPromise(_0x7721('0x45'),_0x421c27[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0xadb365,null))[_0x7721('0xe')](handleError(_0xadb365,null));};exports[_0x7721('0x46')]=function(_0x36fe6f,_0x360882){return respondWithRpcPromise(_0x7721('0x45'),_0x36fe6f[_0x7721('0x17')],routingClient)[_0x7721('0x9')](findById(_0x36fe6f[_0x7721('0x1b')]['id']))[_0x7721('0x9')](respondWithResult(_0x360882,null))[_0x7721('0xe')](handleError(_0x360882,null));};exports['mailQueues']=function(_0x50e9e9,_0x4e112e){return respondWithRpcPromise(_0x7721('0x47'),_0x50e9e9['query'],routingClient)['then'](respondWithResult(_0x4e112e,null))['catch'](handleError(_0x4e112e,null));};exports['showMailQueues']=function(_0x47925a,_0x219181){return respondWithRpcPromise(_0x7721('0x47'),_0x47925a['query'],routingClient)[_0x7721('0x9')](findById(_0x47925a['params']['id']))['then'](respondWithResult(_0x219181,null))['catch'](handleError(_0x219181,null));};exports[_0x7721('0x48')]=function(_0x4f0d38,_0x48e7e3){return respondWithRpcPromise('MailAccounts',_0x4f0d38[_0x7721('0x17')],mailClient)[_0x7721('0x9')](respondWithResult(_0x48e7e3,null))[_0x7721('0xe')](handleError(_0x48e7e3,null));};exports['openchannelQueues']=function(_0x2a025c,_0x1f1890){return respondWithRpcPromise(_0x7721('0x49'),_0x2a025c[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0x1f1890,null))[_0x7721('0xe')](handleError(_0x1f1890,null));};exports[_0x7721('0x4a')]=function(_0x3e3301,_0x127f46){return respondWithRpcPromise(_0x7721('0x49'),_0x3e3301[_0x7721('0x17')],routingClient)[_0x7721('0x9')](findById(_0x3e3301[_0x7721('0x1b')]['id']))[_0x7721('0x9')](respondWithResult(_0x127f46,null))[_0x7721('0xe')](handleError(_0x127f46,null));};exports['smsQueues']=function(_0x233e5d,_0x2c93b0){return respondWithRpcPromise(_0x7721('0x4b'),_0x233e5d[_0x7721('0x17')],routingClient)['then'](respondWithResult(_0x2c93b0,null))[_0x7721('0xe')](handleError(_0x2c93b0,null));};exports[_0x7721('0x4c')]=function(_0x4c8284,_0x3e7df3){return respondWithRpcPromise('SmsQueues',_0x4c8284[_0x7721('0x17')],routingClient)[_0x7721('0x9')](findById(_0x4c8284[_0x7721('0x1b')]['id']))[_0x7721('0x9')](respondWithResult(_0x3e7df3,null))[_0x7721('0xe')](handleError(_0x3e7df3,null));};exports[_0x7721('0x4d')]=function(_0x3121e0,_0x167ce7){return respondWithRpcPromise(_0x7721('0x4e'),_0x3121e0['query'],routingClient)[_0x7721('0x9')](respondWithResult(_0x167ce7,null))[_0x7721('0xe')](handleError(_0x167ce7,null));};exports[_0x7721('0x4f')]=function(_0x3a11e2,_0x56a988){return respondWithRpcPromise(_0x7721('0x4e'),_0x3a11e2[_0x7721('0x17')],routingClient)['then'](findById(_0x3a11e2[_0x7721('0x1b')]['id']))[_0x7721('0x9')](respondWithResult(_0x56a988,null))['catch'](handleError(_0x56a988,null));};exports[_0x7721('0x50')]=function(_0x565c49,_0x14b543){return respondWithRpcPromise(_0x7721('0x51'),_0x565c49[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0x14b543,null))[_0x7721('0xe')](handleError(_0x14b543,null));};exports[_0x7721('0x52')]=function(_0x258c57,_0x5dca04){return respondWithRpcPromise(_0x7721('0x51'),_0x258c57[_0x7721('0x17')],routingClient)[_0x7721('0x9')](findById(_0x258c57['params']['id']))['then'](respondWithResult(_0x5dca04,null))['catch'](handleError(_0x5dca04,null));};exports['faxAccounts']=function(_0x5e966f,_0x1fc5f7){return respondWithRpcPromise(_0x7721('0x53'),_0x5e966f['query'])[_0x7721('0x9')](respondWithResult(_0x1fc5f7,null))[_0x7721('0xe')](handleError(_0x1fc5f7,null));};exports[_0x7721('0x54')]=function(_0x4593e1,_0x53ebb1){return respondWithRpcPromise(_0x7721('0x55'),_0x4593e1[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0x53ebb1,null))[_0x7721('0xe')](handleError(_0x53ebb1,null));};exports[_0x7721('0x56')]=function(_0x53adb1,_0x29ac64){return respondWithRpcPromise(_0x7721('0x57'),_0x53adb1[_0x7721('0x17')],routingClient)['then'](respondWithResult(_0x29ac64,null))['catch'](handleError(_0x29ac64,null));};exports[_0x7721('0x58')]=function(_0x752564,_0x423040){return respondWithRpcPromise(_0x7721('0x59'),_0x752564[_0x7721('0x17')],routingClient)['then'](respondWithResult(_0x423040,null))['catch'](handleError(_0x423040,null));};exports[_0x7721('0x5a')]=function(_0x1bd97e,_0x68de4){return respondWithRpcPromise(_0x7721('0x59'),_0x1bd97e[_0x7721('0x17')],routingClient)[_0x7721('0x9')](function(_0x34187f){if(_0x1bd97e['query'][_0x7721('0x5b')]!==undefined){var _0x413185=_(_0x34187f[_0x7721('0x5c')])['filter']([_0x1bd97e[_0x7721('0x17')][_0x7721('0x5b')],_0x1bd97e[_0x7721('0x1b')]['id']])[_0x7721('0x5d')]('queue_id')['uniq']()[_0x7721('0x5e')]();return _0x34187f[_0x7721('0x5c')][_0x7721('0x5f')](function(_0x42c849){return _0x413185[_0x7721('0x60')](_0x42c849[_0x7721('0x61')])>-0x1;});}else{return _0x34187f['rows'][_0x7721('0x5f')](function(_0x42bb5a){return _0x42bb5a[_0x7721('0x61')]===parseInt(_0x1bd97e['params']['id']);});}})[_0x7721('0x9')](respondWithResult(_0x68de4,null))[_0x7721('0xe')](handleError(_0x68de4,null));};exports[_0x7721('0x62')]=function(_0xc20188,_0x457d7f){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0xc20188[_0x7721('0x17')],routingClient)['then'](respondWithResult(_0x457d7f,null))[_0x7721('0xe')](handleError(_0x457d7f,null));};exports[_0x7721('0x63')]=function(_0x2d5433,_0x7f0598){return respondWithRpcPromise(_0x7721('0x64'),_0x2d5433[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0x7f0598,null))[_0x7721('0xe')](handleError(_0x7f0598,null));};exports[_0x7721('0x65')]=function(_0x3b78f5,_0x2c74d8){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x3b78f5[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0x2c74d8,null))[_0x7721('0xe')](handleError(_0x2c74d8,null));};exports['queueNotify']=function(_0x94af20){return function(_0x26b2cc,_0x139517){var _0xc9761e,_0xcd9f0d;var _0x594059=_[_0x7721('0x66')](_0x94af20);var _0x22f15a=_0x94af20===_0x7721('0x67')?_0x7721('0x68'):_0x7721('0x69');return db[_0x594059+_0x7721('0x6a')]['findOne']({'raw':!![],'where':{'id':_0x26b2cc[_0x7721('0x1b')]['id']}})[_0x7721('0x9')](function(_0x480a03){if(_[_0x7721('0x13')](_0x480a03)){throw new Error(_0x594059+'\x20Queue\x20not\x20found');}_0xc9761e=_0x480a03;return db[_0x594059+_0x7721('0x6b')][_0x7721('0x6c')]({'where':{'id':_0x26b2cc['body'][_0x7721('0x6d')]},'include':[{'model':db[_0x594059+'Interaction'],'as':'Interaction'},{'model':db[_0x594059+_0x22f15a],'as':'Account'}]});})[_0x7721('0x9')](function(_0x20f12e){if(_[_0x7721('0x13')](_0x20f12e)){throw new Error(_0x594059+'\x20Message\x20not\x20found');}_0xcd9f0d=_0x20f12e;return _0x20f12e['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x355aa8={'uniqueid':_0x94af20+'.'+_0xcd9f0d['id']+'.'+_0xcd9f0d[_0x7721('0x6e')]['id'],'FromUserId':_0x26b2cc[_0x7721('0x2f')]['id'],'type':_0x7721('0x6f')};_0x355aa8[_0x594059+_0x7721('0x70')]=_0xcd9f0d['id'];_0x355aa8[_0x594059+_0x7721('0x71')]=_0xcd9f0d['Interaction']['id'];_0x355aa8[_0x7721('0x72')+_0x594059+_0x22f15a+'Id']=_0xcd9f0d[_0x7721('0x69')]['id'];_0x355aa8['To'+_0x594059+_0x7721('0x73')]=_0xc9761e['id'];return db[_0x594059+_0x7721('0x74')][_0x7721('0x75')](_0x355aa8);})[_0x7721('0x9')](function(){return respondWithRpcPromise(_0x7721('0x76'),{'channel':_0x94af20,'interaction':_0xcd9f0d[_0x7721('0x6e')],'message':_0xcd9f0d,'account':_0xcd9f0d[_0x7721('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7721('0x6f'),'appdata':_0xc9761e[_0x7721('0x30')]+','+(_0xcd9f0d[_0x7721('0x69')]['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x7721('0x9')](respondWithResult(_0x139517,null))[_0x7721('0xe')](handleError(_0x139517,null));};};exports['agentNotify']=function(_0x167e05,_0x570cf4){var _0x4e3c93,_0x154b4b;if(_['isNil'](_0x167e05['body'][_0x7721('0x77')])){throw new Error(_0x7721('0x78'));}var _0x28e123=_0x167e05[_0x7721('0x2d')][_0x7721('0x77')];var _0x494c5e=_[_0x7721('0x66')](_0x28e123);var _0xcf2c06=_0x28e123===_0x7721('0x67')?_0x7721('0x68'):'Account';return db['User'][_0x7721('0x6c')]({'raw':!![],'where':{'id':_0x167e05[_0x7721('0x1b')]['id'],'role':'agent'}})[_0x7721('0x9')](function(_0x13dc8a){if(_['isNil'](_0x13dc8a)){throw new Error('Agent\x20not\x20found');}_0x4e3c93=_0x13dc8a;return db[_0x494c5e+_0x7721('0x6b')][_0x7721('0x6c')]({'where':{'id':_0x167e05[_0x7721('0x2d')][_0x7721('0x6d')]},'include':[{'model':db[_0x494c5e+_0x7721('0x6e')],'as':_0x7721('0x6e')},{'model':db[_0x494c5e+_0xcf2c06],'as':_0x7721('0x69')}]});})[_0x7721('0x9')](function(_0x59de30){if(_[_0x7721('0x13')](_0x59de30)){throw new Error(_0x494c5e+_0x7721('0x79'));}_0x154b4b=_0x59de30;return _0x59de30[_0x7721('0x7a')]({'read':0x0,'readAt':null,'UserId':null});})[_0x7721('0x9')](function(){var _0xe1c795={'uniqueid':_0x28e123+'.'+_0x154b4b['id']+'.'+_0x154b4b[_0x7721('0x6e')]['id'],'FromUserId':_0x167e05[_0x7721('0x2f')]['id'],'type':'queue','ToUserId':_0x4e3c93['id']};_0xe1c795[_0x494c5e+_0x7721('0x70')]=_0x154b4b['id'];_0xe1c795[_0x494c5e+_0x7721('0x71')]=_0x154b4b['Interaction']['id'];_0xe1c795[_0x7721('0x72')+_0x494c5e+_0xcf2c06+'Id']=_0x154b4b[_0x7721('0x69')]['id'];return db[_0x494c5e+_0x7721('0x74')][_0x7721('0x75')](_0xe1c795);})[_0x7721('0x9')](function(){return respondWithRpcPromise(_0x7721('0x76'),{'channel':_0x28e123,'interaction':_0x154b4b[_0x7721('0x6e')],'message':_0x154b4b,'account':_0x154b4b[_0x7721('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7721('0x3b'),'appdata':_0x4e3c93[_0x7721('0x30')]+','+(_0x154b4b['Account'][_0x7721('0x7b')]||0x12c),'interval':_0x7721('0x7c')}]},routingClient);})[_0x7721('0x9')](respondWithResult(_0x570cf4,null))[_0x7721('0xe')](handleError(_0x570cf4,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index fb4f3c4..73c3c22 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 _0x5202=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','/:id','show','get','/:id/run','run','post'];(function(_0xb6b444,_0x3922cc){var _0x344d57=function(_0x5e5f0b){while(--_0x5e5f0b){_0xb6b444['push'](_0xb6b444['shift']());}};_0x344d57(++_0x3922cc);}(_0x5202,0x130));var _0x2520=function(_0x1e516f,_0x456c3f){_0x1e516f=_0x1e516f-0x0;var _0x21688f=_0x5202[_0x1e516f];return _0x21688f;};'use strict';var multer=require(_0x2520('0x0'));var util=require(_0x2520('0x1'));var path=require(_0x2520('0x2'));var timeout=require(_0x2520('0x3'));var express=require(_0x2520('0x4'));var router=express[_0x2520('0x5')]();var fs_extra=require(_0x2520('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2520('0x7'));var config=require(_0x2520('0x8'));var controller=require(_0x2520('0x9'));router['get']('/',auth[_0x2520('0xa')](),controller[_0x2520('0xb')]);router['get'](_0x2520('0xc'),auth[_0x2520('0xa')](),controller[_0x2520('0xd')]);router[_0x2520('0xe')](_0x2520('0xf'),auth[_0x2520('0xa')](),controller[_0x2520('0x10')]);router[_0x2520('0x11')]('/',auth['isAuthenticated'](),controller[_0x2520('0x12')]);router[_0x2520('0x13')](_0x2520('0xc'),auth[_0x2520('0xa')](),controller[_0x2520('0x14')]);router['delete'](_0x2520('0xc'),auth['isAuthenticated'](),controller[_0x2520('0x15')]);module[_0x2520('0x16')]=router; \ No newline at end of file +var _0x7e8a=['get','index','/:id','show','/:id/run','run','isAuthenticated','create','put','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7e8a,0x1c4));var _0xa7e8=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x7e8a[_0x7e2eb0];return _0xd92de4;};'use strict';var multer=require(_0xa7e8('0x0'));var util=require('util');var path=require(_0xa7e8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa7e8('0x2'));var auth=require(_0xa7e8('0x3'));var interaction=require(_0xa7e8('0x4'));var config=require(_0xa7e8('0x5'));var controller=require(_0xa7e8('0x6'));router[_0xa7e8('0x7')]('/',auth['isAuthenticated'](),controller[_0xa7e8('0x8')]);router[_0xa7e8('0x7')](_0xa7e8('0x9'),auth['isAuthenticated'](),controller[_0xa7e8('0xa')]);router[_0xa7e8('0x7')](_0xa7e8('0xb'),auth['isAuthenticated'](),controller[_0xa7e8('0xc')]);router['post']('/',auth[_0xa7e8('0xd')](),controller[_0xa7e8('0xe')]);router[_0xa7e8('0xf')](_0xa7e8('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xa7e8('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xa7e8('0x10')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index e353532..a08ba29 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 _0xbb7c=['default','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months','weeks','minutes','days','csv','pdf','xlsx'];(function(_0x6c4fbf,_0x5b9391){var _0x6fb1cc=function(_0x18109c){while(--_0x18109c){_0x6c4fbf['push'](_0x6c4fbf['shift']());}};_0x6fb1cc(++_0x5b9391);}(_0xbb7c,0x68));var _0xcbb7=function(_0xbddcd1,_0x5b2b5b){_0xbddcd1=_0xbddcd1-0x0;var _0x4141e3=_0xbb7c[_0xbddcd1];return _0x4141e3;};'use strict';var Sequelize=require(_0xcbb7('0x0'));module['exports']={'name':{'type':Sequelize[_0xcbb7('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xcbb7('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xcbb7('0x1')],'allowNull':![],'defaultValue':_0xcbb7('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xcbb7('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xcbb7('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xcbb7('0x6')]('years',_0xcbb7('0x7'),_0xcbb7('0x8'),_0xcbb7('0x9'),'days','hours',_0xcbb7('0xa')),'allowNull':![],'defaultValue':_0xcbb7('0xb')},'output':{'type':Sequelize['ENUM'](_0xcbb7('0xc'),_0xcbb7('0xd'),_0xcbb7('0xe')),'allowNull':![],'defaultValue':_0xcbb7('0xc')},'type':{'type':Sequelize[_0xcbb7('0x6')]('custom',_0xcbb7('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xcbb7('0x1')]},'cc':{'type':Sequelize[_0xcbb7('0x10')]},'bcc':{'type':Sequelize[_0xcbb7('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xcbb7('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe5b7=['STRING','BOOLEAN','DATE','INTEGER','years','quarters','months','days','hours','minutes','ENUM','csv','pdf','xlsx','custom','default','TEXT','sequelize'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xe5b7,0x7d));var _0x7e5b=function(_0x3fc040,_0x2b7014){_0x3fc040=_0x3fc040-0x0;var _0x1e7ddc=_0xe5b7[_0x3fc040];return _0x1e7ddc;};'use strict';var Sequelize=require(_0x7e5b('0x0'));module['exports']={'name':{'type':Sequelize[_0x7e5b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7e5b('0x1')]},'active':{'type':Sequelize[_0x7e5b('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x7e5b('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x7e5b('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x7e5b('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x7e5b('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x7e5b('0x5'),_0x7e5b('0x6'),_0x7e5b('0x7'),'weeks',_0x7e5b('0x8'),_0x7e5b('0x9'),_0x7e5b('0xa')),'allowNull':![],'defaultValue':_0x7e5b('0x8')},'output':{'type':Sequelize[_0x7e5b('0xb')](_0x7e5b('0xc'),_0x7e5b('0xd'),_0x7e5b('0xe')),'allowNull':![],'defaultValue':_0x7e5b('0xc')},'type':{'type':Sequelize['ENUM'](_0x7e5b('0xf'),_0x7e5b('0x10')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x7e5b('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x7e5b('0x1')]},'cc':{'type':Sequelize[_0x7e5b('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x7e5b('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 3bb4e6b..210074a 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 _0x159e=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','reject','save','then','get','Scheduler','UserProfileResource','error','name','send','Schedule','rawAttributes','type','model','map','query','attributes','fields','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','count','include','rows','catch','show','params','keys','intersection','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x54a3d3,_0x2ac71e){var _0x273c2f=function(_0x37be79){while(--_0x37be79){_0x54a3d3['push'](_0x54a3d3['shift']());}};_0x273c2f(++_0x2ac71e);}(_0x159e,0xf8));var _0xe159=function(_0x3fafe7,_0x34b42b){_0x3fafe7=_0x3fafe7-0x0;var _0x58eeb7=_0x159e[_0x3fafe7];return _0x58eeb7;};'use strict';var emlformat=require(_0xe159('0x0'));var rimraf=require(_0xe159('0x1'));var zipdir=require(_0xe159('0x2'));var jsonpatch=require(_0xe159('0x3'));var rp=require(_0xe159('0x4'));var moment=require(_0xe159('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe159('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe159('0x7'));var fs=require('fs');var fs_extra=require(_0xe159('0x8'));var _=require('lodash');var squel=require(_0xe159('0x9'));var crypto=require('crypto');var jsforce=require(_0xe159('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe159('0xb'));var Papa=require(_0xe159('0xc'));var Redis=require(_0xe159('0xd'));var authService=require(_0xe159('0xe'));var qs=require(_0xe159('0xf'));var as=require(_0xe159('0x10'));var hardwareService=require(_0xe159('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xe159('0x12'));var config=require(_0xe159('0x13'));var licenseUtil=require(_0xe159('0x14'));var db=require(_0xe159('0x15'))['db'];function respondWithStatusCode(_0x1219a9,_0x2e0455){_0x2e0455=_0x2e0455||0xcc;return function(_0x33de95){if(_0x33de95){return _0x1219a9[_0xe159('0x16')](_0x2e0455);}return _0x1219a9['status'](_0x2e0455)[_0xe159('0x17')]();};}function respondWithResult(_0x4b7672,_0x794c20){_0x794c20=_0x794c20||0xc8;return function(_0x1662df){if(_0x1662df){return _0x4b7672[_0xe159('0x18')](_0x794c20)['json'](_0x1662df);}};}function respondWithFilteredResult(_0x2a8391,_0x259d69){return function(_0x2e93f2){if(_0x2e93f2){var _0x44381c=typeof _0x259d69[_0xe159('0x19')]===_0xe159('0x1a')&&typeof _0x259d69[_0xe159('0x1b')]===_0xe159('0x1a');var _0x44d77f=_0x2e93f2['count'];var _0x915b1=_0x44381c?0x0:_0x259d69[_0xe159('0x19')];var _0x3b8cbb=_0x44381c?_0x2e93f2['count']:_0x259d69[_0xe159('0x19')]+_0x259d69[_0xe159('0x1b')];var _0x4a84ba;if(_0x3b8cbb>=_0x44d77f){_0x3b8cbb=_0x44d77f;_0x4a84ba=0xc8;}else{_0x4a84ba=0xce;}_0x2a8391[_0xe159('0x18')](_0x4a84ba);return _0x2a8391[_0xe159('0x1c')](_0xe159('0x1d'),_0x915b1+'-'+_0x3b8cbb+'/'+_0x44d77f)[_0xe159('0x1e')](_0x2e93f2);}return null;};}function patchUpdates(_0x3a023b){return function(_0x971ac0){try{jsonpatch['apply'](_0x971ac0,_0x3a023b,!![]);}catch(_0x5077a2){return BPromise[_0xe159('0x1f')](_0x5077a2);}return _0x971ac0[_0xe159('0x20')]();};}function saveUpdates(_0x56137c,_0x5bfa55){return function(_0xb8e41f){if(_0xb8e41f){return _0xb8e41f['update'](_0x56137c)[_0xe159('0x21')](function(_0x2b06c2){return _0x2b06c2;});}return null;};}function removeEntity(_0x4f904d,_0x56fed4){return function(_0x12f684){if(_0x12f684){return _0x12f684['destroy']()[_0xe159('0x21')](function(){var _0x2dad52=_0x12f684[_0xe159('0x22')]({'plain':!![]});var _0x20e4db=_0xe159('0x23');return db[_0xe159('0x24')]['destroy']({'where':{'type':_0x20e4db,'resourceId':_0x2dad52['id']}})[_0xe159('0x21')](function(){return _0x12f684;});})[_0xe159('0x21')](function(){_0x4f904d[_0xe159('0x18')](0xcc)[_0xe159('0x17')]();});}};}function handleEntityNotFound(_0x4c1f7b,_0x2450b5){return function(_0x1ca7e1){if(!_0x1ca7e1){_0x4c1f7b[_0xe159('0x16')](0x194);}return _0x1ca7e1;};}function handleError(_0xba93f3,_0x21a1da){_0x21a1da=_0x21a1da||0x1f4;return function(_0x471fa8){logger[_0xe159('0x25')](_0x471fa8['stack']);if(_0x471fa8[_0xe159('0x26')]){delete _0x471fa8['name'];}_0xba93f3[_0xe159('0x18')](_0x21a1da)[_0xe159('0x27')](_0x471fa8);};}exports['index']=function(_0x42754b,_0x4acc09){var _0x3ca448={},_0x42a3e3={},_0x1ccd87={'count':0x0,'rows':[]};var _0x59d58f=_['map'](db[_0xe159('0x28')][_0xe159('0x29')],function(_0x23471d){return{'name':_0x23471d['fieldName'],'type':_0x23471d[_0xe159('0x2a')]['key']};});_0x42a3e3[_0xe159('0x2b')]=_[_0xe159('0x2c')](_0x59d58f,_0xe159('0x26'));_0x42a3e3[_0xe159('0x2d')]=_['keys'](_0x42754b['query']);_0x42a3e3['filters']=_['intersection'](_0x42a3e3['model'],_0x42a3e3[_0xe159('0x2d')]);_0x3ca448[_0xe159('0x2e')]=_['intersection'](_0x42a3e3[_0xe159('0x2b')],qs[_0xe159('0x2f')](_0x42754b['query'][_0xe159('0x2f')]));_0x3ca448[_0xe159('0x2e')]=_0x3ca448[_0xe159('0x2e')]['length']?_0x3ca448[_0xe159('0x2e')]:_0x42a3e3['model'];if(!_0x42754b[_0xe159('0x2d')]['hasOwnProperty'](_0xe159('0x30'))){_0x3ca448[_0xe159('0x1b')]=qs['limit'](_0x42754b[_0xe159('0x2d')][_0xe159('0x1b')]);_0x3ca448[_0xe159('0x19')]=qs[_0xe159('0x19')](_0x42754b[_0xe159('0x2d')][_0xe159('0x19')]);}_0x3ca448['order']=qs[_0xe159('0x31')](_0x42754b[_0xe159('0x2d')]['sort']);_0x3ca448[_0xe159('0x32')]=qs[_0xe159('0x33')](_[_0xe159('0x34')](_0x42754b['query'],_0x42a3e3[_0xe159('0x33')]),_0x59d58f);if(_0x42754b[_0xe159('0x2d')]['filter']){_0x3ca448[_0xe159('0x32')]=_['merge'](_0x3ca448[_0xe159('0x32')],{'$or':_[_0xe159('0x2c')](_0x59d58f,function(_0x4a7f15){if(_0x4a7f15[_0xe159('0x2a')]!==_0xe159('0x35')){var _0x3356c6={};_0x3356c6[_0x4a7f15[_0xe159('0x26')]]={'$like':'%'+_0x42754b['query'][_0xe159('0x36')]+'%'};return _0x3356c6;}})});}_0x3ca448=_[_0xe159('0x37')]({},_0x3ca448,_0x42754b[_0xe159('0x38')]);var _0x242f68={'where':_0x3ca448[_0xe159('0x32')]};return db[_0xe159('0x28')][_0xe159('0x39')](_0x242f68)['then'](function(_0x26abcb){_0x1ccd87['count']=_0x26abcb;if(_0x42754b[_0xe159('0x2d')]['includeAll']){_0x3ca448[_0xe159('0x3a')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x3ca448);})[_0xe159('0x21')](function(_0x2b6e5e){_0x1ccd87[_0xe159('0x3b')]=_0x2b6e5e;return _0x1ccd87;})[_0xe159('0x21')](respondWithFilteredResult(_0x4acc09,_0x3ca448))[_0xe159('0x3c')](handleError(_0x4acc09,null));};exports[_0xe159('0x3d')]=function(_0x4a6a16,_0x88f5e1){var _0x309257={'raw':![],'where':{'id':_0x4a6a16[_0xe159('0x3e')]['id']}},_0x4ae4b9={};_0x4ae4b9[_0xe159('0x2b')]=_[_0xe159('0x3f')](db['Schedule'][_0xe159('0x29')]);_0x4ae4b9[_0xe159('0x2d')]=_['keys'](_0x4a6a16[_0xe159('0x2d')]);_0x4ae4b9[_0xe159('0x33')]=_[_0xe159('0x40')](_0x4ae4b9['model'],_0x4ae4b9[_0xe159('0x2d')]);_0x309257[_0xe159('0x2e')]=_[_0xe159('0x40')](_0x4ae4b9['model'],qs['fields'](_0x4a6a16[_0xe159('0x2d')][_0xe159('0x2f')]));_0x309257[_0xe159('0x2e')]=_0x309257['attributes'][_0xe159('0x41')]?_0x309257[_0xe159('0x2e')]:_0x4ae4b9[_0xe159('0x2b')];if(_0x4a6a16['query'][_0xe159('0x42')]){_0x309257['include']=[{'all':!![]}];}_0x309257=_['merge']({},_0x309257,_0x4a6a16[_0xe159('0x38')]);return db[_0xe159('0x28')][_0xe159('0x43')](_0x309257)[_0xe159('0x21')](handleEntityNotFound(_0x88f5e1,null))['then'](respondWithResult(_0x88f5e1,null))[_0xe159('0x3c')](handleError(_0x88f5e1,null));};exports[_0xe159('0x44')]=function(_0x1b8f6c,_0x35892b){return db[_0xe159('0x28')][_0xe159('0x44')](_0x1b8f6c[_0xe159('0x45')],{})[_0xe159('0x21')](function(_0x1a8130){var _0x3174dc=_0x1b8f6c[_0xe159('0x46')]['get']({'plain':!![]});if(!_0x3174dc)throw new Error(_0xe159('0x47'));if(_0x3174dc[_0xe159('0x48')]==='user'){var _0x3dd134=_0x1a8130[_0xe159('0x22')]({'plain':!![]});var _0x149859='Scheduler';return db[_0xe159('0x49')][_0xe159('0x43')]({'where':{'name':_0x149859,'userProfileId':_0x3174dc[_0xe159('0x4a')]},'raw':!![]})[_0xe159('0x21')](function(_0x40f1a6){if(_0x40f1a6&&_0x40f1a6[_0xe159('0x4b')]===0x0){return db[_0xe159('0x24')]['create']({'name':_0x3dd134['name'],'resourceId':_0x3dd134['id'],'type':_0x40f1a6[_0xe159('0x26')],'sectionId':_0x40f1a6['id']},{})[_0xe159('0x21')](function(){return _0x1a8130;});}else{return _0x1a8130;}})[_0xe159('0x3c')](function(_0x52c1a9){logger['error'](_0xe159('0x4c'),_0x52c1a9);throw _0x52c1a9;});}return _0x1a8130;})[_0xe159('0x21')](respondWithResult(_0x35892b,0xc9))[_0xe159('0x3c')](handleError(_0x35892b,null));};exports[_0xe159('0x4d')]=function(_0x46736e,_0xc10f58){if(_0x46736e[_0xe159('0x45')]['id']){delete _0x46736e[_0xe159('0x45')]['id'];}return db[_0xe159('0x28')][_0xe159('0x43')]({'where':{'id':_0x46736e[_0xe159('0x3e')]['id']}})['then'](handleEntityNotFound(_0xc10f58,null))[_0xe159('0x21')](saveUpdates(_0x46736e[_0xe159('0x45')],null))[_0xe159('0x21')](respondWithResult(_0xc10f58,null))[_0xe159('0x3c')](handleError(_0xc10f58,null));};exports[_0xe159('0x4e')]=function(_0x2c5b13,_0x53401f){return db[_0xe159('0x28')]['find']({'where':{'id':_0x2c5b13[_0xe159('0x3e')]['id']}})[_0xe159('0x21')](handleEntityNotFound(_0x53401f,null))['then'](removeEntity(_0x53401f,null))['catch'](handleError(_0x53401f,null));};exports[_0xe159('0x4f')]=function(_0x5a3e15,_0xf4b878,_0xdbe75f){var _0x4e7063=require(_0xe159('0x50'));return db[_0xe159('0x28')]['find']({'where':{'id':_0x5a3e15[_0xe159('0x3e')]['id']},'raw':!![]})[_0xe159('0x21')](handleEntityNotFound(_0xf4b878,null))[_0xe159('0x21')](function(){_0x4e7063[_0xe159('0x4f')](_0x5a3e15['params']['id']);})[_0xe159('0x21')](respondWithStatusCode(_0xf4b878,null))['catch'](handleError(_0xf4b878,null));}; \ No newline at end of file +var _0xe9f0=['json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Scheduler','error','stack','name','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','Schedule','includeAll','include','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x286f48,_0x2ac09c){var _0x3484b0=function(_0x4b2141){while(--_0x4b2141){_0x286f48['push'](_0x286f48['shift']());}};_0x3484b0(++_0x2ac09c);}(_0xe9f0,0xe4));var _0x0e9f=function(_0x4b0033,_0x214194){_0x4b0033=_0x4b0033-0x0;var _0xe1b652=_0xe9f0[_0x4b0033];return _0xe1b652;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e9f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e9f('0x1'));var rp=require('request-promise');var moment=require(_0x0e9f('0x2'));var BPromise=require(_0x0e9f('0x3'));var Mustache=require('mustache');var util=require(_0x0e9f('0x4'));var path=require(_0x0e9f('0x5'));var sox=require('sox');var csv=require(_0x0e9f('0x6'));var ejs=require(_0x0e9f('0x7'));var fs=require('fs');var fs_extra=require(_0x0e9f('0x8'));var _=require(_0x0e9f('0x9'));var squel=require('squel');var crypto=require(_0x0e9f('0xa'));var jsforce=require(_0x0e9f('0xb'));var deskjs=require(_0x0e9f('0xc'));var toCsv=require(_0x0e9f('0x6'));var querystring=require(_0x0e9f('0xd'));var Papa=require(_0x0e9f('0xe'));var Redis=require(_0x0e9f('0xf'));var authService=require(_0x0e9f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0e9f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e9f('0x12'))(_0x0e9f('0x13'));var utils=require(_0x0e9f('0x14'));var config=require(_0x0e9f('0x15'));var licenseUtil=require(_0x0e9f('0x16'));var db=require(_0x0e9f('0x17'))['db'];function respondWithStatusCode(_0x2e81ac,_0x50af0a){_0x50af0a=_0x50af0a||0xcc;return function(_0x9fa701){if(_0x9fa701){return _0x2e81ac[_0x0e9f('0x18')](_0x50af0a);}return _0x2e81ac[_0x0e9f('0x19')](_0x50af0a)[_0x0e9f('0x1a')]();};}function respondWithResult(_0x3754ef,_0x44274a){_0x44274a=_0x44274a||0xc8;return function(_0x5c2eb5){if(_0x5c2eb5){return _0x3754ef[_0x0e9f('0x19')](_0x44274a)[_0x0e9f('0x1b')](_0x5c2eb5);}};}function respondWithFilteredResult(_0x475a2,_0x1e6b47){return function(_0x5ae825){if(_0x5ae825){var _0x20a1ee=typeof _0x1e6b47[_0x0e9f('0x1c')]===_0x0e9f('0x1d')&&typeof _0x1e6b47[_0x0e9f('0x1e')]==='undefined';var _0x5a5d56=_0x5ae825[_0x0e9f('0x1f')];var _0x3c40df=_0x20a1ee?0x0:_0x1e6b47[_0x0e9f('0x1c')];var _0xf30106=_0x20a1ee?_0x5ae825[_0x0e9f('0x1f')]:_0x1e6b47[_0x0e9f('0x1c')]+_0x1e6b47[_0x0e9f('0x1e')];var _0x1b77da;if(_0xf30106>=_0x5a5d56){_0xf30106=_0x5a5d56;_0x1b77da=0xc8;}else{_0x1b77da=0xce;}_0x475a2[_0x0e9f('0x19')](_0x1b77da);return _0x475a2[_0x0e9f('0x20')]('Content-Range',_0x3c40df+'-'+_0xf30106+'/'+_0x5a5d56)[_0x0e9f('0x1b')](_0x5ae825);}return null;};}function patchUpdates(_0x29bf8b){return function(_0x525df7){try{jsonpatch[_0x0e9f('0x21')](_0x525df7,_0x29bf8b,!![]);}catch(_0x11f87e){return BPromise[_0x0e9f('0x22')](_0x11f87e);}return _0x525df7[_0x0e9f('0x23')]();};}function saveUpdates(_0x16bb21,_0x2fe97a){return function(_0x5a8805){if(_0x5a8805){return _0x5a8805[_0x0e9f('0x24')](_0x16bb21)[_0x0e9f('0x25')](function(_0x5b6a3c){return _0x5b6a3c;});}return null;};}function removeEntity(_0x5c9f18,_0x32aecb){return function(_0xac60a2){if(_0xac60a2){return _0xac60a2[_0x0e9f('0x26')]()[_0x0e9f('0x25')](function(){var _0x532e24=_0xac60a2[_0x0e9f('0x27')]({'plain':!![]});var _0x2b5544=_0x0e9f('0x28');return db['UserProfileResource'][_0x0e9f('0x26')]({'where':{'type':_0x2b5544,'resourceId':_0x532e24['id']}})[_0x0e9f('0x25')](function(){return _0xac60a2;});})[_0x0e9f('0x25')](function(){_0x5c9f18[_0x0e9f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a62bf,_0x1f3a92){return function(_0x35f6bd){if(!_0x35f6bd){_0x3a62bf[_0x0e9f('0x18')](0x194);}return _0x35f6bd;};}function handleError(_0x1e3a09,_0x44a634){_0x44a634=_0x44a634||0x1f4;return function(_0x496b56){logger[_0x0e9f('0x29')](_0x496b56[_0x0e9f('0x2a')]);if(_0x496b56['name']){delete _0x496b56[_0x0e9f('0x2b')];}_0x1e3a09[_0x0e9f('0x19')](_0x44a634)['send'](_0x496b56);};}exports[_0x0e9f('0x2c')]=function(_0x209acf,_0x112771){var _0x2b0d8f={},_0x5aa621={},_0x439c8f={'count':0x0,'rows':[]};var _0x293fc9=_['map'](db['Schedule'][_0x0e9f('0x2d')],function(_0x139b4d){return{'name':_0x139b4d[_0x0e9f('0x2e')],'type':_0x139b4d[_0x0e9f('0x2f')]['key']};});_0x5aa621[_0x0e9f('0x30')]=_['map'](_0x293fc9,'name');_0x5aa621[_0x0e9f('0x31')]=_[_0x0e9f('0x32')](_0x209acf[_0x0e9f('0x31')]);_0x5aa621[_0x0e9f('0x33')]=_[_0x0e9f('0x34')](_0x5aa621[_0x0e9f('0x30')],_0x5aa621[_0x0e9f('0x31')]);_0x2b0d8f['attributes']=_[_0x0e9f('0x34')](_0x5aa621['model'],qs[_0x0e9f('0x35')](_0x209acf[_0x0e9f('0x31')][_0x0e9f('0x35')]));_0x2b0d8f[_0x0e9f('0x36')]=_0x2b0d8f[_0x0e9f('0x36')][_0x0e9f('0x37')]?_0x2b0d8f[_0x0e9f('0x36')]:_0x5aa621[_0x0e9f('0x30')];if(!_0x209acf[_0x0e9f('0x31')][_0x0e9f('0x38')](_0x0e9f('0x39'))){_0x2b0d8f['limit']=qs[_0x0e9f('0x1e')](_0x209acf['query']['limit']);_0x2b0d8f[_0x0e9f('0x1c')]=qs[_0x0e9f('0x1c')](_0x209acf['query'][_0x0e9f('0x1c')]);}_0x2b0d8f[_0x0e9f('0x3a')]=qs['sort'](_0x209acf[_0x0e9f('0x31')][_0x0e9f('0x3b')]);_0x2b0d8f[_0x0e9f('0x3c')]=qs['filters'](_[_0x0e9f('0x3d')](_0x209acf[_0x0e9f('0x31')],_0x5aa621[_0x0e9f('0x33')]),_0x293fc9);if(_0x209acf[_0x0e9f('0x31')][_0x0e9f('0x3e')]){_0x2b0d8f['where']=_['merge'](_0x2b0d8f[_0x0e9f('0x3c')],{'$or':_[_0x0e9f('0x3f')](_0x293fc9,function(_0x53a66b){if(_0x53a66b[_0x0e9f('0x2f')]!==_0x0e9f('0x40')){var _0x1b10bb={};_0x1b10bb[_0x53a66b[_0x0e9f('0x2b')]]={'$like':'%'+_0x209acf[_0x0e9f('0x31')]['filter']+'%'};return _0x1b10bb;}})});}_0x2b0d8f=_[_0x0e9f('0x41')]({},_0x2b0d8f,_0x209acf[_0x0e9f('0x42')]);var _0x37575e={'where':_0x2b0d8f[_0x0e9f('0x3c')]};return db[_0x0e9f('0x43')]['count'](_0x37575e)[_0x0e9f('0x25')](function(_0x1760b7){_0x439c8f['count']=_0x1760b7;if(_0x209acf['query'][_0x0e9f('0x44')]){_0x2b0d8f[_0x0e9f('0x45')]=[{'all':!![]}];}return db[_0x0e9f('0x43')][_0x0e9f('0x46')](_0x2b0d8f);})['then'](function(_0x22a0ac){_0x439c8f[_0x0e9f('0x47')]=_0x22a0ac;return _0x439c8f;})[_0x0e9f('0x25')](respondWithFilteredResult(_0x112771,_0x2b0d8f))[_0x0e9f('0x48')](handleError(_0x112771,null));};exports['show']=function(_0x4a15f5,_0x53ddc1){var _0x1f9527={'raw':![],'where':{'id':_0x4a15f5['params']['id']}},_0x2ed15b={};_0x2ed15b[_0x0e9f('0x30')]=_[_0x0e9f('0x32')](db[_0x0e9f('0x43')][_0x0e9f('0x2d')]);_0x2ed15b[_0x0e9f('0x31')]=_['keys'](_0x4a15f5[_0x0e9f('0x31')]);_0x2ed15b[_0x0e9f('0x33')]=_[_0x0e9f('0x34')](_0x2ed15b['model'],_0x2ed15b['query']);_0x1f9527['attributes']=_[_0x0e9f('0x34')](_0x2ed15b[_0x0e9f('0x30')],qs[_0x0e9f('0x35')](_0x4a15f5[_0x0e9f('0x31')][_0x0e9f('0x35')]));_0x1f9527[_0x0e9f('0x36')]=_0x1f9527['attributes'][_0x0e9f('0x37')]?_0x1f9527['attributes']:_0x2ed15b[_0x0e9f('0x30')];if(_0x4a15f5[_0x0e9f('0x31')][_0x0e9f('0x44')]){_0x1f9527[_0x0e9f('0x45')]=[{'all':!![]}];}_0x1f9527=_[_0x0e9f('0x41')]({},_0x1f9527,_0x4a15f5[_0x0e9f('0x42')]);return db['Schedule'][_0x0e9f('0x49')](_0x1f9527)[_0x0e9f('0x25')](handleEntityNotFound(_0x53ddc1,null))[_0x0e9f('0x25')](respondWithResult(_0x53ddc1,null))[_0x0e9f('0x48')](handleError(_0x53ddc1,null));};exports[_0x0e9f('0x4a')]=function(_0x2ca411,_0x9c285a){return db[_0x0e9f('0x43')]['create'](_0x2ca411[_0x0e9f('0x4b')],{})[_0x0e9f('0x25')](function(_0x3f1230){var _0x453568=_0x2ca411[_0x0e9f('0x4c')][_0x0e9f('0x27')]({'plain':!![]});if(!_0x453568)throw new Error(_0x0e9f('0x4d'));if(_0x453568[_0x0e9f('0x4e')]===_0x0e9f('0x4c')){var _0x2eaebe=_0x3f1230[_0x0e9f('0x27')]({'plain':!![]});var _0x27101f=_0x0e9f('0x28');return db[_0x0e9f('0x4f')][_0x0e9f('0x49')]({'where':{'name':_0x27101f,'userProfileId':_0x453568[_0x0e9f('0x50')]},'raw':!![]})[_0x0e9f('0x25')](function(_0x44afad){if(_0x44afad&&_0x44afad['autoAssociation']===0x0){return db['UserProfileResource'][_0x0e9f('0x4a')]({'name':_0x2eaebe['name'],'resourceId':_0x2eaebe['id'],'type':_0x44afad[_0x0e9f('0x2b')],'sectionId':_0x44afad['id']},{})[_0x0e9f('0x25')](function(){return _0x3f1230;});}else{return _0x3f1230;}})[_0x0e9f('0x48')](function(_0x21a8e6){logger[_0x0e9f('0x29')](_0x0e9f('0x51'),_0x21a8e6);throw _0x21a8e6;});}return _0x3f1230;})[_0x0e9f('0x25')](respondWithResult(_0x9c285a,0xc9))['catch'](handleError(_0x9c285a,null));};exports[_0x0e9f('0x24')]=function(_0x531182,_0x39b366){if(_0x531182[_0x0e9f('0x4b')]['id']){delete _0x531182['body']['id'];}return db[_0x0e9f('0x43')][_0x0e9f('0x49')]({'where':{'id':_0x531182[_0x0e9f('0x52')]['id']}})[_0x0e9f('0x25')](handleEntityNotFound(_0x39b366,null))[_0x0e9f('0x25')](saveUpdates(_0x531182[_0x0e9f('0x4b')],null))[_0x0e9f('0x25')](respondWithResult(_0x39b366,null))[_0x0e9f('0x48')](handleError(_0x39b366,null));};exports[_0x0e9f('0x26')]=function(_0xf16e70,_0x438b29){return db[_0x0e9f('0x43')][_0x0e9f('0x49')]({'where':{'id':_0xf16e70[_0x0e9f('0x52')]['id']}})[_0x0e9f('0x25')](handleEntityNotFound(_0x438b29,null))[_0x0e9f('0x25')](removeEntity(_0x438b29,null))['catch'](handleError(_0x438b29,null));};exports[_0x0e9f('0x53')]=function(_0x2c0b19,_0x1dd162,_0x2704e1){var _0x51967e=require(_0x0e9f('0x54'));return db[_0x0e9f('0x43')][_0x0e9f('0x49')]({'where':{'id':_0x2c0b19[_0x0e9f('0x52')]['id']},'raw':!![]})[_0x0e9f('0x25')](handleEntityNotFound(_0x1dd162,null))[_0x0e9f('0x25')](function(){_0x51967e[_0x0e9f('0x53')](_0x2c0b19[_0x0e9f('0x52')]['id']);})[_0x0e9f('0x25')](respondWithStatusCode(_0x1dd162,null))['catch'](handleError(_0x1dd162,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 873b48c..7b8dd49 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 _0x5c5f=['define','Schedule','tools_schedules','util','../../config/logger','request-promise','rimraf','../../config/environment','./schedule.attributes','exports'];(function(_0x47be32,_0x253193){var _0x10027b=function(_0x4ba7d0){while(--_0x4ba7d0){_0x47be32['push'](_0x47be32['shift']());}};_0x10027b(++_0x253193);}(_0x5c5f,0x67));var _0xf5c5=function(_0x718b21,_0x165be5){_0x718b21=_0x718b21-0x0;var _0x3bf745=_0x5c5f[_0x718b21];return _0x3bf745;};'use strict';var _=require('lodash');var util=require(_0xf5c5('0x0'));var logger=require(_0xf5c5('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf5c5('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5c5('0x3'));var config=require(_0xf5c5('0x4'));var attributes=require(_0xf5c5('0x5'));module[_0xf5c5('0x6')]=function(_0x2a1e73,_0x2c7e78){return _0x2a1e73[_0xf5c5('0x7')](_0xf5c5('0x8'),attributes,{'tableName':_0xf5c5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1aec=['../../config/environment','exports','define','Schedule','tools_schedules','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4a6f4d,_0x2a7d99){var _0x45e425=function(_0x54e8b2){while(--_0x54e8b2){_0x4a6f4d['push'](_0x4a6f4d['shift']());}};_0x45e425(++_0x2a7d99);}(_0x1aec,0x1f3));var _0xc1ae=function(_0x1c9517,_0x3da8f3){_0x1c9517=_0x1c9517-0x0;var _0x3b8377=_0x1aec[_0x1c9517];return _0x3b8377;};'use strict';var _=require('lodash');var util=require(_0xc1ae('0x0'));var logger=require(_0xc1ae('0x1'))(_0xc1ae('0x2'));var moment=require(_0xc1ae('0x3'));var BPromise=require(_0xc1ae('0x4'));var rp=require(_0xc1ae('0x5'));var fs=require('fs');var path=require(_0xc1ae('0x6'));var rimraf=require(_0xc1ae('0x7'));var config=require(_0xc1ae('0x8'));var attributes=require('./schedule.attributes');module[_0xc1ae('0x9')]=function(_0x403e79,_0xcc8fc0){return _0x403e79[_0xc1ae('0xa')](_0xc1ae('0xb'),attributes,{'tableName':_0xc1ae('0xc'),'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 1e450dd..f4272eb 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 _0xae79=['Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0x3de5d3,_0x144d80){var _0xada515=function(_0xe78932){while(--_0xe78932){_0x3de5d3['push'](_0x3de5d3['shift']());}};_0xada515(++_0x144d80);}(_0xae79,0xc1));var _0x9ae7=function(_0x226860,_0x11ce22){_0x226860=_0x226860-0x0;var _0x2180da=_0xae79[_0x226860];return _0x2180da;};'use strict';var _=require(_0x9ae7('0x0'));var util=require(_0x9ae7('0x1'));var moment=require(_0x9ae7('0x2'));var BPromise=require('bluebird');var rs=require(_0x9ae7('0x3'));var fs=require('fs');var Redis=require(_0x9ae7('0x4'));var db=require(_0x9ae7('0x5'))['db'];var utils=require(_0x9ae7('0x6'));var logger=require(_0x9ae7('0x7'))(_0x9ae7('0x8'));var config=require('../../config/environment');var jayson=require(_0x9ae7('0x9'));var client=jayson['client'][_0x9ae7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45c28b,_0x546d62,_0x4bf9dd){return new BPromise(function(_0x1bbbf4,_0x382dd9){return client[_0x9ae7('0xb')](_0x45c28b,_0x4bf9dd)[_0x9ae7('0xc')](function(_0xa0cc56){logger[_0x9ae7('0xd')](_0x9ae7('0xe'),_0x546d62,_0x9ae7('0xf'));logger['debug'](_0x9ae7('0x10'),_0x546d62,_0x9ae7('0xf'),JSON[_0x9ae7('0x11')](_0xa0cc56));if(_0xa0cc56[_0x9ae7('0x12')]){if(_0xa0cc56['error'][_0x9ae7('0x13')]===0x1f4){logger[_0x9ae7('0x12')](_0x9ae7('0xe'),_0x546d62,_0xa0cc56[_0x9ae7('0x12')]['message']);return _0x382dd9(_0xa0cc56[_0x9ae7('0x12')][_0x9ae7('0x14')]);}logger[_0x9ae7('0x12')](_0x9ae7('0xe'),_0x546d62,_0xa0cc56[_0x9ae7('0x12')][_0x9ae7('0x14')]);return _0x1bbbf4(_0xa0cc56['error'][_0x9ae7('0x14')]);}else{logger[_0x9ae7('0xd')]('Schedule,\x20%s,\x20%s',_0x546d62,_0x9ae7('0xf'));_0x1bbbf4(_0xa0cc56[_0x9ae7('0x15')]['message']);}})[_0x9ae7('0x16')](function(_0x4c6440){logger[_0x9ae7('0x12')](_0x9ae7('0xe'),_0x546d62,_0x4c6440);_0x382dd9(_0x4c6440);});});} \ No newline at end of file +var _0x8d19=['result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8d19,0x1e6));var _0x98d1=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0x8d19[_0x581af1];return _0x54c22e;};'use strict';var _=require('lodash');var util=require(_0x98d1('0x0'));var moment=require(_0x98d1('0x1'));var BPromise=require(_0x98d1('0x2'));var rs=require(_0x98d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x98d1('0x4'));var logger=require(_0x98d1('0x5'))(_0x98d1('0x6'));var config=require(_0x98d1('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x98d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x756b4,_0xc5c5c4,_0x113d14){return new BPromise(function(_0x3f9e2e,_0xeed28c){return client[_0x98d1('0x9')](_0x756b4,_0x113d14)[_0x98d1('0xa')](function(_0x388e2c){logger[_0x98d1('0xb')]('Schedule,\x20%s,\x20%s',_0xc5c5c4,_0x98d1('0xc'));logger[_0x98d1('0xd')](_0x98d1('0xe'),_0xc5c5c4,'request\x20sent',JSON[_0x98d1('0xf')](_0x388e2c));if(_0x388e2c[_0x98d1('0x10')]){if(_0x388e2c[_0x98d1('0x10')][_0x98d1('0x11')]===0x1f4){logger[_0x98d1('0x10')](_0x98d1('0x12'),_0xc5c5c4,_0x388e2c['error'][_0x98d1('0x13')]);return _0xeed28c(_0x388e2c['error'][_0x98d1('0x13')]);}logger['error']('Schedule,\x20%s,\x20%s',_0xc5c5c4,_0x388e2c['error'][_0x98d1('0x13')]);return _0x3f9e2e(_0x388e2c[_0x98d1('0x10')][_0x98d1('0x13')]);}else{logger[_0x98d1('0xb')](_0x98d1('0x12'),_0xc5c5c4,'request\x20sent');_0x3f9e2e(_0x388e2c[_0x98d1('0x14')]['message']);}})[_0x98d1('0x15')](function(_0x4909ed){logger[_0x98d1('0x10')](_0x98d1('0x12'),_0xc5c5c4,_0x4909ed);_0xeed28c(_0x4909ed);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 96159cd..f721496 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 _0x1747=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','describe','show','/:id/download','post','create','put','/:id','update'];(function(_0x27abf1,_0xbdce93){var _0x208ee4=function(_0x44e016){while(--_0x44e016){_0x27abf1['push'](_0x27abf1['shift']());}};_0x208ee4(++_0xbdce93);}(_0x1747,0x75));var _0x7174=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x1747[_0xda464c];return _0x19e222;};'use strict';var multer=require(_0x7174('0x0'));var util=require(_0x7174('0x1'));var path=require(_0x7174('0x2'));var timeout=require(_0x7174('0x3'));var express=require(_0x7174('0x4'));var router=express[_0x7174('0x5')]();var fs_extra=require(_0x7174('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7174('0x7'));var config=require(_0x7174('0x8'));var controller=require(_0x7174('0x9'));router[_0x7174('0xa')]('/',auth[_0x7174('0xb')](),controller[_0x7174('0xc')]);router[_0x7174('0xa')]('/describe',auth[_0x7174('0xb')](),controller[_0x7174('0xd')]);router[_0x7174('0xa')]('/:id',auth[_0x7174('0xb')](),controller[_0x7174('0xe')]);router[_0x7174('0xa')](_0x7174('0xf'),auth[_0x7174('0xb')](),controller['download']);router[_0x7174('0x10')]('/',auth['isAuthenticated'](),controller[_0x7174('0x11')]);router[_0x7174('0x12')](_0x7174('0x13'),auth['isAuthenticated'](),controller[_0x7174('0x14')]);router[_0x7174('0x15')]('/:id',auth[_0x7174('0xb')](),controller[_0x7174('0x16')]);module['exports']=router; \ No newline at end of file +var _0xebf8=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x37be7e,_0x538f6d){var _0x4cacb8=function(_0x22aa33){while(--_0x22aa33){_0x37be7e['push'](_0x37be7e['shift']());}};_0x4cacb8(++_0x538f6d);}(_0xebf8,0x183));var _0x8ebf=function(_0xdbce43,_0x3fe410){_0xdbce43=_0xdbce43-0x0;var _0x311415=_0xebf8[_0xdbce43];return _0x311415;};'use strict';var multer=require(_0x8ebf('0x0'));var util=require(_0x8ebf('0x1'));var path=require(_0x8ebf('0x2'));var timeout=require(_0x8ebf('0x3'));var express=require(_0x8ebf('0x4'));var router=express[_0x8ebf('0x5')]();var fs_extra=require(_0x8ebf('0x6'));var auth=require(_0x8ebf('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ebf('0x8'));var controller=require(_0x8ebf('0x9'));router[_0x8ebf('0xa')]('/',auth[_0x8ebf('0xb')](),controller['index']);router[_0x8ebf('0xa')](_0x8ebf('0xc'),auth[_0x8ebf('0xb')](),controller[_0x8ebf('0xd')]);router[_0x8ebf('0xa')](_0x8ebf('0xe'),auth[_0x8ebf('0xb')](),controller[_0x8ebf('0xf')]);router['get'](_0x8ebf('0x10'),auth['isAuthenticated'](),controller[_0x8ebf('0x11')]);router[_0x8ebf('0x12')]('/',auth[_0x8ebf('0xb')](),controller['create']);router['put'](_0x8ebf('0xe'),auth['isAuthenticated'](),controller[_0x8ebf('0x13')]);router[_0x8ebf('0x14')](_0x8ebf('0xe'),auth[_0x8ebf('0xb')](),controller[_0x8ebf('0x15')]);module[_0x8ebf('0x16')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index dccd3c2..42a1b3b 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 _0x0f97=['DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','INTEGER','setDataValue','duration'];(function(_0x3a94e1,_0x22e4fd){var _0x6a09d5=function(_0x2d6d1c){while(--_0x2d6d1c){_0x3a94e1['push'](_0x3a94e1['shift']());}};_0x6a09d5(++_0x22e4fd);}(_0x0f97,0x196));var _0x70f9=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0x0f97[_0x209fcd];return _0x501d5e;};'use strict';var Sequelize=require(_0x70f9('0x0'));var moment=require(_0x70f9('0x1'));var path=require(_0x70f9('0x2'));var config=require(_0x70f9('0x3'));module[_0x70f9('0x4')]={'format':{'type':Sequelize[_0x70f9('0x5')],'get':function(){return this[_0x70f9('0x6')](_0x70f9('0x7'))?path[_0x70f9('0x8')](this[_0x70f9('0x6')](_0x70f9('0x7'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x70f9('0x9')],'set':function(_0x17531e){var _0x2e1ac7=_0x17531e[_0x70f9('0xa')](/\\/g,'/');this['setDataValue']('value',_0x2e1ac7);}},'rating':{'type':Sequelize[_0x70f9('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x70f9('0xb')],'set':function(_0x2265a8){this[_0x70f9('0xc')]('startedAt',moment()['subtract'](_0x2265a8,'ms'));this['setDataValue']('closedAt',moment());this[_0x70f9('0xc')](_0x70f9('0xd'),_0x2265a8);}},'startedAt':{'type':Sequelize[_0x70f9('0xe')],'get':function(){return moment(this[_0x70f9('0x6')]('startedAt'))[_0x70f9('0xf')](_0x70f9('0x10'))[_0x70f9('0x11')]();}},'closedAt':{'type':Sequelize[_0x70f9('0xe')],'get':function(){return moment(this[_0x70f9('0x6')]('closedAt'))[_0x70f9('0xf')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x70f9('0x12')))['format'](_0x70f9('0x10'))[_0x70f9('0x11')]();}},'updatedAt':{'type':Sequelize[_0x70f9('0xe')],'get':function(){return moment(this[_0x70f9('0x6')](_0x70f9('0x13')))[_0x70f9('0xf')](_0x70f9('0x10'))[_0x70f9('0x11')]();}}}; \ No newline at end of file +var _0xa988=['format','toString','updatedAt','sequelize','moment','path','../../config/environment','exports','getDataValue','value','extname','STRING','replace','INTEGER','setDataValue','startedAt','closedAt','DATE','MM-DD-YYYY\x20HH:mm','createdAt'];(function(_0x5aa8d4,_0x12ebd5){var _0x239670=function(_0x4ff9d9){while(--_0x4ff9d9){_0x5aa8d4['push'](_0x5aa8d4['shift']());}};_0x239670(++_0x12ebd5);}(_0xa988,0x1a7));var _0x8a98=function(_0x3ee74e,_0x1b52c3){_0x3ee74e=_0x3ee74e-0x0;var _0x46782d=_0xa988[_0x3ee74e];return _0x46782d;};'use strict';var Sequelize=require(_0x8a98('0x0'));var moment=require(_0x8a98('0x1'));var path=require(_0x8a98('0x2'));var config=require(_0x8a98('0x3'));module[_0x8a98('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x8a98('0x5')](_0x8a98('0x6'))?path[_0x8a98('0x7')](this[_0x8a98('0x5')](_0x8a98('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x8a98('0x8')]},'channel':{'type':Sequelize[_0x8a98('0x8')]},'value':{'type':Sequelize[_0x8a98('0x8')],'set':function(_0x4ef481){var _0x27db7a=_0x4ef481[_0x8a98('0x9')](/\\/g,'/');this['setDataValue'](_0x8a98('0x6'),_0x27db7a);}},'rating':{'type':Sequelize[_0x8a98('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x5552b2){this[_0x8a98('0xb')](_0x8a98('0xc'),moment()['subtract'](_0x5552b2,'ms'));this[_0x8a98('0xb')](_0x8a98('0xd'),moment());this[_0x8a98('0xb')]('duration',_0x5552b2);}},'startedAt':{'type':Sequelize[_0x8a98('0xe')],'get':function(){return moment(this[_0x8a98('0x5')](_0x8a98('0xc')))['format'](_0x8a98('0xf'))['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x8a98('0xd')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize[_0x8a98('0xe')],'get':function(){return moment(this['getDataValue'](_0x8a98('0x10')))[_0x8a98('0x11')](_0x8a98('0xf'))[_0x8a98('0x12')]();}},'updatedAt':{'type':Sequelize[_0x8a98('0xe')],'get':function(){return moment(this[_0x8a98('0x5')](_0x8a98('0x13')))[_0x8a98('0x11')]('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 66b0524..0347a1e 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 _0x5075=['send','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','end','error','name','index','map','ScreenRecording','rawAttributes','fieldName','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','message'];(function(_0x5d14e4,_0x1afe0b){var _0x49e0d1=function(_0x4ea53b){while(--_0x4ea53b){_0x5d14e4['push'](_0x5d14e4['shift']());}};_0x49e0d1(++_0x1afe0b);}(_0x5075,0x73));var _0x5507=function(_0x509273,_0x13fc9f){_0x509273=_0x509273-0x0;var _0x38ef40=_0x5075[_0x509273];return _0x38ef40;};'use strict';var emlformat=require(_0x5507('0x0'));var rimraf=require(_0x5507('0x1'));var zipdir=require(_0x5507('0x2'));var jsonpatch=require(_0x5507('0x3'));var rp=require(_0x5507('0x4'));var moment=require(_0x5507('0x5'));var BPromise=require(_0x5507('0x6'));var Mustache=require('mustache');var util=require(_0x5507('0x7'));var path=require(_0x5507('0x8'));var sox=require(_0x5507('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5507('0xa'));var _=require(_0x5507('0xb'));var squel=require('squel');var crypto=require(_0x5507('0xc'));var jsforce=require(_0x5507('0xd'));var deskjs=require(_0x5507('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5507('0xf'));var Redis=require(_0x5507('0x10'));var authService=require(_0x5507('0x11'));var qs=require(_0x5507('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5507('0x13'));var logger=require(_0x5507('0x14'))('api');var utils=require(_0x5507('0x15'));var config=require(_0x5507('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5507('0x17'))['db'];function respondWithStatusCode(_0x2a2ea0,_0x32c872){_0x32c872=_0x32c872||0xcc;return function(_0x267f27){if(_0x267f27){return _0x2a2ea0[_0x5507('0x18')](_0x32c872);}return _0x2a2ea0[_0x5507('0x19')](_0x32c872)['end']();};}function respondWithResult(_0x9cc3f9,_0x2b7c43){_0x2b7c43=_0x2b7c43||0xc8;return function(_0xc828e5){if(_0xc828e5){return _0x9cc3f9[_0x5507('0x19')](_0x2b7c43)['json'](_0xc828e5);}};}function respondWithFilteredResult(_0x49e400,_0x10d7b9){return function(_0x2dfd06){if(_0x2dfd06){var _0x1ab167=typeof _0x10d7b9[_0x5507('0x1a')]===_0x5507('0x1b')&&typeof _0x10d7b9[_0x5507('0x1c')]===_0x5507('0x1b');var _0x3d1619=_0x2dfd06[_0x5507('0x1d')];var _0x233b6a=_0x1ab167?0x0:_0x10d7b9[_0x5507('0x1a')];var _0x3822dd=_0x1ab167?_0x2dfd06['count']:_0x10d7b9[_0x5507('0x1a')]+_0x10d7b9[_0x5507('0x1c')];var _0x4054c6;if(_0x3822dd>=_0x3d1619){_0x3822dd=_0x3d1619;_0x4054c6=0xc8;}else{_0x4054c6=0xce;}_0x49e400[_0x5507('0x19')](_0x4054c6);return _0x49e400['set'](_0x5507('0x1e'),_0x233b6a+'-'+_0x3822dd+'/'+_0x3d1619)[_0x5507('0x1f')](_0x2dfd06);}return null;};}function patchUpdates(_0x1a54b0){return function(_0x3ca1f7){try{jsonpatch[_0x5507('0x20')](_0x3ca1f7,_0x1a54b0,!![]);}catch(_0x1be8b1){return BPromise['reject'](_0x1be8b1);}return _0x3ca1f7[_0x5507('0x21')]();};}function saveUpdates(_0x105535,_0x1f6325){return function(_0xa3e2cf){if(_0xa3e2cf){return _0xa3e2cf[_0x5507('0x22')](_0x105535)[_0x5507('0x23')](function(_0x1fcc8d){return _0x1fcc8d;});}return null;};}function removeEntity(_0x10f149,_0x398911){return function(_0xa47641){if(_0xa47641){return _0xa47641[_0x5507('0x24')]()[_0x5507('0x23')](function(){_0x10f149[_0x5507('0x19')](0xcc)[_0x5507('0x25')]();});}};}function handleEntityNotFound(_0x1a2203,_0x4915ed){return function(_0x4e8906){if(!_0x4e8906){_0x1a2203['sendStatus'](0x194);}return _0x4e8906;};}function handleError(_0x26335e,_0x4ea271){_0x4ea271=_0x4ea271||0x1f4;return function(_0xa66a01){logger[_0x5507('0x26')](_0xa66a01['stack']);if(_0xa66a01['name']){delete _0xa66a01[_0x5507('0x27')];}_0x26335e[_0x5507('0x19')](_0x4ea271)['send'](_0xa66a01);};}exports[_0x5507('0x28')]=function(_0x24574b,_0x85d383){var _0x38f4d9={},_0x1e5ce6={},_0x14fdea={'count':0x0,'rows':[]};var _0x55e889=_[_0x5507('0x29')](db[_0x5507('0x2a')][_0x5507('0x2b')],function(_0x38f0f5){return{'name':_0x38f0f5[_0x5507('0x2c')],'type':_0x38f0f5['type']['key']};});_0x1e5ce6[_0x5507('0x2d')]=_[_0x5507('0x2e')](_[_0x5507('0x29')](_0x55e889,_0x5507('0x27')),['format']);_0x1e5ce6[_0x5507('0x2f')]=_[_0x5507('0x30')](_0x24574b[_0x5507('0x2f')]);_0x1e5ce6[_0x5507('0x31')]=_[_0x5507('0x32')](_0x1e5ce6[_0x5507('0x2d')],_0x1e5ce6[_0x5507('0x2f')]);_0x38f4d9[_0x5507('0x33')]=_['intersection'](_0x1e5ce6[_0x5507('0x2d')],qs[_0x5507('0x34')](_0x24574b[_0x5507('0x2f')]['fields']));_0x38f4d9['attributes']=_0x38f4d9[_0x5507('0x33')][_0x5507('0x35')]?_0x38f4d9[_0x5507('0x33')]:_0x1e5ce6[_0x5507('0x2d')];if(!_0x24574b[_0x5507('0x2f')]['hasOwnProperty']('nolimit')){_0x38f4d9[_0x5507('0x1c')]=qs[_0x5507('0x1c')](_0x24574b[_0x5507('0x2f')][_0x5507('0x1c')]);_0x38f4d9['offset']=qs['offset'](_0x24574b[_0x5507('0x2f')]['offset']);}_0x38f4d9[_0x5507('0x36')]=qs[_0x5507('0x37')](_0x24574b[_0x5507('0x2f')][_0x5507('0x37')]);_0x38f4d9[_0x5507('0x38')]=qs[_0x5507('0x31')](_[_0x5507('0x39')](_0x24574b[_0x5507('0x2f')],_0x1e5ce6[_0x5507('0x31')]),_0x55e889);if(_0x24574b[_0x5507('0x2f')]['filter']){_0x38f4d9['where']=_['merge'](_0x38f4d9['where'],{'$or':_[_0x5507('0x29')](_0x55e889,function(_0x2cf512){if(_0x2cf512[_0x5507('0x3a')]!==_0x5507('0x3b')){var _0x2b32a5={};_0x2b32a5[_0x2cf512[_0x5507('0x27')]]={'$like':'%'+_0x24574b[_0x5507('0x2f')][_0x5507('0x3c')]+'%'};return _0x2b32a5;}})});}_0x38f4d9=_[_0x5507('0x3d')]({},_0x38f4d9,_0x24574b[_0x5507('0x3e')]);var _0x3ec0ed={'where':_0x38f4d9[_0x5507('0x38')]};return db[_0x5507('0x2a')][_0x5507('0x1d')](_0x3ec0ed)['then'](function(_0x53b3f3){_0x14fdea['count']=_0x53b3f3;if(_0x24574b[_0x5507('0x2f')][_0x5507('0x3f')]){_0x38f4d9[_0x5507('0x40')]=[{'all':!![]}];}return db[_0x5507('0x2a')][_0x5507('0x41')](_0x38f4d9);})[_0x5507('0x23')](function(_0x340c4c){_0x14fdea[_0x5507('0x42')]=_0x340c4c;return _0x14fdea;})[_0x5507('0x23')](respondWithFilteredResult(_0x85d383,_0x38f4d9))[_0x5507('0x43')](handleError(_0x85d383,null));};exports[_0x5507('0x44')]=function(_0x192a00,_0x24d7b5){var _0x25496b={'raw':![],'where':{'id':_0x192a00[_0x5507('0x45')]['id']}},_0x1b3006={};_0x1b3006[_0x5507('0x2d')]=_[_0x5507('0x30')](db[_0x5507('0x2a')]['rawAttributes']);_0x1b3006[_0x5507('0x2f')]=_[_0x5507('0x30')](_0x192a00['query']);_0x1b3006['filters']=_[_0x5507('0x32')](_0x1b3006[_0x5507('0x2d')],_0x1b3006[_0x5507('0x2f')]);_0x25496b[_0x5507('0x33')]=_[_0x5507('0x32')](_0x1b3006['model'],qs[_0x5507('0x34')](_0x192a00[_0x5507('0x2f')][_0x5507('0x34')]));_0x25496b['attributes']=_0x25496b[_0x5507('0x33')][_0x5507('0x35')]?_0x25496b[_0x5507('0x33')]:_0x1b3006[_0x5507('0x2d')];if(_0x192a00[_0x5507('0x2f')]['includeAll']){_0x25496b[_0x5507('0x40')]=[{'all':!![]}];}_0x25496b=_['merge']({},_0x25496b,_0x192a00[_0x5507('0x3e')]);return db[_0x5507('0x2a')][_0x5507('0x46')](_0x25496b)[_0x5507('0x23')](handleEntityNotFound(_0x24d7b5,null))[_0x5507('0x23')](respondWithResult(_0x24d7b5,null))[_0x5507('0x43')](handleError(_0x24d7b5,null));};exports[_0x5507('0x47')]=function(_0x3452e4,_0x549cf0){return db[_0x5507('0x2a')][_0x5507('0x47')](_0x3452e4['body'],{})['then'](respondWithResult(_0x549cf0,0xc9))['catch'](handleError(_0x549cf0,null));};exports[_0x5507('0x22')]=function(_0x5961fd,_0x403d03){if(_0x5961fd['body']['id']){delete _0x5961fd[_0x5507('0x48')]['id'];}delete _0x5961fd['body']['duration'];delete _0x5961fd[_0x5507('0x48')][_0x5507('0x49')];delete _0x5961fd[_0x5507('0x48')][_0x5507('0x4a')];delete _0x5961fd[_0x5507('0x48')][_0x5507('0x4b')];return db['ScreenRecording'][_0x5507('0x46')]({'where':{'id':_0x5961fd[_0x5507('0x45')]['id']}})[_0x5507('0x23')](handleEntityNotFound(_0x403d03,null))['then'](saveUpdates(_0x5961fd[_0x5507('0x48')],null))[_0x5507('0x23')](respondWithResult(_0x403d03,null))[_0x5507('0x43')](handleError(_0x403d03,null));};exports[_0x5507('0x4c')]=function(_0x300c9f,_0x3af70f){return db[_0x5507('0x2a')][_0x5507('0x4c')]()[_0x5507('0x23')](respondWithResult(_0x3af70f,null))[_0x5507('0x43')](handleError(_0x3af70f,null));};exports[_0x5507('0x4d')]=function(_0x49a2f8,_0x570928,_0x1992fa){var _0x5d7753=require(_0x5507('0x4e'));var _0x1b34c8=![];var _0xce851d={};if(_0x49a2f8[_0x5507('0x2f')][_0x5507('0x3a')]&&_0x49a2f8[_0x5507('0x2f')][_0x5507('0x3a')]===_0x5507('0x4f')){_0xce851d[_0x5507('0x4f')]=_0x49a2f8[_0x5507('0x45')]['id'];}else{_0xce851d['id']=_0x49a2f8[_0x5507('0x45')]['id'];}return db[_0x5507('0x2a')][_0x5507('0x46')]({'where':_0xce851d,'attributes':['id',_0x5507('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x570928,null))[_0x5507('0x23')](function(_0x56e0cd){if(_0x56e0cd){var _0x5af5f5=path[_0x5507('0x50')](config[_0x5507('0x51')],_0x5507('0x52'),_0x56e0cd[_0x5507('0x4b')]);var _0x52b9f2=util[_0x5507('0x53')](_0x5507('0x54'),_0x5af5f5);if(fs[_0x5507('0x55')](_0x52b9f2)){_0x1b34c8=!![];return _0x5d7753[_0x5507('0x56')](_0x52b9f2,_0x5af5f5,config[_0x5507('0x57')][_0x5507('0x58')])['then'](function(){return _0x56e0cd;});}return _0x56e0cd;}})[_0x5507('0x23')](function(_0x46e589){if(_0x46e589){var _0x3a2f9f=path['join'](config['root'],_0x5507('0x52'),_0x46e589['value']);if(!fs[_0x5507('0x55')](_0x3a2f9f)){throw new db[(_0x5507('0x59'))]['ValidationError'](_0x5507('0x5a'));}if(_0x46e589[_0x5507('0x5b')]){return _0x570928[_0x5507('0x4d')](_0x3a2f9f,_0x46e589[_0x5507('0x5b')]+path[_0x5507('0x5c')](_0x3a2f9f),function(){if(_0x1b34c8){fs[_0x5507('0x5d')](_0x3a2f9f);}});}else{return _0x570928[_0x5507('0x4d')](_0x3a2f9f,function(_0x2928f2){if(_0x1b34c8){fs[_0x5507('0x5d')](_0x3a2f9f);}});}}})[_0x5507('0x43')](function(_0x1453f1){if(_0x1453f1[_0x5507('0x5e')]==='ScreenRecording\x20not\x20found'){_0x570928[_0x5507('0x19')](0x194)[_0x5507('0x5f')](_0x5507('0x60'));}else{return handleError(_0x570928,null);}});};exports[_0x5507('0x24')]=function(_0x3c4422,_0x5183ae){return db[_0x5507('0x2a')]['find']({'where':{'id':_0x3c4422[_0x5507('0x45')]['id']}})[_0x5507('0x23')](function(_0x241733){if(_['isNil'](_0x241733)){throw new ReferenceError(_0x5507('0x61'));}return _0x241733;})[_0x5507('0x23')](function(_0x2a9672){var _0x56632b=path[_0x5507('0x50')](config['root'],_0x5507('0x52'),_0x2a9672['value']);logger['info'](_0x5507('0x62'),_0x56632b);if(!_[_0x5507('0x63')](_0x2a9672[_0x5507('0x4b')])&&fs[_0x5507('0x55')](_0x56632b)){logger[_0x5507('0x64')](_0x5507('0x65')+_0x56632b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x56632b);}_0x56632b=_0x56632b+_0x5507('0x66');if(!_[_0x5507('0x63')](_0x2a9672[_0x5507('0x4b')])&&fs[_0x5507('0x55')](_0x56632b)){logger['info'](_0x5507('0x65')+_0x56632b+_0x5507('0x67'));fs[_0x5507('0x68')](_0x56632b);}return _0x2a9672;})[_0x5507('0x23')](function(_0x296cf5){if(!_0x296cf5)throw new InternalError();return _0x296cf5[_0x5507('0x24')]();})[_0x5507('0x23')](function(){_0x5183ae['status'](0xcc)[_0x5507('0x25')]();})[_0x5507('0x43')](handleError(_0x5183ae,null));}; \ No newline at end of file +var _0x008c=['papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','sendStatus','send','index','ScreenRecording','rawAttributes','key','model','differenceBy','map','name','format','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','type','VIRTUAL','filter','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','duration','createdAt','closedAt','describe','../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','decryptFile','secrets','recording','existsSync','ValidationError','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x008c,0x188));var _0xc008=function(_0x2ce9c3,_0x20a165){_0x2ce9c3=_0x2ce9c3-0x0;var _0x109b3a=_0x008c[_0x2ce9c3];return _0x109b3a;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_[_0xc008('0x2b')](_0x2a7d4f,_0xc008('0x2c')),[_0xc008('0x2d')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x25eae4[_0xc008('0x2e')]);_0x32390d[_0xc008('0x30')]=_[_0xc008('0x31')](_0x32390d[_0xc008('0x29')],_0x32390d['query']);_0x24c14c[_0xc008('0x32')]=_[_0xc008('0x31')](_0x32390d['model'],qs[_0xc008('0x33')](_0x25eae4[_0xc008('0x2e')][_0xc008('0x33')]));_0x24c14c[_0xc008('0x32')]=_0x24c14c[_0xc008('0x32')][_0xc008('0x34')]?_0x24c14c[_0xc008('0x32')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2e')]['hasOwnProperty'](_0xc008('0x35'))){_0x24c14c[_0xc008('0x1d')]=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2e')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4['query'][_0xc008('0x1b')]);}_0x24c14c[_0xc008('0x36')]=qs['sort'](_0x25eae4[_0xc008('0x2e')][_0xc008('0x37')]);_0x24c14c['where']=qs[_0xc008('0x30')](_[_0xc008('0x38')](_0x25eae4[_0xc008('0x2e')],_0x32390d['filters']),_0x2a7d4f);if(_0x25eae4['query']['filter']){_0x24c14c[_0xc008('0x39')]=_['merge'](_0x24c14c[_0xc008('0x39')],{'$or':_[_0xc008('0x2b')](_0x2a7d4f,function(_0x6a4ccb){if(_0x6a4ccb[_0xc008('0x3a')]!==_0xc008('0x3b')){var _0xa381d1={};_0xa381d1[_0x6a4ccb[_0xc008('0x2c')]]={'$like':'%'+_0x25eae4[_0xc008('0x2e')][_0xc008('0x3c')]+'%'};return _0xa381d1;}})});}_0x24c14c=_[_0xc008('0x3d')]({},_0x24c14c,_0x25eae4[_0xc008('0x3e')]);var _0xdfca2e={'where':_0x24c14c[_0xc008('0x39')]};return db[_0xc008('0x26')]['count'](_0xdfca2e)[_0xc008('0x21')](function(_0x23c4db){_0x209591[_0xc008('0x1e')]=_0x23c4db;if(_0x25eae4[_0xc008('0x2e')]['includeAll']){_0x24c14c[_0xc008('0x3f')]=[{'all':!![]}];}return db[_0xc008('0x26')][_0xc008('0x40')](_0x24c14c);})[_0xc008('0x21')](function(_0x2d142d){_0x209591['rows']=_0x2d142d;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))[_0xc008('0x41')](handleError(_0x529961,null));};exports[_0xc008('0x42')]=function(_0x3e9a99,_0x7279e8){var _0x4f93a4={'raw':![],'where':{'id':_0x3e9a99[_0xc008('0x43')]['id']}},_0xf4cc4b={};_0xf4cc4b[_0xc008('0x29')]=_[_0xc008('0x2f')](db['ScreenRecording'][_0xc008('0x27')]);_0xf4cc4b[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x3e9a99['query']);_0xf4cc4b[_0xc008('0x30')]=_['intersection'](_0xf4cc4b[_0xc008('0x29')],_0xf4cc4b['query']);_0x4f93a4[_0xc008('0x32')]=_[_0xc008('0x31')](_0xf4cc4b['model'],qs[_0xc008('0x33')](_0x3e9a99[_0xc008('0x2e')][_0xc008('0x33')]));_0x4f93a4['attributes']=_0x4f93a4[_0xc008('0x32')][_0xc008('0x34')]?_0x4f93a4[_0xc008('0x32')]:_0xf4cc4b[_0xc008('0x29')];if(_0x3e9a99[_0xc008('0x2e')][_0xc008('0x44')]){_0x4f93a4['include']=[{'all':!![]}];}_0x4f93a4=_['merge']({},_0x4f93a4,_0x3e9a99['options']);return db[_0xc008('0x26')][_0xc008('0x45')](_0x4f93a4)[_0xc008('0x21')](handleEntityNotFound(_0x7279e8,null))[_0xc008('0x21')](respondWithResult(_0x7279e8,null))[_0xc008('0x41')](handleError(_0x7279e8,null));};exports[_0xc008('0x46')]=function(_0x2cf641,_0x33be4f){return db['ScreenRecording']['create'](_0x2cf641['body'],{})[_0xc008('0x21')](respondWithResult(_0x33be4f,0xc9))[_0xc008('0x41')](handleError(_0x33be4f,null));};exports[_0xc008('0x20')]=function(_0x511383,_0x28bc33){if(_0x511383[_0xc008('0x47')]['id']){delete _0x511383[_0xc008('0x47')]['id'];}delete _0x511383[_0xc008('0x47')][_0xc008('0x48')];delete _0x511383[_0xc008('0x47')][_0xc008('0x49')];delete _0x511383[_0xc008('0x47')][_0xc008('0x4a')];delete _0x511383[_0xc008('0x47')]['value'];return db['ScreenRecording'][_0xc008('0x45')]({'where':{'id':_0x511383['params']['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x28bc33,null))[_0xc008('0x21')](saveUpdates(_0x511383[_0xc008('0x47')],null))['then'](respondWithResult(_0x28bc33,null))[_0xc008('0x41')](handleError(_0x28bc33,null));};exports[_0xc008('0x4b')]=function(_0xee64,_0x8b9775){return db[_0xc008('0x26')]['describe']()[_0xc008('0x21')](respondWithResult(_0x8b9775,null))[_0xc008('0x41')](handleError(_0x8b9775,null));};exports['download']=function(_0x24f775,_0xfd6d1d,_0x5b5fbf){var _0x51d3dc=require(_0xc008('0x4c'));var _0xd47b74=![];var _0x20947b={};if(_0x24f775[_0xc008('0x2e')][_0xc008('0x3a')]&&_0x24f775['query']['type']===_0xc008('0x4d')){_0x20947b['uniqueid']=_0x24f775[_0xc008('0x43')]['id'];}else{_0x20947b['id']=_0x24f775[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x45')]({'where':_0x20947b,'attributes':['id',_0xc008('0x4e')],'raw':!![]})[_0xc008('0x21')](handleEntityNotFound(_0xfd6d1d,null))['then'](function(_0x2ea742){if(_0x2ea742){var _0xbd7422=path[_0xc008('0x4f')](config[_0xc008('0x50')],_0xc008('0x51'),_0x2ea742['value']);var _0x41fae3=util['format']('%s.cypher',_0xbd7422);if(fs['existsSync'](_0x41fae3)){_0xd47b74=!![];return _0x51d3dc[_0xc008('0x52')](_0x41fae3,_0xbd7422,config[_0xc008('0x53')][_0xc008('0x54')])['then'](function(){return _0x2ea742;});}return _0x2ea742;}})[_0xc008('0x21')](function(_0x2d8361){if(_0x2d8361){var _0x3dda82=path['join'](config[_0xc008('0x50')],_0xc008('0x51'),_0x2d8361[_0xc008('0x4e')]);if(!fs[_0xc008('0x55')](_0x3dda82)){throw new db['Sequelize'][(_0xc008('0x56'))]('ScreenRecording\x20not\x20found');}if(_0x2d8361[_0xc008('0x57')]){return _0xfd6d1d[_0xc008('0x58')](_0x3dda82,_0x2d8361[_0xc008('0x57')]+path[_0xc008('0x59')](_0x3dda82),function(){if(_0xd47b74){fs[_0xc008('0x5a')](_0x3dda82);}});}else{return _0xfd6d1d[_0xc008('0x58')](_0x3dda82,function(_0x4818c7){if(_0xd47b74){fs[_0xc008('0x5a')](_0x3dda82);}});}}})['catch'](function(_0x5bf4a9){if(_0x5bf4a9[_0xc008('0x5b')]===_0xc008('0x5c')){_0xfd6d1d['status'](0x194)[_0xc008('0x24')](_0xc008('0x5d'));}else{return handleError(_0xfd6d1d,null);}});};exports[_0xc008('0x22')]=function(_0x4517c0,_0x21ee6d){return db[_0xc008('0x26')][_0xc008('0x45')]({'where':{'id':_0x4517c0['params']['id']}})[_0xc008('0x21')](function(_0x462e1e){if(_[_0xc008('0x5e')](_0x462e1e)){throw new ReferenceError(_0xc008('0x5f'));}return _0x462e1e;})[_0xc008('0x21')](function(_0x167425){var _0x249898=path[_0xc008('0x4f')](config[_0xc008('0x50')],_0xc008('0x51'),_0x167425[_0xc008('0x4e')]);logger[_0xc008('0x60')](_0xc008('0x61'),_0x249898);if(!_[_0xc008('0x5e')](_0x167425['value'])&&fs[_0xc008('0x55')](_0x249898)){logger[_0xc008('0x60')](_0xc008('0x62')+_0x249898+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xc008('0x63')](_0x249898);}_0x249898=_0x249898+_0xc008('0x64');if(!_['isNil'](_0x167425['value'])&&fs[_0xc008('0x55')](_0x249898)){logger[_0xc008('0x60')](_0xc008('0x62')+_0x249898+_0xc008('0x65'));fs[_0xc008('0x63')](_0x249898);}return _0x167425;})[_0xc008('0x21')](function(_0x238852){if(!_0x238852)throw new InternalError();return _0x238852[_0xc008('0x22')]();})[_0xc008('0x21')](function(){_0x21ee6d[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();})['catch'](handleError(_0x21ee6d,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 67e0516..6429b16 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 _0xeeee=['../../config/environment','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','rimraf'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xeeee,0x124));var _0xeeee=function(_0x1c78b2,_0x45e720){_0x1c78b2=_0x1c78b2-0x0;var _0x15f984=_0xeeee[_0x1c78b2];return _0x15f984;};'use strict';var _=require(_0xeeee('0x0'));var util=require(_0xeeee('0x1'));var logger=require(_0xeeee('0x2'))(_0xeeee('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeeee('0x4'));var config=require(_0xeeee('0x5'));var attributes=require('./screenRecording.attributes');module[_0xeeee('0x6')]=function(_0x5dcbb7,_0x2a8820){return _0x5dcbb7[_0xeeee('0x7')](_0xeeee('0x8'),attributes,{'tableName':_0xeeee('0x9'),'paranoid':![],'indexes':[{'name':_0xeeee('0xa'),'fields':[_0xeeee('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbc2e=['path','rimraf','../../config/environment','exports','define','ScreenRecording','screen_recordings','interactionid','util','../../config/logger','api','moment','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbc2e,0xcb));var _0xebc2=function(_0x47887c,_0x3ea162){_0x47887c=_0x47887c-0x0;var _0x1f85a7=_0xbc2e[_0x47887c];return _0x1f85a7;};'use strict';var _=require('lodash');var util=require(_0xebc2('0x0'));var logger=require(_0xebc2('0x1'))(_0xebc2('0x2'));var moment=require(_0xebc2('0x3'));var BPromise=require('bluebird');var rp=require(_0xebc2('0x4'));var fs=require('fs');var path=require(_0xebc2('0x5'));var rimraf=require(_0xebc2('0x6'));var config=require(_0xebc2('0x7'));var attributes=require('./screenRecording.attributes');module[_0xebc2('0x8')]=function(_0x237064,_0x13162c){return _0x237064[_0xebc2('0x9')](_0xebc2('0xa'),attributes,{'tableName':_0xebc2('0xb'),'paranoid':![],'indexes':[{'name':_0xebc2('0xc'),'fields':[_0xebc2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index fab5910..aa5a493 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 _0x32f2=['../../config/environment','jayson/promise','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x460fa4,_0x935c69){var _0x45ee43=function(_0x401541){while(--_0x401541){_0x460fa4['push'](_0x460fa4['shift']());}};_0x45ee43(++_0x935c69);}(_0x32f2,0xd0));var _0x232f=function(_0x4ff6bd,_0x1aa86a){_0x4ff6bd=_0x4ff6bd-0x0;var _0x2b20d8=_0x32f2[_0x4ff6bd];return _0x2b20d8;};'use strict';var _=require('lodash');var util=require(_0x232f('0x0'));var moment=require(_0x232f('0x1'));var BPromise=require(_0x232f('0x2'));var rs=require(_0x232f('0x3'));var fs=require('fs');var Redis=require(_0x232f('0x4'));var db=require(_0x232f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x232f('0x6'))(_0x232f('0x7'));var config=require(_0x232f('0x8'));var jayson=require(_0x232f('0x9'));var client=jayson[_0x232f('0xa')][_0x232f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f44fe,_0x445005,_0x5a56c0){return new BPromise(function(_0x370931,_0x4a87d9){return client[_0x232f('0xc')](_0x2f44fe,_0x5a56c0)[_0x232f('0xd')](function(_0x77e625){logger['info'](_0x232f('0xe'),_0x445005,_0x232f('0xf'));logger['debug'](_0x232f('0x10'),_0x445005,'request\x20sent',JSON[_0x232f('0x11')](_0x77e625));if(_0x77e625[_0x232f('0x12')]){if(_0x77e625[_0x232f('0x12')][_0x232f('0x13')]===0x1f4){logger['error'](_0x232f('0xe'),_0x445005,_0x77e625[_0x232f('0x12')][_0x232f('0x14')]);return _0x4a87d9(_0x77e625[_0x232f('0x12')][_0x232f('0x14')]);}logger[_0x232f('0x12')](_0x232f('0xe'),_0x445005,_0x77e625[_0x232f('0x12')][_0x232f('0x14')]);return _0x370931(_0x77e625[_0x232f('0x12')]['message']);}else{logger[_0x232f('0x15')]('ScreenRecording,\x20%s,\x20%s',_0x445005,_0x232f('0xf'));_0x370931(_0x77e625[_0x232f('0x16')][_0x232f('0x14')]);}})[_0x232f('0x17')](function(_0x249ccb){logger[_0x232f('0x12')](_0x232f('0xe'),_0x445005,_0x249ccb);_0x4a87d9(_0x249ccb);});});} \ No newline at end of file +var _0x03b1=['info','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','ScreenRecording,\x20%s,\x20%s','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x2ac772,_0x579bf6){var _0x573cc9=function(_0x15497f){while(--_0x15497f){_0x2ac772['push'](_0x2ac772['shift']());}};_0x573cc9(++_0x579bf6);}(_0x03b1,0x8f));var _0x103b=function(_0x216e06,_0x2843f4){_0x216e06=_0x216e06-0x0;var _0x81ad3a=_0x03b1[_0x216e06];return _0x81ad3a;};'use strict';var _=require(_0x103b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x103b('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x103b('0x2'))['db'];var utils=require(_0x103b('0x3'));var logger=require(_0x103b('0x4'))(_0x103b('0x5'));var config=require(_0x103b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x103b('0x7')][_0x103b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27b2eb,_0x4eae49,_0x2f0719){return new BPromise(function(_0x29115e,_0x2a6e42){return client[_0x103b('0x9')](_0x27b2eb,_0x2f0719)['then'](function(_0x5ce1a7){logger['info'](_0x103b('0xa'),_0x4eae49,'request\x20sent');logger['debug'](_0x103b('0xb'),_0x4eae49,_0x103b('0xc'),JSON[_0x103b('0xd')](_0x5ce1a7));if(_0x5ce1a7[_0x103b('0xe')]){if(_0x5ce1a7[_0x103b('0xe')][_0x103b('0xf')]===0x1f4){logger[_0x103b('0xe')](_0x103b('0xa'),_0x4eae49,_0x5ce1a7[_0x103b('0xe')][_0x103b('0x10')]);return _0x2a6e42(_0x5ce1a7[_0x103b('0xe')][_0x103b('0x10')]);}logger[_0x103b('0xe')](_0x103b('0xa'),_0x4eae49,_0x5ce1a7[_0x103b('0xe')][_0x103b('0x10')]);return _0x29115e(_0x5ce1a7[_0x103b('0xe')][_0x103b('0x10')]);}else{logger[_0x103b('0x11')](_0x103b('0xa'),_0x4eae49,'request\x20sent');_0x29115e(_0x5ce1a7[_0x103b('0x12')]['message']);}})[_0x103b('0x13')](function(_0x298bd5){logger[_0x103b('0xe')](_0x103b('0xa'),_0x4eae49,_0x298bd5);_0x2a6e42(_0x298bd5);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 8e0cfe7..307c7d9 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 _0x274e=['../../config/environment','./setting.controller','get','isAuthenticated','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','root','server/files/images/logos/','logo','extname','originalname','post','single','file','addLogo','%s%s','join','preferred','addPreferred','format','favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x325956,_0x41e30a){var _0x596361=function(_0x233a28){while(--_0x233a28){_0x325956['push'](_0x325956['shift']());}};_0x596361(++_0x41e30a);}(_0x274e,0x100));var _0xe274=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x274e[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require(_0xe274('0x0'));var util=require(_0xe274('0x1'));var path=require(_0xe274('0x2'));var timeout=require(_0xe274('0x3'));var express=require(_0xe274('0x4'));var router=express['Router']();var fs_extra=require(_0xe274('0x5'));var auth=require(_0xe274('0x6'));var interaction=require(_0xe274('0x7'));var config=require(_0xe274('0x8'));var controller=require(_0xe274('0x9'));router[_0xe274('0xa')]('/',auth[_0xe274('0xb')](),controller['index']);router['get'](_0xe274('0xc'),controller[_0xe274('0xd')]);router[_0xe274('0xa')](_0xe274('0xe'),controller[_0xe274('0xf')]);router['get'](_0xe274('0x10'),controller[_0xe274('0x11')]);router[_0xe274('0xa')](_0xe274('0x12'),controller['getLogoLogin']);router['get'](_0xe274('0x13'),controller[_0xe274('0x14')]);router[_0xe274('0xa')](_0xe274('0x15'),controller[_0xe274('0x16')]);router[_0xe274('0xa')](_0xe274('0x17'),controller['getFavicon']);var upload=multer({'storage':multer[_0xe274('0x18')]({'destination':function(_0x23bec0,_0x5eb1f8,_0x82fc0c){_0x82fc0c(null,path['join'](config[_0xe274('0x19')],_0xe274('0x1a')));},'filename':function(_0x3660c4,_0x35b17b,_0x26e70a){_0x26e70a(null,util['format']('%s%s',_0xe274('0x1b'),path[_0xe274('0x1c')](_0x35b17b[_0xe274('0x1d')])));}})});router[_0xe274('0x1e')]('/:id/logo',upload[_0xe274('0x1f')](_0xe274('0x20')),controller[_0xe274('0x21')]);var upload=multer({'storage':multer[_0xe274('0x18')]({'destination':function(_0x5f4845,_0x4fec8e,_0x10347a){_0x10347a(null,path['join'](config['root'],_0xe274('0x1a')));},'filename':function(_0x5b8773,_0x1eb8cf,_0x4c6c3b){_0x4c6c3b(null,util['format'](_0xe274('0x22'),'logologin',path[_0xe274('0x1c')](_0x1eb8cf[_0xe274('0x1d')])));}})});router['post'](_0xe274('0x12'),upload[_0xe274('0x1f')]('file'),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x28bcf8,_0x248953,_0x15930c){_0x15930c(null,path[_0xe274('0x23')](config[_0xe274('0x19')],_0xe274('0x1a')));},'filename':function(_0x3e53f9,_0x134e1e,_0x194c85){_0x194c85(null,util['format'](_0xe274('0x22'),_0xe274('0x24'),path['extname'](_0x134e1e[_0xe274('0x1d')])));}})});router[_0xe274('0x1e')]('/:id/preferred',upload[_0xe274('0x1f')]('file'),controller[_0xe274('0x25')]);var upload=multer({'storage':multer[_0xe274('0x18')]({'destination':function(_0xfb6c00,_0x4cba5e,_0x1e69a5){_0x1e69a5(null,path['join'](config[_0xe274('0x19')],_0xe274('0x1a')));},'filename':function(_0x172e3b,_0x3e7108,_0x49d0bd){_0x49d0bd(null,util[_0xe274('0x26')](_0xe274('0x22'),_0xe274('0x27'),path[_0xe274('0x1c')](_0x3e7108[_0xe274('0x1d')])));}})});router[_0xe274('0x1e')](_0xe274('0x17'),upload[_0xe274('0x1f')](_0xe274('0x20')),controller[_0xe274('0x28')]);router[_0xe274('0x29')](_0xe274('0xe'),auth['isAuthenticated'](),controller[_0xe274('0x2a')]);module[_0xe274('0x2b')]=router; \ No newline at end of file +var _0xa347=['/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','logo','originalname','post','single','file','addLogo','%s%s','logologin','extname','/:id/logo_login','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','getLogoLogin','/:id/gdpr'];(function(_0x379427,_0x56b9fb){var _0xceece3=function(_0x4feeff){while(--_0x4feeff){_0x379427['push'](_0x379427['shift']());}};_0xceece3(++_0x56b9fb);}(_0xa347,0x134));var _0x7a34=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0xa347[_0x2053ea];return _0x2232c4;};'use strict';var multer=require(_0x7a34('0x0'));var util=require(_0x7a34('0x1'));var path=require(_0x7a34('0x2'));var timeout=require(_0x7a34('0x3'));var express=require(_0x7a34('0x4'));var router=express[_0x7a34('0x5')]();var fs_extra=require(_0x7a34('0x6'));var auth=require(_0x7a34('0x7'));var interaction=require(_0x7a34('0x8'));var config=require(_0x7a34('0x9'));var controller=require('./setting.controller');router[_0x7a34('0xa')]('/',auth[_0x7a34('0xb')](),controller[_0x7a34('0xc')]);router[_0x7a34('0xa')](_0x7a34('0xd'),controller[_0x7a34('0xe')]);router['get'](_0x7a34('0xf'),controller[_0x7a34('0x10')]);router[_0x7a34('0xa')](_0x7a34('0x11'),controller[_0x7a34('0x12')]);router['get']('/:id/logo_login',controller[_0x7a34('0x13')]);router[_0x7a34('0xa')](_0x7a34('0x14'),controller['gdpr']);router['get'](_0x7a34('0x15'),controller[_0x7a34('0x16')]);router[_0x7a34('0xa')](_0x7a34('0x17'),controller[_0x7a34('0x18')]);var upload=multer({'storage':multer[_0x7a34('0x19')]({'destination':function(_0x595809,_0x29725c,_0x5aa75e){_0x5aa75e(null,path[_0x7a34('0x1a')](config[_0x7a34('0x1b')],_0x7a34('0x1c')));},'filename':function(_0x180edb,_0x31871a,_0x534053){_0x534053(null,util[_0x7a34('0x1d')]('%s%s',_0x7a34('0x1e'),path['extname'](_0x31871a[_0x7a34('0x1f')])));}})});router[_0x7a34('0x20')](_0x7a34('0x11'),upload[_0x7a34('0x21')](_0x7a34('0x22')),controller[_0x7a34('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3aae2d,_0x42882c,_0x523f14){_0x523f14(null,path[_0x7a34('0x1a')](config['root'],_0x7a34('0x1c')));},'filename':function(_0x1713ae,_0xb5d1b5,_0x43ab3d){_0x43ab3d(null,util[_0x7a34('0x1d')](_0x7a34('0x24'),_0x7a34('0x25'),path[_0x7a34('0x26')](_0xb5d1b5[_0x7a34('0x1f')])));}})});router[_0x7a34('0x20')](_0x7a34('0x27'),upload[_0x7a34('0x21')](_0x7a34('0x22')),controller[_0x7a34('0x28')]);var upload=multer({'storage':multer[_0x7a34('0x19')]({'destination':function(_0x3d4a15,_0x5be660,_0x534ea3){_0x534ea3(null,path['join'](config['root'],_0x7a34('0x1c')));},'filename':function(_0x34d095,_0x5612f8,_0x2a9746){_0x2a9746(null,util[_0x7a34('0x1d')](_0x7a34('0x24'),_0x7a34('0x29'),path[_0x7a34('0x26')](_0x5612f8[_0x7a34('0x1f')])));}})});router['post'](_0x7a34('0x15'),upload[_0x7a34('0x21')](_0x7a34('0x22')),controller[_0x7a34('0x2a')]);var upload=multer({'storage':multer[_0x7a34('0x19')]({'destination':function(_0x19fad1,_0x4e3c0a,_0x2a2395){_0x2a2395(null,path[_0x7a34('0x1a')](config[_0x7a34('0x1b')],_0x7a34('0x1c')));},'filename':function(_0x1b6f7c,_0x2de66e,_0x37ebfa){_0x37ebfa(null,util['format']('%s%s',_0x7a34('0x2b'),path[_0x7a34('0x26')](_0x2de66e[_0x7a34('0x1f')])));}})});router[_0x7a34('0x20')]('/:id/favicon',upload[_0x7a34('0x21')](_0x7a34('0x22')),controller[_0x7a34('0x2c')]);router[_0x7a34('0x2d')](_0x7a34('0xf'),auth[_0x7a34('0xb')](),controller['update']);module[_0x7a34('0x2e')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 5d94b91..de07af4 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 _0x7a54=['UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate'];(function(_0x427ba1,_0x50e2df){var _0x5d5e24=function(_0x24ff4e){while(--_0x24ff4e){_0x427ba1['push'](_0x427ba1['shift']());}};_0x5d5e24(++_0x50e2df);}(_0x7a54,0x106));var _0x47a5=function(_0xca6be,_0x249a11){_0xca6be=_0xca6be-0x0;var _0x4c8f4d=_0x7a54[_0xca6be];return _0x4c8f4d;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'min_internal':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':_0x47a5('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x5')},'logo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLogo':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x47a5('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x47a5('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x47a5('0x4')]},'defaultPreferred':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x47a5('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x47a5('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x47a5('0x2')]},'transcribeRegion':{'type':Sequelize[_0x47a5('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x47a5('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x47a5('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xadb5=['https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','exports','min_internal','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x28b7ab,_0x16a764){var _0x56791b=function(_0x25d20d){while(--_0x25d20d){_0x28b7ab['push'](_0x28b7ab['shift']());}};_0x56791b(++_0x16a764);}(_0xadb5,0xad));var _0x5adb=function(_0x41bf2d,_0x301d4a){_0x41bf2d=_0x41bf2d-0x0;var _0x27b432=_0xadb5[_0x41bf2d];return _0x27b432;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x5adb('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x5adb('0x2')](0xb),'unique':_0x5adb('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':_0x5adb('0x5')},'logo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x5adb('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnusername':{'type':Sequelize[_0x5adb('0x4')]},'turnpassword':{'type':Sequelize[_0x5adb('0x4')]},'pageTitle':{'type':Sequelize[_0x5adb('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x5adb('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x5adb('0x7')},'enableEmailPreview':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x5adb('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x5adb('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x5adb('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x5adb('0x2')]},'transcribeRegion':{'type':Sequelize[_0x5adb('0x4')]},'sentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x5adb('0x2')]},'sentimentRegion':{'type':Sequelize[_0x5adb('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x5adb('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x5adb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x5adb('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 56f8653..d25ae78 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 _0x65a4=['zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','request','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','reject','save','destroy','stack','name','index','map','Setting','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','includeAll','findAll','rows','show','include','merge','options','find','body','params','file','filename','addLogoLogin','loginLogo','getLicense','logo','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','../../config/license/util','getLogoLogin','server/files/images/logos','gdpr','securePassword','addPreferred','getPreferred','preferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf'];(function(_0x4264bf,_0x39db0f){var _0x515e5f=function(_0x130168){while(--_0x130168){_0x4264bf['push'](_0x4264bf['shift']());}};_0x515e5f(++_0x39db0f);}(_0x65a4,0x166));var _0x465a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x65a4[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x465a('0x0'));var rimraf=require(_0x465a('0x1'));var zipdir=require(_0x465a('0x2'));var jsonpatch=require(_0x465a('0x3'));var rp=require(_0x465a('0x4'));var moment=require(_0x465a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x465a('0x6'));var util=require('util');var path=require(_0x465a('0x7'));var sox=require('sox');var csv=require(_0x465a('0x8'));var ejs=require(_0x465a('0x9'));var fs=require('fs');var fs_extra=require(_0x465a('0xa'));var _=require(_0x465a('0xb'));var squel=require(_0x465a('0xc'));var crypto=require(_0x465a('0xd'));var jsforce=require(_0x465a('0xe'));var deskjs=require(_0x465a('0xf'));var toCsv=require(_0x465a('0x8'));var querystring=require('querystring');var Papa=require(_0x465a('0x10'));var Redis=require(_0x465a('0x11'));var authService=require(_0x465a('0x12'));var qs=require(_0x465a('0x13'));var as=require(_0x465a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x465a('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x465a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x465a('0x17'))['db'];var jayson=require(_0x465a('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x70e618,_0x4d36c8,_0x4078a5,_0x5a1ea2){return new BPromise(function(_0x103f5d,_0x3f7098){var _0x4773d1=_0x5a1ea2||client;return _0x4773d1[_0x465a('0x19')](_0x70e618,_0x4078a5)[_0x465a('0x1a')](function(_0x500c58){logger[_0x465a('0x1b')]('Setting,\x20%s,\x20%s',_0x4d36c8,_0x465a('0x1c'));logger['debug'](_0x465a('0x1d'),_0x4d36c8,_0x465a('0x1c'),JSON['stringify'](_0x500c58));if(_0x500c58[_0x465a('0x1e')]){if(_0x500c58['error'][_0x465a('0x1f')]===0x1f4){logger[_0x465a('0x1e')](_0x465a('0x20'),_0x4d36c8,_0x500c58[_0x465a('0x1e')]['message']);return _0x3f7098(_0x500c58['error'][_0x465a('0x21')]);}logger[_0x465a('0x1e')](_0x465a('0x20'),_0x4d36c8,_0x500c58['error'][_0x465a('0x21')]);return _0x103f5d(_0x500c58[_0x465a('0x1e')][_0x465a('0x21')]);}else{logger['info'](_0x465a('0x20'),_0x4d36c8,_0x465a('0x1c'));_0x103f5d(_0x500c58[_0x465a('0x22')][_0x465a('0x21')]);}})[_0x465a('0x23')](function(_0x4fd592){logger[_0x465a('0x1e')]('Setting,\x20%s,\x20%s',_0x4d36c8,_0x4fd592);_0x3f7098(_0x4fd592);});});}function respondWithStatusCode(_0x43ceb4,_0xe23a16){_0xe23a16=_0xe23a16||0xcc;return function(_0x4c6ff8){if(_0x4c6ff8){return _0x43ceb4[_0x465a('0x24')](_0xe23a16);}return _0x43ceb4[_0x465a('0x25')](_0xe23a16)[_0x465a('0x26')]();};}function respondWithResult(_0xbb6e56,_0x326827){_0x326827=_0x326827||0xc8;return function(_0x47b58c){if(_0x47b58c){return _0xbb6e56[_0x465a('0x25')](_0x326827)['json'](_0x47b58c);}};}function respondWithFilteredResult(_0x5e0434,_0x2e5f71){return function(_0x22994f){if(_0x22994f){var _0x88b93a=typeof _0x2e5f71[_0x465a('0x27')]===_0x465a('0x28')&&typeof _0x2e5f71['limit']===_0x465a('0x28');var _0x9226de=_0x22994f[_0x465a('0x29')];var _0x28bc23=_0x88b93a?0x0:_0x2e5f71[_0x465a('0x27')];var _0x5f6f50=_0x88b93a?_0x22994f[_0x465a('0x29')]:_0x2e5f71['offset']+_0x2e5f71[_0x465a('0x2a')];var _0x14984c;if(_0x5f6f50>=_0x9226de){_0x5f6f50=_0x9226de;_0x14984c=0xc8;}else{_0x14984c=0xce;}_0x5e0434[_0x465a('0x25')](_0x14984c);return _0x5e0434['set'](_0x465a('0x2b'),_0x28bc23+'-'+_0x5f6f50+'/'+_0x9226de)[_0x465a('0x2c')](_0x22994f);}return null;};}function patchUpdates(_0x54bea3){return function(_0x444865){try{jsonpatch['apply'](_0x444865,_0x54bea3,!![]);}catch(_0x59e639){return BPromise[_0x465a('0x2d')](_0x59e639);}return _0x444865[_0x465a('0x2e')]();};}function saveUpdates(_0x1aa641,_0x333707){return function(_0x3e11cc){if(_0x3e11cc){return _0x3e11cc['update'](_0x1aa641)[_0x465a('0x1a')](function(_0x17969a){return _0x17969a;});}return null;};}function removeEntity(_0x165f4f,_0xe6431f){return function(_0x1280f1){if(_0x1280f1){return _0x1280f1[_0x465a('0x2f')]()[_0x465a('0x1a')](function(){_0x165f4f[_0x465a('0x25')](0xcc)[_0x465a('0x26')]();});}};}function handleEntityNotFound(_0x250997,_0x1e2106){return function(_0xa7b2cc){if(!_0xa7b2cc){_0x250997['sendStatus'](0x194);}return _0xa7b2cc;};}function handleError(_0xad3751,_0x1f271c){_0x1f271c=_0x1f271c||0x1f4;return function(_0x30bc7d){logger['error'](_0x30bc7d[_0x465a('0x30')]);if(_0x30bc7d[_0x465a('0x31')]){delete _0x30bc7d[_0x465a('0x31')];}_0xad3751[_0x465a('0x25')](_0x1f271c)['send'](_0x30bc7d);};}exports[_0x465a('0x32')]=function(_0x14b8c2,_0x38de74){var _0x3ac162={},_0x5289f8={},_0x552ab9={'count':0x0,'rows':[]};var _0x12bba7=_[_0x465a('0x33')](db[_0x465a('0x34')][_0x465a('0x35')],function(_0x15bb44){return{'name':_0x15bb44[_0x465a('0x36')],'type':_0x15bb44['type']['key']};});_0x5289f8[_0x465a('0x37')]=_[_0x465a('0x33')](_0x12bba7,_0x465a('0x31'));_0x5289f8[_0x465a('0x38')]=_[_0x465a('0x39')](_0x14b8c2[_0x465a('0x38')]);_0x5289f8['filters']=_[_0x465a('0x3a')](_0x5289f8['model'],_0x5289f8['query']);_0x3ac162[_0x465a('0x3b')]=_[_0x465a('0x3a')](_0x5289f8['model'],qs[_0x465a('0x3c')](_0x14b8c2[_0x465a('0x38')][_0x465a('0x3c')]));_0x3ac162['attributes']=_0x3ac162[_0x465a('0x3b')][_0x465a('0x3d')]?_0x3ac162[_0x465a('0x3b')]:_0x5289f8[_0x465a('0x37')];if(!_0x14b8c2[_0x465a('0x38')][_0x465a('0x3e')](_0x465a('0x3f'))){_0x3ac162['limit']=qs[_0x465a('0x2a')](_0x14b8c2['query'][_0x465a('0x2a')]);_0x3ac162[_0x465a('0x27')]=qs['offset'](_0x14b8c2[_0x465a('0x38')][_0x465a('0x27')]);}_0x3ac162[_0x465a('0x40')]=qs[_0x465a('0x41')](_0x14b8c2[_0x465a('0x38')][_0x465a('0x41')]);_0x3ac162[_0x465a('0x42')]=qs[_0x465a('0x43')](_[_0x465a('0x44')](_0x14b8c2['query'],_0x5289f8[_0x465a('0x43')]),_0x12bba7);if(_0x14b8c2[_0x465a('0x38')][_0x465a('0x45')]){_0x3ac162[_0x465a('0x42')]=_['merge'](_0x3ac162['where'],{'$or':_['map'](_0x12bba7,function(_0xa8556f){if(_0xa8556f[_0x465a('0x46')]!=='VIRTUAL'){var _0x5159f4={};_0x5159f4[_0xa8556f[_0x465a('0x31')]]={'$like':'%'+_0x14b8c2['query'][_0x465a('0x45')]+'%'};return _0x5159f4;}})});}_0x3ac162=_['merge']({},_0x3ac162,_0x14b8c2['options']);var _0x4fba26={'where':_0x3ac162['where']};return db[_0x465a('0x34')][_0x465a('0x29')](_0x4fba26)['then'](function(_0x2f71bb){_0x552ab9['count']=_0x2f71bb;if(_0x14b8c2[_0x465a('0x38')][_0x465a('0x47')]){_0x3ac162['include']=[{'all':!![]}];}return db[_0x465a('0x34')][_0x465a('0x48')](_0x3ac162);})[_0x465a('0x1a')](function(_0x486cf0){_0x552ab9[_0x465a('0x49')]=_0x486cf0;return _0x552ab9;})[_0x465a('0x1a')](respondWithFilteredResult(_0x38de74,_0x3ac162))[_0x465a('0x23')](handleError(_0x38de74,null));};exports[_0x465a('0x4a')]=function(_0x51e839,_0x35c6a7){var _0x10e393={'raw':![],'where':{'id':_0x51e839['params']['id']}},_0x1f4c6={};_0x1f4c6['model']=_[_0x465a('0x39')](db[_0x465a('0x34')][_0x465a('0x35')]);_0x1f4c6[_0x465a('0x38')]=_[_0x465a('0x39')](_0x51e839[_0x465a('0x38')]);_0x1f4c6[_0x465a('0x43')]=_[_0x465a('0x3a')](_0x1f4c6[_0x465a('0x37')],_0x1f4c6[_0x465a('0x38')]);_0x10e393[_0x465a('0x3b')]=_[_0x465a('0x3a')](_0x1f4c6[_0x465a('0x37')],qs[_0x465a('0x3c')](_0x51e839[_0x465a('0x38')]['fields']));_0x10e393[_0x465a('0x3b')]=_0x10e393[_0x465a('0x3b')][_0x465a('0x3d')]?_0x10e393[_0x465a('0x3b')]:_0x1f4c6[_0x465a('0x37')];if(_0x51e839['query'][_0x465a('0x47')]){_0x10e393[_0x465a('0x4b')]=[{'all':!![]}];}_0x10e393=_[_0x465a('0x4c')]({},_0x10e393,_0x51e839[_0x465a('0x4d')]);return db[_0x465a('0x34')][_0x465a('0x4e')](_0x10e393)[_0x465a('0x1a')](handleEntityNotFound(_0x35c6a7,null))[_0x465a('0x1a')](respondWithResult(_0x35c6a7,null))['catch'](handleError(_0x35c6a7,null));};exports['update']=function(_0x2ffdd5,_0x391c93){if(_0x2ffdd5[_0x465a('0x4f')]['id']){delete _0x2ffdd5['body']['id'];}return db['Setting'][_0x465a('0x4e')]({'where':{'id':_0x2ffdd5[_0x465a('0x50')]['id']}})[_0x465a('0x1a')](handleEntityNotFound(_0x391c93,null))[_0x465a('0x1a')](saveUpdates(_0x2ffdd5[_0x465a('0x4f')],null))['then'](respondWithResult(_0x391c93,null))[_0x465a('0x23')](handleError(_0x391c93,null));};exports['addLogo']=function(_0x5bf3e8,_0x17e62c,_0x1e502c){if(_0x5bf3e8[_0x465a('0x51')]&&_0x5bf3e8[_0x465a('0x51')][_0x465a('0x52')]){_0x5bf3e8['body']['logo']=_0x5bf3e8[_0x465a('0x51')][_0x465a('0x52')];}return db[_0x465a('0x34')][_0x465a('0x4e')]({'where':{'id':_0x5bf3e8[_0x465a('0x50')]['id']}})[_0x465a('0x1a')](handleEntityNotFound(_0x17e62c,null))[_0x465a('0x1a')](saveUpdates(_0x5bf3e8[_0x465a('0x4f')],null))[_0x465a('0x1a')](respondWithResult(_0x17e62c,null))[_0x465a('0x23')](handleError(_0x17e62c,null));};exports[_0x465a('0x53')]=function(_0x1a9a3a,_0x13a3b1,_0x8672eb){if(_0x1a9a3a[_0x465a('0x51')]&&_0x1a9a3a[_0x465a('0x51')][_0x465a('0x52')]){_0x1a9a3a[_0x465a('0x4f')][_0x465a('0x54')]=_0x1a9a3a[_0x465a('0x51')][_0x465a('0x52')];}return db[_0x465a('0x34')]['find']({'where':{'id':_0x1a9a3a['params']['id']}})['then'](handleEntityNotFound(_0x13a3b1,null))[_0x465a('0x1a')](saveUpdates(_0x1a9a3a['body'],null))[_0x465a('0x1a')](respondWithResult(_0x13a3b1,null))['catch'](handleError(_0x13a3b1,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0xf0702,_0x3f7c71,_0x4defb7){var _0x197352='server/files/images/logos';var _0x8ca8a0={'custom':![]};return utilLicense[_0x465a('0x55')]()[_0x465a('0x1a')](function(_0x296cab){if(_0x296cab){_0x8ca8a0=_0x296cab;}return db[_0x465a('0x34')][_0x465a('0x4e')]({'where':{'id':_0xf0702[_0x465a('0x50')]['id']},'attributes':[_0x465a('0x56'),'loginLogo','preferred',_0x465a('0x57'),_0x465a('0x58'),_0x465a('0x59'),_0x465a('0x5a'),_0x465a('0x5b')],'raw':!![]});})[_0x465a('0x1a')](handleEntityNotFound(_0x3f7c71,null))[_0x465a('0x1a')](function(_0x177408){if(_0x177408){var _0x5468cc=_0x177408[_0x465a('0x56')]&&fs[_0x465a('0x5c')](path[_0x465a('0x5d')](config[_0x465a('0x5e')],_0x197352,_[_0x465a('0x5f')](_0x177408['logo'])))?path[_0x465a('0x5d')](config['root'],_0x197352,_[_0x465a('0x5f')](_0x177408[_0x465a('0x56')])):path[_0x465a('0x5d')](config['root'],_0x197352,_[_0x465a('0x5f')]('default_logo.svg'));var _0x252623=_0x465a('0x60')+_[_0x465a('0x61')]('logo');if(_0x177408[_0x252623]||!_0x8ca8a0[_0x465a('0x62')]){_0x5468cc=path[_0x465a('0x5d')](config[_0x465a('0x5e')],_0x197352,_['toLower'](_0x465a('0x63')));}if(!fs[_0x465a('0x5c')](_0x5468cc)){throw new db[(_0x465a('0x64'))][(_0x465a('0x65'))](_['upperFirst'](_0x465a('0x56'))+_0x465a('0x66'));}return _0x3f7c71[_0x465a('0x67')](_0x5468cc);}})[_0x465a('0x23')](handleError(_0x3f7c71,null));};var utilLicense=require(_0x465a('0x68'));exports[_0x465a('0x69')]=function(_0x2019d5,_0x570ce9,_0x536310){var _0x4edd0a=_0x465a('0x6a');var _0x47bedb={'custom':![]};return utilLicense[_0x465a('0x55')]()['then'](function(_0x5159b4){if(_0x5159b4){_0x47bedb=_0x5159b4;}return db[_0x465a('0x34')][_0x465a('0x4e')]({'where':{'id':_0x2019d5[_0x465a('0x50')]['id']},'attributes':[_0x465a('0x56'),_0x465a('0x54'),'preferred',_0x465a('0x57'),_0x465a('0x58'),_0x465a('0x59'),_0x465a('0x5a'),_0x465a('0x5b')],'raw':!![]});})[_0x465a('0x1a')](handleEntityNotFound(_0x570ce9,null))['then'](function(_0x4dabad){if(_0x4dabad){var _0x4eecd9=_0x4dabad[_0x465a('0x54')]&&fs[_0x465a('0x5c')](path[_0x465a('0x5d')](config[_0x465a('0x5e')],_0x4edd0a,_[_0x465a('0x5f')](_0x4dabad[_0x465a('0x54')])))?path[_0x465a('0x5d')](config[_0x465a('0x5e')],_0x4edd0a,_[_0x465a('0x5f')](_0x4dabad['loginLogo'])):path[_0x465a('0x5d')](config[_0x465a('0x5e')],_0x4edd0a,_[_0x465a('0x5f')]('default_loginLogo.svg'));var _0x58c604=_0x465a('0x60')+_['upperFirst']('loginLogo');if(_0x4dabad[_0x58c604]||!_0x47bedb[_0x465a('0x62')]){_0x4eecd9=path[_0x465a('0x5d')](config[_0x465a('0x5e')],_0x4edd0a,_[_0x465a('0x5f')]('default_loginLogo.svg'));}if(!fs[_0x465a('0x5c')](_0x4eecd9)){throw new db[(_0x465a('0x64'))][(_0x465a('0x65'))](_[_0x465a('0x61')](_0x465a('0x54'))+_0x465a('0x66'));}return _0x570ce9['download'](_0x4eecd9);}})[_0x465a('0x23')](handleError(_0x570ce9,null));};exports[_0x465a('0x6b')]=function(_0x502016,_0x1d1451){return db[_0x465a('0x34')]['find']({'where':{'id':_0x502016[_0x465a('0x50')]['id']},'attributes':[_0x465a('0x6c')]})[_0x465a('0x1a')](respondWithResult(_0x1d1451,null))[_0x465a('0x23')](handleError(_0x1d1451,null));};exports[_0x465a('0x6d')]=function(_0x281fd3,_0x2f1ada,_0x474b2b){if(_0x281fd3['file']&&_0x281fd3['file'][_0x465a('0x52')]){_0x281fd3[_0x465a('0x4f')]['preferred']=_0x281fd3['file'][_0x465a('0x52')];}return db['Setting'][_0x465a('0x4e')]({'where':{'id':_0x281fd3['params']['id']}})[_0x465a('0x1a')](handleEntityNotFound(_0x2f1ada,null))[_0x465a('0x1a')](saveUpdates(_0x281fd3[_0x465a('0x4f')],null))[_0x465a('0x1a')](respondWithResult(_0x2f1ada,null))[_0x465a('0x23')](handleError(_0x2f1ada,null));};var utilLicense=require('../../config/license/util');exports[_0x465a('0x6e')]=function(_0x580ff8,_0x5dc52e,_0x2ac585){var _0x39b134=_0x465a('0x6a');var _0x58f0b8={'custom':![]};return utilLicense['getLicense']()[_0x465a('0x1a')](function(_0x22f37a){if(_0x22f37a){_0x58f0b8=_0x22f37a;}return db[_0x465a('0x34')][_0x465a('0x4e')]({'where':{'id':_0x580ff8[_0x465a('0x50')]['id']},'attributes':[_0x465a('0x56'),_0x465a('0x54'),_0x465a('0x6f'),'favicon',_0x465a('0x58'),'defaultLoginLogo',_0x465a('0x5a'),_0x465a('0x5b')],'raw':!![]});})['then'](handleEntityNotFound(_0x5dc52e,null))['then'](function(_0x52b21f){if(_0x52b21f){var _0x23fddd=_0x52b21f['preferred']&&fs[_0x465a('0x5c')](path[_0x465a('0x5d')](config[_0x465a('0x5e')],_0x39b134,_[_0x465a('0x5f')](_0x52b21f[_0x465a('0x6f')])))?path['join'](config[_0x465a('0x5e')],_0x39b134,_['toLower'](_0x52b21f['preferred'])):path['join'](config[_0x465a('0x5e')],_0x39b134,_['toLower']('default_preferred.png'));var _0x4e3205=_0x465a('0x60')+_[_0x465a('0x61')](_0x465a('0x6f'));if(_0x52b21f[_0x4e3205]||!_0x58f0b8[_0x465a('0x62')]||!_0x58f0b8[_0x465a('0x6f')]){_0x23fddd=path[_0x465a('0x5d')](config['root'],_0x39b134,_[_0x465a('0x5f')](_0x465a('0x70')));}if(!fs[_0x465a('0x5c')](_0x23fddd)){throw new db[(_0x465a('0x64'))][(_0x465a('0x65'))](_[_0x465a('0x61')]('preferred')+'\x20not\x20found');}return _0x5dc52e[_0x465a('0x67')](_0x23fddd);}})[_0x465a('0x23')](handleError(_0x5dc52e,null));};exports['addFavicon']=function(_0xe2aefd,_0x42c97a,_0x15dc91){if(_0xe2aefd[_0x465a('0x51')]&&_0xe2aefd[_0x465a('0x51')]['filename']){_0xe2aefd[_0x465a('0x4f')][_0x465a('0x57')]=_0xe2aefd[_0x465a('0x51')][_0x465a('0x52')];}return db[_0x465a('0x34')][_0x465a('0x4e')]({'where':{'id':_0xe2aefd['params']['id']}})[_0x465a('0x1a')](handleEntityNotFound(_0x42c97a,null))['then'](saveUpdates(_0xe2aefd[_0x465a('0x4f')],null))[_0x465a('0x1a')](respondWithResult(_0x42c97a,null))[_0x465a('0x23')](handleError(_0x42c97a,null));};var utilLicense=require(_0x465a('0x68'));exports[_0x465a('0x71')]=function(_0x33c79f,_0x199b41,_0x280fed){var _0x3fd284=_0x465a('0x6a');var _0x51671e={'custom':![]};return utilLicense['getLicense']()[_0x465a('0x1a')](function(_0x2c7f1d){if(_0x2c7f1d){_0x51671e=_0x2c7f1d;}return db['Setting']['find']({'where':{'id':_0x33c79f[_0x465a('0x50')]['id']},'attributes':['logo',_0x465a('0x54'),_0x465a('0x6f'),_0x465a('0x57'),_0x465a('0x58'),_0x465a('0x59'),_0x465a('0x5a'),_0x465a('0x5b')],'raw':!![]});})[_0x465a('0x1a')](handleEntityNotFound(_0x199b41,null))['then'](function(_0x202b4e){if(_0x202b4e){var _0x1f3325=_0x202b4e[_0x465a('0x57')]&&fs[_0x465a('0x5c')](path[_0x465a('0x5d')](config[_0x465a('0x5e')],_0x3fd284,_['toLower'](_0x202b4e[_0x465a('0x57')])))?path[_0x465a('0x5d')](config[_0x465a('0x5e')],_0x3fd284,_['toLower'](_0x202b4e[_0x465a('0x57')])):path['join'](config['root'],_0x3fd284,_[_0x465a('0x5f')](_0x465a('0x72')));var _0xa48ce2='default'+_['upperFirst'](_0x465a('0x57'));if(_0x202b4e[_0xa48ce2]||!_0x51671e['custom']){_0x1f3325=path[_0x465a('0x5d')](config[_0x465a('0x5e')],_0x3fd284,_[_0x465a('0x5f')]('default_favicon.ico'));}if(!fs[_0x465a('0x5c')](_0x1f3325)){throw new db[(_0x465a('0x64'))][(_0x465a('0x65'))](_[_0x465a('0x61')](_0x465a('0x57'))+_0x465a('0x66'));}return _0x199b41[_0x465a('0x67')](_0x1f3325);}})[_0x465a('0x23')](handleError(_0x199b41,null));};exports[_0x465a('0x73')]=function(_0xce508e,_0x2fe0be){var _0x31044a={'offset':moment()[_0x465a('0x74')]()};_0x31044a['now']=moment()[_0x465a('0x74')](_0x31044a[_0x465a('0x27')])[_0x465a('0x75')](_0x465a('0x76'));return _0x2fe0be[_0x465a('0x25')](0xc8)[_0x465a('0x77')](_0x31044a);}; \ No newline at end of file +var _0x070c=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','stack','send','index','Setting','rawAttributes','fieldName','type','key','model','map','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','show','params','keys','options','find','body','addLogo','file','logo','filename','addLogoLogin','loginLogo','getLogo','getLicense','preferred','favicon','defaultLogo','defaultPreferred','join','root','toLower','default_logo.svg','default','upperFirst','custom','ValidationError','\x20not\x20found','download','server/files/images/logos','defaultLoginLogo','default_loginLogo.svg','Sequelize','gdpr','securePassword','getPreferred','defaultFavicon','default_preferred.png','existsSync','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox'];(function(_0x357be4,_0x3bc32f){var _0xa8b73d=function(_0x213895){while(--_0x213895){_0x357be4['push'](_0x357be4['shift']());}};_0xa8b73d(++_0x3bc32f);}(_0x070c,0xfb));var _0xc070=function(_0x26bb37,_0x169d5a){_0x26bb37=_0x26bb37-0x0;var _0x26e7ab=_0x070c[_0x26bb37];return _0x26e7ab;};'use strict';var emlformat=require(_0xc070('0x0'));var rimraf=require(_0xc070('0x1'));var zipdir=require(_0xc070('0x2'));var jsonpatch=require(_0xc070('0x3'));var rp=require(_0xc070('0x4'));var moment=require(_0xc070('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc070('0x6'));var util=require('util');var path=require(_0xc070('0x7'));var sox=require(_0xc070('0x8'));var csv=require(_0xc070('0x9'));var ejs=require(_0xc070('0xa'));var fs=require('fs');var fs_extra=require(_0xc070('0xb'));var _=require(_0xc070('0xc'));var squel=require(_0xc070('0xd'));var crypto=require(_0xc070('0xe'));var jsforce=require(_0xc070('0xf'));var deskjs=require(_0xc070('0x10'));var toCsv=require(_0xc070('0x9'));var querystring=require(_0xc070('0x11'));var Papa=require(_0xc070('0x12'));var Redis=require(_0xc070('0x13'));var authService=require(_0xc070('0x14'));var qs=require(_0xc070('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc070('0x16'))(_0xc070('0x17'));var utils=require(_0xc070('0x18'));var config=require(_0xc070('0x19'));var licenseUtil=require(_0xc070('0x1a'));var db=require(_0xc070('0x1b'))['db'];var jayson=require(_0xc070('0x1c'));var client=jayson[_0xc070('0x1d')][_0xc070('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3a5fe2,_0x5f100d,_0x21c3be,_0x2ec485){return new BPromise(function(_0x345c28,_0x2256bd){var _0x463918=_0x2ec485||client;return _0x463918[_0xc070('0x1f')](_0x3a5fe2,_0x21c3be)['then'](function(_0x3cc199){logger[_0xc070('0x20')](_0xc070('0x21'),_0x5f100d,'request\x20sent');logger[_0xc070('0x22')]('Setting,\x20%s,\x20%s,\x20%s',_0x5f100d,'request\x20sent',JSON[_0xc070('0x23')](_0x3cc199));if(_0x3cc199['error']){if(_0x3cc199['error'][_0xc070('0x24')]===0x1f4){logger[_0xc070('0x25')](_0xc070('0x21'),_0x5f100d,_0x3cc199[_0xc070('0x25')][_0xc070('0x26')]);return _0x2256bd(_0x3cc199[_0xc070('0x25')][_0xc070('0x26')]);}logger[_0xc070('0x25')](_0xc070('0x21'),_0x5f100d,_0x3cc199[_0xc070('0x25')]['message']);return _0x345c28(_0x3cc199['error'][_0xc070('0x26')]);}else{logger['info'](_0xc070('0x21'),_0x5f100d,_0xc070('0x27'));_0x345c28(_0x3cc199[_0xc070('0x28')]['message']);}})[_0xc070('0x29')](function(_0x4af087){logger[_0xc070('0x25')](_0xc070('0x21'),_0x5f100d,_0x4af087);_0x2256bd(_0x4af087);});});}function respondWithStatusCode(_0x2948c2,_0x573c1c){_0x573c1c=_0x573c1c||0xcc;return function(_0x28860f){if(_0x28860f){return _0x2948c2[_0xc070('0x2a')](_0x573c1c);}return _0x2948c2[_0xc070('0x2b')](_0x573c1c)[_0xc070('0x2c')]();};}function respondWithResult(_0x219158,_0x1d875d){_0x1d875d=_0x1d875d||0xc8;return function(_0x206c12){if(_0x206c12){return _0x219158['status'](_0x1d875d)['json'](_0x206c12);}};}function respondWithFilteredResult(_0x5fd8c,_0x431e37){return function(_0x3c6ca7){if(_0x3c6ca7){var _0x201a49=typeof _0x431e37['offset']==='undefined'&&typeof _0x431e37[_0xc070('0x2d')]===_0xc070('0x2e');var _0x182829=_0x3c6ca7[_0xc070('0x2f')];var _0x284a67=_0x201a49?0x0:_0x431e37[_0xc070('0x30')];var _0x183aeb=_0x201a49?_0x3c6ca7['count']:_0x431e37['offset']+_0x431e37[_0xc070('0x2d')];var _0x33d333;if(_0x183aeb>=_0x182829){_0x183aeb=_0x182829;_0x33d333=0xc8;}else{_0x33d333=0xce;}_0x5fd8c[_0xc070('0x2b')](_0x33d333);return _0x5fd8c[_0xc070('0x31')](_0xc070('0x32'),_0x284a67+'-'+_0x183aeb+'/'+_0x182829)[_0xc070('0x33')](_0x3c6ca7);}return null;};}function patchUpdates(_0x4dbce3){return function(_0x58a05c){try{jsonpatch[_0xc070('0x34')](_0x58a05c,_0x4dbce3,!![]);}catch(_0xd5c47f){return BPromise[_0xc070('0x35')](_0xd5c47f);}return _0x58a05c[_0xc070('0x36')]();};}function saveUpdates(_0x4fd12f,_0x27fc70){return function(_0xac3a6b){if(_0xac3a6b){return _0xac3a6b[_0xc070('0x37')](_0x4fd12f)[_0xc070('0x38')](function(_0x2947f6){return _0x2947f6;});}return null;};}function removeEntity(_0x3ae335,_0x1b4e49){return function(_0xc4bdc7){if(_0xc4bdc7){return _0xc4bdc7['destroy']()[_0xc070('0x38')](function(){_0x3ae335[_0xc070('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53b949,_0x534d5b){return function(_0x30a478){if(!_0x30a478){_0x53b949['sendStatus'](0x194);}return _0x30a478;};}function handleError(_0x1d349b,_0x5765a4){_0x5765a4=_0x5765a4||0x1f4;return function(_0x1de096){logger[_0xc070('0x25')](_0x1de096[_0xc070('0x39')]);if(_0x1de096['name']){delete _0x1de096['name'];}_0x1d349b['status'](_0x5765a4)[_0xc070('0x3a')](_0x1de096);};}exports[_0xc070('0x3b')]=function(_0x464dfa,_0x9cc5ce){var _0x202987={},_0x353560={},_0xc139dd={'count':0x0,'rows':[]};var _0x3dae1b=_['map'](db[_0xc070('0x3c')][_0xc070('0x3d')],function(_0x4c620e){return{'name':_0x4c620e[_0xc070('0x3e')],'type':_0x4c620e[_0xc070('0x3f')][_0xc070('0x40')]};});_0x353560[_0xc070('0x41')]=_[_0xc070('0x42')](_0x3dae1b,_0xc070('0x43'));_0x353560[_0xc070('0x44')]=_['keys'](_0x464dfa[_0xc070('0x44')]);_0x353560[_0xc070('0x45')]=_[_0xc070('0x46')](_0x353560[_0xc070('0x41')],_0x353560[_0xc070('0x44')]);_0x202987['attributes']=_['intersection'](_0x353560['model'],qs[_0xc070('0x47')](_0x464dfa[_0xc070('0x44')][_0xc070('0x47')]));_0x202987[_0xc070('0x48')]=_0x202987['attributes'][_0xc070('0x49')]?_0x202987[_0xc070('0x48')]:_0x353560['model'];if(!_0x464dfa[_0xc070('0x44')][_0xc070('0x4a')](_0xc070('0x4b'))){_0x202987[_0xc070('0x2d')]=qs[_0xc070('0x2d')](_0x464dfa[_0xc070('0x44')][_0xc070('0x2d')]);_0x202987[_0xc070('0x30')]=qs[_0xc070('0x30')](_0x464dfa[_0xc070('0x44')][_0xc070('0x30')]);}_0x202987[_0xc070('0x4c')]=qs[_0xc070('0x4d')](_0x464dfa[_0xc070('0x44')][_0xc070('0x4d')]);_0x202987[_0xc070('0x4e')]=qs[_0xc070('0x45')](_[_0xc070('0x4f')](_0x464dfa[_0xc070('0x44')],_0x353560['filters']),_0x3dae1b);if(_0x464dfa[_0xc070('0x44')][_0xc070('0x50')]){_0x202987[_0xc070('0x4e')]=_[_0xc070('0x51')](_0x202987['where'],{'$or':_[_0xc070('0x42')](_0x3dae1b,function(_0x49ada3){if(_0x49ada3['type']!==_0xc070('0x52')){var _0x4465fc={};_0x4465fc[_0x49ada3['name']]={'$like':'%'+_0x464dfa[_0xc070('0x44')][_0xc070('0x50')]+'%'};return _0x4465fc;}})});}_0x202987=_['merge']({},_0x202987,_0x464dfa['options']);var _0x308932={'where':_0x202987[_0xc070('0x4e')]};return db[_0xc070('0x3c')]['count'](_0x308932)[_0xc070('0x38')](function(_0xb2c568){_0xc139dd[_0xc070('0x2f')]=_0xb2c568;if(_0x464dfa[_0xc070('0x44')]['includeAll']){_0x202987[_0xc070('0x53')]=[{'all':!![]}];}return db[_0xc070('0x3c')]['findAll'](_0x202987);})['then'](function(_0x34fd96){_0xc139dd['rows']=_0x34fd96;return _0xc139dd;})[_0xc070('0x38')](respondWithFilteredResult(_0x9cc5ce,_0x202987))[_0xc070('0x29')](handleError(_0x9cc5ce,null));};exports[_0xc070('0x54')]=function(_0x5c4f5d,_0x1ca242){var _0x3394ed={'raw':![],'where':{'id':_0x5c4f5d[_0xc070('0x55')]['id']}},_0x51376d={};_0x51376d['model']=_['keys'](db[_0xc070('0x3c')][_0xc070('0x3d')]);_0x51376d[_0xc070('0x44')]=_[_0xc070('0x56')](_0x5c4f5d['query']);_0x51376d[_0xc070('0x45')]=_[_0xc070('0x46')](_0x51376d[_0xc070('0x41')],_0x51376d[_0xc070('0x44')]);_0x3394ed[_0xc070('0x48')]=_['intersection'](_0x51376d[_0xc070('0x41')],qs[_0xc070('0x47')](_0x5c4f5d[_0xc070('0x44')][_0xc070('0x47')]));_0x3394ed[_0xc070('0x48')]=_0x3394ed[_0xc070('0x48')][_0xc070('0x49')]?_0x3394ed[_0xc070('0x48')]:_0x51376d[_0xc070('0x41')];if(_0x5c4f5d[_0xc070('0x44')]['includeAll']){_0x3394ed[_0xc070('0x53')]=[{'all':!![]}];}_0x3394ed=_[_0xc070('0x51')]({},_0x3394ed,_0x5c4f5d[_0xc070('0x57')]);return db[_0xc070('0x3c')]['find'](_0x3394ed)[_0xc070('0x38')](handleEntityNotFound(_0x1ca242,null))[_0xc070('0x38')](respondWithResult(_0x1ca242,null))[_0xc070('0x29')](handleError(_0x1ca242,null));};exports[_0xc070('0x37')]=function(_0x5787ed,_0x3e2350){if(_0x5787ed['body']['id']){delete _0x5787ed['body']['id'];}return db[_0xc070('0x3c')][_0xc070('0x58')]({'where':{'id':_0x5787ed['params']['id']}})[_0xc070('0x38')](handleEntityNotFound(_0x3e2350,null))[_0xc070('0x38')](saveUpdates(_0x5787ed[_0xc070('0x59')],null))[_0xc070('0x38')](respondWithResult(_0x3e2350,null))[_0xc070('0x29')](handleError(_0x3e2350,null));};exports[_0xc070('0x5a')]=function(_0x1bbab4,_0x4d6576,_0x598ce6){if(_0x1bbab4[_0xc070('0x5b')]&&_0x1bbab4[_0xc070('0x5b')]['filename']){_0x1bbab4[_0xc070('0x59')][_0xc070('0x5c')]=_0x1bbab4[_0xc070('0x5b')][_0xc070('0x5d')];}return db['Setting']['find']({'where':{'id':_0x1bbab4[_0xc070('0x55')]['id']}})[_0xc070('0x38')](handleEntityNotFound(_0x4d6576,null))['then'](saveUpdates(_0x1bbab4['body'],null))['then'](respondWithResult(_0x4d6576,null))[_0xc070('0x29')](handleError(_0x4d6576,null));};exports[_0xc070('0x5e')]=function(_0x3842bc,_0x419705,_0x8fde3b){if(_0x3842bc['file']&&_0x3842bc[_0xc070('0x5b')][_0xc070('0x5d')]){_0x3842bc[_0xc070('0x59')][_0xc070('0x5f')]=_0x3842bc[_0xc070('0x5b')][_0xc070('0x5d')];}return db['Setting'][_0xc070('0x58')]({'where':{'id':_0x3842bc['params']['id']}})[_0xc070('0x38')](handleEntityNotFound(_0x419705,null))[_0xc070('0x38')](saveUpdates(_0x3842bc[_0xc070('0x59')],null))[_0xc070('0x38')](respondWithResult(_0x419705,null))[_0xc070('0x29')](handleError(_0x419705,null));};var utilLicense=require(_0xc070('0x1a'));exports[_0xc070('0x60')]=function(_0x404eea,_0x3a5529,_0x1b9ec5){var _0x5c7559='server/files/images/logos';var _0x426389={'custom':![]};return utilLicense[_0xc070('0x61')]()['then'](function(_0x51a2bb){if(_0x51a2bb){_0x426389=_0x51a2bb;}return db[_0xc070('0x3c')][_0xc070('0x58')]({'where':{'id':_0x404eea['params']['id']},'attributes':[_0xc070('0x5c'),_0xc070('0x5f'),_0xc070('0x62'),_0xc070('0x63'),_0xc070('0x64'),'defaultLoginLogo',_0xc070('0x65'),'defaultFavicon'],'raw':!![]});})[_0xc070('0x38')](handleEntityNotFound(_0x3a5529,null))['then'](function(_0x4f825a){if(_0x4f825a){var _0x2ca84f=_0x4f825a['logo']&&fs['existsSync'](path[_0xc070('0x66')](config[_0xc070('0x67')],_0x5c7559,_[_0xc070('0x68')](_0x4f825a['logo'])))?path[_0xc070('0x66')](config['root'],_0x5c7559,_['toLower'](_0x4f825a[_0xc070('0x5c')])):path['join'](config[_0xc070('0x67')],_0x5c7559,_[_0xc070('0x68')](_0xc070('0x69')));var _0x5c2c36=_0xc070('0x6a')+_[_0xc070('0x6b')](_0xc070('0x5c'));if(_0x4f825a[_0x5c2c36]||!_0x426389[_0xc070('0x6c')]){_0x2ca84f=path[_0xc070('0x66')](config[_0xc070('0x67')],_0x5c7559,_['toLower'](_0xc070('0x69')));}if(!fs['existsSync'](_0x2ca84f)){throw new db['Sequelize'][(_0xc070('0x6d'))](_[_0xc070('0x6b')]('logo')+_0xc070('0x6e'));}return _0x3a5529[_0xc070('0x6f')](_0x2ca84f);}})['catch'](handleError(_0x3a5529,null));};var utilLicense=require(_0xc070('0x1a'));exports['getLogoLogin']=function(_0x392078,_0x20df32,_0x467328){var _0x5278dd=_0xc070('0x70');var _0x4794ac={'custom':![]};return utilLicense[_0xc070('0x61')]()[_0xc070('0x38')](function(_0x4a07d4){if(_0x4a07d4){_0x4794ac=_0x4a07d4;}return db[_0xc070('0x3c')][_0xc070('0x58')]({'where':{'id':_0x392078[_0xc070('0x55')]['id']},'attributes':[_0xc070('0x5c'),_0xc070('0x5f'),'preferred','favicon',_0xc070('0x64'),_0xc070('0x71'),_0xc070('0x65'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x20df32,null))[_0xc070('0x38')](function(_0xf92b0b){if(_0xf92b0b){var _0x3a019a=_0xf92b0b[_0xc070('0x5f')]&&fs['existsSync'](path['join'](config[_0xc070('0x67')],_0x5278dd,_['toLower'](_0xf92b0b[_0xc070('0x5f')])))?path[_0xc070('0x66')](config['root'],_0x5278dd,_[_0xc070('0x68')](_0xf92b0b[_0xc070('0x5f')])):path[_0xc070('0x66')](config[_0xc070('0x67')],_0x5278dd,_[_0xc070('0x68')]('default_loginLogo.svg'));var _0x1eafc8=_0xc070('0x6a')+_[_0xc070('0x6b')]('loginLogo');if(_0xf92b0b[_0x1eafc8]||!_0x4794ac[_0xc070('0x6c')]){_0x3a019a=path[_0xc070('0x66')](config[_0xc070('0x67')],_0x5278dd,_[_0xc070('0x68')](_0xc070('0x72')));}if(!fs['existsSync'](_0x3a019a)){throw new db[(_0xc070('0x73'))][(_0xc070('0x6d'))](_[_0xc070('0x6b')](_0xc070('0x5f'))+_0xc070('0x6e'));}return _0x20df32[_0xc070('0x6f')](_0x3a019a);}})['catch'](handleError(_0x20df32,null));};exports[_0xc070('0x74')]=function(_0x979384,_0x2f623f){return db[_0xc070('0x3c')]['find']({'where':{'id':_0x979384[_0xc070('0x55')]['id']},'attributes':[_0xc070('0x75')]})[_0xc070('0x38')](respondWithResult(_0x2f623f,null))[_0xc070('0x29')](handleError(_0x2f623f,null));};exports['addPreferred']=function(_0x2db82d,_0x43ef44,_0x29ee5b){if(_0x2db82d[_0xc070('0x5b')]&&_0x2db82d[_0xc070('0x5b')][_0xc070('0x5d')]){_0x2db82d[_0xc070('0x59')][_0xc070('0x62')]=_0x2db82d[_0xc070('0x5b')]['filename'];}return db[_0xc070('0x3c')][_0xc070('0x58')]({'where':{'id':_0x2db82d['params']['id']}})['then'](handleEntityNotFound(_0x43ef44,null))[_0xc070('0x38')](saveUpdates(_0x2db82d[_0xc070('0x59')],null))['then'](respondWithResult(_0x43ef44,null))[_0xc070('0x29')](handleError(_0x43ef44,null));};var utilLicense=require(_0xc070('0x1a'));exports[_0xc070('0x76')]=function(_0x5cd3dd,_0x2b3bbe,_0x139059){var _0x32fd7f=_0xc070('0x70');var _0x310c1d={'custom':![]};return utilLicense[_0xc070('0x61')]()['then'](function(_0x20208c){if(_0x20208c){_0x310c1d=_0x20208c;}return db[_0xc070('0x3c')]['find']({'where':{'id':_0x5cd3dd[_0xc070('0x55')]['id']},'attributes':['logo',_0xc070('0x5f'),'preferred','favicon',_0xc070('0x64'),_0xc070('0x71'),'defaultPreferred',_0xc070('0x77')],'raw':!![]});})[_0xc070('0x38')](handleEntityNotFound(_0x2b3bbe,null))['then'](function(_0xc888ed){if(_0xc888ed){var _0xe83c63=_0xc888ed['preferred']&&fs['existsSync'](path['join'](config[_0xc070('0x67')],_0x32fd7f,_[_0xc070('0x68')](_0xc888ed[_0xc070('0x62')])))?path['join'](config[_0xc070('0x67')],_0x32fd7f,_[_0xc070('0x68')](_0xc888ed[_0xc070('0x62')])):path[_0xc070('0x66')](config[_0xc070('0x67')],_0x32fd7f,_[_0xc070('0x68')](_0xc070('0x78')));var _0x4df24d=_0xc070('0x6a')+_[_0xc070('0x6b')](_0xc070('0x62'));if(_0xc888ed[_0x4df24d]||!_0x310c1d['custom']||!_0x310c1d[_0xc070('0x62')]){_0xe83c63=path[_0xc070('0x66')](config['root'],_0x32fd7f,_[_0xc070('0x68')](_0xc070('0x78')));}if(!fs[_0xc070('0x79')](_0xe83c63)){throw new db['Sequelize'][(_0xc070('0x6d'))](_[_0xc070('0x6b')](_0xc070('0x62'))+_0xc070('0x6e'));}return _0x2b3bbe[_0xc070('0x6f')](_0xe83c63);}})['catch'](handleError(_0x2b3bbe,null));};exports[_0xc070('0x7a')]=function(_0xed5d,_0x5c6207,_0x24d22d){if(_0xed5d[_0xc070('0x5b')]&&_0xed5d[_0xc070('0x5b')]['filename']){_0xed5d[_0xc070('0x59')][_0xc070('0x63')]=_0xed5d[_0xc070('0x5b')][_0xc070('0x5d')];}return db[_0xc070('0x3c')][_0xc070('0x58')]({'where':{'id':_0xed5d[_0xc070('0x55')]['id']}})[_0xc070('0x38')](handleEntityNotFound(_0x5c6207,null))['then'](saveUpdates(_0xed5d['body'],null))[_0xc070('0x38')](respondWithResult(_0x5c6207,null))['catch'](handleError(_0x5c6207,null));};var utilLicense=require(_0xc070('0x1a'));exports[_0xc070('0x7b')]=function(_0x1ce665,_0x5a07ba,_0x3d38da){var _0x46e787=_0xc070('0x70');var _0x983d33={'custom':![]};return utilLicense[_0xc070('0x61')]()[_0xc070('0x38')](function(_0x2e0931){if(_0x2e0931){_0x983d33=_0x2e0931;}return db[_0xc070('0x3c')][_0xc070('0x58')]({'where':{'id':_0x1ce665[_0xc070('0x55')]['id']},'attributes':[_0xc070('0x5c'),_0xc070('0x5f'),_0xc070('0x62'),_0xc070('0x63'),_0xc070('0x64'),'defaultLoginLogo',_0xc070('0x65'),_0xc070('0x77')],'raw':!![]});})[_0xc070('0x38')](handleEntityNotFound(_0x5a07ba,null))['then'](function(_0x362314){if(_0x362314){var _0x260e25=_0x362314[_0xc070('0x63')]&&fs[_0xc070('0x79')](path['join'](config[_0xc070('0x67')],_0x46e787,_[_0xc070('0x68')](_0x362314[_0xc070('0x63')])))?path[_0xc070('0x66')](config[_0xc070('0x67')],_0x46e787,_[_0xc070('0x68')](_0x362314[_0xc070('0x63')])):path['join'](config[_0xc070('0x67')],_0x46e787,_[_0xc070('0x68')](_0xc070('0x7c')));var _0x4d96fb='default'+_['upperFirst'](_0xc070('0x63'));if(_0x362314[_0x4d96fb]||!_0x983d33[_0xc070('0x6c')]){_0x260e25=path[_0xc070('0x66')](config[_0xc070('0x67')],_0x46e787,_[_0xc070('0x68')](_0xc070('0x7c')));}if(!fs[_0xc070('0x79')](_0x260e25)){throw new db[(_0xc070('0x73'))][(_0xc070('0x6d'))](_[_0xc070('0x6b')](_0xc070('0x63'))+_0xc070('0x6e'));}return _0x5a07ba['download'](_0x260e25);}})['catch'](handleError(_0x5a07ba,null));};exports[_0xc070('0x7d')]=function(_0x20d56b,_0x574a82){var _0x269074={'offset':moment()[_0xc070('0x7e')]()};_0x269074[_0xc070('0x7f')]=moment()[_0xc070('0x7e')](_0x269074[_0xc070('0x30')])[_0xc070('0x80')](_0xc070('0x81'));return _0x574a82[_0xc070('0x2b')](0xc8)[_0xc070('0x3a')](_0x269074);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index e9a1e6a..f26de3a 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(_0x446597,_0x486660){var _0x1cb263=function(_0x27e5c2){while(--_0x27e5c2){_0x446597['push'](_0x446597['shift']());}};_0x1cb263(++_0x486660);}(_0xedd9,0xfc));var _0x9edd=function(_0x20823c,_0x19cf39){_0x20823c=_0x20823c-0x0;var _0x46716f=_0xedd9[_0x20823c];return _0x46716f;};'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(_0x590851,_0x496bee){var _0x3b0115=function(_0x5140cc){while(--_0x5140cc){_0x590851['push'](_0x590851['shift']());}};_0x3b0115(++_0x496bee);}(_0x55ca,0x126));var _0xa55c=function(_0x591053,_0x523072){_0x591053=_0x591053-0x0;var _0x31ab80=_0x55ca[_0x591053];return _0x31ab80;};'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 4622c9c..618f450 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 _0x0682=['debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','options','where','include','map','model','attributes'];(function(_0x5ec646,_0x2b3418){var _0x4b3625=function(_0x3ae547){while(--_0x3ae547){_0x5ec646['push'](_0x5ec646['shift']());}};_0x4b3625(++_0x2b3418);}(_0x0682,0x181));var _0x2068=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0682[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2068('0x0'));var util=require(_0x2068('0x1'));var moment=require(_0x2068('0x2'));var BPromise=require('bluebird');var rs=require(_0x2068('0x3'));var fs=require('fs');var Redis=require(_0x2068('0x4'));var db=require(_0x2068('0x5'))['db'];var utils=require(_0x2068('0x6'));var logger=require(_0x2068('0x7'))('rpc');var config=require(_0x2068('0x8'));var jayson=require(_0x2068('0x9'));var client=jayson[_0x2068('0xa')][_0x2068('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x159bd8,_0x2f67c6,_0x4723a4){return new BPromise(function(_0x34722a,_0x37abf9){return client[_0x2068('0xc')](_0x159bd8,_0x4723a4)[_0x2068('0xd')](function(_0x408bce){logger[_0x2068('0xe')](_0x2068('0xf'),_0x2f67c6,_0x2068('0x10'));logger['debug'](_0x2068('0x11'),_0x2f67c6,'request\x20sent',JSON[_0x2068('0x12')](_0x408bce));if(_0x408bce[_0x2068('0x13')]){if(_0x408bce[_0x2068('0x13')][_0x2068('0x14')]===0x1f4){logger[_0x2068('0x13')]('Setting,\x20%s,\x20%s',_0x2f67c6,_0x408bce['error'][_0x2068('0x15')]);return _0x37abf9(_0x408bce[_0x2068('0x13')][_0x2068('0x15')]);}logger[_0x2068('0x13')]('Setting,\x20%s,\x20%s',_0x2f67c6,_0x408bce[_0x2068('0x13')][_0x2068('0x15')]);return _0x34722a(_0x408bce[_0x2068('0x13')][_0x2068('0x15')]);}else{logger[_0x2068('0xe')](_0x2068('0xf'),_0x2f67c6,_0x2068('0x10'));_0x34722a(_0x408bce[_0x2068('0x16')][_0x2068('0x15')]);}})[_0x2068('0x17')](function(_0x1b7dc1){logger[_0x2068('0x13')](_0x2068('0xf'),_0x2f67c6,_0x1b7dc1);_0x37abf9(_0x1b7dc1);});});}exports[_0x2068('0x18')]=function(_0x318310){var _0x4b0660=this;return new Promise(function(_0xa3fa92,_0x349b0f){return db['Setting']['find']({'raw':_0x318310[_0x2068('0x19')]?_0x318310[_0x2068('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x318310['options']?_0x318310[_0x2068('0x19')][_0x2068('0x1a')]||null:null,'attributes':_0x318310[_0x2068('0x19')]?_0x318310[_0x2068('0x19')]['attributes']||null:null,'include':_0x318310[_0x2068('0x19')]?_0x318310[_0x2068('0x19')][_0x2068('0x1b')]?_[_0x2068('0x1c')](_0x318310[_0x2068('0x19')][_0x2068('0x1b')],function(_0x3473de){return{'model':db[_0x3473de['model']],'as':_0x3473de['as'],'attributes':_0x3473de['attributes'],'include':_0x3473de['include']?_[_0x2068('0x1c')](_0x3473de[_0x2068('0x1b')],function(_0x59da2f){return{'model':db[_0x59da2f['model']],'as':_0x59da2f['as'],'attributes':_0x59da2f['attributes'],'include':_0x59da2f[_0x2068('0x1b')]?_[_0x2068('0x1c')](_0x59da2f['include'],function(_0x5dcf63){return{'model':db[_0x5dcf63[_0x2068('0x1d')]],'as':_0x5dcf63['as'],'attributes':_0x5dcf63[_0x2068('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2068('0xd')](function(_0x3ea687){logger[_0x2068('0xe')](_0x2068('0x18'),_0x318310);logger[_0x2068('0x1f')]('ShowSetting',_0x318310,JSON['stringify'](_0x3ea687));_0xa3fa92(_0x3ea687);})[_0x2068('0x17')](function(_0x5d7980){logger[_0x2068('0x13')](_0x2068('0x18'),_0x5d7980[_0x2068('0x15')],_0x318310);_0x349b0f(_0x4b0660['error'](0x1f4,_0x5d7980['message']));});});}; \ No newline at end of file +var _0x4d6e=['model','map','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSetting','Setting','options','where','attributes','include'];(function(_0x1d70bc,_0xe32555){var _0x17e8c4=function(_0x2668a0){while(--_0x2668a0){_0x1d70bc['push'](_0x1d70bc['shift']());}};_0x17e8c4(++_0xe32555);}(_0x4d6e,0x1bd));var _0xe4d6=function(_0xe38764,_0x28ce79){_0xe38764=_0xe38764-0x0;var _0x5979cf=_0x4d6e[_0xe38764];return _0x5979cf;};'use strict';var _=require(_0xe4d6('0x0'));var util=require(_0xe4d6('0x1'));var moment=require(_0xe4d6('0x2'));var BPromise=require(_0xe4d6('0x3'));var rs=require(_0xe4d6('0x4'));var fs=require('fs');var Redis=require(_0xe4d6('0x5'));var db=require(_0xe4d6('0x6'))['db'];var utils=require(_0xe4d6('0x7'));var logger=require(_0xe4d6('0x8'))(_0xe4d6('0x9'));var config=require('../../config/environment');var jayson=require(_0xe4d6('0xa'));var client=jayson[_0xe4d6('0xb')][_0xe4d6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x49db67,_0x1364ef,_0xf20e5b){return new BPromise(function(_0x20f20f,_0x2c9d0c){return client[_0xe4d6('0xd')](_0x49db67,_0xf20e5b)[_0xe4d6('0xe')](function(_0x52f3c6){logger['info'](_0xe4d6('0xf'),_0x1364ef,'request\x20sent');logger[_0xe4d6('0x10')](_0xe4d6('0x11'),_0x1364ef,_0xe4d6('0x12'),JSON[_0xe4d6('0x13')](_0x52f3c6));if(_0x52f3c6[_0xe4d6('0x14')]){if(_0x52f3c6[_0xe4d6('0x14')][_0xe4d6('0x15')]===0x1f4){logger['error'](_0xe4d6('0xf'),_0x1364ef,_0x52f3c6['error'][_0xe4d6('0x16')]);return _0x2c9d0c(_0x52f3c6[_0xe4d6('0x14')][_0xe4d6('0x16')]);}logger[_0xe4d6('0x14')](_0xe4d6('0xf'),_0x1364ef,_0x52f3c6[_0xe4d6('0x14')]['message']);return _0x20f20f(_0x52f3c6['error']['message']);}else{logger['info'](_0xe4d6('0xf'),_0x1364ef,_0xe4d6('0x12'));_0x20f20f(_0x52f3c6[_0xe4d6('0x17')]['message']);}})[_0xe4d6('0x18')](function(_0x21daa0){logger[_0xe4d6('0x14')](_0xe4d6('0xf'),_0x1364ef,_0x21daa0);_0x2c9d0c(_0x21daa0);});});}exports[_0xe4d6('0x19')]=function(_0x16b58d){var _0x3fe4f4=this;return new Promise(function(_0x2c7b65,_0x2059b7){return db[_0xe4d6('0x1a')]['find']({'raw':_0x16b58d['options']?_0x16b58d[_0xe4d6('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x16b58d[_0xe4d6('0x1b')]?_0x16b58d[_0xe4d6('0x1b')][_0xe4d6('0x1c')]||null:null,'attributes':_0x16b58d[_0xe4d6('0x1b')]?_0x16b58d['options'][_0xe4d6('0x1d')]||null:null,'include':_0x16b58d[_0xe4d6('0x1b')]?_0x16b58d[_0xe4d6('0x1b')][_0xe4d6('0x1e')]?_['map'](_0x16b58d[_0xe4d6('0x1b')][_0xe4d6('0x1e')],function(_0x2218af){return{'model':db[_0x2218af[_0xe4d6('0x1f')]],'as':_0x2218af['as'],'attributes':_0x2218af[_0xe4d6('0x1d')],'include':_0x2218af['include']?_[_0xe4d6('0x20')](_0x2218af['include'],function(_0xf8fd01){return{'model':db[_0xf8fd01['model']],'as':_0xf8fd01['as'],'attributes':_0xf8fd01[_0xe4d6('0x1d')],'include':_0xf8fd01[_0xe4d6('0x1e')]?_[_0xe4d6('0x20')](_0xf8fd01[_0xe4d6('0x1e')],function(_0x52fb34){return{'model':db[_0x52fb34['model']],'as':_0x52fb34['as'],'attributes':_0x52fb34['attributes']};}):[]};}):[]};}):[]:[]})[_0xe4d6('0xe')](function(_0x153ec0){logger[_0xe4d6('0x21')](_0xe4d6('0x19'),_0x16b58d);logger[_0xe4d6('0x10')](_0xe4d6('0x19'),_0x16b58d,JSON[_0xe4d6('0x13')](_0x153ec0));_0x2c7b65(_0x153ec0);})['catch'](function(_0x4e1809){logger[_0xe4d6('0x14')]('ShowSetting',_0x4e1809[_0xe4d6('0x16')],_0x16b58d);_0x2059b7(_0x3fe4f4[_0xe4d6('0x14')](0x1f4,_0x4e1809['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 333973e..d0a5f93 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 _0x7fbe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','/:id/notify','notify','put','delete','removeAnswers','path','connect-timeout','express'];(function(_0x12dc0c,_0x18bae3){var _0x2ad087=function(_0x36c262){while(--_0x36c262){_0x12dc0c['push'](_0x12dc0c['shift']());}};_0x2ad087(++_0x18bae3);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0x7fbe[_0x725a4c];return _0x37b2cc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['get'](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x10')]);router[_0xe7fb('0x9')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x12')]);router[_0xe7fb('0x9')](_0xe7fb('0x13'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x14')]);router[_0xe7fb('0x9')](_0xe7fb('0x15'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x16')]);router['get'](_0xe7fb('0x17'),controller[_0xe7fb('0x18')]);router['get'](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['getAgents']);router[_0xe7fb('0x1a')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0x1b')]);router[_0xe7fb('0x1a')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['addDisposition']);router[_0xe7fb('0x1a')]('/:id/canned_answers',auth[_0xe7fb('0xa')](),controller['addAnswer']);router[_0xe7fb('0x1a')](_0xe7fb('0x1c'),controller[_0xe7fb('0x1d')]);router[_0xe7fb('0x1a')]('/:id/applications',auth[_0xe7fb('0xa')](),controller['addApplications']);router[_0xe7fb('0x1a')]('/:id/send',auth[_0xe7fb('0xa')](),controller['send']);router[_0xe7fb('0x1a')](_0xe7fb('0x17'),controller['status']);router[_0xe7fb('0x1a')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['addAgents']);router[_0xe7fb('0x1e')](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xe7fb('0x1f')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['removeDispositions']);router[_0xe7fb('0x1f')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x20')]);router[_0xe7fb('0x1f')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x486d3d,_0x39c2fb){var _0x39ee60=function(_0x147eee){while(--_0x147eee){_0x486d3d['push'](_0x486d3d['shift']());}};_0x39ee60(++_0x39c2fb);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xc4aa[_0x2064e5];return _0x21a233;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('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 ef89fe2..04cc7d7 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 _0xfeac=['exports','name','STRING','generate','ENUM','twilio','skebby','connectel','plivo','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x2bc8d1,_0x170887){var _0xb8ba48=function(_0x16c6fb){while(--_0x16c6fb){_0x2bc8d1['push'](_0x2bc8d1['shift']());}};_0xb8ba48(++_0x170887);}(_0xfeac,0x190));var _0xcfea=function(_0x11e607,_0x17bbce){_0x11e607=_0x11e607-0x0;var _0x5778b5=_0xfeac[_0x11e607];return _0x5778b5;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xcfea('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xcfea('0x1'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xcfea('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xcfea('0x2')],'defaultValue':function(){return rs[_0xcfea('0x3')]();}},'phone':{'type':Sequelize[_0xcfea('0x2')]},'type':{'type':Sequelize[_0xcfea('0x4')](_0xcfea('0x5'),_0xcfea('0x6'),_0xcfea('0x7'),'clicksend',_0xcfea('0x8'),_0xcfea('0x9'),_0xcfea('0xa'),_0xcfea('0xb'),_0xcfea('0xc'),_0xcfea('0xd'))},'accountSid':{'type':Sequelize[_0xcfea('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xcfea('0x2')]},'smsMethod':{'type':Sequelize[_0xcfea('0x4')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xcfea('0x2')]},'apiKey':{'type':Sequelize[_0xcfea('0x2')]},'applicationId':{'type':Sequelize[_0xcfea('0x2')]},'accountId':{'type':Sequelize[_0xcfea('0x2')]},'senderString':{'type':Sequelize[_0xcfea('0x2')]},'deliveryReport':{'type':Sequelize[_0xcfea('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xcfea('0xf');}},'notificationSound':{'type':Sequelize[_0xcfea('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcfea('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcfea('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcfea('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xcfea('0xe')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x26d39e){if(!_0x26d39e)this[_0xcfea('0x11')](_0xcfea('0x12'),null);this['setDataValue'](_0xcfea('0x13'),_0x26d39e);}}}; \ No newline at end of file +var _0x35ad=['bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','name','generate','ENUM','twilio','skebby','clicksend','plivo'];(function(_0x152aa1,_0x307718){var _0x1bc01a=function(_0xd3211e){while(--_0xd3211e){_0x152aa1['push'](_0x152aa1['shift']());}};_0x1bc01a(++_0x307718);}(_0x35ad,0x199));var _0xd35a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x35ad[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xd35a('0x0'));module['exports']={'name':{'type':Sequelize[_0xd35a('0x1')],'unique':_0xd35a('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xd35a('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xd35a('0x1')],'defaultValue':function(){return rs[_0xd35a('0x3')]();}},'phone':{'type':Sequelize[_0xd35a('0x1')]},'type':{'type':Sequelize[_0xd35a('0x4')](_0xd35a('0x5'),_0xd35a('0x6'),'connectel',_0xd35a('0x7'),_0xd35a('0x8'),'clickatell',_0xd35a('0x9'),_0xd35a('0xa'),_0xd35a('0xb'),_0xd35a('0xc'))},'accountSid':{'type':Sequelize[_0xd35a('0x1')]},'authId':{'type':Sequelize[_0xd35a('0x1')]},'authToken':{'type':Sequelize[_0xd35a('0x1')]},'smsMethod':{'type':Sequelize[_0xd35a('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xd35a('0x1')]},'password':{'type':Sequelize[_0xd35a('0x1')]},'apiKey':{'type':Sequelize[_0xd35a('0x1')]},'applicationId':{'type':Sequelize[_0xd35a('0x1')]},'accountId':{'type':Sequelize[_0xd35a('0x1')]},'senderString':{'type':Sequelize[_0xd35a('0x1')]},'deliveryReport':{'type':Sequelize[_0xd35a('0xd')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xd35a('0xe')],'defaultValue':function(){return _0xd35a('0xf');}},'notificationSound':{'type':Sequelize[_0xd35a('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd35a('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd35a('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd35a('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd35a('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd35a('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd35a('0x10')],'comment':_0xd35a('0x11')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd35a('0x12'),'set':function(_0xf7058f){if(!_0xf7058f)this[_0xd35a('0x13')](_0xd35a('0x14'),null);this['setDataValue'](_0xd35a('0x15'),_0xf7058f);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index b04a2a5..9292658 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 _0x7d1c=['received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','message_id','status_code','DELIVERED','groupName','intelepeer','redif','clicksend','error_code','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','state','message-id','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','catch','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','get','SmsAccounts','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','options','SmsAccount','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','getDispositions','findOne','pick','filter','includeAll','removeDispositions','ids','CannedAnswer','getAnswers','order','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','twilio','messageId','MessageSid','skebby','from','sender','text','connectel','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','agent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','\x0a','json','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','internal','Tag','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','debug'];(function(_0x10c630,_0xb36f90){var _0x1af020=function(_0x5cf0ed){while(--_0x5cf0ed){_0x10c630['push'](_0x10c630['shift']());}};_0x1af020(++_0xb36f90);}(_0x7d1c,0xfa));var _0xc7d1=function(_0x4611bb,_0x16f2a7){_0x4611bb=_0x4611bb-0x0;var _0x4ab34a=_0x7d1c[_0x4611bb];return _0x4ab34a;};'use strict';var emlformat=require(_0xc7d1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc7d1('0x1'));var rp=require(_0xc7d1('0x2'));var moment=require(_0xc7d1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc7d1('0x4'));var util=require(_0xc7d1('0x5'));var path=require(_0xc7d1('0x6'));var sox=require(_0xc7d1('0x7'));var csv=require(_0xc7d1('0x8'));var ejs=require(_0xc7d1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc7d1('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc7d1('0xb'));var deskjs=require(_0xc7d1('0xc'));var toCsv=require(_0xc7d1('0x8'));var querystring=require(_0xc7d1('0xd'));var Papa=require(_0xc7d1('0xe'));var Redis=require('ioredis');var authService=require(_0xc7d1('0xf'));var qs=require(_0xc7d1('0x10'));var as=require(_0xc7d1('0x11'));var hardwareService=require(_0xc7d1('0x12'));var logger=require(_0xc7d1('0x13'))(_0xc7d1('0x14'));var utils=require(_0xc7d1('0x15'));var config=require(_0xc7d1('0x16'));var licenseUtil=require(_0xc7d1('0x17'));var db=require(_0xc7d1('0x18'))['db'];config[_0xc7d1('0x19')]=_[_0xc7d1('0x1a')](config[_0xc7d1('0x19')],{'host':_0xc7d1('0x1b'),'port':0x18eb});var socket=require(_0xc7d1('0x1c'))(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);var jayson=require(_0xc7d1('0x1d'));var client=jayson[_0xc7d1('0x1e')][_0xc7d1('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x5c1c6f,_0x57e38a,_0x312c1b,_0x38ff79){return new BPromise(function(_0x4fd255,_0x5584ab){var _0x1338f1=_0x38ff79||client;return _0x1338f1[_0xc7d1('0x20')](_0x5c1c6f,_0x312c1b)[_0xc7d1('0x21')](function(_0x513b9d){logger[_0xc7d1('0x22')]('SmsAccount,\x20%s,\x20%s',_0x57e38a,_0xc7d1('0x23'));logger['debug'](_0xc7d1('0x24'),_0x57e38a,_0xc7d1('0x23'),JSON[_0xc7d1('0x25')](_0x513b9d));if(_0x513b9d[_0xc7d1('0x26')]){if(_0x513b9d[_0xc7d1('0x26')][_0xc7d1('0x27')]===0x1f4){logger[_0xc7d1('0x26')]('SmsAccount,\x20%s,\x20%s',_0x57e38a,_0x513b9d['error'][_0xc7d1('0x28')]);return _0x5584ab(_0x513b9d[_0xc7d1('0x26')][_0xc7d1('0x28')]);}logger[_0xc7d1('0x26')]('SmsAccount,\x20%s,\x20%s',_0x57e38a,_0x513b9d[_0xc7d1('0x26')][_0xc7d1('0x28')]);return _0x4fd255(_0x513b9d[_0xc7d1('0x26')][_0xc7d1('0x28')]);}else{logger[_0xc7d1('0x22')](_0xc7d1('0x29'),_0x57e38a,'request\x20sent');_0x4fd255(_0x513b9d['result']['message']);}})[_0xc7d1('0x2a')](function(_0x46649e){logger[_0xc7d1('0x26')]('SmsAccount,\x20%s,\x20%s',_0x57e38a,_0x46649e);_0x5584ab(_0x46649e);});});}function respondWithStatusCode(_0xef5d6,_0xed220a){_0xed220a=_0xed220a||0xcc;return function(_0x19d735){if(_0x19d735){return _0xef5d6[_0xc7d1('0x2b')](_0xed220a);}return _0xef5d6[_0xc7d1('0x2c')](_0xed220a)['end']();};}function respondWithResult(_0x4bc0e2,_0x54b731){_0x54b731=_0x54b731||0xc8;return function(_0x1cc86f){if(_0x1cc86f){return _0x4bc0e2[_0xc7d1('0x2c')](_0x54b731)['json'](_0x1cc86f);}};}function respondWithFilteredResult(_0x134044,_0x30c33a){return function(_0x125e48){if(_0x125e48){var _0x2e0292=typeof _0x30c33a[_0xc7d1('0x2d')]==='undefined'&&typeof _0x30c33a[_0xc7d1('0x2e')]===_0xc7d1('0x2f');var _0x209bc9=_0x125e48[_0xc7d1('0x30')];var _0x4cde6c=_0x2e0292?0x0:_0x30c33a['offset'];var _0x2786a8=_0x2e0292?_0x125e48[_0xc7d1('0x30')]:_0x30c33a[_0xc7d1('0x2d')]+_0x30c33a[_0xc7d1('0x2e')];var _0x5a8706;if(_0x2786a8>=_0x209bc9){_0x2786a8=_0x209bc9;_0x5a8706=0xc8;}else{_0x5a8706=0xce;}_0x134044[_0xc7d1('0x2c')](_0x5a8706);return _0x134044[_0xc7d1('0x31')](_0xc7d1('0x32'),_0x4cde6c+'-'+_0x2786a8+'/'+_0x209bc9)['json'](_0x125e48);}return null;};}function patchUpdates(_0x4b4926){return function(_0x5147cf){try{jsonpatch[_0xc7d1('0x33')](_0x5147cf,_0x4b4926,!![]);}catch(_0x3c62ce){return BPromise[_0xc7d1('0x34')](_0x3c62ce);}return _0x5147cf['save']();};}function saveUpdates(_0x36b3bb,_0xdacfdf){return function(_0x314722){if(_0x314722){return _0x314722[_0xc7d1('0x35')](_0x36b3bb)[_0xc7d1('0x21')](function(_0x4ebe9d){return _0x4ebe9d;});}return null;};}function removeEntity(_0x271775,_0x556ad5){return function(_0x5b35d1){if(_0x5b35d1){return _0x5b35d1[_0xc7d1('0x36')]()[_0xc7d1('0x21')](function(){var _0x2daa3f=_0x5b35d1[_0xc7d1('0x37')]({'plain':!![]});var _0x2acf23=_0xc7d1('0x38');return db[_0xc7d1('0x39')][_0xc7d1('0x36')]({'where':{'type':_0x2acf23,'resourceId':_0x2daa3f['id']}})[_0xc7d1('0x21')](function(){return _0x5b35d1;});})[_0xc7d1('0x21')](function(){_0x271775[_0xc7d1('0x2c')](0xcc)[_0xc7d1('0x3a')]();});}};}function handleEntityNotFound(_0x4f05a1,_0x3e7cef){return function(_0x22af7a){if(!_0x22af7a){_0x4f05a1[_0xc7d1('0x2b')](0x194);}return _0x22af7a;};}function handleError(_0x2a1f38,_0x15076f){_0x15076f=_0x15076f||0x1f4;return function(_0x5e6133){logger[_0xc7d1('0x26')](_0x5e6133[_0xc7d1('0x3b')]);if(_0x5e6133[_0xc7d1('0x3c')]){delete _0x5e6133[_0xc7d1('0x3c')];}_0x2a1f38[_0xc7d1('0x2c')](_0x15076f)['send'](_0x5e6133);};}exports[_0xc7d1('0x3d')]=function(_0x2fc2fd,_0x217ee3){var _0x4d783c={'include':[{'model':db[_0xc7d1('0x3e')],'as':_0xc7d1('0x3f')}]},_0x5df0f6={},_0x57cf68={'count':0x0,'rows':[]};var _0x1d7a77=_[_0xc7d1('0x40')](db['SmsAccount'][_0xc7d1('0x41')],function(_0x11a58d){return{'name':_0x11a58d['fieldName'],'type':_0x11a58d[_0xc7d1('0x42')]['key']};});_0x5df0f6[_0xc7d1('0x43')]=_[_0xc7d1('0x40')](_0x1d7a77,_0xc7d1('0x3c'));_0x5df0f6[_0xc7d1('0x44')]=_[_0xc7d1('0x45')](_0x2fc2fd[_0xc7d1('0x44')]);_0x5df0f6['filters']=_[_0xc7d1('0x46')](_0x5df0f6[_0xc7d1('0x43')],_0x5df0f6['query']);_0x4d783c[_0xc7d1('0x47')]=_[_0xc7d1('0x46')](_0x5df0f6[_0xc7d1('0x43')],qs[_0xc7d1('0x48')](_0x2fc2fd[_0xc7d1('0x44')][_0xc7d1('0x48')]));_0x4d783c['attributes']=_0x4d783c[_0xc7d1('0x47')][_0xc7d1('0x49')]?_0x4d783c[_0xc7d1('0x47')]:_0x5df0f6[_0xc7d1('0x43')];if(!_0x2fc2fd[_0xc7d1('0x44')][_0xc7d1('0x4a')](_0xc7d1('0x4b'))){_0x4d783c[_0xc7d1('0x2e')]=qs['limit'](_0x2fc2fd[_0xc7d1('0x44')][_0xc7d1('0x2e')]);_0x4d783c[_0xc7d1('0x2d')]=qs[_0xc7d1('0x2d')](_0x2fc2fd[_0xc7d1('0x44')][_0xc7d1('0x2d')]);}_0x4d783c['order']=qs[_0xc7d1('0x4c')](_0x2fc2fd[_0xc7d1('0x44')][_0xc7d1('0x4c')]);_0x4d783c[_0xc7d1('0x4d')]=qs[_0xc7d1('0x4e')](_['pick'](_0x2fc2fd[_0xc7d1('0x44')],_0x5df0f6[_0xc7d1('0x4e')]),_0x1d7a77);if(_0x2fc2fd[_0xc7d1('0x44')]['filter']){_0x4d783c[_0xc7d1('0x4d')]=_['merge'](_0x4d783c[_0xc7d1('0x4d')],{'$or':_[_0xc7d1('0x40')](_0x1d7a77,function(_0x390546){if(_0x390546[_0xc7d1('0x42')]!=='VIRTUAL'){var _0x4323ce={};_0x4323ce[_0x390546[_0xc7d1('0x3c')]]={'$like':'%'+_0x2fc2fd[_0xc7d1('0x44')]['filter']+'%'};return _0x4323ce;}})});}_0x4d783c=_[_0xc7d1('0x4f')]({},_0x4d783c,_0x2fc2fd[_0xc7d1('0x50')]);var _0x2e5ba1={'where':_0x4d783c[_0xc7d1('0x4d')]};return db[_0xc7d1('0x51')][_0xc7d1('0x30')](_0x2e5ba1)[_0xc7d1('0x21')](function(_0x1d23ab){_0x57cf68[_0xc7d1('0x30')]=_0x1d23ab;if(_0x2fc2fd['query']['includeAll']){_0x4d783c[_0xc7d1('0x52')]=[{'all':!![]}];}return db['SmsAccount'][_0xc7d1('0x53')](_0x4d783c);})['then'](function(_0x5a3d92){_0x57cf68[_0xc7d1('0x54')]=_0x5a3d92;return _0x57cf68;})[_0xc7d1('0x21')](respondWithFilteredResult(_0x217ee3,_0x4d783c))['catch'](handleError(_0x217ee3,null));};exports[_0xc7d1('0x55')]=function(_0x11f1d6,_0x325ae9){var _0xdc8c04={'raw':![],'where':{'id':_0x11f1d6[_0xc7d1('0x56')]['id']},'include':[{'model':db[_0xc7d1('0x3e')],'as':_0xc7d1('0x3f')}]},_0x1241d9={};_0x1241d9['model']=_[_0xc7d1('0x45')](db[_0xc7d1('0x51')]['rawAttributes']);_0x1241d9[_0xc7d1('0x44')]=_[_0xc7d1('0x45')](_0x11f1d6[_0xc7d1('0x44')]);_0x1241d9[_0xc7d1('0x4e')]=_[_0xc7d1('0x46')](_0x1241d9['model'],_0x1241d9[_0xc7d1('0x44')]);_0xdc8c04[_0xc7d1('0x47')]=_['intersection'](_0x1241d9[_0xc7d1('0x43')],qs[_0xc7d1('0x48')](_0x11f1d6['query']['fields']));_0xdc8c04[_0xc7d1('0x47')]=_0xdc8c04[_0xc7d1('0x47')][_0xc7d1('0x49')]?_0xdc8c04[_0xc7d1('0x47')]:_0x1241d9[_0xc7d1('0x43')];if(_0x11f1d6['query']['includeAll']){_0xdc8c04[_0xc7d1('0x52')]=[{'all':!![]}];}_0xdc8c04=_[_0xc7d1('0x4f')]({},_0xdc8c04,_0x11f1d6[_0xc7d1('0x50')]);return db[_0xc7d1('0x51')][_0xc7d1('0x57')](_0xdc8c04)[_0xc7d1('0x21')](handleEntityNotFound(_0x325ae9,null))['then'](respondWithResult(_0x325ae9,null))['catch'](handleError(_0x325ae9,null));};exports[_0xc7d1('0x58')]=function(_0x1b5cb9,_0x343c90){return db['SmsAccount'][_0xc7d1('0x58')](_0x1b5cb9[_0xc7d1('0x59')],{})['then'](function(_0x5145f6){var _0x211956=_0x1b5cb9['user']['get']({'plain':!![]});if(!_0x211956)throw new Error(_0xc7d1('0x5a'));if(_0x211956[_0xc7d1('0x5b')]===_0xc7d1('0x5c')){var _0x2fc714=_0x5145f6[_0xc7d1('0x37')]({'plain':!![]});var _0x1168e3=_0xc7d1('0x38');return db[_0xc7d1('0x5d')][_0xc7d1('0x57')]({'where':{'name':_0x1168e3,'userProfileId':_0x211956[_0xc7d1('0x5e')]},'raw':!![]})['then'](function(_0x340bae){if(_0x340bae&&_0x340bae[_0xc7d1('0x5f')]===0x0){return db['UserProfileResource'][_0xc7d1('0x58')]({'name':_0x2fc714['name'],'resourceId':_0x2fc714['id'],'type':_0x340bae[_0xc7d1('0x3c')],'sectionId':_0x340bae['id']},{})['then'](function(){return _0x5145f6;});}else{return _0x5145f6;}})[_0xc7d1('0x2a')](function(_0x486392){logger[_0xc7d1('0x26')](_0xc7d1('0x60'),_0x486392);throw _0x486392;});}return _0x5145f6;})[_0xc7d1('0x21')](respondWithResult(_0x343c90,0xc9))[_0xc7d1('0x2a')](handleError(_0x343c90,null));};exports[_0xc7d1('0x35')]=function(_0x2011b4,_0x2ff50c){if(_0x2011b4[_0xc7d1('0x59')]['id']){delete _0x2011b4[_0xc7d1('0x59')]['id'];}return db[_0xc7d1('0x51')][_0xc7d1('0x57')]({'where':{'id':_0x2011b4[_0xc7d1('0x56')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xc7d1('0x21')](handleEntityNotFound(_0x2ff50c,null))[_0xc7d1('0x21')](saveUpdates(_0x2011b4[_0xc7d1('0x59')],null))[_0xc7d1('0x21')](respondWithResult(_0x2ff50c,null))[_0xc7d1('0x2a')](handleError(_0x2ff50c,null));};exports[_0xc7d1('0x36')]=function(_0x4710e7,_0x1a6861){return db[_0xc7d1('0x51')][_0xc7d1('0x57')]({'where':{'id':_0x4710e7[_0xc7d1('0x56')]['id']}})['then'](handleEntityNotFound(_0x1a6861,null))[_0xc7d1('0x21')](removeEntity(_0x1a6861,null))[_0xc7d1('0x2a')](handleError(_0x1a6861,null));};exports[_0xc7d1('0x61')]=function(_0x56cb43,_0x18ab36){return db[_0xc7d1('0x51')][_0xc7d1('0x61')]()[_0xc7d1('0x21')](respondWithResult(_0x18ab36,null))[_0xc7d1('0x2a')](handleError(_0x18ab36,null));};exports['addDisposition']=function(_0x42a887,_0x2dee1b,_0x30be1f){if(_0x42a887['body']['id']){delete _0x42a887[_0xc7d1('0x59')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x42a887[_0xc7d1('0x56')]['id']}})[_0xc7d1('0x21')](handleEntityNotFound(_0x2dee1b,null))[_0xc7d1('0x21')](function(_0x3c00c9){if(_0x3c00c9){_0x42a887['body'][_0xc7d1('0x62')]=_0x3c00c9['id'];return db[_0xc7d1('0x63')][_0xc7d1('0x58')](_0x42a887[_0xc7d1('0x59')]);}})[_0xc7d1('0x21')](respondWithResult(_0x2dee1b,null))[_0xc7d1('0x2a')](handleError(_0x2dee1b,null));};exports[_0xc7d1('0x64')]=function(_0x492f44,_0x144750,_0x57ad35){var _0x1fd73a={'raw':![],'where':{}};var _0x475f2d={};var _0x267dec={'count':0x0,'rows':[]};return db[_0xc7d1('0x51')][_0xc7d1('0x65')]({'where':{'id':_0x492f44[_0xc7d1('0x56')]['id']}})[_0xc7d1('0x21')](handleEntityNotFound(_0x144750,null))[_0xc7d1('0x21')](function(_0x36dfda){if(_0x36dfda){_0x475f2d[_0xc7d1('0x43')]=_[_0xc7d1('0x45')](db[_0xc7d1('0x63')]['rawAttributes']);_0x475f2d[_0xc7d1('0x44')]=_['keys'](_0x492f44['query']);_0x475f2d[_0xc7d1('0x4e')]=_['intersection'](_0x475f2d['model'],_0x475f2d['query']);_0x1fd73a[_0xc7d1('0x47')]=_['intersection'](_0x475f2d['model'],qs[_0xc7d1('0x48')](_0x492f44[_0xc7d1('0x44')][_0xc7d1('0x48')]));_0x1fd73a[_0xc7d1('0x47')]=_0x1fd73a[_0xc7d1('0x47')][_0xc7d1('0x49')]?_0x1fd73a[_0xc7d1('0x47')]:_0x475f2d[_0xc7d1('0x43')];if(!_0x492f44['query'][_0xc7d1('0x4a')](_0xc7d1('0x4b'))){_0x1fd73a[_0xc7d1('0x2e')]=qs[_0xc7d1('0x2e')](_0x492f44['query'][_0xc7d1('0x2e')]);_0x1fd73a[_0xc7d1('0x2d')]=qs[_0xc7d1('0x2d')](_0x492f44[_0xc7d1('0x44')][_0xc7d1('0x2d')]);}_0x1fd73a['order']=qs['sort'](_0x492f44[_0xc7d1('0x44')]['sort']);_0x1fd73a[_0xc7d1('0x4d')]=qs[_0xc7d1('0x4e')](_[_0xc7d1('0x66')](_0x492f44['query'],_0x475f2d[_0xc7d1('0x4e')]));_0x1fd73a[_0xc7d1('0x4d')][_0xc7d1('0x62')]=_0x36dfda['id'];if(_0x492f44[_0xc7d1('0x44')]['filter']){_0x1fd73a[_0xc7d1('0x4d')]=_['merge'](_0x1fd73a[_0xc7d1('0x4d')],{'$or':_[_0xc7d1('0x40')](_0x1fd73a[_0xc7d1('0x47')],function(_0x21d099){var _0x5d0a55={};_0x5d0a55[_0x21d099]={'$like':'%'+_0x492f44[_0xc7d1('0x44')][_0xc7d1('0x67')]+'%'};return _0x5d0a55;})});}_0x1fd73a=_[_0xc7d1('0x4f')]({},_0x1fd73a,_0x492f44[_0xc7d1('0x50')]);return db[_0xc7d1('0x63')][_0xc7d1('0x30')]({'where':_0x1fd73a[_0xc7d1('0x4d')]})[_0xc7d1('0x21')](function(_0xe03312){_0x267dec[_0xc7d1('0x30')]=_0xe03312;if(_0x492f44[_0xc7d1('0x44')][_0xc7d1('0x68')]){_0x1fd73a['include']=[{'all':!![]}];}return db[_0xc7d1('0x63')][_0xc7d1('0x53')](_0x1fd73a);})[_0xc7d1('0x21')](function(_0x4370a5){_0x267dec[_0xc7d1('0x54')]=_0x4370a5;return _0x267dec;});}})['then'](respondWithFilteredResult(_0x144750,_0x1fd73a))[_0xc7d1('0x2a')](handleError(_0x144750,null));};exports[_0xc7d1('0x69')]=function(_0x29aa30,_0x4f4d51,_0x197d46){return db[_0xc7d1('0x51')][_0xc7d1('0x57')]({'where':{'id':_0x29aa30['params']['id']}})[_0xc7d1('0x21')](handleEntityNotFound(_0x4f4d51,null))['then'](function(_0x4276f4){if(_0x4276f4){return _0x4276f4[_0xc7d1('0x69')](_0x29aa30[_0xc7d1('0x44')][_0xc7d1('0x6a')]);}})[_0xc7d1('0x21')](respondWithStatusCode(_0x4f4d51,null))[_0xc7d1('0x2a')](handleError(_0x4f4d51,null));};exports['addAnswer']=function(_0x2c3cdc,_0x16399b,_0x3f6e18){if(_0x2c3cdc[_0xc7d1('0x59')]['id']){delete _0x2c3cdc['body']['id'];}return db[_0xc7d1('0x51')]['find']({'where':{'id':_0x2c3cdc['params']['id']}})[_0xc7d1('0x21')](handleEntityNotFound(_0x16399b,null))[_0xc7d1('0x21')](function(_0x1d0008){if(_0x1d0008){_0x2c3cdc[_0xc7d1('0x59')][_0xc7d1('0x62')]=_0x1d0008['id'];return db[_0xc7d1('0x6b')][_0xc7d1('0x58')](_0x2c3cdc['body']);}})[_0xc7d1('0x21')](respondWithResult(_0x16399b,null))[_0xc7d1('0x2a')](handleError(_0x16399b,null));};exports[_0xc7d1('0x6c')]=function(_0x551721,_0x56e3f2,_0x36bb95){var _0x412b6f={'raw':![],'where':{}};var _0xce5bd0={};var _0x52bba2={'count':0x0,'rows':[]};return db[_0xc7d1('0x51')]['findOne']({'where':{'id':_0x551721['params']['id']}})['then'](handleEntityNotFound(_0x56e3f2,null))['then'](function(_0x1de1c9){if(_0x1de1c9){_0xce5bd0['model']=_[_0xc7d1('0x45')](db[_0xc7d1('0x6b')][_0xc7d1('0x41')]);_0xce5bd0['query']=_[_0xc7d1('0x45')](_0x551721[_0xc7d1('0x44')]);_0xce5bd0[_0xc7d1('0x4e')]=_['intersection'](_0xce5bd0[_0xc7d1('0x43')],_0xce5bd0[_0xc7d1('0x44')]);_0x412b6f['attributes']=_[_0xc7d1('0x46')](_0xce5bd0[_0xc7d1('0x43')],qs[_0xc7d1('0x48')](_0x551721[_0xc7d1('0x44')]['fields']));_0x412b6f['attributes']=_0x412b6f[_0xc7d1('0x47')][_0xc7d1('0x49')]?_0x412b6f[_0xc7d1('0x47')]:_0xce5bd0[_0xc7d1('0x43')];if(!_0x551721[_0xc7d1('0x44')][_0xc7d1('0x4a')](_0xc7d1('0x4b'))){_0x412b6f['limit']=qs['limit'](_0x551721[_0xc7d1('0x44')]['limit']);_0x412b6f[_0xc7d1('0x2d')]=qs[_0xc7d1('0x2d')](_0x551721[_0xc7d1('0x44')]['offset']);}_0x412b6f[_0xc7d1('0x6d')]=qs[_0xc7d1('0x4c')](_0x551721[_0xc7d1('0x44')][_0xc7d1('0x4c')]);_0x412b6f['where']=qs[_0xc7d1('0x4e')](_[_0xc7d1('0x66')](_0x551721['query'],_0xce5bd0[_0xc7d1('0x4e')]));_0x412b6f[_0xc7d1('0x4d')]['SmsAccountId']=_0x1de1c9['id'];if(_0x551721[_0xc7d1('0x44')][_0xc7d1('0x67')]){_0x412b6f[_0xc7d1('0x4d')]=_[_0xc7d1('0x4f')](_0x412b6f[_0xc7d1('0x4d')],{'$or':_[_0xc7d1('0x40')](_0x412b6f[_0xc7d1('0x47')],function(_0x43146f){var _0x457354={};_0x457354[_0x43146f]={'$like':'%'+_0x551721[_0xc7d1('0x44')][_0xc7d1('0x67')]+'%'};return _0x457354;})});}_0x412b6f=_[_0xc7d1('0x4f')]({},_0x412b6f,_0x551721[_0xc7d1('0x50')]);return db[_0xc7d1('0x6b')]['count']({'where':_0x412b6f[_0xc7d1('0x4d')]})['then'](function(_0x5e820b){_0x52bba2[_0xc7d1('0x30')]=_0x5e820b;if(_0x551721[_0xc7d1('0x44')][_0xc7d1('0x68')]){_0x412b6f[_0xc7d1('0x52')]=[{'all':!![]}];}return db[_0xc7d1('0x6b')][_0xc7d1('0x53')](_0x412b6f);})[_0xc7d1('0x21')](function(_0x50c2bd){_0x52bba2[_0xc7d1('0x54')]=_0x50c2bd;return _0x52bba2;});}})[_0xc7d1('0x21')](respondWithFilteredResult(_0x56e3f2,_0x412b6f))['catch'](handleError(_0x56e3f2,null));};exports['removeAnswers']=function(_0x18e559,_0x5e7c73,_0x146dc1){return db['SmsAccount'][_0xc7d1('0x57')]({'where':{'id':_0x18e559[_0xc7d1('0x56')]['id']}})['then'](handleEntityNotFound(_0x5e7c73,null))[_0xc7d1('0x21')](function(_0xe8cd74){if(_0xe8cd74){return _0xe8cd74['removeAnswers'](_0x18e559[_0xc7d1('0x44')][_0xc7d1('0x6a')]);}})[_0xc7d1('0x21')](respondWithStatusCode(_0x5e7c73,null))[_0xc7d1('0x2a')](handleError(_0x5e7c73,null));};exports['notify']=function(_0x4f7e5e,_0x4ee882,_0x1e14ae){var _0x32d786={'channel':_0xc7d1('0x6e')};var _0x239a8e=[];var _0x50eef2=[];var _0x4eec7c={};return db['SmsAccount'][_0xc7d1('0x57')]({'where':{'id':_0x4f7e5e[_0xc7d1('0x56')]['id']},'include':[{'model':db[_0xc7d1('0x6f')],'as':_0xc7d1('0x70')}]})[_0xc7d1('0x21')](handleEntityNotFound(_0x4ee882,null))[_0xc7d1('0x21')](function(_0x65b669){_0x32d786[_0xc7d1('0x71')]=_0x65b669;_0x32d786[_0xc7d1('0x72')]=_[_0xc7d1('0x73')](_0x65b669[_0xc7d1('0x70')],[_0xc7d1('0x74')],[_0xc7d1('0x75')]);if(_0x32d786['account'][_0xc7d1('0x70')]){delete _0x32d786[_0xc7d1('0x71')]['Applications'];}return db[_0xc7d1('0x76')][_0xc7d1('0x61')]();})[_0xc7d1('0x21')](function(_0xd0f6ec){if(!_0xd0f6ec){throw new db['Sequelize'][(_0xc7d1('0x77'))](_0xc7d1('0x78'));}_0x239a8e=_[_0xc7d1('0x79')](_[_0xc7d1('0x45')](_0xd0f6ec),['createdAt',_0xc7d1('0x7a')]);_0x50eef2=_[_0xc7d1('0x79')](_[_0xc7d1('0x45')](_0xd0f6ec),[_0xc7d1('0x7b'),'updatedAt',_0xc7d1('0x7c'),_0xc7d1('0x7d')]);_0x32d786['body']={'mapKey':'mobile'};if(_0x32d786[_0xc7d1('0x71')][_0xc7d1('0x42')]){switch(_0x32d786[_0xc7d1('0x71')][_0xc7d1('0x42')]){case _0xc7d1('0x7e'):_0x32d786['body']['from']=_0x4f7e5e[_0xc7d1('0x59')]['From'];_0x32d786['body'][_0xc7d1('0x59')]=_0x4f7e5e[_0xc7d1('0x59')]['Body'];_0x32d786['body'][_0xc7d1('0x7f')]=_0x4f7e5e['body'][_0xc7d1('0x80')];break;case _0xc7d1('0x81'):_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x82')]='+'+_0x4f7e5e[_0xc7d1('0x59')][_0xc7d1('0x83')];_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x59')]=_0x4f7e5e[_0xc7d1('0x59')][_0xc7d1('0x84')];break;case _0xc7d1('0x85'):_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x82')]=_0x4f7e5e[_0xc7d1('0x59')]['from'];_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x59')]=_0x4f7e5e['body']['message'];break;case'clicksend':_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x82')]=_0x4f7e5e[_0xc7d1('0x59')]['from'];_0x32d786[_0xc7d1('0x59')]['body']=_0x4f7e5e[_0xc7d1('0x59')][_0xc7d1('0x59')];_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x7f')]=_0x4f7e5e[_0xc7d1('0x59')]['message_id'];break;case _0xc7d1('0x86'):_0x32d786[_0xc7d1('0x59')]['from']=_0x4f7e5e['body']['From'];_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x59')]=_0x4f7e5e[_0xc7d1('0x59')][_0xc7d1('0x87')];_0x32d786['body']['messageId']=_0x4f7e5e['body'][_0xc7d1('0x88')];break;case _0xc7d1('0x89'):_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x82')]='+'+_0x4f7e5e[_0xc7d1('0x59')][_0xc7d1('0x8a')][0x0][_0xc7d1('0x82')];_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x59')]=_0x4f7e5e[_0xc7d1('0x59')][_0xc7d1('0x8a')][0x0][_0xc7d1('0x84')];_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x7f')]=_0x4f7e5e[_0xc7d1('0x59')][_0xc7d1('0x8a')][0x0]['messageId'];break;case _0xc7d1('0x8b'):_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x82')]=_0x4f7e5e[_0xc7d1('0x59')][_0xc7d1('0x8c')];_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x59')]=_0x4f7e5e['body'][_0xc7d1('0x8d')][_0xc7d1('0x28')];break;case _0xc7d1('0x8e'):_0x32d786[_0xc7d1('0x59')]['from']=_0x4f7e5e['body'][_0xc7d1('0x8f')];_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x59')]=_0x4f7e5e[_0xc7d1('0x59')][_0xc7d1('0x84')];_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x7f')]=_0x4f7e5e[_0xc7d1('0x59')][_0xc7d1('0x90')];break;case _0xc7d1('0x91'):_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x7f')]=_0x4f7e5e[_0xc7d1('0x59')][0x0][_0xc7d1('0x28')]['id'];_0x32d786['body'][_0xc7d1('0x82')]=_0x4f7e5e['body'][0x0][_0xc7d1('0x28')]['from'];_0x32d786[_0xc7d1('0x59')]['body']=_0x4f7e5e[_0xc7d1('0x59')][0x0][_0xc7d1('0x28')]['text'];break;case'intelepeer':_0x32d786[_0xc7d1('0x59')]['from']=_0x4f7e5e['body'][_0xc7d1('0x82')];_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x59')]=_0x4f7e5e[_0xc7d1('0x59')][_0xc7d1('0x28')];_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x7f')]=_0x4f7e5e[_0xc7d1('0x59')]['refid'];break;}}if(_0x32d786[_0xc7d1('0x59')]['id']){delete _0x32d786[_0xc7d1('0x59')]['id'];}if(_[_0xc7d1('0x92')](_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x82')])){throw new db[(_0xc7d1('0x93'))]['ValidationError'](_0xc7d1('0x94'));}if(_[_0xc7d1('0x92')](_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x59')])||_0x32d786[_0xc7d1('0x59')]['body']===''){throw new db[(_0xc7d1('0x93'))][(_0xc7d1('0x77'))](_0xc7d1('0x95'));}if(_[_0xc7d1('0x92')](_0x32d786['body']['mapKey'])){throw new db['Sequelize'][(_0xc7d1('0x77'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x50eef2);}if(!_['includes'](_0x50eef2,_0x32d786['body'][_0xc7d1('0x96')])){throw new db[(_0xc7d1('0x93'))]['ValidationError'](_0xc7d1('0x97')+_0x50eef2);}_0x4eec7c[_0x32d786['body'][_0xc7d1('0x96')]]=_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x82')];return db[_0xc7d1('0x98')][_0xc7d1('0x57')]({'where':{'id':_0x32d786['account']['ListId']},'include':[{'model':db[_0xc7d1('0x76')],'as':_0xc7d1('0x99'),'where':_0x4eec7c,'limit':0x1,'order':[[_0xc7d1('0x7a'),_0xc7d1('0x9a')]]}]});})[_0xc7d1('0x21')](handleEntityNotFound(_0x4ee882,null))['then'](function(_0x338583){if(_0x338583){_0x32d786[_0xc7d1('0x9b')]=_[_0xc7d1('0x9c')](_0x338583,['Contacts']);if(_0x338583['Contacts'][_0xc7d1('0x49')]){return _0x338583[_0xc7d1('0x99')][0x0];}var _0x5a4300=_[_0xc7d1('0x1a')](_0x32d786[_0xc7d1('0x59')],{'firstName':_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x82')],'ListId':_0x338583['id']});_0x5a4300[_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x96')]]=_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x82')];return db[_0xc7d1('0x76')][_0xc7d1('0x58')](_0x5a4300,{'fields':_0x239a8e,'raw':!![]});}})[_0xc7d1('0x21')](handleEntityNotFound(_0x4ee882,null))['then'](function(_0x4a114d){if(_0x4a114d){_0x32d786[_0xc7d1('0x9d')]=_0x4a114d;var _0x4e26a9={'ContactId':_0x4a114d['id'],'phone':_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x82')],'SmsAccountId':_0x4f7e5e['params']['id']};var _0x5b58a7={'ContactId':_0x4a114d['id'],'SmsAccountId':_0x4f7e5e[_0xc7d1('0x56')]['id'],'closed':![]};return db[_0xc7d1('0x9e')]['find']({'where':_0x5b58a7})[_0xc7d1('0x21')](function(_0x127e2e){if(_0x127e2e){return[_0x127e2e,![]];}return db['SmsInteraction'][_0xc7d1('0x58')](_0x4e26a9)[_0xc7d1('0x21')](function(_0x28c083){return[_0x28c083,!![]];});});}})[_0xc7d1('0x9f')](function(_0x5bac39,_0x34fd44){_0x32d786['interaction']=_0x5bac39[_0xc7d1('0x37')]({'plain':!![]});_0x32d786[_0xc7d1('0xa0')][_0xc7d1('0xa1')]=![];if(_0x34fd44){if(_0x32d786[_0xc7d1('0x71')][_0xc7d1('0xa2')]){_0x32d786['applications'][_0xc7d1('0xa3')]({'id':0x0,'priority':_0x32d786[_0xc7d1('0x72')][_0xc7d1('0x49')]+0x1,'app':'close','appdata':_0xc7d1('0xa4'),'interval':_0xc7d1('0xa5')});}_0x32d786[_0xc7d1('0xa0')][_0xc7d1('0xa1')]=!![];}return db[_0xc7d1('0xa6')][_0xc7d1('0x58')]({'phone':_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x82')],'messageId':_0x32d786[_0xc7d1('0x59')]['messageId'],'body':_0x32d786[_0xc7d1('0x59')][_0xc7d1('0x59')],'SmsAccountId':_0x4f7e5e[_0xc7d1('0x56')]['id'],'SmsInteractionId':_0x5bac39['id'],'direction':'in','ContactId':_0x5bac39[_0xc7d1('0xa7')],'AttachmentId':_0x32d786['body'][_0xc7d1('0xa8')]});})[_0xc7d1('0x21')](function(_0x4f0e3e){_0x32d786['message']=_0x4f0e3e;if(_0x32d786[_0xc7d1('0xa0')][_0xc7d1('0xa9')]){return db[_0xc7d1('0xaa')][_0xc7d1('0x57')]({'attributes':['id',_0xc7d1('0x3c')],'where':{'id':_0x32d786[_0xc7d1('0xa0')]['UserId']}})['then'](function(_0x21b054){if(_0x21b054){_0x32d786['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xc7d1('0xab'),'appdata':_0x21b054[_0xc7d1('0x3c')]+','+(_0x32d786['account']['waitForTheAssignedAgent']||0xa),'interval':_0xc7d1('0xa5')});}return respondWithRpcPromise(_0xc7d1('0xac'),_0xc7d1('0xad'),_0x32d786);});}return respondWithRpcPromise(_0xc7d1('0xac'),_0xc7d1('0xad'),_0x32d786);})[_0xc7d1('0x21')](function(_0x8e6a6f){if(_0x8e6a6f){var _0x3d8775=0xc8;var _0x289a45=_0xc7d1('0xae');logger[_0xc7d1('0x22')](_0xc7d1('0x24'),_0x289a45,_0x3d8775,_0xc7d1('0xaf'));logger['debug'](_0xc7d1('0xb0'),_0x289a45,_0x3d8775,'entity\x20found',JSON[_0xc7d1('0x25')](_0x8e6a6f));if(_0x32d786[_0xc7d1('0x71')][_0xc7d1('0x42')]==='twilio'){return _0x4ee882[_0xc7d1('0x2c')](_0x3d8775)[_0xc7d1('0x31')](_0xc7d1('0xb1'),_0xc7d1('0xb2'))[_0xc7d1('0xb3')](_0xc7d1('0xb4'));}else{return _0x4ee882['status'](_0x3d8775)[_0xc7d1('0xb5')](_0x8e6a6f);}}})[_0xc7d1('0x2a')](handleError(_0x4ee882,null));};exports[_0xc7d1('0xb6')]=function(_0x58f408,_0x4505b9,_0x33b2b0){return db['SmsAccount']['findOne']({'where':{'id':_0x58f408[_0xc7d1('0x56')]['id']}})[_0xc7d1('0x21')](handleEntityNotFound(_0x4505b9,null))[_0xc7d1('0x21')](function(_0x12d91d){if(_0x12d91d){return db[_0xc7d1('0xb7')]['transaction'](function(_0x4f72fe){return db[_0xc7d1('0x6f')][_0xc7d1('0x36')]({'where':{'SmsAccountId':_0x58f408['params']['id']},'transaction':_0x4f72fe})[_0xc7d1('0x21')](function(_0x5e0eef){var _0x36f53e=_['map'](_0x58f408[_0xc7d1('0x59')],function(_0x2e8346){_0x2e8346[_0xc7d1('0x62')]=_0x58f408['params']['id'];return _0x2e8346;});return db[_0xc7d1('0x6f')][_0xc7d1('0xb8')](_0x36f53e,{'transaction':_0x4f72fe});});})['then'](function(){return db[_0xc7d1('0x6f')][_0xc7d1('0xb9')]({'where':{'SmsAccountId':_0x58f408['params']['id']},'order':_0xc7d1('0x74')});});}})['then'](respondWithResult(_0x4505b9,null))[_0xc7d1('0x2a')](handleError(_0x4505b9,null));};exports[_0xc7d1('0xba')]=function(_0x2ef3b4,_0x27bfed,_0x36f523){var _0x233aa1={};var _0x4b6929={};var _0x50054f;var _0x594586;return db['SmsAccount'][_0xc7d1('0x65')]({'where':{'id':_0x2ef3b4[_0xc7d1('0x56')]['id']}})[_0xc7d1('0x21')](handleEntityNotFound(_0x27bfed,null))[_0xc7d1('0x21')](function(_0x41c1d2){if(_0x41c1d2){_0x50054f=_0x41c1d2;_0x4b6929[_0xc7d1('0x43')]=_[_0xc7d1('0x45')](db[_0xc7d1('0x6f')][_0xc7d1('0x41')]);_0x4b6929['query']=_['keys'](_0x2ef3b4['query']);_0x4b6929[_0xc7d1('0x4e')]=_[_0xc7d1('0x46')](_0x4b6929[_0xc7d1('0x43')],_0x4b6929['query']);_0x233aa1[_0xc7d1('0x47')]=_[_0xc7d1('0x46')](_0x4b6929[_0xc7d1('0x43')],qs[_0xc7d1('0x48')](_0x2ef3b4[_0xc7d1('0x44')][_0xc7d1('0x48')]));_0x233aa1[_0xc7d1('0x47')]=_0x233aa1[_0xc7d1('0x47')][_0xc7d1('0x49')]?_0x233aa1['attributes']:_0x4b6929[_0xc7d1('0x43')];_0x233aa1['order']=qs[_0xc7d1('0x4c')](_0x2ef3b4[_0xc7d1('0x44')][_0xc7d1('0x4c')]);_0x233aa1['where']=qs[_0xc7d1('0x4e')](_[_0xc7d1('0x66')](_0x2ef3b4[_0xc7d1('0x44')],_0x4b6929['filters']));if(_0x2ef3b4[_0xc7d1('0x44')][_0xc7d1('0x67')]){_0x233aa1[_0xc7d1('0x4d')]=_['merge'](_0x233aa1['where'],{'$or':_[_0xc7d1('0x40')](_0x233aa1['attributes'],function(_0x5cf36f){var _0x3eba93={};_0x3eba93[_0x5cf36f]={'$like':'%'+_0x2ef3b4[_0xc7d1('0x44')][_0xc7d1('0x67')]+'%'};return _0x3eba93;})});}_0x233aa1=_[_0xc7d1('0x4f')]({},_0x233aa1,_0x2ef3b4[_0xc7d1('0x50')]);return _0x50054f['getApplications'](_0x233aa1);}})[_0xc7d1('0x21')](function(_0x27d8f3){if(_0x27d8f3){_0x594586=_0x27d8f3['length'];if(!_0x2ef3b4['query'][_0xc7d1('0x4a')](_0xc7d1('0x4b'))){_0x233aa1[_0xc7d1('0x2e')]=qs[_0xc7d1('0x2e')](_0x2ef3b4[_0xc7d1('0x44')][_0xc7d1('0x2e')]);_0x233aa1[_0xc7d1('0x2d')]=qs[_0xc7d1('0x2d')](_0x2ef3b4[_0xc7d1('0x44')][_0xc7d1('0x2d')]);}return _0x50054f[_0xc7d1('0xba')](_0x233aa1);}})[_0xc7d1('0x21')](function(_0x269fba){if(_0x269fba){return _0x269fba?{'count':_0x594586,'rows':_0x269fba}:null;}})[_0xc7d1('0x21')](respondWithResult(_0x27bfed,null))['catch'](handleError(_0x27bfed,null));};exports[_0xc7d1('0xbb')]=function(_0x26604d,_0x4deed8,_0x6f0dc7){var _0x2cb9a9={'raw':![],'where':{}};var _0x65f570={};var _0xf8f528={'count':0x0,'rows':[]};return db[_0xc7d1('0x51')][_0xc7d1('0x65')]({'where':{'id':_0x26604d[_0xc7d1('0x56')]['id']}})['then'](handleEntityNotFound(_0x4deed8,null))['then'](function(_0x114e83){if(_0x114e83){_0x65f570[_0xc7d1('0x43')]=_[_0xc7d1('0x45')](db[_0xc7d1('0x9e')][_0xc7d1('0x41')]);_0x65f570['query']=_[_0xc7d1('0x45')](_0x26604d['query']);_0x65f570[_0xc7d1('0x4e')]=_[_0xc7d1('0x46')](_0x65f570['model'],_0x65f570[_0xc7d1('0x44')]);_0x2cb9a9['attributes']=_['intersection'](_0x65f570[_0xc7d1('0x43')],qs['fields'](_0x26604d[_0xc7d1('0x44')][_0xc7d1('0x48')]));_0x2cb9a9[_0xc7d1('0x47')]=_0x2cb9a9['attributes'][_0xc7d1('0x49')]?_0x2cb9a9[_0xc7d1('0x47')]:_0x65f570[_0xc7d1('0x43')];if(!_0x26604d[_0xc7d1('0x44')][_0xc7d1('0x4a')](_0xc7d1('0x4b'))){_0x2cb9a9[_0xc7d1('0x2e')]=qs[_0xc7d1('0x2e')](_0x26604d[_0xc7d1('0x44')][_0xc7d1('0x2e')]);_0x2cb9a9[_0xc7d1('0x2d')]=qs[_0xc7d1('0x2d')](_0x26604d[_0xc7d1('0x44')][_0xc7d1('0x2d')]);}_0x2cb9a9[_0xc7d1('0x6d')]=qs[_0xc7d1('0x4c')](_0x26604d[_0xc7d1('0x44')][_0xc7d1('0x4c')]);_0x2cb9a9['where']=qs[_0xc7d1('0x4e')](_[_0xc7d1('0x66')](_0x26604d[_0xc7d1('0x44')],_0x65f570['filters']));_0x2cb9a9[_0xc7d1('0x4d')]['SmsAccountId']=_0x114e83['id'];if(_0x26604d[_0xc7d1('0x44')]['filter']){_0x2cb9a9[_0xc7d1('0x4d')]=_[_0xc7d1('0x4f')](_0x2cb9a9[_0xc7d1('0x4d')],{'$or':_[_0xc7d1('0x40')](_0x2cb9a9[_0xc7d1('0x47')],function(_0x5acd81){var _0x2945ed={};_0x2945ed[_0x5acd81]={'$like':'%'+_0x26604d['query']['filter']+'%'};return _0x2945ed;})});}_0x2cb9a9=_['merge']({},_0x2cb9a9,_0x26604d['options']);return db[_0xc7d1('0x9e')][_0xc7d1('0x30')]({'where':_0x2cb9a9[_0xc7d1('0x4d')]})[_0xc7d1('0x21')](function(_0x4419f8){_0xf8f528[_0xc7d1('0x30')]=_0x4419f8;if(_0x26604d['query'][_0xc7d1('0x68')]){_0x2cb9a9[_0xc7d1('0x52')]=[{'model':db[_0xc7d1('0x76')],'as':_0xc7d1('0xbc'),'required':![]},{'model':db[_0xc7d1('0xaa')],'as':_0xc7d1('0xbd'),'attributes':[_0xc7d1('0x3c'),'fullname',_0xc7d1('0xbe')],'required':![]},{'model':db[_0xc7d1('0xbf')],'as':'Tags','attributes':['id',_0xc7d1('0x3c'),_0xc7d1('0xc0')],'where':_0x26604d[_0xc7d1('0x44')]['tag']?{'id':_0x26604d[_0xc7d1('0x44')][_0xc7d1('0xc1')]}:undefined,'required':_0x26604d[_0xc7d1('0x44')][_0xc7d1('0xc1')]?!![]:![]}];}return db[_0xc7d1('0x9e')][_0xc7d1('0x53')](_0x2cb9a9);})['then'](function(_0x4c0a48){_0xf8f528[_0xc7d1('0x54')]=_0x4c0a48;return _0xf8f528;});}})['then'](respondWithFilteredResult(_0x4deed8,_0x2cb9a9))[_0xc7d1('0x2a')](handleError(_0x4deed8,null));};exports[_0xc7d1('0xb3')]=function(_0x37e9c2,_0x52c12d,_0x48303a){var _0x7d5e8,_0x3dc77e,_0x1db249;if(_[_0xc7d1('0x92')](_0x37e9c2[_0xc7d1('0x59')][_0xc7d1('0x59')])||_0x37e9c2[_0xc7d1('0x59')]['body']===''){throw new db[(_0xc7d1('0x93'))][(_0xc7d1('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x37e9c2['body']['to'])){throw new db[(_0xc7d1('0x93'))]['ValidationError'](_0xc7d1('0xc2'));}_0x7d5e8=_0x37e9c2['body']['to'];return db[_0xc7d1('0x51')][_0xc7d1('0x57')]({'where':{'id':_0x37e9c2[_0xc7d1('0x56')]['id']},'include':[{'model':db[_0xc7d1('0x98')],'as':_0xc7d1('0xc3'),'include':[{'model':db[_0xc7d1('0x76')],'as':_0xc7d1('0x99'),'where':{'mobile':_0x7d5e8},'limit':0x1,'order':[[_0xc7d1('0x7a'),'DESC']]}]}]})[_0xc7d1('0x21')](handleEntityNotFound(_0x52c12d,null))[_0xc7d1('0x21')](function(_0x5bcfb4){if(_0x5bcfb4&&_0x5bcfb4[_0xc7d1('0xc3')]){_0x3dc77e=_0x5bcfb4['get']({'plain':!![]});if(_0x3dc77e[_0xc7d1('0xc3')]&&_0x3dc77e['List'][_0xc7d1('0x99')]['length']){return _0x3dc77e[_0xc7d1('0xc3')][_0xc7d1('0x99')][0x0];}return db[_0xc7d1('0x76')][_0xc7d1('0x58')](_[_0xc7d1('0x1a')](_0x37e9c2[_0xc7d1('0x59')],{'firstName':_0x7d5e8,'mobile':_0x7d5e8,'phone':_0x7d5e8,'ListId':_0x3dc77e[_0xc7d1('0x7d')]}));}})['then'](handleEntityNotFound(_0x52c12d,null))['then'](function(_0x1cbfa1){if(_0x1cbfa1){_0x1db249=_0x1cbfa1;return db['SmsInteraction'][_0xc7d1('0x57')]({'where':{'ContactId':_0x1db249['id'],'closed':![],'SmsAccountId':_0x3dc77e['id']}})[_0xc7d1('0x21')](function(_0x13a24d){if(_0x13a24d){return[_0x13a24d,![]];}return db[_0xc7d1('0x9e')]['create']({'UserId':_0x37e9c2['user']['id'],'ContactId':_0x1db249['id'],'SmsAccountId':_0x3dc77e['id'],'phone':_0x7d5e8,'firstMsgDirection':_0xc7d1('0xc4'),'Messages':[_[_0xc7d1('0x4f')](_0x37e9c2['body'],{'read':![],'body':_0x37e9c2[_0xc7d1('0x59')][_0xc7d1('0x59')],'phone':_0x7d5e8,'SmsAccountId':_0x3dc77e['id'],'UserId':_0x37e9c2['user']['id'],'ContactId':_0x1db249['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xc7d1('0xc5')}]})['then'](function(_0xa3f098){return[_0xa3f098,!![]];});});}})[_0xc7d1('0x9f')](function(_0x41292a,_0x3a625e){if(_0x3a625e){return _0x41292a;}return db[_0xc7d1('0xa6')][_0xc7d1('0x58')](_[_0xc7d1('0x4f')](_0x37e9c2[_0xc7d1('0x59')],{'read':![],'body':_0x37e9c2[_0xc7d1('0x59')]['body'],'phone':_0x7d5e8,'SmsAccountId':_0x3dc77e['id'],'SmsInteractionId':_0x41292a['id'],'UserId':_0x37e9c2['user']['id'],'ContactId':_0x1db249['id']}))[_0xc7d1('0x21')](function(_0x31b977){_0x41292a[_0xc7d1('0xc6')][_0xc7d1('0xc5')]=[];_0x41292a[_0xc7d1('0xc6')][_0xc7d1('0xc5')][_0xc7d1('0xa3')](_0x31b977[_0xc7d1('0xc6')]);return _0x41292a;});})[_0xc7d1('0x21')](respondWithResult(_0x52c12d,null))[_0xc7d1('0x2a')](handleError(_0x52c12d,null));};exports['status']=function(_0x3b7b6c,_0x20f4e5,_0xb8f863){if(_0x3b7b6c[_0xc7d1('0x59')]['id']){delete _0x3b7b6c[_0xc7d1('0x59')]['id'];}var _0xd1c9b7,_0x595ebd,_0x1146c0;return db['SmsAccount'][_0xc7d1('0x57')]({'where':{'id':_0x3b7b6c['params']['id']}})[_0xc7d1('0x21')](handleEntityNotFound(_0x20f4e5,null))['then'](function(_0x36b07a){if(_0x36b07a){_0x1146c0=_0x36b07a;logger[_0xc7d1('0xc7')](_0xc7d1('0x24'),'status',_0xc7d1('0xc8'),_0x36b07a[_0xc7d1('0x42')],util[_0xc7d1('0xc9')](_0x3b7b6c[_0xc7d1('0x59')],{'showHidden':![],'depth':null}));switch(_0x36b07a[_0xc7d1('0x42')]){case'skebby':if(_0x3b7b6c['body'][_0xc7d1('0xca')]&&_0x3b7b6c['body'][_0xc7d1('0x2c')]){_0x595ebd=_0x3b7b6c[_0xc7d1('0x59')][_0xc7d1('0x2c')];return db['SmsMessage'][_0xc7d1('0x57')]({'where':{'messageId':_0x3b7b6c[_0xc7d1('0x59')][_0xc7d1('0xca')]}});}break;case _0xc7d1('0x85'):if(_0x3b7b6c['body'][_0xc7d1('0xcb')]&&_0x3b7b6c[_0xc7d1('0x59')][_0xc7d1('0xcc')]){_0x595ebd=_0x3b7b6c[_0xc7d1('0x59')]['statusInt'];return db[_0xc7d1('0xa6')][_0xc7d1('0x57')]({'where':{'messageId':_0x3b7b6c[_0xc7d1('0x59')][_0xc7d1('0xcb')]}});}break;case'clicksend':if(_0x3b7b6c['body'][_0xc7d1('0xcd')]&&_0x3b7b6c[_0xc7d1('0x59')][_0xc7d1('0xce')]){_0x595ebd=_0x3b7b6c[_0xc7d1('0x59')][_0xc7d1('0xce')];return db[_0xc7d1('0xa6')][_0xc7d1('0x57')]({'where':{'messageId':_0x3b7b6c['body']['message_id']}});}break;case'infobip':var _0xc1f533=_0x3b7b6c['body']['results'][0x0];if(_0xc1f533[_0xc7d1('0x7f')]&&_0xc1f533[_0xc7d1('0x2c')]['groupName']===_0xc7d1('0xcf')){_0x595ebd=_0xc1f533[_0xc7d1('0x2c')][_0xc7d1('0xd0')];return db[_0xc7d1('0xa6')][_0xc7d1('0x57')]({'where':{'messageId':_0xc1f533[_0xc7d1('0x7f')]}});}break;case _0xc7d1('0x8e'):if(_0x3b7b6c[_0xc7d1('0x59')][_0xc7d1('0x7f')]&&_0x3b7b6c[_0xc7d1('0x59')][_0xc7d1('0x2c')]){_0x595ebd=_0x3b7b6c['body'][_0xc7d1('0x2c')];return db[_0xc7d1('0xa6')][_0xc7d1('0x57')]({'where':{'messageId':_0x3b7b6c['body']['messageId']}});}break;case _0xc7d1('0x91'):if(_0x3b7b6c[_0xc7d1('0x59')][0x0][_0xc7d1('0x28')]['id']){_0x595ebd=_0x3b7b6c[_0xc7d1('0x59')][0x0][_0xc7d1('0x42')];return db['SmsMessage'][_0xc7d1('0x57')]({'where':{'messageId':_0x3b7b6c[_0xc7d1('0x59')][0x0][_0xc7d1('0x28')]['id']}});}break;case _0xc7d1('0xd1'):if(_0x3b7b6c[_0xc7d1('0x59')][_0xc7d1('0xd2')]&&_0x3b7b6c[_0xc7d1('0x59')]['status']){_0x595ebd=_0x3b7b6c['body']['status'];return db[_0xc7d1('0xa6')]['find']({'where':{'messageId':_0x3b7b6c[_0xc7d1('0x59')][_0xc7d1('0xd2')]}});}break;}}})['then'](handleEntityNotFound(_0x20f4e5,null))[_0xc7d1('0x21')](function(_0x24344a){if(_0x24344a){_0xd1c9b7=_0x24344a;switch(_0x1146c0[_0xc7d1('0x42')]){case'skebby':if(_0x595ebd===_0xc7d1('0xcf')){return _0xd1c9b7[_0xc7d1('0x35')]({'read':!![]});}else{logger[_0xc7d1('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc7d1('0x2c'),_0xc7d1('0x81'),util[_0xc7d1('0xc9')](_0x3b7b6c[_0xc7d1('0x59')],{'showHidden':![],'depth':null}));}break;case _0xc7d1('0x85'):if(_0x595ebd==='1'){return _0xd1c9b7[_0xc7d1('0x35')]({'read':!![]});}else{logger[_0xc7d1('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc7d1('0x2c'),'skebby',util[_0xc7d1('0xc9')](_0x3b7b6c[_0xc7d1('0x59')],{'showHidden':![],'depth':null}));}break;case _0xc7d1('0xd3'):if(!_0x3b7b6c[_0xc7d1('0x59')][_0xc7d1('0xd4')]&&_0x595ebd>=0xc8&&_0x595ebd<=0xce){return _0xd1c9b7[_0xc7d1('0x35')]({'read':!![]});}else{logger[_0xc7d1('0x26')](_0xc7d1('0x24'),'status',_0xc7d1('0xd3'),util[_0xc7d1('0xc9')](_0x3b7b6c['body'],{'showHidden':![],'depth':null}));}break;case _0xc7d1('0x89'):var _0x3467eb=_0x3b7b6c[_0xc7d1('0x59')][_0xc7d1('0x8a')][0x0];if(_0x3467eb['status'][_0xc7d1('0xd0')]==='DELIVERED'){return _0xd1c9b7['update']({'read':!![]});}else{logger[_0xc7d1('0x26')](_0xc7d1('0x24'),_0xc7d1('0x2c'),'infobip',util[_0xc7d1('0xc9')](_0x3b7b6c[_0xc7d1('0x59')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x595ebd=='DELIVERED_TO_GATEWAY'||_0x595ebd==_0xc7d1('0xd5')){return _0xd1c9b7[_0xc7d1('0x35')]({'read':!![]});}else{logger['error'](_0xc7d1('0x24'),_0xc7d1('0x2c'),_0xc7d1('0x8e'),util[_0xc7d1('0xc9')](_0x3b7b6c[_0xc7d1('0x59')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x595ebd=='message-delivered'){return _0xd1c9b7[_0xc7d1('0x35')]({'read':!![]});}else{logger[_0xc7d1('0x26')](_0xc7d1('0x24'),_0xc7d1('0x2c'),_0xc7d1('0x91'),util[_0xc7d1('0xc9')](_0x3b7b6c[_0xc7d1('0x59')],{'showHidden':![],'depth':null}));}break;case _0xc7d1('0xd1'):if(_0x595ebd===_0xc7d1('0xd6')||_0x595ebd===_0xc7d1('0xd7')){return _0xd1c9b7[_0xc7d1('0x35')]({'read':!![]});}else{logger[_0xc7d1('0x26')](_0xc7d1('0x24'),'status',_0xc7d1('0xd1'),util[_0xc7d1('0xc9')](_0x3b7b6c[_0xc7d1('0x59')],{'showHidden':![],'depth':null}));}break;}return _0xd1c9b7;}})[_0xc7d1('0x21')](respondWithResult(_0x20f4e5,null))['catch'](handleError(_0x20f4e5,null));};exports[_0xc7d1('0xd8')]=function(_0x132faf,_0xd32e81,_0x1912b7){var _0x21b931,_0x5f1d51,_0xba0c5b;return db[_0xc7d1('0x51')][_0xc7d1('0x57')]({'where':{'id':_0x132faf[_0xc7d1('0x56')]['id']}})['then'](handleEntityNotFound(_0xd32e81,null))[_0xc7d1('0x21')](function(_0xb817f8){if(_0xb817f8){_0xba0c5b=_0xb817f8;logger[_0xc7d1('0xc7')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc7d1('0x2c'),'received\x20delivery\x20report\x20from',_0xb817f8[_0xc7d1('0x42')],util['inspect'](_0x132faf['query'],{'showHidden':![],'depth':null}));switch(_0xb817f8['type']){case _0xc7d1('0x8b'):if(_0x132faf[_0xc7d1('0x44')]['message-id']&&_0x132faf[_0xc7d1('0x44')]['state']){_0x5f1d51=_0x132faf['query'][_0xc7d1('0xd9')];return db['SmsMessage']['find']({'where':{'messageId':_0x132faf['query'][_0xc7d1('0xda')]}});}break;}}})[_0xc7d1('0x21')](handleEntityNotFound(_0xd32e81,null))[_0xc7d1('0x21')](function(_0x4fba60){if(_0x4fba60){_0x21b931=_0x4fba60;switch(_0xba0c5b[_0xc7d1('0x42')]){case _0xc7d1('0x8b'):if(_0x5f1d51==='2'||_0x5f1d51==='6'){return _0x21b931['update']({'read':!![]});}else{logger[_0xc7d1('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc7d1('0x2c'),_0xc7d1('0x8b'),util[_0xc7d1('0xc9')](_0x132faf[_0xc7d1('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x21b931;}})['then'](respondWithResult(_0xd32e81,null))['catch'](handleError(_0xd32e81,null));};exports[_0xc7d1('0xdb')]=function(_0x4aa1ae,_0x229b69,_0x361eec){return db[_0xc7d1('0x51')][_0xc7d1('0x57')]({'where':{'id':_0x4aa1ae['params']['id']}})[_0xc7d1('0x21')](handleEntityNotFound(_0x229b69,null))[_0xc7d1('0x21')](function(_0xfa0d32){if(_0xfa0d32){return _0xfa0d32[_0xc7d1('0xdb')](_0x4aa1ae[_0xc7d1('0x59')][_0xc7d1('0x6a')],_['omit'](_0x4aa1ae[_0xc7d1('0x59')],[_0xc7d1('0x6a'),'id'])||{})[_0xc7d1('0x9f')](function(_0x4e1c1f){for(var _0x5a1427=0x0;_0x5a1427<_0x4aa1ae[_0xc7d1('0x59')][_0xc7d1('0x6a')][_0xc7d1('0x49')];_0x5a1427+=0x1){socket[_0xc7d1('0xdc')]('userSmsAccount:save',{'UserId':Number(_0x4aa1ae[_0xc7d1('0x59')][_0xc7d1('0x6a')][_0x5a1427]),'SmsAccountId':Number(_0x4aa1ae[_0xc7d1('0x56')]['id'])});}return _0x4e1c1f;});}})[_0xc7d1('0x21')](respondWithResult(_0x229b69,null))['catch'](handleError(_0x229b69,null));};exports[_0xc7d1('0xdd')]=function(_0x567daa,_0x1a7dc8,_0x42b585){return db[_0xc7d1('0x51')][_0xc7d1('0x57')]({'where':{'id':_0x567daa['params']['id']}})[_0xc7d1('0x21')](handleEntityNotFound(_0x1a7dc8,null))[_0xc7d1('0x21')](function(_0x41d763){if(_0x41d763){return _0x41d763[_0xc7d1('0xdd')](_0x567daa['query']['ids'])[_0xc7d1('0x21')](function(){if(_[_0xc7d1('0xde')](_0x567daa[_0xc7d1('0x44')][_0xc7d1('0x6a')])){for(var _0x3561b1=0x0;_0x3561b1<_0x567daa[_0xc7d1('0x44')]['ids']['length'];_0x3561b1+=0x1){socket[_0xc7d1('0xdc')](_0xc7d1('0xdf'),{'UserId':Number(_0x567daa[_0xc7d1('0x44')]['ids'][_0x3561b1]),'SmsAccountId':Number(_0x567daa[_0xc7d1('0x56')]['id'])});}}else{socket[_0xc7d1('0xdc')](_0xc7d1('0xdf'),{'UserId':Number(_0x567daa[_0xc7d1('0x44')]['ids']),'SmsAccountId':Number(_0x567daa[_0xc7d1('0x56')]['id'])});}});}})[_0xc7d1('0x21')](respondWithStatusCode(_0x1a7dc8,null))[_0xc7d1('0x2a')](handleError(_0x1a7dc8,null));};exports[_0xc7d1('0xe0')]=function(_0x4eb222,_0x30eafb,_0x160db5){var _0x416c2d={};var _0x2a8035={};var _0x34520a;var _0x53ec1b;return db[_0xc7d1('0x51')][_0xc7d1('0x65')]({'where':{'id':_0x4eb222[_0xc7d1('0x56')]['id']}})[_0xc7d1('0x21')](handleEntityNotFound(_0x30eafb,null))['then'](function(_0x2af821){if(_0x2af821){_0x34520a=_0x2af821;_0x2a8035[_0xc7d1('0x43')]=_[_0xc7d1('0x45')](db[_0xc7d1('0xaa')][_0xc7d1('0x41')]);_0x2a8035[_0xc7d1('0x44')]=_[_0xc7d1('0x45')](_0x4eb222[_0xc7d1('0x44')]);_0x2a8035[_0xc7d1('0x4e')]=_['intersection'](_0x2a8035[_0xc7d1('0x43')],_0x2a8035[_0xc7d1('0x44')]);_0x416c2d[_0xc7d1('0x47')]=_[_0xc7d1('0x46')](_0x2a8035[_0xc7d1('0x43')],qs['fields'](_0x4eb222[_0xc7d1('0x44')][_0xc7d1('0x48')]));_0x416c2d['attributes']=_0x416c2d[_0xc7d1('0x47')][_0xc7d1('0x49')]?_0x416c2d[_0xc7d1('0x47')]:_0x2a8035[_0xc7d1('0x43')];_0x416c2d[_0xc7d1('0x6d')]=qs['sort'](_0x4eb222[_0xc7d1('0x44')][_0xc7d1('0x4c')]);_0x416c2d[_0xc7d1('0x4d')]=qs[_0xc7d1('0x4e')](_['pick'](_0x4eb222[_0xc7d1('0x44')],_0x2a8035[_0xc7d1('0x4e')]));if(_0x4eb222[_0xc7d1('0x44')][_0xc7d1('0x67')]){_0x416c2d[_0xc7d1('0x4d')]=_[_0xc7d1('0x4f')](_0x416c2d[_0xc7d1('0x4d')],{'$or':_['map'](_0x416c2d['attributes'],function(_0x429044){var _0x5de033={};_0x5de033[_0x429044]={'$like':'%'+_0x4eb222[_0xc7d1('0x44')][_0xc7d1('0x67')]+'%'};return _0x5de033;})});}_0x416c2d=_[_0xc7d1('0x4f')]({},_0x416c2d,_0x4eb222[_0xc7d1('0x50')]);return _0x34520a[_0xc7d1('0xe0')](_0x416c2d);}})[_0xc7d1('0x21')](function(_0x1fa2a7){if(_0x1fa2a7){_0x53ec1b=_0x1fa2a7[_0xc7d1('0x49')];if(!_0x4eb222['query'][_0xc7d1('0x4a')](_0xc7d1('0x4b'))){_0x416c2d[_0xc7d1('0x2e')]=qs[_0xc7d1('0x2e')](_0x4eb222['query'][_0xc7d1('0x2e')]);_0x416c2d['offset']=qs['offset'](_0x4eb222[_0xc7d1('0x44')][_0xc7d1('0x2d')]);}return _0x34520a[_0xc7d1('0xe0')](_0x416c2d);}})['then'](function(_0x1b7152){if(_0x1b7152){return _0x1b7152?{'count':_0x53ec1b,'rows':_0x1b7152}:null;}})['then'](respondWithResult(_0x30eafb,null))['catch'](handleError(_0x30eafb,null));}; \ No newline at end of file +var _0x4c00=['color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','spread','SmsMessage','dataValues','Messages','received\x20delivery\x20report\x20from','skebby','skebby_dispatch_id','requestid','statusInt','clicksend','message_id','status_code','groupName','DELIVERED','intelepeer','redif','inspect','error_code','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','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','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','SmsAccounts','stack','name','send','index','mandatoryDispositionPause','map','SmsAccount','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','Pause','rawAttributes','length','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','SmsAccountId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sms','SmsApplication','account','orderBy','priority','Applications','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','mobile','twilio','from','From','messageId','MessageSid','text','connectel','plivo','Text','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','bandwidth','refid','isNil','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','updatedAt','DESC','omit','Contacts','contact','SmsInteraction','interaction','created','autoclose','applications','close','unmanaged','ContactId','AttachmentId','User','UserId','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','\x0a','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Owner','fullname','Tag'];(function(_0x469dd6,_0x418b44){var _0x18c2c8=function(_0x6e0747){while(--_0x6e0747){_0x469dd6['push'](_0x469dd6['shift']());}};_0x18c2c8(++_0x418b44);}(_0x4c00,0x105));var _0x04c0=function(_0x47c902,_0x220fd2){_0x47c902=_0x47c902-0x0;var _0x1ad6a0=_0x4c00[_0x47c902];return _0x1ad6a0;};'use strict';var emlformat=require(_0x04c0('0x0'));var rimraf=require(_0x04c0('0x1'));var zipdir=require(_0x04c0('0x2'));var jsonpatch=require(_0x04c0('0x3'));var rp=require('request-promise');var moment=require(_0x04c0('0x4'));var BPromise=require(_0x04c0('0x5'));var Mustache=require(_0x04c0('0x6'));var util=require(_0x04c0('0x7'));var path=require(_0x04c0('0x8'));var sox=require(_0x04c0('0x9'));var csv=require('to-csv');var ejs=require(_0x04c0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x04c0('0xb'));var squel=require('squel');var crypto=require(_0x04c0('0xc'));var jsforce=require(_0x04c0('0xd'));var deskjs=require(_0x04c0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x04c0('0xf'));var Papa=require(_0x04c0('0x10'));var Redis=require(_0x04c0('0x11'));var authService=require(_0x04c0('0x12'));var qs=require(_0x04c0('0x13'));var as=require(_0x04c0('0x14'));var hardwareService=require(_0x04c0('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x04c0('0x16'));var config=require(_0x04c0('0x17'));var licenseUtil=require(_0x04c0('0x18'));var db=require(_0x04c0('0x19'))['db'];config[_0x04c0('0x1a')]=_[_0x04c0('0x1b')](config[_0x04c0('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x04c0('0x1c'))(new Redis(config[_0x04c0('0x1a')]));require(_0x04c0('0x1d'))[_0x04c0('0x1e')](socket);var jayson=require(_0x04c0('0x1f'));var client=jayson['client'][_0x04c0('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x24b812,_0xfe6440,_0xb6958f,_0x313aea){return new BPromise(function(_0x111635,_0x21a0e9){var _0x520f24=_0x313aea||client;return _0x520f24[_0x04c0('0x21')](_0x24b812,_0xb6958f)[_0x04c0('0x22')](function(_0x11848e){logger[_0x04c0('0x23')](_0x04c0('0x24'),_0xfe6440,_0x04c0('0x25'));logger[_0x04c0('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfe6440,_0x04c0('0x25'),JSON['stringify'](_0x11848e));if(_0x11848e[_0x04c0('0x27')]){if(_0x11848e[_0x04c0('0x27')][_0x04c0('0x28')]===0x1f4){logger[_0x04c0('0x27')](_0x04c0('0x24'),_0xfe6440,_0x11848e[_0x04c0('0x27')][_0x04c0('0x29')]);return _0x21a0e9(_0x11848e[_0x04c0('0x27')][_0x04c0('0x29')]);}logger[_0x04c0('0x27')]('SmsAccount,\x20%s,\x20%s',_0xfe6440,_0x11848e[_0x04c0('0x27')]['message']);return _0x111635(_0x11848e[_0x04c0('0x27')]['message']);}else{logger[_0x04c0('0x23')](_0x04c0('0x24'),_0xfe6440,_0x04c0('0x25'));_0x111635(_0x11848e[_0x04c0('0x2a')][_0x04c0('0x29')]);}})[_0x04c0('0x2b')](function(_0x1cb86b){logger['error'](_0x04c0('0x24'),_0xfe6440,_0x1cb86b);_0x21a0e9(_0x1cb86b);});});}function respondWithStatusCode(_0xfb4512,_0x481bca){_0x481bca=_0x481bca||0xcc;return function(_0x355b72){if(_0x355b72){return _0xfb4512['sendStatus'](_0x481bca);}return _0xfb4512['status'](_0x481bca)[_0x04c0('0x2c')]();};}function respondWithResult(_0x53dc0c,_0x3204bc){_0x3204bc=_0x3204bc||0xc8;return function(_0x3dcad8){if(_0x3dcad8){return _0x53dc0c[_0x04c0('0x2d')](_0x3204bc)[_0x04c0('0x2e')](_0x3dcad8);}};}function respondWithFilteredResult(_0x521fe6,_0x396d90){return function(_0x1db474){if(_0x1db474){var _0x35516f=typeof _0x396d90[_0x04c0('0x2f')]===_0x04c0('0x30')&&typeof _0x396d90[_0x04c0('0x31')]===_0x04c0('0x30');var _0x377787=_0x1db474[_0x04c0('0x32')];var _0x4352e8=_0x35516f?0x0:_0x396d90[_0x04c0('0x2f')];var _0x3d893b=_0x35516f?_0x1db474[_0x04c0('0x32')]:_0x396d90[_0x04c0('0x2f')]+_0x396d90[_0x04c0('0x31')];var _0xe59f23;if(_0x3d893b>=_0x377787){_0x3d893b=_0x377787;_0xe59f23=0xc8;}else{_0xe59f23=0xce;}_0x521fe6[_0x04c0('0x2d')](_0xe59f23);return _0x521fe6['set'](_0x04c0('0x33'),_0x4352e8+'-'+_0x3d893b+'/'+_0x377787)[_0x04c0('0x2e')](_0x1db474);}return null;};}function patchUpdates(_0x5b0050){return function(_0x3fa9dc){try{jsonpatch[_0x04c0('0x34')](_0x3fa9dc,_0x5b0050,!![]);}catch(_0x154aeb){return BPromise[_0x04c0('0x35')](_0x154aeb);}return _0x3fa9dc[_0x04c0('0x36')]();};}function saveUpdates(_0x2dfc3c,_0x50cad5){return function(_0x4df793){if(_0x4df793){return _0x4df793[_0x04c0('0x37')](_0x2dfc3c)[_0x04c0('0x22')](function(_0x2f07ae){return _0x2f07ae;});}return null;};}function removeEntity(_0x472f7b,_0x4c782d){return function(_0x2491e3){if(_0x2491e3){return _0x2491e3[_0x04c0('0x38')]()['then'](function(){var _0x4dd2ba=_0x2491e3['get']({'plain':!![]});var _0x5567d7=_0x04c0('0x39');return db['UserProfileResource'][_0x04c0('0x38')]({'where':{'type':_0x5567d7,'resourceId':_0x4dd2ba['id']}})['then'](function(){return _0x2491e3;});})[_0x04c0('0x22')](function(){_0x472f7b[_0x04c0('0x2d')](0xcc)[_0x04c0('0x2c')]();});}};}function handleEntityNotFound(_0x5cac3a,_0x1df013){return function(_0x1d17be){if(!_0x1d17be){_0x5cac3a['sendStatus'](0x194);}return _0x1d17be;};}function handleError(_0x80327b,_0x33132b){_0x33132b=_0x33132b||0x1f4;return function(_0x23b558){logger[_0x04c0('0x27')](_0x23b558[_0x04c0('0x3a')]);if(_0x23b558['name']){delete _0x23b558[_0x04c0('0x3b')];}_0x80327b[_0x04c0('0x2d')](_0x33132b)[_0x04c0('0x3c')](_0x23b558);};}exports[_0x04c0('0x3d')]=function(_0x370426,_0x333258){var _0x1a9be1={'include':[{'model':db['Pause'],'as':_0x04c0('0x3e')}]},_0x325f54={},_0xf71cf6={'count':0x0,'rows':[]};var _0x537518=_[_0x04c0('0x3f')](db[_0x04c0('0x40')]['rawAttributes'],function(_0x1c1573){return{'name':_0x1c1573['fieldName'],'type':_0x1c1573['type'][_0x04c0('0x41')]};});_0x325f54[_0x04c0('0x42')]=_['map'](_0x537518,_0x04c0('0x3b'));_0x325f54[_0x04c0('0x43')]=_[_0x04c0('0x44')](_0x370426[_0x04c0('0x43')]);_0x325f54[_0x04c0('0x45')]=_[_0x04c0('0x46')](_0x325f54[_0x04c0('0x42')],_0x325f54['query']);_0x1a9be1['attributes']=_['intersection'](_0x325f54['model'],qs['fields'](_0x370426[_0x04c0('0x43')][_0x04c0('0x47')]));_0x1a9be1[_0x04c0('0x48')]=_0x1a9be1[_0x04c0('0x48')]['length']?_0x1a9be1[_0x04c0('0x48')]:_0x325f54[_0x04c0('0x42')];if(!_0x370426[_0x04c0('0x43')]['hasOwnProperty'](_0x04c0('0x49'))){_0x1a9be1['limit']=qs[_0x04c0('0x31')](_0x370426[_0x04c0('0x43')][_0x04c0('0x31')]);_0x1a9be1[_0x04c0('0x2f')]=qs[_0x04c0('0x2f')](_0x370426[_0x04c0('0x43')]['offset']);}_0x1a9be1[_0x04c0('0x4a')]=qs[_0x04c0('0x4b')](_0x370426[_0x04c0('0x43')][_0x04c0('0x4b')]);_0x1a9be1[_0x04c0('0x4c')]=qs[_0x04c0('0x45')](_[_0x04c0('0x4d')](_0x370426[_0x04c0('0x43')],_0x325f54[_0x04c0('0x45')]),_0x537518);if(_0x370426[_0x04c0('0x43')][_0x04c0('0x4e')]){_0x1a9be1[_0x04c0('0x4c')]=_[_0x04c0('0x4f')](_0x1a9be1[_0x04c0('0x4c')],{'$or':_['map'](_0x537518,function(_0x22a3a8){if(_0x22a3a8[_0x04c0('0x50')]!==_0x04c0('0x51')){var _0x55186d={};_0x55186d[_0x22a3a8[_0x04c0('0x3b')]]={'$like':'%'+_0x370426['query'][_0x04c0('0x4e')]+'%'};return _0x55186d;}})});}_0x1a9be1=_[_0x04c0('0x4f')]({},_0x1a9be1,_0x370426[_0x04c0('0x52')]);var _0x2f146a={'where':_0x1a9be1[_0x04c0('0x4c')]};return db[_0x04c0('0x40')][_0x04c0('0x32')](_0x2f146a)['then'](function(_0x15d91b){_0xf71cf6[_0x04c0('0x32')]=_0x15d91b;if(_0x370426[_0x04c0('0x43')][_0x04c0('0x53')]){_0x1a9be1[_0x04c0('0x54')]=[{'all':!![]}];}return db[_0x04c0('0x40')]['findAll'](_0x1a9be1);})['then'](function(_0x2750f0){_0xf71cf6[_0x04c0('0x55')]=_0x2750f0;return _0xf71cf6;})[_0x04c0('0x22')](respondWithFilteredResult(_0x333258,_0x1a9be1))[_0x04c0('0x2b')](handleError(_0x333258,null));};exports['show']=function(_0x4bc46a,_0x2c292a){var _0x3e55b9={'raw':![],'where':{'id':_0x4bc46a['params']['id']},'include':[{'model':db[_0x04c0('0x56')],'as':'mandatoryDispositionPause'}]},_0x5abd99={};_0x5abd99[_0x04c0('0x42')]=_[_0x04c0('0x44')](db['SmsAccount'][_0x04c0('0x57')]);_0x5abd99['query']=_['keys'](_0x4bc46a[_0x04c0('0x43')]);_0x5abd99[_0x04c0('0x45')]=_[_0x04c0('0x46')](_0x5abd99[_0x04c0('0x42')],_0x5abd99[_0x04c0('0x43')]);_0x3e55b9[_0x04c0('0x48')]=_[_0x04c0('0x46')](_0x5abd99['model'],qs[_0x04c0('0x47')](_0x4bc46a[_0x04c0('0x43')][_0x04c0('0x47')]));_0x3e55b9['attributes']=_0x3e55b9[_0x04c0('0x48')][_0x04c0('0x58')]?_0x3e55b9[_0x04c0('0x48')]:_0x5abd99[_0x04c0('0x42')];if(_0x4bc46a[_0x04c0('0x43')][_0x04c0('0x53')]){_0x3e55b9[_0x04c0('0x54')]=[{'all':!![]}];}_0x3e55b9=_[_0x04c0('0x4f')]({},_0x3e55b9,_0x4bc46a[_0x04c0('0x52')]);return db[_0x04c0('0x40')][_0x04c0('0x59')](_0x3e55b9)[_0x04c0('0x22')](handleEntityNotFound(_0x2c292a,null))['then'](respondWithResult(_0x2c292a,null))[_0x04c0('0x2b')](handleError(_0x2c292a,null));};exports[_0x04c0('0x5a')]=function(_0x18c14a,_0x468590){return db[_0x04c0('0x40')][_0x04c0('0x5a')](_0x18c14a['body'],{})[_0x04c0('0x22')](function(_0x21ab6f){var _0x26b906=_0x18c14a[_0x04c0('0x5b')][_0x04c0('0x5c')]({'plain':!![]});if(!_0x26b906)throw new Error(_0x04c0('0x5d'));if(_0x26b906[_0x04c0('0x5e')]===_0x04c0('0x5b')){var _0x5bffd8=_0x21ab6f[_0x04c0('0x5c')]({'plain':!![]});var _0x38fe57=_0x04c0('0x39');return db['UserProfileSection'][_0x04c0('0x59')]({'where':{'name':_0x38fe57,'userProfileId':_0x26b906[_0x04c0('0x5f')]},'raw':!![]})[_0x04c0('0x22')](function(_0x5e6797){if(_0x5e6797&&_0x5e6797[_0x04c0('0x60')]===0x0){return db[_0x04c0('0x61')][_0x04c0('0x5a')]({'name':_0x5bffd8['name'],'resourceId':_0x5bffd8['id'],'type':_0x5e6797[_0x04c0('0x3b')],'sectionId':_0x5e6797['id']},{})[_0x04c0('0x22')](function(){return _0x21ab6f;});}else{return _0x21ab6f;}})[_0x04c0('0x2b')](function(_0x24cffa){logger[_0x04c0('0x27')](_0x04c0('0x62'),_0x24cffa);throw _0x24cffa;});}return _0x21ab6f;})[_0x04c0('0x22')](respondWithResult(_0x468590,0xc9))['catch'](handleError(_0x468590,null));};exports['update']=function(_0x9e67f7,_0x1f9bfd){if(_0x9e67f7[_0x04c0('0x63')]['id']){delete _0x9e67f7[_0x04c0('0x63')]['id'];}return db[_0x04c0('0x40')][_0x04c0('0x59')]({'where':{'id':_0x9e67f7[_0x04c0('0x64')]['id']},'include':[{'model':db[_0x04c0('0x56')],'as':_0x04c0('0x3e')}]})[_0x04c0('0x22')](handleEntityNotFound(_0x1f9bfd,null))[_0x04c0('0x22')](saveUpdates(_0x9e67f7[_0x04c0('0x63')],null))[_0x04c0('0x22')](respondWithResult(_0x1f9bfd,null))[_0x04c0('0x2b')](handleError(_0x1f9bfd,null));};exports['destroy']=function(_0x59613c,_0x19a413){return db[_0x04c0('0x40')][_0x04c0('0x59')]({'where':{'id':_0x59613c['params']['id']}})[_0x04c0('0x22')](handleEntityNotFound(_0x19a413,null))[_0x04c0('0x22')](removeEntity(_0x19a413,null))['catch'](handleError(_0x19a413,null));};exports[_0x04c0('0x65')]=function(_0x28b298,_0xf52409){return db['SmsAccount'][_0x04c0('0x65')]()[_0x04c0('0x22')](respondWithResult(_0xf52409,null))['catch'](handleError(_0xf52409,null));};exports[_0x04c0('0x66')]=function(_0x5b58bd,_0x301901,_0x45386b){if(_0x5b58bd['body']['id']){delete _0x5b58bd['body']['id'];}return db[_0x04c0('0x40')][_0x04c0('0x59')]({'where':{'id':_0x5b58bd[_0x04c0('0x64')]['id']}})[_0x04c0('0x22')](handleEntityNotFound(_0x301901,null))[_0x04c0('0x22')](function(_0x4363eb){if(_0x4363eb){_0x5b58bd[_0x04c0('0x63')]['SmsAccountId']=_0x4363eb['id'];return db[_0x04c0('0x67')][_0x04c0('0x5a')](_0x5b58bd[_0x04c0('0x63')]);}})[_0x04c0('0x22')](respondWithResult(_0x301901,null))[_0x04c0('0x2b')](handleError(_0x301901,null));};exports[_0x04c0('0x68')]=function(_0x40a726,_0x29677d,_0x212daa){var _0x2822c1={'raw':![],'where':{}};var _0x247af1={};var _0x4baeac={'count':0x0,'rows':[]};return db[_0x04c0('0x40')][_0x04c0('0x69')]({'where':{'id':_0x40a726['params']['id']}})[_0x04c0('0x22')](handleEntityNotFound(_0x29677d,null))[_0x04c0('0x22')](function(_0x16e537){if(_0x16e537){_0x247af1[_0x04c0('0x42')]=_[_0x04c0('0x44')](db[_0x04c0('0x67')][_0x04c0('0x57')]);_0x247af1[_0x04c0('0x43')]=_[_0x04c0('0x44')](_0x40a726[_0x04c0('0x43')]);_0x247af1['filters']=_[_0x04c0('0x46')](_0x247af1[_0x04c0('0x42')],_0x247af1[_0x04c0('0x43')]);_0x2822c1[_0x04c0('0x48')]=_[_0x04c0('0x46')](_0x247af1[_0x04c0('0x42')],qs[_0x04c0('0x47')](_0x40a726[_0x04c0('0x43')]['fields']));_0x2822c1[_0x04c0('0x48')]=_0x2822c1[_0x04c0('0x48')][_0x04c0('0x58')]?_0x2822c1[_0x04c0('0x48')]:_0x247af1[_0x04c0('0x42')];if(!_0x40a726[_0x04c0('0x43')][_0x04c0('0x6a')](_0x04c0('0x49'))){_0x2822c1['limit']=qs['limit'](_0x40a726[_0x04c0('0x43')]['limit']);_0x2822c1[_0x04c0('0x2f')]=qs[_0x04c0('0x2f')](_0x40a726[_0x04c0('0x43')][_0x04c0('0x2f')]);}_0x2822c1[_0x04c0('0x4a')]=qs[_0x04c0('0x4b')](_0x40a726['query'][_0x04c0('0x4b')]);_0x2822c1[_0x04c0('0x4c')]=qs[_0x04c0('0x45')](_[_0x04c0('0x4d')](_0x40a726['query'],_0x247af1['filters']));_0x2822c1[_0x04c0('0x4c')][_0x04c0('0x6b')]=_0x16e537['id'];if(_0x40a726['query'][_0x04c0('0x4e')]){_0x2822c1[_0x04c0('0x4c')]=_[_0x04c0('0x4f')](_0x2822c1[_0x04c0('0x4c')],{'$or':_[_0x04c0('0x3f')](_0x2822c1[_0x04c0('0x48')],function(_0x18a334){var _0x728e88={};_0x728e88[_0x18a334]={'$like':'%'+_0x40a726[_0x04c0('0x43')][_0x04c0('0x4e')]+'%'};return _0x728e88;})});}_0x2822c1=_['merge']({},_0x2822c1,_0x40a726[_0x04c0('0x52')]);return db['Disposition'][_0x04c0('0x32')]({'where':_0x2822c1[_0x04c0('0x4c')]})[_0x04c0('0x22')](function(_0x133634){_0x4baeac[_0x04c0('0x32')]=_0x133634;if(_0x40a726['query']['includeAll']){_0x2822c1[_0x04c0('0x54')]=[{'all':!![]}];}return db[_0x04c0('0x67')][_0x04c0('0x6c')](_0x2822c1);})[_0x04c0('0x22')](function(_0x25db5e){_0x4baeac['rows']=_0x25db5e;return _0x4baeac;});}})['then'](respondWithFilteredResult(_0x29677d,_0x2822c1))[_0x04c0('0x2b')](handleError(_0x29677d,null));};exports[_0x04c0('0x6d')]=function(_0x5af1e4,_0x13144e,_0x44954c){return db[_0x04c0('0x40')][_0x04c0('0x59')]({'where':{'id':_0x5af1e4[_0x04c0('0x64')]['id']}})[_0x04c0('0x22')](handleEntityNotFound(_0x13144e,null))['then'](function(_0x42318b){if(_0x42318b){return _0x42318b[_0x04c0('0x6d')](_0x5af1e4[_0x04c0('0x43')][_0x04c0('0x6e')]);}})[_0x04c0('0x22')](respondWithStatusCode(_0x13144e,null))[_0x04c0('0x2b')](handleError(_0x13144e,null));};exports[_0x04c0('0x6f')]=function(_0x31f81e,_0x592e9d,_0x33cada){if(_0x31f81e['body']['id']){delete _0x31f81e[_0x04c0('0x63')]['id'];}return db[_0x04c0('0x40')][_0x04c0('0x59')]({'where':{'id':_0x31f81e[_0x04c0('0x64')]['id']}})[_0x04c0('0x22')](handleEntityNotFound(_0x592e9d,null))[_0x04c0('0x22')](function(_0x57caff){if(_0x57caff){_0x31f81e['body'][_0x04c0('0x6b')]=_0x57caff['id'];return db[_0x04c0('0x70')][_0x04c0('0x5a')](_0x31f81e[_0x04c0('0x63')]);}})[_0x04c0('0x22')](respondWithResult(_0x592e9d,null))[_0x04c0('0x2b')](handleError(_0x592e9d,null));};exports[_0x04c0('0x71')]=function(_0x552ee8,_0x1d030c,_0x2a9504){var _0x45d2f0={'raw':![],'where':{}};var _0x74be27={};var _0x3c58bc={'count':0x0,'rows':[]};return db['SmsAccount'][_0x04c0('0x69')]({'where':{'id':_0x552ee8['params']['id']}})[_0x04c0('0x22')](handleEntityNotFound(_0x1d030c,null))[_0x04c0('0x22')](function(_0x27bd37){if(_0x27bd37){_0x74be27[_0x04c0('0x42')]=_['keys'](db['CannedAnswer'][_0x04c0('0x57')]);_0x74be27['query']=_[_0x04c0('0x44')](_0x552ee8[_0x04c0('0x43')]);_0x74be27[_0x04c0('0x45')]=_[_0x04c0('0x46')](_0x74be27[_0x04c0('0x42')],_0x74be27[_0x04c0('0x43')]);_0x45d2f0[_0x04c0('0x48')]=_[_0x04c0('0x46')](_0x74be27[_0x04c0('0x42')],qs[_0x04c0('0x47')](_0x552ee8[_0x04c0('0x43')][_0x04c0('0x47')]));_0x45d2f0[_0x04c0('0x48')]=_0x45d2f0['attributes'][_0x04c0('0x58')]?_0x45d2f0[_0x04c0('0x48')]:_0x74be27[_0x04c0('0x42')];if(!_0x552ee8[_0x04c0('0x43')]['hasOwnProperty'](_0x04c0('0x49'))){_0x45d2f0[_0x04c0('0x31')]=qs[_0x04c0('0x31')](_0x552ee8['query'][_0x04c0('0x31')]);_0x45d2f0['offset']=qs[_0x04c0('0x2f')](_0x552ee8[_0x04c0('0x43')][_0x04c0('0x2f')]);}_0x45d2f0[_0x04c0('0x4a')]=qs[_0x04c0('0x4b')](_0x552ee8[_0x04c0('0x43')]['sort']);_0x45d2f0[_0x04c0('0x4c')]=qs[_0x04c0('0x45')](_[_0x04c0('0x4d')](_0x552ee8['query'],_0x74be27[_0x04c0('0x45')]));_0x45d2f0[_0x04c0('0x4c')][_0x04c0('0x6b')]=_0x27bd37['id'];if(_0x552ee8[_0x04c0('0x43')][_0x04c0('0x4e')]){_0x45d2f0[_0x04c0('0x4c')]=_[_0x04c0('0x4f')](_0x45d2f0[_0x04c0('0x4c')],{'$or':_['map'](_0x45d2f0[_0x04c0('0x48')],function(_0x4b6b13){var _0x2c9a52={};_0x2c9a52[_0x4b6b13]={'$like':'%'+_0x552ee8[_0x04c0('0x43')]['filter']+'%'};return _0x2c9a52;})});}_0x45d2f0=_['merge']({},_0x45d2f0,_0x552ee8['options']);return db[_0x04c0('0x70')]['count']({'where':_0x45d2f0[_0x04c0('0x4c')]})[_0x04c0('0x22')](function(_0x15c4a5){_0x3c58bc[_0x04c0('0x32')]=_0x15c4a5;if(_0x552ee8[_0x04c0('0x43')]['includeAll']){_0x45d2f0['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x04c0('0x6c')](_0x45d2f0);})[_0x04c0('0x22')](function(_0x208ed9){_0x3c58bc[_0x04c0('0x55')]=_0x208ed9;return _0x3c58bc;});}})[_0x04c0('0x22')](respondWithFilteredResult(_0x1d030c,_0x45d2f0))['catch'](handleError(_0x1d030c,null));};exports['removeAnswers']=function(_0x23b735,_0x2f6a0d,_0x1163e8){return db[_0x04c0('0x40')]['find']({'where':{'id':_0x23b735[_0x04c0('0x64')]['id']}})[_0x04c0('0x22')](handleEntityNotFound(_0x2f6a0d,null))[_0x04c0('0x22')](function(_0x2212b3){if(_0x2212b3){return _0x2212b3[_0x04c0('0x72')](_0x23b735[_0x04c0('0x43')][_0x04c0('0x6e')]);}})['then'](respondWithStatusCode(_0x2f6a0d,null))[_0x04c0('0x2b')](handleError(_0x2f6a0d,null));};exports['notify']=function(_0xb2ade,_0x48451a,_0x3b1adb){var _0x122e66={'channel':_0x04c0('0x73')};var _0x5b76ce=[];var _0x1e6740=[];var _0x463b1f={};return db[_0x04c0('0x40')][_0x04c0('0x59')]({'where':{'id':_0xb2ade[_0x04c0('0x64')]['id']},'include':[{'model':db[_0x04c0('0x74')],'as':'Applications'}]})[_0x04c0('0x22')](handleEntityNotFound(_0x48451a,null))[_0x04c0('0x22')](function(_0x4fd44b){_0x122e66[_0x04c0('0x75')]=_0x4fd44b;_0x122e66['applications']=_[_0x04c0('0x76')](_0x4fd44b['Applications'],[_0x04c0('0x77')],['asc']);if(_0x122e66[_0x04c0('0x75')][_0x04c0('0x78')]){delete _0x122e66[_0x04c0('0x75')]['Applications'];}return db[_0x04c0('0x79')][_0x04c0('0x65')]();})[_0x04c0('0x22')](function(_0x5bc17c){if(!_0x5bc17c){throw new db[(_0x04c0('0x7a'))][(_0x04c0('0x7b'))](_0x04c0('0x7c'));}_0x5b76ce=_[_0x04c0('0x7d')](_['keys'](_0x5bc17c),[_0x04c0('0x7e'),'updatedAt']);_0x1e6740=_['difference'](_[_0x04c0('0x44')](_0x5bc17c),[_0x04c0('0x7e'),'updatedAt',_0x04c0('0x7f'),_0x04c0('0x80')]);_0x122e66['body']={'mapKey':_0x04c0('0x81')};if(_0x122e66[_0x04c0('0x75')]['type']){switch(_0x122e66[_0x04c0('0x75')][_0x04c0('0x50')]){case _0x04c0('0x82'):_0x122e66['body'][_0x04c0('0x83')]=_0xb2ade[_0x04c0('0x63')][_0x04c0('0x84')];_0x122e66[_0x04c0('0x63')]['body']=_0xb2ade[_0x04c0('0x63')]['Body'];_0x122e66[_0x04c0('0x63')][_0x04c0('0x85')]=_0xb2ade[_0x04c0('0x63')][_0x04c0('0x86')];break;case'skebby':_0x122e66[_0x04c0('0x63')][_0x04c0('0x83')]='+'+_0xb2ade[_0x04c0('0x63')]['sender'];_0x122e66[_0x04c0('0x63')][_0x04c0('0x63')]=_0xb2ade[_0x04c0('0x63')][_0x04c0('0x87')];break;case _0x04c0('0x88'):_0x122e66[_0x04c0('0x63')]['from']=_0xb2ade[_0x04c0('0x63')][_0x04c0('0x83')];_0x122e66[_0x04c0('0x63')][_0x04c0('0x63')]=_0xb2ade[_0x04c0('0x63')][_0x04c0('0x29')];break;case'clicksend':_0x122e66[_0x04c0('0x63')][_0x04c0('0x83')]=_0xb2ade[_0x04c0('0x63')][_0x04c0('0x83')];_0x122e66['body'][_0x04c0('0x63')]=_0xb2ade['body'][_0x04c0('0x63')];_0x122e66['body'][_0x04c0('0x85')]=_0xb2ade[_0x04c0('0x63')]['message_id'];break;case _0x04c0('0x89'):_0x122e66[_0x04c0('0x63')]['from']=_0xb2ade[_0x04c0('0x63')][_0x04c0('0x84')];_0x122e66[_0x04c0('0x63')][_0x04c0('0x63')]=_0xb2ade[_0x04c0('0x63')][_0x04c0('0x8a')];_0x122e66[_0x04c0('0x63')][_0x04c0('0x85')]=_0xb2ade['body']['MessageUUID'];break;case _0x04c0('0x8b'):_0x122e66['body'][_0x04c0('0x83')]='+'+_0xb2ade['body'][_0x04c0('0x8c')][0x0]['from'];_0x122e66[_0x04c0('0x63')][_0x04c0('0x63')]=_0xb2ade['body'][_0x04c0('0x8c')][0x0]['text'];_0x122e66[_0x04c0('0x63')][_0x04c0('0x85')]=_0xb2ade[_0x04c0('0x63')][_0x04c0('0x8c')][0x0][_0x04c0('0x85')];break;case _0x04c0('0x8d'):_0x122e66['body'][_0x04c0('0x83')]=_0xb2ade[_0x04c0('0x63')][_0x04c0('0x8e')];_0x122e66[_0x04c0('0x63')][_0x04c0('0x63')]=_0xb2ade[_0x04c0('0x63')][_0x04c0('0x8f')]['message'];break;case _0x04c0('0x90'):_0x122e66[_0x04c0('0x63')][_0x04c0('0x83')]=_0xb2ade[_0x04c0('0x63')]['fromNumber'];_0x122e66[_0x04c0('0x63')][_0x04c0('0x63')]=_0xb2ade[_0x04c0('0x63')][_0x04c0('0x87')];_0x122e66[_0x04c0('0x63')]['messageId']=_0xb2ade[_0x04c0('0x63')]['replyMessageId'];break;case _0x04c0('0x91'):_0x122e66[_0x04c0('0x63')]['messageId']=_0xb2ade['body'][0x0][_0x04c0('0x29')]['id'];_0x122e66['body'][_0x04c0('0x83')]=_0xb2ade[_0x04c0('0x63')][0x0][_0x04c0('0x29')][_0x04c0('0x83')];_0x122e66[_0x04c0('0x63')]['body']=_0xb2ade[_0x04c0('0x63')][0x0][_0x04c0('0x29')]['text'];break;case'intelepeer':_0x122e66[_0x04c0('0x63')]['from']=_0xb2ade[_0x04c0('0x63')][_0x04c0('0x83')];_0x122e66[_0x04c0('0x63')][_0x04c0('0x63')]=_0xb2ade[_0x04c0('0x63')][_0x04c0('0x29')];_0x122e66[_0x04c0('0x63')][_0x04c0('0x85')]=_0xb2ade[_0x04c0('0x63')][_0x04c0('0x92')];break;}}if(_0x122e66[_0x04c0('0x63')]['id']){delete _0x122e66['body']['id'];}if(_[_0x04c0('0x93')](_0x122e66[_0x04c0('0x63')][_0x04c0('0x83')])){throw new db[(_0x04c0('0x7a'))][(_0x04c0('0x7b'))]('from\x20is\x20mandatory');}if(_[_0x04c0('0x93')](_0x122e66[_0x04c0('0x63')][_0x04c0('0x63')])||_0x122e66['body'][_0x04c0('0x63')]===''){throw new db[(_0x04c0('0x7a'))][(_0x04c0('0x7b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x122e66[_0x04c0('0x63')]['mapKey'])){throw new db[(_0x04c0('0x7a'))][(_0x04c0('0x7b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1e6740);}if(!_[_0x04c0('0x94')](_0x1e6740,_0x122e66[_0x04c0('0x63')][_0x04c0('0x95')])){throw new db['Sequelize']['ValidationError'](_0x04c0('0x96')+_0x1e6740);}_0x463b1f[_0x122e66[_0x04c0('0x63')]['mapKey']]=_0x122e66[_0x04c0('0x63')][_0x04c0('0x83')];return db[_0x04c0('0x97')][_0x04c0('0x59')]({'where':{'id':_0x122e66[_0x04c0('0x75')][_0x04c0('0x80')]},'include':[{'model':db[_0x04c0('0x79')],'as':'Contacts','where':_0x463b1f,'limit':0x1,'order':[[_0x04c0('0x98'),_0x04c0('0x99')]]}]});})[_0x04c0('0x22')](handleEntityNotFound(_0x48451a,null))[_0x04c0('0x22')](function(_0xabba89){if(_0xabba89){_0x122e66['list']=_[_0x04c0('0x9a')](_0xabba89,['Contacts']);if(_0xabba89['Contacts'][_0x04c0('0x58')]){return _0xabba89[_0x04c0('0x9b')][0x0];}var _0x1c7ee1=_[_0x04c0('0x1b')](_0x122e66['body'],{'firstName':_0x122e66[_0x04c0('0x63')][_0x04c0('0x83')],'ListId':_0xabba89['id']});_0x1c7ee1[_0x122e66['body'][_0x04c0('0x95')]]=_0x122e66[_0x04c0('0x63')][_0x04c0('0x83')];return db[_0x04c0('0x79')][_0x04c0('0x5a')](_0x1c7ee1,{'fields':_0x5b76ce,'raw':!![]});}})[_0x04c0('0x22')](handleEntityNotFound(_0x48451a,null))[_0x04c0('0x22')](function(_0x9db720){if(_0x9db720){_0x122e66[_0x04c0('0x9c')]=_0x9db720;var _0x22d145={'ContactId':_0x9db720['id'],'phone':_0x122e66[_0x04c0('0x63')][_0x04c0('0x83')],'SmsAccountId':_0xb2ade[_0x04c0('0x64')]['id']};var _0x5990b8={'ContactId':_0x9db720['id'],'SmsAccountId':_0xb2ade['params']['id'],'closed':![]};return db[_0x04c0('0x9d')][_0x04c0('0x59')]({'where':_0x5990b8})[_0x04c0('0x22')](function(_0x1630b2){if(_0x1630b2){return[_0x1630b2,![]];}return db['SmsInteraction'][_0x04c0('0x5a')](_0x22d145)['then'](function(_0x3fa027){return[_0x3fa027,!![]];});});}})['spread'](function(_0x30286c,_0x56a955){_0x122e66[_0x04c0('0x9e')]=_0x30286c['get']({'plain':!![]});_0x122e66['interaction'][_0x04c0('0x9f')]=![];if(_0x56a955){if(_0x122e66[_0x04c0('0x75')][_0x04c0('0xa0')]){_0x122e66['applications']['push']({'id':0x0,'priority':_0x122e66[_0x04c0('0xa1')][_0x04c0('0x58')]+0x1,'app':_0x04c0('0xa2'),'appdata':_0x04c0('0xa3'),'interval':'*,*,*,*'});}_0x122e66[_0x04c0('0x9e')][_0x04c0('0x9f')]=!![];}return db['SmsMessage'][_0x04c0('0x5a')]({'phone':_0x122e66[_0x04c0('0x63')][_0x04c0('0x83')],'messageId':_0x122e66['body'][_0x04c0('0x85')],'body':_0x122e66[_0x04c0('0x63')][_0x04c0('0x63')],'SmsAccountId':_0xb2ade['params']['id'],'SmsInteractionId':_0x30286c['id'],'direction':'in','ContactId':_0x30286c[_0x04c0('0xa4')],'AttachmentId':_0x122e66[_0x04c0('0x63')][_0x04c0('0xa5')]});})['then'](function(_0x5ad813){_0x122e66[_0x04c0('0x29')]=_0x5ad813;if(_0x122e66[_0x04c0('0x9e')]['UserId']){return db[_0x04c0('0xa6')][_0x04c0('0x59')]({'attributes':['id',_0x04c0('0x3b')],'where':{'id':_0x122e66[_0x04c0('0x9e')][_0x04c0('0xa7')]}})['then'](function(_0x424f2c){if(_0x424f2c){_0x122e66[_0x04c0('0xa1')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x424f2c['name']+','+(_0x122e66[_0x04c0('0x75')][_0x04c0('0xa8')]||0xa),'interval':_0x04c0('0xa9')});}return respondWithRpcPromise(_0x04c0('0xaa'),_0x04c0('0xab'),_0x122e66);});}return respondWithRpcPromise(_0x04c0('0xaa'),'startRouting',_0x122e66);})[_0x04c0('0x22')](function(_0x5e216d){if(_0x5e216d){var _0x2a9aac=0xc8;var _0x316d02=_0x04c0('0xac');logger[_0x04c0('0x23')](_0x04c0('0xad'),_0x316d02,_0x2a9aac,_0x04c0('0xae'));logger[_0x04c0('0x26')](_0x04c0('0xaf'),_0x316d02,_0x2a9aac,_0x04c0('0xae'),JSON[_0x04c0('0xb0')](_0x5e216d));if(_0x122e66[_0x04c0('0x75')]['type']===_0x04c0('0x82')){return _0x48451a['status'](_0x2a9aac)['set'](_0x04c0('0xb1'),_0x04c0('0xb2'))[_0x04c0('0x3c')](_0x04c0('0xb3'));}else{return _0x48451a[_0x04c0('0x2d')](_0x2a9aac)[_0x04c0('0x2e')](_0x5e216d);}}})[_0x04c0('0x2b')](handleError(_0x48451a,null));};exports[_0x04c0('0xb4')]=function(_0x5e9705,_0x4f1351,_0x3a0631){return db[_0x04c0('0x40')][_0x04c0('0x69')]({'where':{'id':_0x5e9705[_0x04c0('0x64')]['id']}})[_0x04c0('0x22')](handleEntityNotFound(_0x4f1351,null))['then'](function(_0x33a8be){if(_0x33a8be){return db[_0x04c0('0xb5')]['transaction'](function(_0x112e73){return db[_0x04c0('0x74')][_0x04c0('0x38')]({'where':{'SmsAccountId':_0x5e9705[_0x04c0('0x64')]['id']},'transaction':_0x112e73})[_0x04c0('0x22')](function(_0x5290d3){var _0x1f4cdb=_[_0x04c0('0x3f')](_0x5e9705[_0x04c0('0x63')],function(_0x3ff51e){_0x3ff51e[_0x04c0('0x6b')]=_0x5e9705[_0x04c0('0x64')]['id'];return _0x3ff51e;});return db[_0x04c0('0x74')][_0x04c0('0xb6')](_0x1f4cdb,{'transaction':_0x112e73});});})[_0x04c0('0x22')](function(){return db[_0x04c0('0x74')][_0x04c0('0xb7')]({'where':{'SmsAccountId':_0x5e9705['params']['id']},'order':'priority'});});}})[_0x04c0('0x22')](respondWithResult(_0x4f1351,null))['catch'](handleError(_0x4f1351,null));};exports['getApplications']=function(_0xbe5d80,_0x527f17,_0x1e4976){var _0x2cf993={};var _0x3ce1da={};var _0x2cbe69;var _0x469bc6;return db[_0x04c0('0x40')][_0x04c0('0x69')]({'where':{'id':_0xbe5d80['params']['id']}})['then'](handleEntityNotFound(_0x527f17,null))['then'](function(_0x499da3){if(_0x499da3){_0x2cbe69=_0x499da3;_0x3ce1da['model']=_[_0x04c0('0x44')](db[_0x04c0('0x74')][_0x04c0('0x57')]);_0x3ce1da[_0x04c0('0x43')]=_[_0x04c0('0x44')](_0xbe5d80['query']);_0x3ce1da[_0x04c0('0x45')]=_[_0x04c0('0x46')](_0x3ce1da['model'],_0x3ce1da['query']);_0x2cf993[_0x04c0('0x48')]=_['intersection'](_0x3ce1da[_0x04c0('0x42')],qs[_0x04c0('0x47')](_0xbe5d80[_0x04c0('0x43')]['fields']));_0x2cf993['attributes']=_0x2cf993['attributes'][_0x04c0('0x58')]?_0x2cf993['attributes']:_0x3ce1da['model'];_0x2cf993['order']=qs[_0x04c0('0x4b')](_0xbe5d80[_0x04c0('0x43')][_0x04c0('0x4b')]);_0x2cf993[_0x04c0('0x4c')]=qs['filters'](_[_0x04c0('0x4d')](_0xbe5d80['query'],_0x3ce1da[_0x04c0('0x45')]));if(_0xbe5d80['query'][_0x04c0('0x4e')]){_0x2cf993[_0x04c0('0x4c')]=_['merge'](_0x2cf993[_0x04c0('0x4c')],{'$or':_[_0x04c0('0x3f')](_0x2cf993[_0x04c0('0x48')],function(_0x3e73b2){var _0x277513={};_0x277513[_0x3e73b2]={'$like':'%'+_0xbe5d80['query'][_0x04c0('0x4e')]+'%'};return _0x277513;})});}_0x2cf993=_[_0x04c0('0x4f')]({},_0x2cf993,_0xbe5d80[_0x04c0('0x52')]);return _0x2cbe69[_0x04c0('0xb8')](_0x2cf993);}})[_0x04c0('0x22')](function(_0x47316a){if(_0x47316a){_0x469bc6=_0x47316a[_0x04c0('0x58')];if(!_0xbe5d80[_0x04c0('0x43')][_0x04c0('0x6a')](_0x04c0('0x49'))){_0x2cf993['limit']=qs[_0x04c0('0x31')](_0xbe5d80[_0x04c0('0x43')][_0x04c0('0x31')]);_0x2cf993['offset']=qs['offset'](_0xbe5d80['query'][_0x04c0('0x2f')]);}return _0x2cbe69[_0x04c0('0xb8')](_0x2cf993);}})[_0x04c0('0x22')](function(_0x1ae07d){if(_0x1ae07d){return _0x1ae07d?{'count':_0x469bc6,'rows':_0x1ae07d}:null;}})[_0x04c0('0x22')](respondWithResult(_0x527f17,null))['catch'](handleError(_0x527f17,null));};exports[_0x04c0('0xb9')]=function(_0x97cdbd,_0x178fdd,_0x585a3f){var _0x1eb604={'raw':![],'where':{}};var _0x4f2b41={};var _0x4eb224={'count':0x0,'rows':[]};return db[_0x04c0('0x40')]['findOne']({'where':{'id':_0x97cdbd[_0x04c0('0x64')]['id']}})['then'](handleEntityNotFound(_0x178fdd,null))['then'](function(_0x430cac){if(_0x430cac){_0x4f2b41['model']=_['keys'](db[_0x04c0('0x9d')]['rawAttributes']);_0x4f2b41[_0x04c0('0x43')]=_['keys'](_0x97cdbd[_0x04c0('0x43')]);_0x4f2b41['filters']=_[_0x04c0('0x46')](_0x4f2b41[_0x04c0('0x42')],_0x4f2b41[_0x04c0('0x43')]);_0x1eb604[_0x04c0('0x48')]=_[_0x04c0('0x46')](_0x4f2b41['model'],qs[_0x04c0('0x47')](_0x97cdbd[_0x04c0('0x43')][_0x04c0('0x47')]));_0x1eb604[_0x04c0('0x48')]=_0x1eb604[_0x04c0('0x48')][_0x04c0('0x58')]?_0x1eb604[_0x04c0('0x48')]:_0x4f2b41['model'];if(!_0x97cdbd[_0x04c0('0x43')][_0x04c0('0x6a')](_0x04c0('0x49'))){_0x1eb604['limit']=qs[_0x04c0('0x31')](_0x97cdbd[_0x04c0('0x43')]['limit']);_0x1eb604[_0x04c0('0x2f')]=qs[_0x04c0('0x2f')](_0x97cdbd[_0x04c0('0x43')]['offset']);}_0x1eb604[_0x04c0('0x4a')]=qs[_0x04c0('0x4b')](_0x97cdbd[_0x04c0('0x43')][_0x04c0('0x4b')]);_0x1eb604[_0x04c0('0x4c')]=qs[_0x04c0('0x45')](_['pick'](_0x97cdbd[_0x04c0('0x43')],_0x4f2b41[_0x04c0('0x45')]));_0x1eb604['where']['SmsAccountId']=_0x430cac['id'];if(_0x97cdbd[_0x04c0('0x43')][_0x04c0('0x4e')]){_0x1eb604[_0x04c0('0x4c')]=_[_0x04c0('0x4f')](_0x1eb604['where'],{'$or':_[_0x04c0('0x3f')](_0x1eb604[_0x04c0('0x48')],function(_0xf0030){var _0x376b99={};_0x376b99[_0xf0030]={'$like':'%'+_0x97cdbd['query'][_0x04c0('0x4e')]+'%'};return _0x376b99;})});}_0x1eb604=_[_0x04c0('0x4f')]({},_0x1eb604,_0x97cdbd[_0x04c0('0x52')]);return db[_0x04c0('0x9d')]['count']({'where':_0x1eb604[_0x04c0('0x4c')]})[_0x04c0('0x22')](function(_0x11218b){_0x4eb224[_0x04c0('0x32')]=_0x11218b;if(_0x97cdbd[_0x04c0('0x43')]['includeAll']){_0x1eb604[_0x04c0('0x54')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x04c0('0xa6')],'as':_0x04c0('0xba'),'attributes':[_0x04c0('0x3b'),_0x04c0('0xbb'),'internal'],'required':![]},{'model':db[_0x04c0('0xbc')],'as':'Tags','attributes':['id',_0x04c0('0x3b'),_0x04c0('0xbd')],'where':_0x97cdbd[_0x04c0('0x43')]['tag']?{'id':_0x97cdbd[_0x04c0('0x43')][_0x04c0('0xbe')]}:undefined,'required':_0x97cdbd[_0x04c0('0x43')][_0x04c0('0xbe')]?!![]:![]}];}return db[_0x04c0('0x9d')][_0x04c0('0x6c')](_0x1eb604);})[_0x04c0('0x22')](function(_0x2c5cb9){_0x4eb224[_0x04c0('0x55')]=_0x2c5cb9;return _0x4eb224;});}})[_0x04c0('0x22')](respondWithFilteredResult(_0x178fdd,_0x1eb604))[_0x04c0('0x2b')](handleError(_0x178fdd,null));};exports[_0x04c0('0x3c')]=function(_0x53497a,_0x3e9dcf,_0x591fde){var _0x2439f9,_0x26c197,_0x45e437;if(_[_0x04c0('0x93')](_0x53497a[_0x04c0('0x63')][_0x04c0('0x63')])||_0x53497a[_0x04c0('0x63')][_0x04c0('0x63')]===''){throw new db[(_0x04c0('0x7a'))][(_0x04c0('0x7b'))](_0x04c0('0xbf'));}if(_[_0x04c0('0x93')](_0x53497a[_0x04c0('0x63')]['to'])){throw new db[(_0x04c0('0x7a'))]['ValidationError'](_0x04c0('0xc0'));}_0x2439f9=_0x53497a['body']['to'];return db[_0x04c0('0x40')][_0x04c0('0x59')]({'where':{'id':_0x53497a[_0x04c0('0x64')]['id']},'include':[{'model':db['CmList'],'as':_0x04c0('0xc1'),'include':[{'model':db['CmContact'],'as':_0x04c0('0x9b'),'where':{'mobile':_0x2439f9},'limit':0x1,'order':[['updatedAt',_0x04c0('0x99')]]}]}]})['then'](handleEntityNotFound(_0x3e9dcf,null))[_0x04c0('0x22')](function(_0x15648a){if(_0x15648a&&_0x15648a[_0x04c0('0xc1')]){_0x26c197=_0x15648a[_0x04c0('0x5c')]({'plain':!![]});if(_0x26c197[_0x04c0('0xc1')]&&_0x26c197[_0x04c0('0xc1')]['Contacts'][_0x04c0('0x58')]){return _0x26c197[_0x04c0('0xc1')][_0x04c0('0x9b')][0x0];}return db[_0x04c0('0x79')][_0x04c0('0x5a')](_[_0x04c0('0x1b')](_0x53497a[_0x04c0('0x63')],{'firstName':_0x2439f9,'mobile':_0x2439f9,'phone':_0x2439f9,'ListId':_0x26c197[_0x04c0('0x80')]}));}})[_0x04c0('0x22')](handleEntityNotFound(_0x3e9dcf,null))[_0x04c0('0x22')](function(_0x52e7de){if(_0x52e7de){_0x45e437=_0x52e7de;return db[_0x04c0('0x9d')][_0x04c0('0x59')]({'where':{'ContactId':_0x45e437['id'],'closed':![],'SmsAccountId':_0x26c197['id']}})[_0x04c0('0x22')](function(_0x43925e){if(_0x43925e){return[_0x43925e,![]];}return db[_0x04c0('0x9d')][_0x04c0('0x5a')]({'UserId':_0x53497a[_0x04c0('0x5b')]['id'],'ContactId':_0x45e437['id'],'SmsAccountId':_0x26c197['id'],'phone':_0x2439f9,'firstMsgDirection':_0x04c0('0xc2'),'Messages':[_[_0x04c0('0x4f')](_0x53497a[_0x04c0('0x63')],{'read':![],'body':_0x53497a[_0x04c0('0x63')][_0x04c0('0x63')],'phone':_0x2439f9,'SmsAccountId':_0x26c197['id'],'UserId':_0x53497a[_0x04c0('0x5b')]['id'],'ContactId':_0x45e437['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0x04c0('0x22')](function(_0x2b6418){return[_0x2b6418,!![]];});});}})[_0x04c0('0xc3')](function(_0x206ed6,_0x52f4eb){if(_0x52f4eb){return _0x206ed6;}return db[_0x04c0('0xc4')]['create'](_[_0x04c0('0x4f')](_0x53497a[_0x04c0('0x63')],{'read':![],'body':_0x53497a['body'][_0x04c0('0x63')],'phone':_0x2439f9,'SmsAccountId':_0x26c197['id'],'SmsInteractionId':_0x206ed6['id'],'UserId':_0x53497a[_0x04c0('0x5b')]['id'],'ContactId':_0x45e437['id']}))[_0x04c0('0x22')](function(_0x5ec4e8){_0x206ed6[_0x04c0('0xc5')]['Messages']=[];_0x206ed6[_0x04c0('0xc5')][_0x04c0('0xc6')]['push'](_0x5ec4e8[_0x04c0('0xc5')]);return _0x206ed6;});})['then'](respondWithResult(_0x3e9dcf,null))[_0x04c0('0x2b')](handleError(_0x3e9dcf,null));};exports['status']=function(_0x167e5a,_0x23ebac,_0x1cb7f7){if(_0x167e5a[_0x04c0('0x63')]['id']){delete _0x167e5a['body']['id'];}var _0x1d2d8d,_0x50e3b7,_0x525cab;return db[_0x04c0('0x40')]['find']({'where':{'id':_0x167e5a[_0x04c0('0x64')]['id']}})[_0x04c0('0x22')](handleEntityNotFound(_0x23ebac,null))['then'](function(_0xc0ae10){if(_0xc0ae10){_0x525cab=_0xc0ae10;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x04c0('0x2d'),_0x04c0('0xc7'),_0xc0ae10[_0x04c0('0x50')],util['inspect'](_0x167e5a[_0x04c0('0x63')],{'showHidden':![],'depth':null}));switch(_0xc0ae10['type']){case _0x04c0('0xc8'):if(_0x167e5a[_0x04c0('0x63')][_0x04c0('0xc9')]&&_0x167e5a[_0x04c0('0x63')][_0x04c0('0x2d')]){_0x50e3b7=_0x167e5a[_0x04c0('0x63')][_0x04c0('0x2d')];return db['SmsMessage']['find']({'where':{'messageId':_0x167e5a[_0x04c0('0x63')][_0x04c0('0xc9')]}});}break;case'connectel':if(_0x167e5a[_0x04c0('0x63')][_0x04c0('0xca')]&&_0x167e5a[_0x04c0('0x63')][_0x04c0('0xcb')]){_0x50e3b7=_0x167e5a[_0x04c0('0x63')][_0x04c0('0xcb')];return db[_0x04c0('0xc4')][_0x04c0('0x59')]({'where':{'messageId':_0x167e5a[_0x04c0('0x63')][_0x04c0('0xca')]}});}break;case _0x04c0('0xcc'):if(_0x167e5a['body'][_0x04c0('0xcd')]&&_0x167e5a[_0x04c0('0x63')][_0x04c0('0xce')]){_0x50e3b7=_0x167e5a[_0x04c0('0x63')][_0x04c0('0xce')];return db[_0x04c0('0xc4')][_0x04c0('0x59')]({'where':{'messageId':_0x167e5a[_0x04c0('0x63')][_0x04c0('0xcd')]}});}break;case _0x04c0('0x8b'):var _0x3eb00e=_0x167e5a[_0x04c0('0x63')][_0x04c0('0x8c')][0x0];if(_0x3eb00e['messageId']&&_0x3eb00e['status'][_0x04c0('0xcf')]===_0x04c0('0xd0')){_0x50e3b7=_0x3eb00e[_0x04c0('0x2d')][_0x04c0('0xcf')];return db[_0x04c0('0xc4')][_0x04c0('0x59')]({'where':{'messageId':_0x3eb00e[_0x04c0('0x85')]}});}break;case _0x04c0('0x90'):if(_0x167e5a[_0x04c0('0x63')][_0x04c0('0x85')]&&_0x167e5a[_0x04c0('0x63')][_0x04c0('0x2d')]){_0x50e3b7=_0x167e5a[_0x04c0('0x63')][_0x04c0('0x2d')];return db[_0x04c0('0xc4')][_0x04c0('0x59')]({'where':{'messageId':_0x167e5a[_0x04c0('0x63')][_0x04c0('0x85')]}});}break;case _0x04c0('0x91'):if(_0x167e5a['body'][0x0]['message']['id']){_0x50e3b7=_0x167e5a[_0x04c0('0x63')][0x0]['type'];return db['SmsMessage'][_0x04c0('0x59')]({'where':{'messageId':_0x167e5a[_0x04c0('0x63')][0x0]['message']['id']}});}break;case _0x04c0('0xd1'):if(_0x167e5a[_0x04c0('0x63')][_0x04c0('0xd2')]&&_0x167e5a[_0x04c0('0x63')][_0x04c0('0x2d')]){_0x50e3b7=_0x167e5a[_0x04c0('0x63')][_0x04c0('0x2d')];return db['SmsMessage'][_0x04c0('0x59')]({'where':{'messageId':_0x167e5a[_0x04c0('0x63')][_0x04c0('0xd2')]}});}break;}}})[_0x04c0('0x22')](handleEntityNotFound(_0x23ebac,null))['then'](function(_0x22fe6b){if(_0x22fe6b){_0x1d2d8d=_0x22fe6b;switch(_0x525cab[_0x04c0('0x50')]){case _0x04c0('0xc8'):if(_0x50e3b7===_0x04c0('0xd0')){return _0x1d2d8d[_0x04c0('0x37')]({'read':!![]});}else{logger['error'](_0x04c0('0xad'),_0x04c0('0x2d'),'skebby',util[_0x04c0('0xd3')](_0x167e5a['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x50e3b7==='1'){return _0x1d2d8d[_0x04c0('0x37')]({'read':!![]});}else{logger[_0x04c0('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x04c0('0x2d'),_0x04c0('0xc8'),util[_0x04c0('0xd3')](_0x167e5a['body'],{'showHidden':![],'depth':null}));}break;case _0x04c0('0xcc'):if(!_0x167e5a['body'][_0x04c0('0xd4')]&&_0x50e3b7>=0xc8&&_0x50e3b7<=0xce){return _0x1d2d8d[_0x04c0('0x37')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x04c0('0x2d'),_0x04c0('0xcc'),util[_0x04c0('0xd3')](_0x167e5a[_0x04c0('0x63')],{'showHidden':![],'depth':null}));}break;case _0x04c0('0x8b'):var _0x1a98bf=_0x167e5a[_0x04c0('0x63')]['results'][0x0];if(_0x1a98bf['status'][_0x04c0('0xcf')]==='DELIVERED'){return _0x1d2d8d[_0x04c0('0x37')]({'read':!![]});}else{logger[_0x04c0('0x27')](_0x04c0('0xad'),_0x04c0('0x2d'),_0x04c0('0x8b'),util[_0x04c0('0xd3')](_0x167e5a[_0x04c0('0x63')],{'showHidden':![],'depth':null}));}break;case _0x04c0('0x90'):if(_0x50e3b7==_0x04c0('0xd5')||_0x50e3b7=='RECEIVED_BY_RECIPIENT'){return _0x1d2d8d[_0x04c0('0x37')]({'read':!![]});}else{logger[_0x04c0('0x27')](_0x04c0('0xad'),_0x04c0('0x2d'),_0x04c0('0x90'),util[_0x04c0('0xd3')](_0x167e5a[_0x04c0('0x63')],{'showHidden':![],'depth':null}));}break;case _0x04c0('0x91'):if(_0x50e3b7==_0x04c0('0xd6')){return _0x1d2d8d[_0x04c0('0x37')]({'read':!![]});}else{logger[_0x04c0('0x27')](_0x04c0('0xad'),_0x04c0('0x2d'),_0x04c0('0x91'),util[_0x04c0('0xd3')](_0x167e5a[_0x04c0('0x63')],{'showHidden':![],'depth':null}));}break;case _0x04c0('0xd1'):if(_0x50e3b7===_0x04c0('0xd7')||_0x50e3b7==='ACCEPTD'){return _0x1d2d8d['update']({'read':!![]});}else{logger[_0x04c0('0x27')](_0x04c0('0xad'),_0x04c0('0x2d'),_0x04c0('0xd1'),util['inspect'](_0x167e5a[_0x04c0('0x63')],{'showHidden':![],'depth':null}));}break;}return _0x1d2d8d;}})[_0x04c0('0x22')](respondWithResult(_0x23ebac,null))['catch'](handleError(_0x23ebac,null));};exports['statusGet']=function(_0x59bfb6,_0x328c5f,_0x2f7c67){var _0x5a9607,_0x387123,_0x43f3d8;return db[_0x04c0('0x40')][_0x04c0('0x59')]({'where':{'id':_0x59bfb6[_0x04c0('0x64')]['id']}})[_0x04c0('0x22')](handleEntityNotFound(_0x328c5f,null))[_0x04c0('0x22')](function(_0x461895){if(_0x461895){_0x43f3d8=_0x461895;logger['debug'](_0x04c0('0xad'),'status',_0x04c0('0xc7'),_0x461895[_0x04c0('0x50')],util[_0x04c0('0xd3')](_0x59bfb6[_0x04c0('0x43')],{'showHidden':![],'depth':null}));switch(_0x461895[_0x04c0('0x50')]){case _0x04c0('0x8d'):if(_0x59bfb6['query'][_0x04c0('0xd8')]&&_0x59bfb6[_0x04c0('0x43')][_0x04c0('0xd9')]){_0x387123=_0x59bfb6[_0x04c0('0x43')][_0x04c0('0xd9')];return db[_0x04c0('0xc4')][_0x04c0('0x59')]({'where':{'messageId':_0x59bfb6[_0x04c0('0x43')][_0x04c0('0xd8')]}});}break;}}})[_0x04c0('0x22')](handleEntityNotFound(_0x328c5f,null))[_0x04c0('0x22')](function(_0xa6ef26){if(_0xa6ef26){_0x5a9607=_0xa6ef26;switch(_0x43f3d8[_0x04c0('0x50')]){case _0x04c0('0x8d'):if(_0x387123==='2'||_0x387123==='6'){return _0x5a9607[_0x04c0('0x37')]({'read':!![]});}else{logger[_0x04c0('0x27')](_0x04c0('0xad'),'status',_0x04c0('0x8d'),util[_0x04c0('0xd3')](_0x59bfb6[_0x04c0('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x5a9607;}})[_0x04c0('0x22')](respondWithResult(_0x328c5f,null))[_0x04c0('0x2b')](handleError(_0x328c5f,null));};exports[_0x04c0('0xda')]=function(_0x1d47e7,_0x2917a9,_0x517b11){return db[_0x04c0('0x40')]['find']({'where':{'id':_0x1d47e7['params']['id']}})[_0x04c0('0x22')](handleEntityNotFound(_0x2917a9,null))[_0x04c0('0x22')](function(_0x246c44){if(_0x246c44){return _0x246c44[_0x04c0('0xda')](_0x1d47e7[_0x04c0('0x63')][_0x04c0('0x6e')],_['omit'](_0x1d47e7['body'],[_0x04c0('0x6e'),'id'])||{})[_0x04c0('0xc3')](function(_0x112b83){for(var _0x5a632a=0x0;_0x5a632a<_0x1d47e7[_0x04c0('0x63')][_0x04c0('0x6e')][_0x04c0('0x58')];_0x5a632a+=0x1){socket[_0x04c0('0xdb')](_0x04c0('0xdc'),{'UserId':Number(_0x1d47e7['body']['ids'][_0x5a632a]),'SmsAccountId':Number(_0x1d47e7[_0x04c0('0x64')]['id'])});}return _0x112b83;});}})[_0x04c0('0x22')](respondWithResult(_0x2917a9,null))['catch'](handleError(_0x2917a9,null));};exports[_0x04c0('0xdd')]=function(_0xf71708,_0x35c647,_0x217294){return db[_0x04c0('0x40')][_0x04c0('0x59')]({'where':{'id':_0xf71708[_0x04c0('0x64')]['id']}})[_0x04c0('0x22')](handleEntityNotFound(_0x35c647,null))[_0x04c0('0x22')](function(_0x3ecde8){if(_0x3ecde8){return _0x3ecde8['removeAgents'](_0xf71708[_0x04c0('0x43')][_0x04c0('0x6e')])[_0x04c0('0x22')](function(){if(_[_0x04c0('0xde')](_0xf71708[_0x04c0('0x43')][_0x04c0('0x6e')])){for(var _0xe88bdb=0x0;_0xe88bdb<_0xf71708['query']['ids'][_0x04c0('0x58')];_0xe88bdb+=0x1){socket['emit'](_0x04c0('0xdf'),{'UserId':Number(_0xf71708[_0x04c0('0x43')][_0x04c0('0x6e')][_0xe88bdb]),'SmsAccountId':Number(_0xf71708['params']['id'])});}}else{socket[_0x04c0('0xdb')](_0x04c0('0xdf'),{'UserId':Number(_0xf71708['query'][_0x04c0('0x6e')]),'SmsAccountId':Number(_0xf71708[_0x04c0('0x64')]['id'])});}});}})['then'](respondWithStatusCode(_0x35c647,null))[_0x04c0('0x2b')](handleError(_0x35c647,null));};exports['getAgents']=function(_0x36facb,_0x34bec6,_0x52c4ff){var _0x3e7b60={};var _0x4331a5={};var _0x3a8baf;var _0x20a152;return db[_0x04c0('0x40')][_0x04c0('0x69')]({'where':{'id':_0x36facb[_0x04c0('0x64')]['id']}})[_0x04c0('0x22')](handleEntityNotFound(_0x34bec6,null))[_0x04c0('0x22')](function(_0x415361){if(_0x415361){_0x3a8baf=_0x415361;_0x4331a5[_0x04c0('0x42')]=_[_0x04c0('0x44')](db[_0x04c0('0xa6')][_0x04c0('0x57')]);_0x4331a5[_0x04c0('0x43')]=_[_0x04c0('0x44')](_0x36facb[_0x04c0('0x43')]);_0x4331a5['filters']=_['intersection'](_0x4331a5[_0x04c0('0x42')],_0x4331a5[_0x04c0('0x43')]);_0x3e7b60['attributes']=_['intersection'](_0x4331a5[_0x04c0('0x42')],qs[_0x04c0('0x47')](_0x36facb[_0x04c0('0x43')][_0x04c0('0x47')]));_0x3e7b60[_0x04c0('0x48')]=_0x3e7b60[_0x04c0('0x48')]['length']?_0x3e7b60[_0x04c0('0x48')]:_0x4331a5[_0x04c0('0x42')];_0x3e7b60[_0x04c0('0x4a')]=qs[_0x04c0('0x4b')](_0x36facb[_0x04c0('0x43')][_0x04c0('0x4b')]);_0x3e7b60[_0x04c0('0x4c')]=qs['filters'](_[_0x04c0('0x4d')](_0x36facb[_0x04c0('0x43')],_0x4331a5[_0x04c0('0x45')]));if(_0x36facb['query'][_0x04c0('0x4e')]){_0x3e7b60[_0x04c0('0x4c')]=_['merge'](_0x3e7b60['where'],{'$or':_[_0x04c0('0x3f')](_0x3e7b60[_0x04c0('0x48')],function(_0x4bb228){var _0xdd30c5={};_0xdd30c5[_0x4bb228]={'$like':'%'+_0x36facb[_0x04c0('0x43')][_0x04c0('0x4e')]+'%'};return _0xdd30c5;})});}_0x3e7b60=_[_0x04c0('0x4f')]({},_0x3e7b60,_0x36facb[_0x04c0('0x52')]);return _0x3a8baf['getAgents'](_0x3e7b60);}})['then'](function(_0x33fbec){if(_0x33fbec){_0x20a152=_0x33fbec[_0x04c0('0x58')];if(!_0x36facb[_0x04c0('0x43')][_0x04c0('0x6a')](_0x04c0('0x49'))){_0x3e7b60[_0x04c0('0x31')]=qs[_0x04c0('0x31')](_0x36facb[_0x04c0('0x43')][_0x04c0('0x31')]);_0x3e7b60['offset']=qs[_0x04c0('0x2f')](_0x36facb[_0x04c0('0x43')][_0x04c0('0x2f')]);}return _0x3a8baf[_0x04c0('0xe0')](_0x3e7b60);}})[_0x04c0('0x22')](function(_0x4fdae7){if(_0x4fdae7){return _0x4fdae7?{'count':_0x20a152,'rows':_0x4fdae7}:null;}})['then'](respondWithResult(_0x34bec6,null))[_0x04c0('0x2b')](handleError(_0x34bec6,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 3e08955..116f299 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 _0xf984=['../../mysqldb','SmsAccount','save','update','emit','hook','exports'];(function(_0x64ef48,_0x3eb8f8){var _0x3c20ef=function(_0x3350a1){while(--_0x3350a1){_0x64ef48['push'](_0x64ef48['shift']());}};_0x3c20ef(++_0x3eb8f8);}(_0xf984,0x70));var _0x4f98=function(_0x54880a,_0x4ce03c){_0x54880a=_0x54880a-0x0;var _0x2eae69=_0xf984[_0x54880a];return _0x2eae69;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x4f98('0x0'))['db'][_0x4f98('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f98('0x2'),'afterUpdate':_0x4f98('0x3'),'afterDestroy':'remove'};function emitEvent(_0x16eef1){return function(_0x23e94e,_0xe18e8c,_0x14c426){SmsAccountEvents[_0x4f98('0x4')](_0x16eef1+':'+_0x23e94e['id'],_0x23e94e);SmsAccountEvents[_0x4f98('0x4')](_0x16eef1,_0x23e94e);_0x14c426(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x4f98('0x5')](e,emitEvent(event));}}module[_0x4f98('0x6')]=SmsAccountEvents; \ No newline at end of file +var _0x6b4e=['hasOwnProperty','hook','exports','events','SmsAccount','setMaxListeners','save','update','remove','emit'];(function(_0x44714c,_0x2ac454){var _0x57d4d5=function(_0x5aca44){while(--_0x5aca44){_0x44714c['push'](_0x44714c['shift']());}};_0x57d4d5(++_0x2ac454);}(_0x6b4e,0x1d9));var _0xe6b4=function(_0x46bcc5,_0x5efcc8){_0x46bcc5=_0x46bcc5-0x0;var _0x4d5e9a=_0x6b4e[_0x46bcc5];return _0x4d5e9a;};'use strict';var EventEmitter=require(_0xe6b4('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xe6b4('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe6b4('0x2')](0x0);var events={'afterCreate':_0xe6b4('0x3'),'afterUpdate':_0xe6b4('0x4'),'afterDestroy':_0xe6b4('0x5')};function emitEvent(_0x1c4a1d){return function(_0x43e795,_0x16444c,_0x269090){SmsAccountEvents[_0xe6b4('0x6')](_0x1c4a1d+':'+_0x43e795['id'],_0x43e795);SmsAccountEvents['emit'](_0x1c4a1d,_0x43e795);_0x269090(null);};}for(var e in events){if(events[_0xe6b4('0x7')](e)){var event=events[e];SmsAccount[_0xe6b4('0x8')](e,emitEvent(event));}}module[_0xe6b4('0x9')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 155d477..0575121 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 _0x58d8=['moment','bluebird','request-promise','path','../../config/environment','exports','define','SmsAccount','sms_accounts','util','../../config/logger','api'];(function(_0x21cd8e,_0x142f34){var _0x383ad7=function(_0x292fe7){while(--_0x292fe7){_0x21cd8e['push'](_0x21cd8e['shift']());}};_0x383ad7(++_0x142f34);}(_0x58d8,0x1d1));var _0x858d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x58d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x858d('0x0'));var logger=require(_0x858d('0x1'))(_0x858d('0x2'));var moment=require(_0x858d('0x3'));var BPromise=require(_0x858d('0x4'));var rp=require(_0x858d('0x5'));var fs=require('fs');var path=require(_0x858d('0x6'));var rimraf=require('rimraf');var config=require(_0x858d('0x7'));var attributes=require('./smsAccount.attributes');module[_0x858d('0x8')]=function(_0x8c3c65,_0x2331a2){return _0x8c3c65[_0x858d('0x9')](_0x858d('0xa'),attributes,{'tableName':_0x858d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2eda=['../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x2eda,0x7e));var _0xa2ed=function(_0x165caa,_0x4d5834){_0x165caa=_0x165caa-0x0;var _0xad2a72=_0x2eda[_0x165caa];return _0xad2a72;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa2ed('0x0'));var moment=require(_0xa2ed('0x1'));var BPromise=require(_0xa2ed('0x2'));var rp=require(_0xa2ed('0x3'));var fs=require('fs');var path=require(_0xa2ed('0x4'));var rimraf=require(_0xa2ed('0x5'));var config=require(_0xa2ed('0x6'));var attributes=require(_0xa2ed('0x7'));module[_0xa2ed('0x8')]=function(_0x5d4084,_0x53eefe){return _0x5d4084[_0xa2ed('0x9')](_0xa2ed('0xa'),attributes,{'tableName':_0xa2ed('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 8be98b7..74ec7c5 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 _0x6d4e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSmsAccount','find','options','raw','where','include','map','model','attributes','stringify','lodash','util','moment'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x6d4e,0x66));var _0xe6d4=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0x6d4e[_0x2ef44b];return _0x2405b9;};'use strict';var _=require(_0xe6d4('0x0'));var util=require(_0xe6d4('0x1'));var moment=require(_0xe6d4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe6d4('0x3'));var db=require(_0xe6d4('0x4'))['db'];var utils=require(_0xe6d4('0x5'));var logger=require(_0xe6d4('0x6'))(_0xe6d4('0x7'));var config=require(_0xe6d4('0x8'));var jayson=require(_0xe6d4('0x9'));var client=jayson['client'][_0xe6d4('0xa')]({'port':0x232a});config[_0xe6d4('0xb')]=_[_0xe6d4('0xc')](config['redis'],{'host':_0xe6d4('0xd'),'port':0x18eb});var socket=require(_0xe6d4('0xe'))(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x2b8e5e,_0xc849dd,_0x53ef23){return new BPromise(function(_0x44dda2,_0x4453fe){return client['request'](_0x2b8e5e,_0x53ef23)[_0xe6d4('0xf')](function(_0x53c5b5){logger[_0xe6d4('0x10')](_0xe6d4('0x11'),_0xc849dd,_0xe6d4('0x12'));logger[_0xe6d4('0x13')](_0xe6d4('0x14'),_0xc849dd,_0xe6d4('0x12'),JSON['stringify'](_0x53c5b5));if(_0x53c5b5[_0xe6d4('0x15')]){if(_0x53c5b5[_0xe6d4('0x15')][_0xe6d4('0x16')]===0x1f4){logger[_0xe6d4('0x15')](_0xe6d4('0x11'),_0xc849dd,_0x53c5b5[_0xe6d4('0x15')][_0xe6d4('0x17')]);return _0x4453fe(_0x53c5b5[_0xe6d4('0x15')]['message']);}logger[_0xe6d4('0x15')]('SmsAccount,\x20%s,\x20%s',_0xc849dd,_0x53c5b5[_0xe6d4('0x15')]['message']);return _0x44dda2(_0x53c5b5[_0xe6d4('0x15')][_0xe6d4('0x17')]);}else{logger['info'](_0xe6d4('0x11'),_0xc849dd,_0xe6d4('0x12'));_0x44dda2(_0x53c5b5['result'][_0xe6d4('0x17')]);}})[_0xe6d4('0x18')](function(_0x631a06){logger[_0xe6d4('0x15')](_0xe6d4('0x11'),_0xc849dd,_0x631a06);_0x4453fe(_0x631a06);});});}exports[_0xe6d4('0x19')]=function(_0x3a9c1c){var _0x331472=this;return new Promise(function(_0x204b1e,_0x334aca){return db['SmsAccount'][_0xe6d4('0x1a')]({'raw':_0x3a9c1c[_0xe6d4('0x1b')]?_0x3a9c1c[_0xe6d4('0x1b')][_0xe6d4('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a9c1c[_0xe6d4('0x1b')]?_0x3a9c1c['options'][_0xe6d4('0x1d')]||null:null,'attributes':_0x3a9c1c[_0xe6d4('0x1b')]?_0x3a9c1c['options']['attributes']||null:null,'include':_0x3a9c1c[_0xe6d4('0x1b')]?_0x3a9c1c[_0xe6d4('0x1b')][_0xe6d4('0x1e')]?_[_0xe6d4('0x1f')](_0x3a9c1c[_0xe6d4('0x1b')][_0xe6d4('0x1e')],function(_0x4b01a5){return{'model':db[_0x4b01a5[_0xe6d4('0x20')]],'as':_0x4b01a5['as'],'attributes':_0x4b01a5[_0xe6d4('0x21')],'include':_0x4b01a5[_0xe6d4('0x1e')]?_[_0xe6d4('0x1f')](_0x4b01a5[_0xe6d4('0x1e')],function(_0x5a7c8c){return{'model':db[_0x5a7c8c['model']],'as':_0x5a7c8c['as'],'attributes':_0x5a7c8c[_0xe6d4('0x21')],'include':_0x5a7c8c[_0xe6d4('0x1e')]?_[_0xe6d4('0x1f')](_0x5a7c8c['include'],function(_0x42ae72){return{'model':db[_0x42ae72[_0xe6d4('0x20')]],'as':_0x42ae72['as'],'attributes':_0x42ae72[_0xe6d4('0x21')]};}):[]};}):[]};}):[]:[]})[_0xe6d4('0xf')](function(_0x21b732){logger[_0xe6d4('0x10')](_0xe6d4('0x19'),_0x3a9c1c);logger[_0xe6d4('0x13')](_0xe6d4('0x19'),_0x3a9c1c,JSON[_0xe6d4('0x22')](_0x21b732));_0x204b1e(_0x21b732);})['catch'](function(_0x596c9b){logger['error'](_0xe6d4('0x19'),_0x596c9b[_0xe6d4('0x17')],_0x3a9c1c);_0x334aca(_0x331472['error'](0x1f4,_0x596c9b[_0xe6d4('0x17')]));});});}; \ No newline at end of file +var _0xa1a4=['SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','SmsAccount','find','options','raw','where','include','map','model','attributes','then','ShowSmsAccount','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','register','request','info','SmsAccount,\x20%s,\x20%s','debug'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa1a4,0x1d9));var _0x4a1a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xa1a4[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x4a1a('0x0'));var util=require('util');var moment=require(_0x4a1a('0x1'));var BPromise=require('bluebird');var rs=require(_0x4a1a('0x2'));var fs=require('fs');var Redis=require(_0x4a1a('0x3'));var db=require(_0x4a1a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4a1a('0x5'))(_0x4a1a('0x6'));var config=require(_0x4a1a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4a1a('0x8')][_0x4a1a('0x9')]({'port':0x232a});config['redis']=_[_0x4a1a('0xa')](config[_0x4a1a('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a1a('0xb')]));require('./smsAccount.socket')[_0x4a1a('0xc')](socket);function respondWithRpcPromise(_0x5b6b03,_0xafdaa8,_0x2f50dd){return new BPromise(function(_0x5d85e6,_0x2e2176){return client[_0x4a1a('0xd')](_0x5b6b03,_0x2f50dd)['then'](function(_0x54f36b){logger[_0x4a1a('0xe')](_0x4a1a('0xf'),_0xafdaa8,'request\x20sent');logger[_0x4a1a('0x10')](_0x4a1a('0x11'),_0xafdaa8,_0x4a1a('0x12'),JSON[_0x4a1a('0x13')](_0x54f36b));if(_0x54f36b[_0x4a1a('0x14')]){if(_0x54f36b['error'][_0x4a1a('0x15')]===0x1f4){logger['error'](_0x4a1a('0xf'),_0xafdaa8,_0x54f36b[_0x4a1a('0x14')]['message']);return _0x2e2176(_0x54f36b[_0x4a1a('0x14')][_0x4a1a('0x16')]);}logger[_0x4a1a('0x14')](_0x4a1a('0xf'),_0xafdaa8,_0x54f36b[_0x4a1a('0x14')][_0x4a1a('0x16')]);return _0x5d85e6(_0x54f36b['error'][_0x4a1a('0x16')]);}else{logger['info'](_0x4a1a('0xf'),_0xafdaa8,'request\x20sent');_0x5d85e6(_0x54f36b['result']['message']);}})[_0x4a1a('0x17')](function(_0xfba2a3){logger[_0x4a1a('0x14')](_0x4a1a('0xf'),_0xafdaa8,_0xfba2a3);_0x2e2176(_0xfba2a3);});});}exports['ShowSmsAccount']=function(_0x5a8619){var _0x364a9a=this;return new Promise(function(_0x394c49,_0x3875af){return db[_0x4a1a('0x18')][_0x4a1a('0x19')]({'raw':_0x5a8619[_0x4a1a('0x1a')]?_0x5a8619[_0x4a1a('0x1a')][_0x4a1a('0x1b')]===undefined?!![]:![]:!![],'where':_0x5a8619[_0x4a1a('0x1a')]?_0x5a8619[_0x4a1a('0x1a')][_0x4a1a('0x1c')]||null:null,'attributes':_0x5a8619[_0x4a1a('0x1a')]?_0x5a8619[_0x4a1a('0x1a')]['attributes']||null:null,'include':_0x5a8619['options']?_0x5a8619[_0x4a1a('0x1a')][_0x4a1a('0x1d')]?_[_0x4a1a('0x1e')](_0x5a8619[_0x4a1a('0x1a')][_0x4a1a('0x1d')],function(_0x552b4e){return{'model':db[_0x552b4e[_0x4a1a('0x1f')]],'as':_0x552b4e['as'],'attributes':_0x552b4e['attributes'],'include':_0x552b4e[_0x4a1a('0x1d')]?_[_0x4a1a('0x1e')](_0x552b4e[_0x4a1a('0x1d')],function(_0x53a4c5){return{'model':db[_0x53a4c5[_0x4a1a('0x1f')]],'as':_0x53a4c5['as'],'attributes':_0x53a4c5['attributes'],'include':_0x53a4c5[_0x4a1a('0x1d')]?_[_0x4a1a('0x1e')](_0x53a4c5[_0x4a1a('0x1d')],function(_0x1cf5a5){return{'model':db[_0x1cf5a5[_0x4a1a('0x1f')]],'as':_0x1cf5a5['as'],'attributes':_0x1cf5a5[_0x4a1a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4a1a('0x21')](function(_0x5c0fd3){logger[_0x4a1a('0xe')](_0x4a1a('0x22'),_0x5a8619);logger[_0x4a1a('0x10')](_0x4a1a('0x22'),_0x5a8619,JSON[_0x4a1a('0x13')](_0x5c0fd3));_0x394c49(_0x5c0fd3);})[_0x4a1a('0x17')](function(_0x4f1588){logger['error'](_0x4a1a('0x22'),_0x4f1588['message'],_0x5a8619);_0x3875af(_0x364a9a['error'](0x1f4,_0x4f1588[_0x4a1a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 0464eac..7388fcd 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 ef72c8f..4dc8e25 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 _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x2edb97,_0x20ec23){var _0x2c45a2=function(_0x2c8e52){while(--_0x2c8e52){_0x2edb97['push'](_0x2edb97['shift']());}};_0x2c45a2(++_0x20ec23);}(_0x3e74,0x175));var _0x43e7=function(_0x2a4f06,_0x510142){_0x2a4f06=_0x2a4f06-0x0;var _0x250c34=_0x3e74[_0x2a4f06];return _0x250c34;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x5736fe,_0x2ce1b8){var _0x20d02a=function(_0x34cbfa){while(--_0x34cbfa){_0x5736fe['push'](_0x5736fe['shift']());}};_0x20d02a(++_0x2ce1b8);}(_0x7217,0x19e));var _0x7721=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x7217[_0x4fc9e6];return _0x551d28;};'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('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index b11bd9d..e63dd5c 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 _0xec2f=['noop','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x2d72d2,_0x439ca0){var _0x375530=function(_0x167a53){while(--_0x167a53){_0x2d72d2['push'](_0x2d72d2['shift']());}};_0x375530(++_0x439ca0);}(_0xec2f,0x75));var _0xfec2=function(_0x859f36,_0x30dffb){_0x859f36=_0x859f36-0x0;var _0x35107b=_0xec2f[_0x859f36];return _0x35107b;};'use strict';var Sequelize=require(_0xfec2('0x0'));module['exports']={'priority':{'type':Sequelize[_0xfec2('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xfec2('0x2')],'allowNull':![],'defaultValue':_0xfec2('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xfec2('0x2')]},'interval':{'type':Sequelize[_0xfec2('0x2')],'defaultValue':_0xfec2('0x4')}}; \ No newline at end of file +var _0xa2d2=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x4bc314,_0x20a3dd){var _0xfc7d8c=function(_0x5b7ea6){while(--_0x5b7ea6){_0x4bc314['push'](_0x4bc314['shift']());}};_0xfc7d8c(++_0x20a3dd);}(_0xa2d2,0x1de));var _0x2a2d=function(_0x72a45c,_0x1dc5f2){_0x72a45c=_0x72a45c-0x0;var _0x5c5ec9=_0xa2d2[_0x72a45c];return _0x5c5ec9;};'use strict';var Sequelize=require(_0x2a2d('0x0'));module['exports']={'priority':{'type':Sequelize[_0x2a2d('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x2a2d('0x2')],'allowNull':![],'defaultValue':_0x2a2d('0x3')},'appdata':{'type':Sequelize[_0x2a2d('0x4')]()},'description':{'type':Sequelize[_0x2a2d('0x2')]},'interval':{'type':Sequelize[_0x2a2d('0x2')],'defaultValue':_0x2a2d('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 44c28fa..6457719 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 _0x3af4=['sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','SmsApplication','includeAll','rows','catch','show','params','include','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x19fa4e,_0x1afa73){var _0x33fb31=function(_0x4bbfa6){while(--_0x4bbfa6){_0x19fa4e['push'](_0x19fa4e['shift']());}};_0x33fb31(++_0x1afa73);}(_0x3af4,0xbc));var _0x43af=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0x3af4[_0x35af23];return _0x340506;};'use strict';var emlformat=require(_0x43af('0x0'));var rimraf=require(_0x43af('0x1'));var zipdir=require(_0x43af('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x43af('0x3'));var moment=require(_0x43af('0x4'));var BPromise=require(_0x43af('0x5'));var Mustache=require(_0x43af('0x6'));var util=require(_0x43af('0x7'));var path=require('path');var sox=require(_0x43af('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43af('0x9'));var _=require(_0x43af('0xa'));var squel=require(_0x43af('0xb'));var crypto=require(_0x43af('0xc'));var jsforce=require(_0x43af('0xd'));var deskjs=require(_0x43af('0xe'));var toCsv=require(_0x43af('0xf'));var querystring=require(_0x43af('0x10'));var Papa=require(_0x43af('0x11'));var Redis=require(_0x43af('0x12'));var authService=require(_0x43af('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x43af('0x14'))(_0x43af('0x15'));var utils=require(_0x43af('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x43af('0x17'));var db=require(_0x43af('0x18'))['db'];function respondWithStatusCode(_0x43d01d,_0x5761c2){_0x5761c2=_0x5761c2||0xcc;return function(_0x543a6e){if(_0x543a6e){return _0x43d01d[_0x43af('0x19')](_0x5761c2);}return _0x43d01d[_0x43af('0x1a')](_0x5761c2)['end']();};}function respondWithResult(_0x317f95,_0x40c1dd){_0x40c1dd=_0x40c1dd||0xc8;return function(_0x2d9ff5){if(_0x2d9ff5){return _0x317f95[_0x43af('0x1a')](_0x40c1dd)[_0x43af('0x1b')](_0x2d9ff5);}};}function respondWithFilteredResult(_0x25642d,_0xf7d4b8){return function(_0x445916){if(_0x445916){var _0x934eac=typeof _0xf7d4b8[_0x43af('0x1c')]===_0x43af('0x1d')&&typeof _0xf7d4b8[_0x43af('0x1e')]===_0x43af('0x1d');var _0x2fcc7e=_0x445916[_0x43af('0x1f')];var _0x4dc4e7=_0x934eac?0x0:_0xf7d4b8[_0x43af('0x1c')];var _0x4ae05e=_0x934eac?_0x445916[_0x43af('0x1f')]:_0xf7d4b8[_0x43af('0x1c')]+_0xf7d4b8[_0x43af('0x1e')];var _0x2a39e9;if(_0x4ae05e>=_0x2fcc7e){_0x4ae05e=_0x2fcc7e;_0x2a39e9=0xc8;}else{_0x2a39e9=0xce;}_0x25642d['status'](_0x2a39e9);return _0x25642d[_0x43af('0x20')]('Content-Range',_0x4dc4e7+'-'+_0x4ae05e+'/'+_0x2fcc7e)[_0x43af('0x1b')](_0x445916);}return null;};}function patchUpdates(_0x2cdb97){return function(_0x5ca9c2){try{jsonpatch[_0x43af('0x21')](_0x5ca9c2,_0x2cdb97,!![]);}catch(_0x5d3d8e){return BPromise[_0x43af('0x22')](_0x5d3d8e);}return _0x5ca9c2[_0x43af('0x23')]();};}function saveUpdates(_0x415662,_0x1481cb){return function(_0x10a712){if(_0x10a712){return _0x10a712['update'](_0x415662)[_0x43af('0x24')](function(_0x5ac36f){return _0x5ac36f;});}return null;};}function removeEntity(_0x3cb54b,_0x2b66c0){return function(_0x3a8ae4){if(_0x3a8ae4){return _0x3a8ae4['destroy']()[_0x43af('0x24')](function(){_0x3cb54b[_0x43af('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b2af0,_0x46c356){return function(_0x8656be){if(!_0x8656be){_0x5b2af0['sendStatus'](0x194);}return _0x8656be;};}function handleError(_0x5e6070,_0x4eb668){_0x4eb668=_0x4eb668||0x1f4;return function(_0x54968b){logger[_0x43af('0x25')](_0x54968b[_0x43af('0x26')]);if(_0x54968b[_0x43af('0x27')]){delete _0x54968b[_0x43af('0x27')];}_0x5e6070[_0x43af('0x1a')](_0x4eb668)[_0x43af('0x28')](_0x54968b);};}exports[_0x43af('0x29')]=function(_0x4d4ac3,_0xf42edd){var _0x306e76={},_0x2efa6a={},_0x58b478={'count':0x0,'rows':[]};var _0x28265d=_[_0x43af('0x2a')](db['SmsApplication'][_0x43af('0x2b')],function(_0x2917ed){return{'name':_0x2917ed[_0x43af('0x2c')],'type':_0x2917ed[_0x43af('0x2d')]['key']};});_0x2efa6a[_0x43af('0x2e')]=_[_0x43af('0x2a')](_0x28265d,'name');_0x2efa6a[_0x43af('0x2f')]=_['keys'](_0x4d4ac3[_0x43af('0x2f')]);_0x2efa6a['filters']=_[_0x43af('0x30')](_0x2efa6a[_0x43af('0x2e')],_0x2efa6a[_0x43af('0x2f')]);_0x306e76[_0x43af('0x31')]=_[_0x43af('0x30')](_0x2efa6a[_0x43af('0x2e')],qs['fields'](_0x4d4ac3['query'][_0x43af('0x32')]));_0x306e76['attributes']=_0x306e76[_0x43af('0x31')][_0x43af('0x33')]?_0x306e76['attributes']:_0x2efa6a[_0x43af('0x2e')];if(!_0x4d4ac3[_0x43af('0x2f')][_0x43af('0x34')](_0x43af('0x35'))){_0x306e76[_0x43af('0x1e')]=qs[_0x43af('0x1e')](_0x4d4ac3['query'][_0x43af('0x1e')]);_0x306e76[_0x43af('0x1c')]=qs['offset'](_0x4d4ac3['query'][_0x43af('0x1c')]);}_0x306e76[_0x43af('0x36')]=qs[_0x43af('0x37')](_0x4d4ac3['query']['sort']);_0x306e76[_0x43af('0x38')]=qs['filters'](_['pick'](_0x4d4ac3[_0x43af('0x2f')],_0x2efa6a['filters']),_0x28265d);if(_0x4d4ac3['query'][_0x43af('0x39')]){_0x306e76[_0x43af('0x38')]=_[_0x43af('0x3a')](_0x306e76[_0x43af('0x38')],{'$or':_[_0x43af('0x2a')](_0x28265d,function(_0x2eba49){if(_0x2eba49['type']!==_0x43af('0x3b')){var _0x3d32c0={};_0x3d32c0[_0x2eba49[_0x43af('0x27')]]={'$like':'%'+_0x4d4ac3[_0x43af('0x2f')][_0x43af('0x39')]+'%'};return _0x3d32c0;}})});}_0x306e76=_['merge']({},_0x306e76,_0x4d4ac3[_0x43af('0x3c')]);var _0x274035={'where':_0x306e76['where']};return db[_0x43af('0x3d')][_0x43af('0x1f')](_0x274035)[_0x43af('0x24')](function(_0x222018){_0x58b478[_0x43af('0x1f')]=_0x222018;if(_0x4d4ac3['query'][_0x43af('0x3e')]){_0x306e76['include']=[{'all':!![]}];}return db[_0x43af('0x3d')]['findAll'](_0x306e76);})[_0x43af('0x24')](function(_0x21c502){_0x58b478[_0x43af('0x3f')]=_0x21c502;return _0x58b478;})[_0x43af('0x24')](respondWithFilteredResult(_0xf42edd,_0x306e76))[_0x43af('0x40')](handleError(_0xf42edd,null));};exports[_0x43af('0x41')]=function(_0x2955fd,_0x32f672){var _0x4e49c7={'raw':!![],'where':{'id':_0x2955fd[_0x43af('0x42')]['id']}},_0x565577={};_0x565577['model']=_['keys'](db[_0x43af('0x3d')][_0x43af('0x2b')]);_0x565577[_0x43af('0x2f')]=_['keys'](_0x2955fd[_0x43af('0x2f')]);_0x565577['filters']=_[_0x43af('0x30')](_0x565577['model'],_0x565577[_0x43af('0x2f')]);_0x4e49c7[_0x43af('0x31')]=_[_0x43af('0x30')](_0x565577[_0x43af('0x2e')],qs[_0x43af('0x32')](_0x2955fd['query'][_0x43af('0x32')]));_0x4e49c7[_0x43af('0x31')]=_0x4e49c7[_0x43af('0x31')][_0x43af('0x33')]?_0x4e49c7[_0x43af('0x31')]:_0x565577[_0x43af('0x2e')];if(_0x2955fd[_0x43af('0x2f')][_0x43af('0x3e')]){_0x4e49c7[_0x43af('0x43')]=[{'all':!![]}];}_0x4e49c7=_['merge']({},_0x4e49c7,_0x2955fd[_0x43af('0x3c')]);return db[_0x43af('0x3d')]['find'](_0x4e49c7)[_0x43af('0x24')](handleEntityNotFound(_0x32f672,null))[_0x43af('0x24')](respondWithResult(_0x32f672,null))['catch'](handleError(_0x32f672,null));};exports[_0x43af('0x44')]=function(_0x5ea374,_0xc54177){return db[_0x43af('0x3d')][_0x43af('0x44')](_0x5ea374[_0x43af('0x45')],{})[_0x43af('0x24')](respondWithResult(_0xc54177,0xc9))['catch'](handleError(_0xc54177,null));};exports['update']=function(_0x57b54f,_0x63ee7a){if(_0x57b54f['body']['id']){delete _0x57b54f[_0x43af('0x45')]['id'];}return db['SmsApplication'][_0x43af('0x46')]({'where':{'id':_0x57b54f[_0x43af('0x42')]['id']}})[_0x43af('0x24')](handleEntityNotFound(_0x63ee7a,null))['then'](saveUpdates(_0x57b54f[_0x43af('0x45')],null))['then'](respondWithResult(_0x63ee7a,null))[_0x43af('0x40')](handleError(_0x63ee7a,null));};exports['destroy']=function(_0x191a47,_0x3f2258){return db[_0x43af('0x3d')][_0x43af('0x46')]({'where':{'id':_0x191a47[_0x43af('0x42')]['id']}})[_0x43af('0x24')](handleEntityNotFound(_0x3f2258,null))[_0x43af('0x24')](removeEntity(_0x3f2258,null))[_0x43af('0x40')](handleError(_0x3f2258,null));}; \ No newline at end of file +var _0x2077=['type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','params','keys','includeAll','catch','create','body','update','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','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','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','map','SmsApplication','rawAttributes','fieldName'];(function(_0x499390,_0x3e4232){var _0x10556b=function(_0x1db37a){while(--_0x1db37a){_0x499390['push'](_0x499390['shift']());}};_0x10556b(++_0x3e4232);}(_0x2077,0x142));var _0x7207=function(_0xbcc9ef,_0x25ac76){_0xbcc9ef=_0xbcc9ef-0x0;var _0x508627=_0x2077[_0xbcc9ef];return _0x508627;};'use strict';var emlformat=require(_0x7207('0x0'));var rimraf=require(_0x7207('0x1'));var zipdir=require(_0x7207('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7207('0x3'));var moment=require('moment');var BPromise=require(_0x7207('0x4'));var Mustache=require(_0x7207('0x5'));var util=require(_0x7207('0x6'));var path=require('path');var sox=require(_0x7207('0x7'));var csv=require(_0x7207('0x8'));var ejs=require(_0x7207('0x9'));var fs=require('fs');var fs_extra=require(_0x7207('0xa'));var _=require(_0x7207('0xb'));var squel=require('squel');var crypto=require(_0x7207('0xc'));var jsforce=require(_0x7207('0xd'));var deskjs=require(_0x7207('0xe'));var toCsv=require(_0x7207('0x8'));var querystring=require(_0x7207('0xf'));var Papa=require(_0x7207('0x10'));var Redis=require(_0x7207('0x11'));var authService=require(_0x7207('0x12'));var qs=require(_0x7207('0x13'));var as=require(_0x7207('0x14'));var hardwareService=require(_0x7207('0x15'));var logger=require('../../config/logger')(_0x7207('0x16'));var utils=require(_0x7207('0x17'));var config=require(_0x7207('0x18'));var licenseUtil=require(_0x7207('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17edcf,_0x23aa74){_0x23aa74=_0x23aa74||0xcc;return function(_0x260f32){if(_0x260f32){return _0x17edcf[_0x7207('0x1a')](_0x23aa74);}return _0x17edcf[_0x7207('0x1b')](_0x23aa74)[_0x7207('0x1c')]();};}function respondWithResult(_0x458e2e,_0x19a0d0){_0x19a0d0=_0x19a0d0||0xc8;return function(_0x5938fd){if(_0x5938fd){return _0x458e2e[_0x7207('0x1b')](_0x19a0d0)['json'](_0x5938fd);}};}function respondWithFilteredResult(_0x8f546a,_0x409c38){return function(_0x399e07){if(_0x399e07){var _0x26a662=typeof _0x409c38[_0x7207('0x1d')]===_0x7207('0x1e')&&typeof _0x409c38[_0x7207('0x1f')]===_0x7207('0x1e');var _0x1b23be=_0x399e07[_0x7207('0x20')];var _0x67a7d3=_0x26a662?0x0:_0x409c38[_0x7207('0x1d')];var _0x5ec21e=_0x26a662?_0x399e07['count']:_0x409c38['offset']+_0x409c38[_0x7207('0x1f')];var _0x10f4c9;if(_0x5ec21e>=_0x1b23be){_0x5ec21e=_0x1b23be;_0x10f4c9=0xc8;}else{_0x10f4c9=0xce;}_0x8f546a[_0x7207('0x1b')](_0x10f4c9);return _0x8f546a[_0x7207('0x21')](_0x7207('0x22'),_0x67a7d3+'-'+_0x5ec21e+'/'+_0x1b23be)[_0x7207('0x23')](_0x399e07);}return null;};}function patchUpdates(_0x54a2fa){return function(_0x43a4f1){try{jsonpatch[_0x7207('0x24')](_0x43a4f1,_0x54a2fa,!![]);}catch(_0x2d829d){return BPromise['reject'](_0x2d829d);}return _0x43a4f1[_0x7207('0x25')]();};}function saveUpdates(_0x280261,_0x368ead){return function(_0x556597){if(_0x556597){return _0x556597['update'](_0x280261)[_0x7207('0x26')](function(_0x1c89b8){return _0x1c89b8;});}return null;};}function removeEntity(_0x356f23,_0x30140d){return function(_0x31cd35){if(_0x31cd35){return _0x31cd35[_0x7207('0x27')]()[_0x7207('0x26')](function(){_0x356f23[_0x7207('0x1b')](0xcc)[_0x7207('0x1c')]();});}};}function handleEntityNotFound(_0xc534b4,_0x5b1872){return function(_0x33522c){if(!_0x33522c){_0xc534b4[_0x7207('0x1a')](0x194);}return _0x33522c;};}function handleError(_0x1a5082,_0x375f42){_0x375f42=_0x375f42||0x1f4;return function(_0x32ff4c){logger[_0x7207('0x28')](_0x32ff4c[_0x7207('0x29')]);if(_0x32ff4c[_0x7207('0x2a')]){delete _0x32ff4c['name'];}_0x1a5082[_0x7207('0x1b')](_0x375f42)[_0x7207('0x2b')](_0x32ff4c);};}exports['index']=function(_0x257a7d,_0x44d8f2){var _0x413027={},_0x2331da={},_0x1e1528={'count':0x0,'rows':[]};var _0x52b23c=_[_0x7207('0x2c')](db[_0x7207('0x2d')][_0x7207('0x2e')],function(_0x3c7778){return{'name':_0x3c7778[_0x7207('0x2f')],'type':_0x3c7778[_0x7207('0x30')]['key']};});_0x2331da[_0x7207('0x31')]=_[_0x7207('0x2c')](_0x52b23c,_0x7207('0x2a'));_0x2331da['query']=_['keys'](_0x257a7d[_0x7207('0x32')]);_0x2331da[_0x7207('0x33')]=_['intersection'](_0x2331da[_0x7207('0x31')],_0x2331da[_0x7207('0x32')]);_0x413027[_0x7207('0x34')]=_[_0x7207('0x35')](_0x2331da['model'],qs[_0x7207('0x36')](_0x257a7d[_0x7207('0x32')][_0x7207('0x36')]));_0x413027[_0x7207('0x34')]=_0x413027[_0x7207('0x34')][_0x7207('0x37')]?_0x413027['attributes']:_0x2331da[_0x7207('0x31')];if(!_0x257a7d['query'][_0x7207('0x38')](_0x7207('0x39'))){_0x413027[_0x7207('0x1f')]=qs[_0x7207('0x1f')](_0x257a7d['query']['limit']);_0x413027[_0x7207('0x1d')]=qs[_0x7207('0x1d')](_0x257a7d[_0x7207('0x32')][_0x7207('0x1d')]);}_0x413027['order']=qs[_0x7207('0x3a')](_0x257a7d[_0x7207('0x32')]['sort']);_0x413027[_0x7207('0x3b')]=qs[_0x7207('0x33')](_[_0x7207('0x3c')](_0x257a7d[_0x7207('0x32')],_0x2331da[_0x7207('0x33')]),_0x52b23c);if(_0x257a7d[_0x7207('0x32')][_0x7207('0x3d')]){_0x413027[_0x7207('0x3b')]=_[_0x7207('0x3e')](_0x413027['where'],{'$or':_[_0x7207('0x2c')](_0x52b23c,function(_0x37bcbf){if(_0x37bcbf[_0x7207('0x30')]!==_0x7207('0x3f')){var _0x10702c={};_0x10702c[_0x37bcbf['name']]={'$like':'%'+_0x257a7d[_0x7207('0x32')][_0x7207('0x3d')]+'%'};return _0x10702c;}})});}_0x413027=_['merge']({},_0x413027,_0x257a7d[_0x7207('0x40')]);var _0x1ad701={'where':_0x413027[_0x7207('0x3b')]};return db[_0x7207('0x2d')][_0x7207('0x20')](_0x1ad701)[_0x7207('0x26')](function(_0xfdd7a0){_0x1e1528['count']=_0xfdd7a0;if(_0x257a7d['query']['includeAll']){_0x413027['include']=[{'all':!![]}];}return db[_0x7207('0x2d')][_0x7207('0x41')](_0x413027);})[_0x7207('0x26')](function(_0x2445ad){_0x1e1528['rows']=_0x2445ad;return _0x1e1528;})[_0x7207('0x26')](respondWithFilteredResult(_0x44d8f2,_0x413027))['catch'](handleError(_0x44d8f2,null));};exports['show']=function(_0xc8e6c8,_0x321d48){var _0x3a0ce7={'raw':!![],'where':{'id':_0xc8e6c8[_0x7207('0x42')]['id']}},_0x441343={};_0x441343[_0x7207('0x31')]=_[_0x7207('0x43')](db[_0x7207('0x2d')][_0x7207('0x2e')]);_0x441343[_0x7207('0x32')]=_[_0x7207('0x43')](_0xc8e6c8[_0x7207('0x32')]);_0x441343[_0x7207('0x33')]=_['intersection'](_0x441343['model'],_0x441343[_0x7207('0x32')]);_0x3a0ce7['attributes']=_[_0x7207('0x35')](_0x441343[_0x7207('0x31')],qs[_0x7207('0x36')](_0xc8e6c8['query'][_0x7207('0x36')]));_0x3a0ce7[_0x7207('0x34')]=_0x3a0ce7[_0x7207('0x34')][_0x7207('0x37')]?_0x3a0ce7[_0x7207('0x34')]:_0x441343[_0x7207('0x31')];if(_0xc8e6c8['query'][_0x7207('0x44')]){_0x3a0ce7['include']=[{'all':!![]}];}_0x3a0ce7=_[_0x7207('0x3e')]({},_0x3a0ce7,_0xc8e6c8['options']);return db[_0x7207('0x2d')]['find'](_0x3a0ce7)[_0x7207('0x26')](handleEntityNotFound(_0x321d48,null))[_0x7207('0x26')](respondWithResult(_0x321d48,null))[_0x7207('0x45')](handleError(_0x321d48,null));};exports[_0x7207('0x46')]=function(_0x2ffcea,_0x4bc828){return db[_0x7207('0x2d')]['create'](_0x2ffcea[_0x7207('0x47')],{})[_0x7207('0x26')](respondWithResult(_0x4bc828,0xc9))[_0x7207('0x45')](handleError(_0x4bc828,null));};exports[_0x7207('0x48')]=function(_0xccf2da,_0x2d6ea9){if(_0xccf2da['body']['id']){delete _0xccf2da['body']['id'];}return db[_0x7207('0x2d')][_0x7207('0x49')]({'where':{'id':_0xccf2da[_0x7207('0x42')]['id']}})[_0x7207('0x26')](handleEntityNotFound(_0x2d6ea9,null))[_0x7207('0x26')](saveUpdates(_0xccf2da['body'],null))[_0x7207('0x26')](respondWithResult(_0x2d6ea9,null))[_0x7207('0x45')](handleError(_0x2d6ea9,null));};exports[_0x7207('0x27')]=function(_0x2d5298,_0x522c02){return db['SmsApplication'][_0x7207('0x49')]({'where':{'id':_0x2d5298[_0x7207('0x42')]['id']}})[_0x7207('0x26')](handleEntityNotFound(_0x522c02,null))[_0x7207('0x26')](removeEntity(_0x522c02,null))[_0x7207('0x45')](handleError(_0x522c02,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 42ef430..a5790ad 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 _0xe93b=['../../config/environment','./smsApplication.attributes','exports','SmsApplication','sms_applications','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4fba97,_0x222701){var _0x1b04fe=function(_0x56adf3){while(--_0x56adf3){_0x4fba97['push'](_0x4fba97['shift']());}};_0x1b04fe(++_0x222701);}(_0xe93b,0xb9));var _0xbe93=function(_0x5cc7dd,_0x25f5d0){_0x5cc7dd=_0x5cc7dd-0x0;var _0x32e9ac=_0xe93b[_0x5cc7dd];return _0x32e9ac;};'use strict';var _=require(_0xbe93('0x0'));var util=require(_0xbe93('0x1'));var logger=require(_0xbe93('0x2'))('api');var moment=require(_0xbe93('0x3'));var BPromise=require(_0xbe93('0x4'));var rp=require(_0xbe93('0x5'));var fs=require('fs');var path=require(_0xbe93('0x6'));var rimraf=require('rimraf');var config=require(_0xbe93('0x7'));var attributes=require(_0xbe93('0x8'));module[_0xbe93('0x9')]=function(_0x4ca13a,_0x2451d4){return _0x4ca13a['define'](_0xbe93('0xa'),attributes,{'tableName':_0xbe93('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa20a=['./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x50ae86,_0x41ded2){var _0x397b64=function(_0x55f18a){while(--_0x55f18a){_0x50ae86['push'](_0x50ae86['shift']());}};_0x397b64(++_0x41ded2);}(_0xa20a,0x167));var _0xaa20=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa20a[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xaa20('0x0'));var util=require(_0xaa20('0x1'));var logger=require(_0xaa20('0x2'))(_0xaa20('0x3'));var moment=require(_0xaa20('0x4'));var BPromise=require('bluebird');var rp=require(_0xaa20('0x5'));var fs=require('fs');var path=require(_0xaa20('0x6'));var rimraf=require(_0xaa20('0x7'));var config=require(_0xaa20('0x8'));var attributes=require(_0xaa20('0x9'));module[_0xaa20('0xa')]=function(_0x502f17,_0x1a7e3c){return _0x502f17[_0xaa20('0xb')](_0xaa20('0xc'),attributes,{'tableName':_0xaa20('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaa20('0xe'),'collate':_0xaa20('0xf')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 77e2b20..b3daf0d 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 _0x96f2=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring'];(function(_0x4eaa3e,_0x24031c){var _0x18d712=function(_0x34c24b){while(--_0x34c24b){_0x4eaa3e['push'](_0x4eaa3e['shift']());}};_0x18d712(++_0x24031c);}(_0x96f2,0xb0));var _0x296f=function(_0x40bec0,_0x1e0328){_0x40bec0=_0x40bec0-0x0;var _0x2b5a84=_0x96f2[_0x40bec0];return _0x2b5a84;};'use strict';var _=require(_0x296f('0x0'));var util=require('util');var moment=require(_0x296f('0x1'));var BPromise=require(_0x296f('0x2'));var rs=require(_0x296f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x296f('0x4'))['db'];var utils=require(_0x296f('0x5'));var logger=require(_0x296f('0x6'))('rpc');var config=require(_0x296f('0x7'));var jayson=require(_0x296f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x164031,_0x1d019f,_0x2dc0ca){return new BPromise(function(_0x28f708,_0x30ed43){return client[_0x296f('0x9')](_0x164031,_0x2dc0ca)[_0x296f('0xa')](function(_0x3ea699){logger[_0x296f('0xb')](_0x296f('0xc'),_0x1d019f,'request\x20sent');logger[_0x296f('0xd')](_0x296f('0xe'),_0x1d019f,_0x296f('0xf'),JSON['stringify'](_0x3ea699));if(_0x3ea699[_0x296f('0x10')]){if(_0x3ea699[_0x296f('0x10')][_0x296f('0x11')]===0x1f4){logger[_0x296f('0x10')]('SmsApplication,\x20%s,\x20%s',_0x1d019f,_0x3ea699['error']['message']);return _0x30ed43(_0x3ea699[_0x296f('0x10')][_0x296f('0x12')]);}logger[_0x296f('0x10')](_0x296f('0xc'),_0x1d019f,_0x3ea699['error'][_0x296f('0x12')]);return _0x28f708(_0x3ea699['error']['message']);}else{logger[_0x296f('0xb')](_0x296f('0xc'),_0x1d019f,_0x296f('0xf'));_0x28f708(_0x3ea699[_0x296f('0x13')]['message']);}})['catch'](function(_0x3e3860){logger['error'](_0x296f('0xc'),_0x1d019f,_0x3e3860);_0x30ed43(_0x3e3860);});});} \ No newline at end of file +var _0x7916=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x3433eb,_0x50b0a2){var _0x1d9527=function(_0x21bf7e){while(--_0x21bf7e){_0x3433eb['push'](_0x3433eb['shift']());}};_0x1d9527(++_0x50b0a2);}(_0x7916,0x128));var _0x6791=function(_0x5610b7,_0x5095be){_0x5610b7=_0x5610b7-0x0;var _0x1c0eef=_0x7916[_0x5610b7];return _0x1c0eef;};'use strict';var _=require(_0x6791('0x0'));var util=require('util');var moment=require(_0x6791('0x1'));var BPromise=require(_0x6791('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6791('0x3'));var db=require(_0x6791('0x4'))['db'];var utils=require(_0x6791('0x5'));var logger=require(_0x6791('0x6'))('rpc');var config=require(_0x6791('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6791('0x8')][_0x6791('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ad8c0,_0x8b85ff,_0x5d2118){return new BPromise(function(_0x2b240c,_0x50c563){return client['request'](_0x5ad8c0,_0x5d2118)[_0x6791('0xa')](function(_0x198a64){logger['info'](_0x6791('0xb'),_0x8b85ff,_0x6791('0xc'));logger[_0x6791('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x8b85ff,_0x6791('0xc'),JSON[_0x6791('0xe')](_0x198a64));if(_0x198a64[_0x6791('0xf')]){if(_0x198a64[_0x6791('0xf')][_0x6791('0x10')]===0x1f4){logger[_0x6791('0xf')](_0x6791('0xb'),_0x8b85ff,_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);return _0x50c563(_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x8b85ff,_0x198a64[_0x6791('0xf')]['message']);return _0x2b240c(_0x198a64[_0x6791('0xf')]['message']);}else{logger[_0x6791('0x12')](_0x6791('0xb'),_0x8b85ff,'request\x20sent');_0x2b240c(_0x198a64[_0x6791('0x13')]['message']);}})[_0x6791('0x14')](function(_0x150d1f){logger['error'](_0x6791('0xb'),_0x8b85ff,_0x150d1f);_0x50c563(_0x150d1f);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 538b338..45590f6 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 _0xd8b0=['util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer'];(function(_0x16c3ea,_0x22b68f){var _0xf72882=function(_0x46499d){while(--_0x46499d){_0x16c3ea['push'](_0x16c3ea['shift']());}};_0xf72882(++_0x22b68f);}(_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'));var controller=require('./smsInteraction.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('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/download',auth[_0x0d8b('0x7')](),controller['download']);router[_0x0d8b('0xf')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0xf')](_0x0d8b('0x12'),auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x15')),controller[_0x0d8b('0x16')]);router['put'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x17')),controller['update']);router[_0x0d8b('0x18')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x19')),controller[_0x0d8b('0x1a')]);router[_0x0d8b('0x18')]('/:id/tags',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x1b')]);module[_0x0d8b('0x1c')]=router; \ No newline at end of file +var _0x80ed=['delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','update'];(function(_0x552fce,_0x3f24bc){var _0x3e27a2=function(_0xc91154){while(--_0xc91154){_0x552fce['push'](_0x552fce['shift']());}};_0x3e27a2(++_0x3f24bc);}(_0x80ed,0x11c));var _0xd80e=function(_0x266300,_0x54e9bf){_0x266300=_0x266300-0x0;var _0x1ba61d=_0x80ed[_0x266300];return _0x1ba61d;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var fs_extra=require(_0xd80e('0x4'));var auth=require(_0xd80e('0x5'));var interaction=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var controller=require('./smsInteraction.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0x8')](_0xd80e('0xd'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0x8')](_0xd80e('0xf'),auth[_0xd80e('0x9')](),controller['getMessages']);router[_0xd80e('0x8')](_0xd80e('0x10'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);router[_0xd80e('0x12')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0x13')]);router[_0xd80e('0x12')](_0xd80e('0xf'),auth['isAuthenticated'](),controller['addMessage']);router['post']('/:id/tags',auth[_0xd80e('0x9')](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x16')),controller[_0xd80e('0x17')]);router['put'](_0xd80e('0xd'),auth[_0xd80e('0x9')](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x18')),controller[_0xd80e('0x19')]);router[_0xd80e('0x1a')](_0xd80e('0xd'),auth['isAuthenticated'](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x1b')),controller[_0xd80e('0x1c')]);router['delete'](_0xd80e('0x1d'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index cc1d29c..b7e1360 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 _0x8585=['ENUM','out','sequelize','moment','exports','DATE','STRING'];(function(_0x5b3fed,_0x59d322){var _0x4cd7c8=function(_0x268eb0){while(--_0x268eb0){_0x5b3fed['push'](_0x5b3fed['shift']());}};_0x4cd7c8(++_0x59d322);}(_0x8585,0x64));var _0x5858=function(_0x14c0f4,_0x1260b5){_0x14c0f4=_0x14c0f4-0x0;var _0x1303da=_0x8585[_0x14c0f4];return _0x1303da;};'use strict';var Sequelize=require(_0x5858('0x0'));var moment=require(_0x5858('0x1'));module[_0x5858('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5858('0x3')]},'disposition':{'type':Sequelize[_0x5858('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x5858('0x4')]},'read1stAt':{'type':Sequelize[_0x5858('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5858('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x5858('0x5')]('in',_0x5858('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9a5a=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x9a5a,0x194));var _0xa9a5=function(_0x56dfdd,_0x13d9b8){_0x56dfdd=_0x56dfdd-0x0;var _0x5cc8ec=_0x9a5a[_0x56dfdd];return _0x5cc8ec;};'use strict';var Sequelize=require(_0xa9a5('0x0'));var moment=require(_0xa9a5('0x1'));module[_0xa9a5('0x2')]={'closed':{'type':Sequelize[_0xa9a5('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa9a5('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa9a5('0x5')]},'thirdDisposition':{'type':Sequelize[_0xa9a5('0x5')]},'note':{'type':Sequelize[_0xa9a5('0x5')]},'phone':{'type':Sequelize[_0xa9a5('0x5')]},'read1stAt':{'type':Sequelize[_0xa9a5('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xa9a5('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa9a5('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xa9a5('0x6')]('in',_0xa9a5('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa9a5('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index e938f6c..5a914aa 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 _0x3a53=['push','index','SmsInteraction','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','expr','search','parseSearch','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','text','keys','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','isArray','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','SELECT','clone','order','contactName','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','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','c.lastName','Contact.lastName','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','ui.SmsInteractionId\x20IN\x20?','all','rows','show','rawAttributes','includeAll','catch','create','params','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage','SmsInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','addTags','setTags','spread','smsInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','format','transcript-%d-%s.zip','firstName','direction','secret','SmsAccount','Account','Owner','Sms','N.A.','closed','closedAt','disposition','Messages','System','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach'];(function(_0x33725b,_0x1e6b72){var _0x125d99=function(_0x31e671){while(--_0x31e671){_0x33725b['push'](_0x33725b['shift']());}};_0x125d99(++_0x1e6b72);}(_0x3a53,0x18b));var _0x33a5=function(_0x4256c5,_0x288cee){_0x4256c5=_0x4256c5-0x0;var _0x3c8bfd=_0x3a53[_0x4256c5];return _0x3c8bfd;};'use strict';var emlformat=require(_0x33a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x33a5('0x1'));var rp=require('request-promise');var moment=require(_0x33a5('0x2'));var BPromise=require(_0x33a5('0x3'));var Mustache=require(_0x33a5('0x4'));var util=require(_0x33a5('0x5'));var path=require('path');var sox=require(_0x33a5('0x6'));var csv=require('to-csv');var ejs=require(_0x33a5('0x7'));var fs=require('fs');var fs_extra=require(_0x33a5('0x8'));var _=require('lodash');var squel=require(_0x33a5('0x9'));var crypto=require(_0x33a5('0xa'));var jsforce=require(_0x33a5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x33a5('0xc'));var querystring=require(_0x33a5('0xd'));var Papa=require(_0x33a5('0xe'));var Redis=require(_0x33a5('0xf'));var authService=require(_0x33a5('0x10'));var qs=require(_0x33a5('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x33a5('0x12'));var hardwareService=require(_0x33a5('0x13'));var logger=require(_0x33a5('0x14'))(_0x33a5('0x15'));var utils=require(_0x33a5('0x16'));var config=require(_0x33a5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x33a5('0x18'))['db'];config[_0x33a5('0x19')]=_[_0x33a5('0x1a')](config[_0x33a5('0x19')],{'host':_0x33a5('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x33a5('0x19')]));require(_0x33a5('0x1c'))['register'](socket);function respondWithStatusCode(_0x5e11db,_0x491dff){_0x491dff=_0x491dff||0xcc;return function(_0x5b9a19){if(_0x5b9a19){return _0x5e11db[_0x33a5('0x1d')](_0x491dff);}return _0x5e11db[_0x33a5('0x1e')](_0x491dff)['end']();};}function respondWithResult(_0x3e4387,_0x5c6c9c){_0x5c6c9c=_0x5c6c9c||0xc8;return function(_0x483725){if(_0x483725){return _0x3e4387[_0x33a5('0x1e')](_0x5c6c9c)[_0x33a5('0x1f')](_0x483725);}};}function respondWithFilteredResult(_0x2cf45b,_0x31059f){return function(_0x4396be){if(_0x4396be){var _0x1b85b1=typeof _0x31059f[_0x33a5('0x20')]===_0x33a5('0x21')&&typeof _0x31059f[_0x33a5('0x22')]===_0x33a5('0x21');var _0x53cd08=_0x4396be[_0x33a5('0x23')];var _0x55d31c=_0x1b85b1?0x0:_0x31059f[_0x33a5('0x20')];var _0x1d90f7=_0x1b85b1?_0x4396be[_0x33a5('0x23')]:_0x31059f[_0x33a5('0x20')]+_0x31059f[_0x33a5('0x22')];var _0x27f483;if(_0x1d90f7>=_0x53cd08){_0x1d90f7=_0x53cd08;_0x27f483=0xc8;}else{_0x27f483=0xce;}_0x2cf45b[_0x33a5('0x1e')](_0x27f483);return _0x2cf45b[_0x33a5('0x24')](_0x33a5('0x25'),_0x55d31c+'-'+_0x1d90f7+'/'+_0x53cd08)[_0x33a5('0x1f')](_0x4396be);}return null;};}function patchUpdates(_0x2a70ea){return function(_0x171fb6){try{jsonpatch[_0x33a5('0x26')](_0x171fb6,_0x2a70ea,!![]);}catch(_0x5ae014){return BPromise[_0x33a5('0x27')](_0x5ae014);}return _0x171fb6[_0x33a5('0x28')]();};}function saveUpdates(_0x452274,_0x236c0d){return function(_0x5a5ee6){if(_0x5a5ee6){return _0x5a5ee6[_0x33a5('0x29')](_0x452274)['then'](function(_0x469b88){return _0x469b88;});}return null;};}function removeEntity(_0x1f45db,_0x51a620){return function(_0x2316d6){if(_0x2316d6){return _0x2316d6[_0x33a5('0x2a')]()[_0x33a5('0x2b')](function(){_0x1f45db[_0x33a5('0x1e')](0xcc)[_0x33a5('0x2c')]();});}};}function handleEntityNotFound(_0x4620cd,_0x57e633){return function(_0x52f692){if(!_0x52f692){_0x4620cd[_0x33a5('0x1d')](0x194);}return _0x52f692;};}function handleError(_0x57f7c1,_0x4cb78f){_0x4cb78f=_0x4cb78f||0x1f4;return function(_0x10ce6a){logger['error'](_0x10ce6a[_0x33a5('0x2d')]);if(_0x10ce6a[_0x33a5('0x2e')]){delete _0x10ce6a[_0x33a5('0x2e')];}_0x57f7c1[_0x33a5('0x1e')](_0x4cb78f)[_0x33a5('0x2f')](_0x10ce6a);};}function getInteractionUsers(_0x50962a,_0x34dd07){return new BPromise(function(_0x12a641,_0x571ea2){try{if(_0x34dd07[_0x50962a['id']]){_0x50962a[_0x33a5('0x30')]=_[_0x33a5('0x31')](_0x34dd07[_0x50962a['id']],function(_0x40c79e){return{'id':_0x40c79e['id'],'fullname':_0x40c79e[_0x33a5('0x32')]};});}}catch(_0x21a740){_0x571ea2(_0x21a740);}_0x12a641(_0x50962a);});}function getInteractionTags(_0x271cad,_0x2a196c){return new BPromise(function(_0x4a1af1,_0x45ce0f){try{if(_0x271cad[_0x33a5('0x33')]){_0x271cad[_0x33a5('0x34')]=[];_0x271cad[_0x33a5('0x33')][_0x33a5('0x35')](',')[_0x33a5('0x36')](function(_0x139c0a){_0x271cad[_0x33a5('0x34')][_0x33a5('0x37')](_0x2a196c[_0x139c0a]);});}delete _0x271cad[_0x33a5('0x33')];}catch(_0x504162){_0x45ce0f(_0x504162);}_0x4a1af1(_0x271cad);});}function updateSmsInteraction(_0x5255b6,_0x1b2a93,_0x4d4e1b){return new BPromise(function(_0x984181,_0x25cb28){return getInteractionUsers(_0x5255b6,_0x4d4e1b)[_0x33a5('0x2b')](function(_0x138d9c){return getInteractionTags(_0x138d9c,_0x1b2a93);})[_0x33a5('0x2b')](function(_0x448a7c){_0x984181(_0x448a7c);})['catch'](function(_0x4933b5){_0x25cb28(_0x4933b5);});});}exports[_0x33a5('0x38')]=function(_0x54f29e,_0x125512){var _0x16983d={},_0x1a9954={},_0x1c26e9={'count':0x0,'rows':[]};var _0x2fad6c=_[_0x33a5('0x31')](db[_0x33a5('0x39')]['rawAttributes'],function(_0x5550af){return{'name':_0x5550af[_0x33a5('0x3a')],'type':_0x5550af[_0x33a5('0x3b')][_0x33a5('0x3c')]};});_0x1a9954[_0x33a5('0x3d')]=_['map'](_0x2fad6c,_0x33a5('0x2e'));_0x1a9954['query']=_['keys'](_0x54f29e['query']);_0x1a9954[_0x33a5('0x3e')]=_[_0x33a5('0x3f')](_0x1a9954[_0x33a5('0x3d')],_0x1a9954[_0x33a5('0x40')]);_0x16983d[_0x33a5('0x41')]=_[_0x33a5('0x3f')](_0x1a9954[_0x33a5('0x3d')],qs[_0x33a5('0x42')](_0x54f29e[_0x33a5('0x40')]['fields']));_0x16983d[_0x33a5('0x41')]=_0x16983d[_0x33a5('0x41')][_0x33a5('0x43')]?_0x16983d[_0x33a5('0x41')]:_0x1a9954[_0x33a5('0x3d')];if(!_0x54f29e[_0x33a5('0x40')][_0x33a5('0x44')](_0x33a5('0x45'))){_0x16983d[_0x33a5('0x22')]=qs['limit'](_0x54f29e[_0x33a5('0x40')]['limit']);_0x16983d['offset']=qs[_0x33a5('0x20')](_0x54f29e[_0x33a5('0x40')][_0x33a5('0x20')]);}_0x16983d['order']=qs[_0x33a5('0x46')](_0x54f29e[_0x33a5('0x40')][_0x33a5('0x46')]);_0x16983d[_0x33a5('0x47')]=qs[_0x33a5('0x3e')](_[_0x33a5('0x48')](_0x54f29e[_0x33a5('0x40')],_0x1a9954[_0x33a5('0x3e')]),_0x2fad6c);var _0x297366=[];var _0x404b01=squel[_0x33a5('0x49')]()[_0x33a5('0x4a')]('id')[_0x33a5('0x4a')](_0x33a5('0x2e'))[_0x33a5('0x4a')](_0x33a5('0x4b'))[_0x33a5('0x4c')](_0x33a5('0x4d'));var _0xd23eb=squel[_0x33a5('0x49')]()['field'](_0x33a5('0x4e'))[_0x33a5('0x4a')](_0x33a5('0x4f'))[_0x33a5('0x4a')]('ui.SmsInteractionId')[_0x33a5('0x4c')](_0x33a5('0x50'),'ui')[_0x33a5('0x51')]('users','u',_0x33a5('0x52'));var _0x4d046c=squel[_0x33a5('0x49')]()[_0x33a5('0x4c')]('sms_interactions','i')[_0x33a5('0x51')]('cm_contacts','c',_0x33a5('0x53'))[_0x33a5('0x51')](_0x33a5('0x54'),'o',_0x33a5('0x55'))[_0x33a5('0x51')](_0x33a5('0x56'),'a',_0x33a5('0x57'))['left_join'](_0x33a5('0x58'),'me','me.SmsInteractionId\x20=\x20i.id')['left_join'](_0x33a5('0x59'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x33a5('0x51')](_0x33a5('0x4d'),'t','t.id\x20=\x20it.TagId');var _0x5cba3d=squel['expr']();var _0x18e357=[];var _0x40a4e9=squel[_0x33a5('0x5a')]();var _0x2496e4;if(_0x54f29e[_0x33a5('0x40')][_0x33a5('0x5b')]){_0x2496e4=as[_0x33a5('0x5c')](_0x54f29e[_0x33a5('0x40')][_0x33a5('0x5b')]);var _0xd87a6f=_0x2496e4['sqlOperator'];for(var _0x415984=0x0;_0x415984<_0x2496e4['conditions'][_0x33a5('0x43')];_0x415984++){var _0x23b731=_0x2496e4['conditions'][_0x415984];var _0xdc5dd8='i';var _0x20cdde=_[_0x33a5('0x5d')](_0x2fad6c,[_0x33a5('0x2e'),_0x23b731[_0x33a5('0x4a')]]);if(!_0x20cdde){switch(_0x23b731[_0x33a5('0x4a')]){case _0x33a5('0x5e'):if(_0x23b731[_0x33a5('0x5f')]==0x1){_0x4d046c[_0x33a5('0x60')]('`'+_0x23b731['field']+_0x33a5('0x61'));}else{_0x4d046c['having']('`'+_0x23b731[_0x33a5('0x4a')]+_0x33a5('0x62'));}break;case _0x33a5('0x63'):if(_0x23b731[_0x33a5('0x64')]===_0x33a5('0x65')){if(_0x23b731['value']['split']('\x20')[_0x33a5('0x43')]>0x1){_0x5cba3d[_0xd87a6f]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x33a5('0x66')](_0x23b731[_0x33a5('0x5f')]),null);}else{var _0x3ffaa9='%'+_0x23b731['value']+'%';_0x5cba3d[_0xd87a6f](_0x33a5('0x67'),_0x3ffaa9,_0x3ffaa9,_0x3ffaa9);}}else{_0x20cdde=_[_0x33a5('0x5d')](_0x2fad6c,[_0x33a5('0x2e'),_0x33a5('0x68')]);_0x23b731[_0x33a5('0x4a')]=_0x33a5('0x68');_0x5f2627=as[_0x33a5('0x69')](_0xdc5dd8,_0x20cdde[_0x33a5('0x3b')],_0x23b731);_0x5cba3d[_0xd87a6f](_0x5f2627['text'],_0x5f2627[_0x33a5('0x5f')][_0x33a5('0x6a')],_0x5f2627[_0x33a5('0x5f')][_0x33a5('0x2c')]);}break;case _0x33a5('0x6b'):var _0x1e6ad1=_0x23b731[_0x33a5('0x5f')][_0x33a5('0x35')](',')['map'](function(_0x57c074){return Number(_0x57c074);});_0x1e6ad1[_0x33a5('0x36')](function(_0x3a9122){_0x40a4e9['or'](_0x33a5('0x6c'),'%,'+_0x3a9122+',%');});_0x18e357=_['union'](_0x18e357,_0x1e6ad1);break;case _0x33a5('0x6d'):if(_0x23b731[_0x33a5('0x64')]===_0x33a5('0x65')){_0x5cba3d[_0xd87a6f](_0x33a5('0x6e'),'%'+_0x23b731['value']+'%',null);}else{_0x20cdde=_['find'](_0x2fad6c,['name','UserId']);_0x23b731[_0x33a5('0x4a')]=_0x33a5('0x6f');_0x5f2627=as[_0x33a5('0x69')](_0xdc5dd8,_0x20cdde[_0x33a5('0x3b')],_0x23b731);_0x5cba3d[_0xd87a6f](_0x5f2627['text'],_0x5f2627[_0x33a5('0x5f')][_0x33a5('0x6a')],_0x5f2627[_0x33a5('0x5f')]['end']);}break;case _0x33a5('0x70'):_0x5f2627=as[_0x33a5('0x69')]('me',null,_0x23b731);_0x5cba3d[_0xd87a6f](_0x5f2627[_0x33a5('0x71')],_0x5f2627[_0x33a5('0x5f')]['start'],_0x5f2627[_0x33a5('0x5f')][_0x33a5('0x2c')]);break;}}else{var _0x5f2627=as[_0x33a5('0x69')](_0xdc5dd8,_0x20cdde[_0x33a5('0x3b')],_0x23b731);_0x5cba3d[_0xd87a6f](_0x5f2627[_0x33a5('0x71')],_0x5f2627[_0x33a5('0x5f')]['start'],_0x5f2627[_0x33a5('0x5f')]['end']);}}}else{var _0x573597=_(_0x54f29e['query'])[_0x33a5('0x72')]()[_0x33a5('0x31')](function(_0x532c0d){return _['some'](_0x2fad6c,[_0x33a5('0x2e'),_0x532c0d])?_0x532c0d:undefined;})[_0x33a5('0x73')]()[_0x33a5('0x5f')]();if(!_[_0x33a5('0x74')](_0x573597)){_0x573597[_0x33a5('0x36')](function(_0x4497e9){if(_0x4497e9===_0x33a5('0x75')){_0x4d046c[_0x33a5('0x47')](_0x33a5('0x76'),[][_0x33a5('0x77')](_0x54f29e[_0x33a5('0x40')][_0x4497e9]));}else if(_0x4497e9===_0x33a5('0x78')){var _0x165d8c=JSON[_0x33a5('0x79')](_0x54f29e[_0x33a5('0x40')][_0x4497e9])['$gte'];var _0x5a4984=JSON[_0x33a5('0x79')](_0x54f29e[_0x33a5('0x40')][_0x4497e9])['$lte'];_0x4d046c[_0x33a5('0x47')](_0x33a5('0x7a'),_0x165d8c,_0x5a4984);}else{if(_0x54f29e['query'][_0x4497e9]==='null'){_0x4d046c['where']('i.'+_0x4497e9+_0x33a5('0x7b'));}else{_0x4d046c[_0x33a5('0x47')]('i.'+_0x4497e9+'\x20=\x20?',_0x54f29e['query'][_0x4497e9]);}}});}if(_0x54f29e[_0x33a5('0x40')][_0x33a5('0x7c')]){if(_0x54f29e[_0x33a5('0x40')][_0x33a5('0x7c')]==0x1){_0x4d046c[_0x33a5('0x60')]('`unreadMessages`\x20=\x200');}else{_0x4d046c[_0x33a5('0x60')](_0x33a5('0x7d'));}}if(_0x54f29e[_0x33a5('0x40')]['tag']){_0x18e357=_[_0x33a5('0x7e')](_0x54f29e[_0x33a5('0x40')]['tag'])?_0x54f29e[_0x33a5('0x40')]['tag']:new Array(_0x54f29e[_0x33a5('0x40')]['tag']);_0x18e357['forEach'](function(_0x38112a){_0x40a4e9['or'](_0x33a5('0x6c'),'%,'+_0x38112a+',%');});}if(_0x54f29e[_0x33a5('0x40')][_0x33a5('0x7f')]){var _0x4b8036=_0x54f29e[_0x33a5('0x40')]['filter'][_0x33a5('0x80')]('\x5c','\x5c\x5c')[_0x33a5('0x80')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4b8036)){_0x5cba3d['or']('i.id\x20LIKE\x20?',_0x4b8036+'%')['or'](_0x33a5('0x81'),_0x4b8036+'%');}else{_0x5cba3d['or'](_0x33a5('0x82'),qs['getFullTextValue'](_0x4b8036))['or'](_0x33a5('0x83'),_0x4b8036+'%');}}}_0x4d046c[_0x33a5('0x47')](_0x5cba3d);_0x4d046c[_0x33a5('0x84')](_0x33a5('0x85'));var _0x3d49f4={'type':db[_0x33a5('0x86')]['QueryTypes'][_0x33a5('0x87')],'raw':!![]};var _0x31197c=_0x4d046c[_0x33a5('0x88')]();_0x31197c[_0x33a5('0x4a')](_0x33a5('0x85'));_0x31197c[_0x33a5('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x33a5('0x5e'));if(_0x16983d[_0x33a5('0x89')]){_0x16983d[_0x33a5('0x89')][_0x33a5('0x36')](function(_0x532cf6){var _0x13242c=_0x532cf6[0x0]===_0x33a5('0x8a')?_0x532cf6[0x0]:'i.'+_0x532cf6[0x0];_0x4d046c[_0x33a5('0x89')](_0x13242c,_0x532cf6[0x1]==='DESC'?![]:!![]);});}if(!_[_0x33a5('0x74')](_0x18e357)){_0x4d046c['having'](_0x40a4e9);_0x31197c['where']('t.id\x20IN\x20?',_0x18e357);}BPromise['resolve']()['then'](function(){if(!_0x2496e4){if(_0x54f29e[_0x33a5('0x40')]['SmsAccountId'])return;_0x31197c[_0x33a5('0x47')](_0x33a5('0x8b'));_0x4d046c[_0x33a5('0x47')](_0x33a5('0x8b'));return;}if(_0x54f29e[_0x33a5('0x8c')][_0x33a5('0x8d')]!==_0x33a5('0x8e'))return;return _0x54f29e['user'][_0x33a5('0x8f')]({'attributes':['id'],'raw':!![]})[_0x33a5('0x2b')](function(_0x24306b){if(_[_0x33a5('0x74')](_0x24306b)){_0x31197c['where'](_0x33a5('0x90'));_0x4d046c[_0x33a5('0x47')](_0x33a5('0x90'));}else{_0x31197c['where'](_0x33a5('0x76'),_[_0x33a5('0x31')](_0x24306b,'id'));_0x4d046c[_0x33a5('0x47')](_0x33a5('0x76'),_[_0x33a5('0x31')](_0x24306b,'id'));}});})[_0x33a5('0x2b')](function(){if(_0x54f29e['user'][_0x33a5('0x8d')]===_0x33a5('0x8e')&&!_0x2496e4&&!_0x54f29e[_0x33a5('0x40')][_0x33a5('0x75')])return[];return db[_0x33a5('0x91')][_0x33a5('0x40')](_0x31197c[_0x33a5('0x92')](),_0x3d49f4);})[_0x33a5('0x2b')](function(_0x5c0055){_0x1c26e9[_0x33a5('0x23')]=_0x5c0055[_0x33a5('0x43')];if(_0x1c26e9['count']===0x0)return[];return db['sequelize'][_0x33a5('0x40')](_0x404b01[_0x33a5('0x92')](),_0x3d49f4)[_0x33a5('0x2b')](function(_0x5e1155){_0x297366=_[_0x33a5('0x93')](_0x5e1155,'id');_0x3d49f4=_[_0x33a5('0x94')](_0x3d49f4,{'model':db[_0x33a5('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x54f29e[_0x33a5('0x40')]['fields']){_0x16983d[_0x33a5('0x41')][_0x33a5('0x36')](function(_0x58c796){_0x4d046c[_0x33a5('0x4a')]('i.'+_0x58c796);});}else{_0x4d046c[_0x33a5('0x4a')](_0x33a5('0x95'),_0x33a5('0x5e'));_0x4d046c['field'](_0x33a5('0x96'),_0x33a5('0x97'));_0x4d046c['field'](_0x33a5('0x98'),_0x33a5('0x99'));_0x4d046c[_0x33a5('0x4a')](_0x33a5('0x9a'),_0x33a5('0x8a'));_0x4d046c[_0x33a5('0x4a')](_0x33a5('0x9b'));_0x4d046c['field'](_0x33a5('0x9c'),'Contact.firstName');_0x4d046c['field'](_0x33a5('0x9d'),_0x33a5('0x9e'));_0x4d046c['field']('c.email',_0x33a5('0x9f'));_0x4d046c[_0x33a5('0x4a')]('c.phone','Contact.phone');_0x4d046c[_0x33a5('0x4a')](_0x33a5('0xa0'),_0x33a5('0xa1'));_0x4d046c['field'](_0x33a5('0xa2'),_0x33a5('0xa3'));_0x4d046c[_0x33a5('0x4a')](_0x33a5('0xa4'),'Owner.fullname');_0x4d046c[_0x33a5('0x4a')]('o.internal',_0x33a5('0xa5'));_0x4d046c[_0x33a5('0x4a')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x16983d[_0x33a5('0x22')])_0x4d046c[_0x33a5('0x22')](_0x16983d[_0x33a5('0x22')]);if(_0x16983d[_0x33a5('0x20')])_0x4d046c[_0x33a5('0x20')](_0x16983d[_0x33a5('0x20')]);return db[_0x33a5('0x91')][_0x33a5('0x40')](_0x4d046c['toString'](),_0x3d49f4);})[_0x33a5('0x2b')](function(_0xfe164c){if(_0xfe164c[_0x33a5('0x43')]>0x0)_0xd23eb['where'](_0x33a5('0xa6'),_['map'](_0xfe164c,'id'));return db[_0x33a5('0x91')]['query'](_0xd23eb['toString'](),_0x3d49f4)['then'](function(_0x105380){var _0x10539b=_['groupBy'](_0x105380,'SmsInteractionId');var _0x1970c3=[];_0xfe164c[_0x33a5('0x36')](function(_0x5575e4){_0x1970c3['push'](updateSmsInteraction(_0x5575e4,_0x297366,_0x10539b));});return BPromise[_0x33a5('0xa7')](_0x1970c3);});});})[_0x33a5('0x2b')](function(_0x57ab7a){_0x1c26e9[_0x33a5('0xa8')]=_0x57ab7a;return _0x1c26e9;})[_0x33a5('0x2b')](respondWithFilteredResult(_0x125512,_0x16983d))['catch'](handleError(_0x125512,null));};exports[_0x33a5('0xa9')]=function(_0x3f79bc,_0x49868a){var _0x1716e3={'raw':![],'where':{'id':_0x3f79bc['params']['id']}},_0x32995a={};_0x32995a[_0x33a5('0x3d')]=_[_0x33a5('0x72')](db[_0x33a5('0x39')][_0x33a5('0xaa')]);_0x32995a[_0x33a5('0x40')]=_['keys'](_0x3f79bc[_0x33a5('0x40')]);_0x32995a[_0x33a5('0x3e')]=_[_0x33a5('0x3f')](_0x32995a['model'],_0x32995a['query']);_0x1716e3[_0x33a5('0x41')]=_[_0x33a5('0x3f')](_0x32995a[_0x33a5('0x3d')],qs[_0x33a5('0x42')](_0x3f79bc[_0x33a5('0x40')][_0x33a5('0x42')]));_0x1716e3[_0x33a5('0x41')]=_0x1716e3[_0x33a5('0x41')][_0x33a5('0x43')]?_0x1716e3[_0x33a5('0x41')]:_0x32995a['model'];if(_0x3f79bc[_0x33a5('0x40')][_0x33a5('0xab')]){_0x1716e3['include']=[{'all':!![]}];}_0x1716e3=_['merge']({},_0x1716e3,_0x3f79bc['options']);return db[_0x33a5('0x39')][_0x33a5('0x5d')](_0x1716e3)[_0x33a5('0x2b')](handleEntityNotFound(_0x49868a,null))[_0x33a5('0x2b')](respondWithResult(_0x49868a,null))[_0x33a5('0xac')](handleError(_0x49868a,null));};exports['create']=function(_0x2449c9,_0xe1abc){return db[_0x33a5('0x39')][_0x33a5('0xad')](_0x2449c9[_0x33a5('0x70')],{})['then'](respondWithResult(_0xe1abc,0xc9))[_0x33a5('0xac')](handleError(_0xe1abc,null));};exports['update']=function(_0x40157c,_0xe855fd){if(_0x40157c[_0x33a5('0x70')]['id']){delete _0x40157c['body']['id'];}return db['SmsInteraction'][_0x33a5('0x5d')]({'where':{'id':_0x40157c[_0x33a5('0xae')]['id']}})[_0x33a5('0x2b')](handleEntityNotFound(_0xe855fd,null))[_0x33a5('0x2b')](saveUpdates(_0x40157c[_0x33a5('0x70')],null))['then'](respondWithResult(_0xe855fd,null))[_0x33a5('0xac')](handleError(_0xe855fd,null));};exports[_0x33a5('0x2a')]=function(_0x363a99,_0x8686e8){return db[_0x33a5('0x39')][_0x33a5('0x5d')]({'where':{'id':_0x363a99[_0x33a5('0xae')]['id']}})[_0x33a5('0x2b')](handleEntityNotFound(_0x8686e8,null))[_0x33a5('0x2b')](removeEntity(_0x8686e8,null))[_0x33a5('0xac')](handleError(_0x8686e8,null));};exports['describe']=function(_0x13a364,_0x44025a){return db[_0x33a5('0x39')][_0x33a5('0xaf')]()['then'](respondWithResult(_0x44025a,null))[_0x33a5('0xac')](handleError(_0x44025a,null));};exports[_0x33a5('0xb0')]=function(_0x46c887,_0x311e89,_0x3018f6){return db['SmsMessage'][_0x33a5('0x5d')]({'where':{'id':_0x46c887[_0x33a5('0xae')]['id']}})[_0x33a5('0x2b')](handleEntityNotFound(_0x311e89,null))[_0x33a5('0x2b')](function(_0x5713ed){if(_0x5713ed){return _0x5713ed['addMessage'](_0x46c887['body'][_0x33a5('0xb1')],_[_0x33a5('0xb2')](_0x46c887['body'],[_0x33a5('0xb1'),'id'])||{});}})['then'](respondWithResult(_0x311e89,null))['catch'](handleError(_0x311e89,null));};exports[_0x33a5('0xb3')]=function(_0x367362,_0x416478,_0x4c8932){var _0x36bd86={'raw':![],'where':{}};var _0x23c0a0={};var _0x4a6cd8={'count':0x0,'rows':[]};return db[_0x33a5('0x39')][_0x33a5('0xb4')]({'where':{'id':_0x367362[_0x33a5('0xae')]['id']}})[_0x33a5('0x2b')](handleEntityNotFound(_0x416478,null))['then'](function(_0x5636c1){if(_0x5636c1){_0x23c0a0[_0x33a5('0x3d')]=_['keys'](db[_0x33a5('0xb5')][_0x33a5('0xaa')]);_0x23c0a0[_0x33a5('0x40')]=_['keys'](_0x367362[_0x33a5('0x40')]);_0x23c0a0[_0x33a5('0x3e')]=_['intersection'](_0x23c0a0['model'],_0x23c0a0[_0x33a5('0x40')]);_0x36bd86['attributes']=_[_0x33a5('0x3f')](_0x23c0a0[_0x33a5('0x3d')],qs[_0x33a5('0x42')](_0x367362['query']['fields']));_0x36bd86[_0x33a5('0x41')]=_0x36bd86[_0x33a5('0x41')]['length']?_0x36bd86[_0x33a5('0x41')]:_0x23c0a0[_0x33a5('0x3d')];if(!_0x367362[_0x33a5('0x40')]['hasOwnProperty'](_0x33a5('0x45'))){_0x36bd86[_0x33a5('0x22')]=qs[_0x33a5('0x22')](_0x367362['query']['limit']);_0x36bd86['offset']=qs[_0x33a5('0x20')](_0x367362[_0x33a5('0x40')][_0x33a5('0x20')]);}_0x36bd86['order']=qs['sort'](_0x367362[_0x33a5('0x40')][_0x33a5('0x46')]);_0x36bd86[_0x33a5('0x47')]=qs[_0x33a5('0x3e')](_[_0x33a5('0x48')](_0x367362[_0x33a5('0x40')],_0x23c0a0[_0x33a5('0x3e')]));_0x36bd86[_0x33a5('0x47')][_0x33a5('0xb6')]=_0x5636c1['id'];if(_0x367362[_0x33a5('0x40')]['filter']){_0x36bd86[_0x33a5('0x47')]=_[_0x33a5('0x94')](_0x36bd86[_0x33a5('0x47')],{'$or':_[_0x33a5('0x31')](_0x36bd86[_0x33a5('0x41')],function(_0x45a232){var _0x3a9368={};_0x3a9368[_0x45a232]={'$like':'%'+_0x367362[_0x33a5('0x40')][_0x33a5('0x7f')]+'%'};return _0x3a9368;})});}if(_0x367362[_0x33a5('0x40')][_0x33a5('0xb7')]){var _0x588b11=_0x367362[_0x33a5('0x40')]['$gte'][_0x33a5('0x35')](',');var _0x8d6b42={};_0x8d6b42[_0x588b11[0x0]]={'$gte':moment(_0x588b11[0x1])['format'](_0x33a5('0xb8'))};_0x36bd86['where']=_[_0x33a5('0x94')](_0x36bd86[_0x33a5('0x47')],_0x8d6b42);}_0x36bd86=_[_0x33a5('0x94')]({},_0x36bd86,_0x367362[_0x33a5('0xb9')]);return db[_0x33a5('0xb5')][_0x33a5('0x23')]({'where':_0x36bd86[_0x33a5('0x47')]})[_0x33a5('0x2b')](function(_0x5eaee6){_0x4a6cd8['count']=_0x5eaee6;if(_0x367362[_0x33a5('0x40')]['includeAll']){_0x36bd86[_0x33a5('0xba')]=[{'all':!![]}];}return db[_0x33a5('0xb5')][_0x33a5('0xbb')](_0x36bd86);})[_0x33a5('0x2b')](function(_0x48f616){_0x4a6cd8[_0x33a5('0xa8')]=_0x48f616;return _0x4a6cd8;});}})[_0x33a5('0x2b')](respondWithFilteredResult(_0x416478,_0x36bd86))[_0x33a5('0xac')](handleError(_0x416478,null));};exports[_0x33a5('0xbc')]=function(_0xe98009,_0x4112e3,_0x319387){return db['SmsInteraction'][_0x33a5('0x5d')]({'where':{'id':_0xe98009['params']['id']}})['then'](handleEntityNotFound(_0x4112e3,null))[_0x33a5('0x2b')](function(_0x4ea867){if(_0x4ea867){return _0x4ea867[_0x33a5('0xbd')](_0xe98009[_0x33a5('0x70')][_0x33a5('0xb1')],_['omit'](_0xe98009['body'],[_0x33a5('0xb1'),'id'])||{})[_0x33a5('0xbe')](function(){return db['Tag'][_0x33a5('0xbb')]({'attributes':['id',_0x33a5('0x2e'),'color'],'where':{'id':_0xe98009[_0x33a5('0x70')]['ids']}});})[_0x33a5('0x2b')](function(_0xe119ba){socket['emit'](_0x33a5('0xbf'),{'id':Number(_0xe98009[_0x33a5('0xae')]['id']),'tags':_0xe119ba||[]});return{'id':Number(_0xe98009['params']['id']),'tags':_0xe119ba||[]};});}})[_0x33a5('0x2b')](respondWithResult(_0x4112e3,null))[_0x33a5('0xac')](handleError(_0x4112e3,null));};exports[_0x33a5('0xc0')]=function(_0x2c4211,_0x43b127,_0xcf3bc8){return db['SmsInteraction'][_0x33a5('0x5d')]({'where':{'id':_0x2c4211[_0x33a5('0xae')]['id']}})[_0x33a5('0x2b')](handleEntityNotFound(_0x43b127,null))[_0x33a5('0x2b')](function(_0x5dd307){if(_0x5dd307){return _0x5dd307[_0x33a5('0xc0')](_0x2c4211['query']['ids']);}})[_0x33a5('0x2b')](respondWithStatusCode(_0x43b127,null))['catch'](handleError(_0x43b127,null));};exports[_0x33a5('0xc1')]=function(_0x390d15,_0x55cec0){var _0x46e8d1=moment()[_0x33a5('0xc2')]()[_0x33a5('0x92')]();var _0x3dc510=path[_0x33a5('0xc3')](config[_0x33a5('0xc4')],'server',_0x33a5('0xc5'),_0x33a5('0xc6'));var _0x4e9c42=path[_0x33a5('0xc3')](config[_0x33a5('0xc4')],_0x33a5('0xc7'),_0x33a5('0xc5'),_0x33a5('0xc8'));var _0x5ad8bb=path[_0x33a5('0xc3')](_0x3dc510,_0x46e8d1);var _0x12bf1f=util[_0x33a5('0xc9')](_0x33a5('0xca'),_0x390d15['params']['id'],_0x46e8d1);var _0x54de22=path[_0x33a5('0xc3')](_0x3dc510,_0x12bf1f);var _0x59c45d=[];_0x59c45d[_0x33a5('0x37')]({'model':db[_0x33a5('0x6d')],'as':'User','attributes':['id',_0x33a5('0x32')],'raw':!![]});_0x59c45d[_0x33a5('0x37')]({'model':db['CmContact'],'as':_0x33a5('0x63'),'attributes':['id',_0x33a5('0xcb'),'lastName'],'raw':!![]});var _0x18a9d1=[{'model':db[_0x33a5('0xb5')],'as':'Messages','attributes':['id','body',_0x33a5('0x78'),_0x33a5('0xcc'),_0x33a5('0xcd'),_0x33a5('0x7c')],'include':_0x59c45d}];_0x18a9d1[_0x33a5('0x37')]({'model':db[_0x33a5('0xce')],'as':_0x33a5('0xcf'),'attributes':['id',_0x33a5('0x2e')]});_0x18a9d1[_0x33a5('0x37')]({'model':db[_0x33a5('0x6d')],'as':_0x33a5('0xd0'),'attributes':['id',_0x33a5('0x32')]});return db[_0x33a5('0x39')][_0x33a5('0x5d')]({'where':{'id':_0x390d15['params']['id']},'include':_0x18a9d1})[_0x33a5('0x2b')](handleEntityNotFound(_0x55cec0,null))['then'](function(_0x5522ba){if(_0x5522ba){var _0x429d64=_0x5522ba['get']({'plain':!![]});fs['mkdirSync'](_0x5ad8bb);var _0x24fe1d={'channel':_0x33a5('0xd1'),'account':_0x429d64[_0x33a5('0xcf')][_0x33a5('0x2e')],'agent':_0x429d64[_0x33a5('0xd0')]?_0x429d64[_0x33a5('0xd0')][_0x33a5('0x32')]:_0x33a5('0xd2'),'createdAt':moment(_0x429d64['createdAt'])[_0x33a5('0xc9')]('YYYY-MM-DD\x20HH:mm:ss')[_0x33a5('0x92')](),'closedAt':_0x429d64[_0x33a5('0xd3')]?moment(_0x429d64[_0x33a5('0xd4')])[_0x33a5('0xc9')]('YYYY-MM-DD\x20HH:mm:ss')[_0x33a5('0x92')]():'','disposition':_0x429d64[_0x33a5('0xd5')],'messages':_(_0x429d64[_0x33a5('0xd6')])[_0x33a5('0x7f')]({'secret':![]})[_0x33a5('0x31')](function(_0x1f4b06){return{'date':moment(_0x1f4b06[_0x33a5('0x78')])[_0x33a5('0xc9')]('YYYY-MM-DD\x20HH:mm:ss')[_0x33a5('0x92')](),'sender':_0x1f4b06[_0x33a5('0xcc')]==='out'?_0x1f4b06[_0x33a5('0x6d')]?_0x1f4b06[_0x33a5('0x6d')][_0x33a5('0x32')]:_0x33a5('0xd7'):_0x1f4b06[_0x33a5('0x63')]['firstName']+(_0x1f4b06[_0x33a5('0x63')]['lastName']?'\x20'+_0x1f4b06['Contact']['lastName']:''),'body':_0x1f4b06[_0x33a5('0x70')],'direction':_0x1f4b06[_0x33a5('0xcc')]===_0x33a5('0xd8')?'A':'C','secret':_0x1f4b06[_0x33a5('0xcd')],'read':_0x1f4b06[_0x33a5('0x7c')]};})[_0x33a5('0x5f')]()};return ejs[_0x33a5('0xd9')](path[_0x33a5('0xc3')](config['root'],_0x33a5('0xc7'),_0x33a5('0xda'),_0x33a5('0xdb')),{'interaction':_0x24fe1d})['then'](function(_0x87986e){var _0x5ebf92=path[_0x33a5('0xc3')](_0x5ad8bb,_0x33a5('0xdc')+_0x429d64['id']+'-'+_0x46e8d1+_0x33a5('0xdd'));var _0xf19c45={'path':_0x5ebf92,'channel':_0x33a5('0xd1'),'interactionId':_0x429d64['id']};return pdf[_0x33a5('0xde')](_0x87986e,_0xf19c45);})['then'](function(){return new BPromise(function(_0x5a1452,_0x45f1bc){zipdir(_0x5ad8bb,{'saveTo':_0x54de22},function(_0x455c60,_0x5c8afc){if(_0x455c60)return _0x45f1bc(_0x455c60);return _0x5a1452(_0x5c8afc);});})[_0x33a5('0x2b')](function(){return new BPromise(function(_0x194bf7,_0x49765b){rimraf(_0x5ad8bb,function(_0x3eee78){if(_0x3eee78)_0x49765b(_0x3eee78);return _0x194bf7();});});})[_0x33a5('0x2b')](function(){return _0x55cec0[_0x33a5('0xc1')](_0x54de22,_0x12bf1f,function(_0x180509){if(_0x180509){console['log'](_0x33a5('0xdf'),_0x180509);}else{fs[_0x33a5('0xe0')](_0x54de22);}});});});}else{return _0x55cec0[_0x33a5('0x1d')](0xc8);}})[_0x33a5('0xac')](handleError(_0x55cec0,null));}; \ No newline at end of file +var _0xc69f=['field','color','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','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','tools_tags','expr','search','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20>\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','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?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','toString','sequelize','merge','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.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','rawAttributes','include','options','catch','params','describe','SmsMessage','addMessage','ids','omit','getMessages','pick','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','emit','smsInteractionTags:save','removeTags','download','join','server','files','tmp','attachments','transcript-%d-%s.zip','User','Contact','firstName','lastName','createdAt','direction','SmsAccount','Owner','get','Sms','N.A.','closed','closedAt','disposition','Messages','out','System','secret','renderFile','root','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','index','SmsInteraction','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','select'];(function(_0x4ddc7e,_0xcb9b8){var _0xfbf0ec=function(_0x32b673){while(--_0x32b673){_0x4ddc7e['push'](_0x4ddc7e['shift']());}};_0xfbf0ec(++_0xcb9b8);}(_0xc69f,0x179));var _0xfc69=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xc69f[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0xfc69('0x0'));var rimraf=require(_0xfc69('0x1'));var zipdir=require(_0xfc69('0x2'));var jsonpatch=require(_0xfc69('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfc69('0x4'));var Mustache=require(_0xfc69('0x5'));var util=require(_0xfc69('0x6'));var path=require(_0xfc69('0x7'));var sox=require(_0xfc69('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xfc69('0x9'));var jsforce=require(_0xfc69('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xfc69('0xb'));var querystring=require(_0xfc69('0xc'));var Papa=require(_0xfc69('0xd'));var Redis=require(_0xfc69('0xe'));var authService=require(_0xfc69('0xf'));var qs=require(_0xfc69('0x10'));var as=require(_0xfc69('0x11'));var pdf=require(_0xfc69('0x12'));var hardwareService=require(_0xfc69('0x13'));var logger=require('../../config/logger')(_0xfc69('0x14'));var utils=require('../../config/utils');var config=require(_0xfc69('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xfc69('0x16')]=_['defaults'](config['redis'],{'host':_0xfc69('0x17'),'port':0x18eb});var socket=require(_0xfc69('0x18'))(new Redis(config[_0xfc69('0x16')]));require(_0xfc69('0x19'))[_0xfc69('0x1a')](socket);function respondWithStatusCode(_0x37b2ac,_0x789a4f){_0x789a4f=_0x789a4f||0xcc;return function(_0x23424f){if(_0x23424f){return _0x37b2ac['sendStatus'](_0x789a4f);}return _0x37b2ac[_0xfc69('0x1b')](_0x789a4f)[_0xfc69('0x1c')]();};}function respondWithResult(_0x5d94d4,_0x50642a){_0x50642a=_0x50642a||0xc8;return function(_0xbc43c3){if(_0xbc43c3){return _0x5d94d4[_0xfc69('0x1b')](_0x50642a)[_0xfc69('0x1d')](_0xbc43c3);}};}function respondWithFilteredResult(_0xc60651,_0x5c3d13){return function(_0x2285f5){if(_0x2285f5){var _0x343429=typeof _0x5c3d13[_0xfc69('0x1e')]==='undefined'&&typeof _0x5c3d13[_0xfc69('0x1f')]===_0xfc69('0x20');var _0x4ce135=_0x2285f5[_0xfc69('0x21')];var _0x2d574c=_0x343429?0x0:_0x5c3d13[_0xfc69('0x1e')];var _0x49713f=_0x343429?_0x2285f5[_0xfc69('0x21')]:_0x5c3d13['offset']+_0x5c3d13[_0xfc69('0x1f')];var _0x3912a3;if(_0x49713f>=_0x4ce135){_0x49713f=_0x4ce135;_0x3912a3=0xc8;}else{_0x3912a3=0xce;}_0xc60651[_0xfc69('0x1b')](_0x3912a3);return _0xc60651[_0xfc69('0x22')]('Content-Range',_0x2d574c+'-'+_0x49713f+'/'+_0x4ce135)[_0xfc69('0x1d')](_0x2285f5);}return null;};}function patchUpdates(_0x505f50){return function(_0x520f48){try{jsonpatch[_0xfc69('0x23')](_0x520f48,_0x505f50,!![]);}catch(_0x503d40){return BPromise[_0xfc69('0x24')](_0x503d40);}return _0x520f48[_0xfc69('0x25')]();};}function saveUpdates(_0x436287,_0x482ea9){return function(_0x43eb61){if(_0x43eb61){return _0x43eb61[_0xfc69('0x26')](_0x436287)[_0xfc69('0x27')](function(_0x3c0b3e){return _0x3c0b3e;});}return null;};}function removeEntity(_0x279b28,_0x45aabe){return function(_0x13f50e){if(_0x13f50e){return _0x13f50e[_0xfc69('0x28')]()[_0xfc69('0x27')](function(){_0x279b28['status'](0xcc)[_0xfc69('0x1c')]();});}};}function handleEntityNotFound(_0x545c16,_0xf4c7cb){return function(_0xe892e1){if(!_0xe892e1){_0x545c16[_0xfc69('0x29')](0x194);}return _0xe892e1;};}function handleError(_0x44938f,_0x25799e){_0x25799e=_0x25799e||0x1f4;return function(_0x38c6f1){logger['error'](_0x38c6f1[_0xfc69('0x2a')]);if(_0x38c6f1[_0xfc69('0x2b')]){delete _0x38c6f1['name'];}_0x44938f['status'](_0x25799e)[_0xfc69('0x2c')](_0x38c6f1);};}function getInteractionUsers(_0x311909,_0x1092bb){return new BPromise(function(_0x2d732f,_0x5d749e){try{if(_0x1092bb[_0x311909['id']]){_0x311909[_0xfc69('0x2d')]=_[_0xfc69('0x2e')](_0x1092bb[_0x311909['id']],function(_0x509616){return{'id':_0x509616['id'],'fullname':_0x509616[_0xfc69('0x2f')]};});}}catch(_0x2efbc8){_0x5d749e(_0x2efbc8);}_0x2d732f(_0x311909);});}function getInteractionTags(_0x574a81,_0x431059){return new BPromise(function(_0x45e40d,_0x27e952){try{if(_0x574a81[_0xfc69('0x30')]){_0x574a81['Tags']=[];_0x574a81[_0xfc69('0x30')][_0xfc69('0x31')](',')[_0xfc69('0x32')](function(_0x18d3a3){_0x574a81[_0xfc69('0x33')][_0xfc69('0x34')](_0x431059[_0x18d3a3]);});}delete _0x574a81[_0xfc69('0x30')];}catch(_0x4e6286){_0x27e952(_0x4e6286);}_0x45e40d(_0x574a81);});}function updateSmsInteraction(_0x10e05c,_0x389b9a,_0x309182){return new BPromise(function(_0x31b6e2,_0x15c7fb){return getInteractionUsers(_0x10e05c,_0x309182)[_0xfc69('0x27')](function(_0x2680e7){return getInteractionTags(_0x2680e7,_0x389b9a);})[_0xfc69('0x27')](function(_0x1679d4){_0x31b6e2(_0x1679d4);})['catch'](function(_0x503566){_0x15c7fb(_0x503566);});});}exports[_0xfc69('0x35')]=function(_0x124775,_0x134ac1){var _0x90c1b7={},_0x1ebecf={},_0x47ce9c={'count':0x0,'rows':[]};var _0x2229d1=_[_0xfc69('0x2e')](db[_0xfc69('0x36')]['rawAttributes'],function(_0x5eed53){return{'name':_0x5eed53['fieldName'],'type':_0x5eed53[_0xfc69('0x37')]['key']};});_0x1ebecf[_0xfc69('0x38')]=_[_0xfc69('0x2e')](_0x2229d1,_0xfc69('0x2b'));_0x1ebecf[_0xfc69('0x39')]=_[_0xfc69('0x3a')](_0x124775[_0xfc69('0x39')]);_0x1ebecf[_0xfc69('0x3b')]=_['intersection'](_0x1ebecf['model'],_0x1ebecf[_0xfc69('0x39')]);_0x90c1b7['attributes']=_[_0xfc69('0x3c')](_0x1ebecf[_0xfc69('0x38')],qs['fields'](_0x124775[_0xfc69('0x39')][_0xfc69('0x3d')]));_0x90c1b7[_0xfc69('0x3e')]=_0x90c1b7[_0xfc69('0x3e')]['length']?_0x90c1b7[_0xfc69('0x3e')]:_0x1ebecf[_0xfc69('0x38')];if(!_0x124775[_0xfc69('0x39')][_0xfc69('0x3f')](_0xfc69('0x40'))){_0x90c1b7[_0xfc69('0x1f')]=qs[_0xfc69('0x1f')](_0x124775[_0xfc69('0x39')]['limit']);_0x90c1b7[_0xfc69('0x1e')]=qs[_0xfc69('0x1e')](_0x124775['query']['offset']);}_0x90c1b7[_0xfc69('0x41')]=qs[_0xfc69('0x42')](_0x124775[_0xfc69('0x39')]['sort']);_0x90c1b7[_0xfc69('0x43')]=qs[_0xfc69('0x3b')](_['pick'](_0x124775[_0xfc69('0x39')],_0x1ebecf['filters']),_0x2229d1);var _0x112e21=[];var _0x5965cc=squel[_0xfc69('0x44')]()[_0xfc69('0x45')]('id')[_0xfc69('0x45')](_0xfc69('0x2b'))[_0xfc69('0x45')](_0xfc69('0x46'))['from']('tools_tags');var _0x2f0914=squel['select']()[_0xfc69('0x45')]('u.id')[_0xfc69('0x45')]('u.fullname')[_0xfc69('0x45')](_0xfc69('0x47'))[_0xfc69('0x48')](_0xfc69('0x49'),'ui')[_0xfc69('0x4a')](_0xfc69('0x4b'),'u','u.id\x20=\x20ui.UserId');var _0x48f120=squel[_0xfc69('0x44')]()[_0xfc69('0x48')]('sms_interactions','i')[_0xfc69('0x4a')](_0xfc69('0x4c'),'c',_0xfc69('0x4d'))[_0xfc69('0x4a')](_0xfc69('0x4b'),'o',_0xfc69('0x4e'))[_0xfc69('0x4a')](_0xfc69('0x4f'),'a',_0xfc69('0x50'))[_0xfc69('0x4a')](_0xfc69('0x51'),'me',_0xfc69('0x52'))[_0xfc69('0x4a')](_0xfc69('0x53'),'it',_0xfc69('0x54'))[_0xfc69('0x4a')](_0xfc69('0x55'),'t','t.id\x20=\x20it.TagId');var _0x2f18fd=squel[_0xfc69('0x56')]();var _0x4d3592=[];var _0x960a23=squel[_0xfc69('0x56')]();var _0x32e5db;if(_0x124775[_0xfc69('0x39')][_0xfc69('0x57')]){_0x32e5db=as['parseSearch'](_0x124775[_0xfc69('0x39')][_0xfc69('0x57')]);var _0x3cc073=_0x32e5db[_0xfc69('0x58')];for(var _0x299f42=0x0;_0x299f42<_0x32e5db[_0xfc69('0x59')][_0xfc69('0x5a')];_0x299f42++){var _0x3d40ed=_0x32e5db[_0xfc69('0x59')][_0x299f42];var _0x40f112='i';var _0xabb0e9=_[_0xfc69('0x5b')](_0x2229d1,['name',_0x3d40ed[_0xfc69('0x45')]]);if(!_0xabb0e9){switch(_0x3d40ed[_0xfc69('0x45')]){case _0xfc69('0x5c'):if(_0x3d40ed[_0xfc69('0x5d')]==0x1){_0x48f120[_0xfc69('0x5e')]('`'+_0x3d40ed['field']+'`\x20=\x200');}else{_0x48f120['having']('`'+_0x3d40ed[_0xfc69('0x45')]+_0xfc69('0x5f'));}break;case'Contact':if(_0x3d40ed['operator']===_0xfc69('0x60')){if(_0x3d40ed[_0xfc69('0x5d')]['split']('\x20')[_0xfc69('0x5a')]>0x1){_0x2f18fd[_0x3cc073](_0xfc69('0x61'),qs[_0xfc69('0x62')](_0x3d40ed[_0xfc69('0x5d')]),null);}else{var _0x310f84='%'+_0x3d40ed[_0xfc69('0x5d')]+'%';_0x2f18fd[_0x3cc073]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x310f84,_0x310f84,_0x310f84);}}else{_0xabb0e9=_[_0xfc69('0x5b')](_0x2229d1,['name',_0xfc69('0x63')]);_0x3d40ed[_0xfc69('0x45')]=_0xfc69('0x63');_0x2912d0=as[_0xfc69('0x64')](_0x40f112,_0xabb0e9[_0xfc69('0x37')],_0x3d40ed);_0x2f18fd[_0x3cc073](_0x2912d0['text'],_0x2912d0[_0xfc69('0x5d')][_0xfc69('0x65')],_0x2912d0[_0xfc69('0x5d')]['end']);}break;case _0xfc69('0x66'):var _0x1e3a65=_0x3d40ed[_0xfc69('0x5d')][_0xfc69('0x31')](',')['map'](function(_0x577dbb){return Number(_0x577dbb);});_0x1e3a65[_0xfc69('0x32')](function(_0x10955a){_0x960a23['or'](_0xfc69('0x67'),'%,'+_0x10955a+',%');});_0x4d3592=_['union'](_0x4d3592,_0x1e3a65);break;case'User':if(_0x3d40ed[_0xfc69('0x68')]===_0xfc69('0x60')){_0x2f18fd[_0x3cc073](_0xfc69('0x69'),'%'+_0x3d40ed[_0xfc69('0x5d')]+'%',null);}else{_0xabb0e9=_[_0xfc69('0x5b')](_0x2229d1,['name',_0xfc69('0x6a')]);_0x3d40ed[_0xfc69('0x45')]=_0xfc69('0x6a');_0x2912d0=as[_0xfc69('0x64')](_0x40f112,_0xabb0e9[_0xfc69('0x37')],_0x3d40ed);_0x2f18fd[_0x3cc073](_0x2912d0[_0xfc69('0x6b')],_0x2912d0[_0xfc69('0x5d')][_0xfc69('0x65')],_0x2912d0['value'][_0xfc69('0x1c')]);}break;case _0xfc69('0x6c'):_0x2912d0=as[_0xfc69('0x64')]('me',null,_0x3d40ed);_0x2f18fd[_0x3cc073](_0x2912d0[_0xfc69('0x6b')],_0x2912d0[_0xfc69('0x5d')][_0xfc69('0x65')],_0x2912d0[_0xfc69('0x5d')]['end']);break;}}else{var _0x2912d0=as[_0xfc69('0x64')](_0x40f112,_0xabb0e9['type'],_0x3d40ed);_0x2f18fd[_0x3cc073](_0x2912d0[_0xfc69('0x6b')],_0x2912d0[_0xfc69('0x5d')][_0xfc69('0x65')],_0x2912d0[_0xfc69('0x5d')][_0xfc69('0x1c')]);}}}else{var _0x35d609=_(_0x124775[_0xfc69('0x39')])[_0xfc69('0x3a')]()[_0xfc69('0x2e')](function(_0xa1ec09){return _[_0xfc69('0x6d')](_0x2229d1,['name',_0xa1ec09])?_0xa1ec09:undefined;})['compact']()['value']();if(!_[_0xfc69('0x6e')](_0x35d609)){_0x35d609[_0xfc69('0x32')](function(_0xe0fc8f){if(_0xe0fc8f===_0xfc69('0x6f')){_0x48f120[_0xfc69('0x43')](_0xfc69('0x70'),[]['concat'](_0x124775['query'][_0xe0fc8f]));}else if(_0xe0fc8f==='createdAt'){var _0x428a2a=JSON[_0xfc69('0x71')](_0x124775[_0xfc69('0x39')][_0xe0fc8f])[_0xfc69('0x72')];var _0x29d716=JSON['parse'](_0x124775[_0xfc69('0x39')][_0xe0fc8f])['$lte'];_0x48f120[_0xfc69('0x43')](_0xfc69('0x73'),_0x428a2a,_0x29d716);}else{if(_0x124775['query'][_0xe0fc8f]===_0xfc69('0x74')){_0x48f120[_0xfc69('0x43')]('i.'+_0xe0fc8f+'\x20IS\x20NULL');}else{_0x48f120['where']('i.'+_0xe0fc8f+_0xfc69('0x75'),_0x124775[_0xfc69('0x39')][_0xe0fc8f]);}}});}if(_0x124775[_0xfc69('0x39')][_0xfc69('0x76')]){if(_0x124775[_0xfc69('0x39')]['read']==0x1){_0x48f120[_0xfc69('0x5e')](_0xfc69('0x77'));}else{_0x48f120['having']('`unreadMessages`\x20>\x200');}}if(_0x124775[_0xfc69('0x39')][_0xfc69('0x78')]){_0x4d3592=_['isArray'](_0x124775[_0xfc69('0x39')][_0xfc69('0x78')])?_0x124775['query'][_0xfc69('0x78')]:new Array(_0x124775[_0xfc69('0x39')][_0xfc69('0x78')]);_0x4d3592['forEach'](function(_0xd2bdf6){_0x960a23['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd2bdf6+',%');});}if(_0x124775[_0xfc69('0x39')][_0xfc69('0x79')]){var _0x1feea6=_0x124775[_0xfc69('0x39')][_0xfc69('0x79')][_0xfc69('0x7a')]('\x5c','\x5c\x5c')[_0xfc69('0x7a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1feea6)){_0x2f18fd['or'](_0xfc69('0x7b'),_0x1feea6+'%')['or'](_0xfc69('0x7c'),_0x1feea6+'%');}else{_0x2f18fd['or'](_0xfc69('0x7d'),qs['getFullTextValue'](_0x1feea6))['or'](_0xfc69('0x7e'),_0x1feea6+'%');}}}_0x48f120[_0xfc69('0x43')](_0x2f18fd);_0x48f120['group'](_0xfc69('0x7f'));var _0x23701a={'type':db[_0xfc69('0x80')][_0xfc69('0x81')][_0xfc69('0x82')],'raw':!![]};var _0x3be313=_0x48f120[_0xfc69('0x83')]();_0x3be313[_0xfc69('0x45')](_0xfc69('0x7f'));_0x3be313[_0xfc69('0x45')](_0xfc69('0x84'),_0xfc69('0x5c'));if(_0x90c1b7['order']){_0x90c1b7[_0xfc69('0x41')][_0xfc69('0x32')](function(_0x53c014){var _0x24b2eb=_0x53c014[0x0]===_0xfc69('0x85')?_0x53c014[0x0]:'i.'+_0x53c014[0x0];_0x48f120[_0xfc69('0x41')](_0x24b2eb,_0x53c014[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x4d3592)){_0x48f120['having'](_0x960a23);_0x3be313['where'](_0xfc69('0x86'),_0x4d3592);}BPromise['resolve']()[_0xfc69('0x27')](function(){if(!_0x32e5db){if(_0x124775[_0xfc69('0x39')][_0xfc69('0x6f')])return;_0x3be313['where'](_0xfc69('0x87'));_0x48f120[_0xfc69('0x43')](_0xfc69('0x87'));return;}if(_0x124775[_0xfc69('0x88')][_0xfc69('0x89')]!=='agent')return;return _0x124775['user'][_0xfc69('0x8a')]({'attributes':['id'],'raw':!![]})[_0xfc69('0x27')](function(_0x3bf781){if(_[_0xfc69('0x6e')](_0x3bf781)){_0x3be313[_0xfc69('0x43')](_0xfc69('0x8b'));_0x48f120[_0xfc69('0x43')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x3be313[_0xfc69('0x43')]('i.SmsAccountId\x20IN\x20?',_[_0xfc69('0x2e')](_0x3bf781,'id'));_0x48f120[_0xfc69('0x43')](_0xfc69('0x70'),_[_0xfc69('0x2e')](_0x3bf781,'id'));}});})[_0xfc69('0x27')](function(){if(_0x124775[_0xfc69('0x88')]['role']===_0xfc69('0x8c')&&!_0x32e5db&&!_0x124775[_0xfc69('0x39')][_0xfc69('0x6f')])return[];return db['sequelize'][_0xfc69('0x39')](_0x3be313[_0xfc69('0x8d')](),_0x23701a);})[_0xfc69('0x27')](function(_0x43b20a){_0x47ce9c['count']=_0x43b20a[_0xfc69('0x5a')];if(_0x47ce9c['count']===0x0)return[];return db[_0xfc69('0x8e')]['query'](_0x5965cc[_0xfc69('0x8d')](),_0x23701a)[_0xfc69('0x27')](function(_0x313540){_0x112e21=_['keyBy'](_0x313540,'id');_0x23701a=_[_0xfc69('0x8f')](_0x23701a,{'model':db[_0xfc69('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x124775[_0xfc69('0x39')][_0xfc69('0x3d')]){_0x90c1b7[_0xfc69('0x3e')][_0xfc69('0x32')](function(_0xa62dde){_0x48f120[_0xfc69('0x45')]('i.'+_0xa62dde);});}else{_0x48f120[_0xfc69('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xfc69('0x5c'));_0x48f120[_0xfc69('0x45')](_0xfc69('0x90'),_0xfc69('0x91'));_0x48f120[_0xfc69('0x45')](_0xfc69('0x92'),'Account.mandatoryDisposition');_0x48f120[_0xfc69('0x45')](_0xfc69('0x93'),_0xfc69('0x85'));_0x48f120[_0xfc69('0x45')](_0xfc69('0x94'));_0x48f120[_0xfc69('0x45')]('c.firstName',_0xfc69('0x95'));_0x48f120[_0xfc69('0x45')](_0xfc69('0x96'),_0xfc69('0x97'));_0x48f120[_0xfc69('0x45')](_0xfc69('0x98'),_0xfc69('0x99'));_0x48f120['field']('c.phone',_0xfc69('0x9a'));_0x48f120[_0xfc69('0x45')]('c.mobile','Contact.mobile');_0x48f120[_0xfc69('0x45')](_0xfc69('0x9b'),_0xfc69('0x9c'));_0x48f120[_0xfc69('0x45')](_0xfc69('0x9d'),_0xfc69('0x9e'));_0x48f120[_0xfc69('0x45')](_0xfc69('0x9f'),_0xfc69('0xa0'));_0x48f120[_0xfc69('0x45')](_0xfc69('0xa1'),'TagIds');}if(_0x90c1b7[_0xfc69('0x1f')])_0x48f120[_0xfc69('0x1f')](_0x90c1b7['limit']);if(_0x90c1b7['offset'])_0x48f120[_0xfc69('0x1e')](_0x90c1b7['offset']);return db[_0xfc69('0x8e')][_0xfc69('0x39')](_0x48f120[_0xfc69('0x8d')](),_0x23701a);})[_0xfc69('0x27')](function(_0x3837be){if(_0x3837be[_0xfc69('0x5a')]>0x0)_0x2f0914[_0xfc69('0x43')](_0xfc69('0xa2'),_[_0xfc69('0x2e')](_0x3837be,'id'));return db[_0xfc69('0x8e')][_0xfc69('0x39')](_0x2f0914['toString'](),_0x23701a)[_0xfc69('0x27')](function(_0x1ee36c){var _0x22c32b=_[_0xfc69('0xa3')](_0x1ee36c,_0xfc69('0xa4'));var _0x18f645=[];_0x3837be[_0xfc69('0x32')](function(_0x80356e){_0x18f645['push'](updateSmsInteraction(_0x80356e,_0x112e21,_0x22c32b));});return BPromise[_0xfc69('0xa5')](_0x18f645);});});})[_0xfc69('0x27')](function(_0x54b4fe){_0x47ce9c[_0xfc69('0xa6')]=_0x54b4fe;return _0x47ce9c;})[_0xfc69('0x27')](respondWithFilteredResult(_0x134ac1,_0x90c1b7))['catch'](handleError(_0x134ac1,null));};exports[_0xfc69('0xa7')]=function(_0x1b5dc9,_0x330a79){var _0x5ead54={'raw':![],'where':{'id':_0x1b5dc9['params']['id']}},_0x4f1ff2={};_0x4f1ff2[_0xfc69('0x38')]=_[_0xfc69('0x3a')](db[_0xfc69('0x36')][_0xfc69('0xa8')]);_0x4f1ff2['query']=_[_0xfc69('0x3a')](_0x1b5dc9[_0xfc69('0x39')]);_0x4f1ff2[_0xfc69('0x3b')]=_['intersection'](_0x4f1ff2['model'],_0x4f1ff2[_0xfc69('0x39')]);_0x5ead54[_0xfc69('0x3e')]=_[_0xfc69('0x3c')](_0x4f1ff2[_0xfc69('0x38')],qs[_0xfc69('0x3d')](_0x1b5dc9[_0xfc69('0x39')][_0xfc69('0x3d')]));_0x5ead54[_0xfc69('0x3e')]=_0x5ead54[_0xfc69('0x3e')]['length']?_0x5ead54[_0xfc69('0x3e')]:_0x4f1ff2[_0xfc69('0x38')];if(_0x1b5dc9[_0xfc69('0x39')]['includeAll']){_0x5ead54[_0xfc69('0xa9')]=[{'all':!![]}];}_0x5ead54=_[_0xfc69('0x8f')]({},_0x5ead54,_0x1b5dc9[_0xfc69('0xaa')]);return db[_0xfc69('0x36')][_0xfc69('0x5b')](_0x5ead54)[_0xfc69('0x27')](handleEntityNotFound(_0x330a79,null))[_0xfc69('0x27')](respondWithResult(_0x330a79,null))['catch'](handleError(_0x330a79,null));};exports['create']=function(_0x3530eb,_0x506d8c){return db[_0xfc69('0x36')]['create'](_0x3530eb[_0xfc69('0x6c')],{})[_0xfc69('0x27')](respondWithResult(_0x506d8c,0xc9))[_0xfc69('0xab')](handleError(_0x506d8c,null));};exports['update']=function(_0x4d7482,_0x4a2f46){if(_0x4d7482['body']['id']){delete _0x4d7482[_0xfc69('0x6c')]['id'];}return db[_0xfc69('0x36')][_0xfc69('0x5b')]({'where':{'id':_0x4d7482[_0xfc69('0xac')]['id']}})[_0xfc69('0x27')](handleEntityNotFound(_0x4a2f46,null))[_0xfc69('0x27')](saveUpdates(_0x4d7482['body'],null))['then'](respondWithResult(_0x4a2f46,null))['catch'](handleError(_0x4a2f46,null));};exports[_0xfc69('0x28')]=function(_0x19f411,_0x2a75f5){return db[_0xfc69('0x36')][_0xfc69('0x5b')]({'where':{'id':_0x19f411[_0xfc69('0xac')]['id']}})[_0xfc69('0x27')](handleEntityNotFound(_0x2a75f5,null))['then'](removeEntity(_0x2a75f5,null))[_0xfc69('0xab')](handleError(_0x2a75f5,null));};exports[_0xfc69('0xad')]=function(_0x2b1815,_0x1e2012){return db['SmsInteraction'][_0xfc69('0xad')]()[_0xfc69('0x27')](respondWithResult(_0x1e2012,null))[_0xfc69('0xab')](handleError(_0x1e2012,null));};exports['addMessage']=function(_0x5f7b70,_0x267c02,_0xa86178){return db[_0xfc69('0xae')]['find']({'where':{'id':_0x5f7b70[_0xfc69('0xac')]['id']}})[_0xfc69('0x27')](handleEntityNotFound(_0x267c02,null))[_0xfc69('0x27')](function(_0x25ab92){if(_0x25ab92){return _0x25ab92[_0xfc69('0xaf')](_0x5f7b70[_0xfc69('0x6c')][_0xfc69('0xb0')],_[_0xfc69('0xb1')](_0x5f7b70[_0xfc69('0x6c')],['ids','id'])||{});}})[_0xfc69('0x27')](respondWithResult(_0x267c02,null))[_0xfc69('0xab')](handleError(_0x267c02,null));};exports[_0xfc69('0xb2')]=function(_0x59c82,_0x41d1ea,_0x5254f1){var _0x158fd9={'raw':![],'where':{}};var _0x4f68b4={};var _0x4d1f19={'count':0x0,'rows':[]};return db[_0xfc69('0x36')]['findOne']({'where':{'id':_0x59c82[_0xfc69('0xac')]['id']}})[_0xfc69('0x27')](handleEntityNotFound(_0x41d1ea,null))[_0xfc69('0x27')](function(_0x21b353){if(_0x21b353){_0x4f68b4[_0xfc69('0x38')]=_[_0xfc69('0x3a')](db[_0xfc69('0xae')]['rawAttributes']);_0x4f68b4['query']=_['keys'](_0x59c82[_0xfc69('0x39')]);_0x4f68b4[_0xfc69('0x3b')]=_['intersection'](_0x4f68b4['model'],_0x4f68b4[_0xfc69('0x39')]);_0x158fd9[_0xfc69('0x3e')]=_[_0xfc69('0x3c')](_0x4f68b4[_0xfc69('0x38')],qs[_0xfc69('0x3d')](_0x59c82[_0xfc69('0x39')][_0xfc69('0x3d')]));_0x158fd9[_0xfc69('0x3e')]=_0x158fd9['attributes'][_0xfc69('0x5a')]?_0x158fd9[_0xfc69('0x3e')]:_0x4f68b4[_0xfc69('0x38')];if(!_0x59c82[_0xfc69('0x39')][_0xfc69('0x3f')](_0xfc69('0x40'))){_0x158fd9[_0xfc69('0x1f')]=qs[_0xfc69('0x1f')](_0x59c82[_0xfc69('0x39')][_0xfc69('0x1f')]);_0x158fd9['offset']=qs[_0xfc69('0x1e')](_0x59c82[_0xfc69('0x39')][_0xfc69('0x1e')]);}_0x158fd9[_0xfc69('0x41')]=qs[_0xfc69('0x42')](_0x59c82[_0xfc69('0x39')]['sort']);_0x158fd9['where']=qs['filters'](_[_0xfc69('0xb3')](_0x59c82[_0xfc69('0x39')],_0x4f68b4['filters']));_0x158fd9[_0xfc69('0x43')][_0xfc69('0xa4')]=_0x21b353['id'];if(_0x59c82[_0xfc69('0x39')]['filter']){_0x158fd9[_0xfc69('0x43')]=_[_0xfc69('0x8f')](_0x158fd9['where'],{'$or':_[_0xfc69('0x2e')](_0x158fd9[_0xfc69('0x3e')],function(_0x43ece4){var _0x18eb8e={};_0x18eb8e[_0x43ece4]={'$like':'%'+_0x59c82[_0xfc69('0x39')][_0xfc69('0x79')]+'%'};return _0x18eb8e;})});}if(_0x59c82['query']['$gte']){var _0x5d6f65=_0x59c82[_0xfc69('0x39')][_0xfc69('0x72')][_0xfc69('0x31')](',');var _0x5754ac={};_0x5754ac[_0x5d6f65[0x0]]={'$gte':moment(_0x5d6f65[0x1])[_0xfc69('0xb4')](_0xfc69('0xb5'))};_0x158fd9[_0xfc69('0x43')]=_[_0xfc69('0x8f')](_0x158fd9[_0xfc69('0x43')],_0x5754ac);}_0x158fd9=_[_0xfc69('0x8f')]({},_0x158fd9,_0x59c82['options']);return db[_0xfc69('0xae')]['count']({'where':_0x158fd9[_0xfc69('0x43')]})[_0xfc69('0x27')](function(_0x90c80e){_0x4d1f19[_0xfc69('0x21')]=_0x90c80e;if(_0x59c82[_0xfc69('0x39')][_0xfc69('0xb6')]){_0x158fd9['include']=[{'all':!![]}];}return db[_0xfc69('0xae')][_0xfc69('0xb7')](_0x158fd9);})[_0xfc69('0x27')](function(_0x2be069){_0x4d1f19[_0xfc69('0xa6')]=_0x2be069;return _0x4d1f19;});}})[_0xfc69('0x27')](respondWithFilteredResult(_0x41d1ea,_0x158fd9))[_0xfc69('0xab')](handleError(_0x41d1ea,null));};exports[_0xfc69('0xb8')]=function(_0x26f819,_0x316322,_0x13d3ac){return db[_0xfc69('0x36')]['find']({'where':{'id':_0x26f819[_0xfc69('0xac')]['id']}})['then'](handleEntityNotFound(_0x316322,null))['then'](function(_0x4cb43e){if(_0x4cb43e){return _0x4cb43e['setTags'](_0x26f819['body'][_0xfc69('0xb0')],_['omit'](_0x26f819['body'],[_0xfc69('0xb0'),'id'])||{})['spread'](function(){return db['Tag'][_0xfc69('0xb7')]({'attributes':['id','name','color'],'where':{'id':_0x26f819[_0xfc69('0x6c')]['ids']}});})[_0xfc69('0x27')](function(_0x2ba7f4){socket[_0xfc69('0xb9')](_0xfc69('0xba'),{'id':Number(_0x26f819[_0xfc69('0xac')]['id']),'tags':_0x2ba7f4||[]});return{'id':Number(_0x26f819[_0xfc69('0xac')]['id']),'tags':_0x2ba7f4||[]};});}})[_0xfc69('0x27')](respondWithResult(_0x316322,null))[_0xfc69('0xab')](handleError(_0x316322,null));};exports[_0xfc69('0xbb')]=function(_0x4c78f4,_0x1df5c0,_0x167fc8){return db[_0xfc69('0x36')][_0xfc69('0x5b')]({'where':{'id':_0x4c78f4[_0xfc69('0xac')]['id']}})[_0xfc69('0x27')](handleEntityNotFound(_0x1df5c0,null))[_0xfc69('0x27')](function(_0x3a6229){if(_0x3a6229){return _0x3a6229[_0xfc69('0xbb')](_0x4c78f4[_0xfc69('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x1df5c0,null))[_0xfc69('0xab')](handleError(_0x1df5c0,null));};exports[_0xfc69('0xbc')]=function(_0x231be8,_0xe3eef6){var _0x2b10ec=moment()['unix']()[_0xfc69('0x8d')]();var _0x305aad=path[_0xfc69('0xbd')](config['root'],_0xfc69('0xbe'),_0xfc69('0xbf'),_0xfc69('0xc0'));var _0x1fbc10=path[_0xfc69('0xbd')](config['root'],_0xfc69('0xbe'),_0xfc69('0xbf'),_0xfc69('0xc1'));var _0x78d43a=path['join'](_0x305aad,_0x2b10ec);var _0x3af189=util[_0xfc69('0xb4')](_0xfc69('0xc2'),_0x231be8['params']['id'],_0x2b10ec);var _0x2fdd45=path['join'](_0x305aad,_0x3af189);var _0x5535b1=[];_0x5535b1['push']({'model':db[_0xfc69('0xc3')],'as':_0xfc69('0xc3'),'attributes':['id',_0xfc69('0x2f')],'raw':!![]});_0x5535b1[_0xfc69('0x34')]({'model':db['CmContact'],'as':_0xfc69('0xc4'),'attributes':['id',_0xfc69('0xc5'),_0xfc69('0xc6')],'raw':!![]});var _0x11a444=[{'model':db[_0xfc69('0xae')],'as':'Messages','attributes':['id',_0xfc69('0x6c'),_0xfc69('0xc7'),_0xfc69('0xc8'),'secret',_0xfc69('0x76')],'include':_0x5535b1}];_0x11a444[_0xfc69('0x34')]({'model':db[_0xfc69('0xc9')],'as':'Account','attributes':['id',_0xfc69('0x2b')]});_0x11a444[_0xfc69('0x34')]({'model':db[_0xfc69('0xc3')],'as':_0xfc69('0xca'),'attributes':['id',_0xfc69('0x2f')]});return db['SmsInteraction'][_0xfc69('0x5b')]({'where':{'id':_0x231be8['params']['id']},'include':_0x11a444})[_0xfc69('0x27')](handleEntityNotFound(_0xe3eef6,null))[_0xfc69('0x27')](function(_0x6b1ebe){if(_0x6b1ebe){var _0x458871=_0x6b1ebe[_0xfc69('0xcb')]({'plain':!![]});fs['mkdirSync'](_0x78d43a);var _0x2ef8c0={'channel':_0xfc69('0xcc'),'account':_0x458871['Account'][_0xfc69('0x2b')],'agent':_0x458871[_0xfc69('0xca')]?_0x458871[_0xfc69('0xca')][_0xfc69('0x2f')]:_0xfc69('0xcd'),'createdAt':moment(_0x458871[_0xfc69('0xc7')])[_0xfc69('0xb4')](_0xfc69('0xb5'))['toString'](),'closedAt':_0x458871[_0xfc69('0xce')]?moment(_0x458871[_0xfc69('0xcf')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xfc69('0x8d')]():'','disposition':_0x458871[_0xfc69('0xd0')],'messages':_(_0x458871[_0xfc69('0xd1')])['filter']({'secret':![]})[_0xfc69('0x2e')](function(_0x16a8d2){return{'date':moment(_0x16a8d2[_0xfc69('0xc7')])[_0xfc69('0xb4')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfc69('0x8d')](),'sender':_0x16a8d2['direction']===_0xfc69('0xd2')?_0x16a8d2[_0xfc69('0xc3')]?_0x16a8d2[_0xfc69('0xc3')][_0xfc69('0x2f')]:_0xfc69('0xd3'):_0x16a8d2[_0xfc69('0xc4')][_0xfc69('0xc5')]+(_0x16a8d2[_0xfc69('0xc4')][_0xfc69('0xc6')]?'\x20'+_0x16a8d2[_0xfc69('0xc4')][_0xfc69('0xc6')]:''),'body':_0x16a8d2[_0xfc69('0x6c')],'direction':_0x16a8d2['direction']==='out'?'A':'C','secret':_0x16a8d2[_0xfc69('0xd4')],'read':_0x16a8d2['read']};})[_0xfc69('0x5d')]()};return ejs[_0xfc69('0xd5')](path['join'](config[_0xfc69('0xd6')],'server',_0xfc69('0xd7'),_0xfc69('0xd8')),{'interaction':_0x2ef8c0})['then'](function(_0x167645){var _0x561ae2=path[_0xfc69('0xbd')](_0x78d43a,_0xfc69('0xd9')+_0x458871['id']+'-'+_0x2b10ec+_0xfc69('0xda'));var _0x4c2731={'path':_0x561ae2,'channel':_0xfc69('0xcc'),'interactionId':_0x458871['id']};return pdf[_0xfc69('0xdb')](_0x167645,_0x4c2731);})[_0xfc69('0x27')](function(){return new BPromise(function(_0x2387ea,_0x28b464){zipdir(_0x78d43a,{'saveTo':_0x2fdd45},function(_0x1fa226,_0x4c1e32){if(_0x1fa226)return _0x28b464(_0x1fa226);return _0x2387ea(_0x4c1e32);});})[_0xfc69('0x27')](function(){return new BPromise(function(_0x15c797,_0x2565c3){rimraf(_0x78d43a,function(_0x59ba5d){if(_0x59ba5d)_0x2565c3(_0x59ba5d);return _0x15c797();});});})[_0xfc69('0x27')](function(){return _0xe3eef6[_0xfc69('0xbc')](_0x2fdd45,_0x3af189,function(_0xf3a9e0){if(_0xf3a9e0){console[_0xfc69('0xdc')](_0xfc69('0xdd'),_0xf3a9e0);}else{fs[_0xfc69('0xde')](_0x2fdd45);}});});});}else{return _0xe3eef6[_0xfc69('0x29')](0xc8);}})[_0xfc69('0xab')](handleError(_0xe3eef6,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 14d3ac2..e996434 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 _0x2272=['findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x2272,0xd8));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x2227('0x0'));var SmsInteraction=require(_0x2227('0x1'))['db'][_0x2227('0x2')];var SmsMessage=require(_0x2227('0x1'))['db'][_0x2227('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2227('0x4'),'afterUpdate':_0x2227('0x5'),'afterDestroy':_0x2227('0x6')};function emitEvent(_0x4c17c2){return function(_0x4ebde3,_0x1e5a8a,_0x3b8661){_0x4ebde3[_0x2227('0x7')]({'attributes':['id'],'raw':!![]})[_0x2227('0x8')](function(_0xaec623){_0x4ebde3[_0x2227('0x9')](_0x2227('0xa'),_0xaec623[_0x2227('0xb')](function(_0x18094d){return{'id':_0x18094d['id']};}));return SmsMessage[_0x2227('0xc')]({'where':{'SmsInteractionId':_0x4ebde3['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x799370){_0x4ebde3['setDataValue'](_0x2227('0xd'),_0x799370[_0x2227('0xe')]);SmsInteractionEvents[_0x2227('0xf')](_0x4c17c2+':'+_0x4ebde3['id'],_0x4ebde3);SmsInteractionEvents[_0x2227('0xf')](_0x4c17c2,_0x4ebde3);_0x3b8661(null);})[_0x2227('0x10')](_0x3b8661(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x2227('0x11')](e,emitEvent(event));}}module[_0x2227('0x12')]=SmsInteractionEvents; \ No newline at end of file +var _0x4888=['../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','getUsers','then','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x53371d,_0x5b86c3){var _0x5e4f4b=function(_0x522e5c){while(--_0x522e5c){_0x53371d['push'](_0x53371d['shift']());}};_0x5e4f4b(++_0x5b86c3);}(_0x4888,0x198));var _0x8488=function(_0x474f47,_0x2303b7){_0x474f47=_0x474f47-0x0;var _0x21bfe6=_0x4888[_0x474f47];return _0x21bfe6;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x8488('0x0'))['db'][_0x8488('0x1')];var SmsMessage=require(_0x8488('0x0'))['db'][_0x8488('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8488('0x3')](0x0);var events={'afterCreate':_0x8488('0x4'),'afterUpdate':_0x8488('0x5'),'afterDestroy':'remove'};function emitEvent(_0x267093){return function(_0xf45c3f,_0x1a97f4,_0x421292){_0xf45c3f[_0x8488('0x6')]({'attributes':['id'],'raw':!![]})[_0x8488('0x7')](function(_0x5250a1){_0xf45c3f['setDataValue']('Users',_0x5250a1['map'](function(_0x151528){return{'id':_0x151528['id']};}));return SmsMessage[_0x8488('0x8')]({'where':{'SmsInteractionId':_0xf45c3f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x19c994){_0xf45c3f[_0x8488('0x9')](_0x8488('0xa'),_0x19c994[_0x8488('0xb')]);SmsInteractionEvents['emit'](_0x267093+':'+_0xf45c3f['id'],_0xf45c3f);SmsInteractionEvents[_0x8488('0xc')](_0x267093,_0xf45c3f);_0x421292(null);})[_0x8488('0xd')](_0x421292(null));};}for(var e in events){if(events[_0x8488('0xe')](e)){var event=events[e];SmsInteraction[_0x8488('0xf')](e,emitEvent(event));}}module[_0x8488('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 18fd59d..9bc4c24 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 _0x02fd=['SmsInteraction','sms_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x02fd,0x131));var _0xd02f=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x02fd[_0x455c6c];return _0x488242;};'use strict';var _=require(_0xd02f('0x0'));var util=require(_0xd02f('0x1'));var logger=require(_0xd02f('0x2'))(_0xd02f('0x3'));var moment=require(_0xd02f('0x4'));var BPromise=require('bluebird');var rp=require(_0xd02f('0x5'));var fs=require('fs');var path=require(_0xd02f('0x6'));var rimraf=require(_0xd02f('0x7'));var config=require(_0xd02f('0x8'));var attributes=require(_0xd02f('0x9'));module['exports']=function(_0x54c771,_0xb87f24){return _0x54c771['define'](_0xd02f('0xa'),attributes,{'tableName':_0xd02f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c7239,_0x5254c4,_0x13d18d){if(_0x4c7239[_0xd02f('0xc')]('closed')){_0x4c7239[_0xd02f('0xd')]=moment()['format'](_0xd02f('0xe'));}_0x13d18d(null,_0x4c7239);}}});}; \ No newline at end of file +var _0xb154=['SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./smsInteraction.attributes','define'];(function(_0x278319,_0x266d41){var _0x5e4b28=function(_0x124b0d){while(--_0x124b0d){_0x278319['push'](_0x278319['shift']());}};_0x5e4b28(++_0x266d41);}(_0xb154,0x1c1));var _0x4b15=function(_0x5e48c7,_0xa195e8){_0x5e48c7=_0x5e48c7-0x0;var _0x4b1285=_0xb154[_0x5e48c7];return _0x4b1285;};'use strict';var _=require(_0x4b15('0x0'));var util=require(_0x4b15('0x1'));var logger=require('../../config/logger')(_0x4b15('0x2'));var moment=require(_0x4b15('0x3'));var BPromise=require(_0x4b15('0x4'));var rp=require(_0x4b15('0x5'));var fs=require('fs');var path=require(_0x4b15('0x6'));var rimraf=require('rimraf');var config=require(_0x4b15('0x7'));var attributes=require(_0x4b15('0x8'));module['exports']=function(_0x4c7bd7,_0xef1df4){return _0x4c7bd7[_0x4b15('0x9')](_0x4b15('0xa'),attributes,{'tableName':_0x4b15('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1441bf,_0x168840,_0x405e32){if(_0x1441bf[_0x4b15('0xc')](_0x4b15('0xd'))){_0x1441bf[_0x4b15('0xe')]=moment()[_0x4b15('0xf')](_0x4b15('0x10'));}_0x405e32(null,_0x1441bf);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index c2f9e3d..214e965 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 _0xaba8=['AddTagsToSmsInteraction','find','where','addTags','body','ids','omit','AddTags','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateSmsInteraction','SmsInteraction','options','attributes','limit'];(function(_0x53bf34,_0xa21daa){var _0x39bf45=function(_0x38fa7e){while(--_0x38fa7e){_0x53bf34['push'](_0x53bf34['shift']());}};_0x39bf45(++_0xa21daa);}(_0xaba8,0x98));var _0x8aba=function(_0x10db1e,_0x51b7e3){_0x10db1e=_0x10db1e-0x0;var _0x2dddc5=_0xaba8[_0x10db1e];return _0x2dddc5;};'use strict';var _=require('lodash');var util=require(_0x8aba('0x0'));var moment=require(_0x8aba('0x1'));var BPromise=require(_0x8aba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aba('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8aba('0x4'));var logger=require(_0x8aba('0x5'))(_0x8aba('0x6'));var config=require(_0x8aba('0x7'));var jayson=require(_0x8aba('0x8'));var client=jayson['client'][_0x8aba('0x9')]({'port':0x232a});config[_0x8aba('0xa')]=_['defaults'](config[_0x8aba('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8aba('0xb'))(new Redis(config[_0x8aba('0xa')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x27c0dc,_0x5850a7,_0x50459e){return new BPromise(function(_0xae1f6d,_0x908b2b){return client['request'](_0x27c0dc,_0x50459e)[_0x8aba('0xc')](function(_0x1d71da){logger[_0x8aba('0xd')](_0x8aba('0xe'),_0x5850a7,_0x8aba('0xf'));logger[_0x8aba('0x10')](_0x8aba('0x11'),_0x5850a7,_0x8aba('0xf'),JSON[_0x8aba('0x12')](_0x1d71da));if(_0x1d71da[_0x8aba('0x13')]){if(_0x1d71da[_0x8aba('0x13')][_0x8aba('0x14')]===0x1f4){logger[_0x8aba('0x13')](_0x8aba('0xe'),_0x5850a7,_0x1d71da[_0x8aba('0x13')][_0x8aba('0x15')]);return _0x908b2b(_0x1d71da['error'][_0x8aba('0x15')]);}logger[_0x8aba('0x13')](_0x8aba('0xe'),_0x5850a7,_0x1d71da[_0x8aba('0x13')][_0x8aba('0x15')]);return _0xae1f6d(_0x1d71da[_0x8aba('0x13')][_0x8aba('0x15')]);}else{logger['info'](_0x8aba('0xe'),_0x5850a7,_0x8aba('0xf'));_0xae1f6d(_0x1d71da['result']['message']);}})[_0x8aba('0x16')](function(_0x47f0e4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x5850a7,_0x47f0e4);_0x908b2b(_0x47f0e4);});});}exports[_0x8aba('0x17')]=function(_0x3696d9){var _0x5d8819=this;return new Promise(function(_0x3f9d50,_0x1c688b){return db[_0x8aba('0x18')]['update'](_0x3696d9['body'],{'raw':_0x3696d9[_0x8aba('0x19')]?_0x3696d9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3696d9[_0x8aba('0x19')]?_0x3696d9['options']['where']||null:null,'attributes':_0x3696d9['options']?_0x3696d9[_0x8aba('0x19')][_0x8aba('0x1a')]||null:null,'limit':_0x3696d9[_0x8aba('0x19')]?_0x3696d9[_0x8aba('0x19')][_0x8aba('0x1b')]||null:null})[_0x8aba('0xc')](function(_0x2234ad){logger[_0x8aba('0xd')](_0x8aba('0x17'),_0x3696d9);logger[_0x8aba('0x10')]('UpdateSmsInteraction',_0x3696d9,JSON[_0x8aba('0x12')](_0x2234ad));_0x3f9d50(_0x2234ad);})[_0x8aba('0x16')](function(_0x26c948){logger[_0x8aba('0x13')](_0x8aba('0x17'),_0x26c948[_0x8aba('0x15')],_0x3696d9);_0x1c688b(_0x5d8819[_0x8aba('0x13')](0x1f4,_0x26c948['message']));});});};exports[_0x8aba('0x1c')]=function(_0x4f0619){return new Promise(function(_0x150ee,_0x381b87){return db[_0x8aba('0x18')][_0x8aba('0x1d')]({'where':_0x4f0619[_0x8aba('0x19')]?_0x4f0619['options'][_0x8aba('0x1e')]||null:null})[_0x8aba('0xc')](function(_0x1fdd4f){if(_0x1fdd4f){return _0x1fdd4f[_0x8aba('0x1f')](_0x4f0619[_0x8aba('0x20')][_0x8aba('0x21')],_[_0x8aba('0x22')](_0x4f0619[_0x8aba('0x20')],[_0x8aba('0x21'),'id'])||{});}})['spread'](function(_0x2fbff){logger['info'](_0x8aba('0x23'),_0x4f0619);logger['debug'](_0x8aba('0x23'),_0x4f0619,JSON['stringify'](_0x2fbff));_0x150ee(_0x2fbff);})[_0x8aba('0x16')](function(_0x4b5051){logger[_0x8aba('0x13')]('AddTags',_0x4b5051[_0x8aba('0x15')],_0x4f0619);_0x381b87(_this[_0x8aba('0x13')](0x1f4,_0x4b5051['message']));});});}; \ No newline at end of file +var _0xca74=['./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SmsInteraction','update','body','options','raw','where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','ids','omit','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','defaults','redis','localhost','socket.io-emitter'];(function(_0x1be52a,_0x5ec0b7){var _0x535ec4=function(_0x1e6b65){while(--_0x1e6b65){_0x1be52a['push'](_0x1be52a['shift']());}};_0x535ec4(++_0x5ec0b7);}(_0xca74,0xea));var _0x4ca7=function(_0x22fc1d,_0x5b8ee1){_0x22fc1d=_0x22fc1d-0x0;var _0x29e032=_0xca74[_0x22fc1d];return _0x29e032;};'use strict';var _=require(_0x4ca7('0x0'));var util=require(_0x4ca7('0x1'));var moment=require(_0x4ca7('0x2'));var BPromise=require('bluebird');var rs=require(_0x4ca7('0x3'));var fs=require('fs');var Redis=require(_0x4ca7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ca7('0x5'));var logger=require('../../config/logger')(_0x4ca7('0x6'));var config=require('../../config/environment');var jayson=require(_0x4ca7('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x4ca7('0x8')](config[_0x4ca7('0x9')],{'host':_0x4ca7('0xa'),'port':0x18eb});var socket=require(_0x4ca7('0xb'))(new Redis(config['redis']));require(_0x4ca7('0xc'))[_0x4ca7('0xd')](socket);function respondWithRpcPromise(_0x4f3e76,_0x2c527c,_0x3b9540){return new BPromise(function(_0x42db0d,_0x5642fc){return client[_0x4ca7('0xe')](_0x4f3e76,_0x3b9540)[_0x4ca7('0xf')](function(_0x59d3ed){logger['info'](_0x4ca7('0x10'),_0x2c527c,_0x4ca7('0x11'));logger[_0x4ca7('0x12')](_0x4ca7('0x13'),_0x2c527c,_0x4ca7('0x11'),JSON[_0x4ca7('0x14')](_0x59d3ed));if(_0x59d3ed[_0x4ca7('0x15')]){if(_0x59d3ed[_0x4ca7('0x15')][_0x4ca7('0x16')]===0x1f4){logger[_0x4ca7('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x2c527c,_0x59d3ed[_0x4ca7('0x15')]['message']);return _0x5642fc(_0x59d3ed[_0x4ca7('0x15')][_0x4ca7('0x17')]);}logger[_0x4ca7('0x15')](_0x4ca7('0x10'),_0x2c527c,_0x59d3ed[_0x4ca7('0x15')][_0x4ca7('0x17')]);return _0x42db0d(_0x59d3ed[_0x4ca7('0x15')]['message']);}else{logger[_0x4ca7('0x18')](_0x4ca7('0x10'),_0x2c527c,'request\x20sent');_0x42db0d(_0x59d3ed[_0x4ca7('0x19')][_0x4ca7('0x17')]);}})[_0x4ca7('0x1a')](function(_0x3d299d){logger['error'](_0x4ca7('0x10'),_0x2c527c,_0x3d299d);_0x5642fc(_0x3d299d);});});}exports['UpdateSmsInteraction']=function(_0x345903){var _0x20511c=this;return new Promise(function(_0x4e475e,_0x49f1dc){return db[_0x4ca7('0x1b')][_0x4ca7('0x1c')](_0x345903[_0x4ca7('0x1d')],{'raw':_0x345903['options']?_0x345903[_0x4ca7('0x1e')][_0x4ca7('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x345903[_0x4ca7('0x1e')]?_0x345903[_0x4ca7('0x1e')][_0x4ca7('0x20')]||null:null,'attributes':_0x345903[_0x4ca7('0x1e')]?_0x345903[_0x4ca7('0x1e')][_0x4ca7('0x21')]||null:null,'limit':_0x345903[_0x4ca7('0x1e')]?_0x345903[_0x4ca7('0x1e')][_0x4ca7('0x22')]||null:null})[_0x4ca7('0xf')](function(_0x2583f6){logger[_0x4ca7('0x18')]('UpdateSmsInteraction',_0x345903);logger[_0x4ca7('0x12')](_0x4ca7('0x23'),_0x345903,JSON[_0x4ca7('0x14')](_0x2583f6));_0x4e475e(_0x2583f6);})[_0x4ca7('0x1a')](function(_0x486d4c){logger[_0x4ca7('0x15')](_0x4ca7('0x23'),_0x486d4c['message'],_0x345903);_0x49f1dc(_0x20511c[_0x4ca7('0x15')](0x1f4,_0x486d4c['message']));});});};exports[_0x4ca7('0x24')]=function(_0x388910){return new Promise(function(_0x1df61d,_0x15c9e8){return db[_0x4ca7('0x1b')][_0x4ca7('0x25')]({'where':_0x388910[_0x4ca7('0x1e')]?_0x388910[_0x4ca7('0x1e')]['where']||null:null})[_0x4ca7('0xf')](function(_0x1b07d0){if(_0x1b07d0){return _0x1b07d0['addTags'](_0x388910[_0x4ca7('0x1d')][_0x4ca7('0x26')],_[_0x4ca7('0x27')](_0x388910[_0x4ca7('0x1d')],[_0x4ca7('0x26'),'id'])||{});}})['spread'](function(_0x457def){logger[_0x4ca7('0x18')](_0x4ca7('0x28'),_0x388910);logger[_0x4ca7('0x12')]('AddTags',_0x388910,JSON[_0x4ca7('0x14')](_0x457def));_0x1df61d(_0x457def);})[_0x4ca7('0x1a')](function(_0x41a256){logger[_0x4ca7('0x15')](_0x4ca7('0x28'),_0x41a256[_0x4ca7('0x17')],_0x388910);_0x15c9e8(_this[_0x4ca7('0x15')](0x1f4,_0x41a256[_0x4ca7('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index e679bae..51c5a5e 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 _0x14e0=['removeListener','register','./smsInteraction.events','save','update','emit'];(function(_0x29a7b0,_0x32bb3d){var _0x3d839c=function(_0x5cf55d){while(--_0x5cf55d){_0x29a7b0['push'](_0x29a7b0['shift']());}};_0x3d839c(++_0x32bb3d);}(_0x14e0,0x1b8));var _0x014e=function(_0x2525f1,_0x47034f){_0x2525f1=_0x2525f1-0x0;var _0x13c1b5=_0x14e0[_0x2525f1];return _0x13c1b5;};'use strict';var SmsInteractionEvents=require(_0x014e('0x0'));var events=[_0x014e('0x1'),'remove',_0x014e('0x2')];function createListener(_0x1ff3ad,_0x2b6f4e){return function(_0x5f45cd){_0x2b6f4e[_0x014e('0x3')](_0x1ff3ad,_0x5f45cd);};}function removeListener(_0x6324eb,_0x593456){return function(){SmsInteractionEvents[_0x014e('0x4')](_0x6324eb,_0x593456);};}exports[_0x014e('0x5')]=function(_0x419e4d){for(var _0x18325f=0x0,_0x5515d5=events['length'];_0x18325f<_0x5515d5;_0x18325f++){var _0x51dc12=events[_0x18325f];var _0xe7bc72=createListener('smsInteraction:'+_0x51dc12,_0x419e4d);SmsInteractionEvents['on'](_0x51dc12,_0xe7bc72);}}; \ No newline at end of file +var _0x81c8=['update','smsInteraction:','save','remove'];(function(_0x4db75d,_0x111380){var _0x596539=function(_0x2408c5){while(--_0x2408c5){_0x4db75d['push'](_0x4db75d['shift']());}};_0x596539(++_0x111380);}(_0x81c8,0x7e));var _0x881c=function(_0x336bd1,_0x51aae8){_0x336bd1=_0x336bd1-0x0;var _0x477429=_0x81c8[_0x336bd1];return _0x477429;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x881c('0x0'),_0x881c('0x1'),_0x881c('0x2')];function createListener(_0x35ecec,_0x12276c){return function(_0x9b9e86){_0x12276c['emit'](_0x35ecec,_0x9b9e86);};}function removeListener(_0x2ccbce,_0x37a6df){return function(){SmsInteractionEvents['removeListener'](_0x2ccbce,_0x37a6df);};}exports['register']=function(_0x3c26e8){for(var _0x3e6c3a=0x0,_0x46c49c=events['length'];_0x3e6c3a<_0x46c49c;_0x3e6c3a++){var _0x1648e4=events[_0x3e6c3a];var _0x4c988c=createListener(_0x881c('0x3')+_0x1648e4,_0x3c26e8);SmsInteractionEvents['on'](_0x1648e4,_0x4c988c);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index ecf3cdc..8658190 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 _0x0715=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','/:id','update','/:id/accept','reject','exports','util','path','connect-timeout','express'];(function(_0x3ee926,_0x837d2a){var _0x45831c=function(_0x154d63){while(--_0x154d63){_0x3ee926['push'](_0x3ee926['shift']());}};_0x45831c(++_0x837d2a);}(_0x0715,0x1f4));var _0x5071=function(_0x31d4fd,_0x1a5783){_0x31d4fd=_0x31d4fd-0x0;var _0x32860e=_0x0715[_0x31d4fd];return _0x32860e;};'use strict';var multer=require('multer');var util=require(_0x5071('0x0'));var path=require(_0x5071('0x1'));var timeout=require(_0x5071('0x2'));var express=require(_0x5071('0x3'));var router=express[_0x5071('0x4')]();var fs_extra=require(_0x5071('0x5'));var auth=require(_0x5071('0x6'));var interaction=require(_0x5071('0x7'));var config=require('../../config/environment');var controller=require(_0x5071('0x8'));router[_0x5071('0x9')]('/',auth[_0x5071('0xa')](),controller[_0x5071('0xb')]);router[_0x5071('0x9')](_0x5071('0xc'),auth[_0x5071('0xa')](),controller[_0x5071('0xd')]);router[_0x5071('0x9')]('/:id',auth[_0x5071('0xa')](),controller[_0x5071('0xe')]);router[_0x5071('0xf')]('/',auth[_0x5071('0xa')](),interaction[_0x5071('0x10')](_0x5071('0x11'),_0x5071('0x12')),controller[_0x5071('0x13')]);router[_0x5071('0xf')](_0x5071('0x14'),controller[_0x5071('0x15')]);router[_0x5071('0x16')](_0x5071('0x17'),auth['isAuthenticated'](),controller[_0x5071('0x18')]);router[_0x5071('0x16')](_0x5071('0x19'),auth[_0x5071('0xa')](),controller['accept']);router['put']('/:id/reject',auth[_0x5071('0xa')](),controller[_0x5071('0x1a')]);router['delete'](_0x5071('0x17'),auth[_0x5071('0xa')](),controller['destroy']);module[_0x5071('0x1b')]=router; \ No newline at end of file +var _0x2b4a=['/describe','describe','/:id','show','post','sms','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated'];(function(_0x535150,_0x572644){var _0x2788e3=function(_0xae7270){while(--_0xae7270){_0x535150['push'](_0x535150['shift']());}};_0x2788e3(++_0x572644);}(_0x2b4a,0x13e));var _0xa2b4=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x2b4a[_0x1f9f37];return _0x21c080;};'use strict';var multer=require(_0xa2b4('0x0'));var util=require(_0xa2b4('0x1'));var path=require(_0xa2b4('0x2'));var timeout=require(_0xa2b4('0x3'));var express=require(_0xa2b4('0x4'));var router=express[_0xa2b4('0x5')]();var fs_extra=require(_0xa2b4('0x6'));var auth=require(_0xa2b4('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa2b4('0x8'));var controller=require(_0xa2b4('0x9'));router[_0xa2b4('0xa')]('/',auth[_0xa2b4('0xb')](),controller['index']);router[_0xa2b4('0xa')](_0xa2b4('0xc'),auth['isAuthenticated'](),controller[_0xa2b4('0xd')]);router[_0xa2b4('0xa')](_0xa2b4('0xe'),auth[_0xa2b4('0xb')](),controller[_0xa2b4('0xf')]);router[_0xa2b4('0x10')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xa2b4('0x11'),'smsmessage:create'),controller[_0xa2b4('0x12')]);router[_0xa2b4('0x10')](_0xa2b4('0x13'),controller[_0xa2b4('0x14')]);router[_0xa2b4('0x15')](_0xa2b4('0xe'),auth[_0xa2b4('0xb')](),controller[_0xa2b4('0x16')]);router[_0xa2b4('0x15')](_0xa2b4('0x17'),auth[_0xa2b4('0xb')](),controller[_0xa2b4('0x18')]);router[_0xa2b4('0x15')](_0xa2b4('0x19'),auth['isAuthenticated'](),controller[_0xa2b4('0x1a')]);router[_0xa2b4('0x1b')](_0xa2b4('0xe'),auth[_0xa2b4('0xb')](),controller[_0xa2b4('0x1c')]);module[_0xa2b4('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 369b60d..137e51f 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 _0x10eb=['STRING','sequelize','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x5f0c2e,_0x33309f){var _0x1c2dda=function(_0x205be4){while(--_0x205be4){_0x5f0c2e['push'](_0x5f0c2e['shift']());}};_0x1c2dda(++_0x33309f);}(_0x10eb,0x71));var _0xb10e=function(_0x59b189,_0xfa300c){_0x59b189=_0x59b189-0x0;var _0x339aab=_0x10eb[_0x59b189];return _0x339aab;};'use strict';var Sequelize=require(_0xb10e('0x0'));module['exports']={'body':{'type':Sequelize[_0xb10e('0x1')](_0xb10e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb10e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb10e('0x4')]('in',_0xb10e('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xb10e('0x6')](0xbe)},'phone':{'type':Sequelize[_0xb10e('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb10e('0x6')]},'providerResponse':{'type':Sequelize[_0xb10e('0x1')]}}; \ No newline at end of file +var _0xe636=['BOOLEAN','ENUM','out','STRING','TEXT','sequelize','exports','medium'];(function(_0x754f7f,_0x5a0753){var _0x20d21b=function(_0x36594e){while(--_0x36594e){_0x754f7f['push'](_0x754f7f['shift']());}};_0x20d21b(++_0x5a0753);}(_0xe636,0x16d));var _0x6e63=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0xe636[_0x174ef5];return _0x1cc379;};'use strict';var Sequelize=require(_0x6e63('0x0'));module[_0x6e63('0x1')]={'body':{'type':Sequelize['TEXT'](_0x6e63('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x6e63('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6e63('0x4')]('in',_0x6e63('0x5')),'defaultValue':_0x6e63('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x6e63('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x6e63('0x6')]},'providerResponse':{'type':Sequelize[_0x6e63('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 91a9914..2cee170 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 _0xe9f2=['defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','send','index','rawAttributes','key','map','name','keys','query','model','attributes','fields','length','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','then','include','SmsMessage','findAll','show','params','intersection','includeAll','find','create','body','describe','accept','sms','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','contact','fullname','email','internal','manual','interface','SIP/%s','channel','event','interaction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','Sequelize','SELECT','User','motionChannel','EventManager','rejectmessage','SmsAccount','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x56090d,_0x47f98b){var _0x524716=function(_0x1218c6){while(--_0x1218c6){_0x56090d['push'](_0x56090d['shift']());}};_0x524716(++_0x47f98b);}(_0xe9f2,0x10f));var _0x2e9f=function(_0x1199f9,_0x917ebd){_0x1199f9=_0x1199f9-0x0;var _0x2dadf4=_0xe9f2[_0x1199f9];return _0x2dadf4;};'use strict';var emlformat=require(_0x2e9f('0x0'));var rimraf=require(_0x2e9f('0x1'));var zipdir=require(_0x2e9f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2e9f('0x3'));var moment=require(_0x2e9f('0x4'));var BPromise=require(_0x2e9f('0x5'));var Mustache=require(_0x2e9f('0x6'));var util=require(_0x2e9f('0x7'));var path=require(_0x2e9f('0x8'));var sox=require(_0x2e9f('0x9'));var csv=require(_0x2e9f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e9f('0xb'));var squel=require('squel');var crypto=require(_0x2e9f('0xc'));var jsforce=require(_0x2e9f('0xd'));var deskjs=require(_0x2e9f('0xe'));var toCsv=require(_0x2e9f('0xa'));var querystring=require(_0x2e9f('0xf'));var Papa=require(_0x2e9f('0x10'));var Redis=require(_0x2e9f('0x11'));var authService=require(_0x2e9f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2e9f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e9f('0x14'))(_0x2e9f('0x15'));var utils=require(_0x2e9f('0x16'));var config=require(_0x2e9f('0x17'));var licenseUtil=require(_0x2e9f('0x18'));var db=require(_0x2e9f('0x19'))['db'];config[_0x2e9f('0x1a')]=_[_0x2e9f('0x1b')](config[_0x2e9f('0x1a')],{'host':_0x2e9f('0x1c'),'port':0x18eb});var socket=require(_0x2e9f('0x1d'))(new Redis(config[_0x2e9f('0x1a')]));require(_0x2e9f('0x1e'))[_0x2e9f('0x1f')](socket);var jayson=require(_0x2e9f('0x20'));var client=jayson[_0x2e9f('0x21')][_0x2e9f('0x22')]({'port':0x232c});var client9002=jayson[_0x2e9f('0x21')][_0x2e9f('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x51dfbb,_0x1e5b31,_0x1aa159,_0x415b31){return new BPromise(function(_0x150aaa,_0x4421dc){var _0x3d48a7=_0x415b31||client;return _0x3d48a7[_0x2e9f('0x23')](_0x51dfbb,_0x1aa159)['then'](function(_0x48331a){logger[_0x2e9f('0x24')](_0x2e9f('0x25'),_0x1e5b31,'request\x20sent');logger[_0x2e9f('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1e5b31,_0x2e9f('0x27'),JSON[_0x2e9f('0x28')](_0x48331a));if(_0x48331a[_0x2e9f('0x29')]){if(_0x48331a[_0x2e9f('0x29')][_0x2e9f('0x2a')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x1e5b31,_0x48331a['error'][_0x2e9f('0x2b')]);return _0x4421dc(_0x48331a[_0x2e9f('0x29')][_0x2e9f('0x2b')]);}logger['error'](_0x2e9f('0x25'),_0x1e5b31,_0x48331a['error'][_0x2e9f('0x2b')]);return _0x150aaa(_0x48331a[_0x2e9f('0x29')][_0x2e9f('0x2b')]);}else{logger[_0x2e9f('0x24')](_0x2e9f('0x25'),_0x1e5b31,_0x2e9f('0x27'));_0x150aaa(_0x48331a['result'][_0x2e9f('0x2b')]);}})[_0x2e9f('0x2c')](function(_0x384070){logger[_0x2e9f('0x29')](_0x2e9f('0x25'),_0x1e5b31,_0x384070);_0x4421dc(_0x384070);});});}function respondWithStatusCode(_0x1be656,_0x1c4bbc){_0x1c4bbc=_0x1c4bbc||0xcc;return function(_0x1e370d){if(_0x1e370d){return _0x1be656['sendStatus'](_0x1c4bbc);}return _0x1be656['status'](_0x1c4bbc)[_0x2e9f('0x2d')]();};}function respondWithResult(_0x1dbbf5,_0x3afc8f){_0x3afc8f=_0x3afc8f||0xc8;return function(_0x1f84dd){if(_0x1f84dd){return _0x1dbbf5[_0x2e9f('0x2e')](_0x3afc8f)[_0x2e9f('0x2f')](_0x1f84dd);}};}function respondWithFilteredResult(_0x10d8b9,_0x2ceae8){return function(_0x2bbd84){if(_0x2bbd84){var _0x813932=typeof _0x2ceae8[_0x2e9f('0x30')]===_0x2e9f('0x31')&&typeof _0x2ceae8[_0x2e9f('0x32')]==='undefined';var _0x138376=_0x2bbd84[_0x2e9f('0x33')];var _0x9a7c20=_0x813932?0x0:_0x2ceae8[_0x2e9f('0x30')];var _0x346f26=_0x813932?_0x2bbd84[_0x2e9f('0x33')]:_0x2ceae8[_0x2e9f('0x30')]+_0x2ceae8[_0x2e9f('0x32')];var _0x3cc13d;if(_0x346f26>=_0x138376){_0x346f26=_0x138376;_0x3cc13d=0xc8;}else{_0x3cc13d=0xce;}_0x10d8b9[_0x2e9f('0x2e')](_0x3cc13d);return _0x10d8b9[_0x2e9f('0x34')](_0x2e9f('0x35'),_0x9a7c20+'-'+_0x346f26+'/'+_0x138376)['json'](_0x2bbd84);}return null;};}function patchUpdates(_0x439ff3){return function(_0x2243ac){try{jsonpatch[_0x2e9f('0x36')](_0x2243ac,_0x439ff3,!![]);}catch(_0x8b23d8){return BPromise[_0x2e9f('0x37')](_0x8b23d8);}return _0x2243ac[_0x2e9f('0x38')]();};}function saveUpdates(_0x5a55f1,_0x4dd74c){return function(_0x4832b8){if(_0x4832b8){return _0x4832b8[_0x2e9f('0x39')](_0x5a55f1)['then'](function(_0x49c997){return _0x49c997;});}return null;};}function removeEntity(_0x688274,_0x167abd){return function(_0x19d81b){if(_0x19d81b){return _0x19d81b[_0x2e9f('0x3a')]()['then'](function(){_0x688274['status'](0xcc)[_0x2e9f('0x2d')]();});}};}function handleEntityNotFound(_0x566d3b,_0xb03fb1){return function(_0x4bf552){if(!_0x4bf552){_0x566d3b['sendStatus'](0x194);}return _0x4bf552;};}function handleError(_0x4aee40,_0xb3d6dd){_0xb3d6dd=_0xb3d6dd||0x1f4;return function(_0x51895c){logger['error'](_0x51895c[_0x2e9f('0x3b')]);if(_0x51895c['name']){delete _0x51895c['name'];}_0x4aee40['status'](_0xb3d6dd)[_0x2e9f('0x3c')](_0x51895c);};}exports[_0x2e9f('0x3d')]=function(_0x26c256,_0x287e08){var _0x3a2294={},_0x5e6076={},_0x49cd47={'count':0x0,'rows':[]};var _0x29639d=_['map'](db['SmsMessage'][_0x2e9f('0x3e')],function(_0x26930f){return{'name':_0x26930f['fieldName'],'type':_0x26930f['type'][_0x2e9f('0x3f')]};});_0x5e6076['model']=_[_0x2e9f('0x40')](_0x29639d,_0x2e9f('0x41'));_0x5e6076['query']=_[_0x2e9f('0x42')](_0x26c256[_0x2e9f('0x43')]);_0x5e6076['filters']=_['intersection'](_0x5e6076[_0x2e9f('0x44')],_0x5e6076[_0x2e9f('0x43')]);_0x3a2294[_0x2e9f('0x45')]=_['intersection'](_0x5e6076[_0x2e9f('0x44')],qs[_0x2e9f('0x46')](_0x26c256['query']['fields']));_0x3a2294['attributes']=_0x3a2294[_0x2e9f('0x45')][_0x2e9f('0x47')]?_0x3a2294[_0x2e9f('0x45')]:_0x5e6076[_0x2e9f('0x44')];if(!_0x26c256[_0x2e9f('0x43')]['hasOwnProperty']('nolimit')){_0x3a2294[_0x2e9f('0x32')]=qs[_0x2e9f('0x32')](_0x26c256[_0x2e9f('0x43')][_0x2e9f('0x32')]);_0x3a2294['offset']=qs[_0x2e9f('0x30')](_0x26c256[_0x2e9f('0x43')]['offset']);}_0x3a2294[_0x2e9f('0x48')]=qs['sort'](_0x26c256[_0x2e9f('0x43')][_0x2e9f('0x49')]);_0x3a2294['where']=qs[_0x2e9f('0x4a')](_[_0x2e9f('0x4b')](_0x26c256[_0x2e9f('0x43')],_0x5e6076[_0x2e9f('0x4a')]),_0x29639d);if(_0x26c256['query']['filter']){_0x3a2294[_0x2e9f('0x4c')]=_[_0x2e9f('0x4d')](_0x3a2294[_0x2e9f('0x4c')],{'$or':_['map'](_0x29639d,function(_0x31d4b2){if(_0x31d4b2[_0x2e9f('0x4e')]!==_0x2e9f('0x4f')){var _0x1ef1ab={};_0x1ef1ab[_0x31d4b2[_0x2e9f('0x41')]]={'$like':'%'+_0x26c256[_0x2e9f('0x43')][_0x2e9f('0x50')]+'%'};return _0x1ef1ab;}})});}_0x3a2294=_[_0x2e9f('0x4d')]({},_0x3a2294,_0x26c256[_0x2e9f('0x51')]);var _0x5dab9a={'where':_0x3a2294['where']};return db['SmsMessage'][_0x2e9f('0x33')](_0x5dab9a)[_0x2e9f('0x52')](function(_0x45c92a){_0x49cd47[_0x2e9f('0x33')]=_0x45c92a;if(_0x26c256['query']['includeAll']){_0x3a2294[_0x2e9f('0x53')]=[{'all':!![]}];}return db[_0x2e9f('0x54')][_0x2e9f('0x55')](_0x3a2294);})[_0x2e9f('0x52')](function(_0x17cd16){_0x49cd47['rows']=_0x17cd16;return _0x49cd47;})[_0x2e9f('0x52')](respondWithFilteredResult(_0x287e08,_0x3a2294))[_0x2e9f('0x2c')](handleError(_0x287e08,null));};exports[_0x2e9f('0x56')]=function(_0x32dbb3,_0x25a5f0){var _0xee96a2={'raw':!![],'where':{'id':_0x32dbb3[_0x2e9f('0x57')]['id']}},_0x3eda15={};_0x3eda15[_0x2e9f('0x44')]=_[_0x2e9f('0x42')](db[_0x2e9f('0x54')][_0x2e9f('0x3e')]);_0x3eda15[_0x2e9f('0x43')]=_[_0x2e9f('0x42')](_0x32dbb3['query']);_0x3eda15[_0x2e9f('0x4a')]=_[_0x2e9f('0x58')](_0x3eda15['model'],_0x3eda15['query']);_0xee96a2[_0x2e9f('0x45')]=_[_0x2e9f('0x58')](_0x3eda15['model'],qs['fields'](_0x32dbb3[_0x2e9f('0x43')][_0x2e9f('0x46')]));_0xee96a2[_0x2e9f('0x45')]=_0xee96a2[_0x2e9f('0x45')][_0x2e9f('0x47')]?_0xee96a2['attributes']:_0x3eda15[_0x2e9f('0x44')];if(_0x32dbb3[_0x2e9f('0x43')][_0x2e9f('0x59')]){_0xee96a2[_0x2e9f('0x53')]=[{'all':!![]}];}_0xee96a2=_[_0x2e9f('0x4d')]({},_0xee96a2,_0x32dbb3[_0x2e9f('0x51')]);return db[_0x2e9f('0x54')][_0x2e9f('0x5a')](_0xee96a2)[_0x2e9f('0x52')](handleEntityNotFound(_0x25a5f0,null))['then'](respondWithResult(_0x25a5f0,null))['catch'](handleError(_0x25a5f0,null));};exports['create']=function(_0x4bd628,_0x37daa9){return db[_0x2e9f('0x54')][_0x2e9f('0x5b')](_0x4bd628[_0x2e9f('0x5c')],{})[_0x2e9f('0x52')](respondWithResult(_0x37daa9,0xc9))[_0x2e9f('0x2c')](handleError(_0x37daa9,null));};exports[_0x2e9f('0x39')]=function(_0x49228c,_0x16ec93){if(_0x49228c[_0x2e9f('0x5c')]['id']){delete _0x49228c['body']['id'];}return db['SmsMessage'][_0x2e9f('0x5a')]({'where':{'id':_0x49228c[_0x2e9f('0x57')]['id']}})[_0x2e9f('0x52')](handleEntityNotFound(_0x16ec93,null))['then'](saveUpdates(_0x49228c[_0x2e9f('0x5c')],null))[_0x2e9f('0x52')](respondWithResult(_0x16ec93,null))[_0x2e9f('0x2c')](handleError(_0x16ec93,null));};exports[_0x2e9f('0x3a')]=function(_0x32211d,_0x159c01){return db['SmsMessage'][_0x2e9f('0x5a')]({'where':{'id':_0x32211d[_0x2e9f('0x57')]['id']}})[_0x2e9f('0x52')](handleEntityNotFound(_0x159c01,null))['then'](removeEntity(_0x159c01,null))['catch'](handleError(_0x159c01,null));};exports[_0x2e9f('0x5d')]=function(_0x36ebbd,_0x46c48f){return db[_0x2e9f('0x54')][_0x2e9f('0x5d')]()[_0x2e9f('0x52')](respondWithResult(_0x46c48f,null))[_0x2e9f('0x2c')](handleError(_0x46c48f,null));};var interaction_log=require(_0x2e9f('0x14'))('sms-interactions');exports[_0x2e9f('0x5e')]=function(_0x21b76e,_0x66a757,_0x4d1cb4){var _0x581622={'agent':{},'channel':_0x2e9f('0x5f')};if(_0x21b76e[_0x2e9f('0x5c')]['id']){delete _0x21b76e['body']['id'];}_0x21b76e['body']['read']=!![];_0x21b76e['body']['readAt']=moment()[_0x2e9f('0x60')](_0x2e9f('0x61'));_0x21b76e[_0x2e9f('0x5c')][_0x2e9f('0x62')]=_0x21b76e[_0x2e9f('0x5c')][_0x2e9f('0x62')]||_0x21b76e[_0x2e9f('0x63')]['id'];_0x581622[_0x2e9f('0x64')]['id']=_0x21b76e[_0x2e9f('0x5c')][_0x2e9f('0x62')];return db[_0x2e9f('0x54')]['find']({'where':{'id':_0x21b76e[_0x2e9f('0x57')]['id'],'UserId':null}})[_0x2e9f('0x52')](handleEntityNotFound(_0x66a757,null))[_0x2e9f('0x52')](saveUpdates(_0x21b76e[_0x2e9f('0x5c')],null))[_0x2e9f('0x52')](function(_0x4e99ea){if(_0x4e99ea){_0x581622[_0x2e9f('0x2b')]=_0x4e99ea['get']({'plain':!![]});return db[_0x2e9f('0x65')]['find']({'where':{'id':_0x4e99ea[_0x2e9f('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x66a757,null))['then'](function(_0x10e37e){if(_0x10e37e){return _0x10e37e[_0x2e9f('0x39')]({'UserId':_0x21b76e[_0x2e9f('0x5c')]['UserId'],'read1stAt':_[_0x2e9f('0x67')](_0x10e37e[_0x2e9f('0x68')])?moment()[_0x2e9f('0x60')](_0x2e9f('0x61')):undefined});}return null;})[_0x2e9f('0x52')](function(_0xb11c94){if(_0xb11c94){_0x581622['interaction']=_0xb11c94[_0x2e9f('0x69')]({'plain':!![]});interaction_log[_0x2e9f('0x24')](_0x2e9f('0x6a'),_0x21b76e[_0x2e9f('0x63')]['id'],_0x21b76e['user'][_0x2e9f('0x41')],_0x21b76e[_0x2e9f('0x63')][_0x2e9f('0x6b')],_0x581622['interaction']['id'],_0x21b76e['body']?JSON[_0x2e9f('0x28')](_0x21b76e[_0x2e9f('0x5c')]):'null');return respondWithRpcPromise(_0x2e9f('0x6c'),_0x2e9f('0x6d'),_0x581622);}return null;})['then'](function(_0x1f39e9){var _0x186d16=_0x2e9f('0x6e')+_0x1f39e9[_0x2e9f('0x2b')][_0x2e9f('0x6f')];return db['sequelize']['query'](_0x186d16,{'type':db['Sequelize'][_0x2e9f('0x70')]['SELECT'],'raw':!![]})[_0x2e9f('0x52')](function(_0x18981){return _0x18981;});})[_0x2e9f('0x52')](function(_0x4ab059){if(_0x4ab059){_0x581622['message'][_0x2e9f('0x71')]=_0x4ab059[0x0];if(!_0x21b76e['body']['UserId'])return;return db['User']['find']({'where':{'id':_0x21b76e[_0x2e9f('0x5c')]['UserId'],'role':_0x2e9f('0x64')},'attributes':['id',_0x2e9f('0x41'),_0x2e9f('0x72'),_0x2e9f('0x73'),_0x2e9f('0x74')],'raw':!![]});}return null;})[_0x2e9f('0x52')](function(_0x4110d0){if(!_0x4110d0)return null;_0x581622[_0x2e9f('0x2b')][_0x2e9f('0x64')]=_0x4110d0;return _0x581622;})[_0x2e9f('0x52')](function(_0xdd95a6){if(_0xdd95a6){if(_0x21b76e[_0x2e9f('0x5c')][_0x2e9f('0x75')]){_0x581622[_0x2e9f('0x2b')][_0x2e9f('0x76')]=util['format'](_0x2e9f('0x77'),_0x21b76e['user'][_0x2e9f('0x41')]);_0x581622['message'][_0x2e9f('0x78')]=_0x581622['channel'];_0x581622[_0x2e9f('0x2b')]['motionChannel']=_0x581622[_0x2e9f('0x78')];_0x581622[_0x2e9f('0x2b')][_0x2e9f('0x79')]=_0x2e9f('0x5e');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x581622['message']},client9002)[_0x2e9f('0x52')](function(){return _0x581622;});}return _0x581622;}return null;})['then'](respondWithResult(_0x66a757,null))[_0x2e9f('0x2c')](handleError(_0x66a757,null));};var interaction_log=require(_0x2e9f('0x14'))('sms-interactions');exports[_0x2e9f('0x37')]=function(_0x31b78e,_0x3e3f05,_0x134d9b){var _0x2fb416={'agent':{},'channel':'sms'};if(_0x31b78e['body']['id']){delete _0x31b78e[_0x2e9f('0x5c')]['id'];}_0x31b78e[_0x2e9f('0x5c')][_0x2e9f('0x62')]=_0x31b78e[_0x2e9f('0x5c')][_0x2e9f('0x62')]||_0x31b78e[_0x2e9f('0x63')]['id'];_0x2fb416[_0x2e9f('0x64')]['id']=_0x31b78e[_0x2e9f('0x5c')][_0x2e9f('0x62')];return db[_0x2e9f('0x54')][_0x2e9f('0x5a')]({'where':{'id':_0x31b78e[_0x2e9f('0x57')]['id'],'UserId':null}})[_0x2e9f('0x52')](handleEntityNotFound(_0x3e3f05,null))['then'](function(_0x21351d){if(_0x21351d){_0x2fb416[_0x2e9f('0x2b')]=_0x21351d['get']({'plain':!![]});return db[_0x2e9f('0x65')]['find']({'where':{'id':_0x21351d[_0x2e9f('0x66')]}});}return null;})[_0x2e9f('0x52')](handleEntityNotFound(_0x3e3f05,null))[_0x2e9f('0x52')](function(_0x5cbb09){if(_0x5cbb09){_0x2fb416[_0x2e9f('0x7a')]=_0x5cbb09['get']({'plain':!![]});interaction_log[_0x2e9f('0x24')](_0x2e9f('0x7b'),_0x31b78e[_0x2e9f('0x63')]['id'],_0x31b78e[_0x2e9f('0x63')][_0x2e9f('0x41')],_0x31b78e[_0x2e9f('0x63')]['role'],_0x2fb416['interaction']['id'],_0x31b78e['body']?JSON['stringify'](_0x31b78e['body']):_0x2e9f('0x7c'));return respondWithRpcPromise(_0x2e9f('0x7d'),_0x2e9f('0x7e'),_0x2fb416);}return null;})['then'](function(_0x1f38e9){var _0x59d0b3=_0x2e9f('0x6e')+_0x1f38e9['message']['ContactId'];return db[_0x2e9f('0x7f')][_0x2e9f('0x43')](_0x59d0b3,{'type':db[_0x2e9f('0x80')][_0x2e9f('0x70')][_0x2e9f('0x81')],'raw':!![]})[_0x2e9f('0x52')](function(_0x101a1d){return _0x101a1d;});})['then'](function(_0x2e56c3){if(_0x2e56c3){_0x2fb416[_0x2e9f('0x2b')]['contact']=_0x2e56c3[0x0];if(!_0x31b78e[_0x2e9f('0x5c')][_0x2e9f('0x62')])return;return db[_0x2e9f('0x82')][_0x2e9f('0x5a')]({'where':{'id':_0x31b78e[_0x2e9f('0x5c')][_0x2e9f('0x62')],'role':'agent'},'attributes':['id',_0x2e9f('0x41'),_0x2e9f('0x72'),_0x2e9f('0x73'),_0x2e9f('0x74')],'raw':!![]});}return null;})[_0x2e9f('0x52')](function(_0x39ff18){if(!_0x39ff18)return null;_0x2fb416['message'][_0x2e9f('0x64')]=_0x39ff18;return _0x2fb416;})[_0x2e9f('0x52')](function(_0x57929b){if(_0x57929b){_0x57929b[_0x2e9f('0x2b')]['interface']=util[_0x2e9f('0x60')](_0x2e9f('0x77'),_0x31b78e['user'][_0x2e9f('0x41')]);_0x57929b[_0x2e9f('0x2b')][_0x2e9f('0x78')]=_0x2fb416[_0x2e9f('0x78')];_0x57929b[_0x2e9f('0x2b')][_0x2e9f('0x83')]=_0x2fb416[_0x2e9f('0x78')];_0x57929b[_0x2e9f('0x2b')][_0x2e9f('0x79')]=_0x2e9f('0x37');respondWithRpcPromise(_0x2e9f('0x84'),_0x2e9f('0x84'),{'event':_0x2e9f('0x85'),'message':_0x57929b[_0x2e9f('0x2b')]},client9002);return _0x2fb416;}return null;})[_0x2e9f('0x52')](respondWithResult(_0x3e3f05,null))['catch'](handleError(_0x3e3f05,null));};exports[_0x2e9f('0x2e')]=function(_0xf6c55e,_0x406e82,_0x450165){if(_0xf6c55e[_0x2e9f('0x5c')]['id']){delete _0xf6c55e[_0x2e9f('0x5c')]['id'];}var _0x275f5f;return db[_0x2e9f('0x54')][_0x2e9f('0x5a')]({'where':{'id':_0xf6c55e[_0x2e9f('0x57')]['id']}})[_0x2e9f('0x52')](handleEntityNotFound(_0x406e82,null))[_0x2e9f('0x52')](function(_0x190935){if(_0x190935){_0x275f5f=_0x190935;return db[_0x2e9f('0x86')]['find']({'where':{'id':_0x190935['SmsAccountId']}});}})[_0x2e9f('0x52')](handleEntityNotFound(_0x406e82,null))[_0x2e9f('0x52')](function(_0xf54248){if(_0xf54248){logger[_0x2e9f('0x26')](_0x2e9f('0x87'),_0x2e9f('0x2e'),_0x2e9f('0x88'),_0xf54248[_0x2e9f('0x4e')],util[_0x2e9f('0x89')](_0xf6c55e[_0x2e9f('0x5c')],{'showHidden':![],'depth':null}));switch(_0xf54248['type']){case _0x2e9f('0x8a'):if(_0xf6c55e[_0x2e9f('0x5c')]['MessageSid']&&_0xf6c55e['body'][_0x2e9f('0x8b')]===_0x275f5f[_0x2e9f('0x8c')]){return _0x275f5f[_0x2e9f('0x39')]({'read':!![]});}else{logger[_0x2e9f('0x29')](_0x2e9f('0x8d'),'status',_0x2e9f('0x8a'),util[_0x2e9f('0x89')](_0xf6c55e['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0xf6c55e[_0x2e9f('0x5c')][_0x2e9f('0x8e')]&&_0xf6c55e[_0x2e9f('0x5c')][_0x2e9f('0x8e')]===_0x275f5f[_0x2e9f('0x8c')]&&_['indexOf'](['sent','delivered'],_0xf6c55e[_0x2e9f('0x5c')][_0x2e9f('0x8f')])>=0x0){return _0x275f5f[_0x2e9f('0x39')]({'read':!![]});}else{logger[_0x2e9f('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2e9f('0x2e'),_0x2e9f('0x90'),util[_0x2e9f('0x89')](_0xf6c55e[_0x2e9f('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x2e9f('0x91'):var _0x3bbfa9=_0xf6c55e[_0x2e9f('0x5c')][_0x2e9f('0x92')][0x0];if(_0x3bbfa9[_0x2e9f('0x2e')][_0x2e9f('0x93')]===_0x2e9f('0x94')){return _0x275f5f[_0x2e9f('0x39')]({'read':!![]});}else{logger[_0x2e9f('0x29')](_0x2e9f('0x8d'),_0x2e9f('0x2e'),'infobip',util['inspect'](_0xf6c55e[_0x2e9f('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x275f5f;}})[_0x2e9f('0x52')](respondWithResult(_0x406e82,null))['catch'](handleError(_0x406e82,null));}; \ No newline at end of file +var _0x605a=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','SmsMessage','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','filter','where','type','VIRTUAL','options','include','rows','show','params','includeAll','find','create','body','describe','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','SmsInteractionId','interaction','get','[SMSMESSAGE: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','User','fullname','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','accept','EventManager','acceptmessage','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','Sequelize','QueryTypes','contact','rejectmessage','SmsAccount','SmsAccountId','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0xd95a4f,_0x5b2faf){var _0x913026=function(_0x4e9711){while(--_0x4e9711){_0xd95a4f['push'](_0xd95a4f['shift']());}};_0x913026(++_0x5b2faf);}(_0x605a,0x126));var _0xa605=function(_0x463f57,_0x39139c){_0x463f57=_0x463f57-0x0;var _0x531291=_0x605a[_0x463f57];return _0x531291;};'use strict';var emlformat=require(_0xa605('0x0'));var rimraf=require(_0xa605('0x1'));var zipdir=require(_0xa605('0x2'));var jsonpatch=require(_0xa605('0x3'));var rp=require(_0xa605('0x4'));var moment=require(_0xa605('0x5'));var BPromise=require(_0xa605('0x6'));var Mustache=require('mustache');var util=require(_0xa605('0x7'));var path=require(_0xa605('0x8'));var sox=require(_0xa605('0x9'));var csv=require(_0xa605('0xa'));var ejs=require(_0xa605('0xb'));var fs=require('fs');var fs_extra=require(_0xa605('0xc'));var _=require(_0xa605('0xd'));var squel=require(_0xa605('0xe'));var crypto=require('crypto');var jsforce=require(_0xa605('0xf'));var deskjs=require(_0xa605('0x10'));var toCsv=require(_0xa605('0xa'));var querystring=require(_0xa605('0x11'));var Papa=require(_0xa605('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa605('0x13'));var as=require(_0xa605('0x14'));var hardwareService=require(_0xa605('0x15'));var logger=require(_0xa605('0x16'))(_0xa605('0x17'));var utils=require(_0xa605('0x18'));var config=require(_0xa605('0x19'));var licenseUtil=require(_0xa605('0x1a'));var db=require(_0xa605('0x1b'))['db'];config[_0xa605('0x1c')]=_['defaults'](config['redis'],{'host':_0xa605('0x1d'),'port':0x18eb});var socket=require(_0xa605('0x1e'))(new Redis(config[_0xa605('0x1c')]));require(_0xa605('0x1f'))[_0xa605('0x20')](socket);var jayson=require(_0xa605('0x21'));var client=jayson[_0xa605('0x22')][_0xa605('0x23')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1103e6,_0x24a6a3,_0x471c80,_0x364d8a){return new BPromise(function(_0x22af74,_0x33adfb){var _0x244c59=_0x364d8a||client;return _0x244c59[_0xa605('0x24')](_0x1103e6,_0x471c80)[_0xa605('0x25')](function(_0x47dd15){logger[_0xa605('0x26')](_0xa605('0x27'),_0x24a6a3,'request\x20sent');logger[_0xa605('0x28')](_0xa605('0x29'),_0x24a6a3,'request\x20sent',JSON[_0xa605('0x2a')](_0x47dd15));if(_0x47dd15['error']){if(_0x47dd15[_0xa605('0x2b')][_0xa605('0x2c')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x24a6a3,_0x47dd15[_0xa605('0x2b')][_0xa605('0x2d')]);return _0x33adfb(_0x47dd15[_0xa605('0x2b')]['message']);}logger['error'](_0xa605('0x27'),_0x24a6a3,_0x47dd15['error'][_0xa605('0x2d')]);return _0x22af74(_0x47dd15[_0xa605('0x2b')][_0xa605('0x2d')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x24a6a3,'request\x20sent');_0x22af74(_0x47dd15[_0xa605('0x2e')]['message']);}})[_0xa605('0x2f')](function(_0x55f5d7){logger[_0xa605('0x2b')]('SmsMessage,\x20%s,\x20%s',_0x24a6a3,_0x55f5d7);_0x33adfb(_0x55f5d7);});});}function respondWithStatusCode(_0x415a88,_0x30746e){_0x30746e=_0x30746e||0xcc;return function(_0x2362af){if(_0x2362af){return _0x415a88[_0xa605('0x30')](_0x30746e);}return _0x415a88[_0xa605('0x31')](_0x30746e)[_0xa605('0x32')]();};}function respondWithResult(_0x1a6718,_0x5be0df){_0x5be0df=_0x5be0df||0xc8;return function(_0x415c6a){if(_0x415c6a){return _0x1a6718[_0xa605('0x31')](_0x5be0df)[_0xa605('0x33')](_0x415c6a);}};}function respondWithFilteredResult(_0x3e0c84,_0xdb1ee4){return function(_0x379438){if(_0x379438){var _0x3a897f=typeof _0xdb1ee4[_0xa605('0x34')]==='undefined'&&typeof _0xdb1ee4['limit']===_0xa605('0x35');var _0x90192f=_0x379438[_0xa605('0x36')];var _0x23cd6f=_0x3a897f?0x0:_0xdb1ee4[_0xa605('0x34')];var _0x307956=_0x3a897f?_0x379438[_0xa605('0x36')]:_0xdb1ee4[_0xa605('0x34')]+_0xdb1ee4[_0xa605('0x37')];var _0x44c20d;if(_0x307956>=_0x90192f){_0x307956=_0x90192f;_0x44c20d=0xc8;}else{_0x44c20d=0xce;}_0x3e0c84[_0xa605('0x31')](_0x44c20d);return _0x3e0c84[_0xa605('0x38')](_0xa605('0x39'),_0x23cd6f+'-'+_0x307956+'/'+_0x90192f)[_0xa605('0x33')](_0x379438);}return null;};}function patchUpdates(_0x338261){return function(_0x2d5fb3){try{jsonpatch[_0xa605('0x3a')](_0x2d5fb3,_0x338261,!![]);}catch(_0x429ec7){return BPromise[_0xa605('0x3b')](_0x429ec7);}return _0x2d5fb3[_0xa605('0x3c')]();};}function saveUpdates(_0x432ad6,_0x3cb842){return function(_0x45c212){if(_0x45c212){return _0x45c212[_0xa605('0x3d')](_0x432ad6)[_0xa605('0x25')](function(_0x3cb5a4){return _0x3cb5a4;});}return null;};}function removeEntity(_0x1b6fe9,_0x31b35b){return function(_0x35d002){if(_0x35d002){return _0x35d002['destroy']()[_0xa605('0x25')](function(){_0x1b6fe9[_0xa605('0x31')](0xcc)[_0xa605('0x32')]();});}};}function handleEntityNotFound(_0x5313e7,_0x5bf482){return function(_0x354ded){if(!_0x354ded){_0x5313e7[_0xa605('0x30')](0x194);}return _0x354ded;};}function handleError(_0x307c1d,_0xebb5e5){_0xebb5e5=_0xebb5e5||0x1f4;return function(_0x3f41a6){logger[_0xa605('0x2b')](_0x3f41a6[_0xa605('0x3e')]);if(_0x3f41a6[_0xa605('0x3f')]){delete _0x3f41a6[_0xa605('0x3f')];}_0x307c1d['status'](_0xebb5e5)[_0xa605('0x40')](_0x3f41a6);};}exports[_0xa605('0x41')]=function(_0x25d9bb,_0x30efe0){var _0xc896a={},_0xe95662={},_0x2c7225={'count':0x0,'rows':[]};var _0x46fdfc=_[_0xa605('0x42')](db[_0xa605('0x43')]['rawAttributes'],function(_0x5d8681){return{'name':_0x5d8681[_0xa605('0x44')],'type':_0x5d8681['type'][_0xa605('0x45')]};});_0xe95662[_0xa605('0x46')]=_['map'](_0x46fdfc,'name');_0xe95662[_0xa605('0x47')]=_[_0xa605('0x48')](_0x25d9bb[_0xa605('0x47')]);_0xe95662[_0xa605('0x49')]=_['intersection'](_0xe95662[_0xa605('0x46')],_0xe95662[_0xa605('0x47')]);_0xc896a[_0xa605('0x4a')]=_[_0xa605('0x4b')](_0xe95662[_0xa605('0x46')],qs[_0xa605('0x4c')](_0x25d9bb[_0xa605('0x47')][_0xa605('0x4c')]));_0xc896a['attributes']=_0xc896a[_0xa605('0x4a')][_0xa605('0x4d')]?_0xc896a[_0xa605('0x4a')]:_0xe95662[_0xa605('0x46')];if(!_0x25d9bb[_0xa605('0x47')]['hasOwnProperty'](_0xa605('0x4e'))){_0xc896a['limit']=qs['limit'](_0x25d9bb[_0xa605('0x47')][_0xa605('0x37')]);_0xc896a[_0xa605('0x34')]=qs['offset'](_0x25d9bb['query'][_0xa605('0x34')]);}_0xc896a[_0xa605('0x4f')]=qs[_0xa605('0x50')](_0x25d9bb['query'][_0xa605('0x50')]);_0xc896a['where']=qs[_0xa605('0x49')](_['pick'](_0x25d9bb[_0xa605('0x47')],_0xe95662[_0xa605('0x49')]),_0x46fdfc);if(_0x25d9bb[_0xa605('0x47')][_0xa605('0x51')]){_0xc896a[_0xa605('0x52')]=_['merge'](_0xc896a[_0xa605('0x52')],{'$or':_['map'](_0x46fdfc,function(_0x118d41){if(_0x118d41[_0xa605('0x53')]!==_0xa605('0x54')){var _0x5c9be2={};_0x5c9be2[_0x118d41['name']]={'$like':'%'+_0x25d9bb['query']['filter']+'%'};return _0x5c9be2;}})});}_0xc896a=_['merge']({},_0xc896a,_0x25d9bb[_0xa605('0x55')]);var _0x5cafdf={'where':_0xc896a['where']};return db['SmsMessage'][_0xa605('0x36')](_0x5cafdf)[_0xa605('0x25')](function(_0x2ce9df){_0x2c7225['count']=_0x2ce9df;if(_0x25d9bb[_0xa605('0x47')]['includeAll']){_0xc896a[_0xa605('0x56')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0xc896a);})[_0xa605('0x25')](function(_0x15862f){_0x2c7225[_0xa605('0x57')]=_0x15862f;return _0x2c7225;})[_0xa605('0x25')](respondWithFilteredResult(_0x30efe0,_0xc896a))[_0xa605('0x2f')](handleError(_0x30efe0,null));};exports[_0xa605('0x58')]=function(_0x49fe8d,_0x18864c){var _0x26b6f1={'raw':!![],'where':{'id':_0x49fe8d[_0xa605('0x59')]['id']}},_0x3bf0ee={};_0x3bf0ee[_0xa605('0x46')]=_[_0xa605('0x48')](db['SmsMessage']['rawAttributes']);_0x3bf0ee[_0xa605('0x47')]=_[_0xa605('0x48')](_0x49fe8d['query']);_0x3bf0ee[_0xa605('0x49')]=_[_0xa605('0x4b')](_0x3bf0ee['model'],_0x3bf0ee[_0xa605('0x47')]);_0x26b6f1[_0xa605('0x4a')]=_[_0xa605('0x4b')](_0x3bf0ee['model'],qs[_0xa605('0x4c')](_0x49fe8d[_0xa605('0x47')][_0xa605('0x4c')]));_0x26b6f1[_0xa605('0x4a')]=_0x26b6f1[_0xa605('0x4a')][_0xa605('0x4d')]?_0x26b6f1['attributes']:_0x3bf0ee['model'];if(_0x49fe8d[_0xa605('0x47')][_0xa605('0x5a')]){_0x26b6f1['include']=[{'all':!![]}];}_0x26b6f1=_['merge']({},_0x26b6f1,_0x49fe8d['options']);return db['SmsMessage'][_0xa605('0x5b')](_0x26b6f1)[_0xa605('0x25')](handleEntityNotFound(_0x18864c,null))[_0xa605('0x25')](respondWithResult(_0x18864c,null))[_0xa605('0x2f')](handleError(_0x18864c,null));};exports[_0xa605('0x5c')]=function(_0x49f2fa,_0x47e88c){return db[_0xa605('0x43')][_0xa605('0x5c')](_0x49f2fa[_0xa605('0x5d')],{})['then'](respondWithResult(_0x47e88c,0xc9))[_0xa605('0x2f')](handleError(_0x47e88c,null));};exports[_0xa605('0x3d')]=function(_0x29a695,_0x31f372){if(_0x29a695[_0xa605('0x5d')]['id']){delete _0x29a695[_0xa605('0x5d')]['id'];}return db[_0xa605('0x43')][_0xa605('0x5b')]({'where':{'id':_0x29a695[_0xa605('0x59')]['id']}})['then'](handleEntityNotFound(_0x31f372,null))[_0xa605('0x25')](saveUpdates(_0x29a695['body'],null))[_0xa605('0x25')](respondWithResult(_0x31f372,null))[_0xa605('0x2f')](handleError(_0x31f372,null));};exports['destroy']=function(_0x585b59,_0x15fd46){return db[_0xa605('0x43')][_0xa605('0x5b')]({'where':{'id':_0x585b59[_0xa605('0x59')]['id']}})['then'](handleEntityNotFound(_0x15fd46,null))['then'](removeEntity(_0x15fd46,null))[_0xa605('0x2f')](handleError(_0x15fd46,null));};exports[_0xa605('0x5e')]=function(_0x3d23b6,_0x3aa8cb){return db[_0xa605('0x43')]['describe']()['then'](respondWithResult(_0x3aa8cb,null))[_0xa605('0x2f')](handleError(_0x3aa8cb,null));};var interaction_log=require(_0xa605('0x16'))('sms-interactions');exports['accept']=function(_0x27504d,_0x2b2f3c,_0x23bf3a){var _0x181dc1={'agent':{},'channel':_0xa605('0x5f')};if(_0x27504d[_0xa605('0x5d')]['id']){delete _0x27504d[_0xa605('0x5d')]['id'];}_0x27504d['body'][_0xa605('0x60')]=!![];_0x27504d[_0xa605('0x5d')][_0xa605('0x61')]=moment()[_0xa605('0x62')](_0xa605('0x63'));_0x27504d[_0xa605('0x5d')][_0xa605('0x64')]=_0x27504d[_0xa605('0x5d')][_0xa605('0x64')]||_0x27504d['user']['id'];_0x181dc1[_0xa605('0x65')]['id']=_0x27504d[_0xa605('0x5d')][_0xa605('0x64')];return db[_0xa605('0x43')]['find']({'where':{'id':_0x27504d['params']['id'],'UserId':null}})[_0xa605('0x25')](handleEntityNotFound(_0x2b2f3c,null))['then'](saveUpdates(_0x27504d[_0xa605('0x5d')],null))[_0xa605('0x25')](function(_0x4a6ce8){if(_0x4a6ce8){_0x181dc1[_0xa605('0x2d')]=_0x4a6ce8['get']({'plain':!![]});return db['SmsInteraction'][_0xa605('0x5b')]({'where':{'id':_0x4a6ce8[_0xa605('0x66')]}});}return null;})[_0xa605('0x25')](handleEntityNotFound(_0x2b2f3c,null))[_0xa605('0x25')](function(_0x16370b){if(_0x16370b){return _0x16370b['update']({'UserId':_0x27504d[_0xa605('0x5d')][_0xa605('0x64')],'read1stAt':_['isNil'](_0x16370b['read1stAt'])?moment()[_0xa605('0x62')](_0xa605('0x63')):undefined});}return null;})[_0xa605('0x25')](function(_0x36b697){if(_0x36b697){_0x181dc1[_0xa605('0x67')]=_0x36b697[_0xa605('0x68')]({'plain':!![]});interaction_log[_0xa605('0x26')](_0xa605('0x69'),_0x27504d['user']['id'],_0x27504d[_0xa605('0x6a')]['name'],_0x27504d[_0xa605('0x6a')][_0xa605('0x6b')],_0x181dc1['interaction']['id'],_0x27504d[_0xa605('0x5d')]?JSON[_0xa605('0x2a')](_0x27504d[_0xa605('0x5d')]):_0xa605('0x6c'));return respondWithRpcPromise('AcceptMessage',_0xa605('0x6d'),_0x181dc1);}return null;})[_0xa605('0x25')](function(_0x34acb4){var _0x33c3ef=_0xa605('0x6e')+_0x34acb4[_0xa605('0x2d')][_0xa605('0x6f')];return db[_0xa605('0x70')][_0xa605('0x47')](_0x33c3ef,{'type':db['Sequelize']['QueryTypes'][_0xa605('0x71')],'raw':!![]})[_0xa605('0x25')](function(_0x28ce23){return _0x28ce23;});})[_0xa605('0x25')](function(_0x527b66){if(_0x527b66){_0x181dc1[_0xa605('0x2d')]['contact']=_0x527b66[0x0];if(!_0x27504d[_0xa605('0x5d')][_0xa605('0x64')])return;return db[_0xa605('0x72')]['find']({'where':{'id':_0x27504d[_0xa605('0x5d')]['UserId'],'role':'agent'},'attributes':['id','name',_0xa605('0x73'),_0xa605('0x74'),_0xa605('0x75')],'raw':!![]});}return null;})[_0xa605('0x25')](function(_0x499cdd){if(!_0x499cdd)return null;_0x181dc1[_0xa605('0x2d')][_0xa605('0x65')]=_0x499cdd;return _0x181dc1;})[_0xa605('0x25')](function(_0x4ba867){if(_0x4ba867){if(_0x27504d[_0xa605('0x5d')][_0xa605('0x76')]){_0x181dc1[_0xa605('0x2d')][_0xa605('0x77')]=util['format'](_0xa605('0x78'),_0x27504d[_0xa605('0x6a')][_0xa605('0x3f')]);_0x181dc1['message']['channel']=_0x181dc1['channel'];_0x181dc1[_0xa605('0x2d')][_0xa605('0x79')]=_0x181dc1[_0xa605('0x7a')];_0x181dc1[_0xa605('0x2d')][_0xa605('0x7b')]=_0xa605('0x7c');return respondWithRpcPromise(_0xa605('0x7d'),_0xa605('0x7d'),{'event':_0xa605('0x7e'),'message':_0x181dc1['message']},client9002)[_0xa605('0x25')](function(){return _0x181dc1;});}return _0x181dc1;}return null;})[_0xa605('0x25')](respondWithResult(_0x2b2f3c,null))[_0xa605('0x2f')](handleError(_0x2b2f3c,null));};var interaction_log=require('../../config/logger')(_0xa605('0x7f'));exports[_0xa605('0x3b')]=function(_0x4ff86b,_0xaab346,_0x28d4e5){var _0x1a862f={'agent':{},'channel':'sms'};if(_0x4ff86b[_0xa605('0x5d')]['id']){delete _0x4ff86b['body']['id'];}_0x4ff86b[_0xa605('0x5d')][_0xa605('0x64')]=_0x4ff86b[_0xa605('0x5d')][_0xa605('0x64')]||_0x4ff86b[_0xa605('0x6a')]['id'];_0x1a862f[_0xa605('0x65')]['id']=_0x4ff86b[_0xa605('0x5d')][_0xa605('0x64')];return db[_0xa605('0x43')][_0xa605('0x5b')]({'where':{'id':_0x4ff86b[_0xa605('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xaab346,null))[_0xa605('0x25')](function(_0x148ecd){if(_0x148ecd){_0x1a862f[_0xa605('0x2d')]=_0x148ecd['get']({'plain':!![]});return db['SmsInteraction'][_0xa605('0x5b')]({'where':{'id':_0x148ecd[_0xa605('0x66')]}});}return null;})[_0xa605('0x25')](handleEntityNotFound(_0xaab346,null))['then'](function(_0x21c8b5){if(_0x21c8b5){_0x1a862f['interaction']=_0x21c8b5[_0xa605('0x68')]({'plain':!![]});interaction_log['info'](_0xa605('0x80'),_0x4ff86b[_0xa605('0x6a')]['id'],_0x4ff86b[_0xa605('0x6a')][_0xa605('0x3f')],_0x4ff86b[_0xa605('0x6a')][_0xa605('0x6b')],_0x1a862f[_0xa605('0x67')]['id'],_0x4ff86b[_0xa605('0x5d')]?JSON[_0xa605('0x2a')](_0x4ff86b[_0xa605('0x5d')]):_0xa605('0x6c'));return respondWithRpcPromise(_0xa605('0x81'),'rejectMessage',_0x1a862f);}return null;})[_0xa605('0x25')](function(_0x5cb3b5){var _0x156b38=_0xa605('0x6e')+_0x5cb3b5[_0xa605('0x2d')][_0xa605('0x6f')];return db[_0xa605('0x70')][_0xa605('0x47')](_0x156b38,{'type':db[_0xa605('0x82')][_0xa605('0x83')]['SELECT'],'raw':!![]})[_0xa605('0x25')](function(_0x53f5c0){return _0x53f5c0;});})[_0xa605('0x25')](function(_0x1f77a1){if(_0x1f77a1){_0x1a862f['message'][_0xa605('0x84')]=_0x1f77a1[0x0];if(!_0x4ff86b[_0xa605('0x5d')][_0xa605('0x64')])return;return db[_0xa605('0x72')]['find']({'where':{'id':_0x4ff86b[_0xa605('0x5d')][_0xa605('0x64')],'role':_0xa605('0x65')},'attributes':['id',_0xa605('0x3f'),_0xa605('0x73'),_0xa605('0x74'),_0xa605('0x75')],'raw':!![]});}return null;})[_0xa605('0x25')](function(_0x26a780){if(!_0x26a780)return null;_0x1a862f['message'][_0xa605('0x65')]=_0x26a780;return _0x1a862f;})['then'](function(_0x4d3400){if(_0x4d3400){_0x4d3400[_0xa605('0x2d')][_0xa605('0x77')]=util[_0xa605('0x62')](_0xa605('0x78'),_0x4ff86b[_0xa605('0x6a')][_0xa605('0x3f')]);_0x4d3400[_0xa605('0x2d')][_0xa605('0x7a')]=_0x1a862f[_0xa605('0x7a')];_0x4d3400['message'][_0xa605('0x79')]=_0x1a862f[_0xa605('0x7a')];_0x4d3400[_0xa605('0x2d')][_0xa605('0x7b')]=_0xa605('0x3b');respondWithRpcPromise(_0xa605('0x7d'),_0xa605('0x7d'),{'event':_0xa605('0x85'),'message':_0x4d3400[_0xa605('0x2d')]},client9002);return _0x1a862f;}return null;})[_0xa605('0x25')](respondWithResult(_0xaab346,null))[_0xa605('0x2f')](handleError(_0xaab346,null));};exports[_0xa605('0x31')]=function(_0x1842b7,_0x4818a0,_0x34806c){if(_0x1842b7[_0xa605('0x5d')]['id']){delete _0x1842b7[_0xa605('0x5d')]['id'];}var _0x2162d7;return db[_0xa605('0x43')]['find']({'where':{'id':_0x1842b7[_0xa605('0x59')]['id']}})['then'](handleEntityNotFound(_0x4818a0,null))[_0xa605('0x25')](function(_0x503889){if(_0x503889){_0x2162d7=_0x503889;return db[_0xa605('0x86')][_0xa605('0x5b')]({'where':{'id':_0x503889[_0xa605('0x87')]}});}})[_0xa605('0x25')](handleEntityNotFound(_0x4818a0,null))[_0xa605('0x25')](function(_0x41e8b9){if(_0x41e8b9){logger['debug'](_0xa605('0x29'),_0xa605('0x31'),'received\x20delivery\x20report\x20from',_0x41e8b9['type'],util[_0xa605('0x88')](_0x1842b7[_0xa605('0x5d')],{'showHidden':![],'depth':null}));switch(_0x41e8b9['type']){case _0xa605('0x89'):if(_0x1842b7[_0xa605('0x5d')][_0xa605('0x8a')]&&_0x1842b7[_0xa605('0x5d')][_0xa605('0x8a')]===_0x2162d7[_0xa605('0x8b')]){return _0x2162d7['update']({'read':!![]});}else{logger[_0xa605('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa605('0x31'),_0xa605('0x89'),util[_0xa605('0x88')](_0x1842b7[_0xa605('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xa605('0x8c'):if(_0x1842b7[_0xa605('0x5d')][_0xa605('0x8d')]&&_0x1842b7[_0xa605('0x5d')][_0xa605('0x8d')]===_0x2162d7[_0xa605('0x8b')]&&_[_0xa605('0x8e')]([_0xa605('0x8f'),_0xa605('0x90')],_0x1842b7[_0xa605('0x5d')][_0xa605('0x91')])>=0x0){return _0x2162d7[_0xa605('0x3d')]({'read':!![]});}else{logger[_0xa605('0x2b')](_0xa605('0x92'),_0xa605('0x31'),_0xa605('0x93'),util[_0xa605('0x88')](_0x1842b7[_0xa605('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xa605('0x94'):var _0x90b2c7=_0x1842b7[_0xa605('0x5d')][_0xa605('0x95')][0x0];if(_0x90b2c7['status'][_0xa605('0x96')]===_0xa605('0x97')){return _0x2162d7[_0xa605('0x3d')]({'read':!![]});}else{logger[_0xa605('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xa605('0x94'),util['inspect'](_0x1842b7[_0xa605('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x2162d7;}})['then'](respondWithResult(_0x4818a0,null))[_0xa605('0x2f')](handleError(_0x4818a0,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index ec858e9..1c65c60 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 _0x3573=['update','remove','emit','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0x59eefb,_0x2151ce){var _0x1a49e8=function(_0x5a758c){while(--_0x5a758c){_0x59eefb['push'](_0x59eefb['shift']());}};_0x1a49e8(++_0x2151ce);}(_0x3573,0xb0));var _0x3357=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3573[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x3357('0x0'));var SmsMessage=require(_0x3357('0x1'))['db'][_0x3357('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x3357('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3357('0x4'),'afterDestroy':_0x3357('0x5')};function emitEvent(_0x3f8903){return function(_0x237e3d,_0x4273b1,_0x39ac3e){SmsMessageEvents[_0x3357('0x6')](_0x3f8903+':'+_0x237e3d['id'],_0x237e3d);SmsMessageEvents[_0x3357('0x6')](_0x3f8903,_0x237e3d);_0x39ac3e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x3357('0x7')](e,emitEvent(event));}}module[_0x3357('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0xe19c=['exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x446fbc,_0x239a91){var _0x3e5d6f=function(_0x1e6e7b){while(--_0x1e6e7b){_0x446fbc['push'](_0x446fbc['shift']());}};_0x3e5d6f(++_0x239a91);}(_0xe19c,0x6d));var _0xce19=function(_0x17a28b,_0x5d1465){_0x17a28b=_0x17a28b-0x0;var _0x9cbb5a=_0xe19c[_0x17a28b];return _0x9cbb5a;};'use strict';var EventEmitter=require(_0xce19('0x0'));var SmsMessage=require(_0xce19('0x1'))['db'][_0xce19('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xce19('0x3')](0x0);var events={'afterCreate':_0xce19('0x4'),'afterUpdate':_0xce19('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2ab03f){return function(_0x486b11,_0xb0286b,_0x5e8c25){SmsMessageEvents['emit'](_0x2ab03f+':'+_0x486b11['id'],_0x486b11);SmsMessageEvents[_0xce19('0x6')](_0x2ab03f,_0x486b11);_0x5e8c25(null);};}for(var e in events){if(events[_0xce19('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xce19('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index c0caedb..3a316c5 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 _0xb677=['base64','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','text','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','messageId','body','get','direction','out','secret','isNil','UserId','SmsInteraction','findOne','then','update','createdAt','toLowerCase','catch','SmsAccount','find','type','twilio','accountSid','authToken','phone','remote','/api/sms/messages/','/status?token=','token','sid','error','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','smsMethod','sender','login?username=','username','&password=','password','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','read','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','clicksend','xCALLY\x20Motion','senderString','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','http_code','data','messages','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','toString'];(function(_0x57d141,_0x5dd8d0){var _0x1ec420=function(_0x43c5d8){while(--_0x43c5d8){_0x57d141['push'](_0x57d141['shift']());}};_0x1ec420(++_0x5dd8d0);}(_0xb677,0x119));var _0x7b67=function(_0xd5a731,_0x41cae8){_0xd5a731=_0xd5a731-0x0;var _0x2b88bc=_0xb677[_0xd5a731];return _0x2b88bc;};'use strict';var _=require(_0x7b67('0x0'));var util=require('util');var logger=require(_0x7b67('0x1'))(_0x7b67('0x2'));var moment=require(_0x7b67('0x3'));var BPromise=require(_0x7b67('0x4'));var rp=require(_0x7b67('0x5'));var fs=require('fs');var path=require(_0x7b67('0x6'));var rimraf=require(_0x7b67('0x7'));var config=require(_0x7b67('0x8'));var attributes=require('./smsMessage.attributes');module[_0x7b67('0x9')]=function(_0x21ccf2,_0x2beadb){return _0x21ccf2[_0x7b67('0xa')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x7b67('0xb')]},{'name':'fti_sms_messages','fields':[_0x7b67('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x34e306,_0x248aad,_0x565daf){var _0x1f1f6b=_0x21ccf2['models'];var _0x18015f=_0x34e306[_0x7b67('0xd')]({'plain':!![]});if(_0x18015f[_0x7b67('0xe')]['toLowerCase']()==='in'||_0x18015f['direction']['toLowerCase']()===_0x7b67('0xf')&&!_0x18015f[_0x7b67('0x10')]&&!_[_0x7b67('0x11')](_0x18015f[_0x7b67('0x12')])){_0x1f1f6b[_0x7b67('0x13')][_0x7b67('0x14')]({'where':{'id':_0x18015f['SmsInteractionId']}})[_0x7b67('0x15')](function(_0x473d10){if(_0x473d10){_0x473d10[_0x7b67('0x16')]({'lastMsgAt':_0x18015f[_0x7b67('0x17')],'lastMsgDirection':_0x18015f[_0x7b67('0xe')][_0x7b67('0x18')]()});}})[_0x7b67('0x19')](function(_0xf99987){console['error'](_0xf99987);});}if(_0x18015f[_0x7b67('0xe')]===_0x7b67('0xf')&&!_0x18015f[_0x7b67('0x10')]){var _0x41e23d;_0x1f1f6b[_0x7b67('0x1a')][_0x7b67('0x1b')]({'where':{'id':_0x18015f['SmsAccountId']},'raw':!![]})[_0x7b67('0x15')](function(_0x348f28){_0x41e23d=_0x348f28;if(_0x41e23d&&_0x41e23d[_0x7b67('0x1c')]){switch(_0x41e23d[_0x7b67('0x1c')]){case _0x7b67('0x1d'):var _0x4095e7=require(_0x7b67('0x1d'));if(_0x41e23d[_0x7b67('0x1e')]&&_0x41e23d[_0x7b67('0x1f')]&&_0x41e23d[_0x7b67('0x20')]){var _0x5ddb36=new _0x4095e7(_0x41e23d[_0x7b67('0x1e')],_0x41e23d[_0x7b67('0x1f')]);_0x5ddb36['messages']['create']({'body':_0x18015f['body'],'to':_0x18015f['phone'],'from':_0x41e23d[_0x7b67('0x20')],'statusCallback':_0x41e23d[_0x7b67('0x21')]+_0x7b67('0x22')+_0x18015f['id']+_0x7b67('0x23')+_0x41e23d[_0x7b67('0x24')]})['then'](function(_0x3b4fea){if(_0x3b4fea[_0x7b67('0x25')]){return _0x34e306[_0x7b67('0x16')]({'messageId':_0x3b4fea[_0x7b67('0x25')]});}})[_0x7b67('0x19')](function(_0x3e9630){logger[_0x7b67('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7b67('0x27'),'twilio',util[_0x7b67('0x28')](_0x3e9630,{'showHidden':![],'depth':null}));});}else{logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),'twilio',_0x7b67('0x2a'));}break;case _0x7b67('0x2b'):var _0x37e35f='https://api.skebby.it/API/v1.0/REST/';if(_0x41e23d['username']&&_0x41e23d['password']){var _0x8649ec={'recipient':[_0x18015f['phone']],'message':_0x18015f['body'],'message_type':_0x41e23d[_0x7b67('0x2c')]};if(_0x41e23d[_0x7b67('0x2c')]&&_0x41e23d['smsMethod']!=='SI'){_0x8649ec[_0x7b67('0x2d')]=_0x41e23d['phone'];}var _0x2c5a11={'url':_0x37e35f+_0x7b67('0x2e')+_0x41e23d[_0x7b67('0x2f')]+_0x7b67('0x30')+_0x41e23d[_0x7b67('0x31')],'method':_0x7b67('0x32')};rp(_0x2c5a11)[_0x7b67('0x15')](function(_0x7af5fe){var _0x138b78=_0x7af5fe[_0x7b67('0x33')](';');var _0x452b49={'user_key':_0x138b78[0x0],'session_key':_0x138b78[0x1]};_0x2c5a11={'url':_0x37e35f+_0x7b67('0x34'),'method':_0x7b67('0x35'),'headers':{'user_key':_0x452b49[_0x7b67('0x36')],'Session_key':_0x452b49[_0x7b67('0x37')]},'json':!![],'body':_0x8649ec};return rp(_0x2c5a11);})[_0x7b67('0x15')](function(_0x20c18b){if(_0x20c18b[_0x7b67('0x38')]>=0x1){var _0x5b06ff={'messageId':_0x20c18b[_0x7b67('0x39')]};if(_0x41e23d[_0x7b67('0x2c')]!=='GP'||!_0x41e23d['deliveryReport']){_0x5b06ff[_0x7b67('0x3a')]=!![];}return _0x34e306[_0x7b67('0x16')](_0x5b06ff);}else{return logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),_0x7b67('0x2b'),util[_0x7b67('0x28')](_0x20c18b,{'showHidden':![],'depth':null}));}})[_0x7b67('0x19')](function(_0x44f819){return logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),_0x7b67('0x2b'),util['inspect'](_0x44f819,{'showHidden':![],'depth':null}));});}else{logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),_0x7b67('0x2b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x7b67('0x3b'):if(_0x41e23d[_0x7b67('0x1f')]){var _0x50a197={'recipient':_0x18015f[_0x7b67('0x20')],'message':_0x18015f[_0x7b67('0xc')],'sender':_0x41e23d['senderString']||_0x41e23d[_0x7b67('0x20')],'authorization':_0x41e23d[_0x7b67('0x1f')]};var _0x248aad={'method':_0x7b67('0x35'),'uri':_0x7b67('0x3c'),'body':_0x50a197,'json':!![]};rp(_0x248aad)[_0x7b67('0x15')](function(_0x1de6b2){var _0x254eec={'messageId':_0x1de6b2[_0x7b67('0x3d')]};if(!_0x41e23d[_0x7b67('0x3e')]){_0x254eec[_0x7b67('0x3a')]=!![];}return _0x34e306[_0x7b67('0x16')](_0x254eec);})[_0x7b67('0x19')](function(_0x2ef44e){logger[_0x7b67('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7b67('0x27'),_0x7b67('0x3b'),util[_0x7b67('0x28')](_0x2ef44e,{'showHidden':![],'depth':null}));});}else{logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0x7b67('0x3f'):if(_0x41e23d[_0x7b67('0x2f')]&&_0x41e23d['password']){var _0x50a197={'messages':[{'source':_0x7b67('0x40'),'to':_0x18015f[_0x7b67('0x20')],'body':_0x18015f[_0x7b67('0xc')],'from':_0x41e23d[_0x7b67('0x41')]||_0x41e23d[_0x7b67('0x20')]}]};var _0x430067=util['format'](_0x7b67('0x42'),_0x41e23d[_0x7b67('0x2f')],_0x41e23d[_0x7b67('0x31')]);var _0x248aad={'method':'POST','uri':_0x7b67('0x43'),'body':_0x50a197,'headers':{'Authorization':util[_0x7b67('0x44')](_0x7b67('0x45'),new Buffer(_0x430067)['toString']('base64'))},'json':!![]};rp(_0x248aad)[_0x7b67('0x15')](function(_0x520ffb){if(_0x520ffb[_0x7b67('0x46')]>=0xc8&&_0x520ffb['http_code']<=0xce){if(_0x520ffb['data']&&_0x520ffb[_0x7b67('0x47')]['queued_count']>0x0){var _0x88e611=_['head'](_0x520ffb[_0x7b67('0x47')][_0x7b67('0x48')]);var _0x4e764a={'messageId':_0x88e611[_0x7b67('0x49')]};if(!_0x41e23d[_0x7b67('0x3e')]){_0x4e764a[_0x7b67('0x3a')]=!![];}return _0x34e306[_0x7b67('0x16')](_0x4e764a);}else{logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),_0x7b67('0x4a'),util[_0x7b67('0x28')](_0x520ffb,{'showHidden':![],'depth':null}));}}else{logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),_0x7b67('0x4a'),util[_0x7b67('0x28')](_0x520ffb,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3eb8ff){logger[_0x7b67('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7b67('0x27'),'clickSend',util[_0x7b67('0x28')](_0x3eb8ff,{'showHidden':![],'depth':null}));});}else{logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),'clickSend',_0x7b67('0x4b'));}break;case _0x7b67('0x4c'):if(_0x41e23d[_0x7b67('0x4d')]&&_0x41e23d['authToken']){var _0x50a197={'dst':_0x18015f[_0x7b67('0x20')],'text':_0x18015f[_0x7b67('0xc')],'src':_0x41e23d['senderString']||_0x41e23d['phone'],'url':_0x41e23d[_0x7b67('0x21')]+_0x7b67('0x22')+_0x18015f['id']+_0x7b67('0x23')+_0x41e23d[_0x7b67('0x24')]};var _0x430067=util['format'](_0x7b67('0x42'),_0x41e23d[_0x7b67('0x4d')],_0x41e23d[_0x7b67('0x1f')]);var _0x248aad={'method':'POST','uri':util[_0x7b67('0x44')]('https://api.plivo.com/v1/Account/%s/Message/',_0x41e23d[_0x7b67('0x4d')]),'body':_0x50a197,'headers':{'Authorization':util[_0x7b67('0x44')](_0x7b67('0x45'),new Buffer(_0x430067)[_0x7b67('0x4e')](_0x7b67('0x4f')))},'json':!![]};rp(_0x248aad)[_0x7b67('0x15')](function(_0x4195e0){var _0x2023da={'messageId':_0x4195e0['message_uuid'][0x0]};return _0x34e306['update'](_0x2023da);})['catch'](function(_0x572cd7){logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),_0x7b67('0x4c'),util[_0x7b67('0x28')](_0x572cd7,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7b67('0x29'),'afterCreate',_0x7b67('0x4c'),_0x7b67('0x50'));}break;case _0x7b67('0x51'):if(_0x41e23d[_0x7b67('0x2f')]&&_0x41e23d[_0x7b67('0x31')]){if(_0x41e23d['baseUrl']){var _0x1b0769={'method':_0x7b67('0x35'),'uri':_0x41e23d[_0x7b67('0x52')]+_0x7b67('0x53'),'body':{'username':_0x41e23d['username'],'password':_0x41e23d[_0x7b67('0x31')]},'json':!![]};return rp(_0x1b0769)[_0x7b67('0x15')](function(_0x4ece53){var _0x3ff2a8={'method':_0x7b67('0x35'),'uri':_0x41e23d[_0x7b67('0x52')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x41e23d[_0x7b67('0x20')],'destinations':[{'to':_0x18015f[_0x7b67('0x20')]}],'text':_0x18015f['body'],'notifyUrl':_0x41e23d['remote']+_0x7b67('0x22')+_0x18015f['id']+_0x7b67('0x23')+_0x41e23d[_0x7b67('0x24')],'notifyContentType':'application/json','callbackData':_0x41e23d[_0x7b67('0x20')]+';'+_0x18015f[_0x7b67('0xc')]}]},'headers':{'Authorization':_0x7b67('0x54')+_0x4ece53['token']},'json':!![]};return rp(_0x3ff2a8)[_0x7b67('0x15')](function(_0x1d4283){if(_0x1d4283['messages']){var _0x5b4fde={'messageId':_0x1d4283['messages'][0x0][_0x7b67('0xb')]};if(!_0x41e23d[_0x7b67('0x3e')]){_0x5b4fde[_0x7b67('0x3a')]=!![];}return _0x34e306['update'](_0x5b4fde);}else{return logger['error'](_0x7b67('0x29'),'afterCreate',_0x7b67('0x51'),util[_0x7b67('0x28')](_0x1d4283,{'showHidden':![],'depth':null}));}});})[_0x7b67('0x19')](function(_0x51a207){return logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),_0x7b67('0x51'),util[_0x7b67('0x28')](_0x51a207,{'showHidden':![],'depth':null}));});}else{logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),_0x7b67('0x51'),_0x7b67('0x55'));}}else{logger['error'](_0x7b67('0x29'),_0x7b67('0x27'),'infobip','Missing\x20parameters:\x20username,\x20password');}break;case _0x7b67('0x56'):var _0x4975a2=require('crypto');if(_0x41e23d[_0x7b67('0x57')]){var _0x553a33={};_0x553a33['login']=_0x41e23d[_0x7b67('0x2f')];_0x553a33['phone']=_0x18015f[_0x7b67('0x20')];_0x553a33[_0x7b67('0x2d')]=_0x41e23d[_0x7b67('0x20')];_0x553a33[_0x7b67('0x58')]=_0x18015f[_0x7b67('0xc')];_0x553a33[_0x7b67('0x59')]=+new Date();var _0x490326='';var _0x4c293c='';var _0x54b487=Object[_0x7b67('0x5a')](_0x553a33);_0x54b487[_0x7b67('0x5b')]();for(var _0x20ad14=0x0;_0x20ad14<_0x54b487[_0x7b67('0x5c')];_0x20ad14++){if(_0x490326!=''){_0x490326+='&';}_0x490326+=_0x54b487[_0x20ad14]+'='+encodeURIComponent(_0x553a33[_0x54b487[_0x20ad14]]);_0x4c293c+=_0x553a33[_0x54b487[_0x20ad14]];}_0x4c293c+=_0x41e23d['apiKey'];_0x4c293c=_0x4975a2[_0x7b67('0x5d')](_0x7b67('0x5e'))[_0x7b67('0x16')](_0x4c293c)[_0x7b67('0x5f')](_0x7b67('0x60'));if(_0x490326!==''){_0x490326+='&';}_0x490326+=_0x7b67('0x61')+_0x4c293c;var _0x2c5a11={'method':_0x7b67('0x32'),'uri':_0x41e23d['baseUrl']+_0x7b67('0x62')+_0x490326,'json':!![]};return rp(_0x2c5a11)[_0x7b67('0x15')](function(_0x5a6ac5){var _0x361b76=Object[_0x7b67('0x5a')](_0x5a6ac5);if(_0x5a6ac5[_0x361b76[0x0]][_0x7b67('0x26')]&&parseInt(_0x5a6ac5[_0x361b76[0x0]][_0x7b67('0x26')])===0x0){var _0x2ef917={'messageId':_0x5a6ac5[_0x361b76[0x0]]['id_sms']};if(!_0x41e23d[_0x7b67('0x3e')]){_0x2ef917['read']=!![];}return _0x34e306[_0x7b67('0x16')](_0x2ef917);}else{return logger[_0x7b67('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7b67('0x27'),_0x7b67('0x56'),util[_0x7b67('0x28')](_0x5a6ac5['error'],{'showHidden':![],'depth':null}));}})[_0x7b67('0x19')](function(_0x458f8d){return logger['error'](_0x7b67('0x29'),_0x7b67('0x27'),'csc',util['inspect'](_0x458f8d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7b67('0x29'),_0x7b67('0x27'),_0x7b67('0x56'),_0x7b67('0x63'));}break;case _0x7b67('0x64'):if(_0x41e23d[_0x7b67('0x57')]){var _0x54777e={'method':'POST','uri':_0x7b67('0x65'),'headers':{'Authorization':_0x41e23d[_0x7b67('0x57')]},'body':{'content':_0x18015f[_0x7b67('0xc')],'to':[_0x18015f['phone']],'from':_0x41e23d['phone'],'binary':![],'clientMessageId':_0x7b67('0x66'),'charset':_0x7b67('0x67')},'json':!![]};rp(_0x54777e)['then'](function(_0x347b55){if(!_0x347b55[_0x7b67('0x26')]){var _0x4631e8={'messageId':_0x347b55['messages'][0x0][_0x7b67('0x68')]};if(!_0x41e23d[_0x7b67('0x3e')]){_0x4631e8[_0x7b67('0x3a')]=!![];}return _0x34e306[_0x7b67('0x16')](_0x4631e8);}else{return logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),_0x7b67('0x64'),util[_0x7b67('0x28')](_0x347b55[_0x7b67('0x26')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x4ee21b){return logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),'clickatell',util[_0x7b67('0x28')](_0x4ee21b,{'showHidden':![],'depth':null}));});}else{logger[_0x7b67('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7b67('0x27'),_0x7b67('0x64'),_0x7b67('0x63'));}break;case _0x7b67('0x69'):if(_0x41e23d[_0x7b67('0x2f')]&&_0x41e23d[_0x7b67('0x31')]){var _0x430067=util['format'](_0x7b67('0x42'),_0x41e23d['username'],_0x41e23d['password']);var _0x248aad={'method':_0x7b67('0x35'),'uri':_0x7b67('0x6a')+_0x41e23d[_0x7b67('0x6b')]+_0x7b67('0x6c'),'body':{'to':[_0x18015f[_0x7b67('0x20')]],'text':_0x18015f['body'],'from':_0x41e23d[_0x7b67('0x20')],'applicationId':_0x41e23d[_0x7b67('0x6d')]},'headers':{'Authorization':util[_0x7b67('0x44')](_0x7b67('0x45'),new Buffer(_0x430067)[_0x7b67('0x4e')](_0x7b67('0x4f')))},'json':!![]};rp(_0x248aad)[_0x7b67('0x15')](function(_0x1850a1){if(_0x1850a1['id']){var _0x1a42ba={'messageId':_0x1850a1['id']};return _0x34e306[_0x7b67('0x16')](_0x1a42ba);}else{logger['error'](_0x7b67('0x29'),'afterCreate',_0x7b67('0x69'),util[_0x7b67('0x28')](_0x1850a1,{'showHidden':![],'depth':null}));}})['catch'](function(_0x57206b){logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),_0x7b67('0x69'),util[_0x7b67('0x28')](_0x57206b,{'showHidden':![],'depth':null}));});}else{logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),_0x7b67('0x69'),_0x7b67('0x4b'));}break;case _0x7b67('0x6e'):if(_0x41e23d['apiKey']){var _0x26a78d={};var _0x2c5a11={'method':_0x7b67('0x35'),'uri':_0x7b67('0x6f'),'headers':{'Authorization':_0x7b67('0x70')+_0x41e23d[_0x7b67('0x57')],'Content-Type':_0x7b67('0x71')},'body':{'from':_0x41e23d['phone'],'to':_0x18015f[_0x7b67('0x20')],'text':_0x18015f['body']},'json':!![]};return rp(_0x2c5a11)[_0x7b67('0x15')](function(_0x10ccc0){if(_0x10ccc0['code']==0xca){_0x26a78d[_0x7b67('0x72')]=_0x10ccc0;var _0x3075ef={'method':_0x7b67('0x35'),'uri':_0x7b67('0x73'),'headers':{'Authorization':_0x7b67('0x70')+_0x41e23d['apiKey'],'Content-Type':_0x7b67('0x71')},'body':{'refid':_0x26a78d[_0x7b67('0x72')]['refid']},'json':!![]};return rp(_0x3075ef)[_0x7b67('0x15')](function(_0x5af1a8){_0x26a78d['status']=_0x5af1a8;var _0x3a9f31={'messageId':_0x26a78d[_0x7b67('0x72')][_0x7b67('0x74')],'read':!![]};return _0x34e306['update'](_0x3a9f31);});}else{return logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),_0x7b67('0x6e'),util['inspect'](_0x10ccc0,{'showHidden':![],'depth':null}));}})[_0x7b67('0x19')](function(_0x4b400f){return logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),_0x7b67('0x6e'),util[_0x7b67('0x28')](_0x4b400f,{'showHidden':![],'depth':null}));});}else{return logger[_0x7b67('0x26')](_0x7b67('0x29'),_0x7b67('0x27'),_0x7b67('0x6e'),'Token\x20not\x20received');}break;}}})[_0x7b67('0x75')](function(){_0x565daf();});}else{_0x565daf();}}},'charset':_0x7b67('0x76'),'collate':_0x7b67('0x77')});}; \ No newline at end of file +var _0x2746=['password','smsMethod','sender','username','&password=','GET','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','Missing\x20parameters:\x20authToken','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','data','head','message_id','clickSend','plivo','authId','message_uuid','baseUrl','/auth/1/session','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','timestamp','length','md5','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','body','models','get','direction','toLowerCase','secret','UserId','SmsInteraction','findOne','then','update','createdAt','catch','error','out','SmsAccount','find','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','/status?token=','token','sid','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/'];(function(_0x40fe9b,_0x32c044){var _0x4847ad=function(_0x27c0dc){while(--_0x27c0dc){_0x40fe9b['push'](_0x40fe9b['shift']());}};_0x4847ad(++_0x32c044);}(_0x2746,0x19c));var _0x6274=function(_0xf3436f,_0x2c70c1){_0xf3436f=_0xf3436f-0x0;var _0x333638=_0x2746[_0xf3436f];return _0x333638;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6274('0x0'))(_0x6274('0x1'));var moment=require(_0x6274('0x2'));var BPromise=require(_0x6274('0x3'));var rp=require(_0x6274('0x4'));var fs=require('fs');var path=require(_0x6274('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6274('0x6'));module[_0x6274('0x7')]=function(_0x1978ff,_0x534aee){return _0x1978ff[_0x6274('0x8')](_0x6274('0x9'),attributes,{'tableName':_0x6274('0xa'),'paranoid':![],'indexes':[{'name':_0x6274('0xb'),'fields':[_0x6274('0xb')]},{'name':'fti_sms_messages','fields':[_0x6274('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x218189,_0x11b702,_0x226681){var _0x371a51=_0x1978ff[_0x6274('0xd')];var _0x1eef9a=_0x218189[_0x6274('0xe')]({'plain':!![]});if(_0x1eef9a[_0x6274('0xf')][_0x6274('0x10')]()==='in'||_0x1eef9a['direction']['toLowerCase']()==='out'&&!_0x1eef9a[_0x6274('0x11')]&&!_['isNil'](_0x1eef9a[_0x6274('0x12')])){_0x371a51[_0x6274('0x13')][_0x6274('0x14')]({'where':{'id':_0x1eef9a['SmsInteractionId']}})[_0x6274('0x15')](function(_0x488b60){if(_0x488b60){_0x488b60[_0x6274('0x16')]({'lastMsgAt':_0x1eef9a[_0x6274('0x17')],'lastMsgDirection':_0x1eef9a['direction']['toLowerCase']()});}})[_0x6274('0x18')](function(_0x1d0dc4){console[_0x6274('0x19')](_0x1d0dc4);});}if(_0x1eef9a[_0x6274('0xf')]===_0x6274('0x1a')&&!_0x1eef9a['secret']){var _0x3219d1;_0x371a51[_0x6274('0x1b')][_0x6274('0x1c')]({'where':{'id':_0x1eef9a['SmsAccountId']},'raw':!![]})['then'](function(_0x43593c){_0x3219d1=_0x43593c;if(_0x3219d1&&_0x3219d1['type']){switch(_0x3219d1['type']){case _0x6274('0x1d'):var _0x4e7442=require(_0x6274('0x1d'));if(_0x3219d1[_0x6274('0x1e')]&&_0x3219d1['authToken']&&_0x3219d1['phone']){var _0x3e0248=new _0x4e7442(_0x3219d1[_0x6274('0x1e')],_0x3219d1[_0x6274('0x1f')]);_0x3e0248[_0x6274('0x20')][_0x6274('0x21')]({'body':_0x1eef9a[_0x6274('0xc')],'to':_0x1eef9a[_0x6274('0x22')],'from':_0x3219d1[_0x6274('0x22')],'statusCallback':_0x3219d1[_0x6274('0x23')]+_0x6274('0x24')+_0x1eef9a['id']+_0x6274('0x25')+_0x3219d1[_0x6274('0x26')]})[_0x6274('0x15')](function(_0xa0c8bd){if(_0xa0c8bd[_0x6274('0x27')]){return _0x218189[_0x6274('0x16')]({'messageId':_0xa0c8bd[_0x6274('0x27')]});}})[_0x6274('0x18')](function(_0x5228a1){logger[_0x6274('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6274('0x28'),'twilio',util[_0x6274('0x29')](_0x5228a1,{'showHidden':![],'depth':null}));});}else{logger[_0x6274('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6274('0x28'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x6274('0x2a'):var _0x375641=_0x6274('0x2b');if(_0x3219d1['username']&&_0x3219d1[_0x6274('0x2c')]){var _0x49df2e={'recipient':[_0x1eef9a['phone']],'message':_0x1eef9a['body'],'message_type':_0x3219d1[_0x6274('0x2d')]};if(_0x3219d1[_0x6274('0x2d')]&&_0x3219d1[_0x6274('0x2d')]!=='SI'){_0x49df2e[_0x6274('0x2e')]=_0x3219d1[_0x6274('0x22')];}var _0x868ff9={'url':_0x375641+'login?username='+_0x3219d1[_0x6274('0x2f')]+_0x6274('0x30')+_0x3219d1[_0x6274('0x2c')],'method':_0x6274('0x31')};rp(_0x868ff9)[_0x6274('0x15')](function(_0x232b1f){var _0x3211d0=_0x232b1f['split'](';');var _0x4cd1a7={'user_key':_0x3211d0[0x0],'session_key':_0x3211d0[0x1]};_0x868ff9={'url':_0x375641+_0x6274('0x32'),'method':_0x6274('0x33'),'headers':{'user_key':_0x4cd1a7[_0x6274('0x34')],'Session_key':_0x4cd1a7[_0x6274('0x35')]},'json':!![],'body':_0x49df2e};return rp(_0x868ff9);})[_0x6274('0x15')](function(_0x2a5811){if(_0x2a5811[_0x6274('0x36')]>=0x1){var _0x3c2365={'messageId':_0x2a5811[_0x6274('0x37')]};if(_0x3219d1[_0x6274('0x2d')]!=='GP'||!_0x3219d1[_0x6274('0x38')]){_0x3c2365[_0x6274('0x39')]=!![];}return _0x218189['update'](_0x3c2365);}else{return logger[_0x6274('0x19')](_0x6274('0x3a'),_0x6274('0x28'),_0x6274('0x2a'),util[_0x6274('0x29')](_0x2a5811,{'showHidden':![],'depth':null}));}})[_0x6274('0x18')](function(_0x518397){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6274('0x28'),_0x6274('0x2a'),util[_0x6274('0x29')](_0x518397,{'showHidden':![],'depth':null}));});}else{logger[_0x6274('0x19')](_0x6274('0x3a'),_0x6274('0x28'),_0x6274('0x2a'),_0x6274('0x3b'));}break;case _0x6274('0x3c'):if(_0x3219d1[_0x6274('0x1f')]){var _0x1b5671={'recipient':_0x1eef9a[_0x6274('0x22')],'message':_0x1eef9a[_0x6274('0xc')],'sender':_0x3219d1[_0x6274('0x3d')]||_0x3219d1[_0x6274('0x22')],'authorization':_0x3219d1[_0x6274('0x1f')]};var _0x11b702={'method':_0x6274('0x33'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x1b5671,'json':!![]};rp(_0x11b702)[_0x6274('0x15')](function(_0x3737ee){var _0x417a4c={'messageId':_0x3737ee[_0x6274('0x3e')]};if(!_0x3219d1[_0x6274('0x38')]){_0x417a4c[_0x6274('0x39')]=!![];}return _0x218189[_0x6274('0x16')](_0x417a4c);})[_0x6274('0x18')](function(_0x562301){logger['error'](_0x6274('0x3a'),_0x6274('0x28'),_0x6274('0x3c'),util[_0x6274('0x29')](_0x562301,{'showHidden':![],'depth':null}));});}else{logger[_0x6274('0x19')](_0x6274('0x3a'),'afterCreate','connectel',_0x6274('0x3f'));}break;case'clicksend':if(_0x3219d1['username']&&_0x3219d1['password']){var _0x1b5671={'messages':[{'source':'xCALLY\x20Motion','to':_0x1eef9a[_0x6274('0x22')],'body':_0x1eef9a[_0x6274('0xc')],'from':_0x3219d1[_0x6274('0x3d')]||_0x3219d1[_0x6274('0x22')]}]};var _0x83cbc2=util[_0x6274('0x40')](_0x6274('0x41'),_0x3219d1[_0x6274('0x2f')],_0x3219d1['password']);var _0x11b702={'method':_0x6274('0x33'),'uri':_0x6274('0x42'),'body':_0x1b5671,'headers':{'Authorization':util[_0x6274('0x40')](_0x6274('0x43'),new Buffer(_0x83cbc2)[_0x6274('0x44')](_0x6274('0x45')))},'json':!![]};rp(_0x11b702)[_0x6274('0x15')](function(_0x4bc8ef){if(_0x4bc8ef['http_code']>=0xc8&&_0x4bc8ef['http_code']<=0xce){if(_0x4bc8ef[_0x6274('0x46')]&&_0x4bc8ef[_0x6274('0x46')]['queued_count']>0x0){var _0x27f597=_[_0x6274('0x47')](_0x4bc8ef['data'][_0x6274('0x20')]);var _0xbb458a={'messageId':_0x27f597[_0x6274('0x48')]};if(!_0x3219d1[_0x6274('0x38')]){_0xbb458a['read']=!![];}return _0x218189[_0x6274('0x16')](_0xbb458a);}else{logger[_0x6274('0x19')](_0x6274('0x3a'),_0x6274('0x28'),'clickSend',util[_0x6274('0x29')](_0x4bc8ef,{'showHidden':![],'depth':null}));}}else{logger[_0x6274('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x6274('0x49'),util[_0x6274('0x29')](_0x4bc8ef,{'showHidden':![],'depth':null}));}})[_0x6274('0x18')](function(_0x1d27fc){logger[_0x6274('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6274('0x28'),_0x6274('0x49'),util['inspect'](_0x1d27fc,{'showHidden':![],'depth':null}));});}else{logger[_0x6274('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6274('0x28'),'clickSend',_0x6274('0x3b'));}break;case _0x6274('0x4a'):if(_0x3219d1['authId']&&_0x3219d1[_0x6274('0x1f')]){var _0x1b5671={'dst':_0x1eef9a['phone'],'text':_0x1eef9a['body'],'src':_0x3219d1['senderString']||_0x3219d1[_0x6274('0x22')],'url':_0x3219d1['remote']+'/api/sms/messages/'+_0x1eef9a['id']+_0x6274('0x25')+_0x3219d1[_0x6274('0x26')]};var _0x83cbc2=util[_0x6274('0x40')](_0x6274('0x41'),_0x3219d1[_0x6274('0x4b')],_0x3219d1[_0x6274('0x1f')]);var _0x11b702={'method':_0x6274('0x33'),'uri':util[_0x6274('0x40')]('https://api.plivo.com/v1/Account/%s/Message/',_0x3219d1['authId']),'body':_0x1b5671,'headers':{'Authorization':util[_0x6274('0x40')](_0x6274('0x43'),new Buffer(_0x83cbc2)[_0x6274('0x44')](_0x6274('0x45')))},'json':!![]};rp(_0x11b702)[_0x6274('0x15')](function(_0x137a90){var _0x12c731={'messageId':_0x137a90[_0x6274('0x4c')][0x0]};return _0x218189[_0x6274('0x16')](_0x12c731);})['catch'](function(_0x159e51){logger[_0x6274('0x19')](_0x6274('0x3a'),_0x6274('0x28'),_0x6274('0x4a'),util[_0x6274('0x29')](_0x159e51,{'showHidden':![],'depth':null}));});}else{logger[_0x6274('0x19')](_0x6274('0x3a'),'afterCreate',_0x6274('0x4a'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x3219d1[_0x6274('0x2f')]&&_0x3219d1[_0x6274('0x2c')]){if(_0x3219d1[_0x6274('0x4d')]){var _0x22a76f={'method':'POST','uri':_0x3219d1['baseUrl']+_0x6274('0x4e'),'body':{'username':_0x3219d1[_0x6274('0x2f')],'password':_0x3219d1['password']},'json':!![]};return rp(_0x22a76f)[_0x6274('0x15')](function(_0x26e3a7){var _0x28e7bc={'method':_0x6274('0x33'),'uri':_0x3219d1[_0x6274('0x4d')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x3219d1[_0x6274('0x22')],'destinations':[{'to':_0x1eef9a[_0x6274('0x22')]}],'text':_0x1eef9a[_0x6274('0xc')],'notifyUrl':_0x3219d1[_0x6274('0x23')]+_0x6274('0x24')+_0x1eef9a['id']+'/status?token='+_0x3219d1['token'],'notifyContentType':_0x6274('0x4f'),'callbackData':_0x3219d1[_0x6274('0x22')]+';'+_0x1eef9a[_0x6274('0xc')]}]},'headers':{'Authorization':_0x6274('0x50')+_0x26e3a7['token']},'json':!![]};return rp(_0x28e7bc)['then'](function(_0x276b39){if(_0x276b39[_0x6274('0x20')]){var _0x1ef230={'messageId':_0x276b39[_0x6274('0x20')][0x0][_0x6274('0xb')]};if(!_0x3219d1[_0x6274('0x38')]){_0x1ef230[_0x6274('0x39')]=!![];}return _0x218189[_0x6274('0x16')](_0x1ef230);}else{return logger[_0x6274('0x19')](_0x6274('0x3a'),_0x6274('0x28'),_0x6274('0x51'),util[_0x6274('0x29')](_0x276b39,{'showHidden':![],'depth':null}));}});})[_0x6274('0x18')](function(_0x35c33f){return logger[_0x6274('0x19')](_0x6274('0x3a'),_0x6274('0x28'),_0x6274('0x51'),util[_0x6274('0x29')](_0x35c33f,{'showHidden':![],'depth':null}));});}else{logger[_0x6274('0x19')](_0x6274('0x3a'),_0x6274('0x28'),_0x6274('0x51'),_0x6274('0x52'));}}else{logger[_0x6274('0x19')](_0x6274('0x3a'),_0x6274('0x28'),'infobip',_0x6274('0x3b'));}break;case _0x6274('0x53'):var _0x232c55=require(_0x6274('0x54'));if(_0x3219d1[_0x6274('0x55')]){var _0x3a04f0={};_0x3a04f0[_0x6274('0x56')]=_0x3219d1[_0x6274('0x2f')];_0x3a04f0[_0x6274('0x22')]=_0x1eef9a[_0x6274('0x22')];_0x3a04f0[_0x6274('0x2e')]=_0x3219d1[_0x6274('0x22')];_0x3a04f0['text']=_0x1eef9a[_0x6274('0xc')];_0x3a04f0[_0x6274('0x57')]=+new Date();var _0xe4bf5a='';var _0x44ec97='';var _0x1ae76c=Object['keys'](_0x3a04f0);_0x1ae76c['sort']();for(var _0x58399c=0x0;_0x58399c<_0x1ae76c[_0x6274('0x58')];_0x58399c++){if(_0xe4bf5a!=''){_0xe4bf5a+='&';}_0xe4bf5a+=_0x1ae76c[_0x58399c]+'='+encodeURIComponent(_0x3a04f0[_0x1ae76c[_0x58399c]]);_0x44ec97+=_0x3a04f0[_0x1ae76c[_0x58399c]];}_0x44ec97+=_0x3219d1[_0x6274('0x55')];_0x44ec97=_0x232c55['createHash'](_0x6274('0x59'))['update'](_0x44ec97)['digest']('hex');if(_0xe4bf5a!==''){_0xe4bf5a+='&';}_0xe4bf5a+='signature='+_0x44ec97;var _0x868ff9={'method':_0x6274('0x31'),'uri':_0x3219d1[_0x6274('0x4d')]+_0x6274('0x5a')+_0xe4bf5a,'json':!![]};return rp(_0x868ff9)[_0x6274('0x15')](function(_0x670171){var _0x37b6aa=Object[_0x6274('0x5b')](_0x670171);if(_0x670171[_0x37b6aa[0x0]]['error']&&parseInt(_0x670171[_0x37b6aa[0x0]][_0x6274('0x19')])===0x0){var _0x11728c={'messageId':_0x670171[_0x37b6aa[0x0]][_0x6274('0x5c')]};if(!_0x3219d1[_0x6274('0x38')]){_0x11728c[_0x6274('0x39')]=!![];}return _0x218189[_0x6274('0x16')](_0x11728c);}else{return logger[_0x6274('0x19')](_0x6274('0x3a'),'afterCreate',_0x6274('0x53'),util['inspect'](_0x670171[_0x6274('0x19')],{'showHidden':![],'depth':null}));}})[_0x6274('0x18')](function(_0x36ea65){return logger[_0x6274('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6274('0x28'),_0x6274('0x53'),util['inspect'](_0x36ea65,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6274('0x28'),'csc',_0x6274('0x5d'));}break;case _0x6274('0x5e'):if(_0x3219d1[_0x6274('0x55')]){var _0x1ea13a={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x3219d1['apiKey']},'body':{'content':_0x1eef9a[_0x6274('0xc')],'to':[_0x1eef9a[_0x6274('0x22')]],'from':_0x3219d1[_0x6274('0x22')],'binary':![],'clientMessageId':'uuid','charset':_0x6274('0x5f')},'json':!![]};rp(_0x1ea13a)['then'](function(_0x19470d){if(!_0x19470d[_0x6274('0x19')]){var _0x8b3f88={'messageId':_0x19470d['messages'][0x0][_0x6274('0x60')]};if(!_0x3219d1[_0x6274('0x38')]){_0x8b3f88[_0x6274('0x39')]=!![];}return _0x218189[_0x6274('0x16')](_0x8b3f88);}else{return logger[_0x6274('0x19')](_0x6274('0x3a'),_0x6274('0x28'),_0x6274('0x5e'),util['inspect'](_0x19470d[_0x6274('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x39cc11){return logger['error'](_0x6274('0x3a'),_0x6274('0x28'),_0x6274('0x5e'),util[_0x6274('0x29')](_0x39cc11,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x6274('0x3a'),'afterCreate',_0x6274('0x5e'),_0x6274('0x5d'));}break;case'bandwidth':if(_0x3219d1['username']&&_0x3219d1[_0x6274('0x2c')]){var _0x83cbc2=util[_0x6274('0x40')](_0x6274('0x41'),_0x3219d1[_0x6274('0x2f')],_0x3219d1[_0x6274('0x2c')]);var _0x11b702={'method':'POST','uri':_0x6274('0x61')+_0x3219d1[_0x6274('0x62')]+_0x6274('0x63'),'body':{'to':[_0x1eef9a['phone']],'text':_0x1eef9a[_0x6274('0xc')],'from':_0x3219d1[_0x6274('0x22')],'applicationId':_0x3219d1[_0x6274('0x64')]},'headers':{'Authorization':util[_0x6274('0x40')]('Basic\x20%s',new Buffer(_0x83cbc2)[_0x6274('0x44')](_0x6274('0x45')))},'json':!![]};rp(_0x11b702)[_0x6274('0x15')](function(_0x3109f6){if(_0x3109f6['id']){var _0x2896dd={'messageId':_0x3109f6['id']};return _0x218189[_0x6274('0x16')](_0x2896dd);}else{logger[_0x6274('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6274('0x28'),_0x6274('0x65'),util[_0x6274('0x29')](_0x3109f6,{'showHidden':![],'depth':null}));}})[_0x6274('0x18')](function(_0x48a801){logger[_0x6274('0x19')](_0x6274('0x3a'),'afterCreate',_0x6274('0x65'),util[_0x6274('0x29')](_0x48a801,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x6274('0x3a'),_0x6274('0x28'),_0x6274('0x65'),_0x6274('0x3b'));}break;case'intelepeer':if(_0x3219d1[_0x6274('0x55')]){var _0x159ce2={};var _0x868ff9={'method':_0x6274('0x33'),'uri':_0x6274('0x66'),'headers':{'Authorization':_0x6274('0x67')+_0x3219d1['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x3219d1[_0x6274('0x22')],'to':_0x1eef9a[_0x6274('0x22')],'text':_0x1eef9a['body']},'json':!![]};return rp(_0x868ff9)['then'](function(_0xcb0c9c){if(_0xcb0c9c[_0x6274('0x68')]==0xca){_0x159ce2[_0x6274('0x69')]=_0xcb0c9c;var _0x26d53f={'method':_0x6274('0x33'),'uri':_0x6274('0x6a'),'headers':{'Authorization':'Bearer\x20'+_0x3219d1[_0x6274('0x55')],'Content-Type':_0x6274('0x4f')},'body':{'refid':_0x159ce2[_0x6274('0x69')][_0x6274('0x6b')]},'json':!![]};return rp(_0x26d53f)['then'](function(_0x181f75){_0x159ce2[_0x6274('0x6c')]=_0x181f75;var _0x4d9842={'messageId':_0x159ce2[_0x6274('0x69')]['refid'],'read':!![]};return _0x218189[_0x6274('0x16')](_0x4d9842);});}else{return logger[_0x6274('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6274('0x28'),_0x6274('0x6d'),util[_0x6274('0x29')](_0xcb0c9c,{'showHidden':![],'depth':null}));}})[_0x6274('0x18')](function(_0x10af1a){return logger[_0x6274('0x19')](_0x6274('0x3a'),_0x6274('0x28'),_0x6274('0x6d'),util['inspect'](_0x10af1a,{'showHidden':![],'depth':null}));});}else{return logger[_0x6274('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6274('0x28'),_0x6274('0x6d'),_0x6274('0x6e'));}break;}}})[_0x6274('0x6f')](function(){_0x226681();});}else{_0x226681();}}},'charset':_0x6274('0x70'),'collate':_0x6274('0x71')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index a3d9b50..81aa6b1 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 _0xb24f=['socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsMessage','body','options','raw','CreateSmsMessage','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x21d18f,_0xd08440){var _0x1b0e5c=function(_0x200dd2){while(--_0x200dd2){_0x21d18f['push'](_0x21d18f['shift']());}};_0x1b0e5c(++_0xd08440);}(_0xb24f,0x10a));var _0xfb24=function(_0x2bfe7c,_0x28b11a){_0x2bfe7c=_0x2bfe7c-0x0;var _0x1d74cc=_0xb24f[_0x2bfe7c];return _0x1d74cc;};'use strict';var _=require(_0xfb24('0x0'));var util=require(_0xfb24('0x1'));var moment=require('moment');var BPromise=require(_0xfb24('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb24('0x3'));var db=require(_0xfb24('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb24('0x5'))(_0xfb24('0x6'));var config=require(_0xfb24('0x7'));var jayson=require(_0xfb24('0x8'));var client=jayson[_0xfb24('0x9')][_0xfb24('0xa')]({'port':0x232a});config['redis']=_[_0xfb24('0xb')](config[_0xfb24('0xc')],{'host':_0xfb24('0xd'),'port':0x18eb});var socket=require(_0xfb24('0xe'))(new Redis(config[_0xfb24('0xc')]));require(_0xfb24('0xf'))[_0xfb24('0x10')](socket);function respondWithRpcPromise(_0x19c71a,_0x2edeb8,_0x5602c4){return new BPromise(function(_0xd9373f,_0x276cd8){return client[_0xfb24('0x11')](_0x19c71a,_0x5602c4)[_0xfb24('0x12')](function(_0x1c0d15){logger[_0xfb24('0x13')](_0xfb24('0x14'),_0x2edeb8,_0xfb24('0x15'));logger[_0xfb24('0x16')](_0xfb24('0x17'),_0x2edeb8,'request\x20sent',JSON[_0xfb24('0x18')](_0x1c0d15));if(_0x1c0d15[_0xfb24('0x19')]){if(_0x1c0d15[_0xfb24('0x19')][_0xfb24('0x1a')]===0x1f4){logger[_0xfb24('0x19')](_0xfb24('0x14'),_0x2edeb8,_0x1c0d15['error'][_0xfb24('0x1b')]);return _0x276cd8(_0x1c0d15[_0xfb24('0x19')]['message']);}logger['error'](_0xfb24('0x14'),_0x2edeb8,_0x1c0d15[_0xfb24('0x19')][_0xfb24('0x1b')]);return _0xd9373f(_0x1c0d15[_0xfb24('0x19')][_0xfb24('0x1b')]);}else{logger[_0xfb24('0x13')]('SmsMessage,\x20%s,\x20%s',_0x2edeb8,'request\x20sent');_0xd9373f(_0x1c0d15[_0xfb24('0x1c')]['message']);}})[_0xfb24('0x1d')](function(_0x365249){logger[_0xfb24('0x19')](_0xfb24('0x14'),_0x2edeb8,_0x365249);_0x276cd8(_0x365249);});});}exports['CreateSmsMessage']=function(_0xacd801){var _0x525537=this;return new Promise(function(_0x10894c,_0x59c6ca){return db[_0xfb24('0x1e')]['create'](_0xacd801[_0xfb24('0x1f')],{'raw':_0xacd801[_0xfb24('0x20')]?_0xacd801[_0xfb24('0x20')][_0xfb24('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x2b76df){logger[_0xfb24('0x13')](_0xfb24('0x22'),_0xacd801);logger['debug'](_0xfb24('0x22'),_0xacd801,JSON[_0xfb24('0x18')](_0x2b76df));_0x10894c(_0x2b76df);})['catch'](function(_0x50202d){logger[_0xfb24('0x19')](_0xfb24('0x22'),_0x50202d[_0xfb24('0x1b')],_0xacd801);_0x59c6ca(_0x525537[_0xfb24('0x19')](0x1f4,_0x50202d[_0xfb24('0x1b')]));});});}; \ No newline at end of file +var _0xa318=['http','redis','defaults','socket.io-emitter','./smsMessage.socket','request','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateSmsMessage','create','options','then','info','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4b6507,_0x5518b5){var _0x2001ec=function(_0x330ddf){while(--_0x330ddf){_0x4b6507['push'](_0x4b6507['shift']());}};_0x2001ec(++_0x5518b5);}(_0xa318,0xe5));var _0x8a31=function(_0x316a0f,_0x3c4088){_0x316a0f=_0x316a0f-0x0;var _0x582cbe=_0xa318[_0x316a0f];return _0x582cbe;};'use strict';var _=require(_0x8a31('0x0'));var util=require(_0x8a31('0x1'));var moment=require(_0x8a31('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a31('0x3'));var db=require(_0x8a31('0x4'))['db'];var utils=require(_0x8a31('0x5'));var logger=require(_0x8a31('0x6'))(_0x8a31('0x7'));var config=require(_0x8a31('0x8'));var jayson=require(_0x8a31('0x9'));var client=jayson[_0x8a31('0xa')][_0x8a31('0xb')]({'port':0x232a});config[_0x8a31('0xc')]=_[_0x8a31('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8a31('0xe'))(new Redis(config['redis']));require(_0x8a31('0xf'))['register'](socket);function respondWithRpcPromise(_0x16c1ba,_0xfafbc3,_0xd040e4){return new BPromise(function(_0x5b3de5,_0x289fc5){return client[_0x8a31('0x10')](_0x16c1ba,_0xd040e4)['then'](function(_0x3b468d){logger['info'](_0x8a31('0x11'),_0xfafbc3,'request\x20sent');logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfafbc3,_0x8a31('0x12'),JSON[_0x8a31('0x13')](_0x3b468d));if(_0x3b468d[_0x8a31('0x14')]){if(_0x3b468d['error'][_0x8a31('0x15')]===0x1f4){logger[_0x8a31('0x14')](_0x8a31('0x11'),_0xfafbc3,_0x3b468d[_0x8a31('0x14')]['message']);return _0x289fc5(_0x3b468d[_0x8a31('0x14')][_0x8a31('0x16')]);}logger[_0x8a31('0x14')](_0x8a31('0x11'),_0xfafbc3,_0x3b468d[_0x8a31('0x14')][_0x8a31('0x16')]);return _0x5b3de5(_0x3b468d[_0x8a31('0x14')][_0x8a31('0x16')]);}else{logger['info'](_0x8a31('0x11'),_0xfafbc3,_0x8a31('0x12'));_0x5b3de5(_0x3b468d['result']['message']);}})[_0x8a31('0x17')](function(_0x25fc4a){logger['error'](_0x8a31('0x11'),_0xfafbc3,_0x25fc4a);_0x289fc5(_0x25fc4a);});});}exports[_0x8a31('0x18')]=function(_0x29c470){var _0x28cb62=this;return new Promise(function(_0x48e0c4,_0x11ba57){return db['SmsMessage'][_0x8a31('0x19')](_0x29c470['body'],{'raw':_0x29c470[_0x8a31('0x1a')]?_0x29c470[_0x8a31('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x8a31('0x1b')](function(_0xe2067d){logger[_0x8a31('0x1c')](_0x8a31('0x18'),_0x29c470);logger[_0x8a31('0x1d')](_0x8a31('0x18'),_0x29c470,JSON[_0x8a31('0x13')](_0xe2067d));_0x48e0c4(_0xe2067d);})[_0x8a31('0x17')](function(_0x315d87){logger[_0x8a31('0x14')]('CreateSmsMessage',_0x315d87[_0x8a31('0x16')],_0x29c470);_0x11ba57(_0x28cb62[_0x8a31('0x14')](0x1f4,_0x315d87[_0x8a31('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 9f0a760..bf81182 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 _0xaa1e=['remove','update','emit','removeListener','register','length','smsMessage:','./smsMessage.events','save'];(function(_0x450cf0,_0x183637){var _0x173655=function(_0xd5596d){while(--_0xd5596d){_0x450cf0['push'](_0x450cf0['shift']());}};_0x173655(++_0x183637);}(_0xaa1e,0x181));var _0xeaa1=function(_0x3e3432,_0xa18f5f){_0x3e3432=_0x3e3432-0x0;var _0x10bb36=_0xaa1e[_0x3e3432];return _0x10bb36;};'use strict';var SmsMessageEvents=require(_0xeaa1('0x0'));var events=[_0xeaa1('0x1'),_0xeaa1('0x2'),_0xeaa1('0x3')];function createListener(_0x36c89d,_0x5a389c){return function(_0x28745d){_0x5a389c[_0xeaa1('0x4')](_0x36c89d,_0x28745d);};}function removeListener(_0x135676,_0x38f03a){return function(){SmsMessageEvents[_0xeaa1('0x5')](_0x135676,_0x38f03a);};}exports[_0xeaa1('0x6')]=function(_0x37f37f){for(var _0x501ce9=0x0,_0x162f8f=events[_0xeaa1('0x7')];_0x501ce9<_0x162f8f;_0x501ce9++){var _0x4f20fc=events[_0x501ce9];var _0xdf722f=createListener(_0xeaa1('0x8')+_0x4f20fc,_0x37f37f);SmsMessageEvents['on'](_0x4f20fc,_0xdf722f);}}; \ No newline at end of file +var _0x00c4=['register','length','./smsMessage.events','save','emit','removeListener'];(function(_0x13c413,_0x59021f){var _0x1e4c39=function(_0x13231d){while(--_0x13231d){_0x13c413['push'](_0x13c413['shift']());}};_0x1e4c39(++_0x59021f);}(_0x00c4,0x19a));var _0x400c=function(_0x3e45b1,_0x62c209){_0x3e45b1=_0x3e45b1-0x0;var _0x1ef1bf=_0x00c4[_0x3e45b1];return _0x1ef1bf;};'use strict';var SmsMessageEvents=require(_0x400c('0x0'));var events=[_0x400c('0x1'),'remove','update'];function createListener(_0x2c723f,_0x15970a){return function(_0x3ef0ab){_0x15970a[_0x400c('0x2')](_0x2c723f,_0x3ef0ab);};}function removeListener(_0x2f115d,_0x325e75){return function(){SmsMessageEvents[_0x400c('0x3')](_0x2f115d,_0x325e75);};}exports[_0x400c('0x4')]=function(_0x29a98c){for(var _0x3276f9=0x0,_0x216788=events[_0x400c('0x5')];_0x3276f9<_0x216788;_0x3276f9++){var _0x3a6a18=events[_0x3276f9];var _0x4f0852=createListener('smsMessage:'+_0x3a6a18,_0x29a98c);SmsMessageEvents['on'](_0x3a6a18,_0x4f0852);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 7494767..e36284d 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 _0x4be4=['create','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','getMembers','/:id/teams','/:id/users','getAgents','post'];(function(_0x4eafb4,_0x5d49a3){var _0x5a38dc=function(_0x23cfda){while(--_0x23cfda){_0x4eafb4['push'](_0x4eafb4['shift']());}};_0x5a38dc(++_0x5d49a3);}(_0x4be4,0xa0));var _0x44be=function(_0x2e8d11,_0x5de71a){_0x2e8d11=_0x2e8d11-0x0;var _0x30bb51=_0x4be4[_0x2e8d11];return _0x30bb51;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x44be('0x0'));var timeout=require('connect-timeout');var express=require(_0x44be('0x1'));var router=express[_0x44be('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x44be('0x3'));var interaction=require(_0x44be('0x4'));var config=require(_0x44be('0x5'));var controller=require(_0x44be('0x6'));router[_0x44be('0x7')]('/',auth[_0x44be('0x8')](),controller['index']);router[_0x44be('0x7')](_0x44be('0x9'),auth[_0x44be('0x8')](),controller['describe']);router[_0x44be('0x7')]('/:id',auth[_0x44be('0x8')](),controller['show']);router['get']('/:id/members',auth[_0x44be('0x8')](),controller[_0x44be('0xa')]);router[_0x44be('0x7')](_0x44be('0xb'),auth['isAuthenticated'](),controller['getTeams']);router[_0x44be('0x7')](_0x44be('0xc'),auth[_0x44be('0x8')](),controller[_0x44be('0xd')]);router[_0x44be('0xe')]('/',auth['isAuthenticated'](),controller[_0x44be('0xf')]);router[_0x44be('0xe')](_0x44be('0xb'),auth[_0x44be('0x8')](),controller[_0x44be('0x10')]);router[_0x44be('0xe')](_0x44be('0xc'),auth['isAuthenticated'](),controller[_0x44be('0x11')]);router[_0x44be('0x12')](_0x44be('0x13'),auth[_0x44be('0x8')](),controller[_0x44be('0x14')]);router[_0x44be('0x15')](_0x44be('0x13'),auth['isAuthenticated'](),controller[_0x44be('0x16')]);router[_0x44be('0x15')](_0x44be('0xb'),auth[_0x44be('0x8')](),controller[_0x44be('0x17')]);router[_0x44be('0x15')](_0x44be('0xc'),auth[_0x44be('0x8')](),controller['removeAgents']);module[_0x44be('0x18')]=router; \ No newline at end of file +var _0x4fca=['/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x764874,_0x3ed544){var _0x29f9d5=function(_0x152dad){while(--_0x152dad){_0x764874['push'](_0x764874['shift']());}};_0x29f9d5(++_0x3ed544);}(_0x4fca,0x76));var _0xa4fc=function(_0x1e4ab1,_0x489327){_0x1e4ab1=_0x1e4ab1-0x0;var _0x4f3be9=_0x4fca[_0x1e4ab1];return _0x4f3be9;};'use strict';var multer=require('multer');var util=require(_0xa4fc('0x0'));var path=require(_0xa4fc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa4fc('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa4fc('0x3'));var interaction=require(_0xa4fc('0x4'));var config=require(_0xa4fc('0x5'));var controller=require(_0xa4fc('0x6'));router[_0xa4fc('0x7')]('/',auth[_0xa4fc('0x8')](),controller[_0xa4fc('0x9')]);router[_0xa4fc('0x7')](_0xa4fc('0xa'),auth[_0xa4fc('0x8')](),controller['describe']);router[_0xa4fc('0x7')](_0xa4fc('0xb'),auth[_0xa4fc('0x8')](),controller['show']);router[_0xa4fc('0x7')]('/:id/members',auth[_0xa4fc('0x8')](),controller['getMembers']);router[_0xa4fc('0x7')](_0xa4fc('0xc'),auth['isAuthenticated'](),controller[_0xa4fc('0xd')]);router[_0xa4fc('0x7')](_0xa4fc('0xe'),auth[_0xa4fc('0x8')](),controller[_0xa4fc('0xf')]);router['post']('/',auth[_0xa4fc('0x8')](),controller[_0xa4fc('0x10')]);router[_0xa4fc('0x11')](_0xa4fc('0xc'),auth[_0xa4fc('0x8')](),controller[_0xa4fc('0x12')]);router[_0xa4fc('0x11')](_0xa4fc('0xe'),auth[_0xa4fc('0x8')](),controller[_0xa4fc('0x13')]);router[_0xa4fc('0x14')]('/:id',auth[_0xa4fc('0x8')](),controller[_0xa4fc('0x15')]);router[_0xa4fc('0x16')](_0xa4fc('0xb'),auth[_0xa4fc('0x8')](),controller[_0xa4fc('0x17')]);router[_0xa4fc('0x16')](_0xa4fc('0xc'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xa4fc('0x16')](_0xa4fc('0xe'),auth[_0xa4fc('0x8')](),controller[_0xa4fc('0x18')]);module[_0xa4fc('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index ec32fc0..680a7a3 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 _0x807b=['INTEGER','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x457d14,_0x1149e7){var _0x1040bb=function(_0xb1b20a){while(--_0xb1b20a){_0x457d14['push'](_0x457d14['shift']());}};_0x1040bb(++_0x1149e7);}(_0x807b,0x122));var _0xb807=function(_0x3a6aee,_0x2c7fff){_0x3a6aee=_0x3a6aee-0x0;var _0x30ce48=_0x807b[_0x3a6aee];return _0x30ce48;};'use strict';var Sequelize=require(_0xb807('0x0'));module[_0xb807('0x1')]={'name':{'type':Sequelize[_0xb807('0x2')],'unique':_0xb807('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb807('0x2')]},'timeout':{'type':Sequelize[_0xb807('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb807('0x5'),'beepall',_0xb807('0x6'))}}; \ No newline at end of file +var _0xa1c8=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x902455,_0xe9df75){var _0x58aafe=function(_0x288f81){while(--_0x288f81){_0x902455['push'](_0x902455['shift']());}};_0x58aafe(++_0xe9df75);}(_0xa1c8,0xdf));var _0x8a1c=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xa1c8[_0x35885a];return _0xe86249;};'use strict';var Sequelize=require(_0x8a1c('0x0'));module[_0x8a1c('0x1')]={'name':{'type':Sequelize[_0x8a1c('0x2')],'unique':_0x8a1c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8a1c('0x2')]},'timeout':{'type':Sequelize[_0x8a1c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8a1c('0x5')](_0x8a1c('0x6'),_0x8a1c('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 1d26fc3..85820b6 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 _0x0c1a=['options','find','catch','create','body','get','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsQueueId','filter','UserSmsQueue','User','findAndCountAll','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','fs-extra','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','SmsQueues','error','stack','name','send','index','map','SmsQueue','rawAttributes','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','findAll','rows','show','params','includeAll','include'];(function(_0x42932d,_0x4749fb){var _0x4f6f2c=function(_0x12ea2e){while(--_0x12ea2e){_0x42932d['push'](_0x42932d['shift']());}};_0x4f6f2c(++_0x4749fb);}(_0x0c1a,0x1d6));var _0xa0c1=function(_0x556d02,_0x1e9f3c){_0x556d02=_0x556d02-0x0;var _0x13b255=_0x0c1a[_0x556d02];return _0x13b255;};'use strict';var emlformat=require(_0xa0c1('0x0'));var rimraf=require(_0xa0c1('0x1'));var zipdir=require(_0xa0c1('0x2'));var jsonpatch=require(_0xa0c1('0x3'));var rp=require(_0xa0c1('0x4'));var moment=require(_0xa0c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa0c1('0x6'));var util=require('util');var path=require(_0xa0c1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa0c1('0x8'));var fs=require('fs');var fs_extra=require(_0xa0c1('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa0c1('0xa'));var deskjs=require(_0xa0c1('0xb'));var toCsv=require(_0xa0c1('0xc'));var querystring=require('querystring');var Papa=require(_0xa0c1('0xd'));var Redis=require(_0xa0c1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa0c1('0xf'));var as=require(_0xa0c1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0c1('0x11'))(_0xa0c1('0x12'));var utils=require(_0xa0c1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa0c1('0x14'));var db=require('../../mysqldb')['db'];config[_0xa0c1('0x15')]=_[_0xa0c1('0x16')](config[_0xa0c1('0x15')],{'host':_0xa0c1('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa0c1('0x15')]));require(_0xa0c1('0x18'))[_0xa0c1('0x19')](socket);function respondWithStatusCode(_0x1e471a,_0x214d26){_0x214d26=_0x214d26||0xcc;return function(_0x583d08){if(_0x583d08){return _0x1e471a[_0xa0c1('0x1a')](_0x214d26);}return _0x1e471a[_0xa0c1('0x1b')](_0x214d26)[_0xa0c1('0x1c')]();};}function respondWithResult(_0x32e488,_0x28b425){_0x28b425=_0x28b425||0xc8;return function(_0x15551e){if(_0x15551e){return _0x32e488[_0xa0c1('0x1b')](_0x28b425)[_0xa0c1('0x1d')](_0x15551e);}};}function respondWithFilteredResult(_0x47f3d8,_0x38f0a1){return function(_0x5a038c){if(_0x5a038c){var _0x198e1f=typeof _0x38f0a1[_0xa0c1('0x1e')]===_0xa0c1('0x1f')&&typeof _0x38f0a1[_0xa0c1('0x20')]===_0xa0c1('0x1f');var _0x31966a=_0x5a038c[_0xa0c1('0x21')];var _0x436a8f=_0x198e1f?0x0:_0x38f0a1[_0xa0c1('0x1e')];var _0x3a37f9=_0x198e1f?_0x5a038c[_0xa0c1('0x21')]:_0x38f0a1['offset']+_0x38f0a1[_0xa0c1('0x20')];var _0x7e5c12;if(_0x3a37f9>=_0x31966a){_0x3a37f9=_0x31966a;_0x7e5c12=0xc8;}else{_0x7e5c12=0xce;}_0x47f3d8['status'](_0x7e5c12);return _0x47f3d8[_0xa0c1('0x22')](_0xa0c1('0x23'),_0x436a8f+'-'+_0x3a37f9+'/'+_0x31966a)[_0xa0c1('0x1d')](_0x5a038c);}return null;};}function patchUpdates(_0x455012){return function(_0x1f83b8){try{jsonpatch[_0xa0c1('0x24')](_0x1f83b8,_0x455012,!![]);}catch(_0x2db5b1){return BPromise[_0xa0c1('0x25')](_0x2db5b1);}return _0x1f83b8[_0xa0c1('0x26')]();};}function saveUpdates(_0xc2afa9,_0x1e3cfe){return function(_0x4a648b){if(_0x4a648b){return _0x4a648b[_0xa0c1('0x27')](_0xc2afa9)[_0xa0c1('0x28')](function(_0x51adfe){return _0x51adfe;});}return null;};}function removeEntity(_0x559f8f,_0x449193){return function(_0x231a96){if(_0x231a96){return _0x231a96[_0xa0c1('0x29')]()[_0xa0c1('0x28')](function(){var _0x5e6032=_0x231a96['get']({'plain':!![]});var _0x4da63c=_0xa0c1('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x4da63c,'resourceId':_0x5e6032['id']}})[_0xa0c1('0x28')](function(){return _0x231a96;});})['then'](function(){_0x559f8f[_0xa0c1('0x1b')](0xcc)[_0xa0c1('0x1c')]();});}};}function handleEntityNotFound(_0x5776eb,_0x28db64){return function(_0x508445){if(!_0x508445){_0x5776eb[_0xa0c1('0x1a')](0x194);}return _0x508445;};}function handleError(_0x500ab7,_0x226b34){_0x226b34=_0x226b34||0x1f4;return function(_0x5981cb){logger[_0xa0c1('0x2b')](_0x5981cb[_0xa0c1('0x2c')]);if(_0x5981cb['name']){delete _0x5981cb[_0xa0c1('0x2d')];}_0x500ab7[_0xa0c1('0x1b')](_0x226b34)[_0xa0c1('0x2e')](_0x5981cb);};}exports[_0xa0c1('0x2f')]=function(_0x351e50,_0x9363af){var _0x375dfb={},_0x119cbb={},_0x41d64f={'count':0x0,'rows':[]};var _0xe577aa=_[_0xa0c1('0x30')](db[_0xa0c1('0x31')][_0xa0c1('0x32')],function(_0x3284a8){return{'name':_0x3284a8['fieldName'],'type':_0x3284a8[_0xa0c1('0x33')]['key']};});_0x119cbb[_0xa0c1('0x34')]=_[_0xa0c1('0x30')](_0xe577aa,'name');_0x119cbb['query']=_[_0xa0c1('0x35')](_0x351e50[_0xa0c1('0x36')]);_0x119cbb[_0xa0c1('0x37')]=_['intersection'](_0x119cbb[_0xa0c1('0x34')],_0x119cbb[_0xa0c1('0x36')]);_0x375dfb[_0xa0c1('0x38')]=_[_0xa0c1('0x39')](_0x119cbb[_0xa0c1('0x34')],qs[_0xa0c1('0x3a')](_0x351e50[_0xa0c1('0x36')]['fields']));_0x375dfb[_0xa0c1('0x38')]=_0x375dfb[_0xa0c1('0x38')][_0xa0c1('0x3b')]?_0x375dfb[_0xa0c1('0x38')]:_0x119cbb[_0xa0c1('0x34')];if(!_0x351e50[_0xa0c1('0x36')][_0xa0c1('0x3c')](_0xa0c1('0x3d'))){_0x375dfb[_0xa0c1('0x20')]=qs['limit'](_0x351e50['query'][_0xa0c1('0x20')]);_0x375dfb[_0xa0c1('0x1e')]=qs['offset'](_0x351e50[_0xa0c1('0x36')][_0xa0c1('0x1e')]);}_0x375dfb[_0xa0c1('0x3e')]=qs[_0xa0c1('0x3f')](_0x351e50[_0xa0c1('0x36')]['sort']);_0x375dfb[_0xa0c1('0x40')]=qs[_0xa0c1('0x37')](_[_0xa0c1('0x41')](_0x351e50[_0xa0c1('0x36')],_0x119cbb[_0xa0c1('0x37')]),_0xe577aa);if(_0x351e50[_0xa0c1('0x36')]['filter']){_0x375dfb[_0xa0c1('0x40')]=_[_0xa0c1('0x42')](_0x375dfb[_0xa0c1('0x40')],{'$or':_['map'](_0xe577aa,function(_0x181b71){if(_0x181b71[_0xa0c1('0x33')]!==_0xa0c1('0x43')){var _0x2f7dc6={};_0x2f7dc6[_0x181b71['name']]={'$like':'%'+_0x351e50['query']['filter']+'%'};return _0x2f7dc6;}})});}_0x375dfb=_['merge']({},_0x375dfb,_0x351e50['options']);var _0x2110df={'where':_0x375dfb['where']};return db[_0xa0c1('0x31')][_0xa0c1('0x21')](_0x2110df)[_0xa0c1('0x28')](function(_0x39a1f4){_0x41d64f[_0xa0c1('0x21')]=_0x39a1f4;if(_0x351e50[_0xa0c1('0x36')]['includeAll']){_0x375dfb['include']=[{'all':!![]}];}return db[_0xa0c1('0x31')][_0xa0c1('0x44')](_0x375dfb);})['then'](function(_0x3d4752){_0x41d64f[_0xa0c1('0x45')]=_0x3d4752;return _0x41d64f;})['then'](respondWithFilteredResult(_0x9363af,_0x375dfb))['catch'](handleError(_0x9363af,null));};exports[_0xa0c1('0x46')]=function(_0x5139a6,_0x3ec683){var _0x5bff0b={'raw':!![],'where':{'id':_0x5139a6[_0xa0c1('0x47')]['id']}},_0x316306={};_0x316306[_0xa0c1('0x34')]=_[_0xa0c1('0x35')](db[_0xa0c1('0x31')][_0xa0c1('0x32')]);_0x316306[_0xa0c1('0x36')]=_[_0xa0c1('0x35')](_0x5139a6['query']);_0x316306[_0xa0c1('0x37')]=_[_0xa0c1('0x39')](_0x316306[_0xa0c1('0x34')],_0x316306[_0xa0c1('0x36')]);_0x5bff0b[_0xa0c1('0x38')]=_['intersection'](_0x316306[_0xa0c1('0x34')],qs[_0xa0c1('0x3a')](_0x5139a6[_0xa0c1('0x36')][_0xa0c1('0x3a')]));_0x5bff0b['attributes']=_0x5bff0b[_0xa0c1('0x38')][_0xa0c1('0x3b')]?_0x5bff0b['attributes']:_0x316306[_0xa0c1('0x34')];if(_0x5139a6['query'][_0xa0c1('0x48')]){_0x5bff0b[_0xa0c1('0x49')]=[{'all':!![]}];}_0x5bff0b=_[_0xa0c1('0x42')]({},_0x5bff0b,_0x5139a6[_0xa0c1('0x4a')]);return db[_0xa0c1('0x31')][_0xa0c1('0x4b')](_0x5bff0b)[_0xa0c1('0x28')](handleEntityNotFound(_0x3ec683,null))[_0xa0c1('0x28')](respondWithResult(_0x3ec683,null))[_0xa0c1('0x4c')](handleError(_0x3ec683,null));};exports[_0xa0c1('0x4d')]=function(_0x4300b4,_0x58984b){return db['SmsQueue'][_0xa0c1('0x4d')](_0x4300b4[_0xa0c1('0x4e')],{})[_0xa0c1('0x28')](function(_0x1046f4){var _0x53fbfa=_0x4300b4['user'][_0xa0c1('0x4f')]({'plain':!![]});if(!_0x53fbfa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53fbfa[_0xa0c1('0x50')]==='user'){var _0x242345=_0x1046f4['get']({'plain':!![]});var _0x5820b8=_0xa0c1('0x2a');return db[_0xa0c1('0x51')][_0xa0c1('0x4b')]({'where':{'name':_0x5820b8,'userProfileId':_0x53fbfa['userProfileId']},'raw':!![]})[_0xa0c1('0x28')](function(_0x26cd7e){if(_0x26cd7e&&_0x26cd7e[_0xa0c1('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x242345['name'],'resourceId':_0x242345['id'],'type':_0x26cd7e[_0xa0c1('0x2d')],'sectionId':_0x26cd7e['id']},{})[_0xa0c1('0x28')](function(){return _0x1046f4;});}else{return _0x1046f4;}})[_0xa0c1('0x4c')](function(_0x3b2922){logger[_0xa0c1('0x2b')](_0xa0c1('0x53'),_0x3b2922);throw _0x3b2922;});}return _0x1046f4;})[_0xa0c1('0x28')](respondWithResult(_0x58984b,0xc9))['catch'](handleError(_0x58984b,null));};exports[_0xa0c1('0x27')]=function(_0x169365,_0x31d523){if(_0x169365[_0xa0c1('0x4e')]['id']){delete _0x169365[_0xa0c1('0x4e')]['id'];}return db['SmsQueue'][_0xa0c1('0x4b')]({'where':{'id':_0x169365[_0xa0c1('0x47')]['id']}})[_0xa0c1('0x28')](handleEntityNotFound(_0x31d523,null))[_0xa0c1('0x28')](saveUpdates(_0x169365['body'],null))['then'](respondWithResult(_0x31d523,null))['catch'](handleError(_0x31d523,null));};exports[_0xa0c1('0x29')]=function(_0x4a2ed9,_0x120e32){return db['SmsQueue'][_0xa0c1('0x4b')]({'where':{'id':_0x4a2ed9[_0xa0c1('0x47')]['id']}})[_0xa0c1('0x28')](handleEntityNotFound(_0x120e32,null))['then'](removeEntity(_0x120e32,null))[_0xa0c1('0x4c')](handleError(_0x120e32,null));};exports[_0xa0c1('0x54')]=function(_0x46ad19,_0x503a51){return db[_0xa0c1('0x31')][_0xa0c1('0x54')]()[_0xa0c1('0x28')](respondWithResult(_0x503a51,null))[_0xa0c1('0x4c')](handleError(_0x503a51,null));};exports['getMembers']=function(_0x3fbe4a,_0x3f957c,_0x14bd2c){var _0x40c83b={'raw':!![],'where':{}},_0x402862={},_0x2497ab;return db[_0xa0c1('0x31')]['findOne']({'where':{'id':_0x3fbe4a[_0xa0c1('0x47')]['id']}})[_0xa0c1('0x28')](handleEntityNotFound(_0x3f957c,null))[_0xa0c1('0x28')](function(_0x235b8e){if(_0x235b8e){_0x2497ab=_0x235b8e[_0xa0c1('0x4f')]({'plain':!![]});_0x402862['model']=_['keys'](db['UserSmsQueue'][_0xa0c1('0x32')]);_0x402862[_0xa0c1('0x36')]=_[_0xa0c1('0x35')](_0x3fbe4a[_0xa0c1('0x36')]);_0x402862[_0xa0c1('0x37')]=_['intersection'](_0x402862[_0xa0c1('0x34')],_0x402862[_0xa0c1('0x36')]);_0x40c83b[_0xa0c1('0x38')]=_[_0xa0c1('0x39')](_0x402862[_0xa0c1('0x34')],qs[_0xa0c1('0x3a')](_0x3fbe4a[_0xa0c1('0x36')][_0xa0c1('0x3a')]));_0x40c83b[_0xa0c1('0x38')]=_0x40c83b[_0xa0c1('0x38')][_0xa0c1('0x3b')]?_0x40c83b[_0xa0c1('0x38')]:_0x402862[_0xa0c1('0x34')];if(!_0x3fbe4a['query'][_0xa0c1('0x3c')]('nolimit')){_0x40c83b[_0xa0c1('0x20')]=qs['limit'](_0x3fbe4a[_0xa0c1('0x36')][_0xa0c1('0x20')]);_0x40c83b[_0xa0c1('0x1e')]=qs[_0xa0c1('0x1e')](_0x3fbe4a['query']['offset']);}_0x40c83b[_0xa0c1('0x3e')]=qs[_0xa0c1('0x3f')](_0x3fbe4a[_0xa0c1('0x36')][_0xa0c1('0x3f')]);_0x40c83b[_0xa0c1('0x40')]=qs[_0xa0c1('0x37')](_[_0xa0c1('0x41')](_0x3fbe4a[_0xa0c1('0x36')],_0x402862['filters']));_0x40c83b['where'][_0xa0c1('0x55')]=_0x235b8e['id'];if(_0x3fbe4a[_0xa0c1('0x36')][_0xa0c1('0x56')]){_0x40c83b[_0xa0c1('0x40')]=_[_0xa0c1('0x42')](_0x40c83b[_0xa0c1('0x40')],{'$or':_[_0xa0c1('0x30')](_0x40c83b[_0xa0c1('0x38')],function(_0x48a209){var _0x275ca6={};_0x275ca6[_0x48a209]={'$like':'%'+_0x3fbe4a[_0xa0c1('0x36')][_0xa0c1('0x56')]+'%'};return _0x275ca6;})});}_0x40c83b=_['merge']({},_0x40c83b,_0x3fbe4a[_0xa0c1('0x4a')]);return db[_0xa0c1('0x57')]['findAll'](_0x40c83b);}})[_0xa0c1('0x28')](function(_0x12266d){if(_0x12266d){return db[_0xa0c1('0x58')][_0xa0c1('0x59')]({'where':{'id':_[_0xa0c1('0x30')](_0x12266d,'UserId'),'role':'agent'},'attributes':['id',_0xa0c1('0x2d'),_0xa0c1('0x5a'),_0xa0c1('0x5b'),_0xa0c1('0x5c')]});}})[_0xa0c1('0x28')](function(_0x377ff1){if(_0x377ff1){return{'count':_0x377ff1[_0xa0c1('0x21')],'rows':_[_0xa0c1('0x30')](_0x377ff1[_0xa0c1('0x45')],function(_0x1186a6){return{'membername':_0x1186a6['name'],'UserId':_0x1186a6['id'],'queue_name':_0x2497ab[_0xa0c1('0x2d')],'SmsQueueId':_0x2497ab['id'],'interface':util['format'](_0xa0c1('0x5d'),_0xa0c1('0x5e'),_0x1186a6[_0xa0c1('0x2d')]),'penalty':0x0,'paused':_0x1186a6[_0xa0c1('0x5a')],'createdAt':_0x1186a6[_0xa0c1('0x5c')],'updatedAt':_0x1186a6[_0xa0c1('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa0c1('0x28')](respondWithFilteredResult(_0x3f957c,_0x40c83b))[_0xa0c1('0x4c')](handleError(_0x3f957c,null));};exports[_0xa0c1('0x5f')]=function(_0x387e74,_0x1404e8,_0x5c3875){var _0x15ae32={};var _0x4a3912={};var _0x4b4c97;var _0x767ec;return db[_0xa0c1('0x31')]['findOne']({'where':{'id':_0x387e74['params']['id']}})[_0xa0c1('0x28')](handleEntityNotFound(_0x1404e8,null))[_0xa0c1('0x28')](function(_0x22b67e){if(_0x22b67e){_0x4b4c97=_0x22b67e;_0x4a3912['model']=_['keys'](db[_0xa0c1('0x60')][_0xa0c1('0x32')]);_0x4a3912[_0xa0c1('0x36')]=_[_0xa0c1('0x35')](_0x387e74[_0xa0c1('0x36')]);_0x4a3912[_0xa0c1('0x37')]=_[_0xa0c1('0x39')](_0x4a3912[_0xa0c1('0x34')],_0x4a3912[_0xa0c1('0x36')]);_0x15ae32[_0xa0c1('0x38')]=_[_0xa0c1('0x39')](_0x4a3912[_0xa0c1('0x34')],qs[_0xa0c1('0x3a')](_0x387e74[_0xa0c1('0x36')][_0xa0c1('0x3a')]));_0x15ae32['attributes']=_0x15ae32[_0xa0c1('0x38')][_0xa0c1('0x3b')]?_0x15ae32[_0xa0c1('0x38')]:_0x4a3912[_0xa0c1('0x34')];_0x15ae32[_0xa0c1('0x3e')]=qs[_0xa0c1('0x3f')](_0x387e74[_0xa0c1('0x36')][_0xa0c1('0x3f')]);_0x15ae32[_0xa0c1('0x40')]=qs[_0xa0c1('0x37')](_[_0xa0c1('0x41')](_0x387e74['query'],_0x4a3912[_0xa0c1('0x37')]));if(_0x387e74[_0xa0c1('0x36')][_0xa0c1('0x56')]){_0x15ae32[_0xa0c1('0x40')]=_[_0xa0c1('0x42')](_0x15ae32[_0xa0c1('0x40')],{'$or':_[_0xa0c1('0x30')](_0x15ae32[_0xa0c1('0x38')],function(_0x5e7066){var _0x14ff7c={};_0x14ff7c[_0x5e7066]={'$like':'%'+_0x387e74[_0xa0c1('0x36')][_0xa0c1('0x56')]+'%'};return _0x14ff7c;})});}_0x15ae32=_[_0xa0c1('0x42')]({},_0x15ae32,_0x387e74[_0xa0c1('0x4a')]);return _0x4b4c97[_0xa0c1('0x5f')](_0x15ae32);}})[_0xa0c1('0x28')](function(_0x485047){if(_0x485047){_0x767ec=_0x485047[_0xa0c1('0x3b')];if(!_0x387e74[_0xa0c1('0x36')]['hasOwnProperty'](_0xa0c1('0x3d'))){_0x15ae32[_0xa0c1('0x20')]=qs[_0xa0c1('0x20')](_0x387e74[_0xa0c1('0x36')][_0xa0c1('0x20')]);_0x15ae32[_0xa0c1('0x1e')]=qs['offset'](_0x387e74[_0xa0c1('0x36')]['offset']);}return _0x4b4c97[_0xa0c1('0x5f')](_0x15ae32);}})[_0xa0c1('0x28')](function(_0x17af85){if(_0x17af85){return _0x17af85?{'count':_0x767ec,'rows':_0x17af85}:null;}})['then'](respondWithResult(_0x1404e8,null))[_0xa0c1('0x4c')](handleError(_0x1404e8,null));};exports[_0xa0c1('0x61')]=function(_0x2adf24,_0x128441,_0x3f4f1b){var _0x2ad06f=_0x2adf24[_0xa0c1('0x4e')][_0xa0c1('0x62')];return db['Team'][_0xa0c1('0x44')]({'where':{'id':_0x2ad06f},'attributes':['id'],'include':[{'model':db[_0xa0c1('0x58')],'as':_0xa0c1('0x63'),'attributes':['id',_0xa0c1('0x2d'),_0xa0c1('0x64'),_0xa0c1('0x65'),_0xa0c1('0x66')],'raw':!![]}]})[_0xa0c1('0x28')](function(_0x141637){if(_0x141637){var _0x405a95=_['flatMap'](_0x141637,function(_0x3f8042){var _0x5f8c80=_0x3f8042['get']({'plain':!![]});return _0x5f8c80[_0xa0c1('0x63')];});return db['SmsQueue'][_0xa0c1('0x4b')]({'where':{'id':_0x2adf24[_0xa0c1('0x47')]['id']}})[_0xa0c1('0x28')](function(_0xfd2bc){return db[_0xa0c1('0x67')][_0xa0c1('0x68')](function(_0x2e470d){return _0xfd2bc[_0xa0c1('0x61')](_0x2ad06f,{'transaction':_0x2e470d})[_0xa0c1('0x28')](function(){return BPromise['each'](_0x405a95,function(_0x549b07){return db['UserSmsQueue'][_0xa0c1('0x69')]({'where':{'UserId':_0x549b07['id'],'SmsQueueId':_0x2adf24[_0xa0c1('0x47')]['id']},'transaction':_0x2e470d});});})[_0xa0c1('0x28')](function(){_0x405a95[_0xa0c1('0x6a')](function(_0x3ca923){socket[_0xa0c1('0x6b')](_0xa0c1('0x6c'),{'UserId':_0x3ca923['id'],'SmsQueueId':_0xfd2bc['id']});});});});});}})[_0xa0c1('0x28')](respondWithStatusCode(_0x128441,null))['catch'](handleError(_0x128441,null));};exports[_0xa0c1('0x6d')]=function(_0x530858,_0x364974,_0x9eed09){return db[_0xa0c1('0x60')][_0xa0c1('0x44')]({'where':{'id':_0x530858['query'][_0xa0c1('0x62')]},'attributes':['id'],'include':[{'model':db[_0xa0c1('0x58')],'as':_0xa0c1('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x364974,null))[_0xa0c1('0x28')](function(_0x24f198){var _0x2967bc=_[_0xa0c1('0x30')](_0x24f198,'id');var _0x5460c5=[];var _0x42edaf=[];var _0x15bbcd=squel[_0xa0c1('0x6e')]();_0x15bbcd['field'](_0xa0c1('0x6f'))[_0xa0c1('0x70')](_0xa0c1('0x71'),'tq')[_0xa0c1('0x72')](_0xa0c1('0x73'),'ut',_0xa0c1('0x74'))[_0xa0c1('0x40')](_0xa0c1('0x75'),_0x530858[_0xa0c1('0x47')]['id']);for(var _0x5df6b6=0x0;_0x5df6b6<_0x24f198[_0xa0c1('0x3b')];_0x5df6b6+=0x1){let _0xed5faa=_0x24f198[_0x5df6b6];for(var _0x575f71=0x0;_0x575f71<_0xed5faa[_0xa0c1('0x63')]['length'];_0x575f71+=0x1){let _0x8d5027=_0xed5faa[_0xa0c1('0x63')][_0x575f71];var _0x47691d=_0x15bbcd[_0xa0c1('0x76')]();_0x47691d[_0xa0c1('0x40')]('ut.UserId\x20=\x20?',_0x8d5027['id']);_0x42edaf[_0xa0c1('0x77')](db[_0xa0c1('0x67')][_0xa0c1('0x36')](_0x47691d[_0xa0c1('0x78')](),{'type':db[_0xa0c1('0x67')][_0xa0c1('0x79')][_0xa0c1('0x7a')]})[_0xa0c1('0x28')](function(_0x1bff5c){if(_0x1bff5c[_0xa0c1('0x3b')]===0x1){return _0x8d5027['id'];}else{var _0x5f2385=_[_0xa0c1('0x7b')](_['map'](_0x1bff5c,_0xa0c1('0x7c')),function(_0x3cabca){return _['includes'](_0x2967bc,_0x3cabca);});if(_0x5f2385){return _0x8d5027['id'];}}}));}}return BPromise[_0xa0c1('0x7d')](_0x42edaf)[_0xa0c1('0x28')](function(_0x15cef1){_0x5460c5=_(_0x5460c5)['union'](_0x15cef1)[_0xa0c1('0x7e')]()['value']();return db['SmsQueue'][_0xa0c1('0x4b')]({'where':{'id':_0x530858[_0xa0c1('0x47')]['id']}})[_0xa0c1('0x28')](function(_0x41911c){return db[_0xa0c1('0x67')][_0xa0c1('0x68')](function(_0x94ce13){return _0x41911c[_0xa0c1('0x6d')](_0x530858[_0xa0c1('0x36')][_0xa0c1('0x62')],{'transaction':_0x94ce13})['then'](function(){if(!_[_0xa0c1('0x7f')](_0x5460c5)){return _0x41911c[_0xa0c1('0x80')](_0x5460c5,{'transaction':_0x94ce13});}})[_0xa0c1('0x28')](function(){_0x5460c5[_0xa0c1('0x6a')](function(_0x3dfd09){socket[_0xa0c1('0x6b')](_0xa0c1('0x81'),{'UserId':_0x3dfd09,'SmsQueueId':_0x41911c['id']});});});});});});})[_0xa0c1('0x28')](respondWithStatusCode(_0x364974,null))[_0xa0c1('0x4c')](handleError(_0x364974,null));};exports['addAgents']=function(_0x45d9ea,_0xd5c242,_0x392ac0){return db[_0xa0c1('0x31')][_0xa0c1('0x4b')]({'where':{'id':_0x45d9ea[_0xa0c1('0x47')]['id']}})[_0xa0c1('0x28')](handleEntityNotFound(_0xd5c242,null))[_0xa0c1('0x28')](function(_0x2cf2d8){if(_0x2cf2d8){return _0x2cf2d8[_0xa0c1('0x82')](_0x45d9ea[_0xa0c1('0x4e')][_0xa0c1('0x62')],_[_0xa0c1('0x83')](_0x45d9ea[_0xa0c1('0x4e')],[_0xa0c1('0x62'),'id'])||{})[_0xa0c1('0x84')](function(_0x1d5189){for(var _0x307cd3=0x0;_0x307cd3<_0x45d9ea[_0xa0c1('0x4e')][_0xa0c1('0x62')][_0xa0c1('0x3b')];_0x307cd3+=0x1){socket[_0xa0c1('0x6b')](_0xa0c1('0x6c'),{'UserId':Number(_0x45d9ea['body']['ids'][_0x307cd3]),'SmsQueueId':Number(_0x45d9ea['params']['id'])});}return _0x1d5189;});}})[_0xa0c1('0x28')](respondWithResult(_0xd5c242,null))[_0xa0c1('0x4c')](handleError(_0xd5c242,null));};exports['removeAgents']=function(_0x243348,_0x2288a5,_0xc00665){return db[_0xa0c1('0x31')]['find']({'where':{'id':_0x243348[_0xa0c1('0x47')]['id']}})['then'](handleEntityNotFound(_0x2288a5,null))[_0xa0c1('0x28')](function(_0x1ddd1b){if(_0x1ddd1b){return _0x1ddd1b[_0xa0c1('0x80')](_0x243348[_0xa0c1('0x36')][_0xa0c1('0x62')])[_0xa0c1('0x28')](function(){if(_[_0xa0c1('0x85')](_0x243348['query'][_0xa0c1('0x62')])){for(var _0x22ccdc=0x0;_0x22ccdc<_0x243348[_0xa0c1('0x36')][_0xa0c1('0x62')][_0xa0c1('0x3b')];_0x22ccdc+=0x1){socket[_0xa0c1('0x6b')]('userSmsQueue:remove',{'UserId':Number(_0x243348[_0xa0c1('0x36')]['ids'][_0x22ccdc]),'SmsQueueId':Number(_0x243348[_0xa0c1('0x47')]['id'])});}}else{socket['emit'](_0xa0c1('0x81'),{'UserId':Number(_0x243348['query'][_0xa0c1('0x62')]),'SmsQueueId':Number(_0x243348[_0xa0c1('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x2288a5,null))[_0xa0c1('0x4c')](handleError(_0x2288a5,null));};exports[_0xa0c1('0x86')]=function(_0x74a8fb,_0x484368,_0x3e0fc5){var _0x43c3c8={};var _0x19126e={};var _0x4de115;var _0x50ded3;return db[_0xa0c1('0x31')][_0xa0c1('0x87')]({'where':{'id':_0x74a8fb[_0xa0c1('0x47')]['id']}})['then'](handleEntityNotFound(_0x484368,null))[_0xa0c1('0x28')](function(_0x15cafa){if(_0x15cafa){_0x4de115=_0x15cafa;_0x19126e[_0xa0c1('0x34')]=_[_0xa0c1('0x35')](db['User'][_0xa0c1('0x32')]);_0x19126e[_0xa0c1('0x36')]=_[_0xa0c1('0x35')](_0x74a8fb[_0xa0c1('0x36')]);_0x19126e[_0xa0c1('0x37')]=_['intersection'](_0x19126e[_0xa0c1('0x34')],_0x19126e[_0xa0c1('0x36')]);_0x43c3c8[_0xa0c1('0x38')]=_[_0xa0c1('0x39')](_0x19126e['model'],qs[_0xa0c1('0x3a')](_0x74a8fb[_0xa0c1('0x36')][_0xa0c1('0x3a')]));_0x43c3c8[_0xa0c1('0x38')]=_0x43c3c8[_0xa0c1('0x38')][_0xa0c1('0x3b')]?_0x43c3c8['attributes']:_0x19126e[_0xa0c1('0x34')];_0x43c3c8[_0xa0c1('0x3e')]=qs[_0xa0c1('0x3f')](_0x74a8fb['query'][_0xa0c1('0x3f')]);_0x43c3c8[_0xa0c1('0x40')]=qs[_0xa0c1('0x37')](_[_0xa0c1('0x41')](_0x74a8fb[_0xa0c1('0x36')],_0x19126e[_0xa0c1('0x37')]));if(_0x74a8fb['query'][_0xa0c1('0x56')]){_0x43c3c8[_0xa0c1('0x40')]=_['merge'](_0x43c3c8[_0xa0c1('0x40')],{'$or':_[_0xa0c1('0x30')](_0x43c3c8[_0xa0c1('0x38')],function(_0x4dbd94){var _0x36894e={};_0x36894e[_0x4dbd94]={'$like':'%'+_0x74a8fb['query'][_0xa0c1('0x56')]+'%'};return _0x36894e;})});}_0x43c3c8=_[_0xa0c1('0x42')]({},_0x43c3c8,_0x74a8fb[_0xa0c1('0x4a')]);return _0x4de115[_0xa0c1('0x86')](_0x43c3c8);}})[_0xa0c1('0x28')](function(_0x1d5577){if(_0x1d5577){_0x50ded3=_0x1d5577[_0xa0c1('0x3b')];if(!_0x74a8fb[_0xa0c1('0x36')][_0xa0c1('0x3c')]('nolimit')){_0x43c3c8[_0xa0c1('0x20')]=qs[_0xa0c1('0x20')](_0x74a8fb['query'][_0xa0c1('0x20')]);_0x43c3c8[_0xa0c1('0x1e')]=qs[_0xa0c1('0x1e')](_0x74a8fb[_0xa0c1('0x36')][_0xa0c1('0x1e')]);}return _0x4de115[_0xa0c1('0x86')](_0x43c3c8);}})[_0xa0c1('0x28')](function(_0x1a4ea3){if(_0x1a4ea3){return _0x1a4ea3?{'count':_0x50ded3,'rows':_0x1a4ea3}:null;}})[_0xa0c1('0x28')](respondWithResult(_0x484368,null))[_0xa0c1('0x4c')](handleError(_0x484368,null));}; \ No newline at end of file +var _0x1c63=['order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','get','SmsQueues','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMembers','findOne','UserSmsQueue','hasOwnProperty','SmsQueueId','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','userSmsQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','json','offset','undefined','limit','count','status','Content-Range','apply','reject','destroy','then','end','error','stack','name','index','SmsQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit'];(function(_0x109810,_0x16ff77){var _0x5779c4=function(_0x7173a8){while(--_0x7173a8){_0x109810['push'](_0x109810['shift']());}};_0x5779c4(++_0x16ff77);}(_0x1c63,0xdc));var _0x31c6=function(_0x4b87dc,_0x65bfba){_0x4b87dc=_0x4b87dc-0x0;var _0x4c3b12=_0x1c63[_0x4b87dc];return _0x4c3b12;};'use strict';var emlformat=require(_0x31c6('0x0'));var rimraf=require(_0x31c6('0x1'));var zipdir=require(_0x31c6('0x2'));var jsonpatch=require(_0x31c6('0x3'));var rp=require('request-promise');var moment=require(_0x31c6('0x4'));var BPromise=require(_0x31c6('0x5'));var Mustache=require(_0x31c6('0x6'));var util=require('util');var path=require(_0x31c6('0x7'));var sox=require(_0x31c6('0x8'));var csv=require(_0x31c6('0x9'));var ejs=require(_0x31c6('0xa'));var fs=require('fs');var fs_extra=require(_0x31c6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x31c6('0xc'));var jsforce=require(_0x31c6('0xd'));var deskjs=require(_0x31c6('0xe'));var toCsv=require(_0x31c6('0x9'));var querystring=require(_0x31c6('0xf'));var Papa=require('papaparse');var Redis=require(_0x31c6('0x10'));var authService=require(_0x31c6('0x11'));var qs=require(_0x31c6('0x12'));var as=require(_0x31c6('0x13'));var hardwareService=require(_0x31c6('0x14'));var logger=require('../../config/logger')(_0x31c6('0x15'));var utils=require('../../config/utils');var config=require(_0x31c6('0x16'));var licenseUtil=require(_0x31c6('0x17'));var db=require('../../mysqldb')['db'];config[_0x31c6('0x18')]=_[_0x31c6('0x19')](config[_0x31c6('0x18')],{'host':_0x31c6('0x1a'),'port':0x18eb});var socket=require(_0x31c6('0x1b'))(new Redis(config[_0x31c6('0x18')]));require('./smsQueue.socket')[_0x31c6('0x1c')](socket);function respondWithStatusCode(_0x3995cc,_0x42c611){_0x42c611=_0x42c611||0xcc;return function(_0x28dbc9){if(_0x28dbc9){return _0x3995cc[_0x31c6('0x1d')](_0x42c611);}return _0x3995cc['status'](_0x42c611)['end']();};}function respondWithResult(_0x497264,_0x527b48){_0x527b48=_0x527b48||0xc8;return function(_0x3766df){if(_0x3766df){return _0x497264['status'](_0x527b48)[_0x31c6('0x1e')](_0x3766df);}};}function respondWithFilteredResult(_0x2a4780,_0x43b5cb){return function(_0xf352af){if(_0xf352af){var _0x20f9a2=typeof _0x43b5cb[_0x31c6('0x1f')]===_0x31c6('0x20')&&typeof _0x43b5cb[_0x31c6('0x21')]==='undefined';var _0x593d2b=_0xf352af['count'];var _0x9f02ae=_0x20f9a2?0x0:_0x43b5cb[_0x31c6('0x1f')];var _0x58dce5=_0x20f9a2?_0xf352af[_0x31c6('0x22')]:_0x43b5cb['offset']+_0x43b5cb['limit'];var _0x4070f6;if(_0x58dce5>=_0x593d2b){_0x58dce5=_0x593d2b;_0x4070f6=0xc8;}else{_0x4070f6=0xce;}_0x2a4780[_0x31c6('0x23')](_0x4070f6);return _0x2a4780['set'](_0x31c6('0x24'),_0x9f02ae+'-'+_0x58dce5+'/'+_0x593d2b)[_0x31c6('0x1e')](_0xf352af);}return null;};}function patchUpdates(_0x392723){return function(_0x4632f6){try{jsonpatch[_0x31c6('0x25')](_0x4632f6,_0x392723,!![]);}catch(_0x509bed){return BPromise[_0x31c6('0x26')](_0x509bed);}return _0x4632f6['save']();};}function saveUpdates(_0x8773d4,_0x178973){return function(_0x5cc043){if(_0x5cc043){return _0x5cc043['update'](_0x8773d4)['then'](function(_0x412a8a){return _0x412a8a;});}return null;};}function removeEntity(_0x250ab1,_0x551291){return function(_0x8a608b){if(_0x8a608b){return _0x8a608b[_0x31c6('0x27')]()[_0x31c6('0x28')](function(){var _0x2fb5f3=_0x8a608b['get']({'plain':!![]});var _0x542209='SmsQueues';return db['UserProfileResource'][_0x31c6('0x27')]({'where':{'type':_0x542209,'resourceId':_0x2fb5f3['id']}})['then'](function(){return _0x8a608b;});})['then'](function(){_0x250ab1[_0x31c6('0x23')](0xcc)[_0x31c6('0x29')]();});}};}function handleEntityNotFound(_0x5e3ed0,_0x41100c){return function(_0x47a0cd){if(!_0x47a0cd){_0x5e3ed0[_0x31c6('0x1d')](0x194);}return _0x47a0cd;};}function handleError(_0x3443d8,_0x58089d){_0x58089d=_0x58089d||0x1f4;return function(_0x1d114e){logger[_0x31c6('0x2a')](_0x1d114e[_0x31c6('0x2b')]);if(_0x1d114e[_0x31c6('0x2c')]){delete _0x1d114e[_0x31c6('0x2c')];}_0x3443d8[_0x31c6('0x23')](_0x58089d)['send'](_0x1d114e);};}exports[_0x31c6('0x2d')]=function(_0x41c4bb,_0x49fda2){var _0x3cdf2c={},_0x2fe1fb={},_0x5a0f56={'count':0x0,'rows':[]};var _0x4d9d78=_['map'](db[_0x31c6('0x2e')][_0x31c6('0x2f')],function(_0x4fc40b){return{'name':_0x4fc40b[_0x31c6('0x30')],'type':_0x4fc40b[_0x31c6('0x31')][_0x31c6('0x32')]};});_0x2fe1fb[_0x31c6('0x33')]=_[_0x31c6('0x34')](_0x4d9d78,'name');_0x2fe1fb[_0x31c6('0x35')]=_[_0x31c6('0x36')](_0x41c4bb[_0x31c6('0x35')]);_0x2fe1fb[_0x31c6('0x37')]=_[_0x31c6('0x38')](_0x2fe1fb[_0x31c6('0x33')],_0x2fe1fb[_0x31c6('0x35')]);_0x3cdf2c[_0x31c6('0x39')]=_[_0x31c6('0x38')](_0x2fe1fb['model'],qs[_0x31c6('0x3a')](_0x41c4bb[_0x31c6('0x35')]['fields']));_0x3cdf2c[_0x31c6('0x39')]=_0x3cdf2c[_0x31c6('0x39')]['length']?_0x3cdf2c[_0x31c6('0x39')]:_0x2fe1fb[_0x31c6('0x33')];if(!_0x41c4bb[_0x31c6('0x35')]['hasOwnProperty'](_0x31c6('0x3b'))){_0x3cdf2c['limit']=qs[_0x31c6('0x21')](_0x41c4bb[_0x31c6('0x35')][_0x31c6('0x21')]);_0x3cdf2c['offset']=qs[_0x31c6('0x1f')](_0x41c4bb[_0x31c6('0x35')][_0x31c6('0x1f')]);}_0x3cdf2c[_0x31c6('0x3c')]=qs['sort'](_0x41c4bb['query'][_0x31c6('0x3d')]);_0x3cdf2c[_0x31c6('0x3e')]=qs[_0x31c6('0x37')](_[_0x31c6('0x3f')](_0x41c4bb[_0x31c6('0x35')],_0x2fe1fb[_0x31c6('0x37')]),_0x4d9d78);if(_0x41c4bb[_0x31c6('0x35')][_0x31c6('0x40')]){_0x3cdf2c[_0x31c6('0x3e')]=_[_0x31c6('0x41')](_0x3cdf2c['where'],{'$or':_[_0x31c6('0x34')](_0x4d9d78,function(_0xda4ebd){if(_0xda4ebd['type']!=='VIRTUAL'){var _0x45b0f3={};_0x45b0f3[_0xda4ebd[_0x31c6('0x2c')]]={'$like':'%'+_0x41c4bb[_0x31c6('0x35')][_0x31c6('0x40')]+'%'};return _0x45b0f3;}})});}_0x3cdf2c=_[_0x31c6('0x41')]({},_0x3cdf2c,_0x41c4bb[_0x31c6('0x42')]);var _0x5c7591={'where':_0x3cdf2c['where']};return db[_0x31c6('0x2e')]['count'](_0x5c7591)[_0x31c6('0x28')](function(_0x1f0b73){_0x5a0f56['count']=_0x1f0b73;if(_0x41c4bb[_0x31c6('0x35')][_0x31c6('0x43')]){_0x3cdf2c[_0x31c6('0x44')]=[{'all':!![]}];}return db[_0x31c6('0x2e')][_0x31c6('0x45')](_0x3cdf2c);})[_0x31c6('0x28')](function(_0x562ddb){_0x5a0f56[_0x31c6('0x46')]=_0x562ddb;return _0x5a0f56;})[_0x31c6('0x28')](respondWithFilteredResult(_0x49fda2,_0x3cdf2c))[_0x31c6('0x47')](handleError(_0x49fda2,null));};exports[_0x31c6('0x48')]=function(_0x2c5d69,_0x573dc9){var _0x33a346={'raw':!![],'where':{'id':_0x2c5d69[_0x31c6('0x49')]['id']}},_0x9ef17b={};_0x9ef17b[_0x31c6('0x33')]=_['keys'](db[_0x31c6('0x2e')]['rawAttributes']);_0x9ef17b[_0x31c6('0x35')]=_[_0x31c6('0x36')](_0x2c5d69[_0x31c6('0x35')]);_0x9ef17b[_0x31c6('0x37')]=_[_0x31c6('0x38')](_0x9ef17b['model'],_0x9ef17b[_0x31c6('0x35')]);_0x33a346[_0x31c6('0x39')]=_[_0x31c6('0x38')](_0x9ef17b[_0x31c6('0x33')],qs[_0x31c6('0x3a')](_0x2c5d69[_0x31c6('0x35')]['fields']));_0x33a346[_0x31c6('0x39')]=_0x33a346['attributes'][_0x31c6('0x4a')]?_0x33a346['attributes']:_0x9ef17b['model'];if(_0x2c5d69[_0x31c6('0x35')][_0x31c6('0x43')]){_0x33a346['include']=[{'all':!![]}];}_0x33a346=_[_0x31c6('0x41')]({},_0x33a346,_0x2c5d69[_0x31c6('0x42')]);return db[_0x31c6('0x2e')]['find'](_0x33a346)['then'](handleEntityNotFound(_0x573dc9,null))[_0x31c6('0x28')](respondWithResult(_0x573dc9,null))[_0x31c6('0x47')](handleError(_0x573dc9,null));};exports[_0x31c6('0x4b')]=function(_0x344192,_0xbb1229){return db[_0x31c6('0x2e')][_0x31c6('0x4b')](_0x344192[_0x31c6('0x4c')],{})[_0x31c6('0x28')](function(_0x10f5b1){var _0x173bcc=_0x344192[_0x31c6('0x4d')]['get']({'plain':!![]});if(!_0x173bcc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x173bcc['role']===_0x31c6('0x4d')){var _0x19e155=_0x10f5b1[_0x31c6('0x4e')]({'plain':!![]});var _0x433a63=_0x31c6('0x4f');return db[_0x31c6('0x50')][_0x31c6('0x51')]({'where':{'name':_0x433a63,'userProfileId':_0x173bcc['userProfileId']},'raw':!![]})['then'](function(_0x6a00fe){if(_0x6a00fe&&_0x6a00fe[_0x31c6('0x52')]===0x0){return db[_0x31c6('0x53')][_0x31c6('0x4b')]({'name':_0x19e155['name'],'resourceId':_0x19e155['id'],'type':_0x6a00fe[_0x31c6('0x2c')],'sectionId':_0x6a00fe['id']},{})[_0x31c6('0x28')](function(){return _0x10f5b1;});}else{return _0x10f5b1;}})['catch'](function(_0x4eabd8){logger['error'](_0x31c6('0x54'),_0x4eabd8);throw _0x4eabd8;});}return _0x10f5b1;})[_0x31c6('0x28')](respondWithResult(_0xbb1229,0xc9))[_0x31c6('0x47')](handleError(_0xbb1229,null));};exports[_0x31c6('0x55')]=function(_0x4c2040,_0x494723){if(_0x4c2040[_0x31c6('0x4c')]['id']){delete _0x4c2040[_0x31c6('0x4c')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x4c2040[_0x31c6('0x49')]['id']}})['then'](handleEntityNotFound(_0x494723,null))[_0x31c6('0x28')](saveUpdates(_0x4c2040[_0x31c6('0x4c')],null))[_0x31c6('0x28')](respondWithResult(_0x494723,null))['catch'](handleError(_0x494723,null));};exports['destroy']=function(_0x5d71b8,_0x542e50){return db[_0x31c6('0x2e')]['find']({'where':{'id':_0x5d71b8[_0x31c6('0x49')]['id']}})[_0x31c6('0x28')](handleEntityNotFound(_0x542e50,null))[_0x31c6('0x28')](removeEntity(_0x542e50,null))[_0x31c6('0x47')](handleError(_0x542e50,null));};exports['describe']=function(_0x1941b3,_0x4bc617){return db[_0x31c6('0x2e')]['describe']()[_0x31c6('0x28')](respondWithResult(_0x4bc617,null))[_0x31c6('0x47')](handleError(_0x4bc617,null));};exports[_0x31c6('0x56')]=function(_0x517db1,_0x378c12,_0x1229cb){var _0x739588={'raw':!![],'where':{}},_0x386bab={},_0x97c1d2;return db['SmsQueue'][_0x31c6('0x57')]({'where':{'id':_0x517db1[_0x31c6('0x49')]['id']}})['then'](handleEntityNotFound(_0x378c12,null))['then'](function(_0x3a0bcb){if(_0x3a0bcb){_0x97c1d2=_0x3a0bcb[_0x31c6('0x4e')]({'plain':!![]});_0x386bab['model']=_['keys'](db[_0x31c6('0x58')]['rawAttributes']);_0x386bab[_0x31c6('0x35')]=_[_0x31c6('0x36')](_0x517db1[_0x31c6('0x35')]);_0x386bab[_0x31c6('0x37')]=_[_0x31c6('0x38')](_0x386bab[_0x31c6('0x33')],_0x386bab[_0x31c6('0x35')]);_0x739588[_0x31c6('0x39')]=_[_0x31c6('0x38')](_0x386bab['model'],qs[_0x31c6('0x3a')](_0x517db1[_0x31c6('0x35')]['fields']));_0x739588[_0x31c6('0x39')]=_0x739588[_0x31c6('0x39')][_0x31c6('0x4a')]?_0x739588[_0x31c6('0x39')]:_0x386bab[_0x31c6('0x33')];if(!_0x517db1[_0x31c6('0x35')][_0x31c6('0x59')](_0x31c6('0x3b'))){_0x739588['limit']=qs[_0x31c6('0x21')](_0x517db1[_0x31c6('0x35')][_0x31c6('0x21')]);_0x739588[_0x31c6('0x1f')]=qs[_0x31c6('0x1f')](_0x517db1[_0x31c6('0x35')]['offset']);}_0x739588[_0x31c6('0x3c')]=qs[_0x31c6('0x3d')](_0x517db1['query'][_0x31c6('0x3d')]);_0x739588[_0x31c6('0x3e')]=qs[_0x31c6('0x37')](_['pick'](_0x517db1[_0x31c6('0x35')],_0x386bab[_0x31c6('0x37')]));_0x739588['where'][_0x31c6('0x5a')]=_0x3a0bcb['id'];if(_0x517db1[_0x31c6('0x35')]['filter']){_0x739588[_0x31c6('0x3e')]=_[_0x31c6('0x41')](_0x739588[_0x31c6('0x3e')],{'$or':_[_0x31c6('0x34')](_0x739588[_0x31c6('0x39')],function(_0x56f017){var _0xa9d97d={};_0xa9d97d[_0x56f017]={'$like':'%'+_0x517db1[_0x31c6('0x35')]['filter']+'%'};return _0xa9d97d;})});}_0x739588=_['merge']({},_0x739588,_0x517db1['options']);return db[_0x31c6('0x58')][_0x31c6('0x45')](_0x739588);}})[_0x31c6('0x28')](function(_0x55d404){if(_0x55d404){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x55d404,_0x31c6('0x5b')),'role':_0x31c6('0x5c')},'attributes':['id',_0x31c6('0x2c'),_0x31c6('0x5d'),_0x31c6('0x5e'),_0x31c6('0x5f')]});}})['then'](function(_0x12becb){if(_0x12becb){return{'count':_0x12becb[_0x31c6('0x22')],'rows':_[_0x31c6('0x34')](_0x12becb[_0x31c6('0x46')],function(_0x31d73b){return{'membername':_0x31d73b[_0x31c6('0x2c')],'UserId':_0x31d73b['id'],'queue_name':_0x97c1d2['name'],'SmsQueueId':_0x97c1d2['id'],'interface':util[_0x31c6('0x60')](_0x31c6('0x61'),_0x31c6('0x62'),_0x31d73b['name']),'penalty':0x0,'paused':_0x31d73b[_0x31c6('0x5d')],'createdAt':_0x31d73b['createdAt'],'updatedAt':_0x31d73b[_0x31c6('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x31c6('0x28')](respondWithFilteredResult(_0x378c12,_0x739588))['catch'](handleError(_0x378c12,null));};exports[_0x31c6('0x63')]=function(_0x5749e8,_0x5130f5,_0x59d255){var _0x47efe7={};var _0x4c0faa={};var _0x37b220;var _0x3d93c3;return db['SmsQueue'][_0x31c6('0x57')]({'where':{'id':_0x5749e8[_0x31c6('0x49')]['id']}})['then'](handleEntityNotFound(_0x5130f5,null))['then'](function(_0x2e97d5){if(_0x2e97d5){_0x37b220=_0x2e97d5;_0x4c0faa[_0x31c6('0x33')]=_[_0x31c6('0x36')](db[_0x31c6('0x64')][_0x31c6('0x2f')]);_0x4c0faa[_0x31c6('0x35')]=_[_0x31c6('0x36')](_0x5749e8[_0x31c6('0x35')]);_0x4c0faa['filters']=_[_0x31c6('0x38')](_0x4c0faa['model'],_0x4c0faa[_0x31c6('0x35')]);_0x47efe7[_0x31c6('0x39')]=_[_0x31c6('0x38')](_0x4c0faa[_0x31c6('0x33')],qs[_0x31c6('0x3a')](_0x5749e8['query']['fields']));_0x47efe7[_0x31c6('0x39')]=_0x47efe7['attributes'][_0x31c6('0x4a')]?_0x47efe7[_0x31c6('0x39')]:_0x4c0faa[_0x31c6('0x33')];_0x47efe7['order']=qs[_0x31c6('0x3d')](_0x5749e8[_0x31c6('0x35')][_0x31c6('0x3d')]);_0x47efe7[_0x31c6('0x3e')]=qs[_0x31c6('0x37')](_[_0x31c6('0x3f')](_0x5749e8[_0x31c6('0x35')],_0x4c0faa[_0x31c6('0x37')]));if(_0x5749e8[_0x31c6('0x35')][_0x31c6('0x40')]){_0x47efe7[_0x31c6('0x3e')]=_[_0x31c6('0x41')](_0x47efe7['where'],{'$or':_[_0x31c6('0x34')](_0x47efe7[_0x31c6('0x39')],function(_0x4a6472){var _0x328eee={};_0x328eee[_0x4a6472]={'$like':'%'+_0x5749e8['query'][_0x31c6('0x40')]+'%'};return _0x328eee;})});}_0x47efe7=_[_0x31c6('0x41')]({},_0x47efe7,_0x5749e8[_0x31c6('0x42')]);return _0x37b220[_0x31c6('0x63')](_0x47efe7);}})[_0x31c6('0x28')](function(_0x3b6aa8){if(_0x3b6aa8){_0x3d93c3=_0x3b6aa8[_0x31c6('0x4a')];if(!_0x5749e8[_0x31c6('0x35')][_0x31c6('0x59')](_0x31c6('0x3b'))){_0x47efe7[_0x31c6('0x21')]=qs[_0x31c6('0x21')](_0x5749e8[_0x31c6('0x35')][_0x31c6('0x21')]);_0x47efe7['offset']=qs[_0x31c6('0x1f')](_0x5749e8[_0x31c6('0x35')][_0x31c6('0x1f')]);}return _0x37b220[_0x31c6('0x63')](_0x47efe7);}})['then'](function(_0x25d232){if(_0x25d232){return _0x25d232?{'count':_0x3d93c3,'rows':_0x25d232}:null;}})[_0x31c6('0x28')](respondWithResult(_0x5130f5,null))[_0x31c6('0x47')](handleError(_0x5130f5,null));};exports['addTeams']=function(_0x2f1756,_0x26a9dd,_0x2620e7){var _0x4a7339=_0x2f1756[_0x31c6('0x4c')][_0x31c6('0x65')];return db[_0x31c6('0x64')][_0x31c6('0x45')]({'where':{'id':_0x4a7339},'attributes':['id'],'include':[{'model':db[_0x31c6('0x66')],'as':_0x31c6('0x67'),'attributes':['id',_0x31c6('0x2c'),_0x31c6('0x68'),_0x31c6('0x69'),_0x31c6('0x6a')],'raw':!![]}]})['then'](function(_0x321d29){if(_0x321d29){var _0x4cfbe8=_[_0x31c6('0x6b')](_0x321d29,function(_0x57e52d){var _0x2ce3db=_0x57e52d[_0x31c6('0x4e')]({'plain':!![]});return _0x2ce3db['Agents'];});return db[_0x31c6('0x2e')][_0x31c6('0x51')]({'where':{'id':_0x2f1756[_0x31c6('0x49')]['id']}})['then'](function(_0x1d81a6){return db[_0x31c6('0x6c')][_0x31c6('0x6d')](function(_0x4c705f){return _0x1d81a6['addTeams'](_0x4a7339,{'transaction':_0x4c705f})[_0x31c6('0x28')](function(){return BPromise['each'](_0x4cfbe8,function(_0x2d5751){return db[_0x31c6('0x58')][_0x31c6('0x6e')]({'where':{'UserId':_0x2d5751['id'],'SmsQueueId':_0x2f1756[_0x31c6('0x49')]['id']},'transaction':_0x4c705f});});})[_0x31c6('0x28')](function(){_0x4cfbe8[_0x31c6('0x6f')](function(_0x28f922){socket[_0x31c6('0x70')](_0x31c6('0x71'),{'UserId':_0x28f922['id'],'SmsQueueId':_0x1d81a6['id']});});});});});}})[_0x31c6('0x28')](respondWithStatusCode(_0x26a9dd,null))[_0x31c6('0x47')](handleError(_0x26a9dd,null));};exports[_0x31c6('0x72')]=function(_0x2a59d3,_0x150cee,_0x40e8b1){return db['Team'][_0x31c6('0x45')]({'where':{'id':_0x2a59d3['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x31c6('0x66')],'as':_0x31c6('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x150cee,null))[_0x31c6('0x28')](function(_0x22c68c){var _0x353f29=_[_0x31c6('0x34')](_0x22c68c,'id');var _0x10d9cd=[];var _0x434200=[];var _0x28144b=squel[_0x31c6('0x73')]();_0x28144b[_0x31c6('0x74')](_0x31c6('0x75'))[_0x31c6('0x76')](_0x31c6('0x77'),'tq')['join'](_0x31c6('0x78'),'ut',_0x31c6('0x79'))[_0x31c6('0x3e')]('SmsQueueId\x20=\x20?',_0x2a59d3[_0x31c6('0x49')]['id']);for(var _0x7f47e=0x0;_0x7f47e<_0x22c68c[_0x31c6('0x4a')];_0x7f47e+=0x1){let _0x5236af=_0x22c68c[_0x7f47e];for(var _0x43c36d=0x0;_0x43c36d<_0x5236af[_0x31c6('0x67')][_0x31c6('0x4a')];_0x43c36d+=0x1){let _0x5728ce=_0x5236af[_0x31c6('0x67')][_0x43c36d];var _0x323107=_0x28144b[_0x31c6('0x7a')]();_0x323107['where'](_0x31c6('0x7b'),_0x5728ce['id']);_0x434200[_0x31c6('0x7c')](db[_0x31c6('0x6c')]['query'](_0x323107['toString'](),{'type':db[_0x31c6('0x6c')][_0x31c6('0x7d')]['SELECT']})['then'](function(_0xee4de8){if(_0xee4de8[_0x31c6('0x4a')]===0x1){return _0x5728ce['id'];}else{var _0x4da80d=_[_0x31c6('0x7e')](_['map'](_0xee4de8,_0x31c6('0x7f')),function(_0x4ca707){return _[_0x31c6('0x80')](_0x353f29,_0x4ca707);});if(_0x4da80d){return _0x5728ce['id'];}}}));}}return BPromise[_0x31c6('0x81')](_0x434200)[_0x31c6('0x28')](function(_0x184408){_0x10d9cd=_(_0x10d9cd)[_0x31c6('0x82')](_0x184408)[_0x31c6('0x83')]()[_0x31c6('0x84')]();return db['SmsQueue'][_0x31c6('0x51')]({'where':{'id':_0x2a59d3[_0x31c6('0x49')]['id']}})[_0x31c6('0x28')](function(_0x1024e1){return db[_0x31c6('0x6c')][_0x31c6('0x6d')](function(_0x7c86b0){return _0x1024e1[_0x31c6('0x72')](_0x2a59d3[_0x31c6('0x35')][_0x31c6('0x65')],{'transaction':_0x7c86b0})[_0x31c6('0x28')](function(){if(!_[_0x31c6('0x85')](_0x10d9cd)){return _0x1024e1['removeAgents'](_0x10d9cd,{'transaction':_0x7c86b0});}})[_0x31c6('0x28')](function(){_0x10d9cd[_0x31c6('0x6f')](function(_0x3e96bb){socket[_0x31c6('0x70')](_0x31c6('0x86'),{'UserId':_0x3e96bb,'SmsQueueId':_0x1024e1['id']});});});});});});})['then'](respondWithStatusCode(_0x150cee,null))[_0x31c6('0x47')](handleError(_0x150cee,null));};exports[_0x31c6('0x87')]=function(_0x1852b4,_0x1ebb80,_0x260e36){return db[_0x31c6('0x2e')][_0x31c6('0x51')]({'where':{'id':_0x1852b4['params']['id']}})['then'](handleEntityNotFound(_0x1ebb80,null))[_0x31c6('0x28')](function(_0x29a017){if(_0x29a017){return _0x29a017['addAgents'](_0x1852b4[_0x31c6('0x4c')][_0x31c6('0x65')],_[_0x31c6('0x88')](_0x1852b4[_0x31c6('0x4c')],['ids','id'])||{})['spread'](function(_0x3f04ca){for(var _0x3cd527=0x0;_0x3cd527<_0x1852b4[_0x31c6('0x4c')]['ids']['length'];_0x3cd527+=0x1){socket[_0x31c6('0x70')](_0x31c6('0x71'),{'UserId':Number(_0x1852b4[_0x31c6('0x4c')][_0x31c6('0x65')][_0x3cd527]),'SmsQueueId':Number(_0x1852b4[_0x31c6('0x49')]['id'])});}return _0x3f04ca;});}})[_0x31c6('0x28')](respondWithResult(_0x1ebb80,null))[_0x31c6('0x47')](handleError(_0x1ebb80,null));};exports[_0x31c6('0x89')]=function(_0x283f11,_0x1fd44f,_0x17a785){return db['SmsQueue'][_0x31c6('0x51')]({'where':{'id':_0x283f11['params']['id']}})[_0x31c6('0x28')](handleEntityNotFound(_0x1fd44f,null))[_0x31c6('0x28')](function(_0x320135){if(_0x320135){return _0x320135['removeAgents'](_0x283f11[_0x31c6('0x35')][_0x31c6('0x65')])[_0x31c6('0x28')](function(){if(_[_0x31c6('0x8a')](_0x283f11['query'][_0x31c6('0x65')])){for(var _0x1d257a=0x0;_0x1d257a<_0x283f11[_0x31c6('0x35')]['ids'][_0x31c6('0x4a')];_0x1d257a+=0x1){socket['emit'](_0x31c6('0x86'),{'UserId':Number(_0x283f11[_0x31c6('0x35')][_0x31c6('0x65')][_0x1d257a]),'SmsQueueId':Number(_0x283f11[_0x31c6('0x49')]['id'])});}}else{socket[_0x31c6('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x283f11[_0x31c6('0x35')][_0x31c6('0x65')]),'SmsQueueId':Number(_0x283f11['params']['id'])});}});}})[_0x31c6('0x28')](respondWithStatusCode(_0x1fd44f,null))['catch'](handleError(_0x1fd44f,null));};exports[_0x31c6('0x8b')]=function(_0x5b5212,_0x235ca8,_0x4bcd3c){var _0x216dab={};var _0x49a053={};var _0x535ea8;var _0x3962bf;return db['SmsQueue']['findOne']({'where':{'id':_0x5b5212[_0x31c6('0x49')]['id']}})['then'](handleEntityNotFound(_0x235ca8,null))[_0x31c6('0x28')](function(_0x8d7b78){if(_0x8d7b78){_0x535ea8=_0x8d7b78;_0x49a053[_0x31c6('0x33')]=_[_0x31c6('0x36')](db[_0x31c6('0x66')][_0x31c6('0x2f')]);_0x49a053[_0x31c6('0x35')]=_[_0x31c6('0x36')](_0x5b5212[_0x31c6('0x35')]);_0x49a053[_0x31c6('0x37')]=_[_0x31c6('0x38')](_0x49a053['model'],_0x49a053[_0x31c6('0x35')]);_0x216dab[_0x31c6('0x39')]=_['intersection'](_0x49a053[_0x31c6('0x33')],qs['fields'](_0x5b5212[_0x31c6('0x35')][_0x31c6('0x3a')]));_0x216dab[_0x31c6('0x39')]=_0x216dab['attributes']['length']?_0x216dab[_0x31c6('0x39')]:_0x49a053[_0x31c6('0x33')];_0x216dab[_0x31c6('0x3c')]=qs['sort'](_0x5b5212[_0x31c6('0x35')][_0x31c6('0x3d')]);_0x216dab[_0x31c6('0x3e')]=qs['filters'](_[_0x31c6('0x3f')](_0x5b5212[_0x31c6('0x35')],_0x49a053[_0x31c6('0x37')]));if(_0x5b5212[_0x31c6('0x35')][_0x31c6('0x40')]){_0x216dab[_0x31c6('0x3e')]=_['merge'](_0x216dab[_0x31c6('0x3e')],{'$or':_['map'](_0x216dab[_0x31c6('0x39')],function(_0xdeeeb6){var _0x2156c7={};_0x2156c7[_0xdeeeb6]={'$like':'%'+_0x5b5212[_0x31c6('0x35')][_0x31c6('0x40')]+'%'};return _0x2156c7;})});}_0x216dab=_[_0x31c6('0x41')]({},_0x216dab,_0x5b5212[_0x31c6('0x42')]);return _0x535ea8['getAgents'](_0x216dab);}})[_0x31c6('0x28')](function(_0x451c55){if(_0x451c55){_0x3962bf=_0x451c55[_0x31c6('0x4a')];if(!_0x5b5212[_0x31c6('0x35')][_0x31c6('0x59')](_0x31c6('0x3b'))){_0x216dab[_0x31c6('0x21')]=qs['limit'](_0x5b5212[_0x31c6('0x35')]['limit']);_0x216dab[_0x31c6('0x1f')]=qs['offset'](_0x5b5212[_0x31c6('0x35')]['offset']);}return _0x535ea8[_0x31c6('0x8b')](_0x216dab);}})['then'](function(_0x233115){if(_0x233115){return _0x233115?{'count':_0x3962bf,'rows':_0x233115}:null;}})[_0x31c6('0x28')](respondWithResult(_0x235ca8,null))[_0x31c6('0x47')](handleError(_0x235ca8,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index f99e775..5c554b2 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 _0xa287=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x497ae8,_0x3d6237){var _0x3b1a07=function(_0x4620f1){while(--_0x4620f1){_0x497ae8['push'](_0x497ae8['shift']());}};_0x3b1a07(++_0x3d6237);}(_0xa287,0xa6));var _0x7a28=function(_0x4bfd95,_0x1c3b3b){_0x4bfd95=_0x4bfd95-0x0;var _0x1484cd=_0xa287[_0x4bfd95];return _0x1484cd;};'use strict';var EventEmitter=require(_0x7a28('0x0'));var SmsQueue=require(_0x7a28('0x1'))['db'][_0x7a28('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7a28('0x3')](0x0);var events={'afterCreate':_0x7a28('0x4'),'afterUpdate':_0x7a28('0x5'),'afterDestroy':_0x7a28('0x6')};function emitEvent(_0x13450c){return function(_0x92bc27,_0x497e6e,_0x982c13){SmsQueueEvents[_0x7a28('0x7')](_0x13450c+':'+_0x92bc27['id'],_0x92bc27);SmsQueueEvents[_0x7a28('0x7')](_0x13450c,_0x92bc27);_0x982c13(null);};}for(var e in events){if(events[_0x7a28('0x8')](e)){var event=events[e];SmsQueue[_0x7a28('0x9')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x3deb=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsQueue','save'];(function(_0x4b3358,_0x5cda77){var _0x1ea011=function(_0x1a17ea){while(--_0x1a17ea){_0x4b3358['push'](_0x4b3358['shift']());}};_0x1ea011(++_0x5cda77);}(_0x3deb,0xc2));var _0xb3de=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x3deb[_0x1d1779];return _0x2377e9;};'use strict';var EventEmitter=require(_0xb3de('0x0'));var SmsQueue=require(_0xb3de('0x1'))['db'][_0xb3de('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb3de('0x3'),'afterUpdate':_0xb3de('0x4'),'afterDestroy':_0xb3de('0x5')};function emitEvent(_0x1f6037){return function(_0x517470,_0x8cd485,_0xc546e8){SmsQueueEvents[_0xb3de('0x6')](_0x1f6037+':'+_0x517470['id'],_0x517470);SmsQueueEvents[_0xb3de('0x6')](_0x1f6037,_0x517470);_0xc546e8(null);};}for(var e in events){if(events[_0xb3de('0x7')](e)){var event=events[e];SmsQueue[_0xb3de('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index f5c54ef..f4642c4 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 _0x942a=['define','SmsQueue','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0x942a,0xf2));var _0xa942=function(_0x408d22,_0x53eef9){_0x408d22=_0x408d22-0x0;var _0x58effd=_0x942a[_0x408d22];return _0x58effd;};'use strict';var _=require('lodash');var util=require(_0xa942('0x0'));var logger=require(_0xa942('0x1'))('api');var moment=require(_0xa942('0x2'));var BPromise=require(_0xa942('0x3'));var rp=require(_0xa942('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa942('0x5'));var config=require(_0xa942('0x6'));var attributes=require(_0xa942('0x7'));module['exports']=function(_0x21813a,_0x379c1b){return _0x21813a[_0xa942('0x8')](_0xa942('0x9'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e5e=['../../config/environment','exports','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0xcd0523,_0x5ec059){var _0x36c81c=function(_0x5ca6aa){while(--_0x5ca6aa){_0xcd0523['push'](_0xcd0523['shift']());}};_0x36c81c(++_0x5ec059);}(_0x6e5e,0x1c0));var _0xe6e5=function(_0x361fa9,_0x14e44c){_0x361fa9=_0x361fa9-0x0;var _0x20563a=_0x6e5e[_0x361fa9];return _0x20563a;};'use strict';var _=require(_0xe6e5('0x0'));var util=require(_0xe6e5('0x1'));var logger=require(_0xe6e5('0x2'))(_0xe6e5('0x3'));var moment=require(_0xe6e5('0x4'));var BPromise=require(_0xe6e5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe6e5('0x6'));var rimraf=require(_0xe6e5('0x7'));var config=require(_0xe6e5('0x8'));var attributes=require('./smsQueue.attributes');module[_0xe6e5('0x9')]=function(_0x28a448,_0x330efc){return _0x28a448['define'](_0xe6e5('0xa'),attributes,{'tableName':_0xe6e5('0xb'),'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 6dd915b..7b995d7 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 _0x3b3f=['rpc','client','http','defaults','localhost','socket.io-emitter','redis','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x3b3f,0xc9));var _0xf3b3=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3b3f[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xf3b3('0x0'));var util=require(_0xf3b3('0x1'));var moment=require(_0xf3b3('0x2'));var BPromise=require(_0xf3b3('0x3'));var rs=require(_0xf3b3('0x4'));var fs=require('fs');var Redis=require(_0xf3b3('0x5'));var db=require(_0xf3b3('0x6'))['db'];var utils=require(_0xf3b3('0x7'));var logger=require(_0xf3b3('0x8'))(_0xf3b3('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf3b3('0xa')][_0xf3b3('0xb')]({'port':0x232a});config['redis']=_[_0xf3b3('0xc')](config['redis'],{'host':_0xf3b3('0xd'),'port':0x18eb});var socket=require(_0xf3b3('0xe'))(new Redis(config[_0xf3b3('0xf')]));require(_0xf3b3('0x10'))[_0xf3b3('0x11')](socket);function respondWithRpcPromise(_0x29a974,_0x58b02a,_0x3d8bc1){return new BPromise(function(_0x296cee,_0x31acb6){return client[_0xf3b3('0x12')](_0x29a974,_0x3d8bc1)[_0xf3b3('0x13')](function(_0x308f8c){logger[_0xf3b3('0x14')](_0xf3b3('0x15'),_0x58b02a,_0xf3b3('0x16'));logger[_0xf3b3('0x17')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x58b02a,_0xf3b3('0x16'),JSON[_0xf3b3('0x18')](_0x308f8c));if(_0x308f8c['error']){if(_0x308f8c['error'][_0xf3b3('0x19')]===0x1f4){logger[_0xf3b3('0x1a')](_0xf3b3('0x15'),_0x58b02a,_0x308f8c[_0xf3b3('0x1a')][_0xf3b3('0x1b')]);return _0x31acb6(_0x308f8c['error'][_0xf3b3('0x1b')]);}logger['error'](_0xf3b3('0x15'),_0x58b02a,_0x308f8c['error'][_0xf3b3('0x1b')]);return _0x296cee(_0x308f8c[_0xf3b3('0x1a')][_0xf3b3('0x1b')]);}else{logger[_0xf3b3('0x14')](_0xf3b3('0x15'),_0x58b02a,'request\x20sent');_0x296cee(_0x308f8c['result'][_0xf3b3('0x1b')]);}})[_0xf3b3('0x1c')](function(_0x24c0b1){logger[_0xf3b3('0x1a')](_0xf3b3('0x15'),_0x58b02a,_0x24c0b1);_0x31acb6(_0x24c0b1);});});}exports[_0xf3b3('0x1d')]=function(_0x1476f4){var _0x322a1a=this;return new Promise(function(_0x1e5ef9,_0x5f168a){return db[_0xf3b3('0x1e')][_0xf3b3('0x1f')]({'raw':_0x1476f4[_0xf3b3('0x20')]?_0x1476f4['options'][_0xf3b3('0x21')]===undefined?!![]:![]:!![],'where':_0x1476f4[_0xf3b3('0x20')]?_0x1476f4[_0xf3b3('0x20')][_0xf3b3('0x22')]||null:null,'attributes':_0x1476f4['options']?_0x1476f4[_0xf3b3('0x20')][_0xf3b3('0x23')]||null:null,'limit':_0x1476f4[_0xf3b3('0x20')]?_0x1476f4[_0xf3b3('0x20')][_0xf3b3('0x24')]||null:null,'include':_0x1476f4[_0xf3b3('0x20')]?_0x1476f4[_0xf3b3('0x20')][_0xf3b3('0x25')]?_['map'](_0x1476f4[_0xf3b3('0x20')][_0xf3b3('0x25')],function(_0x3cb00b){return{'model':db[_0x3cb00b[_0xf3b3('0x26')]],'as':_0x3cb00b['as'],'attributes':_0x3cb00b[_0xf3b3('0x23')],'include':_0x3cb00b[_0xf3b3('0x25')]?_[_0xf3b3('0x27')](_0x3cb00b[_0xf3b3('0x25')],function(_0x5d9fe0){return{'model':db[_0x5d9fe0[_0xf3b3('0x26')]],'as':_0x5d9fe0['as'],'attributes':_0x5d9fe0['attributes'],'include':_0x5d9fe0[_0xf3b3('0x25')]?_[_0xf3b3('0x27')](_0x5d9fe0[_0xf3b3('0x25')],function(_0x5a761c){return{'model':db[_0x5a761c[_0xf3b3('0x26')]],'as':_0x5a761c['as'],'attributes':_0x5a761c[_0xf3b3('0x23')]};}):[]};}):[]};}):[]:[]})[_0xf3b3('0x13')](function(_0x56e523){logger['info'](_0xf3b3('0x1d'),_0x1476f4);logger[_0xf3b3('0x17')](_0xf3b3('0x1d'),_0x1476f4,JSON[_0xf3b3('0x18')](_0x56e523));_0x1e5ef9(_0x56e523);})[_0xf3b3('0x1c')](function(_0x109e70){logger[_0xf3b3('0x1a')](_0xf3b3('0x1d'),_0x109e70[_0xf3b3('0x1b')],_0x1476f4);_0x5f168a(_0x322a1a[_0xf3b3('0x1a')](0x1f4,_0x109e70['message']));});});};exports[_0xf3b3('0x28')]=function(_0x44c456){var _0x5dfff4=this;return new Promise(function(_0x26866e,_0x172595){return db[_0xf3b3('0x1e')][_0xf3b3('0x29')]({'raw':_0x44c456[_0xf3b3('0x20')]?_0x44c456['options'][_0xf3b3('0x21')]===undefined?!![]:![]:!![],'where':_0x44c456[_0xf3b3('0x20')]?_0x44c456[_0xf3b3('0x20')][_0xf3b3('0x22')]||null:null,'attributes':_0x44c456['options']?_0x44c456[_0xf3b3('0x20')][_0xf3b3('0x23')]||null:null,'include':_0x44c456[_0xf3b3('0x20')]?_0x44c456[_0xf3b3('0x20')][_0xf3b3('0x25')]?_['map'](_0x44c456[_0xf3b3('0x20')][_0xf3b3('0x25')],function(_0x3d4ce7){return{'model':db[_0x3d4ce7[_0xf3b3('0x26')]],'as':_0x3d4ce7['as'],'attributes':_0x3d4ce7[_0xf3b3('0x23')],'include':_0x3d4ce7[_0xf3b3('0x25')]?_['map'](_0x3d4ce7[_0xf3b3('0x25')],function(_0x41371f){return{'model':db[_0x41371f[_0xf3b3('0x26')]],'as':_0x41371f['as'],'attributes':_0x41371f[_0xf3b3('0x23')],'include':_0x41371f[_0xf3b3('0x25')]?_[_0xf3b3('0x27')](_0x41371f['include'],function(_0x11f26d){return{'model':db[_0x11f26d[_0xf3b3('0x26')]],'as':_0x11f26d['as'],'attributes':_0x11f26d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x402284){logger[_0xf3b3('0x14')](_0xf3b3('0x28'),_0x44c456);logger[_0xf3b3('0x17')](_0xf3b3('0x28'),_0x44c456,JSON[_0xf3b3('0x18')](_0x402284));_0x26866e(_0x402284);})[_0xf3b3('0x1c')](function(_0x506894){logger[_0xf3b3('0x1a')](_0xf3b3('0x28'),_0x506894[_0xf3b3('0x1b')],_0x44c456);_0x172595(_0x5dfff4['error'](0x1f4,_0x506894[_0xf3b3('0x1b')]));});});}; \ No newline at end of file +var _0x03e7=['ShowSmsQueue','find','raw','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','request\x20sent','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','include','model','map'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x03e7,0x1d2));var _0x703e=function(_0x3a8a65,_0x19a8b2){_0x3a8a65=_0x3a8a65-0x0;var _0x564fe3=_0x03e7[_0x3a8a65];return _0x564fe3;};'use strict';var _=require(_0x703e('0x0'));var util=require(_0x703e('0x1'));var moment=require(_0x703e('0x2'));var BPromise=require(_0x703e('0x3'));var rs=require(_0x703e('0x4'));var fs=require('fs');var Redis=require(_0x703e('0x5'));var db=require(_0x703e('0x6'))['db'];var utils=require(_0x703e('0x7'));var logger=require(_0x703e('0x8'))(_0x703e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x703e('0xa')]({'port':0x232a});config[_0x703e('0xb')]=_[_0x703e('0xc')](config[_0x703e('0xb')],{'host':_0x703e('0xd'),'port':0x18eb});var socket=require(_0x703e('0xe'))(new Redis(config[_0x703e('0xb')]));require(_0x703e('0xf'))[_0x703e('0x10')](socket);function respondWithRpcPromise(_0xef1a39,_0x5c539d,_0x41aac5){return new BPromise(function(_0x4fb09e,_0x3e708e){return client[_0x703e('0x11')](_0xef1a39,_0x41aac5)[_0x703e('0x12')](function(_0x4a6071){logger['info']('SmsQueue,\x20%s,\x20%s',_0x5c539d,'request\x20sent');logger[_0x703e('0x13')](_0x703e('0x14'),_0x5c539d,'request\x20sent',JSON[_0x703e('0x15')](_0x4a6071));if(_0x4a6071[_0x703e('0x16')]){if(_0x4a6071[_0x703e('0x16')][_0x703e('0x17')]===0x1f4){logger[_0x703e('0x16')](_0x703e('0x18'),_0x5c539d,_0x4a6071[_0x703e('0x16')][_0x703e('0x19')]);return _0x3e708e(_0x4a6071[_0x703e('0x16')][_0x703e('0x19')]);}logger['error'](_0x703e('0x18'),_0x5c539d,_0x4a6071[_0x703e('0x16')][_0x703e('0x19')]);return _0x4fb09e(_0x4a6071[_0x703e('0x16')][_0x703e('0x19')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x5c539d,_0x703e('0x1a'));_0x4fb09e(_0x4a6071['result']['message']);}})[_0x703e('0x1b')](function(_0xb442cb){logger[_0x703e('0x16')](_0x703e('0x18'),_0x5c539d,_0xb442cb);_0x3e708e(_0xb442cb);});});}exports[_0x703e('0x1c')]=function(_0x475283){var _0x41371d=this;return new Promise(function(_0x72a542,_0x45e2cc){return db[_0x703e('0x1d')][_0x703e('0x1e')]({'raw':_0x475283[_0x703e('0x1f')]?_0x475283[_0x703e('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x475283[_0x703e('0x1f')]?_0x475283[_0x703e('0x1f')][_0x703e('0x20')]||null:null,'attributes':_0x475283[_0x703e('0x1f')]?_0x475283[_0x703e('0x1f')][_0x703e('0x21')]||null:null,'limit':_0x475283[_0x703e('0x1f')]?_0x475283[_0x703e('0x1f')][_0x703e('0x22')]||null:null,'include':_0x475283[_0x703e('0x1f')]?_0x475283[_0x703e('0x1f')][_0x703e('0x23')]?_['map'](_0x475283['options'][_0x703e('0x23')],function(_0x217edf){return{'model':db[_0x217edf[_0x703e('0x24')]],'as':_0x217edf['as'],'attributes':_0x217edf[_0x703e('0x21')],'include':_0x217edf[_0x703e('0x23')]?_[_0x703e('0x25')](_0x217edf[_0x703e('0x23')],function(_0x3d6ed8){return{'model':db[_0x3d6ed8[_0x703e('0x24')]],'as':_0x3d6ed8['as'],'attributes':_0x3d6ed8[_0x703e('0x21')],'include':_0x3d6ed8[_0x703e('0x23')]?_[_0x703e('0x25')](_0x3d6ed8[_0x703e('0x23')],function(_0x33656d){return{'model':db[_0x33656d[_0x703e('0x24')]],'as':_0x33656d['as'],'attributes':_0x33656d[_0x703e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x703e('0x12')](function(_0x42ec7b){logger['info'](_0x703e('0x1c'),_0x475283);logger[_0x703e('0x13')]('GetSmsQueue',_0x475283,JSON[_0x703e('0x15')](_0x42ec7b));_0x72a542(_0x42ec7b);})[_0x703e('0x1b')](function(_0xaf9573){logger[_0x703e('0x16')](_0x703e('0x1c'),_0xaf9573[_0x703e('0x19')],_0x475283);_0x45e2cc(_0x41371d[_0x703e('0x16')](0x1f4,_0xaf9573['message']));});});};exports[_0x703e('0x26')]=function(_0x35e43a){var _0x3e8964=this;return new Promise(function(_0x277089,_0x565062){return db[_0x703e('0x1d')][_0x703e('0x27')]({'raw':_0x35e43a[_0x703e('0x1f')]?_0x35e43a[_0x703e('0x1f')][_0x703e('0x28')]===undefined?!![]:![]:!![],'where':_0x35e43a[_0x703e('0x1f')]?_0x35e43a['options']['where']||null:null,'attributes':_0x35e43a[_0x703e('0x1f')]?_0x35e43a['options'][_0x703e('0x21')]||null:null,'include':_0x35e43a[_0x703e('0x1f')]?_0x35e43a[_0x703e('0x1f')][_0x703e('0x23')]?_[_0x703e('0x25')](_0x35e43a['options'][_0x703e('0x23')],function(_0xfed26d){return{'model':db[_0xfed26d['model']],'as':_0xfed26d['as'],'attributes':_0xfed26d[_0x703e('0x21')],'include':_0xfed26d[_0x703e('0x23')]?_['map'](_0xfed26d[_0x703e('0x23')],function(_0x558bf6){return{'model':db[_0x558bf6[_0x703e('0x24')]],'as':_0x558bf6['as'],'attributes':_0x558bf6[_0x703e('0x21')],'include':_0x558bf6[_0x703e('0x23')]?_[_0x703e('0x25')](_0x558bf6[_0x703e('0x23')],function(_0x289d64){return{'model':db[_0x289d64[_0x703e('0x24')]],'as':_0x289d64['as'],'attributes':_0x289d64[_0x703e('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e14a5){logger[_0x703e('0x29')](_0x703e('0x26'),_0x35e43a);logger[_0x703e('0x13')](_0x703e('0x26'),_0x35e43a,JSON[_0x703e('0x15')](_0x3e14a5));_0x277089(_0x3e14a5);})[_0x703e('0x1b')](function(_0x4a1939){logger['error'](_0x703e('0x26'),_0x4a1939['message'],_0x35e43a);_0x565062(_0x3e8964[_0x703e('0x16')](0x1f4,_0x4a1939['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index ef2f9a6..ca8cdd6 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 _0x3a95=['save','remove','removeListener','register','length','smsQueue:','./smsQueue.events'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3a95,0xfb));var _0x53a9=function(_0x1e9324,_0x575835){_0x1e9324=_0x1e9324-0x0;var _0x1be9d6=_0x3a95[_0x1e9324];return _0x1be9d6;};'use strict';var SmsQueueEvents=require(_0x53a9('0x0'));var events=[_0x53a9('0x1'),_0x53a9('0x2'),'update'];function createListener(_0x1f39f1,_0x54bb3a){return function(_0x20d910){_0x54bb3a['emit'](_0x1f39f1,_0x20d910);};}function removeListener(_0x42a077,_0x5f24df){return function(){SmsQueueEvents[_0x53a9('0x3')](_0x42a077,_0x5f24df);};}exports[_0x53a9('0x4')]=function(_0x3596dd){for(var _0xd1703e=0x0,_0x1c1768=events[_0x53a9('0x5')];_0xd1703e<_0x1c1768;_0xd1703e++){var _0x47f896=events[_0xd1703e];var _0x54c8f6=createListener(_0x53a9('0x6')+_0x47f896,_0x3596dd);SmsQueueEvents['on'](_0x47f896,_0x54c8f6);}}; \ No newline at end of file +var _0xe9ec=['./smsQueue.events','save','remove','update','register','smsQueue:'];(function(_0x7690a0,_0x544db6){var _0x4d5a83=function(_0x4abf48){while(--_0x4abf48){_0x7690a0['push'](_0x7690a0['shift']());}};_0x4d5a83(++_0x544db6);}(_0xe9ec,0x72));var _0xce9e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe9ec[_0x122ef9];return _0x42fba0;};'use strict';var SmsQueueEvents=require(_0xce9e('0x0'));var events=[_0xce9e('0x1'),_0xce9e('0x2'),_0xce9e('0x3')];function createListener(_0x5deca2,_0x3100b4){return function(_0xda8519){_0x3100b4['emit'](_0x5deca2,_0xda8519);};}function removeListener(_0x3948de,_0x47d139){return function(){SmsQueueEvents['removeListener'](_0x3948de,_0x47d139);};}exports[_0xce9e('0x4')]=function(_0x1dd222){for(var _0x374703=0x0,_0xfe9381=events['length'];_0x374703<_0xfe9381;_0x374703++){var _0x411ba9=events[_0x374703];var _0x5e0844=createListener(_0xce9e('0x5')+_0x411ba9,_0x1dd222);SmsQueueEvents['on'](_0x411ba9,_0x5e0844);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 8f4cd4c..0fd979d 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 _0x1059=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','get','/describe','/:id','show','create','put','update','exports'];(function(_0x55daf2,_0x1b48de){var _0x1c8500=function(_0x4686b5){while(--_0x4686b5){_0x55daf2['push'](_0x55daf2['shift']());}};_0x1c8500(++_0x1b48de);}(_0x1059,0x176));var _0x9105=function(_0x1b47f1,_0x3607f5){_0x1b47f1=_0x1b47f1-0x0;var _0x124d21=_0x1059[_0x1b47f1];return _0x124d21;};'use strict';var multer=require(_0x9105('0x0'));var util=require(_0x9105('0x1'));var path=require('path');var timeout=require(_0x9105('0x2'));var express=require(_0x9105('0x3'));var router=express[_0x9105('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9105('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9105('0x6'));var controller=require(_0x9105('0x7'));router['get']('/',auth[_0x9105('0x8')](),controller['index']);router[_0x9105('0x9')](_0x9105('0xa'),auth[_0x9105('0x8')](),controller['describe']);router[_0x9105('0x9')](_0x9105('0xb'),auth[_0x9105('0x8')](),controller[_0x9105('0xc')]);router['post']('/',auth[_0x9105('0x8')](),controller[_0x9105('0xd')]);router[_0x9105('0xe')](_0x9105('0xb'),auth['isAuthenticated'](),controller[_0x9105('0xf')]);router['delete'](_0x9105('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x9105('0x10')]=router; \ No newline at end of file +var _0x8ccc=['isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get'];(function(_0x584d2a,_0x225d3e){var _0x48a185=function(_0xe0822a){while(--_0xe0822a){_0x584d2a['push'](_0x584d2a['shift']());}};_0x48a185(++_0x225d3e);}(_0x8ccc,0x16f));var _0xc8cc=function(_0x50d82f,_0x447eb1){_0x50d82f=_0x50d82f-0x0;var _0x30044b=_0x8ccc[_0x50d82f];return _0x30044b;};'use strict';var multer=require(_0xc8cc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc8cc('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc8cc('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xc8cc('0x3'));var config=require(_0xc8cc('0x4'));var controller=require(_0xc8cc('0x5'));router[_0xc8cc('0x6')]('/',auth[_0xc8cc('0x7')](),controller['index']);router['get'](_0xc8cc('0x8'),auth[_0xc8cc('0x7')](),controller[_0xc8cc('0x9')]);router[_0xc8cc('0x6')](_0xc8cc('0xa'),auth[_0xc8cc('0x7')](),controller[_0xc8cc('0xb')]);router[_0xc8cc('0xc')]('/',auth[_0xc8cc('0x7')](),controller[_0xc8cc('0xd')]);router['put'](_0xc8cc('0xa'),auth['isAuthenticated'](),controller[_0xc8cc('0xe')]);router[_0xc8cc('0xf')](_0xc8cc('0xa'),auth[_0xc8cc('0x7')](),controller['destroy']);module[_0xc8cc('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index fbe97a8..237d4e9 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 _0x9268=['moment','sequelize','exports','STRING','DATE'];(function(_0x1b693a,_0x500ea3){var _0x315f4a=function(_0x556408){while(--_0x556408){_0x1b693a['push'](_0x1b693a['shift']());}};_0x315f4a(++_0x500ea3);}(_0x9268,0x104));var _0x8926=function(_0x1c470d,_0x81d66b){_0x1c470d=_0x1c470d-0x0;var _0x12141b=_0x9268[_0x1c470d];return _0x12141b;};'use strict';var moment=require(_0x8926('0x0'));var Sequelize=require(_0x8926('0x1'));module[_0x8926('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8926('0x3')]},'joinAt':{'type':Sequelize[_0x8926('0x4')]},'leaveAt':{'type':Sequelize[_0x8926('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8926('0x4')]},'reason':{'type':Sequelize[_0x8926('0x3')]}}; \ No newline at end of file +var _0x1c76=['STRING','DATE','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c76,0x11a));var _0x61c7=function(_0x59e2f8,_0x4fb359){_0x59e2f8=_0x59e2f8-0x0;var _0x4d9a29=_0x1c76[_0x59e2f8];return _0x4d9a29;};'use strict';var moment=require('moment');var Sequelize=require(_0x61c7('0x0'));module[_0x61c7('0x1')]={'uniqueid':{'type':Sequelize[_0x61c7('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x61c7('0x2')]},'joinAt':{'type':Sequelize[_0x61c7('0x3')]},'leaveAt':{'type':Sequelize[_0x61c7('0x3')]},'acceptAt':{'type':Sequelize[_0x61c7('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index ea06327..6913094 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 _0xf2ae=['includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','sendStatus','error','stack','name','send','SmsQueueReport','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options'];(function(_0x1ba2e5,_0xbcc3fb){var _0x2b8957=function(_0x2a2427){while(--_0x2a2427){_0x1ba2e5['push'](_0x1ba2e5['shift']());}};_0x2b8957(++_0xbcc3fb);}(_0xf2ae,0x176));var _0xef2a=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0xf2ae[_0x40a825];return _0x273a54;};'use strict';var emlformat=require(_0xef2a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef2a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef2a('0x2'));var moment=require(_0xef2a('0x3'));var BPromise=require(_0xef2a('0x4'));var Mustache=require(_0xef2a('0x5'));var util=require(_0xef2a('0x6'));var path=require(_0xef2a('0x7'));var sox=require(_0xef2a('0x8'));var csv=require(_0xef2a('0x9'));var ejs=require(_0xef2a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef2a('0xb'));var squel=require(_0xef2a('0xc'));var crypto=require(_0xef2a('0xd'));var jsforce=require(_0xef2a('0xe'));var deskjs=require(_0xef2a('0xf'));var toCsv=require(_0xef2a('0x9'));var querystring=require(_0xef2a('0x10'));var Papa=require(_0xef2a('0x11'));var Redis=require(_0xef2a('0x12'));var authService=require(_0xef2a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xef2a('0x14'));var logger=require(_0xef2a('0x15'))('api');var utils=require(_0xef2a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xef2a('0x17'));var db=require(_0xef2a('0x18'))['db'];function respondWithStatusCode(_0x1f9c85,_0xeab024){_0xeab024=_0xeab024||0xcc;return function(_0x5e0e1e){if(_0x5e0e1e){return _0x1f9c85['sendStatus'](_0xeab024);}return _0x1f9c85[_0xef2a('0x19')](_0xeab024)[_0xef2a('0x1a')]();};}function respondWithResult(_0x503270,_0x1e1dae){_0x1e1dae=_0x1e1dae||0xc8;return function(_0x46bc05){if(_0x46bc05){return _0x503270[_0xef2a('0x19')](_0x1e1dae)[_0xef2a('0x1b')](_0x46bc05);}};}function respondWithFilteredResult(_0x55dd92,_0x313b18){return function(_0x1f4e3d){if(_0x1f4e3d){var _0x291666=typeof _0x313b18[_0xef2a('0x1c')]===_0xef2a('0x1d')&&typeof _0x313b18[_0xef2a('0x1e')]===_0xef2a('0x1d');var _0x7124f0=_0x1f4e3d[_0xef2a('0x1f')];var _0x3ca3c6=_0x291666?0x0:_0x313b18[_0xef2a('0x1c')];var _0x43db19=_0x291666?_0x1f4e3d[_0xef2a('0x1f')]:_0x313b18[_0xef2a('0x1c')]+_0x313b18['limit'];var _0x68357f;if(_0x43db19>=_0x7124f0){_0x43db19=_0x7124f0;_0x68357f=0xc8;}else{_0x68357f=0xce;}_0x55dd92[_0xef2a('0x19')](_0x68357f);return _0x55dd92[_0xef2a('0x20')]('Content-Range',_0x3ca3c6+'-'+_0x43db19+'/'+_0x7124f0)[_0xef2a('0x1b')](_0x1f4e3d);}return null;};}function patchUpdates(_0x120263){return function(_0x334dc6){try{jsonpatch['apply'](_0x334dc6,_0x120263,!![]);}catch(_0x34afd9){return BPromise[_0xef2a('0x21')](_0x34afd9);}return _0x334dc6['save']();};}function saveUpdates(_0x3ca55d,_0x4c3608){return function(_0x4f001f){if(_0x4f001f){return _0x4f001f[_0xef2a('0x22')](_0x3ca55d)[_0xef2a('0x23')](function(_0xe61a37){return _0xe61a37;});}return null;};}function removeEntity(_0x7c9bf2,_0x4e1639){return function(_0x452d0f){if(_0x452d0f){return _0x452d0f[_0xef2a('0x24')]()[_0xef2a('0x23')](function(){_0x7c9bf2[_0xef2a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9c35f2,_0x425c95){return function(_0x563c90){if(!_0x563c90){_0x9c35f2[_0xef2a('0x25')](0x194);}return _0x563c90;};}function handleError(_0x14320c,_0x1f3dd4){_0x1f3dd4=_0x1f3dd4||0x1f4;return function(_0x40db54){logger[_0xef2a('0x26')](_0x40db54[_0xef2a('0x27')]);if(_0x40db54[_0xef2a('0x28')]){delete _0x40db54['name'];}_0x14320c[_0xef2a('0x19')](_0x1f3dd4)[_0xef2a('0x29')](_0x40db54);};}exports['index']=function(_0x2d5674,_0x3bf81e){var _0x105a92={},_0x163aa8={},_0xb892cb={'count':0x0,'rows':[]};var _0x4e58e1=_['map'](db[_0xef2a('0x2a')][_0xef2a('0x2b')],function(_0x4dfd22){return{'name':_0x4dfd22['fieldName'],'type':_0x4dfd22[_0xef2a('0x2c')][_0xef2a('0x2d')]};});_0x163aa8[_0xef2a('0x2e')]=_[_0xef2a('0x2f')](_0x4e58e1,_0xef2a('0x28'));_0x163aa8['query']=_['keys'](_0x2d5674[_0xef2a('0x30')]);_0x163aa8['filters']=_[_0xef2a('0x31')](_0x163aa8[_0xef2a('0x2e')],_0x163aa8[_0xef2a('0x30')]);_0x105a92[_0xef2a('0x32')]=_['intersection'](_0x163aa8[_0xef2a('0x2e')],qs[_0xef2a('0x33')](_0x2d5674[_0xef2a('0x30')][_0xef2a('0x33')]));_0x105a92[_0xef2a('0x32')]=_0x105a92[_0xef2a('0x32')][_0xef2a('0x34')]?_0x105a92['attributes']:_0x163aa8[_0xef2a('0x2e')];if(!_0x2d5674[_0xef2a('0x30')][_0xef2a('0x35')](_0xef2a('0x36'))){_0x105a92['limit']=qs['limit'](_0x2d5674[_0xef2a('0x30')][_0xef2a('0x1e')]);_0x105a92[_0xef2a('0x1c')]=qs[_0xef2a('0x1c')](_0x2d5674[_0xef2a('0x30')][_0xef2a('0x1c')]);}_0x105a92[_0xef2a('0x37')]=qs[_0xef2a('0x38')](_0x2d5674[_0xef2a('0x30')]['sort']);_0x105a92[_0xef2a('0x39')]=qs[_0xef2a('0x3a')](_[_0xef2a('0x3b')](_0x2d5674[_0xef2a('0x30')],_0x163aa8[_0xef2a('0x3a')]),_0x4e58e1);if(_0x2d5674[_0xef2a('0x30')][_0xef2a('0x3c')]){_0x105a92[_0xef2a('0x39')]=_['merge'](_0x105a92[_0xef2a('0x39')],{'$or':_[_0xef2a('0x2f')](_0x4e58e1,function(_0x2431ec){if(_0x2431ec[_0xef2a('0x2c')]!==_0xef2a('0x3d')){var _0x2de825={};_0x2de825[_0x2431ec[_0xef2a('0x28')]]={'$like':'%'+_0x2d5674[_0xef2a('0x30')][_0xef2a('0x3c')]+'%'};return _0x2de825;}})});}_0x105a92=_[_0xef2a('0x3e')]({},_0x105a92,_0x2d5674[_0xef2a('0x3f')]);var _0x42d01f={'where':_0x105a92[_0xef2a('0x39')]};return db['SmsQueueReport'][_0xef2a('0x1f')](_0x42d01f)['then'](function(_0x1bf6db){_0xb892cb[_0xef2a('0x1f')]=_0x1bf6db;if(_0x2d5674['query'][_0xef2a('0x40')]){_0x105a92[_0xef2a('0x41')]=[{'all':!![]}];}return db[_0xef2a('0x2a')][_0xef2a('0x42')](_0x105a92);})[_0xef2a('0x23')](function(_0x109ccb){_0xb892cb['rows']=_0x109ccb;return _0xb892cb;})['then'](respondWithFilteredResult(_0x3bf81e,_0x105a92))[_0xef2a('0x43')](handleError(_0x3bf81e,null));};exports['show']=function(_0x4b28f3,_0x4c4f96){var _0x5c7986={'raw':!![],'where':{'id':_0x4b28f3[_0xef2a('0x44')]['id']}},_0x15edc0={};_0x15edc0['model']=_['keys'](db[_0xef2a('0x2a')][_0xef2a('0x2b')]);_0x15edc0[_0xef2a('0x30')]=_['keys'](_0x4b28f3['query']);_0x15edc0[_0xef2a('0x3a')]=_['intersection'](_0x15edc0[_0xef2a('0x2e')],_0x15edc0[_0xef2a('0x30')]);_0x5c7986['attributes']=_[_0xef2a('0x31')](_0x15edc0[_0xef2a('0x2e')],qs['fields'](_0x4b28f3['query'][_0xef2a('0x33')]));_0x5c7986['attributes']=_0x5c7986[_0xef2a('0x32')][_0xef2a('0x34')]?_0x5c7986[_0xef2a('0x32')]:_0x15edc0[_0xef2a('0x2e')];if(_0x4b28f3['query'][_0xef2a('0x40')]){_0x5c7986['include']=[{'all':!![]}];}_0x5c7986=_[_0xef2a('0x3e')]({},_0x5c7986,_0x4b28f3[_0xef2a('0x3f')]);return db[_0xef2a('0x2a')][_0xef2a('0x45')](_0x5c7986)[_0xef2a('0x23')](handleEntityNotFound(_0x4c4f96,null))[_0xef2a('0x23')](respondWithResult(_0x4c4f96,null))[_0xef2a('0x43')](handleError(_0x4c4f96,null));};exports['create']=function(_0x23c2a5,_0x38293f){return db[_0xef2a('0x2a')][_0xef2a('0x46')](_0x23c2a5[_0xef2a('0x47')],{})[_0xef2a('0x23')](respondWithResult(_0x38293f,0xc9))['catch'](handleError(_0x38293f,null));};exports[_0xef2a('0x22')]=function(_0x309ac4,_0x468500){if(_0x309ac4['body']['id']){delete _0x309ac4[_0xef2a('0x47')]['id'];}return db[_0xef2a('0x2a')][_0xef2a('0x45')]({'where':{'id':_0x309ac4['params']['id']}})[_0xef2a('0x23')](handleEntityNotFound(_0x468500,null))[_0xef2a('0x23')](saveUpdates(_0x309ac4['body'],null))[_0xef2a('0x23')](respondWithResult(_0x468500,null))['catch'](handleError(_0x468500,null));};exports['destroy']=function(_0xfbbb08,_0x5176ae){return db['SmsQueueReport'][_0xef2a('0x45')]({'where':{'id':_0xfbbb08[_0xef2a('0x44')]['id']}})['then'](handleEntityNotFound(_0x5176ae,null))[_0xef2a('0x23')](removeEntity(_0x5176ae,null))[_0xef2a('0x43')](handleError(_0x5176ae,null));};exports[_0xef2a('0x48')]=function(_0x46d7b3,_0x4a8e35){return db[_0xef2a('0x2a')]['describe']()[_0xef2a('0x23')](respondWithResult(_0x4a8e35,null))[_0xef2a('0x43')](handleError(_0x4a8e35,null));}; \ No newline at end of file +var _0x04e2=['include','rows','catch','show','rawAttributes','includeAll','options','create','body','find','params','destroy','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','end','error','name','index','SmsQueueReport','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','merge'];(function(_0x1ad68e,_0x16562f){var _0x82d21e=function(_0x755572){while(--_0x755572){_0x1ad68e['push'](_0x1ad68e['shift']());}};_0x82d21e(++_0x16562f);}(_0x04e2,0x17f));var _0x204e=function(_0x2e32db,_0x11b6dd){_0x2e32db=_0x2e32db-0x0;var _0x1575e5=_0x04e2[_0x2e32db];return _0x1575e5;};'use strict';var emlformat=require(_0x204e('0x0'));var rimraf=require(_0x204e('0x1'));var zipdir=require(_0x204e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x204e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x204e('0x4'));var util=require(_0x204e('0x5'));var path=require(_0x204e('0x6'));var sox=require(_0x204e('0x7'));var csv=require(_0x204e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x204e('0x9'));var _=require(_0x204e('0xa'));var squel=require(_0x204e('0xb'));var crypto=require(_0x204e('0xc'));var jsforce=require(_0x204e('0xd'));var deskjs=require(_0x204e('0xe'));var toCsv=require(_0x204e('0x8'));var querystring=require(_0x204e('0xf'));var Papa=require(_0x204e('0x10'));var Redis=require(_0x204e('0x11'));var authService=require(_0x204e('0x12'));var qs=require(_0x204e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x204e('0x14'));var logger=require('../../config/logger')(_0x204e('0x15'));var utils=require('../../config/utils');var config=require(_0x204e('0x16'));var licenseUtil=require(_0x204e('0x17'));var db=require(_0x204e('0x18'))['db'];function respondWithStatusCode(_0x46a4e2,_0x49bdca){_0x49bdca=_0x49bdca||0xcc;return function(_0x9cba70){if(_0x9cba70){return _0x46a4e2[_0x204e('0x19')](_0x49bdca);}return _0x46a4e2[_0x204e('0x1a')](_0x49bdca)['end']();};}function respondWithResult(_0x4f81cb,_0x523c7e){_0x523c7e=_0x523c7e||0xc8;return function(_0x1a195b){if(_0x1a195b){return _0x4f81cb['status'](_0x523c7e)[_0x204e('0x1b')](_0x1a195b);}};}function respondWithFilteredResult(_0x18b982,_0xe97c8f){return function(_0x241e39){if(_0x241e39){var _0x4337b7=typeof _0xe97c8f[_0x204e('0x1c')]===_0x204e('0x1d')&&typeof _0xe97c8f['limit']===_0x204e('0x1d');var _0x499f8e=_0x241e39[_0x204e('0x1e')];var _0x23db73=_0x4337b7?0x0:_0xe97c8f[_0x204e('0x1c')];var _0x463ed1=_0x4337b7?_0x241e39['count']:_0xe97c8f[_0x204e('0x1c')]+_0xe97c8f[_0x204e('0x1f')];var _0x38ee42;if(_0x463ed1>=_0x499f8e){_0x463ed1=_0x499f8e;_0x38ee42=0xc8;}else{_0x38ee42=0xce;}_0x18b982['status'](_0x38ee42);return _0x18b982['set'](_0x204e('0x20'),_0x23db73+'-'+_0x463ed1+'/'+_0x499f8e)[_0x204e('0x1b')](_0x241e39);}return null;};}function patchUpdates(_0x31e4f1){return function(_0x28b76d){try{jsonpatch[_0x204e('0x21')](_0x28b76d,_0x31e4f1,!![]);}catch(_0x4545ce){return BPromise[_0x204e('0x22')](_0x4545ce);}return _0x28b76d[_0x204e('0x23')]();};}function saveUpdates(_0x5cf8a9,_0x44ce2f){return function(_0x6f847b){if(_0x6f847b){return _0x6f847b['update'](_0x5cf8a9)[_0x204e('0x24')](function(_0x4a1be9){return _0x4a1be9;});}return null;};}function removeEntity(_0x5143a6,_0x48cc31){return function(_0x11bf6f){if(_0x11bf6f){return _0x11bf6f['destroy']()[_0x204e('0x24')](function(){_0x5143a6[_0x204e('0x1a')](0xcc)[_0x204e('0x25')]();});}};}function handleEntityNotFound(_0x15c171,_0x4e1270){return function(_0x5bc2da){if(!_0x5bc2da){_0x15c171['sendStatus'](0x194);}return _0x5bc2da;};}function handleError(_0x523539,_0x27aba7){_0x27aba7=_0x27aba7||0x1f4;return function(_0xee5648){logger[_0x204e('0x26')](_0xee5648['stack']);if(_0xee5648[_0x204e('0x27')]){delete _0xee5648[_0x204e('0x27')];}_0x523539[_0x204e('0x1a')](_0x27aba7)['send'](_0xee5648);};}exports[_0x204e('0x28')]=function(_0x564e12,_0x490f4c){var _0x105b71={},_0x2f38f4={},_0x5b9bbf={'count':0x0,'rows':[]};var _0x3a3056=_['map'](db[_0x204e('0x29')]['rawAttributes'],function(_0x264f25){return{'name':_0x264f25[_0x204e('0x2a')],'type':_0x264f25[_0x204e('0x2b')][_0x204e('0x2c')]};});_0x2f38f4[_0x204e('0x2d')]=_[_0x204e('0x2e')](_0x3a3056,_0x204e('0x27'));_0x2f38f4[_0x204e('0x2f')]=_[_0x204e('0x30')](_0x564e12[_0x204e('0x2f')]);_0x2f38f4['filters']=_[_0x204e('0x31')](_0x2f38f4['model'],_0x2f38f4[_0x204e('0x2f')]);_0x105b71[_0x204e('0x32')]=_[_0x204e('0x31')](_0x2f38f4['model'],qs[_0x204e('0x33')](_0x564e12[_0x204e('0x2f')]['fields']));_0x105b71['attributes']=_0x105b71[_0x204e('0x32')][_0x204e('0x34')]?_0x105b71['attributes']:_0x2f38f4['model'];if(!_0x564e12[_0x204e('0x2f')][_0x204e('0x35')](_0x204e('0x36'))){_0x105b71[_0x204e('0x1f')]=qs[_0x204e('0x1f')](_0x564e12[_0x204e('0x2f')][_0x204e('0x1f')]);_0x105b71['offset']=qs[_0x204e('0x1c')](_0x564e12[_0x204e('0x2f')][_0x204e('0x1c')]);}_0x105b71[_0x204e('0x37')]=qs[_0x204e('0x38')](_0x564e12['query'][_0x204e('0x38')]);_0x105b71[_0x204e('0x39')]=qs[_0x204e('0x3a')](_['pick'](_0x564e12['query'],_0x2f38f4[_0x204e('0x3a')]),_0x3a3056);if(_0x564e12[_0x204e('0x2f')]['filter']){_0x105b71['where']=_['merge'](_0x105b71['where'],{'$or':_[_0x204e('0x2e')](_0x3a3056,function(_0x389841){if(_0x389841[_0x204e('0x2b')]!==_0x204e('0x3b')){var _0x2897c2={};_0x2897c2[_0x389841[_0x204e('0x27')]]={'$like':'%'+_0x564e12[_0x204e('0x2f')]['filter']+'%'};return _0x2897c2;}})});}_0x105b71=_[_0x204e('0x3c')]({},_0x105b71,_0x564e12['options']);var _0x477ca8={'where':_0x105b71[_0x204e('0x39')]};return db[_0x204e('0x29')][_0x204e('0x1e')](_0x477ca8)[_0x204e('0x24')](function(_0x2fe580){_0x5b9bbf[_0x204e('0x1e')]=_0x2fe580;if(_0x564e12[_0x204e('0x2f')]['includeAll']){_0x105b71[_0x204e('0x3d')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x105b71);})[_0x204e('0x24')](function(_0x32df73){_0x5b9bbf[_0x204e('0x3e')]=_0x32df73;return _0x5b9bbf;})[_0x204e('0x24')](respondWithFilteredResult(_0x490f4c,_0x105b71))[_0x204e('0x3f')](handleError(_0x490f4c,null));};exports[_0x204e('0x40')]=function(_0x254e05,_0x337956){var _0x3eb78c={'raw':!![],'where':{'id':_0x254e05['params']['id']}},_0xdd8e01={};_0xdd8e01[_0x204e('0x2d')]=_['keys'](db['SmsQueueReport'][_0x204e('0x41')]);_0xdd8e01[_0x204e('0x2f')]=_[_0x204e('0x30')](_0x254e05[_0x204e('0x2f')]);_0xdd8e01['filters']=_[_0x204e('0x31')](_0xdd8e01[_0x204e('0x2d')],_0xdd8e01[_0x204e('0x2f')]);_0x3eb78c[_0x204e('0x32')]=_[_0x204e('0x31')](_0xdd8e01[_0x204e('0x2d')],qs[_0x204e('0x33')](_0x254e05[_0x204e('0x2f')][_0x204e('0x33')]));_0x3eb78c[_0x204e('0x32')]=_0x3eb78c[_0x204e('0x32')][_0x204e('0x34')]?_0x3eb78c[_0x204e('0x32')]:_0xdd8e01['model'];if(_0x254e05[_0x204e('0x2f')][_0x204e('0x42')]){_0x3eb78c[_0x204e('0x3d')]=[{'all':!![]}];}_0x3eb78c=_[_0x204e('0x3c')]({},_0x3eb78c,_0x254e05[_0x204e('0x43')]);return db[_0x204e('0x29')]['find'](_0x3eb78c)[_0x204e('0x24')](handleEntityNotFound(_0x337956,null))[_0x204e('0x24')](respondWithResult(_0x337956,null))['catch'](handleError(_0x337956,null));};exports[_0x204e('0x44')]=function(_0x467d97,_0x439b50){return db[_0x204e('0x29')][_0x204e('0x44')](_0x467d97[_0x204e('0x45')],{})[_0x204e('0x24')](respondWithResult(_0x439b50,0xc9))['catch'](handleError(_0x439b50,null));};exports['update']=function(_0x2d5a25,_0x55bf7b){if(_0x2d5a25[_0x204e('0x45')]['id']){delete _0x2d5a25[_0x204e('0x45')]['id'];}return db[_0x204e('0x29')][_0x204e('0x46')]({'where':{'id':_0x2d5a25[_0x204e('0x47')]['id']}})[_0x204e('0x24')](handleEntityNotFound(_0x55bf7b,null))[_0x204e('0x24')](saveUpdates(_0x2d5a25[_0x204e('0x45')],null))[_0x204e('0x24')](respondWithResult(_0x55bf7b,null))[_0x204e('0x3f')](handleError(_0x55bf7b,null));};exports[_0x204e('0x48')]=function(_0x333707,_0x564d97){return db[_0x204e('0x29')]['find']({'where':{'id':_0x333707[_0x204e('0x47')]['id']}})[_0x204e('0x24')](handleEntityNotFound(_0x564d97,null))[_0x204e('0x24')](removeEntity(_0x564d97,null))[_0x204e('0x3f')](handleError(_0x564d97,null));};exports[_0x204e('0x49')]=function(_0x247235,_0x14b8bd){return db[_0x204e('0x29')]['describe']()[_0x204e('0x24')](respondWithResult(_0x14b8bd,null))[_0x204e('0x3f')](handleError(_0x14b8bd,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index f762709..fdcefbd 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 _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x1ca74d,_0x5973fe){var _0x29a532=function(_0x5111f9){while(--_0x5111f9){_0x1ca74d['push'](_0x1ca74d['shift']());}};_0x29a532(++_0x5973fe);}(_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 +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x4d443e,_0x4ac26c){var _0x468e82=function(_0x357c49){while(--_0x357c49){_0x4d443e['push'](_0x4d443e['shift']());}};_0x468e82(++_0x4ac26c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'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 477c77f..7a86651 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 _0xa4ff=['error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','options','raw','then','UpdateSmsQueueReport','update','body','where','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xa4ff,0xae));var _0xfa4f=function(_0x21e7c4,_0x2dc307){_0x21e7c4=_0x21e7c4-0x0;var _0x5c7139=_0xa4ff[_0x21e7c4];return _0x5c7139;};'use strict';var _=require('lodash');var util=require(_0xfa4f('0x0'));var moment=require(_0xfa4f('0x1'));var BPromise=require(_0xfa4f('0x2'));var rs=require(_0xfa4f('0x3'));var fs=require('fs');var Redis=require(_0xfa4f('0x4'));var db=require(_0xfa4f('0x5'))['db'];var utils=require(_0xfa4f('0x6'));var logger=require(_0xfa4f('0x7'))(_0xfa4f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfa4f('0x9')][_0xfa4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13b20c,_0x35e73e,_0x1ea3ee){return new BPromise(function(_0x7fe64c,_0x3f3d30){return client[_0xfa4f('0xb')](_0x13b20c,_0x1ea3ee)['then'](function(_0x272296){logger[_0xfa4f('0xc')](_0xfa4f('0xd'),_0x35e73e,_0xfa4f('0xe'));logger[_0xfa4f('0xf')](_0xfa4f('0x10'),_0x35e73e,_0xfa4f('0xe'),JSON[_0xfa4f('0x11')](_0x272296));if(_0x272296[_0xfa4f('0x12')]){if(_0x272296[_0xfa4f('0x12')]['code']===0x1f4){logger['error'](_0xfa4f('0xd'),_0x35e73e,_0x272296[_0xfa4f('0x12')][_0xfa4f('0x13')]);return _0x3f3d30(_0x272296[_0xfa4f('0x12')][_0xfa4f('0x13')]);}logger[_0xfa4f('0x12')](_0xfa4f('0xd'),_0x35e73e,_0x272296['error'][_0xfa4f('0x13')]);return _0x7fe64c(_0x272296[_0xfa4f('0x12')][_0xfa4f('0x13')]);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x35e73e,_0xfa4f('0xe'));_0x7fe64c(_0x272296[_0xfa4f('0x14')][_0xfa4f('0x13')]);}})[_0xfa4f('0x15')](function(_0x1c779a){logger[_0xfa4f('0x12')](_0xfa4f('0xd'),_0x35e73e,_0x1c779a);_0x3f3d30(_0x1c779a);});});}exports[_0xfa4f('0x16')]=function(_0x1d4980){var _0x3f5a7b=this;return new Promise(function(_0x916496,_0x2e88a4){return db[_0xfa4f('0x17')]['create'](_0x1d4980['body'],{'raw':_0x1d4980['options']?_0x1d4980[_0xfa4f('0x18')][_0xfa4f('0x19')]===undefined?!![]:![]:!![]})[_0xfa4f('0x1a')](function(_0x2dc53e){logger[_0xfa4f('0xc')](_0xfa4f('0x16'),_0x1d4980);logger[_0xfa4f('0xf')]('CreateSmsQueueReport',_0x1d4980,JSON[_0xfa4f('0x11')](_0x2dc53e));_0x916496(_0x2dc53e);})[_0xfa4f('0x15')](function(_0x1ea133){logger[_0xfa4f('0x12')](_0xfa4f('0x16'),_0x1ea133[_0xfa4f('0x13')],_0x1d4980);_0x2e88a4(_0x3f5a7b['error'](0x1f4,_0x1ea133['message']));});});};exports[_0xfa4f('0x1b')]=function(_0xf1ccf1){var _0x2f9ede=this;return new Promise(function(_0x38be78,_0x979926){return db[_0xfa4f('0x17')][_0xfa4f('0x1c')](_0xf1ccf1[_0xfa4f('0x1d')],{'raw':_0xf1ccf1[_0xfa4f('0x18')]?_0xf1ccf1[_0xfa4f('0x18')][_0xfa4f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf1ccf1[_0xfa4f('0x18')]?_0xf1ccf1[_0xfa4f('0x18')][_0xfa4f('0x1e')]||null:null,'attributes':_0xf1ccf1[_0xfa4f('0x18')]?_0xf1ccf1[_0xfa4f('0x18')]['attributes']||null:null,'limit':_0xf1ccf1['options']?_0xf1ccf1['options'][_0xfa4f('0x1f')]||null:null})[_0xfa4f('0x1a')](function(_0x544c14){logger['info'](_0xfa4f('0x1b'),_0xf1ccf1);logger[_0xfa4f('0xf')](_0xfa4f('0x1b'),_0xf1ccf1,JSON[_0xfa4f('0x11')](_0x544c14));_0x38be78(_0x544c14);})[_0xfa4f('0x15')](function(_0x573a52){logger[_0xfa4f('0x12')](_0xfa4f('0x1b'),_0x573a52[_0xfa4f('0x13')],_0xf1ccf1);_0x979926(_0x2f9ede[_0xfa4f('0x12')](0x1f4,_0x573a52['message']));});});}; \ No newline at end of file +var _0x5275=['SmsQueueReport','create','body','options','UpdateSmsQueueReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateSmsQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5275,0x1e6));var _0x5527=function(_0x3ced9d,_0x18daa5){_0x3ced9d=_0x3ced9d-0x0;var _0xa06cbb=_0x5275[_0x3ced9d];return _0xa06cbb;};'use strict';var _=require(_0x5527('0x0'));var util=require(_0x5527('0x1'));var moment=require(_0x5527('0x2'));var BPromise=require(_0x5527('0x3'));var rs=require(_0x5527('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5527('0x5'));var logger=require(_0x5527('0x6'))(_0x5527('0x7'));var config=require(_0x5527('0x8'));var jayson=require(_0x5527('0x9'));var client=jayson[_0x5527('0xa')][_0x5527('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x275532,_0xd3e822,_0x217dbb){return new BPromise(function(_0x2bf611,_0xe2bfa0){return client['request'](_0x275532,_0x217dbb)[_0x5527('0xc')](function(_0x3b6bf0){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0xd3e822,_0x5527('0xd'));logger[_0x5527('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0xd3e822,_0x5527('0xd'),JSON[_0x5527('0xf')](_0x3b6bf0));if(_0x3b6bf0[_0x5527('0x10')]){if(_0x3b6bf0['error'][_0x5527('0x11')]===0x1f4){logger['error'](_0x5527('0x12'),_0xd3e822,_0x3b6bf0[_0x5527('0x10')][_0x5527('0x13')]);return _0xe2bfa0(_0x3b6bf0[_0x5527('0x10')][_0x5527('0x13')]);}logger[_0x5527('0x10')](_0x5527('0x12'),_0xd3e822,_0x3b6bf0[_0x5527('0x10')][_0x5527('0x13')]);return _0x2bf611(_0x3b6bf0['error'][_0x5527('0x13')]);}else{logger[_0x5527('0x14')](_0x5527('0x12'),_0xd3e822,_0x5527('0xd'));_0x2bf611(_0x3b6bf0[_0x5527('0x15')][_0x5527('0x13')]);}})[_0x5527('0x16')](function(_0x4f920b){logger[_0x5527('0x10')](_0x5527('0x12'),_0xd3e822,_0x4f920b);_0xe2bfa0(_0x4f920b);});});}exports[_0x5527('0x17')]=function(_0x124db0){var _0x169c9a=this;return new Promise(function(_0x4e52fd,_0x3bb214){return db[_0x5527('0x18')][_0x5527('0x19')](_0x124db0[_0x5527('0x1a')],{'raw':_0x124db0['options']?_0x124db0[_0x5527('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x5527('0xc')](function(_0x132177){logger[_0x5527('0x14')]('CreateSmsQueueReport',_0x124db0);logger[_0x5527('0xe')]('CreateSmsQueueReport',_0x124db0,JSON[_0x5527('0xf')](_0x132177));_0x4e52fd(_0x132177);})[_0x5527('0x16')](function(_0x36aad1){logger[_0x5527('0x10')](_0x5527('0x17'),_0x36aad1[_0x5527('0x13')],_0x124db0);_0x3bb214(_0x169c9a[_0x5527('0x10')](0x1f4,_0x36aad1[_0x5527('0x13')]));});});};exports[_0x5527('0x1c')]=function(_0x2ed2a2){var _0x36cedd=this;return new Promise(function(_0x4c35e9,_0x4ff8a2){return db[_0x5527('0x18')][_0x5527('0x1d')](_0x2ed2a2[_0x5527('0x1a')],{'raw':_0x2ed2a2[_0x5527('0x1b')]?_0x2ed2a2['options'][_0x5527('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ed2a2['options']?_0x2ed2a2[_0x5527('0x1b')][_0x5527('0x1f')]||null:null,'attributes':_0x2ed2a2[_0x5527('0x1b')]?_0x2ed2a2[_0x5527('0x1b')][_0x5527('0x20')]||null:null,'limit':_0x2ed2a2['options']?_0x2ed2a2[_0x5527('0x1b')][_0x5527('0x21')]||null:null})[_0x5527('0xc')](function(_0x29a927){logger[_0x5527('0x14')](_0x5527('0x1c'),_0x2ed2a2);logger['debug'](_0x5527('0x1c'),_0x2ed2a2,JSON[_0x5527('0xf')](_0x29a927));_0x4c35e9(_0x29a927);})[_0x5527('0x16')](function(_0x23c448){logger[_0x5527('0x10')](_0x5527('0x1c'),_0x23c448['message'],_0x2ed2a2);_0x4ff8a2(_0x36cedd[_0x5527('0x10')](0x1f4,_0x23c448[_0x5527('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 589f6ed..e2085f4 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 _0xcca7=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x32e758,_0x13c271){var _0x349316=function(_0x27a9da){while(--_0x27a9da){_0x32e758['push'](_0x32e758['shift']());}};_0x349316(++_0x13c271);}(_0xcca7,0x1aa));var _0x7cca=function(_0x13f1e8,_0x558da1){_0x13f1e8=_0x13f1e8-0x0;var _0x2933d3=_0xcca7[_0x13f1e8];return _0x2933d3;};'use strict';var multer=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var path=require(_0x7cca('0x2'));var timeout=require(_0x7cca('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7cca('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7cca('0x5'));var config=require(_0x7cca('0x6'));var controller=require(_0x7cca('0x7'));router[_0x7cca('0x8')]('/',auth[_0x7cca('0x9')](),controller[_0x7cca('0xa')]);router['get']('/describe',auth[_0x7cca('0x9')](),controller[_0x7cca('0xb')]);router[_0x7cca('0x8')](_0x7cca('0xc'),auth[_0x7cca('0x9')](),controller[_0x7cca('0xd')]);router[_0x7cca('0xe')]('/',auth[_0x7cca('0x9')](),controller[_0x7cca('0xf')]);router[_0x7cca('0x10')]('/:id',auth[_0x7cca('0x9')](),controller[_0x7cca('0x11')]);router[_0x7cca('0x12')](_0x7cca('0xc'),auth[_0x7cca('0x9')](),controller['destroy']);module[_0x7cca('0x13')]=router; \ No newline at end of file +var _0x90b5=['/describe','describe','/:id','show','post','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x2f309c,_0x47ecab){var _0x2967b1=function(_0xc54884){while(--_0xc54884){_0x2f309c['push'](_0x2f309c['shift']());}};_0x2967b1(++_0x47ecab);}(_0x90b5,0x139));var _0x590b=function(_0x5143ed,_0x25b2e2){_0x5143ed=_0x5143ed-0x0;var _0x5dc173=_0x90b5[_0x5143ed];return _0x5dc173;};'use strict';var multer=require(_0x590b('0x0'));var util=require('util');var path=require(_0x590b('0x1'));var timeout=require(_0x590b('0x2'));var express=require(_0x590b('0x3'));var router=express[_0x590b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x590b('0x5'));var config=require(_0x590b('0x6'));var controller=require('./smsTransferReport.controller');router[_0x590b('0x7')]('/',auth[_0x590b('0x8')](),controller[_0x590b('0x9')]);router['get'](_0x590b('0xa'),auth[_0x590b('0x8')](),controller[_0x590b('0xb')]);router[_0x590b('0x7')](_0x590b('0xc'),auth[_0x590b('0x8')](),controller[_0x590b('0xd')]);router[_0x590b('0xe')]('/',auth[_0x590b('0x8')](),controller['create']);router[_0x590b('0xf')](_0x590b('0xc'),auth['isAuthenticated'](),controller[_0x590b('0x10')]);router['delete'](_0x590b('0xc'),auth[_0x590b('0x8')](),controller[_0x590b('0x11')]);module[_0x590b('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 0b5ab70..379a0cc 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x4b396d,_0x2d9f25){var _0x1901df=function(_0x305d1d){while(--_0x305d1d){_0x4b396d['push'](_0x4b396d['shift']());}};_0x1901df(++_0x2d9f25);}(_0x00bb,0x1d8));var _0xb00b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x00bb[_0x42245d];return _0x4b211a;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x3a2e4b,_0x1fc1f7){var _0x3697d9=function(_0x45a4fa){while(--_0x45a4fa){_0x3a2e4b['push'](_0x3a2e4b['shift']());}};_0x3697d9(++_0x1fc1f7);}(_0x34e8,0x12c));var _0x834e=function(_0x40ee1b,_0x1ef16b){_0x40ee1b=_0x40ee1b-0x0;var _0x794885=_0x34e8[_0x40ee1b];return _0x794885;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 9ad9560..f8f6897 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 _0xf297=['offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x292827,_0x95f387){var _0x485407=function(_0x3096eb){while(--_0x3096eb){_0x292827['push'](_0x292827['shift']());}};_0x485407(++_0x95f387);}(_0xf297,0x1f1));var _0x7f29=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xf297[_0x10004e];return _0x5af990;};'use strict';var emlformat=require(_0x7f29('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7f29('0x1'));var jsonpatch=require(_0x7f29('0x2'));var rp=require('request-promise');var moment=require(_0x7f29('0x3'));var BPromise=require(_0x7f29('0x4'));var Mustache=require(_0x7f29('0x5'));var util=require(_0x7f29('0x6'));var path=require(_0x7f29('0x7'));var sox=require(_0x7f29('0x8'));var csv=require(_0x7f29('0x9'));var ejs=require(_0x7f29('0xa'));var fs=require('fs');var fs_extra=require(_0x7f29('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7f29('0xc'));var jsforce=require(_0x7f29('0xd'));var deskjs=require(_0x7f29('0xe'));var toCsv=require(_0x7f29('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7f29('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7f29('0x10'));var hardwareService=require(_0x7f29('0x11'));var logger=require(_0x7f29('0x12'))(_0x7f29('0x13'));var utils=require(_0x7f29('0x14'));var config=require(_0x7f29('0x15'));var licenseUtil=require(_0x7f29('0x16'));var db=require(_0x7f29('0x17'))['db'];function respondWithStatusCode(_0x15b0c6,_0x279672){_0x279672=_0x279672||0xcc;return function(_0x46fb2d){if(_0x46fb2d){return _0x15b0c6[_0x7f29('0x18')](_0x279672);}return _0x15b0c6[_0x7f29('0x19')](_0x279672)[_0x7f29('0x1a')]();};}function respondWithResult(_0x50b61d,_0x159954){_0x159954=_0x159954||0xc8;return function(_0x406b8){if(_0x406b8){return _0x50b61d['status'](_0x159954)[_0x7f29('0x1b')](_0x406b8);}};}function respondWithFilteredResult(_0x7ee12b,_0x207cce){return function(_0x2a11d0){if(_0x2a11d0){var _0x302636=typeof _0x207cce[_0x7f29('0x1c')]===_0x7f29('0x1d')&&typeof _0x207cce[_0x7f29('0x1e')]===_0x7f29('0x1d');var _0x58523e=_0x2a11d0[_0x7f29('0x1f')];var _0x54ab69=_0x302636?0x0:_0x207cce[_0x7f29('0x1c')];var _0x451774=_0x302636?_0x2a11d0[_0x7f29('0x1f')]:_0x207cce[_0x7f29('0x1c')]+_0x207cce[_0x7f29('0x1e')];var _0x25d3ca;if(_0x451774>=_0x58523e){_0x451774=_0x58523e;_0x25d3ca=0xc8;}else{_0x25d3ca=0xce;}_0x7ee12b[_0x7f29('0x19')](_0x25d3ca);return _0x7ee12b['set'](_0x7f29('0x20'),_0x54ab69+'-'+_0x451774+'/'+_0x58523e)[_0x7f29('0x1b')](_0x2a11d0);}return null;};}function patchUpdates(_0x1c32f3){return function(_0x3f5218){try{jsonpatch['apply'](_0x3f5218,_0x1c32f3,!![]);}catch(_0x5f48fe){return BPromise[_0x7f29('0x21')](_0x5f48fe);}return _0x3f5218[_0x7f29('0x22')]();};}function saveUpdates(_0x21baf9,_0x1a73c0){return function(_0x3ec001){if(_0x3ec001){return _0x3ec001[_0x7f29('0x23')](_0x21baf9)[_0x7f29('0x24')](function(_0x2b667b){return _0x2b667b;});}return null;};}function removeEntity(_0x356430,_0x1f73bf){return function(_0x425282){if(_0x425282){return _0x425282[_0x7f29('0x25')]()[_0x7f29('0x24')](function(){_0x356430[_0x7f29('0x19')](0xcc)[_0x7f29('0x1a')]();});}};}function handleEntityNotFound(_0x433e4e,_0x31d92c){return function(_0x2dfa7f){if(!_0x2dfa7f){_0x433e4e[_0x7f29('0x18')](0x194);}return _0x2dfa7f;};}function handleError(_0x2d65d1,_0x5ad012){_0x5ad012=_0x5ad012||0x1f4;return function(_0xda42ff){logger[_0x7f29('0x26')](_0xda42ff[_0x7f29('0x27')]);if(_0xda42ff[_0x7f29('0x28')]){delete _0xda42ff[_0x7f29('0x28')];}_0x2d65d1[_0x7f29('0x19')](_0x5ad012)[_0x7f29('0x29')](_0xda42ff);};}exports[_0x7f29('0x2a')]=function(_0x12db91,_0x20f12a){var _0x35ef91={},_0x47d36e={},_0x56b573={'count':0x0,'rows':[]};var _0x1bdcc8=_['map'](db[_0x7f29('0x2b')][_0x7f29('0x2c')],function(_0x2e5247){return{'name':_0x2e5247[_0x7f29('0x2d')],'type':_0x2e5247[_0x7f29('0x2e')][_0x7f29('0x2f')]};});_0x47d36e[_0x7f29('0x30')]=_['map'](_0x1bdcc8,'name');_0x47d36e[_0x7f29('0x31')]=_[_0x7f29('0x32')](_0x12db91[_0x7f29('0x31')]);_0x47d36e['filters']=_[_0x7f29('0x33')](_0x47d36e['model'],_0x47d36e[_0x7f29('0x31')]);_0x35ef91[_0x7f29('0x34')]=_[_0x7f29('0x33')](_0x47d36e['model'],qs[_0x7f29('0x35')](_0x12db91['query'][_0x7f29('0x35')]));_0x35ef91[_0x7f29('0x34')]=_0x35ef91['attributes'][_0x7f29('0x36')]?_0x35ef91[_0x7f29('0x34')]:_0x47d36e[_0x7f29('0x30')];if(!_0x12db91[_0x7f29('0x31')][_0x7f29('0x37')](_0x7f29('0x38'))){_0x35ef91[_0x7f29('0x1e')]=qs[_0x7f29('0x1e')](_0x12db91['query']['limit']);_0x35ef91[_0x7f29('0x1c')]=qs[_0x7f29('0x1c')](_0x12db91[_0x7f29('0x31')]['offset']);}_0x35ef91['order']=qs['sort'](_0x12db91['query']['sort']);_0x35ef91[_0x7f29('0x39')]=qs[_0x7f29('0x3a')](_[_0x7f29('0x3b')](_0x12db91[_0x7f29('0x31')],_0x47d36e[_0x7f29('0x3a')]),_0x1bdcc8);if(_0x12db91[_0x7f29('0x31')][_0x7f29('0x3c')]){_0x35ef91['where']=_[_0x7f29('0x3d')](_0x35ef91[_0x7f29('0x39')],{'$or':_[_0x7f29('0x3e')](_0x1bdcc8,function(_0x3e7d61){if(_0x3e7d61['type']!==_0x7f29('0x3f')){var _0x5b8d19={};_0x5b8d19[_0x3e7d61['name']]={'$like':'%'+_0x12db91[_0x7f29('0x31')][_0x7f29('0x3c')]+'%'};return _0x5b8d19;}})});}_0x35ef91=_[_0x7f29('0x3d')]({},_0x35ef91,_0x12db91[_0x7f29('0x40')]);var _0x472837={'where':_0x35ef91[_0x7f29('0x39')]};return db['SmsTransferReport']['count'](_0x472837)[_0x7f29('0x24')](function(_0x236e90){_0x56b573[_0x7f29('0x1f')]=_0x236e90;if(_0x12db91[_0x7f29('0x31')][_0x7f29('0x41')]){_0x35ef91[_0x7f29('0x42')]=[{'all':!![]}];}return db[_0x7f29('0x2b')]['findAll'](_0x35ef91);})[_0x7f29('0x24')](function(_0x51caf3){_0x56b573[_0x7f29('0x43')]=_0x51caf3;return _0x56b573;})[_0x7f29('0x24')](respondWithFilteredResult(_0x20f12a,_0x35ef91))[_0x7f29('0x44')](handleError(_0x20f12a,null));};exports[_0x7f29('0x45')]=function(_0x49059b,_0x5b14e3){var _0x52f2e6={'raw':!![],'where':{'id':_0x49059b['params']['id']}},_0x25539e={};_0x25539e['model']=_[_0x7f29('0x32')](db[_0x7f29('0x2b')][_0x7f29('0x2c')]);_0x25539e[_0x7f29('0x31')]=_['keys'](_0x49059b[_0x7f29('0x31')]);_0x25539e['filters']=_['intersection'](_0x25539e['model'],_0x25539e[_0x7f29('0x31')]);_0x52f2e6[_0x7f29('0x34')]=_[_0x7f29('0x33')](_0x25539e[_0x7f29('0x30')],qs['fields'](_0x49059b[_0x7f29('0x31')][_0x7f29('0x35')]));_0x52f2e6[_0x7f29('0x34')]=_0x52f2e6[_0x7f29('0x34')][_0x7f29('0x36')]?_0x52f2e6['attributes']:_0x25539e[_0x7f29('0x30')];if(_0x49059b[_0x7f29('0x31')][_0x7f29('0x41')]){_0x52f2e6['include']=[{'all':!![]}];}_0x52f2e6=_[_0x7f29('0x3d')]({},_0x52f2e6,_0x49059b[_0x7f29('0x40')]);return db['SmsTransferReport'][_0x7f29('0x46')](_0x52f2e6)[_0x7f29('0x24')](handleEntityNotFound(_0x5b14e3,null))[_0x7f29('0x24')](respondWithResult(_0x5b14e3,null))[_0x7f29('0x44')](handleError(_0x5b14e3,null));};exports[_0x7f29('0x47')]=function(_0x5daaba,_0x1d9d24){return db[_0x7f29('0x2b')][_0x7f29('0x47')](_0x5daaba[_0x7f29('0x48')],{})[_0x7f29('0x24')](respondWithResult(_0x1d9d24,0xc9))[_0x7f29('0x44')](handleError(_0x1d9d24,null));};exports['update']=function(_0x464b26,_0x1014df){if(_0x464b26[_0x7f29('0x48')]['id']){delete _0x464b26['body']['id'];}return db['SmsTransferReport'][_0x7f29('0x46')]({'where':{'id':_0x464b26['params']['id']}})['then'](handleEntityNotFound(_0x1014df,null))[_0x7f29('0x24')](saveUpdates(_0x464b26[_0x7f29('0x48')],null))[_0x7f29('0x24')](respondWithResult(_0x1014df,null))['catch'](handleError(_0x1014df,null));};exports[_0x7f29('0x25')]=function(_0x3f51d8,_0x29af6f){return db[_0x7f29('0x2b')][_0x7f29('0x46')]({'where':{'id':_0x3f51d8[_0x7f29('0x49')]['id']}})[_0x7f29('0x24')](handleEntityNotFound(_0x29af6f,null))[_0x7f29('0x24')](removeEntity(_0x29af6f,null))['catch'](handleError(_0x29af6f,null));};exports[_0x7f29('0x4a')]=function(_0x33b402,_0xa6b005){return db[_0x7f29('0x2b')][_0x7f29('0x4a')]()[_0x7f29('0x24')](respondWithResult(_0xa6b005,null))[_0x7f29('0x44')](handleError(_0xa6b005,null));}; \ No newline at end of file +var _0xa899=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','index','SmsTransferReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','merge','includeAll','include','findAll','params','rawAttributes','options','catch','create','body','find','describe','eml-format','rimraf','moment','bluebird','mustache','util','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','sendStatus'];(function(_0x3915e4,_0xa5cf47){var _0x4622e3=function(_0x543978){while(--_0x543978){_0x3915e4['push'](_0x3915e4['shift']());}};_0x4622e3(++_0xa5cf47);}(_0xa899,0x1b5));var _0x9a89=function(_0x578275,_0xe7ae46){_0x578275=_0x578275-0x0;var _0xf78041=_0xa899[_0x578275];return _0xf78041;};'use strict';var emlformat=require(_0x9a89('0x0'));var rimraf=require(_0x9a89('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9a89('0x2'));var BPromise=require(_0x9a89('0x3'));var Mustache=require(_0x9a89('0x4'));var util=require(_0x9a89('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a89('0x6'));var _=require(_0x9a89('0x7'));var squel=require(_0x9a89('0x8'));var crypto=require('crypto');var jsforce=require(_0x9a89('0x9'));var deskjs=require(_0x9a89('0xa'));var toCsv=require(_0x9a89('0xb'));var querystring=require(_0x9a89('0xc'));var Papa=require(_0x9a89('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9a89('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a89('0xf'))('api');var utils=require(_0x9a89('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31b089,_0x2a1bb4){_0x2a1bb4=_0x2a1bb4||0xcc;return function(_0xabc279){if(_0xabc279){return _0x31b089[_0x9a89('0x11')](_0x2a1bb4);}return _0x31b089['status'](_0x2a1bb4)[_0x9a89('0x12')]();};}function respondWithResult(_0x35d391,_0x4211ca){_0x4211ca=_0x4211ca||0xc8;return function(_0x3a91b6){if(_0x3a91b6){return _0x35d391[_0x9a89('0x13')](_0x4211ca)['json'](_0x3a91b6);}};}function respondWithFilteredResult(_0x514c9c,_0x10a21e){return function(_0x5b3379){if(_0x5b3379){var _0x5a0f6f=typeof _0x10a21e[_0x9a89('0x14')]===_0x9a89('0x15')&&typeof _0x10a21e[_0x9a89('0x16')]==='undefined';var _0x492981=_0x5b3379[_0x9a89('0x17')];var _0x5c5fdd=_0x5a0f6f?0x0:_0x10a21e[_0x9a89('0x14')];var _0x23c0d2=_0x5a0f6f?_0x5b3379[_0x9a89('0x17')]:_0x10a21e[_0x9a89('0x14')]+_0x10a21e['limit'];var _0x1452cf;if(_0x23c0d2>=_0x492981){_0x23c0d2=_0x492981;_0x1452cf=0xc8;}else{_0x1452cf=0xce;}_0x514c9c[_0x9a89('0x13')](_0x1452cf);return _0x514c9c[_0x9a89('0x18')](_0x9a89('0x19'),_0x5c5fdd+'-'+_0x23c0d2+'/'+_0x492981)['json'](_0x5b3379);}return null;};}function patchUpdates(_0x362c4e){return function(_0x24f289){try{jsonpatch[_0x9a89('0x1a')](_0x24f289,_0x362c4e,!![]);}catch(_0x303ca2){return BPromise[_0x9a89('0x1b')](_0x303ca2);}return _0x24f289['save']();};}function saveUpdates(_0x91796c,_0x3f0f2b){return function(_0x11f227){if(_0x11f227){return _0x11f227[_0x9a89('0x1c')](_0x91796c)[_0x9a89('0x1d')](function(_0x7dec8e){return _0x7dec8e;});}return null;};}function removeEntity(_0x5e23d3,_0x6465c6){return function(_0x38df42){if(_0x38df42){return _0x38df42[_0x9a89('0x1e')]()['then'](function(){_0x5e23d3['status'](0xcc)[_0x9a89('0x12')]();});}};}function handleEntityNotFound(_0x399a1f,_0xb660f4){return function(_0x10668a){if(!_0x10668a){_0x399a1f['sendStatus'](0x194);}return _0x10668a;};}function handleError(_0x47d79b,_0x412fb5){_0x412fb5=_0x412fb5||0x1f4;return function(_0xa147a7){logger[_0x9a89('0x1f')](_0xa147a7['stack']);if(_0xa147a7[_0x9a89('0x20')]){delete _0xa147a7[_0x9a89('0x20')];}_0x47d79b[_0x9a89('0x13')](_0x412fb5)['send'](_0xa147a7);};}exports[_0x9a89('0x21')]=function(_0x2d955b,_0x5d1b3f){var _0x5a4f67={},_0x56bc00={},_0xeb7447={'count':0x0,'rows':[]};var _0x670bd8=_['map'](db[_0x9a89('0x22')]['rawAttributes'],function(_0x22a548){return{'name':_0x22a548[_0x9a89('0x23')],'type':_0x22a548[_0x9a89('0x24')][_0x9a89('0x25')]};});_0x56bc00[_0x9a89('0x26')]=_['map'](_0x670bd8,_0x9a89('0x20'));_0x56bc00[_0x9a89('0x27')]=_[_0x9a89('0x28')](_0x2d955b[_0x9a89('0x27')]);_0x56bc00['filters']=_[_0x9a89('0x29')](_0x56bc00[_0x9a89('0x26')],_0x56bc00[_0x9a89('0x27')]);_0x5a4f67[_0x9a89('0x2a')]=_[_0x9a89('0x29')](_0x56bc00[_0x9a89('0x26')],qs[_0x9a89('0x2b')](_0x2d955b[_0x9a89('0x27')][_0x9a89('0x2b')]));_0x5a4f67[_0x9a89('0x2a')]=_0x5a4f67[_0x9a89('0x2a')][_0x9a89('0x2c')]?_0x5a4f67[_0x9a89('0x2a')]:_0x56bc00[_0x9a89('0x26')];if(!_0x2d955b[_0x9a89('0x27')][_0x9a89('0x2d')](_0x9a89('0x2e'))){_0x5a4f67[_0x9a89('0x16')]=qs[_0x9a89('0x16')](_0x2d955b[_0x9a89('0x27')][_0x9a89('0x16')]);_0x5a4f67[_0x9a89('0x14')]=qs[_0x9a89('0x14')](_0x2d955b['query']['offset']);}_0x5a4f67['order']=qs[_0x9a89('0x2f')](_0x2d955b['query'][_0x9a89('0x2f')]);_0x5a4f67[_0x9a89('0x30')]=qs[_0x9a89('0x31')](_[_0x9a89('0x32')](_0x2d955b[_0x9a89('0x27')],_0x56bc00['filters']),_0x670bd8);if(_0x2d955b[_0x9a89('0x27')][_0x9a89('0x33')]){_0x5a4f67[_0x9a89('0x30')]=_['merge'](_0x5a4f67['where'],{'$or':_[_0x9a89('0x34')](_0x670bd8,function(_0x3c0231){if(_0x3c0231[_0x9a89('0x24')]!=='VIRTUAL'){var _0x3c4428={};_0x3c4428[_0x3c0231[_0x9a89('0x20')]]={'$like':'%'+_0x2d955b[_0x9a89('0x27')][_0x9a89('0x33')]+'%'};return _0x3c4428;}})});}_0x5a4f67=_[_0x9a89('0x35')]({},_0x5a4f67,_0x2d955b['options']);var _0x32a079={'where':_0x5a4f67['where']};return db['SmsTransferReport'][_0x9a89('0x17')](_0x32a079)[_0x9a89('0x1d')](function(_0x1c7e75){_0xeb7447[_0x9a89('0x17')]=_0x1c7e75;if(_0x2d955b[_0x9a89('0x27')][_0x9a89('0x36')]){_0x5a4f67[_0x9a89('0x37')]=[{'all':!![]}];}return db[_0x9a89('0x22')][_0x9a89('0x38')](_0x5a4f67);})['then'](function(_0x28b989){_0xeb7447['rows']=_0x28b989;return _0xeb7447;})[_0x9a89('0x1d')](respondWithFilteredResult(_0x5d1b3f,_0x5a4f67))['catch'](handleError(_0x5d1b3f,null));};exports['show']=function(_0x471d6b,_0x29388a){var _0xf3189c={'raw':!![],'where':{'id':_0x471d6b[_0x9a89('0x39')]['id']}},_0x410a5c={};_0x410a5c['model']=_[_0x9a89('0x28')](db[_0x9a89('0x22')][_0x9a89('0x3a')]);_0x410a5c['query']=_['keys'](_0x471d6b[_0x9a89('0x27')]);_0x410a5c['filters']=_['intersection'](_0x410a5c[_0x9a89('0x26')],_0x410a5c['query']);_0xf3189c[_0x9a89('0x2a')]=_[_0x9a89('0x29')](_0x410a5c[_0x9a89('0x26')],qs[_0x9a89('0x2b')](_0x471d6b[_0x9a89('0x27')][_0x9a89('0x2b')]));_0xf3189c[_0x9a89('0x2a')]=_0xf3189c[_0x9a89('0x2a')][_0x9a89('0x2c')]?_0xf3189c['attributes']:_0x410a5c[_0x9a89('0x26')];if(_0x471d6b[_0x9a89('0x27')]['includeAll']){_0xf3189c[_0x9a89('0x37')]=[{'all':!![]}];}_0xf3189c=_[_0x9a89('0x35')]({},_0xf3189c,_0x471d6b[_0x9a89('0x3b')]);return db['SmsTransferReport']['find'](_0xf3189c)['then'](handleEntityNotFound(_0x29388a,null))[_0x9a89('0x1d')](respondWithResult(_0x29388a,null))[_0x9a89('0x3c')](handleError(_0x29388a,null));};exports[_0x9a89('0x3d')]=function(_0x224307,_0xe5b26){return db['SmsTransferReport'][_0x9a89('0x3d')](_0x224307[_0x9a89('0x3e')],{})['then'](respondWithResult(_0xe5b26,0xc9))['catch'](handleError(_0xe5b26,null));};exports['update']=function(_0x4d8eff,_0x36ecf4){if(_0x4d8eff[_0x9a89('0x3e')]['id']){delete _0x4d8eff[_0x9a89('0x3e')]['id'];}return db[_0x9a89('0x22')]['find']({'where':{'id':_0x4d8eff[_0x9a89('0x39')]['id']}})[_0x9a89('0x1d')](handleEntityNotFound(_0x36ecf4,null))['then'](saveUpdates(_0x4d8eff[_0x9a89('0x3e')],null))[_0x9a89('0x1d')](respondWithResult(_0x36ecf4,null))[_0x9a89('0x3c')](handleError(_0x36ecf4,null));};exports[_0x9a89('0x1e')]=function(_0xe3466d,_0x28ca6c){return db[_0x9a89('0x22')][_0x9a89('0x3f')]({'where':{'id':_0xe3466d[_0x9a89('0x39')]['id']}})['then'](handleEntityNotFound(_0x28ca6c,null))[_0x9a89('0x1d')](removeEntity(_0x28ca6c,null))[_0x9a89('0x3c')](handleError(_0x28ca6c,null));};exports[_0x9a89('0x40')]=function(_0x19031a,_0xa24845){return db[_0x9a89('0x22')][_0x9a89('0x40')]()['then'](respondWithResult(_0xa24845,null))[_0x9a89('0x3c')](handleError(_0xa24845,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index f8a95ed..a57a29f 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 _0x3468=['path','rimraf','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','api','request-promise'];(function(_0x40ac68,_0xa56dc3){var _0x4ea40e=function(_0x5bc355){while(--_0x5bc355){_0x40ac68['push'](_0x40ac68['shift']());}};_0x4ea40e(++_0xa56dc3);}(_0x3468,0x8d));var _0x8346=function(_0x5108f7,_0x3e9a31){_0x5108f7=_0x5108f7-0x0;var _0x4224ce=_0x3468[_0x5108f7];return _0x4224ce;};'use strict';var _=require(_0x8346('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8346('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8346('0x2'));var fs=require('fs');var path=require(_0x8346('0x3'));var rimraf=require(_0x8346('0x4'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x2fc584,_0x52f1be){return _0x2fc584[_0x8346('0x5')](_0x8346('0x6'),attributes,{'tableName':_0x8346('0x7'),'paranoid':![],'indexes':[{'name':_0x8346('0x8'),'fields':[_0x8346('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb71d=['path','rimraf','../../config/environment','define','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1ad4d4,_0x43613c){var _0x5456e3=function(_0x1722a7){while(--_0x1722a7){_0x1ad4d4['push'](_0x1ad4d4['shift']());}};_0x5456e3(++_0x43613c);}(_0xb71d,0xc0));var _0xdb71=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb71d[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xdb71('0x0'));var util=require(_0xdb71('0x1'));var logger=require(_0xdb71('0x2'))(_0xdb71('0x3'));var moment=require(_0xdb71('0x4'));var BPromise=require(_0xdb71('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb71('0x6'));var rimraf=require(_0xdb71('0x7'));var config=require(_0xdb71('0x8'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x3bd587,_0x4dff0d){return _0x3bd587[_0xdb71('0x9')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xdb71('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 9ccd72f..4bc7085 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 _0x6fc4=['randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error','code','SmsTransferReport,\x20%s,\x20%s','message','info','catch','lodash','util'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0x6fc4,0x1a0));var _0x46fc=function(_0x4eb832,_0x324bff){_0x4eb832=_0x4eb832-0x0;var _0x2e5927=_0x6fc4[_0x4eb832];return _0x2e5927;};'use strict';var _=require(_0x46fc('0x0'));var util=require(_0x46fc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x46fc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x46fc('0x3'))(_0x46fc('0x4'));var config=require(_0x46fc('0x5'));var jayson=require(_0x46fc('0x6'));var client=jayson[_0x46fc('0x7')][_0x46fc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c4f75,_0x3951e9,_0x5ca981){return new BPromise(function(_0x4a7762,_0x149bf8){return client[_0x46fc('0x9')](_0x3c4f75,_0x5ca981)[_0x46fc('0xa')](function(_0x4594c1){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x3951e9,_0x46fc('0xb'));logger[_0x46fc('0xc')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x3951e9,_0x46fc('0xb'),JSON['stringify'](_0x4594c1));if(_0x4594c1[_0x46fc('0xd')]){if(_0x4594c1[_0x46fc('0xd')][_0x46fc('0xe')]===0x1f4){logger[_0x46fc('0xd')](_0x46fc('0xf'),_0x3951e9,_0x4594c1[_0x46fc('0xd')][_0x46fc('0x10')]);return _0x149bf8(_0x4594c1[_0x46fc('0xd')][_0x46fc('0x10')]);}logger[_0x46fc('0xd')](_0x46fc('0xf'),_0x3951e9,_0x4594c1[_0x46fc('0xd')][_0x46fc('0x10')]);return _0x4a7762(_0x4594c1[_0x46fc('0xd')][_0x46fc('0x10')]);}else{logger[_0x46fc('0x11')](_0x46fc('0xf'),_0x3951e9,_0x46fc('0xb'));_0x4a7762(_0x4594c1['result'][_0x46fc('0x10')]);}})[_0x46fc('0x12')](function(_0x1df938){logger[_0x46fc('0xd')](_0x46fc('0xf'),_0x3951e9,_0x1df938);_0x149bf8(_0x1df938);});});} \ No newline at end of file +var _0x60c2=['stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3c4f31,_0x3a20da){var _0x39f732=function(_0x2262bf){while(--_0x2262bf){_0x3c4f31['push'](_0x3c4f31['shift']());}};_0x39f732(++_0x3a20da);}(_0x60c2,0x8f));var _0x260c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x60c2[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x260c('0x0'));var moment=require(_0x260c('0x1'));var BPromise=require(_0x260c('0x2'));var rs=require(_0x260c('0x3'));var fs=require('fs');var Redis=require(_0x260c('0x4'));var db=require(_0x260c('0x5'))['db'];var utils=require(_0x260c('0x6'));var logger=require(_0x260c('0x7'))(_0x260c('0x8'));var config=require(_0x260c('0x9'));var jayson=require(_0x260c('0xa'));var client=jayson[_0x260c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14fab2,_0x2c2cd8,_0x3b432d){return new BPromise(function(_0xf22c37,_0x4b2992){return client[_0x260c('0xc')](_0x14fab2,_0x3b432d)[_0x260c('0xd')](function(_0x8378bb){logger[_0x260c('0xe')](_0x260c('0xf'),_0x2c2cd8,_0x260c('0x10'));logger[_0x260c('0x11')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x2c2cd8,_0x260c('0x10'),JSON[_0x260c('0x12')](_0x8378bb));if(_0x8378bb[_0x260c('0x13')]){if(_0x8378bb['error'][_0x260c('0x14')]===0x1f4){logger[_0x260c('0x13')](_0x260c('0xf'),_0x2c2cd8,_0x8378bb['error'][_0x260c('0x15')]);return _0x4b2992(_0x8378bb[_0x260c('0x13')][_0x260c('0x15')]);}logger[_0x260c('0x13')](_0x260c('0xf'),_0x2c2cd8,_0x8378bb['error'][_0x260c('0x15')]);return _0xf22c37(_0x8378bb['error'][_0x260c('0x15')]);}else{logger[_0x260c('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x2c2cd8,_0x260c('0x10'));_0xf22c37(_0x8378bb['result'][_0x260c('0x15')]);}})[_0x260c('0x16')](function(_0x411970){logger[_0x260c('0x13')](_0x260c('0xf'),_0x2c2cd8,_0x411970);_0x4b2992(_0x411970);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index ba5611a..b40d61e 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 _0x4b66=['diskStorage','server/files/sounds/original/','originalname','replace','format','basename','extname','now','single','create','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','show'];(function(_0x1e1965,_0x55785c){var _0x1a2e96=function(_0x27d366){while(--_0x27d366){_0x1e1965['push'](_0x1e1965['shift']());}};_0x1a2e96(++_0x55785c);}(_0x4b66,0x17a));var _0x64b6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4b66[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x64b6('0x0'));var util=require(_0x64b6('0x1'));var path=require(_0x64b6('0x2'));var timeout=require(_0x64b6('0x3'));var express=require(_0x64b6('0x4'));var router=express[_0x64b6('0x5')]();var fs_extra=require(_0x64b6('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x64b6('0x7'));var config=require(_0x64b6('0x8'));var controller=require('./sound.controller');router['get']('/',auth[_0x64b6('0x9')](),controller['index']);router[_0x64b6('0xa')]('/:id',auth[_0x64b6('0x9')](),controller[_0x64b6('0xb')]);router[_0x64b6('0xa')]('/:id/download',auth[_0x64b6('0x9')](),controller['download']);var upload=multer({'storage':multer[_0x64b6('0xc')]({'destination':function(_0x1f2943,_0x56ffed,_0x49be14){_0x49be14(null,path['join'](config['root'],_0x64b6('0xd')));},'filename':function(_0x54f200,_0xa52527,_0x57199b){_0xa52527[_0x64b6('0xe')]=_0xa52527[_0x64b6('0xe')][_0x64b6('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x57199b(null,util[_0x64b6('0x10')]('%s-%s%s',path[_0x64b6('0x11')](_0xa52527[_0x64b6('0xe')],path[_0x64b6('0x12')](_0xa52527[_0x64b6('0xe')])),Date[_0x64b6('0x13')](),path[_0x64b6('0x12')](_0xa52527[_0x64b6('0xe')])));}})});router['post']('/',upload[_0x64b6('0x14')]('file'),controller[_0x64b6('0x15')]);router[_0x64b6('0x16')](_0x64b6('0x17'),auth['isAuthenticated'](),controller['update']);router[_0x64b6('0x18')]('/:id',auth[_0x64b6('0x9')](),controller['delete']);module[_0x64b6('0x19')]=router; \ No newline at end of file +var _0x8d5f=['fs-extra','../../components/auth/service','get','isAuthenticated','/:id','show','/:id/download','download','diskStorage','join','originalname','replace','format','%s-%s%s','extname','now','post','single','file','create','update','delete','exports','util','connect-timeout','express'];(function(_0x27b3d4,_0xb8a9ec){var _0x162043=function(_0x4f1df6){while(--_0x4f1df6){_0x27b3d4['push'](_0x27b3d4['shift']());}};_0x162043(++_0xb8a9ec);}(_0x8d5f,0xe7));var _0xf8d5=function(_0x2ff762,_0x342c0b){_0x2ff762=_0x2ff762-0x0;var _0x158b02=_0x8d5f[_0x2ff762];return _0x158b02;};'use strict';var multer=require('multer');var util=require(_0xf8d5('0x0'));var path=require('path');var timeout=require(_0xf8d5('0x1'));var express=require(_0xf8d5('0x2'));var router=express['Router']();var fs_extra=require(_0xf8d5('0x3'));var auth=require(_0xf8d5('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./sound.controller');router[_0xf8d5('0x5')]('/',auth[_0xf8d5('0x6')](),controller['index']);router[_0xf8d5('0x5')](_0xf8d5('0x7'),auth[_0xf8d5('0x6')](),controller[_0xf8d5('0x8')]);router[_0xf8d5('0x5')](_0xf8d5('0x9'),auth[_0xf8d5('0x6')](),controller[_0xf8d5('0xa')]);var upload=multer({'storage':multer[_0xf8d5('0xb')]({'destination':function(_0x231fef,_0x4b0f0a,_0x463dc8){_0x463dc8(null,path[_0xf8d5('0xc')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x566ff5,_0x2c0511,_0x2ae764){_0x2c0511['originalname']=_0x2c0511[_0xf8d5('0xd')][_0xf8d5('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2ae764(null,util[_0xf8d5('0xf')](_0xf8d5('0x10'),path['basename'](_0x2c0511[_0xf8d5('0xd')],path[_0xf8d5('0x11')](_0x2c0511[_0xf8d5('0xd')])),Date[_0xf8d5('0x12')](),path[_0xf8d5('0x11')](_0x2c0511[_0xf8d5('0xd')])));}})});router[_0xf8d5('0x13')]('/',upload[_0xf8d5('0x14')](_0xf8d5('0x15')),controller[_0xf8d5('0x16')]);router['put'](_0xf8d5('0x7'),auth['isAuthenticated'](),controller[_0xf8d5('0x17')]);router[_0xf8d5('0x18')](_0xf8d5('0x7'),auth[_0xf8d5('0x6')](),controller[_0xf8d5('0x18')]);module[_0xf8d5('0x19')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index a73b248..c8d90ba 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 _0x3518=['BIGINT','INTEGER','sequelize','exports','STRING','name','FLOAT'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x3518,0x198));var _0x8351=function(_0x21af3a,_0x386e1d){_0x21af3a=_0x21af3a-0x0;var _0x268a49=_0x3518[_0x21af3a];return _0x268a49;};'use strict';var Sequelize=require(_0x8351('0x0'));module[_0x8351('0x1')]={'name':{'type':Sequelize[_0x8351('0x2')],'unique':_0x8351('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x8351('0x2')]},'display_name':{'type':Sequelize[_0x8351('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x8351('0x2')]},'original_format':{'type':Sequelize[_0x8351('0x2')]},'original_duration':{'type':Sequelize[_0x8351('0x4')]},'original_sampleCount':{'type':Sequelize[_0x8351('0x5')]},'original_channelCount':{'type':Sequelize[_0x8351('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x8351('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x8351('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x8351('0x5')]},'converted_channelCount':{'type':Sequelize[_0x8351('0x6')]},'converted_bitRate':{'type':Sequelize[_0x8351('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x8351('0x6')]}}; \ No newline at end of file +var _0xd389=['FLOAT','BIGINT','INTEGER','exports','name','STRING'];(function(_0x82dc2c,_0x183cca){var _0x13b857=function(_0x300a00){while(--_0x300a00){_0x82dc2c['push'](_0x82dc2c['shift']());}};_0x13b857(++_0x183cca);}(_0xd389,0xe1));var _0x9d38=function(_0x47f5b2,_0x321bc9){_0x47f5b2=_0x47f5b2-0x0;var _0x260496=_0xd389[_0x47f5b2];return _0x260496;};'use strict';var Sequelize=require('sequelize');module[_0x9d38('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x9d38('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x9d38('0x2')]},'display_name':{'type':Sequelize[_0x9d38('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x9d38('0x2')]},'original_format':{'type':Sequelize[_0x9d38('0x2')]},'original_duration':{'type':Sequelize[_0x9d38('0x3')]},'original_sampleCount':{'type':Sequelize[_0x9d38('0x4')]},'original_channelCount':{'type':Sequelize[_0x9d38('0x5')]},'original_bitRate':{'type':Sequelize[_0x9d38('0x4')]},'original_sampleRate':{'type':Sequelize[_0x9d38('0x5')]},'converted_format':{'type':Sequelize[_0x9d38('0x2')]},'converted_duration':{'type':Sequelize[_0x9d38('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x9d38('0x5')]},'converted_bitRate':{'type':Sequelize[_0x9d38('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x9d38('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index fb30584..7df60f4 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 _0x0946=['sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','body','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','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','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','get','Sounds','UserProfileResource','error','index','map','Sound','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','params','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','originalname','extname','file','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','send','original_duration','duration','original_sampleCount'];(function(_0x9c8b4a,_0x2387ff){var _0x198bef=function(_0x2eb4e8){while(--_0x2eb4e8){_0x9c8b4a['push'](_0x9c8b4a['shift']());}};_0x198bef(++_0x2387ff);}(_0x0946,0x8f));var _0x6094=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x0946[_0x26462c];return _0x509a42;};'use strict';var emlformat=require(_0x6094('0x0'));var rimraf=require(_0x6094('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6094('0x2'));var rp=require(_0x6094('0x3'));var moment=require(_0x6094('0x4'));var BPromise=require(_0x6094('0x5'));var Mustache=require(_0x6094('0x6'));var util=require(_0x6094('0x7'));var path=require(_0x6094('0x8'));var sox=require(_0x6094('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6094('0xa'));var _=require(_0x6094('0xb'));var squel=require(_0x6094('0xc'));var crypto=require(_0x6094('0xd'));var jsforce=require(_0x6094('0xe'));var deskjs=require(_0x6094('0xf'));var toCsv=require(_0x6094('0x10'));var querystring=require(_0x6094('0x11'));var Papa=require(_0x6094('0x12'));var Redis=require(_0x6094('0x13'));var authService=require(_0x6094('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x6094('0x15'));var hardwareService=require(_0x6094('0x16'));var logger=require(_0x6094('0x17'))('api');var utils=require(_0x6094('0x18'));var config=require(_0x6094('0x19'));var licenseUtil=require(_0x6094('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd6f8bd,_0x4478e1){_0x4478e1=_0x4478e1||0xcc;return function(_0x26155b){if(_0x26155b){return _0xd6f8bd[_0x6094('0x1b')](_0x4478e1);}return _0xd6f8bd[_0x6094('0x1c')](_0x4478e1)[_0x6094('0x1d')]();};}function respondWithResult(_0x16d26f,_0x14c8a1){_0x14c8a1=_0x14c8a1||0xc8;return function(_0x3f5875){if(_0x3f5875){return _0x16d26f[_0x6094('0x1c')](_0x14c8a1)[_0x6094('0x1e')](_0x3f5875);}};}function respondWithFilteredResult(_0x183a28,_0x3d8fcf){return function(_0x552356){if(_0x552356){var _0x309bb6=typeof _0x3d8fcf['offset']===_0x6094('0x1f')&&typeof _0x3d8fcf[_0x6094('0x20')]===_0x6094('0x1f');var _0x5dace5=_0x552356[_0x6094('0x21')];var _0x5dbaba=_0x309bb6?0x0:_0x3d8fcf[_0x6094('0x22')];var _0x1aa6b6=_0x309bb6?_0x552356[_0x6094('0x21')]:_0x3d8fcf[_0x6094('0x22')]+_0x3d8fcf['limit'];var _0x55e025;if(_0x1aa6b6>=_0x5dace5){_0x1aa6b6=_0x5dace5;_0x55e025=0xc8;}else{_0x55e025=0xce;}_0x183a28[_0x6094('0x1c')](_0x55e025);return _0x183a28[_0x6094('0x23')]('Content-Range',_0x5dbaba+'-'+_0x1aa6b6+'/'+_0x5dace5)[_0x6094('0x1e')](_0x552356);}return null;};}function patchUpdates(_0x1e7ee4){return function(_0x9c4b2d){try{jsonpatch[_0x6094('0x24')](_0x9c4b2d,_0x1e7ee4,!![]);}catch(_0x17bb45){return BPromise['reject'](_0x17bb45);}return _0x9c4b2d[_0x6094('0x25')]();};}function saveUpdates(_0x1a6c44,_0x404776){return function(_0x303753){if(_0x303753){return _0x303753[_0x6094('0x26')](_0x1a6c44)[_0x6094('0x27')](function(_0x2c0c75){return _0x2c0c75;});}return null;};}function removeEntity(_0xa358b1,_0x58fb8d){return function(_0x414c67){if(_0x414c67){return _0x414c67[_0x6094('0x28')]()['then'](function(){var _0x41e6b7=_0x414c67[_0x6094('0x29')]({'plain':!![]});var _0x57804e=_0x6094('0x2a');return db[_0x6094('0x2b')][_0x6094('0x28')]({'where':{'type':_0x57804e,'resourceId':_0x41e6b7['id']}})[_0x6094('0x27')](function(){return _0x414c67;});})[_0x6094('0x27')](function(){_0xa358b1['status'](0xcc)[_0x6094('0x1d')]();});}};}function handleEntityNotFound(_0x30530f,_0x5f4f6e){return function(_0x28cbac){if(!_0x28cbac){_0x30530f[_0x6094('0x1b')](0x194);}return _0x28cbac;};}function handleError(_0xe15d2f,_0x1609a5){_0x1609a5=_0x1609a5||0x1f4;return function(_0x18a2d5){logger[_0x6094('0x2c')](_0x18a2d5['stack']);if(_0x18a2d5['name']){delete _0x18a2d5['name'];}_0xe15d2f['status'](_0x1609a5)['send'](_0x18a2d5);};}exports[_0x6094('0x2d')]=function(_0x370d95,_0x449015){var _0x350b20={},_0x2c4c5d={},_0x4e93e4={'count':0x0,'rows':[]};var _0x5f38e2=_[_0x6094('0x2e')](db[_0x6094('0x2f')][_0x6094('0x30')],function(_0x3bc2f3){return{'name':_0x3bc2f3[_0x6094('0x31')],'type':_0x3bc2f3[_0x6094('0x32')][_0x6094('0x33')]};});_0x2c4c5d[_0x6094('0x34')]=_['map'](_0x5f38e2,_0x6094('0x35'));_0x2c4c5d[_0x6094('0x36')]=_[_0x6094('0x37')](_0x370d95[_0x6094('0x36')]);_0x2c4c5d['filters']=_[_0x6094('0x38')](_0x2c4c5d['model'],_0x2c4c5d[_0x6094('0x36')]);_0x350b20[_0x6094('0x39')]=_[_0x6094('0x38')](_0x2c4c5d[_0x6094('0x34')],qs[_0x6094('0x3a')](_0x370d95[_0x6094('0x36')]['fields']));_0x350b20[_0x6094('0x39')]=_0x350b20['attributes'][_0x6094('0x3b')]?_0x350b20[_0x6094('0x39')]:_0x2c4c5d[_0x6094('0x34')];if(!_0x370d95[_0x6094('0x36')][_0x6094('0x3c')](_0x6094('0x3d'))){_0x350b20['limit']=qs['limit'](_0x370d95[_0x6094('0x36')][_0x6094('0x20')]);_0x350b20[_0x6094('0x22')]=qs['offset'](_0x370d95['query'][_0x6094('0x22')]);}_0x350b20[_0x6094('0x3e')]=qs['sort'](_0x370d95[_0x6094('0x36')][_0x6094('0x3f')]);_0x350b20['where']=qs[_0x6094('0x40')](_[_0x6094('0x41')](_0x370d95['query'],_0x2c4c5d[_0x6094('0x40')]),_0x5f38e2);if(_0x370d95['query'][_0x6094('0x42')]){_0x350b20['where']=_[_0x6094('0x43')](_0x350b20[_0x6094('0x44')],{'$or':_['map'](_0x5f38e2,function(_0x5c40d2){if(_0x5c40d2['type']!==_0x6094('0x45')){var _0x11cbc2={};_0x11cbc2[_0x5c40d2[_0x6094('0x35')]]={'$like':'%'+_0x370d95[_0x6094('0x36')]['filter']+'%'};return _0x11cbc2;}})});}_0x350b20=_[_0x6094('0x43')]({},_0x350b20,_0x370d95[_0x6094('0x46')]);var _0x3d9125={'where':_0x350b20[_0x6094('0x44')]};return db[_0x6094('0x2f')]['count'](_0x3d9125)[_0x6094('0x27')](function(_0x1b7995){_0x4e93e4['count']=_0x1b7995;if(_0x370d95['query'][_0x6094('0x47')]){_0x350b20[_0x6094('0x48')]=[{'all':!![]}];}return db[_0x6094('0x2f')][_0x6094('0x49')](_0x350b20);})[_0x6094('0x27')](function(_0x2554b0){_0x4e93e4['rows']=_0x2554b0;return _0x4e93e4;})['then'](respondWithFilteredResult(_0x449015,_0x350b20))[_0x6094('0x4a')](handleError(_0x449015,null));};exports['show']=function(_0x14e9d8,_0x3d41d1){var _0x3ca3e5={'raw':!![],'where':{'id':_0x14e9d8[_0x6094('0x4b')]['id']}},_0x37ba0b={};_0x37ba0b['model']=_['keys'](db['Sound'][_0x6094('0x30')]);_0x37ba0b['query']=_[_0x6094('0x37')](_0x14e9d8[_0x6094('0x36')]);_0x37ba0b[_0x6094('0x40')]=_[_0x6094('0x38')](_0x37ba0b[_0x6094('0x34')],_0x37ba0b[_0x6094('0x36')]);_0x3ca3e5['attributes']=_['intersection'](_0x37ba0b[_0x6094('0x34')],qs['fields'](_0x14e9d8['query'][_0x6094('0x3a')]));_0x3ca3e5[_0x6094('0x39')]=_0x3ca3e5[_0x6094('0x39')][_0x6094('0x3b')]?_0x3ca3e5['attributes']:_0x37ba0b[_0x6094('0x34')];if(_0x14e9d8[_0x6094('0x36')]['includeAll']){_0x3ca3e5[_0x6094('0x48')]=[{'all':!![]}];}_0x3ca3e5=_[_0x6094('0x43')]({},_0x3ca3e5,_0x14e9d8[_0x6094('0x46')]);return db[_0x6094('0x2f')][_0x6094('0x4c')](_0x3ca3e5)[_0x6094('0x27')](handleEntityNotFound(_0x3d41d1,null))[_0x6094('0x27')](respondWithResult(_0x3d41d1,null))[_0x6094('0x4a')](handleError(_0x3d41d1,null));};exports[_0x6094('0x4d')]=function(_0xe5729d,_0x44ae32,_0x5cee39){return db['Sound'][_0x6094('0x4c')]({'where':{'id':_0xe5729d[_0x6094('0x4b')]['id']},'attributes':[_0x6094('0x35'),_0x6094('0x4e'),_0x6094('0x4f')],'raw':!![]})[_0x6094('0x27')](handleEntityNotFound(_0x44ae32,null))[_0x6094('0x27')](function(_0x29cd65){if(_0x29cd65){if(!fs[_0x6094('0x50')](path[_0x6094('0x51')](config[_0x6094('0x52')],_0x6094('0x53'),_0x29cd65[_0x6094('0x4e')]+'.'+_0x29cd65[_0x6094('0x4f')]))){throw new db[(_0x6094('0x54'))][(_0x6094('0x55'))](_0x6094('0x56'));}return _0x44ae32[_0x6094('0x4d')](path[_0x6094('0x51')](config[_0x6094('0x52')],'server/files/sounds/converted',util[_0x6094('0x57')](_0x6094('0x58'),_0x29cd65['save_name'],_0x29cd65['converted_format'])),util[_0x6094('0x57')]('%s.%s',_0x29cd65['name'],_0x29cd65[_0x6094('0x4f')]));}return null;})['catch'](handleError(_0x44ae32,null));};exports[_0x6094('0x59')]=function(_0x2c1c26,_0x22b79b,_0x55412d){var _0x123624={'name':path[_0x6094('0x5a')](_0x2c1c26['file'][_0x6094('0x5b')],path[_0x6094('0x5c')](_0x2c1c26[_0x6094('0x5d')][_0x6094('0x5b')])),'save_name':path[_0x6094('0x5a')](_0x2c1c26[_0x6094('0x5d')][_0x6094('0x5e')],path[_0x6094('0x5c')](_0x2c1c26[_0x6094('0x5d')][_0x6094('0x5e')])),'original_format':path[_0x6094('0x5c')](_0x2c1c26[_0x6094('0x5d')][_0x6094('0x5b')])[_0x6094('0x5f')](0x1),'converted_format':_0x6094('0x60')};var _0x4a92a2=path[_0x6094('0x51')](config[_0x6094('0x52')],'server/files/sounds/original',_0x2c1c26[_0x6094('0x5d')][_0x6094('0x5e')]);var _0x2ec251=path[_0x6094('0x51')](config[_0x6094('0x52')],_0x6094('0x53'),util[_0x6094('0x57')](_0x6094('0x58'),path[_0x6094('0x5a')](_0x2c1c26[_0x6094('0x5d')][_0x6094('0x5e')],path['extname'](_0x2c1c26['file'][_0x6094('0x5e')])),_0x123624[_0x6094('0x4f')]));logger[_0x6094('0x61')](_0x6094('0x62'),_0x4a92a2);logger['info'](_0x6094('0x63'),_0x2ec251);try{fs[_0x6094('0x64')](_0x4a92a2,parseInt('0777',0x8));var _0xc8d1b=sox['transcode'](_0x4a92a2,_0x2ec251,{'sampleRate':0x1f40,'format':_0x6094('0x60'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xc8d1b['on']('error',function(_0x7d8f60){fs['unlinkSync'](_0x4a92a2);_0x22b79b['status'](0x1f4)[_0x6094('0x65')](_0x7d8f60);});_0xc8d1b['on']('src',function(_0x491fd9){_0x123624[_0x6094('0x66')]=isNaN(_0x491fd9[_0x6094('0x67')])?null:_0x491fd9[_0x6094('0x67')]*0x3e8;_0x123624[_0x6094('0x68')]=isNaN(_0x491fd9[_0x6094('0x69')])?null:_0x491fd9[_0x6094('0x69')];_0x123624[_0x6094('0x6a')]=isNaN(_0x491fd9['channelCount'])?null:_0x491fd9[_0x6094('0x6b')];_0x123624[_0x6094('0x6c')]=isNaN(_0x491fd9['bitRate'])?null:_0x491fd9[_0x6094('0x6d')];_0x123624['original_sampleRate']=isNaN(_0x491fd9[_0x6094('0x6e')])?null:_0x491fd9['sampleRate'];});_0xc8d1b['on'](_0x6094('0x6f'),function(_0xc70739){_0x123624['converted_duration']=isNaN(_0xc70739['duration'])?null:_0xc70739[_0x6094('0x67')]*0x3e8;_0x123624[_0x6094('0x70')]=isNaN(_0xc70739[_0x6094('0x69')])?null:_0xc70739[_0x6094('0x69')];_0x123624[_0x6094('0x71')]=isNaN(_0xc70739['channelCount'])?null:_0xc70739[_0x6094('0x6b')];_0x123624[_0x6094('0x72')]=isNaN(_0xc70739[_0x6094('0x6d')])?null:_0xc70739[_0x6094('0x6d')];_0x123624[_0x6094('0x73')]=isNaN(_0xc70739[_0x6094('0x6e')])?null:_0xc70739['sampleRate'];});_0xc8d1b['on'](_0x6094('0x1d'),function(){fs[_0x6094('0x64')](_0x2ec251,parseInt('0777',0x8));return db[_0x6094('0x2f')]['create'](_0x123624)[_0x6094('0x27')](function(_0x11020d){var _0x3952dd={'role':_0x2c1c26['body'][_0x6094('0x74')],'userProfileId':_0x2c1c26['body']['userProfileId']};if(!_0x3952dd)throw new Error(_0x6094('0x75'));if(_0x3952dd[_0x6094('0x74')]===_0x6094('0x76')){var _0x3192a6=_0x11020d[_0x6094('0x29')]({'plain':!![]});return db['UserProfileSection'][_0x6094('0x4c')]({'where':{'name':_0x6094('0x2a'),'userProfileId':_0x3952dd['userProfileId']},'raw':!![]})['then'](function(_0xfd64c1){if(_0xfd64c1&&_0xfd64c1[_0x6094('0x77')]===0x0){return db[_0x6094('0x2b')][_0x6094('0x59')]({'name':_0x3192a6[_0x6094('0x35')],'resourceId':_0x3192a6['id'],'type':_0xfd64c1[_0x6094('0x35')],'sectionId':_0xfd64c1['id']},{})[_0x6094('0x27')](function(){return _0x11020d;});}else{return _0x11020d;}})[_0x6094('0x4a')](function(_0x3ec498){logger[_0x6094('0x2c')](_0x6094('0x78'),_0x3ec498);throw _0x3ec498;});}return _0x11020d;})[_0x6094('0x27')](respondWithResult(_0x22b79b,null))[_0x6094('0x4a')](handleError(_0x22b79b,null));});_0xc8d1b[_0x6094('0x79')]();}catch(_0xfd9e6f){_0x22b79b[_0x6094('0x1c')](0x1f4)[_0x6094('0x65')](_0xfd9e6f);}};exports[_0x6094('0x26')]=function(_0x5c7ed4,_0x2df225,_0xa37850){return db[_0x6094('0x2f')]['find']({'where':{'id':_0x5c7ed4[_0x6094('0x4b')]['id']}})[_0x6094('0x27')](handleEntityNotFound(_0x2df225,null))[_0x6094('0x27')](saveUpdates(_[_0x6094('0x41')](_0x5c7ed4[_0x6094('0x7a')],[_0x6094('0x35'),'description']),null))['then'](respondWithResult(_0x2df225,null))[_0x6094('0x4a')](handleError(_0x2df225,null));};exports['delete']=function(_0x3dad59,_0x1e4e10,_0x2ed9b7){return db[_0x6094('0x2f')][_0x6094('0x4c')]({'where':{'id':_0x3dad59[_0x6094('0x4b')]['id']}})['then'](function(_0x3f5d24){if(_0x3f5d24){return _0x3f5d24[_0x6094('0x28')]();}})[_0x6094('0x27')](function(_0x3ec7e4){var _0x181808=path[_0x6094('0x51')](config[_0x6094('0x52')],'server/files/sounds/original',util['format'](_0x6094('0x58'),_0x3ec7e4['save_name'],_0x3ec7e4['original_format']));var _0x53896a=path[_0x6094('0x51')](config[_0x6094('0x52')],_0x6094('0x53'),util[_0x6094('0x57')](_0x6094('0x58'),_0x3ec7e4[_0x6094('0x4e')],_0x3ec7e4['converted_format']));fs[_0x6094('0x7b')](_0x181808);fs[_0x6094('0x7b')](_0x53896a);return _0x3ec7e4;})['then'](function(_0x34e0fa){if(_0x34e0fa){return _0x1e4e10[_0x6094('0x1c')](0xcc)['end']();}})[_0x6094('0x27')](handleEntityNotFound(_0x1e4e10,null))[_0x6094('0x4a')](handleError(_0x1e4e10,null));}; \ No newline at end of file +var _0x4b03=['rows','catch','params','find','download','save_name','join','root','server/files/sounds/converted','converted_format','Sound\x20not\x20found','format','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','%s.%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','error','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_channelCount','converted_bitRate','converted_sampleRate','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','delete','original_format','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','nolimit','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','Sound','includeAll','include','findAll'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x4b03,0xad));var _0x34b0=function(_0x43b2bb,_0x1828c8){_0x43b2bb=_0x43b2bb-0x0;var _0x36dc2c=_0x4b03[_0x43b2bb];return _0x36dc2c;};'use strict';var emlformat=require(_0x34b0('0x0'));var rimraf=require(_0x34b0('0x1'));var zipdir=require(_0x34b0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x34b0('0x3'));var moment=require(_0x34b0('0x4'));var BPromise=require(_0x34b0('0x5'));var Mustache=require('mustache');var util=require(_0x34b0('0x6'));var path=require('path');var sox=require(_0x34b0('0x7'));var csv=require(_0x34b0('0x8'));var ejs=require(_0x34b0('0x9'));var fs=require('fs');var fs_extra=require(_0x34b0('0xa'));var _=require(_0x34b0('0xb'));var squel=require(_0x34b0('0xc'));var crypto=require(_0x34b0('0xd'));var jsforce=require(_0x34b0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x34b0('0x8'));var querystring=require(_0x34b0('0xf'));var Papa=require('papaparse');var Redis=require(_0x34b0('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(_0x34b0('0x11'))(_0x34b0('0x12'));var utils=require(_0x34b0('0x13'));var config=require(_0x34b0('0x14'));var licenseUtil=require(_0x34b0('0x15'));var db=require(_0x34b0('0x16'))['db'];function respondWithStatusCode(_0x17e0cb,_0x125945){_0x125945=_0x125945||0xcc;return function(_0x164ca4){if(_0x164ca4){return _0x17e0cb[_0x34b0('0x17')](_0x125945);}return _0x17e0cb[_0x34b0('0x18')](_0x125945)[_0x34b0('0x19')]();};}function respondWithResult(_0x3ee6dc,_0x149347){_0x149347=_0x149347||0xc8;return function(_0x4aa9ee){if(_0x4aa9ee){return _0x3ee6dc[_0x34b0('0x18')](_0x149347)[_0x34b0('0x1a')](_0x4aa9ee);}};}function respondWithFilteredResult(_0x51022e,_0x7e1405){return function(_0x369d0b){if(_0x369d0b){var _0x1f17b3=typeof _0x7e1405[_0x34b0('0x1b')]==='undefined'&&typeof _0x7e1405[_0x34b0('0x1c')]===_0x34b0('0x1d');var _0x2d2b45=_0x369d0b[_0x34b0('0x1e')];var _0x302805=_0x1f17b3?0x0:_0x7e1405['offset'];var _0x10079a=_0x1f17b3?_0x369d0b[_0x34b0('0x1e')]:_0x7e1405['offset']+_0x7e1405[_0x34b0('0x1c')];var _0x2ff3b7;if(_0x10079a>=_0x2d2b45){_0x10079a=_0x2d2b45;_0x2ff3b7=0xc8;}else{_0x2ff3b7=0xce;}_0x51022e['status'](_0x2ff3b7);return _0x51022e[_0x34b0('0x1f')](_0x34b0('0x20'),_0x302805+'-'+_0x10079a+'/'+_0x2d2b45)[_0x34b0('0x1a')](_0x369d0b);}return null;};}function patchUpdates(_0x23744d){return function(_0x158592){try{jsonpatch[_0x34b0('0x21')](_0x158592,_0x23744d,!![]);}catch(_0x3346ec){return BPromise[_0x34b0('0x22')](_0x3346ec);}return _0x158592[_0x34b0('0x23')]();};}function saveUpdates(_0x367146,_0x17d298){return function(_0x3dbc77){if(_0x3dbc77){return _0x3dbc77[_0x34b0('0x24')](_0x367146)[_0x34b0('0x25')](function(_0x18a522){return _0x18a522;});}return null;};}function removeEntity(_0x348faf,_0x117f83){return function(_0xbfd511){if(_0xbfd511){return _0xbfd511[_0x34b0('0x26')]()['then'](function(){var _0x3bf545=_0xbfd511[_0x34b0('0x27')]({'plain':!![]});var _0x979cd5=_0x34b0('0x28');return db[_0x34b0('0x29')][_0x34b0('0x26')]({'where':{'type':_0x979cd5,'resourceId':_0x3bf545['id']}})[_0x34b0('0x25')](function(){return _0xbfd511;});})[_0x34b0('0x25')](function(){_0x348faf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a30f3,_0x2f8ce5){return function(_0x399e53){if(!_0x399e53){_0x1a30f3[_0x34b0('0x17')](0x194);}return _0x399e53;};}function handleError(_0x87ce71,_0x3e0d9b){_0x3e0d9b=_0x3e0d9b||0x1f4;return function(_0x123c7b){logger['error'](_0x123c7b[_0x34b0('0x2a')]);if(_0x123c7b[_0x34b0('0x2b')]){delete _0x123c7b[_0x34b0('0x2b')];}_0x87ce71[_0x34b0('0x18')](_0x3e0d9b)[_0x34b0('0x2c')](_0x123c7b);};}exports['index']=function(_0x1b5701,_0x5bf2d5){var _0x25745c={},_0x23aec2={},_0x57a561={'count':0x0,'rows':[]};var _0x33a012=_[_0x34b0('0x2d')](db['Sound'][_0x34b0('0x2e')],function(_0x44cce9){return{'name':_0x44cce9[_0x34b0('0x2f')],'type':_0x44cce9['type']['key']};});_0x23aec2[_0x34b0('0x30')]=_[_0x34b0('0x2d')](_0x33a012,_0x34b0('0x2b'));_0x23aec2[_0x34b0('0x31')]=_[_0x34b0('0x32')](_0x1b5701['query']);_0x23aec2['filters']=_['intersection'](_0x23aec2[_0x34b0('0x30')],_0x23aec2[_0x34b0('0x31')]);_0x25745c[_0x34b0('0x33')]=_[_0x34b0('0x34')](_0x23aec2[_0x34b0('0x30')],qs['fields'](_0x1b5701[_0x34b0('0x31')][_0x34b0('0x35')]));_0x25745c[_0x34b0('0x33')]=_0x25745c[_0x34b0('0x33')][_0x34b0('0x36')]?_0x25745c[_0x34b0('0x33')]:_0x23aec2[_0x34b0('0x30')];if(!_0x1b5701[_0x34b0('0x31')]['hasOwnProperty'](_0x34b0('0x37'))){_0x25745c[_0x34b0('0x1c')]=qs[_0x34b0('0x1c')](_0x1b5701[_0x34b0('0x31')][_0x34b0('0x1c')]);_0x25745c[_0x34b0('0x1b')]=qs[_0x34b0('0x1b')](_0x1b5701[_0x34b0('0x31')][_0x34b0('0x1b')]);}_0x25745c['order']=qs['sort'](_0x1b5701[_0x34b0('0x31')][_0x34b0('0x38')]);_0x25745c['where']=qs[_0x34b0('0x39')](_[_0x34b0('0x3a')](_0x1b5701[_0x34b0('0x31')],_0x23aec2[_0x34b0('0x39')]),_0x33a012);if(_0x1b5701[_0x34b0('0x31')][_0x34b0('0x3b')]){_0x25745c[_0x34b0('0x3c')]=_[_0x34b0('0x3d')](_0x25745c[_0x34b0('0x3c')],{'$or':_[_0x34b0('0x2d')](_0x33a012,function(_0x11809a){if(_0x11809a[_0x34b0('0x3e')]!==_0x34b0('0x3f')){var _0x49052d={};_0x49052d[_0x11809a[_0x34b0('0x2b')]]={'$like':'%'+_0x1b5701[_0x34b0('0x31')][_0x34b0('0x3b')]+'%'};return _0x49052d;}})});}_0x25745c=_[_0x34b0('0x3d')]({},_0x25745c,_0x1b5701[_0x34b0('0x40')]);var _0x1d6ce8={'where':_0x25745c[_0x34b0('0x3c')]};return db[_0x34b0('0x41')]['count'](_0x1d6ce8)[_0x34b0('0x25')](function(_0x5bd291){_0x57a561[_0x34b0('0x1e')]=_0x5bd291;if(_0x1b5701[_0x34b0('0x31')][_0x34b0('0x42')]){_0x25745c[_0x34b0('0x43')]=[{'all':!![]}];}return db['Sound'][_0x34b0('0x44')](_0x25745c);})[_0x34b0('0x25')](function(_0xf53c37){_0x57a561[_0x34b0('0x45')]=_0xf53c37;return _0x57a561;})[_0x34b0('0x25')](respondWithFilteredResult(_0x5bf2d5,_0x25745c))[_0x34b0('0x46')](handleError(_0x5bf2d5,null));};exports['show']=function(_0x3fc72b,_0x561158){var _0x520501={'raw':!![],'where':{'id':_0x3fc72b[_0x34b0('0x47')]['id']}},_0x5ec09b={};_0x5ec09b[_0x34b0('0x30')]=_[_0x34b0('0x32')](db[_0x34b0('0x41')][_0x34b0('0x2e')]);_0x5ec09b[_0x34b0('0x31')]=_[_0x34b0('0x32')](_0x3fc72b[_0x34b0('0x31')]);_0x5ec09b['filters']=_[_0x34b0('0x34')](_0x5ec09b[_0x34b0('0x30')],_0x5ec09b['query']);_0x520501[_0x34b0('0x33')]=_[_0x34b0('0x34')](_0x5ec09b[_0x34b0('0x30')],qs[_0x34b0('0x35')](_0x3fc72b['query'][_0x34b0('0x35')]));_0x520501[_0x34b0('0x33')]=_0x520501[_0x34b0('0x33')][_0x34b0('0x36')]?_0x520501[_0x34b0('0x33')]:_0x5ec09b[_0x34b0('0x30')];if(_0x3fc72b['query'][_0x34b0('0x42')]){_0x520501[_0x34b0('0x43')]=[{'all':!![]}];}_0x520501=_['merge']({},_0x520501,_0x3fc72b[_0x34b0('0x40')]);return db[_0x34b0('0x41')][_0x34b0('0x48')](_0x520501)[_0x34b0('0x25')](handleEntityNotFound(_0x561158,null))[_0x34b0('0x25')](respondWithResult(_0x561158,null))[_0x34b0('0x46')](handleError(_0x561158,null));};exports[_0x34b0('0x49')]=function(_0x77b54c,_0x5958ef,_0x4fa039){return db[_0x34b0('0x41')][_0x34b0('0x48')]({'where':{'id':_0x77b54c[_0x34b0('0x47')]['id']},'attributes':[_0x34b0('0x2b'),_0x34b0('0x4a'),'converted_format'],'raw':!![]})[_0x34b0('0x25')](handleEntityNotFound(_0x5958ef,null))[_0x34b0('0x25')](function(_0xe5763d){if(_0xe5763d){if(!fs['existsSync'](path[_0x34b0('0x4b')](config[_0x34b0('0x4c')],_0x34b0('0x4d'),_0xe5763d['save_name']+'.'+_0xe5763d[_0x34b0('0x4e')]))){throw new db['Sequelize']['ValidationError'](_0x34b0('0x4f'));}return _0x5958ef['download'](path[_0x34b0('0x4b')](config[_0x34b0('0x4c')],'server/files/sounds/converted',util['format']('%s.%s',_0xe5763d[_0x34b0('0x4a')],_0xe5763d[_0x34b0('0x4e')])),util[_0x34b0('0x50')]('%s.%s',_0xe5763d[_0x34b0('0x2b')],_0xe5763d[_0x34b0('0x4e')]));}return null;})['catch'](handleError(_0x5958ef,null));};exports[_0x34b0('0x51')]=function(_0x3f6d05,_0x2395a2,_0x384e4c){var _0xae395={'name':path[_0x34b0('0x52')](_0x3f6d05[_0x34b0('0x53')][_0x34b0('0x54')],path[_0x34b0('0x55')](_0x3f6d05[_0x34b0('0x53')][_0x34b0('0x54')])),'save_name':path[_0x34b0('0x52')](_0x3f6d05[_0x34b0('0x53')][_0x34b0('0x56')],path[_0x34b0('0x55')](_0x3f6d05['file'][_0x34b0('0x56')])),'original_format':path[_0x34b0('0x55')](_0x3f6d05[_0x34b0('0x53')][_0x34b0('0x54')])[_0x34b0('0x57')](0x1),'converted_format':_0x34b0('0x58')};var _0x5cdbdd=path[_0x34b0('0x4b')](config[_0x34b0('0x4c')],_0x34b0('0x59'),_0x3f6d05[_0x34b0('0x53')][_0x34b0('0x56')]);var _0x997806=path[_0x34b0('0x4b')](config[_0x34b0('0x4c')],'server/files/sounds/converted',util[_0x34b0('0x50')](_0x34b0('0x5a'),path[_0x34b0('0x52')](_0x3f6d05[_0x34b0('0x53')][_0x34b0('0x56')],path[_0x34b0('0x55')](_0x3f6d05[_0x34b0('0x53')][_0x34b0('0x56')])),_0xae395['converted_format']));logger[_0x34b0('0x5b')]('Sound\x20upload\x20filepath:\x20%s',_0x5cdbdd);logger[_0x34b0('0x5b')](_0x34b0('0x5c'),_0x997806);try{fs[_0x34b0('0x5d')](_0x5cdbdd,parseInt(_0x34b0('0x5e'),0x8));var _0xed7085=sox['transcode'](_0x5cdbdd,_0x997806,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xed7085['on'](_0x34b0('0x5f'),function(_0x5dcc5a){fs['unlinkSync'](_0x5cdbdd);_0x2395a2['status'](0x1f4)[_0x34b0('0x2c')](_0x5dcc5a);});_0xed7085['on'](_0x34b0('0x60'),function(_0x3954f8){_0xae395[_0x34b0('0x61')]=isNaN(_0x3954f8[_0x34b0('0x62')])?null:_0x3954f8[_0x34b0('0x62')]*0x3e8;_0xae395[_0x34b0('0x63')]=isNaN(_0x3954f8[_0x34b0('0x64')])?null:_0x3954f8[_0x34b0('0x64')];_0xae395['original_channelCount']=isNaN(_0x3954f8[_0x34b0('0x65')])?null:_0x3954f8[_0x34b0('0x65')];_0xae395[_0x34b0('0x66')]=isNaN(_0x3954f8['bitRate'])?null:_0x3954f8[_0x34b0('0x67')];_0xae395[_0x34b0('0x68')]=isNaN(_0x3954f8[_0x34b0('0x69')])?null:_0x3954f8[_0x34b0('0x69')];});_0xed7085['on'](_0x34b0('0x6a'),function(_0x54afdf){_0xae395['converted_duration']=isNaN(_0x54afdf[_0x34b0('0x62')])?null:_0x54afdf[_0x34b0('0x62')]*0x3e8;_0xae395['converted_sampleCount']=isNaN(_0x54afdf['sampleCount'])?null:_0x54afdf['sampleCount'];_0xae395[_0x34b0('0x6b')]=isNaN(_0x54afdf['channelCount'])?null:_0x54afdf['channelCount'];_0xae395[_0x34b0('0x6c')]=isNaN(_0x54afdf[_0x34b0('0x67')])?null:_0x54afdf[_0x34b0('0x67')];_0xae395[_0x34b0('0x6d')]=isNaN(_0x54afdf[_0x34b0('0x69')])?null:_0x54afdf[_0x34b0('0x69')];});_0xed7085['on']('end',function(){fs[_0x34b0('0x5d')](_0x997806,parseInt(_0x34b0('0x5e'),0x8));return db[_0x34b0('0x41')]['create'](_0xae395)[_0x34b0('0x25')](function(_0x56ba04){var _0x2d385b={'role':_0x3f6d05[_0x34b0('0x6e')]['role'],'userProfileId':_0x3f6d05['body']['userProfileId']};if(!_0x2d385b)throw new Error(_0x34b0('0x6f'));if(_0x2d385b[_0x34b0('0x70')]===_0x34b0('0x71')){var _0x4fbc79=_0x56ba04[_0x34b0('0x27')]({'plain':!![]});return db[_0x34b0('0x72')][_0x34b0('0x48')]({'where':{'name':'Sounds','userProfileId':_0x2d385b[_0x34b0('0x73')]},'raw':!![]})['then'](function(_0x312cef){if(_0x312cef&&_0x312cef[_0x34b0('0x74')]===0x0){return db[_0x34b0('0x29')][_0x34b0('0x51')]({'name':_0x4fbc79[_0x34b0('0x2b')],'resourceId':_0x4fbc79['id'],'type':_0x312cef[_0x34b0('0x2b')],'sectionId':_0x312cef['id']},{})[_0x34b0('0x25')](function(){return _0x56ba04;});}else{return _0x56ba04;}})['catch'](function(_0x238b8a){logger['error'](_0x34b0('0x75'),_0x238b8a);throw _0x238b8a;});}return _0x56ba04;})['then'](respondWithResult(_0x2395a2,null))[_0x34b0('0x46')](handleError(_0x2395a2,null));});_0xed7085['start']();}catch(_0x3d10e0){_0x2395a2[_0x34b0('0x18')](0x1f4)[_0x34b0('0x2c')](_0x3d10e0);}};exports[_0x34b0('0x24')]=function(_0x48cc98,_0x188879,_0x4afca7){return db['Sound'][_0x34b0('0x48')]({'where':{'id':_0x48cc98[_0x34b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x188879,null))['then'](saveUpdates(_['pick'](_0x48cc98[_0x34b0('0x6e')],['name','description']),null))[_0x34b0('0x25')](respondWithResult(_0x188879,null))[_0x34b0('0x46')](handleError(_0x188879,null));};exports[_0x34b0('0x76')]=function(_0x3773c4,_0x496a46,_0x1b427e){return db[_0x34b0('0x41')][_0x34b0('0x48')]({'where':{'id':_0x3773c4[_0x34b0('0x47')]['id']}})[_0x34b0('0x25')](function(_0x5b6f82){if(_0x5b6f82){return _0x5b6f82[_0x34b0('0x26')]();}})['then'](function(_0x3900be){var _0x1fc605=path['join'](config['root'],_0x34b0('0x59'),util[_0x34b0('0x50')](_0x34b0('0x5a'),_0x3900be['save_name'],_0x3900be[_0x34b0('0x77')]));var _0x35bbbb=path[_0x34b0('0x4b')](config[_0x34b0('0x4c')],_0x34b0('0x4d'),util[_0x34b0('0x50')]('%s.%s',_0x3900be[_0x34b0('0x4a')],_0x3900be['converted_format']));fs[_0x34b0('0x78')](_0x1fc605);fs[_0x34b0('0x78')](_0x35bbbb);return _0x3900be;})[_0x34b0('0x25')](function(_0xd1d8ba){if(_0xd1d8ba){return _0x496a46[_0x34b0('0x18')](0xcc)[_0x34b0('0x19')]();}})[_0x34b0('0x25')](handleEntityNotFound(_0x496a46,null))[_0x34b0('0x46')](handleError(_0x496a46,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 348aa80..4d9e678 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 _0x2ce4=['exports','define','tools_sounds','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xc2addc,_0x5cb4da){var _0x4840a5=function(_0x122c24){while(--_0x122c24){_0xc2addc['push'](_0xc2addc['shift']());}};_0x4840a5(++_0x5cb4da);}(_0x2ce4,0xf6));var _0x42ce=function(_0x36fe06,_0xd5790d){_0x36fe06=_0x36fe06-0x0;var _0x1a8cd5=_0x2ce4[_0x36fe06];return _0x1a8cd5;};'use strict';var _=require(_0x42ce('0x0'));var util=require(_0x42ce('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x42ce('0x2'));var rp=require(_0x42ce('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x42ce('0x4'));var config=require(_0x42ce('0x5'));var attributes=require('./sound.attributes');module[_0x42ce('0x6')]=function(_0x18c92b,_0x5a680e){return _0x18c92b[_0x42ce('0x7')]('Sound',attributes,{'tableName':_0x42ce('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5889=['define','Sound','tools_sounds','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports'];(function(_0x451ad7,_0x4d26e2){var _0x21665b=function(_0x3fd581){while(--_0x3fd581){_0x451ad7['push'](_0x451ad7['shift']());}};_0x21665b(++_0x4d26e2);}(_0x5889,0x196));var _0x9588=function(_0x347d36,_0x10e804){_0x347d36=_0x347d36-0x0;var _0x9289cc=_0x5889[_0x347d36];return _0x9289cc;};'use strict';var _=require(_0x9588('0x0'));var util=require(_0x9588('0x1'));var logger=require(_0x9588('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9588('0x3'));var rp=require(_0x9588('0x4'));var fs=require('fs');var path=require(_0x9588('0x5'));var rimraf=require(_0x9588('0x6'));var config=require(_0x9588('0x7'));var attributes=require(_0x9588('0x8'));module[_0x9588('0x9')]=function(_0x522089,_0x250d65){return _0x522089[_0x9588('0xa')](_0x9588('0xb'),attributes,{'tableName':_0x9588('0xc'),'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 3f01dbe..bf992b4 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 _0x9945=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','ShowSound','Sound','options','raw','where','attributes','include','map','model','then','catch','moment','bluebird','ioredis'];(function(_0x828160,_0x26d5be){var _0x296b5f=function(_0x5e16e3){while(--_0x5e16e3){_0x828160['push'](_0x828160['shift']());}};_0x296b5f(++_0x26d5be);}(_0x9945,0xf5));var _0x5994=function(_0x3002f7,_0x300754){_0x3002f7=_0x3002f7-0x0;var _0x36b7d6=_0x9945[_0x3002f7];return _0x36b7d6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5994('0x0'));var BPromise=require(_0x5994('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5994('0x2'));var db=require(_0x5994('0x3'))['db'];var utils=require(_0x5994('0x4'));var logger=require(_0x5994('0x5'))(_0x5994('0x6'));var config=require(_0x5994('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5994('0x8')][_0x5994('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d3f37,_0x45660a,_0x490e03){return new BPromise(function(_0x11a6b6,_0x219137){return client[_0x5994('0xa')](_0x4d3f37,_0x490e03)['then'](function(_0x38486c){logger[_0x5994('0xb')](_0x5994('0xc'),_0x45660a,_0x5994('0xd'));logger[_0x5994('0xe')]('Sound,\x20%s,\x20%s,\x20%s',_0x45660a,_0x5994('0xd'),JSON[_0x5994('0xf')](_0x38486c));if(_0x38486c['error']){if(_0x38486c[_0x5994('0x10')][_0x5994('0x11')]===0x1f4){logger[_0x5994('0x10')](_0x5994('0xc'),_0x45660a,_0x38486c['error'][_0x5994('0x12')]);return _0x219137(_0x38486c[_0x5994('0x10')][_0x5994('0x12')]);}logger['error'](_0x5994('0xc'),_0x45660a,_0x38486c['error'][_0x5994('0x12')]);return _0x11a6b6(_0x38486c[_0x5994('0x10')][_0x5994('0x12')]);}else{logger['info'](_0x5994('0xc'),_0x45660a,_0x5994('0xd'));_0x11a6b6(_0x38486c[_0x5994('0x13')][_0x5994('0x12')]);}})['catch'](function(_0x2b9b14){logger[_0x5994('0x10')](_0x5994('0xc'),_0x45660a,_0x2b9b14);_0x219137(_0x2b9b14);});});}exports[_0x5994('0x14')]=function(_0x576f6e){var _0x219c0b=this;return new Promise(function(_0x12ac49,_0x2168ab){return db[_0x5994('0x15')]['find']({'raw':_0x576f6e[_0x5994('0x16')]?_0x576f6e[_0x5994('0x16')][_0x5994('0x17')]===undefined?!![]:![]:!![],'where':_0x576f6e[_0x5994('0x16')]?_0x576f6e[_0x5994('0x16')][_0x5994('0x18')]||null:null,'attributes':_0x576f6e[_0x5994('0x16')]?_0x576f6e[_0x5994('0x16')][_0x5994('0x19')]||null:null,'include':_0x576f6e[_0x5994('0x16')]?_0x576f6e[_0x5994('0x16')][_0x5994('0x1a')]?_[_0x5994('0x1b')](_0x576f6e[_0x5994('0x16')][_0x5994('0x1a')],function(_0x4115ef){return{'model':db[_0x4115ef['model']],'as':_0x4115ef['as'],'attributes':_0x4115ef['attributes'],'include':_0x4115ef[_0x5994('0x1a')]?_['map'](_0x4115ef['include'],function(_0x24911c){return{'model':db[_0x24911c[_0x5994('0x1c')]],'as':_0x24911c['as'],'attributes':_0x24911c[_0x5994('0x19')],'include':_0x24911c['include']?_[_0x5994('0x1b')](_0x24911c[_0x5994('0x1a')],function(_0x3eac9e){return{'model':db[_0x3eac9e['model']],'as':_0x3eac9e['as'],'attributes':_0x3eac9e['attributes']};}):[]};}):[]};}):[]:[]})[_0x5994('0x1d')](function(_0x35ba9b){logger[_0x5994('0xb')](_0x5994('0x14'),_0x576f6e);logger[_0x5994('0xe')](_0x5994('0x14'),_0x576f6e,JSON[_0x5994('0xf')](_0x35ba9b));_0x12ac49(_0x35ba9b);})[_0x5994('0x1e')](function(_0x309f1f){logger[_0x5994('0x10')](_0x5994('0x14'),_0x309f1f['message'],_0x576f6e);_0x2168ab(_0x219c0b[_0x5994('0x10')](0x1f4,_0x309f1f[_0x5994('0x12')]));});});}; \ No newline at end of file +var _0xe5f5=['raw','where','map','include','model','attributes','info','debug','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSound','Sound','options'];(function(_0x712d97,_0x53bb9b){var _0x2025e6=function(_0x2b45e3){while(--_0x2b45e3){_0x712d97['push'](_0x712d97['shift']());}};_0x2025e6(++_0x53bb9b);}(_0xe5f5,0x170));var _0x5e5f=function(_0x325cec,_0x2afc87){_0x325cec=_0x325cec-0x0;var _0x852361=_0xe5f5[_0x325cec];return _0x852361;};'use strict';var _=require('lodash');var util=require(_0x5e5f('0x0'));var moment=require(_0x5e5f('0x1'));var BPromise=require(_0x5e5f('0x2'));var rs=require(_0x5e5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5e5f('0x4'));var logger=require('../../config/logger')(_0x5e5f('0x5'));var config=require(_0x5e5f('0x6'));var jayson=require(_0x5e5f('0x7'));var client=jayson[_0x5e5f('0x8')][_0x5e5f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x469c32,_0x3347cd,_0xf8a5f0){return new BPromise(function(_0x373ada,_0x5f1f14){return client[_0x5e5f('0xa')](_0x469c32,_0xf8a5f0)['then'](function(_0x45191f){logger['info'](_0x5e5f('0xb'),_0x3347cd,_0x5e5f('0xc'));logger['debug'](_0x5e5f('0xd'),_0x3347cd,_0x5e5f('0xc'),JSON[_0x5e5f('0xe')](_0x45191f));if(_0x45191f[_0x5e5f('0xf')]){if(_0x45191f[_0x5e5f('0xf')][_0x5e5f('0x10')]===0x1f4){logger[_0x5e5f('0xf')](_0x5e5f('0xb'),_0x3347cd,_0x45191f['error']['message']);return _0x5f1f14(_0x45191f[_0x5e5f('0xf')][_0x5e5f('0x11')]);}logger[_0x5e5f('0xf')](_0x5e5f('0xb'),_0x3347cd,_0x45191f[_0x5e5f('0xf')][_0x5e5f('0x11')]);return _0x373ada(_0x45191f[_0x5e5f('0xf')]['message']);}else{logger['info']('Sound,\x20%s,\x20%s',_0x3347cd,_0x5e5f('0xc'));_0x373ada(_0x45191f['result'][_0x5e5f('0x11')]);}})[_0x5e5f('0x12')](function(_0x421c67){logger[_0x5e5f('0xf')](_0x5e5f('0xb'),_0x3347cd,_0x421c67);_0x5f1f14(_0x421c67);});});}exports[_0x5e5f('0x13')]=function(_0x2dea18){var _0x376979=this;return new Promise(function(_0x1884bf,_0x50176c){return db[_0x5e5f('0x14')]['find']({'raw':_0x2dea18['options']?_0x2dea18[_0x5e5f('0x15')][_0x5e5f('0x16')]===undefined?!![]:![]:!![],'where':_0x2dea18[_0x5e5f('0x15')]?_0x2dea18[_0x5e5f('0x15')][_0x5e5f('0x17')]||null:null,'attributes':_0x2dea18[_0x5e5f('0x15')]?_0x2dea18['options']['attributes']||null:null,'include':_0x2dea18[_0x5e5f('0x15')]?_0x2dea18[_0x5e5f('0x15')]['include']?_[_0x5e5f('0x18')](_0x2dea18[_0x5e5f('0x15')][_0x5e5f('0x19')],function(_0x35bac2){return{'model':db[_0x35bac2[_0x5e5f('0x1a')]],'as':_0x35bac2['as'],'attributes':_0x35bac2[_0x5e5f('0x1b')],'include':_0x35bac2['include']?_[_0x5e5f('0x18')](_0x35bac2[_0x5e5f('0x19')],function(_0x342e73){return{'model':db[_0x342e73['model']],'as':_0x342e73['as'],'attributes':_0x342e73['attributes'],'include':_0x342e73[_0x5e5f('0x19')]?_[_0x5e5f('0x18')](_0x342e73[_0x5e5f('0x19')],function(_0x40f009){return{'model':db[_0x40f009[_0x5e5f('0x1a')]],'as':_0x40f009['as'],'attributes':_0x40f009['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x43df7d){logger[_0x5e5f('0x1c')](_0x5e5f('0x13'),_0x2dea18);logger[_0x5e5f('0x1d')]('ShowSound',_0x2dea18,JSON['stringify'](_0x43df7d));_0x1884bf(_0x43df7d);})[_0x5e5f('0x12')](function(_0x3407ed){logger[_0x5e5f('0xf')](_0x5e5f('0x13'),_0x3407ed[_0x5e5f('0x11')],_0x2dea18);_0x50176c(_0x376979['error'](0x1f4,_0x3407ed[_0x5e5f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 50e562b..f8a35df 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 _0x757a=['destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x255c13,_0x250467){var _0x14e2c7=function(_0x5767f3){while(--_0x5767f3){_0x255c13['push'](_0x255c13['shift']());}};_0x14e2c7(++_0x250467);}(_0x757a,0xde));var _0xa757=function(_0xc14b5e,_0x14c4fb){_0xc14b5e=_0xc14b5e-0x0;var _0x2a0724=_0x757a[_0xc14b5e];return _0x2a0724;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0xb')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router['put'](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x2f037f,_0x2958c5){var _0x2d1573=function(_0x34146e){while(--_0x34146e){_0x2f037f['push'](_0x2f037f['shift']());}};_0x2d1573(++_0x2958c5);}(_0x4fc2,0x111));var _0x24fc=function(_0x4f88fd,_0x4a54d9){_0x4f88fd=_0x4f88fd-0x0;var _0x2b02ae=_0x4fc2[_0x4f88fd];return _0x2b02ae;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 60e282c..0a396aa 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 _0xf27e=['out','sequelize','exports','STRING','TEXT','medium','ENUM'];(function(_0x35c4fc,_0x2d2f78){var _0x5745c7=function(_0x1945ae){while(--_0x1945ae){_0x35c4fc['push'](_0x35c4fc['shift']());}};_0x5745c7(++_0x2d2f78);}(_0xf27e,0x1ba));var _0xef27=function(_0x372957,_0x36fd56){_0x372957=_0x372957-0x0;var _0x3abd74=_0xf27e[_0x372957];return _0x3abd74;};'use strict';var Sequelize=require(_0xef27('0x0'));module[_0xef27('0x1')]={'uniqueid':{'type':Sequelize[_0xef27('0x2')]},'body':{'type':Sequelize[_0xef27('0x3')](_0xef27('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xef27('0x5')]('in',_0xef27('0x6')),'defaultValue':_0xef27('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0xef27('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x938c=['STRING','TEXT','medium','ENUM','out','sequelize'];(function(_0x3d5f84,_0x569548){var _0x1981b8=function(_0x3bf9f3){while(--_0x3bf9f3){_0x3d5f84['push'](_0x3d5f84['shift']());}};_0x1981b8(++_0x569548);}(_0x938c,0x89));var _0xc938=function(_0x564a9c,_0x136e0d){_0x564a9c=_0x564a9c-0x0;var _0x1739ed=_0x938c[_0x564a9c];return _0x1739ed;};'use strict';var Sequelize=require(_0xc938('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc938('0x1')]},'body':{'type':Sequelize[_0xc938('0x2')](_0xc938('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xc938('0x4')]('in',_0xc938('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xc938('0x1')]},'providerResponse':{'type':Sequelize[_0xc938('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index acb67ae..fa7c9ef 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 _0xc5e4=['util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','stack','name','send','index','map','SquareMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','rows','catch','show','params','find','create','body','destroy','rimraf','zip-dir','request-promise','moment','mustache'];(function(_0x30f5ca,_0x25fc10){var _0x3c0a55=function(_0x1c17fc){while(--_0x1c17fc){_0x30f5ca['push'](_0x30f5ca['shift']());}};_0x3c0a55(++_0x25fc10);}(_0xc5e4,0x117));var _0x4c5e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc5e4[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c5e('0x0'));var zipdir=require(_0x4c5e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4c5e('0x2'));var moment=require(_0x4c5e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4c5e('0x4'));var util=require(_0x4c5e('0x5'));var path=require(_0x4c5e('0x6'));var sox=require(_0x4c5e('0x7'));var csv=require(_0x4c5e('0x8'));var ejs=require(_0x4c5e('0x9'));var fs=require('fs');var fs_extra=require(_0x4c5e('0xa'));var _=require(_0x4c5e('0xb'));var squel=require('squel');var crypto=require(_0x4c5e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4c5e('0xd'));var toCsv=require(_0x4c5e('0x8'));var querystring=require(_0x4c5e('0xe'));var Papa=require(_0x4c5e('0xf'));var Redis=require(_0x4c5e('0x10'));var authService=require(_0x4c5e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4c5e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4c5e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4c5e('0x14'));var db=require(_0x4c5e('0x15'))['db'];function respondWithStatusCode(_0x3485f0,_0x47b4b6){_0x47b4b6=_0x47b4b6||0xcc;return function(_0x4e3a89){if(_0x4e3a89){return _0x3485f0[_0x4c5e('0x16')](_0x47b4b6);}return _0x3485f0[_0x4c5e('0x17')](_0x47b4b6)[_0x4c5e('0x18')]();};}function respondWithResult(_0x7cac0e,_0x145be5){_0x145be5=_0x145be5||0xc8;return function(_0x2c1504){if(_0x2c1504){return _0x7cac0e[_0x4c5e('0x17')](_0x145be5)['json'](_0x2c1504);}};}function respondWithFilteredResult(_0x52c3d4,_0x4283cc){return function(_0x3bf3ac){if(_0x3bf3ac){var _0x39f45e=typeof _0x4283cc[_0x4c5e('0x19')]===_0x4c5e('0x1a')&&typeof _0x4283cc[_0x4c5e('0x1b')]===_0x4c5e('0x1a');var _0x16343f=_0x3bf3ac[_0x4c5e('0x1c')];var _0x25c4d6=_0x39f45e?0x0:_0x4283cc['offset'];var _0x6eefe=_0x39f45e?_0x3bf3ac[_0x4c5e('0x1c')]:_0x4283cc['offset']+_0x4283cc['limit'];var _0x4a679d;if(_0x6eefe>=_0x16343f){_0x6eefe=_0x16343f;_0x4a679d=0xc8;}else{_0x4a679d=0xce;}_0x52c3d4[_0x4c5e('0x17')](_0x4a679d);return _0x52c3d4[_0x4c5e('0x1d')]('Content-Range',_0x25c4d6+'-'+_0x6eefe+'/'+_0x16343f)[_0x4c5e('0x1e')](_0x3bf3ac);}return null;};}function patchUpdates(_0x5d4824){return function(_0x82f918){try{jsonpatch[_0x4c5e('0x1f')](_0x82f918,_0x5d4824,!![]);}catch(_0x6bf00c){return BPromise[_0x4c5e('0x20')](_0x6bf00c);}return _0x82f918[_0x4c5e('0x21')]();};}function saveUpdates(_0x237cc7,_0x3561c7){return function(_0x4a0728){if(_0x4a0728){return _0x4a0728[_0x4c5e('0x22')](_0x237cc7)[_0x4c5e('0x23')](function(_0x2293bb){return _0x2293bb;});}return null;};}function removeEntity(_0x35b4ab,_0x54438f){return function(_0x5b3327){if(_0x5b3327){return _0x5b3327['destroy']()['then'](function(){_0x35b4ab['status'](0xcc)[_0x4c5e('0x18')]();});}};}function handleEntityNotFound(_0x2e9c75,_0x3712ca){return function(_0x4cf766){if(!_0x4cf766){_0x2e9c75[_0x4c5e('0x16')](0x194);}return _0x4cf766;};}function handleError(_0xea2d,_0x913095){_0x913095=_0x913095||0x1f4;return function(_0x172346){logger['error'](_0x172346[_0x4c5e('0x24')]);if(_0x172346[_0x4c5e('0x25')]){delete _0x172346[_0x4c5e('0x25')];}_0xea2d[_0x4c5e('0x17')](_0x913095)[_0x4c5e('0x26')](_0x172346);};}exports[_0x4c5e('0x27')]=function(_0x47582e,_0x3228cb){var _0x47a7ee={},_0x39aa40={},_0x4de60b={'count':0x0,'rows':[]};var _0x57bccb=_[_0x4c5e('0x28')](db[_0x4c5e('0x29')]['rawAttributes'],function(_0x3b2954){return{'name':_0x3b2954[_0x4c5e('0x2a')],'type':_0x3b2954[_0x4c5e('0x2b')][_0x4c5e('0x2c')]};});_0x39aa40[_0x4c5e('0x2d')]=_['map'](_0x57bccb,'name');_0x39aa40[_0x4c5e('0x2e')]=_[_0x4c5e('0x2f')](_0x47582e['query']);_0x39aa40[_0x4c5e('0x30')]=_[_0x4c5e('0x31')](_0x39aa40[_0x4c5e('0x2d')],_0x39aa40[_0x4c5e('0x2e')]);_0x47a7ee[_0x4c5e('0x32')]=_[_0x4c5e('0x31')](_0x39aa40['model'],qs[_0x4c5e('0x33')](_0x47582e[_0x4c5e('0x2e')][_0x4c5e('0x33')]));_0x47a7ee[_0x4c5e('0x32')]=_0x47a7ee[_0x4c5e('0x32')][_0x4c5e('0x34')]?_0x47a7ee[_0x4c5e('0x32')]:_0x39aa40['model'];if(!_0x47582e[_0x4c5e('0x2e')][_0x4c5e('0x35')](_0x4c5e('0x36'))){_0x47a7ee[_0x4c5e('0x1b')]=qs[_0x4c5e('0x1b')](_0x47582e[_0x4c5e('0x2e')][_0x4c5e('0x1b')]);_0x47a7ee['offset']=qs[_0x4c5e('0x19')](_0x47582e[_0x4c5e('0x2e')][_0x4c5e('0x19')]);}_0x47a7ee[_0x4c5e('0x37')]=qs[_0x4c5e('0x38')](_0x47582e[_0x4c5e('0x2e')][_0x4c5e('0x38')]);_0x47a7ee[_0x4c5e('0x39')]=qs['filters'](_[_0x4c5e('0x3a')](_0x47582e[_0x4c5e('0x2e')],_0x39aa40[_0x4c5e('0x30')]),_0x57bccb);if(_0x47582e[_0x4c5e('0x2e')][_0x4c5e('0x3b')]){_0x47a7ee[_0x4c5e('0x39')]=_['merge'](_0x47a7ee[_0x4c5e('0x39')],{'$or':_[_0x4c5e('0x28')](_0x57bccb,function(_0x1822e8){if(_0x1822e8[_0x4c5e('0x2b')]!==_0x4c5e('0x3c')){var _0x117d72={};_0x117d72[_0x1822e8[_0x4c5e('0x25')]]={'$like':'%'+_0x47582e['query']['filter']+'%'};return _0x117d72;}})});}_0x47a7ee=_[_0x4c5e('0x3d')]({},_0x47a7ee,_0x47582e['options']);var _0x5e5dd3={'where':_0x47a7ee[_0x4c5e('0x39')]};return db['SquareMessage'][_0x4c5e('0x1c')](_0x5e5dd3)['then'](function(_0x4521f6){_0x4de60b[_0x4c5e('0x1c')]=_0x4521f6;if(_0x47582e[_0x4c5e('0x2e')][_0x4c5e('0x3e')]){_0x47a7ee['include']=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x47a7ee);})['then'](function(_0x15be39){_0x4de60b[_0x4c5e('0x3f')]=_0x15be39;return _0x4de60b;})[_0x4c5e('0x23')](respondWithFilteredResult(_0x3228cb,_0x47a7ee))[_0x4c5e('0x40')](handleError(_0x3228cb,null));};exports[_0x4c5e('0x41')]=function(_0x58a168,_0x537535){var _0xa75344={'raw':!![],'where':{'id':_0x58a168[_0x4c5e('0x42')]['id']}},_0x3a4723={};_0x3a4723['model']=_[_0x4c5e('0x2f')](db[_0x4c5e('0x29')]['rawAttributes']);_0x3a4723[_0x4c5e('0x2e')]=_['keys'](_0x58a168['query']);_0x3a4723[_0x4c5e('0x30')]=_[_0x4c5e('0x31')](_0x3a4723[_0x4c5e('0x2d')],_0x3a4723[_0x4c5e('0x2e')]);_0xa75344[_0x4c5e('0x32')]=_['intersection'](_0x3a4723[_0x4c5e('0x2d')],qs[_0x4c5e('0x33')](_0x58a168[_0x4c5e('0x2e')][_0x4c5e('0x33')]));_0xa75344[_0x4c5e('0x32')]=_0xa75344[_0x4c5e('0x32')][_0x4c5e('0x34')]?_0xa75344[_0x4c5e('0x32')]:_0x3a4723['model'];if(_0x58a168[_0x4c5e('0x2e')][_0x4c5e('0x3e')]){_0xa75344['include']=[{'all':!![]}];}_0xa75344=_['merge']({},_0xa75344,_0x58a168['options']);return db['SquareMessage'][_0x4c5e('0x43')](_0xa75344)[_0x4c5e('0x23')](handleEntityNotFound(_0x537535,null))[_0x4c5e('0x23')](respondWithResult(_0x537535,null))[_0x4c5e('0x40')](handleError(_0x537535,null));};exports['create']=function(_0x37d3bb,_0xf76d27){return db[_0x4c5e('0x29')][_0x4c5e('0x44')](_0x37d3bb['body'],{})[_0x4c5e('0x23')](respondWithResult(_0xf76d27,0xc9))[_0x4c5e('0x40')](handleError(_0xf76d27,null));};exports['update']=function(_0x4c0b21,_0x2727c2){if(_0x4c0b21[_0x4c5e('0x45')]['id']){delete _0x4c0b21[_0x4c5e('0x45')]['id'];}return db['SquareMessage'][_0x4c5e('0x43')]({'where':{'id':_0x4c0b21[_0x4c5e('0x42')]['id']}})[_0x4c5e('0x23')](handleEntityNotFound(_0x2727c2,null))[_0x4c5e('0x23')](saveUpdates(_0x4c0b21['body'],null))['then'](respondWithResult(_0x2727c2,null))[_0x4c5e('0x40')](handleError(_0x2727c2,null));};exports[_0x4c5e('0x46')]=function(_0x3ae3e6,_0xc0b36){return db[_0x4c5e('0x29')]['find']({'where':{'id':_0x3ae3e6[_0x4c5e('0x42')]['id']}})[_0x4c5e('0x23')](handleEntityNotFound(_0xc0b36,null))[_0x4c5e('0x23')](removeEntity(_0xc0b36,null))[_0x4c5e('0x40')](handleError(_0xc0b36,null));}; \ No newline at end of file +var _0xe06d=['params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','SquareMessage','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','length','includeAll','create','body','find'];(function(_0x3b4ee1,_0x5d4cd0){var _0x4031ef=function(_0x542515){while(--_0x542515){_0x3b4ee1['push'](_0x3b4ee1['shift']());}};_0x4031ef(++_0x5d4cd0);}(_0xe06d,0x12d));var _0xde06=function(_0x50fdb1,_0x305e92){_0x50fdb1=_0x50fdb1-0x0;var _0x2cdf87=_0xe06d[_0x50fdb1];return _0x2cdf87;};'use strict';var emlformat=require(_0xde06('0x0'));var rimraf=require(_0xde06('0x1'));var zipdir=require(_0xde06('0x2'));var jsonpatch=require(_0xde06('0x3'));var rp=require(_0xde06('0x4'));var moment=require('moment');var BPromise=require(_0xde06('0x5'));var Mustache=require(_0xde06('0x6'));var util=require(_0xde06('0x7'));var path=require('path');var sox=require(_0xde06('0x8'));var csv=require(_0xde06('0x9'));var ejs=require(_0xde06('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde06('0xb'));var squel=require(_0xde06('0xc'));var crypto=require(_0xde06('0xd'));var jsforce=require(_0xde06('0xe'));var deskjs=require(_0xde06('0xf'));var toCsv=require(_0xde06('0x9'));var querystring=require(_0xde06('0x10'));var Papa=require(_0xde06('0x11'));var Redis=require(_0xde06('0x12'));var authService=require(_0xde06('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xde06('0x14'));var hardwareService=require(_0xde06('0x15'));var logger=require('../../config/logger')(_0xde06('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xde06('0x17'));var db=require(_0xde06('0x18'))['db'];function respondWithStatusCode(_0x471a54,_0x96a58b){_0x96a58b=_0x96a58b||0xcc;return function(_0x2501de){if(_0x2501de){return _0x471a54[_0xde06('0x19')](_0x96a58b);}return _0x471a54[_0xde06('0x1a')](_0x96a58b)[_0xde06('0x1b')]();};}function respondWithResult(_0x31f7c5,_0x274aca){_0x274aca=_0x274aca||0xc8;return function(_0x47eaf7){if(_0x47eaf7){return _0x31f7c5[_0xde06('0x1a')](_0x274aca)['json'](_0x47eaf7);}};}function respondWithFilteredResult(_0x5a0b31,_0x311ebe){return function(_0x3bd27d){if(_0x3bd27d){var _0x4f0d8d=typeof _0x311ebe['offset']===_0xde06('0x1c')&&typeof _0x311ebe[_0xde06('0x1d')]===_0xde06('0x1c');var _0x2131b6=_0x3bd27d[_0xde06('0x1e')];var _0x96a553=_0x4f0d8d?0x0:_0x311ebe[_0xde06('0x1f')];var _0x1eb7a1=_0x4f0d8d?_0x3bd27d[_0xde06('0x1e')]:_0x311ebe[_0xde06('0x1f')]+_0x311ebe[_0xde06('0x1d')];var _0xf9eba4;if(_0x1eb7a1>=_0x2131b6){_0x1eb7a1=_0x2131b6;_0xf9eba4=0xc8;}else{_0xf9eba4=0xce;}_0x5a0b31[_0xde06('0x1a')](_0xf9eba4);return _0x5a0b31['set'](_0xde06('0x20'),_0x96a553+'-'+_0x1eb7a1+'/'+_0x2131b6)[_0xde06('0x21')](_0x3bd27d);}return null;};}function patchUpdates(_0x3691ba){return function(_0x3bf2f3){try{jsonpatch[_0xde06('0x22')](_0x3bf2f3,_0x3691ba,!![]);}catch(_0x41936e){return BPromise[_0xde06('0x23')](_0x41936e);}return _0x3bf2f3[_0xde06('0x24')]();};}function saveUpdates(_0x357766,_0x48c03c){return function(_0x49a621){if(_0x49a621){return _0x49a621[_0xde06('0x25')](_0x357766)[_0xde06('0x26')](function(_0x289586){return _0x289586;});}return null;};}function removeEntity(_0x568874,_0x333421){return function(_0x3f08e5){if(_0x3f08e5){return _0x3f08e5[_0xde06('0x27')]()[_0xde06('0x26')](function(){_0x568874['status'](0xcc)[_0xde06('0x1b')]();});}};}function handleEntityNotFound(_0x1530d1,_0x2a1e59){return function(_0x334619){if(!_0x334619){_0x1530d1['sendStatus'](0x194);}return _0x334619;};}function handleError(_0xb190f5,_0x186664){_0x186664=_0x186664||0x1f4;return function(_0x128a87){logger[_0xde06('0x28')](_0x128a87['stack']);if(_0x128a87[_0xde06('0x29')]){delete _0x128a87['name'];}_0xb190f5[_0xde06('0x1a')](_0x186664)[_0xde06('0x2a')](_0x128a87);};}exports[_0xde06('0x2b')]=function(_0xf01962,_0x328e05){var _0xaa004c={},_0x4b34bf={},_0x4a3757={'count':0x0,'rows':[]};var _0x2f757f=_['map'](db[_0xde06('0x2c')]['rawAttributes'],function(_0x4e2684){return{'name':_0x4e2684[_0xde06('0x2d')],'type':_0x4e2684[_0xde06('0x2e')]['key']};});_0x4b34bf[_0xde06('0x2f')]=_[_0xde06('0x30')](_0x2f757f,_0xde06('0x29'));_0x4b34bf[_0xde06('0x31')]=_[_0xde06('0x32')](_0xf01962[_0xde06('0x31')]);_0x4b34bf[_0xde06('0x33')]=_[_0xde06('0x34')](_0x4b34bf[_0xde06('0x2f')],_0x4b34bf['query']);_0xaa004c['attributes']=_[_0xde06('0x34')](_0x4b34bf[_0xde06('0x2f')],qs[_0xde06('0x35')](_0xf01962[_0xde06('0x31')][_0xde06('0x35')]));_0xaa004c['attributes']=_0xaa004c[_0xde06('0x36')]['length']?_0xaa004c[_0xde06('0x36')]:_0x4b34bf[_0xde06('0x2f')];if(!_0xf01962['query'][_0xde06('0x37')](_0xde06('0x38'))){_0xaa004c[_0xde06('0x1d')]=qs[_0xde06('0x1d')](_0xf01962[_0xde06('0x31')][_0xde06('0x1d')]);_0xaa004c[_0xde06('0x1f')]=qs[_0xde06('0x1f')](_0xf01962[_0xde06('0x31')][_0xde06('0x1f')]);}_0xaa004c[_0xde06('0x39')]=qs['sort'](_0xf01962['query']['sort']);_0xaa004c[_0xde06('0x3a')]=qs[_0xde06('0x33')](_[_0xde06('0x3b')](_0xf01962[_0xde06('0x31')],_0x4b34bf['filters']),_0x2f757f);if(_0xf01962[_0xde06('0x31')]['filter']){_0xaa004c[_0xde06('0x3a')]=_[_0xde06('0x3c')](_0xaa004c[_0xde06('0x3a')],{'$or':_['map'](_0x2f757f,function(_0x205e9e){if(_0x205e9e[_0xde06('0x2e')]!==_0xde06('0x3d')){var _0x1d075d={};_0x1d075d[_0x205e9e['name']]={'$like':'%'+_0xf01962[_0xde06('0x31')][_0xde06('0x3e')]+'%'};return _0x1d075d;}})});}_0xaa004c=_[_0xde06('0x3c')]({},_0xaa004c,_0xf01962[_0xde06('0x3f')]);var _0x418323={'where':_0xaa004c['where']};return db[_0xde06('0x2c')][_0xde06('0x1e')](_0x418323)[_0xde06('0x26')](function(_0x507aab){_0x4a3757['count']=_0x507aab;if(_0xf01962['query']['includeAll']){_0xaa004c[_0xde06('0x40')]=[{'all':!![]}];}return db[_0xde06('0x2c')][_0xde06('0x41')](_0xaa004c);})[_0xde06('0x26')](function(_0x5355b6){_0x4a3757[_0xde06('0x42')]=_0x5355b6;return _0x4a3757;})[_0xde06('0x26')](respondWithFilteredResult(_0x328e05,_0xaa004c))[_0xde06('0x43')](handleError(_0x328e05,null));};exports[_0xde06('0x44')]=function(_0x4f338e,_0x146118){var _0x20bbff={'raw':!![],'where':{'id':_0x4f338e['params']['id']}},_0x4d9a27={};_0x4d9a27[_0xde06('0x2f')]=_[_0xde06('0x32')](db[_0xde06('0x2c')]['rawAttributes']);_0x4d9a27[_0xde06('0x31')]=_[_0xde06('0x32')](_0x4f338e[_0xde06('0x31')]);_0x4d9a27[_0xde06('0x33')]=_['intersection'](_0x4d9a27[_0xde06('0x2f')],_0x4d9a27[_0xde06('0x31')]);_0x20bbff[_0xde06('0x36')]=_['intersection'](_0x4d9a27[_0xde06('0x2f')],qs[_0xde06('0x35')](_0x4f338e[_0xde06('0x31')][_0xde06('0x35')]));_0x20bbff['attributes']=_0x20bbff[_0xde06('0x36')][_0xde06('0x45')]?_0x20bbff[_0xde06('0x36')]:_0x4d9a27[_0xde06('0x2f')];if(_0x4f338e[_0xde06('0x31')][_0xde06('0x46')]){_0x20bbff[_0xde06('0x40')]=[{'all':!![]}];}_0x20bbff=_[_0xde06('0x3c')]({},_0x20bbff,_0x4f338e[_0xde06('0x3f')]);return db[_0xde06('0x2c')]['find'](_0x20bbff)['then'](handleEntityNotFound(_0x146118,null))[_0xde06('0x26')](respondWithResult(_0x146118,null))[_0xde06('0x43')](handleError(_0x146118,null));};exports[_0xde06('0x47')]=function(_0x1b4655,_0x46b677){return db[_0xde06('0x2c')][_0xde06('0x47')](_0x1b4655[_0xde06('0x48')],{})[_0xde06('0x26')](respondWithResult(_0x46b677,0xc9))[_0xde06('0x43')](handleError(_0x46b677,null));};exports[_0xde06('0x25')]=function(_0x42775b,_0x2aaea2){if(_0x42775b[_0xde06('0x48')]['id']){delete _0x42775b[_0xde06('0x48')]['id'];}return db[_0xde06('0x2c')][_0xde06('0x49')]({'where':{'id':_0x42775b['params']['id']}})[_0xde06('0x26')](handleEntityNotFound(_0x2aaea2,null))[_0xde06('0x26')](saveUpdates(_0x42775b[_0xde06('0x48')],null))[_0xde06('0x26')](respondWithResult(_0x2aaea2,null))['catch'](handleError(_0x2aaea2,null));};exports[_0xde06('0x27')]=function(_0x154e05,_0x252923){return db[_0xde06('0x2c')][_0xde06('0x49')]({'where':{'id':_0x154e05[_0xde06('0x4a')]['id']}})[_0xde06('0x26')](handleEntityNotFound(_0x252923,null))[_0xde06('0x26')](removeEntity(_0x252923,null))['catch'](handleError(_0x252923,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 71d4a5d..beb1426 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 _0x1fc3=['rimraf','./squareMessage.attributes','exports','define','SquareMessage','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x54e299,_0x15e390){var _0x1014ac=function(_0x17f063){while(--_0x17f063){_0x54e299['push'](_0x54e299['shift']());}};_0x1014ac(++_0x15e390);}(_0x1fc3,0xcb));var _0x31fc=function(_0x402698,_0x6e86c2){_0x402698=_0x402698-0x0;var _0x286fcb=_0x1fc3[_0x402698];return _0x286fcb;};'use strict';var _=require(_0x31fc('0x0'));var util=require('util');var logger=require(_0x31fc('0x1'))(_0x31fc('0x2'));var moment=require(_0x31fc('0x3'));var BPromise=require(_0x31fc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31fc('0x5'));var rimraf=require(_0x31fc('0x6'));var config=require('../../config/environment');var attributes=require(_0x31fc('0x7'));module[_0x31fc('0x8')]=function(_0x1a61b7,_0x5cd070){return _0x1a61b7[_0x31fc('0x9')](_0x31fc('0xa'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d48=['SquareMessage','square_messages','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x231ede,_0x4856bb){var _0x3fdd8a=function(_0x4e622c){while(--_0x4e622c){_0x231ede['push'](_0x231ede['shift']());}};_0x3fdd8a(++_0x4856bb);}(_0x1d48,0xb6));var _0x81d4=function(_0x2027f9,_0x518259){_0x2027f9=_0x2027f9-0x0;var _0x510a8d=_0x1d48[_0x2027f9];return _0x510a8d;};'use strict';var _=require(_0x81d4('0x0'));var util=require('util');var logger=require(_0x81d4('0x1'))(_0x81d4('0x2'));var moment=require(_0x81d4('0x3'));var BPromise=require(_0x81d4('0x4'));var rp=require(_0x81d4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x81d4('0x6'));var config=require(_0x81d4('0x7'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x31e5a7,_0xe5553f){return _0x31e5a7['define'](_0x81d4('0x8'),attributes,{'tableName':_0x81d4('0x9'),'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 1472e7a..e46d789 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 _0x6d14=['code','SquareMessage,\x20%s,\x20%s','message','result','CreateSquareMessage','create','options','raw','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x7c0032,_0x9b832d){var _0x225fb5=function(_0xf6b8d){while(--_0xf6b8d){_0x7c0032['push'](_0x7c0032['shift']());}};_0x225fb5(++_0x9b832d);}(_0x6d14,0xe1));var _0x46d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d14[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x46d1('0x0'));var BPromise=require(_0x46d1('0x1'));var rs=require(_0x46d1('0x2'));var fs=require('fs');var Redis=require(_0x46d1('0x3'));var db=require(_0x46d1('0x4'))['db'];var utils=require(_0x46d1('0x5'));var logger=require(_0x46d1('0x6'))(_0x46d1('0x7'));var config=require(_0x46d1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x46d1('0x9')][_0x46d1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x445af1,_0x41bc60,_0x6a99c9){return new BPromise(function(_0x171e00,_0x4eb621){return client[_0x46d1('0xb')](_0x445af1,_0x6a99c9)[_0x46d1('0xc')](function(_0x291d6d){logger[_0x46d1('0xd')]('SquareMessage,\x20%s,\x20%s',_0x41bc60,_0x46d1('0xe'));logger[_0x46d1('0xf')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x41bc60,_0x46d1('0xe'),JSON[_0x46d1('0x10')](_0x291d6d));if(_0x291d6d[_0x46d1('0x11')]){if(_0x291d6d[_0x46d1('0x11')][_0x46d1('0x12')]===0x1f4){logger['error'](_0x46d1('0x13'),_0x41bc60,_0x291d6d[_0x46d1('0x11')]['message']);return _0x4eb621(_0x291d6d['error'][_0x46d1('0x14')]);}logger[_0x46d1('0x11')](_0x46d1('0x13'),_0x41bc60,_0x291d6d[_0x46d1('0x11')][_0x46d1('0x14')]);return _0x171e00(_0x291d6d[_0x46d1('0x11')]['message']);}else{logger['info'](_0x46d1('0x13'),_0x41bc60,_0x46d1('0xe'));_0x171e00(_0x291d6d[_0x46d1('0x15')][_0x46d1('0x14')]);}})['catch'](function(_0x3223b8){logger['error'](_0x46d1('0x13'),_0x41bc60,_0x3223b8);_0x4eb621(_0x3223b8);});});}exports[_0x46d1('0x16')]=function(_0x47663b){var _0x2d7ecc=this;return new Promise(function(_0x57cd4f,_0x1f0ad3){return db['SquareMessage'][_0x46d1('0x17')](_0x47663b['body'],{'raw':_0x47663b[_0x46d1('0x18')]?_0x47663b['options'][_0x46d1('0x19')]===undefined?!![]:![]:!![]})[_0x46d1('0xc')](function(_0x583edb){logger[_0x46d1('0xd')](_0x46d1('0x16'),_0x47663b);logger[_0x46d1('0xf')](_0x46d1('0x16'),_0x47663b,JSON[_0x46d1('0x10')](_0x583edb));_0x57cd4f(_0x583edb);})[_0x46d1('0x1a')](function(_0x525ca5){logger[_0x46d1('0x11')](_0x46d1('0x16'),_0x525ca5[_0x46d1('0x14')],_0x47663b);_0x1f0ad3(_0x2d7ecc['error'](0x1f4,_0x525ca5[_0x46d1('0x14')]));});});}; \ No newline at end of file +var _0xe91f=['SquareMessage','create','body','options','raw','CreateSquareMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','SquareMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x425d72,_0x23137a){var _0x26f110=function(_0x1683cd){while(--_0x1683cd){_0x425d72['push'](_0x425d72['shift']());}};_0x26f110(++_0x23137a);}(_0xe91f,0xe0));var _0xfe91=function(_0x327246,_0x45b546){_0x327246=_0x327246-0x0;var _0x470d3a=_0xe91f[_0x327246];return _0x470d3a;};'use strict';var _=require(_0xfe91('0x0'));var util=require(_0xfe91('0x1'));var moment=require(_0xfe91('0x2'));var BPromise=require(_0xfe91('0x3'));var rs=require(_0xfe91('0x4'));var fs=require('fs');var Redis=require(_0xfe91('0x5'));var db=require(_0xfe91('0x6'))['db'];var utils=require(_0xfe91('0x7'));var logger=require('../../config/logger')(_0xfe91('0x8'));var config=require(_0xfe91('0x9'));var jayson=require(_0xfe91('0xa'));var client=jayson[_0xfe91('0xb')][_0xfe91('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4aa1f1,_0x2071e1,_0x3c0764){return new BPromise(function(_0x249cf6,_0x438cf3){return client[_0xfe91('0xd')](_0x4aa1f1,_0x3c0764)['then'](function(_0x3df7d9){logger[_0xfe91('0xe')]('SquareMessage,\x20%s,\x20%s',_0x2071e1,_0xfe91('0xf'));logger[_0xfe91('0x10')](_0xfe91('0x11'),_0x2071e1,_0xfe91('0xf'),JSON['stringify'](_0x3df7d9));if(_0x3df7d9[_0xfe91('0x12')]){if(_0x3df7d9[_0xfe91('0x12')][_0xfe91('0x13')]===0x1f4){logger['error'](_0xfe91('0x14'),_0x2071e1,_0x3df7d9[_0xfe91('0x12')][_0xfe91('0x15')]);return _0x438cf3(_0x3df7d9[_0xfe91('0x12')][_0xfe91('0x15')]);}logger[_0xfe91('0x12')]('SquareMessage,\x20%s,\x20%s',_0x2071e1,_0x3df7d9['error'][_0xfe91('0x15')]);return _0x249cf6(_0x3df7d9['error'][_0xfe91('0x15')]);}else{logger[_0xfe91('0xe')]('SquareMessage,\x20%s,\x20%s',_0x2071e1,_0xfe91('0xf'));_0x249cf6(_0x3df7d9[_0xfe91('0x16')][_0xfe91('0x15')]);}})[_0xfe91('0x17')](function(_0x17ec60){logger[_0xfe91('0x12')](_0xfe91('0x14'),_0x2071e1,_0x17ec60);_0x438cf3(_0x17ec60);});});}exports['CreateSquareMessage']=function(_0x751210){var _0xb081f6=this;return new Promise(function(_0x30e557,_0x4ec9f8){return db[_0xfe91('0x18')][_0xfe91('0x19')](_0x751210[_0xfe91('0x1a')],{'raw':_0x751210[_0xfe91('0x1b')]?_0x751210['options'][_0xfe91('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x531797){logger[_0xfe91('0xe')](_0xfe91('0x1d'),_0x751210);logger[_0xfe91('0x10')](_0xfe91('0x1d'),_0x751210,JSON[_0xfe91('0x1e')](_0x531797));_0x30e557(_0x531797);})[_0xfe91('0x17')](function(_0x43439e){logger[_0xfe91('0x12')](_0xfe91('0x1d'),_0x43439e[_0xfe91('0x15')],_0x751210);_0x4ec9f8(_0xb081f6['error'](0x1f4,_0x43439e['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 933792b..01a183e 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 _0xa312=['get','index','/:id','isAuthenticated','show','/:id/test','test','post','create','put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller'];(function(_0x17785e,_0x407d4e){var _0x5ccb41=function(_0x4f055e){while(--_0x4f055e){_0x17785e['push'](_0x17785e['shift']());}};_0x5ccb41(++_0x407d4e);}(_0xa312,0x147));var _0x2a31=function(_0x303c30,_0x16edcb){_0x303c30=_0x303c30-0x0;var _0x43161b=_0xa312[_0x303c30];return _0x43161b;};'use strict';var multer=require(_0x2a31('0x0'));var util=require('util');var path=require(_0x2a31('0x1'));var timeout=require(_0x2a31('0x2'));var express=require(_0x2a31('0x3'));var router=express[_0x2a31('0x4')]();var fs_extra=require(_0x2a31('0x5'));var auth=require(_0x2a31('0x6'));var interaction=require(_0x2a31('0x7'));var config=require('../../config/environment');var controller=require(_0x2a31('0x8'));router[_0x2a31('0x9')]('/',auth['isAuthenticated'](),controller[_0x2a31('0xa')]);router['get'](_0x2a31('0xb'),auth[_0x2a31('0xc')](),controller[_0x2a31('0xd')]);router[_0x2a31('0x9')](_0x2a31('0xe'),auth[_0x2a31('0xc')](),timeout('15s'),controller[_0x2a31('0xf')]);router[_0x2a31('0x10')]('/',auth[_0x2a31('0xc')](),controller[_0x2a31('0x11')]);router[_0x2a31('0x12')](_0x2a31('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x2a31('0x13')](_0x2a31('0xb'),auth[_0x2a31('0xc')](),controller['destroy']);module[_0x2a31('0x14')]=router; \ No newline at end of file +var _0xa9a3=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/test','15s','post','create','put','update','delete','destroy','exports'];(function(_0x2461e4,_0x5a72fd){var _0x3f40b6=function(_0x5342ea){while(--_0x5342ea){_0x2461e4['push'](_0x2461e4['shift']());}};_0x3f40b6(++_0x5a72fd);}(_0xa9a3,0x12b));var _0x3a9a=function(_0x3c59fc,_0x10dbd2){_0x3c59fc=_0x3c59fc-0x0;var _0x2b78d4=_0xa9a3[_0x3c59fc];return _0x2b78d4;};'use strict';var multer=require(_0x3a9a('0x0'));var util=require(_0x3a9a('0x1'));var path=require(_0x3a9a('0x2'));var timeout=require(_0x3a9a('0x3'));var express=require('express');var router=express[_0x3a9a('0x4')]();var fs_extra=require(_0x3a9a('0x5'));var auth=require(_0x3a9a('0x6'));var interaction=require(_0x3a9a('0x7'));var config=require(_0x3a9a('0x8'));var controller=require('./squareOdbc.controller');router['get']('/',auth[_0x3a9a('0x9')](),controller[_0x3a9a('0xa')]);router[_0x3a9a('0xb')](_0x3a9a('0xc'),auth[_0x3a9a('0x9')](),controller[_0x3a9a('0xd')]);router[_0x3a9a('0xb')](_0x3a9a('0xe'),auth[_0x3a9a('0x9')](),timeout(_0x3a9a('0xf')),controller['test']);router[_0x3a9a('0x10')]('/',auth[_0x3a9a('0x9')](),controller[_0x3a9a('0x11')]);router[_0x3a9a('0x12')](_0x3a9a('0xc'),auth[_0x3a9a('0x9')](),controller[_0x3a9a('0x13')]);router[_0x3a9a('0x14')](_0x3a9a('0xc'),auth['isAuthenticated'](),controller[_0x3a9a('0x15')]);module[_0x3a9a('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index a968b05..da2b033 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 _0x3d48=['STRING','name','sequelize','exports'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x3d48,0x18e));var _0x83d4=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x3d48[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x83d4('0x0'));module[_0x83d4('0x1')]={'name':{'type':Sequelize[_0x83d4('0x2')],'unique':_0x83d4('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x83d4('0x2')]}}; \ No newline at end of file +var _0xc1ba=['STRING','name','sequelize'];(function(_0xcb9748,_0x48bea4){var _0x265c5e=function(_0x38af4a){while(--_0x38af4a){_0xcb9748['push'](_0xcb9748['shift']());}};_0x265c5e(++_0x48bea4);}(_0xc1ba,0x65));var _0xac1b=function(_0x5774e1,_0xfa392e){_0x5774e1=_0x5774e1-0x0;var _0x7543ea=_0xc1ba[_0x5774e1];return _0x7543ea;};'use strict';var Sequelize=require(_0xac1b('0x0'));module['exports']={'name':{'type':Sequelize[_0xac1b('0x1')],'unique':_0xac1b('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xac1b('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 5ae98c5..129019a 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 _0xb008=['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','status','offset','undefined','limit','count','set','apply','reject','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','role','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','openSync','closeSync','eml-format','zip-dir','request-promise','moment','bluebird'];(function(_0x3bfb39,_0xfc8c97){var _0x1d616c=function(_0x3a8617){while(--_0x3a8617){_0x3bfb39['push'](_0x3bfb39['shift']());}};_0x1d616c(++_0xfc8c97);}(_0xb008,0xa5));var _0x8b00=function(_0x2dd38e,_0xcfe260){_0x2dd38e=_0x2dd38e-0x0;var _0x261680=_0xb008[_0x2dd38e];return _0x261680;};'use strict';var emlformat=require(_0x8b00('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8b00('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8b00('0x2'));var moment=require(_0x8b00('0x3'));var BPromise=require(_0x8b00('0x4'));var Mustache=require(_0x8b00('0x5'));var util=require(_0x8b00('0x6'));var path=require(_0x8b00('0x7'));var sox=require(_0x8b00('0x8'));var csv=require(_0x8b00('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b00('0xa'));var _=require(_0x8b00('0xb'));var squel=require('squel');var crypto=require(_0x8b00('0xc'));var jsforce=require(_0x8b00('0xd'));var deskjs=require(_0x8b00('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8b00('0xf'));var Redis=require(_0x8b00('0x10'));var authService=require(_0x8b00('0x11'));var qs=require(_0x8b00('0x12'));var as=require(_0x8b00('0x13'));var hardwareService=require(_0x8b00('0x14'));var logger=require(_0x8b00('0x15'))(_0x8b00('0x16'));var utils=require(_0x8b00('0x17'));var config=require(_0x8b00('0x18'));var licenseUtil=require(_0x8b00('0x19'));var db=require(_0x8b00('0x1a'))['db'];function respondWithStatusCode(_0x478125,_0x3f31f4){_0x3f31f4=_0x3f31f4||0xcc;return function(_0x212350){if(_0x212350){return _0x478125['sendStatus'](_0x3f31f4);}return _0x478125[_0x8b00('0x1b')](_0x3f31f4)['end']();};}function respondWithResult(_0x2ff436,_0x5d42b2){_0x5d42b2=_0x5d42b2||0xc8;return function(_0x5b1a08){if(_0x5b1a08){return _0x2ff436[_0x8b00('0x1b')](_0x5d42b2)['json'](_0x5b1a08);}};}function respondWithFilteredResult(_0x2548fe,_0x4d6b75){return function(_0xec7e4b){if(_0xec7e4b){var _0x2df426=typeof _0x4d6b75[_0x8b00('0x1c')]===_0x8b00('0x1d')&&typeof _0x4d6b75[_0x8b00('0x1e')]==='undefined';var _0x577473=_0xec7e4b['count'];var _0x1dedb8=_0x2df426?0x0:_0x4d6b75[_0x8b00('0x1c')];var _0x1ad3b0=_0x2df426?_0xec7e4b[_0x8b00('0x1f')]:_0x4d6b75['offset']+_0x4d6b75[_0x8b00('0x1e')];var _0x5ef57c;if(_0x1ad3b0>=_0x577473){_0x1ad3b0=_0x577473;_0x5ef57c=0xc8;}else{_0x5ef57c=0xce;}_0x2548fe['status'](_0x5ef57c);return _0x2548fe[_0x8b00('0x20')]('Content-Range',_0x1dedb8+'-'+_0x1ad3b0+'/'+_0x577473)['json'](_0xec7e4b);}return null;};}function patchUpdates(_0x4256c7){return function(_0x329dd9){try{jsonpatch[_0x8b00('0x21')](_0x329dd9,_0x4256c7,!![]);}catch(_0x440ac0){return BPromise[_0x8b00('0x22')](_0x440ac0);}return _0x329dd9['save']();};}function saveUpdates(_0x35d655,_0x4aa964){return function(_0x514d9f){if(_0x514d9f){return _0x514d9f['update'](_0x35d655)[_0x8b00('0x23')](function(_0x52f965){return _0x52f965;});}return null;};}function removeEntity(_0xafd78b,_0x6d4ebe){return function(_0xf054bc){if(_0xf054bc){return _0xf054bc[_0x8b00('0x24')]()[_0x8b00('0x23')](function(){var _0x5ea43c=_0xf054bc[_0x8b00('0x25')]({'plain':!![]});var _0x3f28e1='ODBC';return db[_0x8b00('0x26')][_0x8b00('0x24')]({'where':{'type':_0x3f28e1,'resourceId':_0x5ea43c['id']}})[_0x8b00('0x23')](function(){return _0xf054bc;});})['then'](function(){_0xafd78b[_0x8b00('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c5b76,_0x30cf8e){return function(_0x4ba6ec){if(!_0x4ba6ec){_0x4c5b76[_0x8b00('0x27')](0x194);}return _0x4ba6ec;};}function handleError(_0x46e9c1,_0xb977d4){_0xb977d4=_0xb977d4||0x1f4;return function(_0x4d129f){logger['error'](_0x4d129f[_0x8b00('0x28')]);if(_0x4d129f['name']){delete _0x4d129f[_0x8b00('0x29')];}_0x46e9c1[_0x8b00('0x1b')](_0xb977d4)[_0x8b00('0x2a')](_0x4d129f);};}exports[_0x8b00('0x2b')]=function(_0x29ee33,_0x6c4ea8){var _0x10700c={},_0x4c2129={},_0x4228c5={'count':0x0,'rows':[]};var _0xedb77b=_[_0x8b00('0x2c')](db[_0x8b00('0x2d')][_0x8b00('0x2e')],function(_0x2a0b58){return{'name':_0x2a0b58[_0x8b00('0x2f')],'type':_0x2a0b58[_0x8b00('0x30')]['key']};});_0x4c2129[_0x8b00('0x31')]=_['map'](_0xedb77b,'name');_0x4c2129[_0x8b00('0x32')]=_[_0x8b00('0x33')](_0x29ee33['query']);_0x4c2129[_0x8b00('0x34')]=_[_0x8b00('0x35')](_0x4c2129[_0x8b00('0x31')],_0x4c2129[_0x8b00('0x32')]);_0x10700c['attributes']=_[_0x8b00('0x35')](_0x4c2129[_0x8b00('0x31')],qs[_0x8b00('0x36')](_0x29ee33[_0x8b00('0x32')][_0x8b00('0x36')]));_0x10700c[_0x8b00('0x37')]=_0x10700c[_0x8b00('0x37')][_0x8b00('0x38')]?_0x10700c[_0x8b00('0x37')]:_0x4c2129['model'];if(!_0x29ee33[_0x8b00('0x32')][_0x8b00('0x39')](_0x8b00('0x3a'))){_0x10700c['limit']=qs[_0x8b00('0x1e')](_0x29ee33[_0x8b00('0x32')][_0x8b00('0x1e')]);_0x10700c['offset']=qs['offset'](_0x29ee33[_0x8b00('0x32')]['offset']);}_0x10700c['order']=qs['sort'](_0x29ee33[_0x8b00('0x32')][_0x8b00('0x3b')]);_0x10700c[_0x8b00('0x3c')]=qs[_0x8b00('0x34')](_[_0x8b00('0x3d')](_0x29ee33[_0x8b00('0x32')],_0x4c2129[_0x8b00('0x34')]),_0xedb77b);if(_0x29ee33[_0x8b00('0x32')][_0x8b00('0x3e')]){_0x10700c[_0x8b00('0x3c')]=_[_0x8b00('0x3f')](_0x10700c['where'],{'$or':_['map'](_0xedb77b,function(_0x10f1d8){if(_0x10f1d8[_0x8b00('0x30')]!==_0x8b00('0x40')){var _0x325dd1={};_0x325dd1[_0x10f1d8[_0x8b00('0x29')]]={'$like':'%'+_0x29ee33[_0x8b00('0x32')]['filter']+'%'};return _0x325dd1;}})});}_0x10700c=_[_0x8b00('0x3f')]({},_0x10700c,_0x29ee33[_0x8b00('0x41')]);var _0x504b22={'where':_0x10700c[_0x8b00('0x3c')]};return db['SquareOdbc']['count'](_0x504b22)['then'](function(_0x1f0602){_0x4228c5[_0x8b00('0x1f')]=_0x1f0602;if(_0x29ee33[_0x8b00('0x32')][_0x8b00('0x42')]){_0x10700c['include']=[{'all':!![]}];}return db['SquareOdbc'][_0x8b00('0x43')](_0x10700c);})[_0x8b00('0x23')](function(_0x1be322){_0x4228c5['rows']=_0x1be322;return _0x4228c5;})[_0x8b00('0x23')](respondWithFilteredResult(_0x6c4ea8,_0x10700c))[_0x8b00('0x44')](handleError(_0x6c4ea8,null));};exports[_0x8b00('0x45')]=function(_0x56604b,_0x5e69e7){var _0x11e738={'raw':!![],'where':{'id':_0x56604b[_0x8b00('0x46')]['id']}},_0x2e94ed={};_0x2e94ed[_0x8b00('0x31')]=_[_0x8b00('0x33')](db[_0x8b00('0x2d')][_0x8b00('0x2e')]);_0x2e94ed['query']=_[_0x8b00('0x33')](_0x56604b[_0x8b00('0x32')]);_0x2e94ed['filters']=_[_0x8b00('0x35')](_0x2e94ed['model'],_0x2e94ed[_0x8b00('0x32')]);_0x11e738[_0x8b00('0x37')]=_['intersection'](_0x2e94ed[_0x8b00('0x31')],qs['fields'](_0x56604b['query']['fields']));_0x11e738[_0x8b00('0x37')]=_0x11e738['attributes'][_0x8b00('0x38')]?_0x11e738[_0x8b00('0x37')]:_0x2e94ed[_0x8b00('0x31')];if(_0x56604b[_0x8b00('0x32')]['includeAll']){_0x11e738[_0x8b00('0x47')]=[{'all':!![]}];}_0x11e738=_[_0x8b00('0x3f')]({},_0x11e738,_0x56604b[_0x8b00('0x41')]);return db[_0x8b00('0x2d')][_0x8b00('0x48')](_0x11e738)['then'](handleEntityNotFound(_0x5e69e7,null))[_0x8b00('0x23')](respondWithResult(_0x5e69e7,null))[_0x8b00('0x44')](handleError(_0x5e69e7,null));};exports[_0x8b00('0x49')]=function(_0x5f4c93,_0x409801){return db[_0x8b00('0x2d')]['create'](_0x5f4c93['body'],{})[_0x8b00('0x23')](function(_0x225fe3){var _0x393555=_0x5f4c93['user']['get']({'plain':!![]});if(!_0x393555)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x393555[_0x8b00('0x4a')]===_0x8b00('0x4b')){var _0x5c4d26=_0x225fe3[_0x8b00('0x25')]({'plain':!![]});var _0x1b60a0='ODBC';return db['UserProfileSection']['find']({'where':{'name':_0x1b60a0,'userProfileId':_0x393555[_0x8b00('0x4c')]},'raw':!![]})[_0x8b00('0x23')](function(_0x384e51){if(_0x384e51&&_0x384e51[_0x8b00('0x4d')]===0x0){return db[_0x8b00('0x26')][_0x8b00('0x49')]({'name':_0x5c4d26[_0x8b00('0x29')],'resourceId':_0x5c4d26['id'],'type':_0x384e51['name'],'sectionId':_0x384e51['id']},{})[_0x8b00('0x23')](function(){return _0x225fe3;});}else{return _0x225fe3;}})[_0x8b00('0x44')](function(_0x94eb45){logger[_0x8b00('0x4e')](_0x8b00('0x4f'),_0x94eb45);throw _0x94eb45;});}return _0x225fe3;})[_0x8b00('0x23')](respondWithResult(_0x409801,0xc9))[_0x8b00('0x44')](handleError(_0x409801,null));};exports['update']=function(_0x4037e6,_0x2bdde6){if(_0x4037e6[_0x8b00('0x50')]['id']){delete _0x4037e6[_0x8b00('0x50')]['id'];}return db[_0x8b00('0x2d')][_0x8b00('0x48')]({'where':{'id':_0x4037e6[_0x8b00('0x46')]['id']}})[_0x8b00('0x23')](handleEntityNotFound(_0x2bdde6,null))[_0x8b00('0x23')](saveUpdates(_0x4037e6[_0x8b00('0x50')],null))['then'](respondWithResult(_0x2bdde6,null))[_0x8b00('0x44')](handleError(_0x2bdde6,null));};exports[_0x8b00('0x24')]=function(_0x10d4b8,_0x3dde38){return db[_0x8b00('0x2d')][_0x8b00('0x48')]({'where':{'id':_0x10d4b8['params']['id']}})[_0x8b00('0x23')](handleEntityNotFound(_0x3dde38,null))[_0x8b00('0x23')](removeEntity(_0x3dde38,null))[_0x8b00('0x44')](handleError(_0x3dde38,null));};exports[_0x8b00('0x51')]=function(_0x4d8115,_0x51474b,_0x57de37){var _0x35ec76;return db[_0x8b00('0x2d')][_0x8b00('0x48')]({'where':{'id':_0x4d8115[_0x8b00('0x46')]['id']},'attributes':['id',_0x8b00('0x52')]})[_0x8b00('0x23')](handleEntityNotFound(_0x51474b,null))[_0x8b00('0x23')](function(_0x3712b2){if(_0x3712b2){var _0x2344c4=require('odbc')();_0x2344c4[_0x8b00('0x53')](_0x3712b2[_0x8b00('0x52')]);_0x2344c4[_0x8b00('0x54')]();return _0x3712b2;}})[_0x8b00('0x23')](respondWithResult(_0x51474b,null))[_0x8b00('0x44')](handleError(_0x51474b,null));}; \ No newline at end of file +var _0xa008=['moment','sox','to-csv','ejs','squel','desk.js','querystring','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','error','name','send','index','map','SquareOdbc','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','includeAll','findAll','rows','show','params','rawAttributes','length','include','find','catch','create','body','get','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','openSync','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa008,0x1be));var _0x8a00=function(_0x2f96ad,_0x567608){_0x2f96ad=_0x2f96ad-0x0;var _0x5da7ec=_0xa008[_0x2f96ad];return _0x5da7ec;};'use strict';var emlformat=require(_0x8a00('0x0'));var rimraf=require(_0x8a00('0x1'));var zipdir=require(_0x8a00('0x2'));var jsonpatch=require(_0x8a00('0x3'));var rp=require('request-promise');var moment=require(_0x8a00('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8a00('0x5'));var csv=require(_0x8a00('0x6'));var ejs=require(_0x8a00('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8a00('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8a00('0x9'));var toCsv=require('to-csv');var querystring=require(_0x8a00('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8a00('0xb'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8a00('0xc'));var utils=require(_0x8a00('0xd'));var config=require(_0x8a00('0xe'));var licenseUtil=require('../../config/license/util');var db=require(_0x8a00('0xf'))['db'];function respondWithStatusCode(_0x551438,_0x4ba69d){_0x4ba69d=_0x4ba69d||0xcc;return function(_0x3f71f){if(_0x3f71f){return _0x551438[_0x8a00('0x10')](_0x4ba69d);}return _0x551438[_0x8a00('0x11')](_0x4ba69d)[_0x8a00('0x12')]();};}function respondWithResult(_0x4e9ba6,_0xd2073c){_0xd2073c=_0xd2073c||0xc8;return function(_0x51b5a4){if(_0x51b5a4){return _0x4e9ba6[_0x8a00('0x11')](_0xd2073c)[_0x8a00('0x13')](_0x51b5a4);}};}function respondWithFilteredResult(_0x4b4cdc,_0x273ef5){return function(_0x1544ee){if(_0x1544ee){var _0x5632d6=typeof _0x273ef5[_0x8a00('0x14')]===_0x8a00('0x15')&&typeof _0x273ef5['limit']===_0x8a00('0x15');var _0x468a69=_0x1544ee[_0x8a00('0x16')];var _0x30f636=_0x5632d6?0x0:_0x273ef5['offset'];var _0x503158=_0x5632d6?_0x1544ee['count']:_0x273ef5[_0x8a00('0x14')]+_0x273ef5[_0x8a00('0x17')];var _0x35d506;if(_0x503158>=_0x468a69){_0x503158=_0x468a69;_0x35d506=0xc8;}else{_0x35d506=0xce;}_0x4b4cdc[_0x8a00('0x11')](_0x35d506);return _0x4b4cdc[_0x8a00('0x18')](_0x8a00('0x19'),_0x30f636+'-'+_0x503158+'/'+_0x468a69)[_0x8a00('0x13')](_0x1544ee);}return null;};}function patchUpdates(_0x24743c){return function(_0xdde785){try{jsonpatch[_0x8a00('0x1a')](_0xdde785,_0x24743c,!![]);}catch(_0x5764f3){return BPromise['reject'](_0x5764f3);}return _0xdde785[_0x8a00('0x1b')]();};}function saveUpdates(_0x15b9d1,_0x7cc71d){return function(_0x4308c5){if(_0x4308c5){return _0x4308c5[_0x8a00('0x1c')](_0x15b9d1)[_0x8a00('0x1d')](function(_0x21a7d1){return _0x21a7d1;});}return null;};}function removeEntity(_0x58b188,_0x1e2fe8){return function(_0x1a6745){if(_0x1a6745){return _0x1a6745[_0x8a00('0x1e')]()[_0x8a00('0x1d')](function(){var _0x4ca6aa=_0x1a6745['get']({'plain':!![]});var _0x8c2a10='ODBC';return db[_0x8a00('0x1f')]['destroy']({'where':{'type':_0x8c2a10,'resourceId':_0x4ca6aa['id']}})[_0x8a00('0x1d')](function(){return _0x1a6745;});})[_0x8a00('0x1d')](function(){_0x58b188[_0x8a00('0x11')](0xcc)[_0x8a00('0x12')]();});}};}function handleEntityNotFound(_0x1d6c7e,_0x16ca00){return function(_0xdfc1d7){if(!_0xdfc1d7){_0x1d6c7e[_0x8a00('0x10')](0x194);}return _0xdfc1d7;};}function handleError(_0x188ba8,_0x43582d){_0x43582d=_0x43582d||0x1f4;return function(_0x19212e){logger[_0x8a00('0x20')](_0x19212e['stack']);if(_0x19212e[_0x8a00('0x21')]){delete _0x19212e['name'];}_0x188ba8[_0x8a00('0x11')](_0x43582d)[_0x8a00('0x22')](_0x19212e);};}exports[_0x8a00('0x23')]=function(_0x4f94bd,_0x525572){var _0x316e59={},_0x6c64ad={},_0x58c02f={'count':0x0,'rows':[]};var _0x499852=_[_0x8a00('0x24')](db[_0x8a00('0x25')]['rawAttributes'],function(_0x212cad){return{'name':_0x212cad[_0x8a00('0x26')],'type':_0x212cad[_0x8a00('0x27')]['key']};});_0x6c64ad[_0x8a00('0x28')]=_[_0x8a00('0x24')](_0x499852,_0x8a00('0x21'));_0x6c64ad['query']=_[_0x8a00('0x29')](_0x4f94bd[_0x8a00('0x2a')]);_0x6c64ad[_0x8a00('0x2b')]=_[_0x8a00('0x2c')](_0x6c64ad[_0x8a00('0x28')],_0x6c64ad['query']);_0x316e59[_0x8a00('0x2d')]=_['intersection'](_0x6c64ad[_0x8a00('0x28')],qs[_0x8a00('0x2e')](_0x4f94bd['query'][_0x8a00('0x2e')]));_0x316e59[_0x8a00('0x2d')]=_0x316e59[_0x8a00('0x2d')]['length']?_0x316e59['attributes']:_0x6c64ad[_0x8a00('0x28')];if(!_0x4f94bd[_0x8a00('0x2a')][_0x8a00('0x2f')](_0x8a00('0x30'))){_0x316e59[_0x8a00('0x17')]=qs[_0x8a00('0x17')](_0x4f94bd['query'][_0x8a00('0x17')]);_0x316e59['offset']=qs[_0x8a00('0x14')](_0x4f94bd[_0x8a00('0x2a')][_0x8a00('0x14')]);}_0x316e59['order']=qs[_0x8a00('0x31')](_0x4f94bd[_0x8a00('0x2a')][_0x8a00('0x31')]);_0x316e59[_0x8a00('0x32')]=qs['filters'](_['pick'](_0x4f94bd['query'],_0x6c64ad['filters']),_0x499852);if(_0x4f94bd[_0x8a00('0x2a')]['filter']){_0x316e59['where']=_[_0x8a00('0x33')](_0x316e59['where'],{'$or':_[_0x8a00('0x24')](_0x499852,function(_0x294c17){if(_0x294c17[_0x8a00('0x27')]!==_0x8a00('0x34')){var _0x16dd29={};_0x16dd29[_0x294c17[_0x8a00('0x21')]]={'$like':'%'+_0x4f94bd[_0x8a00('0x2a')][_0x8a00('0x35')]+'%'};return _0x16dd29;}})});}_0x316e59=_[_0x8a00('0x33')]({},_0x316e59,_0x4f94bd['options']);var _0x563cd8={'where':_0x316e59[_0x8a00('0x32')]};return db['SquareOdbc'][_0x8a00('0x16')](_0x563cd8)['then'](function(_0x48980c){_0x58c02f['count']=_0x48980c;if(_0x4f94bd['query'][_0x8a00('0x36')]){_0x316e59['include']=[{'all':!![]}];}return db[_0x8a00('0x25')][_0x8a00('0x37')](_0x316e59);})[_0x8a00('0x1d')](function(_0x370a36){_0x58c02f[_0x8a00('0x38')]=_0x370a36;return _0x58c02f;})['then'](respondWithFilteredResult(_0x525572,_0x316e59))['catch'](handleError(_0x525572,null));};exports[_0x8a00('0x39')]=function(_0x46c848,_0x12bd17){var _0x5de359={'raw':!![],'where':{'id':_0x46c848[_0x8a00('0x3a')]['id']}},_0x156c41={};_0x156c41['model']=_[_0x8a00('0x29')](db['SquareOdbc'][_0x8a00('0x3b')]);_0x156c41['query']=_['keys'](_0x46c848[_0x8a00('0x2a')]);_0x156c41[_0x8a00('0x2b')]=_[_0x8a00('0x2c')](_0x156c41['model'],_0x156c41['query']);_0x5de359[_0x8a00('0x2d')]=_[_0x8a00('0x2c')](_0x156c41[_0x8a00('0x28')],qs['fields'](_0x46c848[_0x8a00('0x2a')][_0x8a00('0x2e')]));_0x5de359[_0x8a00('0x2d')]=_0x5de359[_0x8a00('0x2d')][_0x8a00('0x3c')]?_0x5de359[_0x8a00('0x2d')]:_0x156c41[_0x8a00('0x28')];if(_0x46c848[_0x8a00('0x2a')][_0x8a00('0x36')]){_0x5de359[_0x8a00('0x3d')]=[{'all':!![]}];}_0x5de359=_[_0x8a00('0x33')]({},_0x5de359,_0x46c848['options']);return db[_0x8a00('0x25')][_0x8a00('0x3e')](_0x5de359)['then'](handleEntityNotFound(_0x12bd17,null))[_0x8a00('0x1d')](respondWithResult(_0x12bd17,null))[_0x8a00('0x3f')](handleError(_0x12bd17,null));};exports['create']=function(_0x1c9ee7,_0x2de40a){return db[_0x8a00('0x25')][_0x8a00('0x40')](_0x1c9ee7[_0x8a00('0x41')],{})[_0x8a00('0x1d')](function(_0x188d7d){var _0x18de48=_0x1c9ee7['user'][_0x8a00('0x42')]({'plain':!![]});if(!_0x18de48)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18de48[_0x8a00('0x43')]===_0x8a00('0x44')){var _0x426f45=_0x188d7d[_0x8a00('0x42')]({'plain':!![]});var _0x26a7c0='ODBC';return db[_0x8a00('0x45')][_0x8a00('0x3e')]({'where':{'name':_0x26a7c0,'userProfileId':_0x18de48[_0x8a00('0x46')]},'raw':!![]})[_0x8a00('0x1d')](function(_0x44c8a0){if(_0x44c8a0&&_0x44c8a0['autoAssociation']===0x0){return db[_0x8a00('0x1f')][_0x8a00('0x40')]({'name':_0x426f45['name'],'resourceId':_0x426f45['id'],'type':_0x44c8a0[_0x8a00('0x21')],'sectionId':_0x44c8a0['id']},{})[_0x8a00('0x1d')](function(){return _0x188d7d;});}else{return _0x188d7d;}})[_0x8a00('0x3f')](function(_0x2e6e76){logger['error'](_0x8a00('0x47'),_0x2e6e76);throw _0x2e6e76;});}return _0x188d7d;})['then'](respondWithResult(_0x2de40a,0xc9))[_0x8a00('0x3f')](handleError(_0x2de40a,null));};exports['update']=function(_0x3b7c10,_0x5125f2){if(_0x3b7c10[_0x8a00('0x41')]['id']){delete _0x3b7c10['body']['id'];}return db[_0x8a00('0x25')]['find']({'where':{'id':_0x3b7c10[_0x8a00('0x3a')]['id']}})[_0x8a00('0x1d')](handleEntityNotFound(_0x5125f2,null))[_0x8a00('0x1d')](saveUpdates(_0x3b7c10[_0x8a00('0x41')],null))[_0x8a00('0x1d')](respondWithResult(_0x5125f2,null))[_0x8a00('0x3f')](handleError(_0x5125f2,null));};exports[_0x8a00('0x1e')]=function(_0x37f73c,_0xd3729b){return db[_0x8a00('0x25')][_0x8a00('0x3e')]({'where':{'id':_0x37f73c[_0x8a00('0x3a')]['id']}})['then'](handleEntityNotFound(_0xd3729b,null))[_0x8a00('0x1d')](removeEntity(_0xd3729b,null))[_0x8a00('0x3f')](handleError(_0xd3729b,null));};exports[_0x8a00('0x48')]=function(_0x56d74f,_0x504f35,_0x24a4ed){var _0x4b5774;return db['SquareOdbc'][_0x8a00('0x3e')]({'where':{'id':_0x56d74f[_0x8a00('0x3a')]['id']},'attributes':['id',_0x8a00('0x49')]})[_0x8a00('0x1d')](handleEntityNotFound(_0x504f35,null))[_0x8a00('0x1d')](function(_0x504eb7){if(_0x504eb7){var _0x517786=require('odbc')();_0x517786[_0x8a00('0x4a')](_0x504eb7['dsn']);_0x517786['closeSync']();return _0x504eb7;}})[_0x8a00('0x1d')](respondWithResult(_0x504f35,null))[_0x8a00('0x3f')](handleError(_0x504f35,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 61aa06a..13d5733 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 _0x57c5=['path','../../config/environment','exports','define','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x232f42,_0x23b27c){var _0x1f73de=function(_0x5912c0){while(--_0x5912c0){_0x232f42['push'](_0x232f42['shift']());}};_0x1f73de(++_0x23b27c);}(_0x57c5,0x125));var _0x557c=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x57c5[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x557c('0x0'));var util=require(_0x557c('0x1'));var logger=require(_0x557c('0x2'))(_0x557c('0x3'));var moment=require(_0x557c('0x4'));var BPromise=require(_0x557c('0x5'));var rp=require(_0x557c('0x6'));var fs=require('fs');var path=require(_0x557c('0x7'));var rimraf=require('rimraf');var config=require(_0x557c('0x8'));var attributes=require('./squareOdbc.attributes');module[_0x557c('0x9')]=function(_0x299f29,_0xbc5014){return _0x299f29[_0x557c('0xa')]('SquareOdbc',attributes,{'tableName':_0x557c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f45=['api','moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','square_odbc','lodash','util','../../config/logger'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0f45,0x1c4));var _0x50f4=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x0f45[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x50f4('0x0'));var util=require(_0x50f4('0x1'));var logger=require(_0x50f4('0x2'))(_0x50f4('0x3'));var moment=require(_0x50f4('0x4'));var BPromise=require(_0x50f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x50f4('0x6'));var rimraf=require(_0x50f4('0x7'));var config=require(_0x50f4('0x8'));var attributes=require(_0x50f4('0x9'));module[_0x50f4('0xa')]=function(_0x130794,_0x3874ae){return _0x130794[_0x50f4('0xb')]('SquareOdbc',attributes,{'tableName':_0x50f4('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 5d37df7..30b001e 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 _0x7a45=['lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ShowSquareOdbc','SquareOdbc','find','options','where','attributes','map','include','model','info'];(function(_0x2c6025,_0x44b6d2){var _0x40fcaa=function(_0x1c05ff){while(--_0x1c05ff){_0x2c6025['push'](_0x2c6025['shift']());}};_0x40fcaa(++_0x44b6d2);}(_0x7a45,0x1a4));var _0x57a4=function(_0x246500,_0x32af5d){_0x246500=_0x246500-0x0;var _0x456758=_0x7a45[_0x246500];return _0x456758;};'use strict';var _=require(_0x57a4('0x0'));var util=require(_0x57a4('0x1'));var moment=require('moment');var BPromise=require(_0x57a4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57a4('0x3'))['db'];var utils=require(_0x57a4('0x4'));var logger=require(_0x57a4('0x5'))(_0x57a4('0x6'));var config=require(_0x57a4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x57a4('0x8')][_0x57a4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x435992,_0xeefa24,_0x3d91b7){return new BPromise(function(_0x4a05cf,_0x584378){return client[_0x57a4('0xa')](_0x435992,_0x3d91b7)[_0x57a4('0xb')](function(_0x1bda35){logger['info'](_0x57a4('0xc'),_0xeefa24,_0x57a4('0xd'));logger[_0x57a4('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0xeefa24,_0x57a4('0xd'),JSON[_0x57a4('0xf')](_0x1bda35));if(_0x1bda35[_0x57a4('0x10')]){if(_0x1bda35[_0x57a4('0x10')][_0x57a4('0x11')]===0x1f4){logger[_0x57a4('0x10')](_0x57a4('0xc'),_0xeefa24,_0x1bda35[_0x57a4('0x10')]['message']);return _0x584378(_0x1bda35[_0x57a4('0x10')][_0x57a4('0x12')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0xeefa24,_0x1bda35['error']['message']);return _0x4a05cf(_0x1bda35[_0x57a4('0x10')][_0x57a4('0x12')]);}else{logger['info'](_0x57a4('0xc'),_0xeefa24,_0x57a4('0xd'));_0x4a05cf(_0x1bda35['result'][_0x57a4('0x12')]);}})[_0x57a4('0x13')](function(_0x1449b4){logger[_0x57a4('0x10')]('SquareOdbc,\x20%s,\x20%s',_0xeefa24,_0x1449b4);_0x584378(_0x1449b4);});});}exports[_0x57a4('0x14')]=function(_0x423d5a){var _0x5b1935=this;return new Promise(function(_0x3ac4c2,_0x1620ad){return db[_0x57a4('0x15')][_0x57a4('0x16')]({'raw':_0x423d5a[_0x57a4('0x17')]?_0x423d5a[_0x57a4('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x423d5a[_0x57a4('0x17')]?_0x423d5a[_0x57a4('0x17')][_0x57a4('0x18')]||null:null,'attributes':_0x423d5a[_0x57a4('0x17')]?_0x423d5a[_0x57a4('0x17')][_0x57a4('0x19')]||null:null,'include':_0x423d5a['options']?_0x423d5a[_0x57a4('0x17')]['include']?_[_0x57a4('0x1a')](_0x423d5a[_0x57a4('0x17')][_0x57a4('0x1b')],function(_0xd777b0){return{'model':db[_0xd777b0[_0x57a4('0x1c')]],'as':_0xd777b0['as'],'attributes':_0xd777b0[_0x57a4('0x19')],'include':_0xd777b0['include']?_[_0x57a4('0x1a')](_0xd777b0[_0x57a4('0x1b')],function(_0xbd62e1){return{'model':db[_0xbd62e1['model']],'as':_0xbd62e1['as'],'attributes':_0xbd62e1[_0x57a4('0x19')],'include':_0xbd62e1['include']?_['map'](_0xbd62e1[_0x57a4('0x1b')],function(_0xfce5d3){return{'model':db[_0xfce5d3[_0x57a4('0x1c')]],'as':_0xfce5d3['as'],'attributes':_0xfce5d3[_0x57a4('0x19')]};}):[]};}):[]};}):[]:[]})[_0x57a4('0xb')](function(_0x2bc659){logger[_0x57a4('0x1d')]('ShowSquareOdbc',_0x423d5a);logger[_0x57a4('0xe')](_0x57a4('0x14'),_0x423d5a,JSON[_0x57a4('0xf')](_0x2bc659));_0x3ac4c2(_0x2bc659);})[_0x57a4('0x13')](function(_0x5ab70c){logger[_0x57a4('0x10')]('ShowSquareOdbc',_0x5ab70c['message'],_0x423d5a);_0x1620ad(_0x5b1935['error'](0x1f4,_0x5ab70c['message']));});});}; \ No newline at end of file +var _0x4ca1=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','SquareOdbc,\x20%s,\x20%s','info','result','catch','ShowSquareOdbc','find','options','raw','where','attributes','map','include','model','debug','util','moment','bluebird'];(function(_0x4989ca,_0x20cc42){var _0x47bae2=function(_0x3fb147){while(--_0x3fb147){_0x4989ca['push'](_0x4989ca['shift']());}};_0x47bae2(++_0x20cc42);}(_0x4ca1,0x11d));var _0x14ca=function(_0x87d3ec,_0x387888){_0x87d3ec=_0x87d3ec-0x0;var _0x5f3f6f=_0x4ca1[_0x87d3ec];return _0x5f3f6f;};'use strict';var _=require('lodash');var util=require(_0x14ca('0x0'));var moment=require(_0x14ca('0x1'));var BPromise=require(_0x14ca('0x2'));var rs=require(_0x14ca('0x3'));var fs=require('fs');var Redis=require(_0x14ca('0x4'));var db=require(_0x14ca('0x5'))['db'];var utils=require(_0x14ca('0x6'));var logger=require('../../config/logger')(_0x14ca('0x7'));var config=require(_0x14ca('0x8'));var jayson=require(_0x14ca('0x9'));var client=jayson['client'][_0x14ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33ec19,_0x229f1a,_0x785d97){return new BPromise(function(_0x1f3ee,_0x2b2c25){return client[_0x14ca('0xb')](_0x33ec19,_0x785d97)[_0x14ca('0xc')](function(_0x1fba44){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x229f1a,_0x14ca('0xd'));logger['debug'](_0x14ca('0xe'),_0x229f1a,_0x14ca('0xd'),JSON[_0x14ca('0xf')](_0x1fba44));if(_0x1fba44[_0x14ca('0x10')]){if(_0x1fba44['error']['code']===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x229f1a,_0x1fba44[_0x14ca('0x10')][_0x14ca('0x11')]);return _0x2b2c25(_0x1fba44[_0x14ca('0x10')][_0x14ca('0x11')]);}logger['error'](_0x14ca('0x12'),_0x229f1a,_0x1fba44['error']['message']);return _0x1f3ee(_0x1fba44[_0x14ca('0x10')][_0x14ca('0x11')]);}else{logger[_0x14ca('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x229f1a,_0x14ca('0xd'));_0x1f3ee(_0x1fba44[_0x14ca('0x14')][_0x14ca('0x11')]);}})[_0x14ca('0x15')](function(_0x2da490){logger[_0x14ca('0x10')](_0x14ca('0x12'),_0x229f1a,_0x2da490);_0x2b2c25(_0x2da490);});});}exports[_0x14ca('0x16')]=function(_0x2b2dc2){var _0x4706b6=this;return new Promise(function(_0x486256,_0x3ba316){return db['SquareOdbc'][_0x14ca('0x17')]({'raw':_0x2b2dc2[_0x14ca('0x18')]?_0x2b2dc2['options'][_0x14ca('0x19')]===undefined?!![]:![]:!![],'where':_0x2b2dc2[_0x14ca('0x18')]?_0x2b2dc2[_0x14ca('0x18')][_0x14ca('0x1a')]||null:null,'attributes':_0x2b2dc2['options']?_0x2b2dc2[_0x14ca('0x18')][_0x14ca('0x1b')]||null:null,'include':_0x2b2dc2[_0x14ca('0x18')]?_0x2b2dc2[_0x14ca('0x18')]['include']?_[_0x14ca('0x1c')](_0x2b2dc2[_0x14ca('0x18')][_0x14ca('0x1d')],function(_0x30d7d3){return{'model':db[_0x30d7d3['model']],'as':_0x30d7d3['as'],'attributes':_0x30d7d3['attributes'],'include':_0x30d7d3[_0x14ca('0x1d')]?_['map'](_0x30d7d3[_0x14ca('0x1d')],function(_0xc1b3f){return{'model':db[_0xc1b3f[_0x14ca('0x1e')]],'as':_0xc1b3f['as'],'attributes':_0xc1b3f[_0x14ca('0x1b')],'include':_0xc1b3f[_0x14ca('0x1d')]?_['map'](_0xc1b3f[_0x14ca('0x1d')],function(_0x4e6dac){return{'model':db[_0x4e6dac[_0x14ca('0x1e')]],'as':_0x4e6dac['as'],'attributes':_0x4e6dac[_0x14ca('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x14ca('0xc')](function(_0x9bacd3){logger[_0x14ca('0x13')]('ShowSquareOdbc',_0x2b2dc2);logger[_0x14ca('0x1f')](_0x14ca('0x16'),_0x2b2dc2,JSON[_0x14ca('0xf')](_0x9bacd3));_0x486256(_0x9bacd3);})[_0x14ca('0x15')](function(_0x4bff69){logger[_0x14ca('0x10')](_0x14ca('0x16'),_0x4bff69['message'],_0x2b2dc2);_0x3ba316(_0x4706b6['error'](0x1f4,_0x4bff69[_0x14ca('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index c4e37c8..b2715e9 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 _0x23a3=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','/:id/users','post','create','addUsers','put','update','delete','connect-timeout'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x23a3,0x131));var _0x323a=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0x23a3[_0x389832];return _0x59429e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x323a('0x0'));var express=require('express');var router=express[_0x323a('0x1')]();var fs_extra=require(_0x323a('0x2'));var auth=require(_0x323a('0x3'));var interaction=require(_0x323a('0x4'));var config=require(_0x323a('0x5'));var controller=require(_0x323a('0x6'));router[_0x323a('0x7')]('/',auth[_0x323a('0x8')](),controller[_0x323a('0x9')]);router['get'](_0x323a('0xa'),auth[_0x323a('0x8')](),controller['show']);router[_0x323a('0x7')](_0x323a('0xb'),auth[_0x323a('0x8')](),controller['getUsers']);router[_0x323a('0xc')]('/',auth[_0x323a('0x8')](),controller[_0x323a('0xd')]);router[_0x323a('0xc')](_0x323a('0xb'),auth[_0x323a('0x8')](),controller[_0x323a('0xe')]);router[_0x323a('0xf')](_0x323a('0xa'),auth[_0x323a('0x8')](),controller[_0x323a('0x10')]);router[_0x323a('0x11')](_0x323a('0xa'),auth[_0x323a('0x8')](),controller['destroy']);router[_0x323a('0x11')]('/:id/users',auth[_0x323a('0x8')](),controller['removeUsers']);module['exports']=router; \ No newline at end of file +var _0x1d91=['Router','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller','get','/:id','isAuthenticated','show','/:id/users','getUsers','post','addUsers','put','delete','destroy','multer','util','path','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1d91,0x150));var _0x11d9=function(_0x22d4a0,_0x2d557a){_0x22d4a0=_0x22d4a0-0x0;var _0x1d3a5e=_0x1d91[_0x22d4a0];return _0x1d3a5e;};'use strict';var multer=require(_0x11d9('0x0'));var util=require(_0x11d9('0x1'));var path=require(_0x11d9('0x2'));var timeout=require('connect-timeout');var express=require(_0x11d9('0x3'));var router=express[_0x11d9('0x4')]();var fs_extra=require(_0x11d9('0x5'));var auth=require(_0x11d9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x11d9('0x7'));var controller=require(_0x11d9('0x8'));router[_0x11d9('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x11d9('0xa'),auth[_0x11d9('0xb')](),controller[_0x11d9('0xc')]);router[_0x11d9('0x9')](_0x11d9('0xd'),auth['isAuthenticated'](),controller[_0x11d9('0xe')]);router['post']('/',auth[_0x11d9('0xb')](),controller['create']);router[_0x11d9('0xf')](_0x11d9('0xd'),auth[_0x11d9('0xb')](),controller[_0x11d9('0x10')]);router[_0x11d9('0x11')]('/:id',auth[_0x11d9('0xb')](),controller['update']);router[_0x11d9('0x12')](_0x11d9('0xa'),auth['isAuthenticated'](),controller[_0x11d9('0x13')]);router[_0x11d9('0x12')](_0x11d9('0xd'),auth[_0x11d9('0xb')](),controller['removeUsers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 0b19e09..447477b 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 _0x1c1a=['utf8','DATE','sequelize','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','production'];(function(_0x146da3,_0x50cff6){var _0x4ab8a3=function(_0xdf8a05){while(--_0xdf8a05){_0x146da3['push'](_0x146da3['shift']());}};_0x4ab8a3(++_0x50cff6);}(_0x1c1a,0x1f1));var _0xa1c1=function(_0x5c4e4a,_0x1b18b7){_0x5c4e4a=_0x5c4e4a-0x0;var _0x5a0747=_0x1c1a[_0x5c4e4a];return _0x5a0747;};'use strict';var Sequelize=require(_0xa1c1('0x0'));module['exports']={'name':{'type':Sequelize[_0xa1c1('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xa1c1('0x2')]},'preproduction':{'type':Sequelize[_0xa1c1('0x3')](_0xa1c1('0x4')),'get':function(){if(this[_0xa1c1('0x5')](_0xa1c1('0x6'))){return this[_0xa1c1('0x5')]('preproduction')[_0xa1c1('0x7')]('utf8');}}},'production':{'type':Sequelize[_0xa1c1('0x3')](_0xa1c1('0x4')),'get':function(){if(this['getDataValue']('production')){return this['getDataValue'](_0xa1c1('0x8'))[_0xa1c1('0x7')](_0xa1c1('0x9'));}}},'savedAt':{'type':Sequelize[_0xa1c1('0xa')]},'publishedAt':{'type':Sequelize[_0xa1c1('0xa')]}}; \ No newline at end of file +var _0x9c4b=['long','getDataValue','preproduction','toString','utf8','DATE','STRING','name','TEXT'];(function(_0xc398b8,_0x3ae32e){var _0x2b183a=function(_0x53ffd7){while(--_0x53ffd7){_0xc398b8['push'](_0xc398b8['shift']());}};_0x2b183a(++_0x3ae32e);}(_0x9c4b,0x14a));var _0xb9c4=function(_0x13a5e2,_0x4e2d46){_0x13a5e2=_0x13a5e2-0x0;var _0x42c586=_0x9c4b[_0x13a5e2];return _0x42c586;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb9c4('0x0')],'unique':_0xb9c4('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xb9c4('0x0')]},'notes':{'type':Sequelize[_0xb9c4('0x2')]},'preproduction':{'type':Sequelize['BLOB'](_0xb9c4('0x3')),'get':function(){if(this[_0xb9c4('0x4')](_0xb9c4('0x5'))){return this[_0xb9c4('0x4')](_0xb9c4('0x5'))[_0xb9c4('0x6')]('utf8');}}},'production':{'type':Sequelize['BLOB'](_0xb9c4('0x3')),'get':function(){if(this[_0xb9c4('0x4')]('production')){return this['getDataValue']('production')[_0xb9c4('0x6')](_0xb9c4('0x7'));}}},'savedAt':{'type':Sequelize[_0xb9c4('0x8')]},'publishedAt':{'type':Sequelize[_0xb9c4('0x8')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 89343ac..3eb7070 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 _0xf114=['findAll','rows','catch','show','params','keys','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','userSquareProject:remove','emit','User','pick','getUsers','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./squareProject.socket','register','status','end','json','offset','undefined','limit','count','set','save','update','then','destroy','get','SquareProjects','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','SquareProject'];(function(_0x266954,_0x39b338){var _0x2b2195=function(_0x50016b){while(--_0x50016b){_0x266954['push'](_0x266954['shift']());}};_0x2b2195(++_0x39b338);}(_0xf114,0xe5));var _0x4f11=function(_0xe89ccc,_0x150f86){_0xe89ccc=_0xe89ccc-0x0;var _0x262bca=_0xf114[_0xe89ccc];return _0x262bca;};'use strict';var emlformat=require(_0x4f11('0x0'));var rimraf=require(_0x4f11('0x1'));var zipdir=require(_0x4f11('0x2'));var jsonpatch=require(_0x4f11('0x3'));var rp=require(_0x4f11('0x4'));var moment=require(_0x4f11('0x5'));var BPromise=require(_0x4f11('0x6'));var Mustache=require(_0x4f11('0x7'));var util=require(_0x4f11('0x8'));var path=require(_0x4f11('0x9'));var sox=require(_0x4f11('0xa'));var csv=require('to-csv');var ejs=require(_0x4f11('0xb'));var fs=require('fs');var fs_extra=require(_0x4f11('0xc'));var _=require(_0x4f11('0xd'));var squel=require('squel');var crypto=require(_0x4f11('0xe'));var jsforce=require(_0x4f11('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4f11('0x10'));var querystring=require(_0x4f11('0x11'));var Papa=require(_0x4f11('0x12'));var Redis=require(_0x4f11('0x13'));var authService=require(_0x4f11('0x14'));var qs=require(_0x4f11('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f11('0x16'));var logger=require(_0x4f11('0x17'))(_0x4f11('0x18'));var utils=require(_0x4f11('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x4f11('0x1a'));var db=require(_0x4f11('0x1b'))['db'];config[_0x4f11('0x1c')]=_[_0x4f11('0x1d')](config[_0x4f11('0x1c')],{'host':_0x4f11('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4f11('0x1f'))[_0x4f11('0x20')](socket);function respondWithStatusCode(_0x579535,_0x4cec07){_0x4cec07=_0x4cec07||0xcc;return function(_0xd0599d){if(_0xd0599d){return _0x579535['sendStatus'](_0x4cec07);}return _0x579535[_0x4f11('0x21')](_0x4cec07)[_0x4f11('0x22')]();};}function respondWithResult(_0x279c9b,_0x5c6f7b){_0x5c6f7b=_0x5c6f7b||0xc8;return function(_0x255c4c){if(_0x255c4c){return _0x279c9b['status'](_0x5c6f7b)[_0x4f11('0x23')](_0x255c4c);}};}function respondWithFilteredResult(_0x4552b1,_0x328b05){return function(_0x422e8c){if(_0x422e8c){var _0x482c37=typeof _0x328b05[_0x4f11('0x24')]===_0x4f11('0x25')&&typeof _0x328b05[_0x4f11('0x26')]===_0x4f11('0x25');var _0x3142ba=_0x422e8c[_0x4f11('0x27')];var _0x553696=_0x482c37?0x0:_0x328b05['offset'];var _0x3264bf=_0x482c37?_0x422e8c['count']:_0x328b05[_0x4f11('0x24')]+_0x328b05['limit'];var _0x154299;if(_0x3264bf>=_0x3142ba){_0x3264bf=_0x3142ba;_0x154299=0xc8;}else{_0x154299=0xce;}_0x4552b1[_0x4f11('0x21')](_0x154299);return _0x4552b1[_0x4f11('0x28')]('Content-Range',_0x553696+'-'+_0x3264bf+'/'+_0x3142ba)[_0x4f11('0x23')](_0x422e8c);}return null;};}function patchUpdates(_0x56cebb){return function(_0xa4b6c9){try{jsonpatch['apply'](_0xa4b6c9,_0x56cebb,!![]);}catch(_0x110090){return BPromise['reject'](_0x110090);}return _0xa4b6c9[_0x4f11('0x29')]();};}function saveUpdates(_0xe86b0e,_0x230410){return function(_0x511bfa){if(_0x511bfa){return _0x511bfa[_0x4f11('0x2a')](_0xe86b0e)[_0x4f11('0x2b')](function(_0x401c77){return _0x401c77;});}return null;};}function removeEntity(_0x2d634c,_0x4194a6){return function(_0xdbdd77){if(_0xdbdd77){return _0xdbdd77[_0x4f11('0x2c')]()[_0x4f11('0x2b')](function(){var _0x5ecc02=_0xdbdd77[_0x4f11('0x2d')]({'plain':!![]});var _0x4b4656=_0x4f11('0x2e');return db[_0x4f11('0x2f')][_0x4f11('0x2c')]({'where':{'type':_0x4b4656,'resourceId':_0x5ecc02['id']}})[_0x4f11('0x2b')](function(){return _0xdbdd77;});})[_0x4f11('0x2b')](function(){_0x2d634c[_0x4f11('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3043df,_0x2aed11){return function(_0x3f191d){if(!_0x3f191d){_0x3043df[_0x4f11('0x30')](0x194);}return _0x3f191d;};}function handleError(_0x5570f6,_0x52d152){_0x52d152=_0x52d152||0x1f4;return function(_0x34b85a){logger[_0x4f11('0x31')](_0x34b85a[_0x4f11('0x32')]);if(_0x34b85a[_0x4f11('0x33')]){delete _0x34b85a[_0x4f11('0x33')];}_0x5570f6[_0x4f11('0x21')](_0x52d152)[_0x4f11('0x34')](_0x34b85a);};}exports[_0x4f11('0x35')]=function(_0x5f2895,_0xc61acf){var _0x273f13={},_0x2412eb={},_0x5ae395={'count':0x0,'rows':[]};var _0x54234d=_[_0x4f11('0x36')](db['SquareProject'][_0x4f11('0x37')],function(_0x33e468){return{'name':_0x33e468[_0x4f11('0x38')],'type':_0x33e468['type'][_0x4f11('0x39')]};});_0x2412eb[_0x4f11('0x3a')]=_[_0x4f11('0x36')](_0x54234d,_0x4f11('0x33'));_0x2412eb['query']=_['keys'](_0x5f2895[_0x4f11('0x3b')]);_0x2412eb['filters']=_[_0x4f11('0x3c')](_0x2412eb[_0x4f11('0x3a')],_0x2412eb[_0x4f11('0x3b')]);_0x273f13[_0x4f11('0x3d')]=_[_0x4f11('0x3c')](_0x2412eb[_0x4f11('0x3a')],qs[_0x4f11('0x3e')](_0x5f2895[_0x4f11('0x3b')]['fields']));_0x273f13['attributes']=_0x273f13['attributes'][_0x4f11('0x3f')]?_0x273f13[_0x4f11('0x3d')]:_0x2412eb[_0x4f11('0x3a')];if(!_0x5f2895[_0x4f11('0x3b')]['hasOwnProperty'](_0x4f11('0x40'))){_0x273f13[_0x4f11('0x26')]=qs['limit'](_0x5f2895[_0x4f11('0x3b')][_0x4f11('0x26')]);_0x273f13['offset']=qs['offset'](_0x5f2895[_0x4f11('0x3b')]['offset']);}_0x273f13['order']=qs[_0x4f11('0x41')](_0x5f2895[_0x4f11('0x3b')]['sort']);_0x273f13[_0x4f11('0x42')]=qs[_0x4f11('0x43')](_['pick'](_0x5f2895['query'],_0x2412eb[_0x4f11('0x43')]),_0x54234d);if(_0x5f2895[_0x4f11('0x3b')][_0x4f11('0x44')]){_0x273f13[_0x4f11('0x42')]=_[_0x4f11('0x45')](_0x273f13[_0x4f11('0x42')],{'$or':_[_0x4f11('0x36')](_0x54234d,function(_0x5887e5){if(_0x5887e5[_0x4f11('0x46')]!==_0x4f11('0x47')){var _0x474d1b={};_0x474d1b[_0x5887e5['name']]={'$like':'%'+_0x5f2895[_0x4f11('0x3b')][_0x4f11('0x44')]+'%'};return _0x474d1b;}})});}_0x273f13=_['merge']({},_0x273f13,_0x5f2895[_0x4f11('0x48')]);var _0x4ee871={'where':_0x273f13[_0x4f11('0x42')]};return db['SquareProject'][_0x4f11('0x27')](_0x4ee871)['then'](function(_0x873493){_0x5ae395[_0x4f11('0x27')]=_0x873493;if(_0x5f2895['query']['includeAll']){_0x273f13['include']=[{'all':!![]}];}return db[_0x4f11('0x49')][_0x4f11('0x4a')](_0x273f13);})[_0x4f11('0x2b')](function(_0x5844bb){_0x5ae395[_0x4f11('0x4b')]=_0x5844bb;return _0x5ae395;})[_0x4f11('0x2b')](respondWithFilteredResult(_0xc61acf,_0x273f13))[_0x4f11('0x4c')](handleError(_0xc61acf,null));};exports[_0x4f11('0x4d')]=function(_0x223ba7,_0x3b9dca){var _0x282108={'raw':![],'where':{'id':_0x223ba7[_0x4f11('0x4e')]['id']}},_0x45e155={};_0x45e155[_0x4f11('0x3a')]=_[_0x4f11('0x4f')](db[_0x4f11('0x49')]['rawAttributes']);_0x45e155[_0x4f11('0x3b')]=_[_0x4f11('0x4f')](_0x223ba7[_0x4f11('0x3b')]);_0x45e155[_0x4f11('0x43')]=_['intersection'](_0x45e155[_0x4f11('0x3a')],_0x45e155[_0x4f11('0x3b')]);_0x282108[_0x4f11('0x3d')]=_[_0x4f11('0x3c')](_0x45e155[_0x4f11('0x3a')],qs[_0x4f11('0x3e')](_0x223ba7[_0x4f11('0x3b')][_0x4f11('0x3e')]));_0x282108[_0x4f11('0x3d')]=_0x282108[_0x4f11('0x3d')][_0x4f11('0x3f')]?_0x282108[_0x4f11('0x3d')]:_0x45e155[_0x4f11('0x3a')];if(_0x223ba7[_0x4f11('0x3b')][_0x4f11('0x50')]){_0x282108[_0x4f11('0x51')]=[{'all':!![]}];}_0x282108=_['merge']({},_0x282108,_0x223ba7[_0x4f11('0x48')]);return db[_0x4f11('0x49')][_0x4f11('0x52')](_0x282108)[_0x4f11('0x2b')](handleEntityNotFound(_0x3b9dca,null))['then'](respondWithResult(_0x3b9dca,null))[_0x4f11('0x4c')](handleError(_0x3b9dca,null));};exports[_0x4f11('0x53')]=function(_0x20be85,_0x2be8c9){return db[_0x4f11('0x49')]['create'](_0x20be85[_0x4f11('0x54')],{})[_0x4f11('0x2b')](function(_0x5a0ebd){var _0x3cb292=_0x20be85[_0x4f11('0x55')]['get']({'plain':!![]});if(!_0x3cb292)throw new Error(_0x4f11('0x56'));if(_0x3cb292[_0x4f11('0x57')]===_0x4f11('0x55')){var _0x4f409c=_0x5a0ebd['get']({'plain':!![]});var _0x209919=_0x4f11('0x2e');return db[_0x4f11('0x58')][_0x4f11('0x52')]({'where':{'name':_0x209919,'userProfileId':_0x3cb292['userProfileId']},'raw':!![]})[_0x4f11('0x2b')](function(_0x2db49c){if(_0x2db49c&&_0x2db49c[_0x4f11('0x59')]===0x0){return db[_0x4f11('0x2f')][_0x4f11('0x53')]({'name':_0x4f409c[_0x4f11('0x33')],'resourceId':_0x4f409c['id'],'type':_0x2db49c[_0x4f11('0x33')],'sectionId':_0x2db49c['id']},{})[_0x4f11('0x2b')](function(){return _0x5a0ebd;});}else{return _0x5a0ebd;}})[_0x4f11('0x4c')](function(_0x5cc853){logger[_0x4f11('0x31')](_0x4f11('0x5a'),_0x5cc853);throw _0x5cc853;});}return _0x5a0ebd;})[_0x4f11('0x2b')](respondWithResult(_0x2be8c9,0xc9))[_0x4f11('0x4c')](handleError(_0x2be8c9,null));};exports['update']=function(_0x25df1d,_0x59bc1b){if(_0x25df1d[_0x4f11('0x54')]['id']){delete _0x25df1d[_0x4f11('0x54')]['id'];}return db[_0x4f11('0x49')][_0x4f11('0x52')]({'where':{'id':_0x25df1d[_0x4f11('0x4e')]['id']}})[_0x4f11('0x2b')](handleEntityNotFound(_0x59bc1b,null))[_0x4f11('0x2b')](saveUpdates(_0x25df1d[_0x4f11('0x54')],null))['then'](respondWithResult(_0x59bc1b,null))[_0x4f11('0x4c')](handleError(_0x59bc1b,null));};exports[_0x4f11('0x2c')]=function(_0x2e2054,_0x5eee79){return db[_0x4f11('0x49')][_0x4f11('0x52')]({'where':{'id':_0x2e2054['params']['id']}})[_0x4f11('0x2b')](handleEntityNotFound(_0x5eee79,null))[_0x4f11('0x2b')](removeEntity(_0x5eee79,null))[_0x4f11('0x4c')](handleError(_0x5eee79,null));};exports[_0x4f11('0x5b')]=function(_0x2977a7,_0x241f36,_0x2361be){return db['SquareProject'][_0x4f11('0x52')]({'where':{'id':_0x2977a7[_0x4f11('0x4e')]['id']}})[_0x4f11('0x2b')](handleEntityNotFound(_0x241f36,null))[_0x4f11('0x2b')](function(_0x1b25c8){if(_0x1b25c8){return _0x1b25c8[_0x4f11('0x5b')](_0x2977a7[_0x4f11('0x54')][_0x4f11('0x5c')],_[_0x4f11('0x5d')](_0x2977a7['body'],[_0x4f11('0x5c'),'id'])||{});}})[_0x4f11('0x2b')](respondWithResult(_0x241f36,null))[_0x4f11('0x4c')](handleError(_0x241f36,null));};exports[_0x4f11('0x5e')]=function(_0xaaff28,_0x40267a,_0xaf7a75){return db[_0x4f11('0x49')][_0x4f11('0x52')]({'where':{'id':_0xaaff28['params']['id']}})[_0x4f11('0x2b')](handleEntityNotFound(_0x40267a,null))['then'](function(_0x5ee0dc){if(_0x5ee0dc){return _0x5ee0dc[_0x4f11('0x5e')](_0xaaff28[_0x4f11('0x3b')][_0x4f11('0x5c')])['then'](function(){if(_['isArray'](_0xaaff28[_0x4f11('0x3b')][_0x4f11('0x5c')])){for(var _0x4a3ddc=0x0;_0x4a3ddc<_0xaaff28[_0x4f11('0x3b')][_0x4f11('0x5c')][_0x4f11('0x3f')];_0x4a3ddc+=0x1){socket['emit'](_0x4f11('0x5f'),{'UserId':Number(_0xaaff28[_0x4f11('0x3b')]['ids'][_0x4a3ddc]),'SquareProjectId':Number(_0xaaff28[_0x4f11('0x4e')]['id'])});}}else{socket[_0x4f11('0x60')](_0x4f11('0x5f'),{'UserId':Number(_0xaaff28[_0x4f11('0x3b')][_0x4f11('0x5c')]),'SquareProjectId':Number(_0xaaff28[_0x4f11('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x40267a,null))[_0x4f11('0x4c')](handleError(_0x40267a,null));};exports['getUsers']=function(_0x52bc79,_0x50d033,_0x2575cc){var _0x46a086={};var _0x3704ec={};var _0x217e94;var _0x52ad9d;return db[_0x4f11('0x49')]['findOne']({'where':{'id':_0x52bc79[_0x4f11('0x4e')]['id']}})[_0x4f11('0x2b')](handleEntityNotFound(_0x50d033,null))['then'](function(_0x3e57e5){if(_0x3e57e5){_0x217e94=_0x3e57e5;_0x3704ec['model']=_['keys'](db[_0x4f11('0x61')]['rawAttributes']);_0x3704ec['query']=_[_0x4f11('0x4f')](_0x52bc79['query']);_0x3704ec[_0x4f11('0x43')]=_['intersection'](_0x3704ec[_0x4f11('0x3a')],_0x3704ec[_0x4f11('0x3b')]);_0x46a086[_0x4f11('0x3d')]=_[_0x4f11('0x3c')](_0x3704ec[_0x4f11('0x3a')],qs[_0x4f11('0x3e')](_0x52bc79[_0x4f11('0x3b')]['fields']));_0x46a086[_0x4f11('0x3d')]=_0x46a086[_0x4f11('0x3d')][_0x4f11('0x3f')]?_0x46a086[_0x4f11('0x3d')]:_0x3704ec[_0x4f11('0x3a')];_0x46a086['order']=qs[_0x4f11('0x41')](_0x52bc79['query'][_0x4f11('0x41')]);_0x46a086[_0x4f11('0x42')]=qs[_0x4f11('0x43')](_[_0x4f11('0x62')](_0x52bc79['query'],_0x3704ec[_0x4f11('0x43')]));if(_0x52bc79[_0x4f11('0x3b')][_0x4f11('0x44')]){_0x46a086['where']=_[_0x4f11('0x45')](_0x46a086['where'],{'$or':_[_0x4f11('0x36')](_0x46a086['attributes'],function(_0x3af9c2){var _0x1f3275={};_0x1f3275[_0x3af9c2]={'$like':'%'+_0x52bc79[_0x4f11('0x3b')][_0x4f11('0x44')]+'%'};return _0x1f3275;})});}_0x46a086=_[_0x4f11('0x45')]({},_0x46a086,_0x52bc79['options']);return _0x217e94[_0x4f11('0x63')](_0x46a086);}})[_0x4f11('0x2b')](function(_0x1bd9c2){if(_0x1bd9c2){_0x52ad9d=_0x1bd9c2['length'];if(!_0x52bc79[_0x4f11('0x3b')][_0x4f11('0x64')](_0x4f11('0x40'))){_0x46a086[_0x4f11('0x26')]=qs[_0x4f11('0x26')](_0x52bc79['query'][_0x4f11('0x26')]);_0x46a086['offset']=qs[_0x4f11('0x24')](_0x52bc79[_0x4f11('0x3b')][_0x4f11('0x24')]);}return _0x217e94[_0x4f11('0x63')](_0x46a086);}})['then'](function(_0xae41b3){if(_0xae41b3){return _0xae41b3?{'count':_0x52ad9d,'rows':_0xae41b3}:null;}})[_0x4f11('0x2b')](respondWithResult(_0x50d033,null))[_0x4f11('0x4c')](handleError(_0x50d033,null));}; \ No newline at end of file +var _0xc496=['Content-Range','apply','reject','update','then','destroy','get','SquareProjects','UserProfileResource','end','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./squareProject.socket','register','sendStatus','status','json','undefined','limit','count','offset','set'];(function(_0x4c8f16,_0x183b7c){var _0x579088=function(_0xccbfc2){while(--_0xccbfc2){_0x4c8f16['push'](_0x4c8f16['shift']());}};_0x579088(++_0x183b7c);}(_0xc496,0x1c2));var _0x6c49=function(_0x363b81,_0x81e6ca){_0x363b81=_0x363b81-0x0;var _0x1d92fb=_0xc496[_0x363b81];return _0x1d92fb;};'use strict';var emlformat=require(_0x6c49('0x0'));var rimraf=require(_0x6c49('0x1'));var zipdir=require(_0x6c49('0x2'));var jsonpatch=require(_0x6c49('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6c49('0x4'));var Mustache=require('mustache');var util=require(_0x6c49('0x5'));var path=require(_0x6c49('0x6'));var sox=require('sox');var csv=require(_0x6c49('0x7'));var ejs=require(_0x6c49('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c49('0x9'));var squel=require(_0x6c49('0xa'));var crypto=require(_0x6c49('0xb'));var jsforce=require(_0x6c49('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6c49('0x7'));var querystring=require(_0x6c49('0xd'));var Papa=require(_0x6c49('0xe'));var Redis=require(_0x6c49('0xf'));var authService=require(_0x6c49('0x10'));var qs=require(_0x6c49('0x11'));var as=require(_0x6c49('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6c49('0x13'))(_0x6c49('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6c49('0x15'));var db=require(_0x6c49('0x16'))['db'];config[_0x6c49('0x17')]=_['defaults'](config[_0x6c49('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x6c49('0x18'))(new Redis(config[_0x6c49('0x17')]));require(_0x6c49('0x19'))[_0x6c49('0x1a')](socket);function respondWithStatusCode(_0x2f7dd9,_0x5e1f9f){_0x5e1f9f=_0x5e1f9f||0xcc;return function(_0x40432f){if(_0x40432f){return _0x2f7dd9[_0x6c49('0x1b')](_0x5e1f9f);}return _0x2f7dd9[_0x6c49('0x1c')](_0x5e1f9f)['end']();};}function respondWithResult(_0x4b08f9,_0x4104f2){_0x4104f2=_0x4104f2||0xc8;return function(_0x2d59b1){if(_0x2d59b1){return _0x4b08f9[_0x6c49('0x1c')](_0x4104f2)[_0x6c49('0x1d')](_0x2d59b1);}};}function respondWithFilteredResult(_0x4966a7,_0x53b686){return function(_0x579652){if(_0x579652){var _0x24999e=typeof _0x53b686['offset']===_0x6c49('0x1e')&&typeof _0x53b686[_0x6c49('0x1f')]===_0x6c49('0x1e');var _0x258627=_0x579652[_0x6c49('0x20')];var _0x23f330=_0x24999e?0x0:_0x53b686[_0x6c49('0x21')];var _0x1ce8ab=_0x24999e?_0x579652[_0x6c49('0x20')]:_0x53b686[_0x6c49('0x21')]+_0x53b686[_0x6c49('0x1f')];var _0x5aa283;if(_0x1ce8ab>=_0x258627){_0x1ce8ab=_0x258627;_0x5aa283=0xc8;}else{_0x5aa283=0xce;}_0x4966a7[_0x6c49('0x1c')](_0x5aa283);return _0x4966a7[_0x6c49('0x22')](_0x6c49('0x23'),_0x23f330+'-'+_0x1ce8ab+'/'+_0x258627)['json'](_0x579652);}return null;};}function patchUpdates(_0x3b631a){return function(_0x292876){try{jsonpatch[_0x6c49('0x24')](_0x292876,_0x3b631a,!![]);}catch(_0x59298d){return BPromise[_0x6c49('0x25')](_0x59298d);}return _0x292876['save']();};}function saveUpdates(_0x1f065e,_0xa312b9){return function(_0x32f651){if(_0x32f651){return _0x32f651[_0x6c49('0x26')](_0x1f065e)[_0x6c49('0x27')](function(_0x2bb6c4){return _0x2bb6c4;});}return null;};}function removeEntity(_0x356262,_0x3aa9f1){return function(_0x64f277){if(_0x64f277){return _0x64f277[_0x6c49('0x28')]()[_0x6c49('0x27')](function(){var _0x12426f=_0x64f277[_0x6c49('0x29')]({'plain':!![]});var _0x2217ca=_0x6c49('0x2a');return db[_0x6c49('0x2b')][_0x6c49('0x28')]({'where':{'type':_0x2217ca,'resourceId':_0x12426f['id']}})[_0x6c49('0x27')](function(){return _0x64f277;});})[_0x6c49('0x27')](function(){_0x356262[_0x6c49('0x1c')](0xcc)[_0x6c49('0x2c')]();});}};}function handleEntityNotFound(_0x197401,_0xa3012b){return function(_0x5d3537){if(!_0x5d3537){_0x197401[_0x6c49('0x1b')](0x194);}return _0x5d3537;};}function handleError(_0x56d6ca,_0x29ab81){_0x29ab81=_0x29ab81||0x1f4;return function(_0x37c97e){logger[_0x6c49('0x2d')](_0x37c97e[_0x6c49('0x2e')]);if(_0x37c97e[_0x6c49('0x2f')]){delete _0x37c97e['name'];}_0x56d6ca[_0x6c49('0x1c')](_0x29ab81)[_0x6c49('0x30')](_0x37c97e);};}exports[_0x6c49('0x31')]=function(_0x388e1d,_0x4e0095){var _0x38431c={},_0x5d6dad={},_0x2a9971={'count':0x0,'rows':[]};var _0x3442fb=_[_0x6c49('0x32')](db[_0x6c49('0x33')][_0x6c49('0x34')],function(_0x377149){return{'name':_0x377149[_0x6c49('0x35')],'type':_0x377149[_0x6c49('0x36')]['key']};});_0x5d6dad[_0x6c49('0x37')]=_['map'](_0x3442fb,_0x6c49('0x2f'));_0x5d6dad[_0x6c49('0x38')]=_[_0x6c49('0x39')](_0x388e1d[_0x6c49('0x38')]);_0x5d6dad['filters']=_[_0x6c49('0x3a')](_0x5d6dad[_0x6c49('0x37')],_0x5d6dad[_0x6c49('0x38')]);_0x38431c[_0x6c49('0x3b')]=_[_0x6c49('0x3a')](_0x5d6dad[_0x6c49('0x37')],qs[_0x6c49('0x3c')](_0x388e1d[_0x6c49('0x38')][_0x6c49('0x3c')]));_0x38431c[_0x6c49('0x3b')]=_0x38431c[_0x6c49('0x3b')][_0x6c49('0x3d')]?_0x38431c[_0x6c49('0x3b')]:_0x5d6dad[_0x6c49('0x37')];if(!_0x388e1d[_0x6c49('0x38')][_0x6c49('0x3e')]('nolimit')){_0x38431c[_0x6c49('0x1f')]=qs[_0x6c49('0x1f')](_0x388e1d['query'][_0x6c49('0x1f')]);_0x38431c[_0x6c49('0x21')]=qs[_0x6c49('0x21')](_0x388e1d[_0x6c49('0x38')]['offset']);}_0x38431c[_0x6c49('0x3f')]=qs[_0x6c49('0x40')](_0x388e1d[_0x6c49('0x38')][_0x6c49('0x40')]);_0x38431c[_0x6c49('0x41')]=qs[_0x6c49('0x42')](_[_0x6c49('0x43')](_0x388e1d['query'],_0x5d6dad[_0x6c49('0x42')]),_0x3442fb);if(_0x388e1d[_0x6c49('0x38')][_0x6c49('0x44')]){_0x38431c['where']=_[_0x6c49('0x45')](_0x38431c[_0x6c49('0x41')],{'$or':_[_0x6c49('0x32')](_0x3442fb,function(_0x10ef50){if(_0x10ef50[_0x6c49('0x36')]!==_0x6c49('0x46')){var _0x4bfac3={};_0x4bfac3[_0x10ef50[_0x6c49('0x2f')]]={'$like':'%'+_0x388e1d[_0x6c49('0x38')][_0x6c49('0x44')]+'%'};return _0x4bfac3;}})});}_0x38431c=_[_0x6c49('0x45')]({},_0x38431c,_0x388e1d[_0x6c49('0x47')]);var _0x434235={'where':_0x38431c[_0x6c49('0x41')]};return db[_0x6c49('0x33')][_0x6c49('0x20')](_0x434235)[_0x6c49('0x27')](function(_0x589b59){_0x2a9971['count']=_0x589b59;if(_0x388e1d[_0x6c49('0x38')][_0x6c49('0x48')]){_0x38431c['include']=[{'all':!![]}];}return db[_0x6c49('0x33')][_0x6c49('0x49')](_0x38431c);})[_0x6c49('0x27')](function(_0x4eefc1){_0x2a9971[_0x6c49('0x4a')]=_0x4eefc1;return _0x2a9971;})['then'](respondWithFilteredResult(_0x4e0095,_0x38431c))['catch'](handleError(_0x4e0095,null));};exports[_0x6c49('0x4b')]=function(_0x314584,_0x38d446){var _0x47086a={'raw':![],'where':{'id':_0x314584[_0x6c49('0x4c')]['id']}},_0x5bcb31={};_0x5bcb31[_0x6c49('0x37')]=_[_0x6c49('0x39')](db[_0x6c49('0x33')][_0x6c49('0x34')]);_0x5bcb31[_0x6c49('0x38')]=_[_0x6c49('0x39')](_0x314584[_0x6c49('0x38')]);_0x5bcb31['filters']=_[_0x6c49('0x3a')](_0x5bcb31[_0x6c49('0x37')],_0x5bcb31[_0x6c49('0x38')]);_0x47086a[_0x6c49('0x3b')]=_[_0x6c49('0x3a')](_0x5bcb31[_0x6c49('0x37')],qs['fields'](_0x314584[_0x6c49('0x38')][_0x6c49('0x3c')]));_0x47086a['attributes']=_0x47086a['attributes'][_0x6c49('0x3d')]?_0x47086a[_0x6c49('0x3b')]:_0x5bcb31[_0x6c49('0x37')];if(_0x314584[_0x6c49('0x38')]['includeAll']){_0x47086a[_0x6c49('0x4d')]=[{'all':!![]}];}_0x47086a=_[_0x6c49('0x45')]({},_0x47086a,_0x314584[_0x6c49('0x47')]);return db[_0x6c49('0x33')][_0x6c49('0x4e')](_0x47086a)['then'](handleEntityNotFound(_0x38d446,null))[_0x6c49('0x27')](respondWithResult(_0x38d446,null))[_0x6c49('0x4f')](handleError(_0x38d446,null));};exports[_0x6c49('0x50')]=function(_0x3d4d77,_0x175cc1){return db['SquareProject']['create'](_0x3d4d77[_0x6c49('0x51')],{})[_0x6c49('0x27')](function(_0x19bf5c){var _0x146fc5=_0x3d4d77[_0x6c49('0x52')][_0x6c49('0x29')]({'plain':!![]});if(!_0x146fc5)throw new Error(_0x6c49('0x53'));if(_0x146fc5['role']===_0x6c49('0x52')){var _0x1a6dc4=_0x19bf5c['get']({'plain':!![]});var _0x1f9b02=_0x6c49('0x2a');return db[_0x6c49('0x54')]['find']({'where':{'name':_0x1f9b02,'userProfileId':_0x146fc5[_0x6c49('0x55')]},'raw':!![]})[_0x6c49('0x27')](function(_0x2a36fb){if(_0x2a36fb&&_0x2a36fb[_0x6c49('0x56')]===0x0){return db[_0x6c49('0x2b')][_0x6c49('0x50')]({'name':_0x1a6dc4[_0x6c49('0x2f')],'resourceId':_0x1a6dc4['id'],'type':_0x2a36fb['name'],'sectionId':_0x2a36fb['id']},{})['then'](function(){return _0x19bf5c;});}else{return _0x19bf5c;}})[_0x6c49('0x4f')](function(_0x464685){logger[_0x6c49('0x2d')](_0x6c49('0x57'),_0x464685);throw _0x464685;});}return _0x19bf5c;})[_0x6c49('0x27')](respondWithResult(_0x175cc1,0xc9))['catch'](handleError(_0x175cc1,null));};exports['update']=function(_0x469d80,_0x4418a2){if(_0x469d80[_0x6c49('0x51')]['id']){delete _0x469d80[_0x6c49('0x51')]['id'];}return db[_0x6c49('0x33')][_0x6c49('0x4e')]({'where':{'id':_0x469d80[_0x6c49('0x4c')]['id']}})[_0x6c49('0x27')](handleEntityNotFound(_0x4418a2,null))[_0x6c49('0x27')](saveUpdates(_0x469d80[_0x6c49('0x51')],null))[_0x6c49('0x27')](respondWithResult(_0x4418a2,null))['catch'](handleError(_0x4418a2,null));};exports['destroy']=function(_0x334da4,_0x15bb20){return db[_0x6c49('0x33')]['find']({'where':{'id':_0x334da4[_0x6c49('0x4c')]['id']}})['then'](handleEntityNotFound(_0x15bb20,null))[_0x6c49('0x27')](removeEntity(_0x15bb20,null))[_0x6c49('0x4f')](handleError(_0x15bb20,null));};exports[_0x6c49('0x58')]=function(_0x83faa0,_0x54c6af,_0x173385){return db[_0x6c49('0x33')]['find']({'where':{'id':_0x83faa0[_0x6c49('0x4c')]['id']}})[_0x6c49('0x27')](handleEntityNotFound(_0x54c6af,null))[_0x6c49('0x27')](function(_0x7a20cc){if(_0x7a20cc){return _0x7a20cc[_0x6c49('0x58')](_0x83faa0[_0x6c49('0x51')][_0x6c49('0x59')],_[_0x6c49('0x5a')](_0x83faa0[_0x6c49('0x51')],[_0x6c49('0x59'),'id'])||{});}})[_0x6c49('0x27')](respondWithResult(_0x54c6af,null))[_0x6c49('0x4f')](handleError(_0x54c6af,null));};exports['removeUsers']=function(_0x2e23d5,_0x20c0f3,_0x15562a){return db[_0x6c49('0x33')][_0x6c49('0x4e')]({'where':{'id':_0x2e23d5[_0x6c49('0x4c')]['id']}})['then'](handleEntityNotFound(_0x20c0f3,null))[_0x6c49('0x27')](function(_0x417c04){if(_0x417c04){return _0x417c04[_0x6c49('0x5b')](_0x2e23d5[_0x6c49('0x38')][_0x6c49('0x59')])['then'](function(){if(_[_0x6c49('0x5c')](_0x2e23d5[_0x6c49('0x38')][_0x6c49('0x59')])){for(var _0xe37dbf=0x0;_0xe37dbf<_0x2e23d5['query'][_0x6c49('0x59')][_0x6c49('0x3d')];_0xe37dbf+=0x1){socket[_0x6c49('0x5d')](_0x6c49('0x5e'),{'UserId':Number(_0x2e23d5[_0x6c49('0x38')]['ids'][_0xe37dbf]),'SquareProjectId':Number(_0x2e23d5[_0x6c49('0x4c')]['id'])});}}else{socket[_0x6c49('0x5d')](_0x6c49('0x5e'),{'UserId':Number(_0x2e23d5[_0x6c49('0x38')][_0x6c49('0x59')]),'SquareProjectId':Number(_0x2e23d5[_0x6c49('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x20c0f3,null))[_0x6c49('0x4f')](handleError(_0x20c0f3,null));};exports['getUsers']=function(_0x2cd9d6,_0x208bc4,_0x3a2289){var _0x92918e={};var _0x5d8013={};var _0x347af9;var _0x5f5d2f;return db[_0x6c49('0x33')]['findOne']({'where':{'id':_0x2cd9d6['params']['id']}})[_0x6c49('0x27')](handleEntityNotFound(_0x208bc4,null))['then'](function(_0x579a51){if(_0x579a51){_0x347af9=_0x579a51;_0x5d8013[_0x6c49('0x37')]=_[_0x6c49('0x39')](db['User'][_0x6c49('0x34')]);_0x5d8013['query']=_['keys'](_0x2cd9d6[_0x6c49('0x38')]);_0x5d8013['filters']=_[_0x6c49('0x3a')](_0x5d8013[_0x6c49('0x37')],_0x5d8013[_0x6c49('0x38')]);_0x92918e[_0x6c49('0x3b')]=_[_0x6c49('0x3a')](_0x5d8013[_0x6c49('0x37')],qs[_0x6c49('0x3c')](_0x2cd9d6[_0x6c49('0x38')][_0x6c49('0x3c')]));_0x92918e[_0x6c49('0x3b')]=_0x92918e[_0x6c49('0x3b')][_0x6c49('0x3d')]?_0x92918e['attributes']:_0x5d8013[_0x6c49('0x37')];_0x92918e[_0x6c49('0x3f')]=qs['sort'](_0x2cd9d6[_0x6c49('0x38')][_0x6c49('0x40')]);_0x92918e[_0x6c49('0x41')]=qs[_0x6c49('0x42')](_['pick'](_0x2cd9d6[_0x6c49('0x38')],_0x5d8013[_0x6c49('0x42')]));if(_0x2cd9d6[_0x6c49('0x38')]['filter']){_0x92918e[_0x6c49('0x41')]=_[_0x6c49('0x45')](_0x92918e[_0x6c49('0x41')],{'$or':_[_0x6c49('0x32')](_0x92918e[_0x6c49('0x3b')],function(_0x53be80){var _0x405575={};_0x405575[_0x53be80]={'$like':'%'+_0x2cd9d6[_0x6c49('0x38')]['filter']+'%'};return _0x405575;})});}_0x92918e=_['merge']({},_0x92918e,_0x2cd9d6[_0x6c49('0x47')]);return _0x347af9[_0x6c49('0x5f')](_0x92918e);}})[_0x6c49('0x27')](function(_0x46d2b0){if(_0x46d2b0){_0x5f5d2f=_0x46d2b0[_0x6c49('0x3d')];if(!_0x2cd9d6[_0x6c49('0x38')][_0x6c49('0x3e')](_0x6c49('0x60'))){_0x92918e[_0x6c49('0x1f')]=qs[_0x6c49('0x1f')](_0x2cd9d6[_0x6c49('0x38')]['limit']);_0x92918e[_0x6c49('0x21')]=qs[_0x6c49('0x21')](_0x2cd9d6[_0x6c49('0x38')][_0x6c49('0x21')]);}return _0x347af9['getUsers'](_0x92918e);}})['then'](function(_0x1d0fb0){if(_0x1d0fb0){return _0x1d0fb0?{'count':_0x5f5d2f,'rows':_0x1d0fb0}:null;}})['then'](respondWithResult(_0x208bc4,null))['catch'](handleError(_0x208bc4,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index a04fdad..ec62d6c 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 _0xbe45=['../../mysqldb','SquareProject','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe45,0x1d3));var _0x5be4=function(_0x4cdab1,_0x1d31f9){_0x4cdab1=_0x4cdab1-0x0;var _0x21ecfa=_0xbe45[_0x4cdab1];return _0x21ecfa;};'use strict';var EventEmitter=require(_0x5be4('0x0'));var SquareProject=require(_0x5be4('0x1'))['db'][_0x5be4('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x5be4('0x3')](0x0);var events={'afterCreate':_0x5be4('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2c01fe){return function(_0x46289a,_0x177ccc,_0x484e82){SquareProjectEvents['emit'](_0x2c01fe+':'+_0x46289a['id'],_0x46289a);SquareProjectEvents[_0x5be4('0x5')](_0x2c01fe,_0x46289a);_0x484e82(null);};}for(var e in events){if(events[_0x5be4('0x6')](e)){var event=events[e];SquareProject[_0x5be4('0x7')](e,emitEvent(event));}}module[_0x5be4('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x5ebb=['events','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4d9825,_0x5abdbc){var _0x204124=function(_0x2b6948){while(--_0x2b6948){_0x4d9825['push'](_0x4d9825['shift']());}};_0x204124(++_0x5abdbc);}(_0x5ebb,0x140));var _0xb5eb=function(_0x264de4,_0x41f555){_0x264de4=_0x264de4-0x0;var _0x4e004e=_0x5ebb[_0x264de4];return _0x4e004e;};'use strict';var EventEmitter=require(_0xb5eb('0x0'));var SquareProject=require('../../mysqldb')['db'][_0xb5eb('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb5eb('0x2')](0x0);var events={'afterCreate':_0xb5eb('0x3'),'afterUpdate':_0xb5eb('0x4'),'afterDestroy':_0xb5eb('0x5')};function emitEvent(_0x1629c1){return function(_0x3a3c6a,_0x39be1d,_0x3f21ed){SquareProjectEvents[_0xb5eb('0x6')](_0x1629c1+':'+_0x3a3c6a['id'],_0x3a3c6a);SquareProjectEvents[_0xb5eb('0x6')](_0x1629c1,_0x3a3c6a);_0x3f21ed(null);};}for(var e in events){if(events[_0xb5eb('0x7')](e)){var event=events[e];SquareProject[_0xb5eb('0x8')](e,emitEvent(event));}}module[_0xb5eb('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 156f13a..0740016 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 _0x3604=['format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./squareProject.attributes','exports','define','SquareProject','changed','preproduction','savedAt'];(function(_0x1c15bd,_0x388725){var _0x131df4=function(_0x2ce780){while(--_0x2ce780){_0x1c15bd['push'](_0x1c15bd['shift']());}};_0x131df4(++_0x388725);}(_0x3604,0x123));var _0x4360=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3604[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4360('0x0'));var util=require(_0x4360('0x1'));var logger=require('../../config/logger')(_0x4360('0x2'));var moment=require(_0x4360('0x3'));var BPromise=require(_0x4360('0x4'));var rp=require(_0x4360('0x5'));var fs=require('fs');var path=require(_0x4360('0x6'));var rimraf=require(_0x4360('0x7'));var config=require('../../config/environment');var attributes=require(_0x4360('0x8'));module[_0x4360('0x9')]=function(_0x3d3b38,_0x37e4eb){return _0x3d3b38[_0x4360('0xa')](_0x4360('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4004c3,_0x4fe70a,_0x54bfb9){if(_0x4004c3[_0x4360('0xc')](_0x4360('0xd'))){_0x4004c3[_0x4360('0xe')]=moment()[_0x4360('0xf')](_0x4360('0x10'));}if(_0x4004c3[_0x4360('0xc')]('production')){_0x4004c3[_0x4360('0x11')]=moment()['format'](_0x4360('0x10'));}_0x54bfb9(null,_0x4004c3);}}});}; \ No newline at end of file +var _0xb3ab=['../../config/logger','api','moment','rimraf','../../config/environment','exports','define','SquareProject','changed','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','format','lodash','util'];(function(_0x31929f,_0x16d825){var _0xb9aba8=function(_0x430f0f){while(--_0x430f0f){_0x31929f['push'](_0x31929f['shift']());}};_0xb9aba8(++_0x16d825);}(_0xb3ab,0x166));var _0xbb3a=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0xb3ab[_0x46a38b];return _0x346e75;};'use strict';var _=require(_0xbb3a('0x0'));var util=require(_0xbb3a('0x1'));var logger=require(_0xbb3a('0x2'))(_0xbb3a('0x3'));var moment=require(_0xbb3a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbb3a('0x5'));var config=require(_0xbb3a('0x6'));var attributes=require('./squareProject.attributes');module[_0xbb3a('0x7')]=function(_0x304a88,_0x4b042d){return _0x304a88[_0xbb3a('0x8')](_0xbb3a('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x50968a,_0x1bd84f,_0x22325d){if(_0x50968a[_0xbb3a('0xa')]('preproduction')){_0x50968a[_0xbb3a('0xb')]=moment()['format'](_0xbb3a('0xc'));}if(_0x50968a['changed'](_0xbb3a('0xd'))){_0x50968a['publishedAt']=moment()[_0xbb3a('0xe')](_0xbb3a('0xc'));}_0x22325d(null,_0x50968a);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index e648a45..ceeed0d 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 _0x9b85=['where','attributes','include','model','map','then','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./squareProject.socket','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSquareProject','SquareProject','find','options'];(function(_0x53f234,_0x5ae08d){var _0x1ebfe3=function(_0x25eba3){while(--_0x25eba3){_0x53f234['push'](_0x53f234['shift']());}};_0x1ebfe3(++_0x5ae08d);}(_0x9b85,0x1e2));var _0x59b8=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x9b85[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x59b8('0x0'));var moment=require(_0x59b8('0x1'));var BPromise=require(_0x59b8('0x2'));var rs=require(_0x59b8('0x3'));var fs=require('fs');var Redis=require(_0x59b8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x59b8('0x5'));var logger=require(_0x59b8('0x6'))('rpc');var config=require(_0x59b8('0x7'));var jayson=require(_0x59b8('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x59b8('0x9')],{'host':_0x59b8('0xa'),'port':0x18eb});var socket=require(_0x59b8('0xb'))(new Redis(config[_0x59b8('0x9')]));require(_0x59b8('0xc'))['register'](socket);function respondWithRpcPromise(_0x490795,_0x2d8847,_0xb07c7c){return new BPromise(function(_0x3eb9a7,_0x3cbf63){return client[_0x59b8('0xd')](_0x490795,_0xb07c7c)['then'](function(_0x29a3c8){logger[_0x59b8('0xe')](_0x59b8('0xf'),_0x2d8847,_0x59b8('0x10'));logger[_0x59b8('0x11')](_0x59b8('0x12'),_0x2d8847,_0x59b8('0x10'),JSON[_0x59b8('0x13')](_0x29a3c8));if(_0x29a3c8[_0x59b8('0x14')]){if(_0x29a3c8[_0x59b8('0x14')]['code']===0x1f4){logger[_0x59b8('0x14')](_0x59b8('0xf'),_0x2d8847,_0x29a3c8['error'][_0x59b8('0x15')]);return _0x3cbf63(_0x29a3c8[_0x59b8('0x14')][_0x59b8('0x15')]);}logger[_0x59b8('0x14')](_0x59b8('0xf'),_0x2d8847,_0x29a3c8['error'][_0x59b8('0x15')]);return _0x3eb9a7(_0x29a3c8['error'][_0x59b8('0x15')]);}else{logger[_0x59b8('0xe')](_0x59b8('0xf'),_0x2d8847,_0x59b8('0x10'));_0x3eb9a7(_0x29a3c8[_0x59b8('0x16')][_0x59b8('0x15')]);}})[_0x59b8('0x17')](function(_0x4ba772){logger[_0x59b8('0x14')](_0x59b8('0xf'),_0x2d8847,_0x4ba772);_0x3cbf63(_0x4ba772);});});}exports[_0x59b8('0x18')]=function(_0x2e0299){var _0x33b783=this;return new Promise(function(_0x46dd8c,_0x4d4328){return db[_0x59b8('0x19')][_0x59b8('0x1a')]({'raw':_0x2e0299[_0x59b8('0x1b')]?_0x2e0299['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e0299[_0x59b8('0x1b')]?_0x2e0299[_0x59b8('0x1b')][_0x59b8('0x1c')]||null:null,'attributes':_0x2e0299[_0x59b8('0x1b')]?_0x2e0299[_0x59b8('0x1b')][_0x59b8('0x1d')]||null:null,'include':_0x2e0299[_0x59b8('0x1b')]?_0x2e0299['options'][_0x59b8('0x1e')]?_['map'](_0x2e0299[_0x59b8('0x1b')][_0x59b8('0x1e')],function(_0x3d2e6a){return{'model':db[_0x3d2e6a[_0x59b8('0x1f')]],'as':_0x3d2e6a['as'],'attributes':_0x3d2e6a[_0x59b8('0x1d')],'include':_0x3d2e6a['include']?_['map'](_0x3d2e6a[_0x59b8('0x1e')],function(_0x472f5a){return{'model':db[_0x472f5a[_0x59b8('0x1f')]],'as':_0x472f5a['as'],'attributes':_0x472f5a[_0x59b8('0x1d')],'include':_0x472f5a[_0x59b8('0x1e')]?_[_0x59b8('0x20')](_0x472f5a[_0x59b8('0x1e')],function(_0x9d8f12){return{'model':db[_0x9d8f12[_0x59b8('0x1f')]],'as':_0x9d8f12['as'],'attributes':_0x9d8f12[_0x59b8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x59b8('0x21')](function(_0x500554){logger[_0x59b8('0xe')](_0x59b8('0x18'),_0x2e0299);logger['debug'](_0x59b8('0x18'),_0x2e0299,JSON[_0x59b8('0x13')](_0x500554));_0x46dd8c(_0x500554);})['catch'](function(_0x416813){logger[_0x59b8('0x14')](_0x59b8('0x18'),_0x416813[_0x59b8('0x15')],_0x2e0299);_0x4d4328(_0x33b783['error'](0x1f4,_0x416813['message']));});});}; \ No newline at end of file +var _0x7786=['ShowSquareProject','options','raw','attributes','include','map','model','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x31827b,_0x4b721e){var _0x23bfe3=function(_0x3f895b){while(--_0x3f895b){_0x31827b['push'](_0x31827b['shift']());}};_0x23bfe3(++_0x4b721e);}(_0x7786,0x8c));var _0x6778=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7786[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6778('0x0'));var util=require(_0x6778('0x1'));var moment=require('moment');var BPromise=require(_0x6778('0x2'));var rs=require(_0x6778('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6778('0x4'))['db'];var utils=require(_0x6778('0x5'));var logger=require('../../config/logger')(_0x6778('0x6'));var config=require(_0x6778('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6778('0x8')][_0x6778('0x9')]({'port':0x232a});config[_0x6778('0xa')]=_[_0x6778('0xb')](config['redis'],{'host':_0x6778('0xc'),'port':0x18eb});var socket=require(_0x6778('0xd'))(new Redis(config[_0x6778('0xa')]));require(_0x6778('0xe'))[_0x6778('0xf')](socket);function respondWithRpcPromise(_0x4aa5cc,_0x890514,_0x41b998){return new BPromise(function(_0x4ea462,_0x4716ee){return client[_0x6778('0x10')](_0x4aa5cc,_0x41b998)['then'](function(_0x4780bc){logger[_0x6778('0x11')](_0x6778('0x12'),_0x890514,_0x6778('0x13'));logger['debug'](_0x6778('0x14'),_0x890514,_0x6778('0x13'),JSON[_0x6778('0x15')](_0x4780bc));if(_0x4780bc[_0x6778('0x16')]){if(_0x4780bc[_0x6778('0x16')]['code']===0x1f4){logger[_0x6778('0x16')](_0x6778('0x12'),_0x890514,_0x4780bc['error'][_0x6778('0x17')]);return _0x4716ee(_0x4780bc[_0x6778('0x16')][_0x6778('0x17')]);}logger[_0x6778('0x16')](_0x6778('0x12'),_0x890514,_0x4780bc['error'][_0x6778('0x17')]);return _0x4ea462(_0x4780bc[_0x6778('0x16')][_0x6778('0x17')]);}else{logger[_0x6778('0x11')](_0x6778('0x12'),_0x890514,_0x6778('0x13'));_0x4ea462(_0x4780bc['result']['message']);}})[_0x6778('0x18')](function(_0x4a06dc){logger[_0x6778('0x16')](_0x6778('0x12'),_0x890514,_0x4a06dc);_0x4716ee(_0x4a06dc);});});}exports[_0x6778('0x19')]=function(_0x41bedb){var _0xb4970b=this;return new Promise(function(_0x46a2b9,_0x1a298e){return db['SquareProject']['find']({'raw':_0x41bedb[_0x6778('0x1a')]?_0x41bedb[_0x6778('0x1a')][_0x6778('0x1b')]===undefined?!![]:![]:!![],'where':_0x41bedb[_0x6778('0x1a')]?_0x41bedb['options']['where']||null:null,'attributes':_0x41bedb[_0x6778('0x1a')]?_0x41bedb['options'][_0x6778('0x1c')]||null:null,'include':_0x41bedb[_0x6778('0x1a')]?_0x41bedb[_0x6778('0x1a')][_0x6778('0x1d')]?_[_0x6778('0x1e')](_0x41bedb[_0x6778('0x1a')]['include'],function(_0x3ff270){return{'model':db[_0x3ff270[_0x6778('0x1f')]],'as':_0x3ff270['as'],'attributes':_0x3ff270['attributes'],'include':_0x3ff270[_0x6778('0x1d')]?_[_0x6778('0x1e')](_0x3ff270['include'],function(_0x2ef50c){return{'model':db[_0x2ef50c[_0x6778('0x1f')]],'as':_0x2ef50c['as'],'attributes':_0x2ef50c[_0x6778('0x1c')],'include':_0x2ef50c[_0x6778('0x1d')]?_['map'](_0x2ef50c[_0x6778('0x1d')],function(_0x3a344b){return{'model':db[_0x3a344b[_0x6778('0x1f')]],'as':_0x3a344b['as'],'attributes':_0x3a344b[_0x6778('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b6157){logger[_0x6778('0x11')](_0x6778('0x19'),_0x41bedb);logger[_0x6778('0x20')]('ShowSquareProject',_0x41bedb,JSON['stringify'](_0x3b6157));_0x46a2b9(_0x3b6157);})[_0x6778('0x18')](function(_0x2d1c20){logger['error']('ShowSquareProject',_0x2d1c20[_0x6778('0x17')],_0x41bedb);_0x1a298e(_0xb4970b[_0x6778('0x16')](0x1f4,_0x2d1c20[_0x6778('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index cdfd0a2..40b17cb 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 _0x0b43=['squareProject:','./squareProject.events','remove','update','emit','register','length'];(function(_0x8ae98b,_0x155f88){var _0xc30bd4=function(_0x5ca462){while(--_0x5ca462){_0x8ae98b['push'](_0x8ae98b['shift']());}};_0xc30bd4(++_0x155f88);}(_0x0b43,0xa9));var _0x30b4=function(_0x4a3f34,_0x5deb51){_0x4a3f34=_0x4a3f34-0x0;var _0xa46cf7=_0x0b43[_0x4a3f34];return _0xa46cf7;};'use strict';var SquareProjectEvents=require(_0x30b4('0x0'));var events=['save',_0x30b4('0x1'),_0x30b4('0x2')];function createListener(_0x3a2246,_0x566347){return function(_0x1d650b){_0x566347[_0x30b4('0x3')](_0x3a2246,_0x1d650b);};}function removeListener(_0x528d47,_0x4a7ba6){return function(){SquareProjectEvents['removeListener'](_0x528d47,_0x4a7ba6);};}exports[_0x30b4('0x4')]=function(_0x43c397){for(var _0x3628be=0x0,_0x3f3422=events[_0x30b4('0x5')];_0x3628be<_0x3f3422;_0x3628be++){var _0x14be57=events[_0x3628be];var _0x1f4f21=createListener(_0x30b4('0x6')+_0x14be57,_0x43c397);SquareProjectEvents['on'](_0x14be57,_0x1f4f21);}}; \ No newline at end of file +var _0xdaa4=['remove','update','emit','removeListener','register','length','squareProject:','save'];(function(_0x28ebe1,_0x1dc95c){var _0x2f0e23=function(_0x602003){while(--_0x602003){_0x28ebe1['push'](_0x28ebe1['shift']());}};_0x2f0e23(++_0x1dc95c);}(_0xdaa4,0x147));var _0x4daa=function(_0x2e4eea,_0x5db9bf){_0x2e4eea=_0x2e4eea-0x0;var _0x3e5788=_0xdaa4[_0x2e4eea];return _0x3e5788;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x4daa('0x0'),_0x4daa('0x1'),_0x4daa('0x2')];function createListener(_0x295fc1,_0xc544a2){return function(_0x10e2a3){_0xc544a2[_0x4daa('0x3')](_0x295fc1,_0x10e2a3);};}function removeListener(_0x202536,_0x536e9a){return function(){SquareProjectEvents[_0x4daa('0x4')](_0x202536,_0x536e9a);};}exports[_0x4daa('0x5')]=function(_0x5ab046){for(var _0x307258=0x0,_0x3b1800=events[_0x4daa('0x6')];_0x307258<_0x3b1800;_0x307258++){var _0x38f6ad=events[_0x307258];var _0x289681=createListener(_0x4daa('0x7')+_0x38f6ad,_0x5ab046);SquareProjectEvents['on'](_0x38f6ad,_0x289681);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 25fd948..b3f2472 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 _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x4496be,_0x2053ee){var _0x31a26d=function(_0x282823){while(--_0x282823){_0x4496be['push'](_0x4496be['shift']());}};_0x31a26d(++_0x2053ee);}(_0x326f,0xd1));var _0xf326=function(_0x487711,_0x8845e2){_0x487711=_0x487711-0x0;var _0x398598=_0x326f[_0x487711];return _0x398598;};'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/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file +var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x552a86,_0x1da141){var _0x3e1e0e=function(_0x3b0c47){while(--_0x3b0c47){_0x552a86['push'](_0x552a86['shift']());}};_0x3e1e0e(++_0x1da141);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5a15f1,_0x2688f7){_0x5a15f1=_0x5a15f1-0x0;var _0x3c18e6=_0x1cb9[_0x5a15f1];return _0x3c18e6;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 9afba77..fa75d7f 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 _0xeec6=['sequelize','exports','STRING','getDataValue','savePath','lastIndexOf'];(function(_0x4f0a35,_0x3ddc41){var _0x71fbe3=function(_0x5b5598){while(--_0x5b5598){_0x4f0a35['push'](_0x4f0a35['shift']());}};_0x71fbe3(++_0x3ddc41);}(_0xeec6,0x1c2));var _0x6eec=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0xeec6[_0x581af1];return _0x54c22e;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'uniqueid':{'type':Sequelize[_0x6eec('0x2')]},'callerid':{'type':Sequelize[_0x6eec('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6eec('0x2')]},'extension':{'type':Sequelize[_0x6eec('0x2')]},'priority':{'type':Sequelize[_0x6eec('0x2')]},'accountcode':{'type':Sequelize[_0x6eec('0x2')]},'dnid':{'type':Sequelize[_0x6eec('0x2')]},'projectName':{'type':Sequelize[_0x6eec('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x6eec('0x2')]},'savePath':{'type':Sequelize[_0x6eec('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5a5e47='';var _0x1c810e=this[_0x6eec('0x3')](_0x6eec('0x4'));if(_0x1c810e){_0x5a5e47=_0x1c810e['substring'](_0x1c810e[_0x6eec('0x5')]('.'));}return _0x5a5e47;}}}; \ No newline at end of file +var _0xdbf5=['lastIndexOf','exports','STRING','VIRTUAL','savePath'];(function(_0x1fad26,_0x5ed1c8){var _0x202613=function(_0x1a7a76){while(--_0x1a7a76){_0x1fad26['push'](_0x1fad26['shift']());}};_0x202613(++_0x5ed1c8);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x32a17d,_0x5cee6e){_0x32a17d=_0x32a17d-0x0;var _0x157097=_0xdbf5[_0x32a17d];return _0x157097;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5dbf('0x1')]},'context':{'type':Sequelize[_0x5dbf('0x1')]},'extension':{'type':Sequelize[_0x5dbf('0x1')]},'priority':{'type':Sequelize[_0x5dbf('0x1')]},'accountcode':{'type':Sequelize[_0x5dbf('0x1')]},'dnid':{'type':Sequelize[_0x5dbf('0x1')]},'projectName':{'type':Sequelize[_0x5dbf('0x1')]},'saveName':{'type':Sequelize[_0x5dbf('0x1')]},'filename':{'type':Sequelize[_0x5dbf('0x1')]},'savePath':{'type':Sequelize[_0x5dbf('0x1')]},'format':{'type':Sequelize[_0x5dbf('0x2')],'get':function(){var _0x88128e='';var _0x93e657=this['getDataValue'](_0x5dbf('0x3'));if(_0x93e657){_0x88128e=_0x93e657['substring'](_0x93e657[_0x5dbf('0x4')]('.'));}return _0x88128e;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 56d404d..efd005a 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 _0xc232=['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/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','SquareRecording','findAll','rows','catch','keys','find','create','params','body','download','../../components/encryptor','type','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','.cypher','unlinkSync','end','eml-format','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x1cc328,_0x546f96){var _0x31e35b=function(_0x275be7){while(--_0x275be7){_0x1cc328['push'](_0x1cc328['shift']());}};_0x31e35b(++_0x546f96);}(_0xc232,0x1f4));var _0x2c23=function(_0x42afaa,_0xc98af3){_0x42afaa=_0x42afaa-0x0;var _0x18dc85=_0xc232[_0x42afaa];return _0x18dc85;};'use strict';var emlformat=require(_0x2c23('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2c23('0x1'));var jsonpatch=require(_0x2c23('0x2'));var rp=require('request-promise');var moment=require(_0x2c23('0x3'));var BPromise=require(_0x2c23('0x4'));var Mustache=require('mustache');var util=require(_0x2c23('0x5'));var path=require(_0x2c23('0x6'));var sox=require(_0x2c23('0x7'));var csv=require(_0x2c23('0x8'));var ejs=require(_0x2c23('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c23('0xa'));var squel=require(_0x2c23('0xb'));var crypto=require(_0x2c23('0xc'));var jsforce=require(_0x2c23('0xd'));var deskjs=require(_0x2c23('0xe'));var toCsv=require(_0x2c23('0x8'));var querystring=require(_0x2c23('0xf'));var Papa=require(_0x2c23('0x10'));var Redis=require('ioredis');var authService=require(_0x2c23('0x11'));var qs=require(_0x2c23('0x12'));var as=require(_0x2c23('0x13'));var hardwareService=require(_0x2c23('0x14'));var logger=require(_0x2c23('0x15'))(_0x2c23('0x16'));var utils=require('../../config/utils');var config=require(_0x2c23('0x17'));var licenseUtil=require(_0x2c23('0x18'));var db=require(_0x2c23('0x19'))['db'];function respondWithStatusCode(_0x4f83f2,_0x24acae){_0x24acae=_0x24acae||0xcc;return function(_0x2ea5bd){if(_0x2ea5bd){return _0x4f83f2[_0x2c23('0x1a')](_0x24acae);}return _0x4f83f2[_0x2c23('0x1b')](_0x24acae)['end']();};}function respondWithResult(_0x498a80,_0xb495f){_0xb495f=_0xb495f||0xc8;return function(_0xeb7d03){if(_0xeb7d03){return _0x498a80['status'](_0xb495f)['json'](_0xeb7d03);}};}function respondWithFilteredResult(_0x50a228,_0x5b2147){return function(_0x3fe968){if(_0x3fe968){var _0x38c5df=typeof _0x5b2147['offset']==='undefined'&&typeof _0x5b2147[_0x2c23('0x1c')]===_0x2c23('0x1d');var _0x7927c5=_0x3fe968[_0x2c23('0x1e')];var _0x13e52d=_0x38c5df?0x0:_0x5b2147[_0x2c23('0x1f')];var _0xbdac9d=_0x38c5df?_0x3fe968[_0x2c23('0x1e')]:_0x5b2147[_0x2c23('0x1f')]+_0x5b2147['limit'];var _0x4d5968;if(_0xbdac9d>=_0x7927c5){_0xbdac9d=_0x7927c5;_0x4d5968=0xc8;}else{_0x4d5968=0xce;}_0x50a228['status'](_0x4d5968);return _0x50a228[_0x2c23('0x20')](_0x2c23('0x21'),_0x13e52d+'-'+_0xbdac9d+'/'+_0x7927c5)[_0x2c23('0x22')](_0x3fe968);}return null;};}function patchUpdates(_0x3bdb10){return function(_0x52b9b3){try{jsonpatch[_0x2c23('0x23')](_0x52b9b3,_0x3bdb10,!![]);}catch(_0x5ccb0a){return BPromise['reject'](_0x5ccb0a);}return _0x52b9b3[_0x2c23('0x24')]();};}function saveUpdates(_0x497199,_0x3ed3c8){return function(_0x4215f7){if(_0x4215f7){return _0x4215f7[_0x2c23('0x25')](_0x497199)[_0x2c23('0x26')](function(_0x10c781){return _0x10c781;});}return null;};}function removeEntity(_0x24d054,_0x416591){return function(_0x127af4){if(_0x127af4){return _0x127af4[_0x2c23('0x27')]()[_0x2c23('0x26')](function(){_0x24d054[_0x2c23('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x165b92,_0x49892b){return function(_0x7d6f17){if(!_0x7d6f17){_0x165b92['sendStatus'](0x194);}return _0x7d6f17;};}function handleError(_0x3e4fd9,_0x29d342){_0x29d342=_0x29d342||0x1f4;return function(_0x4fcd19){logger[_0x2c23('0x28')](_0x4fcd19[_0x2c23('0x29')]);if(_0x4fcd19[_0x2c23('0x2a')]){delete _0x4fcd19[_0x2c23('0x2a')];}_0x3e4fd9['status'](_0x29d342)[_0x2c23('0x2b')](_0x4fcd19);};}exports['index']=function(_0x278077,_0x121670){var _0x373a4e={},_0x2c6e93={},_0x3b6250={'count':0x0,'rows':[]};var _0x164df1=_[_0x2c23('0x2c')](db['SquareRecording'][_0x2c23('0x2d')],function(_0x133f93){return{'name':_0x133f93[_0x2c23('0x2e')],'type':_0x133f93['type'][_0x2c23('0x2f')]};});_0x2c6e93[_0x2c23('0x30')]=_[_0x2c23('0x2c')](_0x164df1,_0x2c23('0x2a'));_0x2c6e93[_0x2c23('0x31')]=_['keys'](_0x278077['query']);_0x2c6e93[_0x2c23('0x32')]=_[_0x2c23('0x33')](_0x2c6e93[_0x2c23('0x30')],_0x2c6e93['query']);_0x373a4e[_0x2c23('0x34')]=_[_0x2c23('0x33')](_0x2c6e93[_0x2c23('0x30')],qs[_0x2c23('0x35')](_0x278077[_0x2c23('0x31')]['fields']));_0x373a4e[_0x2c23('0x34')]=_0x373a4e[_0x2c23('0x34')]['length']?_0x373a4e[_0x2c23('0x34')]:_0x2c6e93[_0x2c23('0x30')];if(!_0x278077[_0x2c23('0x31')][_0x2c23('0x36')](_0x2c23('0x37'))){_0x373a4e['limit']=qs[_0x2c23('0x1c')](_0x278077[_0x2c23('0x31')][_0x2c23('0x1c')]);_0x373a4e[_0x2c23('0x1f')]=qs['offset'](_0x278077[_0x2c23('0x31')][_0x2c23('0x1f')]);}_0x373a4e[_0x2c23('0x38')]=qs[_0x2c23('0x39')](_0x278077[_0x2c23('0x31')][_0x2c23('0x39')]);_0x373a4e[_0x2c23('0x3a')]=qs['filters'](_['pick'](_0x278077[_0x2c23('0x31')],_0x2c6e93['filters']),_0x164df1);if(_0x278077[_0x2c23('0x31')][_0x2c23('0x3b')]){_0x373a4e['where']=_[_0x2c23('0x3c')](_0x373a4e[_0x2c23('0x3a')],{'$or':_[_0x2c23('0x2c')](_0x164df1,function(_0x30d0b3){if(_0x30d0b3['type']!==_0x2c23('0x3d')){var _0x2d24b9={};_0x2d24b9[_0x30d0b3['name']]={'$like':'%'+_0x278077['query']['filter']+'%'};return _0x2d24b9;}})});}_0x373a4e=_[_0x2c23('0x3c')]({},_0x373a4e,_0x278077[_0x2c23('0x3e')]);var _0x3c8d9e={'where':_0x373a4e['where']};return db['SquareRecording']['count'](_0x3c8d9e)[_0x2c23('0x26')](function(_0x2a7063){_0x3b6250[_0x2c23('0x1e')]=_0x2a7063;if(_0x278077[_0x2c23('0x31')][_0x2c23('0x3f')]){_0x373a4e[_0x2c23('0x40')]=[{'all':!![]}];}return db[_0x2c23('0x41')][_0x2c23('0x42')](_0x373a4e);})['then'](function(_0x3ed605){_0x3b6250[_0x2c23('0x43')]=_0x3ed605;return _0x3b6250;})[_0x2c23('0x26')](respondWithFilteredResult(_0x121670,_0x373a4e))[_0x2c23('0x44')](handleError(_0x121670,null));};exports['show']=function(_0x51fe37,_0x3d13e0){var _0x3ef331={'raw':!![],'where':{'id':_0x51fe37['params']['id']}},_0x38cdde={};_0x38cdde[_0x2c23('0x30')]=_['keys'](db['SquareRecording'][_0x2c23('0x2d')]);_0x38cdde[_0x2c23('0x31')]=_[_0x2c23('0x45')](_0x51fe37['query']);_0x38cdde[_0x2c23('0x32')]=_[_0x2c23('0x33')](_0x38cdde[_0x2c23('0x30')],_0x38cdde[_0x2c23('0x31')]);_0x3ef331[_0x2c23('0x34')]=_[_0x2c23('0x33')](_0x38cdde[_0x2c23('0x30')],qs[_0x2c23('0x35')](_0x51fe37[_0x2c23('0x31')][_0x2c23('0x35')]));_0x3ef331[_0x2c23('0x34')]=_0x3ef331[_0x2c23('0x34')]['length']?_0x3ef331[_0x2c23('0x34')]:_0x38cdde[_0x2c23('0x30')];if(_0x51fe37['query'][_0x2c23('0x3f')]){_0x3ef331[_0x2c23('0x40')]=[{'all':!![]}];}_0x3ef331=_['merge']({},_0x3ef331,_0x51fe37[_0x2c23('0x3e')]);return db[_0x2c23('0x41')][_0x2c23('0x46')](_0x3ef331)[_0x2c23('0x26')](handleEntityNotFound(_0x3d13e0,null))['then'](respondWithResult(_0x3d13e0,null))[_0x2c23('0x44')](handleError(_0x3d13e0,null));};exports[_0x2c23('0x47')]=function(_0x3720f4,_0x191948){return db['SquareRecording'][_0x2c23('0x47')](_0x3720f4['body'],{})[_0x2c23('0x26')](respondWithResult(_0x191948,0xc9))[_0x2c23('0x44')](handleError(_0x191948,null));};exports['update']=function(_0x4e17f8,_0x6c491a){if(_0x4e17f8['body']['id']){delete _0x4e17f8['body']['id'];}return db[_0x2c23('0x41')]['find']({'where':{'id':_0x4e17f8[_0x2c23('0x48')]['id']}})['then'](handleEntityNotFound(_0x6c491a,null))[_0x2c23('0x26')](saveUpdates(_0x4e17f8[_0x2c23('0x49')],null))[_0x2c23('0x26')](respondWithResult(_0x6c491a,null))[_0x2c23('0x44')](handleError(_0x6c491a,null));};exports[_0x2c23('0x4a')]=function(_0x5e1130,_0x48848e,_0x246156){var _0x3874e2=require(_0x2c23('0x4b'));var _0x4663d5=![];var _0x11fa19={};if(_0x5e1130[_0x2c23('0x31')]['type']&&_0x5e1130[_0x2c23('0x31')][_0x2c23('0x4c')]===_0x2c23('0x4d')){_0x11fa19[_0x2c23('0x4d')]=_0x5e1130['params']['id'];}else{_0x11fa19['id']=_0x5e1130[_0x2c23('0x48')]['id'];}return db['SquareRecording']['find']({'where':_0x11fa19,'attributes':['id',_0x2c23('0x4e'),_0x2c23('0x4f')],'raw':!![]})[_0x2c23('0x26')](handleEntityNotFound(_0x48848e,null))[_0x2c23('0x26')](function(_0x3945e1){if(_0x3945e1){var _0x3f9dcb=_0x3945e1[_0x2c23('0x4e')];var _0x2b9ec8=util[_0x2c23('0x50')](_0x2c23('0x51'),_0x3f9dcb);if(fs[_0x2c23('0x52')](_0x2b9ec8)){_0x4663d5=!![];return _0x3874e2[_0x2c23('0x53')](_0x2b9ec8,_0x3f9dcb,config[_0x2c23('0x54')][_0x2c23('0x55')])['then'](function(){return _0x3945e1;});}return _0x3945e1;}})[_0x2c23('0x26')](function(_0x594e3d){if(_0x594e3d){var _0x4b572d=_0x594e3d[_0x2c23('0x4e')];if(!fs['existsSync'](_0x4b572d)){throw new db[(_0x2c23('0x56'))][(_0x2c23('0x57'))](_0x2c23('0x58'));}if(_0x594e3d[_0x2c23('0x4f')]){return _0x48848e[_0x2c23('0x4a')](_0x4b572d,_0x594e3d[_0x2c23('0x4f')]+path[_0x2c23('0x59')](_0x4b572d),function(){if(_0x4663d5){fs[_0x2c23('0x5a')](_0x4b572d);}});}else{return _0x48848e[_0x2c23('0x4a')](_0x4b572d,function(_0x3bf617){if(_0x4663d5){fs[_0x2c23('0x5a')](_0x4b572d);}});}}})[_0x2c23('0x44')](function(_0x2bbebf){if(_0x2bbebf[_0x2c23('0x5b')]==='SquareRecording\x20not\x20found'){_0x48848e[_0x2c23('0x1b')](0x194)['send'](_0x2c23('0x5c'));}else{return handleError(_0x48848e,null);}});};exports['destroy']=function(_0x117be9,_0x23d07a){return db[_0x2c23('0x41')][_0x2c23('0x46')]({'where':{'id':_0x117be9[_0x2c23('0x48')]['id']}})[_0x2c23('0x26')](function(_0x11867f){if(_[_0x2c23('0x5d')](_0x11867f)){throw new ReferenceError(_0x2c23('0x5e'));}return _0x11867f;})[_0x2c23('0x26')](function(_0x17d92e){var _0x4ab149=_0x17d92e['savePath'];logger['info'](_0x2c23('0x5f'),_0x4ab149);if(!_[_0x2c23('0x5d')](_0x17d92e['savePath'])&&fs[_0x2c23('0x52')](_0x4ab149)){logger[_0x2c23('0x60')](_0x2c23('0x61')+_0x4ab149+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x4ab149);}_0x4ab149=_0x4ab149+_0x2c23('0x62');if(!_[_0x2c23('0x5d')](_0x17d92e['savePath'])&&fs['existsSync'](_0x4ab149)){logger['info']('File:\x20\x22'+_0x4ab149+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x2c23('0x63')](_0x4ab149);}return _0x17d92e;})[_0x2c23('0x26')](function(_0x27d0aa){if(!_0x27d0aa)throw new InternalError();return _0x27d0aa[_0x2c23('0x27')]();})[_0x2c23('0x26')](function(){_0x23d07a[_0x2c23('0x1b')](0xcc)[_0x2c23('0x64')]();})[_0x2c23('0x44')](handleError(_0x23d07a,null));}; \ No newline at end of file +var _0xb513=['apply','reject','save','update','then','destroy','end','error','stack','name','send','index','SquareRecording','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','includeAll','include','rows','show','params','options','find','catch','body','download','../../components/encryptor','type','uniqueid','savePath','filename','format','decryptFile','existsSync','Sequelize','SquareRecording\x20not\x20found','extname','unlink','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x375099,_0x16e152){var _0x2f1d54=function(_0x37a778){while(--_0x37a778){_0x375099['push'](_0x375099['shift']());}};_0x2f1d54(++_0x16e152);}(_0xb513,0x150));var _0x3b51=function(_0x1d930e,_0x20d8b8){_0x1d930e=_0x1d930e-0x0;var _0x5bbd66=_0xb513[_0x1d930e];return _0x5bbd66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b51('0x0'));var zipdir=require(_0x3b51('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b51('0x2'));var moment=require(_0x3b51('0x3'));var BPromise=require(_0x3b51('0x4'));var Mustache=require(_0x3b51('0x5'));var util=require(_0x3b51('0x6'));var path=require(_0x3b51('0x7'));var sox=require(_0x3b51('0x8'));var csv=require('to-csv');var ejs=require(_0x3b51('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b51('0xa'));var squel=require(_0x3b51('0xb'));var crypto=require(_0x3b51('0xc'));var jsforce=require(_0x3b51('0xd'));var deskjs=require(_0x3b51('0xe'));var toCsv=require(_0x3b51('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3b51('0x10'));var qs=require(_0x3b51('0x11'));var as=require(_0x3b51('0x12'));var hardwareService=require(_0x3b51('0x13'));var logger=require(_0x3b51('0x14'))(_0x3b51('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3b51('0x16'));var db=require(_0x3b51('0x17'))['db'];function respondWithStatusCode(_0x8bbc0c,_0x49a79b){_0x49a79b=_0x49a79b||0xcc;return function(_0xd45158){if(_0xd45158){return _0x8bbc0c[_0x3b51('0x18')](_0x49a79b);}return _0x8bbc0c[_0x3b51('0x19')](_0x49a79b)['end']();};}function respondWithResult(_0x2d86e1,_0x4256b2){_0x4256b2=_0x4256b2||0xc8;return function(_0x56d78c){if(_0x56d78c){return _0x2d86e1[_0x3b51('0x19')](_0x4256b2)[_0x3b51('0x1a')](_0x56d78c);}};}function respondWithFilteredResult(_0x2f9240,_0x4a4b6f){return function(_0x54cf04){if(_0x54cf04){var _0x5b8b3b=typeof _0x4a4b6f[_0x3b51('0x1b')]===_0x3b51('0x1c')&&typeof _0x4a4b6f[_0x3b51('0x1d')]===_0x3b51('0x1c');var _0x5402eb=_0x54cf04[_0x3b51('0x1e')];var _0xb8acb0=_0x5b8b3b?0x0:_0x4a4b6f[_0x3b51('0x1b')];var _0x450fa6=_0x5b8b3b?_0x54cf04['count']:_0x4a4b6f[_0x3b51('0x1b')]+_0x4a4b6f[_0x3b51('0x1d')];var _0x2c3e33;if(_0x450fa6>=_0x5402eb){_0x450fa6=_0x5402eb;_0x2c3e33=0xc8;}else{_0x2c3e33=0xce;}_0x2f9240[_0x3b51('0x19')](_0x2c3e33);return _0x2f9240[_0x3b51('0x1f')]('Content-Range',_0xb8acb0+'-'+_0x450fa6+'/'+_0x5402eb)[_0x3b51('0x1a')](_0x54cf04);}return null;};}function patchUpdates(_0x2918d1){return function(_0x84299d){try{jsonpatch[_0x3b51('0x20')](_0x84299d,_0x2918d1,!![]);}catch(_0x113d60){return BPromise[_0x3b51('0x21')](_0x113d60);}return _0x84299d[_0x3b51('0x22')]();};}function saveUpdates(_0x39e91b,_0x215a94){return function(_0x715110){if(_0x715110){return _0x715110[_0x3b51('0x23')](_0x39e91b)[_0x3b51('0x24')](function(_0x2ab1e2){return _0x2ab1e2;});}return null;};}function removeEntity(_0x3968f9,_0x258a5a){return function(_0x2737a0){if(_0x2737a0){return _0x2737a0[_0x3b51('0x25')]()[_0x3b51('0x24')](function(){_0x3968f9['status'](0xcc)[_0x3b51('0x26')]();});}};}function handleEntityNotFound(_0x3ad8db,_0x48ff6b){return function(_0x5264c8){if(!_0x5264c8){_0x3ad8db['sendStatus'](0x194);}return _0x5264c8;};}function handleError(_0x45e31d,_0x4a9ff3){_0x4a9ff3=_0x4a9ff3||0x1f4;return function(_0x3fbe36){logger[_0x3b51('0x27')](_0x3fbe36[_0x3b51('0x28')]);if(_0x3fbe36[_0x3b51('0x29')]){delete _0x3fbe36[_0x3b51('0x29')];}_0x45e31d[_0x3b51('0x19')](_0x4a9ff3)[_0x3b51('0x2a')](_0x3fbe36);};}exports[_0x3b51('0x2b')]=function(_0x36f801,_0x473a41){var _0x3778df={},_0x443843={},_0x346767={'count':0x0,'rows':[]};var _0x5b9c3d=_['map'](db[_0x3b51('0x2c')][_0x3b51('0x2d')],function(_0x546414){return{'name':_0x546414[_0x3b51('0x2e')],'type':_0x546414['type'][_0x3b51('0x2f')]};});_0x443843[_0x3b51('0x30')]=_[_0x3b51('0x31')](_0x5b9c3d,_0x3b51('0x29'));_0x443843['query']=_[_0x3b51('0x32')](_0x36f801[_0x3b51('0x33')]);_0x443843[_0x3b51('0x34')]=_[_0x3b51('0x35')](_0x443843[_0x3b51('0x30')],_0x443843[_0x3b51('0x33')]);_0x3778df['attributes']=_[_0x3b51('0x35')](_0x443843['model'],qs[_0x3b51('0x36')](_0x36f801[_0x3b51('0x33')]['fields']));_0x3778df[_0x3b51('0x37')]=_0x3778df['attributes'][_0x3b51('0x38')]?_0x3778df[_0x3b51('0x37')]:_0x443843['model'];if(!_0x36f801[_0x3b51('0x33')]['hasOwnProperty'](_0x3b51('0x39'))){_0x3778df[_0x3b51('0x1d')]=qs['limit'](_0x36f801[_0x3b51('0x33')]['limit']);_0x3778df[_0x3b51('0x1b')]=qs[_0x3b51('0x1b')](_0x36f801[_0x3b51('0x33')]['offset']);}_0x3778df[_0x3b51('0x3a')]=qs[_0x3b51('0x3b')](_0x36f801[_0x3b51('0x33')][_0x3b51('0x3b')]);_0x3778df[_0x3b51('0x3c')]=qs[_0x3b51('0x34')](_[_0x3b51('0x3d')](_0x36f801[_0x3b51('0x33')],_0x443843[_0x3b51('0x34')]),_0x5b9c3d);if(_0x36f801[_0x3b51('0x33')][_0x3b51('0x3e')]){_0x3778df[_0x3b51('0x3c')]=_['merge'](_0x3778df[_0x3b51('0x3c')],{'$or':_['map'](_0x5b9c3d,function(_0x580e37){if(_0x580e37['type']!=='VIRTUAL'){var _0x296b0f={};_0x296b0f[_0x580e37[_0x3b51('0x29')]]={'$like':'%'+_0x36f801['query']['filter']+'%'};return _0x296b0f;}})});}_0x3778df=_['merge']({},_0x3778df,_0x36f801['options']);var _0x165a7e={'where':_0x3778df[_0x3b51('0x3c')]};return db[_0x3b51('0x2c')][_0x3b51('0x1e')](_0x165a7e)[_0x3b51('0x24')](function(_0x51c70f){_0x346767['count']=_0x51c70f;if(_0x36f801[_0x3b51('0x33')][_0x3b51('0x3f')]){_0x3778df[_0x3b51('0x40')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x3778df);})[_0x3b51('0x24')](function(_0x2359f8){_0x346767[_0x3b51('0x41')]=_0x2359f8;return _0x346767;})[_0x3b51('0x24')](respondWithFilteredResult(_0x473a41,_0x3778df))['catch'](handleError(_0x473a41,null));};exports[_0x3b51('0x42')]=function(_0x306766,_0x59c4e7){var _0x10ce87={'raw':!![],'where':{'id':_0x306766[_0x3b51('0x43')]['id']}},_0x5ea6a1={};_0x5ea6a1[_0x3b51('0x30')]=_[_0x3b51('0x32')](db[_0x3b51('0x2c')][_0x3b51('0x2d')]);_0x5ea6a1['query']=_[_0x3b51('0x32')](_0x306766[_0x3b51('0x33')]);_0x5ea6a1[_0x3b51('0x34')]=_[_0x3b51('0x35')](_0x5ea6a1['model'],_0x5ea6a1[_0x3b51('0x33')]);_0x10ce87[_0x3b51('0x37')]=_[_0x3b51('0x35')](_0x5ea6a1[_0x3b51('0x30')],qs[_0x3b51('0x36')](_0x306766[_0x3b51('0x33')][_0x3b51('0x36')]));_0x10ce87[_0x3b51('0x37')]=_0x10ce87['attributes'][_0x3b51('0x38')]?_0x10ce87[_0x3b51('0x37')]:_0x5ea6a1['model'];if(_0x306766[_0x3b51('0x33')][_0x3b51('0x3f')]){_0x10ce87['include']=[{'all':!![]}];}_0x10ce87=_['merge']({},_0x10ce87,_0x306766[_0x3b51('0x44')]);return db[_0x3b51('0x2c')][_0x3b51('0x45')](_0x10ce87)[_0x3b51('0x24')](handleEntityNotFound(_0x59c4e7,null))[_0x3b51('0x24')](respondWithResult(_0x59c4e7,null))[_0x3b51('0x46')](handleError(_0x59c4e7,null));};exports['create']=function(_0x2ac9af,_0x40a4a0){return db[_0x3b51('0x2c')]['create'](_0x2ac9af['body'],{})[_0x3b51('0x24')](respondWithResult(_0x40a4a0,0xc9))[_0x3b51('0x46')](handleError(_0x40a4a0,null));};exports['update']=function(_0x1f67d9,_0x57ba4c){if(_0x1f67d9[_0x3b51('0x47')]['id']){delete _0x1f67d9[_0x3b51('0x47')]['id'];}return db[_0x3b51('0x2c')][_0x3b51('0x45')]({'where':{'id':_0x1f67d9[_0x3b51('0x43')]['id']}})['then'](handleEntityNotFound(_0x57ba4c,null))[_0x3b51('0x24')](saveUpdates(_0x1f67d9[_0x3b51('0x47')],null))['then'](respondWithResult(_0x57ba4c,null))[_0x3b51('0x46')](handleError(_0x57ba4c,null));};exports[_0x3b51('0x48')]=function(_0x1ee3b9,_0x24350c,_0x2e2bda){var _0x278364=require(_0x3b51('0x49'));var _0x150b8b=![];var _0x33c3a1={};if(_0x1ee3b9[_0x3b51('0x33')][_0x3b51('0x4a')]&&_0x1ee3b9[_0x3b51('0x33')][_0x3b51('0x4a')]==='uniqueid'){_0x33c3a1[_0x3b51('0x4b')]=_0x1ee3b9[_0x3b51('0x43')]['id'];}else{_0x33c3a1['id']=_0x1ee3b9[_0x3b51('0x43')]['id'];}return db[_0x3b51('0x2c')][_0x3b51('0x45')]({'where':_0x33c3a1,'attributes':['id',_0x3b51('0x4c'),_0x3b51('0x4d')],'raw':!![]})[_0x3b51('0x24')](handleEntityNotFound(_0x24350c,null))[_0x3b51('0x24')](function(_0x9eb35e){if(_0x9eb35e){var _0x4baa64=_0x9eb35e[_0x3b51('0x4c')];var _0x1c1775=util[_0x3b51('0x4e')]('%s.cypher',_0x4baa64);if(fs['existsSync'](_0x1c1775)){_0x150b8b=!![];return _0x278364[_0x3b51('0x4f')](_0x1c1775,_0x4baa64,config['secrets']['recording'])['then'](function(){return _0x9eb35e;});}return _0x9eb35e;}})[_0x3b51('0x24')](function(_0x1ba142){if(_0x1ba142){var _0x22da48=_0x1ba142[_0x3b51('0x4c')];if(!fs[_0x3b51('0x50')](_0x22da48)){throw new db[(_0x3b51('0x51'))]['ValidationError'](_0x3b51('0x52'));}if(_0x1ba142[_0x3b51('0x4d')]){return _0x24350c[_0x3b51('0x48')](_0x22da48,_0x1ba142[_0x3b51('0x4d')]+path[_0x3b51('0x53')](_0x22da48),function(){if(_0x150b8b){fs[_0x3b51('0x54')](_0x22da48);}});}else{return _0x24350c[_0x3b51('0x48')](_0x22da48,function(_0x3f399b){if(_0x150b8b){fs[_0x3b51('0x54')](_0x22da48);}});}}})[_0x3b51('0x46')](function(_0x7f2aff){if(_0x7f2aff['message']===_0x3b51('0x52')){_0x24350c[_0x3b51('0x19')](0x194)[_0x3b51('0x2a')]('Not\x20found');}else{return handleError(_0x24350c,null);}});};exports[_0x3b51('0x25')]=function(_0x541a0e,_0x3981b0){return db['SquareRecording'][_0x3b51('0x45')]({'where':{'id':_0x541a0e['params']['id']}})[_0x3b51('0x24')](function(_0x1540db){if(_['isNil'](_0x1540db)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1540db;})[_0x3b51('0x24')](function(_0x1c9614){var _0x16adc4=_0x1c9614[_0x3b51('0x4c')];logger[_0x3b51('0x55')](_0x3b51('0x56'),_0x16adc4);if(!_[_0x3b51('0x57')](_0x1c9614[_0x3b51('0x4c')])&&fs[_0x3b51('0x50')](_0x16adc4)){logger[_0x3b51('0x55')](_0x3b51('0x58')+_0x16adc4+_0x3b51('0x59'));fs['unlinkSync'](_0x16adc4);}_0x16adc4=_0x16adc4+_0x3b51('0x5a');if(!_[_0x3b51('0x57')](_0x1c9614[_0x3b51('0x4c')])&&fs[_0x3b51('0x50')](_0x16adc4)){logger[_0x3b51('0x55')](_0x3b51('0x58')+_0x16adc4+_0x3b51('0x59'));fs[_0x3b51('0x5b')](_0x16adc4);}return _0x1c9614;})[_0x3b51('0x24')](function(_0x3d6875){if(!_0x3d6875)throw new InternalError();return _0x3d6875[_0x3b51('0x25')]();})[_0x3b51('0x24')](function(){_0x3981b0[_0x3b51('0x19')](0xcc)[_0x3b51('0x26')]();})[_0x3b51('0x46')](handleError(_0x3981b0,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 884196e..31d2fe4 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 _0xafb9=['request-promise','path','rimraf','exports','square_recordings','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4fe523,_0x301e2c){var _0x19ac45=function(_0x354a2c){while(--_0x354a2c){_0x4fe523['push'](_0x4fe523['shift']());}};_0x19ac45(++_0x301e2c);}(_0xafb9,0x68));var _0x9afb=function(_0x279e6d,_0x3e48b0){_0x279e6d=_0x279e6d-0x0;var _0x36ae3d=_0xafb9[_0x279e6d];return _0x36ae3d;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var logger=require(_0x9afb('0x2'))(_0x9afb('0x3'));var moment=require(_0x9afb('0x4'));var BPromise=require(_0x9afb('0x5'));var rp=require(_0x9afb('0x6'));var fs=require('fs');var path=require(_0x9afb('0x7'));var rimraf=require(_0x9afb('0x8'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module[_0x9afb('0x9')]=function(_0x56a139,_0x1ccf93){return _0x56a139['define']('SquareRecording',attributes,{'tableName':_0x9afb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d11=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','define','SquareRecording'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x1d11,0xb6));var _0x11d1=function(_0x46ea1b,_0x48ec3a){_0x46ea1b=_0x46ea1b-0x0;var _0x5c5532=_0x1d11[_0x46ea1b];return _0x5c5532;};'use strict';var _=require(_0x11d1('0x0'));var util=require(_0x11d1('0x1'));var logger=require(_0x11d1('0x2'))(_0x11d1('0x3'));var moment=require(_0x11d1('0x4'));var BPromise=require(_0x11d1('0x5'));var rp=require(_0x11d1('0x6'));var fs=require('fs');var path=require(_0x11d1('0x7'));var rimraf=require(_0x11d1('0x8'));var config=require(_0x11d1('0x9'));var attributes=require(_0x11d1('0xa'));module['exports']=function(_0x32d808,_0x4a9622){return _0x32d808[_0x11d1('0xb')](_0x11d1('0xc'),attributes,{'tableName':'square_recordings','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 2ea49cd..4a0effd 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 _0x0e02=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options'];(function(_0x12c6b5,_0x3ae8a5){var _0x44c9cf=function(_0x3d12b1){while(--_0x3d12b1){_0x12c6b5['push'](_0x12c6b5['shift']());}};_0x44c9cf(++_0x3ae8a5);}(_0x0e02,0x96));var _0x20e0=function(_0x1aa0c8,_0x67bd02){_0x1aa0c8=_0x1aa0c8-0x0;var _0x27074e=_0x0e02[_0x1aa0c8];return _0x27074e;};'use strict';var _=require(_0x20e0('0x0'));var util=require(_0x20e0('0x1'));var moment=require(_0x20e0('0x2'));var BPromise=require('bluebird');var rs=require(_0x20e0('0x3'));var fs=require('fs');var Redis=require(_0x20e0('0x4'));var db=require(_0x20e0('0x5'))['db'];var utils=require(_0x20e0('0x6'));var logger=require(_0x20e0('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x20e0('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45c8d4,_0x482d8d,_0x15b1d3){return new BPromise(function(_0xe872f,_0x425510){return client['request'](_0x45c8d4,_0x15b1d3)[_0x20e0('0x9')](function(_0x1db0e5){logger[_0x20e0('0xa')](_0x20e0('0xb'),_0x482d8d,_0x20e0('0xc'));logger[_0x20e0('0xd')](_0x20e0('0xe'),_0x482d8d,_0x20e0('0xc'),JSON[_0x20e0('0xf')](_0x1db0e5));if(_0x1db0e5[_0x20e0('0x10')]){if(_0x1db0e5[_0x20e0('0x10')]['code']===0x1f4){logger[_0x20e0('0x10')](_0x20e0('0xb'),_0x482d8d,_0x1db0e5[_0x20e0('0x10')][_0x20e0('0x11')]);return _0x425510(_0x1db0e5[_0x20e0('0x10')][_0x20e0('0x11')]);}logger[_0x20e0('0x10')](_0x20e0('0xb'),_0x482d8d,_0x1db0e5[_0x20e0('0x10')][_0x20e0('0x11')]);return _0xe872f(_0x1db0e5[_0x20e0('0x10')][_0x20e0('0x11')]);}else{logger[_0x20e0('0xa')]('SquareRecording,\x20%s,\x20%s',_0x482d8d,_0x20e0('0xc'));_0xe872f(_0x1db0e5[_0x20e0('0x12')][_0x20e0('0x11')]);}})[_0x20e0('0x13')](function(_0x43c5a4){logger[_0x20e0('0x10')](_0x20e0('0xb'),_0x482d8d,_0x43c5a4);_0x425510(_0x43c5a4);});});}exports[_0x20e0('0x14')]=function(_0x4aedfb){var _0x213dd2=this;return new Promise(function(_0x437fdf,_0x353725){return db[_0x20e0('0x15')][_0x20e0('0x16')](_0x4aedfb[_0x20e0('0x17')],{'raw':_0x4aedfb['options']?_0x4aedfb[_0x20e0('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x20e0('0x9')](function(_0xe08588){logger[_0x20e0('0xa')](_0x20e0('0x14'),_0x4aedfb);logger[_0x20e0('0xd')](_0x20e0('0x14'),_0x4aedfb,JSON[_0x20e0('0xf')](_0xe08588));_0x437fdf(_0xe08588);})[_0x20e0('0x13')](function(_0x3171ec){logger[_0x20e0('0x10')](_0x20e0('0x14'),_0x3171ec[_0x20e0('0x11')],_0x4aedfb);_0x353725(_0x213dd2['error'](0x1f4,_0x3171ec[_0x20e0('0x11')]));});});}; \ No newline at end of file +var _0x6da8=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','then','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','SquareRecording,\x20%s,\x20%s','message','info','result','catch','SquareRecording','create','body','options','raw','CreateSquareRecording','stringify','lodash','util','moment'];(function(_0x534c8f,_0x500079){var _0x5a57f5=function(_0x38ec0a){while(--_0x38ec0a){_0x534c8f['push'](_0x534c8f['shift']());}};_0x5a57f5(++_0x500079);}(_0x6da8,0x11f));var _0x86da=function(_0x380d53,_0x453fa0){_0x380d53=_0x380d53-0x0;var _0x49d517=_0x6da8[_0x380d53];return _0x49d517;};'use strict';var _=require(_0x86da('0x0'));var util=require(_0x86da('0x1'));var moment=require(_0x86da('0x2'));var BPromise=require(_0x86da('0x3'));var rs=require(_0x86da('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x86da('0x6'))(_0x86da('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x86da('0x8')][_0x86da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56497c,_0x1a8bfb,_0x210f79){return new BPromise(function(_0x152214,_0x38fe7e){return client[_0x86da('0xa')](_0x56497c,_0x210f79)[_0x86da('0xb')](function(_0x5aba7c){logger['info']('SquareRecording,\x20%s,\x20%s',_0x1a8bfb,_0x86da('0xc'));logger[_0x86da('0xd')](_0x86da('0xe'),_0x1a8bfb,_0x86da('0xc'),JSON['stringify'](_0x5aba7c));if(_0x5aba7c[_0x86da('0xf')]){if(_0x5aba7c[_0x86da('0xf')][_0x86da('0x10')]===0x1f4){logger['error'](_0x86da('0x11'),_0x1a8bfb,_0x5aba7c[_0x86da('0xf')][_0x86da('0x12')]);return _0x38fe7e(_0x5aba7c[_0x86da('0xf')][_0x86da('0x12')]);}logger[_0x86da('0xf')](_0x86da('0x11'),_0x1a8bfb,_0x5aba7c[_0x86da('0xf')][_0x86da('0x12')]);return _0x152214(_0x5aba7c[_0x86da('0xf')][_0x86da('0x12')]);}else{logger[_0x86da('0x13')]('SquareRecording,\x20%s,\x20%s',_0x1a8bfb,_0x86da('0xc'));_0x152214(_0x5aba7c[_0x86da('0x14')]['message']);}})[_0x86da('0x15')](function(_0x16752c){logger[_0x86da('0xf')]('SquareRecording,\x20%s,\x20%s',_0x1a8bfb,_0x16752c);_0x38fe7e(_0x16752c);});});}exports['CreateSquareRecording']=function(_0x59132c){var _0x43c71a=this;return new Promise(function(_0x9b8fda,_0x20e31f){return db[_0x86da('0x16')][_0x86da('0x17')](_0x59132c[_0x86da('0x18')],{'raw':_0x59132c[_0x86da('0x19')]?_0x59132c[_0x86da('0x19')][_0x86da('0x1a')]===undefined?!![]:![]:!![]})[_0x86da('0xb')](function(_0xc0248e){logger[_0x86da('0x13')](_0x86da('0x1b'),_0x59132c);logger[_0x86da('0xd')](_0x86da('0x1b'),_0x59132c,JSON[_0x86da('0x1c')](_0xc0248e));_0x9b8fda(_0xc0248e);})[_0x86da('0x15')](function(_0x1fd540){logger[_0x86da('0xf')](_0x86da('0x1b'),_0x1fd540[_0x86da('0x12')],_0x59132c);_0x20e31f(_0x43c71a[_0x86da('0xf')](0x1f4,_0x1fd540[_0x86da('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 2ec75d3..2fcb51d 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 _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x33af89,_0x35bdfd){var _0x2c20a2=function(_0x3077cc){while(--_0x3077cc){_0x33af89['push'](_0x33af89['shift']());}};_0x2c20a2(++_0x35bdfd);}(_0xe706,0xa3));var _0x6e70=function(_0x233811,_0x1283e9){_0x233811=_0x233811-0x0;var _0x292f41=_0xe706[_0x233811];return _0x292f41;};'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('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x2534a6,_0x1ac6d6){var _0x517d99=function(_0x4258ca){while(--_0x4258ca){_0x2534a6['push'](_0x2534a6['shift']());}};_0x517d99(++_0x1ac6d6);}(_0xe706,0xa3));var _0x6e70=function(_0x461935,_0xeaeb6e){_0x461935=_0x461935-0x0;var _0x1f809f=_0xe706[_0x461935];return _0x1f809f;};'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('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 814b364..a026f03 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 _0x5799=['DATE','BOOLEAN','sequelize','STRING'];(function(_0x39dcf5,_0x5dc0c8){var _0x385342=function(_0x56ad9c){while(--_0x56ad9c){_0x39dcf5['push'](_0x39dcf5['shift']());}};_0x385342(++_0x5dc0c8);}(_0x5799,0x152));var _0x9579=function(_0x10c025,_0x232f32){_0x10c025=_0x10c025-0x0;var _0x62292f=_0x5799[_0x10c025];return _0x62292f;};'use strict';var Sequelize=require(_0x9579('0x0'));module['exports']={'network':{'type':Sequelize[_0x9579('0x1')]},'network_script':{'type':Sequelize[_0x9579('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9579('0x1')]},'language':{'type':Sequelize[_0x9579('0x1')]},'type':{'type':Sequelize[_0x9579('0x1')]},'uniqueid':{'type':Sequelize[_0x9579('0x1')]},'version':{'type':Sequelize[_0x9579('0x1')]},'callerid':{'type':Sequelize[_0x9579('0x1')]},'calleridname':{'type':Sequelize[_0x9579('0x1')]},'callingpres':{'type':Sequelize[_0x9579('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x9579('0x1')]},'callingtns':{'type':Sequelize[_0x9579('0x1')]},'dnid':{'type':Sequelize[_0x9579('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9579('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9579('0x1')]},'enhanced':{'type':Sequelize[_0x9579('0x1')]},'accountcode':{'type':Sequelize[_0x9579('0x1')]},'threadid':{'type':Sequelize[_0x9579('0x1')]},'project_name':{'type':Sequelize[_0x9579('0x1')]},'joinAt':{'type':Sequelize[_0x9579('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x9579('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5254=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x5254,0xe4));var _0x4525=function(_0x54daa2,_0x48ca14){_0x54daa2=_0x54daa2-0x0;var _0x4a43d0=_0x5254[_0x54daa2];return _0x4a43d0;};'use strict';var Sequelize=require(_0x4525('0x0'));module[_0x4525('0x1')]={'network':{'type':Sequelize[_0x4525('0x2')]},'network_script':{'type':Sequelize[_0x4525('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4525('0x2')]},'language':{'type':Sequelize[_0x4525('0x2')]},'type':{'type':Sequelize[_0x4525('0x2')]},'uniqueid':{'type':Sequelize[_0x4525('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x4525('0x2')]},'callingani2':{'type':Sequelize[_0x4525('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x4525('0x2')]},'rdnis':{'type':Sequelize[_0x4525('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x4525('0x2')]},'priority':{'type':Sequelize[_0x4525('0x2')]},'enhanced':{'type':Sequelize[_0x4525('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x4525('0x2')]},'joinAt':{'type':Sequelize[_0x4525('0x3')]},'leaveAt':{'type':Sequelize[_0x4525('0x3')]},'bot':{'type':Sequelize[_0x4525('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 9430e3e..9623007 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 _0x2230=['Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','type','filter','merge','options','SquareReport','includeAll','include','rows','catch','show','params','intersection','create','body','find','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x2230,0x108));var _0x0223=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2230[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0223('0x0'));var rimraf=require(_0x0223('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0223('0x2'));var rp=require('request-promise');var moment=require(_0x0223('0x3'));var BPromise=require(_0x0223('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0223('0x5'));var sox=require(_0x0223('0x6'));var csv=require('to-csv');var ejs=require(_0x0223('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0223('0x8'));var squel=require(_0x0223('0x9'));var crypto=require(_0x0223('0xa'));var jsforce=require(_0x0223('0xb'));var deskjs=require(_0x0223('0xc'));var toCsv=require(_0x0223('0xd'));var querystring=require(_0x0223('0xe'));var Papa=require('papaparse');var Redis=require(_0x0223('0xf'));var authService=require(_0x0223('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0223('0x11'));var logger=require(_0x0223('0x12'))(_0x0223('0x13'));var utils=require(_0x0223('0x14'));var config=require(_0x0223('0x15'));var licenseUtil=require(_0x0223('0x16'));var db=require(_0x0223('0x17'))['db'];function respondWithStatusCode(_0x40b761,_0x3fa02e){_0x3fa02e=_0x3fa02e||0xcc;return function(_0x4ae832){if(_0x4ae832){return _0x40b761[_0x0223('0x18')](_0x3fa02e);}return _0x40b761[_0x0223('0x19')](_0x3fa02e)[_0x0223('0x1a')]();};}function respondWithResult(_0x1dc9d3,_0x59e3fe){_0x59e3fe=_0x59e3fe||0xc8;return function(_0x17f435){if(_0x17f435){return _0x1dc9d3['status'](_0x59e3fe)[_0x0223('0x1b')](_0x17f435);}};}function respondWithFilteredResult(_0x1e4653,_0x2fe8ed){return function(_0x61071f){if(_0x61071f){var _0x4f8af8=typeof _0x2fe8ed[_0x0223('0x1c')]==='undefined'&&typeof _0x2fe8ed[_0x0223('0x1d')]==='undefined';var _0x7be36a=_0x61071f[_0x0223('0x1e')];var _0x5ae29e=_0x4f8af8?0x0:_0x2fe8ed[_0x0223('0x1c')];var _0x343ae7=_0x4f8af8?_0x61071f[_0x0223('0x1e')]:_0x2fe8ed[_0x0223('0x1c')]+_0x2fe8ed['limit'];var _0x55864c;if(_0x343ae7>=_0x7be36a){_0x343ae7=_0x7be36a;_0x55864c=0xc8;}else{_0x55864c=0xce;}_0x1e4653['status'](_0x55864c);return _0x1e4653[_0x0223('0x1f')](_0x0223('0x20'),_0x5ae29e+'-'+_0x343ae7+'/'+_0x7be36a)[_0x0223('0x1b')](_0x61071f);}return null;};}function patchUpdates(_0x3190f7){return function(_0x537594){try{jsonpatch[_0x0223('0x21')](_0x537594,_0x3190f7,!![]);}catch(_0x411120){return BPromise[_0x0223('0x22')](_0x411120);}return _0x537594[_0x0223('0x23')]();};}function saveUpdates(_0x3c3ff3,_0x255f52){return function(_0xb36336){if(_0xb36336){return _0xb36336[_0x0223('0x24')](_0x3c3ff3)[_0x0223('0x25')](function(_0x2ed3fe){return _0x2ed3fe;});}return null;};}function removeEntity(_0x4b4bf6,_0x5598b7){return function(_0x1db6ce){if(_0x1db6ce){return _0x1db6ce[_0x0223('0x26')]()[_0x0223('0x25')](function(){_0x4b4bf6['status'](0xcc)[_0x0223('0x1a')]();});}};}function handleEntityNotFound(_0x3044f3,_0x1ddbce){return function(_0x4bef76){if(!_0x4bef76){_0x3044f3['sendStatus'](0x194);}return _0x4bef76;};}function handleError(_0x5ab257,_0x48ce6b){_0x48ce6b=_0x48ce6b||0x1f4;return function(_0x318e4c){logger['error'](_0x318e4c[_0x0223('0x27')]);if(_0x318e4c[_0x0223('0x28')]){delete _0x318e4c[_0x0223('0x28')];}_0x5ab257[_0x0223('0x19')](_0x48ce6b)[_0x0223('0x29')](_0x318e4c);};}exports[_0x0223('0x2a')]=function(_0x3aeada,_0x1d2e1d){var _0x271548={},_0x225b4f={},_0x240093={'count':0x0,'rows':[]};var _0x128ab5=_[_0x0223('0x2b')](db['SquareReport'][_0x0223('0x2c')],function(_0x1dc54e){return{'name':_0x1dc54e[_0x0223('0x2d')],'type':_0x1dc54e['type'][_0x0223('0x2e')]};});_0x225b4f['model']=_[_0x0223('0x2b')](_0x128ab5,'name');_0x225b4f[_0x0223('0x2f')]=_[_0x0223('0x30')](_0x3aeada['query']);_0x225b4f['filters']=_['intersection'](_0x225b4f[_0x0223('0x31')],_0x225b4f['query']);_0x271548[_0x0223('0x32')]=_['intersection'](_0x225b4f['model'],qs[_0x0223('0x33')](_0x3aeada['query'][_0x0223('0x33')]));_0x271548[_0x0223('0x32')]=_0x271548[_0x0223('0x32')][_0x0223('0x34')]?_0x271548[_0x0223('0x32')]:_0x225b4f[_0x0223('0x31')];if(!_0x3aeada['query'][_0x0223('0x35')](_0x0223('0x36'))){_0x271548['limit']=qs[_0x0223('0x1d')](_0x3aeada['query'][_0x0223('0x1d')]);_0x271548[_0x0223('0x1c')]=qs[_0x0223('0x1c')](_0x3aeada[_0x0223('0x2f')][_0x0223('0x1c')]);}_0x271548['order']=qs[_0x0223('0x37')](_0x3aeada[_0x0223('0x2f')][_0x0223('0x37')]);_0x271548[_0x0223('0x38')]=qs['filters'](_['pick'](_0x3aeada[_0x0223('0x2f')],_0x225b4f[_0x0223('0x39')]),_0x128ab5);if(_0x3aeada[_0x0223('0x2f')]['filter']){_0x271548[_0x0223('0x38')]=_['merge'](_0x271548[_0x0223('0x38')],{'$or':_[_0x0223('0x2b')](_0x128ab5,function(_0x524082){if(_0x524082[_0x0223('0x3a')]!=='VIRTUAL'){var _0x3110b9={};_0x3110b9[_0x524082[_0x0223('0x28')]]={'$like':'%'+_0x3aeada[_0x0223('0x2f')][_0x0223('0x3b')]+'%'};return _0x3110b9;}})});}_0x271548=_[_0x0223('0x3c')]({},_0x271548,_0x3aeada[_0x0223('0x3d')]);var _0x17946d={'where':_0x271548[_0x0223('0x38')]};return db[_0x0223('0x3e')][_0x0223('0x1e')](_0x17946d)[_0x0223('0x25')](function(_0xc59acb){_0x240093['count']=_0xc59acb;if(_0x3aeada[_0x0223('0x2f')][_0x0223('0x3f')]){_0x271548[_0x0223('0x40')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x271548);})[_0x0223('0x25')](function(_0x251526){_0x240093[_0x0223('0x41')]=_0x251526;return _0x240093;})[_0x0223('0x25')](respondWithFilteredResult(_0x1d2e1d,_0x271548))[_0x0223('0x42')](handleError(_0x1d2e1d,null));};exports[_0x0223('0x43')]=function(_0x410f3d,_0x83f63e){var _0x47d1fc={'raw':!![],'where':{'id':_0x410f3d[_0x0223('0x44')]['id']}},_0x25acda={};_0x25acda[_0x0223('0x31')]=_['keys'](db[_0x0223('0x3e')][_0x0223('0x2c')]);_0x25acda[_0x0223('0x2f')]=_['keys'](_0x410f3d[_0x0223('0x2f')]);_0x25acda['filters']=_['intersection'](_0x25acda[_0x0223('0x31')],_0x25acda[_0x0223('0x2f')]);_0x47d1fc[_0x0223('0x32')]=_[_0x0223('0x45')](_0x25acda[_0x0223('0x31')],qs[_0x0223('0x33')](_0x410f3d[_0x0223('0x2f')]['fields']));_0x47d1fc[_0x0223('0x32')]=_0x47d1fc['attributes']['length']?_0x47d1fc['attributes']:_0x25acda[_0x0223('0x31')];if(_0x410f3d['query'][_0x0223('0x3f')]){_0x47d1fc['include']=[{'all':!![]}];}_0x47d1fc=_['merge']({},_0x47d1fc,_0x410f3d[_0x0223('0x3d')]);return db[_0x0223('0x3e')]['find'](_0x47d1fc)[_0x0223('0x25')](handleEntityNotFound(_0x83f63e,null))[_0x0223('0x25')](respondWithResult(_0x83f63e,null))[_0x0223('0x42')](handleError(_0x83f63e,null));};exports[_0x0223('0x46')]=function(_0x304540,_0x254b7e){return db['SquareReport']['create'](_0x304540[_0x0223('0x47')],{})[_0x0223('0x25')](respondWithResult(_0x254b7e,0xc9))['catch'](handleError(_0x254b7e,null));};exports[_0x0223('0x24')]=function(_0x3e7234,_0x3e8b5b){if(_0x3e7234['body']['id']){delete _0x3e7234[_0x0223('0x47')]['id'];}return db['SquareReport'][_0x0223('0x48')]({'where':{'id':_0x3e7234[_0x0223('0x44')]['id']}})[_0x0223('0x25')](handleEntityNotFound(_0x3e8b5b,null))[_0x0223('0x25')](saveUpdates(_0x3e7234[_0x0223('0x47')],null))[_0x0223('0x25')](respondWithResult(_0x3e8b5b,null))[_0x0223('0x42')](handleError(_0x3e8b5b,null));};exports[_0x0223('0x26')]=function(_0xd147a1,_0x2488e0){return db['SquareReport'][_0x0223('0x48')]({'where':{'id':_0xd147a1[_0x0223('0x44')]['id']}})[_0x0223('0x25')](handleEntityNotFound(_0x2488e0,null))[_0x0223('0x25')](removeEntity(_0x2488e0,null))[_0x0223('0x42')](handleError(_0x2488e0,null));};exports[_0x0223('0x49')]=function(_0xe696fc,_0x10caca){return db[_0x0223('0x3e')][_0x0223('0x49')]()[_0x0223('0x25')](respondWithResult(_0x10caca,null))[_0x0223('0x42')](handleError(_0x10caca,null));}; \ No newline at end of file +var _0xcad5=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','json','apply','save','update','then','destroy','stack','name','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x106555,_0x504a05){var _0x1bff75=function(_0x558681){while(--_0x558681){_0x106555['push'](_0x106555['shift']());}};_0x1bff75(++_0x504a05);}(_0xcad5,0x86));var _0x5cad=function(_0x509695,_0x21d107){_0x509695=_0x509695-0x0;var _0x5e39bb=_0xcad5[_0x509695];return _0x5e39bb;};'use strict';var emlformat=require(_0x5cad('0x0'));var rimraf=require(_0x5cad('0x1'));var zipdir=require(_0x5cad('0x2'));var jsonpatch=require(_0x5cad('0x3'));var rp=require(_0x5cad('0x4'));var moment=require(_0x5cad('0x5'));var BPromise=require(_0x5cad('0x6'));var Mustache=require(_0x5cad('0x7'));var util=require(_0x5cad('0x8'));var path=require(_0x5cad('0x9'));var sox=require(_0x5cad('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5cad('0xb'));var _=require(_0x5cad('0xc'));var squel=require(_0x5cad('0xd'));var crypto=require('crypto');var jsforce=require(_0x5cad('0xe'));var deskjs=require(_0x5cad('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5cad('0x10'));var Papa=require(_0x5cad('0x11'));var Redis=require(_0x5cad('0x12'));var authService=require(_0x5cad('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5cad('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5cad('0x15'))(_0x5cad('0x16'));var utils=require(_0x5cad('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5cad('0x18'));var db=require(_0x5cad('0x19'))['db'];function respondWithStatusCode(_0x306f00,_0x1274c0){_0x1274c0=_0x1274c0||0xcc;return function(_0x1323c2){if(_0x1323c2){return _0x306f00[_0x5cad('0x1a')](_0x1274c0);}return _0x306f00[_0x5cad('0x1b')](_0x1274c0)[_0x5cad('0x1c')]();};}function respondWithResult(_0x5759e0,_0x17b4b6){_0x17b4b6=_0x17b4b6||0xc8;return function(_0x1e9ec5){if(_0x1e9ec5){return _0x5759e0[_0x5cad('0x1b')](_0x17b4b6)['json'](_0x1e9ec5);}};}function respondWithFilteredResult(_0x1456ec,_0x51ddcf){return function(_0x1f16ed){if(_0x1f16ed){var _0x4c7cda=typeof _0x51ddcf[_0x5cad('0x1d')]==='undefined'&&typeof _0x51ddcf[_0x5cad('0x1e')]===_0x5cad('0x1f');var _0x166558=_0x1f16ed[_0x5cad('0x20')];var _0x37c7ce=_0x4c7cda?0x0:_0x51ddcf[_0x5cad('0x1d')];var _0x4d9f1b=_0x4c7cda?_0x1f16ed[_0x5cad('0x20')]:_0x51ddcf[_0x5cad('0x1d')]+_0x51ddcf['limit'];var _0x55d7e9;if(_0x4d9f1b>=_0x166558){_0x4d9f1b=_0x166558;_0x55d7e9=0xc8;}else{_0x55d7e9=0xce;}_0x1456ec[_0x5cad('0x1b')](_0x55d7e9);return _0x1456ec['set']('Content-Range',_0x37c7ce+'-'+_0x4d9f1b+'/'+_0x166558)[_0x5cad('0x21')](_0x1f16ed);}return null;};}function patchUpdates(_0x1f6fd6){return function(_0x120b1c){try{jsonpatch[_0x5cad('0x22')](_0x120b1c,_0x1f6fd6,!![]);}catch(_0x1dc22b){return BPromise['reject'](_0x1dc22b);}return _0x120b1c[_0x5cad('0x23')]();};}function saveUpdates(_0x1618c2,_0x445599){return function(_0x59a033){if(_0x59a033){return _0x59a033[_0x5cad('0x24')](_0x1618c2)[_0x5cad('0x25')](function(_0x1e1646){return _0x1e1646;});}return null;};}function removeEntity(_0x2ecea8,_0x252e58){return function(_0x442e3a){if(_0x442e3a){return _0x442e3a[_0x5cad('0x26')]()[_0x5cad('0x25')](function(){_0x2ecea8[_0x5cad('0x1b')](0xcc)[_0x5cad('0x1c')]();});}};}function handleEntityNotFound(_0x55a52e,_0x59c502){return function(_0x2b03b4){if(!_0x2b03b4){_0x55a52e[_0x5cad('0x1a')](0x194);}return _0x2b03b4;};}function handleError(_0x540476,_0x795e61){_0x795e61=_0x795e61||0x1f4;return function(_0x1ec6e2){logger['error'](_0x1ec6e2[_0x5cad('0x27')]);if(_0x1ec6e2[_0x5cad('0x28')]){delete _0x1ec6e2[_0x5cad('0x28')];}_0x540476[_0x5cad('0x1b')](_0x795e61)['send'](_0x1ec6e2);};}exports[_0x5cad('0x29')]=function(_0xcaf286,_0x383912){var _0x3ca89c={},_0x13694d={},_0xc64ddf={'count':0x0,'rows':[]};var _0x5ea8f0=_[_0x5cad('0x2a')](db[_0x5cad('0x2b')][_0x5cad('0x2c')],function(_0x460f41){return{'name':_0x460f41[_0x5cad('0x2d')],'type':_0x460f41[_0x5cad('0x2e')][_0x5cad('0x2f')]};});_0x13694d[_0x5cad('0x30')]=_[_0x5cad('0x2a')](_0x5ea8f0,_0x5cad('0x28'));_0x13694d[_0x5cad('0x31')]=_[_0x5cad('0x32')](_0xcaf286['query']);_0x13694d['filters']=_[_0x5cad('0x33')](_0x13694d[_0x5cad('0x30')],_0x13694d['query']);_0x3ca89c['attributes']=_['intersection'](_0x13694d[_0x5cad('0x30')],qs['fields'](_0xcaf286[_0x5cad('0x31')][_0x5cad('0x34')]));_0x3ca89c[_0x5cad('0x35')]=_0x3ca89c[_0x5cad('0x35')][_0x5cad('0x36')]?_0x3ca89c[_0x5cad('0x35')]:_0x13694d['model'];if(!_0xcaf286['query'][_0x5cad('0x37')](_0x5cad('0x38'))){_0x3ca89c[_0x5cad('0x1e')]=qs[_0x5cad('0x1e')](_0xcaf286[_0x5cad('0x31')]['limit']);_0x3ca89c['offset']=qs[_0x5cad('0x1d')](_0xcaf286[_0x5cad('0x31')][_0x5cad('0x1d')]);}_0x3ca89c[_0x5cad('0x39')]=qs[_0x5cad('0x3a')](_0xcaf286[_0x5cad('0x31')][_0x5cad('0x3a')]);_0x3ca89c[_0x5cad('0x3b')]=qs[_0x5cad('0x3c')](_[_0x5cad('0x3d')](_0xcaf286[_0x5cad('0x31')],_0x13694d[_0x5cad('0x3c')]),_0x5ea8f0);if(_0xcaf286[_0x5cad('0x31')][_0x5cad('0x3e')]){_0x3ca89c[_0x5cad('0x3b')]=_[_0x5cad('0x3f')](_0x3ca89c[_0x5cad('0x3b')],{'$or':_['map'](_0x5ea8f0,function(_0x421638){if(_0x421638[_0x5cad('0x2e')]!=='VIRTUAL'){var _0x1822c8={};_0x1822c8[_0x421638['name']]={'$like':'%'+_0xcaf286[_0x5cad('0x31')][_0x5cad('0x3e')]+'%'};return _0x1822c8;}})});}_0x3ca89c=_[_0x5cad('0x3f')]({},_0x3ca89c,_0xcaf286[_0x5cad('0x40')]);var _0x2a8f7a={'where':_0x3ca89c['where']};return db[_0x5cad('0x2b')][_0x5cad('0x20')](_0x2a8f7a)[_0x5cad('0x25')](function(_0x4938d2){_0xc64ddf['count']=_0x4938d2;if(_0xcaf286[_0x5cad('0x31')][_0x5cad('0x41')]){_0x3ca89c['include']=[{'all':!![]}];}return db[_0x5cad('0x2b')][_0x5cad('0x42')](_0x3ca89c);})[_0x5cad('0x25')](function(_0x103ed8){_0xc64ddf[_0x5cad('0x43')]=_0x103ed8;return _0xc64ddf;})[_0x5cad('0x25')](respondWithFilteredResult(_0x383912,_0x3ca89c))[_0x5cad('0x44')](handleError(_0x383912,null));};exports[_0x5cad('0x45')]=function(_0x43964a,_0x500ae5){var _0x4db503={'raw':!![],'where':{'id':_0x43964a[_0x5cad('0x46')]['id']}},_0x272ea3={};_0x272ea3[_0x5cad('0x30')]=_[_0x5cad('0x32')](db[_0x5cad('0x2b')]['rawAttributes']);_0x272ea3[_0x5cad('0x31')]=_[_0x5cad('0x32')](_0x43964a[_0x5cad('0x31')]);_0x272ea3[_0x5cad('0x3c')]=_['intersection'](_0x272ea3[_0x5cad('0x30')],_0x272ea3[_0x5cad('0x31')]);_0x4db503[_0x5cad('0x35')]=_[_0x5cad('0x33')](_0x272ea3[_0x5cad('0x30')],qs[_0x5cad('0x34')](_0x43964a[_0x5cad('0x31')][_0x5cad('0x34')]));_0x4db503['attributes']=_0x4db503['attributes'][_0x5cad('0x36')]?_0x4db503['attributes']:_0x272ea3[_0x5cad('0x30')];if(_0x43964a['query'][_0x5cad('0x41')]){_0x4db503[_0x5cad('0x47')]=[{'all':!![]}];}_0x4db503=_[_0x5cad('0x3f')]({},_0x4db503,_0x43964a[_0x5cad('0x40')]);return db[_0x5cad('0x2b')]['find'](_0x4db503)['then'](handleEntityNotFound(_0x500ae5,null))[_0x5cad('0x25')](respondWithResult(_0x500ae5,null))[_0x5cad('0x44')](handleError(_0x500ae5,null));};exports[_0x5cad('0x48')]=function(_0x19c5b6,_0x2c7eda){return db[_0x5cad('0x2b')][_0x5cad('0x48')](_0x19c5b6[_0x5cad('0x49')],{})[_0x5cad('0x25')](respondWithResult(_0x2c7eda,0xc9))[_0x5cad('0x44')](handleError(_0x2c7eda,null));};exports[_0x5cad('0x24')]=function(_0x50aa56,_0x35cf14){if(_0x50aa56['body']['id']){delete _0x50aa56['body']['id'];}return db[_0x5cad('0x2b')][_0x5cad('0x4a')]({'where':{'id':_0x50aa56[_0x5cad('0x46')]['id']}})['then'](handleEntityNotFound(_0x35cf14,null))[_0x5cad('0x25')](saveUpdates(_0x50aa56[_0x5cad('0x49')],null))[_0x5cad('0x25')](respondWithResult(_0x35cf14,null))[_0x5cad('0x44')](handleError(_0x35cf14,null));};exports[_0x5cad('0x26')]=function(_0x4ef241,_0x3d20c4){return db['SquareReport'][_0x5cad('0x4a')]({'where':{'id':_0x4ef241[_0x5cad('0x46')]['id']}})[_0x5cad('0x25')](handleEntityNotFound(_0x3d20c4,null))[_0x5cad('0x25')](removeEntity(_0x3d20c4,null))['catch'](handleError(_0x3d20c4,null));};exports[_0x5cad('0x4b')]=function(_0x31b690,_0x39b0cd){return db[_0x5cad('0x2b')][_0x5cad('0x4b')]()[_0x5cad('0x25')](respondWithResult(_0x39b0cd,null))[_0x5cad('0x44')](handleError(_0x39b0cd,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index d50bd79..02a26d5 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 _0x677c=['uid_pname','project_name','leaveAt','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareReport.attributes','define','SquareReport','report_square'];(function(_0x188b03,_0x5d6cd2){var _0x56ad39=function(_0x935585){while(--_0x935585){_0x188b03['push'](_0x188b03['shift']());}};_0x56ad39(++_0x5d6cd2);}(_0x677c,0x1b6));var _0xc677=function(_0x42e249,_0x41d435){_0x42e249=_0x42e249-0x0;var _0x173409=_0x677c[_0x42e249];return _0x173409;};'use strict';var _=require('lodash');var util=require(_0xc677('0x0'));var logger=require(_0xc677('0x1'))(_0xc677('0x2'));var moment=require(_0xc677('0x3'));var BPromise=require(_0xc677('0x4'));var rp=require(_0xc677('0x5'));var fs=require('fs');var path=require(_0xc677('0x6'));var rimraf=require(_0xc677('0x7'));var config=require('../../config/environment');var attributes=require(_0xc677('0x8'));module['exports']=function(_0x355b10,_0x43a3d7){return _0x355b10[_0xc677('0x9')](_0xc677('0xa'),attributes,{'tableName':_0xc677('0xb'),'paranoid':![],'indexes':[{'name':_0xc677('0xc'),'fields':['uniqueid',_0xc677('0xd')]},{'name':_0xc677('0xe'),'fields':[_0xc677('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x11f5=['SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','exports','define'];(function(_0x232be7,_0x36a8d1){var _0x3acf9a=function(_0xad0969){while(--_0xad0969){_0x232be7['push'](_0x232be7['shift']());}};_0x3acf9a(++_0x36a8d1);}(_0x11f5,0x180));var _0x511f=function(_0x4a5232,_0x33288d){_0x4a5232=_0x4a5232-0x0;var _0x14a5ab=_0x11f5[_0x4a5232];return _0x14a5ab;};'use strict';var _=require(_0x511f('0x0'));var util=require(_0x511f('0x1'));var logger=require(_0x511f('0x2'))(_0x511f('0x3'));var moment=require(_0x511f('0x4'));var BPromise=require(_0x511f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x511f('0x6'));var rimraf=require(_0x511f('0x7'));var config=require(_0x511f('0x8'));var attributes=require(_0x511f('0x9'));module[_0x511f('0xa')]=function(_0x22ad70,_0x79af82){return _0x22ad70[_0x511f('0xb')](_0x511f('0xc'),attributes,{'tableName':_0x511f('0xd'),'paranoid':![],'indexes':[{'name':_0x511f('0xe'),'fields':[_0x511f('0xf'),_0x511f('0x10')]},{'name':_0x511f('0x11'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index b19aeab..f3c75a3 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 _0xf1f3=['client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','error','message','result','CreateSquareReport','SquareReport','create','options','debug','stringify','catch','UpdateSquareReport','update','body','raw','where','limit','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xf1f3,0x93));var _0x3f1f=function(_0x25e508,_0xf92393){_0x25e508=_0x25e508-0x0;var _0x21060a=_0xf1f3[_0x25e508];return _0x21060a;};'use strict';var _=require(_0x3f1f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3f1f('0x1'));var rs=require(_0x3f1f('0x2'));var fs=require('fs');var Redis=require(_0x3f1f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f1f('0x4'));var logger=require(_0x3f1f('0x5'))(_0x3f1f('0x6'));var config=require('../../config/environment');var jayson=require(_0x3f1f('0x7'));var client=jayson[_0x3f1f('0x8')][_0x3f1f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x248570,_0x33c599,_0x4de364){return new BPromise(function(_0x1dac02,_0x1de7f0){return client[_0x3f1f('0xa')](_0x248570,_0x4de364)[_0x3f1f('0xb')](function(_0x54b9fb){logger[_0x3f1f('0xc')](_0x3f1f('0xd'),_0x33c599,_0x3f1f('0xe'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x33c599,_0x3f1f('0xe'),JSON['stringify'](_0x54b9fb));if(_0x54b9fb[_0x3f1f('0xf')]){if(_0x54b9fb['error']['code']===0x1f4){logger[_0x3f1f('0xf')](_0x3f1f('0xd'),_0x33c599,_0x54b9fb[_0x3f1f('0xf')][_0x3f1f('0x10')]);return _0x1de7f0(_0x54b9fb[_0x3f1f('0xf')][_0x3f1f('0x10')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x33c599,_0x54b9fb['error'][_0x3f1f('0x10')]);return _0x1dac02(_0x54b9fb[_0x3f1f('0xf')][_0x3f1f('0x10')]);}else{logger[_0x3f1f('0xc')](_0x3f1f('0xd'),_0x33c599,_0x3f1f('0xe'));_0x1dac02(_0x54b9fb[_0x3f1f('0x11')]['message']);}})['catch'](function(_0x4a8ddb){logger['error'](_0x3f1f('0xd'),_0x33c599,_0x4a8ddb);_0x1de7f0(_0x4a8ddb);});});}exports[_0x3f1f('0x12')]=function(_0x58ae62){var _0x4f1d59=this;return new Promise(function(_0x110d81,_0x4221fc){return db[_0x3f1f('0x13')][_0x3f1f('0x14')](_0x58ae62['body'],{'raw':_0x58ae62[_0x3f1f('0x15')]?_0x58ae62[_0x3f1f('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x3f1f('0xb')](function(_0x43877d){logger[_0x3f1f('0xc')]('CreateSquareReport',_0x58ae62);logger[_0x3f1f('0x16')]('CreateSquareReport',_0x58ae62,JSON[_0x3f1f('0x17')](_0x43877d));_0x110d81(_0x43877d);})[_0x3f1f('0x18')](function(_0x49a7e2){logger[_0x3f1f('0xf')](_0x3f1f('0x12'),_0x49a7e2[_0x3f1f('0x10')],_0x58ae62);_0x4221fc(_0x4f1d59[_0x3f1f('0xf')](0x1f4,_0x49a7e2[_0x3f1f('0x10')]));});});};exports[_0x3f1f('0x19')]=function(_0x1b977a){var _0x3428c5=this;return new Promise(function(_0x122228,_0x5231e5){return db['SquareReport'][_0x3f1f('0x1a')](_0x1b977a[_0x3f1f('0x1b')],{'raw':_0x1b977a[_0x3f1f('0x15')]?_0x1b977a[_0x3f1f('0x15')][_0x3f1f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b977a[_0x3f1f('0x15')]?_0x1b977a[_0x3f1f('0x15')][_0x3f1f('0x1d')]||null:null,'attributes':_0x1b977a[_0x3f1f('0x15')]?_0x1b977a[_0x3f1f('0x15')]['attributes']||null:null,'limit':_0x1b977a[_0x3f1f('0x15')]?_0x1b977a[_0x3f1f('0x15')][_0x3f1f('0x1e')]||null:null})[_0x3f1f('0xb')](function(_0x3db0d3){logger[_0x3f1f('0xc')](_0x3f1f('0x19'),_0x1b977a);logger['debug'](_0x3f1f('0x19'),_0x1b977a,JSON[_0x3f1f('0x17')](_0x3db0d3));_0x122228(_0x3db0d3);})[_0x3f1f('0x18')](function(_0x58ff00){logger[_0x3f1f('0xf')](_0x3f1f('0x19'),_0x58ff00[_0x3f1f('0x10')],_0x1b977a);_0x5231e5(_0x3428c5[_0x3f1f('0xf')](0x1f4,_0x58ff00[_0x3f1f('0x10')]));});});}; \ No newline at end of file +var _0xeee5=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','SquareReport,\x20%s,\x20%s','stringify','error','code','message','SquareReport','body','raw','debug','CreateSquareReport','catch','UpdateSquareReport','update','options','where','limit','lodash'];(function(_0x1cc060,_0x1afbdc){var _0x5c7e10=function(_0x15e8d6){while(--_0x15e8d6){_0x1cc060['push'](_0x1cc060['shift']());}};_0x5c7e10(++_0x1afbdc);}(_0xeee5,0x6f));var _0x5eee=function(_0x510c01,_0x5ca5c0){_0x510c01=_0x510c01-0x0;var _0x515f9f=_0xeee5[_0x510c01];return _0x515f9f;};'use strict';var _=require(_0x5eee('0x0'));var util=require(_0x5eee('0x1'));var moment=require(_0x5eee('0x2'));var BPromise=require(_0x5eee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5eee('0x4'));var db=require(_0x5eee('0x5'))['db'];var utils=require(_0x5eee('0x6'));var logger=require('../../config/logger')(_0x5eee('0x7'));var config=require(_0x5eee('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5eee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x524b1e,_0x50dc56,_0x11d37d){return new BPromise(function(_0x2164f2,_0x2ac625){return client['request'](_0x524b1e,_0x11d37d)[_0x5eee('0xa')](function(_0x291a09){logger[_0x5eee('0xb')](_0x5eee('0xc'),_0x50dc56,'request\x20sent');logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x50dc56,'request\x20sent',JSON[_0x5eee('0xd')](_0x291a09));if(_0x291a09[_0x5eee('0xe')]){if(_0x291a09[_0x5eee('0xe')][_0x5eee('0xf')]===0x1f4){logger[_0x5eee('0xe')](_0x5eee('0xc'),_0x50dc56,_0x291a09[_0x5eee('0xe')][_0x5eee('0x10')]);return _0x2ac625(_0x291a09[_0x5eee('0xe')][_0x5eee('0x10')]);}logger[_0x5eee('0xe')](_0x5eee('0xc'),_0x50dc56,_0x291a09['error']['message']);return _0x2164f2(_0x291a09[_0x5eee('0xe')][_0x5eee('0x10')]);}else{logger['info'](_0x5eee('0xc'),_0x50dc56,'request\x20sent');_0x2164f2(_0x291a09['result'][_0x5eee('0x10')]);}})['catch'](function(_0x3d3424){logger['error'](_0x5eee('0xc'),_0x50dc56,_0x3d3424);_0x2ac625(_0x3d3424);});});}exports['CreateSquareReport']=function(_0x9d4970){var _0x4f0010=this;return new Promise(function(_0x34c548,_0x1fe153){return db[_0x5eee('0x11')]['create'](_0x9d4970[_0x5eee('0x12')],{'raw':_0x9d4970['options']?_0x9d4970['options'][_0x5eee('0x13')]===undefined?!![]:![]:!![]})[_0x5eee('0xa')](function(_0x253b8d){logger[_0x5eee('0xb')]('CreateSquareReport',_0x9d4970);logger[_0x5eee('0x14')](_0x5eee('0x15'),_0x9d4970,JSON['stringify'](_0x253b8d));_0x34c548(_0x253b8d);})[_0x5eee('0x16')](function(_0x4dd402){logger[_0x5eee('0xe')](_0x5eee('0x15'),_0x4dd402[_0x5eee('0x10')],_0x9d4970);_0x1fe153(_0x4f0010['error'](0x1f4,_0x4dd402[_0x5eee('0x10')]));});});};exports[_0x5eee('0x17')]=function(_0x5a3032){var _0x3fb108=this;return new Promise(function(_0x3102fb,_0x3d7126){return db[_0x5eee('0x11')][_0x5eee('0x18')](_0x5a3032[_0x5eee('0x12')],{'raw':_0x5a3032['options']?_0x5a3032[_0x5eee('0x19')][_0x5eee('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a3032[_0x5eee('0x19')]?_0x5a3032[_0x5eee('0x19')][_0x5eee('0x1a')]||null:null,'attributes':_0x5a3032[_0x5eee('0x19')]?_0x5a3032[_0x5eee('0x19')]['attributes']||null:null,'limit':_0x5a3032[_0x5eee('0x19')]?_0x5a3032[_0x5eee('0x19')][_0x5eee('0x1b')]||null:null})[_0x5eee('0xa')](function(_0x343ab7){logger['info'](_0x5eee('0x17'),_0x5a3032);logger[_0x5eee('0x14')](_0x5eee('0x17'),_0x5a3032,JSON[_0x5eee('0xd')](_0x343ab7));_0x3102fb(_0x343ab7);})['catch'](function(_0x487c22){logger['error'](_0x5eee('0x17'),_0x487c22[_0x5eee('0x10')],_0x5a3032);_0x3d7126(_0x3fb108[_0x5eee('0xe')](0x1f4,_0x487c22[_0x5eee('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index d19d3bc..f203a5b 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 _0x526b=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','delete','destroy','exports'];(function(_0x260425,_0x20783e){var _0x2d6444=function(_0x35a492){while(--_0x35a492){_0x260425['push'](_0x260425['shift']());}};_0x2d6444(++_0x20783e);}(_0x526b,0x169));var _0xb526=function(_0x26d67a,_0x36348b){_0x26d67a=_0x26d67a-0x0;var _0x438df4=_0x526b[_0x26d67a];return _0x438df4;};'use strict';var multer=require(_0xb526('0x0'));var util=require(_0xb526('0x1'));var path=require('path');var timeout=require(_0xb526('0x2'));var express=require(_0xb526('0x3'));var router=express[_0xb526('0x4')]();var fs_extra=require(_0xb526('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb526('0x6'));var config=require('../../config/environment');var controller=require(_0xb526('0x7'));router[_0xb526('0x8')]('/',auth[_0xb526('0x9')](),controller[_0xb526('0xa')]);router[_0xb526('0x8')](_0xb526('0xb'),auth[_0xb526('0x9')](),controller['describe']);router[_0xb526('0x8')](_0xb526('0xc'),auth[_0xb526('0x9')](),controller[_0xb526('0xd')]);router[_0xb526('0xe')]('/',auth[_0xb526('0x9')](),controller[_0xb526('0xf')]);router['put'](_0xb526('0xc'),auth[_0xb526('0x9')](),controller['update']);router[_0xb526('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xb526('0x11')]);module[_0xb526('0x12')]=router; \ No newline at end of file +var _0x4d6d=['delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update'];(function(_0x3c6a2f,_0x398815){var _0x5a90e3=function(_0x25eada){while(--_0x25eada){_0x3c6a2f['push'](_0x3c6a2f['shift']());}};_0x5a90e3(++_0x398815);}(_0x4d6d,0xfe));var _0xd4d6=function(_0x2c723d,_0x4e2bbd){_0x2c723d=_0x2c723d-0x0;var _0x1ddced=_0x4d6d[_0x2c723d];return _0x1ddced;};'use strict';var multer=require(_0xd4d6('0x0'));var util=require('util');var path=require(_0xd4d6('0x1'));var timeout=require(_0xd4d6('0x2'));var express=require('express');var router=express[_0xd4d6('0x3')]();var fs_extra=require(_0xd4d6('0x4'));var auth=require(_0xd4d6('0x5'));var interaction=require(_0xd4d6('0x6'));var config=require(_0xd4d6('0x7'));var controller=require(_0xd4d6('0x8'));router[_0xd4d6('0x9')]('/',auth[_0xd4d6('0xa')](),controller[_0xd4d6('0xb')]);router[_0xd4d6('0x9')](_0xd4d6('0xc'),auth['isAuthenticated'](),controller[_0xd4d6('0xd')]);router['get']('/:id',auth[_0xd4d6('0xa')](),controller[_0xd4d6('0xe')]);router['post']('/',auth[_0xd4d6('0xa')](),controller[_0xd4d6('0xf')]);router[_0xd4d6('0x10')](_0xd4d6('0x11'),auth[_0xd4d6('0xa')](),controller[_0xd4d6('0x12')]);router[_0xd4d6('0x13')]('/:id',auth[_0xd4d6('0xa')](),controller[_0xd4d6('0x14')]);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 e526bd6..a613993 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 _0xaf12=['exports','STRING','sequelize'];(function(_0x559e11,_0x4e33fe){var _0x547562=function(_0x4abdcc){while(--_0x4abdcc){_0x559e11['push'](_0x559e11['shift']());}};_0x547562(++_0x4e33fe);}(_0xaf12,0x1cd));var _0x2af1=function(_0x5c710d,_0x4feb62){_0x5c710d=_0x5c710d-0x0;var _0x3acb16=_0xaf12[_0x5c710d];return _0x3acb16;};'use strict';var Sequelize=require(_0x2af1('0x0'));module[_0x2af1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x2af1('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x2af1('0x2')]},'callerid':{'type':Sequelize[_0x2af1('0x2')]}}; \ No newline at end of file +var _0x78e9=['STRING','TEXT','sequelize','exports'];(function(_0x42d1f8,_0x22e529){var _0x40d234=function(_0xd59b57){while(--_0xd59b57){_0x42d1f8['push'](_0x42d1f8['shift']());}};_0x40d234(++_0x22e529);}(_0x78e9,0x1aa));var _0x978e=function(_0x1c3abd,_0x2730ec){_0x1c3abd=_0x1c3abd-0x0;var _0x551272=_0x78e9[_0x1c3abd];return _0x551272;};'use strict';var Sequelize=require(_0x978e('0x0'));module[_0x978e('0x1')]={'uniqueid':{'type':Sequelize[_0x978e('0x2')]},'node':{'type':Sequelize[_0x978e('0x2')]},'application':{'type':Sequelize[_0x978e('0x2')]},'data':{'type':Sequelize[_0x978e('0x3')]},'project_name':{'type':Sequelize[_0x978e('0x2')]},'callerid':{'type':Sequelize[_0x978e('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index c318fea..61bf5b8 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 _0x5619=['apply','save','then','destroy','error','stack','name','send','map','SquareDetailsReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range'];(function(_0x36ba80,_0x284c26){var _0x135582=function(_0x35ac6b){while(--_0x35ac6b){_0x36ba80['push'](_0x36ba80['shift']());}};_0x135582(++_0x284c26);}(_0x5619,0x102));var _0x9561=function(_0x312198,_0x225a66){_0x312198=_0x312198-0x0;var _0x2c01a4=_0x5619[_0x312198];return _0x2c01a4;};'use strict';var emlformat=require(_0x9561('0x0'));var rimraf=require(_0x9561('0x1'));var zipdir=require(_0x9561('0x2'));var jsonpatch=require(_0x9561('0x3'));var rp=require(_0x9561('0x4'));var moment=require(_0x9561('0x5'));var BPromise=require(_0x9561('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9561('0x7'));var sox=require(_0x9561('0x8'));var csv=require(_0x9561('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9561('0xa'));var squel=require('squel');var crypto=require(_0x9561('0xb'));var jsforce=require(_0x9561('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9561('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9561('0xd'));var authService=require(_0x9561('0xe'));var qs=require(_0x9561('0xf'));var as=require(_0x9561('0x10'));var hardwareService=require(_0x9561('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x9561('0x12'));var config=require(_0x9561('0x13'));var licenseUtil=require(_0x9561('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2923a1,_0x2bcfae){_0x2bcfae=_0x2bcfae||0xcc;return function(_0x408fa5){if(_0x408fa5){return _0x2923a1[_0x9561('0x15')](_0x2bcfae);}return _0x2923a1[_0x9561('0x16')](_0x2bcfae)[_0x9561('0x17')]();};}function respondWithResult(_0x39cf17,_0x26edb5){_0x26edb5=_0x26edb5||0xc8;return function(_0x248e9c){if(_0x248e9c){return _0x39cf17[_0x9561('0x16')](_0x26edb5)[_0x9561('0x18')](_0x248e9c);}};}function respondWithFilteredResult(_0x1166b0,_0x5e6973){return function(_0x328c89){if(_0x328c89){var _0x58ae23=typeof _0x5e6973[_0x9561('0x19')]===_0x9561('0x1a')&&typeof _0x5e6973['limit']===_0x9561('0x1a');var _0x513607=_0x328c89[_0x9561('0x1b')];var _0x258746=_0x58ae23?0x0:_0x5e6973[_0x9561('0x19')];var _0x4c47c5=_0x58ae23?_0x328c89[_0x9561('0x1b')]:_0x5e6973[_0x9561('0x19')]+_0x5e6973['limit'];var _0x29b28f;if(_0x4c47c5>=_0x513607){_0x4c47c5=_0x513607;_0x29b28f=0xc8;}else{_0x29b28f=0xce;}_0x1166b0[_0x9561('0x16')](_0x29b28f);return _0x1166b0[_0x9561('0x1c')](_0x9561('0x1d'),_0x258746+'-'+_0x4c47c5+'/'+_0x513607)[_0x9561('0x18')](_0x328c89);}return null;};}function patchUpdates(_0x1b7228){return function(_0x2f73f7){try{jsonpatch[_0x9561('0x1e')](_0x2f73f7,_0x1b7228,!![]);}catch(_0xe5332f){return BPromise['reject'](_0xe5332f);}return _0x2f73f7[_0x9561('0x1f')]();};}function saveUpdates(_0x145540,_0x45156b){return function(_0x3329e2){if(_0x3329e2){return _0x3329e2['update'](_0x145540)[_0x9561('0x20')](function(_0xd4064a){return _0xd4064a;});}return null;};}function removeEntity(_0x2aad1b,_0x1081ad){return function(_0x1ae046){if(_0x1ae046){return _0x1ae046[_0x9561('0x21')]()[_0x9561('0x20')](function(){_0x2aad1b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d9d57,_0x198889){return function(_0x1b8fb4){if(!_0x1b8fb4){_0x5d9d57[_0x9561('0x15')](0x194);}return _0x1b8fb4;};}function handleError(_0x1d45f6,_0x5578cf){_0x5578cf=_0x5578cf||0x1f4;return function(_0x288bfc){logger[_0x9561('0x22')](_0x288bfc[_0x9561('0x23')]);if(_0x288bfc[_0x9561('0x24')]){delete _0x288bfc['name'];}_0x1d45f6[_0x9561('0x16')](_0x5578cf)[_0x9561('0x25')](_0x288bfc);};}exports['index']=function(_0x4405cc,_0x2e14f8){var _0x56192a={},_0x1262f8={},_0x958fc2={'count':0x0,'rows':[]};var _0x24084c=_[_0x9561('0x26')](db[_0x9561('0x27')][_0x9561('0x28')],function(_0x453b4b){return{'name':_0x453b4b['fieldName'],'type':_0x453b4b[_0x9561('0x29')][_0x9561('0x2a')]};});_0x1262f8['model']=_[_0x9561('0x26')](_0x24084c,_0x9561('0x24'));_0x1262f8[_0x9561('0x2b')]=_[_0x9561('0x2c')](_0x4405cc['query']);_0x1262f8[_0x9561('0x2d')]=_[_0x9561('0x2e')](_0x1262f8[_0x9561('0x2f')],_0x1262f8[_0x9561('0x2b')]);_0x56192a[_0x9561('0x30')]=_[_0x9561('0x2e')](_0x1262f8[_0x9561('0x2f')],qs[_0x9561('0x31')](_0x4405cc['query'][_0x9561('0x31')]));_0x56192a['attributes']=_0x56192a[_0x9561('0x30')][_0x9561('0x32')]?_0x56192a[_0x9561('0x30')]:_0x1262f8[_0x9561('0x2f')];if(!_0x4405cc[_0x9561('0x2b')]['hasOwnProperty'](_0x9561('0x33'))){_0x56192a[_0x9561('0x34')]=qs['limit'](_0x4405cc[_0x9561('0x2b')][_0x9561('0x34')]);_0x56192a[_0x9561('0x19')]=qs[_0x9561('0x19')](_0x4405cc['query'][_0x9561('0x19')]);}_0x56192a[_0x9561('0x35')]=qs[_0x9561('0x36')](_0x4405cc[_0x9561('0x2b')][_0x9561('0x36')]);_0x56192a[_0x9561('0x37')]=qs[_0x9561('0x2d')](_['pick'](_0x4405cc[_0x9561('0x2b')],_0x1262f8[_0x9561('0x2d')]),_0x24084c);if(_0x4405cc[_0x9561('0x2b')][_0x9561('0x38')]){_0x56192a[_0x9561('0x37')]=_['merge'](_0x56192a[_0x9561('0x37')],{'$or':_[_0x9561('0x26')](_0x24084c,function(_0x45748d){if(_0x45748d[_0x9561('0x29')]!==_0x9561('0x39')){var _0x29403b={};_0x29403b[_0x45748d[_0x9561('0x24')]]={'$like':'%'+_0x4405cc[_0x9561('0x2b')][_0x9561('0x38')]+'%'};return _0x29403b;}})});}_0x56192a=_[_0x9561('0x3a')]({},_0x56192a,_0x4405cc[_0x9561('0x3b')]);var _0x4d156b={'where':_0x56192a[_0x9561('0x37')]};return db[_0x9561('0x27')][_0x9561('0x1b')](_0x4d156b)[_0x9561('0x20')](function(_0xd4c22){_0x958fc2['count']=_0xd4c22;if(_0x4405cc[_0x9561('0x2b')]['includeAll']){_0x56192a[_0x9561('0x3c')]=[{'all':!![]}];}return db[_0x9561('0x27')][_0x9561('0x3d')](_0x56192a);})[_0x9561('0x20')](function(_0xfee3b3){_0x958fc2[_0x9561('0x3e')]=_0xfee3b3;return _0x958fc2;})[_0x9561('0x20')](respondWithFilteredResult(_0x2e14f8,_0x56192a))[_0x9561('0x3f')](handleError(_0x2e14f8,null));};exports[_0x9561('0x40')]=function(_0x1b8338,_0xbb1e9e){var _0x268183={'raw':!![],'where':{'id':_0x1b8338[_0x9561('0x41')]['id']}},_0x2d95ea={};_0x2d95ea[_0x9561('0x2f')]=_['keys'](db[_0x9561('0x27')][_0x9561('0x28')]);_0x2d95ea[_0x9561('0x2b')]=_[_0x9561('0x2c')](_0x1b8338[_0x9561('0x2b')]);_0x2d95ea[_0x9561('0x2d')]=_[_0x9561('0x2e')](_0x2d95ea['model'],_0x2d95ea['query']);_0x268183[_0x9561('0x30')]=_['intersection'](_0x2d95ea[_0x9561('0x2f')],qs[_0x9561('0x31')](_0x1b8338['query'][_0x9561('0x31')]));_0x268183[_0x9561('0x30')]=_0x268183[_0x9561('0x30')][_0x9561('0x32')]?_0x268183[_0x9561('0x30')]:_0x2d95ea[_0x9561('0x2f')];if(_0x1b8338[_0x9561('0x2b')][_0x9561('0x42')]){_0x268183[_0x9561('0x3c')]=[{'all':!![]}];}_0x268183=_['merge']({},_0x268183,_0x1b8338[_0x9561('0x3b')]);return db[_0x9561('0x27')][_0x9561('0x43')](_0x268183)[_0x9561('0x20')](handleEntityNotFound(_0xbb1e9e,null))[_0x9561('0x20')](respondWithResult(_0xbb1e9e,null))[_0x9561('0x3f')](handleError(_0xbb1e9e,null));};exports[_0x9561('0x44')]=function(_0x46d5d3,_0x334805){return db[_0x9561('0x27')][_0x9561('0x44')](_0x46d5d3['body'],{})[_0x9561('0x20')](respondWithResult(_0x334805,0xc9))[_0x9561('0x3f')](handleError(_0x334805,null));};exports[_0x9561('0x45')]=function(_0x40ab5f,_0x154e77){if(_0x40ab5f['body']['id']){delete _0x40ab5f[_0x9561('0x46')]['id'];}return db[_0x9561('0x27')][_0x9561('0x43')]({'where':{'id':_0x40ab5f['params']['id']}})[_0x9561('0x20')](handleEntityNotFound(_0x154e77,null))['then'](saveUpdates(_0x40ab5f[_0x9561('0x46')],null))[_0x9561('0x20')](respondWithResult(_0x154e77,null))[_0x9561('0x3f')](handleError(_0x154e77,null));};exports[_0x9561('0x21')]=function(_0x230c9e,_0x29cdc3){return db[_0x9561('0x27')][_0x9561('0x43')]({'where':{'id':_0x230c9e[_0x9561('0x41')]['id']}})[_0x9561('0x20')](handleEntityNotFound(_0x29cdc3,null))[_0x9561('0x20')](removeEntity(_0x29cdc3,null))['catch'](handleError(_0x29cdc3,null));};exports[_0x9561('0x47')]=function(_0x17545f,_0x2657ae){return db['SquareDetailsReport'][_0x9561('0x47')]()['then'](respondWithResult(_0x2657ae,null))[_0x9561('0x3f')](handleError(_0x2657ae,null));}; \ No newline at end of file +var _0x6f69=['create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','ejs','fs-extra','lodash','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','SquareDetailsReport','includeAll','include','catch','show','keys','find'];(function(_0x26deed,_0xb1b062){var _0x399378=function(_0x182c7d){while(--_0x182c7d){_0x26deed['push'](_0x26deed['shift']());}};_0x399378(++_0xb1b062);}(_0x6f69,0x1e0));var _0x96f6=function(_0x580cd6,_0x984f0d){_0x580cd6=_0x580cd6-0x0;var _0x4ee9ca=_0x6f69[_0x580cd6];return _0x4ee9ca;};'use strict';var emlformat=require(_0x96f6('0x0'));var rimraf=require(_0x96f6('0x1'));var zipdir=require(_0x96f6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96f6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x96f6('0x4'));var util=require(_0x96f6('0x5'));var path=require('path');var sox=require(_0x96f6('0x6'));var csv=require('to-csv');var ejs=require(_0x96f6('0x7'));var fs=require('fs');var fs_extra=require(_0x96f6('0x8'));var _=require(_0x96f6('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x96f6('0xa'));var querystring=require(_0x96f6('0xb'));var Papa=require(_0x96f6('0xc'));var Redis=require(_0x96f6('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x96f6('0xe'));var as=require(_0x96f6('0xf'));var hardwareService=require(_0x96f6('0x10'));var logger=require('../../config/logger')(_0x96f6('0x11'));var utils=require(_0x96f6('0x12'));var config=require(_0x96f6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x96f6('0x14'))['db'];function respondWithStatusCode(_0x3cb16e,_0x5ea211){_0x5ea211=_0x5ea211||0xcc;return function(_0x429b73){if(_0x429b73){return _0x3cb16e[_0x96f6('0x15')](_0x5ea211);}return _0x3cb16e[_0x96f6('0x16')](_0x5ea211)[_0x96f6('0x17')]();};}function respondWithResult(_0x5005d2,_0x32cad1){_0x32cad1=_0x32cad1||0xc8;return function(_0x23a715){if(_0x23a715){return _0x5005d2['status'](_0x32cad1)[_0x96f6('0x18')](_0x23a715);}};}function respondWithFilteredResult(_0x682584,_0x3ef6da){return function(_0x3fbce4){if(_0x3fbce4){var _0x40e5fb=typeof _0x3ef6da[_0x96f6('0x19')]===_0x96f6('0x1a')&&typeof _0x3ef6da[_0x96f6('0x1b')]===_0x96f6('0x1a');var _0x476483=_0x3fbce4[_0x96f6('0x1c')];var _0x440612=_0x40e5fb?0x0:_0x3ef6da['offset'];var _0x3fc940=_0x40e5fb?_0x3fbce4[_0x96f6('0x1c')]:_0x3ef6da[_0x96f6('0x19')]+_0x3ef6da[_0x96f6('0x1b')];var _0x47e1f9;if(_0x3fc940>=_0x476483){_0x3fc940=_0x476483;_0x47e1f9=0xc8;}else{_0x47e1f9=0xce;}_0x682584[_0x96f6('0x16')](_0x47e1f9);return _0x682584[_0x96f6('0x1d')]('Content-Range',_0x440612+'-'+_0x3fc940+'/'+_0x476483)[_0x96f6('0x18')](_0x3fbce4);}return null;};}function patchUpdates(_0x1da931){return function(_0x2bbf51){try{jsonpatch['apply'](_0x2bbf51,_0x1da931,!![]);}catch(_0x574cbd){return BPromise[_0x96f6('0x1e')](_0x574cbd);}return _0x2bbf51[_0x96f6('0x1f')]();};}function saveUpdates(_0x164e30,_0x48edc1){return function(_0xd31ec5){if(_0xd31ec5){return _0xd31ec5[_0x96f6('0x20')](_0x164e30)['then'](function(_0x2dbb5d){return _0x2dbb5d;});}return null;};}function removeEntity(_0x4fba88,_0x4bcdd0){return function(_0x28166e){if(_0x28166e){return _0x28166e[_0x96f6('0x21')]()[_0x96f6('0x22')](function(){_0x4fba88[_0x96f6('0x16')](0xcc)[_0x96f6('0x17')]();});}};}function handleEntityNotFound(_0x1294bc,_0x478f12){return function(_0x4050a5){if(!_0x4050a5){_0x1294bc[_0x96f6('0x15')](0x194);}return _0x4050a5;};}function handleError(_0x57cba5,_0x4ab1ac){_0x4ab1ac=_0x4ab1ac||0x1f4;return function(_0x5eba24){logger[_0x96f6('0x23')](_0x5eba24[_0x96f6('0x24')]);if(_0x5eba24[_0x96f6('0x25')]){delete _0x5eba24['name'];}_0x57cba5['status'](_0x4ab1ac)[_0x96f6('0x26')](_0x5eba24);};}exports['index']=function(_0x40f5ee,_0x2b6061){var _0x58b19c={},_0x153d0a={},_0xdac583={'count':0x0,'rows':[]};var _0x5f0a45=_[_0x96f6('0x27')](db['SquareDetailsReport'][_0x96f6('0x28')],function(_0x13e873){return{'name':_0x13e873['fieldName'],'type':_0x13e873[_0x96f6('0x29')]['key']};});_0x153d0a[_0x96f6('0x2a')]=_['map'](_0x5f0a45,_0x96f6('0x25'));_0x153d0a[_0x96f6('0x2b')]=_['keys'](_0x40f5ee[_0x96f6('0x2b')]);_0x153d0a[_0x96f6('0x2c')]=_[_0x96f6('0x2d')](_0x153d0a[_0x96f6('0x2a')],_0x153d0a['query']);_0x58b19c[_0x96f6('0x2e')]=_[_0x96f6('0x2d')](_0x153d0a[_0x96f6('0x2a')],qs[_0x96f6('0x2f')](_0x40f5ee[_0x96f6('0x2b')][_0x96f6('0x2f')]));_0x58b19c[_0x96f6('0x2e')]=_0x58b19c[_0x96f6('0x2e')][_0x96f6('0x30')]?_0x58b19c[_0x96f6('0x2e')]:_0x153d0a[_0x96f6('0x2a')];if(!_0x40f5ee[_0x96f6('0x2b')][_0x96f6('0x31')](_0x96f6('0x32'))){_0x58b19c['limit']=qs[_0x96f6('0x1b')](_0x40f5ee[_0x96f6('0x2b')]['limit']);_0x58b19c[_0x96f6('0x19')]=qs[_0x96f6('0x19')](_0x40f5ee[_0x96f6('0x2b')][_0x96f6('0x19')]);}_0x58b19c['order']=qs[_0x96f6('0x33')](_0x40f5ee[_0x96f6('0x2b')][_0x96f6('0x33')]);_0x58b19c[_0x96f6('0x34')]=qs[_0x96f6('0x2c')](_['pick'](_0x40f5ee[_0x96f6('0x2b')],_0x153d0a[_0x96f6('0x2c')]),_0x5f0a45);if(_0x40f5ee[_0x96f6('0x2b')][_0x96f6('0x35')]){_0x58b19c[_0x96f6('0x34')]=_[_0x96f6('0x36')](_0x58b19c[_0x96f6('0x34')],{'$or':_[_0x96f6('0x27')](_0x5f0a45,function(_0x368889){if(_0x368889[_0x96f6('0x29')]!==_0x96f6('0x37')){var _0xb53d3d={};_0xb53d3d[_0x368889[_0x96f6('0x25')]]={'$like':'%'+_0x40f5ee[_0x96f6('0x2b')]['filter']+'%'};return _0xb53d3d;}})});}_0x58b19c=_[_0x96f6('0x36')]({},_0x58b19c,_0x40f5ee[_0x96f6('0x38')]);var _0x455521={'where':_0x58b19c[_0x96f6('0x34')]};return db[_0x96f6('0x39')][_0x96f6('0x1c')](_0x455521)[_0x96f6('0x22')](function(_0x5dd287){_0xdac583[_0x96f6('0x1c')]=_0x5dd287;if(_0x40f5ee['query'][_0x96f6('0x3a')]){_0x58b19c[_0x96f6('0x3b')]=[{'all':!![]}];}return db[_0x96f6('0x39')]['findAll'](_0x58b19c);})[_0x96f6('0x22')](function(_0x3b662f){_0xdac583['rows']=_0x3b662f;return _0xdac583;})['then'](respondWithFilteredResult(_0x2b6061,_0x58b19c))[_0x96f6('0x3c')](handleError(_0x2b6061,null));};exports[_0x96f6('0x3d')]=function(_0x5dce85,_0x3fcb7b){var _0x1f2c3b={'raw':!![],'where':{'id':_0x5dce85['params']['id']}},_0x52a3c5={};_0x52a3c5[_0x96f6('0x2a')]=_[_0x96f6('0x3e')](db['SquareDetailsReport']['rawAttributes']);_0x52a3c5['query']=_[_0x96f6('0x3e')](_0x5dce85[_0x96f6('0x2b')]);_0x52a3c5['filters']=_[_0x96f6('0x2d')](_0x52a3c5[_0x96f6('0x2a')],_0x52a3c5[_0x96f6('0x2b')]);_0x1f2c3b[_0x96f6('0x2e')]=_[_0x96f6('0x2d')](_0x52a3c5[_0x96f6('0x2a')],qs[_0x96f6('0x2f')](_0x5dce85[_0x96f6('0x2b')][_0x96f6('0x2f')]));_0x1f2c3b[_0x96f6('0x2e')]=_0x1f2c3b[_0x96f6('0x2e')][_0x96f6('0x30')]?_0x1f2c3b[_0x96f6('0x2e')]:_0x52a3c5['model'];if(_0x5dce85[_0x96f6('0x2b')][_0x96f6('0x3a')]){_0x1f2c3b[_0x96f6('0x3b')]=[{'all':!![]}];}_0x1f2c3b=_[_0x96f6('0x36')]({},_0x1f2c3b,_0x5dce85[_0x96f6('0x38')]);return db[_0x96f6('0x39')][_0x96f6('0x3f')](_0x1f2c3b)[_0x96f6('0x22')](handleEntityNotFound(_0x3fcb7b,null))[_0x96f6('0x22')](respondWithResult(_0x3fcb7b,null))[_0x96f6('0x3c')](handleError(_0x3fcb7b,null));};exports[_0x96f6('0x40')]=function(_0x377786,_0x11aeff){return db['SquareDetailsReport'][_0x96f6('0x40')](_0x377786[_0x96f6('0x41')],{})[_0x96f6('0x22')](respondWithResult(_0x11aeff,0xc9))[_0x96f6('0x3c')](handleError(_0x11aeff,null));};exports[_0x96f6('0x20')]=function(_0x255864,_0x573f5f){if(_0x255864['body']['id']){delete _0x255864[_0x96f6('0x41')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x255864['params']['id']}})[_0x96f6('0x22')](handleEntityNotFound(_0x573f5f,null))['then'](saveUpdates(_0x255864['body'],null))[_0x96f6('0x22')](respondWithResult(_0x573f5f,null))[_0x96f6('0x3c')](handleError(_0x573f5f,null));};exports['destroy']=function(_0x19e81c,_0x35cfac){return db[_0x96f6('0x39')][_0x96f6('0x3f')]({'where':{'id':_0x19e81c[_0x96f6('0x42')]['id']}})[_0x96f6('0x22')](handleEntityNotFound(_0x35cfac,null))[_0x96f6('0x22')](removeEntity(_0x35cfac,null))[_0x96f6('0x3c')](handleError(_0x35cfac,null));};exports[_0x96f6('0x43')]=function(_0x2c6d27,_0x4493f2){return db['SquareDetailsReport'][_0x96f6('0x43')]()[_0x96f6('0x22')](respondWithResult(_0x4493f2,null))['catch'](handleError(_0x4493f2,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 11fc4cd..5241fea 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 _0x2c70=['path','rimraf','exports','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x425561,_0x3a4598){var _0x303b28=function(_0x42f9f3){while(--_0x42f9f3){_0x425561['push'](_0x425561['shift']());}};_0x303b28(++_0x3a4598);}(_0x2c70,0x17a));var _0x02c7=function(_0x348055,_0x38e0f7){_0x348055=_0x348055-0x0;var _0x14a620=_0x2c70[_0x348055];return _0x14a620;};'use strict';var _=require(_0x02c7('0x0'));var util=require('util');var logger=require(_0x02c7('0x1'))(_0x02c7('0x2'));var moment=require(_0x02c7('0x3'));var BPromise=require(_0x02c7('0x4'));var rp=require(_0x02c7('0x5'));var fs=require('fs');var path=require(_0x02c7('0x6'));var rimraf=require(_0x02c7('0x7'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0x02c7('0x8')]=function(_0x2e4280,_0x139152){return _0x2e4280[_0x02c7('0x9')](_0x02c7('0xa'),attributes,{'tableName':_0x02c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x820c=['lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','exports','define','SquareDetailsReport','report_square_details'];(function(_0x30e557,_0xe0fa02){var _0x11be4c=function(_0x56e38a){while(--_0x56e38a){_0x30e557['push'](_0x30e557['shift']());}};_0x11be4c(++_0xe0fa02);}(_0x820c,0x8c));var _0xc820=function(_0x19a5da,_0x283df9){_0x19a5da=_0x19a5da-0x0;var _0x140de5=_0x820c[_0x19a5da];return _0x140de5;};'use strict';var _=require(_0xc820('0x0'));var util=require('util');var logger=require(_0xc820('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc820('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc820('0x3'));var rimraf=require(_0xc820('0x4'));var config=require(_0xc820('0x5'));var attributes=require('./squareReportDetail.attributes');module[_0xc820('0x6')]=function(_0x1a954e,_0x498e8d){return _0x1a954e[_0xc820('0x7')](_0xc820('0x8'),attributes,{'tableName':_0xc820('0x9'),'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 f07a73c..a06f09b 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 _0xd914=['client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x15bba7,_0x5b0a39){var _0x327912=function(_0x8fed0e){while(--_0x8fed0e){_0x15bba7['push'](_0x15bba7['shift']());}};_0x327912(++_0x5b0a39);}(_0xd914,0x17f));var _0x4d91=function(_0x35a140,_0x3aeac6){_0x35a140=_0x35a140-0x0;var _0x30ab82=_0xd914[_0x35a140];return _0x30ab82;};'use strict';var _=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var moment=require('moment');var BPromise=require(_0x4d91('0x2'));var rs=require(_0x4d91('0x3'));var fs=require('fs');var Redis=require(_0x4d91('0x4'));var db=require(_0x4d91('0x5'))['db'];var utils=require(_0x4d91('0x6'));var logger=require(_0x4d91('0x7'))('rpc');var config=require(_0x4d91('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4d91('0x9')][_0x4d91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x175ce3,_0x27c0d5,_0x22f2a4){return new BPromise(function(_0x150767,_0x3016c0){return client[_0x4d91('0xb')](_0x175ce3,_0x22f2a4)['then'](function(_0x37bde4){logger[_0x4d91('0xc')](_0x4d91('0xd'),_0x27c0d5,_0x4d91('0xe'));logger[_0x4d91('0xf')](_0x4d91('0x10'),_0x27c0d5,'request\x20sent',JSON['stringify'](_0x37bde4));if(_0x37bde4[_0x4d91('0x11')]){if(_0x37bde4[_0x4d91('0x11')][_0x4d91('0x12')]===0x1f4){logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x37bde4[_0x4d91('0x11')]['message']);return _0x3016c0(_0x37bde4['error'][_0x4d91('0x13')]);}logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x37bde4[_0x4d91('0x11')][_0x4d91('0x13')]);return _0x150767(_0x37bde4[_0x4d91('0x11')][_0x4d91('0x13')]);}else{logger['info'](_0x4d91('0xd'),_0x27c0d5,_0x4d91('0xe'));_0x150767(_0x37bde4[_0x4d91('0x14')][_0x4d91('0x13')]);}})[_0x4d91('0x15')](function(_0x554ca8){logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x554ca8);_0x3016c0(_0x554ca8);});});}exports[_0x4d91('0x16')]=function(_0x44b9a7){var _0x4cfa40=this;return new Promise(function(_0x350e23,_0x3b579b){return db[_0x4d91('0x17')]['create'](_0x44b9a7[_0x4d91('0x18')],{'raw':_0x44b9a7[_0x4d91('0x19')]?_0x44b9a7[_0x4d91('0x19')][_0x4d91('0x1a')]===undefined?!![]:![]:!![]})[_0x4d91('0x1b')](function(_0x40cde4){logger[_0x4d91('0xc')](_0x4d91('0x16'),_0x44b9a7);logger[_0x4d91('0xf')](_0x4d91('0x16'),_0x44b9a7,JSON['stringify'](_0x40cde4));_0x350e23(_0x40cde4);})[_0x4d91('0x15')](function(_0x5f5236){logger['error'](_0x4d91('0x16'),_0x5f5236[_0x4d91('0x13')],_0x44b9a7);_0x3b579b(_0x4cfa40[_0x4d91('0x11')](0x1f4,_0x5f5236[_0x4d91('0x13')]));});});}; \ No newline at end of file +var _0x4227=['body','options','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport'];(function(_0x28a06,_0x553992){var _0x6a3fbc=function(_0x319ecc){while(--_0x319ecc){_0x28a06['push'](_0x28a06['shift']());}};_0x6a3fbc(++_0x553992);}(_0x4227,0x89));var _0x7422=function(_0x48829a,_0x3eb43f){_0x48829a=_0x48829a-0x0;var _0xcce25=_0x4227[_0x48829a];return _0xcce25;};'use strict';var _=require(_0x7422('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7422('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7422('0x2'));var db=require(_0x7422('0x3'))['db'];var utils=require(_0x7422('0x4'));var logger=require('../../config/logger')(_0x7422('0x5'));var config=require(_0x7422('0x6'));var jayson=require(_0x7422('0x7'));var client=jayson[_0x7422('0x8')][_0x7422('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b3432,_0xe99299,_0x45ca1a){return new BPromise(function(_0x12965e,_0x599d78){return client[_0x7422('0xa')](_0x2b3432,_0x45ca1a)[_0x7422('0xb')](function(_0x25de34){logger['info'](_0x7422('0xc'),_0xe99299,'request\x20sent');logger[_0x7422('0xd')](_0x7422('0xe'),_0xe99299,_0x7422('0xf'),JSON[_0x7422('0x10')](_0x25de34));if(_0x25de34[_0x7422('0x11')]){if(_0x25de34['error'][_0x7422('0x12')]===0x1f4){logger[_0x7422('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0xe99299,_0x25de34[_0x7422('0x11')][_0x7422('0x13')]);return _0x599d78(_0x25de34['error'][_0x7422('0x13')]);}logger[_0x7422('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0xe99299,_0x25de34['error'][_0x7422('0x13')]);return _0x12965e(_0x25de34['error'][_0x7422('0x13')]);}else{logger[_0x7422('0x14')]('SquareDetailsReport,\x20%s,\x20%s',_0xe99299,_0x7422('0xf'));_0x12965e(_0x25de34[_0x7422('0x15')][_0x7422('0x13')]);}})[_0x7422('0x16')](function(_0x2946ca){logger[_0x7422('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0xe99299,_0x2946ca);_0x599d78(_0x2946ca);});});}exports[_0x7422('0x17')]=function(_0xa7ff41){var _0x493f59=this;return new Promise(function(_0x30656d,_0x57b8bf){return db[_0x7422('0x18')]['create'](_0xa7ff41[_0x7422('0x19')],{'raw':_0xa7ff41[_0x7422('0x1a')]?_0xa7ff41[_0x7422('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x7422('0xb')](function(_0xacaad1){logger[_0x7422('0x14')](_0x7422('0x17'),_0xa7ff41);logger['debug']('CreateSquareDetailsReport',_0xa7ff41,JSON[_0x7422('0x10')](_0xacaad1));_0x30656d(_0xacaad1);})[_0x7422('0x16')](function(_0x20c1e3){logger[_0x7422('0x11')](_0x7422('0x17'),_0x20c1e3[_0x7422('0x13')],_0xa7ff41);_0x57b8bf(_0x493f59[_0x7422('0x11')](0x1f4,_0x20c1e3['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 4c18fb7..7596f24 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 _0x0e53=['express','Router','../../components/auth/service','/process/:pid/kill','isAuthenticated','killProcess','exports'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0x0e53,0x70));var _0x30e5=function(_0x197cda,_0x34c74d){_0x197cda=_0x197cda-0x0;var _0x4cfc89=_0x0e53[_0x197cda];return _0x4cfc89;};'use strict';var express=require(_0x30e5('0x0'));var router=express[_0x30e5('0x1')]();var auth=require(_0x30e5('0x2'));var controller=require('./system.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x30e5('0x3'),auth[_0x30e5('0x4')](),controller[_0x30e5('0x5')]);module[_0x30e5('0x6')]=router; \ No newline at end of file +var _0xa2ea=['get','index','/process/:pid/kill','killProcess','express','Router','../../components/auth/service','./system.controller'];(function(_0x15dbca,_0x1d7c3c){var _0x326533=function(_0x507ee2){while(--_0x507ee2){_0x15dbca['push'](_0x15dbca['shift']());}};_0x326533(++_0x1d7c3c);}(_0xa2ea,0x15c));var _0xaa2e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa2ea[_0x934425];return _0x31d596;};'use strict';var express=require(_0xaa2e('0x0'));var router=express[_0xaa2e('0x1')]();var auth=require(_0xaa2e('0x2'));var controller=require(_0xaa2e('0x3'));router[_0xaa2e('0x4')]('/',auth['isAuthenticated'](),controller[_0xaa2e('0x5')]);router['get'](_0xaa2e('0x6'),auth['isAuthenticated'](),controller[_0xaa2e('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index bac66cf..1a12e0a 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 _0x1d61=['format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','exec','../../config/logger','api','util','bluebird','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm'];(function(_0x1496b9,_0x362c62){var _0x5de295=function(_0x1699dc){while(--_0x1699dc){_0x1496b9['push'](_0x1496b9['shift']());}};_0x5de295(++_0x362c62);}(_0x1d61,0x9f));var _0x11d6=function(_0x2c7a02,_0x3b3d55){_0x2c7a02=_0x2c7a02-0x0;var _0xdbb5b=_0x1d61[_0x2c7a02];return _0xdbb5b;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0x11d6('0x0')];var logger=require(_0x11d6('0x1'))(_0x11d6('0x2'));var util=require(_0x11d6('0x3'));var BPromise=require(_0x11d6('0x4'));var _=require('lodash');function handleError(_0x38bb3c,_0x38a879,_0x3cfcad){_0x38a879=_0x38a879||0x1f4;return function(_0x34ae5c){logger['error'](_0x11d6('0x5'),_0x3cfcad,_0x38a879,util[_0x11d6('0x6')](_0x34ae5c,{'showHidden':![],'depth':null}));delete _0x34ae5c['name'];_0x38bb3c[_0x11d6('0x7')](_0x38a879)[_0x11d6('0x8')](_0x34ae5c);};}exports[_0x11d6('0x9')]=function(_0x4732a2,_0x1d8d83){return info[_0x11d6('0xa')]()[_0x11d6('0xb')](function(_0x3f13bd){return _0x1d8d83[_0x11d6('0x7')](0xc8)[_0x11d6('0xc')](_0x3f13bd);})[_0x11d6('0xd')](function(_0x5da3f7){return _0x1d8d83[_0x11d6('0x7')](0x1f4)[_0x11d6('0xc')](_0x5da3f7);});};exports[_0x11d6('0xe')]=function(_0x1fbb75,_0x5af05b){var _0x420a3d=[_0x11d6('0xf')];return new BPromise(function(_0x17f662,_0x58acee){return exec(util[_0x11d6('0x10')](_0x11d6('0x11'),_0x1fbb75[_0x11d6('0x12')]['pid']),function(_0x39241a,_0x4231be,_0x4e5f04){if(_0x39241a){return _0x58acee(_0x39241a);}return _0x17f662(_0x4231be);});})['then'](function(_0x1d7f5b){var _0x139bd9=![];var _0x3c19e3=_0x1d7f5b[_0x11d6('0x13')](/\n/);for(var _0x2f70f1=0x0,_0x4f7ab5=_0x420a3d[_0x11d6('0x14')];_0x2f70f1<_0x4f7ab5,_0x139bd9===![];_0x2f70f1+=0x1){if(_0x1d7f5b['indexOf'](_0x420a3d[_0x2f70f1])>=0x0){_0x139bd9=!![];}}if(!_0x139bd9){throw new Error(util[_0x11d6('0x10')](_0x11d6('0x15'),_0x1fbb75[_0x11d6('0x12')][_0x11d6('0x16')]));}process[_0x11d6('0x17')](_0x1fbb75['params'][_0x11d6('0x16')],_0x11d6('0x18'));return _0x5af05b[_0x11d6('0x7')](0xc8)[_0x11d6('0xc')]({'message':util[_0x11d6('0x10')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x1fbb75['params'][_0x11d6('0x16')])});})[_0x11d6('0xd')](handleError(_0x5af05b,null,_0x11d6('0xe')));}; \ No newline at end of file +var _0xfd4d=['catch','systeminformation','child_process','exec','../../config/logger','api','util','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','then','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0x186855,_0x604373){var _0x114ba4=function(_0x1e34e8){while(--_0x1e34e8){_0x186855['push'](_0x186855['shift']());}};_0x114ba4(++_0x604373);}(_0xfd4d,0x19f));var _0xdfd4=function(_0x52bb53,_0x2b0445){_0x52bb53=_0x52bb53-0x0;var _0x349304=_0xfd4d[_0x52bb53];return _0x349304;};'use strict';var info=require(_0xdfd4('0x0'));var exec=require(_0xdfd4('0x1'))[_0xdfd4('0x2')];var logger=require(_0xdfd4('0x3'))(_0xdfd4('0x4'));var util=require(_0xdfd4('0x5'));var BPromise=require('bluebird');var _=require(_0xdfd4('0x6'));function handleError(_0x5da104,_0x192a54,_0xe9348){_0x192a54=_0x192a54||0x1f4;return function(_0x5513d2){logger['error'](_0xdfd4('0x7'),_0xe9348,_0x192a54,util[_0xdfd4('0x8')](_0x5513d2,{'showHidden':![],'depth':null}));delete _0x5513d2['name'];_0x5da104[_0xdfd4('0x9')](_0x192a54)['send'](_0x5513d2);};}exports['index']=function(_0x357749,_0x349616){return info['getAllData']()[_0xdfd4('0xa')](function(_0x1738df){return _0x349616[_0xdfd4('0x9')](0xc8)[_0xdfd4('0xb')](_0x1738df);})['catch'](function(_0x35587a){return _0x349616[_0xdfd4('0x9')](0x1f4)['json'](_0x35587a);});};exports['killProcess']=function(_0xbcd01d,_0x80a877){var _0x371212=[_0xdfd4('0xc')];return new BPromise(function(_0x5529ca,_0x4fd60f){return exec(util[_0xdfd4('0xd')](_0xdfd4('0xe'),_0xbcd01d[_0xdfd4('0xf')][_0xdfd4('0x10')]),function(_0x3cae7f,_0x3f1d3b,_0x13805f){if(_0x3cae7f){return _0x4fd60f(_0x3cae7f);}return _0x5529ca(_0x3f1d3b);});})[_0xdfd4('0xa')](function(_0x34e9c9){var _0x4e16d8=![];var _0x33cc34=_0x34e9c9[_0xdfd4('0x11')](/\n/);for(var _0x58b914=0x0,_0x44aaf0=_0x371212[_0xdfd4('0x12')];_0x58b914<_0x44aaf0,_0x4e16d8===![];_0x58b914+=0x1){if(_0x34e9c9[_0xdfd4('0x13')](_0x371212[_0x58b914])>=0x0){_0x4e16d8=!![];}}if(!_0x4e16d8){throw new Error(util[_0xdfd4('0xd')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0xbcd01d[_0xdfd4('0xf')][_0xdfd4('0x10')]));}process[_0xdfd4('0x14')](_0xbcd01d['params'][_0xdfd4('0x10')],'SIGINT');return _0x80a877[_0xdfd4('0x9')](0xc8)[_0xdfd4('0xb')]({'message':util[_0xdfd4('0xd')](_0xdfd4('0x15'),_0xbcd01d['params'][_0xdfd4('0x10')])});})[_0xdfd4('0x16')](handleError(_0x80a877,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 8699ae7..6d5bf76 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 _0x5b20=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','get','show','post','create','put','/:id','delete','destroy'];(function(_0x20048c,_0x337690){var _0x1d7f4b=function(_0x420930){while(--_0x420930){_0x20048c['push'](_0x20048c['shift']());}};_0x1d7f4b(++_0x337690);}(_0x5b20,0xf1));var _0x05b2=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5b20[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0x05b2('0x0'));var path=require(_0x05b2('0x1'));var timeout=require(_0x05b2('0x2'));var express=require(_0x05b2('0x3'));var router=express['Router']();var fs_extra=require(_0x05b2('0x4'));var auth=require(_0x05b2('0x5'));var interaction=require(_0x05b2('0x6'));var config=require(_0x05b2('0x7'));var controller=require(_0x05b2('0x8'));router['get']('/',auth[_0x05b2('0x9')](),controller[_0x05b2('0xa')]);router[_0x05b2('0xb')]('/:id',auth[_0x05b2('0x9')](),controller[_0x05b2('0xc')]);router[_0x05b2('0xd')]('/',auth[_0x05b2('0x9')](),controller[_0x05b2('0xe')]);router[_0x05b2('0xf')](_0x05b2('0x10'),auth[_0x05b2('0x9')](),controller['update']);router[_0x05b2('0x11')](_0x05b2('0x10'),auth[_0x05b2('0x9')](),controller[_0x05b2('0x12')]);module[_0x05b2('0x13')]=router; \ No newline at end of file +var _0x80e0=['fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','get','isAuthenticated','post','create','put','/:id','update','destroy','exports','path','connect-timeout','express'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x80e0,0x9d));var _0x080e=function(_0xde1f01,_0x3e2455){_0xde1f01=_0xde1f01-0x0;var _0x3ee182=_0x80e0[_0xde1f01];return _0x3ee182;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x080e('0x0'));var timeout=require(_0x080e('0x1'));var express=require(_0x080e('0x2'));var router=express['Router']();var fs_extra=require(_0x080e('0x3'));var auth=require(_0x080e('0x4'));var interaction=require(_0x080e('0x5'));var config=require('../../config/environment');var controller=require(_0x080e('0x6'));router[_0x080e('0x7')]('/',auth[_0x080e('0x8')](),controller['index']);router['get']('/:id',auth[_0x080e('0x8')](),controller['show']);router[_0x080e('0x9')]('/',auth['isAuthenticated'](),controller[_0x080e('0xa')]);router[_0x080e('0xb')](_0x080e('0xc'),auth[_0x080e('0x8')](),controller[_0x080e('0xd')]);router['delete']('/:id',auth[_0x080e('0x8')](),controller[_0x080e('0xe')]);module[_0x080e('0xf')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 72eb333..c2d2e0a 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 _0x373d=['name','#0091EA','sequelize','STRING'];(function(_0x42aba3,_0x4ef48f){var _0x33b03c=function(_0x424739){while(--_0x424739){_0x42aba3['push'](_0x42aba3['shift']());}};_0x33b03c(++_0x4ef48f);}(_0x373d,0x1e2));var _0xd373=function(_0x4e3ac5,_0x18d402){_0x4e3ac5=_0x4e3ac5-0x0;var _0x3b408f=_0x373d[_0x4e3ac5];return _0x3b408f;};'use strict';var Sequelize=require(_0xd373('0x0'));module['exports']={'name':{'type':Sequelize[_0xd373('0x1')],'unique':_0xd373('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xd373('0x1')],'defaultValue':_0xd373('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9b00=['sequelize','exports','STRING','#0091EA'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x9b00,0xcc));var _0x09b0=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x9b00[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x09b0('0x0'));module[_0x09b0('0x1')]={'name':{'type':Sequelize[_0x09b0('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x09b0('0x2')],'defaultValue':_0x09b0('0x3')},'description':{'type':Sequelize[_0x09b0('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 89b4b6d..884e9be 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 _0x3685=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','index','Tag','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','map','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3685,0xf8));var _0x5368=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3685[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x5368('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5368('0x1'));var jsonpatch=require(_0x5368('0x2'));var rp=require(_0x5368('0x3'));var moment=require(_0x5368('0x4'));var BPromise=require(_0x5368('0x5'));var Mustache=require(_0x5368('0x6'));var util=require(_0x5368('0x7'));var path=require(_0x5368('0x8'));var sox=require(_0x5368('0x9'));var csv=require(_0x5368('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5368('0xb'));var _=require(_0x5368('0xc'));var squel=require(_0x5368('0xd'));var crypto=require(_0x5368('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5368('0xf'));var toCsv=require(_0x5368('0xa'));var querystring=require(_0x5368('0x10'));var Papa=require(_0x5368('0x11'));var Redis=require(_0x5368('0x12'));var authService=require(_0x5368('0x13'));var qs=require(_0x5368('0x14'));var as=require(_0x5368('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5368('0x16'))(_0x5368('0x17'));var utils=require(_0x5368('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5368('0x19'));var db=require(_0x5368('0x1a'))['db'];function respondWithStatusCode(_0x4940af,_0x5d6a86){_0x5d6a86=_0x5d6a86||0xcc;return function(_0x5c626a){if(_0x5c626a){return _0x4940af[_0x5368('0x1b')](_0x5d6a86);}return _0x4940af[_0x5368('0x1c')](_0x5d6a86)[_0x5368('0x1d')]();};}function respondWithResult(_0x5df43,_0xa5ce3c){_0xa5ce3c=_0xa5ce3c||0xc8;return function(_0x2f18dd){if(_0x2f18dd){return _0x5df43[_0x5368('0x1c')](_0xa5ce3c)[_0x5368('0x1e')](_0x2f18dd);}};}function respondWithFilteredResult(_0x3a3b8e,_0x5b1da2){return function(_0x524fbf){if(_0x524fbf){var _0x41ce0e=typeof _0x5b1da2[_0x5368('0x1f')]==='undefined'&&typeof _0x5b1da2[_0x5368('0x20')]===_0x5368('0x21');var _0x973143=_0x524fbf[_0x5368('0x22')];var _0x5b10e9=_0x41ce0e?0x0:_0x5b1da2[_0x5368('0x1f')];var _0x56ac4d=_0x41ce0e?_0x524fbf['count']:_0x5b1da2[_0x5368('0x1f')]+_0x5b1da2['limit'];var _0x52afa9;if(_0x56ac4d>=_0x973143){_0x56ac4d=_0x973143;_0x52afa9=0xc8;}else{_0x52afa9=0xce;}_0x3a3b8e['status'](_0x52afa9);return _0x3a3b8e[_0x5368('0x23')](_0x5368('0x24'),_0x5b10e9+'-'+_0x56ac4d+'/'+_0x973143)[_0x5368('0x1e')](_0x524fbf);}return null;};}function patchUpdates(_0x5cef40){return function(_0x4e3267){try{jsonpatch[_0x5368('0x25')](_0x4e3267,_0x5cef40,!![]);}catch(_0x3c891a){return BPromise[_0x5368('0x26')](_0x3c891a);}return _0x4e3267[_0x5368('0x27')]();};}function saveUpdates(_0x1c2fcd,_0x1093e2){return function(_0x4885d0){if(_0x4885d0){return _0x4885d0[_0x5368('0x28')](_0x1c2fcd)[_0x5368('0x29')](function(_0x4705f2){return _0x4705f2;});}return null;};}function removeEntity(_0x57108b,_0x45884f){return function(_0xb994f4){if(_0xb994f4){return _0xb994f4[_0x5368('0x2a')]()[_0x5368('0x29')](function(){var _0x1c287f=_0xb994f4[_0x5368('0x2b')]({'plain':!![]});var _0xabac8c=_0x5368('0x2c');return db[_0x5368('0x2d')]['destroy']({'where':{'type':_0xabac8c,'resourceId':_0x1c287f['id']}})['then'](function(){return _0xb994f4;});})[_0x5368('0x29')](function(){_0x57108b[_0x5368('0x1c')](0xcc)[_0x5368('0x1d')]();});}};}function handleEntityNotFound(_0x452c81,_0x131722){return function(_0x4b94cd){if(!_0x4b94cd){_0x452c81[_0x5368('0x1b')](0x194);}return _0x4b94cd;};}function handleError(_0x200ad0,_0x2e18e0){_0x2e18e0=_0x2e18e0||0x1f4;return function(_0x2bcf41){logger[_0x5368('0x2e')](_0x2bcf41[_0x5368('0x2f')]);if(_0x2bcf41[_0x5368('0x30')]){delete _0x2bcf41[_0x5368('0x30')];}_0x200ad0[_0x5368('0x1c')](_0x2e18e0)[_0x5368('0x31')](_0x2bcf41);};}exports[_0x5368('0x32')]=function(_0x46ea22,_0x7449cd){var _0x5810cb={},_0x73111b={},_0x256abd={'count':0x0,'rows':[]};var _0x36e230=_['map'](db[_0x5368('0x33')]['rawAttributes'],function(_0x26fc48){return{'name':_0x26fc48[_0x5368('0x34')],'type':_0x26fc48['type'][_0x5368('0x35')]};});_0x73111b[_0x5368('0x36')]=_['map'](_0x36e230,'name');_0x73111b[_0x5368('0x37')]=_[_0x5368('0x38')](_0x46ea22['query']);_0x73111b[_0x5368('0x39')]=_[_0x5368('0x3a')](_0x73111b[_0x5368('0x36')],_0x73111b['query']);_0x5810cb[_0x5368('0x3b')]=_['intersection'](_0x73111b[_0x5368('0x36')],qs[_0x5368('0x3c')](_0x46ea22[_0x5368('0x37')]['fields']));_0x5810cb[_0x5368('0x3b')]=_0x5810cb[_0x5368('0x3b')][_0x5368('0x3d')]?_0x5810cb[_0x5368('0x3b')]:_0x73111b['model'];if(!_0x46ea22[_0x5368('0x37')]['hasOwnProperty'](_0x5368('0x3e'))){_0x5810cb[_0x5368('0x20')]=qs['limit'](_0x46ea22[_0x5368('0x37')][_0x5368('0x20')]);_0x5810cb[_0x5368('0x1f')]=qs[_0x5368('0x1f')](_0x46ea22['query'][_0x5368('0x1f')]);}_0x5810cb[_0x5368('0x3f')]=qs[_0x5368('0x40')](_0x46ea22[_0x5368('0x37')][_0x5368('0x40')]);_0x5810cb['where']=qs[_0x5368('0x39')](_[_0x5368('0x41')](_0x46ea22['query'],_0x73111b[_0x5368('0x39')]),_0x36e230);if(_0x46ea22[_0x5368('0x37')][_0x5368('0x42')]){_0x5810cb['where']=_[_0x5368('0x43')](_0x5810cb[_0x5368('0x44')],{'$or':_[_0x5368('0x45')](_0x36e230,function(_0x25e432){if(_0x25e432['type']!=='VIRTUAL'){var _0x1be46a={};_0x1be46a[_0x25e432[_0x5368('0x30')]]={'$like':'%'+_0x46ea22[_0x5368('0x37')]['filter']+'%'};return _0x1be46a;}})});}_0x5810cb=_['merge']({},_0x5810cb,_0x46ea22[_0x5368('0x46')]);var _0x5ae3f1={'where':_0x5810cb[_0x5368('0x44')]};return db[_0x5368('0x33')]['count'](_0x5ae3f1)[_0x5368('0x29')](function(_0x3b57a2){_0x256abd[_0x5368('0x22')]=_0x3b57a2;if(_0x46ea22[_0x5368('0x37')][_0x5368('0x47')]){_0x5810cb[_0x5368('0x48')]=[{'all':!![]}];}return db[_0x5368('0x33')][_0x5368('0x49')](_0x5810cb);})[_0x5368('0x29')](function(_0x43c776){_0x256abd[_0x5368('0x4a')]=_0x43c776;return _0x256abd;})[_0x5368('0x29')](respondWithFilteredResult(_0x7449cd,_0x5810cb))['catch'](handleError(_0x7449cd,null));};exports[_0x5368('0x4b')]=function(_0x61b1a1,_0xd4e247){var _0x4cb800={'raw':!![],'where':{'id':_0x61b1a1[_0x5368('0x4c')]['id']}},_0x1b66a1={};_0x1b66a1['model']=_[_0x5368('0x38')](db[_0x5368('0x33')][_0x5368('0x4d')]);_0x1b66a1[_0x5368('0x37')]=_[_0x5368('0x38')](_0x61b1a1[_0x5368('0x37')]);_0x1b66a1[_0x5368('0x39')]=_[_0x5368('0x3a')](_0x1b66a1[_0x5368('0x36')],_0x1b66a1[_0x5368('0x37')]);_0x4cb800['attributes']=_['intersection'](_0x1b66a1[_0x5368('0x36')],qs[_0x5368('0x3c')](_0x61b1a1[_0x5368('0x37')][_0x5368('0x3c')]));_0x4cb800['attributes']=_0x4cb800['attributes'][_0x5368('0x3d')]?_0x4cb800['attributes']:_0x1b66a1[_0x5368('0x36')];if(_0x61b1a1['query'][_0x5368('0x47')]){_0x4cb800['include']=[{'all':!![]}];}_0x4cb800=_[_0x5368('0x43')]({},_0x4cb800,_0x61b1a1[_0x5368('0x46')]);return db['Tag']['find'](_0x4cb800)[_0x5368('0x29')](handleEntityNotFound(_0xd4e247,null))['then'](respondWithResult(_0xd4e247,null))[_0x5368('0x4e')](handleError(_0xd4e247,null));};exports[_0x5368('0x4f')]=function(_0x2ee00b,_0x121d8d){return db['Tag'][_0x5368('0x4f')](_0x2ee00b[_0x5368('0x50')],{})[_0x5368('0x29')](function(_0x1d9c87){var _0x20e641=_0x2ee00b[_0x5368('0x51')][_0x5368('0x2b')]({'plain':!![]});if(!_0x20e641)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20e641['role']===_0x5368('0x51')){var _0x7d7a5=_0x1d9c87[_0x5368('0x2b')]({'plain':!![]});var _0x4850f8=_0x5368('0x2c');return db[_0x5368('0x52')][_0x5368('0x53')]({'where':{'name':_0x4850f8,'userProfileId':_0x20e641[_0x5368('0x54')]},'raw':!![]})[_0x5368('0x29')](function(_0x233bf6){if(_0x233bf6&&_0x233bf6[_0x5368('0x55')]===0x0){return db[_0x5368('0x2d')]['create']({'name':_0x7d7a5[_0x5368('0x30')],'resourceId':_0x7d7a5['id'],'type':_0x233bf6[_0x5368('0x30')],'sectionId':_0x233bf6['id']},{})[_0x5368('0x29')](function(){return _0x1d9c87;});}else{return _0x1d9c87;}})[_0x5368('0x4e')](function(_0x5720c8){logger[_0x5368('0x2e')](_0x5368('0x56'),_0x5720c8);throw _0x5720c8;});}return _0x1d9c87;})[_0x5368('0x29')](respondWithResult(_0x121d8d,0xc9))[_0x5368('0x4e')](handleError(_0x121d8d,null));};exports[_0x5368('0x28')]=function(_0x44a481,_0x42544e){if(_0x44a481[_0x5368('0x50')]['id']){delete _0x44a481[_0x5368('0x50')]['id'];}return db[_0x5368('0x33')][_0x5368('0x53')]({'where':{'id':_0x44a481[_0x5368('0x4c')]['id']}})[_0x5368('0x29')](handleEntityNotFound(_0x42544e,null))[_0x5368('0x29')](saveUpdates(_0x44a481['body'],null))[_0x5368('0x29')](respondWithResult(_0x42544e,null))[_0x5368('0x4e')](handleError(_0x42544e,null));};exports[_0x5368('0x2a')]=function(_0x2971de,_0x2688a9){return db[_0x5368('0x33')]['find']({'where':{'id':_0x2971de[_0x5368('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2688a9,null))[_0x5368('0x29')](removeEntity(_0x2688a9,null))[_0x5368('0x4e')](handleError(_0x2688a9,null));}; \ No newline at end of file +var _0xfd28=['include','findAll','catch','show','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','save','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Tag','includeAll'];(function(_0x2bbb40,_0x3b70c8){var _0x108088=function(_0x15a27c){while(--_0x15a27c){_0x2bbb40['push'](_0x2bbb40['shift']());}};_0x108088(++_0x3b70c8);}(_0xfd28,0x148));var _0x8fd2=function(_0xcfeff4,_0x3f2e19){_0xcfeff4=_0xcfeff4-0x0;var _0xb2fadc=_0xfd28[_0xcfeff4];return _0xb2fadc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8fd2('0x0'));var zipdir=require(_0x8fd2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8fd2('0x2'));var moment=require('moment');var BPromise=require(_0x8fd2('0x3'));var Mustache=require(_0x8fd2('0x4'));var util=require(_0x8fd2('0x5'));var path=require('path');var sox=require(_0x8fd2('0x6'));var csv=require(_0x8fd2('0x7'));var ejs=require(_0x8fd2('0x8'));var fs=require('fs');var fs_extra=require(_0x8fd2('0x9'));var _=require(_0x8fd2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8fd2('0xb'));var deskjs=require(_0x8fd2('0xc'));var toCsv=require(_0x8fd2('0x7'));var querystring=require('querystring');var Papa=require(_0x8fd2('0xd'));var Redis=require('ioredis');var authService=require(_0x8fd2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8fd2('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8fd2('0x10'))('api');var utils=require(_0x8fd2('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x8fd2('0x12'));var db=require(_0x8fd2('0x13'))['db'];function respondWithStatusCode(_0xfd78d,_0xa6d7ca){_0xa6d7ca=_0xa6d7ca||0xcc;return function(_0x17ad4c){if(_0x17ad4c){return _0xfd78d[_0x8fd2('0x14')](_0xa6d7ca);}return _0xfd78d[_0x8fd2('0x15')](_0xa6d7ca)[_0x8fd2('0x16')]();};}function respondWithResult(_0x2b152c,_0x2b4611){_0x2b4611=_0x2b4611||0xc8;return function(_0x118329){if(_0x118329){return _0x2b152c[_0x8fd2('0x15')](_0x2b4611)[_0x8fd2('0x17')](_0x118329);}};}function respondWithFilteredResult(_0x40712c,_0xa65b4){return function(_0x596639){if(_0x596639){var _0x20daca=typeof _0xa65b4['offset']==='undefined'&&typeof _0xa65b4['limit']===_0x8fd2('0x18');var _0x530866=_0x596639[_0x8fd2('0x19')];var _0x12e8a3=_0x20daca?0x0:_0xa65b4['offset'];var _0xabbeb4=_0x20daca?_0x596639[_0x8fd2('0x19')]:_0xa65b4[_0x8fd2('0x1a')]+_0xa65b4[_0x8fd2('0x1b')];var _0x14641a;if(_0xabbeb4>=_0x530866){_0xabbeb4=_0x530866;_0x14641a=0xc8;}else{_0x14641a=0xce;}_0x40712c['status'](_0x14641a);return _0x40712c['set'](_0x8fd2('0x1c'),_0x12e8a3+'-'+_0xabbeb4+'/'+_0x530866)['json'](_0x596639);}return null;};}function patchUpdates(_0x3c03de){return function(_0x490b39){try{jsonpatch[_0x8fd2('0x1d')](_0x490b39,_0x3c03de,!![]);}catch(_0x50f410){return BPromise['reject'](_0x50f410);}return _0x490b39[_0x8fd2('0x1e')]();};}function saveUpdates(_0x4c2be8,_0xd3981f){return function(_0x44ee7a){if(_0x44ee7a){return _0x44ee7a['update'](_0x4c2be8)[_0x8fd2('0x1f')](function(_0x2a9c3c){return _0x2a9c3c;});}return null;};}function removeEntity(_0x120285,_0x490ea5){return function(_0x299c1c){if(_0x299c1c){return _0x299c1c[_0x8fd2('0x20')]()[_0x8fd2('0x1f')](function(){var _0x4742cf=_0x299c1c[_0x8fd2('0x21')]({'plain':!![]});var _0x25db4e=_0x8fd2('0x22');return db[_0x8fd2('0x23')][_0x8fd2('0x20')]({'where':{'type':_0x25db4e,'resourceId':_0x4742cf['id']}})[_0x8fd2('0x1f')](function(){return _0x299c1c;});})[_0x8fd2('0x1f')](function(){_0x120285[_0x8fd2('0x15')](0xcc)[_0x8fd2('0x16')]();});}};}function handleEntityNotFound(_0x512e5a,_0x4c6af7){return function(_0x345bc3){if(!_0x345bc3){_0x512e5a[_0x8fd2('0x14')](0x194);}return _0x345bc3;};}function handleError(_0x288bcd,_0x56f294){_0x56f294=_0x56f294||0x1f4;return function(_0x2f26ae){logger[_0x8fd2('0x24')](_0x2f26ae[_0x8fd2('0x25')]);if(_0x2f26ae[_0x8fd2('0x26')]){delete _0x2f26ae[_0x8fd2('0x26')];}_0x288bcd[_0x8fd2('0x15')](_0x56f294)[_0x8fd2('0x27')](_0x2f26ae);};}exports['index']=function(_0xe76676,_0x13c9b9){var _0x818f61={},_0x446c7a={},_0x313902={'count':0x0,'rows':[]};var _0x3ea575=_[_0x8fd2('0x28')](db['Tag']['rawAttributes'],function(_0x5144ba){return{'name':_0x5144ba[_0x8fd2('0x29')],'type':_0x5144ba[_0x8fd2('0x2a')][_0x8fd2('0x2b')]};});_0x446c7a[_0x8fd2('0x2c')]=_['map'](_0x3ea575,'name');_0x446c7a[_0x8fd2('0x2d')]=_[_0x8fd2('0x2e')](_0xe76676[_0x8fd2('0x2d')]);_0x446c7a[_0x8fd2('0x2f')]=_[_0x8fd2('0x30')](_0x446c7a['model'],_0x446c7a[_0x8fd2('0x2d')]);_0x818f61['attributes']=_[_0x8fd2('0x30')](_0x446c7a['model'],qs[_0x8fd2('0x31')](_0xe76676['query'][_0x8fd2('0x31')]));_0x818f61[_0x8fd2('0x32')]=_0x818f61[_0x8fd2('0x32')]['length']?_0x818f61[_0x8fd2('0x32')]:_0x446c7a['model'];if(!_0xe76676[_0x8fd2('0x2d')][_0x8fd2('0x33')](_0x8fd2('0x34'))){_0x818f61['limit']=qs[_0x8fd2('0x1b')](_0xe76676[_0x8fd2('0x2d')][_0x8fd2('0x1b')]);_0x818f61['offset']=qs[_0x8fd2('0x1a')](_0xe76676[_0x8fd2('0x2d')][_0x8fd2('0x1a')]);}_0x818f61['order']=qs[_0x8fd2('0x35')](_0xe76676[_0x8fd2('0x2d')]['sort']);_0x818f61[_0x8fd2('0x36')]=qs[_0x8fd2('0x2f')](_[_0x8fd2('0x37')](_0xe76676[_0x8fd2('0x2d')],_0x446c7a[_0x8fd2('0x2f')]),_0x3ea575);if(_0xe76676[_0x8fd2('0x2d')][_0x8fd2('0x38')]){_0x818f61['where']=_[_0x8fd2('0x39')](_0x818f61['where'],{'$or':_['map'](_0x3ea575,function(_0x38fff9){if(_0x38fff9[_0x8fd2('0x2a')]!==_0x8fd2('0x3a')){var _0x2edcfd={};_0x2edcfd[_0x38fff9[_0x8fd2('0x26')]]={'$like':'%'+_0xe76676[_0x8fd2('0x2d')]['filter']+'%'};return _0x2edcfd;}})});}_0x818f61=_['merge']({},_0x818f61,_0xe76676[_0x8fd2('0x3b')]);var _0x4aff57={'where':_0x818f61['where']};return db[_0x8fd2('0x3c')][_0x8fd2('0x19')](_0x4aff57)[_0x8fd2('0x1f')](function(_0x28f927){_0x313902['count']=_0x28f927;if(_0xe76676[_0x8fd2('0x2d')][_0x8fd2('0x3d')]){_0x818f61[_0x8fd2('0x3e')]=[{'all':!![]}];}return db[_0x8fd2('0x3c')][_0x8fd2('0x3f')](_0x818f61);})[_0x8fd2('0x1f')](function(_0xb1938a){_0x313902['rows']=_0xb1938a;return _0x313902;})[_0x8fd2('0x1f')](respondWithFilteredResult(_0x13c9b9,_0x818f61))[_0x8fd2('0x40')](handleError(_0x13c9b9,null));};exports[_0x8fd2('0x41')]=function(_0x70404e,_0xde7e1){var _0x12b014={'raw':!![],'where':{'id':_0x70404e['params']['id']}},_0x40a572={};_0x40a572[_0x8fd2('0x2c')]=_[_0x8fd2('0x2e')](db[_0x8fd2('0x3c')][_0x8fd2('0x42')]);_0x40a572[_0x8fd2('0x2d')]=_[_0x8fd2('0x2e')](_0x70404e[_0x8fd2('0x2d')]);_0x40a572['filters']=_[_0x8fd2('0x30')](_0x40a572['model'],_0x40a572[_0x8fd2('0x2d')]);_0x12b014['attributes']=_[_0x8fd2('0x30')](_0x40a572[_0x8fd2('0x2c')],qs[_0x8fd2('0x31')](_0x70404e['query'][_0x8fd2('0x31')]));_0x12b014[_0x8fd2('0x32')]=_0x12b014[_0x8fd2('0x32')]['length']?_0x12b014[_0x8fd2('0x32')]:_0x40a572['model'];if(_0x70404e[_0x8fd2('0x2d')][_0x8fd2('0x3d')]){_0x12b014[_0x8fd2('0x3e')]=[{'all':!![]}];}_0x12b014=_[_0x8fd2('0x39')]({},_0x12b014,_0x70404e[_0x8fd2('0x3b')]);return db[_0x8fd2('0x3c')][_0x8fd2('0x43')](_0x12b014)[_0x8fd2('0x1f')](handleEntityNotFound(_0xde7e1,null))[_0x8fd2('0x1f')](respondWithResult(_0xde7e1,null))[_0x8fd2('0x40')](handleError(_0xde7e1,null));};exports[_0x8fd2('0x44')]=function(_0x34f3a2,_0xd3d8cb){return db[_0x8fd2('0x3c')][_0x8fd2('0x44')](_0x34f3a2[_0x8fd2('0x45')],{})[_0x8fd2('0x1f')](function(_0x2a2c69){var _0x2fdbe5=_0x34f3a2['user']['get']({'plain':!![]});if(!_0x2fdbe5)throw new Error(_0x8fd2('0x46'));if(_0x2fdbe5[_0x8fd2('0x47')]===_0x8fd2('0x48')){var _0x5d79c3=_0x2a2c69['get']({'plain':!![]});var _0x177f04='Tags';return db[_0x8fd2('0x49')][_0x8fd2('0x43')]({'where':{'name':_0x177f04,'userProfileId':_0x2fdbe5[_0x8fd2('0x4a')]},'raw':!![]})['then'](function(_0x2251d9){if(_0x2251d9&&_0x2251d9[_0x8fd2('0x4b')]===0x0){return db['UserProfileResource'][_0x8fd2('0x44')]({'name':_0x5d79c3[_0x8fd2('0x26')],'resourceId':_0x5d79c3['id'],'type':_0x2251d9[_0x8fd2('0x26')],'sectionId':_0x2251d9['id']},{})['then'](function(){return _0x2a2c69;});}else{return _0x2a2c69;}})[_0x8fd2('0x40')](function(_0x14cdc2){logger[_0x8fd2('0x24')](_0x8fd2('0x4c'),_0x14cdc2);throw _0x14cdc2;});}return _0x2a2c69;})[_0x8fd2('0x1f')](respondWithResult(_0xd3d8cb,0xc9))[_0x8fd2('0x40')](handleError(_0xd3d8cb,null));};exports['update']=function(_0x4d5340,_0x46a1a1){if(_0x4d5340[_0x8fd2('0x45')]['id']){delete _0x4d5340['body']['id'];}return db[_0x8fd2('0x3c')]['find']({'where':{'id':_0x4d5340['params']['id']}})[_0x8fd2('0x1f')](handleEntityNotFound(_0x46a1a1,null))[_0x8fd2('0x1f')](saveUpdates(_0x4d5340[_0x8fd2('0x45')],null))[_0x8fd2('0x1f')](respondWithResult(_0x46a1a1,null))[_0x8fd2('0x40')](handleError(_0x46a1a1,null));};exports[_0x8fd2('0x20')]=function(_0x52c912,_0x2f4759){return db[_0x8fd2('0x3c')][_0x8fd2('0x43')]({'where':{'id':_0x52c912[_0x8fd2('0x4d')]['id']}})[_0x8fd2('0x1f')](handleEntityNotFound(_0x2f4759,null))['then'](removeEntity(_0x2f4759,null))['catch'](handleError(_0x2f4759,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index e89093c..f0e0b76 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 _0x4a06=['path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x572b4e,_0x5e95d1){var _0x5e70ad=function(_0x282dd2){while(--_0x282dd2){_0x572b4e['push'](_0x572b4e['shift']());}};_0x5e70ad(++_0x5e95d1);}(_0x4a06,0x1f2));var _0x64a0=function(_0x9d720f,_0x4eb60f){_0x9d720f=_0x9d720f-0x0;var _0x1bb8d5=_0x4a06[_0x9d720f];return _0x1bb8d5;};'use strict';var _=require(_0x64a0('0x0'));var util=require(_0x64a0('0x1'));var logger=require(_0x64a0('0x2'))(_0x64a0('0x3'));var moment=require(_0x64a0('0x4'));var BPromise=require(_0x64a0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64a0('0x6'));var rimraf=require(_0x64a0('0x7'));var config=require(_0x64a0('0x8'));var attributes=require(_0x64a0('0x9'));module[_0x64a0('0xa')]=function(_0xba1d8f,_0x37464e){return _0xba1d8f[_0x64a0('0xb')](_0x64a0('0xc'),attributes,{'tableName':_0x64a0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9990=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./tag.attributes','exports','define','Tag','tools_tags','util'];(function(_0x9388c8,_0x2cdf84){var _0x6f1d3a=function(_0x6a3073){while(--_0x6a3073){_0x9388c8['push'](_0x9388c8['shift']());}};_0x6f1d3a(++_0x2cdf84);}(_0x9990,0xf6));var _0x0999=function(_0x36fe1e,_0x175199){_0x36fe1e=_0x36fe1e-0x0;var _0x3368ef=_0x9990[_0x36fe1e];return _0x3368ef;};'use strict';var _=require('lodash');var util=require(_0x0999('0x0'));var logger=require(_0x0999('0x1'))(_0x0999('0x2'));var moment=require(_0x0999('0x3'));var BPromise=require(_0x0999('0x4'));var rp=require(_0x0999('0x5'));var fs=require('fs');var path=require(_0x0999('0x6'));var rimraf=require(_0x0999('0x7'));var config=require('../../config/environment');var attributes=require(_0x0999('0x8'));module[_0x0999('0x9')]=function(_0x45d3e0,_0x4c606f){return _0x45d3e0[_0x0999('0xa')](_0x0999('0xb'),attributes,{'tableName':_0x0999('0xc'),'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 0b4e51e..7679320 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 _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','Tag,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x2008a1,_0x1c1a48){var _0x464e0a=function(_0x90eb58){while(--_0x90eb58){_0x2008a1['push'](_0x2008a1['shift']());}};_0x464e0a(++_0x1c1a48);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5466ab,_0x227b13){_0x5466ab=_0x5466ab-0x0;var _0x40751a=_0x4b84[_0x5466ab];return _0x40751a;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('Tag,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('Tag,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});} \ No newline at end of file +var _0xf72b=['../../config/environment','jayson/promise','client','request','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3d510a,_0x4675ea){var _0x13f6bd=function(_0xbbc6b7){while(--_0xbbc6b7){_0x3d510a['push'](_0x3d510a['shift']());}};_0x13f6bd(++_0x4675ea);}(_0xf72b,0x1d9));var _0xbf72=function(_0x1534f8,_0x149716){_0x1534f8=_0x1534f8-0x0;var _0x43f8e3=_0xf72b[_0x1534f8];return _0x43f8e3;};'use strict';var _=require(_0xbf72('0x0'));var util=require('util');var moment=require(_0xbf72('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf72('0x2'));var fs=require('fs');var Redis=require(_0xbf72('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf72('0x4'));var logger=require(_0xbf72('0x5'))(_0xbf72('0x6'));var config=require(_0xbf72('0x7'));var jayson=require(_0xbf72('0x8'));var client=jayson[_0xbf72('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41c11d,_0xc0842b,_0x119807){return new BPromise(function(_0xd0402c,_0xdd6177){return client[_0xbf72('0xa')](_0x41c11d,_0x119807)['then'](function(_0x455891){logger['info'](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));logger['debug'](_0xbf72('0xd'),_0xc0842b,_0xbf72('0xc'),JSON[_0xbf72('0xe')](_0x455891));if(_0x455891[_0xbf72('0xf')]){if(_0x455891[_0xbf72('0xf')][_0xbf72('0x10')]===0x1f4){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x455891['error'][_0xbf72('0x11')]);return _0xdd6177(_0x455891[_0xbf72('0xf')][_0xbf72('0x11')]);}logger['error'](_0xbf72('0xb'),_0xc0842b,_0x455891['error']['message']);return _0xd0402c(_0x455891['error'][_0xbf72('0x11')]);}else{logger[_0xbf72('0x12')](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));_0xd0402c(_0x455891[_0xbf72('0x13')][_0xbf72('0x11')]);}})['catch'](function(_0x266ce2){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x266ce2);_0xdd6177(_0x266ce2);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 1a77e9b..50286b0 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(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 7a144c1..4cf9dc0 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 _0xb7e7=['STRING','sequelize'];(function(_0x2a5099,_0x329e92){var _0x2802f1=function(_0x53f99b){while(--_0x53f99b){_0x2a5099['push'](_0x2a5099['shift']());}};_0x2802f1(++_0x329e92);}(_0xb7e7,0x121));var _0x7b7e=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xb7e7[_0xbd08b4];return _0x314f1e;};'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 +var _0xd8b0=['exports','sequelize'];(function(_0x542980,_0x20dc2c){var _0x3a936c=function(_0xe1ee9e){while(--_0xe1ee9e){_0x542980['push'](_0x542980['shift']());}};_0x3a936c(++_0x20dc2c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index afd8a14..84e62c8 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 _0xa947=['UserVoiceQueueRt','SIP/%s','voicePause','TeamVoiceQueue','all','VoicePrefixId','addAgents','removeAgents','Whatsapp','Queue:remove','User','getAgents','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','Team','then','includeAll','include','findAll','catch','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','UserProfileSection','userProfileId','autoAssociation','destroy','sequelize','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','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','UserProfileResource','getQueues','findOne','isValidChannel','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','addQueues','add','Queues','ids','removeQueues','remove','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','transaction','through','QueueId','penalty','emit','Queue:save','online','interface'];(function(_0x256e32,_0x4013bc){var _0x464070=function(_0x449398){while(--_0x449398){_0x256e32['push'](_0x256e32['shift']());}};_0x464070(++_0x4013bc);}(_0xa947,0xaa));var _0x7a94=function(_0x4b5ae2,_0x5e7492){_0x4b5ae2=_0x4b5ae2-0x0;var _0x48a4ab=_0xa947[_0x4b5ae2];return _0x48a4ab;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7a94('0x0'));var jsonpatch=require(_0x7a94('0x1'));var rp=require(_0x7a94('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7a94('0x3'));var util=require(_0x7a94('0x4'));var path=require(_0x7a94('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7a94('0x6'));var fs=require('fs');var fs_extra=require(_0x7a94('0x7'));var _=require(_0x7a94('0x8'));var squel=require(_0x7a94('0x9'));var crypto=require('crypto');var jsforce=require(_0x7a94('0xa'));var deskjs=require(_0x7a94('0xb'));var toCsv=require(_0x7a94('0xc'));var querystring=require(_0x7a94('0xd'));var Papa=require(_0x7a94('0xe'));var Redis=require(_0x7a94('0xf'));var authService=require(_0x7a94('0x10'));var qs=require(_0x7a94('0x11'));var as=require(_0x7a94('0x12'));var hardwareService=require(_0x7a94('0x13'));var logger=require('../../config/logger')(_0x7a94('0x14'));var utils=require('../../config/utils');var config=require(_0x7a94('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7a94('0x16'))['db'];config[_0x7a94('0x17')]=_[_0x7a94('0x18')](config[_0x7a94('0x17')],{'host':_0x7a94('0x19'),'port':0x18eb});var socket=require(_0x7a94('0x1a'))(new Redis(config[_0x7a94('0x17')]));require(_0x7a94('0x1b'))[_0x7a94('0x1c')](socket);function respondWithStatusCode(_0x4023ea,_0x407a38){_0x407a38=_0x407a38||0xcc;return function(_0x26a1f2){if(_0x26a1f2){return _0x4023ea[_0x7a94('0x1d')](_0x407a38);}return _0x4023ea['status'](_0x407a38)[_0x7a94('0x1e')]();};}function respondWithResult(_0x12c28a,_0x44d0ba){_0x44d0ba=_0x44d0ba||0xc8;return function(_0x3cf815){if(_0x3cf815){return _0x12c28a[_0x7a94('0x1f')](_0x44d0ba)[_0x7a94('0x20')](_0x3cf815);}};}function respondWithFilteredResult(_0x5c000e,_0x5b9417){return function(_0x495bbc){if(_0x495bbc){var _0x353cd6=typeof _0x5b9417['offset']===_0x7a94('0x21')&&typeof _0x5b9417[_0x7a94('0x22')]===_0x7a94('0x21');var _0x3b0716=_0x495bbc['count'];var _0x191fba=_0x353cd6?0x0:_0x5b9417[_0x7a94('0x23')];var _0x5bf104=_0x353cd6?_0x495bbc[_0x7a94('0x24')]:_0x5b9417['offset']+_0x5b9417[_0x7a94('0x22')];var _0x40ada9;if(_0x5bf104>=_0x3b0716){_0x5bf104=_0x3b0716;_0x40ada9=0xc8;}else{_0x40ada9=0xce;}_0x5c000e['status'](_0x40ada9);return _0x5c000e[_0x7a94('0x25')](_0x7a94('0x26'),_0x191fba+'-'+_0x5bf104+'/'+_0x3b0716)[_0x7a94('0x20')](_0x495bbc);}return null;};}function patchUpdates(_0x5d4714){return function(_0x14d37a){try{jsonpatch[_0x7a94('0x27')](_0x14d37a,_0x5d4714,!![]);}catch(_0x4863a4){return BPromise[_0x7a94('0x28')](_0x4863a4);}return _0x14d37a[_0x7a94('0x29')]();};}function saveUpdates(_0x4ee00d,_0x17af35){return function(_0x127733){if(_0x127733){return _0x127733[_0x7a94('0x2a')](_0x4ee00d)['then'](function(_0x2dd890){return _0x2dd890;});}return null;};}function handleEntityNotFound(_0x3434bb,_0x180000){return function(_0x35107e){if(!_0x35107e){_0x3434bb['sendStatus'](0x194);}return _0x35107e;};}function handleError(_0x2ac19f,_0x3b1f8b){_0x3b1f8b=_0x3b1f8b||0x1f4;return function(_0x33bfb2){logger[_0x7a94('0x2b')](_0x33bfb2[_0x7a94('0x2c')]);if(_0x33bfb2[_0x7a94('0x2d')]){delete _0x33bfb2[_0x7a94('0x2d')];}_0x2ac19f['status'](_0x3b1f8b)[_0x7a94('0x2e')](_0x33bfb2);};}exports[_0x7a94('0x2f')]=function(_0x4a71f1,_0x2a2527){var _0x2e2267={},_0x3e791c={},_0x5e9a4e={'count':0x0,'rows':[]};var _0x9a1549=_[_0x7a94('0x30')](db['Team'][_0x7a94('0x31')],function(_0x538f0e){return{'name':_0x538f0e[_0x7a94('0x32')],'type':_0x538f0e[_0x7a94('0x33')][_0x7a94('0x34')]};});_0x3e791c[_0x7a94('0x35')]=_[_0x7a94('0x30')](_0x9a1549,'name');_0x3e791c['query']=_[_0x7a94('0x36')](_0x4a71f1[_0x7a94('0x37')]);_0x3e791c[_0x7a94('0x38')]=_['intersection'](_0x3e791c[_0x7a94('0x35')],_0x3e791c[_0x7a94('0x37')]);_0x2e2267['attributes']=_['intersection'](_0x3e791c[_0x7a94('0x35')],qs[_0x7a94('0x39')](_0x4a71f1[_0x7a94('0x37')][_0x7a94('0x39')]));_0x2e2267['attributes']=_0x2e2267[_0x7a94('0x3a')][_0x7a94('0x3b')]?_0x2e2267[_0x7a94('0x3a')]:_0x3e791c[_0x7a94('0x35')];if(!_0x4a71f1[_0x7a94('0x37')][_0x7a94('0x3c')](_0x7a94('0x3d'))){_0x2e2267['limit']=qs['limit'](_0x4a71f1['query'][_0x7a94('0x22')]);_0x2e2267[_0x7a94('0x23')]=qs[_0x7a94('0x23')](_0x4a71f1[_0x7a94('0x37')]['offset']);}_0x2e2267[_0x7a94('0x3e')]=qs[_0x7a94('0x3f')](_0x4a71f1[_0x7a94('0x37')][_0x7a94('0x3f')]);_0x2e2267['where']=qs[_0x7a94('0x38')](_['pick'](_0x4a71f1[_0x7a94('0x37')],_0x3e791c[_0x7a94('0x38')]),_0x9a1549);if(_0x4a71f1[_0x7a94('0x37')][_0x7a94('0x40')]){_0x2e2267[_0x7a94('0x41')]=_[_0x7a94('0x42')](_0x2e2267[_0x7a94('0x41')],{'$or':_[_0x7a94('0x30')](_0x9a1549,function(_0xbe4db6){if(_0xbe4db6[_0x7a94('0x33')]!==_0x7a94('0x43')){var _0x1b7b47={};_0x1b7b47[_0xbe4db6[_0x7a94('0x2d')]]={'$like':'%'+_0x4a71f1[_0x7a94('0x37')][_0x7a94('0x40')]+'%'};return _0x1b7b47;}})});}_0x2e2267=_['merge']({},_0x2e2267,_0x4a71f1[_0x7a94('0x44')]);var _0x20bef1={'where':_0x2e2267[_0x7a94('0x41')]};return db[_0x7a94('0x45')][_0x7a94('0x24')](_0x20bef1)[_0x7a94('0x46')](function(_0x4a6fbf){_0x5e9a4e['count']=_0x4a6fbf;if(_0x4a71f1[_0x7a94('0x37')][_0x7a94('0x47')]){_0x2e2267[_0x7a94('0x48')]=[{'all':!![]}];}return db[_0x7a94('0x45')][_0x7a94('0x49')](_0x2e2267);})[_0x7a94('0x46')](function(_0x54da0a){_0x5e9a4e['rows']=_0x54da0a;return _0x5e9a4e;})[_0x7a94('0x46')](respondWithFilteredResult(_0x2a2527,_0x2e2267))[_0x7a94('0x4a')](handleError(_0x2a2527,null));};exports[_0x7a94('0x4b')]=function(_0x3d0716,_0x34fffd){var _0x4241e8={'raw':![],'where':{'id':_0x3d0716[_0x7a94('0x4c')]['id']}},_0x5246fb={};_0x5246fb['model']=_[_0x7a94('0x36')](db[_0x7a94('0x45')][_0x7a94('0x31')]);_0x5246fb[_0x7a94('0x37')]=_['keys'](_0x3d0716[_0x7a94('0x37')]);_0x5246fb[_0x7a94('0x38')]=_['intersection'](_0x5246fb[_0x7a94('0x35')],_0x5246fb[_0x7a94('0x37')]);_0x4241e8[_0x7a94('0x3a')]=_[_0x7a94('0x4d')](_0x5246fb[_0x7a94('0x35')],qs[_0x7a94('0x39')](_0x3d0716[_0x7a94('0x37')]['fields']));_0x4241e8[_0x7a94('0x3a')]=_0x4241e8[_0x7a94('0x3a')]['length']?_0x4241e8[_0x7a94('0x3a')]:_0x5246fb['model'];if(_0x3d0716['query'][_0x7a94('0x47')]){_0x4241e8[_0x7a94('0x48')]=[{'all':!![]}];}_0x4241e8=_[_0x7a94('0x42')]({},_0x4241e8,_0x3d0716[_0x7a94('0x44')]);return db[_0x7a94('0x45')][_0x7a94('0x4e')](_0x4241e8)[_0x7a94('0x46')](handleEntityNotFound(_0x34fffd,null))[_0x7a94('0x46')](respondWithResult(_0x34fffd,null))['catch'](handleError(_0x34fffd,null));};exports[_0x7a94('0x4f')]=function(_0x58ca9f,_0x1e12a0){return db[_0x7a94('0x45')][_0x7a94('0x4f')](_0x58ca9f[_0x7a94('0x50')],{})['then'](function(_0x6e956f){var _0x4bf30c=_0x58ca9f[_0x7a94('0x51')]['get']({'plain':!![]});if(!_0x4bf30c)throw new Error(_0x7a94('0x52'));if(_0x4bf30c[_0x7a94('0x53')]==='user'){var _0x40b632=_0x6e956f[_0x7a94('0x54')]({'plain':!![]});var _0x288755=_0x7a94('0x55');return db[_0x7a94('0x56')]['find']({'where':{'name':_0x288755,'userProfileId':_0x4bf30c[_0x7a94('0x57')]},'raw':!![]})['then'](function(_0x4fb857){if(_0x4fb857&&_0x4fb857[_0x7a94('0x58')]===0x0){return db['UserProfileResource'][_0x7a94('0x4f')]({'name':_0x40b632[_0x7a94('0x2d')],'resourceId':_0x40b632['id'],'type':_0x4fb857[_0x7a94('0x2d')],'sectionId':_0x4fb857['id']},{})['then'](function(){return _0x6e956f;});}else{return _0x6e956f;}})[_0x7a94('0x4a')](function(_0x8f9136){logger[_0x7a94('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8f9136);throw _0x8f9136;});}return _0x6e956f;})[_0x7a94('0x46')](respondWithResult(_0x1e12a0,0xc9))['catch'](handleError(_0x1e12a0,null));};exports[_0x7a94('0x2a')]=function(_0x21bb72,_0x5396a0){if(_0x21bb72['body']['id']){delete _0x21bb72[_0x7a94('0x50')]['id'];}return db[_0x7a94('0x45')][_0x7a94('0x4e')]({'where':{'id':_0x21bb72[_0x7a94('0x4c')]['id']}})[_0x7a94('0x46')](handleEntityNotFound(_0x5396a0,null))[_0x7a94('0x46')](saveUpdates(_0x21bb72[_0x7a94('0x50')],null))['then'](respondWithResult(_0x5396a0,null))['catch'](handleError(_0x5396a0,null));};exports[_0x7a94('0x59')]=function(_0x37761b,_0x39c9b5){var _0x3fa1f1=_0x37761b[_0x7a94('0x4c')]['id'];var _0x2d09e9=[];return db[_0x7a94('0x5a')]['transaction'](function(_0x126b96){var _0x4c12aa=_0x7a94('0x5b')+_0x3fa1f1;return db[_0x7a94('0x5a')][_0x7a94('0x37')](_0x4c12aa,{'type':db[_0x7a94('0x5c')]['QueryTypes'][_0x7a94('0x5d')],'raw':!![],'transaction':_0x126b96})[_0x7a94('0x46')](function(_0x1c6b87){_0x2d09e9=_[_0x7a94('0x30')](_0x1c6b87,function(_0x263853){return Number(_0x263853[_0x7a94('0x5e')]);});})[_0x7a94('0x46')](function(){var _0x2e3fdb=_0x7a94('0x5f')+_0x3fa1f1;return db[_0x7a94('0x5a')][_0x7a94('0x37')](_0x2e3fdb,{'type':db['Sequelize'][_0x7a94('0x60')][_0x7a94('0x5d')],'raw':!![],'transaction':_0x126b96});})[_0x7a94('0x46')](function(_0x98bf29){var _0x4c91bf=_[_0x7a94('0x30')](_0x98bf29,function(_0x44e092){return Number(_0x44e092[_0x7a94('0x61')]);});return db[_0x7a94('0x62')]['destroy']({'where':{'UserId':{'$in':_0x2d09e9},'VoiceQueueId':{'$in':_0x4c91bf}},'transaction':_0x126b96});})['then'](function(){var _0x3c2170=_0x7a94('0x63')+_0x3fa1f1;return db[_0x7a94('0x5a')]['query'](_0x3c2170,{'type':db['Sequelize'][_0x7a94('0x60')][_0x7a94('0x5d')],'raw':!![],'transaction':_0x126b96});})[_0x7a94('0x46')](function(_0x5397ea){var _0x27c013=_[_0x7a94('0x30')](_0x5397ea,function(_0x5c767c){return Number(_0x5c767c['MailQueueId']);});return db[_0x7a94('0x64')][_0x7a94('0x59')]({'where':{'UserId':{'$in':_0x2d09e9},'MailQueueId':{'$in':_0x27c013}},'transaction':_0x126b96});})[_0x7a94('0x46')](function(){var _0x2ce4c0=_0x7a94('0x65')+_0x3fa1f1;return db[_0x7a94('0x5a')][_0x7a94('0x37')](_0x2ce4c0,{'type':db[_0x7a94('0x5c')][_0x7a94('0x60')]['SELECT'],'raw':!![],'transaction':_0x126b96});})[_0x7a94('0x46')](function(_0x1a0498){var _0x4db1d7=_[_0x7a94('0x30')](_0x1a0498,function(_0x59b1d2){return Number(_0x59b1d2[_0x7a94('0x66')]);});return db[_0x7a94('0x67')]['destroy']({'where':{'UserId':{'$in':_0x2d09e9},'SmsQueueId':{'$in':_0x4db1d7}},'transaction':_0x126b96});})[_0x7a94('0x46')](function(){var _0x51dd67='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3fa1f1;return db[_0x7a94('0x5a')][_0x7a94('0x37')](_0x51dd67,{'type':db[_0x7a94('0x5c')][_0x7a94('0x60')]['SELECT'],'raw':!![],'transaction':_0x126b96});})['then'](function(_0x243a17){var _0x727eba=_[_0x7a94('0x30')](_0x243a17,function(_0x385220){return Number(_0x385220[_0x7a94('0x68')]);});return db['UserChatQueue'][_0x7a94('0x59')]({'where':{'UserId':{'$in':_0x2d09e9},'ChatQueueId':{'$in':_0x727eba}},'transaction':_0x126b96});})[_0x7a94('0x46')](function(){var _0x1f85ce=_0x7a94('0x69')+_0x3fa1f1;return db['sequelize'][_0x7a94('0x37')](_0x1f85ce,{'type':db[_0x7a94('0x5c')][_0x7a94('0x60')][_0x7a94('0x5d')],'raw':!![],'transaction':_0x126b96});})['then'](function(_0x48c910){var _0x5775ac=_[_0x7a94('0x30')](_0x48c910,function(_0x479c1c){return Number(_0x479c1c[_0x7a94('0x6a')]);});return db[_0x7a94('0x6b')][_0x7a94('0x59')]({'where':{'UserId':{'$in':_0x2d09e9},'FaxQueueId':{'$in':_0x5775ac}},'transaction':_0x126b96});})['then'](function(){var _0x3608c4=_0x7a94('0x6c')+_0x3fa1f1;return db[_0x7a94('0x5a')]['query'](_0x3608c4,{'type':db[_0x7a94('0x5c')][_0x7a94('0x60')][_0x7a94('0x5d')],'raw':!![],'transaction':_0x126b96});})[_0x7a94('0x46')](function(_0x23bf40){var _0x5136fb=_[_0x7a94('0x30')](_0x23bf40,function(_0xc6fb30){return Number(_0xc6fb30[_0x7a94('0x6d')]);});return db['UserOpenchannelQueue'][_0x7a94('0x59')]({'where':{'UserId':{'$in':_0x2d09e9},'OpenchannelQueueId':{'$in':_0x5136fb}},'transaction':_0x126b96});})[_0x7a94('0x46')](function(){var _0x20ce38='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3fa1f1;return db[_0x7a94('0x5a')][_0x7a94('0x37')](_0x20ce38,{'type':db[_0x7a94('0x5c')][_0x7a94('0x60')][_0x7a94('0x5d')],'raw':!![],'transaction':_0x126b96});})[_0x7a94('0x46')](function(_0x3e9abf){var _0x1bd4fa=_[_0x7a94('0x30')](_0x3e9abf,function(_0x373d6b){return Number(_0x373d6b[_0x7a94('0x6e')]);});return db[_0x7a94('0x6f')][_0x7a94('0x59')]({'where':{'UserId':{'$in':_0x2d09e9},'WhatsappQueueId':{'$in':_0x1bd4fa}},'transaction':_0x126b96});})[_0x7a94('0x46')](function(){return db[_0x7a94('0x70')][_0x7a94('0x4e')]({'where':{'TeamId':_0x3fa1f1}});})[_0x7a94('0x46')](function(_0x351b9a){if(_0x351b9a===null){return;}return db[_0x7a94('0x71')][_0x7a94('0x59')]({'where':{'UserId':{'$in':_0x2d09e9},'VoicePrefixId':_0x351b9a['VoicePrefixId']},'transaction':_0x126b96});})[_0x7a94('0x46')](function(){return db['Team']['destroy']({'where':{'id':_0x3fa1f1},'cascade':!![],'transaction':_0x126b96});})[_0x7a94('0x46')](function(_0x3a3048){if(_0x3a3048===0x0){_0x39c9b5[_0x7a94('0x1d')](0x194);}else{return db[_0x7a94('0x72')]['destroy']({'where':{'type':_0x7a94('0x55'),'resourceId':_0x3fa1f1},'cascade':!![],'transaction':_0x126b96})[_0x7a94('0x46')](function(){_0x39c9b5[_0x7a94('0x1f')](0xcc)[_0x7a94('0x1e')]();});}})['catch'](function(_0x1979de){_0x39c9b5['status'](0x1f4)['send'](_0x1979de);});});};exports[_0x7a94('0x73')]=function(_0x5927c3,_0x3efa60,_0x310957){return db[_0x7a94('0x45')][_0x7a94('0x74')]({'where':{'id':_0x5927c3[_0x7a94('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3efa60,null))[_0x7a94('0x46')](function(_0x4b7b08){if(!_0x5927c3['query']['channel']||!utils[_0x7a94('0x75')](_0x5927c3[_0x7a94('0x37')][_0x7a94('0x76')])){throw new db[(_0x7a94('0x5c'))][(_0x7a94('0x77'))](_0x7a94('0x78'));}var _0x2e9115={};var _0x37987d={};_0x37987d['model']=_['keys'](db[_[_0x7a94('0x79')](_0x5927c3[_0x7a94('0x37')][_0x7a94('0x76')][_0x7a94('0x7a')]())+_0x7a94('0x7b')][_0x7a94('0x31')]);_0x37987d[_0x7a94('0x37')]=_[_0x7a94('0x36')](_0x5927c3[_0x7a94('0x37')]);_0x37987d['filters']=_[_0x7a94('0x4d')](_0x37987d[_0x7a94('0x35')],_0x37987d[_0x7a94('0x37')]);_0x2e9115['attributes']=_[_0x7a94('0x4d')](_0x37987d[_0x7a94('0x35')],qs[_0x7a94('0x39')](_0x5927c3['query']['fields']));_0x2e9115['attributes']=_0x2e9115['attributes']['length']?_0x2e9115['attributes']:_0x37987d['model'];_0x2e9115[_0x7a94('0x22')]=qs[_0x7a94('0x22')](_0x5927c3[_0x7a94('0x37')][_0x7a94('0x22')]);_0x2e9115[_0x7a94('0x23')]=qs[_0x7a94('0x23')](_0x5927c3['query'][_0x7a94('0x23')]);_0x2e9115[_0x7a94('0x3e')]=qs[_0x7a94('0x3f')](_0x5927c3['query'][_0x7a94('0x3f')]);_0x2e9115[_0x7a94('0x41')]=qs[_0x7a94('0x38')](_[_0x7a94('0x7c')](_0x5927c3['query'],_0x37987d[_0x7a94('0x38')]));_0x2e9115=_[_0x7a94('0x42')]({},_0x2e9115,_0x5927c3['options']);return _0x4b7b08[_0x7a94('0x54')+_[_0x7a94('0x79')](_0x5927c3['query'][_0x7a94('0x76')]['toLowerCase']())+'Queues'](_0x2e9115);})[_0x7a94('0x46')](respondWithResult(_0x3efa60,null))[_0x7a94('0x4a')](handleError(_0x3efa60,null));};exports[_0x7a94('0x7d')]=function(_0x9170d3,_0x484845,_0x1cf62b){return db[_0x7a94('0x45')]['findOne']({'where':{'id':_0x9170d3[_0x7a94('0x4c')]['id']}})[_0x7a94('0x46')](function(_0x549c4b){if(_0x549c4b){if(!_0x9170d3[_0x7a94('0x50')][_0x7a94('0x76')]||!utils[_0x7a94('0x75')](_0x9170d3[_0x7a94('0x50')][_0x7a94('0x76')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x549c4b[_0x7a94('0x7e')+_['capitalize'](_0x9170d3[_0x7a94('0x50')]['channel'][_0x7a94('0x7a')]())+_0x7a94('0x7f')](_0x9170d3[_0x7a94('0x50')][_0x7a94('0x80')]);}return null;})[_0x7a94('0x46')](handleEntityNotFound(_0x484845,null))[_0x7a94('0x46')](respondWithStatusCode(_0x484845,null))[_0x7a94('0x4a')](handleError(_0x484845,null));};exports[_0x7a94('0x81')]=function(_0x5ee9ed,_0x120568,_0x86906a){return db[_0x7a94('0x45')][_0x7a94('0x74')]({'where':{'id':_0x5ee9ed[_0x7a94('0x4c')]['id']}})['then'](function(_0x578ce5){if(_0x578ce5){if(!_0x5ee9ed[_0x7a94('0x37')][_0x7a94('0x76')]||!utils['isValidChannel'](_0x5ee9ed[_0x7a94('0x37')][_0x7a94('0x76')])){throw new db[(_0x7a94('0x5c'))][(_0x7a94('0x77'))](_0x7a94('0x78'));}return _0x578ce5[_0x7a94('0x82')+_['capitalize'](_0x5ee9ed[_0x7a94('0x37')]['channel'][_0x7a94('0x7a')]())+_0x7a94('0x7f')](_0x5ee9ed[_0x7a94('0x37')][_0x7a94('0x80')]);}return null;})['then'](handleEntityNotFound(_0x120568,null))[_0x7a94('0x46')](respondWithStatusCode(_0x120568,null))[_0x7a94('0x4a')](handleError(_0x120568,null));};exports['addAgents']=function(_0xa03201,_0x9be8d9){var _0x4a3ced=_[_0x7a94('0x83')](_0xa03201['body'][_0x7a94('0x80')])?_0xa03201['body'][_0x7a94('0x80')]:[_0xa03201[_0x7a94('0x50')][_0x7a94('0x80')]];var _0x45f53d=_0xa03201[_0x7a94('0x4c')]['id'];return db[_0x7a94('0x45')]['find']({'where':{'id':_0x45f53d}})['then'](handleEntityNotFound(_0x9be8d9,null))[_0x7a94('0x46')](function(_0x465c36){if(_0x465c36){var _0x35ee51=[_0x7a94('0x84'),_0x7a94('0x85'),_0x7a94('0x86'),_0x7a94('0x87'),_0x7a94('0x88'),_0x7a94('0x89'),'Whatsapp'];return db[_0x7a94('0x5a')][_0x7a94('0x8a')](function(_0x4f7182){var _0x1418b0=_[_0x7a94('0x30')](_0x35ee51,function(_0x4ea25d){var _0x1bab4e={'attributes':['id',_0x7a94('0x2d')]};if(_0x4ea25d===_0x7a94('0x84')){_0x1bab4e[_0x7a94('0x8b')]={'attributes':['penalty']};}return _0x465c36['get'+_0x4ea25d+_0x7a94('0x7f')](_0x1bab4e)[_0x7a94('0x46')](function(_0x17466d){var _0x46b9ff=_[_0x7a94('0x30')](_0x17466d,function(_0x44588f){var _0x5ce961=_[_0x7a94('0x30')](_0x4a3ced,function(_0x286102){var _0x20720e={'where':{'UserId':_0x286102,[_0x4ea25d+_0x7a94('0x8c')]:_0x44588f['id']},'transaction':_0x4f7182};if(_0x4ea25d===_0x7a94('0x84')){_0x20720e[_0x7a94('0x18')]={'penalty':_0x44588f['TeamVoiceQueue'][_0x7a94('0x8d')]};}return db['User'+_0x4ea25d+_0x7a94('0x7b')]['findOrCreate'](_0x20720e)[_0x7a94('0x46')](function(){socket[_0x7a94('0x8e')]('user'+_0x4ea25d+_0x7a94('0x8f'),{'UserId':_0x286102,[_0x4ea25d+'QueueId']:_0x44588f['id']});if(_0x4ea25d!==_0x7a94('0x84')){return;}return db['User'][_0x7a94('0x49')]({'where':{'id':_0x4a3ced,'online':0x1},'attributes':['id',_0x7a94('0x2d'),_0x7a94('0x90'),'voicePause',_0x7a94('0x91')],'raw':!![]})[_0x7a94('0x46')](function(_0x16f1b1){var _0x1fe168=_[_0x7a94('0x30')](_0x16f1b1,function(_0x16cd66){return db[_0x7a94('0x92')]['upsert']({'membername':_0x16cd66['name'],'UserId':_0x16cd66['id'],'queue_name':_0x44588f[_0x7a94('0x2d')],'VoiceQueueId':_0x44588f['id'],'interface':_['isNil'](_0x16cd66['interface'])?util['format'](_0x7a94('0x93'),_0x16cd66[_0x7a94('0x2d')]):_0x16cd66[_0x7a94('0x91')],'paused':_0x16cd66[_0x7a94('0x94')]||![],'penalty':_0x44588f[_0x7a94('0x95')][_0x7a94('0x8d')]},{'transaction':_0x4f7182});});return Promise['all'](_0x1fe168);});});});return Promise[_0x7a94('0x96')](_0x5ce961);});return Promise['all'](_0x46b9ff);})[_0x7a94('0x46')](function(){return db[_0x7a94('0x70')]['findOne']({'where':{'teamId':_0x45f53d}})[_0x7a94('0x46')](function(_0x5b51ed){if(_0x5b51ed){var _0x489f20=_['map'](_0x4a3ced,function(_0x476dd1){db[_0x7a94('0x71')]['upsert']({'UserId':_0x476dd1,'VoicePrefixId':_0x5b51ed[_0x7a94('0x97')]});});return Promise[_0x7a94('0x96')](_0x489f20);}});});});return Promise[_0x7a94('0x96')](_0x1418b0)[_0x7a94('0x46')](function(){return _0x465c36[_0x7a94('0x98')](_0x4a3ced,{'transaction':_0x4f7182})['spread'](function(_0x22ab36){return _0x22ab36;});});});}})[_0x7a94('0x46')](respondWithResult(_0x9be8d9,null))[_0x7a94('0x4a')](handleError(_0x9be8d9,null));};exports[_0x7a94('0x99')]=function(_0x672a64,_0x3e5c60){var _0x3c1ed4=_[_0x7a94('0x83')](_0x672a64['query'][_0x7a94('0x80')])?_0x672a64[_0x7a94('0x37')][_0x7a94('0x80')]:[_0x672a64[_0x7a94('0x37')][_0x7a94('0x80')]];var _0x13ff28=_0x672a64['params']['id'];return db[_0x7a94('0x45')]['find']({'where':{'id':_0x13ff28}})[_0x7a94('0x46')](handleEntityNotFound(_0x3e5c60,null))[_0x7a94('0x46')](function(_0x1f5280){if(_0x1f5280){var _0x4a01f3=[_0x7a94('0x84'),_0x7a94('0x85'),_0x7a94('0x86'),'Sms',_0x7a94('0x88'),_0x7a94('0x89'),_0x7a94('0x9a')];return db[_0x7a94('0x5a')][_0x7a94('0x8a')](function(_0x5131e){var _0x4e7748=_['map'](_0x4a01f3,function(_0x3d35d1){var _0x168489={'attributes':['id',_0x7a94('0x2d')]};return _0x1f5280[_0x7a94('0x54')+_0x3d35d1+'Queues'](_0x168489)[_0x7a94('0x46')](function(_0x4296a3){var _0x18a99d=_[_0x7a94('0x30')](_0x4296a3,function(_0x11013a){return _0x11013a[_0x7a94('0x99')](_0x3c1ed4,{'transaction':_0x5131e})[_0x7a94('0x46')](function(){var _0x22d51c=_[_0x7a94('0x30')](_0x3c1ed4,function(_0x5b5da0){socket[_0x7a94('0x8e')](_0x7a94('0x51')+_0x3d35d1+_0x7a94('0x9b'),{'UserId':Number(_0x5b5da0),[_0x3d35d1+_0x7a94('0x8c')]:_0x11013a['id']});if(_0x3d35d1!==_0x7a94('0x84')){return;}return db[_0x7a94('0x92')][_0x7a94('0x59')]({'where':{'VoiceQueueId':_0x11013a['id'],'UserId':_0x5b5da0},'transaction':_0x5131e});});return Promise[_0x7a94('0x96')](_0x22d51c);});});return Promise[_0x7a94('0x96')](_0x18a99d);});});return Promise[_0x7a94('0x96')](_0x4e7748)[_0x7a94('0x46')](function(){return _0x1f5280[_0x7a94('0x99')](_0x3c1ed4,{'transaction':_0x5131e});})[_0x7a94('0x46')](function(){return db[_0x7a94('0x70')]['findOne']({'where':{'teamId':_0x13ff28}})[_0x7a94('0x46')](function(_0x140c75){if(_0x140c75){var _0x584847=_['map'](_0x3c1ed4,function(_0x17e91a){db[_0x7a94('0x71')][_0x7a94('0x59')]({'where':{'UserId':_0x17e91a,'VoicePrefixId':_0x140c75['VoicePrefixId']}});});return Promise[_0x7a94('0x96')](_0x584847);}});});});}})['then'](respondWithStatusCode(_0x3e5c60,null))[_0x7a94('0x4a')](handleError(_0x3e5c60,null));};exports['getAgents']=function(_0xc2bae8,_0x31e7e7,_0x5e83ec){var _0x17000e={};var _0x539c7c={};var _0x334684;var _0xba2557;return db[_0x7a94('0x45')][_0x7a94('0x74')]({'where':{'id':_0xc2bae8[_0x7a94('0x4c')]['id']}})[_0x7a94('0x46')](handleEntityNotFound(_0x31e7e7,null))[_0x7a94('0x46')](function(_0x4a297c){if(_0x4a297c){_0x334684=_0x4a297c;_0x539c7c['model']=_['keys'](db[_0x7a94('0x9c')][_0x7a94('0x31')]);_0x539c7c[_0x7a94('0x37')]=_['keys'](_0xc2bae8[_0x7a94('0x37')]);_0x539c7c[_0x7a94('0x38')]=_[_0x7a94('0x4d')](_0x539c7c['model'],_0x539c7c[_0x7a94('0x37')]);_0x17000e[_0x7a94('0x3a')]=_['intersection'](_0x539c7c['model'],qs[_0x7a94('0x39')](_0xc2bae8[_0x7a94('0x37')][_0x7a94('0x39')]));_0x17000e['attributes']=_0x17000e[_0x7a94('0x3a')][_0x7a94('0x3b')]?_0x17000e[_0x7a94('0x3a')]:_0x539c7c[_0x7a94('0x35')];_0x17000e[_0x7a94('0x3e')]=qs[_0x7a94('0x3f')](_0xc2bae8['query'][_0x7a94('0x3f')]);_0x17000e['where']=qs[_0x7a94('0x38')](_[_0x7a94('0x7c')](_0xc2bae8[_0x7a94('0x37')],_0x539c7c['filters']));if(_0xc2bae8['query'][_0x7a94('0x40')]){_0x17000e['where']=_['merge'](_0x17000e['where'],{'$or':_[_0x7a94('0x30')](_0x17000e[_0x7a94('0x3a')],function(_0x55b31a){var _0x4bc2b2={};_0x4bc2b2[_0x55b31a]={'$like':'%'+_0xc2bae8[_0x7a94('0x37')][_0x7a94('0x40')]+'%'};return _0x4bc2b2;})});}_0x17000e=_[_0x7a94('0x42')]({},_0x17000e,_0xc2bae8['options']);return _0x334684[_0x7a94('0x9d')](_0x17000e);}})[_0x7a94('0x46')](function(_0x49b7ca){if(_0x49b7ca){_0xba2557=_0x49b7ca[_0x7a94('0x3b')];if(!_0xc2bae8['query'][_0x7a94('0x3c')](_0x7a94('0x3d'))){_0x17000e[_0x7a94('0x22')]=qs[_0x7a94('0x22')](_0xc2bae8[_0x7a94('0x37')][_0x7a94('0x22')]);_0x17000e[_0x7a94('0x23')]=qs[_0x7a94('0x23')](_0xc2bae8[_0x7a94('0x37')][_0x7a94('0x23')]);}return _0x334684['getAgents'](_0x17000e);}})[_0x7a94('0x46')](function(_0x4203fe){if(_0x4203fe){return _0x4203fe?{'count':_0xba2557,'rows':_0x4203fe}:null;}})[_0x7a94('0x46')](respondWithResult(_0x31e7e7,null))[_0x7a94('0x4a')](handleError(_0x31e7e7,null));}; \ No newline at end of file +var _0xb83f=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','end','status','json','offset','undefined','limit','count','Content-Range','save','then','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','Team','rows','params','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','destroy','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','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Teams','send','getQueues','findOne','channel','isValidChannel','ValidationError','capitalize','toLowerCase','Queue','options','Queues','addQueues','Unknown\x20channel','add','ids','removeQueues','remove','addAgents','isArray','Sms','Fax','Whatsapp','through','penalty','Voice','defaults','TeamVoiceQueue','User','findOrCreate','findAll','voicePause','upsert','isNil','interface','format','SIP/%s','all','spread','removeAgents','Mail','Openchannel','emit','QueueId','UserVoiceQueueRt','getAgents'];(function(_0x116d87,_0x5cc18f){var _0x1a98c6=function(_0x16ca31){while(--_0x16ca31){_0x116d87['push'](_0x116d87['shift']());}};_0x1a98c6(++_0x5cc18f);}(_0xb83f,0x144));var _0xfb83=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xb83f[_0xb0f7c3];return _0x28ea68;};'use strict';var emlformat=require(_0xfb83('0x0'));var rimraf=require(_0xfb83('0x1'));var zipdir=require(_0xfb83('0x2'));var jsonpatch=require(_0xfb83('0x3'));var rp=require('request-promise');var moment=require(_0xfb83('0x4'));var BPromise=require(_0xfb83('0x5'));var Mustache=require(_0xfb83('0x6'));var util=require('util');var path=require(_0xfb83('0x7'));var sox=require(_0xfb83('0x8'));var csv=require(_0xfb83('0x9'));var ejs=require(_0xfb83('0xa'));var fs=require('fs');var fs_extra=require(_0xfb83('0xb'));var _=require(_0xfb83('0xc'));var squel=require('squel');var crypto=require(_0xfb83('0xd'));var jsforce=require(_0xfb83('0xe'));var deskjs=require(_0xfb83('0xf'));var toCsv=require(_0xfb83('0x9'));var querystring=require(_0xfb83('0x10'));var Papa=require(_0xfb83('0x11'));var Redis=require(_0xfb83('0x12'));var authService=require(_0xfb83('0x13'));var qs=require(_0xfb83('0x14'));var as=require(_0xfb83('0x15'));var hardwareService=require(_0xfb83('0x16'));var logger=require(_0xfb83('0x17'))(_0xfb83('0x18'));var utils=require(_0xfb83('0x19'));var config=require(_0xfb83('0x1a'));var licenseUtil=require(_0xfb83('0x1b'));var db=require(_0xfb83('0x1c'))['db'];config[_0xfb83('0x1d')]=_['defaults'](config[_0xfb83('0x1d')],{'host':_0xfb83('0x1e'),'port':0x18eb});var socket=require(_0xfb83('0x1f'))(new Redis(config[_0xfb83('0x1d')]));require(_0xfb83('0x20'))['register'](socket);function respondWithStatusCode(_0x263fc8,_0x4c51ab){_0x4c51ab=_0x4c51ab||0xcc;return function(_0x31f309){if(_0x31f309){return _0x263fc8['sendStatus'](_0x4c51ab);}return _0x263fc8['status'](_0x4c51ab)[_0xfb83('0x21')]();};}function respondWithResult(_0x4eca0e,_0x138356){_0x138356=_0x138356||0xc8;return function(_0x37ed83){if(_0x37ed83){return _0x4eca0e[_0xfb83('0x22')](_0x138356)[_0xfb83('0x23')](_0x37ed83);}};}function respondWithFilteredResult(_0x54ab58,_0xe78e23){return function(_0xeb4b9d){if(_0xeb4b9d){var _0x58ade9=typeof _0xe78e23[_0xfb83('0x24')]===_0xfb83('0x25')&&typeof _0xe78e23[_0xfb83('0x26')]===_0xfb83('0x25');var _0xe2ee10=_0xeb4b9d['count'];var _0x14db3b=_0x58ade9?0x0:_0xe78e23[_0xfb83('0x24')];var _0x216c84=_0x58ade9?_0xeb4b9d[_0xfb83('0x27')]:_0xe78e23[_0xfb83('0x24')]+_0xe78e23['limit'];var _0x2918e6;if(_0x216c84>=_0xe2ee10){_0x216c84=_0xe2ee10;_0x2918e6=0xc8;}else{_0x2918e6=0xce;}_0x54ab58[_0xfb83('0x22')](_0x2918e6);return _0x54ab58['set'](_0xfb83('0x28'),_0x14db3b+'-'+_0x216c84+'/'+_0xe2ee10)['json'](_0xeb4b9d);}return null;};}function patchUpdates(_0x402af3){return function(_0x5793aa){try{jsonpatch['apply'](_0x5793aa,_0x402af3,!![]);}catch(_0x567d1a){return BPromise['reject'](_0x567d1a);}return _0x5793aa[_0xfb83('0x29')]();};}function saveUpdates(_0x12b398,_0x457723){return function(_0x1f503c){if(_0x1f503c){return _0x1f503c['update'](_0x12b398)[_0xfb83('0x2a')](function(_0x52c18c){return _0x52c18c;});}return null;};}function handleEntityNotFound(_0x1b07e6,_0x2ecb94){return function(_0x59271c){if(!_0x59271c){_0x1b07e6[_0xfb83('0x2b')](0x194);}return _0x59271c;};}function handleError(_0x114ebb,_0x5ec36c){_0x5ec36c=_0x5ec36c||0x1f4;return function(_0x902439){logger[_0xfb83('0x2c')](_0x902439[_0xfb83('0x2d')]);if(_0x902439[_0xfb83('0x2e')]){delete _0x902439[_0xfb83('0x2e')];}_0x114ebb[_0xfb83('0x22')](_0x5ec36c)['send'](_0x902439);};}exports[_0xfb83('0x2f')]=function(_0x316657,_0x4ccb55){var _0x502bb8={},_0x3f8da6={},_0x231b9b={'count':0x0,'rows':[]};var _0x46ba51=_[_0xfb83('0x30')](db['Team'][_0xfb83('0x31')],function(_0x3fe323){return{'name':_0x3fe323[_0xfb83('0x32')],'type':_0x3fe323[_0xfb83('0x33')][_0xfb83('0x34')]};});_0x3f8da6[_0xfb83('0x35')]=_[_0xfb83('0x30')](_0x46ba51,_0xfb83('0x2e'));_0x3f8da6[_0xfb83('0x36')]=_[_0xfb83('0x37')](_0x316657['query']);_0x3f8da6[_0xfb83('0x38')]=_[_0xfb83('0x39')](_0x3f8da6['model'],_0x3f8da6[_0xfb83('0x36')]);_0x502bb8[_0xfb83('0x3a')]=_['intersection'](_0x3f8da6[_0xfb83('0x35')],qs[_0xfb83('0x3b')](_0x316657['query'][_0xfb83('0x3b')]));_0x502bb8[_0xfb83('0x3a')]=_0x502bb8[_0xfb83('0x3a')][_0xfb83('0x3c')]?_0x502bb8[_0xfb83('0x3a')]:_0x3f8da6[_0xfb83('0x35')];if(!_0x316657[_0xfb83('0x36')][_0xfb83('0x3d')](_0xfb83('0x3e'))){_0x502bb8[_0xfb83('0x26')]=qs[_0xfb83('0x26')](_0x316657['query']['limit']);_0x502bb8[_0xfb83('0x24')]=qs[_0xfb83('0x24')](_0x316657[_0xfb83('0x36')]['offset']);}_0x502bb8[_0xfb83('0x3f')]=qs[_0xfb83('0x40')](_0x316657[_0xfb83('0x36')]['sort']);_0x502bb8[_0xfb83('0x41')]=qs[_0xfb83('0x38')](_[_0xfb83('0x42')](_0x316657['query'],_0x3f8da6[_0xfb83('0x38')]),_0x46ba51);if(_0x316657['query'][_0xfb83('0x43')]){_0x502bb8[_0xfb83('0x41')]=_[_0xfb83('0x44')](_0x502bb8[_0xfb83('0x41')],{'$or':_['map'](_0x46ba51,function(_0x35cfda){if(_0x35cfda[_0xfb83('0x33')]!==_0xfb83('0x45')){var _0x17660e={};_0x17660e[_0x35cfda[_0xfb83('0x2e')]]={'$like':'%'+_0x316657['query'][_0xfb83('0x43')]+'%'};return _0x17660e;}})});}_0x502bb8=_[_0xfb83('0x44')]({},_0x502bb8,_0x316657['options']);var _0x2ac90a={'where':_0x502bb8[_0xfb83('0x41')]};return db['Team'][_0xfb83('0x27')](_0x2ac90a)[_0xfb83('0x2a')](function(_0x299041){_0x231b9b[_0xfb83('0x27')]=_0x299041;if(_0x316657[_0xfb83('0x36')][_0xfb83('0x46')]){_0x502bb8['include']=[{'all':!![]}];}return db[_0xfb83('0x47')]['findAll'](_0x502bb8);})[_0xfb83('0x2a')](function(_0x2ccaf5){_0x231b9b[_0xfb83('0x48')]=_0x2ccaf5;return _0x231b9b;})['then'](respondWithFilteredResult(_0x4ccb55,_0x502bb8))['catch'](handleError(_0x4ccb55,null));};exports['show']=function(_0x5945a6,_0x110f9a){var _0x52f96b={'raw':![],'where':{'id':_0x5945a6[_0xfb83('0x49')]['id']}},_0x11b2bf={};_0x11b2bf[_0xfb83('0x35')]=_[_0xfb83('0x37')](db[_0xfb83('0x47')][_0xfb83('0x31')]);_0x11b2bf[_0xfb83('0x36')]=_['keys'](_0x5945a6[_0xfb83('0x36')]);_0x11b2bf[_0xfb83('0x38')]=_[_0xfb83('0x39')](_0x11b2bf[_0xfb83('0x35')],_0x11b2bf[_0xfb83('0x36')]);_0x52f96b[_0xfb83('0x3a')]=_[_0xfb83('0x39')](_0x11b2bf[_0xfb83('0x35')],qs[_0xfb83('0x3b')](_0x5945a6[_0xfb83('0x36')][_0xfb83('0x3b')]));_0x52f96b[_0xfb83('0x3a')]=_0x52f96b[_0xfb83('0x3a')]['length']?_0x52f96b[_0xfb83('0x3a')]:_0x11b2bf['model'];if(_0x5945a6['query']['includeAll']){_0x52f96b[_0xfb83('0x4a')]=[{'all':!![]}];}_0x52f96b=_[_0xfb83('0x44')]({},_0x52f96b,_0x5945a6['options']);return db[_0xfb83('0x47')][_0xfb83('0x4b')](_0x52f96b)['then'](handleEntityNotFound(_0x110f9a,null))[_0xfb83('0x2a')](respondWithResult(_0x110f9a,null))[_0xfb83('0x4c')](handleError(_0x110f9a,null));};exports[_0xfb83('0x4d')]=function(_0x5b31ed,_0x116656){return db[_0xfb83('0x47')]['create'](_0x5b31ed[_0xfb83('0x4e')],{})[_0xfb83('0x2a')](function(_0x30ae13){var _0x288744=_0x5b31ed[_0xfb83('0x4f')][_0xfb83('0x50')]({'plain':!![]});if(!_0x288744)throw new Error(_0xfb83('0x51'));if(_0x288744[_0xfb83('0x52')]==='user'){var _0x3c5d77=_0x30ae13[_0xfb83('0x50')]({'plain':!![]});var _0x12d532='Teams';return db['UserProfileSection'][_0xfb83('0x4b')]({'where':{'name':_0x12d532,'userProfileId':_0x288744[_0xfb83('0x53')]},'raw':!![]})[_0xfb83('0x2a')](function(_0x2f54cb){if(_0x2f54cb&&_0x2f54cb[_0xfb83('0x54')]===0x0){return db[_0xfb83('0x55')][_0xfb83('0x4d')]({'name':_0x3c5d77[_0xfb83('0x2e')],'resourceId':_0x3c5d77['id'],'type':_0x2f54cb[_0xfb83('0x2e')],'sectionId':_0x2f54cb['id']},{})[_0xfb83('0x2a')](function(){return _0x30ae13;});}else{return _0x30ae13;}})['catch'](function(_0x4b8135){logger[_0xfb83('0x2c')](_0xfb83('0x56'),_0x4b8135);throw _0x4b8135;});}return _0x30ae13;})[_0xfb83('0x2a')](respondWithResult(_0x116656,0xc9))[_0xfb83('0x4c')](handleError(_0x116656,null));};exports['update']=function(_0x4c5f95,_0x3cdf59){if(_0x4c5f95[_0xfb83('0x4e')]['id']){delete _0x4c5f95[_0xfb83('0x4e')]['id'];}return db[_0xfb83('0x47')]['find']({'where':{'id':_0x4c5f95[_0xfb83('0x49')]['id']}})[_0xfb83('0x2a')](handleEntityNotFound(_0x3cdf59,null))[_0xfb83('0x2a')](saveUpdates(_0x4c5f95[_0xfb83('0x4e')],null))[_0xfb83('0x2a')](respondWithResult(_0x3cdf59,null))[_0xfb83('0x4c')](handleError(_0x3cdf59,null));};exports['destroy']=function(_0x25d2cc,_0x474109){var _0x302e9f=_0x25d2cc[_0xfb83('0x49')]['id'];var _0xddf02b=[];return db['sequelize'][_0xfb83('0x57')](function(_0x567932){var _0x32ef7d=_0xfb83('0x58')+_0x302e9f;return db[_0xfb83('0x59')][_0xfb83('0x36')](_0x32ef7d,{'type':db[_0xfb83('0x5a')][_0xfb83('0x5b')][_0xfb83('0x5c')],'raw':!![],'transaction':_0x567932})[_0xfb83('0x2a')](function(_0x2a56ee){_0xddf02b=_[_0xfb83('0x30')](_0x2a56ee,function(_0x25ac42){return Number(_0x25ac42[_0xfb83('0x5d')]);});})[_0xfb83('0x2a')](function(){var _0x402cf4=_0xfb83('0x5e')+_0x302e9f;return db[_0xfb83('0x59')][_0xfb83('0x36')](_0x402cf4,{'type':db[_0xfb83('0x5a')]['QueryTypes'][_0xfb83('0x5c')],'raw':!![],'transaction':_0x567932});})[_0xfb83('0x2a')](function(_0x409d4e){var _0x1ae5a4=_[_0xfb83('0x30')](_0x409d4e,function(_0x342a06){return Number(_0x342a06[_0xfb83('0x5f')]);});return db[_0xfb83('0x60')][_0xfb83('0x61')]({'where':{'UserId':{'$in':_0xddf02b},'VoiceQueueId':{'$in':_0x1ae5a4}},'transaction':_0x567932});})[_0xfb83('0x2a')](function(){var _0x376edf='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x302e9f;return db[_0xfb83('0x59')][_0xfb83('0x36')](_0x376edf,{'type':db[_0xfb83('0x5a')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x567932});})['then'](function(_0x57f8f5){var _0x4d3256=_[_0xfb83('0x30')](_0x57f8f5,function(_0x152336){return Number(_0x152336[_0xfb83('0x62')]);});return db[_0xfb83('0x63')][_0xfb83('0x61')]({'where':{'UserId':{'$in':_0xddf02b},'MailQueueId':{'$in':_0x4d3256}},'transaction':_0x567932});})[_0xfb83('0x2a')](function(){var _0x4affab=_0xfb83('0x64')+_0x302e9f;return db[_0xfb83('0x59')][_0xfb83('0x36')](_0x4affab,{'type':db[_0xfb83('0x5a')][_0xfb83('0x5b')][_0xfb83('0x5c')],'raw':!![],'transaction':_0x567932});})[_0xfb83('0x2a')](function(_0x3d779f){var _0x225736=_['map'](_0x3d779f,function(_0x455c39){return Number(_0x455c39[_0xfb83('0x65')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0xddf02b},'SmsQueueId':{'$in':_0x225736}},'transaction':_0x567932});})[_0xfb83('0x2a')](function(){var _0x3090de=_0xfb83('0x66')+_0x302e9f;return db[_0xfb83('0x59')][_0xfb83('0x36')](_0x3090de,{'type':db[_0xfb83('0x5a')][_0xfb83('0x5b')][_0xfb83('0x5c')],'raw':!![],'transaction':_0x567932});})['then'](function(_0x391ec9){var _0x28d8a8=_['map'](_0x391ec9,function(_0x3ec7d8){return Number(_0x3ec7d8[_0xfb83('0x67')]);});return db[_0xfb83('0x68')][_0xfb83('0x61')]({'where':{'UserId':{'$in':_0xddf02b},'ChatQueueId':{'$in':_0x28d8a8}},'transaction':_0x567932});})[_0xfb83('0x2a')](function(){var _0x277e63='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x302e9f;return db['sequelize'][_0xfb83('0x36')](_0x277e63,{'type':db[_0xfb83('0x5a')][_0xfb83('0x5b')][_0xfb83('0x5c')],'raw':!![],'transaction':_0x567932});})[_0xfb83('0x2a')](function(_0x2fc357){var _0x50190f=_[_0xfb83('0x30')](_0x2fc357,function(_0x44d7c4){return Number(_0x44d7c4[_0xfb83('0x69')]);});return db[_0xfb83('0x6a')][_0xfb83('0x61')]({'where':{'UserId':{'$in':_0xddf02b},'FaxQueueId':{'$in':_0x50190f}},'transaction':_0x567932});})[_0xfb83('0x2a')](function(){var _0x52ac2f=_0xfb83('0x6b')+_0x302e9f;return db[_0xfb83('0x59')]['query'](_0x52ac2f,{'type':db[_0xfb83('0x5a')][_0xfb83('0x5b')][_0xfb83('0x5c')],'raw':!![],'transaction':_0x567932});})[_0xfb83('0x2a')](function(_0x15f38f){var _0x1bcf40=_['map'](_0x15f38f,function(_0x256e4c){return Number(_0x256e4c[_0xfb83('0x6c')]);});return db[_0xfb83('0x6d')]['destroy']({'where':{'UserId':{'$in':_0xddf02b},'OpenchannelQueueId':{'$in':_0x1bcf40}},'transaction':_0x567932});})[_0xfb83('0x2a')](function(){var _0x22cc01=_0xfb83('0x6e')+_0x302e9f;return db[_0xfb83('0x59')][_0xfb83('0x36')](_0x22cc01,{'type':db[_0xfb83('0x5a')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x567932});})['then'](function(_0x4aae75){var _0x39fc36=_['map'](_0x4aae75,function(_0x59bae9){return Number(_0x59bae9[_0xfb83('0x6f')]);});return db[_0xfb83('0x70')][_0xfb83('0x61')]({'where':{'UserId':{'$in':_0xddf02b},'WhatsappQueueId':{'$in':_0x39fc36}},'transaction':_0x567932});})[_0xfb83('0x2a')](function(){return db[_0xfb83('0x71')][_0xfb83('0x4b')]({'where':{'TeamId':_0x302e9f}});})[_0xfb83('0x2a')](function(_0x58102e){if(_0x58102e===null){return;}return db[_0xfb83('0x72')][_0xfb83('0x61')]({'where':{'UserId':{'$in':_0xddf02b},'VoicePrefixId':_0x58102e[_0xfb83('0x73')]},'transaction':_0x567932});})[_0xfb83('0x2a')](function(){return db['Team']['destroy']({'where':{'id':_0x302e9f},'cascade':!![],'transaction':_0x567932});})['then'](function(_0x1455a2){if(_0x1455a2===0x0){_0x474109[_0xfb83('0x2b')](0x194);}else{return db[_0xfb83('0x55')]['destroy']({'where':{'type':_0xfb83('0x74'),'resourceId':_0x302e9f},'cascade':!![],'transaction':_0x567932})[_0xfb83('0x2a')](function(){_0x474109[_0xfb83('0x22')](0xcc)['end']();});}})[_0xfb83('0x4c')](function(_0x4e4fe7){_0x474109[_0xfb83('0x22')](0x1f4)[_0xfb83('0x75')](_0x4e4fe7);});});};exports[_0xfb83('0x76')]=function(_0x37b9bd,_0x3feee7,_0xb3cdfb){return db[_0xfb83('0x47')][_0xfb83('0x77')]({'where':{'id':_0x37b9bd[_0xfb83('0x49')]['id']}})[_0xfb83('0x2a')](handleEntityNotFound(_0x3feee7,null))['then'](function(_0x2c8511){if(!_0x37b9bd[_0xfb83('0x36')][_0xfb83('0x78')]||!utils[_0xfb83('0x79')](_0x37b9bd['query'][_0xfb83('0x78')])){throw new db[(_0xfb83('0x5a'))][(_0xfb83('0x7a'))]('Unknown\x20channel');}var _0x52661c={};var _0xf54cba={};_0xf54cba[_0xfb83('0x35')]=_[_0xfb83('0x37')](db[_[_0xfb83('0x7b')](_0x37b9bd[_0xfb83('0x36')]['channel'][_0xfb83('0x7c')]())+_0xfb83('0x7d')][_0xfb83('0x31')]);_0xf54cba[_0xfb83('0x36')]=_[_0xfb83('0x37')](_0x37b9bd[_0xfb83('0x36')]);_0xf54cba[_0xfb83('0x38')]=_['intersection'](_0xf54cba[_0xfb83('0x35')],_0xf54cba[_0xfb83('0x36')]);_0x52661c[_0xfb83('0x3a')]=_['intersection'](_0xf54cba[_0xfb83('0x35')],qs[_0xfb83('0x3b')](_0x37b9bd[_0xfb83('0x36')][_0xfb83('0x3b')]));_0x52661c[_0xfb83('0x3a')]=_0x52661c['attributes'][_0xfb83('0x3c')]?_0x52661c['attributes']:_0xf54cba[_0xfb83('0x35')];_0x52661c[_0xfb83('0x26')]=qs['limit'](_0x37b9bd[_0xfb83('0x36')][_0xfb83('0x26')]);_0x52661c[_0xfb83('0x24')]=qs[_0xfb83('0x24')](_0x37b9bd[_0xfb83('0x36')][_0xfb83('0x24')]);_0x52661c[_0xfb83('0x3f')]=qs[_0xfb83('0x40')](_0x37b9bd['query']['sort']);_0x52661c[_0xfb83('0x41')]=qs[_0xfb83('0x38')](_[_0xfb83('0x42')](_0x37b9bd[_0xfb83('0x36')],_0xf54cba[_0xfb83('0x38')]));_0x52661c=_[_0xfb83('0x44')]({},_0x52661c,_0x37b9bd[_0xfb83('0x7e')]);return _0x2c8511['get'+_[_0xfb83('0x7b')](_0x37b9bd[_0xfb83('0x36')][_0xfb83('0x78')][_0xfb83('0x7c')]())+_0xfb83('0x7f')](_0x52661c);})[_0xfb83('0x2a')](respondWithResult(_0x3feee7,null))['catch'](handleError(_0x3feee7,null));};exports[_0xfb83('0x80')]=function(_0x24b401,_0xf8978b,_0xdc9963){return db['Team'][_0xfb83('0x77')]({'where':{'id':_0x24b401['params']['id']}})['then'](function(_0x294100){if(_0x294100){if(!_0x24b401[_0xfb83('0x4e')]['channel']||!utils[_0xfb83('0x79')](_0x24b401[_0xfb83('0x4e')][_0xfb83('0x78')])){throw new db[(_0xfb83('0x5a'))][(_0xfb83('0x7a'))](_0xfb83('0x81'));}return _0x294100[_0xfb83('0x82')+_['capitalize'](_0x24b401[_0xfb83('0x4e')]['channel']['toLowerCase']())+'Queues'](_0x24b401[_0xfb83('0x4e')][_0xfb83('0x83')]);}return null;})[_0xfb83('0x2a')](handleEntityNotFound(_0xf8978b,null))[_0xfb83('0x2a')](respondWithStatusCode(_0xf8978b,null))['catch'](handleError(_0xf8978b,null));};exports[_0xfb83('0x84')]=function(_0x44c219,_0x5bc1c8,_0x2ce1aa){return db['Team'][_0xfb83('0x77')]({'where':{'id':_0x44c219['params']['id']}})['then'](function(_0x1230ea){if(_0x1230ea){if(!_0x44c219[_0xfb83('0x36')][_0xfb83('0x78')]||!utils[_0xfb83('0x79')](_0x44c219['query'][_0xfb83('0x78')])){throw new db['Sequelize']['ValidationError'](_0xfb83('0x81'));}return _0x1230ea[_0xfb83('0x85')+_[_0xfb83('0x7b')](_0x44c219[_0xfb83('0x36')][_0xfb83('0x78')][_0xfb83('0x7c')]())+'Queues'](_0x44c219['query'][_0xfb83('0x83')]);}return null;})[_0xfb83('0x2a')](handleEntityNotFound(_0x5bc1c8,null))[_0xfb83('0x2a')](respondWithStatusCode(_0x5bc1c8,null))[_0xfb83('0x4c')](handleError(_0x5bc1c8,null));};exports[_0xfb83('0x86')]=function(_0x2cabee,_0x1f55aa){var _0x1baa77=_[_0xfb83('0x87')](_0x2cabee[_0xfb83('0x4e')]['ids'])?_0x2cabee[_0xfb83('0x4e')][_0xfb83('0x83')]:[_0x2cabee[_0xfb83('0x4e')][_0xfb83('0x83')]];var _0x218334=_0x2cabee[_0xfb83('0x49')]['id'];return db['Team']['find']({'where':{'id':_0x218334}})['then'](handleEntityNotFound(_0x1f55aa,null))[_0xfb83('0x2a')](function(_0x5a1bb9){if(_0x5a1bb9){var _0x25cd5e=['Voice','Chat','Mail',_0xfb83('0x88'),_0xfb83('0x89'),'Openchannel',_0xfb83('0x8a')];return db['sequelize'][_0xfb83('0x57')](function(_0x483f1b){var _0x1f59b8=_[_0xfb83('0x30')](_0x25cd5e,function(_0x3ddf44){var _0x504898={'attributes':['id',_0xfb83('0x2e')]};if(_0x3ddf44==='Voice'){_0x504898[_0xfb83('0x8b')]={'attributes':[_0xfb83('0x8c')]};}return _0x5a1bb9['get'+_0x3ddf44+_0xfb83('0x7f')](_0x504898)[_0xfb83('0x2a')](function(_0xac219){var _0x140129=_['map'](_0xac219,function(_0xbbc0a1){var _0x5e2399=_[_0xfb83('0x30')](_0x1baa77,function(_0x2cd66c){var _0x57573c={'where':{'UserId':_0x2cd66c,[_0x3ddf44+'QueueId']:_0xbbc0a1['id']},'transaction':_0x483f1b};if(_0x3ddf44===_0xfb83('0x8d')){_0x57573c[_0xfb83('0x8e')]={'penalty':_0xbbc0a1[_0xfb83('0x8f')][_0xfb83('0x8c')]};}return db[_0xfb83('0x90')+_0x3ddf44+_0xfb83('0x7d')][_0xfb83('0x91')](_0x57573c)[_0xfb83('0x2a')](function(){socket['emit'](_0xfb83('0x4f')+_0x3ddf44+'Queue:save',{'UserId':_0x2cd66c,[_0x3ddf44+'QueueId']:_0xbbc0a1['id']});if(_0x3ddf44!=='Voice'){return;}return db['User'][_0xfb83('0x92')]({'where':{'id':_0x1baa77,'online':0x1},'attributes':['id',_0xfb83('0x2e'),'online',_0xfb83('0x93'),'interface'],'raw':!![]})['then'](function(_0x4dc6f0){var _0x353a7b=_['map'](_0x4dc6f0,function(_0x4a03e2){return db['UserVoiceQueueRt'][_0xfb83('0x94')]({'membername':_0x4a03e2[_0xfb83('0x2e')],'UserId':_0x4a03e2['id'],'queue_name':_0xbbc0a1[_0xfb83('0x2e')],'VoiceQueueId':_0xbbc0a1['id'],'interface':_[_0xfb83('0x95')](_0x4a03e2[_0xfb83('0x96')])?util[_0xfb83('0x97')](_0xfb83('0x98'),_0x4a03e2[_0xfb83('0x2e')]):_0x4a03e2[_0xfb83('0x96')],'paused':_0x4a03e2['voicePause']||![],'penalty':_0xbbc0a1[_0xfb83('0x8f')][_0xfb83('0x8c')]},{'transaction':_0x483f1b});});return Promise[_0xfb83('0x99')](_0x353a7b);});});});return Promise[_0xfb83('0x99')](_0x5e2399);});return Promise['all'](_0x140129);})[_0xfb83('0x2a')](function(){return db['TeamVoicePrefix'][_0xfb83('0x77')]({'where':{'teamId':_0x218334}})[_0xfb83('0x2a')](function(_0x445900){if(_0x445900){var _0x5cea49=_['map'](_0x1baa77,function(_0x213d6b){db[_0xfb83('0x72')][_0xfb83('0x94')]({'UserId':_0x213d6b,'VoicePrefixId':_0x445900['VoicePrefixId']});});return Promise[_0xfb83('0x99')](_0x5cea49);}});});});return Promise[_0xfb83('0x99')](_0x1f59b8)['then'](function(){return _0x5a1bb9[_0xfb83('0x86')](_0x1baa77,{'transaction':_0x483f1b})[_0xfb83('0x9a')](function(_0x11a9b1){return _0x11a9b1;});});});}})[_0xfb83('0x2a')](respondWithResult(_0x1f55aa,null))[_0xfb83('0x4c')](handleError(_0x1f55aa,null));};exports[_0xfb83('0x9b')]=function(_0x52a421,_0x402ca4){var _0x11ec5c=_['isArray'](_0x52a421['query'][_0xfb83('0x83')])?_0x52a421[_0xfb83('0x36')][_0xfb83('0x83')]:[_0x52a421[_0xfb83('0x36')][_0xfb83('0x83')]];var _0x56b6be=_0x52a421[_0xfb83('0x49')]['id'];return db[_0xfb83('0x47')][_0xfb83('0x4b')]({'where':{'id':_0x56b6be}})[_0xfb83('0x2a')](handleEntityNotFound(_0x402ca4,null))[_0xfb83('0x2a')](function(_0x1767fc){if(_0x1767fc){var _0x20c76d=[_0xfb83('0x8d'),'Chat',_0xfb83('0x9c'),_0xfb83('0x88'),_0xfb83('0x89'),_0xfb83('0x9d'),_0xfb83('0x8a')];return db[_0xfb83('0x59')][_0xfb83('0x57')](function(_0x464b04){var _0x16e624=_[_0xfb83('0x30')](_0x20c76d,function(_0x384231){var _0x2aac42={'attributes':['id',_0xfb83('0x2e')]};return _0x1767fc['get'+_0x384231+_0xfb83('0x7f')](_0x2aac42)[_0xfb83('0x2a')](function(_0x14d138){var _0x415978=_[_0xfb83('0x30')](_0x14d138,function(_0xc22263){return _0xc22263['removeAgents'](_0x11ec5c,{'transaction':_0x464b04})['then'](function(){var _0x2b7bc0=_[_0xfb83('0x30')](_0x11ec5c,function(_0x2b0e50){socket[_0xfb83('0x9e')](_0xfb83('0x4f')+_0x384231+'Queue:remove',{'UserId':Number(_0x2b0e50),[_0x384231+_0xfb83('0x9f')]:_0xc22263['id']});if(_0x384231!=='Voice'){return;}return db[_0xfb83('0xa0')][_0xfb83('0x61')]({'where':{'VoiceQueueId':_0xc22263['id'],'UserId':_0x2b0e50},'transaction':_0x464b04});});return Promise[_0xfb83('0x99')](_0x2b7bc0);});});return Promise[_0xfb83('0x99')](_0x415978);});});return Promise[_0xfb83('0x99')](_0x16e624)[_0xfb83('0x2a')](function(){return _0x1767fc[_0xfb83('0x9b')](_0x11ec5c,{'transaction':_0x464b04});})[_0xfb83('0x2a')](function(){return db[_0xfb83('0x71')]['findOne']({'where':{'teamId':_0x56b6be}})[_0xfb83('0x2a')](function(_0x5d0591){if(_0x5d0591){var _0x39a579=_[_0xfb83('0x30')](_0x11ec5c,function(_0x543c38){db['UserVoicePrefix'][_0xfb83('0x61')]({'where':{'UserId':_0x543c38,'VoicePrefixId':_0x5d0591[_0xfb83('0x73')]}});});return Promise[_0xfb83('0x99')](_0x39a579);}});});});}})[_0xfb83('0x2a')](respondWithStatusCode(_0x402ca4,null))[_0xfb83('0x4c')](handleError(_0x402ca4,null));};exports[_0xfb83('0xa1')]=function(_0xe3fdfc,_0x3b75bc,_0x4943b8){var _0xf494c1={};var _0x2bc5a2={};var _0x30491b;var _0x1ea8a1;return db[_0xfb83('0x47')][_0xfb83('0x77')]({'where':{'id':_0xe3fdfc[_0xfb83('0x49')]['id']}})[_0xfb83('0x2a')](handleEntityNotFound(_0x3b75bc,null))[_0xfb83('0x2a')](function(_0x253100){if(_0x253100){_0x30491b=_0x253100;_0x2bc5a2[_0xfb83('0x35')]=_[_0xfb83('0x37')](db[_0xfb83('0x90')]['rawAttributes']);_0x2bc5a2[_0xfb83('0x36')]=_[_0xfb83('0x37')](_0xe3fdfc[_0xfb83('0x36')]);_0x2bc5a2['filters']=_[_0xfb83('0x39')](_0x2bc5a2['model'],_0x2bc5a2[_0xfb83('0x36')]);_0xf494c1[_0xfb83('0x3a')]=_['intersection'](_0x2bc5a2[_0xfb83('0x35')],qs[_0xfb83('0x3b')](_0xe3fdfc[_0xfb83('0x36')][_0xfb83('0x3b')]));_0xf494c1[_0xfb83('0x3a')]=_0xf494c1[_0xfb83('0x3a')][_0xfb83('0x3c')]?_0xf494c1['attributes']:_0x2bc5a2[_0xfb83('0x35')];_0xf494c1['order']=qs[_0xfb83('0x40')](_0xe3fdfc['query'][_0xfb83('0x40')]);_0xf494c1[_0xfb83('0x41')]=qs[_0xfb83('0x38')](_[_0xfb83('0x42')](_0xe3fdfc[_0xfb83('0x36')],_0x2bc5a2[_0xfb83('0x38')]));if(_0xe3fdfc[_0xfb83('0x36')][_0xfb83('0x43')]){_0xf494c1[_0xfb83('0x41')]=_[_0xfb83('0x44')](_0xf494c1[_0xfb83('0x41')],{'$or':_[_0xfb83('0x30')](_0xf494c1[_0xfb83('0x3a')],function(_0xb80c32){var _0x50f435={};_0x50f435[_0xb80c32]={'$like':'%'+_0xe3fdfc[_0xfb83('0x36')][_0xfb83('0x43')]+'%'};return _0x50f435;})});}_0xf494c1=_['merge']({},_0xf494c1,_0xe3fdfc['options']);return _0x30491b[_0xfb83('0xa1')](_0xf494c1);}})[_0xfb83('0x2a')](function(_0x42fe6d){if(_0x42fe6d){_0x1ea8a1=_0x42fe6d[_0xfb83('0x3c')];if(!_0xe3fdfc[_0xfb83('0x36')][_0xfb83('0x3d')](_0xfb83('0x3e'))){_0xf494c1[_0xfb83('0x26')]=qs[_0xfb83('0x26')](_0xe3fdfc[_0xfb83('0x36')][_0xfb83('0x26')]);_0xf494c1[_0xfb83('0x24')]=qs[_0xfb83('0x24')](_0xe3fdfc['query'][_0xfb83('0x24')]);}return _0x30491b[_0xfb83('0xa1')](_0xf494c1);}})[_0xfb83('0x2a')](function(_0x39529c){if(_0x39529c){return _0x39529c?{'count':_0x1ea8a1,'rows':_0x39529c}:null;}})[_0xfb83('0x2a')](respondWithResult(_0x3b75bc,null))['catch'](handleError(_0x3b75bc,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index f342d95..d440d84 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 _0x96aa=['events','Team','setMaxListeners','update','remove','emit','hook'];(function(_0x46e7fb,_0x2daf69){var _0x235a52=function(_0x10a1a6){while(--_0x10a1a6){_0x46e7fb['push'](_0x46e7fb['shift']());}};_0x235a52(++_0x2daf69);}(_0x96aa,0xaf));var _0xa96a=function(_0x56f591,_0xd3e156){_0x56f591=_0x56f591-0x0;var _0x486bb7=_0x96aa[_0x56f591];return _0x486bb7;};'use strict';var EventEmitter=require(_0xa96a('0x0'));var Team=require('../../mysqldb')['db'][_0xa96a('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xa96a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa96a('0x3'),'afterDestroy':_0xa96a('0x4')};function emitEvent(_0x38ddc6){return function(_0x55e924,_0x256f02,_0x179aea){TeamEvents[_0xa96a('0x5')](_0x38ddc6+':'+_0x55e924['id'],_0x55e924);TeamEvents[_0xa96a('0x5')](_0x38ddc6,_0x55e924);_0x179aea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xa96a('0x6')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x195e=['exports','events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x195e,0xfb));var _0xe195=function(_0x579cd9,_0x4f39ea){_0x579cd9=_0x579cd9-0x0;var _0x3074f3=_0x195e[_0x579cd9];return _0x3074f3;};'use strict';var EventEmitter=require(_0xe195('0x0'));var Team=require(_0xe195('0x1'))['db'][_0xe195('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xe195('0x3')](0x0);var events={'afterCreate':_0xe195('0x4'),'afterUpdate':_0xe195('0x5'),'afterDestroy':_0xe195('0x6')};function emitEvent(_0x4064fd){return function(_0x2243e9,_0x30011c,_0x31f6c9){TeamEvents[_0xe195('0x7')](_0x4064fd+':'+_0x2243e9['id'],_0x2243e9);TeamEvents[_0xe195('0x7')](_0x4064fd,_0x2243e9);_0x31f6c9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xe195('0x8')](e,emitEvent(event));}}module[_0xe195('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index f6b3288..2b68d29 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 _0xb302=['util','../../config/logger','api','moment','path','rimraf','exports','define','Team','teams'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xb302,0x6e));var _0x2b30=function(_0xe1ea3,_0x3e73ef){_0xe1ea3=_0xe1ea3-0x0;var _0x54bc95=_0xb302[_0xe1ea3];return _0x54bc95;};'use strict';var _=require('lodash');var util=require(_0x2b30('0x0'));var logger=require(_0x2b30('0x1'))(_0x2b30('0x2'));var moment=require(_0x2b30('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b30('0x4'));var rimraf=require(_0x2b30('0x5'));var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0x2b30('0x6')]=function(_0x1f7a88,_0x43daeb){return _0x1f7a88[_0x2b30('0x7')](_0x2b30('0x8'),attributes,{'tableName':_0x2b30('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3765=['moment','request-promise','rimraf','../../config/environment','exports','lodash','../../config/logger','api'];(function(_0x4f6a11,_0xa5a4b1){var _0x1757c5=function(_0x3dd747){while(--_0x3dd747){_0x4f6a11['push'](_0x4f6a11['shift']());}};_0x1757c5(++_0xa5a4b1);}(_0x3765,0x12d));var _0x5376=function(_0x35f630,_0x54f852){_0x35f630=_0x35f630-0x0;var _0x35864a=_0x3765[_0x35f630];return _0x35864a;};'use strict';var _=require(_0x5376('0x0'));var util=require('util');var logger=require(_0x5376('0x1'))(_0x5376('0x2'));var moment=require(_0x5376('0x3'));var BPromise=require('bluebird');var rp=require(_0x5376('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5376('0x5'));var config=require(_0x5376('0x6'));var attributes=require('./team.attributes');module[_0x5376('0x7')]=function(_0x5795be,_0x567a2d){return _0x5795be['define']('Team',attributes,{'tableName':'teams','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 684f2eb..0d0942d 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 _0x4eac=['code','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x319045,_0x2b88c1){var _0x410c99=function(_0x3a6ab7){while(--_0x3a6ab7){_0x319045['push'](_0x319045['shift']());}};_0x410c99(++_0x2b88c1);}(_0x4eac,0x1ae));var _0xc4ea=function(_0x41169e,_0x7b7ce){_0x41169e=_0x41169e-0x0;var _0x399c1f=_0x4eac[_0x41169e];return _0x399c1f;};'use strict';var _=require(_0xc4ea('0x0'));var util=require(_0xc4ea('0x1'));var moment=require(_0xc4ea('0x2'));var BPromise=require('bluebird');var rs=require(_0xc4ea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc4ea('0x4'))['db'];var utils=require(_0xc4ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc4ea('0x6'));var jayson=require(_0xc4ea('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xc4ea('0x8')]=_['defaults'](config['redis'],{'host':_0xc4ea('0x9'),'port':0x18eb});var socket=require(_0xc4ea('0xa'))(new Redis(config['redis']));require(_0xc4ea('0xb'))[_0xc4ea('0xc')](socket);function respondWithRpcPromise(_0x437a96,_0x4c8581,_0x2072a9){return new BPromise(function(_0x4b51b7,_0x41f19f){return client[_0xc4ea('0xd')](_0x437a96,_0x2072a9)[_0xc4ea('0xe')](function(_0x356b09){logger[_0xc4ea('0xf')](_0xc4ea('0x10'),_0x4c8581,_0xc4ea('0x11'));logger[_0xc4ea('0x12')]('Team,\x20%s,\x20%s,\x20%s',_0x4c8581,_0xc4ea('0x11'),JSON[_0xc4ea('0x13')](_0x356b09));if(_0x356b09['error']){if(_0x356b09['error'][_0xc4ea('0x14')]===0x1f4){logger[_0xc4ea('0x15')](_0xc4ea('0x10'),_0x4c8581,_0x356b09[_0xc4ea('0x15')][_0xc4ea('0x16')]);return _0x41f19f(_0x356b09[_0xc4ea('0x15')][_0xc4ea('0x16')]);}logger[_0xc4ea('0x15')](_0xc4ea('0x10'),_0x4c8581,_0x356b09[_0xc4ea('0x15')][_0xc4ea('0x16')]);return _0x4b51b7(_0x356b09['error'][_0xc4ea('0x16')]);}else{logger[_0xc4ea('0xf')](_0xc4ea('0x10'),_0x4c8581,_0xc4ea('0x11'));_0x4b51b7(_0x356b09[_0xc4ea('0x17')][_0xc4ea('0x16')]);}})[_0xc4ea('0x18')](function(_0x43ef82){logger[_0xc4ea('0x15')]('Team,\x20%s,\x20%s',_0x4c8581,_0x43ef82);_0x41f19f(_0x43ef82);});});} \ No newline at end of file +var _0x2168=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','redis','register','then','Team,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2cbc9a,_0x249ff2){var _0x9ee0c8=function(_0x292f56){while(--_0x292f56){_0x2cbc9a['push'](_0x2cbc9a['shift']());}};_0x9ee0c8(++_0x249ff2);}(_0x2168,0x12c));var _0x8216=function(_0x59ea93,_0x104bed){_0x59ea93=_0x59ea93-0x0;var _0xc68901=_0x2168[_0x59ea93];return _0xc68901;};'use strict';var _=require(_0x8216('0x0'));var util=require(_0x8216('0x1'));var moment=require(_0x8216('0x2'));var BPromise=require(_0x8216('0x3'));var rs=require(_0x8216('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8216('0x5'))['db'];var utils=require(_0x8216('0x6'));var logger=require(_0x8216('0x7'))(_0x8216('0x8'));var config=require(_0x8216('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8216('0xa')][_0x8216('0xb')]({'port':0x232a});config['redis']=_[_0x8216('0xc')](config['redis'],{'host':_0x8216('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8216('0xe')]));require('./team.socket')[_0x8216('0xf')](socket);function respondWithRpcPromise(_0x34d5e1,_0x54edcc,_0x372117){return new BPromise(function(_0x4499e9,_0x5dc28e){return client['request'](_0x34d5e1,_0x372117)[_0x8216('0x10')](function(_0x36aaf1){logger['info'](_0x8216('0x11'),_0x54edcc,'request\x20sent');logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x54edcc,'request\x20sent',JSON[_0x8216('0x12')](_0x36aaf1));if(_0x36aaf1[_0x8216('0x13')]){if(_0x36aaf1[_0x8216('0x13')][_0x8216('0x14')]===0x1f4){logger[_0x8216('0x13')](_0x8216('0x11'),_0x54edcc,_0x36aaf1[_0x8216('0x13')][_0x8216('0x15')]);return _0x5dc28e(_0x36aaf1[_0x8216('0x13')]['message']);}logger[_0x8216('0x13')](_0x8216('0x11'),_0x54edcc,_0x36aaf1['error'][_0x8216('0x15')]);return _0x4499e9(_0x36aaf1[_0x8216('0x13')][_0x8216('0x15')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x54edcc,_0x8216('0x16'));_0x4499e9(_0x36aaf1[_0x8216('0x17')]['message']);}})[_0x8216('0x18')](function(_0x52821e){logger[_0x8216('0x13')](_0x8216('0x11'),_0x54edcc,_0x52821e);_0x5dc28e(_0x52821e);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index bb823b5..8ac72bf 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 _0x1d90=['./team.events','remove','emit','removeListener','register','length'];(function(_0x5447bd,_0x106269){var _0x183e1a=function(_0x1baf2d){while(--_0x1baf2d){_0x5447bd['push'](_0x5447bd['shift']());}};_0x183e1a(++_0x106269);}(_0x1d90,0x13e));var _0x01d9=function(_0x26be12,_0x338b2c){_0x26be12=_0x26be12-0x0;var _0x110b3c=_0x1d90[_0x26be12];return _0x110b3c;};'use strict';var TeamEvents=require(_0x01d9('0x0'));var events=['save',_0x01d9('0x1'),'update'];function createListener(_0x433fc8,_0x5525be){return function(_0x1d6da0){_0x5525be[_0x01d9('0x2')](_0x433fc8,_0x1d6da0);};}function removeListener(_0x47e13e,_0x2f2e27){return function(){TeamEvents[_0x01d9('0x3')](_0x47e13e,_0x2f2e27);};}exports[_0x01d9('0x4')]=function(_0x549267){for(var _0x500fb7=0x0,_0x1664eb=events[_0x01d9('0x5')];_0x500fb7<_0x1664eb;_0x500fb7++){var _0x598409=events[_0x500fb7];var _0xef9d5b=createListener('team:'+_0x598409,_0x549267);TeamEvents['on'](_0x598409,_0xef9d5b);}}; \ No newline at end of file +var _0xbdd4=['update','emit','removeListener','register','remove'];(function(_0x4d57c0,_0x5b41a0){var _0x2543a1=function(_0x52a15a){while(--_0x52a15a){_0x4d57c0['push'](_0x4d57c0['shift']());}};_0x2543a1(++_0x5b41a0);}(_0xbdd4,0x14e));var _0x4bdd=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xbdd4[_0x4d07cc];return _0x42de3b;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0x4bdd('0x0'),_0x4bdd('0x1')];function createListener(_0x4eb082,_0x4c482d){return function(_0x1f2395){_0x4c482d[_0x4bdd('0x2')](_0x4eb082,_0x1f2395);};}function removeListener(_0x53f8f9,_0x10dc26){return function(){TeamEvents[_0x4bdd('0x3')](_0x53f8f9,_0x10dc26);};}exports[_0x4bdd('0x4')]=function(_0x494b9d){for(var _0x19a31a=0x0,_0x5096be=events['length'];_0x19a31a<_0x5096be;_0x19a31a++){var _0x49f6c1=events[_0x19a31a];var _0xa7889f=createListener('team:'+_0x49f6c1,_0x494b9d);TeamEvents['on'](_0x49f6c1,_0xa7889f);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index f35836a..f3e2d79 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 _0x05b0=['INTEGER'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x05b0,0x188));var _0x005b=function(_0x31a505,_0x54cf0b){_0x31a505=_0x31a505-0x0;var _0x2694d6=_0x05b0[_0x31a505];return _0x2694d6;};'use strict';var Sequelize=require('sequelize');module['exports']={'TeamId':{'type':Sequelize[_0x005b('0x0')]},'VoicePrefixId':{'type':Sequelize[_0x005b('0x0')]}}; \ No newline at end of file +var _0xafa8=['INTEGER','exports'];(function(_0x88e543,_0x1b273d){var _0x522dea=function(_0x424db6){while(--_0x424db6){_0x88e543['push'](_0x88e543['shift']());}};_0x522dea(++_0x1b273d);}(_0xafa8,0x135));var _0x8afa=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xafa8[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require('sequelize');module[_0x8afa('0x0')]={'TeamId':{'type':Sequelize[_0x8afa('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x8afa('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index ef1943f..9ff9ed5 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 _0x20d6=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','lodash','util'];(function(_0x33f6b6,_0x13938c){var _0x12a29c=function(_0xe73751){while(--_0xe73751){_0x33f6b6['push'](_0x33f6b6['shift']());}};_0x12a29c(++_0x13938c);}(_0x20d6,0x1b8));var _0x620d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x20d6[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x620d('0x0'));var util=require(_0x620d('0x1'));var logger=require(_0x620d('0x2'))(_0x620d('0x3'));var moment=require('moment');var BPromise=require(_0x620d('0x4'));var rp=require(_0x620d('0x5'));var fs=require('fs');var path=require(_0x620d('0x6'));var rimraf=require(_0x620d('0x7'));var config=require(_0x620d('0x8'));var attributes=require(_0x620d('0x9'));module[_0x620d('0xa')]=function(_0x46fc14,_0x28e29a){return _0x46fc14[_0x620d('0xb')](_0x620d('0xc'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0901=['moment','bluebird','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api'];(function(_0x30defd,_0x357daf){var _0x243c5d=function(_0x2eaf3b){while(--_0x2eaf3b){_0x30defd['push'](_0x30defd['shift']());}};_0x243c5d(++_0x357daf);}(_0x0901,0x134));var _0x1090=function(_0x126de4,_0x1048d3){_0x126de4=_0x126de4-0x0;var _0x5711f1=_0x0901[_0x126de4];return _0x5711f1;};'use strict';var _=require(_0x1090('0x0'));var util=require(_0x1090('0x1'));var logger=require(_0x1090('0x2'))(_0x1090('0x3'));var moment=require(_0x1090('0x4'));var BPromise=require(_0x1090('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1090('0x6'));var config=require(_0x1090('0x7'));var attributes=require(_0x1090('0x8'));module[_0x1090('0x9')]=function(_0x9a1121,_0x395921){return _0x9a1121['define'](_0x1090('0xa'),attributes,{'tableName':_0x1090('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 564cd1a..1c0c658 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x466824,_0xe35319){var _0x6d1537=function(_0x2ec60e){while(--_0x2ec60e){_0x466824['push'](_0x466824['shift']());}};_0x6d1537(++_0xe35319);}(_0xe706,0xa3));var _0x6e70=function(_0x515cff,_0x27d4a5){_0x515cff=_0x515cff-0x0;var _0x419c0e=_0xe706[_0x515cff];return _0x419c0e;};'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 +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x56e245,_0x39959c){var _0x501579=function(_0x5e359e){while(--_0x5e359e){_0x56e245['push'](_0x56e245['shift']());}};_0x501579(++_0x39959c);}(_0xe706,0xa3));var _0x6e70=function(_0x5474b4,_0x5027aa){_0x5474b4=_0x5474b4-0x0;var _0x33a0b5=_0xe706[_0x5474b4];return _0x33a0b5;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 0cd829e..1f66495 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 _0x6925=['sequelize','exports','INTEGER'];(function(_0x142e33,_0x1c6ce8){var _0x1ab301=function(_0x126e19){while(--_0x126e19){_0x142e33['push'](_0x142e33['shift']());}};_0x1ab301(++_0x1c6ce8);}(_0x6925,0x6f));var _0x5692=function(_0x1fdb27,_0x21928f){_0x1fdb27=_0x1fdb27-0x0;var _0x4a27dc=_0x6925[_0x1fdb27];return _0x4a27dc;};'use strict';var Sequelize=require(_0x5692('0x0'));module[_0x5692('0x1')]={'penalty':{'type':Sequelize[_0x5692('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3286=['sequelize','INTEGER'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0x3286,0x1da));var _0x6328=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3286[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6328('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6328('0x1')],'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 0affcc8..fb19dda 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 _0xa1fd=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x291e73,_0x240beb){_0x291e73=_0x291e73-0x0;var _0x15a90f=_0xa1fd[_0x291e73];return _0x15a90f;};'use strict';var _=require(_0xda1f('0x0'));var util=require(_0xda1f('0x1'));var logger=require(_0xda1f('0x2'))(_0xda1f('0x3'));var moment=require('moment');var BPromise=require(_0xda1f('0x4'));var rp=require(_0xda1f('0x5'));var fs=require('fs');var path=require(_0xda1f('0x6'));var rimraf=require(_0xda1f('0x7'));var config=require(_0xda1f('0x8'));var attributes=require('./teamVoiceQueue.attributes');module[_0xda1f('0x9')]=function(_0x3b9463,_0x362dee){return _0x3b9463['define'](_0xda1f('0xa'),attributes,{'tableName':_0xda1f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc79f=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc79f,0x82));var _0xfc79=function(_0x3e7cdb,_0x4119ea){_0x3e7cdb=_0x3e7cdb-0x0;var _0x24a0d3=_0xc79f[_0x3e7cdb];return _0x24a0d3;};'use strict';var _=require(_0xfc79('0x0'));var util=require(_0xfc79('0x1'));var logger=require(_0xfc79('0x2'))(_0xfc79('0x3'));var moment=require(_0xfc79('0x4'));var BPromise=require('bluebird');var rp=require(_0xfc79('0x5'));var fs=require('fs');var path=require(_0xfc79('0x6'));var rimraf=require(_0xfc79('0x7'));var config=require(_0xfc79('0x8'));var attributes=require(_0xfc79('0x9'));module[_0xfc79('0xa')]=function(_0x660769,_0x1ba054){return _0x660769[_0xfc79('0xb')]('TeamVoiceQueue',attributes,{'tableName':_0xfc79('0xc'),'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 df3699e..47de79d 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 _0x3a42=['../../mysqldb','../../config/logger','jayson/promise','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1c1d37,_0x482194){var _0x17e5ea=function(_0x4c331b){while(--_0x4c331b){_0x1c1d37['push'](_0x1c1d37['shift']());}};_0x17e5ea(++_0x482194);}(_0x3a42,0x19c));var _0x23a4=function(_0x5c676c,_0x63814e){_0x5c676c=_0x5c676c-0x0;var _0x278b2f=_0x3a42[_0x5c676c];return _0x278b2f;};'use strict';var _=require(_0x23a4('0x0'));var util=require(_0x23a4('0x1'));var moment=require(_0x23a4('0x2'));var BPromise=require(_0x23a4('0x3'));var rs=require(_0x23a4('0x4'));var fs=require('fs');var Redis=require(_0x23a4('0x5'));var db=require(_0x23a4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x23a4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x23a4('0x8'));var client=jayson['client'][_0x23a4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x112e31,_0x45a727,_0xd0be79){return new BPromise(function(_0x5c5dbe,_0x42b11a){return client[_0x23a4('0xa')](_0x112e31,_0xd0be79)[_0x23a4('0xb')](function(_0x5f3913){logger[_0x23a4('0xc')](_0x23a4('0xd'),_0x45a727,_0x23a4('0xe'));logger[_0x23a4('0xf')](_0x23a4('0x10'),_0x45a727,_0x23a4('0xe'),JSON[_0x23a4('0x11')](_0x5f3913));if(_0x5f3913[_0x23a4('0x12')]){if(_0x5f3913[_0x23a4('0x12')][_0x23a4('0x13')]===0x1f4){logger[_0x23a4('0x12')](_0x23a4('0xd'),_0x45a727,_0x5f3913[_0x23a4('0x12')]['message']);return _0x42b11a(_0x5f3913[_0x23a4('0x12')][_0x23a4('0x14')]);}logger[_0x23a4('0x12')](_0x23a4('0xd'),_0x45a727,_0x5f3913[_0x23a4('0x12')][_0x23a4('0x14')]);return _0x5c5dbe(_0x5f3913[_0x23a4('0x12')][_0x23a4('0x14')]);}else{logger[_0x23a4('0xc')](_0x23a4('0xd'),_0x45a727,'request\x20sent');_0x5c5dbe(_0x5f3913[_0x23a4('0x15')][_0x23a4('0x14')]);}})['catch'](function(_0x431b42){logger[_0x23a4('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x45a727,_0x431b42);_0x42b11a(_0x431b42);});});} \ No newline at end of file +var _0x14ac=['http','request','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x590ef3,_0x3b2dd2){var _0x4502be=function(_0x2c8011){while(--_0x2c8011){_0x590ef3['push'](_0x590ef3['shift']());}};_0x4502be(++_0x3b2dd2);}(_0x14ac,0x13b));var _0xc14a=function(_0xa3400,_0x3a980a){_0xa3400=_0xa3400-0x0;var _0x33dba2=_0x14ac[_0xa3400];return _0x33dba2;};'use strict';var _=require('lodash');var util=require(_0xc14a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc14a('0x1'));var fs=require('fs');var Redis=require(_0xc14a('0x2'));var db=require(_0xc14a('0x3'))['db'];var utils=require(_0xc14a('0x4'));var logger=require(_0xc14a('0x5'))(_0xc14a('0x6'));var config=require(_0xc14a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc14a('0x8')][_0xc14a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17a7d5,_0x42d5cf,_0x16ad35){return new BPromise(function(_0x357cd7,_0x4b164e){return client[_0xc14a('0xa')](_0x17a7d5,_0x16ad35)['then'](function(_0x5c8738){logger['info'](_0xc14a('0xb'),_0x42d5cf,'request\x20sent');logger[_0xc14a('0xc')](_0xc14a('0xd'),_0x42d5cf,'request\x20sent',JSON['stringify'](_0x5c8738));if(_0x5c8738[_0xc14a('0xe')]){if(_0x5c8738[_0xc14a('0xe')][_0xc14a('0xf')]===0x1f4){logger['error'](_0xc14a('0xb'),_0x42d5cf,_0x5c8738[_0xc14a('0xe')][_0xc14a('0x10')]);return _0x4b164e(_0x5c8738[_0xc14a('0xe')][_0xc14a('0x10')]);}logger['error'](_0xc14a('0xb'),_0x42d5cf,_0x5c8738['error'][_0xc14a('0x10')]);return _0x357cd7(_0x5c8738[_0xc14a('0xe')]['message']);}else{logger['info'](_0xc14a('0xb'),_0x42d5cf,'request\x20sent');_0x357cd7(_0x5c8738[_0xc14a('0x11')][_0xc14a('0x10')]);}})['catch'](function(_0x55b0d6){logger[_0xc14a('0xe')](_0xc14a('0xb'),_0x42d5cf,_0x55b0d6);_0x4b164e(_0x55b0d6);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 2b6c201..d4f2d8e 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 _0x147b=['/:id','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','isAuthenticated','index','get','show','post','create','put'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x147b,0x193));var _0xb147=function(_0x51af96,_0x2494ea){_0x51af96=_0x51af96-0x0;var _0x7c9730=_0x147b[_0x51af96];return _0x7c9730;};'use strict';var multer=require(_0xb147('0x0'));var util=require(_0xb147('0x1'));var path=require('path');var timeout=require(_0xb147('0x2'));var express=require(_0xb147('0x3'));var router=express['Router']();var fs_extra=require(_0xb147('0x4'));var auth=require(_0xb147('0x5'));var interaction=require(_0xb147('0x6'));var config=require('../../config/environment');var controller=require(_0xb147('0x7'));router['get']('/',auth[_0xb147('0x8')](),controller[_0xb147('0x9')]);router[_0xb147('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xb147('0xb')]);router[_0xb147('0xc')]('/',auth[_0xb147('0x8')](),controller[_0xb147('0xd')]);router[_0xb147('0xe')](_0xb147('0xf'),auth[_0xb147('0x8')](),controller[_0xb147('0x10')]);router['delete']('/:id',auth[_0xb147('0x8')](),controller[_0xb147('0x11')]);module[_0xb147('0x12')]=router; \ No newline at end of file +var _0x404d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','get','index','show','post','put','/:id','isAuthenticated','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x404d,0x1e9));var _0xd404=function(_0x11dcef,_0x25a423){_0x11dcef=_0x11dcef-0x0;var _0x165993=_0x404d[_0x11dcef];return _0x165993;};'use strict';var multer=require(_0xd404('0x0'));var util=require(_0xd404('0x1'));var path=require(_0xd404('0x2'));var timeout=require(_0xd404('0x3'));var express=require(_0xd404('0x4'));var router=express[_0xd404('0x5')]();var fs_extra=require(_0xd404('0x6'));var auth=require(_0xd404('0x7'));var interaction=require(_0xd404('0x8'));var config=require('../../config/environment');var controller=require(_0xd404('0x9'));router[_0xd404('0xa')]('/',auth['isAuthenticated'](),controller[_0xd404('0xb')]);router[_0xd404('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xd404('0xc')]);router[_0xd404('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd404('0xe')](_0xd404('0xf'),auth[_0xd404('0x10')](),controller[_0xd404('0x11')]);router['delete']('/:id',auth[_0xd404('0x10')](),controller[_0xd404('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index cad66b8..91fe5b3 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 _0xe457=['exports','STRING','TEXT'];(function(_0x102789,_0x24217f){var _0x4aeb4f=function(_0x48bbcb){while(--_0x48bbcb){_0x102789['push'](_0x102789['shift']());}};_0x4aeb4f(++_0x24217f);}(_0xe457,0x1b6));var _0x7e45=function(_0x28be3e,_0x28728c){_0x28be3e=_0x28be3e-0x0;var _0x20029d=_0xe457[_0x28be3e];return _0x20029d;};'use strict';var Sequelize=require('sequelize');module[_0x7e45('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7e45('0x1')]},'html':{'type':Sequelize[_0x7e45('0x2')]}}; \ No newline at end of file +var _0x47c4=['TEXT','exports','STRING'];(function(_0x4b6f9c,_0x50f561){var _0x41264e=function(_0x1062db){while(--_0x1062db){_0x4b6f9c['push'](_0x4b6f9c['shift']());}};_0x41264e(++_0x50f561);}(_0x47c4,0x1e1));var _0x447c=function(_0x4e26b8,_0x1a3c12){_0x4e26b8=_0x4e26b8-0x0;var _0x10a6f0=_0x47c4[_0x4e26b8];return _0x10a6f0;};'use strict';var Sequelize=require('sequelize');module[_0x447c('0x0')]={'name':{'type':Sequelize[_0x447c('0x1')]},'description':{'type':Sequelize[_0x447c('0x1')]},'html':{'type':Sequelize[_0x447c('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index ddc72cf..ee6e530 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 _0x8a60=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','save','destroy','then','get','Templates','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Template','includeAll','catch','keys','filters','include','options','find','create','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x629444,_0x49e531){var _0x13369a=function(_0x377d77){while(--_0x377d77){_0x629444['push'](_0x629444['shift']());}};_0x13369a(++_0x49e531);}(_0x8a60,0x176));var _0x08a6=function(_0x58f6fd,_0x8e6c3d){_0x58f6fd=_0x58f6fd-0x0;var _0x44dce4=_0x8a60[_0x58f6fd];return _0x44dce4;};'use strict';var emlformat=require(_0x08a6('0x0'));var rimraf=require(_0x08a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x08a6('0x2'));var rp=require(_0x08a6('0x3'));var moment=require(_0x08a6('0x4'));var BPromise=require(_0x08a6('0x5'));var Mustache=require(_0x08a6('0x6'));var util=require(_0x08a6('0x7'));var path=require(_0x08a6('0x8'));var sox=require(_0x08a6('0x9'));var csv=require(_0x08a6('0xa'));var ejs=require(_0x08a6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x08a6('0xc'));var squel=require(_0x08a6('0xd'));var crypto=require(_0x08a6('0xe'));var jsforce=require(_0x08a6('0xf'));var deskjs=require(_0x08a6('0x10'));var toCsv=require(_0x08a6('0xa'));var querystring=require(_0x08a6('0x11'));var Papa=require(_0x08a6('0x12'));var Redis=require('ioredis');var authService=require(_0x08a6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x08a6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x08a6('0x15'));var utils=require(_0x08a6('0x16'));var config=require(_0x08a6('0x17'));var licenseUtil=require(_0x08a6('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fae54,_0x38efd6){_0x38efd6=_0x38efd6||0xcc;return function(_0x142ba3){if(_0x142ba3){return _0x2fae54[_0x08a6('0x19')](_0x38efd6);}return _0x2fae54[_0x08a6('0x1a')](_0x38efd6)[_0x08a6('0x1b')]();};}function respondWithResult(_0x4467e6,_0x3a16b2){_0x3a16b2=_0x3a16b2||0xc8;return function(_0x1d7009){if(_0x1d7009){return _0x4467e6[_0x08a6('0x1a')](_0x3a16b2)[_0x08a6('0x1c')](_0x1d7009);}};}function respondWithFilteredResult(_0x4b4930,_0xe4d0da){return function(_0x4a2de3){if(_0x4a2de3){var _0x2facbf=typeof _0xe4d0da[_0x08a6('0x1d')]===_0x08a6('0x1e')&&typeof _0xe4d0da['limit']==='undefined';var _0x407643=_0x4a2de3[_0x08a6('0x1f')];var _0x1f3ac5=_0x2facbf?0x0:_0xe4d0da[_0x08a6('0x1d')];var _0x56c84c=_0x2facbf?_0x4a2de3['count']:_0xe4d0da[_0x08a6('0x1d')]+_0xe4d0da[_0x08a6('0x20')];var _0x45971e;if(_0x56c84c>=_0x407643){_0x56c84c=_0x407643;_0x45971e=0xc8;}else{_0x45971e=0xce;}_0x4b4930[_0x08a6('0x1a')](_0x45971e);return _0x4b4930['set']('Content-Range',_0x1f3ac5+'-'+_0x56c84c+'/'+_0x407643)['json'](_0x4a2de3);}return null;};}function patchUpdates(_0x1f0e6a){return function(_0x1d89fa){try{jsonpatch['apply'](_0x1d89fa,_0x1f0e6a,!![]);}catch(_0xe4b6bf){return BPromise['reject'](_0xe4b6bf);}return _0x1d89fa[_0x08a6('0x21')]();};}function saveUpdates(_0xcad271,_0x29092a){return function(_0x3d973f){if(_0x3d973f){return _0x3d973f['update'](_0xcad271)['then'](function(_0x8f3210){return _0x8f3210;});}return null;};}function removeEntity(_0x3232fb,_0x246f96){return function(_0x238e41){if(_0x238e41){return _0x238e41[_0x08a6('0x22')]()[_0x08a6('0x23')](function(){var _0x472bc0=_0x238e41[_0x08a6('0x24')]({'plain':!![]});var _0xdb7ece=_0x08a6('0x25');return db[_0x08a6('0x26')][_0x08a6('0x22')]({'where':{'type':_0xdb7ece,'resourceId':_0x472bc0['id']}})[_0x08a6('0x23')](function(){return _0x238e41;});})['then'](function(){_0x3232fb[_0x08a6('0x1a')](0xcc)[_0x08a6('0x1b')]();});}};}function handleEntityNotFound(_0xd9289d,_0x1fe4d9){return function(_0x2de980){if(!_0x2de980){_0xd9289d[_0x08a6('0x19')](0x194);}return _0x2de980;};}function handleError(_0x5cae30,_0x5c2f49){_0x5c2f49=_0x5c2f49||0x1f4;return function(_0x2181e5){logger[_0x08a6('0x27')](_0x2181e5['stack']);if(_0x2181e5[_0x08a6('0x28')]){delete _0x2181e5['name'];}_0x5cae30[_0x08a6('0x1a')](_0x5c2f49)[_0x08a6('0x29')](_0x2181e5);};}exports[_0x08a6('0x2a')]=function(_0x34aa52,_0x11baef){var _0x1d525a={},_0x239bf0={},_0x58c8a7={'count':0x0,'rows':[]};var _0x19f100=_[_0x08a6('0x2b')](db['Template'][_0x08a6('0x2c')],function(_0x39e9c0){return{'name':_0x39e9c0[_0x08a6('0x2d')],'type':_0x39e9c0[_0x08a6('0x2e')][_0x08a6('0x2f')]};});_0x239bf0['model']=_[_0x08a6('0x2b')](_0x19f100,_0x08a6('0x28'));_0x239bf0[_0x08a6('0x30')]=_['keys'](_0x34aa52['query']);_0x239bf0['filters']=_[_0x08a6('0x31')](_0x239bf0[_0x08a6('0x32')],_0x239bf0[_0x08a6('0x30')]);_0x1d525a[_0x08a6('0x33')]=_['intersection'](_0x239bf0[_0x08a6('0x32')],qs[_0x08a6('0x34')](_0x34aa52[_0x08a6('0x30')][_0x08a6('0x34')]));_0x1d525a[_0x08a6('0x33')]=_0x1d525a['attributes'][_0x08a6('0x35')]?_0x1d525a['attributes']:_0x239bf0['model'];if(!_0x34aa52[_0x08a6('0x30')][_0x08a6('0x36')](_0x08a6('0x37'))){_0x1d525a[_0x08a6('0x20')]=qs[_0x08a6('0x20')](_0x34aa52['query'][_0x08a6('0x20')]);_0x1d525a[_0x08a6('0x1d')]=qs[_0x08a6('0x1d')](_0x34aa52[_0x08a6('0x30')][_0x08a6('0x1d')]);}_0x1d525a[_0x08a6('0x38')]=qs[_0x08a6('0x39')](_0x34aa52[_0x08a6('0x30')][_0x08a6('0x39')]);_0x1d525a[_0x08a6('0x3a')]=qs['filters'](_[_0x08a6('0x3b')](_0x34aa52[_0x08a6('0x30')],_0x239bf0['filters']),_0x19f100);if(_0x34aa52[_0x08a6('0x30')][_0x08a6('0x3c')]){_0x1d525a[_0x08a6('0x3a')]=_[_0x08a6('0x3d')](_0x1d525a[_0x08a6('0x3a')],{'$or':_['map'](_0x19f100,function(_0xaec2ef){if(_0xaec2ef[_0x08a6('0x2e')]!==_0x08a6('0x3e')){var _0x5eb313={};_0x5eb313[_0xaec2ef[_0x08a6('0x28')]]={'$like':'%'+_0x34aa52['query'][_0x08a6('0x3c')]+'%'};return _0x5eb313;}})});}_0x1d525a=_[_0x08a6('0x3d')]({},_0x1d525a,_0x34aa52['options']);var _0x286821={'where':_0x1d525a[_0x08a6('0x3a')]};return db[_0x08a6('0x3f')][_0x08a6('0x1f')](_0x286821)[_0x08a6('0x23')](function(_0x51a88b){_0x58c8a7[_0x08a6('0x1f')]=_0x51a88b;if(_0x34aa52[_0x08a6('0x30')][_0x08a6('0x40')]){_0x1d525a['include']=[{'all':!![]}];}return db[_0x08a6('0x3f')]['findAll'](_0x1d525a);})['then'](function(_0x1b6d78){_0x58c8a7['rows']=_0x1b6d78;return _0x58c8a7;})[_0x08a6('0x23')](respondWithFilteredResult(_0x11baef,_0x1d525a))[_0x08a6('0x41')](handleError(_0x11baef,null));};exports['show']=function(_0x12f813,_0x1feff8){var _0x2443b1={'raw':!![],'where':{'id':_0x12f813['params']['id']}},_0x9d4f00={};_0x9d4f00[_0x08a6('0x32')]=_['keys'](db['Template'][_0x08a6('0x2c')]);_0x9d4f00[_0x08a6('0x30')]=_[_0x08a6('0x42')](_0x12f813['query']);_0x9d4f00[_0x08a6('0x43')]=_['intersection'](_0x9d4f00['model'],_0x9d4f00[_0x08a6('0x30')]);_0x2443b1['attributes']=_['intersection'](_0x9d4f00[_0x08a6('0x32')],qs[_0x08a6('0x34')](_0x12f813[_0x08a6('0x30')][_0x08a6('0x34')]));_0x2443b1[_0x08a6('0x33')]=_0x2443b1[_0x08a6('0x33')][_0x08a6('0x35')]?_0x2443b1[_0x08a6('0x33')]:_0x9d4f00[_0x08a6('0x32')];if(_0x12f813[_0x08a6('0x30')][_0x08a6('0x40')]){_0x2443b1[_0x08a6('0x44')]=[{'all':!![]}];}_0x2443b1=_[_0x08a6('0x3d')]({},_0x2443b1,_0x12f813[_0x08a6('0x45')]);return db[_0x08a6('0x3f')][_0x08a6('0x46')](_0x2443b1)[_0x08a6('0x23')](handleEntityNotFound(_0x1feff8,null))[_0x08a6('0x23')](respondWithResult(_0x1feff8,null))[_0x08a6('0x41')](handleError(_0x1feff8,null));};exports['create']=function(_0x595204,_0x5b5966){return db[_0x08a6('0x3f')][_0x08a6('0x47')](_0x595204['body'],{})['then'](function(_0x5edb64){var _0x4a67b4=_0x595204[_0x08a6('0x48')]['get']({'plain':!![]});if(!_0x4a67b4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a67b4[_0x08a6('0x49')]===_0x08a6('0x48')){var _0x4e7eb2=_0x5edb64[_0x08a6('0x24')]({'plain':!![]});var _0x223436=_0x08a6('0x25');return db[_0x08a6('0x4a')]['find']({'where':{'name':_0x223436,'userProfileId':_0x4a67b4[_0x08a6('0x4b')]},'raw':!![]})[_0x08a6('0x23')](function(_0x2d154e){if(_0x2d154e&&_0x2d154e['autoAssociation']===0x0){return db[_0x08a6('0x26')][_0x08a6('0x47')]({'name':_0x4e7eb2[_0x08a6('0x28')],'resourceId':_0x4e7eb2['id'],'type':_0x2d154e[_0x08a6('0x28')],'sectionId':_0x2d154e['id']},{})['then'](function(){return _0x5edb64;});}else{return _0x5edb64;}})[_0x08a6('0x41')](function(_0x12286a){logger[_0x08a6('0x27')](_0x08a6('0x4c'),_0x12286a);throw _0x12286a;});}return _0x5edb64;})[_0x08a6('0x23')](respondWithResult(_0x5b5966,0xc9))[_0x08a6('0x41')](handleError(_0x5b5966,null));};exports['update']=function(_0x248199,_0x4253c7){if(_0x248199[_0x08a6('0x4d')]['id']){delete _0x248199['body']['id'];}return db['Template'][_0x08a6('0x46')]({'where':{'id':_0x248199[_0x08a6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4253c7,null))[_0x08a6('0x23')](saveUpdates(_0x248199[_0x08a6('0x4d')],null))[_0x08a6('0x23')](respondWithResult(_0x4253c7,null))[_0x08a6('0x41')](handleError(_0x4253c7,null));};exports[_0x08a6('0x22')]=function(_0x5c4305,_0xd085bc){return db[_0x08a6('0x3f')][_0x08a6('0x46')]({'where':{'id':_0x5c4305[_0x08a6('0x4e')]['id']}})[_0x08a6('0x23')](handleEntityNotFound(_0xd085bc,null))['then'](removeEntity(_0xd085bc,null))[_0x08a6('0x41')](handleError(_0xd085bc,null));}; \ No newline at end of file +var _0xebea=['end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','get','Templates','UserProfileResource','error','stack','name','index','map','Template','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','length','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x42167f,_0x36c277){var _0x20f119=function(_0x1f79f3){while(--_0x1f79f3){_0x42167f['push'](_0x42167f['shift']());}};_0x20f119(++_0x36c277);}(_0xebea,0xe4));var _0xaebe=function(_0x53030b,_0x43f3da){_0x53030b=_0x53030b-0x0;var _0x2bee3d=_0xebea[_0x53030b];return _0x2bee3d;};'use strict';var emlformat=require(_0xaebe('0x0'));var rimraf=require(_0xaebe('0x1'));var zipdir=require(_0xaebe('0x2'));var jsonpatch=require(_0xaebe('0x3'));var rp=require(_0xaebe('0x4'));var moment=require(_0xaebe('0x5'));var BPromise=require(_0xaebe('0x6'));var Mustache=require(_0xaebe('0x7'));var util=require('util');var path=require(_0xaebe('0x8'));var sox=require(_0xaebe('0x9'));var csv=require(_0xaebe('0xa'));var ejs=require(_0xaebe('0xb'));var fs=require('fs');var fs_extra=require(_0xaebe('0xc'));var _=require('lodash');var squel=require(_0xaebe('0xd'));var crypto=require(_0xaebe('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xaebe('0xa'));var querystring=require(_0xaebe('0xf'));var Papa=require(_0xaebe('0x10'));var Redis=require(_0xaebe('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaebe('0x12'));var hardwareService=require(_0xaebe('0x13'));var logger=require(_0xaebe('0x14'))(_0xaebe('0x15'));var utils=require('../../config/utils');var config=require(_0xaebe('0x16'));var licenseUtil=require(_0xaebe('0x17'));var db=require(_0xaebe('0x18'))['db'];function respondWithStatusCode(_0xd9532e,_0x356652){_0x356652=_0x356652||0xcc;return function(_0x164c91){if(_0x164c91){return _0xd9532e[_0xaebe('0x19')](_0x356652);}return _0xd9532e[_0xaebe('0x1a')](_0x356652)[_0xaebe('0x1b')]();};}function respondWithResult(_0x1250bd,_0x37424b){_0x37424b=_0x37424b||0xc8;return function(_0x5830db){if(_0x5830db){return _0x1250bd[_0xaebe('0x1a')](_0x37424b)[_0xaebe('0x1c')](_0x5830db);}};}function respondWithFilteredResult(_0xd2e1b9,_0x59f08f){return function(_0x1ed90b){if(_0x1ed90b){var _0x4cff79=typeof _0x59f08f['offset']===_0xaebe('0x1d')&&typeof _0x59f08f[_0xaebe('0x1e')]===_0xaebe('0x1d');var _0x3737ea=_0x1ed90b[_0xaebe('0x1f')];var _0x52de68=_0x4cff79?0x0:_0x59f08f[_0xaebe('0x20')];var _0x2f812f=_0x4cff79?_0x1ed90b['count']:_0x59f08f['offset']+_0x59f08f[_0xaebe('0x1e')];var _0x330287;if(_0x2f812f>=_0x3737ea){_0x2f812f=_0x3737ea;_0x330287=0xc8;}else{_0x330287=0xce;}_0xd2e1b9[_0xaebe('0x1a')](_0x330287);return _0xd2e1b9[_0xaebe('0x21')](_0xaebe('0x22'),_0x52de68+'-'+_0x2f812f+'/'+_0x3737ea)[_0xaebe('0x1c')](_0x1ed90b);}return null;};}function patchUpdates(_0x1b2072){return function(_0x2c4bba){try{jsonpatch['apply'](_0x2c4bba,_0x1b2072,!![]);}catch(_0x4bf909){return BPromise[_0xaebe('0x23')](_0x4bf909);}return _0x2c4bba[_0xaebe('0x24')]();};}function saveUpdates(_0x42bb91,_0x3050a1){return function(_0xf2123e){if(_0xf2123e){return _0xf2123e[_0xaebe('0x25')](_0x42bb91)[_0xaebe('0x26')](function(_0x29d6bb){return _0x29d6bb;});}return null;};}function removeEntity(_0x519f32,_0x150643){return function(_0x5dd93d){if(_0x5dd93d){return _0x5dd93d['destroy']()['then'](function(){var _0x2a8607=_0x5dd93d[_0xaebe('0x27')]({'plain':!![]});var _0x24ac74=_0xaebe('0x28');return db[_0xaebe('0x29')]['destroy']({'where':{'type':_0x24ac74,'resourceId':_0x2a8607['id']}})[_0xaebe('0x26')](function(){return _0x5dd93d;});})['then'](function(){_0x519f32[_0xaebe('0x1a')](0xcc)[_0xaebe('0x1b')]();});}};}function handleEntityNotFound(_0xfbbeb8,_0x2c6b20){return function(_0x68fba3){if(!_0x68fba3){_0xfbbeb8[_0xaebe('0x19')](0x194);}return _0x68fba3;};}function handleError(_0x22ff05,_0x619a08){_0x619a08=_0x619a08||0x1f4;return function(_0x15f823){logger[_0xaebe('0x2a')](_0x15f823[_0xaebe('0x2b')]);if(_0x15f823[_0xaebe('0x2c')]){delete _0x15f823['name'];}_0x22ff05['status'](_0x619a08)['send'](_0x15f823);};}exports[_0xaebe('0x2d')]=function(_0x51f328,_0x1b5339){var _0x6d152d={},_0x2c6b78={},_0x4ccc6c={'count':0x0,'rows':[]};var _0x23f75a=_[_0xaebe('0x2e')](db[_0xaebe('0x2f')][_0xaebe('0x30')],function(_0x132dfb){return{'name':_0x132dfb[_0xaebe('0x31')],'type':_0x132dfb[_0xaebe('0x32')]['key']};});_0x2c6b78[_0xaebe('0x33')]=_['map'](_0x23f75a,_0xaebe('0x2c'));_0x2c6b78[_0xaebe('0x34')]=_[_0xaebe('0x35')](_0x51f328[_0xaebe('0x34')]);_0x2c6b78[_0xaebe('0x36')]=_['intersection'](_0x2c6b78[_0xaebe('0x33')],_0x2c6b78[_0xaebe('0x34')]);_0x6d152d[_0xaebe('0x37')]=_[_0xaebe('0x38')](_0x2c6b78['model'],qs['fields'](_0x51f328[_0xaebe('0x34')][_0xaebe('0x39')]));_0x6d152d['attributes']=_0x6d152d[_0xaebe('0x37')]['length']?_0x6d152d[_0xaebe('0x37')]:_0x2c6b78[_0xaebe('0x33')];if(!_0x51f328[_0xaebe('0x34')][_0xaebe('0x3a')](_0xaebe('0x3b'))){_0x6d152d[_0xaebe('0x1e')]=qs['limit'](_0x51f328['query'][_0xaebe('0x1e')]);_0x6d152d[_0xaebe('0x20')]=qs['offset'](_0x51f328[_0xaebe('0x34')][_0xaebe('0x20')]);}_0x6d152d[_0xaebe('0x3c')]=qs[_0xaebe('0x3d')](_0x51f328[_0xaebe('0x34')][_0xaebe('0x3d')]);_0x6d152d[_0xaebe('0x3e')]=qs[_0xaebe('0x36')](_[_0xaebe('0x3f')](_0x51f328['query'],_0x2c6b78[_0xaebe('0x36')]),_0x23f75a);if(_0x51f328[_0xaebe('0x34')][_0xaebe('0x40')]){_0x6d152d[_0xaebe('0x3e')]=_[_0xaebe('0x41')](_0x6d152d[_0xaebe('0x3e')],{'$or':_[_0xaebe('0x2e')](_0x23f75a,function(_0x5f0ea8){if(_0x5f0ea8['type']!=='VIRTUAL'){var _0x33e2b1={};_0x33e2b1[_0x5f0ea8[_0xaebe('0x2c')]]={'$like':'%'+_0x51f328[_0xaebe('0x34')][_0xaebe('0x40')]+'%'};return _0x33e2b1;}})});}_0x6d152d=_[_0xaebe('0x41')]({},_0x6d152d,_0x51f328[_0xaebe('0x42')]);var _0x237eb3={'where':_0x6d152d[_0xaebe('0x3e')]};return db['Template']['count'](_0x237eb3)[_0xaebe('0x26')](function(_0x476dec){_0x4ccc6c[_0xaebe('0x1f')]=_0x476dec;if(_0x51f328['query']['includeAll']){_0x6d152d[_0xaebe('0x43')]=[{'all':!![]}];}return db[_0xaebe('0x2f')][_0xaebe('0x44')](_0x6d152d);})[_0xaebe('0x26')](function(_0xd17cb3){_0x4ccc6c[_0xaebe('0x45')]=_0xd17cb3;return _0x4ccc6c;})[_0xaebe('0x26')](respondWithFilteredResult(_0x1b5339,_0x6d152d))[_0xaebe('0x46')](handleError(_0x1b5339,null));};exports[_0xaebe('0x47')]=function(_0x24f31f,_0x5f27cc){var _0x53de98={'raw':!![],'where':{'id':_0x24f31f[_0xaebe('0x48')]['id']}},_0x399a4a={};_0x399a4a[_0xaebe('0x33')]=_[_0xaebe('0x35')](db[_0xaebe('0x2f')]['rawAttributes']);_0x399a4a[_0xaebe('0x34')]=_[_0xaebe('0x35')](_0x24f31f[_0xaebe('0x34')]);_0x399a4a[_0xaebe('0x36')]=_[_0xaebe('0x38')](_0x399a4a['model'],_0x399a4a['query']);_0x53de98[_0xaebe('0x37')]=_['intersection'](_0x399a4a[_0xaebe('0x33')],qs['fields'](_0x24f31f[_0xaebe('0x34')]['fields']));_0x53de98[_0xaebe('0x37')]=_0x53de98['attributes'][_0xaebe('0x49')]?_0x53de98[_0xaebe('0x37')]:_0x399a4a[_0xaebe('0x33')];if(_0x24f31f[_0xaebe('0x34')][_0xaebe('0x4a')]){_0x53de98[_0xaebe('0x43')]=[{'all':!![]}];}_0x53de98=_[_0xaebe('0x41')]({},_0x53de98,_0x24f31f['options']);return db[_0xaebe('0x2f')]['find'](_0x53de98)['then'](handleEntityNotFound(_0x5f27cc,null))['then'](respondWithResult(_0x5f27cc,null))[_0xaebe('0x46')](handleError(_0x5f27cc,null));};exports[_0xaebe('0x4b')]=function(_0x8836fc,_0x58693a){return db[_0xaebe('0x2f')]['create'](_0x8836fc[_0xaebe('0x4c')],{})['then'](function(_0x521d31){var _0x52b330=_0x8836fc[_0xaebe('0x4d')]['get']({'plain':!![]});if(!_0x52b330)throw new Error(_0xaebe('0x4e'));if(_0x52b330['role']===_0xaebe('0x4d')){var _0x7c97fd=_0x521d31[_0xaebe('0x27')]({'plain':!![]});var _0x5666c0='Templates';return db[_0xaebe('0x4f')]['find']({'where':{'name':_0x5666c0,'userProfileId':_0x52b330[_0xaebe('0x50')]},'raw':!![]})[_0xaebe('0x26')](function(_0x4a6988){if(_0x4a6988&&_0x4a6988[_0xaebe('0x51')]===0x0){return db['UserProfileResource'][_0xaebe('0x4b')]({'name':_0x7c97fd[_0xaebe('0x2c')],'resourceId':_0x7c97fd['id'],'type':_0x4a6988[_0xaebe('0x2c')],'sectionId':_0x4a6988['id']},{})[_0xaebe('0x26')](function(){return _0x521d31;});}else{return _0x521d31;}})[_0xaebe('0x46')](function(_0x1aa632){logger[_0xaebe('0x2a')](_0xaebe('0x52'),_0x1aa632);throw _0x1aa632;});}return _0x521d31;})['then'](respondWithResult(_0x58693a,0xc9))[_0xaebe('0x46')](handleError(_0x58693a,null));};exports[_0xaebe('0x25')]=function(_0x33e5ea,_0x5e4e69){if(_0x33e5ea[_0xaebe('0x4c')]['id']){delete _0x33e5ea[_0xaebe('0x4c')]['id'];}return db[_0xaebe('0x2f')][_0xaebe('0x53')]({'where':{'id':_0x33e5ea[_0xaebe('0x48')]['id']}})[_0xaebe('0x26')](handleEntityNotFound(_0x5e4e69,null))[_0xaebe('0x26')](saveUpdates(_0x33e5ea['body'],null))['then'](respondWithResult(_0x5e4e69,null))['catch'](handleError(_0x5e4e69,null));};exports[_0xaebe('0x54')]=function(_0x4003cb,_0x405998){return db[_0xaebe('0x2f')][_0xaebe('0x53')]({'where':{'id':_0x4003cb[_0xaebe('0x48')]['id']}})[_0xaebe('0x26')](handleEntityNotFound(_0x405998,null))['then'](removeEntity(_0x405998,null))['catch'](handleError(_0x405998,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 04c7f82..9b27a5a 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 _0x8bcf=['tools_templates','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./template.attributes','define','Template'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8bcf,0x121));var _0xf8bc=function(_0x20f096,_0x34e00c){_0x20f096=_0x20f096-0x0;var _0x26a65f=_0x8bcf[_0x20f096];return _0x26a65f;};'use strict';var _=require(_0xf8bc('0x0'));var util=require(_0xf8bc('0x1'));var logger=require(_0xf8bc('0x2'))(_0xf8bc('0x3'));var moment=require(_0xf8bc('0x4'));var BPromise=require(_0xf8bc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8bc('0x6'));var rimraf=require(_0xf8bc('0x7'));var config=require('../../config/environment');var attributes=require(_0xf8bc('0x8'));module['exports']=function(_0x497fb9,_0x5d488e){return _0x497fb9[_0xf8bc('0x9')](_0xf8bc('0xa'),attributes,{'tableName':_0xf8bc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd821=['../../config/environment','exports','define','tools_templates','util','api','path','rimraf'];(function(_0x4ced31,_0x3387c1){var _0x1923b5=function(_0x4d6dfd){while(--_0x4d6dfd){_0x4ced31['push'](_0x4ced31['shift']());}};_0x1923b5(++_0x3387c1);}(_0xd821,0x1f4));var _0x1d82=function(_0x1f3e6b,_0x130459){_0x1f3e6b=_0x1f3e6b-0x0;var _0x5d29bc=_0xd821[_0x1f3e6b];return _0x5d29bc;};'use strict';var _=require('lodash');var util=require(_0x1d82('0x0'));var logger=require('../../config/logger')(_0x1d82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d82('0x2'));var rimraf=require(_0x1d82('0x3'));var config=require(_0x1d82('0x4'));var attributes=require('./template.attributes');module[_0x1d82('0x5')]=function(_0x5c43d7,_0x2bad40){return _0x5c43d7[_0x1d82('0x6')]('Template',attributes,{'tableName':_0x1d82('0x7'),'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 1a1cd40..3d6d242 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 _0xa57f=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','Template','options','raw','where','attributes','limit','include','map','model','then','GetTemplate','util'];(function(_0x2e8170,_0x131c79){var _0x3e6e13=function(_0x3b1ac7){while(--_0x3b1ac7){_0x2e8170['push'](_0x2e8170['shift']());}};_0x3e6e13(++_0x131c79);}(_0xa57f,0x77));var _0xfa57=function(_0x53271f,_0x230491){_0x53271f=_0x53271f-0x0;var _0x58343b=_0xa57f[_0x53271f];return _0x58343b;};'use strict';var _=require('lodash');var util=require(_0xfa57('0x0'));var moment=require(_0xfa57('0x1'));var BPromise=require(_0xfa57('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfa57('0x3'))['db'];var utils=require(_0xfa57('0x4'));var logger=require(_0xfa57('0x5'))(_0xfa57('0x6'));var config=require('../../config/environment');var jayson=require(_0xfa57('0x7'));var client=jayson['client'][_0xfa57('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e10f3,_0x221b60,_0x47ced0){return new BPromise(function(_0x8ad0f2,_0x1b839b){return client['request'](_0x3e10f3,_0x47ced0)['then'](function(_0x5eaa56){logger[_0xfa57('0x9')](_0xfa57('0xa'),_0x221b60,_0xfa57('0xb'));logger[_0xfa57('0xc')](_0xfa57('0xd'),_0x221b60,'request\x20sent',JSON[_0xfa57('0xe')](_0x5eaa56));if(_0x5eaa56['error']){if(_0x5eaa56['error'][_0xfa57('0xf')]===0x1f4){logger[_0xfa57('0x10')]('Template,\x20%s,\x20%s',_0x221b60,_0x5eaa56['error'][_0xfa57('0x11')]);return _0x1b839b(_0x5eaa56['error'][_0xfa57('0x11')]);}logger[_0xfa57('0x10')](_0xfa57('0xa'),_0x221b60,_0x5eaa56['error']['message']);return _0x8ad0f2(_0x5eaa56[_0xfa57('0x10')][_0xfa57('0x11')]);}else{logger[_0xfa57('0x9')]('Template,\x20%s,\x20%s',_0x221b60,_0xfa57('0xb'));_0x8ad0f2(_0x5eaa56['result'][_0xfa57('0x11')]);}})[_0xfa57('0x12')](function(_0x55d19f){logger['error'](_0xfa57('0xa'),_0x221b60,_0x55d19f);_0x1b839b(_0x55d19f);});});}exports['GetTemplate']=function(_0x45054b){var _0xfadf2a=this;return new Promise(function(_0x1dc29e,_0x26ba3d){return db[_0xfa57('0x13')]['findAll']({'raw':_0x45054b[_0xfa57('0x14')]?_0x45054b[_0xfa57('0x14')][_0xfa57('0x15')]===undefined?!![]:![]:!![],'where':_0x45054b[_0xfa57('0x14')]?_0x45054b['options'][_0xfa57('0x16')]||null:null,'attributes':_0x45054b[_0xfa57('0x14')]?_0x45054b[_0xfa57('0x14')][_0xfa57('0x17')]||null:null,'limit':_0x45054b[_0xfa57('0x14')]?_0x45054b['options'][_0xfa57('0x18')]||null:null,'include':_0x45054b[_0xfa57('0x14')]?_0x45054b[_0xfa57('0x14')][_0xfa57('0x19')]?_[_0xfa57('0x1a')](_0x45054b[_0xfa57('0x14')]['include'],function(_0x434cdf){return{'model':db[_0x434cdf[_0xfa57('0x1b')]],'as':_0x434cdf['as'],'attributes':_0x434cdf[_0xfa57('0x17')],'include':_0x434cdf[_0xfa57('0x19')]?_[_0xfa57('0x1a')](_0x434cdf[_0xfa57('0x19')],function(_0x184b70){return{'model':db[_0x184b70[_0xfa57('0x1b')]],'as':_0x184b70['as'],'attributes':_0x184b70['attributes'],'include':_0x184b70['include']?_[_0xfa57('0x1a')](_0x184b70['include'],function(_0x10132e){return{'model':db[_0x10132e[_0xfa57('0x1b')]],'as':_0x10132e['as'],'attributes':_0x10132e[_0xfa57('0x17')]};}):[]};}):[]};}):[]:[]})[_0xfa57('0x1c')](function(_0x3c1c65){logger[_0xfa57('0x9')](_0xfa57('0x1d'),_0x45054b);logger[_0xfa57('0xc')](_0xfa57('0x1d'),_0x45054b,JSON[_0xfa57('0xe')](_0x3c1c65));_0x1dc29e(_0x3c1c65);})[_0xfa57('0x12')](function(_0x27abd5){logger[_0xfa57('0x10')](_0xfa57('0x1d'),_0x27abd5[_0xfa57('0x11')],_0x45054b);_0x26ba3d(_0xfadf2a[_0xfa57('0x10')](0x1f4,_0x27abd5[_0xfa57('0x11')]));});});}; \ No newline at end of file +var _0x4c6b=['stringify','error','code','Template,\x20%s,\x20%s','message','info','result','catch','GetTemplate','Template','options','raw','where','attributes','include','model','map','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s'];(function(_0x131fea,_0x45cf53){var _0x4583b4=function(_0x132aec){while(--_0x132aec){_0x131fea['push'](_0x131fea['shift']());}};_0x4583b4(++_0x45cf53);}(_0x4c6b,0x111));var _0xb4c6=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x4c6b[_0x3511d3];return _0x5d6321;};'use strict';var _=require('lodash');var util=require(_0xb4c6('0x0'));var moment=require(_0xb4c6('0x1'));var BPromise=require(_0xb4c6('0x2'));var rs=require(_0xb4c6('0x3'));var fs=require('fs');var Redis=require(_0xb4c6('0x4'));var db=require(_0xb4c6('0x5'))['db'];var utils=require(_0xb4c6('0x6'));var logger=require(_0xb4c6('0x7'))(_0xb4c6('0x8'));var config=require(_0xb4c6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb4c6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x348e72,_0x5e883b,_0x45dfaf){return new BPromise(function(_0x5e58cc,_0x2ef6e2){return client['request'](_0x348e72,_0x45dfaf)[_0xb4c6('0xb')](function(_0x34f668){logger['info']('Template,\x20%s,\x20%s',_0x5e883b,_0xb4c6('0xc'));logger[_0xb4c6('0xd')](_0xb4c6('0xe'),_0x5e883b,_0xb4c6('0xc'),JSON[_0xb4c6('0xf')](_0x34f668));if(_0x34f668[_0xb4c6('0x10')]){if(_0x34f668[_0xb4c6('0x10')][_0xb4c6('0x11')]===0x1f4){logger[_0xb4c6('0x10')](_0xb4c6('0x12'),_0x5e883b,_0x34f668[_0xb4c6('0x10')][_0xb4c6('0x13')]);return _0x2ef6e2(_0x34f668[_0xb4c6('0x10')][_0xb4c6('0x13')]);}logger['error'](_0xb4c6('0x12'),_0x5e883b,_0x34f668[_0xb4c6('0x10')][_0xb4c6('0x13')]);return _0x5e58cc(_0x34f668['error']['message']);}else{logger[_0xb4c6('0x14')]('Template,\x20%s,\x20%s',_0x5e883b,'request\x20sent');_0x5e58cc(_0x34f668[_0xb4c6('0x15')]['message']);}})[_0xb4c6('0x16')](function(_0x44f684){logger['error']('Template,\x20%s,\x20%s',_0x5e883b,_0x44f684);_0x2ef6e2(_0x44f684);});});}exports[_0xb4c6('0x17')]=function(_0x14f7a9){var _0x395fa3=this;return new Promise(function(_0x40d4d0,_0x391b2e){return db[_0xb4c6('0x18')]['findAll']({'raw':_0x14f7a9[_0xb4c6('0x19')]?_0x14f7a9[_0xb4c6('0x19')][_0xb4c6('0x1a')]===undefined?!![]:![]:!![],'where':_0x14f7a9[_0xb4c6('0x19')]?_0x14f7a9['options'][_0xb4c6('0x1b')]||null:null,'attributes':_0x14f7a9[_0xb4c6('0x19')]?_0x14f7a9[_0xb4c6('0x19')][_0xb4c6('0x1c')]||null:null,'limit':_0x14f7a9['options']?_0x14f7a9[_0xb4c6('0x19')]['limit']||null:null,'include':_0x14f7a9[_0xb4c6('0x19')]?_0x14f7a9[_0xb4c6('0x19')][_0xb4c6('0x1d')]?_['map'](_0x14f7a9[_0xb4c6('0x19')][_0xb4c6('0x1d')],function(_0x255337){return{'model':db[_0x255337[_0xb4c6('0x1e')]],'as':_0x255337['as'],'attributes':_0x255337['attributes'],'include':_0x255337['include']?_[_0xb4c6('0x1f')](_0x255337[_0xb4c6('0x1d')],function(_0x394dd7){return{'model':db[_0x394dd7['model']],'as':_0x394dd7['as'],'attributes':_0x394dd7['attributes'],'include':_0x394dd7[_0xb4c6('0x1d')]?_[_0xb4c6('0x1f')](_0x394dd7[_0xb4c6('0x1d')],function(_0x551721){return{'model':db[_0x551721[_0xb4c6('0x1e')]],'as':_0x551721['as'],'attributes':_0x551721[_0xb4c6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb4c6('0xb')](function(_0x86d51f){logger[_0xb4c6('0x14')]('GetTemplate',_0x14f7a9);logger[_0xb4c6('0xd')](_0xb4c6('0x17'),_0x14f7a9,JSON[_0xb4c6('0xf')](_0x86d51f));_0x40d4d0(_0x86d51f);})[_0xb4c6('0x16')](function(_0x16fa2a){logger[_0xb4c6('0x10')](_0xb4c6('0x17'),_0x16fa2a[_0xb4c6('0x13')],_0x14f7a9);_0x391b2e(_0x395fa3[_0xb4c6('0x10')](0x1f4,_0x16fa2a[_0xb4c6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 8ecca91..19549a9 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 _0x6123=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','/:id/all_conditions','put','/:id','update','destroy','util'];(function(_0x50697c,_0x5e69d3){var _0x39c851=function(_0x37e2d4){while(--_0x37e2d4){_0x50697c['push'](_0x50697c['shift']());}};_0x39c851(++_0x5e69d3);}(_0x6123,0x1e2));var _0x3612=function(_0x5efed8,_0x139363){_0x5efed8=_0x5efed8-0x0;var _0x2da65b=_0x6123[_0x5efed8];return _0x2da65b;};'use strict';var multer=require('multer');var util=require(_0x3612('0x0'));var path=require(_0x3612('0x1'));var timeout=require('connect-timeout');var express=require(_0x3612('0x2'));var router=express[_0x3612('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3612('0x4'));var interaction=require(_0x3612('0x5'));var config=require(_0x3612('0x6'));var controller=require(_0x3612('0x7'));router[_0x3612('0x8')]('/',auth[_0x3612('0x9')](),controller['index']);router[_0x3612('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3612('0xa')]);router[_0x3612('0x8')]('/:id/all_conditions',auth[_0x3612('0x9')](),controller[_0x3612('0xb')]);router[_0x3612('0x8')](_0x3612('0xc'),auth[_0x3612('0x9')](),controller[_0x3612('0xd')]);router['get'](_0x3612('0xe'),auth['isAuthenticated'](),controller[_0x3612('0xf')]);router[_0x3612('0x10')]('/',auth[_0x3612('0x9')](),controller[_0x3612('0x11')]);router[_0x3612('0x10')](_0x3612('0x12'),auth[_0x3612('0x9')](),controller['addAllCondition']);router['post'](_0x3612('0xc'),auth[_0x3612('0x9')](),controller['addAnyCondition']);router['post'](_0x3612('0xe'),auth[_0x3612('0x9')](),controller['addAction']);router[_0x3612('0x13')](_0x3612('0x14'),auth[_0x3612('0x9')](),controller[_0x3612('0x15')]);router['delete'](_0x3612('0x14'),auth['isAuthenticated'](),controller[_0x3612('0x16')]);module['exports']=router; \ No newline at end of file +var _0x4892=['/:id/actions','create','/:id/all_conditions','addAllCondition','post','addAnyCondition','addAction','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/any_conditions'];(function(_0xe729e6,_0x5a1666){var _0x2cf56a=function(_0x2de98c){while(--_0x2de98c){_0xe729e6['push'](_0xe729e6['shift']());}};_0x2cf56a(++_0x5a1666);}(_0x4892,0x1cd));var _0x2489=function(_0x2c2630,_0x10de54){_0x2c2630=_0x2c2630-0x0;var _0xbe89cf=_0x4892[_0x2c2630];return _0xbe89cf;};'use strict';var multer=require(_0x2489('0x0'));var util=require(_0x2489('0x1'));var path=require('path');var timeout=require(_0x2489('0x2'));var express=require(_0x2489('0x3'));var router=express[_0x2489('0x4')]();var fs_extra=require(_0x2489('0x5'));var auth=require(_0x2489('0x6'));var interaction=require(_0x2489('0x7'));var config=require(_0x2489('0x8'));var controller=require('./trigger.controller');router[_0x2489('0x9')]('/',auth[_0x2489('0xa')](),controller['index']);router[_0x2489('0x9')](_0x2489('0xb'),auth[_0x2489('0xa')](),controller[_0x2489('0xc')]);router[_0x2489('0x9')]('/:id/all_conditions',auth[_0x2489('0xa')](),controller['getAllConditions']);router['get'](_0x2489('0xd'),auth[_0x2489('0xa')](),controller['getAnyConditions']);router[_0x2489('0x9')](_0x2489('0xe'),auth[_0x2489('0xa')](),controller['getActions']);router['post']('/',auth[_0x2489('0xa')](),controller[_0x2489('0xf')]);router['post'](_0x2489('0x10'),auth['isAuthenticated'](),controller[_0x2489('0x11')]);router[_0x2489('0x12')](_0x2489('0xd'),auth['isAuthenticated'](),controller[_0x2489('0x13')]);router[_0x2489('0x12')]('/:id/actions',auth[_0x2489('0xa')](),controller[_0x2489('0x14')]);router[_0x2489('0x15')]('/:id',auth[_0x2489('0xa')](),controller[_0x2489('0x16')]);router[_0x2489('0x17')](_0x2489('0xb'),auth[_0x2489('0xa')](),controller['destroy']);module[_0x2489('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 8828203..a73087b 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 _0x1e09=['BOOLEAN','STRING'];(function(_0x20578f,_0x121a29){var _0x33cc93=function(_0xd5ccab){while(--_0xd5ccab){_0x20578f['push'](_0x20578f['shift']());}};_0x33cc93(++_0x121a29);}(_0x1e09,0x89));var _0x91e0=function(_0x8d5f04,_0xf59de9){_0x8d5f04=_0x8d5f04-0x0;var _0x1caeaa=_0x1e09[_0x8d5f04];return _0x1caeaa;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x91e0('0x0')]},'description':{'type':Sequelize[_0x91e0('0x0')]},'status':{'type':Sequelize[_0x91e0('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x8193=['sequelize','exports','STRING'];(function(_0x1e50ce,_0x330023){var _0x5af6a2=function(_0x113c4a){while(--_0x113c4a){_0x1e50ce['push'](_0x1e50ce['shift']());}};_0x5af6a2(++_0x330023);}(_0x8193,0x135));var _0x3819=function(_0x51d7b7,_0x3132fe){_0x51d7b7=_0x51d7b7-0x0;var _0x3dcd18=_0x8193[_0x51d7b7];return _0x3dcd18;};'use strict';var Sequelize=require(_0x3819('0x0'));module[_0x3819('0x1')]={'name':{'type':Sequelize[_0x3819('0x2')]},'channel':{'type':Sequelize[_0x3819('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 516720e..36d01ec 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 _0x5e39=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','end','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','user','role','Triggers','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','addAnyCondition','getAllConditions','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs'];(function(_0x5d007c,_0x18b9c3){var _0x6d6961=function(_0x520ee7){while(--_0x520ee7){_0x5d007c['push'](_0x5d007c['shift']());}};_0x6d6961(++_0x18b9c3);}(_0x5e39,0x105));var _0x95e3=function(_0x1ca7a4,_0x3b2e29){_0x1ca7a4=_0x1ca7a4-0x0;var _0x3fce06=_0x5e39[_0x1ca7a4];return _0x3fce06;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95e3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x95e3('0x1'));var rp=require('request-promise');var moment=require(_0x95e3('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x95e3('0x3'));var util=require(_0x95e3('0x4'));var path=require('path');var sox=require(_0x95e3('0x5'));var csv=require(_0x95e3('0x6'));var ejs=require(_0x95e3('0x7'));var fs=require('fs');var fs_extra=require(_0x95e3('0x8'));var _=require(_0x95e3('0x9'));var squel=require('squel');var crypto=require(_0x95e3('0xa'));var jsforce=require(_0x95e3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x95e3('0x6'));var querystring=require(_0x95e3('0xc'));var Papa=require('papaparse');var Redis=require(_0x95e3('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x95e3('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x95e3('0xf'));var logger=require(_0x95e3('0x10'))(_0x95e3('0x11'));var utils=require(_0x95e3('0x12'));var config=require(_0x95e3('0x13'));var licenseUtil=require(_0x95e3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ad15b,_0x52c2fc){_0x52c2fc=_0x52c2fc||0xcc;return function(_0x3f36d7){if(_0x3f36d7){return _0x5ad15b[_0x95e3('0x15')](_0x52c2fc);}return _0x5ad15b[_0x95e3('0x16')](_0x52c2fc)['end']();};}function respondWithResult(_0x11d59c,_0x3501a3){_0x3501a3=_0x3501a3||0xc8;return function(_0x3483f6){if(_0x3483f6){return _0x11d59c['status'](_0x3501a3)[_0x95e3('0x17')](_0x3483f6);}};}function respondWithFilteredResult(_0x31b0f3,_0x4ba7d2){return function(_0x1766ff){if(_0x1766ff){var _0xe3146=typeof _0x4ba7d2[_0x95e3('0x18')]===_0x95e3('0x19')&&typeof _0x4ba7d2[_0x95e3('0x1a')]===_0x95e3('0x19');var _0x47efef=_0x1766ff[_0x95e3('0x1b')];var _0x241362=_0xe3146?0x0:_0x4ba7d2[_0x95e3('0x18')];var _0x1c6e13=_0xe3146?_0x1766ff[_0x95e3('0x1b')]:_0x4ba7d2[_0x95e3('0x18')]+_0x4ba7d2[_0x95e3('0x1a')];var _0x57f588;if(_0x1c6e13>=_0x47efef){_0x1c6e13=_0x47efef;_0x57f588=0xc8;}else{_0x57f588=0xce;}_0x31b0f3[_0x95e3('0x16')](_0x57f588);return _0x31b0f3[_0x95e3('0x1c')](_0x95e3('0x1d'),_0x241362+'-'+_0x1c6e13+'/'+_0x47efef)['json'](_0x1766ff);}return null;};}function patchUpdates(_0x450898){return function(_0x3611d9){try{jsonpatch['apply'](_0x3611d9,_0x450898,!![]);}catch(_0x2e3a5c){return BPromise[_0x95e3('0x1e')](_0x2e3a5c);}return _0x3611d9[_0x95e3('0x1f')]();};}function saveUpdates(_0x586099,_0x306dd5){return function(_0x3cf5d0){if(_0x3cf5d0){return _0x3cf5d0[_0x95e3('0x20')](_0x586099)[_0x95e3('0x21')](function(_0x126daa){return _0x126daa;});}return null;};}function removeEntity(_0x596aa9,_0x3dd225){return function(_0x2ef840){if(_0x2ef840){return _0x2ef840[_0x95e3('0x22')]()[_0x95e3('0x21')](function(){var _0x1815d5=_0x2ef840[_0x95e3('0x23')]({'plain':!![]});var _0x1fcdfa='Triggers';return db[_0x95e3('0x24')]['destroy']({'where':{'type':_0x1fcdfa,'resourceId':_0x1815d5['id']}})[_0x95e3('0x21')](function(){return _0x2ef840;});})[_0x95e3('0x21')](function(){_0x596aa9[_0x95e3('0x16')](0xcc)[_0x95e3('0x25')]();});}};}function handleEntityNotFound(_0x724c9e,_0x529e2f){return function(_0x334487){if(!_0x334487){_0x724c9e[_0x95e3('0x15')](0x194);}return _0x334487;};}function handleError(_0x4cb03b,_0x4b8a47){_0x4b8a47=_0x4b8a47||0x1f4;return function(_0x5293cc){logger['error'](_0x5293cc['stack']);if(_0x5293cc[_0x95e3('0x26')]){delete _0x5293cc[_0x95e3('0x26')];}_0x4cb03b[_0x95e3('0x16')](_0x4b8a47)[_0x95e3('0x27')](_0x5293cc);};}exports[_0x95e3('0x28')]=function(_0x13fae0,_0x92966a){var _0x8ef3a8={},_0xd45623={},_0x26d985={'count':0x0,'rows':[]};var _0x18972d=_[_0x95e3('0x29')](db[_0x95e3('0x2a')][_0x95e3('0x2b')],function(_0x31bfb8){return{'name':_0x31bfb8[_0x95e3('0x2c')],'type':_0x31bfb8[_0x95e3('0x2d')][_0x95e3('0x2e')]};});_0xd45623['model']=_[_0x95e3('0x29')](_0x18972d,'name');_0xd45623[_0x95e3('0x2f')]=_['keys'](_0x13fae0[_0x95e3('0x2f')]);_0xd45623[_0x95e3('0x30')]=_[_0x95e3('0x31')](_0xd45623[_0x95e3('0x32')],_0xd45623[_0x95e3('0x2f')]);_0x8ef3a8[_0x95e3('0x33')]=_[_0x95e3('0x31')](_0xd45623[_0x95e3('0x32')],qs['fields'](_0x13fae0[_0x95e3('0x2f')][_0x95e3('0x34')]));_0x8ef3a8[_0x95e3('0x33')]=_0x8ef3a8[_0x95e3('0x33')][_0x95e3('0x35')]?_0x8ef3a8[_0x95e3('0x33')]:_0xd45623['model'];if(!_0x13fae0[_0x95e3('0x2f')][_0x95e3('0x36')](_0x95e3('0x37'))){_0x8ef3a8[_0x95e3('0x1a')]=qs[_0x95e3('0x1a')](_0x13fae0['query'][_0x95e3('0x1a')]);_0x8ef3a8[_0x95e3('0x18')]=qs[_0x95e3('0x18')](_0x13fae0[_0x95e3('0x2f')][_0x95e3('0x18')]);}_0x8ef3a8[_0x95e3('0x38')]=qs[_0x95e3('0x39')](_0x13fae0[_0x95e3('0x2f')][_0x95e3('0x39')]);_0x8ef3a8[_0x95e3('0x3a')]=qs[_0x95e3('0x30')](_[_0x95e3('0x3b')](_0x13fae0['query'],_0xd45623[_0x95e3('0x30')]),_0x18972d);if(_0x13fae0[_0x95e3('0x2f')][_0x95e3('0x3c')]){_0x8ef3a8[_0x95e3('0x3a')]=_[_0x95e3('0x3d')](_0x8ef3a8[_0x95e3('0x3a')],{'$or':_[_0x95e3('0x29')](_0x18972d,function(_0x53cdc2){if(_0x53cdc2[_0x95e3('0x2d')]!==_0x95e3('0x3e')){var _0x12c5f9={};_0x12c5f9[_0x53cdc2[_0x95e3('0x26')]]={'$like':'%'+_0x13fae0[_0x95e3('0x2f')][_0x95e3('0x3c')]+'%'};return _0x12c5f9;}})});}_0x8ef3a8=_[_0x95e3('0x3d')]({},_0x8ef3a8,_0x13fae0['options']);var _0x58d942={'where':_0x8ef3a8[_0x95e3('0x3a')]};return db[_0x95e3('0x2a')][_0x95e3('0x1b')](_0x58d942)[_0x95e3('0x21')](function(_0x457f84){_0x26d985['count']=_0x457f84;if(_0x13fae0['query'][_0x95e3('0x3f')]){_0x8ef3a8[_0x95e3('0x40')]=[{'all':!![]}];}return db[_0x95e3('0x2a')][_0x95e3('0x41')](_0x8ef3a8);})[_0x95e3('0x21')](function(_0x415565){_0x26d985[_0x95e3('0x42')]=_0x415565;return _0x26d985;})[_0x95e3('0x21')](respondWithFilteredResult(_0x92966a,_0x8ef3a8))[_0x95e3('0x43')](handleError(_0x92966a,null));};exports['show']=function(_0x3dcb7a,_0x3d89dd){var _0x36c8ca={'raw':![],'where':{'id':_0x3dcb7a[_0x95e3('0x44')]['id']}},_0x17a35e={};_0x17a35e['model']=_[_0x95e3('0x45')](db[_0x95e3('0x2a')][_0x95e3('0x2b')]);_0x17a35e['query']=_[_0x95e3('0x45')](_0x3dcb7a[_0x95e3('0x2f')]);_0x17a35e[_0x95e3('0x30')]=_[_0x95e3('0x31')](_0x17a35e[_0x95e3('0x32')],_0x17a35e[_0x95e3('0x2f')]);_0x36c8ca['attributes']=_[_0x95e3('0x31')](_0x17a35e['model'],qs[_0x95e3('0x34')](_0x3dcb7a[_0x95e3('0x2f')]['fields']));_0x36c8ca[_0x95e3('0x33')]=_0x36c8ca[_0x95e3('0x33')][_0x95e3('0x35')]?_0x36c8ca[_0x95e3('0x33')]:_0x17a35e[_0x95e3('0x32')];if(_0x3dcb7a[_0x95e3('0x2f')]['includeAll']){_0x36c8ca['include']=[{'all':!![]}];}_0x36c8ca=_[_0x95e3('0x3d')]({},_0x36c8ca,_0x3dcb7a[_0x95e3('0x46')]);return db['Trigger'][_0x95e3('0x47')](_0x36c8ca)[_0x95e3('0x21')](handleEntityNotFound(_0x3d89dd,null))[_0x95e3('0x21')](respondWithResult(_0x3d89dd,null))[_0x95e3('0x43')](handleError(_0x3d89dd,null));};exports[_0x95e3('0x48')]=function(_0x297963,_0x5241f1){return db[_0x95e3('0x2a')][_0x95e3('0x48')](_0x297963[_0x95e3('0x49')],{})[_0x95e3('0x21')](function(_0x58ffc2){var _0x2a5fc2=_0x297963[_0x95e3('0x4a')]['get']({'plain':!![]});if(!_0x2a5fc2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a5fc2[_0x95e3('0x4b')]===_0x95e3('0x4a')){var _0x1937bb=_0x58ffc2[_0x95e3('0x23')]({'plain':!![]});var _0x2a4f99=_0x95e3('0x4c');return db[_0x95e3('0x4d')]['find']({'where':{'name':_0x2a4f99,'userProfileId':_0x2a5fc2[_0x95e3('0x4e')]},'raw':!![]})[_0x95e3('0x21')](function(_0x5e62df){if(_0x5e62df&&_0x5e62df[_0x95e3('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x1937bb[_0x95e3('0x26')],'resourceId':_0x1937bb['id'],'type':_0x5e62df[_0x95e3('0x26')],'sectionId':_0x5e62df['id']},{})[_0x95e3('0x21')](function(){return _0x58ffc2;});}else{return _0x58ffc2;}})[_0x95e3('0x43')](function(_0x2598be){logger[_0x95e3('0x50')](_0x95e3('0x51'),_0x2598be);throw _0x2598be;});}return _0x58ffc2;})[_0x95e3('0x21')](respondWithResult(_0x5241f1,0xc9))['catch'](handleError(_0x5241f1,null));};exports['update']=function(_0x3a7fa1,_0x5b2176){if(_0x3a7fa1[_0x95e3('0x49')]['id']){delete _0x3a7fa1[_0x95e3('0x49')]['id'];}return db['Trigger'][_0x95e3('0x47')]({'where':{'id':_0x3a7fa1[_0x95e3('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b2176,null))['then'](saveUpdates(_0x3a7fa1[_0x95e3('0x49')],null))[_0x95e3('0x21')](respondWithResult(_0x5b2176,null))['catch'](handleError(_0x5b2176,null));};exports[_0x95e3('0x22')]=function(_0x3d3d5c,_0x5d9fcf){return db[_0x95e3('0x2a')][_0x95e3('0x47')]({'where':{'id':_0x3d3d5c[_0x95e3('0x44')]['id']}})[_0x95e3('0x21')](handleEntityNotFound(_0x5d9fcf,null))[_0x95e3('0x21')](removeEntity(_0x5d9fcf,null))['catch'](handleError(_0x5d9fcf,null));};exports[_0x95e3('0x52')]=function(_0x50fa50,_0x370fc4,_0xe307e5){if(_0x50fa50[_0x95e3('0x49')]['id']){delete _0x50fa50[_0x95e3('0x49')]['id'];}return db[_0x95e3('0x2a')][_0x95e3('0x47')]({'where':{'id':_0x50fa50[_0x95e3('0x44')]['id']}})['then'](handleEntityNotFound(_0x370fc4,null))[_0x95e3('0x21')](function(_0x12752c){if(_0x12752c){_0x50fa50[_0x95e3('0x49')]['TriggerAllId']=_0x12752c['id'];return db[_0x95e3('0x53')][_0x95e3('0x48')](_0x50fa50[_0x95e3('0x49')]);}})['then'](respondWithResult(_0x370fc4,null))[_0x95e3('0x43')](handleError(_0x370fc4,null));};exports[_0x95e3('0x54')]=function(_0x33199c,_0x2f83c9,_0x23b36f){if(_0x33199c[_0x95e3('0x49')]['id']){delete _0x33199c[_0x95e3('0x49')]['id'];}return db[_0x95e3('0x2a')]['find']({'where':{'id':_0x33199c[_0x95e3('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f83c9,null))[_0x95e3('0x21')](function(_0x3956d4){if(_0x3956d4){_0x33199c[_0x95e3('0x49')]['TriggerAnyId']=_0x3956d4['id'];return db['Condition']['create'](_0x33199c[_0x95e3('0x49')]);}})[_0x95e3('0x21')](respondWithResult(_0x2f83c9,null))['catch'](handleError(_0x2f83c9,null));};exports[_0x95e3('0x55')]=function(_0x453253,_0x5f1ecf,_0x21f16a){var _0x5814a6={};var _0x2a7956={};var _0x258726;var _0x4c4e64;return db['Trigger']['findOne']({'where':{'id':_0x453253['params']['id']}})['then'](handleEntityNotFound(_0x5f1ecf,null))[_0x95e3('0x21')](function(_0x404503){if(_0x404503){_0x258726=_0x404503;_0x2a7956[_0x95e3('0x32')]=_[_0x95e3('0x45')](db[_0x95e3('0x53')][_0x95e3('0x2b')]);_0x2a7956[_0x95e3('0x2f')]=_[_0x95e3('0x45')](_0x453253[_0x95e3('0x2f')]);_0x2a7956[_0x95e3('0x30')]=_['intersection'](_0x2a7956[_0x95e3('0x32')],_0x2a7956[_0x95e3('0x2f')]);_0x5814a6['attributes']=_[_0x95e3('0x31')](_0x2a7956[_0x95e3('0x32')],qs[_0x95e3('0x34')](_0x453253[_0x95e3('0x2f')][_0x95e3('0x34')]));_0x5814a6[_0x95e3('0x33')]=_0x5814a6[_0x95e3('0x33')]['length']?_0x5814a6['attributes']:_0x2a7956[_0x95e3('0x32')];_0x5814a6['order']=qs['sort'](_0x453253['query'][_0x95e3('0x39')]);_0x5814a6[_0x95e3('0x3a')]=qs['filters'](_[_0x95e3('0x3b')](_0x453253[_0x95e3('0x2f')],_0x2a7956[_0x95e3('0x30')]));if(_0x453253[_0x95e3('0x2f')][_0x95e3('0x3c')]){_0x5814a6['where']=_[_0x95e3('0x3d')](_0x5814a6[_0x95e3('0x3a')],{'$or':_[_0x95e3('0x29')](_0x5814a6[_0x95e3('0x33')],function(_0xafd3a3){var _0x1e1410={};_0x1e1410[_0xafd3a3]={'$like':'%'+_0x453253[_0x95e3('0x2f')][_0x95e3('0x3c')]+'%'};return _0x1e1410;})});}_0x5814a6=_[_0x95e3('0x3d')]({},_0x5814a6,_0x453253[_0x95e3('0x46')]);return _0x258726[_0x95e3('0x55')](_0x5814a6);}})[_0x95e3('0x21')](function(_0x5215d7){if(_0x5215d7){_0x4c4e64=_0x5215d7[_0x95e3('0x35')];if(!_0x453253[_0x95e3('0x2f')][_0x95e3('0x36')]('nolimit')){_0x5814a6[_0x95e3('0x1a')]=qs[_0x95e3('0x1a')](_0x453253['query'][_0x95e3('0x1a')]);_0x5814a6[_0x95e3('0x18')]=qs[_0x95e3('0x18')](_0x453253['query']['offset']);}return _0x258726[_0x95e3('0x55')](_0x5814a6);}})[_0x95e3('0x21')](function(_0x56f203){if(_0x56f203){return _0x56f203?{'count':_0x4c4e64,'rows':_0x56f203}:null;}})[_0x95e3('0x21')](respondWithResult(_0x5f1ecf,null))[_0x95e3('0x43')](handleError(_0x5f1ecf,null));};exports[_0x95e3('0x56')]=function(_0x57ee7c,_0x3d8c79,_0xb8a4d6){var _0x492074={};var _0x8d3ead={};var _0x2024ab;var _0x47d25e;return db[_0x95e3('0x2a')][_0x95e3('0x57')]({'where':{'id':_0x57ee7c[_0x95e3('0x44')]['id']}})[_0x95e3('0x21')](handleEntityNotFound(_0x3d8c79,null))[_0x95e3('0x21')](function(_0x313208){if(_0x313208){_0x2024ab=_0x313208;_0x8d3ead['model']=_[_0x95e3('0x45')](db[_0x95e3('0x53')][_0x95e3('0x2b')]);_0x8d3ead['query']=_[_0x95e3('0x45')](_0x57ee7c['query']);_0x8d3ead[_0x95e3('0x30')]=_['intersection'](_0x8d3ead[_0x95e3('0x32')],_0x8d3ead[_0x95e3('0x2f')]);_0x492074[_0x95e3('0x33')]=_[_0x95e3('0x31')](_0x8d3ead['model'],qs['fields'](_0x57ee7c[_0x95e3('0x2f')][_0x95e3('0x34')]));_0x492074[_0x95e3('0x33')]=_0x492074[_0x95e3('0x33')][_0x95e3('0x35')]?_0x492074[_0x95e3('0x33')]:_0x8d3ead[_0x95e3('0x32')];_0x492074['order']=qs[_0x95e3('0x39')](_0x57ee7c[_0x95e3('0x2f')][_0x95e3('0x39')]);_0x492074[_0x95e3('0x3a')]=qs[_0x95e3('0x30')](_[_0x95e3('0x3b')](_0x57ee7c[_0x95e3('0x2f')],_0x8d3ead[_0x95e3('0x30')]));if(_0x57ee7c['query'][_0x95e3('0x3c')]){_0x492074[_0x95e3('0x3a')]=_[_0x95e3('0x3d')](_0x492074[_0x95e3('0x3a')],{'$or':_['map'](_0x492074['attributes'],function(_0xcac489){var _0x415974={};_0x415974[_0xcac489]={'$like':'%'+_0x57ee7c[_0x95e3('0x2f')][_0x95e3('0x3c')]+'%'};return _0x415974;})});}_0x492074=_[_0x95e3('0x3d')]({},_0x492074,_0x57ee7c[_0x95e3('0x46')]);return _0x2024ab['getAnyConditions'](_0x492074);}})[_0x95e3('0x21')](function(_0x1d88e3){if(_0x1d88e3){_0x47d25e=_0x1d88e3['length'];if(!_0x57ee7c[_0x95e3('0x2f')][_0x95e3('0x36')](_0x95e3('0x37'))){_0x492074[_0x95e3('0x1a')]=qs[_0x95e3('0x1a')](_0x57ee7c['query'][_0x95e3('0x1a')]);_0x492074[_0x95e3('0x18')]=qs[_0x95e3('0x18')](_0x57ee7c[_0x95e3('0x2f')]['offset']);}return _0x2024ab[_0x95e3('0x56')](_0x492074);}})[_0x95e3('0x21')](function(_0x11d244){if(_0x11d244){return _0x11d244?{'count':_0x47d25e,'rows':_0x11d244}:null;}})['then'](respondWithResult(_0x3d8c79,null))[_0x95e3('0x43')](handleError(_0x3d8c79,null));};exports[_0x95e3('0x58')]=function(_0x321539,_0x542626,_0x5aed99){if(_0x321539[_0x95e3('0x49')]['id']){delete _0x321539[_0x95e3('0x49')]['id'];}return db[_0x95e3('0x2a')][_0x95e3('0x47')]({'where':{'id':_0x321539[_0x95e3('0x44')]['id']}})['then'](handleEntityNotFound(_0x542626,null))[_0x95e3('0x21')](function(_0x30af66){if(_0x30af66){_0x321539[_0x95e3('0x49')][_0x95e3('0x59')]=_0x30af66['id'];return db[_0x95e3('0x5a')]['create'](_0x321539['body']);}})[_0x95e3('0x21')](respondWithResult(_0x542626,null))[_0x95e3('0x43')](handleError(_0x542626,null));};exports[_0x95e3('0x5b')]=function(_0x5bec1f,_0x18606d,_0x5ae1e4){var _0x1c1b2b={};var _0x29582d={};var _0xd3abf3;var _0x4b6e96;return db[_0x95e3('0x2a')][_0x95e3('0x57')]({'where':{'id':_0x5bec1f[_0x95e3('0x44')]['id']}})[_0x95e3('0x21')](handleEntityNotFound(_0x18606d,null))[_0x95e3('0x21')](function(_0x22620f){if(_0x22620f){_0xd3abf3=_0x22620f;_0x29582d[_0x95e3('0x32')]=_[_0x95e3('0x45')](db[_0x95e3('0x5a')][_0x95e3('0x2b')]);_0x29582d[_0x95e3('0x2f')]=_[_0x95e3('0x45')](_0x5bec1f[_0x95e3('0x2f')]);_0x29582d[_0x95e3('0x30')]=_[_0x95e3('0x31')](_0x29582d[_0x95e3('0x32')],_0x29582d['query']);_0x1c1b2b[_0x95e3('0x33')]=_[_0x95e3('0x31')](_0x29582d[_0x95e3('0x32')],qs['fields'](_0x5bec1f[_0x95e3('0x2f')]['fields']));_0x1c1b2b[_0x95e3('0x33')]=_0x1c1b2b[_0x95e3('0x33')][_0x95e3('0x35')]?_0x1c1b2b[_0x95e3('0x33')]:_0x29582d[_0x95e3('0x32')];_0x1c1b2b['order']=qs[_0x95e3('0x39')](_0x5bec1f[_0x95e3('0x2f')][_0x95e3('0x39')]);_0x1c1b2b[_0x95e3('0x3a')]=qs[_0x95e3('0x30')](_[_0x95e3('0x3b')](_0x5bec1f[_0x95e3('0x2f')],_0x29582d[_0x95e3('0x30')]));if(_0x5bec1f['query'][_0x95e3('0x3c')]){_0x1c1b2b['where']=_[_0x95e3('0x3d')](_0x1c1b2b['where'],{'$or':_['map'](_0x1c1b2b['attributes'],function(_0x35acdc){var _0x4eeac8={};_0x4eeac8[_0x35acdc]={'$like':'%'+_0x5bec1f[_0x95e3('0x2f')][_0x95e3('0x3c')]+'%'};return _0x4eeac8;})});}_0x1c1b2b=_[_0x95e3('0x3d')]({},_0x1c1b2b,_0x5bec1f[_0x95e3('0x46')]);return _0xd3abf3[_0x95e3('0x5b')](_0x1c1b2b);}})[_0x95e3('0x21')](function(_0x28ae11){if(_0x28ae11){_0x4b6e96=_0x28ae11[_0x95e3('0x35')];if(!_0x5bec1f[_0x95e3('0x2f')]['hasOwnProperty'](_0x95e3('0x37'))){_0x1c1b2b[_0x95e3('0x1a')]=qs[_0x95e3('0x1a')](_0x5bec1f[_0x95e3('0x2f')][_0x95e3('0x1a')]);_0x1c1b2b[_0x95e3('0x18')]=qs[_0x95e3('0x18')](_0x5bec1f[_0x95e3('0x2f')]['offset']);}return _0xd3abf3[_0x95e3('0x5b')](_0x1c1b2b);}})['then'](function(_0x1b6678){if(_0x1b6678){return _0x1b6678?{'count':_0x4b6e96,'rows':_0x1b6678}:null;}})[_0x95e3('0x21')](respondWithResult(_0x18606d,null))[_0x95e3('0x43')](handleError(_0x18606d,null));}; \ No newline at end of file +var _0x2517=['include','findAll','rows','catch','show','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addAllCondition','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','order','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','get','destroy','then','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','Trigger','count'];(function(_0x585972,_0x200c05){var _0x5ab684=function(_0x46578e){while(--_0x46578e){_0x585972['push'](_0x585972['shift']());}};_0x5ab684(++_0x200c05);}(_0x2517,0xdb));var _0x7251=function(_0xe17300,_0x229ac8){_0xe17300=_0xe17300-0x0;var _0x59c4be=_0x2517[_0xe17300];return _0x59c4be;};'use strict';var emlformat=require(_0x7251('0x0'));var rimraf=require(_0x7251('0x1'));var zipdir=require(_0x7251('0x2'));var jsonpatch=require(_0x7251('0x3'));var rp=require(_0x7251('0x4'));var moment=require(_0x7251('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7251('0x6'));var util=require(_0x7251('0x7'));var path=require('path');var sox=require(_0x7251('0x8'));var csv=require(_0x7251('0x9'));var ejs=require(_0x7251('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7251('0xb'));var squel=require('squel');var crypto=require(_0x7251('0xc'));var jsforce=require(_0x7251('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7251('0x9'));var querystring=require('querystring');var Papa=require(_0x7251('0xe'));var Redis=require(_0x7251('0xf'));var authService=require(_0x7251('0x10'));var qs=require(_0x7251('0x11'));var as=require(_0x7251('0x12'));var hardwareService=require(_0x7251('0x13'));var logger=require(_0x7251('0x14'))(_0x7251('0x15'));var utils=require('../../config/utils');var config=require(_0x7251('0x16'));var licenseUtil=require(_0x7251('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c5615,_0x215687){_0x215687=_0x215687||0xcc;return function(_0x4edd8c){if(_0x4edd8c){return _0x3c5615[_0x7251('0x18')](_0x215687);}return _0x3c5615[_0x7251('0x19')](_0x215687)[_0x7251('0x1a')]();};}function respondWithResult(_0x59d60d,_0x340596){_0x340596=_0x340596||0xc8;return function(_0x43cd9e){if(_0x43cd9e){return _0x59d60d[_0x7251('0x19')](_0x340596)['json'](_0x43cd9e);}};}function respondWithFilteredResult(_0x51dce7,_0x3bf348){return function(_0x2d3176){if(_0x2d3176){var _0x3626f9=typeof _0x3bf348[_0x7251('0x1b')]===_0x7251('0x1c')&&typeof _0x3bf348[_0x7251('0x1d')]===_0x7251('0x1c');var _0x4512ab=_0x2d3176['count'];var _0x5ee7e6=_0x3626f9?0x0:_0x3bf348[_0x7251('0x1b')];var _0x3d2f58=_0x3626f9?_0x2d3176['count']:_0x3bf348[_0x7251('0x1b')]+_0x3bf348[_0x7251('0x1d')];var _0x271495;if(_0x3d2f58>=_0x4512ab){_0x3d2f58=_0x4512ab;_0x271495=0xc8;}else{_0x271495=0xce;}_0x51dce7[_0x7251('0x19')](_0x271495);return _0x51dce7[_0x7251('0x1e')](_0x7251('0x1f'),_0x5ee7e6+'-'+_0x3d2f58+'/'+_0x4512ab)[_0x7251('0x20')](_0x2d3176);}return null;};}function patchUpdates(_0x1be5b0){return function(_0x229025){try{jsonpatch[_0x7251('0x21')](_0x229025,_0x1be5b0,!![]);}catch(_0xfbf92a){return BPromise[_0x7251('0x22')](_0xfbf92a);}return _0x229025[_0x7251('0x23')]();};}function saveUpdates(_0x5dcbdd,_0x68d1cd){return function(_0x38dc5c){if(_0x38dc5c){return _0x38dc5c[_0x7251('0x24')](_0x5dcbdd)['then'](function(_0x5166fb){return _0x5166fb;});}return null;};}function removeEntity(_0x3f0fa1,_0x2e9bc3){return function(_0x44b06d){if(_0x44b06d){return _0x44b06d['destroy']()['then'](function(){var _0x415f35=_0x44b06d[_0x7251('0x25')]({'plain':!![]});var _0x125ebe='Triggers';return db['UserProfileResource'][_0x7251('0x26')]({'where':{'type':_0x125ebe,'resourceId':_0x415f35['id']}})['then'](function(){return _0x44b06d;});})[_0x7251('0x27')](function(){_0x3f0fa1['status'](0xcc)[_0x7251('0x1a')]();});}};}function handleEntityNotFound(_0x16045c,_0x57048e){return function(_0x5aa2e9){if(!_0x5aa2e9){_0x16045c[_0x7251('0x18')](0x194);}return _0x5aa2e9;};}function handleError(_0x152833,_0x5de653){_0x5de653=_0x5de653||0x1f4;return function(_0x519d24){logger[_0x7251('0x28')](_0x519d24['stack']);if(_0x519d24['name']){delete _0x519d24[_0x7251('0x29')];}_0x152833[_0x7251('0x19')](_0x5de653)['send'](_0x519d24);};}exports[_0x7251('0x2a')]=function(_0xc40f64,_0x45c535){var _0x3971f1={},_0x8d186b={},_0x549553={'count':0x0,'rows':[]};var _0x2918fd=_[_0x7251('0x2b')](db['Trigger'][_0x7251('0x2c')],function(_0x2d02f7){return{'name':_0x2d02f7[_0x7251('0x2d')],'type':_0x2d02f7[_0x7251('0x2e')][_0x7251('0x2f')]};});_0x8d186b[_0x7251('0x30')]=_['map'](_0x2918fd,_0x7251('0x29'));_0x8d186b[_0x7251('0x31')]=_[_0x7251('0x32')](_0xc40f64[_0x7251('0x31')]);_0x8d186b[_0x7251('0x33')]=_[_0x7251('0x34')](_0x8d186b[_0x7251('0x30')],_0x8d186b[_0x7251('0x31')]);_0x3971f1[_0x7251('0x35')]=_[_0x7251('0x34')](_0x8d186b[_0x7251('0x30')],qs[_0x7251('0x36')](_0xc40f64['query'][_0x7251('0x36')]));_0x3971f1[_0x7251('0x35')]=_0x3971f1[_0x7251('0x35')][_0x7251('0x37')]?_0x3971f1[_0x7251('0x35')]:_0x8d186b[_0x7251('0x30')];if(!_0xc40f64['query'][_0x7251('0x38')](_0x7251('0x39'))){_0x3971f1['limit']=qs[_0x7251('0x1d')](_0xc40f64['query'][_0x7251('0x1d')]);_0x3971f1['offset']=qs[_0x7251('0x1b')](_0xc40f64[_0x7251('0x31')][_0x7251('0x1b')]);}_0x3971f1['order']=qs['sort'](_0xc40f64[_0x7251('0x31')][_0x7251('0x3a')]);_0x3971f1[_0x7251('0x3b')]=qs[_0x7251('0x33')](_[_0x7251('0x3c')](_0xc40f64[_0x7251('0x31')],_0x8d186b[_0x7251('0x33')]),_0x2918fd);if(_0xc40f64[_0x7251('0x31')][_0x7251('0x3d')]){_0x3971f1[_0x7251('0x3b')]=_[_0x7251('0x3e')](_0x3971f1['where'],{'$or':_['map'](_0x2918fd,function(_0x228022){if(_0x228022['type']!==_0x7251('0x3f')){var _0x58c731={};_0x58c731[_0x228022[_0x7251('0x29')]]={'$like':'%'+_0xc40f64[_0x7251('0x31')][_0x7251('0x3d')]+'%'};return _0x58c731;}})});}_0x3971f1=_['merge']({},_0x3971f1,_0xc40f64['options']);var _0x5d9255={'where':_0x3971f1[_0x7251('0x3b')]};return db[_0x7251('0x40')]['count'](_0x5d9255)[_0x7251('0x27')](function(_0xd1e7){_0x549553[_0x7251('0x41')]=_0xd1e7;if(_0xc40f64[_0x7251('0x31')]['includeAll']){_0x3971f1[_0x7251('0x42')]=[{'all':!![]}];}return db[_0x7251('0x40')][_0x7251('0x43')](_0x3971f1);})[_0x7251('0x27')](function(_0x24454b){_0x549553[_0x7251('0x44')]=_0x24454b;return _0x549553;})[_0x7251('0x27')](respondWithFilteredResult(_0x45c535,_0x3971f1))[_0x7251('0x45')](handleError(_0x45c535,null));};exports[_0x7251('0x46')]=function(_0x8d5308,_0x5460e0){var _0x18f3ad={'raw':![],'where':{'id':_0x8d5308['params']['id']}},_0x1055aa={};_0x1055aa[_0x7251('0x30')]=_[_0x7251('0x32')](db[_0x7251('0x40')]['rawAttributes']);_0x1055aa['query']=_[_0x7251('0x32')](_0x8d5308[_0x7251('0x31')]);_0x1055aa[_0x7251('0x33')]=_[_0x7251('0x34')](_0x1055aa[_0x7251('0x30')],_0x1055aa['query']);_0x18f3ad[_0x7251('0x35')]=_[_0x7251('0x34')](_0x1055aa['model'],qs[_0x7251('0x36')](_0x8d5308[_0x7251('0x31')][_0x7251('0x36')]));_0x18f3ad['attributes']=_0x18f3ad[_0x7251('0x35')][_0x7251('0x37')]?_0x18f3ad[_0x7251('0x35')]:_0x1055aa[_0x7251('0x30')];if(_0x8d5308['query'][_0x7251('0x47')]){_0x18f3ad[_0x7251('0x42')]=[{'all':!![]}];}_0x18f3ad=_['merge']({},_0x18f3ad,_0x8d5308[_0x7251('0x48')]);return db[_0x7251('0x40')][_0x7251('0x49')](_0x18f3ad)['then'](handleEntityNotFound(_0x5460e0,null))['then'](respondWithResult(_0x5460e0,null))[_0x7251('0x45')](handleError(_0x5460e0,null));};exports[_0x7251('0x4a')]=function(_0x23181e,_0x23f3e1){return db[_0x7251('0x40')][_0x7251('0x4a')](_0x23181e['body'],{})[_0x7251('0x27')](function(_0x4001ff){var _0x5b6883=_0x23181e[_0x7251('0x4b')][_0x7251('0x25')]({'plain':!![]});if(!_0x5b6883)throw new Error(_0x7251('0x4c'));if(_0x5b6883[_0x7251('0x4d')]===_0x7251('0x4b')){var _0x12a7dc=_0x4001ff[_0x7251('0x25')]({'plain':!![]});var _0x150d7d=_0x7251('0x4e');return db['UserProfileSection'][_0x7251('0x49')]({'where':{'name':_0x150d7d,'userProfileId':_0x5b6883['userProfileId']},'raw':!![]})['then'](function(_0x2b7708){if(_0x2b7708&&_0x2b7708[_0x7251('0x4f')]===0x0){return db['UserProfileResource'][_0x7251('0x4a')]({'name':_0x12a7dc[_0x7251('0x29')],'resourceId':_0x12a7dc['id'],'type':_0x2b7708[_0x7251('0x29')],'sectionId':_0x2b7708['id']},{})[_0x7251('0x27')](function(){return _0x4001ff;});}else{return _0x4001ff;}})[_0x7251('0x45')](function(_0x14565f){logger[_0x7251('0x28')](_0x7251('0x50'),_0x14565f);throw _0x14565f;});}return _0x4001ff;})['then'](respondWithResult(_0x23f3e1,0xc9))[_0x7251('0x45')](handleError(_0x23f3e1,null));};exports[_0x7251('0x24')]=function(_0x4eea02,_0x3e26e4){if(_0x4eea02['body']['id']){delete _0x4eea02[_0x7251('0x51')]['id'];}return db[_0x7251('0x40')][_0x7251('0x49')]({'where':{'id':_0x4eea02[_0x7251('0x52')]['id']}})[_0x7251('0x27')](handleEntityNotFound(_0x3e26e4,null))[_0x7251('0x27')](saveUpdates(_0x4eea02['body'],null))[_0x7251('0x27')](respondWithResult(_0x3e26e4,null))['catch'](handleError(_0x3e26e4,null));};exports['destroy']=function(_0xa0f0b8,_0x2130d1){return db['Trigger'][_0x7251('0x49')]({'where':{'id':_0xa0f0b8['params']['id']}})['then'](handleEntityNotFound(_0x2130d1,null))[_0x7251('0x27')](removeEntity(_0x2130d1,null))[_0x7251('0x45')](handleError(_0x2130d1,null));};exports[_0x7251('0x53')]=function(_0x7bd561,_0x1157b6,_0x49fe38){if(_0x7bd561['body']['id']){delete _0x7bd561[_0x7251('0x51')]['id'];}return db[_0x7251('0x40')]['find']({'where':{'id':_0x7bd561[_0x7251('0x52')]['id']}})[_0x7251('0x27')](handleEntityNotFound(_0x1157b6,null))['then'](function(_0x3c7604){if(_0x3c7604){_0x7bd561[_0x7251('0x51')]['TriggerAllId']=_0x3c7604['id'];return db['Condition']['create'](_0x7bd561['body']);}})[_0x7251('0x27')](respondWithResult(_0x1157b6,null))[_0x7251('0x45')](handleError(_0x1157b6,null));};exports[_0x7251('0x54')]=function(_0x370d8c,_0x31c513,_0x15ac30){if(_0x370d8c['body']['id']){delete _0x370d8c[_0x7251('0x51')]['id'];}return db[_0x7251('0x40')]['find']({'where':{'id':_0x370d8c[_0x7251('0x52')]['id']}})['then'](handleEntityNotFound(_0x31c513,null))[_0x7251('0x27')](function(_0x30ab12){if(_0x30ab12){_0x370d8c[_0x7251('0x51')][_0x7251('0x55')]=_0x30ab12['id'];return db[_0x7251('0x56')][_0x7251('0x4a')](_0x370d8c[_0x7251('0x51')]);}})[_0x7251('0x27')](respondWithResult(_0x31c513,null))[_0x7251('0x45')](handleError(_0x31c513,null));};exports[_0x7251('0x57')]=function(_0x9a3601,_0x22afba,_0x484c1b){var _0x2f3a35={};var _0x43fa4f={};var _0x47cad3;var _0x1ab17a;return db['Trigger'][_0x7251('0x58')]({'where':{'id':_0x9a3601[_0x7251('0x52')]['id']}})['then'](handleEntityNotFound(_0x22afba,null))[_0x7251('0x27')](function(_0x1e85a6){if(_0x1e85a6){_0x47cad3=_0x1e85a6;_0x43fa4f[_0x7251('0x30')]=_[_0x7251('0x32')](db['Condition'][_0x7251('0x2c')]);_0x43fa4f[_0x7251('0x31')]=_[_0x7251('0x32')](_0x9a3601[_0x7251('0x31')]);_0x43fa4f[_0x7251('0x33')]=_[_0x7251('0x34')](_0x43fa4f[_0x7251('0x30')],_0x43fa4f[_0x7251('0x31')]);_0x2f3a35[_0x7251('0x35')]=_[_0x7251('0x34')](_0x43fa4f[_0x7251('0x30')],qs[_0x7251('0x36')](_0x9a3601[_0x7251('0x31')][_0x7251('0x36')]));_0x2f3a35['attributes']=_0x2f3a35[_0x7251('0x35')][_0x7251('0x37')]?_0x2f3a35['attributes']:_0x43fa4f[_0x7251('0x30')];_0x2f3a35[_0x7251('0x59')]=qs[_0x7251('0x3a')](_0x9a3601[_0x7251('0x31')]['sort']);_0x2f3a35[_0x7251('0x3b')]=qs[_0x7251('0x33')](_[_0x7251('0x3c')](_0x9a3601[_0x7251('0x31')],_0x43fa4f[_0x7251('0x33')]));if(_0x9a3601['query'][_0x7251('0x3d')]){_0x2f3a35[_0x7251('0x3b')]=_[_0x7251('0x3e')](_0x2f3a35[_0x7251('0x3b')],{'$or':_[_0x7251('0x2b')](_0x2f3a35[_0x7251('0x35')],function(_0x120b98){var _0x2109b8={};_0x2109b8[_0x120b98]={'$like':'%'+_0x9a3601['query']['filter']+'%'};return _0x2109b8;})});}_0x2f3a35=_[_0x7251('0x3e')]({},_0x2f3a35,_0x9a3601['options']);return _0x47cad3['getAllConditions'](_0x2f3a35);}})[_0x7251('0x27')](function(_0x298e59){if(_0x298e59){_0x1ab17a=_0x298e59['length'];if(!_0x9a3601[_0x7251('0x31')][_0x7251('0x38')](_0x7251('0x39'))){_0x2f3a35[_0x7251('0x1d')]=qs['limit'](_0x9a3601[_0x7251('0x31')][_0x7251('0x1d')]);_0x2f3a35['offset']=qs[_0x7251('0x1b')](_0x9a3601['query']['offset']);}return _0x47cad3[_0x7251('0x57')](_0x2f3a35);}})[_0x7251('0x27')](function(_0x32de74){if(_0x32de74){return _0x32de74?{'count':_0x1ab17a,'rows':_0x32de74}:null;}})[_0x7251('0x27')](respondWithResult(_0x22afba,null))[_0x7251('0x45')](handleError(_0x22afba,null));};exports[_0x7251('0x5a')]=function(_0x47cb04,_0x55ef48,_0x149e61){var _0x3c96c8={};var _0x5eb5f6={};var _0x61ad72;var _0x3e01c7;return db['Trigger'][_0x7251('0x58')]({'where':{'id':_0x47cb04['params']['id']}})[_0x7251('0x27')](handleEntityNotFound(_0x55ef48,null))[_0x7251('0x27')](function(_0x32b58b){if(_0x32b58b){_0x61ad72=_0x32b58b;_0x5eb5f6[_0x7251('0x30')]=_['keys'](db[_0x7251('0x56')][_0x7251('0x2c')]);_0x5eb5f6['query']=_[_0x7251('0x32')](_0x47cb04[_0x7251('0x31')]);_0x5eb5f6[_0x7251('0x33')]=_[_0x7251('0x34')](_0x5eb5f6[_0x7251('0x30')],_0x5eb5f6[_0x7251('0x31')]);_0x3c96c8[_0x7251('0x35')]=_['intersection'](_0x5eb5f6[_0x7251('0x30')],qs[_0x7251('0x36')](_0x47cb04[_0x7251('0x31')][_0x7251('0x36')]));_0x3c96c8['attributes']=_0x3c96c8[_0x7251('0x35')][_0x7251('0x37')]?_0x3c96c8[_0x7251('0x35')]:_0x5eb5f6[_0x7251('0x30')];_0x3c96c8[_0x7251('0x59')]=qs[_0x7251('0x3a')](_0x47cb04[_0x7251('0x31')][_0x7251('0x3a')]);_0x3c96c8[_0x7251('0x3b')]=qs[_0x7251('0x33')](_[_0x7251('0x3c')](_0x47cb04[_0x7251('0x31')],_0x5eb5f6[_0x7251('0x33')]));if(_0x47cb04['query'][_0x7251('0x3d')]){_0x3c96c8[_0x7251('0x3b')]=_[_0x7251('0x3e')](_0x3c96c8[_0x7251('0x3b')],{'$or':_['map'](_0x3c96c8[_0x7251('0x35')],function(_0x509584){var _0x1e6e94={};_0x1e6e94[_0x509584]={'$like':'%'+_0x47cb04[_0x7251('0x31')]['filter']+'%'};return _0x1e6e94;})});}_0x3c96c8=_[_0x7251('0x3e')]({},_0x3c96c8,_0x47cb04[_0x7251('0x48')]);return _0x61ad72[_0x7251('0x5a')](_0x3c96c8);}})[_0x7251('0x27')](function(_0x52f747){if(_0x52f747){_0x3e01c7=_0x52f747[_0x7251('0x37')];if(!_0x47cb04[_0x7251('0x31')][_0x7251('0x38')]('nolimit')){_0x3c96c8[_0x7251('0x1d')]=qs[_0x7251('0x1d')](_0x47cb04['query'][_0x7251('0x1d')]);_0x3c96c8['offset']=qs['offset'](_0x47cb04['query'][_0x7251('0x1b')]);}return _0x61ad72[_0x7251('0x5a')](_0x3c96c8);}})[_0x7251('0x27')](function(_0x5ab012){if(_0x5ab012){return _0x5ab012?{'count':_0x3e01c7,'rows':_0x5ab012}:null;}})[_0x7251('0x27')](respondWithResult(_0x55ef48,null))[_0x7251('0x45')](handleError(_0x55ef48,null));};exports[_0x7251('0x5b')]=function(_0x1e3770,_0x5405bf,_0xc68bd0){if(_0x1e3770[_0x7251('0x51')]['id']){delete _0x1e3770[_0x7251('0x51')]['id'];}return db[_0x7251('0x40')][_0x7251('0x49')]({'where':{'id':_0x1e3770['params']['id']}})[_0x7251('0x27')](handleEntityNotFound(_0x5405bf,null))[_0x7251('0x27')](function(_0x139c01){if(_0x139c01){_0x1e3770[_0x7251('0x51')][_0x7251('0x5c')]=_0x139c01['id'];return db[_0x7251('0x5d')]['create'](_0x1e3770['body']);}})[_0x7251('0x27')](respondWithResult(_0x5405bf,null))['catch'](handleError(_0x5405bf,null));};exports[_0x7251('0x5e')]=function(_0x212863,_0x4a1024,_0x1e2e49){var _0x5f01b3={};var _0x31747d={};var _0x1624c9;var _0x49764a;return db[_0x7251('0x40')][_0x7251('0x58')]({'where':{'id':_0x212863[_0x7251('0x52')]['id']}})[_0x7251('0x27')](handleEntityNotFound(_0x4a1024,null))[_0x7251('0x27')](function(_0x16209d){if(_0x16209d){_0x1624c9=_0x16209d;_0x31747d[_0x7251('0x30')]=_[_0x7251('0x32')](db[_0x7251('0x5d')][_0x7251('0x2c')]);_0x31747d[_0x7251('0x31')]=_[_0x7251('0x32')](_0x212863[_0x7251('0x31')]);_0x31747d[_0x7251('0x33')]=_['intersection'](_0x31747d[_0x7251('0x30')],_0x31747d[_0x7251('0x31')]);_0x5f01b3[_0x7251('0x35')]=_[_0x7251('0x34')](_0x31747d[_0x7251('0x30')],qs[_0x7251('0x36')](_0x212863[_0x7251('0x31')][_0x7251('0x36')]));_0x5f01b3['attributes']=_0x5f01b3[_0x7251('0x35')][_0x7251('0x37')]?_0x5f01b3['attributes']:_0x31747d[_0x7251('0x30')];_0x5f01b3[_0x7251('0x59')]=qs[_0x7251('0x3a')](_0x212863[_0x7251('0x31')][_0x7251('0x3a')]);_0x5f01b3[_0x7251('0x3b')]=qs[_0x7251('0x33')](_[_0x7251('0x3c')](_0x212863[_0x7251('0x31')],_0x31747d[_0x7251('0x33')]));if(_0x212863[_0x7251('0x31')][_0x7251('0x3d')]){_0x5f01b3[_0x7251('0x3b')]=_['merge'](_0x5f01b3[_0x7251('0x3b')],{'$or':_[_0x7251('0x2b')](_0x5f01b3[_0x7251('0x35')],function(_0x597b4c){var _0x55298f={};_0x55298f[_0x597b4c]={'$like':'%'+_0x212863[_0x7251('0x31')][_0x7251('0x3d')]+'%'};return _0x55298f;})});}_0x5f01b3=_['merge']({},_0x5f01b3,_0x212863[_0x7251('0x48')]);return _0x1624c9['getActions'](_0x5f01b3);}})['then'](function(_0x449144){if(_0x449144){_0x49764a=_0x449144[_0x7251('0x37')];if(!_0x212863[_0x7251('0x31')]['hasOwnProperty'](_0x7251('0x39'))){_0x5f01b3[_0x7251('0x1d')]=qs['limit'](_0x212863[_0x7251('0x31')][_0x7251('0x1d')]);_0x5f01b3[_0x7251('0x1b')]=qs[_0x7251('0x1b')](_0x212863[_0x7251('0x31')][_0x7251('0x1b')]);}return _0x1624c9[_0x7251('0x5e')](_0x5f01b3);}})[_0x7251('0x27')](function(_0xdf2605){if(_0xdf2605){return _0xdf2605?{'count':_0x49764a,'rows':_0xdf2605}:null;}})[_0x7251('0x27')](respondWithResult(_0x4a1024,null))[_0x7251('0x45')](handleError(_0x4a1024,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index fe5e6aa..568c188 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 _0x03ce=['api','bluebird','request-promise','path','../../config/environment','./trigger.attributes','exports','define','Trigger','lodash','util','../../config/logger'];(function(_0x4fff02,_0x20fab9){var _0xd0d172=function(_0x515a6d){while(--_0x515a6d){_0x4fff02['push'](_0x4fff02['shift']());}};_0xd0d172(++_0x20fab9);}(_0x03ce,0x1a1));var _0xe03c=function(_0x3db3c3,_0x56f20c){_0x3db3c3=_0x3db3c3-0x0;var _0x2d5c78=_0x03ce[_0x3db3c3];return _0x2d5c78;};'use strict';var _=require(_0xe03c('0x0'));var util=require(_0xe03c('0x1'));var logger=require(_0xe03c('0x2'))(_0xe03c('0x3'));var moment=require('moment');var BPromise=require(_0xe03c('0x4'));var rp=require(_0xe03c('0x5'));var fs=require('fs');var path=require(_0xe03c('0x6'));var rimraf=require('rimraf');var config=require(_0xe03c('0x7'));var attributes=require(_0xe03c('0x8'));module[_0xe03c('0x9')]=function(_0x2c0e4b,_0x4340f0){return _0x2c0e4b[_0xe03c('0xa')](_0xe03c('0xb'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf675=['Trigger','tools_triggers','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./trigger.attributes','exports'];(function(_0x4df919,_0x1ba6f5){var _0x4a5642=function(_0x3068cc){while(--_0x3068cc){_0x4df919['push'](_0x4df919['shift']());}};_0x4a5642(++_0x1ba6f5);}(_0xf675,0x199));var _0x5f67=function(_0x2d8f6c,_0x44db4c){_0x2d8f6c=_0x2d8f6c-0x0;var _0x3a00f6=_0xf675[_0x2d8f6c];return _0x3a00f6;};'use strict';var _=require(_0x5f67('0x0'));var util=require(_0x5f67('0x1'));var logger=require(_0x5f67('0x2'))('api');var moment=require(_0x5f67('0x3'));var BPromise=require('bluebird');var rp=require(_0x5f67('0x4'));var fs=require('fs');var path=require(_0x5f67('0x5'));var rimraf=require(_0x5f67('0x6'));var config=require('../../config/environment');var attributes=require(_0x5f67('0x7'));module[_0x5f67('0x8')]=function(_0x2919cc,_0xd4b727){return _0x2919cc['define'](_0x5f67('0x9'),attributes,{'tableName':_0x5f67('0xa'),'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 7478a29..e1e5327 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 _0x8acc=['limit','include','attributes','map','model','debug','ShowTrigger','find','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','info','result','catch','GetTrigger','Trigger','findAll','options','raw'];(function(_0x3ff5dd,_0x4e5e9c){var _0x29586e=function(_0x271e0a){while(--_0x271e0a){_0x3ff5dd['push'](_0x3ff5dd['shift']());}};_0x29586e(++_0x4e5e9c);}(_0x8acc,0xdb));var _0xc8ac=function(_0x357766,_0x1ade36){_0x357766=_0x357766-0x0;var _0xe28a73=_0x8acc[_0x357766];return _0xe28a73;};'use strict';var _=require('lodash');var util=require(_0xc8ac('0x0'));var moment=require(_0xc8ac('0x1'));var BPromise=require(_0xc8ac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8ac('0x3'));var db=require(_0xc8ac('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc8ac('0x5'))(_0xc8ac('0x6'));var config=require('../../config/environment');var jayson=require(_0xc8ac('0x7'));var client=jayson[_0xc8ac('0x8')][_0xc8ac('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f0850,_0x201f12,_0x184cb1){return new BPromise(function(_0x5b96d4,_0x5e42a0){return client[_0xc8ac('0xa')](_0x3f0850,_0x184cb1)[_0xc8ac('0xb')](function(_0x55384b){logger['info'](_0xc8ac('0xc'),_0x201f12,_0xc8ac('0xd'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x201f12,'request\x20sent',JSON[_0xc8ac('0xe')](_0x55384b));if(_0x55384b['error']){if(_0x55384b['error'][_0xc8ac('0xf')]===0x1f4){logger['error'](_0xc8ac('0xc'),_0x201f12,_0x55384b['error'][_0xc8ac('0x10')]);return _0x5e42a0(_0x55384b[_0xc8ac('0x11')][_0xc8ac('0x10')]);}logger[_0xc8ac('0x11')](_0xc8ac('0xc'),_0x201f12,_0x55384b[_0xc8ac('0x11')][_0xc8ac('0x10')]);return _0x5b96d4(_0x55384b[_0xc8ac('0x11')][_0xc8ac('0x10')]);}else{logger[_0xc8ac('0x12')](_0xc8ac('0xc'),_0x201f12,_0xc8ac('0xd'));_0x5b96d4(_0x55384b[_0xc8ac('0x13')][_0xc8ac('0x10')]);}})[_0xc8ac('0x14')](function(_0x186a0d){logger[_0xc8ac('0x11')](_0xc8ac('0xc'),_0x201f12,_0x186a0d);_0x5e42a0(_0x186a0d);});});}exports[_0xc8ac('0x15')]=function(_0x129693){var _0xae037=this;return new Promise(function(_0x44d945,_0x3c1f23){return db[_0xc8ac('0x16')][_0xc8ac('0x17')]({'raw':_0x129693[_0xc8ac('0x18')]?_0x129693['options'][_0xc8ac('0x19')]===undefined?!![]:![]:!![],'where':_0x129693[_0xc8ac('0x18')]?_0x129693[_0xc8ac('0x18')]['where']||null:null,'attributes':_0x129693[_0xc8ac('0x18')]?_0x129693['options']['attributes']||null:null,'limit':_0x129693[_0xc8ac('0x18')]?_0x129693[_0xc8ac('0x18')][_0xc8ac('0x1a')]||null:null,'include':_0x129693[_0xc8ac('0x18')]?_0x129693[_0xc8ac('0x18')][_0xc8ac('0x1b')]?_['map'](_0x129693[_0xc8ac('0x18')][_0xc8ac('0x1b')],function(_0xf481d9){return{'model':db[_0xf481d9['model']],'as':_0xf481d9['as'],'attributes':_0xf481d9[_0xc8ac('0x1c')],'include':_0xf481d9[_0xc8ac('0x1b')]?_[_0xc8ac('0x1d')](_0xf481d9[_0xc8ac('0x1b')],function(_0x45c486){return{'model':db[_0x45c486[_0xc8ac('0x1e')]],'as':_0x45c486['as'],'attributes':_0x45c486[_0xc8ac('0x1c')],'include':_0x45c486[_0xc8ac('0x1b')]?_['map'](_0x45c486['include'],function(_0x3b89cf){return{'model':db[_0x3b89cf[_0xc8ac('0x1e')]],'as':_0x3b89cf['as'],'attributes':_0x3b89cf[_0xc8ac('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc8ac('0xb')](function(_0xb91cf5){logger['info'](_0xc8ac('0x15'),_0x129693);logger[_0xc8ac('0x1f')](_0xc8ac('0x15'),_0x129693,JSON['stringify'](_0xb91cf5));_0x44d945(_0xb91cf5);})['catch'](function(_0x43db05){logger[_0xc8ac('0x11')](_0xc8ac('0x15'),_0x43db05[_0xc8ac('0x10')],_0x129693);_0x3c1f23(_0xae037['error'](0x1f4,_0x43db05[_0xc8ac('0x10')]));});});};exports[_0xc8ac('0x20')]=function(_0x19f937){var _0x1c1399=this;return new Promise(function(_0x629879,_0x5aeb91){return db[_0xc8ac('0x16')][_0xc8ac('0x21')]({'raw':_0x19f937[_0xc8ac('0x18')]?_0x19f937[_0xc8ac('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x19f937['options']?_0x19f937[_0xc8ac('0x18')][_0xc8ac('0x22')]||null:null,'attributes':_0x19f937[_0xc8ac('0x18')]?_0x19f937[_0xc8ac('0x18')][_0xc8ac('0x1c')]||null:null,'include':_0x19f937[_0xc8ac('0x18')]?_0x19f937[_0xc8ac('0x18')][_0xc8ac('0x1b')]?_[_0xc8ac('0x1d')](_0x19f937['options'][_0xc8ac('0x1b')],function(_0x26903c){return{'model':db[_0x26903c[_0xc8ac('0x1e')]],'as':_0x26903c['as'],'attributes':_0x26903c[_0xc8ac('0x1c')],'include':_0x26903c[_0xc8ac('0x1b')]?_[_0xc8ac('0x1d')](_0x26903c['include'],function(_0x42a7d7){return{'model':db[_0x42a7d7[_0xc8ac('0x1e')]],'as':_0x42a7d7['as'],'attributes':_0x42a7d7[_0xc8ac('0x1c')],'include':_0x42a7d7[_0xc8ac('0x1b')]?_[_0xc8ac('0x1d')](_0x42a7d7[_0xc8ac('0x1b')],function(_0x585ed7){return{'model':db[_0x585ed7[_0xc8ac('0x1e')]],'as':_0x585ed7['as'],'attributes':_0x585ed7[_0xc8ac('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2215aa){logger[_0xc8ac('0x12')]('ShowTrigger',_0x19f937);logger[_0xc8ac('0x1f')]('ShowTrigger',_0x19f937,JSON[_0xc8ac('0xe')](_0x2215aa));_0x629879(_0x2215aa);})[_0xc8ac('0x14')](function(_0x5063bf){logger[_0xc8ac('0x11')]('ShowTrigger',_0x5063bf[_0xc8ac('0x10')],_0x19f937);_0x5aeb91(_0x1c1399[_0xc8ac('0x11')](0x1f4,_0x5063bf['message']));});});}; \ No newline at end of file +var _0xe0a3=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','Trigger','options','raw','where','include','map','model','attributes','ShowTrigger','lodash','util','moment','randomstring','ioredis'];(function(_0x571845,_0x2ca758){var _0x35e88e=function(_0xbca866){while(--_0xbca866){_0x571845['push'](_0x571845['shift']());}};_0x35e88e(++_0x2ca758);}(_0xe0a3,0x187));var _0x3e0a=function(_0x1b5a5a,_0x1c3b75){_0x1b5a5a=_0x1b5a5a-0x0;var _0x42b32d=_0xe0a3[_0x1b5a5a];return _0x42b32d;};'use strict';var _=require(_0x3e0a('0x0'));var util=require(_0x3e0a('0x1'));var moment=require(_0x3e0a('0x2'));var BPromise=require('bluebird');var rs=require(_0x3e0a('0x3'));var fs=require('fs');var Redis=require(_0x3e0a('0x4'));var db=require(_0x3e0a('0x5'))['db'];var utils=require(_0x3e0a('0x6'));var logger=require(_0x3e0a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3e0a('0x8'));var client=jayson[_0x3e0a('0x9')][_0x3e0a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x586bab,_0x53c13a,_0x105fdc){return new BPromise(function(_0xbccfd4,_0x520603){return client[_0x3e0a('0xb')](_0x586bab,_0x105fdc)[_0x3e0a('0xc')](function(_0x329e81){logger[_0x3e0a('0xd')](_0x3e0a('0xe'),_0x53c13a,_0x3e0a('0xf'));logger[_0x3e0a('0x10')](_0x3e0a('0x11'),_0x53c13a,_0x3e0a('0xf'),JSON[_0x3e0a('0x12')](_0x329e81));if(_0x329e81[_0x3e0a('0x13')]){if(_0x329e81['error'][_0x3e0a('0x14')]===0x1f4){logger[_0x3e0a('0x13')](_0x3e0a('0xe'),_0x53c13a,_0x329e81[_0x3e0a('0x13')][_0x3e0a('0x15')]);return _0x520603(_0x329e81[_0x3e0a('0x13')][_0x3e0a('0x15')]);}logger[_0x3e0a('0x13')](_0x3e0a('0xe'),_0x53c13a,_0x329e81[_0x3e0a('0x13')]['message']);return _0xbccfd4(_0x329e81[_0x3e0a('0x13')][_0x3e0a('0x15')]);}else{logger[_0x3e0a('0xd')](_0x3e0a('0xe'),_0x53c13a,_0x3e0a('0xf'));_0xbccfd4(_0x329e81['result'][_0x3e0a('0x15')]);}})[_0x3e0a('0x16')](function(_0xa39a8d){logger['error'](_0x3e0a('0xe'),_0x53c13a,_0xa39a8d);_0x520603(_0xa39a8d);});});}exports[_0x3e0a('0x17')]=function(_0x3754cb){var _0x46a71e=this;return new Promise(function(_0x30310a,_0x103f3a){return db[_0x3e0a('0x18')]['findAll']({'raw':_0x3754cb[_0x3e0a('0x19')]?_0x3754cb[_0x3e0a('0x19')][_0x3e0a('0x1a')]===undefined?!![]:![]:!![],'where':_0x3754cb['options']?_0x3754cb['options'][_0x3e0a('0x1b')]||null:null,'attributes':_0x3754cb[_0x3e0a('0x19')]?_0x3754cb[_0x3e0a('0x19')]['attributes']||null:null,'limit':_0x3754cb[_0x3e0a('0x19')]?_0x3754cb[_0x3e0a('0x19')]['limit']||null:null,'include':_0x3754cb[_0x3e0a('0x19')]?_0x3754cb[_0x3e0a('0x19')][_0x3e0a('0x1c')]?_[_0x3e0a('0x1d')](_0x3754cb[_0x3e0a('0x19')][_0x3e0a('0x1c')],function(_0x57fab8){return{'model':db[_0x57fab8[_0x3e0a('0x1e')]],'as':_0x57fab8['as'],'attributes':_0x57fab8['attributes'],'include':_0x57fab8[_0x3e0a('0x1c')]?_['map'](_0x57fab8['include'],function(_0x44a06a){return{'model':db[_0x44a06a[_0x3e0a('0x1e')]],'as':_0x44a06a['as'],'attributes':_0x44a06a[_0x3e0a('0x1f')],'include':_0x44a06a[_0x3e0a('0x1c')]?_[_0x3e0a('0x1d')](_0x44a06a[_0x3e0a('0x1c')],function(_0x54dc5e){return{'model':db[_0x54dc5e[_0x3e0a('0x1e')]],'as':_0x54dc5e['as'],'attributes':_0x54dc5e[_0x3e0a('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2aefe2){logger[_0x3e0a('0xd')](_0x3e0a('0x17'),_0x3754cb);logger['debug']('GetTrigger',_0x3754cb,JSON[_0x3e0a('0x12')](_0x2aefe2));_0x30310a(_0x2aefe2);})[_0x3e0a('0x16')](function(_0x1feb32){logger['error'](_0x3e0a('0x17'),_0x1feb32[_0x3e0a('0x15')],_0x3754cb);_0x103f3a(_0x46a71e['error'](0x1f4,_0x1feb32[_0x3e0a('0x15')]));});});};exports['ShowTrigger']=function(_0x635cf){var _0x17204f=this;return new Promise(function(_0x1a8ae3,_0xa4d5b7){return db['Trigger']['find']({'raw':_0x635cf[_0x3e0a('0x19')]?_0x635cf['options'][_0x3e0a('0x1a')]===undefined?!![]:![]:!![],'where':_0x635cf[_0x3e0a('0x19')]?_0x635cf[_0x3e0a('0x19')][_0x3e0a('0x1b')]||null:null,'attributes':_0x635cf[_0x3e0a('0x19')]?_0x635cf[_0x3e0a('0x19')]['attributes']||null:null,'include':_0x635cf['options']?_0x635cf[_0x3e0a('0x19')]['include']?_[_0x3e0a('0x1d')](_0x635cf[_0x3e0a('0x19')][_0x3e0a('0x1c')],function(_0x3ff993){return{'model':db[_0x3ff993['model']],'as':_0x3ff993['as'],'attributes':_0x3ff993[_0x3e0a('0x1f')],'include':_0x3ff993['include']?_['map'](_0x3ff993['include'],function(_0x183cb5){return{'model':db[_0x183cb5[_0x3e0a('0x1e')]],'as':_0x183cb5['as'],'attributes':_0x183cb5[_0x3e0a('0x1f')],'include':_0x183cb5[_0x3e0a('0x1c')]?_['map'](_0x183cb5['include'],function(_0x414a8d){return{'model':db[_0x414a8d['model']],'as':_0x414a8d['as'],'attributes':_0x414a8d[_0x3e0a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3e0a('0xc')](function(_0x262827){logger[_0x3e0a('0xd')]('ShowTrigger',_0x635cf);logger['debug']('ShowTrigger',_0x635cf,JSON[_0x3e0a('0x12')](_0x262827));_0x1a8ae3(_0x262827);})[_0x3e0a('0x16')](function(_0x3b92c8){logger[_0x3e0a('0x13')](_0x3e0a('0x20'),_0x3b92c8['message'],_0x635cf);_0xa4d5b7(_0x17204f[_0x3e0a('0x13')](0x1f4,_0x3b92c8['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 8f727f8..0e2d189 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 _0x7309=['clone','create','put','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','/:id','show','post','/:id/clone','isAuthenticated'];(function(_0x499286,_0x3e79c6){var _0x26d4c1=function(_0xe25be9){while(--_0xe25be9){_0x499286['push'](_0x499286['shift']());}};_0x26d4c1(++_0x3e79c6);}(_0x7309,0xa6));var _0x9730=function(_0x5bac8b,_0x3f8ac9){_0x5bac8b=_0x5bac8b-0x0;var _0x53ccd7=_0x7309[_0x5bac8b];return _0x53ccd7;};'use strict';var multer=require('multer');var util=require(_0x9730('0x0'));var path=require(_0x9730('0x1'));var timeout=require(_0x9730('0x2'));var express=require(_0x9730('0x3'));var router=express['Router']();var fs_extra=require(_0x9730('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9730('0x5'));var config=require(_0x9730('0x6'));var controller=require(_0x9730('0x7'));router[_0x9730('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9730('0x8')](_0x9730('0x9'),auth['isAuthenticated'](),controller[_0x9730('0xa')]);router[_0x9730('0xb')](_0x9730('0xc'),auth[_0x9730('0xd')](),controller[_0x9730('0xe')]);router['post']('/',auth[_0x9730('0xd')](),controller[_0x9730('0xf')]);router[_0x9730('0x10')](_0x9730('0x9'),auth[_0x9730('0xd')](),controller['update']);router[_0x9730('0x11')](_0x9730('0x9'),auth[_0x9730('0xd')](),controller[_0x9730('0x12')]);module[_0x9730('0x13')]=router; \ No newline at end of file +var _0x2de6=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','isAuthenticated','post','/:id/clone','clone','create','put','/:id','delete','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2de6,0x14f));var _0x62de=function(_0x43e6e3,_0x5a9435){_0x43e6e3=_0x43e6e3-0x0;var _0x5d2888=_0x2de6[_0x43e6e3];return _0x5d2888;};'use strict';var multer=require(_0x62de('0x0'));var util=require(_0x62de('0x1'));var path=require(_0x62de('0x2'));var timeout=require(_0x62de('0x3'));var express=require(_0x62de('0x4'));var router=express[_0x62de('0x5')]();var fs_extra=require(_0x62de('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x62de('0x7'));var config=require(_0x62de('0x8'));var controller=require(_0x62de('0x9'));router[_0x62de('0xa')]('/',auth['isAuthenticated'](),controller[_0x62de('0xb')]);router['get']('/:id',auth[_0x62de('0xc')](),controller['show']);router[_0x62de('0xd')](_0x62de('0xe'),auth[_0x62de('0xc')](),controller[_0x62de('0xf')]);router[_0x62de('0xd')]('/',auth['isAuthenticated'](),controller[_0x62de('0x10')]);router[_0x62de('0x11')](_0x62de('0x12'),auth[_0x62de('0xc')](),controller['update']);router[_0x62de('0x13')](_0x62de('0x12'),auth[_0x62de('0xc')](),controller['destroy']);module[_0x62de('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 f2ed76a..46b0f51 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 _0x0af3=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','never','\x22\x22\x20<>','INTEGER','accept','originate','uas','pai','fingerprint','certificate','passive','actpass','dynamic','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','join','transport','split','rfc2833','shortinfo','inband','auto','yes','nonat','update','outgoing','nat','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow'];(function(_0x1d05c2,_0x1a6c2d){var _0x4766f5=function(_0xa0df0){while(--_0xa0df0){_0x1d05c2['push'](_0x1d05c2['shift']());}};_0x4766f5(++_0x1a6c2d);}(_0x0af3,0x158));var _0x30af=function(_0x225d34,_0xa7b00f){_0x225d34=_0x225d34-0x0;var _0x7d5644=_0x0af3[_0x225d34];return _0x7d5644;};'use strict';var Sequelize=require(_0x30af('0x0'));module[_0x30af('0x1')]={'name':{'type':Sequelize[_0x30af('0x2')],'allowNull':![],'unique':_0x30af('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x30af('0x4')](_0x30af('0x5'),'user',_0x30af('0x6')),'allowNull':![],'defaultValue':_0x30af('0x5')},'context':{'type':Sequelize[_0x30af('0x2')],'allowNull':![],'defaultValue':_0x30af('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0x30af('0x8'),_0x30af('0x9'),'ALLOWED_FAILED_SCREEN',_0x30af('0xa'),_0x30af('0xb'),_0x30af('0xc'),_0x30af('0xd'),_0x30af('0xe'))},'deny':{'type':Sequelize[_0x30af('0x2')]},'permit':{'type':Sequelize[_0x30af('0x2')]},'secret':{'type':Sequelize[_0x30af('0x2')]},'md5secret':{'type':Sequelize[_0x30af('0x2')]},'remotesecret':{'type':Sequelize[_0x30af('0x2')]},'transport':{'type':Sequelize[_0x30af('0x2')],'defaultValue':'udp','set':function(_0x1e91b4){this[_0x30af('0xf')]('transport',_0x1e91b4?_0x1e91b4[_0x30af('0x10')](','):null);},'get':function(){return this['getDataValue'](_0x30af('0x11'))?this['getDataValue'](_0x30af('0x11'))[_0x30af('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x30af('0x4')](_0x30af('0x13'),'info',_0x30af('0x14'),_0x30af('0x15'),_0x30af('0x16')),'defaultValue':_0x30af('0x13')},'directmedia':{'type':Sequelize['ENUM'](_0x30af('0x17'),'no',_0x30af('0x18'),_0x30af('0x19'),_0x30af('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x30af('0x4')](_0x30af('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x30af('0x2')]},'directmediadeny':{'type':Sequelize[_0x30af('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0x2c24c3){this[_0x30af('0xf')](_0x30af('0x1b'),_0x2c24c3?_0x2c24c3[_0x30af('0x10')](','):null);},'get':function(){return this[_0x30af('0x1c')]('nat')?this[_0x30af('0x1c')]('nat')['split'](','):null;},'comment':_0x30af('0x1d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x30af('0x2')]},'language':{'type':Sequelize[_0x30af('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x30af('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x30af('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x30af('0x2')],'allowNull':![],'defaultValue':_0x30af('0x1e'),'set':function(_0x599da0){this[_0x30af('0xf')]('allow',_0x599da0?_0x599da0['join'](';'):_0x30af('0x1e'));},'get':function(){return this[_0x30af('0x1c')](_0x30af('0x1f'))?this[_0x30af('0x1c')](_0x30af('0x1f'))['split'](';'):null;},'comment':_0x30af('0x20')},'autoframing':{'type':Sequelize['ENUM'](_0x30af('0x17'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x24e7ec){this['setDataValue']('insecure',_0x24e7ec?_0x24e7ec[_0x30af('0x10')](','):null);},'get':function(){return this[_0x30af('0x1c')](_0x30af('0x21'))?this['getDataValue'](_0x30af('0x21'))[_0x30af('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x30af('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x30af('0x4')](_0x30af('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x30af('0x17'),'no',_0x30af('0x22'))},'promiscredir':{'type':Sequelize[_0x30af('0x4')](_0x30af('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x30af('0x4')](_0x30af('0x17'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x30af('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x30af('0x23')},'amaflags':{'type':Sequelize[_0x30af('0x2')]},'callcounter':{'type':Sequelize['ENUM'](_0x30af('0x17'),'no'),'defaultValue':_0x30af('0x17')},'busylevel':{'type':Sequelize[_0x30af('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x30af('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x30af('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x30af('0x4')](_0x30af('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x30af('0x4')](_0x30af('0x17'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x30af('0x4')](_0x30af('0x17'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x30af('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0x30af('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x30af('0x25'),'refuse',_0x30af('0x26'))},'session_expires':{'type':Sequelize[_0x30af('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x30af('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x30af('0x4')]('uac',_0x30af('0x27')),'defaultValue':_0x30af('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x30af('0x2')]},'regexten':{'type':Sequelize[_0x30af('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x30af('0x24')](0x5)},'qualify':{'type':Sequelize[_0x30af('0x4')](_0x30af('0x17'),'no'),'defaultValue':_0x30af('0x17')},'keepalive':{'type':Sequelize[_0x30af('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x30af('0x2')]},'defaultuser':{'type':Sequelize[_0x30af('0x2')]},'rtptimeout':{'type':Sequelize[_0x30af('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x30af('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x30af('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x30af('0x4')](_0x30af('0x17'),'no',_0x30af('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x30af('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x30af('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x30af('0x24')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x30af('0x2')]},'contactacl':{'type':Sequelize[_0x30af('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x30af('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x30af('0x24')](0xb)},'encryption':{'type':Sequelize[_0x30af('0x4')](_0x30af('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x30af('0x4')](_0x30af('0x17'),'no')},'force_avp':{'type':Sequelize[_0x30af('0x4')](_0x30af('0x17'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x30af('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x30af('0x4')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x30af('0x4')](_0x30af('0x17'),'no',_0x30af('0x29'),_0x30af('0x2a'))},'dtlsrekey':{'type':Sequelize[_0x30af('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x30af('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x30af('0x2')]},'dtlssetup':{'type':Sequelize[_0x30af('0x4')]('active',_0x30af('0x2b'),_0x30af('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x30af('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0x30af('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x30af('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x30af('0x4')](_0x30af('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x30af('0x4')](_0x30af('0x17'),'no')},'vmexten':{'type':Sequelize[_0x30af('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x30af('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0x30af('0x2d')},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x30af('0x18'),_0x30af('0x19'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x30af('0x2')]},'otherFields':{'type':Sequelize[_0x30af('0x2')]},'active':{'type':Sequelize[_0x30af('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x30af('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xfde5=['nat','join','getDataValue','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\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','fingerprint','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0xfde5,0x19b));var _0x5fde=function(_0x2e9e29,_0x2e25d3){_0x2e9e29=_0x2e9e29-0x0;var _0x52679c=_0xfde5[_0x2e9e29];return _0x52679c;};'use strict';var Sequelize=require(_0x5fde('0x0'));module['exports']={'name':{'type':Sequelize[_0x5fde('0x1')],'allowNull':![],'unique':_0x5fde('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5fde('0x3')]('friend',_0x5fde('0x4'),_0x5fde('0x5')),'allowNull':![],'defaultValue':_0x5fde('0x6')},'context':{'type':Sequelize[_0x5fde('0x1')],'allowNull':![],'defaultValue':_0x5fde('0x7')},'callingpres':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x8'),_0x5fde('0x9'),_0x5fde('0xa'),_0x5fde('0xb'),_0x5fde('0xc'),'PROHIB_PASSED_SCREEN',_0x5fde('0xd'),_0x5fde('0xe'))},'deny':{'type':Sequelize[_0x5fde('0x1')]},'permit':{'type':Sequelize[_0x5fde('0x1')]},'secret':{'type':Sequelize[_0x5fde('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x5fde('0x1')]},'transport':{'type':Sequelize[_0x5fde('0x1')],'defaultValue':_0x5fde('0xf'),'set':function(_0x55ed68){this[_0x5fde('0x10')](_0x5fde('0x11'),_0x55ed68?_0x55ed68['join'](','):null);},'get':function(){return this['getDataValue'](_0x5fde('0x11'))?this['getDataValue']('transport')[_0x5fde('0x12')](','):null;},'comment':_0x5fde('0x13')},'dtmfmode':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x14'),_0x5fde('0x15'),_0x5fde('0x16'),_0x5fde('0x17'),'auto'),'defaultValue':_0x5fde('0x14')},'directmedia':{'type':Sequelize['ENUM'](_0x5fde('0x18'),'no',_0x5fde('0x19'),_0x5fde('0x1a'),_0x5fde('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x5fde('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x5fde('0x1')]},'nat':{'type':Sequelize[_0x5fde('0x1')],'defaultValue':_0x5fde('0x1c'),'set':function(_0x5a240b){this[_0x5fde('0x10')](_0x5fde('0x1d'),_0x5a240b?_0x5a240b[_0x5fde('0x1e')](','):null);},'get':function(){return this[_0x5fde('0x1f')](_0x5fde('0x1d'))?this[_0x5fde('0x1f')](_0x5fde('0x1d'))[_0x5fde('0x12')](','):null;},'comment':_0x5fde('0x20')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x5fde('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x5fde('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x5fde('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x5fde('0x1')],'defaultValue':_0x5fde('0x21')},'allow':{'type':Sequelize[_0x5fde('0x1')],'allowNull':![],'defaultValue':_0x5fde('0x22'),'set':function(_0x5a5ab9){this[_0x5fde('0x10')](_0x5fde('0x23'),_0x5a5ab9?_0x5a5ab9[_0x5fde('0x1e')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x5fde('0x23'))?this[_0x5fde('0x1f')](_0x5fde('0x23'))[_0x5fde('0x12')](';'):null;},'comment':_0x5fde('0x24')},'autoframing':{'type':Sequelize[_0x5fde('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x5fde('0x1')],'defaultValue':_0x5fde('0x25'),'set':function(_0x38d679){this[_0x5fde('0x10')](_0x5fde('0x26'),_0x38d679?_0x38d679[_0x5fde('0x1e')](','):null);},'get':function(){return this['getDataValue'](_0x5fde('0x26'))?this[_0x5fde('0x1f')](_0x5fde('0x26'))[_0x5fde('0x12')](','):null;},'comment':_0x5fde('0x27')},'trustrpid':{'type':Sequelize[_0x5fde('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x5fde('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x5fde('0x18'),'no','never')},'promiscredir':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x18'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0x5fde('0x28')](0xb)},'setvar':{'type':Sequelize[_0x5fde('0x1')]},'callerid':{'type':Sequelize[_0x5fde('0x1')],'defaultValue':_0x5fde('0x29')},'amaflags':{'type':Sequelize[_0x5fde('0x1')]},'callcounter':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x18'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x5fde('0x1')]},'videosupport':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x18'),'no',_0x5fde('0x2a')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x18'),'no')},'mailbox':{'type':Sequelize[_0x5fde('0x1')]},'session_timers':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x2b'),_0x5fde('0x2c'),_0x5fde('0x2d'))},'session_expires':{'type':Sequelize[_0x5fde('0x28')](0xb)},'session_minse':{'type':Sequelize[_0x5fde('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x2e'),_0x5fde('0x2f')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x5fde('0x1')]},'fromuser':{'type':Sequelize[_0x5fde('0x1')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x18'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x5fde('0x1')]},'rtptimeout':{'type':Sequelize[_0x5fde('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x5fde('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x5fde('0x28')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x5fde('0x18'),'no',_0x5fde('0x30')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x5fde('0x1')]},'callbackextension':{'type':Sequelize[_0x5fde('0x1')]},'timert1':{'type':Sequelize[_0x5fde('0x28')](0xb)},'timerb':{'type':Sequelize[_0x5fde('0x28')](0xb)},'qualifyfreq':{'type':Sequelize[_0x5fde('0x28')](0xb)},'contactpermit':{'type':Sequelize[_0x5fde('0x1')]},'contactdeny':{'type':Sequelize[_0x5fde('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x5fde('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x5fde('0x28')](0xb)},'encryption':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x18'),'no')},'force_avp':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x18'),'no')},'icesupport':{'type':Sequelize[_0x5fde('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x18'),'no',_0x5fde('0x31'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x5fde('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0x5fde('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x5fde('0x1')]},'dtlscipher':{'type':Sequelize[_0x5fde('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x32'),'passive',_0x5fde('0x33')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x5fde('0x1')]},'usereqphone':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x5fde('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x18'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x5fde('0x18'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x5fde('0x1')]},'parkinglot':{'type':Sequelize[_0x5fde('0x1')]},'description':{'type':Sequelize[_0x5fde('0x1')]},'host':{'type':Sequelize[_0x5fde('0x1')],'defaultValue':_0x5fde('0x34')},'canreinvite':{'type':Sequelize[_0x5fde('0x3')](_0x5fde('0x18'),'no',_0x5fde('0x19'),_0x5fde('0x1a'),_0x5fde('0x35')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x5fde('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x5fde('0x36')],'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 d9b0171..bc1b170 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(_0x311d30,_0x317f03){var _0x3e1835=function(_0x40f6da){while(--_0x40f6da){_0x311d30['push'](_0x311d30['shift']());}};_0x3e1835(++_0x317f03);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x508685,_0x9f94af){_0x508685=_0x508685-0x0;var _0x976a76=_0xf3cd[_0x508685];return _0x976a76;};'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 _0x425d=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','userProfileId','/etc/asterisk/sip_xcally_trunks.conf','destroy','eml-format','zip-dir','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','Trunk,\x20%s,\x20%s','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','find','omit','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8'];(function(_0x155152,_0x2447a5){var _0x20c068=function(_0x4a5619){while(--_0x4a5619){_0x155152['push'](_0x155152['shift']());}};_0x20c068(++_0x2447a5);}(_0x425d,0x1e0));var _0xd425=function(_0x528fd5,_0x116c22){_0x528fd5=_0x528fd5-0x0;var _0x43f1f8=_0x425d[_0x528fd5];return _0x43f1f8;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];var jayson=require(_0xd425('0x1d'));var client=jayson[_0xd425('0x1e')][_0xd425('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x18eafb,_0x51263f,_0x27318c,_0x17a498){return new BPromise(function(_0x336dc3,_0x5d3d60){var _0x309263=_0x17a498||client;return _0x309263[_0xd425('0x20')](_0x18eafb,_0x27318c)[_0xd425('0x21')](function(_0x41f34d){logger[_0xd425('0x22')]('Trunk,\x20%s,\x20%s',_0x51263f,_0xd425('0x23'));logger[_0xd425('0x24')](_0xd425('0x25'),_0x51263f,_0xd425('0x23'),JSON['stringify'](_0x41f34d));if(_0x41f34d[_0xd425('0x26')]){if(_0x41f34d[_0xd425('0x26')][_0xd425('0x27')]===0x1f4){logger[_0xd425('0x26')]('Trunk,\x20%s,\x20%s',_0x51263f,_0x41f34d['error']['message']);return _0x5d3d60(_0x41f34d['error'][_0xd425('0x28')]);}logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x41f34d['error'][_0xd425('0x28')]);return _0x336dc3(_0x41f34d[_0xd425('0x26')]['message']);}else{logger[_0xd425('0x22')](_0xd425('0x29'),_0x51263f,_0xd425('0x23'));_0x336dc3(_0x41f34d[_0xd425('0x2a')][_0xd425('0x28')]);}})[_0xd425('0x2b')](function(_0x2480a0){logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x2480a0);_0x5d3d60(_0x2480a0);});});}function respondWithStatusCode(_0x2b030b,_0x151ad9){_0x151ad9=_0x151ad9||0xcc;return function(_0x40e84b){if(_0x40e84b){return _0x2b030b['sendStatus'](_0x151ad9);}return _0x2b030b[_0xd425('0x2c')](_0x151ad9)[_0xd425('0x2d')]();};}function respondWithResult(_0x398985,_0x1908a5){_0x1908a5=_0x1908a5||0xc8;return function(_0x2afcdb){if(_0x2afcdb){return _0x398985[_0xd425('0x2c')](_0x1908a5)[_0xd425('0x2e')](_0x2afcdb);}};}function respondWithFilteredResult(_0x577e4b,_0x12f951){return function(_0x177de2){if(_0x177de2){var _0x1d8861=typeof _0x12f951['offset']===_0xd425('0x2f')&&typeof _0x12f951[_0xd425('0x30')]===_0xd425('0x2f');var _0x999fb9=_0x177de2[_0xd425('0x31')];var _0x185d7e=_0x1d8861?0x0:_0x12f951[_0xd425('0x32')];var _0x37b63c=_0x1d8861?_0x177de2[_0xd425('0x31')]:_0x12f951[_0xd425('0x32')]+_0x12f951['limit'];var _0x471e3e;if(_0x37b63c>=_0x999fb9){_0x37b63c=_0x999fb9;_0x471e3e=0xc8;}else{_0x471e3e=0xce;}_0x577e4b[_0xd425('0x2c')](_0x471e3e);return _0x577e4b[_0xd425('0x33')](_0xd425('0x34'),_0x185d7e+'-'+_0x37b63c+'/'+_0x999fb9)[_0xd425('0x2e')](_0x177de2);}return null;};}function patchUpdates(_0x1abf33){return function(_0x47405f){try{jsonpatch[_0xd425('0x35')](_0x47405f,_0x1abf33,!![]);}catch(_0x3ec51b){return BPromise[_0xd425('0x36')](_0x3ec51b);}return _0x47405f[_0xd425('0x37')]();};}function saveUpdates(_0x5f3dab,_0x316493){return function(_0x2a2a9b){if(_0x2a2a9b){return _0x2a2a9b[_0xd425('0x38')](_0x5f3dab)[_0xd425('0x21')](function(_0x28870f){return _0x28870f;});}return null;};}function removeEntity(_0x4eddbc,_0x4aa168){return function(_0x3badcc){if(_0x3badcc){return _0x3badcc['destroy']()['then'](function(){var _0x51669d=_0x3badcc[_0xd425('0x39')]({'plain':!![]});var _0xfb0c8=_0xd425('0x3a');return db[_0xd425('0x3b')]['destroy']({'where':{'type':_0xfb0c8,'resourceId':_0x51669d['id']}})[_0xd425('0x21')](function(){return _0x3badcc;});})[_0xd425('0x21')](function(){_0x4eddbc[_0xd425('0x2c')](0xcc)[_0xd425('0x2d')]();});}};}function handleEntityNotFound(_0x27b9e2,_0x1e12f2){return function(_0x35bbec){if(!_0x35bbec){_0x27b9e2['sendStatus'](0x194);}return _0x35bbec;};}function handleError(_0x363fb0,_0x59b3d3){_0x59b3d3=_0x59b3d3||0x1f4;return function(_0x22df81){logger[_0xd425('0x26')](_0x22df81[_0xd425('0x3c')]);if(_0x22df81['name']){delete _0x22df81[_0xd425('0x3d')];}_0x363fb0[_0xd425('0x2c')](_0x59b3d3)[_0xd425('0x3e')](_0x22df81);};}exports[_0xd425('0x3f')]=function(_0x58f36d,_0x1d38fa){var _0x3cf540={},_0x59e326={},_0x5d310e={'count':0x0,'rows':[]};var _0x48fc85=_[_0xd425('0x40')](db[_0xd425('0x41')][_0xd425('0x42')],function(_0x588688){return{'name':_0x588688['fieldName'],'type':_0x588688['type'][_0xd425('0x43')]};});_0x59e326[_0xd425('0x44')]=_[_0xd425('0x40')](_0x48fc85,_0xd425('0x3d'));_0x59e326[_0xd425('0x45')]=_[_0xd425('0x46')](_0x58f36d[_0xd425('0x45')]);_0x59e326['filters']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],_0x59e326[_0xd425('0x45')]);_0x3cf540['attributes']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],qs[_0xd425('0x48')](_0x58f36d['query'][_0xd425('0x48')]));_0x3cf540[_0xd425('0x49')]=_0x3cf540[_0xd425('0x49')][_0xd425('0x4a')]?_0x3cf540['attributes']:_0x59e326[_0xd425('0x44')];if(!_0x58f36d[_0xd425('0x45')][_0xd425('0x4b')](_0xd425('0x4c'))){_0x3cf540[_0xd425('0x30')]=qs[_0xd425('0x30')](_0x58f36d[_0xd425('0x45')]['limit']);_0x3cf540[_0xd425('0x32')]=qs[_0xd425('0x32')](_0x58f36d['query'][_0xd425('0x32')]);}_0x3cf540['order']=qs['sort'](_0x58f36d[_0xd425('0x45')]['sort']);_0x3cf540[_0xd425('0x4d')]=qs['filters'](_[_0xd425('0x4e')](_0x58f36d[_0xd425('0x45')],_0x59e326[_0xd425('0x4f')]),_0x48fc85);if(_0x58f36d[_0xd425('0x45')][_0xd425('0x50')]){_0x3cf540['where']=_[_0xd425('0x51')](_0x3cf540['where'],{'$or':_[_0xd425('0x40')](_0x48fc85,function(_0x55a15d){if(_0x55a15d[_0xd425('0x52')]!==_0xd425('0x53')){var _0x3fd2ce={};_0x3fd2ce[_0x55a15d[_0xd425('0x3d')]]={'$like':'%'+_0x58f36d[_0xd425('0x45')]['filter']+'%'};return _0x3fd2ce;}})});}_0x3cf540=_[_0xd425('0x51')]({},_0x3cf540,_0x58f36d[_0xd425('0x54')]);var _0x35e77b={'where':_0x3cf540[_0xd425('0x4d')]};return db[_0xd425('0x41')]['count'](_0x35e77b)[_0xd425('0x21')](function(_0x177704){_0x5d310e[_0xd425('0x31')]=_0x177704;if(_0x58f36d[_0xd425('0x45')][_0xd425('0x55')]){_0x3cf540[_0xd425('0x56')]=[{'all':!![]}];}return db['Trunk'][_0xd425('0x57')](_0x3cf540);})[_0xd425('0x21')](function(_0x5bfac6){_0x5d310e[_0xd425('0x58')]=_0x5bfac6;return _0x5d310e;})[_0xd425('0x21')](respondWithFilteredResult(_0x1d38fa,_0x3cf540))[_0xd425('0x2b')](handleError(_0x1d38fa,null));};exports[_0xd425('0x59')]=function(_0x5c0219,_0x54f1d){var _0x2b8882={'raw':![],'where':{'id':_0x5c0219[_0xd425('0x5a')]['id']}},_0x4552cd={};_0x4552cd[_0xd425('0x44')]=_['keys'](db['Trunk'][_0xd425('0x42')]);_0x4552cd['query']=_[_0xd425('0x46')](_0x5c0219[_0xd425('0x45')]);_0x4552cd['filters']=_[_0xd425('0x47')](_0x4552cd['model'],_0x4552cd['query']);_0x2b8882[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4552cd[_0xd425('0x44')],qs[_0xd425('0x48')](_0x5c0219[_0xd425('0x45')][_0xd425('0x48')]));_0x2b8882[_0xd425('0x49')]=_0x2b8882[_0xd425('0x49')]['length']?_0x2b8882[_0xd425('0x49')]:_0x4552cd[_0xd425('0x44')];if(_0x5c0219[_0xd425('0x45')][_0xd425('0x55')]){_0x2b8882[_0xd425('0x56')]=[{'all':!![]}];}_0x2b8882=_[_0xd425('0x51')]({},_0x2b8882,_0x5c0219[_0xd425('0x54')]);return db[_0xd425('0x41')]['find'](_0x2b8882)['then'](handleEntityNotFound(_0x54f1d,null))['then'](respondWithResult(_0x54f1d,null))[_0xd425('0x2b')](handleError(_0x54f1d,null));};exports[_0xd425('0x5b')]=function(_0x3dec61,_0x3c6b49){var _0x59c286={'where':{'id':_0x3dec61['params']['id']}},_0x4fedc0={};_0x4fedc0['model']=_[_0xd425('0x46')](db[_0xd425('0x41')]['rawAttributes']);_0x59c286[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4fedc0[_0xd425('0x44')],qs['fields'](_0x3dec61['query'][_0xd425('0x48')]));_0x59c286['attributes']=_0x59c286['attributes']['length']?_0x59c286[_0xd425('0x49')]:_0x4fedc0[_0xd425('0x44')];if(_0x3dec61[_0xd425('0x45')]['includeAll']){_0x59c286[_0xd425('0x56')]=[{'all':!![]}];}_0x59c286=_['merge']({},_0x59c286,_0x3dec61[_0xd425('0x54')]);return db[_0xd425('0x41')][_0xd425('0x5c')](_0x59c286)[_0xd425('0x21')](handleEntityNotFound(_0x3c6b49,null))[_0xd425('0x21')](function(_0xd261a){if(_0xd261a){var _0xa21f7c=_0xd261a[_0xd425('0x39')]({'plain':!![]});_0xa21f7c=qs[_0xd425('0x5d')](_0xa21f7c,['id','createdAt',_0xd425('0x5e')]);_0x3dec61[_0xd425('0x5f')]=_[_0xd425('0x5d')](_0x3dec61[_0xd425('0x5f')],['id','createdAt','updatedAt']);return db[_0xd425('0x41')][_0xd425('0x60')](_[_0xd425('0x51')](_0xa21f7c,_0x3dec61[_0xd425('0x5f')]),{'include':_0x3dec61[_0xd425('0x45')][_0xd425('0x55')]?[{'all':!![]}]:undefined})[_0xd425('0x21')](function(_0x44782a){var _0x1fcde4=_0x3dec61[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x1fcde4)throw new Error(_0xd425('0x62'));if(_0x1fcde4[_0xd425('0x63')]===_0xd425('0x61')){var _0x5e72db=_0x44782a[_0xd425('0x39')]({'plain':!![]});var _0x343cc1=_0xd425('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x343cc1,'userProfileId':_0x1fcde4['userProfileId']},'raw':!![]})[_0xd425('0x21')](function(_0x34d065){if(_0x34d065&&_0x34d065[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x5e72db['name'],'resourceId':_0x5e72db['id'],'type':_0x34d065[_0xd425('0x3d')],'sectionId':_0x34d065['id']},{})[_0xd425('0x21')](function(){return _0x44782a;});}else{return _0x44782a;}})[_0xd425('0x2b')](function(_0x5113fc){logger[_0xd425('0x26')](_0xd425('0x65'),_0x5113fc);throw _0x5113fc;});}return _0x44782a;});}})[_0xd425('0x21')](respondWithResult(_0x3c6b49,0xc9))[_0xd425('0x2b')](handleError(_0x3c6b49,null));};exports[_0xd425('0x60')]=function(_0x43b1a9,_0x38a762,_0x44db7f){var _0xcb1a64;return db[_0xd425('0x41')][_0xd425('0x60')](_0x43b1a9[_0xd425('0x5f')],{'raw':!![]})[_0xd425('0x21')](function(_0x285d54){_0xcb1a64=_0x285d54;return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})[_0xd425('0x21')](function(_0x25cae6){var _0x541218=fs['readFileSync'](path[_0xd425('0x66')](config['root'],_0xd425('0x67')),_0xd425('0x68'));var _0xb407bb=fs[_0xd425('0x69')](path['join'](config[_0xd425('0x6a')],_0xd425('0x6b')),_0xd425('0x68'));var _0x689332=ejs[_0xd425('0x6c')](_0x541218,{'trunks':_0x25cae6||[]});fs[_0xd425('0x6d')]('/etc/asterisk/sip_xcally_trunks.conf',_0x689332);if(_0xcb1a64['registry']){var _0x3ccffe=ejs[_0xd425('0x6c')](_0xb407bb,{'trunks':_0x25cae6||[]});fs['writeFileSync'](_0xd425('0x6e'),_0x3ccffe);}})['then'](function(){return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x60'),{'module':_0xd425('0x70')});})[_0xd425('0x21')](function(){var _0x376134=_0x43b1a9[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x376134)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x376134[_0xd425('0x63')]===_0xd425('0x61')){var _0x24af3=_0xcb1a64[_0xd425('0x39')]({'plain':!![]});return db[_0xd425('0x71')]['find']({'where':{'name':_0xd425('0x3a'),'userProfileId':_0x376134[_0xd425('0x72')]},'raw':!![]})['then'](function(_0x2bb36f){if(_0x2bb36f&&_0x2bb36f[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x24af3[_0xd425('0x3d')],'resourceId':_0x24af3['id'],'type':_0x2bb36f[_0xd425('0x3d')],'sectionId':_0x2bb36f['id']},{})[_0xd425('0x21')](function(){return _0xcb1a64;});}else{return _0xcb1a64;}})[_0xd425('0x2b')](function(_0x572f23){logger[_0xd425('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x572f23);throw _0x572f23;});}return _0xcb1a64;})[_0xd425('0x21')](respondWithResult(_0x38a762,0xc9))[_0xd425('0x2b')](handleError(_0x38a762,null));};exports['update']=function(_0x2bf8e6,_0xcf7b51,_0x66d87b){var _0x1fc64d;return db['Trunk']['find']({'where':{'id':_0x2bf8e6[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0xcf7b51,null))[_0xd425('0x21')](saveUpdates(_0x2bf8e6['body'],null))[_0xd425('0x21')](function(_0xb1479e){if(_0xb1479e){_0x1fc64d=_0xb1479e;return db['Trunk'][_0xd425('0x57')]({'raw':!![]});}})['then'](function(_0x998ad1){if(_0x998ad1){var _0x46346c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config['root'],'server/files/templates/trunk.ejs'),_0xd425('0x68'));var _0x413a65=fs['readFileSync'](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x369f8b=ejs[_0xd425('0x6c')](_0x46346c,{'trunks':_0x998ad1||[]});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x369f8b);var _0xf251e6=ejs[_0xd425('0x6c')](_0x413a65,{'trunks':_0x998ad1||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0xf251e6);return respondWithRpcPromise(_0xd425('0x6f'),'update',{'module':_0xd425('0x70')});}return null;})[_0xd425('0x21')](function(_0x58cad5){if(_0x58cad5){return _0x1fc64d;}})[_0xd425('0x21')](respondWithResult(_0xcf7b51,null))[_0xd425('0x2b')](handleError(_0xcf7b51,null));};exports['destroy']=function(_0x592c40,_0x750685,_0x242ed8){var _0x16eac6;return db[_0xd425('0x41')][_0xd425('0x5c')]({'where':{'id':_0x592c40[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0x750685,null))[_0xd425('0x21')](removeEntity(_0x750685,null))['then'](function(){return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})['then'](function(_0x2bbcf3){var _0x1d386c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],_0xd425('0x67')),_0xd425('0x68'));var _0x2c3995=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x498e81=ejs['render'](_0x1d386c,{'trunks':_0x2bbcf3});var _0x2c8d63=ejs['render'](_0x2c3995,{'trunks':_0x2bbcf3});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x498e81);fs[_0xd425('0x6d')](_0xd425('0x6e'),_0x2c8d63);return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x74'),{'module':_0xd425('0x70')});})['catch'](handleError(_0x750685,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index ecbee15..b9c9169 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 _0x0b00=['api','moment','request-promise','../../config/environment','exports','define','Trunk','tools_trunks','lodash','util'];(function(_0x2cb321,_0x4966fe){var _0x24c609=function(_0x4ed75d){while(--_0x4ed75d){_0x2cb321['push'](_0x2cb321['shift']());}};_0x24c609(++_0x4966fe);}(_0x0b00,0x6c));var _0x00b0=function(_0x3c6279,_0x393d20){_0x3c6279=_0x3c6279-0x0;var _0x337973=_0x0b00[_0x3c6279];return _0x337973;};'use strict';var _=require(_0x00b0('0x0'));var util=require(_0x00b0('0x1'));var logger=require('../../config/logger')(_0x00b0('0x2'));var moment=require(_0x00b0('0x3'));var BPromise=require('bluebird');var rp=require(_0x00b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x00b0('0x5'));var attributes=require('./trunk.attributes');module[_0x00b0('0x6')]=function(_0x25ac1b,_0x160624){return _0x25ac1b[_0x00b0('0x7')](_0x00b0('0x8'),attributes,{'tableName':_0x00b0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xccfe=['../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','util','api','moment','bluebird','rimraf'];(function(_0x306013,_0x4859ff){var _0x27b2b8=function(_0x348701){while(--_0x348701){_0x306013['push'](_0x306013['shift']());}};_0x27b2b8(++_0x4859ff);}(_0xccfe,0xaf));var _0xeccf=function(_0x4a6a4c,_0x1649a6){_0x4a6a4c=_0x4a6a4c-0x0;var _0x368eaa=_0xccfe[_0x4a6a4c];return _0x368eaa;};'use strict';var _=require('lodash');var util=require(_0xeccf('0x0'));var logger=require('../../config/logger')(_0xeccf('0x1'));var moment=require(_0xeccf('0x2'));var BPromise=require(_0xeccf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeccf('0x4'));var config=require(_0xeccf('0x5'));var attributes=require(_0xeccf('0x6'));module[_0xeccf('0x7')]=function(_0x5e3129,_0x3828b7){return _0x5e3129['define'](_0xeccf('0x8'),attributes,{'tableName':_0xeccf('0x9'),'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 7e03f09..30dbd31 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 _0x754d=['debug','ShowTrunk','find','raw','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','catch','GetTrunk','Trunk','findAll','options','attributes','limit','model','include','map'];(function(_0x575057,_0x14baf3){var _0x49dbc8=function(_0x23599a){while(--_0x23599a){_0x575057['push'](_0x575057['shift']());}};_0x49dbc8(++_0x14baf3);}(_0x754d,0x1d9));var _0xd754=function(_0x2b5da0,_0x501e39){_0x2b5da0=_0x2b5da0-0x0;var _0x29d59d=_0x754d[_0x2b5da0];return _0x29d59d;};'use strict';var _=require(_0xd754('0x0'));var util=require('util');var moment=require(_0xd754('0x1'));var BPromise=require('bluebird');var rs=require(_0xd754('0x2'));var fs=require('fs');var Redis=require(_0xd754('0x3'));var db=require(_0xd754('0x4'))['db'];var utils=require(_0xd754('0x5'));var logger=require(_0xd754('0x6'))(_0xd754('0x7'));var config=require(_0xd754('0x8'));var jayson=require(_0xd754('0x9'));var client=jayson['client'][_0xd754('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xea32e7,_0x4c577a,_0xb8356e){return new BPromise(function(_0x237ea6,_0x287b19){return client[_0xd754('0xb')](_0xea32e7,_0xb8356e)[_0xd754('0xc')](function(_0x542931){logger[_0xd754('0xd')]('Trunk,\x20%s,\x20%s',_0x4c577a,_0xd754('0xe'));logger['debug'](_0xd754('0xf'),_0x4c577a,_0xd754('0xe'),JSON[_0xd754('0x10')](_0x542931));if(_0x542931['error']){if(_0x542931[_0xd754('0x11')][_0xd754('0x12')]===0x1f4){logger[_0xd754('0x11')]('Trunk,\x20%s,\x20%s',_0x4c577a,_0x542931['error']['message']);return _0x287b19(_0x542931[_0xd754('0x11')][_0xd754('0x13')]);}logger[_0xd754('0x11')](_0xd754('0x14'),_0x4c577a,_0x542931['error'][_0xd754('0x13')]);return _0x237ea6(_0x542931[_0xd754('0x11')][_0xd754('0x13')]);}else{logger['info'](_0xd754('0x14'),_0x4c577a,_0xd754('0xe'));_0x237ea6(_0x542931['result'][_0xd754('0x13')]);}})[_0xd754('0x15')](function(_0x35d4a7){logger['error'](_0xd754('0x14'),_0x4c577a,_0x35d4a7);_0x287b19(_0x35d4a7);});});}exports[_0xd754('0x16')]=function(_0x4b337d){var _0x4d1c51=this;return new Promise(function(_0xc08152,_0x5269b6){return db[_0xd754('0x17')][_0xd754('0x18')]({'raw':_0x4b337d[_0xd754('0x19')]?_0x4b337d['options']['raw']===undefined?!![]:![]:!![],'where':_0x4b337d[_0xd754('0x19')]?_0x4b337d[_0xd754('0x19')]['where']||null:null,'attributes':_0x4b337d[_0xd754('0x19')]?_0x4b337d[_0xd754('0x19')][_0xd754('0x1a')]||null:null,'limit':_0x4b337d[_0xd754('0x19')]?_0x4b337d['options'][_0xd754('0x1b')]||null:null,'include':_0x4b337d[_0xd754('0x19')]?_0x4b337d[_0xd754('0x19')]['include']?_['map'](_0x4b337d[_0xd754('0x19')]['include'],function(_0x21ce55){return{'model':db[_0x21ce55[_0xd754('0x1c')]],'as':_0x21ce55['as'],'attributes':_0x21ce55[_0xd754('0x1a')],'include':_0x21ce55[_0xd754('0x1d')]?_[_0xd754('0x1e')](_0x21ce55[_0xd754('0x1d')],function(_0xf7e882){return{'model':db[_0xf7e882[_0xd754('0x1c')]],'as':_0xf7e882['as'],'attributes':_0xf7e882[_0xd754('0x1a')],'include':_0xf7e882[_0xd754('0x1d')]?_[_0xd754('0x1e')](_0xf7e882['include'],function(_0xb4f8cc){return{'model':db[_0xb4f8cc[_0xd754('0x1c')]],'as':_0xb4f8cc['as'],'attributes':_0xb4f8cc[_0xd754('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd754('0xc')](function(_0x4301f2){logger[_0xd754('0xd')](_0xd754('0x16'),_0x4b337d);logger[_0xd754('0x1f')]('GetTrunk',_0x4b337d,JSON['stringify'](_0x4301f2));_0xc08152(_0x4301f2);})[_0xd754('0x15')](function(_0x56d960){logger['error'](_0xd754('0x16'),_0x56d960[_0xd754('0x13')],_0x4b337d);_0x5269b6(_0x4d1c51[_0xd754('0x11')](0x1f4,_0x56d960[_0xd754('0x13')]));});});};exports[_0xd754('0x20')]=function(_0x24a7d7){var _0x17f985=this;return new Promise(function(_0x216868,_0x1d4ac6){return db['Trunk'][_0xd754('0x21')]({'raw':_0x24a7d7['options']?_0x24a7d7['options'][_0xd754('0x22')]===undefined?!![]:![]:!![],'where':_0x24a7d7['options']?_0x24a7d7[_0xd754('0x19')][_0xd754('0x23')]||null:null,'attributes':_0x24a7d7['options']?_0x24a7d7[_0xd754('0x19')][_0xd754('0x1a')]||null:null,'include':_0x24a7d7['options']?_0x24a7d7[_0xd754('0x19')]['include']?_[_0xd754('0x1e')](_0x24a7d7[_0xd754('0x19')][_0xd754('0x1d')],function(_0x5c4ed1){return{'model':db[_0x5c4ed1[_0xd754('0x1c')]],'as':_0x5c4ed1['as'],'attributes':_0x5c4ed1[_0xd754('0x1a')],'include':_0x5c4ed1['include']?_[_0xd754('0x1e')](_0x5c4ed1[_0xd754('0x1d')],function(_0x4ea7ff){return{'model':db[_0x4ea7ff['model']],'as':_0x4ea7ff['as'],'attributes':_0x4ea7ff['attributes'],'include':_0x4ea7ff[_0xd754('0x1d')]?_[_0xd754('0x1e')](_0x4ea7ff[_0xd754('0x1d')],function(_0x194a24){return{'model':db[_0x194a24[_0xd754('0x1c')]],'as':_0x194a24['as'],'attributes':_0x194a24['attributes']};}):[]};}):[]};}):[]:[]})[_0xd754('0xc')](function(_0x586695){logger[_0xd754('0xd')]('ShowTrunk',_0x24a7d7);logger[_0xd754('0x1f')]('ShowTrunk',_0x24a7d7,JSON['stringify'](_0x586695));_0x216868(_0x586695);})['catch'](function(_0x1343bf){logger[_0xd754('0x11')](_0xd754('0x20'),_0x1343bf[_0xd754('0x13')],_0x24a7d7);_0x1d4ac6(_0x17f985[_0xd754('0x11')](0x1f4,_0x1343bf[_0xd754('0x13')]));});});}; \ No newline at end of file +var _0xf1a6=['code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrunk','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x39b3a9,_0x2dad1d){var _0x81ab07=function(_0x2af7e8){while(--_0x2af7e8){_0x39b3a9['push'](_0x39b3a9['shift']());}};_0x81ab07(++_0x2dad1d);}(_0xf1a6,0x122));var _0x6f1a=function(_0x1d2c54,_0x3fa65e){_0x1d2c54=_0x1d2c54-0x0;var _0x21cbc2=_0xf1a6[_0x1d2c54];return _0x21cbc2;};'use strict';var _=require(_0x6f1a('0x0'));var util=require(_0x6f1a('0x1'));var moment=require(_0x6f1a('0x2'));var BPromise=require('bluebird');var rs=require(_0x6f1a('0x3'));var fs=require('fs');var Redis=require(_0x6f1a('0x4'));var db=require(_0x6f1a('0x5'))['db'];var utils=require(_0x6f1a('0x6'));var logger=require(_0x6f1a('0x7'))(_0x6f1a('0x8'));var config=require(_0x6f1a('0x9'));var jayson=require(_0x6f1a('0xa'));var client=jayson[_0x6f1a('0xb')][_0x6f1a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1607d8,_0x55d44c,_0x5b18ed){return new BPromise(function(_0x34c4ca,_0x555171){return client[_0x6f1a('0xd')](_0x1607d8,_0x5b18ed)[_0x6f1a('0xe')](function(_0x427474){logger[_0x6f1a('0xf')](_0x6f1a('0x10'),_0x55d44c,_0x6f1a('0x11'));logger[_0x6f1a('0x12')](_0x6f1a('0x13'),_0x55d44c,_0x6f1a('0x11'),JSON[_0x6f1a('0x14')](_0x427474));if(_0x427474[_0x6f1a('0x15')]){if(_0x427474['error'][_0x6f1a('0x16')]===0x1f4){logger[_0x6f1a('0x15')](_0x6f1a('0x10'),_0x55d44c,_0x427474['error'][_0x6f1a('0x17')]);return _0x555171(_0x427474['error'][_0x6f1a('0x17')]);}logger[_0x6f1a('0x15')](_0x6f1a('0x10'),_0x55d44c,_0x427474['error'][_0x6f1a('0x17')]);return _0x34c4ca(_0x427474[_0x6f1a('0x15')][_0x6f1a('0x17')]);}else{logger[_0x6f1a('0xf')](_0x6f1a('0x10'),_0x55d44c,_0x6f1a('0x11'));_0x34c4ca(_0x427474[_0x6f1a('0x18')][_0x6f1a('0x17')]);}})[_0x6f1a('0x19')](function(_0x3d972a){logger[_0x6f1a('0x15')](_0x6f1a('0x10'),_0x55d44c,_0x3d972a);_0x555171(_0x3d972a);});});}exports[_0x6f1a('0x1a')]=function(_0x3417ff){var _0x5ad1c3=this;return new Promise(function(_0xca3845,_0x1e8a72){return db[_0x6f1a('0x1b')][_0x6f1a('0x1c')]({'raw':_0x3417ff[_0x6f1a('0x1d')]?_0x3417ff[_0x6f1a('0x1d')][_0x6f1a('0x1e')]===undefined?!![]:![]:!![],'where':_0x3417ff['options']?_0x3417ff[_0x6f1a('0x1d')][_0x6f1a('0x1f')]||null:null,'attributes':_0x3417ff[_0x6f1a('0x1d')]?_0x3417ff['options'][_0x6f1a('0x20')]||null:null,'limit':_0x3417ff[_0x6f1a('0x1d')]?_0x3417ff[_0x6f1a('0x1d')][_0x6f1a('0x21')]||null:null,'include':_0x3417ff[_0x6f1a('0x1d')]?_0x3417ff[_0x6f1a('0x1d')][_0x6f1a('0x22')]?_[_0x6f1a('0x23')](_0x3417ff[_0x6f1a('0x1d')][_0x6f1a('0x22')],function(_0x610835){return{'model':db[_0x610835[_0x6f1a('0x24')]],'as':_0x610835['as'],'attributes':_0x610835[_0x6f1a('0x20')],'include':_0x610835['include']?_[_0x6f1a('0x23')](_0x610835[_0x6f1a('0x22')],function(_0x4374e8){return{'model':db[_0x4374e8[_0x6f1a('0x24')]],'as':_0x4374e8['as'],'attributes':_0x4374e8[_0x6f1a('0x20')],'include':_0x4374e8[_0x6f1a('0x22')]?_['map'](_0x4374e8[_0x6f1a('0x22')],function(_0x52efdf){return{'model':db[_0x52efdf[_0x6f1a('0x24')]],'as':_0x52efdf['as'],'attributes':_0x52efdf[_0x6f1a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6f1a('0xe')](function(_0x593b27){logger[_0x6f1a('0xf')](_0x6f1a('0x1a'),_0x3417ff);logger['debug']('GetTrunk',_0x3417ff,JSON[_0x6f1a('0x14')](_0x593b27));_0xca3845(_0x593b27);})['catch'](function(_0xdbc184){logger[_0x6f1a('0x15')](_0x6f1a('0x1a'),_0xdbc184[_0x6f1a('0x17')],_0x3417ff);_0x1e8a72(_0x5ad1c3['error'](0x1f4,_0xdbc184[_0x6f1a('0x17')]));});});};exports[_0x6f1a('0x25')]=function(_0x3654d0){var _0x5d4f07=this;return new Promise(function(_0x111c91,_0xd727b4){return db[_0x6f1a('0x1b')][_0x6f1a('0x26')]({'raw':_0x3654d0[_0x6f1a('0x1d')]?_0x3654d0[_0x6f1a('0x1d')][_0x6f1a('0x1e')]===undefined?!![]:![]:!![],'where':_0x3654d0['options']?_0x3654d0[_0x6f1a('0x1d')]['where']||null:null,'attributes':_0x3654d0[_0x6f1a('0x1d')]?_0x3654d0[_0x6f1a('0x1d')][_0x6f1a('0x20')]||null:null,'include':_0x3654d0['options']?_0x3654d0['options'][_0x6f1a('0x22')]?_[_0x6f1a('0x23')](_0x3654d0['options']['include'],function(_0x48e41b){return{'model':db[_0x48e41b[_0x6f1a('0x24')]],'as':_0x48e41b['as'],'attributes':_0x48e41b['attributes'],'include':_0x48e41b[_0x6f1a('0x22')]?_['map'](_0x48e41b['include'],function(_0x555e73){return{'model':db[_0x555e73[_0x6f1a('0x24')]],'as':_0x555e73['as'],'attributes':_0x555e73[_0x6f1a('0x20')],'include':_0x555e73[_0x6f1a('0x22')]?_[_0x6f1a('0x23')](_0x555e73[_0x6f1a('0x22')],function(_0x38d817){return{'model':db[_0x38d817[_0x6f1a('0x24')]],'as':_0x38d817['as'],'attributes':_0x38d817[_0x6f1a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6f1a('0xe')](function(_0x4b735a){logger[_0x6f1a('0xf')](_0x6f1a('0x25'),_0x3654d0);logger[_0x6f1a('0x12')](_0x6f1a('0x25'),_0x3654d0,JSON[_0x6f1a('0x14')](_0x4b735a));_0x111c91(_0x4b735a);})[_0x6f1a('0x19')](function(_0x1a06e3){logger[_0x6f1a('0x15')](_0x6f1a('0x25'),_0x1a06e3['message'],_0x3654d0);_0xd727b4(_0x5d4f07[_0x6f1a('0x15')](0x1f4,_0x1a06e3[_0x6f1a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index ff8f905..4ffa277 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 _0x6be7=['/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','post','/:id/contacts','addContacts','create','bulkCreate','addQueues','diskStorage','join','root','format','%s-%s','originalname','single','file','addAvatar','/:id/login','/:id/logout','logout','pause','/:id/unpause','/:id/teams','addTeams','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addMailAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','/:id/password','changePassword','removeQueues','delete','removeTeams','/:id','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','/:id/sms_accounts','removeSmsAccounts','removeChatWebsites','exports','multer','util','path','connect-timeout','fs-extra','../../config/environment','./user.controller','get','index','/describe','isAuthenticated','describe','/whoami','whoami','/presence','show','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','/:id/recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x6be7,0x1f1));var _0x76be=function(_0x4d7404,_0xe5a475){_0x4d7404=_0x4d7404-0x0;var _0x1ae9c9=_0x6be7[_0x4d7404];return _0x1ae9c9;};'use strict';var multer=require(_0x76be('0x0'));var util=require(_0x76be('0x1'));var path=require(_0x76be('0x2'));var timeout=require(_0x76be('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x76be('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x76be('0x5'));var controller=require(_0x76be('0x6'));router[_0x76be('0x7')]('/',auth['isAuthenticated'](),controller[_0x76be('0x8')]);router[_0x76be('0x7')](_0x76be('0x9'),auth[_0x76be('0xa')](),controller[_0x76be('0xb')]);router[_0x76be('0x7')](_0x76be('0xc'),auth[_0x76be('0xa')](),controller[_0x76be('0xd')]);router[_0x76be('0x7')](_0x76be('0xe'),auth[_0x76be('0xa')](),controller['getPresence']);router[_0x76be('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x76be('0xf')]);router[_0x76be('0x7')](_0x76be('0x10'),controller['getAvatar']);router['get'](_0x76be('0x11'),auth[_0x76be('0xa')](),controller[_0x76be('0x12')]);router[_0x76be('0x7')]('/:id/contacts',auth[_0x76be('0xa')](),controller['getContacts']);router[_0x76be('0x7')](_0x76be('0x13'),auth[_0x76be('0xa')](),controller[_0x76be('0x14')]);router['get'](_0x76be('0x15'),auth[_0x76be('0xa')](),controller['getVoiceQueuesRt']);router['get'](_0x76be('0x16'),auth[_0x76be('0xa')](),controller['getGroups']);router['get'](_0x76be('0x17'),auth[_0x76be('0xa')](),controller['getRecordings']);router[_0x76be('0x7')]('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0x76be('0x18')]);router[_0x76be('0x7')]('/:id/chat/interactions',auth[_0x76be('0xa')](),controller[_0x76be('0x19')]);router['get'](_0x76be('0x1a'),auth['isAuthenticated'](),controller[_0x76be('0x1b')]);router[_0x76be('0x7')](_0x76be('0x1c'),auth[_0x76be('0xa')](),controller[_0x76be('0x1d')]);router['get'](_0x76be('0x1e'),auth['isAuthenticated'](),controller[_0x76be('0x1f')]);router[_0x76be('0x7')]('/:id/fax/interactions',auth[_0x76be('0xa')](),controller[_0x76be('0x20')]);router['get'](_0x76be('0x21'),auth[_0x76be('0xa')](),controller['getWhatsappInteractions']);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x76be('0x22')]);router['get'](_0x76be('0x23'),auth[_0x76be('0xa')](),controller[_0x76be('0x24')]);router[_0x76be('0x7')](_0x76be('0x25'),auth[_0x76be('0xa')](),controller[_0x76be('0x26')]);router[_0x76be('0x7')]('/:id/prefixes',auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0x76be('0x7')](_0x76be('0x27'),auth[_0x76be('0xa')](),controller[_0x76be('0x28')]);router[_0x76be('0x7')](_0x76be('0x29'),auth[_0x76be('0xa')](),controller[_0x76be('0x2a')]);router['get'](_0x76be('0x2b'),auth[_0x76be('0xa')](),controller['getOpenchannelAccounts']);router[_0x76be('0x7')]('/:id/sms_accounts',auth['isAuthenticated'](),controller['getSmsAccounts']);router['get'](_0x76be('0x2c'),auth[_0x76be('0xa')](),controller[_0x76be('0x2d')]);router[_0x76be('0x7')](_0x76be('0x2e'),auth[_0x76be('0xa')](),controller[_0x76be('0x2f')]);router['get'](_0x76be('0x30'),auth[_0x76be('0xa')](),controller[_0x76be('0x31')]);router['get']('/:id/scheduled_calls',auth[_0x76be('0xa')](),controller[_0x76be('0x32')]);router[_0x76be('0x7')](_0x76be('0x33'),auth[_0x76be('0xa')](),controller[_0x76be('0x34')]);router[_0x76be('0x35')](_0x76be('0x36'),auth[_0x76be('0xa')](),controller[_0x76be('0x37')]);router['post']('/',auth[_0x76be('0xa')](),controller[_0x76be('0x38')]);router[_0x76be('0x35')]('/create_many',auth[_0x76be('0xa')](),controller[_0x76be('0x39')]);router[_0x76be('0x35')]('/:id/queues',auth['isAuthenticated'](),controller[_0x76be('0x3a')]);var upload=multer({'storage':multer[_0x76be('0x3b')]({'destination':function(_0x2415a1,_0x1d3e56,_0x4c8e9b){_0x4c8e9b(null,path[_0x76be('0x3c')](config[_0x76be('0x3d')],'server/files/images/'));},'filename':function(_0x199da3,_0x57f6ad,_0x21b4d7){_0x21b4d7(null,util[_0x76be('0x3e')](_0x76be('0x3f'),Date['now'](),_0x57f6ad[_0x76be('0x40')]));}})});router['post'](_0x76be('0x10'),upload[_0x76be('0x41')](_0x76be('0x42')),controller[_0x76be('0x43')]);router['post'](_0x76be('0x44'),auth[_0x76be('0xa')](),controller['login']);router[_0x76be('0x35')](_0x76be('0x45'),auth[_0x76be('0xa')](),controller[_0x76be('0x46')]);router[_0x76be('0x35')]('/:id/pause',auth['isAuthenticated'](),controller[_0x76be('0x47')]);router[_0x76be('0x35')](_0x76be('0x48'),auth[_0x76be('0xa')](),controller['unpause']);router[_0x76be('0x35')](_0x76be('0x49'),auth[_0x76be('0xa')](),controller[_0x76be('0x4a')]);router[_0x76be('0x35')]('/:id/chat_interactions',auth[_0x76be('0xa')](),controller['addChatInteractions']);router[_0x76be('0x35')](_0x76be('0x4b'),auth[_0x76be('0xa')](),controller[_0x76be('0x4c')]);router[_0x76be('0x35')](_0x76be('0x4d'),auth[_0x76be('0xa')](),controller[_0x76be('0x4e')]);router[_0x76be('0x35')](_0x76be('0x4f'),auth[_0x76be('0xa')](),controller[_0x76be('0x50')]);router[_0x76be('0x35')](_0x76be('0x51'),auth[_0x76be('0xa')](),controller[_0x76be('0x52')]);router[_0x76be('0x35')]('/:id/whatsapp_interactions',auth[_0x76be('0xa')](),controller[_0x76be('0x53')]);router['post'](_0x76be('0x27'),auth['isAuthenticated'](),controller['addFaxAccounts']);router['post'](_0x76be('0x29'),auth[_0x76be('0xa')](),controller[_0x76be('0x54')]);router[_0x76be('0x35')](_0x76be('0x2b'),auth[_0x76be('0xa')](),controller['addOpenchannelAccounts']);router['post']('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x76be('0x55')]);router[_0x76be('0x35')](_0x76be('0x2c'),auth[_0x76be('0xa')](),controller[_0x76be('0x56')]);router[_0x76be('0x35')](_0x76be('0x2e'),auth[_0x76be('0xa')](),controller[_0x76be('0x57')]);router[_0x76be('0x35')](_0x76be('0x30'),auth[_0x76be('0xa')](),controller[_0x76be('0x58')]);router[_0x76be('0x35')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x76be('0x59')]);router[_0x76be('0x5a')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x76be('0x5a')](_0x76be('0x5b'),auth[_0x76be('0xa')](),controller[_0x76be('0x5c')]);router['delete'](_0x76be('0x13'),auth[_0x76be('0xa')](),controller[_0x76be('0x5d')]);router[_0x76be('0x5e')](_0x76be('0x49'),auth['isAuthenticated'](),controller[_0x76be('0x5f')]);router[_0x76be('0x5e')](_0x76be('0x60'),auth[_0x76be('0xa')](),controller['destroy']);router[_0x76be('0x5e')]('/:id/chat_interactions',auth['isAuthenticated'](),controller['removeChatInteractions']);router['delete'](_0x76be('0x4b'),auth[_0x76be('0xa')](),controller[_0x76be('0x61')]);router[_0x76be('0x5e')](_0x76be('0x4d'),auth[_0x76be('0xa')](),controller[_0x76be('0x62')]);router[_0x76be('0x5e')](_0x76be('0x4f'),auth[_0x76be('0xa')](),controller[_0x76be('0x63')]);router[_0x76be('0x5e')]('/:id/openchannel_interactions',auth[_0x76be('0xa')](),controller[_0x76be('0x64')]);router[_0x76be('0x5e')](_0x76be('0x65'),auth[_0x76be('0xa')](),controller[_0x76be('0x66')]);router['delete'](_0x76be('0x27'),auth['isAuthenticated'](),controller[_0x76be('0x67')]);router[_0x76be('0x5e')]('/:id/mail_accounts',auth[_0x76be('0xa')](),controller['removeMailAccounts']);router[_0x76be('0x5e')](_0x76be('0x2b'),auth['isAuthenticated'](),controller[_0x76be('0x68')]);router[_0x76be('0x5e')](_0x76be('0x69'),auth[_0x76be('0xa')](),controller[_0x76be('0x6a')]);router[_0x76be('0x5e')](_0x76be('0x2c'),auth['isAuthenticated'](),controller[_0x76be('0x6b')]);router['delete'](_0x76be('0x2e'),auth[_0x76be('0xa')](),controller['removeWhatsappAccounts']);router[_0x76be('0x5e')](_0x76be('0x30'),auth['isAuthenticated'](),controller['removeSquareProjects']);router['delete']('/:id/api_key',auth[_0x76be('0xa')](),controller['removeApiKey']);module[_0x76be('0x6c')]=router; \ No newline at end of file +var _0x5983=['put','/:id/password','changePassword','removeQueues','delete','removeTeams','destroy','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','/:id/api_key','removeApiKey','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/whoami','whoami','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getApiKey','/:id/contacts','addContacts','create','post','/create_many','bulkCreate','addQueues','diskStorage','join','server/files/images/','format','%s-%s','addAvatar','/:id/login','/:id/logout','logout','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','createApiKey'];(function(_0x2cda75,_0x151437){var _0x45b7e5=function(_0x1f6265){while(--_0x1f6265){_0x2cda75['push'](_0x2cda75['shift']());}};_0x45b7e5(++_0x151437);}(_0x5983,0x83));var _0x3598=function(_0xd0ee8c,_0x29087d){_0xd0ee8c=_0xd0ee8c-0x0;var _0xdcf0e1=_0x5983[_0xd0ee8c];return _0xdcf0e1;};'use strict';var multer=require(_0x3598('0x0'));var util=require(_0x3598('0x1'));var path=require(_0x3598('0x2'));var timeout=require(_0x3598('0x3'));var express=require(_0x3598('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3598('0x5'));var config=require(_0x3598('0x6'));var controller=require('./user.controller');router[_0x3598('0x7')]('/',auth[_0x3598('0x8')](),controller[_0x3598('0x9')]);router[_0x3598('0x7')](_0x3598('0xa'),auth[_0x3598('0x8')](),controller[_0x3598('0xb')]);router[_0x3598('0x7')](_0x3598('0xc'),auth[_0x3598('0x8')](),controller[_0x3598('0xd')]);router['get']('/presence',auth[_0x3598('0x8')](),controller[_0x3598('0xe')]);router['get'](_0x3598('0xf'),auth[_0x3598('0x8')](),controller[_0x3598('0x10')]);router[_0x3598('0x7')](_0x3598('0x11'),controller[_0x3598('0x12')]);router[_0x3598('0x7')](_0x3598('0x13'),auth[_0x3598('0x8')](),controller[_0x3598('0x14')]);router[_0x3598('0x7')]('/:id/contacts',auth[_0x3598('0x8')](),controller['getContacts']);router['get'](_0x3598('0x15'),auth[_0x3598('0x8')](),controller[_0x3598('0x16')]);router[_0x3598('0x7')](_0x3598('0x17'),auth[_0x3598('0x8')](),controller[_0x3598('0x18')]);router[_0x3598('0x7')](_0x3598('0x19'),auth['isAuthenticated'](),controller[_0x3598('0x1a')]);router['get'](_0x3598('0x1b'),auth['isAuthenticated'](),controller[_0x3598('0x1c')]);router[_0x3598('0x7')]('/:id/screen_recordings',auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0x3598('0x7')]('/:id/chat/interactions',auth[_0x3598('0x8')](),controller[_0x3598('0x1d')]);router[_0x3598('0x7')](_0x3598('0x1e'),auth[_0x3598('0x8')](),controller['getOpenchannelInteractions']);router['get'](_0x3598('0x1f'),auth[_0x3598('0x8')](),controller[_0x3598('0x20')]);router[_0x3598('0x7')](_0x3598('0x21'),auth[_0x3598('0x8')](),controller['getSmsInteractions']);router['get'](_0x3598('0x22'),auth[_0x3598('0x8')](),controller[_0x3598('0x23')]);router[_0x3598('0x7')](_0x3598('0x24'),auth[_0x3598('0x8')](),controller[_0x3598('0x25')]);router[_0x3598('0x7')](_0x3598('0x26'),auth[_0x3598('0x8')](),controller[_0x3598('0x27')]);router['get'](_0x3598('0x28'),auth[_0x3598('0x8')](),controller['getLists']);router['get'](_0x3598('0x29'),auth[_0x3598('0x8')](),controller[_0x3598('0x2a')]);router[_0x3598('0x7')](_0x3598('0x2b'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router['get']('/:id/fax_accounts',auth[_0x3598('0x8')](),controller[_0x3598('0x2c')]);router[_0x3598('0x7')](_0x3598('0x2d'),auth[_0x3598('0x8')](),controller['getMailAccounts']);router[_0x3598('0x7')](_0x3598('0x2e'),auth['isAuthenticated'](),controller[_0x3598('0x2f')]);router[_0x3598('0x7')](_0x3598('0x30'),auth[_0x3598('0x8')](),controller[_0x3598('0x31')]);router['get'](_0x3598('0x32'),auth['isAuthenticated'](),controller[_0x3598('0x33')]);router['get']('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x3598('0x34')]);router[_0x3598('0x7')](_0x3598('0x35'),auth['isAuthenticated'](),controller['getSquareProjects']);router['get'](_0x3598('0x36'),auth[_0x3598('0x8')](),controller['getScheduledCalls']);router[_0x3598('0x7')]('/:id/api_key',auth[_0x3598('0x8')](),controller[_0x3598('0x37')]);router['post'](_0x3598('0x38'),auth['isAuthenticated'](),controller[_0x3598('0x39')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3598('0x3a')]);router[_0x3598('0x3b')](_0x3598('0x3c'),auth[_0x3598('0x8')](),controller[_0x3598('0x3d')]);router[_0x3598('0x3b')](_0x3598('0x15'),auth[_0x3598('0x8')](),controller[_0x3598('0x3e')]);var upload=multer({'storage':multer[_0x3598('0x3f')]({'destination':function(_0x44d257,_0xe1a2cb,_0x5450d1){_0x5450d1(null,path[_0x3598('0x40')](config['root'],_0x3598('0x41')));},'filename':function(_0x343424,_0x5a0d22,_0xd4a0fa){_0xd4a0fa(null,util[_0x3598('0x42')](_0x3598('0x43'),Date['now'](),_0x5a0d22['originalname']));}})});router[_0x3598('0x3b')]('/:id/avatar',upload['single']('file'),controller[_0x3598('0x44')]);router[_0x3598('0x3b')](_0x3598('0x45'),auth[_0x3598('0x8')](),controller['login']);router[_0x3598('0x3b')](_0x3598('0x46'),auth[_0x3598('0x8')](),controller[_0x3598('0x47')]);router[_0x3598('0x3b')]('/:id/pause',auth[_0x3598('0x8')](),controller[_0x3598('0x48')]);router[_0x3598('0x3b')](_0x3598('0x49'),auth[_0x3598('0x8')](),controller[_0x3598('0x4a')]);router[_0x3598('0x3b')](_0x3598('0x26'),auth['isAuthenticated'](),controller[_0x3598('0x4b')]);router['post'](_0x3598('0x4c'),auth[_0x3598('0x8')](),controller['addChatInteractions']);router[_0x3598('0x3b')](_0x3598('0x4d'),auth[_0x3598('0x8')](),controller[_0x3598('0x4e')]);router['post'](_0x3598('0x4f'),auth[_0x3598('0x8')](),controller[_0x3598('0x50')]);router['post'](_0x3598('0x51'),auth[_0x3598('0x8')](),controller[_0x3598('0x52')]);router['post'](_0x3598('0x53'),auth[_0x3598('0x8')](),controller[_0x3598('0x54')]);router['post']('/:id/whatsapp_interactions',auth[_0x3598('0x8')](),controller[_0x3598('0x55')]);router[_0x3598('0x3b')](_0x3598('0x56'),auth[_0x3598('0x8')](),controller[_0x3598('0x57')]);router[_0x3598('0x3b')](_0x3598('0x2d'),auth[_0x3598('0x8')](),controller[_0x3598('0x58')]);router[_0x3598('0x3b')](_0x3598('0x2e'),auth[_0x3598('0x8')](),controller[_0x3598('0x59')]);router['post'](_0x3598('0x30'),auth[_0x3598('0x8')](),controller['addSmsAccounts']);router['post'](_0x3598('0x32'),auth['isAuthenticated'](),controller[_0x3598('0x5a')]);router[_0x3598('0x3b')](_0x3598('0x5b'),auth[_0x3598('0x8')](),controller[_0x3598('0x5c')]);router['post'](_0x3598('0x35'),auth[_0x3598('0x8')](),controller[_0x3598('0x5d')]);router[_0x3598('0x3b')]('/:id/api_key',auth[_0x3598('0x8')](),controller[_0x3598('0x5e')]);router['put'](_0x3598('0xf'),auth[_0x3598('0x8')](),controller['update']);router[_0x3598('0x5f')](_0x3598('0x60'),auth[_0x3598('0x8')](),controller[_0x3598('0x61')]);router['delete'](_0x3598('0x15'),auth[_0x3598('0x8')](),controller[_0x3598('0x62')]);router[_0x3598('0x63')](_0x3598('0x26'),auth['isAuthenticated'](),controller[_0x3598('0x64')]);router[_0x3598('0x63')](_0x3598('0xf'),auth[_0x3598('0x8')](),controller[_0x3598('0x65')]);router['delete']('/:id/chat_interactions',auth[_0x3598('0x8')](),controller['removeChatInteractions']);router[_0x3598('0x63')](_0x3598('0x4d'),auth[_0x3598('0x8')](),controller[_0x3598('0x66')]);router[_0x3598('0x63')]('/:id/fax_interactions',auth[_0x3598('0x8')](),controller['removeFaxInteractions']);router['delete'](_0x3598('0x51'),auth[_0x3598('0x8')](),controller[_0x3598('0x67')]);router['delete']('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x3598('0x68')]);router[_0x3598('0x63')](_0x3598('0x69'),auth['isAuthenticated'](),controller[_0x3598('0x6a')]);router['delete']('/:id/fax_accounts',auth[_0x3598('0x8')](),controller['removeFaxAccounts']);router[_0x3598('0x63')](_0x3598('0x2d'),auth[_0x3598('0x8')](),controller['removeMailAccounts']);router[_0x3598('0x63')]('/:id/openchannel_accounts',auth[_0x3598('0x8')](),controller[_0x3598('0x6b')]);router[_0x3598('0x63')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x3598('0x6c')]);router[_0x3598('0x63')](_0x3598('0x32'),auth[_0x3598('0x8')](),controller[_0x3598('0x6d')]);router[_0x3598('0x63')](_0x3598('0x5b'),auth[_0x3598('0x8')](),controller[_0x3598('0x6e')]);router['delete'](_0x3598('0x35'),auth[_0x3598('0x8')](),controller['removeSquareProjects']);router[_0x3598('0x63')](_0x3598('0x6f'),auth[_0x3598('0x8')](),controller[_0x3598('0x70')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 91f1e07..f9e3a91 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 _0xba18=['force_rport,comedia','nat','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','TEXT','get','encryption','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','avpf','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','getDataValue','internal','email','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','callerid','format','\x22%s\x22\x20<%s>','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','yes','nonat','update','outgoing'];(function(_0x225b63,_0x29fc76){var _0x5ba8fb=function(_0x3e6852){while(--_0x3e6852){_0x225b63['push'](_0x225b63['shift']());}};_0x5ba8fb(++_0x29fc76);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8ba1('0x0'));var moment=require(_0x8ba1('0x1'));var util=require(_0x8ba1('0x2'));var _=require(_0x8ba1('0x3'));module[_0x8ba1('0x4')]={'name':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':![],'unique':_0x8ba1('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3b5254){this['setDataValue'](_0x8ba1('0x6'),_0x3b5254);this[_0x8ba1('0x7')](_0x8ba1('0x8'),_0x3b5254);},'comment':_0x8ba1('0x9')},'fullname':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':![],'set':function(_0x2ffa15){this['setDataValue'](_0x8ba1('0xa'),_0x2ffa15);this[_0x8ba1('0x7')]('callerid',util['format']('\x22%s\x22\x20<%s>',_0x2ffa15,this[_0x8ba1('0xb')](_0x8ba1('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':![],'unique':_0x8ba1('0xd'),'validate':{'isEmail':!![]},'set':function(_0x460e69){if(_0x460e69){this[_0x8ba1('0x7')](_0x8ba1('0xd'),_0x460e69['toLowerCase']());}}},'role':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0xf'),_0x8ba1('0x10'),_0x8ba1('0x11'),_0x8ba1('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x8ba1('0x13')},'internal':{'type':Sequelize[_0x8ba1('0x14')](0xb),'allowNull':![],'unique':_0x8ba1('0xc'),'set':function(_0xca53c4){this['setDataValue']('internal',_0xca53c4);this['setDataValue'](_0x8ba1('0x15'),_0xca53c4);this[_0x8ba1('0x7')](_0x8ba1('0x16'),util[_0x8ba1('0x17')](_0x8ba1('0x18'),this[_0x8ba1('0xb')](_0x8ba1('0xa')),_0xca53c4));}},'salt':{'type':Sequelize[_0x8ba1('0x5')]},'phone':{'type':Sequelize[_0x8ba1('0x5')]},'mobile':{'type':Sequelize[_0x8ba1('0x5')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x8ba1('0x5')]},'city':{'type':Sequelize[_0x8ba1('0x5')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x8ba1('0x1a')]},'voicePause':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x8ba1('0x5')],'defaultValue':_0x8ba1('0x1b')},'lastPauseAt':{'type':Sequelize[_0x8ba1('0x1a')]},'chatCapacity':{'type':Sequelize[_0x8ba1('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x8ba1('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x8ba1('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x8ba1('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x8ba1('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x8ba1('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x8ba1('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x8ba1('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'host':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x8ba1('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x8ba1('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x8ba1('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x1c'),_0x8ba1('0x10'),_0x8ba1('0x1d')),'allowNull':!![],'defaultValue':_0x8ba1('0x1c')},'context':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![],'defaultValue':_0x8ba1('0x1e')},'callingpres':{'type':Sequelize['ENUM'](_0x8ba1('0x1f'),_0x8ba1('0x20'),_0x8ba1('0x21'),_0x8ba1('0x22'),_0x8ba1('0x23'),_0x8ba1('0x24'),'PROHIB_FAILED_SCREEN',_0x8ba1('0x25')),'allowNull':!![]},'deny':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![],'defaultValue':'udp','set':function(_0x41f684){this[_0x8ba1('0x7')](_0x8ba1('0x26'),_0x41f684?_0x41f684[_0x8ba1('0x27')](','):null);},'get':function(){return this[_0x8ba1('0xb')]('transport')?this[_0x8ba1('0xb')](_0x8ba1('0x26'))[_0x8ba1('0x28')](','):null;},'comment':_0x8ba1('0x29')},'dtmfmode':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2a'),_0x8ba1('0x2b'),_0x8ba1('0x2c'),'inband',_0x8ba1('0x2d')),'allowNull':!![],'defaultValue':_0x8ba1('0x2a')},'directmedia':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no',_0x8ba1('0x2f'),_0x8ba1('0x30'),_0x8ba1('0x31')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![],'defaultValue':_0x8ba1('0x32'),'set':function(_0x146104){this[_0x8ba1('0x7')](_0x8ba1('0x33'),_0x146104?_0x146104[_0x8ba1('0x27')](','):null);},'get':function(){return this[_0x8ba1('0xb')](_0x8ba1('0x33'))?this[_0x8ba1('0xb')](_0x8ba1('0x33'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x8ba1('0x5')]},'namedcallgroup':{'type':Sequelize[_0x8ba1('0x5')]},'pickupgroup':{'type':Sequelize[_0x8ba1('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x8ba1('0x5')]},'language':{'type':Sequelize[_0x8ba1('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8ba1('0x5')]},'disallow':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':![],'defaultValue':_0x8ba1('0x34')},'allow':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':![],'defaultValue':_0x8ba1('0x35'),'set':function(_0x2f4ac4){this[_0x8ba1('0x7')](_0x8ba1('0x36'),_0x2f4ac4?_0x2f4ac4[_0x8ba1('0x27')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x8ba1('0xb')](_0x8ba1('0x36'))?this[_0x8ba1('0xb')](_0x8ba1('0x36'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![],'set':function(_0x3430d4){this[_0x8ba1('0x7')]('insecure',_0x3430d4?_0x3430d4[_0x8ba1('0x27')](','):null);},'get':function(){return this[_0x8ba1('0xb')](_0x8ba1('0x37'))?this['getDataValue'](_0x8ba1('0x37'))[_0x8ba1('0x28')](','):null;},'comment':_0x8ba1('0x38')},'trustrpid':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x8ba1('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8ba1('0xe')]('yes','no',_0x8ba1('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x8ba1('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![],'defaultValue':_0x8ba1('0x3a')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x8ba1('0x2e'),'no'),'allowNull':!![],'defaultValue':_0x8ba1('0x2e')},'busylevel':{'type':Sequelize[_0x8ba1('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x8ba1('0x2e'),'no',_0x8ba1('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8ba1('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x3c'),_0x8ba1('0x3d'),_0x8ba1('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x8ba1('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x8ba1('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x3f'),'uas'),'allowNull':!![],'defaultValue':_0x8ba1('0x40')},'t38pt_usertpsource':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'allowNull':!![],'defaultValue':_0x8ba1('0x2e')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x8ba1('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x8ba1('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x8ba1('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x8ba1('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x8ba1('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x8ba1('0x2e'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x8ba1('0xe')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no',_0x8ba1('0x41'),_0x8ba1('0x42')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x8ba1('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x8ba1('0xe')]('active',_0x8ba1('0x43'),_0x8ba1('0x44')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x8ba1('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x8ba1('0x2e'),'no','nonat',_0x8ba1('0x30'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x8ba1('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0x8ba1('0x1a')]},'passwordResetAt':{'type':Sequelize[_0x8ba1('0x1a')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x8ba1('0x45')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4d3d76){this['setDataValue']('showWebBar',_0x4d3d76);var _0x12e7e9=this[_0x8ba1('0x46')]({'plain':!![]});switch(_0x4d3d76){case 0x0:case 0x1:var _0x27b704=_0x12e7e9[_0x8ba1('0x26')]?_['isArray'](_0x12e7e9[_0x8ba1('0x26')])?_0x12e7e9[_0x8ba1('0x26')][_0x8ba1('0x27')]():_0x12e7e9[_0x8ba1('0x26')]:'udp';if(_0x27b704==='wss'){_0x27b704='udp';}this[_0x8ba1('0x7')]('transport',_0x27b704);this[_0x8ba1('0x7')](_0x8ba1('0x47'),'no');this[_0x8ba1('0x7')]('avpf',null);this[_0x8ba1('0x7')]('force_avp',null);this[_0x8ba1('0x7')](_0x8ba1('0x48'),null);this[_0x8ba1('0x7')](_0x8ba1('0x49'),null);this[_0x8ba1('0x7')](_0x8ba1('0x4a'),null);this[_0x8ba1('0x7')](_0x8ba1('0x4b'),null);this[_0x8ba1('0x7')]('dtlscertfile',null);this[_0x8ba1('0x7')](_0x8ba1('0x4c'),null);this[_0x8ba1('0x7')](_0x8ba1('0x4d'),'no');break;case 0x2:this[_0x8ba1('0x7')](_0x8ba1('0x26'),'wss');this[_0x8ba1('0x7')](_0x8ba1('0x47'),'yes');this[_0x8ba1('0x7')](_0x8ba1('0x4e'),_0x8ba1('0x2e'));this[_0x8ba1('0x7')]('force_avp',_0x8ba1('0x2e'));this[_0x8ba1('0x7')](_0x8ba1('0x48'),_0x8ba1('0x2e'));this[_0x8ba1('0x7')](_0x8ba1('0x49'),'yes');this[_0x8ba1('0x7')](_0x8ba1('0x4a'),'no');this[_0x8ba1('0x7')](_0x8ba1('0x4b'),_0x8ba1('0x44'));this[_0x8ba1('0x7')](_0x8ba1('0x4f'),_0x12e7e9['dtlscertfile']||_0x8ba1('0x50'));this[_0x8ba1('0x7')](_0x8ba1('0x4c'),_0x12e7e9[_0x8ba1('0x4c')]||_0x8ba1('0x51'));this[_0x8ba1('0x7')]('rtcp_mux',_0x8ba1('0x2e'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x29c305){this['setDataValue']('permissions',_0x29c305?_0x29c305['join'](','):[]);},'get':function(){return this[_0x8ba1('0xb')](_0x8ba1('0x52'))?_[_0x8ba1('0x53')](this['getDataValue'](_0x8ba1('0x52'))[_0x8ba1('0x28')](','),function(_0xe13d68){return parseInt(_0xe13d68,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x8ba1('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x8ba1('0x5')]},'phoneBarBusyNumber':{'type':Sequelize[_0x8ba1('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x8ba1('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x8ba1('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x8ba1('0xe')](_0x8ba1('0x2e'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x8ba1('0x5')]},'phoneBarEnableJaws':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x8ba1('0xb')](_0x8ba1('0x54'))?this['getDataValue'](_0x8ba1('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'interface':{'type':Sequelize[_0x8ba1('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x8ba1('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![],'set':function(_0x2527fa){if(typeof _0x2527fa===_0x8ba1('0x55')){var _0x155ad2=_0x2527fa==='1'?!![]:_0x2527fa==='0'?![]:_0x2527fa===_0x8ba1('0x56')?!![]:_0x2527fa===_0x8ba1('0x57')?![]:![];this['setDataValue'](_0x8ba1('0x58'),_0x155ad2);}else{this[_0x8ba1('0x7')]('screenrecording',_0x2527fa);}}},'blocked':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![],'set':function(_0x83447e){this[_0x8ba1('0x7')]('blocked',_0x83447e);if(_0x83447e===!![]){this[_0x8ba1('0x7')](_0x8ba1('0x59'),moment());this[_0x8ba1('0x7')]('loginAttempts',0x0);}else{this[_0x8ba1('0x7')](_0x8ba1('0x59'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x8ba1('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x8ba1('0x14')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8ba1('0x19')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9432=['lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','update,nonat','TEXT','showWebBar','get','isArray','encryption','force_avp','icesupport','dtlsverify','rtcp_mux','wss','dtlssetup','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','join','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment'];(function(_0x458db7,_0x118cfc){var _0xb5dbe=function(_0x425988){while(--_0x425988){_0x458db7['push'](_0x458db7['shift']());}};_0xb5dbe(++_0x118cfc);}(_0x9432,0x1e3));var _0x2943=function(_0x4f146a,_0x424082){_0x4f146a=_0x4f146a-0x0;var _0x311428=_0x9432[_0x4f146a];return _0x311428;};'use strict';var Sequelize=require(_0x2943('0x0'));var moment=require(_0x2943('0x1'));var util=require('util');var _=require(_0x2943('0x2'));module[_0x2943('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2943('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x571144){this['setDataValue'](_0x2943('0x4'),_0x571144);this[_0x2943('0x5')](_0x2943('0x6'),_0x571144);},'comment':_0x2943('0x7')},'fullname':{'type':Sequelize[_0x2943('0x8')],'allowNull':![],'set':function(_0x56f65f){this[_0x2943('0x5')](_0x2943('0x9'),_0x56f65f);this[_0x2943('0x5')](_0x2943('0xa'),util['format'](_0x2943('0xb'),_0x56f65f,this[_0x2943('0xc')](_0x2943('0xd'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x2943('0x8')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x3e7866){if(_0x3e7866){this[_0x2943('0x5')](_0x2943('0xe'),_0x3e7866[_0x2943('0xf')]());}}},'role':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x11'),_0x2943('0x12'),_0x2943('0x13'),_0x2943('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x2943('0x8')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x2943('0x8')],'defaultValue':_0x2943('0x15')},'internal':{'type':Sequelize[_0x2943('0x16')](0xb),'allowNull':![],'unique':'internal','set':function(_0x306eae){this[_0x2943('0x5')](_0x2943('0xd'),_0x306eae);this[_0x2943('0x5')](_0x2943('0x17'),_0x306eae);this[_0x2943('0x5')](_0x2943('0xa'),util['format']('\x22%s\x22\x20<%s>',this[_0x2943('0xc')]('fullname'),_0x306eae));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x2943('0x8')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x2943('0x8')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x2943('0x8')]},'city':{'type':Sequelize[_0x2943('0x8')]},'country':{'type':Sequelize[_0x2943('0x8')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x2943('0x18')]},'voicePause':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x2943('0x8')],'defaultValue':_0x2943('0x1a')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x2943('0x16')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x2943('0x16')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x2943('0x16')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x2943('0x16')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x2943('0x16')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x2943('0x19')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x2943('0x16')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'description':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'host':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![],'defaultValue':_0x2943('0x1b')},'ipaddr':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x2943('0x16')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x2943('0x16')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x1c'),_0x2943('0x12'),_0x2943('0x1d')),'allowNull':!![],'defaultValue':_0x2943('0x1c')},'context':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![],'defaultValue':_0x2943('0x1e')},'callingpres':{'type':Sequelize['ENUM'](_0x2943('0x1f'),_0x2943('0x20'),_0x2943('0x21'),_0x2943('0x22'),_0x2943('0x23'),_0x2943('0x24'),_0x2943('0x25'),_0x2943('0x26')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'secret':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'transport':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![],'defaultValue':_0x2943('0x27'),'set':function(_0x47fe7f){this['setDataValue']('transport',_0x47fe7f?_0x47fe7f['join'](','):null);},'get':function(){return this[_0x2943('0xc')](_0x2943('0x28'))?this[_0x2943('0xc')]('transport')[_0x2943('0x29')](','):null;},'comment':_0x2943('0x2a')},'dtmfmode':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x2b'),_0x2943('0x2c'),_0x2943('0x2d'),_0x2943('0x2e'),_0x2943('0x2f')),'allowNull':!![],'defaultValue':_0x2943('0x2b')},'directmedia':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no',_0x2943('0x31'),_0x2943('0x32'),_0x2943('0x33')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'nat':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x555ba7){this['setDataValue']('nat',_0x555ba7?_0x555ba7['join'](','):null);},'get':function(){return this[_0x2943('0xc')](_0x2943('0x34'))?this['getDataValue'](_0x2943('0x34'))[_0x2943('0x29')](','):null;},'comment':_0x2943('0x35')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x2943('0x8')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x2943('0x8')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x2943('0x8')],'allowNull':![],'defaultValue':_0x2943('0x36')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2943('0x37'),'set':function(_0x218f03){this[_0x2943('0x5')]('allow',_0x218f03?_0x218f03['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x2943('0xc')]('allow')?this[_0x2943('0xc')](_0x2943('0x38'))[_0x2943('0x29')](';'):null;},'comment':_0x2943('0x39')},'autoframing':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![],'set':function(_0x233b7d){this[_0x2943('0x5')](_0x2943('0x3a'),_0x233b7d?_0x233b7d['join'](','):null);},'get':function(){return this['getDataValue'](_0x2943('0x3a'))?this[_0x2943('0xc')]('insecure')[_0x2943('0x29')](','):null;},'comment':_0x2943('0x3b')},'trustrpid':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no',_0x2943('0x3c')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x2943('0x16')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![],'defaultValue':_0x2943('0x3d')},'amaflags':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no'),'allowNull':!![],'defaultValue':_0x2943('0x30')},'busylevel':{'type':Sequelize[_0x2943('0x16')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x2943('0x30'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x2943('0x10')]('yes','no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2943('0x16')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x3e'),_0x2943('0x3f'),_0x2943('0x40')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x2943('0x16')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x2943('0x16')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x2943('0x41'),_0x2943('0x42')),'allowNull':!![],'defaultValue':_0x2943('0x42')},'t38pt_usertpsource':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x2943('0x30'),'no'),'allowNull':!![],'defaultValue':_0x2943('0x30')},'keepalive':{'type':Sequelize[_0x2943('0x16')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x2943('0x16')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x2943('0x16')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x2943('0x16')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x2943('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x2943('0x16')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x2943('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x2943('0x30'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x2943('0x30'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x2943('0x43'),_0x2943('0x44')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x2943('0x16')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x45'),_0x2943('0x46'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x2943('0x10')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no','nonat','update',_0x2943('0x47')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x2943('0x18')]},'passwordResetAt':{'type':Sequelize[_0x2943('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x2943('0x48')]},'showWebBar':{'type':Sequelize[_0x2943('0x16')],'defaultValue':0x0,'set':function(_0x1acdf1){this[_0x2943('0x5')](_0x2943('0x49'),_0x1acdf1);var _0x516480=this[_0x2943('0x4a')]({'plain':!![]});switch(_0x1acdf1){case 0x0:case 0x1:var _0x1b4679=_0x516480[_0x2943('0x28')]?_[_0x2943('0x4b')](_0x516480[_0x2943('0x28')])?_0x516480[_0x2943('0x28')]['join']():_0x516480[_0x2943('0x28')]:_0x2943('0x27');if(_0x1b4679==='wss'){_0x1b4679=_0x2943('0x27');}this[_0x2943('0x5')](_0x2943('0x28'),_0x1b4679);this[_0x2943('0x5')](_0x2943('0x4c'),'no');this[_0x2943('0x5')]('avpf',null);this[_0x2943('0x5')](_0x2943('0x4d'),null);this['setDataValue'](_0x2943('0x4e'),null);this[_0x2943('0x5')]('dtlsenable',null);this[_0x2943('0x5')](_0x2943('0x4f'),null);this['setDataValue']('dtlssetup',null);this[_0x2943('0x5')]('dtlscertfile',null);this[_0x2943('0x5')]('dtlsprivatekey',null);this[_0x2943('0x5')](_0x2943('0x50'),'no');break;case 0x2:this[_0x2943('0x5')](_0x2943('0x28'),_0x2943('0x51'));this[_0x2943('0x5')]('encryption',_0x2943('0x30'));this[_0x2943('0x5')]('avpf',_0x2943('0x30'));this['setDataValue'](_0x2943('0x4d'),_0x2943('0x30'));this['setDataValue'](_0x2943('0x4e'),_0x2943('0x30'));this[_0x2943('0x5')]('dtlsenable',_0x2943('0x30'));this[_0x2943('0x5')](_0x2943('0x4f'),'no');this[_0x2943('0x5')](_0x2943('0x52'),_0x2943('0x53'));this[_0x2943('0x5')](_0x2943('0x54'),_0x516480[_0x2943('0x54')]||_0x2943('0x55'));this[_0x2943('0x5')](_0x2943('0x56'),_0x516480[_0x2943('0x56')]||'/etc/pki/tls/private/motion.key');this[_0x2943('0x5')](_0x2943('0x50'),_0x2943('0x30'));break;default:}}},'permissions':{'type':Sequelize[_0x2943('0x48')],'set':function(_0x31fea3){this['setDataValue'](_0x2943('0x57'),_0x31fea3?_0x31fea3[_0x2943('0x58')](','):[]);},'get':function(){return this[_0x2943('0xc')](_0x2943('0x57'))?_[_0x2943('0x59')](this[_0x2943('0xc')](_0x2943('0x57'))[_0x2943('0x29')](','),function(_0xd360){return parseInt(_0xd360,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x2943('0x8')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x2943('0x8')]},'phoneBarUnconditional':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x2943('0x19')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x2943('0x19')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x2943('0x16')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x2943('0x8')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x2943('0x16')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x2943('0x10')](_0x2943('0x30'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x2943('0x19')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x2943('0x8')]},'phoneBarEnableJaws':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x2943('0x5a')],'get':function(){return this['getDataValue'](_0x2943('0x5b'))?this[_0x2943('0xc')](_0x2943('0x5b')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x2943('0x8')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![],'set':function(_0x1e5d3b){if(typeof _0x1e5d3b==='string'){var _0x3000be=_0x1e5d3b==='1'?!![]:_0x1e5d3b==='0'?![]:_0x1e5d3b==='true'?!![]:_0x1e5d3b===_0x2943('0x5c')?![]:![];this[_0x2943('0x5')](_0x2943('0x5d'),_0x3000be);}else{this[_0x2943('0x5')](_0x2943('0x5d'),_0x1e5d3b);}}},'blocked':{'type':Sequelize[_0x2943('0x19')],'defaultValue':![],'set':function(_0x25097c){this['setDataValue'](_0x2943('0x5e'),_0x25097c);if(_0x25097c===!![]){this[_0x2943('0x5')](_0x2943('0x5f'),moment());this['setDataValue'](_0x2943('0x60'),0x0);}else{this['setDataValue'](_0x2943('0x5f'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x2943('0x16')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x2943('0x19')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x2943('0x16')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x2943('0x19')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x2943('0x19')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x2943('0x19')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index f776022..8c2753b 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 _0x7096=['some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','each','isEmpty','autoAssociation','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','updatePasswordsHistory','addQueues','online','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','emit','voice','VoiceQueue','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','channel','remove','isArray','Queue:remove','addAvatar','file','filename','join','server/files/images/logos/default_profile.png','userpic','existsSync','root','server/files/images/','fax','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','WhatsappOpenTabs','WHATSAPP','getContacts','findOne','filters','order','sort','pick','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','phone','LOCAL/%s@from-sip/n','intrf','x-forwarded-for','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','forEach','getChannels','LOGIN','loginInPause','PAUSE','MemberReport','concat','YYYY-MM-DD\x20HH:mm:ss','isMiddleware','resolve','logout','QueuePause','updateAttributes','type','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','getTeams','Team','addTeams','setDataValue','Voice','Chat','getSmsQueues','getWhatsappQueues','Whatsapp','Fax','getOpenchannelQueues','flatten','getDataValue','Queue:save','TeamVoicePrefix','UserVoicePrefix','removeTeams','getVoiceQueues','getMailQueues','Mail','Sms','getFaxQueues','Openchannel','removeAgent','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','spread','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','$and','$gt','$gte','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$iLike','$notILike','$contains','$any','CmContact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','nonce','removeApiKey','apiKeyNonce','API\x20key\x20not\x20available','whoami','getPresence','teams','queues','lower','col','toString','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','pause','idle','unknown','unavailable','busy','slice','charAt','toUpperCase','select','field','ui.','InteractionId','ui.createdAt','_interactions','ui.UserId\x20=\x20?','bluebird','path','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','defaults','localhost','client','http','request','then','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','update','destroy','get','Users','user','Agents','agent','Telephones','telephone','filter','map','value','includes','find','role','UserProfileResource','name','send','index','User','fieldName','key','password','salt','getOptions','where','includeAll','include','attributes','findAll','rows','query','length','push','sms','dataValues','mail','openchannel','whatsapp','all','params','model','differenceBy','keys','rawAttributes','intersection','fields','merge','options','chat','body','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','isNil','min_internal','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)','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','101','102','113','110','104','105','106','109','100','114','115','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','create','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','Unauthorized'];(function(_0x4b2cc6,_0x29ef43){var _0x3e0b08=function(_0x3b4131){while(--_0x3b4131){_0x4b2cc6['push'](_0x4b2cc6['shift']());}};_0x3e0b08(++_0x29ef43);}(_0x7096,0x10c));var _0x6709=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x7096[_0x550d12];return _0x12103d;};'use strict';var moment=require('moment');var BPromise=require(_0x6709('0x0'));var util=require('util');var path=require(_0x6709('0x1'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6709('0x2'));var jayson=require(_0x6709('0x3'));var Redis=require(_0x6709('0x4'));var authService=require(_0x6709('0x5'));var qs=require(_0x6709('0x6'));var logger=require(_0x6709('0x7'))(_0x6709('0x8'));var utils=require(_0x6709('0x9'));var config=require(_0x6709('0xa'));var licenseUtil=require(_0x6709('0xb'));var db=require(_0x6709('0xc'))['db'];var socket=require(_0x6709('0xd'))(new Redis(config[_0x6709('0xe')]));require('./user.socket')['register'](socket);config[_0x6709('0xe')]=_[_0x6709('0xf')](config[_0x6709('0xe')],{'host':_0x6709('0x10'),'port':0x18eb});var client=jayson[_0x6709('0x11')][_0x6709('0x12')]({'port':0x232a});var values;function respondWithRpcPromise(_0x5de1fa,_0x5b9f26,_0x329aa9,_0x262261){return new BPromise(function(_0x275dd3,_0x84e9e6){var _0x31ac88=_0x262261||client;return _0x31ac88[_0x6709('0x13')](_0x5de1fa,_0x329aa9)[_0x6709('0x14')](function(_0x1ac547){logger['info'](_0x6709('0x15'),_0x5b9f26,_0x6709('0x16'));logger[_0x6709('0x17')](_0x6709('0x18'),_0x5b9f26,'request\x20sent',JSON[_0x6709('0x19')](_0x1ac547));if(_0x1ac547['error']){if(_0x1ac547[_0x6709('0x1a')]['code']===0x1f4){logger[_0x6709('0x1a')](_0x6709('0x15'),_0x5b9f26,_0x1ac547[_0x6709('0x1a')][_0x6709('0x1b')]);return _0x84e9e6(_0x1ac547['error']['message']);}logger['error'](_0x6709('0x15'),_0x5b9f26,_0x1ac547[_0x6709('0x1a')]['message']);return _0x275dd3(_0x1ac547[_0x6709('0x1a')][_0x6709('0x1b')]);}else{logger[_0x6709('0x1c')]('User,\x20%s,\x20%s',_0x5b9f26,_0x6709('0x16'));_0x275dd3(_0x1ac547[_0x6709('0x1d')][_0x6709('0x1b')]);}})[_0x6709('0x1e')](function(_0x5485d7){logger[_0x6709('0x1a')](_0x6709('0x15'),_0x5b9f26,_0x5485d7);_0x84e9e6(_0x5485d7);});});}function respondWithStatusCode(_0x373047,_0x3cf882){_0x3cf882=_0x3cf882||0xcc;return function(_0x78f61a){if(_0x78f61a){return _0x373047[_0x6709('0x1f')](_0x3cf882);}return _0x373047[_0x6709('0x20')](_0x3cf882)[_0x6709('0x21')]();};}function respondWithResult(_0x386224,_0x1c5153){_0x1c5153=_0x1c5153||0xc8;return function(_0x2f3415){if(_0x2f3415){return _0x386224[_0x6709('0x20')](_0x1c5153)['json'](_0x2f3415);}};}function respondWithFilteredResult(_0x29f25f,_0x81138e){return function(_0x2bcc73){if(_0x2bcc73){var _0x5c7982=typeof _0x81138e[_0x6709('0x22')]===_0x6709('0x23')&&typeof _0x81138e[_0x6709('0x24')]===_0x6709('0x23');var _0x588e00=_0x2bcc73[_0x6709('0x25')];var _0x3076fe=_0x5c7982?0x0:_0x81138e['offset'];var _0x585073=_0x5c7982?_0x2bcc73[_0x6709('0x25')]:_0x81138e['offset']+_0x81138e[_0x6709('0x24')];var _0x2499a2;if(_0x585073>=_0x588e00){_0x585073=_0x588e00;_0x2499a2=0xc8;}else{_0x2499a2=0xce;}_0x29f25f['status'](_0x2499a2);return _0x29f25f[_0x6709('0x26')]('Content-Range',_0x3076fe+'-'+_0x585073+'/'+_0x588e00)[_0x6709('0x27')](_0x2bcc73);}return null;};}function saveUpdates(_0x3cd555){return function(_0x5b6906){if(_0x5b6906){return _0x5b6906[_0x6709('0x28')](_0x3cd555)['then'](function(_0xe066d8){return _0xe066d8;});}return null;};}function removeEntity(_0x388aee){return function(_0x4ad1c3){if(_0x4ad1c3){return _0x4ad1c3[_0x6709('0x29')]()['then'](function(){var _0x138318=_0x4ad1c3[_0x6709('0x2a')]({'plain':!![]});if(_0x138318['role']==='admin')return;var _0x37b3ce=[{'name':_0x6709('0x2b'),'value':_0x6709('0x2c'),'ignore':!![]},{'name':_0x6709('0x2d'),'value':_0x6709('0x2e'),'ignore':![]},{'name':_0x6709('0x2f'),'value':_0x6709('0x30'),'ignore':![]}];var _0x402e45=_(_0x37b3ce)[_0x6709('0x31')]('ignore')[_0x6709('0x32')](_0x6709('0x33'))[_0x6709('0x33')]();if(_[_0x6709('0x34')](_0x402e45,_0x138318['role'])){return;}var _0x7e783d=_[_0x6709('0x35')](_0x37b3ce,[_0x6709('0x33'),_0x138318[_0x6709('0x36')]])['name'];return db[_0x6709('0x37')][_0x6709('0x29')]({'where':{'type':_0x7e783d,'resourceId':_0x138318['id']}})['then'](function(){return _0x4ad1c3;});})[_0x6709('0x14')](function(){_0x388aee[_0x6709('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6863f9){return function(_0x12b78b){if(!_0x12b78b){_0x6863f9[_0x6709('0x1f')](0x194);}return _0x12b78b;};}function handleError(_0xf30c4c,_0x4f2a68){_0x4f2a68=_0x4f2a68||0x1f4;return function(_0x43309a){logger[_0x6709('0x1a')](_0x43309a['stack']);if(_0x43309a[_0x6709('0x38')]){delete _0x43309a[_0x6709('0x38')];}_0xf30c4c['status'](_0x4f2a68)[_0x6709('0x39')](_0x43309a);};}exports[_0x6709('0x3a')]=function(_0x6b5f39,_0x2bb89c){var _0x3d5930={},_0x1c12bb={'count':0x0,'rows':[]};var _0x4b5d60=_(db[_0x6709('0x3b')]['rawAttributes'])[_0x6709('0x32')](function(_0xbb7a64){return{'name':_0xbb7a64[_0x6709('0x3c')],'type':_0xbb7a64['type'][_0x6709('0x3d')]};})[_0x6709('0x31')](function(_0x2d9879){return!_[_0x6709('0x34')]([_0x6709('0x3e'),_0x6709('0x3f')],_0x2d9879[_0x6709('0x38')]);})['value']();_0x3d5930=qs[_0x6709('0x40')](_0x4b5d60,_0x6b5f39);var _0x197f2e={'where':_0x3d5930[_0x6709('0x41')]};return db[_0x6709('0x3b')][_0x6709('0x25')](_0x197f2e)[_0x6709('0x14')](function(_0x2765da){_0x1c12bb['count']=_0x2765da;if(_0x6b5f39['query'][_0x6709('0x42')]){_0x3d5930[_0x6709('0x43')]=[{'all':!![]}];}if(!_[_0x6709('0x34')](_0x3d5930[_0x6709('0x44')],'id')){_0x3d5930['attributes']['push']('id');}return db['User'][_0x6709('0x45')](_0x3d5930);})[_0x6709('0x14')](function(_0x54f74e){_0x1c12bb[_0x6709('0x46')]=_0x54f74e;if(_0x6b5f39[_0x6709('0x47')]['openTabs']==='true'){var _0x2b24b3=[];for(var _0x2a4445=0x0;_0x2a4445<_0x1c12bb[_0x6709('0x46')][_0x6709('0x48')];_0x2a4445++){_0x2b24b3[_0x6709('0x49')](get_open_tabs('chat',_0x1c12bb[_0x6709('0x46')][_0x2a4445]['dataValues']));_0x2b24b3[_0x6709('0x49')](get_open_tabs(_0x6709('0x4a'),_0x1c12bb[_0x6709('0x46')][_0x2a4445]['dataValues']));_0x2b24b3[_0x6709('0x49')](get_open_tabs('fax',_0x1c12bb['rows'][_0x2a4445][_0x6709('0x4b')]));_0x2b24b3[_0x6709('0x49')](get_open_tabs(_0x6709('0x4c'),_0x1c12bb[_0x6709('0x46')][_0x2a4445][_0x6709('0x4b')]));_0x2b24b3[_0x6709('0x49')](get_open_tabs(_0x6709('0x4d'),_0x1c12bb[_0x6709('0x46')][_0x2a4445][_0x6709('0x4b')]));_0x2b24b3[_0x6709('0x49')](get_open_tabs(_0x6709('0x4e'),_0x1c12bb[_0x6709('0x46')][_0x2a4445][_0x6709('0x4b')]));}return BPromise[_0x6709('0x4f')](_0x2b24b3)[_0x6709('0x14')](function(_0x4f82a0){return _0x1c12bb;});}else{return _0x1c12bb;}})[_0x6709('0x14')](respondWithFilteredResult(_0x2bb89c,_0x3d5930))['catch'](handleError(_0x2bb89c,null));};exports['show']=function(_0x594c43,_0x3091b8){var _0x483e15={'raw':![],'where':{'id':_0x594c43[_0x6709('0x50')]['id']}},_0xe8dd1={};_0xe8dd1[_0x6709('0x51')]=_[_0x6709('0x52')](_[_0x6709('0x53')](db['User'][_0x6709('0x54')]),[_0x6709('0x3e'),_0x6709('0x3f')]);_0xe8dd1[_0x6709('0x47')]=_['keys'](_0x594c43[_0x6709('0x47')]);_0xe8dd1['filters']=_[_0x6709('0x55')](_0xe8dd1[_0x6709('0x51')],_0xe8dd1[_0x6709('0x47')]);_0x483e15[_0x6709('0x44')]=_[_0x6709('0x55')](_0xe8dd1['model'],qs[_0x6709('0x56')](_0x594c43[_0x6709('0x47')][_0x6709('0x56')]));_0x483e15[_0x6709('0x44')]=_0x483e15[_0x6709('0x44')]['length']?_0x483e15['attributes']:_0xe8dd1[_0x6709('0x51')];if(_0x594c43['query']['includeAll']){_0x483e15[_0x6709('0x43')]=[{'all':!![]}];}_0x483e15=_[_0x6709('0x57')]({},_0x483e15,_0x594c43[_0x6709('0x58')]);if(!_[_0x6709('0x34')](_0x483e15[_0x6709('0x44')],'id')){_0x483e15[_0x6709('0x44')][_0x6709('0x49')]('id');}return db[_0x6709('0x3b')][_0x6709('0x35')](_0x483e15)[_0x6709('0x14')](handleEntityNotFound(_0x3091b8,null))[_0x6709('0x14')](function(_0x4d4ff9){var _0x125b32=[];values=_0x4d4ff9;if(_0x594c43[_0x6709('0x47')]['openTabs']==='true'){_0x125b32[_0x6709('0x49')](get_open_tabs(_0x6709('0x59'),_0x4d4ff9[_0x6709('0x4b')]));_0x125b32[_0x6709('0x49')](get_open_tabs('sms',_0x4d4ff9[_0x6709('0x4b')]));_0x125b32['push'](get_open_tabs(_0x6709('0x4d'),_0x4d4ff9[_0x6709('0x4b')]));_0x125b32[_0x6709('0x49')](get_open_tabs(_0x6709('0x4e'),_0x4d4ff9[_0x6709('0x4b')]));_0x125b32['push'](get_open_tabs('fax',_0x4d4ff9[_0x6709('0x4b')]));_0x125b32[_0x6709('0x49')](get_open_tabs('mail',_0x4d4ff9[_0x6709('0x4b')]));return BPromise[_0x6709('0x4f')](_0x125b32);}else{return values;}})['then'](function(_0xbb78ba){return values;})[_0x6709('0x14')](respondWithResult(_0x3091b8,null))[_0x6709('0x1e')](handleError(_0x3091b8,null));};exports[_0x6709('0x28')]=function(_0x4f596e,_0x4dca92){if(_0x4f596e[_0x6709('0x5a')]['id']){delete _0x4f596e['body']['id'];}delete _0x4f596e[_0x6709('0x5a')][_0x6709('0x36')];return db[_0x6709('0x3b')]['find']({'where':{'id':_0x4f596e[_0x6709('0x50')]['id']}})['then'](handleEntityNotFound(_0x4dca92,null))['then'](saveUpdates(_0x4f596e[_0x6709('0x5a')],null))['then'](respondWithResult(_0x4dca92,null))[_0x6709('0x1e')](handleError(_0x4dca92,null));};exports['describe']=function(_0x3e52e7,_0x34f790){return db[_0x6709('0x3b')][_0x6709('0x5b')]()['then'](respondWithResult(_0x34f790,null))[_0x6709('0x1e')](handleError(_0x34f790,null));};exports[_0x6709('0x5c')]=function(_0x27d041,_0x11c435){return db[_0x6709('0x3b')][_0x6709('0x35')]({'where':{'id':_0x27d041[_0x6709('0x50')]['id']}})['then'](handleEntityNotFound(_0x11c435,null))[_0x6709('0x14')](function(_0x123898){if(_0x123898){return _0x123898[_0x6709('0x5c')](_0x27d041[_0x6709('0x5a')][_0x6709('0x5d')],_[_0x6709('0x5e')](_0x27d041[_0x6709('0x5a')],[_0x6709('0x5d'),'id'])||{});}})[_0x6709('0x14')](respondWithResult(_0x11c435,null))['catch'](handleError(_0x11c435,null));};function validateUser(_0x469289){return new BPromise(function(_0x122080,_0x50f992){if(_0x469289[_0x6709('0x5f')])return _0x122080(_0x469289);return db[_0x6709('0x60')][_0x6709('0x61')](0x1)[_0x6709('0x14')](function(_0xfd93ef){if(_0xfd93ef[_0x6709('0x62')])authService[_0x6709('0x63')](_0x469289[_0x6709('0x3e')]);db[_0x6709('0x3b')]['max'](_0x6709('0x5f'))[_0x6709('0x14')](function(_0x114435){if(_[_0x6709('0x64')](_0x114435)){_0x469289[_0x6709('0x5f')]=_0xfd93ef[_0x6709('0x65')]||0x1;return;}if(_[_0x6709('0x64')](_0xfd93ef[_0x6709('0x65')])||_0xfd93ef[_0x6709('0x65')]===_0x114435){_0x469289[_0x6709('0x5f')]=_0x114435+0x1;return;}if(_0xfd93ef[_0x6709('0x65')]>_0x114435){_0x469289['internal']=_0xfd93ef[_0x6709('0x65')];return;}return db['sequelize']['query'](_0x6709('0x66'),{'type':db[_0x6709('0x67')][_0x6709('0x68')][_0x6709('0x69')]})[_0x6709('0x14')](function(_0x3c27bb){if(_0x3c27bb&&_0x3c27bb[_0x6709('0x48')]){for(var _0x5c1132=0x0,_0x5a61b8=_0x3c27bb[_0x6709('0x48')];_0x5c1132<_0x5a61b8&&_['isNil'](_0x469289[_0x6709('0x5f')]);_0x5c1132++){if(_0xfd93ef['min_internal']<=_0x3c27bb[_0x5c1132][_0x6709('0x6a')]){_0x469289[_0x6709('0x5f')]=_0x3c27bb[_0x5c1132]['from'];}else if(_0xfd93ef['min_internal']>_0x3c27bb[_0x5c1132]['from']&&_0xfd93ef[_0x6709('0x65')]<=_0x3c27bb[_0x5c1132]['to']){_0x469289[_0x6709('0x5f')]=_0xfd93ef[_0x6709('0x65')];}}}if(_[_0x6709('0x64')](_0x469289[_0x6709('0x5f')])){_0x469289[_0x6709('0x5f')]=_0x114435+0x1;}return _0x122080(_0x469289);});});})[_0x6709('0x1e')](function(_0x305e0d){_0x50f992(_0x305e0d);});});}function updateUser(_0x38520c){return new BPromise(function(_0x398c12,_0x1d2f35){try{if(_0x38520c[_0x6709('0x6b')]){_0x38520c[_0x6709('0x6c')]=_0x38520c['internal'];_0x38520c[_0x6709('0x6d')]={'mailbox':_0x38520c[_0x6709('0x5f')],'password':_0x38520c[_0x6709('0x3e')],'fullname':_0x38520c[_0x6709('0x6e')],'email':_0x38520c['email']};}if(_0x38520c['role']===_0x6709('0x2e')){if(!_0x38520c['permissions'])_0x38520c['permissions']=[_0x6709('0x6f'),_0x6709('0x70'),'103',_0x6709('0x71'),_0x6709('0x72'),_0x6709('0x73'),_0x6709('0x74'),_0x6709('0x75'),'107','108',_0x6709('0x76'),_0x6709('0x77'),'111',_0x6709('0x78'),_0x6709('0x79')];}_0x398c12(_0x38520c);}catch(_0x1c90d7){_0x1d2f35(_0x1c90d7);}});}exports['create']=function(_0x3963c2,_0x174a28){if(_0x3963c2[_0x6709('0x2c')][_0x6709('0x36')]==='agent')throw new Error('Unauthorized');if(_0x3963c2[_0x6709('0x5a')][_0x6709('0x36')]===_0x6709('0x2c')&&_0x3963c2[_0x6709('0x2c')][_0x6709('0x36')]!=='admin'){throw new Error(_0x6709('0x7a'));}if(_0x3963c2[_0x6709('0x5a')]['role']===_0x6709('0x7b')&&_0x3963c2[_0x6709('0x2c')][_0x6709('0x36')]!==_0x6709('0x7b')){throw new Error(_0x6709('0x7c'));}return licenseUtil['checkUserLimits']([_0x3963c2[_0x6709('0x5a')]])['then'](function(){return validateUser(_0x3963c2[_0x6709('0x5a')]);})['then'](function(_0x1a16c4){return updateUser(_0x1a16c4)[_0x6709('0x14')](function(_0x25b11d){if(_0x25b11d[_0x6709('0x36')]==='admin'){_0x25b11d[_0x6709('0x7d')]=_0x3963c2[_0x6709('0x2c')][_0x6709('0x7d')];delete _0x25b11d[_0x6709('0x7e')];}return _0x25b11d;});})[_0x6709('0x14')](function(_0x2c1aa6){return db['User'][_0x6709('0x7f')](_0x2c1aa6,{'include':[{'model':db[_0x6709('0x6d')],'as':_0x6709('0x6d')}]});})['then'](function(_0x308b8b){if(_0x3963c2[_0x6709('0x5a')]['role']===_0x6709('0x2c'))return _0x308b8b;if(_0x3963c2[_0x6709('0x2c')][_0x6709('0x36')]!=='user')return _0x308b8b;return db[_0x6709('0x80')][_0x6709('0x35')]({'where':{'name':_0x308b8b[_0x6709('0x36')]==='agent'?_0x6709('0x2d'):_0x6709('0x2f'),'userProfileId':_0x3963c2[_0x6709('0x2c')][_0x6709('0x7e')]},'raw':!![]})[_0x6709('0x14')](function(_0x5a48dc){if(!_0x5a48dc||_0x5a48dc['autoAssociation']!=0x0)return _0x308b8b;return db[_0x6709('0x37')][_0x6709('0x7f')]({'name':_0x308b8b['name'],'resourceId':_0x308b8b['id'],'type':_0x5a48dc[_0x6709('0x38')],'sectionId':_0x5a48dc['id']},{})[_0x6709('0x14')](function(){return _0x308b8b;});})[_0x6709('0x1e')](function(_0x5c69ee){logger[_0x6709('0x1a')](_0x6709('0x81'),_0x5c69ee);throw _0x5c69ee;});})[_0x6709('0x14')](respondWithResult(_0x174a28,0xc9))[_0x6709('0x1e')](handleError(_0x174a28,null));};exports[_0x6709('0x82')]=function(_0x22a4e6,_0x477a1d){var _0x48dce5=_0x22a4e6[_0x6709('0x5a')];var _0x4161d5=[];if(_0x22a4e6[_0x6709('0x2c')][_0x6709('0x36')]===_0x6709('0x2e'))throw new Error(_0x6709('0x83'));if(_[_0x6709('0x84')](_0x48dce5,['role',_0x6709('0x2c')])&&_0x22a4e6['user'][_0x6709('0x36')]!==_0x6709('0x7b')){throw new Error(_0x6709('0x7a'));}if(_[_0x6709('0x84')](_0x48dce5,[_0x6709('0x36'),_0x6709('0x7b')])&&_0x22a4e6[_0x6709('0x2c')][_0x6709('0x36')]!==_0x6709('0x7b')){throw new Error(_0x6709('0x85'));}return licenseUtil[_0x6709('0x86')](_0x48dce5)[_0x6709('0x14')](function(){return validateUser(_0x48dce5[0x0]);})[_0x6709('0x14')](function(){for(var _0x1a7b87=0x1;_0x1a7b87<_0x48dce5['length'];_0x1a7b87++){var _0x5be0df=_0x48dce5[_0x1a7b87-0x1][_0x6709('0x5f')];if(!_0x48dce5[_0x1a7b87][_0x6709('0x5f')])_0x48dce5[_0x1a7b87]['internal']=_0x5be0df+0x1;_0x4161d5[_0x6709('0x49')](validateUser(_0x48dce5[_0x1a7b87]));}return BPromise[_0x6709('0x4f')](_0x4161d5);})[_0x6709('0x14')](function(){_0x4161d5=[];for(var _0x25975d=0x0;_0x25975d<_0x48dce5[_0x6709('0x48')];_0x25975d++){_0x4161d5[_0x6709('0x49')](updateUser(_0x48dce5[_0x25975d]));}return BPromise[_0x6709('0x4f')](_0x4161d5);})['then'](function(){return BPromise[_0x6709('0x87')](_0x48dce5,function(_0x2385cb){return db[_0x6709('0x3b')][_0x6709('0x7f')](_0x2385cb,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})[_0x6709('0x14')](function(_0x17d074){_0x2385cb['id']=_0x17d074['id'];return _0x2385cb;});});})[_0x6709('0x14')](function(_0x1473ab){if(_0x22a4e6[_0x6709('0x5a')][_0x6709('0x36')]===_0x6709('0x2c'))return _0x1473ab;if(_0x22a4e6[_0x6709('0x2c')][_0x6709('0x36')]!==_0x6709('0x2c'))return _0x1473ab;var _0x1c9bc1=_[_0x6709('0x84')](_0x1473ab,function(_0x4969ab){return _0x4969ab[_0x6709('0x36')]===_0x6709('0x2e')||_0x4969ab[_0x6709('0x36')]==='telephone';});if(!_0x1c9bc1)return _0x1473ab;return db[_0x6709('0x80')][_0x6709('0x45')]({'where':{'name':{'$or':['Agents',_0x6709('0x2f')]},'userProfileId':_0x22a4e6['user'][_0x6709('0x7e')]},'raw':!![]})[_0x6709('0x14')](function(_0x1a247b){if(_[_0x6709('0x88')](_0x1a247b)||!_[_0x6709('0x84')](_0x1a247b,[_0x6709('0x89'),0x0]))return _0x1473ab;_0x4161d5=[];var _0x286aaf=_(_0x1a247b)[_0x6709('0x32')](function(_0x5d227a){if(_0x5d227a[_0x6709('0x89')]===0x1)return;return _0x5d227a[_0x6709('0x38')]===_0x6709('0x2d')?'agent':'telephone';})['compact']()[_0x6709('0x33')]();for(var _0xc95c8d=0x0;_0xc95c8d<_0x1473ab[_0x6709('0x48')];_0xc95c8d++){if(!_[_0x6709('0x34')](_0x286aaf,_0x1473ab[_0xc95c8d][_0x6709('0x36')]))return;var _0x57e2a9=_0x1473ab[_0xc95c8d][_0x6709('0x36')]==='agent'?_0x6709('0x2d'):_0x6709('0x2f');_0x4161d5[_0x6709('0x49')](db[_0x6709('0x37')]['create']({'name':_0x1473ab[_0xc95c8d][_0x6709('0x38')],'resourceId':_0x1473ab[_0xc95c8d]['id'],'type':_0x57e2a9,'sectionId':_[_0x6709('0x35')](_0x1a247b,['name',_0x57e2a9])['id']},{}));}return BPromise[_0x6709('0x4f')](_0x4161d5);});})[_0x6709('0x14')](respondWithResult(_0x477a1d,0xc9))[_0x6709('0x1e')](handleError(_0x477a1d,null));};exports[_0x6709('0x8a')]=function(_0x3b4539,_0x2dea9b){if(_0x3b4539[_0x6709('0x5a')]['id']){delete _0x3b4539[_0x6709('0x5a')]['id'];}return db[_0x6709('0x3b')][_0x6709('0x35')]({'where':{'id':_0x3b4539['params']['id']}})['then'](function(_0x49e603){if(!_0x49e603)return null;if(_0x49e603['id']===_0x3b4539['user']['id']){if(!_0x3b4539['body']['oldPassword']||!_0x3b4539['body'][_0x6709('0x8b')]){throw new db[(_0x6709('0x8c'))][(_0x6709('0x8d'))](_0x6709('0x8e'));}if(!_0x49e603[_0x6709('0x8f')](_0x3b4539[_0x6709('0x5a')][_0x6709('0x90')])){throw new db[(_0x6709('0x8c'))]['ValidationError'](_0x6709('0x91'));}if(_0x3b4539[_0x6709('0x5a')][_0x6709('0x90')]===_0x3b4539[_0x6709('0x5a')][_0x6709('0x8b')]){throw new db[(_0x6709('0x8c'))][(_0x6709('0x8d'))](_0x6709('0x92'));}}else if(_0x3b4539[_0x6709('0x2c')]['role']==='admin'){if(!_0x3b4539[_0x6709('0x5a')]['newPassword']){throw new db['Sequelize'][(_0x6709('0x8d'))](_0x6709('0x93'));}}else if(_0x3b4539[_0x6709('0x2c')][_0x6709('0x36')]===_0x6709('0x2c')){if(!_0x3b4539['body'][_0x6709('0x8b')]){throw new db['Sequelize'][(_0x6709('0x8d'))](_0x6709('0x93'));}if(_0x49e603['role']!=='agent'){throw new db[(_0x6709('0x8c'))][(_0x6709('0x8d'))]('Unauthorized');}}else{throw new db[(_0x6709('0x8c'))][(_0x6709('0x8d'))](_0x6709('0x83'));}return _0x49e603;})[_0x6709('0x14')](handleEntityNotFound(_0x2dea9b,null))[_0x6709('0x14')](function(_0x31aa88){return db[_0x6709('0x60')]['findOne']({'attributes':['id',_0x6709('0x62'),_0x6709('0x94'),_0x6709('0x95')]})[_0x6709('0x14')](function(_0x839d85){if(_0x839d85['securePassword'])authService[_0x6709('0x63')](_0x3b4539[_0x6709('0x5a')]['newPassword']);if(!_0x839d85['enforcePasswordHistory']||!_0x31aa88['previousPasswords'])return _0x31aa88;authService[_0x6709('0x96')](_0x3b4539['body'][_0x6709('0x8b')],_0x31aa88[_0x6709('0x97')],_0x839d85[_0x6709('0x95')]);return _0x31aa88;})[_0x6709('0x14')](saveUpdates({'password':_0x3b4539[_0x6709('0x5a')]['newPassword'],'passwordResetAt':_0x3b4539[_0x6709('0x2c')]['id']==_0x3b4539[_0x6709('0x50')]['id']?moment():null,'previousPasswords':authService[_0x6709('0x98')](_0x3b4539[_0x6709('0x5a')]['newPassword'],_0x31aa88[_0x6709('0x97')])},null));})['then'](respondWithResult(_0x2dea9b,null))['catch'](handleError(_0x2dea9b,null));};exports[_0x6709('0x99')]=function(_0x56eac7,_0x1bb733){var _0x40340f=_0x56eac7['body']['channel'];return db[_0x6709('0x3b')][_0x6709('0x35')]({'where':{'id':_0x56eac7['params']['id']},'attributes':['id','name',_0x6709('0x36'),_0x6709('0x9a'),'loginInPause',_0x6709('0x9b'),_0x6709('0x9c')]})[_0x6709('0x14')](handleEntityNotFound(_0x1bb733,null))[_0x6709('0x14')](function(_0x233e31){if(_0x233e31){if(!utils[_0x6709('0x9d')](_0x40340f)){throw new db[(_0x6709('0x8c'))][(_0x6709('0x8d'))](_0x6709('0x9e'));}return _0x233e31[_0x6709('0x9f')+_[_0x6709('0xa0')](_0x40340f[_0x6709('0xa1')]())+_0x6709('0xa2')](_0x56eac7['body'][_0x6709('0x5d')],{'penalty':_0x56eac7[_0x6709('0x5a')][_0x6709('0xa3')]||0x0})['spread'](function(_0x35504a){for(var _0x551010=0x0;_0x551010<_0x56eac7[_0x6709('0x5a')]['ids'][_0x6709('0x48')];_0x551010+=0x1){var _0xaca234={'UserId':Number(_0x56eac7[_0x6709('0x50')]['id'])};_0xaca234[_[_0x6709('0xa0')](_0x40340f[_0x6709('0xa1')]())+'QueueId']=Number(_0x56eac7[_0x6709('0x5a')]['ids'][_0x551010]);socket[_0x6709('0xa4')](_0x6709('0x2c')+_[_0x6709('0xa0')](_0x40340f['toLowerCase']())+'Queue:save',_0xaca234);}return _0x35504a;})[_0x6709('0x14')](function(){if(_0x40340f===_0x6709('0xa5')){return db[_0x6709('0xa6')]['findAll']({'where':{'id':_0x56eac7[_0x6709('0x5a')][_0x6709('0x5d')]||[]},'raw':!![],'attributes':['id',_0x6709('0x38')]});}})[_0x6709('0x14')](function(_0x1ea7e9){var _0x1d9c45=_0x233e31[_0x6709('0x2a')]({'plain':!![]});var _0x4c5ab8=[];if(_0x40340f==='voice'&&_0x1d9c45['role']===_0x6709('0x2e')&&_0x1d9c45['online']){for(var _0x1ce949=0x0;_0x1ce949<_0x1ea7e9[_0x6709('0x48')];_0x1ce949+=0x1){_0x4c5ab8[_0x6709('0x49')]({'membername':_0x1d9c45[_0x6709('0x38')],'UserId':_0x1d9c45['id'],'queue_name':_0x1ea7e9[_0x1ce949][_0x6709('0x38')],'VoiceQueueId':_0x1ea7e9[_0x1ce949]['id'],'interface':_['isNil'](_0x1d9c45['interface'])?util[_0x6709('0xa7')](_0x6709('0xa8'),_0x1d9c45[_0x6709('0x38')]):_0x1d9c45[_0x6709('0x9c')],'paused':_0x1d9c45['voicePause']||![],'penalty':_0x56eac7[_0x6709('0x5a')][_0x6709('0xa3')]||0x0});}return BPromise[_0x6709('0x87')](_0x4c5ab8,function(_0x27e527){return db[_0x6709('0xa9')][_0x6709('0xaa')](_0x27e527);});}return _0x233e31;});}})[_0x6709('0x14')](respondWithStatusCode(_0x1bb733,null))[_0x6709('0x1e')](handleError(_0x1bb733,null));};exports[_0x6709('0xab')]=function(_0xe6c75e,_0x437077){var _0x37b6f4;return db[_0x6709('0x3b')]['find']({'where':{'id':_0xe6c75e['params']['id']},'attributes':['id',_0x6709('0x38'),'role']})['then'](handleEntityNotFound(_0x437077,null))[_0x6709('0x14')](function(_0x5b9339){if(_0x5b9339){_0x37b6f4=_0x5b9339;if(!_0xe6c75e[_0x6709('0x47')][_0x6709('0xac')]||!utils[_0x6709('0x9d')](_0xe6c75e[_0x6709('0x47')][_0x6709('0xac')])){throw new db[(_0x6709('0x8c'))][(_0x6709('0x8d'))](_0x6709('0x9e'));}return _0x5b9339[_0x6709('0xad')+_['capitalize'](_0xe6c75e['query']['channel'][_0x6709('0xa1')]())+_0x6709('0xa2')](_0xe6c75e[_0x6709('0x47')][_0x6709('0x5d')]);}})[_0x6709('0x14')](function(_0x5ae419){if(_[_0x6709('0xae')](_0xe6c75e[_0x6709('0x47')][_0x6709('0x5d')])){for(var _0x1507b0=0x0;_0x1507b0<_0xe6c75e[_0x6709('0x47')][_0x6709('0x5d')]['length'];_0x1507b0+=0x1){var _0x576280={'UserId':Number(_0xe6c75e['params']['id'])};_0x576280[_['capitalize'](_0xe6c75e[_0x6709('0x47')][_0x6709('0xac')][_0x6709('0xa1')]())+'QueueId']=Number(_0xe6c75e['query'][_0x6709('0x5d')][_0x1507b0]);socket[_0x6709('0xa4')](_0x6709('0x2c')+_[_0x6709('0xa0')](_0xe6c75e['query'][_0x6709('0xac')][_0x6709('0xa1')]())+'Queue:remove',_0x576280);}}else{var _0x576280={'UserId':Number(_0xe6c75e[_0x6709('0x50')]['id'])};_0x576280[_[_0x6709('0xa0')](_0xe6c75e['query']['channel']['toLowerCase']())+'QueueId']=Number(_0xe6c75e['query'][_0x6709('0x5d')]);socket[_0x6709('0xa4')]('user'+_[_0x6709('0xa0')](_0xe6c75e[_0x6709('0x47')][_0x6709('0xac')][_0x6709('0xa1')]())+_0x6709('0xaf'),_0x576280);}return _0x5ae419;})[_0x6709('0x14')](function(){if(_0xe6c75e[_0x6709('0x47')][_0x6709('0xac')]===_0x6709('0xa5')){return db[_0x6709('0xa9')][_0x6709('0x29')]({'where':{'UserId':_0xe6c75e['params']['id'],'VoiceQueueId':_0xe6c75e[_0x6709('0x47')][_0x6709('0x5d')]},'individualHooks':!![]})[_0x6709('0x14')](function(){return _0x37b6f4;});}return _0x37b6f4;})[_0x6709('0x14')](respondWithStatusCode(_0x437077,null))[_0x6709('0x1e')](handleError(_0x437077,null));};exports[_0x6709('0xb0')]=function(_0x29478c,_0x197150){_0x29478c['body']['userpic']=_0x29478c[_0x6709('0xb1')][_0x6709('0xb2')];return db[_0x6709('0x3b')][_0x6709('0x35')]({'where':{'id':_0x29478c[_0x6709('0x50')]['id']}})['then'](handleEntityNotFound(_0x197150,null))[_0x6709('0x14')](saveUpdates(_0x29478c[_0x6709('0x5a')],null))['then'](respondWithResult(_0x197150,null))[_0x6709('0x1e')](handleError(_0x197150,null));};exports['getAvatar']=function(_0x49e954,_0x13ac21){var _0x20ef0f=path[_0x6709('0xb3')](config['root'],_0x6709('0xb4'));return db[_0x6709('0x3b')][_0x6709('0x35')]({'where':{'id':_0x49e954['params']['id']},'attributes':['id',_0x6709('0xb5')],'raw':!![]})[_0x6709('0x14')](handleEntityNotFound(_0x13ac21,null))[_0x6709('0x14')](function(_0x27bc21){if(_0x27bc21){if(_[_0x6709('0x64')](_0x27bc21[_0x6709('0xb5')])){return _0x13ac21['download'](_0x20ef0f);}else{if(!fs[_0x6709('0xb6')](path[_0x6709('0xb3')](config[_0x6709('0xb7')],_0x6709('0xb8'),_0x27bc21[_0x6709('0xb5')]))){return _0x13ac21['download'](_0x20ef0f);}return _0x13ac21['download'](path[_0x6709('0xb3')](config['root'],'server/files/images/',_0x27bc21['userpic']));}}})[_0x6709('0x1e')](handleError(_0x13ac21,null));};exports['getOpenTabs']=function(_0x4320f6,_0x33c55e){return db['User'][_0x6709('0x35')]({'where':{'id':_0x4320f6['params']['id']},'attributes':['id']})[_0x6709('0x14')](handleEntityNotFound(_0x33c55e,null))[_0x6709('0x14')](function(_0x13f9c4){var _0x554b8c=[];values=_0x13f9c4['dataValues'];_0x554b8c[_0x6709('0x49')](get_open_tabs(_0x6709('0x59'),_0x13f9c4[_0x6709('0x4b')]));_0x554b8c[_0x6709('0x49')](get_open_tabs('sms',_0x13f9c4[_0x6709('0x4b')]));_0x554b8c[_0x6709('0x49')](get_open_tabs('openchannel',_0x13f9c4[_0x6709('0x4b')]));_0x554b8c[_0x6709('0x49')](get_open_tabs(_0x6709('0x4e'),_0x13f9c4[_0x6709('0x4b')]));_0x554b8c['push'](get_open_tabs(_0x6709('0xb9'),_0x13f9c4[_0x6709('0x4b')]));_0x554b8c[_0x6709('0x49')](get_open_tabs(_0x6709('0x4c'),_0x13f9c4[_0x6709('0x4b')]));return BPromise['all'](_0x554b8c);})['then'](function(_0x80fc09){var _0x51ef62=[];if(_0x80fc09){for(var _0x458667=0x0;_0x458667=_0x36054a){_0x215a31=_0x36054a;_0x20202c=0xc8;}else{_0x20202c=0xce;}_0x4d2d6c['status'](_0x20202c);return _0x4d2d6c[_0xac4a('0x26')](_0xac4a('0x27'),_0x3bc318+'-'+_0x215a31+'/'+_0x36054a)[_0xac4a('0x21')](_0x2503d8);}return null;};}function saveUpdates(_0x2772fe){return function(_0x116700){if(_0x116700){return _0x116700['update'](_0x2772fe)['then'](function(_0xdb7e){return _0xdb7e;});}return null;};}function removeEntity(_0x7a948b){return function(_0x1f12d5){if(_0x1f12d5){return _0x1f12d5['destroy']()['then'](function(){var _0x355755=_0x1f12d5[_0xac4a('0x28')]({'plain':!![]});if(_0x355755[_0xac4a('0x29')]===_0xac4a('0x2a'))return;var _0x17118e=[{'name':'Users','value':_0xac4a('0x2b'),'ignore':!![]},{'name':'Agents','value':_0xac4a('0x2c'),'ignore':![]},{'name':'Telephones','value':_0xac4a('0x2d'),'ignore':![]}];var _0xfbe355=_(_0x17118e)[_0xac4a('0x2e')](_0xac4a('0x2f'))[_0xac4a('0x30')](_0xac4a('0x31'))[_0xac4a('0x31')]();if(_[_0xac4a('0x32')](_0xfbe355,_0x355755[_0xac4a('0x29')])){return;}var _0xfd7c16=_[_0xac4a('0x33')](_0x17118e,[_0xac4a('0x31'),_0x355755[_0xac4a('0x29')]])[_0xac4a('0x34')];return db['UserProfileResource'][_0xac4a('0x35')]({'where':{'type':_0xfd7c16,'resourceId':_0x355755['id']}})[_0xac4a('0x36')](function(){return _0x1f12d5;});})['then'](function(){_0x7a948b[_0xac4a('0x1f')](0xcc)[_0xac4a('0x20')]();});}};}function handleEntityNotFound(_0x565164){return function(_0x58804b){if(!_0x58804b){_0x565164[_0xac4a('0x37')](0x194);}return _0x58804b;};}function handleError(_0x1ba096,_0x1b42b6){_0x1b42b6=_0x1b42b6||0x1f4;return function(_0x3de9e2){logger['error'](_0x3de9e2[_0xac4a('0x38')]);if(_0x3de9e2[_0xac4a('0x34')]){delete _0x3de9e2['name'];}_0x1ba096[_0xac4a('0x1f')](_0x1b42b6)[_0xac4a('0x39')](_0x3de9e2);};}exports[_0xac4a('0x3a')]=function(_0x5f0eb8,_0x121328){var _0x357f06={},_0x1b5427={'count':0x0,'rows':[]};var _0x4e0445=_(db[_0xac4a('0x3b')][_0xac4a('0x3c')])['map'](function(_0x59bebf){return{'name':_0x59bebf[_0xac4a('0x3d')],'type':_0x59bebf['type']['key']};})['filter'](function(_0x4fee3a){return!_[_0xac4a('0x32')]([_0xac4a('0x3e'),_0xac4a('0x3f')],_0x4fee3a[_0xac4a('0x34')]);})[_0xac4a('0x31')]();_0x357f06=qs[_0xac4a('0x40')](_0x4e0445,_0x5f0eb8);var _0x4220e2={'where':_0x357f06[_0xac4a('0x41')]};return db[_0xac4a('0x3b')][_0xac4a('0x25')](_0x4220e2)[_0xac4a('0x36')](function(_0x1c2a87){_0x1b5427['count']=_0x1c2a87;if(_0x5f0eb8['query']['includeAll']){_0x357f06[_0xac4a('0x42')]=[{'all':!![]}];}if(!_[_0xac4a('0x32')](_0x357f06[_0xac4a('0x43')],'id')){_0x357f06[_0xac4a('0x43')][_0xac4a('0x44')]('id');}return db[_0xac4a('0x3b')][_0xac4a('0x45')](_0x357f06);})[_0xac4a('0x36')](function(_0x3e9973){_0x1b5427[_0xac4a('0x46')]=_0x3e9973;if(_0x5f0eb8['query'][_0xac4a('0x47')]===_0xac4a('0x48')){var _0x3d9595=[];for(var _0x3f24a1=0x0;_0x3f24a1<_0x1b5427[_0xac4a('0x46')]['length'];_0x3f24a1++){_0x3d9595[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x49'),_0x1b5427['rows'][_0x3f24a1][_0xac4a('0x4a')]));_0x3d9595['push'](get_open_tabs(_0xac4a('0x4b'),_0x1b5427[_0xac4a('0x46')][_0x3f24a1][_0xac4a('0x4a')]));_0x3d9595[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4c'),_0x1b5427[_0xac4a('0x46')][_0x3f24a1][_0xac4a('0x4a')]));_0x3d9595[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4d'),_0x1b5427[_0xac4a('0x46')][_0x3f24a1][_0xac4a('0x4a')]));_0x3d9595[_0xac4a('0x44')](get_open_tabs('openchannel',_0x1b5427[_0xac4a('0x46')][_0x3f24a1][_0xac4a('0x4a')]));_0x3d9595[_0xac4a('0x44')](get_open_tabs('whatsapp',_0x1b5427[_0xac4a('0x46')][_0x3f24a1][_0xac4a('0x4a')]));}return BPromise['all'](_0x3d9595)[_0xac4a('0x36')](function(_0x5a7f6e){return _0x1b5427;});}else{return _0x1b5427;}})[_0xac4a('0x36')](respondWithFilteredResult(_0x121328,_0x357f06))[_0xac4a('0x1e')](handleError(_0x121328,null));};exports[_0xac4a('0x4e')]=function(_0x5e3581,_0x588374){var _0x42fd9d={'raw':![],'where':{'id':_0x5e3581[_0xac4a('0x4f')]['id']}},_0x4aaeff={};_0x4aaeff['model']=_[_0xac4a('0x50')](_['keys'](db[_0xac4a('0x3b')][_0xac4a('0x3c')]),[_0xac4a('0x3e'),_0xac4a('0x3f')]);_0x4aaeff['query']=_[_0xac4a('0x51')](_0x5e3581[_0xac4a('0x52')]);_0x4aaeff[_0xac4a('0x53')]=_[_0xac4a('0x54')](_0x4aaeff[_0xac4a('0x55')],_0x4aaeff[_0xac4a('0x52')]);_0x42fd9d[_0xac4a('0x43')]=_['intersection'](_0x4aaeff[_0xac4a('0x55')],qs[_0xac4a('0x56')](_0x5e3581['query'][_0xac4a('0x56')]));_0x42fd9d[_0xac4a('0x43')]=_0x42fd9d[_0xac4a('0x43')][_0xac4a('0x57')]?_0x42fd9d['attributes']:_0x4aaeff[_0xac4a('0x55')];if(_0x5e3581[_0xac4a('0x52')][_0xac4a('0x58')]){_0x42fd9d[_0xac4a('0x42')]=[{'all':!![]}];}_0x42fd9d=_[_0xac4a('0x59')]({},_0x42fd9d,_0x5e3581['options']);if(!_[_0xac4a('0x32')](_0x42fd9d['attributes'],'id')){_0x42fd9d[_0xac4a('0x43')][_0xac4a('0x44')]('id');}return db['User']['find'](_0x42fd9d)[_0xac4a('0x36')](handleEntityNotFound(_0x588374,null))[_0xac4a('0x36')](function(_0x4d448f){var _0x18d29c=[];values=_0x4d448f;if(_0x5e3581[_0xac4a('0x52')][_0xac4a('0x47')]===_0xac4a('0x48')){_0x18d29c['push'](get_open_tabs(_0xac4a('0x49'),_0x4d448f[_0xac4a('0x4a')]));_0x18d29c[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4b'),_0x4d448f[_0xac4a('0x4a')]));_0x18d29c[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x5a'),_0x4d448f['dataValues']));_0x18d29c[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x5b'),_0x4d448f[_0xac4a('0x4a')]));_0x18d29c[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4c'),_0x4d448f[_0xac4a('0x4a')]));_0x18d29c[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4d'),_0x4d448f[_0xac4a('0x4a')]));return BPromise[_0xac4a('0x5c')](_0x18d29c);}else{return values;}})[_0xac4a('0x36')](function(_0x38dd4f){return values;})[_0xac4a('0x36')](respondWithResult(_0x588374,null))[_0xac4a('0x1e')](handleError(_0x588374,null));};exports[_0xac4a('0x5d')]=function(_0x11c753,_0x492aae){if(_0x11c753[_0xac4a('0x5e')]['id']){delete _0x11c753['body']['id'];}delete _0x11c753[_0xac4a('0x5e')]['role'];return db[_0xac4a('0x3b')]['find']({'where':{'id':_0x11c753[_0xac4a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x492aae,null))['then'](saveUpdates(_0x11c753[_0xac4a('0x5e')],null))[_0xac4a('0x36')](respondWithResult(_0x492aae,null))[_0xac4a('0x1e')](handleError(_0x492aae,null));};exports[_0xac4a('0x5f')]=function(_0x2f9940,_0xb7b884){return db['User'][_0xac4a('0x5f')]()['then'](respondWithResult(_0xb7b884,null))[_0xac4a('0x1e')](handleError(_0xb7b884,null));};exports['addContacts']=function(_0x347880,_0x19ce2c){return db[_0xac4a('0x3b')][_0xac4a('0x33')]({'where':{'id':_0x347880[_0xac4a('0x4f')]['id']}})[_0xac4a('0x36')](handleEntityNotFound(_0x19ce2c,null))[_0xac4a('0x36')](function(_0xe3e375){if(_0xe3e375){return _0xe3e375[_0xac4a('0x60')](_0x347880[_0xac4a('0x5e')][_0xac4a('0x61')],_[_0xac4a('0x62')](_0x347880[_0xac4a('0x5e')],[_0xac4a('0x61'),'id'])||{});}})[_0xac4a('0x36')](respondWithResult(_0x19ce2c,null))[_0xac4a('0x1e')](handleError(_0x19ce2c,null));};function validateUser(_0x38cb4f){return new BPromise(function(_0x4a0156,_0xa90d71){if(_0x38cb4f[_0xac4a('0x63')])return _0x4a0156(_0x38cb4f);return db['Setting'][_0xac4a('0x64')](0x1)[_0xac4a('0x36')](function(_0x2d24c7){if(_0x2d24c7[_0xac4a('0x65')])authService[_0xac4a('0x66')](_0x38cb4f['password']);db['User'][_0xac4a('0x67')](_0xac4a('0x63'))[_0xac4a('0x36')](function(_0x148288){if(_[_0xac4a('0x68')](_0x148288)){_0x38cb4f[_0xac4a('0x63')]=_0x2d24c7[_0xac4a('0x69')]||0x1;return;}if(_[_0xac4a('0x68')](_0x2d24c7[_0xac4a('0x69')])||_0x2d24c7[_0xac4a('0x69')]===_0x148288){_0x38cb4f[_0xac4a('0x63')]=_0x148288+0x1;return;}if(_0x2d24c7['min_internal']>_0x148288){_0x38cb4f['internal']=_0x2d24c7[_0xac4a('0x69')];return;}return db[_0xac4a('0x6a')][_0xac4a('0x52')](_0xac4a('0x6b'),{'type':db[_0xac4a('0x6a')][_0xac4a('0x6c')][_0xac4a('0x6d')]})[_0xac4a('0x36')](function(_0x453d62){if(_0x453d62&&_0x453d62[_0xac4a('0x57')]){for(var _0xb09b89=0x0,_0xb12cc5=_0x453d62['length'];_0xb09b89<_0xb12cc5&&_[_0xac4a('0x68')](_0x38cb4f[_0xac4a('0x63')]);_0xb09b89++){if(_0x2d24c7[_0xac4a('0x69')]<=_0x453d62[_0xb09b89][_0xac4a('0x6e')]){_0x38cb4f['internal']=_0x453d62[_0xb09b89][_0xac4a('0x6e')];}else if(_0x2d24c7['min_internal']>_0x453d62[_0xb09b89][_0xac4a('0x6e')]&&_0x2d24c7[_0xac4a('0x69')]<=_0x453d62[_0xb09b89]['to']){_0x38cb4f['internal']=_0x2d24c7['min_internal'];}}}if(_[_0xac4a('0x68')](_0x38cb4f[_0xac4a('0x63')])){_0x38cb4f[_0xac4a('0x63')]=_0x148288+0x1;}return _0x4a0156(_0x38cb4f);});});})['catch'](function(_0x3a0cf8){_0xa90d71(_0x3a0cf8);});});}function updateUser(_0x4d067d){return new BPromise(function(_0x114b11,_0x4a88c7){try{if(_0x4d067d['voicemail']){_0x4d067d[_0xac4a('0x6f')]=_0x4d067d['internal'];_0x4d067d[_0xac4a('0x70')]={'mailbox':_0x4d067d['internal'],'password':_0x4d067d[_0xac4a('0x3e')],'fullname':_0x4d067d[_0xac4a('0x71')],'email':_0x4d067d['email']};}if(_0x4d067d[_0xac4a('0x29')]==='agent'){if(!_0x4d067d[_0xac4a('0x72')])_0x4d067d[_0xac4a('0x72')]=['101',_0xac4a('0x73'),'103','113',_0xac4a('0x74'),'104',_0xac4a('0x75'),'106','107',_0xac4a('0x76'),_0xac4a('0x77'),_0xac4a('0x78'),'111','114',_0xac4a('0x79')];}_0x114b11(_0x4d067d);}catch(_0x9c0fa1){_0x4a88c7(_0x9c0fa1);}});}exports['create']=function(_0x4e93f5,_0x3824a2){if(_0x4e93f5[_0xac4a('0x2b')][_0xac4a('0x29')]===_0xac4a('0x2c'))throw new Error(_0xac4a('0x7a'));if(_0x4e93f5[_0xac4a('0x5e')][_0xac4a('0x29')]===_0xac4a('0x2b')&&_0x4e93f5[_0xac4a('0x2b')]['role']!==_0xac4a('0x2a')){throw new Error(_0xac4a('0x7b'));}if(_0x4e93f5[_0xac4a('0x5e')]['role']===_0xac4a('0x2a')&&_0x4e93f5[_0xac4a('0x2b')][_0xac4a('0x29')]!==_0xac4a('0x2a')){throw new Error(_0xac4a('0x7c'));}return licenseUtil['checkUserLimits']([_0x4e93f5[_0xac4a('0x5e')]])[_0xac4a('0x36')](function(){return validateUser(_0x4e93f5[_0xac4a('0x5e')]);})[_0xac4a('0x36')](function(_0x72c90c){return updateUser(_0x72c90c)[_0xac4a('0x36')](function(_0xd7bdd6){if(_0xd7bdd6['role']===_0xac4a('0x2a')){_0xd7bdd6[_0xac4a('0x7d')]=_0x4e93f5[_0xac4a('0x2b')][_0xac4a('0x7d')];delete _0xd7bdd6[_0xac4a('0x7e')];}return _0xd7bdd6;});})[_0xac4a('0x36')](function(_0x547eec){return db[_0xac4a('0x3b')][_0xac4a('0x7f')](_0x547eec,{'include':[{'model':db[_0xac4a('0x70')],'as':_0xac4a('0x70')}]});})['then'](function(_0x21a384){if(_0x4e93f5['body'][_0xac4a('0x29')]===_0xac4a('0x2b'))return _0x21a384;if(_0x4e93f5['user']['role']!==_0xac4a('0x2b'))return _0x21a384;return db[_0xac4a('0x80')][_0xac4a('0x33')]({'where':{'name':_0x21a384['role']===_0xac4a('0x2c')?'Agents':_0xac4a('0x81'),'userProfileId':_0x4e93f5[_0xac4a('0x2b')][_0xac4a('0x7e')]},'raw':!![]})[_0xac4a('0x36')](function(_0x2e2c92){if(!_0x2e2c92||_0x2e2c92['autoAssociation']!=0x0)return _0x21a384;return db['UserProfileResource'][_0xac4a('0x7f')]({'name':_0x21a384[_0xac4a('0x34')],'resourceId':_0x21a384['id'],'type':_0x2e2c92[_0xac4a('0x34')],'sectionId':_0x2e2c92['id']},{})[_0xac4a('0x36')](function(){return _0x21a384;});})[_0xac4a('0x1e')](function(_0x3c5bbc){logger[_0xac4a('0x1b')](_0xac4a('0x82'),_0x3c5bbc);throw _0x3c5bbc;});})['then'](respondWithResult(_0x3824a2,0xc9))['catch'](handleError(_0x3824a2,null));};exports[_0xac4a('0x83')]=function(_0x31cc9a,_0x247eee){var _0x950e60=_0x31cc9a[_0xac4a('0x5e')];var _0x2ea4a4=[];if(_0x31cc9a[_0xac4a('0x2b')][_0xac4a('0x29')]==='agent')throw new Error('Unauthorized');if(_[_0xac4a('0x84')](_0x950e60,[_0xac4a('0x29'),_0xac4a('0x2b')])&&_0x31cc9a[_0xac4a('0x2b')][_0xac4a('0x29')]!==_0xac4a('0x2a')){throw new Error(_0xac4a('0x7b'));}if(_['some'](_0x950e60,[_0xac4a('0x29'),_0xac4a('0x2a')])&&_0x31cc9a[_0xac4a('0x2b')]['role']!==_0xac4a('0x2a')){throw new Error(_0xac4a('0x85'));}return licenseUtil[_0xac4a('0x86')](_0x950e60)[_0xac4a('0x36')](function(){return validateUser(_0x950e60[0x0]);})[_0xac4a('0x36')](function(){for(var _0x27d023=0x1;_0x27d023<_0x950e60[_0xac4a('0x57')];_0x27d023++){var _0x2ef42a=_0x950e60[_0x27d023-0x1][_0xac4a('0x63')];if(!_0x950e60[_0x27d023]['internal'])_0x950e60[_0x27d023][_0xac4a('0x63')]=_0x2ef42a+0x1;_0x2ea4a4['push'](validateUser(_0x950e60[_0x27d023]));}return BPromise[_0xac4a('0x5c')](_0x2ea4a4);})[_0xac4a('0x36')](function(){_0x2ea4a4=[];for(var _0x3184b3=0x0;_0x3184b3<_0x950e60[_0xac4a('0x57')];_0x3184b3++){_0x2ea4a4[_0xac4a('0x44')](updateUser(_0x950e60[_0x3184b3]));}return BPromise[_0xac4a('0x5c')](_0x2ea4a4);})[_0xac4a('0x36')](function(){return BPromise['each'](_0x950e60,function(_0x2b883a){return db[_0xac4a('0x3b')][_0xac4a('0x7f')](_0x2b883a,{'include':[{'model':db[_0xac4a('0x70')],'as':_0xac4a('0x70')}]})['then'](function(_0x1b37d9){_0x2b883a['id']=_0x1b37d9['id'];return _0x2b883a;});});})[_0xac4a('0x36')](function(_0x4f2b19){if(_0x31cc9a['body'][_0xac4a('0x29')]===_0xac4a('0x2b'))return _0x4f2b19;if(_0x31cc9a['user'][_0xac4a('0x29')]!==_0xac4a('0x2b'))return _0x4f2b19;var _0x6afaba=_[_0xac4a('0x84')](_0x4f2b19,function(_0x31df2d){return _0x31df2d[_0xac4a('0x29')]==='agent'||_0x31df2d[_0xac4a('0x29')]===_0xac4a('0x2d');});if(!_0x6afaba)return _0x4f2b19;return db[_0xac4a('0x80')]['findAll']({'where':{'name':{'$or':[_0xac4a('0x87'),_0xac4a('0x81')]},'userProfileId':_0x31cc9a[_0xac4a('0x2b')][_0xac4a('0x7e')]},'raw':!![]})[_0xac4a('0x36')](function(_0x23d635){if(_['isEmpty'](_0x23d635)||!_[_0xac4a('0x84')](_0x23d635,[_0xac4a('0x88'),0x0]))return _0x4f2b19;_0x2ea4a4=[];var _0x5ab83b=_(_0x23d635)[_0xac4a('0x30')](function(_0x55054a){if(_0x55054a[_0xac4a('0x88')]===0x1)return;return _0x55054a[_0xac4a('0x34')]==='Agents'?_0xac4a('0x2c'):'telephone';})[_0xac4a('0x89')]()['value']();for(var _0x3c601e=0x0;_0x3c601e<_0x4f2b19[_0xac4a('0x57')];_0x3c601e++){if(!_[_0xac4a('0x32')](_0x5ab83b,_0x4f2b19[_0x3c601e][_0xac4a('0x29')]))return;var _0xc38492=_0x4f2b19[_0x3c601e][_0xac4a('0x29')]===_0xac4a('0x2c')?_0xac4a('0x87'):_0xac4a('0x81');_0x2ea4a4[_0xac4a('0x44')](db[_0xac4a('0x8a')][_0xac4a('0x7f')]({'name':_0x4f2b19[_0x3c601e][_0xac4a('0x34')],'resourceId':_0x4f2b19[_0x3c601e]['id'],'type':_0xc38492,'sectionId':_[_0xac4a('0x33')](_0x23d635,['name',_0xc38492])['id']},{}));}return BPromise[_0xac4a('0x5c')](_0x2ea4a4);});})[_0xac4a('0x36')](respondWithResult(_0x247eee,0xc9))['catch'](handleError(_0x247eee,null));};exports[_0xac4a('0x8b')]=function(_0x31d190,_0x1b10ad){if(_0x31d190[_0xac4a('0x5e')]['id']){delete _0x31d190[_0xac4a('0x5e')]['id'];}return db['User'][_0xac4a('0x33')]({'where':{'id':_0x31d190['params']['id']}})[_0xac4a('0x36')](function(_0x28ae76){if(!_0x28ae76)return null;if(_0x28ae76['id']===_0x31d190[_0xac4a('0x2b')]['id']){if(!_0x31d190[_0xac4a('0x5e')]['oldPassword']||!_0x31d190[_0xac4a('0x5e')]['newPassword']){throw new db[(_0xac4a('0x8c'))][(_0xac4a('0x8d'))](_0xac4a('0x8e'));}if(!_0x28ae76['authenticate'](_0x31d190[_0xac4a('0x5e')][_0xac4a('0x8f')])){throw new db[(_0xac4a('0x8c'))]['ValidationError'](_0xac4a('0x90'));}if(_0x31d190[_0xac4a('0x5e')][_0xac4a('0x8f')]===_0x31d190[_0xac4a('0x5e')][_0xac4a('0x91')]){throw new db[(_0xac4a('0x8c'))][(_0xac4a('0x8d'))](_0xac4a('0x92'));}}else if(_0x31d190['user'][_0xac4a('0x29')]==='admin'){if(!_0x31d190['body']['newPassword']){throw new db['Sequelize']['ValidationError'](_0xac4a('0x93'));}}else if(_0x31d190[_0xac4a('0x2b')][_0xac4a('0x29')]===_0xac4a('0x2b')){if(!_0x31d190[_0xac4a('0x5e')]['newPassword']){throw new db[(_0xac4a('0x8c'))][(_0xac4a('0x8d'))](_0xac4a('0x93'));}if(_0x28ae76[_0xac4a('0x29')]!==_0xac4a('0x2c')){throw new db[(_0xac4a('0x8c'))][(_0xac4a('0x8d'))](_0xac4a('0x7a'));}}else{throw new db['Sequelize'][(_0xac4a('0x8d'))](_0xac4a('0x7a'));}return _0x28ae76;})[_0xac4a('0x36')](handleEntityNotFound(_0x1b10ad,null))[_0xac4a('0x36')](function(_0x303d5d){return db[_0xac4a('0x94')][_0xac4a('0x95')]({'attributes':['id','securePassword','enforcePasswordHistory',_0xac4a('0x96')]})[_0xac4a('0x36')](function(_0x51993a){if(_0x51993a[_0xac4a('0x65')])authService[_0xac4a('0x66')](_0x31d190['body']['newPassword']);if(!_0x51993a[_0xac4a('0x97')]||!_0x303d5d[_0xac4a('0x98')])return _0x303d5d;authService[_0xac4a('0x99')](_0x31d190[_0xac4a('0x5e')][_0xac4a('0x91')],_0x303d5d['previousPasswords'],_0x51993a[_0xac4a('0x96')]);return _0x303d5d;})['then'](saveUpdates({'password':_0x31d190['body']['newPassword'],'passwordResetAt':_0x31d190[_0xac4a('0x2b')]['id']==_0x31d190[_0xac4a('0x4f')]['id']?moment():null,'previousPasswords':authService[_0xac4a('0x9a')](_0x31d190[_0xac4a('0x5e')][_0xac4a('0x91')],_0x303d5d[_0xac4a('0x98')])},null));})[_0xac4a('0x36')](respondWithResult(_0x1b10ad,null))[_0xac4a('0x1e')](handleError(_0x1b10ad,null));};exports['addQueues']=function(_0x5e1662,_0x53bcbc){var _0x3305a5=_0x5e1662[_0xac4a('0x5e')][_0xac4a('0x9b')];return db[_0xac4a('0x3b')][_0xac4a('0x33')]({'where':{'id':_0x5e1662[_0xac4a('0x4f')]['id']},'attributes':['id',_0xac4a('0x34'),_0xac4a('0x29'),_0xac4a('0x9c'),_0xac4a('0x9d'),_0xac4a('0x9e'),_0xac4a('0x9f')]})[_0xac4a('0x36')](handleEntityNotFound(_0x53bcbc,null))[_0xac4a('0x36')](function(_0x356a6b){if(_0x356a6b){if(!utils[_0xac4a('0xa0')](_0x3305a5)){throw new db[(_0xac4a('0x8c'))][(_0xac4a('0x8d'))](_0xac4a('0xa1'));}return _0x356a6b[_0xac4a('0xa2')+_[_0xac4a('0xa3')](_0x3305a5[_0xac4a('0xa4')]())+_0xac4a('0xa5')](_0x5e1662['body'][_0xac4a('0x61')],{'penalty':_0x5e1662[_0xac4a('0x5e')][_0xac4a('0xa6')]||0x0})[_0xac4a('0xa7')](function(_0x237312){for(var _0x31afd2=0x0;_0x31afd2<_0x5e1662[_0xac4a('0x5e')][_0xac4a('0x61')]['length'];_0x31afd2+=0x1){var _0x5127ea={'UserId':Number(_0x5e1662[_0xac4a('0x4f')]['id'])};_0x5127ea[_[_0xac4a('0xa3')](_0x3305a5[_0xac4a('0xa4')]())+'QueueId']=Number(_0x5e1662['body']['ids'][_0x31afd2]);socket[_0xac4a('0xa8')]('user'+_[_0xac4a('0xa3')](_0x3305a5[_0xac4a('0xa4')]())+'Queue:save',_0x5127ea);}return _0x237312;})[_0xac4a('0x36')](function(){if(_0x3305a5==='voice'){return db[_0xac4a('0xa9')][_0xac4a('0x45')]({'where':{'id':_0x5e1662[_0xac4a('0x5e')][_0xac4a('0x61')]||[]},'raw':!![],'attributes':['id',_0xac4a('0x34')]});}})[_0xac4a('0x36')](function(_0x5e0602){var _0x25bf23=_0x356a6b[_0xac4a('0x28')]({'plain':!![]});var _0x2c03a1=[];if(_0x3305a5==='voice'&&_0x25bf23[_0xac4a('0x29')]===_0xac4a('0x2c')&&_0x25bf23[_0xac4a('0x9c')]){for(var _0x247856=0x0;_0x247856<_0x5e0602['length'];_0x247856+=0x1){_0x2c03a1[_0xac4a('0x44')]({'membername':_0x25bf23[_0xac4a('0x34')],'UserId':_0x25bf23['id'],'queue_name':_0x5e0602[_0x247856][_0xac4a('0x34')],'VoiceQueueId':_0x5e0602[_0x247856]['id'],'interface':_[_0xac4a('0x68')](_0x25bf23[_0xac4a('0x9f')])?util[_0xac4a('0xaa')]('SIP/%s',_0x25bf23['name']):_0x25bf23[_0xac4a('0x9f')],'paused':_0x25bf23[_0xac4a('0x9e')]||![],'penalty':_0x5e1662[_0xac4a('0x5e')][_0xac4a('0xa6')]||0x0});}return BPromise[_0xac4a('0xab')](_0x2c03a1,function(_0x1a12a2){return db['UserVoiceQueueRt'][_0xac4a('0xac')](_0x1a12a2);});}return _0x356a6b;});}})['then'](respondWithStatusCode(_0x53bcbc,null))[_0xac4a('0x1e')](handleError(_0x53bcbc,null));};exports['removeQueues']=function(_0xa1df14,_0x13b938){var _0x15f35a;return db[_0xac4a('0x3b')]['find']({'where':{'id':_0xa1df14[_0xac4a('0x4f')]['id']},'attributes':['id',_0xac4a('0x34'),_0xac4a('0x29')]})[_0xac4a('0x36')](handleEntityNotFound(_0x13b938,null))[_0xac4a('0x36')](function(_0x520001){if(_0x520001){_0x15f35a=_0x520001;if(!_0xa1df14[_0xac4a('0x52')][_0xac4a('0x9b')]||!utils[_0xac4a('0xa0')](_0xa1df14[_0xac4a('0x52')][_0xac4a('0x9b')])){throw new db['Sequelize'][(_0xac4a('0x8d'))](_0xac4a('0xa1'));}return _0x520001[_0xac4a('0xad')+_[_0xac4a('0xa3')](_0xa1df14[_0xac4a('0x52')]['channel']['toLowerCase']())+'Queues'](_0xa1df14['query'][_0xac4a('0x61')]);}})[_0xac4a('0x36')](function(_0x17f815){if(_[_0xac4a('0xae')](_0xa1df14[_0xac4a('0x52')]['ids'])){for(var _0x293d49=0x0;_0x293d49<_0xa1df14[_0xac4a('0x52')]['ids'][_0xac4a('0x57')];_0x293d49+=0x1){var _0x11faad={'UserId':Number(_0xa1df14[_0xac4a('0x4f')]['id'])};_0x11faad[_['capitalize'](_0xa1df14[_0xac4a('0x52')][_0xac4a('0x9b')][_0xac4a('0xa4')]())+_0xac4a('0xaf')]=Number(_0xa1df14[_0xac4a('0x52')][_0xac4a('0x61')][_0x293d49]);socket[_0xac4a('0xa8')](_0xac4a('0x2b')+_[_0xac4a('0xa3')](_0xa1df14['query'][_0xac4a('0x9b')][_0xac4a('0xa4')]())+'Queue:remove',_0x11faad);}}else{var _0x11faad={'UserId':Number(_0xa1df14['params']['id'])};_0x11faad[_[_0xac4a('0xa3')](_0xa1df14[_0xac4a('0x52')]['channel'][_0xac4a('0xa4')]())+_0xac4a('0xaf')]=Number(_0xa1df14[_0xac4a('0x52')][_0xac4a('0x61')]);socket[_0xac4a('0xa8')](_0xac4a('0x2b')+_[_0xac4a('0xa3')](_0xa1df14[_0xac4a('0x52')]['channel']['toLowerCase']())+_0xac4a('0xb0'),_0x11faad);}return _0x17f815;})['then'](function(){if(_0xa1df14['query'][_0xac4a('0x9b')]===_0xac4a('0xb1')){return db[_0xac4a('0xb2')]['destroy']({'where':{'UserId':_0xa1df14[_0xac4a('0x4f')]['id'],'VoiceQueueId':_0xa1df14[_0xac4a('0x52')]['ids']},'individualHooks':!![]})['then'](function(){return _0x15f35a;});}return _0x15f35a;})[_0xac4a('0x36')](respondWithStatusCode(_0x13b938,null))[_0xac4a('0x1e')](handleError(_0x13b938,null));};exports[_0xac4a('0xb3')]=function(_0x368546,_0x4fadd1){_0x368546[_0xac4a('0x5e')][_0xac4a('0xb4')]=_0x368546[_0xac4a('0xb5')]['filename'];return db[_0xac4a('0x3b')][_0xac4a('0x33')]({'where':{'id':_0x368546[_0xac4a('0x4f')]['id']}})[_0xac4a('0x36')](handleEntityNotFound(_0x4fadd1,null))[_0xac4a('0x36')](saveUpdates(_0x368546['body'],null))['then'](respondWithResult(_0x4fadd1,null))[_0xac4a('0x1e')](handleError(_0x4fadd1,null));};exports[_0xac4a('0xb6')]=function(_0x1774e5,_0x110e16){var _0x14ca03=path[_0xac4a('0xb7')](config[_0xac4a('0xb8')],_0xac4a('0xb9'));return db[_0xac4a('0x3b')][_0xac4a('0x33')]({'where':{'id':_0x1774e5[_0xac4a('0x4f')]['id']},'attributes':['id',_0xac4a('0xb4')],'raw':!![]})[_0xac4a('0x36')](handleEntityNotFound(_0x110e16,null))['then'](function(_0x3ef9b2){if(_0x3ef9b2){if(_['isNil'](_0x3ef9b2['userpic'])){return _0x110e16[_0xac4a('0xba')](_0x14ca03);}else{if(!fs[_0xac4a('0xbb')](path[_0xac4a('0xb7')](config[_0xac4a('0xb8')],_0xac4a('0xbc'),_0x3ef9b2[_0xac4a('0xb4')]))){return _0x110e16[_0xac4a('0xba')](_0x14ca03);}return _0x110e16[_0xac4a('0xba')](path[_0xac4a('0xb7')](config['root'],_0xac4a('0xbc'),_0x3ef9b2[_0xac4a('0xb4')]));}}})[_0xac4a('0x1e')](handleError(_0x110e16,null));};exports[_0xac4a('0xbd')]=function(_0x5c0bb8,_0x5b1934){return db[_0xac4a('0x3b')][_0xac4a('0x33')]({'where':{'id':_0x5c0bb8[_0xac4a('0x4f')]['id']},'attributes':['id']})[_0xac4a('0x36')](handleEntityNotFound(_0x5b1934,null))[_0xac4a('0x36')](function(_0x254de8){var _0x1c7ea7=[];values=_0x254de8[_0xac4a('0x4a')];_0x1c7ea7[_0xac4a('0x44')](get_open_tabs('chat',_0x254de8[_0xac4a('0x4a')]));_0x1c7ea7[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x4b'),_0x254de8[_0xac4a('0x4a')]));_0x1c7ea7[_0xac4a('0x44')](get_open_tabs(_0xac4a('0x5a'),_0x254de8['dataValues']));_0x1c7ea7['push'](get_open_tabs('whatsapp',_0x254de8[_0xac4a('0x4a')]));_0x1c7ea7[_0xac4a('0x44')](get_open_tabs('fax',_0x254de8['dataValues']));_0x1c7ea7[_0xac4a('0x44')](get_open_tabs('mail',_0x254de8[_0xac4a('0x4a')]));return BPromise['all'](_0x1c7ea7);})[_0xac4a('0x36')](function(_0x2abd82){var _0x1888c3=[];if(_0x2abd82){for(var _0x27e640=0x0;_0x27e640=_0x5289d9[_0xabff('0x52')]){throw new Error(_0xabff('0x53'));}})[_0xabff('0x10')](function(){if(_0x250c9c){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x250c9c[_0xabff('0x29')]},'individualHooks':!![]});}})[_0xabff('0x10')](function(){if(_0x250c9c){return _0x250c9c[_0xabff('0x54')]({'raw':!![]});}})['then'](function(_0x1abf6c){if(_0x250c9c){if(_0x1abf6c){var _0x3e58cc=[];_0x34634e=_0x1abf6c;if(_0x34634e['length']){for(var _0x2c235a=0x0;_0x2c235a<_0x34634e[_0xabff('0x31')];_0x2c235a++){_0x3e58cc[_0xabff('0x35')](db['UserVoiceQueueRt'][_0xabff('0x55')]({'membername':_0x250c9c[_0xabff('0x29')],'UserId':_0x250c9c['id'],'queue_name':_0x34634e[_0x2c235a][_0xabff('0x29')],'VoiceQueueId':_0x34634e[_0x2c235a]['id'],'interface':_0x559d75,'paused':_0x250c9c[_0xabff('0x56')]||![],'penalty':_0x34634e[_0x2c235a][_0xabff('0x57')]||0x0}));}return BPromise[_0xabff('0x4b')](_0x3e58cc);}}}})['then'](function(){if(_0x250c9c){return db[_0xabff('0x2e')][_0xabff('0x2f')]({'where':{'membername':_0x250c9c[_0xabff('0x29')],'exitAt':null}});}})[_0xabff('0x10')](function(_0x25d86e){if(_0x250c9c){if(_0x25d86e&&_0x25d86e[_0xabff('0x31')]){var _0x1a4c64=[];_0x25d86e[_0xabff('0x34')](function(_0x5c9198){_0x1a4c64[_0xabff('0x35')](_0x5c9198['update']({'exitAt':moment()[_0xabff('0x39')](_0xabff('0x3d'))}));});return BPromise[_0xabff('0x4b')](_0x1a4c64);}}})[_0xabff('0x10')](function(_0x1da23f){if(_0x250c9c){var _0x169a0c=[];var _0x37b60a=[];var _0x10cc9d=utils[_0xabff('0x33')]();var _0x2bcfc4={'membername':_0x250c9c['name'],'interface':_0x559d75,'enterAt':moment()[_0xabff('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x250c9c[_0xabff('0x2a')],'internal':_0x250c9c[_0xabff('0x2b')]};_0x10cc9d[_0xabff('0x34')](function(_0x29fecd){_0x169a0c[_0xabff('0x35')](_[_0xabff('0x58')]({'channel':_0x29fecd,'type':'LOGIN','data1':_0xabff('0x59'),'data2':_0x559d75},_0x2bcfc4));if(_0x250c9c['loginInPause']){_0x37b60a[_0xabff('0x35')](_['merge']({'channel':_0x29fecd,'type':'PAUSE','data1':'LOGININPAUSE'},_0x2bcfc4));}});return db[_0xabff('0x2e')][_0xabff('0x3c')](_0x169a0c['concat'](_0x37b60a),{'individualHooks':!![]});}})['then'](function(){if(_0x250c9c){return _0x250c9c[_0xabff('0x2d')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x250c9c['loginInPause']||![],'mailPause':_0x250c9c[_0xabff('0x56')]||![],'chatPause':_0x250c9c['loginInPause']||![],'faxPause':_0x250c9c[_0xabff('0x56')]||![],'smsPause':_0x250c9c[_0xabff('0x56')]||![],'openchannelPause':_0x250c9c[_0xabff('0x56')]||![],'pauseType':_0x250c9c[_0xabff('0x56')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xabff('0x39')](_0xabff('0x3d')),'interface':_0x559d75});}})['then'](function(_0x42ddb2){_0xe93314(_0x42ddb2);})['catch'](function(_0x3b6c46){_0x302bc3(_0x2f3cde[_0xabff('0x14')](0x1f4,_0x3b6c46['message']));});});}; \ No newline at end of file +var _0xb6b6=['YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','isNil','format','SIP/%s','body','DEFAULT\x20PAUSE','uniqueid','bulkCreate','type','UnpauseUser','findOne','channel','isValidChannel','UserVoiceQueueRt','find','fax','sms','whatsapp','PAUSE','system','set','Pause','push','all','LogoutUser','destroy','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','UserVoiceQueue.penalty','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./user.socket','request','info','User,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetUser','User','options','raw','where','limit','map','include','model','attributes','then','debug','catch','ShowUser','role','internal','interface','update','MemberReport','findAll','name','length'];(function(_0x14b5af,_0x5c6711){var _0x123289=function(_0x4ac6dd){while(--_0x4ac6dd){_0x14b5af['push'](_0x14b5af['shift']());}};_0x123289(++_0x5c6711);}(_0xb6b6,0x84));var _0x6b6b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb6b6[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x6b6b('0x0'));var util=require(_0x6b6b('0x1'));var moment=require('moment');var BPromise=require(_0x6b6b('0x2'));var rs=require(_0x6b6b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6b6b('0x4'))(_0x6b6b('0x5'));var config=require(_0x6b6b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6b6b('0x7')]['http']({'port':0x232a});config[_0x6b6b('0x8')]=_['defaults'](config['redis'],{'host':_0x6b6b('0x9'),'port':0x18eb});var socket=require(_0x6b6b('0xa'))(new Redis(config[_0x6b6b('0x8')]));require(_0x6b6b('0xb'))['register'](socket);function respondWithRpcPromise(_0x4e248a,_0x3d0b87,_0xc3e4e7){return new BPromise(function(_0x26b8e0,_0x5ad5c0){return client[_0x6b6b('0xc')](_0x4e248a,_0xc3e4e7)['then'](function(_0x30f48d){logger[_0x6b6b('0xd')](_0x6b6b('0xe'),_0x3d0b87,_0x6b6b('0xf'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x3d0b87,'request\x20sent',JSON[_0x6b6b('0x10')](_0x30f48d));if(_0x30f48d[_0x6b6b('0x11')]){if(_0x30f48d['error']['code']===0x1f4){logger[_0x6b6b('0x11')]('User,\x20%s,\x20%s',_0x3d0b87,_0x30f48d['error'][_0x6b6b('0x12')]);return _0x5ad5c0(_0x30f48d[_0x6b6b('0x11')][_0x6b6b('0x12')]);}logger[_0x6b6b('0x11')]('User,\x20%s,\x20%s',_0x3d0b87,_0x30f48d['error']['message']);return _0x26b8e0(_0x30f48d[_0x6b6b('0x11')][_0x6b6b('0x12')]);}else{logger[_0x6b6b('0xd')]('User,\x20%s,\x20%s',_0x3d0b87,_0x6b6b('0xf'));_0x26b8e0(_0x30f48d[_0x6b6b('0x13')][_0x6b6b('0x12')]);}})['catch'](function(_0x5dc6e7){logger[_0x6b6b('0x11')](_0x6b6b('0xe'),_0x3d0b87,_0x5dc6e7);_0x5ad5c0(_0x5dc6e7);});});}exports[_0x6b6b('0x14')]=function(_0x4014c3){var _0x1df559=this;return new Promise(function(_0x28e1c9,_0xaac2c4){return db[_0x6b6b('0x15')]['findAll']({'raw':_0x4014c3[_0x6b6b('0x16')]?_0x4014c3['options'][_0x6b6b('0x17')]===undefined?!![]:![]:!![],'where':_0x4014c3['options']?_0x4014c3[_0x6b6b('0x16')][_0x6b6b('0x18')]||null:null,'attributes':_0x4014c3['options']?_0x4014c3[_0x6b6b('0x16')]['attributes']||null:null,'limit':_0x4014c3[_0x6b6b('0x16')]?_0x4014c3['options'][_0x6b6b('0x19')]||null:null,'include':_0x4014c3[_0x6b6b('0x16')]?_0x4014c3['options']['include']?_[_0x6b6b('0x1a')](_0x4014c3[_0x6b6b('0x16')][_0x6b6b('0x1b')],function(_0x26a2c4){return{'model':db[_0x26a2c4[_0x6b6b('0x1c')]],'as':_0x26a2c4['as'],'attributes':_0x26a2c4[_0x6b6b('0x1d')],'include':_0x26a2c4[_0x6b6b('0x1b')]?_[_0x6b6b('0x1a')](_0x26a2c4['include'],function(_0x522110){return{'model':db[_0x522110[_0x6b6b('0x1c')]],'as':_0x522110['as'],'attributes':_0x522110[_0x6b6b('0x1d')],'include':_0x522110[_0x6b6b('0x1b')]?_['map'](_0x522110[_0x6b6b('0x1b')],function(_0x482afd){return{'model':db[_0x482afd[_0x6b6b('0x1c')]],'as':_0x482afd['as'],'attributes':_0x482afd['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b6b('0x1e')](function(_0x303689){logger[_0x6b6b('0xd')](_0x6b6b('0x14'),_0x4014c3);logger[_0x6b6b('0x1f')](_0x6b6b('0x14'),_0x4014c3,JSON['stringify'](_0x303689));_0x28e1c9(_0x303689);})[_0x6b6b('0x20')](function(_0x31c7d8){logger['error'](_0x6b6b('0x14'),_0x31c7d8[_0x6b6b('0x12')],_0x4014c3);_0xaac2c4(_0x1df559[_0x6b6b('0x11')](0x1f4,_0x31c7d8['message']));});});};exports['ShowUser']=function(_0x21af92){var _0x51755c=this;return new Promise(function(_0x3b93a9,_0x3327d9){return db[_0x6b6b('0x15')]['find']({'raw':_0x21af92[_0x6b6b('0x16')]?_0x21af92[_0x6b6b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x21af92[_0x6b6b('0x16')]?_0x21af92[_0x6b6b('0x16')][_0x6b6b('0x18')]||null:null,'attributes':_0x21af92[_0x6b6b('0x16')]?_0x21af92['options']['attributes']||null:null,'include':_0x21af92[_0x6b6b('0x16')]?_0x21af92[_0x6b6b('0x16')]['include']?_[_0x6b6b('0x1a')](_0x21af92[_0x6b6b('0x16')][_0x6b6b('0x1b')],function(_0x2e12de){return{'model':db[_0x2e12de['model']],'as':_0x2e12de['as'],'attributes':_0x2e12de[_0x6b6b('0x1d')],'include':_0x2e12de[_0x6b6b('0x1b')]?_[_0x6b6b('0x1a')](_0x2e12de['include'],function(_0x4f55a7){return{'model':db[_0x4f55a7[_0x6b6b('0x1c')]],'as':_0x4f55a7['as'],'attributes':_0x4f55a7[_0x6b6b('0x1d')],'include':_0x4f55a7[_0x6b6b('0x1b')]?_[_0x6b6b('0x1a')](_0x4f55a7[_0x6b6b('0x1b')],function(_0x21cf3a){return{'model':db[_0x21cf3a['model']],'as':_0x21cf3a['as'],'attributes':_0x21cf3a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e1242){logger[_0x6b6b('0xd')](_0x6b6b('0x21'),_0x21af92);logger[_0x6b6b('0x1f')](_0x6b6b('0x21'),_0x21af92,JSON['stringify'](_0x2e1242));_0x3b93a9(_0x2e1242);})[_0x6b6b('0x20')](function(_0x461217){logger['error']('ShowUser',_0x461217[_0x6b6b('0x12')],_0x21af92);_0x3327d9(_0x51755c[_0x6b6b('0x11')](0x1f4,_0x461217[_0x6b6b('0x12')]));});});};exports['PauseUser']=function(_0xfd2b5d){var _0x3e2464=this;return new Promise(function(_0xc4faf7,_0x5672df){var _0x25a22f;return db[_0x6b6b('0x15')]['find']({'where':_0xfd2b5d['options'][_0x6b6b('0x18')]||{},'attributes':['id','name',_0x6b6b('0x22'),_0x6b6b('0x23'),_0x6b6b('0x24')]})[_0x6b6b('0x1e')](function(_0x5500a6){if(_0x5500a6){_0x25a22f=_0x5500a6;return db['UserVoiceQueueRt'][_0x6b6b('0x25')]({'paused':0x1},{'where':{'UserId':_0x25a22f['id']},'individualHooks':!![]});}})[_0x6b6b('0x1e')](function(){if(_0x25a22f){return db[_0x6b6b('0x26')][_0x6b6b('0x27')]({'where':{'membername':_0x25a22f[_0x6b6b('0x28')],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x543b15){if(_0x25a22f){if(_0x543b15&&_0x543b15[_0x6b6b('0x29')]){var _0x353d05=moment()['format'](_0x6b6b('0x2a'));for(var _0x166b3a=0x0,_0x54c217=_0x543b15[_0x6b6b('0x29')];_0x166b3a<_0x54c217;_0x166b3a++){_0x543b15[_0x166b3a][_0x6b6b('0x2b')]({'exitAt':_0x353d05});}}}})[_0x6b6b('0x1e')](function(){if(_0x25a22f){var _0x210414=[];var _0x4f847b=utils[_0x6b6b('0x2c')]();_0x4f847b[_0x6b6b('0x2d')](function(_0x479f0f){_0x210414['push']({'channel':_0x479f0f,'membername':_0x25a22f['name'],'interface':_[_0x6b6b('0x2e')](_0x25a22f[_0x6b6b('0x24')])?util[_0x6b6b('0x2f')](_0x6b6b('0x30'),_0x25a22f[_0x6b6b('0x28')]):_0x25a22f[_0x6b6b('0x24')],'type':'PAUSE','enterAt':moment()[_0x6b6b('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0xfd2b5d[_0x6b6b('0x31')]['type']||_0x6b6b('0x32'),'role':_0x25a22f[_0x6b6b('0x22')],'internal':_0x25a22f[_0x6b6b('0x23')],'uniqueid':_0xfd2b5d['body'][_0x6b6b('0x33')]||null});});return db['MemberReport'][_0x6b6b('0x34')](_0x210414,{'individualHooks':!![]});}})[_0x6b6b('0x1e')](function(){if(_0x25a22f){return _0x25a22f['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0xfd2b5d[_0x6b6b('0x31')][_0x6b6b('0x35')]||_0x6b6b('0x32'),'lastPauseAt':moment()[_0x6b6b('0x2f')](_0x6b6b('0x2a'))});}})['then'](function(_0xd11f48){_0xc4faf7(_0xd11f48);})['catch'](function(_0x1a6c1b){_0x5672df(_0x3e2464['error'](0x1f4,_0x1a6c1b[_0x6b6b('0x12')]));});});};exports[_0x6b6b('0x36')]=function(_0x2a2da3){var _0x42065a=this;return new Promise(function(_0x4e8d9f,_0x55739a){var _0x44fbd9;return db['User'][_0x6b6b('0x37')]({'where':_0x2a2da3['options'][_0x6b6b('0x18')]||{},'attributes':['id','name']})['then'](function(_0x2eaad4){if(_0x2eaad4){_0x44fbd9=_0x2eaad4;if(_0x2a2da3['body'][_0x6b6b('0x38')]&&!utils[_0x6b6b('0x39')](_0x2a2da3[_0x6b6b('0x31')][_0x6b6b('0x38')])){throw new Error('Unknown\x20channel');}switch(_0x2a2da3[_0x6b6b('0x31')][_0x6b6b('0x38')]){case'voice':return db[_0x6b6b('0x3a')][_0x6b6b('0x25')]({'paused':0x0},{'where':{'UserId':_0x44fbd9['id']}})[_0x6b6b('0x1e')](function(){return db[_0x6b6b('0x26')][_0x6b6b('0x3b')]({'where':{'channel':_0x2a2da3[_0x6b6b('0x31')][_0x6b6b('0x38')],'membername':_0x44fbd9[_0x6b6b('0x28')],'type':'PAUSE','exitAt':null}});})[_0x6b6b('0x1e')](function(_0x5ba338){if(_0x5ba338){return _0x5ba338[_0x6b6b('0x25')]({'exitAt':moment()[_0x6b6b('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x6b6b('0x1e')](function(){return _0x44fbd9['update']({'voicePause':![]});});case'mail':case'chat':case _0x6b6b('0x3c'):case _0x6b6b('0x3d'):case'openchannel':case _0x6b6b('0x3e'):return db[_0x6b6b('0x26')]['find']({'where':{'channel':_0x2a2da3[_0x6b6b('0x31')][_0x6b6b('0x38')],'membername':_0x44fbd9[_0x6b6b('0x28')],'type':_0x6b6b('0x3f'),'exitAt':null}})[_0x6b6b('0x1e')](function(_0x2431ff){return _0x2431ff[_0x6b6b('0x25')]({'exitAt':moment()[_0x6b6b('0x2f')](_0x6b6b('0x2a')),'data2':_0x6b6b('0x40')},{'individualHooks':!![]});})[_0x6b6b('0x1e')](function(){var _0x3b390e={};_[_0x6b6b('0x41')](_0x3b390e,util[_0x6b6b('0x2f')]('%s%s',_0x2a2da3[_0x6b6b('0x31')]['channel'],_0x6b6b('0x42')),![]);return _0x44fbd9[_0x6b6b('0x25')](_0x3b390e);});default:return db[_0x6b6b('0x3a')][_0x6b6b('0x25')]({'paused':0x0},{'where':{'UserId':_0x44fbd9['id']}})[_0x6b6b('0x1e')](function(){return db[_0x6b6b('0x26')][_0x6b6b('0x27')]({'where':{'membername':_0x44fbd9[_0x6b6b('0x28')],'type':_0x6b6b('0x3f'),'exitAt':null}});})['then'](function(_0xb26f14){var _0x4b61b0=[];_0xb26f14[_0x6b6b('0x2d')](function(_0x20ec14){_0x4b61b0[_0x6b6b('0x43')](_0x20ec14['update']({'exitAt':moment()[_0x6b6b('0x2f')](_0x6b6b('0x2a')),'data2':'system'}));});return BPromise[_0x6b6b('0x44')](_0x4b61b0);})['then'](function(){return _0x44fbd9[_0x6b6b('0x25')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x6b6b('0x1e')](function(_0x4654f0){_0x4e8d9f(_0x4654f0);})[_0x6b6b('0x20')](function(_0x5a0e00){_0x55739a(_0x42065a[_0x6b6b('0x11')](0x1f4,_0x5a0e00[_0x6b6b('0x12')]));});});};exports[_0x6b6b('0x45')]=function(_0x323ad6){var _0x44c8ae=this;return new Promise(function(_0x437e9d,_0x45f2ab){var _0x43163f;return db['User'][_0x6b6b('0x37')]({'where':_0x323ad6[_0x6b6b('0x16')][_0x6b6b('0x18')]||{},'attributes':['id','name']})[_0x6b6b('0x1e')](function(_0x79c0d5){if(_0x79c0d5){_0x43163f=_0x79c0d5;return db[_0x6b6b('0x3a')][_0x6b6b('0x46')]({'where':{'membername':_0x43163f[_0x6b6b('0x28')]},'individualHooks':!![]});}})[_0x6b6b('0x1e')](function(){if(_0x43163f){return db['MemberReport'][_0x6b6b('0x27')]({'where':{'membername':_0x43163f['name'],'exitAt':null}});}})[_0x6b6b('0x1e')](function(_0x355fe6){if(_0x43163f){if(_0x355fe6&&_0x355fe6[_0x6b6b('0x29')]){var _0x472f35=[];_0x355fe6[_0x6b6b('0x2d')](function(_0x349fd8){_0x472f35['push'](_0x349fd8[_0x6b6b('0x25')]({'exitAt':moment()[_0x6b6b('0x2f')](_0x6b6b('0x2a'))}));});return BPromise[_0x6b6b('0x44')](_0x472f35);}}})['then'](function(){if(_0x43163f){return _0x43163f[_0x6b6b('0x25')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x6b6b('0x1e')](function(_0x4bc5e4){_0x437e9d(_0x4bc5e4);})[_0x6b6b('0x20')](function(_0x4ee5f9){_0x45f2ab(_0x44c8ae[_0x6b6b('0x11')](0x1f4,_0x4ee5f9[_0x6b6b('0x12')]));});});};exports[_0x6b6b('0x47')]=function(_0x192fd7){var _0x474e27=this;return new Promise(function(_0x30ade6,_0x29f337){var _0x386267;var _0xe64304;var _0x3ce64e;var _0x587aad;return db['User'][_0x6b6b('0x37')]({'where':_0x192fd7[_0x6b6b('0x16')]['where']||{},'attributes':['id',_0x6b6b('0x28'),_0x6b6b('0x22'),_0x6b6b('0x48'),_0x6b6b('0x49'),'internal',_0x6b6b('0x4a'),_0x6b6b('0x24')]})[_0x6b6b('0x1e')](function(_0x2b5064){if(_0x2b5064){_0x386267=_0x2b5064;_0x587aad=_0x192fd7[_0x6b6b('0x31')]['interface']?_0x192fd7['body'][_0x6b6b('0x24')]:util[_0x6b6b('0x2f')]('SIP/%s',_0x386267[_0x6b6b('0x28')]);return db[_0x6b6b('0x15')][_0x6b6b('0x4b')]({'where':{'role':_0x6b6b('0x4c'),'online':!![],'id':{'$ne':_0x386267['id']}}});}})[_0x6b6b('0x1e')](function(_0x187b01){if(_0x187b01){_0x3ce64e=_0x187b01;return require(_0x6b6b('0x4d'))[_0x6b6b('0x4e')]();}})[_0x6b6b('0x1e')](function(_0xc5c6d4){if(_0xc5c6d4&&_0xc5c6d4[_0x6b6b('0x4f')]&&_0x3ce64e>=_0xc5c6d4[_0x6b6b('0x4f')]){throw new Error(_0x6b6b('0x50'));}})[_0x6b6b('0x1e')](function(){if(_0x386267){return db[_0x6b6b('0x3a')][_0x6b6b('0x46')]({'where':{'membername':_0x386267['name']},'individualHooks':!![]});}})['then'](function(){if(_0x386267){return _0x386267['getVoiceQueues']({'raw':!![]});}})[_0x6b6b('0x1e')](function(_0x54fd94){if(_0x386267){if(_0x54fd94){var _0x264c9f=[];_0xe64304=_0x54fd94;if(_0xe64304[_0x6b6b('0x29')]){for(var _0x26a055=0x0;_0x26a055<_0xe64304[_0x6b6b('0x29')];_0x26a055++){_0x264c9f[_0x6b6b('0x43')](db[_0x6b6b('0x3a')][_0x6b6b('0x51')]({'membername':_0x386267[_0x6b6b('0x28')],'UserId':_0x386267['id'],'queue_name':_0xe64304[_0x26a055][_0x6b6b('0x28')],'VoiceQueueId':_0xe64304[_0x26a055]['id'],'interface':_0x587aad,'paused':_0x386267[_0x6b6b('0x4a')]||![],'penalty':_0xe64304[_0x26a055][_0x6b6b('0x52')]||0x0}));}return BPromise[_0x6b6b('0x44')](_0x264c9f);}}}})[_0x6b6b('0x1e')](function(){if(_0x386267){return db[_0x6b6b('0x26')][_0x6b6b('0x27')]({'where':{'membername':_0x386267[_0x6b6b('0x28')],'exitAt':null}});}})[_0x6b6b('0x1e')](function(_0x39596a){if(_0x386267){if(_0x39596a&&_0x39596a[_0x6b6b('0x29')]){var _0x414923=[];_0x39596a['forEach'](function(_0x215bdb){_0x414923[_0x6b6b('0x43')](_0x215bdb[_0x6b6b('0x25')]({'exitAt':moment()[_0x6b6b('0x2f')](_0x6b6b('0x2a'))}));});return BPromise[_0x6b6b('0x44')](_0x414923);}}})[_0x6b6b('0x1e')](function(_0x3decda){if(_0x386267){var _0x83508d=[];var _0x190f56=[];var _0x3a1969=utils['getChannels']();var _0x5cb44f={'membername':_0x386267['name'],'interface':_0x587aad,'enterAt':moment()[_0x6b6b('0x2f')](_0x6b6b('0x2a')),'role':_0x386267[_0x6b6b('0x22')],'internal':_0x386267[_0x6b6b('0x23')]};_0x3a1969[_0x6b6b('0x2d')](function(_0x474b14){_0x83508d[_0x6b6b('0x43')](_['merge']({'channel':_0x474b14,'type':_0x6b6b('0x53'),'data1':_0x6b6b('0x54'),'data2':_0x587aad},_0x5cb44f));if(_0x386267['loginInPause']){_0x190f56[_0x6b6b('0x43')](_['merge']({'channel':_0x474b14,'type':_0x6b6b('0x3f'),'data1':_0x6b6b('0x55')},_0x5cb44f));}});return db['MemberReport']['bulkCreate'](_0x83508d[_0x6b6b('0x56')](_0x190f56),{'individualHooks':!![]});}})[_0x6b6b('0x1e')](function(){if(_0x386267){return _0x386267[_0x6b6b('0x25')]({'online':!![],'lastLoginAt':moment()[_0x6b6b('0x2f')](_0x6b6b('0x2a')),'voicePause':_0x386267[_0x6b6b('0x4a')]||![],'mailPause':_0x386267['loginInPause']||![],'chatPause':_0x386267['loginInPause']||![],'faxPause':_0x386267[_0x6b6b('0x4a')]||![],'smsPause':_0x386267[_0x6b6b('0x4a')]||![],'openchannelPause':_0x386267[_0x6b6b('0x4a')]||![],'pauseType':_0x386267[_0x6b6b('0x4a')]?_0x6b6b('0x55'):null,'lastPauseAt':moment()[_0x6b6b('0x2f')](_0x6b6b('0x2a')),'interface':_0x587aad});}})[_0x6b6b('0x1e')](function(_0x47fbd4){_0x30ade6(_0x47fbd4);})[_0x6b6b('0x20')](function(_0x35e3f9){_0x29f337(_0x474e27[_0x6b6b('0x11')](0x1f4,_0x35e3f9[_0x6b6b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 99ef8f1..da7e792 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 _0x630f=['length','user:','./user.events','save','remove','emit','removeListener','register'];(function(_0x13a703,_0x32702a){var _0x2f2ad6=function(_0x28a576){while(--_0x28a576){_0x13a703['push'](_0x13a703['shift']());}};_0x2f2ad6(++_0x32702a);}(_0x630f,0x92));var _0xf630=function(_0x5bc978,_0x171063){_0x5bc978=_0x5bc978-0x0;var _0x40aa71=_0x630f[_0x5bc978];return _0x40aa71;};'use strict';var UserEvents=require(_0xf630('0x0'));var events=[_0xf630('0x1'),_0xf630('0x2'),'update'];function createListener(_0x363049,_0x3357ce){return function(_0x51c935){_0x3357ce[_0xf630('0x3')](_0x363049,_0x51c935);};}function removeListener(_0x2a0214,_0x5b1734){return function(){UserEvents[_0xf630('0x4')](_0x2a0214,_0x5b1734);};}exports[_0xf630('0x5')]=function(_0x18e336){for(var _0x155ba9=0x0,_0xe40776=events[_0xf630('0x6')];_0x155ba9<_0xe40776;_0x155ba9++){var _0x3f5527=events[_0x155ba9];var _0xb258d7=createListener(_0xf630('0x7')+_0x3f5527,_0x18e336);UserEvents['on'](_0x3f5527,_0xb258d7);}}; \ No newline at end of file +var _0x0d2b=['update','emit','length','./user.events'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0d2b,0x7b));var _0xb0d2=function(_0x55a747,_0x50c122){_0x55a747=_0x55a747-0x0;var _0x2136b3=_0x0d2b[_0x55a747];return _0x2136b3;};'use strict';var UserEvents=require(_0xb0d2('0x0'));var events=['save','remove',_0xb0d2('0x1')];function createListener(_0x231997,_0x1d4858){return function(_0x5c1cf4){_0x1d4858[_0xb0d2('0x2')](_0x231997,_0x5c1cf4);};}function removeListener(_0x18fc86,_0x41724f){return function(){UserEvents['removeListener'](_0x18fc86,_0x41724f);};}exports['register']=function(_0x278107){for(var _0x366e44=0x0,_0x599e42=events[_0xb0d2('0x3')];_0x366e44<_0x599e42;_0x366e44++){var _0x1970bb=events[_0x366e44];var _0x118970=createListener('user:'+_0x1970bb,_0x278107);UserEvents['on'](_0x1970bb,_0x118970);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index ea51753..37450f4 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x145367,_0x40218a){var _0x58736d=function(_0x2b7de1){while(--_0x2b7de1){_0x145367['push'](_0x145367['shift']());}};_0x58736d(++_0x40218a);}(_0xe706,0xa3));var _0x6e70=function(_0x326e79,_0x33dc91){_0x326e79=_0x326e79-0x0;var _0x37eb89=_0xe706[_0x326e79];return _0x37eb89;};'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 +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x69188b,_0x550923){var _0x3320f4=function(_0x27d05b){while(--_0x27d05b){_0x69188b['push'](_0x69188b['shift']());}};_0x3320f4(++_0x550923);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 5d77ab5..c0f318b 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 _0xa43f=['exports','sequelize'];(function(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0xa43f,0xcb));var _0xfa43=function(_0x175127,_0x36edec){_0x175127=_0x175127-0x0;var _0x184349=_0xa43f[_0x175127];return _0x184349;};'use strict';var Sequelize=require(_0xfa43('0x0'));module[_0xfa43('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4250=['exports','INTEGER','sequelize'];(function(_0x155d88,_0x338c6e){var _0x51c423=function(_0x19d430){while(--_0x19d430){_0x155d88['push'](_0x155d88['shift']());}};_0x51c423(++_0x338c6e);}(_0x4250,0x146));var _0x0425=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x4250[_0x4e9628];return _0x27bc8c;};'use strict';var Sequelize=require(_0x0425('0x0'));module[_0x0425('0x1')]={'penalty':{'type':Sequelize[_0x0425('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 41b6944..5cec419 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 _0xdb7d=['util','../../config/logger','api','moment','request-promise','path','rimraf','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0xdb7d,0x120));var _0xddb7=function(_0x16b55f,_0x301c6c){_0x16b55f=_0x16b55f-0x0;var _0x391c2f=_0xdb7d[_0x16b55f];return _0x391c2f;};'use strict';var _=require('lodash');var util=require(_0xddb7('0x0'));var logger=require(_0xddb7('0x1'))(_0xddb7('0x2'));var moment=require(_0xddb7('0x3'));var BPromise=require('bluebird');var rp=require(_0xddb7('0x4'));var fs=require('fs');var path=require(_0xddb7('0x5'));var rimraf=require(_0xddb7('0x6'));var config=require('../../config/environment');var attributes=require(_0xddb7('0x7'));module[_0xddb7('0x8')]=function(_0x417825,_0x3f4bca){return _0x417825[_0xddb7('0x9')](_0xddb7('0xa'),attributes,{'tableName':_0xddb7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd557=['user_has_chat_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue'];(function(_0x2a2166,_0x3a077f){var _0x3bcf50=function(_0x3f0300){while(--_0x3f0300){_0x2a2166['push'](_0x2a2166['shift']());}};_0x3bcf50(++_0x3a077f);}(_0xd557,0x198));var _0x7d55=function(_0x1a3cab,_0x539a92){_0x1a3cab=_0x1a3cab-0x0;var _0x5a4d8f=_0xd557[_0x1a3cab];return _0x5a4d8f;};'use strict';var _=require(_0x7d55('0x0'));var util=require('util');var logger=require(_0x7d55('0x1'))(_0x7d55('0x2'));var moment=require(_0x7d55('0x3'));var BPromise=require(_0x7d55('0x4'));var rp=require(_0x7d55('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7d55('0x6'));var attributes=require(_0x7d55('0x7'));module[_0x7d55('0x8')]=function(_0x373858,_0x371e6e){return _0x373858['define'](_0x7d55('0x9'),attributes,{'tableName':_0x7d55('0xa'),'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 bcb7033..a499be4 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 _0x7254=['catch','lodash','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','request\x20sent','result'];(function(_0x25110a,_0x3b3852){var _0xe42822=function(_0x283a82){while(--_0x283a82){_0x25110a['push'](_0x25110a['shift']());}};_0xe42822(++_0x3b3852);}(_0x7254,0xa9));var _0x4725=function(_0x2f9e61,_0x566fa8){_0x2f9e61=_0x2f9e61-0x0;var _0x48d21f=_0x7254[_0x2f9e61];return _0x48d21f;};'use strict';var _=require(_0x4725('0x0'));var util=require('util');var moment=require(_0x4725('0x1'));var BPromise=require(_0x4725('0x2'));var rs=require(_0x4725('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4725('0x4'))('rpc');var config=require(_0x4725('0x5'));var jayson=require(_0x4725('0x6'));var client=jayson['client'][_0x4725('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5d1383,_0x2f9120,_0xc27d22){return new BPromise(function(_0x3441aa,_0x11ad28){return client[_0x4725('0x8')](_0x5d1383,_0xc27d22)[_0x4725('0x9')](function(_0x4f0718){logger[_0x4725('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x2f9120,'request\x20sent');logger[_0x4725('0xb')](_0x4725('0xc'),_0x2f9120,'request\x20sent',JSON[_0x4725('0xd')](_0x4f0718));if(_0x4f0718[_0x4725('0xe')]){if(_0x4f0718[_0x4725('0xe')][_0x4725('0xf')]===0x1f4){logger[_0x4725('0xe')](_0x4725('0x10'),_0x2f9120,_0x4f0718[_0x4725('0xe')][_0x4725('0x11')]);return _0x11ad28(_0x4f0718[_0x4725('0xe')]['message']);}logger[_0x4725('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x2f9120,_0x4f0718[_0x4725('0xe')][_0x4725('0x11')]);return _0x3441aa(_0x4f0718[_0x4725('0xe')][_0x4725('0x11')]);}else{logger[_0x4725('0xa')](_0x4725('0x10'),_0x2f9120,_0x4725('0x12'));_0x3441aa(_0x4f0718[_0x4725('0x13')][_0x4725('0x11')]);}})[_0x4725('0x14')](function(_0x54d5b7){logger[_0x4725('0xe')](_0x4725('0x10'),_0x2f9120,_0x54d5b7);_0x11ad28(_0x54d5b7);});});} \ No newline at end of file +var _0x3a09=['request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','UserChatQueue,\x20%s,\x20%s'];(function(_0x1fa7d1,_0x36ba36){var _0xb6eb34=function(_0x10132d){while(--_0x10132d){_0x1fa7d1['push'](_0x1fa7d1['shift']());}};_0xb6eb34(++_0x36ba36);}(_0x3a09,0x7d));var _0x93a0=function(_0x43abb8,_0x32eab1){_0x43abb8=_0x43abb8-0x0;var _0x3395b7=_0x3a09[_0x43abb8];return _0x3395b7;};'use strict';var _=require(_0x93a0('0x0'));var util=require(_0x93a0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x93a0('0x2'));var fs=require('fs');var Redis=require(_0x93a0('0x3'));var db=require(_0x93a0('0x4'))['db'];var utils=require(_0x93a0('0x5'));var logger=require(_0x93a0('0x6'))(_0x93a0('0x7'));var config=require('../../config/environment');var jayson=require(_0x93a0('0x8'));var client=jayson['client'][_0x93a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa1dfe4,_0x7a7a64,_0x446bdf){return new BPromise(function(_0x56ed8d,_0xc707ee){return client[_0x93a0('0xa')](_0xa1dfe4,_0x446bdf)[_0x93a0('0xb')](function(_0x3ba3ce){logger['info'](_0x93a0('0xc'),_0x7a7a64,_0x93a0('0xd'));logger[_0x93a0('0xe')](_0x93a0('0xf'),_0x7a7a64,_0x93a0('0xd'),JSON[_0x93a0('0x10')](_0x3ba3ce));if(_0x3ba3ce[_0x93a0('0x11')]){if(_0x3ba3ce[_0x93a0('0x11')][_0x93a0('0x12')]===0x1f4){logger['error'](_0x93a0('0xc'),_0x7a7a64,_0x3ba3ce[_0x93a0('0x11')][_0x93a0('0x13')]);return _0xc707ee(_0x3ba3ce['error']['message']);}logger[_0x93a0('0x11')](_0x93a0('0xc'),_0x7a7a64,_0x3ba3ce[_0x93a0('0x11')][_0x93a0('0x13')]);return _0x56ed8d(_0x3ba3ce[_0x93a0('0x11')]['message']);}else{logger[_0x93a0('0x14')](_0x93a0('0xc'),_0x7a7a64,_0x93a0('0xd'));_0x56ed8d(_0x3ba3ce[_0x93a0('0x15')]['message']);}})[_0x93a0('0x16')](function(_0x157d96){logger['error'](_0x93a0('0xc'),_0x7a7a64,_0x157d96);_0xc707ee(_0x157d96);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 8654422..1a472cb 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3bc892,_0x1b18d8){var _0x3e160f=function(_0x2af532){while(--_0x2af532){_0x3bc892['push'](_0x3bc892['shift']());}};_0x3e160f(++_0x1b18d8);}(_0xe706,0xa3));var _0x6e70=function(_0x151553,_0x295f9c){_0x151553=_0x151553-0x0;var _0x1a0ad6=_0xe706[_0x151553];return _0x1a0ad6;};'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 +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x48e441,_0x4b9e45){var _0x2408b4=function(_0x21acf4){while(--_0x21acf4){_0x48e441['push'](_0x48e441['shift']());}};_0x2408b4(++_0x4b9e45);}(_0x70e0,0x17b));var _0x070e=function(_0x17f8af,_0x30914e){_0x17f8af=_0x17f8af-0x0;var _0x350671=_0x70e0[_0x17f8af];return _0x350671;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index aedfa6b..e7ef04f 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 _0x9ec8=['STRING','sequelize','exports','INTEGER'];(function(_0x3bb4f7,_0x4548c0){var _0xeee0b=function(_0x26d6a0){while(--_0x26d6a0){_0x3bb4f7['push'](_0x3bb4f7['shift']());}};_0xeee0b(++_0x4548c0);}(_0x9ec8,0x151));var _0x89ec=function(_0x4a19d5,_0x519cf6){_0x4a19d5=_0x4a19d5-0x0;var _0x17e1e4=_0x9ec8[_0x4a19d5];return _0x17e1e4;};'use strict';var Sequelize=require(_0x89ec('0x0'));module[_0x89ec('0x1')]={'penalty':{'type':Sequelize[_0x89ec('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x89ec('0x3')]}}; \ No newline at end of file +var _0x5e71=['INTEGER','sequelize','exports'];(function(_0x3034e1,_0x1939b6){var _0x2e7308=function(_0x272dfa){while(--_0x272dfa){_0x3034e1['push'](_0x3034e1['shift']());}};_0x2e7308(++_0x1939b6);}(_0x5e71,0x109));var _0x15e7=function(_0x3a63a6,_0x1f4f36){_0x3a63a6=_0x3a63a6-0x0;var _0x134dc8=_0x5e71[_0x3a63a6];return _0x134dc8;};'use strict';var Sequelize=require(_0x15e7('0x0'));module[_0x15e7('0x1')]={'penalty':{'type':Sequelize[_0x15e7('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'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 ee6445b..cd4045f 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 _0x436f=['user_has_fax_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','./userFaxQueue.attributes','exports'];(function(_0x576ca4,_0x1e1550){var _0x3a4556=function(_0x407eea){while(--_0x407eea){_0x576ca4['push'](_0x576ca4['shift']());}};_0x3a4556(++_0x1e1550);}(_0x436f,0x97));var _0xf436=function(_0x210a11,_0x2ca9bf){_0x210a11=_0x210a11-0x0;var _0x9d71b0=_0x436f[_0x210a11];return _0x9d71b0;};'use strict';var _=require(_0xf436('0x0'));var util=require(_0xf436('0x1'));var logger=require(_0xf436('0x2'))(_0xf436('0x3'));var moment=require('moment');var BPromise=require(_0xf436('0x4'));var rp=require(_0xf436('0x5'));var fs=require('fs');var path=require(_0xf436('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf436('0x7'));module[_0xf436('0x8')]=function(_0x3ef6be,_0x3018cd){return _0x3ef6be['define']('UserFaxQueue',attributes,{'tableName':_0xf436('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7911=['UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define'];(function(_0x27d71a,_0x1ae3cb){var _0x2f4e22=function(_0x35b7b1){while(--_0x35b7b1){_0x27d71a['push'](_0x27d71a['shift']());}};_0x2f4e22(++_0x1ae3cb);}(_0x7911,0x1f1));var _0x1791=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x7911[_0x31cb5f];return _0x586042;};'use strict';var _=require(_0x1791('0x0'));var util=require(_0x1791('0x1'));var logger=require(_0x1791('0x2'))(_0x1791('0x3'));var moment=require(_0x1791('0x4'));var BPromise=require(_0x1791('0x5'));var rp=require(_0x1791('0x6'));var fs=require('fs');var path=require(_0x1791('0x7'));var rimraf=require(_0x1791('0x8'));var config=require(_0x1791('0x9'));var attributes=require(_0x1791('0xa'));module[_0x1791('0xb')]=function(_0x3e72c2,_0x254e95){return _0x3e72c2[_0x1791('0xc')](_0x1791('0xd'),attributes,{'tableName':_0x1791('0xe'),'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 64fe03b..4606682 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 _0x0f38=['http','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x0f38,0x8a));var _0x80f3=function(_0xb537d6,_0x1b72da){_0xb537d6=_0xb537d6-0x0;var _0x5a7ef1=_0x0f38[_0xb537d6];return _0x5a7ef1;};'use strict';var _=require(_0x80f3('0x0'));var util=require('util');var moment=require(_0x80f3('0x1'));var BPromise=require(_0x80f3('0x2'));var rs=require(_0x80f3('0x3'));var fs=require('fs');var Redis=require(_0x80f3('0x4'));var db=require(_0x80f3('0x5'))['db'];var utils=require(_0x80f3('0x6'));var logger=require(_0x80f3('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x80f3('0x8')][_0x80f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37fd4f,_0x3da094,_0x5d439e){return new BPromise(function(_0x3569c3,_0x1a3cbd){return client['request'](_0x37fd4f,_0x5d439e)[_0x80f3('0xa')](function(_0x5ce27e){logger[_0x80f3('0xb')](_0x80f3('0xc'),_0x3da094,'request\x20sent');logger[_0x80f3('0xd')](_0x80f3('0xe'),_0x3da094,_0x80f3('0xf'),JSON[_0x80f3('0x10')](_0x5ce27e));if(_0x5ce27e[_0x80f3('0x11')]){if(_0x5ce27e['error'][_0x80f3('0x12')]===0x1f4){logger['error'](_0x80f3('0xc'),_0x3da094,_0x5ce27e[_0x80f3('0x11')][_0x80f3('0x13')]);return _0x1a3cbd(_0x5ce27e[_0x80f3('0x11')][_0x80f3('0x13')]);}logger[_0x80f3('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x3da094,_0x5ce27e[_0x80f3('0x11')][_0x80f3('0x13')]);return _0x3569c3(_0x5ce27e[_0x80f3('0x11')][_0x80f3('0x13')]);}else{logger[_0x80f3('0xb')](_0x80f3('0xc'),_0x3da094,_0x80f3('0xf'));_0x3569c3(_0x5ce27e['result'][_0x80f3('0x13')]);}})[_0x80f3('0x14')](function(_0x3097b3){logger[_0x80f3('0x11')](_0x80f3('0xc'),_0x3da094,_0x3097b3);_0x1a3cbd(_0x3097b3);});});} \ No newline at end of file +var _0xee5e=['error','code','message','request\x20sent','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5f4c25,_0xff5011){var _0x67b8db=function(_0x2c33cd){while(--_0x2c33cd){_0x5f4c25['push'](_0x5f4c25['shift']());}};_0x67b8db(++_0xff5011);}(_0xee5e,0xf6));var _0xeee5=function(_0xb1a60f,_0xd75f9){_0xb1a60f=_0xb1a60f-0x0;var _0xd04b77=_0xee5e[_0xb1a60f];return _0xd04b77;};'use strict';var _=require(_0xeee5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xeee5('0x1'));var rs=require(_0xeee5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeee5('0x3'))['db'];var utils=require(_0xeee5('0x4'));var logger=require(_0xeee5('0x5'))(_0xeee5('0x6'));var config=require(_0xeee5('0x7'));var jayson=require(_0xeee5('0x8'));var client=jayson[_0xeee5('0x9')][_0xeee5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3143ac,_0x580882,_0x494b16){return new BPromise(function(_0xe82d98,_0xa03876){return client[_0xeee5('0xb')](_0x3143ac,_0x494b16)[_0xeee5('0xc')](function(_0x24af05){logger[_0xeee5('0xd')](_0xeee5('0xe'),_0x580882,'request\x20sent');logger[_0xeee5('0xf')](_0xeee5('0x10'),_0x580882,'request\x20sent',JSON[_0xeee5('0x11')](_0x24af05));if(_0x24af05[_0xeee5('0x12')]){if(_0x24af05['error'][_0xeee5('0x13')]===0x1f4){logger[_0xeee5('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x580882,_0x24af05['error'][_0xeee5('0x14')]);return _0xa03876(_0x24af05[_0xeee5('0x12')][_0xeee5('0x14')]);}logger[_0xeee5('0x12')](_0xeee5('0xe'),_0x580882,_0x24af05[_0xeee5('0x12')][_0xeee5('0x14')]);return _0xe82d98(_0x24af05[_0xeee5('0x12')][_0xeee5('0x14')]);}else{logger['info'](_0xeee5('0xe'),_0x580882,_0xeee5('0x15'));_0xe82d98(_0x24af05[_0xeee5('0x16')][_0xeee5('0x14')]);}})[_0xeee5('0x17')](function(_0x49a46c){logger['error'](_0xeee5('0xe'),_0x580882,_0x49a46c);_0xa03876(_0x49a46c);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 09f1a57..be036dc 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(_0x11d684,_0x4d4123){var _0x78a301=function(_0x1a1966){while(--_0x1a1966){_0x11d684['push'](_0x11d684['shift']());}};_0x78a301(++_0x4d4123);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5c525b,_0x147be2){var _0x1727f8=function(_0x59bef1){while(--_0x59bef1){_0x5c525b['push'](_0x5c525b['shift']());}};_0x1727f8(++_0x147be2);}(_0xe706,0xa3));var _0x6e70=function(_0x4c6b93,_0x19880d){_0x4c6b93=_0x4c6b93-0x0;var _0x119770=_0xe706[_0x4c6b93];return _0x119770;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index d5679c2..c03f930 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 _0x8e67=['exports','sequelize'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x8e67,0x75));var _0x78e6=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0x8e67[_0x19dd7a];return _0x3feb6a;};'use strict';var Sequelize=require(_0x78e6('0x0'));module[_0x78e6('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8fef=['INTEGER','sequelize','exports'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x8fef,0x1e4));var _0xf8fe=function(_0x2634de,_0x143b28){_0x2634de=_0x2634de-0x0;var _0x922ed5=_0x8fef[_0x2634de];return _0x922ed5;};'use strict';var Sequelize=require(_0xf8fe('0x0'));module[_0xf8fe('0x1')]={'penalty':{'type':Sequelize[_0xf8fe('0x2')],'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 caebed9..d805557 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 _0xc9ea=['../../config/logger','api','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','util'];(function(_0x5e33f6,_0x2e18e6){var _0x20cb0f=function(_0x358e5c){while(--_0x358e5c){_0x5e33f6['push'](_0x5e33f6['shift']());}};_0x20cb0f(++_0x2e18e6);}(_0xc9ea,0x180));var _0xac9e=function(_0x48edbf,_0x3a3804){_0x48edbf=_0x48edbf-0x0;var _0x429692=_0xc9ea[_0x48edbf];return _0x429692;};'use strict';var _=require('lodash');var util=require(_0xac9e('0x0'));var logger=require(_0xac9e('0x1'))(_0xac9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xac9e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac9e('0x4'));var config=require(_0xac9e('0x5'));var attributes=require(_0xac9e('0x6'));module[_0xac9e('0x7')]=function(_0x3539cd,_0x517cfa){return _0x3539cd[_0xac9e('0x8')](_0xac9e('0x9'),attributes,{'tableName':_0xac9e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb130=['util','../../config/logger','moment','bluebird','request-promise','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash'];(function(_0x304b67,_0x31cb39){var _0x493afb=function(_0x21dce3){while(--_0x21dce3){_0x304b67['push'](_0x304b67['shift']());}};_0x493afb(++_0x31cb39);}(_0xb130,0x1b7));var _0x0b13=function(_0x384447,_0x41669a){_0x384447=_0x384447-0x0;var _0x3810db=_0xb130[_0x384447];return _0x3810db;};'use strict';var _=require(_0x0b13('0x0'));var util=require(_0x0b13('0x1'));var logger=require(_0x0b13('0x2'))('api');var moment=require(_0x0b13('0x3'));var BPromise=require(_0x0b13('0x4'));var rp=require(_0x0b13('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0b13('0x6'));module[_0x0b13('0x7')]=function(_0x3f8376,_0x207d92){return _0x3f8376[_0x0b13('0x8')](_0x0b13('0x9'),attributes,{'tableName':_0x0b13('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 10cea9a..4e7ae80 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 _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0xf69116,_0x538a86){var _0x20b570=function(_0x46322f){while(--_0x46322f){_0xf69116['push'](_0xf69116['shift']());}};_0x20b570(++_0x538a86);}(_0x3e74,0x175));var _0x43e7=function(_0x3c300a,_0x5df75a){_0x3c300a=_0x3c300a-0x0;var _0x34c67c=_0x3e74[_0x3c300a];return _0x34c67c;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file +var _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x008c,0x188));var _0xc008=function(_0x4f08dd,_0x3784ec){_0x4f08dd=_0x4f08dd-0x0;var _0x3017ee=_0x008c[_0x4f08dd];return _0x3017ee;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 4b9f64d..2b868c1 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 _0x6957=['post','isAuthenticated','sendUserNotification','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1e3585,_0x3dba07){var _0x1d6fcb=function(_0x40dcc4){while(--_0x40dcc4){_0x1e3585['push'](_0x1e3585['shift']());}};_0x1d6fcb(++_0x3dba07);}(_0x6957,0x1ef));var _0x7695=function(_0xaa0fd2,_0x48046a){_0xaa0fd2=_0xaa0fd2-0x0;var _0x8101af=_0x6957[_0xaa0fd2];return _0x8101af;};'use strict';var multer=require(_0x7695('0x0'));var util=require(_0x7695('0x1'));var path=require(_0x7695('0x2'));var timeout=require('connect-timeout');var express=require(_0x7695('0x3'));var router=express[_0x7695('0x4')]();var fs_extra=require(_0x7695('0x5'));var auth=require(_0x7695('0x6'));var interaction=require(_0x7695('0x7'));var config=require(_0x7695('0x8'));var controller=require('./userNotification.controller');router[_0x7695('0x9')]('/',auth[_0x7695('0xa')](),controller[_0x7695('0xb')]);module['exports']=router; \ No newline at end of file +var _0x8091=['../../config/environment','./userNotification.controller','sendUserNotification','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2b216a,_0x5ebea4){var _0x39ab62=function(_0x37b9bd){while(--_0x37b9bd){_0x2b216a['push'](_0x2b216a['shift']());}};_0x39ab62(++_0x5ebea4);}(_0x8091,0x1cc));var _0x1809=function(_0x2891e0,_0x485a49){_0x2891e0=_0x2891e0-0x0;var _0x145141=_0x8091[_0x2891e0];return _0x145141;};'use strict';var multer=require(_0x1809('0x0'));var util=require('util');var path=require(_0x1809('0x1'));var timeout=require(_0x1809('0x2'));var express=require(_0x1809('0x3'));var router=express[_0x1809('0x4')]();var fs_extra=require(_0x1809('0x5'));var auth=require(_0x1809('0x6'));var interaction=require(_0x1809('0x7'));var config=require(_0x1809('0x8'));var controller=require(_0x1809('0x9'));router['post']('/',auth['isAuthenticated'](),controller[_0x1809('0xa')]);module[_0x1809('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 7e45d61..1396937 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 _0xb8f0=['sequelize','exports','TEXT','BOOLEAN'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_0xb8f0,0x1d0));var _0x0b8f=function(_0x19f54f,_0x49a250){_0x19f54f=_0x19f54f-0x0;var _0x5d02a0=_0xb8f0[_0x19f54f];return _0x5d02a0;};'use strict';var Sequelize=require(_0x0b8f('0x0'));module[_0x0b8f('0x1')]={'body':{'type':Sequelize[_0x0b8f('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x0b8f('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x0b8f('0x3')]}}; \ No newline at end of file +var _0x4fb7=['STRING','sequelize','TEXT'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x4fb7,0x9d));var _0x74fb=function(_0xb3dbde,_0x1c17b1){_0xb3dbde=_0xb3dbde-0x0;var _0x555ebf=_0x4fb7[_0xb3dbde];return _0x555ebf;};'use strict';var Sequelize=require(_0x74fb('0x0'));module['exports']={'body':{'type':Sequelize[_0x74fb('0x1')]},'senderName':{'type':Sequelize[_0x74fb('0x2')]},'recipientsId':{'type':Sequelize[_0x74fb('0x1')]},'recipientsDescription':{'type':Sequelize[_0x74fb('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 8ff2aca..ea7dcad 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 _0x2732=['ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','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','socket.io-emitter','./userNotification.socket','register','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','sendUserNotification','body','text','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','sequelize','transaction','UserNotification','forEach','emit','catch','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','User','union','ids','queue','replace','Queue','all','flatten','getAgents','map','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox'];(function(_0x15b390,_0x2cb116){var _0x1711a7=function(_0x768359){while(--_0x768359){_0x15b390['push'](_0x15b390['shift']());}};_0x1711a7(++_0x2cb116);}(_0x2732,0x191));var _0x2273=function(_0x4f0b46,_0x16fc84){_0x4f0b46=_0x4f0b46-0x0;var _0x2073b1=_0x2732[_0x4f0b46];return _0x2073b1;};'use strict';var emlformat=require(_0x2273('0x0'));var rimraf=require(_0x2273('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2273('0x2'));var rp=require('request-promise');var moment=require(_0x2273('0x3'));var BPromise=require(_0x2273('0x4'));var Mustache=require('mustache');var util=require(_0x2273('0x5'));var path=require('path');var sox=require(_0x2273('0x6'));var csv=require('to-csv');var ejs=require(_0x2273('0x7'));var fs=require('fs');var fs_extra=require(_0x2273('0x8'));var _=require(_0x2273('0x9'));var squel=require(_0x2273('0xa'));var crypto=require(_0x2273('0xb'));var jsforce=require(_0x2273('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2273('0xd'));var querystring=require(_0x2273('0xe'));var Papa=require(_0x2273('0xf'));var Redis=require('ioredis');var authService=require(_0x2273('0x10'));var qs=require(_0x2273('0x11'));var as=require(_0x2273('0x12'));var hardwareService=require(_0x2273('0x13'));var logger=require(_0x2273('0x14'))(_0x2273('0x15'));var utils=require(_0x2273('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2273('0x17'));var db=require(_0x2273('0x18'))['db'];config[_0x2273('0x19')]=_[_0x2273('0x1a')](config[_0x2273('0x19')],{'host':_0x2273('0x1b'),'port':0x18eb});var socket=require(_0x2273('0x1c'))(new Redis(config[_0x2273('0x19')]));require(_0x2273('0x1d'))[_0x2273('0x1e')](socket);function respondWithStatusCode(_0x782790,_0x318855){_0x318855=_0x318855||0xcc;return function(_0x279375){if(_0x279375){return _0x782790[_0x2273('0x1f')](_0x318855);}return _0x782790['status'](_0x318855)[_0x2273('0x20')]();};}function respondWithResult(_0x428141,_0x30fb9f){_0x30fb9f=_0x30fb9f||0xc8;return function(_0x54439a){if(_0x54439a){return _0x428141[_0x2273('0x21')](_0x30fb9f)['json'](_0x54439a);}};}function respondWithFilteredResult(_0x19b9cf,_0x2d6c3c){return function(_0x216bcb){if(_0x216bcb){var _0x4effe6=typeof _0x2d6c3c['offset']===_0x2273('0x22')&&typeof _0x2d6c3c[_0x2273('0x23')]===_0x2273('0x22');var _0x28da19=_0x216bcb[_0x2273('0x24')];var _0x4e1f29=_0x4effe6?0x0:_0x2d6c3c['offset'];var _0x4c4cf4=_0x4effe6?_0x216bcb[_0x2273('0x24')]:_0x2d6c3c[_0x2273('0x25')]+_0x2d6c3c[_0x2273('0x23')];var _0x4aa1f5;if(_0x4c4cf4>=_0x28da19){_0x4c4cf4=_0x28da19;_0x4aa1f5=0xc8;}else{_0x4aa1f5=0xce;}_0x19b9cf[_0x2273('0x21')](_0x4aa1f5);return _0x19b9cf[_0x2273('0x26')](_0x2273('0x27'),_0x4e1f29+'-'+_0x4c4cf4+'/'+_0x28da19)[_0x2273('0x28')](_0x216bcb);}return null;};}function patchUpdates(_0x117cca){return function(_0x5c22b7){try{jsonpatch[_0x2273('0x29')](_0x5c22b7,_0x117cca,!![]);}catch(_0x60fb8e){return BPromise[_0x2273('0x2a')](_0x60fb8e);}return _0x5c22b7['save']();};}function saveUpdates(_0xb69030,_0x2ec416){return function(_0x43ba15){if(_0x43ba15){return _0x43ba15[_0x2273('0x2b')](_0xb69030)[_0x2273('0x2c')](function(_0x37bab7){return _0x37bab7;});}return null;};}function removeEntity(_0x2ed50f,_0x292484){return function(_0x24f057){if(_0x24f057){return _0x24f057[_0x2273('0x2d')]()[_0x2273('0x2c')](function(){_0x2ed50f[_0x2273('0x21')](0xcc)[_0x2273('0x20')]();});}};}function handleEntityNotFound(_0x3ddcdd,_0x16d0c8){return function(_0x5c6b84){if(!_0x5c6b84){_0x3ddcdd['sendStatus'](0x194);}return _0x5c6b84;};}function handleError(_0x171358,_0x39014c){_0x39014c=_0x39014c||0x1f4;return function(_0x4483d0){logger[_0x2273('0x2e')](_0x4483d0[_0x2273('0x2f')]);if(_0x4483d0['name']){delete _0x4483d0['name'];}_0x171358[_0x2273('0x21')](_0x39014c)['send'](_0x4483d0);};}exports[_0x2273('0x30')]=function(_0x517a86,_0x177cdc,_0x162c37){if(!_0x517a86[_0x2273('0x31')]['hasOwnProperty'](_0x2273('0x32'))&&!_0x517a86['body'][_0x2273('0x33')](_0x2273('0x34'))){throw new db[(_0x2273('0x35'))][(_0x2273('0x36'))](_0x2273('0x37'));}else{if(_0x517a86[_0x2273('0x31')][_0x2273('0x33')](_0x2273('0x34'))&&!_0x517a86[_0x2273('0x31')][_0x2273('0x33')](_0x2273('0x38'))){throw new db[(_0x2273('0x35'))][(_0x2273('0x36'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x517a86[_0x2273('0x31')][_0x2273('0x33')](_0x2273('0x39'))){throw new db['Sequelize'][(_0x2273('0x36'))](_0x2273('0x3a'));}else{try{var _0x1165c1=JSON[_0x2273('0x3b')](_0x517a86[_0x2273('0x31')][_0x2273('0x39')]);}catch(_0x46c00b){logger[_0x2273('0x2e')](_0x46c00b);throw new db['Sequelize'][(_0x2273('0x36'))](_0x2273('0x3c'));}var _0x14ab11=[_0x2273('0x3d'),'faxqueue',_0x2273('0x3e'),_0x2273('0x3f'),_0x2273('0x40'),_0x2273('0x41'),_0x2273('0x42'),_0x2273('0x43'),_0x2273('0x44')];if(_[_0x2273('0x45')](_0x1165c1,function(_0x49938d){return!_[_0x2273('0x46')](_0x14ab11,_0x49938d[_0x2273('0x47')][_0x2273('0x48')]());})){throw new db[(_0x2273('0x35'))][(_0x2273('0x36'))](_0x2273('0x49'));}}}var _0x4551a5={};_0x4551a5[_0x2273('0x4a')]=_0x517a86['body']['hasOwnProperty'](_0x2273('0x4a'))?_0x517a86[_0x2273('0x31')][_0x2273('0x4a')]:_0x517a86[_0x2273('0x44')][_0x2273('0x4b')];_0x4551a5[_0x2273('0x4c')]=_[_0x2273('0x4d')](_0x517a86['body'][_0x2273('0x4c')])?null:_0x517a86['body'][_0x2273('0x4c')];_0x4551a5[_0x2273('0x4e')]=_0x517a86[_0x2273('0x31')][_0x2273('0x4e')]||![];_0x4551a5[_0x2273('0x4f')]=_0x517a86[_0x2273('0x44')]['id'];return getContent(_0x517a86['body'])[_0x2273('0x2c')](function(_0x1d0969){_0x4551a5['body']=_0x1d0969;return getRecipients(_0x1165c1);})[_0x2273('0x2c')](function(_0x106a17){_0x4551a5[_0x2273('0x50')]=_[_0x2273('0x51')](_0x106a17)['join'](',');return db[_0x2273('0x52')][_0x2273('0x53')](function(_0x99d8e8){return db[_0x2273('0x54')]['create'](_0x4551a5,{'raw':!![],'transaction':_0x99d8e8})[_0x2273('0x2c')](function(_0x11a21e){var _0x20af66={'sender':_0x4551a5[_0x2273('0x4a')],'description':_0x4551a5[_0x2273('0x4c')],'content':_0x4551a5[_0x2273('0x31')],'beep':_0x4551a5[_0x2273('0x4e')]};_0x106a17[_0x2273('0x55')](function(_0x3a5b9a){_0x20af66['recipient']=_0x3a5b9a;socket[_0x2273('0x56')]('userNotification:send',_0x20af66);});return _0x11a21e;});});})[_0x2273('0x2c')](respondWithResult(_0x177cdc,0xc9))[_0x2273('0x57')](handleError(_0x177cdc,null));};function getContent(_0x385ac3){return new BPromise(function(_0x8d392c,_0x3be765){if(_0x385ac3[_0x2273('0x32')]){_0x8d392c(_0x385ac3[_0x2273('0x32')]);return;}return db['Template'][_0x2273('0x58')]({'attributes':[_0x2273('0x59')],'where':{'id':_0x385ac3[_0x2273('0x34')]},'raw':!![]})[_0x2273('0x2c')](function(_0x41f8c5){if(!_0x41f8c5)throw new db['Sequelize'][(_0x2273('0x36'))](_0x2273('0x5a'));var _0x1db144=Mustache[_0x2273('0x5b')](_0x41f8c5[_0x2273('0x59')],_0x385ac3[_0x2273('0x38')]);_0x8d392c(_0x1db144);})[_0x2273('0x57')](function(_0xcbf91e){_0x3be765(_0xcbf91e);});});}function getRecipients(_0x4e28ea){return new BPromise(function(_0x49e5ee,_0x206d63){var _0x2f348d=[];var _0x5a0f6b=[];_0x4e28ea[_0x2273('0x55')](function(_0x1540c2){var _0x46eb79=_['startCase'](_0x1540c2[_0x2273('0x47')][_0x2273('0x48')]());if(_0x46eb79===_0x2273('0x5c')){_0x2f348d=_[_0x2273('0x5d')](_0x2f348d,_0x1540c2[_0x2273('0x5e')]);}else{if(_['includes'](_0x46eb79,_0x2273('0x5f')))_0x46eb79=_0x46eb79[_0x2273('0x60')](_0x2273('0x5f'),_0x2273('0x61'));_0x1540c2[_0x2273('0x5e')][_0x2273('0x55')](function(_0x313b0c){_0x5a0f6b['push'](getAgents(_0x46eb79,_0x313b0c));});}});return BPromise[_0x2273('0x62')](_0x5a0f6b)[_0x2273('0x2c')](function(_0x327d21){_0x2f348d=_['union'](_0x2f348d,_[_0x2273('0x63')](_0x327d21));_0x49e5ee(_0x2f348d);})[_0x2273('0x57')](function(_0x4c9421){_0x206d63(_0x4c9421);});});}function getAgents(_0x476b29,_0x4f9057){return new BPromise(function(_0x33625c,_0x5f29f4){return db[_0x476b29]['findOne']({'where':{'id':_0x4f9057}})[_0x2273('0x2c')](function(_0x181763){return _0x181763[_0x2273('0x64')]({'attributes':['id'],'raw':!![]})[_0x2273('0x2c')](function(_0x4dc1ef){var _0x1fade3=_[_0x2273('0x65')](_0x4dc1ef,'id');_0x33625c(_0x1fade3);});})[_0x2273('0x57')](function(_0x22f286){_0x5f29f4(_0x22f286);});});} \ No newline at end of file +var _0x00d3=['hasOwnProperty','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','UserNotification','create','forEach','recipient','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','catch','startCase','toLowerCase','User','union','ids','queue','Queue','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','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','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','stack','name','send','body','text'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0x00d3,0x9a));var _0x300d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x00d3[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x300d('0x0'));var zipdir=require(_0x300d('0x1'));var jsonpatch=require(_0x300d('0x2'));var rp=require(_0x300d('0x3'));var moment=require(_0x300d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x300d('0x5'));var util=require(_0x300d('0x6'));var path=require(_0x300d('0x7'));var sox=require(_0x300d('0x8'));var csv=require(_0x300d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x300d('0xa'));var squel=require(_0x300d('0xb'));var crypto=require(_0x300d('0xc'));var jsforce=require(_0x300d('0xd'));var deskjs=require(_0x300d('0xe'));var toCsv=require(_0x300d('0x9'));var querystring=require('querystring');var Papa=require(_0x300d('0xf'));var Redis=require(_0x300d('0x10'));var authService=require(_0x300d('0x11'));var qs=require(_0x300d('0x12'));var as=require(_0x300d('0x13'));var hardwareService=require(_0x300d('0x14'));var logger=require(_0x300d('0x15'))(_0x300d('0x16'));var utils=require('../../config/utils');var config=require(_0x300d('0x17'));var licenseUtil=require(_0x300d('0x18'));var db=require(_0x300d('0x19'))['db'];config[_0x300d('0x1a')]=_[_0x300d('0x1b')](config[_0x300d('0x1a')],{'host':_0x300d('0x1c'),'port':0x18eb});var socket=require(_0x300d('0x1d'))(new Redis(config[_0x300d('0x1a')]));require(_0x300d('0x1e'))[_0x300d('0x1f')](socket);function respondWithStatusCode(_0x1bf93f,_0x109edf){_0x109edf=_0x109edf||0xcc;return function(_0x3dba18){if(_0x3dba18){return _0x1bf93f[_0x300d('0x20')](_0x109edf);}return _0x1bf93f[_0x300d('0x21')](_0x109edf)[_0x300d('0x22')]();};}function respondWithResult(_0x2ae9d9,_0x6e7cf0){_0x6e7cf0=_0x6e7cf0||0xc8;return function(_0x40bb9e){if(_0x40bb9e){return _0x2ae9d9[_0x300d('0x21')](_0x6e7cf0)[_0x300d('0x23')](_0x40bb9e);}};}function respondWithFilteredResult(_0x4a66e4,_0x5eb9a3){return function(_0x584fb6){if(_0x584fb6){var _0x4d9bc5=typeof _0x5eb9a3[_0x300d('0x24')]===_0x300d('0x25')&&typeof _0x5eb9a3['limit']==='undefined';var _0x7f37=_0x584fb6['count'];var _0x4779b0=_0x4d9bc5?0x0:_0x5eb9a3['offset'];var _0x237867=_0x4d9bc5?_0x584fb6[_0x300d('0x26')]:_0x5eb9a3[_0x300d('0x24')]+_0x5eb9a3[_0x300d('0x27')];var _0x5902b6;if(_0x237867>=_0x7f37){_0x237867=_0x7f37;_0x5902b6=0xc8;}else{_0x5902b6=0xce;}_0x4a66e4[_0x300d('0x21')](_0x5902b6);return _0x4a66e4[_0x300d('0x28')](_0x300d('0x29'),_0x4779b0+'-'+_0x237867+'/'+_0x7f37)[_0x300d('0x23')](_0x584fb6);}return null;};}function patchUpdates(_0x318096){return function(_0x4cb96b){try{jsonpatch['apply'](_0x4cb96b,_0x318096,!![]);}catch(_0x1a625d){return BPromise[_0x300d('0x2a')](_0x1a625d);}return _0x4cb96b[_0x300d('0x2b')]();};}function saveUpdates(_0x13316c,_0x3132f3){return function(_0x5e85d4){if(_0x5e85d4){return _0x5e85d4['update'](_0x13316c)['then'](function(_0xda3985){return _0xda3985;});}return null;};}function removeEntity(_0x5a65b8,_0x5b6c97){return function(_0x390d39){if(_0x390d39){return _0x390d39['destroy']()[_0x300d('0x2c')](function(){_0x5a65b8[_0x300d('0x21')](0xcc)[_0x300d('0x22')]();});}};}function handleEntityNotFound(_0x1d7e80,_0xd5eaf){return function(_0x33e5e1){if(!_0x33e5e1){_0x1d7e80[_0x300d('0x20')](0x194);}return _0x33e5e1;};}function handleError(_0xc34e3,_0x4ebe03){_0x4ebe03=_0x4ebe03||0x1f4;return function(_0x8d9c4c){logger['error'](_0x8d9c4c[_0x300d('0x2d')]);if(_0x8d9c4c[_0x300d('0x2e')]){delete _0x8d9c4c['name'];}_0xc34e3[_0x300d('0x21')](_0x4ebe03)[_0x300d('0x2f')](_0x8d9c4c);};}exports['sendUserNotification']=function(_0x251f72,_0x204382,_0x1556b4){if(!_0x251f72[_0x300d('0x30')]['hasOwnProperty'](_0x300d('0x31'))&&!_0x251f72[_0x300d('0x30')][_0x300d('0x32')]('TemplateId')){throw new db['Sequelize'][(_0x300d('0x33'))](_0x300d('0x34'));}else{if(_0x251f72['body'][_0x300d('0x32')](_0x300d('0x35'))&&!_0x251f72[_0x300d('0x30')][_0x300d('0x32')](_0x300d('0x36'))){throw new db[(_0x300d('0x37'))]['ValidationError'](_0x300d('0x38'));}if(!_0x251f72['body'][_0x300d('0x32')](_0x300d('0x39'))){throw new db[(_0x300d('0x37'))][(_0x300d('0x33'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x14dfa6=JSON['parse'](_0x251f72['body'][_0x300d('0x39')]);}catch(_0x4ea4d3){logger[_0x300d('0x3a')](_0x4ea4d3);throw new db[(_0x300d('0x37'))][(_0x300d('0x33'))](_0x300d('0x3b'));}var _0x4b5d64=[_0x300d('0x3c'),'faxqueue',_0x300d('0x3d'),_0x300d('0x3e'),_0x300d('0x3f'),_0x300d('0x40'),_0x300d('0x41'),_0x300d('0x42'),_0x300d('0x43')];if(_[_0x300d('0x44')](_0x14dfa6,function(_0x423bd8){return!_[_0x300d('0x45')](_0x4b5d64,_0x423bd8[_0x300d('0x46')]['toLowerCase']());})){throw new db[(_0x300d('0x37'))][(_0x300d('0x33'))](_0x300d('0x47'));}}}var _0x509a3b={};_0x509a3b[_0x300d('0x48')]=_0x251f72[_0x300d('0x30')][_0x300d('0x32')](_0x300d('0x48'))?_0x251f72[_0x300d('0x30')][_0x300d('0x48')]:_0x251f72['user'][_0x300d('0x49')];_0x509a3b[_0x300d('0x4a')]=_[_0x300d('0x4b')](_0x251f72[_0x300d('0x30')][_0x300d('0x4a')])?null:_0x251f72[_0x300d('0x30')][_0x300d('0x4a')];_0x509a3b[_0x300d('0x4c')]=_0x251f72[_0x300d('0x30')][_0x300d('0x4c')]||![];_0x509a3b[_0x300d('0x4d')]=_0x251f72['user']['id'];return getContent(_0x251f72[_0x300d('0x30')])[_0x300d('0x2c')](function(_0x41814b){_0x509a3b[_0x300d('0x30')]=_0x41814b;return getRecipients(_0x14dfa6);})[_0x300d('0x2c')](function(_0x52b941){_0x509a3b[_0x300d('0x4e')]=_[_0x300d('0x4f')](_0x52b941)[_0x300d('0x50')](',');return db[_0x300d('0x51')]['transaction'](function(_0x529055){return db[_0x300d('0x52')][_0x300d('0x53')](_0x509a3b,{'raw':!![],'transaction':_0x529055})[_0x300d('0x2c')](function(_0x3bedc0){var _0x21caa1={'sender':_0x509a3b[_0x300d('0x48')],'description':_0x509a3b[_0x300d('0x4a')],'content':_0x509a3b['body'],'beep':_0x509a3b[_0x300d('0x4c')]};_0x52b941[_0x300d('0x54')](function(_0x1cf87){_0x21caa1[_0x300d('0x55')]=_0x1cf87;socket['emit'](_0x300d('0x56'),_0x21caa1);});return _0x3bedc0;});});})[_0x300d('0x2c')](respondWithResult(_0x204382,0xc9))['catch'](handleError(_0x204382,null));};function getContent(_0x1d4017){return new BPromise(function(_0x1295e0,_0x5638ad){if(_0x1d4017[_0x300d('0x31')]){_0x1295e0(_0x1d4017[_0x300d('0x31')]);return;}return db[_0x300d('0x57')][_0x300d('0x58')]({'attributes':[_0x300d('0x59')],'where':{'id':_0x1d4017[_0x300d('0x35')]},'raw':!![]})[_0x300d('0x2c')](function(_0x2898db){if(!_0x2898db)throw new db[(_0x300d('0x37'))][(_0x300d('0x33'))](_0x300d('0x5a'));var _0x4dac99=Mustache['render'](_0x2898db[_0x300d('0x59')],_0x1d4017[_0x300d('0x36')]);_0x1295e0(_0x4dac99);})[_0x300d('0x5b')](function(_0x5bd7c6){_0x5638ad(_0x5bd7c6);});});}function getRecipients(_0x4f8491){return new BPromise(function(_0x4607d4,_0x4c146d){var _0x41cf94=[];var _0x52e6d2=[];_0x4f8491[_0x300d('0x54')](function(_0x4a3481){var _0x507fc8=_[_0x300d('0x5c')](_0x4a3481['model'][_0x300d('0x5d')]());if(_0x507fc8===_0x300d('0x5e')){_0x41cf94=_[_0x300d('0x5f')](_0x41cf94,_0x4a3481[_0x300d('0x60')]);}else{if(_[_0x300d('0x45')](_0x507fc8,_0x300d('0x61')))_0x507fc8=_0x507fc8['replace']('queue',_0x300d('0x62'));_0x4a3481['ids']['forEach'](function(_0x43ff85){_0x52e6d2['push'](getAgents(_0x507fc8,_0x43ff85));});}});return BPromise['all'](_0x52e6d2)[_0x300d('0x2c')](function(_0x5e8669){_0x41cf94=_[_0x300d('0x5f')](_0x41cf94,_[_0x300d('0x63')](_0x5e8669));_0x4607d4(_0x41cf94);})[_0x300d('0x5b')](function(_0x139c76){_0x4c146d(_0x139c76);});});}function getAgents(_0x19ded9,_0x40e138){return new BPromise(function(_0x4328d4,_0x3845de){return db[_0x19ded9][_0x300d('0x58')]({'where':{'id':_0x40e138}})[_0x300d('0x2c')](function(_0x10a53f){return _0x10a53f[_0x300d('0x64')]({'attributes':['id'],'raw':!![]})[_0x300d('0x2c')](function(_0x4f7fa6){var _0x38ad2f=_[_0x300d('0x65')](_0x4f7fa6,'id');_0x4328d4(_0x38ad2f);});})['catch'](function(_0x2198f3){_0x3845de(_0x2198f3);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 37096bc..f140af4 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 _0xee24=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','UserNotification','setMaxListeners'];(function(_0x514da6,_0x3b61d9){var _0x3a47e7=function(_0x14f081){while(--_0x14f081){_0x514da6['push'](_0x514da6['shift']());}};_0x3a47e7(++_0x3b61d9);}(_0xee24,0x1d0));var _0x4ee2=function(_0x1b9025,_0x57ca6c){_0x1b9025=_0x1b9025-0x0;var _0x125c02=_0xee24[_0x1b9025];return _0x125c02;};'use strict';var EventEmitter=require(_0x4ee2('0x0'));var UserNotification=require(_0x4ee2('0x1'))['db'][_0x4ee2('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x4ee2('0x3')](0x0);var events={'afterCreate':_0x4ee2('0x4'),'afterUpdate':_0x4ee2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3afc62){return function(_0x2ab956,_0x17db16,_0x562eab){UserNotificationEvents[_0x4ee2('0x6')](_0x3afc62+':'+_0x2ab956['id'],_0x2ab956);UserNotificationEvents[_0x4ee2('0x6')](_0x3afc62,_0x2ab956);_0x562eab(null);};}for(var e in events){if(events[_0x4ee2('0x7')](e)){var event=events[e];UserNotification[_0x4ee2('0x8')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0xc688=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','save','remove'];(function(_0x4a1efa,_0x6e7052){var _0x2b5d62=function(_0x22b9d6){while(--_0x22b9d6){_0x4a1efa['push'](_0x4a1efa['shift']());}};_0x2b5d62(++_0x6e7052);}(_0xc688,0x144));var _0x8c68=function(_0x3691de,_0x5b8253){_0x3691de=_0x3691de-0x0;var _0xb9b9f3=_0xc688[_0x3691de];return _0xb9b9f3;};'use strict';var EventEmitter=require(_0x8c68('0x0'));var UserNotification=require(_0x8c68('0x1'))['db'][_0x8c68('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x8c68('0x3')](0x0);var events={'afterCreate':_0x8c68('0x4'),'afterUpdate':'update','afterDestroy':_0x8c68('0x5')};function emitEvent(_0x27b3af){return function(_0x1420c5,_0x39cbe9,_0x2f3ab9){UserNotificationEvents[_0x8c68('0x6')](_0x27b3af+':'+_0x1420c5['id'],_0x1420c5);UserNotificationEvents[_0x8c68('0x6')](_0x27b3af,_0x1420c5);_0x2f3ab9(null);};}for(var e in events){if(events[_0x8c68('0x7')](e)){var event=events[e];UserNotification[_0x8c68('0x8')](e,emitEvent(event));}}module[_0x8c68('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index f309f62..ad28291 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 _0x27ab=['./userNotification.attributes','UserNotification','userNotifications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x27ab,0x154));var _0xb27a=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x27ab[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0xb27a('0x0'));var util=require(_0xb27a('0x1'));var logger=require(_0xb27a('0x2'))(_0xb27a('0x3'));var moment=require(_0xb27a('0x4'));var BPromise=require(_0xb27a('0x5'));var rp=require(_0xb27a('0x6'));var fs=require('fs');var path=require(_0xb27a('0x7'));var rimraf=require(_0xb27a('0x8'));var config=require(_0xb27a('0x9'));var attributes=require(_0xb27a('0xa'));module['exports']=function(_0x4c2714,_0x397cf2){return _0x4c2714['define'](_0xb27a('0xb'),attributes,{'tableName':_0xb27a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb27a('0xd')});}; \ No newline at end of file +var _0xc395=['userNotifications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','path','rimraf','./userNotification.attributes','exports','define','UserNotification'];(function(_0x1b3c30,_0xe3f388){var _0x1ca1b4=function(_0x21694a){while(--_0x21694a){_0x1b3c30['push'](_0x1b3c30['shift']());}};_0x1ca1b4(++_0xe3f388);}(_0xc395,0x16b));var _0x5c39=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc395[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5c39('0x0'))('api');var moment=require(_0x5c39('0x1'));var BPromise=require(_0x5c39('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5c39('0x3'));var rimraf=require(_0x5c39('0x4'));var config=require('../../config/environment');var attributes=require(_0x5c39('0x5'));module[_0x5c39('0x6')]=function(_0x478516,_0x2c77fe){return _0x478516[_0x5c39('0x7')](_0x5c39('0x8'),attributes,{'tableName':_0x5c39('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5c39('0xa'),'collate':_0x5c39('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 0e14c83..5dad8de 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 _0xf3fe=['code','UserNotification,\x20%s,\x20%s','message','result','lodash','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./userNotification.socket','register','then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x240860,_0x20c04d){var _0x40e288=function(_0x38a753){while(--_0x38a753){_0x240860['push'](_0x240860['shift']());}};_0x40e288(++_0x20c04d);}(_0xf3fe,0x184));var _0xef3f=function(_0x10975f,_0x1320e2){_0x10975f=_0x10975f-0x0;var _0x44a131=_0xf3fe[_0x10975f];return _0x44a131;};'use strict';var _=require(_0xef3f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef3f('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xef3f('0x2'));var logger=require(_0xef3f('0x3'))('rpc');var config=require(_0xef3f('0x4'));var jayson=require(_0xef3f('0x5'));var client=jayson[_0xef3f('0x6')][_0xef3f('0x7')]({'port':0x232a});config['redis']=_[_0xef3f('0x8')](config['redis'],{'host':_0xef3f('0x9'),'port':0x18eb});var socket=require(_0xef3f('0xa'))(new Redis(config['redis']));require(_0xef3f('0xb'))[_0xef3f('0xc')](socket);function respondWithRpcPromise(_0x38cc2e,_0x535e5f,_0x92fc76){return new BPromise(function(_0x4e7ee0,_0xb0fb38){return client['request'](_0x38cc2e,_0x92fc76)[_0xef3f('0xd')](function(_0x3e8fb8){logger[_0xef3f('0xe')]('UserNotification,\x20%s,\x20%s',_0x535e5f,_0xef3f('0xf'));logger[_0xef3f('0x10')](_0xef3f('0x11'),_0x535e5f,_0xef3f('0xf'),JSON[_0xef3f('0x12')](_0x3e8fb8));if(_0x3e8fb8[_0xef3f('0x13')]){if(_0x3e8fb8['error'][_0xef3f('0x14')]===0x1f4){logger[_0xef3f('0x13')](_0xef3f('0x15'),_0x535e5f,_0x3e8fb8[_0xef3f('0x13')][_0xef3f('0x16')]);return _0xb0fb38(_0x3e8fb8[_0xef3f('0x13')][_0xef3f('0x16')]);}logger[_0xef3f('0x13')]('UserNotification,\x20%s,\x20%s',_0x535e5f,_0x3e8fb8[_0xef3f('0x13')][_0xef3f('0x16')]);return _0x4e7ee0(_0x3e8fb8['error'][_0xef3f('0x16')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x535e5f,_0xef3f('0xf'));_0x4e7ee0(_0x3e8fb8[_0xef3f('0x17')][_0xef3f('0x16')]);}})['catch'](function(_0x2ec56d){logger[_0xef3f('0x13')](_0xef3f('0x15'),_0x535e5f,_0x2ec56d);_0xb0fb38(_0x2ec56d);});});} \ No newline at end of file +var _0xdb4c=['UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5ec544,_0x31a0c5){var _0x15d14e=function(_0x2435bf){while(--_0x2435bf){_0x5ec544['push'](_0x5ec544['shift']());}};_0x15d14e(++_0x31a0c5);}(_0xdb4c,0x116));var _0xcdb4=function(_0xd15d59,_0x323192){_0xd15d59=_0xd15d59-0x0;var _0x1dec06=_0xdb4c[_0xd15d59];return _0x1dec06;};'use strict';var _=require(_0xcdb4('0x0'));var util=require(_0xcdb4('0x1'));var moment=require(_0xcdb4('0x2'));var BPromise=require(_0xcdb4('0x3'));var rs=require(_0xcdb4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcdb4('0x5'))['db'];var utils=require(_0xcdb4('0x6'));var logger=require(_0xcdb4('0x7'))('rpc');var config=require(_0xcdb4('0x8'));var jayson=require(_0xcdb4('0x9'));var client=jayson[_0xcdb4('0xa')]['http']({'port':0x232a});config[_0xcdb4('0xb')]=_[_0xcdb4('0xc')](config[_0xcdb4('0xb')],{'host':_0xcdb4('0xd'),'port':0x18eb});var socket=require(_0xcdb4('0xe'))(new Redis(config['redis']));require(_0xcdb4('0xf'))[_0xcdb4('0x10')](socket);function respondWithRpcPromise(_0x3333b5,_0x37ba0e,_0x4d7c1c){return new BPromise(function(_0x146203,_0x3c76d9){return client[_0xcdb4('0x11')](_0x3333b5,_0x4d7c1c)[_0xcdb4('0x12')](function(_0x16ba94){logger['info'](_0xcdb4('0x13'),_0x37ba0e,_0xcdb4('0x14'));logger[_0xcdb4('0x15')](_0xcdb4('0x16'),_0x37ba0e,_0xcdb4('0x14'),JSON[_0xcdb4('0x17')](_0x16ba94));if(_0x16ba94[_0xcdb4('0x18')]){if(_0x16ba94[_0xcdb4('0x18')][_0xcdb4('0x19')]===0x1f4){logger[_0xcdb4('0x18')]('UserNotification,\x20%s,\x20%s',_0x37ba0e,_0x16ba94[_0xcdb4('0x18')][_0xcdb4('0x1a')]);return _0x3c76d9(_0x16ba94[_0xcdb4('0x18')]['message']);}logger[_0xcdb4('0x18')](_0xcdb4('0x13'),_0x37ba0e,_0x16ba94['error'][_0xcdb4('0x1a')]);return _0x146203(_0x16ba94['error'][_0xcdb4('0x1a')]);}else{logger[_0xcdb4('0x1b')](_0xcdb4('0x13'),_0x37ba0e,'request\x20sent');_0x146203(_0x16ba94[_0xcdb4('0x1c')]['message']);}})[_0xcdb4('0x1d')](function(_0x408c3a){logger[_0xcdb4('0x18')](_0xcdb4('0x13'),_0x37ba0e,_0x408c3a);_0x3c76d9(_0x408c3a);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 89973dd..a431c6a 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 _0x7a32=['userNotification:','./userNotification.events','update','emit','register','length'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0x7a32,0xb5));var _0x27a3=function(_0xd6970e,_0x5a15d8){_0xd6970e=_0xd6970e-0x0;var _0x40be06=_0x7a32[_0xd6970e];return _0x40be06;};'use strict';var UserNotificationEvents=require(_0x27a3('0x0'));var events=['save','remove',_0x27a3('0x1')];function createListener(_0x4a273c,_0xc422b){return function(_0x52c55c){_0xc422b[_0x27a3('0x2')](_0x4a273c,_0x52c55c);};}function removeListener(_0xe66e99,_0x171060){return function(){UserNotificationEvents['removeListener'](_0xe66e99,_0x171060);};}exports[_0x27a3('0x3')]=function(_0x1ea360){for(var _0x22c43e=0x0,_0x3d920f=events[_0x27a3('0x4')];_0x22c43e<_0x3d920f;_0x22c43e++){var _0xa397ba=events[_0x22c43e];var _0x41e1d5=createListener(_0x27a3('0x5')+_0xa397ba,_0x1ea360);UserNotificationEvents['on'](_0xa397ba,_0x41e1d5);}}; \ No newline at end of file +var _0x3eaf=['userNotification:','save','update','register','length'];(function(_0x2da3ff,_0x534fd4){var _0x482ff2=function(_0x421913){while(--_0x421913){_0x2da3ff['push'](_0x2da3ff['shift']());}};_0x482ff2(++_0x534fd4);}(_0x3eaf,0x88));var _0xf3ea=function(_0x2751bf,_0x3ab262){_0x2751bf=_0x2751bf-0x0;var _0x2be3f6=_0x3eaf[_0x2751bf];return _0x2be3f6;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xf3ea('0x0'),'remove',_0xf3ea('0x1')];function createListener(_0x9a8836,_0x5c0657){return function(_0x5ab929){_0x5c0657['emit'](_0x9a8836,_0x5ab929);};}function removeListener(_0x246f79,_0x1c68b2){return function(){UserNotificationEvents['removeListener'](_0x246f79,_0x1c68b2);};}exports[_0xf3ea('0x2')]=function(_0x488c91){for(var _0x14d5a4=0x0,_0x567d6a=events[_0xf3ea('0x3')];_0x14d5a4<_0x567d6a;_0x14d5a4++){var _0x446b69=events[_0x14d5a4];var _0x54c1fe=createListener(_0xf3ea('0x4')+_0x446b69,_0x488c91);UserNotificationEvents['on'](_0x446b69,_0x54c1fe);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 7a3a67c..3b36d3e 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2808a1,_0x522cde){var _0xdad805=function(_0x32948a){while(--_0x32948a){_0x2808a1['push'](_0x2808a1['shift']());}};_0xdad805(++_0x522cde);}(_0x70e0,0x17b));var _0x070e=function(_0x3b8219,_0x216e48){_0x3b8219=_0x3b8219-0x0;var _0x2e3071=_0x70e0[_0x3b8219];return _0x2e3071;};'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 +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x5b2d44,_0x1eb8e0){var _0x3ad3d6=function(_0x8dd773){while(--_0x8dd773){_0x5b2d44['push'](_0x5b2d44['shift']());}};_0x3ad3d6(++_0x1eb8e0);}(_0xedd9,0xfc));var _0x9edd=function(_0x392320,_0x428048){_0x392320=_0x392320-0x0;var _0x1fa64d=_0xedd9[_0x392320];return _0x1fa64d;};'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 diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index af9342a..5c895ff 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 _0xadbf=['INTEGER','sequelize'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xadbf,0x6d));var _0xfadb=function(_0x175b95,_0x2fd285){_0x175b95=_0x175b95-0x0;var _0x3370ea=_0xadbf[_0x175b95];return _0x3370ea;};'use strict';var Sequelize=require(_0xfadb('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xfadb('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4a44=['sequelize','INTEGER'];(function(_0x5980c2,_0x114eba){var _0x28b8be=function(_0xb9a2){while(--_0xb9a2){_0x5980c2['push'](_0x5980c2['shift']());}};_0x28b8be(++_0x114eba);}(_0x4a44,0x1ee));var _0x44a4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4a44[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x44a4('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x44a4('0x1')],'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 3df7a70..37507af 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 _0x4a04=['request-promise','path','../../config/environment','define','UserOpenchannelQueue','user_has_openchannel_queues','util','api','moment'];(function(_0x8dec24,_0x903de0){var _0x381de1=function(_0x1aceb4){while(--_0x1aceb4){_0x8dec24['push'](_0x8dec24['shift']());}};_0x381de1(++_0x903de0);}(_0x4a04,0x1bf));var _0x44a0=function(_0x2468b5,_0x506b9e){_0x2468b5=_0x2468b5-0x0;var _0x1056e4=_0x4a04[_0x2468b5];return _0x1056e4;};'use strict';var _=require('lodash');var util=require(_0x44a0('0x0'));var logger=require('../../config/logger')(_0x44a0('0x1'));var moment=require(_0x44a0('0x2'));var BPromise=require('bluebird');var rp=require(_0x44a0('0x3'));var fs=require('fs');var path=require(_0x44a0('0x4'));var rimraf=require('rimraf');var config=require(_0x44a0('0x5'));var attributes=require('./userOpenchannelQueue.attributes');module['exports']=function(_0x4f7587,_0x432c4c){return _0x4f7587[_0x44a0('0x6')](_0x44a0('0x7'),attributes,{'tableName':_0x44a0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21c7=['moment','bluebird','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash','../../config/logger','api'];(function(_0x15cf89,_0x2cda28){var _0x5a6893=function(_0x1d5203){while(--_0x1d5203){_0x15cf89['push'](_0x15cf89['shift']());}};_0x5a6893(++_0x2cda28);}(_0x21c7,0x129));var _0x721c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x21c7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x721c('0x0'));var util=require('util');var logger=require(_0x721c('0x1'))(_0x721c('0x2'));var moment=require(_0x721c('0x3'));var BPromise=require(_0x721c('0x4'));var rp=require(_0x721c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x721c('0x6'));var config=require(_0x721c('0x7'));var attributes=require(_0x721c('0x8'));module[_0x721c('0x9')]=function(_0x23da90,_0x2ae736){return _0x23da90[_0x721c('0xa')]('UserOpenchannelQueue',attributes,{'tableName':_0x721c('0xb'),'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 8c8e1f7..d06c5ac 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 _0x8879=['info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x459a83,_0x307396){var _0x20ba7f=function(_0x43b759){while(--_0x43b759){_0x459a83['push'](_0x459a83['shift']());}};_0x20ba7f(++_0x307396);}(_0x8879,0xc8));var _0x9887=function(_0x35c82d,_0x329dd2){_0x35c82d=_0x35c82d-0x0;var _0x5346ae=_0x8879[_0x35c82d];return _0x5346ae;};'use strict';var _=require(_0x9887('0x0'));var util=require(_0x9887('0x1'));var moment=require(_0x9887('0x2'));var BPromise=require(_0x9887('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9887('0x4'))['db'];var utils=require(_0x9887('0x5'));var logger=require(_0x9887('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9887('0x7')][_0x9887('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4350f1,_0x33a42c,_0x7709db){return new BPromise(function(_0xfc4e8c,_0x36c0d3){return client['request'](_0x4350f1,_0x7709db)['then'](function(_0x1665d9){logger[_0x9887('0x9')](_0x9887('0xa'),_0x33a42c,_0x9887('0xb'));logger[_0x9887('0xc')](_0x9887('0xd'),_0x33a42c,_0x9887('0xb'),JSON[_0x9887('0xe')](_0x1665d9));if(_0x1665d9[_0x9887('0xf')]){if(_0x1665d9[_0x9887('0xf')]['code']===0x1f4){logger[_0x9887('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x33a42c,_0x1665d9[_0x9887('0xf')][_0x9887('0x10')]);return _0x36c0d3(_0x1665d9[_0x9887('0xf')][_0x9887('0x10')]);}logger['error'](_0x9887('0xa'),_0x33a42c,_0x1665d9[_0x9887('0xf')][_0x9887('0x10')]);return _0xfc4e8c(_0x1665d9[_0x9887('0xf')]['message']);}else{logger[_0x9887('0x9')](_0x9887('0xa'),_0x33a42c,_0x9887('0xb'));_0xfc4e8c(_0x1665d9[_0x9887('0x11')]['message']);}})[_0x9887('0x12')](function(_0x58019d){logger[_0x9887('0xf')](_0x9887('0xa'),_0x33a42c,_0x58019d);_0x36c0d3(_0x58019d);});});} \ No newline at end of file +var _0xe5a8=['result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5d6cdc,_0x13e911){var _0x59cc8a=function(_0xab4572){while(--_0xab4572){_0x5d6cdc['push'](_0x5d6cdc['shift']());}};_0x59cc8a(++_0x13e911);}(_0xe5a8,0x8b));var _0x8e5a=function(_0x1bb787,_0x2cea6c){_0x1bb787=_0x1bb787-0x0;var _0x3cbe34=_0xe5a8[_0x1bb787];return _0x3cbe34;};'use strict';var _=require('lodash');var util=require(_0x8e5a('0x0'));var moment=require(_0x8e5a('0x1'));var BPromise=require(_0x8e5a('0x2'));var rs=require(_0x8e5a('0x3'));var fs=require('fs');var Redis=require(_0x8e5a('0x4'));var db=require(_0x8e5a('0x5'))['db'];var utils=require(_0x8e5a('0x6'));var logger=require(_0x8e5a('0x7'))(_0x8e5a('0x8'));var config=require(_0x8e5a('0x9'));var jayson=require(_0x8e5a('0xa'));var client=jayson[_0x8e5a('0xb')][_0x8e5a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4b667c,_0x11ccd9,_0x7635b8){return new BPromise(function(_0x1f2eff,_0x3510af){return client['request'](_0x4b667c,_0x7635b8)[_0x8e5a('0xd')](function(_0x462473){logger[_0x8e5a('0xe')](_0x8e5a('0xf'),_0x11ccd9,_0x8e5a('0x10'));logger[_0x8e5a('0x11')](_0x8e5a('0x12'),_0x11ccd9,_0x8e5a('0x10'),JSON['stringify'](_0x462473));if(_0x462473[_0x8e5a('0x13')]){if(_0x462473[_0x8e5a('0x13')][_0x8e5a('0x14')]===0x1f4){logger[_0x8e5a('0x13')](_0x8e5a('0xf'),_0x11ccd9,_0x462473[_0x8e5a('0x13')][_0x8e5a('0x15')]);return _0x3510af(_0x462473[_0x8e5a('0x13')]['message']);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x11ccd9,_0x462473[_0x8e5a('0x13')][_0x8e5a('0x15')]);return _0x1f2eff(_0x462473['error'][_0x8e5a('0x15')]);}else{logger[_0x8e5a('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x11ccd9,_0x8e5a('0x10'));_0x1f2eff(_0x462473[_0x8e5a('0x16')][_0x8e5a('0x15')]);}})['catch'](function(_0xfbe1d8){logger[_0x8e5a('0x13')](_0x8e5a('0xf'),_0x11ccd9,_0xfbe1d8);_0x3510af(_0xfbe1d8);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index c561d73..812bee1 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 _0xc8bb=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','/:id/sections','addSections','addResources','put','update','delete','destroy','removeResources','exports'];(function(_0x598b6f,_0x55690f){var _0x40959f=function(_0x5b23af){while(--_0x5b23af){_0x598b6f['push'](_0x598b6f['shift']());}};_0x40959f(++_0x55690f);}(_0xc8bb,0xa2));var _0xbc8b=function(_0x9fc61a,_0x4be3ce){_0x9fc61a=_0x9fc61a-0x0;var _0x25fe59=_0xc8bb[_0x9fc61a];return _0x25fe59;};'use strict';var multer=require('multer');var util=require(_0xbc8b('0x0'));var path=require(_0xbc8b('0x1'));var timeout=require(_0xbc8b('0x2'));var express=require('express');var router=express[_0xbc8b('0x3')]();var fs_extra=require(_0xbc8b('0x4'));var auth=require(_0xbc8b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbc8b('0x6'));var controller=require('./userProfile.controller');router[_0xbc8b('0x7')]('/',auth[_0xbc8b('0x8')](),controller[_0xbc8b('0x9')]);router[_0xbc8b('0x7')]('/describe',auth[_0xbc8b('0x8')](),controller['describe']);router['get'](_0xbc8b('0xa'),auth[_0xbc8b('0x8')](),controller['show']);router[_0xbc8b('0x7')]('/:id/sections',auth['isAuthenticated'](),controller[_0xbc8b('0xb')]);router[_0xbc8b('0x7')](_0xbc8b('0xc'),auth[_0xbc8b('0x8')](),controller[_0xbc8b('0xd')]);router[_0xbc8b('0xe')]('/',auth['isAuthenticated'](),controller[_0xbc8b('0xf')]);router[_0xbc8b('0xe')](_0xbc8b('0x10'),auth[_0xbc8b('0x8')](),controller[_0xbc8b('0x11')]);router[_0xbc8b('0xe')](_0xbc8b('0x12'),auth['isAuthenticated'](),controller[_0xbc8b('0x13')]);router[_0xbc8b('0xe')]('/:id/resources',auth[_0xbc8b('0x8')](),controller[_0xbc8b('0x14')]);router[_0xbc8b('0x15')]('/:id',auth[_0xbc8b('0x8')](),controller[_0xbc8b('0x16')]);router[_0xbc8b('0x17')](_0xbc8b('0xa'),auth[_0xbc8b('0x8')](),controller[_0xbc8b('0x18')]);router['delete'](_0xbc8b('0x12'),auth[_0xbc8b('0x8')](),controller['removeSections']);router[_0xbc8b('0x17')]('/:id/resources',auth[_0xbc8b('0x8')](),controller[_0xbc8b('0x19')]);module[_0xbc8b('0x1a')]=router; \ No newline at end of file +var _0x5cae=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','/:id','show','/:id/sections','/:id/resources','getResources','post','create','clone','addSections','addResources','put','update','destroy','delete','removeSections','removeResources','exports','multer','util','path'];(function(_0x48c177,_0x528d3e){var _0x5e3b76=function(_0x4cbf7c){while(--_0x4cbf7c){_0x48c177['push'](_0x48c177['shift']());}};_0x5e3b76(++_0x528d3e);}(_0x5cae,0xb1));var _0xe5ca=function(_0x5a3785,_0x2de636){_0x5a3785=_0x5a3785-0x0;var _0x4d058a=_0x5cae[_0x5a3785];return _0x4d058a;};'use strict';var multer=require(_0xe5ca('0x0'));var util=require(_0xe5ca('0x1'));var path=require(_0xe5ca('0x2'));var timeout=require('connect-timeout');var express=require(_0xe5ca('0x3'));var router=express[_0xe5ca('0x4')]();var fs_extra=require(_0xe5ca('0x5'));var auth=require(_0xe5ca('0x6'));var interaction=require(_0xe5ca('0x7'));var config=require(_0xe5ca('0x8'));var controller=require(_0xe5ca('0x9'));router[_0xe5ca('0xa')]('/',auth[_0xe5ca('0xb')](),controller['index']);router['get'](_0xe5ca('0xc'),auth[_0xe5ca('0xb')](),controller['describe']);router['get'](_0xe5ca('0xd'),auth[_0xe5ca('0xb')](),controller[_0xe5ca('0xe')]);router[_0xe5ca('0xa')](_0xe5ca('0xf'),auth['isAuthenticated'](),controller['getSections']);router[_0xe5ca('0xa')](_0xe5ca('0x10'),auth['isAuthenticated'](),controller[_0xe5ca('0x11')]);router[_0xe5ca('0x12')]('/',auth['isAuthenticated'](),controller[_0xe5ca('0x13')]);router[_0xe5ca('0x12')]('/:id/clone',auth[_0xe5ca('0xb')](),controller[_0xe5ca('0x14')]);router[_0xe5ca('0x12')](_0xe5ca('0xf'),auth[_0xe5ca('0xb')](),controller[_0xe5ca('0x15')]);router[_0xe5ca('0x12')](_0xe5ca('0x10'),auth[_0xe5ca('0xb')](),controller[_0xe5ca('0x16')]);router[_0xe5ca('0x17')](_0xe5ca('0xd'),auth[_0xe5ca('0xb')](),controller[_0xe5ca('0x18')]);router['delete'](_0xe5ca('0xd'),auth[_0xe5ca('0xb')](),controller[_0xe5ca('0x19')]);router[_0xe5ca('0x1a')](_0xe5ca('0xf'),auth[_0xe5ca('0xb')](),controller[_0xe5ca('0x1b')]);router[_0xe5ca('0x1a')](_0xe5ca('0x10'),auth[_0xe5ca('0xb')](),controller[_0xe5ca('0x1c')]);module[_0xe5ca('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 3bd478e..be98934 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 _0x1df4=['split','BOOLEAN','sequelize','STRING','crudPermissions','join','getDataValue'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x1df4,0xa3));var _0x41df=function(_0xabca51,_0x1ce664){_0xabca51=_0xabca51-0x0;var _0x10d033=_0x1df4[_0xabca51];return _0x10d033;};'use strict';var Sequelize=require(_0x41df('0x0'));module['exports']={'name':{'type':Sequelize[_0x41df('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x41df('0x1')],'set':function(_0x19e583){this['setDataValue'](_0x41df('0x2'),_0x19e583?_0x19e583[_0x41df('0x3')](''):[]);},'get':function(){return this['getDataValue'](_0x41df('0x2'))?this[_0x41df('0x4')](_0x41df('0x2'))[_0x41df('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x41df('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x41df('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x41df('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x41df('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x41df('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x41df('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc784=['BOOLEAN','sequelize','exports','join','getDataValue','crudPermissions','split','STRING'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xc784,0x1c1));var _0x4c78=function(_0x306448,_0x37de6a){_0x306448=_0x306448-0x0;var _0x2c66a5=_0xc784[_0x306448];return _0x2c66a5;};'use strict';var Sequelize=require(_0x4c78('0x0'));module[_0x4c78('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x4ca45c){this['setDataValue']('crudPermissions',_0x4ca45c?_0x4ca45c[_0x4c78('0x2')](''):[]);},'get':function(){return this[_0x4c78('0x3')](_0x4c78('0x4'))?this[_0x4c78('0x3')]('crudPermissions')[_0x4c78('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x4c78('0x6')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x4c78('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x4c78('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x4c78('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x4c78('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x4c78('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index e6d0ca1..f7fc0c7 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 _0x5324=['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','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','register','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','clone','get','omit','createdAt','updatedAt','crudPermissions','body','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','push','removeSections','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','ids','getResources','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path'];(function(_0x96ad7d,_0x1017ba){var _0x32d63a=function(_0xb47ad9){while(--_0xb47ad9){_0x96ad7d['push'](_0x96ad7d['shift']());}};_0x32d63a(++_0x1017ba);}(_0x5324,0x154));var _0x4532=function(_0x247d9c,_0x323c0a){_0x247d9c=_0x247d9c-0x0;var _0x5ea1be=_0x5324[_0x247d9c];return _0x5ea1be;};'use strict';var emlformat=require(_0x4532('0x0'));var rimraf=require(_0x4532('0x1'));var zipdir=require(_0x4532('0x2'));var jsonpatch=require(_0x4532('0x3'));var rp=require('request-promise');var moment=require(_0x4532('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4532('0x5'));var util=require(_0x4532('0x6'));var path=require(_0x4532('0x7'));var sox=require(_0x4532('0x8'));var csv=require(_0x4532('0x9'));var ejs=require(_0x4532('0xa'));var fs=require('fs');var fs_extra=require(_0x4532('0xb'));var _=require(_0x4532('0xc'));var squel=require('squel');var crypto=require(_0x4532('0xd'));var jsforce=require(_0x4532('0xe'));var deskjs=require(_0x4532('0xf'));var toCsv=require(_0x4532('0x9'));var querystring=require(_0x4532('0x10'));var Papa=require(_0x4532('0x11'));var Redis=require(_0x4532('0x12'));var authService=require(_0x4532('0x13'));var qs=require(_0x4532('0x14'));var as=require(_0x4532('0x15'));var hardwareService=require(_0x4532('0x16'));var logger=require(_0x4532('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x4532('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4532('0x19'))['db'];config[_0x4532('0x1a')]=_[_0x4532('0x1b')](config[_0x4532('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x4532('0x1c'))(new Redis(config[_0x4532('0x1a')]));require(_0x4532('0x1d'))[_0x4532('0x1e')](socket);function respondWithStatusCode(_0x19eaf3,_0x525f96){_0x525f96=_0x525f96||0xcc;return function(_0x59075c){if(_0x59075c){return _0x19eaf3['sendStatus'](_0x525f96);}return _0x19eaf3[_0x4532('0x1f')](_0x525f96)[_0x4532('0x20')]();};}function respondWithResult(_0x2dedca,_0x3b97ee){_0x3b97ee=_0x3b97ee||0xc8;return function(_0x17512a){if(_0x17512a){return _0x2dedca[_0x4532('0x1f')](_0x3b97ee)[_0x4532('0x21')](_0x17512a);}};}function respondWithFilteredResult(_0x4036b6,_0xd479a9){return function(_0x4db2a1){if(_0x4db2a1){var _0x281ab6=typeof _0xd479a9[_0x4532('0x22')]===_0x4532('0x23')&&typeof _0xd479a9['limit']===_0x4532('0x23');var _0x3734e3=_0x4db2a1['count'];var _0x20a30c=_0x281ab6?0x0:_0xd479a9[_0x4532('0x22')];var _0xf37fc8=_0x281ab6?_0x4db2a1[_0x4532('0x24')]:_0xd479a9[_0x4532('0x22')]+_0xd479a9[_0x4532('0x25')];var _0x6a669f;if(_0xf37fc8>=_0x3734e3){_0xf37fc8=_0x3734e3;_0x6a669f=0xc8;}else{_0x6a669f=0xce;}_0x4036b6[_0x4532('0x1f')](_0x6a669f);return _0x4036b6['set'](_0x4532('0x26'),_0x20a30c+'-'+_0xf37fc8+'/'+_0x3734e3)[_0x4532('0x21')](_0x4db2a1);}return null;};}function patchUpdates(_0x481c26){return function(_0x1c383c){try{jsonpatch[_0x4532('0x27')](_0x1c383c,_0x481c26,!![]);}catch(_0x472d0d){return BPromise[_0x4532('0x28')](_0x472d0d);}return _0x1c383c['save']();};}function saveUpdates(_0xbf825a,_0x571e56){return function(_0x2828ca){if(_0x2828ca){return _0x2828ca[_0x4532('0x29')](_0xbf825a)[_0x4532('0x2a')](function(_0x12ee78){return _0x12ee78;});}return null;};}function removeEntity(_0x40e42f,_0x278b04){return function(_0x105338){if(_0x105338){return _0x105338[_0x4532('0x2b')]()['then'](function(){_0x40e42f['status'](0xcc)[_0x4532('0x20')]();});}};}function handleEntityNotFound(_0x401f3b,_0x60203f){return function(_0x19f85c){if(!_0x19f85c){_0x401f3b[_0x4532('0x2c')](0x194);}return _0x19f85c;};}function handleError(_0x79e5a4,_0x4a810d){_0x4a810d=_0x4a810d||0x1f4;return function(_0x3de0ee){logger[_0x4532('0x2d')](_0x3de0ee[_0x4532('0x2e')]);if(_0x3de0ee[_0x4532('0x2f')]){delete _0x3de0ee[_0x4532('0x2f')];}_0x79e5a4['status'](_0x4a810d)[_0x4532('0x30')](_0x3de0ee);};}exports[_0x4532('0x31')]=function(_0xb2d129,_0x523f96){var _0x58602d={},_0x5b1bab={},_0x3e4c89={'count':0x0,'rows':[]};var _0x24ab08=_[_0x4532('0x32')](db[_0x4532('0x33')][_0x4532('0x34')],function(_0x400646){return{'name':_0x400646[_0x4532('0x35')],'type':_0x400646['type']['key']};});_0x5b1bab[_0x4532('0x36')]=_[_0x4532('0x32')](_0x24ab08,'name');_0x5b1bab[_0x4532('0x37')]=_[_0x4532('0x38')](_0xb2d129[_0x4532('0x37')]);_0x5b1bab[_0x4532('0x39')]=_[_0x4532('0x3a')](_0x5b1bab[_0x4532('0x36')],_0x5b1bab[_0x4532('0x37')]);_0x58602d[_0x4532('0x3b')]=_['intersection'](_0x5b1bab['model'],qs[_0x4532('0x3c')](_0xb2d129[_0x4532('0x37')]['fields']));_0x58602d[_0x4532('0x3b')]=_0x58602d[_0x4532('0x3b')][_0x4532('0x3d')]?_0x58602d[_0x4532('0x3b')]:_0x5b1bab['model'];if(!_0xb2d129[_0x4532('0x37')]['hasOwnProperty'](_0x4532('0x3e'))){_0x58602d['limit']=qs[_0x4532('0x25')](_0xb2d129[_0x4532('0x37')][_0x4532('0x25')]);_0x58602d[_0x4532('0x22')]=qs[_0x4532('0x22')](_0xb2d129[_0x4532('0x37')][_0x4532('0x22')]);}_0x58602d[_0x4532('0x3f')]=qs[_0x4532('0x40')](_0xb2d129[_0x4532('0x37')][_0x4532('0x40')]);_0x58602d['where']=qs[_0x4532('0x39')](_['pick'](_0xb2d129['query'],_0x5b1bab[_0x4532('0x39')]),_0x24ab08);if(_0xb2d129['query'][_0x4532('0x41')]){_0x58602d[_0x4532('0x42')]=_[_0x4532('0x43')](_0x58602d[_0x4532('0x42')],{'$or':_[_0x4532('0x32')](_0x24ab08,function(_0x56dd14){if(_0x56dd14['type']!==_0x4532('0x44')){var _0x1187d8={};_0x1187d8[_0x56dd14['name']]={'$like':'%'+_0xb2d129[_0x4532('0x37')]['filter']+'%'};return _0x1187d8;}})});}_0x58602d=_[_0x4532('0x43')]({},_0x58602d,_0xb2d129[_0x4532('0x45')]);var _0x54f868={'where':_0x58602d['where']};return db[_0x4532('0x33')][_0x4532('0x24')](_0x54f868)[_0x4532('0x2a')](function(_0x56f3d6){_0x3e4c89[_0x4532('0x24')]=_0x56f3d6;if(_0xb2d129[_0x4532('0x37')][_0x4532('0x46')]){_0x58602d['include']=[{'all':!![]}];}return db['UserProfile'][_0x4532('0x47')](_0x58602d);})[_0x4532('0x2a')](function(_0x2b39c8){_0x3e4c89['rows']=_0x2b39c8;return _0x3e4c89;})[_0x4532('0x2a')](respondWithFilteredResult(_0x523f96,_0x58602d))[_0x4532('0x48')](handleError(_0x523f96,null));};exports[_0x4532('0x49')]=function(_0x321304,_0x5c75ff){var _0x4ced14={'raw':![],'where':{'id':_0x321304[_0x4532('0x4a')]['id']}},_0x3326cf={};_0x3326cf[_0x4532('0x36')]=_[_0x4532('0x38')](db['UserProfile'][_0x4532('0x34')]);_0x3326cf[_0x4532('0x37')]=_[_0x4532('0x38')](_0x321304[_0x4532('0x37')]);_0x3326cf[_0x4532('0x39')]=_['intersection'](_0x3326cf[_0x4532('0x36')],_0x3326cf[_0x4532('0x37')]);_0x4ced14[_0x4532('0x3b')]=_[_0x4532('0x3a')](_0x3326cf[_0x4532('0x36')],qs[_0x4532('0x3c')](_0x321304[_0x4532('0x37')]['fields']));_0x4ced14[_0x4532('0x3b')]=_0x4ced14['attributes']['length']?_0x4ced14[_0x4532('0x3b')]:_0x3326cf[_0x4532('0x36')];if(_0x321304['query']['includeAll']){_0x4ced14[_0x4532('0x4b')]=[{'all':!![]}];}_0x4ced14=_['merge']({},_0x4ced14,_0x321304[_0x4532('0x45')]);return db[_0x4532('0x33')][_0x4532('0x4c')](_0x4ced14)[_0x4532('0x2a')](handleEntityNotFound(_0x5c75ff,null))[_0x4532('0x2a')](respondWithResult(_0x5c75ff,null))['catch'](handleError(_0x5c75ff,null));};exports[_0x4532('0x4d')]=function(_0x388583,_0x31501d){return db['UserProfile'][_0x4532('0x4d')](_0x388583['body'],{})[_0x4532('0x2a')](respondWithResult(_0x31501d,0xc9))['catch'](handleError(_0x31501d,null));};exports[_0x4532('0x4e')]=function(_0x1cfb76,_0x2d8109){var _0x16f869={'where':{'id':_0x1cfb76[_0x4532('0x4a')]['id']}},_0x2862b0={};_0x2862b0[_0x4532('0x36')]=_['keys'](db[_0x4532('0x33')][_0x4532('0x34')]);_0x16f869[_0x4532('0x3b')]=_[_0x4532('0x3a')](_0x2862b0[_0x4532('0x36')],qs[_0x4532('0x3c')](_0x1cfb76['query'][_0x4532('0x3c')]));_0x16f869[_0x4532('0x3b')]=_0x16f869[_0x4532('0x3b')][_0x4532('0x3d')]?_0x16f869[_0x4532('0x3b')]:_0x2862b0[_0x4532('0x36')];if(_0x1cfb76['query']['includeAll']){_0x16f869['include']=[{'all':!![]}];}_0x16f869=_[_0x4532('0x43')]({},_0x16f869,_0x1cfb76[_0x4532('0x45')]);return db[_0x4532('0x33')][_0x4532('0x4c')](_0x16f869)['then'](handleEntityNotFound(_0x2d8109,null))[_0x4532('0x2a')](function(_0x463ed6){if(_0x463ed6){var _0x299815=_0x463ed6[_0x4532('0x4f')]({'plain':!![]});_0x299815=qs[_0x4532('0x50')](_0x299815,['id',_0x4532('0x51'),_0x4532('0x52'),_0x4532('0x53')]);_0x1cfb76[_0x4532('0x54')]=_[_0x4532('0x50')](_0x1cfb76[_0x4532('0x54')],['id',_0x4532('0x51'),_0x4532('0x52')]);return db[_0x4532('0x55')][_0x4532('0x56')](function(_0x25109a){return db[_0x4532('0x33')]['create'](_[_0x4532('0x43')](_0x299815,_0x1cfb76[_0x4532('0x54')]),{'include':_0x1cfb76['query'][_0x4532('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x25109a})[_0x4532('0x2a')](function(_0x585437){var _0x2f22a4=_0x585437[_0x4532('0x4f')]({'plain':!![]});return db[_0x4532('0x57')]['findAll']({'where':{'userProfileId':_0x1cfb76[_0x4532('0x4a')]['id']},'raw':!![]})['then'](function(_0x1913cd){if(_0x1913cd){return BPromise[_0x4532('0x58')](_0x1913cd,function(_0x4fb50f){return new BPromise(function(_0x428e46,_0x466c32){if(_0x4fb50f[_0x4532('0x59')]===null||_0x4fb50f[_0x4532('0x59')]===0x1)_0x428e46(null);return db[_0x4532('0x5a')]['findAll']({'where':{'sectionId':_0x4fb50f['id']},'raw':!![]})[_0x4532('0x2a')](function(_0x39da10){var _0x23cc08=_['map'](_0x39da10,function(_0x480da3){return qs['omit'](_0x480da3,['id',_0x4532('0x51'),'updatedAt',_0x4532('0x5b')]);});_0x428e46(_0x23cc08);})[_0x4532('0x48')](function(_0x5c1232){_0x466c32(_0x5c1232);});})[_0x4532('0x2a')](function(_0x278d52){var _0x1ec96e=qs[_0x4532('0x50')](_0x4fb50f,['id',_0x4532('0x51'),_0x4532('0x52')]);_0x1ec96e[_0x4532('0x5c')]=_0x2f22a4['id'];if(_0x278d52)_0x1ec96e[_0x4532('0x5d')]=_0x278d52;return _0x1ec96e;})[_0x4532('0x2a')](function(_0x3c4759){return db['UserProfileSection'][_0x4532('0x4d')](_0x3c4759,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x25109a});});})['then'](function(){return _0x2f22a4;});}});});});}})[_0x4532('0x2a')](respondWithResult(_0x2d8109,0xc9))[_0x4532('0x48')](handleError(_0x2d8109,null));};exports[_0x4532('0x29')]=function(_0x438fb3,_0x5874ed){if(_0x438fb3[_0x4532('0x54')]['id']){delete _0x438fb3['body']['id'];}return db[_0x4532('0x33')][_0x4532('0x4c')]({'where':{'id':_0x438fb3[_0x4532('0x4a')]['id']}})[_0x4532('0x2a')](handleEntityNotFound(_0x5874ed,null))[_0x4532('0x2a')](saveUpdates(_0x438fb3[_0x4532('0x54')],null))[_0x4532('0x2a')](respondWithResult(_0x5874ed,null))['catch'](handleError(_0x5874ed,null));};exports[_0x4532('0x2b')]=function(_0x439a7b,_0x3c925d){return db[_0x4532('0x33')]['find']({'where':{'id':_0x439a7b[_0x4532('0x4a')]['id']}})[_0x4532('0x2a')](handleEntityNotFound(_0x3c925d,null))['then'](removeEntity(_0x3c925d,null))[_0x4532('0x48')](handleError(_0x3c925d,null));};exports['describe']=function(_0x46da6f,_0x301696){return db[_0x4532('0x33')][_0x4532('0x5e')]()[_0x4532('0x2a')](respondWithResult(_0x301696,null))[_0x4532('0x48')](handleError(_0x301696,null));};exports[_0x4532('0x5f')]=function(_0x48c899,_0x57b1f6){var _0x16a14c=_0x48c899[_0x4532('0x54')];return db[_0x4532('0x33')]['find']({'where':{'id':_0x48c899[_0x4532('0x4a')]['id']}})[_0x4532('0x2a')](handleEntityNotFound(_0x57b1f6,null))[_0x4532('0x2a')](function(_0x3b2c5d){if(_0x3b2c5d){return db['sequelize'][_0x4532('0x56')](function(_0x524812){return db[_0x4532('0x57')][_0x4532('0x2b')]({'where':{'userProfileId':_0x48c899['params']['id'],'sectionId':_[_0x4532('0x32')](_0x16a14c,function(_0x352b28){return _0x352b28['sectionId'];})},'transaction':_0x524812})[_0x4532('0x2a')](function(){var _0x242e03=_['map'](_0x16a14c,function(_0x37e645){_0x37e645['userProfileId']=_0x48c899[_0x4532('0x4a')]['id'];return _0x37e645;});var _0xf5a0ef=[];return BPromise[_0x4532('0x58')](_0x242e03,function(_0x336d7a){return db['UserProfileSection']['create'](_0x336d7a,{'include':[{'model':db[_0x4532('0x5a')],'as':'Resources'}],'raw':!![],'transaction':_0x524812})['then'](function(_0x3013c8){_0xf5a0ef[_0x4532('0x60')](_0x3013c8[_0x4532('0x4f')]({'plain':!![]}));});})[_0x4532('0x2a')](function(){return _0xf5a0ef;});});});}})[_0x4532('0x2a')](function(_0x3be620){return _0x3be620;})[_0x4532('0x2a')](respondWithResult(_0x57b1f6,null))[_0x4532('0x48')](handleError(_0x57b1f6,null));};exports[_0x4532('0x61')]=function(_0x354812,_0x1ed9a2){var _0x3af4b8;return db[_0x4532('0x33')]['find']({'where':{'id':_0x354812[_0x4532('0x4a')]['id']},'attributes':['id',_0x4532('0x2f')]})['then'](handleEntityNotFound(_0x1ed9a2,null))[_0x4532('0x2a')](function(_0x3fc432){if(_0x3fc432){_0x3af4b8=_0x3fc432;return db[_0x4532('0x57')]['destroy']({'where':{'userProfileId':_0x354812[_0x4532('0x4a')]['id'],'sectionId':_0x354812['query']['ids']}});}})['then'](function(){return _0x3af4b8;})['then'](respondWithStatusCode(_0x1ed9a2,null))[_0x4532('0x48')](handleError(_0x1ed9a2,null));};exports[_0x4532('0x62')]=function(_0x840d09,_0x5c7331){var _0x231ebe=[];var _0x2a8030=[];return db[_0x4532('0x57')][_0x4532('0x47')]({'where':{'userProfileId':_0x840d09[_0x4532('0x4a')]['id']},'raw':!![]})[_0x4532('0x2a')](function(_0x51d187){_0x231ebe=_['filter'](_0x51d187,function(_0xc4f236){return _0xc4f236[_0x4532('0x63')]===0x1||_[_0x4532('0x64')]([0x3eb,0x709],_0xc4f236[_0x4532('0x5b')]);});if(!_[_0x4532('0x65')](_0x231ebe)){return _[_0x4532('0x32')](_0x231ebe,function(_0x38a7b3){return _0x38a7b3[_0x4532('0x5b')];});}else{return;}})['then'](function(_0x583c59){if(_0x583c59)_0x2a8030=_0x583c59;if(_[_0x4532('0x64')](_0x2a8030,0x64)){var _0x414601=_[_0x4532('0x4c')](_0x231ebe,{'sectionId':0x64});return hasDefaultDashboard(_0x414601)[_0x4532('0x2a')](function(_0x3d76e6){return _[_0x4532('0x32')](_0x231ebe,function(_0x119352){if(_0x119352['sectionId']===0x64){_0x119352[_0x4532('0x66')]=_0x3d76e6;}return _0x119352;});});}else{return;}})[_0x4532('0x2a')](function(_0x522237){if(_0x522237)_0x231ebe=_0x522237;if(_[_0x4532('0x64')](_0x2a8030,0x3eb)){var _0x1c19b0=_[_0x4532('0x4c')](_0x231ebe,{'sectionId':0x3eb});return getCustomDashboards(_0x1c19b0)[_0x4532('0x2a')](function(_0x4dcca6){return _[_0x4532('0x32')](_0x231ebe,function(_0x152413){if(_0x1c19b0[_0x4532('0x63')]){if(_0x152413[_0x4532('0x5b')]===0x3eb){_0x152413[_0x4532('0x66')]=_0x4dcca6;}}else{if(_0x152413[_0x4532('0x5b')]===0x64){_0x152413['subsections']=_0x4dcca6;}}return _0x152413;});});}else{return;}})[_0x4532('0x2a')](function(_0x4c7c62){if(_0x4c7c62)_0x231ebe=_0x4c7c62;if(_[_0x4532('0x64')](_0x2a8030,0x709)){var _0x1cd202=_[_0x4532('0x4c')](_0x231ebe,{'sectionId':0x709});return getPlugins(_0x1cd202)[_0x4532('0x2a')](function(_0x3e9d5a){if(_0x1cd202['enabled']){return _[_0x4532('0x32')](_0x231ebe,function(_0x8194e1){if(_0x8194e1[_0x4532('0x5b')]===0x709){_0x8194e1[_0x4532('0x66')]=_0x3e9d5a;}return _0x8194e1;});}else{var _0x338ed3={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3e9d5a};var _0xe6a86d=_['map'](_0x231ebe);_0xe6a86d['push'](_0x338ed3);return _0xe6a86d;}});}else{return;}})[_0x4532('0x2a')](function(_0x57095d){if(_0x57095d)_0x231ebe=_0x57095d;return _[_0x4532('0x41')](_0x231ebe,[_0x4532('0x63'),0x1]);})[_0x4532('0x2a')](respondWithResult(_0x5c7331,null))[_0x4532('0x48')](handleError(_0x5c7331,null));};function hasDefaultDashboard(_0xc8c74d){var _0x29d8ae=[0x65];return new BPromise(function(_0x3feed7,_0x4b828f){try{if(_0xc8c74d[_0x4532('0x59')]){_0x3feed7(_0x29d8ae);}else{return db[_0x4532('0x5a')][_0x4532('0x67')]({'where':{'sectionId':_0xc8c74d['id']},'raw':!![]})['then'](function(_0x53d6e9){_0x53d6e9?_0x3feed7(_0x29d8ae):_0x3feed7();});}}catch(_0x1226d6){_0x4b828f(_0x1226d6);}});}function getCustomDashboards(_0x9e9ec1){var _0x26b03c=[];return new BPromise(function(_0x79365b,_0x23c6f8){try{if(_0x9e9ec1[_0x4532('0x59')]){return db[_0x4532('0x68')]['findAll']({'raw':!![]})[_0x4532('0x2a')](function(_0xfee512){_0xfee512[_0x4532('0x69')](function(_0x236a15){_0x26b03c[_0x4532('0x60')](_0x236a15['id']+0x1869f);});_0x79365b(_0x26b03c);});}else{return db[_0x4532('0x5a')]['findAll']({'where':{'sectionId':_0x9e9ec1['id']},'raw':!![]})[_0x4532('0x2a')](function(_0x149171){_0x149171['forEach'](function(_0x2644e1){_0x26b03c['push'](_0x2644e1[_0x4532('0x6a')]+0x1869f);});_0x79365b(_0x26b03c);});}}catch(_0x1d4064){_0x23c6f8(_0x1d4064);}});}function getPlugins(_0x4f079d){var _0x3a5cb3=[];return new BPromise(function(_0x5f1fa1,_0x3e8dd5){try{if(_0x4f079d['autoAssociation']){return db[_0x4532('0x6b')][_0x4532('0x47')]({'raw':!![]})[_0x4532('0x2a')](function(_0x22e978){_0x22e978[_0x4532('0x69')](function(_0x415e0a){_0x3a5cb3[_0x4532('0x60')](_0x415e0a['id']+0x15b38);});_0x5f1fa1(_0x3a5cb3);});}else{return db['UserProfileResource'][_0x4532('0x47')]({'where':{'sectionId':_0x4f079d['id']},'raw':!![]})['then'](function(_0x160a22){_0x160a22['forEach'](function(_0x15428f){_0x3a5cb3[_0x4532('0x60')](_0x15428f[_0x4532('0x6a')]+0x15b38);});_0x5f1fa1(_0x3a5cb3);});}}catch(_0xd234bf){_0x3e8dd5(_0xd234bf);}});}exports[_0x4532('0x6c')]=function(_0x99967,_0x198ce9){return db[_0x4532('0x33')]['find']({'where':{'id':_0x99967[_0x4532('0x4a')]['id']}})[_0x4532('0x2a')](handleEntityNotFound(_0x198ce9,null))[_0x4532('0x2a')](function(_0x15e45f){if(_0x15e45f){return db[_0x4532('0x55')][_0x4532('0x56')](function(_0x912200){return db[_0x4532('0x57')]['findAll']({'where':{'userProfileId':_0x99967[_0x4532('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0x4532('0x2a')](function(_0x1ad1e2){if(_0x1ad1e2){return db['UserProfileSection'][_0x4532('0x2b')]({'where':{'userProfileId':_0x99967[_0x4532('0x4a')]['id'],'id':_[_0x4532('0x32')](_0x1ad1e2,function(_0x39339c){return _0x39339c['id'];})},'transaction':_0x912200});}})[_0x4532('0x2a')](function(_0x3d6974){var _0x5e83f3=_[_0x4532('0x32')](_0x99967[_0x4532('0x54')],function(_0xdf35af){_0xdf35af[_0x4532('0x5c')]=_0x99967[_0x4532('0x4a')]['id'];return _0xdf35af;});return db[_0x4532('0x57')][_0x4532('0x6d')](_0x5e83f3,{'raw':!![],'transaction':_0x912200});})[_0x4532('0x2a')](function(_0x580926){var _0x1995fa=_[_0x4532('0x41')](_['map'](_0x580926,function(_0x1fb527){return _0x1fb527['get']({'plain':!![]});}),{'includeAll':![]});if(_0x1995fa){return db[_0x4532('0x57')]['findAll']({'where':{'userProfileId':_0x99967[_0x4532('0x4a')]['id'],'sectionId':_[_0x4532('0x32')](_0x1995fa,function(_0x2457ce){return _0x2457ce[_0x4532('0x5b')];})},'attributes':['id',_0x4532('0x5b')],'raw':!![]})[_0x4532('0x2a')](function(_0x29a4fc){var _0x458f4e=_[_0x4532('0x32')](_0x99967['body'],function(_0x1a759c){_0x1a759c[_0x4532('0x5c')]=_0x99967[_0x4532('0x4a')]['id'];return _0x1a759c;});return db[_0x4532('0x5a')][_0x4532('0x6d')](_0x458f4e,{'raw':!![],'transaction':_0x912200});});}})[_0x4532('0x48')](handleError(_0x198ce9,null));});}})['then'](function(_0x260cb0){var _0x2e6744=_[_0x4532('0x32')](_0x260cb0,function(_0x33523a){return _0x33523a[_0x4532('0x4f')]({'plain':!![]});});})[_0x4532('0x2a')](respondWithResult(_0x198ce9,null))['catch'](handleError(_0x198ce9,null));};exports[_0x4532('0x6e')]=function(_0x4a4542,_0x1e6a1d,_0x7c6011){return db[_0x4532('0x33')][_0x4532('0x4c')]({'where':{'id':_0x4a4542[_0x4532('0x4a')]['id']}})[_0x4532('0x2a')](handleEntityNotFound(_0x1e6a1d,null))[_0x4532('0x2a')](function(_0x4da3a7){if(_0x4da3a7){return _0x4da3a7['removeResources'](_0x4a4542[_0x4532('0x37')][_0x4532('0x6f')]);}})[_0x4532('0x2a')](respondWithStatusCode(_0x1e6a1d,null))['catch'](handleError(_0x1e6a1d,null));};exports[_0x4532('0x70')]=function(_0x1954f2,_0x1d3421){var _0x3faa71={};if(!_0x1954f2['query']['section'])throw new Error(_0x4532('0x71'));if(!_0x1954f2[_0x4532('0x37')][_0x4532('0x72')](_0x4532('0x3e'))){_0x3faa71[_0x4532('0x25')]=qs[_0x4532('0x25')](_0x1954f2['query'][_0x4532('0x25')]);_0x3faa71[_0x4532('0x22')]=qs[_0x4532('0x22')](_0x1954f2[_0x4532('0x37')][_0x4532('0x22')]);}return db[_0x4532('0x33')]['find']({'where':{'id':_0x1954f2[_0x4532('0x4a')]['id']}})['then'](function(_0x48a685){if(!_0x48a685)throw new Error(_0x4532('0x73')+_0x1954f2[_0x4532('0x4a')]['id']);return db['UserProfile'][_0x4532('0x70')](_0x1954f2);})[_0x4532('0x2a')](respondWithFilteredResult(_0x1d3421,_0x3faa71))[_0x4532('0x48')](handleError(_0x1d3421,null));}; \ No newline at end of file +var _0xadb5=['key','keys','query','filters','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','show','params','intersection','find','create','clone','get','omit','updatedAt','body','createdAt','sequelize','UserProfileSection','each','autoAssociation','UserProfileResource','catch','userProfileId','Resources','describe','addSections','transaction','sectionId','push','removeSections','getSections','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','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','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./userProfile.socket','register','status','end','json','undefined','offset','count','Content-Range','apply','reject','update','then','destroy','sendStatus','name','send','index','map','UserProfile','rawAttributes','fieldName'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0xadb5,0xad));var _0x5adb=function(_0x1ff11a,_0x40a8fa){_0x1ff11a=_0x1ff11a-0x0;var _0x2f2027=_0xadb5[_0x1ff11a];return _0x2f2027;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];config[_0x5adb('0x18')]=_['defaults'](config[_0x5adb('0x18')],{'host':_0x5adb('0x19'),'port':0x18eb});var socket=require(_0x5adb('0x1a'))(new Redis(config['redis']));require(_0x5adb('0x1b'))[_0x5adb('0x1c')](socket);function respondWithStatusCode(_0xf82f72,_0x5263ec){_0x5263ec=_0x5263ec||0xcc;return function(_0x2312de){if(_0x2312de){return _0xf82f72['sendStatus'](_0x5263ec);}return _0xf82f72[_0x5adb('0x1d')](_0x5263ec)[_0x5adb('0x1e')]();};}function respondWithResult(_0x30614e,_0x304784){_0x304784=_0x304784||0xc8;return function(_0x1c0f97){if(_0x1c0f97){return _0x30614e[_0x5adb('0x1d')](_0x304784)[_0x5adb('0x1f')](_0x1c0f97);}};}function respondWithFilteredResult(_0x42f4c6,_0xb953a6){return function(_0x529b65){if(_0x529b65){var _0x3fff62=typeof _0xb953a6['offset']===_0x5adb('0x20')&&typeof _0xb953a6['limit']===_0x5adb('0x20');var _0x50e84f=_0x529b65['count'];var _0x1fbaa5=_0x3fff62?0x0:_0xb953a6[_0x5adb('0x21')];var _0x438671=_0x3fff62?_0x529b65[_0x5adb('0x22')]:_0xb953a6[_0x5adb('0x21')]+_0xb953a6['limit'];var _0x3255b3;if(_0x438671>=_0x50e84f){_0x438671=_0x50e84f;_0x3255b3=0xc8;}else{_0x3255b3=0xce;}_0x42f4c6['status'](_0x3255b3);return _0x42f4c6['set'](_0x5adb('0x23'),_0x1fbaa5+'-'+_0x438671+'/'+_0x50e84f)[_0x5adb('0x1f')](_0x529b65);}return null;};}function patchUpdates(_0x1a38d3){return function(_0x1a8014){try{jsonpatch[_0x5adb('0x24')](_0x1a8014,_0x1a38d3,!![]);}catch(_0x413911){return BPromise[_0x5adb('0x25')](_0x413911);}return _0x1a8014['save']();};}function saveUpdates(_0x4b1957,_0x373cc3){return function(_0x3220cd){if(_0x3220cd){return _0x3220cd[_0x5adb('0x26')](_0x4b1957)[_0x5adb('0x27')](function(_0x49f203){return _0x49f203;});}return null;};}function removeEntity(_0x2fee18,_0x2e1e63){return function(_0x5aed76){if(_0x5aed76){return _0x5aed76[_0x5adb('0x28')]()[_0x5adb('0x27')](function(){_0x2fee18[_0x5adb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13ad1d,_0xbe21b1){return function(_0x3a4fca){if(!_0x3a4fca){_0x13ad1d[_0x5adb('0x29')](0x194);}return _0x3a4fca;};}function handleError(_0x36459b,_0x1c06c4){_0x1c06c4=_0x1c06c4||0x1f4;return function(_0x4a5d46){logger['error'](_0x4a5d46['stack']);if(_0x4a5d46[_0x5adb('0x2a')]){delete _0x4a5d46[_0x5adb('0x2a')];}_0x36459b[_0x5adb('0x1d')](_0x1c06c4)[_0x5adb('0x2b')](_0x4a5d46);};}exports[_0x5adb('0x2c')]=function(_0x4de310,_0x11ec2a){var _0x34b793={},_0x372da1={},_0x3b1fed={'count':0x0,'rows':[]};var _0x450169=_[_0x5adb('0x2d')](db[_0x5adb('0x2e')][_0x5adb('0x2f')],function(_0x138bf6){return{'name':_0x138bf6[_0x5adb('0x30')],'type':_0x138bf6['type'][_0x5adb('0x31')]};});_0x372da1['model']=_[_0x5adb('0x2d')](_0x450169,_0x5adb('0x2a'));_0x372da1['query']=_[_0x5adb('0x32')](_0x4de310[_0x5adb('0x33')]);_0x372da1[_0x5adb('0x34')]=_['intersection'](_0x372da1[_0x5adb('0x35')],_0x372da1[_0x5adb('0x33')]);_0x34b793['attributes']=_['intersection'](_0x372da1[_0x5adb('0x35')],qs['fields'](_0x4de310[_0x5adb('0x33')][_0x5adb('0x36')]));_0x34b793[_0x5adb('0x37')]=_0x34b793[_0x5adb('0x37')][_0x5adb('0x38')]?_0x34b793['attributes']:_0x372da1[_0x5adb('0x35')];if(!_0x4de310[_0x5adb('0x33')][_0x5adb('0x39')]('nolimit')){_0x34b793['limit']=qs[_0x5adb('0x3a')](_0x4de310[_0x5adb('0x33')]['limit']);_0x34b793[_0x5adb('0x21')]=qs['offset'](_0x4de310[_0x5adb('0x33')]['offset']);}_0x34b793[_0x5adb('0x3b')]=qs['sort'](_0x4de310[_0x5adb('0x33')][_0x5adb('0x3c')]);_0x34b793['where']=qs[_0x5adb('0x34')](_['pick'](_0x4de310[_0x5adb('0x33')],_0x372da1[_0x5adb('0x34')]),_0x450169);if(_0x4de310[_0x5adb('0x33')]['filter']){_0x34b793[_0x5adb('0x3d')]=_[_0x5adb('0x3e')](_0x34b793[_0x5adb('0x3d')],{'$or':_[_0x5adb('0x2d')](_0x450169,function(_0x22aa95){if(_0x22aa95['type']!=='VIRTUAL'){var _0x4f491a={};_0x4f491a[_0x22aa95['name']]={'$like':'%'+_0x4de310[_0x5adb('0x33')][_0x5adb('0x3f')]+'%'};return _0x4f491a;}})});}_0x34b793=_[_0x5adb('0x3e')]({},_0x34b793,_0x4de310[_0x5adb('0x40')]);var _0x130e18={'where':_0x34b793[_0x5adb('0x3d')]};return db[_0x5adb('0x2e')][_0x5adb('0x22')](_0x130e18)['then'](function(_0x53f2c6){_0x3b1fed[_0x5adb('0x22')]=_0x53f2c6;if(_0x4de310['query'][_0x5adb('0x41')]){_0x34b793[_0x5adb('0x42')]=[{'all':!![]}];}return db[_0x5adb('0x2e')][_0x5adb('0x43')](_0x34b793);})[_0x5adb('0x27')](function(_0x522ee5){_0x3b1fed[_0x5adb('0x44')]=_0x522ee5;return _0x3b1fed;})[_0x5adb('0x27')](respondWithFilteredResult(_0x11ec2a,_0x34b793))['catch'](handleError(_0x11ec2a,null));};exports[_0x5adb('0x45')]=function(_0x1a256c,_0x5833c8){var _0x120497={'raw':![],'where':{'id':_0x1a256c[_0x5adb('0x46')]['id']}},_0x407a4c={};_0x407a4c[_0x5adb('0x35')]=_[_0x5adb('0x32')](db[_0x5adb('0x2e')][_0x5adb('0x2f')]);_0x407a4c['query']=_['keys'](_0x1a256c[_0x5adb('0x33')]);_0x407a4c[_0x5adb('0x34')]=_[_0x5adb('0x47')](_0x407a4c[_0x5adb('0x35')],_0x407a4c['query']);_0x120497['attributes']=_[_0x5adb('0x47')](_0x407a4c[_0x5adb('0x35')],qs[_0x5adb('0x36')](_0x1a256c[_0x5adb('0x33')][_0x5adb('0x36')]));_0x120497['attributes']=_0x120497[_0x5adb('0x37')][_0x5adb('0x38')]?_0x120497['attributes']:_0x407a4c[_0x5adb('0x35')];if(_0x1a256c[_0x5adb('0x33')][_0x5adb('0x41')]){_0x120497[_0x5adb('0x42')]=[{'all':!![]}];}_0x120497=_[_0x5adb('0x3e')]({},_0x120497,_0x1a256c[_0x5adb('0x40')]);return db[_0x5adb('0x2e')][_0x5adb('0x48')](_0x120497)['then'](handleEntityNotFound(_0x5833c8,null))[_0x5adb('0x27')](respondWithResult(_0x5833c8,null))['catch'](handleError(_0x5833c8,null));};exports['create']=function(_0x5015ee,_0x3cd211){return db[_0x5adb('0x2e')][_0x5adb('0x49')](_0x5015ee['body'],{})[_0x5adb('0x27')](respondWithResult(_0x3cd211,0xc9))['catch'](handleError(_0x3cd211,null));};exports[_0x5adb('0x4a')]=function(_0x2c3f21,_0x3f9dc7){var _0x541537={'where':{'id':_0x2c3f21['params']['id']}},_0x27ddc4={};_0x27ddc4[_0x5adb('0x35')]=_[_0x5adb('0x32')](db['UserProfile'][_0x5adb('0x2f')]);_0x541537[_0x5adb('0x37')]=_[_0x5adb('0x47')](_0x27ddc4[_0x5adb('0x35')],qs[_0x5adb('0x36')](_0x2c3f21['query'][_0x5adb('0x36')]));_0x541537[_0x5adb('0x37')]=_0x541537[_0x5adb('0x37')][_0x5adb('0x38')]?_0x541537['attributes']:_0x27ddc4[_0x5adb('0x35')];if(_0x2c3f21[_0x5adb('0x33')][_0x5adb('0x41')]){_0x541537['include']=[{'all':!![]}];}_0x541537=_[_0x5adb('0x3e')]({},_0x541537,_0x2c3f21[_0x5adb('0x40')]);return db[_0x5adb('0x2e')][_0x5adb('0x48')](_0x541537)['then'](handleEntityNotFound(_0x3f9dc7,null))[_0x5adb('0x27')](function(_0x91775c){if(_0x91775c){var _0x28b291=_0x91775c[_0x5adb('0x4b')]({'plain':!![]});_0x28b291=qs[_0x5adb('0x4c')](_0x28b291,['id','createdAt',_0x5adb('0x4d'),'crudPermissions']);_0x2c3f21[_0x5adb('0x4e')]=_['omit'](_0x2c3f21[_0x5adb('0x4e')],['id',_0x5adb('0x4f'),_0x5adb('0x4d')]);return db[_0x5adb('0x50')]['transaction'](function(_0x18f95c){return db[_0x5adb('0x2e')][_0x5adb('0x49')](_['merge'](_0x28b291,_0x2c3f21['body']),{'include':_0x2c3f21['query'][_0x5adb('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x18f95c})[_0x5adb('0x27')](function(_0xa5ecc0){var _0x12a146=_0xa5ecc0[_0x5adb('0x4b')]({'plain':!![]});return db[_0x5adb('0x51')][_0x5adb('0x43')]({'where':{'userProfileId':_0x2c3f21[_0x5adb('0x46')]['id']},'raw':!![]})[_0x5adb('0x27')](function(_0x380d76){if(_0x380d76){return BPromise[_0x5adb('0x52')](_0x380d76,function(_0x1df439){return new BPromise(function(_0x2c2357,_0x511746){if(_0x1df439['autoAssociation']===null||_0x1df439[_0x5adb('0x53')]===0x1)_0x2c2357(null);return db[_0x5adb('0x54')][_0x5adb('0x43')]({'where':{'sectionId':_0x1df439['id']},'raw':!![]})[_0x5adb('0x27')](function(_0x5d7a9f){var _0xfba0d5=_[_0x5adb('0x2d')](_0x5d7a9f,function(_0x5d2d2f){return qs[_0x5adb('0x4c')](_0x5d2d2f,['id',_0x5adb('0x4f'),_0x5adb('0x4d'),'sectionId']);});_0x2c2357(_0xfba0d5);})[_0x5adb('0x55')](function(_0x409357){_0x511746(_0x409357);});})[_0x5adb('0x27')](function(_0x30c92c){var _0x330290=qs[_0x5adb('0x4c')](_0x1df439,['id','createdAt',_0x5adb('0x4d')]);_0x330290[_0x5adb('0x56')]=_0x12a146['id'];if(_0x30c92c)_0x330290[_0x5adb('0x57')]=_0x30c92c;return _0x330290;})['then'](function(_0xcd71d2){return db[_0x5adb('0x51')][_0x5adb('0x49')](_0xcd71d2,{'include':[{'model':db['UserProfileResource'],'as':_0x5adb('0x57')}],'raw':!![],'transaction':_0x18f95c});});})['then'](function(){return _0x12a146;});}});});});}})[_0x5adb('0x27')](respondWithResult(_0x3f9dc7,0xc9))[_0x5adb('0x55')](handleError(_0x3f9dc7,null));};exports[_0x5adb('0x26')]=function(_0x57f0a4,_0x192b1f){if(_0x57f0a4[_0x5adb('0x4e')]['id']){delete _0x57f0a4['body']['id'];}return db[_0x5adb('0x2e')][_0x5adb('0x48')]({'where':{'id':_0x57f0a4[_0x5adb('0x46')]['id']}})[_0x5adb('0x27')](handleEntityNotFound(_0x192b1f,null))['then'](saveUpdates(_0x57f0a4[_0x5adb('0x4e')],null))[_0x5adb('0x27')](respondWithResult(_0x192b1f,null))[_0x5adb('0x55')](handleError(_0x192b1f,null));};exports[_0x5adb('0x28')]=function(_0x5b7556,_0x53a4bc){return db[_0x5adb('0x2e')]['find']({'where':{'id':_0x5b7556['params']['id']}})['then'](handleEntityNotFound(_0x53a4bc,null))[_0x5adb('0x27')](removeEntity(_0x53a4bc,null))[_0x5adb('0x55')](handleError(_0x53a4bc,null));};exports['describe']=function(_0x395350,_0x91e023){return db[_0x5adb('0x2e')][_0x5adb('0x58')]()[_0x5adb('0x27')](respondWithResult(_0x91e023,null))[_0x5adb('0x55')](handleError(_0x91e023,null));};exports[_0x5adb('0x59')]=function(_0x1ffcd3,_0x5240c1){var _0x4b9e80=_0x1ffcd3['body'];return db[_0x5adb('0x2e')][_0x5adb('0x48')]({'where':{'id':_0x1ffcd3[_0x5adb('0x46')]['id']}})[_0x5adb('0x27')](handleEntityNotFound(_0x5240c1,null))[_0x5adb('0x27')](function(_0x2f6ef7){if(_0x2f6ef7){return db[_0x5adb('0x50')][_0x5adb('0x5a')](function(_0x58455b){return db['UserProfileSection'][_0x5adb('0x28')]({'where':{'userProfileId':_0x1ffcd3[_0x5adb('0x46')]['id'],'sectionId':_[_0x5adb('0x2d')](_0x4b9e80,function(_0x3d78e3){return _0x3d78e3[_0x5adb('0x5b')];})},'transaction':_0x58455b})[_0x5adb('0x27')](function(){var _0x40140f=_[_0x5adb('0x2d')](_0x4b9e80,function(_0x338aee){_0x338aee[_0x5adb('0x56')]=_0x1ffcd3['params']['id'];return _0x338aee;});var _0xedde86=[];return BPromise[_0x5adb('0x52')](_0x40140f,function(_0x25ac26){return db['UserProfileSection'][_0x5adb('0x49')](_0x25ac26,{'include':[{'model':db[_0x5adb('0x54')],'as':'Resources'}],'raw':!![],'transaction':_0x58455b})[_0x5adb('0x27')](function(_0x494526){_0xedde86[_0x5adb('0x5c')](_0x494526[_0x5adb('0x4b')]({'plain':!![]}));});})['then'](function(){return _0xedde86;});});});}})[_0x5adb('0x27')](function(_0x1ceb72){return _0x1ceb72;})[_0x5adb('0x27')](respondWithResult(_0x5240c1,null))[_0x5adb('0x55')](handleError(_0x5240c1,null));};exports[_0x5adb('0x5d')]=function(_0x10f54a,_0x3cee6c){var _0xad8e0c;return db['UserProfile'][_0x5adb('0x48')]({'where':{'id':_0x10f54a[_0x5adb('0x46')]['id']},'attributes':['id',_0x5adb('0x2a')]})['then'](handleEntityNotFound(_0x3cee6c,null))['then'](function(_0x9eb9b6){if(_0x9eb9b6){_0xad8e0c=_0x9eb9b6;return db['UserProfileSection'][_0x5adb('0x28')]({'where':{'userProfileId':_0x10f54a[_0x5adb('0x46')]['id'],'sectionId':_0x10f54a[_0x5adb('0x33')]['ids']}});}})[_0x5adb('0x27')](function(){return _0xad8e0c;})[_0x5adb('0x27')](respondWithStatusCode(_0x3cee6c,null))[_0x5adb('0x55')](handleError(_0x3cee6c,null));};exports[_0x5adb('0x5e')]=function(_0x3ed654,_0x56b914){var _0x2a3084=[];var _0x4755fb=[];return db[_0x5adb('0x51')][_0x5adb('0x43')]({'where':{'userProfileId':_0x3ed654['params']['id']},'raw':!![]})[_0x5adb('0x27')](function(_0x17194f){_0x2a3084=_[_0x5adb('0x3f')](_0x17194f,function(_0x1e9cd1){return _0x1e9cd1[_0x5adb('0x5f')]===0x1||_[_0x5adb('0x60')]([0x3eb,0x709],_0x1e9cd1[_0x5adb('0x5b')]);});if(!_['isEmpty'](_0x2a3084)){return _[_0x5adb('0x2d')](_0x2a3084,function(_0x453031){return _0x453031['sectionId'];});}else{return;}})[_0x5adb('0x27')](function(_0x2f8468){if(_0x2f8468)_0x4755fb=_0x2f8468;if(_['includes'](_0x4755fb,0x64)){var _0x462fa0=_['find'](_0x2a3084,{'sectionId':0x64});return hasDefaultDashboard(_0x462fa0)[_0x5adb('0x27')](function(_0x268df2){return _['map'](_0x2a3084,function(_0x167432){if(_0x167432['sectionId']===0x64){_0x167432[_0x5adb('0x61')]=_0x268df2;}return _0x167432;});});}else{return;}})[_0x5adb('0x27')](function(_0x36ba02){if(_0x36ba02)_0x2a3084=_0x36ba02;if(_[_0x5adb('0x60')](_0x4755fb,0x3eb)){var _0x159b20=_['find'](_0x2a3084,{'sectionId':0x3eb});return getCustomDashboards(_0x159b20)[_0x5adb('0x27')](function(_0x337577){return _[_0x5adb('0x2d')](_0x2a3084,function(_0x1c8988){if(_0x159b20['enabled']){if(_0x1c8988['sectionId']===0x3eb){_0x1c8988[_0x5adb('0x61')]=_0x337577;}}else{if(_0x1c8988[_0x5adb('0x5b')]===0x64){_0x1c8988[_0x5adb('0x61')]=_0x337577;}}return _0x1c8988;});});}else{return;}})[_0x5adb('0x27')](function(_0x277668){if(_0x277668)_0x2a3084=_0x277668;if(_[_0x5adb('0x60')](_0x4755fb,0x709)){var _0x31f5b2=_['find'](_0x2a3084,{'sectionId':0x709});return getPlugins(_0x31f5b2)[_0x5adb('0x27')](function(_0x14bada){if(_0x31f5b2[_0x5adb('0x5f')]){return _[_0x5adb('0x2d')](_0x2a3084,function(_0x55a9e8){if(_0x55a9e8[_0x5adb('0x5b')]===0x709){_0x55a9e8[_0x5adb('0x61')]=_0x14bada;}return _0x55a9e8;});}else{var _0x243016={'sectionId':0x76c,'enabled':0x1,'subsections':_0x14bada};var _0x73e76a=_[_0x5adb('0x2d')](_0x2a3084);_0x73e76a[_0x5adb('0x5c')](_0x243016);return _0x73e76a;}});}else{return;}})[_0x5adb('0x27')](function(_0x2d1b65){if(_0x2d1b65)_0x2a3084=_0x2d1b65;return _[_0x5adb('0x3f')](_0x2a3084,['enabled',0x1]);})[_0x5adb('0x27')](respondWithResult(_0x56b914,null))[_0x5adb('0x55')](handleError(_0x56b914,null));};function hasDefaultDashboard(_0x5c55ee){var _0x44d50f=[0x65];return new BPromise(function(_0x290a7b,_0x2b8915){try{if(_0x5c55ee[_0x5adb('0x53')]){_0x290a7b(_0x44d50f);}else{return db[_0x5adb('0x54')][_0x5adb('0x62')]({'where':{'sectionId':_0x5c55ee['id']},'raw':!![]})[_0x5adb('0x27')](function(_0x350bb1){_0x350bb1?_0x290a7b(_0x44d50f):_0x290a7b();});}}catch(_0x57f557){_0x2b8915(_0x57f557);}});}function getCustomDashboards(_0x11d9ce){var _0x2386c0=[];return new BPromise(function(_0x4ed4b1,_0x30b98c){try{if(_0x11d9ce[_0x5adb('0x53')]){return db[_0x5adb('0x63')]['findAll']({'raw':!![]})['then'](function(_0x2d7a9f){_0x2d7a9f[_0x5adb('0x64')](function(_0x3f5596){_0x2386c0['push'](_0x3f5596['id']+0x1869f);});_0x4ed4b1(_0x2386c0);});}else{return db[_0x5adb('0x54')][_0x5adb('0x43')]({'where':{'sectionId':_0x11d9ce['id']},'raw':!![]})[_0x5adb('0x27')](function(_0x1284d9){_0x1284d9[_0x5adb('0x64')](function(_0x743986){_0x2386c0[_0x5adb('0x5c')](_0x743986[_0x5adb('0x65')]+0x1869f);});_0x4ed4b1(_0x2386c0);});}}catch(_0x28bd33){_0x30b98c(_0x28bd33);}});}function getPlugins(_0x3e8a17){var _0x423b80=[];return new BPromise(function(_0x1509e0,_0x487b33){try{if(_0x3e8a17['autoAssociation']){return db[_0x5adb('0x66')][_0x5adb('0x43')]({'raw':!![]})['then'](function(_0x3f6975){_0x3f6975[_0x5adb('0x64')](function(_0x38acde){_0x423b80[_0x5adb('0x5c')](_0x38acde['id']+0x15b38);});_0x1509e0(_0x423b80);});}else{return db[_0x5adb('0x54')][_0x5adb('0x43')]({'where':{'sectionId':_0x3e8a17['id']},'raw':!![]})[_0x5adb('0x27')](function(_0x327ac6){_0x327ac6[_0x5adb('0x64')](function(_0x5374cc){_0x423b80[_0x5adb('0x5c')](_0x5374cc[_0x5adb('0x65')]+0x15b38);});_0x1509e0(_0x423b80);});}}catch(_0x273785){_0x487b33(_0x273785);}});}exports['addResources']=function(_0x312a90,_0x284f79){return db[_0x5adb('0x2e')][_0x5adb('0x48')]({'where':{'id':_0x312a90[_0x5adb('0x46')]['id']}})[_0x5adb('0x27')](handleEntityNotFound(_0x284f79,null))['then'](function(_0x13a4aa){if(_0x13a4aa){return db[_0x5adb('0x50')][_0x5adb('0x5a')](function(_0x1e5532){return db[_0x5adb('0x51')][_0x5adb('0x43')]({'where':{'userProfileId':_0x312a90[_0x5adb('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0x5adb('0x27')](function(_0x24664c){if(_0x24664c){return db[_0x5adb('0x51')]['destroy']({'where':{'userProfileId':_0x312a90[_0x5adb('0x46')]['id'],'id':_['map'](_0x24664c,function(_0x3343fc){return _0x3343fc['id'];})},'transaction':_0x1e5532});}})[_0x5adb('0x27')](function(_0xb32438){var _0x193a29=_[_0x5adb('0x2d')](_0x312a90['body'],function(_0x5b0fe2){_0x5b0fe2[_0x5adb('0x56')]=_0x312a90[_0x5adb('0x46')]['id'];return _0x5b0fe2;});return db[_0x5adb('0x51')][_0x5adb('0x67')](_0x193a29,{'raw':!![],'transaction':_0x1e5532});})[_0x5adb('0x27')](function(_0x162b9a){var _0x55dfac=_['filter'](_[_0x5adb('0x2d')](_0x162b9a,function(_0xd5b95d){return _0xd5b95d[_0x5adb('0x4b')]({'plain':!![]});}),{'includeAll':![]});if(_0x55dfac){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x312a90[_0x5adb('0x46')]['id'],'sectionId':_['map'](_0x55dfac,function(_0x448d4f){return _0x448d4f[_0x5adb('0x5b')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x43b91c){var _0x4bb198=_['map'](_0x312a90[_0x5adb('0x4e')],function(_0x1537a9){_0x1537a9[_0x5adb('0x56')]=_0x312a90[_0x5adb('0x46')]['id'];return _0x1537a9;});return db[_0x5adb('0x54')][_0x5adb('0x67')](_0x4bb198,{'raw':!![],'transaction':_0x1e5532});});}})[_0x5adb('0x55')](handleError(_0x284f79,null));});}})[_0x5adb('0x27')](function(_0x9e318b){var _0x31b696=_[_0x5adb('0x2d')](_0x9e318b,function(_0x1196f5){return _0x1196f5[_0x5adb('0x4b')]({'plain':!![]});});})['then'](respondWithResult(_0x284f79,null))[_0x5adb('0x55')](handleError(_0x284f79,null));};exports['removeResources']=function(_0x409910,_0x4c7163,_0x280f30){return db[_0x5adb('0x2e')][_0x5adb('0x48')]({'where':{'id':_0x409910[_0x5adb('0x46')]['id']}})[_0x5adb('0x27')](handleEntityNotFound(_0x4c7163,null))[_0x5adb('0x27')](function(_0x2ebfad){if(_0x2ebfad){return _0x2ebfad[_0x5adb('0x68')](_0x409910[_0x5adb('0x33')][_0x5adb('0x69')]);}})['then'](respondWithStatusCode(_0x4c7163,null))[_0x5adb('0x55')](handleError(_0x4c7163,null));};exports[_0x5adb('0x6a')]=function(_0x21d4ff,_0x8cf8c7){var _0x1da6bc={};if(!_0x21d4ff[_0x5adb('0x33')][_0x5adb('0x6b')])throw new Error(_0x5adb('0x6c'));if(!_0x21d4ff['query'][_0x5adb('0x39')](_0x5adb('0x6d'))){_0x1da6bc[_0x5adb('0x3a')]=qs['limit'](_0x21d4ff[_0x5adb('0x33')]['limit']);_0x1da6bc[_0x5adb('0x21')]=qs['offset'](_0x21d4ff['query'][_0x5adb('0x21')]);}return db[_0x5adb('0x2e')][_0x5adb('0x48')]({'where':{'id':_0x21d4ff[_0x5adb('0x46')]['id']}})[_0x5adb('0x27')](function(_0xcd014e){if(!_0xcd014e)throw new Error(_0x5adb('0x6e')+_0x21d4ff[_0x5adb('0x46')]['id']);return db[_0x5adb('0x2e')][_0x5adb('0x6a')](_0x21d4ff);})[_0x5adb('0x27')](respondWithFilteredResult(_0x8cf8c7,_0x1da6bc))[_0x5adb('0x55')](handleError(_0x8cf8c7,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 32e9dd8..115c649 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 _0xe0c1=['exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','hasOwnProperty','hook'];(function(_0x549e70,_0x8a5460){var _0x9a9d8c=function(_0x3408c5){while(--_0x3408c5){_0x549e70['push'](_0x549e70['shift']());}};_0x9a9d8c(++_0x8a5460);}(_0xe0c1,0x10f));var _0x1e0c=function(_0x3403f0,_0x12c857){_0x3403f0=_0x3403f0-0x0;var _0x5ff7b7=_0xe0c1[_0x3403f0];return _0x5ff7b7;};'use strict';var EventEmitter=require(_0x1e0c('0x0'));var UserProfile=require(_0x1e0c('0x1'))['db'][_0x1e0c('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x1e0c('0x3')](0x0);var events={'afterCreate':_0x1e0c('0x4'),'afterUpdate':_0x1e0c('0x5'),'afterDestroy':_0x1e0c('0x6')};function emitEvent(_0x5b2f24){return function(_0x565573,_0x4ad70a,_0x492b78){UserProfileEvents['emit'](_0x5b2f24+':'+_0x565573['id'],_0x565573);UserProfileEvents['emit'](_0x5b2f24,_0x565573);_0x492b78(null);};}for(var e in events){if(events[_0x1e0c('0x7')](e)){var event=events[e];UserProfile[_0x1e0c('0x8')](e,emitEvent(event));}}module[_0x1e0c('0x9')]=UserProfileEvents; \ No newline at end of file +var _0xac6a=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','remove'];(function(_0x11afd1,_0x4d62ff){var _0x5e8b34=function(_0x77b8b7){while(--_0x77b8b7){_0x11afd1['push'](_0x11afd1['shift']());}};_0x5e8b34(++_0x4d62ff);}(_0xac6a,0xc2));var _0xaac6=function(_0x35619f,_0xbefb1f){_0x35619f=_0x35619f-0x0;var _0x514689=_0xac6a[_0x35619f];return _0x514689;};'use strict';var EventEmitter=require(_0xaac6('0x0'));var UserProfile=require(_0xaac6('0x1'))['db'][_0xaac6('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xaac6('0x3')](0x0);var events={'afterCreate':_0xaac6('0x4'),'afterUpdate':'update','afterDestroy':_0xaac6('0x5')};function emitEvent(_0x4c0cf4){return function(_0x9dc043,_0x1a0d76,_0x44259b){UserProfileEvents[_0xaac6('0x6')](_0x4c0cf4+':'+_0x9dc043['id'],_0x9dc043);UserProfileEvents[_0xaac6('0x6')](_0x4c0cf4,_0x9dc043);_0x44259b(null);};}for(var e in events){if(events[_0xaac6('0x7')](e)){var event=events[e];UserProfile[_0xaac6('0x8')](e,emitEvent(event));}}module[_0xaac6('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 9812be0..d0d06f8 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 _0xf072=['SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','pauses','scheduler','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.','ui.createdAt','ui.UserId\x20=\x20?','query','toString','define','UserProfile','section','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','params','all','ignore','union','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','merge','key','find','foreignKey','forEach','options','includeAll','include','reportType','default','custom','CustomReports','count','rows','Tags','tag','color','openTabs','chat','sms','dataValues','mail','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','name','resolve','UserProfileResource','type','resourceId','toLowerCase','childModel','SquareProject','SquareOdbc','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','membername','agent','User','role','telephone','VoiceQueue','inbound','queue','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','VoiceQueues','telephones','admin','user','Telephones','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts'];(function(_0x1632d0,_0x10bded){var _0x24856a=function(_0x137894){while(--_0x137894){_0x1632d0['push'](_0x1632d0['shift']());}};_0x24856a(++_0x10bded);}(_0xf072,0x1cf));var _0x2f07=function(_0x255573,_0x1590d8){_0x255573=_0x255573-0x0;var _0x112ca6=_0xf072[_0x255573];return _0x112ca6;};'use strict';var _=require(_0x2f07('0x0'));var attributes=require(_0x2f07('0x1'));var qs=require(_0x2f07('0x2'));var squel=require('squel');module[_0x2f07('0x3')]=function(_0x5f20e3){var _0x19cbb9=_0x5f20e3[_0x2f07('0x4')];function _0x1536c3(_0x48d7b6,_0x1d5a33){return new Promise(function(_0x14d6e6,_0x3643bb){if(!_0x1d5a33)return _0x14d6e6(null);var _0x2e6422=_0x1d5a33[_0x2f07('0x5')]?{[_0x1d5a33[_0x2f07('0x5')][_0x2f07('0x6')]]:_0x1d5a33[_0x2f07('0x5')][_0x2f07('0x7')]}:undefined;return _0x19cbb9[_0x48d7b6][_0x2f07('0x8')]({'where':_0x2e6422,'raw':!![]})[_0x2f07('0x9')](function(_0x2e372c){_0x1d5a33[_0x2f07('0xa')]=_[_0x2f07('0xb')](_0x2e372c,'id');_0x14d6e6(_0x1d5a33);})[_0x2f07('0xc')](function(_0x564260){_0x3643bb(_0x564260);});});}function _0xdb2783(_0x2f464b,_0x1d0812){return new Promise(function(_0x3525be,_0x496d87){var _0x4e81d9=_0x2f464b[_0x2f07('0x5')]?{[_0x2f464b[_0x2f07('0x5')]['field']]:_0x2f464b[_0x2f07('0x5')][_0x2f07('0x7')]}:undefined;return _0x19cbb9[_0x2f464b[_0x2f07('0xd')]]['findAll']({'where':_0x4e81d9,'raw':!![]})[_0x2f07('0x9')](function(_0x443fdc){_0x1d0812[_0x2f07('0xa')]=_[_0x2f07('0xb')](_0x443fdc,function(_0x254dbb){return _0x254dbb[_0x2f07('0xe')];});_0x3525be(_0x1d0812);})['catch'](function(_0x8475cf){_0x496d87(_0x8475cf);});});}function _0x5a7b5c(_0x2232a4,_0xe8cf4d,_0x1dace4){if(!_0xe8cf4d)return Promise[_0x2f07('0xf')](null);return new Promise(function(_0x1ec70d,_0x46c9b4){return _0x19cbb9[_0x2f07('0x10')][_0x2f07('0x8')]({'where':{'sectionId':_0xe8cf4d['id']},'raw':!![]})['then'](function(_0x15c3dd){if(_0x2232a4['field']&&_0x2232a4[_0x2f07('0x6')]!=='id'){_0xe8cf4d[_0x2f07('0xa')]=_[_0x2f07('0xb')](_0x15c3dd,function(_0xd944d6){return _0xd944d6[_0x2232a4[_0x2f07('0x6')]];});}else{if(_0x1dace4==='AnalyticExtractedReport'){_0xe8cf4d[_0x2f07('0xa')]=_['map'](_0x15c3dd,function(_0x5db56b){return{'id':_0x5db56b['resourceId'],'type':_0x5db56b[_0x2f07('0x11')]};});}else{_0xe8cf4d['associatedResources']=_[_0x2f07('0xb')](_0x15c3dd,function(_0x5e6ac6){return _0x5e6ac6[_0x2f07('0x12')];});}}_0x1ec70d(_0xe8cf4d);})[_0x2f07('0xc')](function(_0x12a2a5){_0x46c9b4(_0x12a2a5);});});}function _0x307888(_0x49521b,_0x31be77){var _0x428d8c={'parentSections':[]};switch(_0x49521b[_0x2f07('0x13')]()){case'squareprojects':_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x15');break;case'odbc':_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x16');break;case'squarerecordings':_0x428d8c[_0x2f07('0x14')]='SquareRecording';_0x428d8c[_0x2f07('0x17')]=[{'name':_0x2f07('0x18'),'field':_0x2f07('0xe'),'foreignKey':_0x2f07('0x19')}];break;case _0x2f07('0x1a'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x1b');break;case _0x2f07('0x1c'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x1d');_0x428d8c[_0x2f07('0x17')]=[{'name':_0x2f07('0x1e'),'field':'id','foreignKey':'ListId'}];break;case _0x2f07('0x1f'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x20');break;case'companies':_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x21');break;case _0x2f07('0x22'):_0x428d8c['childModel']=_0x2f07('0x23');break;case _0x2f07('0x24'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x25');break;case _0x2f07('0x26'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x27');break;case'faxqueues':_0x428d8c[_0x2f07('0x14')]='FaxQueue';break;case _0x2f07('0x28'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x29');break;case _0x2f07('0x2a'):case _0x2f07('0x2b'):case _0x2f07('0x2c'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x2d');break;case _0x2f07('0x2e'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x2f');break;case _0x2f07('0x30'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x31');break;case _0x2f07('0x32'):_0x428d8c[_0x2f07('0x14')]='VoiceRecording';_0x428d8c['parentSections']=[{'name':_0x2f07('0x33'),'field':_0x2f07('0xe'),'foreignKey':_0x2f07('0x34'),'model':'User','filter':{'field':'role','value':[_0x2f07('0x35')]}},{'name':'Telephones','field':_0x2f07('0xe'),'foreignKey':_0x2f07('0x34'),'model':_0x2f07('0x36'),'filter':{'field':_0x2f07('0x37'),'value':[_0x2f07('0x38')]}},{'name':'VoiceQueues','field':_0x2f07('0xe'),'foreignKey':'queue','model':_0x2f07('0x39'),'filter':{'field':'type','value':[_0x2f07('0x3a')]}},{'name':'QueueCampaigns','field':'name','foreignKey':_0x2f07('0x3b'),'model':_0x2f07('0x39'),'filter':{'field':'type','value':[_0x2f07('0x3c')]}}];break;case _0x2f07('0x3d'):_0x428d8c[_0x2f07('0x14')]='VoiceMusicOnHold';break;case _0x2f07('0x3e'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x3f');break;case _0x2f07('0x40'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x41');break;case _0x2f07('0x42'):_0x428d8c[_0x2f07('0x14')]='Campaign';break;case _0x2f07('0x43'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x44');break;case _0x2f07('0x45'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x46');break;case _0x2f07('0x47'):_0x428d8c['childModel']=_0x2f07('0x48');break;case _0x2f07('0x49'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x4a');break;case _0x2f07('0x4b'):_0x428d8c[_0x2f07('0x14')]='OpenchannelAccount';break;case _0x2f07('0x4c'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x4d');break;case _0x2f07('0x4e'):_0x428d8c['childModel']='SmsAccount';break;case _0x2f07('0x4f'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x50');break;case _0x2f07('0x51'):_0x428d8c['childModel']=_0x2f07('0x52');break;case _0x2f07('0x53'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x54');break;case _0x2f07('0x55'):case _0x2f07('0x56'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x39');if(_0x31be77){_0x428d8c[_0x2f07('0x17')]=[{'name':_0x2f07('0x57')},{'name':'QueueCampaigns'}];}break;case'users':case'agents':case _0x2f07('0x58'):_0x428d8c[_0x2f07('0x14')]='User';if(_0x31be77){_0x428d8c[_0x2f07('0x17')]=[{'name':'Users','filter':{'field':_0x2f07('0x37'),'value':[_0x2f07('0x59'),_0x2f07('0x5a')]},'ignore':!![]},{'name':'Agents'},{'name':_0x2f07('0x5b')}];}break;case _0x2f07('0x5c'):_0x428d8c['childModel']='ZendeskAccount';break;case _0x2f07('0x5d'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x5e');break;case _0x2f07('0x5f'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x60');break;case _0x2f07('0x61'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x62');break;case _0x2f07('0x63'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x64');break;case _0x2f07('0x65'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x66');break;case _0x2f07('0x67'):_0x428d8c['childModel']=_0x2f07('0x36');break;case _0x2f07('0x68'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x69');break;case _0x2f07('0x6a'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x6b');break;case _0x2f07('0x6c'):_0x428d8c[_0x2f07('0x14')]='Dashboard';break;case _0x2f07('0x6d'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x6e');break;case _0x2f07('0x6f'):_0x428d8c['childModel']='Pause';break;case _0x2f07('0x70'):_0x428d8c[_0x2f07('0x14')]='Schedule';break;case'sounds':_0x428d8c[_0x2f07('0x14')]='Sound';break;case _0x2f07('0x71'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x72');break;case _0x2f07('0x73'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x74');break;case _0x2f07('0x75'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x76');break;case _0x2f07('0x77'):_0x428d8c['childModel']=_0x2f07('0x78');break;case _0x2f07('0x79'):_0x428d8c[_0x2f07('0x14')]=_0x2f07('0x7a');break;case'plugins':_0x428d8c[_0x2f07('0x14')]='Plugin';break;case'extractedreports':_0x428d8c['childModel']=_0x2f07('0x7b');_0x428d8c[_0x2f07('0x17')]=[{'name':_0x2f07('0x7c'),'field':'id','foreignKey':_0x2f07('0x7d')}];break;case _0x2f07('0x7e'):_0x428d8c['childModel']=_0x2f07('0x7f');break;}return _0x428d8c;}function _0x4084d6(_0x402da6,_0x56e9be){var _0x58cba8=_0x402da6['charAt'](0x0)[_0x2f07('0x80')]()+_0x402da6['slice'](0x1);var _0x198ea6={'type':_0x19cbb9[_0x2f07('0x81')][_0x2f07('0x82')][_0x2f07('0x83')],'raw':!![]};return new Promise(function(_0x3a750f,_0x2b6ff8){var _0x1969be=squel[_0x2f07('0x84')]()[_0x2f07('0x6')](_0x2f07('0x85')+_0x58cba8+'InteractionId','id')['field'](_0x2f07('0x86'))['from']('user_has_'+_0x402da6+'_interactions','ui')['where'](_0x2f07('0x87'),_0x56e9be['id']);return _0x19cbb9['sequelize'][_0x2f07('0x88')](_0x1969be[_0x2f07('0x89')](),_0x198ea6)[_0x2f07('0x9')](function(_0x3549c6){_0x56e9be[_0x58cba8+'OpenTabs']=_0x3549c6;_0x3a750f(_0x3549c6);})[_0x2f07('0xc')](function(_0x18baea){_0x2b6ff8(_0x18baea);});});}return _0x5f20e3[_0x2f07('0x8a')](_0x2f07('0x8b'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x40cb33){var _0x27f4b8={'raw':![],'where':{}};var _0x3aba38={};var _0xee5ef2={'count':0x0,'rows':[]};var _0x5cd113=_0x40cb33[_0x2f07('0x88')][_0x2f07('0x8c')];var _0x939049=_0x40cb33[_0x2f07('0x88')]['mergeResources']||![];var _0x124e68=_0x307888(_0x5cd113,_0x939049);if(!_0x124e68['childModel'])throw new Error(_0x2f07('0x8d')+_0x5cd113+'\x27');var _0x29fc46=[{'name':_0x5cd113}];if(!_[_0x2f07('0x8e')](_0x124e68[_0x2f07('0x17')]))_0x29fc46=_0x124e68['parentSections'];var _0xadb6a3=[];for(var _0x45d2f5=0x0;_0x45d2f5<_0x29fc46['length'];_0x45d2f5++){_0xadb6a3[_0x2f07('0x8f')](_0x19cbb9[_0x2f07('0x90')]['find']({'where':{'userProfileId':_0x40cb33[_0x2f07('0x91')]['id'],'name':_0x29fc46[_0x45d2f5][_0x2f07('0xe')]},'raw':!![]}));}return Promise[_0x2f07('0x92')](_0xadb6a3)['then'](function(_0x56eeab){var _0x434b2c=_[_0x2f07('0x5')](_0x56eeab,function(_0x5bd2e4){return _0x5bd2e4?_0x5bd2e4:undefined;});var _0x312139=_[_0x2f07('0x5')](_0x29fc46,[_0x2f07('0x93'),!![]]);var _0x174eb2=_[_0x2f07('0x8e')](_0x434b2c)&&_[_0x2f07('0x8e')](_0x312139)?null:_[_0x2f07('0x94')](_0x312139,_0x434b2c);if(!_0x174eb2)return null;var _0x314ee4=[];for(var _0x539065=0x0;_0x539065<_0x174eb2['length'];_0x539065++){var _0x5a7883=_['find'](_0x29fc46,function(_0x5433c1){return _0x174eb2[_0x539065]?_0x5433c1['name']===_0x174eb2[_0x539065]['name']:null;});if(_0x5a7883){if(_0x174eb2[_0x539065][_0x2f07('0x93')]){_0x314ee4[_0x2f07('0x8f')](_0x1536c3(_0x124e68[_0x2f07('0x14')],_0x174eb2[_0x539065]));}else{if(!_0x174eb2[_0x539065][_0x2f07('0x95')]){_0x314ee4['push'](_0x5a7b5c(_0x5a7883,_0x174eb2[_0x539065],_0x124e68[_0x2f07('0x14')]));}else{if(_0x5a7883[_0x2f07('0xd')]){_0x314ee4[_0x2f07('0x8f')](_0xdb2783(_0x5a7883,_0x174eb2[_0x539065]));}}}}}return Promise[_0x2f07('0x92')](_0x314ee4);})['then'](function(_0x4a9255){var _0x3dc5ee=_0x4a9255;var _0x5e98e5=null;if(_0x3dc5ee){_0x5e98e5=_0x3dc5ee['length']===0x1?_0x3dc5ee[0x0]:null;}if(!_0x5e98e5&&!_0x3dc5ee)return _0xee5ef2;var _0x5da460=_0x19cbb9[_0x124e68['childModel']][_0x2f07('0x96')];_0x3aba38[_0x2f07('0xd')]=_[_0x2f07('0x97')](_0x5da460);_0x3aba38['query']=_[_0x2f07('0x97')](_0x40cb33[_0x2f07('0x88')]);_0x3aba38[_0x2f07('0x98')]=_[_0x2f07('0x99')](_0x3aba38[_0x2f07('0xd')],_0x3aba38[_0x2f07('0x88')]);_0x27f4b8[_0x2f07('0x9a')]=_[_0x2f07('0x99')](_0x3aba38['model'],qs['fields'](_0x40cb33[_0x2f07('0x88')][_0x2f07('0x9b')]));_0x27f4b8[_0x2f07('0x9a')]=_0x27f4b8[_0x2f07('0x9a')][_0x2f07('0x9c')]?_0x27f4b8[_0x2f07('0x9a')]:_0x3aba38[_0x2f07('0xd')];if(!_0x40cb33[_0x2f07('0x88')][_0x2f07('0x9d')](_0x2f07('0x9e'))){_0x27f4b8[_0x2f07('0x9f')]=qs['limit'](_0x40cb33[_0x2f07('0x88')][_0x2f07('0x9f')]);_0x27f4b8[_0x2f07('0xa0')]=qs[_0x2f07('0xa0')](_0x40cb33[_0x2f07('0x88')]['offset']);}_0x27f4b8[_0x2f07('0xa1')]=qs[_0x2f07('0xa2')](_0x40cb33[_0x2f07('0x88')][_0x2f07('0xa2')]);_0x27f4b8[_0x2f07('0xa3')]=qs[_0x2f07('0x98')](_['pick'](_0x40cb33[_0x2f07('0x88')],_0x3aba38[_0x2f07('0x98')]));if(_0x40cb33['query'][_0x2f07('0x5')]){_0x27f4b8[_0x2f07('0xa3')]=_[_0x2f07('0xa4')](_0x27f4b8['where'],{'$or':_[_0x2f07('0xb')](_0x5da460,function(_0x4393bd){if(_0x4393bd['type'][_0x2f07('0xa5')]!=='VIRTUAL'){var _0x3916c6={};_0x3916c6[_0x4393bd[_0x2f07('0x6')]]={'$like':'%'+_0x40cb33[_0x2f07('0x88')][_0x2f07('0x5')]+'%'};return _0x3916c6;}})});}var _0x3377cf=[];var _0x3a99ce=null;var _0x726065={};if(_0x5e98e5){_0x3a99ce=_[_0x2f07('0xa6')](_0x29fc46,[_0x2f07('0xe'),_0x5e98e5['name']]);if(_0x3a99ce[_0x2f07('0x6')]){_0x726065={};if(_0x124e68[_0x2f07('0x14')]===_0x2f07('0x7b')){_0x726065[_0x3a99ce[_0x2f07('0xa7')]]=_[_0x2f07('0xb')](_0x5e98e5[_0x2f07('0xa')],'id');}else{_0x726065[_0x3a99ce['foreignKey']]=_0x5e98e5['associatedResources'];}_0x3377cf[_0x2f07('0x8f')](_0x726065);}else{_0x27f4b8[_0x2f07('0xa3')]['id']=_0x5e98e5[_0x2f07('0xa')];}}else{for(var _0x191111=0x0;_0x191111<_0x3dc5ee['length'];_0x191111++){_0x3a99ce=_[_0x2f07('0xa6')](_0x29fc46,['name',_0x3dc5ee[_0x191111][_0x2f07('0xe')]]);if(_0x3a99ce['field']){_0x726065={};_0x726065[_0x3a99ce[_0x2f07('0xa7')]]=_0x3dc5ee[_0x191111][_0x2f07('0xa')];_0x3377cf[_0x2f07('0x8f')](_0x726065);}else{if(!_0x27f4b8[_0x2f07('0xa3')]['id'])_0x27f4b8[_0x2f07('0xa3')]['id']=[];_0x3dc5ee[_0x191111][_0x2f07('0xa')][_0x2f07('0xa8')](function(_0x33c74f){_0x27f4b8[_0x2f07('0xa3')]['id'][_0x2f07('0x8f')](_0x33c74f);});}}}if(!_['isEmpty'](_0x3377cf)){_0x27f4b8[_0x2f07('0xa3')]=_['merge'](_0x27f4b8[_0x2f07('0xa3')],{'$and':{'$or':_0x3377cf}});}_0x27f4b8=_[_0x2f07('0xa4')]({},_0x27f4b8,_0x40cb33[_0x2f07('0xa9')]);if(_0x5e98e5&&!_0x5e98e5[_0x2f07('0x95')]&&_0x124e68[_0x2f07('0x14')]==='AnalyticExtractedReport'){if(_0x40cb33[_0x2f07('0x88')][_0x2f07('0xaa')]){_0x27f4b8[_0x2f07('0xab')]=[{'all':!![]}];}return _0x19cbb9[_0x124e68['childModel']]['findAll'](_0x27f4b8)['then'](function(_0x50f150){var _0xeb1e55=[];_0x50f150[_0x2f07('0xa8')](function(_0x172df0){var _0x5d1fca;switch(_0x172df0[_0x2f07('0xac')]){case _0x2f07('0xad'):_0x5d1fca=_[_0x2f07('0xa6')](_0x5e98e5[_0x2f07('0xa')],function(_0x376aa1){return _0x376aa1['id']===_0x172df0[_0x2f07('0x7d')]&&_0x376aa1[_0x2f07('0x11')]==='DefaultReports';});break;case _0x2f07('0xae'):_0x5d1fca=_['find'](_0x5e98e5[_0x2f07('0xa')],function(_0x46c355){return _0x46c355['id']===_0x172df0['reportId']&&_0x46c355['type']===_0x2f07('0xaf');});break;}if(_0x5d1fca)_0xeb1e55[_0x2f07('0x8f')](_0x172df0);});_0xee5ef2[_0x2f07('0xb0')]=_0xeb1e55[_0x2f07('0x9c')];_0xee5ef2[_0x2f07('0xb1')]=_0xeb1e55;return _0xee5ef2;});}else{return _0x19cbb9[_0x124e68[_0x2f07('0x14')]][_0x2f07('0xb0')]({'where':_0x27f4b8['where']})[_0x2f07('0x9')](function(_0x13f509){_0xee5ef2['count']=_0x13f509;if(_0x40cb33['query'][_0x2f07('0xaa')]){if(_0x124e68['childModel']==='CmContact'){_0x27f4b8[_0x2f07('0xab')]=[{'model':_0x19cbb9[_0x2f07('0x72')],'as':_0x2f07('0xb2'),'attributes':['id',_0x2f07('0xe'),'color'],'required':_0x40cb33[_0x2f07('0x88')][_0x2f07('0xb3')]?!![]:![]},{'model':_0x19cbb9[_0x2f07('0x72')],'as':'ThroughTags','attributes':['id',_0x2f07('0xe'),_0x2f07('0xb4')],'through':_0x40cb33[_0x2f07('0x88')]['tag']?{'attributes':[],'where':{'TagId':_0x40cb33['query'][_0x2f07('0xb3')]||undefined}}:{},'required':_0x40cb33[_0x2f07('0x88')][_0x2f07('0xb3')]?!![]:![]}];}else{_0x27f4b8[_0x2f07('0xab')]=[{'all':!![]}];}}return _0x19cbb9[_0x124e68[_0x2f07('0x14')]][_0x2f07('0x8')](_0x27f4b8);})[_0x2f07('0x9')](function(_0x16711f){_0xee5ef2[_0x2f07('0xb1')]=_0x16711f;if(_0x5cd113===_0x2f07('0x33')&&_0x40cb33[_0x2f07('0x88')][_0x2f07('0xb5')]==='true'){var _0x35aa11=[];for(var _0x9b8074=0x0;_0x9b8074<_0xee5ef2[_0x2f07('0xb1')][_0x2f07('0x9c')];_0x9b8074++){_0x35aa11[_0x2f07('0x8f')](_0x4084d6(_0x2f07('0xb6'),_0xee5ef2[_0x2f07('0xb1')][_0x9b8074]['dataValues']));_0x35aa11[_0x2f07('0x8f')](_0x4084d6(_0x2f07('0xb7'),_0xee5ef2[_0x2f07('0xb1')][_0x9b8074][_0x2f07('0xb8')]));_0x35aa11[_0x2f07('0x8f')](_0x4084d6('fax',_0xee5ef2[_0x2f07('0xb1')][_0x9b8074][_0x2f07('0xb8')]));_0x35aa11[_0x2f07('0x8f')](_0x4084d6(_0x2f07('0xb9'),_0xee5ef2[_0x2f07('0xb1')][_0x9b8074][_0x2f07('0xb8')]));_0x35aa11[_0x2f07('0x8f')](_0x4084d6('openchannel',_0xee5ef2[_0x2f07('0xb1')][_0x9b8074][_0x2f07('0xb8')]));_0x35aa11['push'](_0x4084d6(_0x2f07('0xba'),_0xee5ef2['rows'][_0x9b8074][_0x2f07('0xb8')]));}return Promise['all'](_0x35aa11)[_0x2f07('0x9')](function(){return _0xee5ef2;});}return _0xee5ef2;});}});}}});}; \ No newline at end of file +var _0x66fa=['sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','intervals','Interval','Pause','scheduler','Schedule','sounds','tags','Tag','templates','Template','Trigger','trunks','Trunk','variables','plugins','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','UserProfile','user_profiles','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','find','params','all','union','ignore','push','autoAssociation','model','keys','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','where','pick','merge','key','VIRTUAL','foreignKey','options','includeAll','reportType','default','custom','CustomReports','rows','count','include','color','tag','openTabs','chat','dataValues','sms','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','value','then','associatedResources','findAll','map','name','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','odbc','SquareOdbc','squarerecordings','childModel','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','companies','globalcustomfields','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','membername','User','role','agent','Telephones','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','smsqueues','smsaccounts','SmsAccount','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','telephones','Users','user','Agents','ZendeskAccount','salesforceaccounts','FreshdeskAccount'];(function(_0x489981,_0x2b793a){var _0x17a975=function(_0x4a6615){while(--_0x4a6615){_0x489981['push'](_0x489981['shift']());}};_0x17a975(++_0x2b793a);}(_0x66fa,0x117));var _0xa66f=function(_0x522d56,_0x493107){_0x522d56=_0x522d56-0x0;var _0x3ee9a6=_0x66fa[_0x522d56];return _0x3ee9a6;};'use strict';var _=require(_0xa66f('0x0'));var attributes=require(_0xa66f('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0xa66f('0x2'));module[_0xa66f('0x3')]=function(_0x234f2d){var _0x12a38f=_0x234f2d[_0xa66f('0x4')];function _0x2a2abf(_0x3f4904,_0x5ebea5){return new Promise(function(_0x4fd9d0,_0x2239d3){if(!_0x5ebea5)return _0x4fd9d0(null);var _0x20a150=_0x5ebea5[_0xa66f('0x5')]?{[_0x5ebea5[_0xa66f('0x5')][_0xa66f('0x6')]]:_0x5ebea5['filter'][_0xa66f('0x7')]}:undefined;return _0x12a38f[_0x3f4904]['findAll']({'where':_0x20a150,'raw':!![]})[_0xa66f('0x8')](function(_0x597c7c){_0x5ebea5[_0xa66f('0x9')]=_['map'](_0x597c7c,'id');_0x4fd9d0(_0x5ebea5);})['catch'](function(_0x55e6dc){_0x2239d3(_0x55e6dc);});});}function _0x1e1997(_0x825868,_0x4979c6){return new Promise(function(_0x14d31e,_0x4cd893){var _0x28634d=_0x825868['filter']?{[_0x825868[_0xa66f('0x5')][_0xa66f('0x6')]]:_0x825868[_0xa66f('0x5')]['value']}:undefined;return _0x12a38f[_0x825868['model']][_0xa66f('0xa')]({'where':_0x28634d,'raw':!![]})['then'](function(_0x528427){_0x4979c6['associatedResources']=_[_0xa66f('0xb')](_0x528427,function(_0x452c37){return _0x452c37[_0xa66f('0xc')];});_0x14d31e(_0x4979c6);})[_0xa66f('0xd')](function(_0xd348f9){_0x4cd893(_0xd348f9);});});}function _0x567d4f(_0x5510dc,_0x19b5ac,_0x32d338){if(!_0x19b5ac)return Promise[_0xa66f('0xe')](null);return new Promise(function(_0x403f4d,_0x5c67f5){return _0x12a38f[_0xa66f('0xf')]['findAll']({'where':{'sectionId':_0x19b5ac['id']},'raw':!![]})['then'](function(_0x2f9da2){if(_0x5510dc[_0xa66f('0x6')]&&_0x5510dc[_0xa66f('0x6')]!=='id'){_0x19b5ac[_0xa66f('0x9')]=_[_0xa66f('0xb')](_0x2f9da2,function(_0x408bc7){return _0x408bc7[_0x5510dc[_0xa66f('0x6')]];});}else{if(_0x32d338===_0xa66f('0x10')){_0x19b5ac[_0xa66f('0x9')]=_[_0xa66f('0xb')](_0x2f9da2,function(_0x235b61){return{'id':_0x235b61[_0xa66f('0x11')],'type':_0x235b61[_0xa66f('0x12')]};});}else{_0x19b5ac[_0xa66f('0x9')]=_[_0xa66f('0xb')](_0x2f9da2,function(_0x5cd613){return _0x5cd613[_0xa66f('0x11')];});}}_0x403f4d(_0x19b5ac);})[_0xa66f('0xd')](function(_0x40ee00){_0x5c67f5(_0x40ee00);});});}function _0x37ee13(_0x5cbd82,_0x337602){var _0x473822={'parentSections':[]};switch(_0x5cbd82[_0xa66f('0x13')]()){case _0xa66f('0x14'):_0x473822['childModel']='SquareProject';break;case _0xa66f('0x15'):_0x473822['childModel']=_0xa66f('0x16');break;case _0xa66f('0x17'):_0x473822[_0xa66f('0x18')]='SquareRecording';_0x473822[_0xa66f('0x19')]=[{'name':_0xa66f('0x1a'),'field':_0xa66f('0xc'),'foreignKey':_0xa66f('0x1b')}];break;case _0xa66f('0x1c'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x1d');break;case _0xa66f('0x1e'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x1f');_0x473822[_0xa66f('0x19')]=[{'name':_0xa66f('0x20'),'field':'id','foreignKey':_0xa66f('0x21')}];break;case _0xa66f('0x22'):_0x473822['childModel']='CmList';break;case _0xa66f('0x23'):_0x473822[_0xa66f('0x18')]='CmCompany';break;case _0xa66f('0x24'):_0x473822[_0xa66f('0x18')]='CmCustomField';break;case _0xa66f('0x25'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x26');break;case _0xa66f('0x27'):_0x473822[_0xa66f('0x18')]='ChatWebsite';break;case _0xa66f('0x28'):_0x473822['childModel']=_0xa66f('0x29');break;case _0xa66f('0x2a'):_0x473822[_0xa66f('0x18')]='FaxAccount';break;case _0xa66f('0x2b'):case _0xa66f('0x2c'):case'outboundroutes':_0x473822[_0xa66f('0x18')]=_0xa66f('0x2d');break;case _0xa66f('0x2e'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x2f');break;case _0xa66f('0x30'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x31');break;case _0xa66f('0x32'):_0x473822[_0xa66f('0x18')]='VoiceRecording';_0x473822[_0xa66f('0x19')]=[{'name':'Agents','field':_0xa66f('0xc'),'foreignKey':_0xa66f('0x33'),'model':_0xa66f('0x34'),'filter':{'field':_0xa66f('0x35'),'value':[_0xa66f('0x36')]}},{'name':_0xa66f('0x37'),'field':_0xa66f('0xc'),'foreignKey':_0xa66f('0x33'),'model':'User','filter':{'field':_0xa66f('0x35'),'value':['telephone']}},{'name':_0xa66f('0x38'),'field':_0xa66f('0xc'),'foreignKey':_0xa66f('0x39'),'model':'VoiceQueue','filter':{'field':'type','value':[_0xa66f('0x3a')]}},{'name':_0xa66f('0x3b'),'field':_0xa66f('0xc'),'foreignKey':_0xa66f('0x39'),'model':_0xa66f('0x3c'),'filter':{'field':'type','value':['outbound']}}];break;case'musiconholds':_0x473822[_0xa66f('0x18')]='VoiceMusicOnHold';break;case'chanspies':_0x473822['childModel']=_0xa66f('0x3d');break;case'voiceprefixes':_0x473822[_0xa66f('0x18')]=_0xa66f('0x3e');break;case _0xa66f('0x3f'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x40');break;case _0xa66f('0x41'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x42');break;case _0xa66f('0x43'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x44');break;case _0xa66f('0x45'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x46');break;case'openchannelqueues':_0x473822[_0xa66f('0x18')]=_0xa66f('0x47');break;case'openchannelaccounts':_0x473822[_0xa66f('0x18')]='OpenchannelAccount';break;case _0xa66f('0x48'):_0x473822[_0xa66f('0x18')]='SmsQueue';break;case _0xa66f('0x49'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x4a');break;case'whatsappqueues':_0x473822[_0xa66f('0x18')]='WhatsappQueue';break;case _0xa66f('0x4b'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x4c');break;case _0xa66f('0x4d'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x4e');break;case _0xa66f('0x4f'):case'queuecampaigns':_0x473822[_0xa66f('0x18')]=_0xa66f('0x3c');if(_0x337602){_0x473822[_0xa66f('0x19')]=[{'name':_0xa66f('0x38')},{'name':_0xa66f('0x3b')}];}break;case'users':case'agents':case _0xa66f('0x50'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x34');if(_0x337602){_0x473822[_0xa66f('0x19')]=[{'name':_0xa66f('0x51'),'filter':{'field':_0xa66f('0x35'),'value':['admin',_0xa66f('0x52')]},'ignore':!![]},{'name':_0xa66f('0x53')},{'name':_0xa66f('0x37')}];}break;case'zendeskaccounts':_0x473822['childModel']=_0xa66f('0x54');break;case _0xa66f('0x55'):_0x473822[_0xa66f('0x18')]='SalesforceAccount';break;case'freshdeskaccounts':_0x473822['childModel']=_0xa66f('0x56');break;case _0xa66f('0x57'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x58');break;case _0xa66f('0x59'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x5a');break;case _0xa66f('0x5b'):_0x473822['childModel']=_0xa66f('0x5c');break;case _0xa66f('0x5d'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x34');break;case _0xa66f('0x5e'):_0x473822[_0xa66f('0x18')]='CannedAnswer';break;case _0xa66f('0x5f'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x60');break;case _0xa66f('0x61'):_0x473822[_0xa66f('0x18')]='Dashboard';break;case _0xa66f('0x62'):_0x473822['childModel']=_0xa66f('0x63');break;case'pauses':_0x473822['childModel']=_0xa66f('0x64');break;case _0xa66f('0x65'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x66');break;case _0xa66f('0x67'):_0x473822[_0xa66f('0x18')]='Sound';break;case _0xa66f('0x68'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x69');break;case _0xa66f('0x6a'):_0x473822['childModel']=_0xa66f('0x6b');break;case'triggers':_0x473822[_0xa66f('0x18')]=_0xa66f('0x6c');break;case _0xa66f('0x6d'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x6e');break;case _0xa66f('0x6f'):_0x473822[_0xa66f('0x18')]='Variable';break;case _0xa66f('0x70'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x71');break;case _0xa66f('0x72'):_0x473822[_0xa66f('0x18')]=_0xa66f('0x10');_0x473822[_0xa66f('0x19')]=[{'name':_0xa66f('0x73'),'field':'id','foreignKey':_0xa66f('0x74')}];break;case'metrics':_0x473822['childModel']=_0xa66f('0x75');break;}return _0x473822;}function _0x8c7bdc(_0x31ffea,_0xf5cdf8){var _0x2f1f1e=_0x31ffea[_0xa66f('0x76')](0x0)[_0xa66f('0x77')]()+_0x31ffea['slice'](0x1);var _0x1709eb={'type':_0x12a38f[_0xa66f('0x78')][_0xa66f('0x79')][_0xa66f('0x7a')],'raw':!![]};return new Promise(function(_0x53d22a,_0x29f216){var _0x242100=squel[_0xa66f('0x7b')]()[_0xa66f('0x6')](_0xa66f('0x7c')+_0x2f1f1e+_0xa66f('0x7d'),'id')['field']('ui.createdAt')[_0xa66f('0x7e')](_0xa66f('0x7f')+_0x31ffea+_0xa66f('0x80'),'ui')['where'](_0xa66f('0x81'),_0xf5cdf8['id']);return _0x12a38f[_0xa66f('0x82')][_0xa66f('0x83')](_0x242100[_0xa66f('0x84')](),_0x1709eb)[_0xa66f('0x8')](function(_0x465758){_0xf5cdf8[_0x2f1f1e+_0xa66f('0x85')]=_0x465758;_0x53d22a(_0x465758);})[_0xa66f('0xd')](function(_0x3b8428){_0x29f216(_0x3b8428);});});}return _0x234f2d['define'](_0xa66f('0x86'),attributes,{'tableName':_0xa66f('0x87'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x235e4f){var _0x172c42={'raw':![],'where':{}};var _0x4565f5={};var _0x148ad1={'count':0x0,'rows':[]};var _0x41ffa7=_0x235e4f[_0xa66f('0x83')]['section'];var _0x52f22d=_0x235e4f[_0xa66f('0x83')][_0xa66f('0x88')]||![];var _0x2540ad=_0x37ee13(_0x41ffa7,_0x52f22d);if(!_0x2540ad[_0xa66f('0x18')])throw new Error(_0xa66f('0x89')+_0x41ffa7+'\x27');var _0x508e73=[{'name':_0x41ffa7}];if(!_[_0xa66f('0x8a')](_0x2540ad['parentSections']))_0x508e73=_0x2540ad[_0xa66f('0x19')];var _0x66dbf4=[];for(var _0x450e1d=0x0;_0x450e1d<_0x508e73[_0xa66f('0x8b')];_0x450e1d++){_0x66dbf4['push'](_0x12a38f[_0xa66f('0x8c')][_0xa66f('0x8d')]({'where':{'userProfileId':_0x235e4f[_0xa66f('0x8e')]['id'],'name':_0x508e73[_0x450e1d][_0xa66f('0xc')]},'raw':!![]}));}return Promise[_0xa66f('0x8f')](_0x66dbf4)[_0xa66f('0x8')](function(_0xe06d44){var _0x2bdb18=_[_0xa66f('0x5')](_0xe06d44,function(_0x36b92f){return _0x36b92f?_0x36b92f:undefined;});var _0x290323=_[_0xa66f('0x5')](_0x508e73,['ignore',!![]]);var _0x1854d3=_[_0xa66f('0x8a')](_0x2bdb18)&&_[_0xa66f('0x8a')](_0x290323)?null:_[_0xa66f('0x90')](_0x290323,_0x2bdb18);if(!_0x1854d3)return null;var _0x178434=[];for(var _0x325916=0x0;_0x325916<_0x1854d3[_0xa66f('0x8b')];_0x325916++){var _0x68bd43=_['find'](_0x508e73,function(_0x5173f0){return _0x1854d3[_0x325916]?_0x5173f0[_0xa66f('0xc')]===_0x1854d3[_0x325916][_0xa66f('0xc')]:null;});if(_0x68bd43){if(_0x1854d3[_0x325916][_0xa66f('0x91')]){_0x178434[_0xa66f('0x92')](_0x2a2abf(_0x2540ad[_0xa66f('0x18')],_0x1854d3[_0x325916]));}else{if(!_0x1854d3[_0x325916][_0xa66f('0x93')]){_0x178434[_0xa66f('0x92')](_0x567d4f(_0x68bd43,_0x1854d3[_0x325916],_0x2540ad['childModel']));}else{if(_0x68bd43['model']){_0x178434[_0xa66f('0x92')](_0x1e1997(_0x68bd43,_0x1854d3[_0x325916]));}}}}}return Promise[_0xa66f('0x8f')](_0x178434);})[_0xa66f('0x8')](function(_0x5b03a4){var _0x53b01b=_0x5b03a4;var _0x2dc550=null;if(_0x53b01b){_0x2dc550=_0x53b01b[_0xa66f('0x8b')]===0x1?_0x53b01b[0x0]:null;}if(!_0x2dc550&&!_0x53b01b)return _0x148ad1;var _0x4293dc=_0x12a38f[_0x2540ad[_0xa66f('0x18')]]['rawAttributes'];_0x4565f5[_0xa66f('0x94')]=_[_0xa66f('0x95')](_0x4293dc);_0x4565f5[_0xa66f('0x83')]=_[_0xa66f('0x95')](_0x235e4f[_0xa66f('0x83')]);_0x4565f5[_0xa66f('0x96')]=_[_0xa66f('0x97')](_0x4565f5[_0xa66f('0x94')],_0x4565f5['query']);_0x172c42[_0xa66f('0x98')]=_[_0xa66f('0x97')](_0x4565f5['model'],qs['fields'](_0x235e4f[_0xa66f('0x83')][_0xa66f('0x99')]));_0x172c42['attributes']=_0x172c42[_0xa66f('0x98')]['length']?_0x172c42[_0xa66f('0x98')]:_0x4565f5['model'];if(!_0x235e4f['query']['hasOwnProperty'](_0xa66f('0x9a'))){_0x172c42[_0xa66f('0x9b')]=qs[_0xa66f('0x9b')](_0x235e4f[_0xa66f('0x83')][_0xa66f('0x9b')]);_0x172c42[_0xa66f('0x9c')]=qs[_0xa66f('0x9c')](_0x235e4f[_0xa66f('0x83')][_0xa66f('0x9c')]);}_0x172c42[_0xa66f('0x9d')]=qs[_0xa66f('0x9e')](_0x235e4f[_0xa66f('0x83')][_0xa66f('0x9e')]);_0x172c42[_0xa66f('0x9f')]=qs[_0xa66f('0x96')](_[_0xa66f('0xa0')](_0x235e4f['query'],_0x4565f5[_0xa66f('0x96')]));if(_0x235e4f['query'][_0xa66f('0x5')]){_0x172c42['where']=_[_0xa66f('0xa1')](_0x172c42[_0xa66f('0x9f')],{'$or':_[_0xa66f('0xb')](_0x4293dc,function(_0x5ecc98){if(_0x5ecc98['type'][_0xa66f('0xa2')]!==_0xa66f('0xa3')){var _0x38b869={};_0x38b869[_0x5ecc98[_0xa66f('0x6')]]={'$like':'%'+_0x235e4f[_0xa66f('0x83')][_0xa66f('0x5')]+'%'};return _0x38b869;}})});}var _0x30bcda=[];var _0x578bff=null;var _0x4013b9={};if(_0x2dc550){_0x578bff=_[_0xa66f('0x8d')](_0x508e73,[_0xa66f('0xc'),_0x2dc550[_0xa66f('0xc')]]);if(_0x578bff[_0xa66f('0x6')]){_0x4013b9={};if(_0x2540ad[_0xa66f('0x18')]===_0xa66f('0x10')){_0x4013b9[_0x578bff[_0xa66f('0xa4')]]=_[_0xa66f('0xb')](_0x2dc550[_0xa66f('0x9')],'id');}else{_0x4013b9[_0x578bff[_0xa66f('0xa4')]]=_0x2dc550[_0xa66f('0x9')];}_0x30bcda[_0xa66f('0x92')](_0x4013b9);}else{_0x172c42['where']['id']=_0x2dc550[_0xa66f('0x9')];}}else{for(var _0x722786=0x0;_0x722786<_0x53b01b[_0xa66f('0x8b')];_0x722786++){_0x578bff=_[_0xa66f('0x8d')](_0x508e73,[_0xa66f('0xc'),_0x53b01b[_0x722786][_0xa66f('0xc')]]);if(_0x578bff[_0xa66f('0x6')]){_0x4013b9={};_0x4013b9[_0x578bff[_0xa66f('0xa4')]]=_0x53b01b[_0x722786][_0xa66f('0x9')];_0x30bcda['push'](_0x4013b9);}else{if(!_0x172c42[_0xa66f('0x9f')]['id'])_0x172c42['where']['id']=[];_0x53b01b[_0x722786][_0xa66f('0x9')]['forEach'](function(_0x25d203){_0x172c42['where']['id'][_0xa66f('0x92')](_0x25d203);});}}}if(!_['isEmpty'](_0x30bcda)){_0x172c42[_0xa66f('0x9f')]=_[_0xa66f('0xa1')](_0x172c42[_0xa66f('0x9f')],{'$and':{'$or':_0x30bcda}});}_0x172c42=_[_0xa66f('0xa1')]({},_0x172c42,_0x235e4f[_0xa66f('0xa5')]);if(_0x2dc550&&!_0x2dc550[_0xa66f('0x93')]&&_0x2540ad['childModel']===_0xa66f('0x10')){if(_0x235e4f[_0xa66f('0x83')][_0xa66f('0xa6')]){_0x172c42['include']=[{'all':!![]}];}return _0x12a38f[_0x2540ad[_0xa66f('0x18')]][_0xa66f('0xa')](_0x172c42)['then'](function(_0x1e8510){var _0x473ebd=[];_0x1e8510['forEach'](function(_0x57f0b7){var _0x125bf4;switch(_0x57f0b7[_0xa66f('0xa7')]){case _0xa66f('0xa8'):_0x125bf4=_[_0xa66f('0x8d')](_0x2dc550[_0xa66f('0x9')],function(_0x495a04){return _0x495a04['id']===_0x57f0b7[_0xa66f('0x74')]&&_0x495a04[_0xa66f('0x12')]==='DefaultReports';});break;case _0xa66f('0xa9'):_0x125bf4=_[_0xa66f('0x8d')](_0x2dc550['associatedResources'],function(_0x453847){return _0x453847['id']===_0x57f0b7[_0xa66f('0x74')]&&_0x453847[_0xa66f('0x12')]===_0xa66f('0xaa');});break;}if(_0x125bf4)_0x473ebd[_0xa66f('0x92')](_0x57f0b7);});_0x148ad1['count']=_0x473ebd[_0xa66f('0x8b')];_0x148ad1[_0xa66f('0xab')]=_0x473ebd;return _0x148ad1;});}else{return _0x12a38f[_0x2540ad[_0xa66f('0x18')]][_0xa66f('0xac')]({'where':_0x172c42[_0xa66f('0x9f')]})[_0xa66f('0x8')](function(_0x4e318d){_0x148ad1[_0xa66f('0xac')]=_0x4e318d;if(_0x235e4f[_0xa66f('0x83')][_0xa66f('0xa6')]){if(_0x2540ad[_0xa66f('0x18')]===_0xa66f('0x1f')){_0x172c42[_0xa66f('0xad')]=[{'model':_0x12a38f[_0xa66f('0x69')],'as':'Tags','attributes':['id','name',_0xa66f('0xae')],'required':_0x235e4f['query'][_0xa66f('0xaf')]?!![]:![]},{'model':_0x12a38f[_0xa66f('0x69')],'as':'ThroughTags','attributes':['id',_0xa66f('0xc'),_0xa66f('0xae')],'through':_0x235e4f[_0xa66f('0x83')]['tag']?{'attributes':[],'where':{'TagId':_0x235e4f['query'][_0xa66f('0xaf')]||undefined}}:{},'required':_0x235e4f['query'][_0xa66f('0xaf')]?!![]:![]}];}else{_0x172c42[_0xa66f('0xad')]=[{'all':!![]}];}}return _0x12a38f[_0x2540ad[_0xa66f('0x18')]]['findAll'](_0x172c42);})[_0xa66f('0x8')](function(_0x4cefa7){_0x148ad1[_0xa66f('0xab')]=_0x4cefa7;if(_0x41ffa7===_0xa66f('0x53')&&_0x235e4f[_0xa66f('0x83')][_0xa66f('0xb0')]==='true'){var _0x20a5bc=[];for(var _0x3ac90f=0x0;_0x3ac90f<_0x148ad1[_0xa66f('0xab')][_0xa66f('0x8b')];_0x3ac90f++){_0x20a5bc[_0xa66f('0x92')](_0x8c7bdc(_0xa66f('0xb1'),_0x148ad1['rows'][_0x3ac90f][_0xa66f('0xb2')]));_0x20a5bc[_0xa66f('0x92')](_0x8c7bdc(_0xa66f('0xb3'),_0x148ad1[_0xa66f('0xab')][_0x3ac90f][_0xa66f('0xb2')]));_0x20a5bc['push'](_0x8c7bdc('fax',_0x148ad1[_0xa66f('0xab')][_0x3ac90f][_0xa66f('0xb2')]));_0x20a5bc[_0xa66f('0x92')](_0x8c7bdc(_0xa66f('0xb4'),_0x148ad1[_0xa66f('0xab')][_0x3ac90f][_0xa66f('0xb2')]));_0x20a5bc[_0xa66f('0x92')](_0x8c7bdc(_0xa66f('0xb5'),_0x148ad1[_0xa66f('0xab')][_0x3ac90f][_0xa66f('0xb2')]));_0x20a5bc[_0xa66f('0x92')](_0x8c7bdc(_0xa66f('0xb6'),_0x148ad1['rows'][_0x3ac90f][_0xa66f('0xb2')]));}return Promise[_0xa66f('0x8f')](_0x20a5bc)['then'](function(){return _0x148ad1;});}return _0x148ad1;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 4cd2d12..2107664 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 _0x83d0=['request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','UserProfile,\x20%s,\x20%s'];(function(_0x5d171e,_0x425f95){var _0x1cfc57=function(_0x2e88f7){while(--_0x2e88f7){_0x5d171e['push'](_0x5d171e['shift']());}};_0x1cfc57(++_0x425f95);}(_0x83d0,0xb7));var _0x083d=function(_0x1da14b,_0x5672e4){_0x1da14b=_0x1da14b-0x0;var _0x4a5e2a=_0x83d0[_0x1da14b];return _0x4a5e2a;};'use strict';var _=require(_0x083d('0x0'));var util=require(_0x083d('0x1'));var moment=require(_0x083d('0x2'));var BPromise=require(_0x083d('0x3'));var rs=require(_0x083d('0x4'));var fs=require('fs');var Redis=require(_0x083d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x083d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x083d('0x7'));var jayson=require(_0x083d('0x8'));var client=jayson[_0x083d('0x9')][_0x083d('0xa')]({'port':0x232a});config[_0x083d('0xb')]=_['defaults'](config['redis'],{'host':_0x083d('0xc'),'port':0x18eb});var socket=require(_0x083d('0xd'))(new Redis(config[_0x083d('0xb')]));require('./userProfile.socket')[_0x083d('0xe')](socket);function respondWithRpcPromise(_0x412ea9,_0x40f5ed,_0xcf2319){return new BPromise(function(_0x4c7ec1,_0x3473fa){return client['request'](_0x412ea9,_0xcf2319)[_0x083d('0xf')](function(_0x403441){logger['info'](_0x083d('0x10'),_0x40f5ed,_0x083d('0x11'));logger[_0x083d('0x12')](_0x083d('0x13'),_0x40f5ed,_0x083d('0x11'),JSON['stringify'](_0x403441));if(_0x403441[_0x083d('0x14')]){if(_0x403441[_0x083d('0x14')]['code']===0x1f4){logger[_0x083d('0x14')]('UserProfile,\x20%s,\x20%s',_0x40f5ed,_0x403441['error'][_0x083d('0x15')]);return _0x3473fa(_0x403441[_0x083d('0x14')][_0x083d('0x15')]);}logger[_0x083d('0x14')](_0x083d('0x10'),_0x40f5ed,_0x403441['error'][_0x083d('0x15')]);return _0x4c7ec1(_0x403441['error'][_0x083d('0x15')]);}else{logger[_0x083d('0x16')](_0x083d('0x10'),_0x40f5ed,_0x083d('0x11'));_0x4c7ec1(_0x403441[_0x083d('0x17')][_0x083d('0x15')]);}})[_0x083d('0x18')](function(_0x3a3dd3){logger[_0x083d('0x14')](_0x083d('0x10'),_0x40f5ed,_0x3a3dd3);_0x3473fa(_0x3a3dd3);});});} \ No newline at end of file +var _0x6fad=['code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5d258e,_0x4141f5){var _0x5eac06=function(_0x199b51){while(--_0x199b51){_0x5d258e['push'](_0x5d258e['shift']());}};_0x5eac06(++_0x4141f5);}(_0x6fad,0x17a));var _0xd6fa=function(_0x4c2468,_0x59bc81){_0x4c2468=_0x4c2468-0x0;var _0x27626a=_0x6fad[_0x4c2468];return _0x27626a;};'use strict';var _=require(_0xd6fa('0x0'));var util=require(_0xd6fa('0x1'));var moment=require(_0xd6fa('0x2'));var BPromise=require(_0xd6fa('0x3'));var rs=require(_0xd6fa('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6fa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6fa('0x6'))('rpc');var config=require(_0xd6fa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd6fa('0x8')][_0xd6fa('0x9')]({'port':0x232a});config[_0xd6fa('0xa')]=_[_0xd6fa('0xb')](config[_0xd6fa('0xa')],{'host':_0xd6fa('0xc'),'port':0x18eb});var socket=require(_0xd6fa('0xd'))(new Redis(config['redis']));require(_0xd6fa('0xe'))['register'](socket);function respondWithRpcPromise(_0x1f7672,_0x23cb2b,_0x41a335){return new BPromise(function(_0x1cc80c,_0x31286a){return client['request'](_0x1f7672,_0x41a335)['then'](function(_0x28f2e6){logger[_0xd6fa('0xf')](_0xd6fa('0x10'),_0x23cb2b,'request\x20sent');logger[_0xd6fa('0x11')](_0xd6fa('0x12'),_0x23cb2b,_0xd6fa('0x13'),JSON[_0xd6fa('0x14')](_0x28f2e6));if(_0x28f2e6[_0xd6fa('0x15')]){if(_0x28f2e6[_0xd6fa('0x15')][_0xd6fa('0x16')]===0x1f4){logger['error'](_0xd6fa('0x10'),_0x23cb2b,_0x28f2e6['error']['message']);return _0x31286a(_0x28f2e6[_0xd6fa('0x15')][_0xd6fa('0x17')]);}logger['error'](_0xd6fa('0x10'),_0x23cb2b,_0x28f2e6[_0xd6fa('0x15')]['message']);return _0x1cc80c(_0x28f2e6[_0xd6fa('0x15')][_0xd6fa('0x17')]);}else{logger[_0xd6fa('0xf')]('UserProfile,\x20%s,\x20%s',_0x23cb2b,_0xd6fa('0x13'));_0x1cc80c(_0x28f2e6['result'][_0xd6fa('0x17')]);}})[_0xd6fa('0x18')](function(_0x6a8922){logger[_0xd6fa('0x15')](_0xd6fa('0x10'),_0x23cb2b,_0x6a8922);_0x31286a(_0x6a8922);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index ec7f3a1..7de7df6 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 _0x057a=['length','userProfile:','./userProfile.events','save','remove','emit','removeListener'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x057a,0x19f));var _0xa057=function(_0x2155fd,_0x48ced0){_0x2155fd=_0x2155fd-0x0;var _0x757c1e=_0x057a[_0x2155fd];return _0x757c1e;};'use strict';var UserProfileEvents=require(_0xa057('0x0'));var events=[_0xa057('0x1'),_0xa057('0x2'),'update'];function createListener(_0x559819,_0x24851e){return function(_0xe3dc6){_0x24851e[_0xa057('0x3')](_0x559819,_0xe3dc6);};}function removeListener(_0x157519,_0x1cdafc){return function(){UserProfileEvents[_0xa057('0x4')](_0x157519,_0x1cdafc);};}exports['register']=function(_0x34fe67){for(var _0xd5f6d0=0x0,_0x541929=events[_0xa057('0x5')];_0xd5f6d0<_0x541929;_0xd5f6d0++){var _0x27f00f=events[_0xd5f6d0];var _0x398d2c=createListener(_0xa057('0x6')+_0x27f00f,_0x34fe67);UserProfileEvents['on'](_0x27f00f,_0x398d2c);}}; \ No newline at end of file +var _0x3bfd=['update','emit','removeListener','register','length','userProfile:','./userProfile.events','save','remove'];(function(_0x266bec,_0x49cc86){var _0x148aa=function(_0x3918bc){while(--_0x3918bc){_0x266bec['push'](_0x266bec['shift']());}};_0x148aa(++_0x49cc86);}(_0x3bfd,0xde));var _0xd3bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3bfd[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require(_0xd3bf('0x0'));var events=[_0xd3bf('0x1'),_0xd3bf('0x2'),_0xd3bf('0x3')];function createListener(_0x49faee,_0x509e7c){return function(_0x288fc6){_0x509e7c[_0xd3bf('0x4')](_0x49faee,_0x288fc6);};}function removeListener(_0x2144cc,_0x17d565){return function(){UserProfileEvents[_0xd3bf('0x5')](_0x2144cc,_0x17d565);};}exports[_0xd3bf('0x6')]=function(_0x3c4855){for(var _0x3fbd45=0x0,_0x4a89a3=events[_0xd3bf('0x7')];_0x3fbd45<_0x4a89a3;_0x3fbd45++){var _0x5deaf9=events[_0x3fbd45];var _0x41da76=createListener(_0xd3bf('0x8')+_0x5deaf9,_0x3c4855);UserProfileEvents['on'](_0x5deaf9,_0x41da76);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index bb1eedf..bcf16a2 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 _0x6d77=['put','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x3220ca,_0x4d089c){var _0x2eb653=function(_0x28fd41){while(--_0x28fd41){_0x3220ca['push'](_0x3220ca['shift']());}};_0x2eb653(++_0x4d089c);}(_0x6d77,0x17d));var _0x76d7=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x6d77[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x76d7('0x0'));var util=require(_0x76d7('0x1'));var path=require(_0x76d7('0x2'));var timeout=require(_0x76d7('0x3'));var express=require(_0x76d7('0x4'));var router=express['Router']();var fs_extra=require(_0x76d7('0x5'));var auth=require(_0x76d7('0x6'));var interaction=require(_0x76d7('0x7'));var config=require(_0x76d7('0x8'));var controller=require(_0x76d7('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x76d7('0xa')]);router[_0x76d7('0xb')](_0x76d7('0xc'),auth[_0x76d7('0xd')](),controller[_0x76d7('0xe')]);router['get'](_0x76d7('0xf'),auth[_0x76d7('0xd')](),controller[_0x76d7('0x10')]);router[_0x76d7('0x11')]('/',auth[_0x76d7('0xd')](),controller['create']);router[_0x76d7('0x12')](_0x76d7('0xf'),auth[_0x76d7('0xd')](),controller[_0x76d7('0x13')]);router[_0x76d7('0x14')](_0x76d7('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7c6d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x4fae39,_0x20183b){var _0x3b86d0=function(_0x436a03){while(--_0x436a03){_0x4fae39['push'](_0x4fae39['shift']());}};_0x3b86d0(++_0x20183b);}(_0x7c6d,0x1ca));var _0xd7c6=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x7c6d[_0xc0a3d3];return _0x3386e8;};'use strict';var multer=require('multer');var util=require(_0xd7c6('0x0'));var path=require(_0xd7c6('0x1'));var timeout=require(_0xd7c6('0x2'));var express=require(_0xd7c6('0x3'));var router=express[_0xd7c6('0x4')]();var fs_extra=require(_0xd7c6('0x5'));var auth=require(_0xd7c6('0x6'));var interaction=require(_0xd7c6('0x7'));var config=require(_0xd7c6('0x8'));var controller=require('./userProfileResource.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd7c6('0x9')]);router[_0xd7c6('0xa')](_0xd7c6('0xb'),auth[_0xd7c6('0xc')](),controller['describe']);router['get'](_0xd7c6('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xd7c6('0xe')]('/',auth[_0xd7c6('0xc')](),controller[_0xd7c6('0xf')]);router[_0xd7c6('0x10')](_0xd7c6('0xd'),auth[_0xd7c6('0xc')](),controller[_0xd7c6('0x11')]);router[_0xd7c6('0x12')](_0xd7c6('0xd'),auth[_0xd7c6('0xc')](),controller[_0xd7c6('0x13')]);module[_0xd7c6('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 326f9df..b4071de 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 _0x133e=['STRING','sequelize','exports'];(function(_0x5a2a22,_0x1f3dc8){var _0xf9f942=function(_0xa0aad2){while(--_0xa0aad2){_0x5a2a22['push'](_0x5a2a22['shift']());}};_0xf9f942(++_0x1f3dc8);}(_0x133e,0x16f));var _0xe133=function(_0x4191bc,_0x3096c5){_0x4191bc=_0x4191bc-0x0;var _0x1ffd4e=_0x133e[_0x4191bc];return _0x1ffd4e;};'use strict';var Sequelize=require(_0xe133('0x0'));module[_0xe133('0x1')]={'name':{'type':Sequelize[_0xe133('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xe133('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf78f=['sequelize','STRING','INTEGER'];(function(_0x3b2369,_0x4c68b9){var _0x5a1367=function(_0x58ddcf){while(--_0x58ddcf){_0x3b2369['push'](_0x3b2369['shift']());}};_0x5a1367(++_0x4c68b9);}(_0xf78f,0x105));var _0xff78=function(_0x1d0057,_0x404757){_0x1d0057=_0x1d0057-0x0;var _0x102c37=_0xf78f[_0x1d0057];return _0x102c37;};'use strict';var Sequelize=require(_0xff78('0x0'));module['exports']={'name':{'type':Sequelize[_0xff78('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xff78('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xff78('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 3eb97f0..b47037a 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 _0xe3da=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','describe','eml-format','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','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x3e6209,_0x426ef7){var _0x2b6a32=function(_0x55996f){while(--_0x55996f){_0x3e6209['push'](_0x3e6209['shift']());}};_0x2b6a32(++_0x426ef7);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['create'](_0x38f92d['body'],{})['then'](respondWithResult(_0x4ed0f9,0xc9))[_0xae3d('0x48')](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0x39f213,_0x6fa6c){if(_0x39f213['body']['id']){delete _0x39f213['body']['id'];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'id':_0x39f213[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x6fa6c,null))['then'](saveUpdates(_0x39f213[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x6fa6c,null))[_0xae3d('0x48')](handleError(_0x6fa6c,null));};exports[_0xae3d('0x29')]=function(_0x2a6a24,_0x38ccf1){return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'id':_0x2a6a24[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x38ccf1,null))[_0xae3d('0x28')](removeEntity(_0x38ccf1,null))[_0xae3d('0x48')](handleError(_0x38ccf1,null));};exports['describe']=function(_0x4f4694,_0x4c6dab){return db[_0xae3d('0x2f')][_0xae3d('0x50')]()['then'](respondWithResult(_0x4c6dab,null))[_0xae3d('0x48')](handleError(_0x4c6dab,null));}; \ No newline at end of file +var _0xc6ac=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','UserProfileResource','rawAttributes','fieldName','type','key','map','query','keys'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x15551d,_0x38d941){_0x15551d=_0x15551d-0x0;var _0x66baa8=_0xc6ac[_0x15551d];return _0x66baa8;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['UserProfileResource'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['create']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')](_0x4e1a0b[_0xcc6a('0x4d')],{})[_0xcc6a('0x27')](respondWithResult(_0x47c999,0xc9))['catch'](handleError(_0x47c999,null));};exports[_0xcc6a('0x4e')]=function(_0x5e7bab,_0x3aa7dd){if(_0x5e7bab[_0xcc6a('0x4d')]['id']){delete _0x5e7bab[_0xcc6a('0x4d')]['id'];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x5e7bab[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3aa7dd,null))[_0xcc6a('0x27')](saveUpdates(_0x5e7bab[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x3aa7dd,null))[_0xcc6a('0x4b')](handleError(_0x3aa7dd,null));};exports[_0xcc6a('0x28')]=function(_0x362bf6,_0x431684){return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x362bf6[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x431684,null))[_0xcc6a('0x27')](removeEntity(_0x431684,null))[_0xcc6a('0x4b')](handleError(_0x431684,null));};exports[_0xcc6a('0x4f')]=function(_0x34531d,_0x14f5e5){return db[_0xcc6a('0x2d')]['describe']()['then'](respondWithResult(_0x14f5e5,null))[_0xcc6a('0x4b')](handleError(_0x14f5e5,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 77eba27..43fb65d 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 _0xd1f2=['./userProfileResource.attributes','exports','define','compositeIndex','resourceId','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x42bb20,_0x5858d1){var _0xbe1fb5=function(_0x5de951){while(--_0x5de951){_0x42bb20['push'](_0x42bb20['shift']());}};_0xbe1fb5(++_0x5858d1);}(_0xd1f2,0x116));var _0x2d1f=function(_0x449781,_0x1f557a){_0x449781=_0x449781-0x0;var _0x59880b=_0xd1f2[_0x449781];return _0x59880b;};'use strict';var _=require(_0x2d1f('0x0'));var util=require(_0x2d1f('0x1'));var logger=require(_0x2d1f('0x2'))(_0x2d1f('0x3'));var moment=require(_0x2d1f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d1f('0x5'));var rimraf=require(_0x2d1f('0x6'));var config=require(_0x2d1f('0x7'));var attributes=require(_0x2d1f('0x8'));module[_0x2d1f('0x9')]=function(_0x56383d,_0x3f030e){return _0x56383d[_0x2d1f('0xa')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x2d1f('0xb'),'fields':[_0x2d1f('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x24b0=['../../config/environment','define','UserProfileResource','compositeIndex','resourceId','sectionId','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4ca815,_0x1e8850){var _0x405abc=function(_0x562d4b){while(--_0x562d4b){_0x4ca815['push'](_0x4ca815['shift']());}};_0x405abc(++_0x1e8850);}(_0x24b0,0x1c9));var _0x024b=function(_0x187660,_0x21ca73){_0x187660=_0x187660-0x0;var _0x382a17=_0x24b0[_0x187660];return _0x382a17;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x024b('0x0'))('api');var moment=require(_0x024b('0x1'));var BPromise=require(_0x024b('0x2'));var rp=require(_0x024b('0x3'));var fs=require('fs');var path=require(_0x024b('0x4'));var rimraf=require('rimraf');var config=require(_0x024b('0x5'));var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x371052,_0x42ee31){return _0x371052[_0x024b('0x6')](_0x024b('0x7'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x024b('0x8'),'fields':[_0x024b('0x9'),_0x024b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 9ed3914..132de22 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 _0x2b63=['request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x6c6302,_0x115779){var _0x406127=function(_0x12bab4){while(--_0x12bab4){_0x6c6302['push'](_0x6c6302['shift']());}};_0x406127(++_0x115779);}(_0x2b63,0x1d5));var _0x32b6=function(_0x5982a5,_0x28aa39){_0x5982a5=_0x5982a5-0x0;var _0x21b7b1=_0x2b63[_0x5982a5];return _0x21b7b1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x32b6('0x0'));var BPromise=require(_0x32b6('0x1'));var rs=require(_0x32b6('0x2'));var fs=require('fs');var Redis=require(_0x32b6('0x3'));var db=require(_0x32b6('0x4'))['db'];var utils=require(_0x32b6('0x5'));var logger=require('../../config/logger')(_0x32b6('0x6'));var config=require(_0x32b6('0x7'));var jayson=require(_0x32b6('0x8'));var client=jayson[_0x32b6('0x9')][_0x32b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b5451,_0x4bfdbc,_0x5ba91){return new BPromise(function(_0x7ee64b,_0x34ac61){return client[_0x32b6('0xb')](_0x4b5451,_0x5ba91)[_0x32b6('0xc')](function(_0x3e6c33){logger[_0x32b6('0xd')](_0x32b6('0xe'),_0x4bfdbc,_0x32b6('0xf'));logger['debug'](_0x32b6('0x10'),_0x4bfdbc,_0x32b6('0xf'),JSON['stringify'](_0x3e6c33));if(_0x3e6c33[_0x32b6('0x11')]){if(_0x3e6c33['error'][_0x32b6('0x12')]===0x1f4){logger['error'](_0x32b6('0xe'),_0x4bfdbc,_0x3e6c33[_0x32b6('0x11')][_0x32b6('0x13')]);return _0x34ac61(_0x3e6c33[_0x32b6('0x11')][_0x32b6('0x13')]);}logger[_0x32b6('0x11')](_0x32b6('0xe'),_0x4bfdbc,_0x3e6c33['error'][_0x32b6('0x13')]);return _0x7ee64b(_0x3e6c33['error'][_0x32b6('0x13')]);}else{logger[_0x32b6('0xd')](_0x32b6('0xe'),_0x4bfdbc,_0x32b6('0xf'));_0x7ee64b(_0x3e6c33[_0x32b6('0x14')][_0x32b6('0x13')]);}})[_0x32b6('0x15')](function(_0x5bf02a){logger[_0x32b6('0x11')](_0x32b6('0xe'),_0x4bfdbc,_0x5bf02a);_0x34ac61(_0x5bf02a);});});} \ No newline at end of file +var _0x0705=['catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0xd356e2,_0x36426d){var _0x121109=function(_0x21690b){while(--_0x21690b){_0xd356e2['push'](_0xd356e2['shift']());}};_0x121109(++_0x36426d);}(_0x0705,0x1dc));var _0x5070=function(_0x7cf8eb,_0x5a470e){_0x7cf8eb=_0x7cf8eb-0x0;var _0x24e417=_0x0705[_0x7cf8eb];return _0x24e417;};'use strict';var _=require(_0x5070('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5070('0x1'));var rs=require(_0x5070('0x2'));var fs=require('fs');var Redis=require(_0x5070('0x3'));var db=require(_0x5070('0x4'))['db'];var utils=require(_0x5070('0x5'));var logger=require(_0x5070('0x6'))(_0x5070('0x7'));var config=require(_0x5070('0x8'));var jayson=require(_0x5070('0x9'));var client=jayson[_0x5070('0xa')][_0x5070('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16bd78,_0x2d445d,_0x1991f7){return new BPromise(function(_0x1af5f3,_0x5f29fc){return client[_0x5070('0xc')](_0x16bd78,_0x1991f7)[_0x5070('0xd')](function(_0x5ac34c){logger[_0x5070('0xe')](_0x5070('0xf'),_0x2d445d,'request\x20sent');logger[_0x5070('0x10')](_0x5070('0x11'),_0x2d445d,'request\x20sent',JSON[_0x5070('0x12')](_0x5ac34c));if(_0x5ac34c['error']){if(_0x5ac34c[_0x5070('0x13')][_0x5070('0x14')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x2d445d,_0x5ac34c[_0x5070('0x13')]['message']);return _0x5f29fc(_0x5ac34c['error']['message']);}logger[_0x5070('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x2d445d,_0x5ac34c[_0x5070('0x13')][_0x5070('0x15')]);return _0x1af5f3(_0x5ac34c[_0x5070('0x13')][_0x5070('0x15')]);}else{logger[_0x5070('0xe')](_0x5070('0xf'),_0x2d445d,_0x5070('0x16'));_0x1af5f3(_0x5ac34c[_0x5070('0x17')][_0x5070('0x15')]);}})[_0x5070('0x18')](function(_0x1639af){logger[_0x5070('0x13')](_0x5070('0xf'),_0x2d445d,_0x1639af);_0x5f29fc(_0x1639af);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index c3ec7a8..0b5540c 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 _0xbf11=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','post','create','put','update','destroy','exports','multer','path'];(function(_0x32349d,_0x558bde){var _0x50c1de=function(_0x3b5a7f){while(--_0x3b5a7f){_0x32349d['push'](_0x32349d['shift']());}};_0x50c1de(++_0x558bde);}(_0xbf11,0x83));var _0x1bf1=function(_0x15d9c9,_0x33ea68){_0x15d9c9=_0x15d9c9-0x0;var _0xd8ef55=_0xbf11[_0x15d9c9];return _0xd8ef55;};'use strict';var multer=require(_0x1bf1('0x0'));var util=require('util');var path=require(_0x1bf1('0x1'));var timeout=require(_0x1bf1('0x2'));var express=require(_0x1bf1('0x3'));var router=express['Router']();var fs_extra=require(_0x1bf1('0x4'));var auth=require(_0x1bf1('0x5'));var interaction=require(_0x1bf1('0x6'));var config=require(_0x1bf1('0x7'));var controller=require('./userProfileSection.controller');router[_0x1bf1('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1bf1('0x8')](_0x1bf1('0x9'),auth[_0x1bf1('0xa')](),controller[_0x1bf1('0xb')]);router['get'](_0x1bf1('0xc'),auth[_0x1bf1('0xa')](),controller['show']);router[_0x1bf1('0xd')]('/',auth[_0x1bf1('0xa')](),controller[_0x1bf1('0xe')]);router[_0x1bf1('0xf')](_0x1bf1('0xc'),auth[_0x1bf1('0xa')](),controller[_0x1bf1('0x10')]);router['delete']('/:id',auth[_0x1bf1('0xa')](),controller[_0x1bf1('0x11')]);module[_0x1bf1('0x12')]=router; \ No newline at end of file +var _0xb741=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','post','/:id','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x454e96,_0x3e5256){var _0x2d5630=function(_0x5b5793){while(--_0x5b5793){_0x454e96['push'](_0x454e96['shift']());}};_0x2d5630(++_0x3e5256);}(_0xb741,0xa6));var _0x1b74=function(_0x3478a1,_0x49b336){_0x3478a1=_0x3478a1-0x0;var _0x1f085a=_0xb741[_0x3478a1];return _0x1f085a;};'use strict';var multer=require(_0x1b74('0x0'));var util=require(_0x1b74('0x1'));var path=require(_0x1b74('0x2'));var timeout=require(_0x1b74('0x3'));var express=require(_0x1b74('0x4'));var router=express['Router']();var fs_extra=require(_0x1b74('0x5'));var auth=require(_0x1b74('0x6'));var interaction=require(_0x1b74('0x7'));var config=require(_0x1b74('0x8'));var controller=require(_0x1b74('0x9'));router[_0x1b74('0xa')]('/',auth[_0x1b74('0xb')](),controller[_0x1b74('0xc')]);router['get'](_0x1b74('0xd'),auth[_0x1b74('0xb')](),controller['describe']);router[_0x1b74('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1b74('0xe')]('/',auth[_0x1b74('0xb')](),controller['create']);router['put'](_0x1b74('0xf'),auth[_0x1b74('0xb')](),controller[_0x1b74('0x10')]);router[_0x1b74('0x11')](_0x1b74('0xf'),auth[_0x1b74('0xb')](),controller['destroy']);module[_0x1b74('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 75399a9..cc06a35 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 _0xf7b4=['getDataValue','split','sequelize','STRING','INTEGER','setDataValue','crudPermissions','join'];(function(_0x45cca7,_0x534c6e){var _0x610eb1=function(_0x4b61bf){while(--_0x4b61bf){_0x45cca7['push'](_0x45cca7['shift']());}};_0x610eb1(++_0x534c6e);}(_0xf7b4,0x152));var _0x4f7b=function(_0x54924e,_0x2e2011){_0x54924e=_0x54924e-0x0;var _0x98c902=_0xf7b4[_0x54924e];return _0x98c902;};'use strict';var Sequelize=require(_0x4f7b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4f7b('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4f7b('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4f7b('0x1')],'set':function(_0x3e18fd){this[_0x4f7b('0x3')](_0x4f7b('0x4'),_0x3e18fd?_0x3e18fd[_0x4f7b('0x5')](''):[]);},'get':function(){return this[_0x4f7b('0x6')](_0x4f7b('0x4'))?this[_0x4f7b('0x6')](_0x4f7b('0x4'))[_0x4f7b('0x7')](''):[];}}}; \ No newline at end of file +var _0x9348=['exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize'];(function(_0x3a7a34,_0x3da3d2){var _0x3cb01d=function(_0x41dd61){while(--_0x41dd61){_0x3a7a34['push'](_0x3a7a34['shift']());}};_0x3cb01d(++_0x3da3d2);}(_0x9348,0x10d));var _0x8934=function(_0x343fcd,_0x3584ed){_0x343fcd=_0x343fcd-0x0;var _0xfeb398=_0x9348[_0x343fcd];return _0xfeb398;};'use strict';var Sequelize=require(_0x8934('0x0'));module[_0x8934('0x1')]={'name':{'type':Sequelize[_0x8934('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x8934('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x8934('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x8934('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x8934('0x2')],'set':function(_0x5f34d7){this[_0x8934('0x5')](_0x8934('0x6'),_0x5f34d7?_0x5f34d7[_0x8934('0x7')](''):[]);},'get':function(){return this[_0x8934('0x8')](_0x8934('0x6'))?this[_0x8934('0x8')]('crudPermissions')[_0x8934('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 81ef188..c6bac29 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 _0x6b58=['includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','UserProfileSection','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x41c134,_0x5e2a85){var _0x3f9670=function(_0x11ab5d){while(--_0x11ab5d){_0x41c134['push'](_0x41c134['shift']());}};_0x3f9670(++_0x5e2a85);}(_0x6b58,0x17e));var _0x86b5=function(_0x33155c,_0x3fdde1){_0x33155c=_0x33155c-0x0;var _0x5becf7=_0x6b58[_0x33155c];return _0x5becf7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86b5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x86b5('0x1'));var rp=require(_0x86b5('0x2'));var moment=require(_0x86b5('0x3'));var BPromise=require(_0x86b5('0x4'));var Mustache=require(_0x86b5('0x5'));var util=require('util');var path=require(_0x86b5('0x6'));var sox=require(_0x86b5('0x7'));var csv=require(_0x86b5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x86b5('0x9'));var _=require(_0x86b5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x86b5('0xb'));var deskjs=require(_0x86b5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x86b5('0xd'));var Papa=require(_0x86b5('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x86b5('0xf'));var as=require(_0x86b5('0x10'));var hardwareService=require(_0x86b5('0x11'));var logger=require(_0x86b5('0x12'))(_0x86b5('0x13'));var utils=require('../../config/utils');var config=require(_0x86b5('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x86b5('0x15'))['db'];function respondWithStatusCode(_0x2fbe16,_0x42ea74){_0x42ea74=_0x42ea74||0xcc;return function(_0xb04c15){if(_0xb04c15){return _0x2fbe16[_0x86b5('0x16')](_0x42ea74);}return _0x2fbe16['status'](_0x42ea74)[_0x86b5('0x17')]();};}function respondWithResult(_0x413070,_0x1a0bc3){_0x1a0bc3=_0x1a0bc3||0xc8;return function(_0x5dccd5){if(_0x5dccd5){return _0x413070[_0x86b5('0x18')](_0x1a0bc3)['json'](_0x5dccd5);}};}function respondWithFilteredResult(_0x12b854,_0x15c57f){return function(_0x12243f){if(_0x12243f){var _0x4c15bd=typeof _0x15c57f[_0x86b5('0x19')]===_0x86b5('0x1a')&&typeof _0x15c57f[_0x86b5('0x1b')]===_0x86b5('0x1a');var _0x23ab39=_0x12243f[_0x86b5('0x1c')];var _0x29750d=_0x4c15bd?0x0:_0x15c57f[_0x86b5('0x19')];var _0x31fbf8=_0x4c15bd?_0x12243f[_0x86b5('0x1c')]:_0x15c57f[_0x86b5('0x19')]+_0x15c57f[_0x86b5('0x1b')];var _0x5d3024;if(_0x31fbf8>=_0x23ab39){_0x31fbf8=_0x23ab39;_0x5d3024=0xc8;}else{_0x5d3024=0xce;}_0x12b854[_0x86b5('0x18')](_0x5d3024);return _0x12b854[_0x86b5('0x1d')](_0x86b5('0x1e'),_0x29750d+'-'+_0x31fbf8+'/'+_0x23ab39)['json'](_0x12243f);}return null;};}function patchUpdates(_0x584a0a){return function(_0x40664e){try{jsonpatch[_0x86b5('0x1f')](_0x40664e,_0x584a0a,!![]);}catch(_0xaa396c){return BPromise[_0x86b5('0x20')](_0xaa396c);}return _0x40664e[_0x86b5('0x21')]();};}function saveUpdates(_0x35eeea,_0x1bde67){return function(_0x15f6f1){if(_0x15f6f1){return _0x15f6f1[_0x86b5('0x22')](_0x35eeea)[_0x86b5('0x23')](function(_0x4d9d1d){return _0x4d9d1d;});}return null;};}function removeEntity(_0x404453,_0x3a1558){return function(_0x40f7ac){if(_0x40f7ac){return _0x40f7ac[_0x86b5('0x24')]()[_0x86b5('0x23')](function(){_0x404453['status'](0xcc)[_0x86b5('0x17')]();});}};}function handleEntityNotFound(_0x20cbc6,_0x3e0a34){return function(_0x25dc9d){if(!_0x25dc9d){_0x20cbc6[_0x86b5('0x16')](0x194);}return _0x25dc9d;};}function handleError(_0x2641aa,_0x552d1b){_0x552d1b=_0x552d1b||0x1f4;return function(_0x268e64){logger[_0x86b5('0x25')](_0x268e64[_0x86b5('0x26')]);if(_0x268e64[_0x86b5('0x27')]){delete _0x268e64[_0x86b5('0x27')];}_0x2641aa[_0x86b5('0x18')](_0x552d1b)['send'](_0x268e64);};}exports[_0x86b5('0x28')]=function(_0x274041,_0x271fac){var _0x5e8317={},_0x5eb13c={},_0x767606={'count':0x0,'rows':[]};var _0x2e67f1=_[_0x86b5('0x29')](db[_0x86b5('0x2a')][_0x86b5('0x2b')],function(_0x1c8464){return{'name':_0x1c8464['fieldName'],'type':_0x1c8464[_0x86b5('0x2c')]['key']};});_0x5eb13c[_0x86b5('0x2d')]=_[_0x86b5('0x29')](_0x2e67f1,_0x86b5('0x27'));_0x5eb13c['query']=_['keys'](_0x274041[_0x86b5('0x2e')]);_0x5eb13c[_0x86b5('0x2f')]=_[_0x86b5('0x30')](_0x5eb13c[_0x86b5('0x2d')],_0x5eb13c[_0x86b5('0x2e')]);_0x5e8317['attributes']=_[_0x86b5('0x30')](_0x5eb13c[_0x86b5('0x2d')],qs[_0x86b5('0x31')](_0x274041[_0x86b5('0x2e')][_0x86b5('0x31')]));_0x5e8317[_0x86b5('0x32')]=_0x5e8317['attributes'][_0x86b5('0x33')]?_0x5e8317['attributes']:_0x5eb13c['model'];if(!_0x274041[_0x86b5('0x2e')][_0x86b5('0x34')](_0x86b5('0x35'))){_0x5e8317['limit']=qs['limit'](_0x274041[_0x86b5('0x2e')][_0x86b5('0x1b')]);_0x5e8317[_0x86b5('0x19')]=qs[_0x86b5('0x19')](_0x274041[_0x86b5('0x2e')][_0x86b5('0x19')]);}_0x5e8317[_0x86b5('0x36')]=qs['sort'](_0x274041[_0x86b5('0x2e')][_0x86b5('0x37')]);_0x5e8317[_0x86b5('0x38')]=qs[_0x86b5('0x2f')](_[_0x86b5('0x39')](_0x274041[_0x86b5('0x2e')],_0x5eb13c[_0x86b5('0x2f')]),_0x2e67f1);if(_0x274041[_0x86b5('0x2e')][_0x86b5('0x3a')]){_0x5e8317[_0x86b5('0x38')]=_[_0x86b5('0x3b')](_0x5e8317[_0x86b5('0x38')],{'$or':_[_0x86b5('0x29')](_0x2e67f1,function(_0xd42f45){if(_0xd42f45['type']!==_0x86b5('0x3c')){var _0x2d4211={};_0x2d4211[_0xd42f45[_0x86b5('0x27')]]={'$like':'%'+_0x274041[_0x86b5('0x2e')]['filter']+'%'};return _0x2d4211;}})});}_0x5e8317=_[_0x86b5('0x3b')]({},_0x5e8317,_0x274041[_0x86b5('0x3d')]);var _0x2987f2={'where':_0x5e8317['where']};return db[_0x86b5('0x2a')][_0x86b5('0x1c')](_0x2987f2)[_0x86b5('0x23')](function(_0x14d712){_0x767606[_0x86b5('0x1c')]=_0x14d712;if(_0x274041[_0x86b5('0x2e')][_0x86b5('0x3e')]){_0x5e8317[_0x86b5('0x3f')]=[{'all':!![]}];}return db[_0x86b5('0x2a')][_0x86b5('0x40')](_0x5e8317);})['then'](function(_0x552b43){_0x767606[_0x86b5('0x41')]=_0x552b43;return _0x767606;})['then'](respondWithFilteredResult(_0x271fac,_0x5e8317))['catch'](handleError(_0x271fac,null));};exports[_0x86b5('0x42')]=function(_0x1cca06,_0x407b92){var _0x4a95bd={'raw':![],'where':{'id':_0x1cca06[_0x86b5('0x43')]['id']}},_0x4418f9={};_0x4418f9[_0x86b5('0x2d')]=_[_0x86b5('0x44')](db['UserProfileSection']['rawAttributes']);_0x4418f9[_0x86b5('0x2e')]=_[_0x86b5('0x44')](_0x1cca06[_0x86b5('0x2e')]);_0x4418f9['filters']=_['intersection'](_0x4418f9['model'],_0x4418f9[_0x86b5('0x2e')]);_0x4a95bd[_0x86b5('0x32')]=_[_0x86b5('0x30')](_0x4418f9[_0x86b5('0x2d')],qs['fields'](_0x1cca06[_0x86b5('0x2e')][_0x86b5('0x31')]));_0x4a95bd[_0x86b5('0x32')]=_0x4a95bd[_0x86b5('0x32')][_0x86b5('0x33')]?_0x4a95bd[_0x86b5('0x32')]:_0x4418f9[_0x86b5('0x2d')];if(_0x1cca06['query'][_0x86b5('0x3e')]){_0x4a95bd[_0x86b5('0x3f')]=[{'all':!![]}];}_0x4a95bd=_['merge']({},_0x4a95bd,_0x1cca06['options']);return db[_0x86b5('0x2a')][_0x86b5('0x45')](_0x4a95bd)['then'](handleEntityNotFound(_0x407b92,null))['then'](respondWithResult(_0x407b92,null))[_0x86b5('0x46')](handleError(_0x407b92,null));};exports[_0x86b5('0x47')]=function(_0x29cc88,_0x4fa476){return db[_0x86b5('0x2a')][_0x86b5('0x47')](_0x29cc88['body'],{})['then'](respondWithResult(_0x4fa476,0xc9))['catch'](handleError(_0x4fa476,null));};exports[_0x86b5('0x22')]=function(_0x401f24,_0x36a94c){if(_0x401f24['body']['id']){delete _0x401f24[_0x86b5('0x48')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x401f24[_0x86b5('0x43')]['id']}})[_0x86b5('0x23')](handleEntityNotFound(_0x36a94c,null))[_0x86b5('0x23')](saveUpdates(_0x401f24[_0x86b5('0x48')],null))[_0x86b5('0x23')](respondWithResult(_0x36a94c,null))[_0x86b5('0x46')](handleError(_0x36a94c,null));};exports[_0x86b5('0x24')]=function(_0x2f1de7,_0x114dfe){return db[_0x86b5('0x2a')]['find']({'where':{'id':_0x2f1de7[_0x86b5('0x43')]['id']}})['then'](handleEntityNotFound(_0x114dfe,null))['then'](removeEntity(_0x114dfe,null))[_0x86b5('0x46')](handleError(_0x114dfe,null));};exports['describe']=function(_0x428bec,_0x271c3a){return db['UserProfileSection'][_0x86b5('0x49')]()[_0x86b5('0x23')](respondWithResult(_0x271c3a,null))[_0x86b5('0x46')](handleError(_0x271c3a,null));}; \ No newline at end of file +var _0x85d7=['where','VIRTUAL','filter','options','UserProfileSection','include','findAll','rows','show','params','length','includeAll','find','create','body','catch','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','order','sort','pick','merge'];(function(_0x511ee4,_0x40ddc5){var _0x4280ed=function(_0x453e2f){while(--_0x453e2f){_0x511ee4['push'](_0x511ee4['shift']());}};_0x4280ed(++_0x40ddc5);}(_0x85d7,0x1d4));var _0x785d=function(_0x58dc03,_0x1c0b28){_0x58dc03=_0x58dc03-0x0;var _0x2f14bb=_0x85d7[_0x58dc03];return _0x2f14bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x785d('0x0'));var zipdir=require(_0x785d('0x1'));var jsonpatch=require(_0x785d('0x2'));var rp=require('request-promise');var moment=require(_0x785d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x785d('0x4'));var util=require(_0x785d('0x5'));var path=require(_0x785d('0x6'));var sox=require(_0x785d('0x7'));var csv=require(_0x785d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x785d('0x9'));var _=require(_0x785d('0xa'));var squel=require('squel');var crypto=require(_0x785d('0xb'));var jsforce=require(_0x785d('0xc'));var deskjs=require(_0x785d('0xd'));var toCsv=require(_0x785d('0x8'));var querystring=require(_0x785d('0xe'));var Papa=require(_0x785d('0xf'));var Redis=require(_0x785d('0x10'));var authService=require(_0x785d('0x11'));var qs=require(_0x785d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x785d('0x13'));var logger=require('../../config/logger')(_0x785d('0x14'));var utils=require('../../config/utils');var config=require(_0x785d('0x15'));var licenseUtil=require(_0x785d('0x16'));var db=require(_0x785d('0x17'))['db'];function respondWithStatusCode(_0x10279f,_0x1548f6){_0x1548f6=_0x1548f6||0xcc;return function(_0x59afc3){if(_0x59afc3){return _0x10279f[_0x785d('0x18')](_0x1548f6);}return _0x10279f['status'](_0x1548f6)[_0x785d('0x19')]();};}function respondWithResult(_0x34134d,_0xbeb039){_0xbeb039=_0xbeb039||0xc8;return function(_0x43f87e){if(_0x43f87e){return _0x34134d[_0x785d('0x1a')](_0xbeb039)[_0x785d('0x1b')](_0x43f87e);}};}function respondWithFilteredResult(_0x1589dc,_0x92388e){return function(_0x47be66){if(_0x47be66){var _0xcab680=typeof _0x92388e[_0x785d('0x1c')]===_0x785d('0x1d')&&typeof _0x92388e[_0x785d('0x1e')]===_0x785d('0x1d');var _0x484ca1=_0x47be66[_0x785d('0x1f')];var _0x22d749=_0xcab680?0x0:_0x92388e[_0x785d('0x1c')];var _0x3355df=_0xcab680?_0x47be66[_0x785d('0x1f')]:_0x92388e[_0x785d('0x1c')]+_0x92388e[_0x785d('0x1e')];var _0x19bdde;if(_0x3355df>=_0x484ca1){_0x3355df=_0x484ca1;_0x19bdde=0xc8;}else{_0x19bdde=0xce;}_0x1589dc[_0x785d('0x1a')](_0x19bdde);return _0x1589dc[_0x785d('0x20')]('Content-Range',_0x22d749+'-'+_0x3355df+'/'+_0x484ca1)[_0x785d('0x1b')](_0x47be66);}return null;};}function patchUpdates(_0x273820){return function(_0x3e60e5){try{jsonpatch[_0x785d('0x21')](_0x3e60e5,_0x273820,!![]);}catch(_0x24f39b){return BPromise['reject'](_0x24f39b);}return _0x3e60e5[_0x785d('0x22')]();};}function saveUpdates(_0x38b4d0,_0x40e244){return function(_0x2545bd){if(_0x2545bd){return _0x2545bd[_0x785d('0x23')](_0x38b4d0)[_0x785d('0x24')](function(_0x1a62c8){return _0x1a62c8;});}return null;};}function removeEntity(_0x2bac53,_0xa3c97b){return function(_0x1fe2c8){if(_0x1fe2c8){return _0x1fe2c8['destroy']()[_0x785d('0x24')](function(){_0x2bac53[_0x785d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d78ed,_0x2f28fa){return function(_0xfa47e6){if(!_0xfa47e6){_0x4d78ed[_0x785d('0x18')](0x194);}return _0xfa47e6;};}function handleError(_0x84845a,_0x622e5e){_0x622e5e=_0x622e5e||0x1f4;return function(_0x54a945){logger[_0x785d('0x25')](_0x54a945[_0x785d('0x26')]);if(_0x54a945['name']){delete _0x54a945[_0x785d('0x27')];}_0x84845a[_0x785d('0x1a')](_0x622e5e)[_0x785d('0x28')](_0x54a945);};}exports[_0x785d('0x29')]=function(_0x3a10a2,_0x5ea564){var _0x67bd29={},_0x294821={},_0x1b2a77={'count':0x0,'rows':[]};var _0x207739=_[_0x785d('0x2a')](db['UserProfileSection'][_0x785d('0x2b')],function(_0x21a22a){return{'name':_0x21a22a[_0x785d('0x2c')],'type':_0x21a22a[_0x785d('0x2d')]['key']};});_0x294821['model']=_[_0x785d('0x2a')](_0x207739,_0x785d('0x27'));_0x294821[_0x785d('0x2e')]=_[_0x785d('0x2f')](_0x3a10a2[_0x785d('0x2e')]);_0x294821[_0x785d('0x30')]=_[_0x785d('0x31')](_0x294821['model'],_0x294821[_0x785d('0x2e')]);_0x67bd29[_0x785d('0x32')]=_[_0x785d('0x31')](_0x294821[_0x785d('0x33')],qs[_0x785d('0x34')](_0x3a10a2['query'][_0x785d('0x34')]));_0x67bd29['attributes']=_0x67bd29[_0x785d('0x32')]['length']?_0x67bd29[_0x785d('0x32')]:_0x294821['model'];if(!_0x3a10a2['query']['hasOwnProperty']('nolimit')){_0x67bd29[_0x785d('0x1e')]=qs[_0x785d('0x1e')](_0x3a10a2[_0x785d('0x2e')][_0x785d('0x1e')]);_0x67bd29[_0x785d('0x1c')]=qs[_0x785d('0x1c')](_0x3a10a2[_0x785d('0x2e')][_0x785d('0x1c')]);}_0x67bd29[_0x785d('0x35')]=qs['sort'](_0x3a10a2[_0x785d('0x2e')][_0x785d('0x36')]);_0x67bd29['where']=qs[_0x785d('0x30')](_[_0x785d('0x37')](_0x3a10a2[_0x785d('0x2e')],_0x294821[_0x785d('0x30')]),_0x207739);if(_0x3a10a2[_0x785d('0x2e')]['filter']){_0x67bd29['where']=_[_0x785d('0x38')](_0x67bd29[_0x785d('0x39')],{'$or':_[_0x785d('0x2a')](_0x207739,function(_0x171988){if(_0x171988[_0x785d('0x2d')]!==_0x785d('0x3a')){var _0x4ce70d={};_0x4ce70d[_0x171988['name']]={'$like':'%'+_0x3a10a2[_0x785d('0x2e')][_0x785d('0x3b')]+'%'};return _0x4ce70d;}})});}_0x67bd29=_[_0x785d('0x38')]({},_0x67bd29,_0x3a10a2[_0x785d('0x3c')]);var _0x435c3d={'where':_0x67bd29[_0x785d('0x39')]};return db[_0x785d('0x3d')]['count'](_0x435c3d)['then'](function(_0x2f925a){_0x1b2a77[_0x785d('0x1f')]=_0x2f925a;if(_0x3a10a2[_0x785d('0x2e')]['includeAll']){_0x67bd29[_0x785d('0x3e')]=[{'all':!![]}];}return db[_0x785d('0x3d')][_0x785d('0x3f')](_0x67bd29);})['then'](function(_0x4706b4){_0x1b2a77[_0x785d('0x40')]=_0x4706b4;return _0x1b2a77;})[_0x785d('0x24')](respondWithFilteredResult(_0x5ea564,_0x67bd29))['catch'](handleError(_0x5ea564,null));};exports[_0x785d('0x41')]=function(_0x3da0d9,_0x11c297){var _0x187d93={'raw':![],'where':{'id':_0x3da0d9[_0x785d('0x42')]['id']}},_0x26df53={};_0x26df53['model']=_[_0x785d('0x2f')](db[_0x785d('0x3d')][_0x785d('0x2b')]);_0x26df53[_0x785d('0x2e')]=_[_0x785d('0x2f')](_0x3da0d9[_0x785d('0x2e')]);_0x26df53[_0x785d('0x30')]=_[_0x785d('0x31')](_0x26df53['model'],_0x26df53[_0x785d('0x2e')]);_0x187d93[_0x785d('0x32')]=_[_0x785d('0x31')](_0x26df53[_0x785d('0x33')],qs['fields'](_0x3da0d9[_0x785d('0x2e')][_0x785d('0x34')]));_0x187d93[_0x785d('0x32')]=_0x187d93['attributes'][_0x785d('0x43')]?_0x187d93[_0x785d('0x32')]:_0x26df53[_0x785d('0x33')];if(_0x3da0d9[_0x785d('0x2e')][_0x785d('0x44')]){_0x187d93['include']=[{'all':!![]}];}_0x187d93=_[_0x785d('0x38')]({},_0x187d93,_0x3da0d9['options']);return db[_0x785d('0x3d')][_0x785d('0x45')](_0x187d93)[_0x785d('0x24')](handleEntityNotFound(_0x11c297,null))['then'](respondWithResult(_0x11c297,null))['catch'](handleError(_0x11c297,null));};exports[_0x785d('0x46')]=function(_0x207064,_0x35e4fa){return db[_0x785d('0x3d')][_0x785d('0x46')](_0x207064[_0x785d('0x47')],{})['then'](respondWithResult(_0x35e4fa,0xc9))[_0x785d('0x48')](handleError(_0x35e4fa,null));};exports[_0x785d('0x23')]=function(_0x25dfd8,_0x4742ea){if(_0x25dfd8[_0x785d('0x47')]['id']){delete _0x25dfd8[_0x785d('0x47')]['id'];}return db[_0x785d('0x3d')]['find']({'where':{'id':_0x25dfd8[_0x785d('0x42')]['id']}})['then'](handleEntityNotFound(_0x4742ea,null))['then'](saveUpdates(_0x25dfd8[_0x785d('0x47')],null))[_0x785d('0x24')](respondWithResult(_0x4742ea,null))[_0x785d('0x48')](handleError(_0x4742ea,null));};exports[_0x785d('0x49')]=function(_0x108beb,_0x13a7fd){return db[_0x785d('0x3d')]['find']({'where':{'id':_0x108beb['params']['id']}})['then'](handleEntityNotFound(_0x13a7fd,null))[_0x785d('0x24')](removeEntity(_0x13a7fd,null))[_0x785d('0x48')](handleError(_0x13a7fd,null));};exports[_0x785d('0x4a')]=function(_0x5a8d7e,_0x40fc6b){return db[_0x785d('0x3d')][_0x785d('0x4a')]()[_0x785d('0x24')](respondWithResult(_0x40fc6b,null))[_0x785d('0x48')](handleError(_0x40fc6b,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index ed80bff..4b84385 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 _0xb167=['define','UserProfileSection','user_profile_has_sections','compositeIndex','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports'];(function(_0x1da98d,_0x427fd1){var _0x1d75f5=function(_0x5a018a){while(--_0x5a018a){_0x1da98d['push'](_0x1da98d['shift']());}};_0x1d75f5(++_0x427fd1);}(_0xb167,0x164));var _0x7b16=function(_0x1e4bee,_0x280b64){_0x1e4bee=_0x1e4bee-0x0;var _0x56a81a=_0xb167[_0x1e4bee];return _0x56a81a;};'use strict';var _=require(_0x7b16('0x0'));var util=require(_0x7b16('0x1'));var logger=require(_0x7b16('0x2'))(_0x7b16('0x3'));var moment=require(_0x7b16('0x4'));var BPromise=require(_0x7b16('0x5'));var rp=require(_0x7b16('0x6'));var fs=require('fs');var path=require(_0x7b16('0x7'));var rimraf=require(_0x7b16('0x8'));var config=require(_0x7b16('0x9'));var attributes=require(_0x7b16('0xa'));module[_0x7b16('0xb')]=function(_0x4afe62,_0x56e773){return _0x4afe62[_0x7b16('0xc')](_0x7b16('0xd'),attributes,{'tableName':_0x7b16('0xe'),'paranoid':![],'indexes':[{'name':_0x7b16('0xf'),'fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc99e=['bluebird','request-promise','path','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','compositeIndex','../../config/logger','moment'];(function(_0x1012e3,_0x152690){var _0x2d9c74=function(_0x40afe3){while(--_0x40afe3){_0x1012e3['push'](_0x1012e3['shift']());}};_0x2d9c74(++_0x152690);}(_0xc99e,0xc4));var _0xec99=function(_0x385803,_0xf36b8d){_0x385803=_0x385803-0x0;var _0x308bca=_0xc99e[_0x385803];return _0x308bca;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xec99('0x0'))('api');var moment=require(_0xec99('0x1'));var BPromise=require(_0xec99('0x2'));var rp=require(_0xec99('0x3'));var fs=require('fs');var path=require(_0xec99('0x4'));var rimraf=require('rimraf');var config=require(_0xec99('0x5'));var attributes=require(_0xec99('0x6'));module['exports']=function(_0x295f4b,_0x5aa581){return _0x295f4b[_0xec99('0x7')](_0xec99('0x8'),attributes,{'tableName':_0xec99('0x9'),'paranoid':![],'indexes':[{'name':_0xec99('0xa'),'fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index b180112..fdc4021 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 _0xa8cd=['http','request','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa8cd,0x7e));var _0xda8c=function(_0x14fad0,_0x278d75){_0x14fad0=_0x14fad0-0x0;var _0x5c665f=_0xa8cd[_0x14fad0];return _0x5c665f;};'use strict';var _=require(_0xda8c('0x0'));var util=require(_0xda8c('0x1'));var moment=require(_0xda8c('0x2'));var BPromise=require('bluebird');var rs=require(_0xda8c('0x3'));var fs=require('fs');var Redis=require(_0xda8c('0x4'));var db=require(_0xda8c('0x5'))['db'];var utils=require(_0xda8c('0x6'));var logger=require(_0xda8c('0x7'))(_0xda8c('0x8'));var config=require(_0xda8c('0x9'));var jayson=require(_0xda8c('0xa'));var client=jayson[_0xda8c('0xb')][_0xda8c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xac5985,_0x457667,_0x5bfd0d){return new BPromise(function(_0x49844a,_0xcb7ee5){return client[_0xda8c('0xd')](_0xac5985,_0x5bfd0d)['then'](function(_0x3bb1c1){logger['info'](_0xda8c('0xe'),_0x457667,_0xda8c('0xf'));logger[_0xda8c('0x10')](_0xda8c('0x11'),_0x457667,_0xda8c('0xf'),JSON['stringify'](_0x3bb1c1));if(_0x3bb1c1[_0xda8c('0x12')]){if(_0x3bb1c1[_0xda8c('0x12')]['code']===0x1f4){logger[_0xda8c('0x12')](_0xda8c('0xe'),_0x457667,_0x3bb1c1[_0xda8c('0x12')]['message']);return _0xcb7ee5(_0x3bb1c1[_0xda8c('0x12')][_0xda8c('0x13')]);}logger[_0xda8c('0x12')](_0xda8c('0xe'),_0x457667,_0x3bb1c1[_0xda8c('0x12')][_0xda8c('0x13')]);return _0x49844a(_0x3bb1c1['error'][_0xda8c('0x13')]);}else{logger[_0xda8c('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x457667,_0xda8c('0xf'));_0x49844a(_0x3bb1c1[_0xda8c('0x15')][_0xda8c('0x13')]);}})[_0xda8c('0x16')](function(_0x4e34fb){logger[_0xda8c('0x12')](_0xda8c('0xe'),_0x457667,_0x4e34fb);_0xcb7ee5(_0x4e34fb);});});} \ No newline at end of file +var _0x7284=['request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x5927ba,_0x34792d){var _0x1975d6=function(_0x8ba690){while(--_0x8ba690){_0x5927ba['push'](_0x5927ba['shift']());}};_0x1975d6(++_0x34792d);}(_0x7284,0x9f));var _0x4728=function(_0x1ab8b3,_0x3fce91){_0x1ab8b3=_0x1ab8b3-0x0;var _0x377df9=_0x7284[_0x1ab8b3];return _0x377df9;};'use strict';var _=require('lodash');var util=require(_0x4728('0x0'));var moment=require(_0x4728('0x1'));var BPromise=require(_0x4728('0x2'));var rs=require(_0x4728('0x3'));var fs=require('fs');var Redis=require(_0x4728('0x4'));var db=require(_0x4728('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4728('0x6'))(_0x4728('0x7'));var config=require(_0x4728('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x9e5185,_0x3965a4,_0x5221c6){return new BPromise(function(_0x43a220,_0x4e1dcc){return client[_0x4728('0x9')](_0x9e5185,_0x5221c6)[_0x4728('0xa')](function(_0x4ae0b6){logger[_0x4728('0xb')](_0x4728('0xc'),_0x3965a4,_0x4728('0xd'));logger[_0x4728('0xe')](_0x4728('0xf'),_0x3965a4,_0x4728('0xd'),JSON[_0x4728('0x10')](_0x4ae0b6));if(_0x4ae0b6['error']){if(_0x4ae0b6[_0x4728('0x11')][_0x4728('0x12')]===0x1f4){logger[_0x4728('0x11')](_0x4728('0xc'),_0x3965a4,_0x4ae0b6[_0x4728('0x11')][_0x4728('0x13')]);return _0x4e1dcc(_0x4ae0b6['error'][_0x4728('0x13')]);}logger['error'](_0x4728('0xc'),_0x3965a4,_0x4ae0b6[_0x4728('0x11')][_0x4728('0x13')]);return _0x43a220(_0x4ae0b6[_0x4728('0x11')][_0x4728('0x13')]);}else{logger[_0x4728('0xb')](_0x4728('0xc'),_0x3965a4,_0x4728('0xd'));_0x43a220(_0x4ae0b6[_0x4728('0x14')][_0x4728('0x13')]);}})['catch'](function(_0x51c988){logger['error'](_0x4728('0xc'),_0x3965a4,_0x51c988);_0x4e1dcc(_0x51c988);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index c93086e..e7b087f 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3ab0f1,_0x31acba){var _0x2c2fb8=function(_0x5da5c4){while(--_0x5da5c4){_0x3ab0f1['push'](_0x3ab0f1['shift']());}};_0x2c2fb8(++_0x31acba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1c1e7c,_0x1dd5f1){var _0xa63a7b=function(_0x5d5040){while(--_0x5d5040){_0x1c1e7c['push'](_0x1c1e7c['shift']());}};_0xa63a7b(++_0x1dd5f1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2f0057,_0x448b27){_0x2f0057=_0x2f0057-0x0;var _0x17f2c3=_0xcb91[_0x2f0057];return _0x17f2c3;};'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 diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 4f732dd..abb518f 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 _0x29ae=['sequelize'];(function(_0x4c4437,_0x219746){var _0xa13e08=function(_0xb32edd){while(--_0xb32edd){_0x4c4437['push'](_0x4c4437['shift']());}};_0xa13e08(++_0x219746);}(_0x29ae,0x167));var _0xe29a=function(_0x3b127f,_0x4e2eb4){_0x3b127f=_0x3b127f-0x0;var _0x1d7329=_0x29ae[_0x3b127f];return _0x1d7329;};'use strict';var Sequelize=require(_0xe29a('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x164f=['exports','INTEGER'];(function(_0xb5e63b,_0x3de88f){var _0x184f50=function(_0x235c28){while(--_0x235c28){_0xb5e63b['push'](_0xb5e63b['shift']());}};_0x184f50(++_0x3de88f);}(_0x164f,0x186));var _0xf164=function(_0x36435f,_0x3398ba){_0x36435f=_0x36435f-0x0;var _0x1ada4f=_0x164f[_0x36435f];return _0x1ada4f;};'use strict';var Sequelize=require('sequelize');module[_0xf164('0x0')]={'penalty':{'type':Sequelize[_0xf164('0x1')],'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 f3e8270..7115b2d 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 _0xaa3f=['rimraf','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x52cf14,_0x56bfee){var _0xfddeef=function(_0x511415){while(--_0x511415){_0x52cf14['push'](_0x52cf14['shift']());}};_0xfddeef(++_0x56bfee);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x55cd61,_0x3164d1){_0x55cd61=_0x55cd61-0x0;var _0x4c7080=_0xaa3f[_0x55cd61];return _0x4c7080;};'use strict';var _=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var logger=require(_0xfaa3('0x2'))(_0xfaa3('0x3'));var moment=require(_0xfaa3('0x4'));var BPromise=require(_0xfaa3('0x5'));var rp=require(_0xfaa3('0x6'));var fs=require('fs');var path=require(_0xfaa3('0x7'));var rimraf=require(_0xfaa3('0x8'));var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module[_0xfaa3('0x9')]=function(_0x4bac92,_0x3d09aa){return _0x4bac92[_0xfaa3('0xa')](_0xfaa3('0xb'),attributes,{'tableName':_0xfaa3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27a0=['define','UserSmsQueue','util','../../config/logger','api','moment','bluebird','./userSmsQueue.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x27a0,0xbf));var _0x027a=function(_0x6d2351,_0xdbf457){_0x6d2351=_0x6d2351-0x0;var _0x1b3e00=_0x27a0[_0x6d2351];return _0x1b3e00;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var logger=require(_0x027a('0x1'))(_0x027a('0x2'));var moment=require(_0x027a('0x3'));var BPromise=require(_0x027a('0x4'));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(_0x027a('0x5'));module[_0x027a('0x6')]=function(_0x137b09,_0x639bec){return _0x137b09[_0x027a('0x7')](_0x027a('0x8'),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 2ed3e93..8cc661c 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 _0x5ecb=['error','message','catch','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x60fb10,_0xd27019){var _0x1de1ef=function(_0x3e0eda){while(--_0x3e0eda){_0x60fb10['push'](_0x60fb10['shift']());}};_0x1de1ef(++_0xd27019);}(_0x5ecb,0x16b));var _0xb5ec=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0x5ecb[_0x4e5552];return _0x60a338;};'use strict';var _=require('lodash');var util=require(_0xb5ec('0x0'));var moment=require(_0xb5ec('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb5ec('0x2'));var logger=require(_0xb5ec('0x3'))(_0xb5ec('0x4'));var config=require(_0xb5ec('0x5'));var jayson=require(_0xb5ec('0x6'));var client=jayson[_0xb5ec('0x7')][_0xb5ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19a68e,_0x28dc19,_0x3032dd){return new BPromise(function(_0x361dc1,_0x46e1f1){return client[_0xb5ec('0x9')](_0x19a68e,_0x3032dd)[_0xb5ec('0xa')](function(_0x30542f){logger[_0xb5ec('0xb')](_0xb5ec('0xc'),_0x28dc19,'request\x20sent');logger[_0xb5ec('0xd')](_0xb5ec('0xe'),_0x28dc19,_0xb5ec('0xf'),JSON[_0xb5ec('0x10')](_0x30542f));if(_0x30542f[_0xb5ec('0x11')]){if(_0x30542f[_0xb5ec('0x11')]['code']===0x1f4){logger[_0xb5ec('0x11')](_0xb5ec('0xc'),_0x28dc19,_0x30542f[_0xb5ec('0x11')][_0xb5ec('0x12')]);return _0x46e1f1(_0x30542f[_0xb5ec('0x11')][_0xb5ec('0x12')]);}logger[_0xb5ec('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x28dc19,_0x30542f['error'][_0xb5ec('0x12')]);return _0x361dc1(_0x30542f[_0xb5ec('0x11')][_0xb5ec('0x12')]);}else{logger[_0xb5ec('0xb')](_0xb5ec('0xc'),_0x28dc19,_0xb5ec('0xf'));_0x361dc1(_0x30542f['result'][_0xb5ec('0x12')]);}})[_0xb5ec('0x13')](function(_0xc99c23){logger[_0xb5ec('0x11')](_0xb5ec('0xc'),_0x28dc19,_0xc99c23);_0x46e1f1(_0xc99c23);});});} \ No newline at end of file +var _0x340c=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x5beb32,_0x1112f4){var _0x28b56c=function(_0x3ff3f9){while(--_0x3ff3f9){_0x5beb32['push'](_0x5beb32['shift']());}};_0x28b56c(++_0x1112f4);}(_0x340c,0xb9));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc340('0x0'));var util=require('util');var moment=require(_0xc340('0x1'));var BPromise=require(_0xc340('0x2'));var rs=require(_0xc340('0x3'));var fs=require('fs');var Redis=require(_0xc340('0x4'));var db=require(_0xc340('0x5'))['db'];var utils=require(_0xc340('0x6'));var logger=require(_0xc340('0x7'))(_0xc340('0x8'));var config=require(_0xc340('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc340('0xa')][_0xc340('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x166720,_0x34cf48,_0x411da9){return new BPromise(function(_0x19a0d7,_0x15245d){return client[_0xc340('0xc')](_0x166720,_0x411da9)[_0xc340('0xd')](function(_0x53edb4){logger[_0xc340('0xe')](_0xc340('0xf'),_0x34cf48,_0xc340('0x10'));logger['debug'](_0xc340('0x11'),_0x34cf48,_0xc340('0x10'),JSON[_0xc340('0x12')](_0x53edb4));if(_0x53edb4['error']){if(_0x53edb4[_0xc340('0x13')]['code']===0x1f4){logger[_0xc340('0x13')](_0xc340('0xf'),_0x34cf48,_0x53edb4[_0xc340('0x13')][_0xc340('0x14')]);return _0x15245d(_0x53edb4[_0xc340('0x13')][_0xc340('0x14')]);}logger[_0xc340('0x13')](_0xc340('0xf'),_0x34cf48,_0x53edb4[_0xc340('0x13')][_0xc340('0x14')]);return _0x19a0d7(_0x53edb4[_0xc340('0x13')][_0xc340('0x14')]);}else{logger[_0xc340('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x34cf48,_0xc340('0x10'));_0x19a0d7(_0x53edb4[_0xc340('0x15')][_0xc340('0x14')]);}})[_0xc340('0x16')](function(_0x302ead){logger['error'](_0xc340('0xf'),_0x34cf48,_0x302ead);_0x15245d(_0x302ead);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index a866e57..8ecc81d 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 _0x9910=['INTEGER'];(function(_0x5b2c7e,_0x3d22f0){var _0x5ec399=function(_0x1a87ad){while(--_0x1a87ad){_0x5b2c7e['push'](_0x5b2c7e['shift']());}};_0x5ec399(++_0x3d22f0);}(_0x9910,0xa6));var _0x0991=function(_0x48fe88,_0x13c295){_0x48fe88=_0x48fe88-0x0;var _0x4f6ef0=_0x9910[_0x48fe88];return _0x4f6ef0;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize[_0x0991('0x0')]},'VoicePrefixId':{'type':Sequelize[_0x0991('0x0')]}}; \ No newline at end of file +var _0x5636=['INTEGER','sequelize','exports'];(function(_0x58b98b,_0x4cda65){var _0x488af6=function(_0x1a37c6){while(--_0x1a37c6){_0x58b98b['push'](_0x58b98b['shift']());}};_0x488af6(++_0x4cda65);}(_0x5636,0x11b));var _0x6563=function(_0xa5db7d,_0x3e3cee){_0xa5db7d=_0xa5db7d-0x0;var _0x2e2a4d=_0x5636[_0xa5db7d];return _0x2e2a4d;};'use strict';var Sequelize=require(_0x6563('0x0'));module[_0x6563('0x1')]={'UserId':{'type':Sequelize[_0x6563('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x6563('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 38fe88a..16d98b5 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(_0x21bc9b,_0x5db559){var _0xc829e3=function(_0x587b4d){while(--_0x587b4d){_0x21bc9b['push'](_0x21bc9b['shift']());}};_0xc829e3(++_0x5db559);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0xc95197,_0x3e58da){var _0x5161f6=function(_0x123fcd){while(--_0x123fcd){_0xc95197['push'](_0xc95197['shift']());}};_0x5161f6(++_0x3e58da);}(_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 diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 8382460..593c048 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5b6375,_0x563718){var _0x4045b4=function(_0x314db8){while(--_0x314db8){_0x5b6375['push'](_0x5b6375['shift']());}};_0x4045b4(++_0x563718);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x577333,_0x85b2a7){var _0x208b88=function(_0x530b12){while(--_0x530b12){_0x577333['push'](_0x577333['shift']());}};_0x208b88(++_0x85b2a7);}(_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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 3105088..5fcb101 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 _0xaf07=['sequelize','exports','INTEGER'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xaf07,0x117));var _0x7af0=function(_0x21370f,_0x3ec224){_0x21370f=_0x21370f-0x0;var _0x455257=_0xaf07[_0x21370f];return _0x455257;};'use strict';var Sequelize=require(_0x7af0('0x0'));module[_0x7af0('0x1')]={'penalty':{'type':Sequelize[_0x7af0('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcd98=['INTEGER','sequelize','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xcd98,0x1cc));var _0x8cd9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd98[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8cd9('0x0'));module[_0x8cd9('0x1')]={'penalty':{'type':Sequelize[_0x8cd9('0x2')],'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 2258dae..aa70ea8 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 _0x1339=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','UserVoiceQueue','user_has_voice_queues','../../config/logger','api'];(function(_0x2778bb,_0x26e882){var _0x316daa=function(_0x26f317){while(--_0x26f317){_0x2778bb['push'](_0x2778bb['shift']());}};_0x316daa(++_0x26e882);}(_0x1339,0x1ed));var _0x9133=function(_0x29d9c1,_0x2745c2){_0x29d9c1=_0x29d9c1-0x0;var _0x1b7b3f=_0x1339[_0x29d9c1];return _0x1b7b3f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var fs=require('fs');var path=require(_0x9133('0x5'));var rimraf=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var attributes=require('./userVoiceQueue.attributes');module[_0x9133('0x8')]=function(_0x855473,_0x379915){return _0x855473['define'](_0x9133('0x9'),attributes,{'tableName':_0x9133('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x672e=['rimraf','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3e0fa4,_0x292a53){var _0xb7dc73=function(_0x5ea825){while(--_0x5ea825){_0x3e0fa4['push'](_0x3e0fa4['shift']());}};_0xb7dc73(++_0x292a53);}(_0x672e,0x1f1));var _0xe672=function(_0x31e63f,_0x512a84){_0x31e63f=_0x31e63f-0x0;var _0x453876=_0x672e[_0x31e63f];return _0x453876;};'use strict';var _=require(_0xe672('0x0'));var util=require(_0xe672('0x1'));var logger=require(_0xe672('0x2'))('api');var moment=require(_0xe672('0x3'));var BPromise=require(_0xe672('0x4'));var rp=require(_0xe672('0x5'));var fs=require('fs');var path=require(_0xe672('0x6'));var rimraf=require(_0xe672('0x7'));var config=require('../../config/environment');var attributes=require(_0xe672('0x8'));module[_0xe672('0x9')]=function(_0x396cbc,_0x3f46a7){return _0x396cbc['define'](_0xe672('0xa'),attributes,{'tableName':_0xe672('0xb'),'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 393df26..37f9347 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 _0x753a=['client','http','request','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x753a,0x137));var _0xa753=function(_0x290ab2,_0x1af455){_0x290ab2=_0x290ab2-0x0;var _0x4a70f4=_0x753a[_0x290ab2];return _0x4a70f4;};'use strict';var _=require(_0xa753('0x0'));var util=require(_0xa753('0x1'));var moment=require(_0xa753('0x2'));var BPromise=require(_0xa753('0x3'));var rs=require(_0xa753('0x4'));var fs=require('fs');var Redis=require(_0xa753('0x5'));var db=require(_0xa753('0x6'))['db'];var utils=require(_0xa753('0x7'));var logger=require(_0xa753('0x8'))(_0xa753('0x9'));var config=require('../../config/environment');var jayson=require(_0xa753('0xa'));var client=jayson[_0xa753('0xb')][_0xa753('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x66b2ad,_0x53c1c0,_0x36b814){return new BPromise(function(_0x260c81,_0xb857c0){return client[_0xa753('0xd')](_0x66b2ad,_0x36b814)['then'](function(_0x21984f){logger['info'](_0xa753('0xe'),_0x53c1c0,_0xa753('0xf'));logger[_0xa753('0x10')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x53c1c0,_0xa753('0xf'),JSON[_0xa753('0x11')](_0x21984f));if(_0x21984f[_0xa753('0x12')]){if(_0x21984f[_0xa753('0x12')][_0xa753('0x13')]===0x1f4){logger['error'](_0xa753('0xe'),_0x53c1c0,_0x21984f['error'][_0xa753('0x14')]);return _0xb857c0(_0x21984f[_0xa753('0x12')][_0xa753('0x14')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x53c1c0,_0x21984f[_0xa753('0x12')][_0xa753('0x14')]);return _0x260c81(_0x21984f[_0xa753('0x12')][_0xa753('0x14')]);}else{logger[_0xa753('0x15')]('UserVoiceQueue,\x20%s,\x20%s',_0x53c1c0,_0xa753('0xf'));_0x260c81(_0x21984f[_0xa753('0x16')][_0xa753('0x14')]);}})['catch'](function(_0x29050b){logger[_0xa753('0x12')](_0xa753('0xe'),_0x53c1c0,_0x29050b);_0xb857c0(_0x29050b);});});} \ No newline at end of file +var _0xaebe=['../../mysqldb','../../config/environment','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xaebe,0xaf));var _0xeaeb=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xaebe[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0xeaeb('0x0'));var util=require('util');var moment=require(_0xeaeb('0x1'));var BPromise=require(_0xeaeb('0x2'));var rs=require(_0xeaeb('0x3'));var fs=require('fs');var Redis=require(_0xeaeb('0x4'));var db=require(_0xeaeb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xeaeb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xeaeb('0x7')][_0xeaeb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c6e2c,_0x4dc2,_0x1c7335){return new BPromise(function(_0x2dbfc3,_0x33f637){return client[_0xeaeb('0x9')](_0x5c6e2c,_0x1c7335)[_0xeaeb('0xa')](function(_0x1db3a9){logger['info'](_0xeaeb('0xb'),_0x4dc2,_0xeaeb('0xc'));logger['debug'](_0xeaeb('0xd'),_0x4dc2,'request\x20sent',JSON[_0xeaeb('0xe')](_0x1db3a9));if(_0x1db3a9[_0xeaeb('0xf')]){if(_0x1db3a9[_0xeaeb('0xf')]['code']===0x1f4){logger[_0xeaeb('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x4dc2,_0x1db3a9[_0xeaeb('0xf')][_0xeaeb('0x10')]);return _0x33f637(_0x1db3a9['error'][_0xeaeb('0x10')]);}logger[_0xeaeb('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x4dc2,_0x1db3a9[_0xeaeb('0xf')][_0xeaeb('0x10')]);return _0x2dbfc3(_0x1db3a9[_0xeaeb('0xf')]['message']);}else{logger[_0xeaeb('0x11')](_0xeaeb('0xb'),_0x4dc2,_0xeaeb('0xc'));_0x2dbfc3(_0x1db3a9[_0xeaeb('0x12')]['message']);}})[_0xeaeb('0x13')](function(_0xb7bf66){logger[_0xeaeb('0xf')](_0xeaeb('0xb'),_0x4dc2,_0xb7bf66);_0x33f637(_0xb7bf66);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index b720bb4..8365aba 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x55f47b,_0x58b84b){var _0x163c2e=function(_0x1662b6){while(--_0x1662b6){_0x55f47b['push'](_0x55f47b['shift']());}};_0x163c2e(++_0x58b84b);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3c7771,_0x2ff214){var _0xc4ca06=function(_0x169b00){while(--_0x169b00){_0x3c7771['push'](_0x3c7771['shift']());}};_0xc4ca06(++_0x2ff214);}(_0xe706,0xa3));var _0x6e70=function(_0x470170,_0x454483){_0x470170=_0x470170-0x0;var _0x2cc1cc=_0xe706[_0x470170];return _0x2cc1cc;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 42972fb..af2bace 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 _0x5574=['queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5574,0x169));var _0x4557=function(_0x322584,_0x4b72fe){_0x322584=_0x322584-0x0;var _0x47f8f6=_0x5574[_0x322584];return _0x47f8f6;};'use strict';var Sequelize=require(_0x4557('0x0'));module[_0x4557('0x1')]={'uniqueid':{'type':Sequelize[_0x4557('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x4557('0x3')},'membername':{'type':Sequelize[_0x4557('0x4')],'allowNull':![],'comment':_0x4557('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x4557('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x4557('0x3')},'VoiceQueueId':{'type':Sequelize[_0x4557('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x4557('0x4')],'allowNull':![],'unique':_0x4557('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x4557('0x2')](0xb),'defaultValue':0x0,'comment':_0x4557('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x4557('0x3')}}; \ No newline at end of file +var _0xaef9=['Required\x20by\x20Asterisk','STRING','queue_interface','INTEGER'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xaef9,0x13b));var _0x9aef=function(_0x36047d,_0x1eddc3){_0x36047d=_0x36047d-0x0;var _0x5000fe=_0xaef9[_0x36047d];return _0x5000fe;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x9aef('0x0')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x9aef('0x1')},'membername':{'type':Sequelize[_0x9aef('0x2')],'allowNull':![],'comment':_0x9aef('0x1')},'UserId':{'type':Sequelize[_0x9aef('0x0')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x9aef('0x2')],'allowNull':![],'unique':_0x9aef('0x3'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9aef('0x3'),'comment':_0x9aef('0x1')},'penalty':{'type':Sequelize[_0x9aef('0x0')](0xb),'defaultValue':0x0,'comment':_0x9aef('0x1')},'paused':{'type':Sequelize[_0x9aef('0x0')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index c03a5b1..daf90b4 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 _0xa9e4=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x56a8bd,_0x17e126){var _0x302c11=function(_0x211c7d){while(--_0x211c7d){_0x56a8bd['push'](_0x56a8bd['shift']());}};_0x302c11(++_0x17e126);}(_0xa9e4,0xa6));var _0x4a9e=function(_0x55eb7c,_0x45cd81){_0x55eb7c=_0x55eb7c-0x0;var _0x132fe8=_0xa9e4[_0x55eb7c];return _0x132fe8;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x4a9e('0x0'))['db'][_0x4a9e('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4a9e('0x2')](0x0);var events={'afterCreate':_0x4a9e('0x3'),'afterUpdate':_0x4a9e('0x4'),'afterDestroy':_0x4a9e('0x5')};function emitEvent(_0x57f75b){return function(_0x242734,_0x5aa69b,_0x26346d){UserVoiceQueueRtEvents[_0x4a9e('0x6')](_0x57f75b+':'+_0x242734['id'],_0x242734);UserVoiceQueueRtEvents[_0x4a9e('0x6')](_0x57f75b,_0x242734);_0x26346d(null);};}for(var e in events){if(events[_0x4a9e('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x4a9e('0x8')](e,emitEvent(event));}}module[_0x4a9e('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xcdb5=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xcdb5,0x7e));var _0x5cdb=function(_0x5d88be,_0x5a9a0d){_0x5d88be=_0x5d88be-0x0;var _0x27b2e7=_0xcdb5[_0x5d88be];return _0x27b2e7;};'use strict';var EventEmitter=require(_0x5cdb('0x0'));var UserVoiceQueueRt=require(_0x5cdb('0x1'))['db'][_0x5cdb('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x5cdb('0x3')](0x0);var events={'afterCreate':_0x5cdb('0x4'),'afterUpdate':_0x5cdb('0x5'),'afterDestroy':_0x5cdb('0x6')};function emitEvent(_0x528726){return function(_0x40c31f,_0x3f34f5,_0x21ca15){UserVoiceQueueRtEvents[_0x5cdb('0x7')](_0x528726+':'+_0x40c31f['id'],_0x40c31f);UserVoiceQueueRtEvents[_0x5cdb('0x7')](_0x528726,_0x40c31f);_0x21ca15(null);};}for(var e in events){if(events[_0x5cdb('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0x5cdb('0x9')](e,emitEvent(event));}}module[_0x5cdb('0xa')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 45f5bc4..add8b44 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 _0x86d1=['request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','lodash','util','../../config/logger','moment'];(function(_0x76b1b9,_0x5c2746){var _0x3e0959=function(_0x53df8a){while(--_0x53df8a){_0x76b1b9['push'](_0x76b1b9['shift']());}};_0x3e0959(++_0x5c2746);}(_0x86d1,0x19c));var _0x186d=function(_0x5af74a,_0x460881){_0x5af74a=_0x5af74a-0x0;var _0x2e93c3=_0x86d1[_0x5af74a];return _0x2e93c3;};'use strict';var _=require(_0x186d('0x0'));var util=require(_0x186d('0x1'));var logger=require(_0x186d('0x2'))('api');var moment=require(_0x186d('0x3'));var BPromise=require('bluebird');var rp=require(_0x186d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x186d('0x5'));var config=require(_0x186d('0x6'));var attributes=require(_0x186d('0x7'));module['exports']=function(_0x1f4ad9,_0x370a82){return _0x1f4ad9['define']('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae3f=['./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x53be8d,_0x2cb53f){var _0x396d2c=function(_0x389878){while(--_0x389878){_0x53be8d['push'](_0x53be8d['shift']());}};_0x396d2c(++_0x2cb53f);}(_0xae3f,0x88));var _0xfae3=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xae3f[_0x59d89e];return _0x554e93;};'use strict';var _=require(_0xfae3('0x0'));var util=require('util');var logger=require(_0xfae3('0x1'))(_0xfae3('0x2'));var moment=require(_0xfae3('0x3'));var BPromise=require(_0xfae3('0x4'));var rp=require(_0xfae3('0x5'));var fs=require('fs');var path=require(_0xfae3('0x6'));var rimraf=require('rimraf');var config=require(_0xfae3('0x7'));var attributes=require(_0xfae3('0x8'));module[_0xfae3('0x9')]=function(_0x2ab6a9,_0x52f25e){return _0x2ab6a9['define'](_0xfae3('0xa'),attributes,{'tableName':_0xfae3('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 957a854..3b55671 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 _0xea2d=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0xd5a2f6,_0x41a397){var _0x11ba7c=function(_0x5bdc5f){while(--_0x5bdc5f){_0xd5a2f6['push'](_0xd5a2f6['shift']());}};_0x11ba7c(++_0x41a397);}(_0xea2d,0xe8));var _0xdea2=function(_0x4b8f7a,_0xfa9f8e){_0x4b8f7a=_0x4b8f7a-0x0;var _0x491f42=_0xea2d[_0x4b8f7a];return _0x491f42;};'use strict';var _=require(_0xdea2('0x0'));var util=require(_0xdea2('0x1'));var moment=require(_0xdea2('0x2'));var BPromise=require(_0xdea2('0x3'));var rs=require(_0xdea2('0x4'));var fs=require('fs');var Redis=require(_0xdea2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdea2('0x6'));var logger=require(_0xdea2('0x7'))(_0xdea2('0x8'));var config=require(_0xdea2('0x9'));var jayson=require(_0xdea2('0xa'));var client=jayson[_0xdea2('0xb')][_0xdea2('0xc')]({'port':0x232a});config[_0xdea2('0xd')]=_['defaults'](config[_0xdea2('0xd')],{'host':_0xdea2('0xe'),'port':0x18eb});var socket=require(_0xdea2('0xf'))(new Redis(config[_0xdea2('0xd')]));require(_0xdea2('0x10'))[_0xdea2('0x11')](socket);function respondWithRpcPromise(_0x535424,_0xa50773,_0x15044c){return new BPromise(function(_0x11f497,_0x5df679){return client['request'](_0x535424,_0x15044c)['then'](function(_0x3f9e1e){logger[_0xdea2('0x12')](_0xdea2('0x13'),_0xa50773,_0xdea2('0x14'));logger[_0xdea2('0x15')](_0xdea2('0x16'),_0xa50773,_0xdea2('0x14'),JSON[_0xdea2('0x17')](_0x3f9e1e));if(_0x3f9e1e['error']){if(_0x3f9e1e[_0xdea2('0x18')][_0xdea2('0x19')]===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0xa50773,_0x3f9e1e[_0xdea2('0x18')][_0xdea2('0x1a')]);return _0x5df679(_0x3f9e1e[_0xdea2('0x18')][_0xdea2('0x1a')]);}logger[_0xdea2('0x18')](_0xdea2('0x13'),_0xa50773,_0x3f9e1e['error'][_0xdea2('0x1a')]);return _0x11f497(_0x3f9e1e[_0xdea2('0x18')]['message']);}else{logger[_0xdea2('0x12')](_0xdea2('0x13'),_0xa50773,_0xdea2('0x14'));_0x11f497(_0x3f9e1e[_0xdea2('0x1b')]['message']);}})[_0xdea2('0x1c')](function(_0x51db5f){logger[_0xdea2('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xa50773,_0x51db5f);_0x5df679(_0x51db5f);});});}exports[_0xdea2('0x1d')]=function(_0x585f3a){var _0xa7cc1a=this;return new Promise(function(_0x3baac0,_0xc74420){return db[_0xdea2('0x1e')][_0xdea2('0x1f')]({'raw':_0x585f3a[_0xdea2('0x20')]?_0x585f3a[_0xdea2('0x20')][_0xdea2('0x21')]===undefined?!![]:![]:!![],'where':_0x585f3a['options']?_0x585f3a[_0xdea2('0x20')][_0xdea2('0x22')]||null:null,'attributes':[[db[_0xdea2('0x23')]['fn']('COUNT',db[_0xdea2('0x23')]['fn']('IF',db[_0xdea2('0x23')][_0xdea2('0x24')](_0xdea2('0x25')))),_0xdea2('0x26')]]})[_0xdea2('0x27')](function(_0x3eea75){logger['info']('GetVoiceQueueRtPauses',_0x585f3a);logger[_0xdea2('0x15')](_0xdea2('0x1d'),_0x585f3a,JSON['stringify'](_0x3eea75));_0x3baac0(_0x3eea75);})[_0xdea2('0x1c')](function(_0x103a72){logger[_0xdea2('0x18')]('GetVoiceQueueRtPauses',_0x103a72[_0xdea2('0x1a')],_0x585f3a);_0xc74420(_0xa7cc1a[_0xdea2('0x18')](0x1f4,_0x103a72[_0xdea2('0x1a')]));});});}; \ No newline at end of file +var _0xba8a=['code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','literal','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x132ca7,_0x5d744d){var _0x3a3cb9=function(_0x71de96){while(--_0x71de96){_0x132ca7['push'](_0x132ca7['shift']());}};_0x3a3cb9(++_0x5d744d);}(_0xba8a,0xf1));var _0xaba8=function(_0x3dd92b,_0x4d1139){_0x3dd92b=_0x3dd92b-0x0;var _0x5e1d23=_0xba8a[_0x3dd92b];return _0x5e1d23;};'use strict';var _=require(_0xaba8('0x0'));var util=require(_0xaba8('0x1'));var moment=require(_0xaba8('0x2'));var BPromise=require(_0xaba8('0x3'));var rs=require(_0xaba8('0x4'));var fs=require('fs');var Redis=require(_0xaba8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaba8('0x6'));var logger=require(_0xaba8('0x7'))(_0xaba8('0x8'));var config=require(_0xaba8('0x9'));var jayson=require(_0xaba8('0xa'));var client=jayson[_0xaba8('0xb')][_0xaba8('0xc')]({'port':0x232a});config[_0xaba8('0xd')]=_[_0xaba8('0xe')](config['redis'],{'host':_0xaba8('0xf'),'port':0x18eb});var socket=require(_0xaba8('0x10'))(new Redis(config[_0xaba8('0xd')]));require(_0xaba8('0x11'))['register'](socket);function respondWithRpcPromise(_0x2a539c,_0x46b549,_0x463c0b){return new BPromise(function(_0x26ead9,_0x3a65a5){return client[_0xaba8('0x12')](_0x2a539c,_0x463c0b)[_0xaba8('0x13')](function(_0x25441d){logger[_0xaba8('0x14')](_0xaba8('0x15'),_0x46b549,_0xaba8('0x16'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x46b549,'request\x20sent',JSON[_0xaba8('0x17')](_0x25441d));if(_0x25441d[_0xaba8('0x18')]){if(_0x25441d[_0xaba8('0x18')][_0xaba8('0x19')]===0x1f4){logger['error'](_0xaba8('0x15'),_0x46b549,_0x25441d['error'][_0xaba8('0x1a')]);return _0x3a65a5(_0x25441d[_0xaba8('0x18')][_0xaba8('0x1a')]);}logger[_0xaba8('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x46b549,_0x25441d[_0xaba8('0x18')][_0xaba8('0x1a')]);return _0x26ead9(_0x25441d[_0xaba8('0x18')]['message']);}else{logger[_0xaba8('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x46b549,_0xaba8('0x16'));_0x26ead9(_0x25441d[_0xaba8('0x1b')]['message']);}})[_0xaba8('0x1c')](function(_0x1c48cb){logger[_0xaba8('0x18')](_0xaba8('0x15'),_0x46b549,_0x1c48cb);_0x3a65a5(_0x1c48cb);});});}exports[_0xaba8('0x1d')]=function(_0x4b4207){var _0x504f15=this;return new Promise(function(_0x29cb87,_0x418172){return db[_0xaba8('0x1e')][_0xaba8('0x1f')]({'raw':_0x4b4207[_0xaba8('0x20')]?_0x4b4207[_0xaba8('0x20')][_0xaba8('0x21')]===undefined?!![]:![]:!![],'where':_0x4b4207[_0xaba8('0x20')]?_0x4b4207[_0xaba8('0x20')]['where']||null:null,'attributes':[[db[_0xaba8('0x22')]['fn'](_0xaba8('0x23'),db[_0xaba8('0x22')]['fn']('IF',db[_0xaba8('0x22')][_0xaba8('0x24')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0xaba8('0x13')](function(_0x1c9c3d){logger[_0xaba8('0x14')](_0xaba8('0x1d'),_0x4b4207);logger[_0xaba8('0x25')](_0xaba8('0x1d'),_0x4b4207,JSON[_0xaba8('0x17')](_0x1c9c3d));_0x29cb87(_0x1c9c3d);})[_0xaba8('0x1c')](function(_0x483afc){logger['error'](_0xaba8('0x1d'),_0x483afc['message'],_0x4b4207);_0x418172(_0x504f15['error'](0x1f4,_0x483afc[_0xaba8('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 789a5bb..4e4890c 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 _0x5aaa=['./userVoiceQueueRt.events','emit','removeListener','register','length'];(function(_0x4a1c47,_0x22922e){var _0x206d85=function(_0x15397f){while(--_0x15397f){_0x4a1c47['push'](_0x4a1c47['shift']());}};_0x206d85(++_0x22922e);}(_0x5aaa,0xff));var _0xa5aa=function(_0x307848,_0x44264c){_0x307848=_0x307848-0x0;var _0x3d2a85=_0x5aaa[_0x307848];return _0x3d2a85;};'use strict';var UserVoiceQueueRtEvents=require(_0xa5aa('0x0'));var events=['save','remove','update'];function createListener(_0x59ccda,_0x4926c9){return function(_0x128d2a){_0x4926c9[_0xa5aa('0x1')](_0x59ccda,_0x128d2a);};}function removeListener(_0x473061,_0x54ca19){return function(){UserVoiceQueueRtEvents[_0xa5aa('0x2')](_0x473061,_0x54ca19);};}exports[_0xa5aa('0x3')]=function(_0x5e1865){for(var _0x21d216=0x0,_0x143817=events[_0xa5aa('0x4')];_0x21d216<_0x143817;_0x21d216++){var _0x2c0b72=events[_0x21d216];var _0x5574aa=createListener('userVoiceQueueRt:'+_0x2c0b72,_0x5e1865);UserVoiceQueueRtEvents['on'](_0x2c0b72,_0x5574aa);}}; \ No newline at end of file +var _0x6b8f=['save','update','emit','removeListener','register','length'];(function(_0x5f0876,_0x5160c3){var _0x43c1b2=function(_0x5479c1){while(--_0x5479c1){_0x5f0876['push'](_0x5f0876['shift']());}};_0x43c1b2(++_0x5160c3);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x2cc34b,_0x271b47){_0x2cc34b=_0x2cc34b-0x0;var _0x14c913=_0x6b8f[_0x2cc34b];return _0x14c913;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xf6b8('0x0'),'remove',_0xf6b8('0x1')];function createListener(_0x4e006e,_0x5443a1){return function(_0x362c27){_0x5443a1[_0xf6b8('0x2')](_0x4e006e,_0x362c27);};}function removeListener(_0x4d0ee5,_0x2b5ca9){return function(){UserVoiceQueueRtEvents[_0xf6b8('0x3')](_0x4d0ee5,_0x2b5ca9);};}exports[_0xf6b8('0x4')]=function(_0x549eac){for(var _0x2d035e=0x0,_0x79c66d=events[_0xf6b8('0x5')];_0x2d035e<_0x79c66d;_0x2d035e++){var _0x3c3430=events[_0x2d035e];var _0x557910=createListener('userVoiceQueueRt:'+_0x3c3430,_0x549eac);UserVoiceQueueRtEvents['on'](_0x3c3430,_0x557910);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 3faf0b2..65650e3 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3c91bb,_0x191fbe){var _0x5e3abf=function(_0x5f30c6){while(--_0x5f30c6){_0x3c91bb['push'](_0x3c91bb['shift']());}};_0x5e3abf(++_0x191fbe);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x225065,_0x7efe2){var _0x5ccbac=function(_0x416a23){while(--_0x416a23){_0x225065['push'](_0x225065['shift']());}};_0x5ccbac(++_0x7efe2);}(_0xe706,0xa3));var _0x6e70=function(_0x150a49,_0x47b070){_0x150a49=_0x150a49-0x0;var _0xe8c345=_0xe706[_0x150a49];return _0xe8c345;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 70f288c..0d7a005 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 _0x0988=['sequelize','exports','INTEGER'];(function(_0x5b9f7f,_0x4c93ff){var _0x49707a=function(_0x5be2cc){while(--_0x5be2cc){_0x5b9f7f['push'](_0x5b9f7f['shift']());}};_0x49707a(++_0x4c93ff);}(_0x0988,0x10e));var _0x8098=function(_0x1f9862,_0x1047d7){_0x1f9862=_0x1f9862-0x0;var _0x5c41b0=_0x0988[_0x1f9862];return _0x5c41b0;};'use strict';var Sequelize=require(_0x8098('0x0'));module[_0x8098('0x1')]={'penalty':{'type':Sequelize[_0x8098('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9787=['exports','INTEGER','sequelize'];(function(_0x52ac28,_0x4b92b5){var _0x1dfa82=function(_0x1cd4ce){while(--_0x1cd4ce){_0x52ac28['push'](_0x52ac28['shift']());}};_0x1dfa82(++_0x4b92b5);}(_0x9787,0x122));var _0x7978=function(_0x30f87a,_0x2cce5a){_0x30f87a=_0x30f87a-0x0;var _0x3a8efc=_0x9787[_0x30f87a];return _0x3a8efc;};'use strict';var Sequelize=require(_0x7978('0x0'));module[_0x7978('0x1')]={'penalty':{'type':Sequelize[_0x7978('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 c0027ea..d61f8bb 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 _0xba0a=['../../config/environment','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x12b683,_0x124186){var _0xfb150b=function(_0x565ce7){while(--_0x565ce7){_0x12b683['push'](_0x12b683['shift']());}};_0xfb150b(++_0x124186);}(_0xba0a,0x1e3));var _0xaba0=function(_0x559add,_0x153177){_0x559add=_0x559add-0x0;var _0x1892af=_0xba0a[_0x559add];return _0x1892af;};'use strict';var _=require(_0xaba0('0x0'));var util=require('util');var logger=require(_0xaba0('0x1'))(_0xaba0('0x2'));var moment=require(_0xaba0('0x3'));var BPromise=require(_0xaba0('0x4'));var rp=require(_0xaba0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaba0('0x6'));var config=require(_0xaba0('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0xaba0('0x8')]=function(_0x17452c,_0x452504){return _0x17452c[_0xaba0('0x9')]('UserWhatsappQueue',attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27da=['api','moment','path','../../config/environment','exports','UserWhatsappQueue','lodash','util'];(function(_0x372056,_0x389c31){var _0x127aa2=function(_0x3900a5){while(--_0x3900a5){_0x372056['push'](_0x372056['shift']());}};_0x127aa2(++_0x389c31);}(_0x27da,0x116));var _0xa27d=function(_0x34ef7e,_0x21399f){_0x34ef7e=_0x34ef7e-0x0;var _0x26164c=_0x27da[_0x34ef7e];return _0x26164c;};'use strict';var _=require(_0xa27d('0x0'));var util=require(_0xa27d('0x1'));var logger=require('../../config/logger')(_0xa27d('0x2'));var moment=require(_0xa27d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa27d('0x4'));var rimraf=require('rimraf');var config=require(_0xa27d('0x5'));var attributes=require('./userWhatsappQueue.attributes');module[_0xa27d('0x6')]=function(_0x5509ac,_0x1824e1){return _0x5509ac['define'](_0xa27d('0x7'),attributes,{'tableName':'user_has_whatsapp_queues','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 328260a..f566e51 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 _0x76bc=['info','UserWhatsappQueue,\x20%s,\x20%s','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x76bc,0xed));var _0xc76b=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x76bc[_0x455c6c];return _0x488242;};'use strict';var _=require('lodash');var util=require(_0xc76b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc76b('0x1'));var db=require(_0xc76b('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xc76b('0x3'))(_0xc76b('0x4'));var config=require(_0xc76b('0x5'));var jayson=require(_0xc76b('0x6'));var client=jayson[_0xc76b('0x7')][_0xc76b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19c152,_0x5e5f59,_0x1bcafa){return new BPromise(function(_0x19199c,_0x41eb17){return client[_0xc76b('0x9')](_0x19c152,_0x1bcafa)['then'](function(_0x4b8af1){logger[_0xc76b('0xa')](_0xc76b('0xb'),_0x5e5f59,'request\x20sent');logger['debug'](_0xc76b('0xc'),_0x5e5f59,_0xc76b('0xd'),JSON[_0xc76b('0xe')](_0x4b8af1));if(_0x4b8af1[_0xc76b('0xf')]){if(_0x4b8af1['error'][_0xc76b('0x10')]===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x5e5f59,_0x4b8af1['error']['message']);return _0x41eb17(_0x4b8af1[_0xc76b('0xf')]['message']);}logger[_0xc76b('0xf')](_0xc76b('0xb'),_0x5e5f59,_0x4b8af1[_0xc76b('0xf')]['message']);return _0x19199c(_0x4b8af1[_0xc76b('0xf')][_0xc76b('0x11')]);}else{logger[_0xc76b('0xa')](_0xc76b('0xb'),_0x5e5f59,_0xc76b('0xd'));_0x19199c(_0x4b8af1[_0xc76b('0x12')][_0xc76b('0x11')]);}})['catch'](function(_0x147f2d){logger[_0xc76b('0xf')](_0xc76b('0xb'),_0x5e5f59,_0x147f2d);_0x41eb17(_0x147f2d);});});} \ No newline at end of file +var _0xdb7b=['stringify','error','code','message','lodash','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x7def10,_0x8941f6){var _0x41f434=function(_0x2055dc){while(--_0x2055dc){_0x7def10['push'](_0x7def10['shift']());}};_0x41f434(++_0x8941f6);}(_0xdb7b,0xb4));var _0xbdb7=function(_0xb9c7ba,_0x4b2cd2){_0xb9c7ba=_0xb9c7ba-0x0;var _0xfb3eca=_0xdb7b[_0xb9c7ba];return _0xfb3eca;};'use strict';var _=require(_0xbdb7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbdb7('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbdb7('0x2'))(_0xbdb7('0x3'));var config=require(_0xbdb7('0x4'));var jayson=require(_0xbdb7('0x5'));var client=jayson['client'][_0xbdb7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2c2378,_0x5d5e36,_0x247874){return new BPromise(function(_0x4f3050,_0x24af1d){return client['request'](_0x2c2378,_0x247874)[_0xbdb7('0x7')](function(_0x3bf0d9){logger[_0xbdb7('0x8')](_0xbdb7('0x9'),_0x5d5e36,_0xbdb7('0xa'));logger[_0xbdb7('0xb')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x5d5e36,_0xbdb7('0xa'),JSON[_0xbdb7('0xc')](_0x3bf0d9));if(_0x3bf0d9[_0xbdb7('0xd')]){if(_0x3bf0d9[_0xbdb7('0xd')][_0xbdb7('0xe')]===0x1f4){logger[_0xbdb7('0xd')](_0xbdb7('0x9'),_0x5d5e36,_0x3bf0d9[_0xbdb7('0xd')][_0xbdb7('0xf')]);return _0x24af1d(_0x3bf0d9[_0xbdb7('0xd')][_0xbdb7('0xf')]);}logger[_0xbdb7('0xd')](_0xbdb7('0x9'),_0x5d5e36,_0x3bf0d9[_0xbdb7('0xd')][_0xbdb7('0xf')]);return _0x4f3050(_0x3bf0d9[_0xbdb7('0xd')][_0xbdb7('0xf')]);}else{logger[_0xbdb7('0x8')](_0xbdb7('0x9'),_0x5d5e36,_0xbdb7('0xa'));_0x4f3050(_0x3bf0d9['result'][_0xbdb7('0xf')]);}})['catch'](function(_0x30d70a){logger[_0xbdb7('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5d5e36,_0x30d70a);_0x24af1d(_0x30d70a);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 02f0a21..046608e 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 _0x2208=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated','get','/:id','show','post','put','update','delete','destroy','util','connect-timeout','Router'];(function(_0x85996e,_0xe2989e){var _0x19ab02=function(_0x4906d6){while(--_0x4906d6){_0x85996e['push'](_0x85996e['shift']());}};_0x19ab02(++_0xe2989e);}(_0x2208,0x11e));var _0x8220=function(_0x140410,_0x4806bd){_0x140410=_0x140410-0x0;var _0x14c739=_0x2208[_0x140410];return _0x14c739;};'use strict';var multer=require('multer');var util=require(_0x8220('0x0'));var path=require('path');var timeout=require(_0x8220('0x1'));var express=require('express');var router=express[_0x8220('0x2')]();var fs_extra=require(_0x8220('0x3'));var auth=require(_0x8220('0x4'));var interaction=require(_0x8220('0x5'));var config=require(_0x8220('0x6'));var controller=require(_0x8220('0x7'));router['get']('/',auth[_0x8220('0x8')](),controller['index']);router[_0x8220('0x9')](_0x8220('0xa'),auth[_0x8220('0x8')](),controller[_0x8220('0xb')]);router[_0x8220('0xc')]('/',auth[_0x8220('0x8')](),controller['create']);router[_0x8220('0xd')](_0x8220('0xa'),auth['isAuthenticated'](),controller[_0x8220('0xe')]);router[_0x8220('0xf')](_0x8220('0xa'),auth[_0x8220('0x8')](),controller[_0x8220('0x10')]);module['exports']=router; \ No newline at end of file +var _0xadb8=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated','index','get','/:id','show','post','destroy','exports'];(function(_0x3b8dae,_0x34f020){var _0x36e826=function(_0x7f62c6){while(--_0x7f62c6){_0x3b8dae['push'](_0x3b8dae['shift']());}};_0x36e826(++_0x34f020);}(_0xadb8,0x1d0));var _0x8adb=function(_0x180ac2,_0x219d65){_0x180ac2=_0x180ac2-0x0;var _0xfcaede=_0xadb8[_0x180ac2];return _0xfcaede;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8adb('0x0'));var timeout=require('connect-timeout');var express=require(_0x8adb('0x1'));var router=express[_0x8adb('0x2')]();var fs_extra=require(_0x8adb('0x3'));var auth=require(_0x8adb('0x4'));var interaction=require(_0x8adb('0x5'));var config=require(_0x8adb('0x6'));var controller=require(_0x8adb('0x7'));router['get']('/',auth[_0x8adb('0x8')](),controller[_0x8adb('0x9')]);router[_0x8adb('0xa')](_0x8adb('0xb'),auth[_0x8adb('0x8')](),controller[_0x8adb('0xc')]);router[_0x8adb('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x8adb('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8adb('0xb'),auth[_0x8adb('0x8')](),controller[_0x8adb('0xe')]);module[_0x8adb('0xf')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 46c49df..9c7251c 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 _0x8c32=['name','sequelize','exports','STRING'];(function(_0x4582a4,_0x5a3a2a){var _0x4fc7c6=function(_0x58241a){while(--_0x58241a){_0x4582a4['push'](_0x4582a4['shift']());}};_0x4fc7c6(++_0x5a3a2a);}(_0x8c32,0x89));var _0x28c3=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x8c32[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require(_0x28c3('0x0'));module[_0x28c3('0x1')]={'name':{'type':Sequelize[_0x28c3('0x2')],'unique':_0x28c3('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xad7c=['sequelize','exports','STRING','name'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xad7c,0x8c));var _0xcad7=function(_0x133dcc,_0x56e3ac){_0x133dcc=_0x133dcc-0x0;var _0xf8263a=_0xad7c[_0x133dcc];return _0xf8263a;};'use strict';var Sequelize=require(_0xcad7('0x0'));module[_0xcad7('0x1')]={'name':{'type':Sequelize[_0xcad7('0x2')],'unique':_0xcad7('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xcad7('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 957d66c..71959af 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 _0x7470=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Variables','UserProfileResource','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service'];(function(_0x417598,_0x207211){var _0xdb1bce=function(_0x459ddc){while(--_0x459ddc){_0x417598['push'](_0x417598['shift']());}};_0xdb1bce(++_0x207211);}(_0x7470,0x127));var _0x0747=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x7470[_0x3511d3];return _0x5d6321;};'use strict';var emlformat=require(_0x0747('0x0'));var rimraf=require(_0x0747('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0747('0x2'));var rp=require(_0x0747('0x3'));var moment=require('moment');var BPromise=require(_0x0747('0x4'));var Mustache=require(_0x0747('0x5'));var util=require('util');var path=require(_0x0747('0x6'));var sox=require(_0x0747('0x7'));var csv=require('to-csv');var ejs=require(_0x0747('0x8'));var fs=require('fs');var fs_extra=require(_0x0747('0x9'));var _=require(_0x0747('0xa'));var squel=require(_0x0747('0xb'));var crypto=require('crypto');var jsforce=require(_0x0747('0xc'));var deskjs=require(_0x0747('0xd'));var toCsv=require(_0x0747('0xe'));var querystring=require('querystring');var Papa=require(_0x0747('0xf'));var Redis=require('ioredis');var authService=require(_0x0747('0x10'));var qs=require(_0x0747('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0747('0x12'));var logger=require(_0x0747('0x13'))('api');var utils=require(_0x0747('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fcf42,_0x15505b){_0x15505b=_0x15505b||0xcc;return function(_0x3e1744){if(_0x3e1744){return _0x2fcf42[_0x0747('0x15')](_0x15505b);}return _0x2fcf42[_0x0747('0x16')](_0x15505b)[_0x0747('0x17')]();};}function respondWithResult(_0x266ea4,_0x2ae29a){_0x2ae29a=_0x2ae29a||0xc8;return function(_0x40a710){if(_0x40a710){return _0x266ea4[_0x0747('0x16')](_0x2ae29a)[_0x0747('0x18')](_0x40a710);}};}function respondWithFilteredResult(_0x53acb4,_0x4ff8b1){return function(_0x3b388b){if(_0x3b388b){var _0x4b9c50=typeof _0x4ff8b1[_0x0747('0x19')]===_0x0747('0x1a')&&typeof _0x4ff8b1[_0x0747('0x1b')]===_0x0747('0x1a');var _0x3fe009=_0x3b388b[_0x0747('0x1c')];var _0x24f7de=_0x4b9c50?0x0:_0x4ff8b1['offset'];var _0x4bb8cc=_0x4b9c50?_0x3b388b['count']:_0x4ff8b1[_0x0747('0x19')]+_0x4ff8b1[_0x0747('0x1b')];var _0x2d9881;if(_0x4bb8cc>=_0x3fe009){_0x4bb8cc=_0x3fe009;_0x2d9881=0xc8;}else{_0x2d9881=0xce;}_0x53acb4[_0x0747('0x16')](_0x2d9881);return _0x53acb4[_0x0747('0x1d')](_0x0747('0x1e'),_0x24f7de+'-'+_0x4bb8cc+'/'+_0x3fe009)[_0x0747('0x18')](_0x3b388b);}return null;};}function patchUpdates(_0x55bb8a){return function(_0xa21355){try{jsonpatch[_0x0747('0x1f')](_0xa21355,_0x55bb8a,!![]);}catch(_0x440ca2){return BPromise[_0x0747('0x20')](_0x440ca2);}return _0xa21355['save']();};}function saveUpdates(_0x86030e,_0x18317d){return function(_0x306558){if(_0x306558){return _0x306558[_0x0747('0x21')](_0x86030e)[_0x0747('0x22')](function(_0x389751){return _0x389751;});}return null;};}function removeEntity(_0x4b3793,_0x295a87){return function(_0x147fe2){if(_0x147fe2){return _0x147fe2[_0x0747('0x23')]()[_0x0747('0x22')](function(){var _0x3ad9f9=_0x147fe2[_0x0747('0x24')]({'plain':!![]});var _0x235fa4=_0x0747('0x25');return db[_0x0747('0x26')][_0x0747('0x23')]({'where':{'type':_0x235fa4,'resourceId':_0x3ad9f9['id']}})[_0x0747('0x22')](function(){return _0x147fe2;});})[_0x0747('0x22')](function(){_0x4b3793[_0x0747('0x16')](0xcc)[_0x0747('0x17')]();});}};}function handleEntityNotFound(_0x5bcffd,_0x2225e3){return function(_0x2abe5e){if(!_0x2abe5e){_0x5bcffd[_0x0747('0x15')](0x194);}return _0x2abe5e;};}function handleError(_0x2b1aa3,_0x18f575){_0x18f575=_0x18f575||0x1f4;return function(_0x41bcf0){logger['error'](_0x41bcf0[_0x0747('0x27')]);if(_0x41bcf0[_0x0747('0x28')]){delete _0x41bcf0[_0x0747('0x28')];}_0x2b1aa3[_0x0747('0x16')](_0x18f575)[_0x0747('0x29')](_0x41bcf0);};}exports[_0x0747('0x2a')]=function(_0x818db9,_0x24c46a){var _0x30864b={},_0x8f68ed={},_0x4bf2ed={'count':0x0,'rows':[]};var _0x2d04bc=_[_0x0747('0x2b')](db[_0x0747('0x2c')][_0x0747('0x2d')],function(_0x19bda2){return{'name':_0x19bda2[_0x0747('0x2e')],'type':_0x19bda2[_0x0747('0x2f')][_0x0747('0x30')]};});_0x8f68ed[_0x0747('0x31')]=_[_0x0747('0x2b')](_0x2d04bc,_0x0747('0x28'));_0x8f68ed[_0x0747('0x32')]=_[_0x0747('0x33')](_0x818db9[_0x0747('0x32')]);_0x8f68ed[_0x0747('0x34')]=_['intersection'](_0x8f68ed[_0x0747('0x31')],_0x8f68ed[_0x0747('0x32')]);_0x30864b[_0x0747('0x35')]=_['intersection'](_0x8f68ed['model'],qs['fields'](_0x818db9['query'][_0x0747('0x36')]));_0x30864b[_0x0747('0x35')]=_0x30864b[_0x0747('0x35')][_0x0747('0x37')]?_0x30864b['attributes']:_0x8f68ed['model'];if(!_0x818db9['query']['hasOwnProperty'](_0x0747('0x38'))){_0x30864b[_0x0747('0x1b')]=qs[_0x0747('0x1b')](_0x818db9[_0x0747('0x32')]['limit']);_0x30864b[_0x0747('0x19')]=qs[_0x0747('0x19')](_0x818db9[_0x0747('0x32')][_0x0747('0x19')]);}_0x30864b['order']=qs[_0x0747('0x39')](_0x818db9[_0x0747('0x32')]['sort']);_0x30864b[_0x0747('0x3a')]=qs[_0x0747('0x34')](_[_0x0747('0x3b')](_0x818db9['query'],_0x8f68ed[_0x0747('0x34')]),_0x2d04bc);if(_0x818db9[_0x0747('0x32')][_0x0747('0x3c')]){_0x30864b[_0x0747('0x3a')]=_['merge'](_0x30864b['where'],{'$or':_[_0x0747('0x2b')](_0x2d04bc,function(_0x569199){if(_0x569199[_0x0747('0x2f')]!==_0x0747('0x3d')){var _0x2927a9={};_0x2927a9[_0x569199[_0x0747('0x28')]]={'$like':'%'+_0x818db9['query'][_0x0747('0x3c')]+'%'};return _0x2927a9;}})});}_0x30864b=_[_0x0747('0x3e')]({},_0x30864b,_0x818db9[_0x0747('0x3f')]);var _0x4173bf={'where':_0x30864b['where']};return db[_0x0747('0x2c')][_0x0747('0x1c')](_0x4173bf)['then'](function(_0xaa5207){_0x4bf2ed[_0x0747('0x1c')]=_0xaa5207;if(_0x818db9[_0x0747('0x32')][_0x0747('0x40')]){_0x30864b[_0x0747('0x41')]=[{'all':!![]}];}return db[_0x0747('0x2c')][_0x0747('0x42')](_0x30864b);})[_0x0747('0x22')](function(_0x1fd195){_0x4bf2ed['rows']=_0x1fd195;return _0x4bf2ed;})['then'](respondWithFilteredResult(_0x24c46a,_0x30864b))[_0x0747('0x43')](handleError(_0x24c46a,null));};exports['show']=function(_0x19fd42,_0x983b90){var _0x188d70={'raw':!![],'where':{'id':_0x19fd42['params']['id']}},_0x28df08={};_0x28df08['model']=_[_0x0747('0x33')](db[_0x0747('0x2c')][_0x0747('0x2d')]);_0x28df08['query']=_['keys'](_0x19fd42[_0x0747('0x32')]);_0x28df08[_0x0747('0x34')]=_[_0x0747('0x44')](_0x28df08[_0x0747('0x31')],_0x28df08['query']);_0x188d70[_0x0747('0x35')]=_[_0x0747('0x44')](_0x28df08['model'],qs[_0x0747('0x36')](_0x19fd42['query'][_0x0747('0x36')]));_0x188d70[_0x0747('0x35')]=_0x188d70[_0x0747('0x35')][_0x0747('0x37')]?_0x188d70[_0x0747('0x35')]:_0x28df08[_0x0747('0x31')];if(_0x19fd42['query'][_0x0747('0x40')]){_0x188d70[_0x0747('0x41')]=[{'all':!![]}];}_0x188d70=_['merge']({},_0x188d70,_0x19fd42[_0x0747('0x3f')]);return db['Variable'][_0x0747('0x45')](_0x188d70)[_0x0747('0x22')](handleEntityNotFound(_0x983b90,null))[_0x0747('0x22')](respondWithResult(_0x983b90,null))[_0x0747('0x43')](handleError(_0x983b90,null));};exports[_0x0747('0x46')]=function(_0x30662a,_0x8e8dae){return db[_0x0747('0x2c')][_0x0747('0x46')](_0x30662a[_0x0747('0x47')],{})[_0x0747('0x22')](function(_0x4b75a9){var _0x16e3ff=_0x30662a[_0x0747('0x48')][_0x0747('0x24')]({'plain':!![]});if(!_0x16e3ff)throw new Error(_0x0747('0x49'));if(_0x16e3ff[_0x0747('0x4a')]==='user'){var _0x5e4a09=_0x4b75a9[_0x0747('0x24')]({'plain':!![]});var _0x5acae8=_0x0747('0x25');return db[_0x0747('0x4b')][_0x0747('0x45')]({'where':{'name':_0x5acae8,'userProfileId':_0x16e3ff['userProfileId']},'raw':!![]})[_0x0747('0x22')](function(_0x65ef73){if(_0x65ef73&&_0x65ef73['autoAssociation']===0x0){return db[_0x0747('0x26')][_0x0747('0x46')]({'name':_0x5e4a09[_0x0747('0x28')],'resourceId':_0x5e4a09['id'],'type':_0x65ef73[_0x0747('0x28')],'sectionId':_0x65ef73['id']},{})['then'](function(){return _0x4b75a9;});}else{return _0x4b75a9;}})[_0x0747('0x43')](function(_0x22cde1){logger[_0x0747('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22cde1);throw _0x22cde1;});}return _0x4b75a9;})[_0x0747('0x22')](respondWithResult(_0x8e8dae,0xc9))[_0x0747('0x43')](handleError(_0x8e8dae,null));};exports[_0x0747('0x21')]=function(_0x471fda,_0x572fa4){if(_0x471fda['body']['id']){delete _0x471fda[_0x0747('0x47')]['id'];}return db[_0x0747('0x2c')][_0x0747('0x45')]({'where':{'id':_0x471fda[_0x0747('0x4d')]['id']}})['then'](handleEntityNotFound(_0x572fa4,null))[_0x0747('0x22')](saveUpdates(_0x471fda[_0x0747('0x47')],null))[_0x0747('0x22')](respondWithResult(_0x572fa4,null))['catch'](handleError(_0x572fa4,null));};exports['destroy']=function(_0x4b0991,_0x395da0){return db[_0x0747('0x2c')]['find']({'where':{'id':_0x4b0991[_0x0747('0x4d')]['id']}})['then'](handleEntityNotFound(_0x395da0,null))['then'](removeEntity(_0x395da0,null))['catch'](handleError(_0x395da0,null));}; \ No newline at end of file +var _0x06c6=['keys','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','json','apply','reject','save','destroy','Variables','then','end','error','name','index','map','Variable','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','rows','catch','show','params'];(function(_0x59c506,_0x3f8d6c){var _0x2f3fbf=function(_0x278f9c){while(--_0x278f9c){_0x59c506['push'](_0x59c506['shift']());}};_0x2f3fbf(++_0x3f8d6c);}(_0x06c6,0x159));var _0x606c=function(_0xe9afaa,_0x91cbae){_0xe9afaa=_0xe9afaa-0x0;var _0x417b7=_0x06c6[_0xe9afaa];return _0x417b7;};'use strict';var emlformat=require(_0x606c('0x0'));var rimraf=require(_0x606c('0x1'));var zipdir=require(_0x606c('0x2'));var jsonpatch=require(_0x606c('0x3'));var rp=require(_0x606c('0x4'));var moment=require(_0x606c('0x5'));var BPromise=require(_0x606c('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x606c('0x7'));var sox=require(_0x606c('0x8'));var csv=require(_0x606c('0x9'));var ejs=require(_0x606c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x606c('0xb'));var squel=require(_0x606c('0xc'));var crypto=require(_0x606c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x606c('0x9'));var querystring=require(_0x606c('0xe'));var Papa=require(_0x606c('0xf'));var Redis=require('ioredis');var authService=require(_0x606c('0x10'));var qs=require(_0x606c('0x11'));var as=require(_0x606c('0x12'));var hardwareService=require(_0x606c('0x13'));var logger=require(_0x606c('0x14'))(_0x606c('0x15'));var utils=require('../../config/utils');var config=require(_0x606c('0x16'));var licenseUtil=require(_0x606c('0x17'));var db=require(_0x606c('0x18'))['db'];function respondWithStatusCode(_0x51cff4,_0x4f7ba9){_0x4f7ba9=_0x4f7ba9||0xcc;return function(_0x510e3d){if(_0x510e3d){return _0x51cff4[_0x606c('0x19')](_0x4f7ba9);}return _0x51cff4[_0x606c('0x1a')](_0x4f7ba9)['end']();};}function respondWithResult(_0x3fb8c4,_0x559046){_0x559046=_0x559046||0xc8;return function(_0x482719){if(_0x482719){return _0x3fb8c4[_0x606c('0x1a')](_0x559046)['json'](_0x482719);}};}function respondWithFilteredResult(_0x44c837,_0x527787){return function(_0x2ebd86){if(_0x2ebd86){var _0x2493ed=typeof _0x527787['offset']===_0x606c('0x1b')&&typeof _0x527787[_0x606c('0x1c')]===_0x606c('0x1b');var _0x140f7d=_0x2ebd86[_0x606c('0x1d')];var _0x536470=_0x2493ed?0x0:_0x527787[_0x606c('0x1e')];var _0x15ee7e=_0x2493ed?_0x2ebd86[_0x606c('0x1d')]:_0x527787[_0x606c('0x1e')]+_0x527787['limit'];var _0x38d968;if(_0x15ee7e>=_0x140f7d){_0x15ee7e=_0x140f7d;_0x38d968=0xc8;}else{_0x38d968=0xce;}_0x44c837['status'](_0x38d968);return _0x44c837[_0x606c('0x1f')]('Content-Range',_0x536470+'-'+_0x15ee7e+'/'+_0x140f7d)[_0x606c('0x20')](_0x2ebd86);}return null;};}function patchUpdates(_0xfbf22c){return function(_0x2ccabc){try{jsonpatch[_0x606c('0x21')](_0x2ccabc,_0xfbf22c,!![]);}catch(_0x5f2119){return BPromise[_0x606c('0x22')](_0x5f2119);}return _0x2ccabc[_0x606c('0x23')]();};}function saveUpdates(_0x5ed978,_0xe8751b){return function(_0x430da0){if(_0x430da0){return _0x430da0['update'](_0x5ed978)['then'](function(_0x594f78){return _0x594f78;});}return null;};}function removeEntity(_0x2dc006,_0x5d8994){return function(_0x3a26f0){if(_0x3a26f0){return _0x3a26f0[_0x606c('0x24')]()['then'](function(){var _0x3d3f1f=_0x3a26f0['get']({'plain':!![]});var _0x5667ed=_0x606c('0x25');return db['UserProfileResource'][_0x606c('0x24')]({'where':{'type':_0x5667ed,'resourceId':_0x3d3f1f['id']}})[_0x606c('0x26')](function(){return _0x3a26f0;});})[_0x606c('0x26')](function(){_0x2dc006[_0x606c('0x1a')](0xcc)[_0x606c('0x27')]();});}};}function handleEntityNotFound(_0x42c6a4,_0x449103){return function(_0x2942ed){if(!_0x2942ed){_0x42c6a4[_0x606c('0x19')](0x194);}return _0x2942ed;};}function handleError(_0x2ee1ae,_0x4db2ff){_0x4db2ff=_0x4db2ff||0x1f4;return function(_0x518c26){logger[_0x606c('0x28')](_0x518c26['stack']);if(_0x518c26[_0x606c('0x29')]){delete _0x518c26[_0x606c('0x29')];}_0x2ee1ae[_0x606c('0x1a')](_0x4db2ff)['send'](_0x518c26);};}exports[_0x606c('0x2a')]=function(_0x2d70de,_0x1e6505){var _0x339d53={},_0x5488fd={},_0x4dc7e6={'count':0x0,'rows':[]};var _0x545a8d=_[_0x606c('0x2b')](db[_0x606c('0x2c')][_0x606c('0x2d')],function(_0x4511c5){return{'name':_0x4511c5[_0x606c('0x2e')],'type':_0x4511c5['type'][_0x606c('0x2f')]};});_0x5488fd[_0x606c('0x30')]=_[_0x606c('0x2b')](_0x545a8d,_0x606c('0x29'));_0x5488fd['query']=_['keys'](_0x2d70de[_0x606c('0x31')]);_0x5488fd[_0x606c('0x32')]=_[_0x606c('0x33')](_0x5488fd[_0x606c('0x30')],_0x5488fd[_0x606c('0x31')]);_0x339d53[_0x606c('0x34')]=_[_0x606c('0x33')](_0x5488fd['model'],qs['fields'](_0x2d70de[_0x606c('0x31')][_0x606c('0x35')]));_0x339d53[_0x606c('0x34')]=_0x339d53[_0x606c('0x34')][_0x606c('0x36')]?_0x339d53[_0x606c('0x34')]:_0x5488fd[_0x606c('0x30')];if(!_0x2d70de[_0x606c('0x31')][_0x606c('0x37')]('nolimit')){_0x339d53[_0x606c('0x1c')]=qs['limit'](_0x2d70de[_0x606c('0x31')][_0x606c('0x1c')]);_0x339d53[_0x606c('0x1e')]=qs['offset'](_0x2d70de[_0x606c('0x31')][_0x606c('0x1e')]);}_0x339d53[_0x606c('0x38')]=qs[_0x606c('0x39')](_0x2d70de['query'][_0x606c('0x39')]);_0x339d53[_0x606c('0x3a')]=qs[_0x606c('0x32')](_[_0x606c('0x3b')](_0x2d70de[_0x606c('0x31')],_0x5488fd[_0x606c('0x32')]),_0x545a8d);if(_0x2d70de['query']['filter']){_0x339d53[_0x606c('0x3a')]=_[_0x606c('0x3c')](_0x339d53['where'],{'$or':_[_0x606c('0x2b')](_0x545a8d,function(_0x1092c8){if(_0x1092c8[_0x606c('0x3d')]!==_0x606c('0x3e')){var _0x3aaa3e={};_0x3aaa3e[_0x1092c8[_0x606c('0x29')]]={'$like':'%'+_0x2d70de[_0x606c('0x31')][_0x606c('0x3f')]+'%'};return _0x3aaa3e;}})});}_0x339d53=_[_0x606c('0x3c')]({},_0x339d53,_0x2d70de[_0x606c('0x40')]);var _0x3f1eb9={'where':_0x339d53[_0x606c('0x3a')]};return db[_0x606c('0x2c')][_0x606c('0x1d')](_0x3f1eb9)[_0x606c('0x26')](function(_0x533afd){_0x4dc7e6[_0x606c('0x1d')]=_0x533afd;if(_0x2d70de[_0x606c('0x31')][_0x606c('0x41')]){_0x339d53['include']=[{'all':!![]}];}return db[_0x606c('0x2c')]['findAll'](_0x339d53);})[_0x606c('0x26')](function(_0x21366e){_0x4dc7e6[_0x606c('0x42')]=_0x21366e;return _0x4dc7e6;})[_0x606c('0x26')](respondWithFilteredResult(_0x1e6505,_0x339d53))[_0x606c('0x43')](handleError(_0x1e6505,null));};exports[_0x606c('0x44')]=function(_0x194689,_0x3bb7d8){var _0x1a379d={'raw':!![],'where':{'id':_0x194689[_0x606c('0x45')]['id']}},_0x2b97ae={};_0x2b97ae['model']=_['keys'](db['Variable']['rawAttributes']);_0x2b97ae[_0x606c('0x31')]=_[_0x606c('0x46')](_0x194689[_0x606c('0x31')]);_0x2b97ae[_0x606c('0x32')]=_[_0x606c('0x33')](_0x2b97ae[_0x606c('0x30')],_0x2b97ae[_0x606c('0x31')]);_0x1a379d['attributes']=_[_0x606c('0x33')](_0x2b97ae['model'],qs['fields'](_0x194689[_0x606c('0x31')][_0x606c('0x35')]));_0x1a379d[_0x606c('0x34')]=_0x1a379d[_0x606c('0x34')]['length']?_0x1a379d[_0x606c('0x34')]:_0x2b97ae[_0x606c('0x30')];if(_0x194689[_0x606c('0x31')][_0x606c('0x41')]){_0x1a379d[_0x606c('0x47')]=[{'all':!![]}];}_0x1a379d=_[_0x606c('0x3c')]({},_0x1a379d,_0x194689[_0x606c('0x40')]);return db[_0x606c('0x2c')]['find'](_0x1a379d)['then'](handleEntityNotFound(_0x3bb7d8,null))['then'](respondWithResult(_0x3bb7d8,null))['catch'](handleError(_0x3bb7d8,null));};exports['create']=function(_0x8a923a,_0x305f11){return db[_0x606c('0x2c')][_0x606c('0x48')](_0x8a923a[_0x606c('0x49')],{})[_0x606c('0x26')](function(_0x31265f){var _0x4e08ae=_0x8a923a[_0x606c('0x4a')][_0x606c('0x4b')]({'plain':!![]});if(!_0x4e08ae)throw new Error(_0x606c('0x4c'));if(_0x4e08ae['role']===_0x606c('0x4a')){var _0x52baba=_0x31265f['get']({'plain':!![]});var _0x3b30c3=_0x606c('0x25');return db[_0x606c('0x4d')][_0x606c('0x4e')]({'where':{'name':_0x3b30c3,'userProfileId':_0x4e08ae[_0x606c('0x4f')]},'raw':!![]})[_0x606c('0x26')](function(_0x30dd8e){if(_0x30dd8e&&_0x30dd8e[_0x606c('0x50')]===0x0){return db[_0x606c('0x51')]['create']({'name':_0x52baba['name'],'resourceId':_0x52baba['id'],'type':_0x30dd8e[_0x606c('0x29')],'sectionId':_0x30dd8e['id']},{})[_0x606c('0x26')](function(){return _0x31265f;});}else{return _0x31265f;}})[_0x606c('0x43')](function(_0x4a2cba){logger[_0x606c('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a2cba);throw _0x4a2cba;});}return _0x31265f;})['then'](respondWithResult(_0x305f11,0xc9))[_0x606c('0x43')](handleError(_0x305f11,null));};exports[_0x606c('0x52')]=function(_0xf9a4f6,_0x388773){if(_0xf9a4f6['body']['id']){delete _0xf9a4f6[_0x606c('0x49')]['id'];}return db['Variable'][_0x606c('0x4e')]({'where':{'id':_0xf9a4f6['params']['id']}})['then'](handleEntityNotFound(_0x388773,null))[_0x606c('0x26')](saveUpdates(_0xf9a4f6[_0x606c('0x49')],null))[_0x606c('0x26')](respondWithResult(_0x388773,null))[_0x606c('0x43')](handleError(_0x388773,null));};exports[_0x606c('0x24')]=function(_0x37c5e6,_0x45cbf1){return db[_0x606c('0x2c')][_0x606c('0x4e')]({'where':{'id':_0x37c5e6[_0x606c('0x45')]['id']}})['then'](handleEntityNotFound(_0x45cbf1,null))[_0x606c('0x26')](removeEntity(_0x45cbf1,null))['catch'](handleError(_0x45cbf1,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 0c2f4d0..41feafb 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 _0x01de=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Variable','tools_variables','lodash','util','api'];(function(_0x11b33b,_0x1b41cd){var _0x2a4cf6=function(_0x2a84e6){while(--_0x2a84e6){_0x11b33b['push'](_0x11b33b['shift']());}};_0x2a4cf6(++_0x1b41cd);}(_0x01de,0x10e));var _0xe01d=function(_0x546d5d,_0x114b45){_0x546d5d=_0x546d5d-0x0;var _0x45c8f8=_0x01de[_0x546d5d];return _0x45c8f8;};'use strict';var _=require(_0xe01d('0x0'));var util=require(_0xe01d('0x1'));var logger=require('../../config/logger')(_0xe01d('0x2'));var moment=require(_0xe01d('0x3'));var BPromise=require(_0xe01d('0x4'));var rp=require(_0xe01d('0x5'));var fs=require('fs');var path=require(_0xe01d('0x6'));var rimraf=require(_0xe01d('0x7'));var config=require(_0xe01d('0x8'));var attributes=require('./variable.attributes');module[_0xe01d('0x9')]=function(_0x89cd09,_0x585dd7){return _0x89cd09[_0xe01d('0xa')](_0xe01d('0xb'),attributes,{'tableName':_0xe01d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa03b=['bluebird','request-promise','rimraf','../../config/environment','define','Variable','tools_variables','lodash','../../config/logger','api'];(function(_0x2dc375,_0x24b1d6){var _0x4e9fed=function(_0x7f55d6){while(--_0x7f55d6){_0x2dc375['push'](_0x2dc375['shift']());}};_0x4e9fed(++_0x24b1d6);}(_0xa03b,0x16f));var _0xba03=function(_0x366e99,_0x15d82d){_0x366e99=_0x366e99-0x0;var _0x180bbe=_0xa03b[_0x366e99];return _0x180bbe;};'use strict';var _=require(_0xba03('0x0'));var util=require('util');var logger=require(_0xba03('0x1'))(_0xba03('0x2'));var moment=require('moment');var BPromise=require(_0xba03('0x3'));var rp=require(_0xba03('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xba03('0x5'));var config=require(_0xba03('0x6'));var attributes=require('./variable.attributes');module['exports']=function(_0x2f02d0,_0x58faf9){return _0x2f02d0[_0xba03('0x7')](_0xba03('0x8'),attributes,{'tableName':_0xba03('0x9'),'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 e6dd6b0..20e600e 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 _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x29d6f1,_0x4465c0){var _0x3cd8b8=function(_0x4b8069){while(--_0x4b8069){_0x29d6f1['push'](_0x29d6f1['shift']());}};_0x3cd8b8(++_0x4465c0);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1d0b66,_0x24accb){_0x1d0b66=_0x1d0b66-0x0;var _0xbcf25a=_0x1cb9[_0x1d0b66];return _0xbcf25a;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});}; \ No newline at end of file +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(_0x24abec,_0x30ff71){var _0x132716=function(_0x124d3f){while(--_0x124d3f){_0x24abec['push'](_0x24abec['shift']());}};_0x132716(++_0x30ff71);}(_0x55ca,0x126));var _0xa55c=function(_0x24487f,_0x9b3ea0){_0x24487f=_0x24487f-0x0;var _0x456456=_0x55ca[_0x24487f];return _0x456456;};'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 diff --git a/server/api/version/index.js b/server/api/version/index.js index 1433977..9b6f453 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 _0xb9b6=['/restart','/migrations','migrations','express','Router','../../components/auth/service','get','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull'];(function(_0x5b2b69,_0x4b278e){var _0x210a10=function(_0xb7643b){while(--_0xb7643b){_0x5b2b69['push'](_0x5b2b69['shift']());}};_0x210a10(++_0x4b278e);}(_0xb9b6,0x199));var _0x6b9b=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xb9b6[_0x1b7368];return _0x25d54c;};'use strict';var express=require(_0x6b9b('0x0'));var router=express[_0x6b9b('0x1')]();var auth=require(_0x6b9b('0x2'));var controller=require('./version.controller');router['get']('/',controller['index']);router[_0x6b9b('0x3')]('/fetch',auth[_0x6b9b('0x4')](),auth[_0x6b9b('0x5')](),controller[_0x6b9b('0x6')]);router['get'](_0x6b9b('0x7'),auth['isAuthenticated'](),auth[_0x6b9b('0x5')](),controller[_0x6b9b('0x8')]);router[_0x6b9b('0x3')](_0x6b9b('0x9'),auth[_0x6b9b('0x4')](),auth[_0x6b9b('0x5')](),controller[_0x6b9b('0xa')]);router[_0x6b9b('0x3')](_0x6b9b('0xb'),auth[_0x6b9b('0x4')](),controller['restart']);router[_0x6b9b('0x3')](_0x6b9b('0xc'),controller[_0x6b9b('0xd')]);module['exports']=router; \ No newline at end of file +var _0x8c01=['fetch','/reset','canUpdate','/pull','pull','/migrations','migrations','exports','Router','get','index','isAuthenticated'];(function(_0x1abb3f,_0x3fca05){var _0x1181ca=function(_0x2e558e){while(--_0x2e558e){_0x1abb3f['push'](_0x1abb3f['shift']());}};_0x1181ca(++_0x3fca05);}(_0x8c01,0x1dc));var _0x18c0=function(_0x38ed42,_0x3d9a37){_0x38ed42=_0x38ed42-0x0;var _0x474931=_0x8c01[_0x38ed42];return _0x474931;};'use strict';var express=require('express');var router=express[_0x18c0('0x0')]();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0x18c0('0x1')]('/',controller[_0x18c0('0x2')]);router['get']('/fetch',auth[_0x18c0('0x3')](),auth['canUpdate'](),controller[_0x18c0('0x4')]);router['get'](_0x18c0('0x5'),auth[_0x18c0('0x3')](),auth[_0x18c0('0x6')](),controller['reset']);router[_0x18c0('0x1')](_0x18c0('0x7'),auth[_0x18c0('0x3')](),auth[_0x18c0('0x6')](),controller[_0x18c0('0x8')]);router[_0x18c0('0x1')]('/restart',auth[_0x18c0('0x3')](),controller['restart']);router[_0x18c0('0x1')](_0x18c0('0x9'),controller[_0x18c0('0xa')]);module[_0x18c0('0xb')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 9e92f97..8143703 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 _0xd0b8=['replace','.js','push','sort','Migration','sequelize','getQueryInterface','constructor','join','server','map','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','fetch','tags','latest','2.0.0','status','json','origin','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','readdirSync','migrations','length'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xd0b8,0x78));var _0x8d0b=function(_0x12aa66,_0x2d35c1){_0x12aa66=_0x12aa66-0x0;var _0x53dfe9=_0xd0b8[_0x12aa66];return _0x53dfe9;};'use strict';var Umzug=require(_0x8d0b('0x0'));var path=require(_0x8d0b('0x1'));var fs=require('fs');var _=require(_0x8d0b('0x2'));var pkginfo=require(_0x8d0b('0x3'))(module,_0x8d0b('0x4'));var compareVersions=require(_0x8d0b('0x5'));var exec=require(_0x8d0b('0x6'))['exec'];var db=require(_0x8d0b('0x7'))['db'];var config=require(_0x8d0b('0x8'));var pm2=require(_0x8d0b('0x9'));var logger=require(_0x8d0b('0xa'))(_0x8d0b('0xb'));var git=require(_0x8d0b('0xc'))(config[_0x8d0b('0xd')]);exports[_0x8d0b('0xe')]=function(_0x1bb1e9,_0x1a181c){var _0x38379c={'current':module[_0x8d0b('0xf')][_0x8d0b('0x4')],'phonebar':0x2};if(_0x1bb1e9['query']&&_0x1bb1e9[_0x8d0b('0x10')]['latest']){return git[_0x8d0b('0x11')]()[_0x8d0b('0x12')](function(_0x41bfa1,_0x48fbbd){_0x38379c[_0x8d0b('0x13')]=(_0x41bfa1?module[_0x8d0b('0xf')][_0x8d0b('0x4')]:_0x48fbbd['latest'])||_0x8d0b('0x14');return _0x1a181c[_0x8d0b('0x15')](0xc8)[_0x8d0b('0x16')](_0x38379c);});}else{return _0x1a181c[_0x8d0b('0x15')](0xc8)['json'](_0x38379c);}};exports[_0x8d0b('0x11')]=function(_0x433c7d,_0x30a9d6){return git[_0x8d0b('0x11')]([_0x8d0b('0x17'),'master'],function(_0x365373){if(_0x365373){logger[_0x8d0b('0x18')](_0x365373);return _0x30a9d6[_0x8d0b('0x15')](0x1f4)[_0x8d0b('0x16')](_0x365373);}logger[_0x8d0b('0x19')](_0x8d0b('0x1a'));return _0x30a9d6[_0x8d0b('0x15')](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x2c2808,_0x5c4013){return git[_0x8d0b('0x1b')]([_0x8d0b('0x1c'),_0x8d0b('0x1d')],function(_0x11547b){if(_0x11547b){logger[_0x8d0b('0x18')](_0x11547b);return _0x5c4013['status'](0x1f4)['json'](_0x11547b);}logger['info'](_0x8d0b('0x1e'));return _0x5c4013[_0x8d0b('0x15')](0xc8)['json']({'output':_0x8d0b('0x1f')});});};exports[_0x8d0b('0x20')]=function(_0x23352a,_0x274eb9){exec(_0x8d0b('0x21'),function(_0x4cc433,_0x16a975,_0x36a642){logger[_0x8d0b('0x19')](_0x16a975);logger[_0x8d0b('0x19')](_0x36a642);if(_0x4cc433){logger[_0x8d0b('0x18')](_0x4cc433);return _0x274eb9['status'](0x1f4)[_0x8d0b('0x16')](_0x4cc433);}return _0x274eb9[_0x8d0b('0x15')](0xc8)[_0x8d0b('0x16')]({'output':_0x16a975});});};exports['restart']=function(_0x28d9f4,_0x19b61a){return pm2['restart']('motion2')['then'](function(_0x4c332e){logger[_0x8d0b('0x19')](_0x8d0b('0x22'),_0x4c332e);return _0x19b61a[_0x8d0b('0x15')](0xc8)[_0x8d0b('0x16')]({'output':_0x8d0b('0x23')});})['catch'](function(_0x4c6061){logger['error'](_0x4c6061);return _0x19b61a[_0x8d0b('0x15')](0x1f4)[_0x8d0b('0x16')](_0x4c6061);});};exports['migrations']=function(_0x194a6a,_0x2fc653){var _0x28784d=fs[_0x8d0b('0x24')](path['join'](config[_0x8d0b('0xd')],'server',_0x8d0b('0x25')));var _0x489b1a=[];for(var _0x14ee50=0x0;_0x14ee50<_0x28784d[_0x8d0b('0x26')];_0x14ee50++){var _0x3de35d=_0x28784d[_0x14ee50][_0x8d0b('0x27')](_0x8d0b('0x28'),'');if(compareVersions(module[_0x8d0b('0xf')][_0x8d0b('0x4')],_0x3de35d)===-0x1){_0x489b1a[_0x8d0b('0x29')](_0x3de35d);}}if(_0x489b1a[_0x8d0b('0x26')]){var _0x56cb65=_0x489b1a[_0x8d0b('0x2a')](compareVersions);var _0x529675=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0x8d0b('0x2b'),'columnName':_0x8d0b('0x4')},'migrations':{'params':[db[_0x8d0b('0x2c')][_0x8d0b('0x2d')](),db[_0x8d0b('0x2c')][_0x8d0b('0x2e')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x8d0b('0x2f')](config[_0x8d0b('0xd')],_0x8d0b('0x30'),_0x8d0b('0x25')),'pattern':/\.js$/}});_0x529675['up']({'migrations':_[_0x8d0b('0x31')](_0x56cb65,function(_0x20010b){return _0x20010b+'.js';})})['then'](function(){return _0x2fc653['status'](0xc8)[_0x8d0b('0x16')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x8d0b('0xf')][_0x8d0b('0x4')]+_0x8d0b('0x32')+_['last'](_0x56cb65),'migrations':_[_0x8d0b('0x2f')](_0x56cb65)});})['catch'](function(_0x50b93a){if(_0x50b93a instanceof db[_0x8d0b('0x2c')][_0x8d0b('0x33')]){return _0x2fc653[_0x8d0b('0x15')](0xc8)[_0x8d0b('0x16')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x2fc653['status'](0x1f4)['json'](_0x50b93a);}});}else{return _0x2fc653[_0x8d0b('0x15')](0xc8)['json']({'output':_0x8d0b('0x34')});}}; \ No newline at end of file +var _0x521e=['constructor','server','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','child_process','../../config/environment','../../config/pm2','../../config/logger','simple-git','index','exports','version','query','latest','fetch','2.0.0','status','json','origin','master','info','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','npm\x20install\x20--production','error','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','root','replace','sort','sequelize','Migration','getQueryInterface'];(function(_0x32e2eb,_0x3347b7){var _0x2418ce=function(_0x13ed52){while(--_0x13ed52){_0x32e2eb['push'](_0x32e2eb['shift']());}};_0x2418ce(++_0x3347b7);}(_0x521e,0x15e));var _0xe521=function(_0x222d56,_0x58a386){_0x222d56=_0x222d56-0x0;var _0x4a3c36=_0x521e[_0x222d56];return _0x4a3c36;};'use strict';var Umzug=require(_0xe521('0x0'));var path=require(_0xe521('0x1'));var fs=require('fs');var _=require(_0xe521('0x2'));var pkginfo=require(_0xe521('0x3'))(module,'version');var compareVersions=require(_0xe521('0x4'));var exec=require(_0xe521('0x5'))['exec'];var db=require('../../mysqldb')['db'];var config=require(_0xe521('0x6'));var pm2=require(_0xe521('0x7'));var logger=require(_0xe521('0x8'))('update');var git=require(_0xe521('0x9'))(config['root']);exports[_0xe521('0xa')]=function(_0x3f98a1,_0x5212d0){var _0x1759a7={'current':module[_0xe521('0xb')][_0xe521('0xc')],'phonebar':0x2};if(_0x3f98a1['query']&&_0x3f98a1[_0xe521('0xd')][_0xe521('0xe')]){return git[_0xe521('0xf')]()['tags'](function(_0x3fe3e3,_0x3f643e){_0x1759a7[_0xe521('0xe')]=(_0x3fe3e3?module[_0xe521('0xb')][_0xe521('0xc')]:_0x3f643e['latest'])||_0xe521('0x10');return _0x5212d0[_0xe521('0x11')](0xc8)[_0xe521('0x12')](_0x1759a7);});}else{return _0x5212d0[_0xe521('0x11')](0xc8)[_0xe521('0x12')](_0x1759a7);}};exports[_0xe521('0xf')]=function(_0x3dc41f,_0x4c6f25){return git[_0xe521('0xf')]([_0xe521('0x13'),_0xe521('0x14')],function(_0x76a81e){if(_0x76a81e){logger['error'](_0x76a81e);return _0x4c6f25[_0xe521('0x11')](0x1f4)['json'](_0x76a81e);}logger[_0xe521('0x15')]('git\x20fetch');return _0x4c6f25[_0xe521('0x11')](0xc8)[_0xe521('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x59bbfc,_0x49dbd8){return git[_0xe521('0x16')]([_0xe521('0x17'),_0xe521('0x18')],function(_0x8375f6){if(_0x8375f6){logger['error'](_0x8375f6);return _0x49dbd8[_0xe521('0x11')](0x1f4)[_0xe521('0x12')](_0x8375f6);}logger[_0xe521('0x15')](_0xe521('0x19'));return _0x49dbd8[_0xe521('0x11')](0xc8)[_0xe521('0x12')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x51495e,_0x8b8c52){exec(_0xe521('0x1a'),function(_0x3a2e29,_0x1313d6,_0x52890e){logger[_0xe521('0x15')](_0x1313d6);logger[_0xe521('0x15')](_0x52890e);if(_0x3a2e29){logger[_0xe521('0x1b')](_0x3a2e29);return _0x8b8c52[_0xe521('0x11')](0x1f4)[_0xe521('0x12')](_0x3a2e29);}return _0x8b8c52[_0xe521('0x11')](0xc8)[_0xe521('0x12')]({'output':_0x1313d6});});};exports[_0xe521('0x1c')]=function(_0x569a02,_0x329f66){return pm2[_0xe521('0x1c')](_0xe521('0x1d'))[_0xe521('0x1e')](function(_0x1c3c23){logger[_0xe521('0x15')](_0xe521('0x1f'),_0x1c3c23);return _0x329f66[_0xe521('0x11')](0xc8)[_0xe521('0x12')]({'output':_0xe521('0x20')});})[_0xe521('0x21')](function(_0x330534){logger[_0xe521('0x1b')](_0x330534);return _0x329f66[_0xe521('0x11')](0x1f4)[_0xe521('0x12')](_0x330534);});};exports[_0xe521('0x22')]=function(_0x363b46,_0x2812a1){var _0x4a069b=fs['readdirSync'](path[_0xe521('0x23')](config[_0xe521('0x24')],'server',_0xe521('0x22')));var _0xe66ab=[];for(var _0x2e70ea=0x0;_0x2e70ea<_0x4a069b['length'];_0x2e70ea++){var _0x15f256=_0x4a069b[_0x2e70ea][_0xe521('0x25')]('.js','');if(compareVersions(module[_0xe521('0xb')][_0xe521('0xc')],_0x15f256)===-0x1){_0xe66ab['push'](_0x15f256);}}if(_0xe66ab['length']){var _0x2d2873=_0xe66ab[_0xe521('0x26')](compareVersions);var _0x51e9d1=new Umzug({'storage':_0xe521('0x27'),'storageOptions':{'model':db['Migration'],'modelName':_0xe521('0x28'),'columnName':_0xe521('0xc')},'migrations':{'params':[db[_0xe521('0x27')][_0xe521('0x29')](),db[_0xe521('0x27')][_0xe521('0x2a')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xe521('0x23')](config['root'],_0xe521('0x2b'),_0xe521('0x22')),'pattern':/\.js$/}});_0x51e9d1['up']({'migrations':_['map'](_0x2d2873,function(_0x6bda59){return _0x6bda59+_0xe521('0x2c');})})[_0xe521('0x1e')](function(){return _0x2812a1[_0xe521('0x11')](0xc8)['json']({'output':_0xe521('0x2d')+module[_0xe521('0xb')][_0xe521('0xc')]+_0xe521('0x2e')+_['last'](_0x2d2873),'migrations':_[_0xe521('0x23')](_0x2d2873)});})[_0xe521('0x21')](function(_0x523fcf){if(_0x523fcf instanceof db[_0xe521('0x27')][_0xe521('0x2f')]){return _0x2812a1['status'](0xc8)[_0xe521('0x12')]({'output':_0xe521('0x30')});}else{return _0x2812a1[_0xe521('0x11')](0x1f4)[_0xe521('0x12')](_0x523fcf);}});}else{return _0x2812a1[_0xe521('0x11')](0xc8)[_0xe521('0x12')]({'output':_0xe521('0x30')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 4ac9dbd..3db6935 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 _0x1c9a=['express','Router','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show','update','delete','destroy','exports','multer','path'];(function(_0x17b02f,_0x284d7f){var _0x54af46=function(_0x43fee5){while(--_0x43fee5){_0x17b02f['push'](_0x17b02f['shift']());}};_0x54af46(++_0x284d7f);}(_0x1c9a,0x130));var _0xa1c9=function(_0x54754f,_0x1084a2){_0x54754f=_0x54754f-0x0;var _0x13bca3=_0x1c9a[_0x54754f];return _0x13bca3;};'use strict';var multer=require(_0xa1c9('0x0'));var util=require('util');var path=require(_0xa1c9('0x1'));var timeout=require('connect-timeout');var express=require(_0xa1c9('0x2'));var router=express[_0xa1c9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa1c9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa1c9('0x5'));var controller=require(_0xa1c9('0x6'));router[_0xa1c9('0x7')]('/',auth[_0xa1c9('0x8')](),controller['index']);router[_0xa1c9('0x7')](_0xa1c9('0x9'),auth[_0xa1c9('0x8')](),controller[_0xa1c9('0xa')]);router['get'](_0xa1c9('0xb'),auth[_0xa1c9('0x8')](),controller[_0xa1c9('0xc')]);router['post']('/',auth[_0xa1c9('0x8')](),controller['create']);router['put'](_0xa1c9('0xb'),auth[_0xa1c9('0x8')](),controller[_0xa1c9('0xd')]);router[_0xa1c9('0xe')]('/:id',auth[_0xa1c9('0x8')](),controller[_0xa1c9('0xf')]);module[_0xa1c9('0x10')]=router; \ No newline at end of file +var _0xeec6=['index','/describe','describe','show','post','create','put','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated'];(function(_0x35de8a,_0x7acd4b){var _0x9c759d=function(_0x1fc3d3){while(--_0x1fc3d3){_0x35de8a['push'](_0x35de8a['shift']());}};_0x9c759d(++_0x7acd4b);}(_0xeec6,0x1ee));var _0x6eec=function(_0xf46bd9,_0x322826){_0xf46bd9=_0xf46bd9-0x0;var _0x2763c3=_0xeec6[_0xf46bd9];return _0x2763c3;};'use strict';var multer=require('multer');var util=require(_0x6eec('0x0'));var path=require(_0x6eec('0x1'));var timeout=require(_0x6eec('0x2'));var express=require(_0x6eec('0x3'));var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6eec('0x6'));var config=require('../../config/environment');var controller=require(_0x6eec('0x7'));router[_0x6eec('0x8')]('/',auth[_0x6eec('0x9')](),controller[_0x6eec('0xa')]);router[_0x6eec('0x8')](_0x6eec('0xb'),auth[_0x6eec('0x9')](),controller[_0x6eec('0xc')]);router[_0x6eec('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/',auth[_0x6eec('0x9')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')](_0x6eec('0x11'),auth[_0x6eec('0x9')](),controller['update']);router[_0x6eec('0x12')](_0x6eec('0x11'),auth[_0x6eec('0x9')](),controller[_0x6eec('0x13')]);module[_0x6eec('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index de913ca..f0bf781 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 _0x14b7=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x14b7,0x144));var _0x714b=function(_0x21940d,_0x2209da){_0x21940d=_0x21940d-0x0;var _0x22d948=_0x14b7[_0x21940d];return _0x22d948;};'use strict';var Sequelize=require(_0x714b('0x0'));module[_0x714b('0x1')]={'type':{'type':Sequelize[_0x714b('0x2')]},'uniqueid':{'type':Sequelize[_0x714b('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x714b('0x2')]},'queue':{'type':Sequelize[_0x714b('0x2')]},'interface':{'type':Sequelize[_0x714b('0x2')]},'membername':{'type':Sequelize[_0x714b('0x2')]},'agentcalledAt':{'type':Sequelize[_0x714b('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x714b('0x3')]},'agentdumpAt':{'type':Sequelize[_0x714b('0x3')]},'holdtime':{'type':Sequelize[_0x714b('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x714b('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x714b('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x714b('0x4')]},'agentacw':{'type':Sequelize[_0x714b('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x714b('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x714b('0x2')]},'channel':{'type':Sequelize[_0x714b('0x2')]},'channelstate':{'type':Sequelize[_0x714b('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x714b('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x714b('0x2')]},'context':{'type':Sequelize[_0x714b('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x714b('0x2')]},'destchannel':{'type':Sequelize[_0x714b('0x2')]},'destchannelstate':{'type':Sequelize[_0x714b('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x714b('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x714b('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x714b('0x2')]},'destlanguage':{'type':Sequelize[_0x714b('0x2')]},'destaccountcode':{'type':Sequelize[_0x714b('0x2')]},'destcontext':{'type':Sequelize[_0x714b('0x2')]},'destexten':{'type':Sequelize[_0x714b('0x2')]},'destpriority':{'type':Sequelize[_0x714b('0x2')]},'destuniqueid':{'type':Sequelize[_0x714b('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x714b('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x714b('0x2')]},'transfer':{'type':Sequelize[_0x714b('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x714b('0x2')],'comment':_0x714b('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x714b('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xdd6e=['DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x308408,_0x37d440){var _0x9dc073=function(_0x29f0c9){while(--_0x29f0c9){_0x308408['push'](_0x308408['shift']());}};_0x9dc073(++_0x37d440);}(_0xdd6e,0xa5));var _0xedd6=function(_0x1cf2b5,_0x45d1a9){_0x1cf2b5=_0x1cf2b5-0x0;var _0x1059bb=_0xdd6e[_0x1cf2b5];return _0x1059bb;};'use strict';var Sequelize=require(_0xedd6('0x0'));module[_0xedd6('0x1')]={'type':{'type':Sequelize[_0xedd6('0x2')]},'uniqueid':{'type':Sequelize[_0xedd6('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xedd6('0x2')]},'queue':{'type':Sequelize[_0xedd6('0x2')]},'interface':{'type':Sequelize[_0xedd6('0x2')]},'membername':{'type':Sequelize[_0xedd6('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xedd6('0x3')]},'agentdumpAt':{'type':Sequelize[_0xedd6('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xedd6('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xedd6('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xedd6('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xedd6('0x5')]},'agentacw':{'type':Sequelize[_0xedd6('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xedd6('0x2')]},'channel':{'type':Sequelize[_0xedd6('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xedd6('0x2')]},'connectedlinenum':{'type':Sequelize[_0xedd6('0x2')]},'connectedlinename':{'type':Sequelize[_0xedd6('0x2')]},'language':{'type':Sequelize[_0xedd6('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xedd6('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xedd6('0x2')]},'destchannel':{'type':Sequelize[_0xedd6('0x2')]},'destchannelstate':{'type':Sequelize[_0xedd6('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0xedd6('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xedd6('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xedd6('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xedd6('0x2')]},'destlanguage':{'type':Sequelize[_0xedd6('0x2')]},'destaccountcode':{'type':Sequelize[_0xedd6('0x2')]},'destcontext':{'type':Sequelize[_0xedd6('0x2')]},'destexten':{'type':Sequelize[_0xedd6('0x2')]},'destpriority':{'type':Sequelize[_0xedd6('0x2')]},'destuniqueid':{'type':Sequelize[_0xedd6('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xedd6('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xedd6('0x2')]},'transfer':{'type':Sequelize[_0xedd6('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xedd6('0x6')},'transferexten':{'type':Sequelize[_0xedd6('0x2')]},'transferuniqueid':{'type':Sequelize[_0xedd6('0x2')]},'agententerreason':{'type':Sequelize[_0xedd6('0x5')],'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 eb5ade3..96ff10b 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(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 a7e3dcd..a251271 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 _0x1d7e=['rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','util','../../config/logger','api','bluebird','path'];(function(_0x467d2c,_0x4458f8){var _0x2b90c1=function(_0x19d1da){while(--_0x19d1da){_0x467d2c['push'](_0x467d2c['shift']());}};_0x2b90c1(++_0x4458f8);}(_0x1d7e,0x7d));var _0xe1d7=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x1d7e[_0x134c2e];return _0x2825db;};'use strict';var _=require('lodash');var util=require(_0xe1d7('0x0'));var logger=require(_0xe1d7('0x1'))(_0xe1d7('0x2'));var moment=require('moment');var BPromise=require(_0xe1d7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe1d7('0x4'));var rimraf=require(_0xe1d7('0x5'));var config=require(_0xe1d7('0x6'));var attributes=require(_0xe1d7('0x7'));module[_0xe1d7('0x8')]=function(_0x4058fe,_0x252026){return _0x4058fe[_0xe1d7('0x9')](_0xe1d7('0xa'),attributes,{'tableName':_0xe1d7('0xb'),'paranoid':![],'indexes':[{'fields':[_0xe1d7('0xc'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x448b=['rimraf','../../config/environment','./voiceAgentReport.attributes','exports','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x53e6a8,_0x19ef02){var _0x294d8f=function(_0x42002f){while(--_0x42002f){_0x53e6a8['push'](_0x53e6a8['shift']());}};_0x294d8f(++_0x19ef02);}(_0x448b,0x125));var _0xb448=function(_0x56e0a5,_0x5a8fe4){_0x56e0a5=_0x56e0a5-0x0;var _0x238606=_0x448b[_0x56e0a5];return _0x238606;};'use strict';var _=require(_0xb448('0x0'));var util=require(_0xb448('0x1'));var logger=require(_0xb448('0x2'))(_0xb448('0x3'));var moment=require(_0xb448('0x4'));var BPromise=require(_0xb448('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb448('0x6'));var rimraf=require(_0xb448('0x7'));var config=require(_0xb448('0x8'));var attributes=require(_0xb448('0x9'));module[_0xb448('0xa')]=function(_0x276466,_0x3670cb){return _0x276466['define'](_0xb448('0xb'),attributes,{'tableName':_0xb448('0xc'),'paranoid':![],'indexes':[{'fields':[_0xb448('0xd'),_0xb448('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index bd5ae07..0812aa7 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 _0x0592=['request','then','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','CreateVoiceAgentReport','VoiceAgentReport','options','stringify','catch','UpdateVoiceAgentReport','update','body','raw','where','attributes','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x3fda90,_0x4a08fd){var _0x48a0ea=function(_0xcb161a){while(--_0xcb161a){_0x3fda90['push'](_0x3fda90['shift']());}};_0x48a0ea(++_0x4a08fd);}(_0x0592,0x96));var _0x2059=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0592[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2059('0x0'));var util=require(_0x2059('0x1'));var moment=require('moment');var BPromise=require(_0x2059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2059('0x3'));var db=require(_0x2059('0x4'))['db'];var utils=require(_0x2059('0x5'));var logger=require(_0x2059('0x6'))(_0x2059('0x7'));var config=require(_0x2059('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2059('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2855c0,_0x1d0580,_0xf4509a){return new BPromise(function(_0x43f5d2,_0xcbc0b9){return client[_0x2059('0xa')](_0x2855c0,_0xf4509a)[_0x2059('0xb')](function(_0x124fab){logger['info'](_0x2059('0xc'),_0x1d0580,'request\x20sent');logger[_0x2059('0xd')](_0x2059('0xe'),_0x1d0580,_0x2059('0xf'),JSON['stringify'](_0x124fab));if(_0x124fab[_0x2059('0x10')]){if(_0x124fab[_0x2059('0x10')][_0x2059('0x11')]===0x1f4){logger[_0x2059('0x10')](_0x2059('0xc'),_0x1d0580,_0x124fab['error'][_0x2059('0x12')]);return _0xcbc0b9(_0x124fab[_0x2059('0x10')][_0x2059('0x12')]);}logger[_0x2059('0x10')](_0x2059('0xc'),_0x1d0580,_0x124fab[_0x2059('0x10')][_0x2059('0x12')]);return _0x43f5d2(_0x124fab[_0x2059('0x10')][_0x2059('0x12')]);}else{logger[_0x2059('0x13')](_0x2059('0xc'),_0x1d0580,_0x2059('0xf'));_0x43f5d2(_0x124fab['result'][_0x2059('0x12')]);}})['catch'](function(_0x400d79){logger['error'](_0x2059('0xc'),_0x1d0580,_0x400d79);_0xcbc0b9(_0x400d79);});});}exports[_0x2059('0x14')]=function(_0x28b754){var _0x9fc8f4=this;return new Promise(function(_0xc6cd94,_0x577421){return db[_0x2059('0x15')]['create'](_0x28b754['body'],{'raw':_0x28b754[_0x2059('0x16')]?_0x28b754[_0x2059('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x49c1d9){logger[_0x2059('0x13')](_0x2059('0x14'),_0x28b754);logger['debug'](_0x2059('0x14'),_0x28b754,JSON[_0x2059('0x17')](_0x49c1d9));_0xc6cd94(_0x49c1d9);})[_0x2059('0x18')](function(_0x57a326){logger[_0x2059('0x10')](_0x2059('0x14'),_0x57a326['message'],_0x28b754);_0x577421(_0x9fc8f4[_0x2059('0x10')](0x1f4,_0x57a326['message']));});});};exports[_0x2059('0x19')]=function(_0x2800c9){var _0x2f2dca=this;return new Promise(function(_0x1358f9,_0x22b11c){return db[_0x2059('0x15')][_0x2059('0x1a')](_0x2800c9[_0x2059('0x1b')],{'raw':_0x2800c9[_0x2059('0x16')]?_0x2800c9[_0x2059('0x16')][_0x2059('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2800c9[_0x2059('0x16')]?_0x2800c9['options'][_0x2059('0x1d')]||null:null,'attributes':_0x2800c9[_0x2059('0x16')]?_0x2800c9[_0x2059('0x16')][_0x2059('0x1e')]||null:null,'limit':_0x2800c9[_0x2059('0x16')]?_0x2800c9['options'][_0x2059('0x1f')]||null:null})[_0x2059('0xb')](function(_0x1070af){logger[_0x2059('0x13')]('UpdateVoiceAgentReport',_0x2800c9);logger[_0x2059('0xd')](_0x2059('0x19'),_0x2800c9,JSON[_0x2059('0x17')](_0x1070af));_0x1358f9(_0x1070af);})[_0x2059('0x18')](function(_0x1ae6aa){logger[_0x2059('0x10')](_0x2059('0x19'),_0x1ae6aa['message'],_0x2800c9);_0x22b11c(_0x2f2dca[_0x2059('0x10')](0x1f4,_0x1ae6aa[_0x2059('0x12')]));});});}; \ No newline at end of file +var _0xae58=['stringify','update','where','attributes','limit','UpdateVoiceAgentReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw'];(function(_0x26f1ad,_0x494ebf){var _0x2310fb=function(_0x17eaf7){while(--_0x17eaf7){_0x26f1ad['push'](_0x26f1ad['shift']());}};_0x2310fb(++_0x494ebf);}(_0xae58,0xdf));var _0x8ae5=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0xae58[_0x3c504b];return _0x2e5354;};'use strict';var _=require(_0x8ae5('0x0'));var util=require(_0x8ae5('0x1'));var moment=require('moment');var BPromise=require(_0x8ae5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8ae5('0x3'));var db=require(_0x8ae5('0x4'))['db'];var utils=require(_0x8ae5('0x5'));var logger=require(_0x8ae5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8ae5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x49a49b,_0x596d9c,_0x239f49){return new BPromise(function(_0x41c8de,_0x73ffb8){return client[_0x8ae5('0x8')](_0x49a49b,_0x239f49)[_0x8ae5('0x9')](function(_0xf1f28b){logger[_0x8ae5('0xa')](_0x8ae5('0xb'),_0x596d9c,_0x8ae5('0xc'));logger[_0x8ae5('0xd')](_0x8ae5('0xe'),_0x596d9c,_0x8ae5('0xc'),JSON['stringify'](_0xf1f28b));if(_0xf1f28b[_0x8ae5('0xf')]){if(_0xf1f28b[_0x8ae5('0xf')][_0x8ae5('0x10')]===0x1f4){logger[_0x8ae5('0xf')](_0x8ae5('0xb'),_0x596d9c,_0xf1f28b[_0x8ae5('0xf')]['message']);return _0x73ffb8(_0xf1f28b[_0x8ae5('0xf')][_0x8ae5('0x11')]);}logger['error'](_0x8ae5('0xb'),_0x596d9c,_0xf1f28b['error'][_0x8ae5('0x11')]);return _0x41c8de(_0xf1f28b[_0x8ae5('0xf')][_0x8ae5('0x11')]);}else{logger[_0x8ae5('0xa')](_0x8ae5('0xb'),_0x596d9c,_0x8ae5('0xc'));_0x41c8de(_0xf1f28b[_0x8ae5('0x12')]['message']);}})[_0x8ae5('0x13')](function(_0xf73d84){logger[_0x8ae5('0xf')](_0x8ae5('0xb'),_0x596d9c,_0xf73d84);_0x73ffb8(_0xf73d84);});});}exports[_0x8ae5('0x14')]=function(_0x2bc793){var _0x3facc2=this;return new Promise(function(_0x566075,_0x2bda9b){return db[_0x8ae5('0x15')]['create'](_0x2bc793[_0x8ae5('0x16')],{'raw':_0x2bc793['options']?_0x2bc793[_0x8ae5('0x17')][_0x8ae5('0x18')]===undefined?!![]:![]:!![]})[_0x8ae5('0x9')](function(_0x4019ac){logger['info'](_0x8ae5('0x14'),_0x2bc793);logger[_0x8ae5('0xd')](_0x8ae5('0x14'),_0x2bc793,JSON[_0x8ae5('0x19')](_0x4019ac));_0x566075(_0x4019ac);})['catch'](function(_0x5c02a2){logger[_0x8ae5('0xf')](_0x8ae5('0x14'),_0x5c02a2['message'],_0x2bc793);_0x2bda9b(_0x3facc2[_0x8ae5('0xf')](0x1f4,_0x5c02a2['message']));});});};exports['UpdateVoiceAgentReport']=function(_0xa7b7f0){var _0x2d5b7c=this;return new Promise(function(_0xca999c,_0x157860){return db[_0x8ae5('0x15')][_0x8ae5('0x1a')](_0xa7b7f0[_0x8ae5('0x16')],{'raw':_0xa7b7f0['options']?_0xa7b7f0['options'][_0x8ae5('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa7b7f0[_0x8ae5('0x17')]?_0xa7b7f0[_0x8ae5('0x17')][_0x8ae5('0x1b')]||null:null,'attributes':_0xa7b7f0['options']?_0xa7b7f0[_0x8ae5('0x17')][_0x8ae5('0x1c')]||null:null,'limit':_0xa7b7f0[_0x8ae5('0x17')]?_0xa7b7f0[_0x8ae5('0x17')][_0x8ae5('0x1d')]||null:null})[_0x8ae5('0x9')](function(_0x58a02c){logger[_0x8ae5('0xa')](_0x8ae5('0x1e'),_0xa7b7f0);logger['debug'](_0x8ae5('0x1e'),_0xa7b7f0,JSON[_0x8ae5('0x19')](_0x58a02c));_0xca999c(_0x58a02c);})[_0x8ae5('0x13')](function(_0x10c969){logger[_0x8ae5('0xf')](_0x8ae5('0x1e'),_0x10c969[_0x8ae5('0x11')],_0xa7b7f0);_0x157860(_0x2d5b7c[_0x8ae5('0xf')](0x1f4,_0x10c969[_0x8ae5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index eaf2c66..a71d1b4 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 _0xe5b3=['../../config/environment','./voiceCallReport.controller','get','index','isAuthenticated','describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x45c98a,_0x3f2968){var _0x1099dd=function(_0x2daced){while(--_0x2daced){_0x45c98a['push'](_0x45c98a['shift']());}};_0x1099dd(++_0x3f2968);}(_0xe5b3,0x133));var _0x3e5b=function(_0x54c8d8,_0x56defc){_0x54c8d8=_0x54c8d8-0x0;var _0x1f9e91=_0xe5b3[_0x54c8d8];return _0x1f9e91;};'use strict';var multer=require('multer');var util=require(_0x3e5b('0x0'));var path=require(_0x3e5b('0x1'));var timeout=require(_0x3e5b('0x2'));var express=require(_0x3e5b('0x3'));var router=express[_0x3e5b('0x4')]();var fs_extra=require(_0x3e5b('0x5'));var auth=require(_0x3e5b('0x6'));var interaction=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var controller=require(_0x3e5b('0x9'));router[_0x3e5b('0xa')]('/',auth['isAuthenticated'](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0xa')]('/describe',auth[_0x3e5b('0xc')](),controller[_0x3e5b('0xd')]);router[_0x3e5b('0xa')](_0x3e5b('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x3e5b('0xf')]('/',auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x10')]);router[_0x3e5b('0x11')](_0x3e5b('0xe'),auth['isAuthenticated'](),controller[_0x3e5b('0x12')]);router['delete'](_0x3e5b('0xe'),auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x13')]);module[_0x3e5b('0x14')]=router; \ No newline at end of file +var _0x6b8f=['destroy','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put'];(function(_0xd6a1c9,_0x203324){var _0x51ea29=function(_0x165a30){while(--_0x165a30){_0xd6a1c9['push'](_0xd6a1c9['shift']());}};_0x51ea29(++_0x203324);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0xbce8b9,_0x4143d1){_0xbce8b9=_0xbce8b9-0x0;var _0x3ad3c9=_0x6b8f[_0xbce8b9];return _0x3ad3c9;};'use strict';var multer=require('multer');var util=require(_0xf6b8('0x0'));var path=require('path');var timeout=require(_0xf6b8('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf6b8('0x2'));var auth=require(_0xf6b8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf6b8('0x4'));var controller=require(_0xf6b8('0x5'));router[_0xf6b8('0x6')]('/',auth['isAuthenticated'](),controller[_0xf6b8('0x7')]);router[_0xf6b8('0x6')](_0xf6b8('0x8'),auth[_0xf6b8('0x9')](),controller['describe']);router['get'](_0xf6b8('0xa'),auth['isAuthenticated'](),controller[_0xf6b8('0xb')]);router[_0xf6b8('0xc')]('/',auth[_0xf6b8('0x9')](),controller[_0xf6b8('0xd')]);router[_0xf6b8('0xe')](_0xf6b8('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xf6b8('0xa'),auth[_0xf6b8('0x9')](),controller[_0xf6b8('0xf')]);module[_0xf6b8('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 2c7e40f..6adb3af 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 _0x88c3=['internal','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','STRING'];(function(_0x5eed40,_0x4796c0){var _0x53aa66=function(_0x1a9e74){while(--_0x1a9e74){_0x5eed40['push'](_0x5eed40['shift']());}};_0x53aa66(++_0x4796c0);}(_0x88c3,0x1ee));var _0x388c=function(_0x324e2d,_0xe331d8){_0x324e2d=_0x324e2d-0x0;var _0x175255=_0x88c3[_0x324e2d];return _0x175255;};'use strict';var Sequelize=require(_0x388c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x388c('0x1')]},'type':{'type':Sequelize['ENUM']('inbound',_0x388c('0x2'),'outbound','inbound-fax',_0x388c('0x3'),_0x388c('0x4'))},'tag':{'type':Sequelize[_0x388c('0x1')]},'accountcode':{'type':Sequelize[_0x388c('0x1')]},'source':{'type':Sequelize[_0x388c('0x1')]},'destination':{'type':Sequelize[_0x388c('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x388c('0x1')]},'channel':{'type':Sequelize[_0x388c('0x1')]},'destinationchannel':{'type':Sequelize[_0x388c('0x1')]},'lastapplication':{'type':Sequelize[_0x388c('0x1')]},'lastdata':{'type':Sequelize[_0x388c('0x5')]},'starttime':{'type':Sequelize[_0x388c('0x6')]},'systemanswertime':{'type':Sequelize[_0x388c('0x6')]},'answertime':{'type':Sequelize[_0x388c('0x6')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x388c('0x7')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x388c('0x1')]},'amaflags':{'type':Sequelize[_0x388c('0x1')]},'userfield':{'type':Sequelize[_0x388c('0x1')]},'userDisposition':{'type':Sequelize[_0x388c('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x388c('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x388c('0x1')]},'note':{'type':Sequelize[_0x388c('0x1')]},'prefix':{'type':Sequelize[_0x388c('0x1')]},'routeid':{'type':Sequelize[_0x388c('0x7')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x845f=['sequelize','exports','STRING','inbound','internal','outbound','inbound-fax','outbound-fax','TEXT','DATE','INTEGER'];(function(_0x1f1e31,_0x27b5c3){var _0x229b56=function(_0x16db77){while(--_0x16db77){_0x1f1e31['push'](_0x1f1e31['shift']());}};_0x229b56(++_0x27b5c3);}(_0x845f,0x1b8));var _0xf845=function(_0x5c7a85,_0x41dd19){_0x5c7a85=_0x5c7a85-0x0;var _0x35290f=_0x845f[_0x5c7a85];return _0x35290f;};'use strict';var Sequelize=require(_0xf845('0x0'));module[_0xf845('0x1')]={'uniqueid':{'type':Sequelize[_0xf845('0x2')]},'type':{'type':Sequelize['ENUM'](_0xf845('0x3'),_0xf845('0x4'),_0xf845('0x5'),_0xf845('0x6'),_0xf845('0x7'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xf845('0x2')]},'source':{'type':Sequelize[_0xf845('0x2')]},'destination':{'type':Sequelize[_0xf845('0x2')]},'destinationcontext':{'type':Sequelize[_0xf845('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf845('0x2')]},'destinationchannel':{'type':Sequelize[_0xf845('0x2')]},'lastapplication':{'type':Sequelize[_0xf845('0x2')]},'lastdata':{'type':Sequelize[_0xf845('0x8')]},'starttime':{'type':Sequelize[_0xf845('0x9')]},'systemanswertime':{'type':Sequelize[_0xf845('0x9')]},'answertime':{'type':Sequelize[_0xf845('0x9')]},'endtime':{'type':Sequelize[_0xf845('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xf845('0xa')]},'mohtime':{'type':Sequelize[_0xf845('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf845('0x2')]},'amaflags':{'type':Sequelize[_0xf845('0x2')]},'userfield':{'type':Sequelize[_0xf845('0x2')]},'userDisposition':{'type':Sequelize[_0xf845('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xf845('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xf845('0x2')]},'note':{'type':Sequelize[_0xf845('0x2')]},'prefix':{'type':Sequelize[_0xf845('0x2')]},'routeid':{'type':Sequelize[_0xf845('0xa')]},'sipcallid':{'type':Sequelize[_0xf845('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index e894125..030e4fe 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 _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x269ea9,_0x3e8555){var _0x4864f0=function(_0x38c290){while(--_0x38c290){_0x269ea9['push'](_0x269ea9['shift']());}};_0x4864f0(++_0x3e8555);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c8567,_0x5180c6){_0x1c8567=_0x1c8567-0x0;var _0x5309fd=_0xb10b[_0x1c8567];return _0x5309fd;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file +var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','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','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0xdd2bfa,_0x5bd304){var _0x55397e=function(_0x196f7d){while(--_0x196f7d){_0xdd2bfa['push'](_0xdd2bfa['shift']());}};_0x55397e(++_0x5bd304);}(_0x2ef3,0xba));var _0x32ef=function(_0x1aa819,_0x5ebced){_0x1aa819=_0x1aa819-0x0;var _0x1eb4c3=_0x2ef3[_0x1aa819];return _0x1eb4c3;};'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['VoiceCallReport'][_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')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 611b115..223685c 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 _0x735a=['path','rimraf','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','util','../../config/logger','bluebird','request-promise'];(function(_0x4b8171,_0x275da1){var _0x3f0288=function(_0x1a3a32){while(--_0x1a3a32){_0x4b8171['push'](_0x4b8171['shift']());}};_0x3f0288(++_0x275da1);}(_0x735a,0x1a9));var _0xa735=function(_0x5b56ef,_0x32a433){_0x5b56ef=_0x5b56ef-0x0;var _0x231d5a=_0x735a[_0x5b56ef];return _0x231d5a;};'use strict';var _=require('lodash');var util=require(_0xa735('0x0'));var logger=require(_0xa735('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa735('0x2'));var rp=require(_0xa735('0x3'));var fs=require('fs');var path=require(_0xa735('0x4'));var rimraf=require(_0xa735('0x5'));var config=require('../../config/environment');var attributes=require(_0xa735('0x6'));module[_0xa735('0x7')]=function(_0x4408fe,_0x2704b9){return _0x4408fe[_0xa735('0x8')](_0xa735('0x9'),attributes,{'tableName':_0xa735('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcd7c=['bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','define','report_call','uniqueid','lodash','util','api','moment'];(function(_0x3e93de,_0x14b773){var _0x122037=function(_0x2afcfa){while(--_0x2afcfa){_0x3e93de['push'](_0x3e93de['shift']());}};_0x122037(++_0x14b773);}(_0xcd7c,0x104));var _0xccd7=function(_0x203634,_0x14dfc9){_0x203634=_0x203634-0x0;var _0x3c0a7a=_0xcd7c[_0x203634];return _0x3c0a7a;};'use strict';var _=require(_0xccd7('0x0'));var util=require(_0xccd7('0x1'));var logger=require('../../config/logger')(_0xccd7('0x2'));var moment=require(_0xccd7('0x3'));var BPromise=require(_0xccd7('0x4'));var rp=require(_0xccd7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xccd7('0x6'));var config=require(_0xccd7('0x7'));var attributes=require(_0xccd7('0x8'));module['exports']=function(_0x1810ba,_0x1ba7f4){return _0x1810ba[_0xccd7('0x9')]('VoiceCallReport',attributes,{'tableName':_0xccd7('0xa'),'paranoid':![],'indexes':[{'fields':[_0xccd7('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index d435165..6735c3d 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 _0xb13b=['info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','where','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','VoiceCallReport','create','body','raw','UpdateVoiceCallReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb13b,0x12a));var _0xbb13=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb13b[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0xbb13('0x0'));var moment=require(_0xbb13('0x1'));var BPromise=require(_0xbb13('0x2'));var rs=require(_0xbb13('0x3'));var fs=require('fs');var Redis=require(_0xbb13('0x4'));var db=require(_0xbb13('0x5'))['db'];var utils=require(_0xbb13('0x6'));var logger=require(_0xbb13('0x7'))('rpc');var config=require(_0xbb13('0x8'));var jayson=require(_0xbb13('0x9'));var client=jayson[_0xbb13('0xa')][_0xbb13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2976d3,_0x3aae02,_0x3a2501){return new BPromise(function(_0x7358a5,_0x311252){return client[_0xbb13('0xc')](_0x2976d3,_0x3a2501)[_0xbb13('0xd')](function(_0xacf0c4){logger[_0xbb13('0xe')](_0xbb13('0xf'),_0x3aae02,_0xbb13('0x10'));logger[_0xbb13('0x11')](_0xbb13('0x12'),_0x3aae02,'request\x20sent',JSON[_0xbb13('0x13')](_0xacf0c4));if(_0xacf0c4['error']){if(_0xacf0c4['error']['code']===0x1f4){logger[_0xbb13('0x14')]('VoiceCallReport,\x20%s,\x20%s',_0x3aae02,_0xacf0c4[_0xbb13('0x14')][_0xbb13('0x15')]);return _0x311252(_0xacf0c4[_0xbb13('0x14')][_0xbb13('0x15')]);}logger[_0xbb13('0x14')](_0xbb13('0xf'),_0x3aae02,_0xacf0c4[_0xbb13('0x14')][_0xbb13('0x15')]);return _0x7358a5(_0xacf0c4[_0xbb13('0x14')][_0xbb13('0x15')]);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x3aae02,_0xbb13('0x10'));_0x7358a5(_0xacf0c4[_0xbb13('0x16')]['message']);}})[_0xbb13('0x17')](function(_0x1bcc2f){logger[_0xbb13('0x14')](_0xbb13('0xf'),_0x3aae02,_0x1bcc2f);_0x311252(_0x1bcc2f);});});}exports['GetVoiceCallReport']=function(_0x439c56){var _0x403f98=this;return new Promise(function(_0x83adf7,_0x1cd7e3){return db['VoiceCallReport'][_0xbb13('0x18')]({'raw':_0x439c56[_0xbb13('0x19')]?_0x439c56[_0xbb13('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x439c56[_0xbb13('0x19')]?_0x439c56[_0xbb13('0x19')][_0xbb13('0x1a')]||null:null,'attributes':_0x439c56[_0xbb13('0x19')]?_0x439c56['options'][_0xbb13('0x1b')]||null:null,'limit':_0x439c56['options']?_0x439c56[_0xbb13('0x19')][_0xbb13('0x1c')]||null:null,'include':_0x439c56[_0xbb13('0x19')]?_0x439c56[_0xbb13('0x19')][_0xbb13('0x1d')]?_[_0xbb13('0x1e')](_0x439c56[_0xbb13('0x19')][_0xbb13('0x1d')],function(_0x2f7a24){return{'model':db[_0x2f7a24[_0xbb13('0x1f')]],'as':_0x2f7a24['as'],'attributes':_0x2f7a24[_0xbb13('0x1b')],'include':_0x2f7a24['include']?_[_0xbb13('0x1e')](_0x2f7a24[_0xbb13('0x1d')],function(_0x4d0abe){return{'model':db[_0x4d0abe[_0xbb13('0x1f')]],'as':_0x4d0abe['as'],'attributes':_0x4d0abe[_0xbb13('0x1b')],'include':_0x4d0abe[_0xbb13('0x1d')]?_[_0xbb13('0x1e')](_0x4d0abe[_0xbb13('0x1d')],function(_0x58fbe8){return{'model':db[_0x58fbe8[_0xbb13('0x1f')]],'as':_0x58fbe8['as'],'attributes':_0x58fbe8[_0xbb13('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbb13('0xd')](function(_0x4751ad){logger[_0xbb13('0xe')]('GetVoiceCallReport',_0x439c56);logger[_0xbb13('0x11')](_0xbb13('0x20'),_0x439c56,JSON[_0xbb13('0x13')](_0x4751ad));_0x83adf7(_0x4751ad);})['catch'](function(_0x28bcbc){logger[_0xbb13('0x14')](_0xbb13('0x20'),_0x28bcbc[_0xbb13('0x15')],_0x439c56);_0x1cd7e3(_0x403f98[_0xbb13('0x14')](0x1f4,_0x28bcbc[_0xbb13('0x15')]));});});};exports[_0xbb13('0x21')]=function(_0x4cc202){var _0x387c66=this;return new Promise(function(_0x4f6831,_0x5dfb44){return db[_0xbb13('0x22')][_0xbb13('0x23')](_0x4cc202[_0xbb13('0x24')],{'raw':_0x4cc202[_0xbb13('0x19')]?_0x4cc202[_0xbb13('0x19')][_0xbb13('0x25')]===undefined?!![]:![]:!![]})[_0xbb13('0xd')](function(_0x3e3cff){logger[_0xbb13('0xe')](_0xbb13('0x21'),_0x4cc202);logger[_0xbb13('0x11')]('CreateVoiceCallReport',_0x4cc202,JSON[_0xbb13('0x13')](_0x3e3cff));_0x4f6831(_0x3e3cff);})['catch'](function(_0x6fd6){logger['error']('CreateVoiceCallReport',_0x6fd6['message'],_0x4cc202);_0x5dfb44(_0x387c66[_0xbb13('0x14')](0x1f4,_0x6fd6[_0xbb13('0x15')]));});});};exports[_0xbb13('0x26')]=function(_0x534d7a){var _0x148af9=this;return new Promise(function(_0x4ef811,_0x21b7eb){return db[_0xbb13('0x22')]['update'](_0x534d7a['body'],{'raw':_0x534d7a[_0xbb13('0x19')]?_0x534d7a[_0xbb13('0x19')][_0xbb13('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x534d7a[_0xbb13('0x19')]?_0x534d7a[_0xbb13('0x19')]['where']||null:null,'attributes':_0x534d7a[_0xbb13('0x19')]?_0x534d7a['options'][_0xbb13('0x1b')]||null:null,'limit':_0x534d7a[_0xbb13('0x19')]?_0x534d7a[_0xbb13('0x19')]['limit']||null:null})[_0xbb13('0xd')](function(_0xa2567){logger['info'](_0xbb13('0x26'),_0x534d7a);logger[_0xbb13('0x11')](_0xbb13('0x26'),_0x534d7a,JSON['stringify'](_0xa2567));_0x4ef811(_0xa2567);})[_0xbb13('0x17')](function(_0x4d1ae1){logger['error'](_0xbb13('0x26'),_0x4d1ae1[_0xbb13('0x15')],_0x534d7a);_0x21b7eb(_0x148af9[_0xbb13('0x14')](0x1f4,_0x4d1ae1[_0xbb13('0x15')]));});});}; \ No newline at end of file +var _0xa0f2=['http','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','options','raw','where','limit','include','map','model','attributes','then','catch','GetVoiceCallReport','CreateVoiceCallReport','VoiceCallReport','create','body','info','update','UpdateVoiceCallReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x5ab244,_0x304b74){var _0x3e67bb=function(_0x26a9d6){while(--_0x26a9d6){_0x5ab244['push'](_0x5ab244['shift']());}};_0x3e67bb(++_0x304b74);}(_0xa0f2,0x6b));var _0x2a0f=function(_0xb49e66,_0x47190c){_0xb49e66=_0xb49e66-0x0;var _0x109255=_0xa0f2[_0xb49e66];return _0x109255;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2a0f('0x0'));var BPromise=require(_0x2a0f('0x1'));var rs=require(_0x2a0f('0x2'));var fs=require('fs');var Redis=require(_0x2a0f('0x3'));var db=require(_0x2a0f('0x4'))['db'];var utils=require(_0x2a0f('0x5'));var logger=require(_0x2a0f('0x6'))(_0x2a0f('0x7'));var config=require('../../config/environment');var jayson=require(_0x2a0f('0x8'));var client=jayson[_0x2a0f('0x9')][_0x2a0f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x507fd0,_0x22b524,_0xc831b3){return new BPromise(function(_0x4b974f,_0x148c0f){return client['request'](_0x507fd0,_0xc831b3)['then'](function(_0x5ea415){logger['info'](_0x2a0f('0xb'),_0x22b524,_0x2a0f('0xc'));logger[_0x2a0f('0xd')](_0x2a0f('0xe'),_0x22b524,'request\x20sent',JSON[_0x2a0f('0xf')](_0x5ea415));if(_0x5ea415[_0x2a0f('0x10')]){if(_0x5ea415[_0x2a0f('0x10')][_0x2a0f('0x11')]===0x1f4){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x22b524,_0x5ea415['error'][_0x2a0f('0x12')]);return _0x148c0f(_0x5ea415[_0x2a0f('0x10')][_0x2a0f('0x12')]);}logger[_0x2a0f('0x10')](_0x2a0f('0xb'),_0x22b524,_0x5ea415['error']['message']);return _0x4b974f(_0x5ea415[_0x2a0f('0x10')][_0x2a0f('0x12')]);}else{logger['info'](_0x2a0f('0xb'),_0x22b524,_0x2a0f('0xc'));_0x4b974f(_0x5ea415[_0x2a0f('0x13')][_0x2a0f('0x12')]);}})['catch'](function(_0x526add){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x22b524,_0x526add);_0x148c0f(_0x526add);});});}exports['GetVoiceCallReport']=function(_0x47bf20){var _0xdd8248=this;return new Promise(function(_0x1f54ad,_0x3c4e3d){return db['VoiceCallReport'][_0x2a0f('0x14')]({'raw':_0x47bf20[_0x2a0f('0x15')]?_0x47bf20[_0x2a0f('0x15')][_0x2a0f('0x16')]===undefined?!![]:![]:!![],'where':_0x47bf20[_0x2a0f('0x15')]?_0x47bf20['options'][_0x2a0f('0x17')]||null:null,'attributes':_0x47bf20[_0x2a0f('0x15')]?_0x47bf20['options']['attributes']||null:null,'limit':_0x47bf20['options']?_0x47bf20['options'][_0x2a0f('0x18')]||null:null,'include':_0x47bf20['options']?_0x47bf20[_0x2a0f('0x15')][_0x2a0f('0x19')]?_[_0x2a0f('0x1a')](_0x47bf20[_0x2a0f('0x15')][_0x2a0f('0x19')],function(_0x1e2ee2){return{'model':db[_0x1e2ee2[_0x2a0f('0x1b')]],'as':_0x1e2ee2['as'],'attributes':_0x1e2ee2[_0x2a0f('0x1c')],'include':_0x1e2ee2['include']?_[_0x2a0f('0x1a')](_0x1e2ee2['include'],function(_0x19ff34){return{'model':db[_0x19ff34[_0x2a0f('0x1b')]],'as':_0x19ff34['as'],'attributes':_0x19ff34[_0x2a0f('0x1c')],'include':_0x19ff34[_0x2a0f('0x19')]?_['map'](_0x19ff34['include'],function(_0x17b2bb){return{'model':db[_0x17b2bb[_0x2a0f('0x1b')]],'as':_0x17b2bb['as'],'attributes':_0x17b2bb['attributes']};}):[]};}):[]};}):[]:[]})[_0x2a0f('0x1d')](function(_0x5cc2cc){logger['info']('GetVoiceCallReport',_0x47bf20);logger[_0x2a0f('0xd')]('GetVoiceCallReport',_0x47bf20,JSON['stringify'](_0x5cc2cc));_0x1f54ad(_0x5cc2cc);})[_0x2a0f('0x1e')](function(_0x3d72bf){logger[_0x2a0f('0x10')](_0x2a0f('0x1f'),_0x3d72bf[_0x2a0f('0x12')],_0x47bf20);_0x3c4e3d(_0xdd8248[_0x2a0f('0x10')](0x1f4,_0x3d72bf[_0x2a0f('0x12')]));});});};exports[_0x2a0f('0x20')]=function(_0x54dfb1){var _0x3d9644=this;return new Promise(function(_0x43cf7f,_0x37fd93){return db[_0x2a0f('0x21')][_0x2a0f('0x22')](_0x54dfb1[_0x2a0f('0x23')],{'raw':_0x54dfb1['options']?_0x54dfb1[_0x2a0f('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x2a0f('0x1d')](function(_0x38447d){logger[_0x2a0f('0x24')](_0x2a0f('0x20'),_0x54dfb1);logger[_0x2a0f('0xd')](_0x2a0f('0x20'),_0x54dfb1,JSON[_0x2a0f('0xf')](_0x38447d));_0x43cf7f(_0x38447d);})[_0x2a0f('0x1e')](function(_0x291c7c){logger[_0x2a0f('0x10')]('CreateVoiceCallReport',_0x291c7c[_0x2a0f('0x12')],_0x54dfb1);_0x37fd93(_0x3d9644[_0x2a0f('0x10')](0x1f4,_0x291c7c['message']));});});};exports['UpdateVoiceCallReport']=function(_0x8ed381){var _0x1d6653=this;return new Promise(function(_0x9ff2de,_0xe05c09){return db[_0x2a0f('0x21')][_0x2a0f('0x25')](_0x8ed381[_0x2a0f('0x23')],{'raw':_0x8ed381['options']?_0x8ed381[_0x2a0f('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8ed381['options']?_0x8ed381['options'][_0x2a0f('0x17')]||null:null,'attributes':_0x8ed381[_0x2a0f('0x15')]?_0x8ed381[_0x2a0f('0x15')][_0x2a0f('0x1c')]||null:null,'limit':_0x8ed381[_0x2a0f('0x15')]?_0x8ed381[_0x2a0f('0x15')]['limit']||null:null})[_0x2a0f('0x1d')](function(_0x5ba44a){logger['info'](_0x2a0f('0x26'),_0x8ed381);logger[_0x2a0f('0xd')](_0x2a0f('0x26'),_0x8ed381,JSON[_0x2a0f('0xf')](_0x5ba44a));_0x9ff2de(_0x5ba44a);})[_0x2a0f('0x1e')](function(_0x377c5b){logger[_0x2a0f('0x10')]('UpdateVoiceCallReport',_0x377c5b[_0x2a0f('0x12')],_0x8ed381);_0xe05c09(_0x1d6653[_0x2a0f('0x10')](0x1f4,_0x377c5b['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 1d9a976..d90adb8 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 _0x6ff7=['../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create','put','/:id','update','multer','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x3866df,_0x32d3e4){var _0x368f13=function(_0x44ce5f){while(--_0x44ce5f){_0x3866df['push'](_0x3866df['shift']());}};_0x368f13(++_0x32d3e4);}(_0x6ff7,0x91));var _0x76ff=function(_0x248287,_0x587a03){_0x248287=_0x248287-0x0;var _0x8fb33=_0x6ff7[_0x248287];return _0x8fb33;};'use strict';var multer=require(_0x76ff('0x0'));var util=require('util');var path=require(_0x76ff('0x1'));var timeout=require(_0x76ff('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x76ff('0x3'));var auth=require(_0x76ff('0x4'));var interaction=require(_0x76ff('0x5'));var config=require(_0x76ff('0x6'));var controller=require('./voiceChanSpy.controller');router[_0x76ff('0x7')]('/',auth[_0x76ff('0x8')](),controller['index']);router[_0x76ff('0x7')]('/:id',auth[_0x76ff('0x8')](),controller[_0x76ff('0x9')]);router[_0x76ff('0xa')]('/',auth[_0x76ff('0x8')](),controller[_0x76ff('0xb')]);router[_0x76ff('0xc')](_0x76ff('0xd'),auth[_0x76ff('0x8')](),controller[_0x76ff('0xe')]);router['delete'](_0x76ff('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa388=['fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','index','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','multer','connect-timeout','Router'];(function(_0x1f1ed4,_0x251ff1){var _0x3fe91a=function(_0x2595cc){while(--_0x2595cc){_0x1f1ed4['push'](_0x1f1ed4['shift']());}};_0x3fe91a(++_0x251ff1);}(_0xa388,0x10d));var _0x8a38=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa388[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8a38('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8a38('0x1'));var express=require('express');var router=express[_0x8a38('0x2')]();var fs_extra=require(_0x8a38('0x3'));var auth=require(_0x8a38('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8a38('0x5'));var controller=require(_0x8a38('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x8a38('0x7')]);router[_0x8a38('0x8')](_0x8a38('0x9'),auth[_0x8a38('0xa')](),controller[_0x8a38('0xb')]);router[_0x8a38('0xc')]('/',auth[_0x8a38('0xa')](),controller[_0x8a38('0xd')]);router[_0x8a38('0xe')](_0x8a38('0x9'),auth[_0x8a38('0xa')](),controller['update']);router[_0x8a38('0xf')](_0x8a38('0x9'),auth[_0x8a38('0xa')](),controller[_0x8a38('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index ea770f1..147f5b2 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 _0x54dc=['options','join','getDataValue','split','BOOLEAN','STRING','setDataValue'];(function(_0x18ad12,_0x2348dd){var _0x278436=function(_0x3a57ff){while(--_0x3a57ff){_0x18ad12['push'](_0x18ad12['shift']());}};_0x278436(++_0x2348dd);}(_0x54dc,0x140));var _0xc54d=function(_0x17fc83,_0x155791){_0x17fc83=_0x17fc83-0x0;var _0x122710=_0x54dc[_0x17fc83];return _0x122710;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xc54d('0x0')],'set':function(_0x315f08){this[_0xc54d('0x1')](_0xc54d('0x2'),_0x315f08?_0x315f08[_0xc54d('0x3')](''):[]);},'get':function(){return this[_0xc54d('0x4')]('options')?this[_0xc54d('0x4')](_0xc54d('0x2'))[_0xc54d('0x5')](''):[];}},'auth':{'type':Sequelize[_0xc54d('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0xc54d('0x0')]},'record':{'type':Sequelize[_0xc54d('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc54d('0x0')]}}; \ No newline at end of file +var _0xc84a=['BOOLEAN','sequelize','exports','STRING','options','join','split'];(function(_0x19a28d,_0x472544){var _0x5368ff=function(_0x5311db){while(--_0x5311db){_0x19a28d['push'](_0x19a28d['shift']());}};_0x5368ff(++_0x472544);}(_0xc84a,0x14a));var _0xac84=function(_0x4b633b,_0x4ba81a){_0x4b633b=_0x4b633b-0x0;var _0x3684be=_0xc84a[_0x4b633b];return _0x3684be;};'use strict';var Sequelize=require(_0xac84('0x0'));module[_0xac84('0x1')]={'name':{'type':Sequelize[_0xac84('0x2')]},'prefix':{'type':Sequelize[_0xac84('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x2fdc86){this['setDataValue'](_0xac84('0x3'),_0x2fdc86?_0x2fdc86[_0xac84('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0xac84('0x3'))?this['getDataValue'](_0xac84('0x3'))[_0xac84('0x5')](''):[];}},'auth':{'type':Sequelize[_0xac84('0x6')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xac84('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xac84('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 47d3c6c..a2db8fb 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 _0x049e=['map','rawAttributes','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','VoiceChanSpy','includeAll','include','rows','catch','show','params','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','ChanSpies','destroy','end','error','stack','name','send','index'];(function(_0x102881,_0x58d723){var _0x5c63d0=function(_0x955c59){while(--_0x955c59){_0x102881['push'](_0x102881['shift']());}};_0x5c63d0(++_0x58d723);}(_0x049e,0x16a));var _0xe049=function(_0x454e6d,_0x1e1f38){_0x454e6d=_0x454e6d-0x0;var _0x4bc294=_0x049e[_0x454e6d];return _0x4bc294;};'use strict';var emlformat=require(_0xe049('0x0'));var rimraf=require(_0xe049('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe049('0x2'));var rp=require('request-promise');var moment=require(_0xe049('0x3'));var BPromise=require(_0xe049('0x4'));var Mustache=require(_0xe049('0x5'));var util=require(_0xe049('0x6'));var path=require(_0xe049('0x7'));var sox=require('sox');var csv=require(_0xe049('0x8'));var ejs=require(_0xe049('0x9'));var fs=require('fs');var fs_extra=require(_0xe049('0xa'));var _=require(_0xe049('0xb'));var squel=require(_0xe049('0xc'));var crypto=require(_0xe049('0xd'));var jsforce=require(_0xe049('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe049('0x8'));var querystring=require(_0xe049('0xf'));var Papa=require(_0xe049('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe049('0x11'));var as=require(_0xe049('0x12'));var hardwareService=require(_0xe049('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe049('0x14'));var licenseUtil=require(_0xe049('0x15'));var db=require(_0xe049('0x16'))['db'];function respondWithStatusCode(_0x359931,_0x301c7e){_0x301c7e=_0x301c7e||0xcc;return function(_0x1021e7){if(_0x1021e7){return _0x359931[_0xe049('0x17')](_0x301c7e);}return _0x359931[_0xe049('0x18')](_0x301c7e)['end']();};}function respondWithResult(_0x20c286,_0x3f4a57){_0x3f4a57=_0x3f4a57||0xc8;return function(_0x3924a4){if(_0x3924a4){return _0x20c286[_0xe049('0x18')](_0x3f4a57)['json'](_0x3924a4);}};}function respondWithFilteredResult(_0x3a539b,_0xcc35b6){return function(_0x5c90fd){if(_0x5c90fd){var _0x388be0=typeof _0xcc35b6[_0xe049('0x19')]==='undefined'&&typeof _0xcc35b6[_0xe049('0x1a')]===_0xe049('0x1b');var _0x5d435b=_0x5c90fd[_0xe049('0x1c')];var _0x54c303=_0x388be0?0x0:_0xcc35b6['offset'];var _0x3cbbeb=_0x388be0?_0x5c90fd['count']:_0xcc35b6['offset']+_0xcc35b6[_0xe049('0x1a')];var _0x1092ec;if(_0x3cbbeb>=_0x5d435b){_0x3cbbeb=_0x5d435b;_0x1092ec=0xc8;}else{_0x1092ec=0xce;}_0x3a539b['status'](_0x1092ec);return _0x3a539b['set'](_0xe049('0x1d'),_0x54c303+'-'+_0x3cbbeb+'/'+_0x5d435b)[_0xe049('0x1e')](_0x5c90fd);}return null;};}function patchUpdates(_0x1d2f5b){return function(_0x430421){try{jsonpatch['apply'](_0x430421,_0x1d2f5b,!![]);}catch(_0x572f29){return BPromise[_0xe049('0x1f')](_0x572f29);}return _0x430421[_0xe049('0x20')]();};}function saveUpdates(_0x572a80,_0x36a03b){return function(_0x3f14eb){if(_0x3f14eb){return _0x3f14eb[_0xe049('0x21')](_0x572a80)['then'](function(_0x197358){return _0x197358;});}return null;};}function removeEntity(_0x3b0f54,_0x4c7492){return function(_0x4848c9){if(_0x4848c9){return _0x4848c9['destroy']()[_0xe049('0x22')](function(){var _0x5954c0=_0x4848c9['get']({'plain':!![]});var _0x1aafd1=_0xe049('0x23');return db['UserProfileResource'][_0xe049('0x24')]({'where':{'type':_0x1aafd1,'resourceId':_0x5954c0['id']}})[_0xe049('0x22')](function(){return _0x4848c9;});})[_0xe049('0x22')](function(){_0x3b0f54[_0xe049('0x18')](0xcc)[_0xe049('0x25')]();});}};}function handleEntityNotFound(_0x1843b8,_0x5b0e64){return function(_0x50552d){if(!_0x50552d){_0x1843b8[_0xe049('0x17')](0x194);}return _0x50552d;};}function handleError(_0x542c7c,_0x38ff5b){_0x38ff5b=_0x38ff5b||0x1f4;return function(_0x495d33){logger[_0xe049('0x26')](_0x495d33[_0xe049('0x27')]);if(_0x495d33['name']){delete _0x495d33[_0xe049('0x28')];}_0x542c7c[_0xe049('0x18')](_0x38ff5b)[_0xe049('0x29')](_0x495d33);};}exports[_0xe049('0x2a')]=function(_0x4464b2,_0x4055fc){var _0x123d2e={},_0x44faff={},_0x4038f0={'count':0x0,'rows':[]};var _0x1a4b97=_[_0xe049('0x2b')](db['VoiceChanSpy'][_0xe049('0x2c')],function(_0x1e99c8){return{'name':_0x1e99c8['fieldName'],'type':_0x1e99c8['type']['key']};});_0x44faff['model']=_[_0xe049('0x2b')](_0x1a4b97,_0xe049('0x28'));_0x44faff[_0xe049('0x2d')]=_[_0xe049('0x2e')](_0x4464b2[_0xe049('0x2d')]);_0x44faff['filters']=_[_0xe049('0x2f')](_0x44faff[_0xe049('0x30')],_0x44faff[_0xe049('0x2d')]);_0x123d2e[_0xe049('0x31')]=_[_0xe049('0x2f')](_0x44faff['model'],qs[_0xe049('0x32')](_0x4464b2['query'][_0xe049('0x32')]));_0x123d2e['attributes']=_0x123d2e[_0xe049('0x31')][_0xe049('0x33')]?_0x123d2e[_0xe049('0x31')]:_0x44faff[_0xe049('0x30')];if(!_0x4464b2[_0xe049('0x2d')][_0xe049('0x34')](_0xe049('0x35'))){_0x123d2e[_0xe049('0x1a')]=qs[_0xe049('0x1a')](_0x4464b2[_0xe049('0x2d')][_0xe049('0x1a')]);_0x123d2e['offset']=qs[_0xe049('0x19')](_0x4464b2[_0xe049('0x2d')][_0xe049('0x19')]);}_0x123d2e[_0xe049('0x36')]=qs[_0xe049('0x37')](_0x4464b2[_0xe049('0x2d')][_0xe049('0x37')]);_0x123d2e[_0xe049('0x38')]=qs['filters'](_[_0xe049('0x39')](_0x4464b2[_0xe049('0x2d')],_0x44faff[_0xe049('0x3a')]),_0x1a4b97);if(_0x4464b2[_0xe049('0x2d')][_0xe049('0x3b')]){_0x123d2e[_0xe049('0x38')]=_[_0xe049('0x3c')](_0x123d2e[_0xe049('0x38')],{'$or':_[_0xe049('0x2b')](_0x1a4b97,function(_0x3d6a4b){if(_0x3d6a4b['type']!==_0xe049('0x3d')){var _0x176374={};_0x176374[_0x3d6a4b[_0xe049('0x28')]]={'$like':'%'+_0x4464b2['query'][_0xe049('0x3b')]+'%'};return _0x176374;}})});}_0x123d2e=_['merge']({},_0x123d2e,_0x4464b2['options']);var _0x19dbc4={'where':_0x123d2e['where']};return db[_0xe049('0x3e')][_0xe049('0x1c')](_0x19dbc4)[_0xe049('0x22')](function(_0xe4f184){_0x4038f0[_0xe049('0x1c')]=_0xe4f184;if(_0x4464b2['query'][_0xe049('0x3f')]){_0x123d2e[_0xe049('0x40')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x123d2e);})[_0xe049('0x22')](function(_0x20d264){_0x4038f0[_0xe049('0x41')]=_0x20d264;return _0x4038f0;})[_0xe049('0x22')](respondWithFilteredResult(_0x4055fc,_0x123d2e))[_0xe049('0x42')](handleError(_0x4055fc,null));};exports[_0xe049('0x43')]=function(_0x56a309,_0x1a4707){var _0x3f92ee={'raw':![],'where':{'id':_0x56a309[_0xe049('0x44')]['id']}},_0x5c04f6={};_0x5c04f6[_0xe049('0x30')]=_[_0xe049('0x2e')](db[_0xe049('0x3e')][_0xe049('0x2c')]);_0x5c04f6['query']=_['keys'](_0x56a309[_0xe049('0x2d')]);_0x5c04f6[_0xe049('0x3a')]=_[_0xe049('0x2f')](_0x5c04f6[_0xe049('0x30')],_0x5c04f6[_0xe049('0x2d')]);_0x3f92ee[_0xe049('0x31')]=_['intersection'](_0x5c04f6[_0xe049('0x30')],qs[_0xe049('0x32')](_0x56a309['query'][_0xe049('0x32')]));_0x3f92ee['attributes']=_0x3f92ee[_0xe049('0x31')]['length']?_0x3f92ee[_0xe049('0x31')]:_0x5c04f6['model'];if(_0x56a309[_0xe049('0x2d')][_0xe049('0x3f')]){_0x3f92ee[_0xe049('0x40')]=[{'all':!![]}];}_0x3f92ee=_[_0xe049('0x3c')]({},_0x3f92ee,_0x56a309[_0xe049('0x45')]);return db['VoiceChanSpy'][_0xe049('0x46')](_0x3f92ee)[_0xe049('0x22')](handleEntityNotFound(_0x1a4707,null))[_0xe049('0x22')](respondWithResult(_0x1a4707,null))[_0xe049('0x42')](handleError(_0x1a4707,null));};exports[_0xe049('0x47')]=function(_0x3c15a2,_0x12f9b8){return db[_0xe049('0x3e')][_0xe049('0x47')](_0x3c15a2['body'],{})['then'](function(_0x478387){var _0xd1beaf=_0x3c15a2[_0xe049('0x48')][_0xe049('0x49')]({'plain':!![]});if(!_0xd1beaf)throw new Error(_0xe049('0x4a'));if(_0xd1beaf[_0xe049('0x4b')]===_0xe049('0x48')){var _0x2e4dce=_0x478387[_0xe049('0x49')]({'plain':!![]});var _0x23da27=_0xe049('0x23');return db['UserProfileSection'][_0xe049('0x46')]({'where':{'name':_0x23da27,'userProfileId':_0xd1beaf[_0xe049('0x4c')]},'raw':!![]})[_0xe049('0x22')](function(_0x4710ae){if(_0x4710ae&&_0x4710ae[_0xe049('0x4d')]===0x0){return db[_0xe049('0x4e')][_0xe049('0x47')]({'name':_0x2e4dce['name'],'resourceId':_0x2e4dce['id'],'type':_0x4710ae['name'],'sectionId':_0x4710ae['id']},{})['then'](function(){return _0x478387;});}else{return _0x478387;}})[_0xe049('0x42')](function(_0x2e508e){logger['error'](_0xe049('0x4f'),_0x2e508e);throw _0x2e508e;});}return _0x478387;})[_0xe049('0x22')](respondWithResult(_0x12f9b8,0xc9))[_0xe049('0x42')](handleError(_0x12f9b8,null));};exports[_0xe049('0x21')]=function(_0x4c3ba3,_0x5b0155){if(_0x4c3ba3[_0xe049('0x50')]['id']){delete _0x4c3ba3[_0xe049('0x50')]['id'];}return db['VoiceChanSpy']['find']({'where':{'id':_0x4c3ba3[_0xe049('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b0155,null))[_0xe049('0x22')](saveUpdates(_0x4c3ba3[_0xe049('0x50')],null))['then'](respondWithResult(_0x5b0155,null))[_0xe049('0x42')](handleError(_0x5b0155,null));};exports['destroy']=function(_0x356605,_0x3ec963){return db['VoiceChanSpy'][_0xe049('0x46')]({'where':{'id':_0x356605[_0xe049('0x44')]['id']}})[_0xe049('0x22')](handleEntityNotFound(_0x3ec963,null))[_0xe049('0x22')](removeEntity(_0x3ec963,null))[_0xe049('0x42')](handleError(_0x3ec963,null));}; \ No newline at end of file +var _0x3eec=['set','Content-Range','apply','reject','save','update','then','get','ChanSpies','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','VoiceChanSpy','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit'];(function(_0xbbaf03,_0x31693a){var _0x1952ba=function(_0x333606){while(--_0x333606){_0xbbaf03['push'](_0xbbaf03['shift']());}};_0x1952ba(++_0x31693a);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x261d66,_0x3039ed){_0x261d66=_0x261d66-0x0;var _0x2b967c=_0x3eec[_0x261d66];return _0x2b967c;};'use strict';var emlformat=require(_0xc3ee('0x0'));var rimraf=require(_0xc3ee('0x1'));var zipdir=require(_0xc3ee('0x2'));var jsonpatch=require(_0xc3ee('0x3'));var rp=require('request-promise');var moment=require(_0xc3ee('0x4'));var BPromise=require(_0xc3ee('0x5'));var Mustache=require(_0xc3ee('0x6'));var util=require(_0xc3ee('0x7'));var path=require(_0xc3ee('0x8'));var sox=require(_0xc3ee('0x9'));var csv=require('to-csv');var ejs=require(_0xc3ee('0xa'));var fs=require('fs');var fs_extra=require(_0xc3ee('0xb'));var _=require(_0xc3ee('0xc'));var squel=require(_0xc3ee('0xd'));var crypto=require(_0xc3ee('0xe'));var jsforce=require(_0xc3ee('0xf'));var deskjs=require(_0xc3ee('0x10'));var toCsv=require(_0xc3ee('0x11'));var querystring=require(_0xc3ee('0x12'));var Papa=require(_0xc3ee('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc3ee('0x14'));var as=require(_0xc3ee('0x15'));var hardwareService=require(_0xc3ee('0x16'));var logger=require(_0xc3ee('0x17'))('api');var utils=require(_0xc3ee('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc3ee('0x19'));var db=require(_0xc3ee('0x1a'))['db'];function respondWithStatusCode(_0x4beb01,_0x5f2c3a){_0x5f2c3a=_0x5f2c3a||0xcc;return function(_0x2eb82e){if(_0x2eb82e){return _0x4beb01['sendStatus'](_0x5f2c3a);}return _0x4beb01[_0xc3ee('0x1b')](_0x5f2c3a)['end']();};}function respondWithResult(_0x19feb3,_0x58ebe7){_0x58ebe7=_0x58ebe7||0xc8;return function(_0x3d669d){if(_0x3d669d){return _0x19feb3[_0xc3ee('0x1b')](_0x58ebe7)[_0xc3ee('0x1c')](_0x3d669d);}};}function respondWithFilteredResult(_0x664bad,_0x476f8f){return function(_0xf63359){if(_0xf63359){var _0x277e11=typeof _0x476f8f['offset']===_0xc3ee('0x1d')&&typeof _0x476f8f['limit']===_0xc3ee('0x1d');var _0x1bf49a=_0xf63359[_0xc3ee('0x1e')];var _0x219db0=_0x277e11?0x0:_0x476f8f[_0xc3ee('0x1f')];var _0x3acb0c=_0x277e11?_0xf63359[_0xc3ee('0x1e')]:_0x476f8f[_0xc3ee('0x1f')]+_0x476f8f[_0xc3ee('0x20')];var _0x202a9a;if(_0x3acb0c>=_0x1bf49a){_0x3acb0c=_0x1bf49a;_0x202a9a=0xc8;}else{_0x202a9a=0xce;}_0x664bad[_0xc3ee('0x1b')](_0x202a9a);return _0x664bad[_0xc3ee('0x21')](_0xc3ee('0x22'),_0x219db0+'-'+_0x3acb0c+'/'+_0x1bf49a)[_0xc3ee('0x1c')](_0xf63359);}return null;};}function patchUpdates(_0x3e7224){return function(_0x46a8c9){try{jsonpatch[_0xc3ee('0x23')](_0x46a8c9,_0x3e7224,!![]);}catch(_0x30df3a){return BPromise[_0xc3ee('0x24')](_0x30df3a);}return _0x46a8c9[_0xc3ee('0x25')]();};}function saveUpdates(_0x11778f,_0x493fea){return function(_0x4d672e){if(_0x4d672e){return _0x4d672e[_0xc3ee('0x26')](_0x11778f)[_0xc3ee('0x27')](function(_0x3b8f75){return _0x3b8f75;});}return null;};}function removeEntity(_0x464ffc,_0x28bfeb){return function(_0x238df7){if(_0x238df7){return _0x238df7['destroy']()[_0xc3ee('0x27')](function(){var _0x3f8f7b=_0x238df7[_0xc3ee('0x28')]({'plain':!![]});var _0xfd03bd=_0xc3ee('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0xfd03bd,'resourceId':_0x3f8f7b['id']}})[_0xc3ee('0x27')](function(){return _0x238df7;});})[_0xc3ee('0x27')](function(){_0x464ffc[_0xc3ee('0x1b')](0xcc)[_0xc3ee('0x2a')]();});}};}function handleEntityNotFound(_0x836fac,_0x4ecfec){return function(_0x56201a){if(!_0x56201a){_0x836fac['sendStatus'](0x194);}return _0x56201a;};}function handleError(_0x1be005,_0x2f2c29){_0x2f2c29=_0x2f2c29||0x1f4;return function(_0x44678b){logger[_0xc3ee('0x2b')](_0x44678b[_0xc3ee('0x2c')]);if(_0x44678b['name']){delete _0x44678b[_0xc3ee('0x2d')];}_0x1be005[_0xc3ee('0x1b')](_0x2f2c29)[_0xc3ee('0x2e')](_0x44678b);};}exports[_0xc3ee('0x2f')]=function(_0x1f7b3a,_0x8bbe1e){var _0x3b17f7={},_0x4da264={},_0x330b71={'count':0x0,'rows':[]};var _0x35c19a=_[_0xc3ee('0x30')](db['VoiceChanSpy'][_0xc3ee('0x31')],function(_0x240a16){return{'name':_0x240a16[_0xc3ee('0x32')],'type':_0x240a16[_0xc3ee('0x33')][_0xc3ee('0x34')]};});_0x4da264[_0xc3ee('0x35')]=_[_0xc3ee('0x30')](_0x35c19a,'name');_0x4da264[_0xc3ee('0x36')]=_['keys'](_0x1f7b3a[_0xc3ee('0x36')]);_0x4da264[_0xc3ee('0x37')]=_[_0xc3ee('0x38')](_0x4da264[_0xc3ee('0x35')],_0x4da264[_0xc3ee('0x36')]);_0x3b17f7[_0xc3ee('0x39')]=_['intersection'](_0x4da264[_0xc3ee('0x35')],qs[_0xc3ee('0x3a')](_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x3a')]));_0x3b17f7[_0xc3ee('0x39')]=_0x3b17f7[_0xc3ee('0x39')][_0xc3ee('0x3b')]?_0x3b17f7[_0xc3ee('0x39')]:_0x4da264[_0xc3ee('0x35')];if(!_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x3c')](_0xc3ee('0x3d'))){_0x3b17f7[_0xc3ee('0x20')]=qs[_0xc3ee('0x20')](_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x20')]);_0x3b17f7[_0xc3ee('0x1f')]=qs[_0xc3ee('0x1f')](_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x1f')]);}_0x3b17f7[_0xc3ee('0x3e')]=qs['sort'](_0x1f7b3a[_0xc3ee('0x36')]['sort']);_0x3b17f7[_0xc3ee('0x3f')]=qs[_0xc3ee('0x37')](_[_0xc3ee('0x40')](_0x1f7b3a[_0xc3ee('0x36')],_0x4da264[_0xc3ee('0x37')]),_0x35c19a);if(_0x1f7b3a[_0xc3ee('0x36')]['filter']){_0x3b17f7[_0xc3ee('0x3f')]=_[_0xc3ee('0x41')](_0x3b17f7[_0xc3ee('0x3f')],{'$or':_['map'](_0x35c19a,function(_0x181179){if(_0x181179[_0xc3ee('0x33')]!==_0xc3ee('0x42')){var _0x1fe17f={};_0x1fe17f[_0x181179[_0xc3ee('0x2d')]]={'$like':'%'+_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x43')]+'%'};return _0x1fe17f;}})});}_0x3b17f7=_[_0xc3ee('0x41')]({},_0x3b17f7,_0x1f7b3a[_0xc3ee('0x44')]);var _0x23d365={'where':_0x3b17f7[_0xc3ee('0x3f')]};return db['VoiceChanSpy'][_0xc3ee('0x1e')](_0x23d365)[_0xc3ee('0x27')](function(_0x4a89b7){_0x330b71['count']=_0x4a89b7;if(_0x1f7b3a[_0xc3ee('0x36')][_0xc3ee('0x45')]){_0x3b17f7[_0xc3ee('0x46')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xc3ee('0x47')](_0x3b17f7);})[_0xc3ee('0x27')](function(_0x112e77){_0x330b71[_0xc3ee('0x48')]=_0x112e77;return _0x330b71;})[_0xc3ee('0x27')](respondWithFilteredResult(_0x8bbe1e,_0x3b17f7))[_0xc3ee('0x49')](handleError(_0x8bbe1e,null));};exports[_0xc3ee('0x4a')]=function(_0x724c4e,_0x49b424){var _0x602d47={'raw':![],'where':{'id':_0x724c4e[_0xc3ee('0x4b')]['id']}},_0xf833d9={};_0xf833d9[_0xc3ee('0x35')]=_[_0xc3ee('0x4c')](db['VoiceChanSpy'][_0xc3ee('0x31')]);_0xf833d9['query']=_['keys'](_0x724c4e[_0xc3ee('0x36')]);_0xf833d9[_0xc3ee('0x37')]=_['intersection'](_0xf833d9[_0xc3ee('0x35')],_0xf833d9[_0xc3ee('0x36')]);_0x602d47['attributes']=_[_0xc3ee('0x38')](_0xf833d9['model'],qs[_0xc3ee('0x3a')](_0x724c4e['query'][_0xc3ee('0x3a')]));_0x602d47[_0xc3ee('0x39')]=_0x602d47['attributes']['length']?_0x602d47['attributes']:_0xf833d9[_0xc3ee('0x35')];if(_0x724c4e[_0xc3ee('0x36')][_0xc3ee('0x45')]){_0x602d47[_0xc3ee('0x46')]=[{'all':!![]}];}_0x602d47=_[_0xc3ee('0x41')]({},_0x602d47,_0x724c4e['options']);return db['VoiceChanSpy'][_0xc3ee('0x4d')](_0x602d47)[_0xc3ee('0x27')](handleEntityNotFound(_0x49b424,null))['then'](respondWithResult(_0x49b424,null))[_0xc3ee('0x49')](handleError(_0x49b424,null));};exports['create']=function(_0x60e36a,_0x5d0017){return db[_0xc3ee('0x4e')][_0xc3ee('0x4f')](_0x60e36a[_0xc3ee('0x50')],{})[_0xc3ee('0x27')](function(_0x8c8cc6){var _0x281adc=_0x60e36a[_0xc3ee('0x51')]['get']({'plain':!![]});if(!_0x281adc)throw new Error(_0xc3ee('0x52'));if(_0x281adc[_0xc3ee('0x53')]===_0xc3ee('0x51')){var _0x237aa8=_0x8c8cc6['get']({'plain':!![]});var _0xd246f2=_0xc3ee('0x29');return db[_0xc3ee('0x54')][_0xc3ee('0x4d')]({'where':{'name':_0xd246f2,'userProfileId':_0x281adc[_0xc3ee('0x55')]},'raw':!![]})[_0xc3ee('0x27')](function(_0x14df9d){if(_0x14df9d&&_0x14df9d['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x237aa8['name'],'resourceId':_0x237aa8['id'],'type':_0x14df9d[_0xc3ee('0x2d')],'sectionId':_0x14df9d['id']},{})[_0xc3ee('0x27')](function(){return _0x8c8cc6;});}else{return _0x8c8cc6;}})[_0xc3ee('0x49')](function(_0x2b9ea){logger[_0xc3ee('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b9ea);throw _0x2b9ea;});}return _0x8c8cc6;})['then'](respondWithResult(_0x5d0017,0xc9))[_0xc3ee('0x49')](handleError(_0x5d0017,null));};exports['update']=function(_0x1ca127,_0x28eca9){if(_0x1ca127[_0xc3ee('0x50')]['id']){delete _0x1ca127['body']['id'];}return db[_0xc3ee('0x4e')][_0xc3ee('0x4d')]({'where':{'id':_0x1ca127[_0xc3ee('0x4b')]['id']}})[_0xc3ee('0x27')](handleEntityNotFound(_0x28eca9,null))[_0xc3ee('0x27')](saveUpdates(_0x1ca127[_0xc3ee('0x50')],null))[_0xc3ee('0x27')](respondWithResult(_0x28eca9,null))[_0xc3ee('0x49')](handleError(_0x28eca9,null));};exports[_0xc3ee('0x56')]=function(_0x5d5ca5,_0x3fdc8f){return db[_0xc3ee('0x4e')][_0xc3ee('0x4d')]({'where':{'id':_0x5d5ca5[_0xc3ee('0x4b')]['id']}})[_0xc3ee('0x27')](handleEntityNotFound(_0x3fdc8f,null))[_0xc3ee('0x27')](removeEntity(_0x3fdc8f,null))[_0xc3ee('0x49')](handleError(_0x3fdc8f,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 6ea67b6..923dc5a 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 _0x651d=['system','push','merge','Set','format','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','User','findAll','then','catch','exports','models','define','VoiceChanSpy','VoiceExtension','destroy','bulkCreate','lodash','bluebird','./voiceChanSpy.attributes','%s%s','prefix'];(function(_0x377784,_0x1a856c){var _0xa53ae4=function(_0x155634){while(--_0x155634){_0x377784['push'](_0x377784['shift']());}};_0xa53ae4(++_0x1a856c);}(_0x651d,0x67));var _0xd651=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x651d[_0x58e469];return _0x4c01c5;};'use strict';var _=require(_0xd651('0x0'));var util=require('util');var BPromise=require(_0xd651('0x1'));var attributes=require(_0xd651('0x2'));var getUserApplications=function(_0x562e3d,_0x49a344,_0x20cf82){var _0x472f0d=0x1;var _0x8a263b=[];var _0x376ebe={'context':_0x49a344['context']||'from-sip','exten':util['format'](_0xd651('0x3'),_0x562e3d[_0xd651('0x4')],_0x20cf82),'type':_0xd651('0x5'),'isApp':![],'ChanSpyId':_0x562e3d['id'],'UserId':_0x49a344['id']};_0x8a263b[_0xd651('0x6')](_[_0xd651('0x7')]({'app':_0xd651('0x8'),'appdata':util[_0xd651('0x9')]('CDR(type)=%s',_0xd651('0xa')),'priority':_0x472f0d++},_0x376ebe));if(_0x562e3d[_0xd651('0xb')]){_0x8a263b['push'](_[_0xd651('0x7')]({'app':_0xd651('0xc'),'appdata':util[_0xd651('0x9')](_0xd651('0xd'),_0x562e3d[_0xd651('0xe')]),'priority':_0x472f0d++},_0x376ebe));}if(_0x562e3d[_0xd651('0xf')]){_0x8a263b[_0xd651('0x6')](_[_0xd651('0x7')]({'app':_0xd651('0x10'),'appdata':_0x562e3d[_0xd651('0x11')],'priority':_0x472f0d++},_0x376ebe));}_0x8a263b['push'](_[_0xd651('0x7')]({'app':'ChanSpy','appdata':util[_0xd651('0x9')](_0xd651('0x12'),_0x49a344[_0xd651('0x13')],_0x562e3d[_0xd651('0x14')]?_0x562e3d[_0xd651('0x14')]['join'](''):''),'priority':_0x472f0d++},_0x376ebe));if(_0x562e3d['record']){_0x8a263b[_0xd651('0x6')](_[_0xd651('0x7')]({'app':_0xd651('0x15'),'priority':_0x472f0d++},_0x376ebe));}return _0x8a263b;};var getChanSpyApplications=function(_0xf49a1d,_0x8cbedd){var _0x43fd87=[];for(var _0x5a7bd7=0x0,_0x4f52cd=0x1;_0x5a7bd7<_0x8cbedd[_0xd651('0x16')];_0x5a7bd7++,_0x4f52cd=0x1){_0x43fd87=_0x43fd87[_0xd651('0x17')](getUserApplications(_0xf49a1d,_0x8cbedd[_0x5a7bd7],_0x8cbedd[_0x5a7bd7][_0xd651('0x18')]));if(_0x8cbedd[_0x5a7bd7][_0xd651('0x18')]!=_0x8cbedd[_0x5a7bd7][_0xd651('0x13')]){_0x43fd87=_0x43fd87[_0xd651('0x17')](getUserApplications(_0xf49a1d,_0x8cbedd[_0x5a7bd7],_0x8cbedd[_0x5a7bd7][_0xd651('0x13')]));}}return _0x43fd87;};var getChanSpyPromise=function(_0x3ec28d,_0x260e3a){return new BPromise(function(_0x2230b0,_0x10d61c){return _0x3ec28d[_0xd651('0x19')][_0xd651('0x1a')]({'attributes':['id',_0xd651('0x13'),_0xd651('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xd651('0x1b')](function(_0x3fdfc1){if(_0x3fdfc1){return _0x2230b0(getChanSpyApplications(_0x260e3a,_0x3fdfc1));}return _0x2230b0([]);})[_0xd651('0x1c')](function(_0x29ceb5){_0x10d61c(_0x29ceb5);});});};module[_0xd651('0x1d')]=function(_0x2729e3,_0x10f4d7){var _0x26a130=_0x2729e3[_0xd651('0x1e')];return _0x2729e3[_0xd651('0x1f')](_0xd651('0x20'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5854aa,_0x4aad9b,_0x357eff){return getChanSpyPromise(_0x26a130,_0x5854aa)[_0xd651('0x1b')](function(_0x4b1120){if(_0x4b1120&&_0x4b1120[_0xd651('0x16')]){return _0x26a130[_0xd651('0x21')]['bulkCreate'](_0x4b1120);}})['then'](function(){_0x357eff();})['catch'](function(_0x5ba7be){_0x357eff(_0x5ba7be);});},'afterUpdate':function(_0x4c5023,_0x104c0f,_0x14b7cf){return _0x26a130[_0xd651('0x21')][_0xd651('0x22')]({'where':{'ChanSpyId':_0x4c5023['id']}})[_0xd651('0x1b')](function(){return getChanSpyPromise(_0x26a130,_0x4c5023);})['then'](function(_0x3caa85){if(_0x3caa85&&_0x3caa85[_0xd651('0x16')]){return _0x26a130[_0xd651('0x21')][_0xd651('0x23')](_0x3caa85);}})['then'](function(){_0x14b7cf();})[_0xd651('0x1c')](function(_0x46f937){_0x14b7cf(_0x46f937);});},'afterDestroy':function(_0x1bdf6b,_0x13b705,_0x5a0a22){return _0x26a130['VoiceExtension'][_0xd651('0x22')]({'where':{'ChanSpyId':_0x1bdf6b['id']}})['then'](function(){_0x5a0a22();})[_0xd651('0x1c')](function(_0x47bacf){_0x5a0a22(_0x47bacf);});}}});}; \ No newline at end of file +var _0x817f=['join','internal','concat','User','findAll','then','catch','exports','define','voice_chanspy','VoiceExtension','bulkCreate','length','destroy','lodash','util','bluebird','context','%s%s','prefix','merge','Set','format','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','push','SIP/%s,%s','name','options'];(function(_0x14619d,_0x3e3b8f){var _0x1b42c1=function(_0x580572){while(--_0x580572){_0x14619d['push'](_0x14619d['shift']());}};_0x1b42c1(++_0x3e3b8f);}(_0x817f,0x1b2));var _0xf817=function(_0x2e10b1,_0x845b82){_0x2e10b1=_0x2e10b1-0x0;var _0x41de8b=_0x817f[_0x2e10b1];return _0x41de8b;};'use strict';var _=require(_0xf817('0x0'));var util=require(_0xf817('0x1'));var BPromise=require(_0xf817('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x3e0e74,_0x1e66b6,_0x38af36){var _0x12d570=0x1;var _0x102489=[];var _0x1fa54f={'context':_0x1e66b6[_0xf817('0x3')]||'from-sip','exten':util['format'](_0xf817('0x4'),_0x3e0e74[_0xf817('0x5')],_0x38af36),'type':'system','isApp':![],'ChanSpyId':_0x3e0e74['id'],'UserId':_0x1e66b6['id']};_0x102489['push'](_[_0xf817('0x6')]({'app':_0xf817('0x7'),'appdata':util[_0xf817('0x8')](_0xf817('0x9'),_0xf817('0xa')),'priority':_0x12d570++},_0x1fa54f));if(_0x3e0e74[_0xf817('0xb')]){_0x102489['push'](_[_0xf817('0x6')]({'app':_0xf817('0xc'),'appdata':util['format'](_0xf817('0xd'),_0x3e0e74[_0xf817('0xe')]),'priority':_0x12d570++},_0x1fa54f));}if(_0x3e0e74[_0xf817('0xf')]){_0x102489['push'](_[_0xf817('0x6')]({'app':_0xf817('0x10'),'appdata':_0x3e0e74['password'],'priority':_0x12d570++},_0x1fa54f));}_0x102489[_0xf817('0x11')](_[_0xf817('0x6')]({'app':'ChanSpy','appdata':util[_0xf817('0x8')](_0xf817('0x12'),_0x1e66b6[_0xf817('0x13')],_0x3e0e74[_0xf817('0x14')]?_0x3e0e74[_0xf817('0x14')][_0xf817('0x15')](''):''),'priority':_0x12d570++},_0x1fa54f));if(_0x3e0e74[_0xf817('0xb')]){_0x102489[_0xf817('0x11')](_['merge']({'app':'StopMixMonitor','priority':_0x12d570++},_0x1fa54f));}return _0x102489;};var getChanSpyApplications=function(_0x1a3a44,_0x1ed470){var _0x5d3331=[];for(var _0x341685=0x0,_0x209353=0x1;_0x341685<_0x1ed470['length'];_0x341685++,_0x209353=0x1){_0x5d3331=_0x5d3331['concat'](getUserApplications(_0x1a3a44,_0x1ed470[_0x341685],_0x1ed470[_0x341685][_0xf817('0x16')]));if(_0x1ed470[_0x341685][_0xf817('0x16')]!=_0x1ed470[_0x341685]['name']){_0x5d3331=_0x5d3331[_0xf817('0x17')](getUserApplications(_0x1a3a44,_0x1ed470[_0x341685],_0x1ed470[_0x341685][_0xf817('0x13')]));}}return _0x5d3331;};var getChanSpyPromise=function(_0x510dc7,_0x4a7c99){return new BPromise(function(_0x3626ff,_0x2dd7a2){return _0x510dc7[_0xf817('0x18')][_0xf817('0x19')]({'attributes':['id',_0xf817('0x13'),'internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xf817('0x1a')](function(_0x2e7d9f){if(_0x2e7d9f){return _0x3626ff(getChanSpyApplications(_0x4a7c99,_0x2e7d9f));}return _0x3626ff([]);})[_0xf817('0x1b')](function(_0x39e2c0){_0x2dd7a2(_0x39e2c0);});});};module[_0xf817('0x1c')]=function(_0x16882a,_0x4b5243){var _0x1ae5aa=_0x16882a['models'];return _0x16882a[_0xf817('0x1d')]('VoiceChanSpy',attributes,{'tableName':_0xf817('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4891f7,_0x801d24,_0x4dc97e){return getChanSpyPromise(_0x1ae5aa,_0x4891f7)[_0xf817('0x1a')](function(_0xb7d6a3){if(_0xb7d6a3&&_0xb7d6a3['length']){return _0x1ae5aa[_0xf817('0x1f')][_0xf817('0x20')](_0xb7d6a3);}})[_0xf817('0x1a')](function(){_0x4dc97e();})[_0xf817('0x1b')](function(_0x4304de){_0x4dc97e(_0x4304de);});},'afterUpdate':function(_0x515fd1,_0x1f8127,_0x3b545c){return _0x1ae5aa[_0xf817('0x1f')]['destroy']({'where':{'ChanSpyId':_0x515fd1['id']}})[_0xf817('0x1a')](function(){return getChanSpyPromise(_0x1ae5aa,_0x515fd1);})[_0xf817('0x1a')](function(_0x45c068){if(_0x45c068&&_0x45c068[_0xf817('0x21')]){return _0x1ae5aa['VoiceExtension'][_0xf817('0x20')](_0x45c068);}})[_0xf817('0x1a')](function(){_0x3b545c();})[_0xf817('0x1b')](function(_0xe2df06){_0x3b545c(_0xe2df06);});},'afterDestroy':function(_0x533f15,_0x226366,_0x192d43){return _0x1ae5aa[_0xf817('0x1f')][_0xf817('0x22')]({'where':{'ChanSpyId':_0x533f15['id']}})[_0xf817('0x1a')](function(){_0x192d43();})[_0xf817('0x1b')](function(_0x58c101){_0x192d43(_0x58c101);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 1caa6ad..7a445ae 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 _0xc368=['client','request','then','request\x20sent','debug','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1457b6,_0x5a3db6){var _0x1409e6=function(_0x6c2ed1){while(--_0x6c2ed1){_0x1457b6['push'](_0x1457b6['shift']());}};_0x1409e6(++_0x5a3db6);}(_0xc368,0x7b));var _0x8c36=function(_0x20082d,_0x1ed530){_0x20082d=_0x20082d-0x0;var _0x404323=_0xc368[_0x20082d];return _0x404323;};'use strict';var _=require('lodash');var util=require(_0x8c36('0x0'));var moment=require('moment');var BPromise=require(_0x8c36('0x1'));var rs=require(_0x8c36('0x2'));var fs=require('fs');var Redis=require(_0x8c36('0x3'));var db=require(_0x8c36('0x4'))['db'];var utils=require(_0x8c36('0x5'));var logger=require('../../config/logger')(_0x8c36('0x6'));var config=require(_0x8c36('0x7'));var jayson=require(_0x8c36('0x8'));var client=jayson[_0x8c36('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x554022,_0x8ed437,_0x384867){return new BPromise(function(_0x3e76be,_0x26bad1){return client[_0x8c36('0xa')](_0x554022,_0x384867)[_0x8c36('0xb')](function(_0x569f29){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x8ed437,_0x8c36('0xc'));logger[_0x8c36('0xd')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x8ed437,_0x8c36('0xc'),JSON[_0x8c36('0xe')](_0x569f29));if(_0x569f29[_0x8c36('0xf')]){if(_0x569f29[_0x8c36('0xf')][_0x8c36('0x10')]===0x1f4){logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x569f29[_0x8c36('0xf')][_0x8c36('0x12')]);return _0x26bad1(_0x569f29[_0x8c36('0xf')][_0x8c36('0x12')]);}logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x569f29[_0x8c36('0xf')]['message']);return _0x3e76be(_0x569f29[_0x8c36('0xf')]['message']);}else{logger[_0x8c36('0x13')](_0x8c36('0x11'),_0x8ed437,_0x8c36('0xc'));_0x3e76be(_0x569f29[_0x8c36('0x14')][_0x8c36('0x12')]);}})[_0x8c36('0x15')](function(_0x3c10eb){logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x3c10eb);_0x26bad1(_0x3c10eb);});});} \ No newline at end of file +var _0xda55=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x1c3f8e,_0x2f7794){var _0x40b720=function(_0xd92bec){while(--_0xd92bec){_0x1c3f8e['push'](_0x1c3f8e['shift']());}};_0x40b720(++_0x2f7794);}(_0xda55,0x6d));var _0x5da5=function(_0x4fa665,_0x1ae12a){_0x4fa665=_0x4fa665-0x0;var _0x62ccff=_0xda55[_0x4fa665];return _0x62ccff;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5da5('0x2'));var fs=require('fs');var Redis=require(_0x5da5('0x3'));var db=require(_0x5da5('0x4'))['db'];var utils=require(_0x5da5('0x5'));var logger=require(_0x5da5('0x6'))('rpc');var config=require(_0x5da5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5da5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fd877,_0x267469,_0x71b187){return new BPromise(function(_0x46290d,_0x3debdf){return client[_0x5da5('0x9')](_0x2fd877,_0x71b187)[_0x5da5('0xa')](function(_0x302795){logger['info'](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));logger[_0x5da5('0xd')](_0x5da5('0xe'),_0x267469,_0x5da5('0xc'),JSON[_0x5da5('0xf')](_0x302795));if(_0x302795[_0x5da5('0x10')]){if(_0x302795['error'][_0x5da5('0x11')]===0x1f4){logger[_0x5da5('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x267469,_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);return _0x3debdf(_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);}logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x302795['error']['message']);return _0x46290d(_0x302795['error'][_0x5da5('0x12')]);}else{logger[_0x5da5('0x13')](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));_0x46290d(_0x302795[_0x5da5('0x14')][_0x5da5('0x12')]);}})[_0x5da5('0x15')](function(_0x4a952a){logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x4a952a);_0x3debdf(_0x4a952a);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 3a67987..6633ad6 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 _0x4900=['post','put','update','delete','/:id','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x22ae16,_0x2aba92){var _0x2d7578=function(_0x3dbd76){while(--_0x3dbd76){_0x22ae16['push'](_0x22ae16['shift']());}};_0x2d7578(++_0x2aba92);}(_0x4900,0x1bf));var _0x0490=function(_0x4682cf,_0x5e648c){_0x4682cf=_0x4682cf-0x0;var _0x1c9557=_0x4900[_0x4682cf];return _0x1c9557;};'use strict';var multer=require(_0x0490('0x0'));var util=require(_0x0490('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0490('0x2'));var router=express[_0x0490('0x3')]();var fs_extra=require(_0x0490('0x4'));var auth=require(_0x0490('0x5'));var interaction=require(_0x0490('0x6'));var config=require(_0x0490('0x7'));var controller=require('./voiceContext.controller');router[_0x0490('0x8')]('/',auth[_0x0490('0x9')](),controller[_0x0490('0xa')]);router[_0x0490('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0490('0xb')]);router[_0x0490('0xc')]('/',auth[_0x0490('0x9')](),controller['create']);router[_0x0490('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x0490('0xe')]);router[_0x0490('0xf')](_0x0490('0x10'),auth[_0x0490('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4b42=['../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x41c930,_0x2ee4c1){var _0x1b081f=function(_0x2845d2){while(--_0x2845d2){_0x41c930['push'](_0x41c930['shift']());}};_0x1b081f(++_0x2ee4c1);}(_0x4b42,0x1c5));var _0x24b4=function(_0x4e1f60,_0xc61d2f){_0x4e1f60=_0x4e1f60-0x0;var _0x52e930=_0x4b42[_0x4e1f60];return _0x52e930;};'use strict';var multer=require(_0x24b4('0x0'));var util=require(_0x24b4('0x1'));var path=require(_0x24b4('0x2'));var timeout=require(_0x24b4('0x3'));var express=require(_0x24b4('0x4'));var router=express['Router']();var fs_extra=require(_0x24b4('0x5'));var auth=require(_0x24b4('0x6'));var interaction=require(_0x24b4('0x7'));var config=require('../../config/environment');var controller=require(_0x24b4('0x8'));router[_0x24b4('0x9')]('/',auth[_0x24b4('0xa')](),controller[_0x24b4('0xb')]);router[_0x24b4('0x9')](_0x24b4('0xc'),auth['isAuthenticated'](),controller[_0x24b4('0xd')]);router[_0x24b4('0xe')]('/',auth[_0x24b4('0xa')](),controller[_0x24b4('0xf')]);router[_0x24b4('0x10')](_0x24b4('0xc'),auth[_0x24b4('0xa')](),controller[_0x24b4('0x11')]);router[_0x24b4('0x12')](_0x24b4('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x24b4('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 4fdacce..acc8d73 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 _0xba58=['name','STRING'];(function(_0x99fd38,_0xd68d8c){var _0x59f7df=function(_0x2f71f2){while(--_0x2f71f2){_0x99fd38['push'](_0x99fd38['shift']());}};_0x59f7df(++_0xd68d8c);}(_0xba58,0x166));var _0x8ba5=function(_0x3dbbbe,_0xbafeca){_0x3dbbbe=_0x3dbbbe-0x0;var _0x31df47=_0xba58[_0x3dbbbe];return _0x31df47;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x8ba5('0x0')},'description':{'type':Sequelize[_0x8ba5('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x218a=['sequelize','exports','name','STRING'];(function(_0x489b4d,_0x4ddcbe){var _0x17f1ba=function(_0x90a305){while(--_0x90a305){_0x489b4d['push'](_0x489b4d['shift']());}};_0x17f1ba(++_0x4ddcbe);}(_0x218a,0x10c));var _0xa218=function(_0x5705e8,_0x5211a2){_0x5705e8=_0x5705e8-0x0;var _0x463ba5=_0x218a[_0x5705e8];return _0x463ba5;};'use strict';var Sequelize=require(_0xa218('0x0'));module[_0xa218('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa218('0x2')},'description':{'type':Sequelize[_0xa218('0x3')],'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 6a8170a..8d3c07c 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 _0xf7f2=['request\x20sent','debug','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','body','readFileSync','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','autoAssociation','create','update','/etc/asterisk/extensions_xcally_contexts.conf','join','root','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info'];(function(_0x521d32,_0x42172b){var _0x58db08=function(_0x243e13){while(--_0x243e13){_0x521d32['push'](_0x521d32['shift']());}};_0x58db08(++_0x42172b);}(_0xf7f2,0xb4));var _0x2f7f=function(_0xc9095,_0x643932){_0xc9095=_0xc9095-0x0;var _0x2efa60=_0xf7f2[_0xc9095];return _0x2efa60;};'use strict';var emlformat=require(_0x2f7f('0x0'));var rimraf=require(_0x2f7f('0x1'));var zipdir=require(_0x2f7f('0x2'));var jsonpatch=require(_0x2f7f('0x3'));var rp=require('request-promise');var moment=require(_0x2f7f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2f7f('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2f7f('0x6'));var csv=require(_0x2f7f('0x7'));var ejs=require(_0x2f7f('0x8'));var fs=require('fs');var fs_extra=require(_0x2f7f('0x9'));var _=require(_0x2f7f('0xa'));var squel=require(_0x2f7f('0xb'));var crypto=require('crypto');var jsforce=require(_0x2f7f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2f7f('0x7'));var querystring=require(_0x2f7f('0xd'));var Papa=require(_0x2f7f('0xe'));var Redis=require(_0x2f7f('0xf'));var authService=require(_0x2f7f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2f7f('0x11'));var logger=require(_0x2f7f('0x12'))(_0x2f7f('0x13'));var utils=require(_0x2f7f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2f7f('0x15'));var db=require(_0x2f7f('0x16'))['db'];var jayson=require(_0x2f7f('0x17'));var client=jayson[_0x2f7f('0x18')][_0x2f7f('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x295606,_0x2a58f1,_0x4818c6,_0x4bb0d9){return new BPromise(function(_0x11ba40,_0x49474a){var _0x531268=_0x4bb0d9||client;return _0x531268[_0x2f7f('0x1a')](_0x295606,_0x4818c6)['then'](function(_0x178441){logger[_0x2f7f('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x2a58f1,_0x2f7f('0x1c'));logger[_0x2f7f('0x1d')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x2a58f1,'request\x20sent',JSON['stringify'](_0x178441));if(_0x178441[_0x2f7f('0x1e')]){if(_0x178441[_0x2f7f('0x1e')][_0x2f7f('0x1f')]===0x1f4){logger[_0x2f7f('0x1e')](_0x2f7f('0x20'),_0x2a58f1,_0x178441['error'][_0x2f7f('0x21')]);return _0x49474a(_0x178441[_0x2f7f('0x1e')][_0x2f7f('0x21')]);}logger[_0x2f7f('0x1e')](_0x2f7f('0x20'),_0x2a58f1,_0x178441[_0x2f7f('0x1e')]['message']);return _0x11ba40(_0x178441[_0x2f7f('0x1e')]['message']);}else{logger[_0x2f7f('0x1b')](_0x2f7f('0x20'),_0x2a58f1,'request\x20sent');_0x11ba40(_0x178441[_0x2f7f('0x22')]['message']);}})[_0x2f7f('0x23')](function(_0x1c6cfe){logger[_0x2f7f('0x1e')](_0x2f7f('0x20'),_0x2a58f1,_0x1c6cfe);_0x49474a(_0x1c6cfe);});});}function respondWithStatusCode(_0x227e6c,_0x220937){_0x220937=_0x220937||0xcc;return function(_0x5d5834){if(_0x5d5834){return _0x227e6c[_0x2f7f('0x24')](_0x220937);}return _0x227e6c[_0x2f7f('0x25')](_0x220937)[_0x2f7f('0x26')]();};}function respondWithResult(_0x305c2b,_0x31d087){_0x31d087=_0x31d087||0xc8;return function(_0x1771ab){if(_0x1771ab){return _0x305c2b[_0x2f7f('0x25')](_0x31d087)[_0x2f7f('0x27')](_0x1771ab);}};}function respondWithFilteredResult(_0xce2a76,_0x217089){return function(_0x47ae43){if(_0x47ae43){var _0x28dcdd=typeof _0x217089[_0x2f7f('0x28')]===_0x2f7f('0x29')&&typeof _0x217089[_0x2f7f('0x2a')]==='undefined';var _0x1a57b1=_0x47ae43[_0x2f7f('0x2b')];var _0x30307d=_0x28dcdd?0x0:_0x217089[_0x2f7f('0x28')];var _0x508982=_0x28dcdd?_0x47ae43[_0x2f7f('0x2b')]:_0x217089[_0x2f7f('0x28')]+_0x217089['limit'];var _0x8d799;if(_0x508982>=_0x1a57b1){_0x508982=_0x1a57b1;_0x8d799=0xc8;}else{_0x8d799=0xce;}_0xce2a76[_0x2f7f('0x25')](_0x8d799);return _0xce2a76[_0x2f7f('0x2c')]('Content-Range',_0x30307d+'-'+_0x508982+'/'+_0x1a57b1)[_0x2f7f('0x27')](_0x47ae43);}return null;};}function patchUpdates(_0x4efe51){return function(_0x5b3cee){try{jsonpatch[_0x2f7f('0x2d')](_0x5b3cee,_0x4efe51,!![]);}catch(_0x4fa31d){return BPromise[_0x2f7f('0x2e')](_0x4fa31d);}return _0x5b3cee[_0x2f7f('0x2f')]();};}function saveUpdates(_0x386a2f,_0x2360b3){return function(_0x28c86a){if(_0x28c86a){return _0x28c86a['update'](_0x386a2f)['then'](function(_0xdb0798){return _0xdb0798;});}return null;};}function removeEntity(_0x47c7b5,_0x3ee99b){return function(_0x205367){if(_0x205367){return _0x205367[_0x2f7f('0x30')]()[_0x2f7f('0x31')](function(){var _0x472174=_0x205367['get']({'plain':!![]});var _0x566b5f=_0x2f7f('0x32');return db[_0x2f7f('0x33')][_0x2f7f('0x30')]({'where':{'type':_0x566b5f,'resourceId':_0x472174['id']}})[_0x2f7f('0x31')](function(){return _0x205367;});})[_0x2f7f('0x31')](function(){_0x47c7b5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ff407,_0x50a6e4){return function(_0xc183bc){if(!_0xc183bc){_0x2ff407['sendStatus'](0x194);}return _0xc183bc;};}function handleError(_0x5391fd,_0x3db747){_0x3db747=_0x3db747||0x1f4;return function(_0xd132dd){logger[_0x2f7f('0x1e')](_0xd132dd[_0x2f7f('0x34')]);if(_0xd132dd[_0x2f7f('0x35')]){delete _0xd132dd[_0x2f7f('0x35')];}_0x5391fd['status'](_0x3db747)[_0x2f7f('0x36')](_0xd132dd);};}exports[_0x2f7f('0x37')]=function(_0x56ec43,_0xa97956){var _0x383ced={},_0x25ebd9={},_0x3a3b6d={'count':0x0,'rows':[]};var _0x3212e2=_[_0x2f7f('0x38')](db[_0x2f7f('0x39')][_0x2f7f('0x3a')],function(_0x1117a7){return{'name':_0x1117a7[_0x2f7f('0x3b')],'type':_0x1117a7[_0x2f7f('0x3c')]['key']};});_0x25ebd9[_0x2f7f('0x3d')]=_[_0x2f7f('0x38')](_0x3212e2,_0x2f7f('0x35'));_0x25ebd9[_0x2f7f('0x3e')]=_[_0x2f7f('0x3f')](_0x56ec43[_0x2f7f('0x3e')]);_0x25ebd9['filters']=_['intersection'](_0x25ebd9['model'],_0x25ebd9[_0x2f7f('0x3e')]);_0x383ced['attributes']=_[_0x2f7f('0x40')](_0x25ebd9[_0x2f7f('0x3d')],qs[_0x2f7f('0x41')](_0x56ec43[_0x2f7f('0x3e')][_0x2f7f('0x41')]));_0x383ced[_0x2f7f('0x42')]=_0x383ced['attributes'][_0x2f7f('0x43')]?_0x383ced[_0x2f7f('0x42')]:_0x25ebd9[_0x2f7f('0x3d')];if(!_0x56ec43[_0x2f7f('0x3e')][_0x2f7f('0x44')](_0x2f7f('0x45'))){_0x383ced[_0x2f7f('0x2a')]=qs[_0x2f7f('0x2a')](_0x56ec43[_0x2f7f('0x3e')]['limit']);_0x383ced[_0x2f7f('0x28')]=qs['offset'](_0x56ec43[_0x2f7f('0x3e')][_0x2f7f('0x28')]);}_0x383ced[_0x2f7f('0x46')]=qs[_0x2f7f('0x47')](_0x56ec43['query'][_0x2f7f('0x47')]);_0x383ced[_0x2f7f('0x48')]=qs[_0x2f7f('0x49')](_[_0x2f7f('0x4a')](_0x56ec43[_0x2f7f('0x3e')],_0x25ebd9[_0x2f7f('0x49')]),_0x3212e2);if(_0x56ec43[_0x2f7f('0x3e')][_0x2f7f('0x4b')]){_0x383ced['where']=_[_0x2f7f('0x4c')](_0x383ced[_0x2f7f('0x48')],{'$or':_[_0x2f7f('0x38')](_0x3212e2,function(_0x33939a){if(_0x33939a['type']!=='VIRTUAL'){var _0x1d0016={};_0x1d0016[_0x33939a[_0x2f7f('0x35')]]={'$like':'%'+_0x56ec43['query'][_0x2f7f('0x4b')]+'%'};return _0x1d0016;}})});}_0x383ced=_[_0x2f7f('0x4c')]({},_0x383ced,_0x56ec43[_0x2f7f('0x4d')]);var _0x58f52e={'where':_0x383ced[_0x2f7f('0x48')]};return db[_0x2f7f('0x39')][_0x2f7f('0x2b')](_0x58f52e)['then'](function(_0x5dac7b){_0x3a3b6d['count']=_0x5dac7b;if(_0x56ec43[_0x2f7f('0x3e')][_0x2f7f('0x4e')]){_0x383ced[_0x2f7f('0x4f')]=[{'all':!![]}];}return db[_0x2f7f('0x39')][_0x2f7f('0x50')](_0x383ced);})[_0x2f7f('0x31')](function(_0x293644){_0x3a3b6d[_0x2f7f('0x51')]=_0x293644;return _0x3a3b6d;})[_0x2f7f('0x31')](respondWithFilteredResult(_0xa97956,_0x383ced))[_0x2f7f('0x23')](handleError(_0xa97956,null));};exports[_0x2f7f('0x52')]=function(_0x31e6d3,_0x394418){var _0x21ddc0={'raw':![],'where':{'id':_0x31e6d3[_0x2f7f('0x53')]['id']}},_0x446f07={};_0x446f07['model']=_[_0x2f7f('0x3f')](db['VoiceContext'][_0x2f7f('0x3a')]);_0x446f07[_0x2f7f('0x3e')]=_[_0x2f7f('0x3f')](_0x31e6d3[_0x2f7f('0x3e')]);_0x446f07[_0x2f7f('0x49')]=_[_0x2f7f('0x40')](_0x446f07[_0x2f7f('0x3d')],_0x446f07['query']);_0x21ddc0[_0x2f7f('0x42')]=_[_0x2f7f('0x40')](_0x446f07['model'],qs[_0x2f7f('0x41')](_0x31e6d3[_0x2f7f('0x3e')]['fields']));_0x21ddc0[_0x2f7f('0x42')]=_0x21ddc0[_0x2f7f('0x42')][_0x2f7f('0x43')]?_0x21ddc0[_0x2f7f('0x42')]:_0x446f07[_0x2f7f('0x3d')];if(_0x31e6d3[_0x2f7f('0x3e')][_0x2f7f('0x4e')]){_0x21ddc0[_0x2f7f('0x4f')]=[{'all':!![]}];}_0x21ddc0=_[_0x2f7f('0x4c')]({},_0x21ddc0,_0x31e6d3[_0x2f7f('0x4d')]);return db[_0x2f7f('0x39')][_0x2f7f('0x54')](_0x21ddc0)['then'](handleEntityNotFound(_0x394418,null))[_0x2f7f('0x31')](respondWithResult(_0x394418,null))['catch'](handleError(_0x394418,null));};exports['create']=function(_0x2d35e0,_0x13fb68,_0x210a8a){var _0x1ef90e;return db[_0x2f7f('0x39')]['create'](_0x2d35e0[_0x2f7f('0x55')],{'raw':!![]})[_0x2f7f('0x31')](function(_0x2afde0){_0x1ef90e=_0x2afde0;return db[_0x2f7f('0x39')]['findAll']({'raw':!![]});})[_0x2f7f('0x31')](function(_0x1e6605){var _0x37062e=fs[_0x2f7f('0x56')](path['join'](config['root'],_0x2f7f('0x57')),_0x2f7f('0x58'));var _0x3c8df7=ejs[_0x2f7f('0x59')](_0x37062e,{'contexts':_0x1e6605||[]});fs[_0x2f7f('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3c8df7);})['then'](function(){return respondWithRpcPromise(_0x2f7f('0x5b'),'create',{'module':_0x2f7f('0x5c')});})[_0x2f7f('0x31')](function(){var _0x273cba=_0x2d35e0['user']['get']({'plain':!![]});if(!_0x273cba)throw new Error(_0x2f7f('0x5d'));if(_0x273cba[_0x2f7f('0x5e')]===_0x2f7f('0x5f')){var _0x23e26d=_0x1ef90e[_0x2f7f('0x60')]({'plain':!![]});return db[_0x2f7f('0x61')]['find']({'where':{'name':'Contexts','userProfileId':_0x273cba['userProfileId']},'raw':!![]})[_0x2f7f('0x31')](function(_0x260507){if(_0x260507&&_0x260507[_0x2f7f('0x62')]===0x0){return db['UserProfileResource'][_0x2f7f('0x63')]({'name':_0x23e26d['name'],'resourceId':_0x23e26d['id'],'type':_0x260507[_0x2f7f('0x35')],'sectionId':_0x260507['id']},{})[_0x2f7f('0x31')](function(){return _0x1ef90e;});}else{return _0x1ef90e;}})[_0x2f7f('0x23')](function(_0x583ca1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x583ca1);throw _0x583ca1;});}return _0x1ef90e;})[_0x2f7f('0x31')](respondWithResult(_0x13fb68,0xc9))[_0x2f7f('0x23')](handleError(_0x13fb68,null));};exports[_0x2f7f('0x64')]=function(_0x5da509,_0x5e1a45,_0x472222){var _0x70fbb5;return db[_0x2f7f('0x39')][_0x2f7f('0x54')]({'where':{'id':_0x5da509[_0x2f7f('0x53')]['id']}})[_0x2f7f('0x31')](handleEntityNotFound(_0x5e1a45,null))[_0x2f7f('0x31')](saveUpdates(_0x5da509[_0x2f7f('0x55')],null))[_0x2f7f('0x31')](function(_0x5c2431){if(_0x5c2431){_0x70fbb5=_0x5c2431;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0x2f7f('0x31')](function(_0x1b5eb4){var _0x5dc070=fs[_0x2f7f('0x56')](path['join'](config['root'],'server/files/templates/context.ejs'),_0x2f7f('0x58'));var _0x57a58b=ejs[_0x2f7f('0x59')](_0x5dc070,{'contexts':_0x1b5eb4||[]});fs[_0x2f7f('0x5a')](_0x2f7f('0x65'),_0x57a58b);})[_0x2f7f('0x31')](function(){return respondWithRpcPromise('Reload','update',{'module':_0x2f7f('0x5c')});})[_0x2f7f('0x31')](function(){return _0x70fbb5;})['then'](respondWithResult(_0x5e1a45,null))['catch'](handleError(_0x5e1a45,null));};exports[_0x2f7f('0x30')]=function(_0x2059f7,_0x10bb59,_0x2d2f63){var _0x47c75d;return db['VoiceContext'][_0x2f7f('0x54')]({'where':{'id':_0x2059f7['params']['id']}})[_0x2f7f('0x31')](handleEntityNotFound(_0x10bb59,null))['then'](removeEntity(_0x10bb59,null))[_0x2f7f('0x31')](function(){return db['VoiceContext'][_0x2f7f('0x50')]({'raw':!![]});})[_0x2f7f('0x31')](function(_0x23bcfe){var _0x1c19a3=fs[_0x2f7f('0x56')](path[_0x2f7f('0x66')](config[_0x2f7f('0x67')],_0x2f7f('0x57')),'utf8');var _0x50cfdb=ejs[_0x2f7f('0x59')](_0x1c19a3,{'contexts':_0x23bcfe});fs[_0x2f7f('0x5a')](_0x2f7f('0x65'),_0x50cfdb);return respondWithRpcPromise(_0x2f7f('0x5b'),_0x2f7f('0x30'),{'module':'chan_sip.so'});})['catch'](handleError(_0x10bb59,null));}; \ No newline at end of file +var _0x1802=['readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Contexts','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','get','sendStatus','stack','name','send','index','map','type','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','VoiceContext','includeAll','include','findAll','rows','show','rawAttributes','find','create'];(function(_0x5492d7,_0x1cf8f9){var _0x3fc314=function(_0x1e21f9){while(--_0x1e21f9){_0x5492d7['push'](_0x5492d7['shift']());}};_0x3fc314(++_0x1cf8f9);}(_0x1802,0x1cb));var _0x2180=function(_0x2f69a0,_0x5c10f6){_0x2f69a0=_0x2f69a0-0x0;var _0x2d4486=_0x1802[_0x2f69a0];return _0x2d4486;};'use strict';var emlformat=require(_0x2180('0x0'));var rimraf=require(_0x2180('0x1'));var zipdir=require(_0x2180('0x2'));var jsonpatch=require(_0x2180('0x3'));var rp=require(_0x2180('0x4'));var moment=require(_0x2180('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2180('0x6'));var path=require(_0x2180('0x7'));var sox=require(_0x2180('0x8'));var csv=require('to-csv');var ejs=require(_0x2180('0x9'));var fs=require('fs');var fs_extra=require(_0x2180('0xa'));var _=require(_0x2180('0xb'));var squel=require(_0x2180('0xc'));var crypto=require(_0x2180('0xd'));var jsforce=require(_0x2180('0xe'));var deskjs=require(_0x2180('0xf'));var toCsv=require(_0x2180('0x10'));var querystring=require(_0x2180('0x11'));var Papa=require(_0x2180('0x12'));var Redis=require(_0x2180('0x13'));var authService=require(_0x2180('0x14'));var qs=require(_0x2180('0x15'));var as=require(_0x2180('0x16'));var hardwareService=require(_0x2180('0x17'));var logger=require(_0x2180('0x18'))(_0x2180('0x19'));var utils=require('../../config/utils');var config=require(_0x2180('0x1a'));var licenseUtil=require(_0x2180('0x1b'));var db=require(_0x2180('0x1c'))['db'];var jayson=require(_0x2180('0x1d'));var client=jayson[_0x2180('0x1e')][_0x2180('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x30b57a,_0x5dc153,_0x18b0c1,_0x1991d0){return new BPromise(function(_0x24b37d,_0x1353ef){var _0x3ffa80=_0x1991d0||client;return _0x3ffa80['request'](_0x30b57a,_0x18b0c1)[_0x2180('0x20')](function(_0x27e255){logger[_0x2180('0x21')]('VoiceContext,\x20%s,\x20%s',_0x5dc153,_0x2180('0x22'));logger[_0x2180('0x23')](_0x2180('0x24'),_0x5dc153,_0x2180('0x22'),JSON[_0x2180('0x25')](_0x27e255));if(_0x27e255[_0x2180('0x26')]){if(_0x27e255['error'][_0x2180('0x27')]===0x1f4){logger[_0x2180('0x26')](_0x2180('0x28'),_0x5dc153,_0x27e255[_0x2180('0x26')][_0x2180('0x29')]);return _0x1353ef(_0x27e255['error']['message']);}logger[_0x2180('0x26')](_0x2180('0x28'),_0x5dc153,_0x27e255[_0x2180('0x26')]['message']);return _0x24b37d(_0x27e255[_0x2180('0x26')][_0x2180('0x29')]);}else{logger[_0x2180('0x21')](_0x2180('0x28'),_0x5dc153,_0x2180('0x22'));_0x24b37d(_0x27e255[_0x2180('0x2a')][_0x2180('0x29')]);}})[_0x2180('0x2b')](function(_0xe74c86){logger[_0x2180('0x26')](_0x2180('0x28'),_0x5dc153,_0xe74c86);_0x1353ef(_0xe74c86);});});}function respondWithStatusCode(_0x2d69e6,_0x5a1cd7){_0x5a1cd7=_0x5a1cd7||0xcc;return function(_0x16bf1e){if(_0x16bf1e){return _0x2d69e6['sendStatus'](_0x5a1cd7);}return _0x2d69e6[_0x2180('0x2c')](_0x5a1cd7)[_0x2180('0x2d')]();};}function respondWithResult(_0x79cb64,_0x3edd43){_0x3edd43=_0x3edd43||0xc8;return function(_0x13a7d4){if(_0x13a7d4){return _0x79cb64['status'](_0x3edd43)[_0x2180('0x2e')](_0x13a7d4);}};}function respondWithFilteredResult(_0x2dfc34,_0x4b3145){return function(_0x439a81){if(_0x439a81){var _0x95fc97=typeof _0x4b3145[_0x2180('0x2f')]==='undefined'&&typeof _0x4b3145[_0x2180('0x30')]===_0x2180('0x31');var _0x50f1cb=_0x439a81[_0x2180('0x32')];var _0x4595=_0x95fc97?0x0:_0x4b3145[_0x2180('0x2f')];var _0x1c6f90=_0x95fc97?_0x439a81['count']:_0x4b3145[_0x2180('0x2f')]+_0x4b3145[_0x2180('0x30')];var _0x52c6;if(_0x1c6f90>=_0x50f1cb){_0x1c6f90=_0x50f1cb;_0x52c6=0xc8;}else{_0x52c6=0xce;}_0x2dfc34[_0x2180('0x2c')](_0x52c6);return _0x2dfc34[_0x2180('0x33')](_0x2180('0x34'),_0x4595+'-'+_0x1c6f90+'/'+_0x50f1cb)['json'](_0x439a81);}return null;};}function patchUpdates(_0x4d10db){return function(_0x4a9aaa){try{jsonpatch['apply'](_0x4a9aaa,_0x4d10db,!![]);}catch(_0x140ed6){return BPromise[_0x2180('0x35')](_0x140ed6);}return _0x4a9aaa[_0x2180('0x36')]();};}function saveUpdates(_0x859d42,_0xc3f07){return function(_0x5afe1b){if(_0x5afe1b){return _0x5afe1b[_0x2180('0x37')](_0x859d42)[_0x2180('0x20')](function(_0x8ceb50){return _0x8ceb50;});}return null;};}function removeEntity(_0x161cbf,_0x2396dc){return function(_0x4f629d){if(_0x4f629d){return _0x4f629d[_0x2180('0x38')]()[_0x2180('0x20')](function(){var _0x36150b=_0x4f629d[_0x2180('0x39')]({'plain':!![]});var _0x3a45ac='Contexts';return db['UserProfileResource'][_0x2180('0x38')]({'where':{'type':_0x3a45ac,'resourceId':_0x36150b['id']}})['then'](function(){return _0x4f629d;});})[_0x2180('0x20')](function(){_0x161cbf[_0x2180('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fa5f5,_0x537d44){return function(_0x244761){if(!_0x244761){_0x1fa5f5[_0x2180('0x3a')](0x194);}return _0x244761;};}function handleError(_0x24a574,_0x469638){_0x469638=_0x469638||0x1f4;return function(_0xee1635){logger[_0x2180('0x26')](_0xee1635[_0x2180('0x3b')]);if(_0xee1635[_0x2180('0x3c')]){delete _0xee1635[_0x2180('0x3c')];}_0x24a574['status'](_0x469638)[_0x2180('0x3d')](_0xee1635);};}exports[_0x2180('0x3e')]=function(_0x45ea50,_0x1efd9a){var _0x5ac206={},_0x5b94df={},_0x3f8731={'count':0x0,'rows':[]};var _0x25161c=_[_0x2180('0x3f')](db['VoiceContext']['rawAttributes'],function(_0x3da604){return{'name':_0x3da604['fieldName'],'type':_0x3da604[_0x2180('0x40')]['key']};});_0x5b94df[_0x2180('0x41')]=_[_0x2180('0x3f')](_0x25161c,'name');_0x5b94df['query']=_[_0x2180('0x42')](_0x45ea50[_0x2180('0x43')]);_0x5b94df['filters']=_['intersection'](_0x5b94df[_0x2180('0x41')],_0x5b94df[_0x2180('0x43')]);_0x5ac206[_0x2180('0x44')]=_[_0x2180('0x45')](_0x5b94df[_0x2180('0x41')],qs[_0x2180('0x46')](_0x45ea50[_0x2180('0x43')][_0x2180('0x46')]));_0x5ac206[_0x2180('0x44')]=_0x5ac206[_0x2180('0x44')][_0x2180('0x47')]?_0x5ac206[_0x2180('0x44')]:_0x5b94df[_0x2180('0x41')];if(!_0x45ea50['query'][_0x2180('0x48')](_0x2180('0x49'))){_0x5ac206[_0x2180('0x30')]=qs['limit'](_0x45ea50['query']['limit']);_0x5ac206[_0x2180('0x2f')]=qs[_0x2180('0x2f')](_0x45ea50[_0x2180('0x43')][_0x2180('0x2f')]);}_0x5ac206[_0x2180('0x4a')]=qs[_0x2180('0x4b')](_0x45ea50[_0x2180('0x43')][_0x2180('0x4b')]);_0x5ac206[_0x2180('0x4c')]=qs[_0x2180('0x4d')](_[_0x2180('0x4e')](_0x45ea50[_0x2180('0x43')],_0x5b94df[_0x2180('0x4d')]),_0x25161c);if(_0x45ea50[_0x2180('0x43')][_0x2180('0x4f')]){_0x5ac206[_0x2180('0x4c')]=_[_0x2180('0x50')](_0x5ac206[_0x2180('0x4c')],{'$or':_[_0x2180('0x3f')](_0x25161c,function(_0x5218cb){if(_0x5218cb[_0x2180('0x40')]!=='VIRTUAL'){var _0x50cdb={};_0x50cdb[_0x5218cb[_0x2180('0x3c')]]={'$like':'%'+_0x45ea50[_0x2180('0x43')][_0x2180('0x4f')]+'%'};return _0x50cdb;}})});}_0x5ac206=_['merge']({},_0x5ac206,_0x45ea50[_0x2180('0x51')]);var _0x2a0668={'where':_0x5ac206['where']};return db[_0x2180('0x52')]['count'](_0x2a0668)['then'](function(_0x4840ef){_0x3f8731[_0x2180('0x32')]=_0x4840ef;if(_0x45ea50[_0x2180('0x43')][_0x2180('0x53')]){_0x5ac206[_0x2180('0x54')]=[{'all':!![]}];}return db[_0x2180('0x52')][_0x2180('0x55')](_0x5ac206);})[_0x2180('0x20')](function(_0x37ced5){_0x3f8731[_0x2180('0x56')]=_0x37ced5;return _0x3f8731;})['then'](respondWithFilteredResult(_0x1efd9a,_0x5ac206))['catch'](handleError(_0x1efd9a,null));};exports[_0x2180('0x57')]=function(_0x81b28b,_0xf452cd){var _0x503741={'raw':![],'where':{'id':_0x81b28b['params']['id']}},_0x13228d={};_0x13228d[_0x2180('0x41')]=_[_0x2180('0x42')](db[_0x2180('0x52')][_0x2180('0x58')]);_0x13228d['query']=_[_0x2180('0x42')](_0x81b28b[_0x2180('0x43')]);_0x13228d[_0x2180('0x4d')]=_['intersection'](_0x13228d['model'],_0x13228d[_0x2180('0x43')]);_0x503741[_0x2180('0x44')]=_['intersection'](_0x13228d['model'],qs[_0x2180('0x46')](_0x81b28b[_0x2180('0x43')][_0x2180('0x46')]));_0x503741['attributes']=_0x503741[_0x2180('0x44')][_0x2180('0x47')]?_0x503741[_0x2180('0x44')]:_0x13228d[_0x2180('0x41')];if(_0x81b28b['query']['includeAll']){_0x503741[_0x2180('0x54')]=[{'all':!![]}];}_0x503741=_[_0x2180('0x50')]({},_0x503741,_0x81b28b[_0x2180('0x51')]);return db[_0x2180('0x52')][_0x2180('0x59')](_0x503741)[_0x2180('0x20')](handleEntityNotFound(_0xf452cd,null))['then'](respondWithResult(_0xf452cd,null))[_0x2180('0x2b')](handleError(_0xf452cd,null));};exports[_0x2180('0x5a')]=function(_0x5c95ab,_0x23e168,_0x178ed2){var _0x31f89f;return db[_0x2180('0x52')][_0x2180('0x5a')](_0x5c95ab['body'],{'raw':!![]})[_0x2180('0x20')](function(_0x2bb4d7){_0x31f89f=_0x2bb4d7;return db[_0x2180('0x52')]['findAll']({'raw':!![]});})[_0x2180('0x20')](function(_0x2cd6f9){var _0x5d3ea3=fs[_0x2180('0x5b')](path[_0x2180('0x5c')](config[_0x2180('0x5d')],_0x2180('0x5e')),_0x2180('0x5f'));var _0x1d84e1=ejs[_0x2180('0x60')](_0x5d3ea3,{'contexts':_0x2cd6f9||[]});fs[_0x2180('0x61')](_0x2180('0x62'),_0x1d84e1);})[_0x2180('0x20')](function(){return respondWithRpcPromise(_0x2180('0x63'),_0x2180('0x5a'),{'module':'chan_sip.so'});})['then'](function(){var _0x49fe14=_0x5c95ab['user'][_0x2180('0x39')]({'plain':!![]});if(!_0x49fe14)throw new Error(_0x2180('0x64'));if(_0x49fe14[_0x2180('0x65')]===_0x2180('0x66')){var _0x5ec383=_0x31f89f['get']({'plain':!![]});return db[_0x2180('0x67')][_0x2180('0x59')]({'where':{'name':_0x2180('0x68'),'userProfileId':_0x49fe14[_0x2180('0x69')]},'raw':!![]})[_0x2180('0x20')](function(_0x55161b){if(_0x55161b&&_0x55161b['autoAssociation']===0x0){return db[_0x2180('0x6a')]['create']({'name':_0x5ec383['name'],'resourceId':_0x5ec383['id'],'type':_0x55161b[_0x2180('0x3c')],'sectionId':_0x55161b['id']},{})['then'](function(){return _0x31f89f;});}else{return _0x31f89f;}})[_0x2180('0x2b')](function(_0x4a8141){logger[_0x2180('0x26')](_0x2180('0x6b'),_0x4a8141);throw _0x4a8141;});}return _0x31f89f;})['then'](respondWithResult(_0x23e168,0xc9))[_0x2180('0x2b')](handleError(_0x23e168,null));};exports['update']=function(_0x23d67f,_0x106fea,_0x3ef48f){var _0x1ed6d3;return db['VoiceContext'][_0x2180('0x59')]({'where':{'id':_0x23d67f[_0x2180('0x6c')]['id']}})[_0x2180('0x20')](handleEntityNotFound(_0x106fea,null))[_0x2180('0x20')](saveUpdates(_0x23d67f['body'],null))[_0x2180('0x20')](function(_0x6b03c3){if(_0x6b03c3){_0x1ed6d3=_0x6b03c3;return db[_0x2180('0x52')][_0x2180('0x55')]({'raw':!![]});}})[_0x2180('0x20')](function(_0x52e23c){var _0x3ed692=fs[_0x2180('0x5b')](path[_0x2180('0x5c')](config[_0x2180('0x5d')],_0x2180('0x5e')),_0x2180('0x5f'));var _0x1c7181=ejs['render'](_0x3ed692,{'contexts':_0x52e23c||[]});fs[_0x2180('0x61')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x1c7181);})['then'](function(){return respondWithRpcPromise(_0x2180('0x63'),_0x2180('0x37'),{'module':_0x2180('0x6d')});})[_0x2180('0x20')](function(){return _0x1ed6d3;})[_0x2180('0x20')](respondWithResult(_0x106fea,null))[_0x2180('0x2b')](handleError(_0x106fea,null));};exports['destroy']=function(_0x5d2591,_0xf35c95,_0x2be14e){var _0x5ed9e7;return db['VoiceContext'][_0x2180('0x59')]({'where':{'id':_0x5d2591[_0x2180('0x6c')]['id']}})['then'](handleEntityNotFound(_0xf35c95,null))[_0x2180('0x20')](removeEntity(_0xf35c95,null))['then'](function(){return db[_0x2180('0x52')][_0x2180('0x55')]({'raw':!![]});})[_0x2180('0x20')](function(_0x5c953d){var _0x48f48f=fs['readFileSync'](path[_0x2180('0x5c')](config[_0x2180('0x5d')],_0x2180('0x5e')),_0x2180('0x5f'));var _0x39a3cd=ejs[_0x2180('0x60')](_0x48f48f,{'contexts':_0x5c953d});fs['writeFileSync'](_0x2180('0x62'),_0x39a3cd);return respondWithRpcPromise(_0x2180('0x63'),_0x2180('0x38'),{'module':'chan_sip.so'});})[_0x2180('0x2b')](handleError(_0xf35c95,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index e583915..2722cca 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 _0x9cb9=['request-promise','path','rimraf','./voiceContext.attributes','exports','define','util','../../config/logger','api','moment','bluebird'];(function(_0x1e3291,_0x19e340){var _0x737bc5=function(_0x2f5455){while(--_0x2f5455){_0x1e3291['push'](_0x1e3291['shift']());}};_0x737bc5(++_0x19e340);}(_0x9cb9,0x1c9));var _0x99cb=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9cb9[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0x99cb('0x0'));var logger=require(_0x99cb('0x1'))(_0x99cb('0x2'));var moment=require(_0x99cb('0x3'));var BPromise=require(_0x99cb('0x4'));var rp=require(_0x99cb('0x5'));var fs=require('fs');var path=require(_0x99cb('0x6'));var rimraf=require(_0x99cb('0x7'));var config=require('../../config/environment');var attributes=require(_0x99cb('0x8'));module[_0x99cb('0x9')]=function(_0x29f0b5,_0x176d28){return _0x29f0b5[_0x99cb('0xa')]('VoiceContext',attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07d0=['VoiceContext','lodash','util','api','moment','request-promise','../../config/environment','./voiceContext.attributes','exports','define'];(function(_0xdc3d26,_0x507cf2){var _0x5ed14c=function(_0x134faf){while(--_0x134faf){_0xdc3d26['push'](_0xdc3d26['shift']());}};_0x5ed14c(++_0x507cf2);}(_0x07d0,0x141));var _0x007d=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x07d0[_0x1762b4];return _0x29beda;};'use strict';var _=require(_0x007d('0x0'));var util=require(_0x007d('0x1'));var logger=require('../../config/logger')(_0x007d('0x2'));var moment=require(_0x007d('0x3'));var BPromise=require('bluebird');var rp=require(_0x007d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x007d('0x5'));var attributes=require(_0x007d('0x6'));module[_0x007d('0x7')]=function(_0x5edf43,_0x1307fc){return _0x5edf43[_0x007d('0x8')](_0x007d('0x9'),attributes,{'tableName':'voice_contexts','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 b34f757..1b3f4a2 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 _0x2292=['lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x3c30a4,_0x152fd6){var _0x4f3e14=function(_0x28d11e){while(--_0x28d11e){_0x3c30a4['push'](_0x3c30a4['shift']());}};_0x4f3e14(++_0x152fd6);}(_0x2292,0x11e));var _0x2229=function(_0x35bd6c,_0x585087){_0x35bd6c=_0x35bd6c-0x0;var _0x2f421d=_0x2292[_0x35bd6c];return _0x2f421d;};'use strict';var _=require(_0x2229('0x0'));var util=require('util');var moment=require(_0x2229('0x1'));var BPromise=require(_0x2229('0x2'));var rs=require(_0x2229('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2229('0x4'));var logger=require(_0x2229('0x5'))(_0x2229('0x6'));var config=require(_0x2229('0x7'));var jayson=require(_0x2229('0x8'));var client=jayson[_0x2229('0x9')][_0x2229('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x460424,_0x5576e2,_0x5237de){return new BPromise(function(_0x118f03,_0xea1ad7){return client['request'](_0x460424,_0x5237de)[_0x2229('0xb')](function(_0x185cb6){logger[_0x2229('0xc')](_0x2229('0xd'),_0x5576e2,_0x2229('0xe'));logger[_0x2229('0xf')](_0x2229('0x10'),_0x5576e2,_0x2229('0xe'),JSON[_0x2229('0x11')](_0x185cb6));if(_0x185cb6['error']){if(_0x185cb6[_0x2229('0x12')][_0x2229('0x13')]===0x1f4){logger[_0x2229('0x12')](_0x2229('0xd'),_0x5576e2,_0x185cb6[_0x2229('0x12')][_0x2229('0x14')]);return _0xea1ad7(_0x185cb6[_0x2229('0x12')][_0x2229('0x14')]);}logger[_0x2229('0x12')](_0x2229('0xd'),_0x5576e2,_0x185cb6[_0x2229('0x12')][_0x2229('0x14')]);return _0x118f03(_0x185cb6[_0x2229('0x12')]['message']);}else{logger[_0x2229('0xc')]('VoiceContext,\x20%s,\x20%s',_0x5576e2,_0x2229('0xe'));_0x118f03(_0x185cb6['result'][_0x2229('0x14')]);}})[_0x2229('0x15')](function(_0x2f2f7c){logger[_0x2229('0x12')]('VoiceContext,\x20%s,\x20%s',_0x5576e2,_0x2f2f7c);_0xea1ad7(_0x2f2f7c);});});} \ No newline at end of file +var _0x594d=['VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceContext,\x20%s,\x20%s','debug'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x594d,0x92));var _0xd594=function(_0x1d90ca,_0x397b12){_0x1d90ca=_0x1d90ca-0x0;var _0x245d70=_0x594d[_0x1d90ca];return _0x245d70;};'use strict';var _=require(_0xd594('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd594('0x1'));var rs=require(_0xd594('0x2'));var fs=require('fs');var Redis=require(_0xd594('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd594('0x4'));var logger=require(_0xd594('0x5'))(_0xd594('0x6'));var config=require(_0xd594('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd594('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b1c64,_0x446711,_0xeedad0){return new BPromise(function(_0x20325a,_0x20718a){return client[_0xd594('0x9')](_0x3b1c64,_0xeedad0)[_0xd594('0xa')](function(_0xf3043e){logger[_0xd594('0xb')](_0xd594('0xc'),_0x446711,'request\x20sent');logger[_0xd594('0xd')](_0xd594('0xe'),_0x446711,_0xd594('0xf'),JSON['stringify'](_0xf3043e));if(_0xf3043e[_0xd594('0x10')]){if(_0xf3043e[_0xd594('0x10')][_0xd594('0x11')]===0x1f4){logger[_0xd594('0x10')](_0xd594('0xc'),_0x446711,_0xf3043e[_0xd594('0x10')][_0xd594('0x12')]);return _0x20718a(_0xf3043e['error']['message']);}logger[_0xd594('0x10')](_0xd594('0xc'),_0x446711,_0xf3043e['error'][_0xd594('0x12')]);return _0x20325a(_0xf3043e['error'][_0xd594('0x12')]);}else{logger[_0xd594('0xb')](_0xd594('0xc'),_0x446711,'request\x20sent');_0x20325a(_0xf3043e[_0xd594('0x13')]['message']);}})['catch'](function(_0x2a5f17){logger[_0xd594('0x10')]('VoiceContext,\x20%s,\x20%s',_0x446711,_0x2a5f17);_0x20718a(_0x2a5f17);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index e3ebf72..d52796e 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 _0xa9dc=['update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9dc,0x71));var _0xca9d=function(_0x301c34,_0x15701e){_0x301c34=_0x301c34-0x0;var _0x1a8c5a=_0xa9dc[_0x301c34];return _0x1a8c5a;};'use strict';var multer=require(_0xca9d('0x0'));var util=require('util');var path=require(_0xca9d('0x1'));var timeout=require(_0xca9d('0x2'));var express=require(_0xca9d('0x3'));var router=express[_0xca9d('0x4')]();var fs_extra=require(_0xca9d('0x5'));var auth=require(_0xca9d('0x6'));var interaction=require(_0xca9d('0x7'));var config=require(_0xca9d('0x8'));var controller=require(_0xca9d('0x9'));router[_0xca9d('0xa')]('/',auth[_0xca9d('0xb')](),controller[_0xca9d('0xc')]);router[_0xca9d('0xa')](_0xca9d('0xd'),auth[_0xca9d('0xb')](),controller['describe']);router[_0xca9d('0xa')](_0xca9d('0xe'),auth[_0xca9d('0xb')](),controller[_0xca9d('0xf')]);router[_0xca9d('0x10')]('/',auth[_0xca9d('0xb')](),controller[_0xca9d('0x11')]);router[_0xca9d('0x12')]('/:id',auth[_0xca9d('0xb')](),controller[_0xca9d('0x13')]);router['delete'](_0xca9d('0xe'),auth[_0xca9d('0xb')](),controller[_0xca9d('0x14')]);module[_0xca9d('0x15')]=router; \ No newline at end of file +var _0xc026=['index','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x256361,_0x5cec9e){var _0x594950=function(_0x594503){while(--_0x594503){_0x256361['push'](_0x256361['shift']());}};_0x594950(++_0x5cec9e);}(_0xc026,0x111));var _0x6c02=function(_0x3cf070,_0x4c430e){_0x3cf070=_0x3cf070-0x0;var _0x3d835c=_0xc026[_0x3cf070];return _0x3d835c;};'use strict';var multer=require('multer');var util=require(_0x6c02('0x0'));var path=require(_0x6c02('0x1'));var timeout=require('connect-timeout');var express=require(_0x6c02('0x2'));var router=express['Router']();var fs_extra=require(_0x6c02('0x3'));var auth=require(_0x6c02('0x4'));var interaction=require(_0x6c02('0x5'));var config=require(_0x6c02('0x6'));var controller=require('./voiceDialReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6c02('0x7')]);router[_0x6c02('0x8')](_0x6c02('0x9'),auth[_0x6c02('0xa')](),controller[_0x6c02('0xb')]);router[_0x6c02('0x8')](_0x6c02('0xc'),auth['isAuthenticated'](),controller[_0x6c02('0xd')]);router[_0x6c02('0xe')]('/',auth[_0x6c02('0xa')](),controller[_0x6c02('0xf')]);router[_0x6c02('0x10')]('/:id',auth[_0x6c02('0xa')](),controller[_0x6c02('0x11')]);router['delete'](_0x6c02('0xc'),auth[_0x6c02('0xa')](),controller[_0x6c02('0x12')]);module[_0x6c02('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 3cf2c22..948b708 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 _0xa41a=['exports','STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x12754b,_0x36c2b9){var _0x2590ff=function(_0x50b5e9){while(--_0x50b5e9){_0x12754b['push'](_0x12754b['shift']());}};_0x2590ff(++_0x36c2b9);}(_0xa41a,0x6b));var _0xaa41=function(_0x413ad3,_0x10a0c4){_0x413ad3=_0x413ad3-0x0;var _0x1ed933=_0xa41a[_0x413ad3];return _0x1ed933;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaa41('0x2')]},'channelstate':{'type':Sequelize[_0xaa41('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'calleridnum':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'language':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xaa41('0x2')]},'exten':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaa41('0x2')]},'destchannel':{'type':Sequelize[_0xaa41('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridnum':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridname':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'destlanguage':{'type':Sequelize[_0xaa41('0x2')]},'destaccountcode':{'type':Sequelize[_0xaa41('0x2')]},'destcontext':{'type':Sequelize[_0xaa41('0x2')]},'destexten':{'type':Sequelize[_0xaa41('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaa41('0x2')]},'destlinkedid':{'type':Sequelize[_0xaa41('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xaa41('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xaa41('0x4')]},'lastevent':{'type':Sequelize[_0xaa41('0x2')],'comment':_0xaa41('0x5')},'routeId':{'type':Sequelize[_0xaa41('0x3')]},'duration':{'type':Sequelize[_0xaa41('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xaa41('0x3')]}}; \ No newline at end of file +var _0x55ca=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x44744f,_0x24b58f){var _0x9def04=function(_0x2f21fe){while(--_0x2f21fe){_0x44744f['push'](_0x44744f['shift']());}};_0x9def04(++_0x24b58f);}(_0x55ca,0x126));var _0xa55c=function(_0x525673,_0xb429c2){_0x525673=_0x525673-0x0;var _0x8f7574=_0x55ca[_0x525673];return _0x8f7574;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'calleridnum':{'type':Sequelize[_0xa55c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa55c('0x2')]},'connectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'language':{'type':Sequelize[_0xa55c('0x2')]},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'context':{'type':Sequelize[_0xa55c('0x2')]},'exten':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize[_0xa55c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xa55c('0x2')]},'destchannel':{'type':Sequelize[_0xa55c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'destlanguage':{'type':Sequelize[_0xa55c('0x2')]},'destaccountcode':{'type':Sequelize[_0xa55c('0x2')]},'destcontext':{'type':Sequelize[_0xa55c('0x2')]},'destexten':{'type':Sequelize[_0xa55c('0x2')]},'destpriority':{'type':Sequelize[_0xa55c('0x3')]},'destuniqueid':{'type':Sequelize[_0xa55c('0x2')]},'destlinkedid':{'type':Sequelize[_0xa55c('0x2')]},'dialstring':{'type':Sequelize[_0xa55c('0x2')]},'dialstatus':{'type':Sequelize[_0xa55c('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa55c('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xa55c('0x3')]},'holdtime':{'type':Sequelize[_0xa55c('0x3')]},'billableseconds':{'type':Sequelize[_0xa55c('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 0da58b5..68cf966 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 _0x880e=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','destroy','name','send','index','VoiceDialReport','rawAttributes','fieldName','type','key','map','query','keys','filters','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','catch','show','params','intersection','includeAll','include','find','create','body','update','describe','eml-format','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0xa497d6,_0x30a58e){var _0x2d3121=function(_0x393299){while(--_0x393299){_0xa497d6['push'](_0xa497d6['shift']());}};_0x2d3121(++_0x30a58e);}(_0x880e,0x85));var _0xe880=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x880e[_0x3740fe];return _0x55492b;};'use strict';var emlformat=require(_0xe880('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe880('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe880('0x2'));var util=require(_0xe880('0x3'));var path=require(_0xe880('0x4'));var sox=require(_0xe880('0x5'));var csv=require('to-csv');var ejs=require(_0xe880('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe880('0x7'));var squel=require(_0xe880('0x8'));var crypto=require(_0xe880('0x9'));var jsforce=require(_0xe880('0xa'));var deskjs=require(_0xe880('0xb'));var toCsv=require(_0xe880('0xc'));var querystring=require(_0xe880('0xd'));var Papa=require(_0xe880('0xe'));var Redis=require('ioredis');var authService=require(_0xe880('0xf'));var qs=require(_0xe880('0x10'));var as=require(_0xe880('0x11'));var hardwareService=require(_0xe880('0x12'));var logger=require('../../config/logger')(_0xe880('0x13'));var utils=require(_0xe880('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe880('0x15'));var db=require(_0xe880('0x16'))['db'];function respondWithStatusCode(_0x2d9362,_0x5b22ed){_0x5b22ed=_0x5b22ed||0xcc;return function(_0x2185a4){if(_0x2185a4){return _0x2d9362[_0xe880('0x17')](_0x5b22ed);}return _0x2d9362[_0xe880('0x18')](_0x5b22ed)[_0xe880('0x19')]();};}function respondWithResult(_0xe81c34,_0x535072){_0x535072=_0x535072||0xc8;return function(_0x213e29){if(_0x213e29){return _0xe81c34[_0xe880('0x18')](_0x535072)[_0xe880('0x1a')](_0x213e29);}};}function respondWithFilteredResult(_0x534853,_0x4387fa){return function(_0x186248){if(_0x186248){var _0xe820cb=typeof _0x4387fa['offset']===_0xe880('0x1b')&&typeof _0x4387fa[_0xe880('0x1c')]===_0xe880('0x1b');var _0x1ec36b=_0x186248['count'];var _0x32f0ac=_0xe820cb?0x0:_0x4387fa[_0xe880('0x1d')];var _0x19b005=_0xe820cb?_0x186248[_0xe880('0x1e')]:_0x4387fa[_0xe880('0x1d')]+_0x4387fa[_0xe880('0x1c')];var _0x591bb9;if(_0x19b005>=_0x1ec36b){_0x19b005=_0x1ec36b;_0x591bb9=0xc8;}else{_0x591bb9=0xce;}_0x534853[_0xe880('0x18')](_0x591bb9);return _0x534853[_0xe880('0x1f')](_0xe880('0x20'),_0x32f0ac+'-'+_0x19b005+'/'+_0x1ec36b)[_0xe880('0x1a')](_0x186248);}return null;};}function patchUpdates(_0x1fed71){return function(_0x5edde9){try{jsonpatch[_0xe880('0x21')](_0x5edde9,_0x1fed71,!![]);}catch(_0x2fa777){return BPromise[_0xe880('0x22')](_0x2fa777);}return _0x5edde9[_0xe880('0x23')]();};}function saveUpdates(_0x47ae33,_0x1f84b2){return function(_0x311ee4){if(_0x311ee4){return _0x311ee4['update'](_0x47ae33)[_0xe880('0x24')](function(_0x95603d){return _0x95603d;});}return null;};}function removeEntity(_0x48d240,_0x4f0e3e){return function(_0x44d7be){if(_0x44d7be){return _0x44d7be[_0xe880('0x25')]()[_0xe880('0x24')](function(){_0x48d240[_0xe880('0x18')](0xcc)[_0xe880('0x19')]();});}};}function handleEntityNotFound(_0x25cd74,_0x12e386){return function(_0x582fb1){if(!_0x582fb1){_0x25cd74[_0xe880('0x17')](0x194);}return _0x582fb1;};}function handleError(_0x351eea,_0x4bc872){_0x4bc872=_0x4bc872||0x1f4;return function(_0x5f51e2){logger['error'](_0x5f51e2['stack']);if(_0x5f51e2[_0xe880('0x26')]){delete _0x5f51e2['name'];}_0x351eea['status'](_0x4bc872)[_0xe880('0x27')](_0x5f51e2);};}exports[_0xe880('0x28')]=function(_0x28a853,_0x181d0e){var _0x1b5f0a={},_0x395ae1={},_0x5808bd={'count':0x0,'rows':[]};var _0x5d0eb4=_['map'](db[_0xe880('0x29')][_0xe880('0x2a')],function(_0x3b62e6){return{'name':_0x3b62e6[_0xe880('0x2b')],'type':_0x3b62e6[_0xe880('0x2c')][_0xe880('0x2d')]};});_0x395ae1['model']=_[_0xe880('0x2e')](_0x5d0eb4,'name');_0x395ae1[_0xe880('0x2f')]=_[_0xe880('0x30')](_0x28a853[_0xe880('0x2f')]);_0x395ae1[_0xe880('0x31')]=_['intersection'](_0x395ae1[_0xe880('0x32')],_0x395ae1[_0xe880('0x2f')]);_0x1b5f0a['attributes']=_['intersection'](_0x395ae1[_0xe880('0x32')],qs[_0xe880('0x33')](_0x28a853[_0xe880('0x2f')][_0xe880('0x33')]));_0x1b5f0a[_0xe880('0x34')]=_0x1b5f0a[_0xe880('0x34')]['length']?_0x1b5f0a[_0xe880('0x34')]:_0x395ae1['model'];if(!_0x28a853[_0xe880('0x2f')][_0xe880('0x35')]('nolimit')){_0x1b5f0a[_0xe880('0x1c')]=qs[_0xe880('0x1c')](_0x28a853['query'][_0xe880('0x1c')]);_0x1b5f0a[_0xe880('0x1d')]=qs[_0xe880('0x1d')](_0x28a853[_0xe880('0x2f')][_0xe880('0x1d')]);}_0x1b5f0a[_0xe880('0x36')]=qs['sort'](_0x28a853[_0xe880('0x2f')][_0xe880('0x37')]);_0x1b5f0a[_0xe880('0x38')]=qs[_0xe880('0x31')](_[_0xe880('0x39')](_0x28a853['query'],_0x395ae1[_0xe880('0x31')]),_0x5d0eb4);if(_0x28a853[_0xe880('0x2f')][_0xe880('0x3a')]){_0x1b5f0a[_0xe880('0x38')]=_['merge'](_0x1b5f0a['where'],{'$or':_[_0xe880('0x2e')](_0x5d0eb4,function(_0x508fb8){if(_0x508fb8['type']!==_0xe880('0x3b')){var _0x4058cb={};_0x4058cb[_0x508fb8[_0xe880('0x26')]]={'$like':'%'+_0x28a853[_0xe880('0x2f')][_0xe880('0x3a')]+'%'};return _0x4058cb;}})});}_0x1b5f0a=_[_0xe880('0x3c')]({},_0x1b5f0a,_0x28a853[_0xe880('0x3d')]);var _0x3fda32={'where':_0x1b5f0a[_0xe880('0x38')]};return db['VoiceDialReport'][_0xe880('0x1e')](_0x3fda32)[_0xe880('0x24')](function(_0x5ed3d2){_0x5808bd['count']=_0x5ed3d2;if(_0x28a853[_0xe880('0x2f')]['includeAll']){_0x1b5f0a['include']=[{'all':!![]}];}return db[_0xe880('0x29')][_0xe880('0x3e')](_0x1b5f0a);})[_0xe880('0x24')](function(_0x47c6fa){_0x5808bd['rows']=_0x47c6fa;return _0x5808bd;})[_0xe880('0x24')](respondWithFilteredResult(_0x181d0e,_0x1b5f0a))[_0xe880('0x3f')](handleError(_0x181d0e,null));};exports[_0xe880('0x40')]=function(_0x427aa1,_0x35070f){var _0x2f4bec={'raw':!![],'where':{'id':_0x427aa1[_0xe880('0x41')]['id']}},_0x1abab2={};_0x1abab2[_0xe880('0x32')]=_[_0xe880('0x30')](db[_0xe880('0x29')][_0xe880('0x2a')]);_0x1abab2['query']=_[_0xe880('0x30')](_0x427aa1[_0xe880('0x2f')]);_0x1abab2[_0xe880('0x31')]=_[_0xe880('0x42')](_0x1abab2[_0xe880('0x32')],_0x1abab2[_0xe880('0x2f')]);_0x2f4bec[_0xe880('0x34')]=_[_0xe880('0x42')](_0x1abab2['model'],qs['fields'](_0x427aa1[_0xe880('0x2f')][_0xe880('0x33')]));_0x2f4bec['attributes']=_0x2f4bec[_0xe880('0x34')]['length']?_0x2f4bec[_0xe880('0x34')]:_0x1abab2[_0xe880('0x32')];if(_0x427aa1[_0xe880('0x2f')][_0xe880('0x43')]){_0x2f4bec[_0xe880('0x44')]=[{'all':!![]}];}_0x2f4bec=_[_0xe880('0x3c')]({},_0x2f4bec,_0x427aa1[_0xe880('0x3d')]);return db['VoiceDialReport'][_0xe880('0x45')](_0x2f4bec)['then'](handleEntityNotFound(_0x35070f,null))['then'](respondWithResult(_0x35070f,null))[_0xe880('0x3f')](handleError(_0x35070f,null));};exports[_0xe880('0x46')]=function(_0x405d8c,_0x4199b8){return db[_0xe880('0x29')]['create'](_0x405d8c[_0xe880('0x47')],{})[_0xe880('0x24')](respondWithResult(_0x4199b8,0xc9))[_0xe880('0x3f')](handleError(_0x4199b8,null));};exports[_0xe880('0x48')]=function(_0x3c3d53,_0x4d9c6d){if(_0x3c3d53['body']['id']){delete _0x3c3d53[_0xe880('0x47')]['id'];}return db[_0xe880('0x29')][_0xe880('0x45')]({'where':{'id':_0x3c3d53[_0xe880('0x41')]['id']}})[_0xe880('0x24')](handleEntityNotFound(_0x4d9c6d,null))[_0xe880('0x24')](saveUpdates(_0x3c3d53['body'],null))[_0xe880('0x24')](respondWithResult(_0x4d9c6d,null))['catch'](handleError(_0x4d9c6d,null));};exports[_0xe880('0x25')]=function(_0x74f613,_0x270ca1){return db[_0xe880('0x29')][_0xe880('0x45')]({'where':{'id':_0x74f613[_0xe880('0x41')]['id']}})[_0xe880('0x24')](handleEntityNotFound(_0x270ca1,null))['then'](removeEntity(_0x270ca1,null))[_0xe880('0x3f')](handleError(_0x270ca1,null));};exports['describe']=function(_0x3b4382,_0x2cda6e){return db[_0xe880('0x29')][_0xe880('0x49')]()[_0xe880('0x24')](respondWithResult(_0x2cda6e,null))[_0xe880('0x3f')](handleError(_0x2cda6e,null));}; \ No newline at end of file +var _0x6590=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','sendStatus','error','send','index','map','VoiceDialReport','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','params','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x6505c3,_0x2a68ef){var _0x1b3318=function(_0x422e8f){while(--_0x422e8f){_0x6505c3['push'](_0x6505c3['shift']());}};_0x1b3318(++_0x2a68ef);}(_0x6590,0x85));var _0x0659=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x6590[_0x58e469];return _0x4c01c5;};'use strict';var emlformat=require(_0x0659('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0659('0x1'));var jsonpatch=require(_0x0659('0x2'));var rp=require('request-promise');var moment=require(_0x0659('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0659('0x4'));var util=require(_0x0659('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0659('0x6'));var ejs=require(_0x0659('0x7'));var fs=require('fs');var fs_extra=require(_0x0659('0x8'));var _=require(_0x0659('0x9'));var squel=require(_0x0659('0xa'));var crypto=require(_0x0659('0xb'));var jsforce=require(_0x0659('0xc'));var deskjs=require(_0x0659('0xd'));var toCsv=require(_0x0659('0x6'));var querystring=require(_0x0659('0xe'));var Papa=require('papaparse');var Redis=require(_0x0659('0xf'));var authService=require(_0x0659('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0659('0x11'));var hardwareService=require(_0x0659('0x12'));var logger=require(_0x0659('0x13'))(_0x0659('0x14'));var utils=require(_0x0659('0x15'));var config=require(_0x0659('0x16'));var licenseUtil=require(_0x0659('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6da4ab,_0x3bc3de){_0x3bc3de=_0x3bc3de||0xcc;return function(_0x39dec6){if(_0x39dec6){return _0x6da4ab['sendStatus'](_0x3bc3de);}return _0x6da4ab[_0x0659('0x18')](_0x3bc3de)[_0x0659('0x19')]();};}function respondWithResult(_0x41aacf,_0x411c43){_0x411c43=_0x411c43||0xc8;return function(_0x5c1db4){if(_0x5c1db4){return _0x41aacf[_0x0659('0x18')](_0x411c43)[_0x0659('0x1a')](_0x5c1db4);}};}function respondWithFilteredResult(_0x1eb9cd,_0x1637e9){return function(_0x383456){if(_0x383456){var _0x15962a=typeof _0x1637e9[_0x0659('0x1b')]==='undefined'&&typeof _0x1637e9['limit']===_0x0659('0x1c');var _0x15ed17=_0x383456['count'];var _0x48b8f2=_0x15962a?0x0:_0x1637e9['offset'];var _0x52ea06=_0x15962a?_0x383456[_0x0659('0x1d')]:_0x1637e9[_0x0659('0x1b')]+_0x1637e9['limit'];var _0x34fb02;if(_0x52ea06>=_0x15ed17){_0x52ea06=_0x15ed17;_0x34fb02=0xc8;}else{_0x34fb02=0xce;}_0x1eb9cd['status'](_0x34fb02);return _0x1eb9cd[_0x0659('0x1e')](_0x0659('0x1f'),_0x48b8f2+'-'+_0x52ea06+'/'+_0x15ed17)[_0x0659('0x1a')](_0x383456);}return null;};}function patchUpdates(_0x4f611d){return function(_0x294865){try{jsonpatch[_0x0659('0x20')](_0x294865,_0x4f611d,!![]);}catch(_0x3ea410){return BPromise[_0x0659('0x21')](_0x3ea410);}return _0x294865['save']();};}function saveUpdates(_0x2ef42f,_0x1ae705){return function(_0x58115d){if(_0x58115d){return _0x58115d[_0x0659('0x22')](_0x2ef42f)[_0x0659('0x23')](function(_0x1c5415){return _0x1c5415;});}return null;};}function removeEntity(_0x1c8e38,_0x3afbcb){return function(_0x1cd0bb){if(_0x1cd0bb){return _0x1cd0bb['destroy']()[_0x0659('0x23')](function(){_0x1c8e38[_0x0659('0x18')](0xcc)[_0x0659('0x19')]();});}};}function handleEntityNotFound(_0x5a1eb0,_0xa04d97){return function(_0xb44d3){if(!_0xb44d3){_0x5a1eb0[_0x0659('0x24')](0x194);}return _0xb44d3;};}function handleError(_0x3ae377,_0x1c4b63){_0x1c4b63=_0x1c4b63||0x1f4;return function(_0x2caab5){logger[_0x0659('0x25')](_0x2caab5['stack']);if(_0x2caab5['name']){delete _0x2caab5['name'];}_0x3ae377['status'](_0x1c4b63)[_0x0659('0x26')](_0x2caab5);};}exports[_0x0659('0x27')]=function(_0x1656f1,_0x1d80af){var _0x20d5f5={},_0x45e0d6={},_0x1a9a87={'count':0x0,'rows':[]};var _0x1cbdc8=_[_0x0659('0x28')](db[_0x0659('0x29')]['rawAttributes'],function(_0x1aee56){return{'name':_0x1aee56['fieldName'],'type':_0x1aee56['type'][_0x0659('0x2a')]};});_0x45e0d6[_0x0659('0x2b')]=_[_0x0659('0x28')](_0x1cbdc8,_0x0659('0x2c'));_0x45e0d6[_0x0659('0x2d')]=_[_0x0659('0x2e')](_0x1656f1[_0x0659('0x2d')]);_0x45e0d6[_0x0659('0x2f')]=_[_0x0659('0x30')](_0x45e0d6[_0x0659('0x2b')],_0x45e0d6['query']);_0x20d5f5['attributes']=_[_0x0659('0x30')](_0x45e0d6[_0x0659('0x2b')],qs[_0x0659('0x31')](_0x1656f1[_0x0659('0x2d')][_0x0659('0x31')]));_0x20d5f5[_0x0659('0x32')]=_0x20d5f5[_0x0659('0x32')][_0x0659('0x33')]?_0x20d5f5[_0x0659('0x32')]:_0x45e0d6['model'];if(!_0x1656f1[_0x0659('0x2d')][_0x0659('0x34')]('nolimit')){_0x20d5f5[_0x0659('0x35')]=qs['limit'](_0x1656f1[_0x0659('0x2d')]['limit']);_0x20d5f5[_0x0659('0x1b')]=qs[_0x0659('0x1b')](_0x1656f1[_0x0659('0x2d')][_0x0659('0x1b')]);}_0x20d5f5[_0x0659('0x36')]=qs['sort'](_0x1656f1['query']['sort']);_0x20d5f5[_0x0659('0x37')]=qs[_0x0659('0x2f')](_['pick'](_0x1656f1[_0x0659('0x2d')],_0x45e0d6[_0x0659('0x2f')]),_0x1cbdc8);if(_0x1656f1[_0x0659('0x2d')][_0x0659('0x38')]){_0x20d5f5[_0x0659('0x37')]=_[_0x0659('0x39')](_0x20d5f5[_0x0659('0x37')],{'$or':_[_0x0659('0x28')](_0x1cbdc8,function(_0x172975){if(_0x172975[_0x0659('0x3a')]!==_0x0659('0x3b')){var _0x14a39c={};_0x14a39c[_0x172975[_0x0659('0x2c')]]={'$like':'%'+_0x1656f1[_0x0659('0x2d')][_0x0659('0x38')]+'%'};return _0x14a39c;}})});}_0x20d5f5=_[_0x0659('0x39')]({},_0x20d5f5,_0x1656f1[_0x0659('0x3c')]);var _0x14fede={'where':_0x20d5f5[_0x0659('0x37')]};return db[_0x0659('0x29')][_0x0659('0x1d')](_0x14fede)[_0x0659('0x23')](function(_0x478e5a){_0x1a9a87[_0x0659('0x1d')]=_0x478e5a;if(_0x1656f1[_0x0659('0x2d')][_0x0659('0x3d')]){_0x20d5f5[_0x0659('0x3e')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x20d5f5);})[_0x0659('0x23')](function(_0x2fb2d0){_0x1a9a87[_0x0659('0x3f')]=_0x2fb2d0;return _0x1a9a87;})[_0x0659('0x23')](respondWithFilteredResult(_0x1d80af,_0x20d5f5))[_0x0659('0x40')](handleError(_0x1d80af,null));};exports[_0x0659('0x41')]=function(_0x1b1638,_0x72593){var _0x506959={'raw':!![],'where':{'id':_0x1b1638['params']['id']}},_0x510d2b={};_0x510d2b[_0x0659('0x2b')]=_[_0x0659('0x2e')](db[_0x0659('0x29')]['rawAttributes']);_0x510d2b['query']=_[_0x0659('0x2e')](_0x1b1638[_0x0659('0x2d')]);_0x510d2b['filters']=_[_0x0659('0x30')](_0x510d2b['model'],_0x510d2b[_0x0659('0x2d')]);_0x506959[_0x0659('0x32')]=_['intersection'](_0x510d2b[_0x0659('0x2b')],qs['fields'](_0x1b1638['query'][_0x0659('0x31')]));_0x506959['attributes']=_0x506959[_0x0659('0x32')][_0x0659('0x33')]?_0x506959[_0x0659('0x32')]:_0x510d2b['model'];if(_0x1b1638[_0x0659('0x2d')][_0x0659('0x3d')]){_0x506959[_0x0659('0x3e')]=[{'all':!![]}];}_0x506959=_[_0x0659('0x39')]({},_0x506959,_0x1b1638[_0x0659('0x3c')]);return db[_0x0659('0x29')][_0x0659('0x42')](_0x506959)['then'](handleEntityNotFound(_0x72593,null))['then'](respondWithResult(_0x72593,null))[_0x0659('0x40')](handleError(_0x72593,null));};exports[_0x0659('0x43')]=function(_0x45ab3c,_0x8202e6){return db[_0x0659('0x29')]['create'](_0x45ab3c[_0x0659('0x44')],{})[_0x0659('0x23')](respondWithResult(_0x8202e6,0xc9))[_0x0659('0x40')](handleError(_0x8202e6,null));};exports[_0x0659('0x22')]=function(_0x1c11ad,_0x40eaa3){if(_0x1c11ad['body']['id']){delete _0x1c11ad[_0x0659('0x44')]['id'];}return db[_0x0659('0x29')]['find']({'where':{'id':_0x1c11ad[_0x0659('0x45')]['id']}})[_0x0659('0x23')](handleEntityNotFound(_0x40eaa3,null))[_0x0659('0x23')](saveUpdates(_0x1c11ad[_0x0659('0x44')],null))[_0x0659('0x23')](respondWithResult(_0x40eaa3,null))['catch'](handleError(_0x40eaa3,null));};exports[_0x0659('0x46')]=function(_0x2d9389,_0x156315){return db[_0x0659('0x29')]['find']({'where':{'id':_0x2d9389['params']['id']}})[_0x0659('0x23')](handleEntityNotFound(_0x156315,null))['then'](removeEntity(_0x156315,null))[_0x0659('0x40')](handleError(_0x156315,null));};exports[_0x0659('0x47')]=function(_0x95afe7,_0xf58cc2){return db[_0x0659('0x29')]['describe']()['then'](respondWithResult(_0xf58cc2,null))[_0x0659('0x40')](handleError(_0xf58cc2,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index fa34842..24e5d46 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 _0x0504=['VoiceDialReport','report_dial','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x1f19de,_0x4fca92){var _0x3b1122=function(_0xad4ab6){while(--_0xad4ab6){_0x1f19de['push'](_0x1f19de['shift']());}};_0x3b1122(++_0x4fca92);}(_0x0504,0x147));var _0x4050=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x0504[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var util=require(_0x4050('0x0'));var logger=require(_0x4050('0x1'))(_0x4050('0x2'));var moment=require(_0x4050('0x3'));var BPromise=require(_0x4050('0x4'));var rp=require(_0x4050('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4050('0x6'));var config=require(_0x4050('0x7'));var attributes=require('./voiceDialReport.attributes');module[_0x4050('0x8')]=function(_0x26da81,_0x2fd317){return _0x26da81['define'](_0x4050('0x9'),attributes,{'tableName':_0x4050('0xa'),'paranoid':![],'indexes':[{'fields':[_0x4050('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa8bf=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','uniqueid','lodash'];(function(_0x29bd31,_0x2b47f4){var _0x4f8dd7=function(_0x3049f7){while(--_0x3049f7){_0x29bd31['push'](_0x29bd31['shift']());}};_0x4f8dd7(++_0x2b47f4);}(_0xa8bf,0x1c2));var _0xfa8b=function(_0x85666,_0x403be2){_0x85666=_0x85666-0x0;var _0x233527=_0xa8bf[_0x85666];return _0x233527;};'use strict';var _=require(_0xfa8b('0x0'));var util=require(_0xfa8b('0x1'));var logger=require(_0xfa8b('0x2'))(_0xfa8b('0x3'));var moment=require(_0xfa8b('0x4'));var BPromise=require('bluebird');var rp=require(_0xfa8b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa8b('0x6'));var config=require(_0xfa8b('0x7'));var attributes=require('./voiceDialReport.attributes');module[_0xfa8b('0x8')]=function(_0x2bce16,_0x1c2e78){return _0x2bce16[_0xfa8b('0x9')]('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xfa8b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index e1ff3ff..54c2f1f 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 _0x5ebb=['client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceDialReport','create','options','raw','CreateVoiceDialReport','update','body','where','attributes','UpdateVoiceDialReport','debug','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x591083,_0x3f5795){var _0x57e547=function(_0x2822a7){while(--_0x2822a7){_0x591083['push'](_0x591083['shift']());}};_0x57e547(++_0x3f5795);}(_0x5ebb,0x1e6));var _0xb5eb=function(_0x5e0c4e,_0x4fabd1){_0x5e0c4e=_0x5e0c4e-0x0;var _0x23806a=_0x5ebb[_0x5e0c4e];return _0x23806a;};'use strict';var _=require('lodash');var util=require(_0xb5eb('0x0'));var moment=require(_0xb5eb('0x1'));var BPromise=require(_0xb5eb('0x2'));var rs=require(_0xb5eb('0x3'));var fs=require('fs');var Redis=require(_0xb5eb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb5eb('0x5'));var logger=require('../../config/logger')(_0xb5eb('0x6'));var config=require(_0xb5eb('0x7'));var jayson=require(_0xb5eb('0x8'));var client=jayson[_0xb5eb('0x9')][_0xb5eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50fc76,_0x5143e7,_0x2174d7){return new BPromise(function(_0x591fbc,_0x3808fe){return client[_0xb5eb('0xb')](_0x50fc76,_0x2174d7)[_0xb5eb('0xc')](function(_0x556749){logger[_0xb5eb('0xd')](_0xb5eb('0xe'),_0x5143e7,_0xb5eb('0xf'));logger['debug'](_0xb5eb('0x10'),_0x5143e7,_0xb5eb('0xf'),JSON[_0xb5eb('0x11')](_0x556749));if(_0x556749[_0xb5eb('0x12')]){if(_0x556749[_0xb5eb('0x12')]['code']===0x1f4){logger['error'](_0xb5eb('0xe'),_0x5143e7,_0x556749[_0xb5eb('0x12')][_0xb5eb('0x13')]);return _0x3808fe(_0x556749[_0xb5eb('0x12')][_0xb5eb('0x13')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x5143e7,_0x556749[_0xb5eb('0x12')][_0xb5eb('0x13')]);return _0x591fbc(_0x556749['error']['message']);}else{logger['info'](_0xb5eb('0xe'),_0x5143e7,_0xb5eb('0xf'));_0x591fbc(_0x556749[_0xb5eb('0x14')][_0xb5eb('0x13')]);}})[_0xb5eb('0x15')](function(_0x25fa9b){logger[_0xb5eb('0x12')](_0xb5eb('0xe'),_0x5143e7,_0x25fa9b);_0x3808fe(_0x25fa9b);});});}exports['CreateVoiceDialReport']=function(_0x539477){var _0x474bdb=this;return new Promise(function(_0x2dd816,_0x49b201){return db[_0xb5eb('0x16')][_0xb5eb('0x17')](_0x539477['body'],{'raw':_0x539477[_0xb5eb('0x18')]?_0x539477[_0xb5eb('0x18')][_0xb5eb('0x19')]===undefined?!![]:![]:!![]})[_0xb5eb('0xc')](function(_0x9e1b72){logger['info'](_0xb5eb('0x1a'),_0x539477);logger['debug'](_0xb5eb('0x1a'),_0x539477,JSON[_0xb5eb('0x11')](_0x9e1b72));_0x2dd816(_0x9e1b72);})['catch'](function(_0x5d0ed1){logger[_0xb5eb('0x12')](_0xb5eb('0x1a'),_0x5d0ed1[_0xb5eb('0x13')],_0x539477);_0x49b201(_0x474bdb[_0xb5eb('0x12')](0x1f4,_0x5d0ed1[_0xb5eb('0x13')]));});});};exports['UpdateVoiceDialReport']=function(_0x235928){var _0x5e2ec4=this;return new Promise(function(_0x1df3df,_0x3ddec9){return db[_0xb5eb('0x16')][_0xb5eb('0x1b')](_0x235928[_0xb5eb('0x1c')],{'raw':_0x235928['options']?_0x235928[_0xb5eb('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x235928['options']?_0x235928[_0xb5eb('0x18')][_0xb5eb('0x1d')]||null:null,'attributes':_0x235928[_0xb5eb('0x18')]?_0x235928[_0xb5eb('0x18')][_0xb5eb('0x1e')]||null:null,'limit':_0x235928[_0xb5eb('0x18')]?_0x235928['options']['limit']||null:null})[_0xb5eb('0xc')](function(_0x3a0c60){logger[_0xb5eb('0xd')](_0xb5eb('0x1f'),_0x235928);logger[_0xb5eb('0x20')](_0xb5eb('0x1f'),_0x235928,JSON[_0xb5eb('0x11')](_0x3a0c60));_0x1df3df(_0x3a0c60);})[_0xb5eb('0x15')](function(_0x1b7951){logger[_0xb5eb('0x12')](_0xb5eb('0x1f'),_0x1b7951[_0xb5eb('0x13')],_0x235928);_0x3ddec9(_0x5e2ec4[_0xb5eb('0x12')](0x1f4,_0x1b7951[_0xb5eb('0x13')]));});});}; \ No newline at end of file +var _0x1d94=['limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','attributes'];(function(_0x2265da,_0xfbbd2e){var _0x430c2b=function(_0x20d671){while(--_0x20d671){_0x2265da['push'](_0x2265da['shift']());}};_0x430c2b(++_0xfbbd2e);}(_0x1d94,0x67));var _0x41d9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1d94[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x41d9('0x0'));var util=require(_0x41d9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x41d9('0x2'));var fs=require('fs');var Redis=require(_0x41d9('0x3'));var db=require(_0x41d9('0x4'))['db'];var utils=require(_0x41d9('0x5'));var logger=require(_0x41d9('0x6'))(_0x41d9('0x7'));var config=require(_0x41d9('0x8'));var jayson=require(_0x41d9('0x9'));var client=jayson[_0x41d9('0xa')][_0x41d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x71c021,_0x586c43,_0x4937b3){return new BPromise(function(_0x31bd59,_0x19fa0a){return client[_0x41d9('0xc')](_0x71c021,_0x4937b3)[_0x41d9('0xd')](function(_0x50bded){logger[_0x41d9('0xe')](_0x41d9('0xf'),_0x586c43,_0x41d9('0x10'));logger[_0x41d9('0x11')](_0x41d9('0x12'),_0x586c43,_0x41d9('0x10'),JSON[_0x41d9('0x13')](_0x50bded));if(_0x50bded['error']){if(_0x50bded['error'][_0x41d9('0x14')]===0x1f4){logger['error'](_0x41d9('0xf'),_0x586c43,_0x50bded[_0x41d9('0x15')][_0x41d9('0x16')]);return _0x19fa0a(_0x50bded[_0x41d9('0x15')]['message']);}logger[_0x41d9('0x15')](_0x41d9('0xf'),_0x586c43,_0x50bded[_0x41d9('0x15')][_0x41d9('0x16')]);return _0x31bd59(_0x50bded[_0x41d9('0x15')][_0x41d9('0x16')]);}else{logger['info'](_0x41d9('0xf'),_0x586c43,'request\x20sent');_0x31bd59(_0x50bded[_0x41d9('0x17')][_0x41d9('0x16')]);}})[_0x41d9('0x18')](function(_0x2d1051){logger[_0x41d9('0x15')](_0x41d9('0xf'),_0x586c43,_0x2d1051);_0x19fa0a(_0x2d1051);});});}exports[_0x41d9('0x19')]=function(_0x1498db){var _0x3b8f59=this;return new Promise(function(_0x19a7cc,_0x41dba7){return db[_0x41d9('0x1a')][_0x41d9('0x1b')](_0x1498db[_0x41d9('0x1c')],{'raw':_0x1498db[_0x41d9('0x1d')]?_0x1498db['options'][_0x41d9('0x1e')]===undefined?!![]:![]:!![]})[_0x41d9('0xd')](function(_0x80d94a){logger[_0x41d9('0xe')]('CreateVoiceDialReport',_0x1498db);logger['debug'](_0x41d9('0x19'),_0x1498db,JSON['stringify'](_0x80d94a));_0x19a7cc(_0x80d94a);})[_0x41d9('0x18')](function(_0x50dbf2){logger[_0x41d9('0x15')]('CreateVoiceDialReport',_0x50dbf2[_0x41d9('0x16')],_0x1498db);_0x41dba7(_0x3b8f59['error'](0x1f4,_0x50dbf2[_0x41d9('0x16')]));});});};exports[_0x41d9('0x1f')]=function(_0x5f0f84){var _0x444ea7=this;return new Promise(function(_0x3d1ae4,_0x2e2816){return db[_0x41d9('0x1a')]['update'](_0x5f0f84[_0x41d9('0x1c')],{'raw':_0x5f0f84['options']?_0x5f0f84[_0x41d9('0x1d')][_0x41d9('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f0f84[_0x41d9('0x1d')]?_0x5f0f84[_0x41d9('0x1d')]['where']||null:null,'attributes':_0x5f0f84['options']?_0x5f0f84['options'][_0x41d9('0x20')]||null:null,'limit':_0x5f0f84['options']?_0x5f0f84[_0x41d9('0x1d')][_0x41d9('0x21')]||null:null})[_0x41d9('0xd')](function(_0x562360){logger[_0x41d9('0xe')](_0x41d9('0x1f'),_0x5f0f84);logger[_0x41d9('0x11')](_0x41d9('0x1f'),_0x5f0f84,JSON[_0x41d9('0x13')](_0x562360));_0x3d1ae4(_0x562360);})['catch'](function(_0x41e16c){logger[_0x41d9('0x15')](_0x41d9('0x1f'),_0x41e16c[_0x41d9('0x16')],_0x5f0f84);_0x2e2816(_0x444ea7[_0x41d9('0x15')](0x1f4,_0x41e16c['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index a74c8f2..cd8eef2 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 _0x0fb9=['index','/:id','isAuthenticated','show','post','create','/:id/applications','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get'];(function(_0xaa9488,_0x2fddc8){var _0x30af3f=function(_0x604250){while(--_0x604250){_0xaa9488['push'](_0xaa9488['shift']());}};_0x30af3f(++_0x2fddc8);}(_0x0fb9,0x128));var _0x90fb=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0fb9[_0x40a045];return _0x1a687c;};'use strict';var multer=require('multer');var util=require(_0x90fb('0x0'));var path=require(_0x90fb('0x1'));var timeout=require(_0x90fb('0x2'));var express=require(_0x90fb('0x3'));var router=express[_0x90fb('0x4')]();var fs_extra=require(_0x90fb('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x90fb('0x6'));var controller=require('./voiceExtension.controller');router[_0x90fb('0x7')]('/',auth['isAuthenticated'](),controller[_0x90fb('0x8')]);router[_0x90fb('0x7')](_0x90fb('0x9'),auth[_0x90fb('0xa')](),controller[_0x90fb('0xb')]);router[_0x90fb('0xc')]('/',auth[_0x90fb('0xa')](),controller[_0x90fb('0xd')]);router[_0x90fb('0xc')](_0x90fb('0xe'),auth[_0x90fb('0xa')](),controller['addApplications']);router[_0x90fb('0xf')](_0x90fb('0x9'),auth[_0x90fb('0xa')](),controller['update']);router[_0x90fb('0x10')](_0x90fb('0x9'),auth[_0x90fb('0xa')](),controller[_0x90fb('0x11')]);module[_0x90fb('0x12')]=router; \ No newline at end of file +var _0xfebb=['index','/:id','show','create','post','/:id/applications','addApplications','put','update','destroy','multer','util','path','express','fs-extra','../../components/auth/service','get','isAuthenticated'];(function(_0x4d3958,_0x32788e){var _0x499351=function(_0x4fbf06){while(--_0x4fbf06){_0x4d3958['push'](_0x4d3958['shift']());}};_0x499351(++_0x32788e);}(_0xfebb,0x1f0));var _0xbfeb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfebb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbfeb('0x0'));var util=require(_0xbfeb('0x1'));var path=require(_0xbfeb('0x2'));var timeout=require('connect-timeout');var express=require(_0xbfeb('0x3'));var router=express['Router']();var fs_extra=require(_0xbfeb('0x4'));var auth=require(_0xbfeb('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0xbfeb('0x6')]('/',auth[_0xbfeb('0x7')](),controller[_0xbfeb('0x8')]);router['get'](_0xbfeb('0x9'),auth[_0xbfeb('0x7')](),controller[_0xbfeb('0xa')]);router['post']('/',auth[_0xbfeb('0x7')](),controller[_0xbfeb('0xb')]);router[_0xbfeb('0xc')](_0xbfeb('0xd'),auth[_0xbfeb('0x7')](),controller[_0xbfeb('0xe')]);router[_0xbfeb('0xf')](_0xbfeb('0x9'),auth[_0xbfeb('0x7')](),controller[_0xbfeb('0x10')]);router['delete']('/:id',auth[_0xbfeb('0x7')](),controller[_0xbfeb('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 8fea35d..07f9cf1 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 _0x9f5e=['system','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','exports','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','inbound-fax'];(function(_0x5db605,_0xae4aad){var _0x36ff15=function(_0x2b6c07){while(--_0x2b6c07){_0x5db605['push'](_0x5db605['shift']());}};_0x36ff15(++_0xae4aad);}(_0x9f5e,0x13a));var _0xe9f5=function(_0x505970,_0x23c90d){_0x505970=_0x505970-0x0;var _0x299033=_0x9f5e[_0x505970];return _0x299033;};'use strict';var Sequelize=require('sequelize');module[_0xe9f5('0x0')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe9f5('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xe9f5('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xe9f5('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xe9f5('0x1')},'tag':{'type':Sequelize[_0xe9f5('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xe9f5('0x2')],'allowNull':![],'defaultValue':_0xe9f5('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xe9f5('0x4')](_0xe9f5('0x5'),_0xe9f5('0x6'),_0xe9f5('0x7'),_0xe9f5('0x8'),'outbound-fax',_0xe9f5('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe9f5('0x2')],'allowNull':![],'defaultValue':_0xe9f5('0xa')},'IntervalId':{'type':Sequelize[_0xe9f5('0xb')]},'isApp':{'type':Sequelize[_0xe9f5('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xe9f5('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xe9f5('0xb')]},'recordingFormat':{'type':Sequelize[_0xe9f5('0x2')],'defaultValue':_0xe9f5('0xd')},'answer':{'type':Sequelize[_0xe9f5('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xe9f5('0xe')],'get':function(_0x3231ed){return this[_0xe9f5('0xf')](_0xe9f5('0x10'));}},'alias':{'type':Sequelize[_0xe9f5('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x4592=['sequelize','exports','compositeIndex','STRING','NoOp','ENUM','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten'];(function(_0x4b7124,_0x206b7b){var _0x23e16d=function(_0x2cd68e){while(--_0x2cd68e){_0x4b7124['push'](_0x4b7124['shift']());}};_0x23e16d(++_0x206b7b);}(_0x4592,0x17c));var _0x2459=function(_0x1b1b9a,_0x2b2faf){_0x1b1b9a=_0x1b1b9a-0x0;var _0xe9ec65=_0x4592[_0x1b1b9a];return _0xe9ec65;};'use strict';var Sequelize=require(_0x2459('0x0'));module[_0x2459('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2459('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x2459('0x3')],'allowNull':![],'unique':_0x2459('0x2')},'priority':{'type':Sequelize[_0x2459('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x2459('0x2')},'tag':{'type':Sequelize[_0x2459('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x2459('0x3')],'allowNull':![],'defaultValue':_0x2459('0x4')},'appdata':{'type':Sequelize[_0x2459('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x2459('0x5')]('inbound',_0x2459('0x6'),_0x2459('0x7'),_0x2459('0x8'),_0x2459('0x9'),_0x2459('0xa'),_0x2459('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x2459('0x3')]},'interval':{'type':Sequelize[_0x2459('0x3')],'allowNull':![],'defaultValue':_0x2459('0xc')},'IntervalId':{'type':Sequelize[_0x2459('0xd')]},'isApp':{'type':Sequelize[_0x2459('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x2459('0x3')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x2459('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x2459('0xd')]},'recordingFormat':{'type':Sequelize[_0x2459('0x3')],'defaultValue':_0x2459('0xf')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x2459('0x10')],'get':function(_0x50ec2b){return this[_0x2459('0x11')](_0x2459('0x12'));}},'alias':{'type':Sequelize[_0x2459('0x3')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index ea2174d..eacaef0 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 _0x0dac=['InternalRoutes','internal','filter','ignore','map','value','includes','type','find','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','query','keys','filters','intersection','attributes','model','fields','nolimit','sort','where','pick','merge','VIRTUAL','VoiceExtension','includeAll','include','findAll','catch','show','params','length','options','body','startsWith','exten','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','UserProfileSection','userProfileId','autoAssociation','update','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','addApplications','transaction','VoiceExtensionId','isApp','log','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','get','inbound','OutboundRoutes','outbound'];(function(_0x520a9c,_0x51914c){var _0x370ab6=function(_0x541c5e){while(--_0x541c5e){_0x520a9c['push'](_0x520a9c['shift']());}};_0x370ab6(++_0x51914c);}(_0x0dac,0x151));var _0xc0da=function(_0x274e67,_0x1d6f18){_0x274e67=_0x274e67-0x0;var _0x261c8b=_0x0dac[_0x274e67];return _0x261c8b;};'use strict';var _=require(_0xc0da('0x0'));var Redis=require(_0xc0da('0x1'));var qs=require(_0xc0da('0x2'));var logger=require(_0xc0da('0x3'))('api');var config=require('../../config/environment');var db=require(_0xc0da('0x4'))['db'];config[_0xc0da('0x5')]=_[_0xc0da('0x6')](config[_0xc0da('0x5')],{'host':_0xc0da('0x7'),'port':0x18eb});var socket=require(_0xc0da('0x8'))(new Redis(config[_0xc0da('0x5')]));require(_0xc0da('0x9'))['register'](socket);function respondWithStatusCode(_0x3cb192,_0x1ee5e9){_0x1ee5e9=_0x1ee5e9||0xcc;return function(_0x281b19){if(_0x281b19){return _0x3cb192[_0xc0da('0xa')](_0x1ee5e9);}return _0x3cb192[_0xc0da('0xb')](_0x1ee5e9)[_0xc0da('0xc')]();};}function respondWithResult(_0x47eb76,_0x25955f){_0x25955f=_0x25955f||0xc8;return function(_0x71656b){if(_0x71656b){return _0x47eb76['status'](_0x25955f)[_0xc0da('0xd')](_0x71656b);}};}function respondWithFilteredResult(_0x38c1b7,_0x58d2f9){return function(_0x308ccb){if(_0x308ccb){var _0x3d1abd=typeof _0x58d2f9[_0xc0da('0xe')]===_0xc0da('0xf')&&typeof _0x58d2f9[_0xc0da('0x10')]===_0xc0da('0xf');var _0x2b748e=_0x308ccb[_0xc0da('0x11')];var _0x56df8b=_0x3d1abd?0x0:_0x58d2f9[_0xc0da('0xe')];var _0x49f065=_0x3d1abd?_0x308ccb['count']:_0x58d2f9[_0xc0da('0xe')]+_0x58d2f9['limit'];var _0x430445;if(_0x49f065>=_0x2b748e){_0x49f065=_0x2b748e;_0x430445=0xc8;}else{_0x430445=0xce;}_0x38c1b7['status'](_0x430445);return _0x38c1b7[_0xc0da('0x12')]('Content-Range',_0x56df8b+'-'+_0x49f065+'/'+_0x2b748e)[_0xc0da('0xd')](_0x308ccb);}return null;};}function removeEntity(_0x151db1){return function(_0x589532){if(_0x589532){return _0x589532['destroy']()['then'](function(){var _0x1949a8=_0x589532[_0xc0da('0x13')]({'plain':!![]});var _0x336805=[{'name':'InboundRoutes','value':_0xc0da('0x14'),'ignore':![]},{'name':_0xc0da('0x15'),'value':_0xc0da('0x16'),'ignore':![]},{'name':_0xc0da('0x17'),'value':_0xc0da('0x18'),'ignore':![]}];var _0x24b72f=_(_0x336805)[_0xc0da('0x19')](_0xc0da('0x1a'))[_0xc0da('0x1b')](_0xc0da('0x1c'))['value']();if(_[_0xc0da('0x1d')](_0x24b72f,_0x1949a8[_0xc0da('0x1e')])){return;}var _0x46c97a=_[_0xc0da('0x1f')](_0x336805,['value',_0x1949a8[_0xc0da('0x1e')]])['name'];return db['UserProfileResource'][_0xc0da('0x20')]({'where':{'type':_0x46c97a,'resourceId':_0x1949a8['id']}})[_0xc0da('0x21')](function(){return _0x589532;});})[_0xc0da('0x21')](function(){_0x151db1[_0xc0da('0xb')](0xcc)[_0xc0da('0xc')]();});}};}function handleEntityNotFound(_0x5af848){return function(_0x4d9a4a){if(!_0x4d9a4a){_0x5af848[_0xc0da('0xa')](0x194);}return _0x4d9a4a;};}function handleError(_0x4e093e,_0xfcd3de){_0xfcd3de=_0xfcd3de||0x1f4;return function(_0x4e0f93){logger[_0xc0da('0x22')](_0x4e0f93[_0xc0da('0x23')]);if(_0x4e0f93[_0xc0da('0x24')]){delete _0x4e0f93[_0xc0da('0x24')];}_0x4e093e[_0xc0da('0xb')](_0xfcd3de)[_0xc0da('0x25')](_0x4e0f93);};}exports[_0xc0da('0x26')]=function(_0x4fa438,_0x4598ab){var _0x2af27d={},_0x45737f={},_0xfb49a1={'count':0x0,'rows':[]};var _0x59d560=_[_0xc0da('0x1b')](db['VoiceExtension'][_0xc0da('0x27')],function(_0x5dbd37){return{'name':_0x5dbd37[_0xc0da('0x28')],'type':_0x5dbd37['type']['key']};});_0x45737f['model']=_[_0xc0da('0x1b')](_0x59d560,_0xc0da('0x24'));_0x45737f[_0xc0da('0x29')]=_[_0xc0da('0x2a')](_0x4fa438['query']);_0x45737f[_0xc0da('0x2b')]=_[_0xc0da('0x2c')](_0x45737f['model'],_0x45737f[_0xc0da('0x29')]);_0x2af27d[_0xc0da('0x2d')]=_[_0xc0da('0x2c')](_0x45737f[_0xc0da('0x2e')],qs[_0xc0da('0x2f')](_0x4fa438[_0xc0da('0x29')][_0xc0da('0x2f')]));_0x2af27d['attributes']=_0x2af27d[_0xc0da('0x2d')]['length']?_0x2af27d[_0xc0da('0x2d')]:_0x45737f[_0xc0da('0x2e')];if(!_0x4fa438[_0xc0da('0x29')]['hasOwnProperty'](_0xc0da('0x30'))){_0x2af27d[_0xc0da('0x10')]=qs[_0xc0da('0x10')](_0x4fa438['query'][_0xc0da('0x10')]);_0x2af27d[_0xc0da('0xe')]=qs[_0xc0da('0xe')](_0x4fa438[_0xc0da('0x29')][_0xc0da('0xe')]);}_0x2af27d['order']=qs[_0xc0da('0x31')](_0x4fa438[_0xc0da('0x29')][_0xc0da('0x31')]);_0x2af27d[_0xc0da('0x32')]=qs[_0xc0da('0x2b')](_[_0xc0da('0x33')](_0x4fa438[_0xc0da('0x29')],_0x45737f[_0xc0da('0x2b')]),_0x59d560);if(_0x4fa438[_0xc0da('0x29')][_0xc0da('0x19')]){_0x2af27d['where']=_[_0xc0da('0x34')](_0x2af27d[_0xc0da('0x32')],{'$or':_[_0xc0da('0x1b')](_0x59d560,function(_0x443dea){if(_0x443dea[_0xc0da('0x1e')]!==_0xc0da('0x35')){var _0x10cf7d={};_0x10cf7d[_0x443dea['name']]={'$like':'%'+_0x4fa438[_0xc0da('0x29')]['filter']+'%'};return _0x10cf7d;}})});}_0x2af27d=_[_0xc0da('0x34')]({},_0x2af27d,_0x4fa438['options']);var _0x16c620={'where':_0x2af27d[_0xc0da('0x32')]};return db[_0xc0da('0x36')][_0xc0da('0x11')](_0x16c620)[_0xc0da('0x21')](function(_0x17b465){_0xfb49a1[_0xc0da('0x11')]=_0x17b465;if(_0x4fa438[_0xc0da('0x29')][_0xc0da('0x37')]){_0x2af27d[_0xc0da('0x38')]=[{'all':!![]}];}return db[_0xc0da('0x36')][_0xc0da('0x39')](_0x2af27d);})['then'](function(_0x49d3a3){_0xfb49a1['rows']=_0x49d3a3;return _0xfb49a1;})[_0xc0da('0x21')](respondWithFilteredResult(_0x4598ab,_0x2af27d))[_0xc0da('0x3a')](handleError(_0x4598ab,null));};exports[_0xc0da('0x3b')]=function(_0x5e6a56,_0xfa9bcc){var _0x3b0cc8={'raw':![],'where':{'id':_0x5e6a56[_0xc0da('0x3c')]['id']}},_0xd7c5c3={};_0xd7c5c3[_0xc0da('0x2e')]=_[_0xc0da('0x2a')](db[_0xc0da('0x36')][_0xc0da('0x27')]);_0xd7c5c3['query']=_[_0xc0da('0x2a')](_0x5e6a56[_0xc0da('0x29')]);_0xd7c5c3[_0xc0da('0x2b')]=_[_0xc0da('0x2c')](_0xd7c5c3[_0xc0da('0x2e')],_0xd7c5c3['query']);_0x3b0cc8[_0xc0da('0x2d')]=_[_0xc0da('0x2c')](_0xd7c5c3['model'],qs['fields'](_0x5e6a56[_0xc0da('0x29')]['fields']));_0x3b0cc8[_0xc0da('0x2d')]=_0x3b0cc8[_0xc0da('0x2d')][_0xc0da('0x3d')]?_0x3b0cc8['attributes']:_0xd7c5c3[_0xc0da('0x2e')];if(_0x5e6a56[_0xc0da('0x29')]['includeAll']){_0x3b0cc8[_0xc0da('0x38')]=[{'all':!![]}];}_0x3b0cc8=_['merge']({},_0x3b0cc8,_0x5e6a56[_0xc0da('0x3e')]);return db[_0xc0da('0x36')][_0xc0da('0x1f')](_0x3b0cc8)[_0xc0da('0x21')](handleEntityNotFound(_0xfa9bcc,null))[_0xc0da('0x21')](respondWithResult(_0xfa9bcc,null))[_0xc0da('0x3a')](handleError(_0xfa9bcc,null));};exports[_0xc0da('0x20')]=function(_0x5f352a,_0x5efb95){return db[_0xc0da('0x36')]['find']({'where':{'id':_0x5f352a[_0xc0da('0x3c')]['id']}})[_0xc0da('0x21')](handleEntityNotFound(_0x5efb95,null))['then'](removeEntity(_0x5efb95,null))['catch'](handleError(_0x5efb95,null));};exports['create']=function(_0x18904c,_0xb4a69d){if(_0x18904c[_0xc0da('0x3f')][_0xc0da('0x1e')]===_0xc0da('0x16')&&!_[_0xc0da('0x40')](_0x18904c[_0xc0da('0x3f')][_0xc0da('0x41')],'_')){_0x18904c[_0xc0da('0x3f')][_0xc0da('0x41')]='_'['concat'](_0x18904c[_0xc0da('0x3f')][_0xc0da('0x41')]);}return db['VoiceExtension'][_0xc0da('0x42')](_0x18904c[_0xc0da('0x3f')],{'raw':![]})[_0xc0da('0x21')](function(_0x5c25ba){var _0x234c4d=_0x18904c[_0xc0da('0x43')][_0xc0da('0x13')]({'plain':!![]});if(!_0x234c4d)throw new Error(_0xc0da('0x44'));if(_0x234c4d[_0xc0da('0x45')]===_0xc0da('0x43')){var _0x245be3=_0x5c25ba[_0xc0da('0x13')]({'plain':!![]});var _0x5a9853=[{'name':_0xc0da('0x46'),'value':'inbound'},{'name':_0xc0da('0x15'),'value':_0xc0da('0x16')},{'name':_0xc0da('0x17'),'value':_0xc0da('0x18')}];var _0x41137d=_['find'](_0x5a9853,[_0xc0da('0x1c'),_0x245be3[_0xc0da('0x1e')]])[_0xc0da('0x24')];return db[_0xc0da('0x47')][_0xc0da('0x1f')]({'where':{'name':_0x41137d,'userProfileId':_0x234c4d[_0xc0da('0x48')]},'raw':!![]})[_0xc0da('0x21')](function(_0x3c87ba){if(_0x3c87ba&&_0x3c87ba[_0xc0da('0x49')]===0x0){return db['UserProfileResource'][_0xc0da('0x42')]({'name':_0x245be3[_0xc0da('0x24')],'resourceId':_0x245be3['id'],'type':_0x3c87ba['name'],'sectionId':_0x3c87ba['id']},{})[_0xc0da('0x21')](function(){return _0x5c25ba;});}else{return _0x5c25ba;}})[_0xc0da('0x3a')](function(_0x311010){logger[_0xc0da('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x311010);throw _0x311010;});}return _0x5c25ba;})[_0xc0da('0x21')](respondWithResult(_0xb4a69d,0xc9))[_0xc0da('0x3a')](handleError(_0xb4a69d,null));};exports[_0xc0da('0x4a')]=function(_0x126537,_0x32efec){if(_0x126537[_0xc0da('0x3f')]['id']){delete _0x126537[_0xc0da('0x3f')]['id'];}return db[_0xc0da('0x36')][_0xc0da('0x1f')]({'where':{'id':_0x126537['params']['id']}})[_0xc0da('0x21')](handleEntityNotFound(_0x32efec,null))['then'](function(_0x24e62f){if(_0x24e62f){return db[_0xc0da('0x36')]['update'](_[_0xc0da('0x33')](_0x126537[_0xc0da('0x3f')],['exten','context',_0xc0da('0x4b'),_0xc0da('0x4c'),_0xc0da('0x4d'),_0xc0da('0x4e'),_0xc0da('0x4f')]),{'where':{'context':_0x24e62f[_0xc0da('0x50')],'exten':_0x24e62f['exten']},'individualHooks':!![]})['then'](function(_0x2be6e0){return _0x2be6e0;});}return null;})[_0xc0da('0x21')](respondWithStatusCode(_0x32efec,null))[_0xc0da('0x3a')](handleError(_0x32efec,null));};exports[_0xc0da('0x51')]=function(_0x136af9,_0x55df15){return db[_0xc0da('0x36')]['findOne']({'where':{'id':_0x136af9[_0xc0da('0x3c')]['id']}})[_0xc0da('0x21')](function(_0x7c7926){if(_0x7c7926){return db['sequelize'][_0xc0da('0x52')](function(_0x4bc89a){return db[_0xc0da('0x36')][_0xc0da('0x20')]({'where':{'VoiceExtensionId':_0x136af9[_0xc0da('0x3c')]['id']},'transaction':_0x4bc89a})['then'](function(){var _0x36e6dc=_[_0xc0da('0x1b')](_0x136af9[_0xc0da('0x3f')],function(_0x95e9e5){_0x95e9e5[_0xc0da('0x53')]=_0x136af9[_0xc0da('0x3c')]['id'];_0x95e9e5[_0xc0da('0x54')]=!![];return _0x95e9e5;});return _0x7c7926['createRouting'](_0x36e6dc);})[_0xc0da('0x21')](function(_0x4394fd){console[_0xc0da('0x55')](_0xc0da('0x56'),_0x4394fd);return db[_0xc0da('0x36')][_0xc0da('0x57')](_0x4394fd,{'transaction':_0x4bc89a});});})[_0xc0da('0x21')](function(){return db[_0xc0da('0x36')][_0xc0da('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x136af9[_0xc0da('0x3c')]['id']},'order':_0xc0da('0x59')});});}})[_0xc0da('0x21')](respondWithResult(_0x55df15,null))[_0xc0da('0x3a')](handleError(_0x55df15,null));}; \ No newline at end of file +var _0x5525=['rows','catch','show','params','rawAttributes','length','options','create','body','startsWith','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','inbound','InternalRoutes','internal','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','context','recordingFormat','mandatoryDisposition','alias','findOne','sequelize','transaction','VoiceExtensionId','log','LOG\x20~\x20.then\x20~\x20routing','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','destroy','then','get','InboundRoutes','OutboundRoutes','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','error','send','index','fieldName','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','VIRTUAL','VoiceExtension','includeAll','include','findAll'];(function(_0x213518,_0x51e022){var _0x1baf75=function(_0x5c8444){while(--_0x5c8444){_0x213518['push'](_0x213518['shift']());}};_0x1baf75(++_0x51e022);}(_0x5525,0xda));var _0x5552=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5525[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x5552('0x0'));var Redis=require(_0x5552('0x1'));var qs=require(_0x5552('0x2'));var logger=require(_0x5552('0x3'))(_0x5552('0x4'));var config=require(_0x5552('0x5'));var db=require(_0x5552('0x6'))['db'];config[_0x5552('0x7')]=_[_0x5552('0x8')](config[_0x5552('0x7')],{'host':_0x5552('0x9'),'port':0x18eb});var socket=require(_0x5552('0xa'))(new Redis(config[_0x5552('0x7')]));require(_0x5552('0xb'))[_0x5552('0xc')](socket);function respondWithStatusCode(_0x539e6b,_0x30458e){_0x30458e=_0x30458e||0xcc;return function(_0x343023){if(_0x343023){return _0x539e6b[_0x5552('0xd')](_0x30458e);}return _0x539e6b[_0x5552('0xe')](_0x30458e)[_0x5552('0xf')]();};}function respondWithResult(_0x5ed0d5,_0x4705a4){_0x4705a4=_0x4705a4||0xc8;return function(_0x299709){if(_0x299709){return _0x5ed0d5[_0x5552('0xe')](_0x4705a4)['json'](_0x299709);}};}function respondWithFilteredResult(_0x72ab94,_0x1fba5d){return function(_0x354685){if(_0x354685){var _0x3e7b10=typeof _0x1fba5d['offset']===_0x5552('0x10')&&typeof _0x1fba5d[_0x5552('0x11')]==='undefined';var _0x5ab5c8=_0x354685[_0x5552('0x12')];var _0x235456=_0x3e7b10?0x0:_0x1fba5d[_0x5552('0x13')];var _0x2ee1f0=_0x3e7b10?_0x354685['count']:_0x1fba5d[_0x5552('0x13')]+_0x1fba5d['limit'];var _0x535e49;if(_0x2ee1f0>=_0x5ab5c8){_0x2ee1f0=_0x5ab5c8;_0x535e49=0xc8;}else{_0x535e49=0xce;}_0x72ab94[_0x5552('0xe')](_0x535e49);return _0x72ab94['set'](_0x5552('0x14'),_0x235456+'-'+_0x2ee1f0+'/'+_0x5ab5c8)[_0x5552('0x15')](_0x354685);}return null;};}function removeEntity(_0x589562){return function(_0x1c31f8){if(_0x1c31f8){return _0x1c31f8[_0x5552('0x16')]()[_0x5552('0x17')](function(){var _0x137a38=_0x1c31f8[_0x5552('0x18')]({'plain':!![]});var _0x3794fc=[{'name':_0x5552('0x19'),'value':'inbound','ignore':![]},{'name':_0x5552('0x1a'),'value':_0x5552('0x1b'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x4ea8ab=_(_0x3794fc)['filter'](_0x5552('0x1c'))[_0x5552('0x1d')](_0x5552('0x1e'))[_0x5552('0x1e')]();if(_[_0x5552('0x1f')](_0x4ea8ab,_0x137a38[_0x5552('0x20')])){return;}var _0x5cc16e=_[_0x5552('0x21')](_0x3794fc,[_0x5552('0x1e'),_0x137a38[_0x5552('0x20')]])[_0x5552('0x22')];return db[_0x5552('0x23')][_0x5552('0x16')]({'where':{'type':_0x5cc16e,'resourceId':_0x137a38['id']}})[_0x5552('0x17')](function(){return _0x1c31f8;});})[_0x5552('0x17')](function(){_0x589562[_0x5552('0xe')](0xcc)[_0x5552('0xf')]();});}};}function handleEntityNotFound(_0x73f284){return function(_0xa28a52){if(!_0xa28a52){_0x73f284[_0x5552('0xd')](0x194);}return _0xa28a52;};}function handleError(_0x515034,_0x227113){_0x227113=_0x227113||0x1f4;return function(_0x3529c7){logger[_0x5552('0x24')](_0x3529c7['stack']);if(_0x3529c7['name']){delete _0x3529c7[_0x5552('0x22')];}_0x515034[_0x5552('0xe')](_0x227113)[_0x5552('0x25')](_0x3529c7);};}exports[_0x5552('0x26')]=function(_0x41148d,_0x59ff99){var _0x4b5447={},_0xabdc2e={},_0x1a5afb={'count':0x0,'rows':[]};var _0x561aef=_['map'](db['VoiceExtension']['rawAttributes'],function(_0x5b3032){return{'name':_0x5b3032[_0x5552('0x27')],'type':_0x5b3032['type']['key']};});_0xabdc2e[_0x5552('0x28')]=_[_0x5552('0x1d')](_0x561aef,_0x5552('0x22'));_0xabdc2e['query']=_[_0x5552('0x29')](_0x41148d[_0x5552('0x2a')]);_0xabdc2e[_0x5552('0x2b')]=_[_0x5552('0x2c')](_0xabdc2e[_0x5552('0x28')],_0xabdc2e[_0x5552('0x2a')]);_0x4b5447['attributes']=_[_0x5552('0x2c')](_0xabdc2e['model'],qs[_0x5552('0x2d')](_0x41148d[_0x5552('0x2a')][_0x5552('0x2d')]));_0x4b5447['attributes']=_0x4b5447[_0x5552('0x2e')]['length']?_0x4b5447[_0x5552('0x2e')]:_0xabdc2e[_0x5552('0x28')];if(!_0x41148d[_0x5552('0x2a')]['hasOwnProperty'](_0x5552('0x2f'))){_0x4b5447[_0x5552('0x11')]=qs[_0x5552('0x11')](_0x41148d[_0x5552('0x2a')][_0x5552('0x11')]);_0x4b5447['offset']=qs[_0x5552('0x13')](_0x41148d[_0x5552('0x2a')][_0x5552('0x13')]);}_0x4b5447[_0x5552('0x30')]=qs['sort'](_0x41148d[_0x5552('0x2a')][_0x5552('0x31')]);_0x4b5447[_0x5552('0x32')]=qs['filters'](_['pick'](_0x41148d[_0x5552('0x2a')],_0xabdc2e['filters']),_0x561aef);if(_0x41148d[_0x5552('0x2a')][_0x5552('0x33')]){_0x4b5447[_0x5552('0x32')]=_[_0x5552('0x34')](_0x4b5447[_0x5552('0x32')],{'$or':_[_0x5552('0x1d')](_0x561aef,function(_0x4e0843){if(_0x4e0843[_0x5552('0x20')]!==_0x5552('0x35')){var _0x4d29a7={};_0x4d29a7[_0x4e0843[_0x5552('0x22')]]={'$like':'%'+_0x41148d[_0x5552('0x2a')][_0x5552('0x33')]+'%'};return _0x4d29a7;}})});}_0x4b5447=_['merge']({},_0x4b5447,_0x41148d['options']);var _0x4bb8d7={'where':_0x4b5447[_0x5552('0x32')]};return db[_0x5552('0x36')]['count'](_0x4bb8d7)['then'](function(_0x48647d){_0x1a5afb[_0x5552('0x12')]=_0x48647d;if(_0x41148d['query'][_0x5552('0x37')]){_0x4b5447[_0x5552('0x38')]=[{'all':!![]}];}return db[_0x5552('0x36')][_0x5552('0x39')](_0x4b5447);})[_0x5552('0x17')](function(_0x169e1d){_0x1a5afb[_0x5552('0x3a')]=_0x169e1d;return _0x1a5afb;})[_0x5552('0x17')](respondWithFilteredResult(_0x59ff99,_0x4b5447))[_0x5552('0x3b')](handleError(_0x59ff99,null));};exports[_0x5552('0x3c')]=function(_0x3ff086,_0x3c253f){var _0x48ea57={'raw':![],'where':{'id':_0x3ff086[_0x5552('0x3d')]['id']}},_0x22dd9c={};_0x22dd9c[_0x5552('0x28')]=_[_0x5552('0x29')](db[_0x5552('0x36')][_0x5552('0x3e')]);_0x22dd9c[_0x5552('0x2a')]=_[_0x5552('0x29')](_0x3ff086[_0x5552('0x2a')]);_0x22dd9c[_0x5552('0x2b')]=_[_0x5552('0x2c')](_0x22dd9c[_0x5552('0x28')],_0x22dd9c[_0x5552('0x2a')]);_0x48ea57[_0x5552('0x2e')]=_[_0x5552('0x2c')](_0x22dd9c[_0x5552('0x28')],qs[_0x5552('0x2d')](_0x3ff086[_0x5552('0x2a')]['fields']));_0x48ea57['attributes']=_0x48ea57[_0x5552('0x2e')][_0x5552('0x3f')]?_0x48ea57[_0x5552('0x2e')]:_0x22dd9c['model'];if(_0x3ff086[_0x5552('0x2a')]['includeAll']){_0x48ea57['include']=[{'all':!![]}];}_0x48ea57=_[_0x5552('0x34')]({},_0x48ea57,_0x3ff086[_0x5552('0x40')]);return db[_0x5552('0x36')]['find'](_0x48ea57)[_0x5552('0x17')](handleEntityNotFound(_0x3c253f,null))['then'](respondWithResult(_0x3c253f,null))[_0x5552('0x3b')](handleError(_0x3c253f,null));};exports[_0x5552('0x16')]=function(_0x2a1174,_0x58eaea){return db['VoiceExtension'][_0x5552('0x21')]({'where':{'id':_0x2a1174[_0x5552('0x3d')]['id']}})[_0x5552('0x17')](handleEntityNotFound(_0x58eaea,null))[_0x5552('0x17')](removeEntity(_0x58eaea,null))[_0x5552('0x3b')](handleError(_0x58eaea,null));};exports[_0x5552('0x41')]=function(_0x230e39,_0xc8bb1f){if(_0x230e39[_0x5552('0x42')][_0x5552('0x20')]===_0x5552('0x1b')&&!_[_0x5552('0x43')](_0x230e39[_0x5552('0x42')]['exten'],'_')){_0x230e39[_0x5552('0x42')][_0x5552('0x44')]='_'[_0x5552('0x45')](_0x230e39[_0x5552('0x42')]['exten']);}return db[_0x5552('0x36')][_0x5552('0x41')](_0x230e39[_0x5552('0x42')],{'raw':![]})[_0x5552('0x17')](function(_0x32641b){var _0x5a0996=_0x230e39['user'][_0x5552('0x18')]({'plain':!![]});if(!_0x5a0996)throw new Error(_0x5552('0x46'));if(_0x5a0996[_0x5552('0x47')]===_0x5552('0x48')){var _0xecc80=_0x32641b[_0x5552('0x18')]({'plain':!![]});var _0x26ad27=[{'name':'InboundRoutes','value':_0x5552('0x49')},{'name':_0x5552('0x1a'),'value':_0x5552('0x1b')},{'name':_0x5552('0x4a'),'value':_0x5552('0x4b')}];var _0x35b106=_[_0x5552('0x21')](_0x26ad27,[_0x5552('0x1e'),_0xecc80[_0x5552('0x20')]])['name'];return db[_0x5552('0x4c')][_0x5552('0x21')]({'where':{'name':_0x35b106,'userProfileId':_0x5a0996[_0x5552('0x4d')]},'raw':!![]})[_0x5552('0x17')](function(_0x5754b8){if(_0x5754b8&&_0x5754b8['autoAssociation']===0x0){return db[_0x5552('0x23')][_0x5552('0x41')]({'name':_0xecc80[_0x5552('0x22')],'resourceId':_0xecc80['id'],'type':_0x5754b8[_0x5552('0x22')],'sectionId':_0x5754b8['id']},{})['then'](function(){return _0x32641b;});}else{return _0x32641b;}})[_0x5552('0x3b')](function(_0x16a33f){logger[_0x5552('0x24')](_0x5552('0x4e'),_0x16a33f);throw _0x16a33f;});}return _0x32641b;})[_0x5552('0x17')](respondWithResult(_0xc8bb1f,0xc9))[_0x5552('0x3b')](handleError(_0xc8bb1f,null));};exports['update']=function(_0x9faa7b,_0x202513){if(_0x9faa7b['body']['id']){delete _0x9faa7b['body']['id'];}return db['VoiceExtension'][_0x5552('0x21')]({'where':{'id':_0x9faa7b[_0x5552('0x3d')]['id']}})[_0x5552('0x17')](handleEntityNotFound(_0x202513,null))['then'](function(_0x11eadc){if(_0x11eadc){return db[_0x5552('0x36')]['update'](_[_0x5552('0x4f')](_0x9faa7b[_0x5552('0x42')],[_0x5552('0x44'),_0x5552('0x50'),'description',_0x5552('0x51'),'cutdigits',_0x5552('0x52'),_0x5552('0x53')]),{'where':{'context':_0x11eadc['context'],'exten':_0x11eadc[_0x5552('0x44')]},'individualHooks':!![]})['then'](function(_0x30885b){return _0x30885b;});}return null;})[_0x5552('0x17')](respondWithStatusCode(_0x202513,null))['catch'](handleError(_0x202513,null));};exports['addApplications']=function(_0x345a73,_0x43843f){return db[_0x5552('0x36')][_0x5552('0x54')]({'where':{'id':_0x345a73[_0x5552('0x3d')]['id']}})['then'](function(_0x35ef0c){if(_0x35ef0c){return db[_0x5552('0x55')][_0x5552('0x56')](function(_0x53eeb7){return db[_0x5552('0x36')][_0x5552('0x16')]({'where':{'VoiceExtensionId':_0x345a73[_0x5552('0x3d')]['id']},'transaction':_0x53eeb7})[_0x5552('0x17')](function(){var _0x2f7542=_[_0x5552('0x1d')](_0x345a73[_0x5552('0x42')],function(_0x46e9de){_0x46e9de[_0x5552('0x57')]=_0x345a73[_0x5552('0x3d')]['id'];_0x46e9de['isApp']=!![];return _0x46e9de;});return _0x35ef0c['createRouting'](_0x2f7542);})[_0x5552('0x17')](function(_0x486fd5){console[_0x5552('0x58')](_0x5552('0x59'),_0x486fd5);return db['VoiceExtension']['bulkCreate'](_0x486fd5,{'transaction':_0x53eeb7});});})[_0x5552('0x17')](function(){return db[_0x5552('0x36')][_0x5552('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x345a73['params']['id']},'order':_0x5552('0x5b')});});}})[_0x5552('0x17')](respondWithResult(_0x43843f,null))['catch'](handleError(_0x43843f,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index b3c6524..a04e4a9 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 _0xadef=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xadef,0x1df));var _0xfade=function(_0x4715b0,_0x360122){_0x4715b0=_0x4715b0-0x0;var _0x4ea88d=_0xadef[_0x4715b0];return _0x4ea88d;};'use strict';var EventEmitter=require(_0xfade('0x0'));var VoiceExtension=require(_0xfade('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xfade('0x2')](0x0);var events={'afterCreate':_0xfade('0x3'),'afterUpdate':_0xfade('0x4'),'afterDestroy':_0xfade('0x5')};function emitEvent(_0x22ab30){return function(_0x1afd73,_0x2145ea,_0x536811){VoiceExtensionEvents['emit'](_0x22ab30+':'+_0x1afd73['id'],_0x1afd73);VoiceExtensionEvents[_0xfade('0x6')](_0x22ab30,_0x1afd73);_0x536811(null);};}for(var e in events){if(events[_0xfade('0x7')](e)){var event=events[e];VoiceExtension[_0xfade('0x8')](e,emitEvent(event));}}module[_0xfade('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x3e81=['exports','events','VoiceExtension','save','remove','emit','hasOwnProperty','hook'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x3e81,0x169));var _0x13e8=function(_0x1964d4,_0x55603f){_0x1964d4=_0x1964d4-0x0;var _0x379874=_0x3e81[_0x1964d4];return _0x379874;};'use strict';var EventEmitter=require(_0x13e8('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x13e8('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x13e8('0x2'),'afterUpdate':'update','afterDestroy':_0x13e8('0x3')};function emitEvent(_0x5387a8){return function(_0x532dc0,_0x2f567c,_0x5d2dbe){VoiceExtensionEvents[_0x13e8('0x4')](_0x5387a8+':'+_0x532dc0['id'],_0x532dc0);VoiceExtensionEvents[_0x13e8('0x4')](_0x5387a8,_0x532dc0);_0x5d2dbe(null);};}for(var e in events){if(events[_0x13e8('0x5')](e)){var event=events[e];VoiceExtension[_0x13e8('0x6')](e,emitEvent(event));}}module[_0x13e8('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 8c74185..bc884ef 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 _0x1d01=['includes','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appdata','priority','last','catch','define','VoiceExtension','voice_extensions','get','then','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','alias','CDR(routeAlias)=','context','exten','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','No\x20alias\x20set','CDR(destination)=','${EXTEN:','cutdigits','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','none','push','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','url','split','name','trunk','param','phone','prefix','${EXTEN}','SIP','options','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','findAll','interval','IntervalId','length','*,*,*,*','intervals','map','tag','CDR(tag)=','toLowerCase','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','answer','queue','playback'];(function(_0x4a6934,_0x1237f4){var _0x532acf=function(_0x5f49fe){while(--_0x5f49fe){_0x4a6934['push'](_0x4a6934['shift']());}};_0x532acf(++_0x1237f4);}(_0x1d01,0xb7));var _0x11d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d01[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x11d0('0x0'));var attributes=require(_0x11d0('0x1'));module[_0x11d0('0x2')]=function(_0x25b21a){var _0x222d4a=_0x25b21a[_0x11d0('0x3')];function _0x467b74(_0x1c96ed){var _0xcf9d78=0x2;var _0x31ce1b=[{'type':_0x1c96ed[_0x11d0('0x4')],'app':_0x11d0('0x5'),'appdata':_0x11d0('0x6')+_0x1c96ed['type'],'context':_0x1c96ed['context'],'exten':_0x1c96ed['exten'],'priority':_0xcf9d78++,'VoiceExtensionId':_0x1c96ed['id']},{'type':_0x1c96ed['type'],'app':_0x1c96ed['alias']?'Set':'NoOp','appdata':_0x1c96ed[_0x11d0('0x7')]?_0x11d0('0x8')+_0x1c96ed[_0x11d0('0x7')]:'No\x20alias\x20set','context':_0x1c96ed[_0x11d0('0x9')],'exten':_0x1c96ed[_0x11d0('0xa')],'priority':_0xcf9d78++,'VoiceExtensionId':_0x1c96ed['id']}];if(_0x1c96ed['type']===_0x11d0('0xb')){_0x31ce1b['push']({'type':_0x11d0('0xb'),'app':_0x11d0('0x5'),'appdata':_0x11d0('0xc')+_0x1c96ed['id'],'context':_0x1c96ed['context'],'exten':_0x1c96ed['exten'],'priority':_0xcf9d78++,'VoiceExtensionId':_0x1c96ed['id']});}_0x31ce1b['push']({'type':_0x1c96ed[_0x11d0('0x4')],'app':_0x11d0('0x5'),'appdata':_0x11d0('0xd'),'context':_0x1c96ed[_0x11d0('0x9')],'exten':_0x1c96ed['exten'],'priority':_0xcf9d78++,'VoiceExtensionId':_0x1c96ed['id']},{'type':_0x1c96ed[_0x11d0('0x4')],'app':'Set','appdata':_0x11d0('0xe'),'context':_0x1c96ed[_0x11d0('0x9')],'exten':_0x1c96ed[_0x11d0('0xa')],'priority':_0xcf9d78++,'VoiceExtensionId':_0x1c96ed['id']},{'type':_0x1c96ed[_0x11d0('0x4')],'app':_0x11d0('0x5'),'appdata':_0x11d0('0xf'),'context':_0x1c96ed[_0x11d0('0x9')],'exten':_0x1c96ed[_0x11d0('0xa')],'priority':_0xcf9d78++,'VoiceExtensionId':_0x1c96ed['id']});return _0x31ce1b;}function _0x4401c5(_0x5b296c){var _0x5c5d4f=0x2;var _0x454ae0=[{'type':_0x11d0('0x10'),'app':'Set','appdata':_0x11d0('0x11'),'context':_0x5b296c['context'],'exten':_0x5b296c['exten'],'priority':_0x5c5d4f++,'VoiceExtensionId':_0x5b296c['id']},{'type':_0x11d0('0x10'),'app':_0x5b296c['alias']?_0x11d0('0x5'):_0x11d0('0x12'),'appdata':_0x5b296c['alias']?'CDR(routeAlias)='+_0x5b296c[_0x11d0('0x7')]:_0x11d0('0x13'),'context':_0x5b296c[_0x11d0('0x9')],'exten':_0x5b296c[_0x11d0('0xa')],'priority':_0x5c5d4f++,'VoiceExtensionId':_0x5b296c['id']},{'type':'outbound','app':_0x11d0('0x5'),'appdata':_0x11d0('0x14')+(_0x5b296c['cutdigits']?_0x11d0('0x15')+_0x5b296c[_0x11d0('0x16')]+'}':'${EXTEN}'),'context':_0x5b296c['context'],'exten':_0x5b296c[_0x11d0('0xa')],'priority':_0x5c5d4f++,'VoiceExtensionId':_0x5b296c['id']},{'type':_0x11d0('0x10'),'app':'Set','appdata':_0x11d0('0xc')+_0x5b296c['id'],'context':_0x5b296c[_0x11d0('0x9')],'exten':_0x5b296c[_0x11d0('0xa')],'priority':_0x5c5d4f++,'VoiceExtensionId':_0x5b296c['id']},{'type':'outbound','app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x5c5d4f+0x2)+_0x11d0('0x17')+(_0x5c5d4f+0x1)+')','context':_0x5b296c[_0x11d0('0x9')],'exten':_0x5b296c[_0x11d0('0xa')],'priority':_0x5c5d4f++,'VoiceExtensionId':_0x5b296c['id']},{'type':'outbound','app':_0x11d0('0x5'),'appdata':_0x5b296c[_0x11d0('0x16')]?_0x11d0('0x18')+_0x5b296c[_0x11d0('0x16')]+'}':_0x11d0('0x19'),'context':_0x5b296c[_0x11d0('0x9')],'exten':_0x5b296c[_0x11d0('0xa')],'priority':_0x5c5d4f++,'VoiceExtensionId':_0x5b296c['id']},{'type':'outbound','app':_0x11d0('0x5'),'appdata':_0x11d0('0xd'),'context':_0x5b296c[_0x11d0('0x9')],'exten':_0x5b296c[_0x11d0('0xa')],'priority':_0x5c5d4f++,'VoiceExtensionId':_0x5b296c['id']},{'type':_0x11d0('0x10'),'app':_0x11d0('0x5'),'appdata':_0x11d0('0xe'),'context':_0x5b296c[_0x11d0('0x9')],'exten':_0x5b296c[_0x11d0('0xa')],'priority':_0x5c5d4f++,'VoiceExtensionId':_0x5b296c['id']},{'type':'outbound','app':_0x11d0('0x5'),'appdata':_0x11d0('0xf'),'context':_0x5b296c[_0x11d0('0x9')],'exten':_0x5b296c[_0x11d0('0xa')],'priority':_0x5c5d4f++,'VoiceExtensionId':_0x5b296c['id']},{'type':_0x11d0('0x10'),'app':_0x11d0('0x5'),'appdata':'outboundrouteid='+_0x5b296c['id'],'context':_0x5b296c[_0x11d0('0x9')],'exten':_0x5b296c[_0x11d0('0xa')],'priority':_0x5c5d4f++,'VoiceExtensionId':_0x5b296c['id']}];if(_0x5b296c[_0x11d0('0x1a')]('recordingFormat')&&_0x5b296c['recordingFormat']!==_0x11d0('0x1b')){_0x454ae0[_0x11d0('0x1c')]({'type':'outbound','app':_0x11d0('0x5'),'appdata':_0x11d0('0x1d'),'context':_0x5b296c[_0x11d0('0x9')],'exten':_0x5b296c[_0x11d0('0xa')],'priority':_0x5c5d4f++,'VoiceExtensionId':_0x5b296c['id']},{'type':_0x11d0('0x10'),'app':_0x11d0('0x5'),'appdata':_0x11d0('0x1e')+_0x5b296c[_0x11d0('0x1f')]||_0x11d0('0x20'),'context':_0x5b296c[_0x11d0('0x9')],'exten':_0x5b296c[_0x11d0('0xa')],'priority':_0x5c5d4f++,'VoiceExtensionId':_0x5b296c['id']});}return _0x454ae0;}function _0x22c558(_0x284682,_0x4a2304){var _0x5892ef=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':_0x11d0('0x21'),'param':0x3}];var _0x1ad474={};var _0xc940a=_0x4a2304[_0x11d0('0x22')](',');var _0x331613=[];for(var _0xed97c5=0x0;_0xed97c5<_0x5892ef['length'];_0xed97c5++){switch(_0x5892ef[_0xed97c5][_0x11d0('0x23')]){case _0x11d0('0x24'):_0x1ad474[_0x11d0('0x24')]=_0xc940a[_0x5892ef[_0xed97c5][_0x11d0('0x25')]][_0x11d0('0x22')]('/')[0x1];_0x1ad474['phone']=_0xc940a[_0x5892ef[_0xed97c5]['param']][_0x11d0('0x22')]('/')[0x2];_0x1ad474['prefix']=_0x1ad474[_0x11d0('0x26')]?_0x1ad474[_0x11d0('0x26')][_0x11d0('0x22')]('$')[0x0]:undefined;_0x1ad474[_0x11d0('0x26')]=_0x284682[_0x11d0('0x16')]?(_0x1ad474['prefix']||'')+'${EXTEN:'+_0x284682[_0x11d0('0x16')]+'}':(_0x1ad474[_0x11d0('0x27')]||'')+_0x11d0('0x28');_0x331613[_0x5892ef[_0xed97c5]['param']]=[_0x11d0('0x29'),_0x1ad474[_0x11d0('0x24')],_0x1ad474['phone']]['join']('/');break;case'options':_0x1ad474[_0x11d0('0x2a')]=_0xc940a[_0x5892ef[_0xed97c5][_0x11d0('0x25')]];if(_0x284682[_0x11d0('0x1f')]!==_0x11d0('0x1b')){if(_0x1ad474[_0x11d0('0x2a')][_0x11d0('0x2b')](_0x11d0('0x2c'))<0x0){_0x1ad474[_0x11d0('0x2a')]+=_0x11d0('0x2c');}}else{_0x1ad474['options']=_0x1ad474[_0x11d0('0x2a')][_0x11d0('0x2d')](_0x11d0('0x2c'),'');}_0x331613[_0x5892ef[_0xed97c5][_0x11d0('0x25')]]=_0x1ad474[_0x11d0('0x2a')];break;default:_0x331613[_0x5892ef[_0xed97c5][_0x11d0('0x25')]]=_0xc940a[_0x5892ef[_0xed97c5]['param']];}}return _0x331613[_0x11d0('0x2e')](',');}function _0x3f45a9(_0x57abf2,_0x4043e8,_0x28d8f2){return new Promise(function(_0x19fb85,_0x1aa91d){var _0x5eadb4=[];if(_[_0x11d0('0x2f')](_0x4043e8))return _0x19fb85(_0x5eadb4);_0x222d4a[_0x11d0('0x30')][_0x11d0('0x31')]({'attributes':['id',_0x11d0('0x32'),_0x11d0('0x33')],'raw':!![]})['then'](function(_0x4d8611){for(var _0x58ef72=0x0,_0x5ab5e7=0x0;_0x58ef72<_0x4043e8[_0x11d0('0x34')];_0x58ef72++,_0x5ab5e7=0x0){var _0x546866=_0x4043e8[_0x58ef72];var _0x759560=[];var _0x1caee1=[];delete _0x546866['id'];if(_0x546866[_0x11d0('0x32')]!==_0x11d0('0x35')){_0x546866[_0x11d0('0x36')]=[_0x546866[_0x11d0('0x32')]];}else{_0x546866[_0x11d0('0x36')]=_0x546866[_0x11d0('0x33')]?_[_0x11d0('0x37')](_['filter'](_0x4d8611,{'IntervalId':_0x546866['IntervalId']}),_0x11d0('0x32')):[];}_0x546866[_0x11d0('0x9')]=_0x57abf2['context'];_0x546866[_0x11d0('0xa')]=_0x57abf2['exten'];if(_0x546866[_0x11d0('0x4')])_0x546866[_0x11d0('0x4')]=_0x546866[_0x11d0('0x4')]['toLowerCase']();if(_0x57abf2['type']===_0x11d0('0x10')){if(_0x546866[_0x11d0('0x1a')](_0x11d0('0x38'))&&_0x546866['tag']&&_0x546866['tag']!=='--'){_0x759560[_0x11d0('0x1c')]({'type':_0x546866['type']['toLowerCase'](),'app':_0x11d0('0x5'),'appdata':_0x11d0('0x39')+_0x546866[_0x11d0('0x38')],'context':_0x57abf2[_0x11d0('0x9')],'exten':_0x57abf2[_0x11d0('0xa')],'priority':_0x546866[_0x11d0('0x36')][_0x11d0('0x34')]+_0x28d8f2+_0x5ab5e7++,'VoiceExtensionId':_0x57abf2['id']});}_0x759560[_0x11d0('0x1c')]({'type':_0x546866['type'][_0x11d0('0x3a')](),'app':_0x11d0('0x3b'),'appdata':_0x11d0('0x3c')+(_0x546866[_0x11d0('0x3d')]?_0x11d0('0x3e')+_0x546866['callerID']+')':'NoOp(No\x20number\x20available)'),'context':_0x57abf2[_0x11d0('0x9')],'exten':_0x57abf2[_0x11d0('0xa')],'priority':_0x546866[_0x11d0('0x36')][_0x11d0('0x34')]+_0x28d8f2+_0x5ab5e7++,'VoiceExtensionId':_0x57abf2['id']});}else{if(_0x546866[_0x11d0('0x1a')](_0x11d0('0x3f'))){if([_0x11d0('0x40'),_0x11d0('0x41')][_0x11d0('0x42')](_0x546866['app'][_0x11d0('0x3a')]())&&_0x546866[_0x11d0('0x43')]!=='custom'){if(_0x546866[_0x11d0('0x3f')]){_0x759560[_0x11d0('0x1c')]({'type':_0x546866[_0x11d0('0x4')][_0x11d0('0x3a')](),'app':_0x11d0('0x3b'),'appdata':_0x11d0('0x44'),'context':_0x57abf2[_0x11d0('0x9')],'exten':_0x57abf2[_0x11d0('0xa')],'priority':_0x546866[_0x11d0('0x36')][_0x11d0('0x34')]+_0x28d8f2+_0x5ab5e7++,'VoiceExtensionId':_0x57abf2['id']});_0x759560[_0x11d0('0x1c')]({'type':_0x546866[_0x11d0('0x4')]['toLowerCase'](),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x57abf2[_0x11d0('0x9')],'exten':_0x57abf2[_0x11d0('0xa')],'priority':_0x546866[_0x11d0('0x36')][_0x11d0('0x34')]+_0x28d8f2+_0x5ab5e7++,'VoiceExtensionId':_0x57abf2['id']});}else{_0x759560['push']({'type':_0x546866[_0x11d0('0x4')][_0x11d0('0x3a')](),'app':_0x11d0('0x3b'),'appdata':_0x11d0('0x45'),'context':_0x57abf2[_0x11d0('0x9')],'exten':_0x57abf2['exten'],'priority':_0x546866[_0x11d0('0x36')][_0x11d0('0x34')]+_0x28d8f2+_0x5ab5e7++,'VoiceExtensionId':_0x57abf2['id']});_0x759560['push']({'type':_0x546866[_0x11d0('0x4')][_0x11d0('0x3a')](),'app':_0x11d0('0x5'),'appdata':_0x11d0('0x46'),'context':_0x57abf2[_0x11d0('0x9')],'exten':_0x57abf2['exten'],'priority':_0x546866[_0x11d0('0x36')][_0x11d0('0x34')]+_0x28d8f2+_0x5ab5e7++,'VoiceExtensionId':_0x57abf2['id']});}}}}for(var _0x2c8e4d=0x0;_0x2c8e4d<_0x546866[_0x11d0('0x36')]['length'];_0x2c8e4d++){var _0x2f4773=_0x28d8f2+_0x546866[_0x11d0('0x36')][_0x11d0('0x34')];var _0x479e48=_0x2c8e4d===_0x546866[_0x11d0('0x36')][_0x11d0('0x34')]-0x1?_0x28d8f2+_0x759560['length']+_0x1caee1[_0x11d0('0x34')]+0x2:_0x28d8f2+_0x2c8e4d+0x1;_0x759560[_0x11d0('0x47')](_0x2c8e4d,0x0,{'type':_0x57abf2[_0x11d0('0x4')],'app':'GotoIfTime','appdata':_0x546866[_0x11d0('0x36')][_0x2c8e4d]+'?'+_0x57abf2[_0x11d0('0x9')]+',${EXTEN},'+_0x2f4773+':'+_0x57abf2[_0x11d0('0x9')]+_0x11d0('0x48')+_0x479e48,'exten':_0x57abf2[_0x11d0('0xa')],'context':_0x57abf2[_0x11d0('0x9')],'priority':_0x28d8f2+_0x2c8e4d,'VoiceExtensionId':_0x57abf2['id']});}if(_0x546866[_0x11d0('0x43')]==='outboundDial')_0x546866[_0x11d0('0x49')]=_0x22c558(_0x57abf2,_0x546866[_0x11d0('0x49')]);_0x546866[_0x11d0('0x4a')]=_0x759560[_0x11d0('0x34')]?_[_0x11d0('0x4b')](_0x759560)[_0x11d0('0x4a')]+0x1:_0x28d8f2;_0x5eadb4=_['concat'](_0x5eadb4,_0x759560,[_0x546866],_0x1caee1);_0x28d8f2=_[_0x11d0('0x4b')](_0x5eadb4)[_0x11d0('0x4a')]+0x1;}return _0x19fb85(_0x5eadb4);})[_0x11d0('0x4c')](function(_0x2bb577){_0x1aa91d(_0x2bb577);});});}return _0x25b21a[_0x11d0('0x4d')](_0x11d0('0x4e'),attributes,{'tableName':_0x11d0('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x81f087){var _0x433c33=this[_0x11d0('0x50')]({'plain':!![]});var _0x1237c3=_0x433c33['type']===_0x11d0('0x10')?_0x4401c5(_0x433c33):_0x467b74(_0x433c33);return _0x3f45a9(_0x433c33,_0x81f087,_[_0x11d0('0x4b')](_0x1237c3)[_0x11d0('0x4a')]+0x1)[_0x11d0('0x51')](function(_0x5e17ad){var _0x91b01b=_['concat'](_0x1237c3,_0x5e17ad);_0x91b01b[_0x11d0('0x1c')]({'type':_0x433c33[_0x11d0('0x4')],'app':_0x11d0('0x52'),'exten':_0x433c33['exten'],'context':_0x433c33['context'],'priority':_[_0x11d0('0x4b')](_0x91b01b)[_0x11d0('0x4a')]+0x1,'VoiceExtensionId':_0x433c33['id']});return _0x91b01b;});}}});}; \ No newline at end of file +var _0x2028=['indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','findAll','interval','IntervalId','then','length','*,*,*,*','intervals','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','define','VoiceExtension','voice_extensions','get','concat','Hangup','exports','models','type','Set','CDR(type)=','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','exten','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','name','split','param','prefix','phone','${EXTEN}','SIP'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x2028,0x1e0));var _0x8202=function(_0x3ba3ab,_0x58d410){_0x3ba3ab=_0x3ba3ab-0x0;var _0x323a7f=_0x2028[_0x3ba3ab];return _0x323a7f;};'use strict';var _=require('lodash');var attributes=require('./voiceExtension.attributes');module[_0x8202('0x0')]=function(_0x4e0fc5){var _0x277061=_0x4e0fc5[_0x8202('0x1')];function _0x10f405(_0x495f0f){var _0x39beb0=0x2;var _0x59f4bb=[{'type':_0x495f0f[_0x8202('0x2')],'app':_0x8202('0x3'),'appdata':_0x8202('0x4')+_0x495f0f[_0x8202('0x2')],'context':_0x495f0f['context'],'exten':_0x495f0f['exten'],'priority':_0x39beb0++,'VoiceExtensionId':_0x495f0f['id']},{'type':_0x495f0f[_0x8202('0x2')],'app':_0x495f0f[_0x8202('0x5')]?_0x8202('0x3'):_0x8202('0x6'),'appdata':_0x495f0f['alias']?_0x8202('0x7')+_0x495f0f[_0x8202('0x5')]:_0x8202('0x8'),'context':_0x495f0f[_0x8202('0x9')],'exten':_0x495f0f[_0x8202('0xa')],'priority':_0x39beb0++,'VoiceExtensionId':_0x495f0f['id']}];if(_0x495f0f[_0x8202('0x2')]==='inbound'){_0x59f4bb[_0x8202('0xb')]({'type':_0x8202('0xc'),'app':_0x8202('0x3'),'appdata':_0x8202('0xd')+_0x495f0f['id'],'context':_0x495f0f['context'],'exten':_0x495f0f[_0x8202('0xa')],'priority':_0x39beb0++,'VoiceExtensionId':_0x495f0f['id']});}_0x59f4bb[_0x8202('0xb')]({'type':_0x495f0f['type'],'app':_0x8202('0x3'),'appdata':_0x8202('0xe'),'context':_0x495f0f['context'],'exten':_0x495f0f[_0x8202('0xa')],'priority':_0x39beb0++,'VoiceExtensionId':_0x495f0f['id']},{'type':_0x495f0f[_0x8202('0x2')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x495f0f['context'],'exten':_0x495f0f['exten'],'priority':_0x39beb0++,'VoiceExtensionId':_0x495f0f['id']},{'type':_0x495f0f[_0x8202('0x2')],'app':_0x8202('0x3'),'appdata':_0x8202('0xf'),'context':_0x495f0f[_0x8202('0x9')],'exten':_0x495f0f[_0x8202('0xa')],'priority':_0x39beb0++,'VoiceExtensionId':_0x495f0f['id']});return _0x59f4bb;}function _0xca0e7e(_0x3bf076){var _0x575510=0x2;var _0x4bac69=[{'type':_0x8202('0x10'),'app':_0x8202('0x3'),'appdata':'CDR(type)=outbound','context':_0x3bf076[_0x8202('0x9')],'exten':_0x3bf076['exten'],'priority':_0x575510++,'VoiceExtensionId':_0x3bf076['id']},{'type':_0x8202('0x10'),'app':_0x3bf076[_0x8202('0x5')]?_0x8202('0x3'):_0x8202('0x6'),'appdata':_0x3bf076[_0x8202('0x5')]?_0x8202('0x7')+_0x3bf076[_0x8202('0x5')]:_0x8202('0x8'),'context':_0x3bf076['context'],'exten':_0x3bf076[_0x8202('0xa')],'priority':_0x575510++,'VoiceExtensionId':_0x3bf076['id']},{'type':'outbound','app':'Set','appdata':_0x8202('0x11')+(_0x3bf076[_0x8202('0x12')]?_0x8202('0x13')+_0x3bf076[_0x8202('0x12')]+'}':'${EXTEN}'),'context':_0x3bf076[_0x8202('0x9')],'exten':_0x3bf076['exten'],'priority':_0x575510++,'VoiceExtensionId':_0x3bf076['id']},{'type':_0x8202('0x10'),'app':_0x8202('0x3'),'appdata':_0x8202('0xd')+_0x3bf076['id'],'context':_0x3bf076[_0x8202('0x9')],'exten':_0x3bf076[_0x8202('0xa')],'priority':_0x575510++,'VoiceExtensionId':_0x3bf076['id']},{'type':_0x8202('0x10'),'app':_0x8202('0x14'),'appdata':_0x8202('0x15')+(_0x575510+0x2)+_0x8202('0x16')+(_0x575510+0x1)+')','context':_0x3bf076[_0x8202('0x9')],'exten':_0x3bf076['exten'],'priority':_0x575510++,'VoiceExtensionId':_0x3bf076['id']},{'type':_0x8202('0x10'),'app':_0x8202('0x3'),'appdata':_0x3bf076[_0x8202('0x12')]?_0x8202('0x17')+_0x3bf076[_0x8202('0x12')]+'}':'CDR(prefix)=noprefix','context':_0x3bf076[_0x8202('0x9')],'exten':_0x3bf076[_0x8202('0xa')],'priority':_0x575510++,'VoiceExtensionId':_0x3bf076['id']},{'type':_0x8202('0x10'),'app':'Set','appdata':_0x8202('0xe'),'context':_0x3bf076[_0x8202('0x9')],'exten':_0x3bf076[_0x8202('0xa')],'priority':_0x575510++,'VoiceExtensionId':_0x3bf076['id']},{'type':_0x8202('0x10'),'app':_0x8202('0x3'),'appdata':_0x8202('0x18'),'context':_0x3bf076[_0x8202('0x9')],'exten':_0x3bf076[_0x8202('0xa')],'priority':_0x575510++,'VoiceExtensionId':_0x3bf076['id']},{'type':_0x8202('0x10'),'app':_0x8202('0x3'),'appdata':_0x8202('0xf'),'context':_0x3bf076[_0x8202('0x9')],'exten':_0x3bf076[_0x8202('0xa')],'priority':_0x575510++,'VoiceExtensionId':_0x3bf076['id']},{'type':_0x8202('0x10'),'app':_0x8202('0x3'),'appdata':_0x8202('0x19')+_0x3bf076['id'],'context':_0x3bf076[_0x8202('0x9')],'exten':_0x3bf076[_0x8202('0xa')],'priority':_0x575510++,'VoiceExtensionId':_0x3bf076['id']}];if(_0x3bf076['hasOwnProperty'](_0x8202('0x1a'))&&_0x3bf076[_0x8202('0x1a')]!==_0x8202('0x1b')){_0x4bac69[_0x8202('0xb')]({'type':_0x8202('0x10'),'app':_0x8202('0x3'),'appdata':_0x8202('0x1c'),'context':_0x3bf076['context'],'exten':_0x3bf076[_0x8202('0xa')],'priority':_0x575510++,'VoiceExtensionId':_0x3bf076['id']},{'type':_0x8202('0x10'),'app':_0x8202('0x3'),'appdata':_0x8202('0x1d')+_0x3bf076['recordingFormat']||_0x8202('0x1e'),'context':_0x3bf076[_0x8202('0x9')],'exten':_0x3bf076[_0x8202('0xa')],'priority':_0x575510++,'VoiceExtensionId':_0x3bf076['id']});}return _0x4bac69;}function _0x31d955(_0x5be03e,_0x494e34){var _0x391a49=[{'name':_0x8202('0x1f'),'param':0x0},{'name':_0x8202('0x20'),'param':0x1},{'name':_0x8202('0x21'),'param':0x2},{'name':_0x8202('0x22'),'param':0x3}];var _0x37a8d2={};var _0x502175=_0x494e34['split'](',');var _0x5cf6af=[];for(var _0x41b167=0x0;_0x41b167<_0x391a49['length'];_0x41b167++){switch(_0x391a49[_0x41b167][_0x8202('0x23')]){case'trunk':_0x37a8d2[_0x8202('0x1f')]=_0x502175[_0x391a49[_0x41b167]['param']][_0x8202('0x24')]('/')[0x1];_0x37a8d2['phone']=_0x502175[_0x391a49[_0x41b167][_0x8202('0x25')]][_0x8202('0x24')]('/')[0x2];_0x37a8d2[_0x8202('0x26')]=_0x37a8d2[_0x8202('0x27')]?_0x37a8d2[_0x8202('0x27')][_0x8202('0x24')]('$')[0x0]:undefined;_0x37a8d2[_0x8202('0x27')]=_0x5be03e[_0x8202('0x12')]?(_0x37a8d2[_0x8202('0x26')]||'')+_0x8202('0x13')+_0x5be03e[_0x8202('0x12')]+'}':(_0x37a8d2['prefix']||'')+_0x8202('0x28');_0x5cf6af[_0x391a49[_0x41b167][_0x8202('0x25')]]=[_0x8202('0x29'),_0x37a8d2[_0x8202('0x1f')],_0x37a8d2[_0x8202('0x27')]]['join']('/');break;case _0x8202('0x21'):_0x37a8d2[_0x8202('0x21')]=_0x502175[_0x391a49[_0x41b167][_0x8202('0x25')]];if(_0x5be03e['recordingFormat']!==_0x8202('0x1b')){if(_0x37a8d2[_0x8202('0x21')][_0x8202('0x2a')](_0x8202('0x2b'))<0x0){_0x37a8d2[_0x8202('0x21')]+=_0x8202('0x2b');}}else{_0x37a8d2[_0x8202('0x21')]=_0x37a8d2[_0x8202('0x21')][_0x8202('0x2c')]('U(xcally-mixmonitor-context)','');}_0x5cf6af[_0x391a49[_0x41b167]['param']]=_0x37a8d2[_0x8202('0x21')];break;default:_0x5cf6af[_0x391a49[_0x41b167][_0x8202('0x25')]]=_0x502175[_0x391a49[_0x41b167][_0x8202('0x25')]];}}return _0x5cf6af[_0x8202('0x2d')](',');}function _0x4b3781(_0x105d84,_0x5c634d,_0x3e0236){return new Promise(function(_0x2d9bcc,_0x47e5f6){var _0xdd7ef6=[];if(_[_0x8202('0x2e')](_0x5c634d))return _0x2d9bcc(_0xdd7ef6);_0x277061[_0x8202('0x2f')][_0x8202('0x30')]({'attributes':['id',_0x8202('0x31'),_0x8202('0x32')],'raw':!![]})[_0x8202('0x33')](function(_0x328718){for(var _0x3f090a=0x0,_0x103c51=0x0;_0x3f090a<_0x5c634d[_0x8202('0x34')];_0x3f090a++,_0x103c51=0x0){var _0x178752=_0x5c634d[_0x3f090a];var _0x56e394=[];var _0x238a45=[];delete _0x178752['id'];if(_0x178752['interval']!==_0x8202('0x35')){_0x178752[_0x8202('0x36')]=[_0x178752[_0x8202('0x31')]];}else{_0x178752[_0x8202('0x36')]=_0x178752['IntervalId']?_[_0x8202('0x37')](_[_0x8202('0x38')](_0x328718,{'IntervalId':_0x178752['IntervalId']}),_0x8202('0x31')):[];}_0x178752[_0x8202('0x9')]=_0x105d84[_0x8202('0x9')];_0x178752[_0x8202('0xa')]=_0x105d84[_0x8202('0xa')];if(_0x178752[_0x8202('0x2')])_0x178752[_0x8202('0x2')]=_0x178752['type'][_0x8202('0x39')]();if(_0x105d84[_0x8202('0x2')]===_0x8202('0x10')){if(_0x178752[_0x8202('0x3a')](_0x8202('0x3b'))&&_0x178752[_0x8202('0x3b')]&&_0x178752['tag']!=='--'){_0x56e394[_0x8202('0xb')]({'type':_0x178752[_0x8202('0x2')][_0x8202('0x39')](),'app':_0x8202('0x3'),'appdata':_0x8202('0x3c')+_0x178752[_0x8202('0x3b')],'context':_0x105d84[_0x8202('0x9')],'exten':_0x105d84['exten'],'priority':_0x178752[_0x8202('0x36')]['length']+_0x3e0236+_0x103c51++,'VoiceExtensionId':_0x105d84['id']});}_0x56e394['push']({'type':_0x178752[_0x8202('0x2')][_0x8202('0x39')](),'app':_0x8202('0x14'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x178752[_0x8202('0x3d')]?_0x8202('0x3e')+_0x178752[_0x8202('0x3d')]+')':_0x8202('0x3f')),'context':_0x105d84[_0x8202('0x9')],'exten':_0x105d84[_0x8202('0xa')],'priority':_0x178752[_0x8202('0x36')][_0x8202('0x34')]+_0x3e0236+_0x103c51++,'VoiceExtensionId':_0x105d84['id']});}else{if(_0x178752['hasOwnProperty'](_0x8202('0x40'))){if([_0x8202('0x41'),'playback'][_0x8202('0x42')](_0x178752[_0x8202('0x43')]['toLowerCase']())&&_0x178752[_0x8202('0x44')]!==_0x8202('0x45')){if(_0x178752[_0x8202('0x40')]){_0x56e394[_0x8202('0xb')]({'type':_0x178752[_0x8202('0x2')]['toLowerCase'](),'app':_0x8202('0x14'),'appdata':_0x8202('0x46'),'context':_0x105d84[_0x8202('0x9')],'exten':_0x105d84[_0x8202('0xa')],'priority':_0x178752[_0x8202('0x36')][_0x8202('0x34')]+_0x3e0236+_0x103c51++,'VoiceExtensionId':_0x105d84['id']});_0x56e394['push']({'type':_0x178752[_0x8202('0x2')]['toLowerCase'](),'app':_0x8202('0x3'),'appdata':_0x8202('0x47'),'context':_0x105d84[_0x8202('0x9')],'exten':_0x105d84[_0x8202('0xa')],'priority':_0x178752['intervals']['length']+_0x3e0236+_0x103c51++,'VoiceExtensionId':_0x105d84['id']});}else{_0x56e394[_0x8202('0xb')]({'type':_0x178752[_0x8202('0x2')][_0x8202('0x39')](),'app':_0x8202('0x14'),'appdata':_0x8202('0x48'),'context':_0x105d84['context'],'exten':_0x105d84[_0x8202('0xa')],'priority':_0x178752[_0x8202('0x36')][_0x8202('0x34')]+_0x3e0236+_0x103c51++,'VoiceExtensionId':_0x105d84['id']});_0x56e394[_0x8202('0xb')]({'type':_0x178752['type'][_0x8202('0x39')](),'app':_0x8202('0x3'),'appdata':_0x8202('0x49'),'context':_0x105d84[_0x8202('0x9')],'exten':_0x105d84[_0x8202('0xa')],'priority':_0x178752[_0x8202('0x36')][_0x8202('0x34')]+_0x3e0236+_0x103c51++,'VoiceExtensionId':_0x105d84['id']});}}}}for(var _0x5129b8=0x0;_0x5129b8<_0x178752[_0x8202('0x36')][_0x8202('0x34')];_0x5129b8++){var _0x132497=_0x3e0236+_0x178752[_0x8202('0x36')][_0x8202('0x34')];var _0x1ef264=_0x5129b8===_0x178752[_0x8202('0x36')][_0x8202('0x34')]-0x1?_0x3e0236+_0x56e394[_0x8202('0x34')]+_0x238a45[_0x8202('0x34')]+0x2:_0x3e0236+_0x5129b8+0x1;_0x56e394[_0x8202('0x4a')](_0x5129b8,0x0,{'type':_0x105d84['type'],'app':_0x8202('0x4b'),'appdata':_0x178752[_0x8202('0x36')][_0x5129b8]+'?'+_0x105d84[_0x8202('0x9')]+_0x8202('0x4c')+_0x132497+':'+_0x105d84[_0x8202('0x9')]+_0x8202('0x4c')+_0x1ef264,'exten':_0x105d84['exten'],'context':_0x105d84[_0x8202('0x9')],'priority':_0x3e0236+_0x5129b8,'VoiceExtensionId':_0x105d84['id']});}if(_0x178752[_0x8202('0x44')]===_0x8202('0x4d'))_0x178752[_0x8202('0x4e')]=_0x31d955(_0x105d84,_0x178752[_0x8202('0x4e')]);_0x178752[_0x8202('0x4f')]=_0x56e394[_0x8202('0x34')]?_[_0x8202('0x50')](_0x56e394)[_0x8202('0x4f')]+0x1:_0x3e0236;_0xdd7ef6=_['concat'](_0xdd7ef6,_0x56e394,[_0x178752],_0x238a45);_0x3e0236=_[_0x8202('0x50')](_0xdd7ef6)[_0x8202('0x4f')]+0x1;}return _0x2d9bcc(_0xdd7ef6);})['catch'](function(_0x4a4ae4){_0x47e5f6(_0x4a4ae4);});});}return _0x4e0fc5[_0x8202('0x51')](_0x8202('0x52'),attributes,{'tableName':_0x8202('0x53'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3502fb){var _0x2f7565=this[_0x8202('0x54')]({'plain':!![]});var _0x556523=_0x2f7565[_0x8202('0x2')]==='outbound'?_0xca0e7e(_0x2f7565):_0x10f405(_0x2f7565);return _0x4b3781(_0x2f7565,_0x3502fb,_[_0x8202('0x50')](_0x556523)[_0x8202('0x4f')]+0x1)[_0x8202('0x33')](function(_0x4b5da3){var _0xc5377b=_[_0x8202('0x55')](_0x556523,_0x4b5da3);_0xc5377b['push']({'type':_0x2f7565['type'],'app':_0x8202('0x56'),'exten':_0x2f7565[_0x8202('0xa')],'context':_0x2f7565['context'],'priority':_[_0x8202('0x50')](_0xc5377b)[_0x8202('0x4f')]+0x1,'VoiceExtensionId':_0x2f7565['id']});return _0xc5377b;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 7ebff67..f075e5e 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 _0x510e=['defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','options','attributes','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x393d44,_0x45c6ae){var _0x302a5c=function(_0x3efdc7){while(--_0x3efdc7){_0x393d44['push'](_0x393d44['shift']());}};_0x302a5c(++_0x45c6ae);}(_0x510e,0x1ed));var _0xe510=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0x510e[_0x2b5513];return _0x578fd2;};'use strict';var _=require(_0xe510('0x0'));var util=require(_0xe510('0x1'));var moment=require(_0xe510('0x2'));var BPromise=require(_0xe510('0x3'));var rs=require(_0xe510('0x4'));var fs=require('fs');var Redis=require(_0xe510('0x5'));var db=require(_0xe510('0x6'))['db'];var utils=require(_0xe510('0x7'));var logger=require(_0xe510('0x8'))('rpc');var config=require(_0xe510('0x9'));var jayson=require(_0xe510('0xa'));var client=jayson[_0xe510('0xb')][_0xe510('0xc')]({'port':0x232a});config[_0xe510('0xd')]=_[_0xe510('0xe')](config[_0xe510('0xd')],{'host':_0xe510('0xf'),'port':0x18eb});var socket=require(_0xe510('0x10'))(new Redis(config[_0xe510('0xd')]));require(_0xe510('0x11'))[_0xe510('0x12')](socket);function respondWithRpcPromise(_0x2f28c1,_0x149f35,_0x521561){return new BPromise(function(_0x23de7b,_0x34ee7d){return client[_0xe510('0x13')](_0x2f28c1,_0x521561)[_0xe510('0x14')](function(_0x46445a){logger[_0xe510('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x149f35,_0xe510('0x16'));logger[_0xe510('0x17')](_0xe510('0x18'),_0x149f35,_0xe510('0x16'),JSON[_0xe510('0x19')](_0x46445a));if(_0x46445a[_0xe510('0x1a')]){if(_0x46445a[_0xe510('0x1a')][_0xe510('0x1b')]===0x1f4){logger[_0xe510('0x1a')](_0xe510('0x1c'),_0x149f35,_0x46445a[_0xe510('0x1a')][_0xe510('0x1d')]);return _0x34ee7d(_0x46445a['error'][_0xe510('0x1d')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x149f35,_0x46445a[_0xe510('0x1a')][_0xe510('0x1d')]);return _0x23de7b(_0x46445a[_0xe510('0x1a')][_0xe510('0x1d')]);}else{logger[_0xe510('0x15')](_0xe510('0x1c'),_0x149f35,_0xe510('0x16'));_0x23de7b(_0x46445a[_0xe510('0x1e')]['message']);}})[_0xe510('0x1f')](function(_0x421de0){logger[_0xe510('0x1a')](_0xe510('0x1c'),_0x149f35,_0x421de0);_0x34ee7d(_0x421de0);});});}exports[_0xe510('0x20')]=function(_0x228d03){var _0x3ac39c=this;return new Promise(function(_0x55222e,_0xd3237){return db[_0xe510('0x21')]['findAll']({'raw':_0x228d03[_0xe510('0x22')]?_0x228d03[_0xe510('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x228d03[_0xe510('0x22')]?_0x228d03[_0xe510('0x22')]['where']||null:null,'attributes':_0x228d03[_0xe510('0x22')]?_0x228d03[_0xe510('0x22')][_0xe510('0x23')]||null:null,'limit':_0x228d03[_0xe510('0x22')]?_0x228d03[_0xe510('0x22')]['limit']||null:null,'include':_0x228d03[_0xe510('0x22')]?_0x228d03['options']['include']?_['map'](_0x228d03[_0xe510('0x22')][_0xe510('0x24')],function(_0x5abf44){return{'model':db[_0x5abf44[_0xe510('0x25')]],'as':_0x5abf44['as'],'attributes':_0x5abf44['attributes'],'include':_0x5abf44[_0xe510('0x24')]?_[_0xe510('0x26')](_0x5abf44[_0xe510('0x24')],function(_0x35fa1a){return{'model':db[_0x35fa1a[_0xe510('0x25')]],'as':_0x35fa1a['as'],'attributes':_0x35fa1a[_0xe510('0x23')],'include':_0x35fa1a[_0xe510('0x24')]?_[_0xe510('0x26')](_0x35fa1a[_0xe510('0x24')],function(_0x2aff62){return{'model':db[_0x2aff62[_0xe510('0x25')]],'as':_0x2aff62['as'],'attributes':_0x2aff62['attributes']};}):[]};}):[]};}):[]:[]})[_0xe510('0x14')](function(_0x1ea081){logger['info']('GetVoiceExtension',_0x228d03);logger[_0xe510('0x17')](_0xe510('0x20'),_0x228d03,JSON['stringify'](_0x1ea081));_0x55222e(_0x1ea081);})[_0xe510('0x1f')](function(_0x40008f){logger[_0xe510('0x1a')](_0xe510('0x20'),_0x40008f[_0xe510('0x1d')],_0x228d03);_0xd3237(_0x3ac39c['error'](0x1f4,_0x40008f[_0xe510('0x1d')]));});});}; \ No newline at end of file +var _0xad78=['socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceExtension','findAll','raw','options','attributes','limit','include','model','map','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xad78,0x149));var _0x8ad7=function(_0x262ba5,_0x10bb4d){_0x262ba5=_0x262ba5-0x0;var _0x5ad865=_0xad78[_0x262ba5];return _0x5ad865;};'use strict';var _=require(_0x8ad7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8ad7('0x1'));var rs=require(_0x8ad7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ad7('0x3'))['db'];var utils=require(_0x8ad7('0x4'));var logger=require(_0x8ad7('0x5'))(_0x8ad7('0x6'));var config=require(_0x8ad7('0x7'));var jayson=require(_0x8ad7('0x8'));var client=jayson[_0x8ad7('0x9')][_0x8ad7('0xa')]({'port':0x232a});config[_0x8ad7('0xb')]=_[_0x8ad7('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8ad7('0xd'))(new Redis(config[_0x8ad7('0xb')]));require(_0x8ad7('0xe'))[_0x8ad7('0xf')](socket);function respondWithRpcPromise(_0x94c8cf,_0x1f7808,_0x22e528){return new BPromise(function(_0x4929ca,_0x36fad7){return client[_0x8ad7('0x10')](_0x94c8cf,_0x22e528)[_0x8ad7('0x11')](function(_0x5a51ba){logger[_0x8ad7('0x12')](_0x8ad7('0x13'),_0x1f7808,_0x8ad7('0x14'));logger[_0x8ad7('0x15')](_0x8ad7('0x16'),_0x1f7808,_0x8ad7('0x14'),JSON[_0x8ad7('0x17')](_0x5a51ba));if(_0x5a51ba[_0x8ad7('0x18')]){if(_0x5a51ba[_0x8ad7('0x18')][_0x8ad7('0x19')]===0x1f4){logger[_0x8ad7('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x1f7808,_0x5a51ba['error'][_0x8ad7('0x1a')]);return _0x36fad7(_0x5a51ba['error'][_0x8ad7('0x1a')]);}logger[_0x8ad7('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x1f7808,_0x5a51ba['error'][_0x8ad7('0x1a')]);return _0x4929ca(_0x5a51ba[_0x8ad7('0x18')][_0x8ad7('0x1a')]);}else{logger[_0x8ad7('0x12')](_0x8ad7('0x13'),_0x1f7808,_0x8ad7('0x14'));_0x4929ca(_0x5a51ba[_0x8ad7('0x1b')]['message']);}})['catch'](function(_0x5489e1){logger[_0x8ad7('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x1f7808,_0x5489e1);_0x36fad7(_0x5489e1);});});}exports[_0x8ad7('0x1c')]=function(_0x5d9e45){var _0x41cdd7=this;return new Promise(function(_0x511d6c,_0x5db500){return db['VoiceExtension'][_0x8ad7('0x1d')]({'raw':_0x5d9e45['options']?_0x5d9e45['options'][_0x8ad7('0x1e')]===undefined?!![]:![]:!![],'where':_0x5d9e45[_0x8ad7('0x1f')]?_0x5d9e45[_0x8ad7('0x1f')]['where']||null:null,'attributes':_0x5d9e45[_0x8ad7('0x1f')]?_0x5d9e45[_0x8ad7('0x1f')][_0x8ad7('0x20')]||null:null,'limit':_0x5d9e45[_0x8ad7('0x1f')]?_0x5d9e45[_0x8ad7('0x1f')][_0x8ad7('0x21')]||null:null,'include':_0x5d9e45['options']?_0x5d9e45[_0x8ad7('0x1f')][_0x8ad7('0x22')]?_['map'](_0x5d9e45[_0x8ad7('0x1f')][_0x8ad7('0x22')],function(_0x23d7e5){return{'model':db[_0x23d7e5[_0x8ad7('0x23')]],'as':_0x23d7e5['as'],'attributes':_0x23d7e5[_0x8ad7('0x20')],'include':_0x23d7e5[_0x8ad7('0x22')]?_[_0x8ad7('0x24')](_0x23d7e5['include'],function(_0x508ac9){return{'model':db[_0x508ac9[_0x8ad7('0x23')]],'as':_0x508ac9['as'],'attributes':_0x508ac9['attributes'],'include':_0x508ac9[_0x8ad7('0x22')]?_[_0x8ad7('0x24')](_0x508ac9['include'],function(_0x27bbcb){return{'model':db[_0x27bbcb[_0x8ad7('0x23')]],'as':_0x27bbcb['as'],'attributes':_0x27bbcb[_0x8ad7('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x317c31){logger['info']('GetVoiceExtension',_0x5d9e45);logger['debug'](_0x8ad7('0x1c'),_0x5d9e45,JSON[_0x8ad7('0x17')](_0x317c31));_0x511d6c(_0x317c31);})[_0x8ad7('0x25')](function(_0x38f101){logger[_0x8ad7('0x18')](_0x8ad7('0x1c'),_0x38f101[_0x8ad7('0x1a')],_0x5d9e45);_0x5db500(_0x41cdd7[_0x8ad7('0x18')](0x1f4,_0x38f101[_0x8ad7('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 1a5d836..2ab96a7 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 _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x3f9ff7,_0x2530d7){var _0x29c1a5=function(_0x2b152c){while(--_0x2b152c){_0x3f9ff7['push'](_0x3f9ff7['shift']());}};_0x29c1a5(++_0x2530d7);}(_0xf494,0x1c6));var _0x4f49=function(_0x4616e0,_0x11fae9){_0x4616e0=_0x4616e0-0x0;var _0x21c420=_0xf494[_0x4616e0];return _0x21c420;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file +var _0x53ec=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0xaa393e,_0x3b82e5){var _0x44aa58=function(_0x145536){while(--_0x145536){_0xaa393e['push'](_0xaa393e['shift']());}};_0x44aa58(++_0x3b82e5);}(_0x53ec,0x192));var _0xc53e=function(_0x23cd5a,_0x45de7d){_0x23cd5a=_0x23cd5a-0x0;var _0x4e4719=_0x53ec[_0x23cd5a];return _0x4e4719;};'use strict';var VoiceExtensionEvents=require(_0xc53e('0x0'));var events=[_0xc53e('0x1'),_0xc53e('0x2'),_0xc53e('0x3')];function createListener(_0x1b04cc,_0xe45c6d){return function(_0x51c435){_0xe45c6d[_0xc53e('0x4')](_0x1b04cc,_0x51c435);};}function removeListener(_0x4e954a,_0x2b90f6){return function(){VoiceExtensionEvents[_0xc53e('0x5')](_0x4e954a,_0x2b90f6);};}exports['register']=function(_0x2f1414){for(var _0x4f989b=0x0,_0x41a9e8=events[_0xc53e('0x6')];_0x4f989b<_0x41a9e8;_0x4f989b++){var _0x5d3b28=events[_0x4f989b];var _0x1616ac=createListener(_0xc53e('0x7')+_0x5d3b28,_0x2f1414);VoiceExtensionEvents['on'](_0x5d3b28,_0x1616ac);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 55d72ea..2d9b9a9 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 _0xed1c=['get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','update','delete','destroy','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller'];(function(_0x32496c,_0x1c995e){var _0x57e350=function(_0x44da04){while(--_0x44da04){_0x32496c['push'](_0x32496c['shift']());}};_0x57e350(++_0x1c995e);}(_0xed1c,0xe4));var _0xced1=function(_0x41d61d,_0x194179){_0x41d61d=_0x41d61d-0x0;var _0x606b9e=_0xed1c[_0x41d61d];return _0x606b9e;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xced1('0x2'));var auth=require(_0xced1('0x3'));var interaction=require(_0xced1('0x4'));var config=require('../../config/environment');var controller=require(_0xced1('0x5'));router[_0xced1('0x6')]('/',auth[_0xced1('0x7')](),controller[_0xced1('0x8')]);router['get'](_0xced1('0x9'),auth[_0xced1('0x7')](),controller[_0xced1('0xa')]);router[_0xced1('0x6')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0xc')]);router[_0xced1('0xd')]('/',auth['isAuthenticated'](),controller[_0xced1('0xe')]);router['put'](_0xced1('0x9'),auth[_0xced1('0x7')](),controller[_0xced1('0xf')]);router[_0xced1('0x10')](_0xced1('0x9'),auth[_0xced1('0x7')](),controller[_0xced1('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8aad=['delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','isAuthenticated','index','get','show','/:id/messages','post','create','put','/:id','update'];(function(_0x24ba6d,_0x261d91){var _0x344124=function(_0x161797){while(--_0x161797){_0x24ba6d['push'](_0x24ba6d['shift']());}};_0x344124(++_0x261d91);}(_0x8aad,0x146));var _0xd8aa=function(_0x4173f5,_0x4dee8d){_0x4173f5=_0x4173f5-0x0;var _0x4f4bff=_0x8aad[_0x4173f5];return _0x4f4bff;};'use strict';var multer=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var path=require('path');var timeout=require(_0xd8aa('0x2'));var express=require('express');var router=express[_0xd8aa('0x3')]();var fs_extra=require(_0xd8aa('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd8aa('0x5'));var controller=require('./voiceMail.controller');router['get']('/',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x7')]);router[_0xd8aa('0x8')]('/:id',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x9')]);router[_0xd8aa('0x8')](_0xd8aa('0xa'),auth['isAuthenticated'](),controller['getMessages']);router[_0xd8aa('0xb')]('/',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0xc')]);router[_0xd8aa('0xd')](_0xd8aa('0xe'),auth['isAuthenticated'](),controller[_0xd8aa('0xf')]);router[_0xd8aa('0x10')](_0xd8aa('0xe'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x11')]);module[_0xd8aa('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index d784ebf..5df2f1f 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 _0xb613=['trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','fullname','getDataValue','mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','email','string'];(function(_0x37795c,_0x40a585){var _0x20ca55=function(_0x59f5a9){while(--_0x59f5a9){_0x37795c['push'](_0x37795c['shift']());}};_0x20ca55(++_0x40a585);}(_0xb613,0x14d));var _0x3b61=function(_0x326e79,_0x33dc91){_0x326e79=_0x326e79-0x0;var _0x37eb89=_0xb613[_0x326e79];return _0x37eb89;};'use strict';var Sequelize=require(_0x3b61('0x0'));module[_0x3b61('0x1')]={'customer_id':{'type':Sequelize[_0x3b61('0x2')]},'context':{'type':Sequelize[_0x3b61('0x2')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x3b61('0x2')],'defaultValue':'','allowNull':![],'unique':_0x3b61('0x3')},'password':{'type':Sequelize[_0x3b61('0x2')]},'fullname':{'type':Sequelize[_0x3b61('0x2')]},'email':{'type':Sequelize[_0x3b61('0x2')],'validate':{'isEmail':!![]},'set':function(_0x1bb012){this[_0x3b61('0x4')](_0x3b61('0x5'),typeof _0x1bb012===_0x3b61('0x6')&&_0x1bb012[_0x3b61('0x7')]()?_0x1bb012['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x3b61('0x2')],'defaultValue':_0x3b61('0x8')},'attach':{'type':Sequelize[_0x3b61('0x9')](_0x3b61('0xa'),'no'),'defaultValue':_0x3b61('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x3b61('0x9')](_0x3b61('0xa'),'no'),'defaultValue':_0x3b61('0xa'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x3b61('0x9')](_0x3b61('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3b61('0x9')](_0x3b61('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3b61('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3b61('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3b61('0x9')](_0x3b61('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x3b61('0xa'),'no'),'defaultValue':_0x3b61('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x3b61('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3b61('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3b61('0x9')](_0x3b61('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x3b61('0xc')},'emailsubject':{'type':Sequelize[_0x3b61('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x3b61('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x3b61('0xe'))+'\x20-\x20'+this[_0x3b61('0xf')](_0x3b61('0x10'));}}}; \ No newline at end of file +var _0x2044=['INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','email','string','trim','central','yes','ENUM','TINYINT(4)'];(function(_0x5e96d2,_0x1ab6bb){var _0x2bde36=function(_0x2c10a9){while(--_0x2c10a9){_0x5e96d2['push'](_0x5e96d2['shift']());}};_0x2bde36(++_0x1ab6bb);}(_0x2044,0x1bf));var _0x4204=function(_0x461431,_0x45c3ff){_0x461431=_0x461431-0x0;var _0x4fb41d=_0x2044[_0x461431];return _0x4fb41d;};'use strict';var Sequelize=require(_0x4204('0x0'));module[_0x4204('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4204('0x2')],'defaultValue':_0x4204('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x4204('0x2')],'defaultValue':'','allowNull':![],'unique':_0x4204('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x4204('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x453dac){this['setDataValue'](_0x4204('0x5'),typeof _0x453dac===_0x4204('0x6')&&_0x453dac[_0x4204('0x7')]()?_0x453dac[_0x4204('0x7')]():null);}},'pager':{'type':Sequelize[_0x4204('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x4204('0x8')},'attach':{'type':Sequelize['ENUM'](_0x4204('0x9'),'no'),'defaultValue':_0x4204('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x4204('0xa')](_0x4204('0x9'),'no'),'defaultValue':_0x4204('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x4204('0x2')]},'callback':{'type':Sequelize[_0x4204('0x2')]},'review':{'type':Sequelize['ENUM'](_0x4204('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x4204('0xa')](_0x4204('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x4204('0xa')](_0x4204('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4204('0xa')](_0x4204('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4204('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x4204('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4204('0xa')](_0x4204('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x4204('0x9'),'no'),'defaultValue':_0x4204('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x4204('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x4204('0xa')](_0x4204('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x4204('0xa')]('yes','no'),'defaultValue':_0x4204('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x4204('0x2')]},'emailbody':{'type':Sequelize[_0x4204('0x2')]},'maxsecs':{'type':Sequelize[_0x4204('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x4204('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4204('0xd')](_0x4204('0xe'))+_0x4204('0xf')+this[_0x4204('0xd')](_0x4204('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 2bb6776..5a3aac9 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 _0x0102=['rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','squel','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','end','status','json','offset','undefined','limit','count','set','apply','reject','save','get','Voicemails','destroy','then','sendStatus','stack','name','send','index','VoiceMail'];(function(_0x2f280a,_0x351a5f){var _0x4da1ad=function(_0x29e53f){while(--_0x29e53f){_0x2f280a['push'](_0x2f280a['shift']());}};_0x4da1ad(++_0x351a5f);}(_0x0102,0x186));var _0x2010=function(_0x181fdc,_0xacf8db){_0x181fdc=_0x181fdc-0x0;var _0x2bdc7a=_0x0102[_0x181fdc];return _0x2bdc7a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2010('0x0'));var zipdir=require(_0x2010('0x1'));var jsonpatch=require(_0x2010('0x2'));var rp=require(_0x2010('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2010('0x4'));var csv=require(_0x2010('0x5'));var ejs=require(_0x2010('0x6'));var fs=require('fs');var fs_extra=require(_0x2010('0x7'));var _=require('lodash');var squel=require(_0x2010('0x8'));var crypto=require('crypto');var jsforce=require(_0x2010('0x9'));var deskjs=require(_0x2010('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2010('0xb'));var Papa=require(_0x2010('0xc'));var Redis=require(_0x2010('0xd'));var authService=require(_0x2010('0xe'));var qs=require(_0x2010('0xf'));var as=require(_0x2010('0x10'));var hardwareService=require(_0x2010('0x11'));var logger=require(_0x2010('0x12'))(_0x2010('0x13'));var utils=require(_0x2010('0x14'));var config=require(_0x2010('0x15'));var licenseUtil=require(_0x2010('0x16'));var db=require(_0x2010('0x17'))['db'];function respondWithStatusCode(_0x3f307c,_0x3e8624){_0x3e8624=_0x3e8624||0xcc;return function(_0x388991){if(_0x388991){return _0x3f307c['sendStatus'](_0x3e8624);}return _0x3f307c['status'](_0x3e8624)[_0x2010('0x18')]();};}function respondWithResult(_0x385720,_0x2e8ec2){_0x2e8ec2=_0x2e8ec2||0xc8;return function(_0x10b587){if(_0x10b587){return _0x385720[_0x2010('0x19')](_0x2e8ec2)[_0x2010('0x1a')](_0x10b587);}};}function respondWithFilteredResult(_0x517ff4,_0x3195fa){return function(_0x136418){if(_0x136418){var _0x5ad412=typeof _0x3195fa[_0x2010('0x1b')]===_0x2010('0x1c')&&typeof _0x3195fa[_0x2010('0x1d')]===_0x2010('0x1c');var _0x2d0bf2=_0x136418[_0x2010('0x1e')];var _0x83cd35=_0x5ad412?0x0:_0x3195fa[_0x2010('0x1b')];var _0x309477=_0x5ad412?_0x136418['count']:_0x3195fa['offset']+_0x3195fa[_0x2010('0x1d')];var _0x38a15a;if(_0x309477>=_0x2d0bf2){_0x309477=_0x2d0bf2;_0x38a15a=0xc8;}else{_0x38a15a=0xce;}_0x517ff4[_0x2010('0x19')](_0x38a15a);return _0x517ff4[_0x2010('0x1f')]('Content-Range',_0x83cd35+'-'+_0x309477+'/'+_0x2d0bf2)['json'](_0x136418);}return null;};}function patchUpdates(_0x22c252){return function(_0x171e45){try{jsonpatch[_0x2010('0x20')](_0x171e45,_0x22c252,!![]);}catch(_0x26facc){return BPromise[_0x2010('0x21')](_0x26facc);}return _0x171e45[_0x2010('0x22')]();};}function saveUpdates(_0x4f621c,_0x3db13d){return function(_0x1cfa57){if(_0x1cfa57){return _0x1cfa57['update'](_0x4f621c)['then'](function(_0x50aecc){return _0x50aecc;});}return null;};}function removeEntity(_0x424453,_0x574719){return function(_0x277dcc){if(_0x277dcc){return _0x277dcc['destroy']()['then'](function(){var _0xdb57be=_0x277dcc[_0x2010('0x23')]({'plain':!![]});var _0x52b4fe=_0x2010('0x24');return db['UserProfileResource'][_0x2010('0x25')]({'where':{'type':_0x52b4fe,'resourceId':_0xdb57be['id']}})[_0x2010('0x26')](function(){return _0x277dcc;});})[_0x2010('0x26')](function(){_0x424453[_0x2010('0x19')](0xcc)[_0x2010('0x18')]();});}};}function handleEntityNotFound(_0x2f63bb,_0x981b65){return function(_0x3eb4dc){if(!_0x3eb4dc){_0x2f63bb[_0x2010('0x27')](0x194);}return _0x3eb4dc;};}function handleError(_0x103460,_0x122ee3){_0x122ee3=_0x122ee3||0x1f4;return function(_0x2ebdbb){logger['error'](_0x2ebdbb[_0x2010('0x28')]);if(_0x2ebdbb['name']){delete _0x2ebdbb[_0x2010('0x29')];}_0x103460[_0x2010('0x19')](_0x122ee3)[_0x2010('0x2a')](_0x2ebdbb);};}exports[_0x2010('0x2b')]=function(_0x564a64,_0x554f66){var _0x136d5f={},_0x48d9f2={},_0x2839f2={'count':0x0,'rows':[]};var _0x1d5d7a=_['map'](db[_0x2010('0x2c')][_0x2010('0x2d')],function(_0x2b1ff7){return{'name':_0x2b1ff7[_0x2010('0x2e')],'type':_0x2b1ff7[_0x2010('0x2f')]['key']};});_0x48d9f2[_0x2010('0x30')]=_[_0x2010('0x31')](_0x1d5d7a,_0x2010('0x29'));_0x48d9f2['query']=_['keys'](_0x564a64[_0x2010('0x32')]);_0x48d9f2[_0x2010('0x33')]=_[_0x2010('0x34')](_0x48d9f2['model'],_0x48d9f2['query']);_0x136d5f[_0x2010('0x35')]=_[_0x2010('0x34')](_0x48d9f2[_0x2010('0x30')],qs[_0x2010('0x36')](_0x564a64[_0x2010('0x32')]['fields']));_0x136d5f['attributes']=_0x136d5f['attributes'][_0x2010('0x37')]?_0x136d5f[_0x2010('0x35')]:_0x48d9f2[_0x2010('0x30')];if(!_0x564a64['query'][_0x2010('0x38')](_0x2010('0x39'))){_0x136d5f[_0x2010('0x1d')]=qs[_0x2010('0x1d')](_0x564a64['query'][_0x2010('0x1d')]);_0x136d5f[_0x2010('0x1b')]=qs[_0x2010('0x1b')](_0x564a64['query'][_0x2010('0x1b')]);}_0x136d5f['order']=qs[_0x2010('0x3a')](_0x564a64[_0x2010('0x32')][_0x2010('0x3a')]);_0x136d5f[_0x2010('0x3b')]=qs[_0x2010('0x33')](_[_0x2010('0x3c')](_0x564a64['query'],_0x48d9f2[_0x2010('0x33')]),_0x1d5d7a);if(_0x564a64['query'][_0x2010('0x3d')]){_0x136d5f[_0x2010('0x3b')]=_[_0x2010('0x3e')](_0x136d5f[_0x2010('0x3b')],{'$or':_[_0x2010('0x31')](_0x1d5d7a,function(_0x1f053c){if(_0x1f053c[_0x2010('0x2f')]!==_0x2010('0x3f')){var _0x2fcaef={};_0x2fcaef[_0x1f053c[_0x2010('0x29')]]={'$like':'%'+_0x564a64[_0x2010('0x32')][_0x2010('0x3d')]+'%'};return _0x2fcaef;}})});}_0x136d5f=_[_0x2010('0x3e')]({},_0x136d5f,_0x564a64[_0x2010('0x40')]);var _0x4b6251={'where':_0x136d5f['where']};return db[_0x2010('0x2c')][_0x2010('0x1e')](_0x4b6251)[_0x2010('0x26')](function(_0x35d631){_0x2839f2[_0x2010('0x1e')]=_0x35d631;if(_0x564a64[_0x2010('0x32')][_0x2010('0x41')]){_0x136d5f['include']=[{'all':!![]}];}return db[_0x2010('0x2c')]['findAll'](_0x136d5f);})[_0x2010('0x26')](function(_0x3ff496){_0x2839f2[_0x2010('0x42')]=_0x3ff496;return _0x2839f2;})[_0x2010('0x26')](respondWithFilteredResult(_0x554f66,_0x136d5f))[_0x2010('0x43')](handleError(_0x554f66,null));};exports['show']=function(_0x364338,_0x71eb35){var _0x3dd83c={'raw':!![],'where':{'id':_0x364338['params']['id']}},_0x41b3b5={};_0x41b3b5[_0x2010('0x30')]=_['keys'](db['VoiceMail']['rawAttributes']);_0x41b3b5[_0x2010('0x32')]=_[_0x2010('0x44')](_0x364338[_0x2010('0x32')]);_0x41b3b5[_0x2010('0x33')]=_[_0x2010('0x34')](_0x41b3b5[_0x2010('0x30')],_0x41b3b5['query']);_0x3dd83c[_0x2010('0x35')]=_[_0x2010('0x34')](_0x41b3b5[_0x2010('0x30')],qs['fields'](_0x364338['query'][_0x2010('0x36')]));_0x3dd83c['attributes']=_0x3dd83c[_0x2010('0x35')][_0x2010('0x37')]?_0x3dd83c[_0x2010('0x35')]:_0x41b3b5[_0x2010('0x30')];if(_0x364338['query'][_0x2010('0x41')]){_0x3dd83c[_0x2010('0x45')]=[{'all':!![]}];}_0x3dd83c=_[_0x2010('0x3e')]({},_0x3dd83c,_0x364338[_0x2010('0x40')]);return db[_0x2010('0x2c')][_0x2010('0x46')](_0x3dd83c)['then'](handleEntityNotFound(_0x71eb35,null))[_0x2010('0x26')](respondWithResult(_0x71eb35,null))[_0x2010('0x43')](handleError(_0x71eb35,null));};exports[_0x2010('0x47')]=function(_0x4dc0cf,_0x30e5d0){return db[_0x2010('0x2c')]['create'](_0x4dc0cf[_0x2010('0x48')],{})[_0x2010('0x26')](function(_0x110791){var _0x242274=_0x4dc0cf[_0x2010('0x49')][_0x2010('0x23')]({'plain':!![]});if(!_0x242274)throw new Error(_0x2010('0x4a'));if(_0x242274[_0x2010('0x4b')]==='user'){var _0x5258b9=_0x110791[_0x2010('0x23')]({'plain':!![]});var _0xe1721f='Voicemails';return db[_0x2010('0x4c')][_0x2010('0x46')]({'where':{'name':_0xe1721f,'userProfileId':_0x242274[_0x2010('0x4d')]},'raw':!![]})[_0x2010('0x26')](function(_0x1f1a59){if(_0x1f1a59&&_0x1f1a59['autoAssociation']===0x0){return db['UserProfileResource'][_0x2010('0x47')]({'name':_0x5258b9[_0x2010('0x29')],'resourceId':_0x5258b9['id'],'type':_0x1f1a59[_0x2010('0x29')],'sectionId':_0x1f1a59['id']},{})[_0x2010('0x26')](function(){return _0x110791;});}else{return _0x110791;}})[_0x2010('0x43')](function(_0x2d8164){logger[_0x2010('0x4e')](_0x2010('0x4f'),_0x2d8164);throw _0x2d8164;});}return _0x110791;})[_0x2010('0x26')](respondWithResult(_0x30e5d0,0xc9))[_0x2010('0x43')](handleError(_0x30e5d0,null));};exports[_0x2010('0x50')]=function(_0x5313b5,_0x24421a){if(_0x5313b5[_0x2010('0x48')]['id']){delete _0x5313b5['body']['id'];}return db[_0x2010('0x2c')][_0x2010('0x46')]({'where':{'id':_0x5313b5[_0x2010('0x51')]['id']}})[_0x2010('0x26')](handleEntityNotFound(_0x24421a,null))[_0x2010('0x26')](saveUpdates(_0x5313b5[_0x2010('0x48')],null))[_0x2010('0x26')](respondWithResult(_0x24421a,null))[_0x2010('0x43')](handleError(_0x24421a,null));};exports[_0x2010('0x25')]=function(_0x2dbc2c,_0x1c0b2d){return db[_0x2010('0x2c')][_0x2010('0x46')]({'where':{'id':_0x2dbc2c[_0x2010('0x51')]['id']}})[_0x2010('0x26')](handleEntityNotFound(_0x1c0b2d,null))[_0x2010('0x26')](removeEntity(_0x1c0b2d,null))[_0x2010('0x43')](handleError(_0x1c0b2d,null));};exports[_0x2010('0x52')]=function(_0x2d7765,_0x6f8565,_0x21ee87){return db[_0x2010('0x2c')][_0x2010('0x53')]({'where':{'id':_0x2d7765['params']['id']}})[_0x2010('0x26')](handleEntityNotFound(_0x6f8565,null))['then'](function(_0x5253d5){var _0x1225d7;var _0x13f33d={},_0x4fb5d5={};_0x4fb5d5[_0x2010('0x30')]=_[_0x2010('0x44')](db[_0x2010('0x54')][_0x2010('0x2d')]);_0x4fb5d5['query']=_[_0x2010('0x44')](_0x2d7765[_0x2010('0x32')]);_0x4fb5d5[_0x2010('0x33')]=_[_0x2010('0x34')](_0x4fb5d5['model'],_0x4fb5d5[_0x2010('0x32')]);_0x13f33d['attributes']=_[_0x2010('0x34')](_0x4fb5d5[_0x2010('0x30')],qs[_0x2010('0x36')](_0x2d7765[_0x2010('0x32')]['fields']));_0x13f33d['attributes']=_0x13f33d[_0x2010('0x35')][_0x2010('0x37')]?_0x13f33d['attributes']:_0x4fb5d5['model'];if(!_0x2d7765[_0x2010('0x32')][_0x2010('0x38')](_0x2010('0x39'))){_0x13f33d[_0x2010('0x1d')]=qs['limit'](_0x2d7765[_0x2010('0x32')]['limit']);_0x13f33d[_0x2010('0x1b')]=qs[_0x2010('0x1b')](_0x2d7765[_0x2010('0x32')][_0x2010('0x1b')]);}_0x13f33d['order']=qs[_0x2010('0x3a')](_0x2d7765[_0x2010('0x32')]['sort']);_0x13f33d[_0x2010('0x3b')]=qs[_0x2010('0x33')](_[_0x2010('0x3c')](_0x2d7765[_0x2010('0x32')],_0x4fb5d5[_0x2010('0x33')]));if(_0x2d7765[_0x2010('0x32')][_0x2010('0x3d')]){_0x13f33d[_0x2010('0x3b')]=_[_0x2010('0x3e')](_0x13f33d[_0x2010('0x3b')],{'$or':_[_0x2010('0x31')](_0x13f33d[_0x2010('0x35')],function(_0x4ebdca){var _0x3ca7b3={};_0x3ca7b3[_0x4ebdca]={'$like':'%'+_0x2d7765[_0x2010('0x32')][_0x2010('0x3d')]+'%'};return _0x3ca7b3;})});}_0x13f33d['where']=_['merge'](_0x13f33d[_0x2010('0x3b')],{'mailboxuser':_0x5253d5[_0x2010('0x55')]});_0x13f33d=_[_0x2010('0x3e')]({},_0x13f33d,_0x2d7765[_0x2010('0x40')]);return db[_0x2010('0x54')][_0x2010('0x56')](_0x13f33d)['then'](respondWithFilteredResult(_0x6f8565,_0x13f33d));})[_0x2010('0x43')](handleError(_0x6f8565,null));}; \ No newline at end of file +var _0xb574=['filter','merge','VoiceMail','includeAll','findAll','rows','catch','show','params','intersection','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','body','length','pick','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x238830,_0x545f75){var _0x5917f0=function(_0x12f821){while(--_0x12f821){_0x238830['push'](_0x238830['shift']());}};_0x5917f0(++_0x545f75);}(_0xb574,0x106));var _0x4b57=function(_0xb2fd45,_0x56de72){_0xb2fd45=_0xb2fd45-0x0;var _0x3ed913=_0xb574[_0xb2fd45];return _0x3ed913;};'use strict';var emlformat=require(_0x4b57('0x0'));var rimraf=require(_0x4b57('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b57('0x2'));var rp=require(_0x4b57('0x3'));var moment=require('moment');var BPromise=require(_0x4b57('0x4'));var Mustache=require(_0x4b57('0x5'));var util=require(_0x4b57('0x6'));var path=require(_0x4b57('0x7'));var sox=require(_0x4b57('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b57('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4b57('0xa'));var toCsv=require(_0x4b57('0xb'));var querystring=require(_0x4b57('0xc'));var Papa=require(_0x4b57('0xd'));var Redis=require(_0x4b57('0xe'));var authService=require(_0x4b57('0xf'));var qs=require(_0x4b57('0x10'));var as=require(_0x4b57('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b57('0x12'))(_0x4b57('0x13'));var utils=require(_0x4b57('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b57('0x15'))['db'];function respondWithStatusCode(_0x357c8b,_0x43d066){_0x43d066=_0x43d066||0xcc;return function(_0xf8a6fc){if(_0xf8a6fc){return _0x357c8b[_0x4b57('0x16')](_0x43d066);}return _0x357c8b[_0x4b57('0x17')](_0x43d066)[_0x4b57('0x18')]();};}function respondWithResult(_0xd5ee6d,_0x31cced){_0x31cced=_0x31cced||0xc8;return function(_0x4e15be){if(_0x4e15be){return _0xd5ee6d['status'](_0x31cced)[_0x4b57('0x19')](_0x4e15be);}};}function respondWithFilteredResult(_0x24f776,_0x10b9ff){return function(_0x58d6bd){if(_0x58d6bd){var _0x284640=typeof _0x10b9ff['offset']===_0x4b57('0x1a')&&typeof _0x10b9ff[_0x4b57('0x1b')]===_0x4b57('0x1a');var _0x10eda5=_0x58d6bd[_0x4b57('0x1c')];var _0xfb71cc=_0x284640?0x0:_0x10b9ff['offset'];var _0x1b35ff=_0x284640?_0x58d6bd[_0x4b57('0x1c')]:_0x10b9ff[_0x4b57('0x1d')]+_0x10b9ff[_0x4b57('0x1b')];var _0x4baaeb;if(_0x1b35ff>=_0x10eda5){_0x1b35ff=_0x10eda5;_0x4baaeb=0xc8;}else{_0x4baaeb=0xce;}_0x24f776[_0x4b57('0x17')](_0x4baaeb);return _0x24f776[_0x4b57('0x1e')](_0x4b57('0x1f'),_0xfb71cc+'-'+_0x1b35ff+'/'+_0x10eda5)[_0x4b57('0x19')](_0x58d6bd);}return null;};}function patchUpdates(_0xef1eae){return function(_0x4454c8){try{jsonpatch['apply'](_0x4454c8,_0xef1eae,!![]);}catch(_0x4b504b){return BPromise[_0x4b57('0x20')](_0x4b504b);}return _0x4454c8[_0x4b57('0x21')]();};}function saveUpdates(_0x567d8f,_0x380554){return function(_0x4a34b2){if(_0x4a34b2){return _0x4a34b2[_0x4b57('0x22')](_0x567d8f)[_0x4b57('0x23')](function(_0x56f017){return _0x56f017;});}return null;};}function removeEntity(_0x271361,_0x368c5f){return function(_0x4d07c9){if(_0x4d07c9){return _0x4d07c9[_0x4b57('0x24')]()[_0x4b57('0x23')](function(){var _0x25d190=_0x4d07c9[_0x4b57('0x25')]({'plain':!![]});var _0x540eff=_0x4b57('0x26');return db['UserProfileResource'][_0x4b57('0x24')]({'where':{'type':_0x540eff,'resourceId':_0x25d190['id']}})['then'](function(){return _0x4d07c9;});})[_0x4b57('0x23')](function(){_0x271361[_0x4b57('0x17')](0xcc)[_0x4b57('0x18')]();});}};}function handleEntityNotFound(_0x6584c4,_0x104f52){return function(_0x392e37){if(!_0x392e37){_0x6584c4['sendStatus'](0x194);}return _0x392e37;};}function handleError(_0x5c3c7a,_0x16d196){_0x16d196=_0x16d196||0x1f4;return function(_0x4c58e4){logger[_0x4b57('0x27')](_0x4c58e4[_0x4b57('0x28')]);if(_0x4c58e4[_0x4b57('0x29')]){delete _0x4c58e4[_0x4b57('0x29')];}_0x5c3c7a[_0x4b57('0x17')](_0x16d196)[_0x4b57('0x2a')](_0x4c58e4);};}exports['index']=function(_0xab365c,_0x2e9922){var _0x68be27={},_0x3cd331={},_0x4ccf89={'count':0x0,'rows':[]};var _0xa91ba=_[_0x4b57('0x2b')](db['VoiceMail'][_0x4b57('0x2c')],function(_0xa5b5dc){return{'name':_0xa5b5dc[_0x4b57('0x2d')],'type':_0xa5b5dc[_0x4b57('0x2e')]['key']};});_0x3cd331['model']=_['map'](_0xa91ba,_0x4b57('0x29'));_0x3cd331[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0xab365c[_0x4b57('0x2f')]);_0x3cd331[_0x4b57('0x31')]=_['intersection'](_0x3cd331[_0x4b57('0x32')],_0x3cd331[_0x4b57('0x2f')]);_0x68be27[_0x4b57('0x33')]=_['intersection'](_0x3cd331[_0x4b57('0x32')],qs[_0x4b57('0x34')](_0xab365c[_0x4b57('0x2f')]['fields']));_0x68be27[_0x4b57('0x33')]=_0x68be27[_0x4b57('0x33')]['length']?_0x68be27[_0x4b57('0x33')]:_0x3cd331[_0x4b57('0x32')];if(!_0xab365c[_0x4b57('0x2f')][_0x4b57('0x35')](_0x4b57('0x36'))){_0x68be27[_0x4b57('0x1b')]=qs['limit'](_0xab365c[_0x4b57('0x2f')][_0x4b57('0x1b')]);_0x68be27[_0x4b57('0x1d')]=qs[_0x4b57('0x1d')](_0xab365c[_0x4b57('0x2f')][_0x4b57('0x1d')]);}_0x68be27[_0x4b57('0x37')]=qs['sort'](_0xab365c['query'][_0x4b57('0x38')]);_0x68be27[_0x4b57('0x39')]=qs[_0x4b57('0x31')](_['pick'](_0xab365c[_0x4b57('0x2f')],_0x3cd331[_0x4b57('0x31')]),_0xa91ba);if(_0xab365c[_0x4b57('0x2f')][_0x4b57('0x3a')]){_0x68be27['where']=_[_0x4b57('0x3b')](_0x68be27[_0x4b57('0x39')],{'$or':_[_0x4b57('0x2b')](_0xa91ba,function(_0x2d24ab){if(_0x2d24ab['type']!=='VIRTUAL'){var _0x5d624c={};_0x5d624c[_0x2d24ab[_0x4b57('0x29')]]={'$like':'%'+_0xab365c[_0x4b57('0x2f')][_0x4b57('0x3a')]+'%'};return _0x5d624c;}})});}_0x68be27=_[_0x4b57('0x3b')]({},_0x68be27,_0xab365c['options']);var _0x445353={'where':_0x68be27[_0x4b57('0x39')]};return db[_0x4b57('0x3c')][_0x4b57('0x1c')](_0x445353)[_0x4b57('0x23')](function(_0x453129){_0x4ccf89[_0x4b57('0x1c')]=_0x453129;if(_0xab365c[_0x4b57('0x2f')][_0x4b57('0x3d')]){_0x68be27['include']=[{'all':!![]}];}return db[_0x4b57('0x3c')][_0x4b57('0x3e')](_0x68be27);})[_0x4b57('0x23')](function(_0x5b2f50){_0x4ccf89[_0x4b57('0x3f')]=_0x5b2f50;return _0x4ccf89;})['then'](respondWithFilteredResult(_0x2e9922,_0x68be27))[_0x4b57('0x40')](handleError(_0x2e9922,null));};exports[_0x4b57('0x41')]=function(_0x457273,_0x19ba66){var _0x189fd0={'raw':!![],'where':{'id':_0x457273[_0x4b57('0x42')]['id']}},_0x477352={};_0x477352[_0x4b57('0x32')]=_[_0x4b57('0x30')](db[_0x4b57('0x3c')][_0x4b57('0x2c')]);_0x477352[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0x457273['query']);_0x477352['filters']=_[_0x4b57('0x43')](_0x477352[_0x4b57('0x32')],_0x477352[_0x4b57('0x2f')]);_0x189fd0[_0x4b57('0x33')]=_['intersection'](_0x477352[_0x4b57('0x32')],qs[_0x4b57('0x34')](_0x457273['query'][_0x4b57('0x34')]));_0x189fd0['attributes']=_0x189fd0[_0x4b57('0x33')]['length']?_0x189fd0['attributes']:_0x477352[_0x4b57('0x32')];if(_0x457273[_0x4b57('0x2f')]['includeAll']){_0x189fd0[_0x4b57('0x44')]=[{'all':!![]}];}_0x189fd0=_[_0x4b57('0x3b')]({},_0x189fd0,_0x457273[_0x4b57('0x45')]);return db[_0x4b57('0x3c')][_0x4b57('0x46')](_0x189fd0)[_0x4b57('0x23')](handleEntityNotFound(_0x19ba66,null))['then'](respondWithResult(_0x19ba66,null))[_0x4b57('0x40')](handleError(_0x19ba66,null));};exports[_0x4b57('0x47')]=function(_0x4a632c,_0xd529fb){return db[_0x4b57('0x3c')][_0x4b57('0x47')](_0x4a632c['body'],{})[_0x4b57('0x23')](function(_0x5cba5f){var _0x213dca=_0x4a632c[_0x4b57('0x48')][_0x4b57('0x25')]({'plain':!![]});if(!_0x213dca)throw new Error(_0x4b57('0x49'));if(_0x213dca[_0x4b57('0x4a')]===_0x4b57('0x48')){var _0x3d1ecd=_0x5cba5f[_0x4b57('0x25')]({'plain':!![]});var _0x5ab120=_0x4b57('0x26');return db[_0x4b57('0x4b')][_0x4b57('0x46')]({'where':{'name':_0x5ab120,'userProfileId':_0x213dca['userProfileId']},'raw':!![]})[_0x4b57('0x23')](function(_0xcf72b6){if(_0xcf72b6&&_0xcf72b6[_0x4b57('0x4c')]===0x0){return db['UserProfileResource'][_0x4b57('0x47')]({'name':_0x3d1ecd[_0x4b57('0x29')],'resourceId':_0x3d1ecd['id'],'type':_0xcf72b6[_0x4b57('0x29')],'sectionId':_0xcf72b6['id']},{})[_0x4b57('0x23')](function(){return _0x5cba5f;});}else{return _0x5cba5f;}})[_0x4b57('0x40')](function(_0xb7c37c){logger[_0x4b57('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb7c37c);throw _0xb7c37c;});}return _0x5cba5f;})['then'](respondWithResult(_0xd529fb,0xc9))[_0x4b57('0x40')](handleError(_0xd529fb,null));};exports[_0x4b57('0x22')]=function(_0x3b4cbf,_0x2e64c2){if(_0x3b4cbf['body']['id']){delete _0x3b4cbf[_0x4b57('0x4d')]['id'];}return db[_0x4b57('0x3c')][_0x4b57('0x46')]({'where':{'id':_0x3b4cbf[_0x4b57('0x42')]['id']}})['then'](handleEntityNotFound(_0x2e64c2,null))['then'](saveUpdates(_0x3b4cbf[_0x4b57('0x4d')],null))[_0x4b57('0x23')](respondWithResult(_0x2e64c2,null))['catch'](handleError(_0x2e64c2,null));};exports['destroy']=function(_0x451737,_0x5c1082){return db[_0x4b57('0x3c')][_0x4b57('0x46')]({'where':{'id':_0x451737[_0x4b57('0x42')]['id']}})[_0x4b57('0x23')](handleEntityNotFound(_0x5c1082,null))[_0x4b57('0x23')](removeEntity(_0x5c1082,null))['catch'](handleError(_0x5c1082,null));};exports['getMessages']=function(_0x54ff9d,_0x4c241a,_0x179802){return db[_0x4b57('0x3c')]['findOne']({'where':{'id':_0x54ff9d[_0x4b57('0x42')]['id']}})[_0x4b57('0x23')](handleEntityNotFound(_0x4c241a,null))[_0x4b57('0x23')](function(_0x9ed750){var _0x64b0fd;var _0x1fcc10={},_0xf1bf63={};_0xf1bf63[_0x4b57('0x32')]=_[_0x4b57('0x30')](db['VoiceMailMessage'][_0x4b57('0x2c')]);_0xf1bf63['query']=_[_0x4b57('0x30')](_0x54ff9d[_0x4b57('0x2f')]);_0xf1bf63['filters']=_[_0x4b57('0x43')](_0xf1bf63[_0x4b57('0x32')],_0xf1bf63[_0x4b57('0x2f')]);_0x1fcc10[_0x4b57('0x33')]=_[_0x4b57('0x43')](_0xf1bf63[_0x4b57('0x32')],qs[_0x4b57('0x34')](_0x54ff9d[_0x4b57('0x2f')][_0x4b57('0x34')]));_0x1fcc10[_0x4b57('0x33')]=_0x1fcc10[_0x4b57('0x33')][_0x4b57('0x4e')]?_0x1fcc10['attributes']:_0xf1bf63[_0x4b57('0x32')];if(!_0x54ff9d[_0x4b57('0x2f')]['hasOwnProperty'](_0x4b57('0x36'))){_0x1fcc10['limit']=qs['limit'](_0x54ff9d['query'][_0x4b57('0x1b')]);_0x1fcc10['offset']=qs[_0x4b57('0x1d')](_0x54ff9d[_0x4b57('0x2f')]['offset']);}_0x1fcc10['order']=qs[_0x4b57('0x38')](_0x54ff9d[_0x4b57('0x2f')][_0x4b57('0x38')]);_0x1fcc10['where']=qs[_0x4b57('0x31')](_[_0x4b57('0x4f')](_0x54ff9d['query'],_0xf1bf63[_0x4b57('0x31')]));if(_0x54ff9d[_0x4b57('0x2f')]['filter']){_0x1fcc10[_0x4b57('0x39')]=_[_0x4b57('0x3b')](_0x1fcc10[_0x4b57('0x39')],{'$or':_[_0x4b57('0x2b')](_0x1fcc10[_0x4b57('0x33')],function(_0x5d9dd5){var _0x2112d5={};_0x2112d5[_0x5d9dd5]={'$like':'%'+_0x54ff9d['query']['filter']+'%'};return _0x2112d5;})});}_0x1fcc10[_0x4b57('0x39')]=_[_0x4b57('0x3b')](_0x1fcc10['where'],{'mailboxuser':_0x9ed750['mailbox']});_0x1fcc10=_[_0x4b57('0x3b')]({},_0x1fcc10,_0x54ff9d[_0x4b57('0x45')]);return db['VoiceMailMessage']['findAndCountAll'](_0x1fcc10)['then'](respondWithFilteredResult(_0x4c241a,_0x1fcc10));})[_0x4b57('0x40')](handleError(_0x4c241a,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index eed42dd..dc0d0f9 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 _0x39a6=['../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox_context','context','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x39a6,0x12d));var _0x639a=function(_0x588d64,_0x3a036f){_0x588d64=_0x588d64-0x0;var _0x45e966=_0x39a6[_0x588d64];return _0x45e966;};'use strict';var _=require('lodash');var util=require(_0x639a('0x0'));var logger=require(_0x639a('0x1'))(_0x639a('0x2'));var moment=require(_0x639a('0x3'));var BPromise=require(_0x639a('0x4'));var rp=require(_0x639a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x639a('0x6'));var config=require(_0x639a('0x7'));var attributes=require('./voiceMail.attributes');module[_0x639a('0x8')]=function(_0x14d01b,_0x1fcd78){return _0x14d01b[_0x639a('0x9')](_0x639a('0xa'),attributes,{'tableName':_0x639a('0xb'),'paranoid':![],'indexes':[{'name':_0x639a('0xc'),'fields':['mailbox',_0x639a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x28a2=['request-promise','../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox','context','lodash','util','../../config/logger','api','bluebird'];(function(_0x4492af,_0x47e25d){var _0x216729=function(_0x4964c8){while(--_0x4964c8){_0x4492af['push'](_0x4492af['shift']());}};_0x216729(++_0x47e25d);}(_0x28a2,0x140));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x228a('0x0'));var util=require(_0x228a('0x1'));var logger=require(_0x228a('0x2'))(_0x228a('0x3'));var moment=require('moment');var BPromise=require(_0x228a('0x4'));var rp=require(_0x228a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x228a('0x6'));var attributes=require('./voiceMail.attributes');module[_0x228a('0x7')]=function(_0x50472d,_0x1de446){return _0x50472d[_0x228a('0x8')](_0x228a('0x9'),attributes,{'tableName':_0x228a('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x228a('0xb'),_0x228a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 356d31f..29696c1 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 _0x73a2=['VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug'];(function(_0x4ccb31,_0x15cef9){var _0x4bce35=function(_0x4c9ac4){while(--_0x4c9ac4){_0x4ccb31['push'](_0x4ccb31['shift']());}};_0x4bce35(++_0x15cef9);}(_0x73a2,0x14a));var _0x273a=function(_0x2ce386,_0x5655bd){_0x2ce386=_0x2ce386-0x0;var _0x354404=_0x73a2[_0x2ce386];return _0x354404;};'use strict';var _=require(_0x273a('0x0'));var util=require(_0x273a('0x1'));var moment=require(_0x273a('0x2'));var BPromise=require('bluebird');var rs=require(_0x273a('0x3'));var fs=require('fs');var Redis=require(_0x273a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x273a('0x5'));var logger=require(_0x273a('0x6'))(_0x273a('0x7'));var config=require(_0x273a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x273a('0x9')][_0x273a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f6a3d,_0x11c1a0,_0x25307f){return new BPromise(function(_0x36d1ff,_0x44f6fd){return client[_0x273a('0xb')](_0x3f6a3d,_0x25307f)['then'](function(_0x460441){logger[_0x273a('0xc')]('VoiceMail,\x20%s,\x20%s',_0x11c1a0,_0x273a('0xd'));logger[_0x273a('0xe')](_0x273a('0xf'),_0x11c1a0,_0x273a('0xd'),JSON[_0x273a('0x10')](_0x460441));if(_0x460441[_0x273a('0x11')]){if(_0x460441[_0x273a('0x11')][_0x273a('0x12')]===0x1f4){logger['error'](_0x273a('0x13'),_0x11c1a0,_0x460441[_0x273a('0x11')][_0x273a('0x14')]);return _0x44f6fd(_0x460441[_0x273a('0x11')][_0x273a('0x14')]);}logger[_0x273a('0x11')](_0x273a('0x13'),_0x11c1a0,_0x460441[_0x273a('0x11')]['message']);return _0x36d1ff(_0x460441[_0x273a('0x11')]['message']);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x11c1a0,'request\x20sent');_0x36d1ff(_0x460441[_0x273a('0x15')][_0x273a('0x14')]);}})[_0x273a('0x16')](function(_0x58e8eb){logger[_0x273a('0x11')]('VoiceMail,\x20%s,\x20%s',_0x11c1a0,_0x58e8eb);_0x44f6fd(_0x58e8eb);});});} \ No newline at end of file +var _0xd2dc=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util'];(function(_0x2bfb2b,_0x4e4421){var _0x4cb289=function(_0x56ebef){while(--_0x56ebef){_0x2bfb2b['push'](_0x2bfb2b['shift']());}};_0x4cb289(++_0x4e4421);}(_0xd2dc,0x1c6));var _0xcd2d=function(_0x41c2b8,_0x26c625){_0x41c2b8=_0x41c2b8-0x0;var _0x115aab=_0xd2dc[_0x41c2b8];return _0x115aab;};'use strict';var _=require(_0xcd2d('0x0'));var util=require(_0xcd2d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcd2d('0x2'));var fs=require('fs');var Redis=require(_0xcd2d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcd2d('0x4'))(_0xcd2d('0x5'));var config=require(_0xcd2d('0x6'));var jayson=require(_0xcd2d('0x7'));var client=jayson[_0xcd2d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb3f690,_0x48e9a7,_0x485921){return new BPromise(function(_0x243eae,_0x166108){return client[_0xcd2d('0x9')](_0xb3f690,_0x485921)[_0xcd2d('0xa')](function(_0x2759eb){logger[_0xcd2d('0xb')](_0xcd2d('0xc'),_0x48e9a7,'request\x20sent');logger[_0xcd2d('0xd')](_0xcd2d('0xe'),_0x48e9a7,_0xcd2d('0xf'),JSON['stringify'](_0x2759eb));if(_0x2759eb[_0xcd2d('0x10')]){if(_0x2759eb[_0xcd2d('0x10')]['code']===0x1f4){logger[_0xcd2d('0x10')]('VoiceMail,\x20%s,\x20%s',_0x48e9a7,_0x2759eb[_0xcd2d('0x10')]['message']);return _0x166108(_0x2759eb[_0xcd2d('0x10')]['message']);}logger[_0xcd2d('0x10')](_0xcd2d('0xc'),_0x48e9a7,_0x2759eb[_0xcd2d('0x10')]['message']);return _0x243eae(_0x2759eb[_0xcd2d('0x10')][_0xcd2d('0x11')]);}else{logger[_0xcd2d('0xb')](_0xcd2d('0xc'),_0x48e9a7,_0xcd2d('0xf'));_0x243eae(_0x2759eb['result'][_0xcd2d('0x11')]);}})[_0xcd2d('0x12')](function(_0x55f4d4){logger[_0xcd2d('0x10')]('VoiceMail,\x20%s,\x20%s',_0x48e9a7,_0x55f4d4);_0x166108(_0x55f4d4);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 09ba3fa..a601da4 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 _0x841e=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','/:id','get','/:id/download','download','post','create','update','destroy'];(function(_0x490997,_0x531219){var _0x45f12e=function(_0x4ea4ce){while(--_0x4ea4ce){_0x490997['push'](_0x490997['shift']());}};_0x45f12e(++_0x531219);}(_0x841e,0xdd));var _0xe841=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x841e[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xe841('0x0'));var util=require(_0xe841('0x1'));var path=require(_0xe841('0x2'));var timeout=require(_0xe841('0x3'));var express=require(_0xe841('0x4'));var router=express[_0xe841('0x5')]();var fs_extra=require(_0xe841('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe841('0x7'));var controller=require(_0xe841('0x8'));router['get']('/',auth[_0xe841('0x9')](),controller[_0xe841('0xa')]);router['get'](_0xe841('0xb'),auth[_0xe841('0x9')](),controller['show']);router[_0xe841('0xc')](_0xe841('0xd'),auth[_0xe841('0x9')](),controller[_0xe841('0xe')]);router[_0xe841('0xf')]('/',auth[_0xe841('0x9')](),controller[_0xe841('0x10')]);router['put'](_0xe841('0xb'),auth[_0xe841('0x9')](),controller[_0xe841('0x11')]);router['delete'](_0xe841('0xb'),auth[_0xe841('0x9')](),controller[_0xe841('0x12')]);module[_0xe841('0x13')]=router; \ No newline at end of file +var _0xa9ab=['isAuthenticated','index','get','/:id','download','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa9ab,0x170));var _0xba9a=function(_0x252acb,_0x42f804){_0x252acb=_0x252acb-0x0;var _0x5fb45a=_0xa9ab[_0x252acb];return _0x5fb45a;};'use strict';var multer=require(_0xba9a('0x0'));var util=require(_0xba9a('0x1'));var path=require(_0xba9a('0x2'));var timeout=require(_0xba9a('0x3'));var express=require(_0xba9a('0x4'));var router=express['Router']();var fs_extra=require(_0xba9a('0x5'));var auth=require(_0xba9a('0x6'));var interaction=require(_0xba9a('0x7'));var config=require(_0xba9a('0x8'));var controller=require(_0xba9a('0x9'));router['get']('/',auth[_0xba9a('0xa')](),controller[_0xba9a('0xb')]);router[_0xba9a('0xc')](_0xba9a('0xd'),auth[_0xba9a('0xa')](),controller['show']);router['get']('/:id/download',auth[_0xba9a('0xa')](),controller[_0xba9a('0xe')]);router[_0xba9a('0xf')]('/',auth[_0xba9a('0xa')](),controller[_0xba9a('0x10')]);router[_0xba9a('0x11')]('/:id',auth[_0xba9a('0xa')](),controller['update']);router[_0xba9a('0x12')](_0xba9a('0xd'),auth['isAuthenticated'](),controller[_0xba9a('0x13')]);module[_0xba9a('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 487672e..9e21e73 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 _0x1acd=['INTEGER','STRING','BLOB','literal','sequelize','exports','getDataValue'];(function(_0x2dd9b3,_0x1a705a){var _0x16db12=function(_0x5a6c64){while(--_0x5a6c64){_0x2dd9b3['push'](_0x2dd9b3['shift']());}};_0x16db12(++_0x1a705a);}(_0x1acd,0xc8));var _0xd1ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1acd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd1ac('0x0'));module[_0xd1ac('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x55b5d7){return this[_0xd1ac('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xd1ac('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd1ac('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xd1ac('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xd1ac('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xd1ac('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xd1ac('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xd1ac('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd1ac('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xd1ac('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xd1ac('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xd1ac('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x70f2=['INTEGER','STRING','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue'];(function(_0x30b0ad,_0x21bd56){var _0x5d7957=function(_0x12a418){while(--_0x12a418){_0x30b0ad['push'](_0x30b0ad['shift']());}};_0x5d7957(++_0x21bd56);}(_0x70f2,0xcd));var _0x270f=function(_0x7dbd96,_0x2d72e1){_0x7dbd96=_0x7dbd96-0x0;var _0x2d64b1=_0x70f2[_0x7dbd96];return _0x2d64b1;};'use strict';var Sequelize=require(_0x270f('0x0'));module['exports']={'name':{'type':Sequelize[_0x270f('0x1')],'get':function(_0x213513){return this[_0x270f('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x270f('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x270f('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x270f('0x4')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x270f('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x270f('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x270f('0x4')],'defaultValue':''},'stamp':{'type':_0x270f('0x6'),'defaultValue':Sequelize['literal'](_0x270f('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index c03f139..ac22c38 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 _0x5f8e=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','error','stack','name','index','map','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filters','pick','filter','merge','includeAll','include','findAll','catch','show','keys','options','find','create','body','update','params','destroy','download','recording','ValidationError','VoiceMailMessage\x20not\x20found','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f8e,0xf2));var _0xe5f8=function(_0x3df9dd,_0x26f5cd){_0x3df9dd=_0x3df9dd-0x0;var _0x4f11e4=_0x5f8e[_0x3df9dd];return _0x4f11e4;};'use strict';var emlformat=require(_0xe5f8('0x0'));var rimraf=require(_0xe5f8('0x1'));var zipdir=require(_0xe5f8('0x2'));var jsonpatch=require(_0xe5f8('0x3'));var rp=require(_0xe5f8('0x4'));var moment=require('moment');var BPromise=require(_0xe5f8('0x5'));var Mustache=require(_0xe5f8('0x6'));var util=require(_0xe5f8('0x7'));var path=require(_0xe5f8('0x8'));var sox=require(_0xe5f8('0x9'));var csv=require(_0xe5f8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe5f8('0xb'));var _=require(_0xe5f8('0xc'));var squel=require(_0xe5f8('0xd'));var crypto=require(_0xe5f8('0xe'));var jsforce=require(_0xe5f8('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe5f8('0xa'));var querystring=require(_0xe5f8('0x10'));var Papa=require(_0xe5f8('0x11'));var Redis=require(_0xe5f8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe5f8('0x13'));var as=require(_0xe5f8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5f8('0x15'))(_0xe5f8('0x16'));var utils=require(_0xe5f8('0x17'));var config=require(_0xe5f8('0x18'));var licenseUtil=require(_0xe5f8('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52051d,_0x212c0a){_0x212c0a=_0x212c0a||0xcc;return function(_0x155130){if(_0x155130){return _0x52051d[_0xe5f8('0x1a')](_0x212c0a);}return _0x52051d[_0xe5f8('0x1b')](_0x212c0a)[_0xe5f8('0x1c')]();};}function respondWithResult(_0xaa59f4,_0x1ef72b){_0x1ef72b=_0x1ef72b||0xc8;return function(_0x2f0949){if(_0x2f0949){return _0xaa59f4[_0xe5f8('0x1b')](_0x1ef72b)['json'](_0x2f0949);}};}function respondWithFilteredResult(_0x7082f7,_0x197ebb){return function(_0xa36bdc){if(_0xa36bdc){var _0x5ba5a3=typeof _0x197ebb[_0xe5f8('0x1d')]===_0xe5f8('0x1e')&&typeof _0x197ebb[_0xe5f8('0x1f')]===_0xe5f8('0x1e');var _0x4ac1d1=_0xa36bdc[_0xe5f8('0x20')];var _0x5da220=_0x5ba5a3?0x0:_0x197ebb[_0xe5f8('0x1d')];var _0x3b6529=_0x5ba5a3?_0xa36bdc[_0xe5f8('0x20')]:_0x197ebb[_0xe5f8('0x1d')]+_0x197ebb['limit'];var _0x59f573;if(_0x3b6529>=_0x4ac1d1){_0x3b6529=_0x4ac1d1;_0x59f573=0xc8;}else{_0x59f573=0xce;}_0x7082f7[_0xe5f8('0x1b')](_0x59f573);return _0x7082f7[_0xe5f8('0x21')](_0xe5f8('0x22'),_0x5da220+'-'+_0x3b6529+'/'+_0x4ac1d1)[_0xe5f8('0x23')](_0xa36bdc);}return null;};}function patchUpdates(_0x2425fd){return function(_0x3e0c54){try{jsonpatch['apply'](_0x3e0c54,_0x2425fd,!![]);}catch(_0x1db4fa){return BPromise[_0xe5f8('0x24')](_0x1db4fa);}return _0x3e0c54[_0xe5f8('0x25')]();};}function saveUpdates(_0x29eb05,_0x31d7f3){return function(_0x57a63b){if(_0x57a63b){return _0x57a63b['update'](_0x29eb05)[_0xe5f8('0x26')](function(_0x397484){return _0x397484;});}return null;};}function removeEntity(_0x4970f8,_0x4b3aeb){return function(_0x37bbe0){if(_0x37bbe0){return _0x37bbe0['destroy']()[_0xe5f8('0x26')](function(){_0x4970f8[_0xe5f8('0x1b')](0xcc)[_0xe5f8('0x1c')]();});}};}function handleEntityNotFound(_0x348b31,_0x3c5b9b){return function(_0x4257ad){if(!_0x4257ad){_0x348b31[_0xe5f8('0x1a')](0x194);}return _0x4257ad;};}function handleError(_0x2bf219,_0x1e50ac){_0x1e50ac=_0x1e50ac||0x1f4;return function(_0x45da4e){logger[_0xe5f8('0x27')](_0x45da4e[_0xe5f8('0x28')]);if(_0x45da4e[_0xe5f8('0x29')]){delete _0x45da4e[_0xe5f8('0x29')];}_0x2bf219[_0xe5f8('0x1b')](_0x1e50ac)['send'](_0x45da4e);};}exports[_0xe5f8('0x2a')]=function(_0x597439,_0x33b4b9){var _0x3af190={},_0x5dcf0f={},_0x5c1ff={'count':0x0,'rows':[]};var _0x2f9140=_[_0xe5f8('0x2b')](db[_0xe5f8('0x2c')][_0xe5f8('0x2d')],function(_0x2143c1){return{'name':_0x2143c1['fieldName'],'type':_0x2143c1[_0xe5f8('0x2e')][_0xe5f8('0x2f')]};});_0x5dcf0f[_0xe5f8('0x30')]=_[_0xe5f8('0x31')](_[_0xe5f8('0x2b')](_0x2f9140,_0xe5f8('0x29')),[_0xe5f8('0x29')]);_0x5dcf0f[_0xe5f8('0x32')]=_['keys'](_0x597439[_0xe5f8('0x32')]);_0x5dcf0f['filters']=_[_0xe5f8('0x33')](_0x5dcf0f['model'],_0x5dcf0f[_0xe5f8('0x32')]);_0x3af190[_0xe5f8('0x34')]=_[_0xe5f8('0x33')](_0x5dcf0f[_0xe5f8('0x30')],qs[_0xe5f8('0x35')](_0x597439[_0xe5f8('0x32')][_0xe5f8('0x35')]));_0x3af190[_0xe5f8('0x34')]=_0x3af190[_0xe5f8('0x34')][_0xe5f8('0x36')]?_0x3af190[_0xe5f8('0x34')]:_0x5dcf0f[_0xe5f8('0x30')];if(!_0x597439['query'][_0xe5f8('0x37')](_0xe5f8('0x38'))){_0x3af190['limit']=qs[_0xe5f8('0x1f')](_0x597439[_0xe5f8('0x32')][_0xe5f8('0x1f')]);_0x3af190[_0xe5f8('0x1d')]=qs[_0xe5f8('0x1d')](_0x597439['query'][_0xe5f8('0x1d')]);}_0x3af190['order']=qs['sort'](_0x597439[_0xe5f8('0x32')]['sort']);_0x3af190[_0xe5f8('0x39')]=qs[_0xe5f8('0x3a')](_[_0xe5f8('0x3b')](_0x597439[_0xe5f8('0x32')],_0x5dcf0f['filters']),_0x2f9140);if(_0x597439[_0xe5f8('0x32')]['filter']){_0x3af190[_0xe5f8('0x39')]=_['merge'](_0x3af190[_0xe5f8('0x39')],{'$or':_['map'](_0x2f9140,function(_0x46fe90){if(_0x46fe90['type']!=='VIRTUAL'){var _0x403b7e={};_0x403b7e[_0x46fe90['name']]={'$like':'%'+_0x597439['query'][_0xe5f8('0x3c')]+'%'};return _0x403b7e;}})});}_0x3af190=_[_0xe5f8('0x3d')]({},_0x3af190,_0x597439['options']);var _0x2e02ce={'where':_0x3af190[_0xe5f8('0x39')]};return db[_0xe5f8('0x2c')][_0xe5f8('0x20')](_0x2e02ce)['then'](function(_0x5a9607){_0x5c1ff['count']=_0x5a9607;if(_0x597439[_0xe5f8('0x32')][_0xe5f8('0x3e')]){_0x3af190[_0xe5f8('0x3f')]=[{'all':!![]}];}return db[_0xe5f8('0x2c')][_0xe5f8('0x40')](_0x3af190);})['then'](function(_0x3abf84){_0x5c1ff['rows']=_0x3abf84;return _0x5c1ff;})['then'](respondWithFilteredResult(_0x33b4b9,_0x3af190))[_0xe5f8('0x41')](handleError(_0x33b4b9,null));};exports[_0xe5f8('0x42')]=function(_0x197d5b,_0x22701d){var _0xe7cd26={'raw':!![],'where':{'id':_0x197d5b['params']['id']}},_0x1b99af={};_0x1b99af[_0xe5f8('0x30')]=_[_0xe5f8('0x43')](db['VoiceMailMessage']['rawAttributes']);_0x1b99af[_0xe5f8('0x32')]=_[_0xe5f8('0x43')](_0x197d5b[_0xe5f8('0x32')]);_0x1b99af[_0xe5f8('0x3a')]=_[_0xe5f8('0x33')](_0x1b99af[_0xe5f8('0x30')],_0x1b99af[_0xe5f8('0x32')]);_0xe7cd26[_0xe5f8('0x34')]=_[_0xe5f8('0x33')](_0x1b99af[_0xe5f8('0x30')],qs['fields'](_0x197d5b[_0xe5f8('0x32')][_0xe5f8('0x35')]));_0xe7cd26['attributes']=_0xe7cd26['attributes']['length']?_0xe7cd26['attributes']:_0x1b99af[_0xe5f8('0x30')];if(_0x197d5b['query'][_0xe5f8('0x3e')]){_0xe7cd26[_0xe5f8('0x3f')]=[{'all':!![]}];}_0xe7cd26=_[_0xe5f8('0x3d')]({},_0xe7cd26,_0x197d5b[_0xe5f8('0x44')]);return db['VoiceMailMessage'][_0xe5f8('0x45')](_0xe7cd26)[_0xe5f8('0x26')](handleEntityNotFound(_0x22701d,null))[_0xe5f8('0x26')](respondWithResult(_0x22701d,null))[_0xe5f8('0x41')](handleError(_0x22701d,null));};exports[_0xe5f8('0x46')]=function(_0x408eb7,_0x5de984){return db[_0xe5f8('0x2c')][_0xe5f8('0x46')](_0x408eb7[_0xe5f8('0x47')],{})['then'](respondWithResult(_0x5de984,0xc9))[_0xe5f8('0x41')](handleError(_0x5de984,null));};exports[_0xe5f8('0x48')]=function(_0x1417d1,_0x31b64f){if(_0x1417d1[_0xe5f8('0x47')]['id']){delete _0x1417d1['body']['id'];}return db[_0xe5f8('0x2c')][_0xe5f8('0x45')]({'where':{'id':_0x1417d1[_0xe5f8('0x49')]['id']}})[_0xe5f8('0x26')](handleEntityNotFound(_0x31b64f,null))[_0xe5f8('0x26')](saveUpdates(_0x1417d1[_0xe5f8('0x47')],null))[_0xe5f8('0x26')](respondWithResult(_0x31b64f,null))[_0xe5f8('0x41')](handleError(_0x31b64f,null));};exports[_0xe5f8('0x4a')]=function(_0x4bc57c,_0x1a776b){return db[_0xe5f8('0x2c')][_0xe5f8('0x45')]({'where':{'id':_0x4bc57c[_0xe5f8('0x49')]['id']}})[_0xe5f8('0x26')](handleEntityNotFound(_0x1a776b,null))[_0xe5f8('0x26')](removeEntity(_0x1a776b,null))[_0xe5f8('0x41')](handleError(_0x1a776b,null));};exports[_0xe5f8('0x4b')]=function(_0x32c718,_0x86d7cf,_0x432002){return db[_0xe5f8('0x2c')][_0xe5f8('0x45')]({'where':{'id':_0x32c718[_0xe5f8('0x49')]['id']},'attributes':['id',_0xe5f8('0x4c'),'msg_id']})['then'](handleEntityNotFound(_0x86d7cf,null))[_0xe5f8('0x26')](function(_0x1684f2){if(_0x1684f2){if(!_0x1684f2[_0xe5f8('0x4c')]){throw new db['Sequelize'][(_0xe5f8('0x4d'))](_0xe5f8('0x4e'));}var _0x667c83={'Content-Type':'audio/wav','Content-Disposition':_0xe5f8('0x4f')};if(_0x1684f2[_0xe5f8('0x50')]){_0x667c83[_0xe5f8('0x51')]=_0xe5f8('0x52')+_0x1684f2[_0xe5f8('0x50')]+_0xe5f8('0x53');}_0x86d7cf[_0xe5f8('0x21')](_0x667c83);return _0x86d7cf[_0xe5f8('0x54')](new Buffer(_0x1684f2[_0xe5f8('0x4c')]));}})[_0xe5f8('0x41')](handleError(_0x86d7cf,null));}; \ No newline at end of file +var _0xb0b3=['options','findAll','rows','show','params','keys','includeAll','include','find','catch','body','recording','msg_id','VoiceMailMessage\x20not\x20found','attachment','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','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','sendStatus','limit','count','offset','status','set','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL'];(function(_0x20c488,_0x188c7a){var _0x5a0816=function(_0x1641f3){while(--_0x1641f3){_0x20c488['push'](_0x20c488['shift']());}};_0x5a0816(++_0x188c7a);}(_0xb0b3,0x1b0));var _0x3b0b=function(_0x5d4326,_0xc32283){_0x5d4326=_0x5d4326-0x0;var _0x436c71=_0xb0b3[_0x5d4326];return _0x436c71;};'use strict';var emlformat=require(_0x3b0b('0x0'));var rimraf=require(_0x3b0b('0x1'));var zipdir=require(_0x3b0b('0x2'));var jsonpatch=require(_0x3b0b('0x3'));var rp=require(_0x3b0b('0x4'));var moment=require(_0x3b0b('0x5'));var BPromise=require(_0x3b0b('0x6'));var Mustache=require('mustache');var util=require(_0x3b0b('0x7'));var path=require(_0x3b0b('0x8'));var sox=require(_0x3b0b('0x9'));var csv=require(_0x3b0b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b0b('0xb'));var squel=require(_0x3b0b('0xc'));var crypto=require('crypto');var jsforce=require(_0x3b0b('0xd'));var deskjs=require(_0x3b0b('0xe'));var toCsv=require(_0x3b0b('0xa'));var querystring=require(_0x3b0b('0xf'));var Papa=require(_0x3b0b('0x10'));var Redis=require(_0x3b0b('0x11'));var authService=require(_0x3b0b('0x12'));var qs=require(_0x3b0b('0x13'));var as=require(_0x3b0b('0x14'));var hardwareService=require(_0x3b0b('0x15'));var logger=require(_0x3b0b('0x16'))(_0x3b0b('0x17'));var utils=require(_0x3b0b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3b0b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b305d,_0x519422){_0x519422=_0x519422||0xcc;return function(_0x5ab9da){if(_0x5ab9da){return _0x5b305d[_0x3b0b('0x1a')](_0x519422);}return _0x5b305d['status'](_0x519422)['end']();};}function respondWithResult(_0x50a6f0,_0x16c37c){_0x16c37c=_0x16c37c||0xc8;return function(_0x14259b){if(_0x14259b){return _0x50a6f0['status'](_0x16c37c)['json'](_0x14259b);}};}function respondWithFilteredResult(_0x1ea4fe,_0x12cf91){return function(_0x33a0e4){if(_0x33a0e4){var _0x4a297a=typeof _0x12cf91['offset']==='undefined'&&typeof _0x12cf91[_0x3b0b('0x1b')]==='undefined';var _0x4647f2=_0x33a0e4[_0x3b0b('0x1c')];var _0x2be38a=_0x4a297a?0x0:_0x12cf91[_0x3b0b('0x1d')];var _0x9e8934=_0x4a297a?_0x33a0e4[_0x3b0b('0x1c')]:_0x12cf91[_0x3b0b('0x1d')]+_0x12cf91['limit'];var _0x12c45f;if(_0x9e8934>=_0x4647f2){_0x9e8934=_0x4647f2;_0x12c45f=0xc8;}else{_0x12c45f=0xce;}_0x1ea4fe[_0x3b0b('0x1e')](_0x12c45f);return _0x1ea4fe[_0x3b0b('0x1f')]('Content-Range',_0x2be38a+'-'+_0x9e8934+'/'+_0x4647f2)[_0x3b0b('0x20')](_0x33a0e4);}return null;};}function patchUpdates(_0x2d1f10){return function(_0x37ee84){try{jsonpatch[_0x3b0b('0x21')](_0x37ee84,_0x2d1f10,!![]);}catch(_0x36dc40){return BPromise[_0x3b0b('0x22')](_0x36dc40);}return _0x37ee84[_0x3b0b('0x23')]();};}function saveUpdates(_0x388f69,_0x2816a7){return function(_0x4be10a){if(_0x4be10a){return _0x4be10a[_0x3b0b('0x24')](_0x388f69)[_0x3b0b('0x25')](function(_0x8cb814){return _0x8cb814;});}return null;};}function removeEntity(_0x5c4f09,_0x2de7f2){return function(_0x3ef712){if(_0x3ef712){return _0x3ef712[_0x3b0b('0x26')]()[_0x3b0b('0x25')](function(){_0x5c4f09[_0x3b0b('0x1e')](0xcc)[_0x3b0b('0x27')]();});}};}function handleEntityNotFound(_0x2eed28,_0x313ba6){return function(_0x31e77e){if(!_0x31e77e){_0x2eed28['sendStatus'](0x194);}return _0x31e77e;};}function handleError(_0x3cbcd0,_0x39ab3d){_0x39ab3d=_0x39ab3d||0x1f4;return function(_0x4962e6){logger[_0x3b0b('0x28')](_0x4962e6[_0x3b0b('0x29')]);if(_0x4962e6[_0x3b0b('0x2a')]){delete _0x4962e6[_0x3b0b('0x2a')];}_0x3cbcd0[_0x3b0b('0x1e')](_0x39ab3d)[_0x3b0b('0x2b')](_0x4962e6);};}exports['index']=function(_0x40f27b,_0x46baea){var _0x285e40={},_0x465979={},_0x4cd930={'count':0x0,'rows':[]};var _0x570637=_[_0x3b0b('0x2c')](db[_0x3b0b('0x2d')][_0x3b0b('0x2e')],function(_0x679c20){return{'name':_0x679c20[_0x3b0b('0x2f')],'type':_0x679c20['type'][_0x3b0b('0x30')]};});_0x465979[_0x3b0b('0x31')]=_[_0x3b0b('0x32')](_[_0x3b0b('0x2c')](_0x570637,_0x3b0b('0x2a')),[_0x3b0b('0x2a')]);_0x465979[_0x3b0b('0x33')]=_['keys'](_0x40f27b[_0x3b0b('0x33')]);_0x465979['filters']=_['intersection'](_0x465979['model'],_0x465979['query']);_0x285e40[_0x3b0b('0x34')]=_[_0x3b0b('0x35')](_0x465979[_0x3b0b('0x31')],qs[_0x3b0b('0x36')](_0x40f27b['query']['fields']));_0x285e40[_0x3b0b('0x34')]=_0x285e40[_0x3b0b('0x34')][_0x3b0b('0x37')]?_0x285e40[_0x3b0b('0x34')]:_0x465979[_0x3b0b('0x31')];if(!_0x40f27b[_0x3b0b('0x33')][_0x3b0b('0x38')](_0x3b0b('0x39'))){_0x285e40[_0x3b0b('0x1b')]=qs[_0x3b0b('0x1b')](_0x40f27b[_0x3b0b('0x33')]['limit']);_0x285e40['offset']=qs[_0x3b0b('0x1d')](_0x40f27b['query']['offset']);}_0x285e40[_0x3b0b('0x3a')]=qs[_0x3b0b('0x3b')](_0x40f27b[_0x3b0b('0x33')][_0x3b0b('0x3b')]);_0x285e40[_0x3b0b('0x3c')]=qs[_0x3b0b('0x3d')](_['pick'](_0x40f27b[_0x3b0b('0x33')],_0x465979[_0x3b0b('0x3d')]),_0x570637);if(_0x40f27b['query'][_0x3b0b('0x3e')]){_0x285e40[_0x3b0b('0x3c')]=_[_0x3b0b('0x3f')](_0x285e40['where'],{'$or':_[_0x3b0b('0x2c')](_0x570637,function(_0x1dc67a){if(_0x1dc67a[_0x3b0b('0x40')]!==_0x3b0b('0x41')){var _0x43f84d={};_0x43f84d[_0x1dc67a['name']]={'$like':'%'+_0x40f27b[_0x3b0b('0x33')][_0x3b0b('0x3e')]+'%'};return _0x43f84d;}})});}_0x285e40=_['merge']({},_0x285e40,_0x40f27b[_0x3b0b('0x42')]);var _0x2dccb1={'where':_0x285e40['where']};return db['VoiceMailMessage'][_0x3b0b('0x1c')](_0x2dccb1)[_0x3b0b('0x25')](function(_0x455f6e){_0x4cd930[_0x3b0b('0x1c')]=_0x455f6e;if(_0x40f27b['query']['includeAll']){_0x285e40['include']=[{'all':!![]}];}return db[_0x3b0b('0x2d')][_0x3b0b('0x43')](_0x285e40);})[_0x3b0b('0x25')](function(_0x38f355){_0x4cd930[_0x3b0b('0x44')]=_0x38f355;return _0x4cd930;})[_0x3b0b('0x25')](respondWithFilteredResult(_0x46baea,_0x285e40))['catch'](handleError(_0x46baea,null));};exports[_0x3b0b('0x45')]=function(_0xe98519,_0x17ca5b){var _0xdfb349={'raw':!![],'where':{'id':_0xe98519[_0x3b0b('0x46')]['id']}},_0x14b0af={};_0x14b0af[_0x3b0b('0x31')]=_[_0x3b0b('0x47')](db[_0x3b0b('0x2d')][_0x3b0b('0x2e')]);_0x14b0af[_0x3b0b('0x33')]=_[_0x3b0b('0x47')](_0xe98519[_0x3b0b('0x33')]);_0x14b0af[_0x3b0b('0x3d')]=_[_0x3b0b('0x35')](_0x14b0af[_0x3b0b('0x31')],_0x14b0af[_0x3b0b('0x33')]);_0xdfb349[_0x3b0b('0x34')]=_['intersection'](_0x14b0af[_0x3b0b('0x31')],qs[_0x3b0b('0x36')](_0xe98519[_0x3b0b('0x33')][_0x3b0b('0x36')]));_0xdfb349[_0x3b0b('0x34')]=_0xdfb349[_0x3b0b('0x34')]['length']?_0xdfb349['attributes']:_0x14b0af['model'];if(_0xe98519[_0x3b0b('0x33')][_0x3b0b('0x48')]){_0xdfb349[_0x3b0b('0x49')]=[{'all':!![]}];}_0xdfb349=_['merge']({},_0xdfb349,_0xe98519[_0x3b0b('0x42')]);return db['VoiceMailMessage'][_0x3b0b('0x4a')](_0xdfb349)[_0x3b0b('0x25')](handleEntityNotFound(_0x17ca5b,null))[_0x3b0b('0x25')](respondWithResult(_0x17ca5b,null))[_0x3b0b('0x4b')](handleError(_0x17ca5b,null));};exports['create']=function(_0x495358,_0x62db14){return db['VoiceMailMessage']['create'](_0x495358[_0x3b0b('0x4c')],{})[_0x3b0b('0x25')](respondWithResult(_0x62db14,0xc9))[_0x3b0b('0x4b')](handleError(_0x62db14,null));};exports[_0x3b0b('0x24')]=function(_0x2bbc3e,_0x46ed52){if(_0x2bbc3e[_0x3b0b('0x4c')]['id']){delete _0x2bbc3e[_0x3b0b('0x4c')]['id'];}return db[_0x3b0b('0x2d')][_0x3b0b('0x4a')]({'where':{'id':_0x2bbc3e['params']['id']}})[_0x3b0b('0x25')](handleEntityNotFound(_0x46ed52,null))['then'](saveUpdates(_0x2bbc3e['body'],null))['then'](respondWithResult(_0x46ed52,null))['catch'](handleError(_0x46ed52,null));};exports['destroy']=function(_0x3887ad,_0x4fe499){return db[_0x3b0b('0x2d')][_0x3b0b('0x4a')]({'where':{'id':_0x3887ad[_0x3b0b('0x46')]['id']}})[_0x3b0b('0x25')](handleEntityNotFound(_0x4fe499,null))['then'](removeEntity(_0x4fe499,null))[_0x3b0b('0x4b')](handleError(_0x4fe499,null));};exports['download']=function(_0x456d1a,_0x357d1c,_0x4949c9){return db[_0x3b0b('0x2d')][_0x3b0b('0x4a')]({'where':{'id':_0x456d1a[_0x3b0b('0x46')]['id']},'attributes':['id',_0x3b0b('0x4d'),_0x3b0b('0x4e')]})['then'](handleEntityNotFound(_0x357d1c,null))[_0x3b0b('0x25')](function(_0x2fa70b){if(_0x2fa70b){if(!_0x2fa70b['recording']){throw new db['Sequelize']['ValidationError'](_0x3b0b('0x4f'));}var _0x51db0c={'Content-Type':'audio/wav','Content-Disposition':_0x3b0b('0x50')};if(_0x2fa70b['msg_id']){_0x51db0c['Content-Disposition']=_0x3b0b('0x51')+_0x2fa70b[_0x3b0b('0x4e')]+_0x3b0b('0x52');}_0x357d1c['set'](_0x51db0c);return _0x357d1c[_0x3b0b('0x2b')](new Buffer(_0x2fa70b[_0x3b0b('0x4d')]));}})[_0x3b0b('0x4b')](handleError(_0x357d1c,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index ab0723a..0801534 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 _0x2070=['../../config/environment','./voiceMailMessage.attributes','define','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x2070,0xf5));var _0x0207=function(_0x480e2e,_0x3224d1){_0x480e2e=_0x480e2e-0x0;var _0x3dc518=_0x2070[_0x480e2e];return _0x3dc518;};'use strict';var _=require(_0x0207('0x0'));var util=require(_0x0207('0x1'));var logger=require(_0x0207('0x2'))(_0x0207('0x3'));var moment=require('moment');var BPromise=require(_0x0207('0x4'));var rp=require(_0x0207('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0207('0x6'));var config=require(_0x0207('0x7'));var attributes=require(_0x0207('0x8'));module['exports']=function(_0x265e49,_0x1860a7){return _0x265e49[_0x0207('0x9')]('VoiceMailMessage',attributes,{'tableName':_0x0207('0xa'),'paranoid':![],'indexes':[{'name':_0x0207('0xb'),'fields':[_0x0207('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xf61c=['exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','api','moment','path','rimraf','../../config/environment','./voiceMailMessage.attributes'];(function(_0x2dc577,_0x4eb9d4){var _0x2dbdd6=function(_0x5425d7){while(--_0x5425d7){_0x2dc577['push'](_0x2dc577['shift']());}};_0x2dbdd6(++_0x4eb9d4);}(_0xf61c,0x89));var _0xcf61=function(_0x38961f,_0x418c50){_0x38961f=_0x38961f-0x0;var _0x2396d8=_0xf61c[_0x38961f];return _0x2396d8;};'use strict';var _=require(_0xcf61('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcf61('0x1'));var moment=require(_0xcf61('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf61('0x3'));var rimraf=require(_0xcf61('0x4'));var config=require(_0xcf61('0x5'));var attributes=require(_0xcf61('0x6'));module[_0xcf61('0x7')]=function(_0x39479e,_0x1cdbb4){return _0x39479e[_0xcf61('0x8')](_0xcf61('0x9'),attributes,{'tableName':_0xcf61('0xa'),'paranoid':![],'indexes':[{'name':_0xcf61('0xb'),'fields':[_0xcf61('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index cba7f15..a38206b 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 _0xe996=['http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x2e4869,_0x492d28){var _0x3b3483=function(_0x1e1d7c){while(--_0x1e1d7c){_0x2e4869['push'](_0x2e4869['shift']());}};_0x3b3483(++_0x492d28);}(_0xe996,0x173));var _0x6e99=function(_0x448e72,_0x46f762){_0x448e72=_0x448e72-0x0;var _0x51adde=_0xe996[_0x448e72];return _0x51adde;};'use strict';var _=require(_0x6e99('0x0'));var util=require(_0x6e99('0x1'));var moment=require(_0x6e99('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e99('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e99('0x4'))['db'];var utils=require(_0x6e99('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6e99('0x6'));var jayson=require(_0x6e99('0x7'));var client=jayson[_0x6e99('0x8')][_0x6e99('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17cff6,_0x50dc4,_0x12f443){return new BPromise(function(_0x495e9a,_0x39590e){return client[_0x6e99('0xa')](_0x17cff6,_0x12f443)['then'](function(_0x176ee7){logger[_0x6e99('0xb')](_0x6e99('0xc'),_0x50dc4,_0x6e99('0xd'));logger['debug'](_0x6e99('0xe'),_0x50dc4,'request\x20sent',JSON[_0x6e99('0xf')](_0x176ee7));if(_0x176ee7['error']){if(_0x176ee7[_0x6e99('0x10')][_0x6e99('0x11')]===0x1f4){logger[_0x6e99('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x50dc4,_0x176ee7[_0x6e99('0x10')][_0x6e99('0x12')]);return _0x39590e(_0x176ee7[_0x6e99('0x10')][_0x6e99('0x12')]);}logger[_0x6e99('0x10')](_0x6e99('0xc'),_0x50dc4,_0x176ee7[_0x6e99('0x10')][_0x6e99('0x12')]);return _0x495e9a(_0x176ee7['error'][_0x6e99('0x12')]);}else{logger[_0x6e99('0xb')](_0x6e99('0xc'),_0x50dc4,_0x6e99('0xd'));_0x495e9a(_0x176ee7['result'][_0x6e99('0x12')]);}})[_0x6e99('0x13')](function(_0x4218df){logger[_0x6e99('0x10')](_0x6e99('0xc'),_0x50dc4,_0x4218df);_0x39590e(_0x4218df);});});} \ No newline at end of file +var _0x0d20=['request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\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','info'];(function(_0xd291dd,_0xab3624){var _0x3a4b16=function(_0x3c425a){while(--_0x3c425a){_0xd291dd['push'](_0xd291dd['shift']());}};_0x3a4b16(++_0xab3624);}(_0x0d20,0x1a1));var _0x00d2=function(_0x368c56,_0x1b7db9){_0x368c56=_0x368c56-0x0;var _0x4de7cc=_0x0d20[_0x368c56];return _0x4de7cc;};'use strict';var _=require(_0x00d2('0x0'));var util=require(_0x00d2('0x1'));var moment=require(_0x00d2('0x2'));var BPromise=require(_0x00d2('0x3'));var rs=require(_0x00d2('0x4'));var fs=require('fs');var Redis=require(_0x00d2('0x5'));var db=require(_0x00d2('0x6'))['db'];var utils=require(_0x00d2('0x7'));var logger=require(_0x00d2('0x8'))(_0x00d2('0x9'));var config=require(_0x00d2('0xa'));var jayson=require(_0x00d2('0xb'));var client=jayson[_0x00d2('0xc')][_0x00d2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1b0428,_0x5ef453,_0xa1f524){return new BPromise(function(_0xb7ded8,_0x4850cd){return client['request'](_0x1b0428,_0xa1f524)['then'](function(_0x3746a8){logger[_0x00d2('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x5ef453,_0x00d2('0xf'));logger['debug'](_0x00d2('0x10'),_0x5ef453,'request\x20sent',JSON[_0x00d2('0x11')](_0x3746a8));if(_0x3746a8['error']){if(_0x3746a8[_0x00d2('0x12')][_0x00d2('0x13')]===0x1f4){logger[_0x00d2('0x12')](_0x00d2('0x14'),_0x5ef453,_0x3746a8[_0x00d2('0x12')][_0x00d2('0x15')]);return _0x4850cd(_0x3746a8[_0x00d2('0x12')][_0x00d2('0x15')]);}logger[_0x00d2('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x5ef453,_0x3746a8[_0x00d2('0x12')][_0x00d2('0x15')]);return _0xb7ded8(_0x3746a8[_0x00d2('0x12')][_0x00d2('0x15')]);}else{logger['info'](_0x00d2('0x14'),_0x5ef453,_0x00d2('0xf'));_0xb7ded8(_0x3746a8[_0x00d2('0x16')]['message']);}})[_0x00d2('0x17')](function(_0x2eb8e4){logger[_0x00d2('0x12')](_0x00d2('0x14'),_0x5ef453,_0x2eb8e4);_0x4850cd(_0x2eb8e4);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 2231ff5..35ceedb 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 _0xac76=['index','/:id','show','getSounds','post','create','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated'];(function(_0x5817e6,_0x44a2d0){var _0x51916a=function(_0x1a56e3){while(--_0x1a56e3){_0x5817e6['push'](_0x5817e6['shift']());}};_0x51916a(++_0x44a2d0);}(_0xac76,0x1bd));var _0x6ac7=function(_0xa4f529,_0x36add4){_0xa4f529=_0xa4f529-0x0;var _0x3ce0df=_0xac76[_0xa4f529];return _0x3ce0df;};'use strict';var multer=require(_0x6ac7('0x0'));var util=require(_0x6ac7('0x1'));var path=require(_0x6ac7('0x2'));var timeout=require(_0x6ac7('0x3'));var express=require(_0x6ac7('0x4'));var router=express[_0x6ac7('0x5')]();var fs_extra=require(_0x6ac7('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6ac7('0x7'));var controller=require(_0x6ac7('0x8'));router[_0x6ac7('0x9')]('/',auth[_0x6ac7('0xa')](),controller[_0x6ac7('0xb')]);router[_0x6ac7('0x9')](_0x6ac7('0xc'),auth['isAuthenticated'](),controller[_0x6ac7('0xd')]);router[_0x6ac7('0x9')]('/:id/sounds',auth[_0x6ac7('0xa')](),controller[_0x6ac7('0xe')]);router[_0x6ac7('0xf')]('/',auth[_0x6ac7('0xa')](),controller[_0x6ac7('0x10')]);router['post']('/:id/sounds',auth['isAuthenticated'](),controller[_0x6ac7('0x11')]);router[_0x6ac7('0x12')](_0x6ac7('0xc'),auth['isAuthenticated'](),controller[_0x6ac7('0x13')]);router[_0x6ac7('0x14')](_0x6ac7('0xc'),auth[_0x6ac7('0xa')](),controller[_0x6ac7('0x15')]);router['delete'](_0x6ac7('0x16'),auth['isAuthenticated'](),controller[_0x6ac7('0x17')]);module['exports']=router; \ No newline at end of file +var _0x2928=['/:id','update','delete','destroy','/:id/sounds/:id2','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','getSounds','post','/:id/sounds','addSound','put'];(function(_0x112d79,_0x2a1ab3){var _0x25f72d=function(_0x1cd0bd){while(--_0x1cd0bd){_0x112d79['push'](_0x112d79['shift']());}};_0x25f72d(++_0x2a1ab3);}(_0x2928,0x90));var _0x8292=function(_0x14fad0,_0x278d75){_0x14fad0=_0x14fad0-0x0;var _0x5c665f=_0x2928[_0x14fad0];return _0x5c665f;};'use strict';var multer=require('multer');var util=require(_0x8292('0x0'));var path=require(_0x8292('0x1'));var timeout=require(_0x8292('0x2'));var express=require('express');var router=express[_0x8292('0x3')]();var fs_extra=require(_0x8292('0x4'));var auth=require(_0x8292('0x5'));var interaction=require(_0x8292('0x6'));var config=require('../../config/environment');var controller=require(_0x8292('0x7'));router[_0x8292('0x8')]('/',auth[_0x8292('0x9')](),controller[_0x8292('0xa')]);router[_0x8292('0x8')]('/:id',auth[_0x8292('0x9')](),controller[_0x8292('0xb')]);router[_0x8292('0x8')]('/:id/sounds',auth[_0x8292('0x9')](),controller[_0x8292('0xc')]);router[_0x8292('0xd')]('/',auth[_0x8292('0x9')](),controller['create']);router[_0x8292('0xd')](_0x8292('0xe'),auth[_0x8292('0x9')](),controller[_0x8292('0xf')]);router[_0x8292('0x10')](_0x8292('0x11'),auth['isAuthenticated'](),controller[_0x8292('0x12')]);router[_0x8292('0x13')](_0x8292('0x11'),auth[_0x8292('0x9')](),controller[_0x8292('0x14')]);router[_0x8292('0x13')](_0x8292('0x15'),auth['isAuthenticated'](),controller['removeSound']);module[_0x8292('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 498b1d4..934ae56 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 _0xa03b=['BOOLEAN','sequelize','exports','STRING','name','ENUM','files','quietmp3','mp3','alpha','TIMESTAMP'];(function(_0x5929f6,_0x4b56bc){var _0x4cda66=function(_0xa399f2){while(--_0xa399f2){_0x5929f6['push'](_0x5929f6['shift']());}};_0x4cda66(++_0x4b56bc);}(_0xa03b,0x1e5));var _0xba03=function(_0x3cc05d,_0x4b8f88){_0x3cc05d=_0x3cc05d-0x0;var _0x28b736=_0xa03b[_0x3cc05d];return _0x28b736;};'use strict';var Sequelize=require(_0xba03('0x0'));module[_0xba03('0x1')]={'name':{'type':Sequelize[_0xba03('0x2')],'allowNull':![],'unique':_0xba03('0x3')},'mode':{'type':Sequelize[_0xba03('0x4')]('custom',_0xba03('0x5'),'mp3nb','quietmp3nb',_0xba03('0x6'),_0xba03('0x7')),'allowNull':!![],'defaultValue':_0xba03('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xba03('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xba03('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xba03('0x2')],'allowNull':!![],'defaultValue':_0xba03('0x8')},'format':{'type':Sequelize[_0xba03('0x2')],'allowNull':!![]},'stamp':{'type':_0xba03('0x9')},'defaultEntry':{'type':Sequelize[_0xba03('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0xab0c=['BOOLEAN','sequelize','exports','name','custom','files','quietmp3','STRING','alpha','TIMESTAMP'];(function(_0x513557,_0x25a592){var _0x159c8d=function(_0x26349c){while(--_0x26349c){_0x513557['push'](_0x513557['shift']());}};_0x159c8d(++_0x25a592);}(_0xab0c,0x83));var _0xcab0=function(_0x21ed43,_0x2bd296){_0x21ed43=_0x21ed43-0x0;var _0x2017fd=_0xab0c[_0x21ed43];return _0x2017fd;};'use strict';var Sequelize=require(_0xcab0('0x0'));module[_0xcab0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcab0('0x2')},'mode':{'type':Sequelize['ENUM'](_0xcab0('0x3'),_0xcab0('0x4'),'mp3nb','quietmp3nb',_0xcab0('0x5'),'mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xcab0('0x6')],'allowNull':!![]},'application':{'type':Sequelize[_0xcab0('0x6')],'allowNull':!![]},'digit':{'type':Sequelize[_0xcab0('0x6')],'allowNull':!![]},'sort':{'type':Sequelize[_0xcab0('0x6')],'allowNull':!![],'defaultValue':_0xcab0('0x7')},'format':{'type':Sequelize[_0xcab0('0x6')],'allowNull':!![]},'stamp':{'type':_0xcab0('0x8')},'defaultEntry':{'type':Sequelize[_0xcab0('0x9')],'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 1c4c571..efcef02 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 _0xde96=['join','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','root','format','%s.%s','extname','symlinkSync','removeSound','id2','createdAt','getSounds','filter','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','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','undefined','limit','offset','count','apply','reject','save','update','then','get','UserProfileResource','destroy','name','send','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','options','VoiceMusicOnHold','includeAll','catch','show','params','keys','length','include','find','body','sequelize','transaction','files','directory','server/files/moh','create','mode','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync'];(function(_0x1e3daa,_0x3cbbad){var _0x271139=function(_0x51bd10){while(--_0x51bd10){_0x1e3daa['push'](_0x1e3daa['shift']());}};_0x271139(++_0x3cbbad);}(_0xde96,0x84));var _0x6de9=function(_0x152564,_0x48bdfb){_0x152564=_0x152564-0x0;var _0x49d99b=_0xde96[_0x152564];return _0x49d99b;};'use strict';var emlformat=require(_0x6de9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6de9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6de9('0x2'));var moment=require(_0x6de9('0x3'));var BPromise=require(_0x6de9('0x4'));var Mustache=require(_0x6de9('0x5'));var util=require(_0x6de9('0x6'));var path=require(_0x6de9('0x7'));var sox=require(_0x6de9('0x8'));var csv=require(_0x6de9('0x9'));var ejs=require(_0x6de9('0xa'));var fs=require('fs');var fs_extra=require(_0x6de9('0xb'));var _=require(_0x6de9('0xc'));var squel=require(_0x6de9('0xd'));var crypto=require(_0x6de9('0xe'));var jsforce=require(_0x6de9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6de9('0x9'));var querystring=require(_0x6de9('0x10'));var Papa=require(_0x6de9('0x11'));var Redis=require(_0x6de9('0x12'));var authService=require(_0x6de9('0x13'));var qs=require(_0x6de9('0x14'));var as=require(_0x6de9('0x15'));var hardwareService=require(_0x6de9('0x16'));var logger=require(_0x6de9('0x17'))(_0x6de9('0x18'));var utils=require(_0x6de9('0x19'));var config=require(_0x6de9('0x1a'));var licenseUtil=require(_0x6de9('0x1b'));var db=require(_0x6de9('0x1c'))['db'];function respondWithStatusCode(_0x3c0ee2,_0x1f996b){_0x1f996b=_0x1f996b||0xcc;return function(_0x4b44d){if(_0x4b44d){return _0x3c0ee2['sendStatus'](_0x1f996b);}return _0x3c0ee2[_0x6de9('0x1d')](_0x1f996b)[_0x6de9('0x1e')]();};}function respondWithResult(_0x4bd683,_0x1e9d26){_0x1e9d26=_0x1e9d26||0xc8;return function(_0xed282b){if(_0xed282b){return _0x4bd683[_0x6de9('0x1d')](_0x1e9d26)[_0x6de9('0x1f')](_0xed282b);}};}function respondWithFilteredResult(_0x4a01d1,_0x289cec){return function(_0x1bf1e2){if(_0x1bf1e2){var _0x4c98ee=typeof _0x289cec['offset']===_0x6de9('0x20')&&typeof _0x289cec[_0x6de9('0x21')]===_0x6de9('0x20');var _0x50b148=_0x1bf1e2['count'];var _0x47abd8=_0x4c98ee?0x0:_0x289cec[_0x6de9('0x22')];var _0x35d3ee=_0x4c98ee?_0x1bf1e2[_0x6de9('0x23')]:_0x289cec[_0x6de9('0x22')]+_0x289cec[_0x6de9('0x21')];var _0x320c7f;if(_0x35d3ee>=_0x50b148){_0x35d3ee=_0x50b148;_0x320c7f=0xc8;}else{_0x320c7f=0xce;}_0x4a01d1[_0x6de9('0x1d')](_0x320c7f);return _0x4a01d1['set']('Content-Range',_0x47abd8+'-'+_0x35d3ee+'/'+_0x50b148)['json'](_0x1bf1e2);}return null;};}function patchUpdates(_0x2db027){return function(_0x113d31){try{jsonpatch[_0x6de9('0x24')](_0x113d31,_0x2db027,!![]);}catch(_0x17e3e2){return BPromise[_0x6de9('0x25')](_0x17e3e2);}return _0x113d31[_0x6de9('0x26')]();};}function saveUpdates(_0x2b2fad,_0x57f424){return function(_0x48a9bc){if(_0x48a9bc){return _0x48a9bc[_0x6de9('0x27')](_0x2b2fad)[_0x6de9('0x28')](function(_0x4e17cd){return _0x4e17cd;});}return null;};}function removeEntity(_0x178854,_0x33c1f5){return function(_0x52838b){if(_0x52838b){return _0x52838b['destroy']()[_0x6de9('0x28')](function(){var _0x6457a=_0x52838b[_0x6de9('0x29')]({'plain':!![]});var _0x2ac0d8='MusicOnHolds';return db[_0x6de9('0x2a')][_0x6de9('0x2b')]({'where':{'type':_0x2ac0d8,'resourceId':_0x6457a['id']}})[_0x6de9('0x28')](function(){return _0x52838b;});})[_0x6de9('0x28')](function(){_0x178854[_0x6de9('0x1d')](0xcc)[_0x6de9('0x1e')]();});}};}function handleEntityNotFound(_0x3f61fc,_0x52fa43){return function(_0x38ec4e){if(!_0x38ec4e){_0x3f61fc['sendStatus'](0x194);}return _0x38ec4e;};}function handleError(_0x195b8b,_0x4ad09f){_0x4ad09f=_0x4ad09f||0x1f4;return function(_0x2a0248){logger['error'](_0x2a0248['stack']);if(_0x2a0248[_0x6de9('0x2c')]){delete _0x2a0248[_0x6de9('0x2c')];}_0x195b8b['status'](_0x4ad09f)[_0x6de9('0x2d')](_0x2a0248);};}exports['index']=function(_0x172e14,_0x7c9af8){var _0x3ad7c5={},_0x17882={},_0x55f5e3={'count':0x0,'rows':[]};var _0x2b584b=_['map'](db['VoiceMusicOnHold']['rawAttributes'],function(_0x2b5dc5){return{'name':_0x2b5dc5[_0x6de9('0x2e')],'type':_0x2b5dc5[_0x6de9('0x2f')][_0x6de9('0x30')]};});_0x17882[_0x6de9('0x31')]=_[_0x6de9('0x32')](_0x2b584b,_0x6de9('0x2c'));_0x17882[_0x6de9('0x33')]=_['keys'](_0x172e14[_0x6de9('0x33')]);_0x17882[_0x6de9('0x34')]=_[_0x6de9('0x35')](_0x17882['model'],_0x17882[_0x6de9('0x33')]);_0x3ad7c5[_0x6de9('0x36')]=_[_0x6de9('0x35')](_0x17882[_0x6de9('0x31')],qs['fields'](_0x172e14['query'][_0x6de9('0x37')]));_0x3ad7c5[_0x6de9('0x36')]=_0x3ad7c5[_0x6de9('0x36')]['length']?_0x3ad7c5[_0x6de9('0x36')]:_0x17882[_0x6de9('0x31')];if(!_0x172e14[_0x6de9('0x33')]['hasOwnProperty'](_0x6de9('0x38'))){_0x3ad7c5[_0x6de9('0x21')]=qs['limit'](_0x172e14[_0x6de9('0x33')][_0x6de9('0x21')]);_0x3ad7c5[_0x6de9('0x22')]=qs[_0x6de9('0x22')](_0x172e14[_0x6de9('0x33')]['offset']);}_0x3ad7c5[_0x6de9('0x39')]=qs[_0x6de9('0x3a')](_0x172e14['query'][_0x6de9('0x3a')]);delete _0x172e14[_0x6de9('0x33')][_0x6de9('0x3a')];_0x3ad7c5[_0x6de9('0x3b')]=qs[_0x6de9('0x34')](_[_0x6de9('0x3c')](_0x172e14['query'],_0x17882[_0x6de9('0x34')]),_0x2b584b);if(_0x172e14[_0x6de9('0x33')]['filter']){_0x3ad7c5['where']=_[_0x6de9('0x3d')](_0x3ad7c5['where'],{'$or':_[_0x6de9('0x32')](_0x2b584b,function(_0xf56c5f){if(_0xf56c5f[_0x6de9('0x2f')]!==_0x6de9('0x3e')){var _0x3be37b={};_0x3be37b[_0xf56c5f[_0x6de9('0x2c')]]={'$like':'%'+_0x172e14[_0x6de9('0x33')]['filter']+'%'};return _0x3be37b;}})});}_0x3ad7c5=_[_0x6de9('0x3d')]({},_0x3ad7c5,_0x172e14[_0x6de9('0x3f')]);var _0x53d112={'where':_0x3ad7c5['where']};return db[_0x6de9('0x40')][_0x6de9('0x23')](_0x53d112)[_0x6de9('0x28')](function(_0x38bf29){_0x55f5e3[_0x6de9('0x23')]=_0x38bf29;if(_0x172e14[_0x6de9('0x33')][_0x6de9('0x41')]){_0x3ad7c5['include']=[{'all':!![]}];}return db[_0x6de9('0x40')]['findAll'](_0x3ad7c5);})['then'](function(_0x31fcb9){_0x55f5e3['rows']=_0x31fcb9;return _0x55f5e3;})[_0x6de9('0x28')](respondWithFilteredResult(_0x7c9af8,_0x3ad7c5))[_0x6de9('0x42')](handleError(_0x7c9af8,null));};exports[_0x6de9('0x43')]=function(_0x3676ab,_0x59be48){var _0x2efece={'raw':![],'where':{'id':_0x3676ab[_0x6de9('0x44')]['id']}},_0x4e8a58={};_0x4e8a58[_0x6de9('0x31')]=_['keys'](db[_0x6de9('0x40')]['rawAttributes']);_0x4e8a58['query']=_[_0x6de9('0x45')](_0x3676ab[_0x6de9('0x33')]);_0x4e8a58[_0x6de9('0x34')]=_['intersection'](_0x4e8a58[_0x6de9('0x31')],_0x4e8a58[_0x6de9('0x33')]);_0x2efece[_0x6de9('0x36')]=_[_0x6de9('0x35')](_0x4e8a58['model'],qs['fields'](_0x3676ab[_0x6de9('0x33')][_0x6de9('0x37')]));_0x2efece['attributes']=_0x2efece[_0x6de9('0x36')][_0x6de9('0x46')]?_0x2efece[_0x6de9('0x36')]:_0x4e8a58[_0x6de9('0x31')];if(_0x3676ab[_0x6de9('0x33')][_0x6de9('0x41')]){_0x2efece[_0x6de9('0x47')]=[{'all':!![]}];}_0x2efece=_[_0x6de9('0x3d')]({},_0x2efece,_0x3676ab['options']);return db[_0x6de9('0x40')][_0x6de9('0x48')](_0x2efece)['then'](handleEntityNotFound(_0x59be48,null))[_0x6de9('0x28')](respondWithResult(_0x59be48,null))[_0x6de9('0x42')](handleError(_0x59be48,null));};exports['update']=function(_0x5a0be2,_0x17ab80){if(_0x5a0be2[_0x6de9('0x49')]['id']){delete _0x5a0be2[_0x6de9('0x49')]['id'];}return db[_0x6de9('0x40')][_0x6de9('0x48')]({'where':{'id':_0x5a0be2[_0x6de9('0x44')]['id']}})['then'](handleEntityNotFound(_0x17ab80,null))[_0x6de9('0x28')](saveUpdates(_0x5a0be2[_0x6de9('0x49')],null))[_0x6de9('0x28')](respondWithResult(_0x17ab80,null))[_0x6de9('0x42')](handleError(_0x17ab80,null));};exports['create']=function(_0x29323a,_0x1e8e30,_0x4c0193){return db[_0x6de9('0x4a')][_0x6de9('0x4b')](function(_0x6325f1){if(_0x29323a[_0x6de9('0x49')]['mode']===_0x6de9('0x4c')){_0x29323a[_0x6de9('0x49')][_0x6de9('0x4d')]=path['join'](config['root'],_0x6de9('0x4e'),_0x29323a[_0x6de9('0x49')][_0x6de9('0x2c')]);}return db[_0x6de9('0x40')][_0x6de9('0x4f')](_0x29323a[_0x6de9('0x49')],{'transaction':_0x6325f1})['then'](function(_0x2bf2c3){if(_0x29323a[_0x6de9('0x49')][_0x6de9('0x50')]===_0x6de9('0x4c')){fs['mkdirSync'](_0x2bf2c3[_0x6de9('0x4d')],parseInt(_0x6de9('0x51'),0x8));}var _0x4941c5=_0x29323a[_0x6de9('0x52')][_0x6de9('0x29')]({'plain':!![]});if(!_0x4941c5)throw new Error(_0x6de9('0x53'));if(_0x4941c5[_0x6de9('0x54')]===_0x6de9('0x52')){var _0x32de4b=_0x2bf2c3[_0x6de9('0x29')]({'plain':!![]});return db[_0x6de9('0x55')][_0x6de9('0x48')]({'where':{'name':'MusicOnHolds','userProfileId':_0x4941c5[_0x6de9('0x56')]},'raw':!![]})[_0x6de9('0x28')](function(_0x1f09a9){if(_0x1f09a9&&_0x1f09a9[_0x6de9('0x57')]===0x0){return db[_0x6de9('0x2a')][_0x6de9('0x4f')]({'name':_0x32de4b['name'],'resourceId':_0x32de4b['id'],'type':_0x1f09a9[_0x6de9('0x2c')],'sectionId':_0x1f09a9['id']},{})[_0x6de9('0x28')](function(){return _0x2bf2c3;});}else{return _0x2bf2c3;}})[_0x6de9('0x42')](function(_0x42f50b){logger['error'](_0x6de9('0x58'),_0x42f50b);});}return _0x2bf2c3;});})[_0x6de9('0x28')](respondWithResult(_0x1e8e30,0xc9))[_0x6de9('0x42')](handleError(_0x1e8e30,null));};exports[_0x6de9('0x2b')]=function(_0x56710e,_0x4518d6,_0x37b417){var _0x4b2816;return db[_0x6de9('0x40')][_0x6de9('0x48')]({'where':{'id':_0x56710e['params']['id']}})[_0x6de9('0x28')](function(_0x367c06){if(_0x367c06){return db[_0x6de9('0x4a')][_0x6de9('0x4b')](function(_0x455a91){return _0x367c06['destroy']({'transaction':_0x455a91,'raw':!![]})[_0x6de9('0x28')](function(_0x44db76){if(_0x44db76[_0x6de9('0x4d')]){fs[_0x6de9('0x59')](_0x44db76['directory'])[_0x6de9('0x5a')](function(_0x5ec98d){fs[_0x6de9('0x5b')](path[_0x6de9('0x5c')](_0x44db76[_0x6de9('0x4d')],_0x5ec98d));});fs[_0x6de9('0x5d')](_0x44db76[_0x6de9('0x4d')]);}return _0x44db76;});})['catch'](function(_0x378ba2){throw new db[(_0x6de9('0x5e'))][(_0x6de9('0x5f'))](_0x378ba2[_0x6de9('0x60')]);});}})[_0x6de9('0x28')](handleEntityNotFound(_0x4518d6,null))[_0x6de9('0x28')](removeEntity(_0x4518d6,null))[_0x6de9('0x42')](handleError(_0x4518d6,null));};exports['addSound']=function(_0x1a08a3,_0x3c6d1f,_0x2bedb9){return db[_0x6de9('0x4a')]['transaction'](function(_0x4a9fbf){var _0xd40c55;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x1a08a3['params']['id']}})[_0x6de9('0x28')](function(_0x1a9bd6){if(_0x1a9bd6){_0xd40c55=_0x1a9bd6;return _0x1a9bd6[_0x6de9('0x61')](_0x1a08a3['body']['id'],{'transaction':_0x4a9fbf});}})[_0x6de9('0x28')](function(_0x4a524b){if(_0x4a524b){return db[_0x6de9('0x62')][_0x6de9('0x63')]({'where':{'id':_0x1a08a3[_0x6de9('0x49')]['id']},'attributes':['id',_0x6de9('0x2c'),_0x6de9('0x64'),_0x6de9('0x65'),'createdAt'],'raw':!![]});}})['then'](function(_0x1b9763){if(_0x1b9763){var _0x344cf2=path[_0x6de9('0x5c')](config[_0x6de9('0x66')],'server/files/sounds/converted',util[_0x6de9('0x67')](_0x6de9('0x68'),path['basename'](_0x1b9763['save_name'],path[_0x6de9('0x69')](_0x1b9763[_0x6de9('0x64')])),_0x1b9763['converted_format']));var _0x4d336c=path['join'](config['root'],_0x6de9('0x4e'),_0xd40c55['name'],util[_0x6de9('0x67')]('%s.%s',_0x1b9763[_0x6de9('0x2c')],_0x1b9763[_0x6de9('0x65')]));fs[_0x6de9('0x6a')](_0x344cf2,_0x4d336c);return _0x1b9763;}})['catch'](function(_0xd558a7){throw new db[(_0x6de9('0x5e'))][(_0x6de9('0x5f'))](_0xd558a7[_0x6de9('0x60')]);});})[_0x6de9('0x28')](handleEntityNotFound(_0x3c6d1f,null))[_0x6de9('0x28')](respondWithResult(_0x3c6d1f,0xc9))[_0x6de9('0x42')](handleError(_0x3c6d1f,null));};exports['removeSound']=function(_0x5b74bd,_0x250f79,_0x579779){return db[_0x6de9('0x4a')]['transaction'](function(_0x4d4694){var _0x11d04b;return db[_0x6de9('0x40')][_0x6de9('0x63')]({'where':{'id':_0x5b74bd[_0x6de9('0x44')]['id']}})[_0x6de9('0x28')](handleEntityNotFound(_0x250f79,null))[_0x6de9('0x28')](function(_0x142478){if(_0x142478){_0x11d04b=_0x142478;return _0x142478[_0x6de9('0x6b')](_0x5b74bd[_0x6de9('0x44')][_0x6de9('0x6c')]);}})[_0x6de9('0x28')](function(_0x469f0e){if(_0x469f0e){return db[_0x6de9('0x62')][_0x6de9('0x63')]({'where':{'id':_0x5b74bd[_0x6de9('0x44')][_0x6de9('0x6c')]},'attributes':['id',_0x6de9('0x2c'),_0x6de9('0x64'),'converted_format',_0x6de9('0x6d')],'raw':!![]});}})[_0x6de9('0x28')](function(_0x4c7104){if(_0x4c7104){fs['unlinkSync'](path[_0x6de9('0x5c')](_0x11d04b[_0x6de9('0x4d')],util[_0x6de9('0x67')]('%s.%s',_0x4c7104[_0x6de9('0x2c')],_0x4c7104[_0x6de9('0x65')])));return _0x4c7104;}})[_0x6de9('0x42')](function(_0x43e2c9){throw new db[(_0x6de9('0x5e'))][(_0x6de9('0x5f'))](_0x43e2c9[_0x6de9('0x60')]);});})[_0x6de9('0x28')](handleEntityNotFound(_0x250f79,null))[_0x6de9('0x28')](respondWithStatusCode(_0x250f79,0xcc))[_0x6de9('0x42')](handleError(_0x250f79,null));};exports[_0x6de9('0x6e')]=function(_0x3dcc1b,_0xf37bad,_0x4a6357){var _0x5d19ce={};var _0x4e44d4={};var _0xa27a23;var _0x52c2ce;return db[_0x6de9('0x40')][_0x6de9('0x63')]({'where':{'id':_0x3dcc1b[_0x6de9('0x44')]['id']}})[_0x6de9('0x28')](handleEntityNotFound(_0xf37bad,null))[_0x6de9('0x28')](function(_0x5f10fe){if(_0x5f10fe){_0xa27a23=_0x5f10fe;_0x4e44d4['model']=_['keys'](db[_0x6de9('0x62')]['rawAttributes']);_0x4e44d4[_0x6de9('0x33')]=_['keys'](_0x3dcc1b[_0x6de9('0x33')]);_0x4e44d4['filters']=_[_0x6de9('0x35')](_0x4e44d4['model'],_0x4e44d4[_0x6de9('0x33')]);_0x5d19ce[_0x6de9('0x36')]=_['intersection'](_0x4e44d4[_0x6de9('0x31')],qs[_0x6de9('0x37')](_0x3dcc1b[_0x6de9('0x33')]['fields']));_0x5d19ce[_0x6de9('0x36')]=_0x5d19ce[_0x6de9('0x36')]['length']?_0x5d19ce['attributes']:_0x4e44d4[_0x6de9('0x31')];_0x5d19ce[_0x6de9('0x39')]=qs['sort'](_0x3dcc1b[_0x6de9('0x33')]['sort']);_0x5d19ce[_0x6de9('0x3b')]=qs[_0x6de9('0x34')](_[_0x6de9('0x3c')](_0x3dcc1b['query'],_0x4e44d4[_0x6de9('0x34')]));if(_0x3dcc1b[_0x6de9('0x33')][_0x6de9('0x6f')]){_0x5d19ce[_0x6de9('0x3b')]=_[_0x6de9('0x3d')](_0x5d19ce[_0x6de9('0x3b')],{'$or':_['map'](_0x5d19ce[_0x6de9('0x36')],function(_0x45902e){var _0x5e21e6={};_0x5e21e6[_0x45902e]={'$like':'%'+_0x3dcc1b[_0x6de9('0x33')][_0x6de9('0x6f')]+'%'};return _0x5e21e6;})});}_0x5d19ce=_['merge']({},_0x5d19ce,_0x3dcc1b['options']);return _0xa27a23[_0x6de9('0x6e')](_0x5d19ce);}})[_0x6de9('0x28')](function(_0x14b5fe){if(_0x14b5fe){_0x52c2ce=_0x14b5fe[_0x6de9('0x46')];if(!_0x3dcc1b[_0x6de9('0x33')]['hasOwnProperty'](_0x6de9('0x38'))){_0x5d19ce[_0x6de9('0x21')]=qs['limit'](_0x3dcc1b[_0x6de9('0x33')][_0x6de9('0x21')]);_0x5d19ce['offset']=qs['offset'](_0x3dcc1b[_0x6de9('0x33')][_0x6de9('0x22')]);}return _0xa27a23[_0x6de9('0x6e')](_0x5d19ce);}})[_0x6de9('0x28')](function(_0x65aa4){if(_0x65aa4){return _0x65aa4?{'count':_0x52c2ce,'rows':_0x65aa4}:null;}})[_0x6de9('0x28')](respondWithResult(_0xf37bad,null))[_0x6de9('0x42')](handleError(_0xf37bad,null));}; \ No newline at end of file +var _0xefb3=['fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','rawAttributes','options','catch','body','create','sequelize','transaction','files','directory','join','root','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','Sound','findOne','converted_format','createdAt','server/files/sounds/converted','%s.%s','basename','extname','save_name','format','symlinkSync','Sequelize','removeSound','id2','getSounds','pick','zip-dir','request-promise','moment','bluebird','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','sendStatus','error','stack','name','send','index','map','VoiceMusicOnHold','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x268958,_0x25a6e8){var _0xa7f7fd=function(_0x49b3ae){while(--_0x49b3ae){_0x268958['push'](_0x268958['shift']());}};_0xa7f7fd(++_0x25a6e8);}(_0xefb3,0xa6));var _0x3efb=function(_0x59b7ed,_0x21283a){_0x59b7ed=_0x59b7ed-0x0;var _0x16e140=_0xefb3[_0x59b7ed];return _0x16e140;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3efb('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3efb('0x1'));var moment=require(_0x3efb('0x2'));var BPromise=require(_0x3efb('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3efb('0x4'));var ejs=require(_0x3efb('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3efb('0x6'));var squel=require(_0x3efb('0x7'));var crypto=require(_0x3efb('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x3efb('0x9'));var toCsv=require(_0x3efb('0x4'));var querystring=require(_0x3efb('0xa'));var Papa=require('papaparse');var Redis=require(_0x3efb('0xb'));var authService=require(_0x3efb('0xc'));var qs=require(_0x3efb('0xd'));var as=require(_0x3efb('0xe'));var hardwareService=require(_0x3efb('0xf'));var logger=require('../../config/logger')(_0x3efb('0x10'));var utils=require('../../config/utils');var config=require(_0x3efb('0x11'));var licenseUtil=require(_0x3efb('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x319f0,_0x281ee4){_0x281ee4=_0x281ee4||0xcc;return function(_0x27b57f){if(_0x27b57f){return _0x319f0['sendStatus'](_0x281ee4);}return _0x319f0[_0x3efb('0x13')](_0x281ee4)[_0x3efb('0x14')]();};}function respondWithResult(_0x2c9c6a,_0x14922c){_0x14922c=_0x14922c||0xc8;return function(_0x17ba54){if(_0x17ba54){return _0x2c9c6a[_0x3efb('0x13')](_0x14922c)[_0x3efb('0x15')](_0x17ba54);}};}function respondWithFilteredResult(_0x244b18,_0x1a1355){return function(_0x19549d){if(_0x19549d){var _0x444378=typeof _0x1a1355[_0x3efb('0x16')]===_0x3efb('0x17')&&typeof _0x1a1355[_0x3efb('0x18')]==='undefined';var _0x171f0e=_0x19549d[_0x3efb('0x19')];var _0x2f858b=_0x444378?0x0:_0x1a1355[_0x3efb('0x16')];var _0xdb874c=_0x444378?_0x19549d[_0x3efb('0x19')]:_0x1a1355[_0x3efb('0x16')]+_0x1a1355[_0x3efb('0x18')];var _0x1e9022;if(_0xdb874c>=_0x171f0e){_0xdb874c=_0x171f0e;_0x1e9022=0xc8;}else{_0x1e9022=0xce;}_0x244b18[_0x3efb('0x13')](_0x1e9022);return _0x244b18[_0x3efb('0x1a')](_0x3efb('0x1b'),_0x2f858b+'-'+_0xdb874c+'/'+_0x171f0e)[_0x3efb('0x15')](_0x19549d);}return null;};}function patchUpdates(_0x3f314b){return function(_0x76ba11){try{jsonpatch[_0x3efb('0x1c')](_0x76ba11,_0x3f314b,!![]);}catch(_0x52f54f){return BPromise[_0x3efb('0x1d')](_0x52f54f);}return _0x76ba11[_0x3efb('0x1e')]();};}function saveUpdates(_0x9394ac,_0x21fa48){return function(_0x24b6a9){if(_0x24b6a9){return _0x24b6a9[_0x3efb('0x1f')](_0x9394ac)[_0x3efb('0x20')](function(_0x27a6f3){return _0x27a6f3;});}return null;};}function removeEntity(_0x4df34b,_0x1ca681){return function(_0x1ae164){if(_0x1ae164){return _0x1ae164[_0x3efb('0x21')]()[_0x3efb('0x20')](function(){var _0xa2969=_0x1ae164[_0x3efb('0x22')]({'plain':!![]});var _0x186499=_0x3efb('0x23');return db[_0x3efb('0x24')][_0x3efb('0x21')]({'where':{'type':_0x186499,'resourceId':_0xa2969['id']}})['then'](function(){return _0x1ae164;});})[_0x3efb('0x20')](function(){_0x4df34b[_0x3efb('0x13')](0xcc)[_0x3efb('0x14')]();});}};}function handleEntityNotFound(_0x5410c2,_0x308a1a){return function(_0x33c6aa){if(!_0x33c6aa){_0x5410c2[_0x3efb('0x25')](0x194);}return _0x33c6aa;};}function handleError(_0x28dd10,_0x25848c){_0x25848c=_0x25848c||0x1f4;return function(_0x33f872){logger[_0x3efb('0x26')](_0x33f872[_0x3efb('0x27')]);if(_0x33f872[_0x3efb('0x28')]){delete _0x33f872[_0x3efb('0x28')];}_0x28dd10['status'](_0x25848c)[_0x3efb('0x29')](_0x33f872);};}exports[_0x3efb('0x2a')]=function(_0x37ebc9,_0x566329){var _0x4dad11={},_0x960632={},_0x4d8aff={'count':0x0,'rows':[]};var _0x65f9f4=_[_0x3efb('0x2b')](db[_0x3efb('0x2c')]['rawAttributes'],function(_0x324661){return{'name':_0x324661[_0x3efb('0x2d')],'type':_0x324661[_0x3efb('0x2e')][_0x3efb('0x2f')]};});_0x960632[_0x3efb('0x30')]=_[_0x3efb('0x2b')](_0x65f9f4,_0x3efb('0x28'));_0x960632[_0x3efb('0x31')]=_[_0x3efb('0x32')](_0x37ebc9[_0x3efb('0x31')]);_0x960632[_0x3efb('0x33')]=_[_0x3efb('0x34')](_0x960632[_0x3efb('0x30')],_0x960632[_0x3efb('0x31')]);_0x4dad11[_0x3efb('0x35')]=_[_0x3efb('0x34')](_0x960632[_0x3efb('0x30')],qs[_0x3efb('0x36')](_0x37ebc9[_0x3efb('0x31')]['fields']));_0x4dad11['attributes']=_0x4dad11['attributes'][_0x3efb('0x37')]?_0x4dad11[_0x3efb('0x35')]:_0x960632[_0x3efb('0x30')];if(!_0x37ebc9[_0x3efb('0x31')][_0x3efb('0x38')](_0x3efb('0x39'))){_0x4dad11['limit']=qs[_0x3efb('0x18')](_0x37ebc9[_0x3efb('0x31')][_0x3efb('0x18')]);_0x4dad11['offset']=qs[_0x3efb('0x16')](_0x37ebc9['query'][_0x3efb('0x16')]);}_0x4dad11['order']=qs[_0x3efb('0x3a')](_0x37ebc9[_0x3efb('0x31')][_0x3efb('0x3a')]);delete _0x37ebc9[_0x3efb('0x31')][_0x3efb('0x3a')];_0x4dad11[_0x3efb('0x3b')]=qs[_0x3efb('0x33')](_['pick'](_0x37ebc9[_0x3efb('0x31')],_0x960632[_0x3efb('0x33')]),_0x65f9f4);if(_0x37ebc9['query'][_0x3efb('0x3c')]){_0x4dad11[_0x3efb('0x3b')]=_[_0x3efb('0x3d')](_0x4dad11[_0x3efb('0x3b')],{'$or':_[_0x3efb('0x2b')](_0x65f9f4,function(_0x1ef8fa){if(_0x1ef8fa['type']!==_0x3efb('0x3e')){var _0xd603f1={};_0xd603f1[_0x1ef8fa[_0x3efb('0x28')]]={'$like':'%'+_0x37ebc9[_0x3efb('0x31')][_0x3efb('0x3c')]+'%'};return _0xd603f1;}})});}_0x4dad11=_[_0x3efb('0x3d')]({},_0x4dad11,_0x37ebc9['options']);var _0x5beceb={'where':_0x4dad11[_0x3efb('0x3b')]};return db[_0x3efb('0x2c')][_0x3efb('0x19')](_0x5beceb)[_0x3efb('0x20')](function(_0x3242bf){_0x4d8aff[_0x3efb('0x19')]=_0x3242bf;if(_0x37ebc9[_0x3efb('0x31')][_0x3efb('0x3f')]){_0x4dad11[_0x3efb('0x40')]=[{'all':!![]}];}return db[_0x3efb('0x2c')][_0x3efb('0x41')](_0x4dad11);})[_0x3efb('0x20')](function(_0x42920a){_0x4d8aff[_0x3efb('0x42')]=_0x42920a;return _0x4d8aff;})[_0x3efb('0x20')](respondWithFilteredResult(_0x566329,_0x4dad11))['catch'](handleError(_0x566329,null));};exports['show']=function(_0x45399d,_0x25f00d){var _0x7144f9={'raw':![],'where':{'id':_0x45399d[_0x3efb('0x43')]['id']}},_0x48f91c={};_0x48f91c[_0x3efb('0x30')]=_[_0x3efb('0x32')](db['VoiceMusicOnHold'][_0x3efb('0x44')]);_0x48f91c['query']=_[_0x3efb('0x32')](_0x45399d[_0x3efb('0x31')]);_0x48f91c[_0x3efb('0x33')]=_[_0x3efb('0x34')](_0x48f91c[_0x3efb('0x30')],_0x48f91c['query']);_0x7144f9[_0x3efb('0x35')]=_[_0x3efb('0x34')](_0x48f91c[_0x3efb('0x30')],qs[_0x3efb('0x36')](_0x45399d[_0x3efb('0x31')][_0x3efb('0x36')]));_0x7144f9[_0x3efb('0x35')]=_0x7144f9[_0x3efb('0x35')][_0x3efb('0x37')]?_0x7144f9[_0x3efb('0x35')]:_0x48f91c[_0x3efb('0x30')];if(_0x45399d[_0x3efb('0x31')]['includeAll']){_0x7144f9[_0x3efb('0x40')]=[{'all':!![]}];}_0x7144f9=_['merge']({},_0x7144f9,_0x45399d[_0x3efb('0x45')]);return db[_0x3efb('0x2c')]['find'](_0x7144f9)[_0x3efb('0x20')](handleEntityNotFound(_0x25f00d,null))[_0x3efb('0x20')](respondWithResult(_0x25f00d,null))[_0x3efb('0x46')](handleError(_0x25f00d,null));};exports[_0x3efb('0x1f')]=function(_0x52f878,_0x1ab9dd){if(_0x52f878[_0x3efb('0x47')]['id']){delete _0x52f878[_0x3efb('0x47')]['id'];}return db[_0x3efb('0x2c')]['find']({'where':{'id':_0x52f878[_0x3efb('0x43')]['id']}})[_0x3efb('0x20')](handleEntityNotFound(_0x1ab9dd,null))[_0x3efb('0x20')](saveUpdates(_0x52f878[_0x3efb('0x47')],null))[_0x3efb('0x20')](respondWithResult(_0x1ab9dd,null))[_0x3efb('0x46')](handleError(_0x1ab9dd,null));};exports[_0x3efb('0x48')]=function(_0x593cc2,_0x15be9b,_0x23b4e1){return db[_0x3efb('0x49')][_0x3efb('0x4a')](function(_0xbe4fee){if(_0x593cc2[_0x3efb('0x47')]['mode']===_0x3efb('0x4b')){_0x593cc2['body'][_0x3efb('0x4c')]=path[_0x3efb('0x4d')](config[_0x3efb('0x4e')],_0x3efb('0x4f'),_0x593cc2[_0x3efb('0x47')][_0x3efb('0x28')]);}return db[_0x3efb('0x2c')][_0x3efb('0x48')](_0x593cc2[_0x3efb('0x47')],{'transaction':_0xbe4fee})[_0x3efb('0x20')](function(_0x31bcfb){if(_0x593cc2[_0x3efb('0x47')]['mode']===_0x3efb('0x4b')){fs['mkdirSync'](_0x31bcfb[_0x3efb('0x4c')],parseInt(_0x3efb('0x50'),0x8));}var _0x334351=_0x593cc2[_0x3efb('0x51')][_0x3efb('0x22')]({'plain':!![]});if(!_0x334351)throw new Error(_0x3efb('0x52'));if(_0x334351['role']===_0x3efb('0x51')){var _0x46d2b5=_0x31bcfb[_0x3efb('0x22')]({'plain':!![]});return db[_0x3efb('0x53')]['find']({'where':{'name':_0x3efb('0x23'),'userProfileId':_0x334351[_0x3efb('0x54')]},'raw':!![]})[_0x3efb('0x20')](function(_0x222d11){if(_0x222d11&&_0x222d11['autoAssociation']===0x0){return db[_0x3efb('0x24')][_0x3efb('0x48')]({'name':_0x46d2b5[_0x3efb('0x28')],'resourceId':_0x46d2b5['id'],'type':_0x222d11[_0x3efb('0x28')],'sectionId':_0x222d11['id']},{})[_0x3efb('0x20')](function(){return _0x31bcfb;});}else{return _0x31bcfb;}})[_0x3efb('0x46')](function(_0x27d251){logger[_0x3efb('0x26')](_0x3efb('0x55'),_0x27d251);});}return _0x31bcfb;});})['then'](respondWithResult(_0x15be9b,0xc9))['catch'](handleError(_0x15be9b,null));};exports[_0x3efb('0x21')]=function(_0x4a0aa2,_0x30eed9,_0x1b4946){var _0x396615;return db['VoiceMusicOnHold'][_0x3efb('0x56')]({'where':{'id':_0x4a0aa2[_0x3efb('0x43')]['id']}})[_0x3efb('0x20')](function(_0x28eb94){if(_0x28eb94){return db[_0x3efb('0x49')]['transaction'](function(_0x3e3050){return _0x28eb94['destroy']({'transaction':_0x3e3050,'raw':!![]})[_0x3efb('0x20')](function(_0x2c8a47){if(_0x2c8a47[_0x3efb('0x4c')]){fs[_0x3efb('0x57')](_0x2c8a47[_0x3efb('0x4c')])[_0x3efb('0x58')](function(_0x2ac8dc){fs[_0x3efb('0x59')](path[_0x3efb('0x4d')](_0x2c8a47[_0x3efb('0x4c')],_0x2ac8dc));});fs[_0x3efb('0x5a')](_0x2c8a47['directory']);}return _0x2c8a47;});})['catch'](function(_0xdfa873){throw new db['Sequelize'][(_0x3efb('0x5b'))](_0xdfa873[_0x3efb('0x5c')]);});}})[_0x3efb('0x20')](handleEntityNotFound(_0x30eed9,null))[_0x3efb('0x20')](removeEntity(_0x30eed9,null))[_0x3efb('0x46')](handleError(_0x30eed9,null));};exports[_0x3efb('0x5d')]=function(_0x27cc91,_0x381c7d,_0x4be140){return db[_0x3efb('0x49')][_0x3efb('0x4a')](function(_0x407729){var _0x195b59;return db[_0x3efb('0x2c')]['find']({'where':{'id':_0x27cc91['params']['id']}})[_0x3efb('0x20')](function(_0x3bf7e0){if(_0x3bf7e0){_0x195b59=_0x3bf7e0;return _0x3bf7e0['addSound'](_0x27cc91['body']['id'],{'transaction':_0x407729});}})[_0x3efb('0x20')](function(_0x540ed8){if(_0x540ed8){return db[_0x3efb('0x5e')][_0x3efb('0x5f')]({'where':{'id':_0x27cc91[_0x3efb('0x47')]['id']},'attributes':['id',_0x3efb('0x28'),'save_name',_0x3efb('0x60'),_0x3efb('0x61')],'raw':!![]});}})['then'](function(_0x290e8c){if(_0x290e8c){var _0x192745=path[_0x3efb('0x4d')](config[_0x3efb('0x4e')],_0x3efb('0x62'),util['format'](_0x3efb('0x63'),path[_0x3efb('0x64')](_0x290e8c['save_name'],path[_0x3efb('0x65')](_0x290e8c[_0x3efb('0x66')])),_0x290e8c[_0x3efb('0x60')]));var _0x4429a6=path[_0x3efb('0x4d')](config[_0x3efb('0x4e')],'server/files/moh',_0x195b59[_0x3efb('0x28')],util[_0x3efb('0x67')](_0x3efb('0x63'),_0x290e8c[_0x3efb('0x28')],_0x290e8c[_0x3efb('0x60')]));fs[_0x3efb('0x68')](_0x192745,_0x4429a6);return _0x290e8c;}})['catch'](function(_0xe7530){throw new db[(_0x3efb('0x69'))]['ValidationError'](_0xe7530[_0x3efb('0x5c')]);});})[_0x3efb('0x20')](handleEntityNotFound(_0x381c7d,null))[_0x3efb('0x20')](respondWithResult(_0x381c7d,0xc9))[_0x3efb('0x46')](handleError(_0x381c7d,null));};exports[_0x3efb('0x6a')]=function(_0x9d9094,_0x3743bb,_0x145b9e){return db[_0x3efb('0x49')]['transaction'](function(_0x3d8bd9){var _0xa312d9;return db[_0x3efb('0x2c')][_0x3efb('0x5f')]({'where':{'id':_0x9d9094[_0x3efb('0x43')]['id']}})[_0x3efb('0x20')](handleEntityNotFound(_0x3743bb,null))[_0x3efb('0x20')](function(_0x421e77){if(_0x421e77){_0xa312d9=_0x421e77;return _0x421e77[_0x3efb('0x6a')](_0x9d9094[_0x3efb('0x43')][_0x3efb('0x6b')]);}})[_0x3efb('0x20')](function(_0x430622){if(_0x430622){return db['Sound'][_0x3efb('0x5f')]({'where':{'id':_0x9d9094['params']['id2']},'attributes':['id',_0x3efb('0x28'),_0x3efb('0x66'),_0x3efb('0x60'),'createdAt'],'raw':!![]});}})[_0x3efb('0x20')](function(_0xd4840e){if(_0xd4840e){fs[_0x3efb('0x59')](path[_0x3efb('0x4d')](_0xa312d9[_0x3efb('0x4c')],util[_0x3efb('0x67')](_0x3efb('0x63'),_0xd4840e[_0x3efb('0x28')],_0xd4840e['converted_format'])));return _0xd4840e;}})[_0x3efb('0x46')](function(_0x296e2f){throw new db['Sequelize'][(_0x3efb('0x5b'))](_0x296e2f['message']);});})[_0x3efb('0x20')](handleEntityNotFound(_0x3743bb,null))[_0x3efb('0x20')](respondWithStatusCode(_0x3743bb,0xcc))[_0x3efb('0x46')](handleError(_0x3743bb,null));};exports[_0x3efb('0x6c')]=function(_0x565924,_0xc6d37a,_0x18a052){var _0x2e79f7={};var _0x180dd9={};var _0x4d5042;var _0x517480;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x565924[_0x3efb('0x43')]['id']}})['then'](handleEntityNotFound(_0xc6d37a,null))[_0x3efb('0x20')](function(_0x1d816c){if(_0x1d816c){_0x4d5042=_0x1d816c;_0x180dd9[_0x3efb('0x30')]=_[_0x3efb('0x32')](db[_0x3efb('0x5e')][_0x3efb('0x44')]);_0x180dd9['query']=_[_0x3efb('0x32')](_0x565924[_0x3efb('0x31')]);_0x180dd9['filters']=_[_0x3efb('0x34')](_0x180dd9[_0x3efb('0x30')],_0x180dd9[_0x3efb('0x31')]);_0x2e79f7['attributes']=_[_0x3efb('0x34')](_0x180dd9['model'],qs[_0x3efb('0x36')](_0x565924[_0x3efb('0x31')][_0x3efb('0x36')]));_0x2e79f7[_0x3efb('0x35')]=_0x2e79f7[_0x3efb('0x35')]['length']?_0x2e79f7[_0x3efb('0x35')]:_0x180dd9[_0x3efb('0x30')];_0x2e79f7['order']=qs['sort'](_0x565924[_0x3efb('0x31')][_0x3efb('0x3a')]);_0x2e79f7[_0x3efb('0x3b')]=qs['filters'](_[_0x3efb('0x6d')](_0x565924[_0x3efb('0x31')],_0x180dd9['filters']));if(_0x565924['query'][_0x3efb('0x3c')]){_0x2e79f7[_0x3efb('0x3b')]=_['merge'](_0x2e79f7[_0x3efb('0x3b')],{'$or':_[_0x3efb('0x2b')](_0x2e79f7[_0x3efb('0x35')],function(_0x210638){var _0x51d1f1={};_0x51d1f1[_0x210638]={'$like':'%'+_0x565924[_0x3efb('0x31')][_0x3efb('0x3c')]+'%'};return _0x51d1f1;})});}_0x2e79f7=_[_0x3efb('0x3d')]({},_0x2e79f7,_0x565924[_0x3efb('0x45')]);return _0x4d5042['getSounds'](_0x2e79f7);}})['then'](function(_0x4de960){if(_0x4de960){_0x517480=_0x4de960[_0x3efb('0x37')];if(!_0x565924['query']['hasOwnProperty'](_0x3efb('0x39'))){_0x2e79f7['limit']=qs['limit'](_0x565924[_0x3efb('0x31')]['limit']);_0x2e79f7['offset']=qs['offset'](_0x565924[_0x3efb('0x31')][_0x3efb('0x16')]);}return _0x4d5042['getSounds'](_0x2e79f7);}})[_0x3efb('0x20')](function(_0x48f096){if(_0x48f096){return _0x48f096?{'count':_0x517480,'rows':_0x48f096}:null;}})[_0x3efb('0x20')](respondWithResult(_0xc6d37a,null))['catch'](handleError(_0xc6d37a,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 76b508c..289c89e 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 _0x294f=['./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','api','moment','request-promise','path','../../config/environment'];(function(_0x5933fb,_0x9115ad){var _0x44d988=function(_0x295228){while(--_0x295228){_0x5933fb['push'](_0x5933fb['shift']());}};_0x44d988(++_0x9115ad);}(_0x294f,0x144));var _0xf294=function(_0x1fece6,_0x11093d){_0x1fece6=_0x1fece6-0x0;var _0x474b0c=_0x294f[_0x1fece6];return _0x474b0c;};'use strict';var _=require(_0xf294('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf294('0x1'));var moment=require(_0xf294('0x2'));var BPromise=require('bluebird');var rp=require(_0xf294('0x3'));var fs=require('fs');var path=require(_0xf294('0x4'));var rimraf=require('rimraf');var config=require(_0xf294('0x5'));var attributes=require(_0xf294('0x6'));module[_0xf294('0x7')]=function(_0x8f6d2a,_0x76bcac){return _0x8f6d2a[_0xf294('0x8')]('VoiceMusicOnHold',attributes,{'tableName':_0xf294('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3904=['define','VoiceMusicOnHold','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x2b3928,_0x1b9052){var _0xefe9fc=function(_0x13ab2b){while(--_0x13ab2b){_0x2b3928['push'](_0x2b3928['shift']());}};_0xefe9fc(++_0x1b9052);}(_0x3904,0xe9));var _0x4390=function(_0x2f3ca5,_0x3ba4ac){_0x2f3ca5=_0x2f3ca5-0x0;var _0x11cc85=_0x3904[_0x2f3ca5];return _0x11cc85;};'use strict';var _=require(_0x4390('0x0'));var util=require(_0x4390('0x1'));var logger=require(_0x4390('0x2'))('api');var moment=require(_0x4390('0x3'));var BPromise=require(_0x4390('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4390('0x5'));var rimraf=require(_0x4390('0x6'));var config=require(_0x4390('0x7'));var attributes=require(_0x4390('0x8'));module['exports']=function(_0x4e83ad,_0x31b7ed){return _0x4e83ad[_0x4390('0x9')](_0x4390('0xa'),attributes,{'tableName':'voice_musiconhold','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 57042e9..0012912 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(_0x357fac,_0x49078a){var _0x1b2e2f=function(_0x532b3e){while(--_0x532b3e){_0x357fac['push'](_0x357fac['shift']());}};_0x1b2e2f(++_0x49078a);}(_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 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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1a0c7c,_0x4540c8){var _0x5d7ae2=function(_0x547513){while(--_0x547513){_0x1a0c7c['push'](_0x1a0c7c['shift']());}};_0x5d7ae2(++_0x4540c8);}(_0x34e8,0x12c));var _0x834e=function(_0x4a78e7,_0x204e04){_0x4a78e7=_0x4a78e7-0x0;var _0x38ddbc=_0x34e8[_0x4a78e7];return _0x38ddbc;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index fddf3c0..7a8851d 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 _0xe79f=['addAgents','/:id/teams','addTeams','update','delete','exports','multer','path','express','../../components/interaction/service','../../config/environment','./voicePrefix.controller','index','get','isAuthenticated','describe','/:id','/:id/users','getAgents','getTeams','create','post'];(function(_0x381f4b,_0x5a285a){var _0x2dd1de=function(_0x4bac9a){while(--_0x4bac9a){_0x381f4b['push'](_0x381f4b['shift']());}};_0x2dd1de(++_0x5a285a);}(_0xe79f,0x13a));var _0xfe79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe79f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfe79('0x0'));var util=require('util');var path=require(_0xfe79('0x1'));var timeout=require('connect-timeout');var express=require(_0xfe79('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfe79('0x3'));var config=require(_0xfe79('0x4'));var controller=require(_0xfe79('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xfe79('0x6')]);router[_0xfe79('0x7')]('/describe',auth[_0xfe79('0x8')](),controller[_0xfe79('0x9')]);router['get'](_0xfe79('0xa'),auth[_0xfe79('0x8')](),controller['show']);router['get'](_0xfe79('0xb'),auth[_0xfe79('0x8')](),controller[_0xfe79('0xc')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0xfe79('0xd')]);router['post']('/',auth[_0xfe79('0x8')](),controller[_0xfe79('0xe')]);router[_0xfe79('0xf')](_0xfe79('0xb'),auth['isAuthenticated'](),controller[_0xfe79('0x10')]);router[_0xfe79('0xf')](_0xfe79('0x11'),auth[_0xfe79('0x8')](),controller[_0xfe79('0x12')]);router['put'](_0xfe79('0xa'),auth[_0xfe79('0x8')](),controller[_0xfe79('0x13')]);router[_0xfe79('0x14')](_0xfe79('0xa'),auth[_0xfe79('0x8')](),controller['destroy']);router['delete'](_0xfe79('0xb'),auth['isAuthenticated'](),controller['removeAgents']);router[_0xfe79('0x14')](_0xfe79('0x11'),auth['isAuthenticated'](),controller['removeTeams']);module[_0xfe79('0x15')]=router; \ No newline at end of file +var _0x4c72=['delete','removeAgents','removeTeams','exports','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/users','getAgents','getTeams','post','addAgents','/:id/teams','addTeams','put','update'];(function(_0x3df999,_0x34a620){var _0x3ad0e1=function(_0x58df02){while(--_0x58df02){_0x3df999['push'](_0x3df999['shift']());}};_0x3ad0e1(++_0x34a620);}(_0x4c72,0x1e4));var _0x24c7=function(_0x20b16a,_0x52050d){_0x20b16a=_0x20b16a-0x0;var _0x31285e=_0x4c72[_0x20b16a];return _0x31285e;};'use strict';var multer=require(_0x24c7('0x0'));var util=require('util');var path=require(_0x24c7('0x1'));var timeout=require(_0x24c7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x24c7('0x3'));var config=require(_0x24c7('0x4'));var controller=require('./voicePrefix.controller');router[_0x24c7('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x24c7('0x5')](_0x24c7('0x6'),auth[_0x24c7('0x7')](),controller[_0x24c7('0x8')]);router['get'](_0x24c7('0x9'),auth[_0x24c7('0x7')](),controller[_0x24c7('0xa')]);router[_0x24c7('0x5')](_0x24c7('0xb'),auth[_0x24c7('0x7')](),controller[_0x24c7('0xc')]);router[_0x24c7('0x5')]('/:id/teams',auth[_0x24c7('0x7')](),controller[_0x24c7('0xd')]);router[_0x24c7('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x24c7('0xb'),auth[_0x24c7('0x7')](),controller[_0x24c7('0xf')]);router['post'](_0x24c7('0x10'),auth['isAuthenticated'](),controller[_0x24c7('0x11')]);router[_0x24c7('0x12')](_0x24c7('0x9'),auth['isAuthenticated'](),controller[_0x24c7('0x13')]);router[_0x24c7('0x14')](_0x24c7('0x9'),auth[_0x24c7('0x7')](),controller['destroy']);router[_0x24c7('0x14')](_0x24c7('0xb'),auth['isAuthenticated'](),controller[_0x24c7('0x15')]);router[_0x24c7('0x14')](_0x24c7('0x10'),auth['isAuthenticated'](),controller[_0x24c7('0x16')]);module[_0x24c7('0x17')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index ed76368..3578d40 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 _0xd9c7=['VIRTUAL','system-','getDataValue','sequelize','exports','STRING','name'];(function(_0x226087,_0x4dacbe){var _0x4d7e1f=function(_0xb391e2){while(--_0xb391e2){_0x226087['push'](_0x226087['shift']());}};_0x4d7e1f(++_0x4dacbe);}(_0xd9c7,0x137));var _0x7d9c=function(_0x1c415f,_0x1905e1){_0x1c415f=_0x1c415f-0x0;var _0x30c77d=_0xd9c7[_0x1c415f];return _0x30c77d;};'use strict';var Sequelize=require(_0x7d9c('0x0'));module[_0x7d9c('0x1')]={'name':{'type':Sequelize[_0x7d9c('0x2')],'allowNull':![],'unique':_0x7d9c('0x3')},'prefix':{'type':Sequelize[_0x7d9c('0x4')],'get':function(_0x1de257){return _0x7d9c('0x5')+this[_0x7d9c('0x6')]('name')+'-';}},'description':{'type':Sequelize[_0x7d9c('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6a7b=['sequelize','exports','STRING','VIRTUAL','system-','getDataValue','INTEGER'];(function(_0x430b03,_0x26b677){var _0x1e9c82=function(_0x37c6bf){while(--_0x37c6bf){_0x430b03['push'](_0x430b03['shift']());}};_0x1e9c82(++_0x26b677);}(_0x6a7b,0x103));var _0xb6a7=function(_0xb78f74,_0x2548d1){_0xb78f74=_0xb78f74-0x0;var _0x465eb1=_0x6a7b[_0xb78f74];return _0x465eb1;};'use strict';var Sequelize=require(_0xb6a7('0x0'));module[_0xb6a7('0x1')]={'name':{'type':Sequelize[_0xb6a7('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xb6a7('0x3')],'get':function(_0x1c9d49){return _0xb6a7('0x4')+this[_0xb6a7('0x5')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xb6a7('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xb6a7('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index a99fa9b..bba4d12 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 _0x7d25=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','json','limit','undefined','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','VoicePrefix','includeAll','findAll','catch','show','include','find','describe','transaction','create','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','context','app','system','description','appdata','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','NoOp','goto','${EXTEN:','charAt','system-','sequelize','findById','addAgents','params','omit','spread','ids','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','User','getTeams','findOne','addTeams','Agents','online','interface','each','upsert','forEach','removeTeams','Team','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','value','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x1073b7,_0x52dfd9){var _0xa706db=function(_0x35e6ba){while(--_0x35e6ba){_0x1073b7['push'](_0x1073b7['shift']());}};_0xa706db(++_0x52dfd9);}(_0x7d25,0x8a));var _0x57d2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x7d25[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57d2('0x0'));var zipdir=require(_0x57d2('0x1'));var jsonpatch=require(_0x57d2('0x2'));var rp=require(_0x57d2('0x3'));var moment=require(_0x57d2('0x4'));var BPromise=require(_0x57d2('0x5'));var Mustache=require(_0x57d2('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x57d2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57d2('0x8'));var squel=require(_0x57d2('0x9'));var crypto=require(_0x57d2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x57d2('0xb'));var querystring=require('querystring');var Papa=require(_0x57d2('0xc'));var Redis=require(_0x57d2('0xd'));var authService=require(_0x57d2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x57d2('0xf'));var hardwareService=require(_0x57d2('0x10'));var logger=require(_0x57d2('0x11'))(_0x57d2('0x12'));var utils=require(_0x57d2('0x13'));var config=require(_0x57d2('0x14'));var licenseUtil=require(_0x57d2('0x15'));var db=require(_0x57d2('0x16'))['db'];config[_0x57d2('0x17')]=_[_0x57d2('0x18')](config[_0x57d2('0x17')],{'host':_0x57d2('0x19'),'port':0x18eb});var socket=require(_0x57d2('0x1a'))(new Redis(config[_0x57d2('0x17')]));require(_0x57d2('0x1b'))[_0x57d2('0x1c')](socket);function respondWithStatusCode(_0x5382d9,_0x5b940e){_0x5b940e=_0x5b940e||0xcc;return function(_0x6fad35){if(_0x6fad35){return _0x5382d9[_0x57d2('0x1d')](_0x5b940e);}return _0x5382d9['status'](_0x5b940e)[_0x57d2('0x1e')]();};}function respondWithResult(_0x319489,_0x4bb8f7){_0x4bb8f7=_0x4bb8f7||0xc8;return function(_0x3e12c6){if(_0x3e12c6){return _0x319489['status'](_0x4bb8f7)[_0x57d2('0x1f')](_0x3e12c6);}};}function respondWithFilteredResult(_0x4b4fe0,_0x2ab5f0){return function(_0x7d4cf1){if(_0x7d4cf1){var _0x2ecfdf=typeof _0x2ab5f0['offset']==='undefined'&&typeof _0x2ab5f0[_0x57d2('0x20')]===_0x57d2('0x21');var _0x2662cd=_0x7d4cf1[_0x57d2('0x22')];var _0x5b1b9d=_0x2ecfdf?0x0:_0x2ab5f0[_0x57d2('0x23')];var _0xcf924f=_0x2ecfdf?_0x7d4cf1['count']:_0x2ab5f0['offset']+_0x2ab5f0[_0x57d2('0x20')];var _0x326d49;if(_0xcf924f>=_0x2662cd){_0xcf924f=_0x2662cd;_0x326d49=0xc8;}else{_0x326d49=0xce;}_0x4b4fe0[_0x57d2('0x24')](_0x326d49);return _0x4b4fe0[_0x57d2('0x25')](_0x57d2('0x26'),_0x5b1b9d+'-'+_0xcf924f+'/'+_0x2662cd)[_0x57d2('0x1f')](_0x7d4cf1);}return null;};}function patchUpdates(_0x32c7c8){return function(_0x31d2cf){try{jsonpatch[_0x57d2('0x27')](_0x31d2cf,_0x32c7c8,!![]);}catch(_0x26718e){return BPromise[_0x57d2('0x28')](_0x26718e);}return _0x31d2cf[_0x57d2('0x29')]();};}function saveUpdates(_0x12ff19,_0x473df2){return function(_0x5327ea){if(_0x5327ea){return _0x5327ea[_0x57d2('0x2a')](_0x12ff19)[_0x57d2('0x2b')](function(_0x3c7de8){return _0x3c7de8;});}return null;};}function removeEntity(_0x452d5e,_0x4363b3){return function(_0x5058be){if(_0x5058be){return _0x5058be[_0x57d2('0x2c')]()[_0x57d2('0x2b')](function(){var _0x995928=_0x5058be[_0x57d2('0x2d')]({'plain':!![]});var _0x18d500=_0x57d2('0x2e');return db[_0x57d2('0x2f')]['destroy']({'where':{'type':_0x18d500,'resourceId':_0x995928['id']}})[_0x57d2('0x2b')](function(){return _0x5058be;});})[_0x57d2('0x2b')](function(){_0x452d5e[_0x57d2('0x24')](0xcc)[_0x57d2('0x1e')]();});}};}function handleEntityNotFound(_0x1957a6,_0x7c33f3){return function(_0x1dd6cb){if(!_0x1dd6cb){_0x1957a6[_0x57d2('0x1d')](0x194);}return _0x1dd6cb;};}function handleError(_0x1d2bdb,_0x2cf9d9){_0x2cf9d9=_0x2cf9d9||0x1f4;return function(_0x574589){logger[_0x57d2('0x30')](_0x574589[_0x57d2('0x31')]);if(_0x574589[_0x57d2('0x32')]){delete _0x574589[_0x57d2('0x32')];}_0x1d2bdb['status'](_0x2cf9d9)[_0x57d2('0x33')](_0x574589);};}exports[_0x57d2('0x34')]=function(_0x21152e,_0x290c2d){var _0xb3051c={},_0x40f3f2={},_0x3cbc4b={'count':0x0,'rows':[]};var _0x36c0d7=_[_0x57d2('0x35')](db['VoicePrefix'][_0x57d2('0x36')],function(_0x213c99){return{'name':_0x213c99['fieldName'],'type':_0x213c99[_0x57d2('0x37')][_0x57d2('0x38')]};});_0x40f3f2['model']=_[_0x57d2('0x35')](_0x36c0d7,_0x57d2('0x32'));_0x40f3f2[_0x57d2('0x39')]=_[_0x57d2('0x3a')](_0x21152e[_0x57d2('0x39')]);_0x40f3f2['filters']=_['intersection'](_0x40f3f2['model'],_0x40f3f2['query']);_0xb3051c[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x40f3f2[_0x57d2('0x3d')],qs[_0x57d2('0x3e')](_0x21152e[_0x57d2('0x39')]['fields']));_0xb3051c[_0x57d2('0x3b')]=_0xb3051c['attributes'][_0x57d2('0x3f')]?_0xb3051c[_0x57d2('0x3b')]:_0x40f3f2[_0x57d2('0x3d')];if(!_0x21152e['query'][_0x57d2('0x40')](_0x57d2('0x41'))){_0xb3051c['limit']=qs[_0x57d2('0x20')](_0x21152e[_0x57d2('0x39')][_0x57d2('0x20')]);_0xb3051c[_0x57d2('0x23')]=qs[_0x57d2('0x23')](_0x21152e[_0x57d2('0x39')]['offset']);}_0xb3051c[_0x57d2('0x42')]=qs['sort'](_0x21152e[_0x57d2('0x39')][_0x57d2('0x43')]);_0xb3051c[_0x57d2('0x44')]=qs[_0x57d2('0x45')](_[_0x57d2('0x46')](_0x21152e['query'],_0x40f3f2[_0x57d2('0x45')]),_0x36c0d7);if(_0x21152e[_0x57d2('0x39')]['filter']){_0xb3051c[_0x57d2('0x44')]=_[_0x57d2('0x47')](_0xb3051c[_0x57d2('0x44')],{'$or':_['map'](_0x36c0d7,function(_0x226e56){if(_0x226e56[_0x57d2('0x37')]!==_0x57d2('0x48')){var _0x3281c9={};_0x3281c9[_0x226e56['name']]={'$like':'%'+_0x21152e['query'][_0x57d2('0x49')]+'%'};return _0x3281c9;}})});}_0xb3051c=_[_0x57d2('0x47')]({},_0xb3051c,_0x21152e[_0x57d2('0x4a')]);var _0x5795e7={'where':_0xb3051c['where']};return db[_0x57d2('0x4b')]['count'](_0x5795e7)[_0x57d2('0x2b')](function(_0x1bb8ad){_0x3cbc4b[_0x57d2('0x22')]=_0x1bb8ad;if(_0x21152e[_0x57d2('0x39')][_0x57d2('0x4c')]){_0xb3051c['include']=[{'all':!![]}];}return db[_0x57d2('0x4b')][_0x57d2('0x4d')](_0xb3051c);})['then'](function(_0x775f8c){_0x3cbc4b['rows']=_0x775f8c;return _0x3cbc4b;})[_0x57d2('0x2b')](respondWithFilteredResult(_0x290c2d,_0xb3051c))[_0x57d2('0x4e')](handleError(_0x290c2d,null));};exports[_0x57d2('0x4f')]=function(_0x323273,_0x58aa4e){var _0x541772={'raw':![],'where':{'id':_0x323273['params']['id']}},_0x3d8256={};_0x3d8256['model']=_[_0x57d2('0x3a')](db['VoicePrefix']['rawAttributes']);_0x3d8256[_0x57d2('0x39')]=_['keys'](_0x323273[_0x57d2('0x39')]);_0x3d8256['filters']=_[_0x57d2('0x3c')](_0x3d8256['model'],_0x3d8256['query']);_0x541772[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x3d8256[_0x57d2('0x3d')],qs[_0x57d2('0x3e')](_0x323273[_0x57d2('0x39')][_0x57d2('0x3e')]));_0x541772['attributes']=_0x541772[_0x57d2('0x3b')][_0x57d2('0x3f')]?_0x541772[_0x57d2('0x3b')]:_0x3d8256[_0x57d2('0x3d')];if(_0x323273[_0x57d2('0x39')][_0x57d2('0x4c')]){_0x541772[_0x57d2('0x50')]=[{'all':!![]}];}_0x541772=_[_0x57d2('0x47')]({},_0x541772,_0x323273['options']);return db[_0x57d2('0x4b')][_0x57d2('0x51')](_0x541772)['then'](handleEntityNotFound(_0x58aa4e,null))[_0x57d2('0x2b')](respondWithResult(_0x58aa4e,null))['catch'](handleError(_0x58aa4e,null));};exports['destroy']=function(_0x1a1dc7,_0x31f404){return db[_0x57d2('0x4b')][_0x57d2('0x51')]({'where':{'id':_0x1a1dc7['params']['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x31f404,null))[_0x57d2('0x2b')](removeEntity(_0x31f404,null))['catch'](handleError(_0x31f404,null));};exports['describe']=function(_0xd7c79f,_0xb02f43){return db[_0x57d2('0x4b')][_0x57d2('0x52')]()[_0x57d2('0x2b')](respondWithResult(_0xb02f43,null))[_0x57d2('0x4e')](handleError(_0xb02f43,null));};exports['create']=function(_0x4b377f,_0x5a5edb){var _0x30482c;return db['sequelize'][_0x57d2('0x53')](function(_0x2ef710){return db['VoicePrefix'][_0x57d2('0x54')](_0x4b377f[_0x57d2('0x55')],{'transaction':_0x2ef710})[_0x57d2('0x2b')](function(_0x557f79){_0x30482c=_0x557f79[_0x57d2('0x2d')]({'plain':!![]});return db[_0x57d2('0x56')][_0x57d2('0x51')]({'where':{'id':_0x30482c[_0x57d2('0x57')]},'raw':!![]})[_0x57d2('0x2b')](function(_0x2e90eb){return createVoicePrefixExtensions(_0x30482c,_0x2e90eb,_0x2ef710);});});})[_0x57d2('0x2b')](function(){var _0x2b93c4=_0x4b377f[_0x57d2('0x58')]['get']({'plain':!![]});if(!_0x2b93c4)throw new Error(_0x57d2('0x59'));if(_0x2b93c4[_0x57d2('0x5a')]===_0x57d2('0x58')){var _0x5e3289=_0x30482c;return db[_0x57d2('0x5b')][_0x57d2('0x51')]({'where':{'name':_0x57d2('0x2e'),'userProfileId':_0x2b93c4['userProfileId']},'raw':!![]})['then'](function(_0x56ddfd){if(_0x56ddfd&&_0x56ddfd[_0x57d2('0x5c')]===0x0){return db['UserProfileResource'][_0x57d2('0x54')]({'name':_0x5e3289['name'],'resourceId':_0x5e3289['id'],'type':_0x56ddfd[_0x57d2('0x32')],'sectionId':_0x56ddfd['id']},{})['then'](function(){return _0x30482c;});}else{return _0x30482c;}})[_0x57d2('0x4e')](function(_0x430f85){logger[_0x57d2('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x430f85);throw _0x430f85;});}return _0x30482c;})['then'](respondWithResult(_0x5a5edb,null))[_0x57d2('0x4e')](handleError(_0x5a5edb,null));};function Extension(_0x2c1710,_0x3b57fa,_0x227a02,_0x3e5d71){this[_0x57d2('0x5d')]='from-sip';this['exten']=_0x2c1710;this[_0x57d2('0x5e')]=_0x227a02;this[_0x57d2('0x37')]=_0x57d2('0x5f');this[_0x57d2('0x60')]='Voice\x20Prefix\x20Extension';this['priority']=_0x3b57fa;this[_0x57d2('0x61')]=_0x3e5d71;}function createVoicePrefixExtensions(_0x301e43,_0x4f6b8a,_0xad397){return new BPromise(function(_0x28fcdb,_0x15e3b6){var _0x472e5d=new Extension(formatPrefixName(_0x301e43['prefix']),0x1,'NoOp','Voice\x20Prefix');_0x472e5d['VoicePrefixId']=_0x301e43['id'];return db[_0x57d2('0x56')][_0x57d2('0x54')](_0x472e5d,{'transaction':_0xad397})[_0x57d2('0x2b')](function(_0xa57b70){var _0xd13626=_0xa57b70[_0x57d2('0x2d')]({'plain':!![]});var _0x2737ab=_['map'](addVoicePrefixExtensions(_0x301e43,_0x4f6b8a),function(_0x35808a){_0x35808a['VoiceExtensionId']=_0xd13626['id'];_0x35808a[_0x57d2('0x62')]=_0x301e43['id'];return _0x35808a;});return db['VoiceExtension'][_0x57d2('0x63')](_0x2737ab,{'transaction':_0xad397})[_0x57d2('0x2b')](function(_0x453e6c){if(!_0x453e6c){return _0x15e3b6(_0x57d2('0x64'));}else{return _0x28fcdb(_0x453e6c);}})[_0x57d2('0x4e')](function(_0x145370){return _0x15e3b6(_0x145370);});});;});};function addVoicePrefixExtensions(_0x5e697c,_0x2a481c){var _0x24d3bf=[];var _0x27b27a=formatPrefixName(_0x5e697c[_0x57d2('0x65')]);_0x24d3bf[_0x57d2('0x66')](new Extension(_0x27b27a,0x2,_0x57d2('0x67'),_0x57d2('0x68')+_0x5e697c[_0x57d2('0x32')]));if(_0x5e697c[_0x57d2('0x69')]){_0x24d3bf['push'](new Extension(_0x27b27a,0x3,_0x57d2('0x67'),'PREFIX-CALLERIDALL='+_0x5e697c['callerIdAll']));}else{_0x24d3bf['push'](new Extension(_0x27b27a,0x3,_0x57d2('0x6a'),'No\x20callerid\x20available'));}_0x24d3bf[_0x57d2('0x66')](new Extension(_0x27b27a,0x4,_0x57d2('0x6b'),_0x2a481c['context']+','+_0x57d2('0x6c')+(0x8+_0x5e697c[_0x57d2('0x32')][_0x57d2('0x3f')])+'}'+','+0x1));return _0x24d3bf;}function formatPrefixName(_0x13741f){var _0x5eb7a3='_';for(var _0x3afeb9=0x0;_0x3afeb9<_0x13741f[_0x57d2('0x3f')];_0x3afeb9++){if(_0x13741f['charAt'](_0x3afeb9)=='-'){_0x5eb7a3+=_0x13741f['charAt'](_0x3afeb9);}else{_0x5eb7a3+='['+_0x13741f[_0x57d2('0x6d')](_0x3afeb9)+']';}}_0x5eb7a3+='.';return _0x5eb7a3;}exports[_0x57d2('0x2a')]=function(_0x481c6b,_0x46c7de,_0x5a1283){var _0x360ee0=_0x481c6b[_0x57d2('0x55')];_0x360ee0[_0x57d2('0x65')]=_0x57d2('0x6e')+_0x360ee0[_0x57d2('0x32')]+'-';return db[_0x57d2('0x6f')][_0x57d2('0x53')](function(_0x3bec6f){return db[_0x57d2('0x4b')][_0x57d2('0x2a')](_0x360ee0,{'where':{'id':_0x360ee0['id']},'transaction':_0x3bec6f})[_0x57d2('0x2b')](function(){return db['VoiceExtension'][_0x57d2('0x2c')]({'where':{'VoicePrefixId':_0x360ee0['id']},'transaction':_0x3bec6f})[_0x57d2('0x2b')](function(){return db[_0x57d2('0x56')][_0x57d2('0x51')]({'where':{'id':_0x360ee0[_0x57d2('0x57')]},'raw':!![]})[_0x57d2('0x2b')](function(_0x42666b){return createVoicePrefixExtensions(_0x360ee0,_0x42666b,_0x3bec6f);});});});})[_0x57d2('0x2b')](function(){return db[_0x57d2('0x4b')][_0x57d2('0x70')](_0x360ee0['id']);})[_0x57d2('0x2b')](respondWithResult(_0x46c7de,null))[_0x57d2('0x4e')](handleError(_0x46c7de,null));};exports[_0x57d2('0x71')]=function(_0x26da1b,_0x1bf74a,_0x144229){return db['VoicePrefix'][_0x57d2('0x51')]({'where':{'id':_0x26da1b[_0x57d2('0x72')]['id']}})['then'](handleEntityNotFound(_0x1bf74a,null))[_0x57d2('0x2b')](function(_0x17b3c1){if(_0x17b3c1){return _0x17b3c1[_0x57d2('0x71')](_0x26da1b[_0x57d2('0x55')]['ids'],_[_0x57d2('0x73')](_0x26da1b['body'],['ids','id'])||{})[_0x57d2('0x74')](function(_0x4f30e8){for(var _0x282457=0x0;_0x282457<_0x26da1b[_0x57d2('0x55')][_0x57d2('0x75')][_0x57d2('0x3f')];_0x282457+=0x1){socket['emit'](_0x57d2('0x76'),{'UserId':Number(_0x26da1b[_0x57d2('0x55')][_0x57d2('0x75')][_0x282457]),'VoicePrefixId':Number(_0x26da1b[_0x57d2('0x72')]['id'])});}return _0x4f30e8;});}})[_0x57d2('0x2b')](respondWithResult(_0x1bf74a,null))[_0x57d2('0x4e')](handleError(_0x1bf74a,null));};exports[_0x57d2('0x77')]=function(_0x41ca89,_0x1d147f,_0x261850){return db['VoicePrefix'][_0x57d2('0x51')]({'where':{'id':_0x41ca89[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x1d147f,null))[_0x57d2('0x2b')](function(_0x468990){if(_0x468990){return _0x468990[_0x57d2('0x77')](_0x41ca89[_0x57d2('0x39')][_0x57d2('0x75')])[_0x57d2('0x2b')](function(){if(_[_0x57d2('0x78')](_0x41ca89[_0x57d2('0x39')][_0x57d2('0x75')])){for(var _0x54edaf=0x0;_0x54edaf<_0x41ca89['query'][_0x57d2('0x75')][_0x57d2('0x3f')];_0x54edaf+=0x1){socket[_0x57d2('0x79')](_0x57d2('0x7a'),{'UserId':Number(_0x41ca89[_0x57d2('0x39')]['ids'][_0x54edaf]),'VoicePrefixId':Number(_0x41ca89['params']['id'])});}}else{socket[_0x57d2('0x79')](_0x57d2('0x7a'),{'UserId':Number(_0x41ca89[_0x57d2('0x39')][_0x57d2('0x75')]),'VoicePrefixId':Number(_0x41ca89[_0x57d2('0x72')]['id'])});}});}})[_0x57d2('0x2b')](respondWithStatusCode(_0x1d147f,null))['catch'](handleError(_0x1d147f,null));};exports[_0x57d2('0x7b')]=function(_0x2f5625,_0x5bb7cd,_0x4913c0){var _0x5ac6ee={};var _0x5b3cc6={};var _0xa557d6;var _0x4a7e00;return db[_0x57d2('0x4b')]['findOne']({'where':{'id':_0x2f5625[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x5bb7cd,null))[_0x57d2('0x2b')](function(_0x1dbe31){if(_0x1dbe31){_0xa557d6=_0x1dbe31;_0x5b3cc6[_0x57d2('0x3d')]=_['keys'](db[_0x57d2('0x7c')][_0x57d2('0x36')]);_0x5b3cc6[_0x57d2('0x39')]=_['keys'](_0x2f5625[_0x57d2('0x39')]);_0x5b3cc6[_0x57d2('0x45')]=_[_0x57d2('0x3c')](_0x5b3cc6[_0x57d2('0x3d')],_0x5b3cc6[_0x57d2('0x39')]);_0x5ac6ee[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x5b3cc6['model'],qs['fields'](_0x2f5625['query'][_0x57d2('0x3e')]));_0x5ac6ee[_0x57d2('0x3b')]=_0x5ac6ee[_0x57d2('0x3b')]['length']?_0x5ac6ee[_0x57d2('0x3b')]:_0x5b3cc6[_0x57d2('0x3d')];_0x5ac6ee[_0x57d2('0x42')]=qs[_0x57d2('0x43')](_0x2f5625[_0x57d2('0x39')][_0x57d2('0x43')]);_0x5ac6ee[_0x57d2('0x44')]=qs[_0x57d2('0x45')](_['pick'](_0x2f5625[_0x57d2('0x39')],_0x5b3cc6[_0x57d2('0x45')]));if(_0x2f5625[_0x57d2('0x39')][_0x57d2('0x49')]){_0x5ac6ee['where']=_['merge'](_0x5ac6ee[_0x57d2('0x44')],{'$or':_['map'](_0x5ac6ee[_0x57d2('0x3b')],function(_0x598d62){var _0x3a35d7={};_0x3a35d7[_0x598d62]={'$like':'%'+_0x2f5625[_0x57d2('0x39')][_0x57d2('0x49')]+'%'};return _0x3a35d7;})});}_0x5ac6ee=_['merge']({},_0x5ac6ee,_0x2f5625[_0x57d2('0x4a')]);return _0xa557d6['getAgents'](_0x5ac6ee);}})[_0x57d2('0x2b')](function(_0xe71357){if(_0xe71357){_0x4a7e00=_0xe71357[_0x57d2('0x3f')];if(!_0x2f5625[_0x57d2('0x39')][_0x57d2('0x40')](_0x57d2('0x41'))){_0x5ac6ee[_0x57d2('0x20')]=qs[_0x57d2('0x20')](_0x2f5625[_0x57d2('0x39')][_0x57d2('0x20')]);_0x5ac6ee[_0x57d2('0x23')]=qs[_0x57d2('0x23')](_0x2f5625[_0x57d2('0x39')][_0x57d2('0x23')]);}return _0xa557d6[_0x57d2('0x7b')](_0x5ac6ee);}})['then'](function(_0x3a7d89){if(_0x3a7d89){return _0x3a7d89?{'count':_0x4a7e00,'rows':_0x3a7d89}:null;}})[_0x57d2('0x2b')](respondWithResult(_0x5bb7cd,null))[_0x57d2('0x4e')](handleError(_0x5bb7cd,null));};exports[_0x57d2('0x7d')]=function(_0x4d83cf,_0x93bc52,_0x362b77){var _0x2728ba={};var _0x4f6585={};var _0x34f39a;var _0x1a90cb;return db[_0x57d2('0x4b')][_0x57d2('0x7e')]({'where':{'id':_0x4d83cf[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x93bc52,null))[_0x57d2('0x2b')](function(_0x1ba236){if(_0x1ba236){_0x34f39a=_0x1ba236;_0x4f6585[_0x57d2('0x3d')]=_[_0x57d2('0x3a')](db['Team']['rawAttributes']);_0x4f6585[_0x57d2('0x39')]=_[_0x57d2('0x3a')](_0x4d83cf[_0x57d2('0x39')]);_0x4f6585[_0x57d2('0x45')]=_['intersection'](_0x4f6585[_0x57d2('0x3d')],_0x4f6585[_0x57d2('0x39')]);_0x2728ba[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x4f6585[_0x57d2('0x3d')],qs['fields'](_0x4d83cf['query']['fields']));_0x2728ba['attributes']=_0x2728ba['attributes'][_0x57d2('0x3f')]?_0x2728ba['attributes']:_0x4f6585[_0x57d2('0x3d')];_0x2728ba[_0x57d2('0x42')]=qs['sort'](_0x4d83cf[_0x57d2('0x39')]['sort']);_0x2728ba[_0x57d2('0x44')]=qs[_0x57d2('0x45')](_[_0x57d2('0x46')](_0x4d83cf[_0x57d2('0x39')],_0x4f6585['filters']));if(_0x4d83cf[_0x57d2('0x39')]['filter']){_0x2728ba['where']=_[_0x57d2('0x47')](_0x2728ba[_0x57d2('0x44')],{'$or':_[_0x57d2('0x35')](_0x2728ba[_0x57d2('0x3b')],function(_0x127224){var _0x47ee55={};_0x47ee55[_0x127224]={'$like':'%'+_0x4d83cf[_0x57d2('0x39')][_0x57d2('0x49')]+'%'};return _0x47ee55;})});}_0x2728ba=_[_0x57d2('0x47')]({},_0x2728ba,_0x4d83cf[_0x57d2('0x4a')]);return _0x34f39a[_0x57d2('0x7d')](_0x2728ba);}})[_0x57d2('0x2b')](function(_0x4773a4){if(_0x4773a4){_0x1a90cb=_0x4773a4[_0x57d2('0x3f')];if(!_0x4d83cf['query']['hasOwnProperty'](_0x57d2('0x41'))){_0x2728ba['limit']=qs[_0x57d2('0x20')](_0x4d83cf[_0x57d2('0x39')][_0x57d2('0x20')]);_0x2728ba[_0x57d2('0x23')]=qs[_0x57d2('0x23')](_0x4d83cf['query'][_0x57d2('0x23')]);}return _0x34f39a['getTeams'](_0x2728ba);}})[_0x57d2('0x2b')](function(_0x888a75){if(_0x888a75){return _0x888a75?{'count':_0x1a90cb,'rows':_0x888a75}:null;}})[_0x57d2('0x2b')](respondWithResult(_0x93bc52,null))[_0x57d2('0x4e')](handleError(_0x93bc52,null));};exports[_0x57d2('0x7f')]=function(_0x37608b,_0x5cb4b6,_0xa4b4fd){var _0x3c9d18=_0x37608b[_0x57d2('0x55')][_0x57d2('0x75')];var _0x55f7df;return db['Team']['findAll']({'where':{'id':_0x3c9d18},'attributes':['id'],'include':[{'model':db[_0x57d2('0x7c')],'as':_0x57d2('0x80'),'attributes':['id',_0x57d2('0x32'),_0x57d2('0x81'),'voicePause',_0x57d2('0x82')],'raw':!![]}]})[_0x57d2('0x2b')](function(_0x178706){if(_0x178706){_0x55f7df=_0x178706;var _0xa92185=_['flatMap'](_0x178706,function(_0x3865c7){var _0x1d9c66=_0x3865c7[_0x57d2('0x2d')]({'plain':!![]});return _0x1d9c66[_0x57d2('0x80')];});return db['VoicePrefix'][_0x57d2('0x51')]({'where':{'id':_0x37608b['params']['id']}})['then'](function(_0x5a4689){return db[_0x57d2('0x6f')][_0x57d2('0x53')](function(_0x488dcd){return _0x5a4689['addTeams'](_0x3c9d18,{'transaction':_0x488dcd})[_0x57d2('0x2b')](function(){return BPromise[_0x57d2('0x83')](_0x55f7df,function(_0x23a448){return db['TeamVoicePrefix'][_0x57d2('0x84')]({'TeamId':_0x23a448['id'],'VoicePrefixId':_0x37608b[_0x57d2('0x72')]['id']},{'transaction':_0x488dcd});});})[_0x57d2('0x2b')](function(){return BPromise[_0x57d2('0x83')](_0xa92185,function(_0xa269b5){return db['UserVoicePrefix']['findOrCreate']({'where':{'UserId':_0xa269b5['id'],'VoicePrefixId':_0x37608b[_0x57d2('0x72')]['id']},'transaction':_0x488dcd});});})[_0x57d2('0x2b')](function(){_0xa92185[_0x57d2('0x85')](function(_0x434389){socket['emit'](_0x57d2('0x76'),{'UserId':_0x434389['id'],'VoicePrefixId':_0x5a4689['id']});});});});});}})[_0x57d2('0x2b')](respondWithStatusCode(_0x5cb4b6,null))['catch'](handleError(_0x5cb4b6,null));};exports[_0x57d2('0x86')]=function(_0x29b37c,_0x531b42,_0x120e28){return db[_0x57d2('0x87')][_0x57d2('0x4d')]({'where':{'id':_0x29b37c[_0x57d2('0x39')][_0x57d2('0x75')]},'attributes':['id'],'include':[{'model':db[_0x57d2('0x7c')],'as':_0x57d2('0x80'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x531b42,null))[_0x57d2('0x2b')](function(_0x2809c1){var _0x5444bf=_[_0x57d2('0x35')](_0x2809c1,'id');var _0x3da7ba=[];var _0x2fc3b5=[];var _0x41ba89=squel['select']();_0x41ba89[_0x57d2('0x88')]('tq.TeamId')[_0x57d2('0x89')](_0x57d2('0x8a'),'tq')[_0x57d2('0x8b')](_0x57d2('0x8c'),'ut',_0x57d2('0x8d'))[_0x57d2('0x44')](_0x57d2('0x8e'),_0x29b37c[_0x57d2('0x72')]['id']);for(var _0x112218=0x0;_0x112218<_0x2809c1[_0x57d2('0x3f')];_0x112218+=0x1){let _0x57314b=_0x2809c1[_0x112218];for(var _0x3acffd=0x0;_0x3acffd<_0x57314b[_0x57d2('0x80')]['length'];_0x3acffd+=0x1){let _0x447051=_0x57314b[_0x57d2('0x80')][_0x3acffd];var _0x511494=_0x41ba89[_0x57d2('0x8f')]();_0x511494[_0x57d2('0x44')](_0x57d2('0x90'),_0x447051['id']);_0x2fc3b5[_0x57d2('0x66')](db['sequelize'][_0x57d2('0x39')](_0x511494[_0x57d2('0x91')](),{'type':db['sequelize'][_0x57d2('0x92')][_0x57d2('0x93')]})[_0x57d2('0x2b')](function(_0x13aec4){if(_0x13aec4[_0x57d2('0x3f')]===0x1){return _0x447051['id'];}else{var _0x4e3497=_[_0x57d2('0x94')](_[_0x57d2('0x35')](_0x13aec4,'TeamId'),function(_0xb122b9){return _[_0x57d2('0x95')](_0x5444bf,_0xb122b9);});if(_0x4e3497){return _0x447051['id'];}}}));}}return BPromise[_0x57d2('0x96')](_0x2fc3b5)['then'](function(_0xdc5333){_0x3da7ba=_(_0x3da7ba)[_0x57d2('0x97')](_0xdc5333)['compact']()[_0x57d2('0x98')]();return db[_0x57d2('0x4b')][_0x57d2('0x51')]({'where':{'id':_0x29b37c[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](function(_0x456ed3){return db['sequelize'][_0x57d2('0x53')](function(_0x376cea){return _0x456ed3[_0x57d2('0x86')](_0x29b37c[_0x57d2('0x39')][_0x57d2('0x75')],{'transaction':_0x376cea})[_0x57d2('0x2b')](function(){if(!_[_0x57d2('0x99')](_0x3da7ba)){return _0x456ed3[_0x57d2('0x77')](_0x3da7ba,{'transaction':_0x376cea});}})[_0x57d2('0x2b')](function(){_0x3da7ba['forEach'](function(_0x5b7f18){socket[_0x57d2('0x79')]('userVoicePrefix:remove',{'UserId':_0x5b7f18,'VoicePrefixId':_0x456ed3['id']});});});});});});})[_0x57d2('0x2b')](respondWithStatusCode(_0x531b42,null))['catch'](handleError(_0x531b42,null));}; \ No newline at end of file +var _0xe1e3=['union','compact','value','isEmpty','forEach','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','localhost','./voicePrefix.socket','register','sendStatus','status','offset','undefined','count','limit','Content-Range','json','reject','update','then','UserProfileResource','destroy','end','name','index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','VoicePrefix','includeAll','findAll','rows','show','filters','length','merge','find','catch','params','describe','create','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','prefix','push','CDR(prefix)=','callerIdAll','Set','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','body','system-','sequelize','transaction','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','User','getTeams','findOne','Team','addTeams','Agents','online','voicePause','interface','flatMap','TeamVoicePrefix','each','UserVoicePrefix','removeTeams','select','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all'];(function(_0x5c56d8,_0x2c6245){var _0x38c39c=function(_0x1d8ad7){while(--_0x1d8ad7){_0x5c56d8['push'](_0x5c56d8['shift']());}};_0x38c39c(++_0x2c6245);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x4068f7,_0x1bcc1e){_0x4068f7=_0x4068f7-0x0;var _0x4bb14e=_0xe1e3[_0x4068f7];return _0x4bb14e;};'use strict';var emlformat=require(_0x3e1e('0x0'));var rimraf=require(_0x3e1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e1e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e1e('0x3'));var Mustache=require('mustache');var util=require(_0x3e1e('0x4'));var path=require(_0x3e1e('0x5'));var sox=require(_0x3e1e('0x6'));var csv=require(_0x3e1e('0x7'));var ejs=require(_0x3e1e('0x8'));var fs=require('fs');var fs_extra=require(_0x3e1e('0x9'));var _=require('lodash');var squel=require(_0x3e1e('0xa'));var crypto=require(_0x3e1e('0xb'));var jsforce=require(_0x3e1e('0xc'));var deskjs=require(_0x3e1e('0xd'));var toCsv=require(_0x3e1e('0x7'));var querystring=require(_0x3e1e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e1e('0x10'));var logger=require(_0x3e1e('0x11'))(_0x3e1e('0x12'));var utils=require('../../config/utils');var config=require(_0x3e1e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x3e1e('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3e1e('0x15'))[_0x3e1e('0x16')](socket);function respondWithStatusCode(_0x78ee54,_0x50f221){_0x50f221=_0x50f221||0xcc;return function(_0x5b34ec){if(_0x5b34ec){return _0x78ee54[_0x3e1e('0x17')](_0x50f221);}return _0x78ee54[_0x3e1e('0x18')](_0x50f221)['end']();};}function respondWithResult(_0x26cb35,_0x1f0af9){_0x1f0af9=_0x1f0af9||0xc8;return function(_0x570212){if(_0x570212){return _0x26cb35[_0x3e1e('0x18')](_0x1f0af9)['json'](_0x570212);}};}function respondWithFilteredResult(_0x23228c,_0x247daa){return function(_0x1d786c){if(_0x1d786c){var _0x39eaa7=typeof _0x247daa[_0x3e1e('0x19')]===_0x3e1e('0x1a')&&typeof _0x247daa['limit']==='undefined';var _0x4a9497=_0x1d786c[_0x3e1e('0x1b')];var _0x30acbf=_0x39eaa7?0x0:_0x247daa[_0x3e1e('0x19')];var _0x57c660=_0x39eaa7?_0x1d786c[_0x3e1e('0x1b')]:_0x247daa['offset']+_0x247daa[_0x3e1e('0x1c')];var _0x33ec1d;if(_0x57c660>=_0x4a9497){_0x57c660=_0x4a9497;_0x33ec1d=0xc8;}else{_0x33ec1d=0xce;}_0x23228c[_0x3e1e('0x18')](_0x33ec1d);return _0x23228c['set'](_0x3e1e('0x1d'),_0x30acbf+'-'+_0x57c660+'/'+_0x4a9497)[_0x3e1e('0x1e')](_0x1d786c);}return null;};}function patchUpdates(_0xefa098){return function(_0x55dc62){try{jsonpatch['apply'](_0x55dc62,_0xefa098,!![]);}catch(_0x13d7ac){return BPromise[_0x3e1e('0x1f')](_0x13d7ac);}return _0x55dc62['save']();};}function saveUpdates(_0x60e6bc,_0x56ae51){return function(_0x164b15){if(_0x164b15){return _0x164b15[_0x3e1e('0x20')](_0x60e6bc)[_0x3e1e('0x21')](function(_0x159212){return _0x159212;});}return null;};}function removeEntity(_0x43d583,_0x21c898){return function(_0x4ee2b5){if(_0x4ee2b5){return _0x4ee2b5['destroy']()[_0x3e1e('0x21')](function(){var _0x541ef1=_0x4ee2b5['get']({'plain':!![]});var _0x4be84e='VoicePrefixes';return db[_0x3e1e('0x22')][_0x3e1e('0x23')]({'where':{'type':_0x4be84e,'resourceId':_0x541ef1['id']}})['then'](function(){return _0x4ee2b5;});})[_0x3e1e('0x21')](function(){_0x43d583['status'](0xcc)[_0x3e1e('0x24')]();});}};}function handleEntityNotFound(_0x176bb4,_0x53a6ff){return function(_0x43e029){if(!_0x43e029){_0x176bb4[_0x3e1e('0x17')](0x194);}return _0x43e029;};}function handleError(_0x45ed0e,_0x4d3695){_0x4d3695=_0x4d3695||0x1f4;return function(_0xdef39){logger['error'](_0xdef39['stack']);if(_0xdef39['name']){delete _0xdef39[_0x3e1e('0x25')];}_0x45ed0e['status'](_0x4d3695)['send'](_0xdef39);};}exports[_0x3e1e('0x26')]=function(_0x468336,_0x1c57c2){var _0x233b18={},_0xc9762c={},_0x54df5a={'count':0x0,'rows':[]};var _0x5522ba=_['map'](db['VoicePrefix'][_0x3e1e('0x27')],function(_0x417419){return{'name':_0x417419[_0x3e1e('0x28')],'type':_0x417419[_0x3e1e('0x29')][_0x3e1e('0x2a')]};});_0xc9762c[_0x3e1e('0x2b')]=_[_0x3e1e('0x2c')](_0x5522ba,_0x3e1e('0x25'));_0xc9762c['query']=_[_0x3e1e('0x2d')](_0x468336[_0x3e1e('0x2e')]);_0xc9762c['filters']=_[_0x3e1e('0x2f')](_0xc9762c[_0x3e1e('0x2b')],_0xc9762c[_0x3e1e('0x2e')]);_0x233b18[_0x3e1e('0x30')]=_['intersection'](_0xc9762c['model'],qs[_0x3e1e('0x31')](_0x468336[_0x3e1e('0x2e')]['fields']));_0x233b18[_0x3e1e('0x30')]=_0x233b18[_0x3e1e('0x30')]['length']?_0x233b18[_0x3e1e('0x30')]:_0xc9762c[_0x3e1e('0x2b')];if(!_0x468336[_0x3e1e('0x2e')][_0x3e1e('0x32')](_0x3e1e('0x33'))){_0x233b18['limit']=qs[_0x3e1e('0x1c')](_0x468336[_0x3e1e('0x2e')][_0x3e1e('0x1c')]);_0x233b18[_0x3e1e('0x19')]=qs['offset'](_0x468336[_0x3e1e('0x2e')][_0x3e1e('0x19')]);}_0x233b18[_0x3e1e('0x34')]=qs[_0x3e1e('0x35')](_0x468336[_0x3e1e('0x2e')][_0x3e1e('0x35')]);_0x233b18[_0x3e1e('0x36')]=qs['filters'](_[_0x3e1e('0x37')](_0x468336['query'],_0xc9762c['filters']),_0x5522ba);if(_0x468336[_0x3e1e('0x2e')][_0x3e1e('0x38')]){_0x233b18[_0x3e1e('0x36')]=_['merge'](_0x233b18[_0x3e1e('0x36')],{'$or':_[_0x3e1e('0x2c')](_0x5522ba,function(_0x4d372a){if(_0x4d372a[_0x3e1e('0x29')]!==_0x3e1e('0x39')){var _0x4b3d0f={};_0x4b3d0f[_0x4d372a['name']]={'$like':'%'+_0x468336[_0x3e1e('0x2e')]['filter']+'%'};return _0x4b3d0f;}})});}_0x233b18=_['merge']({},_0x233b18,_0x468336[_0x3e1e('0x3a')]);var _0x3d4a8d={'where':_0x233b18[_0x3e1e('0x36')]};return db[_0x3e1e('0x3b')][_0x3e1e('0x1b')](_0x3d4a8d)['then'](function(_0x5b32ad){_0x54df5a[_0x3e1e('0x1b')]=_0x5b32ad;if(_0x468336[_0x3e1e('0x2e')][_0x3e1e('0x3c')]){_0x233b18['include']=[{'all':!![]}];}return db[_0x3e1e('0x3b')][_0x3e1e('0x3d')](_0x233b18);})[_0x3e1e('0x21')](function(_0x4ad5fd){_0x54df5a[_0x3e1e('0x3e')]=_0x4ad5fd;return _0x54df5a;})['then'](respondWithFilteredResult(_0x1c57c2,_0x233b18))['catch'](handleError(_0x1c57c2,null));};exports[_0x3e1e('0x3f')]=function(_0x9053cd,_0x2a1373){var _0x3d6627={'raw':![],'where':{'id':_0x9053cd['params']['id']}},_0x4a2cfb={};_0x4a2cfb['model']=_['keys'](db[_0x3e1e('0x3b')][_0x3e1e('0x27')]);_0x4a2cfb['query']=_['keys'](_0x9053cd[_0x3e1e('0x2e')]);_0x4a2cfb[_0x3e1e('0x40')]=_[_0x3e1e('0x2f')](_0x4a2cfb['model'],_0x4a2cfb[_0x3e1e('0x2e')]);_0x3d6627['attributes']=_[_0x3e1e('0x2f')](_0x4a2cfb[_0x3e1e('0x2b')],qs[_0x3e1e('0x31')](_0x9053cd[_0x3e1e('0x2e')][_0x3e1e('0x31')]));_0x3d6627[_0x3e1e('0x30')]=_0x3d6627['attributes'][_0x3e1e('0x41')]?_0x3d6627[_0x3e1e('0x30')]:_0x4a2cfb['model'];if(_0x9053cd[_0x3e1e('0x2e')][_0x3e1e('0x3c')]){_0x3d6627['include']=[{'all':!![]}];}_0x3d6627=_[_0x3e1e('0x42')]({},_0x3d6627,_0x9053cd[_0x3e1e('0x3a')]);return db[_0x3e1e('0x3b')][_0x3e1e('0x43')](_0x3d6627)['then'](handleEntityNotFound(_0x2a1373,null))[_0x3e1e('0x21')](respondWithResult(_0x2a1373,null))[_0x3e1e('0x44')](handleError(_0x2a1373,null));};exports[_0x3e1e('0x23')]=function(_0xb086d4,_0x4bce83){return db[_0x3e1e('0x3b')][_0x3e1e('0x43')]({'where':{'id':_0xb086d4[_0x3e1e('0x45')]['id']}})[_0x3e1e('0x21')](handleEntityNotFound(_0x4bce83,null))[_0x3e1e('0x21')](removeEntity(_0x4bce83,null))[_0x3e1e('0x44')](handleError(_0x4bce83,null));};exports[_0x3e1e('0x46')]=function(_0x238a7d,_0x5df608){return db[_0x3e1e('0x3b')]['describe']()['then'](respondWithResult(_0x5df608,null))['catch'](handleError(_0x5df608,null));};exports[_0x3e1e('0x47')]=function(_0x17641c,_0x5147a2){var _0x13b076;return db['sequelize']['transaction'](function(_0x3eaf76){return db['VoicePrefix']['create'](_0x17641c['body'],{'transaction':_0x3eaf76})[_0x3e1e('0x21')](function(_0xe577b2){_0x13b076=_0xe577b2[_0x3e1e('0x48')]({'plain':!![]});return db[_0x3e1e('0x49')][_0x3e1e('0x43')]({'where':{'id':_0x13b076[_0x3e1e('0x4a')]},'raw':!![]})[_0x3e1e('0x21')](function(_0x5b71a6){return createVoicePrefixExtensions(_0x13b076,_0x5b71a6,_0x3eaf76);});});})[_0x3e1e('0x21')](function(){var _0x5f5587=_0x17641c[_0x3e1e('0x4b')][_0x3e1e('0x48')]({'plain':!![]});if(!_0x5f5587)throw new Error(_0x3e1e('0x4c'));if(_0x5f5587['role']==='user'){var _0xba8d16=_0x13b076;return db[_0x3e1e('0x4d')]['find']({'where':{'name':_0x3e1e('0x4e'),'userProfileId':_0x5f5587['userProfileId']},'raw':!![]})['then'](function(_0x284cc7){if(_0x284cc7&&_0x284cc7[_0x3e1e('0x4f')]===0x0){return db['UserProfileResource'][_0x3e1e('0x47')]({'name':_0xba8d16['name'],'resourceId':_0xba8d16['id'],'type':_0x284cc7['name'],'sectionId':_0x284cc7['id']},{})[_0x3e1e('0x21')](function(){return _0x13b076;});}else{return _0x13b076;}})['catch'](function(_0x3ab043){logger['error'](_0x3e1e('0x50'),_0x3ab043);throw _0x3ab043;});}return _0x13b076;})['then'](respondWithResult(_0x5147a2,null))[_0x3e1e('0x44')](handleError(_0x5147a2,null));};function Extension(_0x8a4987,_0x48be40,_0x4dfc6d,_0x499abc){this[_0x3e1e('0x51')]=_0x3e1e('0x52');this[_0x3e1e('0x53')]=_0x8a4987;this['app']=_0x4dfc6d;this[_0x3e1e('0x29')]=_0x3e1e('0x54');this[_0x3e1e('0x55')]='Voice\x20Prefix\x20Extension';this['priority']=_0x48be40;this[_0x3e1e('0x56')]=_0x499abc;}function createVoicePrefixExtensions(_0x48f406,_0x3b97a2,_0x6c0364){return new BPromise(function(_0x13eefb,_0x5a76c2){var _0x2bdd35=new Extension(formatPrefixName(_0x48f406['prefix']),0x1,_0x3e1e('0x57'),_0x3e1e('0x58'));_0x2bdd35['VoicePrefixId']=_0x48f406['id'];return db[_0x3e1e('0x49')]['create'](_0x2bdd35,{'transaction':_0x6c0364})[_0x3e1e('0x21')](function(_0x574c30){var _0x4dafe9=_0x574c30['get']({'plain':!![]});var _0x31062e=_[_0x3e1e('0x2c')](addVoicePrefixExtensions(_0x48f406,_0x3b97a2),function(_0x3457a1){_0x3457a1['VoiceExtensionId']=_0x4dafe9['id'];_0x3457a1[_0x3e1e('0x59')]=_0x48f406['id'];return _0x3457a1;});return db[_0x3e1e('0x49')]['bulkCreate'](_0x31062e,{'transaction':_0x6c0364})[_0x3e1e('0x21')](function(_0x583535){if(!_0x583535){return _0x5a76c2('Extensions\x20creation\x20failed');}else{return _0x13eefb(_0x583535);}})['catch'](function(_0x182da4){return _0x5a76c2(_0x182da4);});});;});};function addVoicePrefixExtensions(_0x3e6e12,_0x384ee6){var _0x4b0944=[];var _0x35d915=formatPrefixName(_0x3e6e12[_0x3e1e('0x5a')]);_0x4b0944[_0x3e1e('0x5b')](new Extension(_0x35d915,0x2,'Set',_0x3e1e('0x5c')+_0x3e6e12[_0x3e1e('0x25')]));if(_0x3e6e12[_0x3e1e('0x5d')]){_0x4b0944[_0x3e1e('0x5b')](new Extension(_0x35d915,0x3,_0x3e1e('0x5e'),_0x3e1e('0x5f')+_0x3e6e12[_0x3e1e('0x5d')]));}else{_0x4b0944[_0x3e1e('0x5b')](new Extension(_0x35d915,0x3,'NoOp','No\x20callerid\x20available'));}_0x4b0944[_0x3e1e('0x5b')](new Extension(_0x35d915,0x4,_0x3e1e('0x60'),_0x384ee6[_0x3e1e('0x51')]+','+_0x3e1e('0x61')+(0x8+_0x3e6e12[_0x3e1e('0x25')][_0x3e1e('0x41')])+'}'+','+0x1));return _0x4b0944;}function formatPrefixName(_0x35c9c3){var _0x112a22='_';for(var _0x2b78d5=0x0;_0x2b78d5<_0x35c9c3[_0x3e1e('0x41')];_0x2b78d5++){if(_0x35c9c3[_0x3e1e('0x62')](_0x2b78d5)=='-'){_0x112a22+=_0x35c9c3[_0x3e1e('0x62')](_0x2b78d5);}else{_0x112a22+='['+_0x35c9c3['charAt'](_0x2b78d5)+']';}}_0x112a22+='.';return _0x112a22;}exports['update']=function(_0x20bc4d,_0x29ddc4,_0x477e64){var _0x1d6135=_0x20bc4d[_0x3e1e('0x63')];_0x1d6135['prefix']=_0x3e1e('0x64')+_0x1d6135[_0x3e1e('0x25')]+'-';return db[_0x3e1e('0x65')][_0x3e1e('0x66')](function(_0x522637){return db['VoicePrefix'][_0x3e1e('0x20')](_0x1d6135,{'where':{'id':_0x1d6135['id']},'transaction':_0x522637})[_0x3e1e('0x21')](function(){return db[_0x3e1e('0x49')][_0x3e1e('0x23')]({'where':{'VoicePrefixId':_0x1d6135['id']},'transaction':_0x522637})[_0x3e1e('0x21')](function(){return db[_0x3e1e('0x49')]['find']({'where':{'id':_0x1d6135[_0x3e1e('0x4a')]},'raw':!![]})[_0x3e1e('0x21')](function(_0x34f093){return createVoicePrefixExtensions(_0x1d6135,_0x34f093,_0x522637);});});});})[_0x3e1e('0x21')](function(){return db[_0x3e1e('0x3b')][_0x3e1e('0x67')](_0x1d6135['id']);})['then'](respondWithResult(_0x29ddc4,null))[_0x3e1e('0x44')](handleError(_0x29ddc4,null));};exports[_0x3e1e('0x68')]=function(_0x4b78de,_0x109407,_0x2aef1b){return db[_0x3e1e('0x3b')]['find']({'where':{'id':_0x4b78de[_0x3e1e('0x45')]['id']}})['then'](handleEntityNotFound(_0x109407,null))[_0x3e1e('0x21')](function(_0x17c054){if(_0x17c054){return _0x17c054['addAgents'](_0x4b78de[_0x3e1e('0x63')][_0x3e1e('0x69')],_[_0x3e1e('0x6a')](_0x4b78de[_0x3e1e('0x63')],['ids','id'])||{})[_0x3e1e('0x6b')](function(_0x4a7dcc){for(var _0x2d6bb0=0x0;_0x2d6bb0<_0x4b78de[_0x3e1e('0x63')][_0x3e1e('0x69')][_0x3e1e('0x41')];_0x2d6bb0+=0x1){socket[_0x3e1e('0x6c')](_0x3e1e('0x6d'),{'UserId':Number(_0x4b78de['body'][_0x3e1e('0x69')][_0x2d6bb0]),'VoicePrefixId':Number(_0x4b78de[_0x3e1e('0x45')]['id'])});}return _0x4a7dcc;});}})[_0x3e1e('0x21')](respondWithResult(_0x109407,null))[_0x3e1e('0x44')](handleError(_0x109407,null));};exports['removeAgents']=function(_0x1ddf4a,_0x11eb0a,_0x437724){return db[_0x3e1e('0x3b')]['find']({'where':{'id':_0x1ddf4a[_0x3e1e('0x45')]['id']}})[_0x3e1e('0x21')](handleEntityNotFound(_0x11eb0a,null))[_0x3e1e('0x21')](function(_0x2161a4){if(_0x2161a4){return _0x2161a4[_0x3e1e('0x6e')](_0x1ddf4a[_0x3e1e('0x2e')]['ids'])['then'](function(){if(_['isArray'](_0x1ddf4a[_0x3e1e('0x2e')]['ids'])){for(var _0x321aa4=0x0;_0x321aa4<_0x1ddf4a['query'][_0x3e1e('0x69')][_0x3e1e('0x41')];_0x321aa4+=0x1){socket[_0x3e1e('0x6c')](_0x3e1e('0x6f'),{'UserId':Number(_0x1ddf4a['query'][_0x3e1e('0x69')][_0x321aa4]),'VoicePrefixId':Number(_0x1ddf4a['params']['id'])});}}else{socket[_0x3e1e('0x6c')]('userVoicePrefix:remove',{'UserId':Number(_0x1ddf4a[_0x3e1e('0x2e')][_0x3e1e('0x69')]),'VoicePrefixId':Number(_0x1ddf4a['params']['id'])});}});}})[_0x3e1e('0x21')](respondWithStatusCode(_0x11eb0a,null))[_0x3e1e('0x44')](handleError(_0x11eb0a,null));};exports[_0x3e1e('0x70')]=function(_0x4ad5e2,_0x53ba1b,_0x185a4d){var _0x20bb6d={};var _0x120618={};var _0x4dac94;var _0x2fced0;return db['VoicePrefix']['findOne']({'where':{'id':_0x4ad5e2['params']['id']}})[_0x3e1e('0x21')](handleEntityNotFound(_0x53ba1b,null))['then'](function(_0x44c0ee){if(_0x44c0ee){_0x4dac94=_0x44c0ee;_0x120618[_0x3e1e('0x2b')]=_[_0x3e1e('0x2d')](db[_0x3e1e('0x71')][_0x3e1e('0x27')]);_0x120618[_0x3e1e('0x2e')]=_[_0x3e1e('0x2d')](_0x4ad5e2[_0x3e1e('0x2e')]);_0x120618[_0x3e1e('0x40')]=_['intersection'](_0x120618['model'],_0x120618[_0x3e1e('0x2e')]);_0x20bb6d[_0x3e1e('0x30')]=_[_0x3e1e('0x2f')](_0x120618[_0x3e1e('0x2b')],qs[_0x3e1e('0x31')](_0x4ad5e2[_0x3e1e('0x2e')][_0x3e1e('0x31')]));_0x20bb6d[_0x3e1e('0x30')]=_0x20bb6d[_0x3e1e('0x30')]['length']?_0x20bb6d[_0x3e1e('0x30')]:_0x120618[_0x3e1e('0x2b')];_0x20bb6d[_0x3e1e('0x34')]=qs[_0x3e1e('0x35')](_0x4ad5e2[_0x3e1e('0x2e')][_0x3e1e('0x35')]);_0x20bb6d[_0x3e1e('0x36')]=qs[_0x3e1e('0x40')](_[_0x3e1e('0x37')](_0x4ad5e2[_0x3e1e('0x2e')],_0x120618[_0x3e1e('0x40')]));if(_0x4ad5e2[_0x3e1e('0x2e')]['filter']){_0x20bb6d[_0x3e1e('0x36')]=_[_0x3e1e('0x42')](_0x20bb6d['where'],{'$or':_[_0x3e1e('0x2c')](_0x20bb6d[_0x3e1e('0x30')],function(_0x1b7e29){var _0x292efb={};_0x292efb[_0x1b7e29]={'$like':'%'+_0x4ad5e2['query'][_0x3e1e('0x38')]+'%'};return _0x292efb;})});}_0x20bb6d=_[_0x3e1e('0x42')]({},_0x20bb6d,_0x4ad5e2[_0x3e1e('0x3a')]);return _0x4dac94[_0x3e1e('0x70')](_0x20bb6d);}})[_0x3e1e('0x21')](function(_0x285f83){if(_0x285f83){_0x2fced0=_0x285f83[_0x3e1e('0x41')];if(!_0x4ad5e2[_0x3e1e('0x2e')]['hasOwnProperty'](_0x3e1e('0x33'))){_0x20bb6d['limit']=qs[_0x3e1e('0x1c')](_0x4ad5e2[_0x3e1e('0x2e')][_0x3e1e('0x1c')]);_0x20bb6d[_0x3e1e('0x19')]=qs['offset'](_0x4ad5e2[_0x3e1e('0x2e')]['offset']);}return _0x4dac94[_0x3e1e('0x70')](_0x20bb6d);}})['then'](function(_0x1be666){if(_0x1be666){return _0x1be666?{'count':_0x2fced0,'rows':_0x1be666}:null;}})[_0x3e1e('0x21')](respondWithResult(_0x53ba1b,null))['catch'](handleError(_0x53ba1b,null));};exports[_0x3e1e('0x72')]=function(_0x1ed174,_0x54723b,_0x3d2406){var _0x2f07d3={};var _0x3b6af5={};var _0x23c86b;var _0x38a5b0;return db[_0x3e1e('0x3b')][_0x3e1e('0x73')]({'where':{'id':_0x1ed174['params']['id']}})[_0x3e1e('0x21')](handleEntityNotFound(_0x54723b,null))[_0x3e1e('0x21')](function(_0x5c5d32){if(_0x5c5d32){_0x23c86b=_0x5c5d32;_0x3b6af5[_0x3e1e('0x2b')]=_[_0x3e1e('0x2d')](db[_0x3e1e('0x74')]['rawAttributes']);_0x3b6af5[_0x3e1e('0x2e')]=_[_0x3e1e('0x2d')](_0x1ed174[_0x3e1e('0x2e')]);_0x3b6af5['filters']=_[_0x3e1e('0x2f')](_0x3b6af5['model'],_0x3b6af5[_0x3e1e('0x2e')]);_0x2f07d3[_0x3e1e('0x30')]=_[_0x3e1e('0x2f')](_0x3b6af5[_0x3e1e('0x2b')],qs[_0x3e1e('0x31')](_0x1ed174['query'][_0x3e1e('0x31')]));_0x2f07d3[_0x3e1e('0x30')]=_0x2f07d3[_0x3e1e('0x30')][_0x3e1e('0x41')]?_0x2f07d3[_0x3e1e('0x30')]:_0x3b6af5[_0x3e1e('0x2b')];_0x2f07d3[_0x3e1e('0x34')]=qs[_0x3e1e('0x35')](_0x1ed174[_0x3e1e('0x2e')]['sort']);_0x2f07d3[_0x3e1e('0x36')]=qs[_0x3e1e('0x40')](_[_0x3e1e('0x37')](_0x1ed174[_0x3e1e('0x2e')],_0x3b6af5[_0x3e1e('0x40')]));if(_0x1ed174['query'][_0x3e1e('0x38')]){_0x2f07d3[_0x3e1e('0x36')]=_[_0x3e1e('0x42')](_0x2f07d3[_0x3e1e('0x36')],{'$or':_[_0x3e1e('0x2c')](_0x2f07d3[_0x3e1e('0x30')],function(_0x1047de){var _0xe0eeab={};_0xe0eeab[_0x1047de]={'$like':'%'+_0x1ed174[_0x3e1e('0x2e')]['filter']+'%'};return _0xe0eeab;})});}_0x2f07d3=_[_0x3e1e('0x42')]({},_0x2f07d3,_0x1ed174[_0x3e1e('0x3a')]);return _0x23c86b['getTeams'](_0x2f07d3);}})[_0x3e1e('0x21')](function(_0x537072){if(_0x537072){_0x38a5b0=_0x537072[_0x3e1e('0x41')];if(!_0x1ed174[_0x3e1e('0x2e')][_0x3e1e('0x32')](_0x3e1e('0x33'))){_0x2f07d3[_0x3e1e('0x1c')]=qs[_0x3e1e('0x1c')](_0x1ed174[_0x3e1e('0x2e')][_0x3e1e('0x1c')]);_0x2f07d3[_0x3e1e('0x19')]=qs[_0x3e1e('0x19')](_0x1ed174['query']['offset']);}return _0x23c86b[_0x3e1e('0x72')](_0x2f07d3);}})[_0x3e1e('0x21')](function(_0x548cba){if(_0x548cba){return _0x548cba?{'count':_0x38a5b0,'rows':_0x548cba}:null;}})[_0x3e1e('0x21')](respondWithResult(_0x54723b,null))[_0x3e1e('0x44')](handleError(_0x54723b,null));};exports[_0x3e1e('0x75')]=function(_0x4a33f5,_0x5a6cb2,_0x2ec5e9){var _0xbfc033=_0x4a33f5[_0x3e1e('0x63')]['ids'];var _0x3049c4;return db['Team']['findAll']({'where':{'id':_0xbfc033},'attributes':['id'],'include':[{'model':db[_0x3e1e('0x71')],'as':_0x3e1e('0x76'),'attributes':['id','name',_0x3e1e('0x77'),_0x3e1e('0x78'),_0x3e1e('0x79')],'raw':!![]}]})[_0x3e1e('0x21')](function(_0x1ca30f){if(_0x1ca30f){_0x3049c4=_0x1ca30f;var _0x285ae4=_[_0x3e1e('0x7a')](_0x1ca30f,function(_0x32c3cf){var _0x201d18=_0x32c3cf[_0x3e1e('0x48')]({'plain':!![]});return _0x201d18[_0x3e1e('0x76')];});return db['VoicePrefix']['find']({'where':{'id':_0x4a33f5[_0x3e1e('0x45')]['id']}})[_0x3e1e('0x21')](function(_0x416b06){return db[_0x3e1e('0x65')]['transaction'](function(_0x2dea8b){return _0x416b06[_0x3e1e('0x75')](_0xbfc033,{'transaction':_0x2dea8b})['then'](function(){return BPromise['each'](_0x3049c4,function(_0x34c4c8){return db[_0x3e1e('0x7b')]['upsert']({'TeamId':_0x34c4c8['id'],'VoicePrefixId':_0x4a33f5[_0x3e1e('0x45')]['id']},{'transaction':_0x2dea8b});});})[_0x3e1e('0x21')](function(){return BPromise[_0x3e1e('0x7c')](_0x285ae4,function(_0x4332db){return db[_0x3e1e('0x7d')]['findOrCreate']({'where':{'UserId':_0x4332db['id'],'VoicePrefixId':_0x4a33f5[_0x3e1e('0x45')]['id']},'transaction':_0x2dea8b});});})[_0x3e1e('0x21')](function(){_0x285ae4['forEach'](function(_0x838800){socket['emit']('userVoicePrefix:save',{'UserId':_0x838800['id'],'VoicePrefixId':_0x416b06['id']});});});});});}})[_0x3e1e('0x21')](respondWithStatusCode(_0x5a6cb2,null))[_0x3e1e('0x44')](handleError(_0x5a6cb2,null));};exports[_0x3e1e('0x7e')]=function(_0xe57be2,_0x3ad5b0,_0x5788ea){return db[_0x3e1e('0x74')][_0x3e1e('0x3d')]({'where':{'id':_0xe57be2[_0x3e1e('0x2e')][_0x3e1e('0x69')]},'attributes':['id'],'include':[{'model':db[_0x3e1e('0x71')],'as':_0x3e1e('0x76'),'attributes':['id'],'raw':!![]}]})[_0x3e1e('0x21')](handleEntityNotFound(_0x3ad5b0,null))['then'](function(_0x2511d2){var _0x2d29d7=_[_0x3e1e('0x2c')](_0x2511d2,'id');var _0x161aa2=[];var _0x61318=[];var _0x20fa70=squel[_0x3e1e('0x7f')]();_0x20fa70['field'](_0x3e1e('0x80'))['from'](_0x3e1e('0x81'),'tq')[_0x3e1e('0x82')](_0x3e1e('0x83'),'ut',_0x3e1e('0x84'))[_0x3e1e('0x36')]('VoicePrefixId\x20=\x20?',_0xe57be2[_0x3e1e('0x45')]['id']);for(var _0x463428=0x0;_0x463428<_0x2511d2[_0x3e1e('0x41')];_0x463428+=0x1){let _0x5c6ba6=_0x2511d2[_0x463428];for(var _0x37eb53=0x0;_0x37eb53<_0x5c6ba6[_0x3e1e('0x76')]['length'];_0x37eb53+=0x1){let _0x3ae731=_0x5c6ba6['Agents'][_0x37eb53];var _0x2a2e80=_0x20fa70[_0x3e1e('0x85')]();_0x2a2e80[_0x3e1e('0x36')](_0x3e1e('0x86'),_0x3ae731['id']);_0x61318['push'](db[_0x3e1e('0x65')][_0x3e1e('0x2e')](_0x2a2e80[_0x3e1e('0x87')](),{'type':db[_0x3e1e('0x65')][_0x3e1e('0x88')][_0x3e1e('0x89')]})[_0x3e1e('0x21')](function(_0x415c88){if(_0x415c88[_0x3e1e('0x41')]===0x1){return _0x3ae731['id'];}else{var _0x187048=_[_0x3e1e('0x8a')](_[_0x3e1e('0x2c')](_0x415c88,'TeamId'),function(_0x244a5d){return _[_0x3e1e('0x8b')](_0x2d29d7,_0x244a5d);});if(_0x187048){return _0x3ae731['id'];}}}));}}return BPromise[_0x3e1e('0x8c')](_0x61318)[_0x3e1e('0x21')](function(_0x4afad1){_0x161aa2=_(_0x161aa2)[_0x3e1e('0x8d')](_0x4afad1)[_0x3e1e('0x8e')]()[_0x3e1e('0x8f')]();return db[_0x3e1e('0x3b')]['find']({'where':{'id':_0xe57be2[_0x3e1e('0x45')]['id']}})[_0x3e1e('0x21')](function(_0x5ef204){return db[_0x3e1e('0x65')][_0x3e1e('0x66')](function(_0x487d3f){return _0x5ef204[_0x3e1e('0x7e')](_0xe57be2[_0x3e1e('0x2e')][_0x3e1e('0x69')],{'transaction':_0x487d3f})[_0x3e1e('0x21')](function(){if(!_[_0x3e1e('0x90')](_0x161aa2)){return _0x5ef204['removeAgents'](_0x161aa2,{'transaction':_0x487d3f});}})[_0x3e1e('0x21')](function(){_0x161aa2[_0x3e1e('0x91')](function(_0x22d774){socket['emit'](_0x3e1e('0x6f'),{'UserId':_0x22d774,'VoicePrefixId':_0x5ef204['id']});});});});});});})[_0x3e1e('0x21')](respondWithStatusCode(_0x3ad5b0,null))[_0x3e1e('0x44')](handleError(_0x3ad5b0,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 7c8ca86..9f6290d 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 _0x5349=['remove','emit','hook','events','VoicePrefix','update'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5349,0x141));var _0x9534=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x5349[_0x4ae625];return _0x31accf;};'use strict';var EventEmitter=require(_0x9534('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x9534('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9534('0x2'),'afterDestroy':_0x9534('0x3')};function emitEvent(_0x4bf682){return function(_0x40d588,_0x411c45,_0x4a4636){VoicePrefixEvents[_0x9534('0x4')](_0x4bf682+':'+_0x40d588['id'],_0x40d588);VoicePrefixEvents[_0x9534('0x4')](_0x4bf682,_0x40d588);_0x4a4636(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x9534('0x5')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x2cf2=['setMaxListeners','save','update','remove','emit','hook','events','VoicePrefix'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2cf2,0x17e));var _0x22cf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x2cf2[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x22cf('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x22cf('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x22cf('0x2')](0x0);var events={'afterCreate':_0x22cf('0x3'),'afterUpdate':_0x22cf('0x4'),'afterDestroy':_0x22cf('0x5')};function emitEvent(_0x128cfa){return function(_0x377121,_0x35a927,_0x5aebc1){VoicePrefixEvents[_0x22cf('0x6')](_0x128cfa+':'+_0x377121['id'],_0x377121);VoicePrefixEvents[_0x22cf('0x6')](_0x128cfa,_0x377121);_0x5aebc1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x22cf('0x7')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 56728a8..dd212eb 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 _0x3c75=['moment','bluebird','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger'];(function(_0x469f19,_0x2c3b99){var _0x429b41=function(_0xcea678){while(--_0xcea678){_0x469f19['push'](_0x469f19['shift']());}};_0x429b41(++_0x2c3b99);}(_0x3c75,0x18d));var _0x53c7=function(_0x4002e7,_0x198ae2){_0x4002e7=_0x4002e7-0x0;var _0x4856ef=_0x3c75[_0x4002e7];return _0x4856ef;};'use strict';var _=require(_0x53c7('0x0'));var util=require(_0x53c7('0x1'));var logger=require(_0x53c7('0x2'))('api');var moment=require(_0x53c7('0x3'));var BPromise=require(_0x53c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53c7('0x5'));var rimraf=require(_0x53c7('0x6'));var config=require(_0x53c7('0x7'));var attributes=require('./voicePrefix.attributes');module[_0x53c7('0x8')]=function(_0x2e6ae2,_0x5705c3){return _0x2e6ae2[_0x53c7('0x9')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea36=['define','VoicePrefix','voice_prefixes','util','../../config/logger','moment','bluebird','path','rimraf','exports'];(function(_0x3b27c8,_0x159e5f){var _0x42fba3=function(_0x52ec01){while(--_0x52ec01){_0x3b27c8['push'](_0x3b27c8['shift']());}};_0x42fba3(++_0x159e5f);}(_0xea36,0x85));var _0x6ea3=function(_0x298fe3,_0x47090b){_0x298fe3=_0x298fe3-0x0;var _0x24616d=_0xea36[_0x298fe3];return _0x24616d;};'use strict';var _=require('lodash');var util=require(_0x6ea3('0x0'));var logger=require(_0x6ea3('0x1'))('api');var moment=require(_0x6ea3('0x2'));var BPromise=require(_0x6ea3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ea3('0x4'));var rimraf=require(_0x6ea3('0x5'));var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module[_0x6ea3('0x6')]=function(_0x4be48a,_0x521567){return _0x4be48a[_0x6ea3('0x7')](_0x6ea3('0x8'),attributes,{'tableName':_0x6ea3('0x9'),'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 07eedce..ca77c58 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 _0x9512=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3818a3,_0x324ec5){var _0x5944a2=function(_0x1e87cf){while(--_0x1e87cf){_0x3818a3['push'](_0x3818a3['shift']());}};_0x5944a2(++_0x324ec5);}(_0x9512,0x75));var _0x2951=function(_0x2b71e0,_0x313267){_0x2b71e0=_0x2b71e0-0x0;var _0x36ca99=_0x9512[_0x2b71e0];return _0x36ca99;};'use strict';var _=require(_0x2951('0x0'));var util=require(_0x2951('0x1'));var moment=require(_0x2951('0x2'));var BPromise=require(_0x2951('0x3'));var rs=require(_0x2951('0x4'));var fs=require('fs');var Redis=require(_0x2951('0x5'));var db=require(_0x2951('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2951('0x7'))(_0x2951('0x8'));var config=require(_0x2951('0x9'));var jayson=require(_0x2951('0xa'));var client=jayson[_0x2951('0xb')][_0x2951('0xc')]({'port':0x232a});config[_0x2951('0xd')]=_['defaults'](config[_0x2951('0xd')],{'host':_0x2951('0xe'),'port':0x18eb});var socket=require(_0x2951('0xf'))(new Redis(config[_0x2951('0xd')]));require(_0x2951('0x10'))[_0x2951('0x11')](socket);function respondWithRpcPromise(_0x50dbe2,_0x3e6f58,_0x43a226){return new BPromise(function(_0x28cbbb,_0x2d0b87){return client['request'](_0x50dbe2,_0x43a226)[_0x2951('0x12')](function(_0x34559a){logger[_0x2951('0x13')](_0x2951('0x14'),_0x3e6f58,_0x2951('0x15'));logger['debug'](_0x2951('0x16'),_0x3e6f58,_0x2951('0x15'),JSON[_0x2951('0x17')](_0x34559a));if(_0x34559a[_0x2951('0x18')]){if(_0x34559a[_0x2951('0x18')][_0x2951('0x19')]===0x1f4){logger[_0x2951('0x18')](_0x2951('0x14'),_0x3e6f58,_0x34559a[_0x2951('0x18')][_0x2951('0x1a')]);return _0x2d0b87(_0x34559a[_0x2951('0x18')][_0x2951('0x1a')]);}logger[_0x2951('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x3e6f58,_0x34559a[_0x2951('0x18')][_0x2951('0x1a')]);return _0x28cbbb(_0x34559a[_0x2951('0x18')][_0x2951('0x1a')]);}else{logger[_0x2951('0x13')](_0x2951('0x14'),_0x3e6f58,'request\x20sent');_0x28cbbb(_0x34559a[_0x2951('0x1b')][_0x2951('0x1a')]);}})[_0x2951('0x1c')](function(_0x3fa5af){logger[_0x2951('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x3e6f58,_0x3fa5af);_0x2d0b87(_0x3fa5af);});});} \ No newline at end of file +var _0x6a83=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x18ae56,_0x12380f){var _0x456406=function(_0x5b5bd8){while(--_0x5b5bd8){_0x18ae56['push'](_0x18ae56['shift']());}};_0x456406(++_0x12380f);}(_0x6a83,0xd2));var _0x36a8=function(_0x51293e,_0x4f2b03){_0x51293e=_0x51293e-0x0;var _0x21fd77=_0x6a83[_0x51293e];return _0x21fd77;};'use strict';var _=require(_0x36a8('0x0'));var util=require(_0x36a8('0x1'));var moment=require(_0x36a8('0x2'));var BPromise=require(_0x36a8('0x3'));var rs=require(_0x36a8('0x4'));var fs=require('fs');var Redis=require(_0x36a8('0x5'));var db=require(_0x36a8('0x6'))['db'];var utils=require(_0x36a8('0x7'));var logger=require(_0x36a8('0x8'))(_0x36a8('0x9'));var config=require(_0x36a8('0xa'));var jayson=require(_0x36a8('0xb'));var client=jayson[_0x36a8('0xc')][_0x36a8('0xd')]({'port':0x232a});config[_0x36a8('0xe')]=_[_0x36a8('0xf')](config[_0x36a8('0xe')],{'host':_0x36a8('0x10'),'port':0x18eb});var socket=require(_0x36a8('0x11'))(new Redis(config['redis']));require(_0x36a8('0x12'))['register'](socket);function respondWithRpcPromise(_0x345fa4,_0x29923c,_0x48b0fc){return new BPromise(function(_0x23834f,_0x1e5a57){return client['request'](_0x345fa4,_0x48b0fc)[_0x36a8('0x13')](function(_0x3c8c08){logger[_0x36a8('0x14')](_0x36a8('0x15'),_0x29923c,_0x36a8('0x16'));logger[_0x36a8('0x17')](_0x36a8('0x18'),_0x29923c,_0x36a8('0x16'),JSON['stringify'](_0x3c8c08));if(_0x3c8c08[_0x36a8('0x19')]){if(_0x3c8c08[_0x36a8('0x19')][_0x36a8('0x1a')]===0x1f4){logger[_0x36a8('0x19')]('VoicePrefix,\x20%s,\x20%s',_0x29923c,_0x3c8c08['error'][_0x36a8('0x1b')]);return _0x1e5a57(_0x3c8c08[_0x36a8('0x19')][_0x36a8('0x1b')]);}logger[_0x36a8('0x19')](_0x36a8('0x15'),_0x29923c,_0x3c8c08[_0x36a8('0x19')][_0x36a8('0x1b')]);return _0x23834f(_0x3c8c08['error'][_0x36a8('0x1b')]);}else{logger[_0x36a8('0x14')](_0x36a8('0x15'),_0x29923c,'request\x20sent');_0x23834f(_0x3c8c08[_0x36a8('0x1c')]['message']);}})[_0x36a8('0x1d')](function(_0x45889a){logger[_0x36a8('0x19')]('VoicePrefix,\x20%s,\x20%s',_0x29923c,_0x45889a);_0x1e5a57(_0x45889a);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 8dadfe6..86ec863 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 _0x33a4=['removeListener','register','length','voicePrefix:','save','update'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x33a4,0x88));var _0x433a=function(_0x4f2f77,_0x572f05){_0x4f2f77=_0x4f2f77-0x0;var _0x59ae0f=_0x33a4[_0x4f2f77];return _0x59ae0f;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x433a('0x0'),'remove',_0x433a('0x1')];function createListener(_0x4786e1,_0x1917aa){return function(_0x4909a4){_0x1917aa['emit'](_0x4786e1,_0x4909a4);};}function removeListener(_0x4f5bc0,_0x19166b){return function(){VoicePrefixEvents[_0x433a('0x2')](_0x4f5bc0,_0x19166b);};}exports[_0x433a('0x3')]=function(_0x60b6b3){for(var _0x1b6f5a=0x0,_0x4fcc88=events[_0x433a('0x4')];_0x1b6f5a<_0x4fcc88;_0x1b6f5a++){var _0x58e65c=events[_0x1b6f5a];var _0x2c2404=createListener(_0x433a('0x5')+_0x58e65c,_0x60b6b3);VoicePrefixEvents['on'](_0x58e65c,_0x2c2404);}}; \ No newline at end of file +var _0x342e=['removeListener','register','./voicePrefix.events','save','remove'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0x342e,0xde));var _0xe342=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x342e[_0x4bfac3];return _0x15f0f2;};'use strict';var VoicePrefixEvents=require(_0xe342('0x0'));var events=[_0xe342('0x1'),_0xe342('0x2'),'update'];function createListener(_0x5d2113,_0x15d20f){return function(_0x4070d1){_0x15d20f['emit'](_0x5d2113,_0x4070d1);};}function removeListener(_0x509778,_0x349dc1){return function(){VoicePrefixEvents[_0xe342('0x3')](_0x509778,_0x349dc1);};}exports[_0xe342('0x4')]=function(_0x590e9){for(var _0x164e21=0x0,_0x5e643a=events['length'];_0x164e21<_0x5e643a;_0x164e21++){var _0x3457ac=events[_0x164e21];var _0x36bb18=createListener('voicePrefix:'+_0x3457ac,_0x590e9);VoicePrefixEvents['on'](_0x3457ac,_0x36bb18);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index e4d10f9..183006b 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 _0x4836=['/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','addAgents','/:id/lists','addLists','put','/:id','update','delete','destroy','removeTeams','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks'];(function(_0x2d61ac,_0x18ff36){var _0x3f7d3c=function(_0x2ba7e5){while(--_0x2ba7e5){_0x2d61ac['push'](_0x2d61ac['shift']());}};_0x3f7d3c(++_0x18ff36);}(_0x4836,0x1f0));var _0x6483=function(_0x4cd2db,_0x8440ed){_0x4cd2db=_0x4cd2db-0x0;var _0xe3b046=_0x4836[_0x4cd2db];return _0xe3b046;};'use strict';var multer=require(_0x6483('0x0'));var util=require(_0x6483('0x1'));var path=require(_0x6483('0x2'));var timeout=require(_0x6483('0x3'));var express=require(_0x6483('0x4'));var router=express[_0x6483('0x5')]();var fs_extra=require(_0x6483('0x6'));var auth=require(_0x6483('0x7'));var interaction=require(_0x6483('0x8'));var config=require(_0x6483('0x9'));var controller=require(_0x6483('0xa'));router[_0x6483('0xb')]('/',auth[_0x6483('0xc')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6483('0xd')]);router[_0x6483('0xb')](_0x6483('0xe'),auth[_0x6483('0xc')](),controller[_0x6483('0xf')]);router[_0x6483('0xb')](_0x6483('0x10'),auth[_0x6483('0xc')](),controller[_0x6483('0x11')]);router['get'](_0x6483('0x12'),auth[_0x6483('0xc')](),controller[_0x6483('0x13')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x6483('0x14')]);router[_0x6483('0xb')](_0x6483('0x15'),auth[_0x6483('0xc')](),controller[_0x6483('0x16')]);router[_0x6483('0xb')](_0x6483('0x17'),auth[_0x6483('0xc')](),controller[_0x6483('0x18')]);router['get'](_0x6483('0x19'),auth[_0x6483('0xc')](),controller[_0x6483('0x1a')]);router[_0x6483('0xb')]('/:id/lists',auth[_0x6483('0xc')](),controller[_0x6483('0x1b')]);router['get'](_0x6483('0x1c'),auth['isAuthenticated'](),controller[_0x6483('0x1d')]);router[_0x6483('0x1e')]('/',auth[_0x6483('0xc')](),controller[_0x6483('0x1f')]);router['post'](_0x6483('0x20'),auth[_0x6483('0xc')](),controller[_0x6483('0x21')]);router['post'](_0x6483('0x15'),auth[_0x6483('0xc')](),controller[_0x6483('0x22')]);router[_0x6483('0x1e')]('/:id/users',auth[_0x6483('0xc')](),controller[_0x6483('0x23')]);router['post'](_0x6483('0x24'),auth[_0x6483('0xc')](),controller[_0x6483('0x25')]);router['post']('/:id/blacklists',auth[_0x6483('0xc')](),controller['addBlackLists']);router[_0x6483('0x26')](_0x6483('0x27'),auth[_0x6483('0xc')](),controller[_0x6483('0x28')]);router[_0x6483('0x29')]('/:id',auth[_0x6483('0xc')](),controller[_0x6483('0x2a')]);router[_0x6483('0x29')](_0x6483('0x15'),auth[_0x6483('0xc')](),controller[_0x6483('0x2b')]);router[_0x6483('0x29')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);router[_0x6483('0x29')](_0x6483('0x24'),auth[_0x6483('0xc')](),controller[_0x6483('0x2c')]);router[_0x6483('0x29')](_0x6483('0x1c'),auth[_0x6483('0xc')](),controller[_0x6483('0x2d')]);module[_0x6483('0x2e')]=router; \ No newline at end of file +var _0xd87e=['getBlackLists','post','create','/:id/clone','clone','/:id/teams','addTeams','addAgents','/:id/lists','addLists','addBlackLists','put','update','destroy','delete','removeTeams','removeLists','/:id/blacklists','removeBlackLists','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getTeams','/:id/users','getAgents','/:id/members','getMembers','getLists'];(function(_0x5a13a9,_0xc94c54){var _0x4919df=function(_0x21ddea){while(--_0x21ddea){_0x5a13a9['push'](_0x5a13a9['shift']());}};_0x4919df(++_0xc94c54);}(_0xd87e,0x14f));var _0xed87=function(_0x3243ca,_0x47c495){_0x3243ca=_0x3243ca-0x0;var _0x3b74e7=_0xd87e[_0x3243ca];return _0x3b74e7;};'use strict';var multer=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var path=require(_0xed87('0x2'));var timeout=require(_0xed87('0x3'));var express=require(_0xed87('0x4'));var router=express['Router']();var fs_extra=require(_0xed87('0x5'));var auth=require(_0xed87('0x6'));var interaction=require(_0xed87('0x7'));var config=require(_0xed87('0x8'));var controller=require(_0xed87('0x9'));router[_0xed87('0xa')]('/',auth[_0xed87('0xb')](),controller[_0xed87('0xc')]);router[_0xed87('0xa')](_0xed87('0xd'),auth[_0xed87('0xb')](),controller['show']);router[_0xed87('0xa')]('/:id/hoppers',auth[_0xed87('0xb')](),controller[_0xed87('0xe')]);router['get'](_0xed87('0xf'),auth[_0xed87('0xb')](),controller['getHopperHistories']);router[_0xed87('0xa')](_0xed87('0x10'),auth[_0xed87('0xb')](),controller[_0xed87('0x11')]);router['get'](_0xed87('0x12'),auth[_0xed87('0xb')](),controller['getHopperBlacks']);router['get']('/:id/teams',auth[_0xed87('0xb')](),controller[_0xed87('0x13')]);router[_0xed87('0xa')](_0xed87('0x14'),auth[_0xed87('0xb')](),controller[_0xed87('0x15')]);router[_0xed87('0xa')](_0xed87('0x16'),auth[_0xed87('0xb')](),controller[_0xed87('0x17')]);router[_0xed87('0xa')]('/:id/lists',auth[_0xed87('0xb')](),controller[_0xed87('0x18')]);router[_0xed87('0xa')]('/:id/blacklists',auth[_0xed87('0xb')](),controller[_0xed87('0x19')]);router[_0xed87('0x1a')]('/',auth[_0xed87('0xb')](),controller[_0xed87('0x1b')]);router[_0xed87('0x1a')](_0xed87('0x1c'),auth[_0xed87('0xb')](),controller[_0xed87('0x1d')]);router['post'](_0xed87('0x1e'),auth[_0xed87('0xb')](),controller[_0xed87('0x1f')]);router[_0xed87('0x1a')](_0xed87('0x14'),auth[_0xed87('0xb')](),controller[_0xed87('0x20')]);router[_0xed87('0x1a')](_0xed87('0x21'),auth[_0xed87('0xb')](),controller[_0xed87('0x22')]);router[_0xed87('0x1a')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xed87('0x23')]);router[_0xed87('0x24')](_0xed87('0xd'),auth[_0xed87('0xb')](),controller[_0xed87('0x25')]);router['delete'](_0xed87('0xd'),auth[_0xed87('0xb')](),controller[_0xed87('0x26')]);router[_0xed87('0x27')](_0xed87('0x1e'),auth[_0xed87('0xb')](),controller[_0xed87('0x28')]);router[_0xed87('0x27')](_0xed87('0x14'),auth[_0xed87('0xb')](),controller['removeAgents']);router[_0xed87('0x27')](_0xed87('0x21'),auth[_0xed87('0xb')](),controller[_0xed87('0x29')]);router[_0xed87('0x27')](_0xed87('0x2a'),auth[_0xed87('0xb')](),controller[_0xed87('0x2b')]);module[_0xed87('0x2c')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index ff02816..11756de 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 _0x9a14=['#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)','#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','mandatoryDisposition','STRING','name','ENUM','inbound','outbound','default','fewestcalls','random','rrmemory','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','booked','roundrobin','progressive','predictive','power','INTEGER','yes','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'];(function(_0x19afce,_0x4a8cba){var _0x50c253=function(_0x3a6946){while(--_0x3a6946){_0x19afce['push'](_0x19afce['shift']());}};_0x50c253(++_0x4a8cba);}(_0x9a14,0xa8));var _0x49a1=function(_0x28a944,_0x569d11){_0x28a944=_0x28a944-0x0;var _0x4fd24e=_0x9a14[_0x28a944];return _0x4fd24e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49a1('0x0')],'allowNull':![],'unique':_0x49a1('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x49a1('0x2')](_0x49a1('0x3'),_0x49a1('0x4')),'allowNull':![],'defaultValue':_0x49a1('0x3')},'musiconhold':{'type':Sequelize[_0x49a1('0x0')],'defaultValue':_0x49a1('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall','leastrecent',_0x49a1('0x6'),_0x49a1('0x7'),_0x49a1('0x8'),'linear',_0x49a1('0x9'),_0x49a1('0xa')),'allowNull':![],'defaultValue':_0x49a1('0xb'),'set':function(_0x5445eb){this[_0x49a1('0xc')](_0x49a1('0xd'),_0x5445eb?_0x5445eb:'rrmemory');},'get':function(){var _0x712f74=this[_0x49a1('0xe')](_0x49a1('0xf'));var _0xe8bb48=this[_0x49a1('0xe')]('dialMethod');var _0x31dc7a=this[_0x49a1('0xe')](_0x49a1('0xd'));if(_0x712f74===_0x49a1('0x3')){return _0x31dc7a;}if(_0xe8bb48===_0x49a1('0x10')&&_0x31dc7a===_0x49a1('0x8')||_0xe8bb48===_0x49a1('0x10')&&_0x31dc7a===_0x49a1('0x11')){return _0x31dc7a;}if(_0xe8bb48===_0x49a1('0x12')||_0xe8bb48===_0x49a1('0x13')||_0xe8bb48===_0x49a1('0x14')){return _0x31dc7a;}return null;}},'servicelevel':{'type':Sequelize[_0x49a1('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x49a1('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x49a1('0x15')](0xb)},'timeout':{'type':Sequelize[_0x49a1('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x49a1('0x0')]},'weight':{'type':Sequelize[_0x49a1('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x49a1('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x49a1('0x16'),'no'),'defaultValue':_0x49a1('0x16')},'autopause':{'type':Sequelize['ENUM'](_0x49a1('0x16'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x49a1('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x49a1('0x2')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x49a1('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x49a1('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x49a1('0x2')](_0x49a1('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x49a1('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x49a1('0x2')](_0x49a1('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x49a1('0x2')](_0x49a1('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x49a1('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x49a1('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x49a1('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x49a1('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x49a1('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x49a1('0x2')](_0x49a1('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0x49a1('0x16'),'no',_0x49a1('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x49a1('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x49a1('0x2')](_0x49a1('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x49a1('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x49a1('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x49a1('0x0')]},'queue_youarenext':{'type':Sequelize[_0x49a1('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x49a1('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x49a1('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x49a1('0x0')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x49a1('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x49a1('0x0')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x49a1('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x49a1('0x0')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x49a1('0x0')]},'periodic_announce':{'type':Sequelize[_0x49a1('0x18')],'set':function(_0x4487f2){this['setDataValue'](_0x49a1('0x19'),_0x4487f2?_0x4487f2[_0x49a1('0x1a')](','):[]);},'get':function(){return this[_0x49a1('0xe')](_0x49a1('0x19'))?this[_0x49a1('0xe')](_0x49a1('0x19'))[_0x49a1('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x49a1('0x0')],'defaultValue':_0x49a1('0x16'),'set':function(_0x237b32){this[_0x49a1('0xc')](_0x49a1('0x1c'),_0x237b32?_0x237b32[_0x49a1('0x1a')](','):undefined);},'get':function(){return this[_0x49a1('0xe')](_0x49a1('0x1c'))?this[_0x49a1('0xe')]('joinempty')[_0x49a1('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x4de5c7){this[_0x49a1('0xc')](_0x49a1('0x1d'),_0x4de5c7?_0x4de5c7[_0x49a1('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0x49a1('0x1d'))?this[_0x49a1('0xe')]('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x49a1('0x2')](_0x49a1('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x49a1('0x2')](_0x49a1('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x49a1('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x49a1('0x2')](_0x49a1('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x49a1('0x0')]},'description':{'type':Sequelize[_0x49a1('0x0')]},'acw':{'type':Sequelize[_0x49a1('0x1e')],'defaultValue':0x0,'set':function(_0x2973dd){this[_0x49a1('0xc')](_0x49a1('0x1f'),_0x2973dd);if(_0x2973dd){if(this[_0x49a1('0xe')](_0x49a1('0x20'))<0x2){this[_0x49a1('0xc')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x49a1('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x49a1('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x49a1('0x2')]('preview',_0x49a1('0x12'),_0x49a1('0x14'),'predictive',_0x49a1('0x10')),'defaultValue':_0x49a1('0x12'),'comment':_0x49a1('0x21')},'dialLimitChannel':{'type':Sequelize[_0x49a1('0x15')](0x4)[_0x49a1('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x49a1('0x23')},'dialLimitQueue':{'type':Sequelize[_0x49a1('0x15')](0x4)[_0x49a1('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x49a1('0x24')},'dialPowerLevel':{'type':Sequelize[_0x49a1('0x25')](0x2)[_0x49a1('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x49a1('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x49a1('0x2')](_0x49a1('0x27'),_0x49a1('0x28')),'defaultValue':_0x49a1('0x28'),'comment':_0x49a1('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x49a1('0x25')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x49a1('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x49a1('0x15')](0x3)[_0x49a1('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x49a1('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x49a1('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x49a1('0x0')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x49a1('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x49a1('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x49a1('0x0')],'defaultValue':'tTxX','comment':_0x49a1('0x2d')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x49a1('0x2e')},'dialQueueProject':{'type':Sequelize[_0x49a1('0x0')],'comment':_0x49a1('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x49a1('0x15')](0x3)[_0x49a1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x49a1('0x15')](0x5)[_0x49a1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x49a1('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x49a1('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x49a1('0x15')](0x5)[_0x49a1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x49a1('0x15')](0x3)[_0x49a1('0x22')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x49a1('0x15')](0x5)[_0x49a1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x49a1('0x31')},'dialGlobalMaxRetry':{'type':Sequelize[_0x49a1('0x15')](0x3)[_0x49a1('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x49a1('0x32')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x49a1('0x0')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x49a1('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x49a1('0x2')](_0x49a1('0x33'),_0x49a1('0x34'),_0x49a1('0x35')),'defaultValue':_0x49a1('0x33')},'dialAMDActive':{'type':Sequelize[_0x49a1('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x49a1('0x15')](0x9)[_0x49a1('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x49a1('0x36')},'dialAMDGreeting':{'type':Sequelize[_0x49a1('0x15')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x49a1('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x49a1('0x15')](0x9)[_0x49a1('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x49a1('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x49a1('0x15')](0x9)[_0x49a1('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x49a1('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0x49a1('0x15')](0x9)[_0x49a1('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x49a1('0x15')](0x9)[_0x49a1('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x49a1('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x49a1('0x15')](0x9)[_0x49a1('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x49a1('0x3b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x49a1('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x49a1('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x49a1('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x49a1('0x3d')},'dialRecallMeTimeout':{'type':Sequelize[_0x49a1('0x15')](0x5)[_0x49a1('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x49a1('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0x49a1('0x1e')],'defaultValue':0x0,'comment':_0x49a1('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x49a1('0x40'),_0x49a1('0x41')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x49a1('0x0')],'comment':_0x49a1('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x49a1('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x49a1('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x49a1('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x49a1('0x42')},'dialCutDigit':{'type':Sequelize[_0x49a1('0x15')](0x3)[_0x49a1('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x49a1('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x49a1('0x15')](0x3)[_0x49a1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x49a1('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x49a1('0x15')](0x5)[_0x49a1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x49a1('0x15')](0x3)[_0x49a1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x49a1('0x45')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x49a1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x49a1('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x49a1('0x15')](0x3)[_0x49a1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x49a1('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x49a1('0x15')](0x5)[_0x49a1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x49a1('0x48')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x49a1('0x15')](0x5)[_0x49a1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x49a1('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x49a1('0x15')](0x3)[_0x49a1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x49a1('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x49a1('0x15')](0x5)[_0x49a1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x49a1('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x49a1('0x15')],'allowNull':!![],'comment':_0x49a1('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0x49a1('0x1e')],'defaultValue':![],'comment':_0x49a1('0x4d'),'set':function(_0x7ccd4){if(!_0x7ccd4)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0x49a1('0x4e'),_0x7ccd4);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x49a1('0x15')](0x3)[_0x49a1('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xeff8=['rrmemory','type','dialMethod','booked','roundrobin','predictive','power','INTEGER','yes','all','setDataValue','periodic_announce','join','getDataValue','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','#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)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#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','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','STRING','default','ringall','leastrecent','fewestcalls','random','linear','wrandom','rrordered','strategy'];(function(_0x1d5cfa,_0x57efb0){var _0x19a273=function(_0x2fe3f5){while(--_0x2fe3f5){_0x1d5cfa['push'](_0x1d5cfa['shift']());}};_0x19a273(++_0x57efb0);}(_0xeff8,0x186));var _0x8eff=function(_0x2601b4,_0x315e78){_0x2601b4=_0x2601b4-0x0;var _0x3e3661=_0xeff8[_0x2601b4];return _0x3e3661;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8eff('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8eff('0x3')](_0x8eff('0x4'),'outbound'),'allowNull':![],'defaultValue':_0x8eff('0x4')},'musiconhold':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':_0x8eff('0x6')},'announce':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x8eff('0x7'),_0x8eff('0x8'),_0x8eff('0x9'),_0x8eff('0xa'),'rrmemory',_0x8eff('0xb'),_0x8eff('0xc'),_0x8eff('0xd')),'allowNull':![],'defaultValue':_0x8eff('0x7'),'set':function(_0x5bd403){this['setDataValue'](_0x8eff('0xe'),_0x5bd403?_0x5bd403:_0x8eff('0xf'));},'get':function(){var _0xb2117e=this['getDataValue'](_0x8eff('0x10'));var _0x369b5d=this['getDataValue'](_0x8eff('0x11'));var _0x271044=this['getDataValue']('strategy');if(_0xb2117e===_0x8eff('0x4')){return _0x271044;}if(_0x369b5d===_0x8eff('0x12')&&_0x271044===_0x8eff('0xf')||_0x369b5d===_0x8eff('0x12')&&_0x271044===_0x8eff('0x13')){return _0x271044;}if(_0x369b5d==='progressive'||_0x369b5d===_0x8eff('0x14')||_0x369b5d===_0x8eff('0x15')){return _0x271044;}return null;}},'servicelevel':{'type':Sequelize[_0x8eff('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x8eff('0x16')](0xb)},'timeout':{'type':Sequelize[_0x8eff('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x8eff('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x8eff('0x5')]},'weight':{'type':Sequelize[_0x8eff('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x8eff('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x8eff('0x3')]('yes','no'),'defaultValue':_0x8eff('0x17')},'autopause':{'type':Sequelize[_0x8eff('0x3')](_0x8eff('0x17'),'no',_0x8eff('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x8eff('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x8eff('0x3')](_0x8eff('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x8eff('0x3')](_0x8eff('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x8eff('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x8eff('0x3')](_0x8eff('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x8eff('0x3')](_0x8eff('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x8eff('0x3')](_0x8eff('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x8eff('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x8eff('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x8eff('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x8eff('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x8eff('0x3')](_0x8eff('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x8eff('0x3')](_0x8eff('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x8eff('0x3')](_0x8eff('0x17'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x8eff('0x3')](_0x8eff('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x8eff('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x8eff('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x8eff('0x5')]},'queue_youarenext':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x8eff('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x8eff('0x5')]},'queue_periodic_announce':{'type':Sequelize[_0x8eff('0x5')]},'queue_less_than':{'type':Sequelize[_0x8eff('0x5')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x2ebf3a){this[_0x8eff('0x19')](_0x8eff('0x1a'),_0x2ebf3a?_0x2ebf3a[_0x8eff('0x1b')](','):[]);},'get':function(){return this[_0x8eff('0x1c')](_0x8eff('0x1a'))?this[_0x8eff('0x1c')](_0x8eff('0x1a'))[_0x8eff('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':_0x8eff('0x17'),'set':function(_0x324597){this['setDataValue'](_0x8eff('0x1e'),_0x324597?_0x324597[_0x8eff('0x1b')](','):undefined);},'get':function(){return this[_0x8eff('0x1c')](_0x8eff('0x1e'))?this['getDataValue'](_0x8eff('0x1e'))[_0x8eff('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x4e1256){this[_0x8eff('0x19')](_0x8eff('0x1f'),_0x4e1256?_0x4e1256['join'](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0x8eff('0x1c')]('leavewhenempty')[_0x8eff('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x8eff('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x8eff('0x3')](_0x8eff('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x8eff('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x8eff('0x3')](_0x8eff('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8eff('0x5')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0xba48d8){this['setDataValue'](_0x8eff('0x20'),_0xba48d8);if(_0xba48d8){if(this[_0x8eff('0x1c')](_0x8eff('0x21'))<0x2){this[_0x8eff('0x19')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x8eff('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x8eff('0x22')],'defaultValue':0x0,'comment':_0x8eff('0x23')},'dialMethod':{'type':Sequelize['ENUM'](_0x8eff('0x24'),_0x8eff('0x25'),_0x8eff('0x15'),_0x8eff('0x14'),_0x8eff('0x12')),'defaultValue':_0x8eff('0x25'),'comment':_0x8eff('0x26')},'dialLimitChannel':{'type':Sequelize[_0x8eff('0x16')](0x4)[_0x8eff('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x8eff('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8eff('0x28')},'dialPowerLevel':{'type':Sequelize[_0x8eff('0x29')](0x2)[_0x8eff('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x8eff('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x8eff('0x3')](_0x8eff('0x2b'),'dropRate'),'defaultValue':_0x8eff('0x2c'),'comment':_0x8eff('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x8eff('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x8eff('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x8eff('0x16')](0x3)[_0x8eff('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x8eff('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8eff('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8eff('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x8eff('0x16')](0x3)[_0x8eff('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':_0x8eff('0x30'),'comment':_0x8eff('0x31')},'dialQueueTimeout':{'type':Sequelize[_0x8eff('0x16')](0x3)[_0x8eff('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x8eff('0x5')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x8eff('0x16')](0x3)[_0x8eff('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8eff('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8eff('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8eff('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x8eff('0x16')](0x3)[_0x8eff('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8eff('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8eff('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8eff('0x16')](0x3)[_0x8eff('0x27')],'defaultValue':0x3,'comment':_0x8eff('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8eff('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x8eff('0x16')](0x3)[_0x8eff('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x8eff('0x36'),_0x8eff('0x37'),_0x8eff('0x38')),'defaultValue':_0x8eff('0x36')},'dialAMDActive':{'type':Sequelize[_0x8eff('0x22')],'defaultValue':0x0,'comment':_0x8eff('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x8eff('0x16')](0x9)[_0x8eff('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8eff('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x8eff('0x16')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8eff('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8eff('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8eff('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8eff('0x16')](0x9)[_0x8eff('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8eff('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0x8eff('0x16')](0x9)[_0x8eff('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8eff('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8eff('0x16')](0x9)[_0x8eff('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8eff('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8eff('0x16')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8eff('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8eff('0x16')](0x5)[_0x8eff('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8eff('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8eff('0x16')](0x9)[_0x8eff('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8eff('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x8eff('0x16')](0x5)[_0x8eff('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8eff('0x43')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8eff('0x3')](_0x8eff('0x44'),_0x8eff('0x45')),'defaultValue':_0x8eff('0x44')},'dialQueueProject2':{'type':Sequelize[_0x8eff('0x5')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x8eff('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x8eff('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8eff('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8eff('0x46')},'dialCutDigit':{'type':Sequelize[_0x8eff('0x16')](0x3)[_0x8eff('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8eff('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8eff('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8eff('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8eff('0x16')](0x5)[_0x8eff('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8eff('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0x8eff('0x16')](0x3)[_0x8eff('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x8eff('0x16')](0x5)[_0x8eff('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8eff('0x4a')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8eff('0x16')](0x3)[_0x8eff('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8eff('0x16')](0x5)[_0x8eff('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8eff('0x4b')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8eff('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x8eff('0x16')](0x5)[_0x8eff('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8eff('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8eff('0x16')](0x3)[_0x8eff('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8eff('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8eff('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8eff('0x16')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x8eff('0x22')],'defaultValue':![],'comment':_0x8eff('0x4e'),'set':function(_0x3064ae){if(!_0x3064ae)this[_0x8eff('0x19')](_0x8eff('0x4f'),null);this['setDataValue'](_0x8eff('0x50'),_0x3064ae);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x8eff('0x16')](0x3)[_0x8eff('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x8eff('0x16')](0x3)[_0x8eff('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index ce3fa99..f6d9e26 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 _0xe204=['each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','transaction','isEmpty','forEach','userVoiceQueue:remove','addAgents','spread','online','interface','format','removeAgents','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','insert','cm_hopper','phone','scheduledAt','ContactId','ListId','field','CmListId','NOW()','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','select','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','cm_contacts','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','destroy','then','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','find','UserProfileResource','error','name','send','VoiceQueue','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','keys','options','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','clone','omit','createdAt','updatedAt','getHoppers','CmHopper','nolimit','VoiceQueueId','getHopperHistories','findOne','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','Agents','voicePause','flatMap','penalty','sequelize'];(function(_0x58391a,_0x3cc666){var _0xe02c18=function(_0x5c1887){while(--_0x5c1887){_0x58391a['push'](_0x58391a['shift']());}};_0xe02c18(++_0x3cc666);}(_0xe204,0xfa));var _0x4e20=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe204[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x4e20('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4e20('0x1'));var rp=require(_0x4e20('0x2'));var moment=require(_0x4e20('0x3'));var BPromise=require(_0x4e20('0x4'));var Mustache=require('mustache');var util=require(_0x4e20('0x5'));var path=require(_0x4e20('0x6'));var sox=require(_0x4e20('0x7'));var csv=require('to-csv');var ejs=require(_0x4e20('0x8'));var fs=require('fs');var fs_extra=require(_0x4e20('0x9'));var _=require(_0x4e20('0xa'));var squel=require(_0x4e20('0xb'));var crypto=require(_0x4e20('0xc'));var jsforce=require(_0x4e20('0xd'));var deskjs=require(_0x4e20('0xe'));var toCsv=require(_0x4e20('0xf'));var querystring=require('querystring');var Papa=require(_0x4e20('0x10'));var Redis=require(_0x4e20('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(_0x4e20('0x12'))(_0x4e20('0x13'));var utils=require(_0x4e20('0x14'));var config=require(_0x4e20('0x15'));var licenseUtil=require(_0x4e20('0x16'));var db=require(_0x4e20('0x17'))['db'];config[_0x4e20('0x18')]=_['defaults'](config['redis'],{'host':_0x4e20('0x19'),'port':0x18eb});var socket=require(_0x4e20('0x1a'))(new Redis(config[_0x4e20('0x18')]));require(_0x4e20('0x1b'))['register'](socket);function respondWithStatusCode(_0x3413c3,_0x2d8c1d){_0x2d8c1d=_0x2d8c1d||0xcc;return function(_0xf33c4d){if(_0xf33c4d){return _0x3413c3[_0x4e20('0x1c')](_0x2d8c1d);}return _0x3413c3[_0x4e20('0x1d')](_0x2d8c1d)[_0x4e20('0x1e')]();};}function respondWithResult(_0x4e4e89,_0x5bae34){_0x5bae34=_0x5bae34||0xc8;return function(_0x1b598b){if(_0x1b598b){return _0x4e4e89[_0x4e20('0x1d')](_0x5bae34)[_0x4e20('0x1f')](_0x1b598b);}};}function respondWithFilteredResult(_0x1a3e9b,_0x4df7e5){return function(_0x1b055c){if(_0x1b055c){var _0x1b2002=typeof _0x4df7e5[_0x4e20('0x20')]==='undefined'&&typeof _0x4df7e5[_0x4e20('0x21')]===_0x4e20('0x22');var _0x377b34=_0x1b055c[_0x4e20('0x23')];var _0x536689=_0x1b2002?0x0:_0x4df7e5['offset'];var _0x409ea5=_0x1b2002?_0x1b055c[_0x4e20('0x23')]:_0x4df7e5[_0x4e20('0x20')]+_0x4df7e5[_0x4e20('0x21')];var _0x285b39;if(_0x409ea5>=_0x377b34){_0x409ea5=_0x377b34;_0x285b39=0xc8;}else{_0x285b39=0xce;}_0x1a3e9b['status'](_0x285b39);return _0x1a3e9b['set'](_0x4e20('0x24'),_0x536689+'-'+_0x409ea5+'/'+_0x377b34)['json'](_0x1b055c);}return null;};}function patchUpdates(_0x105b9a){return function(_0x1a2bee){try{jsonpatch[_0x4e20('0x25')](_0x1a2bee,_0x105b9a,!![]);}catch(_0x367bf9){return BPromise[_0x4e20('0x26')](_0x367bf9);}return _0x1a2bee['save']();};}function saveUpdates(_0x11fb2d,_0x3082ed){return function(_0x46069f){if(_0x46069f){return _0x46069f[_0x4e20('0x27')](_0x11fb2d)['then'](function(_0x1f9ec1){return _0x1f9ec1;});}return null;};}function removeEntity(_0x3201b9,_0x5486ce){return function(_0x1cc81a){if(_0x1cc81a){return _0x1cc81a[_0x4e20('0x28')]()[_0x4e20('0x29')](function(){var _0x106a77=_0x1cc81a['get']({'plain':!![]});var _0x49ba5e=[{'name':_0x4e20('0x2a'),'value':_0x4e20('0x2b'),'ignore':![]},{'name':_0x4e20('0x2c'),'value':_0x4e20('0x2d'),'ignore':![]}];var _0x18d6cd=_(_0x49ba5e)[_0x4e20('0x2e')](_0x4e20('0x2f'))[_0x4e20('0x30')](_0x4e20('0x31'))['value']();if(_['includes'](_0x18d6cd,_0x106a77[_0x4e20('0x32')])){return;}var _0x512a11=_[_0x4e20('0x33')](_0x49ba5e,[_0x4e20('0x31'),_0x106a77[_0x4e20('0x32')]])['name'];return db[_0x4e20('0x34')][_0x4e20('0x28')]({'where':{'type':_0x512a11,'resourceId':_0x106a77['id']}})[_0x4e20('0x29')](function(){return _0x1cc81a;});})[_0x4e20('0x29')](function(){_0x3201b9[_0x4e20('0x1d')](0xcc)[_0x4e20('0x1e')]();});}};}function handleEntityNotFound(_0x113c85,_0x195a83){return function(_0x55edae){if(!_0x55edae){_0x113c85['sendStatus'](0x194);}return _0x55edae;};}function handleError(_0x57aff8,_0x279286){_0x279286=_0x279286||0x1f4;return function(_0x5b4792){logger[_0x4e20('0x35')](_0x5b4792['stack']);if(_0x5b4792[_0x4e20('0x36')]){delete _0x5b4792['name'];}_0x57aff8[_0x4e20('0x1d')](_0x279286)[_0x4e20('0x37')](_0x5b4792);};}exports['index']=function(_0x63ed5b,_0x530695){var _0x400aa7={},_0x2035dc={},_0x3cf7d8={'count':0x0,'rows':[]};var _0x4a8924=_[_0x4e20('0x30')](db[_0x4e20('0x38')][_0x4e20('0x39')],function(_0x3995c7){return{'name':_0x3995c7['fieldName'],'type':_0x3995c7[_0x4e20('0x32')][_0x4e20('0x3a')]};});_0x2035dc[_0x4e20('0x3b')]=_[_0x4e20('0x30')](_0x4a8924,'name');_0x2035dc[_0x4e20('0x3c')]=_['keys'](_0x63ed5b['query']);_0x2035dc[_0x4e20('0x3d')]=_[_0x4e20('0x3e')](_0x2035dc[_0x4e20('0x3b')],_0x2035dc[_0x4e20('0x3c')]);_0x400aa7[_0x4e20('0x3f')]=_[_0x4e20('0x3e')](_0x2035dc[_0x4e20('0x3b')],qs[_0x4e20('0x40')](_0x63ed5b[_0x4e20('0x3c')][_0x4e20('0x40')]));_0x400aa7['attributes']=_0x400aa7['attributes'][_0x4e20('0x41')]?_0x400aa7['attributes']:_0x2035dc[_0x4e20('0x3b')];if(!_0x63ed5b['query'][_0x4e20('0x42')]('nolimit')){_0x400aa7[_0x4e20('0x21')]=qs[_0x4e20('0x21')](_0x63ed5b['query'][_0x4e20('0x21')]);_0x400aa7[_0x4e20('0x20')]=qs[_0x4e20('0x20')](_0x63ed5b[_0x4e20('0x3c')]['offset']);}_0x400aa7[_0x4e20('0x43')]=qs['sort'](_0x63ed5b['query'][_0x4e20('0x44')]);_0x400aa7[_0x4e20('0x45')]=qs['filters'](_[_0x4e20('0x46')](_0x63ed5b['query'],_0x2035dc[_0x4e20('0x3d')]),_0x4a8924);if(_0x63ed5b[_0x4e20('0x3c')]['filter']){_0x400aa7[_0x4e20('0x45')]=_['merge'](_0x400aa7[_0x4e20('0x45')],{'$or':_[_0x4e20('0x30')](_0x4a8924,function(_0x3d75fe){if(_0x3d75fe[_0x4e20('0x32')]!==_0x4e20('0x47')){var _0x3327cd={};_0x3327cd[_0x3d75fe[_0x4e20('0x36')]]={'$like':'%'+_0x63ed5b[_0x4e20('0x3c')][_0x4e20('0x2e')]+'%'};return _0x3327cd;}})});}_0x400aa7=_[_0x4e20('0x48')]({},_0x400aa7,_0x63ed5b['options']);var _0x226ef6={'where':_0x400aa7[_0x4e20('0x45')]};return db['VoiceQueue'][_0x4e20('0x23')](_0x226ef6)[_0x4e20('0x29')](function(_0xb3e3d7){_0x3cf7d8[_0x4e20('0x23')]=_0xb3e3d7;if(_0x63ed5b[_0x4e20('0x3c')][_0x4e20('0x49')]){_0x400aa7[_0x4e20('0x4a')]=[{'all':!![]}];}return db[_0x4e20('0x38')][_0x4e20('0x4b')](_0x400aa7);})['then'](function(_0x587de7){_0x3cf7d8[_0x4e20('0x4c')]=_0x587de7;return _0x3cf7d8;})[_0x4e20('0x29')](respondWithFilteredResult(_0x530695,_0x400aa7))[_0x4e20('0x4d')](handleError(_0x530695,null));};exports['show']=function(_0x197588,_0x27789a){var _0x1f8e9a={'raw':![],'where':{'id':_0x197588[_0x4e20('0x4e')]['id']}},_0x26ae5c={};_0x26ae5c[_0x4e20('0x3b')]=_['keys'](db[_0x4e20('0x38')][_0x4e20('0x39')]);_0x26ae5c[_0x4e20('0x3c')]=_[_0x4e20('0x4f')](_0x197588[_0x4e20('0x3c')]);_0x26ae5c[_0x4e20('0x3d')]=_[_0x4e20('0x3e')](_0x26ae5c[_0x4e20('0x3b')],_0x26ae5c[_0x4e20('0x3c')]);_0x1f8e9a['attributes']=_[_0x4e20('0x3e')](_0x26ae5c['model'],qs[_0x4e20('0x40')](_0x197588['query']['fields']));_0x1f8e9a[_0x4e20('0x3f')]=_0x1f8e9a['attributes'][_0x4e20('0x41')]?_0x1f8e9a[_0x4e20('0x3f')]:_0x26ae5c['model'];if(_0x197588['query']['includeAll']){_0x1f8e9a[_0x4e20('0x4a')]=[{'all':!![]}];}_0x1f8e9a=_[_0x4e20('0x48')]({},_0x1f8e9a,_0x197588[_0x4e20('0x50')]);return db['VoiceQueue'][_0x4e20('0x33')](_0x1f8e9a)[_0x4e20('0x29')](handleEntityNotFound(_0x27789a,null))[_0x4e20('0x29')](respondWithResult(_0x27789a,null))[_0x4e20('0x4d')](handleError(_0x27789a,null));};exports[_0x4e20('0x51')]=function(_0x4f6eca,_0x4b5942){return db[_0x4e20('0x38')][_0x4e20('0x51')](_0x4f6eca[_0x4e20('0x52')],{})[_0x4e20('0x29')](function(_0x308c7d){var _0x13ce6d=_0x4f6eca[_0x4e20('0x53')][_0x4e20('0x54')]({'plain':!![]});if(!_0x13ce6d)throw new Error(_0x4e20('0x55'));if(_0x13ce6d[_0x4e20('0x56')]==='user'){var _0x2cee6e=_0x308c7d['get']({'plain':!![]});var _0x37a074=[{'name':_0x4e20('0x2a'),'value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x5f370e=_[_0x4e20('0x33')](_0x37a074,['value',_0x2cee6e[_0x4e20('0x32')]])['name'];return db[_0x4e20('0x57')][_0x4e20('0x33')]({'where':{'name':_0x5f370e,'userProfileId':_0x13ce6d[_0x4e20('0x58')]},'raw':!![]})[_0x4e20('0x29')](function(_0x20992a){if(_0x20992a&&_0x20992a[_0x4e20('0x59')]===0x0){return db['UserProfileResource'][_0x4e20('0x51')]({'name':_0x2cee6e['name'],'resourceId':_0x2cee6e['id'],'type':_0x20992a[_0x4e20('0x36')],'sectionId':_0x20992a['id']},{})[_0x4e20('0x29')](function(){return _0x308c7d;});}else{return _0x308c7d;}})[_0x4e20('0x4d')](function(_0x45b032){logger[_0x4e20('0x35')](_0x4e20('0x5a'),_0x45b032);throw _0x45b032;});}return _0x308c7d;})[_0x4e20('0x29')](respondWithResult(_0x4b5942,0xc9))['catch'](handleError(_0x4b5942,null));};exports[_0x4e20('0x5b')]=function(_0x12e5b9,_0x1bda8f){var _0x5464bc={'where':{'id':_0x12e5b9['params']['id']}},_0x2f9f31={};_0x2f9f31['model']=_['keys'](db['VoiceQueue'][_0x4e20('0x39')]);_0x5464bc['attributes']=_[_0x4e20('0x3e')](_0x2f9f31[_0x4e20('0x3b')],qs[_0x4e20('0x40')](_0x12e5b9[_0x4e20('0x3c')][_0x4e20('0x40')]));_0x5464bc['attributes']=_0x5464bc[_0x4e20('0x3f')][_0x4e20('0x41')]?_0x5464bc['attributes']:_0x2f9f31[_0x4e20('0x3b')];if(_0x12e5b9[_0x4e20('0x3c')][_0x4e20('0x49')]){_0x5464bc['include']=[{'all':!![]}];}_0x5464bc=_[_0x4e20('0x48')]({},_0x5464bc,_0x12e5b9['options']);return db[_0x4e20('0x38')][_0x4e20('0x33')](_0x5464bc)['then'](handleEntityNotFound(_0x1bda8f,null))[_0x4e20('0x29')](function(_0x421956){if(_0x421956){var _0x5162af=_0x421956[_0x4e20('0x54')]({'plain':!![]});_0x5162af=qs[_0x4e20('0x5c')](_0x5162af,['id',_0x4e20('0x5d'),_0x4e20('0x5e')]);_0x12e5b9['body']=_['omit'](_0x12e5b9['body'],['id',_0x4e20('0x5d'),_0x4e20('0x5e')]);return db[_0x4e20('0x38')][_0x4e20('0x51')](_['merge'](_0x5162af,_0x12e5b9['body']),{'include':_0x12e5b9[_0x4e20('0x3c')][_0x4e20('0x49')]?[{'all':!![]}]:undefined})[_0x4e20('0x29')](function(_0x650fdc){var _0x5d6076=_0x12e5b9[_0x4e20('0x53')]['get']({'plain':!![]});if(!_0x5d6076)throw new Error(_0x4e20('0x55'));if(_0x5d6076[_0x4e20('0x56')]===_0x4e20('0x53')){var _0x4734b3=_0x650fdc[_0x4e20('0x54')]({'plain':!![]});var _0x170295=[{'name':_0x4e20('0x2a'),'value':_0x4e20('0x2b')},{'name':'QueueCampaigns','value':_0x4e20('0x2d')}];var _0x21ddf3=_[_0x4e20('0x33')](_0x170295,[_0x4e20('0x31'),_0x4734b3[_0x4e20('0x32')]])[_0x4e20('0x36')];return db[_0x4e20('0x57')][_0x4e20('0x33')]({'where':{'name':_0x21ddf3,'userProfileId':_0x5d6076[_0x4e20('0x58')]},'raw':!![]})[_0x4e20('0x29')](function(_0x25c385){if(_0x25c385&&_0x25c385[_0x4e20('0x59')]===0x0){return db[_0x4e20('0x34')][_0x4e20('0x51')]({'name':_0x4734b3[_0x4e20('0x36')],'resourceId':_0x4734b3['id'],'type':_0x25c385[_0x4e20('0x36')],'sectionId':_0x25c385['id']},{})[_0x4e20('0x29')](function(){return _0x650fdc;});}else{return _0x650fdc;}})[_0x4e20('0x4d')](function(_0x3b17ab){logger[_0x4e20('0x35')](_0x4e20('0x5a'),_0x3b17ab);throw _0x3b17ab;});}return _0x650fdc;});}})['then'](respondWithResult(_0x1bda8f,0xc9))['catch'](handleError(_0x1bda8f,null));};exports[_0x4e20('0x27')]=function(_0x2611ae,_0x4436fe){if(_0x2611ae[_0x4e20('0x52')]['id']){delete _0x2611ae[_0x4e20('0x52')]['id'];}return db[_0x4e20('0x38')][_0x4e20('0x33')]({'where':{'id':_0x2611ae[_0x4e20('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4436fe,null))[_0x4e20('0x29')](saveUpdates(_0x2611ae['body'],null))[_0x4e20('0x29')](respondWithResult(_0x4436fe,null))[_0x4e20('0x4d')](handleError(_0x4436fe,null));};exports[_0x4e20('0x28')]=function(_0x3a6913,_0x55364d){return db[_0x4e20('0x38')][_0x4e20('0x33')]({'where':{'id':_0x3a6913[_0x4e20('0x4e')]['id']}})[_0x4e20('0x29')](handleEntityNotFound(_0x55364d,null))['then'](removeEntity(_0x55364d,null))['catch'](handleError(_0x55364d,null));};exports[_0x4e20('0x5f')]=function(_0x225037,_0x4fcb69,_0xc79904){var _0x50c7e4={'raw':![],'where':{}};var _0x288822={};var _0x3d3d24={'count':0x0,'rows':[]};return db[_0x4e20('0x38')]['findOne']({'where':{'id':_0x225037[_0x4e20('0x4e')]['id']}})[_0x4e20('0x29')](handleEntityNotFound(_0x4fcb69,null))[_0x4e20('0x29')](function(_0x53a8b0){if(_0x53a8b0){_0x288822[_0x4e20('0x3b')]=_[_0x4e20('0x4f')](db[_0x4e20('0x60')][_0x4e20('0x39')]);_0x288822[_0x4e20('0x3c')]=_[_0x4e20('0x4f')](_0x225037[_0x4e20('0x3c')]);_0x288822[_0x4e20('0x3d')]=_[_0x4e20('0x3e')](_0x288822[_0x4e20('0x3b')],_0x288822[_0x4e20('0x3c')]);_0x50c7e4[_0x4e20('0x3f')]=_[_0x4e20('0x3e')](_0x288822[_0x4e20('0x3b')],qs[_0x4e20('0x40')](_0x225037['query'][_0x4e20('0x40')]));_0x50c7e4['attributes']=_0x50c7e4[_0x4e20('0x3f')]['length']?_0x50c7e4[_0x4e20('0x3f')]:_0x288822[_0x4e20('0x3b')];if(!_0x225037['query'][_0x4e20('0x42')](_0x4e20('0x61'))){_0x50c7e4['limit']=qs[_0x4e20('0x21')](_0x225037[_0x4e20('0x3c')][_0x4e20('0x21')]);_0x50c7e4[_0x4e20('0x20')]=qs[_0x4e20('0x20')](_0x225037[_0x4e20('0x3c')][_0x4e20('0x20')]);}_0x50c7e4[_0x4e20('0x43')]=qs[_0x4e20('0x44')](_0x225037[_0x4e20('0x3c')][_0x4e20('0x44')]);_0x50c7e4[_0x4e20('0x45')]=qs[_0x4e20('0x3d')](_['pick'](_0x225037[_0x4e20('0x3c')],_0x288822[_0x4e20('0x3d')]));_0x50c7e4[_0x4e20('0x45')][_0x4e20('0x62')]=_0x53a8b0['id'];if(_0x225037['query'][_0x4e20('0x2e')]){_0x50c7e4['where']=_[_0x4e20('0x48')](_0x50c7e4[_0x4e20('0x45')],{'$or':_[_0x4e20('0x30')](_0x50c7e4[_0x4e20('0x3f')],function(_0x3251f8){var _0x36d8d7={};_0x36d8d7[_0x3251f8]={'$like':'%'+_0x225037[_0x4e20('0x3c')][_0x4e20('0x2e')]+'%'};return _0x36d8d7;})});}_0x50c7e4=_['merge']({},_0x50c7e4,_0x225037['options']);return db['CmHopper'][_0x4e20('0x23')]({'where':_0x50c7e4[_0x4e20('0x45')]})[_0x4e20('0x29')](function(_0x3240f9){_0x3d3d24['count']=_0x3240f9;if(_0x225037['query'][_0x4e20('0x49')]){_0x50c7e4[_0x4e20('0x4a')]=[{'all':!![]}];}return db[_0x4e20('0x60')][_0x4e20('0x4b')](_0x50c7e4);})[_0x4e20('0x29')](function(_0x64099c){_0x3d3d24[_0x4e20('0x4c')]=_0x64099c;return _0x3d3d24;});}})[_0x4e20('0x29')](respondWithFilteredResult(_0x4fcb69,_0x50c7e4))[_0x4e20('0x4d')](handleError(_0x4fcb69,null));};exports[_0x4e20('0x63')]=function(_0x14ef70,_0x35e30d,_0x39352d){var _0x219f97={'raw':!![],'where':{}};var _0x3d96c8={};var _0x2b8443={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x4e20('0x64')]({'where':{'id':_0x14ef70[_0x4e20('0x4e')]['id']}})[_0x4e20('0x29')](handleEntityNotFound(_0x35e30d,null))['then'](function(_0x1acbd1){if(_0x1acbd1){_0x3d96c8[_0x4e20('0x3b')]=_[_0x4e20('0x4f')](db['CmHopperHistory'][_0x4e20('0x39')]);_0x3d96c8[_0x4e20('0x3c')]=_['keys'](_0x14ef70[_0x4e20('0x3c')]);_0x3d96c8[_0x4e20('0x3d')]=_[_0x4e20('0x3e')](_0x3d96c8[_0x4e20('0x3b')],_0x3d96c8['query']);_0x219f97[_0x4e20('0x3f')]=_[_0x4e20('0x3e')](_0x3d96c8['model'],qs['fields'](_0x14ef70[_0x4e20('0x3c')][_0x4e20('0x40')]));_0x219f97[_0x4e20('0x3f')]=_0x219f97[_0x4e20('0x3f')][_0x4e20('0x41')]?_0x219f97[_0x4e20('0x3f')]:_0x3d96c8[_0x4e20('0x3b')];if(!_0x14ef70[_0x4e20('0x3c')]['hasOwnProperty'](_0x4e20('0x61'))){_0x219f97[_0x4e20('0x21')]=qs[_0x4e20('0x21')](_0x14ef70[_0x4e20('0x3c')][_0x4e20('0x21')]);_0x219f97[_0x4e20('0x20')]=qs['offset'](_0x14ef70['query'][_0x4e20('0x20')]);}_0x219f97[_0x4e20('0x43')]=qs[_0x4e20('0x44')](_0x14ef70[_0x4e20('0x3c')]['sort']);_0x219f97[_0x4e20('0x45')]=qs[_0x4e20('0x3d')](_[_0x4e20('0x46')](_0x14ef70[_0x4e20('0x3c')],_0x3d96c8['filters']));_0x219f97[_0x4e20('0x45')]['VoiceQueueId']=_0x1acbd1['id'];if(_0x14ef70[_0x4e20('0x3c')][_0x4e20('0x2e')]){_0x219f97[_0x4e20('0x45')]=_['merge'](_0x219f97[_0x4e20('0x45')],{'$or':_[_0x4e20('0x30')](_0x219f97['attributes'],function(_0xce9a2a){var _0x444160={};_0x444160[_0xce9a2a]={'$like':'%'+_0x14ef70[_0x4e20('0x3c')][_0x4e20('0x2e')]+'%'};return _0x444160;})});}_0x219f97=_[_0x4e20('0x48')]({},_0x219f97,_0x14ef70[_0x4e20('0x50')]);return db['CmHopperHistory'][_0x4e20('0x23')]({'where':_0x219f97[_0x4e20('0x45')]})[_0x4e20('0x29')](function(_0x1a759f){_0x2b8443[_0x4e20('0x23')]=_0x1a759f;if(_0x14ef70['query']['includeAll']){_0x219f97[_0x4e20('0x4a')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x4e20('0x4b')](_0x219f97);})[_0x4e20('0x29')](function(_0x41684b){_0x2b8443[_0x4e20('0x4c')]=_0x41684b;return _0x2b8443;});}})[_0x4e20('0x29')](respondWithFilteredResult(_0x35e30d,_0x219f97))['catch'](handleError(_0x35e30d,null));};exports[_0x4e20('0x65')]=function(_0x4ea749,_0x40e499,_0x21463d){var _0x59dcb8={'raw':!![],'where':{}};var _0x1e65a2={};var _0x5d6718={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x4e20('0x64')]({'where':{'id':_0x4ea749[_0x4e20('0x4e')]['id']}})[_0x4e20('0x29')](handleEntityNotFound(_0x40e499,null))[_0x4e20('0x29')](function(_0x123ce2){if(_0x123ce2){_0x1e65a2['model']=_[_0x4e20('0x4f')](db['CmHopperFinal'][_0x4e20('0x39')]);_0x1e65a2[_0x4e20('0x3c')]=_[_0x4e20('0x4f')](_0x4ea749[_0x4e20('0x3c')]);_0x1e65a2['filters']=_[_0x4e20('0x3e')](_0x1e65a2[_0x4e20('0x3b')],_0x1e65a2[_0x4e20('0x3c')]);_0x59dcb8[_0x4e20('0x3f')]=_[_0x4e20('0x3e')](_0x1e65a2[_0x4e20('0x3b')],qs[_0x4e20('0x40')](_0x4ea749[_0x4e20('0x3c')][_0x4e20('0x40')]));_0x59dcb8[_0x4e20('0x3f')]=_0x59dcb8[_0x4e20('0x3f')][_0x4e20('0x41')]?_0x59dcb8[_0x4e20('0x3f')]:_0x1e65a2[_0x4e20('0x3b')];if(!_0x4ea749[_0x4e20('0x3c')]['hasOwnProperty'](_0x4e20('0x61'))){_0x59dcb8[_0x4e20('0x21')]=qs[_0x4e20('0x21')](_0x4ea749[_0x4e20('0x3c')][_0x4e20('0x21')]);_0x59dcb8['offset']=qs[_0x4e20('0x20')](_0x4ea749[_0x4e20('0x3c')]['offset']);}_0x59dcb8[_0x4e20('0x43')]=qs[_0x4e20('0x44')](_0x4ea749[_0x4e20('0x3c')]['sort']);_0x59dcb8['where']=qs[_0x4e20('0x3d')](_[_0x4e20('0x46')](_0x4ea749[_0x4e20('0x3c')],_0x1e65a2[_0x4e20('0x3d')]));_0x59dcb8[_0x4e20('0x45')][_0x4e20('0x62')]=_0x123ce2['id'];if(_0x4ea749[_0x4e20('0x3c')][_0x4e20('0x2e')]){_0x59dcb8['where']=_[_0x4e20('0x48')](_0x59dcb8[_0x4e20('0x45')],{'$or':_[_0x4e20('0x30')](_0x59dcb8[_0x4e20('0x3f')],function(_0x7d47a0){var _0x48bf43={};_0x48bf43[_0x7d47a0]={'$like':'%'+_0x4ea749['query']['filter']+'%'};return _0x48bf43;})});}_0x59dcb8=_[_0x4e20('0x48')]({},_0x59dcb8,_0x4ea749[_0x4e20('0x50')]);return db['CmHopperFinal'][_0x4e20('0x23')]({'where':_0x59dcb8[_0x4e20('0x45')]})[_0x4e20('0x29')](function(_0x83ff3e){_0x5d6718[_0x4e20('0x23')]=_0x83ff3e;if(_0x4ea749[_0x4e20('0x3c')][_0x4e20('0x49')]){_0x59dcb8[_0x4e20('0x4a')]=[{'all':!![]}];}return db[_0x4e20('0x66')][_0x4e20('0x4b')](_0x59dcb8);})[_0x4e20('0x29')](function(_0x31a218){_0x5d6718[_0x4e20('0x4c')]=_0x31a218;return _0x5d6718;});}})[_0x4e20('0x29')](respondWithFilteredResult(_0x40e499,_0x59dcb8))[_0x4e20('0x4d')](handleError(_0x40e499,null));};exports[_0x4e20('0x67')]=function(_0x1ef234,_0x3b6321,_0x53ca27){var _0x4aa41d={'raw':!![],'where':{}};var _0x2a2fbc={};var _0x2aa4f2={'count':0x0,'rows':[]};return db[_0x4e20('0x38')][_0x4e20('0x64')]({'where':{'id':_0x1ef234[_0x4e20('0x4e')]['id']}})[_0x4e20('0x29')](handleEntityNotFound(_0x3b6321,null))[_0x4e20('0x29')](function(_0x11e7ca){if(_0x11e7ca){_0x2a2fbc[_0x4e20('0x3b')]=_[_0x4e20('0x4f')](db[_0x4e20('0x68')][_0x4e20('0x39')]);_0x2a2fbc[_0x4e20('0x3c')]=_[_0x4e20('0x4f')](_0x1ef234[_0x4e20('0x3c')]);_0x2a2fbc[_0x4e20('0x3d')]=_[_0x4e20('0x3e')](_0x2a2fbc[_0x4e20('0x3b')],_0x2a2fbc[_0x4e20('0x3c')]);_0x4aa41d[_0x4e20('0x3f')]=_[_0x4e20('0x3e')](_0x2a2fbc['model'],qs['fields'](_0x1ef234[_0x4e20('0x3c')][_0x4e20('0x40')]));_0x4aa41d[_0x4e20('0x3f')]=_0x4aa41d[_0x4e20('0x3f')][_0x4e20('0x41')]?_0x4aa41d[_0x4e20('0x3f')]:_0x2a2fbc[_0x4e20('0x3b')];if(!_0x1ef234['query']['hasOwnProperty']('nolimit')){_0x4aa41d[_0x4e20('0x21')]=qs['limit'](_0x1ef234[_0x4e20('0x3c')][_0x4e20('0x21')]);_0x4aa41d[_0x4e20('0x20')]=qs[_0x4e20('0x20')](_0x1ef234[_0x4e20('0x3c')][_0x4e20('0x20')]);}_0x4aa41d[_0x4e20('0x43')]=qs[_0x4e20('0x44')](_0x1ef234[_0x4e20('0x3c')]['sort']);_0x4aa41d['where']=qs[_0x4e20('0x3d')](_[_0x4e20('0x46')](_0x1ef234[_0x4e20('0x3c')],_0x2a2fbc[_0x4e20('0x3d')]));_0x4aa41d[_0x4e20('0x45')]['VoiceQueueId']=_0x11e7ca['id'];if(_0x1ef234[_0x4e20('0x3c')][_0x4e20('0x2e')]){_0x4aa41d[_0x4e20('0x45')]=_['merge'](_0x4aa41d['where'],{'$or':_[_0x4e20('0x30')](_0x4aa41d[_0x4e20('0x3f')],function(_0x160342){var _0x21e2ab={};_0x21e2ab[_0x160342]={'$like':'%'+_0x1ef234[_0x4e20('0x3c')]['filter']+'%'};return _0x21e2ab;})});}_0x4aa41d=_['merge']({},_0x4aa41d,_0x1ef234['options']);return db['CmHopperBlack']['count']({'where':_0x4aa41d[_0x4e20('0x45')]})[_0x4e20('0x29')](function(_0x765c5b){_0x2aa4f2[_0x4e20('0x23')]=_0x765c5b;if(_0x1ef234[_0x4e20('0x3c')][_0x4e20('0x49')]){_0x4aa41d['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x4e20('0x4b')](_0x4aa41d);})['then'](function(_0x554c61){_0x2aa4f2['rows']=_0x554c61;return _0x2aa4f2;});}})[_0x4e20('0x29')](respondWithFilteredResult(_0x3b6321,_0x4aa41d))[_0x4e20('0x4d')](handleError(_0x3b6321,null));};exports[_0x4e20('0x69')]=function(_0x5db956,_0x2670b4,_0x4308c1){var _0x4cb379={};var _0x41f3f9={};var _0x46b575;var _0x506cae;return db[_0x4e20('0x38')]['findOne']({'where':{'id':_0x5db956[_0x4e20('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2670b4,null))[_0x4e20('0x29')](function(_0xad8e82){if(_0xad8e82){_0x46b575=_0xad8e82;_0x41f3f9[_0x4e20('0x3b')]=_[_0x4e20('0x4f')](db[_0x4e20('0x6a')]['rawAttributes']);_0x41f3f9[_0x4e20('0x3c')]=_['keys'](_0x5db956[_0x4e20('0x3c')]);_0x41f3f9[_0x4e20('0x3d')]=_['intersection'](_0x41f3f9[_0x4e20('0x3b')],_0x41f3f9[_0x4e20('0x3c')]);_0x4cb379[_0x4e20('0x3f')]=_[_0x4e20('0x3e')](_0x41f3f9[_0x4e20('0x3b')],qs[_0x4e20('0x40')](_0x5db956['query'][_0x4e20('0x40')]));_0x4cb379['attributes']=_0x4cb379['attributes'][_0x4e20('0x41')]?_0x4cb379['attributes']:_0x41f3f9[_0x4e20('0x3b')];_0x4cb379[_0x4e20('0x43')]=qs['sort'](_0x5db956[_0x4e20('0x3c')][_0x4e20('0x44')]);_0x4cb379[_0x4e20('0x45')]=qs[_0x4e20('0x3d')](_['pick'](_0x5db956[_0x4e20('0x3c')],_0x41f3f9[_0x4e20('0x3d')]));if(_0x5db956[_0x4e20('0x3c')]['filter']){_0x4cb379[_0x4e20('0x45')]=_[_0x4e20('0x48')](_0x4cb379['where'],{'$or':_[_0x4e20('0x30')](_0x4cb379[_0x4e20('0x3f')],function(_0x137b36){var _0x52e5ef={};_0x52e5ef[_0x137b36]={'$like':'%'+_0x5db956[_0x4e20('0x3c')]['filter']+'%'};return _0x52e5ef;})});}_0x4cb379=_[_0x4e20('0x48')]({},_0x4cb379,_0x5db956[_0x4e20('0x50')]);return _0x46b575[_0x4e20('0x69')](_0x4cb379);}})[_0x4e20('0x29')](function(_0x30fa9e){if(_0x30fa9e){_0x506cae=_0x30fa9e[_0x4e20('0x41')];if(!_0x5db956[_0x4e20('0x3c')]['hasOwnProperty'](_0x4e20('0x61'))){_0x4cb379[_0x4e20('0x21')]=qs['limit'](_0x5db956[_0x4e20('0x3c')][_0x4e20('0x21')]);_0x4cb379['offset']=qs[_0x4e20('0x20')](_0x5db956[_0x4e20('0x3c')]['offset']);}return _0x46b575['getTeams'](_0x4cb379);}})[_0x4e20('0x29')](function(_0x4668d5){if(_0x4668d5){return _0x4668d5?{'count':_0x506cae,'rows':_0x4668d5}:null;}})['then'](respondWithResult(_0x2670b4,null))[_0x4e20('0x4d')](handleError(_0x2670b4,null));};exports[_0x4e20('0x6b')]=function(_0x50181b,_0x2db45e,_0x382869){var _0x2def54=_0x50181b['body']['teams'];var _0x2b3a24=_[_0x4e20('0x30')](_0x2def54,'id');return db['Team'][_0x4e20('0x4b')]({'where':{'id':_0x2b3a24},'attributes':['id'],'include':[{'model':db[_0x4e20('0x6c')],'as':_0x4e20('0x6d'),'attributes':['id',_0x4e20('0x36'),'online',_0x4e20('0x6e'),'interface'],'raw':!![]}]})['then'](function(_0x1029dd){if(_0x1029dd){var _0x5a5da3=_[_0x4e20('0x6f')](_0x1029dd,function(_0x291e29){var _0x3c47e1=_0x291e29[_0x4e20('0x54')]({'plain':!![]});_0x3c47e1['Agents']['forEach'](function(_0x51e3fe){_0x51e3fe[_0x4e20('0x70')]=_['find'](_0x2def54,{'id':_0x3c47e1['id']})[_0x4e20('0x70')];});return _0x3c47e1[_0x4e20('0x6d')];});return db['VoiceQueue'][_0x4e20('0x33')]({'where':{'id':_0x50181b['params']['id']}})[_0x4e20('0x29')](function(_0x2f472f){return db[_0x4e20('0x71')]['transaction'](function(_0x239b94){return _0x2f472f[_0x4e20('0x6b')](_0x2b3a24,{'transaction':_0x239b94})[_0x4e20('0x29')](function(){return BPromise[_0x4e20('0x72')](_0x2def54,function(_0x54f956){return db[_0x4e20('0x73')][_0x4e20('0x74')]({'TeamId':_0x54f956['id'],'VoiceQueueId':_0x50181b[_0x4e20('0x4e')]['id'],'penalty':_0x54f956['penalty']},{'transaction':_0x239b94});});})['then'](function(){return BPromise[_0x4e20('0x72')](_0x5a5da3,function(_0x441a42){return db['UserVoiceQueue'][_0x4e20('0x75')]({'where':{'UserId':_0x441a42['id'],'VoiceQueueId':_0x50181b[_0x4e20('0x4e')]['id']},'defaults':{'penalty':_0x441a42[_0x4e20('0x70')]},'transaction':_0x239b94});});})['then'](function(){return BPromise[_0x4e20('0x72')](_['filter'](_0x5a5da3,{'online':!![]}),function(_0x2085e1){return db[_0x4e20('0x76')][_0x4e20('0x74')]({'membername':_0x2085e1[_0x4e20('0x36')],'UserId':_0x2085e1['id'],'queue_name':_0x2f472f[_0x4e20('0x36')],'VoiceQueueId':_0x2f472f['id'],'interface':_[_0x4e20('0x77')](_0x2085e1['interface'])?util['format'](_0x4e20('0x78'),_0x2085e1[_0x4e20('0x36')]):_0x2085e1['interface'],'paused':_0x2085e1[_0x4e20('0x6e')]||![],'penalty':_0x2085e1['penalty']},{'transaction':_0x239b94});});})[_0x4e20('0x29')](function(){_0x5a5da3['forEach'](function(_0x111680){socket[_0x4e20('0x79')](_0x4e20('0x7a'),{'UserId':_0x111680['id'],'VoiceQueueId':_0x2f472f['id']});});});});});}})[_0x4e20('0x29')](respondWithStatusCode(_0x2db45e,null))[_0x4e20('0x4d')](handleError(_0x2db45e,null));};exports[_0x4e20('0x7b')]=function(_0x34d3f7,_0x5dd435,_0x33e8e1){return db[_0x4e20('0x6a')][_0x4e20('0x4b')]({'where':{'id':_0x34d3f7[_0x4e20('0x3c')][_0x4e20('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x4e20('0x6c')],'as':_0x4e20('0x6d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5dd435,null))['then'](function(_0x54a89c){var _0x5e705b=_[_0x4e20('0x30')](_0x54a89c,'id');var _0x2f165c=[];var _0x371f79=[];var _0x519678=squel['select']();_0x519678['field']('tq.TeamId')[_0x4e20('0x7d')](_0x4e20('0x7e'),'tq')[_0x4e20('0x7f')](_0x4e20('0x80'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x4e20('0x45')](_0x4e20('0x81'),_0x34d3f7[_0x4e20('0x4e')]['id']);for(var _0x14f792=0x0;_0x14f792<_0x54a89c[_0x4e20('0x41')];_0x14f792+=0x1){let _0x24dfdd=_0x54a89c[_0x14f792];for(var _0x390e1d=0x0;_0x390e1d<_0x24dfdd[_0x4e20('0x6d')][_0x4e20('0x41')];_0x390e1d+=0x1){let _0x314568=_0x24dfdd[_0x4e20('0x6d')][_0x390e1d];var _0x4cf4f2=_0x519678['clone']();_0x4cf4f2[_0x4e20('0x45')](_0x4e20('0x82'),_0x314568['id']);_0x371f79[_0x4e20('0x83')](db['sequelize'][_0x4e20('0x3c')](_0x4cf4f2[_0x4e20('0x84')](),{'type':db[_0x4e20('0x71')][_0x4e20('0x85')][_0x4e20('0x86')]})['then'](function(_0x32e82c){if(_0x32e82c['length']===0x1){return _0x314568['id'];}else{var _0x4aff10=_[_0x4e20('0x87')](_[_0x4e20('0x30')](_0x32e82c,_0x4e20('0x88')),function(_0x7703e3){return _[_0x4e20('0x89')](_0x5e705b,_0x7703e3);});if(_0x4aff10){return _0x314568['id'];}}}));}}return BPromise[_0x4e20('0x8a')](_0x371f79)[_0x4e20('0x29')](function(_0x4e6a6e){_0x2f165c=_(_0x2f165c)[_0x4e20('0x8b')](_0x4e6a6e)[_0x4e20('0x8c')]()[_0x4e20('0x31')]();return db['VoiceQueue'][_0x4e20('0x33')]({'where':{'id':_0x34d3f7[_0x4e20('0x4e')]['id']}})[_0x4e20('0x29')](function(_0x3654b0){return db[_0x4e20('0x71')][_0x4e20('0x8d')](function(_0x144006){return _0x3654b0[_0x4e20('0x7b')](_0x34d3f7[_0x4e20('0x3c')][_0x4e20('0x7c')],{'transaction':_0x144006})['then'](function(){if(!_[_0x4e20('0x8e')](_0x2f165c)){return _0x3654b0['removeAgents'](_0x2f165c,{'transaction':_0x144006})['then'](function(){return db['UserVoiceQueueRt'][_0x4e20('0x28')]({'where':{'VoiceQueueId':_0x34d3f7['params']['id'],'UserId':_0x2f165c},'transaction':_0x144006});});}})[_0x4e20('0x29')](function(){_0x2f165c[_0x4e20('0x8f')](function(_0x2c67f2){socket[_0x4e20('0x79')](_0x4e20('0x90'),{'UserId':_0x2c67f2,'VoiceQueueId':_0x3654b0['id']});});});});});});})[_0x4e20('0x29')](respondWithStatusCode(_0x5dd435,null))['catch'](handleError(_0x5dd435,null));};exports[_0x4e20('0x91')]=function(_0x4315ea,_0x5ebce5,_0x74b10c){var _0x31bbaa,_0xb2f462;return db[_0x4e20('0x38')]['find']({'where':{'id':_0x4315ea[_0x4e20('0x4e')]['id']}})[_0x4e20('0x29')](handleEntityNotFound(_0x5ebce5,null))[_0x4e20('0x29')](function(_0x84031e){if(_0x84031e){_0xb2f462=_0x84031e;return _0x84031e[_0x4e20('0x91')](_0x4315ea['body'][_0x4e20('0x7c')],_['omit'](_0x4315ea['body'],['ids','id'])||{})[_0x4e20('0x92')](function(_0x2cba2e){for(var _0x463b57=0x0;_0x463b57<_0x4315ea[_0x4e20('0x52')][_0x4e20('0x7c')][_0x4e20('0x41')];_0x463b57+=0x1){socket[_0x4e20('0x79')](_0x4e20('0x7a'),{'UserId':Number(_0x4315ea[_0x4e20('0x52')][_0x4e20('0x7c')][_0x463b57]),'VoiceQueueId':Number(_0x4315ea['params']['id'])});}return _0x2cba2e;});}})['then'](function(_0x5bcea1){_0x31bbaa=_0x5bcea1||[];if(_0xb2f462){return db[_0x4e20('0x6c')][_0x4e20('0x4b')]({'where':{'id':_0x4315ea[_0x4e20('0x52')]['ids']},'attributes':['id',_0x4e20('0x36'),_0x4e20('0x93'),_0x4e20('0x6e'),_0x4e20('0x94')],'raw':!![]});}})[_0x4e20('0x29')](function(_0x3b5706){if(!_[_0x4e20('0x8e')](_0x3b5706)){var _0x37b7b3=[];for(var _0x3fc1d8=0x0;_0x3fc1d8<_0x3b5706[_0x4e20('0x41')];_0x3fc1d8++){if(_0x3b5706[_0x3fc1d8]['online']){_0x37b7b3[_0x4e20('0x83')](db[_0x4e20('0x76')]['upsert']({'membername':_0x3b5706[_0x3fc1d8][_0x4e20('0x36')],'UserId':_0x3b5706[_0x3fc1d8]['id'],'queue_name':_0xb2f462[_0x4e20('0x36')],'VoiceQueueId':_0xb2f462['id'],'interface':_[_0x4e20('0x77')](_0x3b5706[_0x3fc1d8][_0x4e20('0x94')])?util[_0x4e20('0x95')](_0x4e20('0x78'),_0x3b5706[_0x3fc1d8][_0x4e20('0x36')]):_0x3b5706[_0x3fc1d8][_0x4e20('0x94')],'paused':_0x3b5706[_0x3fc1d8][_0x4e20('0x6e')]||![],'penalty':_0x4315ea[_0x4e20('0x52')][_0x4e20('0x70')]||0x0}));}}return BPromise[_0x4e20('0x8a')](_0x37b7b3);}})[_0x4e20('0x29')](function(){return _0x31bbaa;})[_0x4e20('0x29')](respondWithResult(_0x5ebce5,null))['catch'](handleError(_0x5ebce5,null));};exports[_0x4e20('0x96')]=function(_0x284433,_0x469730,_0x1c16bc){return db[_0x4e20('0x38')][_0x4e20('0x33')]({'where':{'id':_0x284433[_0x4e20('0x4e')]['id']}})[_0x4e20('0x29')](handleEntityNotFound(_0x469730,null))[_0x4e20('0x29')](function(_0x186d5d){if(_0x186d5d){return _0x186d5d[_0x4e20('0x96')](_0x284433[_0x4e20('0x3c')]['ids'])[_0x4e20('0x29')](function(){if(_[_0x4e20('0x97')](_0x284433[_0x4e20('0x3c')][_0x4e20('0x7c')])){for(var _0x5d7e40=0x0;_0x5d7e40<_0x284433[_0x4e20('0x3c')]['ids'][_0x4e20('0x41')];_0x5d7e40+=0x1){socket[_0x4e20('0x79')]('userVoiceQueue:remove',{'UserId':Number(_0x284433[_0x4e20('0x3c')][_0x4e20('0x7c')][_0x5d7e40]),'VoiceQueueId':Number(_0x284433[_0x4e20('0x4e')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x284433[_0x4e20('0x3c')][_0x4e20('0x7c')]),'VoiceQueueId':Number(_0x284433[_0x4e20('0x4e')]['id'])});}});}})[_0x4e20('0x29')](function(_0x290771){return db[_0x4e20('0x76')][_0x4e20('0x28')]({'where':{'VoiceQueueId':_0x284433[_0x4e20('0x4e')]['id'],'UserId':_0x284433[_0x4e20('0x3c')][_0x4e20('0x7c')]}})['then'](function(){return _0x290771;});})[_0x4e20('0x29')](respondWithStatusCode(_0x469730,null))['catch'](handleError(_0x469730,null));};exports[_0x4e20('0x98')]=function(_0x4f2ea4,_0x259843,_0x1ac14c){var _0x2537fa={};var _0x44ff4d={};var _0x3f8419;var _0x4b7e9e;return db[_0x4e20('0x38')][_0x4e20('0x64')]({'where':{'id':_0x4f2ea4[_0x4e20('0x4e')]['id']}})[_0x4e20('0x29')](handleEntityNotFound(_0x259843,null))['then'](function(_0x330128){if(_0x330128){_0x3f8419=_0x330128;_0x44ff4d[_0x4e20('0x3b')]=_['keys'](db[_0x4e20('0x6c')][_0x4e20('0x39')]);_0x44ff4d['query']=_[_0x4e20('0x4f')](_0x4f2ea4['query']);_0x44ff4d[_0x4e20('0x3d')]=_[_0x4e20('0x3e')](_0x44ff4d[_0x4e20('0x3b')],_0x44ff4d[_0x4e20('0x3c')]);_0x2537fa[_0x4e20('0x3f')]=_['intersection'](_0x44ff4d[_0x4e20('0x3b')],qs[_0x4e20('0x40')](_0x4f2ea4['query']['fields']));_0x2537fa[_0x4e20('0x3f')]=_0x2537fa[_0x4e20('0x3f')]['length']?_0x2537fa[_0x4e20('0x3f')]:_0x44ff4d['model'];_0x2537fa[_0x4e20('0x43')]=qs['sort'](_0x4f2ea4['query'][_0x4e20('0x44')]);_0x2537fa[_0x4e20('0x45')]=qs[_0x4e20('0x3d')](_[_0x4e20('0x46')](_0x4f2ea4[_0x4e20('0x3c')],_0x44ff4d[_0x4e20('0x3d')]));if(_0x4f2ea4[_0x4e20('0x3c')][_0x4e20('0x2e')]){_0x2537fa[_0x4e20('0x45')]=_[_0x4e20('0x48')](_0x2537fa[_0x4e20('0x45')],{'$or':_[_0x4e20('0x30')](_0x2537fa[_0x4e20('0x3f')],function(_0x2688b5){var _0x58eaf6={};_0x58eaf6[_0x2688b5]={'$like':'%'+_0x4f2ea4[_0x4e20('0x3c')][_0x4e20('0x2e')]+'%'};return _0x58eaf6;})});}_0x2537fa=_['merge']({},_0x2537fa,_0x4f2ea4['options']);return _0x3f8419[_0x4e20('0x98')](_0x2537fa);}})[_0x4e20('0x29')](function(_0x3af5a2){if(_0x3af5a2){_0x4b7e9e=_0x3af5a2['length'];if(!_0x4f2ea4[_0x4e20('0x3c')][_0x4e20('0x42')](_0x4e20('0x61'))){_0x2537fa[_0x4e20('0x21')]=qs[_0x4e20('0x21')](_0x4f2ea4['query'][_0x4e20('0x21')]);_0x2537fa[_0x4e20('0x20')]=qs['offset'](_0x4f2ea4[_0x4e20('0x3c')][_0x4e20('0x20')]);}return _0x3f8419[_0x4e20('0x98')](_0x2537fa);}})[_0x4e20('0x29')](function(_0x468882){if(_0x468882){return _0x468882?{'count':_0x4b7e9e,'rows':_0x468882}:null;}})[_0x4e20('0x29')](respondWithResult(_0x259843,null))[_0x4e20('0x4d')](handleError(_0x259843,null));};exports[_0x4e20('0x99')]=function(_0x4425e4,_0x58e655,_0x5aa91b){var _0x2a96d1={};var _0x21b068={};var _0x350f81;var _0x4ce2f9;return db[_0x4e20('0x38')]['findOne']({'where':{'id':_0x4425e4[_0x4e20('0x4e')]['id']}})[_0x4e20('0x29')](handleEntityNotFound(_0x58e655,null))[_0x4e20('0x29')](function(_0x348de8){if(_0x348de8){_0x350f81=_0x348de8;_0x21b068['model']=_[_0x4e20('0x4f')](db[_0x4e20('0x76')][_0x4e20('0x39')]);_0x21b068['query']=_['keys'](_0x4425e4[_0x4e20('0x3c')]);_0x21b068['filters']=_[_0x4e20('0x3e')](_0x21b068[_0x4e20('0x3b')],_0x21b068[_0x4e20('0x3c')]);_0x2a96d1['attributes']=_[_0x4e20('0x3e')](_0x21b068[_0x4e20('0x3b')],qs[_0x4e20('0x40')](_0x4425e4[_0x4e20('0x3c')][_0x4e20('0x40')]));_0x2a96d1[_0x4e20('0x3f')]=_0x2a96d1[_0x4e20('0x3f')][_0x4e20('0x41')]?_0x2a96d1['attributes']:_0x21b068[_0x4e20('0x3b')];_0x2a96d1[_0x4e20('0x43')]=qs[_0x4e20('0x44')](_0x4425e4['query'][_0x4e20('0x44')]);_0x2a96d1[_0x4e20('0x45')]=qs[_0x4e20('0x3d')](_['pick'](_0x4425e4['query'],_0x21b068[_0x4e20('0x3d')]));if(_0x4425e4['query'][_0x4e20('0x2e')]){_0x2a96d1[_0x4e20('0x45')]=_[_0x4e20('0x48')](_0x2a96d1[_0x4e20('0x45')],{'$or':_[_0x4e20('0x30')](_0x2a96d1[_0x4e20('0x3f')],function(_0x382583){var _0x4d9f1b={};_0x4d9f1b[_0x382583]={'$like':'%'+_0x4425e4[_0x4e20('0x3c')][_0x4e20('0x2e')]+'%'};return _0x4d9f1b;})});}_0x2a96d1=_[_0x4e20('0x48')]({},_0x2a96d1,_0x4425e4[_0x4e20('0x50')]);return _0x350f81[_0x4e20('0x99')](_0x2a96d1);}})[_0x4e20('0x29')](function(_0x347112){if(_0x347112){_0x4ce2f9=_0x347112[_0x4e20('0x41')];if(!_0x4425e4['query'][_0x4e20('0x42')](_0x4e20('0x61'))){_0x2a96d1[_0x4e20('0x21')]=qs['limit'](_0x4425e4[_0x4e20('0x3c')][_0x4e20('0x21')]);_0x2a96d1[_0x4e20('0x20')]=qs['offset'](_0x4425e4['query'][_0x4e20('0x20')]);}return _0x350f81[_0x4e20('0x99')](_0x2a96d1);}})[_0x4e20('0x29')](function(_0x209066){return _0x209066?{'count':_0x4ce2f9,'rows':_0x209066}:null;})[_0x4e20('0x29')](respondWithResult(_0x58e655,null))[_0x4e20('0x4d')](handleError(_0x58e655,null));};exports['getLists']=function(_0x5cab08,_0x385482,_0x5ccd59){var _0x385789={};var _0x576d8b={};var _0x4ca057;var _0x37656f;return db[_0x4e20('0x38')][_0x4e20('0x64')]({'where':{'id':_0x5cab08[_0x4e20('0x4e')]['id']}})[_0x4e20('0x29')](handleEntityNotFound(_0x385482,null))[_0x4e20('0x29')](function(_0x9d73a5){if(_0x9d73a5){_0x4ca057=_0x9d73a5;_0x576d8b[_0x4e20('0x3b')]=_['keys'](db[_0x4e20('0x9a')][_0x4e20('0x39')]);_0x576d8b[_0x4e20('0x3c')]=_[_0x4e20('0x4f')](_0x5cab08['query']);_0x576d8b[_0x4e20('0x3d')]=_[_0x4e20('0x3e')](_0x576d8b[_0x4e20('0x3b')],_0x576d8b['query']);_0x385789[_0x4e20('0x3f')]=_[_0x4e20('0x3e')](_0x576d8b[_0x4e20('0x3b')],qs['fields'](_0x5cab08[_0x4e20('0x3c')][_0x4e20('0x40')]));_0x385789[_0x4e20('0x3f')]=_0x385789[_0x4e20('0x3f')]['length']?_0x385789[_0x4e20('0x3f')]:_0x576d8b['model'];_0x385789[_0x4e20('0x43')]=qs[_0x4e20('0x44')](_0x5cab08[_0x4e20('0x3c')]['sort']);_0x385789['where']=qs[_0x4e20('0x3d')](_[_0x4e20('0x46')](_0x5cab08[_0x4e20('0x3c')],_0x576d8b['filters']));if(_0x5cab08['query'][_0x4e20('0x2e')]){_0x385789[_0x4e20('0x45')]=_[_0x4e20('0x48')](_0x385789[_0x4e20('0x45')],{'$or':_[_0x4e20('0x30')](_0x385789[_0x4e20('0x3f')],function(_0x2b504e){var _0x437944={};_0x437944[_0x2b504e]={'$like':'%'+_0x5cab08[_0x4e20('0x3c')][_0x4e20('0x2e')]+'%'};return _0x437944;})});}_0x385789=_[_0x4e20('0x48')]({},_0x385789,_0x5cab08['options']);return _0x4ca057['getLists'](_0x385789);}})[_0x4e20('0x29')](function(_0x48b7b1){if(_0x48b7b1){_0x37656f=_0x48b7b1[_0x4e20('0x41')];if(!_0x5cab08[_0x4e20('0x3c')]['hasOwnProperty'](_0x4e20('0x61'))){_0x385789[_0x4e20('0x21')]=qs[_0x4e20('0x21')](_0x5cab08[_0x4e20('0x3c')][_0x4e20('0x21')]);_0x385789[_0x4e20('0x20')]=qs[_0x4e20('0x20')](_0x5cab08[_0x4e20('0x3c')]['offset']);}return _0x4ca057[_0x4e20('0x9b')](_0x385789);}})[_0x4e20('0x29')](function(_0x376c2b){if(_0x376c2b){return _0x376c2b?{'count':_0x37656f,'rows':_0x376c2b}:null;}})['then'](respondWithResult(_0x385482,null))[_0x4e20('0x4d')](handleError(_0x385482,null));};exports['addLists']=function(_0x2d0f0e,_0x4eb2a0,_0x2cfa4b){var _0x43d14e,_0x4ba7f2;return db[_0x4e20('0x38')][_0x4e20('0x33')]({'where':{'id':_0x2d0f0e[_0x4e20('0x4e')]['id']}})[_0x4e20('0x29')](handleEntityNotFound(_0x4eb2a0,null))[_0x4e20('0x29')](function(_0x3d4bce){if(_0x3d4bce){_0x4ba7f2=_0x3d4bce;return _0x3d4bce[_0x4e20('0x9c')](_0x2d0f0e[_0x4e20('0x52')][_0x4e20('0x7c')],_[_0x4e20('0x5c')](_0x2d0f0e[_0x4e20('0x52')],[_0x4e20('0x7c'),'id'])||{});}return null;})[_0x4e20('0x92')](function(_0x41c8a9){var _0x488cf3;_0x43d14e=_0x41c8a9||[];var _0x677a4=[];if(_0x41c8a9){for(var _0x19639d=0x0;_0x19639d<_0x41c8a9['length'];_0x19639d+=0x1){var _0x138616=_0x41c8a9[_0x19639d][_0x4e20('0x54')]({'plain':!![]});_0x4ba7f2[_0x4e20('0x9d')]=_0x2d0f0e[_0x4e20('0x52')][_0x4e20('0x9d')]?_0x2d0f0e['body']['dialCheckDuplicateType']:_0x4ba7f2[_0x4e20('0x9d')];switch(_0x4ba7f2[_0x4e20('0x9d')]){case'always':_0x488cf3=squel[_0x4e20('0x9e')]()['into'](_0x4e20('0x9f'))['fromQuery']([_0x4e20('0xa0'),_0x4e20('0xa1'),_0x4e20('0xa2'),_0x4e20('0xa3'),'VoiceQueueId',_0x4e20('0x5d'),_0x4e20('0x5e')],squel['select']()[_0x4e20('0xa4')](_0x4e20('0xa0'),'phone')[_0x4e20('0xa4')]('NOW()',_0x4e20('0xa1'))[_0x4e20('0xa4')]('id',_0x4e20('0xa2'))[_0x4e20('0xa4')](_0x138616[_0x4e20('0xa5')][_0x4e20('0x84')](),_0x4e20('0xa3'))[_0x4e20('0xa4')](_0x2d0f0e[_0x4e20('0x4e')]['id'][_0x4e20('0x84')](),_0x4e20('0x62'))[_0x4e20('0xa4')](_0x4e20('0xa6'),_0x4e20('0x5d'))[_0x4e20('0xa4')]('NOW()',_0x4e20('0x5e'))[_0x4e20('0x7d')]('cm_contacts')[_0x4e20('0x45')](_0x4e20('0xa7'))[_0x4e20('0x45')]('ListId\x20=\x20?',_0x138616[_0x4e20('0xa5')][_0x4e20('0x84')]())[_0x4e20('0x45')](_0x4e20('0xa8'))[_0x4e20('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0x4e20('0xa9')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x4e20('0x7d')](_0x4e20('0xaa'))[_0x4e20('0x45')](_0x4e20('0x81'),_0x2d0f0e['params']['id'][_0x4e20('0x84')]()))['where'](_0x4e20('0xab'),squel[_0x4e20('0xa9')]()[_0x4e20('0xa4')](_0x4e20('0xac'))['from'](_0x4e20('0x9f'))[_0x4e20('0x45')]('VoiceQueueId\x20=\x20?',_0x2d0f0e[_0x4e20('0x4e')]['id'][_0x4e20('0x84')]())))[_0x4e20('0x84')]();break;case _0x4e20('0xad'):_0x488cf3=squel[_0x4e20('0x9e')]()[_0x4e20('0xae')]('cm_hopper')['fromQuery'](['phone',_0x4e20('0xa1'),_0x4e20('0xa2'),_0x4e20('0xa3'),'VoiceQueueId','createdAt','updatedAt'],squel[_0x4e20('0xa9')]()[_0x4e20('0xa4')](_0x4e20('0xa0'),_0x4e20('0xa0'))[_0x4e20('0xa4')](_0x4e20('0xa6'),_0x4e20('0xa1'))['field']('id',_0x4e20('0xa2'))[_0x4e20('0xa4')](_0x138616[_0x4e20('0xa5')][_0x4e20('0x84')](),'ListId')[_0x4e20('0xa4')](_0x2d0f0e['params']['id'][_0x4e20('0x84')](),_0x4e20('0x62'))[_0x4e20('0xa4')](_0x4e20('0xa6'),'createdAt')[_0x4e20('0xa4')]('NOW()',_0x4e20('0x5e'))[_0x4e20('0x7d')](_0x4e20('0xaf'))[_0x4e20('0x45')](_0x4e20('0xa7'))[_0x4e20('0x45')](_0x4e20('0xb0'),_0x138616[_0x4e20('0xa5')]['toString']())[_0x4e20('0x45')](_0x4e20('0xa8'))[_0x4e20('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0x4e20('0xa9')]()[_0x4e20('0xa4')](_0x4e20('0xac'))[_0x4e20('0x7d')](_0x4e20('0x9f'))[_0x4e20('0x45')](_0x4e20('0x81'),_0x2d0f0e[_0x4e20('0x4e')]['id'][_0x4e20('0x84')]())))[_0x4e20('0x84')]();break;default:_0x488cf3=squel[_0x4e20('0x9e')]()['into'](_0x4e20('0x9f'))['fromQuery']([_0x4e20('0xa0'),'scheduledAt',_0x4e20('0xa2'),'ListId',_0x4e20('0x62'),'createdAt',_0x4e20('0x5e')],squel['select']()[_0x4e20('0xa4')]('phone','phone')['field'](_0x4e20('0xa6'),_0x4e20('0xa1'))[_0x4e20('0xa4')]('id',_0x4e20('0xa2'))['field'](_0x138616['CmListId'][_0x4e20('0x84')](),_0x4e20('0xa3'))['field'](_0x2d0f0e[_0x4e20('0x4e')]['id'][_0x4e20('0x84')](),_0x4e20('0x62'))[_0x4e20('0xa4')](_0x4e20('0xa6'),_0x4e20('0x5d'))[_0x4e20('0xa4')](_0x4e20('0xa6'),_0x4e20('0x5e'))[_0x4e20('0x7d')](_0x4e20('0xaf'))['where'](_0x4e20('0xa7'))[_0x4e20('0x45')](_0x4e20('0xb0'),_0x138616['CmListId'][_0x4e20('0x84')]())[_0x4e20('0x45')]('phone\x20IS\x20NOT\x20NULL'))[_0x4e20('0x84')]();}_0x677a4[_0x4e20('0x83')](db[_0x4e20('0x71')]['query'](_0x488cf3));}return BPromise[_0x4e20('0x8a')](_0x677a4);}})[_0x4e20('0x29')](function(){return _0x43d14e;})[_0x4e20('0x29')](respondWithResult(_0x4eb2a0,null))[_0x4e20('0x4d')](handleError(_0x4eb2a0,null));};exports[_0x4e20('0xb1')]=function(_0x1cd9a5,_0x3b3148,_0x312b6b){return db[_0x4e20('0x38')]['find']({'where':{'id':_0x1cd9a5[_0x4e20('0x4e')]['id']}})[_0x4e20('0x29')](handleEntityNotFound(_0x3b3148,null))[_0x4e20('0x29')](function(_0x2d465c){if(_0x2d465c){return _0x2d465c[_0x4e20('0xb1')](_0x1cd9a5['query']['ids']);}})[_0x4e20('0x29')](function(_0x32704b){if(_0x32704b){return db[_0x4e20('0x60')][_0x4e20('0x28')]({'where':{'ListId':_0x1cd9a5[_0x4e20('0x3c')][_0x4e20('0x7c')],'VoiceQueueId':_0x1cd9a5['params']['id']}})[_0x4e20('0x29')](function(){return _0x32704b;});}})[_0x4e20('0x29')](respondWithStatusCode(_0x3b3148,null))[_0x4e20('0x4d')](handleError(_0x3b3148,null));};exports[_0x4e20('0xb2')]=function(_0xc81cc4,_0x567b4e,_0x1f9be9){var _0x38091d={};var _0x1a99d5={};var _0xbdead8;var _0x33ab7b;return db[_0x4e20('0x38')]['findOne']({'where':{'id':_0xc81cc4['params']['id']}})[_0x4e20('0x29')](handleEntityNotFound(_0x567b4e,null))[_0x4e20('0x29')](function(_0x3e438b){if(_0x3e438b){_0xbdead8=_0x3e438b;_0x1a99d5[_0x4e20('0x3b')]=_[_0x4e20('0x4f')](db[_0x4e20('0x9a')]['rawAttributes']);_0x1a99d5[_0x4e20('0x3c')]=_[_0x4e20('0x4f')](_0xc81cc4['query']);_0x1a99d5[_0x4e20('0x3d')]=_['intersection'](_0x1a99d5['model'],_0x1a99d5[_0x4e20('0x3c')]);_0x38091d['attributes']=_[_0x4e20('0x3e')](_0x1a99d5[_0x4e20('0x3b')],qs[_0x4e20('0x40')](_0xc81cc4['query'][_0x4e20('0x40')]));_0x38091d['attributes']=_0x38091d[_0x4e20('0x3f')][_0x4e20('0x41')]?_0x38091d[_0x4e20('0x3f')]:_0x1a99d5['model'];_0x38091d[_0x4e20('0x43')]=qs[_0x4e20('0x44')](_0xc81cc4[_0x4e20('0x3c')][_0x4e20('0x44')]);_0x38091d[_0x4e20('0x45')]=qs[_0x4e20('0x3d')](_[_0x4e20('0x46')](_0xc81cc4['query'],_0x1a99d5[_0x4e20('0x3d')]));if(_0xc81cc4[_0x4e20('0x3c')][_0x4e20('0x2e')]){_0x38091d[_0x4e20('0x45')]=_[_0x4e20('0x48')](_0x38091d[_0x4e20('0x45')],{'$or':_[_0x4e20('0x30')](_0x38091d[_0x4e20('0x3f')],function(_0x4518d7){var _0x3ac8c6={};_0x3ac8c6[_0x4518d7]={'$like':'%'+_0xc81cc4[_0x4e20('0x3c')][_0x4e20('0x2e')]+'%'};return _0x3ac8c6;})});}_0x38091d=_[_0x4e20('0x48')]({},_0x38091d,_0xc81cc4[_0x4e20('0x50')]);return _0xbdead8[_0x4e20('0xb2')](_0x38091d);}})[_0x4e20('0x29')](function(_0x5a2cf9){if(_0x5a2cf9){_0x33ab7b=_0x5a2cf9[_0x4e20('0x41')];if(!_0xc81cc4[_0x4e20('0x3c')][_0x4e20('0x42')](_0x4e20('0x61'))){_0x38091d[_0x4e20('0x21')]=qs['limit'](_0xc81cc4[_0x4e20('0x3c')][_0x4e20('0x21')]);_0x38091d['offset']=qs[_0x4e20('0x20')](_0xc81cc4['query'][_0x4e20('0x20')]);}return _0xbdead8[_0x4e20('0xb2')](_0x38091d);}})[_0x4e20('0x29')](function(_0x9b8a79){if(_0x9b8a79){return _0x9b8a79?{'count':_0x33ab7b,'rows':_0x9b8a79}:null;}})[_0x4e20('0x29')](respondWithResult(_0x567b4e,null))[_0x4e20('0x4d')](handleError(_0x567b4e,null));};exports[_0x4e20('0xb3')]=function(_0x3a17cf,_0x44ff67,_0x25b3a5){var _0x1b4242,_0x370dcf;return db['VoiceQueue']['find']({'where':{'id':_0x3a17cf[_0x4e20('0x4e')]['id']}})['then'](handleEntityNotFound(_0x44ff67,null))['then'](function(_0x41f1f7){if(_0x41f1f7){_0x370dcf=_0x41f1f7;return _0x41f1f7['addBlackLists'](_0x3a17cf[_0x4e20('0x52')][_0x4e20('0x7c')],_['omit'](_0x3a17cf[_0x4e20('0x52')],[_0x4e20('0x7c'),'id'])||{});}return null;})[_0x4e20('0x92')](function(_0x3e0f5f){var _0x2aa138;_0x1b4242=_0x3e0f5f||[];var _0x11978c=[];if(_0x3e0f5f){for(var _0x113c55=0x0;_0x113c55<_0x3e0f5f['length'];_0x113c55+=0x1){var _0x4cddd7=_0x3e0f5f[_0x113c55][_0x4e20('0x54')]({'plain':!![]});_0x2aa138=squel[_0x4e20('0x9e')]()[_0x4e20('0xae')](_0x4e20('0xb4'))['fromQuery']([_0x4e20('0xa0'),_0x4e20('0xa2'),'ListId',_0x4e20('0x62'),_0x4e20('0x5d'),_0x4e20('0x5e')],squel[_0x4e20('0xa9')]()['field']('phone',_0x4e20('0xa0'))[_0x4e20('0xa4')]('id',_0x4e20('0xa2'))[_0x4e20('0xa4')](_0x4cddd7['CmListId']['toString'](),_0x4e20('0xa3'))['field'](_0x3a17cf[_0x4e20('0x4e')]['id'][_0x4e20('0x84')](),_0x4e20('0x62'))[_0x4e20('0xa4')](_0x4e20('0xa6'),_0x4e20('0x5d'))[_0x4e20('0xa4')](_0x4e20('0xa6'),_0x4e20('0x5e'))[_0x4e20('0x7d')]('cm_contacts')[_0x4e20('0x45')](_0x4e20('0xa7'))[_0x4e20('0x45')](_0x4e20('0xb0'),_0x4cddd7[_0x4e20('0xa5')][_0x4e20('0x84')]())[_0x4e20('0x45')](_0x4e20('0xa8')))[_0x4e20('0x84')]();_0x11978c[_0x4e20('0x83')](db[_0x4e20('0x71')][_0x4e20('0x3c')](_0x2aa138));}return BPromise[_0x4e20('0x8a')](_0x11978c);}})[_0x4e20('0x29')](function(){return _0x1b4242;})[_0x4e20('0x29')](respondWithResult(_0x44ff67,null))[_0x4e20('0x4d')](handleError(_0x44ff67,null));};exports['removeBlackLists']=function(_0x5734d2,_0x3e1510,_0x521de4){return db['VoiceQueue']['find']({'where':{'id':_0x5734d2['params']['id']}})['then'](handleEntityNotFound(_0x3e1510,null))[_0x4e20('0x29')](function(_0x5ea82b){if(_0x5ea82b){return _0x5ea82b[_0x4e20('0xb5')](_0x5734d2[_0x4e20('0x3c')]['ids']);}})[_0x4e20('0x29')](function(_0x90edf5){if(_0x90edf5){return db[_0x4e20('0x68')][_0x4e20('0x28')]({'where':{'ListId':_0x5734d2['query'][_0x4e20('0x7c')],'VoiceQueueId':_0x5734d2[_0x4e20('0x4e')]['id']}})[_0x4e20('0x29')](function(){return _0x90edf5;});}})[_0x4e20('0x29')](respondWithStatusCode(_0x3e1510,null))[_0x4e20('0x4d')](handleError(_0x3e1510,null));}; \ No newline at end of file +var _0xebb8=['tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','all','union','compact','isEmpty','removeAgents','UserVoiceQueueRt','addAgents','spread','userVoiceQueue:save','online','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','updatedAt','phone','NOW()','scheduledAt','ContactId','CmListId','ListId','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','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','VoiceQueues','inbound','outbound','ignore','map','includes','type','find','name','destroy','end','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','create','body','user','get','role','QueueCampaigns','value','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','getHoppers','findOne','order','VoiceQueueId','CmHopper','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','voicePause','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','UserVoiceQueue','upsert','isNil','format','SIP/%s','emit','removeTeams','ids','select','field'];(function(_0x38a7a1,_0x1edc54){var _0x23503e=function(_0x28e76e){while(--_0x28e76e){_0x38a7a1['push'](_0x38a7a1['shift']());}};_0x23503e(++_0x1edc54);}(_0xebb8,0xf4));var _0x8ebb=function(_0x542a89,_0x2e4b8a){_0x542a89=_0x542a89-0x0;var _0x267439=_0xebb8[_0x542a89];return _0x267439;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ebb('0x0'));var zipdir=require(_0x8ebb('0x1'));var jsonpatch=require(_0x8ebb('0x2'));var rp=require(_0x8ebb('0x3'));var moment=require(_0x8ebb('0x4'));var BPromise=require(_0x8ebb('0x5'));var Mustache=require(_0x8ebb('0x6'));var util=require(_0x8ebb('0x7'));var path=require(_0x8ebb('0x8'));var sox=require('sox');var csv=require(_0x8ebb('0x9'));var ejs=require(_0x8ebb('0xa'));var fs=require('fs');var fs_extra=require(_0x8ebb('0xb'));var _=require('lodash');var squel=require(_0x8ebb('0xc'));var crypto=require(_0x8ebb('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8ebb('0x9'));var querystring=require(_0x8ebb('0xe'));var Papa=require(_0x8ebb('0xf'));var Redis=require(_0x8ebb('0x10'));var authService=require(_0x8ebb('0x11'));var qs=require(_0x8ebb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ebb('0x13'));var logger=require(_0x8ebb('0x14'))(_0x8ebb('0x15'));var utils=require(_0x8ebb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8ebb('0x17'));var db=require(_0x8ebb('0x18'))['db'];config[_0x8ebb('0x19')]=_[_0x8ebb('0x1a')](config[_0x8ebb('0x19')],{'host':_0x8ebb('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8ebb('0x19')]));require(_0x8ebb('0x1c'))['register'](socket);function respondWithStatusCode(_0x591a4d,_0x70a057){_0x70a057=_0x70a057||0xcc;return function(_0x143044){if(_0x143044){return _0x591a4d[_0x8ebb('0x1d')](_0x70a057);}return _0x591a4d[_0x8ebb('0x1e')](_0x70a057)['end']();};}function respondWithResult(_0x444069,_0x3d00a9){_0x3d00a9=_0x3d00a9||0xc8;return function(_0x1826a8){if(_0x1826a8){return _0x444069[_0x8ebb('0x1e')](_0x3d00a9)['json'](_0x1826a8);}};}function respondWithFilteredResult(_0x4aadb3,_0x2aadb0){return function(_0x1d17a8){if(_0x1d17a8){var _0x16d392=typeof _0x2aadb0[_0x8ebb('0x1f')]===_0x8ebb('0x20')&&typeof _0x2aadb0['limit']===_0x8ebb('0x20');var _0x5952b9=_0x1d17a8[_0x8ebb('0x21')];var _0x52d93c=_0x16d392?0x0:_0x2aadb0[_0x8ebb('0x1f')];var _0x482fe5=_0x16d392?_0x1d17a8[_0x8ebb('0x21')]:_0x2aadb0['offset']+_0x2aadb0[_0x8ebb('0x22')];var _0x2337cb;if(_0x482fe5>=_0x5952b9){_0x482fe5=_0x5952b9;_0x2337cb=0xc8;}else{_0x2337cb=0xce;}_0x4aadb3[_0x8ebb('0x1e')](_0x2337cb);return _0x4aadb3[_0x8ebb('0x23')](_0x8ebb('0x24'),_0x52d93c+'-'+_0x482fe5+'/'+_0x5952b9)[_0x8ebb('0x25')](_0x1d17a8);}return null;};}function patchUpdates(_0x2b50b4){return function(_0x282a92){try{jsonpatch[_0x8ebb('0x26')](_0x282a92,_0x2b50b4,!![]);}catch(_0x477b1e){return BPromise[_0x8ebb('0x27')](_0x477b1e);}return _0x282a92[_0x8ebb('0x28')]();};}function saveUpdates(_0x6e9852,_0x25f3a4){return function(_0x472221){if(_0x472221){return _0x472221[_0x8ebb('0x29')](_0x6e9852)[_0x8ebb('0x2a')](function(_0x12b3ac){return _0x12b3ac;});}return null;};}function removeEntity(_0x509ce8,_0x1de1dc){return function(_0x1f8947){if(_0x1f8947){return _0x1f8947['destroy']()['then'](function(){var _0x55cfe8=_0x1f8947['get']({'plain':!![]});var _0x28e056=[{'name':_0x8ebb('0x2b'),'value':_0x8ebb('0x2c'),'ignore':![]},{'name':'QueueCampaigns','value':_0x8ebb('0x2d'),'ignore':![]}];var _0x268de0=_(_0x28e056)['filter'](_0x8ebb('0x2e'))[_0x8ebb('0x2f')]('value')['value']();if(_[_0x8ebb('0x30')](_0x268de0,_0x55cfe8[_0x8ebb('0x31')])){return;}var _0x1083f3=_[_0x8ebb('0x32')](_0x28e056,['value',_0x55cfe8[_0x8ebb('0x31')]])[_0x8ebb('0x33')];return db['UserProfileResource'][_0x8ebb('0x34')]({'where':{'type':_0x1083f3,'resourceId':_0x55cfe8['id']}})[_0x8ebb('0x2a')](function(){return _0x1f8947;});})[_0x8ebb('0x2a')](function(){_0x509ce8['status'](0xcc)[_0x8ebb('0x35')]();});}};}function handleEntityNotFound(_0x513cb5,_0x2336a2){return function(_0xf83f49){if(!_0xf83f49){_0x513cb5[_0x8ebb('0x1d')](0x194);}return _0xf83f49;};}function handleError(_0x1e3bea,_0x515d6c){_0x515d6c=_0x515d6c||0x1f4;return function(_0x65cdbd){logger[_0x8ebb('0x36')](_0x65cdbd[_0x8ebb('0x37')]);if(_0x65cdbd[_0x8ebb('0x33')]){delete _0x65cdbd[_0x8ebb('0x33')];}_0x1e3bea[_0x8ebb('0x1e')](_0x515d6c)[_0x8ebb('0x38')](_0x65cdbd);};}exports[_0x8ebb('0x39')]=function(_0xd62732,_0x5d1372){var _0x31397e={},_0x35dcac={},_0x32a087={'count':0x0,'rows':[]};var _0x416086=_[_0x8ebb('0x2f')](db[_0x8ebb('0x3a')][_0x8ebb('0x3b')],function(_0x4bccbd){return{'name':_0x4bccbd[_0x8ebb('0x3c')],'type':_0x4bccbd[_0x8ebb('0x31')][_0x8ebb('0x3d')]};});_0x35dcac[_0x8ebb('0x3e')]=_[_0x8ebb('0x2f')](_0x416086,_0x8ebb('0x33'));_0x35dcac[_0x8ebb('0x3f')]=_[_0x8ebb('0x40')](_0xd62732[_0x8ebb('0x3f')]);_0x35dcac[_0x8ebb('0x41')]=_['intersection'](_0x35dcac[_0x8ebb('0x3e')],_0x35dcac[_0x8ebb('0x3f')]);_0x31397e[_0x8ebb('0x42')]=_[_0x8ebb('0x43')](_0x35dcac[_0x8ebb('0x3e')],qs[_0x8ebb('0x44')](_0xd62732[_0x8ebb('0x3f')][_0x8ebb('0x44')]));_0x31397e[_0x8ebb('0x42')]=_0x31397e[_0x8ebb('0x42')][_0x8ebb('0x45')]?_0x31397e[_0x8ebb('0x42')]:_0x35dcac[_0x8ebb('0x3e')];if(!_0xd62732[_0x8ebb('0x3f')][_0x8ebb('0x46')](_0x8ebb('0x47'))){_0x31397e[_0x8ebb('0x22')]=qs[_0x8ebb('0x22')](_0xd62732[_0x8ebb('0x3f')][_0x8ebb('0x22')]);_0x31397e[_0x8ebb('0x1f')]=qs[_0x8ebb('0x1f')](_0xd62732[_0x8ebb('0x3f')]['offset']);}_0x31397e['order']=qs['sort'](_0xd62732[_0x8ebb('0x3f')][_0x8ebb('0x48')]);_0x31397e[_0x8ebb('0x49')]=qs['filters'](_[_0x8ebb('0x4a')](_0xd62732[_0x8ebb('0x3f')],_0x35dcac[_0x8ebb('0x41')]),_0x416086);if(_0xd62732['query'][_0x8ebb('0x4b')]){_0x31397e[_0x8ebb('0x49')]=_[_0x8ebb('0x4c')](_0x31397e[_0x8ebb('0x49')],{'$or':_[_0x8ebb('0x2f')](_0x416086,function(_0x5949f7){if(_0x5949f7['type']!==_0x8ebb('0x4d')){var _0x4c2b2a={};_0x4c2b2a[_0x5949f7[_0x8ebb('0x33')]]={'$like':'%'+_0xd62732['query'][_0x8ebb('0x4b')]+'%'};return _0x4c2b2a;}})});}_0x31397e=_[_0x8ebb('0x4c')]({},_0x31397e,_0xd62732['options']);var _0x7138d2={'where':_0x31397e[_0x8ebb('0x49')]};return db[_0x8ebb('0x3a')][_0x8ebb('0x21')](_0x7138d2)[_0x8ebb('0x2a')](function(_0x206c00){_0x32a087[_0x8ebb('0x21')]=_0x206c00;if(_0xd62732[_0x8ebb('0x3f')][_0x8ebb('0x4e')]){_0x31397e['include']=[{'all':!![]}];}return db[_0x8ebb('0x3a')][_0x8ebb('0x4f')](_0x31397e);})['then'](function(_0x5122aa){_0x32a087[_0x8ebb('0x50')]=_0x5122aa;return _0x32a087;})['then'](respondWithFilteredResult(_0x5d1372,_0x31397e))[_0x8ebb('0x51')](handleError(_0x5d1372,null));};exports[_0x8ebb('0x52')]=function(_0x52f49d,_0x3dc18f){var _0x53dc2b={'raw':![],'where':{'id':_0x52f49d[_0x8ebb('0x53')]['id']}},_0x499855={};_0x499855[_0x8ebb('0x3e')]=_[_0x8ebb('0x40')](db[_0x8ebb('0x3a')]['rawAttributes']);_0x499855[_0x8ebb('0x3f')]=_[_0x8ebb('0x40')](_0x52f49d[_0x8ebb('0x3f')]);_0x499855[_0x8ebb('0x41')]=_['intersection'](_0x499855[_0x8ebb('0x3e')],_0x499855['query']);_0x53dc2b[_0x8ebb('0x42')]=_['intersection'](_0x499855[_0x8ebb('0x3e')],qs['fields'](_0x52f49d['query'][_0x8ebb('0x44')]));_0x53dc2b[_0x8ebb('0x42')]=_0x53dc2b[_0x8ebb('0x42')][_0x8ebb('0x45')]?_0x53dc2b['attributes']:_0x499855[_0x8ebb('0x3e')];if(_0x52f49d[_0x8ebb('0x3f')][_0x8ebb('0x4e')]){_0x53dc2b[_0x8ebb('0x54')]=[{'all':!![]}];}_0x53dc2b=_[_0x8ebb('0x4c')]({},_0x53dc2b,_0x52f49d[_0x8ebb('0x55')]);return db[_0x8ebb('0x3a')][_0x8ebb('0x32')](_0x53dc2b)[_0x8ebb('0x2a')](handleEntityNotFound(_0x3dc18f,null))[_0x8ebb('0x2a')](respondWithResult(_0x3dc18f,null))[_0x8ebb('0x51')](handleError(_0x3dc18f,null));};exports[_0x8ebb('0x56')]=function(_0x379612,_0x470a47){return db['VoiceQueue'][_0x8ebb('0x56')](_0x379612[_0x8ebb('0x57')],{})[_0x8ebb('0x2a')](function(_0x62e159){var _0x278c4e=_0x379612[_0x8ebb('0x58')][_0x8ebb('0x59')]({'plain':!![]});if(!_0x278c4e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x278c4e[_0x8ebb('0x5a')]===_0x8ebb('0x58')){var _0x524844=_0x62e159['get']({'plain':!![]});var _0x21da1f=[{'name':'VoiceQueues','value':_0x8ebb('0x2c')},{'name':_0x8ebb('0x5b'),'value':_0x8ebb('0x2d')}];var _0x590503=_['find'](_0x21da1f,[_0x8ebb('0x5c'),_0x524844[_0x8ebb('0x31')]])[_0x8ebb('0x33')];return db['UserProfileSection'][_0x8ebb('0x32')]({'where':{'name':_0x590503,'userProfileId':_0x278c4e[_0x8ebb('0x5d')]},'raw':!![]})[_0x8ebb('0x2a')](function(_0xdddd00){if(_0xdddd00&&_0xdddd00['autoAssociation']===0x0){return db[_0x8ebb('0x5e')][_0x8ebb('0x56')]({'name':_0x524844['name'],'resourceId':_0x524844['id'],'type':_0xdddd00['name'],'sectionId':_0xdddd00['id']},{})[_0x8ebb('0x2a')](function(){return _0x62e159;});}else{return _0x62e159;}})['catch'](function(_0x46c1c5){logger[_0x8ebb('0x36')](_0x8ebb('0x5f'),_0x46c1c5);throw _0x46c1c5;});}return _0x62e159;})['then'](respondWithResult(_0x470a47,0xc9))[_0x8ebb('0x51')](handleError(_0x470a47,null));};exports[_0x8ebb('0x60')]=function(_0x2b4ac9,_0xb7eea8){var _0x465a23={'where':{'id':_0x2b4ac9[_0x8ebb('0x53')]['id']}},_0x5aaff7={};_0x5aaff7[_0x8ebb('0x3e')]=_[_0x8ebb('0x40')](db['VoiceQueue'][_0x8ebb('0x3b')]);_0x465a23[_0x8ebb('0x42')]=_[_0x8ebb('0x43')](_0x5aaff7[_0x8ebb('0x3e')],qs[_0x8ebb('0x44')](_0x2b4ac9[_0x8ebb('0x3f')]['fields']));_0x465a23['attributes']=_0x465a23[_0x8ebb('0x42')][_0x8ebb('0x45')]?_0x465a23[_0x8ebb('0x42')]:_0x5aaff7[_0x8ebb('0x3e')];if(_0x2b4ac9['query'][_0x8ebb('0x4e')]){_0x465a23[_0x8ebb('0x54')]=[{'all':!![]}];}_0x465a23=_['merge']({},_0x465a23,_0x2b4ac9[_0x8ebb('0x55')]);return db[_0x8ebb('0x3a')][_0x8ebb('0x32')](_0x465a23)['then'](handleEntityNotFound(_0xb7eea8,null))[_0x8ebb('0x2a')](function(_0x1d9c9a){if(_0x1d9c9a){var _0x40c8a4=_0x1d9c9a[_0x8ebb('0x59')]({'plain':!![]});_0x40c8a4=qs['omit'](_0x40c8a4,['id',_0x8ebb('0x61'),'updatedAt']);_0x2b4ac9['body']=_[_0x8ebb('0x62')](_0x2b4ac9[_0x8ebb('0x57')],['id','createdAt','updatedAt']);return db[_0x8ebb('0x3a')][_0x8ebb('0x56')](_[_0x8ebb('0x4c')](_0x40c8a4,_0x2b4ac9[_0x8ebb('0x57')]),{'include':_0x2b4ac9[_0x8ebb('0x3f')]['includeAll']?[{'all':!![]}]:undefined})[_0x8ebb('0x2a')](function(_0xa26253){var _0x512260=_0x2b4ac9[_0x8ebb('0x58')][_0x8ebb('0x59')]({'plain':!![]});if(!_0x512260)throw new Error(_0x8ebb('0x63'));if(_0x512260[_0x8ebb('0x5a')]===_0x8ebb('0x58')){var _0x24140d=_0xa26253[_0x8ebb('0x59')]({'plain':!![]});var _0x3f157a=[{'name':_0x8ebb('0x2b'),'value':_0x8ebb('0x2c')},{'name':_0x8ebb('0x5b'),'value':_0x8ebb('0x2d')}];var _0x2b8156=_['find'](_0x3f157a,[_0x8ebb('0x5c'),_0x24140d[_0x8ebb('0x31')]])[_0x8ebb('0x33')];return db[_0x8ebb('0x64')][_0x8ebb('0x32')]({'where':{'name':_0x2b8156,'userProfileId':_0x512260[_0x8ebb('0x5d')]},'raw':!![]})[_0x8ebb('0x2a')](function(_0x2f331a){if(_0x2f331a&&_0x2f331a[_0x8ebb('0x65')]===0x0){return db['UserProfileResource'][_0x8ebb('0x56')]({'name':_0x24140d[_0x8ebb('0x33')],'resourceId':_0x24140d['id'],'type':_0x2f331a[_0x8ebb('0x33')],'sectionId':_0x2f331a['id']},{})[_0x8ebb('0x2a')](function(){return _0xa26253;});}else{return _0xa26253;}})[_0x8ebb('0x51')](function(_0x5a3e2a){logger[_0x8ebb('0x36')](_0x8ebb('0x5f'),_0x5a3e2a);throw _0x5a3e2a;});}return _0xa26253;});}})[_0x8ebb('0x2a')](respondWithResult(_0xb7eea8,0xc9))[_0x8ebb('0x51')](handleError(_0xb7eea8,null));};exports[_0x8ebb('0x29')]=function(_0x342b5b,_0xad543){if(_0x342b5b[_0x8ebb('0x57')]['id']){delete _0x342b5b[_0x8ebb('0x57')]['id'];}return db[_0x8ebb('0x3a')][_0x8ebb('0x32')]({'where':{'id':_0x342b5b[_0x8ebb('0x53')]['id']}})[_0x8ebb('0x2a')](handleEntityNotFound(_0xad543,null))[_0x8ebb('0x2a')](saveUpdates(_0x342b5b[_0x8ebb('0x57')],null))[_0x8ebb('0x2a')](respondWithResult(_0xad543,null))[_0x8ebb('0x51')](handleError(_0xad543,null));};exports[_0x8ebb('0x34')]=function(_0x2b207b,_0xf2a76b){return db[_0x8ebb('0x3a')][_0x8ebb('0x32')]({'where':{'id':_0x2b207b[_0x8ebb('0x53')]['id']}})['then'](handleEntityNotFound(_0xf2a76b,null))[_0x8ebb('0x2a')](removeEntity(_0xf2a76b,null))['catch'](handleError(_0xf2a76b,null));};exports[_0x8ebb('0x66')]=function(_0x3da092,_0xab55ec,_0x1b1b4f){var _0x29db9b={'raw':![],'where':{}};var _0xdfb162={};var _0x1a6ca2={'count':0x0,'rows':[]};return db[_0x8ebb('0x3a')][_0x8ebb('0x67')]({'where':{'id':_0x3da092[_0x8ebb('0x53')]['id']}})[_0x8ebb('0x2a')](handleEntityNotFound(_0xab55ec,null))[_0x8ebb('0x2a')](function(_0x850a93){if(_0x850a93){_0xdfb162[_0x8ebb('0x3e')]=_[_0x8ebb('0x40')](db['CmHopper'][_0x8ebb('0x3b')]);_0xdfb162['query']=_['keys'](_0x3da092[_0x8ebb('0x3f')]);_0xdfb162[_0x8ebb('0x41')]=_[_0x8ebb('0x43')](_0xdfb162[_0x8ebb('0x3e')],_0xdfb162[_0x8ebb('0x3f')]);_0x29db9b[_0x8ebb('0x42')]=_[_0x8ebb('0x43')](_0xdfb162[_0x8ebb('0x3e')],qs[_0x8ebb('0x44')](_0x3da092[_0x8ebb('0x3f')][_0x8ebb('0x44')]));_0x29db9b[_0x8ebb('0x42')]=_0x29db9b[_0x8ebb('0x42')][_0x8ebb('0x45')]?_0x29db9b[_0x8ebb('0x42')]:_0xdfb162[_0x8ebb('0x3e')];if(!_0x3da092[_0x8ebb('0x3f')][_0x8ebb('0x46')](_0x8ebb('0x47'))){_0x29db9b[_0x8ebb('0x22')]=qs[_0x8ebb('0x22')](_0x3da092['query']['limit']);_0x29db9b[_0x8ebb('0x1f')]=qs[_0x8ebb('0x1f')](_0x3da092[_0x8ebb('0x3f')][_0x8ebb('0x1f')]);}_0x29db9b[_0x8ebb('0x68')]=qs['sort'](_0x3da092[_0x8ebb('0x3f')][_0x8ebb('0x48')]);_0x29db9b[_0x8ebb('0x49')]=qs[_0x8ebb('0x41')](_[_0x8ebb('0x4a')](_0x3da092[_0x8ebb('0x3f')],_0xdfb162['filters']));_0x29db9b[_0x8ebb('0x49')][_0x8ebb('0x69')]=_0x850a93['id'];if(_0x3da092[_0x8ebb('0x3f')][_0x8ebb('0x4b')]){_0x29db9b[_0x8ebb('0x49')]=_[_0x8ebb('0x4c')](_0x29db9b['where'],{'$or':_['map'](_0x29db9b[_0x8ebb('0x42')],function(_0x1fd8de){var _0x2e8c5c={};_0x2e8c5c[_0x1fd8de]={'$like':'%'+_0x3da092[_0x8ebb('0x3f')][_0x8ebb('0x4b')]+'%'};return _0x2e8c5c;})});}_0x29db9b=_[_0x8ebb('0x4c')]({},_0x29db9b,_0x3da092[_0x8ebb('0x55')]);return db[_0x8ebb('0x6a')]['count']({'where':_0x29db9b[_0x8ebb('0x49')]})[_0x8ebb('0x2a')](function(_0x21cca7){_0x1a6ca2[_0x8ebb('0x21')]=_0x21cca7;if(_0x3da092[_0x8ebb('0x3f')]['includeAll']){_0x29db9b[_0x8ebb('0x54')]=[{'all':!![]}];}return db['CmHopper'][_0x8ebb('0x4f')](_0x29db9b);})['then'](function(_0x49b0f7){_0x1a6ca2[_0x8ebb('0x50')]=_0x49b0f7;return _0x1a6ca2;});}})[_0x8ebb('0x2a')](respondWithFilteredResult(_0xab55ec,_0x29db9b))[_0x8ebb('0x51')](handleError(_0xab55ec,null));};exports['getHopperHistories']=function(_0x54adb7,_0xdeea72,_0x2085f9){var _0x1249ae={'raw':!![],'where':{}};var _0x32dac7={};var _0x2119a0={'count':0x0,'rows':[]};return db[_0x8ebb('0x3a')][_0x8ebb('0x67')]({'where':{'id':_0x54adb7[_0x8ebb('0x53')]['id']}})[_0x8ebb('0x2a')](handleEntityNotFound(_0xdeea72,null))[_0x8ebb('0x2a')](function(_0xb3c99e){if(_0xb3c99e){_0x32dac7[_0x8ebb('0x3e')]=_[_0x8ebb('0x40')](db[_0x8ebb('0x6b')]['rawAttributes']);_0x32dac7[_0x8ebb('0x3f')]=_[_0x8ebb('0x40')](_0x54adb7['query']);_0x32dac7[_0x8ebb('0x41')]=_[_0x8ebb('0x43')](_0x32dac7[_0x8ebb('0x3e')],_0x32dac7[_0x8ebb('0x3f')]);_0x1249ae[_0x8ebb('0x42')]=_[_0x8ebb('0x43')](_0x32dac7[_0x8ebb('0x3e')],qs[_0x8ebb('0x44')](_0x54adb7[_0x8ebb('0x3f')][_0x8ebb('0x44')]));_0x1249ae[_0x8ebb('0x42')]=_0x1249ae[_0x8ebb('0x42')][_0x8ebb('0x45')]?_0x1249ae[_0x8ebb('0x42')]:_0x32dac7['model'];if(!_0x54adb7[_0x8ebb('0x3f')][_0x8ebb('0x46')](_0x8ebb('0x47'))){_0x1249ae[_0x8ebb('0x22')]=qs[_0x8ebb('0x22')](_0x54adb7[_0x8ebb('0x3f')][_0x8ebb('0x22')]);_0x1249ae[_0x8ebb('0x1f')]=qs[_0x8ebb('0x1f')](_0x54adb7[_0x8ebb('0x3f')][_0x8ebb('0x1f')]);}_0x1249ae[_0x8ebb('0x68')]=qs['sort'](_0x54adb7[_0x8ebb('0x3f')][_0x8ebb('0x48')]);_0x1249ae[_0x8ebb('0x49')]=qs[_0x8ebb('0x41')](_[_0x8ebb('0x4a')](_0x54adb7['query'],_0x32dac7['filters']));_0x1249ae['where'][_0x8ebb('0x69')]=_0xb3c99e['id'];if(_0x54adb7[_0x8ebb('0x3f')][_0x8ebb('0x4b')]){_0x1249ae[_0x8ebb('0x49')]=_[_0x8ebb('0x4c')](_0x1249ae[_0x8ebb('0x49')],{'$or':_[_0x8ebb('0x2f')](_0x1249ae[_0x8ebb('0x42')],function(_0x1b0756){var _0x4be090={};_0x4be090[_0x1b0756]={'$like':'%'+_0x54adb7['query'][_0x8ebb('0x4b')]+'%'};return _0x4be090;})});}_0x1249ae=_[_0x8ebb('0x4c')]({},_0x1249ae,_0x54adb7[_0x8ebb('0x55')]);return db[_0x8ebb('0x6b')][_0x8ebb('0x21')]({'where':_0x1249ae[_0x8ebb('0x49')]})[_0x8ebb('0x2a')](function(_0x29b71b){_0x2119a0['count']=_0x29b71b;if(_0x54adb7['query'][_0x8ebb('0x4e')]){_0x1249ae[_0x8ebb('0x54')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x8ebb('0x4f')](_0x1249ae);})[_0x8ebb('0x2a')](function(_0x386989){_0x2119a0[_0x8ebb('0x50')]=_0x386989;return _0x2119a0;});}})['then'](respondWithFilteredResult(_0xdeea72,_0x1249ae))[_0x8ebb('0x51')](handleError(_0xdeea72,null));};exports[_0x8ebb('0x6c')]=function(_0x4139fb,_0x4136c6,_0xf69201){var _0x57c1f0={'raw':!![],'where':{}};var _0x1d10a1={};var _0x2b3429={'count':0x0,'rows':[]};return db[_0x8ebb('0x3a')]['findOne']({'where':{'id':_0x4139fb['params']['id']}})[_0x8ebb('0x2a')](handleEntityNotFound(_0x4136c6,null))[_0x8ebb('0x2a')](function(_0xa33d1c){if(_0xa33d1c){_0x1d10a1[_0x8ebb('0x3e')]=_[_0x8ebb('0x40')](db[_0x8ebb('0x6d')]['rawAttributes']);_0x1d10a1[_0x8ebb('0x3f')]=_[_0x8ebb('0x40')](_0x4139fb[_0x8ebb('0x3f')]);_0x1d10a1[_0x8ebb('0x41')]=_[_0x8ebb('0x43')](_0x1d10a1[_0x8ebb('0x3e')],_0x1d10a1[_0x8ebb('0x3f')]);_0x57c1f0[_0x8ebb('0x42')]=_[_0x8ebb('0x43')](_0x1d10a1[_0x8ebb('0x3e')],qs[_0x8ebb('0x44')](_0x4139fb[_0x8ebb('0x3f')]['fields']));_0x57c1f0[_0x8ebb('0x42')]=_0x57c1f0[_0x8ebb('0x42')]['length']?_0x57c1f0[_0x8ebb('0x42')]:_0x1d10a1['model'];if(!_0x4139fb['query']['hasOwnProperty'](_0x8ebb('0x47'))){_0x57c1f0['limit']=qs[_0x8ebb('0x22')](_0x4139fb[_0x8ebb('0x3f')][_0x8ebb('0x22')]);_0x57c1f0[_0x8ebb('0x1f')]=qs[_0x8ebb('0x1f')](_0x4139fb[_0x8ebb('0x3f')][_0x8ebb('0x1f')]);}_0x57c1f0['order']=qs[_0x8ebb('0x48')](_0x4139fb['query'][_0x8ebb('0x48')]);_0x57c1f0[_0x8ebb('0x49')]=qs[_0x8ebb('0x41')](_[_0x8ebb('0x4a')](_0x4139fb[_0x8ebb('0x3f')],_0x1d10a1[_0x8ebb('0x41')]));_0x57c1f0[_0x8ebb('0x49')][_0x8ebb('0x69')]=_0xa33d1c['id'];if(_0x4139fb[_0x8ebb('0x3f')]['filter']){_0x57c1f0[_0x8ebb('0x49')]=_['merge'](_0x57c1f0['where'],{'$or':_[_0x8ebb('0x2f')](_0x57c1f0[_0x8ebb('0x42')],function(_0x362060){var _0x387749={};_0x387749[_0x362060]={'$like':'%'+_0x4139fb[_0x8ebb('0x3f')]['filter']+'%'};return _0x387749;})});}_0x57c1f0=_[_0x8ebb('0x4c')]({},_0x57c1f0,_0x4139fb[_0x8ebb('0x55')]);return db[_0x8ebb('0x6d')][_0x8ebb('0x21')]({'where':_0x57c1f0['where']})['then'](function(_0x591114){_0x2b3429[_0x8ebb('0x21')]=_0x591114;if(_0x4139fb[_0x8ebb('0x3f')]['includeAll']){_0x57c1f0[_0x8ebb('0x54')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x57c1f0);})[_0x8ebb('0x2a')](function(_0x5bb480){_0x2b3429[_0x8ebb('0x50')]=_0x5bb480;return _0x2b3429;});}})[_0x8ebb('0x2a')](respondWithFilteredResult(_0x4136c6,_0x57c1f0))[_0x8ebb('0x51')](handleError(_0x4136c6,null));};exports[_0x8ebb('0x6e')]=function(_0xe3bc6e,_0x1dbb1f,_0x3273c4){var _0x22a1e8={'raw':!![],'where':{}};var _0x218aa2={};var _0x50567f={'count':0x0,'rows':[]};return db[_0x8ebb('0x3a')][_0x8ebb('0x67')]({'where':{'id':_0xe3bc6e[_0x8ebb('0x53')]['id']}})[_0x8ebb('0x2a')](handleEntityNotFound(_0x1dbb1f,null))[_0x8ebb('0x2a')](function(_0x10c1c4){if(_0x10c1c4){_0x218aa2[_0x8ebb('0x3e')]=_[_0x8ebb('0x40')](db[_0x8ebb('0x6f')]['rawAttributes']);_0x218aa2[_0x8ebb('0x3f')]=_['keys'](_0xe3bc6e[_0x8ebb('0x3f')]);_0x218aa2[_0x8ebb('0x41')]=_[_0x8ebb('0x43')](_0x218aa2['model'],_0x218aa2[_0x8ebb('0x3f')]);_0x22a1e8['attributes']=_[_0x8ebb('0x43')](_0x218aa2[_0x8ebb('0x3e')],qs[_0x8ebb('0x44')](_0xe3bc6e[_0x8ebb('0x3f')][_0x8ebb('0x44')]));_0x22a1e8[_0x8ebb('0x42')]=_0x22a1e8[_0x8ebb('0x42')]['length']?_0x22a1e8[_0x8ebb('0x42')]:_0x218aa2[_0x8ebb('0x3e')];if(!_0xe3bc6e['query']['hasOwnProperty'](_0x8ebb('0x47'))){_0x22a1e8['limit']=qs[_0x8ebb('0x22')](_0xe3bc6e[_0x8ebb('0x3f')]['limit']);_0x22a1e8[_0x8ebb('0x1f')]=qs[_0x8ebb('0x1f')](_0xe3bc6e[_0x8ebb('0x3f')]['offset']);}_0x22a1e8[_0x8ebb('0x68')]=qs[_0x8ebb('0x48')](_0xe3bc6e[_0x8ebb('0x3f')]['sort']);_0x22a1e8[_0x8ebb('0x49')]=qs[_0x8ebb('0x41')](_[_0x8ebb('0x4a')](_0xe3bc6e[_0x8ebb('0x3f')],_0x218aa2[_0x8ebb('0x41')]));_0x22a1e8[_0x8ebb('0x49')][_0x8ebb('0x69')]=_0x10c1c4['id'];if(_0xe3bc6e[_0x8ebb('0x3f')]['filter']){_0x22a1e8[_0x8ebb('0x49')]=_['merge'](_0x22a1e8[_0x8ebb('0x49')],{'$or':_[_0x8ebb('0x2f')](_0x22a1e8[_0x8ebb('0x42')],function(_0x48dd9f){var _0xf4a5df={};_0xf4a5df[_0x48dd9f]={'$like':'%'+_0xe3bc6e[_0x8ebb('0x3f')][_0x8ebb('0x4b')]+'%'};return _0xf4a5df;})});}_0x22a1e8=_[_0x8ebb('0x4c')]({},_0x22a1e8,_0xe3bc6e[_0x8ebb('0x55')]);return db['CmHopperBlack'][_0x8ebb('0x21')]({'where':_0x22a1e8[_0x8ebb('0x49')]})['then'](function(_0x3305cc){_0x50567f['count']=_0x3305cc;if(_0xe3bc6e[_0x8ebb('0x3f')][_0x8ebb('0x4e')]){_0x22a1e8[_0x8ebb('0x54')]=[{'all':!![]}];}return db[_0x8ebb('0x6f')][_0x8ebb('0x4f')](_0x22a1e8);})[_0x8ebb('0x2a')](function(_0x344ebc){_0x50567f[_0x8ebb('0x50')]=_0x344ebc;return _0x50567f;});}})[_0x8ebb('0x2a')](respondWithFilteredResult(_0x1dbb1f,_0x22a1e8))[_0x8ebb('0x51')](handleError(_0x1dbb1f,null));};exports[_0x8ebb('0x70')]=function(_0x4c849e,_0x1b1d95,_0x2c298e){var _0xfdb9e3={};var _0x2b7fc7={};var _0x1a628e;var _0x589634;return db[_0x8ebb('0x3a')][_0x8ebb('0x67')]({'where':{'id':_0x4c849e[_0x8ebb('0x53')]['id']}})['then'](handleEntityNotFound(_0x1b1d95,null))[_0x8ebb('0x2a')](function(_0x777bf3){if(_0x777bf3){_0x1a628e=_0x777bf3;_0x2b7fc7[_0x8ebb('0x3e')]=_['keys'](db[_0x8ebb('0x71')][_0x8ebb('0x3b')]);_0x2b7fc7[_0x8ebb('0x3f')]=_[_0x8ebb('0x40')](_0x4c849e[_0x8ebb('0x3f')]);_0x2b7fc7[_0x8ebb('0x41')]=_['intersection'](_0x2b7fc7[_0x8ebb('0x3e')],_0x2b7fc7[_0x8ebb('0x3f')]);_0xfdb9e3[_0x8ebb('0x42')]=_[_0x8ebb('0x43')](_0x2b7fc7['model'],qs[_0x8ebb('0x44')](_0x4c849e['query'][_0x8ebb('0x44')]));_0xfdb9e3[_0x8ebb('0x42')]=_0xfdb9e3['attributes']['length']?_0xfdb9e3[_0x8ebb('0x42')]:_0x2b7fc7[_0x8ebb('0x3e')];_0xfdb9e3['order']=qs[_0x8ebb('0x48')](_0x4c849e[_0x8ebb('0x3f')][_0x8ebb('0x48')]);_0xfdb9e3['where']=qs[_0x8ebb('0x41')](_[_0x8ebb('0x4a')](_0x4c849e[_0x8ebb('0x3f')],_0x2b7fc7['filters']));if(_0x4c849e[_0x8ebb('0x3f')][_0x8ebb('0x4b')]){_0xfdb9e3[_0x8ebb('0x49')]=_[_0x8ebb('0x4c')](_0xfdb9e3['where'],{'$or':_[_0x8ebb('0x2f')](_0xfdb9e3['attributes'],function(_0x41cc01){var _0x2b4d98={};_0x2b4d98[_0x41cc01]={'$like':'%'+_0x4c849e['query'][_0x8ebb('0x4b')]+'%'};return _0x2b4d98;})});}_0xfdb9e3=_[_0x8ebb('0x4c')]({},_0xfdb9e3,_0x4c849e[_0x8ebb('0x55')]);return _0x1a628e[_0x8ebb('0x70')](_0xfdb9e3);}})['then'](function(_0x5a1968){if(_0x5a1968){_0x589634=_0x5a1968[_0x8ebb('0x45')];if(!_0x4c849e[_0x8ebb('0x3f')][_0x8ebb('0x46')]('nolimit')){_0xfdb9e3['limit']=qs[_0x8ebb('0x22')](_0x4c849e['query'][_0x8ebb('0x22')]);_0xfdb9e3[_0x8ebb('0x1f')]=qs[_0x8ebb('0x1f')](_0x4c849e[_0x8ebb('0x3f')][_0x8ebb('0x1f')]);}return _0x1a628e[_0x8ebb('0x70')](_0xfdb9e3);}})[_0x8ebb('0x2a')](function(_0x3e89e5){if(_0x3e89e5){return _0x3e89e5?{'count':_0x589634,'rows':_0x3e89e5}:null;}})[_0x8ebb('0x2a')](respondWithResult(_0x1b1d95,null))[_0x8ebb('0x51')](handleError(_0x1b1d95,null));};exports[_0x8ebb('0x72')]=function(_0x34a083,_0xc534de,_0x560081){var _0x1f1cfb=_0x34a083[_0x8ebb('0x57')]['teams'];var _0x21901e=_['map'](_0x1f1cfb,'id');return db[_0x8ebb('0x71')][_0x8ebb('0x4f')]({'where':{'id':_0x21901e},'attributes':['id'],'include':[{'model':db[_0x8ebb('0x73')],'as':'Agents','attributes':['id',_0x8ebb('0x33'),'online',_0x8ebb('0x74'),_0x8ebb('0x75')],'raw':!![]}]})[_0x8ebb('0x2a')](function(_0x95850d){if(_0x95850d){var _0x29eaee=_[_0x8ebb('0x76')](_0x95850d,function(_0x2d7615){var _0x34d46d=_0x2d7615[_0x8ebb('0x59')]({'plain':!![]});_0x34d46d[_0x8ebb('0x77')][_0x8ebb('0x78')](function(_0x1948b0){_0x1948b0[_0x8ebb('0x79')]=_[_0x8ebb('0x32')](_0x1f1cfb,{'id':_0x34d46d['id']})[_0x8ebb('0x79')];});return _0x34d46d['Agents'];});return db[_0x8ebb('0x3a')][_0x8ebb('0x32')]({'where':{'id':_0x34a083[_0x8ebb('0x53')]['id']}})[_0x8ebb('0x2a')](function(_0x33c055){return db[_0x8ebb('0x7a')][_0x8ebb('0x7b')](function(_0x4bc6bf){return _0x33c055[_0x8ebb('0x72')](_0x21901e,{'transaction':_0x4bc6bf})['then'](function(){return BPromise[_0x8ebb('0x7c')](_0x1f1cfb,function(_0x15d316){return db[_0x8ebb('0x7d')]['upsert']({'TeamId':_0x15d316['id'],'VoiceQueueId':_0x34a083[_0x8ebb('0x53')]['id'],'penalty':_0x15d316[_0x8ebb('0x79')]},{'transaction':_0x4bc6bf});});})[_0x8ebb('0x2a')](function(){return BPromise[_0x8ebb('0x7c')](_0x29eaee,function(_0x47ec4c){return db[_0x8ebb('0x7e')]['findOrCreate']({'where':{'UserId':_0x47ec4c['id'],'VoiceQueueId':_0x34a083[_0x8ebb('0x53')]['id']},'defaults':{'penalty':_0x47ec4c[_0x8ebb('0x79')]},'transaction':_0x4bc6bf});});})['then'](function(){return BPromise[_0x8ebb('0x7c')](_[_0x8ebb('0x4b')](_0x29eaee,{'online':!![]}),function(_0x2463f5){return db['UserVoiceQueueRt'][_0x8ebb('0x7f')]({'membername':_0x2463f5[_0x8ebb('0x33')],'UserId':_0x2463f5['id'],'queue_name':_0x33c055[_0x8ebb('0x33')],'VoiceQueueId':_0x33c055['id'],'interface':_[_0x8ebb('0x80')](_0x2463f5['interface'])?util[_0x8ebb('0x81')](_0x8ebb('0x82'),_0x2463f5[_0x8ebb('0x33')]):_0x2463f5[_0x8ebb('0x75')],'paused':_0x2463f5[_0x8ebb('0x74')]||![],'penalty':_0x2463f5['penalty']},{'transaction':_0x4bc6bf});});})[_0x8ebb('0x2a')](function(){_0x29eaee[_0x8ebb('0x78')](function(_0x2fd9d0){socket[_0x8ebb('0x83')]('userVoiceQueue:save',{'UserId':_0x2fd9d0['id'],'VoiceQueueId':_0x33c055['id']});});});});});}})[_0x8ebb('0x2a')](respondWithStatusCode(_0xc534de,null))[_0x8ebb('0x51')](handleError(_0xc534de,null));};exports[_0x8ebb('0x84')]=function(_0x3c0348,_0xbaf89e,_0x78d30e){return db[_0x8ebb('0x71')]['findAll']({'where':{'id':_0x3c0348[_0x8ebb('0x3f')][_0x8ebb('0x85')]},'attributes':['id'],'include':[{'model':db[_0x8ebb('0x73')],'as':_0x8ebb('0x77'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xbaf89e,null))['then'](function(_0x3dcd37){var _0x569d3d=_[_0x8ebb('0x2f')](_0x3dcd37,'id');var _0x578f00=[];var _0x4cd3d0=[];var _0x21056e=squel[_0x8ebb('0x86')]();_0x21056e[_0x8ebb('0x87')](_0x8ebb('0x88'))[_0x8ebb('0x89')](_0x8ebb('0x8a'),'tq')[_0x8ebb('0x8b')](_0x8ebb('0x8c'),'ut',_0x8ebb('0x8d'))[_0x8ebb('0x49')](_0x8ebb('0x8e'),_0x3c0348[_0x8ebb('0x53')]['id']);for(var _0x3dcf98=0x0;_0x3dcf98<_0x3dcd37['length'];_0x3dcf98+=0x1){let _0x2d007e=_0x3dcd37[_0x3dcf98];for(var _0x126df2=0x0;_0x126df2<_0x2d007e[_0x8ebb('0x77')][_0x8ebb('0x45')];_0x126df2+=0x1){let _0x491a5b=_0x2d007e[_0x8ebb('0x77')][_0x126df2];var _0x5e5c2e=_0x21056e['clone']();_0x5e5c2e[_0x8ebb('0x49')](_0x8ebb('0x8f'),_0x491a5b['id']);_0x4cd3d0[_0x8ebb('0x90')](db[_0x8ebb('0x7a')][_0x8ebb('0x3f')](_0x5e5c2e[_0x8ebb('0x91')](),{'type':db[_0x8ebb('0x7a')][_0x8ebb('0x92')]['SELECT']})[_0x8ebb('0x2a')](function(_0x44eff9){if(_0x44eff9[_0x8ebb('0x45')]===0x1){return _0x491a5b['id'];}else{var _0x26d8cd=_['every'](_[_0x8ebb('0x2f')](_0x44eff9,_0x8ebb('0x93')),function(_0x4e3d5f){return _[_0x8ebb('0x30')](_0x569d3d,_0x4e3d5f);});if(_0x26d8cd){return _0x491a5b['id'];}}}));}}return BPromise[_0x8ebb('0x94')](_0x4cd3d0)[_0x8ebb('0x2a')](function(_0x3bb07a){_0x578f00=_(_0x578f00)[_0x8ebb('0x95')](_0x3bb07a)[_0x8ebb('0x96')]()[_0x8ebb('0x5c')]();return db[_0x8ebb('0x3a')][_0x8ebb('0x32')]({'where':{'id':_0x3c0348['params']['id']}})['then'](function(_0x38f178){return db[_0x8ebb('0x7a')][_0x8ebb('0x7b')](function(_0xc114ac){return _0x38f178['removeTeams'](_0x3c0348[_0x8ebb('0x3f')]['ids'],{'transaction':_0xc114ac})['then'](function(){if(!_[_0x8ebb('0x97')](_0x578f00)){return _0x38f178[_0x8ebb('0x98')](_0x578f00,{'transaction':_0xc114ac})[_0x8ebb('0x2a')](function(){return db[_0x8ebb('0x99')][_0x8ebb('0x34')]({'where':{'VoiceQueueId':_0x3c0348[_0x8ebb('0x53')]['id'],'UserId':_0x578f00},'transaction':_0xc114ac});});}})[_0x8ebb('0x2a')](function(){_0x578f00[_0x8ebb('0x78')](function(_0x414815){socket['emit']('userVoiceQueue:remove',{'UserId':_0x414815,'VoiceQueueId':_0x38f178['id']});});});});});});})['then'](respondWithStatusCode(_0xbaf89e,null))[_0x8ebb('0x51')](handleError(_0xbaf89e,null));};exports[_0x8ebb('0x9a')]=function(_0x4293fb,_0x3103d1,_0x213539){var _0x4969a9,_0x10de2a;return db['VoiceQueue']['find']({'where':{'id':_0x4293fb['params']['id']}})[_0x8ebb('0x2a')](handleEntityNotFound(_0x3103d1,null))[_0x8ebb('0x2a')](function(_0x3a5fe0){if(_0x3a5fe0){_0x10de2a=_0x3a5fe0;return _0x3a5fe0['addAgents'](_0x4293fb['body']['ids'],_[_0x8ebb('0x62')](_0x4293fb[_0x8ebb('0x57')],[_0x8ebb('0x85'),'id'])||{})[_0x8ebb('0x9b')](function(_0x5d7fda){for(var _0x2c078d=0x0;_0x2c078d<_0x4293fb[_0x8ebb('0x57')][_0x8ebb('0x85')][_0x8ebb('0x45')];_0x2c078d+=0x1){socket[_0x8ebb('0x83')](_0x8ebb('0x9c'),{'UserId':Number(_0x4293fb[_0x8ebb('0x57')][_0x8ebb('0x85')][_0x2c078d]),'VoiceQueueId':Number(_0x4293fb[_0x8ebb('0x53')]['id'])});}return _0x5d7fda;});}})[_0x8ebb('0x2a')](function(_0x31a3af){_0x4969a9=_0x31a3af||[];if(_0x10de2a){return db['User'][_0x8ebb('0x4f')]({'where':{'id':_0x4293fb[_0x8ebb('0x57')][_0x8ebb('0x85')]},'attributes':['id',_0x8ebb('0x33'),_0x8ebb('0x9d'),_0x8ebb('0x74'),_0x8ebb('0x75')],'raw':!![]});}})[_0x8ebb('0x2a')](function(_0x1fda1c){if(!_['isEmpty'](_0x1fda1c)){var _0x395537=[];for(var _0x17eda3=0x0;_0x17eda3<_0x1fda1c[_0x8ebb('0x45')];_0x17eda3++){if(_0x1fda1c[_0x17eda3][_0x8ebb('0x9d')]){_0x395537['push'](db['UserVoiceQueueRt'][_0x8ebb('0x7f')]({'membername':_0x1fda1c[_0x17eda3]['name'],'UserId':_0x1fda1c[_0x17eda3]['id'],'queue_name':_0x10de2a[_0x8ebb('0x33')],'VoiceQueueId':_0x10de2a['id'],'interface':_[_0x8ebb('0x80')](_0x1fda1c[_0x17eda3][_0x8ebb('0x75')])?util[_0x8ebb('0x81')](_0x8ebb('0x82'),_0x1fda1c[_0x17eda3][_0x8ebb('0x33')]):_0x1fda1c[_0x17eda3][_0x8ebb('0x75')],'paused':_0x1fda1c[_0x17eda3][_0x8ebb('0x74')]||![],'penalty':_0x4293fb[_0x8ebb('0x57')][_0x8ebb('0x79')]||0x0}));}}return BPromise['all'](_0x395537);}})[_0x8ebb('0x2a')](function(){return _0x4969a9;})[_0x8ebb('0x2a')](respondWithResult(_0x3103d1,null))[_0x8ebb('0x51')](handleError(_0x3103d1,null));};exports['removeAgents']=function(_0x8d8cda,_0x48be75,_0x65980d){return db[_0x8ebb('0x3a')]['find']({'where':{'id':_0x8d8cda[_0x8ebb('0x53')]['id']}})['then'](handleEntityNotFound(_0x48be75,null))['then'](function(_0x2034ee){if(_0x2034ee){return _0x2034ee['removeAgents'](_0x8d8cda[_0x8ebb('0x3f')][_0x8ebb('0x85')])['then'](function(){if(_[_0x8ebb('0x9e')](_0x8d8cda['query']['ids'])){for(var _0x44a45d=0x0;_0x44a45d<_0x8d8cda[_0x8ebb('0x3f')][_0x8ebb('0x85')][_0x8ebb('0x45')];_0x44a45d+=0x1){socket[_0x8ebb('0x83')](_0x8ebb('0x9f'),{'UserId':Number(_0x8d8cda[_0x8ebb('0x3f')]['ids'][_0x44a45d]),'VoiceQueueId':Number(_0x8d8cda['params']['id'])});}}else{socket[_0x8ebb('0x83')](_0x8ebb('0x9f'),{'UserId':Number(_0x8d8cda[_0x8ebb('0x3f')][_0x8ebb('0x85')]),'VoiceQueueId':Number(_0x8d8cda[_0x8ebb('0x53')]['id'])});}});}})[_0x8ebb('0x2a')](function(_0x38a2da){return db[_0x8ebb('0x99')]['destroy']({'where':{'VoiceQueueId':_0x8d8cda['params']['id'],'UserId':_0x8d8cda['query'][_0x8ebb('0x85')]}})[_0x8ebb('0x2a')](function(){return _0x38a2da;});})['then'](respondWithStatusCode(_0x48be75,null))[_0x8ebb('0x51')](handleError(_0x48be75,null));};exports[_0x8ebb('0xa0')]=function(_0x2c1e93,_0x178ac1,_0x28a7f8){var _0x2785f9={};var _0x4af103={};var _0x302c30;var _0x4c1478;return db[_0x8ebb('0x3a')][_0x8ebb('0x67')]({'where':{'id':_0x2c1e93['params']['id']}})[_0x8ebb('0x2a')](handleEntityNotFound(_0x178ac1,null))[_0x8ebb('0x2a')](function(_0x53d6fb){if(_0x53d6fb){_0x302c30=_0x53d6fb;_0x4af103['model']=_['keys'](db['User'][_0x8ebb('0x3b')]);_0x4af103[_0x8ebb('0x3f')]=_['keys'](_0x2c1e93[_0x8ebb('0x3f')]);_0x4af103[_0x8ebb('0x41')]=_[_0x8ebb('0x43')](_0x4af103[_0x8ebb('0x3e')],_0x4af103[_0x8ebb('0x3f')]);_0x2785f9[_0x8ebb('0x42')]=_[_0x8ebb('0x43')](_0x4af103[_0x8ebb('0x3e')],qs[_0x8ebb('0x44')](_0x2c1e93[_0x8ebb('0x3f')][_0x8ebb('0x44')]));_0x2785f9[_0x8ebb('0x42')]=_0x2785f9[_0x8ebb('0x42')][_0x8ebb('0x45')]?_0x2785f9[_0x8ebb('0x42')]:_0x4af103['model'];_0x2785f9['order']=qs[_0x8ebb('0x48')](_0x2c1e93[_0x8ebb('0x3f')][_0x8ebb('0x48')]);_0x2785f9[_0x8ebb('0x49')]=qs[_0x8ebb('0x41')](_[_0x8ebb('0x4a')](_0x2c1e93['query'],_0x4af103[_0x8ebb('0x41')]));if(_0x2c1e93[_0x8ebb('0x3f')][_0x8ebb('0x4b')]){_0x2785f9[_0x8ebb('0x49')]=_[_0x8ebb('0x4c')](_0x2785f9[_0x8ebb('0x49')],{'$or':_[_0x8ebb('0x2f')](_0x2785f9['attributes'],function(_0x53d325){var _0x4a0d14={};_0x4a0d14[_0x53d325]={'$like':'%'+_0x2c1e93[_0x8ebb('0x3f')][_0x8ebb('0x4b')]+'%'};return _0x4a0d14;})});}_0x2785f9=_['merge']({},_0x2785f9,_0x2c1e93[_0x8ebb('0x55')]);return _0x302c30[_0x8ebb('0xa0')](_0x2785f9);}})[_0x8ebb('0x2a')](function(_0x547ff2){if(_0x547ff2){_0x4c1478=_0x547ff2[_0x8ebb('0x45')];if(!_0x2c1e93[_0x8ebb('0x3f')]['hasOwnProperty'](_0x8ebb('0x47'))){_0x2785f9[_0x8ebb('0x22')]=qs[_0x8ebb('0x22')](_0x2c1e93[_0x8ebb('0x3f')][_0x8ebb('0x22')]);_0x2785f9['offset']=qs[_0x8ebb('0x1f')](_0x2c1e93[_0x8ebb('0x3f')][_0x8ebb('0x1f')]);}return _0x302c30[_0x8ebb('0xa0')](_0x2785f9);}})[_0x8ebb('0x2a')](function(_0x110b01){if(_0x110b01){return _0x110b01?{'count':_0x4c1478,'rows':_0x110b01}:null;}})[_0x8ebb('0x2a')](respondWithResult(_0x178ac1,null))['catch'](handleError(_0x178ac1,null));};exports[_0x8ebb('0xa1')]=function(_0x49a53a,_0x5a24ba,_0x536bad){var _0x331a28={};var _0x4ab675={};var _0x4a7c65;var _0x543cad;return db[_0x8ebb('0x3a')][_0x8ebb('0x67')]({'where':{'id':_0x49a53a[_0x8ebb('0x53')]['id']}})[_0x8ebb('0x2a')](handleEntityNotFound(_0x5a24ba,null))[_0x8ebb('0x2a')](function(_0x1f8fcf){if(_0x1f8fcf){_0x4a7c65=_0x1f8fcf;_0x4ab675[_0x8ebb('0x3e')]=_[_0x8ebb('0x40')](db[_0x8ebb('0x99')]['rawAttributes']);_0x4ab675[_0x8ebb('0x3f')]=_[_0x8ebb('0x40')](_0x49a53a['query']);_0x4ab675[_0x8ebb('0x41')]=_['intersection'](_0x4ab675[_0x8ebb('0x3e')],_0x4ab675[_0x8ebb('0x3f')]);_0x331a28[_0x8ebb('0x42')]=_[_0x8ebb('0x43')](_0x4ab675[_0x8ebb('0x3e')],qs[_0x8ebb('0x44')](_0x49a53a[_0x8ebb('0x3f')][_0x8ebb('0x44')]));_0x331a28[_0x8ebb('0x42')]=_0x331a28['attributes'][_0x8ebb('0x45')]?_0x331a28['attributes']:_0x4ab675[_0x8ebb('0x3e')];_0x331a28[_0x8ebb('0x68')]=qs[_0x8ebb('0x48')](_0x49a53a[_0x8ebb('0x3f')]['sort']);_0x331a28[_0x8ebb('0x49')]=qs[_0x8ebb('0x41')](_[_0x8ebb('0x4a')](_0x49a53a['query'],_0x4ab675[_0x8ebb('0x41')]));if(_0x49a53a['query']['filter']){_0x331a28[_0x8ebb('0x49')]=_['merge'](_0x331a28[_0x8ebb('0x49')],{'$or':_[_0x8ebb('0x2f')](_0x331a28['attributes'],function(_0xb12a55){var _0x3c4553={};_0x3c4553[_0xb12a55]={'$like':'%'+_0x49a53a['query']['filter']+'%'};return _0x3c4553;})});}_0x331a28=_[_0x8ebb('0x4c')]({},_0x331a28,_0x49a53a['options']);return _0x4a7c65[_0x8ebb('0xa1')](_0x331a28);}})['then'](function(_0x32c467){if(_0x32c467){_0x543cad=_0x32c467[_0x8ebb('0x45')];if(!_0x49a53a[_0x8ebb('0x3f')][_0x8ebb('0x46')](_0x8ebb('0x47'))){_0x331a28[_0x8ebb('0x22')]=qs['limit'](_0x49a53a['query']['limit']);_0x331a28[_0x8ebb('0x1f')]=qs[_0x8ebb('0x1f')](_0x49a53a[_0x8ebb('0x3f')][_0x8ebb('0x1f')]);}return _0x4a7c65[_0x8ebb('0xa1')](_0x331a28);}})[_0x8ebb('0x2a')](function(_0x1c65aa){return _0x1c65aa?{'count':_0x543cad,'rows':_0x1c65aa}:null;})[_0x8ebb('0x2a')](respondWithResult(_0x5a24ba,null))[_0x8ebb('0x51')](handleError(_0x5a24ba,null));};exports[_0x8ebb('0xa2')]=function(_0xb94799,_0x3911af,_0x21704f){var _0x53ff09={};var _0x39fd16={};var _0x2a8c9e;var _0x21fa70;return db[_0x8ebb('0x3a')]['findOne']({'where':{'id':_0xb94799[_0x8ebb('0x53')]['id']}})[_0x8ebb('0x2a')](handleEntityNotFound(_0x3911af,null))[_0x8ebb('0x2a')](function(_0x22564c){if(_0x22564c){_0x2a8c9e=_0x22564c;_0x39fd16['model']=_[_0x8ebb('0x40')](db['CmList']['rawAttributes']);_0x39fd16[_0x8ebb('0x3f')]=_['keys'](_0xb94799[_0x8ebb('0x3f')]);_0x39fd16[_0x8ebb('0x41')]=_[_0x8ebb('0x43')](_0x39fd16[_0x8ebb('0x3e')],_0x39fd16[_0x8ebb('0x3f')]);_0x53ff09[_0x8ebb('0x42')]=_[_0x8ebb('0x43')](_0x39fd16[_0x8ebb('0x3e')],qs[_0x8ebb('0x44')](_0xb94799['query']['fields']));_0x53ff09[_0x8ebb('0x42')]=_0x53ff09[_0x8ebb('0x42')][_0x8ebb('0x45')]?_0x53ff09[_0x8ebb('0x42')]:_0x39fd16['model'];_0x53ff09[_0x8ebb('0x68')]=qs[_0x8ebb('0x48')](_0xb94799[_0x8ebb('0x3f')][_0x8ebb('0x48')]);_0x53ff09[_0x8ebb('0x49')]=qs[_0x8ebb('0x41')](_[_0x8ebb('0x4a')](_0xb94799[_0x8ebb('0x3f')],_0x39fd16[_0x8ebb('0x41')]));if(_0xb94799['query']['filter']){_0x53ff09[_0x8ebb('0x49')]=_['merge'](_0x53ff09[_0x8ebb('0x49')],{'$or':_['map'](_0x53ff09[_0x8ebb('0x42')],function(_0x3d57f6){var _0xb8efac={};_0xb8efac[_0x3d57f6]={'$like':'%'+_0xb94799[_0x8ebb('0x3f')][_0x8ebb('0x4b')]+'%'};return _0xb8efac;})});}_0x53ff09=_[_0x8ebb('0x4c')]({},_0x53ff09,_0xb94799[_0x8ebb('0x55')]);return _0x2a8c9e[_0x8ebb('0xa2')](_0x53ff09);}})[_0x8ebb('0x2a')](function(_0x40ca82){if(_0x40ca82){_0x21fa70=_0x40ca82[_0x8ebb('0x45')];if(!_0xb94799['query'][_0x8ebb('0x46')](_0x8ebb('0x47'))){_0x53ff09[_0x8ebb('0x22')]=qs[_0x8ebb('0x22')](_0xb94799['query'][_0x8ebb('0x22')]);_0x53ff09[_0x8ebb('0x1f')]=qs[_0x8ebb('0x1f')](_0xb94799[_0x8ebb('0x3f')][_0x8ebb('0x1f')]);}return _0x2a8c9e[_0x8ebb('0xa2')](_0x53ff09);}})[_0x8ebb('0x2a')](function(_0x583f43){if(_0x583f43){return _0x583f43?{'count':_0x21fa70,'rows':_0x583f43}:null;}})[_0x8ebb('0x2a')](respondWithResult(_0x3911af,null))[_0x8ebb('0x51')](handleError(_0x3911af,null));};exports[_0x8ebb('0xa3')]=function(_0x220119,_0x52647b,_0x59285a){var _0x16c2c7,_0x3d4199;return db[_0x8ebb('0x3a')][_0x8ebb('0x32')]({'where':{'id':_0x220119[_0x8ebb('0x53')]['id']}})['then'](handleEntityNotFound(_0x52647b,null))[_0x8ebb('0x2a')](function(_0x15a27a){if(_0x15a27a){_0x3d4199=_0x15a27a;return _0x15a27a[_0x8ebb('0xa3')](_0x220119[_0x8ebb('0x57')][_0x8ebb('0x85')],_[_0x8ebb('0x62')](_0x220119[_0x8ebb('0x57')],[_0x8ebb('0x85'),'id'])||{});}return null;})['spread'](function(_0x4a236d){var _0x481cca;_0x16c2c7=_0x4a236d||[];var _0x485531=[];if(_0x4a236d){for(var _0x4c90f8=0x0;_0x4c90f8<_0x4a236d[_0x8ebb('0x45')];_0x4c90f8+=0x1){var _0x7d096c=_0x4a236d[_0x4c90f8][_0x8ebb('0x59')]({'plain':!![]});_0x3d4199[_0x8ebb('0xa4')]=_0x220119[_0x8ebb('0x57')]['dialCheckDuplicateType']?_0x220119['body'][_0x8ebb('0xa4')]:_0x3d4199[_0x8ebb('0xa4')];switch(_0x3d4199[_0x8ebb('0xa4')]){case'always':_0x481cca=squel[_0x8ebb('0xa5')]()[_0x8ebb('0xa6')](_0x8ebb('0xa7'))[_0x8ebb('0xa8')](['phone','scheduledAt','ContactId','ListId',_0x8ebb('0x69'),'createdAt',_0x8ebb('0xa9')],squel[_0x8ebb('0x86')]()['field'](_0x8ebb('0xaa'),_0x8ebb('0xaa'))['field'](_0x8ebb('0xab'),_0x8ebb('0xac'))[_0x8ebb('0x87')]('id',_0x8ebb('0xad'))[_0x8ebb('0x87')](_0x7d096c[_0x8ebb('0xae')][_0x8ebb('0x91')](),_0x8ebb('0xaf'))[_0x8ebb('0x87')](_0x220119[_0x8ebb('0x53')]['id'][_0x8ebb('0x91')](),_0x8ebb('0x69'))[_0x8ebb('0x87')](_0x8ebb('0xab'),_0x8ebb('0x61'))['field'](_0x8ebb('0xab'),'updatedAt')[_0x8ebb('0x89')](_0x8ebb('0xb0'))[_0x8ebb('0x49')](_0x8ebb('0xb1'))[_0x8ebb('0x49')](_0x8ebb('0xb2'),_0x7d096c[_0x8ebb('0xae')][_0x8ebb('0x91')]())[_0x8ebb('0x49')](_0x8ebb('0xb3'))[_0x8ebb('0x49')](_0x8ebb('0xb4'),squel[_0x8ebb('0x86')]()['field'](_0x8ebb('0xb5'))[_0x8ebb('0x89')](_0x8ebb('0xb6'))[_0x8ebb('0x49')](_0x8ebb('0x8e'),_0x220119[_0x8ebb('0x53')]['id'][_0x8ebb('0x91')]()))[_0x8ebb('0x49')](_0x8ebb('0xb4'),squel['select']()[_0x8ebb('0x87')](_0x8ebb('0xb7'))['from'](_0x8ebb('0xa7'))[_0x8ebb('0x49')](_0x8ebb('0x8e'),_0x220119['params']['id']['toString']())))['toString']();break;case _0x8ebb('0xb8'):_0x481cca=squel['insert']()[_0x8ebb('0xa6')](_0x8ebb('0xa7'))[_0x8ebb('0xa8')](['phone',_0x8ebb('0xac'),_0x8ebb('0xad'),_0x8ebb('0xaf'),_0x8ebb('0x69'),_0x8ebb('0x61'),'updatedAt'],squel[_0x8ebb('0x86')]()[_0x8ebb('0x87')](_0x8ebb('0xaa'),_0x8ebb('0xaa'))[_0x8ebb('0x87')](_0x8ebb('0xab'),_0x8ebb('0xac'))['field']('id',_0x8ebb('0xad'))[_0x8ebb('0x87')](_0x7d096c[_0x8ebb('0xae')][_0x8ebb('0x91')](),'ListId')[_0x8ebb('0x87')](_0x220119[_0x8ebb('0x53')]['id']['toString'](),_0x8ebb('0x69'))[_0x8ebb('0x87')](_0x8ebb('0xab'),_0x8ebb('0x61'))[_0x8ebb('0x87')](_0x8ebb('0xab'),'updatedAt')[_0x8ebb('0x89')]('cm_contacts')[_0x8ebb('0x49')](_0x8ebb('0xb1'))['where'](_0x8ebb('0xb2'),_0x7d096c[_0x8ebb('0xae')][_0x8ebb('0x91')]())[_0x8ebb('0x49')](_0x8ebb('0xb3'))[_0x8ebb('0x49')](_0x8ebb('0xb4'),squel['select']()[_0x8ebb('0x87')](_0x8ebb('0xb7'))['from'](_0x8ebb('0xa7'))[_0x8ebb('0x49')](_0x8ebb('0x8e'),_0x220119[_0x8ebb('0x53')]['id'][_0x8ebb('0x91')]())))[_0x8ebb('0x91')]();break;default:_0x481cca=squel[_0x8ebb('0xa5')]()[_0x8ebb('0xa6')]('cm_hopper')[_0x8ebb('0xa8')](['phone',_0x8ebb('0xac'),'ContactId',_0x8ebb('0xaf'),_0x8ebb('0x69'),'createdAt',_0x8ebb('0xa9')],squel[_0x8ebb('0x86')]()[_0x8ebb('0x87')](_0x8ebb('0xaa'),_0x8ebb('0xaa'))[_0x8ebb('0x87')](_0x8ebb('0xab'),_0x8ebb('0xac'))[_0x8ebb('0x87')]('id',_0x8ebb('0xad'))[_0x8ebb('0x87')](_0x7d096c['CmListId'][_0x8ebb('0x91')](),_0x8ebb('0xaf'))[_0x8ebb('0x87')](_0x220119[_0x8ebb('0x53')]['id'][_0x8ebb('0x91')](),'VoiceQueueId')[_0x8ebb('0x87')](_0x8ebb('0xab'),_0x8ebb('0x61'))[_0x8ebb('0x87')](_0x8ebb('0xab'),_0x8ebb('0xa9'))[_0x8ebb('0x89')](_0x8ebb('0xb0'))['where'](_0x8ebb('0xb1'))[_0x8ebb('0x49')](_0x8ebb('0xb2'),_0x7d096c['CmListId'][_0x8ebb('0x91')]())[_0x8ebb('0x49')](_0x8ebb('0xb3')))[_0x8ebb('0x91')]();}_0x485531[_0x8ebb('0x90')](db[_0x8ebb('0x7a')]['query'](_0x481cca));}return BPromise[_0x8ebb('0x94')](_0x485531);}})['then'](function(){return _0x16c2c7;})[_0x8ebb('0x2a')](respondWithResult(_0x52647b,null))[_0x8ebb('0x51')](handleError(_0x52647b,null));};exports[_0x8ebb('0xb9')]=function(_0x967f11,_0x2fda83,_0x2e4424){return db[_0x8ebb('0x3a')][_0x8ebb('0x32')]({'where':{'id':_0x967f11[_0x8ebb('0x53')]['id']}})[_0x8ebb('0x2a')](handleEntityNotFound(_0x2fda83,null))[_0x8ebb('0x2a')](function(_0x5f50be){if(_0x5f50be){return _0x5f50be['removeLists'](_0x967f11[_0x8ebb('0x3f')][_0x8ebb('0x85')]);}})['then'](function(_0xdbeb7){if(_0xdbeb7){return db[_0x8ebb('0x6a')][_0x8ebb('0x34')]({'where':{'ListId':_0x967f11['query'][_0x8ebb('0x85')],'VoiceQueueId':_0x967f11['params']['id']}})['then'](function(){return _0xdbeb7;});}})[_0x8ebb('0x2a')](respondWithStatusCode(_0x2fda83,null))[_0x8ebb('0x51')](handleError(_0x2fda83,null));};exports[_0x8ebb('0xba')]=function(_0x599475,_0x239781,_0x1d612c){var _0x285dce={};var _0x375df7={};var _0x12d071;var _0x5e73e3;return db[_0x8ebb('0x3a')][_0x8ebb('0x67')]({'where':{'id':_0x599475[_0x8ebb('0x53')]['id']}})[_0x8ebb('0x2a')](handleEntityNotFound(_0x239781,null))['then'](function(_0x573a6d){if(_0x573a6d){_0x12d071=_0x573a6d;_0x375df7[_0x8ebb('0x3e')]=_[_0x8ebb('0x40')](db[_0x8ebb('0xbb')][_0x8ebb('0x3b')]);_0x375df7[_0x8ebb('0x3f')]=_['keys'](_0x599475[_0x8ebb('0x3f')]);_0x375df7[_0x8ebb('0x41')]=_[_0x8ebb('0x43')](_0x375df7['model'],_0x375df7[_0x8ebb('0x3f')]);_0x285dce['attributes']=_[_0x8ebb('0x43')](_0x375df7['model'],qs['fields'](_0x599475[_0x8ebb('0x3f')]['fields']));_0x285dce[_0x8ebb('0x42')]=_0x285dce[_0x8ebb('0x42')]['length']?_0x285dce[_0x8ebb('0x42')]:_0x375df7['model'];_0x285dce['order']=qs[_0x8ebb('0x48')](_0x599475[_0x8ebb('0x3f')][_0x8ebb('0x48')]);_0x285dce[_0x8ebb('0x49')]=qs[_0x8ebb('0x41')](_[_0x8ebb('0x4a')](_0x599475[_0x8ebb('0x3f')],_0x375df7[_0x8ebb('0x41')]));if(_0x599475[_0x8ebb('0x3f')][_0x8ebb('0x4b')]){_0x285dce[_0x8ebb('0x49')]=_[_0x8ebb('0x4c')](_0x285dce[_0x8ebb('0x49')],{'$or':_[_0x8ebb('0x2f')](_0x285dce['attributes'],function(_0x11679a){var _0x29965e={};_0x29965e[_0x11679a]={'$like':'%'+_0x599475[_0x8ebb('0x3f')][_0x8ebb('0x4b')]+'%'};return _0x29965e;})});}_0x285dce=_[_0x8ebb('0x4c')]({},_0x285dce,_0x599475[_0x8ebb('0x55')]);return _0x12d071[_0x8ebb('0xba')](_0x285dce);}})['then'](function(_0x481204){if(_0x481204){_0x5e73e3=_0x481204[_0x8ebb('0x45')];if(!_0x599475[_0x8ebb('0x3f')][_0x8ebb('0x46')]('nolimit')){_0x285dce[_0x8ebb('0x22')]=qs[_0x8ebb('0x22')](_0x599475[_0x8ebb('0x3f')][_0x8ebb('0x22')]);_0x285dce[_0x8ebb('0x1f')]=qs[_0x8ebb('0x1f')](_0x599475[_0x8ebb('0x3f')][_0x8ebb('0x1f')]);}return _0x12d071[_0x8ebb('0xba')](_0x285dce);}})['then'](function(_0xc927e7){if(_0xc927e7){return _0xc927e7?{'count':_0x5e73e3,'rows':_0xc927e7}:null;}})[_0x8ebb('0x2a')](respondWithResult(_0x239781,null))[_0x8ebb('0x51')](handleError(_0x239781,null));};exports[_0x8ebb('0xbc')]=function(_0x34c7ff,_0x32e0fa,_0x3eb676){var _0x7c668b,_0x208f63;return db[_0x8ebb('0x3a')][_0x8ebb('0x32')]({'where':{'id':_0x34c7ff[_0x8ebb('0x53')]['id']}})[_0x8ebb('0x2a')](handleEntityNotFound(_0x32e0fa,null))[_0x8ebb('0x2a')](function(_0xa4501f){if(_0xa4501f){_0x208f63=_0xa4501f;return _0xa4501f[_0x8ebb('0xbc')](_0x34c7ff[_0x8ebb('0x57')][_0x8ebb('0x85')],_[_0x8ebb('0x62')](_0x34c7ff['body'],[_0x8ebb('0x85'),'id'])||{});}return null;})[_0x8ebb('0x9b')](function(_0x6c86f7){var _0x21d310;_0x7c668b=_0x6c86f7||[];var _0x88a011=[];if(_0x6c86f7){for(var _0x1f1c61=0x0;_0x1f1c61<_0x6c86f7[_0x8ebb('0x45')];_0x1f1c61+=0x1){var _0x3f842a=_0x6c86f7[_0x1f1c61]['get']({'plain':!![]});_0x21d310=squel[_0x8ebb('0xa5')]()[_0x8ebb('0xa6')](_0x8ebb('0xbd'))[_0x8ebb('0xa8')](['phone','ContactId',_0x8ebb('0xaf'),'VoiceQueueId',_0x8ebb('0x61'),_0x8ebb('0xa9')],squel[_0x8ebb('0x86')]()['field'](_0x8ebb('0xaa'),'phone')[_0x8ebb('0x87')]('id',_0x8ebb('0xad'))[_0x8ebb('0x87')](_0x3f842a[_0x8ebb('0xae')][_0x8ebb('0x91')](),_0x8ebb('0xaf'))['field'](_0x34c7ff[_0x8ebb('0x53')]['id']['toString'](),_0x8ebb('0x69'))[_0x8ebb('0x87')]('NOW()','createdAt')[_0x8ebb('0x87')](_0x8ebb('0xab'),_0x8ebb('0xa9'))['from'](_0x8ebb('0xb0'))[_0x8ebb('0x49')]('deletedAt\x20IS\x20NULL')['where'](_0x8ebb('0xb2'),_0x3f842a[_0x8ebb('0xae')][_0x8ebb('0x91')]())[_0x8ebb('0x49')](_0x8ebb('0xb3')))[_0x8ebb('0x91')]();_0x88a011[_0x8ebb('0x90')](db[_0x8ebb('0x7a')][_0x8ebb('0x3f')](_0x21d310));}return BPromise['all'](_0x88a011);}})[_0x8ebb('0x2a')](function(){return _0x7c668b;})['then'](respondWithResult(_0x32e0fa,null))[_0x8ebb('0x51')](handleError(_0x32e0fa,null));};exports['removeBlackLists']=function(_0x42178d,_0x4d1db4,_0x514a15){return db[_0x8ebb('0x3a')]['find']({'where':{'id':_0x42178d[_0x8ebb('0x53')]['id']}})['then'](handleEntityNotFound(_0x4d1db4,null))['then'](function(_0x47774b){if(_0x47774b){return _0x47774b['removeBlackLists'](_0x42178d[_0x8ebb('0x3f')][_0x8ebb('0x85')]);}})[_0x8ebb('0x2a')](function(_0x4b620e){if(_0x4b620e){return db[_0x8ebb('0x6f')][_0x8ebb('0x34')]({'where':{'ListId':_0x42178d[_0x8ebb('0x3f')][_0x8ebb('0x85')],'VoiceQueueId':_0x42178d['params']['id']}})[_0x8ebb('0x2a')](function(){return _0x4b620e;});}})['then'](respondWithStatusCode(_0x4d1db4,null))[_0x8ebb('0x51')](handleError(_0x4d1db4,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index b8574d0..4749aef 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 _0xc8fa=['update','emit','hasOwnProperty','hook','exports','events','VoiceQueue','setMaxListeners','save'];(function(_0x27d8bc,_0x19e010){var _0x4b04cb=function(_0x524568){while(--_0x524568){_0x27d8bc['push'](_0x27d8bc['shift']());}};_0x4b04cb(++_0x19e010);}(_0xc8fa,0x7a));var _0xac8f=function(_0x1bd479,_0x1aab33){_0x1bd479=_0x1bd479-0x0;var _0x49d799=_0xc8fa[_0x1bd479];return _0x49d799;};'use strict';var EventEmitter=require(_0xac8f('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xac8f('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xac8f('0x2')](0x0);var events={'afterCreate':_0xac8f('0x3'),'afterUpdate':_0xac8f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x443d8f){return function(_0x1b33d1,_0x59af34,_0x165302){VoiceQueueEvents['emit'](_0x443d8f+':'+_0x1b33d1['id'],_0x1b33d1);VoiceQueueEvents[_0xac8f('0x5')](_0x443d8f,_0x1b33d1);_0x165302(null);};}for(var e in events){if(events[_0xac8f('0x6')](e)){var event=events[e];VoiceQueue[_0xac8f('0x7')](e,emitEvent(event));}}module[_0xac8f('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x5367=['update','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners'];(function(_0x4c825d,_0x10ec2b){var _0x43de87=function(_0xcab4a3){while(--_0xcab4a3){_0x4c825d['push'](_0x4c825d['shift']());}};_0x43de87(++_0x10ec2b);}(_0x5367,0x64));var _0x7536=function(_0x3f05d1,_0x2e2bee){_0x3f05d1=_0x3f05d1-0x0;var _0x4a179b=_0x5367[_0x3f05d1];return _0x4a179b;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x7536('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x7536('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7536('0x2'),'afterDestroy':'remove'};function emitEvent(_0x28e76b){return function(_0xc32f5c,_0xd4d3d,_0x386fd7){VoiceQueueEvents[_0x7536('0x3')](_0x28e76b+':'+_0xc32f5c['id'],_0xc32f5c);VoiceQueueEvents[_0x7536('0x3')](_0x28e76b,_0xc32f5c);_0x386fd7(null);};}for(var e in events){if(events[_0x7536('0x4')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x7536('0x5')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 258708d..5c79d43 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 _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x906e5d,_0x17d0a6){var _0x6498=function(_0x239248){while(--_0x239248){_0x906e5d['push'](_0x906e5d['shift']());}};_0x6498(++_0x17d0a6);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x8a29a7,_0x71a5bc){var _0x365de4=function(_0x3a2622){while(--_0x3a2622){_0x8a29a7['push'](_0x8a29a7['shift']());}};_0x365de4(++_0x71a5bc);}(_0xedd9,0xfc));var _0x9edd=function(_0x11b142,_0x30ce6a){_0x11b142=_0x11b142-0x0;var _0x510520=_0xedd9[_0x11b142];return _0x510520;};'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':'voice_queues','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 7f5e721..7a39bfd 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 _0x5689=['request\x20sent','stringify','error','code','message','GetVoiceQueue','VoiceQueue','options','raw','limit','map','include','model','attributes','catch','ShowVoiceQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5689,0x8d));var _0x9568=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x5689[_0x1abb09];return _0xea1c07;};'use strict';var _=require(_0x9568('0x0'));var util=require(_0x9568('0x1'));var moment=require(_0x9568('0x2'));var BPromise=require(_0x9568('0x3'));var rs=require(_0x9568('0x4'));var fs=require('fs');var Redis=require(_0x9568('0x5'));var db=require(_0x9568('0x6'))['db'];var utils=require(_0x9568('0x7'));var logger=require(_0x9568('0x8'))('rpc');var config=require(_0x9568('0x9'));var jayson=require(_0x9568('0xa'));var client=jayson[_0x9568('0xb')][_0x9568('0xc')]({'port':0x232a});config[_0x9568('0xd')]=_[_0x9568('0xe')](config[_0x9568('0xd')],{'host':_0x9568('0xf'),'port':0x18eb});var socket=require(_0x9568('0x10'))(new Redis(config['redis']));require(_0x9568('0x11'))[_0x9568('0x12')](socket);function respondWithRpcPromise(_0x34dcff,_0x3df77d,_0x45e32b){return new BPromise(function(_0x5bb72c,_0x485b0e){return client[_0x9568('0x13')](_0x34dcff,_0x45e32b)[_0x9568('0x14')](function(_0x47c637){logger[_0x9568('0x15')](_0x9568('0x16'),_0x3df77d,_0x9568('0x17'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x3df77d,_0x9568('0x17'),JSON[_0x9568('0x18')](_0x47c637));if(_0x47c637[_0x9568('0x19')]){if(_0x47c637[_0x9568('0x19')][_0x9568('0x1a')]===0x1f4){logger[_0x9568('0x19')](_0x9568('0x16'),_0x3df77d,_0x47c637['error'][_0x9568('0x1b')]);return _0x485b0e(_0x47c637['error'][_0x9568('0x1b')]);}logger[_0x9568('0x19')](_0x9568('0x16'),_0x3df77d,_0x47c637[_0x9568('0x19')][_0x9568('0x1b')]);return _0x5bb72c(_0x47c637['error'][_0x9568('0x1b')]);}else{logger[_0x9568('0x15')](_0x9568('0x16'),_0x3df77d,_0x9568('0x17'));_0x5bb72c(_0x47c637['result'][_0x9568('0x1b')]);}})['catch'](function(_0x51103c){logger[_0x9568('0x19')](_0x9568('0x16'),_0x3df77d,_0x51103c);_0x485b0e(_0x51103c);});});}exports[_0x9568('0x1c')]=function(_0x4467c3){var _0x369b0f=this;return new Promise(function(_0xaa4586,_0x1da93f){return db[_0x9568('0x1d')]['findAll']({'raw':_0x4467c3['options']?_0x4467c3[_0x9568('0x1e')][_0x9568('0x1f')]===undefined?!![]:![]:!![],'where':_0x4467c3['options']?_0x4467c3['options']['where']||null:null,'attributes':_0x4467c3['options']?_0x4467c3[_0x9568('0x1e')]['attributes']||null:null,'limit':_0x4467c3[_0x9568('0x1e')]?_0x4467c3[_0x9568('0x1e')][_0x9568('0x20')]||null:null,'include':_0x4467c3[_0x9568('0x1e')]?_0x4467c3[_0x9568('0x1e')]['include']?_[_0x9568('0x21')](_0x4467c3['options'][_0x9568('0x22')],function(_0x2497e7){return{'model':db[_0x2497e7[_0x9568('0x23')]],'as':_0x2497e7['as'],'attributes':_0x2497e7[_0x9568('0x24')],'include':_0x2497e7[_0x9568('0x22')]?_[_0x9568('0x21')](_0x2497e7[_0x9568('0x22')],function(_0x20d661){return{'model':db[_0x20d661[_0x9568('0x23')]],'as':_0x20d661['as'],'attributes':_0x20d661[_0x9568('0x24')],'include':_0x20d661[_0x9568('0x22')]?_[_0x9568('0x21')](_0x20d661[_0x9568('0x22')],function(_0x13a60a){return{'model':db[_0x13a60a['model']],'as':_0x13a60a['as'],'attributes':_0x13a60a['attributes']};}):[]};}):[]};}):[]:[]})[_0x9568('0x14')](function(_0x1bebe8){logger['info']('GetVoiceQueue',_0x4467c3);logger['debug']('GetVoiceQueue',_0x4467c3,JSON[_0x9568('0x18')](_0x1bebe8));_0xaa4586(_0x1bebe8);})[_0x9568('0x25')](function(_0x341c5d){logger[_0x9568('0x19')]('GetVoiceQueue',_0x341c5d[_0x9568('0x1b')],_0x4467c3);_0x1da93f(_0x369b0f[_0x9568('0x19')](0x1f4,_0x341c5d[_0x9568('0x1b')]));});});};exports[_0x9568('0x26')]=function(_0x3ab845){var _0x33496d=this;return new Promise(function(_0x18789c,_0x324431){return db[_0x9568('0x1d')][_0x9568('0x27')]({'raw':_0x3ab845[_0x9568('0x1e')]?_0x3ab845[_0x9568('0x1e')][_0x9568('0x1f')]===undefined?!![]:![]:!![],'where':_0x3ab845[_0x9568('0x1e')]?_0x3ab845['options'][_0x9568('0x28')]||null:null,'attributes':_0x3ab845[_0x9568('0x1e')]?_0x3ab845[_0x9568('0x1e')][_0x9568('0x24')]||null:null,'include':_0x3ab845['options']?_0x3ab845[_0x9568('0x1e')][_0x9568('0x22')]?_[_0x9568('0x21')](_0x3ab845[_0x9568('0x1e')][_0x9568('0x22')],function(_0x55cd25){return{'model':db[_0x55cd25[_0x9568('0x23')]],'as':_0x55cd25['as'],'attributes':_0x55cd25[_0x9568('0x24')],'include':_0x55cd25[_0x9568('0x22')]?_[_0x9568('0x21')](_0x55cd25[_0x9568('0x22')],function(_0x627f48){return{'model':db[_0x627f48[_0x9568('0x23')]],'as':_0x627f48['as'],'attributes':_0x627f48['attributes'],'include':_0x627f48[_0x9568('0x22')]?_['map'](_0x627f48[_0x9568('0x22')],function(_0x548d6c){return{'model':db[_0x548d6c[_0x9568('0x23')]],'as':_0x548d6c['as'],'attributes':_0x548d6c[_0x9568('0x24')]};}):[]};}):[]};}):[]:[]})[_0x9568('0x14')](function(_0x46a667){logger[_0x9568('0x15')](_0x9568('0x26'),_0x3ab845);logger['debug'](_0x9568('0x26'),_0x3ab845,JSON[_0x9568('0x18')](_0x46a667));_0x18789c(_0x46a667);})['catch'](function(_0x1a157b){logger[_0x9568('0x19')](_0x9568('0x26'),_0x1a157b[_0x9568('0x1b')],_0x3ab845);_0x324431(_0x33496d['error'](0x1f4,_0x1a157b[_0x9568('0x1b')]));});});}; \ No newline at end of file +var _0xb8b4=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','defaults','redis','localhost','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetVoiceQueue','VoiceQueue','options','where','attributes','limit','include','map','model','ShowVoiceQueue','find','raw','catch','lodash','util'];(function(_0x32dd23,_0x531778){var _0x1f611e=function(_0xf3172a){while(--_0xf3172a){_0x32dd23['push'](_0x32dd23['shift']());}};_0x1f611e(++_0x531778);}(_0xb8b4,0x17a));var _0x4b8b=function(_0x4f9e4f,_0x540a45){_0x4f9e4f=_0x4f9e4f-0x0;var _0x5c66d5=_0xb8b4[_0x4f9e4f];return _0x5c66d5;};'use strict';var _=require(_0x4b8b('0x0'));var util=require(_0x4b8b('0x1'));var moment=require(_0x4b8b('0x2'));var BPromise=require(_0x4b8b('0x3'));var rs=require(_0x4b8b('0x4'));var fs=require('fs');var Redis=require(_0x4b8b('0x5'));var db=require(_0x4b8b('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4b8b('0x7'));var config=require(_0x4b8b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4b8b('0x9')][_0x4b8b('0xa')]({'port':0x232a});config['redis']=_[_0x4b8b('0xb')](config[_0x4b8b('0xc')],{'host':_0x4b8b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b8b('0xc')]));require(_0x4b8b('0xe'))[_0x4b8b('0xf')](socket);function respondWithRpcPromise(_0x55d708,_0x5e6580,_0x465acb){return new BPromise(function(_0x1c743d,_0x9b0f9c){return client['request'](_0x55d708,_0x465acb)[_0x4b8b('0x10')](function(_0x3c1615){logger[_0x4b8b('0x11')](_0x4b8b('0x12'),_0x5e6580,_0x4b8b('0x13'));logger[_0x4b8b('0x14')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x5e6580,_0x4b8b('0x13'),JSON[_0x4b8b('0x15')](_0x3c1615));if(_0x3c1615[_0x4b8b('0x16')]){if(_0x3c1615[_0x4b8b('0x16')][_0x4b8b('0x17')]===0x1f4){logger[_0x4b8b('0x16')](_0x4b8b('0x12'),_0x5e6580,_0x3c1615[_0x4b8b('0x16')][_0x4b8b('0x18')]);return _0x9b0f9c(_0x3c1615[_0x4b8b('0x16')][_0x4b8b('0x18')]);}logger['error'](_0x4b8b('0x12'),_0x5e6580,_0x3c1615[_0x4b8b('0x16')][_0x4b8b('0x18')]);return _0x1c743d(_0x3c1615[_0x4b8b('0x16')][_0x4b8b('0x18')]);}else{logger[_0x4b8b('0x11')](_0x4b8b('0x12'),_0x5e6580,_0x4b8b('0x13'));_0x1c743d(_0x3c1615['result'][_0x4b8b('0x18')]);}})['catch'](function(_0x164bee){logger[_0x4b8b('0x16')](_0x4b8b('0x12'),_0x5e6580,_0x164bee);_0x9b0f9c(_0x164bee);});});}exports[_0x4b8b('0x19')]=function(_0x3065d1){var _0x5bfaa7=this;return new Promise(function(_0x36df32,_0x50c9e4){return db[_0x4b8b('0x1a')]['findAll']({'raw':_0x3065d1['options']?_0x3065d1[_0x4b8b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3065d1[_0x4b8b('0x1b')]?_0x3065d1[_0x4b8b('0x1b')][_0x4b8b('0x1c')]||null:null,'attributes':_0x3065d1[_0x4b8b('0x1b')]?_0x3065d1[_0x4b8b('0x1b')][_0x4b8b('0x1d')]||null:null,'limit':_0x3065d1['options']?_0x3065d1[_0x4b8b('0x1b')][_0x4b8b('0x1e')]||null:null,'include':_0x3065d1[_0x4b8b('0x1b')]?_0x3065d1['options'][_0x4b8b('0x1f')]?_[_0x4b8b('0x20')](_0x3065d1[_0x4b8b('0x1b')][_0x4b8b('0x1f')],function(_0x5d2b66){return{'model':db[_0x5d2b66[_0x4b8b('0x21')]],'as':_0x5d2b66['as'],'attributes':_0x5d2b66['attributes'],'include':_0x5d2b66[_0x4b8b('0x1f')]?_['map'](_0x5d2b66[_0x4b8b('0x1f')],function(_0x5527e7){return{'model':db[_0x5527e7['model']],'as':_0x5527e7['as'],'attributes':_0x5527e7[_0x4b8b('0x1d')],'include':_0x5527e7[_0x4b8b('0x1f')]?_[_0x4b8b('0x20')](_0x5527e7[_0x4b8b('0x1f')],function(_0x2c50a0){return{'model':db[_0x2c50a0[_0x4b8b('0x21')]],'as':_0x2c50a0['as'],'attributes':_0x2c50a0[_0x4b8b('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cdd57){logger[_0x4b8b('0x11')](_0x4b8b('0x19'),_0x3065d1);logger['debug'](_0x4b8b('0x19'),_0x3065d1,JSON[_0x4b8b('0x15')](_0x5cdd57));_0x36df32(_0x5cdd57);})['catch'](function(_0x122cdc){logger[_0x4b8b('0x16')](_0x4b8b('0x19'),_0x122cdc[_0x4b8b('0x18')],_0x3065d1);_0x50c9e4(_0x5bfaa7[_0x4b8b('0x16')](0x1f4,_0x122cdc[_0x4b8b('0x18')]));});});};exports[_0x4b8b('0x22')]=function(_0x5e442c){var _0x2133aa=this;return new Promise(function(_0x364771,_0x45f62f){return db[_0x4b8b('0x1a')][_0x4b8b('0x23')]({'raw':_0x5e442c[_0x4b8b('0x1b')]?_0x5e442c[_0x4b8b('0x1b')][_0x4b8b('0x24')]===undefined?!![]:![]:!![],'where':_0x5e442c['options']?_0x5e442c[_0x4b8b('0x1b')][_0x4b8b('0x1c')]||null:null,'attributes':_0x5e442c[_0x4b8b('0x1b')]?_0x5e442c[_0x4b8b('0x1b')][_0x4b8b('0x1d')]||null:null,'include':_0x5e442c['options']?_0x5e442c[_0x4b8b('0x1b')]['include']?_[_0x4b8b('0x20')](_0x5e442c['options']['include'],function(_0x1f40e8){return{'model':db[_0x1f40e8[_0x4b8b('0x21')]],'as':_0x1f40e8['as'],'attributes':_0x1f40e8[_0x4b8b('0x1d')],'include':_0x1f40e8[_0x4b8b('0x1f')]?_['map'](_0x1f40e8[_0x4b8b('0x1f')],function(_0x27f172){return{'model':db[_0x27f172[_0x4b8b('0x21')]],'as':_0x27f172['as'],'attributes':_0x27f172[_0x4b8b('0x1d')],'include':_0x27f172['include']?_['map'](_0x27f172[_0x4b8b('0x1f')],function(_0x1ba738){return{'model':db[_0x1ba738[_0x4b8b('0x21')]],'as':_0x1ba738['as'],'attributes':_0x1ba738[_0x4b8b('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4486ad){logger[_0x4b8b('0x11')](_0x4b8b('0x22'),_0x5e442c);logger[_0x4b8b('0x14')](_0x4b8b('0x22'),_0x5e442c,JSON['stringify'](_0x4486ad));_0x364771(_0x4486ad);})[_0x4b8b('0x25')](function(_0x362971){logger['error'](_0x4b8b('0x22'),_0x362971['message'],_0x5e442c);_0x45f62f(_0x2133aa['error'](0x1f4,_0x362971['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index ee3624b..0f687fa 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 _0x44b9=['removeListener','register','voiceQueue:','./voiceQueue.events','save','remove','update'];(function(_0x448f3c,_0x2a9c38){var _0x7c1b88=function(_0x319efe){while(--_0x319efe){_0x448f3c['push'](_0x448f3c['shift']());}};_0x7c1b88(++_0x2a9c38);}(_0x44b9,0x1d1));var _0x944b=function(_0x12811d,_0x230f31){_0x12811d=_0x12811d-0x0;var _0x54fd14=_0x44b9[_0x12811d];return _0x54fd14;};'use strict';var VoiceQueueEvents=require(_0x944b('0x0'));var events=[_0x944b('0x1'),_0x944b('0x2'),_0x944b('0x3')];function createListener(_0x5a07fe,_0x370d44){return function(_0x1fc689){_0x370d44['emit'](_0x5a07fe,_0x1fc689);};}function removeListener(_0x10d206,_0x508236){return function(){VoiceQueueEvents[_0x944b('0x4')](_0x10d206,_0x508236);};}exports[_0x944b('0x5')]=function(_0x1974f3){for(var _0x58210c=0x0,_0xab9b46=events['length'];_0x58210c<_0xab9b46;_0x58210c++){var _0x35819f=events[_0x58210c];var _0x4225d8=createListener(_0x944b('0x6')+_0x35819f,_0x1974f3);VoiceQueueEvents['on'](_0x35819f,_0x4225d8);}}; \ No newline at end of file +var _0x46c4=['length','voiceQueue:','./voiceQueue.events','save','remove','emit','removeListener','register'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x46c4,0x1b2));var _0x446c=function(_0x24db8e,_0x5d806b){_0x24db8e=_0x24db8e-0x0;var _0x43abc6=_0x46c4[_0x24db8e];return _0x43abc6;};'use strict';var VoiceQueueEvents=require(_0x446c('0x0'));var events=[_0x446c('0x1'),_0x446c('0x2'),'update'];function createListener(_0x5b8fe8,_0x195758){return function(_0x53f86c){_0x195758[_0x446c('0x3')](_0x5b8fe8,_0x53f86c);};}function removeListener(_0x28b94e,_0xcf72c7){return function(){VoiceQueueEvents[_0x446c('0x4')](_0x28b94e,_0xcf72c7);};}exports[_0x446c('0x5')]=function(_0x5648db){for(var _0x4ae6c9=0x0,_0x5592f0=events[_0x446c('0x6')];_0x4ae6c9<_0x5592f0;_0x4ae6c9++){var _0x16d411=events[_0x4ae6c9];var _0x3c8109=createListener(_0x446c('0x7')+_0x16d411,_0x5648db);VoiceQueueEvents['on'](_0x16d411,_0x3c8109);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 3bca34b..e3bf061 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 _0xfbc2=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','/describe','describe','/index','getVoiceQueuesReport','/:id','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x55c300,_0x1ababe){var _0x4565dd=function(_0x120c72){while(--_0x120c72){_0x55c300['push'](_0x55c300['shift']());}};_0x4565dd(++_0x1ababe);}(_0xfbc2,0x103));var _0x2fbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfbc2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x2fbc('0x0'));var path=require(_0x2fbc('0x1'));var timeout=require(_0x2fbc('0x2'));var express=require(_0x2fbc('0x3'));var router=express[_0x2fbc('0x4')]();var fs_extra=require(_0x2fbc('0x5'));var auth=require(_0x2fbc('0x6'));var interaction=require(_0x2fbc('0x7'));var config=require(_0x2fbc('0x8'));var controller=require(_0x2fbc('0x9'));router['get']('/',auth[_0x2fbc('0xa')](),controller[_0x2fbc('0xb')]);router[_0x2fbc('0xc')](_0x2fbc('0xd'),auth[_0x2fbc('0xa')](),controller[_0x2fbc('0xe')]);router[_0x2fbc('0xc')](_0x2fbc('0xf'),auth[_0x2fbc('0xa')](),controller[_0x2fbc('0x10')]);router[_0x2fbc('0xc')](_0x2fbc('0x11'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x2fbc('0xa')](),controller[_0x2fbc('0x12')]);router[_0x2fbc('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x2fbc('0x14')]);router[_0x2fbc('0x15')](_0x2fbc('0x11'),auth[_0x2fbc('0xa')](),controller[_0x2fbc('0x16')]);module[_0x2fbc('0x17')]=router; \ No newline at end of file +var _0x2fe6=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','/describe','/index','getVoiceQueuesReport','/:id','show','post','create','update','exports','multer'];(function(_0x5ccae7,_0x33fb5e){var _0x4583ff=function(_0x3c1aaa){while(--_0x3c1aaa){_0x5ccae7['push'](_0x5ccae7['shift']());}};_0x4583ff(++_0x33fb5e);}(_0x2fe6,0x1cb));var _0x62fe=function(_0x22d692,_0x4e388c){_0x22d692=_0x22d692-0x0;var _0x3c15cc=_0x2fe6[_0x22d692];return _0x3c15cc;};'use strict';var multer=require(_0x62fe('0x0'));var util=require(_0x62fe('0x1'));var path=require(_0x62fe('0x2'));var timeout=require(_0x62fe('0x3'));var express=require(_0x62fe('0x4'));var router=express[_0x62fe('0x5')]();var fs_extra=require(_0x62fe('0x6'));var auth=require(_0x62fe('0x7'));var interaction=require(_0x62fe('0x8'));var config=require(_0x62fe('0x9'));var controller=require(_0x62fe('0xa'));router['get']('/',auth[_0x62fe('0xb')](),controller[_0x62fe('0xc')]);router[_0x62fe('0xd')](_0x62fe('0xe'),auth['isAuthenticated'](),controller['describe']);router[_0x62fe('0xd')](_0x62fe('0xf'),auth[_0x62fe('0xb')](),controller[_0x62fe('0x10')]);router['get'](_0x62fe('0x11'),auth[_0x62fe('0xb')](),controller[_0x62fe('0x12')]);router[_0x62fe('0x13')]('/',auth[_0x62fe('0xb')](),controller[_0x62fe('0x14')]);router['put'](_0x62fe('0x11'),auth['isAuthenticated'](),controller[_0x62fe('0x15')]);router['delete'](_0x62fe('0x11'),auth[_0x62fe('0xb')](),controller['destroy']);module[_0x62fe('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 226f28b..81d564b 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 _0xfb9e=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER'];(function(_0x11e4cc,_0x330f3f){var _0x58bfa1=function(_0x172e9f){while(--_0x172e9f){_0x11e4cc['push'](_0x11e4cc['shift']());}};_0x58bfa1(++_0x330f3f);}(_0xfb9e,0xa8));var _0xefb9=function(_0x4ede04,_0x58132b){_0x4ede04=_0x4ede04-0x0;var _0x49ccfc=_0xfb9e[_0x4ede04];return _0x49ccfc;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xefb9('0x0'));module[_0xefb9('0x1')]={'type':{'type':Sequelize[_0xefb9('0x2')]},'uniqueid':{'type':Sequelize[_0xefb9('0x2')]},'calleridnum':{'type':Sequelize[_0xefb9('0x2')]},'calleridname':{'type':Sequelize[_0xefb9('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xefb9('0x3')],'set':function(_0x156d98){var _0x1d600f=moment(_0x156d98);var _0x3f9db4=moment(this['getDataValue'](_0xefb9('0x4')))[_0xefb9('0x5')](_0xefb9('0x6'));var _0xfc0f6c=_0x1d600f['diff'](_0x3f9db4,_0xefb9('0x7'));this[_0xefb9('0x8')](_0xefb9('0x9'),_0x156d98);this[_0xefb9('0x8')](_0xefb9('0xa'),_0xfc0f6c||null);}},'position':{'type':Sequelize[_0xefb9('0xb')]},'count':{'type':Sequelize[_0xefb9('0xb')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xefb9('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xefb9('0x3')]},'queuecallerexit':{'type':Sequelize[_0xefb9('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xefb9('0x2')],'comment':_0xefb9('0xd')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xefb9('0x2')]},'connectedlinenum':{'type':Sequelize[_0xefb9('0x2')]},'connectedlinename':{'type':Sequelize[_0xefb9('0x2')]},'accountcode':{'type':Sequelize[_0xefb9('0x2')]},'context':{'type':Sequelize[_0xefb9('0x2')]},'exten':{'type':Sequelize[_0xefb9('0x2')]},'priority':{'type':Sequelize[_0xefb9('0x2')]},'holdtime':{'type':Sequelize[_0xefb9('0xb')]},'mohtime':{'type':Sequelize[_0xefb9('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xefb9('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xefb9('0x2')]},'transfer':{'type':Sequelize[_0xefb9('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xefb9('0x2')],'comment':_0xefb9('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xefb9('0x2')]},'disposition':{'type':Sequelize[_0xefb9('0x2')]},'secondDisposition':{'type':Sequelize[_0xefb9('0x2')]},'thirdDisposition':{'type':Sequelize[_0xefb9('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6f1c=['queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue'];(function(_0x12dfac,_0x1b7456){var _0x2df79f=function(_0x28b253){while(--_0x28b253){_0x12dfac['push'](_0x12dfac['shift']());}};_0x2df79f(++_0x1b7456);}(_0x6f1c,0x1d6));var _0xc6f1=function(_0x669e58,_0x68ffdf){_0x669e58=_0x669e58-0x0;var _0x3f0834=_0x6f1c[_0x669e58];return _0x3f0834;};'use strict';var Sequelize=require(_0xc6f1('0x0'));var moment=require(_0xc6f1('0x1'));module[_0xc6f1('0x2')]={'type':{'type':Sequelize[_0xc6f1('0x3')]},'uniqueid':{'type':Sequelize[_0xc6f1('0x3')]},'calleridnum':{'type':Sequelize[_0xc6f1('0x3')]},'calleridname':{'type':Sequelize[_0xc6f1('0x3')]},'queue':{'type':Sequelize[_0xc6f1('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xc6f1('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xc6f1('0x4')],'set':function(_0x335341){var _0x570f8a=moment(_0x335341);var _0x315874=moment(this['getDataValue'](_0xc6f1('0x5')))[_0xc6f1('0x6')](_0xc6f1('0x7'));var _0x52f1c0=_0x570f8a[_0xc6f1('0x8')](_0x315874,'seconds');this[_0xc6f1('0x9')](_0xc6f1('0xa'),_0x335341);this['setDataValue'](_0xc6f1('0xb'),_0x52f1c0||null);}},'position':{'type':Sequelize[_0xc6f1('0xc')]},'count':{'type':Sequelize[_0xc6f1('0xc')]},'queuecallerabandon':{'type':Sequelize[_0xc6f1('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xc6f1('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xc6f1('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xc6f1('0x4')]},'queuecallerexit':{'type':Sequelize[_0xc6f1('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xc6f1('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xc6f1('0x3')],'comment':_0xc6f1('0xe')},'originalposition':{'type':Sequelize[_0xc6f1('0xc')]},'channel':{'type':Sequelize[_0xc6f1('0x3')]},'connectedlinenum':{'type':Sequelize[_0xc6f1('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xc6f1('0x3')]},'context':{'type':Sequelize[_0xc6f1('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xc6f1('0xc')]},'mohtime':{'type':Sequelize[_0xc6f1('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xc6f1('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xc6f1('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xc6f1('0x3')]},'disposition':{'type':Sequelize[_0xc6f1('0x3')]},'secondDisposition':{'type':Sequelize[_0xc6f1('0x3')]},'thirdDisposition':{'type':Sequelize[_0xc6f1('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xc6f1('0xc')],'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 af874f8..67a57dd 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 _0xbbd9=['reject','save','then','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','where','merge','options','includeAll','include','VoiceQueueReport','rows','catch','show','params','fields','find','body','update','describe','getVoiceQueuesReport','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./voiceQueueReport.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply'];(function(_0x2c6bd4,_0x65e765){var _0x4d96fa=function(_0x3c05eb){while(--_0x3c05eb){_0x2c6bd4['push'](_0x2c6bd4['shift']());}};_0x4d96fa(++_0x65e765);}(_0xbbd9,0x16f));var _0x9bbd=function(_0x5f035f,_0x5300d1){_0x5f035f=_0x5f035f-0x0;var _0xad281e=_0xbbd9[_0x5f035f];return _0xad281e;};'use strict';var emlformat=require(_0x9bbd('0x0'));var rimraf=require(_0x9bbd('0x1'));var zipdir=require(_0x9bbd('0x2'));var jsonpatch=require(_0x9bbd('0x3'));var rp=require(_0x9bbd('0x4'));var moment=require(_0x9bbd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9bbd('0x6'));var util=require(_0x9bbd('0x7'));var path=require(_0x9bbd('0x8'));var sox=require(_0x9bbd('0x9'));var csv=require(_0x9bbd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9bbd('0xb'));var _=require(_0x9bbd('0xc'));var squel=require('squel');var crypto=require(_0x9bbd('0xd'));var jsforce=require(_0x9bbd('0xe'));var deskjs=require(_0x9bbd('0xf'));var toCsv=require(_0x9bbd('0xa'));var querystring=require('querystring');var Papa=require(_0x9bbd('0x10'));var Redis=require(_0x9bbd('0x11'));var authService=require(_0x9bbd('0x12'));var qs=require(_0x9bbd('0x13'));var as=require(_0x9bbd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9bbd('0x15'))(_0x9bbd('0x16'));var utils=require(_0x9bbd('0x17'));var config=require(_0x9bbd('0x18'));var licenseUtil=require(_0x9bbd('0x19'));var db=require(_0x9bbd('0x1a'))['db'];config['redis']=_[_0x9bbd('0x1b')](config[_0x9bbd('0x1c')],{'host':_0x9bbd('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9bbd('0x1c')]));require(_0x9bbd('0x1e'))[_0x9bbd('0x1f')](socket);function respondWithStatusCode(_0x238753,_0x10d8b6){_0x10d8b6=_0x10d8b6||0xcc;return function(_0x17f0a8){if(_0x17f0a8){return _0x238753[_0x9bbd('0x20')](_0x10d8b6);}return _0x238753['status'](_0x10d8b6)[_0x9bbd('0x21')]();};}function respondWithResult(_0x437c51,_0x434daf){_0x434daf=_0x434daf||0xc8;return function(_0x2bed9d){if(_0x2bed9d){return _0x437c51['status'](_0x434daf)[_0x9bbd('0x22')](_0x2bed9d);}};}function respondWithFilteredResult(_0x3ac2ce,_0x3e905f){return function(_0x200123){if(_0x200123){var _0x29b8ed=typeof _0x3e905f[_0x9bbd('0x23')]===_0x9bbd('0x24')&&typeof _0x3e905f[_0x9bbd('0x25')]===_0x9bbd('0x24');var _0xd3f422=_0x200123[_0x9bbd('0x26')];var _0x25a727=_0x29b8ed?0x0:_0x3e905f[_0x9bbd('0x23')];var _0x4fb45d=_0x29b8ed?_0x200123['count']:_0x3e905f[_0x9bbd('0x23')]+_0x3e905f[_0x9bbd('0x25')];var _0x3e19b5;if(_0x4fb45d>=_0xd3f422){_0x4fb45d=_0xd3f422;_0x3e19b5=0xc8;}else{_0x3e19b5=0xce;}_0x3ac2ce[_0x9bbd('0x27')](_0x3e19b5);return _0x3ac2ce[_0x9bbd('0x28')](_0x9bbd('0x29'),_0x25a727+'-'+_0x4fb45d+'/'+_0xd3f422)[_0x9bbd('0x22')](_0x200123);}return null;};}function patchUpdates(_0x1590bc){return function(_0x2421b0){try{jsonpatch[_0x9bbd('0x2a')](_0x2421b0,_0x1590bc,!![]);}catch(_0x112a82){return BPromise[_0x9bbd('0x2b')](_0x112a82);}return _0x2421b0[_0x9bbd('0x2c')]();};}function saveUpdates(_0x198ea4,_0x3c9dc8){return function(_0x8e085a){if(_0x8e085a){return _0x8e085a['update'](_0x198ea4)[_0x9bbd('0x2d')](function(_0x514cc3){return _0x514cc3;});}return null;};}function removeEntity(_0x352a03,_0x354c21){return function(_0x475ccb){if(_0x475ccb){return _0x475ccb['destroy']()['then'](function(){_0x352a03[_0x9bbd('0x27')](0xcc)[_0x9bbd('0x21')]();});}};}function handleEntityNotFound(_0x2554fc,_0x5bfedb){return function(_0x53a8da){if(!_0x53a8da){_0x2554fc['sendStatus'](0x194);}return _0x53a8da;};}function handleError(_0x362bda,_0x3ee496){_0x3ee496=_0x3ee496||0x1f4;return function(_0xd206cd){logger[_0x9bbd('0x2e')](_0xd206cd[_0x9bbd('0x2f')]);if(_0xd206cd[_0x9bbd('0x30')]){delete _0xd206cd['name'];}_0x362bda[_0x9bbd('0x27')](_0x3ee496)[_0x9bbd('0x31')](_0xd206cd);};}exports[_0x9bbd('0x32')]=function(_0x6fcdab,_0x44e274){var _0x5d4513={},_0x4304e3={},_0x25a7b1={'count':0x0,'rows':[]};var _0x4d7acb=_[_0x9bbd('0x33')](db['VoiceQueueReport'][_0x9bbd('0x34')],function(_0x5f571b){return{'name':_0x5f571b['fieldName'],'type':_0x5f571b[_0x9bbd('0x35')]['key']};});_0x4304e3[_0x9bbd('0x36')]=_['map'](_0x4d7acb,'name');_0x4304e3[_0x9bbd('0x37')]=_[_0x9bbd('0x38')](_0x6fcdab[_0x9bbd('0x37')]);_0x4304e3[_0x9bbd('0x39')]=_[_0x9bbd('0x3a')](_0x4304e3[_0x9bbd('0x36')],_0x4304e3['query']);_0x5d4513[_0x9bbd('0x3b')]=_[_0x9bbd('0x3a')](_0x4304e3[_0x9bbd('0x36')],qs['fields'](_0x6fcdab[_0x9bbd('0x37')]['fields']));_0x5d4513[_0x9bbd('0x3b')]=_0x5d4513['attributes'][_0x9bbd('0x3c')]?_0x5d4513['attributes']:_0x4304e3[_0x9bbd('0x36')];if(!_0x6fcdab[_0x9bbd('0x37')][_0x9bbd('0x3d')]('nolimit')){_0x5d4513[_0x9bbd('0x25')]=qs[_0x9bbd('0x25')](_0x6fcdab['query'][_0x9bbd('0x25')]);_0x5d4513['offset']=qs[_0x9bbd('0x23')](_0x6fcdab[_0x9bbd('0x37')][_0x9bbd('0x23')]);}_0x5d4513[_0x9bbd('0x3e')]=qs[_0x9bbd('0x3f')](_0x6fcdab['query'][_0x9bbd('0x3f')]);_0x5d4513['where']=qs[_0x9bbd('0x39')](_[_0x9bbd('0x40')](_0x6fcdab[_0x9bbd('0x37')],_0x4304e3['filters']),_0x4d7acb);if(_0x6fcdab[_0x9bbd('0x37')]['filter']){_0x5d4513[_0x9bbd('0x41')]=_[_0x9bbd('0x42')](_0x5d4513[_0x9bbd('0x41')],{'$or':_[_0x9bbd('0x33')](_0x4d7acb,function(_0x1cf400){if(_0x1cf400[_0x9bbd('0x35')]!=='VIRTUAL'){var _0xdb0e52={};_0xdb0e52[_0x1cf400[_0x9bbd('0x30')]]={'$like':'%'+_0x6fcdab['query']['filter']+'%'};return _0xdb0e52;}})});}_0x5d4513=_['merge']({},_0x5d4513,_0x6fcdab[_0x9bbd('0x43')]);var _0x345f68={'where':_0x5d4513[_0x9bbd('0x41')]};return db['VoiceQueueReport'][_0x9bbd('0x26')](_0x345f68)['then'](function(_0x3e90bb){_0x25a7b1[_0x9bbd('0x26')]=_0x3e90bb;if(_0x6fcdab['query'][_0x9bbd('0x44')]){_0x5d4513[_0x9bbd('0x45')]=[{'all':!![]}];}return db[_0x9bbd('0x46')]['findAll'](_0x5d4513);})[_0x9bbd('0x2d')](function(_0x460b1c){_0x25a7b1[_0x9bbd('0x47')]=_0x460b1c;return _0x25a7b1;})[_0x9bbd('0x2d')](respondWithFilteredResult(_0x44e274,_0x5d4513))[_0x9bbd('0x48')](handleError(_0x44e274,null));};exports[_0x9bbd('0x49')]=function(_0x1693d5,_0x33b6b6){var _0x23c1c8={'raw':![],'where':{'id':_0x1693d5[_0x9bbd('0x4a')]['id']}},_0xde1eda={};_0xde1eda[_0x9bbd('0x36')]=_['keys'](db['VoiceQueueReport'][_0x9bbd('0x34')]);_0xde1eda[_0x9bbd('0x37')]=_[_0x9bbd('0x38')](_0x1693d5[_0x9bbd('0x37')]);_0xde1eda['filters']=_[_0x9bbd('0x3a')](_0xde1eda[_0x9bbd('0x36')],_0xde1eda[_0x9bbd('0x37')]);_0x23c1c8['attributes']=_[_0x9bbd('0x3a')](_0xde1eda[_0x9bbd('0x36')],qs['fields'](_0x1693d5[_0x9bbd('0x37')][_0x9bbd('0x4b')]));_0x23c1c8[_0x9bbd('0x3b')]=_0x23c1c8[_0x9bbd('0x3b')][_0x9bbd('0x3c')]?_0x23c1c8[_0x9bbd('0x3b')]:_0xde1eda[_0x9bbd('0x36')];if(_0x1693d5[_0x9bbd('0x37')]['includeAll']){_0x23c1c8[_0x9bbd('0x45')]=[{'all':!![]}];}_0x23c1c8=_[_0x9bbd('0x42')]({},_0x23c1c8,_0x1693d5[_0x9bbd('0x43')]);return db['VoiceQueueReport'][_0x9bbd('0x4c')](_0x23c1c8)[_0x9bbd('0x2d')](handleEntityNotFound(_0x33b6b6,null))[_0x9bbd('0x2d')](respondWithResult(_0x33b6b6,null))[_0x9bbd('0x48')](handleError(_0x33b6b6,null));};exports['create']=function(_0x26561c,_0x335361){return db[_0x9bbd('0x46')]['create'](_0x26561c[_0x9bbd('0x4d')],{})['then'](respondWithResult(_0x335361,0xc9))[_0x9bbd('0x48')](handleError(_0x335361,null));};exports[_0x9bbd('0x4e')]=function(_0x27b66c,_0x331ff3){if(_0x27b66c[_0x9bbd('0x4d')]['id']){delete _0x27b66c[_0x9bbd('0x4d')]['id'];}return db[_0x9bbd('0x46')]['find']({'where':{'id':_0x27b66c[_0x9bbd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x331ff3,null))[_0x9bbd('0x2d')](saveUpdates(_0x27b66c[_0x9bbd('0x4d')],null))[_0x9bbd('0x2d')](respondWithResult(_0x331ff3,null))[_0x9bbd('0x48')](handleError(_0x331ff3,null));};exports['destroy']=function(_0x190ae9,_0x6f6f82){return db[_0x9bbd('0x46')]['find']({'where':{'id':_0x190ae9['params']['id']}})[_0x9bbd('0x2d')](handleEntityNotFound(_0x6f6f82,null))[_0x9bbd('0x2d')](removeEntity(_0x6f6f82,null))[_0x9bbd('0x48')](handleError(_0x6f6f82,null));};exports[_0x9bbd('0x4f')]=function(_0x19a0ff,_0x315c9c){return db[_0x9bbd('0x46')][_0x9bbd('0x4f')]()[_0x9bbd('0x2d')](respondWithResult(_0x315c9c,null))[_0x9bbd('0x48')](handleError(_0x315c9c,null));};exports[_0x9bbd('0x50')]=function(_0x14fa87,_0x1bdf08){var _0x4e1ef7={},_0x1edc5b={},_0x41a317={'count':0x0,'rows':[]};_0x1edc5b[_0x9bbd('0x36')]=_['keys'](db['VoiceQueueReport'][_0x9bbd('0x34')]);_0x1edc5b[_0x9bbd('0x37')]=_[_0x9bbd('0x38')](_0x14fa87[_0x9bbd('0x37')]);_0x1edc5b[_0x9bbd('0x39')]=_[_0x9bbd('0x3a')](_0x1edc5b[_0x9bbd('0x36')],_0x1edc5b[_0x9bbd('0x37')]);_0x4e1ef7[_0x9bbd('0x3b')]=_[_0x9bbd('0x3a')](_0x1edc5b[_0x9bbd('0x36')],qs['fields'](_0x14fa87[_0x9bbd('0x37')][_0x9bbd('0x4b')]));_0x4e1ef7[_0x9bbd('0x3b')]=_0x4e1ef7['attributes'][_0x9bbd('0x3c')]?_0x4e1ef7[_0x9bbd('0x3b')]:_0x1edc5b[_0x9bbd('0x36')];if(!_0x14fa87['query'][_0x9bbd('0x3d')]('nolimit')){_0x4e1ef7[_0x9bbd('0x25')]=qs[_0x9bbd('0x25')](_0x14fa87[_0x9bbd('0x37')][_0x9bbd('0x25')]);_0x4e1ef7[_0x9bbd('0x23')]=qs[_0x9bbd('0x23')](_0x14fa87['query']['offset']);}_0x4e1ef7[_0x9bbd('0x3e')]=qs[_0x9bbd('0x3f')](_0x14fa87[_0x9bbd('0x37')][_0x9bbd('0x3f')]);_0x4e1ef7[_0x9bbd('0x41')]=qs[_0x9bbd('0x39')](_['pick'](_0x14fa87['query'],_0x1edc5b[_0x9bbd('0x39')]));if(_0x14fa87[_0x9bbd('0x37')]['filter']){_0x4e1ef7['where']=_[_0x9bbd('0x42')](_0x4e1ef7[_0x9bbd('0x41')],{'$or':_[_0x9bbd('0x33')](_0x4e1ef7[_0x9bbd('0x3b')],function(_0x22aa95){var _0x10c68f={};_0x10c68f[_0x22aa95]={'$like':'%'+_0x14fa87[_0x9bbd('0x37')][_0x9bbd('0x51')]+'%'};return _0x10c68f;})});}_0x4e1ef7=_[_0x9bbd('0x42')]({},_0x4e1ef7,_0x14fa87[_0x9bbd('0x43')]);var _0x4bb9c3={'where':_0x4e1ef7[_0x9bbd('0x41')]};return db[_0x9bbd('0x46')][_0x9bbd('0x26')](_0x4bb9c3)['then'](function(_0x33ef18){_0x41a317[_0x9bbd('0x26')]=_0x33ef18;if(_0x14fa87[_0x9bbd('0x37')][_0x9bbd('0x44')]){_0x4e1ef7[_0x9bbd('0x45')]=[{'all':!![]}];}return db[_0x9bbd('0x46')]['findAll'](_0x4e1ef7);})[_0x9bbd('0x2d')](function(_0x187242){_0x41a317[_0x9bbd('0x47')]=_0x187242;return _0x41a317;})[_0x9bbd('0x2d')](respondWithFilteredResult(_0x1bdf08,_0x4e1ef7,_0x9bbd('0x50')))['catch'](handleError(_0x1bdf08,null,_0x9bbd('0x50')));}; \ No newline at end of file +var _0xbfea=['lodash','crypto','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','redis','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','count','set','apply','save','update','then','error','stack','send','VoiceQueueReport','rawAttributes','fieldName','type','model','map','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','name','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','describe','getVoiceQueuesReport','sort','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x4d2f00,_0x4e94d5){var _0x2d7b7f=function(_0x18fa08){while(--_0x18fa08){_0x4d2f00['push'](_0x4d2f00['shift']());}};_0x2d7b7f(++_0x4e94d5);}(_0xbfea,0x193));var _0xabfe=function(_0xcc185b,_0x2c4d73){_0xcc185b=_0xcc185b-0x0;var _0x4168ff=_0xbfea[_0xcc185b];return _0x4168ff;};'use strict';var emlformat=require(_0xabfe('0x0'));var rimraf=require(_0xabfe('0x1'));var zipdir=require(_0xabfe('0x2'));var jsonpatch=require(_0xabfe('0x3'));var rp=require('request-promise');var moment=require(_0xabfe('0x4'));var BPromise=require(_0xabfe('0x5'));var Mustache=require(_0xabfe('0x6'));var util=require(_0xabfe('0x7'));var path=require(_0xabfe('0x8'));var sox=require('sox');var csv=require(_0xabfe('0x9'));var ejs=require(_0xabfe('0xa'));var fs=require('fs');var fs_extra=require(_0xabfe('0xb'));var _=require(_0xabfe('0xc'));var squel=require('squel');var crypto=require(_0xabfe('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xabfe('0xe'));var toCsv=require(_0xabfe('0x9'));var querystring=require(_0xabfe('0xf'));var Papa=require(_0xabfe('0x10'));var Redis=require(_0xabfe('0x11'));var authService=require(_0xabfe('0x12'));var qs=require(_0xabfe('0x13'));var as=require(_0xabfe('0x14'));var hardwareService=require(_0xabfe('0x15'));var logger=require(_0xabfe('0x16'))(_0xabfe('0x17'));var utils=require(_0xabfe('0x18'));var config=require(_0xabfe('0x19'));var licenseUtil=require(_0xabfe('0x1a'));var db=require(_0xabfe('0x1b'))['db'];config[_0xabfe('0x1c')]=_['defaults'](config[_0xabfe('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xabfe('0x1c')]));require(_0xabfe('0x1d'))[_0xabfe('0x1e')](socket);function respondWithStatusCode(_0x106c70,_0x3abf79){_0x3abf79=_0x3abf79||0xcc;return function(_0xcccc73){if(_0xcccc73){return _0x106c70[_0xabfe('0x1f')](_0x3abf79);}return _0x106c70[_0xabfe('0x20')](_0x3abf79)[_0xabfe('0x21')]();};}function respondWithResult(_0xf2a4c2,_0x5e2de6){_0x5e2de6=_0x5e2de6||0xc8;return function(_0x112fbc){if(_0x112fbc){return _0xf2a4c2[_0xabfe('0x20')](_0x5e2de6)[_0xabfe('0x22')](_0x112fbc);}};}function respondWithFilteredResult(_0x50a33c,_0x1d2268){return function(_0x57b488){if(_0x57b488){var _0x53fa6c=typeof _0x1d2268[_0xabfe('0x23')]==='undefined'&&typeof _0x1d2268[_0xabfe('0x24')]==='undefined';var _0x56df82=_0x57b488[_0xabfe('0x25')];var _0xcec8c5=_0x53fa6c?0x0:_0x1d2268['offset'];var _0x52db01=_0x53fa6c?_0x57b488['count']:_0x1d2268[_0xabfe('0x23')]+_0x1d2268[_0xabfe('0x24')];var _0x4f1418;if(_0x52db01>=_0x56df82){_0x52db01=_0x56df82;_0x4f1418=0xc8;}else{_0x4f1418=0xce;}_0x50a33c[_0xabfe('0x20')](_0x4f1418);return _0x50a33c[_0xabfe('0x26')]('Content-Range',_0xcec8c5+'-'+_0x52db01+'/'+_0x56df82)[_0xabfe('0x22')](_0x57b488);}return null;};}function patchUpdates(_0x1c7d74){return function(_0x45f700){try{jsonpatch[_0xabfe('0x27')](_0x45f700,_0x1c7d74,!![]);}catch(_0x12d4e9){return BPromise['reject'](_0x12d4e9);}return _0x45f700[_0xabfe('0x28')]();};}function saveUpdates(_0x35e724,_0x1864f1){return function(_0x1ceefc){if(_0x1ceefc){return _0x1ceefc[_0xabfe('0x29')](_0x35e724)[_0xabfe('0x2a')](function(_0x118416){return _0x118416;});}return null;};}function removeEntity(_0x184f89,_0x372563){return function(_0x3d3b36){if(_0x3d3b36){return _0x3d3b36['destroy']()[_0xabfe('0x2a')](function(){_0x184f89[_0xabfe('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a5ba3,_0x5dd2df){return function(_0x577d09){if(!_0x577d09){_0x3a5ba3[_0xabfe('0x1f')](0x194);}return _0x577d09;};}function handleError(_0x6ce2ef,_0x532db5){_0x532db5=_0x532db5||0x1f4;return function(_0x986844){logger[_0xabfe('0x2b')](_0x986844[_0xabfe('0x2c')]);if(_0x986844['name']){delete _0x986844['name'];}_0x6ce2ef['status'](_0x532db5)[_0xabfe('0x2d')](_0x986844);};}exports['index']=function(_0x5a746e,_0x194635){var _0x31b8c7={},_0x492d3d={},_0x4eb5bf={'count':0x0,'rows':[]};var _0x5af1d6=_['map'](db[_0xabfe('0x2e')][_0xabfe('0x2f')],function(_0x205c42){return{'name':_0x205c42[_0xabfe('0x30')],'type':_0x205c42[_0xabfe('0x31')]['key']};});_0x492d3d[_0xabfe('0x32')]=_[_0xabfe('0x33')](_0x5af1d6,'name');_0x492d3d['query']=_[_0xabfe('0x34')](_0x5a746e[_0xabfe('0x35')]);_0x492d3d['filters']=_['intersection'](_0x492d3d[_0xabfe('0x32')],_0x492d3d[_0xabfe('0x35')]);_0x31b8c7[_0xabfe('0x36')]=_[_0xabfe('0x37')](_0x492d3d[_0xabfe('0x32')],qs[_0xabfe('0x38')](_0x5a746e[_0xabfe('0x35')][_0xabfe('0x38')]));_0x31b8c7[_0xabfe('0x36')]=_0x31b8c7['attributes']['length']?_0x31b8c7['attributes']:_0x492d3d[_0xabfe('0x32')];if(!_0x5a746e['query'][_0xabfe('0x39')](_0xabfe('0x3a'))){_0x31b8c7[_0xabfe('0x24')]=qs['limit'](_0x5a746e['query'][_0xabfe('0x24')]);_0x31b8c7[_0xabfe('0x23')]=qs[_0xabfe('0x23')](_0x5a746e[_0xabfe('0x35')][_0xabfe('0x23')]);}_0x31b8c7[_0xabfe('0x3b')]=qs['sort'](_0x5a746e[_0xabfe('0x35')]['sort']);_0x31b8c7[_0xabfe('0x3c')]=qs[_0xabfe('0x3d')](_[_0xabfe('0x3e')](_0x5a746e[_0xabfe('0x35')],_0x492d3d[_0xabfe('0x3d')]),_0x5af1d6);if(_0x5a746e[_0xabfe('0x35')]['filter']){_0x31b8c7[_0xabfe('0x3c')]=_[_0xabfe('0x3f')](_0x31b8c7[_0xabfe('0x3c')],{'$or':_[_0xabfe('0x33')](_0x5af1d6,function(_0x4f3179){if(_0x4f3179['type']!==_0xabfe('0x40')){var _0x38578f={};_0x38578f[_0x4f3179[_0xabfe('0x41')]]={'$like':'%'+_0x5a746e[_0xabfe('0x35')][_0xabfe('0x42')]+'%'};return _0x38578f;}})});}_0x31b8c7=_[_0xabfe('0x3f')]({},_0x31b8c7,_0x5a746e[_0xabfe('0x43')]);var _0x560b1b={'where':_0x31b8c7[_0xabfe('0x3c')]};return db[_0xabfe('0x2e')][_0xabfe('0x25')](_0x560b1b)[_0xabfe('0x2a')](function(_0x301d47){_0x4eb5bf[_0xabfe('0x25')]=_0x301d47;if(_0x5a746e[_0xabfe('0x35')][_0xabfe('0x44')]){_0x31b8c7[_0xabfe('0x45')]=[{'all':!![]}];}return db[_0xabfe('0x2e')][_0xabfe('0x46')](_0x31b8c7);})[_0xabfe('0x2a')](function(_0x4c9176){_0x4eb5bf[_0xabfe('0x47')]=_0x4c9176;return _0x4eb5bf;})[_0xabfe('0x2a')](respondWithFilteredResult(_0x194635,_0x31b8c7))[_0xabfe('0x48')](handleError(_0x194635,null));};exports[_0xabfe('0x49')]=function(_0x1875b2,_0x5b570d){var _0x11cb34={'raw':![],'where':{'id':_0x1875b2[_0xabfe('0x4a')]['id']}},_0x190935={};_0x190935[_0xabfe('0x32')]=_[_0xabfe('0x34')](db['VoiceQueueReport'][_0xabfe('0x2f')]);_0x190935['query']=_[_0xabfe('0x34')](_0x1875b2[_0xabfe('0x35')]);_0x190935[_0xabfe('0x3d')]=_['intersection'](_0x190935[_0xabfe('0x32')],_0x190935[_0xabfe('0x35')]);_0x11cb34['attributes']=_[_0xabfe('0x37')](_0x190935[_0xabfe('0x32')],qs[_0xabfe('0x38')](_0x1875b2[_0xabfe('0x35')][_0xabfe('0x38')]));_0x11cb34[_0xabfe('0x36')]=_0x11cb34[_0xabfe('0x36')][_0xabfe('0x4b')]?_0x11cb34[_0xabfe('0x36')]:_0x190935[_0xabfe('0x32')];if(_0x1875b2[_0xabfe('0x35')][_0xabfe('0x44')]){_0x11cb34['include']=[{'all':!![]}];}_0x11cb34=_[_0xabfe('0x3f')]({},_0x11cb34,_0x1875b2[_0xabfe('0x43')]);return db['VoiceQueueReport'][_0xabfe('0x4c')](_0x11cb34)[_0xabfe('0x2a')](handleEntityNotFound(_0x5b570d,null))[_0xabfe('0x2a')](respondWithResult(_0x5b570d,null))[_0xabfe('0x48')](handleError(_0x5b570d,null));};exports[_0xabfe('0x4d')]=function(_0x5f35c8,_0xe912ef){return db['VoiceQueueReport'][_0xabfe('0x4d')](_0x5f35c8[_0xabfe('0x4e')],{})['then'](respondWithResult(_0xe912ef,0xc9))[_0xabfe('0x48')](handleError(_0xe912ef,null));};exports[_0xabfe('0x29')]=function(_0x10c49a,_0x2015ff){if(_0x10c49a['body']['id']){delete _0x10c49a['body']['id'];}return db[_0xabfe('0x2e')]['find']({'where':{'id':_0x10c49a[_0xabfe('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2015ff,null))['then'](saveUpdates(_0x10c49a[_0xabfe('0x4e')],null))[_0xabfe('0x2a')](respondWithResult(_0x2015ff,null))[_0xabfe('0x48')](handleError(_0x2015ff,null));};exports[_0xabfe('0x4f')]=function(_0x10b0b9,_0x3b3cfd){return db[_0xabfe('0x2e')][_0xabfe('0x4c')]({'where':{'id':_0x10b0b9['params']['id']}})[_0xabfe('0x2a')](handleEntityNotFound(_0x3b3cfd,null))['then'](removeEntity(_0x3b3cfd,null))[_0xabfe('0x48')](handleError(_0x3b3cfd,null));};exports[_0xabfe('0x50')]=function(_0x3012ea,_0x22a5e8){return db[_0xabfe('0x2e')][_0xabfe('0x50')]()[_0xabfe('0x2a')](respondWithResult(_0x22a5e8,null))[_0xabfe('0x48')](handleError(_0x22a5e8,null));};exports[_0xabfe('0x51')]=function(_0x20219a,_0x36e614){var _0x205a9d={},_0x3d2ee1={},_0x16f97a={'count':0x0,'rows':[]};_0x3d2ee1[_0xabfe('0x32')]=_[_0xabfe('0x34')](db['VoiceQueueReport']['rawAttributes']);_0x3d2ee1[_0xabfe('0x35')]=_[_0xabfe('0x34')](_0x20219a[_0xabfe('0x35')]);_0x3d2ee1[_0xabfe('0x3d')]=_['intersection'](_0x3d2ee1[_0xabfe('0x32')],_0x3d2ee1[_0xabfe('0x35')]);_0x205a9d[_0xabfe('0x36')]=_[_0xabfe('0x37')](_0x3d2ee1[_0xabfe('0x32')],qs[_0xabfe('0x38')](_0x20219a[_0xabfe('0x35')]['fields']));_0x205a9d['attributes']=_0x205a9d[_0xabfe('0x36')]['length']?_0x205a9d[_0xabfe('0x36')]:_0x3d2ee1['model'];if(!_0x20219a[_0xabfe('0x35')][_0xabfe('0x39')](_0xabfe('0x3a'))){_0x205a9d[_0xabfe('0x24')]=qs['limit'](_0x20219a[_0xabfe('0x35')]['limit']);_0x205a9d[_0xabfe('0x23')]=qs[_0xabfe('0x23')](_0x20219a[_0xabfe('0x35')][_0xabfe('0x23')]);}_0x205a9d[_0xabfe('0x3b')]=qs[_0xabfe('0x52')](_0x20219a[_0xabfe('0x35')][_0xabfe('0x52')]);_0x205a9d[_0xabfe('0x3c')]=qs[_0xabfe('0x3d')](_[_0xabfe('0x3e')](_0x20219a[_0xabfe('0x35')],_0x3d2ee1[_0xabfe('0x3d')]));if(_0x20219a[_0xabfe('0x35')][_0xabfe('0x42')]){_0x205a9d['where']=_[_0xabfe('0x3f')](_0x205a9d[_0xabfe('0x3c')],{'$or':_[_0xabfe('0x33')](_0x205a9d[_0xabfe('0x36')],function(_0x257e59){var _0x28ca56={};_0x28ca56[_0x257e59]={'$like':'%'+_0x20219a[_0xabfe('0x35')][_0xabfe('0x42')]+'%'};return _0x28ca56;})});}_0x205a9d=_[_0xabfe('0x3f')]({},_0x205a9d,_0x20219a[_0xabfe('0x43')]);var _0x513775={'where':_0x205a9d[_0xabfe('0x3c')]};return db[_0xabfe('0x2e')][_0xabfe('0x25')](_0x513775)['then'](function(_0x52eebd){_0x16f97a['count']=_0x52eebd;if(_0x20219a[_0xabfe('0x35')][_0xabfe('0x44')]){_0x205a9d['include']=[{'all':!![]}];}return db[_0xabfe('0x2e')]['findAll'](_0x205a9d);})[_0xabfe('0x2a')](function(_0x508fc9){_0x16f97a[_0xabfe('0x47')]=_0x508fc9;return _0x16f97a;})[_0xabfe('0x2a')](respondWithFilteredResult(_0x36e614,_0x205a9d,_0xabfe('0x51')))[_0xabfe('0x48')](handleError(_0x36e614,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index e51f39a..aadeb6b 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 _0xa038=['VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x22a8a8,_0x4b9068){var _0x43152f=function(_0x376225){while(--_0x376225){_0x22a8a8['push'](_0x22a8a8['shift']());}};_0x43152f(++_0x4b9068);}(_0xa038,0xe5));var _0x8a03=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xa038[_0x346737];return _0x1ade2e;};'use strict';var EventEmitter=require(_0x8a03('0x0'));var VoiceQueueReport=require(_0x8a03('0x1'))['db'][_0x8a03('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x8a03('0x3')](0x0);var events={'afterCreate':_0x8a03('0x4'),'afterUpdate':_0x8a03('0x5'),'afterDestroy':_0x8a03('0x6')};function emitEvent(_0x1cd61c){return function(_0x187245,_0x4a7ff6,_0x5d2d1b){VoiceQueueReportEvents[_0x8a03('0x7')](_0x1cd61c+':'+_0x187245['id'],_0x187245);VoiceQueueReportEvents[_0x8a03('0x7')](_0x1cd61c,_0x187245);_0x5d2d1b(null);};}for(var e in events){if(events[_0x8a03('0x8')](e)){var event=events[e];VoiceQueueReport[_0x8a03('0x9')](e,emitEvent(event));}}module[_0x8a03('0xa')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xe69a=['exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','remove','emit','hook'];(function(_0x1501ed,_0x71a68){var _0x5ca2c2=function(_0x39f319){while(--_0x39f319){_0x1501ed['push'](_0x1501ed['shift']());}};_0x5ca2c2(++_0x71a68);}(_0xe69a,0x169));var _0xae69=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xe69a[_0xc6be3a];return _0x56a310;};'use strict';var EventEmitter=require(_0xae69('0x0'));var VoiceQueueReport=require(_0xae69('0x1'))['db'][_0xae69('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xae69('0x3')](0x0);var events={'afterCreate':_0xae69('0x4'),'afterUpdate':'update','afterDestroy':_0xae69('0x5')};function emitEvent(_0x5a466a){return function(_0x423ef1,_0x3ccded,_0x14f8e1){VoiceQueueReportEvents[_0xae69('0x6')](_0x5a466a+':'+_0x423ef1['id'],_0x423ef1);VoiceQueueReportEvents[_0xae69('0x6')](_0x5a466a,_0x423ef1);_0x14f8e1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xae69('0x7')](e,emitEvent(event));}}module[_0xae69('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 8c78dd3..89badc2 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 _0x7ef8=['calleridnum','lodash','util','api','moment','request-promise','path','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue'];(function(_0x5c04ac,_0x53c759){var _0x54a65e=function(_0x27cc79){while(--_0x27cc79){_0x5c04ac['push'](_0x5c04ac['shift']());}};_0x54a65e(++_0x53c759);}(_0x7ef8,0x1f0));var _0x87ef=function(_0x15f347,_0x547ffe){_0x15f347=_0x15f347-0x0;var _0x3045a6=_0x7ef8[_0x15f347];return _0x3045a6;};'use strict';var _=require(_0x87ef('0x0'));var util=require(_0x87ef('0x1'));var logger=require('../../config/logger')(_0x87ef('0x2'));var moment=require(_0x87ef('0x3'));var BPromise=require('bluebird');var rp=require(_0x87ef('0x4'));var fs=require('fs');var path=require(_0x87ef('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x87ef('0x6'));module['exports']=function(_0x48f74d,_0x13e894){return _0x48f74d[_0x87ef('0x7')](_0x87ef('0x8'),attributes,{'tableName':_0x87ef('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x87ef('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xacfe=['../../config/environment','./voiceQueueReport.attributes','exports','define','report_queue','uniqueid','calleridnum','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x38b2f4,_0x3e2a72){var _0x133552=function(_0xb618f7){while(--_0xb618f7){_0x38b2f4['push'](_0x38b2f4['shift']());}};_0x133552(++_0x3e2a72);}(_0xacfe,0x93));var _0xeacf=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xacfe[_0x42245d];return _0x4b211a;};'use strict';var _=require('lodash');var util=require(_0xeacf('0x0'));var logger=require('../../config/logger')(_0xeacf('0x1'));var moment=require(_0xeacf('0x2'));var BPromise=require(_0xeacf('0x3'));var rp=require(_0xeacf('0x4'));var fs=require('fs');var path=require(_0xeacf('0x5'));var rimraf=require(_0xeacf('0x6'));var config=require(_0xeacf('0x7'));var attributes=require(_0xeacf('0x8'));module[_0xeacf('0x9')]=function(_0xca9ddc,_0x2da332){return _0xca9ddc[_0xeacf('0xa')]('VoiceQueueReport',attributes,{'tableName':_0xeacf('0xb'),'paranoid':![],'indexes':[{'fields':[_0xeacf('0xc')]},{'fields':[_0xeacf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 9e2f4b3..a06c6d4 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 _0xdabe=['VoiceQueueReport,\x20%s,\x20%s','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','map','include','model','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','body','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x59d2b7,_0x5f28f3){var _0x4e75dd=function(_0x35cfec){while(--_0x35cfec){_0x59d2b7['push'](_0x59d2b7['shift']());}};_0x4e75dd(++_0x5f28f3);}(_0xdabe,0x8d));var _0xedab=function(_0x4a85fd,_0x46dcda){_0x4a85fd=_0x4a85fd-0x0;var _0x47d0a7=_0xdabe[_0x4a85fd];return _0x47d0a7;};'use strict';var _=require(_0xedab('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xedab('0x1'));var rs=require(_0xedab('0x2'));var fs=require('fs');var Redis=require(_0xedab('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xedab('0x4'))(_0xedab('0x5'));var config=require(_0xedab('0x6'));var jayson=require(_0xedab('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xedab('0x8')]=_[_0xedab('0x9')](config[_0xedab('0x8')],{'host':_0xedab('0xa'),'port':0x18eb});var socket=require(_0xedab('0xb'))(new Redis(config[_0xedab('0x8')]));require(_0xedab('0xc'))['register'](socket);function respondWithRpcPromise(_0x43011d,_0x22f94c,_0xc9077b){return new BPromise(function(_0x4f8512,_0xf115d0){return client[_0xedab('0xd')](_0x43011d,_0xc9077b)[_0xedab('0xe')](function(_0x357cf0){logger[_0xedab('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0x22f94c,_0xedab('0x10'));logger[_0xedab('0x11')](_0xedab('0x12'),_0x22f94c,_0xedab('0x10'),JSON[_0xedab('0x13')](_0x357cf0));if(_0x357cf0['error']){if(_0x357cf0[_0xedab('0x14')][_0xedab('0x15')]===0x1f4){logger[_0xedab('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x22f94c,_0x357cf0['error'][_0xedab('0x16')]);return _0xf115d0(_0x357cf0[_0xedab('0x14')][_0xedab('0x16')]);}logger['error'](_0xedab('0x17'),_0x22f94c,_0x357cf0[_0xedab('0x14')][_0xedab('0x16')]);return _0x4f8512(_0x357cf0[_0xedab('0x14')][_0xedab('0x16')]);}else{logger[_0xedab('0xf')](_0xedab('0x17'),_0x22f94c,_0xedab('0x10'));_0x4f8512(_0x357cf0[_0xedab('0x18')]['message']);}})[_0xedab('0x19')](function(_0x133350){logger[_0xedab('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x22f94c,_0x133350);_0xf115d0(_0x133350);});});}exports[_0xedab('0x1a')]=function(_0x1cb399){var _0x1112d4=this;return new Promise(function(_0x3a7f60,_0x1d8b7f){return db[_0xedab('0x1b')][_0xedab('0x1c')]({'raw':_0x1cb399[_0xedab('0x1d')]?_0x1cb399[_0xedab('0x1d')][_0xedab('0x1e')]===undefined?!![]:![]:!![],'where':_0x1cb399[_0xedab('0x1d')]?_0x1cb399['options'][_0xedab('0x1f')]||null:null,'attributes':_0x1cb399[_0xedab('0x1d')]?_0x1cb399['options'][_0xedab('0x20')]||null:null,'limit':_0x1cb399[_0xedab('0x1d')]?_0x1cb399[_0xedab('0x1d')][_0xedab('0x21')]||null:null,'include':_0x1cb399['options']?_0x1cb399[_0xedab('0x1d')]['include']?_[_0xedab('0x22')](_0x1cb399[_0xedab('0x1d')][_0xedab('0x23')],function(_0x2aeda1){return{'model':db[_0x2aeda1['model']],'as':_0x2aeda1['as'],'attributes':_0x2aeda1[_0xedab('0x20')],'include':_0x2aeda1[_0xedab('0x23')]?_['map'](_0x2aeda1[_0xedab('0x23')],function(_0xfbb9c0){return{'model':db[_0xfbb9c0['model']],'as':_0xfbb9c0['as'],'attributes':_0xfbb9c0[_0xedab('0x20')],'include':_0xfbb9c0['include']?_[_0xedab('0x22')](_0xfbb9c0[_0xedab('0x23')],function(_0x5db832){return{'model':db[_0x5db832[_0xedab('0x24')]],'as':_0x5db832['as'],'attributes':_0x5db832[_0xedab('0x20')]};}):[]};}):[]};}):[]:[]})[_0xedab('0xe')](function(_0x3c431e){logger[_0xedab('0xf')]('GetVoiceQueueReport',_0x1cb399);logger['debug'](_0xedab('0x1a'),_0x1cb399,JSON[_0xedab('0x13')](_0x3c431e));_0x3a7f60(_0x3c431e);})[_0xedab('0x19')](function(_0x27ca43){logger[_0xedab('0x14')](_0xedab('0x1a'),_0x27ca43[_0xedab('0x16')],_0x1cb399);_0x1d8b7f(_0x1112d4[_0xedab('0x14')](0x1f4,_0x27ca43[_0xedab('0x16')]));});});};exports[_0xedab('0x25')]=function(_0x514014){var _0x580063=this;return new Promise(function(_0x304db7,_0x1c8a8e){return db[_0xedab('0x1b')][_0xedab('0x26')](_0x514014['body'],{'raw':_0x514014['options']?_0x514014[_0xedab('0x1d')][_0xedab('0x1e')]===undefined?!![]:![]:!![]})[_0xedab('0xe')](function(_0x7c5bec){logger[_0xedab('0xf')]('CreateVoiceQueueReport',_0x514014);logger['debug'](_0xedab('0x25'),_0x514014,JSON['stringify'](_0x7c5bec));_0x304db7(_0x7c5bec);})[_0xedab('0x19')](function(_0x42e862){logger[_0xedab('0x14')](_0xedab('0x25'),_0x42e862[_0xedab('0x16')],_0x514014);_0x1c8a8e(_0x580063[_0xedab('0x14')](0x1f4,_0x42e862[_0xedab('0x16')]));});});};exports[_0xedab('0x27')]=function(_0x36eb96){var _0x3ef320=this;return new Promise(function(_0x27ff47,_0x272d84){return db[_0xedab('0x1b')]['update'](_0x36eb96[_0xedab('0x28')],{'raw':_0x36eb96[_0xedab('0x1d')]?_0x36eb96['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36eb96['options']?_0x36eb96[_0xedab('0x1d')][_0xedab('0x1f')]||null:null,'attributes':_0x36eb96[_0xedab('0x1d')]?_0x36eb96[_0xedab('0x1d')][_0xedab('0x20')]||null:null,'limit':_0x36eb96[_0xedab('0x1d')]?_0x36eb96[_0xedab('0x1d')]['limit']||null:null})[_0xedab('0xe')](function(_0x1373d7){logger[_0xedab('0xf')](_0xedab('0x27'),_0x36eb96);logger[_0xedab('0x11')](_0xedab('0x27'),_0x36eb96,JSON[_0xedab('0x13')](_0x1373d7));_0x27ff47(_0x1373d7);})[_0xedab('0x19')](function(_0x104e7b){logger['error'](_0xedab('0x27'),_0x104e7b[_0xedab('0x16')],_0x36eb96);_0x272d84(_0x3ef320['error'](0x1f4,_0x104e7b[_0xedab('0x16')]));});});}; \ No newline at end of file +var _0x2cd9=['request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','where','attributes','limit','include','model','map','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','raw','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register'];(function(_0x2ac91b,_0x1919e8){var _0x4048b2=function(_0x104d58){while(--_0x104d58){_0x2ac91b['push'](_0x2ac91b['shift']());}};_0x4048b2(++_0x1919e8);}(_0x2cd9,0x18c));var _0x92cd=function(_0x306fd0,_0x20fef5){_0x306fd0=_0x306fd0-0x0;var _0x2115e6=_0x2cd9[_0x306fd0];return _0x2115e6;};'use strict';var _=require('lodash');var util=require(_0x92cd('0x0'));var moment=require('moment');var BPromise=require(_0x92cd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92cd('0x2'));var db=require(_0x92cd('0x3'))['db'];var utils=require(_0x92cd('0x4'));var logger=require('../../config/logger')(_0x92cd('0x5'));var config=require(_0x92cd('0x6'));var jayson=require(_0x92cd('0x7'));var client=jayson[_0x92cd('0x8')]['http']({'port':0x232a});config[_0x92cd('0x9')]=_['defaults'](config[_0x92cd('0x9')],{'host':_0x92cd('0xa'),'port':0x18eb});var socket=require(_0x92cd('0xb'))(new Redis(config[_0x92cd('0x9')]));require(_0x92cd('0xc'))[_0x92cd('0xd')](socket);function respondWithRpcPromise(_0x322424,_0x22e943,_0x3f1cf3){return new BPromise(function(_0x44490c,_0x4f5921){return client[_0x92cd('0xe')](_0x322424,_0x3f1cf3)[_0x92cd('0xf')](function(_0x5a1a32){logger[_0x92cd('0x10')](_0x92cd('0x11'),_0x22e943,_0x92cd('0x12'));logger[_0x92cd('0x13')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x22e943,_0x92cd('0x12'),JSON[_0x92cd('0x14')](_0x5a1a32));if(_0x5a1a32[_0x92cd('0x15')]){if(_0x5a1a32[_0x92cd('0x15')][_0x92cd('0x16')]===0x1f4){logger['error'](_0x92cd('0x11'),_0x22e943,_0x5a1a32['error'][_0x92cd('0x17')]);return _0x4f5921(_0x5a1a32[_0x92cd('0x15')][_0x92cd('0x17')]);}logger[_0x92cd('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x22e943,_0x5a1a32[_0x92cd('0x15')][_0x92cd('0x17')]);return _0x44490c(_0x5a1a32[_0x92cd('0x15')][_0x92cd('0x17')]);}else{logger[_0x92cd('0x10')](_0x92cd('0x11'),_0x22e943,_0x92cd('0x12'));_0x44490c(_0x5a1a32[_0x92cd('0x18')][_0x92cd('0x17')]);}})[_0x92cd('0x19')](function(_0x409933){logger['error'](_0x92cd('0x11'),_0x22e943,_0x409933);_0x4f5921(_0x409933);});});}exports[_0x92cd('0x1a')]=function(_0x20fd52){var _0x2973d1=this;return new Promise(function(_0x6d2851,_0x3d048c){return db[_0x92cd('0x1b')]['findAll']({'raw':_0x20fd52[_0x92cd('0x1c')]?_0x20fd52[_0x92cd('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x20fd52[_0x92cd('0x1c')]?_0x20fd52[_0x92cd('0x1c')][_0x92cd('0x1d')]||null:null,'attributes':_0x20fd52['options']?_0x20fd52['options'][_0x92cd('0x1e')]||null:null,'limit':_0x20fd52['options']?_0x20fd52['options'][_0x92cd('0x1f')]||null:null,'include':_0x20fd52[_0x92cd('0x1c')]?_0x20fd52[_0x92cd('0x1c')][_0x92cd('0x20')]?_['map'](_0x20fd52[_0x92cd('0x1c')]['include'],function(_0x27e83a){return{'model':db[_0x27e83a[_0x92cd('0x21')]],'as':_0x27e83a['as'],'attributes':_0x27e83a[_0x92cd('0x1e')],'include':_0x27e83a[_0x92cd('0x20')]?_[_0x92cd('0x22')](_0x27e83a[_0x92cd('0x20')],function(_0x4e51cd){return{'model':db[_0x4e51cd[_0x92cd('0x21')]],'as':_0x4e51cd['as'],'attributes':_0x4e51cd[_0x92cd('0x1e')],'include':_0x4e51cd[_0x92cd('0x20')]?_[_0x92cd('0x22')](_0x4e51cd[_0x92cd('0x20')],function(_0x5d5871){return{'model':db[_0x5d5871['model']],'as':_0x5d5871['as'],'attributes':_0x5d5871['attributes']};}):[]};}):[]};}):[]:[]})[_0x92cd('0xf')](function(_0x29864a){logger[_0x92cd('0x10')](_0x92cd('0x1a'),_0x20fd52);logger[_0x92cd('0x13')](_0x92cd('0x1a'),_0x20fd52,JSON[_0x92cd('0x14')](_0x29864a));_0x6d2851(_0x29864a);})[_0x92cd('0x19')](function(_0x69701d){logger[_0x92cd('0x15')](_0x92cd('0x1a'),_0x69701d[_0x92cd('0x17')],_0x20fd52);_0x3d048c(_0x2973d1[_0x92cd('0x15')](0x1f4,_0x69701d[_0x92cd('0x17')]));});});};exports[_0x92cd('0x23')]=function(_0x3d839c){var _0xf1ea8d=this;return new Promise(function(_0x488d68,_0x149563){return db['VoiceQueueReport'][_0x92cd('0x24')](_0x3d839c[_0x92cd('0x25')],{'raw':_0x3d839c[_0x92cd('0x1c')]?_0x3d839c[_0x92cd('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x92cd('0xf')](function(_0x5823fb){logger[_0x92cd('0x10')]('CreateVoiceQueueReport',_0x3d839c);logger['debug'](_0x92cd('0x23'),_0x3d839c,JSON[_0x92cd('0x14')](_0x5823fb));_0x488d68(_0x5823fb);})[_0x92cd('0x19')](function(_0x5d189e){logger[_0x92cd('0x15')](_0x92cd('0x23'),_0x5d189e[_0x92cd('0x17')],_0x3d839c);_0x149563(_0xf1ea8d[_0x92cd('0x15')](0x1f4,_0x5d189e[_0x92cd('0x17')]));});});};exports[_0x92cd('0x26')]=function(_0xd9755){var _0x1f36ac=this;return new Promise(function(_0x538da9,_0x59c53e){return db[_0x92cd('0x1b')][_0x92cd('0x27')](_0xd9755['body'],{'raw':_0xd9755[_0x92cd('0x1c')]?_0xd9755[_0x92cd('0x1c')][_0x92cd('0x28')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd9755[_0x92cd('0x1c')]?_0xd9755[_0x92cd('0x1c')][_0x92cd('0x1d')]||null:null,'attributes':_0xd9755[_0x92cd('0x1c')]?_0xd9755[_0x92cd('0x1c')][_0x92cd('0x1e')]||null:null,'limit':_0xd9755[_0x92cd('0x1c')]?_0xd9755['options'][_0x92cd('0x1f')]||null:null})[_0x92cd('0xf')](function(_0x2c7ae5){logger[_0x92cd('0x10')](_0x92cd('0x26'),_0xd9755);logger[_0x92cd('0x13')](_0x92cd('0x26'),_0xd9755,JSON[_0x92cd('0x14')](_0x2c7ae5));_0x538da9(_0x2c7ae5);})[_0x92cd('0x19')](function(_0x332225){logger['error'](_0x92cd('0x26'),_0x332225[_0x92cd('0x17')],_0xd9755);_0x59c53e(_0x1f36ac[_0x92cd('0x15')](0x1f4,_0x332225[_0x92cd('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 3268fbd..052412b 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 _0x15cb=['register','length','voiceQueueReport:','save','update','emit','removeListener'];(function(_0x34a47b,_0x109857){var _0x3bd3d7=function(_0x30e79a){while(--_0x30e79a){_0x34a47b['push'](_0x34a47b['shift']());}};_0x3bd3d7(++_0x109857);}(_0x15cb,0x16f));var _0xb15c=function(_0x49186f,_0xc0d604){_0x49186f=_0x49186f-0x0;var _0x4a1b16=_0x15cb[_0x49186f];return _0x4a1b16;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xb15c('0x0'),'remove',_0xb15c('0x1')];function createListener(_0x595def,_0x29f928){return function(_0x320b1d){_0x29f928[_0xb15c('0x2')](_0x595def,_0x320b1d);};}function removeListener(_0x3d8546,_0x4f1c8f){return function(){VoiceQueueReportEvents[_0xb15c('0x3')](_0x3d8546,_0x4f1c8f);};}exports[_0xb15c('0x4')]=function(_0x50ea76){for(var _0x5a1b40=0x0,_0x161c9c=events[_0xb15c('0x5')];_0x5a1b40<_0x161c9c;_0x5a1b40++){var _0x1c75a8=events[_0x5a1b40];var _0x3ad071=createListener(_0xb15c('0x6')+_0x1c75a8,_0x50ea76);VoiceQueueReportEvents['on'](_0x1c75a8,_0x3ad071);}}; \ No newline at end of file +var _0x02a7=['length','voiceQueueReport:','save','emit','removeListener'];(function(_0x2c6292,_0x232231){var _0x5f32=function(_0x568e63){while(--_0x568e63){_0x2c6292['push'](_0x2c6292['shift']());}};_0x5f32(++_0x232231);}(_0x02a7,0x7a));var _0x702a=function(_0x277d4b,_0x6dd8f0){_0x277d4b=_0x277d4b-0x0;var _0x3c351e=_0x02a7[_0x277d4b];return _0x3c351e;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x702a('0x0'),'remove','update'];function createListener(_0x30b64d,_0x30573e){return function(_0x325874){_0x30573e[_0x702a('0x1')](_0x30b64d,_0x325874);};}function removeListener(_0x4612ca,_0x1fc26b){return function(){VoiceQueueReportEvents[_0x702a('0x2')](_0x4612ca,_0x1fc26b);};}exports['register']=function(_0x1bcfe5){for(var _0x5b7d8c=0x0,_0x26b25e=events[_0x702a('0x3')];_0x5b7d8c<_0x26b25e;_0x5b7d8c++){var _0x3f2954=events[_0x5b7d8c];var _0x161dee=createListener(_0x702a('0x4')+_0x3f2954,_0x1bcfe5);VoiceQueueReportEvents['on'](_0x3f2954,_0x161dee);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index f8cfeb0..7ff6a1e 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 _0xc991=['../../config/environment','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4daff5,_0x24b89a){var _0x21762a=function(_0x3e25c6){while(--_0x3e25c6){_0x4daff5['push'](_0x4daff5['shift']());}};_0x21762a(++_0x24b89a);}(_0xc991,0x1d4));var _0x1c99=function(_0x4aa0e1,_0x4c7e5f){_0x4aa0e1=_0x4aa0e1-0x0;var _0x2e56f0=_0xc991[_0x4aa0e1];return _0x2e56f0;};'use strict';var multer=require(_0x1c99('0x0'));var util=require('util');var path=require(_0x1c99('0x1'));var timeout=require(_0x1c99('0x2'));var express=require('express');var router=express[_0x1c99('0x3')]();var fs_extra=require(_0x1c99('0x4'));var auth=require(_0x1c99('0x5'));var interaction=require(_0x1c99('0x6'));var config=require(_0x1c99('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0x1c99('0x8')]('/',auth[_0x1c99('0x9')](),controller[_0x1c99('0xa')]);router['get']('/:id',auth[_0x1c99('0x9')](),controller[_0x1c99('0xb')]);router[_0x1c99('0xc')]('/',auth[_0x1c99('0x9')](),controller[_0x1c99('0xd')]);router['put'](_0x1c99('0xe'),auth[_0x1c99('0x9')](),controller[_0x1c99('0xf')]);router[_0x1c99('0x10')]('/:id',auth[_0x1c99('0x9')](),controller[_0x1c99('0x11')]);module[_0x1c99('0x12')]=router; \ No newline at end of file +var _0xb95a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1d0ce7,_0x5938f1){var _0x27d94d=function(_0x3a8170){while(--_0x3a8170){_0x1d0ce7['push'](_0x1d0ce7['shift']());}};_0x27d94d(++_0x5938f1);}(_0xb95a,0x13b));var _0xab95=function(_0xad6e4d,_0x3b9104){_0xad6e4d=_0xad6e4d-0x0;var _0x33f6de=_0xb95a[_0xad6e4d];return _0x33f6de;};'use strict';var multer=require(_0xab95('0x0'));var util=require(_0xab95('0x1'));var path=require(_0xab95('0x2'));var timeout=require(_0xab95('0x3'));var express=require(_0xab95('0x4'));var router=express[_0xab95('0x5')]();var fs_extra=require(_0xab95('0x6'));var auth=require(_0xab95('0x7'));var interaction=require(_0xab95('0x8'));var config=require(_0xab95('0x9'));var controller=require(_0xab95('0xa'));router[_0xab95('0xb')]('/',auth['isAuthenticated'](),controller[_0xab95('0xc')]);router[_0xab95('0xb')](_0xab95('0xd'),auth['isAuthenticated'](),controller[_0xab95('0xe')]);router[_0xab95('0xf')]('/',auth[_0xab95('0x10')](),controller[_0xab95('0x11')]);router[_0xab95('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xab95('0x13')]);router[_0xab95('0x14')](_0xab95('0xd'),auth['isAuthenticated'](),controller[_0xab95('0x15')]);module[_0xab95('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 9e331e1..60f523f 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 _0xde36=['format','sequelize','moment','STRING','DATE'];(function(_0x472642,_0x4f2a71){var _0x6cc582=function(_0x3dfa7e){while(--_0x3dfa7e){_0x472642['push'](_0x472642['shift']());}};_0x6cc582(++_0x4f2a71);}(_0xde36,0x1a5));var _0x6de3=function(_0x19259f,_0x9e431c){_0x19259f=_0x19259f-0x0;var _0x224aa9=_0xde36[_0x19259f];return _0x224aa9;};'use strict';var Sequelize=require(_0x6de3('0x0'));var moment=require(_0x6de3('0x1'));module['exports']={'time':{'type':Sequelize[_0x6de3('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x6de3('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x6de3('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x6de3('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x6de3('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x6de3('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x6de3('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x6de3('0x3')],'allowNull':![],'defaultValue':moment()[_0x6de3('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0x8935=['sequelize','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x388a1c,_0x1443d6){var _0x23d5be=function(_0x93e864){while(--_0x93e864){_0x388a1c['push'](_0x388a1c['shift']());}};_0x23d5be(++_0x1443d6);}(_0x8935,0xbe));var _0x5893=function(_0xe8f77e,_0xcab56d){_0xe8f77e=_0xe8f77e-0x0;var _0x2cae92=_0x8935[_0xe8f77e];return _0x2cae92;};'use strict';var Sequelize=require(_0x5893('0x0'));var moment=require('moment');module['exports']={'time':{'type':Sequelize[_0x5893('0x1')]},'callid':{'type':Sequelize[_0x5893('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x5893('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x5893('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x5893('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x5893('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x5893('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x5893('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x5893('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x5893('0x2')],'allowNull':![],'defaultValue':moment()[_0x5893('0x3')](_0x5893('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 68032a9..15c3a6c 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 _0x0337=['papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','then','destroy','error','name','send','VoiceQueuesLog','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','body','find','rimraf','zip-dir','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x292f93,_0x2c6e8e){var _0x5a94b1=function(_0x25735e){while(--_0x25735e){_0x292f93['push'](_0x292f93['shift']());}};_0x5a94b1(++_0x2c6e8e);}(_0x0337,0x1d7));var _0x7033=function(_0x266ddc,_0x45aa52){_0x266ddc=_0x266ddc-0x0;var _0x39c1d7=_0x0337[_0x266ddc];return _0x39c1d7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7033('0x0'));var zipdir=require(_0x7033('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7033('0x2'));var BPromise=require(_0x7033('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7033('0x4'));var csv=require(_0x7033('0x5'));var ejs=require(_0x7033('0x6'));var fs=require('fs');var fs_extra=require(_0x7033('0x7'));var _=require(_0x7033('0x8'));var squel=require(_0x7033('0x9'));var crypto=require(_0x7033('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7033('0xb'));var toCsv=require(_0x7033('0x5'));var querystring=require('querystring');var Papa=require(_0x7033('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7033('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7033('0xe'))(_0x7033('0xf'));var utils=require(_0x7033('0x10'));var config=require(_0x7033('0x11'));var licenseUtil=require(_0x7033('0x12'));var db=require(_0x7033('0x13'))['db'];function respondWithStatusCode(_0x9202ea,_0x47bf10){_0x47bf10=_0x47bf10||0xcc;return function(_0x15d5a3){if(_0x15d5a3){return _0x9202ea[_0x7033('0x14')](_0x47bf10);}return _0x9202ea['status'](_0x47bf10)[_0x7033('0x15')]();};}function respondWithResult(_0x583be8,_0x13e11b){_0x13e11b=_0x13e11b||0xc8;return function(_0x17fc51){if(_0x17fc51){return _0x583be8['status'](_0x13e11b)[_0x7033('0x16')](_0x17fc51);}};}function respondWithFilteredResult(_0x253b96,_0x1880fb){return function(_0x3d9656){if(_0x3d9656){var _0x57aa72=typeof _0x1880fb[_0x7033('0x17')]===_0x7033('0x18')&&typeof _0x1880fb['limit']===_0x7033('0x18');var _0xdd9e4d=_0x3d9656[_0x7033('0x19')];var _0x1d215a=_0x57aa72?0x0:_0x1880fb[_0x7033('0x17')];var _0x1e1940=_0x57aa72?_0x3d9656[_0x7033('0x19')]:_0x1880fb[_0x7033('0x17')]+_0x1880fb[_0x7033('0x1a')];var _0x1d0ec0;if(_0x1e1940>=_0xdd9e4d){_0x1e1940=_0xdd9e4d;_0x1d0ec0=0xc8;}else{_0x1d0ec0=0xce;}_0x253b96[_0x7033('0x1b')](_0x1d0ec0);return _0x253b96['set'](_0x7033('0x1c'),_0x1d215a+'-'+_0x1e1940+'/'+_0xdd9e4d)[_0x7033('0x16')](_0x3d9656);}return null;};}function patchUpdates(_0x492ed6){return function(_0x532e0f){try{jsonpatch[_0x7033('0x1d')](_0x532e0f,_0x492ed6,!![]);}catch(_0x3d5230){return BPromise[_0x7033('0x1e')](_0x3d5230);}return _0x532e0f[_0x7033('0x1f')]();};}function saveUpdates(_0x3e629e,_0x24e2da){return function(_0x41f881){if(_0x41f881){return _0x41f881[_0x7033('0x20')](_0x3e629e)[_0x7033('0x21')](function(_0x5095eb){return _0x5095eb;});}return null;};}function removeEntity(_0xde742b,_0x1a0bd5){return function(_0x4c7644){if(_0x4c7644){return _0x4c7644[_0x7033('0x22')]()[_0x7033('0x21')](function(){_0xde742b[_0x7033('0x1b')](0xcc)[_0x7033('0x15')]();});}};}function handleEntityNotFound(_0x38dc90,_0x3d502f){return function(_0x46ec7e){if(!_0x46ec7e){_0x38dc90[_0x7033('0x14')](0x194);}return _0x46ec7e;};}function handleError(_0x1abab7,_0x31537c){_0x31537c=_0x31537c||0x1f4;return function(_0x3a38a3){logger[_0x7033('0x23')](_0x3a38a3['stack']);if(_0x3a38a3[_0x7033('0x24')]){delete _0x3a38a3['name'];}_0x1abab7[_0x7033('0x1b')](_0x31537c)[_0x7033('0x25')](_0x3a38a3);};}exports['index']=function(_0x56a28b,_0x386608){var _0x229a58={},_0x3731d7={},_0x1d562a={'count':0x0,'rows':[]};var _0x736dc0=_['map'](db[_0x7033('0x26')][_0x7033('0x27')],function(_0x541bb4){return{'name':_0x541bb4[_0x7033('0x28')],'type':_0x541bb4[_0x7033('0x29')][_0x7033('0x2a')]};});_0x3731d7['model']=_[_0x7033('0x2b')](_0x736dc0,_0x7033('0x24'));_0x3731d7['query']=_[_0x7033('0x2c')](_0x56a28b[_0x7033('0x2d')]);_0x3731d7[_0x7033('0x2e')]=_[_0x7033('0x2f')](_0x3731d7[_0x7033('0x30')],_0x3731d7[_0x7033('0x2d')]);_0x229a58['attributes']=_[_0x7033('0x2f')](_0x3731d7[_0x7033('0x30')],qs[_0x7033('0x31')](_0x56a28b['query'][_0x7033('0x31')]));_0x229a58[_0x7033('0x32')]=_0x229a58['attributes'][_0x7033('0x33')]?_0x229a58['attributes']:_0x3731d7[_0x7033('0x30')];if(!_0x56a28b[_0x7033('0x2d')][_0x7033('0x34')](_0x7033('0x35'))){_0x229a58['limit']=qs['limit'](_0x56a28b[_0x7033('0x2d')]['limit']);_0x229a58['offset']=qs[_0x7033('0x17')](_0x56a28b['query'][_0x7033('0x17')]);}_0x229a58[_0x7033('0x36')]=qs[_0x7033('0x37')](_0x56a28b[_0x7033('0x2d')][_0x7033('0x37')]);_0x229a58[_0x7033('0x38')]=qs[_0x7033('0x2e')](_[_0x7033('0x39')](_0x56a28b[_0x7033('0x2d')],_0x3731d7['filters']),_0x736dc0);if(_0x56a28b['query']['filter']){_0x229a58[_0x7033('0x38')]=_[_0x7033('0x3a')](_0x229a58[_0x7033('0x38')],{'$or':_['map'](_0x736dc0,function(_0x180d60){if(_0x180d60[_0x7033('0x29')]!==_0x7033('0x3b')){var _0x118fad={};_0x118fad[_0x180d60[_0x7033('0x24')]]={'$like':'%'+_0x56a28b[_0x7033('0x2d')]['filter']+'%'};return _0x118fad;}})});}_0x229a58=_[_0x7033('0x3a')]({},_0x229a58,_0x56a28b[_0x7033('0x3c')]);var _0x43a458={'where':_0x229a58[_0x7033('0x38')]};return db[_0x7033('0x26')][_0x7033('0x19')](_0x43a458)[_0x7033('0x21')](function(_0x95475){_0x1d562a['count']=_0x95475;if(_0x56a28b[_0x7033('0x2d')][_0x7033('0x3d')]){_0x229a58[_0x7033('0x3e')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x7033('0x3f')](_0x229a58);})[_0x7033('0x21')](function(_0x3681f9){_0x1d562a['rows']=_0x3681f9;return _0x1d562a;})[_0x7033('0x21')](respondWithFilteredResult(_0x386608,_0x229a58))[_0x7033('0x40')](handleError(_0x386608,null));};exports[_0x7033('0x41')]=function(_0x441fdf,_0x48602f){var _0x18e32e={'raw':!![],'where':{'id':_0x441fdf[_0x7033('0x42')]['id']}},_0xe04556={};_0xe04556[_0x7033('0x30')]=_[_0x7033('0x2c')](db[_0x7033('0x26')][_0x7033('0x27')]);_0xe04556[_0x7033('0x2d')]=_['keys'](_0x441fdf[_0x7033('0x2d')]);_0xe04556[_0x7033('0x2e')]=_[_0x7033('0x2f')](_0xe04556[_0x7033('0x30')],_0xe04556[_0x7033('0x2d')]);_0x18e32e[_0x7033('0x32')]=_[_0x7033('0x2f')](_0xe04556[_0x7033('0x30')],qs[_0x7033('0x31')](_0x441fdf['query'][_0x7033('0x31')]));_0x18e32e['attributes']=_0x18e32e[_0x7033('0x32')][_0x7033('0x33')]?_0x18e32e[_0x7033('0x32')]:_0xe04556[_0x7033('0x30')];if(_0x441fdf[_0x7033('0x2d')][_0x7033('0x3d')]){_0x18e32e[_0x7033('0x3e')]=[{'all':!![]}];}_0x18e32e=_['merge']({},_0x18e32e,_0x441fdf[_0x7033('0x3c')]);return db[_0x7033('0x26')]['find'](_0x18e32e)[_0x7033('0x21')](handleEntityNotFound(_0x48602f,null))[_0x7033('0x21')](respondWithResult(_0x48602f,null))['catch'](handleError(_0x48602f,null));};exports['create']=function(_0x5232ff,_0x10693e){return db[_0x7033('0x26')]['create'](_0x5232ff['body'],{})['then'](respondWithResult(_0x10693e,0xc9))['catch'](handleError(_0x10693e,null));};exports['update']=function(_0x216e63,_0x576afa){if(_0x216e63[_0x7033('0x43')]['id']){delete _0x216e63[_0x7033('0x43')]['id'];}return db['VoiceQueuesLog'][_0x7033('0x44')]({'where':{'id':_0x216e63[_0x7033('0x42')]['id']}})['then'](handleEntityNotFound(_0x576afa,null))['then'](saveUpdates(_0x216e63[_0x7033('0x43')],null))[_0x7033('0x21')](respondWithResult(_0x576afa,null))[_0x7033('0x40')](handleError(_0x576afa,null));};exports['destroy']=function(_0x335d62,_0x1a73f3){return db['VoiceQueuesLog'][_0x7033('0x44')]({'where':{'id':_0x335d62['params']['id']}})[_0x7033('0x21')](handleEntityNotFound(_0x1a73f3,null))['then'](removeEntity(_0x1a73f3,null))['catch'](handleError(_0x1a73f3,null));}; \ No newline at end of file +var _0xcf88=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','map','VoiceQueuesLog','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','keys','include','options','find','create','body','destroy','params','eml-format','rimraf'];(function(_0x4e479b,_0x2478e7){var _0x32c31a=function(_0x225f6b){while(--_0x225f6b){_0x4e479b['push'](_0x4e479b['shift']());}};_0x32c31a(++_0x2478e7);}(_0xcf88,0x1ae));var _0x8cf8=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xcf88[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require(_0x8cf8('0x0'));var rimraf=require(_0x8cf8('0x1'));var zipdir=require(_0x8cf8('0x2'));var jsonpatch=require(_0x8cf8('0x3'));var rp=require('request-promise');var moment=require(_0x8cf8('0x4'));var BPromise=require(_0x8cf8('0x5'));var Mustache=require(_0x8cf8('0x6'));var util=require(_0x8cf8('0x7'));var path=require(_0x8cf8('0x8'));var sox=require('sox');var csv=require(_0x8cf8('0x9'));var ejs=require(_0x8cf8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8cf8('0xb'));var crypto=require('crypto');var jsforce=require(_0x8cf8('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8cf8('0xd'));var Redis=require(_0x8cf8('0xe'));var authService=require(_0x8cf8('0xf'));var qs=require(_0x8cf8('0x10'));var as=require(_0x8cf8('0x11'));var hardwareService=require(_0x8cf8('0x12'));var logger=require('../../config/logger')(_0x8cf8('0x13'));var utils=require(_0x8cf8('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8cf8('0x15'));var db=require(_0x8cf8('0x16'))['db'];function respondWithStatusCode(_0x262877,_0x2a738f){_0x2a738f=_0x2a738f||0xcc;return function(_0x329bb4){if(_0x329bb4){return _0x262877[_0x8cf8('0x17')](_0x2a738f);}return _0x262877[_0x8cf8('0x18')](_0x2a738f)[_0x8cf8('0x19')]();};}function respondWithResult(_0x4c008f,_0x5adf2e){_0x5adf2e=_0x5adf2e||0xc8;return function(_0x1d6d6b){if(_0x1d6d6b){return _0x4c008f['status'](_0x5adf2e)[_0x8cf8('0x1a')](_0x1d6d6b);}};}function respondWithFilteredResult(_0x51ecc1,_0x3adc2c){return function(_0x5ce4b6){if(_0x5ce4b6){var _0x2b63ba=typeof _0x3adc2c[_0x8cf8('0x1b')]===_0x8cf8('0x1c')&&typeof _0x3adc2c[_0x8cf8('0x1d')]===_0x8cf8('0x1c');var _0xd8827c=_0x5ce4b6[_0x8cf8('0x1e')];var _0x7a252e=_0x2b63ba?0x0:_0x3adc2c[_0x8cf8('0x1b')];var _0x17e871=_0x2b63ba?_0x5ce4b6[_0x8cf8('0x1e')]:_0x3adc2c['offset']+_0x3adc2c[_0x8cf8('0x1d')];var _0x3a8f36;if(_0x17e871>=_0xd8827c){_0x17e871=_0xd8827c;_0x3a8f36=0xc8;}else{_0x3a8f36=0xce;}_0x51ecc1[_0x8cf8('0x18')](_0x3a8f36);return _0x51ecc1[_0x8cf8('0x1f')](_0x8cf8('0x20'),_0x7a252e+'-'+_0x17e871+'/'+_0xd8827c)[_0x8cf8('0x1a')](_0x5ce4b6);}return null;};}function patchUpdates(_0x12c733){return function(_0x205580){try{jsonpatch[_0x8cf8('0x21')](_0x205580,_0x12c733,!![]);}catch(_0x4f8c92){return BPromise['reject'](_0x4f8c92);}return _0x205580[_0x8cf8('0x22')]();};}function saveUpdates(_0x168a48,_0x3d8b48){return function(_0x22e69b){if(_0x22e69b){return _0x22e69b[_0x8cf8('0x23')](_0x168a48)[_0x8cf8('0x24')](function(_0x36b2e4){return _0x36b2e4;});}return null;};}function removeEntity(_0x11cf13,_0xa426a0){return function(_0x1548c2){if(_0x1548c2){return _0x1548c2['destroy']()[_0x8cf8('0x24')](function(){_0x11cf13[_0x8cf8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xedbe7b,_0x5f3c4f){return function(_0x13e1a4){if(!_0x13e1a4){_0xedbe7b[_0x8cf8('0x17')](0x194);}return _0x13e1a4;};}function handleError(_0x525b1b,_0x35e0e3){_0x35e0e3=_0x35e0e3||0x1f4;return function(_0x2d4f3b){logger[_0x8cf8('0x25')](_0x2d4f3b[_0x8cf8('0x26')]);if(_0x2d4f3b['name']){delete _0x2d4f3b[_0x8cf8('0x27')];}_0x525b1b['status'](_0x35e0e3)['send'](_0x2d4f3b);};}exports['index']=function(_0x5018f4,_0x13b9cd){var _0x577fe6={},_0x2c1eda={},_0x521211={'count':0x0,'rows':[]};var _0x85bebf=_[_0x8cf8('0x28')](db[_0x8cf8('0x29')][_0x8cf8('0x2a')],function(_0x544df3){return{'name':_0x544df3['fieldName'],'type':_0x544df3[_0x8cf8('0x2b')][_0x8cf8('0x2c')]};});_0x2c1eda[_0x8cf8('0x2d')]=_[_0x8cf8('0x28')](_0x85bebf,_0x8cf8('0x27'));_0x2c1eda[_0x8cf8('0x2e')]=_['keys'](_0x5018f4[_0x8cf8('0x2e')]);_0x2c1eda[_0x8cf8('0x2f')]=_[_0x8cf8('0x30')](_0x2c1eda[_0x8cf8('0x2d')],_0x2c1eda[_0x8cf8('0x2e')]);_0x577fe6['attributes']=_[_0x8cf8('0x30')](_0x2c1eda['model'],qs[_0x8cf8('0x31')](_0x5018f4[_0x8cf8('0x2e')][_0x8cf8('0x31')]));_0x577fe6['attributes']=_0x577fe6[_0x8cf8('0x32')][_0x8cf8('0x33')]?_0x577fe6['attributes']:_0x2c1eda[_0x8cf8('0x2d')];if(!_0x5018f4['query']['hasOwnProperty'](_0x8cf8('0x34'))){_0x577fe6[_0x8cf8('0x1d')]=qs[_0x8cf8('0x1d')](_0x5018f4[_0x8cf8('0x2e')]['limit']);_0x577fe6[_0x8cf8('0x1b')]=qs[_0x8cf8('0x1b')](_0x5018f4[_0x8cf8('0x2e')]['offset']);}_0x577fe6[_0x8cf8('0x35')]=qs['sort'](_0x5018f4[_0x8cf8('0x2e')]['sort']);_0x577fe6[_0x8cf8('0x36')]=qs['filters'](_[_0x8cf8('0x37')](_0x5018f4[_0x8cf8('0x2e')],_0x2c1eda[_0x8cf8('0x2f')]),_0x85bebf);if(_0x5018f4['query'][_0x8cf8('0x38')]){_0x577fe6['where']=_[_0x8cf8('0x39')](_0x577fe6[_0x8cf8('0x36')],{'$or':_[_0x8cf8('0x28')](_0x85bebf,function(_0x15eec0){if(_0x15eec0['type']!==_0x8cf8('0x3a')){var _0x45da4={};_0x45da4[_0x15eec0[_0x8cf8('0x27')]]={'$like':'%'+_0x5018f4['query'][_0x8cf8('0x38')]+'%'};return _0x45da4;}})});}_0x577fe6=_[_0x8cf8('0x39')]({},_0x577fe6,_0x5018f4['options']);var _0xb78960={'where':_0x577fe6[_0x8cf8('0x36')]};return db[_0x8cf8('0x29')][_0x8cf8('0x1e')](_0xb78960)[_0x8cf8('0x24')](function(_0x525268){_0x521211[_0x8cf8('0x1e')]=_0x525268;if(_0x5018f4[_0x8cf8('0x2e')][_0x8cf8('0x3b')]){_0x577fe6['include']=[{'all':!![]}];}return db[_0x8cf8('0x29')][_0x8cf8('0x3c')](_0x577fe6);})[_0x8cf8('0x24')](function(_0x4962a3){_0x521211[_0x8cf8('0x3d')]=_0x4962a3;return _0x521211;})[_0x8cf8('0x24')](respondWithFilteredResult(_0x13b9cd,_0x577fe6))[_0x8cf8('0x3e')](handleError(_0x13b9cd,null));};exports[_0x8cf8('0x3f')]=function(_0x4d8f06,_0x2f4b49){var _0x375083={'raw':!![],'where':{'id':_0x4d8f06['params']['id']}},_0x27ff70={};_0x27ff70[_0x8cf8('0x2d')]=_[_0x8cf8('0x40')](db[_0x8cf8('0x29')][_0x8cf8('0x2a')]);_0x27ff70[_0x8cf8('0x2e')]=_['keys'](_0x4d8f06[_0x8cf8('0x2e')]);_0x27ff70[_0x8cf8('0x2f')]=_[_0x8cf8('0x30')](_0x27ff70[_0x8cf8('0x2d')],_0x27ff70[_0x8cf8('0x2e')]);_0x375083['attributes']=_[_0x8cf8('0x30')](_0x27ff70['model'],qs[_0x8cf8('0x31')](_0x4d8f06[_0x8cf8('0x2e')][_0x8cf8('0x31')]));_0x375083[_0x8cf8('0x32')]=_0x375083[_0x8cf8('0x32')][_0x8cf8('0x33')]?_0x375083[_0x8cf8('0x32')]:_0x27ff70[_0x8cf8('0x2d')];if(_0x4d8f06[_0x8cf8('0x2e')][_0x8cf8('0x3b')]){_0x375083[_0x8cf8('0x41')]=[{'all':!![]}];}_0x375083=_[_0x8cf8('0x39')]({},_0x375083,_0x4d8f06[_0x8cf8('0x42')]);return db[_0x8cf8('0x29')][_0x8cf8('0x43')](_0x375083)['then'](handleEntityNotFound(_0x2f4b49,null))[_0x8cf8('0x24')](respondWithResult(_0x2f4b49,null))[_0x8cf8('0x3e')](handleError(_0x2f4b49,null));};exports[_0x8cf8('0x44')]=function(_0x18ae7c,_0x1869d0){return db[_0x8cf8('0x29')][_0x8cf8('0x44')](_0x18ae7c[_0x8cf8('0x45')],{})['then'](respondWithResult(_0x1869d0,0xc9))[_0x8cf8('0x3e')](handleError(_0x1869d0,null));};exports['update']=function(_0x5cd1ec,_0x3acc96){if(_0x5cd1ec[_0x8cf8('0x45')]['id']){delete _0x5cd1ec[_0x8cf8('0x45')]['id'];}return db[_0x8cf8('0x29')]['find']({'where':{'id':_0x5cd1ec['params']['id']}})[_0x8cf8('0x24')](handleEntityNotFound(_0x3acc96,null))[_0x8cf8('0x24')](saveUpdates(_0x5cd1ec[_0x8cf8('0x45')],null))[_0x8cf8('0x24')](respondWithResult(_0x3acc96,null))[_0x8cf8('0x3e')](handleError(_0x3acc96,null));};exports[_0x8cf8('0x46')]=function(_0x96c66f,_0x52acbf){return db[_0x8cf8('0x29')]['find']({'where':{'id':_0x96c66f[_0x8cf8('0x47')]['id']}})[_0x8cf8('0x24')](handleEntityNotFound(_0x52acbf,null))[_0x8cf8('0x24')](removeEntity(_0x52acbf,null))[_0x8cf8('0x3e')](handleError(_0x52acbf,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index a914a5b..e1fb974 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 _0xbdc0=['define','VoiceQueuesLog','voice_queues_log','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x2b2260,_0x298b8a){var _0x4b0f3d=function(_0x216908){while(--_0x216908){_0x2b2260['push'](_0x2b2260['shift']());}};_0x4b0f3d(++_0x298b8a);}(_0xbdc0,0x147));var _0x0bdc=function(_0x11cdde,_0x403e4c){_0x11cdde=_0x11cdde-0x0;var _0x48ea05=_0xbdc0[_0x11cdde];return _0x48ea05;};'use strict';var _=require(_0x0bdc('0x0'));var util=require(_0x0bdc('0x1'));var logger=require('../../config/logger')(_0x0bdc('0x2'));var moment=require(_0x0bdc('0x3'));var BPromise=require(_0x0bdc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0bdc('0x5'));var rimraf=require(_0x0bdc('0x6'));var config=require(_0x0bdc('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0x0bdc('0x8')]=function(_0x3bdcc7,_0x3bd580){return _0x3bdcc7[_0x0bdc('0x9')](_0x0bdc('0xa'),attributes,{'tableName':_0x0bdc('0xb'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x15be=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','event_dtm','event','dtm','lodash','util','api'];(function(_0x38895e,_0xdd08f9){var _0x23600e=function(_0x20047b){while(--_0x20047b){_0x38895e['push'](_0x38895e['shift']());}};_0x23600e(++_0xdd08f9);}(_0x15be,0x65));var _0xe15b=function(_0x791641,_0x57880d){_0x791641=_0x791641-0x0;var _0x32d71a=_0x15be[_0x791641];return _0x32d71a;};'use strict';var _=require(_0xe15b('0x0'));var util=require(_0xe15b('0x1'));var logger=require('../../config/logger')(_0xe15b('0x2'));var moment=require(_0xe15b('0x3'));var BPromise=require(_0xe15b('0x4'));var rp=require(_0xe15b('0x5'));var fs=require('fs');var path=require(_0xe15b('0x6'));var rimraf=require(_0xe15b('0x7'));var config=require(_0xe15b('0x8'));var attributes=require(_0xe15b('0x9'));module['exports']=function(_0x1a29de,_0x3a8c33){return _0x1a29de['define']('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xe15b('0xa'),'fields':[_0xe15b('0xb'),_0xe15b('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 b14757a..a3df31f 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 _0xa4de=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa4de,0x10d));var _0xea4d=function(_0x2cf5bd,_0x207524){_0x2cf5bd=_0x2cf5bd-0x0;var _0x50baab=_0xa4de[_0x2cf5bd];return _0x50baab;};'use strict';var _=require(_0xea4d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xea4d('0x1'));var rs=require(_0xea4d('0x2'));var fs=require('fs');var Redis=require(_0xea4d('0x3'));var db=require(_0xea4d('0x4'))['db'];var utils=require(_0xea4d('0x5'));var logger=require(_0xea4d('0x6'))(_0xea4d('0x7'));var config=require(_0xea4d('0x8'));var jayson=require(_0xea4d('0x9'));var client=jayson[_0xea4d('0xa')][_0xea4d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2af8a5,_0x58f748,_0x12d0bb){return new BPromise(function(_0x4f98e8,_0x139f1a){return client[_0xea4d('0xc')](_0x2af8a5,_0x12d0bb)[_0xea4d('0xd')](function(_0x1d58bb){logger[_0xea4d('0xe')](_0xea4d('0xf'),_0x58f748,_0xea4d('0x10'));logger[_0xea4d('0x11')](_0xea4d('0x12'),_0x58f748,_0xea4d('0x10'),JSON[_0xea4d('0x13')](_0x1d58bb));if(_0x1d58bb[_0xea4d('0x14')]){if(_0x1d58bb['error'][_0xea4d('0x15')]===0x1f4){logger[_0xea4d('0x14')](_0xea4d('0xf'),_0x58f748,_0x1d58bb[_0xea4d('0x14')][_0xea4d('0x16')]);return _0x139f1a(_0x1d58bb['error'][_0xea4d('0x16')]);}logger[_0xea4d('0x14')]('VoiceQueuesLog,\x20%s,\x20%s',_0x58f748,_0x1d58bb['error'][_0xea4d('0x16')]);return _0x4f98e8(_0x1d58bb[_0xea4d('0x14')][_0xea4d('0x16')]);}else{logger[_0xea4d('0xe')](_0xea4d('0xf'),_0x58f748,_0xea4d('0x10'));_0x4f98e8(_0x1d58bb[_0xea4d('0x17')]['message']);}})[_0xea4d('0x18')](function(_0x5bdbc0){logger[_0xea4d('0x14')](_0xea4d('0xf'),_0x58f748,_0x5bdbc0);_0x139f1a(_0x5bdbc0);});});} \ No newline at end of file +var _0x50ab=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x59462a,_0x19d7ed){var _0x499b83=function(_0x7c0cf0){while(--_0x7c0cf0){_0x59462a['push'](_0x59462a['shift']());}};_0x499b83(++_0x19d7ed);}(_0x50ab,0xf1));var _0xb50a=function(_0x54b292,_0x4cb287){_0x54b292=_0x54b292-0x0;var _0xc6fec2=_0x50ab[_0x54b292];return _0xc6fec2;};'use strict';var _=require('lodash');var util=require(_0xb50a('0x0'));var moment=require(_0xb50a('0x1'));var BPromise=require(_0xb50a('0x2'));var rs=require(_0xb50a('0x3'));var fs=require('fs');var Redis=require(_0xb50a('0x4'));var db=require(_0xb50a('0x5'))['db'];var utils=require(_0xb50a('0x6'));var logger=require('../../config/logger')(_0xb50a('0x7'));var config=require(_0xb50a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb50a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x482e92,_0x51302c,_0x3a0e10){return new BPromise(function(_0x1831ae,_0x48acbb){return client[_0xb50a('0xa')](_0x482e92,_0x3a0e10)['then'](function(_0x4b6622){logger['info'](_0xb50a('0xb'),_0x51302c,_0xb50a('0xc'));logger['debug'](_0xb50a('0xd'),_0x51302c,_0xb50a('0xc'),JSON[_0xb50a('0xe')](_0x4b6622));if(_0x4b6622[_0xb50a('0xf')]){if(_0x4b6622['error'][_0xb50a('0x10')]===0x1f4){logger[_0xb50a('0xf')](_0xb50a('0xb'),_0x51302c,_0x4b6622[_0xb50a('0xf')][_0xb50a('0x11')]);return _0x48acbb(_0x4b6622[_0xb50a('0xf')][_0xb50a('0x11')]);}logger[_0xb50a('0xf')](_0xb50a('0xb'),_0x51302c,_0x4b6622['error'][_0xb50a('0x11')]);return _0x1831ae(_0x4b6622[_0xb50a('0xf')][_0xb50a('0x11')]);}else{logger[_0xb50a('0x12')](_0xb50a('0xb'),_0x51302c,'request\x20sent');_0x1831ae(_0x4b6622['result'][_0xb50a('0x11')]);}})[_0xb50a('0x13')](function(_0x1c606a){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x51302c,_0x1c606a);_0x48acbb(_0x1c606a);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index e5b237b..16cfb4f 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 _0xb41e=['/:id/transcribe','downloadTranscribe','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads'];(function(_0x2ba963,_0x498036){var _0x4c8cd8=function(_0x1f7cba){while(--_0x1f7cba){_0x2ba963['push'](_0x2ba963['shift']());}};_0x4c8cd8(++_0x498036);}(_0xb41e,0xa3));var _0xeb41=function(_0x5a600a,_0xbdb5b7){_0x5a600a=_0x5a600a-0x0;var _0x35803c=_0xb41e[_0x5a600a];return _0x35803c;};'use strict';var multer=require(_0xeb41('0x0'));var util=require(_0xeb41('0x1'));var path=require(_0xeb41('0x2'));var timeout=require(_0xeb41('0x3'));var express=require(_0xeb41('0x4'));var router=express[_0xeb41('0x5')]();var fs_extra=require(_0xeb41('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xeb41('0x7'));var config=require('../../config/environment');var controller=require(_0xeb41('0x8'));router[_0xeb41('0x9')]('/',auth[_0xeb41('0xa')](),controller['index']);router['get'](_0xeb41('0xb'),auth[_0xeb41('0xa')](),controller[_0xeb41('0xc')]);router[_0xeb41('0x9')](_0xeb41('0xd'),auth['isAuthenticated'](),controller[_0xeb41('0xe')]);router[_0xeb41('0x9')](_0xeb41('0xf'),auth['isAuthenticated'](),controller[_0xeb41('0x10')]);router[_0xeb41('0x9')](_0xeb41('0x11'),controller[_0xeb41('0x12')]);router[_0xeb41('0x9')](_0xeb41('0x13'),auth[_0xeb41('0xa')](),controller[_0xeb41('0x14')]);router['post']('/',auth[_0xeb41('0xa')](),controller['create']);router[_0xeb41('0x15')](_0xeb41('0x13'),auth['isAuthenticated'](),controller['runTranscribe']);router[_0xeb41('0x16')]('/:id',auth[_0xeb41('0xa')](),controller[_0xeb41('0x17')]);router['delete']('/:id',auth[_0xeb41('0xa')](),controller[_0xeb41('0x18')]);module[_0xeb41('0x19')]=router; \ No newline at end of file +var _0xf4d2=['update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','show','download','downloads','/:id/transcribe','post','create','runTranscribe','/:id'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0xf4d2,0x16b));var _0x2f4d=function(_0x2498cb,_0x2bd5f8){_0x2498cb=_0x2498cb-0x0;var _0x1b5588=_0xf4d2[_0x2498cb];return _0x1b5588;};'use strict';var multer=require('multer');var util=require(_0x2f4d('0x0'));var path=require(_0x2f4d('0x1'));var timeout=require(_0x2f4d('0x2'));var express=require(_0x2f4d('0x3'));var router=express[_0x2f4d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2f4d('0x5'));var interaction=require(_0x2f4d('0x6'));var config=require('../../config/environment');var controller=require(_0x2f4d('0x7'));router[_0x2f4d('0x8')]('/',auth[_0x2f4d('0x9')](),controller[_0x2f4d('0xa')]);router['get'](_0x2f4d('0xb'),auth[_0x2f4d('0x9')](),controller[_0x2f4d('0xc')]);router[_0x2f4d('0x8')]('/:id',auth[_0x2f4d('0x9')](),controller[_0x2f4d('0xd')]);router[_0x2f4d('0x8')]('/:id/download',auth[_0x2f4d('0x9')](),controller[_0x2f4d('0xe')]);router[_0x2f4d('0x8')]('/:id/downloads',controller[_0x2f4d('0xf')]);router[_0x2f4d('0x8')](_0x2f4d('0x10'),auth['isAuthenticated'](),controller['downloadTranscribe']);router[_0x2f4d('0x11')]('/',auth[_0x2f4d('0x9')](),controller[_0x2f4d('0x12')]);router[_0x2f4d('0x11')](_0x2f4d('0x10'),auth[_0x2f4d('0x9')](),controller[_0x2f4d('0x13')]);router['put'](_0x2f4d('0x14'),auth[_0x2f4d('0x9')](),controller[_0x2f4d('0x15')]);router['delete']('/:id',auth[_0x2f4d('0x9')](),controller[_0x2f4d('0x16')]);module[_0x2f4d('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 9e02258..bd88666 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(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 0053c18..f882324 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 _0x3781=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','limit','count','offset','Content-Range','json','reject','update','then','destroy','sendStatus','error','stack','name','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','filters','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','intersection','length','find','create','body','params','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','downloads','sequelize','col','$and','push','decryptFile','Sequelize','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','secrets','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','bucket','runSentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format'];(function(_0x50d541,_0x5bca24){var _0x465853=function(_0x145e38){while(--_0x145e38){_0x50d541['push'](_0x50d541['shift']());}};_0x465853(++_0x5bca24);}(_0x3781,0x131));var _0x1378=function(_0x4bb75f,_0x423a32){_0x4bb75f=_0x4bb75f-0x0;var _0x389a29=_0x3781[_0x4bb75f];return _0x389a29;};'use strict';var emlformat=require(_0x1378('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1378('0x1'));var jsonpatch=require(_0x1378('0x2'));var rp=require(_0x1378('0x3'));var moment=require(_0x1378('0x4'));var BPromise=require(_0x1378('0x5'));var Mustache=require(_0x1378('0x6'));var util=require(_0x1378('0x7'));var path=require('path');var sox=require(_0x1378('0x8'));var csv=require(_0x1378('0x9'));var ejs=require(_0x1378('0xa'));var fs=require('fs');var fs_extra=require(_0x1378('0xb'));var _=require('lodash');var squel=require(_0x1378('0xc'));var crypto=require('crypto');var jsforce=require(_0x1378('0xd'));var deskjs=require(_0x1378('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1378('0xf'));var Papa=require('papaparse');var AWS=require(_0x1378('0x10'));var uuidv4=require(_0x1378('0x11'));var Redis=require(_0x1378('0x12'));var authService=require(_0x1378('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1378('0x14'));var hardwareService=require(_0x1378('0x15'));var logger=require('../../config/logger')(_0x1378('0x16'));var utils=require(_0x1378('0x17'));var config=require(_0x1378('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1378('0x19'))['db'];function respondWithStatusCode(_0x14e83a,_0x5c8446){_0x5c8446=_0x5c8446||0xcc;return function(_0x4af7c4){if(_0x4af7c4){return _0x14e83a['sendStatus'](_0x5c8446);}return _0x14e83a[_0x1378('0x1a')](_0x5c8446)[_0x1378('0x1b')]();};}function respondWithResult(_0x17e730,_0x19ace7){_0x19ace7=_0x19ace7||0xc8;return function(_0x52a2c7){if(_0x52a2c7){return _0x17e730[_0x1378('0x1a')](_0x19ace7)['json'](_0x52a2c7);}};}function respondWithFilteredResult(_0x269aba,_0x1d3f4e){return function(_0x4dc530){if(_0x4dc530){var _0x4639e4=typeof _0x1d3f4e['offset']===_0x1378('0x1c')&&typeof _0x1d3f4e[_0x1378('0x1d')]==='undefined';var _0x59e6e6=_0x4dc530[_0x1378('0x1e')];var _0x1aa9b2=_0x4639e4?0x0:_0x1d3f4e['offset'];var _0x210039=_0x4639e4?_0x4dc530['count']:_0x1d3f4e[_0x1378('0x1f')]+_0x1d3f4e[_0x1378('0x1d')];var _0x66288c;if(_0x210039>=_0x59e6e6){_0x210039=_0x59e6e6;_0x66288c=0xc8;}else{_0x66288c=0xce;}_0x269aba[_0x1378('0x1a')](_0x66288c);return _0x269aba['set'](_0x1378('0x20'),_0x1aa9b2+'-'+_0x210039+'/'+_0x59e6e6)[_0x1378('0x21')](_0x4dc530);}return null;};}function patchUpdates(_0x8aafe6){return function(_0x3762ae){try{jsonpatch['apply'](_0x3762ae,_0x8aafe6,!![]);}catch(_0x3f55e2){return BPromise[_0x1378('0x22')](_0x3f55e2);}return _0x3762ae['save']();};}function saveUpdates(_0xab4e17,_0x25acb9){return function(_0x221a48){if(_0x221a48){return _0x221a48[_0x1378('0x23')](_0xab4e17)[_0x1378('0x24')](function(_0x12e395){return _0x12e395;});}return null;};}function removeEntity(_0x2c2354,_0x31c76c){return function(_0x213dc1){if(_0x213dc1){return _0x213dc1[_0x1378('0x25')]()['then'](function(){_0x2c2354[_0x1378('0x1a')](0xcc)[_0x1378('0x1b')]();});}};}function handleEntityNotFound(_0x5af61e,_0xb1b086){return function(_0x4e5e8b){if(!_0x4e5e8b){_0x5af61e[_0x1378('0x26')](0x194);}return _0x4e5e8b;};}function handleError(_0x15cad1,_0x409814){_0x409814=_0x409814||0x1f4;return function(_0x50a4dc){logger[_0x1378('0x27')](_0x50a4dc[_0x1378('0x28')]);if(_0x50a4dc[_0x1378('0x29')]){delete _0x50a4dc[_0x1378('0x29')];}_0x15cad1['status'](_0x409814)['send'](_0x50a4dc);};}exports['index']=function(_0x53e5a2,_0x2946b7){var _0x275952={},_0x1b6f5a={},_0x12318e={'count':0x0,'rows':[]};var _0x531cac=_[_0x1378('0x2a')](db[_0x1378('0x2b')][_0x1378('0x2c')],function(_0x3b4595){return{'name':_0x3b4595[_0x1378('0x2d')],'type':_0x3b4595[_0x1378('0x2e')][_0x1378('0x2f')]};});_0x1b6f5a[_0x1378('0x30')]=_[_0x1378('0x31')](_[_0x1378('0x2a')](_0x531cac,_0x1378('0x29')),[_0x1378('0x32')]);_0x1b6f5a['query']=_['keys'](_0x53e5a2[_0x1378('0x33')]);_0x1b6f5a[_0x1378('0x34')]=_['intersection'](_0x1b6f5a['model'],_0x1b6f5a[_0x1378('0x33')]);_0x275952['attributes']=_['intersection'](_0x1b6f5a[_0x1378('0x30')],qs[_0x1378('0x35')](_0x53e5a2[_0x1378('0x33')]['fields']));_0x275952[_0x1378('0x36')]=_0x275952[_0x1378('0x36')]['length']?_0x275952[_0x1378('0x36')]:_0x1b6f5a[_0x1378('0x30')];if(!_0x53e5a2['query'][_0x1378('0x37')](_0x1378('0x38'))){_0x275952['limit']=qs[_0x1378('0x1d')](_0x53e5a2[_0x1378('0x33')][_0x1378('0x1d')]);_0x275952['offset']=qs[_0x1378('0x1f')](_0x53e5a2[_0x1378('0x33')][_0x1378('0x1f')]);}_0x275952['order']=qs[_0x1378('0x39')](_0x53e5a2[_0x1378('0x33')][_0x1378('0x39')]);_0x275952[_0x1378('0x3a')]=qs[_0x1378('0x34')](_['pick'](_0x53e5a2['query'],_0x1b6f5a[_0x1378('0x34')]),_0x531cac);if(_0x53e5a2[_0x1378('0x33')][_0x1378('0x3b')]){_0x275952[_0x1378('0x3a')]=_[_0x1378('0x3c')](_0x275952[_0x1378('0x3a')],{'$or':_[_0x1378('0x2a')](_0x531cac,function(_0x29bf0a){if(_0x29bf0a[_0x1378('0x2e')]!=='VIRTUAL'){var _0x48eb38={};_0x48eb38[_0x29bf0a[_0x1378('0x29')]]={'$like':'%'+_0x53e5a2[_0x1378('0x33')]['filter']+'%'};return _0x48eb38;}})});}_0x275952=_[_0x1378('0x3c')]({},_0x275952,_0x53e5a2[_0x1378('0x3d')]);var _0x3b54a7={'where':_0x275952[_0x1378('0x3a')]};return db[_0x1378('0x2b')][_0x1378('0x1e')](_0x3b54a7)[_0x1378('0x24')](function(_0x585d9c){_0x12318e[_0x1378('0x1e')]=_0x585d9c;if(_0x53e5a2['query'][_0x1378('0x3e')]){_0x275952[_0x1378('0x3f')]=[{'all':!![]}];}return db[_0x1378('0x2b')][_0x1378('0x40')](_0x275952);})['then'](function(_0x3ec2d3){_0x12318e[_0x1378('0x41')]=_0x3ec2d3;return _0x12318e;})['then'](respondWithFilteredResult(_0x2946b7,_0x275952))[_0x1378('0x42')](handleError(_0x2946b7,null));};exports[_0x1378('0x43')]=function(_0x491f24,_0x1ba4be){var _0xa359b3={'raw':![],'where':{'id':_0x491f24['params']['id']}},_0x11ec1e={};_0x11ec1e[_0x1378('0x30')]=_[_0x1378('0x44')](db[_0x1378('0x2b')][_0x1378('0x2c')]);_0x11ec1e['query']=_['keys'](_0x491f24['query']);_0x11ec1e[_0x1378('0x34')]=_[_0x1378('0x45')](_0x11ec1e[_0x1378('0x30')],_0x11ec1e[_0x1378('0x33')]);_0xa359b3[_0x1378('0x36')]=_[_0x1378('0x45')](_0x11ec1e[_0x1378('0x30')],qs[_0x1378('0x35')](_0x491f24[_0x1378('0x33')][_0x1378('0x35')]));_0xa359b3['attributes']=_0xa359b3['attributes'][_0x1378('0x46')]?_0xa359b3['attributes']:_0x11ec1e[_0x1378('0x30')];if(_0x491f24[_0x1378('0x33')][_0x1378('0x3e')]){_0xa359b3['include']=[{'all':!![]}];}_0xa359b3=_[_0x1378('0x3c')]({},_0xa359b3,_0x491f24[_0x1378('0x3d')]);return db[_0x1378('0x2b')][_0x1378('0x47')](_0xa359b3)['then'](handleEntityNotFound(_0x1ba4be,null))['then'](respondWithResult(_0x1ba4be,null))[_0x1378('0x42')](handleError(_0x1ba4be,null));};exports['create']=function(_0x33f9e5,_0x26a628){return db[_0x1378('0x2b')][_0x1378('0x48')](_0x33f9e5['body'],{})[_0x1378('0x24')](respondWithResult(_0x26a628,0xc9))[_0x1378('0x42')](handleError(_0x26a628,null));};exports[_0x1378('0x23')]=function(_0x3eb738,_0x4aa117){if(_0x3eb738[_0x1378('0x49')]['id']){delete _0x3eb738[_0x1378('0x49')]['id'];}return db[_0x1378('0x2b')]['find']({'where':{'id':_0x3eb738[_0x1378('0x4a')]['id']}})[_0x1378('0x24')](handleEntityNotFound(_0x4aa117,null))[_0x1378('0x24')](saveUpdates(_0x3eb738['body'],null))['then'](respondWithResult(_0x4aa117,null))['catch'](handleError(_0x4aa117,null));};exports[_0x1378('0x4b')]=function(_0x1e6f26,_0x3e5a0f){return db[_0x1378('0x2b')][_0x1378('0x4b')]()[_0x1378('0x24')](respondWithResult(_0x3e5a0f,null))[_0x1378('0x42')](handleError(_0x3e5a0f,null));};exports[_0x1378('0x4c')]=function(_0x37fb8d,_0x293dc8,_0x24ded8){var _0x1140c0=require(_0x1378('0x4d'));var _0x57e4e1=![];var _0x483f23={};if(_0x37fb8d[_0x1378('0x33')][_0x1378('0x2e')]&&_0x37fb8d['query']['type']===_0x1378('0x4e')){_0x483f23['uniqueid']=_0x37fb8d[_0x1378('0x4a')]['id'];}else{_0x483f23['id']=_0x37fb8d[_0x1378('0x4a')]['id'];}return db['VoiceRecording'][_0x1378('0x47')]({'where':_0x483f23,'attributes':['id',_0x1378('0x4f')],'raw':!![]})[_0x1378('0x24')](handleEntityNotFound(_0x293dc8,null))[_0x1378('0x24')](function(_0xe0981a){if(_0xe0981a){var _0x500b63=_0xe0981a['value'];var _0x18df59=util['format'](_0x1378('0x50'),_0x500b63);if(fs[_0x1378('0x51')](_0x18df59)){_0x57e4e1=!![];return _0x1140c0['decryptFile'](_0x18df59,_0x500b63,config['secrets'][_0x1378('0x52')])['then'](function(){return _0xe0981a;});}return _0xe0981a;}})[_0x1378('0x24')](function(_0x583d9e){if(_0x583d9e){var _0x58ec52=_0x583d9e[_0x1378('0x4f')];if(!fs[_0x1378('0x51')](_0x58ec52)){throw new db['Sequelize'][(_0x1378('0x53'))](_0x1378('0x54'));}if(_0x583d9e[_0x1378('0x55')]){return _0x293dc8['download'](_0x58ec52,_0x583d9e[_0x1378('0x55')]+path[_0x1378('0x56')](_0x58ec52),function(){if(_0x57e4e1){fs['unlink'](_0x58ec52);}});}else{return _0x293dc8['download'](_0x58ec52,function(_0x22609c){if(_0x57e4e1){fs[_0x1378('0x57')](_0x58ec52);}});}}})[_0x1378('0x42')](function(_0x36249f){if(_0x36249f[_0x1378('0x58')]===_0x1378('0x54')){_0x293dc8['status'](0x194)[_0x1378('0x59')](_0x1378('0x5a'));}else{return handleError(_0x293dc8,null);}});};exports[_0x1378('0x5b')]=function(_0x435d83,_0x4166bc,_0x7bc5f3){var _0x46ce79=require(_0x1378('0x4d'));var _0xd92dbc=![];var _0x32e79d={'$and':[db[_0x1378('0x5c')][_0x1378('0x3a')](db[_0x1378('0x5c')]['fn']('MD5',db[_0x1378('0x5c')][_0x1378('0x5d')](_0x1378('0x4e'))),_0x435d83['query']['token'])]};if(_0x435d83[_0x1378('0x33')][_0x1378('0x2e')]&&_0x435d83['query'][_0x1378('0x2e')]===_0x1378('0x4e')){_0x32e79d[_0x1378('0x5e')]['push']({'uniqueid':_0x435d83['params']['id']});}else{_0x32e79d['$and'][_0x1378('0x5f')]({'id':_0x435d83[_0x1378('0x4a')]['id']});}return db[_0x1378('0x2b')]['find']({'where':_0x32e79d,'attributes':['id',_0x1378('0x4f')],'raw':!![]})[_0x1378('0x24')](handleEntityNotFound(_0x4166bc,null))['then'](function(_0x3f03a3){if(_0x3f03a3){var _0x319371=util[_0x1378('0x32')]('%s.cypher',_0x3f03a3['value']);if(fs['existsSync'](_0x319371)){_0xd92dbc=!![];return _0x46ce79[_0x1378('0x60')](_0x319371,_0x3f03a3[_0x1378('0x4f')],config['secrets'][_0x1378('0x52')])[_0x1378('0x24')](function(){return _0x3f03a3;});}return _0x3f03a3;}})[_0x1378('0x24')](function(_0x4c083b){if(_0x4c083b){if(!fs['existsSync'](_0x4c083b[_0x1378('0x4f')])){throw new db[(_0x1378('0x61'))][(_0x1378('0x53'))]('VoiceRecording\x20not\x20found');}if(_0x4c083b['filename']){return _0x4166bc[_0x1378('0x4c')](_0x4c083b[_0x1378('0x4f')],_0x4c083b[_0x1378('0x55')]+path[_0x1378('0x56')](_0x4c083b[_0x1378('0x4f')]),function(){if(_0xd92dbc){fs['unlink'](_0x4c083b[_0x1378('0x4f')]);}});}else{return _0x4166bc[_0x1378('0x4c')](_0x4c083b[_0x1378('0x4f')],function(_0x2b11ef){if(_0xd92dbc){fs[_0x1378('0x57')](_0x4c083b[_0x1378('0x4f')]);}});}}})['catch'](handleError(_0x4166bc,null));};exports['destroy']=function(_0x4e848a,_0x3d3e4f){return db['VoiceRecording'][_0x1378('0x47')]({'where':{'id':_0x4e848a[_0x1378('0x4a')]['id']}})[_0x1378('0x24')](function(_0x4727ac){if(_[_0x1378('0x62')](_0x4727ac)){throw new ReferenceError(_0x1378('0x63'));}return _0x4727ac;})[_0x1378('0x24')](function(_0x2aae6b){var _0x386a79=_0x2aae6b[_0x1378('0x4f')];logger['info'](_0x1378('0x64'),_0x386a79);if(!_[_0x1378('0x62')](_0x2aae6b[_0x1378('0x4f')])&&fs[_0x1378('0x51')](_0x386a79)){logger[_0x1378('0x65')](_0x1378('0x66')+_0x386a79+_0x1378('0x67'));fs['unlinkSync'](_0x386a79);}_0x386a79=_0x386a79+_0x1378('0x68');if(!_[_0x1378('0x62')](_0x2aae6b[_0x1378('0x4f')])&&fs['existsSync'](_0x386a79)){logger[_0x1378('0x65')](_0x1378('0x66')+_0x386a79+_0x1378('0x67'));fs[_0x1378('0x69')](_0x386a79);}return _0x2aae6b;})[_0x1378('0x24')](function(_0x1b500d){if(!_0x1b500d)throw new InternalError();return _0x1b500d[_0x1378('0x25')]();})[_0x1378('0x24')](function(){_0x3d3e4f[_0x1378('0x1a')](0xcc)[_0x1378('0x1b')]();})[_0x1378('0x42')](handleError(_0x3d3e4f,null));};function getBucketslist(_0x19ad57,_0x5cb124,_0x3b77e9){return new Promise(function(_0x4aaf90,_0x4096af){var _0x4635c3=new AWS['S3']({'accessKeyId':_0x5cb124,'secretAccessKey':_0x19ad57,'region':_0x3b77e9});_0x4635c3[_0x1378('0x6a')]({},function(_0x127aa1,_0x35703a){if(_0x127aa1){return _0x4096af(_0x127aa1);}else{return _0x4aaf90(_0x35703a);}});});}function createBucket(_0x427737,_0x4699e1,_0x1b71de,_0x5c63fe){return new Promise(function(_0x47496d,_0x31a6fb){var _0x4f0859=new AWS['S3']({'accessKeyId':_0x4699e1,'secretAccessKey':_0x427737,'region':_0x1b71de});_0x4f0859['createBucket']({'Bucket':_0x5c63fe},function(_0x157446,_0x58af4f){if(_0x157446){return _0x31a6fb(_0x157446);}else{return _0x47496d(_0x58af4f);}});});}function uploadFile(_0x1e90b6,_0x808f6e,_0xe7b2ab,_0x19c2a7,_0x4e0746,_0x59e5f1){return new Promise(function(_0xebbb57,_0x1f9168){var _0x39ac89=new AWS['S3']({'accessKeyId':_0x808f6e,'secretAccessKey':_0x1e90b6,'region':_0xe7b2ab});_0x39ac89[_0x1378('0x6b')]({'Bucket':_0x19c2a7,'Key':_0x4e0746,'Body':_0x59e5f1},function(_0x4d2a9f,_0x528a8b){if(_0x4d2a9f){return _0x1f9168(_0x4d2a9f);}else{return _0xebbb57(_0x528a8b);}});});}function startTranscribe(_0x55ed80,_0x61e568,_0x1d4765,_0x375e31,_0x2b6a79,_0x5b7438){return new Promise(function(_0x3dea63,_0x4ef766){var _0x2a9318=new AWS[(_0x1378('0x6c'))]({'accessKeyId':_0x61e568,'secretAccessKey':_0x55ed80,'region':_0x1d4765});_0x2a9318[_0x1378('0x6d')]({'TranscriptionJobName':_0x375e31,'LanguageCode':_0x2b6a79,'Media':{'MediaFileUri':_0x5b7438}},function(_0x1b7c76,_0x53d274){if(_0x1b7c76){return _0x4ef766(_0x1b7c76);}else{return _0x3dea63(_0x53d274);}});});}function transcribe(_0xb7f403,_0x813aaf,_0x452772,_0x4f9687,_0x515d91,_0x36a877,_0x19e47e){return new Promise(function(_0x5add40,_0x58d95d){var _0x3e7339={};logger['info'](util[_0x1378('0x32')](_0x1378('0x6e'),_0xb7f403,_0x515d91));return uploadFile(_0x813aaf,_0x452772,_0x4f9687,_0x515d91,path[_0x1378('0x6f')](_0x36a877),fs[_0x1378('0x70')](_0x36a877))[_0x1378('0x24')](function(_0x4d2fc8){logger[_0x1378('0x65')](util['format']('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0xb7f403,_0x515d91,_0x4d2fc8[_0x1378('0x71')]));_0x3e7339['bucket']=_0x4d2fc8['Bucket'];_0x3e7339[_0x1378('0x72')]=_0x4d2fc8[_0x1378('0x71')];logger[_0x1378('0x65')](util['format']('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0xb7f403));return startTranscribe(_0x813aaf,_0x452772,_0x4f9687,uuidv4(),_0x19e47e,_0x4d2fc8['Location']);})[_0x1378('0x24')](function(_0x5c0f9d){logger['info'](util[_0x1378('0x32')](_0x1378('0x73'),_0xb7f403,_0x5c0f9d[_0x1378('0x74')][_0x1378('0x75')]));_0x3e7339[_0x1378('0x76')]=_0x5c0f9d[_0x1378('0x74')][_0x1378('0x75')];_0x3e7339[_0x1378('0x77')]=_0x5c0f9d[_0x1378('0x74')][_0x1378('0x78')];return _0x5add40(_0x3e7339);})['catch'](function(_0x3871bf){return _0x58d95d(_0x3871bf);});});}exports[_0x1378('0x79')]=function(_0x3f52b9,_0xbbb268,_0x24d736){var _0x188297;var _0x375c1d;var _0x28935a;var _0x2a414a=require(_0x1378('0x4d'));return db['VoiceRecording'][_0x1378('0x7a')]({'where':{'id':_0x3f52b9[_0x1378('0x4a')]['id']}})[_0x1378('0x24')](function(_0x48648b){if(_0x48648b){var _0x15eb5b=util['format'](_0x1378('0x50'),_0x48648b['value']);if(fs[_0x1378('0x51')](_0x15eb5b)){cypher=!![];return _0x2a414a[_0x1378('0x60')](_0x15eb5b,_0x48648b[_0x1378('0x4f')],config[_0x1378('0x7b')]['recording'])['then'](function(){return _0x48648b;});}return _0x48648b;}})[_0x1378('0x24')](function(_0xd12e78){if(!_0xd12e78){throw new db['Sequelize']['ValidationError'](_0x1378('0x7c'));}_0x375c1d=_0xd12e78;return db[_0x1378('0x7d')][_0x1378('0x7a')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0xbbb268,null))[_0x1378('0x24')](function(_0x1847dc){if(_0x1847dc){_0x188297=_0x1847dc;if(!_0x188297[_0x1378('0x7e')]||!_0x188297[_0x1378('0x7f')]||!_0x188297[_0x1378('0x80')]||!_0x188297[_0x1378('0x81')]||!_0x188297[_0x1378('0x82')]){throw new db[(_0x1378('0x61'))][(_0x1378('0x53'))]('Transcribe\x20not\x20configured');}if(_0x3f52b9[_0x1378('0x49')][_0x1378('0x83')]&&(!_0x188297['sentiment']||!_0x188297[_0x1378('0x84')]||!_0x188297['sentimentRegion']||!_0x188297['language']||!_0x188297[_0x1378('0x82')])){throw new db[(_0x1378('0x61'))][(_0x1378('0x53'))](_0x1378('0x85'));}return db[_0x1378('0x86')][_0x1378('0x7a')]({'where':{'id':_0x188297[_0x1378('0x7f')]}});}})['then'](function(_0x9483fe){if(!_0x9483fe){throw new db['Sequelize']['ValidationError'](_0x1378('0x87'));}if(!_0x9483fe[_0x1378('0x88')]||!_0x9483fe[_0x1378('0x89')]){throw new db['Sequelize']['ValidationError'](_0x1378('0x8a'));}_0x28935a=_0x9483fe;return getBucketslist(_0x28935a['data1'],_0x28935a[_0x1378('0x89')],_0x188297[_0x1378('0x80')]);})[_0x1378('0x24')](function(_0x4d888b){if(_0x4d888b&&_0x4d888b['Buckets']){var _0x580649=_[_0x1378('0x47')](_0x4d888b[_0x1378('0x8b')],function(_0x303409){return _0x303409['Name']===_0x188297[_0x1378('0x82')];});if(!_0x580649){logger[_0x1378('0x65')](util[_0x1378('0x32')](_0x1378('0x8c'),_0x3f52b9['params']['id'],_0x188297[_0x1378('0x82')]));return createBucket(_0x28935a[_0x1378('0x88')],_0x28935a[_0x1378('0x89')],_0x188297[_0x1378('0x80')],_0x188297[_0x1378('0x82')]);}logger['info'](util[_0x1378('0x32')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x3f52b9[_0x1378('0x4a')]['id'],_0x188297[_0x1378('0x82')]));return;}})[_0x1378('0x24')](function(_0x3f03e6){if(_0x375c1d[_0x1378('0x77')]===_0x1378('0x8d')){return transcribe(_0x3f52b9[_0x1378('0x4a')]['id'],_0x28935a['data1'],_0x28935a[_0x1378('0x89')],_0x188297['transcribeRegion'],_0x188297[_0x1378('0x82')],_0x375c1d['value'],_0x188297[_0x1378('0x81')]);}else{logger[_0x1378('0x65')](util[_0x1378('0x32')](_0x1378('0x8e'),_0x3f52b9[_0x1378('0x4a')]['id']));return{'transcribeStatus':_0x1378('0x8f')};}})['then'](function(_0x5d22b1){if(_0x5d22b1){_0x5d22b1[_0x1378('0x90')]=_0x3f52b9['body'][_0x1378('0x83')];return _0x375c1d[_0x1378('0x91')](_0x5d22b1);}})[_0x1378('0x24')](respondWithResult(_0xbbb268,null))[_0x1378('0x42')](handleError(_0xbbb268,null));};function writeFile(_0x13865f,_0x417e7d){return new Promise(function(_0x1257c3,_0x2b978d){fs[_0x1378('0x92')](_0x417e7d,_0x13865f,function(_0x105049,_0xaf8e0f){if(_0x105049){return _0x2b978d(_0x105049);}else{return _0x1257c3(_0xaf8e0f);}});});}exports[_0x1378('0x93')]=function(_0xd1bf27,_0x196ca3,_0x516252){return db[_0x1378('0x2b')][_0x1378('0x7a')]({'where':{'id':_0xd1bf27[_0x1378('0x4a')]['id']}})[_0x1378('0x24')](handleEntityNotFound(_0x196ca3))[_0x1378('0x24')](function(_0x2fc463){if(_0x2fc463&&_0x2fc463[_0x1378('0x94')]){var _0x1ff499=_0x2fc463['fileText'];var _0x15ad6a=config[_0x1378('0x95')]+_0x1378('0x96')+_0x2fc463['id']+_0x1378('0x97');if(fs[_0x1378('0x51')](_0x15ad6a)){return _0x15ad6a;}return writeFile(_0x1ff499,_0x15ad6a)['then'](function(){return _0x15ad6a;});}else{throw new db['Sequelize'][(_0x1378('0x53'))](_0x1378('0x98'));}})[_0x1378('0x24')](function(_0x2a19e3){return _0x196ca3[_0x1378('0x4c')](_0x2a19e3);})[_0x1378('0x42')](handleError(_0x196ca3));}; \ No newline at end of file +var _0x57f3=['runSentiment','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','fast-json-patch','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','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','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','VoiceRecording','rawAttributes','key','model','differenceBy','map','format','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','options','includeAll','include','rows','catch','show','params','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','$and','push','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[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','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','findOne','recording','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS'];(function(_0x55e048,_0x531b9e){var _0x1eaa93=function(_0x52fbde){while(--_0x52fbde){_0x55e048['push'](_0x55e048['shift']());}};_0x1eaa93(++_0x531b9e);}(_0x57f3,0xa1));var _0x357f=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x57f3[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x357f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x357f('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x357f('0x2'));var path=require(_0x357f('0x3'));var sox=require(_0x357f('0x4'));var csv=require(_0x357f('0x5'));var ejs=require(_0x357f('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x357f('0x7'));var squel=require(_0x357f('0x8'));var crypto=require(_0x357f('0x9'));var jsforce=require(_0x357f('0xa'));var deskjs=require(_0x357f('0xb'));var toCsv=require(_0x357f('0x5'));var querystring=require(_0x357f('0xc'));var Papa=require(_0x357f('0xd'));var AWS=require(_0x357f('0xe'));var uuidv4=require(_0x357f('0xf'));var Redis=require(_0x357f('0x10'));var authService=require(_0x357f('0x11'));var qs=require(_0x357f('0x12'));var as=require(_0x357f('0x13'));var hardwareService=require(_0x357f('0x14'));var logger=require(_0x357f('0x15'))(_0x357f('0x16'));var utils=require(_0x357f('0x17'));var config=require(_0x357f('0x18'));var licenseUtil=require(_0x357f('0x19'));var db=require(_0x357f('0x1a'))['db'];function respondWithStatusCode(_0x12a718,_0x21a86c){_0x21a86c=_0x21a86c||0xcc;return function(_0x46ccbe){if(_0x46ccbe){return _0x12a718[_0x357f('0x1b')](_0x21a86c);}return _0x12a718[_0x357f('0x1c')](_0x21a86c)['end']();};}function respondWithResult(_0x188b62,_0x5ad2c1){_0x5ad2c1=_0x5ad2c1||0xc8;return function(_0x3851e6){if(_0x3851e6){return _0x188b62['status'](_0x5ad2c1)[_0x357f('0x1d')](_0x3851e6);}};}function respondWithFilteredResult(_0x21f542,_0x592da7){return function(_0x3a12c3){if(_0x3a12c3){var _0x54a067=typeof _0x592da7[_0x357f('0x1e')]==='undefined'&&typeof _0x592da7[_0x357f('0x1f')]===_0x357f('0x20');var _0x3abaf5=_0x3a12c3[_0x357f('0x21')];var _0x38ed32=_0x54a067?0x0:_0x592da7[_0x357f('0x1e')];var _0x2e6ae9=_0x54a067?_0x3a12c3[_0x357f('0x21')]:_0x592da7['offset']+_0x592da7[_0x357f('0x1f')];var _0x6d0e98;if(_0x2e6ae9>=_0x3abaf5){_0x2e6ae9=_0x3abaf5;_0x6d0e98=0xc8;}else{_0x6d0e98=0xce;}_0x21f542[_0x357f('0x1c')](_0x6d0e98);return _0x21f542[_0x357f('0x22')](_0x357f('0x23'),_0x38ed32+'-'+_0x2e6ae9+'/'+_0x3abaf5)[_0x357f('0x1d')](_0x3a12c3);}return null;};}function patchUpdates(_0xf52fd3){return function(_0x5333a8){try{jsonpatch[_0x357f('0x24')](_0x5333a8,_0xf52fd3,!![]);}catch(_0x10fe6a){return BPromise[_0x357f('0x25')](_0x10fe6a);}return _0x5333a8[_0x357f('0x26')]();};}function saveUpdates(_0x19fa0a,_0xc8589c){return function(_0x514ebc){if(_0x514ebc){return _0x514ebc[_0x357f('0x27')](_0x19fa0a)[_0x357f('0x28')](function(_0x5e7940){return _0x5e7940;});}return null;};}function removeEntity(_0x4c1803,_0x59a5b8){return function(_0xe2732e){if(_0xe2732e){return _0xe2732e[_0x357f('0x29')]()[_0x357f('0x28')](function(){_0x4c1803[_0x357f('0x1c')](0xcc)[_0x357f('0x2a')]();});}};}function handleEntityNotFound(_0x4a084d,_0x2f9ba0){return function(_0x6a4d5f){if(!_0x6a4d5f){_0x4a084d[_0x357f('0x1b')](0x194);}return _0x6a4d5f;};}function handleError(_0x411c82,_0x590caa){_0x590caa=_0x590caa||0x1f4;return function(_0x12daf4){logger['error'](_0x12daf4[_0x357f('0x2b')]);if(_0x12daf4[_0x357f('0x2c')]){delete _0x12daf4['name'];}_0x411c82[_0x357f('0x1c')](_0x590caa)[_0x357f('0x2d')](_0x12daf4);};}exports[_0x357f('0x2e')]=function(_0x432f3a,_0x236530){var _0x5c54e5={},_0x35ef97={},_0x5300cc={'count':0x0,'rows':[]};var _0x24cd58=_['map'](db[_0x357f('0x2f')][_0x357f('0x30')],function(_0x29c517){return{'name':_0x29c517['fieldName'],'type':_0x29c517['type'][_0x357f('0x31')]};});_0x35ef97[_0x357f('0x32')]=_[_0x357f('0x33')](_[_0x357f('0x34')](_0x24cd58,_0x357f('0x2c')),[_0x357f('0x35')]);_0x35ef97[_0x357f('0x36')]=_[_0x357f('0x37')](_0x432f3a[_0x357f('0x36')]);_0x35ef97[_0x357f('0x38')]=_[_0x357f('0x39')](_0x35ef97[_0x357f('0x32')],_0x35ef97[_0x357f('0x36')]);_0x5c54e5['attributes']=_['intersection'](_0x35ef97['model'],qs[_0x357f('0x3a')](_0x432f3a[_0x357f('0x36')][_0x357f('0x3a')]));_0x5c54e5[_0x357f('0x3b')]=_0x5c54e5[_0x357f('0x3b')][_0x357f('0x3c')]?_0x5c54e5[_0x357f('0x3b')]:_0x35ef97[_0x357f('0x32')];if(!_0x432f3a['query'][_0x357f('0x3d')]('nolimit')){_0x5c54e5[_0x357f('0x1f')]=qs[_0x357f('0x1f')](_0x432f3a[_0x357f('0x36')][_0x357f('0x1f')]);_0x5c54e5[_0x357f('0x1e')]=qs[_0x357f('0x1e')](_0x432f3a[_0x357f('0x36')][_0x357f('0x1e')]);}_0x5c54e5['order']=qs['sort'](_0x432f3a[_0x357f('0x36')][_0x357f('0x3e')]);_0x5c54e5[_0x357f('0x3f')]=qs[_0x357f('0x38')](_[_0x357f('0x40')](_0x432f3a['query'],_0x35ef97[_0x357f('0x38')]),_0x24cd58);if(_0x432f3a[_0x357f('0x36')][_0x357f('0x41')]){_0x5c54e5[_0x357f('0x3f')]=_[_0x357f('0x42')](_0x5c54e5[_0x357f('0x3f')],{'$or':_[_0x357f('0x34')](_0x24cd58,function(_0x34c888){if(_0x34c888[_0x357f('0x43')]!=='VIRTUAL'){var _0x583fae={};_0x583fae[_0x34c888[_0x357f('0x2c')]]={'$like':'%'+_0x432f3a[_0x357f('0x36')][_0x357f('0x41')]+'%'};return _0x583fae;}})});}_0x5c54e5=_['merge']({},_0x5c54e5,_0x432f3a[_0x357f('0x44')]);var _0x2e50cf={'where':_0x5c54e5[_0x357f('0x3f')]};return db[_0x357f('0x2f')][_0x357f('0x21')](_0x2e50cf)['then'](function(_0x1fed46){_0x5300cc[_0x357f('0x21')]=_0x1fed46;if(_0x432f3a['query'][_0x357f('0x45')]){_0x5c54e5[_0x357f('0x46')]=[{'all':!![]}];}return db[_0x357f('0x2f')]['findAll'](_0x5c54e5);})[_0x357f('0x28')](function(_0x57c86b){_0x5300cc[_0x357f('0x47')]=_0x57c86b;return _0x5300cc;})[_0x357f('0x28')](respondWithFilteredResult(_0x236530,_0x5c54e5))[_0x357f('0x48')](handleError(_0x236530,null));};exports[_0x357f('0x49')]=function(_0x2760bb,_0x1175b8){var _0xdb2dc5={'raw':![],'where':{'id':_0x2760bb[_0x357f('0x4a')]['id']}},_0x5684e7={};_0x5684e7[_0x357f('0x32')]=_[_0x357f('0x37')](db[_0x357f('0x2f')][_0x357f('0x30')]);_0x5684e7[_0x357f('0x36')]=_[_0x357f('0x37')](_0x2760bb[_0x357f('0x36')]);_0x5684e7[_0x357f('0x38')]=_['intersection'](_0x5684e7[_0x357f('0x32')],_0x5684e7[_0x357f('0x36')]);_0xdb2dc5[_0x357f('0x3b')]=_[_0x357f('0x39')](_0x5684e7[_0x357f('0x32')],qs[_0x357f('0x3a')](_0x2760bb['query']['fields']));_0xdb2dc5[_0x357f('0x3b')]=_0xdb2dc5[_0x357f('0x3b')]['length']?_0xdb2dc5[_0x357f('0x3b')]:_0x5684e7[_0x357f('0x32')];if(_0x2760bb[_0x357f('0x36')]['includeAll']){_0xdb2dc5[_0x357f('0x46')]=[{'all':!![]}];}_0xdb2dc5=_[_0x357f('0x42')]({},_0xdb2dc5,_0x2760bb[_0x357f('0x44')]);return db['VoiceRecording'][_0x357f('0x4b')](_0xdb2dc5)[_0x357f('0x28')](handleEntityNotFound(_0x1175b8,null))[_0x357f('0x28')](respondWithResult(_0x1175b8,null))[_0x357f('0x48')](handleError(_0x1175b8,null));};exports['create']=function(_0xea2d8d,_0x376fac){return db[_0x357f('0x2f')][_0x357f('0x4c')](_0xea2d8d['body'],{})[_0x357f('0x28')](respondWithResult(_0x376fac,0xc9))['catch'](handleError(_0x376fac,null));};exports[_0x357f('0x27')]=function(_0x3a2888,_0x4d37e8){if(_0x3a2888[_0x357f('0x4d')]['id']){delete _0x3a2888['body']['id'];}return db[_0x357f('0x2f')][_0x357f('0x4b')]({'where':{'id':_0x3a2888['params']['id']}})['then'](handleEntityNotFound(_0x4d37e8,null))['then'](saveUpdates(_0x3a2888[_0x357f('0x4d')],null))[_0x357f('0x28')](respondWithResult(_0x4d37e8,null))[_0x357f('0x48')](handleError(_0x4d37e8,null));};exports[_0x357f('0x4e')]=function(_0x3f0264,_0xf0a9da){return db[_0x357f('0x2f')][_0x357f('0x4e')]()[_0x357f('0x28')](respondWithResult(_0xf0a9da,null))[_0x357f('0x48')](handleError(_0xf0a9da,null));};exports[_0x357f('0x4f')]=function(_0x4bab6c,_0x2a84be,_0x420d2a){var _0x4b4488=require(_0x357f('0x50'));var _0x2be2b7=![];var _0x16dd89={};if(_0x4bab6c[_0x357f('0x36')][_0x357f('0x43')]&&_0x4bab6c['query'][_0x357f('0x43')]===_0x357f('0x51')){_0x16dd89[_0x357f('0x51')]=_0x4bab6c[_0x357f('0x4a')]['id'];}else{_0x16dd89['id']=_0x4bab6c['params']['id'];}return db[_0x357f('0x2f')]['find']({'where':_0x16dd89,'attributes':['id',_0x357f('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x2a84be,null))['then'](function(_0x2c7fe9){if(_0x2c7fe9){var _0x16ebe0=_0x2c7fe9['value'];var _0x4c463c=util['format'](_0x357f('0x53'),_0x16ebe0);if(fs[_0x357f('0x54')](_0x4c463c)){_0x2be2b7=!![];return _0x4b4488[_0x357f('0x55')](_0x4c463c,_0x16ebe0,config[_0x357f('0x56')]['recording'])[_0x357f('0x28')](function(){return _0x2c7fe9;});}return _0x2c7fe9;}})[_0x357f('0x28')](function(_0x3c1c99){if(_0x3c1c99){var _0x1861c4=_0x3c1c99[_0x357f('0x52')];if(!fs[_0x357f('0x54')](_0x1861c4)){throw new db[(_0x357f('0x57'))][(_0x357f('0x58'))](_0x357f('0x59'));}if(_0x3c1c99['filename']){return _0x2a84be[_0x357f('0x4f')](_0x1861c4,_0x3c1c99[_0x357f('0x5a')]+path[_0x357f('0x5b')](_0x1861c4),function(){if(_0x2be2b7){fs[_0x357f('0x5c')](_0x1861c4);}});}else{return _0x2a84be['download'](_0x1861c4,function(_0x482479){if(_0x2be2b7){fs[_0x357f('0x5c')](_0x1861c4);}});}}})['catch'](function(_0x4f859c){if(_0x4f859c[_0x357f('0x5d')]===_0x357f('0x59')){_0x2a84be['status'](0x194)[_0x357f('0x2d')](_0x357f('0x5e'));}else{return handleError(_0x2a84be,null);}});};exports[_0x357f('0x5f')]=function(_0x1a2ac2,_0x55afa0,_0xb57d2d){var _0x289a68=require(_0x357f('0x50'));var _0x3f5192=![];var _0x2f8946={'$and':[db[_0x357f('0x60')]['where'](db[_0x357f('0x60')]['fn'](_0x357f('0x61'),db[_0x357f('0x60')]['col'](_0x357f('0x51'))),_0x1a2ac2[_0x357f('0x36')]['token'])]};if(_0x1a2ac2[_0x357f('0x36')][_0x357f('0x43')]&&_0x1a2ac2[_0x357f('0x36')][_0x357f('0x43')]==='uniqueid'){_0x2f8946[_0x357f('0x62')][_0x357f('0x63')]({'uniqueid':_0x1a2ac2['params']['id']});}else{_0x2f8946[_0x357f('0x62')][_0x357f('0x63')]({'id':_0x1a2ac2['params']['id']});}return db['VoiceRecording'][_0x357f('0x4b')]({'where':_0x2f8946,'attributes':['id',_0x357f('0x52')],'raw':!![]})[_0x357f('0x28')](handleEntityNotFound(_0x55afa0,null))[_0x357f('0x28')](function(_0x373f4c){if(_0x373f4c){var _0x2b868e=util[_0x357f('0x35')]('%s.cypher',_0x373f4c[_0x357f('0x52')]);if(fs[_0x357f('0x54')](_0x2b868e)){_0x3f5192=!![];return _0x289a68[_0x357f('0x55')](_0x2b868e,_0x373f4c[_0x357f('0x52')],config[_0x357f('0x56')]['recording'])[_0x357f('0x28')](function(){return _0x373f4c;});}return _0x373f4c;}})[_0x357f('0x28')](function(_0x2c1f62){if(_0x2c1f62){if(!fs[_0x357f('0x54')](_0x2c1f62['value'])){throw new db[(_0x357f('0x57'))][(_0x357f('0x58'))](_0x357f('0x59'));}if(_0x2c1f62['filename']){return _0x55afa0[_0x357f('0x4f')](_0x2c1f62[_0x357f('0x52')],_0x2c1f62[_0x357f('0x5a')]+path['extname'](_0x2c1f62[_0x357f('0x52')]),function(){if(_0x3f5192){fs['unlink'](_0x2c1f62['value']);}});}else{return _0x55afa0[_0x357f('0x4f')](_0x2c1f62[_0x357f('0x52')],function(_0xc15094){if(_0x3f5192){fs[_0x357f('0x5c')](_0x2c1f62[_0x357f('0x52')]);}});}}})[_0x357f('0x48')](handleError(_0x55afa0,null));};exports[_0x357f('0x29')]=function(_0x3a55c4,_0x3eec9d){return db[_0x357f('0x2f')][_0x357f('0x4b')]({'where':{'id':_0x3a55c4[_0x357f('0x4a')]['id']}})[_0x357f('0x28')](function(_0x112025){if(_[_0x357f('0x64')](_0x112025)){throw new ReferenceError(_0x357f('0x65'));}return _0x112025;})[_0x357f('0x28')](function(_0x2cd332){var _0x472164=_0x2cd332[_0x357f('0x52')];logger[_0x357f('0x66')](_0x357f('0x67'),_0x472164);if(!_['isNil'](_0x2cd332[_0x357f('0x52')])&&fs[_0x357f('0x54')](_0x472164)){logger[_0x357f('0x66')](_0x357f('0x68')+_0x472164+_0x357f('0x69'));fs[_0x357f('0x6a')](_0x472164);}_0x472164=_0x472164+'.cypher';if(!_[_0x357f('0x64')](_0x2cd332[_0x357f('0x52')])&&fs[_0x357f('0x54')](_0x472164)){logger[_0x357f('0x66')](_0x357f('0x68')+_0x472164+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x357f('0x6a')](_0x472164);}return _0x2cd332;})[_0x357f('0x28')](function(_0x324437){if(!_0x324437)throw new InternalError();return _0x324437[_0x357f('0x29')]();})[_0x357f('0x28')](function(){_0x3eec9d['status'](0xcc)[_0x357f('0x2a')]();})[_0x357f('0x48')](handleError(_0x3eec9d,null));};function getBucketslist(_0x4c23ec,_0x59eda0,_0x242ae1){return new Promise(function(_0x38556c,_0x211d23){var _0x472042=new AWS['S3']({'accessKeyId':_0x59eda0,'secretAccessKey':_0x4c23ec,'region':_0x242ae1});_0x472042[_0x357f('0x6b')]({},function(_0x126309,_0x7e4279){if(_0x126309){return _0x211d23(_0x126309);}else{return _0x38556c(_0x7e4279);}});});}function createBucket(_0x1ccd54,_0x5aee2b,_0x4137a2,_0x4dbc50){return new Promise(function(_0x28f99b,_0xe0092f){var _0xfb8754=new AWS['S3']({'accessKeyId':_0x5aee2b,'secretAccessKey':_0x1ccd54,'region':_0x4137a2});_0xfb8754[_0x357f('0x6c')]({'Bucket':_0x4dbc50},function(_0x2d2bd1,_0x59b09e){if(_0x2d2bd1){return _0xe0092f(_0x2d2bd1);}else{return _0x28f99b(_0x59b09e);}});});}function uploadFile(_0xa1cd10,_0x23058e,_0x3fc6b9,_0x2c7516,_0x3d9941,_0x29cac4){return new Promise(function(_0x17f391,_0x1b2c1b){var _0x258ef9=new AWS['S3']({'accessKeyId':_0x23058e,'secretAccessKey':_0xa1cd10,'region':_0x3fc6b9});_0x258ef9[_0x357f('0x6d')]({'Bucket':_0x2c7516,'Key':_0x3d9941,'Body':_0x29cac4},function(_0x182093,_0x4276d9){if(_0x182093){return _0x1b2c1b(_0x182093);}else{return _0x17f391(_0x4276d9);}});});}function startTranscribe(_0x43a93d,_0x2e20f1,_0x4d43ad,_0x402127,_0x11fd7f,_0x2c6232){return new Promise(function(_0x4a0894,_0x256534){var _0xefbca1=new AWS[(_0x357f('0x6e'))]({'accessKeyId':_0x2e20f1,'secretAccessKey':_0x43a93d,'region':_0x4d43ad});_0xefbca1[_0x357f('0x6f')]({'TranscriptionJobName':_0x402127,'LanguageCode':_0x11fd7f,'Media':{'MediaFileUri':_0x2c6232}},function(_0x46ee1c,_0x4ad638){if(_0x46ee1c){return _0x256534(_0x46ee1c);}else{return _0x4a0894(_0x4ad638);}});});}function transcribe(_0x528f2d,_0x3f21fa,_0x23ce37,_0x10e0ef,_0x31e433,_0x171fd0,_0x424fc6){return new Promise(function(_0x1aa324,_0x2da803){var _0x15a877={};logger[_0x357f('0x66')](util[_0x357f('0x35')](_0x357f('0x70'),_0x528f2d,_0x31e433));return uploadFile(_0x3f21fa,_0x23ce37,_0x10e0ef,_0x31e433,path[_0x357f('0x71')](_0x171fd0),fs[_0x357f('0x72')](_0x171fd0))[_0x357f('0x28')](function(_0x3b78ba){logger[_0x357f('0x66')](util[_0x357f('0x35')](_0x357f('0x73'),_0x528f2d,_0x31e433,_0x3b78ba[_0x357f('0x74')]));_0x15a877[_0x357f('0x75')]=_0x3b78ba[_0x357f('0x76')];_0x15a877[_0x357f('0x77')]=_0x3b78ba[_0x357f('0x74')];logger[_0x357f('0x66')](util['format']('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x528f2d));return startTranscribe(_0x3f21fa,_0x23ce37,_0x10e0ef,uuidv4(),_0x424fc6,_0x3b78ba['Location']);})[_0x357f('0x28')](function(_0xe58258){logger[_0x357f('0x66')](util[_0x357f('0x35')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x528f2d,_0xe58258['TranscriptionJob'][_0x357f('0x78')]));_0x15a877[_0x357f('0x79')]=_0xe58258[_0x357f('0x7a')][_0x357f('0x78')];_0x15a877[_0x357f('0x7b')]=_0xe58258['TranscriptionJob']['TranscriptionJobStatus'];return _0x1aa324(_0x15a877);})[_0x357f('0x48')](function(_0x176ad5){return _0x2da803(_0x176ad5);});});}exports['runTranscribe']=function(_0x19d494,_0x357dd1,_0x404f96){var _0x5284dc;var _0x1687fd;var _0x433871;var _0x277e1d=require(_0x357f('0x50'));return db['VoiceRecording'][_0x357f('0x7c')]({'where':{'id':_0x19d494['params']['id']}})[_0x357f('0x28')](function(_0x3097a4){if(_0x3097a4){var _0x31fd25=util[_0x357f('0x35')](_0x357f('0x53'),_0x3097a4[_0x357f('0x52')]);if(fs[_0x357f('0x54')](_0x31fd25)){cypher=!![];return _0x277e1d[_0x357f('0x55')](_0x31fd25,_0x3097a4[_0x357f('0x52')],config[_0x357f('0x56')][_0x357f('0x7d')])[_0x357f('0x28')](function(){return _0x3097a4;});}return _0x3097a4;}})[_0x357f('0x28')](function(_0x1787eb){if(!_0x1787eb){throw new db[(_0x357f('0x57'))][(_0x357f('0x58'))](_0x357f('0x7e'));}_0x1687fd=_0x1787eb;return db[_0x357f('0x7f')][_0x357f('0x7c')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x357dd1,null))['then'](function(_0xee9ee0){if(_0xee9ee0){_0x5284dc=_0xee9ee0;if(!_0x5284dc[_0x357f('0x80')]||!_0x5284dc[_0x357f('0x81')]||!_0x5284dc[_0x357f('0x82')]||!_0x5284dc[_0x357f('0x83')]||!_0x5284dc['bucket']){throw new db[(_0x357f('0x57'))][(_0x357f('0x58'))](_0x357f('0x84'));}if(_0x19d494[_0x357f('0x4d')]['runSentiment']&&(!_0x5284dc[_0x357f('0x85')]||!_0x5284dc[_0x357f('0x86')]||!_0x5284dc[_0x357f('0x87')]||!_0x5284dc[_0x357f('0x83')]||!_0x5284dc['bucket'])){throw new db[(_0x357f('0x57'))][(_0x357f('0x58'))](_0x357f('0x88'));}return db['CloudProvider']['findOne']({'where':{'id':_0x5284dc['transcribeAccountId']}});}})[_0x357f('0x28')](function(_0x3ced32){if(!_0x3ced32){throw new db[(_0x357f('0x57'))]['ValidationError'](_0x357f('0x89'));}if(!_0x3ced32['data1']||!_0x3ced32['data2']){throw new db[(_0x357f('0x57'))]['ValidationError'](_0x357f('0x8a'));}_0x433871=_0x3ced32;return getBucketslist(_0x433871[_0x357f('0x8b')],_0x433871[_0x357f('0x8c')],_0x5284dc[_0x357f('0x82')]);})[_0x357f('0x28')](function(_0x23f845){if(_0x23f845&&_0x23f845['Buckets']){var _0x2525a7=_[_0x357f('0x4b')](_0x23f845[_0x357f('0x8d')],function(_0x191c22){return _0x191c22[_0x357f('0x8e')]===_0x5284dc[_0x357f('0x75')];});if(!_0x2525a7){logger[_0x357f('0x66')](util[_0x357f('0x35')](_0x357f('0x8f'),_0x19d494[_0x357f('0x4a')]['id'],_0x5284dc[_0x357f('0x75')]));return createBucket(_0x433871[_0x357f('0x8b')],_0x433871[_0x357f('0x8c')],_0x5284dc['transcribeRegion'],_0x5284dc[_0x357f('0x75')]);}logger['info'](util['format'](_0x357f('0x90'),_0x19d494[_0x357f('0x4a')]['id'],_0x5284dc[_0x357f('0x75')]));return;}})['then'](function(_0x5bed58){if(_0x1687fd[_0x357f('0x7b')]==='NEW'){return transcribe(_0x19d494[_0x357f('0x4a')]['id'],_0x433871[_0x357f('0x8b')],_0x433871[_0x357f('0x8c')],_0x5284dc[_0x357f('0x82')],_0x5284dc[_0x357f('0x75')],_0x1687fd[_0x357f('0x52')],_0x5284dc['language']);}else{logger[_0x357f('0x66')](util['format'](_0x357f('0x91'),_0x19d494[_0x357f('0x4a')]['id']));return{'transcribeStatus':_0x357f('0x92')};}})[_0x357f('0x28')](function(_0x36ca0e){if(_0x36ca0e){_0x36ca0e['tempSentiment']=_0x19d494['body'][_0x357f('0x93')];return _0x1687fd['updateAttributes'](_0x36ca0e);}})['then'](respondWithResult(_0x357dd1,null))[_0x357f('0x48')](handleError(_0x357dd1,null));};function writeFile(_0x74759b,_0x5048e3){return new Promise(function(_0x29036d,_0x26059b){fs['writeFile'](_0x5048e3,_0x74759b,function(_0x2a040c,_0x27756f){if(_0x2a040c){return _0x26059b(_0x2a040c);}else{return _0x29036d(_0x27756f);}});});}exports[_0x357f('0x94')]=function(_0x3e5f61,_0x4d0e5c,_0xea6db8){return db[_0x357f('0x2f')][_0x357f('0x7c')]({'where':{'id':_0x3e5f61['params']['id']}})[_0x357f('0x28')](handleEntityNotFound(_0x4d0e5c))['then'](function(_0x39a7c5){if(_0x39a7c5&&_0x39a7c5[_0x357f('0x95')]){var _0x369733=_0x39a7c5[_0x357f('0x95')];var _0xe461b7=config[_0x357f('0x96')]+_0x357f('0x97')+_0x39a7c5['id']+_0x357f('0x98');if(fs['existsSync'](_0xe461b7)){return _0xe461b7;}return writeFile(_0x369733,_0xe461b7)[_0x357f('0x28')](function(){return _0xe461b7;});}else{throw new db[(_0x357f('0x57'))]['ValidationError'](_0x357f('0x99'));}})['then'](function(_0x334cbe){return _0x4d0e5c['download'](_0x334cbe);})[_0x357f('0x48')](handleError(_0x4d0e5c));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index f63a1a5..dc47b78 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 _0x4d1f=['VoiceRecording','voice_recordings','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./voiceRecording.attributes','define'];(function(_0x1af05b,_0x5134b5){var _0x5be7cc=function(_0x2d4ac0){while(--_0x2d4ac0){_0x1af05b['push'](_0x1af05b['shift']());}};_0x5be7cc(++_0x5134b5);}(_0x4d1f,0x141));var _0xf4d1=function(_0x474dc8,_0x28eb3c){_0x474dc8=_0x474dc8-0x0;var _0x315e77=_0x4d1f[_0x474dc8];return _0x315e77;};'use strict';var _=require(_0xf4d1('0x0'));var util=require(_0xf4d1('0x1'));var logger=require(_0xf4d1('0x2'))(_0xf4d1('0x3'));var moment=require(_0xf4d1('0x4'));var BPromise=require(_0xf4d1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf4d1('0x6'));var config=require('../../config/environment');var attributes=require(_0xf4d1('0x7'));module['exports']=function(_0xde6b5e,_0x27c00f){return _0xde6b5e[_0xf4d1('0x8')](_0xf4d1('0x9'),attributes,{'tableName':_0xf4d1('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0120=['../../config/environment','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x272c47,_0x18ce00){var _0x2d9c4d=function(_0x4e20fd){while(--_0x4e20fd){_0x272c47['push'](_0x272c47['shift']());}};_0x2d9c4d(++_0x18ce00);}(_0x0120,0x6f));var _0x0012=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0120[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var logger=require(_0x0012('0x2'))(_0x0012('0x3'));var moment=require(_0x0012('0x4'));var BPromise=require(_0x0012('0x5'));var rp=require(_0x0012('0x6'));var fs=require('fs');var path=require(_0x0012('0x7'));var rimraf=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var attributes=require(_0x0012('0xa'));module[_0x0012('0xb')]=function(_0x4eaa5b,_0x4b396c){return _0x4eaa5b['define'](_0x0012('0xc'),attributes,{'tableName':_0x0012('0xd'),'paranoid':![],'indexes':[{'name':_0x0012('0xe'),'fields':[_0x0012('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 11eeb03..23f0441 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 _0x1a37=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateVoiceRecording','update','body','options','raw','where','attributes','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted'];(function(_0x40e8e7,_0x5892a0){var _0x3adfe4=function(_0x1c31be){while(--_0x1c31be){_0x40e8e7['push'](_0x40e8e7['shift']());}};_0x3adfe4(++_0x5892a0);}(_0x1a37,0xb4));var _0x71a3=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x1a37[_0x31cb5f];return _0x586042;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45050a,_0x231ea7,_0x2bb6a2){return new BPromise(function(_0x4a9ab2,_0x53b893){return client['request'](_0x45050a,_0x2bb6a2)['then'](function(_0x89da86){logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,_0x71a3('0xe'));logger[_0x71a3('0xf')](_0x71a3('0x10'),_0x231ea7,_0x71a3('0xe'),JSON[_0x71a3('0x11')](_0x89da86));if(_0x89da86['error']){if(_0x89da86['error']['code']===0x1f4){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x53b893(_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);}logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x4a9ab2(_0x89da86[_0x71a3('0x12')]['message']);}else{logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,'request\x20sent');_0x4a9ab2(_0x89da86['result'][_0x71a3('0x13')]);}})[_0x71a3('0x14')](function(_0xee797f){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0xee797f);_0x53b893(_0xee797f);});});}exports[_0x71a3('0x15')]=function(_0x5d4dee){var _0x656cd2=this;return new Promise(function(_0x27bfb4,_0x5b955a){return db['VoiceRecording'][_0x71a3('0x16')](_0x5d4dee[_0x71a3('0x17')],{'raw':_0x5d4dee[_0x71a3('0x18')]?_0x5d4dee[_0x71a3('0x18')][_0x71a3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d4dee['options']?_0x5d4dee[_0x71a3('0x18')][_0x71a3('0x1a')]||null:null,'attributes':_0x5d4dee[_0x71a3('0x18')]?_0x5d4dee[_0x71a3('0x18')][_0x71a3('0x1b')]||null:null,'limit':_0x5d4dee['options']?_0x5d4dee[_0x71a3('0x18')]['limit']||null:null})[_0x71a3('0x1c')](function(_0x35d1d4){logger[_0x71a3('0xc')](_0x71a3('0x15'),_0x5d4dee);logger[_0x71a3('0xf')](_0x71a3('0x15'),_0x5d4dee,JSON['stringify'](_0x35d1d4));_0x27bfb4(_0x35d1d4);})[_0x71a3('0x14')](function(_0x299d1d){logger[_0x71a3('0x12')](_0x71a3('0x15'),_0x299d1d[_0x71a3('0x13')],_0x5d4dee);_0x5b955a(_0x656cd2['error'](0x1f4,_0x299d1d[_0x71a3('0x13')]));});});};exports[_0x71a3('0x1d')]=function(_0x4c1a3d){var _0x412746=this;return new Promise(function(_0x515519,_0x46f1ff){var _0x2fd3b6=require(_0x71a3('0x1e'));var _0x35b5c7;return db[_0x71a3('0x1f')][_0x71a3('0x20')]({'attributes':['id',_0x71a3('0x21')],'where':{'id':0x1},'raw':!![]})[_0x71a3('0x1c')](function(_0x305eb1){_0x35b5c7=_0x305eb1;return db[_0x71a3('0x22')][_0x71a3('0x23')](_0x4c1a3d[_0x71a3('0x17')]);})['then'](function(_0x26fd9f){if(_0x35b5c7[_0x71a3('0x21')]&&fs[_0x71a3('0x24')](_0x26fd9f[_0x71a3('0x25')])){var _0x4a750c=util[_0x71a3('0x26')](_0x71a3('0x27'),_0x26fd9f[_0x71a3('0x25')]);return _0x2fd3b6[_0x71a3('0x28')](_0x26fd9f[_0x71a3('0x25')],_0x4a750c,config[_0x71a3('0x29')][_0x71a3('0x2a')])['then'](function(){fs[_0x71a3('0x2b')](_0x26fd9f[_0x71a3('0x25')]);logger[_0x71a3('0xc')](_0x71a3('0x2c'));return _0x26fd9f;});}return _0x26fd9f;})[_0x71a3('0x1c')](function(_0x73c8e7){logger[_0x71a3('0xc')](_0x71a3('0x1d'),_0x4c1a3d);logger[_0x71a3('0xf')](_0x71a3('0x1d'),_0x4c1a3d,JSON[_0x71a3('0x11')](_0x73c8e7));_0x515519(_0x73c8e7);})[_0x71a3('0x14')](function(_0x447b14){logger['error']('CreateVoiceRecording',_0x447b14[_0x71a3('0x13')],_0x4c1a3d);_0x46f1ff(_0x412746[_0x71a3('0x12')](0x1f4,_0x447b14['message']));});});}; \ No newline at end of file +var _0x8aad=['VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','bluebird','ioredis','../../mysqldb','rpc','client','http','request','info'];(function(_0x11a252,_0x58e6c9){var _0x4cfbd4=function(_0x531016){while(--_0x531016){_0x11a252['push'](_0x11a252['shift']());}};_0x4cfbd4(++_0x58e6c9);}(_0x8aad,0x146));var _0xd8aa=function(_0x338798,_0x27dbf9){_0x338798=_0x338798-0x0;var _0x34b8a7=_0x8aad[_0x338798];return _0x34b8a7;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var moment=require('moment');var BPromise=require(_0xd8aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8aa('0x3'));var db=require(_0xd8aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd8aa('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8aa('0x6')][_0xd8aa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16ea12,_0x4a4b10,_0x2a559d){return new BPromise(function(_0x1da411,_0x2a23b5){return client[_0xd8aa('0x8')](_0x16ea12,_0x2a559d)['then'](function(_0x5de228){logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));logger[_0xd8aa('0xc')](_0xd8aa('0xd'),_0x4a4b10,'request\x20sent',JSON[_0xd8aa('0xe')](_0x5de228));if(_0x5de228[_0xd8aa('0xf')]){if(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x10')]===0x1f4){logger[_0xd8aa('0xf')](_0xd8aa('0xa'),_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x2a23b5(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x1da411(_0x5de228[_0xd8aa('0xf')]['message']);}else{logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));_0x1da411(_0x5de228[_0xd8aa('0x12')]['message']);}})[_0xd8aa('0x13')](function(_0xa9ba1b){logger['error'](_0xd8aa('0xa'),_0x4a4b10,_0xa9ba1b);_0x2a23b5(_0xa9ba1b);});});}exports[_0xd8aa('0x14')]=function(_0x32e2cd){var _0x3a29ca=this;return new Promise(function(_0x2d34ac,_0x4953be){return db[_0xd8aa('0x15')][_0xd8aa('0x16')](_0x32e2cd[_0xd8aa('0x17')],{'raw':_0x32e2cd[_0xd8aa('0x18')]?_0x32e2cd['options'][_0xd8aa('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32e2cd[_0xd8aa('0x18')]?_0x32e2cd[_0xd8aa('0x18')][_0xd8aa('0x1a')]||null:null,'attributes':_0x32e2cd[_0xd8aa('0x18')]?_0x32e2cd['options'][_0xd8aa('0x1b')]||null:null,'limit':_0x32e2cd[_0xd8aa('0x18')]?_0x32e2cd[_0xd8aa('0x18')]['limit']||null:null})[_0xd8aa('0x1c')](function(_0x7a4ce7){logger[_0xd8aa('0x9')](_0xd8aa('0x14'),_0x32e2cd);logger[_0xd8aa('0xc')](_0xd8aa('0x14'),_0x32e2cd,JSON[_0xd8aa('0xe')](_0x7a4ce7));_0x2d34ac(_0x7a4ce7);})[_0xd8aa('0x13')](function(_0x375f64){logger[_0xd8aa('0xf')](_0xd8aa('0x14'),_0x375f64[_0xd8aa('0x11')],_0x32e2cd);_0x4953be(_0x3a29ca[_0xd8aa('0xf')](0x1f4,_0x375f64['message']));});});};exports[_0xd8aa('0x1d')]=function(_0x59eb3f){var _0xd4d204=this;return new Promise(function(_0x1f6ab2,_0x26cff3){var _0x3696fd=require(_0xd8aa('0x1e'));var _0x19edee;return db[_0xd8aa('0x1f')][_0xd8aa('0x20')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xd8aa('0x1c')](function(_0x34b792){_0x19edee=_0x34b792;return db[_0xd8aa('0x15')]['create'](_0x59eb3f[_0xd8aa('0x17')]);})['then'](function(_0x3052c6){if(_0x19edee[_0xd8aa('0x21')]&&fs[_0xd8aa('0x22')](_0x3052c6[_0xd8aa('0x23')])){var _0x44f783=util[_0xd8aa('0x24')](_0xd8aa('0x25'),_0x3052c6[_0xd8aa('0x23')]);return _0x3696fd['encryptFile'](_0x3052c6[_0xd8aa('0x23')],_0x44f783,config[_0xd8aa('0x26')][_0xd8aa('0x27')])[_0xd8aa('0x1c')](function(){fs[_0xd8aa('0x28')](_0x3052c6[_0xd8aa('0x23')]);logger[_0xd8aa('0x9')](_0xd8aa('0x29'));return _0x3052c6;});}return _0x3052c6;})['then'](function(_0x265217){logger[_0xd8aa('0x9')](_0xd8aa('0x1d'),_0x59eb3f);logger['debug'](_0xd8aa('0x1d'),_0x59eb3f,JSON[_0xd8aa('0xe')](_0x265217));_0x1f6ab2(_0x265217);})[_0xd8aa('0x13')](function(_0x45c216){logger[_0xd8aa('0xf')](_0xd8aa('0x1d'),_0x45c216[_0xd8aa('0x11')],_0x59eb3f);_0x26cff3(_0xd4d204[_0xd8aa('0xf')](0x1f4,_0x45c216[_0xd8aa('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 58432e1..e932d98 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 _0x309b=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x7f2423,_0x48abaa){var _0x175799=function(_0x2fde33){while(--_0x2fde33){_0x7f2423['push'](_0x7f2423['shift']());}};_0x175799(++_0x48abaa);}(_0x309b,0x89));var _0xb309=function(_0x9f2bb5,_0x1f3980){_0x9f2bb5=_0x9f2bb5-0x0;var _0x497548=_0x309b[_0x9f2bb5];return _0x497548;};'use strict';var multer=require(_0xb309('0x0'));var util=require(_0xb309('0x1'));var path=require('path');var timeout=require(_0xb309('0x2'));var express=require(_0xb309('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb309('0x4'));var interaction=require(_0xb309('0x5'));var config=require(_0xb309('0x6'));var controller=require(_0xb309('0x7'));router[_0xb309('0x8')]('/',auth[_0xb309('0x9')](),controller[_0xb309('0xa')]);router['get'](_0xb309('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xb309('0xc'),auth[_0xb309('0x9')](),controller[_0xb309('0xd')]);router[_0xb309('0xe')]('/',auth[_0xb309('0x9')](),controller[_0xb309('0xf')]);router[_0xb309('0x10')]('/:id',auth[_0xb309('0x9')](),controller[_0xb309('0x11')]);router[_0xb309('0x12')](_0xb309('0xc'),auth[_0xb309('0x9')](),controller[_0xb309('0x13')]);module['exports']=router; \ No newline at end of file +var _0xfe52=['create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','/describe','isAuthenticated','describe','show'];(function(_0xd256a1,_0x2aae80){var _0x2a11a4=function(_0x4a74f3){while(--_0x4a74f3){_0xd256a1['push'](_0xd256a1['shift']());}};_0x2a11a4(++_0x2aae80);}(_0xfe52,0x1be));var _0x2fe5=function(_0x311e2,_0x47fc0a){_0x311e2=_0x311e2-0x0;var _0x5ef847=_0xfe52[_0x311e2];return _0x5ef847;};'use strict';var multer=require('multer');var util=require(_0x2fe5('0x0'));var path=require(_0x2fe5('0x1'));var timeout=require(_0x2fe5('0x2'));var express=require(_0x2fe5('0x3'));var router=express[_0x2fe5('0x4')]();var fs_extra=require(_0x2fe5('0x5'));var auth=require(_0x2fe5('0x6'));var interaction=require(_0x2fe5('0x7'));var config=require(_0x2fe5('0x8'));var controller=require(_0x2fe5('0x9'));router[_0x2fe5('0xa')]('/',auth['isAuthenticated'](),controller[_0x2fe5('0xb')]);router[_0x2fe5('0xa')](_0x2fe5('0xc'),auth[_0x2fe5('0xd')](),controller[_0x2fe5('0xe')]);router[_0x2fe5('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x2fe5('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2fe5('0x10')]);router[_0x2fe5('0x11')](_0x2fe5('0x12'),auth[_0x2fe5('0xd')](),controller[_0x2fe5('0x13')]);router[_0x2fe5('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2fe5('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 51a4484..7f3bf15 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 _0x723e=['ENUM','attended','STRING','Yes','sequelize','moment'];(function(_0x26f648,_0x1313a1){var _0x5e7411=function(_0x567cd9){while(--_0x567cd9){_0x26f648['push'](_0x26f648['shift']());}};_0x5e7411(++_0x1313a1);}(_0x723e,0xe8));var _0xe723=function(_0x543a89,_0x31e8fd){_0x543a89=_0x543a89-0x0;var _0x52c8a9=_0x723e[_0x543a89];return _0x52c8a9;};'use strict';var Sequelize=require(_0xe723('0x0'));var moment=require(_0xe723('0x1'));module['exports']={'type':{'type':Sequelize[_0xe723('0x2')]('blind',_0xe723('0x3'))},'result':{'type':Sequelize[_0xe723('0x4')]},'transfererchannel':{'type':Sequelize[_0xe723('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xe723('0x4')]},'transferercalleridname':{'type':Sequelize[_0xe723('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xe723('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xe723('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xe723('0x4')]},'transfererexten':{'type':Sequelize[_0xe723('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xe723('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xe723('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xe723('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xe723('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xe723('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xe723('0x4')]},'transfereecontext':{'type':Sequelize[_0xe723('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0xe723('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0xe723('0x5'),'No')},'context':{'type':Sequelize[_0xe723('0x4')]},'extension':{'type':Sequelize[_0xe723('0x4')]}}; \ No newline at end of file +var _0xf360=['STRING','Yes','sequelize','moment','ENUM','blind'];(function(_0x594f00,_0x50bac6){var _0x2c329d=function(_0x4849a6){while(--_0x4849a6){_0x594f00['push'](_0x594f00['shift']());}};_0x2c329d(++_0x50bac6);}(_0xf360,0xc8));var _0x0f36=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xf360[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0x0f36('0x0'));var moment=require(_0x0f36('0x1'));module['exports']={'type':{'type':Sequelize[_0x0f36('0x2')](_0x0f36('0x3'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x0f36('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x0f36('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x0f36('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x0f36('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x0f36('0x4')]},'transferercontext':{'type':Sequelize[_0x0f36('0x4')]},'transfererexten':{'type':Sequelize[_0x0f36('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x0f36('0x4')]},'transfereechannel':{'type':Sequelize[_0x0f36('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x0f36('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x0f36('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x0f36('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x0f36('0x4')]},'isexternal':{'type':Sequelize[_0x0f36('0x2')](_0x0f36('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x0f36('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index ea20e56..904b3ce 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 _0x9523=['VIRTUAL','merge','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x9523,0x1e3));var _0x3952=function(_0x2987cb,_0x10be11){_0x2987cb=_0x2987cb-0x0;var _0x2f2cd3=_0x9523[_0x2987cb];return _0x2f2cd3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3952('0x0'));var zipdir=require(_0x3952('0x1'));var jsonpatch=require(_0x3952('0x2'));var rp=require(_0x3952('0x3'));var moment=require(_0x3952('0x4'));var BPromise=require(_0x3952('0x5'));var Mustache=require(_0x3952('0x6'));var util=require('util');var path=require(_0x3952('0x7'));var sox=require(_0x3952('0x8'));var csv=require(_0x3952('0x9'));var ejs=require(_0x3952('0xa'));var fs=require('fs');var fs_extra=require(_0x3952('0xb'));var _=require('lodash');var squel=require(_0x3952('0xc'));var crypto=require(_0x3952('0xd'));var jsforce=require(_0x3952('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3952('0xf'));var Papa=require(_0x3952('0x10'));var Redis=require(_0x3952('0x11'));var authService=require(_0x3952('0x12'));var qs=require(_0x3952('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3952('0x14'))(_0x3952('0x15'));var utils=require('../../config/utils');var config=require(_0x3952('0x16'));var licenseUtil=require(_0x3952('0x17'));var db=require(_0x3952('0x18'))['db'];function respondWithStatusCode(_0x65f57b,_0x5e4d9b){_0x5e4d9b=_0x5e4d9b||0xcc;return function(_0x1fefb5){if(_0x1fefb5){return _0x65f57b[_0x3952('0x19')](_0x5e4d9b);}return _0x65f57b['status'](_0x5e4d9b)[_0x3952('0x1a')]();};}function respondWithResult(_0x272fdc,_0x525938){_0x525938=_0x525938||0xc8;return function(_0xa70985){if(_0xa70985){return _0x272fdc[_0x3952('0x1b')](_0x525938)[_0x3952('0x1c')](_0xa70985);}};}function respondWithFilteredResult(_0x1f95a8,_0x5c13cb){return function(_0x594a47){if(_0x594a47){var _0x571525=typeof _0x5c13cb['offset']==='undefined'&&typeof _0x5c13cb[_0x3952('0x1d')]===_0x3952('0x1e');var _0x3ea23d=_0x594a47[_0x3952('0x1f')];var _0x241f6c=_0x571525?0x0:_0x5c13cb['offset'];var _0x6d4f55=_0x571525?_0x594a47[_0x3952('0x1f')]:_0x5c13cb[_0x3952('0x20')]+_0x5c13cb[_0x3952('0x1d')];var _0x4154e0;if(_0x6d4f55>=_0x3ea23d){_0x6d4f55=_0x3ea23d;_0x4154e0=0xc8;}else{_0x4154e0=0xce;}_0x1f95a8[_0x3952('0x1b')](_0x4154e0);return _0x1f95a8[_0x3952('0x21')](_0x3952('0x22'),_0x241f6c+'-'+_0x6d4f55+'/'+_0x3ea23d)['json'](_0x594a47);}return null;};}function patchUpdates(_0x1c3ab2){return function(_0x77087c){try{jsonpatch[_0x3952('0x23')](_0x77087c,_0x1c3ab2,!![]);}catch(_0x32cb65){return BPromise[_0x3952('0x24')](_0x32cb65);}return _0x77087c[_0x3952('0x25')]();};}function saveUpdates(_0x811a7a,_0x5aea76){return function(_0x4c6a62){if(_0x4c6a62){return _0x4c6a62[_0x3952('0x26')](_0x811a7a)[_0x3952('0x27')](function(_0x3e1cce){return _0x3e1cce;});}return null;};}function removeEntity(_0x228523,_0xae147b){return function(_0x557bd1){if(_0x557bd1){return _0x557bd1['destroy']()[_0x3952('0x27')](function(){_0x228523[_0x3952('0x1b')](0xcc)[_0x3952('0x1a')]();});}};}function handleEntityNotFound(_0x2dbc34,_0x1d138c){return function(_0x15cb9b){if(!_0x15cb9b){_0x2dbc34[_0x3952('0x19')](0x194);}return _0x15cb9b;};}function handleError(_0x4279b3,_0x23838b){_0x23838b=_0x23838b||0x1f4;return function(_0x1fd22c){logger['error'](_0x1fd22c[_0x3952('0x28')]);if(_0x1fd22c[_0x3952('0x29')]){delete _0x1fd22c[_0x3952('0x29')];}_0x4279b3[_0x3952('0x1b')](_0x23838b)[_0x3952('0x2a')](_0x1fd22c);};}exports[_0x3952('0x2b')]=function(_0x4df475,_0x119ff2){var _0x2a9931={},_0x1b0b5f={},_0x126dd6={'count':0x0,'rows':[]};var _0x44a3e6=_[_0x3952('0x2c')](db[_0x3952('0x2d')][_0x3952('0x2e')],function(_0x171d98){return{'name':_0x171d98[_0x3952('0x2f')],'type':_0x171d98['type']['key']};});_0x1b0b5f[_0x3952('0x30')]=_[_0x3952('0x2c')](_0x44a3e6,_0x3952('0x29'));_0x1b0b5f[_0x3952('0x31')]=_[_0x3952('0x32')](_0x4df475[_0x3952('0x31')]);_0x1b0b5f[_0x3952('0x33')]=_[_0x3952('0x34')](_0x1b0b5f['model'],_0x1b0b5f[_0x3952('0x31')]);_0x2a9931[_0x3952('0x35')]=_[_0x3952('0x34')](_0x1b0b5f[_0x3952('0x30')],qs[_0x3952('0x36')](_0x4df475[_0x3952('0x31')][_0x3952('0x36')]));_0x2a9931[_0x3952('0x35')]=_0x2a9931[_0x3952('0x35')][_0x3952('0x37')]?_0x2a9931[_0x3952('0x35')]:_0x1b0b5f[_0x3952('0x30')];if(!_0x4df475[_0x3952('0x31')][_0x3952('0x38')](_0x3952('0x39'))){_0x2a9931['limit']=qs[_0x3952('0x1d')](_0x4df475['query']['limit']);_0x2a9931['offset']=qs[_0x3952('0x20')](_0x4df475[_0x3952('0x31')][_0x3952('0x20')]);}_0x2a9931[_0x3952('0x3a')]=qs[_0x3952('0x3b')](_0x4df475[_0x3952('0x31')][_0x3952('0x3b')]);_0x2a9931['where']=qs[_0x3952('0x33')](_[_0x3952('0x3c')](_0x4df475[_0x3952('0x31')],_0x1b0b5f[_0x3952('0x33')]),_0x44a3e6);if(_0x4df475[_0x3952('0x31')]['filter']){_0x2a9931[_0x3952('0x3d')]=_['merge'](_0x2a9931[_0x3952('0x3d')],{'$or':_[_0x3952('0x2c')](_0x44a3e6,function(_0x1d35bc){if(_0x1d35bc[_0x3952('0x3e')]!==_0x3952('0x3f')){var _0x80569f={};_0x80569f[_0x1d35bc[_0x3952('0x29')]]={'$like':'%'+_0x4df475[_0x3952('0x31')]['filter']+'%'};return _0x80569f;}})});}_0x2a9931=_[_0x3952('0x40')]({},_0x2a9931,_0x4df475[_0x3952('0x41')]);var _0x5832ef={'where':_0x2a9931[_0x3952('0x3d')]};return db[_0x3952('0x2d')]['count'](_0x5832ef)['then'](function(_0x2e5174){_0x126dd6[_0x3952('0x1f')]=_0x2e5174;if(_0x4df475[_0x3952('0x31')]['includeAll']){_0x2a9931[_0x3952('0x42')]=[{'all':!![]}];}return db[_0x3952('0x2d')][_0x3952('0x43')](_0x2a9931);})['then'](function(_0x3ea472){_0x126dd6[_0x3952('0x44')]=_0x3ea472;return _0x126dd6;})[_0x3952('0x27')](respondWithFilteredResult(_0x119ff2,_0x2a9931))['catch'](handleError(_0x119ff2,null));};exports[_0x3952('0x45')]=function(_0x2bb5dd,_0x50e40a){var _0x10badd={'raw':!![],'where':{'id':_0x2bb5dd[_0x3952('0x46')]['id']}},_0x507272={};_0x507272[_0x3952('0x30')]=_[_0x3952('0x32')](db[_0x3952('0x2d')]['rawAttributes']);_0x507272['query']=_[_0x3952('0x32')](_0x2bb5dd[_0x3952('0x31')]);_0x507272['filters']=_[_0x3952('0x34')](_0x507272[_0x3952('0x30')],_0x507272[_0x3952('0x31')]);_0x10badd[_0x3952('0x35')]=_[_0x3952('0x34')](_0x507272[_0x3952('0x30')],qs[_0x3952('0x36')](_0x2bb5dd[_0x3952('0x31')][_0x3952('0x36')]));_0x10badd['attributes']=_0x10badd[_0x3952('0x35')][_0x3952('0x37')]?_0x10badd['attributes']:_0x507272['model'];if(_0x2bb5dd[_0x3952('0x31')][_0x3952('0x47')]){_0x10badd['include']=[{'all':!![]}];}_0x10badd=_[_0x3952('0x40')]({},_0x10badd,_0x2bb5dd[_0x3952('0x41')]);return db['VoiceTransferReport'][_0x3952('0x48')](_0x10badd)[_0x3952('0x27')](handleEntityNotFound(_0x50e40a,null))[_0x3952('0x27')](respondWithResult(_0x50e40a,null))[_0x3952('0x49')](handleError(_0x50e40a,null));};exports[_0x3952('0x4a')]=function(_0x285f97,_0xdd56fc){return db['VoiceTransferReport'][_0x3952('0x4a')](_0x285f97[_0x3952('0x4b')],{})[_0x3952('0x27')](respondWithResult(_0xdd56fc,0xc9))[_0x3952('0x49')](handleError(_0xdd56fc,null));};exports[_0x3952('0x26')]=function(_0x21ed07,_0x523cf1){if(_0x21ed07[_0x3952('0x4b')]['id']){delete _0x21ed07[_0x3952('0x4b')]['id'];}return db[_0x3952('0x2d')]['find']({'where':{'id':_0x21ed07[_0x3952('0x46')]['id']}})[_0x3952('0x27')](handleEntityNotFound(_0x523cf1,null))[_0x3952('0x27')](saveUpdates(_0x21ed07[_0x3952('0x4b')],null))[_0x3952('0x27')](respondWithResult(_0x523cf1,null))[_0x3952('0x49')](handleError(_0x523cf1,null));};exports[_0x3952('0x4c')]=function(_0x29f142,_0x3044bb){return db[_0x3952('0x2d')][_0x3952('0x48')]({'where':{'id':_0x29f142[_0x3952('0x46')]['id']}})['then'](handleEntityNotFound(_0x3044bb,null))[_0x3952('0x27')](removeEntity(_0x3044bb,null))[_0x3952('0x49')](handleError(_0x3044bb,null));};exports[_0x3952('0x4d')]=function(_0x232bcb,_0x149848){return db[_0x3952('0x2d')][_0x3952('0x4d')]()[_0x3952('0x27')](respondWithResult(_0x149848,null))[_0x3952('0x49')](handleError(_0x149848,null));}; \ No newline at end of file +var _0x869d=['../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','create','body','find','describe','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2321de,_0x35a1b8){var _0x5979ee=function(_0x3d21cd){while(--_0x3d21cd){_0x2321de['push'](_0x2321de['shift']());}};_0x5979ee(++_0x35a1b8);}(_0x869d,0x10e));var _0xd869=function(_0x4c2c23,_0x3d8d28){_0x4c2c23=_0x4c2c23-0x0;var _0x5c992e=_0x869d[_0x4c2c23];return _0x5c992e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd869('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd869('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd869('0x2'));var Mustache=require(_0xd869('0x3'));var util=require(_0xd869('0x4'));var path=require(_0xd869('0x5'));var sox=require('sox');var csv=require(_0xd869('0x6'));var ejs=require(_0xd869('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd869('0x8'));var squel=require(_0xd869('0x9'));var crypto=require(_0xd869('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd869('0xb'));var toCsv=require(_0xd869('0x6'));var querystring=require(_0xd869('0xc'));var Papa=require(_0xd869('0xd'));var Redis=require(_0xd869('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd869('0xf'));var as=require(_0xd869('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd869('0x11'))(_0xd869('0x12'));var utils=require(_0xd869('0x13'));var config=require(_0xd869('0x14'));var licenseUtil=require(_0xd869('0x15'));var db=require(_0xd869('0x16'))['db'];function respondWithStatusCode(_0x10fed2,_0x1200ab){_0x1200ab=_0x1200ab||0xcc;return function(_0x37f066){if(_0x37f066){return _0x10fed2[_0xd869('0x17')](_0x1200ab);}return _0x10fed2['status'](_0x1200ab)['end']();};}function respondWithResult(_0xd64537,_0x4a6b0d){_0x4a6b0d=_0x4a6b0d||0xc8;return function(_0x550ae5){if(_0x550ae5){return _0xd64537['status'](_0x4a6b0d)[_0xd869('0x18')](_0x550ae5);}};}function respondWithFilteredResult(_0x31068c,_0x57ac4f){return function(_0x217975){if(_0x217975){var _0x5a64b5=typeof _0x57ac4f[_0xd869('0x19')]===_0xd869('0x1a')&&typeof _0x57ac4f['limit']==='undefined';var _0x6e54c7=_0x217975['count'];var _0x2cec32=_0x5a64b5?0x0:_0x57ac4f[_0xd869('0x19')];var _0x5c6b43=_0x5a64b5?_0x217975[_0xd869('0x1b')]:_0x57ac4f[_0xd869('0x19')]+_0x57ac4f[_0xd869('0x1c')];var _0x47a169;if(_0x5c6b43>=_0x6e54c7){_0x5c6b43=_0x6e54c7;_0x47a169=0xc8;}else{_0x47a169=0xce;}_0x31068c[_0xd869('0x1d')](_0x47a169);return _0x31068c[_0xd869('0x1e')](_0xd869('0x1f'),_0x2cec32+'-'+_0x5c6b43+'/'+_0x6e54c7)['json'](_0x217975);}return null;};}function patchUpdates(_0x18c5c8){return function(_0xa62e02){try{jsonpatch['apply'](_0xa62e02,_0x18c5c8,!![]);}catch(_0x18b0c6){return BPromise[_0xd869('0x20')](_0x18b0c6);}return _0xa62e02[_0xd869('0x21')]();};}function saveUpdates(_0x88c192,_0x185456){return function(_0x524f0c){if(_0x524f0c){return _0x524f0c[_0xd869('0x22')](_0x88c192)[_0xd869('0x23')](function(_0x128068){return _0x128068;});}return null;};}function removeEntity(_0x15f667,_0x242725){return function(_0x22a01b){if(_0x22a01b){return _0x22a01b[_0xd869('0x24')]()['then'](function(){_0x15f667[_0xd869('0x1d')](0xcc)[_0xd869('0x25')]();});}};}function handleEntityNotFound(_0x314e87,_0x37eb7d){return function(_0x5e1c53){if(!_0x5e1c53){_0x314e87[_0xd869('0x17')](0x194);}return _0x5e1c53;};}function handleError(_0x79ddd0,_0x3a2876){_0x3a2876=_0x3a2876||0x1f4;return function(_0x2d74f9){logger[_0xd869('0x26')](_0x2d74f9[_0xd869('0x27')]);if(_0x2d74f9[_0xd869('0x28')]){delete _0x2d74f9[_0xd869('0x28')];}_0x79ddd0['status'](_0x3a2876)[_0xd869('0x29')](_0x2d74f9);};}exports[_0xd869('0x2a')]=function(_0x58ba0b,_0x493b48){var _0x457909={},_0x5d6cf3={},_0xcb71c4={'count':0x0,'rows':[]};var _0x548098=_[_0xd869('0x2b')](db[_0xd869('0x2c')][_0xd869('0x2d')],function(_0x4ab0de){return{'name':_0x4ab0de[_0xd869('0x2e')],'type':_0x4ab0de[_0xd869('0x2f')]['key']};});_0x5d6cf3[_0xd869('0x30')]=_[_0xd869('0x2b')](_0x548098,_0xd869('0x28'));_0x5d6cf3[_0xd869('0x31')]=_[_0xd869('0x32')](_0x58ba0b[_0xd869('0x31')]);_0x5d6cf3[_0xd869('0x33')]=_[_0xd869('0x34')](_0x5d6cf3[_0xd869('0x30')],_0x5d6cf3[_0xd869('0x31')]);_0x457909[_0xd869('0x35')]=_['intersection'](_0x5d6cf3[_0xd869('0x30')],qs['fields'](_0x58ba0b[_0xd869('0x31')][_0xd869('0x36')]));_0x457909[_0xd869('0x35')]=_0x457909[_0xd869('0x35')][_0xd869('0x37')]?_0x457909[_0xd869('0x35')]:_0x5d6cf3[_0xd869('0x30')];if(!_0x58ba0b[_0xd869('0x31')]['hasOwnProperty'](_0xd869('0x38'))){_0x457909['limit']=qs[_0xd869('0x1c')](_0x58ba0b['query'][_0xd869('0x1c')]);_0x457909[_0xd869('0x19')]=qs[_0xd869('0x19')](_0x58ba0b[_0xd869('0x31')]['offset']);}_0x457909[_0xd869('0x39')]=qs['sort'](_0x58ba0b[_0xd869('0x31')]['sort']);_0x457909[_0xd869('0x3a')]=qs['filters'](_['pick'](_0x58ba0b[_0xd869('0x31')],_0x5d6cf3[_0xd869('0x33')]),_0x548098);if(_0x58ba0b[_0xd869('0x31')][_0xd869('0x3b')]){_0x457909[_0xd869('0x3a')]=_[_0xd869('0x3c')](_0x457909[_0xd869('0x3a')],{'$or':_[_0xd869('0x2b')](_0x548098,function(_0x2a11bc){if(_0x2a11bc[_0xd869('0x2f')]!==_0xd869('0x3d')){var _0x53d5a5={};_0x53d5a5[_0x2a11bc['name']]={'$like':'%'+_0x58ba0b[_0xd869('0x31')][_0xd869('0x3b')]+'%'};return _0x53d5a5;}})});}_0x457909=_[_0xd869('0x3c')]({},_0x457909,_0x58ba0b[_0xd869('0x3e')]);var _0x3f288={'where':_0x457909[_0xd869('0x3a')]};return db[_0xd869('0x2c')][_0xd869('0x1b')](_0x3f288)[_0xd869('0x23')](function(_0x5cd16b){_0xcb71c4[_0xd869('0x1b')]=_0x5cd16b;if(_0x58ba0b[_0xd869('0x31')][_0xd869('0x3f')]){_0x457909[_0xd869('0x40')]=[{'all':!![]}];}return db[_0xd869('0x2c')][_0xd869('0x41')](_0x457909);})[_0xd869('0x23')](function(_0x266d16){_0xcb71c4['rows']=_0x266d16;return _0xcb71c4;})[_0xd869('0x23')](respondWithFilteredResult(_0x493b48,_0x457909))['catch'](handleError(_0x493b48,null));};exports[_0xd869('0x42')]=function(_0x5efe72,_0x36a524){var _0x1ba81a={'raw':!![],'where':{'id':_0x5efe72[_0xd869('0x43')]['id']}},_0x4239a4={};_0x4239a4['model']=_[_0xd869('0x32')](db['VoiceTransferReport'][_0xd869('0x2d')]);_0x4239a4[_0xd869('0x31')]=_[_0xd869('0x32')](_0x5efe72[_0xd869('0x31')]);_0x4239a4['filters']=_[_0xd869('0x34')](_0x4239a4[_0xd869('0x30')],_0x4239a4[_0xd869('0x31')]);_0x1ba81a['attributes']=_[_0xd869('0x34')](_0x4239a4[_0xd869('0x30')],qs[_0xd869('0x36')](_0x5efe72['query'][_0xd869('0x36')]));_0x1ba81a['attributes']=_0x1ba81a[_0xd869('0x35')][_0xd869('0x37')]?_0x1ba81a[_0xd869('0x35')]:_0x4239a4['model'];if(_0x5efe72[_0xd869('0x31')][_0xd869('0x3f')]){_0x1ba81a[_0xd869('0x40')]=[{'all':!![]}];}_0x1ba81a=_[_0xd869('0x3c')]({},_0x1ba81a,_0x5efe72[_0xd869('0x3e')]);return db[_0xd869('0x2c')]['find'](_0x1ba81a)[_0xd869('0x23')](handleEntityNotFound(_0x36a524,null))[_0xd869('0x23')](respondWithResult(_0x36a524,null))[_0xd869('0x44')](handleError(_0x36a524,null));};exports[_0xd869('0x45')]=function(_0x4987fc,_0x1bd447){return db[_0xd869('0x2c')][_0xd869('0x45')](_0x4987fc['body'],{})[_0xd869('0x23')](respondWithResult(_0x1bd447,0xc9))[_0xd869('0x44')](handleError(_0x1bd447,null));};exports[_0xd869('0x22')]=function(_0x360b37,_0x415b06){if(_0x360b37[_0xd869('0x46')]['id']){delete _0x360b37[_0xd869('0x46')]['id'];}return db[_0xd869('0x2c')][_0xd869('0x47')]({'where':{'id':_0x360b37[_0xd869('0x43')]['id']}})[_0xd869('0x23')](handleEntityNotFound(_0x415b06,null))[_0xd869('0x23')](saveUpdates(_0x360b37[_0xd869('0x46')],null))['then'](respondWithResult(_0x415b06,null))['catch'](handleError(_0x415b06,null));};exports['destroy']=function(_0x348934,_0x51b627){return db[_0xd869('0x2c')][_0xd869('0x47')]({'where':{'id':_0x348934[_0xd869('0x43')]['id']}})[_0xd869('0x23')](handleEntityNotFound(_0x51b627,null))[_0xd869('0x23')](removeEntity(_0x51b627,null))[_0xd869('0x44')](handleError(_0x51b627,null));};exports['describe']=function(_0x4604a2,_0x44700b){return db[_0xd869('0x2c')][_0xd869('0x48')]()[_0xd869('0x23')](respondWithResult(_0x44700b,null))[_0xd869('0x44')](handleError(_0x44700b,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index f69c41f..4facdd8 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 _0x513f=['../../config/logger','api','moment','request-promise','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util'];(function(_0x4a8f45,_0x4b601e){var _0x1febfc=function(_0x4ff1a6){while(--_0x4ff1a6){_0x4a8f45['push'](_0x4a8f45['shift']());}};_0x1febfc(++_0x4b601e);}(_0x513f,0x9e));var _0xf513=function(_0x257833,_0x179227){_0x257833=_0x257833-0x0;var _0x2f71c6=_0x513f[_0x257833];return _0x2f71c6;};'use strict';var _=require(_0xf513('0x0'));var util=require(_0xf513('0x1'));var logger=require(_0xf513('0x2'))(_0xf513('0x3'));var moment=require(_0xf513('0x4'));var BPromise=require('bluebird');var rp=require(_0xf513('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf513('0x6'));module[_0xf513('0x7')]=function(_0x10d7d1,_0x49250c){return _0x10d7d1[_0xf513('0x8')]('VoiceTransferReport',attributes,{'tableName':_0xf513('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9575=['define','VoiceTransferReport','report_call_transfer','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./voiceTransferReport.attributes'];(function(_0x189305,_0x46c43f){var _0xea3406=function(_0x2aa435){while(--_0x2aa435){_0x189305['push'](_0x189305['shift']());}};_0xea3406(++_0x46c43f);}(_0x9575,0x189));var _0x5957=function(_0x4ac515,_0x4e1320){_0x4ac515=_0x4ac515-0x0;var _0x4734dc=_0x9575[_0x4ac515];return _0x4734dc;};'use strict';var _=require('lodash');var util=require(_0x5957('0x0'));var logger=require(_0x5957('0x1'))('api');var moment=require(_0x5957('0x2'));var BPromise=require(_0x5957('0x3'));var rp=require(_0x5957('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5957('0x5'));var attributes=require(_0x5957('0x6'));module['exports']=function(_0x272ddf,_0x597af8){return _0x272ddf[_0x5957('0x7')](_0x5957('0x8'),attributes,{'tableName':_0x5957('0x9'),'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 e460938..0217964 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 _0xce1a=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','VoiceTransferReport','create','options','raw','CreateVoiceTransferReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xbcd604,_0x5c6862){var _0x16a71e=function(_0xa68500){while(--_0xa68500){_0xbcd604['push'](_0xbcd604['shift']());}};_0x16a71e(++_0x5c6862);}(_0xce1a,0x159));var _0xace1=function(_0x116c7a,_0x27de1d){_0x116c7a=_0x116c7a-0x0;var _0x4a366d=_0xce1a[_0x116c7a];return _0x4a366d;};'use strict';var _=require('lodash');var util=require(_0xace1('0x0'));var moment=require(_0xace1('0x1'));var BPromise=require(_0xace1('0x2'));var rs=require(_0xace1('0x3'));var fs=require('fs');var Redis=require(_0xace1('0x4'));var db=require(_0xace1('0x5'))['db'];var utils=require(_0xace1('0x6'));var logger=require('../../config/logger')(_0xace1('0x7'));var config=require(_0xace1('0x8'));var jayson=require(_0xace1('0x9'));var client=jayson[_0xace1('0xa')][_0xace1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x438f49,_0x2a3806,_0x4e0e35){return new BPromise(function(_0x1e02b1,_0x41f39c){return client['request'](_0x438f49,_0x4e0e35)[_0xace1('0xc')](function(_0x3c9c1a){logger[_0xace1('0xd')](_0xace1('0xe'),_0x2a3806,_0xace1('0xf'));logger[_0xace1('0x10')](_0xace1('0x11'),_0x2a3806,'request\x20sent',JSON['stringify'](_0x3c9c1a));if(_0x3c9c1a[_0xace1('0x12')]){if(_0x3c9c1a['error']['code']===0x1f4){logger[_0xace1('0x12')](_0xace1('0xe'),_0x2a3806,_0x3c9c1a[_0xace1('0x12')][_0xace1('0x13')]);return _0x41f39c(_0x3c9c1a[_0xace1('0x12')][_0xace1('0x13')]);}logger[_0xace1('0x12')](_0xace1('0xe'),_0x2a3806,_0x3c9c1a['error'][_0xace1('0x13')]);return _0x1e02b1(_0x3c9c1a[_0xace1('0x12')]['message']);}else{logger['info'](_0xace1('0xe'),_0x2a3806,_0xace1('0xf'));_0x1e02b1(_0x3c9c1a[_0xace1('0x14')][_0xace1('0x13')]);}})[_0xace1('0x15')](function(_0x492867){logger['error'](_0xace1('0xe'),_0x2a3806,_0x492867);_0x41f39c(_0x492867);});});}exports['CreateVoiceTransferReport']=function(_0x5f292e){var _0x25de9c=this;return new Promise(function(_0x5a00d0,_0x172f94){return db[_0xace1('0x16')][_0xace1('0x17')](_0x5f292e['body'],{'raw':_0x5f292e[_0xace1('0x18')]?_0x5f292e[_0xace1('0x18')][_0xace1('0x19')]===undefined?!![]:![]:!![]})[_0xace1('0xc')](function(_0x2aee79){logger['info']('CreateVoiceTransferReport',_0x5f292e);logger['debug']('CreateVoiceTransferReport',_0x5f292e,JSON['stringify'](_0x2aee79));_0x5a00d0(_0x2aee79);})['catch'](function(_0x4583b9){logger[_0xace1('0x12')](_0xace1('0x1a'),_0x4583b9[_0xace1('0x13')],_0x5f292e);_0x172f94(_0x25de9c[_0xace1('0x12')](0x1f4,_0x4583b9[_0xace1('0x13')]));});});}; \ No newline at end of file +var _0x184a=['raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateVoiceTransferReport','VoiceTransferReport','body','options'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x184a,0x8d));var _0xa184=function(_0x228917,_0x33ed97){_0x228917=_0x228917-0x0;var _0x30d46b=_0x184a[_0x228917];return _0x30d46b;};'use strict';var _=require(_0xa184('0x0'));var util=require(_0xa184('0x1'));var moment=require('moment');var BPromise=require(_0xa184('0x2'));var rs=require(_0xa184('0x3'));var fs=require('fs');var Redis=require(_0xa184('0x4'));var db=require(_0xa184('0x5'))['db'];var utils=require(_0xa184('0x6'));var logger=require(_0xa184('0x7'))('rpc');var config=require(_0xa184('0x8'));var jayson=require(_0xa184('0x9'));var client=jayson[_0xa184('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x174cd9,_0x1bf39a,_0x569ae8){return new BPromise(function(_0x20d758,_0x21e917){return client[_0xa184('0xb')](_0x174cd9,_0x569ae8)[_0xa184('0xc')](function(_0x3378dc){logger[_0xa184('0xd')](_0xa184('0xe'),_0x1bf39a,'request\x20sent');logger[_0xa184('0xf')](_0xa184('0x10'),_0x1bf39a,_0xa184('0x11'),JSON[_0xa184('0x12')](_0x3378dc));if(_0x3378dc[_0xa184('0x13')]){if(_0x3378dc[_0xa184('0x13')][_0xa184('0x14')]===0x1f4){logger[_0xa184('0x13')](_0xa184('0xe'),_0x1bf39a,_0x3378dc['error'][_0xa184('0x15')]);return _0x21e917(_0x3378dc[_0xa184('0x13')]['message']);}logger[_0xa184('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x1bf39a,_0x3378dc['error'][_0xa184('0x15')]);return _0x20d758(_0x3378dc[_0xa184('0x13')]['message']);}else{logger['info'](_0xa184('0xe'),_0x1bf39a,_0xa184('0x11'));_0x20d758(_0x3378dc[_0xa184('0x16')]['message']);}})['catch'](function(_0x21b923){logger['error'](_0xa184('0xe'),_0x1bf39a,_0x21b923);_0x21e917(_0x21b923);});});}exports[_0xa184('0x17')]=function(_0x21e20f){var _0x5f7f29=this;return new Promise(function(_0x54f8dd,_0x172595){return db[_0xa184('0x18')]['create'](_0x21e20f[_0xa184('0x19')],{'raw':_0x21e20f[_0xa184('0x1a')]?_0x21e20f[_0xa184('0x1a')][_0xa184('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x54b637){logger[_0xa184('0xd')](_0xa184('0x17'),_0x21e20f);logger['debug'](_0xa184('0x17'),_0x21e20f,JSON[_0xa184('0x12')](_0x54b637));_0x54f8dd(_0x54b637);})['catch'](function(_0x141464){logger[_0xa184('0x13')](_0xa184('0x17'),_0x141464[_0xa184('0x15')],_0x21e20f);_0x172595(_0x5f7f29[_0xa184('0x13')](0x1f4,_0x141464[_0xa184('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 4154239..3e9abc2 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 _0x1f44=['/transfer','transfer','exports','express','post','/originate','isAuthenticated','canUpdate','/hold','hold','/unhold','unhold','calls'];(function(_0xdefb1c,_0xc0db95){var _0x557a59=function(_0x610744){while(--_0x610744){_0xdefb1c['push'](_0xdefb1c['shift']());}};_0x557a59(++_0xc0db95);}(_0x1f44,0x16f));var _0x41f4=function(_0x54bfb4,_0x37861b){_0x54bfb4=_0x54bfb4-0x0;var _0x466f13=_0x1f44[_0x54bfb4];return _0x466f13;};'use strict';var express=require(_0x41f4('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router[_0x41f4('0x1')](_0x41f4('0x2'),auth[_0x41f4('0x3')](),auth[_0x41f4('0x4')](),controller['originate']);router[_0x41f4('0x1')]('/hangup',auth[_0x41f4('0x3')](),auth['canUpdate'](),controller['hangup']);router[_0x41f4('0x1')]('/answer',auth['isAuthenticated'](),auth[_0x41f4('0x4')](),controller['answer']);router['post'](_0x41f4('0x5'),auth[_0x41f4('0x3')](),auth[_0x41f4('0x4')](),controller[_0x41f4('0x6')]);router['post'](_0x41f4('0x7'),auth[_0x41f4('0x3')](),auth[_0x41f4('0x4')](),controller[_0x41f4('0x8')]);router[_0x41f4('0x1')]('/calls',auth[_0x41f4('0x3')](),auth['canUpdate'](),controller[_0x41f4('0x9')]);router[_0x41f4('0x1')](_0x41f4('0xa'),auth[_0x41f4('0x3')](),auth['canUpdate'](),controller[_0x41f4('0xb')]);module[_0x41f4('0xc')]=router; \ No newline at end of file +var _0x397c=['/hangup','hangup','/answer','answer','/hold','hold','/unhold','unhold','/calls','calls','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','canUpdate','originate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x397c,0x15c));var _0xc397=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x397c[_0x2aecb2];return _0x3ebb80;};'use strict';var express=require(_0xc397('0x0'));var router=express[_0xc397('0x1')]();var auth=require(_0xc397('0x2'));var controller=require(_0xc397('0x3'));router[_0xc397('0x4')](_0xc397('0x5'),auth[_0xc397('0x6')](),auth[_0xc397('0x7')](),controller[_0xc397('0x8')]);router[_0xc397('0x4')](_0xc397('0x9'),auth[_0xc397('0x6')](),auth[_0xc397('0x7')](),controller[_0xc397('0xa')]);router['post'](_0xc397('0xb'),auth[_0xc397('0x6')](),auth[_0xc397('0x7')](),controller[_0xc397('0xc')]);router[_0xc397('0x4')](_0xc397('0xd'),auth[_0xc397('0x6')](),auth[_0xc397('0x7')](),controller[_0xc397('0xe')]);router[_0xc397('0x4')](_0xc397('0xf'),auth['isAuthenticated'](),auth[_0xc397('0x7')](),controller[_0xc397('0x10')]);router[_0xc397('0x4')](_0xc397('0x11'),auth[_0xc397('0x6')](),auth[_0xc397('0x7')](),controller[_0xc397('0x12')]);router[_0xc397('0x4')]('/transfer',auth[_0xc397('0x6')](),auth[_0xc397('0x7')](),controller[_0xc397('0x13')]);module[_0xc397('0x14')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index d328636..701360d 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 _0x0ba7=['client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','transferNumber\x20is\x20required','info','stringify','emit','error','stack','name','status','send','NotFound','request','code','message','result','findOne','agent','then','VoiceChannels','filter','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','sessionId','hangup\x20executed!','catch','answer','answer\x20fired:','entityFound:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','unhold','calls','calls\x20fired:','conference','conference\x20fired:','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path','../../mysqldb','../../config/environment','util','bluebird'];(function(_0xf2abb5,_0x4b7452){var _0x3eb8da=function(_0x260606){while(--_0x260606){_0xf2abb5['push'](_0xf2abb5['shift']());}};_0x3eb8da(++_0x4b7452);}(_0x0ba7,0x16d));var _0x70ba=function(_0x2a4ab3,_0x57fa73){_0x2a4ab3=_0x2a4ab3-0x0;var _0x18377d=_0x0ba7[_0x2a4ab3];return _0x18377d;};'use strict';var path=require(_0x70ba('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x70ba('0x1'))['db'];var config=require(_0x70ba('0x2'));var util=require(_0x70ba('0x3'));var BPromise=require(_0x70ba('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0x70ba('0x5')][_0x70ba('0x6')]({'port':0x232a});var logger=require(_0x70ba('0x7'))(_0x70ba('0x8'));var Redis=require(_0x70ba('0x9'));config[_0x70ba('0xa')]=_[_0x70ba('0xb')](config[_0x70ba('0xa')],{'host':_0x70ba('0xc'),'port':0x18eb});var io=require(_0x70ba('0xd'))(new Redis(config[_0x70ba('0xa')]));var Schema=require(_0x70ba('0xe'));var originateValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]},'callNumber':{'type':_0x70ba('0x11'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x70ba('0x11')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]},'sessionId':{'type':_0x70ba('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x70ba('0x11'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x70ba('0x11'),'required':[!![],_0x70ba('0x12')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x70ba('0x10')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]},'sessionId':{'type':_0x70ba('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]}});function emit(_0x164521,_0x18334a,_0x3e27e8){logger[_0x70ba('0x13')](_0x164521,_0x18334a,JSON[_0x70ba('0x14')](_0x3e27e8));io['to'](_0x164521)[_0x70ba('0x15')](_0x18334a,_0x3e27e8);}function handleError(_0xb6d69a){return function(_0x5ed907){console['log']('handleError:',_0x5ed907,_0x5ed907 instanceof RangeError);logger[_0x70ba('0x16')](_0x5ed907[_0x70ba('0x17')]);if(_0x5ed907 instanceof RangeError){if(_0x5ed907[_0x70ba('0x18')]){delete _0x5ed907[_0x70ba('0x18')];}_0xb6d69a[_0x70ba('0x19')](0x194)[_0x70ba('0x1a')](_0x5ed907);}else{if(_0x5ed907[_0x70ba('0x18')]){delete _0x5ed907[_0x70ba('0x18')];}_0xb6d69a[_0x70ba('0x19')](0x1f4)[_0x70ba('0x1a')](_0x5ed907);}};}function checkError(){return function(_0x26c039){if(!_0x26c039){throw new RangeError(_0x70ba('0x1b'));}return _0x26c039;};}function respondWithRpcPromise(_0x2a1328,_0x4570b0){return new BPromise(function(_0x273ce4,_0x5ebe9d){var _0x3b31ef=amiClient;return _0x3b31ef[_0x70ba('0x1c')](_0x2a1328,_0x4570b0)['then'](function(_0x123b0c){if(_0x123b0c['error']){if(_0x123b0c['error'][_0x70ba('0x1d')]===0x1f4){return _0x5ebe9d(_0x123b0c['error'][_0x70ba('0x1e')]);}return _0x273ce4(_0x123b0c[_0x70ba('0x16')]['message']);}else{_0x273ce4(_0x123b0c[_0x70ba('0x1f')]);}})['catch'](function(_0x5ad828){_0x5ebe9d(_0x5ad828);});});}function getAgent(_0x39482c){return db['User'][_0x70ba('0x20')]({'where':{'id':_0x39482c,'role':_0x70ba('0x21')}})[_0x70ba('0x22')](checkError());}function getAgentCheckSession(_0x33e218,_0x2c6d18){return new BPromise(function(_0x265423,_0x5a8558){var _0x2d840e=respondWithRpcPromise(_0x70ba('0x23'));var _0x797467=getAgent(_0x33e218);Promise['all']([_0x2d840e,_0x797467])[_0x70ba('0x22')](function(_0x51b5cb){var _0x5955dc=_0x51b5cb[0x0];var _0x505f98=_0x51b5cb[0x1];var _0x77e564=_[_0x70ba('0x24')](_0x5955dc['rows'],function(_0x51b3e3){return _0x51b3e3[_0x70ba('0x25')]==_0x505f98['id']&&_0x51b3e3['sessionId']==_0x2c6d18;});if(_0x77e564[_0x70ba('0x26')]==0x1){_0x265423(_0x505f98);}else{_0x5a8558(new RangeError(_0x70ba('0x27')+_0x2c6d18+_0x70ba('0x28')));}});});}exports[_0x70ba('0x29')]=function(_0x1db0c4,_0x269943){logger[_0x70ba('0x13')](_0x70ba('0x2a'),_0x1db0c4[_0x70ba('0x2b')]);var _0x6055d3=originateValidation[_0x70ba('0xe')](_0x1db0c4['body']);if(_0x6055d3['length']>0x0){return _0x269943[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x6055d3);}var _0x943e49=_0x1db0c4['body']['userId'];var _0x507f00=_0x1db0c4[_0x70ba('0x2b')][_0x70ba('0x2d')];var _0x2200d3=_0x1db0c4['body'][_0x70ba('0x2e')];var _0x5bc56f=_0x1db0c4['body'][_0x70ba('0x2f')];return getAgent(_0x943e49)['then'](function(_0x15774e){logger[_0x70ba('0x13')]('entityFound:',_0x15774e[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x15774e['name']),_0x70ba('0x32'),{'callNumber':_0x507f00,'callerId':_0x2200d3,'callbackUrl':_0x5bc56f});return _0x269943[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':_0x70ba('0x33')});})['catch'](handleError(_0x269943));};exports[_0x70ba('0x34')]=function(_0x569ae3,_0x17707a){logger[_0x70ba('0x13')](_0x70ba('0x35'),_0x569ae3[_0x70ba('0x2b')]);var _0x16ce39=hangupValidation[_0x70ba('0xe')](_0x569ae3[_0x70ba('0x2b')]);if(_0x16ce39['length']>0x0){return _0x17707a[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x16ce39);}var _0x31e713=_0x569ae3[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x473489=_0x569ae3['body'][_0x70ba('0x37')];return getAgent(_0x31e713)[_0x70ba('0x22')](function(_0x1861ed){logger['info']('entityFound:',_0x1861ed['name']);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x1861ed[_0x70ba('0x18')]),'webbar:hangup',{'sessionId':_0x473489});return _0x17707a[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':_0x70ba('0x38')});})[_0x70ba('0x39')](handleError(_0x17707a));};exports[_0x70ba('0x3a')]=function(_0x54e732,_0x5ee74c){logger[_0x70ba('0x13')](_0x70ba('0x3b'),_0x54e732[_0x70ba('0x2b')]);var _0x5a1edb=answerValidation['validate'](_0x54e732[_0x70ba('0x2b')]);if(_0x5a1edb['length']>0x0){return _0x5ee74c[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x5a1edb);}var _0x705ca4=_0x54e732[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x51f4df=_0x54e732[_0x70ba('0x2b')][_0x70ba('0x37')];return getAgent(_0x705ca4)[_0x70ba('0x22')](function(_0x3dc2f7){logger[_0x70ba('0x13')](_0x70ba('0x3c'),_0x3dc2f7[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x3dc2f7[_0x70ba('0x18')]),_0x70ba('0x3d'),{'sessionId':_0x51f4df});return _0x5ee74c[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':_0x70ba('0x3e')});})[_0x70ba('0x39')](handleError(_0x5ee74c));};exports['hold']=function(_0xd7638f,_0x3121f6){logger['info'](_0x70ba('0x3f'),_0xd7638f[_0x70ba('0x2b')]);var _0x3de825=holdValidation[_0x70ba('0xe')](_0xd7638f[_0x70ba('0x2b')]);if(_0x3de825[_0x70ba('0x26')]>0x0){return _0x3121f6[_0x70ba('0x19')](0x190)['json'](_0x3de825);}var _0x2e2613=_0xd7638f[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x3d1f89=_0xd7638f[_0x70ba('0x2b')][_0x70ba('0x37')];return getAgent(_0x2e2613)[_0x70ba('0x22')](function(_0x400c37){logger[_0x70ba('0x13')](_0x70ba('0x3c'),_0x400c37[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x400c37[_0x70ba('0x18')]),_0x70ba('0x40'),{'sessionId':_0x3d1f89});return _0x3121f6[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':'hold\x20executed!'});})[_0x70ba('0x39')](handleError(_0x3121f6));};exports[_0x70ba('0x41')]=function(_0x2dc3c5,_0x19c99c){logger['info']('unhold\x20fired:',_0x2dc3c5['body']);var _0x471d19=unholdValidation[_0x70ba('0xe')](_0x2dc3c5['body']);if(_0x471d19['length']>0x0){return _0x19c99c[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x471d19);}var _0x3e3779=_0x2dc3c5[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x4e2397=_0x2dc3c5[_0x70ba('0x2b')]['sessionId'];return getAgent(_0x3e3779)['then'](function(_0x361699){logger[_0x70ba('0x13')](_0x70ba('0x3c'),_0x361699[_0x70ba('0x18')]);emit(util['format'](_0x70ba('0x31'),_0x361699[_0x70ba('0x18')]),'webbar:unhold',{'sessionId':_0x4e2397});return _0x19c99c['status'](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x70ba('0x39')](handleError(_0x19c99c));};exports[_0x70ba('0x42')]=function(_0x1cb9c7,_0x4cc5b1){logger[_0x70ba('0x13')](_0x70ba('0x43'),_0x4cc5b1[_0x70ba('0x2b')]);var _0x5214eb=callsValidation[_0x70ba('0xe')](_0x1cb9c7[_0x70ba('0x2b')]);if(_0x5214eb['length']>0x0){return _0x4cc5b1['status'](0x190)[_0x70ba('0x2c')](_0x5214eb);}var _0x15b3ab=_0x1cb9c7[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x10e824=respondWithRpcPromise(_0x70ba('0x23'));var _0x44cb31=getAgent(_0x15b3ab);return Promise['all']([_0x10e824,_0x44cb31])[_0x70ba('0x22')](function(_0x27d101){var _0x4de412=_0x27d101[0x0];var _0x508da6=_0x27d101[0x1];var _0x137b7d=_[_0x70ba('0x24')](_0x4de412['rows'],function(_0x4ea26b){return _0x4ea26b[_0x70ba('0x25')]==_0x508da6['id'];});return _0x4cc5b1['status'](0xc8)['json']({'count':_0x137b7d[_0x70ba('0x26')],'rows':_0x137b7d});})[_0x70ba('0x39')](handleError(_0x4cc5b1));};exports[_0x70ba('0x44')]=function(_0xb03649,_0x10bb90){logger[_0x70ba('0x13')](_0x70ba('0x45'),_0xb03649['body']);var _0x46a8a6=conferenceValidation[_0x70ba('0xe')](_0xb03649[_0x70ba('0x2b')]);if(_0x46a8a6[_0x70ba('0x26')]>0x0){return _0x10bb90[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x46a8a6);}var _0x5d58a1=_0xb03649[_0x70ba('0x2b')]['userId'];return getAgent(_0x5d58a1)[_0x70ba('0x22')](function(_0x4b385b){logger[_0x70ba('0x13')](_0x70ba('0x3c'),_0x4b385b[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x4b385b[_0x70ba('0x18')]),'webbar:conference');return _0x10bb90[_0x70ba('0x19')](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0x70ba('0x39')](handleError(_0x10bb90));};exports[_0x70ba('0x46')]=function(_0x5b1824,_0x208333){logger['info'](_0x70ba('0x47'),_0x5b1824[_0x70ba('0x2b')]);var _0x378893=transferValidation['validate'](_0x5b1824[_0x70ba('0x2b')]);if(_0x378893['length']>0x0){return _0x208333[_0x70ba('0x19')](0x190)['json'](_0x378893);}var _0x2ee3d0=_0x5b1824[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x4ebc09=_0x5b1824['body'][_0x70ba('0x37')];var _0x530324=_0x5b1824[_0x70ba('0x2b')][_0x70ba('0x48')];return getAgent(_0x2ee3d0)[_0x70ba('0x22')](function(_0x32a246){logger['info'](_0x70ba('0x3c'),_0x32a246[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x32a246[_0x70ba('0x18')]),_0x70ba('0x49'),{'sessionId':_0x4ebc09,'transferNumber':_0x530324});return _0x208333[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0x70ba('0x39')](handleError(_0x208333));}; \ No newline at end of file +var _0xb6b1=['hold\x20executed!','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','all','filter','rows','conference','conference\x20fired:','webbar:conference','transfer','transferNumber','transfer\x20executed!','path','../../mysqldb','util','bluebird','client','../../config/logger','webbarapi','ioredis','redis','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','emit','handleError:','error','stack','name','status','send','NotFound','request','then','message','result','User','findOne','agent','UserId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','length','json','userId','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','catch','hangup','webbar:hangup','hangup\x20executed!','answer\x20fired:','sessionId','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold'];(function(_0x1443d5,_0x21f839){var _0x3f8e34=function(_0x5e1263){while(--_0x5e1263){_0x1443d5['push'](_0x1443d5['shift']());}};_0x3f8e34(++_0x21f839);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x44fef1,_0x132cf4){_0x44fef1=_0x44fef1-0x0;var _0x3c3a04=_0xb6b1[_0x44fef1];return _0x3c3a04;};'use strict';var path=require(_0x1b6b('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x1b6b('0x1'))['db'];var config=require('../../config/environment');var util=require(_0x1b6b('0x2'));var BPromise=require(_0x1b6b('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x1b6b('0x4')]['http']({'port':0x232a});var logger=require(_0x1b6b('0x5'))(_0x1b6b('0x6'));var Redis=require(_0x1b6b('0x7'));config[_0x1b6b('0x8')]=_['defaults'](config[_0x1b6b('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x1b6b('0x9'))(new Redis(config['redis']));var Schema=require(_0x1b6b('0xa'));var originateValidation=new Schema({'userId':{'type':_0x1b6b('0xb'),'required':[!![],_0x1b6b('0xc')]},'callNumber':{'type':_0x1b6b('0xd'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0x1b6b('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x1b6b('0xb'),'required':[!![],_0x1b6b('0xc')]},'sessionId':{'type':_0x1b6b('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x1b6b('0xb'),'required':[!![],_0x1b6b('0xc')]},'sessionId':{'type':_0x1b6b('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x1b6b('0xc')]},'sessionId':{'type':_0x1b6b('0xd'),'required':[!![],_0x1b6b('0xe')]},'transferNumber':{'type':'string','required':[!![],_0x1b6b('0xf')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x1b6b('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x1b6b('0xb'),'required':[!![],_0x1b6b('0xc')]},'sessionId':{'type':_0x1b6b('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x1b6b('0xb'),'required':[!![],_0x1b6b('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0x1b6b('0xb'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x1069a4,_0x251821,_0x10af08){logger[_0x1b6b('0x10')](_0x1069a4,_0x251821,JSON['stringify'](_0x10af08));io['to'](_0x1069a4)[_0x1b6b('0x11')](_0x251821,_0x10af08);}function handleError(_0x3dd677){return function(_0x2e608b){console['log'](_0x1b6b('0x12'),_0x2e608b,_0x2e608b instanceof RangeError);logger[_0x1b6b('0x13')](_0x2e608b[_0x1b6b('0x14')]);if(_0x2e608b instanceof RangeError){if(_0x2e608b[_0x1b6b('0x15')]){delete _0x2e608b[_0x1b6b('0x15')];}_0x3dd677[_0x1b6b('0x16')](0x194)[_0x1b6b('0x17')](_0x2e608b);}else{if(_0x2e608b[_0x1b6b('0x15')]){delete _0x2e608b[_0x1b6b('0x15')];}_0x3dd677[_0x1b6b('0x16')](0x1f4)['send'](_0x2e608b);}};}function checkError(){return function(_0x283675){if(!_0x283675){throw new RangeError(_0x1b6b('0x18'));}return _0x283675;};}function respondWithRpcPromise(_0x3b427d,_0xa8cd35){return new BPromise(function(_0x27974f,_0x276713){var _0x3d4ec2=amiClient;return _0x3d4ec2[_0x1b6b('0x19')](_0x3b427d,_0xa8cd35)[_0x1b6b('0x1a')](function(_0x4987ee){if(_0x4987ee[_0x1b6b('0x13')]){if(_0x4987ee['error']['code']===0x1f4){return _0x276713(_0x4987ee['error'][_0x1b6b('0x1b')]);}return _0x27974f(_0x4987ee[_0x1b6b('0x13')]['message']);}else{_0x27974f(_0x4987ee[_0x1b6b('0x1c')]);}})['catch'](function(_0x15dfc7){_0x276713(_0x15dfc7);});});}function getAgent(_0x440658){return db[_0x1b6b('0x1d')][_0x1b6b('0x1e')]({'where':{'id':_0x440658,'role':_0x1b6b('0x1f')}})[_0x1b6b('0x1a')](checkError());}function getAgentCheckSession(_0x5d0a0a,_0xe8b7b5){return new BPromise(function(_0x1bb7f3,_0x173961){var _0x3b33d4=respondWithRpcPromise('VoiceChannels');var _0x23dac4=getAgent(_0x5d0a0a);Promise['all']([_0x3b33d4,_0x23dac4])['then'](function(_0x39b055){var _0x4e9843=_0x39b055[0x0];var _0x165fe8=_0x39b055[0x1];var _0x5c6faa=_['filter'](_0x4e9843['rows'],function(_0x36878c){return _0x36878c[_0x1b6b('0x20')]==_0x165fe8['id']&&_0x36878c['sessionId']==_0xe8b7b5;});if(_0x5c6faa['length']==0x1){_0x1bb7f3(_0x165fe8);}else{_0x173961(new RangeError(_0x1b6b('0x21')+_0xe8b7b5+_0x1b6b('0x22')));}});});}exports[_0x1b6b('0x23')]=function(_0x1bf52c,_0x56f31b){logger[_0x1b6b('0x10')](_0x1b6b('0x24'),_0x1bf52c[_0x1b6b('0x25')]);var _0x34cb27=originateValidation[_0x1b6b('0xa')](_0x1bf52c[_0x1b6b('0x25')]);if(_0x34cb27[_0x1b6b('0x26')]>0x0){return _0x56f31b[_0x1b6b('0x16')](0x190)[_0x1b6b('0x27')](_0x34cb27);}var _0x517cf7=_0x1bf52c[_0x1b6b('0x25')][_0x1b6b('0x28')];var _0x3d6e4d=_0x1bf52c[_0x1b6b('0x25')]['callNumber'];var _0x281350=_0x1bf52c['body'][_0x1b6b('0x29')];var _0x54aade=_0x1bf52c['body'][_0x1b6b('0x2a')];return getAgent(_0x517cf7)[_0x1b6b('0x1a')](function(_0xb658f1){logger['info'](_0x1b6b('0x2b'),_0xb658f1[_0x1b6b('0x15')]);emit(util[_0x1b6b('0x2c')](_0x1b6b('0x2d'),_0xb658f1[_0x1b6b('0x15')]),_0x1b6b('0x2e'),{'callNumber':_0x3d6e4d,'callerId':_0x281350,'callbackUrl':_0x54aade});return _0x56f31b[_0x1b6b('0x16')](0xc8)[_0x1b6b('0x27')]({'error':![],'message':_0x1b6b('0x2f')});})[_0x1b6b('0x30')](handleError(_0x56f31b));};exports[_0x1b6b('0x31')]=function(_0x279022,_0x3fbbb3){logger[_0x1b6b('0x10')]('hangup\x20fired:',_0x279022[_0x1b6b('0x25')]);var _0x47349b=hangupValidation['validate'](_0x279022[_0x1b6b('0x25')]);if(_0x47349b['length']>0x0){return _0x3fbbb3[_0x1b6b('0x16')](0x190)[_0x1b6b('0x27')](_0x47349b);}var _0x18f725=_0x279022['body'][_0x1b6b('0x28')];var _0x89482a=_0x279022[_0x1b6b('0x25')]['sessionId'];return getAgent(_0x18f725)[_0x1b6b('0x1a')](function(_0x478287){logger[_0x1b6b('0x10')]('entityFound:',_0x478287['name']);emit(util['format'](_0x1b6b('0x2d'),_0x478287[_0x1b6b('0x15')]),_0x1b6b('0x32'),{'sessionId':_0x89482a});return _0x3fbbb3[_0x1b6b('0x16')](0xc8)[_0x1b6b('0x27')]({'error':![],'message':_0x1b6b('0x33')});})[_0x1b6b('0x30')](handleError(_0x3fbbb3));};exports['answer']=function(_0x229d9e,_0x165384){logger[_0x1b6b('0x10')](_0x1b6b('0x34'),_0x229d9e[_0x1b6b('0x25')]);var _0x3d8374=answerValidation['validate'](_0x229d9e[_0x1b6b('0x25')]);if(_0x3d8374[_0x1b6b('0x26')]>0x0){return _0x165384[_0x1b6b('0x16')](0x190)[_0x1b6b('0x27')](_0x3d8374);}var _0x27f41f=_0x229d9e[_0x1b6b('0x25')][_0x1b6b('0x28')];var _0x393a56=_0x229d9e[_0x1b6b('0x25')][_0x1b6b('0x35')];return getAgent(_0x27f41f)[_0x1b6b('0x1a')](function(_0x32ee2f){logger['info'](_0x1b6b('0x2b'),_0x32ee2f[_0x1b6b('0x15')]);emit(util[_0x1b6b('0x2c')](_0x1b6b('0x2d'),_0x32ee2f[_0x1b6b('0x15')]),_0x1b6b('0x36'),{'sessionId':_0x393a56});return _0x165384['status'](0xc8)['json']({'error':![],'message':_0x1b6b('0x37')});})['catch'](handleError(_0x165384));};exports[_0x1b6b('0x38')]=function(_0x5bd593,_0x24c009){logger[_0x1b6b('0x10')](_0x1b6b('0x39'),_0x5bd593[_0x1b6b('0x25')]);var _0x53cb3d=holdValidation[_0x1b6b('0xa')](_0x5bd593['body']);if(_0x53cb3d['length']>0x0){return _0x24c009[_0x1b6b('0x16')](0x190)[_0x1b6b('0x27')](_0x53cb3d);}var _0x151774=_0x5bd593[_0x1b6b('0x25')]['userId'];var _0x45f31b=_0x5bd593['body'][_0x1b6b('0x35')];return getAgent(_0x151774)[_0x1b6b('0x1a')](function(_0x281f19){logger['info'](_0x1b6b('0x2b'),_0x281f19['name']);emit(util[_0x1b6b('0x2c')]('user:%s',_0x281f19[_0x1b6b('0x15')]),_0x1b6b('0x3a'),{'sessionId':_0x45f31b});return _0x24c009[_0x1b6b('0x16')](0xc8)[_0x1b6b('0x27')]({'error':![],'message':_0x1b6b('0x3b')});})[_0x1b6b('0x30')](handleError(_0x24c009));};exports['unhold']=function(_0x4c1e02,_0x2be336){logger[_0x1b6b('0x10')]('unhold\x20fired:',_0x4c1e02[_0x1b6b('0x25')]);var _0x459030=unholdValidation[_0x1b6b('0xa')](_0x4c1e02[_0x1b6b('0x25')]);if(_0x459030[_0x1b6b('0x26')]>0x0){return _0x2be336['status'](0x190)[_0x1b6b('0x27')](_0x459030);}var _0x5ed55b=_0x4c1e02[_0x1b6b('0x25')][_0x1b6b('0x28')];var _0x295002=_0x4c1e02[_0x1b6b('0x25')][_0x1b6b('0x35')];return getAgent(_0x5ed55b)[_0x1b6b('0x1a')](function(_0x32cde4){logger[_0x1b6b('0x10')](_0x1b6b('0x2b'),_0x32cde4['name']);emit(util['format']('user:%s',_0x32cde4[_0x1b6b('0x15')]),'webbar:unhold',{'sessionId':_0x295002});return _0x2be336['status'](0xc8)[_0x1b6b('0x27')]({'error':![],'message':_0x1b6b('0x3c')});})[_0x1b6b('0x30')](handleError(_0x2be336));};exports[_0x1b6b('0x3d')]=function(_0x527aca,_0x1f549c){logger[_0x1b6b('0x10')](_0x1b6b('0x3e'),_0x1f549c['body']);var _0x4df1e4=callsValidation[_0x1b6b('0xa')](_0x527aca[_0x1b6b('0x25')]);if(_0x4df1e4[_0x1b6b('0x26')]>0x0){return _0x1f549c['status'](0x190)['json'](_0x4df1e4);}var _0x5c3276=_0x527aca['body'][_0x1b6b('0x28')];var _0x13f3d8=respondWithRpcPromise(_0x1b6b('0x3f'));var _0x2de012=getAgent(_0x5c3276);return Promise[_0x1b6b('0x40')]([_0x13f3d8,_0x2de012])[_0x1b6b('0x1a')](function(_0x4be484){var _0x1e16fd=_0x4be484[0x0];var _0x3f80d6=_0x4be484[0x1];var _0x1d87d6=_[_0x1b6b('0x41')](_0x1e16fd[_0x1b6b('0x42')],function(_0x1e3ce2){return _0x1e3ce2['UserId']==_0x3f80d6['id'];});return _0x1f549c[_0x1b6b('0x16')](0xc8)['json']({'count':_0x1d87d6['length'],'rows':_0x1d87d6});})['catch'](handleError(_0x1f549c));};exports[_0x1b6b('0x43')]=function(_0x57228d,_0x593726){logger[_0x1b6b('0x10')](_0x1b6b('0x44'),_0x57228d[_0x1b6b('0x25')]);var _0x3cba4a=conferenceValidation[_0x1b6b('0xa')](_0x57228d[_0x1b6b('0x25')]);if(_0x3cba4a[_0x1b6b('0x26')]>0x0){return _0x593726['status'](0x190)[_0x1b6b('0x27')](_0x3cba4a);}var _0x5e8781=_0x57228d[_0x1b6b('0x25')][_0x1b6b('0x28')];return getAgent(_0x5e8781)[_0x1b6b('0x1a')](function(_0x54fc6b){logger['info'](_0x1b6b('0x2b'),_0x54fc6b[_0x1b6b('0x15')]);emit(util[_0x1b6b('0x2c')](_0x1b6b('0x2d'),_0x54fc6b[_0x1b6b('0x15')]),_0x1b6b('0x45'));return _0x593726[_0x1b6b('0x16')](0xc8)[_0x1b6b('0x27')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x593726));};exports[_0x1b6b('0x46')]=function(_0x1f4752,_0x19b1c6){logger[_0x1b6b('0x10')]('transfer\x20fired:',_0x1f4752[_0x1b6b('0x25')]);var _0x4dac8f=transferValidation[_0x1b6b('0xa')](_0x1f4752[_0x1b6b('0x25')]);if(_0x4dac8f['length']>0x0){return _0x19b1c6[_0x1b6b('0x16')](0x190)[_0x1b6b('0x27')](_0x4dac8f);}var _0x358ea9=_0x1f4752[_0x1b6b('0x25')][_0x1b6b('0x28')];var _0x10bd40=_0x1f4752['body'][_0x1b6b('0x35')];var _0x3fbc4b=_0x1f4752['body'][_0x1b6b('0x47')];return getAgent(_0x358ea9)[_0x1b6b('0x1a')](function(_0x2a816b){logger[_0x1b6b('0x10')](_0x1b6b('0x2b'),_0x2a816b[_0x1b6b('0x15')]);emit(util[_0x1b6b('0x2c')](_0x1b6b('0x2d'),_0x2a816b['name']),'webbar:transfer',{'sessionId':_0x10bd40,'transferNumber':_0x3fbc4b});return _0x19b1c6['status'](0xc8)[_0x1b6b('0x27')]({'error':![],'message':_0x1b6b('0x48')});})[_0x1b6b('0x30')](handleError(_0x19b1c6));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 3ce1678..b41609b 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 _0x4975=['describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAgents','/:id/applications','getApplications','post','create','addAnswer','/:id/users','addApplications','/:id/notify','notify','/:id/send','send','put','update','delete','removeDispositions','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated'];(function(_0xc6bdc4,_0x2ae2a0){var _0x1d4eb8=function(_0x22bc4b){while(--_0x22bc4b){_0xc6bdc4['push'](_0xc6bdc4['shift']());}};_0x1d4eb8(++_0x2ae2a0);}(_0x4975,0x86));var _0x5497=function(_0x59ce75,_0x324a48){_0x59ce75=_0x59ce75-0x0;var _0x23ddc3=_0x4975[_0x59ce75];return _0x23ddc3;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0xa')](_0x5497('0x11'),auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0xa')](_0x5497('0x13'),auth[_0x5497('0xd')](),controller['getAnswers']);router['get']('/:id/users',auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router[_0x5497('0xa')](_0x5497('0x15'),auth[_0x5497('0xd')](),controller[_0x5497('0x16')]);router[_0x5497('0x17')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x18')]);router[_0x5497('0x17')]('/:id/dispositions',auth[_0x5497('0xd')](),controller['addDisposition']);router[_0x5497('0x17')](_0x5497('0x13'),auth[_0x5497('0xd')](),controller[_0x5497('0x19')]);router[_0x5497('0x17')](_0x5497('0x1a'),auth[_0x5497('0xd')](),controller['addAgents']);router['post'](_0x5497('0x15'),auth[_0x5497('0xd')](),controller[_0x5497('0x1b')]);router['post'](_0x5497('0x1c'),controller[_0x5497('0x1d')]);router[_0x5497('0x17')](_0x5497('0x1e'),auth[_0x5497('0xd')](),controller[_0x5497('0x1f')]);router[_0x5497('0x20')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x21')]);router[_0x5497('0x22')]('/:id',auth[_0x5497('0xd')](),controller['destroy']);router[_0x5497('0x22')](_0x5497('0x11'),auth[_0x5497('0xd')](),controller[_0x5497('0x23')]);router[_0x5497('0x22')](_0x5497('0x13'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x5497('0x22')](_0x5497('0x1a'),auth[_0x5497('0xd')](),controller[_0x5497('0x24')]);module['exports']=router; \ No newline at end of file +var _0x1a37=['get','index','/describe','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','/:id/users','addAgents','addApplications','notify','/:id/send','send','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1a37,0xb4));var _0x71a3=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x1a37[_0x1694f5];return _0x5b4321;};'use strict';var multer=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var path=require(_0x71a3('0x2'));var timeout=require(_0x71a3('0x3'));var express=require(_0x71a3('0x4'));var router=express[_0x71a3('0x5')]();var fs_extra=require(_0x71a3('0x6'));var auth=require(_0x71a3('0x7'));var interaction=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var controller=require('./whatsappAccount.controller');router[_0x71a3('0xa')]('/',auth['isAuthenticated'](),controller[_0x71a3('0xb')]);router[_0x71a3('0xa')](_0x71a3('0xc'),auth[_0x71a3('0xd')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x71a3('0xe')]);router[_0x71a3('0xa')](_0x71a3('0xf'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x10')]);router[_0x71a3('0xa')](_0x71a3('0x11'),auth[_0x71a3('0xd')](),controller['getAnswers']);router['get']('/:id/users',auth[_0x71a3('0xd')](),controller[_0x71a3('0x12')]);router[_0x71a3('0xa')](_0x71a3('0x13'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x14')]);router[_0x71a3('0x15')]('/',auth[_0x71a3('0xd')](),controller[_0x71a3('0x16')]);router[_0x71a3('0x15')](_0x71a3('0xf'),auth['isAuthenticated'](),controller[_0x71a3('0x17')]);router[_0x71a3('0x15')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x71a3('0x18')]);router[_0x71a3('0x15')](_0x71a3('0x19'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x1a')]);router[_0x71a3('0x15')]('/:id/applications',auth[_0x71a3('0xd')](),controller[_0x71a3('0x1b')]);router['post']('/:id/notify',controller[_0x71a3('0x1c')]);router[_0x71a3('0x15')](_0x71a3('0x1d'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x1e')]);router['put'](_0x71a3('0x1f'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x20')]);router[_0x71a3('0x21')](_0x71a3('0x1f'),auth['isAuthenticated'](),controller[_0x71a3('0x22')]);router['delete'](_0x71a3('0xf'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x23')]);router[_0x71a3('0x21')](_0x71a3('0x11'),auth[_0x71a3('0xd')](),controller['removeAnswers']);router[_0x71a3('0x21')](_0x71a3('0x19'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x24')]);module[_0x71a3('0x25')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 9a7f012..bf424c9 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 _0x2f44=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','ENUM','sinch','TEXT','BOOLEAN','INTEGER'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0x2f44,0x1d3));var _0x42f4=function(_0x5c812f,_0x790971){_0x5c812f=_0x5c812f-0x0;var _0x39f134=_0x2f44[_0x5c812f];return _0x39f134;};'use strict';var Sequelize=require(_0x42f4('0x0'));var rs=require(_0x42f4('0x1'));module['exports']={'name':{'type':Sequelize[_0x42f4('0x2')],'unique':_0x42f4('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x42f4('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x42f4('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x42f4('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x42f4('0x4')]('twilio',_0x42f4('0x5'))},'accountSid':{'type':Sequelize[_0x42f4('0x2')]},'baseUrl':{'type':Sequelize[_0x42f4('0x2')]},'authToken':{'type':Sequelize[_0x42f4('0x2')]},'notificationTemplate':{'type':Sequelize[_0x42f4('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x42f4('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x42f4('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x42f4('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x42f4('0x8')],'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[_0x42f4('0x8')],'comment':_0x42f4('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x42f4('0xa'),'set':function(_0x425c89){if(!_0x425c89){this[_0x42f4('0xb')](_0x42f4('0xc'),null);}this[_0x42f4('0xb')](_0x42f4('0xd'),_0x425c89);}},'description':{'type':Sequelize[_0x42f4('0x2')]}}; \ No newline at end of file +var _0xf03f=['ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','generate'];(function(_0x2d1995,_0x5378e3){var _0x3dffc4=function(_0x4a713d){while(--_0x4a713d){_0x2d1995['push'](_0x2d1995['shift']());}};_0x3dffc4(++_0x5378e3);}(_0xf03f,0x11a));var _0xff03=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xf03f[_0x2261ce];return _0x524640;};'use strict';var Sequelize=require(_0xff03('0x0'));var rs=require('randomstring');module[_0xff03('0x1')]={'name':{'type':Sequelize[_0xff03('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xff03('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xff03('0x2')],'defaultValue':function(){return rs[_0xff03('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xff03('0x4')](_0xff03('0x5'),'sinch')},'accountSid':{'type':Sequelize[_0xff03('0x2')]},'baseUrl':{'type':Sequelize[_0xff03('0x2')]},'authToken':{'type':Sequelize[_0xff03('0x2')]},'notificationTemplate':{'type':Sequelize[_0xff03('0x6')],'defaultValue':function(){return _0xff03('0x7');}},'notificationSound':{'type':Sequelize[_0xff03('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xff03('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xff03('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xff03('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xff03('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xff03('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xff03('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xff03('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xff03('0x8')],'defaultValue':![],'comment':_0xff03('0xa'),'set':function(_0x5acc70){if(!_0x5acc70){this[_0xff03('0xb')](_0xff03('0xc'),null);}this[_0xff03('0xb')]('mandatoryDisposition',_0x5acc70);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 87119ee..9941869 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 _0xc721=['message_id','applications','orderBy','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','MessageSid','sinch','notifications','messageId','Sequelize','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','CmList','Contacts','DESC','omit','contact','WhatsappInteraction','interaction','created','autoclose','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','List','CmContact','out','dataValues','Messages','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','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','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','http','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','save','destroy','WhatsappAccounts','UserProfileResource','end','stack','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','rows','params','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','update','Pause','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','rawAttributes','order','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','transaction','bulkCreate','WhatsappApplication','findAndCountAll','priority','getApplications','notify','Applications','account','statuses','read','state','WhatsappMessage','timestamp'];(function(_0x1623b5,_0x4544e1){var _0x5b5d9f=function(_0x1ac81a){while(--_0x1ac81a){_0x1623b5['push'](_0x1623b5['shift']());}};_0x5b5d9f(++_0x4544e1);}(_0xc721,0xfc));var _0x1c72=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc721[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1c72('0x0'));var rimraf=require(_0x1c72('0x1'));var zipdir=require(_0x1c72('0x2'));var jsonpatch=require(_0x1c72('0x3'));var rp=require(_0x1c72('0x4'));var moment=require(_0x1c72('0x5'));var BPromise=require(_0x1c72('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1c72('0x7'));var sox=require(_0x1c72('0x8'));var csv=require('to-csv');var ejs=require(_0x1c72('0x9'));var fs=require('fs');var fs_extra=require(_0x1c72('0xa'));var _=require(_0x1c72('0xb'));var squel=require(_0x1c72('0xc'));var crypto=require(_0x1c72('0xd'));var jsforce=require(_0x1c72('0xe'));var deskjs=require(_0x1c72('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1c72('0x10'));var Papa=require(_0x1c72('0x11'));var Redis=require('ioredis');var authService=require(_0x1c72('0x12'));var qs=require(_0x1c72('0x13'));var as=require(_0x1c72('0x14'));var hardwareService=require(_0x1c72('0x15'));var logger=require(_0x1c72('0x16'))(_0x1c72('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1c72('0x18'));var db=require(_0x1c72('0x19'))['db'];config[_0x1c72('0x1a')]=_[_0x1c72('0x1b')](config[_0x1c72('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x1c72('0x1c'))(new Redis(config[_0x1c72('0x1a')]));require(_0x1c72('0x1d'))[_0x1c72('0x1e')](socket);var jayson=require(_0x1c72('0x1f'));var client=jayson['client'][_0x1c72('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x401c41,_0x59b5c2,_0x2228ea,_0x5ac679){return new BPromise(function(_0x372318,_0x3ee99d){var _0xe49c71=_0x5ac679||client;return _0xe49c71['request'](_0x401c41,_0x2228ea)[_0x1c72('0x21')](function(_0x5ab28e){logger[_0x1c72('0x22')]('WhatsappAccount,\x20%s,\x20%s',_0x59b5c2,'request\x20sent');logger[_0x1c72('0x23')](_0x1c72('0x24'),_0x59b5c2,_0x1c72('0x25'),JSON[_0x1c72('0x26')](_0x5ab28e));if(_0x5ab28e['error']){if(_0x5ab28e[_0x1c72('0x27')]['code']===0x1f4){logger[_0x1c72('0x27')](_0x1c72('0x28'),_0x59b5c2,_0x5ab28e[_0x1c72('0x27')][_0x1c72('0x29')]);return _0x3ee99d(_0x5ab28e[_0x1c72('0x27')][_0x1c72('0x29')]);}logger['error'](_0x1c72('0x28'),_0x59b5c2,_0x5ab28e[_0x1c72('0x27')][_0x1c72('0x29')]);return _0x372318(_0x5ab28e[_0x1c72('0x27')]['message']);}else{logger['info'](_0x1c72('0x28'),_0x59b5c2,_0x1c72('0x25'));_0x372318(_0x5ab28e[_0x1c72('0x2a')]['message']);}})[_0x1c72('0x2b')](function(_0x257fb5){logger[_0x1c72('0x27')](_0x1c72('0x28'),_0x59b5c2,_0x257fb5);_0x3ee99d(_0x257fb5);});});}function respondWithStatusCode(_0x18a392,_0x1f6df0){_0x1f6df0=_0x1f6df0||0xcc;return function(_0x4f59fc){if(_0x4f59fc){return _0x18a392[_0x1c72('0x2c')](_0x1f6df0);}return _0x18a392[_0x1c72('0x2d')](_0x1f6df0)['end']();};}function respondWithResult(_0x3dfae2,_0x41371f){_0x41371f=_0x41371f||0xc8;return function(_0x332ab3){if(_0x332ab3){return _0x3dfae2[_0x1c72('0x2d')](_0x41371f)['json'](_0x332ab3);}};}function respondWithFilteredResult(_0xafce0b,_0x5d9dad){return function(_0x4a813e){if(_0x4a813e){var _0x299127=typeof _0x5d9dad['offset']===_0x1c72('0x2e')&&typeof _0x5d9dad['limit']===_0x1c72('0x2e');var _0x19d81a=_0x4a813e[_0x1c72('0x2f')];var _0x23ea2f=_0x299127?0x0:_0x5d9dad[_0x1c72('0x30')];var _0x4afa86=_0x299127?_0x4a813e['count']:_0x5d9dad[_0x1c72('0x30')]+_0x5d9dad[_0x1c72('0x31')];var _0xdf7c3b;if(_0x4afa86>=_0x19d81a){_0x4afa86=_0x19d81a;_0xdf7c3b=0xc8;}else{_0xdf7c3b=0xce;}_0xafce0b['status'](_0xdf7c3b);return _0xafce0b[_0x1c72('0x32')](_0x1c72('0x33'),_0x23ea2f+'-'+_0x4afa86+'/'+_0x19d81a)[_0x1c72('0x34')](_0x4a813e);}return null;};}function patchUpdates(_0x3e4349){return function(_0x16098c){try{jsonpatch[_0x1c72('0x35')](_0x16098c,_0x3e4349,!![]);}catch(_0x57feb2){return BPromise['reject'](_0x57feb2);}return _0x16098c[_0x1c72('0x36')]();};}function saveUpdates(_0x8bbc93,_0x3498a1){return function(_0x4f96a0){if(_0x4f96a0){return _0x4f96a0['update'](_0x8bbc93)[_0x1c72('0x21')](function(_0x996fa1){return _0x996fa1;});}return null;};}function removeEntity(_0x392d46,_0x3ba094){return function(_0x539601){if(_0x539601){return _0x539601[_0x1c72('0x37')]()[_0x1c72('0x21')](function(){var _0x5464ff=_0x539601['get']({'plain':!![]});var _0x20e9db=_0x1c72('0x38');return db[_0x1c72('0x39')][_0x1c72('0x37')]({'where':{'type':_0x20e9db,'resourceId':_0x5464ff['id']}})[_0x1c72('0x21')](function(){return _0x539601;});})['then'](function(){_0x392d46[_0x1c72('0x2d')](0xcc)[_0x1c72('0x3a')]();});}};}function handleEntityNotFound(_0x2b3fc8,_0x53c2b4){return function(_0x474894){if(!_0x474894){_0x2b3fc8[_0x1c72('0x2c')](0x194);}return _0x474894;};}function handleError(_0x2e7cc9,_0x59ae71){_0x59ae71=_0x59ae71||0x1f4;return function(_0x21d80f){logger['error'](_0x21d80f[_0x1c72('0x3b')]);if(_0x21d80f[_0x1c72('0x3c')]){delete _0x21d80f['name'];}_0x2e7cc9[_0x1c72('0x2d')](_0x59ae71)[_0x1c72('0x3d')](_0x21d80f);};}exports[_0x1c72('0x3e')]=function(_0x1f2a7b,_0x573333){var _0xab7300={'include':[{'model':db['Pause'],'as':_0x1c72('0x3f')}]},_0x305dfa={},_0x1601f0={'count':0x0,'rows':[]};var _0x44f176=_[_0x1c72('0x40')](db[_0x1c72('0x41')]['rawAttributes'],function(_0x429102){return{'name':_0x429102[_0x1c72('0x42')],'type':_0x429102[_0x1c72('0x43')]['key']};});_0x305dfa[_0x1c72('0x44')]=_['map'](_0x44f176,_0x1c72('0x3c'));_0x305dfa[_0x1c72('0x45')]=_[_0x1c72('0x46')](_0x1f2a7b[_0x1c72('0x45')]);_0x305dfa['filters']=_['intersection'](_0x305dfa[_0x1c72('0x44')],_0x305dfa[_0x1c72('0x45')]);_0xab7300[_0x1c72('0x47')]=_[_0x1c72('0x48')](_0x305dfa[_0x1c72('0x44')],qs[_0x1c72('0x49')](_0x1f2a7b[_0x1c72('0x45')][_0x1c72('0x49')]));_0xab7300[_0x1c72('0x47')]=_0xab7300[_0x1c72('0x47')][_0x1c72('0x4a')]?_0xab7300[_0x1c72('0x47')]:_0x305dfa[_0x1c72('0x44')];if(!_0x1f2a7b['query'][_0x1c72('0x4b')](_0x1c72('0x4c'))){_0xab7300[_0x1c72('0x31')]=qs[_0x1c72('0x31')](_0x1f2a7b['query'][_0x1c72('0x31')]);_0xab7300[_0x1c72('0x30')]=qs[_0x1c72('0x30')](_0x1f2a7b['query'][_0x1c72('0x30')]);}_0xab7300['order']=qs['sort'](_0x1f2a7b[_0x1c72('0x45')][_0x1c72('0x4d')]);_0xab7300[_0x1c72('0x4e')]=qs['filters'](_[_0x1c72('0x4f')](_0x1f2a7b['query'],_0x305dfa[_0x1c72('0x50')]),_0x44f176);if(_0x1f2a7b['query'][_0x1c72('0x51')]){_0xab7300['where']=_['merge'](_0xab7300[_0x1c72('0x4e')],{'$or':_['map'](_0x44f176,function(_0x418db4){if(_0x418db4[_0x1c72('0x43')]!==_0x1c72('0x52')){var _0x34cbc2={};_0x34cbc2[_0x418db4['name']]={'$like':'%'+_0x1f2a7b[_0x1c72('0x45')][_0x1c72('0x51')]+'%'};return _0x34cbc2;}})});}_0xab7300=_[_0x1c72('0x53')]({},_0xab7300,_0x1f2a7b[_0x1c72('0x54')]);var _0x4e48af={'where':_0xab7300[_0x1c72('0x4e')]};return db['WhatsappAccount']['count'](_0x4e48af)[_0x1c72('0x21')](function(_0x3f54d9){_0x1601f0[_0x1c72('0x2f')]=_0x3f54d9;if(_0x1f2a7b[_0x1c72('0x45')][_0x1c72('0x55')]){_0xab7300[_0x1c72('0x56')]=[{'all':!![]}];}return db[_0x1c72('0x41')]['findAll'](_0xab7300);})[_0x1c72('0x21')](function(_0x83542c){_0x1601f0[_0x1c72('0x57')]=_0x83542c;return _0x1601f0;})[_0x1c72('0x21')](respondWithFilteredResult(_0x573333,_0xab7300))[_0x1c72('0x2b')](handleError(_0x573333,null));};exports['show']=function(_0x44947f,_0xcca5d0){var _0x2c282f={'raw':![],'where':{'id':_0x44947f[_0x1c72('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x1c72('0x3f')}]},_0x22c840={};_0x22c840['model']=_[_0x1c72('0x46')](db['WhatsappAccount']['rawAttributes']);_0x22c840[_0x1c72('0x45')]=_[_0x1c72('0x46')](_0x44947f['query']);_0x22c840[_0x1c72('0x50')]=_[_0x1c72('0x48')](_0x22c840[_0x1c72('0x44')],_0x22c840[_0x1c72('0x45')]);_0x2c282f[_0x1c72('0x47')]=_[_0x1c72('0x48')](_0x22c840['model'],qs[_0x1c72('0x49')](_0x44947f['query'][_0x1c72('0x49')]));_0x2c282f[_0x1c72('0x47')]=_0x2c282f['attributes']['length']?_0x2c282f[_0x1c72('0x47')]:_0x22c840[_0x1c72('0x44')];if(_0x44947f[_0x1c72('0x45')][_0x1c72('0x55')]){_0x2c282f['include']=[{'all':!![]}];}_0x2c282f=_[_0x1c72('0x53')]({},_0x2c282f,_0x44947f[_0x1c72('0x54')]);return db[_0x1c72('0x41')][_0x1c72('0x59')](_0x2c282f)[_0x1c72('0x21')](handleEntityNotFound(_0xcca5d0,null))[_0x1c72('0x21')](respondWithResult(_0xcca5d0,null))[_0x1c72('0x2b')](handleError(_0xcca5d0,null));};exports[_0x1c72('0x5a')]=function(_0x114059,_0x3e01a7){return db['WhatsappAccount']['create'](_0x114059[_0x1c72('0x5b')],{})[_0x1c72('0x21')](function(_0xb80fa8){var _0x250202=_0x114059[_0x1c72('0x5c')][_0x1c72('0x5d')]({'plain':!![]});if(!_0x250202)throw new Error(_0x1c72('0x5e'));if(_0x250202[_0x1c72('0x5f')]===_0x1c72('0x5c')){var _0x53d6c0=_0xb80fa8[_0x1c72('0x5d')]({'plain':!![]});var _0x57ebb0=_0x1c72('0x38');return db[_0x1c72('0x60')]['find']({'where':{'name':_0x57ebb0,'userProfileId':_0x250202[_0x1c72('0x61')]},'raw':!![]})[_0x1c72('0x21')](function(_0x3ad88e){if(_0x3ad88e&&_0x3ad88e[_0x1c72('0x62')]===0x0){return db[_0x1c72('0x39')][_0x1c72('0x5a')]({'name':_0x53d6c0[_0x1c72('0x3c')],'resourceId':_0x53d6c0['id'],'type':_0x3ad88e[_0x1c72('0x3c')],'sectionId':_0x3ad88e['id']},{})[_0x1c72('0x21')](function(){return _0xb80fa8;});}else{return _0xb80fa8;}})['catch'](function(_0x464158){logger['error'](_0x1c72('0x63'),_0x464158);throw _0x464158;});}return _0xb80fa8;})[_0x1c72('0x21')](respondWithResult(_0x3e01a7,0xc9))[_0x1c72('0x2b')](handleError(_0x3e01a7,null));};exports[_0x1c72('0x64')]=function(_0x117d86,_0x34dac3){if(_0x117d86[_0x1c72('0x5b')]['id']){delete _0x117d86[_0x1c72('0x5b')]['id'];}return db[_0x1c72('0x41')]['find']({'where':{'id':_0x117d86[_0x1c72('0x58')]['id']},'include':[{'model':db[_0x1c72('0x65')],'as':'mandatoryDispositionPause'}]})[_0x1c72('0x21')](handleEntityNotFound(_0x34dac3,null))[_0x1c72('0x21')](saveUpdates(_0x117d86[_0x1c72('0x5b')],null))['then'](respondWithResult(_0x34dac3,null))[_0x1c72('0x2b')](handleError(_0x34dac3,null));};exports[_0x1c72('0x37')]=function(_0x680fec,_0x315ce0){return db[_0x1c72('0x41')][_0x1c72('0x59')]({'where':{'id':_0x680fec['params']['id']}})[_0x1c72('0x21')](handleEntityNotFound(_0x315ce0,null))[_0x1c72('0x21')](removeEntity(_0x315ce0,null))['catch'](handleError(_0x315ce0,null));};exports['describe']=function(_0x2d867e,_0xdf8c57){return db[_0x1c72('0x41')][_0x1c72('0x66')]()[_0x1c72('0x21')](respondWithResult(_0xdf8c57,null))[_0x1c72('0x2b')](handleError(_0xdf8c57,null));};exports[_0x1c72('0x67')]=function(_0x588c1f,_0x1f89e8,_0x1ab8c8){if(_0x588c1f['body']['id']){delete _0x588c1f['body']['id'];}return db['WhatsappAccount'][_0x1c72('0x59')]({'where':{'id':_0x588c1f[_0x1c72('0x58')]['id']}})[_0x1c72('0x21')](handleEntityNotFound(_0x1f89e8,null))[_0x1c72('0x21')](function(_0x3eaf3f){if(_0x3eaf3f){_0x588c1f[_0x1c72('0x5b')][_0x1c72('0x68')]=_0x3eaf3f['id'];return db[_0x1c72('0x69')]['create'](_0x588c1f['body']);}})[_0x1c72('0x21')](respondWithResult(_0x1f89e8,null))[_0x1c72('0x2b')](handleError(_0x1f89e8,null));};exports[_0x1c72('0x6a')]=function(_0x2b6549,_0x5bc35,_0x13cf64){var _0x2d8d02={'raw':![],'where':{}};var _0x2d5688={};var _0x3e5126={'count':0x0,'rows':[]};return db[_0x1c72('0x41')][_0x1c72('0x6b')]({'where':{'id':_0x2b6549[_0x1c72('0x58')]['id']}})[_0x1c72('0x21')](handleEntityNotFound(_0x5bc35,null))['then'](function(_0x2e7a1b){if(_0x2e7a1b){_0x2d5688['model']=_[_0x1c72('0x46')](db[_0x1c72('0x69')][_0x1c72('0x6c')]);_0x2d5688['query']=_['keys'](_0x2b6549['query']);_0x2d5688[_0x1c72('0x50')]=_[_0x1c72('0x48')](_0x2d5688['model'],_0x2d5688[_0x1c72('0x45')]);_0x2d8d02['attributes']=_[_0x1c72('0x48')](_0x2d5688[_0x1c72('0x44')],qs[_0x1c72('0x49')](_0x2b6549['query']['fields']));_0x2d8d02['attributes']=_0x2d8d02[_0x1c72('0x47')][_0x1c72('0x4a')]?_0x2d8d02[_0x1c72('0x47')]:_0x2d5688[_0x1c72('0x44')];if(!_0x2b6549[_0x1c72('0x45')][_0x1c72('0x4b')](_0x1c72('0x4c'))){_0x2d8d02[_0x1c72('0x31')]=qs[_0x1c72('0x31')](_0x2b6549[_0x1c72('0x45')][_0x1c72('0x31')]);_0x2d8d02[_0x1c72('0x30')]=qs['offset'](_0x2b6549[_0x1c72('0x45')]['offset']);}_0x2d8d02[_0x1c72('0x6d')]=qs[_0x1c72('0x4d')](_0x2b6549[_0x1c72('0x45')][_0x1c72('0x4d')]);_0x2d8d02[_0x1c72('0x4e')]=qs[_0x1c72('0x50')](_['pick'](_0x2b6549[_0x1c72('0x45')],_0x2d5688[_0x1c72('0x50')]));_0x2d8d02['where'][_0x1c72('0x68')]=_0x2e7a1b['id'];if(_0x2b6549['query'][_0x1c72('0x51')]){_0x2d8d02[_0x1c72('0x4e')]=_[_0x1c72('0x53')](_0x2d8d02[_0x1c72('0x4e')],{'$or':_[_0x1c72('0x40')](_0x2d8d02['attributes'],function(_0x664bf0){var _0x213c10={};_0x213c10[_0x664bf0]={'$like':'%'+_0x2b6549['query'][_0x1c72('0x51')]+'%'};return _0x213c10;})});}_0x2d8d02=_['merge']({},_0x2d8d02,_0x2b6549['options']);return db[_0x1c72('0x69')][_0x1c72('0x2f')]({'where':_0x2d8d02[_0x1c72('0x4e')]})[_0x1c72('0x21')](function(_0x381497){_0x3e5126['count']=_0x381497;if(_0x2b6549['query']['includeAll']){_0x2d8d02['include']=[{'all':!![]}];}return db[_0x1c72('0x69')][_0x1c72('0x6e')](_0x2d8d02);})['then'](function(_0x26865e){_0x3e5126['rows']=_0x26865e;return _0x3e5126;});}})[_0x1c72('0x21')](respondWithFilteredResult(_0x5bc35,_0x2d8d02))['catch'](handleError(_0x5bc35,null));};exports['removeDispositions']=function(_0xa97cf1,_0x63e135,_0x33492d){return db['WhatsappAccount'][_0x1c72('0x59')]({'where':{'id':_0xa97cf1[_0x1c72('0x58')]['id']}})[_0x1c72('0x21')](handleEntityNotFound(_0x63e135,null))[_0x1c72('0x21')](function(_0x48ba09){if(_0x48ba09){return _0x48ba09[_0x1c72('0x6f')](_0xa97cf1['query'][_0x1c72('0x70')]);}})[_0x1c72('0x21')](respondWithStatusCode(_0x63e135,null))[_0x1c72('0x2b')](handleError(_0x63e135,null));};exports[_0x1c72('0x71')]=function(_0x3668b4,_0x1d62a4,_0x3f4241){if(_0x3668b4['body']['id']){delete _0x3668b4[_0x1c72('0x5b')]['id'];}return db[_0x1c72('0x41')][_0x1c72('0x59')]({'where':{'id':_0x3668b4[_0x1c72('0x58')]['id']}})['then'](handleEntityNotFound(_0x1d62a4,null))[_0x1c72('0x21')](function(_0x556fae){if(_0x556fae){_0x3668b4[_0x1c72('0x5b')][_0x1c72('0x68')]=_0x556fae['id'];return db[_0x1c72('0x72')][_0x1c72('0x5a')](_0x3668b4['body']);}})['then'](respondWithResult(_0x1d62a4,null))[_0x1c72('0x2b')](handleError(_0x1d62a4,null));};exports[_0x1c72('0x73')]=function(_0x28d8b2,_0x1e32e1,_0x111397){var _0x4e4145={'raw':![],'where':{}};var _0x17b275={};var _0x28e86c={'count':0x0,'rows':[]};return db[_0x1c72('0x41')]['findOne']({'where':{'id':_0x28d8b2['params']['id']}})[_0x1c72('0x21')](handleEntityNotFound(_0x1e32e1,null))[_0x1c72('0x21')](function(_0x49d81a){if(_0x49d81a){_0x17b275[_0x1c72('0x44')]=_[_0x1c72('0x46')](db[_0x1c72('0x72')]['rawAttributes']);_0x17b275[_0x1c72('0x45')]=_[_0x1c72('0x46')](_0x28d8b2[_0x1c72('0x45')]);_0x17b275[_0x1c72('0x50')]=_[_0x1c72('0x48')](_0x17b275['model'],_0x17b275[_0x1c72('0x45')]);_0x4e4145[_0x1c72('0x47')]=_[_0x1c72('0x48')](_0x17b275[_0x1c72('0x44')],qs[_0x1c72('0x49')](_0x28d8b2[_0x1c72('0x45')][_0x1c72('0x49')]));_0x4e4145[_0x1c72('0x47')]=_0x4e4145[_0x1c72('0x47')]['length']?_0x4e4145[_0x1c72('0x47')]:_0x17b275[_0x1c72('0x44')];if(!_0x28d8b2['query'][_0x1c72('0x4b')]('nolimit')){_0x4e4145[_0x1c72('0x31')]=qs[_0x1c72('0x31')](_0x28d8b2[_0x1c72('0x45')][_0x1c72('0x31')]);_0x4e4145[_0x1c72('0x30')]=qs[_0x1c72('0x30')](_0x28d8b2[_0x1c72('0x45')][_0x1c72('0x30')]);}_0x4e4145[_0x1c72('0x6d')]=qs[_0x1c72('0x4d')](_0x28d8b2[_0x1c72('0x45')][_0x1c72('0x4d')]);_0x4e4145[_0x1c72('0x4e')]=qs[_0x1c72('0x50')](_['pick'](_0x28d8b2[_0x1c72('0x45')],_0x17b275[_0x1c72('0x50')]));_0x4e4145[_0x1c72('0x4e')][_0x1c72('0x68')]=_0x49d81a['id'];if(_0x28d8b2[_0x1c72('0x45')][_0x1c72('0x51')]){_0x4e4145[_0x1c72('0x4e')]=_['merge'](_0x4e4145[_0x1c72('0x4e')],{'$or':_['map'](_0x4e4145[_0x1c72('0x47')],function(_0xc84ef6){var _0x3d49b9={};_0x3d49b9[_0xc84ef6]={'$like':'%'+_0x28d8b2[_0x1c72('0x45')][_0x1c72('0x51')]+'%'};return _0x3d49b9;})});}_0x4e4145=_[_0x1c72('0x53')]({},_0x4e4145,_0x28d8b2[_0x1c72('0x54')]);return db['CannedAnswer'][_0x1c72('0x2f')]({'where':_0x4e4145[_0x1c72('0x4e')]})['then'](function(_0x47ea08){_0x28e86c[_0x1c72('0x2f')]=_0x47ea08;if(_0x28d8b2['query'][_0x1c72('0x55')]){_0x4e4145['include']=[{'all':!![]}];}return db[_0x1c72('0x72')][_0x1c72('0x6e')](_0x4e4145);})[_0x1c72('0x21')](function(_0x470ac0){_0x28e86c[_0x1c72('0x57')]=_0x470ac0;return _0x28e86c;});}})[_0x1c72('0x21')](respondWithFilteredResult(_0x1e32e1,_0x4e4145))[_0x1c72('0x2b')](handleError(_0x1e32e1,null));};exports['removeAnswers']=function(_0x4d15bf,_0x335c3a,_0x36ad83){return db[_0x1c72('0x41')]['find']({'where':{'id':_0x4d15bf['params']['id']}})[_0x1c72('0x21')](handleEntityNotFound(_0x335c3a,null))[_0x1c72('0x21')](function(_0x1fbf66){if(_0x1fbf66){return _0x1fbf66[_0x1c72('0x74')](_0x4d15bf['query'][_0x1c72('0x70')]);}})[_0x1c72('0x21')](respondWithStatusCode(_0x335c3a,null))[_0x1c72('0x2b')](handleError(_0x335c3a,null));};exports[_0x1c72('0x75')]=function(_0x12449a,_0x800a83,_0x3b81f4){return db[_0x1c72('0x41')][_0x1c72('0x59')]({'where':{'id':_0x12449a[_0x1c72('0x58')]['id']}})[_0x1c72('0x21')](handleEntityNotFound(_0x800a83,null))[_0x1c72('0x21')](function(_0x191213){if(_0x191213){return _0x191213[_0x1c72('0x75')](_0x12449a[_0x1c72('0x5b')][_0x1c72('0x70')],_['omit'](_0x12449a[_0x1c72('0x5b')],[_0x1c72('0x70'),'id'])||{})[_0x1c72('0x76')](function(_0x5464d7){for(var _0x4298c2=0x0;_0x4298c2<_0x12449a[_0x1c72('0x5b')]['ids']['length'];_0x4298c2+=0x1){socket[_0x1c72('0x77')](_0x1c72('0x78'),{'UserId':Number(_0x12449a[_0x1c72('0x5b')][_0x1c72('0x70')][_0x4298c2]),'WhatsappAccountId':Number(_0x12449a['params']['id'])});}return _0x5464d7;});}})[_0x1c72('0x21')](respondWithResult(_0x800a83,null))['catch'](handleError(_0x800a83,null));};exports[_0x1c72('0x79')]=function(_0x581c00,_0xbeff95,_0x132625){return db['WhatsappAccount'][_0x1c72('0x59')]({'where':{'id':_0x581c00[_0x1c72('0x58')]['id']}})[_0x1c72('0x21')](handleEntityNotFound(_0xbeff95,null))[_0x1c72('0x21')](function(_0x1d815e){if(_0x1d815e){return _0x1d815e[_0x1c72('0x79')](_0x581c00['query'][_0x1c72('0x70')])[_0x1c72('0x21')](function(){if(_[_0x1c72('0x7a')](_0x581c00[_0x1c72('0x45')]['ids'])){for(var _0x2bb25f=0x0;_0x2bb25f<_0x581c00[_0x1c72('0x45')][_0x1c72('0x70')][_0x1c72('0x4a')];_0x2bb25f+=0x1){socket[_0x1c72('0x77')](_0x1c72('0x7b'),{'UserId':Number(_0x581c00['query'][_0x1c72('0x70')][_0x2bb25f]),'WhatsappAccountId':Number(_0x581c00[_0x1c72('0x58')]['id'])});}}else{socket[_0x1c72('0x77')](_0x1c72('0x7b'),{'UserId':Number(_0x581c00[_0x1c72('0x45')][_0x1c72('0x70')]),'WhatsappAccountId':Number(_0x581c00[_0x1c72('0x58')]['id'])});}});}})[_0x1c72('0x21')](respondWithStatusCode(_0xbeff95,null))[_0x1c72('0x2b')](handleError(_0xbeff95,null));};exports[_0x1c72('0x7c')]=function(_0x247b42,_0x4cd44a,_0x1ee4d2){var _0x295f6b={};var _0x25b3cb={};var _0x882307;var _0x4af13c;return db['WhatsappAccount'][_0x1c72('0x6b')]({'where':{'id':_0x247b42[_0x1c72('0x58')]['id']}})[_0x1c72('0x21')](handleEntityNotFound(_0x4cd44a,null))[_0x1c72('0x21')](function(_0x14c7b7){if(_0x14c7b7){_0x882307=_0x14c7b7;_0x25b3cb['model']=_['keys'](db[_0x1c72('0x7d')][_0x1c72('0x6c')]);_0x25b3cb[_0x1c72('0x45')]=_['keys'](_0x247b42[_0x1c72('0x45')]);_0x25b3cb[_0x1c72('0x50')]=_[_0x1c72('0x48')](_0x25b3cb[_0x1c72('0x44')],_0x25b3cb['query']);_0x295f6b[_0x1c72('0x47')]=_['intersection'](_0x25b3cb['model'],qs[_0x1c72('0x49')](_0x247b42[_0x1c72('0x45')][_0x1c72('0x49')]));_0x295f6b['attributes']=_0x295f6b[_0x1c72('0x47')][_0x1c72('0x4a')]?_0x295f6b['attributes']:_0x25b3cb[_0x1c72('0x44')];_0x295f6b['order']=qs[_0x1c72('0x4d')](_0x247b42[_0x1c72('0x45')][_0x1c72('0x4d')]);_0x295f6b[_0x1c72('0x4e')]=qs[_0x1c72('0x50')](_['pick'](_0x247b42[_0x1c72('0x45')],_0x25b3cb[_0x1c72('0x50')]));if(_0x247b42[_0x1c72('0x45')][_0x1c72('0x51')]){_0x295f6b[_0x1c72('0x4e')]=_['merge'](_0x295f6b['where'],{'$or':_[_0x1c72('0x40')](_0x295f6b[_0x1c72('0x47')],function(_0x3cbab3){var _0x45ed43={};_0x45ed43[_0x3cbab3]={'$like':'%'+_0x247b42[_0x1c72('0x45')][_0x1c72('0x51')]+'%'};return _0x45ed43;})});}_0x295f6b=_[_0x1c72('0x53')]({},_0x295f6b,_0x247b42[_0x1c72('0x54')]);return _0x882307[_0x1c72('0x7c')](_0x295f6b);}})[_0x1c72('0x21')](function(_0x15dc4d){if(_0x15dc4d){_0x4af13c=_0x15dc4d['length'];if(!_0x247b42[_0x1c72('0x45')][_0x1c72('0x4b')](_0x1c72('0x4c'))){_0x295f6b[_0x1c72('0x31')]=qs[_0x1c72('0x31')](_0x247b42[_0x1c72('0x45')][_0x1c72('0x31')]);_0x295f6b['offset']=qs[_0x1c72('0x30')](_0x247b42[_0x1c72('0x45')][_0x1c72('0x30')]);}return _0x882307[_0x1c72('0x7c')](_0x295f6b);}})[_0x1c72('0x21')](function(_0x391648){if(_0x391648){return _0x391648?{'count':_0x4af13c,'rows':_0x391648}:null;}})['then'](respondWithResult(_0x4cd44a,null))[_0x1c72('0x2b')](handleError(_0x4cd44a,null));};exports['addApplications']=function(_0x2582df,_0xa831d4,_0x118d5c){return db['WhatsappAccount']['findOne']({'where':{'id':_0x2582df[_0x1c72('0x58')]['id']}})[_0x1c72('0x21')](handleEntityNotFound(_0xa831d4,null))[_0x1c72('0x21')](function(_0x10b70b){if(_0x10b70b){return db['sequelize'][_0x1c72('0x7e')](function(_0xfd3abe){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x2582df[_0x1c72('0x58')]['id']},'transaction':_0xfd3abe})[_0x1c72('0x21')](function(_0x43b8d9){var _0x278fc5=_[_0x1c72('0x40')](_0x2582df['body'],function(_0x3b3de){_0x3b3de[_0x1c72('0x68')]=_0x2582df['params']['id'];return _0x3b3de;});return db['WhatsappApplication'][_0x1c72('0x7f')](_0x278fc5,{'transaction':_0xfd3abe});});})[_0x1c72('0x21')](function(){return db[_0x1c72('0x80')][_0x1c72('0x81')]({'where':{'WhatsappAccountId':_0x2582df[_0x1c72('0x58')]['id']},'order':_0x1c72('0x82')});});}})['then'](respondWithResult(_0xa831d4,null))[_0x1c72('0x2b')](handleError(_0xa831d4,null));};exports[_0x1c72('0x83')]=function(_0x351c20,_0x3e28be,_0x512cee){var _0x3a9bf7={};var _0x4036f0={};var _0x1635a1;var _0x34912c;return db[_0x1c72('0x41')][_0x1c72('0x6b')]({'where':{'id':_0x351c20['params']['id']}})[_0x1c72('0x21')](handleEntityNotFound(_0x3e28be,null))[_0x1c72('0x21')](function(_0x3d5693){if(_0x3d5693){_0x1635a1=_0x3d5693;_0x4036f0['model']=_[_0x1c72('0x46')](db[_0x1c72('0x80')][_0x1c72('0x6c')]);_0x4036f0['query']=_[_0x1c72('0x46')](_0x351c20[_0x1c72('0x45')]);_0x4036f0[_0x1c72('0x50')]=_[_0x1c72('0x48')](_0x4036f0['model'],_0x4036f0[_0x1c72('0x45')]);_0x3a9bf7['attributes']=_[_0x1c72('0x48')](_0x4036f0[_0x1c72('0x44')],qs[_0x1c72('0x49')](_0x351c20[_0x1c72('0x45')][_0x1c72('0x49')]));_0x3a9bf7['attributes']=_0x3a9bf7[_0x1c72('0x47')][_0x1c72('0x4a')]?_0x3a9bf7[_0x1c72('0x47')]:_0x4036f0[_0x1c72('0x44')];_0x3a9bf7[_0x1c72('0x6d')]=qs[_0x1c72('0x4d')](_0x351c20[_0x1c72('0x45')]['sort']);_0x3a9bf7['where']=qs['filters'](_[_0x1c72('0x4f')](_0x351c20[_0x1c72('0x45')],_0x4036f0[_0x1c72('0x50')]));if(_0x351c20[_0x1c72('0x45')]['filter']){_0x3a9bf7[_0x1c72('0x4e')]=_[_0x1c72('0x53')](_0x3a9bf7[_0x1c72('0x4e')],{'$or':_[_0x1c72('0x40')](_0x3a9bf7[_0x1c72('0x47')],function(_0x14c86a){var _0xb28f18={};_0xb28f18[_0x14c86a]={'$like':'%'+_0x351c20[_0x1c72('0x45')][_0x1c72('0x51')]+'%'};return _0xb28f18;})});}_0x3a9bf7=_[_0x1c72('0x53')]({},_0x3a9bf7,_0x351c20[_0x1c72('0x54')]);return _0x1635a1[_0x1c72('0x83')](_0x3a9bf7);}})[_0x1c72('0x21')](function(_0x1a7d71){if(_0x1a7d71){_0x34912c=_0x1a7d71['length'];if(!_0x351c20[_0x1c72('0x45')][_0x1c72('0x4b')](_0x1c72('0x4c'))){_0x3a9bf7[_0x1c72('0x31')]=qs[_0x1c72('0x31')](_0x351c20[_0x1c72('0x45')]['limit']);_0x3a9bf7[_0x1c72('0x30')]=qs[_0x1c72('0x30')](_0x351c20[_0x1c72('0x45')][_0x1c72('0x30')]);}return _0x1635a1['getApplications'](_0x3a9bf7);}})[_0x1c72('0x21')](function(_0x252c68){if(_0x252c68){return _0x252c68?{'count':_0x34912c,'rows':_0x252c68}:null;}})['then'](respondWithResult(_0x3e28be,null))[_0x1c72('0x2b')](handleError(_0x3e28be,null));};exports[_0x1c72('0x84')]=function(_0xefd106,_0x31bfc2,_0x5af00f){var _0x296cfa={'channel':'whatsapp'};var _0xf7aeef=[];var _0x4d1719=[];var _0x413e21={};return db['WhatsappAccount'][_0x1c72('0x59')]({'where':{'id':_0xefd106[_0x1c72('0x58')]['id']},'include':[{'model':db[_0x1c72('0x80')],'as':_0x1c72('0x85')}]})[_0x1c72('0x21')](handleEntityNotFound(_0x31bfc2,null))[_0x1c72('0x21')](function(_0x10deb0){_0x296cfa['account']=_0x10deb0;if(_0x296cfa[_0x1c72('0x86')]&&_0x296cfa[_0x1c72('0x86')][_0x1c72('0x43')]==='sinch'&&_0xefd106[_0x1c72('0x5b')][_0x1c72('0x87')]&&_0xefd106[_0x1c72('0x5b')][_0x1c72('0x87')][0x0]['state']===_0x1c72('0x88')){if(_0xefd106['body'][_0x1c72('0x87')][0x0][_0x1c72('0x89')]!==_0x1c72('0x88'))return;return db[_0x1c72('0x8a')]['update']({'read':!![],'readAt':_0xefd106['body'][_0x1c72('0x87')][0x0][_0x1c72('0x8b')]},{'where':{'messageId':_0xefd106[_0x1c72('0x5b')][_0x1c72('0x87')][0x0][_0x1c72('0x8c')]},'individualHooks':!![]})[_0x1c72('0x21')](function(_0x473c6f){return _0x31bfc2['status'](0xc8)[_0x1c72('0x34')](_0x473c6f);});}_0x296cfa[_0x1c72('0x8d')]=_[_0x1c72('0x8e')](_0x10deb0['Applications'],[_0x1c72('0x82')],['asc']);if(_0x296cfa[_0x1c72('0x86')]['Applications']){delete _0x296cfa[_0x1c72('0x86')]['Applications'];}return db['CmContact'][_0x1c72('0x66')]()[_0x1c72('0x21')](function(_0x29872a){if(!_0x29872a){throw new db['Sequelize']['ValidationError'](_0x1c72('0x8f'));}_0xf7aeef=_[_0x1c72('0x90')](_['keys'](_0x29872a),['createdAt','updatedAt']);_0x4d1719=_[_0x1c72('0x90')](_[_0x1c72('0x46')](_0x29872a),[_0x1c72('0x91'),_0x1c72('0x92'),_0x1c72('0x93'),_0x1c72('0x94')]);_0x296cfa['body']={'mapKey':_0x1c72('0x95')};if(_0x296cfa[_0x1c72('0x86')]&&_0x296cfa[_0x1c72('0x86')][_0x1c72('0x43')]===_0x1c72('0x96')){_0x296cfa[_0x1c72('0x5b')][_0x1c72('0x97')]=_0xefd106[_0x1c72('0x5b')][_0x1c72('0x98')][_0x1c72('0x99')](_0x1c72('0x9a'),'');_0x296cfa['body']['body']=_0xefd106[_0x1c72('0x5b')]['Body'];_0x296cfa[_0x1c72('0x5b')]['messageId']=_0xefd106[_0x1c72('0x5b')][_0x1c72('0x9b')];}if(_0x296cfa[_0x1c72('0x86')]&&_0x296cfa[_0x1c72('0x86')][_0x1c72('0x43')]===_0x1c72('0x9c')){_0x296cfa[_0x1c72('0x5b')][_0x1c72('0x97')]=_0xefd106[_0x1c72('0x5b')][_0x1c72('0x9d')][0x0]['from'];_0x296cfa[_0x1c72('0x5b')][_0x1c72('0x5b')]=_0xefd106[_0x1c72('0x5b')][_0x1c72('0x9d')][0x0][_0x1c72('0x29')][_0x1c72('0x5b')];_0x296cfa['body'][_0x1c72('0x9e')]=_0xefd106[_0x1c72('0x5b')][_0x1c72('0x9d')][0x0][_0x1c72('0x8c')];}if(_0x296cfa['body']['id']){delete _0x296cfa[_0x1c72('0x5b')]['id'];}if(_['isNil'](_0x296cfa['body'][_0x1c72('0x97')])){throw new db[(_0x1c72('0x9f'))][(_0x1c72('0xa0'))](_0x1c72('0xa1'));}if(_[_0x1c72('0xa2')](_0x296cfa[_0x1c72('0x5b')][_0x1c72('0x5b')])||_0x296cfa[_0x1c72('0x5b')]['body']===''){throw new db['Sequelize'][(_0x1c72('0xa0'))](_0x1c72('0xa3'));}if(_[_0x1c72('0xa2')](_0x296cfa['body']['mapKey'])){throw new db[(_0x1c72('0x9f'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4d1719);}if(!_[_0x1c72('0xa4')](_0x4d1719,_0x296cfa[_0x1c72('0x5b')][_0x1c72('0xa5')])){throw new db['Sequelize'][(_0x1c72('0xa0'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4d1719);}_0x413e21[_0x296cfa['body'][_0x1c72('0xa5')]]=_0x296cfa[_0x1c72('0x5b')][_0x1c72('0x97')];return db[_0x1c72('0xa6')][_0x1c72('0x59')]({'where':{'id':_0x296cfa['account'][_0x1c72('0x94')]},'include':[{'model':db['CmContact'],'as':_0x1c72('0xa7'),'where':_0x413e21,'limit':0x1,'order':[[_0x1c72('0x92'),_0x1c72('0xa8')]]}]});})[_0x1c72('0x21')](handleEntityNotFound(_0x31bfc2,null))[_0x1c72('0x21')](function(_0x583bfd){if(_0x583bfd){_0x296cfa['list']=_[_0x1c72('0xa9')](_0x583bfd,['Contacts']);if(_0x583bfd['Contacts']['length']){return _0x583bfd[_0x1c72('0xa7')][0x0];}var _0xb58eb0=_[_0x1c72('0x1b')](_0x296cfa['body'],{'firstName':_0x296cfa[_0x1c72('0x5b')]['from'],'ListId':_0x583bfd['id']});_0xb58eb0[_0x296cfa[_0x1c72('0x5b')][_0x1c72('0xa5')]]=_0x296cfa['body'][_0x1c72('0x97')];return db['CmContact']['create'](_0xb58eb0,{'fields':_0xf7aeef,'raw':!![]});}})[_0x1c72('0x21')](handleEntityNotFound(_0x31bfc2,null))[_0x1c72('0x21')](function(_0x3b9dd1){if(_0x3b9dd1){_0x296cfa[_0x1c72('0xaa')]=_0x3b9dd1;var _0xcd9d83={'ContactId':_0x3b9dd1['id'],'phone':_0x296cfa[_0x1c72('0x5b')][_0x1c72('0x97')],'WhatsappAccountId':_0xefd106['params']['id']};var _0x1c0cf8={'ContactId':_0x3b9dd1['id'],'WhatsappAccountId':_0xefd106[_0x1c72('0x58')]['id'],'closed':![]};return db[_0x1c72('0xab')][_0x1c72('0x59')]({'where':_0x1c0cf8})[_0x1c72('0x21')](function(_0x37843f){if(_0x37843f){return[_0x37843f,![]];}return db[_0x1c72('0xab')]['create'](_0xcd9d83)[_0x1c72('0x21')](function(_0x5e3ee4){return[_0x5e3ee4,!![]];});});}})[_0x1c72('0x76')](function(_0x3177f4,_0x1cf7e6){_0x296cfa['interaction']=_0x3177f4[_0x1c72('0x5d')]({'plain':!![]});_0x296cfa[_0x1c72('0xac')][_0x1c72('0xad')]=![];if(_0x1cf7e6){if(_0x296cfa['account'][_0x1c72('0xae')]){_0x296cfa[_0x1c72('0x8d')]['push']({'id':0x0,'priority':_0x296cfa[_0x1c72('0x8d')][_0x1c72('0x4a')]+0x1,'app':_0x1c72('0xaf'),'appdata':_0x1c72('0xb0'),'interval':_0x1c72('0xb1')});}_0x296cfa[_0x1c72('0xac')]['created']=!![];}return db[_0x1c72('0x8a')][_0x1c72('0x5a')]({'phone':_0x296cfa[_0x1c72('0x5b')][_0x1c72('0x97')],'messageId':_0x296cfa[_0x1c72('0x5b')][_0x1c72('0x9e')],'body':_0x296cfa[_0x1c72('0x5b')][_0x1c72('0x5b')],'WhatsappAccountId':_0xefd106['params']['id'],'WhatsappInteractionId':_0x3177f4['id'],'direction':'in','ContactId':_0x3177f4[_0x1c72('0xb2')],'AttachmentId':_0x296cfa[_0x1c72('0x5b')][_0x1c72('0xb3')]});})[_0x1c72('0x21')](function(_0x372b73){_0x296cfa[_0x1c72('0x29')]=_0x372b73;if(_0x296cfa[_0x1c72('0xac')][_0x1c72('0xb4')]){return db[_0x1c72('0x7d')][_0x1c72('0x59')]({'attributes':['id',_0x1c72('0x3c')],'where':{'id':_0x296cfa[_0x1c72('0xac')]['UserId']}})[_0x1c72('0x21')](function(_0x78a7ce){if(_0x78a7ce){_0x296cfa[_0x1c72('0x8d')]['unshift']({'id':0x0,'priority':0x0,'app':_0x1c72('0xb5'),'appdata':_0x78a7ce[_0x1c72('0x3c')]+','+(_0x296cfa[_0x1c72('0x86')][_0x1c72('0xb6')]||0xa),'interval':_0x1c72('0xb1')});}return respondWithRpcPromise(_0x1c72('0xb7'),_0x1c72('0xb8'),_0x296cfa);});}return respondWithRpcPromise(_0x1c72('0xb7'),_0x1c72('0xb8'),_0x296cfa);})[_0x1c72('0x21')](function(_0x97d1a5){if(_0x97d1a5){var _0x5e5066=0xc8;var _0x21611d='receiveMessage';logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x21611d,_0x5e5066,_0x1c72('0xb9'));logger[_0x1c72('0x23')](_0x1c72('0xba'),_0x21611d,_0x5e5066,'entity\x20found',JSON['stringify'](_0x97d1a5));if(_0x296cfa[_0x1c72('0x86')]['type']==='twilio'){return _0x31bfc2[_0x1c72('0x2d')](_0x5e5066)[_0x1c72('0x32')](_0x1c72('0xbb'),_0x1c72('0xbc'))['send'](_0x1c72('0xbd'));}else{return _0x31bfc2['status'](_0x5e5066)[_0x1c72('0x34')](_0x97d1a5);}}});})[_0x1c72('0x2b')](handleError(_0x31bfc2,null));};exports['send']=function(_0x232557,_0x1c7e6b,_0x1180e2){var _0x5877c2,_0x20d7be,_0x3dbdd0;if(_[_0x1c72('0xa2')](_0x232557[_0x1c72('0x5b')][_0x1c72('0x5b')])||_0x232557[_0x1c72('0x5b')][_0x1c72('0x5b')]===''){throw new db[(_0x1c72('0x9f'))]['ValidationError'](_0x1c72('0xa3'));}if(_[_0x1c72('0xa2')](_0x232557[_0x1c72('0x5b')]['to'])){throw new db[(_0x1c72('0x9f'))][(_0x1c72('0xa0'))]('to\x20is\x20mandatory');}_0x5877c2=_0x232557[_0x1c72('0x5b')]['to'];return db[_0x1c72('0x41')][_0x1c72('0x59')]({'where':{'id':_0x232557[_0x1c72('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x1c72('0xbe'),'include':[{'model':db[_0x1c72('0xbf')],'as':_0x1c72('0xa7'),'where':{'mobile':_0x5877c2},'limit':0x1,'order':[['updatedAt',_0x1c72('0xa8')]]}]}]})['then'](handleEntityNotFound(_0x1c7e6b,null))[_0x1c72('0x21')](function(_0x2d60f2){if(_0x2d60f2&&_0x2d60f2[_0x1c72('0xbe')]){_0x20d7be=_0x2d60f2[_0x1c72('0x5d')]({'plain':!![]});if(_0x20d7be['List']&&_0x20d7be['List']['Contacts'][_0x1c72('0x4a')]){return _0x20d7be['List'][_0x1c72('0xa7')][0x0];}return db[_0x1c72('0xbf')][_0x1c72('0x5a')](_['defaults'](_0x232557[_0x1c72('0x5b')],{'firstName':_0x5877c2,'mobile':_0x5877c2,'phone':_0x5877c2,'ListId':_0x20d7be[_0x1c72('0x94')]}));}})[_0x1c72('0x21')](handleEntityNotFound(_0x1c7e6b,null))[_0x1c72('0x21')](function(_0x22aebc){if(_0x22aebc){_0x3dbdd0=_0x22aebc;return db[_0x1c72('0xab')][_0x1c72('0x59')]({'where':{'ContactId':_0x3dbdd0['id'],'closed':![],'WhatsappAccountId':_0x20d7be['id']}})[_0x1c72('0x21')](function(_0x1ead34){if(_0x1ead34){return[_0x1ead34,![]];}return db['WhatsappInteraction'][_0x1c72('0x5a')]({'UserId':_0x232557['user']['id'],'ContactId':_0x3dbdd0['id'],'WhatsappAccountId':_0x20d7be['id'],'phone':_0x5877c2,'firstMsgDirection':_0x1c72('0xc0'),'Messages':[_[_0x1c72('0x53')](_0x232557[_0x1c72('0x5b')],{'read':![],'body':_0x232557['body'][_0x1c72('0x5b')],'phone':_0x5877c2,'WhatsappAccountId':_0x20d7be['id'],'UserId':_0x232557[_0x1c72('0x5c')]['id'],'ContactId':_0x3dbdd0['id']})]},{'include':[{'model':db[_0x1c72('0x8a')],'as':'Messages'}]})[_0x1c72('0x21')](function(_0x227ca9){return[_0x227ca9,!![]];});});}})['spread'](function(_0x274906,_0x160e85){if(_0x160e85){return _0x274906;}return db[_0x1c72('0x8a')][_0x1c72('0x5a')](_[_0x1c72('0x53')](_0x232557[_0x1c72('0x5b')],{'read':![],'body':_0x232557[_0x1c72('0x5b')][_0x1c72('0x5b')],'phone':_0x5877c2,'WhatsappAccountId':_0x20d7be['id'],'WhatsappInteractionId':_0x274906['id'],'UserId':_0x232557[_0x1c72('0x5c')]['id'],'ContactId':_0x3dbdd0['id']}))[_0x1c72('0x21')](function(_0x144c1c){_0x274906[_0x1c72('0xc1')][_0x1c72('0xc2')]=[];_0x274906['dataValues']['Messages'][_0x1c72('0xc3')](_0x144c1c[_0x1c72('0xc1')]);return _0x274906;});})[_0x1c72('0x21')](respondWithResult(_0x1c7e6b,null))[_0x1c72('0x2b')](handleError(_0x1c7e6b,null));}; \ No newline at end of file +var _0xf8a3=['options','include','WhatsappAccount','findAll','rows','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','params','describe','addDisposition','WhatsappAccountId','getDispositions','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','findOne','User','getAgents','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','twilio','From','whatsapp:','Body','MessageSid','sinch','from','notifications','messageId','isNil','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','ListId','CmContact','Contacts','list','contact','WhatsappInteraction','interaction','created','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','DESC','List','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','client','http','then','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','get','UserProfileResource','destroy','end','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0xf8a3,0x6b));var _0x3f8a=function(_0x45fcf9,_0x41370d){_0x45fcf9=_0x45fcf9-0x0;var _0x31fd34=_0xf8a3[_0x45fcf9];return _0x31fd34;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f8a('0x0'));var zipdir=require(_0x3f8a('0x1'));var jsonpatch=require(_0x3f8a('0x2'));var rp=require(_0x3f8a('0x3'));var moment=require('moment');var BPromise=require(_0x3f8a('0x4'));var Mustache=require(_0x3f8a('0x5'));var util=require(_0x3f8a('0x6'));var path=require(_0x3f8a('0x7'));var sox=require('sox');var csv=require(_0x3f8a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3f8a('0x9'));var _=require(_0x3f8a('0xa'));var squel=require('squel');var crypto=require(_0x3f8a('0xb'));var jsforce=require(_0x3f8a('0xc'));var deskjs=require(_0x3f8a('0xd'));var toCsv=require(_0x3f8a('0x8'));var querystring=require(_0x3f8a('0xe'));var Papa=require('papaparse');var Redis=require(_0x3f8a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3f8a('0x10'));var as=require(_0x3f8a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f8a('0x12'))(_0x3f8a('0x13'));var utils=require(_0x3f8a('0x14'));var config=require(_0x3f8a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f8a('0x16'))['db'];config['redis']=_[_0x3f8a('0x17')](config[_0x3f8a('0x18')],{'host':_0x3f8a('0x19'),'port':0x18eb});var socket=require(_0x3f8a('0x1a'))(new Redis(config[_0x3f8a('0x18')]));require('./whatsappAccount.socket')[_0x3f8a('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3f8a('0x1c')][_0x3f8a('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x5f4db4,_0x2343f7,_0x54e798,_0x2da339){return new BPromise(function(_0x4c9ba1,_0x790e5d){var _0x34a7f9=_0x2da339||client;return _0x34a7f9['request'](_0x5f4db4,_0x54e798)[_0x3f8a('0x1e')](function(_0x3c3d95){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x2343f7,'request\x20sent');logger[_0x3f8a('0x1f')](_0x3f8a('0x20'),_0x2343f7,'request\x20sent',JSON[_0x3f8a('0x21')](_0x3c3d95));if(_0x3c3d95[_0x3f8a('0x22')]){if(_0x3c3d95['error'][_0x3f8a('0x23')]===0x1f4){logger[_0x3f8a('0x22')](_0x3f8a('0x24'),_0x2343f7,_0x3c3d95[_0x3f8a('0x22')][_0x3f8a('0x25')]);return _0x790e5d(_0x3c3d95[_0x3f8a('0x22')][_0x3f8a('0x25')]);}logger[_0x3f8a('0x22')](_0x3f8a('0x24'),_0x2343f7,_0x3c3d95[_0x3f8a('0x22')][_0x3f8a('0x25')]);return _0x4c9ba1(_0x3c3d95[_0x3f8a('0x22')]['message']);}else{logger['info'](_0x3f8a('0x24'),_0x2343f7,_0x3f8a('0x26'));_0x4c9ba1(_0x3c3d95[_0x3f8a('0x27')][_0x3f8a('0x25')]);}})[_0x3f8a('0x28')](function(_0x3fb4cd){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x2343f7,_0x3fb4cd);_0x790e5d(_0x3fb4cd);});});}function respondWithStatusCode(_0x3b63ba,_0x45f253){_0x45f253=_0x45f253||0xcc;return function(_0x4bc801){if(_0x4bc801){return _0x3b63ba[_0x3f8a('0x29')](_0x45f253);}return _0x3b63ba['status'](_0x45f253)['end']();};}function respondWithResult(_0x1e19ec,_0x15bc63){_0x15bc63=_0x15bc63||0xc8;return function(_0x20ed79){if(_0x20ed79){return _0x1e19ec[_0x3f8a('0x2a')](_0x15bc63)[_0x3f8a('0x2b')](_0x20ed79);}};}function respondWithFilteredResult(_0x37e7f5,_0x1fbff8){return function(_0x16b4b9){if(_0x16b4b9){var _0x249f59=typeof _0x1fbff8['offset']===_0x3f8a('0x2c')&&typeof _0x1fbff8['limit']==='undefined';var _0x560e92=_0x16b4b9[_0x3f8a('0x2d')];var _0x4fa5d8=_0x249f59?0x0:_0x1fbff8[_0x3f8a('0x2e')];var _0x165a80=_0x249f59?_0x16b4b9[_0x3f8a('0x2d')]:_0x1fbff8[_0x3f8a('0x2e')]+_0x1fbff8['limit'];var _0x355bb5;if(_0x165a80>=_0x560e92){_0x165a80=_0x560e92;_0x355bb5=0xc8;}else{_0x355bb5=0xce;}_0x37e7f5[_0x3f8a('0x2a')](_0x355bb5);return _0x37e7f5[_0x3f8a('0x2f')](_0x3f8a('0x30'),_0x4fa5d8+'-'+_0x165a80+'/'+_0x560e92)[_0x3f8a('0x2b')](_0x16b4b9);}return null;};}function patchUpdates(_0x4b4f32){return function(_0x49fdad){try{jsonpatch[_0x3f8a('0x31')](_0x49fdad,_0x4b4f32,!![]);}catch(_0x56ff0a){return BPromise[_0x3f8a('0x32')](_0x56ff0a);}return _0x49fdad[_0x3f8a('0x33')]();};}function saveUpdates(_0x5064bc,_0x3ccb28){return function(_0x59f843){if(_0x59f843){return _0x59f843[_0x3f8a('0x34')](_0x5064bc)[_0x3f8a('0x1e')](function(_0x4a24dd){return _0x4a24dd;});}return null;};}function removeEntity(_0x511fda,_0x24215a){return function(_0x1edf16){if(_0x1edf16){return _0x1edf16['destroy']()[_0x3f8a('0x1e')](function(){var _0x135468=_0x1edf16[_0x3f8a('0x35')]({'plain':!![]});var _0x2532e6='WhatsappAccounts';return db[_0x3f8a('0x36')][_0x3f8a('0x37')]({'where':{'type':_0x2532e6,'resourceId':_0x135468['id']}})[_0x3f8a('0x1e')](function(){return _0x1edf16;});})[_0x3f8a('0x1e')](function(){_0x511fda[_0x3f8a('0x2a')](0xcc)[_0x3f8a('0x38')]();});}};}function handleEntityNotFound(_0x20daf1,_0x5bf801){return function(_0xcc66e4){if(!_0xcc66e4){_0x20daf1['sendStatus'](0x194);}return _0xcc66e4;};}function handleError(_0x124d22,_0x48a244){_0x48a244=_0x48a244||0x1f4;return function(_0x910baf){logger[_0x3f8a('0x22')](_0x910baf['stack']);if(_0x910baf[_0x3f8a('0x39')]){delete _0x910baf[_0x3f8a('0x39')];}_0x124d22['status'](_0x48a244)[_0x3f8a('0x3a')](_0x910baf);};}exports[_0x3f8a('0x3b')]=function(_0x559ec8,_0x320d6e){var _0x41d180={'include':[{'model':db[_0x3f8a('0x3c')],'as':_0x3f8a('0x3d')}]},_0x57550e={},_0xe6814a={'count':0x0,'rows':[]};var _0x6fce75=_[_0x3f8a('0x3e')](db['WhatsappAccount'][_0x3f8a('0x3f')],function(_0x4afd19){return{'name':_0x4afd19['fieldName'],'type':_0x4afd19[_0x3f8a('0x40')]['key']};});_0x57550e[_0x3f8a('0x41')]=_['map'](_0x6fce75,_0x3f8a('0x39'));_0x57550e['query']=_[_0x3f8a('0x42')](_0x559ec8[_0x3f8a('0x43')]);_0x57550e['filters']=_[_0x3f8a('0x44')](_0x57550e[_0x3f8a('0x41')],_0x57550e[_0x3f8a('0x43')]);_0x41d180[_0x3f8a('0x45')]=_[_0x3f8a('0x44')](_0x57550e[_0x3f8a('0x41')],qs['fields'](_0x559ec8[_0x3f8a('0x43')][_0x3f8a('0x46')]));_0x41d180[_0x3f8a('0x45')]=_0x41d180[_0x3f8a('0x45')][_0x3f8a('0x47')]?_0x41d180[_0x3f8a('0x45')]:_0x57550e[_0x3f8a('0x41')];if(!_0x559ec8[_0x3f8a('0x43')][_0x3f8a('0x48')](_0x3f8a('0x49'))){_0x41d180[_0x3f8a('0x4a')]=qs[_0x3f8a('0x4a')](_0x559ec8['query'][_0x3f8a('0x4a')]);_0x41d180['offset']=qs[_0x3f8a('0x2e')](_0x559ec8[_0x3f8a('0x43')][_0x3f8a('0x2e')]);}_0x41d180[_0x3f8a('0x4b')]=qs[_0x3f8a('0x4c')](_0x559ec8[_0x3f8a('0x43')][_0x3f8a('0x4c')]);_0x41d180[_0x3f8a('0x4d')]=qs['filters'](_[_0x3f8a('0x4e')](_0x559ec8['query'],_0x57550e[_0x3f8a('0x4f')]),_0x6fce75);if(_0x559ec8[_0x3f8a('0x43')][_0x3f8a('0x50')]){_0x41d180[_0x3f8a('0x4d')]=_[_0x3f8a('0x51')](_0x41d180[_0x3f8a('0x4d')],{'$or':_[_0x3f8a('0x3e')](_0x6fce75,function(_0x2c61b2){if(_0x2c61b2['type']!==_0x3f8a('0x52')){var _0x27e69a={};_0x27e69a[_0x2c61b2[_0x3f8a('0x39')]]={'$like':'%'+_0x559ec8[_0x3f8a('0x43')][_0x3f8a('0x50')]+'%'};return _0x27e69a;}})});}_0x41d180=_['merge']({},_0x41d180,_0x559ec8[_0x3f8a('0x53')]);var _0x3362dd={'where':_0x41d180[_0x3f8a('0x4d')]};return db['WhatsappAccount'][_0x3f8a('0x2d')](_0x3362dd)[_0x3f8a('0x1e')](function(_0x2659f8){_0xe6814a[_0x3f8a('0x2d')]=_0x2659f8;if(_0x559ec8[_0x3f8a('0x43')]['includeAll']){_0x41d180[_0x3f8a('0x54')]=[{'all':!![]}];}return db[_0x3f8a('0x55')][_0x3f8a('0x56')](_0x41d180);})[_0x3f8a('0x1e')](function(_0x216dab){_0xe6814a[_0x3f8a('0x57')]=_0x216dab;return _0xe6814a;})[_0x3f8a('0x1e')](respondWithFilteredResult(_0x320d6e,_0x41d180))[_0x3f8a('0x28')](handleError(_0x320d6e,null));};exports[_0x3f8a('0x58')]=function(_0x51ba92,_0x29f5f7){var _0x5be819={'raw':![],'where':{'id':_0x51ba92['params']['id']},'include':[{'model':db[_0x3f8a('0x3c')],'as':'mandatoryDispositionPause'}]},_0x5e8e74={};_0x5e8e74[_0x3f8a('0x41')]=_['keys'](db[_0x3f8a('0x55')][_0x3f8a('0x3f')]);_0x5e8e74[_0x3f8a('0x43')]=_[_0x3f8a('0x42')](_0x51ba92['query']);_0x5e8e74[_0x3f8a('0x4f')]=_[_0x3f8a('0x44')](_0x5e8e74[_0x3f8a('0x41')],_0x5e8e74[_0x3f8a('0x43')]);_0x5be819['attributes']=_[_0x3f8a('0x44')](_0x5e8e74['model'],qs[_0x3f8a('0x46')](_0x51ba92['query'][_0x3f8a('0x46')]));_0x5be819[_0x3f8a('0x45')]=_0x5be819[_0x3f8a('0x45')][_0x3f8a('0x47')]?_0x5be819['attributes']:_0x5e8e74['model'];if(_0x51ba92[_0x3f8a('0x43')][_0x3f8a('0x59')]){_0x5be819[_0x3f8a('0x54')]=[{'all':!![]}];}_0x5be819=_[_0x3f8a('0x51')]({},_0x5be819,_0x51ba92[_0x3f8a('0x53')]);return db[_0x3f8a('0x55')][_0x3f8a('0x5a')](_0x5be819)['then'](handleEntityNotFound(_0x29f5f7,null))[_0x3f8a('0x1e')](respondWithResult(_0x29f5f7,null))['catch'](handleError(_0x29f5f7,null));};exports[_0x3f8a('0x5b')]=function(_0x20d65e,_0x5831ac){return db[_0x3f8a('0x55')][_0x3f8a('0x5b')](_0x20d65e[_0x3f8a('0x5c')],{})['then'](function(_0x21c360){var _0x4a4eb8=_0x20d65e[_0x3f8a('0x5d')][_0x3f8a('0x35')]({'plain':!![]});if(!_0x4a4eb8)throw new Error(_0x3f8a('0x5e'));if(_0x4a4eb8['role']===_0x3f8a('0x5d')){var _0x529734=_0x21c360[_0x3f8a('0x35')]({'plain':!![]});var _0x1da6e1='WhatsappAccounts';return db[_0x3f8a('0x5f')][_0x3f8a('0x5a')]({'where':{'name':_0x1da6e1,'userProfileId':_0x4a4eb8['userProfileId']},'raw':!![]})[_0x3f8a('0x1e')](function(_0x4b41f1){if(_0x4b41f1&&_0x4b41f1['autoAssociation']===0x0){return db['UserProfileResource'][_0x3f8a('0x5b')]({'name':_0x529734['name'],'resourceId':_0x529734['id'],'type':_0x4b41f1['name'],'sectionId':_0x4b41f1['id']},{})['then'](function(){return _0x21c360;});}else{return _0x21c360;}})[_0x3f8a('0x28')](function(_0xe72c9e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe72c9e);throw _0xe72c9e;});}return _0x21c360;})[_0x3f8a('0x1e')](respondWithResult(_0x5831ac,0xc9))[_0x3f8a('0x28')](handleError(_0x5831ac,null));};exports['update']=function(_0xa1cb52,_0x4c7d2b){if(_0xa1cb52['body']['id']){delete _0xa1cb52['body']['id'];}return db[_0x3f8a('0x55')][_0x3f8a('0x5a')]({'where':{'id':_0xa1cb52['params']['id']},'include':[{'model':db['Pause'],'as':_0x3f8a('0x3d')}]})['then'](handleEntityNotFound(_0x4c7d2b,null))[_0x3f8a('0x1e')](saveUpdates(_0xa1cb52[_0x3f8a('0x5c')],null))[_0x3f8a('0x1e')](respondWithResult(_0x4c7d2b,null))['catch'](handleError(_0x4c7d2b,null));};exports[_0x3f8a('0x37')]=function(_0x29d267,_0x2892e5){return db[_0x3f8a('0x55')][_0x3f8a('0x5a')]({'where':{'id':_0x29d267[_0x3f8a('0x60')]['id']}})['then'](handleEntityNotFound(_0x2892e5,null))[_0x3f8a('0x1e')](removeEntity(_0x2892e5,null))[_0x3f8a('0x28')](handleError(_0x2892e5,null));};exports[_0x3f8a('0x61')]=function(_0x537026,_0xc9d2cf){return db[_0x3f8a('0x55')][_0x3f8a('0x61')]()[_0x3f8a('0x1e')](respondWithResult(_0xc9d2cf,null))['catch'](handleError(_0xc9d2cf,null));};exports[_0x3f8a('0x62')]=function(_0x565dc3,_0x3d3fdf,_0x2d6382){if(_0x565dc3['body']['id']){delete _0x565dc3['body']['id'];}return db[_0x3f8a('0x55')][_0x3f8a('0x5a')]({'where':{'id':_0x565dc3[_0x3f8a('0x60')]['id']}})[_0x3f8a('0x1e')](handleEntityNotFound(_0x3d3fdf,null))['then'](function(_0x5b3550){if(_0x5b3550){_0x565dc3['body'][_0x3f8a('0x63')]=_0x5b3550['id'];return db['Disposition'][_0x3f8a('0x5b')](_0x565dc3[_0x3f8a('0x5c')]);}})[_0x3f8a('0x1e')](respondWithResult(_0x3d3fdf,null))['catch'](handleError(_0x3d3fdf,null));};exports[_0x3f8a('0x64')]=function(_0x27b586,_0x4a79ba,_0x2937da){var _0x1be735={'raw':![],'where':{}};var _0x5b716c={};var _0x11967c={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x27b586[_0x3f8a('0x60')]['id']}})[_0x3f8a('0x1e')](handleEntityNotFound(_0x4a79ba,null))['then'](function(_0x13dd15){if(_0x13dd15){_0x5b716c['model']=_[_0x3f8a('0x42')](db[_0x3f8a('0x65')][_0x3f8a('0x3f')]);_0x5b716c[_0x3f8a('0x43')]=_[_0x3f8a('0x42')](_0x27b586[_0x3f8a('0x43')]);_0x5b716c[_0x3f8a('0x4f')]=_['intersection'](_0x5b716c[_0x3f8a('0x41')],_0x5b716c[_0x3f8a('0x43')]);_0x1be735[_0x3f8a('0x45')]=_[_0x3f8a('0x44')](_0x5b716c[_0x3f8a('0x41')],qs['fields'](_0x27b586[_0x3f8a('0x43')][_0x3f8a('0x46')]));_0x1be735[_0x3f8a('0x45')]=_0x1be735['attributes'][_0x3f8a('0x47')]?_0x1be735[_0x3f8a('0x45')]:_0x5b716c[_0x3f8a('0x41')];if(!_0x27b586[_0x3f8a('0x43')][_0x3f8a('0x48')]('nolimit')){_0x1be735[_0x3f8a('0x4a')]=qs[_0x3f8a('0x4a')](_0x27b586[_0x3f8a('0x43')][_0x3f8a('0x4a')]);_0x1be735[_0x3f8a('0x2e')]=qs['offset'](_0x27b586['query'][_0x3f8a('0x2e')]);}_0x1be735[_0x3f8a('0x4b')]=qs['sort'](_0x27b586[_0x3f8a('0x43')][_0x3f8a('0x4c')]);_0x1be735['where']=qs[_0x3f8a('0x4f')](_[_0x3f8a('0x4e')](_0x27b586[_0x3f8a('0x43')],_0x5b716c[_0x3f8a('0x4f')]));_0x1be735[_0x3f8a('0x4d')][_0x3f8a('0x63')]=_0x13dd15['id'];if(_0x27b586[_0x3f8a('0x43')][_0x3f8a('0x50')]){_0x1be735[_0x3f8a('0x4d')]=_[_0x3f8a('0x51')](_0x1be735[_0x3f8a('0x4d')],{'$or':_[_0x3f8a('0x3e')](_0x1be735[_0x3f8a('0x45')],function(_0x3970d8){var _0x4a4a82={};_0x4a4a82[_0x3970d8]={'$like':'%'+_0x27b586[_0x3f8a('0x43')][_0x3f8a('0x50')]+'%'};return _0x4a4a82;})});}_0x1be735=_[_0x3f8a('0x51')]({},_0x1be735,_0x27b586[_0x3f8a('0x53')]);return db[_0x3f8a('0x65')]['count']({'where':_0x1be735[_0x3f8a('0x4d')]})[_0x3f8a('0x1e')](function(_0x21237e){_0x11967c[_0x3f8a('0x2d')]=_0x21237e;if(_0x27b586[_0x3f8a('0x43')][_0x3f8a('0x59')]){_0x1be735[_0x3f8a('0x54')]=[{'all':!![]}];}return db['Disposition'][_0x3f8a('0x56')](_0x1be735);})[_0x3f8a('0x1e')](function(_0x31c15b){_0x11967c['rows']=_0x31c15b;return _0x11967c;});}})[_0x3f8a('0x1e')](respondWithFilteredResult(_0x4a79ba,_0x1be735))['catch'](handleError(_0x4a79ba,null));};exports[_0x3f8a('0x66')]=function(_0x362f2c,_0x37b1ea,_0x431742){return db['WhatsappAccount']['find']({'where':{'id':_0x362f2c[_0x3f8a('0x60')]['id']}})[_0x3f8a('0x1e')](handleEntityNotFound(_0x37b1ea,null))[_0x3f8a('0x1e')](function(_0x55c6a8){if(_0x55c6a8){return _0x55c6a8[_0x3f8a('0x66')](_0x362f2c[_0x3f8a('0x43')][_0x3f8a('0x67')]);}})[_0x3f8a('0x1e')](respondWithStatusCode(_0x37b1ea,null))['catch'](handleError(_0x37b1ea,null));};exports[_0x3f8a('0x68')]=function(_0x444656,_0x5ab830,_0x88122c){if(_0x444656[_0x3f8a('0x5c')]['id']){delete _0x444656['body']['id'];}return db[_0x3f8a('0x55')]['find']({'where':{'id':_0x444656['params']['id']}})[_0x3f8a('0x1e')](handleEntityNotFound(_0x5ab830,null))[_0x3f8a('0x1e')](function(_0x5e8034){if(_0x5e8034){_0x444656['body'][_0x3f8a('0x63')]=_0x5e8034['id'];return db[_0x3f8a('0x69')][_0x3f8a('0x5b')](_0x444656['body']);}})['then'](respondWithResult(_0x5ab830,null))[_0x3f8a('0x28')](handleError(_0x5ab830,null));};exports[_0x3f8a('0x6a')]=function(_0x4a8e36,_0x32fa02,_0x5f184f){var _0x276cca={'raw':![],'where':{}};var _0x554176={};var _0x3f24c8={'count':0x0,'rows':[]};return db[_0x3f8a('0x55')]['findOne']({'where':{'id':_0x4a8e36[_0x3f8a('0x60')]['id']}})[_0x3f8a('0x1e')](handleEntityNotFound(_0x32fa02,null))[_0x3f8a('0x1e')](function(_0xb78fe5){if(_0xb78fe5){_0x554176[_0x3f8a('0x41')]=_[_0x3f8a('0x42')](db['CannedAnswer'][_0x3f8a('0x3f')]);_0x554176[_0x3f8a('0x43')]=_['keys'](_0x4a8e36[_0x3f8a('0x43')]);_0x554176[_0x3f8a('0x4f')]=_['intersection'](_0x554176['model'],_0x554176['query']);_0x276cca[_0x3f8a('0x45')]=_[_0x3f8a('0x44')](_0x554176[_0x3f8a('0x41')],qs['fields'](_0x4a8e36[_0x3f8a('0x43')][_0x3f8a('0x46')]));_0x276cca['attributes']=_0x276cca['attributes'][_0x3f8a('0x47')]?_0x276cca[_0x3f8a('0x45')]:_0x554176['model'];if(!_0x4a8e36[_0x3f8a('0x43')]['hasOwnProperty'](_0x3f8a('0x49'))){_0x276cca[_0x3f8a('0x4a')]=qs[_0x3f8a('0x4a')](_0x4a8e36[_0x3f8a('0x43')]['limit']);_0x276cca[_0x3f8a('0x2e')]=qs['offset'](_0x4a8e36[_0x3f8a('0x43')][_0x3f8a('0x2e')]);}_0x276cca[_0x3f8a('0x4b')]=qs[_0x3f8a('0x4c')](_0x4a8e36[_0x3f8a('0x43')]['sort']);_0x276cca[_0x3f8a('0x4d')]=qs['filters'](_[_0x3f8a('0x4e')](_0x4a8e36[_0x3f8a('0x43')],_0x554176[_0x3f8a('0x4f')]));_0x276cca[_0x3f8a('0x4d')]['WhatsappAccountId']=_0xb78fe5['id'];if(_0x4a8e36[_0x3f8a('0x43')][_0x3f8a('0x50')]){_0x276cca[_0x3f8a('0x4d')]=_[_0x3f8a('0x51')](_0x276cca[_0x3f8a('0x4d')],{'$or':_['map'](_0x276cca['attributes'],function(_0xf0cc7c){var _0x4a8a77={};_0x4a8a77[_0xf0cc7c]={'$like':'%'+_0x4a8e36[_0x3f8a('0x43')][_0x3f8a('0x50')]+'%'};return _0x4a8a77;})});}_0x276cca=_[_0x3f8a('0x51')]({},_0x276cca,_0x4a8e36[_0x3f8a('0x53')]);return db[_0x3f8a('0x69')][_0x3f8a('0x2d')]({'where':_0x276cca['where']})[_0x3f8a('0x1e')](function(_0x3c1fe0){_0x3f24c8[_0x3f8a('0x2d')]=_0x3c1fe0;if(_0x4a8e36[_0x3f8a('0x43')][_0x3f8a('0x59')]){_0x276cca[_0x3f8a('0x54')]=[{'all':!![]}];}return db[_0x3f8a('0x69')]['findAll'](_0x276cca);})[_0x3f8a('0x1e')](function(_0x3d53c5){_0x3f24c8[_0x3f8a('0x57')]=_0x3d53c5;return _0x3f24c8;});}})[_0x3f8a('0x1e')](respondWithFilteredResult(_0x32fa02,_0x276cca))[_0x3f8a('0x28')](handleError(_0x32fa02,null));};exports[_0x3f8a('0x6b')]=function(_0x26b3fa,_0x1acbde,_0x3ad890){return db['WhatsappAccount'][_0x3f8a('0x5a')]({'where':{'id':_0x26b3fa[_0x3f8a('0x60')]['id']}})[_0x3f8a('0x1e')](handleEntityNotFound(_0x1acbde,null))[_0x3f8a('0x1e')](function(_0x2792dc){if(_0x2792dc){return _0x2792dc['removeAnswers'](_0x26b3fa[_0x3f8a('0x43')]['ids']);}})[_0x3f8a('0x1e')](respondWithStatusCode(_0x1acbde,null))['catch'](handleError(_0x1acbde,null));};exports[_0x3f8a('0x6c')]=function(_0x214f32,_0x56aee6,_0x2a6415){return db['WhatsappAccount'][_0x3f8a('0x5a')]({'where':{'id':_0x214f32[_0x3f8a('0x60')]['id']}})[_0x3f8a('0x1e')](handleEntityNotFound(_0x56aee6,null))[_0x3f8a('0x1e')](function(_0x554859){if(_0x554859){return _0x554859[_0x3f8a('0x6c')](_0x214f32[_0x3f8a('0x5c')][_0x3f8a('0x67')],_[_0x3f8a('0x6d')](_0x214f32[_0x3f8a('0x5c')],[_0x3f8a('0x67'),'id'])||{})[_0x3f8a('0x6e')](function(_0x36b975){for(var _0x31fe00=0x0;_0x31fe00<_0x214f32['body'][_0x3f8a('0x67')][_0x3f8a('0x47')];_0x31fe00+=0x1){socket[_0x3f8a('0x6f')](_0x3f8a('0x70'),{'UserId':Number(_0x214f32[_0x3f8a('0x5c')][_0x3f8a('0x67')][_0x31fe00]),'WhatsappAccountId':Number(_0x214f32[_0x3f8a('0x60')]['id'])});}return _0x36b975;});}})['then'](respondWithResult(_0x56aee6,null))['catch'](handleError(_0x56aee6,null));};exports[_0x3f8a('0x71')]=function(_0x11640a,_0x163399,_0x5b5600){return db[_0x3f8a('0x55')][_0x3f8a('0x5a')]({'where':{'id':_0x11640a['params']['id']}})[_0x3f8a('0x1e')](handleEntityNotFound(_0x163399,null))[_0x3f8a('0x1e')](function(_0x548c8e){if(_0x548c8e){return _0x548c8e[_0x3f8a('0x71')](_0x11640a[_0x3f8a('0x43')][_0x3f8a('0x67')])[_0x3f8a('0x1e')](function(){if(_[_0x3f8a('0x72')](_0x11640a[_0x3f8a('0x43')][_0x3f8a('0x67')])){for(var _0x131b89=0x0;_0x131b89<_0x11640a[_0x3f8a('0x43')][_0x3f8a('0x67')][_0x3f8a('0x47')];_0x131b89+=0x1){socket[_0x3f8a('0x6f')]('userWhatsappAccount:remove',{'UserId':Number(_0x11640a[_0x3f8a('0x43')]['ids'][_0x131b89]),'WhatsappAccountId':Number(_0x11640a[_0x3f8a('0x60')]['id'])});}}else{socket[_0x3f8a('0x6f')](_0x3f8a('0x73'),{'UserId':Number(_0x11640a[_0x3f8a('0x43')][_0x3f8a('0x67')]),'WhatsappAccountId':Number(_0x11640a[_0x3f8a('0x60')]['id'])});}});}})[_0x3f8a('0x1e')](respondWithStatusCode(_0x163399,null))[_0x3f8a('0x28')](handleError(_0x163399,null));};exports['getAgents']=function(_0x445cec,_0xda3db1,_0x37af96){var _0x588564={};var _0x589017={};var _0x504c8a;var _0x2b31a6;return db[_0x3f8a('0x55')][_0x3f8a('0x74')]({'where':{'id':_0x445cec[_0x3f8a('0x60')]['id']}})[_0x3f8a('0x1e')](handleEntityNotFound(_0xda3db1,null))['then'](function(_0x1dcc96){if(_0x1dcc96){_0x504c8a=_0x1dcc96;_0x589017['model']=_[_0x3f8a('0x42')](db[_0x3f8a('0x75')]['rawAttributes']);_0x589017[_0x3f8a('0x43')]=_[_0x3f8a('0x42')](_0x445cec['query']);_0x589017[_0x3f8a('0x4f')]=_[_0x3f8a('0x44')](_0x589017[_0x3f8a('0x41')],_0x589017[_0x3f8a('0x43')]);_0x588564[_0x3f8a('0x45')]=_['intersection'](_0x589017[_0x3f8a('0x41')],qs[_0x3f8a('0x46')](_0x445cec['query'][_0x3f8a('0x46')]));_0x588564[_0x3f8a('0x45')]=_0x588564[_0x3f8a('0x45')][_0x3f8a('0x47')]?_0x588564[_0x3f8a('0x45')]:_0x589017['model'];_0x588564[_0x3f8a('0x4b')]=qs[_0x3f8a('0x4c')](_0x445cec[_0x3f8a('0x43')][_0x3f8a('0x4c')]);_0x588564[_0x3f8a('0x4d')]=qs[_0x3f8a('0x4f')](_[_0x3f8a('0x4e')](_0x445cec[_0x3f8a('0x43')],_0x589017[_0x3f8a('0x4f')]));if(_0x445cec[_0x3f8a('0x43')][_0x3f8a('0x50')]){_0x588564['where']=_['merge'](_0x588564['where'],{'$or':_[_0x3f8a('0x3e')](_0x588564['attributes'],function(_0x2c30cf){var _0x4f028c={};_0x4f028c[_0x2c30cf]={'$like':'%'+_0x445cec[_0x3f8a('0x43')][_0x3f8a('0x50')]+'%'};return _0x4f028c;})});}_0x588564=_[_0x3f8a('0x51')]({},_0x588564,_0x445cec['options']);return _0x504c8a[_0x3f8a('0x76')](_0x588564);}})[_0x3f8a('0x1e')](function(_0x3ce838){if(_0x3ce838){_0x2b31a6=_0x3ce838[_0x3f8a('0x47')];if(!_0x445cec[_0x3f8a('0x43')][_0x3f8a('0x48')](_0x3f8a('0x49'))){_0x588564['limit']=qs[_0x3f8a('0x4a')](_0x445cec[_0x3f8a('0x43')][_0x3f8a('0x4a')]);_0x588564[_0x3f8a('0x2e')]=qs[_0x3f8a('0x2e')](_0x445cec['query'][_0x3f8a('0x2e')]);}return _0x504c8a[_0x3f8a('0x76')](_0x588564);}})['then'](function(_0x5622ae){if(_0x5622ae){return _0x5622ae?{'count':_0x2b31a6,'rows':_0x5622ae}:null;}})[_0x3f8a('0x1e')](respondWithResult(_0xda3db1,null))[_0x3f8a('0x28')](handleError(_0xda3db1,null));};exports[_0x3f8a('0x77')]=function(_0x557d11,_0x3d944c,_0x46aa7f){return db[_0x3f8a('0x55')][_0x3f8a('0x74')]({'where':{'id':_0x557d11[_0x3f8a('0x60')]['id']}})['then'](handleEntityNotFound(_0x3d944c,null))[_0x3f8a('0x1e')](function(_0x1a2287){if(_0x1a2287){return db[_0x3f8a('0x78')][_0x3f8a('0x79')](function(_0x9a9d96){return db[_0x3f8a('0x7a')][_0x3f8a('0x37')]({'where':{'WhatsappAccountId':_0x557d11[_0x3f8a('0x60')]['id']},'transaction':_0x9a9d96})[_0x3f8a('0x1e')](function(_0x3e51fa){var _0x2b21d1=_[_0x3f8a('0x3e')](_0x557d11[_0x3f8a('0x5c')],function(_0x299ef5){_0x299ef5[_0x3f8a('0x63')]=_0x557d11[_0x3f8a('0x60')]['id'];return _0x299ef5;});return db[_0x3f8a('0x7a')][_0x3f8a('0x7b')](_0x2b21d1,{'transaction':_0x9a9d96});});})['then'](function(){return db[_0x3f8a('0x7a')][_0x3f8a('0x7c')]({'where':{'WhatsappAccountId':_0x557d11[_0x3f8a('0x60')]['id']},'order':_0x3f8a('0x7d')});});}})[_0x3f8a('0x1e')](respondWithResult(_0x3d944c,null))[_0x3f8a('0x28')](handleError(_0x3d944c,null));};exports[_0x3f8a('0x7e')]=function(_0x517ae3,_0x381cc2,_0x1b75a7){var _0x2fff83={};var _0x4a9d54={};var _0x34e8c4;var _0x41c79d;return db[_0x3f8a('0x55')][_0x3f8a('0x74')]({'where':{'id':_0x517ae3[_0x3f8a('0x60')]['id']}})[_0x3f8a('0x1e')](handleEntityNotFound(_0x381cc2,null))[_0x3f8a('0x1e')](function(_0x2e2c4e){if(_0x2e2c4e){_0x34e8c4=_0x2e2c4e;_0x4a9d54[_0x3f8a('0x41')]=_['keys'](db[_0x3f8a('0x7a')]['rawAttributes']);_0x4a9d54[_0x3f8a('0x43')]=_[_0x3f8a('0x42')](_0x517ae3[_0x3f8a('0x43')]);_0x4a9d54[_0x3f8a('0x4f')]=_[_0x3f8a('0x44')](_0x4a9d54[_0x3f8a('0x41')],_0x4a9d54[_0x3f8a('0x43')]);_0x2fff83['attributes']=_[_0x3f8a('0x44')](_0x4a9d54[_0x3f8a('0x41')],qs[_0x3f8a('0x46')](_0x517ae3['query'][_0x3f8a('0x46')]));_0x2fff83[_0x3f8a('0x45')]=_0x2fff83[_0x3f8a('0x45')][_0x3f8a('0x47')]?_0x2fff83[_0x3f8a('0x45')]:_0x4a9d54[_0x3f8a('0x41')];_0x2fff83[_0x3f8a('0x4b')]=qs[_0x3f8a('0x4c')](_0x517ae3[_0x3f8a('0x43')][_0x3f8a('0x4c')]);_0x2fff83[_0x3f8a('0x4d')]=qs['filters'](_[_0x3f8a('0x4e')](_0x517ae3['query'],_0x4a9d54[_0x3f8a('0x4f')]));if(_0x517ae3['query'][_0x3f8a('0x50')]){_0x2fff83['where']=_[_0x3f8a('0x51')](_0x2fff83['where'],{'$or':_['map'](_0x2fff83[_0x3f8a('0x45')],function(_0x5b792d){var _0x1aa00c={};_0x1aa00c[_0x5b792d]={'$like':'%'+_0x517ae3[_0x3f8a('0x43')][_0x3f8a('0x50')]+'%'};return _0x1aa00c;})});}_0x2fff83=_[_0x3f8a('0x51')]({},_0x2fff83,_0x517ae3['options']);return _0x34e8c4[_0x3f8a('0x7e')](_0x2fff83);}})[_0x3f8a('0x1e')](function(_0x4720bf){if(_0x4720bf){_0x41c79d=_0x4720bf[_0x3f8a('0x47')];if(!_0x517ae3[_0x3f8a('0x43')][_0x3f8a('0x48')](_0x3f8a('0x49'))){_0x2fff83[_0x3f8a('0x4a')]=qs[_0x3f8a('0x4a')](_0x517ae3[_0x3f8a('0x43')][_0x3f8a('0x4a')]);_0x2fff83['offset']=qs[_0x3f8a('0x2e')](_0x517ae3['query']['offset']);}return _0x34e8c4[_0x3f8a('0x7e')](_0x2fff83);}})[_0x3f8a('0x1e')](function(_0x308228){if(_0x308228){return _0x308228?{'count':_0x41c79d,'rows':_0x308228}:null;}})[_0x3f8a('0x1e')](respondWithResult(_0x381cc2,null))[_0x3f8a('0x28')](handleError(_0x381cc2,null));};exports[_0x3f8a('0x7f')]=function(_0x1ca71c,_0x18c96c,_0x7a81ab){var _0x45d85b={'channel':_0x3f8a('0x80')};var _0x39c486=[];var _0x5caffb=[];var _0x4ec611={};return db[_0x3f8a('0x55')][_0x3f8a('0x5a')]({'where':{'id':_0x1ca71c[_0x3f8a('0x60')]['id']},'include':[{'model':db[_0x3f8a('0x7a')],'as':_0x3f8a('0x81')}]})[_0x3f8a('0x1e')](handleEntityNotFound(_0x18c96c,null))[_0x3f8a('0x1e')](function(_0x1149e8){_0x45d85b[_0x3f8a('0x82')]=_0x1149e8;if(_0x45d85b['account']&&_0x45d85b['account'][_0x3f8a('0x40')]==='sinch'&&_0x1ca71c['body'][_0x3f8a('0x83')]&&_0x1ca71c[_0x3f8a('0x5c')][_0x3f8a('0x83')][0x0][_0x3f8a('0x84')]===_0x3f8a('0x85')){if(_0x1ca71c['body'][_0x3f8a('0x83')][0x0]['state']!==_0x3f8a('0x85'))return;return db[_0x3f8a('0x86')]['update']({'read':!![],'readAt':_0x1ca71c['body'][_0x3f8a('0x83')][0x0][_0x3f8a('0x87')]},{'where':{'messageId':_0x1ca71c[_0x3f8a('0x5c')]['statuses'][0x0][_0x3f8a('0x88')]},'individualHooks':!![]})[_0x3f8a('0x1e')](function(_0x2f39bd){return _0x18c96c[_0x3f8a('0x2a')](0xc8)[_0x3f8a('0x2b')](_0x2f39bd);});}_0x45d85b[_0x3f8a('0x89')]=_[_0x3f8a('0x8a')](_0x1149e8['Applications'],[_0x3f8a('0x7d')],[_0x3f8a('0x8b')]);if(_0x45d85b[_0x3f8a('0x82')][_0x3f8a('0x81')]){delete _0x45d85b[_0x3f8a('0x82')][_0x3f8a('0x81')];}return db['CmContact'][_0x3f8a('0x61')]()[_0x3f8a('0x1e')](function(_0x112f7f){if(!_0x112f7f){throw new db[(_0x3f8a('0x8c'))]['ValidationError'](_0x3f8a('0x8d'));}_0x39c486=_[_0x3f8a('0x8e')](_['keys'](_0x112f7f),['createdAt','updatedAt']);_0x5caffb=_['difference'](_[_0x3f8a('0x42')](_0x112f7f),[_0x3f8a('0x8f'),_0x3f8a('0x90'),'CompanyId','ListId']);_0x45d85b['body']={'mapKey':'mobile'};if(_0x45d85b[_0x3f8a('0x82')]&&_0x45d85b[_0x3f8a('0x82')]['type']===_0x3f8a('0x91')){_0x45d85b[_0x3f8a('0x5c')]['from']=_0x1ca71c[_0x3f8a('0x5c')][_0x3f8a('0x92')]['replace'](_0x3f8a('0x93'),'');_0x45d85b['body'][_0x3f8a('0x5c')]=_0x1ca71c[_0x3f8a('0x5c')][_0x3f8a('0x94')];_0x45d85b[_0x3f8a('0x5c')]['messageId']=_0x1ca71c[_0x3f8a('0x5c')][_0x3f8a('0x95')];}if(_0x45d85b[_0x3f8a('0x82')]&&_0x45d85b[_0x3f8a('0x82')][_0x3f8a('0x40')]===_0x3f8a('0x96')){_0x45d85b['body'][_0x3f8a('0x97')]=_0x1ca71c['body'][_0x3f8a('0x98')][0x0][_0x3f8a('0x97')];_0x45d85b[_0x3f8a('0x5c')][_0x3f8a('0x5c')]=_0x1ca71c[_0x3f8a('0x5c')][_0x3f8a('0x98')][0x0][_0x3f8a('0x25')][_0x3f8a('0x5c')];_0x45d85b[_0x3f8a('0x5c')][_0x3f8a('0x99')]=_0x1ca71c[_0x3f8a('0x5c')][_0x3f8a('0x98')][0x0][_0x3f8a('0x88')];}if(_0x45d85b[_0x3f8a('0x5c')]['id']){delete _0x45d85b['body']['id'];}if(_[_0x3f8a('0x9a')](_0x45d85b['body'][_0x3f8a('0x97')])){throw new db[(_0x3f8a('0x8c'))][(_0x3f8a('0x9b'))]('from\x20is\x20mandatory');}if(_[_0x3f8a('0x9a')](_0x45d85b[_0x3f8a('0x5c')][_0x3f8a('0x5c')])||_0x45d85b[_0x3f8a('0x5c')]['body']===''){throw new db[(_0x3f8a('0x8c'))][(_0x3f8a('0x9b'))](_0x3f8a('0x9c'));}if(_[_0x3f8a('0x9a')](_0x45d85b['body'][_0x3f8a('0x9d')])){throw new db[(_0x3f8a('0x8c'))]['ValidationError'](_0x3f8a('0x9e')+_0x5caffb);}if(!_[_0x3f8a('0x9f')](_0x5caffb,_0x45d85b[_0x3f8a('0x5c')][_0x3f8a('0x9d')])){throw new db[(_0x3f8a('0x8c'))][(_0x3f8a('0x9b'))](_0x3f8a('0xa0')+_0x5caffb);}_0x4ec611[_0x45d85b[_0x3f8a('0x5c')][_0x3f8a('0x9d')]]=_0x45d85b[_0x3f8a('0x5c')][_0x3f8a('0x97')];return db[_0x3f8a('0xa1')][_0x3f8a('0x5a')]({'where':{'id':_0x45d85b[_0x3f8a('0x82')][_0x3f8a('0xa2')]},'include':[{'model':db[_0x3f8a('0xa3')],'as':_0x3f8a('0xa4'),'where':_0x4ec611,'limit':0x1,'order':[['updatedAt','DESC']]}]});})['then'](handleEntityNotFound(_0x18c96c,null))[_0x3f8a('0x1e')](function(_0x3ad830){if(_0x3ad830){_0x45d85b[_0x3f8a('0xa5')]=_['omit'](_0x3ad830,[_0x3f8a('0xa4')]);if(_0x3ad830['Contacts'][_0x3f8a('0x47')]){return _0x3ad830[_0x3f8a('0xa4')][0x0];}var _0x42e27d=_[_0x3f8a('0x17')](_0x45d85b[_0x3f8a('0x5c')],{'firstName':_0x45d85b[_0x3f8a('0x5c')][_0x3f8a('0x97')],'ListId':_0x3ad830['id']});_0x42e27d[_0x45d85b[_0x3f8a('0x5c')][_0x3f8a('0x9d')]]=_0x45d85b[_0x3f8a('0x5c')][_0x3f8a('0x97')];return db[_0x3f8a('0xa3')][_0x3f8a('0x5b')](_0x42e27d,{'fields':_0x39c486,'raw':!![]});}})['then'](handleEntityNotFound(_0x18c96c,null))[_0x3f8a('0x1e')](function(_0x3a6580){if(_0x3a6580){_0x45d85b[_0x3f8a('0xa6')]=_0x3a6580;var _0x2e998e={'ContactId':_0x3a6580['id'],'phone':_0x45d85b[_0x3f8a('0x5c')][_0x3f8a('0x97')],'WhatsappAccountId':_0x1ca71c[_0x3f8a('0x60')]['id']};var _0x2ff7ee={'ContactId':_0x3a6580['id'],'WhatsappAccountId':_0x1ca71c['params']['id'],'closed':![]};return db[_0x3f8a('0xa7')][_0x3f8a('0x5a')]({'where':_0x2ff7ee})['then'](function(_0xe521e5){if(_0xe521e5){return[_0xe521e5,![]];}return db['WhatsappInteraction'][_0x3f8a('0x5b')](_0x2e998e)[_0x3f8a('0x1e')](function(_0xeac177){return[_0xeac177,!![]];});});}})[_0x3f8a('0x6e')](function(_0x1476a4,_0x2db568){_0x45d85b[_0x3f8a('0xa8')]=_0x1476a4['get']({'plain':!![]});_0x45d85b[_0x3f8a('0xa8')][_0x3f8a('0xa9')]=![];if(_0x2db568){if(_0x45d85b[_0x3f8a('0x82')]['autoclose']){_0x45d85b[_0x3f8a('0x89')]['push']({'id':0x0,'priority':_0x45d85b[_0x3f8a('0x89')]['length']+0x1,'app':_0x3f8a('0xaa'),'appdata':_0x3f8a('0xab'),'interval':_0x3f8a('0xac')});}_0x45d85b['interaction'][_0x3f8a('0xa9')]=!![];}return db['WhatsappMessage']['create']({'phone':_0x45d85b[_0x3f8a('0x5c')]['from'],'messageId':_0x45d85b[_0x3f8a('0x5c')][_0x3f8a('0x99')],'body':_0x45d85b[_0x3f8a('0x5c')][_0x3f8a('0x5c')],'WhatsappAccountId':_0x1ca71c[_0x3f8a('0x60')]['id'],'WhatsappInteractionId':_0x1476a4['id'],'direction':'in','ContactId':_0x1476a4[_0x3f8a('0xad')],'AttachmentId':_0x45d85b[_0x3f8a('0x5c')][_0x3f8a('0xae')]});})['then'](function(_0x5a33fc){_0x45d85b[_0x3f8a('0x25')]=_0x5a33fc;if(_0x45d85b['interaction'][_0x3f8a('0xaf')]){return db[_0x3f8a('0x75')][_0x3f8a('0x5a')]({'attributes':['id',_0x3f8a('0x39')],'where':{'id':_0x45d85b[_0x3f8a('0xa8')][_0x3f8a('0xaf')]}})[_0x3f8a('0x1e')](function(_0x4b5404){if(_0x4b5404){_0x45d85b[_0x3f8a('0x89')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3f8a('0xb0'),'appdata':_0x4b5404['name']+','+(_0x45d85b[_0x3f8a('0x82')][_0x3f8a('0xb1')]||0xa),'interval':_0x3f8a('0xac')});}return respondWithRpcPromise(_0x3f8a('0xb2'),_0x3f8a('0xb3'),_0x45d85b);});}return respondWithRpcPromise(_0x3f8a('0xb2'),_0x3f8a('0xb3'),_0x45d85b);})['then'](function(_0x5b0f86){if(_0x5b0f86){var _0x573847=0xc8;var _0x69b57a=_0x3f8a('0xb4');logger['info'](_0x3f8a('0x20'),_0x69b57a,_0x573847,_0x3f8a('0xb5'));logger['debug'](_0x3f8a('0xb6'),_0x69b57a,_0x573847,_0x3f8a('0xb5'),JSON[_0x3f8a('0x21')](_0x5b0f86));if(_0x45d85b['account']['type']===_0x3f8a('0x91')){return _0x18c96c['status'](_0x573847)[_0x3f8a('0x2f')](_0x3f8a('0xb7'),_0x3f8a('0xb8'))['send'](_0x3f8a('0xb9'));}else{return _0x18c96c['status'](_0x573847)[_0x3f8a('0x2b')](_0x5b0f86);}}});})[_0x3f8a('0x28')](handleError(_0x18c96c,null));};exports[_0x3f8a('0x3a')]=function(_0x47cdce,_0x22d715,_0x5a2ea9){var _0x335ec3,_0x5cef62,_0x52dc09;if(_['isNil'](_0x47cdce[_0x3f8a('0x5c')][_0x3f8a('0x5c')])||_0x47cdce[_0x3f8a('0x5c')][_0x3f8a('0x5c')]===''){throw new db[(_0x3f8a('0x8c'))][(_0x3f8a('0x9b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x47cdce[_0x3f8a('0x5c')]['to'])){throw new db[(_0x3f8a('0x8c'))][(_0x3f8a('0x9b'))]('to\x20is\x20mandatory');}_0x335ec3=_0x47cdce[_0x3f8a('0x5c')]['to'];return db['WhatsappAccount'][_0x3f8a('0x5a')]({'where':{'id':_0x47cdce[_0x3f8a('0x60')]['id']},'include':[{'model':db[_0x3f8a('0xa1')],'as':'List','include':[{'model':db[_0x3f8a('0xa3')],'as':_0x3f8a('0xa4'),'where':{'mobile':_0x335ec3},'limit':0x1,'order':[[_0x3f8a('0x90'),_0x3f8a('0xba')]]}]}]})[_0x3f8a('0x1e')](handleEntityNotFound(_0x22d715,null))[_0x3f8a('0x1e')](function(_0x3e7b72){if(_0x3e7b72&&_0x3e7b72[_0x3f8a('0xbb')]){_0x5cef62=_0x3e7b72['get']({'plain':!![]});if(_0x5cef62[_0x3f8a('0xbb')]&&_0x5cef62[_0x3f8a('0xbb')][_0x3f8a('0xa4')]['length']){return _0x5cef62[_0x3f8a('0xbb')]['Contacts'][0x0];}return db[_0x3f8a('0xa3')][_0x3f8a('0x5b')](_[_0x3f8a('0x17')](_0x47cdce[_0x3f8a('0x5c')],{'firstName':_0x335ec3,'mobile':_0x335ec3,'phone':_0x335ec3,'ListId':_0x5cef62[_0x3f8a('0xa2')]}));}})[_0x3f8a('0x1e')](handleEntityNotFound(_0x22d715,null))['then'](function(_0x41c8d4){if(_0x41c8d4){_0x52dc09=_0x41c8d4;return db[_0x3f8a('0xa7')][_0x3f8a('0x5a')]({'where':{'ContactId':_0x52dc09['id'],'closed':![],'WhatsappAccountId':_0x5cef62['id']}})[_0x3f8a('0x1e')](function(_0x502801){if(_0x502801){return[_0x502801,![]];}return db[_0x3f8a('0xa7')]['create']({'UserId':_0x47cdce[_0x3f8a('0x5d')]['id'],'ContactId':_0x52dc09['id'],'WhatsappAccountId':_0x5cef62['id'],'phone':_0x335ec3,'firstMsgDirection':'out','Messages':[_[_0x3f8a('0x51')](_0x47cdce[_0x3f8a('0x5c')],{'read':![],'body':_0x47cdce[_0x3f8a('0x5c')][_0x3f8a('0x5c')],'phone':_0x335ec3,'WhatsappAccountId':_0x5cef62['id'],'UserId':_0x47cdce[_0x3f8a('0x5d')]['id'],'ContactId':_0x52dc09['id']})]},{'include':[{'model':db[_0x3f8a('0x86')],'as':_0x3f8a('0xbc')}]})[_0x3f8a('0x1e')](function(_0x3681bc){return[_0x3681bc,!![]];});});}})['spread'](function(_0x4877dc,_0x5b34fe){if(_0x5b34fe){return _0x4877dc;}return db['WhatsappMessage'][_0x3f8a('0x5b')](_[_0x3f8a('0x51')](_0x47cdce[_0x3f8a('0x5c')],{'read':![],'body':_0x47cdce[_0x3f8a('0x5c')][_0x3f8a('0x5c')],'phone':_0x335ec3,'WhatsappAccountId':_0x5cef62['id'],'WhatsappInteractionId':_0x4877dc['id'],'UserId':_0x47cdce['user']['id'],'ContactId':_0x52dc09['id']}))['then'](function(_0xa97a2f){_0x4877dc[_0x3f8a('0xbd')][_0x3f8a('0xbc')]=[];_0x4877dc[_0x3f8a('0xbd')][_0x3f8a('0xbc')]['push'](_0xa97a2f[_0x3f8a('0xbd')]);return _0x4877dc;});})[_0x3f8a('0x1e')](respondWithResult(_0x22d715,null))[_0x3f8a('0x28')](handleError(_0x22d715,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 354eadb..80a1b77 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 _0xaa7c=['events','../../mysqldb','WhatsappAccount','emit','hook','exports'];(function(_0x16cede,_0x560013){var _0x32a4ed=function(_0x45bfa5){while(--_0x45bfa5){_0x16cede['push'](_0x16cede['shift']());}};_0x32a4ed(++_0x560013);}(_0xaa7c,0x90));var _0xcaa7=function(_0x4225dd,_0x2df43f){_0x4225dd=_0x4225dd-0x0;var _0x237a2b=_0xaa7c[_0x4225dd];return _0x237a2b;};'use strict';var EventEmitter=require(_0xcaa7('0x0'));var WhatsappAccount=require(_0xcaa7('0x1'))['db'][_0xcaa7('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x443fab){return function(_0x1546d8,_0x1381da,_0x4536bb){WhatsappAccountEvents[_0xcaa7('0x3')](_0x443fab+':'+_0x1546d8['id'],_0x1546d8);WhatsappAccountEvents[_0xcaa7('0x3')](_0x443fab,_0x1546d8);_0x4536bb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xcaa7('0x4')](e,emitEvent(event));}}module[_0xcaa7('0x5')]=WhatsappAccountEvents; \ No newline at end of file +var _0x3696=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove'];(function(_0x1da804,_0x1b7529){var _0x57be20=function(_0x285826){while(--_0x285826){_0x1da804['push'](_0x1da804['shift']());}};_0x57be20(++_0x1b7529);}(_0x3696,0x10c));var _0x6369=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x3696[_0xbd08b4];return _0x314f1e;};'use strict';var EventEmitter=require(_0x6369('0x0'));var WhatsappAccount=require(_0x6369('0x1'))['db'][_0x6369('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x6369('0x3')](0x0);var events={'afterCreate':_0x6369('0x4'),'afterUpdate':_0x6369('0x5'),'afterDestroy':_0x6369('0x6')};function emitEvent(_0x5e85a0){return function(_0x6d52f5,_0x1f7389,_0x16dd53){WhatsappAccountEvents['emit'](_0x5e85a0+':'+_0x6d52f5['id'],_0x6d52f5);WhatsappAccountEvents[_0x6369('0x7')](_0x5e85a0,_0x6d52f5);_0x16dd53(null);};}for(var e in events){if(events[_0x6369('0x8')](e)){var event=events[e];WhatsappAccount[_0x6369('0x9')](e,emitEvent(event));}}module[_0x6369('0xa')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index b51184b..c5d3899 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 _0xd03e=['moment','request-promise','path','rimraf','../../config/environment','define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api'];(function(_0x1f57bc,_0x3c459b){var _0x3a21d5=function(_0x24a99a){while(--_0x24a99a){_0x1f57bc['push'](_0x1f57bc['shift']());}};_0x3a21d5(++_0x3c459b);}(_0xd03e,0x131));var _0xed03=function(_0x5cd0fc,_0x19975a){_0x5cd0fc=_0x5cd0fc-0x0;var _0x2601a2=_0xd03e[_0x5cd0fc];return _0x2601a2;};'use strict';var _=require(_0xed03('0x0'));var util=require('util');var logger=require(_0xed03('0x1'))(_0xed03('0x2'));var moment=require(_0xed03('0x3'));var BPromise=require('bluebird');var rp=require(_0xed03('0x4'));var fs=require('fs');var path=require(_0xed03('0x5'));var rimraf=require(_0xed03('0x6'));var config=require(_0xed03('0x7'));var attributes=require('./whatsappAccount.attributes');module['exports']=function(_0x22db1a,_0x3c13c8){return _0x22db1a[_0xed03('0x8')](_0xed03('0x9'),attributes,{'tableName':_0xed03('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d1d=['../../config/environment','./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3f5210,_0x32f195){var _0x53c3ab=function(_0x341fa0){while(--_0x341fa0){_0x3f5210['push'](_0x3f5210['shift']());}};_0x53c3ab(++_0x32f195);}(_0x0d1d,0x10d));var _0xd0d1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0d1d[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xd0d1('0x0'));var logger=require(_0xd0d1('0x1'))(_0xd0d1('0x2'));var moment=require(_0xd0d1('0x3'));var BPromise=require(_0xd0d1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd0d1('0x5'));var rimraf=require(_0xd0d1('0x6'));var config=require(_0xd0d1('0x7'));var attributes=require(_0xd0d1('0x8'));module['exports']=function(_0x1d6020,_0x2797ed){return _0x1d6020[_0xd0d1('0x9')](_0xd0d1('0xa'),attributes,{'tableName':_0xd0d1('0xb'),'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 bc9d4e8..e115b8c 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 _0x0fdc=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','options','raw','where','attributes','include','map','model','then','ShowWhatsappAccount','catch','util','bluebird','ioredis'];(function(_0x5037ec,_0x2cb385){var _0x1ac0fd=function(_0x4a0693){while(--_0x4a0693){_0x5037ec['push'](_0x5037ec['shift']());}};_0x1ac0fd(++_0x2cb385);}(_0x0fdc,0xeb));var _0xc0fd=function(_0xe283df,_0x319237){_0xe283df=_0xe283df-0x0;var _0x49334d=_0x0fdc[_0xe283df];return _0x49334d;};'use strict';var _=require('lodash');var util=require(_0xc0fd('0x0'));var moment=require('moment');var BPromise=require(_0xc0fd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc0fd('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc0fd('0x3'));var logger=require(_0xc0fd('0x4'))('rpc');var config=require(_0xc0fd('0x5'));var jayson=require(_0xc0fd('0x6'));var client=jayson[_0xc0fd('0x7')][_0xc0fd('0x8')]({'port':0x232a});config[_0xc0fd('0x9')]=_[_0xc0fd('0xa')](config[_0xc0fd('0x9')],{'host':_0xc0fd('0xb'),'port':0x18eb});var socket=require(_0xc0fd('0xc'))(new Redis(config[_0xc0fd('0x9')]));require(_0xc0fd('0xd'))[_0xc0fd('0xe')](socket);function respondWithRpcPromise(_0x455b55,_0x5cf2bc,_0x147cba){return new BPromise(function(_0x4066eb,_0x5671aa){return client[_0xc0fd('0xf')](_0x455b55,_0x147cba)['then'](function(_0x37ae9f){logger[_0xc0fd('0x10')](_0xc0fd('0x11'),_0x5cf2bc,_0xc0fd('0x12'));logger[_0xc0fd('0x13')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x5cf2bc,_0xc0fd('0x12'),JSON[_0xc0fd('0x14')](_0x37ae9f));if(_0x37ae9f['error']){if(_0x37ae9f[_0xc0fd('0x15')][_0xc0fd('0x16')]===0x1f4){logger[_0xc0fd('0x15')](_0xc0fd('0x11'),_0x5cf2bc,_0x37ae9f['error'][_0xc0fd('0x17')]);return _0x5671aa(_0x37ae9f[_0xc0fd('0x15')][_0xc0fd('0x17')]);}logger[_0xc0fd('0x15')](_0xc0fd('0x11'),_0x5cf2bc,_0x37ae9f['error']['message']);return _0x4066eb(_0x37ae9f[_0xc0fd('0x15')][_0xc0fd('0x17')]);}else{logger[_0xc0fd('0x10')](_0xc0fd('0x11'),_0x5cf2bc,'request\x20sent');_0x4066eb(_0x37ae9f['result']['message']);}})['catch'](function(_0x4cc8f5){logger[_0xc0fd('0x15')](_0xc0fd('0x11'),_0x5cf2bc,_0x4cc8f5);_0x5671aa(_0x4cc8f5);});});}exports['ShowWhatsappAccount']=function(_0x557b97){var _0x2345b5=this;return new Promise(function(_0x58c435,_0x1efc89){return db['WhatsappAccount']['find']({'raw':_0x557b97[_0xc0fd('0x18')]?_0x557b97[_0xc0fd('0x18')][_0xc0fd('0x19')]===undefined?!![]:![]:!![],'where':_0x557b97[_0xc0fd('0x18')]?_0x557b97['options'][_0xc0fd('0x1a')]||null:null,'attributes':_0x557b97[_0xc0fd('0x18')]?_0x557b97[_0xc0fd('0x18')][_0xc0fd('0x1b')]||null:null,'include':_0x557b97[_0xc0fd('0x18')]?_0x557b97[_0xc0fd('0x18')][_0xc0fd('0x1c')]?_[_0xc0fd('0x1d')](_0x557b97[_0xc0fd('0x18')][_0xc0fd('0x1c')],function(_0x1274ce){return{'model':db[_0x1274ce['model']],'as':_0x1274ce['as'],'attributes':_0x1274ce['attributes'],'include':_0x1274ce[_0xc0fd('0x1c')]?_[_0xc0fd('0x1d')](_0x1274ce[_0xc0fd('0x1c')],function(_0x33e3d7){return{'model':db[_0x33e3d7[_0xc0fd('0x1e')]],'as':_0x33e3d7['as'],'attributes':_0x33e3d7[_0xc0fd('0x1b')],'include':_0x33e3d7['include']?_[_0xc0fd('0x1d')](_0x33e3d7['include'],function(_0x336faa){return{'model':db[_0x336faa[_0xc0fd('0x1e')]],'as':_0x336faa['as'],'attributes':_0x336faa['attributes']};}):[]};}):[]};}):[]:[]})[_0xc0fd('0x1f')](function(_0x4db2c5){logger[_0xc0fd('0x10')](_0xc0fd('0x20'),_0x557b97);logger[_0xc0fd('0x13')](_0xc0fd('0x20'),_0x557b97,JSON[_0xc0fd('0x14')](_0x4db2c5));_0x58c435(_0x4db2c5);})[_0xc0fd('0x21')](function(_0x41df69){logger[_0xc0fd('0x15')](_0xc0fd('0x20'),_0x41df69[_0xc0fd('0x17')],_0x557b97);_0x1efc89(_0x2345b5[_0xc0fd('0x15')](0x1f4,_0x41df69['message']));});});}; \ No newline at end of file +var _0xf45a=['then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','debug','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','request'];(function(_0x344f37,_0x241ef7){var _0x5d52dd=function(_0x26e00c){while(--_0x26e00c){_0x344f37['push'](_0x344f37['shift']());}};_0x5d52dd(++_0x241ef7);}(_0xf45a,0xcf));var _0xaf45=function(_0x49d56d,_0x21389b){_0x49d56d=_0x49d56d-0x0;var _0x2c79a6=_0xf45a[_0x49d56d];return _0x2c79a6;};'use strict';var _=require(_0xaf45('0x0'));var util=require('util');var moment=require(_0xaf45('0x1'));var BPromise=require(_0xaf45('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf45('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf45('0x4'));var logger=require(_0xaf45('0x5'))(_0xaf45('0x6'));var config=require(_0xaf45('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaf45('0x8')]['http']({'port':0x232a});config[_0xaf45('0x9')]=_[_0xaf45('0xa')](config[_0xaf45('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xaf45('0xb'))(new Redis(config[_0xaf45('0x9')]));require(_0xaf45('0xc'))[_0xaf45('0xd')](socket);function respondWithRpcPromise(_0x518028,_0x1736f6,_0x17382e){return new BPromise(function(_0x2a45ae,_0x47d6e7){return client[_0xaf45('0xe')](_0x518028,_0x17382e)[_0xaf45('0xf')](function(_0x30f63e){logger[_0xaf45('0x10')](_0xaf45('0x11'),_0x1736f6,_0xaf45('0x12'));logger['debug'](_0xaf45('0x13'),_0x1736f6,_0xaf45('0x12'),JSON[_0xaf45('0x14')](_0x30f63e));if(_0x30f63e[_0xaf45('0x15')]){if(_0x30f63e[_0xaf45('0x15')][_0xaf45('0x16')]===0x1f4){logger[_0xaf45('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x1736f6,_0x30f63e['error']['message']);return _0x47d6e7(_0x30f63e[_0xaf45('0x15')][_0xaf45('0x17')]);}logger[_0xaf45('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x1736f6,_0x30f63e[_0xaf45('0x15')][_0xaf45('0x17')]);return _0x2a45ae(_0x30f63e[_0xaf45('0x15')]['message']);}else{logger['info'](_0xaf45('0x11'),_0x1736f6,_0xaf45('0x12'));_0x2a45ae(_0x30f63e[_0xaf45('0x18')]['message']);}})['catch'](function(_0x269650){logger[_0xaf45('0x15')](_0xaf45('0x11'),_0x1736f6,_0x269650);_0x47d6e7(_0x269650);});});}exports[_0xaf45('0x19')]=function(_0xa3c36b){var _0x5f51eb=this;return new Promise(function(_0x27a7e6,_0x5a3fb2){return db[_0xaf45('0x1a')][_0xaf45('0x1b')]({'raw':_0xa3c36b[_0xaf45('0x1c')]?_0xa3c36b[_0xaf45('0x1c')][_0xaf45('0x1d')]===undefined?!![]:![]:!![],'where':_0xa3c36b[_0xaf45('0x1c')]?_0xa3c36b['options'][_0xaf45('0x1e')]||null:null,'attributes':_0xa3c36b['options']?_0xa3c36b[_0xaf45('0x1c')][_0xaf45('0x1f')]||null:null,'include':_0xa3c36b[_0xaf45('0x1c')]?_0xa3c36b[_0xaf45('0x1c')][_0xaf45('0x20')]?_[_0xaf45('0x21')](_0xa3c36b[_0xaf45('0x1c')][_0xaf45('0x20')],function(_0x5f38b6){return{'model':db[_0x5f38b6[_0xaf45('0x22')]],'as':_0x5f38b6['as'],'attributes':_0x5f38b6[_0xaf45('0x1f')],'include':_0x5f38b6[_0xaf45('0x20')]?_[_0xaf45('0x21')](_0x5f38b6['include'],function(_0x3aaf28){return{'model':db[_0x3aaf28[_0xaf45('0x22')]],'as':_0x3aaf28['as'],'attributes':_0x3aaf28[_0xaf45('0x1f')],'include':_0x3aaf28[_0xaf45('0x20')]?_[_0xaf45('0x21')](_0x3aaf28['include'],function(_0x270f1c){return{'model':db[_0x270f1c[_0xaf45('0x22')]],'as':_0x270f1c['as'],'attributes':_0x270f1c['attributes']};}):[]};}):[]};}):[]:[]})[_0xaf45('0xf')](function(_0x3312b6){logger['info'](_0xaf45('0x19'),_0xa3c36b);logger[_0xaf45('0x23')]('ShowWhatsappAccount',_0xa3c36b,JSON['stringify'](_0x3312b6));_0x27a7e6(_0x3312b6);})[_0xaf45('0x24')](function(_0x2b0f6d){logger['error'](_0xaf45('0x19'),_0x2b0f6d[_0xaf45('0x17')],_0xa3c36b);_0x5a3fb2(_0x5f51eb['error'](0x1f4,_0x2b0f6d[_0xaf45('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 73ee5d5..6b5f30e 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 _0x6525=['length','whatsappAccount:','save','removeListener','register'];(function(_0x1e4cfc,_0x16e831){var _0x3eb56e=function(_0x21d6f2){while(--_0x21d6f2){_0x1e4cfc['push'](_0x1e4cfc['shift']());}};_0x3eb56e(++_0x16e831);}(_0x6525,0x66));var _0x5652=function(_0x3f1076,_0x23b6c1){_0x3f1076=_0x3f1076-0x0;var _0x21d34f=_0x6525[_0x3f1076];return _0x21d34f;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x5652('0x0'),'remove','update'];function createListener(_0x264d58,_0x3842a7){return function(_0x30d1dd){_0x3842a7['emit'](_0x264d58,_0x30d1dd);};}function removeListener(_0x3e0d01,_0x17bfaa){return function(){WhatsappAccountEvents[_0x5652('0x1')](_0x3e0d01,_0x17bfaa);};}exports[_0x5652('0x2')]=function(_0x591545){for(var _0x1117bc=0x0,_0xc09b2a=events[_0x5652('0x3')];_0x1117bc<_0xc09b2a;_0x1117bc++){var _0x584d75=events[_0x1117bc];var _0x991d3e=createListener(_0x5652('0x4')+_0x584d75,_0x591545);WhatsappAccountEvents['on'](_0x584d75,_0x991d3e);}}; \ No newline at end of file +var _0x743f=['./whatsappAccount.events','save','remove','update','removeListener','length'];(function(_0x4457d0,_0x2592e0){var _0x521ca4=function(_0x5ba397){while(--_0x5ba397){_0x4457d0['push'](_0x4457d0['shift']());}};_0x521ca4(++_0x2592e0);}(_0x743f,0x66));var _0xf743=function(_0x18fb06,_0x51be38){_0x18fb06=_0x18fb06-0x0;var _0x421d3d=_0x743f[_0x18fb06];return _0x421d3d;};'use strict';var WhatsappAccountEvents=require(_0xf743('0x0'));var events=[_0xf743('0x1'),_0xf743('0x2'),_0xf743('0x3')];function createListener(_0x4a1bb3,_0xf1c362){return function(_0x2b89c8){_0xf1c362['emit'](_0x4a1bb3,_0x2b89c8);};}function removeListener(_0x29f238,_0x4192a8){return function(){WhatsappAccountEvents[_0xf743('0x4')](_0x29f238,_0x4192a8);};}exports['register']=function(_0x1ec7c9){for(var _0xe5f489=0x0,_0x4efb7a=events[_0xf743('0x5')];_0xe5f489<_0x4efb7a;_0xe5f489++){var _0x1ec105=events[_0xe5f489];var _0x44f564=createListener('whatsappAccount:'+_0x1ec105,_0x1ec7c9);WhatsappAccountEvents['on'](_0x1ec105,_0x44f564);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index c01645e..5db13bc 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 _0x1d59=['show','post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index'];(function(_0xccf939,_0x307bd0){var _0x11d934=function(_0x4d4d7f){while(--_0x4d4d7f){_0xccf939['push'](_0xccf939['shift']());}};_0x11d934(++_0x307bd0);}(_0x1d59,0x10d));var _0x91d5=function(_0x15e381,_0x433bc6){_0x15e381=_0x15e381-0x0;var _0xc37e16=_0x1d59[_0x15e381];return _0xc37e16;};'use strict';var multer=require(_0x91d5('0x0'));var util=require('util');var path=require(_0x91d5('0x1'));var timeout=require(_0x91d5('0x2'));var express=require('express');var router=express[_0x91d5('0x3')]();var fs_extra=require(_0x91d5('0x4'));var auth=require(_0x91d5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x91d5('0x6'));var controller=require(_0x91d5('0x7'));router[_0x91d5('0x8')]('/',auth[_0x91d5('0x9')](),controller[_0x91d5('0xa')]);router['get']('/:id',auth[_0x91d5('0x9')](),controller[_0x91d5('0xb')]);router[_0x91d5('0xc')]('/',auth[_0x91d5('0x9')](),controller[_0x91d5('0xd')]);router[_0x91d5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x91d5('0xf')]);router[_0x91d5('0x10')](_0x91d5('0x11'),auth[_0x91d5('0x9')](),controller[_0x91d5('0x12')]);module[_0x91d5('0x13')]=router; \ No newline at end of file +var _0xb7d3=['../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','update','destroy','exports','multer','util','express','fs-extra','../../components/auth/service'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb7d3,0x9b));var _0x3b7d=function(_0xc64946,_0x229695){_0xc64946=_0xc64946-0x0;var _0x2f66e5=_0xb7d3[_0xc64946];return _0x2f66e5;};'use strict';var multer=require(_0x3b7d('0x0'));var util=require(_0x3b7d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3b7d('0x2'));var router=express['Router']();var fs_extra=require(_0x3b7d('0x3'));var auth=require(_0x3b7d('0x4'));var interaction=require(_0x3b7d('0x5'));var config=require(_0x3b7d('0x6'));var controller=require(_0x3b7d('0x7'));router[_0x3b7d('0x8')]('/',auth[_0x3b7d('0x9')](),controller[_0x3b7d('0xa')]);router[_0x3b7d('0x8')](_0x3b7d('0xb'),auth[_0x3b7d('0x9')](),controller[_0x3b7d('0xc')]);router['post']('/',auth[_0x3b7d('0x9')](),controller['create']);router['put'](_0x3b7d('0xb'),auth[_0x3b7d('0x9')](),controller[_0x3b7d('0xd')]);router['delete']('/:id',auth[_0x3b7d('0x9')](),controller[_0x3b7d('0xe')]);module[_0x3b7d('0xf')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 02710d6..2f20312 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 _0x400a=['noop','*,*,*,*','exports','STRING'];(function(_0x2517bd,_0x33b9f4){var _0x2d75c7=function(_0x21e353){while(--_0x21e353){_0x2517bd['push'](_0x2517bd['shift']());}};_0x2d75c7(++_0x33b9f4);}(_0x400a,0x66));var _0xa400=function(_0x196cc9,_0x214f92){_0x196cc9=_0x196cc9-0x0;var _0x1a2238=_0x400a[_0x196cc9];return _0x1a2238;};'use strict';var Sequelize=require('sequelize');module[_0xa400('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xa400('0x1')],'allowNull':![],'defaultValue':_0xa400('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa400('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa400('0x3')}}; \ No newline at end of file +var _0x7992=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x18fec8,_0x31d0cd){var _0x5e400c=function(_0x1f3bc0){while(--_0x1f3bc0){_0x18fec8['push'](_0x18fec8['shift']());}};_0x5e400c(++_0x31d0cd);}(_0x7992,0x192));var _0x2799=function(_0x6c0123,_0x4c8d3b){_0x6c0123=_0x6c0123-0x0;var _0x5a87d2=_0x7992[_0x6c0123];return _0x5a87d2;};'use strict';var Sequelize=require(_0x2799('0x0'));module[_0x2799('0x1')]={'priority':{'type':Sequelize[_0x2799('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2799('0x3')],'allowNull':![],'defaultValue':_0x2799('0x4')},'appdata':{'type':Sequelize[_0x2799('0x5')]()},'description':{'type':Sequelize[_0x2799('0x3')]},'interval':{'type':Sequelize[_0x2799('0x3')],'defaultValue':_0x2799('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 88f603f..8f6d1dd 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 _0xd824=['../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','WhatsappApplication','rawAttributes','type','key','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','pick','filters','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4a628d,_0x106074){var _0x26ea15=function(_0x26a5a7){while(--_0x26a5a7){_0x4a628d['push'](_0x4a628d['shift']());}};_0x26ea15(++_0x106074);}(_0xd824,0xc2));var _0x4d82=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd824[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x4d82('0x0'));var rimraf=require(_0x4d82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4d82('0x2'));var moment=require(_0x4d82('0x3'));var BPromise=require(_0x4d82('0x4'));var Mustache=require(_0x4d82('0x5'));var util=require(_0x4d82('0x6'));var path=require(_0x4d82('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4d82('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4d82('0x9'));var crypto=require(_0x4d82('0xa'));var jsforce=require(_0x4d82('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4d82('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d82('0xd'));var authService=require(_0x4d82('0xe'));var qs=require(_0x4d82('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d82('0x10'));var logger=require('../../config/logger')(_0x4d82('0x11'));var utils=require(_0x4d82('0x12'));var config=require(_0x4d82('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x346394,_0x248eed){_0x248eed=_0x248eed||0xcc;return function(_0x319ba8){if(_0x319ba8){return _0x346394[_0x4d82('0x14')](_0x248eed);}return _0x346394['status'](_0x248eed)[_0x4d82('0x15')]();};}function respondWithResult(_0x2094bc,_0x41f5b2){_0x41f5b2=_0x41f5b2||0xc8;return function(_0x486152){if(_0x486152){return _0x2094bc[_0x4d82('0x16')](_0x41f5b2)['json'](_0x486152);}};}function respondWithFilteredResult(_0x3382c4,_0x5012db){return function(_0x469e09){if(_0x469e09){var _0x496f3b=typeof _0x5012db[_0x4d82('0x17')]===_0x4d82('0x18')&&typeof _0x5012db[_0x4d82('0x19')]===_0x4d82('0x18');var _0x2648a8=_0x469e09[_0x4d82('0x1a')];var _0x258c59=_0x496f3b?0x0:_0x5012db[_0x4d82('0x17')];var _0x2f2127=_0x496f3b?_0x469e09['count']:_0x5012db[_0x4d82('0x17')]+_0x5012db[_0x4d82('0x19')];var _0x1b1e39;if(_0x2f2127>=_0x2648a8){_0x2f2127=_0x2648a8;_0x1b1e39=0xc8;}else{_0x1b1e39=0xce;}_0x3382c4[_0x4d82('0x16')](_0x1b1e39);return _0x3382c4[_0x4d82('0x1b')](_0x4d82('0x1c'),_0x258c59+'-'+_0x2f2127+'/'+_0x2648a8)[_0x4d82('0x1d')](_0x469e09);}return null;};}function patchUpdates(_0x64669c){return function(_0x19832f){try{jsonpatch[_0x4d82('0x1e')](_0x19832f,_0x64669c,!![]);}catch(_0xf2f5a5){return BPromise['reject'](_0xf2f5a5);}return _0x19832f[_0x4d82('0x1f')]();};}function saveUpdates(_0x748ee7,_0x5e5bdf){return function(_0x1a419f){if(_0x1a419f){return _0x1a419f[_0x4d82('0x20')](_0x748ee7)[_0x4d82('0x21')](function(_0x14a2d4){return _0x14a2d4;});}return null;};}function removeEntity(_0xe17d70,_0x15f5d1){return function(_0x11c043){if(_0x11c043){return _0x11c043[_0x4d82('0x22')]()[_0x4d82('0x21')](function(){_0xe17d70[_0x4d82('0x16')](0xcc)[_0x4d82('0x15')]();});}};}function handleEntityNotFound(_0x395efc,_0x7404ba){return function(_0x284c66){if(!_0x284c66){_0x395efc[_0x4d82('0x14')](0x194);}return _0x284c66;};}function handleError(_0x4af6da,_0x5e0b03){_0x5e0b03=_0x5e0b03||0x1f4;return function(_0x3dcb0f){logger[_0x4d82('0x23')](_0x3dcb0f[_0x4d82('0x24')]);if(_0x3dcb0f[_0x4d82('0x25')]){delete _0x3dcb0f['name'];}_0x4af6da[_0x4d82('0x16')](_0x5e0b03)[_0x4d82('0x26')](_0x3dcb0f);};}exports[_0x4d82('0x27')]=function(_0x11d022,_0x5ce98b){var _0x4081f6={},_0x4a7444={},_0x4d9ac4={'count':0x0,'rows':[]};var _0x487581=_['map'](db[_0x4d82('0x28')][_0x4d82('0x29')],function(_0x88318c){return{'name':_0x88318c['fieldName'],'type':_0x88318c[_0x4d82('0x2a')][_0x4d82('0x2b')]};});_0x4a7444['model']=_['map'](_0x487581,_0x4d82('0x25'));_0x4a7444[_0x4d82('0x2c')]=_[_0x4d82('0x2d')](_0x11d022[_0x4d82('0x2c')]);_0x4a7444['filters']=_[_0x4d82('0x2e')](_0x4a7444['model'],_0x4a7444[_0x4d82('0x2c')]);_0x4081f6[_0x4d82('0x2f')]=_['intersection'](_0x4a7444['model'],qs[_0x4d82('0x30')](_0x11d022[_0x4d82('0x2c')][_0x4d82('0x30')]));_0x4081f6[_0x4d82('0x2f')]=_0x4081f6[_0x4d82('0x2f')][_0x4d82('0x31')]?_0x4081f6[_0x4d82('0x2f')]:_0x4a7444[_0x4d82('0x32')];if(!_0x11d022[_0x4d82('0x2c')][_0x4d82('0x33')]('nolimit')){_0x4081f6[_0x4d82('0x19')]=qs[_0x4d82('0x19')](_0x11d022[_0x4d82('0x2c')]['limit']);_0x4081f6[_0x4d82('0x17')]=qs[_0x4d82('0x17')](_0x11d022['query'][_0x4d82('0x17')]);}_0x4081f6[_0x4d82('0x34')]=qs[_0x4d82('0x35')](_0x11d022['query'][_0x4d82('0x35')]);_0x4081f6[_0x4d82('0x36')]=qs['filters'](_[_0x4d82('0x37')](_0x11d022['query'],_0x4a7444[_0x4d82('0x38')]),_0x487581);if(_0x11d022[_0x4d82('0x2c')]['filter']){_0x4081f6[_0x4d82('0x36')]=_['merge'](_0x4081f6[_0x4d82('0x36')],{'$or':_['map'](_0x487581,function(_0x51c705){if(_0x51c705[_0x4d82('0x2a')]!=='VIRTUAL'){var _0x2528d7={};_0x2528d7[_0x51c705['name']]={'$like':'%'+_0x11d022[_0x4d82('0x2c')][_0x4d82('0x39')]+'%'};return _0x2528d7;}})});}_0x4081f6=_['merge']({},_0x4081f6,_0x11d022[_0x4d82('0x3a')]);var _0x5d9444={'where':_0x4081f6[_0x4d82('0x36')]};return db[_0x4d82('0x28')]['count'](_0x5d9444)[_0x4d82('0x21')](function(_0x5521f1){_0x4d9ac4[_0x4d82('0x1a')]=_0x5521f1;if(_0x11d022[_0x4d82('0x2c')][_0x4d82('0x3b')]){_0x4081f6[_0x4d82('0x3c')]=[{'all':!![]}];}return db[_0x4d82('0x28')][_0x4d82('0x3d')](_0x4081f6);})['then'](function(_0x222b35){_0x4d9ac4[_0x4d82('0x3e')]=_0x222b35;return _0x4d9ac4;})[_0x4d82('0x21')](respondWithFilteredResult(_0x5ce98b,_0x4081f6))[_0x4d82('0x3f')](handleError(_0x5ce98b,null));};exports[_0x4d82('0x40')]=function(_0x363158,_0x37498b){var _0x4c474b={'raw':!![],'where':{'id':_0x363158[_0x4d82('0x41')]['id']}},_0x3c80d6={};_0x3c80d6[_0x4d82('0x32')]=_[_0x4d82('0x2d')](db[_0x4d82('0x28')]['rawAttributes']);_0x3c80d6[_0x4d82('0x2c')]=_[_0x4d82('0x2d')](_0x363158[_0x4d82('0x2c')]);_0x3c80d6[_0x4d82('0x38')]=_[_0x4d82('0x2e')](_0x3c80d6[_0x4d82('0x32')],_0x3c80d6[_0x4d82('0x2c')]);_0x4c474b['attributes']=_[_0x4d82('0x2e')](_0x3c80d6[_0x4d82('0x32')],qs['fields'](_0x363158[_0x4d82('0x2c')]['fields']));_0x4c474b[_0x4d82('0x2f')]=_0x4c474b[_0x4d82('0x2f')]['length']?_0x4c474b[_0x4d82('0x2f')]:_0x3c80d6[_0x4d82('0x32')];if(_0x363158['query'][_0x4d82('0x3b')]){_0x4c474b[_0x4d82('0x3c')]=[{'all':!![]}];}_0x4c474b=_[_0x4d82('0x42')]({},_0x4c474b,_0x363158['options']);return db[_0x4d82('0x28')][_0x4d82('0x43')](_0x4c474b)['then'](handleEntityNotFound(_0x37498b,null))['then'](respondWithResult(_0x37498b,null))[_0x4d82('0x3f')](handleError(_0x37498b,null));};exports[_0x4d82('0x44')]=function(_0x40c5ed,_0xb9d3bd){return db[_0x4d82('0x28')][_0x4d82('0x44')](_0x40c5ed[_0x4d82('0x45')],{})['then'](respondWithResult(_0xb9d3bd,0xc9))[_0x4d82('0x3f')](handleError(_0xb9d3bd,null));};exports[_0x4d82('0x20')]=function(_0x2e4083,_0x234ce3){if(_0x2e4083['body']['id']){delete _0x2e4083['body']['id'];}return db['WhatsappApplication'][_0x4d82('0x43')]({'where':{'id':_0x2e4083[_0x4d82('0x41')]['id']}})[_0x4d82('0x21')](handleEntityNotFound(_0x234ce3,null))[_0x4d82('0x21')](saveUpdates(_0x2e4083[_0x4d82('0x45')],null))[_0x4d82('0x21')](respondWithResult(_0x234ce3,null))['catch'](handleError(_0x234ce3,null));};exports[_0x4d82('0x22')]=function(_0x1c022d,_0x3c0ffc){return db[_0x4d82('0x28')][_0x4d82('0x43')]({'where':{'id':_0x1c022d[_0x4d82('0x41')]['id']}})[_0x4d82('0x21')](handleEntityNotFound(_0x3c0ffc,null))[_0x4d82('0x21')](removeEntity(_0x3c0ffc,null))[_0x4d82('0x3f')](handleError(_0x3c0ffc,null));}; \ No newline at end of file +var _0xb931=['desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','WhatsappApplication','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','rawAttributes','keys','find','create','body','params','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x288536,_0x369b51){var _0x525e94=function(_0x2fe9db){while(--_0x2fe9db){_0x288536['push'](_0x288536['shift']());}};_0x525e94(++_0x369b51);}(_0xb931,0x155));var _0x1b93=function(_0x10018c,_0x2c62cd){_0x10018c=_0x10018c-0x0;var _0x45177d=_0xb931[_0x10018c];return _0x45177d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1b93('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b93('0x1'));var BPromise=require(_0x1b93('0x2'));var Mustache=require(_0x1b93('0x3'));var util=require(_0x1b93('0x4'));var path=require(_0x1b93('0x5'));var sox=require(_0x1b93('0x6'));var csv=require(_0x1b93('0x7'));var ejs=require(_0x1b93('0x8'));var fs=require('fs');var fs_extra=require(_0x1b93('0x9'));var _=require(_0x1b93('0xa'));var squel=require(_0x1b93('0xb'));var crypto=require(_0x1b93('0xc'));var jsforce=require(_0x1b93('0xd'));var deskjs=require(_0x1b93('0xe'));var toCsv=require(_0x1b93('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1b93('0xf'));var authService=require(_0x1b93('0x10'));var qs=require(_0x1b93('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b93('0x12'));var logger=require('../../config/logger')(_0x1b93('0x13'));var utils=require(_0x1b93('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1b93('0x15'))['db'];function respondWithStatusCode(_0x2606eb,_0x3c4881){_0x3c4881=_0x3c4881||0xcc;return function(_0x50f99f){if(_0x50f99f){return _0x2606eb[_0x1b93('0x16')](_0x3c4881);}return _0x2606eb['status'](_0x3c4881)[_0x1b93('0x17')]();};}function respondWithResult(_0x12ca65,_0x3ab584){_0x3ab584=_0x3ab584||0xc8;return function(_0x1ea97a){if(_0x1ea97a){return _0x12ca65[_0x1b93('0x18')](_0x3ab584)[_0x1b93('0x19')](_0x1ea97a);}};}function respondWithFilteredResult(_0x4a0bb6,_0x140515){return function(_0x267527){if(_0x267527){var _0x240b8f=typeof _0x140515[_0x1b93('0x1a')]==='undefined'&&typeof _0x140515[_0x1b93('0x1b')]===_0x1b93('0x1c');var _0x4f7199=_0x267527[_0x1b93('0x1d')];var _0x339c5b=_0x240b8f?0x0:_0x140515['offset'];var _0x5ccbf4=_0x240b8f?_0x267527[_0x1b93('0x1d')]:_0x140515[_0x1b93('0x1a')]+_0x140515[_0x1b93('0x1b')];var _0x4156d9;if(_0x5ccbf4>=_0x4f7199){_0x5ccbf4=_0x4f7199;_0x4156d9=0xc8;}else{_0x4156d9=0xce;}_0x4a0bb6[_0x1b93('0x18')](_0x4156d9);return _0x4a0bb6['set'](_0x1b93('0x1e'),_0x339c5b+'-'+_0x5ccbf4+'/'+_0x4f7199)[_0x1b93('0x19')](_0x267527);}return null;};}function patchUpdates(_0x5cba05){return function(_0x546288){try{jsonpatch[_0x1b93('0x1f')](_0x546288,_0x5cba05,!![]);}catch(_0x116775){return BPromise[_0x1b93('0x20')](_0x116775);}return _0x546288[_0x1b93('0x21')]();};}function saveUpdates(_0x2619e6,_0x333390){return function(_0x577a22){if(_0x577a22){return _0x577a22[_0x1b93('0x22')](_0x2619e6)[_0x1b93('0x23')](function(_0x208217){return _0x208217;});}return null;};}function removeEntity(_0x5a61dc,_0x1cfcd1){return function(_0x41f219){if(_0x41f219){return _0x41f219[_0x1b93('0x24')]()[_0x1b93('0x23')](function(){_0x5a61dc[_0x1b93('0x18')](0xcc)[_0x1b93('0x17')]();});}};}function handleEntityNotFound(_0x13cddc,_0x309ac5){return function(_0x14626a){if(!_0x14626a){_0x13cddc[_0x1b93('0x16')](0x194);}return _0x14626a;};}function handleError(_0x8010e6,_0x189869){_0x189869=_0x189869||0x1f4;return function(_0xa15258){logger[_0x1b93('0x25')](_0xa15258[_0x1b93('0x26')]);if(_0xa15258['name']){delete _0xa15258['name'];}_0x8010e6[_0x1b93('0x18')](_0x189869)[_0x1b93('0x27')](_0xa15258);};}exports[_0x1b93('0x28')]=function(_0x2501ee,_0x20b035){var _0xc47d69={},_0x59983e={},_0x5af450={'count':0x0,'rows':[]};var _0x2e7f79=_[_0x1b93('0x29')](db[_0x1b93('0x2a')]['rawAttributes'],function(_0x3dc539){return{'name':_0x3dc539['fieldName'],'type':_0x3dc539[_0x1b93('0x2b')][_0x1b93('0x2c')]};});_0x59983e[_0x1b93('0x2d')]=_['map'](_0x2e7f79,'name');_0x59983e[_0x1b93('0x2e')]=_['keys'](_0x2501ee[_0x1b93('0x2e')]);_0x59983e[_0x1b93('0x2f')]=_[_0x1b93('0x30')](_0x59983e['model'],_0x59983e[_0x1b93('0x2e')]);_0xc47d69[_0x1b93('0x31')]=_[_0x1b93('0x30')](_0x59983e[_0x1b93('0x2d')],qs[_0x1b93('0x32')](_0x2501ee[_0x1b93('0x2e')][_0x1b93('0x32')]));_0xc47d69[_0x1b93('0x31')]=_0xc47d69[_0x1b93('0x31')][_0x1b93('0x33')]?_0xc47d69[_0x1b93('0x31')]:_0x59983e['model'];if(!_0x2501ee['query'][_0x1b93('0x34')](_0x1b93('0x35'))){_0xc47d69[_0x1b93('0x1b')]=qs[_0x1b93('0x1b')](_0x2501ee[_0x1b93('0x2e')][_0x1b93('0x1b')]);_0xc47d69[_0x1b93('0x1a')]=qs['offset'](_0x2501ee['query']['offset']);}_0xc47d69[_0x1b93('0x36')]=qs[_0x1b93('0x37')](_0x2501ee['query']['sort']);_0xc47d69[_0x1b93('0x38')]=qs[_0x1b93('0x2f')](_['pick'](_0x2501ee[_0x1b93('0x2e')],_0x59983e['filters']),_0x2e7f79);if(_0x2501ee[_0x1b93('0x2e')][_0x1b93('0x39')]){_0xc47d69[_0x1b93('0x38')]=_[_0x1b93('0x3a')](_0xc47d69[_0x1b93('0x38')],{'$or':_[_0x1b93('0x29')](_0x2e7f79,function(_0x538e18){if(_0x538e18[_0x1b93('0x2b')]!=='VIRTUAL'){var _0x3755cc={};_0x3755cc[_0x538e18['name']]={'$like':'%'+_0x2501ee[_0x1b93('0x2e')][_0x1b93('0x39')]+'%'};return _0x3755cc;}})});}_0xc47d69=_[_0x1b93('0x3a')]({},_0xc47d69,_0x2501ee[_0x1b93('0x3b')]);var _0x46c9bf={'where':_0xc47d69[_0x1b93('0x38')]};return db[_0x1b93('0x2a')][_0x1b93('0x1d')](_0x46c9bf)[_0x1b93('0x23')](function(_0x42913e){_0x5af450[_0x1b93('0x1d')]=_0x42913e;if(_0x2501ee[_0x1b93('0x2e')][_0x1b93('0x3c')]){_0xc47d69[_0x1b93('0x3d')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x1b93('0x3e')](_0xc47d69);})[_0x1b93('0x23')](function(_0x318d13){_0x5af450['rows']=_0x318d13;return _0x5af450;})[_0x1b93('0x23')](respondWithFilteredResult(_0x20b035,_0xc47d69))[_0x1b93('0x3f')](handleError(_0x20b035,null));};exports[_0x1b93('0x40')]=function(_0x37d2c2,_0xd1017){var _0x4ec427={'raw':!![],'where':{'id':_0x37d2c2['params']['id']}},_0x5ad3e3={};_0x5ad3e3[_0x1b93('0x2d')]=_['keys'](db['WhatsappApplication'][_0x1b93('0x41')]);_0x5ad3e3[_0x1b93('0x2e')]=_[_0x1b93('0x42')](_0x37d2c2[_0x1b93('0x2e')]);_0x5ad3e3[_0x1b93('0x2f')]=_[_0x1b93('0x30')](_0x5ad3e3[_0x1b93('0x2d')],_0x5ad3e3['query']);_0x4ec427['attributes']=_[_0x1b93('0x30')](_0x5ad3e3[_0x1b93('0x2d')],qs['fields'](_0x37d2c2[_0x1b93('0x2e')][_0x1b93('0x32')]));_0x4ec427['attributes']=_0x4ec427[_0x1b93('0x31')]['length']?_0x4ec427[_0x1b93('0x31')]:_0x5ad3e3[_0x1b93('0x2d')];if(_0x37d2c2['query'][_0x1b93('0x3c')]){_0x4ec427[_0x1b93('0x3d')]=[{'all':!![]}];}_0x4ec427=_[_0x1b93('0x3a')]({},_0x4ec427,_0x37d2c2[_0x1b93('0x3b')]);return db['WhatsappApplication'][_0x1b93('0x43')](_0x4ec427)[_0x1b93('0x23')](handleEntityNotFound(_0xd1017,null))[_0x1b93('0x23')](respondWithResult(_0xd1017,null))[_0x1b93('0x3f')](handleError(_0xd1017,null));};exports['create']=function(_0x154c7a,_0x1ef0b1){return db['WhatsappApplication'][_0x1b93('0x44')](_0x154c7a['body'],{})[_0x1b93('0x23')](respondWithResult(_0x1ef0b1,0xc9))[_0x1b93('0x3f')](handleError(_0x1ef0b1,null));};exports[_0x1b93('0x22')]=function(_0x1df9d4,_0x4a6918){if(_0x1df9d4[_0x1b93('0x45')]['id']){delete _0x1df9d4[_0x1b93('0x45')]['id'];}return db[_0x1b93('0x2a')][_0x1b93('0x43')]({'where':{'id':_0x1df9d4[_0x1b93('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a6918,null))[_0x1b93('0x23')](saveUpdates(_0x1df9d4['body'],null))['then'](respondWithResult(_0x4a6918,null))[_0x1b93('0x3f')](handleError(_0x4a6918,null));};exports[_0x1b93('0x24')]=function(_0x32f6cd,_0x1e7fcf){return db[_0x1b93('0x2a')]['find']({'where':{'id':_0x32f6cd[_0x1b93('0x46')]['id']}})[_0x1b93('0x23')](handleEntityNotFound(_0x1e7fcf,null))[_0x1b93('0x23')](removeEntity(_0x1e7fcf,null))[_0x1b93('0x3f')](handleError(_0x1e7fcf,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 8632b5f..f547633 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 _0x64f5=['path','../../config/environment','./whatsappApplication.attributes','exports','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','moment','request-promise'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x64f5,0x17e));var _0x564f=function(_0x44ad32,_0x524c6e){_0x44ad32=_0x44ad32-0x0;var _0x307bf3=_0x64f5[_0x44ad32];return _0x307bf3;};'use strict';var _=require(_0x564f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x564f('0x1'));var BPromise=require('bluebird');var rp=require(_0x564f('0x2'));var fs=require('fs');var path=require(_0x564f('0x3'));var rimraf=require('rimraf');var config=require(_0x564f('0x4'));var attributes=require(_0x564f('0x5'));module[_0x564f('0x6')]=function(_0x72b009,_0x4bbedf){return _0x72b009['define'](_0x564f('0x7'),attributes,{'tableName':_0x564f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x564f('0x9'),'collate':_0x564f('0xa')});}; \ No newline at end of file +var _0x01fe=['../../config/environment','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x01fe,0x102));var _0xe01f=function(_0x20de9f,_0x311434){_0x20de9f=_0x20de9f-0x0;var _0x561526=_0x01fe[_0x20de9f];return _0x561526;};'use strict';var _=require(_0xe01f('0x0'));var util=require('util');var logger=require(_0xe01f('0x1'))(_0xe01f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe01f('0x3'));var fs=require('fs');var path=require(_0xe01f('0x4'));var rimraf=require(_0xe01f('0x5'));var config=require(_0xe01f('0x6'));var attributes=require('./whatsappApplication.attributes');module[_0xe01f('0x7')]=function(_0x574969,_0x3effc4){return _0x574969[_0xe01f('0x8')](_0xe01f('0x9'),attributes,{'tableName':_0xe01f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe01f('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index f341ae0..01fba49 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 _0x99e9=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x5578ed,_0xb4bcc9){var _0x1bdb67=function(_0x1af359){while(--_0x1af359){_0x5578ed['push'](_0x5578ed['shift']());}};_0x1bdb67(++_0xb4bcc9);}(_0x99e9,0xb4));var _0x999e=function(_0x51f4fc,_0x1fe3ef){_0x51f4fc=_0x51f4fc-0x0;var _0x4d96fc=_0x99e9[_0x51f4fc];return _0x4d96fc;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var moment=require(_0x999e('0x1'));var BPromise=require(_0x999e('0x2'));var rs=require(_0x999e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x999e('0x4'))['db'];var utils=require(_0x999e('0x5'));var logger=require(_0x999e('0x6'))('rpc');var config=require(_0x999e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x999e('0x8')][_0x999e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x100330,_0x18f337,_0x5c1c17){return new BPromise(function(_0x46aeae,_0x38a692){return client[_0x999e('0xa')](_0x100330,_0x5c1c17)[_0x999e('0xb')](function(_0x2c38cf){logger[_0x999e('0xc')](_0x999e('0xd'),_0x18f337,_0x999e('0xe'));logger[_0x999e('0xf')](_0x999e('0x10'),_0x18f337,_0x999e('0xe'),JSON[_0x999e('0x11')](_0x2c38cf));if(_0x2c38cf[_0x999e('0x12')]){if(_0x2c38cf[_0x999e('0x12')][_0x999e('0x13')]===0x1f4){logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x38a692(_0x2c38cf['error'][_0x999e('0x14')]);}logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x46aeae(_0x2c38cf['error'][_0x999e('0x14')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x18f337,_0x999e('0xe'));_0x46aeae(_0x2c38cf[_0x999e('0x15')][_0x999e('0x14')]);}})[_0x999e('0x16')](function(_0x1e9bff){logger[_0x999e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x18f337,_0x1e9bff);_0x38a692(_0x1e9bff);});});} \ No newline at end of file +var _0x55e0=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x55e0,0xdc));var _0x055e=function(_0x395667,_0x45593a){_0x395667=_0x395667-0x0;var _0x5cdb8f=_0x55e0[_0x395667];return _0x5cdb8f;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4384ff,_0x4a442e,_0x8e7824){return new BPromise(function(_0x3c4cf,_0x376618){return client[_0x055e('0xa')](_0x4384ff,_0x8e7824)[_0x055e('0xb')](function(_0x49540c){logger[_0x055e('0xc')](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));logger[_0x055e('0xf')](_0x055e('0x10'),_0x4a442e,'request\x20sent',JSON['stringify'](_0x49540c));if(_0x49540c[_0x055e('0x11')]){if(_0x49540c['error'][_0x055e('0x12')]===0x1f4){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x376618(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}logger['error'](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x3c4cf(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}else{logger['info'](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));_0x3c4cf(_0x49540c[_0x055e('0x14')]['message']);}})[_0x055e('0x15')](function(_0x2c377c){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x2c377c);_0x376618(_0x2c377c);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index c34c0ca..ac38832 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 _0xaa37=['describe','show','/:id/messages','getMessages','post','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','put','/:id','update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','isAuthenticated'];(function(_0x256a99,_0x5705b8){var _0x5b1105=function(_0x189521){while(--_0x189521){_0x256a99['push'](_0x256a99['shift']());}};_0x5b1105(++_0x5705b8);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xaa37[_0x13e741];return _0x3f8bb3;};'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/download',auth[_0x7aa3('0xc')](),controller['download']);router[_0x7aa3('0x11')]('/',auth[_0x7aa3('0xc')](),controller['create']);router[_0x7aa3('0x11')](_0x7aa3('0xf'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x7aa3('0x12'),auth[_0x7aa3('0xc')](),interaction[_0x7aa3('0x13')](_0x7aa3('0x14'),_0x7aa3('0x15')),controller['addTags']);router[_0x7aa3('0x16')](_0x7aa3('0x17'),auth[_0x7aa3('0xc')](),interaction[_0x7aa3('0x13')]('whatsapp','whatsappinteraction:update'),controller[_0x7aa3('0x18')]);router['delete'](_0x7aa3('0x17'),auth[_0x7aa3('0xc')](),interaction['tracked'](_0x7aa3('0x14'),_0x7aa3('0x19')),controller[_0x7aa3('0x1a')]);router[_0x7aa3('0x1b')](_0x7aa3('0x12'),auth['isAuthenticated'](),controller[_0x7aa3('0x1c')]);module[_0x7aa3('0x1d')]=router; \ No newline at end of file +var _0x4745=['../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','isAuthenticated','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','delete','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x52b34e,_0x26bfbe){var _0x3d6a3d=function(_0xcbaae2){while(--_0xcbaae2){_0x52b34e['push'](_0x52b34e['shift']());}};_0x3d6a3d(++_0x26bfbe);}(_0x4745,0x1e7));var _0x5474=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x4745[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var path=require(_0x5474('0x2'));var timeout=require(_0x5474('0x3'));var express=require(_0x5474('0x4'));var router=express[_0x5474('0x5')]();var fs_extra=require(_0x5474('0x6'));var auth=require(_0x5474('0x7'));var interaction=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var controller=require(_0x5474('0xa'));router[_0x5474('0xb')]('/',auth['isAuthenticated'](),controller[_0x5474('0xc')]);router[_0x5474('0xb')]('/describe',auth[_0x5474('0xd')](),controller['describe']);router[_0x5474('0xb')](_0x5474('0xe'),auth['isAuthenticated'](),controller[_0x5474('0xf')]);router[_0x5474('0xb')](_0x5474('0x10'),auth[_0x5474('0xd')](),controller[_0x5474('0x11')]);router[_0x5474('0xb')](_0x5474('0x12'),auth[_0x5474('0xd')](),controller['download']);router[_0x5474('0x13')]('/',auth[_0x5474('0xd')](),controller[_0x5474('0x14')]);router[_0x5474('0x13')](_0x5474('0x10'),auth[_0x5474('0xd')](),controller[_0x5474('0x15')]);router[_0x5474('0x13')](_0x5474('0x16'),auth['isAuthenticated'](),interaction[_0x5474('0x17')](_0x5474('0x18'),_0x5474('0x19')),controller[_0x5474('0x1a')]);router['put']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x5474('0x18'),_0x5474('0x1b')),controller[_0x5474('0x1c')]);router['delete'](_0x5474('0xe'),auth[_0x5474('0xd')](),interaction['tracked'](_0x5474('0x18'),_0x5474('0x1d')),controller[_0x5474('0x1e')]);router[_0x5474('0x1f')](_0x5474('0x16'),auth['isAuthenticated'](),controller[_0x5474('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 0c5ec90..27a41e9 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 _0x04e7=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x5a3588,_0x4e4fc0){var _0xc08d5=function(_0x20d7d9){while(--_0x20d7d9){_0x5a3588['push'](_0x5a3588['shift']());}};_0xc08d5(++_0x4e4fc0);}(_0x04e7,0x121));var _0x704e=function(_0x3877c1,_0x238c29){_0x3877c1=_0x3877c1-0x0;var _0x59056a=_0x04e7[_0x3877c1];return _0x59056a;};'use strict';var Sequelize=require(_0x704e('0x0'));var moment=require(_0x704e('0x1'));module[_0x704e('0x2')]={'closed':{'type':Sequelize[_0x704e('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x704e('0x4')]},'disposition':{'type':Sequelize[_0x704e('0x5')]},'secondDisposition':{'type':Sequelize[_0x704e('0x5')]},'thirdDisposition':{'type':Sequelize[_0x704e('0x5')]},'note':{'type':Sequelize[_0x704e('0x5')]},'phone':{'type':Sequelize[_0x704e('0x5')]},'read1stAt':{'type':Sequelize[_0x704e('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x704e('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x704e('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x704e('0x6')]('in',_0x704e('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x704e('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xb073=['out','moment','BOOLEAN','DATE','STRING','ENUM'];(function(_0x3ad94a,_0x55369a){var _0x49cfb3=function(_0x4706f4){while(--_0x4706f4){_0x3ad94a['push'](_0x3ad94a['shift']());}};_0x49cfb3(++_0x55369a);}(_0xb073,0x187));var _0x3b07=function(_0x3fae31,_0x368645){_0x3fae31=_0x3fae31-0x0;var _0x1f6e92=_0xb073[_0x3fae31];return _0x1f6e92;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3b07('0x0'));module['exports']={'closed':{'type':Sequelize[_0x3b07('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3b07('0x2')]},'disposition':{'type':Sequelize[_0x3b07('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3b07('0x3')]},'note':{'type':Sequelize[_0x3b07('0x3')]},'phone':{'type':Sequelize[_0x3b07('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x3b07('0x4')]('in',_0x3b07('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3b07('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x3b07('0x4')]('in',_0x3b07('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3b07('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 4c429a5..a552f61 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 _0x1da1=['filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','length','unreadMessages','value','having','`\x20=\x200','`\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','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$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?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','toString','sequelize','keyBy','a.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','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','all','rows','show','params','include','options','create','describe','addMessage','WhatsappMessage','omit','ids','sort','pick','merge','format','includeAll','addTags','setTags','spread','findAll','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','createdAt','direction','secret','WhatsappAccount','Owner','get','mkdirSync','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','Messages','basename','existsSync','createReadStream','createWriteStream','out','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','sendStatus','error','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x2c22d8,_0x210bec){var _0x4b692f=function(_0x5a5261){while(--_0x5a5261){_0x2c22d8['push'](_0x2c22d8['shift']());}};_0x4b692f(++_0x210bec);}(_0x1da1,0x1a4));var _0x11da=function(_0x3de37d,_0x3b1b7b){_0x3de37d=_0x3de37d-0x0;var _0x41855b=_0x1da1[_0x3de37d];return _0x41855b;};'use strict';var emlformat=require(_0x11da('0x0'));var rimraf=require(_0x11da('0x1'));var zipdir=require(_0x11da('0x2'));var jsonpatch=require(_0x11da('0x3'));var rp=require(_0x11da('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x11da('0x5'));var util=require(_0x11da('0x6'));var path=require(_0x11da('0x7'));var sox=require('sox');var csv=require(_0x11da('0x8'));var ejs=require(_0x11da('0x9'));var fs=require('fs');var fs_extra=require(_0x11da('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x11da('0xb'));var jsforce=require(_0x11da('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x11da('0x8'));var querystring=require(_0x11da('0xd'));var Papa=require('papaparse');var Redis=require(_0x11da('0xe'));var authService=require(_0x11da('0xf'));var qs=require(_0x11da('0x10'));var as=require(_0x11da('0x11'));var pdf=require(_0x11da('0x12'));var hardwareService=require(_0x11da('0x13'));var logger=require(_0x11da('0x14'))(_0x11da('0x15'));var utils=require(_0x11da('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x11da('0x17'));var db=require(_0x11da('0x18'))['db'];config[_0x11da('0x19')]=_[_0x11da('0x1a')](config[_0x11da('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x11da('0x1b'))(new Redis(config[_0x11da('0x19')]));require(_0x11da('0x1c'))[_0x11da('0x1d')](socket);function respondWithStatusCode(_0x3aae0d,_0x58c60d){_0x58c60d=_0x58c60d||0xcc;return function(_0x1a0f47){if(_0x1a0f47){return _0x3aae0d['sendStatus'](_0x58c60d);}return _0x3aae0d[_0x11da('0x1e')](_0x58c60d)[_0x11da('0x1f')]();};}function respondWithResult(_0x278f02,_0xdcd341){_0xdcd341=_0xdcd341||0xc8;return function(_0x9ec352){if(_0x9ec352){return _0x278f02[_0x11da('0x1e')](_0xdcd341)[_0x11da('0x20')](_0x9ec352);}};}function respondWithFilteredResult(_0x2c757e,_0x3c3392){return function(_0x12fb44){if(_0x12fb44){var _0x463c3d=typeof _0x3c3392[_0x11da('0x21')]==='undefined'&&typeof _0x3c3392[_0x11da('0x22')]===_0x11da('0x23');var _0x33de25=_0x12fb44[_0x11da('0x24')];var _0x3e3140=_0x463c3d?0x0:_0x3c3392['offset'];var _0x2c0d4a=_0x463c3d?_0x12fb44[_0x11da('0x24')]:_0x3c3392[_0x11da('0x21')]+_0x3c3392['limit'];var _0x4b0f71;if(_0x2c0d4a>=_0x33de25){_0x2c0d4a=_0x33de25;_0x4b0f71=0xc8;}else{_0x4b0f71=0xce;}_0x2c757e[_0x11da('0x1e')](_0x4b0f71);return _0x2c757e[_0x11da('0x25')](_0x11da('0x26'),_0x3e3140+'-'+_0x2c0d4a+'/'+_0x33de25)['json'](_0x12fb44);}return null;};}function patchUpdates(_0x1294b3){return function(_0x4a7e5d){try{jsonpatch[_0x11da('0x27')](_0x4a7e5d,_0x1294b3,!![]);}catch(_0x3a90db){return BPromise[_0x11da('0x28')](_0x3a90db);}return _0x4a7e5d[_0x11da('0x29')]();};}function saveUpdates(_0x2b03dd,_0x700476){return function(_0x49578b){if(_0x49578b){return _0x49578b['update'](_0x2b03dd)[_0x11da('0x2a')](function(_0x3ad7b7){return _0x3ad7b7;});}return null;};}function removeEntity(_0x48908f,_0x662329){return function(_0x28adc7){if(_0x28adc7){return _0x28adc7['destroy']()[_0x11da('0x2a')](function(){_0x48908f[_0x11da('0x1e')](0xcc)[_0x11da('0x1f')]();});}};}function handleEntityNotFound(_0x1592ab,_0x1f82c7){return function(_0x5e9c07){if(!_0x5e9c07){_0x1592ab[_0x11da('0x2b')](0x194);}return _0x5e9c07;};}function handleError(_0x25b716,_0x219ac0){_0x219ac0=_0x219ac0||0x1f4;return function(_0x47aab1){logger[_0x11da('0x2c')](_0x47aab1['stack']);if(_0x47aab1['name']){delete _0x47aab1[_0x11da('0x2d')];}_0x25b716[_0x11da('0x1e')](_0x219ac0)[_0x11da('0x2e')](_0x47aab1);};}function getInteractionUsers(_0x4c66cd,_0x553814){return new BPromise(function(_0x400e36,_0x279fd1){try{if(_0x553814[_0x4c66cd['id']]){_0x4c66cd[_0x11da('0x2f')]=_[_0x11da('0x30')](_0x553814[_0x4c66cd['id']],function(_0x45d0fa){return{'id':_0x45d0fa['id'],'fullname':_0x45d0fa[_0x11da('0x31')]};});}}catch(_0x56e74d){_0x279fd1(_0x56e74d);}_0x400e36(_0x4c66cd);});}function getInteractionTags(_0x1ccd67,_0x4f58b8){return new BPromise(function(_0x5ecc20,_0x122c23){try{if(_0x1ccd67[_0x11da('0x32')]){_0x1ccd67[_0x11da('0x33')]=[];_0x1ccd67[_0x11da('0x32')][_0x11da('0x34')](',')[_0x11da('0x35')](function(_0xc968e3){_0x1ccd67['Tags'][_0x11da('0x36')](_0x4f58b8[_0xc968e3]);});}delete _0x1ccd67['TagIds'];}catch(_0x3c9fbe){_0x122c23(_0x3c9fbe);}_0x5ecc20(_0x1ccd67);});}function updateWhatsappInteraction(_0x5903d5,_0x3110b5,_0x4b440e){return new BPromise(function(_0x5e49d6,_0xfd1bca){return getInteractionUsers(_0x5903d5,_0x4b440e)[_0x11da('0x2a')](function(_0x39b1fd){return getInteractionTags(_0x39b1fd,_0x3110b5);})[_0x11da('0x2a')](function(_0xd537){_0x5e49d6(_0xd537);})[_0x11da('0x37')](function(_0x56614e){_0xfd1bca(_0x56614e);});});}exports['index']=function(_0x4187be,_0x4314ad){var _0x2bb01e={},_0x5ae0aa={},_0x58c4c9={'count':0x0,'rows':[]};var _0x387dab=_[_0x11da('0x30')](db[_0x11da('0x38')][_0x11da('0x39')],function(_0xf4699b){return{'name':_0xf4699b[_0x11da('0x3a')],'type':_0xf4699b[_0x11da('0x3b')][_0x11da('0x3c')]};});_0x5ae0aa[_0x11da('0x3d')]=_[_0x11da('0x30')](_0x387dab,_0x11da('0x2d'));_0x5ae0aa[_0x11da('0x3e')]=_[_0x11da('0x3f')](_0x4187be[_0x11da('0x3e')]);_0x5ae0aa[_0x11da('0x40')]=_['intersection'](_0x5ae0aa[_0x11da('0x3d')],_0x5ae0aa[_0x11da('0x3e')]);_0x2bb01e['attributes']=_[_0x11da('0x41')](_0x5ae0aa['model'],qs[_0x11da('0x42')](_0x4187be[_0x11da('0x3e')][_0x11da('0x42')]));_0x2bb01e['attributes']=_0x2bb01e[_0x11da('0x43')]['length']?_0x2bb01e[_0x11da('0x43')]:_0x5ae0aa[_0x11da('0x3d')];if(!_0x4187be[_0x11da('0x3e')][_0x11da('0x44')](_0x11da('0x45'))){_0x2bb01e['limit']=qs[_0x11da('0x22')](_0x4187be[_0x11da('0x3e')][_0x11da('0x22')]);_0x2bb01e[_0x11da('0x21')]=qs[_0x11da('0x21')](_0x4187be['query'][_0x11da('0x21')]);}_0x2bb01e[_0x11da('0x46')]=qs['sort'](_0x4187be['query']['sort']);_0x2bb01e[_0x11da('0x47')]=qs[_0x11da('0x40')](_['pick'](_0x4187be[_0x11da('0x3e')],_0x5ae0aa[_0x11da('0x40')]),_0x387dab);var _0x15a079=[];var _0x4ab79b=squel[_0x11da('0x48')]()[_0x11da('0x49')]('id')[_0x11da('0x49')](_0x11da('0x2d'))[_0x11da('0x49')](_0x11da('0x4a'))[_0x11da('0x4b')](_0x11da('0x4c'));var _0xeae90b=squel['select']()[_0x11da('0x49')](_0x11da('0x4d'))[_0x11da('0x49')](_0x11da('0x4e'))[_0x11da('0x49')](_0x11da('0x4f'))[_0x11da('0x4b')](_0x11da('0x50'),'ui')[_0x11da('0x51')](_0x11da('0x52'),'u',_0x11da('0x53'));var _0x5b8723=squel[_0x11da('0x48')]()[_0x11da('0x4b')](_0x11da('0x54'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x11da('0x51')]('users','o','o.id\x20=\x20i.UserId')[_0x11da('0x51')](_0x11da('0x55'),'a',_0x11da('0x56'))['left_join'](_0x11da('0x57'),'me',_0x11da('0x58'))['left_join'](_0x11da('0x59'),'it',_0x11da('0x5a'))['left_join'](_0x11da('0x4c'),'t',_0x11da('0x5b'));var _0x23c632=squel[_0x11da('0x5c')]();var _0x500353=[];var _0x1af615=squel['expr']();var _0x4af8ca;if(_0x4187be['query']['search']){_0x4af8ca=as['parseSearch'](_0x4187be[_0x11da('0x3e')][_0x11da('0x5d')]);var _0x340450=_0x4af8ca['sqlOperator'];for(var _0x105bbe=0x0;_0x105bbe<_0x4af8ca[_0x11da('0x5e')][_0x11da('0x5f')];_0x105bbe++){var _0x4633ef=_0x4af8ca['conditions'][_0x105bbe];var _0x1bfc3e='i';var _0x4254c5=_['find'](_0x387dab,[_0x11da('0x2d'),_0x4633ef[_0x11da('0x49')]]);if(!_0x4254c5){switch(_0x4633ef[_0x11da('0x49')]){case _0x11da('0x60'):if(_0x4633ef[_0x11da('0x61')]==0x1){_0x5b8723[_0x11da('0x62')]('`'+_0x4633ef[_0x11da('0x49')]+_0x11da('0x63'));}else{_0x5b8723[_0x11da('0x62')]('`'+_0x4633ef[_0x11da('0x49')]+_0x11da('0x64'));}break;case _0x11da('0x65'):if(_0x4633ef[_0x11da('0x66')]===_0x11da('0x67')){if(_0x4633ef[_0x11da('0x61')]['split']('\x20')[_0x11da('0x5f')]>0x1){_0x23c632[_0x340450](_0x11da('0x68'),qs[_0x11da('0x69')](_0x4633ef[_0x11da('0x61')]),null);}else{var _0x280962='%'+_0x4633ef[_0x11da('0x61')]+'%';_0x23c632[_0x340450](_0x11da('0x6a'),_0x280962,_0x280962,_0x280962);}}else{_0x4254c5=_['find'](_0x387dab,['name',_0x11da('0x6b')]);_0x4633ef[_0x11da('0x49')]='ContactId';_0x19fc47=as[_0x11da('0x6c')](_0x1bfc3e,_0x4254c5[_0x11da('0x3b')],_0x4633ef);_0x23c632[_0x340450](_0x19fc47[_0x11da('0x6d')],_0x19fc47['value'][_0x11da('0x6e')],_0x19fc47[_0x11da('0x61')][_0x11da('0x1f')]);}break;case'Tag':var _0x225f56=_0x4633ef[_0x11da('0x61')]['split'](',')[_0x11da('0x30')](function(_0x29769e){return Number(_0x29769e);});_0x225f56[_0x11da('0x35')](function(_0x405d65){_0x1af615['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x405d65+',%');});_0x500353=_['union'](_0x500353,_0x225f56);break;case _0x11da('0x6f'):if(_0x4633ef['operator']===_0x11da('0x67')){_0x23c632[_0x340450](_0x11da('0x70'),'%'+_0x4633ef[_0x11da('0x61')]+'%',null);}else{_0x4254c5=_[_0x11da('0x71')](_0x387dab,[_0x11da('0x2d'),_0x11da('0x72')]);_0x4633ef[_0x11da('0x49')]=_0x11da('0x72');_0x19fc47=as[_0x11da('0x6c')](_0x1bfc3e,_0x4254c5[_0x11da('0x3b')],_0x4633ef);_0x23c632[_0x340450](_0x19fc47[_0x11da('0x6d')],_0x19fc47['value']['start'],_0x19fc47['value'][_0x11da('0x1f')]);}break;case _0x11da('0x73'):_0x19fc47=as[_0x11da('0x6c')]('me',null,_0x4633ef);_0x23c632[_0x340450](_0x19fc47[_0x11da('0x6d')],_0x19fc47[_0x11da('0x61')][_0x11da('0x6e')],_0x19fc47['value'][_0x11da('0x1f')]);break;}}else{var _0x19fc47=as[_0x11da('0x6c')](_0x1bfc3e,_0x4254c5[_0x11da('0x3b')],_0x4633ef);_0x23c632[_0x340450](_0x19fc47[_0x11da('0x6d')],_0x19fc47[_0x11da('0x61')]['start'],_0x19fc47['value'][_0x11da('0x1f')]);}}}else{var _0x4a8abb=_(_0x4187be[_0x11da('0x3e')])[_0x11da('0x3f')]()['map'](function(_0x188673){return _['some'](_0x387dab,[_0x11da('0x2d'),_0x188673])?_0x188673:undefined;})[_0x11da('0x74')]()[_0x11da('0x61')]();if(!_[_0x11da('0x75')](_0x4a8abb)){_0x4a8abb[_0x11da('0x35')](function(_0x45c074){if(_0x45c074===_0x11da('0x76')){_0x5b8723[_0x11da('0x47')](_0x11da('0x77'),[][_0x11da('0x78')](_0x4187be['query'][_0x45c074]));}else if(_0x45c074==='createdAt'){var _0x54e0a0=JSON[_0x11da('0x79')](_0x4187be[_0x11da('0x3e')][_0x45c074])[_0x11da('0x7a')];var _0x4467f0=JSON['parse'](_0x4187be[_0x11da('0x3e')][_0x45c074])[_0x11da('0x7b')];_0x5b8723['where'](_0x11da('0x7c'),_0x54e0a0,_0x4467f0);}else{if(_0x4187be[_0x11da('0x3e')][_0x45c074]===_0x11da('0x7d')){_0x5b8723['where']('i.'+_0x45c074+_0x11da('0x7e'));}else{_0x5b8723[_0x11da('0x47')]('i.'+_0x45c074+'\x20=\x20?',_0x4187be[_0x11da('0x3e')][_0x45c074]);}}});}if(_0x4187be[_0x11da('0x3e')][_0x11da('0x7f')]){if(_0x4187be[_0x11da('0x3e')][_0x11da('0x7f')]==0x1){_0x5b8723[_0x11da('0x62')](_0x11da('0x80'));}else{_0x5b8723['having'](_0x11da('0x81'));}}if(_0x4187be[_0x11da('0x3e')]['tag']){_0x500353=_[_0x11da('0x82')](_0x4187be[_0x11da('0x3e')][_0x11da('0x83')])?_0x4187be[_0x11da('0x3e')]['tag']:new Array(_0x4187be[_0x11da('0x3e')][_0x11da('0x83')]);_0x500353['forEach'](function(_0x2689f3){_0x1af615['or'](_0x11da('0x84'),'%,'+_0x2689f3+',%');});}if(_0x4187be[_0x11da('0x3e')]['filter']){var _0x55f83b=_0x4187be['query'][_0x11da('0x85')]['replace']('\x5c','\x5c\x5c')[_0x11da('0x86')](/'/g,'\x27\x27');if(qs[_0x11da('0x87')](_0x55f83b)){_0x23c632['or'](_0x11da('0x88'),_0x55f83b+'%')['or'](_0x11da('0x89'),_0x55f83b+'%');}else{_0x23c632['or'](_0x11da('0x8a'),qs[_0x11da('0x69')](_0x55f83b))['or'](_0x11da('0x8b'),_0x55f83b+'%');}}}_0x5b8723[_0x11da('0x47')](_0x23c632);_0x5b8723['group'](_0x11da('0x8c'));var _0x22554c={'type':db[_0x11da('0x8d')][_0x11da('0x8e')][_0x11da('0x8f')],'raw':!![]};var _0x2c6970=_0x5b8723[_0x11da('0x90')]();_0x2c6970['field'](_0x11da('0x8c'));_0x2c6970[_0x11da('0x49')](_0x11da('0x91'),_0x11da('0x60'));if(_0x2bb01e['order']){_0x2bb01e[_0x11da('0x46')][_0x11da('0x35')](function(_0x4c0872){var _0x1693d7=_0x4c0872[0x0]===_0x11da('0x92')?_0x4c0872[0x0]:'i.'+_0x4c0872[0x0];_0x5b8723[_0x11da('0x46')](_0x1693d7,_0x4c0872[0x1]===_0x11da('0x93')?![]:!![]);});}if(!_[_0x11da('0x75')](_0x500353)){_0x5b8723[_0x11da('0x62')](_0x1af615);_0x2c6970[_0x11da('0x47')](_0x11da('0x94'),_0x500353);}BPromise[_0x11da('0x95')]()[_0x11da('0x2a')](function(){if(!_0x4af8ca){if(_0x4187be['query'][_0x11da('0x76')])return;_0x2c6970[_0x11da('0x47')](_0x11da('0x96'));_0x5b8723[_0x11da('0x47')](_0x11da('0x96'));return;}if(_0x4187be[_0x11da('0x97')][_0x11da('0x98')]!==_0x11da('0x99'))return;return _0x4187be[_0x11da('0x97')][_0x11da('0x9a')]({'attributes':['id'],'raw':!![]})[_0x11da('0x2a')](function(_0x3552f5){if(_[_0x11da('0x75')](_0x3552f5)){_0x2c6970[_0x11da('0x47')]('i.WhatsappAccountId\x20IS\x20NULL');_0x5b8723[_0x11da('0x47')](_0x11da('0x9b'));}else{_0x2c6970['where'](_0x11da('0x77'),_[_0x11da('0x30')](_0x3552f5,'id'));_0x5b8723['where'](_0x11da('0x77'),_['map'](_0x3552f5,'id'));}});})[_0x11da('0x2a')](function(){if(_0x4187be['user']['role']==='agent'&&!_0x4af8ca&&!_0x4187be[_0x11da('0x3e')][_0x11da('0x76')])return[];return db['sequelize'][_0x11da('0x3e')](_0x2c6970[_0x11da('0x9c')](),_0x22554c);})['then'](function(_0x3549ad){_0x58c4c9[_0x11da('0x24')]=_0x3549ad[_0x11da('0x5f')];if(_0x58c4c9[_0x11da('0x24')]===0x0)return[];return db[_0x11da('0x9d')]['query'](_0x4ab79b[_0x11da('0x9c')](),_0x22554c)[_0x11da('0x2a')](function(_0x5924e7){_0x15a079=_[_0x11da('0x9e')](_0x5924e7,'id');_0x22554c=_['merge'](_0x22554c,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4187be[_0x11da('0x3e')][_0x11da('0x42')]){_0x2bb01e[_0x11da('0x43')][_0x11da('0x35')](function(_0x58c179){_0x5b8723[_0x11da('0x49')]('i.'+_0x58c179);});}else{_0x5b8723[_0x11da('0x49')](_0x11da('0x91'),_0x11da('0x60'));_0x5b8723[_0x11da('0x49')](_0x11da('0x9f'),'Account.key');_0x5b8723[_0x11da('0x49')](_0x11da('0xa0'),_0x11da('0xa1'));_0x5b8723[_0x11da('0x49')](_0x11da('0xa2'),_0x11da('0x92'));_0x5b8723['field']('i.*');_0x5b8723[_0x11da('0x49')](_0x11da('0xa3'),'Contact.firstName');_0x5b8723[_0x11da('0x49')](_0x11da('0xa4'),_0x11da('0xa5'));_0x5b8723[_0x11da('0x49')](_0x11da('0xa6'),_0x11da('0xa7'));_0x5b8723[_0x11da('0x49')](_0x11da('0xa8'),'Contact.phone');_0x5b8723[_0x11da('0x49')](_0x11da('0xa9'),_0x11da('0xaa'));_0x5b8723[_0x11da('0x49')](_0x11da('0xab'),_0x11da('0xac'));_0x5b8723[_0x11da('0x49')](_0x11da('0xad'),_0x11da('0xae'));_0x5b8723[_0x11da('0x49')](_0x11da('0xaf'),_0x11da('0xb0'));_0x5b8723[_0x11da('0x49')](_0x11da('0xb1'),'TagIds');}if(_0x2bb01e[_0x11da('0x22')])_0x5b8723[_0x11da('0x22')](_0x2bb01e[_0x11da('0x22')]);if(_0x2bb01e[_0x11da('0x21')])_0x5b8723[_0x11da('0x21')](_0x2bb01e[_0x11da('0x21')]);return db[_0x11da('0x9d')]['query'](_0x5b8723[_0x11da('0x9c')](),_0x22554c);})[_0x11da('0x2a')](function(_0x2d4728){if(_0x2d4728['length']>0x0)_0xeae90b[_0x11da('0x47')](_0x11da('0xb2'),_[_0x11da('0x30')](_0x2d4728,'id'));return db['sequelize']['query'](_0xeae90b[_0x11da('0x9c')](),_0x22554c)[_0x11da('0x2a')](function(_0x389d1b){var _0x15c577=_['groupBy'](_0x389d1b,_0x11da('0xb3'));var _0x2d9f98=[];_0x2d4728[_0x11da('0x35')](function(_0x31e220){_0x2d9f98[_0x11da('0x36')](updateWhatsappInteraction(_0x31e220,_0x15a079,_0x15c577));});return BPromise[_0x11da('0xb4')](_0x2d9f98);});});})[_0x11da('0x2a')](function(_0x5dc264){_0x58c4c9[_0x11da('0xb5')]=_0x5dc264;return _0x58c4c9;})[_0x11da('0x2a')](respondWithFilteredResult(_0x4314ad,_0x2bb01e))[_0x11da('0x37')](handleError(_0x4314ad,null));};exports[_0x11da('0xb6')]=function(_0x82bdfc,_0x51d42b){var _0x4f2513={'raw':![],'where':{'id':_0x82bdfc[_0x11da('0xb7')]['id']}},_0x3009b4={};_0x3009b4['model']=_[_0x11da('0x3f')](db[_0x11da('0x38')]['rawAttributes']);_0x3009b4['query']=_['keys'](_0x82bdfc[_0x11da('0x3e')]);_0x3009b4[_0x11da('0x40')]=_['intersection'](_0x3009b4['model'],_0x3009b4[_0x11da('0x3e')]);_0x4f2513['attributes']=_[_0x11da('0x41')](_0x3009b4[_0x11da('0x3d')],qs[_0x11da('0x42')](_0x82bdfc[_0x11da('0x3e')][_0x11da('0x42')]));_0x4f2513[_0x11da('0x43')]=_0x4f2513[_0x11da('0x43')][_0x11da('0x5f')]?_0x4f2513[_0x11da('0x43')]:_0x3009b4[_0x11da('0x3d')];if(_0x82bdfc['query']['includeAll']){_0x4f2513[_0x11da('0xb8')]=[{'all':!![]}];}_0x4f2513=_['merge']({},_0x4f2513,_0x82bdfc[_0x11da('0xb9')]);return db[_0x11da('0x38')][_0x11da('0x71')](_0x4f2513)[_0x11da('0x2a')](handleEntityNotFound(_0x51d42b,null))[_0x11da('0x2a')](respondWithResult(_0x51d42b,null))['catch'](handleError(_0x51d42b,null));};exports[_0x11da('0xba')]=function(_0x326bae,_0x553519){return db[_0x11da('0x38')][_0x11da('0xba')](_0x326bae['body'],{})['then'](respondWithResult(_0x553519,0xc9))[_0x11da('0x37')](handleError(_0x553519,null));};exports['update']=function(_0x47dafb,_0x2c586b){if(_0x47dafb[_0x11da('0x73')]['id']){delete _0x47dafb[_0x11da('0x73')]['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x47dafb['params']['id']}})[_0x11da('0x2a')](handleEntityNotFound(_0x2c586b,null))['then'](saveUpdates(_0x47dafb[_0x11da('0x73')],null))[_0x11da('0x2a')](respondWithResult(_0x2c586b,null))[_0x11da('0x37')](handleError(_0x2c586b,null));};exports['destroy']=function(_0x9be40f,_0x44c52b){return db[_0x11da('0x38')][_0x11da('0x71')]({'where':{'id':_0x9be40f[_0x11da('0xb7')]['id']}})[_0x11da('0x2a')](handleEntityNotFound(_0x44c52b,null))['then'](removeEntity(_0x44c52b,null))[_0x11da('0x37')](handleError(_0x44c52b,null));};exports[_0x11da('0xbb')]=function(_0x34bde7,_0x4d1cd7){return db[_0x11da('0x38')][_0x11da('0xbb')]()[_0x11da('0x2a')](respondWithResult(_0x4d1cd7,null))[_0x11da('0x37')](handleError(_0x4d1cd7,null));};exports[_0x11da('0xbc')]=function(_0xec0a5f,_0xb25edf,_0xb60b48){return db[_0x11da('0xbd')][_0x11da('0x71')]({'where':{'id':_0xec0a5f[_0x11da('0xb7')]['id']}})['then'](handleEntityNotFound(_0xb25edf,null))[_0x11da('0x2a')](function(_0xf27dc3){if(_0xf27dc3){return _0xf27dc3[_0x11da('0xbc')](_0xec0a5f['body']['ids'],_[_0x11da('0xbe')](_0xec0a5f[_0x11da('0x73')],[_0x11da('0xbf'),'id'])||{});}})['then'](respondWithResult(_0xb25edf,null))['catch'](handleError(_0xb25edf,null));};exports['getMessages']=function(_0x3e6fa2,_0x583d1e,_0x3087ac){var _0x1fa988={'raw':![],'where':{}};var _0x99c02e={};var _0x3ee8da={'count':0x0,'rows':[]};return db[_0x11da('0x38')]['findOne']({'where':{'id':_0x3e6fa2[_0x11da('0xb7')]['id']}})[_0x11da('0x2a')](handleEntityNotFound(_0x583d1e,null))[_0x11da('0x2a')](function(_0x4b0e01){if(_0x4b0e01){_0x99c02e[_0x11da('0x3d')]=_['keys'](db[_0x11da('0xbd')]['rawAttributes']);_0x99c02e[_0x11da('0x3e')]=_['keys'](_0x3e6fa2[_0x11da('0x3e')]);_0x99c02e[_0x11da('0x40')]=_[_0x11da('0x41')](_0x99c02e[_0x11da('0x3d')],_0x99c02e['query']);_0x1fa988[_0x11da('0x43')]=_[_0x11da('0x41')](_0x99c02e['model'],qs[_0x11da('0x42')](_0x3e6fa2[_0x11da('0x3e')]['fields']));_0x1fa988[_0x11da('0x43')]=_0x1fa988[_0x11da('0x43')]['length']?_0x1fa988[_0x11da('0x43')]:_0x99c02e[_0x11da('0x3d')];if(!_0x3e6fa2[_0x11da('0x3e')][_0x11da('0x44')](_0x11da('0x45'))){_0x1fa988[_0x11da('0x22')]=qs['limit'](_0x3e6fa2[_0x11da('0x3e')][_0x11da('0x22')]);_0x1fa988['offset']=qs[_0x11da('0x21')](_0x3e6fa2[_0x11da('0x3e')]['offset']);}_0x1fa988[_0x11da('0x46')]=qs[_0x11da('0xc0')](_0x3e6fa2[_0x11da('0x3e')][_0x11da('0xc0')]);_0x1fa988[_0x11da('0x47')]=qs[_0x11da('0x40')](_[_0x11da('0xc1')](_0x3e6fa2[_0x11da('0x3e')],_0x99c02e[_0x11da('0x40')]));_0x1fa988['where'][_0x11da('0xb3')]=_0x4b0e01['id'];if(_0x3e6fa2[_0x11da('0x3e')]['filter']){_0x1fa988['where']=_[_0x11da('0xc2')](_0x1fa988[_0x11da('0x47')],{'$or':_['map'](_0x1fa988[_0x11da('0x43')],function(_0x5b6453){var _0x47849c={};_0x47849c[_0x5b6453]={'$like':'%'+_0x3e6fa2['query'][_0x11da('0x85')]+'%'};return _0x47849c;})});}if(_0x3e6fa2[_0x11da('0x3e')][_0x11da('0x7a')]){var _0x578872=_0x3e6fa2['query'][_0x11da('0x7a')][_0x11da('0x34')](',');var _0x5cb2cb={};_0x5cb2cb[_0x578872[0x0]]={'$gte':moment(_0x578872[0x1])[_0x11da('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1fa988[_0x11da('0x47')]=_['merge'](_0x1fa988[_0x11da('0x47')],_0x5cb2cb);}_0x1fa988=_[_0x11da('0xc2')]({},_0x1fa988,_0x3e6fa2[_0x11da('0xb9')]);return db[_0x11da('0xbd')]['count']({'where':_0x1fa988[_0x11da('0x47')]})['then'](function(_0x512d16){_0x3ee8da[_0x11da('0x24')]=_0x512d16;if(_0x3e6fa2['query'][_0x11da('0xc4')]){_0x1fa988[_0x11da('0xb8')]=[{'all':!![]}];}return db[_0x11da('0xbd')]['findAll'](_0x1fa988);})[_0x11da('0x2a')](function(_0x56e381){_0x3ee8da[_0x11da('0xb5')]=_0x56e381;return _0x3ee8da;});}})[_0x11da('0x2a')](respondWithFilteredResult(_0x583d1e,_0x1fa988))[_0x11da('0x37')](handleError(_0x583d1e,null));};exports[_0x11da('0xc5')]=function(_0x2c15e0,_0x3dd8c4,_0xcc6f56){return db[_0x11da('0x38')]['find']({'where':{'id':_0x2c15e0[_0x11da('0xb7')]['id']}})[_0x11da('0x2a')](handleEntityNotFound(_0x3dd8c4,null))[_0x11da('0x2a')](function(_0x16be79){if(_0x16be79){return _0x16be79[_0x11da('0xc6')](_0x2c15e0['body'][_0x11da('0xbf')],_[_0x11da('0xbe')](_0x2c15e0[_0x11da('0x73')],[_0x11da('0xbf'),'id'])||{})[_0x11da('0xc7')](function(){return db['Tag'][_0x11da('0xc8')]({'attributes':['id','name',_0x11da('0x4a')],'where':{'id':_0x2c15e0[_0x11da('0x73')]['ids']}});})[_0x11da('0x2a')](function(_0x2d56bd){socket[_0x11da('0xc9')](_0x11da('0xca'),{'id':Number(_0x2c15e0[_0x11da('0xb7')]['id']),'tags':_0x2d56bd||[]});return{'id':Number(_0x2c15e0[_0x11da('0xb7')]['id']),'tags':_0x2d56bd||[]};});}})[_0x11da('0x2a')](respondWithResult(_0x3dd8c4,null))[_0x11da('0x37')](handleError(_0x3dd8c4,null));};exports[_0x11da('0xcb')]=function(_0x447a7b,_0x187c4e,_0x1f0ae6){return db['WhatsappInteraction']['find']({'where':{'id':_0x447a7b['params']['id']}})['then'](handleEntityNotFound(_0x187c4e,null))[_0x11da('0x2a')](function(_0x15196c){if(_0x15196c){return _0x15196c[_0x11da('0xcb')](_0x447a7b[_0x11da('0x3e')][_0x11da('0xbf')]);}})[_0x11da('0x2a')](respondWithStatusCode(_0x187c4e,null))['catch'](handleError(_0x187c4e,null));};exports[_0x11da('0xcc')]=function(_0x358b3e,_0x17e20e){var _0x8badc3=moment()[_0x11da('0xcd')]()[_0x11da('0x9c')]();var _0x1f92ff=path[_0x11da('0xce')](config[_0x11da('0xcf')],_0x11da('0xd0'),'files',_0x11da('0xd1'));var _0x4be924=path['join'](config[_0x11da('0xcf')],'server','files',_0x11da('0xd2'));var _0x1e7316=path['join'](_0x1f92ff,_0x8badc3);var _0x1a5a8a=util[_0x11da('0xc3')](_0x11da('0xd3'),_0x358b3e[_0x11da('0xb7')]['id'],_0x8badc3);var _0x369b51=path['join'](_0x1f92ff,_0x1a5a8a);var _0x1f42a1=[];_0x1f42a1['push']({'model':db[_0x11da('0x6f')],'as':_0x11da('0x6f'),'attributes':['id',_0x11da('0x31')],'raw':!![]});_0x1f42a1['push']({'model':db[_0x11da('0xd4')],'as':_0x11da('0x65'),'attributes':['id',_0x11da('0xd5'),_0x11da('0xd6')],'raw':!![]});if(_0x358b3e[_0x11da('0x3e')][_0x11da('0xd2')]){_0x1f42a1[_0x11da('0x36')]({'model':db[_0x11da('0xd7')],'as':_0x11da('0xd7'),'raw':!![]});}var _0x543238=[{'model':db[_0x11da('0xbd')],'as':'Messages','attributes':['id',_0x11da('0x73'),_0x11da('0xd8'),_0x11da('0xd9'),_0x11da('0xda'),_0x11da('0x7f')],'include':_0x1f42a1}];_0x543238['push']({'model':db[_0x11da('0xdb')],'as':'Account','attributes':['id',_0x11da('0x2d')]});_0x543238['push']({'model':db[_0x11da('0x6f')],'as':_0x11da('0xdc'),'attributes':['id',_0x11da('0x31')]});return db[_0x11da('0x38')][_0x11da('0x71')]({'where':{'id':_0x358b3e[_0x11da('0xb7')]['id']},'include':_0x543238})[_0x11da('0x2a')](handleEntityNotFound(_0x17e20e,null))[_0x11da('0x2a')](function(_0x58f6fd){if(_0x58f6fd){var _0x5b051c=_0x58f6fd[_0x11da('0xdd')]({'plain':!![]});fs[_0x11da('0xde')](_0x1e7316);var _0x3120b1={'channel':'Whatsapp','account':_0x5b051c[_0x11da('0xdf')][_0x11da('0x2d')],'agent':_0x5b051c[_0x11da('0xdc')]?_0x5b051c[_0x11da('0xdc')]['fullname']:_0x11da('0xe0'),'createdAt':moment(_0x5b051c[_0x11da('0xd8')])[_0x11da('0xc3')](_0x11da('0xe1'))[_0x11da('0x9c')](),'closedAt':_0x5b051c[_0x11da('0xe2')]?moment(_0x5b051c['closedAt'])[_0x11da('0xc3')](_0x11da('0xe1'))[_0x11da('0x9c')]():'','disposition':_0x5b051c[_0x11da('0xe3')],'messages':_(_0x5b051c[_0x11da('0xe4')])[_0x11da('0x85')]({'secret':![]})[_0x11da('0x30')](function(_0x1ca322){if(_0x1ca322[_0x11da('0xd7')]){var _0x22e59e=path[_0x11da('0xce')](_0x4be924,_0x1ca322[_0x11da('0xd7')][_0x11da('0xe5')]);if(fs[_0x11da('0xe6')](_0x22e59e)){fs[_0x11da('0xe7')](_0x22e59e)['pipe'](fs[_0x11da('0xe8')](path['join'](_0x1e7316,_0x1ca322[_0x11da('0xd7')][_0x11da('0xe5')])));}}return{'date':moment(_0x1ca322['createdAt'])[_0x11da('0xc3')](_0x11da('0xe1'))['toString'](),'sender':_0x1ca322['direction']===_0x11da('0xe9')?_0x1ca322[_0x11da('0x6f')]?_0x1ca322[_0x11da('0x6f')][_0x11da('0x31')]:'System':_0x1ca322[_0x11da('0x65')][_0x11da('0xd5')]+(_0x1ca322['Contact'][_0x11da('0xd6')]?'\x20'+_0x1ca322[_0x11da('0x65')]['lastName']:''),'body':_0x1ca322[_0x11da('0xd7')]?_0x1ca322['Attachment'][_0x11da('0xe5')]:_0x1ca322['body'],'direction':_0x1ca322[_0x11da('0xd9')]===_0x11da('0xe9')?'A':'C','secret':_0x1ca322[_0x11da('0xda')],'read':_0x1ca322[_0x11da('0x7f')],'attachment':_0x1ca322[_0x11da('0xd7')]};})[_0x11da('0x61')]()};return ejs['renderFile'](path[_0x11da('0xce')](config[_0x11da('0xcf')],_0x11da('0xd0'),'views',_0x11da('0xea')),{'interaction':_0x3120b1})['then'](function(_0x33e9eb){var _0x15fc84=path[_0x11da('0xce')](_0x1e7316,_0x11da('0xeb')+_0x5b051c['id']+'-'+_0x8badc3+_0x11da('0xec'));var _0xa70d66={'path':_0x15fc84,'channel':_0x11da('0xed'),'interactionId':_0x5b051c['id']};return pdf[_0x11da('0xee')](_0x33e9eb,_0xa70d66);})['then'](function(){return new BPromise(function(_0x3a580c,_0x28a120){zipdir(_0x1e7316,{'saveTo':_0x369b51},function(_0x1a0150,_0x57bca5){if(_0x1a0150)return _0x28a120(_0x1a0150);return _0x3a580c(_0x57bca5);});})[_0x11da('0x2a')](function(){return new BPromise(function(_0x53d6a1,_0x3afaf8){rimraf(_0x1e7316,function(_0x54bdc9){if(_0x54bdc9)_0x3afaf8(_0x54bdc9);return _0x53d6a1();});});})[_0x11da('0x2a')](function(){return _0x17e20e[_0x11da('0xcc')](_0x369b51,_0x1a5a8a,function(_0x584bef){if(_0x584bef){console[_0x11da('0xef')](_0x11da('0xf0'),_0x584bef);}else{fs[_0x11da('0xf1')](_0x369b51);}});});});}else{return _0x17e20e[_0x11da('0x2b')](0xc8);}})['catch'](handleError(_0x17e20e,null));}; \ No newline at end of file +var _0x3ae9=['crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','end','error','stack','name','Users','fullname','TagIds','split','forEach','Tags','push','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','select','field','from','tools_tags','u.fullname','ui.WhatsappInteractionId','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','o.id\x20=\x20i.UserId','whatsapp_accounts','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','Account.key','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.email','Contact.phone','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','rows','catch','show','params','include','options','create','destroy','describe','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','nolimit','WhatsappInteractionId','format','findAll','addTags','setTags','spread','color','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','createdAt','direction','WhatsappAccount','Account','Owner','get','Whatsapp','N.A.','closedAt','disposition','basename','pipe','createWriteStream','YYYY-MM-DD\x20HH:mm:ss','System','out','secret','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel'];(function(_0x612a71,_0xb27d3f){var _0xb07bc1=function(_0x41b70b){while(--_0x41b70b){_0x612a71['push'](_0x612a71['shift']());}};_0xb07bc1(++_0xb27d3f);}(_0x3ae9,0xdb));var _0x93ae=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x3ae9[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x93ae('0x0'));var jsonpatch=require(_0x93ae('0x1'));var rp=require(_0x93ae('0x2'));var moment=require('moment');var BPromise=require(_0x93ae('0x3'));var Mustache=require(_0x93ae('0x4'));var util=require(_0x93ae('0x5'));var path=require(_0x93ae('0x6'));var sox=require('sox');var csv=require(_0x93ae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93ae('0x8'));var _=require(_0x93ae('0x9'));var squel=require(_0x93ae('0xa'));var crypto=require(_0x93ae('0xb'));var jsforce=require(_0x93ae('0xc'));var deskjs=require(_0x93ae('0xd'));var toCsv=require('to-csv');var querystring=require(_0x93ae('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x93ae('0xf'));var as=require(_0x93ae('0x10'));var pdf=require(_0x93ae('0x11'));var hardwareService=require(_0x93ae('0x12'));var logger=require(_0x93ae('0x13'))(_0x93ae('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x93ae('0x15'));var db=require(_0x93ae('0x16'))['db'];config['redis']=_['defaults'](config[_0x93ae('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x93ae('0x18'))(new Redis(config[_0x93ae('0x17')]));require('./whatsappInteraction.socket')[_0x93ae('0x19')](socket);function respondWithStatusCode(_0x7f8662,_0x3c38b9){_0x3c38b9=_0x3c38b9||0xcc;return function(_0x1f8aa2){if(_0x1f8aa2){return _0x7f8662[_0x93ae('0x1a')](_0x3c38b9);}return _0x7f8662[_0x93ae('0x1b')](_0x3c38b9)['end']();};}function respondWithResult(_0x11a9ce,_0x282094){_0x282094=_0x282094||0xc8;return function(_0x129e44){if(_0x129e44){return _0x11a9ce['status'](_0x282094)[_0x93ae('0x1c')](_0x129e44);}};}function respondWithFilteredResult(_0x514a0c,_0x54cfd0){return function(_0x1002b6){if(_0x1002b6){var _0x51c77d=typeof _0x54cfd0[_0x93ae('0x1d')]===_0x93ae('0x1e')&&typeof _0x54cfd0['limit']===_0x93ae('0x1e');var _0x31a8da=_0x1002b6[_0x93ae('0x1f')];var _0x586a0=_0x51c77d?0x0:_0x54cfd0['offset'];var _0x128913=_0x51c77d?_0x1002b6[_0x93ae('0x1f')]:_0x54cfd0['offset']+_0x54cfd0[_0x93ae('0x20')];var _0x28d6fa;if(_0x128913>=_0x31a8da){_0x128913=_0x31a8da;_0x28d6fa=0xc8;}else{_0x28d6fa=0xce;}_0x514a0c[_0x93ae('0x1b')](_0x28d6fa);return _0x514a0c[_0x93ae('0x21')](_0x93ae('0x22'),_0x586a0+'-'+_0x128913+'/'+_0x31a8da)[_0x93ae('0x1c')](_0x1002b6);}return null;};}function patchUpdates(_0xcdd84f){return function(_0x499b50){try{jsonpatch['apply'](_0x499b50,_0xcdd84f,!![]);}catch(_0xd33af5){return BPromise[_0x93ae('0x23')](_0xd33af5);}return _0x499b50['save']();};}function saveUpdates(_0x4d0c48,_0x18ffeb){return function(_0x367c0f){if(_0x367c0f){return _0x367c0f[_0x93ae('0x24')](_0x4d0c48)[_0x93ae('0x25')](function(_0x1abea7){return _0x1abea7;});}return null;};}function removeEntity(_0xe17086,_0x1970f4){return function(_0x32ddca){if(_0x32ddca){return _0x32ddca['destroy']()['then'](function(){_0xe17086['status'](0xcc)[_0x93ae('0x26')]();});}};}function handleEntityNotFound(_0x29e4e7,_0x2dada4){return function(_0xf7f15b){if(!_0xf7f15b){_0x29e4e7[_0x93ae('0x1a')](0x194);}return _0xf7f15b;};}function handleError(_0x17fab9,_0x520d6d){_0x520d6d=_0x520d6d||0x1f4;return function(_0x54a37b){logger[_0x93ae('0x27')](_0x54a37b[_0x93ae('0x28')]);if(_0x54a37b[_0x93ae('0x29')]){delete _0x54a37b[_0x93ae('0x29')];}_0x17fab9['status'](_0x520d6d)['send'](_0x54a37b);};}function getInteractionUsers(_0x554318,_0x19aaaa){return new BPromise(function(_0x512d8f,_0x4436f3){try{if(_0x19aaaa[_0x554318['id']]){_0x554318[_0x93ae('0x2a')]=_['map'](_0x19aaaa[_0x554318['id']],function(_0x4369c2){return{'id':_0x4369c2['id'],'fullname':_0x4369c2[_0x93ae('0x2b')]};});}}catch(_0x11359d){_0x4436f3(_0x11359d);}_0x512d8f(_0x554318);});}function getInteractionTags(_0x369ac2,_0x346719){return new BPromise(function(_0x153385,_0x43fe58){try{if(_0x369ac2[_0x93ae('0x2c')]){_0x369ac2['Tags']=[];_0x369ac2[_0x93ae('0x2c')][_0x93ae('0x2d')](',')[_0x93ae('0x2e')](function(_0x1a8344){_0x369ac2[_0x93ae('0x2f')][_0x93ae('0x30')](_0x346719[_0x1a8344]);});}delete _0x369ac2[_0x93ae('0x2c')];}catch(_0x19773f){_0x43fe58(_0x19773f);}_0x153385(_0x369ac2);});}function updateWhatsappInteraction(_0x53be22,_0x1a72d3,_0x47ae45){return new BPromise(function(_0x3daec6,_0x116330){return getInteractionUsers(_0x53be22,_0x47ae45)[_0x93ae('0x25')](function(_0x4022f2){return getInteractionTags(_0x4022f2,_0x1a72d3);})[_0x93ae('0x25')](function(_0x46ade5){_0x3daec6(_0x46ade5);})['catch'](function(_0x1b9777){_0x116330(_0x1b9777);});});}exports[_0x93ae('0x31')]=function(_0x2aa4ae,_0x4fab04){var _0x4161f2={},_0x88d255={},_0x15e6af={'count':0x0,'rows':[]};var _0x4d4712=_['map'](db[_0x93ae('0x32')][_0x93ae('0x33')],function(_0x31e9b0){return{'name':_0x31e9b0[_0x93ae('0x34')],'type':_0x31e9b0[_0x93ae('0x35')][_0x93ae('0x36')]};});_0x88d255[_0x93ae('0x37')]=_[_0x93ae('0x38')](_0x4d4712,_0x93ae('0x29'));_0x88d255[_0x93ae('0x39')]=_[_0x93ae('0x3a')](_0x2aa4ae[_0x93ae('0x39')]);_0x88d255[_0x93ae('0x3b')]=_[_0x93ae('0x3c')](_0x88d255['model'],_0x88d255[_0x93ae('0x39')]);_0x4161f2[_0x93ae('0x3d')]=_['intersection'](_0x88d255[_0x93ae('0x37')],qs['fields'](_0x2aa4ae['query'][_0x93ae('0x3e')]));_0x4161f2['attributes']=_0x4161f2[_0x93ae('0x3d')][_0x93ae('0x3f')]?_0x4161f2[_0x93ae('0x3d')]:_0x88d255[_0x93ae('0x37')];if(!_0x2aa4ae[_0x93ae('0x39')][_0x93ae('0x40')]('nolimit')){_0x4161f2[_0x93ae('0x20')]=qs[_0x93ae('0x20')](_0x2aa4ae[_0x93ae('0x39')][_0x93ae('0x20')]);_0x4161f2[_0x93ae('0x1d')]=qs[_0x93ae('0x1d')](_0x2aa4ae[_0x93ae('0x39')][_0x93ae('0x1d')]);}_0x4161f2[_0x93ae('0x41')]=qs[_0x93ae('0x42')](_0x2aa4ae[_0x93ae('0x39')]['sort']);_0x4161f2[_0x93ae('0x43')]=qs[_0x93ae('0x3b')](_['pick'](_0x2aa4ae['query'],_0x88d255[_0x93ae('0x3b')]),_0x4d4712);var _0x2b04d6=[];var _0x1cbc76=squel[_0x93ae('0x44')]()[_0x93ae('0x45')]('id')[_0x93ae('0x45')](_0x93ae('0x29'))[_0x93ae('0x45')]('color')[_0x93ae('0x46')](_0x93ae('0x47'));var _0x3701b4=squel[_0x93ae('0x44')]()[_0x93ae('0x45')]('u.id')['field'](_0x93ae('0x48'))['field'](_0x93ae('0x49'))['from']('user_has_whatsapp_interactions','ui')[_0x93ae('0x4a')](_0x93ae('0x4b'),'u',_0x93ae('0x4c'));var _0x33a1df=squel[_0x93ae('0x44')]()[_0x93ae('0x46')](_0x93ae('0x4d'),'i')['left_join'](_0x93ae('0x4e'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x93ae('0x4b'),'o',_0x93ae('0x4f'))[_0x93ae('0x4a')](_0x93ae('0x50'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x93ae('0x4a')]('whatsapp_messages','me',_0x93ae('0x51'))[_0x93ae('0x4a')](_0x93ae('0x52'),'it',_0x93ae('0x53'))[_0x93ae('0x4a')](_0x93ae('0x47'),'t',_0x93ae('0x54'));var _0x411ec6=squel[_0x93ae('0x55')]();var _0x5065ed=[];var _0x47d3c3=squel['expr']();var _0x4ddece;if(_0x2aa4ae['query'][_0x93ae('0x56')]){_0x4ddece=as[_0x93ae('0x57')](_0x2aa4ae[_0x93ae('0x39')][_0x93ae('0x56')]);var _0x490bea=_0x4ddece[_0x93ae('0x58')];for(var _0x487f79=0x0;_0x487f79<_0x4ddece[_0x93ae('0x59')][_0x93ae('0x3f')];_0x487f79++){var _0x3553d3=_0x4ddece[_0x93ae('0x59')][_0x487f79];var _0x4732bd='i';var _0xd4479a=_[_0x93ae('0x5a')](_0x4d4712,[_0x93ae('0x29'),_0x3553d3[_0x93ae('0x45')]]);if(!_0xd4479a){switch(_0x3553d3['field']){case _0x93ae('0x5b'):if(_0x3553d3['value']==0x1){_0x33a1df[_0x93ae('0x5c')]('`'+_0x3553d3[_0x93ae('0x45')]+_0x93ae('0x5d'));}else{_0x33a1df[_0x93ae('0x5c')]('`'+_0x3553d3[_0x93ae('0x45')]+_0x93ae('0x5e'));}break;case _0x93ae('0x5f'):if(_0x3553d3['operator']===_0x93ae('0x60')){if(_0x3553d3['value']['split']('\x20')[_0x93ae('0x3f')]>0x1){_0x411ec6[_0x490bea](_0x93ae('0x61'),qs['getFullTextValue'](_0x3553d3[_0x93ae('0x62')]),null);}else{var _0x7fac87='%'+_0x3553d3[_0x93ae('0x62')]+'%';_0x411ec6[_0x490bea](_0x93ae('0x63'),_0x7fac87,_0x7fac87,_0x7fac87);}}else{_0xd4479a=_[_0x93ae('0x5a')](_0x4d4712,[_0x93ae('0x29'),_0x93ae('0x64')]);_0x3553d3[_0x93ae('0x45')]=_0x93ae('0x64');_0x33b178=as[_0x93ae('0x65')](_0x4732bd,_0xd4479a[_0x93ae('0x35')],_0x3553d3);_0x411ec6[_0x490bea](_0x33b178['text'],_0x33b178[_0x93ae('0x62')][_0x93ae('0x66')],_0x33b178[_0x93ae('0x62')][_0x93ae('0x26')]);}break;case _0x93ae('0x67'):var _0x1ffa1e=_0x3553d3['value'][_0x93ae('0x2d')](',')[_0x93ae('0x38')](function(_0x1da97c){return Number(_0x1da97c);});_0x1ffa1e[_0x93ae('0x2e')](function(_0x34533c){_0x47d3c3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x34533c+',%');});_0x5065ed=_[_0x93ae('0x68')](_0x5065ed,_0x1ffa1e);break;case _0x93ae('0x69'):if(_0x3553d3[_0x93ae('0x6a')]==='$substring'){_0x411ec6[_0x490bea](_0x93ae('0x6b'),'%'+_0x3553d3[_0x93ae('0x62')]+'%',null);}else{_0xd4479a=_['find'](_0x4d4712,[_0x93ae('0x29'),_0x93ae('0x6c')]);_0x3553d3[_0x93ae('0x45')]=_0x93ae('0x6c');_0x33b178=as[_0x93ae('0x65')](_0x4732bd,_0xd4479a[_0x93ae('0x35')],_0x3553d3);_0x411ec6[_0x490bea](_0x33b178[_0x93ae('0x6d')],_0x33b178['value'][_0x93ae('0x66')],_0x33b178['value']['end']);}break;case _0x93ae('0x6e'):_0x33b178=as[_0x93ae('0x65')]('me',null,_0x3553d3);_0x411ec6[_0x490bea](_0x33b178['text'],_0x33b178[_0x93ae('0x62')][_0x93ae('0x66')],_0x33b178[_0x93ae('0x62')][_0x93ae('0x26')]);break;}}else{var _0x33b178=as[_0x93ae('0x65')](_0x4732bd,_0xd4479a[_0x93ae('0x35')],_0x3553d3);_0x411ec6[_0x490bea](_0x33b178[_0x93ae('0x6d')],_0x33b178[_0x93ae('0x62')]['start'],_0x33b178['value'][_0x93ae('0x26')]);}}}else{var _0xb656c9=_(_0x2aa4ae[_0x93ae('0x39')])[_0x93ae('0x3a')]()[_0x93ae('0x38')](function(_0x20f2af){return _[_0x93ae('0x6f')](_0x4d4712,['name',_0x20f2af])?_0x20f2af:undefined;})['compact']()[_0x93ae('0x62')]();if(!_[_0x93ae('0x70')](_0xb656c9)){_0xb656c9[_0x93ae('0x2e')](function(_0x3dd412){if(_0x3dd412===_0x93ae('0x71')){_0x33a1df[_0x93ae('0x43')](_0x93ae('0x72'),[][_0x93ae('0x73')](_0x2aa4ae[_0x93ae('0x39')][_0x3dd412]));}else if(_0x3dd412==='createdAt'){var _0x30ed4a=JSON['parse'](_0x2aa4ae['query'][_0x3dd412])[_0x93ae('0x74')];var _0x16e00c=JSON[_0x93ae('0x75')](_0x2aa4ae[_0x93ae('0x39')][_0x3dd412])[_0x93ae('0x76')];_0x33a1df[_0x93ae('0x43')](_0x93ae('0x77'),_0x30ed4a,_0x16e00c);}else{if(_0x2aa4ae[_0x93ae('0x39')][_0x3dd412]===_0x93ae('0x78')){_0x33a1df[_0x93ae('0x43')]('i.'+_0x3dd412+_0x93ae('0x79'));}else{_0x33a1df[_0x93ae('0x43')]('i.'+_0x3dd412+'\x20=\x20?',_0x2aa4ae['query'][_0x3dd412]);}}});}if(_0x2aa4ae[_0x93ae('0x39')][_0x93ae('0x7a')]){if(_0x2aa4ae[_0x93ae('0x39')]['read']==0x1){_0x33a1df[_0x93ae('0x5c')](_0x93ae('0x7b'));}else{_0x33a1df[_0x93ae('0x5c')]('`unreadMessages`\x20>\x200');}}if(_0x2aa4ae[_0x93ae('0x39')][_0x93ae('0x7c')]){_0x5065ed=_[_0x93ae('0x7d')](_0x2aa4ae[_0x93ae('0x39')][_0x93ae('0x7c')])?_0x2aa4ae['query'][_0x93ae('0x7c')]:new Array(_0x2aa4ae[_0x93ae('0x39')][_0x93ae('0x7c')]);_0x5065ed['forEach'](function(_0x1dd8c9){_0x47d3c3['or'](_0x93ae('0x7e'),'%,'+_0x1dd8c9+',%');});}if(_0x2aa4ae['query'][_0x93ae('0x7f')]){var _0x239921=_0x2aa4ae[_0x93ae('0x39')][_0x93ae('0x7f')]['replace']('\x5c','\x5c\x5c')[_0x93ae('0x80')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x239921)){_0x411ec6['or'](_0x93ae('0x81'),_0x239921+'%')['or'](_0x93ae('0x82'),_0x239921+'%');}else{_0x411ec6['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x93ae('0x83')](_0x239921))['or'](_0x93ae('0x84'),_0x239921+'%');}}}_0x33a1df['where'](_0x411ec6);_0x33a1df[_0x93ae('0x85')](_0x93ae('0x86'));var _0x3aedf4={'type':db['Sequelize'][_0x93ae('0x87')]['SELECT'],'raw':!![]};var _0x5a2b22=_0x33a1df[_0x93ae('0x88')]();_0x5a2b22['field'](_0x93ae('0x86'));_0x5a2b22[_0x93ae('0x45')](_0x93ae('0x89'),_0x93ae('0x5b'));if(_0x4161f2[_0x93ae('0x41')]){_0x4161f2[_0x93ae('0x41')][_0x93ae('0x2e')](function(_0x410098){var _0x69f8e6=_0x410098[0x0]===_0x93ae('0x8a')?_0x410098[0x0]:'i.'+_0x410098[0x0];_0x33a1df['order'](_0x69f8e6,_0x410098[0x1]==='DESC'?![]:!![]);});}if(!_[_0x93ae('0x70')](_0x5065ed)){_0x33a1df[_0x93ae('0x5c')](_0x47d3c3);_0x5a2b22[_0x93ae('0x43')](_0x93ae('0x8b'),_0x5065ed);}BPromise[_0x93ae('0x8c')]()['then'](function(){if(!_0x4ddece){if(_0x2aa4ae[_0x93ae('0x39')][_0x93ae('0x71')])return;_0x5a2b22[_0x93ae('0x43')](_0x93ae('0x8d'));_0x33a1df['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2aa4ae['user'][_0x93ae('0x8e')]!=='agent')return;return _0x2aa4ae[_0x93ae('0x8f')][_0x93ae('0x90')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1ff4c4){if(_[_0x93ae('0x70')](_0x1ff4c4)){_0x5a2b22[_0x93ae('0x43')](_0x93ae('0x91'));_0x33a1df[_0x93ae('0x43')](_0x93ae('0x91'));}else{_0x5a2b22[_0x93ae('0x43')](_0x93ae('0x72'),_[_0x93ae('0x38')](_0x1ff4c4,'id'));_0x33a1df[_0x93ae('0x43')](_0x93ae('0x72'),_[_0x93ae('0x38')](_0x1ff4c4,'id'));}});})['then'](function(){if(_0x2aa4ae[_0x93ae('0x8f')][_0x93ae('0x8e')]===_0x93ae('0x92')&&!_0x4ddece&&!_0x2aa4ae[_0x93ae('0x39')][_0x93ae('0x71')])return[];return db['sequelize'][_0x93ae('0x39')](_0x5a2b22['toString'](),_0x3aedf4);})[_0x93ae('0x25')](function(_0x45409d){_0x15e6af[_0x93ae('0x1f')]=_0x45409d[_0x93ae('0x3f')];if(_0x15e6af['count']===0x0)return[];return db[_0x93ae('0x93')]['query'](_0x1cbc76[_0x93ae('0x94')](),_0x3aedf4)[_0x93ae('0x25')](function(_0x3aa582){_0x2b04d6=_[_0x93ae('0x95')](_0x3aa582,'id');_0x3aedf4=_[_0x93ae('0x96')](_0x3aedf4,{'model':db[_0x93ae('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2aa4ae['query'][_0x93ae('0x3e')]){_0x4161f2[_0x93ae('0x3d')][_0x93ae('0x2e')](function(_0x4e9515){_0x33a1df[_0x93ae('0x45')]('i.'+_0x4e9515);});}else{_0x33a1df[_0x93ae('0x45')](_0x93ae('0x89'),'unreadMessages');_0x33a1df[_0x93ae('0x45')]('a.key',_0x93ae('0x97'));_0x33a1df[_0x93ae('0x45')]('a.mandatoryDisposition',_0x93ae('0x98'));_0x33a1df[_0x93ae('0x45')](_0x93ae('0x99'),_0x93ae('0x8a'));_0x33a1df['field'](_0x93ae('0x9a'));_0x33a1df[_0x93ae('0x45')](_0x93ae('0x9b'),'Contact.firstName');_0x33a1df[_0x93ae('0x45')](_0x93ae('0x9c'),_0x93ae('0x9d'));_0x33a1df[_0x93ae('0x45')](_0x93ae('0x9e'),_0x93ae('0x9f'));_0x33a1df[_0x93ae('0x45')]('c.phone',_0x93ae('0xa0'));_0x33a1df[_0x93ae('0x45')]('c.mobile',_0x93ae('0xa1'));_0x33a1df[_0x93ae('0x45')](_0x93ae('0xa2'),'Contact.fax');_0x33a1df[_0x93ae('0x45')]('o.fullname',_0x93ae('0xa3'));_0x33a1df[_0x93ae('0x45')](_0x93ae('0xa4'),_0x93ae('0xa5'));_0x33a1df[_0x93ae('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x4161f2[_0x93ae('0x20')])_0x33a1df[_0x93ae('0x20')](_0x4161f2[_0x93ae('0x20')]);if(_0x4161f2[_0x93ae('0x1d')])_0x33a1df['offset'](_0x4161f2[_0x93ae('0x1d')]);return db[_0x93ae('0x93')][_0x93ae('0x39')](_0x33a1df['toString'](),_0x3aedf4);})['then'](function(_0x5627cb){if(_0x5627cb['length']>0x0)_0x3701b4[_0x93ae('0x43')](_0x93ae('0xa6'),_[_0x93ae('0x38')](_0x5627cb,'id'));return db['sequelize'][_0x93ae('0x39')](_0x3701b4['toString'](),_0x3aedf4)[_0x93ae('0x25')](function(_0x2ce90d){var _0x1e20c8=_['groupBy'](_0x2ce90d,'WhatsappInteractionId');var _0x54baa9=[];_0x5627cb['forEach'](function(_0x6e3646){_0x54baa9['push'](updateWhatsappInteraction(_0x6e3646,_0x2b04d6,_0x1e20c8));});return BPromise['all'](_0x54baa9);});});})[_0x93ae('0x25')](function(_0x4aa03e){_0x15e6af[_0x93ae('0xa7')]=_0x4aa03e;return _0x15e6af;})['then'](respondWithFilteredResult(_0x4fab04,_0x4161f2))[_0x93ae('0xa8')](handleError(_0x4fab04,null));};exports[_0x93ae('0xa9')]=function(_0x3c99f2,_0x42d0a5){var _0x48dc1d={'raw':![],'where':{'id':_0x3c99f2[_0x93ae('0xaa')]['id']}},_0x2467d3={};_0x2467d3[_0x93ae('0x37')]=_['keys'](db['WhatsappInteraction']['rawAttributes']);_0x2467d3[_0x93ae('0x39')]=_['keys'](_0x3c99f2[_0x93ae('0x39')]);_0x2467d3[_0x93ae('0x3b')]=_[_0x93ae('0x3c')](_0x2467d3[_0x93ae('0x37')],_0x2467d3[_0x93ae('0x39')]);_0x48dc1d[_0x93ae('0x3d')]=_[_0x93ae('0x3c')](_0x2467d3[_0x93ae('0x37')],qs[_0x93ae('0x3e')](_0x3c99f2[_0x93ae('0x39')][_0x93ae('0x3e')]));_0x48dc1d[_0x93ae('0x3d')]=_0x48dc1d[_0x93ae('0x3d')][_0x93ae('0x3f')]?_0x48dc1d['attributes']:_0x2467d3[_0x93ae('0x37')];if(_0x3c99f2['query']['includeAll']){_0x48dc1d[_0x93ae('0xab')]=[{'all':!![]}];}_0x48dc1d=_[_0x93ae('0x96')]({},_0x48dc1d,_0x3c99f2[_0x93ae('0xac')]);return db[_0x93ae('0x32')][_0x93ae('0x5a')](_0x48dc1d)[_0x93ae('0x25')](handleEntityNotFound(_0x42d0a5,null))[_0x93ae('0x25')](respondWithResult(_0x42d0a5,null))[_0x93ae('0xa8')](handleError(_0x42d0a5,null));};exports[_0x93ae('0xad')]=function(_0x2d554a,_0x532f09){return db[_0x93ae('0x32')][_0x93ae('0xad')](_0x2d554a[_0x93ae('0x6e')],{})[_0x93ae('0x25')](respondWithResult(_0x532f09,0xc9))[_0x93ae('0xa8')](handleError(_0x532f09,null));};exports[_0x93ae('0x24')]=function(_0x3de96e,_0x35cf0d){if(_0x3de96e[_0x93ae('0x6e')]['id']){delete _0x3de96e['body']['id'];}return db['WhatsappInteraction'][_0x93ae('0x5a')]({'where':{'id':_0x3de96e['params']['id']}})['then'](handleEntityNotFound(_0x35cf0d,null))[_0x93ae('0x25')](saveUpdates(_0x3de96e[_0x93ae('0x6e')],null))[_0x93ae('0x25')](respondWithResult(_0x35cf0d,null))[_0x93ae('0xa8')](handleError(_0x35cf0d,null));};exports[_0x93ae('0xae')]=function(_0x582e6b,_0x3e7fe0){return db[_0x93ae('0x32')]['find']({'where':{'id':_0x582e6b[_0x93ae('0xaa')]['id']}})[_0x93ae('0x25')](handleEntityNotFound(_0x3e7fe0,null))[_0x93ae('0x25')](removeEntity(_0x3e7fe0,null))[_0x93ae('0xa8')](handleError(_0x3e7fe0,null));};exports[_0x93ae('0xaf')]=function(_0x21745c,_0x129443){return db['WhatsappInteraction']['describe']()[_0x93ae('0x25')](respondWithResult(_0x129443,null))[_0x93ae('0xa8')](handleError(_0x129443,null));};exports[_0x93ae('0xb0')]=function(_0xddf094,_0x3a2e03,_0x2cd07e){return db[_0x93ae('0xb1')][_0x93ae('0x5a')]({'where':{'id':_0xddf094[_0x93ae('0xaa')]['id']}})[_0x93ae('0x25')](handleEntityNotFound(_0x3a2e03,null))[_0x93ae('0x25')](function(_0x19bafd){if(_0x19bafd){return _0x19bafd[_0x93ae('0xb0')](_0xddf094[_0x93ae('0x6e')]['ids'],_[_0x93ae('0xb2')](_0xddf094[_0x93ae('0x6e')],[_0x93ae('0xb3'),'id'])||{});}})[_0x93ae('0x25')](respondWithResult(_0x3a2e03,null))[_0x93ae('0xa8')](handleError(_0x3a2e03,null));};exports[_0x93ae('0xb4')]=function(_0x22620a,_0x4c0110,_0x5937b4){var _0x47217d={'raw':![],'where':{}};var _0x21e113={};var _0x1b6e59={'count':0x0,'rows':[]};return db[_0x93ae('0x32')][_0x93ae('0xb5')]({'where':{'id':_0x22620a[_0x93ae('0xaa')]['id']}})['then'](handleEntityNotFound(_0x4c0110,null))['then'](function(_0x4c8420){if(_0x4c8420){_0x21e113[_0x93ae('0x37')]=_[_0x93ae('0x3a')](db[_0x93ae('0xb1')][_0x93ae('0x33')]);_0x21e113['query']=_[_0x93ae('0x3a')](_0x22620a['query']);_0x21e113['filters']=_[_0x93ae('0x3c')](_0x21e113[_0x93ae('0x37')],_0x21e113[_0x93ae('0x39')]);_0x47217d['attributes']=_['intersection'](_0x21e113[_0x93ae('0x37')],qs['fields'](_0x22620a[_0x93ae('0x39')][_0x93ae('0x3e')]));_0x47217d[_0x93ae('0x3d')]=_0x47217d[_0x93ae('0x3d')][_0x93ae('0x3f')]?_0x47217d[_0x93ae('0x3d')]:_0x21e113['model'];if(!_0x22620a[_0x93ae('0x39')][_0x93ae('0x40')](_0x93ae('0xb6'))){_0x47217d[_0x93ae('0x20')]=qs[_0x93ae('0x20')](_0x22620a[_0x93ae('0x39')][_0x93ae('0x20')]);_0x47217d[_0x93ae('0x1d')]=qs['offset'](_0x22620a['query'][_0x93ae('0x1d')]);}_0x47217d[_0x93ae('0x41')]=qs[_0x93ae('0x42')](_0x22620a[_0x93ae('0x39')]['sort']);_0x47217d[_0x93ae('0x43')]=qs[_0x93ae('0x3b')](_['pick'](_0x22620a[_0x93ae('0x39')],_0x21e113[_0x93ae('0x3b')]));_0x47217d[_0x93ae('0x43')][_0x93ae('0xb7')]=_0x4c8420['id'];if(_0x22620a[_0x93ae('0x39')][_0x93ae('0x7f')]){_0x47217d[_0x93ae('0x43')]=_[_0x93ae('0x96')](_0x47217d[_0x93ae('0x43')],{'$or':_[_0x93ae('0x38')](_0x47217d[_0x93ae('0x3d')],function(_0x5cbd88){var _0x303df={};_0x303df[_0x5cbd88]={'$like':'%'+_0x22620a[_0x93ae('0x39')][_0x93ae('0x7f')]+'%'};return _0x303df;})});}if(_0x22620a['query'][_0x93ae('0x74')]){var _0x4c5930=_0x22620a['query'][_0x93ae('0x74')][_0x93ae('0x2d')](',');var _0x4509c1={};_0x4509c1[_0x4c5930[0x0]]={'$gte':moment(_0x4c5930[0x1])[_0x93ae('0xb8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x47217d[_0x93ae('0x43')]=_[_0x93ae('0x96')](_0x47217d[_0x93ae('0x43')],_0x4509c1);}_0x47217d=_[_0x93ae('0x96')]({},_0x47217d,_0x22620a[_0x93ae('0xac')]);return db[_0x93ae('0xb1')][_0x93ae('0x1f')]({'where':_0x47217d[_0x93ae('0x43')]})[_0x93ae('0x25')](function(_0x2f26e2){_0x1b6e59[_0x93ae('0x1f')]=_0x2f26e2;if(_0x22620a[_0x93ae('0x39')]['includeAll']){_0x47217d[_0x93ae('0xab')]=[{'all':!![]}];}return db[_0x93ae('0xb1')][_0x93ae('0xb9')](_0x47217d);})[_0x93ae('0x25')](function(_0x42fda0){_0x1b6e59['rows']=_0x42fda0;return _0x1b6e59;});}})[_0x93ae('0x25')](respondWithFilteredResult(_0x4c0110,_0x47217d))['catch'](handleError(_0x4c0110,null));};exports[_0x93ae('0xba')]=function(_0x20e3ff,_0x31028c,_0x108177){return db[_0x93ae('0x32')][_0x93ae('0x5a')]({'where':{'id':_0x20e3ff[_0x93ae('0xaa')]['id']}})[_0x93ae('0x25')](handleEntityNotFound(_0x31028c,null))['then'](function(_0xe1b543){if(_0xe1b543){return _0xe1b543[_0x93ae('0xbb')](_0x20e3ff[_0x93ae('0x6e')][_0x93ae('0xb3')],_[_0x93ae('0xb2')](_0x20e3ff['body'],[_0x93ae('0xb3'),'id'])||{})[_0x93ae('0xbc')](function(){return db['Tag'][_0x93ae('0xb9')]({'attributes':['id',_0x93ae('0x29'),_0x93ae('0xbd')],'where':{'id':_0x20e3ff[_0x93ae('0x6e')][_0x93ae('0xb3')]}});})[_0x93ae('0x25')](function(_0x2a5c67){socket[_0x93ae('0xbe')](_0x93ae('0xbf'),{'id':Number(_0x20e3ff[_0x93ae('0xaa')]['id']),'tags':_0x2a5c67||[]});return{'id':Number(_0x20e3ff['params']['id']),'tags':_0x2a5c67||[]};});}})[_0x93ae('0x25')](respondWithResult(_0x31028c,null))[_0x93ae('0xa8')](handleError(_0x31028c,null));};exports[_0x93ae('0xc0')]=function(_0x2d3263,_0x28d79c,_0x950042){return db[_0x93ae('0x32')][_0x93ae('0x5a')]({'where':{'id':_0x2d3263[_0x93ae('0xaa')]['id']}})['then'](handleEntityNotFound(_0x28d79c,null))['then'](function(_0x3364b6){if(_0x3364b6){return _0x3364b6[_0x93ae('0xc0')](_0x2d3263['query'][_0x93ae('0xb3')]);}})['then'](respondWithStatusCode(_0x28d79c,null))[_0x93ae('0xa8')](handleError(_0x28d79c,null));};exports[_0x93ae('0xc1')]=function(_0x96a456,_0x399a9b){var _0x4cca7e=moment()[_0x93ae('0xc2')]()['toString']();var _0x216eab=path[_0x93ae('0xc3')](config[_0x93ae('0xc4')],_0x93ae('0xc5'),_0x93ae('0xc6'),_0x93ae('0xc7'));var _0x2911db=path['join'](config['root'],'server','files',_0x93ae('0xc8'));var _0x2cb700=path['join'](_0x216eab,_0x4cca7e);var _0x4b761c=util['format'](_0x93ae('0xc9'),_0x96a456[_0x93ae('0xaa')]['id'],_0x4cca7e);var _0x52c92a=path[_0x93ae('0xc3')](_0x216eab,_0x4b761c);var _0x1c6d96=[];_0x1c6d96[_0x93ae('0x30')]({'model':db[_0x93ae('0x69')],'as':_0x93ae('0x69'),'attributes':['id','fullname'],'raw':!![]});_0x1c6d96[_0x93ae('0x30')]({'model':db[_0x93ae('0xca')],'as':_0x93ae('0x5f'),'attributes':['id',_0x93ae('0xcb'),_0x93ae('0xcc')],'raw':!![]});if(_0x96a456['query'][_0x93ae('0xc8')]){_0x1c6d96[_0x93ae('0x30')]({'model':db[_0x93ae('0xcd')],'as':_0x93ae('0xcd'),'raw':!![]});}var _0x5062d7=[{'model':db[_0x93ae('0xb1')],'as':'Messages','attributes':['id',_0x93ae('0x6e'),_0x93ae('0xce'),_0x93ae('0xcf'),'secret',_0x93ae('0x7a')],'include':_0x1c6d96}];_0x5062d7['push']({'model':db[_0x93ae('0xd0')],'as':_0x93ae('0xd1'),'attributes':['id','name']});_0x5062d7['push']({'model':db['User'],'as':_0x93ae('0xd2'),'attributes':['id',_0x93ae('0x2b')]});return db[_0x93ae('0x32')][_0x93ae('0x5a')]({'where':{'id':_0x96a456[_0x93ae('0xaa')]['id']},'include':_0x5062d7})[_0x93ae('0x25')](handleEntityNotFound(_0x399a9b,null))[_0x93ae('0x25')](function(_0x491ff1){if(_0x491ff1){var _0x580cf4=_0x491ff1[_0x93ae('0xd3')]({'plain':!![]});fs['mkdirSync'](_0x2cb700);var _0x586d79={'channel':_0x93ae('0xd4'),'account':_0x580cf4[_0x93ae('0xd1')][_0x93ae('0x29')],'agent':_0x580cf4['Owner']?_0x580cf4[_0x93ae('0xd2')][_0x93ae('0x2b')]:_0x93ae('0xd5'),'createdAt':moment(_0x580cf4[_0x93ae('0xce')])[_0x93ae('0xb8')]('YYYY-MM-DD\x20HH:mm:ss')[_0x93ae('0x94')](),'closedAt':_0x580cf4['closed']?moment(_0x580cf4[_0x93ae('0xd6')])[_0x93ae('0xb8')]('YYYY-MM-DD\x20HH:mm:ss')[_0x93ae('0x94')]():'','disposition':_0x580cf4[_0x93ae('0xd7')],'messages':_(_0x580cf4['Messages'])[_0x93ae('0x7f')]({'secret':![]})[_0x93ae('0x38')](function(_0x54a9df){if(_0x54a9df['Attachment']){var _0x1f19d6=path[_0x93ae('0xc3')](_0x2911db,_0x54a9df[_0x93ae('0xcd')][_0x93ae('0xd8')]);if(fs['existsSync'](_0x1f19d6)){fs['createReadStream'](_0x1f19d6)[_0x93ae('0xd9')](fs[_0x93ae('0xda')](path[_0x93ae('0xc3')](_0x2cb700,_0x54a9df[_0x93ae('0xcd')][_0x93ae('0xd8')])));}}return{'date':moment(_0x54a9df['createdAt'])['format'](_0x93ae('0xdb'))[_0x93ae('0x94')](),'sender':_0x54a9df[_0x93ae('0xcf')]==='out'?_0x54a9df[_0x93ae('0x69')]?_0x54a9df[_0x93ae('0x69')][_0x93ae('0x2b')]:_0x93ae('0xdc'):_0x54a9df[_0x93ae('0x5f')][_0x93ae('0xcb')]+(_0x54a9df[_0x93ae('0x5f')]['lastName']?'\x20'+_0x54a9df[_0x93ae('0x5f')][_0x93ae('0xcc')]:''),'body':_0x54a9df[_0x93ae('0xcd')]?_0x54a9df[_0x93ae('0xcd')]['basename']:_0x54a9df['body'],'direction':_0x54a9df['direction']===_0x93ae('0xdd')?'A':'C','secret':_0x54a9df[_0x93ae('0xde')],'read':_0x54a9df[_0x93ae('0x7a')],'attachment':_0x54a9df[_0x93ae('0xcd')]};})[_0x93ae('0x62')]()};return ejs[_0x93ae('0xdf')](path[_0x93ae('0xc3')](config[_0x93ae('0xc4')],_0x93ae('0xc5'),_0x93ae('0xe0'),'downloadInteraction.ejs'),{'interaction':_0x586d79})[_0x93ae('0x25')](function(_0x47416c){var _0x350cdc=path['join'](_0x2cb700,_0x93ae('0xe1')+_0x580cf4['id']+'-'+_0x4cca7e+_0x93ae('0xe2'));var _0x30a8d9={'path':_0x350cdc,'channel':'Whatsapp','interactionId':_0x580cf4['id']};return pdf[_0x93ae('0xe3')](_0x47416c,_0x30a8d9);})[_0x93ae('0x25')](function(){return new BPromise(function(_0x1e6c0f,_0x33a885){zipdir(_0x2cb700,{'saveTo':_0x52c92a},function(_0x5763cf,_0x323ae7){if(_0x5763cf)return _0x33a885(_0x5763cf);return _0x1e6c0f(_0x323ae7);});})[_0x93ae('0x25')](function(){return new BPromise(function(_0x29b32f,_0x36a21f){rimraf(_0x2cb700,function(_0x5b1c67){if(_0x5b1c67)_0x36a21f(_0x5b1c67);return _0x29b32f();});});})[_0x93ae('0x25')](function(){return _0x399a9b[_0x93ae('0xc1')](_0x52c92a,_0x4b761c,function(_0x43efbd){if(_0x43efbd){console[_0x93ae('0xe4')](_0x93ae('0xe5'),_0x43efbd);}else{fs['unlinkSync'](_0x52c92a);}});});});}else{return _0x399a9b[_0x93ae('0x1a')](0xc8);}})[_0x93ae('0xa8')](handleError(_0x399a9b,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index c413fc4..6ca9182 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 _0x8a9a=['hasOwnProperty','hook','exports','WhatsappInteraction','../../mysqldb','WhatsappMessage','save','update','getUsers','then','Users','map','findAll','setDataValue','length','emit'];(function(_0x9e9173,_0x414ba9){var _0x3322b8=function(_0x5337f5){while(--_0x5337f5){_0x9e9173['push'](_0x9e9173['shift']());}};_0x3322b8(++_0x414ba9);}(_0x8a9a,0x193));var _0xa8a9=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x8a9a[_0x2b5eae];return _0x5f3ac9;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0xa8a9('0x0')];var WhatsappMessage=require(_0xa8a9('0x1'))['db'][_0xa8a9('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa8a9('0x3'),'afterUpdate':_0xa8a9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x488e20){return function(_0x266941,_0x4210be,_0x16b086){_0x266941[_0xa8a9('0x5')]({'attributes':['id'],'raw':!![]})[_0xa8a9('0x6')](function(_0x5c3c57){_0x266941['setDataValue'](_0xa8a9('0x7'),_0x5c3c57[_0xa8a9('0x8')](function(_0x1e8159){return{'id':_0x1e8159['id']};}));return WhatsappMessage[_0xa8a9('0x9')]({'where':{'WhatsappInteractionId':_0x266941['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa8a9('0x6')](function(_0x15ae41){_0x266941[_0xa8a9('0xa')]('unreadMessages',_0x15ae41[_0xa8a9('0xb')]);WhatsappInteractionEvents['emit'](_0x488e20+':'+_0x266941['id'],_0x266941);WhatsappInteractionEvents[_0xa8a9('0xc')](_0x488e20,_0x266941);_0x16b086(null);})['catch'](_0x16b086(null));};}for(var e in events){if(events[_0xa8a9('0xd')](e)){var event=events[e];WhatsappInteraction[_0xa8a9('0xe')](e,emitEvent(event));}}module[_0xa8a9('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x49ac=['update','remove','then','setDataValue','Users','unreadMessages','length','emit','hook','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save'];(function(_0x37d18e,_0x583c76){var _0x509a83=function(_0x351867){while(--_0x351867){_0x37d18e['push'](_0x37d18e['shift']());}};_0x509a83(++_0x583c76);}(_0x49ac,0x19e));var _0xc49a=function(_0x45c262,_0x2e3ce5){_0x45c262=_0x45c262-0x0;var _0x4f2ba6=_0x49ac[_0x45c262];return _0x4f2ba6;};'use strict';var EventEmitter=require(_0xc49a('0x0'));var WhatsappInteraction=require(_0xc49a('0x1'))['db'][_0xc49a('0x2')];var WhatsappMessage=require(_0xc49a('0x1'))['db'][_0xc49a('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xc49a('0x4')](0x0);var events={'afterCreate':_0xc49a('0x5'),'afterUpdate':_0xc49a('0x6'),'afterDestroy':_0xc49a('0x7')};function emitEvent(_0x28a560){return function(_0x43bc9c,_0x4dcf88,_0x40017e){_0x43bc9c['getUsers']({'attributes':['id'],'raw':!![]})[_0xc49a('0x8')](function(_0x1cbdda){_0x43bc9c[_0xc49a('0x9')](_0xc49a('0xa'),_0x1cbdda['map'](function(_0x35f07d){return{'id':_0x35f07d['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x43bc9c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc49a('0x8')](function(_0x5d5828){_0x43bc9c[_0xc49a('0x9')](_0xc49a('0xb'),_0x5d5828[_0xc49a('0xc')]);WhatsappInteractionEvents[_0xc49a('0xd')](_0x28a560+':'+_0x43bc9c['id'],_0x43bc9c);WhatsappInteractionEvents[_0xc49a('0xd')](_0x28a560,_0x43bc9c);_0x40017e(null);})['catch'](_0x40017e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xc49a('0xe')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index c84673d..8fb5fad 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 _0xb4ad=['changed','closedAt','format','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions'];(function(_0x4fe470,_0xfa0a8c){var _0x3cfee0=function(_0x47cc01){while(--_0x47cc01){_0x4fe470['push'](_0x4fe470['shift']());}};_0x3cfee0(++_0xfa0a8c);}(_0xb4ad,0x153));var _0xdb4a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb4ad[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdb4a('0x0'));var util=require(_0xdb4a('0x1'));var logger=require(_0xdb4a('0x2'))('api');var moment=require(_0xdb4a('0x3'));var BPromise=require(_0xdb4a('0x4'));var rp=require(_0xdb4a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb4a('0x6'));var config=require(_0xdb4a('0x7'));var attributes=require(_0xdb4a('0x8'));module[_0xdb4a('0x9')]=function(_0x1363f3,_0x11dc94){return _0x1363f3[_0xdb4a('0xa')](_0xdb4a('0xb'),attributes,{'tableName':_0xdb4a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d56e3,_0x6cb8d1,_0x439886){if(_0x4d56e3[_0xdb4a('0xd')]('closed')){_0x4d56e3[_0xdb4a('0xe')]=moment()[_0xdb4a('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x439886(null,_0x4d56e3);}}});}; \ No newline at end of file +var _0xb273=['moment','bluebird','request-promise','path','rimraf','exports','define','WhatsappInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x46aabc,_0x1b0b24){var _0x10c273=function(_0x341129){while(--_0x341129){_0x46aabc['push'](_0x46aabc['shift']());}};_0x10c273(++_0x1b0b24);}(_0xb273,0xd9));var _0x3b27=function(_0x42ab13,_0x3bc3cf){_0x42ab13=_0x42ab13-0x0;var _0x3047d5=_0xb273[_0x42ab13];return _0x3047d5;};'use strict';var _=require(_0x3b27('0x0'));var util=require(_0x3b27('0x1'));var logger=require(_0x3b27('0x2'))(_0x3b27('0x3'));var moment=require(_0x3b27('0x4'));var BPromise=require(_0x3b27('0x5'));var rp=require(_0x3b27('0x6'));var fs=require('fs');var path=require(_0x3b27('0x7'));var rimraf=require(_0x3b27('0x8'));var config=require('../../config/environment');var attributes=require('./whatsappInteraction.attributes');module[_0x3b27('0x9')]=function(_0x17ef18,_0x4bf6ad){return _0x17ef18[_0x3b27('0xa')](_0x3b27('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2da050,_0x6cecf0,_0x29ec4b){if(_0x2da050[_0x3b27('0xc')](_0x3b27('0xd'))){_0x2da050[_0x3b27('0xe')]=moment()[_0x3b27('0xf')](_0x3b27('0x10'));}_0x29ec4b(null,_0x2da050);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 128a8f2..0ea65af 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 _0x5124=['then','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','AddTagsToWhatsappInteraction','find'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5124,0x1c7));var _0x4512=function(_0x35a236,_0x8c3233){_0x35a236=_0x35a236-0x0;var _0x5d2cc6=_0x5124[_0x35a236];return _0x5d2cc6;};'use strict';var _=require(_0x4512('0x0'));var util=require(_0x4512('0x1'));var moment=require(_0x4512('0x2'));var BPromise=require(_0x4512('0x3'));var rs=require(_0x4512('0x4'));var fs=require('fs');var Redis=require(_0x4512('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4512('0x6'))(_0x4512('0x7'));var config=require(_0x4512('0x8'));var jayson=require(_0x4512('0x9'));var client=jayson[_0x4512('0xa')][_0x4512('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4512('0xc')],{'host':_0x4512('0xd'),'port':0x18eb});var socket=require(_0x4512('0xe'))(new Redis(config[_0x4512('0xc')]));require(_0x4512('0xf'))[_0x4512('0x10')](socket);function respondWithRpcPromise(_0x2bfd6d,_0x53a4cc,_0xc173ac){return new BPromise(function(_0x58e8e0,_0x4ab0cb){return client['request'](_0x2bfd6d,_0xc173ac)['then'](function(_0x5bb741){logger[_0x4512('0x11')](_0x4512('0x12'),_0x53a4cc,'request\x20sent');logger[_0x4512('0x13')](_0x4512('0x14'),_0x53a4cc,_0x4512('0x15'),JSON[_0x4512('0x16')](_0x5bb741));if(_0x5bb741[_0x4512('0x17')]){if(_0x5bb741[_0x4512('0x17')]['code']===0x1f4){logger[_0x4512('0x17')](_0x4512('0x12'),_0x53a4cc,_0x5bb741[_0x4512('0x17')][_0x4512('0x18')]);return _0x4ab0cb(_0x5bb741[_0x4512('0x17')][_0x4512('0x18')]);}logger[_0x4512('0x17')](_0x4512('0x12'),_0x53a4cc,_0x5bb741[_0x4512('0x17')][_0x4512('0x18')]);return _0x58e8e0(_0x5bb741[_0x4512('0x17')][_0x4512('0x18')]);}else{logger[_0x4512('0x11')](_0x4512('0x12'),_0x53a4cc,_0x4512('0x15'));_0x58e8e0(_0x5bb741[_0x4512('0x19')][_0x4512('0x18')]);}})[_0x4512('0x1a')](function(_0x8ff170){logger[_0x4512('0x17')](_0x4512('0x12'),_0x53a4cc,_0x8ff170);_0x4ab0cb(_0x8ff170);});});}exports[_0x4512('0x1b')]=function(_0x4a0e6e){var _0x3c38f5=this;return new Promise(function(_0x5f0806,_0x2cd076){return db[_0x4512('0x1c')][_0x4512('0x1d')](_0x4a0e6e[_0x4512('0x1e')],{'raw':_0x4a0e6e[_0x4512('0x1f')]?_0x4a0e6e[_0x4512('0x1f')][_0x4512('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a0e6e[_0x4512('0x1f')]?_0x4a0e6e['options'][_0x4512('0x21')]||null:null,'attributes':_0x4a0e6e[_0x4512('0x1f')]?_0x4a0e6e[_0x4512('0x1f')][_0x4512('0x22')]||null:null,'limit':_0x4a0e6e['options']?_0x4a0e6e[_0x4512('0x1f')]['limit']||null:null})['then'](function(_0x4b5614){logger[_0x4512('0x11')](_0x4512('0x1b'),_0x4a0e6e);logger[_0x4512('0x13')]('UpdateWhatsappInteraction',_0x4a0e6e,JSON[_0x4512('0x16')](_0x4b5614));_0x5f0806(_0x4b5614);})[_0x4512('0x1a')](function(_0x34ccda){logger[_0x4512('0x17')](_0x4512('0x1b'),_0x34ccda[_0x4512('0x18')],_0x4a0e6e);_0x2cd076(_0x3c38f5[_0x4512('0x17')](0x1f4,_0x34ccda['message']));});});};exports[_0x4512('0x23')]=function(_0x4a14f3){return new Promise(function(_0x42695d,_0xd8b8b0){return db[_0x4512('0x1c')][_0x4512('0x24')]({'where':_0x4a14f3['options']?_0x4a14f3[_0x4512('0x1f')][_0x4512('0x21')]||null:null})[_0x4512('0x25')](function(_0x2b99c6){if(_0x2b99c6){return _0x2b99c6[_0x4512('0x26')](_0x4a14f3[_0x4512('0x1e')][_0x4512('0x27')],_['omit'](_0x4a14f3[_0x4512('0x1e')],[_0x4512('0x27'),'id'])||{});}})['spread'](function(_0x476c8a){logger[_0x4512('0x11')](_0x4512('0x28'),_0x4a14f3);logger[_0x4512('0x13')](_0x4512('0x28'),_0x4a14f3,JSON[_0x4512('0x16')](_0x476c8a));_0x42695d(_0x476c8a);})['catch'](function(_0x212289){logger[_0x4512('0x17')](_0x4512('0x28'),_0x212289[_0x4512('0x18')],_0x4a14f3);_0xd8b8b0(_this[_0x4512('0x17')](0x1f4,_0x212289[_0x4512('0x18')]));});});}; \ No newline at end of file +var _0xa979=['util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','error','code','message','catch','UpdateWhatsappInteraction','update','body','options','where','attributes','limit','stringify','addTags','omit','ids','spread','AddTags','lodash'];(function(_0x19caa0,_0x553899){var _0x1a816b=function(_0x2a600c){while(--_0x2a600c){_0x19caa0['push'](_0x19caa0['shift']());}};_0x1a816b(++_0x553899);}(_0xa979,0xb3));var _0x9a97=function(_0x87b989,_0x48be91){_0x87b989=_0x87b989-0x0;var _0x14b62d=_0xa979[_0x87b989];return _0x14b62d;};'use strict';var _=require(_0x9a97('0x0'));var util=require(_0x9a97('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a97('0x2'))['db'];var utils=require(_0x9a97('0x3'));var logger=require(_0x9a97('0x4'))(_0x9a97('0x5'));var config=require(_0x9a97('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9a97('0x7')][_0x9a97('0x8')]({'port':0x232a});config[_0x9a97('0x9')]=_[_0x9a97('0xa')](config[_0x9a97('0x9')],{'host':_0x9a97('0xb'),'port':0x18eb});var socket=require(_0x9a97('0xc'))(new Redis(config[_0x9a97('0x9')]));require('./whatsappInteraction.socket')[_0x9a97('0xd')](socket);function respondWithRpcPromise(_0x5658c1,_0x138442,_0x2acc20){return new BPromise(function(_0x154569,_0xf94a04){return client[_0x9a97('0xe')](_0x5658c1,_0x2acc20)[_0x9a97('0xf')](function(_0xf8ebd){logger[_0x9a97('0x10')](_0x9a97('0x11'),_0x138442,'request\x20sent');logger[_0x9a97('0x12')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x138442,'request\x20sent',JSON['stringify'](_0xf8ebd));if(_0xf8ebd['error']){if(_0xf8ebd[_0x9a97('0x13')][_0x9a97('0x14')]===0x1f4){logger[_0x9a97('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x138442,_0xf8ebd[_0x9a97('0x13')][_0x9a97('0x15')]);return _0xf94a04(_0xf8ebd['error'][_0x9a97('0x15')]);}logger[_0x9a97('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x138442,_0xf8ebd[_0x9a97('0x13')][_0x9a97('0x15')]);return _0x154569(_0xf8ebd[_0x9a97('0x13')][_0x9a97('0x15')]);}else{logger['info'](_0x9a97('0x11'),_0x138442,'request\x20sent');_0x154569(_0xf8ebd['result'][_0x9a97('0x15')]);}})[_0x9a97('0x16')](function(_0x30547b){logger[_0x9a97('0x13')](_0x9a97('0x11'),_0x138442,_0x30547b);_0xf94a04(_0x30547b);});});}exports[_0x9a97('0x17')]=function(_0x5dc362){var _0x27e4b6=this;return new Promise(function(_0x39dc7c,_0x12c5ed){return db['WhatsappInteraction'][_0x9a97('0x18')](_0x5dc362[_0x9a97('0x19')],{'raw':_0x5dc362[_0x9a97('0x1a')]?_0x5dc362['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dc362['options']?_0x5dc362[_0x9a97('0x1a')][_0x9a97('0x1b')]||null:null,'attributes':_0x5dc362[_0x9a97('0x1a')]?_0x5dc362[_0x9a97('0x1a')][_0x9a97('0x1c')]||null:null,'limit':_0x5dc362['options']?_0x5dc362['options'][_0x9a97('0x1d')]||null:null})[_0x9a97('0xf')](function(_0x4c2bfb){logger[_0x9a97('0x10')](_0x9a97('0x17'),_0x5dc362);logger[_0x9a97('0x12')](_0x9a97('0x17'),_0x5dc362,JSON[_0x9a97('0x1e')](_0x4c2bfb));_0x39dc7c(_0x4c2bfb);})[_0x9a97('0x16')](function(_0x160c26){logger[_0x9a97('0x13')](_0x9a97('0x17'),_0x160c26[_0x9a97('0x15')],_0x5dc362);_0x12c5ed(_0x27e4b6[_0x9a97('0x13')](0x1f4,_0x160c26['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x4f3a5e){return new Promise(function(_0x1b4ea7,_0x5c2203){return db['WhatsappInteraction']['find']({'where':_0x4f3a5e[_0x9a97('0x1a')]?_0x4f3a5e['options'][_0x9a97('0x1b')]||null:null})[_0x9a97('0xf')](function(_0x34dd93){if(_0x34dd93){return _0x34dd93[_0x9a97('0x1f')](_0x4f3a5e[_0x9a97('0x19')]['ids'],_[_0x9a97('0x20')](_0x4f3a5e[_0x9a97('0x19')],[_0x9a97('0x21'),'id'])||{});}})[_0x9a97('0x22')](function(_0x340590){logger['info'](_0x9a97('0x23'),_0x4f3a5e);logger[_0x9a97('0x12')]('AddTags',_0x4f3a5e,JSON[_0x9a97('0x1e')](_0x340590));_0x1b4ea7(_0x340590);})[_0x9a97('0x16')](function(_0x39ca44){logger[_0x9a97('0x13')](_0x9a97('0x23'),_0x39ca44[_0x9a97('0x15')],_0x4f3a5e);_0x5c2203(_this[_0x9a97('0x13')](0x1f4,_0x39ca44[_0x9a97('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 30c9d79..7dc5d25 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 _0xaee2=['removeListener','length','whatsappInteraction:','save','remove','update'];(function(_0x5c926a,_0x48a47f){var _0x23242d=function(_0x531d63){while(--_0x531d63){_0x5c926a['push'](_0x5c926a['shift']());}};_0x23242d(++_0x48a47f);}(_0xaee2,0x195));var _0x2aee=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xaee2[_0x1abb09];return _0xea1c07;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x2aee('0x0'),_0x2aee('0x1'),_0x2aee('0x2')];function createListener(_0x300094,_0x5104ce){return function(_0x55536e){_0x5104ce['emit'](_0x300094,_0x55536e);};}function removeListener(_0x1d938d,_0x535fc4){return function(){WhatsappInteractionEvents[_0x2aee('0x3')](_0x1d938d,_0x535fc4);};}exports['register']=function(_0x37b4e0){for(var _0x5451c8=0x0,_0x2d6f44=events[_0x2aee('0x4')];_0x5451c8<_0x2d6f44;_0x5451c8++){var _0x54b54f=events[_0x5451c8];var _0x1eaa71=createListener(_0x2aee('0x5')+_0x54b54f,_0x37b4e0);WhatsappInteractionEvents['on'](_0x54b54f,_0x1eaa71);}}; \ No newline at end of file +var _0xb8be=['whatsappInteraction:','save','remove','update','emit','removeListener','register','length'];(function(_0x2460fc,_0x39b5f6){var _0x422375=function(_0x238373){while(--_0x238373){_0x2460fc['push'](_0x2460fc['shift']());}};_0x422375(++_0x39b5f6);}(_0xb8be,0x81));var _0xeb8b=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0xb8be[_0x152678];return _0x311a9;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xeb8b('0x0'),_0xeb8b('0x1'),_0xeb8b('0x2')];function createListener(_0x2ca6b7,_0x323189){return function(_0x2c64a6){_0x323189[_0xeb8b('0x3')](_0x2ca6b7,_0x2c64a6);};}function removeListener(_0x1eb97d,_0x261280){return function(){WhatsappInteractionEvents[_0xeb8b('0x4')](_0x1eb97d,_0x261280);};}exports[_0xeb8b('0x5')]=function(_0x4f2628){for(var _0x43ba3e=0x0,_0x222d4c=events[_0xeb8b('0x6')];_0x43ba3e<_0x222d4c;_0x43ba3e++){var _0x31cc1b=events[_0x43ba3e];var _0xa9c33c=createListener(_0xeb8b('0x7')+_0x31cc1b,_0x4f2628);WhatsappInteractionEvents['on'](_0x31cc1b,_0xa9c33c);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 010656f..5e71524 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 _0xd32c=['/describe','describe','/:id','show','post','tracked','whatsappmessage:create','/:id/status','status','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index'];(function(_0x4304d2,_0xa0f870){var _0x41d00c=function(_0xb4f39c){while(--_0xb4f39c){_0x4304d2['push'](_0x4304d2['shift']());}};_0x41d00c(++_0xa0f870);}(_0xd32c,0x150));var _0xcd32=function(_0x54aea3,_0xae7d81){_0x54aea3=_0x54aea3-0x0;var _0x21ae46=_0xd32c[_0x54aea3];return _0x21ae46;};'use strict';var multer=require(_0xcd32('0x0'));var util=require(_0xcd32('0x1'));var path=require(_0xcd32('0x2'));var timeout=require(_0xcd32('0x3'));var express=require('express');var router=express[_0xcd32('0x4')]();var fs_extra=require(_0xcd32('0x5'));var auth=require(_0xcd32('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcd32('0x7'));var controller=require(_0xcd32('0x8'));router[_0xcd32('0x9')]('/',auth[_0xcd32('0xa')](),controller[_0xcd32('0xb')]);router[_0xcd32('0x9')](_0xcd32('0xc'),auth[_0xcd32('0xa')](),controller[_0xcd32('0xd')]);router[_0xcd32('0x9')](_0xcd32('0xe'),auth[_0xcd32('0xa')](),controller[_0xcd32('0xf')]);router[_0xcd32('0x10')]('/',auth['isAuthenticated'](),interaction[_0xcd32('0x11')]('whatsapp',_0xcd32('0x12')),controller['create']);router[_0xcd32('0x10')](_0xcd32('0x13'),controller[_0xcd32('0x14')]);router[_0xcd32('0x15')](_0xcd32('0xe'),auth['isAuthenticated'](),controller[_0xcd32('0x16')]);router[_0xcd32('0x15')](_0xcd32('0x17'),auth[_0xcd32('0xa')](),controller['accept']);router[_0xcd32('0x15')](_0xcd32('0x18'),auth['isAuthenticated'](),controller[_0xcd32('0x19')]);router[_0xcd32('0x1a')]('/:id',auth[_0xcd32('0xa')](),controller[_0xcd32('0x1b')]);module[_0xcd32('0x1c')]=router; \ No newline at end of file +var _0x6f8a=['/:id/reject','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','tracked','whatsapp','whatsappmessage:create','create','post','status','put','accept'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6f8a,0x12c));var _0xa6f8=function(_0x5a8279,_0x319df1){_0x5a8279=_0x5a8279-0x0;var _0x1ea345=_0x6f8a[_0x5a8279];return _0x1ea345;};'use strict';var multer=require(_0xa6f8('0x0'));var util=require(_0xa6f8('0x1'));var path=require(_0xa6f8('0x2'));var timeout=require(_0xa6f8('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa6f8('0x4'));var auth=require(_0xa6f8('0x5'));var interaction=require(_0xa6f8('0x6'));var config=require(_0xa6f8('0x7'));var controller=require(_0xa6f8('0x8'));router[_0xa6f8('0x9')]('/',auth['isAuthenticated'](),controller[_0xa6f8('0xa')]);router[_0xa6f8('0x9')](_0xa6f8('0xb'),auth[_0xa6f8('0xc')](),controller[_0xa6f8('0xd')]);router[_0xa6f8('0x9')](_0xa6f8('0xe'),auth[_0xa6f8('0xc')](),controller[_0xa6f8('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xa6f8('0x10')](_0xa6f8('0x11'),_0xa6f8('0x12')),controller[_0xa6f8('0x13')]);router[_0xa6f8('0x14')]('/:id/status',controller[_0xa6f8('0x15')]);router[_0xa6f8('0x16')](_0xa6f8('0xe'),auth['isAuthenticated'](),controller['update']);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0xa6f8('0x17')]);router[_0xa6f8('0x16')](_0xa6f8('0x18'),auth[_0xa6f8('0xc')](),controller['reject']);router[_0xa6f8('0x19')]('/:id',auth[_0xa6f8('0xc')](),controller[_0xa6f8('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 11df888..c0ae0ca 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 _0x1738=['out','STRING','DATE','TEXT','sequelize','exports','BOOLEAN','ENUM'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x1738,0x1bc));var _0x8173=function(_0x24f5ec,_0x34c588){_0x24f5ec=_0x24f5ec-0x0;var _0x366b7c=_0x1738[_0x24f5ec];return _0x366b7c;};'use strict';var Sequelize=require(_0x8173('0x0'));module[_0x8173('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8173('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8173('0x3')]('in',_0x8173('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x8173('0x5')]},'readAt':{'type':Sequelize[_0x8173('0x6')]},'secret':{'type':Sequelize[_0x8173('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8173('0x5')]},'providerResponse':{'type':Sequelize[_0x8173('0x7')]}}; \ No newline at end of file +var _0x2408=['TEXT','medium','ENUM','out','STRING','DATE','BOOLEAN','sequelize'];(function(_0x45efcd,_0x2d3824){var _0x28ee7b=function(_0x1f3459){while(--_0x1f3459){_0x45efcd['push'](_0x45efcd['shift']());}};_0x28ee7b(++_0x2d3824);}(_0x2408,0x97));var _0x8240=function(_0x1449b1,_0x1b4547){_0x1449b1=_0x1449b1-0x0;var _0x1e77b4=_0x2408[_0x1449b1];return _0x1e77b4;};'use strict';var Sequelize=require(_0x8240('0x0'));module['exports']={'body':{'type':Sequelize[_0x8240('0x1')](_0x8240('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8240('0x3')]('in',_0x8240('0x4')),'defaultValue':_0x8240('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8240('0x5')](0xbe)},'phone':{'type':Sequelize[_0x8240('0x5')]},'readAt':{'type':Sequelize[_0x8240('0x6')]},'secret':{'type':Sequelize[_0x8240('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8240('0x5')]},'providerResponse':{'type':Sequelize[_0x8240('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 2ed00e8..9dae87d 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 _0xbaac=['WhatsappAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','read','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','then','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','WhatsappMessage,\x20%s,\x20%s','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','index','map','WhatsappMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','describe','whatsapp-interactions','accept','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','isNil','read1stAt','interaction','[WHATSAPPMESSAGE: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','Sequelize','QueryTypes','SELECT','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','WhatsappInteraction','WhatsappInteractionId','get','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','fullname','SIP/%s','rejectmessage'];(function(_0x246ed0,_0x4cba7d){var _0x15f43b=function(_0x26a8f2){while(--_0x26a8f2){_0x246ed0['push'](_0x246ed0['shift']());}};_0x15f43b(++_0x4cba7d);}(_0xbaac,0x96));var _0xcbaa=function(_0x4d30e5,_0x341957){_0x4d30e5=_0x4d30e5-0x0;var _0x5880b1=_0xbaac[_0x4d30e5];return _0x5880b1;};'use strict';var emlformat=require(_0xcbaa('0x0'));var rimraf=require(_0xcbaa('0x1'));var zipdir=require(_0xcbaa('0x2'));var jsonpatch=require(_0xcbaa('0x3'));var rp=require(_0xcbaa('0x4'));var moment=require(_0xcbaa('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcbaa('0x6'));var util=require(_0xcbaa('0x7'));var path=require('path');var sox=require(_0xcbaa('0x8'));var csv=require(_0xcbaa('0x9'));var ejs=require(_0xcbaa('0xa'));var fs=require('fs');var fs_extra=require(_0xcbaa('0xb'));var _=require(_0xcbaa('0xc'));var squel=require(_0xcbaa('0xd'));var crypto=require(_0xcbaa('0xe'));var jsforce=require(_0xcbaa('0xf'));var deskjs=require(_0xcbaa('0x10'));var toCsv=require(_0xcbaa('0x9'));var querystring=require('querystring');var Papa=require(_0xcbaa('0x11'));var Redis=require('ioredis');var authService=require(_0xcbaa('0x12'));var qs=require(_0xcbaa('0x13'));var as=require(_0xcbaa('0x14'));var hardwareService=require(_0xcbaa('0x15'));var logger=require(_0xcbaa('0x16'))('api');var utils=require(_0xcbaa('0x17'));var config=require(_0xcbaa('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbaa('0x19'))['db'];config[_0xcbaa('0x1a')]=_[_0xcbaa('0x1b')](config[_0xcbaa('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xcbaa('0x1c'))(new Redis(config[_0xcbaa('0x1a')]));require(_0xcbaa('0x1d'))['register'](socket);var jayson=require(_0xcbaa('0x1e'));var client=jayson[_0xcbaa('0x1f')][_0xcbaa('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xcbaa('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3ad686,_0x5f0d55,_0x48d137,_0x3daaa9){return new BPromise(function(_0x14c777,_0x186ad9){var _0x35d907=_0x3daaa9||client;return _0x35d907[_0xcbaa('0x21')](_0x3ad686,_0x48d137)[_0xcbaa('0x22')](function(_0x4e6f6b){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x5f0d55,_0xcbaa('0x23'));logger[_0xcbaa('0x24')](_0xcbaa('0x25'),_0x5f0d55,_0xcbaa('0x23'),JSON[_0xcbaa('0x26')](_0x4e6f6b));if(_0x4e6f6b['error']){if(_0x4e6f6b[_0xcbaa('0x27')][_0xcbaa('0x28')]===0x1f4){logger[_0xcbaa('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x5f0d55,_0x4e6f6b['error'][_0xcbaa('0x29')]);return _0x186ad9(_0x4e6f6b[_0xcbaa('0x27')][_0xcbaa('0x29')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x5f0d55,_0x4e6f6b[_0xcbaa('0x27')][_0xcbaa('0x29')]);return _0x14c777(_0x4e6f6b['error']['message']);}else{logger[_0xcbaa('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0x5f0d55,'request\x20sent');_0x14c777(_0x4e6f6b[_0xcbaa('0x2b')][_0xcbaa('0x29')]);}})['catch'](function(_0xb5be90){logger[_0xcbaa('0x27')](_0xcbaa('0x2c'),_0x5f0d55,_0xb5be90);_0x186ad9(_0xb5be90);});});}function respondWithStatusCode(_0x7470cd,_0x3e0b3c){_0x3e0b3c=_0x3e0b3c||0xcc;return function(_0x5c03b2){if(_0x5c03b2){return _0x7470cd['sendStatus'](_0x3e0b3c);}return _0x7470cd[_0xcbaa('0x2d')](_0x3e0b3c)['end']();};}function respondWithResult(_0x3bf245,_0x28376a){_0x28376a=_0x28376a||0xc8;return function(_0x5e1cf7){if(_0x5e1cf7){return _0x3bf245['status'](_0x28376a)['json'](_0x5e1cf7);}};}function respondWithFilteredResult(_0x4581d4,_0x2a7c0d){return function(_0x33daac){if(_0x33daac){var _0x25d783=typeof _0x2a7c0d[_0xcbaa('0x2e')]==='undefined'&&typeof _0x2a7c0d[_0xcbaa('0x2f')]==='undefined';var _0x94acee=_0x33daac['count'];var _0x11c577=_0x25d783?0x0:_0x2a7c0d[_0xcbaa('0x2e')];var _0x4703de=_0x25d783?_0x33daac[_0xcbaa('0x30')]:_0x2a7c0d[_0xcbaa('0x2e')]+_0x2a7c0d[_0xcbaa('0x2f')];var _0x1d048b;if(_0x4703de>=_0x94acee){_0x4703de=_0x94acee;_0x1d048b=0xc8;}else{_0x1d048b=0xce;}_0x4581d4['status'](_0x1d048b);return _0x4581d4[_0xcbaa('0x31')](_0xcbaa('0x32'),_0x11c577+'-'+_0x4703de+'/'+_0x94acee)[_0xcbaa('0x33')](_0x33daac);}return null;};}function patchUpdates(_0x4c0636){return function(_0x15d1f8){try{jsonpatch[_0xcbaa('0x34')](_0x15d1f8,_0x4c0636,!![]);}catch(_0x6cb786){return BPromise[_0xcbaa('0x35')](_0x6cb786);}return _0x15d1f8[_0xcbaa('0x36')]();};}function saveUpdates(_0x37247e,_0x5a3cda){return function(_0x4a6adb){if(_0x4a6adb){return _0x4a6adb[_0xcbaa('0x37')](_0x37247e)[_0xcbaa('0x22')](function(_0x78fb27){return _0x78fb27;});}return null;};}function removeEntity(_0x58c14c,_0x201096){return function(_0x2634d2){if(_0x2634d2){return _0x2634d2[_0xcbaa('0x38')]()[_0xcbaa('0x22')](function(){_0x58c14c[_0xcbaa('0x2d')](0xcc)[_0xcbaa('0x39')]();});}};}function handleEntityNotFound(_0x52c583,_0x16f8da){return function(_0x3a01e2){if(!_0x3a01e2){_0x52c583[_0xcbaa('0x3a')](0x194);}return _0x3a01e2;};}function handleError(_0x43ccca,_0x3443f7){_0x3443f7=_0x3443f7||0x1f4;return function(_0x2c786a){logger[_0xcbaa('0x27')](_0x2c786a[_0xcbaa('0x3b')]);if(_0x2c786a[_0xcbaa('0x3c')]){delete _0x2c786a[_0xcbaa('0x3c')];}_0x43ccca['status'](_0x3443f7)[_0xcbaa('0x3d')](_0x2c786a);};}exports[_0xcbaa('0x3e')]=function(_0x411f33,_0x59e0d6){var _0x1fcaf5={},_0x42de28={},_0x12d006={'count':0x0,'rows':[]};var _0x2d7987=_[_0xcbaa('0x3f')](db[_0xcbaa('0x40')][_0xcbaa('0x41')],function(_0x348b4f){return{'name':_0x348b4f['fieldName'],'type':_0x348b4f[_0xcbaa('0x42')][_0xcbaa('0x43')]};});_0x42de28[_0xcbaa('0x44')]=_['map'](_0x2d7987,_0xcbaa('0x3c'));_0x42de28[_0xcbaa('0x45')]=_[_0xcbaa('0x46')](_0x411f33[_0xcbaa('0x45')]);_0x42de28[_0xcbaa('0x47')]=_[_0xcbaa('0x48')](_0x42de28[_0xcbaa('0x44')],_0x42de28[_0xcbaa('0x45')]);_0x1fcaf5[_0xcbaa('0x49')]=_['intersection'](_0x42de28[_0xcbaa('0x44')],qs[_0xcbaa('0x4a')](_0x411f33[_0xcbaa('0x45')]['fields']));_0x1fcaf5[_0xcbaa('0x49')]=_0x1fcaf5[_0xcbaa('0x49')][_0xcbaa('0x4b')]?_0x1fcaf5[_0xcbaa('0x49')]:_0x42de28[_0xcbaa('0x44')];if(!_0x411f33[_0xcbaa('0x45')][_0xcbaa('0x4c')](_0xcbaa('0x4d'))){_0x1fcaf5[_0xcbaa('0x2f')]=qs[_0xcbaa('0x2f')](_0x411f33['query'][_0xcbaa('0x2f')]);_0x1fcaf5[_0xcbaa('0x2e')]=qs[_0xcbaa('0x2e')](_0x411f33[_0xcbaa('0x45')][_0xcbaa('0x2e')]);}_0x1fcaf5['order']=qs['sort'](_0x411f33[_0xcbaa('0x45')][_0xcbaa('0x4e')]);_0x1fcaf5[_0xcbaa('0x4f')]=qs[_0xcbaa('0x47')](_[_0xcbaa('0x50')](_0x411f33['query'],_0x42de28['filters']),_0x2d7987);if(_0x411f33['query']['filter']){_0x1fcaf5[_0xcbaa('0x4f')]=_['merge'](_0x1fcaf5[_0xcbaa('0x4f')],{'$or':_['map'](_0x2d7987,function(_0x4e9ca9){if(_0x4e9ca9[_0xcbaa('0x42')]!=='VIRTUAL'){var _0x2fc1b1={};_0x2fc1b1[_0x4e9ca9[_0xcbaa('0x3c')]]={'$like':'%'+_0x411f33[_0xcbaa('0x45')][_0xcbaa('0x51')]+'%'};return _0x2fc1b1;}})});}_0x1fcaf5=_[_0xcbaa('0x52')]({},_0x1fcaf5,_0x411f33[_0xcbaa('0x53')]);var _0x179c9f={'where':_0x1fcaf5['where']};return db[_0xcbaa('0x40')][_0xcbaa('0x30')](_0x179c9f)[_0xcbaa('0x22')](function(_0x428ef7){_0x12d006[_0xcbaa('0x30')]=_0x428ef7;if(_0x411f33[_0xcbaa('0x45')][_0xcbaa('0x54')]){_0x1fcaf5['include']=[{'all':!![]}];}return db[_0xcbaa('0x40')][_0xcbaa('0x55')](_0x1fcaf5);})[_0xcbaa('0x22')](function(_0x4dda28){_0x12d006[_0xcbaa('0x56')]=_0x4dda28;return _0x12d006;})[_0xcbaa('0x22')](respondWithFilteredResult(_0x59e0d6,_0x1fcaf5))['catch'](handleError(_0x59e0d6,null));};exports[_0xcbaa('0x57')]=function(_0x43d915,_0x284690){var _0x503bdc={'raw':!![],'where':{'id':_0x43d915[_0xcbaa('0x58')]['id']}},_0x43fe6c={};_0x43fe6c['model']=_[_0xcbaa('0x46')](db[_0xcbaa('0x40')]['rawAttributes']);_0x43fe6c[_0xcbaa('0x45')]=_['keys'](_0x43d915[_0xcbaa('0x45')]);_0x43fe6c[_0xcbaa('0x47')]=_[_0xcbaa('0x48')](_0x43fe6c[_0xcbaa('0x44')],_0x43fe6c[_0xcbaa('0x45')]);_0x503bdc[_0xcbaa('0x49')]=_[_0xcbaa('0x48')](_0x43fe6c[_0xcbaa('0x44')],qs[_0xcbaa('0x4a')](_0x43d915['query'][_0xcbaa('0x4a')]));_0x503bdc[_0xcbaa('0x49')]=_0x503bdc[_0xcbaa('0x49')][_0xcbaa('0x4b')]?_0x503bdc[_0xcbaa('0x49')]:_0x43fe6c['model'];if(_0x43d915['query']['includeAll']){_0x503bdc[_0xcbaa('0x59')]=[{'all':!![]}];}_0x503bdc=_[_0xcbaa('0x52')]({},_0x503bdc,_0x43d915[_0xcbaa('0x53')]);return db[_0xcbaa('0x40')][_0xcbaa('0x5a')](_0x503bdc)[_0xcbaa('0x22')](handleEntityNotFound(_0x284690,null))['then'](respondWithResult(_0x284690,null))[_0xcbaa('0x5b')](handleError(_0x284690,null));};exports[_0xcbaa('0x5c')]=function(_0xaa815b,_0x3f5edc){return db[_0xcbaa('0x40')][_0xcbaa('0x5c')](_0xaa815b[_0xcbaa('0x5d')],{})[_0xcbaa('0x22')](respondWithResult(_0x3f5edc,0xc9))['catch'](handleError(_0x3f5edc,null));};exports['update']=function(_0x4c09aa,_0x46eefe){if(_0x4c09aa[_0xcbaa('0x5d')]['id']){delete _0x4c09aa[_0xcbaa('0x5d')]['id'];}return db[_0xcbaa('0x40')][_0xcbaa('0x5a')]({'where':{'id':_0x4c09aa['params']['id']}})[_0xcbaa('0x22')](handleEntityNotFound(_0x46eefe,null))[_0xcbaa('0x22')](saveUpdates(_0x4c09aa[_0xcbaa('0x5d')],null))[_0xcbaa('0x22')](respondWithResult(_0x46eefe,null))[_0xcbaa('0x5b')](handleError(_0x46eefe,null));};exports[_0xcbaa('0x38')]=function(_0x574886,_0x1f2dff){return db['WhatsappMessage']['find']({'where':{'id':_0x574886[_0xcbaa('0x58')]['id']}})[_0xcbaa('0x22')](handleEntityNotFound(_0x1f2dff,null))[_0xcbaa('0x22')](removeEntity(_0x1f2dff,null))[_0xcbaa('0x5b')](handleError(_0x1f2dff,null));};exports[_0xcbaa('0x5e')]=function(_0x21f001,_0x566b5a){return db['WhatsappMessage'][_0xcbaa('0x5e')]()[_0xcbaa('0x22')](respondWithResult(_0x566b5a,null))[_0xcbaa('0x5b')](handleError(_0x566b5a,null));};var interaction_log=require('../../config/logger')(_0xcbaa('0x5f'));exports[_0xcbaa('0x60')]=function(_0x2266b0,_0x54ca59,_0x307c0f){var _0x1a325d={'agent':{},'channel':_0xcbaa('0x61')};if(_0x2266b0[_0xcbaa('0x5d')]['id']){delete _0x2266b0[_0xcbaa('0x5d')]['id'];}_0x2266b0[_0xcbaa('0x5d')]['read']=!![];_0x2266b0['body'][_0xcbaa('0x62')]=moment()[_0xcbaa('0x63')](_0xcbaa('0x64'));_0x2266b0[_0xcbaa('0x5d')][_0xcbaa('0x65')]=_0x2266b0['body'][_0xcbaa('0x65')]||_0x2266b0['user']['id'];_0x1a325d[_0xcbaa('0x66')]['id']=_0x2266b0[_0xcbaa('0x5d')][_0xcbaa('0x65')];return db[_0xcbaa('0x40')][_0xcbaa('0x5a')]({'where':{'id':_0x2266b0['params']['id'],'UserId':null}})[_0xcbaa('0x22')](handleEntityNotFound(_0x54ca59,null))[_0xcbaa('0x22')](saveUpdates(_0x2266b0['body'],null))[_0xcbaa('0x22')](function(_0x4a9be0){if(_0x4a9be0){_0x1a325d[_0xcbaa('0x29')]=_0x4a9be0['get']({'plain':!![]});return db['WhatsappInteraction'][_0xcbaa('0x5a')]({'where':{'id':_0x4a9be0['WhatsappInteractionId']}});}return null;})[_0xcbaa('0x22')](handleEntityNotFound(_0x54ca59,null))[_0xcbaa('0x22')](function(_0x566efd){if(_0x566efd){return _0x566efd[_0xcbaa('0x37')]({'UserId':_0x2266b0['body'][_0xcbaa('0x65')],'read1stAt':_[_0xcbaa('0x67')](_0x566efd[_0xcbaa('0x68')])?moment()[_0xcbaa('0x63')](_0xcbaa('0x64')):undefined});}return null;})['then'](function(_0x2eaf41){if(_0x2eaf41){_0x1a325d[_0xcbaa('0x69')]=_0x2eaf41['get']({'plain':!![]});interaction_log['info'](_0xcbaa('0x6a'),_0x2266b0[_0xcbaa('0x6b')]['id'],_0x2266b0['user'][_0xcbaa('0x3c')],_0x2266b0[_0xcbaa('0x6b')][_0xcbaa('0x6c')],_0x1a325d[_0xcbaa('0x69')]['id'],_0x2266b0[_0xcbaa('0x5d')]?JSON[_0xcbaa('0x26')](_0x2266b0[_0xcbaa('0x5d')]):_0xcbaa('0x6d'));return respondWithRpcPromise('AcceptMessage',_0xcbaa('0x6e'),_0x1a325d);}return null;})[_0xcbaa('0x22')](function(_0x1410c6){var _0x5effb3=_0xcbaa('0x6f')+_0x1410c6[_0xcbaa('0x29')][_0xcbaa('0x70')];return db[_0xcbaa('0x71')]['query'](_0x5effb3,{'type':db[_0xcbaa('0x72')][_0xcbaa('0x73')][_0xcbaa('0x74')],'raw':!![]})[_0xcbaa('0x22')](function(_0xa4047){return _0xa4047;});})[_0xcbaa('0x22')](function(_0x4ef720){if(_0x4ef720){_0x1a325d[_0xcbaa('0x29')]['contact']=_0x4ef720[0x0];if(!_0x2266b0[_0xcbaa('0x5d')][_0xcbaa('0x65')])return;return db['User'][_0xcbaa('0x5a')]({'where':{'id':_0x2266b0['body'][_0xcbaa('0x65')],'role':_0xcbaa('0x66')},'attributes':['id',_0xcbaa('0x3c'),'fullname',_0xcbaa('0x75'),_0xcbaa('0x76')],'raw':!![]});}return null;})[_0xcbaa('0x22')](function(_0x2d8d44){if(!_0x2d8d44)return null;_0x1a325d[_0xcbaa('0x29')]['agent']=_0x2d8d44;return _0x1a325d;})[_0xcbaa('0x22')](function(_0x3c1d03){if(_0x3c1d03){if(_0x2266b0['body'][_0xcbaa('0x77')]){_0x1a325d[_0xcbaa('0x29')][_0xcbaa('0x78')]=util[_0xcbaa('0x63')]('SIP/%s',_0x2266b0['user'][_0xcbaa('0x3c')]);_0x1a325d[_0xcbaa('0x29')]['channel']=_0x1a325d[_0xcbaa('0x79')];_0x1a325d[_0xcbaa('0x29')][_0xcbaa('0x7a')]=_0x1a325d[_0xcbaa('0x79')];_0x1a325d[_0xcbaa('0x29')][_0xcbaa('0x7b')]='accept';return respondWithRpcPromise(_0xcbaa('0x7c'),_0xcbaa('0x7c'),{'event':_0xcbaa('0x7d'),'message':_0x1a325d[_0xcbaa('0x29')]},client9002)[_0xcbaa('0x22')](function(){return _0x1a325d;});}return _0x1a325d;}return null;})[_0xcbaa('0x22')](respondWithResult(_0x54ca59,null))['catch'](handleError(_0x54ca59,null));};var interaction_log=require(_0xcbaa('0x16'))('whatsapp-interactions');exports['reject']=function(_0x652939,_0x3c79e1,_0x391e65){var _0x39251a={'agent':{},'channel':_0xcbaa('0x61')};if(_0x652939[_0xcbaa('0x5d')]['id']){delete _0x652939['body']['id'];}_0x652939[_0xcbaa('0x5d')][_0xcbaa('0x65')]=_0x652939[_0xcbaa('0x5d')][_0xcbaa('0x65')]||_0x652939[_0xcbaa('0x6b')]['id'];_0x39251a[_0xcbaa('0x66')]['id']=_0x652939['body'][_0xcbaa('0x65')];return db[_0xcbaa('0x40')]['find']({'where':{'id':_0x652939[_0xcbaa('0x58')]['id'],'UserId':null}})[_0xcbaa('0x22')](handleEntityNotFound(_0x3c79e1,null))['then'](function(_0x30faef){if(_0x30faef){_0x39251a[_0xcbaa('0x29')]=_0x30faef['get']({'plain':!![]});return db[_0xcbaa('0x7e')]['find']({'where':{'id':_0x30faef[_0xcbaa('0x7f')]}});}return null;})[_0xcbaa('0x22')](handleEntityNotFound(_0x3c79e1,null))['then'](function(_0xad8ebe){if(_0xad8ebe){_0x39251a[_0xcbaa('0x69')]=_0xad8ebe[_0xcbaa('0x80')]({'plain':!![]});interaction_log[_0xcbaa('0x2a')](_0xcbaa('0x81'),_0x652939[_0xcbaa('0x6b')]['id'],_0x652939[_0xcbaa('0x6b')][_0xcbaa('0x3c')],_0x652939[_0xcbaa('0x6b')][_0xcbaa('0x6c')],_0x39251a[_0xcbaa('0x69')]['id'],_0x652939[_0xcbaa('0x5d')]?JSON[_0xcbaa('0x26')](_0x652939[_0xcbaa('0x5d')]):_0xcbaa('0x6d'));return respondWithRpcPromise(_0xcbaa('0x82'),'rejectMessage',_0x39251a);}return null;})['then'](function(_0x3631d3){var _0x5431c8=_0xcbaa('0x6f')+_0x3631d3[_0xcbaa('0x29')]['ContactId'];return db[_0xcbaa('0x71')]['query'](_0x5431c8,{'type':db['Sequelize'][_0xcbaa('0x73')][_0xcbaa('0x74')],'raw':!![]})[_0xcbaa('0x22')](function(_0x40dea0){return _0x40dea0;});})[_0xcbaa('0x22')](function(_0x4e2692){if(_0x4e2692){_0x39251a[_0xcbaa('0x29')]['contact']=_0x4e2692[0x0];if(!_0x652939[_0xcbaa('0x5d')][_0xcbaa('0x65')])return;return db['User']['find']({'where':{'id':_0x652939[_0xcbaa('0x5d')]['UserId'],'role':_0xcbaa('0x66')},'attributes':['id','name',_0xcbaa('0x83'),_0xcbaa('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0x48d9b3){if(!_0x48d9b3)return null;_0x39251a['message'][_0xcbaa('0x66')]=_0x48d9b3;return _0x39251a;})[_0xcbaa('0x22')](function(_0x4ec4bd){if(_0x4ec4bd){_0x4ec4bd[_0xcbaa('0x29')][_0xcbaa('0x78')]=util[_0xcbaa('0x63')](_0xcbaa('0x84'),_0x652939['user'][_0xcbaa('0x3c')]);_0x4ec4bd[_0xcbaa('0x29')][_0xcbaa('0x79')]=_0x39251a[_0xcbaa('0x79')];_0x4ec4bd[_0xcbaa('0x29')][_0xcbaa('0x7a')]=_0x39251a[_0xcbaa('0x79')];_0x4ec4bd[_0xcbaa('0x29')]['event']=_0xcbaa('0x35');respondWithRpcPromise(_0xcbaa('0x7c'),_0xcbaa('0x7c'),{'event':_0xcbaa('0x85'),'message':_0x4ec4bd['message']},client9002);return _0x39251a;}return null;})[_0xcbaa('0x22')](respondWithResult(_0x3c79e1,null))['catch'](handleError(_0x3c79e1,null));};exports[_0xcbaa('0x2d')]=function(_0x207a3b,_0x470a98,_0x58eac0){if(_0x207a3b[_0xcbaa('0x5d')]['id']){delete _0x207a3b[_0xcbaa('0x5d')]['id'];}var _0x4a3c93;return db[_0xcbaa('0x40')][_0xcbaa('0x5a')]({'where':{'id':_0x207a3b[_0xcbaa('0x58')]['id']}})[_0xcbaa('0x22')](handleEntityNotFound(_0x470a98,null))[_0xcbaa('0x22')](function(_0x2e3bbf){if(_0x2e3bbf){_0x4a3c93=_0x2e3bbf;return db[_0xcbaa('0x86')][_0xcbaa('0x5a')]({'where':{'id':_0x2e3bbf['WhatsappAccountId']}});}})[_0xcbaa('0x22')](handleEntityNotFound(_0x470a98,null))[_0xcbaa('0x22')](function(_0x37e273){if(_0x37e273){logger[_0xcbaa('0x24')]('WhatsppMessage,\x20%s,\x20%s,\x20%s','status',_0xcbaa('0x87'),_0x37e273['type'],util[_0xcbaa('0x88')](_0x207a3b['body'],{'showHidden':![],'depth':null}));switch(_0x37e273['type']){case _0xcbaa('0x89'):if(_0x207a3b[_0xcbaa('0x5d')][_0xcbaa('0x8a')]&&_0x207a3b[_0xcbaa('0x5d')][_0xcbaa('0x8a')]===_0x4a3c93[_0xcbaa('0x8b')]&&_0x207a3b[_0xcbaa('0x5d')][_0xcbaa('0x8c')]&&_0x207a3b[_0xcbaa('0x5d')][_0xcbaa('0x8c')]===_0xcbaa('0x8d')){return _0x4a3c93[_0xcbaa('0x37')]({'read':!![]});}else{logger[_0xcbaa('0x27')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xcbaa('0x2d'),_0xcbaa('0x89'),util['inspect'](_0x207a3b[_0xcbaa('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x4a3c93;}})[_0xcbaa('0x22')](respondWithResult(_0x470a98,null))['catch'](handleError(_0x470a98,null));}; \ No newline at end of file +var _0x8a66=['fields','length','hasOwnProperty','nolimit','order','where','pick','type','filter','merge','options','count','includeAll','findAll','rows','show','params','include','find','create','body','update','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','isNil','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','email','rejectmessage','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','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','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','./whatsappMessage.socket','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','apply','reject','destroy','end','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x24f478,_0x305b72){var _0x1cd8b8=function(_0x382db0){while(--_0x382db0){_0x24f478['push'](_0x24f478['shift']());}};_0x1cd8b8(++_0x305b72);}(_0x8a66,0x166));var _0x68a6=function(_0x70fd53,_0x2a95a6){_0x70fd53=_0x70fd53-0x0;var _0x4b71c5=_0x8a66[_0x70fd53];return _0x4b71c5;};'use strict';var emlformat=require(_0x68a6('0x0'));var rimraf=require(_0x68a6('0x1'));var zipdir=require(_0x68a6('0x2'));var jsonpatch=require(_0x68a6('0x3'));var rp=require(_0x68a6('0x4'));var moment=require(_0x68a6('0x5'));var BPromise=require(_0x68a6('0x6'));var Mustache=require(_0x68a6('0x7'));var util=require(_0x68a6('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x68a6('0x9'));var fs=require('fs');var fs_extra=require(_0x68a6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x68a6('0xb'));var jsforce=require(_0x68a6('0xc'));var deskjs=require(_0x68a6('0xd'));var toCsv=require(_0x68a6('0xe'));var querystring=require(_0x68a6('0xf'));var Papa=require(_0x68a6('0x10'));var Redis=require(_0x68a6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x68a6('0x12'));var as=require(_0x68a6('0x13'));var hardwareService=require(_0x68a6('0x14'));var logger=require(_0x68a6('0x15'))(_0x68a6('0x16'));var utils=require(_0x68a6('0x17'));var config=require(_0x68a6('0x18'));var licenseUtil=require(_0x68a6('0x19'));var db=require(_0x68a6('0x1a'))['db'];config[_0x68a6('0x1b')]=_[_0x68a6('0x1c')](config[_0x68a6('0x1b')],{'host':_0x68a6('0x1d'),'port':0x18eb});var socket=require(_0x68a6('0x1e'))(new Redis(config['redis']));require(_0x68a6('0x1f'))['register'](socket);var jayson=require(_0x68a6('0x20'));var client=jayson[_0x68a6('0x21')][_0x68a6('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x68a6('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x1fd733,_0x51ac6d,_0x1f599d,_0x486876){return new BPromise(function(_0x2a12af,_0x5f562b){var _0x4ed667=_0x486876||client;return _0x4ed667['request'](_0x1fd733,_0x1f599d)[_0x68a6('0x23')](function(_0x90307b){logger[_0x68a6('0x24')](_0x68a6('0x25'),_0x51ac6d,_0x68a6('0x26'));logger[_0x68a6('0x27')](_0x68a6('0x28'),_0x51ac6d,_0x68a6('0x26'),JSON[_0x68a6('0x29')](_0x90307b));if(_0x90307b[_0x68a6('0x2a')]){if(_0x90307b['error'][_0x68a6('0x2b')]===0x1f4){logger[_0x68a6('0x2a')](_0x68a6('0x25'),_0x51ac6d,_0x90307b[_0x68a6('0x2a')]['message']);return _0x5f562b(_0x90307b[_0x68a6('0x2a')][_0x68a6('0x2c')]);}logger['error'](_0x68a6('0x25'),_0x51ac6d,_0x90307b['error']['message']);return _0x2a12af(_0x90307b[_0x68a6('0x2a')][_0x68a6('0x2c')]);}else{logger[_0x68a6('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x51ac6d,_0x68a6('0x26'));_0x2a12af(_0x90307b[_0x68a6('0x2d')][_0x68a6('0x2c')]);}})[_0x68a6('0x2e')](function(_0x4b1e08){logger['error'](_0x68a6('0x25'),_0x51ac6d,_0x4b1e08);_0x5f562b(_0x4b1e08);});});}function respondWithStatusCode(_0x315011,_0x4bf3e3){_0x4bf3e3=_0x4bf3e3||0xcc;return function(_0x1ee70b){if(_0x1ee70b){return _0x315011[_0x68a6('0x2f')](_0x4bf3e3);}return _0x315011[_0x68a6('0x30')](_0x4bf3e3)['end']();};}function respondWithResult(_0x28371f,_0x463f9b){_0x463f9b=_0x463f9b||0xc8;return function(_0x564c59){if(_0x564c59){return _0x28371f['status'](_0x463f9b)[_0x68a6('0x31')](_0x564c59);}};}function respondWithFilteredResult(_0x4d4ab9,_0x3475e7){return function(_0x25ad76){if(_0x25ad76){var _0x4a86cc=typeof _0x3475e7[_0x68a6('0x32')]===_0x68a6('0x33')&&typeof _0x3475e7[_0x68a6('0x34')]===_0x68a6('0x33');var _0x5d5df4=_0x25ad76['count'];var _0x15461d=_0x4a86cc?0x0:_0x3475e7[_0x68a6('0x32')];var _0x37f2a5=_0x4a86cc?_0x25ad76['count']:_0x3475e7['offset']+_0x3475e7[_0x68a6('0x34')];var _0x523cf4;if(_0x37f2a5>=_0x5d5df4){_0x37f2a5=_0x5d5df4;_0x523cf4=0xc8;}else{_0x523cf4=0xce;}_0x4d4ab9['status'](_0x523cf4);return _0x4d4ab9['set']('Content-Range',_0x15461d+'-'+_0x37f2a5+'/'+_0x5d5df4)[_0x68a6('0x31')](_0x25ad76);}return null;};}function patchUpdates(_0x5b179f){return function(_0x3f6410){try{jsonpatch[_0x68a6('0x35')](_0x3f6410,_0x5b179f,!![]);}catch(_0x55701c){return BPromise[_0x68a6('0x36')](_0x55701c);}return _0x3f6410['save']();};}function saveUpdates(_0x4f2aad,_0xc4f9f){return function(_0x904a2c){if(_0x904a2c){return _0x904a2c['update'](_0x4f2aad)['then'](function(_0x31fa5b){return _0x31fa5b;});}return null;};}function removeEntity(_0x5483c6,_0x31a014){return function(_0x558b3d){if(_0x558b3d){return _0x558b3d[_0x68a6('0x37')]()[_0x68a6('0x23')](function(){_0x5483c6[_0x68a6('0x30')](0xcc)[_0x68a6('0x38')]();});}};}function handleEntityNotFound(_0x45ad7a,_0x30b4f8){return function(_0x418caa){if(!_0x418caa){_0x45ad7a[_0x68a6('0x2f')](0x194);}return _0x418caa;};}function handleError(_0x4bebd6,_0xabe202){_0xabe202=_0xabe202||0x1f4;return function(_0x2a891c){logger[_0x68a6('0x2a')](_0x2a891c['stack']);if(_0x2a891c[_0x68a6('0x39')]){delete _0x2a891c['name'];}_0x4bebd6[_0x68a6('0x30')](_0xabe202)[_0x68a6('0x3a')](_0x2a891c);};}exports[_0x68a6('0x3b')]=function(_0x37ccc1,_0x52e7f6){var _0x192f8d={},_0x1f2060={},_0x26f30a={'count':0x0,'rows':[]};var _0x481dc8=_[_0x68a6('0x3c')](db[_0x68a6('0x3d')][_0x68a6('0x3e')],function(_0x25fb34){return{'name':_0x25fb34[_0x68a6('0x3f')],'type':_0x25fb34['type'][_0x68a6('0x40')]};});_0x1f2060[_0x68a6('0x41')]=_['map'](_0x481dc8,'name');_0x1f2060[_0x68a6('0x42')]=_[_0x68a6('0x43')](_0x37ccc1[_0x68a6('0x42')]);_0x1f2060[_0x68a6('0x44')]=_[_0x68a6('0x45')](_0x1f2060[_0x68a6('0x41')],_0x1f2060[_0x68a6('0x42')]);_0x192f8d[_0x68a6('0x46')]=_[_0x68a6('0x45')](_0x1f2060[_0x68a6('0x41')],qs[_0x68a6('0x47')](_0x37ccc1['query'][_0x68a6('0x47')]));_0x192f8d[_0x68a6('0x46')]=_0x192f8d[_0x68a6('0x46')][_0x68a6('0x48')]?_0x192f8d[_0x68a6('0x46')]:_0x1f2060['model'];if(!_0x37ccc1[_0x68a6('0x42')][_0x68a6('0x49')](_0x68a6('0x4a'))){_0x192f8d['limit']=qs[_0x68a6('0x34')](_0x37ccc1[_0x68a6('0x42')][_0x68a6('0x34')]);_0x192f8d[_0x68a6('0x32')]=qs[_0x68a6('0x32')](_0x37ccc1['query'][_0x68a6('0x32')]);}_0x192f8d[_0x68a6('0x4b')]=qs['sort'](_0x37ccc1[_0x68a6('0x42')]['sort']);_0x192f8d[_0x68a6('0x4c')]=qs['filters'](_[_0x68a6('0x4d')](_0x37ccc1[_0x68a6('0x42')],_0x1f2060[_0x68a6('0x44')]),_0x481dc8);if(_0x37ccc1[_0x68a6('0x42')]['filter']){_0x192f8d['where']=_['merge'](_0x192f8d[_0x68a6('0x4c')],{'$or':_[_0x68a6('0x3c')](_0x481dc8,function(_0x1a7d50){if(_0x1a7d50[_0x68a6('0x4e')]!=='VIRTUAL'){var _0x1e3eac={};_0x1e3eac[_0x1a7d50[_0x68a6('0x39')]]={'$like':'%'+_0x37ccc1[_0x68a6('0x42')][_0x68a6('0x4f')]+'%'};return _0x1e3eac;}})});}_0x192f8d=_[_0x68a6('0x50')]({},_0x192f8d,_0x37ccc1[_0x68a6('0x51')]);var _0x14797e={'where':_0x192f8d[_0x68a6('0x4c')]};return db[_0x68a6('0x3d')][_0x68a6('0x52')](_0x14797e)['then'](function(_0x29bf10){_0x26f30a['count']=_0x29bf10;if(_0x37ccc1[_0x68a6('0x42')][_0x68a6('0x53')]){_0x192f8d['include']=[{'all':!![]}];}return db[_0x68a6('0x3d')][_0x68a6('0x54')](_0x192f8d);})[_0x68a6('0x23')](function(_0x33d8b8){_0x26f30a[_0x68a6('0x55')]=_0x33d8b8;return _0x26f30a;})[_0x68a6('0x23')](respondWithFilteredResult(_0x52e7f6,_0x192f8d))['catch'](handleError(_0x52e7f6,null));};exports[_0x68a6('0x56')]=function(_0x52ddb5,_0xbf6d32){var _0xbf9d41={'raw':!![],'where':{'id':_0x52ddb5[_0x68a6('0x57')]['id']}},_0x303b5d={};_0x303b5d[_0x68a6('0x41')]=_[_0x68a6('0x43')](db[_0x68a6('0x3d')]['rawAttributes']);_0x303b5d[_0x68a6('0x42')]=_[_0x68a6('0x43')](_0x52ddb5[_0x68a6('0x42')]);_0x303b5d[_0x68a6('0x44')]=_[_0x68a6('0x45')](_0x303b5d[_0x68a6('0x41')],_0x303b5d['query']);_0xbf9d41[_0x68a6('0x46')]=_['intersection'](_0x303b5d[_0x68a6('0x41')],qs['fields'](_0x52ddb5[_0x68a6('0x42')][_0x68a6('0x47')]));_0xbf9d41[_0x68a6('0x46')]=_0xbf9d41['attributes'][_0x68a6('0x48')]?_0xbf9d41[_0x68a6('0x46')]:_0x303b5d[_0x68a6('0x41')];if(_0x52ddb5[_0x68a6('0x42')]['includeAll']){_0xbf9d41[_0x68a6('0x58')]=[{'all':!![]}];}_0xbf9d41=_[_0x68a6('0x50')]({},_0xbf9d41,_0x52ddb5[_0x68a6('0x51')]);return db['WhatsappMessage'][_0x68a6('0x59')](_0xbf9d41)[_0x68a6('0x23')](handleEntityNotFound(_0xbf6d32,null))['then'](respondWithResult(_0xbf6d32,null))[_0x68a6('0x2e')](handleError(_0xbf6d32,null));};exports[_0x68a6('0x5a')]=function(_0x1953d4,_0x3e4a5b){return db[_0x68a6('0x3d')][_0x68a6('0x5a')](_0x1953d4[_0x68a6('0x5b')],{})[_0x68a6('0x23')](respondWithResult(_0x3e4a5b,0xc9))[_0x68a6('0x2e')](handleError(_0x3e4a5b,null));};exports[_0x68a6('0x5c')]=function(_0x5c046b,_0x1c990d){if(_0x5c046b[_0x68a6('0x5b')]['id']){delete _0x5c046b[_0x68a6('0x5b')]['id'];}return db['WhatsappMessage'][_0x68a6('0x59')]({'where':{'id':_0x5c046b[_0x68a6('0x57')]['id']}})[_0x68a6('0x23')](handleEntityNotFound(_0x1c990d,null))[_0x68a6('0x23')](saveUpdates(_0x5c046b[_0x68a6('0x5b')],null))['then'](respondWithResult(_0x1c990d,null))[_0x68a6('0x2e')](handleError(_0x1c990d,null));};exports[_0x68a6('0x37')]=function(_0x22f112,_0x2653e8){return db[_0x68a6('0x3d')][_0x68a6('0x59')]({'where':{'id':_0x22f112[_0x68a6('0x57')]['id']}})[_0x68a6('0x23')](handleEntityNotFound(_0x2653e8,null))[_0x68a6('0x23')](removeEntity(_0x2653e8,null))[_0x68a6('0x2e')](handleError(_0x2653e8,null));};exports[_0x68a6('0x5d')]=function(_0x11c544,_0x3b12c3){return db[_0x68a6('0x3d')][_0x68a6('0x5d')]()[_0x68a6('0x23')](respondWithResult(_0x3b12c3,null))[_0x68a6('0x2e')](handleError(_0x3b12c3,null));};var interaction_log=require(_0x68a6('0x15'))(_0x68a6('0x5e'));exports[_0x68a6('0x5f')]=function(_0x1ce700,_0x17ac23,_0x52643d){var _0x3e0808={'agent':{},'channel':_0x68a6('0x60')};if(_0x1ce700['body']['id']){delete _0x1ce700[_0x68a6('0x5b')]['id'];}_0x1ce700[_0x68a6('0x5b')][_0x68a6('0x61')]=!![];_0x1ce700['body'][_0x68a6('0x62')]=moment()[_0x68a6('0x63')](_0x68a6('0x64'));_0x1ce700[_0x68a6('0x5b')]['UserId']=_0x1ce700[_0x68a6('0x5b')][_0x68a6('0x65')]||_0x1ce700[_0x68a6('0x66')]['id'];_0x3e0808['agent']['id']=_0x1ce700['body'][_0x68a6('0x65')];return db['WhatsappMessage']['find']({'where':{'id':_0x1ce700[_0x68a6('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x17ac23,null))[_0x68a6('0x23')](saveUpdates(_0x1ce700[_0x68a6('0x5b')],null))['then'](function(_0x37170c){if(_0x37170c){_0x3e0808[_0x68a6('0x2c')]=_0x37170c[_0x68a6('0x67')]({'plain':!![]});return db[_0x68a6('0x68')][_0x68a6('0x59')]({'where':{'id':_0x37170c['WhatsappInteractionId']}});}return null;})[_0x68a6('0x23')](handleEntityNotFound(_0x17ac23,null))['then'](function(_0x5abac5){if(_0x5abac5){return _0x5abac5[_0x68a6('0x5c')]({'UserId':_0x1ce700['body'][_0x68a6('0x65')],'read1stAt':_[_0x68a6('0x69')](_0x5abac5['read1stAt'])?moment()[_0x68a6('0x63')](_0x68a6('0x64')):undefined});}return null;})[_0x68a6('0x23')](function(_0x44b8de){if(_0x44b8de){_0x3e0808['interaction']=_0x44b8de[_0x68a6('0x67')]({'plain':!![]});interaction_log[_0x68a6('0x24')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1ce700[_0x68a6('0x66')]['id'],_0x1ce700[_0x68a6('0x66')][_0x68a6('0x39')],_0x1ce700[_0x68a6('0x66')][_0x68a6('0x6a')],_0x3e0808[_0x68a6('0x6b')]['id'],_0x1ce700['body']?JSON[_0x68a6('0x29')](_0x1ce700[_0x68a6('0x5b')]):_0x68a6('0x6c'));return respondWithRpcPromise(_0x68a6('0x6d'),'acceptMessage',_0x3e0808);}return null;})[_0x68a6('0x23')](function(_0x2739ec){var _0x578181=_0x68a6('0x6e')+_0x2739ec[_0x68a6('0x2c')][_0x68a6('0x6f')];return db[_0x68a6('0x70')]['query'](_0x578181,{'type':db[_0x68a6('0x71')][_0x68a6('0x72')][_0x68a6('0x73')],'raw':!![]})['then'](function(_0x366a49){return _0x366a49;});})[_0x68a6('0x23')](function(_0x3d7430){if(_0x3d7430){_0x3e0808[_0x68a6('0x2c')][_0x68a6('0x74')]=_0x3d7430[0x0];if(!_0x1ce700['body'][_0x68a6('0x65')])return;return db[_0x68a6('0x75')][_0x68a6('0x59')]({'where':{'id':_0x1ce700[_0x68a6('0x5b')]['UserId'],'role':_0x68a6('0x76')},'attributes':['id',_0x68a6('0x39'),_0x68a6('0x77'),'email',_0x68a6('0x78')],'raw':!![]});}return null;})['then'](function(_0x59a5c6){if(!_0x59a5c6)return null;_0x3e0808[_0x68a6('0x2c')][_0x68a6('0x76')]=_0x59a5c6;return _0x3e0808;})[_0x68a6('0x23')](function(_0x512834){if(_0x512834){if(_0x1ce700[_0x68a6('0x5b')][_0x68a6('0x79')]){_0x3e0808[_0x68a6('0x2c')][_0x68a6('0x7a')]=util[_0x68a6('0x63')](_0x68a6('0x7b'),_0x1ce700[_0x68a6('0x66')][_0x68a6('0x39')]);_0x3e0808['message'][_0x68a6('0x7c')]=_0x3e0808[_0x68a6('0x7c')];_0x3e0808['message'][_0x68a6('0x7d')]=_0x3e0808[_0x68a6('0x7c')];_0x3e0808['message'][_0x68a6('0x7e')]='accept';return respondWithRpcPromise(_0x68a6('0x7f'),'EventManager',{'event':'acceptmessage','message':_0x3e0808[_0x68a6('0x2c')]},client9002)[_0x68a6('0x23')](function(){return _0x3e0808;});}return _0x3e0808;}return null;})[_0x68a6('0x23')](respondWithResult(_0x17ac23,null))[_0x68a6('0x2e')](handleError(_0x17ac23,null));};var interaction_log=require(_0x68a6('0x15'))(_0x68a6('0x5e'));exports[_0x68a6('0x36')]=function(_0x2c4f71,_0x444ee5,_0xe02943){var _0x2d86c4={'agent':{},'channel':'whatsapp'};if(_0x2c4f71[_0x68a6('0x5b')]['id']){delete _0x2c4f71['body']['id'];}_0x2c4f71['body']['UserId']=_0x2c4f71['body'][_0x68a6('0x65')]||_0x2c4f71[_0x68a6('0x66')]['id'];_0x2d86c4[_0x68a6('0x76')]['id']=_0x2c4f71['body']['UserId'];return db['WhatsappMessage'][_0x68a6('0x59')]({'where':{'id':_0x2c4f71[_0x68a6('0x57')]['id'],'UserId':null}})[_0x68a6('0x23')](handleEntityNotFound(_0x444ee5,null))['then'](function(_0x231d55){if(_0x231d55){_0x2d86c4[_0x68a6('0x2c')]=_0x231d55[_0x68a6('0x67')]({'plain':!![]});return db['WhatsappInteraction'][_0x68a6('0x59')]({'where':{'id':_0x231d55[_0x68a6('0x80')]}});}return null;})[_0x68a6('0x23')](handleEntityNotFound(_0x444ee5,null))['then'](function(_0x18ac6c){if(_0x18ac6c){_0x2d86c4[_0x68a6('0x6b')]=_0x18ac6c[_0x68a6('0x67')]({'plain':!![]});interaction_log[_0x68a6('0x24')](_0x68a6('0x81'),_0x2c4f71[_0x68a6('0x66')]['id'],_0x2c4f71[_0x68a6('0x66')][_0x68a6('0x39')],_0x2c4f71['user'][_0x68a6('0x6a')],_0x2d86c4[_0x68a6('0x6b')]['id'],_0x2c4f71[_0x68a6('0x5b')]?JSON[_0x68a6('0x29')](_0x2c4f71['body']):'null');return respondWithRpcPromise(_0x68a6('0x82'),'rejectMessage',_0x2d86c4);}return null;})['then'](function(_0x374ed2){var _0xc97200=_0x68a6('0x6e')+_0x374ed2['message'][_0x68a6('0x6f')];return db[_0x68a6('0x70')][_0x68a6('0x42')](_0xc97200,{'type':db['Sequelize'][_0x68a6('0x72')][_0x68a6('0x73')],'raw':!![]})[_0x68a6('0x23')](function(_0x47eaa6){return _0x47eaa6;});})[_0x68a6('0x23')](function(_0x466a0d){if(_0x466a0d){_0x2d86c4['message']['contact']=_0x466a0d[0x0];if(!_0x2c4f71[_0x68a6('0x5b')]['UserId'])return;return db[_0x68a6('0x75')][_0x68a6('0x59')]({'where':{'id':_0x2c4f71[_0x68a6('0x5b')][_0x68a6('0x65')],'role':_0x68a6('0x76')},'attributes':['id','name',_0x68a6('0x77'),_0x68a6('0x83'),_0x68a6('0x78')],'raw':!![]});}return null;})[_0x68a6('0x23')](function(_0x1a556c){if(!_0x1a556c)return null;_0x2d86c4[_0x68a6('0x2c')]['agent']=_0x1a556c;return _0x2d86c4;})[_0x68a6('0x23')](function(_0x26a9d4){if(_0x26a9d4){_0x26a9d4[_0x68a6('0x2c')][_0x68a6('0x7a')]=util[_0x68a6('0x63')](_0x68a6('0x7b'),_0x2c4f71[_0x68a6('0x66')][_0x68a6('0x39')]);_0x26a9d4[_0x68a6('0x2c')]['channel']=_0x2d86c4[_0x68a6('0x7c')];_0x26a9d4[_0x68a6('0x2c')][_0x68a6('0x7d')]=_0x2d86c4[_0x68a6('0x7c')];_0x26a9d4[_0x68a6('0x2c')]['event']=_0x68a6('0x36');respondWithRpcPromise(_0x68a6('0x7f'),'EventManager',{'event':_0x68a6('0x84'),'message':_0x26a9d4[_0x68a6('0x2c')]},client9002);return _0x2d86c4;}return null;})['then'](respondWithResult(_0x444ee5,null))[_0x68a6('0x2e')](handleError(_0x444ee5,null));};exports[_0x68a6('0x30')]=function(_0x8ab34e,_0x3d515e,_0x205b3f){if(_0x8ab34e[_0x68a6('0x5b')]['id']){delete _0x8ab34e[_0x68a6('0x5b')]['id'];}var _0x5e6017;return db[_0x68a6('0x3d')][_0x68a6('0x59')]({'where':{'id':_0x8ab34e[_0x68a6('0x57')]['id']}})['then'](handleEntityNotFound(_0x3d515e,null))[_0x68a6('0x23')](function(_0x814eb0){if(_0x814eb0){_0x5e6017=_0x814eb0;return db[_0x68a6('0x85')][_0x68a6('0x59')]({'where':{'id':_0x814eb0[_0x68a6('0x86')]}});}})['then'](handleEntityNotFound(_0x3d515e,null))[_0x68a6('0x23')](function(_0x46ce17){if(_0x46ce17){logger[_0x68a6('0x27')](_0x68a6('0x87'),_0x68a6('0x30'),_0x68a6('0x88'),_0x46ce17[_0x68a6('0x4e')],util['inspect'](_0x8ab34e[_0x68a6('0x5b')],{'showHidden':![],'depth':null}));switch(_0x46ce17[_0x68a6('0x4e')]){case _0x68a6('0x89'):if(_0x8ab34e[_0x68a6('0x5b')]['MessageSid']&&_0x8ab34e['body'][_0x68a6('0x8a')]===_0x5e6017[_0x68a6('0x8b')]&&_0x8ab34e[_0x68a6('0x5b')][_0x68a6('0x8c')]&&_0x8ab34e[_0x68a6('0x5b')][_0x68a6('0x8c')]==='read'){return _0x5e6017[_0x68a6('0x5c')]({'read':!![]});}else{logger[_0x68a6('0x2a')](_0x68a6('0x8d'),_0x68a6('0x30'),_0x68a6('0x89'),util[_0x68a6('0x8e')](_0x8ab34e[_0x68a6('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x5e6017;}})[_0x68a6('0x23')](respondWithResult(_0x3d515e,null))['catch'](handleError(_0x3d515e,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 4bc8f40..12c986f 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 _0x0db9=['hook','exports','events','save','update','emit','hasOwnProperty'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0db9,0xa3));var _0x90db=function(_0xa4f636,_0xaca1b6){_0xa4f636=_0xa4f636-0x0;var _0x37e02a=_0x0db9[_0xa4f636];return _0x37e02a;};'use strict';var EventEmitter=require(_0x90db('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x90db('0x1'),'afterUpdate':_0x90db('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2da262){return function(_0x500dcf,_0x1e0f41,_0x29b59f){WhatsappMessageEvents['emit'](_0x2da262+':'+_0x500dcf['id'],_0x500dcf);WhatsappMessageEvents[_0x90db('0x3')](_0x2da262,_0x500dcf);_0x29b59f(null);};}for(var e in events){if(events[_0x90db('0x4')](e)){var event=events[e];WhatsappMessage[_0x90db('0x5')](e,emitEvent(event));}}module[_0x90db('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0x91a7=['../../mysqldb','WhatsappMessage','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x91a7,0xe7));var _0x791a=function(_0x175676,_0x1c4484){_0x175676=_0x175676-0x0;var _0x326bd7=_0x91a7[_0x175676];return _0x326bd7;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x791a('0x0'))['db'][_0x791a('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x791a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x791a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2f6392){return function(_0x535640,_0x50ab29,_0x32fe2b){WhatsappMessageEvents[_0x791a('0x4')](_0x2f6392+':'+_0x535640['id'],_0x535640);WhatsappMessageEvents['emit'](_0x2f6392,_0x535640);_0x32fe2b(null);};}for(var e in events){if(events[_0x791a('0x5')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x791a('0x6')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 0882796..4d553f3 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 _0x8e90=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','catch','WhatsappAccountId','type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','/api/whatsapp/messages/','/status?token=','token','then','sid','error','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','LOG\x20~\x20~\x20SEND','statuses','message_id','log','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x5863c6,_0x2ec61b){var _0x4811ed=function(_0x476d67){while(--_0x476d67){_0x5863c6['push'](_0x5863c6['shift']());}};_0x4811ed(++_0x2ec61b);}(_0x8e90,0xfc));var _0x08e9=function(_0x148785,_0x195ee5){_0x148785=_0x148785-0x0;var _0x17a172=_0x8e90[_0x148785];return _0x17a172;};'use strict';var _=require(_0x08e9('0x0'));var util=require(_0x08e9('0x1'));var logger=require(_0x08e9('0x2'))(_0x08e9('0x3'));var moment=require(_0x08e9('0x4'));var BPromise=require(_0x08e9('0x5'));var rp=require(_0x08e9('0x6'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x08e9('0x7'));var rimraf=require(_0x08e9('0x8'));var config=require(_0x08e9('0x9'));var attributes=require(_0x08e9('0xa'));module[_0x08e9('0xb')]=function(_0x1be814,_0x5be5a5){return _0x1be814['define'](_0x08e9('0xc'),attributes,{'tableName':_0x08e9('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x08e9('0xe')]},{'name':_0x08e9('0xf'),'fields':[_0x08e9('0x10')],'type':_0x08e9('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c4c4b,_0x39889f,_0x215c80){var _0x5c6b9b=_0x1be814['models'];var _0x5c1298=_0x5c4c4b['get']({'plain':!![]});if(_0x5c1298[_0x08e9('0x12')][_0x08e9('0x13')]()==='in'||_0x5c1298[_0x08e9('0x12')][_0x08e9('0x13')]()===_0x08e9('0x14')&&!_0x5c1298[_0x08e9('0x15')]&&!_[_0x08e9('0x16')](_0x5c1298[_0x08e9('0x17')])){_0x5c6b9b[_0x08e9('0x18')][_0x08e9('0x19')]({'where':{'id':_0x5c1298[_0x08e9('0x1a')]}})['then'](function(_0x304fef){if(_0x304fef){_0x304fef[_0x08e9('0x1b')]({'lastMsgAt':_0x5c1298[_0x08e9('0x1c')],'lastMsgDirection':_0x5c1298['direction'][_0x08e9('0x13')]()});}})[_0x08e9('0x1d')](function(_0x3bdcd3){console['error'](_0x3bdcd3);});}if(_0x5c1298[_0x08e9('0x12')]==='out'&&!_0x5c1298[_0x08e9('0x15')]){var _0x33a6fb;_0x5c6b9b['WhatsappAccount']['find']({'where':{'id':_0x5c1298[_0x08e9('0x1e')]},'raw':!![]})['then'](function(_0x872425){_0x33a6fb=_0x872425;if(_0x33a6fb&&_0x33a6fb[_0x08e9('0x1f')]){switch(_0x33a6fb[_0x08e9('0x1f')]){case _0x08e9('0x20'):var _0x589f05=require('twilio');if(_0x33a6fb[_0x08e9('0x21')]&&_0x33a6fb[_0x08e9('0x22')]&&_0x33a6fb['phone']){var _0x4c773e=new _0x589f05(_0x33a6fb[_0x08e9('0x21')],_0x33a6fb['authToken']);_0x4c773e[_0x08e9('0x23')][_0x08e9('0x24')]({'body':_0x5c1298[_0x08e9('0x10')],'to':_0x08e9('0x25')+_0x5c1298['phone'],'from':_0x08e9('0x25')+_0x33a6fb[_0x08e9('0x26')],'statusCallback':_0x33a6fb['remote']+_0x08e9('0x27')+_0x5c1298['id']+_0x08e9('0x28')+_0x33a6fb[_0x08e9('0x29')]})[_0x08e9('0x2a')](function(_0x589734){if(_0x589734[_0x08e9('0x2b')]){return _0x5c4c4b[_0x08e9('0x1b')]({'messageId':_0x589734['sid']});}})[_0x08e9('0x1d')](function(_0x5b9842){logger[_0x08e9('0x2c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x08e9('0x2d'),'twilio',util[_0x08e9('0x2e')](_0x5b9842,{'showHidden':![],'depth':null}));});}else{logger[_0x08e9('0x2c')](_0x08e9('0x2f'),_0x08e9('0x2d'),_0x08e9('0x20'),_0x08e9('0x30'));}break;case _0x08e9('0x31'):var _0x166e02=_0x33a6fb[_0x08e9('0x21')];var _0x3307eb=_0x33a6fb[_0x08e9('0x26')];var _0x588ae0=_0x33a6fb['authToken'];var _0x582fed=_0x33a6fb[_0x08e9('0x32')]+_0x08e9('0x33')+_0x166e02+_0x08e9('0x34');var _0x447d16={'to':[_0x5c1298['phone']],'message':{'type':_0x08e9('0x35'),'text':_0x5c1298['body']}};var _0x3cdb86={'method':_0x08e9('0x36'),'uri':_0x582fed,'headers':{'Authorization':_0x08e9('0x37')+_0x588ae0,'Content-Type':_0x08e9('0x38')},'body':_0x447d16,'json':!![]};rp(_0x3cdb86)['then'](function(_0x35ee1b){console['log'](_0x08e9('0x39'),_0x35ee1b);if(_0x35ee1b[_0x08e9('0x3a')][0x0][_0x08e9('0x3b')]){return _0x5c4c4b[_0x08e9('0x1b')]({'messageId':_0x35ee1b[_0x08e9('0x3a')][0x0]['message_id']});}})[_0x08e9('0x1d')](function(_0x3f6d6a){console[_0x08e9('0x3c')](_0x3f6d6a);});break;}}})[_0x08e9('0x3d')](function(){_0x215c80();});}else{_0x215c80();}}},'charset':_0x08e9('0x3e'),'collate':_0x08e9('0x3f')});}; \ No newline at end of file +var _0x3988=['lodash','util','../../config/logger','moment','request-promise','node-fetch','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','UserId','WhatsappInteraction','findOne','then','update','error','secret','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','whatsapp:','remote','/api/whatsapp/messages/','token','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','/messages/','POST','Bearer\x20','application/json','log','LOG\x20~\x20~\x20SEND','statuses','message_id','finally','utf8mb4','utf8mb4_unicode_ci'];(function(_0x9d0c07,_0xde4af2){var _0x28029d=function(_0x54444a){while(--_0x54444a){_0x9d0c07['push'](_0x9d0c07['shift']());}};_0x28029d(++_0xde4af2);}(_0x3988,0x17a));var _0x8398=function(_0x36707e,_0x45ebfb){_0x36707e=_0x36707e-0x0;var _0x59044b=_0x3988[_0x36707e];return _0x59044b;};'use strict';var _=require(_0x8398('0x0'));var util=require(_0x8398('0x1'));var logger=require(_0x8398('0x2'))('api');var moment=require(_0x8398('0x3'));var BPromise=require('bluebird');var rp=require(_0x8398('0x4'));var fetch=require(_0x8398('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8398('0x6'));var config=require(_0x8398('0x7'));var attributes=require(_0x8398('0x8'));module[_0x8398('0x9')]=function(_0x267b75,_0x7f9ef0){return _0x267b75['define'](_0x8398('0xa'),attributes,{'tableName':_0x8398('0xb'),'paranoid':![],'indexes':[{'name':_0x8398('0xc'),'fields':[_0x8398('0xc')]},{'name':'fti_whatsapp_messages','fields':[_0x8398('0xd')],'type':_0x8398('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x54158b,_0x974b86,_0x1fa8c9){var _0x29efe8=_0x267b75[_0x8398('0xf')];var _0x35e02f=_0x54158b[_0x8398('0x10')]({'plain':!![]});if(_0x35e02f[_0x8398('0x11')][_0x8398('0x12')]()==='in'||_0x35e02f[_0x8398('0x11')][_0x8398('0x12')]()===_0x8398('0x13')&&!_0x35e02f['secret']&&!_['isNil'](_0x35e02f[_0x8398('0x14')])){_0x29efe8[_0x8398('0x15')][_0x8398('0x16')]({'where':{'id':_0x35e02f['WhatsappInteractionId']}})[_0x8398('0x17')](function(_0x258ae5){if(_0x258ae5){_0x258ae5[_0x8398('0x18')]({'lastMsgAt':_0x35e02f['createdAt'],'lastMsgDirection':_0x35e02f['direction']['toLowerCase']()});}})['catch'](function(_0x3d5249){console[_0x8398('0x19')](_0x3d5249);});}if(_0x35e02f[_0x8398('0x11')]==='out'&&!_0x35e02f[_0x8398('0x1a')]){var _0x221f63;_0x29efe8['WhatsappAccount']['find']({'where':{'id':_0x35e02f[_0x8398('0x1b')]},'raw':!![]})[_0x8398('0x17')](function(_0x16a989){_0x221f63=_0x16a989;if(_0x221f63&&_0x221f63[_0x8398('0x1c')]){switch(_0x221f63[_0x8398('0x1c')]){case _0x8398('0x1d'):var _0x13f856=require(_0x8398('0x1d'));if(_0x221f63[_0x8398('0x1e')]&&_0x221f63[_0x8398('0x1f')]&&_0x221f63[_0x8398('0x20')]){var _0x451645=new _0x13f856(_0x221f63[_0x8398('0x1e')],_0x221f63['authToken']);_0x451645[_0x8398('0x21')]['create']({'body':_0x35e02f[_0x8398('0xd')],'to':_0x8398('0x22')+_0x35e02f[_0x8398('0x20')],'from':_0x8398('0x22')+_0x221f63[_0x8398('0x20')],'statusCallback':_0x221f63[_0x8398('0x23')]+_0x8398('0x24')+_0x35e02f['id']+'/status?token='+_0x221f63[_0x8398('0x25')]})['then'](function(_0x433ede){if(_0x433ede['sid']){return _0x54158b[_0x8398('0x18')]({'messageId':_0x433ede['sid']});}})[_0x8398('0x26')](function(_0x1410d3){logger[_0x8398('0x19')](_0x8398('0x27'),_0x8398('0x28'),_0x8398('0x1d'),util[_0x8398('0x29')](_0x1410d3,{'showHidden':![],'depth':null}));});}else{logger[_0x8398('0x19')](_0x8398('0x27'),_0x8398('0x28'),_0x8398('0x1d'),_0x8398('0x2a'));}break;case'sinch':var _0x1063cc=_0x221f63[_0x8398('0x1e')];var _0xbef39=_0x221f63[_0x8398('0x20')];var _0xb1e117=_0x221f63[_0x8398('0x1f')];var _0x8dabad=_0x221f63['baseUrl']+'/whatsapp/v1/'+_0x1063cc+_0x8398('0x2b');var _0x286651={'to':[_0x35e02f['phone']],'message':{'type':'text','text':_0x35e02f['body']}};var _0x338965={'method':_0x8398('0x2c'),'uri':_0x8dabad,'headers':{'Authorization':_0x8398('0x2d')+_0xb1e117,'Content-Type':_0x8398('0x2e')},'body':_0x286651,'json':!![]};rp(_0x338965)[_0x8398('0x17')](function(_0x37da1b){console[_0x8398('0x2f')](_0x8398('0x30'),_0x37da1b);if(_0x37da1b['statuses'][0x0]['message_id']){return _0x54158b[_0x8398('0x18')]({'messageId':_0x37da1b[_0x8398('0x31')][0x0][_0x8398('0x32')]});}})['catch'](function(_0x7b37e9){console[_0x8398('0x2f')](_0x7b37e9);});break;}}})[_0x8398('0x33')](function(){_0x1fa8c9();});}else{_0x1fa8c9();}}},'charset':_0x8398('0x34'),'collate':_0x8398('0x35')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index da37251..09e44ec 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 _0x5ae8=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./whatsappMessage.socket','register','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','CreateWhatsappMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird'];(function(_0x380a3f,_0x202483){var _0x2b4eca=function(_0x1e99b2){while(--_0x1e99b2){_0x380a3f['push'](_0x380a3f['shift']());}};_0x2b4eca(++_0x202483);}(_0x5ae8,0xea));var _0x85ae=function(_0x2cdc34,_0x15e0c1){_0x2cdc34=_0x2cdc34-0x0;var _0x2be714=_0x5ae8[_0x2cdc34];return _0x2be714;};'use strict';var _=require(_0x85ae('0x0'));var util=require(_0x85ae('0x1'));var moment=require(_0x85ae('0x2'));var BPromise=require(_0x85ae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85ae('0x4'));var db=require(_0x85ae('0x5'))['db'];var utils=require(_0x85ae('0x6'));var logger=require('../../config/logger')(_0x85ae('0x7'));var config=require(_0x85ae('0x8'));var jayson=require(_0x85ae('0x9'));var client=jayson[_0x85ae('0xa')][_0x85ae('0xb')]({'port':0x232a});config['redis']=_[_0x85ae('0xc')](config[_0x85ae('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x85ae('0xe'))(new Redis(config[_0x85ae('0xd')]));require(_0x85ae('0xf'))[_0x85ae('0x10')](socket);function respondWithRpcPromise(_0x24833b,_0x54a6be,_0x29965c){return new BPromise(function(_0x2f4e8e,_0xb9d33){return client[_0x85ae('0x11')](_0x24833b,_0x29965c)[_0x85ae('0x12')](function(_0x28a5da){logger['info'](_0x85ae('0x13'),_0x54a6be,_0x85ae('0x14'));logger[_0x85ae('0x15')](_0x85ae('0x16'),_0x54a6be,_0x85ae('0x14'),JSON['stringify'](_0x28a5da));if(_0x28a5da[_0x85ae('0x17')]){if(_0x28a5da[_0x85ae('0x17')][_0x85ae('0x18')]===0x1f4){logger[_0x85ae('0x17')](_0x85ae('0x13'),_0x54a6be,_0x28a5da['error'][_0x85ae('0x19')]);return _0xb9d33(_0x28a5da['error']['message']);}logger[_0x85ae('0x17')](_0x85ae('0x13'),_0x54a6be,_0x28a5da['error']['message']);return _0x2f4e8e(_0x28a5da[_0x85ae('0x17')][_0x85ae('0x19')]);}else{logger[_0x85ae('0x1a')](_0x85ae('0x13'),_0x54a6be,_0x85ae('0x14'));_0x2f4e8e(_0x28a5da['result'][_0x85ae('0x19')]);}})[_0x85ae('0x1b')](function(_0x1bbb17){logger[_0x85ae('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x54a6be,_0x1bbb17);_0xb9d33(_0x1bbb17);});});}exports[_0x85ae('0x1c')]=function(_0x529a77){var _0xf014ac=this;return new Promise(function(_0x140eec,_0x2f98e3){return db['WhatsappMessage'][_0x85ae('0x1d')](_0x529a77[_0x85ae('0x1e')],{'raw':_0x529a77[_0x85ae('0x1f')]?_0x529a77[_0x85ae('0x1f')][_0x85ae('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x196b86){logger[_0x85ae('0x1a')]('CreateWhatsappMessage',_0x529a77);logger[_0x85ae('0x15')]('CreateWhatsappMessage',_0x529a77,JSON[_0x85ae('0x21')](_0x196b86));_0x140eec(_0x196b86);})['catch'](function(_0x5d1c01){logger[_0x85ae('0x17')]('CreateWhatsappMessage',_0x5d1c01[_0x85ae('0x19')],_0x529a77);_0x2f98e3(_0xf014ac[_0x85ae('0x17')](0x1f4,_0x5d1c01['message']));});});}; \ No newline at end of file +var _0x92cd=['message','result','CreateWhatsappMessage','WhatsappMessage','create','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','./whatsappMessage.socket','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s'];(function(_0x3f32b8,_0x2b6e83){var _0x41bca7=function(_0x3a2360){while(--_0x3a2360){_0x3f32b8['push'](_0x3f32b8['shift']());}};_0x41bca7(++_0x2b6e83);}(_0x92cd,0x1a8));var _0xd92c=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x92cd[_0x28aea5];return _0x6a55f9;};'use strict';var _=require(_0xd92c('0x0'));var util=require(_0xd92c('0x1'));var moment=require(_0xd92c('0x2'));var BPromise=require(_0xd92c('0x3'));var rs=require(_0xd92c('0x4'));var fs=require('fs');var Redis=require(_0xd92c('0x5'));var db=require(_0xd92c('0x6'))['db'];var utils=require(_0xd92c('0x7'));var logger=require(_0xd92c('0x8'))(_0xd92c('0x9'));var config=require('../../config/environment');var jayson=require(_0xd92c('0xa'));var client=jayson[_0xd92c('0xb')][_0xd92c('0xc')]({'port':0x232a});config['redis']=_[_0xd92c('0xd')](config['redis'],{'host':_0xd92c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd92c('0xf'))['register'](socket);function respondWithRpcPromise(_0x502ab1,_0x5066c9,_0xe2573b){return new BPromise(function(_0x3c1ac7,_0x1bd864){return client['request'](_0x502ab1,_0xe2573b)[_0xd92c('0x10')](function(_0x1bd9f5){logger[_0xd92c('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x5066c9,_0xd92c('0x12'));logger['debug'](_0xd92c('0x13'),_0x5066c9,_0xd92c('0x12'),JSON[_0xd92c('0x14')](_0x1bd9f5));if(_0x1bd9f5[_0xd92c('0x15')]){if(_0x1bd9f5[_0xd92c('0x15')][_0xd92c('0x16')]===0x1f4){logger[_0xd92c('0x15')](_0xd92c('0x17'),_0x5066c9,_0x1bd9f5[_0xd92c('0x15')][_0xd92c('0x18')]);return _0x1bd864(_0x1bd9f5['error']['message']);}logger[_0xd92c('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x5066c9,_0x1bd9f5['error']['message']);return _0x3c1ac7(_0x1bd9f5[_0xd92c('0x15')]['message']);}else{logger[_0xd92c('0x11')](_0xd92c('0x17'),_0x5066c9,'request\x20sent');_0x3c1ac7(_0x1bd9f5[_0xd92c('0x19')][_0xd92c('0x18')]);}})['catch'](function(_0x5a043e){logger[_0xd92c('0x15')](_0xd92c('0x17'),_0x5066c9,_0x5a043e);_0x1bd864(_0x5a043e);});});}exports[_0xd92c('0x1a')]=function(_0x351fda){var _0x4a815b=this;return new Promise(function(_0x176c4a,_0x2e1089){return db[_0xd92c('0x1b')][_0xd92c('0x1c')](_0x351fda['body'],{'raw':_0x351fda[_0xd92c('0x1d')]?_0x351fda[_0xd92c('0x1d')][_0xd92c('0x1e')]===undefined?!![]:![]:!![]})[_0xd92c('0x10')](function(_0x4ce065){logger[_0xd92c('0x11')](_0xd92c('0x1a'),_0x351fda);logger[_0xd92c('0x1f')](_0xd92c('0x1a'),_0x351fda,JSON['stringify'](_0x4ce065));_0x176c4a(_0x4ce065);})['catch'](function(_0x1a38cb){logger[_0xd92c('0x15')](_0xd92c('0x1a'),_0x1a38cb[_0xd92c('0x18')],_0x351fda);_0x2e1089(_0x4a815b[_0xd92c('0x15')](0x1f4,_0x1a38cb[_0xd92c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 4d160df..84234b7 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 _0x37f9=['save','remove','update','emit','removeListener','length','whatsappMessage:','./whatsappMessage.events'];(function(_0x50dd61,_0x5149cb){var _0x5217b2=function(_0x2c523f){while(--_0x2c523f){_0x50dd61['push'](_0x50dd61['shift']());}};_0x5217b2(++_0x5149cb);}(_0x37f9,0x77));var _0x937f=function(_0x444c2b,_0x1d9920){_0x444c2b=_0x444c2b-0x0;var _0x333ed0=_0x37f9[_0x444c2b];return _0x333ed0;};'use strict';var WhatsappMessageEvents=require(_0x937f('0x0'));var events=[_0x937f('0x1'),_0x937f('0x2'),_0x937f('0x3')];function createListener(_0x1da8a1,_0x1e40cb){return function(_0x2532b7){_0x1e40cb[_0x937f('0x4')](_0x1da8a1,_0x2532b7);};}function removeListener(_0x5348f5,_0x381f97){return function(){WhatsappMessageEvents[_0x937f('0x5')](_0x5348f5,_0x381f97);};}exports['register']=function(_0xd35bf8){for(var _0x610dbd=0x0,_0x4d819d=events[_0x937f('0x6')];_0x610dbd<_0x4d819d;_0x610dbd++){var _0x64bd7e=events[_0x610dbd];var _0x404f03=createListener(_0x937f('0x7')+_0x64bd7e,_0xd35bf8);WhatsappMessageEvents['on'](_0x64bd7e,_0x404f03);}}; \ No newline at end of file +var _0x99ff=['./whatsappMessage.events','save','remove','update','emit','removeListener','register','length','whatsappMessage:'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x99ff,0xbd));var _0xf99f=function(_0x24783a,_0x75041){_0x24783a=_0x24783a-0x0;var _0x227a77=_0x99ff[_0x24783a];return _0x227a77;};'use strict';var WhatsappMessageEvents=require(_0xf99f('0x0'));var events=[_0xf99f('0x1'),_0xf99f('0x2'),_0xf99f('0x3')];function createListener(_0x2d4113,_0x448d61){return function(_0x58c6b8){_0x448d61[_0xf99f('0x4')](_0x2d4113,_0x58c6b8);};}function removeListener(_0x2f3f46,_0x5c5679){return function(){WhatsappMessageEvents[_0xf99f('0x5')](_0x2f3f46,_0x5c5679);};}exports[_0xf99f('0x6')]=function(_0x220c6c){for(var _0xa7977b=0x0,_0x568752=events[_0xf99f('0x7')];_0xa7977b<_0x568752;_0xa7977b++){var _0x192e54=events[_0xa7977b];var _0x25703a=createListener(_0xf99f('0x8')+_0x192e54,_0x220c6c);WhatsappMessageEvents['on'](_0x192e54,_0x25703a);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 2b5b6ea..443f8a9 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 _0x6b5d=['getTeams','/:id/users','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers'];(function(_0xb61399,_0x413936){var _0x2d7aba=function(_0x4fc888){while(--_0x4fc888){_0xb61399['push'](_0xb61399['shift']());}};_0x2d7aba(++_0x413936);}(_0x6b5d,0x9e));var _0xd6b5=function(_0x510da7,_0x49def9){_0x510da7=_0x510da7-0x0;var _0x337e96=_0x6b5d[_0x510da7];return _0x337e96;};'use strict';var multer=require(_0xd6b5('0x0'));var util=require(_0xd6b5('0x1'));var path=require(_0xd6b5('0x2'));var timeout=require(_0xd6b5('0x3'));var express=require('express');var router=express[_0xd6b5('0x4')]();var fs_extra=require(_0xd6b5('0x5'));var auth=require(_0xd6b5('0x6'));var interaction=require(_0xd6b5('0x7'));var config=require('../../config/environment');var controller=require(_0xd6b5('0x8'));router[_0xd6b5('0x9')]('/',auth[_0xd6b5('0xa')](),controller[_0xd6b5('0xb')]);router[_0xd6b5('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xd6b5('0xc')]);router[_0xd6b5('0x9')](_0xd6b5('0xd'),auth[_0xd6b5('0xa')](),controller['show']);router[_0xd6b5('0x9')](_0xd6b5('0xe'),auth[_0xd6b5('0xa')](),controller[_0xd6b5('0xf')]);router[_0xd6b5('0x9')]('/:id/teams',auth[_0xd6b5('0xa')](),controller[_0xd6b5('0x10')]);router[_0xd6b5('0x9')](_0xd6b5('0x11'),auth[_0xd6b5('0xa')](),controller['getAgents']);router[_0xd6b5('0x12')]('/',auth[_0xd6b5('0xa')](),controller[_0xd6b5('0x13')]);router[_0xd6b5('0x12')](_0xd6b5('0x14'),auth[_0xd6b5('0xa')](),controller[_0xd6b5('0x15')]);router['post']('/:id/users',auth[_0xd6b5('0xa')](),controller[_0xd6b5('0x16')]);router[_0xd6b5('0x17')](_0xd6b5('0xd'),auth[_0xd6b5('0xa')](),controller[_0xd6b5('0x18')]);router[_0xd6b5('0x19')](_0xd6b5('0xd'),auth['isAuthenticated'](),controller[_0xd6b5('0x1a')]);router['delete'](_0xd6b5('0x14'),auth[_0xd6b5('0xa')](),controller[_0xd6b5('0x1b')]);router[_0xd6b5('0x19')](_0xd6b5('0x11'),auth[_0xd6b5('0xa')](),controller['removeAgents']);module[_0xd6b5('0x1c')]=router; \ No newline at end of file +var _0x5ace=['show','/:id/members','getMembers','getTeams','getAgents','addTeams','post','/:id/users','put','update','delete','destroy','/:id/teams','removeTeams','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','/describe','/:id'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5ace,0xb7));var _0xe5ac=function(_0x279f6d,_0x122316){_0x279f6d=_0x279f6d-0x0;var _0x5874a5=_0x5ace[_0x279f6d];return _0x5874a5;};'use strict';var multer=require(_0xe5ac('0x0'));var util=require('util');var path=require(_0xe5ac('0x1'));var timeout=require(_0xe5ac('0x2'));var express=require(_0xe5ac('0x3'));var router=express[_0xe5ac('0x4')]();var fs_extra=require(_0xe5ac('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe5ac('0x6'));var config=require(_0xe5ac('0x7'));var controller=require(_0xe5ac('0x8'));router[_0xe5ac('0x9')]('/',auth[_0xe5ac('0xa')](),controller['index']);router['get'](_0xe5ac('0xb'),auth[_0xe5ac('0xa')](),controller['describe']);router[_0xe5ac('0x9')](_0xe5ac('0xc'),auth[_0xe5ac('0xa')](),controller[_0xe5ac('0xd')]);router['get'](_0xe5ac('0xe'),auth['isAuthenticated'](),controller[_0xe5ac('0xf')]);router[_0xe5ac('0x9')]('/:id/teams',auth[_0xe5ac('0xa')](),controller[_0xe5ac('0x10')]);router[_0xe5ac('0x9')]('/:id/users',auth[_0xe5ac('0xa')](),controller[_0xe5ac('0x11')]);router['post']('/',auth[_0xe5ac('0xa')](),controller['create']);router['post']('/:id/teams',auth[_0xe5ac('0xa')](),controller[_0xe5ac('0x12')]);router[_0xe5ac('0x13')](_0xe5ac('0x14'),auth[_0xe5ac('0xa')](),controller['addAgents']);router[_0xe5ac('0x15')](_0xe5ac('0xc'),auth['isAuthenticated'](),controller[_0xe5ac('0x16')]);router[_0xe5ac('0x17')]('/:id',auth[_0xe5ac('0xa')](),controller[_0xe5ac('0x18')]);router[_0xe5ac('0x17')](_0xe5ac('0x19'),auth[_0xe5ac('0xa')](),controller[_0xe5ac('0x1a')]);router[_0xe5ac('0x17')](_0xe5ac('0x14'),auth[_0xe5ac('0xa')](),controller['removeAgents']);module[_0xe5ac('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 0803998..efb3d62 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 _0xb16f=['beepall','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x21ad57,_0xcb98cd){var _0x27ce7f=function(_0x56f42c){while(--_0x56f42c){_0x21ad57['push'](_0x21ad57['shift']());}};_0x27ce7f(++_0xcb98cd);}(_0xb16f,0xf6));var _0xfb16=function(_0x1d90ca,_0x3bab16){_0x1d90ca=_0x1d90ca-0x0;var _0x28872b=_0xb16f[_0x1d90ca];return _0x28872b;};'use strict';var Sequelize=require(_0xfb16('0x0'));module[_0xfb16('0x1')]={'name':{'type':Sequelize[_0xfb16('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xfb16('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfb16('0x4')](_0xfb16('0x5'),_0xfb16('0x6'),'roundrobin')},'description':{'type':Sequelize[_0xfb16('0x2')]}}; \ No newline at end of file +var _0x7217=['roundrobin','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0xbb09c8,_0x5861d2){var _0x15231b=function(_0x16cd11){while(--_0x16cd11){_0xbb09c8['push'](_0xbb09c8['shift']());}};_0x15231b(++_0x5861d2);}(_0x7217,0xa9));var _0x7721=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x7217[_0x481bf7];return _0x461787;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7721('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x7721('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7721('0x2')](_0x7721('0x3'),_0x7721('0x4'),_0x7721('0x5'))},'description':{'type':Sequelize[_0x7721('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index e3b5952..bcdfd26 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 _0x1af2=['stack','name','send','index','WhatsappQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','params','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','body','describe','getMembers','UserWhatsappQueue','WhatsappQueueId','findAndCountAll','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','voicePause','interface','flatMap','Agents','sequelize','findOrCreate','emit','userWhatsappQueue:save','select','field','tq.TeamId','from','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','every','TeamId','includes','all','union','compact','transaction','removeTeams','isEmpty','forEach','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','WhatsappQueues','UserProfileResource','error'];(function(_0x356e31,_0x93584e){var _0x232737=function(_0x13e847){while(--_0x13e847){_0x356e31['push'](_0x356e31['shift']());}};_0x232737(++_0x93584e);}(_0x1af2,0xf4));var _0x21af=function(_0x78db5e,_0x3b9804){_0x78db5e=_0x78db5e-0x0;var _0x250b88=_0x1af2[_0x78db5e];return _0x250b88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x21af('0x0'));var zipdir=require(_0x21af('0x1'));var jsonpatch=require(_0x21af('0x2'));var rp=require(_0x21af('0x3'));var moment=require(_0x21af('0x4'));var BPromise=require(_0x21af('0x5'));var Mustache=require(_0x21af('0x6'));var util=require(_0x21af('0x7'));var path=require(_0x21af('0x8'));var sox=require(_0x21af('0x9'));var csv=require(_0x21af('0xa'));var ejs=require(_0x21af('0xb'));var fs=require('fs');var fs_extra=require(_0x21af('0xc'));var _=require('lodash');var squel=require(_0x21af('0xd'));var crypto=require(_0x21af('0xe'));var jsforce=require(_0x21af('0xf'));var deskjs=require(_0x21af('0x10'));var toCsv=require(_0x21af('0xa'));var querystring=require('querystring');var Papa=require(_0x21af('0x11'));var Redis=require(_0x21af('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x21af('0x13'));var as=require(_0x21af('0x14'));var hardwareService=require(_0x21af('0x15'));var logger=require(_0x21af('0x16'))(_0x21af('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x21af('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x21af('0x19')](config[_0x21af('0x1a')],{'host':_0x21af('0x1b'),'port':0x18eb});var socket=require(_0x21af('0x1c'))(new Redis(config[_0x21af('0x1a')]));require(_0x21af('0x1d'))[_0x21af('0x1e')](socket);function respondWithStatusCode(_0x5dc529,_0x341889){_0x341889=_0x341889||0xcc;return function(_0x543e7b){if(_0x543e7b){return _0x5dc529[_0x21af('0x1f')](_0x341889);}return _0x5dc529[_0x21af('0x20')](_0x341889)[_0x21af('0x21')]();};}function respondWithResult(_0x292042,_0xe6d924){_0xe6d924=_0xe6d924||0xc8;return function(_0x51adfb){if(_0x51adfb){return _0x292042[_0x21af('0x20')](_0xe6d924)[_0x21af('0x22')](_0x51adfb);}};}function respondWithFilteredResult(_0x23446a,_0x20d981){return function(_0x31aa85){if(_0x31aa85){var _0x33fb83=typeof _0x20d981['offset']===_0x21af('0x23')&&typeof _0x20d981['limit']==='undefined';var _0x2ff9f4=_0x31aa85['count'];var _0x388e98=_0x33fb83?0x0:_0x20d981['offset'];var _0x70bfaa=_0x33fb83?_0x31aa85[_0x21af('0x24')]:_0x20d981[_0x21af('0x25')]+_0x20d981[_0x21af('0x26')];var _0x836e24;if(_0x70bfaa>=_0x2ff9f4){_0x70bfaa=_0x2ff9f4;_0x836e24=0xc8;}else{_0x836e24=0xce;}_0x23446a['status'](_0x836e24);return _0x23446a[_0x21af('0x27')](_0x21af('0x28'),_0x388e98+'-'+_0x70bfaa+'/'+_0x2ff9f4)[_0x21af('0x22')](_0x31aa85);}return null;};}function patchUpdates(_0xdbf951){return function(_0x248b9d){try{jsonpatch[_0x21af('0x29')](_0x248b9d,_0xdbf951,!![]);}catch(_0x4c7eb8){return BPromise[_0x21af('0x2a')](_0x4c7eb8);}return _0x248b9d[_0x21af('0x2b')]();};}function saveUpdates(_0x3d36e6,_0x25e0e6){return function(_0x19148f){if(_0x19148f){return _0x19148f['update'](_0x3d36e6)[_0x21af('0x2c')](function(_0xd0bc43){return _0xd0bc43;});}return null;};}function removeEntity(_0x531c17,_0x4e9f0e){return function(_0x559b73){if(_0x559b73){return _0x559b73[_0x21af('0x2d')]()[_0x21af('0x2c')](function(){var _0x42617b=_0x559b73[_0x21af('0x2e')]({'plain':!![]});var _0x4ca41e=_0x21af('0x2f');return db[_0x21af('0x30')][_0x21af('0x2d')]({'where':{'type':_0x4ca41e,'resourceId':_0x42617b['id']}})[_0x21af('0x2c')](function(){return _0x559b73;});})[_0x21af('0x2c')](function(){_0x531c17[_0x21af('0x20')](0xcc)[_0x21af('0x21')]();});}};}function handleEntityNotFound(_0x1907d1,_0x23c715){return function(_0x4d63b4){if(!_0x4d63b4){_0x1907d1['sendStatus'](0x194);}return _0x4d63b4;};}function handleError(_0x50c1d6,_0x5d25d9){_0x5d25d9=_0x5d25d9||0x1f4;return function(_0x1d2b3f){logger[_0x21af('0x31')](_0x1d2b3f[_0x21af('0x32')]);if(_0x1d2b3f[_0x21af('0x33')]){delete _0x1d2b3f['name'];}_0x50c1d6[_0x21af('0x20')](_0x5d25d9)[_0x21af('0x34')](_0x1d2b3f);};}exports[_0x21af('0x35')]=function(_0x5c6bb7,_0x39c821){var _0x54ef52={},_0x1e7c63={},_0x4d3ca7={'count':0x0,'rows':[]};var _0x436370=_['map'](db[_0x21af('0x36')][_0x21af('0x37')],function(_0x23fb1f){return{'name':_0x23fb1f[_0x21af('0x38')],'type':_0x23fb1f[_0x21af('0x39')][_0x21af('0x3a')]};});_0x1e7c63[_0x21af('0x3b')]=_[_0x21af('0x3c')](_0x436370,_0x21af('0x33'));_0x1e7c63[_0x21af('0x3d')]=_[_0x21af('0x3e')](_0x5c6bb7['query']);_0x1e7c63[_0x21af('0x3f')]=_[_0x21af('0x40')](_0x1e7c63[_0x21af('0x3b')],_0x1e7c63[_0x21af('0x3d')]);_0x54ef52[_0x21af('0x41')]=_['intersection'](_0x1e7c63[_0x21af('0x3b')],qs[_0x21af('0x42')](_0x5c6bb7[_0x21af('0x3d')][_0x21af('0x42')]));_0x54ef52[_0x21af('0x41')]=_0x54ef52[_0x21af('0x41')][_0x21af('0x43')]?_0x54ef52[_0x21af('0x41')]:_0x1e7c63[_0x21af('0x3b')];if(!_0x5c6bb7[_0x21af('0x3d')][_0x21af('0x44')](_0x21af('0x45'))){_0x54ef52['limit']=qs[_0x21af('0x26')](_0x5c6bb7[_0x21af('0x3d')][_0x21af('0x26')]);_0x54ef52[_0x21af('0x25')]=qs[_0x21af('0x25')](_0x5c6bb7[_0x21af('0x3d')][_0x21af('0x25')]);}_0x54ef52[_0x21af('0x46')]=qs[_0x21af('0x47')](_0x5c6bb7[_0x21af('0x3d')]['sort']);_0x54ef52['where']=qs[_0x21af('0x3f')](_[_0x21af('0x48')](_0x5c6bb7[_0x21af('0x3d')],_0x1e7c63[_0x21af('0x3f')]),_0x436370);if(_0x5c6bb7[_0x21af('0x3d')][_0x21af('0x49')]){_0x54ef52[_0x21af('0x4a')]=_[_0x21af('0x4b')](_0x54ef52[_0x21af('0x4a')],{'$or':_[_0x21af('0x3c')](_0x436370,function(_0x5028dc){if(_0x5028dc[_0x21af('0x39')]!==_0x21af('0x4c')){var _0x491c75={};_0x491c75[_0x5028dc[_0x21af('0x33')]]={'$like':'%'+_0x5c6bb7[_0x21af('0x3d')][_0x21af('0x49')]+'%'};return _0x491c75;}})});}_0x54ef52=_[_0x21af('0x4b')]({},_0x54ef52,_0x5c6bb7['options']);var _0x4384d7={'where':_0x54ef52[_0x21af('0x4a')]};return db['WhatsappQueue']['count'](_0x4384d7)[_0x21af('0x2c')](function(_0x4d1ed3){_0x4d3ca7[_0x21af('0x24')]=_0x4d1ed3;if(_0x5c6bb7['query'][_0x21af('0x4d')]){_0x54ef52[_0x21af('0x4e')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x21af('0x4f')](_0x54ef52);})['then'](function(_0x281bae){_0x4d3ca7[_0x21af('0x50')]=_0x281bae;return _0x4d3ca7;})[_0x21af('0x2c')](respondWithFilteredResult(_0x39c821,_0x54ef52))['catch'](handleError(_0x39c821,null));};exports['show']=function(_0x346c65,_0x4304b3){var _0x52b08d={'raw':!![],'where':{'id':_0x346c65[_0x21af('0x51')]['id']}},_0x501e1f={};_0x501e1f[_0x21af('0x3b')]=_['keys'](db[_0x21af('0x36')][_0x21af('0x37')]);_0x501e1f['query']=_[_0x21af('0x3e')](_0x346c65[_0x21af('0x3d')]);_0x501e1f[_0x21af('0x3f')]=_[_0x21af('0x40')](_0x501e1f['model'],_0x501e1f[_0x21af('0x3d')]);_0x52b08d[_0x21af('0x41')]=_['intersection'](_0x501e1f[_0x21af('0x3b')],qs[_0x21af('0x42')](_0x346c65['query'][_0x21af('0x42')]));_0x52b08d[_0x21af('0x41')]=_0x52b08d['attributes'][_0x21af('0x43')]?_0x52b08d[_0x21af('0x41')]:_0x501e1f[_0x21af('0x3b')];if(_0x346c65[_0x21af('0x3d')][_0x21af('0x4d')]){_0x52b08d[_0x21af('0x4e')]=[{'all':!![]}];}_0x52b08d=_[_0x21af('0x4b')]({},_0x52b08d,_0x346c65[_0x21af('0x52')]);return db[_0x21af('0x36')][_0x21af('0x53')](_0x52b08d)['then'](handleEntityNotFound(_0x4304b3,null))[_0x21af('0x2c')](respondWithResult(_0x4304b3,null))[_0x21af('0x54')](handleError(_0x4304b3,null));};exports[_0x21af('0x55')]=function(_0x523f86,_0x4f9f28){return db[_0x21af('0x36')]['create'](_0x523f86['body'],{})[_0x21af('0x2c')](function(_0xccbba6){var _0x366cfe=_0x523f86['user']['get']({'plain':!![]});if(!_0x366cfe)throw new Error(_0x21af('0x56'));if(_0x366cfe[_0x21af('0x57')]==='user'){var _0x3be976=_0xccbba6['get']({'plain':!![]});var _0x5310c4=_0x21af('0x2f');return db[_0x21af('0x58')]['find']({'where':{'name':_0x5310c4,'userProfileId':_0x366cfe[_0x21af('0x59')]},'raw':!![]})[_0x21af('0x2c')](function(_0x383001){if(_0x383001&&_0x383001['autoAssociation']===0x0){return db[_0x21af('0x30')][_0x21af('0x55')]({'name':_0x3be976[_0x21af('0x33')],'resourceId':_0x3be976['id'],'type':_0x383001[_0x21af('0x33')],'sectionId':_0x383001['id']},{})['then'](function(){return _0xccbba6;});}else{return _0xccbba6;}})['catch'](function(_0x1851ec){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1851ec);throw _0x1851ec;});}return _0xccbba6;})[_0x21af('0x2c')](respondWithResult(_0x4f9f28,0xc9))[_0x21af('0x54')](handleError(_0x4f9f28,null));};exports['update']=function(_0x3c3a46,_0x31613c){if(_0x3c3a46[_0x21af('0x5a')]['id']){delete _0x3c3a46[_0x21af('0x5a')]['id'];}return db['WhatsappQueue']['find']({'where':{'id':_0x3c3a46[_0x21af('0x51')]['id']}})[_0x21af('0x2c')](handleEntityNotFound(_0x31613c,null))[_0x21af('0x2c')](saveUpdates(_0x3c3a46['body'],null))['then'](respondWithResult(_0x31613c,null))[_0x21af('0x54')](handleError(_0x31613c,null));};exports[_0x21af('0x2d')]=function(_0x46ae45,_0x2b1bdb){return db[_0x21af('0x36')][_0x21af('0x53')]({'where':{'id':_0x46ae45[_0x21af('0x51')]['id']}})[_0x21af('0x2c')](handleEntityNotFound(_0x2b1bdb,null))['then'](removeEntity(_0x2b1bdb,null))[_0x21af('0x54')](handleError(_0x2b1bdb,null));};exports[_0x21af('0x5b')]=function(_0x51b321,_0x2bbb72){return db['WhatsappQueue'][_0x21af('0x5b')]()['then'](respondWithResult(_0x2bbb72,null))[_0x21af('0x54')](handleError(_0x2bbb72,null));};exports[_0x21af('0x5c')]=function(_0x20c951,_0x4ee130,_0x35d1f9){var _0x369d1c={'raw':!![],'where':{}},_0x19ba9a={},_0x78e513;return db['WhatsappQueue']['findOne']({'where':{'id':_0x20c951[_0x21af('0x51')]['id']}})[_0x21af('0x2c')](handleEntityNotFound(_0x4ee130,null))['then'](function(_0x1673b0){if(_0x1673b0){_0x78e513=_0x1673b0[_0x21af('0x2e')]({'plain':!![]});_0x19ba9a['model']=_[_0x21af('0x3e')](db[_0x21af('0x5d')][_0x21af('0x37')]);_0x19ba9a[_0x21af('0x3d')]=_['keys'](_0x20c951[_0x21af('0x3d')]);_0x19ba9a[_0x21af('0x3f')]=_['intersection'](_0x19ba9a['model'],_0x19ba9a[_0x21af('0x3d')]);_0x369d1c[_0x21af('0x41')]=_[_0x21af('0x40')](_0x19ba9a[_0x21af('0x3b')],qs[_0x21af('0x42')](_0x20c951[_0x21af('0x3d')][_0x21af('0x42')]));_0x369d1c[_0x21af('0x41')]=_0x369d1c['attributes'][_0x21af('0x43')]?_0x369d1c[_0x21af('0x41')]:_0x19ba9a['model'];if(!_0x20c951['query'][_0x21af('0x44')](_0x21af('0x45'))){_0x369d1c[_0x21af('0x26')]=qs['limit'](_0x20c951[_0x21af('0x3d')][_0x21af('0x26')]);_0x369d1c[_0x21af('0x25')]=qs[_0x21af('0x25')](_0x20c951['query'][_0x21af('0x25')]);}_0x369d1c[_0x21af('0x46')]=qs[_0x21af('0x47')](_0x20c951[_0x21af('0x3d')]['sort']);_0x369d1c[_0x21af('0x4a')]=qs[_0x21af('0x3f')](_[_0x21af('0x48')](_0x20c951[_0x21af('0x3d')],_0x19ba9a['filters']));_0x369d1c[_0x21af('0x4a')][_0x21af('0x5e')]=_0x1673b0['id'];if(_0x20c951[_0x21af('0x3d')][_0x21af('0x49')]){_0x369d1c[_0x21af('0x4a')]=_[_0x21af('0x4b')](_0x369d1c[_0x21af('0x4a')],{'$or':_[_0x21af('0x3c')](_0x369d1c[_0x21af('0x41')],function(_0x36a91e){var _0x5b60ae={};_0x5b60ae[_0x36a91e]={'$like':'%'+_0x20c951[_0x21af('0x3d')]['filter']+'%'};return _0x5b60ae;})});}_0x369d1c=_['merge']({},_0x369d1c,_0x20c951[_0x21af('0x52')]);return db[_0x21af('0x5d')][_0x21af('0x4f')](_0x369d1c);}})[_0x21af('0x2c')](function(_0xd0e398){if(_0xd0e398){return db['User'][_0x21af('0x5f')]({'where':{'id':_['map'](_0xd0e398,'UserId'),'role':'agent'},'attributes':['id',_0x21af('0x33'),_0x21af('0x60'),_0x21af('0x61'),_0x21af('0x62')]});}})[_0x21af('0x2c')](function(_0x372de0){if(_0x372de0){return{'count':_0x372de0[_0x21af('0x24')],'rows':_[_0x21af('0x3c')](_0x372de0[_0x21af('0x50')],function(_0x198d98){return{'membername':_0x198d98[_0x21af('0x33')],'UserId':_0x198d98['id'],'queue_name':_0x78e513[_0x21af('0x33')],'WhatsappQueueId':_0x78e513['id'],'interface':util[_0x21af('0x63')](_0x21af('0x64'),_0x21af('0x65'),_0x198d98[_0x21af('0x33')]),'penalty':0x0,'paused':_0x198d98[_0x21af('0x60')],'createdAt':_0x198d98[_0x21af('0x62')],'updatedAt':_0x198d98[_0x21af('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x21af('0x2c')](respondWithFilteredResult(_0x4ee130,_0x369d1c))['catch'](handleError(_0x4ee130,null));};exports[_0x21af('0x66')]=function(_0x551110,_0x4e48ec,_0x5c58fc){var _0x33476b={};var _0x409b63={};var _0x3cc97c;var _0x2dadb3;return db[_0x21af('0x36')]['findOne']({'where':{'id':_0x551110[_0x21af('0x51')]['id']}})[_0x21af('0x2c')](handleEntityNotFound(_0x4e48ec,null))[_0x21af('0x2c')](function(_0x9dc3a0){if(_0x9dc3a0){_0x3cc97c=_0x9dc3a0;_0x409b63[_0x21af('0x3b')]=_[_0x21af('0x3e')](db[_0x21af('0x67')][_0x21af('0x37')]);_0x409b63[_0x21af('0x3d')]=_[_0x21af('0x3e')](_0x551110[_0x21af('0x3d')]);_0x409b63[_0x21af('0x3f')]=_[_0x21af('0x40')](_0x409b63['model'],_0x409b63[_0x21af('0x3d')]);_0x33476b[_0x21af('0x41')]=_[_0x21af('0x40')](_0x409b63[_0x21af('0x3b')],qs['fields'](_0x551110[_0x21af('0x3d')][_0x21af('0x42')]));_0x33476b['attributes']=_0x33476b['attributes'][_0x21af('0x43')]?_0x33476b[_0x21af('0x41')]:_0x409b63[_0x21af('0x3b')];_0x33476b[_0x21af('0x46')]=qs[_0x21af('0x47')](_0x551110[_0x21af('0x3d')][_0x21af('0x47')]);_0x33476b[_0x21af('0x4a')]=qs[_0x21af('0x3f')](_[_0x21af('0x48')](_0x551110[_0x21af('0x3d')],_0x409b63[_0x21af('0x3f')]));if(_0x551110[_0x21af('0x3d')][_0x21af('0x49')]){_0x33476b[_0x21af('0x4a')]=_['merge'](_0x33476b[_0x21af('0x4a')],{'$or':_[_0x21af('0x3c')](_0x33476b[_0x21af('0x41')],function(_0x16274){var _0x33b081={};_0x33b081[_0x16274]={'$like':'%'+_0x551110[_0x21af('0x3d')][_0x21af('0x49')]+'%'};return _0x33b081;})});}_0x33476b=_[_0x21af('0x4b')]({},_0x33476b,_0x551110[_0x21af('0x52')]);return _0x3cc97c['getTeams'](_0x33476b);}})['then'](function(_0x2a64fb){if(_0x2a64fb){_0x2dadb3=_0x2a64fb['length'];if(!_0x551110['query']['hasOwnProperty']('nolimit')){_0x33476b[_0x21af('0x26')]=qs['limit'](_0x551110['query'][_0x21af('0x26')]);_0x33476b[_0x21af('0x25')]=qs[_0x21af('0x25')](_0x551110[_0x21af('0x3d')][_0x21af('0x25')]);}return _0x3cc97c[_0x21af('0x66')](_0x33476b);}})['then'](function(_0x11131f){if(_0x11131f){return _0x11131f?{'count':_0x2dadb3,'rows':_0x11131f}:null;}})['then'](respondWithResult(_0x4e48ec,null))['catch'](handleError(_0x4e48ec,null));};exports[_0x21af('0x68')]=function(_0x1284bb,_0xd82b43,_0x45bbc4){var _0x4accec=_0x1284bb[_0x21af('0x5a')][_0x21af('0x69')];return db[_0x21af('0x67')][_0x21af('0x4f')]({'where':{'id':_0x4accec},'attributes':['id'],'include':[{'model':db[_0x21af('0x6a')],'as':'Agents','attributes':['id',_0x21af('0x33'),'online',_0x21af('0x6b'),_0x21af('0x6c')],'raw':!![]}]})[_0x21af('0x2c')](function(_0x328a78){if(_0x328a78){var _0x340c3f=_[_0x21af('0x6d')](_0x328a78,function(_0x196586){var _0x1796ec=_0x196586['get']({'plain':!![]});return _0x1796ec[_0x21af('0x6e')];});return db['WhatsappQueue'][_0x21af('0x53')]({'where':{'id':_0x1284bb['params']['id']}})[_0x21af('0x2c')](function(_0x38629a){return db[_0x21af('0x6f')]['transaction'](function(_0x9640f){return _0x38629a[_0x21af('0x68')](_0x4accec,{'transaction':_0x9640f})[_0x21af('0x2c')](function(){return BPromise['each'](_0x340c3f,function(_0x3da21f){return db['UserWhatsappQueue'][_0x21af('0x70')]({'where':{'UserId':_0x3da21f['id'],'WhatsappQueueId':_0x1284bb[_0x21af('0x51')]['id']},'transaction':_0x9640f});});})[_0x21af('0x2c')](function(){_0x340c3f['forEach'](function(_0x1665a9){socket[_0x21af('0x71')](_0x21af('0x72'),{'UserId':_0x1665a9['id'],'WhatsappQueueId':_0x38629a['id']});});});});});}})[_0x21af('0x2c')](respondWithStatusCode(_0xd82b43,null))[_0x21af('0x54')](handleError(_0xd82b43,null));};exports['removeTeams']=function(_0x3f5501,_0xab2bfe,_0x2bbc7c){return db[_0x21af('0x67')][_0x21af('0x4f')]({'where':{'id':_0x3f5501['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x21af('0x6a')],'as':_0x21af('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x21af('0x2c')](handleEntityNotFound(_0xab2bfe,null))['then'](function(_0x43ef15){var _0x4ca874=_[_0x21af('0x3c')](_0x43ef15,'id');var _0x3ac19f=[];var _0x29261c=[];var _0xa3c391=squel[_0x21af('0x73')]();_0xa3c391[_0x21af('0x74')](_0x21af('0x75'))[_0x21af('0x76')](_0x21af('0x77'),'tq')[_0x21af('0x78')](_0x21af('0x79'),'ut',_0x21af('0x7a'))['where'](_0x21af('0x7b'),_0x3f5501['params']['id']);for(var _0x14966e=0x0;_0x14966e<_0x43ef15[_0x21af('0x43')];_0x14966e+=0x1){let _0x54d406=_0x43ef15[_0x14966e];for(var _0x28d753=0x0;_0x28d753<_0x54d406[_0x21af('0x6e')][_0x21af('0x43')];_0x28d753+=0x1){let _0x5885d3=_0x54d406[_0x21af('0x6e')][_0x28d753];var _0x408250=_0xa3c391[_0x21af('0x7c')]();_0x408250[_0x21af('0x4a')](_0x21af('0x7d'),_0x5885d3['id']);_0x29261c[_0x21af('0x7e')](db['sequelize'][_0x21af('0x3d')](_0x408250[_0x21af('0x7f')](),{'type':db['sequelize'][_0x21af('0x80')][_0x21af('0x81')]})[_0x21af('0x2c')](function(_0x2aeae4){if(_0x2aeae4['length']===0x1){return _0x5885d3['id'];}else{var _0x584d0a=_[_0x21af('0x82')](_[_0x21af('0x3c')](_0x2aeae4,_0x21af('0x83')),function(_0x5334d8){return _[_0x21af('0x84')](_0x4ca874,_0x5334d8);});if(_0x584d0a){return _0x5885d3['id'];}}}));}}return BPromise[_0x21af('0x85')](_0x29261c)[_0x21af('0x2c')](function(_0x3dd01){_0x3ac19f=_(_0x3ac19f)[_0x21af('0x86')](_0x3dd01)[_0x21af('0x87')]()['value']();return db[_0x21af('0x36')][_0x21af('0x53')]({'where':{'id':_0x3f5501['params']['id']}})[_0x21af('0x2c')](function(_0xec22b0){return db['sequelize'][_0x21af('0x88')](function(_0x100417){return _0xec22b0[_0x21af('0x89')](_0x3f5501[_0x21af('0x3d')]['ids'],{'transaction':_0x100417})['then'](function(){if(!_[_0x21af('0x8a')](_0x3ac19f)){return _0xec22b0['removeAgents'](_0x3ac19f,{'transaction':_0x100417});}})[_0x21af('0x2c')](function(){_0x3ac19f[_0x21af('0x8b')](function(_0x206d5b){socket[_0x21af('0x71')](_0x21af('0x8c'),{'UserId':_0x206d5b,'WhatsappQueueId':_0xec22b0['id']});});});});});});})['then'](respondWithStatusCode(_0xab2bfe,null))[_0x21af('0x54')](handleError(_0xab2bfe,null));};exports[_0x21af('0x8d')]=function(_0x1ac082,_0x36fa17,_0x3c6ca3){return db[_0x21af('0x36')][_0x21af('0x53')]({'where':{'id':_0x1ac082['params']['id']}})[_0x21af('0x2c')](handleEntityNotFound(_0x36fa17,null))[_0x21af('0x2c')](function(_0x515f3c){if(_0x515f3c){return _0x515f3c[_0x21af('0x8d')](_0x1ac082['body'][_0x21af('0x69')],_[_0x21af('0x8e')](_0x1ac082['body'],[_0x21af('0x69'),'id'])||{})[_0x21af('0x8f')](function(_0x273ae7){for(var _0x311b42=0x0;_0x311b42<_0x1ac082[_0x21af('0x5a')][_0x21af('0x69')]['length'];_0x311b42+=0x1){socket[_0x21af('0x71')]('userWhatsappQueue:save',{'UserId':Number(_0x1ac082[_0x21af('0x5a')]['ids'][_0x311b42]),'WhatsappQueueId':Number(_0x1ac082['params']['id'])});}return _0x273ae7;});}})[_0x21af('0x2c')](respondWithResult(_0x36fa17,null))[_0x21af('0x54')](handleError(_0x36fa17,null));};exports[_0x21af('0x90')]=function(_0x166dad,_0x21cc54,_0x186d3a){return db[_0x21af('0x36')][_0x21af('0x53')]({'where':{'id':_0x166dad[_0x21af('0x51')]['id']}})[_0x21af('0x2c')](handleEntityNotFound(_0x21cc54,null))[_0x21af('0x2c')](function(_0x1f3f33){if(_0x1f3f33){return _0x1f3f33[_0x21af('0x90')](_0x166dad['query'][_0x21af('0x69')])['then'](function(){if(_[_0x21af('0x91')](_0x166dad[_0x21af('0x3d')]['ids'])){for(var _0x242278=0x0;_0x242278<_0x166dad[_0x21af('0x3d')][_0x21af('0x69')][_0x21af('0x43')];_0x242278+=0x1){socket[_0x21af('0x71')](_0x21af('0x8c'),{'UserId':Number(_0x166dad['query'][_0x21af('0x69')][_0x242278]),'WhatsappQueueId':Number(_0x166dad[_0x21af('0x51')]['id'])});}}else{socket['emit'](_0x21af('0x8c'),{'UserId':Number(_0x166dad['query']['ids']),'WhatsappQueueId':Number(_0x166dad[_0x21af('0x51')]['id'])});}});}})[_0x21af('0x2c')](respondWithStatusCode(_0x21cc54,null))[_0x21af('0x54')](handleError(_0x21cc54,null));};exports[_0x21af('0x92')]=function(_0x4ac672,_0x367e9e,_0x184634){var _0x45cce1={};var _0x432f60={};var _0x37e08c;var _0xf61ec3;return db['WhatsappQueue']['findOne']({'where':{'id':_0x4ac672['params']['id']}})['then'](handleEntityNotFound(_0x367e9e,null))[_0x21af('0x2c')](function(_0x108bff){if(_0x108bff){_0x37e08c=_0x108bff;_0x432f60['model']=_[_0x21af('0x3e')](db[_0x21af('0x6a')][_0x21af('0x37')]);_0x432f60[_0x21af('0x3d')]=_[_0x21af('0x3e')](_0x4ac672[_0x21af('0x3d')]);_0x432f60[_0x21af('0x3f')]=_['intersection'](_0x432f60[_0x21af('0x3b')],_0x432f60[_0x21af('0x3d')]);_0x45cce1[_0x21af('0x41')]=_[_0x21af('0x40')](_0x432f60[_0x21af('0x3b')],qs[_0x21af('0x42')](_0x4ac672[_0x21af('0x3d')][_0x21af('0x42')]));_0x45cce1[_0x21af('0x41')]=_0x45cce1[_0x21af('0x41')]['length']?_0x45cce1[_0x21af('0x41')]:_0x432f60[_0x21af('0x3b')];_0x45cce1['order']=qs['sort'](_0x4ac672[_0x21af('0x3d')][_0x21af('0x47')]);_0x45cce1['where']=qs[_0x21af('0x3f')](_[_0x21af('0x48')](_0x4ac672[_0x21af('0x3d')],_0x432f60[_0x21af('0x3f')]));if(_0x4ac672[_0x21af('0x3d')][_0x21af('0x49')]){_0x45cce1['where']=_[_0x21af('0x4b')](_0x45cce1[_0x21af('0x4a')],{'$or':_[_0x21af('0x3c')](_0x45cce1[_0x21af('0x41')],function(_0x4d9050){var _0x4b5a8e={};_0x4b5a8e[_0x4d9050]={'$like':'%'+_0x4ac672['query'][_0x21af('0x49')]+'%'};return _0x4b5a8e;})});}_0x45cce1=_[_0x21af('0x4b')]({},_0x45cce1,_0x4ac672['options']);return _0x37e08c[_0x21af('0x92')](_0x45cce1);}})[_0x21af('0x2c')](function(_0x295ede){if(_0x295ede){_0xf61ec3=_0x295ede[_0x21af('0x43')];if(!_0x4ac672['query'][_0x21af('0x44')]('nolimit')){_0x45cce1['limit']=qs[_0x21af('0x26')](_0x4ac672[_0x21af('0x3d')][_0x21af('0x26')]);_0x45cce1[_0x21af('0x25')]=qs[_0x21af('0x25')](_0x4ac672['query'][_0x21af('0x25')]);}return _0x37e08c['getAgents'](_0x45cce1);}})[_0x21af('0x2c')](function(_0x1f0e2c){if(_0x1f0e2c){return _0x1f0e2c?{'count':_0xf61ec3,'rows':_0x1f0e2c}:null;}})[_0x21af('0x2c')](respondWithResult(_0x367e9e,null))['catch'](handleError(_0x367e9e,null));}; \ No newline at end of file +var _0x67f7=['end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','WhatsappQueue','includeAll','include','findAll','options','find','catch','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','update','params','destroy','describe','UserWhatsappQueue','WhatsappQueueId','User','UserId','whatsappPause','createdAt','rows','format','%s/%s','SIP','updatedAt','findOne','Team','getTeams','addTeams','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','TeamId','includes','all','union','compact','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','ids','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','status','json','offset','limit','undefined','count','set','apply','then','WhatsappQueues','UserProfileResource'];(function(_0x2d9499,_0x5730d9){var _0x491ffb=function(_0x1b3e00){while(--_0x1b3e00){_0x2d9499['push'](_0x2d9499['shift']());}};_0x491ffb(++_0x5730d9);}(_0x67f7,0xef));var _0x767f=function(_0xe1ca08,_0x289972){_0xe1ca08=_0xe1ca08-0x0;var _0x159fbc=_0x67f7[_0xe1ca08];return _0x159fbc;};'use strict';var emlformat=require(_0x767f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x767f('0x1'));var jsonpatch=require(_0x767f('0x2'));var rp=require(_0x767f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x767f('0x4'));var util=require(_0x767f('0x5'));var path=require(_0x767f('0x6'));var sox=require(_0x767f('0x7'));var csv=require(_0x767f('0x8'));var ejs=require(_0x767f('0x9'));var fs=require('fs');var fs_extra=require(_0x767f('0xa'));var _=require('lodash');var squel=require(_0x767f('0xb'));var crypto=require(_0x767f('0xc'));var jsforce=require(_0x767f('0xd'));var deskjs=require(_0x767f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x767f('0xf'));var Papa=require(_0x767f('0x10'));var Redis=require(_0x767f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x767f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x767f('0x13'))(_0x767f('0x14'));var utils=require(_0x767f('0x15'));var config=require(_0x767f('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x767f('0x17')]=_[_0x767f('0x18')](config[_0x767f('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x767f('0x19'))(new Redis(config[_0x767f('0x17')]));require('./whatsappQueue.socket')[_0x767f('0x1a')](socket);function respondWithStatusCode(_0x22649a,_0x199afd){_0x199afd=_0x199afd||0xcc;return function(_0x48255c){if(_0x48255c){return _0x22649a[_0x767f('0x1b')](_0x199afd);}return _0x22649a[_0x767f('0x1c')](_0x199afd)['end']();};}function respondWithResult(_0x636570,_0x29caf6){_0x29caf6=_0x29caf6||0xc8;return function(_0x3d284d){if(_0x3d284d){return _0x636570[_0x767f('0x1c')](_0x29caf6)[_0x767f('0x1d')](_0x3d284d);}};}function respondWithFilteredResult(_0x2a3455,_0x176762){return function(_0x1928e8){if(_0x1928e8){var _0x7225f6=typeof _0x176762[_0x767f('0x1e')]==='undefined'&&typeof _0x176762[_0x767f('0x1f')]===_0x767f('0x20');var _0x355cf3=_0x1928e8[_0x767f('0x21')];var _0x12aefe=_0x7225f6?0x0:_0x176762[_0x767f('0x1e')];var _0x456cc5=_0x7225f6?_0x1928e8[_0x767f('0x21')]:_0x176762['offset']+_0x176762['limit'];var _0x19b225;if(_0x456cc5>=_0x355cf3){_0x456cc5=_0x355cf3;_0x19b225=0xc8;}else{_0x19b225=0xce;}_0x2a3455['status'](_0x19b225);return _0x2a3455[_0x767f('0x22')]('Content-Range',_0x12aefe+'-'+_0x456cc5+'/'+_0x355cf3)[_0x767f('0x1d')](_0x1928e8);}return null;};}function patchUpdates(_0x120b1a){return function(_0x4a36b0){try{jsonpatch[_0x767f('0x23')](_0x4a36b0,_0x120b1a,!![]);}catch(_0x59d389){return BPromise['reject'](_0x59d389);}return _0x4a36b0['save']();};}function saveUpdates(_0x53fe37,_0xdda1d){return function(_0x1ab616){if(_0x1ab616){return _0x1ab616['update'](_0x53fe37)[_0x767f('0x24')](function(_0x39c6d0){return _0x39c6d0;});}return null;};}function removeEntity(_0x59a262,_0x35e41d){return function(_0x45d7e3){if(_0x45d7e3){return _0x45d7e3['destroy']()['then'](function(){var _0x145506=_0x45d7e3['get']({'plain':!![]});var _0x3a427e=_0x767f('0x25');return db[_0x767f('0x26')]['destroy']({'where':{'type':_0x3a427e,'resourceId':_0x145506['id']}})[_0x767f('0x24')](function(){return _0x45d7e3;});})[_0x767f('0x24')](function(){_0x59a262['status'](0xcc)[_0x767f('0x27')]();});}};}function handleEntityNotFound(_0x4e117c,_0x477bbc){return function(_0x11499a){if(!_0x11499a){_0x4e117c[_0x767f('0x1b')](0x194);}return _0x11499a;};}function handleError(_0xbf98a0,_0x32e361){_0x32e361=_0x32e361||0x1f4;return function(_0x5e6b8e){logger[_0x767f('0x28')](_0x5e6b8e['stack']);if(_0x5e6b8e[_0x767f('0x29')]){delete _0x5e6b8e['name'];}_0xbf98a0[_0x767f('0x1c')](_0x32e361)[_0x767f('0x2a')](_0x5e6b8e);};}exports[_0x767f('0x2b')]=function(_0x3bfd4a,_0x376f78){var _0x4eb16c={},_0xfafdee={},_0x32388a={'count':0x0,'rows':[]};var _0xe8a19=_[_0x767f('0x2c')](db['WhatsappQueue'][_0x767f('0x2d')],function(_0x34ee9b){return{'name':_0x34ee9b[_0x767f('0x2e')],'type':_0x34ee9b[_0x767f('0x2f')][_0x767f('0x30')]};});_0xfafdee[_0x767f('0x31')]=_[_0x767f('0x2c')](_0xe8a19,_0x767f('0x29'));_0xfafdee['query']=_[_0x767f('0x32')](_0x3bfd4a[_0x767f('0x33')]);_0xfafdee[_0x767f('0x34')]=_['intersection'](_0xfafdee['model'],_0xfafdee[_0x767f('0x33')]);_0x4eb16c[_0x767f('0x35')]=_[_0x767f('0x36')](_0xfafdee[_0x767f('0x31')],qs[_0x767f('0x37')](_0x3bfd4a[_0x767f('0x33')][_0x767f('0x37')]));_0x4eb16c[_0x767f('0x35')]=_0x4eb16c[_0x767f('0x35')][_0x767f('0x38')]?_0x4eb16c[_0x767f('0x35')]:_0xfafdee[_0x767f('0x31')];if(!_0x3bfd4a[_0x767f('0x33')][_0x767f('0x39')](_0x767f('0x3a'))){_0x4eb16c[_0x767f('0x1f')]=qs['limit'](_0x3bfd4a['query']['limit']);_0x4eb16c['offset']=qs[_0x767f('0x1e')](_0x3bfd4a[_0x767f('0x33')][_0x767f('0x1e')]);}_0x4eb16c[_0x767f('0x3b')]=qs[_0x767f('0x3c')](_0x3bfd4a[_0x767f('0x33')]['sort']);_0x4eb16c['where']=qs['filters'](_[_0x767f('0x3d')](_0x3bfd4a[_0x767f('0x33')],_0xfafdee[_0x767f('0x34')]),_0xe8a19);if(_0x3bfd4a[_0x767f('0x33')][_0x767f('0x3e')]){_0x4eb16c[_0x767f('0x3f')]=_[_0x767f('0x40')](_0x4eb16c['where'],{'$or':_[_0x767f('0x2c')](_0xe8a19,function(_0x5c94d2){if(_0x5c94d2['type']!=='VIRTUAL'){var _0x1f26e2={};_0x1f26e2[_0x5c94d2['name']]={'$like':'%'+_0x3bfd4a['query'][_0x767f('0x3e')]+'%'};return _0x1f26e2;}})});}_0x4eb16c=_[_0x767f('0x40')]({},_0x4eb16c,_0x3bfd4a['options']);var _0x21900d={'where':_0x4eb16c[_0x767f('0x3f')]};return db[_0x767f('0x41')][_0x767f('0x21')](_0x21900d)[_0x767f('0x24')](function(_0x6e8973){_0x32388a[_0x767f('0x21')]=_0x6e8973;if(_0x3bfd4a[_0x767f('0x33')][_0x767f('0x42')]){_0x4eb16c[_0x767f('0x43')]=[{'all':!![]}];}return db[_0x767f('0x41')][_0x767f('0x44')](_0x4eb16c);})[_0x767f('0x24')](function(_0x3e3231){_0x32388a['rows']=_0x3e3231;return _0x32388a;})[_0x767f('0x24')](respondWithFilteredResult(_0x376f78,_0x4eb16c))['catch'](handleError(_0x376f78,null));};exports['show']=function(_0x20e5de,_0x2df69a){var _0x22fdff={'raw':!![],'where':{'id':_0x20e5de['params']['id']}},_0x32783b={};_0x32783b[_0x767f('0x31')]=_[_0x767f('0x32')](db['WhatsappQueue']['rawAttributes']);_0x32783b[_0x767f('0x33')]=_[_0x767f('0x32')](_0x20e5de[_0x767f('0x33')]);_0x32783b[_0x767f('0x34')]=_[_0x767f('0x36')](_0x32783b['model'],_0x32783b[_0x767f('0x33')]);_0x22fdff['attributes']=_[_0x767f('0x36')](_0x32783b[_0x767f('0x31')],qs[_0x767f('0x37')](_0x20e5de[_0x767f('0x33')][_0x767f('0x37')]));_0x22fdff[_0x767f('0x35')]=_0x22fdff[_0x767f('0x35')][_0x767f('0x38')]?_0x22fdff['attributes']:_0x32783b[_0x767f('0x31')];if(_0x20e5de['query'][_0x767f('0x42')]){_0x22fdff[_0x767f('0x43')]=[{'all':!![]}];}_0x22fdff=_[_0x767f('0x40')]({},_0x22fdff,_0x20e5de[_0x767f('0x45')]);return db[_0x767f('0x41')][_0x767f('0x46')](_0x22fdff)[_0x767f('0x24')](handleEntityNotFound(_0x2df69a,null))[_0x767f('0x24')](respondWithResult(_0x2df69a,null))[_0x767f('0x47')](handleError(_0x2df69a,null));};exports['create']=function(_0x329fb4,_0x22e03f){return db['WhatsappQueue'][_0x767f('0x48')](_0x329fb4[_0x767f('0x49')],{})[_0x767f('0x24')](function(_0x5266f4){var _0x2c12c3=_0x329fb4[_0x767f('0x4a')][_0x767f('0x4b')]({'plain':!![]});if(!_0x2c12c3)throw new Error(_0x767f('0x4c'));if(_0x2c12c3[_0x767f('0x4d')]===_0x767f('0x4a')){var _0x17f92e=_0x5266f4[_0x767f('0x4b')]({'plain':!![]});var _0x49435d='WhatsappQueues';return db[_0x767f('0x4e')][_0x767f('0x46')]({'where':{'name':_0x49435d,'userProfileId':_0x2c12c3[_0x767f('0x4f')]},'raw':!![]})[_0x767f('0x24')](function(_0x78f45f){if(_0x78f45f&&_0x78f45f[_0x767f('0x50')]===0x0){return db['UserProfileResource'][_0x767f('0x48')]({'name':_0x17f92e['name'],'resourceId':_0x17f92e['id'],'type':_0x78f45f[_0x767f('0x29')],'sectionId':_0x78f45f['id']},{})[_0x767f('0x24')](function(){return _0x5266f4;});}else{return _0x5266f4;}})[_0x767f('0x47')](function(_0x5bd297){logger[_0x767f('0x28')](_0x767f('0x51'),_0x5bd297);throw _0x5bd297;});}return _0x5266f4;})[_0x767f('0x24')](respondWithResult(_0x22e03f,0xc9))[_0x767f('0x47')](handleError(_0x22e03f,null));};exports[_0x767f('0x52')]=function(_0x2f271a,_0x597f38){if(_0x2f271a[_0x767f('0x49')]['id']){delete _0x2f271a[_0x767f('0x49')]['id'];}return db['WhatsappQueue'][_0x767f('0x46')]({'where':{'id':_0x2f271a[_0x767f('0x53')]['id']}})[_0x767f('0x24')](handleEntityNotFound(_0x597f38,null))['then'](saveUpdates(_0x2f271a[_0x767f('0x49')],null))[_0x767f('0x24')](respondWithResult(_0x597f38,null))[_0x767f('0x47')](handleError(_0x597f38,null));};exports[_0x767f('0x54')]=function(_0x1dc23f,_0x4cd9dc){return db[_0x767f('0x41')][_0x767f('0x46')]({'where':{'id':_0x1dc23f[_0x767f('0x53')]['id']}})['then'](handleEntityNotFound(_0x4cd9dc,null))[_0x767f('0x24')](removeEntity(_0x4cd9dc,null))[_0x767f('0x47')](handleError(_0x4cd9dc,null));};exports[_0x767f('0x55')]=function(_0x8b385b,_0x1e1479){return db[_0x767f('0x41')][_0x767f('0x55')]()[_0x767f('0x24')](respondWithResult(_0x1e1479,null))[_0x767f('0x47')](handleError(_0x1e1479,null));};exports['getMembers']=function(_0x25f466,_0x17d268,_0x4c251e){var _0x160909={'raw':!![],'where':{}},_0x1dab22={},_0x2423dc;return db[_0x767f('0x41')]['findOne']({'where':{'id':_0x25f466[_0x767f('0x53')]['id']}})['then'](handleEntityNotFound(_0x17d268,null))['then'](function(_0x33d938){if(_0x33d938){_0x2423dc=_0x33d938['get']({'plain':!![]});_0x1dab22[_0x767f('0x31')]=_['keys'](db[_0x767f('0x56')]['rawAttributes']);_0x1dab22[_0x767f('0x33')]=_[_0x767f('0x32')](_0x25f466[_0x767f('0x33')]);_0x1dab22[_0x767f('0x34')]=_[_0x767f('0x36')](_0x1dab22[_0x767f('0x31')],_0x1dab22[_0x767f('0x33')]);_0x160909[_0x767f('0x35')]=_['intersection'](_0x1dab22[_0x767f('0x31')],qs[_0x767f('0x37')](_0x25f466['query'][_0x767f('0x37')]));_0x160909[_0x767f('0x35')]=_0x160909[_0x767f('0x35')][_0x767f('0x38')]?_0x160909['attributes']:_0x1dab22[_0x767f('0x31')];if(!_0x25f466[_0x767f('0x33')][_0x767f('0x39')](_0x767f('0x3a'))){_0x160909[_0x767f('0x1f')]=qs[_0x767f('0x1f')](_0x25f466[_0x767f('0x33')][_0x767f('0x1f')]);_0x160909[_0x767f('0x1e')]=qs[_0x767f('0x1e')](_0x25f466[_0x767f('0x33')][_0x767f('0x1e')]);}_0x160909[_0x767f('0x3b')]=qs[_0x767f('0x3c')](_0x25f466[_0x767f('0x33')][_0x767f('0x3c')]);_0x160909[_0x767f('0x3f')]=qs['filters'](_['pick'](_0x25f466[_0x767f('0x33')],_0x1dab22[_0x767f('0x34')]));_0x160909[_0x767f('0x3f')][_0x767f('0x57')]=_0x33d938['id'];if(_0x25f466[_0x767f('0x33')][_0x767f('0x3e')]){_0x160909[_0x767f('0x3f')]=_['merge'](_0x160909[_0x767f('0x3f')],{'$or':_[_0x767f('0x2c')](_0x160909[_0x767f('0x35')],function(_0x3d2203){var _0x15e18c={};_0x15e18c[_0x3d2203]={'$like':'%'+_0x25f466[_0x767f('0x33')][_0x767f('0x3e')]+'%'};return _0x15e18c;})});}_0x160909=_['merge']({},_0x160909,_0x25f466['options']);return db[_0x767f('0x56')]['findAll'](_0x160909);}})['then'](function(_0x340082){if(_0x340082){return db[_0x767f('0x58')]['findAndCountAll']({'where':{'id':_[_0x767f('0x2c')](_0x340082,_0x767f('0x59')),'role':'agent'},'attributes':['id',_0x767f('0x29'),_0x767f('0x5a'),'updatedAt',_0x767f('0x5b')]});}})[_0x767f('0x24')](function(_0x4a5155){if(_0x4a5155){return{'count':_0x4a5155[_0x767f('0x21')],'rows':_[_0x767f('0x2c')](_0x4a5155[_0x767f('0x5c')],function(_0x7ad2f1){return{'membername':_0x7ad2f1[_0x767f('0x29')],'UserId':_0x7ad2f1['id'],'queue_name':_0x2423dc['name'],'WhatsappQueueId':_0x2423dc['id'],'interface':util[_0x767f('0x5d')](_0x767f('0x5e'),_0x767f('0x5f'),_0x7ad2f1[_0x767f('0x29')]),'penalty':0x0,'paused':_0x7ad2f1['whatsappPause'],'createdAt':_0x7ad2f1[_0x767f('0x5b')],'updatedAt':_0x7ad2f1[_0x767f('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x767f('0x24')](respondWithFilteredResult(_0x17d268,_0x160909))[_0x767f('0x47')](handleError(_0x17d268,null));};exports['getTeams']=function(_0x3baf5b,_0x1f8a1e,_0x2fc59e){var _0x5255b1={};var _0x3f497a={};var _0x41f782;var _0x31b505;return db[_0x767f('0x41')][_0x767f('0x61')]({'where':{'id':_0x3baf5b['params']['id']}})[_0x767f('0x24')](handleEntityNotFound(_0x1f8a1e,null))[_0x767f('0x24')](function(_0x465d40){if(_0x465d40){_0x41f782=_0x465d40;_0x3f497a[_0x767f('0x31')]=_[_0x767f('0x32')](db[_0x767f('0x62')]['rawAttributes']);_0x3f497a['query']=_[_0x767f('0x32')](_0x3baf5b[_0x767f('0x33')]);_0x3f497a[_0x767f('0x34')]=_[_0x767f('0x36')](_0x3f497a[_0x767f('0x31')],_0x3f497a['query']);_0x5255b1[_0x767f('0x35')]=_['intersection'](_0x3f497a['model'],qs['fields'](_0x3baf5b[_0x767f('0x33')]['fields']));_0x5255b1['attributes']=_0x5255b1['attributes']['length']?_0x5255b1[_0x767f('0x35')]:_0x3f497a[_0x767f('0x31')];_0x5255b1['order']=qs[_0x767f('0x3c')](_0x3baf5b[_0x767f('0x33')][_0x767f('0x3c')]);_0x5255b1['where']=qs[_0x767f('0x34')](_[_0x767f('0x3d')](_0x3baf5b['query'],_0x3f497a[_0x767f('0x34')]));if(_0x3baf5b[_0x767f('0x33')][_0x767f('0x3e')]){_0x5255b1[_0x767f('0x3f')]=_[_0x767f('0x40')](_0x5255b1[_0x767f('0x3f')],{'$or':_['map'](_0x5255b1[_0x767f('0x35')],function(_0x3c2f52){var _0x4a7396={};_0x4a7396[_0x3c2f52]={'$like':'%'+_0x3baf5b[_0x767f('0x33')][_0x767f('0x3e')]+'%'};return _0x4a7396;})});}_0x5255b1=_[_0x767f('0x40')]({},_0x5255b1,_0x3baf5b[_0x767f('0x45')]);return _0x41f782[_0x767f('0x63')](_0x5255b1);}})[_0x767f('0x24')](function(_0x3c496a){if(_0x3c496a){_0x31b505=_0x3c496a['length'];if(!_0x3baf5b[_0x767f('0x33')][_0x767f('0x39')](_0x767f('0x3a'))){_0x5255b1[_0x767f('0x1f')]=qs[_0x767f('0x1f')](_0x3baf5b[_0x767f('0x33')]['limit']);_0x5255b1[_0x767f('0x1e')]=qs[_0x767f('0x1e')](_0x3baf5b[_0x767f('0x33')][_0x767f('0x1e')]);}return _0x41f782['getTeams'](_0x5255b1);}})[_0x767f('0x24')](function(_0x4287e3){if(_0x4287e3){return _0x4287e3?{'count':_0x31b505,'rows':_0x4287e3}:null;}})[_0x767f('0x24')](respondWithResult(_0x1f8a1e,null))[_0x767f('0x47')](handleError(_0x1f8a1e,null));};exports[_0x767f('0x64')]=function(_0x3800c0,_0x4f249b,_0x18403e){var _0x12acf9=_0x3800c0['body']['ids'];return db[_0x767f('0x62')]['findAll']({'where':{'id':_0x12acf9},'attributes':['id'],'include':[{'model':db[_0x767f('0x58')],'as':_0x767f('0x65'),'attributes':['id',_0x767f('0x29'),'online',_0x767f('0x66'),_0x767f('0x67')],'raw':!![]}]})[_0x767f('0x24')](function(_0x2e6e52){if(_0x2e6e52){var _0x3b78d3=_[_0x767f('0x68')](_0x2e6e52,function(_0x1c586b){var _0x46caac=_0x1c586b['get']({'plain':!![]});return _0x46caac[_0x767f('0x65')];});return db[_0x767f('0x41')][_0x767f('0x46')]({'where':{'id':_0x3800c0[_0x767f('0x53')]['id']}})[_0x767f('0x24')](function(_0x589a9e){return db[_0x767f('0x69')][_0x767f('0x6a')](function(_0x14d100){return _0x589a9e[_0x767f('0x64')](_0x12acf9,{'transaction':_0x14d100})['then'](function(){return BPromise['each'](_0x3b78d3,function(_0x5b914f){return db['UserWhatsappQueue'][_0x767f('0x6b')]({'where':{'UserId':_0x5b914f['id'],'WhatsappQueueId':_0x3800c0['params']['id']},'transaction':_0x14d100});});})[_0x767f('0x24')](function(){_0x3b78d3[_0x767f('0x6c')](function(_0x2005e7){socket[_0x767f('0x6d')](_0x767f('0x6e'),{'UserId':_0x2005e7['id'],'WhatsappQueueId':_0x589a9e['id']});});});});});}})['then'](respondWithStatusCode(_0x4f249b,null))[_0x767f('0x47')](handleError(_0x4f249b,null));};exports[_0x767f('0x6f')]=function(_0x4258d8,_0x485fd8,_0xcf01e9){return db[_0x767f('0x62')]['findAll']({'where':{'id':_0x4258d8[_0x767f('0x33')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x767f('0x65'),'attributes':['id'],'raw':!![]}]})[_0x767f('0x24')](handleEntityNotFound(_0x485fd8,null))[_0x767f('0x24')](function(_0x9d7486){var _0x376862=_[_0x767f('0x2c')](_0x9d7486,'id');var _0x1bbb9e=[];var _0x41628c=[];var _0x5120aa=squel[_0x767f('0x70')]();_0x5120aa[_0x767f('0x71')](_0x767f('0x72'))[_0x767f('0x73')](_0x767f('0x74'),'tq')[_0x767f('0x75')](_0x767f('0x76'),'ut',_0x767f('0x77'))[_0x767f('0x3f')](_0x767f('0x78'),_0x4258d8['params']['id']);for(var _0x3d55dc=0x0;_0x3d55dc<_0x9d7486[_0x767f('0x38')];_0x3d55dc+=0x1){let _0x3a0a7b=_0x9d7486[_0x3d55dc];for(var _0x24772d=0x0;_0x24772d<_0x3a0a7b[_0x767f('0x65')][_0x767f('0x38')];_0x24772d+=0x1){let _0x53f12b=_0x3a0a7b[_0x767f('0x65')][_0x24772d];var _0x44d302=_0x5120aa[_0x767f('0x79')]();_0x44d302[_0x767f('0x3f')](_0x767f('0x7a'),_0x53f12b['id']);_0x41628c['push'](db['sequelize'][_0x767f('0x33')](_0x44d302['toString'](),{'type':db[_0x767f('0x69')][_0x767f('0x7b')][_0x767f('0x7c')]})[_0x767f('0x24')](function(_0x5955e3){if(_0x5955e3['length']===0x1){return _0x53f12b['id'];}else{var _0x323389=_['every'](_[_0x767f('0x2c')](_0x5955e3,_0x767f('0x7d')),function(_0xea3a45){return _[_0x767f('0x7e')](_0x376862,_0xea3a45);});if(_0x323389){return _0x53f12b['id'];}}}));}}return BPromise[_0x767f('0x7f')](_0x41628c)[_0x767f('0x24')](function(_0x584476){_0x1bbb9e=_(_0x1bbb9e)[_0x767f('0x80')](_0x584476)[_0x767f('0x81')]()['value']();return db[_0x767f('0x41')][_0x767f('0x46')]({'where':{'id':_0x4258d8[_0x767f('0x53')]['id']}})[_0x767f('0x24')](function(_0x3b00b7){return db[_0x767f('0x69')][_0x767f('0x6a')](function(_0x25a782){return _0x3b00b7[_0x767f('0x6f')](_0x4258d8[_0x767f('0x33')]['ids'],{'transaction':_0x25a782})['then'](function(){if(!_[_0x767f('0x82')](_0x1bbb9e)){return _0x3b00b7[_0x767f('0x83')](_0x1bbb9e,{'transaction':_0x25a782});}})[_0x767f('0x24')](function(){_0x1bbb9e[_0x767f('0x6c')](function(_0x23c527){socket[_0x767f('0x6d')](_0x767f('0x84'),{'UserId':_0x23c527,'WhatsappQueueId':_0x3b00b7['id']});});});});});});})[_0x767f('0x24')](respondWithStatusCode(_0x485fd8,null))[_0x767f('0x47')](handleError(_0x485fd8,null));};exports[_0x767f('0x85')]=function(_0x2684d8,_0x29631a,_0x524e48){return db[_0x767f('0x41')][_0x767f('0x46')]({'where':{'id':_0x2684d8[_0x767f('0x53')]['id']}})['then'](handleEntityNotFound(_0x29631a,null))[_0x767f('0x24')](function(_0x325292){if(_0x325292){return _0x325292[_0x767f('0x85')](_0x2684d8[_0x767f('0x49')][_0x767f('0x86')],_[_0x767f('0x87')](_0x2684d8[_0x767f('0x49')],['ids','id'])||{})[_0x767f('0x88')](function(_0x13304f){for(var _0xdfb1b4=0x0;_0xdfb1b4<_0x2684d8['body'][_0x767f('0x86')][_0x767f('0x38')];_0xdfb1b4+=0x1){socket[_0x767f('0x6d')]('userWhatsappQueue:save',{'UserId':Number(_0x2684d8[_0x767f('0x49')][_0x767f('0x86')][_0xdfb1b4]),'WhatsappQueueId':Number(_0x2684d8[_0x767f('0x53')]['id'])});}return _0x13304f;});}})[_0x767f('0x24')](respondWithResult(_0x29631a,null))['catch'](handleError(_0x29631a,null));};exports['removeAgents']=function(_0x56f5f7,_0x4db7c3,_0x1c257c){return db[_0x767f('0x41')][_0x767f('0x46')]({'where':{'id':_0x56f5f7[_0x767f('0x53')]['id']}})[_0x767f('0x24')](handleEntityNotFound(_0x4db7c3,null))['then'](function(_0x2ee6ba){if(_0x2ee6ba){return _0x2ee6ba[_0x767f('0x83')](_0x56f5f7[_0x767f('0x33')]['ids'])[_0x767f('0x24')](function(){if(_[_0x767f('0x89')](_0x56f5f7[_0x767f('0x33')]['ids'])){for(var _0x1627f4=0x0;_0x1627f4<_0x56f5f7[_0x767f('0x33')][_0x767f('0x86')][_0x767f('0x38')];_0x1627f4+=0x1){socket[_0x767f('0x6d')](_0x767f('0x84'),{'UserId':Number(_0x56f5f7['query']['ids'][_0x1627f4]),'WhatsappQueueId':Number(_0x56f5f7[_0x767f('0x53')]['id'])});}}else{socket[_0x767f('0x6d')](_0x767f('0x84'),{'UserId':Number(_0x56f5f7[_0x767f('0x33')][_0x767f('0x86')]),'WhatsappQueueId':Number(_0x56f5f7[_0x767f('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x4db7c3,null))['catch'](handleError(_0x4db7c3,null));};exports[_0x767f('0x8a')]=function(_0x5bd294,_0x4b470e,_0x58c7b0){var _0x31cc44={};var _0x355972={};var _0x21c19c;var _0x2caa24;return db[_0x767f('0x41')][_0x767f('0x61')]({'where':{'id':_0x5bd294[_0x767f('0x53')]['id']}})['then'](handleEntityNotFound(_0x4b470e,null))[_0x767f('0x24')](function(_0x28b0dd){if(_0x28b0dd){_0x21c19c=_0x28b0dd;_0x355972[_0x767f('0x31')]=_[_0x767f('0x32')](db[_0x767f('0x58')][_0x767f('0x2d')]);_0x355972[_0x767f('0x33')]=_['keys'](_0x5bd294[_0x767f('0x33')]);_0x355972['filters']=_[_0x767f('0x36')](_0x355972['model'],_0x355972['query']);_0x31cc44[_0x767f('0x35')]=_[_0x767f('0x36')](_0x355972[_0x767f('0x31')],qs['fields'](_0x5bd294[_0x767f('0x33')]['fields']));_0x31cc44[_0x767f('0x35')]=_0x31cc44[_0x767f('0x35')]['length']?_0x31cc44['attributes']:_0x355972[_0x767f('0x31')];_0x31cc44[_0x767f('0x3b')]=qs['sort'](_0x5bd294['query'][_0x767f('0x3c')]);_0x31cc44[_0x767f('0x3f')]=qs[_0x767f('0x34')](_[_0x767f('0x3d')](_0x5bd294[_0x767f('0x33')],_0x355972[_0x767f('0x34')]));if(_0x5bd294[_0x767f('0x33')]['filter']){_0x31cc44['where']=_[_0x767f('0x40')](_0x31cc44[_0x767f('0x3f')],{'$or':_[_0x767f('0x2c')](_0x31cc44[_0x767f('0x35')],function(_0x5154cb){var _0x5b111c={};_0x5b111c[_0x5154cb]={'$like':'%'+_0x5bd294['query']['filter']+'%'};return _0x5b111c;})});}_0x31cc44=_[_0x767f('0x40')]({},_0x31cc44,_0x5bd294['options']);return _0x21c19c['getAgents'](_0x31cc44);}})[_0x767f('0x24')](function(_0x47ed87){if(_0x47ed87){_0x2caa24=_0x47ed87[_0x767f('0x38')];if(!_0x5bd294['query'][_0x767f('0x39')](_0x767f('0x3a'))){_0x31cc44[_0x767f('0x1f')]=qs[_0x767f('0x1f')](_0x5bd294[_0x767f('0x33')][_0x767f('0x1f')]);_0x31cc44[_0x767f('0x1e')]=qs['offset'](_0x5bd294['query'][_0x767f('0x1e')]);}return _0x21c19c[_0x767f('0x8a')](_0x31cc44);}})['then'](function(_0x4981e3){if(_0x4981e3){return _0x4981e3?{'count':_0x2caa24,'rows':_0x4981e3}:null;}})[_0x767f('0x24')](respondWithResult(_0x4b470e,null))[_0x767f('0x47')](handleError(_0x4b470e,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 330f066..1da03ba 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 _0xe67f=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x5e1eae,_0x2d2a56){var _0x3217c5=function(_0xb968dd){while(--_0xb968dd){_0x5e1eae['push'](_0x5e1eae['shift']());}};_0x3217c5(++_0x2d2a56);}(_0xe67f,0x153));var _0xfe67=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xe67f[_0x8c43de];return _0xa6591b;};'use strict';var EventEmitter=require(_0xfe67('0x0'));var WhatsappQueue=require(_0xfe67('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xfe67('0x2')](0x0);var events={'afterCreate':_0xfe67('0x3'),'afterUpdate':_0xfe67('0x4'),'afterDestroy':'remove'};function emitEvent(_0x352379){return function(_0x3f7534,_0x1a1af3,_0x552237){WhatsappQueueEvents[_0xfe67('0x5')](_0x352379+':'+_0x3f7534['id'],_0x3f7534);WhatsappQueueEvents[_0xfe67('0x5')](_0x352379,_0x3f7534);_0x552237(null);};}for(var e in events){if(events[_0xfe67('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xfe67('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0x203c=['../../mysqldb','WhatsappQueue','save','update','emit','hasOwnProperty','hook','events'];(function(_0x525370,_0x5abe18){var _0x4a1ae9=function(_0x257f97){while(--_0x257f97){_0x525370['push'](_0x525370['shift']());}};_0x4a1ae9(++_0x5abe18);}(_0x203c,0x12f));var _0xc203=function(_0x5a8f1e,_0x34e14e){_0x5a8f1e=_0x5a8f1e-0x0;var _0x19072f=_0x203c[_0x5a8f1e];return _0x19072f;};'use strict';var EventEmitter=require(_0xc203('0x0'));var WhatsappQueue=require(_0xc203('0x1'))['db'][_0xc203('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc203('0x3'),'afterUpdate':_0xc203('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5d40d2){return function(_0x38c4d6,_0x6102d1,_0x2aef1c){WhatsappQueueEvents[_0xc203('0x5')](_0x5d40d2+':'+_0x38c4d6['id'],_0x38c4d6);WhatsappQueueEvents[_0xc203('0x5')](_0x5d40d2,_0x38c4d6);_0x2aef1c(null);};}for(var e in events){if(events[_0xc203('0x6')](e)){var event=events[e];WhatsappQueue[_0xc203('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 a5f01be..992dd85 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 _0x1ddd=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','whatsapp_queues','lodash','util'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0x1ddd,0x195));var _0xd1dd=function(_0x3f6cf3,_0xf29a91){_0x3f6cf3=_0x3f6cf3-0x0;var _0xb1ba7c=_0x1ddd[_0x3f6cf3];return _0xb1ba7c;};'use strict';var _=require(_0xd1dd('0x0'));var util=require(_0xd1dd('0x1'));var logger=require(_0xd1dd('0x2'))('api');var moment=require(_0xd1dd('0x3'));var BPromise=require('bluebird');var rp=require(_0xd1dd('0x4'));var fs=require('fs');var path=require(_0xd1dd('0x5'));var rimraf=require(_0xd1dd('0x6'));var config=require(_0xd1dd('0x7'));var attributes=require(_0xd1dd('0x8'));module[_0xd1dd('0x9')]=function(_0x52e71a,_0x5ef969){return _0x52e71a['define']('WhatsappQueue',attributes,{'tableName':_0xd1dd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6dfa=['define','WhatsappQueue','whatsapp_queues','lodash','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x516308,_0x2318c6){var _0x344466=function(_0x3b63ec){while(--_0x3b63ec){_0x516308['push'](_0x516308['shift']());}};_0x344466(++_0x2318c6);}(_0x6dfa,0x12f));var _0xa6df=function(_0x21c027,_0x23ac0a){_0x21c027=_0x21c027-0x0;var _0x6c0246=_0x6dfa[_0x21c027];return _0x6c0246;};'use strict';var _=require(_0xa6df('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa6df('0x1'));var moment=require(_0xa6df('0x2'));var BPromise=require(_0xa6df('0x3'));var rp=require(_0xa6df('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa6df('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappQueue.attributes');module[_0xa6df('0x6')]=function(_0x51000e,_0x2a46a2){return _0x51000e[_0xa6df('0x7')](_0xa6df('0x8'),attributes,{'tableName':_0xa6df('0x9'),'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 f044b8a..7f91a74 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 _0xa9dc=['where','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetWhatsappQueue','findAll','options','raw','attributes','limit','include','map','model','ShowWhatsappQueue','WhatsappQueue','find'];(function(_0x483bfd,_0x3d7076){var _0x58a063=function(_0x43a8fb){while(--_0x43a8fb){_0x483bfd['push'](_0x483bfd['shift']());}};_0x58a063(++_0x3d7076);}(_0xa9dc,0x9d));var _0xca9d=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0xa9dc[_0x86b219];return _0x1f320c;};'use strict';var _=require('lodash');var util=require(_0xca9d('0x0'));var moment=require(_0xca9d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca9d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xca9d('0x3'));var logger=require(_0xca9d('0x4'))(_0xca9d('0x5'));var config=require('../../config/environment');var jayson=require(_0xca9d('0x6'));var client=jayson[_0xca9d('0x7')][_0xca9d('0x8')]({'port':0x232a});config[_0xca9d('0x9')]=_[_0xca9d('0xa')](config[_0xca9d('0x9')],{'host':_0xca9d('0xb'),'port':0x18eb});var socket=require(_0xca9d('0xc'))(new Redis(config['redis']));require('./whatsappQueue.socket')['register'](socket);function respondWithRpcPromise(_0x3f6ec2,_0x5ca3ed,_0x5d6088){return new BPromise(function(_0x61d6e4,_0x44cb19){return client[_0xca9d('0xd')](_0x3f6ec2,_0x5d6088)[_0xca9d('0xe')](function(_0x370c0f){logger[_0xca9d('0xf')](_0xca9d('0x10'),_0x5ca3ed,'request\x20sent');logger[_0xca9d('0x11')](_0xca9d('0x12'),_0x5ca3ed,_0xca9d('0x13'),JSON[_0xca9d('0x14')](_0x370c0f));if(_0x370c0f[_0xca9d('0x15')]){if(_0x370c0f[_0xca9d('0x15')][_0xca9d('0x16')]===0x1f4){logger[_0xca9d('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x5ca3ed,_0x370c0f[_0xca9d('0x15')][_0xca9d('0x17')]);return _0x44cb19(_0x370c0f[_0xca9d('0x15')][_0xca9d('0x17')]);}logger['error'](_0xca9d('0x10'),_0x5ca3ed,_0x370c0f[_0xca9d('0x15')]['message']);return _0x61d6e4(_0x370c0f[_0xca9d('0x15')][_0xca9d('0x17')]);}else{logger[_0xca9d('0xf')](_0xca9d('0x10'),_0x5ca3ed,'request\x20sent');_0x61d6e4(_0x370c0f[_0xca9d('0x18')][_0xca9d('0x17')]);}})[_0xca9d('0x19')](function(_0xd357d){logger[_0xca9d('0x15')](_0xca9d('0x10'),_0x5ca3ed,_0xd357d);_0x44cb19(_0xd357d);});});}exports[_0xca9d('0x1a')]=function(_0x1f8c0a){var _0x100992=this;return new Promise(function(_0x89f518,_0x27f1ea){return db['WhatsappQueue'][_0xca9d('0x1b')]({'raw':_0x1f8c0a[_0xca9d('0x1c')]?_0x1f8c0a[_0xca9d('0x1c')][_0xca9d('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f8c0a[_0xca9d('0x1c')]?_0x1f8c0a[_0xca9d('0x1c')]['where']||null:null,'attributes':_0x1f8c0a['options']?_0x1f8c0a[_0xca9d('0x1c')][_0xca9d('0x1e')]||null:null,'limit':_0x1f8c0a[_0xca9d('0x1c')]?_0x1f8c0a[_0xca9d('0x1c')][_0xca9d('0x1f')]||null:null,'include':_0x1f8c0a[_0xca9d('0x1c')]?_0x1f8c0a[_0xca9d('0x1c')][_0xca9d('0x20')]?_['map'](_0x1f8c0a[_0xca9d('0x1c')][_0xca9d('0x20')],function(_0x12dd65){return{'model':db[_0x12dd65['model']],'as':_0x12dd65['as'],'attributes':_0x12dd65[_0xca9d('0x1e')],'include':_0x12dd65[_0xca9d('0x20')]?_[_0xca9d('0x21')](_0x12dd65['include'],function(_0x38b5de){return{'model':db[_0x38b5de[_0xca9d('0x22')]],'as':_0x38b5de['as'],'attributes':_0x38b5de[_0xca9d('0x1e')],'include':_0x38b5de[_0xca9d('0x20')]?_[_0xca9d('0x21')](_0x38b5de[_0xca9d('0x20')],function(_0x5e61dc){return{'model':db[_0x5e61dc['model']],'as':_0x5e61dc['as'],'attributes':_0x5e61dc[_0xca9d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xca9d('0xe')](function(_0x1410a4){logger[_0xca9d('0xf')](_0xca9d('0x1a'),_0x1f8c0a);logger[_0xca9d('0x11')](_0xca9d('0x1a'),_0x1f8c0a,JSON['stringify'](_0x1410a4));_0x89f518(_0x1410a4);})['catch'](function(_0x322c5c){logger[_0xca9d('0x15')]('GetWhatsappQueue',_0x322c5c[_0xca9d('0x17')],_0x1f8c0a);_0x27f1ea(_0x100992[_0xca9d('0x15')](0x1f4,_0x322c5c[_0xca9d('0x17')]));});});};exports[_0xca9d('0x23')]=function(_0x3a1e0d){var _0x45a6e0=this;return new Promise(function(_0x4b7cca,_0x38b5bc){return db[_0xca9d('0x24')][_0xca9d('0x25')]({'raw':_0x3a1e0d['options']?_0x3a1e0d[_0xca9d('0x1c')][_0xca9d('0x1d')]===undefined?!![]:![]:!![],'where':_0x3a1e0d[_0xca9d('0x1c')]?_0x3a1e0d[_0xca9d('0x1c')][_0xca9d('0x26')]||null:null,'attributes':_0x3a1e0d[_0xca9d('0x1c')]?_0x3a1e0d[_0xca9d('0x1c')][_0xca9d('0x1e')]||null:null,'include':_0x3a1e0d[_0xca9d('0x1c')]?_0x3a1e0d['options'][_0xca9d('0x20')]?_[_0xca9d('0x21')](_0x3a1e0d[_0xca9d('0x1c')]['include'],function(_0xa4796f){return{'model':db[_0xa4796f[_0xca9d('0x22')]],'as':_0xa4796f['as'],'attributes':_0xa4796f['attributes'],'include':_0xa4796f[_0xca9d('0x20')]?_[_0xca9d('0x21')](_0xa4796f[_0xca9d('0x20')],function(_0x369c4f){return{'model':db[_0x369c4f['model']],'as':_0x369c4f['as'],'attributes':_0x369c4f[_0xca9d('0x1e')],'include':_0x369c4f['include']?_[_0xca9d('0x21')](_0x369c4f['include'],function(_0x517ea2){return{'model':db[_0x517ea2[_0xca9d('0x22')]],'as':_0x517ea2['as'],'attributes':_0x517ea2[_0xca9d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xca9d('0xe')](function(_0x29790d){logger[_0xca9d('0xf')](_0xca9d('0x23'),_0x3a1e0d);logger[_0xca9d('0x11')](_0xca9d('0x23'),_0x3a1e0d,JSON[_0xca9d('0x14')](_0x29790d));_0x4b7cca(_0x29790d);})['catch'](function(_0x43c667){logger[_0xca9d('0x15')](_0xca9d('0x23'),_0x43c667[_0xca9d('0x17')],_0x3a1e0d);_0x38b5bc(_0x45a6e0[_0xca9d('0x15')](0x1f4,_0x43c667[_0xca9d('0x17')]));});});}; \ No newline at end of file +var _0x9384=['GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','map','include','model','ShowWhatsappQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','defaults','redis','localhost','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9384,0x1b9));var _0x4938=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x9384[_0x3a73bc];return _0x32891b;};'use strict';var _=require(_0x4938('0x0'));var util=require('util');var moment=require(_0x4938('0x1'));var BPromise=require(_0x4938('0x2'));var rs=require(_0x4938('0x3'));var fs=require('fs');var Redis=require(_0x4938('0x4'));var db=require(_0x4938('0x5'))['db'];var utils=require(_0x4938('0x6'));var logger=require(_0x4938('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4938('0x8'));var client=jayson[_0x4938('0x9')]['http']({'port':0x232a});config['redis']=_[_0x4938('0xa')](config[_0x4938('0xb')],{'host':_0x4938('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4938('0xb')]));require(_0x4938('0xd'))[_0x4938('0xe')](socket);function respondWithRpcPromise(_0x33b912,_0x16a083,_0x2c944e){return new BPromise(function(_0x7e521a,_0x5185bd){return client[_0x4938('0xf')](_0x33b912,_0x2c944e)[_0x4938('0x10')](function(_0x27fc10){logger[_0x4938('0x11')](_0x4938('0x12'),_0x16a083,_0x4938('0x13'));logger[_0x4938('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x16a083,'request\x20sent',JSON[_0x4938('0x15')](_0x27fc10));if(_0x27fc10['error']){if(_0x27fc10[_0x4938('0x16')][_0x4938('0x17')]===0x1f4){logger[_0x4938('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x16a083,_0x27fc10[_0x4938('0x16')][_0x4938('0x18')]);return _0x5185bd(_0x27fc10[_0x4938('0x16')]['message']);}logger[_0x4938('0x16')](_0x4938('0x12'),_0x16a083,_0x27fc10[_0x4938('0x16')][_0x4938('0x18')]);return _0x7e521a(_0x27fc10['error'][_0x4938('0x18')]);}else{logger[_0x4938('0x11')](_0x4938('0x12'),_0x16a083,'request\x20sent');_0x7e521a(_0x27fc10[_0x4938('0x19')][_0x4938('0x18')]);}})[_0x4938('0x1a')](function(_0x1fbf26){logger[_0x4938('0x16')](_0x4938('0x12'),_0x16a083,_0x1fbf26);_0x5185bd(_0x1fbf26);});});}exports[_0x4938('0x1b')]=function(_0xaea955){var _0x424740=this;return new Promise(function(_0x25f0a8,_0x4974a2){return db[_0x4938('0x1c')][_0x4938('0x1d')]({'raw':_0xaea955[_0x4938('0x1e')]?_0xaea955['options'][_0x4938('0x1f')]===undefined?!![]:![]:!![],'where':_0xaea955[_0x4938('0x1e')]?_0xaea955[_0x4938('0x1e')][_0x4938('0x20')]||null:null,'attributes':_0xaea955[_0x4938('0x1e')]?_0xaea955[_0x4938('0x1e')][_0x4938('0x21')]||null:null,'limit':_0xaea955['options']?_0xaea955[_0x4938('0x1e')]['limit']||null:null,'include':_0xaea955[_0x4938('0x1e')]?_0xaea955[_0x4938('0x1e')]['include']?_[_0x4938('0x22')](_0xaea955['options'][_0x4938('0x23')],function(_0x2988f0){return{'model':db[_0x2988f0[_0x4938('0x24')]],'as':_0x2988f0['as'],'attributes':_0x2988f0[_0x4938('0x21')],'include':_0x2988f0[_0x4938('0x23')]?_[_0x4938('0x22')](_0x2988f0['include'],function(_0x217263){return{'model':db[_0x217263[_0x4938('0x24')]],'as':_0x217263['as'],'attributes':_0x217263[_0x4938('0x21')],'include':_0x217263[_0x4938('0x23')]?_[_0x4938('0x22')](_0x217263[_0x4938('0x23')],function(_0x61b42){return{'model':db[_0x61b42[_0x4938('0x24')]],'as':_0x61b42['as'],'attributes':_0x61b42[_0x4938('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4938('0x10')](function(_0x4072a7){logger[_0x4938('0x11')]('GetWhatsappQueue',_0xaea955);logger[_0x4938('0x14')](_0x4938('0x1b'),_0xaea955,JSON[_0x4938('0x15')](_0x4072a7));_0x25f0a8(_0x4072a7);})[_0x4938('0x1a')](function(_0x8f8155){logger[_0x4938('0x16')](_0x4938('0x1b'),_0x8f8155[_0x4938('0x18')],_0xaea955);_0x4974a2(_0x424740[_0x4938('0x16')](0x1f4,_0x8f8155[_0x4938('0x18')]));});});};exports[_0x4938('0x25')]=function(_0x361dab){var _0x35b39e=this;return new Promise(function(_0x420330,_0x1fa93b){return db['WhatsappQueue'][_0x4938('0x26')]({'raw':_0x361dab[_0x4938('0x1e')]?_0x361dab[_0x4938('0x1e')][_0x4938('0x1f')]===undefined?!![]:![]:!![],'where':_0x361dab['options']?_0x361dab[_0x4938('0x1e')][_0x4938('0x20')]||null:null,'attributes':_0x361dab['options']?_0x361dab[_0x4938('0x1e')][_0x4938('0x21')]||null:null,'include':_0x361dab[_0x4938('0x1e')]?_0x361dab['options'][_0x4938('0x23')]?_[_0x4938('0x22')](_0x361dab[_0x4938('0x1e')][_0x4938('0x23')],function(_0x3bf1b4){return{'model':db[_0x3bf1b4[_0x4938('0x24')]],'as':_0x3bf1b4['as'],'attributes':_0x3bf1b4[_0x4938('0x21')],'include':_0x3bf1b4[_0x4938('0x23')]?_['map'](_0x3bf1b4[_0x4938('0x23')],function(_0x270b79){return{'model':db[_0x270b79[_0x4938('0x24')]],'as':_0x270b79['as'],'attributes':_0x270b79[_0x4938('0x21')],'include':_0x270b79[_0x4938('0x23')]?_[_0x4938('0x22')](_0x270b79[_0x4938('0x23')],function(_0x4c5c9f){return{'model':db[_0x4c5c9f['model']],'as':_0x4c5c9f['as'],'attributes':_0x4c5c9f[_0x4938('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4938('0x10')](function(_0xd8337c){logger[_0x4938('0x11')](_0x4938('0x25'),_0x361dab);logger[_0x4938('0x14')](_0x4938('0x25'),_0x361dab,JSON[_0x4938('0x15')](_0xd8337c));_0x420330(_0xd8337c);})[_0x4938('0x1a')](function(_0x230f7b){logger[_0x4938('0x16')](_0x4938('0x25'),_0x230f7b['message'],_0x361dab);_0x1fa93b(_0x35b39e[_0x4938('0x16')](0x1f4,_0x230f7b[_0x4938('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 260bc02..59c3283 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 _0xe18b=['length','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','register'];(function(_0x260fb9,_0x2bc9da){var _0x5326af=function(_0x3f00ae){while(--_0x3f00ae){_0x260fb9['push'](_0x260fb9['shift']());}};_0x5326af(++_0x2bc9da);}(_0xe18b,0xca));var _0xbe18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe18b[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappQueueEvents=require(_0xbe18('0x0'));var events=[_0xbe18('0x1'),_0xbe18('0x2'),_0xbe18('0x3')];function createListener(_0x2bb5eb,_0x4bd409){return function(_0x154bde){_0x4bd409[_0xbe18('0x4')](_0x2bb5eb,_0x154bde);};}function removeListener(_0x2c9f5c,_0x4c06cd){return function(){WhatsappQueueEvents['removeListener'](_0x2c9f5c,_0x4c06cd);};}exports[_0xbe18('0x5')]=function(_0x2ce63c){for(var _0xdf28b3=0x0,_0x6dd9b7=events[_0xbe18('0x6')];_0xdf28b3<_0x6dd9b7;_0xdf28b3++){var _0x4214b7=events[_0xdf28b3];var _0x218018=createListener(_0xbe18('0x7')+_0x4214b7,_0x2ce63c);WhatsappQueueEvents['on'](_0x4214b7,_0x218018);}}; \ No newline at end of file +var _0x4fce=['remove','update','removeListener','register','length','whatsappQueue:'];(function(_0x2aee2f,_0xad9887){var _0x19337f=function(_0x2e62d){while(--_0x2e62d){_0x2aee2f['push'](_0x2aee2f['shift']());}};_0x19337f(++_0xad9887);}(_0x4fce,0x1c2));var _0xe4fc=function(_0x435b4f,_0x2c6580){_0x435b4f=_0x435b4f-0x0;var _0xdf9d46=_0x4fce[_0x435b4f];return _0xdf9d46;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0xe4fc('0x0'),_0xe4fc('0x1')];function createListener(_0x8a55c7,_0x5a4767){return function(_0x2fe303){_0x5a4767['emit'](_0x8a55c7,_0x2fe303);};}function removeListener(_0x52f4bc,_0x20cbb4){return function(){WhatsappQueueEvents[_0xe4fc('0x2')](_0x52f4bc,_0x20cbb4);};}exports[_0xe4fc('0x3')]=function(_0x54ecc7){for(var _0xcd3202=0x0,_0x3f845b=events[_0xe4fc('0x4')];_0xcd3202<_0x3f845b;_0xcd3202++){var _0x18ffba=events[_0xcd3202];var _0x286ead=createListener(_0xe4fc('0x5')+_0x18ffba,_0x54ecc7);WhatsappQueueEvents['on'](_0x18ffba,_0x286ead);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index a4f113d..6ddd9f3 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 _0xde1c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x2be4bf,_0x2216a5){var _0x1907d1=function(_0x173cbb){while(--_0x173cbb){_0x2be4bf['push'](_0x2be4bf['shift']());}};_0x1907d1(++_0x2216a5);}(_0xde1c,0x19d));var _0xcde1=function(_0x40804c,_0x24250e){_0x40804c=_0x40804c-0x0;var _0x1321ab=_0xde1c[_0x40804c];return _0x1321ab;};'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['describe']);router['get'](_0xcde1('0xf'),auth[_0xcde1('0xc')](),controller['show']);router[_0xcde1('0x10')]('/',auth['isAuthenticated'](),controller[_0xcde1('0x11')]);router[_0xcde1('0x12')](_0xcde1('0xf'),auth[_0xcde1('0xc')](),controller[_0xcde1('0x13')]);router[_0xcde1('0x14')](_0xcde1('0xf'),auth['isAuthenticated'](),controller[_0xcde1('0x15')]);module['exports']=router; \ No newline at end of file +var _0xa84e=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./whatsappQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy'];(function(_0x74d22,_0x383575){var _0x4b23e1=function(_0x27bdc8){while(--_0x27bdc8){_0x74d22['push'](_0x74d22['shift']());}};_0x4b23e1(++_0x383575);}(_0xa84e,0x151));var _0xea84=function(_0x577fa5,_0x1989b4){_0x577fa5=_0x577fa5-0x0;var _0x3c36be=_0xa84e[_0x577fa5];return _0x3c36be;};'use strict';var multer=require(_0xea84('0x0'));var util=require(_0xea84('0x1'));var path=require(_0xea84('0x2'));var timeout=require(_0xea84('0x3'));var express=require(_0xea84('0x4'));var router=express['Router']();var fs_extra=require(_0xea84('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xea84('0x6'));var config=require('../../config/environment');var controller=require(_0xea84('0x7'));router[_0xea84('0x8')]('/',auth['isAuthenticated'](),controller[_0xea84('0x9')]);router[_0xea84('0x8')](_0xea84('0xa'),auth[_0xea84('0xb')](),controller[_0xea84('0xc')]);router['get'](_0xea84('0xd'),auth[_0xea84('0xb')](),controller[_0xea84('0xe')]);router[_0xea84('0xf')]('/',auth[_0xea84('0xb')](),controller['create']);router[_0xea84('0x10')](_0xea84('0xd'),auth[_0xea84('0xb')](),controller[_0xea84('0x11')]);router[_0xea84('0x12')](_0xea84('0xd'),auth[_0xea84('0xb')](),controller[_0xea84('0x13')]);module[_0xea84('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 669d1d6..ee3e993 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 _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x1bad39,_0xe98f7e){var _0x3e60ce=function(_0x4cf8e0){while(--_0x4cf8e0){_0x1bad39['push'](_0x1bad39['shift']());}};_0x3e60ce(++_0xe98f7e);}(_0x7a54,0x106));var _0x47a5=function(_0x5790c0,_0x23d5a6){_0x5790c0=_0x5790c0-0x0;var _0xa241d3=_0x7a54[_0x5790c0];return _0xa241d3;};'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 +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x535f56,_0x2e8005){var _0x1c32d3=function(_0x215e0f){while(--_0x215e0f){_0x535f56['push'](_0x535f56['shift']());}};_0x1c32d3(++_0x2e8005);}(_0x7a54,0x106));var _0x47a5=function(_0x56ca0d,_0xd662){_0x56ca0d=_0x56ca0d-0x0;var _0x34d3cf=_0x7a54[_0x56ca0d];return _0x34d3cf;};'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 0a54958..e9291b8 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 _0x69d3=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','WhatsappQueueReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','create','body','catch','update','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv'];(function(_0x24d798,_0x482615){var _0x45e510=function(_0x3f3075){while(--_0x3f3075){_0x24d798['push'](_0x24d798['shift']());}};_0x45e510(++_0x482615);}(_0x69d3,0xda));var _0x369d=function(_0x42aa98,_0x33d3ed){_0x42aa98=_0x42aa98-0x0;var _0x313d3e=_0x69d3[_0x42aa98];return _0x313d3e;};'use strict';var emlformat=require(_0x369d('0x0'));var rimraf=require(_0x369d('0x1'));var zipdir=require(_0x369d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x369d('0x3'));var moment=require(_0x369d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x369d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x369d('0x6'));var ejs=require(_0x369d('0x7'));var fs=require('fs');var fs_extra=require(_0x369d('0x8'));var _=require(_0x369d('0x9'));var squel=require(_0x369d('0xa'));var crypto=require(_0x369d('0xb'));var jsforce=require(_0x369d('0xc'));var deskjs=require(_0x369d('0xd'));var toCsv=require(_0x369d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x369d('0xe'));var authService=require(_0x369d('0xf'));var qs=require(_0x369d('0x10'));var as=require(_0x369d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x369d('0x12'));var utils=require(_0x369d('0x13'));var config=require(_0x369d('0x14'));var licenseUtil=require(_0x369d('0x15'));var db=require(_0x369d('0x16'))['db'];function respondWithStatusCode(_0xee549e,_0x52c126){_0x52c126=_0x52c126||0xcc;return function(_0x15b417){if(_0x15b417){return _0xee549e[_0x369d('0x17')](_0x52c126);}return _0xee549e[_0x369d('0x18')](_0x52c126)[_0x369d('0x19')]();};}function respondWithResult(_0x121307,_0x539536){_0x539536=_0x539536||0xc8;return function(_0x5cd4c3){if(_0x5cd4c3){return _0x121307['status'](_0x539536)[_0x369d('0x1a')](_0x5cd4c3);}};}function respondWithFilteredResult(_0xa126c1,_0x389c43){return function(_0x5b4f55){if(_0x5b4f55){var _0x2c1a4a=typeof _0x389c43[_0x369d('0x1b')]===_0x369d('0x1c')&&typeof _0x389c43['limit']===_0x369d('0x1c');var _0x1f37ff=_0x5b4f55['count'];var _0x572513=_0x2c1a4a?0x0:_0x389c43['offset'];var _0x2946be=_0x2c1a4a?_0x5b4f55[_0x369d('0x1d')]:_0x389c43[_0x369d('0x1b')]+_0x389c43['limit'];var _0x410dbe;if(_0x2946be>=_0x1f37ff){_0x2946be=_0x1f37ff;_0x410dbe=0xc8;}else{_0x410dbe=0xce;}_0xa126c1[_0x369d('0x18')](_0x410dbe);return _0xa126c1[_0x369d('0x1e')](_0x369d('0x1f'),_0x572513+'-'+_0x2946be+'/'+_0x1f37ff)[_0x369d('0x1a')](_0x5b4f55);}return null;};}function patchUpdates(_0x538ca4){return function(_0x5c9fdd){try{jsonpatch[_0x369d('0x20')](_0x5c9fdd,_0x538ca4,!![]);}catch(_0x1edcd5){return BPromise[_0x369d('0x21')](_0x1edcd5);}return _0x5c9fdd[_0x369d('0x22')]();};}function saveUpdates(_0x84cc0f,_0x15fbef){return function(_0x1b262a){if(_0x1b262a){return _0x1b262a['update'](_0x84cc0f)['then'](function(_0x32ef9a){return _0x32ef9a;});}return null;};}function removeEntity(_0xed16e,_0xf7bc3a){return function(_0xcae58){if(_0xcae58){return _0xcae58[_0x369d('0x23')]()[_0x369d('0x24')](function(){_0xed16e[_0x369d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dfe83,_0x16145e){return function(_0x46de2b){if(!_0x46de2b){_0x4dfe83[_0x369d('0x17')](0x194);}return _0x46de2b;};}function handleError(_0xe01d2b,_0x8aa521){_0x8aa521=_0x8aa521||0x1f4;return function(_0x41e0cf){logger[_0x369d('0x25')](_0x41e0cf['stack']);if(_0x41e0cf[_0x369d('0x26')]){delete _0x41e0cf[_0x369d('0x26')];}_0xe01d2b[_0x369d('0x18')](_0x8aa521)[_0x369d('0x27')](_0x41e0cf);};}exports[_0x369d('0x28')]=function(_0x41367a,_0x3d1ce0){var _0x4d42ea={},_0x157291={},_0x56efb1={'count':0x0,'rows':[]};var _0x57b94c=_[_0x369d('0x29')](db[_0x369d('0x2a')]['rawAttributes'],function(_0x104540){return{'name':_0x104540['fieldName'],'type':_0x104540[_0x369d('0x2b')][_0x369d('0x2c')]};});_0x157291[_0x369d('0x2d')]=_[_0x369d('0x29')](_0x57b94c,_0x369d('0x26'));_0x157291[_0x369d('0x2e')]=_[_0x369d('0x2f')](_0x41367a['query']);_0x157291[_0x369d('0x30')]=_[_0x369d('0x31')](_0x157291[_0x369d('0x2d')],_0x157291[_0x369d('0x2e')]);_0x4d42ea[_0x369d('0x32')]=_[_0x369d('0x31')](_0x157291[_0x369d('0x2d')],qs[_0x369d('0x33')](_0x41367a['query'][_0x369d('0x33')]));_0x4d42ea[_0x369d('0x32')]=_0x4d42ea[_0x369d('0x32')][_0x369d('0x34')]?_0x4d42ea[_0x369d('0x32')]:_0x157291['model'];if(!_0x41367a[_0x369d('0x2e')][_0x369d('0x35')](_0x369d('0x36'))){_0x4d42ea[_0x369d('0x37')]=qs[_0x369d('0x37')](_0x41367a[_0x369d('0x2e')]['limit']);_0x4d42ea[_0x369d('0x1b')]=qs[_0x369d('0x1b')](_0x41367a[_0x369d('0x2e')][_0x369d('0x1b')]);}_0x4d42ea[_0x369d('0x38')]=qs[_0x369d('0x39')](_0x41367a[_0x369d('0x2e')][_0x369d('0x39')]);_0x4d42ea[_0x369d('0x3a')]=qs[_0x369d('0x30')](_[_0x369d('0x3b')](_0x41367a[_0x369d('0x2e')],_0x157291[_0x369d('0x30')]),_0x57b94c);if(_0x41367a[_0x369d('0x2e')][_0x369d('0x3c')]){_0x4d42ea[_0x369d('0x3a')]=_[_0x369d('0x3d')](_0x4d42ea[_0x369d('0x3a')],{'$or':_[_0x369d('0x29')](_0x57b94c,function(_0x7fd64b){if(_0x7fd64b[_0x369d('0x2b')]!==_0x369d('0x3e')){var _0xb7837f={};_0xb7837f[_0x7fd64b[_0x369d('0x26')]]={'$like':'%'+_0x41367a['query']['filter']+'%'};return _0xb7837f;}})});}_0x4d42ea=_[_0x369d('0x3d')]({},_0x4d42ea,_0x41367a[_0x369d('0x3f')]);var _0x8a1ef5={'where':_0x4d42ea[_0x369d('0x3a')]};return db[_0x369d('0x2a')][_0x369d('0x1d')](_0x8a1ef5)[_0x369d('0x24')](function(_0x169340){_0x56efb1[_0x369d('0x1d')]=_0x169340;if(_0x41367a['query'][_0x369d('0x40')]){_0x4d42ea[_0x369d('0x41')]=[{'all':!![]}];}return db[_0x369d('0x2a')][_0x369d('0x42')](_0x4d42ea);})[_0x369d('0x24')](function(_0x25cf4e){_0x56efb1[_0x369d('0x43')]=_0x25cf4e;return _0x56efb1;})[_0x369d('0x24')](respondWithFilteredResult(_0x3d1ce0,_0x4d42ea))['catch'](handleError(_0x3d1ce0,null));};exports['show']=function(_0x20b351,_0x3222ce){var _0x30909a={'raw':!![],'where':{'id':_0x20b351['params']['id']}},_0x4dad71={};_0x4dad71['model']=_[_0x369d('0x2f')](db[_0x369d('0x2a')]['rawAttributes']);_0x4dad71[_0x369d('0x2e')]=_[_0x369d('0x2f')](_0x20b351[_0x369d('0x2e')]);_0x4dad71[_0x369d('0x30')]=_['intersection'](_0x4dad71[_0x369d('0x2d')],_0x4dad71['query']);_0x30909a[_0x369d('0x32')]=_['intersection'](_0x4dad71[_0x369d('0x2d')],qs[_0x369d('0x33')](_0x20b351[_0x369d('0x2e')]['fields']));_0x30909a['attributes']=_0x30909a[_0x369d('0x32')][_0x369d('0x34')]?_0x30909a[_0x369d('0x32')]:_0x4dad71['model'];if(_0x20b351[_0x369d('0x2e')][_0x369d('0x40')]){_0x30909a[_0x369d('0x41')]=[{'all':!![]}];}_0x30909a=_[_0x369d('0x3d')]({},_0x30909a,_0x20b351[_0x369d('0x3f')]);return db[_0x369d('0x2a')][_0x369d('0x44')](_0x30909a)[_0x369d('0x24')](handleEntityNotFound(_0x3222ce,null))[_0x369d('0x24')](respondWithResult(_0x3222ce,null))['catch'](handleError(_0x3222ce,null));};exports[_0x369d('0x45')]=function(_0x41066d,_0xcc1465){return db[_0x369d('0x2a')][_0x369d('0x45')](_0x41066d[_0x369d('0x46')],{})['then'](respondWithResult(_0xcc1465,0xc9))[_0x369d('0x47')](handleError(_0xcc1465,null));};exports[_0x369d('0x48')]=function(_0x16dd8f,_0x44a357){if(_0x16dd8f[_0x369d('0x46')]['id']){delete _0x16dd8f[_0x369d('0x46')]['id'];}return db[_0x369d('0x2a')][_0x369d('0x44')]({'where':{'id':_0x16dd8f[_0x369d('0x49')]['id']}})[_0x369d('0x24')](handleEntityNotFound(_0x44a357,null))[_0x369d('0x24')](saveUpdates(_0x16dd8f[_0x369d('0x46')],null))['then'](respondWithResult(_0x44a357,null))[_0x369d('0x47')](handleError(_0x44a357,null));};exports[_0x369d('0x23')]=function(_0x289eb8,_0x85edd6){return db[_0x369d('0x2a')]['find']({'where':{'id':_0x289eb8[_0x369d('0x49')]['id']}})['then'](handleEntityNotFound(_0x85edd6,null))[_0x369d('0x24')](removeEntity(_0x85edd6,null))[_0x369d('0x47')](handleError(_0x85edd6,null));};exports[_0x369d('0x4a')]=function(_0x851746,_0x46c62c){return db[_0x369d('0x2a')][_0x369d('0x4a')]()[_0x369d('0x24')](respondWithResult(_0x46c62c,null))[_0x369d('0x47')](handleError(_0x46c62c,null));}; \ No newline at end of file +var _0xfef3=['offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','WhatsappQueueReport','then','includeAll','include','findAll','rows','catch','show','params','fields','create','body','find','describe','eml-format','zip-dir','request-promise','moment','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/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json'];(function(_0x365b01,_0x4d1cb4){var _0x4235f5=function(_0x5927db){while(--_0x5927db){_0x365b01['push'](_0x365b01['shift']());}};_0x4235f5(++_0x4d1cb4);}(_0xfef3,0x118));var _0x3fef=function(_0x26b596,_0x3ba3b1){_0x26b596=_0x26b596-0x0;var _0x281734=_0xfef3[_0x26b596];return _0x281734;};'use strict';var emlformat=require(_0x3fef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fef('0x2'));var moment=require(_0x3fef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3fef('0x4'));var util=require(_0x3fef('0x5'));var path=require('path');var sox=require(_0x3fef('0x6'));var csv=require(_0x3fef('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fef('0x8'));var _=require(_0x3fef('0x9'));var squel=require(_0x3fef('0xa'));var crypto=require(_0x3fef('0xb'));var jsforce=require(_0x3fef('0xc'));var deskjs=require(_0x3fef('0xd'));var toCsv=require(_0x3fef('0x7'));var querystring=require(_0x3fef('0xe'));var Papa=require(_0x3fef('0xf'));var Redis=require(_0x3fef('0x10'));var authService=require(_0x3fef('0x11'));var qs=require(_0x3fef('0x12'));var as=require(_0x3fef('0x13'));var hardwareService=require(_0x3fef('0x14'));var logger=require('../../config/logger')(_0x3fef('0x15'));var utils=require(_0x3fef('0x16'));var config=require(_0x3fef('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3fef('0x18'))['db'];function respondWithStatusCode(_0x4c4a47,_0x2c99ff){_0x2c99ff=_0x2c99ff||0xcc;return function(_0x3d2c2d){if(_0x3d2c2d){return _0x4c4a47[_0x3fef('0x19')](_0x2c99ff);}return _0x4c4a47['status'](_0x2c99ff)[_0x3fef('0x1a')]();};}function respondWithResult(_0x4be62f,_0x15b757){_0x15b757=_0x15b757||0xc8;return function(_0x14c053){if(_0x14c053){return _0x4be62f['status'](_0x15b757)[_0x3fef('0x1b')](_0x14c053);}};}function respondWithFilteredResult(_0x177e28,_0x40b479){return function(_0x79b617){if(_0x79b617){var _0x395df0=typeof _0x40b479[_0x3fef('0x1c')]==='undefined'&&typeof _0x40b479[_0x3fef('0x1d')]===_0x3fef('0x1e');var _0x1ec282=_0x79b617[_0x3fef('0x1f')];var _0x1613ad=_0x395df0?0x0:_0x40b479[_0x3fef('0x1c')];var _0x53d993=_0x395df0?_0x79b617[_0x3fef('0x1f')]:_0x40b479[_0x3fef('0x1c')]+_0x40b479['limit'];var _0x2c7f36;if(_0x53d993>=_0x1ec282){_0x53d993=_0x1ec282;_0x2c7f36=0xc8;}else{_0x2c7f36=0xce;}_0x177e28[_0x3fef('0x20')](_0x2c7f36);return _0x177e28[_0x3fef('0x21')](_0x3fef('0x22'),_0x1613ad+'-'+_0x53d993+'/'+_0x1ec282)[_0x3fef('0x1b')](_0x79b617);}return null;};}function patchUpdates(_0x2b5226){return function(_0x451d11){try{jsonpatch[_0x3fef('0x23')](_0x451d11,_0x2b5226,!![]);}catch(_0x124e7c){return BPromise[_0x3fef('0x24')](_0x124e7c);}return _0x451d11[_0x3fef('0x25')]();};}function saveUpdates(_0x3bb110,_0x2eb578){return function(_0x39a8ea){if(_0x39a8ea){return _0x39a8ea[_0x3fef('0x26')](_0x3bb110)['then'](function(_0x5b56de){return _0x5b56de;});}return null;};}function removeEntity(_0x50025f,_0x378b03){return function(_0x3ba38d){if(_0x3ba38d){return _0x3ba38d[_0x3fef('0x27')]()['then'](function(){_0x50025f[_0x3fef('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45464b,_0x2c0848){return function(_0x64d3e6){if(!_0x64d3e6){_0x45464b[_0x3fef('0x19')](0x194);}return _0x64d3e6;};}function handleError(_0x30e17a,_0x492ea0){_0x492ea0=_0x492ea0||0x1f4;return function(_0x4b4dee){logger['error'](_0x4b4dee[_0x3fef('0x28')]);if(_0x4b4dee[_0x3fef('0x29')]){delete _0x4b4dee['name'];}_0x30e17a[_0x3fef('0x20')](_0x492ea0)[_0x3fef('0x2a')](_0x4b4dee);};}exports['index']=function(_0x30a954,_0x3bdf03){var _0xf892bb={},_0x2b73fb={},_0x3a1a0a={'count':0x0,'rows':[]};var _0x137849=_[_0x3fef('0x2b')](db['WhatsappQueueReport'][_0x3fef('0x2c')],function(_0xc20ce5){return{'name':_0xc20ce5[_0x3fef('0x2d')],'type':_0xc20ce5[_0x3fef('0x2e')]['key']};});_0x2b73fb[_0x3fef('0x2f')]=_['map'](_0x137849,_0x3fef('0x29'));_0x2b73fb[_0x3fef('0x30')]=_[_0x3fef('0x31')](_0x30a954[_0x3fef('0x30')]);_0x2b73fb[_0x3fef('0x32')]=_[_0x3fef('0x33')](_0x2b73fb[_0x3fef('0x2f')],_0x2b73fb[_0x3fef('0x30')]);_0xf892bb[_0x3fef('0x34')]=_[_0x3fef('0x33')](_0x2b73fb['model'],qs['fields'](_0x30a954[_0x3fef('0x30')]['fields']));_0xf892bb[_0x3fef('0x34')]=_0xf892bb[_0x3fef('0x34')][_0x3fef('0x35')]?_0xf892bb[_0x3fef('0x34')]:_0x2b73fb[_0x3fef('0x2f')];if(!_0x30a954[_0x3fef('0x30')][_0x3fef('0x36')](_0x3fef('0x37'))){_0xf892bb[_0x3fef('0x1d')]=qs[_0x3fef('0x1d')](_0x30a954[_0x3fef('0x30')][_0x3fef('0x1d')]);_0xf892bb[_0x3fef('0x1c')]=qs[_0x3fef('0x1c')](_0x30a954['query'][_0x3fef('0x1c')]);}_0xf892bb[_0x3fef('0x38')]=qs[_0x3fef('0x39')](_0x30a954[_0x3fef('0x30')][_0x3fef('0x39')]);_0xf892bb[_0x3fef('0x3a')]=qs['filters'](_['pick'](_0x30a954[_0x3fef('0x30')],_0x2b73fb[_0x3fef('0x32')]),_0x137849);if(_0x30a954[_0x3fef('0x30')][_0x3fef('0x3b')]){_0xf892bb[_0x3fef('0x3a')]=_[_0x3fef('0x3c')](_0xf892bb[_0x3fef('0x3a')],{'$or':_[_0x3fef('0x2b')](_0x137849,function(_0x1fa70f){if(_0x1fa70f[_0x3fef('0x2e')]!==_0x3fef('0x3d')){var _0x560aae={};_0x560aae[_0x1fa70f[_0x3fef('0x29')]]={'$like':'%'+_0x30a954[_0x3fef('0x30')]['filter']+'%'};return _0x560aae;}})});}_0xf892bb=_['merge']({},_0xf892bb,_0x30a954[_0x3fef('0x3e')]);var _0x3dda68={'where':_0xf892bb[_0x3fef('0x3a')]};return db[_0x3fef('0x3f')][_0x3fef('0x1f')](_0x3dda68)[_0x3fef('0x40')](function(_0x17aff8){_0x3a1a0a[_0x3fef('0x1f')]=_0x17aff8;if(_0x30a954['query'][_0x3fef('0x41')]){_0xf892bb[_0x3fef('0x42')]=[{'all':!![]}];}return db[_0x3fef('0x3f')][_0x3fef('0x43')](_0xf892bb);})[_0x3fef('0x40')](function(_0x2143ec){_0x3a1a0a[_0x3fef('0x44')]=_0x2143ec;return _0x3a1a0a;})[_0x3fef('0x40')](respondWithFilteredResult(_0x3bdf03,_0xf892bb))[_0x3fef('0x45')](handleError(_0x3bdf03,null));};exports[_0x3fef('0x46')]=function(_0x12867c,_0x254880){var _0x2e1d7f={'raw':!![],'where':{'id':_0x12867c[_0x3fef('0x47')]['id']}},_0x15d2c7={};_0x15d2c7['model']=_[_0x3fef('0x31')](db[_0x3fef('0x3f')][_0x3fef('0x2c')]);_0x15d2c7[_0x3fef('0x30')]=_[_0x3fef('0x31')](_0x12867c[_0x3fef('0x30')]);_0x15d2c7['filters']=_[_0x3fef('0x33')](_0x15d2c7['model'],_0x15d2c7[_0x3fef('0x30')]);_0x2e1d7f[_0x3fef('0x34')]=_['intersection'](_0x15d2c7[_0x3fef('0x2f')],qs['fields'](_0x12867c[_0x3fef('0x30')][_0x3fef('0x48')]));_0x2e1d7f[_0x3fef('0x34')]=_0x2e1d7f[_0x3fef('0x34')][_0x3fef('0x35')]?_0x2e1d7f[_0x3fef('0x34')]:_0x15d2c7[_0x3fef('0x2f')];if(_0x12867c[_0x3fef('0x30')][_0x3fef('0x41')]){_0x2e1d7f[_0x3fef('0x42')]=[{'all':!![]}];}_0x2e1d7f=_[_0x3fef('0x3c')]({},_0x2e1d7f,_0x12867c[_0x3fef('0x3e')]);return db[_0x3fef('0x3f')]['find'](_0x2e1d7f)[_0x3fef('0x40')](handleEntityNotFound(_0x254880,null))[_0x3fef('0x40')](respondWithResult(_0x254880,null))['catch'](handleError(_0x254880,null));};exports[_0x3fef('0x49')]=function(_0x4210d6,_0x2f00c0){return db['WhatsappQueueReport'][_0x3fef('0x49')](_0x4210d6[_0x3fef('0x4a')],{})['then'](respondWithResult(_0x2f00c0,0xc9))[_0x3fef('0x45')](handleError(_0x2f00c0,null));};exports['update']=function(_0x48322c,_0x15fb2c){if(_0x48322c['body']['id']){delete _0x48322c[_0x3fef('0x4a')]['id'];}return db[_0x3fef('0x3f')]['find']({'where':{'id':_0x48322c[_0x3fef('0x47')]['id']}})[_0x3fef('0x40')](handleEntityNotFound(_0x15fb2c,null))[_0x3fef('0x40')](saveUpdates(_0x48322c['body'],null))[_0x3fef('0x40')](respondWithResult(_0x15fb2c,null))[_0x3fef('0x45')](handleError(_0x15fb2c,null));};exports[_0x3fef('0x27')]=function(_0x5b1acb,_0x324f70){return db[_0x3fef('0x3f')][_0x3fef('0x4b')]({'where':{'id':_0x5b1acb[_0x3fef('0x47')]['id']}})[_0x3fef('0x40')](handleEntityNotFound(_0x324f70,null))['then'](removeEntity(_0x324f70,null))[_0x3fef('0x45')](handleError(_0x324f70,null));};exports[_0x3fef('0x4c')]=function(_0x39a4b1,_0x2b9275){return db[_0x3fef('0x3f')][_0x3fef('0x4c')]()[_0x3fef('0x40')](respondWithResult(_0x2b9275,null))[_0x3fef('0x45')](handleError(_0x2b9275,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 4b0c751..8e7c538 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 _0x0f5e=['moment','bluebird','path','rimraf','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0x5bff9e,_0x39ea3a){var _0x7f42ef=function(_0x58a923){while(--_0x58a923){_0x5bff9e['push'](_0x5bff9e['shift']());}};_0x7f42ef(++_0x39ea3a);}(_0x0f5e,0xe6));var _0xe0f5=function(_0x3235dc,_0x1285be){_0x3235dc=_0x3235dc-0x0;var _0x15c9ac=_0x0f5e[_0x3235dc];return _0x15c9ac;};'use strict';var _=require(_0xe0f5('0x0'));var util=require(_0xe0f5('0x1'));var logger=require(_0xe0f5('0x2'))(_0xe0f5('0x3'));var moment=require(_0xe0f5('0x4'));var BPromise=require(_0xe0f5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe0f5('0x6'));var rimraf=require(_0xe0f5('0x7'));var config=require('../../config/environment');var attributes=require(_0xe0f5('0x8'));module['exports']=function(_0x332c87,_0x4b2e0d){return _0x332c87[_0xe0f5('0x9')](_0xe0f5('0xa'),attributes,{'tableName':_0xe0f5('0xb'),'paranoid':![],'indexes':[{'name':_0xe0f5('0xc'),'fields':[_0xe0f5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xde6c=['define','WhatsappQueueReport','uniqueid','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x36909d,_0x2795f1){var _0x1fd29d=function(_0x27d0fa){while(--_0x27d0fa){_0x36909d['push'](_0x36909d['shift']());}};_0x1fd29d(++_0x2795f1);}(_0xde6c,0xdb));var _0xcde6=function(_0x1e48b3,_0x3150bc){_0x1e48b3=_0x1e48b3-0x0;var _0x295fae=_0xde6c[_0x1e48b3];return _0x295fae;};'use strict';var _=require('lodash');var util=require(_0xcde6('0x0'));var logger=require(_0xcde6('0x1'))('api');var moment=require('moment');var BPromise=require(_0xcde6('0x2'));var rp=require(_0xcde6('0x3'));var fs=require('fs');var path=require(_0xcde6('0x4'));var rimraf=require(_0xcde6('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x5ef79a,_0x1ee569){return _0x5ef79a[_0xcde6('0x6')](_0xcde6('0x7'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xcde6('0x8'),'fields':[_0xcde6('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 1e49df0..70bf1f6 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 _0x5ebb=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','raw','CreateWhatsappQueueReport','WhatsappQueueReport','options','attributes','limit','UpdateWhatsappQueueReport','lodash','util'];(function(_0x2f651e,_0x423261){var _0x382a47=function(_0x4ca46){while(--_0x4ca46){_0x2f651e['push'](_0x2f651e['shift']());}};_0x382a47(++_0x423261);}(_0x5ebb,0x134));var _0xb5eb=function(_0x30d68b,_0x12526a){_0x30d68b=_0x30d68b-0x0;var _0x526b44=_0x5ebb[_0x30d68b];return _0x526b44;};'use strict';var _=require(_0xb5eb('0x0'));var util=require(_0xb5eb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb5eb('0x2'));var fs=require('fs');var Redis=require(_0xb5eb('0x3'));var db=require(_0xb5eb('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb5eb('0x5'));var config=require(_0xb5eb('0x6'));var jayson=require(_0xb5eb('0x7'));var client=jayson[_0xb5eb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x204e40,_0x1b9261,_0x3caba9){return new BPromise(function(_0x56003f,_0x235bd8){return client[_0xb5eb('0x9')](_0x204e40,_0x3caba9)[_0xb5eb('0xa')](function(_0x22124d){logger[_0xb5eb('0xb')](_0xb5eb('0xc'),_0x1b9261,_0xb5eb('0xd'));logger[_0xb5eb('0xe')](_0xb5eb('0xf'),_0x1b9261,'request\x20sent',JSON[_0xb5eb('0x10')](_0x22124d));if(_0x22124d[_0xb5eb('0x11')]){if(_0x22124d[_0xb5eb('0x11')][_0xb5eb('0x12')]===0x1f4){logger[_0xb5eb('0x11')](_0xb5eb('0xc'),_0x1b9261,_0x22124d[_0xb5eb('0x11')][_0xb5eb('0x13')]);return _0x235bd8(_0x22124d[_0xb5eb('0x11')]['message']);}logger[_0xb5eb('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1b9261,_0x22124d[_0xb5eb('0x11')][_0xb5eb('0x13')]);return _0x56003f(_0x22124d[_0xb5eb('0x11')][_0xb5eb('0x13')]);}else{logger['info'](_0xb5eb('0xc'),_0x1b9261,_0xb5eb('0xd'));_0x56003f(_0x22124d[_0xb5eb('0x14')]['message']);}})[_0xb5eb('0x15')](function(_0x4015c5){logger[_0xb5eb('0x11')](_0xb5eb('0xc'),_0x1b9261,_0x4015c5);_0x235bd8(_0x4015c5);});});}exports['CreateWhatsappQueueReport']=function(_0x38224d){var _0x22d938=this;return new Promise(function(_0x554a24,_0x756fee){return db['WhatsappQueueReport'][_0xb5eb('0x16')](_0x38224d[_0xb5eb('0x17')],{'raw':_0x38224d['options']?_0x38224d['options'][_0xb5eb('0x18')]===undefined?!![]:![]:!![]})[_0xb5eb('0xa')](function(_0x4bc52e){logger[_0xb5eb('0xb')](_0xb5eb('0x19'),_0x38224d);logger[_0xb5eb('0xe')](_0xb5eb('0x19'),_0x38224d,JSON[_0xb5eb('0x10')](_0x4bc52e));_0x554a24(_0x4bc52e);})['catch'](function(_0x226c60){logger[_0xb5eb('0x11')]('CreateWhatsappQueueReport',_0x226c60[_0xb5eb('0x13')],_0x38224d);_0x756fee(_0x22d938[_0xb5eb('0x11')](0x1f4,_0x226c60['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x525502){var _0x51cf3a=this;return new Promise(function(_0x5c1d37,_0x2944bc){return db[_0xb5eb('0x1a')]['update'](_0x525502['body'],{'raw':_0x525502[_0xb5eb('0x1b')]?_0x525502[_0xb5eb('0x1b')][_0xb5eb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x525502[_0xb5eb('0x1b')]?_0x525502[_0xb5eb('0x1b')]['where']||null:null,'attributes':_0x525502[_0xb5eb('0x1b')]?_0x525502['options'][_0xb5eb('0x1c')]||null:null,'limit':_0x525502[_0xb5eb('0x1b')]?_0x525502[_0xb5eb('0x1b')][_0xb5eb('0x1d')]||null:null})[_0xb5eb('0xa')](function(_0x3a2066){logger[_0xb5eb('0xb')](_0xb5eb('0x1e'),_0x525502);logger[_0xb5eb('0xe')](_0xb5eb('0x1e'),_0x525502,JSON[_0xb5eb('0x10')](_0x3a2066));_0x5c1d37(_0x3a2066);})['catch'](function(_0x378bd4){logger['error'](_0xb5eb('0x1e'),_0x378bd4[_0xb5eb('0x13')],_0x525502);_0x2944bc(_0x51cf3a['error'](0x1f4,_0x378bd4[_0xb5eb('0x13')]));});});}; \ No newline at end of file +var _0x3a6d=['error','code','message','result','CreateWhatsappQueueReport','create','body','raw','catch','update','options','where','UpdateWhatsappQueueReport','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x297768,_0x16b542){var _0x53aa57=function(_0x4cf4eb){while(--_0x4cf4eb){_0x297768['push'](_0x297768['shift']());}};_0x53aa57(++_0x16b542);}(_0x3a6d,0xa8));var _0xd3a6=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x3a6d[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var moment=require('moment');var BPromise=require(_0xd3a6('0x2'));var rs=require(_0xd3a6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3a6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd3a6('0x5'))(_0xd3a6('0x6'));var config=require(_0xd3a6('0x7'));var jayson=require(_0xd3a6('0x8'));var client=jayson[_0xd3a6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57a477,_0x597bc2,_0x3783de){return new BPromise(function(_0x323b69,_0x55d3d9){return client[_0xd3a6('0xa')](_0x57a477,_0x3783de)[_0xd3a6('0xb')](function(_0x111375){logger[_0xd3a6('0xc')](_0xd3a6('0xd'),_0x597bc2,_0xd3a6('0xe'));logger[_0xd3a6('0xf')](_0xd3a6('0x10'),_0x597bc2,'request\x20sent',JSON[_0xd3a6('0x11')](_0x111375));if(_0x111375[_0xd3a6('0x12')]){if(_0x111375[_0xd3a6('0x12')][_0xd3a6('0x13')]===0x1f4){logger[_0xd3a6('0x12')](_0xd3a6('0xd'),_0x597bc2,_0x111375['error'][_0xd3a6('0x14')]);return _0x55d3d9(_0x111375[_0xd3a6('0x12')][_0xd3a6('0x14')]);}logger[_0xd3a6('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x597bc2,_0x111375['error']['message']);return _0x323b69(_0x111375[_0xd3a6('0x12')][_0xd3a6('0x14')]);}else{logger[_0xd3a6('0xc')](_0xd3a6('0xd'),_0x597bc2,_0xd3a6('0xe'));_0x323b69(_0x111375[_0xd3a6('0x15')][_0xd3a6('0x14')]);}})['catch'](function(_0x37f63a){logger[_0xd3a6('0x12')](_0xd3a6('0xd'),_0x597bc2,_0x37f63a);_0x55d3d9(_0x37f63a);});});}exports[_0xd3a6('0x16')]=function(_0x44d854){var _0xee5af=this;return new Promise(function(_0x1fff51,_0x2d229e){return db['WhatsappQueueReport'][_0xd3a6('0x17')](_0x44d854[_0xd3a6('0x18')],{'raw':_0x44d854['options']?_0x44d854['options'][_0xd3a6('0x19')]===undefined?!![]:![]:!![]})[_0xd3a6('0xb')](function(_0x4bb600){logger[_0xd3a6('0xc')](_0xd3a6('0x16'),_0x44d854);logger[_0xd3a6('0xf')](_0xd3a6('0x16'),_0x44d854,JSON[_0xd3a6('0x11')](_0x4bb600));_0x1fff51(_0x4bb600);})[_0xd3a6('0x1a')](function(_0x3c935d){logger[_0xd3a6('0x12')](_0xd3a6('0x16'),_0x3c935d[_0xd3a6('0x14')],_0x44d854);_0x2d229e(_0xee5af[_0xd3a6('0x12')](0x1f4,_0x3c935d[_0xd3a6('0x14')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x4fbf61){var _0x4daef4=this;return new Promise(function(_0x1130f9,_0x5d53ab){return db['WhatsappQueueReport'][_0xd3a6('0x1b')](_0x4fbf61[_0xd3a6('0x18')],{'raw':_0x4fbf61['options']?_0x4fbf61[_0xd3a6('0x1c')][_0xd3a6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fbf61[_0xd3a6('0x1c')]?_0x4fbf61[_0xd3a6('0x1c')][_0xd3a6('0x1d')]||null:null,'attributes':_0x4fbf61['options']?_0x4fbf61[_0xd3a6('0x1c')]['attributes']||null:null,'limit':_0x4fbf61[_0xd3a6('0x1c')]?_0x4fbf61[_0xd3a6('0x1c')]['limit']||null:null})[_0xd3a6('0xb')](function(_0x1ed083){logger[_0xd3a6('0xc')](_0xd3a6('0x1e'),_0x4fbf61);logger[_0xd3a6('0xf')](_0xd3a6('0x1e'),_0x4fbf61,JSON[_0xd3a6('0x11')](_0x1ed083));_0x1130f9(_0x1ed083);})['catch'](function(_0x5a4cf8){logger['error'](_0xd3a6('0x1e'),_0x5a4cf8[_0xd3a6('0x14')],_0x4fbf61);_0x5d53ab(_0x4daef4['error'](0x1f4,_0x5a4cf8[_0xd3a6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 40a24c5..58e4553 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 _0xe2ef=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put'];(function(_0x6c0923,_0x23c0bb){var _0x16a5ac=function(_0x1dd6c8){while(--_0x1dd6c8){_0x6c0923['push'](_0x6c0923['shift']());}};_0x16a5ac(++_0x23c0bb);}(_0xe2ef,0x10c));var _0xfe2e=function(_0x461955,_0x4085a4){_0x461955=_0x461955-0x0;var _0x3b6da7=_0xe2ef[_0x461955];return _0x3b6da7;};'use strict';var multer=require(_0xfe2e('0x0'));var util=require(_0xfe2e('0x1'));var path=require(_0xfe2e('0x2'));var timeout=require(_0xfe2e('0x3'));var express=require(_0xfe2e('0x4'));var router=express[_0xfe2e('0x5')]();var fs_extra=require(_0xfe2e('0x6'));var auth=require(_0xfe2e('0x7'));var interaction=require(_0xfe2e('0x8'));var config=require('../../config/environment');var controller=require(_0xfe2e('0x9'));router[_0xfe2e('0xa')]('/',auth[_0xfe2e('0xb')](),controller[_0xfe2e('0xc')]);router[_0xfe2e('0xa')](_0xfe2e('0xd'),auth[_0xfe2e('0xb')](),controller[_0xfe2e('0xe')]);router['get'](_0xfe2e('0xf'),auth[_0xfe2e('0xb')](),controller[_0xfe2e('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xfe2e('0x11')](_0xfe2e('0xf'),auth[_0xfe2e('0xb')](),controller[_0xfe2e('0x12')]);router[_0xfe2e('0x13')](_0xfe2e('0xf'),auth[_0xfe2e('0xb')](),controller[_0xfe2e('0x14')]);module[_0xfe2e('0x15')]=router; \ No newline at end of file +var _0x8247=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete','destroy'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x8247,0x1db));var _0x7824=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x8247[_0x363ef8];return _0x148822;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7824('0x0'));var timeout=require(_0x7824('0x1'));var express=require(_0x7824('0x2'));var router=express[_0x7824('0x3')]();var fs_extra=require(_0x7824('0x4'));var auth=require(_0x7824('0x5'));var interaction=require(_0x7824('0x6'));var config=require(_0x7824('0x7'));var controller=require('./whatsappTransferReport.controller');router['get']('/',auth[_0x7824('0x8')](),controller['index']);router['get'](_0x7824('0x9'),auth[_0x7824('0x8')](),controller[_0x7824('0xa')]);router['get']('/:id',auth[_0x7824('0x8')](),controller[_0x7824('0xb')]);router[_0x7824('0xc')]('/',auth[_0x7824('0x8')](),controller[_0x7824('0xd')]);router[_0x7824('0xe')](_0x7824('0xf'),auth[_0x7824('0x8')](),controller[_0x7824('0x10')]);router[_0x7824('0x11')](_0x7824('0xf'),auth[_0x7824('0x8')](),controller[_0x7824('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 52b584f..4879e68 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 _0xc5b3=['STRING','ENUM','account','agent','queue','DATE','sequelize','exports'];(function(_0x41582d,_0x291b1c){var _0x59c504=function(_0x4d967e){while(--_0x4d967e){_0x41582d['push'](_0x41582d['shift']());}};_0x59c504(++_0x291b1c);}(_0xc5b3,0x1ee));var _0x3c5b=function(_0x2181b1,_0x569637){_0x2181b1=_0x2181b1-0x0;var _0x530548=_0xc5b3[_0x2181b1];return _0x530548;};'use strict';var Sequelize=require(_0x3c5b('0x0'));module[_0x3c5b('0x1')]={'uniqueid':{'type':Sequelize[_0x3c5b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3c5b('0x3')](_0x3c5b('0x4'),_0x3c5b('0x5'),_0x3c5b('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x3c5b('0x7')]}}; \ No newline at end of file +var _0x58a4=['exports','STRING','ENUM','account','agent','queue','DATE','sequelize'];(function(_0x5cb094,_0x8661b7){var _0x19c8e3=function(_0x120713){while(--_0x120713){_0x5cb094['push'](_0x5cb094['shift']());}};_0x19c8e3(++_0x8661b7);}(_0x58a4,0xbf));var _0x458a=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x58a4[_0x2d34d6];return _0x1d3d12;};'use strict';var Sequelize=require(_0x458a('0x0'));module[_0x458a('0x1')]={'uniqueid':{'type':Sequelize[_0x458a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x458a('0x3')](_0x458a('0x4'),_0x458a('0x5'),_0x458a('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x458a('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 35922de..19f05f9 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 _0x005f=['attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','type','key','model','query','filters','intersection'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x005f,0x19e));var _0xf005=function(_0x1581c4,_0xb7efc7){_0x1581c4=_0x1581c4-0x0;var _0x2ee04b=_0x005f[_0x1581c4];return _0x2ee04b;};'use strict';var emlformat=require(_0xf005('0x0'));var rimraf=require(_0xf005('0x1'));var zipdir=require(_0xf005('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf005('0x3'));var moment=require(_0xf005('0x4'));var BPromise=require(_0xf005('0x5'));var Mustache=require(_0xf005('0x6'));var util=require(_0xf005('0x7'));var path=require(_0xf005('0x8'));var sox=require(_0xf005('0x9'));var csv=require(_0xf005('0xa'));var ejs=require(_0xf005('0xb'));var fs=require('fs');var fs_extra=require(_0xf005('0xc'));var _=require(_0xf005('0xd'));var squel=require(_0xf005('0xe'));var crypto=require(_0xf005('0xf'));var jsforce=require(_0xf005('0x10'));var deskjs=require(_0xf005('0x11'));var toCsv=require(_0xf005('0xa'));var querystring=require(_0xf005('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf005('0x13'));var qs=require(_0xf005('0x14'));var as=require(_0xf005('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf005('0x16'))('api');var utils=require(_0xf005('0x17'));var config=require(_0xf005('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf005('0x19'))['db'];function respondWithStatusCode(_0x51c27a,_0x36c104){_0x36c104=_0x36c104||0xcc;return function(_0x674892){if(_0x674892){return _0x51c27a[_0xf005('0x1a')](_0x36c104);}return _0x51c27a[_0xf005('0x1b')](_0x36c104)[_0xf005('0x1c')]();};}function respondWithResult(_0x569c83,_0x47ebe2){_0x47ebe2=_0x47ebe2||0xc8;return function(_0x7d1ec0){if(_0x7d1ec0){return _0x569c83['status'](_0x47ebe2)[_0xf005('0x1d')](_0x7d1ec0);}};}function respondWithFilteredResult(_0x3ba40b,_0x2c82f1){return function(_0x50dbd2){if(_0x50dbd2){var _0x14b572=typeof _0x2c82f1['offset']===_0xf005('0x1e')&&typeof _0x2c82f1['limit']===_0xf005('0x1e');var _0xcac60f=_0x50dbd2[_0xf005('0x1f')];var _0x1d333d=_0x14b572?0x0:_0x2c82f1[_0xf005('0x20')];var _0x3909e7=_0x14b572?_0x50dbd2[_0xf005('0x1f')]:_0x2c82f1['offset']+_0x2c82f1['limit'];var _0x415990;if(_0x3909e7>=_0xcac60f){_0x3909e7=_0xcac60f;_0x415990=0xc8;}else{_0x415990=0xce;}_0x3ba40b[_0xf005('0x1b')](_0x415990);return _0x3ba40b[_0xf005('0x21')](_0xf005('0x22'),_0x1d333d+'-'+_0x3909e7+'/'+_0xcac60f)['json'](_0x50dbd2);}return null;};}function patchUpdates(_0x41ea92){return function(_0x12916c){try{jsonpatch[_0xf005('0x23')](_0x12916c,_0x41ea92,!![]);}catch(_0x2f941b){return BPromise[_0xf005('0x24')](_0x2f941b);}return _0x12916c['save']();};}function saveUpdates(_0x1c9652,_0x398a25){return function(_0x29ef8d){if(_0x29ef8d){return _0x29ef8d[_0xf005('0x25')](_0x1c9652)[_0xf005('0x26')](function(_0x3add10){return _0x3add10;});}return null;};}function removeEntity(_0x5b7d47,_0x428287){return function(_0x5995f6){if(_0x5995f6){return _0x5995f6[_0xf005('0x27')]()[_0xf005('0x26')](function(){_0x5b7d47[_0xf005('0x1b')](0xcc)[_0xf005('0x1c')]();});}};}function handleEntityNotFound(_0xcc8b9,_0x285871){return function(_0x24dee2){if(!_0x24dee2){_0xcc8b9[_0xf005('0x1a')](0x194);}return _0x24dee2;};}function handleError(_0x27578d,_0xb73e46){_0xb73e46=_0xb73e46||0x1f4;return function(_0x2b4fae){logger[_0xf005('0x28')](_0x2b4fae[_0xf005('0x29')]);if(_0x2b4fae[_0xf005('0x2a')]){delete _0x2b4fae['name'];}_0x27578d[_0xf005('0x1b')](_0xb73e46)[_0xf005('0x2b')](_0x2b4fae);};}exports[_0xf005('0x2c')]=function(_0xcd3a1c,_0x4b1f5d){var _0x3c0489={},_0x5a7893={},_0x1c3e39={'count':0x0,'rows':[]};var _0x2adb39=_[_0xf005('0x2d')](db[_0xf005('0x2e')][_0xf005('0x2f')],function(_0x3e3b7a){return{'name':_0x3e3b7a['fieldName'],'type':_0x3e3b7a[_0xf005('0x30')][_0xf005('0x31')]};});_0x5a7893[_0xf005('0x32')]=_[_0xf005('0x2d')](_0x2adb39,_0xf005('0x2a'));_0x5a7893['query']=_['keys'](_0xcd3a1c[_0xf005('0x33')]);_0x5a7893[_0xf005('0x34')]=_[_0xf005('0x35')](_0x5a7893[_0xf005('0x32')],_0x5a7893[_0xf005('0x33')]);_0x3c0489[_0xf005('0x36')]=_[_0xf005('0x35')](_0x5a7893[_0xf005('0x32')],qs[_0xf005('0x37')](_0xcd3a1c[_0xf005('0x33')][_0xf005('0x37')]));_0x3c0489[_0xf005('0x36')]=_0x3c0489['attributes'][_0xf005('0x38')]?_0x3c0489['attributes']:_0x5a7893['model'];if(!_0xcd3a1c[_0xf005('0x33')][_0xf005('0x39')](_0xf005('0x3a'))){_0x3c0489[_0xf005('0x3b')]=qs[_0xf005('0x3b')](_0xcd3a1c[_0xf005('0x33')][_0xf005('0x3b')]);_0x3c0489[_0xf005('0x20')]=qs['offset'](_0xcd3a1c[_0xf005('0x33')][_0xf005('0x20')]);}_0x3c0489['order']=qs[_0xf005('0x3c')](_0xcd3a1c[_0xf005('0x33')][_0xf005('0x3c')]);_0x3c0489[_0xf005('0x3d')]=qs[_0xf005('0x34')](_[_0xf005('0x3e')](_0xcd3a1c[_0xf005('0x33')],_0x5a7893['filters']),_0x2adb39);if(_0xcd3a1c[_0xf005('0x33')][_0xf005('0x3f')]){_0x3c0489[_0xf005('0x3d')]=_[_0xf005('0x40')](_0x3c0489[_0xf005('0x3d')],{'$or':_[_0xf005('0x2d')](_0x2adb39,function(_0x57c739){if(_0x57c739['type']!==_0xf005('0x41')){var _0x366578={};_0x366578[_0x57c739['name']]={'$like':'%'+_0xcd3a1c[_0xf005('0x33')]['filter']+'%'};return _0x366578;}})});}_0x3c0489=_['merge']({},_0x3c0489,_0xcd3a1c[_0xf005('0x42')]);var _0x2a4101={'where':_0x3c0489[_0xf005('0x3d')]};return db[_0xf005('0x2e')][_0xf005('0x1f')](_0x2a4101)[_0xf005('0x26')](function(_0x335fd5){_0x1c3e39[_0xf005('0x1f')]=_0x335fd5;if(_0xcd3a1c[_0xf005('0x33')][_0xf005('0x43')]){_0x3c0489[_0xf005('0x44')]=[{'all':!![]}];}return db[_0xf005('0x2e')][_0xf005('0x45')](_0x3c0489);})['then'](function(_0x27276d){_0x1c3e39[_0xf005('0x46')]=_0x27276d;return _0x1c3e39;})[_0xf005('0x26')](respondWithFilteredResult(_0x4b1f5d,_0x3c0489))[_0xf005('0x47')](handleError(_0x4b1f5d,null));};exports[_0xf005('0x48')]=function(_0xbeefe,_0xca0086){var _0x486a6c={'raw':!![],'where':{'id':_0xbeefe[_0xf005('0x49')]['id']}},_0x4fd547={};_0x4fd547[_0xf005('0x32')]=_['keys'](db['WhatsappTransferReport'][_0xf005('0x2f')]);_0x4fd547[_0xf005('0x33')]=_['keys'](_0xbeefe['query']);_0x4fd547[_0xf005('0x34')]=_[_0xf005('0x35')](_0x4fd547[_0xf005('0x32')],_0x4fd547[_0xf005('0x33')]);_0x486a6c['attributes']=_[_0xf005('0x35')](_0x4fd547[_0xf005('0x32')],qs['fields'](_0xbeefe['query'][_0xf005('0x37')]));_0x486a6c['attributes']=_0x486a6c[_0xf005('0x36')][_0xf005('0x38')]?_0x486a6c[_0xf005('0x36')]:_0x4fd547[_0xf005('0x32')];if(_0xbeefe[_0xf005('0x33')]['includeAll']){_0x486a6c['include']=[{'all':!![]}];}_0x486a6c=_[_0xf005('0x40')]({},_0x486a6c,_0xbeefe[_0xf005('0x42')]);return db[_0xf005('0x2e')]['find'](_0x486a6c)['then'](handleEntityNotFound(_0xca0086,null))[_0xf005('0x26')](respondWithResult(_0xca0086,null))[_0xf005('0x47')](handleError(_0xca0086,null));};exports[_0xf005('0x4a')]=function(_0x3b93fe,_0x3ff7dc){return db[_0xf005('0x2e')][_0xf005('0x4a')](_0x3b93fe[_0xf005('0x4b')],{})[_0xf005('0x26')](respondWithResult(_0x3ff7dc,0xc9))['catch'](handleError(_0x3ff7dc,null));};exports['update']=function(_0x4a8eb0,_0x560104){if(_0x4a8eb0[_0xf005('0x4b')]['id']){delete _0x4a8eb0[_0xf005('0x4b')]['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x4a8eb0[_0xf005('0x49')]['id']}})['then'](handleEntityNotFound(_0x560104,null))['then'](saveUpdates(_0x4a8eb0['body'],null))['then'](respondWithResult(_0x560104,null))[_0xf005('0x47')](handleError(_0x560104,null));};exports[_0xf005('0x27')]=function(_0x220d18,_0x378de2){return db[_0xf005('0x2e')][_0xf005('0x4c')]({'where':{'id':_0x220d18[_0xf005('0x49')]['id']}})['then'](handleEntityNotFound(_0x378de2,null))[_0xf005('0x26')](removeEntity(_0x378de2,null))[_0xf005('0x47')](handleError(_0x378de2,null));};exports[_0xf005('0x4d')]=function(_0x7398db,_0xb469e9){return db['WhatsappTransferReport']['describe']()[_0xf005('0x26')](respondWithResult(_0xb469e9,null))[_0xf005('0x47')](handleError(_0xb469e9,null));}; \ No newline at end of file +var _0xd201=['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','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','params','length','options','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x178767,_0x1cd68a){var _0x5aad66=function(_0x514480){while(--_0x514480){_0x178767['push'](_0x178767['shift']());}};_0x5aad66(++_0x1cd68a);}(_0xd201,0x17a));var _0x1d20=function(_0x37b31c,_0x19ffd5){_0x37b31c=_0x37b31c-0x0;var _0x18cccc=_0xd201[_0x37b31c];return _0x18cccc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1d20('0x0'));var zipdir=require(_0x1d20('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d20('0x2'));var moment=require(_0x1d20('0x3'));var BPromise=require(_0x1d20('0x4'));var Mustache=require(_0x1d20('0x5'));var util=require(_0x1d20('0x6'));var path=require(_0x1d20('0x7'));var sox=require(_0x1d20('0x8'));var csv=require(_0x1d20('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d20('0xa'));var _=require(_0x1d20('0xb'));var squel=require(_0x1d20('0xc'));var crypto=require(_0x1d20('0xd'));var jsforce=require(_0x1d20('0xe'));var deskjs=require(_0x1d20('0xf'));var toCsv=require(_0x1d20('0x9'));var querystring=require(_0x1d20('0x10'));var Papa=require(_0x1d20('0x11'));var Redis=require(_0x1d20('0x12'));var authService=require(_0x1d20('0x13'));var qs=require(_0x1d20('0x14'));var as=require(_0x1d20('0x15'));var hardwareService=require(_0x1d20('0x16'));var logger=require(_0x1d20('0x17'))(_0x1d20('0x18'));var utils=require(_0x1d20('0x19'));var config=require(_0x1d20('0x1a'));var licenseUtil=require(_0x1d20('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x185b45,_0x2e183f){_0x2e183f=_0x2e183f||0xcc;return function(_0x396121){if(_0x396121){return _0x185b45[_0x1d20('0x1c')](_0x2e183f);}return _0x185b45['status'](_0x2e183f)[_0x1d20('0x1d')]();};}function respondWithResult(_0x52718b,_0x29f7de){_0x29f7de=_0x29f7de||0xc8;return function(_0x294f64){if(_0x294f64){return _0x52718b['status'](_0x29f7de)[_0x1d20('0x1e')](_0x294f64);}};}function respondWithFilteredResult(_0x373bc8,_0x56e03c){return function(_0x42e054){if(_0x42e054){var _0x3ad07f=typeof _0x56e03c[_0x1d20('0x1f')]===_0x1d20('0x20')&&typeof _0x56e03c[_0x1d20('0x21')]===_0x1d20('0x20');var _0x4d938a=_0x42e054['count'];var _0x4df244=_0x3ad07f?0x0:_0x56e03c[_0x1d20('0x1f')];var _0x117d9a=_0x3ad07f?_0x42e054[_0x1d20('0x22')]:_0x56e03c[_0x1d20('0x1f')]+_0x56e03c[_0x1d20('0x21')];var _0x59baf2;if(_0x117d9a>=_0x4d938a){_0x117d9a=_0x4d938a;_0x59baf2=0xc8;}else{_0x59baf2=0xce;}_0x373bc8[_0x1d20('0x23')](_0x59baf2);return _0x373bc8[_0x1d20('0x24')](_0x1d20('0x25'),_0x4df244+'-'+_0x117d9a+'/'+_0x4d938a)['json'](_0x42e054);}return null;};}function patchUpdates(_0x270d43){return function(_0x38e3f0){try{jsonpatch[_0x1d20('0x26')](_0x38e3f0,_0x270d43,!![]);}catch(_0x72758){return BPromise[_0x1d20('0x27')](_0x72758);}return _0x38e3f0[_0x1d20('0x28')]();};}function saveUpdates(_0x3963db,_0x27a0b6){return function(_0xa870){if(_0xa870){return _0xa870[_0x1d20('0x29')](_0x3963db)[_0x1d20('0x2a')](function(_0x386a64){return _0x386a64;});}return null;};}function removeEntity(_0xceb526,_0x383375){return function(_0x24316e){if(_0x24316e){return _0x24316e[_0x1d20('0x2b')]()['then'](function(){_0xceb526[_0x1d20('0x23')](0xcc)[_0x1d20('0x1d')]();});}};}function handleEntityNotFound(_0x413fb2,_0x2567e6){return function(_0x1075bd){if(!_0x1075bd){_0x413fb2[_0x1d20('0x1c')](0x194);}return _0x1075bd;};}function handleError(_0x58cf5f,_0x19b771){_0x19b771=_0x19b771||0x1f4;return function(_0x4aa4a8){logger[_0x1d20('0x2c')](_0x4aa4a8['stack']);if(_0x4aa4a8['name']){delete _0x4aa4a8[_0x1d20('0x2d')];}_0x58cf5f[_0x1d20('0x23')](_0x19b771)[_0x1d20('0x2e')](_0x4aa4a8);};}exports[_0x1d20('0x2f')]=function(_0x27e2d5,_0x178e32){var _0x3dcaab={},_0x3f5b37={},_0x2249e3={'count':0x0,'rows':[]};var _0x2dc6a2=_[_0x1d20('0x30')](db[_0x1d20('0x31')][_0x1d20('0x32')],function(_0x3bda97){return{'name':_0x3bda97[_0x1d20('0x33')],'type':_0x3bda97[_0x1d20('0x34')]['key']};});_0x3f5b37[_0x1d20('0x35')]=_[_0x1d20('0x30')](_0x2dc6a2,_0x1d20('0x2d'));_0x3f5b37[_0x1d20('0x36')]=_[_0x1d20('0x37')](_0x27e2d5['query']);_0x3f5b37[_0x1d20('0x38')]=_['intersection'](_0x3f5b37['model'],_0x3f5b37[_0x1d20('0x36')]);_0x3dcaab['attributes']=_[_0x1d20('0x39')](_0x3f5b37['model'],qs[_0x1d20('0x3a')](_0x27e2d5[_0x1d20('0x36')][_0x1d20('0x3a')]));_0x3dcaab[_0x1d20('0x3b')]=_0x3dcaab['attributes']['length']?_0x3dcaab[_0x1d20('0x3b')]:_0x3f5b37['model'];if(!_0x27e2d5[_0x1d20('0x36')][_0x1d20('0x3c')]('nolimit')){_0x3dcaab['limit']=qs[_0x1d20('0x21')](_0x27e2d5[_0x1d20('0x36')][_0x1d20('0x21')]);_0x3dcaab[_0x1d20('0x1f')]=qs[_0x1d20('0x1f')](_0x27e2d5[_0x1d20('0x36')][_0x1d20('0x1f')]);}_0x3dcaab[_0x1d20('0x3d')]=qs[_0x1d20('0x3e')](_0x27e2d5[_0x1d20('0x36')][_0x1d20('0x3e')]);_0x3dcaab['where']=qs[_0x1d20('0x38')](_[_0x1d20('0x3f')](_0x27e2d5[_0x1d20('0x36')],_0x3f5b37[_0x1d20('0x38')]),_0x2dc6a2);if(_0x27e2d5[_0x1d20('0x36')][_0x1d20('0x40')]){_0x3dcaab[_0x1d20('0x41')]=_['merge'](_0x3dcaab[_0x1d20('0x41')],{'$or':_[_0x1d20('0x30')](_0x2dc6a2,function(_0x140421){if(_0x140421[_0x1d20('0x34')]!==_0x1d20('0x42')){var _0x5f4515={};_0x5f4515[_0x140421[_0x1d20('0x2d')]]={'$like':'%'+_0x27e2d5[_0x1d20('0x36')][_0x1d20('0x40')]+'%'};return _0x5f4515;}})});}_0x3dcaab=_[_0x1d20('0x43')]({},_0x3dcaab,_0x27e2d5['options']);var _0xf80835={'where':_0x3dcaab[_0x1d20('0x41')]};return db['WhatsappTransferReport']['count'](_0xf80835)[_0x1d20('0x2a')](function(_0x7193dc){_0x2249e3[_0x1d20('0x22')]=_0x7193dc;if(_0x27e2d5[_0x1d20('0x36')][_0x1d20('0x44')]){_0x3dcaab[_0x1d20('0x45')]=[{'all':!![]}];}return db[_0x1d20('0x31')][_0x1d20('0x46')](_0x3dcaab);})[_0x1d20('0x2a')](function(_0x1e1d98){_0x2249e3['rows']=_0x1e1d98;return _0x2249e3;})[_0x1d20('0x2a')](respondWithFilteredResult(_0x178e32,_0x3dcaab))['catch'](handleError(_0x178e32,null));};exports['show']=function(_0x144834,_0x35028b){var _0x3e1459={'raw':!![],'where':{'id':_0x144834[_0x1d20('0x47')]['id']}},_0x1546e4={};_0x1546e4[_0x1d20('0x35')]=_[_0x1d20('0x37')](db[_0x1d20('0x31')]['rawAttributes']);_0x1546e4[_0x1d20('0x36')]=_[_0x1d20('0x37')](_0x144834['query']);_0x1546e4['filters']=_['intersection'](_0x1546e4[_0x1d20('0x35')],_0x1546e4[_0x1d20('0x36')]);_0x3e1459[_0x1d20('0x3b')]=_[_0x1d20('0x39')](_0x1546e4[_0x1d20('0x35')],qs[_0x1d20('0x3a')](_0x144834[_0x1d20('0x36')]['fields']));_0x3e1459[_0x1d20('0x3b')]=_0x3e1459[_0x1d20('0x3b')][_0x1d20('0x48')]?_0x3e1459['attributes']:_0x1546e4['model'];if(_0x144834[_0x1d20('0x36')][_0x1d20('0x44')]){_0x3e1459['include']=[{'all':!![]}];}_0x3e1459=_[_0x1d20('0x43')]({},_0x3e1459,_0x144834[_0x1d20('0x49')]);return db[_0x1d20('0x31')][_0x1d20('0x4a')](_0x3e1459)[_0x1d20('0x2a')](handleEntityNotFound(_0x35028b,null))[_0x1d20('0x2a')](respondWithResult(_0x35028b,null))[_0x1d20('0x4b')](handleError(_0x35028b,null));};exports[_0x1d20('0x4c')]=function(_0x44bac6,_0x516812){return db[_0x1d20('0x31')]['create'](_0x44bac6[_0x1d20('0x4d')],{})['then'](respondWithResult(_0x516812,0xc9))[_0x1d20('0x4b')](handleError(_0x516812,null));};exports[_0x1d20('0x29')]=function(_0x576d31,_0x27db13){if(_0x576d31['body']['id']){delete _0x576d31['body']['id'];}return db['WhatsappTransferReport'][_0x1d20('0x4a')]({'where':{'id':_0x576d31[_0x1d20('0x47')]['id']}})[_0x1d20('0x2a')](handleEntityNotFound(_0x27db13,null))[_0x1d20('0x2a')](saveUpdates(_0x576d31[_0x1d20('0x4d')],null))[_0x1d20('0x2a')](respondWithResult(_0x27db13,null))['catch'](handleError(_0x27db13,null));};exports[_0x1d20('0x2b')]=function(_0x2052e2,_0x2b7f28){return db['WhatsappTransferReport'][_0x1d20('0x4a')]({'where':{'id':_0x2052e2['params']['id']}})[_0x1d20('0x2a')](handleEntityNotFound(_0x2b7f28,null))['then'](removeEntity(_0x2b7f28,null))[_0x1d20('0x4b')](handleError(_0x2b7f28,null));};exports[_0x1d20('0x4e')]=function(_0x1f0110,_0x287e7b){return db[_0x1d20('0x31')]['describe']()[_0x1d20('0x2a')](respondWithResult(_0x287e7b,null))[_0x1d20('0x4b')](handleError(_0x287e7b,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 5c48a95..bd4442a 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 _0xea26=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','WhatsappTransferReport','report_whatsapp_transfer','uniqueid'];(function(_0x25f23a,_0x40a2aa){var _0x693fa8=function(_0x19922f){while(--_0x19922f){_0x25f23a['push'](_0x25f23a['shift']());}};_0x693fa8(++_0x40a2aa);}(_0xea26,0x11e));var _0x6ea2=function(_0x598902,_0x20592a){_0x598902=_0x598902-0x0;var _0x5c6500=_0xea26[_0x598902];return _0x5c6500;};'use strict';var _=require(_0x6ea2('0x0'));var util=require(_0x6ea2('0x1'));var logger=require(_0x6ea2('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6ea2('0x3'));var rp=require(_0x6ea2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ea2('0x5'));var config=require(_0x6ea2('0x6'));var attributes=require(_0x6ea2('0x7'));module['exports']=function(_0x1b089c,_0x41949b){return _0x1b089c['define'](_0x6ea2('0x8'),attributes,{'tableName':_0x6ea2('0x9'),'paranoid':![],'indexes':[{'name':_0x6ea2('0xa'),'fields':[_0x6ea2('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4197=['report_whatsapp_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','WhatsappTransferReport'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4197,0x18e));var _0x7419=function(_0x4d91fa,_0x37024c){_0x4d91fa=_0x4d91fa-0x0;var _0x144623=_0x4197[_0x4d91fa];return _0x144623;};'use strict';var _=require(_0x7419('0x0'));var util=require(_0x7419('0x1'));var logger=require('../../config/logger')(_0x7419('0x2'));var moment=require(_0x7419('0x3'));var BPromise=require(_0x7419('0x4'));var rp=require(_0x7419('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7419('0x6'));var config=require(_0x7419('0x7'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x14f1a5,_0x3f7434){return _0x14f1a5[_0x7419('0x8')](_0x7419('0x9'),attributes,{'tableName':_0x7419('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7419('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 01594dc..c773192 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 _0xfef6=['http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x35b0b6,_0x21ae97){var _0x145fcd=function(_0x3ae951){while(--_0x3ae951){_0x35b0b6['push'](_0x35b0b6['shift']());}};_0x145fcd(++_0x21ae97);}(_0xfef6,0xfc));var _0x6fef=function(_0x14a2de,_0xb6f4fa){_0x14a2de=_0x14a2de-0x0;var _0x5f2d6c=_0xfef6[_0x14a2de];return _0x5f2d6c;};'use strict';var _=require('lodash');var util=require(_0x6fef('0x0'));var moment=require('moment');var BPromise=require(_0x6fef('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6fef('0x2'));var db=require(_0x6fef('0x3'))['db'];var utils=require(_0x6fef('0x4'));var logger=require(_0x6fef('0x5'))(_0x6fef('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6fef('0x7')][_0x6fef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c361a,_0x397487,_0x5b7fc0){return new BPromise(function(_0x3de00d,_0x47941f){return client[_0x6fef('0x9')](_0x5c361a,_0x5b7fc0)['then'](function(_0x641b56){logger[_0x6fef('0xa')](_0x6fef('0xb'),_0x397487,_0x6fef('0xc'));logger['debug'](_0x6fef('0xd'),_0x397487,_0x6fef('0xc'),JSON[_0x6fef('0xe')](_0x641b56));if(_0x641b56[_0x6fef('0xf')]){if(_0x641b56[_0x6fef('0xf')][_0x6fef('0x10')]===0x1f4){logger[_0x6fef('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x397487,_0x641b56[_0x6fef('0xf')][_0x6fef('0x11')]);return _0x47941f(_0x641b56[_0x6fef('0xf')][_0x6fef('0x11')]);}logger[_0x6fef('0xf')](_0x6fef('0xb'),_0x397487,_0x641b56['error'][_0x6fef('0x11')]);return _0x3de00d(_0x641b56[_0x6fef('0xf')]['message']);}else{logger[_0x6fef('0xa')](_0x6fef('0xb'),_0x397487,_0x6fef('0xc'));_0x3de00d(_0x641b56[_0x6fef('0x12')][_0x6fef('0x11')]);}})[_0x6fef('0x13')](function(_0x552f97){logger[_0x6fef('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x397487,_0x552f97);_0x47941f(_0x552f97);});});} \ No newline at end of file +var _0xe98b=['randomstring','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4a775c,_0x356dda){var _0x1fb88a=function(_0x555ef8){while(--_0x555ef8){_0x4a775c['push'](_0x4a775c['shift']());}};_0x1fb88a(++_0x356dda);}(_0xe98b,0x15c));var _0xbe98=function(_0x265264,_0x9e9210){_0x265264=_0x265264-0x0;var _0x335120=_0xe98b[_0x265264];return _0x335120;};'use strict';var _=require(_0xbe98('0x0'));var util=require(_0xbe98('0x1'));var moment=require(_0xbe98('0x2'));var BPromise=require(_0xbe98('0x3'));var rs=require(_0xbe98('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbe98('0x5'));var logger=require(_0xbe98('0x6'))(_0xbe98('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbe98('0x8')][_0xbe98('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x110197,_0x1bd656,_0x58527a){return new BPromise(function(_0xa349f7,_0x34ccbc){return client[_0xbe98('0xa')](_0x110197,_0x58527a)[_0xbe98('0xb')](function(_0x2e215a){logger[_0xbe98('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1bd656,_0xbe98('0xd'));logger[_0xbe98('0xe')](_0xbe98('0xf'),_0x1bd656,'request\x20sent',JSON[_0xbe98('0x10')](_0x2e215a));if(_0x2e215a[_0xbe98('0x11')]){if(_0x2e215a[_0xbe98('0x11')]['code']===0x1f4){logger[_0xbe98('0x11')](_0xbe98('0x12'),_0x1bd656,_0x2e215a[_0xbe98('0x11')][_0xbe98('0x13')]);return _0x34ccbc(_0x2e215a['error'][_0xbe98('0x13')]);}logger[_0xbe98('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1bd656,_0x2e215a[_0xbe98('0x11')]['message']);return _0xa349f7(_0x2e215a[_0xbe98('0x11')]['message']);}else{logger[_0xbe98('0xc')](_0xbe98('0x12'),_0x1bd656,'request\x20sent');_0xa349f7(_0x2e215a[_0xbe98('0x14')]['message']);}})[_0xbe98('0x15')](function(_0x84630a){logger['error'](_0xbe98('0x12'),_0x1bd656,_0x84630a);_0x34ccbc(_0x84630a);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index fe9da71..0ec49a0 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x180d=['exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','then','listen','info','start','Online\x20apps:','map','online','name','join','filter','seedDB','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s'];(function(_0x12b83d,_0x4bcec7){var _0x1fd39d=function(_0x449185){while(--_0x449185){_0x12b83d['push'](_0x12b83d['shift']());}};_0x1fd39d(++_0x4bcec7);}(_0x180d,0xc5));var _0xd180=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x180d[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0xd180('0x0'));var mysqldb=require(_0xd180('0x1'));var rpc=require(_0xd180('0x2'));var config=require(_0xd180('0x3'));var logger=require(_0xd180('0x4'))(_0xd180('0x5'));var pm2=require(_0xd180('0x6'));var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require(_0xd180('0x7'));var whatsapp=require(_0xd180('0x8'));var transcribe=require(_0xd180('0x9'));function main(){return mysqldb['db'][_0xd180('0xa')]['sync']()[_0xd180('0xb')](function(){return rpc[_0xd180('0xc')]();})[_0xd180('0xb')](function(_0x38d57c){logger[_0xd180('0xd')](_0x38d57c);return chat[_0xd180('0xe')]();})[_0xd180('0xb')](function(){return whatsapp[_0xd180('0xe')]();})[_0xd180('0xb')](function(){return schedule[_0xd180('0xe')]();})[_0xd180('0xb')](function(){return transcribe[_0xd180('0xe')]();})['then'](function(_0x17a1b7){logger[_0xd180('0xd')](_0x17a1b7);return pm2[_0xd180('0xe')](pm2Config);})[_0xd180('0xb')](function(_0x3ee387){logger[_0xd180('0xd')](_0xd180('0xf'),_[_0xd180('0x10')](_['filter'](_0x3ee387,{'status':_0xd180('0x11')}),_0xd180('0x12'))[_0xd180('0x13')]());logger[_0xd180('0xd')]('Offline\x20apps:',_[_0xd180('0x10')](_[_0xd180('0x14')](_0x3ee387,function(_0x49061f){return _0x49061f['status']!==_0xd180('0x11');}),'name')[_0xd180('0x13')]()||'None');config[_0xd180('0x15')]&&require(_0xd180('0x16'))[_0xd180('0x17')]();require(_0xd180('0x18'))[_0xd180('0x17')]();})[_0xd180('0x19')](function(_0x5c14a0){logger['error'](_0xd180('0x1a'),_0x5c14a0);process[_0xd180('0x1b')](0x1);});}main(); \ No newline at end of file +var _0x983f=['./config/environment','./config/logger','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','sequelize','then','listen','start','info','filter','online','join','Offline\x20apps:','map','status','name','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc'];(function(_0x247c8d,_0x25141e){var _0x39f9fe=function(_0x51789d){while(--_0x51789d){_0x247c8d['push'](_0x247c8d['shift']());}};_0x39f9fe(++_0x25141e);}(_0x983f,0x13c));var _0xf983=function(_0x2aca1b,_0x15843e){_0x2aca1b=_0x2aca1b-0x0;var _0x37f562=_0x983f[_0x2aca1b];return _0x37f562;};'use strict';var _=require(_0xf983('0x0'));var mysqldb=require(_0xf983('0x1'));var rpc=require(_0xf983('0x2'));var config=require(_0xf983('0x3'));var logger=require(_0xf983('0x4'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0xf983('0x5'));var schedule=require(_0xf983('0x6'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xf983('0x7'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0xf983('0x8')]['sync']()[_0xf983('0x9')](function(){return rpc[_0xf983('0xa')]();})[_0xf983('0x9')](function(_0x2b8bae){logger['info'](_0x2b8bae);return chat[_0xf983('0xb')]();})[_0xf983('0x9')](function(){return whatsapp[_0xf983('0xb')]();})[_0xf983('0x9')](function(){return schedule['start']();})[_0xf983('0x9')](function(){return transcribe['start']();})[_0xf983('0x9')](function(_0x54e617){logger['info'](_0x54e617);return pm2[_0xf983('0xb')](pm2Config);})[_0xf983('0x9')](function(_0x4af3f5){logger[_0xf983('0xc')]('Online\x20apps:',_['map'](_[_0xf983('0xd')](_0x4af3f5,{'status':_0xf983('0xe')}),'name')[_0xf983('0xf')]());logger[_0xf983('0xc')](_0xf983('0x10'),_[_0xf983('0x11')](_['filter'](_0x4af3f5,function(_0x1e156d){return _0x1e156d[_0xf983('0x12')]!=='online';}),_0xf983('0x13'))[_0xf983('0xf')]()||_0xf983('0x14'));config[_0xf983('0x15')]&&require(_0xf983('0x16'))[_0xf983('0x17')]();require(_0xf983('0x18'))[_0xf983('0x17')]();})[_0xf983('0x19')](function(_0x197672){logger[_0xf983('0x1a')](_0xf983('0x1b'),_0x197672);process[_0xf983('0x1c')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index e5f1019..dae4d86 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 _0xc257=['toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','length','unshift','encryptString','join','promisify','sign','secret','session','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','crypto','bluebird','moment','secrets','role','fullname','userpic','voicePause','chatPause','mailPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','disposition','closed','status','unmanaged','json','Unmanaged.','catch','headers','authorization','Basic','User','name','authenticate','Wrong\x20credentials.','startsWith','Bearer','query','apikey','getUuid','find','sub','then','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split'];(function(_0x5bc5fe,_0x2afaef){var _0x298ea7=function(_0x1c6bd5){while(--_0x1c6bd5){_0x5bc5fe['push'](_0x5bc5fe['shift']());}};_0x298ea7(++_0x2afaef);}(_0xc257,0x1a1));var _0x7c25=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xc257[_0x5ddb1c];return _0x354adc;};'use strict';var db=require(_0x7c25('0x0'))['db'];var config=require(_0x7c25('0x1'));var hardwareConf=require(_0x7c25('0x2'));var licenseUtil=require(_0x7c25('0x3'));var encryptor=require(_0x7c25('0x4'));var _=require(_0x7c25('0x5'));var jwt=require(_0x7c25('0x6'));var expressJwt=require(_0x7c25('0x7'));var compose=require(_0x7c25('0x8'));var basicAuth=require('basic-auth');var crypto=require(_0x7c25('0x9'));var BPromise=require(_0x7c25('0xa'));var util=require('util');var moment=require(_0x7c25('0xb'));var validateJwt=expressJwt({'secret':config[_0x7c25('0xc')]['session']});var userAttributes=['id',_0x7c25('0xd'),_0x7c25('0xe'),'name','internal','email',_0x7c25('0xf'),'permissions','md5secret',_0x7c25('0x10'),_0x7c25('0x11'),_0x7c25('0x12'),_0x7c25('0x13'),_0x7c25('0x14'),'openchannelPause',_0x7c25('0x15'),_0x7c25('0x16'),_0x7c25('0x17'),_0x7c25('0x18'),_0x7c25('0x19'),_0x7c25('0x1a'),'passwordResetAt',_0x7c25('0x1b'),'phoneBarAutoAnswer',_0x7c25('0x1c'),'phoneBarDnd',_0x7c25('0x1d'),_0x7c25('0x1e'),_0x7c25('0x1f'),_0x7c25('0x20'),_0x7c25('0x21'),_0x7c25('0x22'),_0x7c25('0x23'),_0x7c25('0x24'),'interface',_0x7c25('0x25'),_0x7c25('0x26'),_0x7c25('0x27'),_0x7c25('0x28'),_0x7c25('0x29'),'downloadOmnichannelInteractions',_0x7c25('0x2a')];exports[_0x7c25('0x2b')]=function(){return this[_0x7c25('0x2c')](!![])[_0x7c25('0x2d')](function(_0x5f3fee,_0x4382ed,_0x1ec923){if(_0x5f3fee[_0x7c25('0x2e')]){_0x1ec923();}else{return db[_0x7c25('0x2f')][_0x7c25('0x30')]({'where':{'id':_0x5f3fee[_0x7c25('0x31')]['id']},'attributes':['id','closed',_0x7c25('0x32')],'raw':!![]})['then'](function(_0x2121eb){if(_0x2121eb&&_0x2121eb[_0x7c25('0x33')]){return _0x4382ed[_0x7c25('0x34')](_0x2121eb[_0x7c25('0x32')]===_0x7c25('0x35')?0x195:0x193)[_0x7c25('0x36')]({'message':_0x2121eb['disposition']===_0x7c25('0x35')?_0x7c25('0x37'):'Forbidden.'});}else{_0x1ec923();}})[_0x7c25('0x38')](function(_0x37cb90){_0x1ec923(_0x37cb90);});}});};exports[_0x7c25('0x2c')]=function isAuthenticated(_0x40150e){return compose()[_0x7c25('0x2d')](function(_0x412454,_0x17a5e2,_0x2bd60d){var _0x4724f3;if(_0x412454[_0x7c25('0x39')][_0x7c25('0x3a')]){if(_['startsWith'](_0x412454[_0x7c25('0x39')][_0x7c25('0x3a')],_0x7c25('0x3b'))){var _0x2b0cdd=basicAuth(_0x412454);db[_0x7c25('0x3c')]['find']({'where':{'name':_0x2b0cdd[_0x7c25('0x3d')]}})['then'](function(_0x4091a0){if(!_0x4091a0||!_0x4091a0[_0x7c25('0x3e')](_0x2b0cdd['pass'])){return _0x17a5e2['status'](0x191)[_0x7c25('0x36')]({'message':_0x7c25('0x3f')});}_0x412454['user']={'id':_0x4091a0['id']};_0x2bd60d();})[_0x7c25('0x38')](function(_0x5c8920){_0x2bd60d(_0x5c8920);});}else if(_[_0x7c25('0x40')](_0x412454['headers'][_0x7c25('0x3a')],_0x7c25('0x41'))){validateJwt(_0x412454,_0x17a5e2,_0x2bd60d);}else{if(_0x40150e){_0x2bd60d();}else{return _0x17a5e2['status'](0x193)[_0x7c25('0x36')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x412454[_0x7c25('0x42')][_0x7c25('0x43')]){try{var _0x428316={'audience':hardwareConf[_0x7c25('0x44')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x412454[_0x7c25('0x42')]['apikey'],_0x428316)['then'](function(_0x193c4d){return db[_0x7c25('0x3c')][_0x7c25('0x45')]({'where':{'id':_0x193c4d[_0x7c25('0x46')]}})[_0x7c25('0x47')](function(_0x1caf5c){_0x4724f3=_0x1caf5c;return db[_0x7c25('0x48')][_0x7c25('0x30')]({'where':{'id':0x1},'attributes':[_0x7c25('0x49'),_0x7c25('0x4a')],'raw':!![]});})[_0x7c25('0x47')](function(_0x36ff1d){if(!_0x4724f3||!_[_0x7c25('0x4b')](_0x4724f3[_0x7c25('0x4c')],_0x193c4d[_0x7c25('0x4d')])){return _0x17a5e2[_0x7c25('0x34')](0x191)[_0x7c25('0x36')]({'message':_0x7c25('0x4e')});}if(_0x4724f3[_0x7c25('0x4f')]){return _0x17a5e2[_0x7c25('0x34')](0x191)[_0x7c25('0x36')]({'message':_0x7c25('0x50')});}if(_0x4724f3[_0x7c25('0x51')]){if(_0x36ff1d[_0x7c25('0x4a')]>0x0){if(moment(_0x4724f3[_0x7c25('0x52')])[_0x7c25('0x53')](_0x36ff1d[_0x7c25('0x4a')],_0x7c25('0x54'))>moment()){return _0x17a5e2[_0x7c25('0x34')](0x191)['json']({'message':_0x7c25('0x50')});}}else{return _0x17a5e2[_0x7c25('0x34')](0x191)[_0x7c25('0x36')]({'message':_0x7c25('0x50')});}}_0x412454[_0x7c25('0x2e')]={'id':_0x4724f3['id']};_0x2bd60d();});})[_0x7c25('0x38')](function(){return _0x17a5e2['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x433496){_0x2bd60d(_0x433496);}}else if(_0x40150e){_0x2bd60d();}else{return _0x17a5e2[_0x7c25('0x34')](0x193)[_0x7c25('0x36')]({'message':_0x7c25('0x55')});}})[_0x7c25('0x2d')](function(_0x454a45,_0x378908,_0x492914){if(_0x454a45['user']){db[_0x7c25('0x3c')][_0x7c25('0x45')]({'where':{'id':_0x454a45[_0x7c25('0x2e')]['id']},'attributes':userAttributes})[_0x7c25('0x47')](function(_0x191d02){if(!_0x191d02){return _0x378908[_0x7c25('0x34')](0x194)['json']({'message':_0x7c25('0x56')});}_0x454a45['user']=_0x191d02;_0x492914();})[_0x7c25('0x38')](function(_0x66e9b8){_0x492914(_0x66e9b8);});}else if(_0x40150e){_0x492914();}else{return _0x378908[_0x7c25('0x34')](0x194)['json']({'message':_0x7c25('0x57')});}});};exports[_0x7c25('0x58')]=function canUpdate(){return compose()[_0x7c25('0x2d')](function(_0x55b874,_0x5679ca,_0x44e2a8){return licenseUtil[_0x7c25('0x59')]()[_0x7c25('0x47')](function(_0x57f65b){if(_0x57f65b[_0x7c25('0x5a')]){_0x44e2a8();}else{return _0x5679ca['status'](0x193)[_0x7c25('0x36')]({'message':_0x7c25('0x5b')});}})[_0x7c25('0x38')](function(_0x586816){_0x44e2a8(_0x586816);});});};exports[_0x7c25('0x5c')]=function(_0x3fd777,_0x26e587,_0x1a1129){_0x3fd777[_0x7c25('0x5c')]=!![];return _0x1a1129();};exports[_0x7c25('0x5d')]=function signToken(_0xe72192){return signJwt(_0xe72192);};exports['setTokenCookie']=function(_0x1555b5,_0x1dbe0b){if(!_0x1555b5[_0x7c25('0x2e')]){return _0x1dbe0b[_0x7c25('0x34')](0x194)[_0x7c25('0x36')]({'message':_0x7c25('0x5e')});}var _0x2b6442={'payload':{'id':_0x1555b5[_0x7c25('0x2e')]['id'],'role':_0x1555b5[_0x7c25('0x2e')][_0x7c25('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2b6442)[_0x7c25('0x47')](function(_0x30bb8e){_0x1dbe0b['cookie'](_0x7c25('0x5f'),_0x30bb8e);_0x1dbe0b[_0x7c25('0x60')](_0x7c25('0x61'));})[_0x7c25('0x38')](function(_0xf54f99){return _0x1dbe0b[_0x7c25('0x34')](0x1f4)[_0x7c25('0x62')](_0xf54f99);});};exports[_0x7c25('0x63')]=function(_0x35639a){if(_[_0x7c25('0x64')](_0x35639a['apiKeyNonce'])||_[_0x7c25('0x64')](_0x35639a[_0x7c25('0x65')])){return null;}else{return createJwt(_0x35639a);}};exports[_0x7c25('0x66')]=function(_0x53dc22){_0x53dc22[_0x7c25('0x4c')]=generateNonce();_0x53dc22[_0x7c25('0x65')]=generateIssuedAt();return createJwt(_0x53dc22);};exports[_0x7c25('0x67')]=function(_0x3552e4,_0x540e50){var _0x43df15=_0x3552e4['query'][_0x7c25('0x43')];if(_0x43df15){var _0x7d3943={'nonce':_0x540e50[_0x7c25('0x4c')],'iat':_0x540e50[_0x7c25('0x65')],'audience':hardwareConf[_0x7c25('0x44')](),'issuer':hardwareConf[_0x7c25('0x44')]()};return verifyJwt(_0x43df15,_0x7d3943)['then'](function(){return generateApiKey(_0x540e50);});}else{throw{'message':_0x7c25('0x68')};}};exports[_0x7c25('0x69')]=function(_0x40e2fd){var _0x337f9e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x337f9e[_0x7c25('0x6a')](_0x40e2fd))throw new db['Sequelize']['ValidationError'](_0x7c25('0x6b'));return;};exports[_0x7c25('0x6c')]=function(_0x4a4f70,_0x602aee,_0x1cff35){var _0x466cb0=encryptor[_0x7c25('0x6d')](_0x602aee)[_0x7c25('0x6e')](',');for(var _0x2e0ba2=0x0;_0x2e0ba2<_0x1cff35;_0x2e0ba2++){if(!_0x466cb0[_0x2e0ba2])break;if(_0x4a4f70['toLowerCase']()===_0x466cb0[_0x2e0ba2][_0x7c25('0x6f')]()){var _0x3abef0=util[_0x7c25('0x70')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x1cff35);if(_0x1cff35===0x1){_0x3abef0=_0x7c25('0x71');}throw new db['Sequelize'][(_0x7c25('0x72'))](_0x3abef0);}}return;};exports[_0x7c25('0x73')]=function(_0x492c36,_0x3f9728){var _0x3d9b5b=_0x3f9728?encryptor[_0x7c25('0x6d')](_0x3f9728)[_0x7c25('0x6e')](','):[];if(_0x3d9b5b[_0x7c25('0x74')]===0x5){_0x3d9b5b['splice'](-0x1,0x1);}_0x3d9b5b[_0x7c25('0x75')](_0x492c36);return encryptor[_0x7c25('0x76')](_0x3d9b5b[_0x7c25('0x77')](','));};function signJwt(_0x4cc61d){var _0x3e149c=BPromise[_0x7c25('0x78')](jwt[_0x7c25('0x79')],{'context':jwt});var _0x2e94c7=_0x4cc61d[_0x7c25('0x7a')]||config[_0x7c25('0xc')][_0x7c25('0x7b')];return new BPromise(function(_0x376fc7,_0x321d4e){_0x3e149c(_0x4cc61d['payload'],_0x2e94c7,_0x4cc61d[_0x7c25('0x7c')])[_0x7c25('0x47')](function(_0xc87fe9){_0x376fc7(_0xc87fe9);})[_0x7c25('0x38')](function(_0x5d618c){_0x321d4e(_0x5d618c);});});}function verifyJwt(_0x27eeec,_0x5c027f,_0x3ac5db){var _0x489bf5=BPromise[_0x7c25('0x78')](jwt[_0x7c25('0x7d')],{'context':jwt});var _0x8588e3=_0x3ac5db||config[_0x7c25('0xc')][_0x7c25('0x7b')];return new BPromise(function(_0x38414d,_0x4f2325){_0x489bf5(_0x27eeec,_0x8588e3,_0x5c027f)[_0x7c25('0x47')](function(_0x5bf630){_0x38414d(_0x5bf630);})[_0x7c25('0x38')](function(_0x4342bf){_0x4f2325(_0x4342bf);});});}function generateNonce(){return crypto[_0x7c25('0x7e')](0x10)[_0x7c25('0x7f')](_0x7c25('0x80'));}function generateIssuedAt(){return Math[_0x7c25('0x81')](Date[_0x7c25('0x82')]()/0x3e8)[_0x7c25('0x7f')]();}function createJwt(_0x41c79f){var _0x3f04b4={'payload':{'iat':_0x41c79f['apiKeyIat'],'nonce':_0x41c79f[_0x7c25('0x4c')]},'options':{'algorithm':_0x7c25('0x83'),'subject':_0x41c79f['id'][_0x7c25('0x7f')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x7c25('0x44')]()}};return signJwt(_0x3f04b4)[_0x7c25('0x47')](function(_0x55eb80){return{'iat':_0x41c79f[_0x7c25('0x65')],'nonce':_0x41c79f[_0x7c25('0x4c')],'token':_0x55eb80};});} \ No newline at end of file +var _0x0df9=['nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','length','unshift','join','promisify','sign','secret','secrets','payload','options','randomBytes','toString','hex','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','composable-middleware','crypto','bluebird','util','moment','session','role','fullname','name','internal','email','userpic','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','allowmessenger','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','closed','disposition','then','status','json','unmanaged','Unmanaged.','Forbidden.','catch','use','headers','authorization','startsWith','User','find','authenticate','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce'];(function(_0x4329d3,_0x290109){var _0x43a0cb=function(_0x2872a6){while(--_0x2872a6){_0x4329d3['push'](_0x4329d3['shift']());}};_0x43a0cb(++_0x290109);}(_0x0df9,0xaa));var _0x90df=function(_0x388794,_0x10395e){_0x388794=_0x388794-0x0;var _0x1d1c64=_0x0df9[_0x388794];return _0x1d1c64;};'use strict';var db=require(_0x90df('0x0'))['db'];var config=require(_0x90df('0x1'));var hardwareConf=require(_0x90df('0x2'));var licenseUtil=require(_0x90df('0x3'));var encryptor=require('../encryptor');var _=require(_0x90df('0x4'));var jwt=require(_0x90df('0x5'));var expressJwt=require('express-jwt');var compose=require(_0x90df('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0x90df('0x7'));var BPromise=require(_0x90df('0x8'));var util=require(_0x90df('0x9'));var moment=require(_0x90df('0xa'));var validateJwt=expressJwt({'secret':config['secrets'][_0x90df('0xb')]});var userAttributes=['id',_0x90df('0xc'),_0x90df('0xd'),_0x90df('0xe'),_0x90df('0xf'),_0x90df('0x10'),_0x90df('0x11'),'permissions',_0x90df('0x12'),_0x90df('0x13'),_0x90df('0x14'),_0x90df('0x15'),_0x90df('0x16'),_0x90df('0x17'),_0x90df('0x18'),_0x90df('0x19'),'showWebBar',_0x90df('0x1a'),_0x90df('0x1b'),'crudPermissions',_0x90df('0x1c'),'passwordResetAt','alias',_0x90df('0x1d'),_0x90df('0x1e'),_0x90df('0x1f'),_0x90df('0x20'),'phoneBarEnableDtmfTone',_0x90df('0x21'),_0x90df('0x22'),_0x90df('0x23'),'phoneBarRemoteControl',_0x90df('0x24'),_0x90df('0x25'),'interface',_0x90df('0x26'),_0x90df('0x27'),_0x90df('0x28'),_0x90df('0x29'),'downloadVoiceRecordings',_0x90df('0x2a'),'downloadAttachments'];exports[_0x90df('0x2b')]=function(){return this[_0x90df('0x2c')](!![])['use'](function(_0x13f5fa,_0x45e815,_0x41468c){if(_0x13f5fa[_0x90df('0x2d')]){_0x41468c();}else{return db[_0x90df('0x2e')][_0x90df('0x2f')]({'where':{'id':_0x13f5fa['params']['id']},'attributes':['id',_0x90df('0x30'),_0x90df('0x31')],'raw':!![]})[_0x90df('0x32')](function(_0x5a034e){if(_0x5a034e&&_0x5a034e[_0x90df('0x30')]){return _0x45e815[_0x90df('0x33')](_0x5a034e['disposition']==='unmanaged'?0x195:0x193)[_0x90df('0x34')]({'message':_0x5a034e[_0x90df('0x31')]===_0x90df('0x35')?_0x90df('0x36'):_0x90df('0x37')});}else{_0x41468c();}})[_0x90df('0x38')](function(_0x12526d){_0x41468c(_0x12526d);});}});};exports['isAuthenticated']=function isAuthenticated(_0x35d228){return compose()[_0x90df('0x39')](function(_0x42c0a8,_0x30eacd,_0x44245a){var _0x2d1dc5;if(_0x42c0a8[_0x90df('0x3a')][_0x90df('0x3b')]){if(_[_0x90df('0x3c')](_0x42c0a8[_0x90df('0x3a')][_0x90df('0x3b')],'Basic')){var _0x1177a1=basicAuth(_0x42c0a8);db[_0x90df('0x3d')][_0x90df('0x3e')]({'where':{'name':_0x1177a1['name']}})[_0x90df('0x32')](function(_0x19c2d1){if(!_0x19c2d1||!_0x19c2d1[_0x90df('0x3f')](_0x1177a1['pass'])){return _0x30eacd[_0x90df('0x33')](0x191)[_0x90df('0x34')]({'message':_0x90df('0x40')});}_0x42c0a8[_0x90df('0x2d')]={'id':_0x19c2d1['id']};_0x44245a();})['catch'](function(_0x12dc6a){_0x44245a(_0x12dc6a);});}else if(_[_0x90df('0x3c')](_0x42c0a8[_0x90df('0x3a')][_0x90df('0x3b')],_0x90df('0x41'))){validateJwt(_0x42c0a8,_0x30eacd,_0x44245a);}else{if(_0x35d228){_0x44245a();}else{return _0x30eacd[_0x90df('0x33')](0x193)[_0x90df('0x34')]({'message':_0x90df('0x42')});}}}else if(_0x42c0a8['query'][_0x90df('0x43')]){try{var _0x1578e6={'audience':hardwareConf[_0x90df('0x44')](),'issuer':hardwareConf[_0x90df('0x44')]()};verifyJwt(_0x42c0a8[_0x90df('0x45')]['apikey'],_0x1578e6)[_0x90df('0x32')](function(_0x14d6a7){return db[_0x90df('0x3d')]['find']({'where':{'id':_0x14d6a7[_0x90df('0x46')]}})['then'](function(_0x2eb76d){_0x2d1dc5=_0x2eb76d;return db[_0x90df('0x47')][_0x90df('0x2f')]({'where':{'id':0x1},'attributes':[_0x90df('0x48'),_0x90df('0x49')],'raw':!![]});})[_0x90df('0x32')](function(_0x2989a6){if(!_0x2d1dc5||!_[_0x90df('0x4a')](_0x2d1dc5[_0x90df('0x4b')],_0x14d6a7[_0x90df('0x4c')])){return _0x30eacd[_0x90df('0x33')](0x191)['json']({'message':_0x90df('0x4d')});}if(_0x2d1dc5[_0x90df('0x4e')]){return _0x30eacd['status'](0x191)[_0x90df('0x34')]({'message':_0x90df('0x4f')});}if(_0x2d1dc5[_0x90df('0x50')]){if(_0x2989a6[_0x90df('0x49')]>0x0){if(moment(_0x2d1dc5[_0x90df('0x51')])['add'](_0x2989a6['blockDuration'],_0x90df('0x52'))>moment()){return _0x30eacd[_0x90df('0x33')](0x191)['json']({'message':_0x90df('0x4f')});}}else{return _0x30eacd[_0x90df('0x33')](0x191)[_0x90df('0x34')]({'message':_0x90df('0x4f')});}}_0x42c0a8[_0x90df('0x2d')]={'id':_0x2d1dc5['id']};_0x44245a();});})['catch'](function(){return _0x30eacd[_0x90df('0x33')](0x191)[_0x90df('0x34')]({'message':_0x90df('0x4f')});});}catch(_0x37a7a9){_0x44245a(_0x37a7a9);}}else if(_0x35d228){_0x44245a();}else{return _0x30eacd[_0x90df('0x33')](0x193)['json']({'message':_0x90df('0x42')});}})[_0x90df('0x39')](function(_0x2d4140,_0x5db805,_0x54ce44){if(_0x2d4140[_0x90df('0x2d')]){db[_0x90df('0x3d')][_0x90df('0x3e')]({'where':{'id':_0x2d4140[_0x90df('0x2d')]['id']},'attributes':userAttributes})['then'](function(_0x3ec515){if(!_0x3ec515){return _0x5db805['status'](0x194)[_0x90df('0x34')]({'message':'User\x20not\x20found.'});}_0x2d4140[_0x90df('0x2d')]=_0x3ec515;_0x54ce44();})[_0x90df('0x38')](function(_0x3d17dd){_0x54ce44(_0x3d17dd);});}else if(_0x35d228){_0x54ce44();}else{return _0x5db805[_0x90df('0x33')](0x194)['json']({'message':_0x90df('0x53')});}});};exports[_0x90df('0x54')]=function canUpdate(){return compose()[_0x90df('0x39')](function(_0x2bec77,_0x391f5c,_0x538c38){return licenseUtil['getLicense']()[_0x90df('0x32')](function(_0x1e4506){if(_0x1e4506[_0x90df('0x55')]){_0x538c38();}else{return _0x391f5c[_0x90df('0x33')](0x193)[_0x90df('0x34')]({'message':_0x90df('0x56')});}})[_0x90df('0x38')](function(_0x3b2e68){_0x538c38(_0x3b2e68);});});};exports[_0x90df('0x57')]=function(_0x5bd445,_0x1c719a,_0x31c8b5){_0x5bd445[_0x90df('0x57')]=!![];return _0x31c8b5();};exports[_0x90df('0x58')]=function signToken(_0xf9d431){return signJwt(_0xf9d431);};exports[_0x90df('0x59')]=function(_0x2e0627,_0x553dcc){if(!_0x2e0627[_0x90df('0x2d')]){return _0x553dcc['status'](0x194)[_0x90df('0x34')]({'message':_0x90df('0x5a')});}var _0x3ec7c4={'payload':{'id':_0x2e0627[_0x90df('0x2d')]['id'],'role':_0x2e0627['user'][_0x90df('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3ec7c4)[_0x90df('0x32')](function(_0x3888c3){_0x553dcc['cookie']('motion.token',_0x3888c3);_0x553dcc[_0x90df('0x5b')](_0x90df('0x5c'));})[_0x90df('0x38')](function(_0x1daba2){return _0x553dcc['status'](0x1f4)[_0x90df('0x5d')](_0x1daba2);});};exports['retrieveApiKey']=function(_0x19014d){if(_[_0x90df('0x5e')](_0x19014d['apiKeyNonce'])||_[_0x90df('0x5e')](_0x19014d[_0x90df('0x5f')])){return null;}else{return createJwt(_0x19014d);}};exports[_0x90df('0x60')]=function(_0x134cdf){_0x134cdf[_0x90df('0x4b')]=generateNonce();_0x134cdf['apiKeyIat']=generateIssuedAt();return createJwt(_0x134cdf);};exports['regenerateApiKey']=function(_0x357dfb,_0x267bfb){var _0x45fdec=_0x357dfb[_0x90df('0x45')][_0x90df('0x43')];if(_0x45fdec){var _0x458846={'nonce':_0x267bfb['apiKeyNonce'],'iat':_0x267bfb['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x90df('0x44')]()};return verifyJwt(_0x45fdec,_0x458846)[_0x90df('0x32')](function(){return generateApiKey(_0x267bfb);});}else{throw{'message':_0x90df('0x61')};}};exports[_0x90df('0x62')]=function(_0x2c9c6b){var _0x4af719=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4af719[_0x90df('0x63')](_0x2c9c6b))throw new db[(_0x90df('0x64'))]['ValidationError'](_0x90df('0x65'));return;};exports[_0x90df('0x66')]=function(_0xddc29b,_0x3c5be4,_0x53d1eb){var _0x1cd88b=encryptor[_0x90df('0x67')](_0x3c5be4)[_0x90df('0x68')](',');for(var _0x3c45d3=0x0;_0x3c45d3<_0x53d1eb;_0x3c45d3++){if(!_0x1cd88b[_0x3c45d3])break;if(_0xddc29b['toLowerCase']()===_0x1cd88b[_0x3c45d3]['toLowerCase']()){var _0x1ab509=util[_0x90df('0x69')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x53d1eb);if(_0x53d1eb===0x1){_0x1ab509=_0x90df('0x6a');}throw new db['Sequelize'][(_0x90df('0x6b'))](_0x1ab509);}}return;};exports[_0x90df('0x6c')]=function(_0x1bdc76,_0xfc960d){var _0x4638e8=_0xfc960d?encryptor[_0x90df('0x67')](_0xfc960d)[_0x90df('0x68')](','):[];if(_0x4638e8[_0x90df('0x6d')]===0x5){_0x4638e8['splice'](-0x1,0x1);}_0x4638e8[_0x90df('0x6e')](_0x1bdc76);return encryptor['encryptString'](_0x4638e8[_0x90df('0x6f')](','));};function signJwt(_0xc91de9){var _0x2c46a0=BPromise[_0x90df('0x70')](jwt[_0x90df('0x71')],{'context':jwt});var _0x580da9=_0xc91de9[_0x90df('0x72')]||config[_0x90df('0x73')][_0x90df('0xb')];return new BPromise(function(_0x4c8d71,_0x467acf){_0x2c46a0(_0xc91de9[_0x90df('0x74')],_0x580da9,_0xc91de9[_0x90df('0x75')])[_0x90df('0x32')](function(_0x4c4c5f){_0x4c8d71(_0x4c4c5f);})[_0x90df('0x38')](function(_0x4d8f3f){_0x467acf(_0x4d8f3f);});});}function verifyJwt(_0x1121eb,_0x4497bf,_0x44e3c0){var _0x14a97e=BPromise[_0x90df('0x70')](jwt['verify'],{'context':jwt});var _0x45f7a7=_0x44e3c0||config[_0x90df('0x73')][_0x90df('0xb')];return new BPromise(function(_0x7a1631,_0x206a28){_0x14a97e(_0x1121eb,_0x45f7a7,_0x4497bf)[_0x90df('0x32')](function(_0x5a649a){_0x7a1631(_0x5a649a);})[_0x90df('0x38')](function(_0x11b420){_0x206a28(_0x11b420);});});}function generateNonce(){return crypto[_0x90df('0x76')](0x10)[_0x90df('0x77')](_0x90df('0x78'));}function generateIssuedAt(){return Math['floor'](Date[_0x90df('0x79')]()/0x3e8)[_0x90df('0x77')]();}function createJwt(_0x50103e){var _0x25bb29={'payload':{'iat':_0x50103e[_0x90df('0x5f')],'nonce':_0x50103e[_0x90df('0x4b')]},'options':{'algorithm':_0x90df('0x7a'),'subject':_0x50103e['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x25bb29)['then'](function(_0x769024){return{'iat':_0x50103e['apiKeyIat'],'nonce':_0x50103e[_0x90df('0x4b')],'token':_0x769024};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index f1869cf..44a25ef 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 _0xecd2=['../../config/environment','app','secrets','session','aes192','algorithm','encrypt','join','test','filter','hasOwnProperty','createReadStream','createWriteStream','data','binary','write','end','final','unlink','decryptFile','createDecipher','update','close','encryptString','secret','createCipher','utf8','base64','decryptString','crypto','bluebird','lodash'];(function(_0x3ffbab,_0x2ee1b4){var _0x42b220=function(_0x11fece){while(--_0x11fece){_0x3ffbab['push'](_0x3ffbab['shift']());}};_0x42b220(++_0x2ee1b4);}(_0xecd2,0x13d));var _0x2ecd=function(_0xff72a5,_0x377bf6){_0xff72a5=_0xff72a5-0x0;var _0x2ac69c=_0xecd2[_0xff72a5];return _0x2ac69c;};'use strict';var crypto=require(_0x2ecd('0x0'));var fs=require('fs');var BPromise=require(_0x2ecd('0x1'));var _=require(_0x2ecd('0x2'));var config=require(_0x2ecd('0x3'));var logger=require('../../config/logger')(_0x2ecd('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x2ecd('0x5')][_0x2ecd('0x6')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x2ecd('0x7')};if(config['encrypt']&&config['encrypt'][_0x2ecd('0x8')]){var isSupported=isAlgorithmSupported(config[_0x2ecd('0x9')][_0x2ecd('0x8')]);if(isSupported){fileOptions[_0x2ecd('0x8')]=config['encrypt'][_0x2ecd('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x2ecd('0xa')](',\x20');logger['error'](config[_0x2ecd('0x9')][_0x2ecd('0x8')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x37ea07){return AES_SUPPORTED_RX[_0x2ecd('0xb')](_0x37ea07);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x2ecd('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x1b9fa9){return getSupportedCiphers()['indexOf'](_0x1b9fa9)>-0x1;}function combineOptions(_0xa754ee){var _0x53143c={};for(var _0x59e26 in fileOptions){if(fileOptions[_0x2ecd('0xd')](_0x59e26)){_0x53143c[_0x59e26]=fileOptions[_0x59e26];}}if(_0xa754ee){for(var _0xa8c669 in _0xa754ee){if(_0xa754ee[_0x2ecd('0xd')](_0xa8c669)){_0x53143c[_0xa8c669]=_0xa754ee[_0xa8c669];}}}return _0x53143c;}exports['encryptFile']=function(_0x921395,_0x448004,_0x5700e8,_0x45673a){return new BPromise(function(_0x439057,_0x31114e){_0x45673a=combineOptions(_0x45673a);var _0x45ccad=new Buffer(_0x5700e8);var _0x2aaaec=fs[_0x2ecd('0xe')](_0x921395);var _0x4efd94=fs[_0x2ecd('0xf')](_0x448004);var _0x19270c=crypto['createCipher'](_0x45673a[_0x2ecd('0x8')],_0x45ccad);_0x2aaaec['on'](_0x2ecd('0x10'),function(_0xce2c4d){var _0x1e308d=new Buffer(_0x19270c['update'](_0xce2c4d),_0x2ecd('0x11'));_0x4efd94[_0x2ecd('0x12')](_0x1e308d);});_0x2aaaec['on'](_0x2ecd('0x13'),function(){try{var _0x4e9b06=new Buffer(_0x19270c[_0x2ecd('0x14')](_0x2ecd('0x11')),_0x2ecd('0x11'));_0x4efd94[_0x2ecd('0x12')](_0x4e9b06);_0x4efd94['end']();_0x4efd94['on']('close',function(){return _0x439057(_0x448004);});}catch(_0x5da668){fs[_0x2ecd('0x15')](_0x448004);return _0x31114e(_0x5da668);}});});};exports[_0x2ecd('0x16')]=function(_0x157238,_0x407226,_0x2e5e86,_0x5d83aa){return new BPromise(function(_0x55eb2c,_0x3b934a){_0x5d83aa=combineOptions(_0x5d83aa);var _0x14a00a=new Buffer(_0x2e5e86);var _0x541228=fs['createReadStream'](_0x157238);var _0x3a66e4=fs[_0x2ecd('0xf')](_0x407226);var _0x30f335=crypto[_0x2ecd('0x17')](_0x5d83aa[_0x2ecd('0x8')],_0x14a00a);_0x541228['on'](_0x2ecd('0x10'),function(_0x3e52e5){var _0x54fcf4=new Buffer(_0x30f335[_0x2ecd('0x18')](_0x3e52e5),_0x2ecd('0x11'));_0x3a66e4[_0x2ecd('0x12')](_0x54fcf4);});_0x541228['on']('end',function(){try{var _0x48c77f=new Buffer(_0x30f335['final'](_0x2ecd('0x11')),'binary');_0x3a66e4[_0x2ecd('0x12')](_0x48c77f);_0x3a66e4[_0x2ecd('0x13')]();_0x3a66e4['on'](_0x2ecd('0x19'),function(){return _0x55eb2c(_0x407226);});}catch(_0x3b2f8b){fs[_0x2ecd('0x15')](_0x407226);return _0x3b934a(_0x3b2f8b);}});});};exports[_0x2ecd('0x1a')]=function(_0x47e9c3,_0x27e511,_0x5eeb5a){var _0x59acc3=_0x5eeb5a||stringOptions[_0x2ecd('0x8')];var _0x578cb8=_0x27e511||stringOptions[_0x2ecd('0x1b')];var _0x15a7fc=crypto[_0x2ecd('0x1c')](_0x59acc3,_0x578cb8);var _0x2a1701=_0x15a7fc['update'](_0x47e9c3,_0x2ecd('0x1d'),_0x2ecd('0x1e'));_0x2a1701+=_0x15a7fc['final']('base64');return _0x2a1701;};exports[_0x2ecd('0x1f')]=function(_0x10ffd6,_0x24ebaa,_0x5cdb65){var _0x56eb2a=_0x5cdb65||stringOptions[_0x2ecd('0x8')];var _0x4de028=_0x24ebaa||stringOptions[_0x2ecd('0x1b')];var _0x346769=crypto[_0x2ecd('0x17')](_0x56eb2a,_0x4de028);var _0x512b8f=_0x346769[_0x2ecd('0x18')](_0x10ffd6,_0x2ecd('0x1e'),'utf8');_0x512b8f+=_0x346769[_0x2ecd('0x14')](_0x2ecd('0x1d'));return _0x512b8f;}; \ No newline at end of file +var _0x0814=['utf8','base64','decryptString','secret','crypto','bluebird','lodash','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','createDecipher','encryptString'];(function(_0x208e71,_0x5b82aa){var _0x552f6d=function(_0x336526){while(--_0x336526){_0x208e71['push'](_0x208e71['shift']());}};_0x552f6d(++_0x5b82aa);}(_0x0814,0x8c));var _0x4081=function(_0x26cdec,_0x1ad0a1){_0x26cdec=_0x26cdec-0x0;var _0x59f442=_0x0814[_0x26cdec];return _0x59f442;};'use strict';var crypto=require(_0x4081('0x0'));var fs=require('fs');var BPromise=require(_0x4081('0x1'));var _=require(_0x4081('0x2'));var config=require('../../config/environment');var logger=require(_0x4081('0x3'))(_0x4081('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x4081('0x5')][_0x4081('0x6')],'algorithm':_0x4081('0x7')};const fileOptions={'algorithm':'aes192'};if(config[_0x4081('0x8')]&&config[_0x4081('0x8')][_0x4081('0x9')]){var isSupported=isAlgorithmSupported(config[_0x4081('0x8')][_0x4081('0x9')]);if(isSupported){fileOptions['algorithm']=config[_0x4081('0x8')][_0x4081('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x4081('0xa')](',\x20');logger[_0x4081('0xb')](config[_0x4081('0x8')][_0x4081('0x9')],_0x4081('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x5abd5f){return AES_SUPPORTED_RX['test'](_0x5abd5f);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x4081('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x48a96f){return getSupportedCiphers()[_0x4081('0xe')](_0x48a96f)>-0x1;}function combineOptions(_0x25a4d7){var _0x505922={};for(var _0x28d3c7 in fileOptions){if(fileOptions[_0x4081('0xf')](_0x28d3c7)){_0x505922[_0x28d3c7]=fileOptions[_0x28d3c7];}}if(_0x25a4d7){for(var _0x123c3e in _0x25a4d7){if(_0x25a4d7[_0x4081('0xf')](_0x123c3e)){_0x505922[_0x123c3e]=_0x25a4d7[_0x123c3e];}}}return _0x505922;}exports['encryptFile']=function(_0x525314,_0x62c210,_0x3bc9dc,_0xbb71f2){return new BPromise(function(_0x5aa3c1,_0x409a8b){_0xbb71f2=combineOptions(_0xbb71f2);var _0x2c147d=new Buffer(_0x3bc9dc);var _0x2d8684=fs[_0x4081('0x10')](_0x525314);var _0x148e70=fs[_0x4081('0x11')](_0x62c210);var _0x41bd54=crypto[_0x4081('0x12')](_0xbb71f2[_0x4081('0x9')],_0x2c147d);_0x2d8684['on'](_0x4081('0x13'),function(_0x2b83fe){var _0xe053ef=new Buffer(_0x41bd54[_0x4081('0x14')](_0x2b83fe),_0x4081('0x15'));_0x148e70[_0x4081('0x16')](_0xe053ef);});_0x2d8684['on'](_0x4081('0x17'),function(){try{var _0x1607d9=new Buffer(_0x41bd54[_0x4081('0x18')](_0x4081('0x15')),_0x4081('0x15'));_0x148e70['write'](_0x1607d9);_0x148e70[_0x4081('0x17')]();_0x148e70['on'](_0x4081('0x19'),function(){return _0x5aa3c1(_0x62c210);});}catch(_0x522c60){fs[_0x4081('0x1a')](_0x62c210);return _0x409a8b(_0x522c60);}});});};exports[_0x4081('0x1b')]=function(_0x26e297,_0x20460f,_0x2b465c,_0x363fe5){return new BPromise(function(_0x5c9bf8,_0x778aa){_0x363fe5=combineOptions(_0x363fe5);var _0x27a628=new Buffer(_0x2b465c);var _0xcba145=fs[_0x4081('0x10')](_0x26e297);var _0x360fb2=fs[_0x4081('0x11')](_0x20460f);var _0x493d90=crypto[_0x4081('0x1c')](_0x363fe5[_0x4081('0x9')],_0x27a628);_0xcba145['on'](_0x4081('0x13'),function(_0x1a88d2){var _0x56047b=new Buffer(_0x493d90[_0x4081('0x14')](_0x1a88d2),_0x4081('0x15'));_0x360fb2[_0x4081('0x16')](_0x56047b);});_0xcba145['on'](_0x4081('0x17'),function(){try{var _0x442b4e=new Buffer(_0x493d90[_0x4081('0x18')](_0x4081('0x15')),_0x4081('0x15'));_0x360fb2[_0x4081('0x16')](_0x442b4e);_0x360fb2[_0x4081('0x17')]();_0x360fb2['on']('close',function(){return _0x5c9bf8(_0x20460f);});}catch(_0x421907){fs[_0x4081('0x1a')](_0x20460f);return _0x778aa(_0x421907);}});});};exports[_0x4081('0x1d')]=function(_0x5aff61,_0x83bc,_0x51ac62){var _0x478662=_0x51ac62||stringOptions[_0x4081('0x9')];var _0x13a05b=_0x83bc||stringOptions['secret'];var _0x516e60=crypto[_0x4081('0x12')](_0x478662,_0x13a05b);var _0x2dc13e=_0x516e60[_0x4081('0x14')](_0x5aff61,_0x4081('0x1e'),_0x4081('0x1f'));_0x2dc13e+=_0x516e60[_0x4081('0x18')](_0x4081('0x1f'));return _0x2dc13e;};exports[_0x4081('0x20')]=function(_0x5d4e0b,_0x579171,_0x1ad47a){var _0x4a5ac3=_0x1ad47a||stringOptions[_0x4081('0x9')];var _0x511507=_0x579171||stringOptions[_0x4081('0x21')];var _0x4f1f4e=crypto[_0x4081('0x1c')](_0x4a5ac3,_0x511507);var _0x31de27=_0x4f1f4e[_0x4081('0x14')](_0x5d4e0b,_0x4081('0x1f'),_0x4081('0x1e'));_0x31de27+=_0x4f1f4e[_0x4081('0x18')]('utf8');return _0x31de27;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 140f2db..db30afd 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 _0x7001=['zip','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','exit','util','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','range','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','dirname','basename','.csv','join','length','csv','%s.%s','writeFileSync'];(function(_0x62e9fc,_0x1fee2e){var _0x7bd970=function(_0x59a9bd){while(--_0x59a9bd){_0x62e9fc['push'](_0x62e9fc['shift']());}};_0x7bd970(++_0x1fee2e);}(_0x7001,0x1b0));var _0x1700=function(_0x55fea3,_0x17ffa8){_0x55fea3=_0x55fea3-0x0;var _0x219372=_0x7001[_0x55fea3];return _0x219372;};'use strict';var util=require(_0x1700('0x0'));var path=require(_0x1700('0x1'));var _=require(_0x1700('0x2'));var csv=require(_0x1700('0x3'));var fs=require('fs');var BPromise=require(_0x1700('0x4'));var zipdir=require(_0x1700('0x5'));var rimraf=require('rimraf');var db=require(_0x1700('0x6'))['db'];var dbH=require('../../mysqldb')[_0x1700('0x7')];var logger=require(_0x1700('0x8'))(_0x1700('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x1700('0xa')][0x2]);var QUERY=process[_0x1700('0xa')][0x3];var PATH=process[_0x1700('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x57895f,_0x5a4d27){var _0x407f9d={'status':_0x57895f};var _0x24da85={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5a4d27){_0x407f9d[_0x1700('0xb')]=_0x5a4d27;}return db['AnalyticExtractedReport'][_0x1700('0xc')](_0x407f9d,_0x24da85);}function main(){var _0x137ab9=0x1388;var _0x30972f;logger[_0x1700('0xd')](util[_0x1700('0xe')](_0x1700('0xf'),EXTRACTED_REPORT_ID,_0x1700('0x10')));return db[_0x1700('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1700('0x12'),_0x1700('0x13')]})[_0x1700('0x14')](function(_0x57f537){if(_0x57f537){_0x30972f=_0x57f537;_0x137ab9=_0x30972f[_0x1700('0x13')]||0x1388;}})['then'](function(){return dbH[_0x1700('0x15')][_0x1700('0x16')](util[_0x1700('0xe')](_0x1700('0x17'),QUERY),{'type':dbH[_0x1700('0x15')]['QueryTypes'][_0x1700('0x18')]});})[_0x1700('0x14')](function(_0x33a093){if(!_0x33a093[0x0][_0x1700('0x19')]){return analyticExtractedReport('Empty');}var _0x3a4c0f=[];var _0x3487bc=0x0;if(_0x30972f['split']){if(_0x33a093&&_0x33a093['length']){var _0x5aaff5=_[_0x1700('0x1a')](_0x33a093[0x0][_0x1700('0x19')]/_0x137ab9);var _0xb2d275=Number['isInteger'](_0x33a093[0x0][_0x1700('0x19')]/_0x137ab9)?_0x33a093[0x0][_0x1700('0x19')]%_0x137ab9:0x0;_0x5aaff5['forEach'](function(_0x50ed7c){if(_0x50ed7c>0x0){_0x3487bc+=_0x137ab9;}_0x3a4c0f['push'](dbH['sequelize'][_0x1700('0x16')](util[_0x1700('0xe')](_0x1700('0x1b'),QUERY,_0x137ab9,_0x3487bc),{'type':dbH[_0x1700('0x15')][_0x1700('0x1c')]['SELECT']}));});if(_0xb2d275>0x0){_0x3487bc+=_0x137ab9;_0x3a4c0f[_0x1700('0x1d')](dbH['sequelize'][_0x1700('0x16')](util[_0x1700('0xe')](_0x1700('0x1b'),QUERY,_0xb2d275,_0x3487bc),{'type':dbH[_0x1700('0x15')]['QueryTypes'][_0x1700('0x18')]}));}}}else{_0x3a4c0f[_0x1700('0x1d')](dbH[_0x1700('0x15')][_0x1700('0x16')](QUERY,{'type':dbH['sequelize'][_0x1700('0x1c')][_0x1700('0x18')]}));}var _0x55d81c=path[_0x1700('0x1e')](PATH);var _0x1db106=path[_0x1700('0x1f')](PATH,_0x1700('0x20'));var _0x42f48d=_0x30972f[_0x1700('0x12')]&&_0x3a4c0f['length']>0x1;var _0x492b9d=[];if(!fs['existsSync'](path[_0x1700('0x21')](_0x55d81c,_0x1db106))&&_0x42f48d){fs['mkdirSync'](path['join'](_0x55d81c,_0x1db106));}return BPromise['each'](_0x3a4c0f,function(_0x4ab53d){_0x492b9d['push'](_0x4ab53d);})[_0x1700('0x14')](function(){for(var _0x3e740e=0x0;_0x3e740e<_0x492b9d[_0x1700('0x22')];_0x3e740e+=0x1){var _0x275a30;var _0x2cadf1=_0x492b9d[_0x3e740e];if(_0x42f48d){_0x275a30=path[_0x1700('0x21')](_0x55d81c,_0x1db106,util[_0x1700('0xe')]('%s%d.%s',_0x1db106,_0x3e740e,_0x1700('0x23')));}else{_0x275a30=path[_0x1700('0x21')](_0x55d81c,util[_0x1700('0xe')](_0x1700('0x24'),_0x1db106,'csv'));}fs[_0x1700('0x25')](_0x275a30,csv(_0x2cadf1));}})[_0x1700('0x14')](function(){if(_0x42f48d){return new Promise(function(_0x1428c5){zipdir(path[_0x1700('0x21')](_0x55d81c,_0x1db106),{'saveTo':path[_0x1700('0x21')](_0x55d81c,util[_0x1700('0xe')](_0x1700('0x24'),_0x1db106,_0x1700('0x26')))},function(_0x54f6f4,_0x35c930){rimraf(path[_0x1700('0x21')](_0x55d81c,_0x1db106),function(){});_0x1428c5('zip\x20finished');});});}})[_0x1700('0x14')](function(){logger[_0x1700('0xd')](util['format'](_0x1700('0x27'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x1700('0x28'),_0x42f48d?util['format'](_0x1700('0x24'),_0x1db106,_0x42f48d?_0x1700('0x26'):'csv'):null);});})[_0x1700('0x29')](function(_0x5c054d){logger['info'](util['format'](_0x1700('0x2a'),EXTRACTED_REPORT_ID,_0x1700('0x10')),util[_0x1700('0x2b')](_0x5c054d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1700('0x2c'));})[_0x1700('0x2d')](function(){process[_0x1700('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x81de=['%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','dirname','.csv','join','mkdirSync','%s%d.%s','csv','%s.%s','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','Empty','length','range','num','isInteger','forEach','sequelize'];(function(_0x504b54,_0x282c60){var _0x33f872=function(_0x159f39){while(--_0x159f39){_0x504b54['push'](_0x504b54['shift']());}};_0x33f872(++_0x282c60);}(_0x81de,0x15a));var _0xe81d=function(_0x531c06,_0x153598){_0x531c06=_0x531c06-0x0;var _0x59926e=_0x81de[_0x531c06];return _0x59926e;};'use strict';var util=require(_0xe81d('0x0'));var path=require(_0xe81d('0x1'));var _=require(_0xe81d('0x2'));var csv=require(_0xe81d('0x3'));var fs=require('fs');var BPromise=require(_0xe81d('0x4'));var zipdir=require(_0xe81d('0x5'));var rimraf=require(_0xe81d('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0xe81d('0x7'))['dbH'];var logger=require(_0xe81d('0x8'))(_0xe81d('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xe81d('0xa')][0x2]);var QUERY=process[_0xe81d('0xa')][0x3];var PATH=process[_0xe81d('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x773176,_0x341853){var _0x101ca0={'status':_0x773176};var _0x4952a8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x341853){_0x101ca0[_0xe81d('0xb')]=_0x341853;}return db[_0xe81d('0xc')]['update'](_0x101ca0,_0x4952a8);}function main(){var _0x2eae05=0x1388;var _0x29f9a2;logger[_0xe81d('0xd')](util[_0xe81d('0xe')](_0xe81d('0xf'),EXTRACTED_REPORT_ID,_0xe81d('0x10')));return db[_0xe81d('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xe81d('0x12')]})['then'](function(_0x244b51){if(_0x244b51){_0x29f9a2=_0x244b51;_0x2eae05=_0x29f9a2[_0xe81d('0x12')]||0x1388;}})[_0xe81d('0x13')](function(){return dbH['sequelize'][_0xe81d('0x14')](util[_0xe81d('0xe')](_0xe81d('0x15'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xe81d('0x16')]});})['then'](function(_0x31a0bf){if(!_0x31a0bf[0x0]['num']){return analyticExtractedReport(_0xe81d('0x17'));}var _0x310220=[];var _0x517f68=0x0;if(_0x29f9a2['split']){if(_0x31a0bf&&_0x31a0bf[_0xe81d('0x18')]){var _0x4f0b8c=_[_0xe81d('0x19')](_0x31a0bf[0x0][_0xe81d('0x1a')]/_0x2eae05);var _0x39f3ce=Number[_0xe81d('0x1b')](_0x31a0bf[0x0][_0xe81d('0x1a')]/_0x2eae05)?_0x31a0bf[0x0][_0xe81d('0x1a')]%_0x2eae05:0x0;_0x4f0b8c[_0xe81d('0x1c')](function(_0xd1351e){if(_0xd1351e>0x0){_0x517f68+=_0x2eae05;}_0x310220['push'](dbH[_0xe81d('0x1d')][_0xe81d('0x14')](util[_0xe81d('0xe')](_0xe81d('0x1e'),QUERY,_0x2eae05,_0x517f68),{'type':dbH[_0xe81d('0x1d')][_0xe81d('0x1f')][_0xe81d('0x16')]}));});if(_0x39f3ce>0x0){_0x517f68+=_0x2eae05;_0x310220['push'](dbH[_0xe81d('0x1d')][_0xe81d('0x14')](util[_0xe81d('0xe')](_0xe81d('0x1e'),QUERY,_0x39f3ce,_0x517f68),{'type':dbH[_0xe81d('0x1d')][_0xe81d('0x1f')][_0xe81d('0x16')]}));}}}else{_0x310220[_0xe81d('0x20')](dbH[_0xe81d('0x1d')][_0xe81d('0x14')](QUERY,{'type':dbH[_0xe81d('0x1d')][_0xe81d('0x1f')][_0xe81d('0x16')]}));}var _0x2361fc=path[_0xe81d('0x21')](PATH);var _0x42e13f=path['basename'](PATH,_0xe81d('0x22'));var _0x4089f7=_0x29f9a2['split']&&_0x310220[_0xe81d('0x18')]>0x1;var _0x59f1da=[];if(!fs['existsSync'](path[_0xe81d('0x23')](_0x2361fc,_0x42e13f))&&_0x4089f7){fs[_0xe81d('0x24')](path[_0xe81d('0x23')](_0x2361fc,_0x42e13f));}return BPromise['each'](_0x310220,function(_0x222b31){_0x59f1da[_0xe81d('0x20')](_0x222b31);})['then'](function(){for(var _0x7cbf33=0x0;_0x7cbf33<_0x59f1da[_0xe81d('0x18')];_0x7cbf33+=0x1){var _0x47d5e7;var _0x468fee=_0x59f1da[_0x7cbf33];if(_0x4089f7){_0x47d5e7=path['join'](_0x2361fc,_0x42e13f,util[_0xe81d('0xe')](_0xe81d('0x25'),_0x42e13f,_0x7cbf33,_0xe81d('0x26')));}else{_0x47d5e7=path['join'](_0x2361fc,util[_0xe81d('0xe')](_0xe81d('0x27'),_0x42e13f,_0xe81d('0x26')));}fs['writeFileSync'](_0x47d5e7,csv(_0x468fee));}})[_0xe81d('0x13')](function(){if(_0x4089f7){return new Promise(function(_0x38bd9f){zipdir(path[_0xe81d('0x23')](_0x2361fc,_0x42e13f),{'saveTo':path[_0xe81d('0x23')](_0x2361fc,util['format']('%s.%s',_0x42e13f,'zip'))},function(_0x5e3d75,_0x91830){rimraf(path[_0xe81d('0x23')](_0x2361fc,_0x42e13f),function(){});_0x38bd9f(_0xe81d('0x28'));});});}})[_0xe81d('0x13')](function(){logger[_0xe81d('0xd')](util[_0xe81d('0xe')](_0xe81d('0x29'),EXTRACTED_REPORT_ID,_0xe81d('0x10')));return analyticExtractedReport(_0xe81d('0x2a'),_0x4089f7?util[_0xe81d('0xe')]('%s.%s',_0x42e13f,_0x4089f7?_0xe81d('0x2b'):_0xe81d('0x26')):null);});})[_0xe81d('0x2c')](function(_0x11232b){logger[_0xe81d('0xd')](util[_0xe81d('0xe')](_0xe81d('0x2d'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x11232b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0xe81d('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index c95946a..9e2e203 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 _0x1850=['Failed','finally','exit','/fonts/arial-bold.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','end','createPdfFromHTML','catch','lodash','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','pick','toString','value','length','auto','push','body','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','header','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','query','sequelize','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.pdf','existsSync','mkdirSync','join','each','createPdfKitDocument','%s%d.%s','pdf','all','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','%s.%s','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect'];(function(_0x3ab353,_0x5d5283){var _0x1e2285=function(_0x55804f){while(--_0x55804f){_0x3ab353['push'](_0x3ab353['shift']());}};_0x1e2285(++_0x5d5283);}(_0x1850,0xc6));var _0x0185=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1850[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0185('0x0'));var fs=require('fs');var util=require(_0x0185('0x1'));var path=require(_0x0185('0x2'));var moment=require(_0x0185('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x0185('0x4'));var zipdir=require(_0x0185('0x5'));var rimraf=require(_0x0185('0x6'));var JSDOM=require(_0x0185('0x7'))[_0x0185('0x8')];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require(_0x0185('0x9'))['db'];var dbH=require('../../mysqldb')[_0x0185('0xa')];var logger=require('../../config/logger')(_0x0185('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x0185('0xc')][0x2]);var QUERY=process[_0x0185('0xc')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0185('0xc')][0x5];var FORMAT=_0x0185('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x285221,_0x1993d0){var _0x47df32={'status':_0x285221};var _0x59ab3d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1993d0){_0x47df32[_0x0185('0xe')]=_0x1993d0;}return db['AnalyticExtractedReport'][_0x0185('0xf')](_0x47df32,_0x59ab3d);}function getHeaders(_0x369d2c){return _[_0x0185('0x10')](_0x369d2c,function(_0x304d21){return{'text':_0x304d21,'style':_0x0185('0x11')};});}function getRows(_0x2fc1f1,_0x2bdc35){return _['map'](_0x2bdc35,function(_0x2fae5f){return _(_0x2fae5f)[_0x0185('0x12')](_0x2fc1f1)[_0x0185('0x10')](function(_0x1fab57){return _0x1fab57?_[_0x0185('0x13')](_0x1fab57):'';})[_0x0185('0x14')]();});}function createTable(_0x24384c,_0x6555fa){var _0x2bbaef={'widths':_['fill'](Array(_0x24384c[_0x0185('0x15')]),0x91),'heights':function(_0x1597c0){return _0x1597c0===0x0?_0x0185('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x10e4a8=getHeaders(_0x24384c);_0x2bbaef['body'][_0x0185('0x17')](_0x10e4a8);var _0x247d73=getRows(_0x24384c,_0x6555fa);_0x2bbaef[_0x0185('0x18')]=_0x2bbaef[_0x0185('0x18')][_0x0185('0x19')](_0x247d73);return _0x2bbaef;}function createTables(_0x5414c0){var _0x5eb627=[];var _0x2277db=_[_0x0185('0x1a')](Object[_0x0185('0x1b')](_0x5414c0[0x0]),0x5);_0x2277db[_0x0185('0x1c')](function(_0x45fb82){_0x5eb627[_0x0185('0x17')](createTable(_0x45fb82,_0x5414c0));});return _0x5eb627;}function getPDFDocDefinition(_0x4ef4ed){var _0x17b93f=util[_0x0185('0x1d')](_0x0185('0x1e'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0x0185('0x1d')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x0185('0x1d')](FORMAT));var _0x3892da=[];for(var _0x337483=0x0;_0x337483<_0x4ef4ed[_0x0185('0x15')];_0x337483++){var _0x3653a1=[];if(_0x337483===0x0){_0x3653a1[_0x0185('0x17')]({'text':_0x17b93f,'style':_0x0185('0x1f')});}var _0x291d09={'table':_0x4ef4ed[_0x337483]};if(_0x337483>0x0){_0x291d09['pageBreak']=_0x0185('0x20');_0x291d09[_0x0185('0x21')]=[0x0,0x46,0x0,0x0];}_0x3653a1[_0x0185('0x17')](_0x291d09);_0x3892da[_0x0185('0x17')](_0x3653a1);}return{'pageSize':'A4','pageOrientation':_0x0185('0x22'),'content':_0x3892da,'footer':function(_0x3478a6,_0x38c51c){return{'text':_0x3478a6['toString']()+_0x0185('0x23')+_0x38c51c,'style':_0x0185('0x24')};},'defaultStyle':{'font':_0x0185('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0185('0x26')},'footer':{'alignment':_0x0185('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3c9adf){var _0x2be2ed=0x1388;var _0x544a55;if(!_0x3c9adf[0x0][_0x0185('0x28')]){return analyticExtractedReport(_0x0185('0x29'));}return db[_0x0185('0x2a')][_0x0185('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0185('0x2c'),_0x0185('0x2d')]})['then'](function(_0x46797e){if(_0x46797e){_0x544a55=_0x46797e;_0x2be2ed=_0x544a55['splitSizePdf']||0x3e8;}})[_0x0185('0x2e')](function(){var _0x365e4e=[];var _0x337344=0x0;if(_0x544a55[_0x0185('0x2c')]){if(_0x3c9adf&&_0x3c9adf['length']){var _0x55438b=_[_0x0185('0x2f')](_0x3c9adf[0x0][_0x0185('0x28')]/_0x2be2ed);var _0x8ab85f=Number[_0x0185('0x30')](_0x3c9adf[0x0][_0x0185('0x28')]/_0x2be2ed)?_0x3c9adf[0x0][_0x0185('0x28')]%_0x2be2ed:0x0;_0x55438b['forEach'](function(_0x5115ba){if(_0x5115ba>0x0){_0x337344+=_0x2be2ed;}_0x365e4e[_0x0185('0x17')](dbH['sequelize'][_0x0185('0x31')](util[_0x0185('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2be2ed,_0x337344),{'type':dbH[_0x0185('0x32')][_0x0185('0x33')][_0x0185('0x34')]}));});if(_0x8ab85f>0x0){_0x337344+=_0x2be2ed;_0x365e4e['push'](dbH[_0x0185('0x32')][_0x0185('0x31')](util['format'](_0x0185('0x35'),QUERY,_0x8ab85f,_0x337344),{'type':dbH['sequelize'][_0x0185('0x33')][_0x0185('0x34')]}));}}}else{_0x365e4e[_0x0185('0x17')](dbH[_0x0185('0x32')][_0x0185('0x31')](QUERY,{'type':dbH[_0x0185('0x32')][_0x0185('0x33')]['SELECT']}));}var _0x623a56=path[_0x0185('0x36')](PATH);var _0x198237=path[_0x0185('0x37')](PATH,_0x0185('0x38'));var _0x4424c7=_0x544a55[_0x0185('0x2c')]&&_0x365e4e[_0x0185('0x15')]>0x1;var _0x1fe7db=[];if(!fs[_0x0185('0x39')](path['join'](_0x623a56,_0x198237))&&_0x4424c7){fs[_0x0185('0x3a')](path[_0x0185('0x3b')](_0x623a56,_0x198237));}return BPromise[_0x0185('0x3c')](_0x365e4e,function(_0x1fdbfd){_0x1fe7db[_0x0185('0x17')](_0x1fdbfd);})[_0x0185('0x2e')](function(){var _0x3022e4=[];for(var _0x37725a=0x0;_0x37725a<_0x1fe7db[_0x0185('0x15')];_0x37725a+=0x1){var _0xead5cd=_0x1fe7db[_0x37725a];var _0x5ae5e7=createTables(_['flatten'](_0xead5cd));var _0x5b9ff3;var _0xd5a3ef=getPDFDocDefinition(_0x5ae5e7);var _0x42a391=getPDFPrinter();var _0x5c10b8=_0x42a391[_0x0185('0x3d')](_0xd5a3ef);if(_0x4424c7){_0x5b9ff3=path[_0x0185('0x3b')](_0x623a56,_0x198237,util[_0x0185('0x1d')](_0x0185('0x3e'),_0x198237,_0x37725a,_0x0185('0x3f')));}else{_0x5b9ff3=path[_0x0185('0x3b')](_0x623a56,util[_0x0185('0x1d')]('%s.%s',_0x198237,_0x0185('0x3f')));}_0x3022e4['push'](writePDFDocument(_0x5c10b8,_0x5b9ff3));}return Promise[_0x0185('0x40')](_0x3022e4);})[_0x0185('0x2e')](function(){if(_0x4424c7){return new Promise(function(_0x4b34b4){zipdir(path[_0x0185('0x3b')](_0x623a56,_0x198237),{'saveTo':path[_0x0185('0x3b')](_0x623a56,util['format']('%s.%s',_0x198237,'zip'))},function(){rimraf(path[_0x0185('0x3b')](_0x623a56,_0x198237),function(){});_0x4b34b4(_0x0185('0x41'));});});}})['then'](function(){if(!_0x4424c7)return;rimraf(path[_0x0185('0x3b')](_0x623a56,_0x198237),function(){});})[_0x0185('0x2e')](function(){logger[_0x0185('0x42')](util['format'](_0x0185('0x43'),EXTRACTED_REPORT_ID,_0x0185('0x44')));return analyticExtractedReport(_0x0185('0x45'),_0x4424c7?util['format'](_0x0185('0x46'),_0x198237,_0x4424c7?'zip':'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x0185('0x42')](util['format'](_0x0185('0x47'),EXTRACTED_REPORT_ID,_0x0185('0x44')));return db[_0x0185('0x48')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x125a8a){EXTRACTED_REPORT=_0x125a8a;return dbH[_0x0185('0x32')]['query'](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0185('0x32')][_0x0185('0x33')][_0x0185('0x34')]});})[_0x0185('0x2e')](extractReport)['catch'](function(_0x5a8427){logger['info'](util[_0x0185('0x1d')](_0x0185('0x49'),EXTRACTED_REPORT_ID,_0x0185('0x44')),util[_0x0185('0x4a')](_0x5a8427,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0185('0x4b'));})[_0x0185('0x4c')](function(){process[_0x0185('0x4d')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x585080=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x0185('0x4e'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x585080;}function getPDFDocDefinitionFromHTML(_0x36395c,_0x150638){var _0x613904=util['format'](_0x0185('0x4f'),_0x150638[_0x0185('0x50')],_0x150638[_0x0185('0x51')]);var _0x503ea7=moment()[_0x0185('0x1d')](_0x0185('0x52'))[_0x0185('0x13')]();var _0x4ae28c=htmlToPdfmake(_0x36395c,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4ae28c],'defaultStyle':{'font':_0x0185('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x0185('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x0185('0x53'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x0185('0x1f')}];},'footer':function(_0x1e9290,_0x29cd83){return[{'text':util[_0x0185('0x1d')](_0x0185('0x54'),_0x613904,_0x1e9290,_0x29cd83,_0x503ea7),'style':_0x0185('0x24')}];}};}function writePDFDocument(_0x1c0c3f,_0x170f23){return new Promise(function(_0x4a4097,_0x151205){var _0x43c8cf=_0x1c0c3f['pipe'](fs[_0x0185('0x55')](_0x170f23));_0x43c8cf['on'](_0x0185('0x56'),function(){_0x4a4097(_0x0185('0x56'));});_0x43c8cf['on'](_0x0185('0x57'),function(_0x3940c0){_0x151205(_0x3940c0);});_0x1c0c3f[_0x0185('0x58')]();});}exports[_0x0185('0x59')]=function(_0x372361,_0x4d29a5){var _0x4c8436=getPDFPrinter();var _0x1ccd05=getPDFDocDefinitionFromHTML(_0x372361,_0x4d29a5);var _0xcac8f7=_0x4c8436[_0x0185('0x3d')](_0x1ccd05);return writePDFDocument(_0xcac8f7,_0x4d29a5['path'])[_0x0185('0x5a')](function(_0x5dd41a){throw _0x5dd41a;});}; \ No newline at end of file +var _0x9d9a=['pipe','finish','end','path','util','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','auto','body','push','concat','chunk','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','endDate','length','header','pageBreak','margin','\x20/\x20','footer','Arial','right','num','Empty','Setting','find','splitSizePdf','then','split','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.pdf','existsSync','mkdirSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','info','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','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s'];(function(_0x3bce42,_0x5caf64){var _0x2ce0a2=function(_0x1de5e5){while(--_0x1de5e5){_0x3bce42['push'](_0x3bce42['shift']());}};_0x2ce0a2(++_0x5caf64);}(_0x9d9a,0x1da));var _0xa9d9=function(_0x41188f,_0x43488c){_0x41188f=_0x41188f-0x0;var _0x356950=_0x9d9a[_0x41188f];return _0x356950;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xa9d9('0x0'));var path=require('path');var moment=require(_0xa9d9('0x1'));var htmlToPdfmake=require(_0xa9d9('0x2'));var PdfPrinter=require(_0xa9d9('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xa9d9('0x4'));var JSDOM=require(_0xa9d9('0x5'))[_0xa9d9('0x6')];var window=new JSDOM('')[_0xa9d9('0x7')];var BPromise=require(_0xa9d9('0x8'));var db=require(_0xa9d9('0x9'))['db'];var dbH=require('../../mysqldb')[_0xa9d9('0xa')];var logger=require('../../config/logger')(_0xa9d9('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0xa9d9('0xc')][0x2]);var QUERY=process[_0xa9d9('0xc')][0x3];var PATH=process[_0xa9d9('0xc')][0x4];var NAME=process[_0xa9d9('0xc')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xe32664,_0x531587){var _0x3a8e0a={'status':_0xe32664};var _0x1989d8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x531587){_0x3a8e0a[_0xa9d9('0xd')]=_0x531587;}return db[_0xa9d9('0xe')][_0xa9d9('0xf')](_0x3a8e0a,_0x1989d8);}function getHeaders(_0x4739d0){return _[_0xa9d9('0x10')](_0x4739d0,function(_0x5e9a94){return{'text':_0x5e9a94,'style':_0xa9d9('0x11')};});}function getRows(_0x1fd5c1,_0x27f0b5){return _['map'](_0x27f0b5,function(_0x1bfe09){return _(_0x1bfe09)[_0xa9d9('0x12')](_0x1fd5c1)['map'](function(_0x2ca2ad){return _0x2ca2ad?_[_0xa9d9('0x13')](_0x2ca2ad):'';})[_0xa9d9('0x14')]();});}function createTable(_0x2e089e,_0xf490a9){var _0x1d15ee={'widths':_[_0xa9d9('0x15')](Array(_0x2e089e['length']),0x91),'heights':function(_0x46d05d){return _0x46d05d===0x0?_0xa9d9('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4d6fdc=getHeaders(_0x2e089e);_0x1d15ee[_0xa9d9('0x17')][_0xa9d9('0x18')](_0x4d6fdc);var _0x427d67=getRows(_0x2e089e,_0xf490a9);_0x1d15ee['body']=_0x1d15ee[_0xa9d9('0x17')][_0xa9d9('0x19')](_0x427d67);return _0x1d15ee;}function createTables(_0x21b522){var _0x19d3da=[];var _0x96a4c5=_[_0xa9d9('0x1a')](Object[_0xa9d9('0x1b')](_0x21b522[0x0]),0x5);_0x96a4c5[_0xa9d9('0x1c')](function(_0x1ea3f0){_0x19d3da[_0xa9d9('0x18')](createTable(_0x1ea3f0,_0x21b522));});return _0x19d3da;}function getPDFDocDefinition(_0x48cf3b){var _0x1bc3a7=util['format'](_0xa9d9('0x1d'),NAME,EXTRACTED_REPORT[_0xa9d9('0x1e')],moment(EXTRACTED_REPORT[_0xa9d9('0x1f')])[_0xa9d9('0x20')](FORMAT),moment(EXTRACTED_REPORT[_0xa9d9('0x21')])[_0xa9d9('0x20')](FORMAT));var _0x4b9296=[];for(var _0x573f0d=0x0;_0x573f0d<_0x48cf3b[_0xa9d9('0x22')];_0x573f0d++){var _0x1a9c26=[];if(_0x573f0d===0x0){_0x1a9c26[_0xa9d9('0x18')]({'text':_0x1bc3a7,'style':_0xa9d9('0x23')});}var _0x5e3d0d={'table':_0x48cf3b[_0x573f0d]};if(_0x573f0d>0x0){_0x5e3d0d[_0xa9d9('0x24')]='before';_0x5e3d0d[_0xa9d9('0x25')]=[0x0,0x46,0x0,0x0];}_0x1a9c26[_0xa9d9('0x18')](_0x5e3d0d);_0x4b9296['push'](_0x1a9c26);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x4b9296,'footer':function(_0x3bccf4,_0x6e1f10){return{'text':_0x3bccf4[_0xa9d9('0x13')]()+_0xa9d9('0x26')+_0x6e1f10,'style':_0xa9d9('0x27')};},'defaultStyle':{'font':_0xa9d9('0x28')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xa9d9('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x785941){var _0x254c6c=0x1388;var _0x5a40fe;if(!_0x785941[0x0][_0xa9d9('0x2a')]){return analyticExtractedReport(_0xa9d9('0x2b'));}return db[_0xa9d9('0x2c')][_0xa9d9('0x2d')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xa9d9('0x2e')]})['then'](function(_0x573ffd){if(_0x573ffd){_0x5a40fe=_0x573ffd;_0x254c6c=_0x5a40fe[_0xa9d9('0x2e')]||0x3e8;}})[_0xa9d9('0x2f')](function(){var _0x4a40ae=[];var _0x166126=0x0;if(_0x5a40fe[_0xa9d9('0x30')]){if(_0x785941&&_0x785941[_0xa9d9('0x22')]){var _0x2c4156=_[_0xa9d9('0x31')](_0x785941[0x0]['num']/_0x254c6c);var _0x4a9514=Number[_0xa9d9('0x32')](_0x785941[0x0][_0xa9d9('0x2a')]/_0x254c6c)?_0x785941[0x0][_0xa9d9('0x2a')]%_0x254c6c:0x0;_0x2c4156[_0xa9d9('0x1c')](function(_0x5b6aae){if(_0x5b6aae>0x0){_0x166126+=_0x254c6c;}_0x4a40ae['push'](dbH[_0xa9d9('0x33')][_0xa9d9('0x34')](util[_0xa9d9('0x20')](_0xa9d9('0x35'),QUERY,_0x254c6c,_0x166126),{'type':dbH[_0xa9d9('0x33')][_0xa9d9('0x36')][_0xa9d9('0x37')]}));});if(_0x4a9514>0x0){_0x166126+=_0x254c6c;_0x4a40ae[_0xa9d9('0x18')](dbH[_0xa9d9('0x33')][_0xa9d9('0x34')](util['format'](_0xa9d9('0x35'),QUERY,_0x4a9514,_0x166126),{'type':dbH[_0xa9d9('0x33')][_0xa9d9('0x36')][_0xa9d9('0x37')]}));}}}else{_0x4a40ae[_0xa9d9('0x18')](dbH['sequelize'][_0xa9d9('0x34')](QUERY,{'type':dbH[_0xa9d9('0x33')]['QueryTypes'][_0xa9d9('0x37')]}));}var _0x302c53=path['dirname'](PATH);var _0x33473d=path[_0xa9d9('0x38')](PATH,_0xa9d9('0x39'));var _0x43bc13=_0x5a40fe[_0xa9d9('0x30')]&&_0x4a40ae['length']>0x1;var _0xed7cfe=[];if(!fs[_0xa9d9('0x3a')](path['join'](_0x302c53,_0x33473d))&&_0x43bc13){fs[_0xa9d9('0x3b')](path[_0xa9d9('0x3c')](_0x302c53,_0x33473d));}return BPromise[_0xa9d9('0x3d')](_0x4a40ae,function(_0x5a872d){_0xed7cfe['push'](_0x5a872d);})[_0xa9d9('0x2f')](function(){var _0x3bff95=[];for(var _0x31dc69=0x0;_0x31dc69<_0xed7cfe[_0xa9d9('0x22')];_0x31dc69+=0x1){var _0x46e408=_0xed7cfe[_0x31dc69];var _0x1137e5=createTables(_[_0xa9d9('0x3e')](_0x46e408));var _0x3d1b8b;var _0x2b2d05=getPDFDocDefinition(_0x1137e5);var _0x1f2918=getPDFPrinter();var _0xe40762=_0x1f2918[_0xa9d9('0x3f')](_0x2b2d05);if(_0x43bc13){_0x3d1b8b=path[_0xa9d9('0x3c')](_0x302c53,_0x33473d,util['format'](_0xa9d9('0x40'),_0x33473d,_0x31dc69,_0xa9d9('0x41')));}else{_0x3d1b8b=path[_0xa9d9('0x3c')](_0x302c53,util[_0xa9d9('0x20')]('%s.%s',_0x33473d,'pdf'));}_0x3bff95[_0xa9d9('0x18')](writePDFDocument(_0xe40762,_0x3d1b8b));}return Promise[_0xa9d9('0x42')](_0x3bff95);})['then'](function(){if(_0x43bc13){return new Promise(function(_0x85a538){zipdir(path[_0xa9d9('0x3c')](_0x302c53,_0x33473d),{'saveTo':path[_0xa9d9('0x3c')](_0x302c53,util[_0xa9d9('0x20')](_0xa9d9('0x43'),_0x33473d,_0xa9d9('0x44')))},function(){rimraf(path[_0xa9d9('0x3c')](_0x302c53,_0x33473d),function(){});_0x85a538(_0xa9d9('0x45'));});});}})[_0xa9d9('0x2f')](function(){if(!_0x43bc13)return;rimraf(path[_0xa9d9('0x3c')](_0x302c53,_0x33473d),function(){});})[_0xa9d9('0x2f')](function(){logger['info'](util[_0xa9d9('0x20')](_0xa9d9('0x46'),EXTRACTED_REPORT_ID,_0xa9d9('0x47')));return analyticExtractedReport(_0xa9d9('0x48'),_0x43bc13?util[_0xa9d9('0x20')](_0xa9d9('0x43'),_0x33473d,_0x43bc13?'zip':_0xa9d9('0x41')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xa9d9('0x49')](util['format'](_0xa9d9('0x4a'),EXTRACTED_REPORT_ID,_0xa9d9('0x47')));return db[_0xa9d9('0xe')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xa9d9('0x2f')](function(_0x1c71f5){EXTRACTED_REPORT=_0x1c71f5;return dbH[_0xa9d9('0x33')]['query'](util[_0xa9d9('0x20')](_0xa9d9('0x4b'),QUERY),{'type':dbH[_0xa9d9('0x33')][_0xa9d9('0x36')][_0xa9d9('0x37')]});})['then'](extractReport)[_0xa9d9('0x4c')](function(_0x7260c6){logger[_0xa9d9('0x49')](util[_0xa9d9('0x20')](_0xa9d9('0x4d'),EXTRACTED_REPORT_ID,_0xa9d9('0x47')),util[_0xa9d9('0x4e')](_0x7260c6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa9d9('0x4f'));})[_0xa9d9('0x50')](function(){process[_0xa9d9('0x51')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x9c100d=new PdfPrinter({'Arial':{'normal':__dirname+_0xa9d9('0x52'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xa9d9('0x53'),'bolditalics':__dirname+_0xa9d9('0x54')}});return _0x9c100d;}function getPDFDocDefinitionFromHTML(_0x1425b9,_0x404c01){var _0xeb0c33=util[_0xa9d9('0x20')](_0xa9d9('0x55'),_0x404c01['channel'],_0x404c01[_0xa9d9('0x56')]);var _0x4187f7=moment()[_0xa9d9('0x20')]('YYYY-MM-DD')[_0xa9d9('0x13')]();var _0x49bc7c=htmlToPdfmake(_0x1425b9,{'window':window,'tableAutoSize':!![]});return{'content':[_0x49bc7c],'defaultStyle':{'font':_0xa9d9('0x28')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xa9d9('0x57'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xa9d9('0x57')}},'header':function(){return[{'text':_0xa9d9('0x58'),'style':_0xa9d9('0x23')}];},'footer':function(_0x1cd9fa,_0x2efd07){return[{'text':util[_0xa9d9('0x20')](_0xa9d9('0x59'),_0xeb0c33,_0x1cd9fa,_0x2efd07,_0x4187f7),'style':'footer'}];}};}function writePDFDocument(_0x1228ea,_0x2568aa){return new Promise(function(_0x1e18a0,_0xda744e){var _0x5c4f72=_0x1228ea[_0xa9d9('0x5a')](fs['createWriteStream'](_0x2568aa));_0x5c4f72['on']('finish',function(){_0x1e18a0(_0xa9d9('0x5b'));});_0x5c4f72['on']('error',function(_0x209e95){_0xda744e(_0x209e95);});_0x1228ea[_0xa9d9('0x5c')]();});}exports['createPdfFromHTML']=function(_0xf209d0,_0x5bc8f9){var _0x41fd50=getPDFPrinter();var _0x33d236=getPDFDocDefinitionFromHTML(_0xf209d0,_0x5bc8f9);var _0x5e1af0=_0x41fd50[_0xa9d9('0x3f')](_0x33d236);return writePDFDocument(_0x5e1af0,_0x5bc8f9[_0xa9d9('0x5d')])[_0xa9d9('0x4c')](function(_0x2ff840){throw _0x2ff840;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index e05e5bc..9a5bc4e 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 _0x6224=['../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','length','existsSync','join','mkdirSync','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','json2xls','bluebird','rimraf'];(function(_0x91ad21,_0x3e9b82){var _0x1f6cab=function(_0x4e6bd4){while(--_0x4e6bd4){_0x91ad21['push'](_0x91ad21['shift']());}};_0x1f6cab(++_0x3e9b82);}(_0x6224,0xd3));var _0x4622=function(_0x26efac,_0x21ab8a){_0x26efac=_0x26efac-0x0;var _0x8482e4=_0x6224[_0x26efac];return _0x8482e4;};'use strict';var util=require(_0x4622('0x0'));var path=require(_0x4622('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x4622('0x2'));var BPromise=require(_0x4622('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x4622('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4622('0x5'))[_0x4622('0x6')];var logger=require(_0x4622('0x7'))(_0x4622('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x4622('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x202115,_0x5b65d3){var _0x329a17={'status':_0x202115};var _0x1e6e9a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5b65d3){_0x329a17[_0x4622('0xa')]=_0x5b65d3;}return db['AnalyticExtractedReport'][_0x4622('0xb')](_0x329a17,_0x1e6e9a);}function main(){var _0x391106=0x1388;var _0x91e89c;logger[_0x4622('0xc')](util['format'](_0x4622('0xd'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x4622('0xe')][_0x4622('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4622('0x10'),_0x4622('0x11')]})[_0x4622('0x12')](function(_0x2c6144){if(_0x2c6144){_0x91e89c=_0x2c6144;_0x391106=_0x91e89c[_0x4622('0x11')]||0x1388;}})[_0x4622('0x12')](function(){return dbH[_0x4622('0x13')][_0x4622('0x14')](util[_0x4622('0x15')](_0x4622('0x16'),QUERY),{'type':dbH[_0x4622('0x13')][_0x4622('0x17')]['SELECT']});})[_0x4622('0x12')](function(_0x2c29dd){if(!_0x2c29dd[0x0][_0x4622('0x18')]){return analyticExtractedReport(_0x4622('0x19'));}var _0xe8e850=[];var _0x420bae=0x0;if(_0x91e89c[_0x4622('0x10')]){if(_0x2c29dd&&_0x2c29dd['length']){var _0x4cebd2=_[_0x4622('0x1a')](_0x2c29dd[0x0][_0x4622('0x18')]/_0x391106);var _0x3c3f23=Number[_0x4622('0x1b')](_0x2c29dd[0x0]['num']/_0x391106)?_0x2c29dd[0x0][_0x4622('0x18')]%_0x391106:0x0;_0x4cebd2[_0x4622('0x1c')](function(_0x21e690){if(_0x21e690>0x0){_0x420bae+=_0x391106;}_0xe8e850[_0x4622('0x1d')](dbH[_0x4622('0x13')][_0x4622('0x14')](util[_0x4622('0x15')](_0x4622('0x1e'),QUERY,_0x391106,_0x420bae),{'type':dbH['sequelize'][_0x4622('0x17')][_0x4622('0x1f')]}));});if(_0x3c3f23>0x0){_0x420bae+=_0x391106;_0xe8e850[_0x4622('0x1d')](dbH[_0x4622('0x13')][_0x4622('0x14')](util[_0x4622('0x15')](_0x4622('0x1e'),QUERY,_0x3c3f23,_0x420bae),{'type':dbH[_0x4622('0x13')]['QueryTypes']['SELECT']}));}}}else{_0xe8e850[_0x4622('0x1d')](dbH['sequelize'][_0x4622('0x14')](QUERY,{'type':dbH[_0x4622('0x13')]['QueryTypes'][_0x4622('0x1f')]}));}var _0x21447c=path[_0x4622('0x20')](PATH);var _0x548206=path[_0x4622('0x21')](PATH,_0x4622('0x22'));var _0x28979c=_0x91e89c[_0x4622('0x10')]&&_0xe8e850[_0x4622('0x23')]>0x1;var _0x4d0906=[];if(!fs[_0x4622('0x24')](path[_0x4622('0x25')](_0x21447c,_0x548206))&&_0x28979c){fs[_0x4622('0x26')](path['join'](_0x21447c,_0x548206));}return BPromise['each'](_0xe8e850,function(_0x1758aa){_0x4d0906[_0x4622('0x1d')](_0x1758aa);})[_0x4622('0x12')](function(){for(var _0x2e5c42=0x0;_0x2e5c42<_0x4d0906[_0x4622('0x23')];_0x2e5c42+=0x1){var _0x9f6146;var _0xef1400=_0x4d0906[_0x2e5c42];if(_0x28979c){_0x9f6146=path[_0x4622('0x25')](_0x21447c,_0x548206,util['format'](_0x4622('0x27'),_0x548206,_0x2e5c42,_0x4622('0x28')));}else{_0x9f6146=path[_0x4622('0x25')](_0x21447c,util[_0x4622('0x15')]('%s.%s',_0x548206,_0x4622('0x28')));}fs[_0x4622('0x29')](_0x9f6146,json2xls(_0xef1400),_0x4622('0x2a'));}})['then'](function(){if(_0x28979c){return new Promise(function(_0x556dd4){zipdir(path[_0x4622('0x25')](_0x21447c,_0x548206),{'saveTo':path[_0x4622('0x25')](_0x21447c,util[_0x4622('0x15')](_0x4622('0x2b'),_0x548206,_0x4622('0x2c')))},function(_0x38d178,_0x2a6065){rimraf(path[_0x4622('0x25')](_0x21447c,_0x548206),function(){});_0x556dd4(_0x4622('0x2d'));});});}})['then'](function(){logger[_0x4622('0xc')](util[_0x4622('0x15')](_0x4622('0x2e'),EXTRACTED_REPORT_ID,_0x4622('0x2f')));return analyticExtractedReport('Completed',_0x28979c?util[_0x4622('0x15')](_0x4622('0x2b'),_0x548206,_0x28979c?_0x4622('0x2c'):_0x4622('0x28')):null);});})[_0x4622('0x30')](function(_0x43e6ee){logger['info'](util[_0x4622('0x15')](_0x4622('0x31'),EXTRACTED_REPORT_ID,_0x4622('0x2f')),util[_0x4622('0x32')](_0x43e6ee,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4622('0x33'));})[_0x4622('0x34')](function(){process[_0x4622('0x35')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x3407=['.xlsx','existsSync','join','mkdirSync','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','then','splitSizeXlsx','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','length','range','forEach','push','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x3407,0x1c8));var _0x7340=function(_0x4ceabc,_0x1ce086){_0x4ceabc=_0x4ceabc-0x0;var _0x4da071=_0x3407[_0x4ceabc];return _0x4da071;};'use strict';var util=require(_0x7340('0x0'));var path=require(_0x7340('0x1'));var _=require(_0x7340('0x2'));var fs=require('fs');var json2xls=require(_0x7340('0x3'));var BPromise=require(_0x7340('0x4'));var zipdir=require(_0x7340('0x5'));var rimraf=require(_0x7340('0x6'));var db=require(_0x7340('0x7'))['db'];var dbH=require(_0x7340('0x7'))[_0x7340('0x8')];var logger=require(_0x7340('0x9'))(_0x7340('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x7340('0xb')][0x2]);var QUERY=process[_0x7340('0xb')][0x3];var PATH=process[_0x7340('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xd132c7,_0x2bc5d4){var _0x57b87c={'status':_0xd132c7};var _0x3645fc={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2bc5d4){_0x57b87c['savename']=_0x2bc5d4;}return db[_0x7340('0xc')]['update'](_0x57b87c,_0x3645fc);}function main(){var _0x54f089=0x1388;var _0x451d47;logger[_0x7340('0xd')](util[_0x7340('0xe')](_0x7340('0xf'),EXTRACTED_REPORT_ID,_0x7340('0x10')));return db[_0x7340('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7340('0x12'),'splitSizeXlsx']})[_0x7340('0x13')](function(_0x27fda0){if(_0x27fda0){_0x451d47=_0x27fda0;_0x54f089=_0x451d47[_0x7340('0x14')]||0x1388;}})[_0x7340('0x13')](function(){return dbH[_0x7340('0x15')]['query'](util[_0x7340('0xe')](_0x7340('0x16'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})['then'](function(_0x4ec487){if(!_0x4ec487[0x0][_0x7340('0x17')]){return analyticExtractedReport('Empty');}var _0x4ea19c=[];var _0x1a8c5d=0x0;if(_0x451d47[_0x7340('0x12')]){if(_0x4ec487&&_0x4ec487[_0x7340('0x18')]){var _0x5c30f9=_[_0x7340('0x19')](_0x4ec487[0x0][_0x7340('0x17')]/_0x54f089);var _0x4d2577=Number['isInteger'](_0x4ec487[0x0][_0x7340('0x17')]/_0x54f089)?_0x4ec487[0x0][_0x7340('0x17')]%_0x54f089:0x0;_0x5c30f9[_0x7340('0x1a')](function(_0x29f470){if(_0x29f470>0x0){_0x1a8c5d+=_0x54f089;}_0x4ea19c[_0x7340('0x1b')](dbH[_0x7340('0x15')][_0x7340('0x1c')](util[_0x7340('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x54f089,_0x1a8c5d),{'type':dbH[_0x7340('0x15')][_0x7340('0x1d')][_0x7340('0x1e')]}));});if(_0x4d2577>0x0){_0x1a8c5d+=_0x54f089;_0x4ea19c['push'](dbH['sequelize'][_0x7340('0x1c')](util[_0x7340('0xe')](_0x7340('0x1f'),QUERY,_0x4d2577,_0x1a8c5d),{'type':dbH[_0x7340('0x15')][_0x7340('0x1d')][_0x7340('0x1e')]}));}}}else{_0x4ea19c[_0x7340('0x1b')](dbH[_0x7340('0x15')][_0x7340('0x1c')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x7340('0x1e')]}));}var _0x149e76=path[_0x7340('0x20')](PATH);var _0x47234e=path[_0x7340('0x21')](PATH,_0x7340('0x22'));var _0x6c8664=_0x451d47[_0x7340('0x12')]&&_0x4ea19c[_0x7340('0x18')]>0x1;var _0x38e27c=[];if(!fs[_0x7340('0x23')](path[_0x7340('0x24')](_0x149e76,_0x47234e))&&_0x6c8664){fs[_0x7340('0x25')](path[_0x7340('0x24')](_0x149e76,_0x47234e));}return BPromise['each'](_0x4ea19c,function(_0x148313){_0x38e27c[_0x7340('0x1b')](_0x148313);})['then'](function(){for(var _0x287bf9=0x0;_0x287bf9<_0x38e27c[_0x7340('0x18')];_0x287bf9+=0x1){var _0xc94eee;var _0xec27d9=_0x38e27c[_0x287bf9];if(_0x6c8664){_0xc94eee=path[_0x7340('0x24')](_0x149e76,_0x47234e,util['format'](_0x7340('0x26'),_0x47234e,_0x287bf9,_0x7340('0x27')));}else{_0xc94eee=path[_0x7340('0x24')](_0x149e76,util['format'](_0x7340('0x28'),_0x47234e,_0x7340('0x27')));}fs[_0x7340('0x29')](_0xc94eee,json2xls(_0xec27d9),_0x7340('0x2a'));}})[_0x7340('0x13')](function(){if(_0x6c8664){return new Promise(function(_0x420e4c){zipdir(path[_0x7340('0x24')](_0x149e76,_0x47234e),{'saveTo':path[_0x7340('0x24')](_0x149e76,util[_0x7340('0xe')](_0x7340('0x28'),_0x47234e,'zip'))},function(_0x22d29e,_0x5e814e){rimraf(path[_0x7340('0x24')](_0x149e76,_0x47234e),function(){});_0x420e4c('zip\x20finished');});});}})['then'](function(){logger[_0x7340('0xd')](util['format'](_0x7340('0x2b'),EXTRACTED_REPORT_ID,_0x7340('0x10')));return analyticExtractedReport(_0x7340('0x2c'),_0x6c8664?util[_0x7340('0xe')](_0x7340('0x28'),_0x47234e,_0x6c8664?_0x7340('0x2d'):_0x7340('0x27')):null);});})['catch'](function(_0x19a6f9){logger[_0x7340('0xd')](util[_0x7340('0xe')](_0x7340('0x2e'),EXTRACTED_REPORT_ID,_0x7340('0x10')),util['inspect'](_0x19a6f9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x7340('0x2f')](function(){process[_0x7340('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 96e9453..ce028c2 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 _0x7d2e=['wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','XCALLY-MOTION-ANSWER=1','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','catch','error','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','priority','extensions','extension','find','push','type','format','CDR(type)=%s','context','VoiceExtensionId','inbound','Set','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT='];(function(_0x23d8f8,_0x79bff5){var _0x34019c=function(_0x49dc93){while(--_0x49dc93){_0x23d8f8['push'](_0x23d8f8['shift']());}};_0x34019c(++_0x79bff5);}(_0x7d2e,0x184));var _0xe7d2=function(_0x470ce2,_0x4b3815){_0x470ce2=_0x470ce2-0x0;var _0x739076=_0x7d2e[_0x470ce2];return _0x739076;};'use strict';var _=require('lodash');var util=require(_0xe7d2('0x0'));function rewrite(_0x3d8bd6,_0x4a1781){var _0x545b6f=this;return _0x3d8bd6[_0xe7d2('0x1')][_0xe7d2('0x2')][_0xe7d2('0x3')]({'raw':!![]})[_0xe7d2('0x4')](function(_0x29934b){_0x545b6f[_0xe7d2('0x5')]=_0x29934b;return _0x3d8bd6[_0xe7d2('0x1')][_0xe7d2('0x6')]['findAll']({'where':{'IntervalId':_0x4a1781[_0xe7d2('0x7')]},'raw':!![]});})[_0xe7d2('0x4')](function(_0x4da685){return _0x3d8bd6[_0xe7d2('0x1')]['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0xe7d2('0x8')](_[_0xe7d2('0x9')](_0x4da685,_0xe7d2('0xa')))}},'order':[{'raw':_0xe7d2('0xb')}],'raw':!![]});})['then'](function(_0x37fff6){var _0x375efe=_['filter'](_0x37fff6,{'priority':'1'});var _0x31f345=_[_0xe7d2('0xc')](_0x37fff6,{'isApp':0x1});var _0x245afa=_[_0xe7d2('0xd')](_0x31f345,_0xe7d2('0xa'));var _0x3e29a3=[_0xe7d2('0xe'),'playback'];var _0x59a51e=[];var _0x918610=[];for(var _0x2c9705 in _0x245afa){if(_0x245afa['hasOwnProperty'](_0x2c9705)){_0x545b6f[_0xe7d2('0xf')]=0x2;_0x545b6f[_0xe7d2('0x10')]=[];_0x545b6f[_0xe7d2('0x11')]=_[_0xe7d2('0x12')](_0x375efe,{'exten':_0x245afa[_0x2c9705][0x0]['exten']});_0x545b6f[_0xe7d2('0x10')][_0xe7d2('0x13')]({'type':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x14')],'app':'Set','appdata':util[_0xe7d2('0x15')](_0xe7d2('0x16'),_0x245afa[_0x2c9705][0x0][_0xe7d2('0x14')]),'context':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x17')],'exten':_0x245afa[_0x2c9705][0x0][_0xe7d2('0xa')],'priority':_0x545b6f[_0xe7d2('0xf')]++,'VoiceExtensionId':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x18')]});if(_0x245afa[_0x2c9705][0x0][_0xe7d2('0x14')]===_0xe7d2('0x19')){_0x545b6f[_0xe7d2('0x10')][_0xe7d2('0x13')]({'type':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x14')],'app':_0xe7d2('0x1a'),'appdata':_0xe7d2('0x1b')+_0x245afa[_0x2c9705][0x0][_0xe7d2('0x18')],'context':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x17')],'exten':_0x245afa[_0x2c9705][0x0][_0xe7d2('0xa')],'priority':_0x545b6f[_0xe7d2('0xf')]++,'VoiceExtensionId':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x18')]});}else if(_0x245afa[_0x2c9705][0x0]['type']===_0xe7d2('0x1c')){if(_0x545b6f['extension']){_0x545b6f[_0xe7d2('0x10')][_0xe7d2('0x13')]({'type':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x14')],'app':_0xe7d2('0x1a'),'appdata':_0xe7d2('0x1d')+(_0x545b6f[_0xe7d2('0x11')][_0xe7d2('0x1e')]?_0xe7d2('0x1f')+_0x545b6f[_0xe7d2('0x11')][_0xe7d2('0x1e')]+'}':_0xe7d2('0x20')),'context':_0x245afa[_0x2c9705][0x0]['context'],'exten':_0x245afa[_0x2c9705][0x0][_0xe7d2('0xa')],'priority':_0x545b6f['priority']++,'VoiceExtensionId':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x18')]});}_0x545b6f[_0xe7d2('0x10')][_0xe7d2('0x13')]({'type':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x14')],'app':'Set','appdata':_0xe7d2('0x1b')+_0x245afa[_0x2c9705][0x0][_0xe7d2('0x18')],'context':_0x245afa[_0x2c9705][0x0]['context'],'exten':_0x245afa[_0x2c9705][0x0][_0xe7d2('0xa')],'priority':_0x545b6f['priority']++,'VoiceExtensionId':_0x245afa[_0x2c9705][0x0]['VoiceExtensionId']});var _0x1c7ca3=_0x545b6f[_0xe7d2('0xf')]++;_0x545b6f[_0xe7d2('0x10')]['push']({'type':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x14')],'app':_0xe7d2('0x21'),'appdata':_0xe7d2('0x22')+(_0x1c7ca3+0x2)+_0xe7d2('0x23')+(_0x1c7ca3+0x1)+')','context':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x17')],'exten':_0x245afa[_0x2c9705][0x0][_0xe7d2('0xa')],'priority':_0x1c7ca3,'VoiceExtensionId':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x18')]});if(_0x545b6f[_0xe7d2('0x11')]){_0x545b6f[_0xe7d2('0x10')]['push']({'type':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x14')],'app':_0xe7d2('0x1a'),'appdata':_0x545b6f[_0xe7d2('0x11')][_0xe7d2('0x1e')]?_0xe7d2('0x24')+_0x545b6f[_0xe7d2('0x11')][_0xe7d2('0x1e')]+'}':_0xe7d2('0x25'),'context':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x17')],'exten':_0x245afa[_0x2c9705][0x0][_0xe7d2('0xa')],'priority':_0x545b6f[_0xe7d2('0xf')]++,'VoiceExtensionId':_0x245afa[_0x2c9705][0x0]['VoiceExtensionId']});}_0x545b6f['extensions']['push']({'type':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x14')],'app':_0xe7d2('0x1a'),'appdata':_0xe7d2('0x26')+_0x245afa[_0x2c9705][0x0][_0xe7d2('0x18')],'context':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x17')],'exten':_0x245afa[_0x2c9705][0x0][_0xe7d2('0xa')],'priority':_0x545b6f['priority']++,'VoiceExtensionId':_0x245afa[_0x2c9705][0x0]['VoiceExtensionId']});if(_0x545b6f[_0xe7d2('0x11')]&&_0x545b6f['extension'][_0xe7d2('0x27')](_0xe7d2('0x28'))&&_0x545b6f['extension'][_0xe7d2('0x28')]!==_0xe7d2('0x29')){_0x545b6f['extensions'][_0xe7d2('0x13')]({'type':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x14')],'app':_0xe7d2('0x1a'),'appdata':_0xe7d2('0x2a'),'context':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x17')],'exten':_0x245afa[_0x2c9705][0x0]['exten'],'priority':_0x545b6f[_0xe7d2('0xf')]++,'VoiceExtensionId':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x18')]});_0x545b6f[_0xe7d2('0x10')][_0xe7d2('0x13')]({'type':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x14')],'app':_0xe7d2('0x1a'),'appdata':_0xe7d2('0x2b')+_0x545b6f[_0xe7d2('0x11')][_0xe7d2('0x28')]||_0xe7d2('0x2c'),'context':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x17')],'exten':_0x245afa[_0x2c9705][0x0][_0xe7d2('0xa')],'priority':_0x545b6f[_0xe7d2('0xf')]++,'VoiceExtensionId':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x18')]});}}_0x545b6f[_0xe7d2('0x10')][_0xe7d2('0x13')]({'type':_0x245afa[_0x2c9705][0x0]['type'],'app':'Set','appdata':_0xe7d2('0x2d'),'context':_0x245afa[_0x2c9705][0x0]['context'],'exten':_0x245afa[_0x2c9705][0x0][_0xe7d2('0xa')],'priority':_0x545b6f[_0xe7d2('0xf')]++,'VoiceExtensionId':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x18')]});_0x545b6f['extensions'][_0xe7d2('0x13')]({'type':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x14')],'app':_0xe7d2('0x1a'),'appdata':_0xe7d2('0x2e'),'context':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x17')],'exten':_0x245afa[_0x2c9705][0x0][_0xe7d2('0xa')],'priority':_0x545b6f[_0xe7d2('0xf')]++,'VoiceExtensionId':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x18')]});_0x545b6f['extensions'][_0xe7d2('0x13')]({'type':_0x245afa[_0x2c9705][0x0]['type'],'app':_0xe7d2('0x1a'),'appdata':_0xe7d2('0x2f'),'context':_0x245afa[_0x2c9705][0x0]['context'],'exten':_0x245afa[_0x2c9705][0x0][_0xe7d2('0xa')],'priority':_0x545b6f[_0xe7d2('0xf')]++,'VoiceExtensionId':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x18')]});for(var _0x366308=0x0,_0x7e0e8e=0x0;_0x366308<_0x245afa[_0x2c9705][_0xe7d2('0x30')];_0x366308+=0x1,_0x7e0e8e=0x0){var _0x2a416d=_0x245afa[_0x2c9705][_0x366308];if(_0x2a416d[_0xe7d2('0x14')]){_0x2a416d[_0xe7d2('0x14')]=_0x2a416d[_0xe7d2('0x14')][_0xe7d2('0x31')]();}var _0x4bccba=[];var _0xfc1b63=[];delete _0x2a416d['id'];delete _0x2a416d[_0xe7d2('0x32')];delete _0x2a416d[_0xe7d2('0x33')];var _0x46289d=_0x2a416d[_0xe7d2('0x34')]!=='*,*,*,*'?[_0x2a416d[_0xe7d2('0x34')]]:_0x2a416d[_0xe7d2('0x7')]?_[_0xe7d2('0x9')](_['filter'](_0x545b6f[_0xe7d2('0x5')],{'IntervalId':_0x2a416d[_0xe7d2('0x7')]}),_0xe7d2('0x34')):[];if(_0x2a416d[_0xe7d2('0x27')](_0xe7d2('0x35'))){if(_0x2a416d[_0xe7d2('0x35')]&&_0x2a416d['tag']!=='--'){_0x4bccba[_0xe7d2('0x13')]({'type':_0x2a416d['type'],'app':_0xe7d2('0x1a'),'appdata':_0xe7d2('0x36')+_0x2a416d['tag'],'context':_0x2a416d[_0xe7d2('0x17')],'exten':_0x2a416d[_0xe7d2('0xa')],'priority':_0x46289d['length']+_0x545b6f[_0xe7d2('0xf')]+_0x7e0e8e++,'VoiceExtensionId':_0x2a416d[_0xe7d2('0x18')]});}}if(_0x2a416d['type']==='outbound'&&_0x2a416d['hasOwnProperty'](_0xe7d2('0x37'))){if(_0x2a416d[_0xe7d2('0x37')]){_0x4bccba[_0xe7d2('0x13')]({'type':_0x2a416d[_0xe7d2('0x14')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x2a416d[_0xe7d2('0x37')]+')','context':_0x2a416d[_0xe7d2('0x17')],'exten':_0x2a416d[_0xe7d2('0xa')],'priority':_0x46289d[_0xe7d2('0x30')]+_0x545b6f[_0xe7d2('0xf')]+_0x7e0e8e++,'VoiceExtensionId':_0x2a416d['VoiceExtensionId']});}else{_0x4bccba[_0xe7d2('0x13')]({'type':_0x2a416d[_0xe7d2('0x14')],'app':_0xe7d2('0x21'),'appdata':_0xe7d2('0x38'),'context':_0x2a416d[_0xe7d2('0x17')],'exten':_0x2a416d['exten'],'priority':_0x46289d[_0xe7d2('0x30')]+_0x545b6f[_0xe7d2('0xf')]+_0x7e0e8e++,'VoiceExtensionId':_0x2a416d[_0xe7d2('0x18')]});}}if(_0x2a416d[_0xe7d2('0x27')](_0xe7d2('0x39'))){if(_0x3e29a3[_0xe7d2('0x3a')](_0x2a416d['app'][_0xe7d2('0x31')]())>=0x0&&_0x2a416d[_0xe7d2('0x3b')]!==_0xe7d2('0x3c')){if(_0x2a416d['answer']){_0x4bccba[_0xe7d2('0x13')]({'type':_0x2a416d[_0xe7d2('0x14')],'app':_0xe7d2('0x21'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x2a416d['context'],'exten':_0x2a416d[_0xe7d2('0xa')],'priority':_0x46289d[_0xe7d2('0x30')]+_0x545b6f[_0xe7d2('0xf')]+_0x7e0e8e++,'VoiceExtensionId':_0x2a416d[_0xe7d2('0x18')]});_0x4bccba[_0xe7d2('0x13')]({'type':_0x2a416d['type'],'app':'Set','appdata':_0xe7d2('0x3d'),'context':_0x2a416d['context'],'exten':_0x2a416d[_0xe7d2('0xa')],'priority':_0x46289d[_0xe7d2('0x30')]+_0x545b6f[_0xe7d2('0xf')]+_0x7e0e8e++,'VoiceExtensionId':_0x2a416d[_0xe7d2('0x18')]});}else{_0x4bccba[_0xe7d2('0x13')]({'type':_0x2a416d[_0xe7d2('0x14')],'app':_0xe7d2('0x21'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x2a416d[_0xe7d2('0x17')],'exten':_0x2a416d['exten'],'priority':_0x46289d['length']+_0x545b6f[_0xe7d2('0xf')]+_0x7e0e8e++,'VoiceExtensionId':_0x2a416d[_0xe7d2('0x18')]});_0x4bccba[_0xe7d2('0x13')]({'type':_0x2a416d[_0xe7d2('0x14')],'app':_0xe7d2('0x1a'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x2a416d['context'],'exten':_0x2a416d[_0xe7d2('0xa')],'priority':_0x46289d['length']+_0x545b6f['priority']+_0x7e0e8e++,'VoiceExtensionId':_0x2a416d['VoiceExtensionId']});}}}for(var _0x2c281e=0x0;_0x2c281e<_0x46289d[_0xe7d2('0x30')];_0x2c281e+=0x1){var _0x2bb01=_0x545b6f[_0xe7d2('0xf')]+_0x46289d[_0xe7d2('0x30')];var _0x382c00=_0x2c281e===_0x46289d['length']-0x1?_0x545b6f[_0xe7d2('0xf')]+_0x4bccba[_0xe7d2('0x30')]+_0xfc1b63['length']+0x2:_0x545b6f[_0xe7d2('0xf')]+_0x2c281e+0x1;_0x4bccba[_0xe7d2('0x3e')](_0x2c281e,0x0,{'type':_0x2a416d[_0xe7d2('0x14')],'app':'GotoIfTime','appdata':_0x46289d[_0x2c281e]+'?'+_0x2a416d[_0xe7d2('0x17')]+_0xe7d2('0x3f')+_0x2bb01+':'+_0x2a416d['context']+_0xe7d2('0x3f')+_0x382c00,'exten':_0x2a416d[_0xe7d2('0xa')],'context':_0x2a416d[_0xe7d2('0x17')],'priority':_0x545b6f[_0xe7d2('0xf')]+_0x2c281e,'VoiceExtensionId':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x18')]});}_0x2a416d[_0xe7d2('0xf')]=_0x4bccba[_0xe7d2('0x30')]?_[_0xe7d2('0x40')](_0x4bccba)[_0xe7d2('0xf')]+0x1:_0x545b6f[_0xe7d2('0xf')];_0x545b6f[_0xe7d2('0xf')]=(_0xfc1b63[_0xe7d2('0x30')]?_[_0xe7d2('0x40')](_0xfc1b63)[_0xe7d2('0xf')]:_0x2a416d[_0xe7d2('0xf')])+0x1;_0x545b6f['extensions']=_[_0xe7d2('0x41')](_0x545b6f['extensions'],_0x4bccba,[_0x2a416d],_0xfc1b63);}_0x545b6f['extensions'][_0xe7d2('0x13')]({'type':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x14')],'app':_0xe7d2('0x42'),'exten':_0x245afa[_0x2c9705][0x0][_0xe7d2('0xa')],'context':_0x245afa[_0x2c9705][0x0][_0xe7d2('0x17')],'priority':_0x545b6f[_0xe7d2('0xf')],'VoiceExtensionId':_0x245afa[_0x2c9705][0x0]['VoiceExtensionId']});_0x59a51e[_0xe7d2('0x13')](_0x245afa[_0x2c9705][0x0][_0xe7d2('0x18')]);_0x918610=_[_0xe7d2('0x41')](_0x918610,_0x545b6f[_0xe7d2('0x10')]);}}return _0x3d8bd6[_0xe7d2('0x43')](function(_0x12b18c){return _0x3d8bd6['models']['VoiceExtension'][_0xe7d2('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x59a51e}},'transaction':_0x12b18c})['then'](function(_0x33d13a){return _0x3d8bd6['models'][_0xe7d2('0x6')]['bulkCreate'](_[_0xe7d2('0x45')](_0x918610,_0xe7d2('0xf')),{'transaction':_0x12b18c});});});})[_0xe7d2('0x46')](function(_0x3f5314){console[_0xe7d2('0x47')](_0x3f5314);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x09c0=['answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime','last','concat','Hangup','transaction','bulkCreate','sortBy','rewrite','lodash','models','Interval','findAll','intervals','VoiceExtension','IntervalId','then','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extension','find','extensions','push','type','Set','format','CDR(type)=%s','context','inbound','CDR(routeid)=','VoiceExtensionId','CDR(destination)=','cutdigits','${EXTEN:','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','map','tag','CDR(tag)=','callerID','ExecIf','$[${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)','indexOf','app','appType'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0x09c0,0x161));var _0x009c=function(_0x3b2d24,_0x2f2be8){_0x3b2d24=_0x3b2d24-0x0;var _0x137320=_0x09c0[_0x3b2d24];return _0x137320;};'use strict';var _=require(_0x009c('0x0'));var util=require('util');function rewrite(_0x1683cb,_0x53ae8e){var _0xd4b1a2=this;return _0x1683cb[_0x009c('0x1')][_0x009c('0x2')][_0x009c('0x3')]({'raw':!![]})['then'](function(_0x50b96a){_0xd4b1a2[_0x009c('0x4')]=_0x50b96a;return _0x1683cb['models'][_0x009c('0x5')]['findAll']({'where':{'IntervalId':_0x53ae8e[_0x009c('0x6')]},'raw':!![]});})[_0x009c('0x7')](function(_0x2f84aa){return _0x1683cb[_0x009c('0x1')][_0x009c('0x5')][_0x009c('0x3')]({'where':{'exten':{'$in':_['uniq'](_['map'](_0x2f84aa,_0x009c('0x8')))}},'order':[{'raw':_0x009c('0x9')}],'raw':!![]});})[_0x009c('0x7')](function(_0x1d1c18){var _0x6ddce2=_[_0x009c('0xa')](_0x1d1c18,{'priority':'1'});var _0x546ace=_[_0x009c('0xa')](_0x1d1c18,{'isApp':0x1});var _0x250123=_[_0x009c('0xb')](_0x546ace,'exten');var _0x1e549a=[_0x009c('0xc'),_0x009c('0xd')];var _0x9d5296=[];var _0x19e632=[];for(var _0x4e3494 in _0x250123){if(_0x250123['hasOwnProperty'](_0x4e3494)){_0xd4b1a2[_0x009c('0xe')]=0x2;_0xd4b1a2['extensions']=[];_0xd4b1a2[_0x009c('0xf')]=_[_0x009c('0x10')](_0x6ddce2,{'exten':_0x250123[_0x4e3494][0x0][_0x009c('0x8')]});_0xd4b1a2[_0x009c('0x11')][_0x009c('0x12')]({'type':_0x250123[_0x4e3494][0x0][_0x009c('0x13')],'app':_0x009c('0x14'),'appdata':util[_0x009c('0x15')](_0x009c('0x16'),_0x250123[_0x4e3494][0x0][_0x009c('0x13')]),'context':_0x250123[_0x4e3494][0x0][_0x009c('0x17')],'exten':_0x250123[_0x4e3494][0x0]['exten'],'priority':_0xd4b1a2[_0x009c('0xe')]++,'VoiceExtensionId':_0x250123[_0x4e3494][0x0]['VoiceExtensionId']});if(_0x250123[_0x4e3494][0x0][_0x009c('0x13')]===_0x009c('0x18')){_0xd4b1a2['extensions'][_0x009c('0x12')]({'type':_0x250123[_0x4e3494][0x0][_0x009c('0x13')],'app':_0x009c('0x14'),'appdata':_0x009c('0x19')+_0x250123[_0x4e3494][0x0][_0x009c('0x1a')],'context':_0x250123[_0x4e3494][0x0][_0x009c('0x17')],'exten':_0x250123[_0x4e3494][0x0][_0x009c('0x8')],'priority':_0xd4b1a2[_0x009c('0xe')]++,'VoiceExtensionId':_0x250123[_0x4e3494][0x0][_0x009c('0x1a')]});}else if(_0x250123[_0x4e3494][0x0][_0x009c('0x13')]==='outbound'){if(_0xd4b1a2[_0x009c('0xf')]){_0xd4b1a2['extensions'][_0x009c('0x12')]({'type':_0x250123[_0x4e3494][0x0][_0x009c('0x13')],'app':_0x009c('0x14'),'appdata':_0x009c('0x1b')+(_0xd4b1a2[_0x009c('0xf')][_0x009c('0x1c')]?_0x009c('0x1d')+_0xd4b1a2[_0x009c('0xf')]['cutdigits']+'}':'${EXTEN}'),'context':_0x250123[_0x4e3494][0x0][_0x009c('0x17')],'exten':_0x250123[_0x4e3494][0x0][_0x009c('0x8')],'priority':_0xd4b1a2[_0x009c('0xe')]++,'VoiceExtensionId':_0x250123[_0x4e3494][0x0][_0x009c('0x1a')]});}_0xd4b1a2[_0x009c('0x11')][_0x009c('0x12')]({'type':_0x250123[_0x4e3494][0x0][_0x009c('0x13')],'app':_0x009c('0x14'),'appdata':_0x009c('0x19')+_0x250123[_0x4e3494][0x0][_0x009c('0x1a')],'context':_0x250123[_0x4e3494][0x0]['context'],'exten':_0x250123[_0x4e3494][0x0][_0x009c('0x8')],'priority':_0xd4b1a2[_0x009c('0xe')]++,'VoiceExtensionId':_0x250123[_0x4e3494][0x0]['VoiceExtensionId']});var _0x4490e2=_0xd4b1a2['priority']++;_0xd4b1a2[_0x009c('0x11')][_0x009c('0x12')]({'type':_0x250123[_0x4e3494][0x0]['type'],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4490e2+0x2)+'):Goto('+(_0x4490e2+0x1)+')','context':_0x250123[_0x4e3494][0x0][_0x009c('0x17')],'exten':_0x250123[_0x4e3494][0x0][_0x009c('0x8')],'priority':_0x4490e2,'VoiceExtensionId':_0x250123[_0x4e3494][0x0][_0x009c('0x1a')]});if(_0xd4b1a2[_0x009c('0xf')]){_0xd4b1a2[_0x009c('0x11')][_0x009c('0x12')]({'type':_0x250123[_0x4e3494][0x0][_0x009c('0x13')],'app':_0x009c('0x14'),'appdata':_0xd4b1a2['extension'][_0x009c('0x1c')]?_0x009c('0x1e')+_0xd4b1a2['extension'][_0x009c('0x1c')]+'}':_0x009c('0x1f'),'context':_0x250123[_0x4e3494][0x0][_0x009c('0x17')],'exten':_0x250123[_0x4e3494][0x0]['exten'],'priority':_0xd4b1a2[_0x009c('0xe')]++,'VoiceExtensionId':_0x250123[_0x4e3494][0x0]['VoiceExtensionId']});}_0xd4b1a2['extensions'][_0x009c('0x12')]({'type':_0x250123[_0x4e3494][0x0][_0x009c('0x13')],'app':_0x009c('0x14'),'appdata':_0x009c('0x20')+_0x250123[_0x4e3494][0x0][_0x009c('0x1a')],'context':_0x250123[_0x4e3494][0x0][_0x009c('0x17')],'exten':_0x250123[_0x4e3494][0x0][_0x009c('0x8')],'priority':_0xd4b1a2[_0x009c('0xe')]++,'VoiceExtensionId':_0x250123[_0x4e3494][0x0][_0x009c('0x1a')]});if(_0xd4b1a2[_0x009c('0xf')]&&_0xd4b1a2[_0x009c('0xf')][_0x009c('0x21')](_0x009c('0x22'))&&_0xd4b1a2['extension'][_0x009c('0x22')]!==_0x009c('0x23')){_0xd4b1a2[_0x009c('0x11')][_0x009c('0x12')]({'type':_0x250123[_0x4e3494][0x0]['type'],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x250123[_0x4e3494][0x0]['context'],'exten':_0x250123[_0x4e3494][0x0][_0x009c('0x8')],'priority':_0xd4b1a2[_0x009c('0xe')]++,'VoiceExtensionId':_0x250123[_0x4e3494][0x0][_0x009c('0x1a')]});_0xd4b1a2[_0x009c('0x11')][_0x009c('0x12')]({'type':_0x250123[_0x4e3494][0x0][_0x009c('0x13')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xd4b1a2['extension'][_0x009c('0x22')]||_0x009c('0x24'),'context':_0x250123[_0x4e3494][0x0][_0x009c('0x17')],'exten':_0x250123[_0x4e3494][0x0][_0x009c('0x8')],'priority':_0xd4b1a2[_0x009c('0xe')]++,'VoiceExtensionId':_0x250123[_0x4e3494][0x0][_0x009c('0x1a')]});}}_0xd4b1a2[_0x009c('0x11')][_0x009c('0x12')]({'type':_0x250123[_0x4e3494][0x0][_0x009c('0x13')],'app':'Set','appdata':_0x009c('0x25'),'context':_0x250123[_0x4e3494][0x0][_0x009c('0x17')],'exten':_0x250123[_0x4e3494][0x0]['exten'],'priority':_0xd4b1a2[_0x009c('0xe')]++,'VoiceExtensionId':_0x250123[_0x4e3494][0x0][_0x009c('0x1a')]});_0xd4b1a2['extensions'][_0x009c('0x12')]({'type':_0x250123[_0x4e3494][0x0][_0x009c('0x13')],'app':_0x009c('0x14'),'appdata':_0x009c('0x26'),'context':_0x250123[_0x4e3494][0x0][_0x009c('0x17')],'exten':_0x250123[_0x4e3494][0x0][_0x009c('0x8')],'priority':_0xd4b1a2['priority']++,'VoiceExtensionId':_0x250123[_0x4e3494][0x0][_0x009c('0x1a')]});_0xd4b1a2['extensions'][_0x009c('0x12')]({'type':_0x250123[_0x4e3494][0x0][_0x009c('0x13')],'app':'Set','appdata':_0x009c('0x27'),'context':_0x250123[_0x4e3494][0x0]['context'],'exten':_0x250123[_0x4e3494][0x0][_0x009c('0x8')],'priority':_0xd4b1a2[_0x009c('0xe')]++,'VoiceExtensionId':_0x250123[_0x4e3494][0x0]['VoiceExtensionId']});for(var _0x2c97dd=0x0,_0x29b398=0x0;_0x2c97dd<_0x250123[_0x4e3494][_0x009c('0x28')];_0x2c97dd+=0x1,_0x29b398=0x0){var _0x55d37d=_0x250123[_0x4e3494][_0x2c97dd];if(_0x55d37d[_0x009c('0x13')]){_0x55d37d[_0x009c('0x13')]=_0x55d37d[_0x009c('0x13')][_0x009c('0x29')]();}var _0x20e1b4=[];var _0x2cd787=[];delete _0x55d37d['id'];delete _0x55d37d[_0x009c('0x2a')];delete _0x55d37d['updatedAt'];var _0x10c3f4=_0x55d37d[_0x009c('0x2b')]!==_0x009c('0x2c')?[_0x55d37d[_0x009c('0x2b')]]:_0x55d37d['IntervalId']?_[_0x009c('0x2d')](_['filter'](_0xd4b1a2[_0x009c('0x4')],{'IntervalId':_0x55d37d[_0x009c('0x6')]}),_0x009c('0x2b')):[];if(_0x55d37d[_0x009c('0x21')](_0x009c('0x2e'))){if(_0x55d37d['tag']&&_0x55d37d[_0x009c('0x2e')]!=='--'){_0x20e1b4[_0x009c('0x12')]({'type':_0x55d37d[_0x009c('0x13')],'app':_0x009c('0x14'),'appdata':_0x009c('0x2f')+_0x55d37d[_0x009c('0x2e')],'context':_0x55d37d[_0x009c('0x17')],'exten':_0x55d37d['exten'],'priority':_0x10c3f4[_0x009c('0x28')]+_0xd4b1a2['priority']+_0x29b398++,'VoiceExtensionId':_0x55d37d[_0x009c('0x1a')]});}}if(_0x55d37d['type']==='outbound'&&_0x55d37d[_0x009c('0x21')]('callerID')){if(_0x55d37d[_0x009c('0x30')]){_0x20e1b4[_0x009c('0x12')]({'type':_0x55d37d['type'],'app':_0x009c('0x31'),'appdata':_0x009c('0x32')+_0x55d37d['callerID']+')','context':_0x55d37d[_0x009c('0x17')],'exten':_0x55d37d[_0x009c('0x8')],'priority':_0x10c3f4[_0x009c('0x28')]+_0xd4b1a2[_0x009c('0xe')]+_0x29b398++,'VoiceExtensionId':_0x55d37d[_0x009c('0x1a')]});}else{_0x20e1b4[_0x009c('0x12')]({'type':_0x55d37d[_0x009c('0x13')],'app':_0x009c('0x31'),'appdata':_0x009c('0x33'),'context':_0x55d37d['context'],'exten':_0x55d37d[_0x009c('0x8')],'priority':_0x10c3f4['length']+_0xd4b1a2[_0x009c('0xe')]+_0x29b398++,'VoiceExtensionId':_0x55d37d[_0x009c('0x1a')]});}}if(_0x55d37d[_0x009c('0x21')]('answer')){if(_0x1e549a[_0x009c('0x34')](_0x55d37d[_0x009c('0x35')][_0x009c('0x29')]())>=0x0&&_0x55d37d[_0x009c('0x36')]!=='custom'){if(_0x55d37d[_0x009c('0x37')]){_0x20e1b4[_0x009c('0x12')]({'type':_0x55d37d[_0x009c('0x13')],'app':'ExecIf','appdata':_0x009c('0x38'),'context':_0x55d37d[_0x009c('0x17')],'exten':_0x55d37d[_0x009c('0x8')],'priority':_0x10c3f4['length']+_0xd4b1a2[_0x009c('0xe')]+_0x29b398++,'VoiceExtensionId':_0x55d37d[_0x009c('0x1a')]});_0x20e1b4[_0x009c('0x12')]({'type':_0x55d37d['type'],'app':_0x009c('0x14'),'appdata':_0x009c('0x39'),'context':_0x55d37d[_0x009c('0x17')],'exten':_0x55d37d[_0x009c('0x8')],'priority':_0x10c3f4[_0x009c('0x28')]+_0xd4b1a2[_0x009c('0xe')]+_0x29b398++,'VoiceExtensionId':_0x55d37d[_0x009c('0x1a')]});}else{_0x20e1b4['push']({'type':_0x55d37d[_0x009c('0x13')],'app':_0x009c('0x31'),'appdata':_0x009c('0x3a'),'context':_0x55d37d['context'],'exten':_0x55d37d[_0x009c('0x8')],'priority':_0x10c3f4[_0x009c('0x28')]+_0xd4b1a2[_0x009c('0xe')]+_0x29b398++,'VoiceExtensionId':_0x55d37d[_0x009c('0x1a')]});_0x20e1b4[_0x009c('0x12')]({'type':_0x55d37d[_0x009c('0x13')],'app':_0x009c('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x55d37d['context'],'exten':_0x55d37d[_0x009c('0x8')],'priority':_0x10c3f4[_0x009c('0x28')]+_0xd4b1a2[_0x009c('0xe')]+_0x29b398++,'VoiceExtensionId':_0x55d37d[_0x009c('0x1a')]});}}}for(var _0x1fc350=0x0;_0x1fc350<_0x10c3f4['length'];_0x1fc350+=0x1){var _0x9b1474=_0xd4b1a2[_0x009c('0xe')]+_0x10c3f4[_0x009c('0x28')];var _0x1495de=_0x1fc350===_0x10c3f4[_0x009c('0x28')]-0x1?_0xd4b1a2[_0x009c('0xe')]+_0x20e1b4['length']+_0x2cd787[_0x009c('0x28')]+0x2:_0xd4b1a2[_0x009c('0xe')]+_0x1fc350+0x1;_0x20e1b4[_0x009c('0x3b')](_0x1fc350,0x0,{'type':_0x55d37d['type'],'app':_0x009c('0x3c'),'appdata':_0x10c3f4[_0x1fc350]+'?'+_0x55d37d[_0x009c('0x17')]+',${EXTEN},'+_0x9b1474+':'+_0x55d37d['context']+',${EXTEN},'+_0x1495de,'exten':_0x55d37d['exten'],'context':_0x55d37d[_0x009c('0x17')],'priority':_0xd4b1a2[_0x009c('0xe')]+_0x1fc350,'VoiceExtensionId':_0x250123[_0x4e3494][0x0]['VoiceExtensionId']});}_0x55d37d[_0x009c('0xe')]=_0x20e1b4[_0x009c('0x28')]?_[_0x009c('0x3d')](_0x20e1b4)[_0x009c('0xe')]+0x1:_0xd4b1a2['priority'];_0xd4b1a2[_0x009c('0xe')]=(_0x2cd787['length']?_[_0x009c('0x3d')](_0x2cd787)[_0x009c('0xe')]:_0x55d37d[_0x009c('0xe')])+0x1;_0xd4b1a2[_0x009c('0x11')]=_[_0x009c('0x3e')](_0xd4b1a2['extensions'],_0x20e1b4,[_0x55d37d],_0x2cd787);}_0xd4b1a2[_0x009c('0x11')][_0x009c('0x12')]({'type':_0x250123[_0x4e3494][0x0][_0x009c('0x13')],'app':_0x009c('0x3f'),'exten':_0x250123[_0x4e3494][0x0][_0x009c('0x8')],'context':_0x250123[_0x4e3494][0x0]['context'],'priority':_0xd4b1a2[_0x009c('0xe')],'VoiceExtensionId':_0x250123[_0x4e3494][0x0]['VoiceExtensionId']});_0x9d5296['push'](_0x250123[_0x4e3494][0x0][_0x009c('0x1a')]);_0x19e632=_[_0x009c('0x3e')](_0x19e632,_0xd4b1a2['extensions']);}}return _0x1683cb[_0x009c('0x40')](function(_0x416e5f){return _0x1683cb['models'][_0x009c('0x5')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x9d5296}},'transaction':_0x416e5f})[_0x009c('0x7')](function(_0x5e0843){return _0x1683cb[_0x009c('0x1')][_0x009c('0x5')][_0x009c('0x41')](_[_0x009c('0x42')](_0x19e632,_0x009c('0xe')),{'transaction':_0x416e5f});});});})['catch'](function(_0xd9169b){console['error'](_0xd9169b);});}exports[_0x009c('0x43')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 92c8c79..9e8467d 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 _0xbe5c=['pause','CSV\x20parsed\x20correctly!','util','lodash','squel','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','errors','length','map','message','join','hasOwnProperty','data','firstName','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','duplicate','Duplicate\x20Contact','create','then','push','pick','catch','stringify','inspect','insert','cm_hopper','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','into','ListId','cm_contacts','ListId\x20=\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','fromQuery','cm_hopper_black','id\x20IN\x20?','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','onlyIfOpen','VoiceQueueId','all','BlackLists','get','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse'];(function(_0x593752,_0xfc3827){var _0x4612be=function(_0x2d64c6){while(--_0x2d64c6){_0x593752['push'](_0x593752['shift']());}};_0x4612be(++_0xfc3827);}(_0xbe5c,0x13d));var _0xcbe5=function(_0x34dc6f,_0x2aa9a3){_0x34dc6f=_0x34dc6f-0x0;var _0x221b6c=_0xbe5c[_0x34dc6f];return _0x221b6c;};'use strict';var BPromise=require('bluebird');var util=require(_0xcbe5('0x0'));var _=require(_0xcbe5('0x1'));var fs=require('fs');var squel=require(_0xcbe5('0x2'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0xcbe5('0x3'));var logger=require(_0xcbe5('0x4'))(_0xcbe5('0x5'));config[_0xcbe5('0x6')]=_['defaults'](config[_0xcbe5('0x6')],{'host':_0xcbe5('0x7'),'port':0x18eb});var socket=require(_0xcbe5('0x8'))(new Redis(config['redis']));require(_0xcbe5('0x9'))['register'](socket);try{if(!process['argv'][0x2]||process[_0xcbe5('0xa')][0x2]===_0xcbe5('0xb')||process[_0xcbe5('0xa')][0x2]===_0xcbe5('0xc')){throw new Error(_0xcbe5('0xd'));}var FILEPATH=process['argv'][0x2];if(!process[_0xcbe5('0xa')][0x3]||process[_0xcbe5('0xa')][0x3]===_0xcbe5('0xb')||process[_0xcbe5('0xa')][0x3]===_0xcbe5('0xc')||!process[_0xcbe5('0xa')][0x4]||process[_0xcbe5('0xa')][0x4]===_0xcbe5('0xb')||process['argv'][0x4]===_0xcbe5('0xc')){throw new Error(_0xcbe5('0xe'));}var FIELDS=_['zipObject'](process[_0xcbe5('0xa')][0x3]['split'](','),process[_0xcbe5('0xa')][0x4][_0xcbe5('0xf')](','));if(!process[_0xcbe5('0xa')][0x5]||process[_0xcbe5('0xa')][0x5]===_0xcbe5('0xb')||process[_0xcbe5('0xa')][0x5]==='null'){throw new Error(_0xcbe5('0x10'));}var LISTID=process[_0xcbe5('0xa')][0x5];var COMPANYID=process[_0xcbe5('0xa')][0x6]&&process['argv'][0x6]!=='undefined'&&process['argv'][0x6]!=='null'?process[_0xcbe5('0xa')][0x6]:null;var DUPLICATES=process[_0xcbe5('0xa')][0x7]&&process[_0xcbe5('0xa')][0x7]!=='undefined'&&process[_0xcbe5('0xa')][0x7]!==_0xcbe5('0xc')?process[_0xcbe5('0xa')][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]===_0xcbe5('0xb')||process[_0xcbe5('0xa')][0x8]===_0xcbe5('0xc')){throw new Error(_0xcbe5('0x11'));}var SOCKET_TIMESTAMP=process[_0xcbe5('0xa')][0x8];}catch(_0x6b391e){logger[_0xcbe5('0x12')](_0x6b391e);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(_0x16cbd7,_0x213f0f,_0x31ed95,_0x3398f3){var _0x25fb74={'message':_0x213f0f};_0x25fb74[_0x16cbd7]=!![];if(_0x31ed95){_0x25fb74[_0xcbe5('0x13')]=_0x31ed95;}if(_0x3398f3){_0x25fb74['index']=_0x3398f3;}return _0x25fb74;}function isEmail(_0x928570){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))*$/[_0xcbe5('0x14')](_0x928570);}function checkRow(_0x3b2a49,_0x11b669,_0x3471e3){return new BPromise(function(_0x155de1,_0x2be2b8){if(_['isNil'](_0x3b2a49)){return _0x2be2b8(handleCheckRowError(_0xcbe5('0x12'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x3471e3));}if(_0x3b2a49['errors']&&_0x3b2a49[_0xcbe5('0x15')][_0xcbe5('0x16')]){var _0x39b179=_[_0xcbe5('0x17')](_0x3b2a49[_0xcbe5('0x15')],_0xcbe5('0x18'))[_0xcbe5('0x19')](';');return _0x2be2b8(handleCheckRowError(_0xcbe5('0x12'),_0x39b179,null,_0x3471e3));}var _0x205705={};for(var _0x510857 in FIELDS){if(FIELDS[_0xcbe5('0x1a')](_0x510857)&&FIELDS[_0x510857]){_0x205705[_0x510857]=_0x3b2a49['data'][0x0][FIELDS[_0x510857]]||_0x3b2a49[_0xcbe5('0x1b')][0x0]['\ufeff'+FIELDS[_0x510857]];}}if(!_0x205705[_0xcbe5('0x1c')]){return _0x2be2b8(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x3471e3));}if(!_0x205705[_0xcbe5('0x1d')]){return _0x2be2b8(handleCheckRowError('error','phone\x20not\x20specified!',null,_0x3471e3));}if(_0x205705[_0xcbe5('0x1e')]){var _0x4b9ba3=moment(_0x205705[_0xcbe5('0x1e')],_0xcbe5('0x1f'));if(!_0x4b9ba3[_0xcbe5('0x20')]()){return _0x2be2b8(handleCheckRowError('error',_0xcbe5('0x21'),null,_0x3471e3));}}if(_0x205705[_0xcbe5('0x22')]){if(!isEmail(_0x205705[_0xcbe5('0x22')])){return _0x2be2b8(handleCheckRowError(_0xcbe5('0x12'),_0xcbe5('0x23'),null,_0x3471e3));}}_0x205705['ListId']=LISTID;_0x205705[_0xcbe5('0x24')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xcbe5('0x16')]&&_0x11b669){var _0x774e16={};for(var _0x35853d=0x0,_0x1d11d5=DUPLICATES[_0xcbe5('0x16')];_0x35853d<_0x1d11d5;_0x35853d+=0x1){_0x774e16[DUPLICATES[_0x35853d]]=_0x205705[DUPLICATES[_0x35853d]];}var _0x4d2f9e=_['find'](_0x11b669,_0x774e16);if(_0x4d2f9e){return _0x2be2b8(handleCheckRowError(_0xcbe5('0x25'),_0xcbe5('0x26'),_0x4d2f9e,_0x3471e3));}}return db['CmContact'][_0xcbe5('0x27')](_0x205705,{'raw':!![],'hooks':![],'fields':_['keys'](_0x205705)})[_0xcbe5('0x28')](function(_0x483776){if(DUPLICATES&&DUPLICATES['length']&&_0x11b669){_0x11b669[_0xcbe5('0x29')](_[_0xcbe5('0x2a')](_0x205705,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x483776['id'];return _0x155de1();})[_0xcbe5('0x2b')](function(_0x3d7a92){return _0x2be2b8(handleCheckRowError(_0xcbe5('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x3d7a92[_0xcbe5('0x18')]||JSON[_0xcbe5('0x2c')](_0x3d7a92)),null,_0x3471e3));});});}function checkHopper(){function _0x267799(){return function(_0x3a7fe3){logger[_0xcbe5('0x12')]('cmContact','checkHopper',util[_0xcbe5('0x2d')](_0x3a7fe3,{'showHidden':![],'depth':null}));};}var _0x431dc1=function(_0x1d3f9c,_0x49e082){var _0x58f2f1=squel[_0xcbe5('0x2e')]()['into'](_0xcbe5('0x2f'))['fromQuery'](['phone',_0xcbe5('0x30'),_0xcbe5('0x31'),'ListId',_0x49e082,_0xcbe5('0x32'),_0xcbe5('0x33')],squel[_0xcbe5('0x34')]()['field'](_0xcbe5('0x1d'),_0xcbe5('0x1d'))[_0xcbe5('0x35')](_0xcbe5('0x36'),_0xcbe5('0x30'))['field']('id',_0xcbe5('0x31'))[_0xcbe5('0x35')](LISTID['toString'](),'ListId')[_0xcbe5('0x35')](_0x1d3f9c['id'][_0xcbe5('0x37')](),_0x49e082)[_0xcbe5('0x35')](_0xcbe5('0x36'),_0xcbe5('0x32'))[_0xcbe5('0x35')]('NOW()',_0xcbe5('0x33'))[_0xcbe5('0x38')]('cm_contacts')[_0xcbe5('0x39')](_0xcbe5('0x3a'))['where']('ListId\x20=\x20?',LISTID['toString']())['where'](_0xcbe5('0x3b'))[_0xcbe5('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0xcbe5('0x34')]()[_0xcbe5('0x35')](_0xcbe5('0x1d'))['from'](_0xcbe5('0x2f'))[_0xcbe5('0x39')](_0x49e082+_0xcbe5('0x3c'),_0x1d3f9c['id'][_0xcbe5('0x37')]())))[_0xcbe5('0x37')]();return _0x58f2f1;};var _0x2a676d=function(_0x6730d,_0x3fefa9){var _0x564b85=squel['insert']()[_0xcbe5('0x3d')](_0xcbe5('0x2f'))['fromQuery']([_0xcbe5('0x1d'),'scheduledAt',_0xcbe5('0x31'),'ListId',_0x3fefa9,_0xcbe5('0x32'),_0xcbe5('0x33')],squel[_0xcbe5('0x34')]()[_0xcbe5('0x35')]('phone',_0xcbe5('0x1d'))[_0xcbe5('0x35')]('NOW()',_0xcbe5('0x30'))['field']('id',_0xcbe5('0x31'))[_0xcbe5('0x35')](LISTID[_0xcbe5('0x37')](),_0xcbe5('0x3e'))[_0xcbe5('0x35')](_0x6730d['id']['toString'](),_0x3fefa9)[_0xcbe5('0x35')](_0xcbe5('0x36'),'createdAt')[_0xcbe5('0x35')]('NOW()',_0xcbe5('0x33'))['from'](_0xcbe5('0x3f'))['where'](_0xcbe5('0x3a'))['where'](_0xcbe5('0x40'),LISTID['toString']())[_0xcbe5('0x39')]('id\x20IN\x20?',squel[_0xcbe5('0x41')](hopperContacts))[_0xcbe5('0x39')](_0xcbe5('0x3b'))[_0xcbe5('0x39')](_0xcbe5('0x42'),squel[_0xcbe5('0x34')]()[_0xcbe5('0x35')](_0xcbe5('0x43'))['from'](_0xcbe5('0x44'))['where'](_0x3fefa9+_0xcbe5('0x3c'),_0x6730d['id'][_0xcbe5('0x37')]()))[_0xcbe5('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0xcbe5('0x34')]()[_0xcbe5('0x35')](_0xcbe5('0x1d'))[_0xcbe5('0x38')](_0xcbe5('0x2f'))['where'](_0x3fefa9+_0xcbe5('0x3c'),_0x6730d['id']['toString']())))[_0xcbe5('0x37')]();return _0x564b85;};function _0x66d1c0(_0x4826af,_0x2311bc){var _0x58da11=squel[_0xcbe5('0x2e')]()[_0xcbe5('0x3d')]('cm_hopper')[_0xcbe5('0x45')]([_0xcbe5('0x1d'),_0xcbe5('0x30'),_0xcbe5('0x31'),'ListId',_0x2311bc,_0xcbe5('0x32'),_0xcbe5('0x33')],squel[_0xcbe5('0x34')]()[_0xcbe5('0x35')]('phone',_0xcbe5('0x1d'))['field'](_0xcbe5('0x36'),_0xcbe5('0x30'))['field']('id',_0xcbe5('0x31'))[_0xcbe5('0x35')](LISTID[_0xcbe5('0x37')](),_0xcbe5('0x3e'))[_0xcbe5('0x35')](_0x4826af['id'][_0xcbe5('0x37')](),_0x2311bc)[_0xcbe5('0x35')](_0xcbe5('0x36'),'createdAt')[_0xcbe5('0x35')]('NOW()',_0xcbe5('0x33'))[_0xcbe5('0x38')](_0xcbe5('0x3f'))[_0xcbe5('0x39')](_0xcbe5('0x3a'))['where'](_0xcbe5('0x40'),LISTID[_0xcbe5('0x37')]())[_0xcbe5('0x39')]('id\x20IN\x20?',squel[_0xcbe5('0x41')](hopperContacts))[_0xcbe5('0x39')](_0xcbe5('0x3b')))[_0xcbe5('0x37')]();return _0x58da11;}function _0xa623f2(_0x381d44,_0x51cb83){var _0x5721ec=squel[_0xcbe5('0x2e')]()[_0xcbe5('0x3d')](_0xcbe5('0x46'))[_0xcbe5('0x45')]([_0xcbe5('0x1d'),_0xcbe5('0x31'),_0xcbe5('0x3e'),_0x51cb83,'createdAt',_0xcbe5('0x33')],squel[_0xcbe5('0x34')]()['field'](_0xcbe5('0x1d'),'phone')['field']('id',_0xcbe5('0x31'))[_0xcbe5('0x35')](LISTID[_0xcbe5('0x37')](),'ListId')[_0xcbe5('0x35')](_0x381d44['id'][_0xcbe5('0x37')](),_0x51cb83)[_0xcbe5('0x35')](_0xcbe5('0x36'),_0xcbe5('0x32'))[_0xcbe5('0x35')](_0xcbe5('0x36'),_0xcbe5('0x33'))[_0xcbe5('0x38')](_0xcbe5('0x3f'))[_0xcbe5('0x39')](_0xcbe5('0x3a'))[_0xcbe5('0x39')](_0xcbe5('0x40'),LISTID['toString']())[_0xcbe5('0x39')](_0xcbe5('0x47'),squel[_0xcbe5('0x41')](hopperContacts))[_0xcbe5('0x39')](_0xcbe5('0x3b')))[_0xcbe5('0x37')]();return _0x5721ec;}return db[_0xcbe5('0x48')][_0xcbe5('0x49')]({'where':{'type':_0xcbe5('0x4a')},'attributes':['id',_0xcbe5('0x4b')],'include':[{'model':db[_0xcbe5('0x4c')],'as':_0xcbe5('0x4d'),'where':{'id':LISTID}}]})['then'](function(_0x4b5132){var _0x377b04=[];if(_0x4b5132){var _0x1edb1c;for(var _0x4fad23=0x0,_0xa701ab;_0x4fad23<_0x4b5132[_0xcbe5('0x16')];_0x4fad23+=0x1){_0xa701ab=_0x4b5132[_0x4fad23]['get']({'plain':!![]});switch(_0xa701ab['dialCheckDuplicateType']){case _0xcbe5('0x4e'):_0x377b04[_0xcbe5('0x29')](db[_0xcbe5('0x4f')][_0xcbe5('0x50')](_0x2a676d(_0xa701ab,'VoiceQueueId'))[_0xcbe5('0x28')](function(){})[_0xcbe5('0x2b')](_0x267799()));break;case _0xcbe5('0x51'):_0x377b04[_0xcbe5('0x29')](db[_0xcbe5('0x4f')][_0xcbe5('0x50')](_0x431dc1(_0xa701ab,_0xcbe5('0x52')))[_0xcbe5('0x28')](function(){})[_0xcbe5('0x2b')](_0x267799()));break;default:_0x377b04['push'](db['sequelize'][_0xcbe5('0x50')](_0x66d1c0(_0xa701ab,'VoiceQueueId'))['then'](function(){})[_0xcbe5('0x2b')](_0x267799()));}}}return _0x377b04;})[_0xcbe5('0x53')]()[_0xcbe5('0x28')](function(){return db['VoiceQueue'][_0xcbe5('0x49')]({'where':{'type':_0xcbe5('0x4a')},'attributes':['id'],'include':[{'model':db[_0xcbe5('0x4c')],'as':_0xcbe5('0x54'),'where':{'id':LISTID}}]})[_0xcbe5('0x28')](function(_0x302cbc){var _0x26240c=[];if(_0x302cbc){var _0x53bf6e;for(var _0x5db0d6=0x0,_0x5ecd76;_0x5db0d6<_0x302cbc[_0xcbe5('0x16')];_0x5db0d6+=0x1){_0x5ecd76=_0x302cbc[_0x5db0d6][_0xcbe5('0x55')]({'plain':!![]});_0x26240c['push'](db[_0xcbe5('0x4f')][_0xcbe5('0x50')](_0xa623f2(_0x5ecd76,_0xcbe5('0x52')))[_0xcbe5('0x28')](function(){})[_0xcbe5('0x2b')](_0x267799()));}}return _0x26240c;})[_0xcbe5('0x53')]();})[_0xcbe5('0x28')](function(){return db[_0xcbe5('0x56')][_0xcbe5('0x49')]({'attributes':['id',_0xcbe5('0x4b')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xcbe5('0x28')](function(_0x5d0a69){var _0x2f966d=[];if(_0x5d0a69){for(var _0x35e8db=0x0,_0xe006a7;_0x35e8db<_0x5d0a69[_0xcbe5('0x16')];_0x35e8db+=0x1){_0xe006a7=_0x5d0a69[_0x35e8db][_0xcbe5('0x55')]({'plain':!![]});switch(_0xe006a7[_0xcbe5('0x4b')]){case _0xcbe5('0x4e'):_0x2f966d['push'](db[_0xcbe5('0x4f')][_0xcbe5('0x50')](_0x2a676d(_0xe006a7,'CampaignId'))[_0xcbe5('0x28')](function(){})[_0xcbe5('0x2b')](_0x267799()));break;case _0xcbe5('0x51'):_0x2f966d['push'](db[_0xcbe5('0x4f')]['query'](_0x431dc1(_0xe006a7,_0xcbe5('0x57')))[_0xcbe5('0x28')](function(){})[_0xcbe5('0x2b')](_0x267799()));break;default:_0x2f966d[_0xcbe5('0x29')](db['sequelize'][_0xcbe5('0x50')](_0x66d1c0(_0xe006a7,_0xcbe5('0x57')))[_0xcbe5('0x28')](function(){})['catch'](_0x267799()));}}}return _0x2f966d;})[_0xcbe5('0x53')]();})[_0xcbe5('0x28')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xcbe5('0x54'),'where':{'id':LISTID}}]})[_0xcbe5('0x28')](function(_0x53273b){var _0x50c163=[];if(_0x53273b){for(var _0x1deb94=0x0,_0x2f57a1;_0x1deb94<_0x53273b['length'];_0x1deb94+=0x1){_0x2f57a1=_0x53273b[_0x1deb94][_0xcbe5('0x55')]({'plain':!![]});_0x50c163['push'](db[_0xcbe5('0x4f')][_0xcbe5('0x50')](_0xa623f2(_0x2f57a1,_0xcbe5('0x57')))['then'](function(){})[_0xcbe5('0x2b')](_0x267799()));}}return _0x50c163;})[_0xcbe5('0x53')]();})[_0xcbe5('0x2b')](function(_0x361d4d){logger['error'](_0xcbe5('0x58'),_0xcbe5('0x59'),_0x361d4d[_0xcbe5('0x18')]);});}var processPromises=function(_0x45c15c){return BPromise[_0xcbe5('0x53')](promises)['then'](function(_0x501843){})[_0xcbe5('0x2b')](function(_0x6a5d79){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0xcbe5('0x2c')](_0x6a5d79));})['finally'](function(){socket[_0xcbe5('0x5a')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x45c15c){return _0x45c15c[_0xcbe5('0x5b')]();}});};var endCsv=function(){return BPromise[_0xcbe5('0x5c')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xcbe5('0x28')](function(){socket[_0xcbe5('0x5a')](_0xcbe5('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xcbe5('0x5e')](FILEPATH);}catch(_0x18eec2){logger[_0xcbe5('0x12')](_0xcbe5('0x5f'),JSON[_0xcbe5('0x2c')](_0x18eec2));}finally{process[_0xcbe5('0x60')](0x0);}});};process['on'](_0xcbe5('0x61'),function(){logger[_0xcbe5('0x62')](_0xcbe5('0x63'));endCsv();});function main(){return BPromise[_0xcbe5('0x5c')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xcbe5('0xf')](',');return db[_0xcbe5('0x64')][_0xcbe5('0x49')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xcbe5('0x28')](function(_0x18d86e){var _0x4ccf49=fs[_0xcbe5('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xcbe5('0x66')](_0x4ccf49,{'header':!![],'skipEmptyLines':!![],'step':function(_0x41c65b,_0x1c812c){total+=0x1;var _0x28d368=total;promises['push'](checkRow(_0x41c65b,_0x18d86e,_0x28d368)[_0xcbe5('0x28')](function(){success+=0x1;})[_0xcbe5('0x2b')](function(_0x15cac0){if(_0x15cac0[_0xcbe5('0x12')]){errors+=0x1;delete _0x15cac0[_0xcbe5('0x12')];}else if(_0x15cac0[_0xcbe5('0x25')]){duplicates+=0x1;delete _0x15cac0[_0xcbe5('0x25')];}rows[_0xcbe5('0x29')](_0x15cac0);}));if(total%0xc8===0x0){_0x1c812c[_0xcbe5('0x67')]();return processPromises(_0x1c812c);}},'complete':function(){return processPromises()['then'](function(){logger[_0xcbe5('0x62')](_0xcbe5('0x68'));endCsv();});},'error':function(_0x470d89,_0x3e0eb1){logger[_0xcbe5('0x62')]('CSV\x20parse\x20error',JSON[_0xcbe5('0x2c')](_0x470d89));endCsv();}});})[_0xcbe5('0x2b')](function(_0x21b167){logger[_0xcbe5('0x12')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xcbe5('0x2c')](_0x21b167));});}main(); \ No newline at end of file +var _0xdbd2=['firstName','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','Duplicate\x20Contact','CmContact','keys','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','insert','into','fromQuery','scheduledAt','createdAt','updatedAt','select','field','NOW()','ContactId','toString','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_contacts','id\x20IN\x20?','calleridnum','\x20=\x20?','cm_hopper','str','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','then','get','always','push','query','VoiceQueueId','catch','sequelize','all','VoiceQueue','BlackLists','Campaign','Lists','CampaignId','onlyIfOpen','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','emit','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','papaparse','ioredis','../../../config/environment','api','defaults','redis','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','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xdbd2,0x12e));var _0x2dbd=function(_0x514eb1,_0x243cae){_0x514eb1=_0x514eb1-0x0;var _0x49977c=_0xdbd2[_0x514eb1];return _0x49977c;};'use strict';var BPromise=require('bluebird');var util=require(_0x2dbd('0x0'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0x2dbd('0x1'));var Redis=require(_0x2dbd('0x2'));var db=require('../../../mysqldb')['db'];var config=require(_0x2dbd('0x3'));var logger=require('../../../config/logger')(_0x2dbd('0x4'));config['redis']=_[_0x2dbd('0x5')](config[_0x2dbd('0x6')],{'host':_0x2dbd('0x7'),'port':0x18eb});var socket=require(_0x2dbd('0x8'))(new Redis(config[_0x2dbd('0x6')]));require(_0x2dbd('0x9'))[_0x2dbd('0xa')](socket);try{if(!process[_0x2dbd('0xb')][0x2]||process[_0x2dbd('0xb')][0x2]===_0x2dbd('0xc')||process[_0x2dbd('0xb')][0x2]===_0x2dbd('0xd')){throw new Error(_0x2dbd('0xe'));}var FILEPATH=process[_0x2dbd('0xb')][0x2];if(!process['argv'][0x3]||process[_0x2dbd('0xb')][0x3]===_0x2dbd('0xc')||process[_0x2dbd('0xb')][0x3]===_0x2dbd('0xd')||!process[_0x2dbd('0xb')][0x4]||process[_0x2dbd('0xb')][0x4]===_0x2dbd('0xc')||process[_0x2dbd('0xb')][0x4]==='null'){throw new Error(_0x2dbd('0xf'));}var FIELDS=_[_0x2dbd('0x10')](process[_0x2dbd('0xb')][0x3][_0x2dbd('0x11')](','),process[_0x2dbd('0xb')][0x4]['split'](','));if(!process[_0x2dbd('0xb')][0x5]||process[_0x2dbd('0xb')][0x5]===_0x2dbd('0xc')||process[_0x2dbd('0xb')][0x5]===_0x2dbd('0xd')){throw new Error(_0x2dbd('0x12'));}var LISTID=process[_0x2dbd('0xb')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x2dbd('0xb')][0x6]!==_0x2dbd('0xc')&&process[_0x2dbd('0xb')][0x6]!==_0x2dbd('0xd')?process[_0x2dbd('0xb')][0x6]:null;var DUPLICATES=process[_0x2dbd('0xb')][0x7]&&process[_0x2dbd('0xb')][0x7]!=='undefined'&&process['argv'][0x7]!==_0x2dbd('0xd')?process[_0x2dbd('0xb')][0x7]:null;if(!process[_0x2dbd('0xb')][0x8]||process[_0x2dbd('0xb')][0x8]===_0x2dbd('0xc')||process[_0x2dbd('0xb')][0x8]===_0x2dbd('0xd')){throw new Error(_0x2dbd('0x13'));}var SOCKET_TIMESTAMP=process[_0x2dbd('0xb')][0x8];}catch(_0x2516c1){logger[_0x2dbd('0x14')](_0x2516c1);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(_0x5a7fa7,_0xb00ef5,_0x1d0b7f,_0x22652f){var _0x3a0121={'message':_0xb00ef5};_0x3a0121[_0x5a7fa7]=!![];if(_0x1d0b7f){_0x3a0121['contact']=_0x1d0b7f;}if(_0x22652f){_0x3a0121[_0x2dbd('0x15')]=_0x22652f;}return _0x3a0121;}function isEmail(_0x311c0c){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))*$/[_0x2dbd('0x16')](_0x311c0c);}function checkRow(_0x1a460d,_0x240da2,_0x4f28bd){return new BPromise(function(_0x12de2c,_0x110c2e){if(_[_0x2dbd('0x17')](_0x1a460d)){return _0x110c2e(handleCheckRowError(_0x2dbd('0x14'),_0x2dbd('0x18'),null,_0x4f28bd));}if(_0x1a460d[_0x2dbd('0x19')]&&_0x1a460d[_0x2dbd('0x19')][_0x2dbd('0x1a')]){var _0x333131=_[_0x2dbd('0x1b')](_0x1a460d[_0x2dbd('0x19')],'message')[_0x2dbd('0x1c')](';');return _0x110c2e(handleCheckRowError('error',_0x333131,null,_0x4f28bd));}var _0x10fc5e={};for(var _0x290e26 in FIELDS){if(FIELDS[_0x2dbd('0x1d')](_0x290e26)&&FIELDS[_0x290e26]){_0x10fc5e[_0x290e26]=_0x1a460d[_0x2dbd('0x1e')][0x0][FIELDS[_0x290e26]]||_0x1a460d[_0x2dbd('0x1e')][0x0]['\ufeff'+FIELDS[_0x290e26]];}}if(!_0x10fc5e[_0x2dbd('0x1f')]){return _0x110c2e(handleCheckRowError(_0x2dbd('0x14'),'firstName\x20not\x20specified!',null,_0x4f28bd));}if(!_0x10fc5e[_0x2dbd('0x20')]){return _0x110c2e(handleCheckRowError(_0x2dbd('0x14'),_0x2dbd('0x21'),null,_0x4f28bd));}if(_0x10fc5e['birthDate']){var _0x1c17ac=moment(_0x10fc5e[_0x2dbd('0x22')],_0x2dbd('0x23'));if(!_0x1c17ac[_0x2dbd('0x24')]()){return _0x110c2e(handleCheckRowError(_0x2dbd('0x14'),_0x2dbd('0x25'),null,_0x4f28bd));}}if(_0x10fc5e[_0x2dbd('0x26')]){if(!isEmail(_0x10fc5e[_0x2dbd('0x26')])){return _0x110c2e(handleCheckRowError(_0x2dbd('0x14'),_0x2dbd('0x27'),null,_0x4f28bd));}}_0x10fc5e[_0x2dbd('0x28')]=LISTID;_0x10fc5e[_0x2dbd('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x2dbd('0x1a')]&&_0x240da2){var _0x3f493f={};for(var _0x36dc2d=0x0,_0x20dbf2=DUPLICATES[_0x2dbd('0x1a')];_0x36dc2d<_0x20dbf2;_0x36dc2d+=0x1){_0x3f493f[DUPLICATES[_0x36dc2d]]=_0x10fc5e[DUPLICATES[_0x36dc2d]];}var _0x472fd4=_['find'](_0x240da2,_0x3f493f);if(_0x472fd4){return _0x110c2e(handleCheckRowError(_0x2dbd('0x2a'),_0x2dbd('0x2b'),_0x472fd4,_0x4f28bd));}}return db[_0x2dbd('0x2c')]['create'](_0x10fc5e,{'raw':!![],'hooks':![],'fields':_[_0x2dbd('0x2d')](_0x10fc5e)})['then'](function(_0x172fa3){if(DUPLICATES&&DUPLICATES[_0x2dbd('0x1a')]&&_0x240da2){_0x240da2['push'](_[_0x2dbd('0x2e')](_0x10fc5e,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x172fa3['id'];return _0x12de2c();})['catch'](function(_0x456162){return _0x110c2e(handleCheckRowError('error',_0x2dbd('0x2f')+(_0x456162[_0x2dbd('0x30')]||JSON[_0x2dbd('0x31')](_0x456162)),null,_0x4f28bd));});});}function checkHopper(){function _0x13aa31(){return function(_0xe6e8ca){logger[_0x2dbd('0x14')](_0x2dbd('0x32'),_0x2dbd('0x33'),util[_0x2dbd('0x34')](_0xe6e8ca,{'showHidden':![],'depth':null}));};}var _0x12c203=function(_0x4715da,_0x3c001c){var _0x298b4d=squel[_0x2dbd('0x35')]()[_0x2dbd('0x36')]('cm_hopper')[_0x2dbd('0x37')]([_0x2dbd('0x20'),_0x2dbd('0x38'),'ContactId',_0x2dbd('0x28'),_0x3c001c,_0x2dbd('0x39'),_0x2dbd('0x3a')],squel[_0x2dbd('0x3b')]()[_0x2dbd('0x3c')](_0x2dbd('0x20'),'phone')[_0x2dbd('0x3c')](_0x2dbd('0x3d'),_0x2dbd('0x38'))['field']('id',_0x2dbd('0x3e'))[_0x2dbd('0x3c')](LISTID['toString'](),_0x2dbd('0x28'))[_0x2dbd('0x3c')](_0x4715da['id'][_0x2dbd('0x3f')](),_0x3c001c)[_0x2dbd('0x3c')](_0x2dbd('0x3d'),_0x2dbd('0x39'))[_0x2dbd('0x3c')](_0x2dbd('0x3d'),_0x2dbd('0x3a'))['from']('cm_contacts')[_0x2dbd('0x40')](_0x2dbd('0x41'))[_0x2dbd('0x40')](_0x2dbd('0x42'),LISTID['toString']())['where'](_0x2dbd('0x43'))['where'](_0x2dbd('0x44'),squel[_0x2dbd('0x3b')]()[_0x2dbd('0x3c')](_0x2dbd('0x20'))['from']('cm_hopper')[_0x2dbd('0x40')](_0x3c001c+'\x20=\x20?',_0x4715da['id']['toString']())))[_0x2dbd('0x3f')]();return _0x298b4d;};var _0x5c2b96=function(_0x65db7a,_0x3ab920){var _0x2e3880=squel['insert']()['into']('cm_hopper')[_0x2dbd('0x37')]([_0x2dbd('0x20'),_0x2dbd('0x38'),'ContactId',_0x2dbd('0x28'),_0x3ab920,_0x2dbd('0x39'),_0x2dbd('0x3a')],squel[_0x2dbd('0x3b')]()[_0x2dbd('0x3c')](_0x2dbd('0x20'),'phone')[_0x2dbd('0x3c')](_0x2dbd('0x3d'),_0x2dbd('0x38'))[_0x2dbd('0x3c')]('id','ContactId')[_0x2dbd('0x3c')](LISTID[_0x2dbd('0x3f')](),_0x2dbd('0x28'))[_0x2dbd('0x3c')](_0x65db7a['id']['toString'](),_0x3ab920)[_0x2dbd('0x3c')](_0x2dbd('0x3d'),'createdAt')[_0x2dbd('0x3c')](_0x2dbd('0x3d'),_0x2dbd('0x3a'))[_0x2dbd('0x45')](_0x2dbd('0x46'))['where'](_0x2dbd('0x41'))[_0x2dbd('0x40')](_0x2dbd('0x42'),LISTID[_0x2dbd('0x3f')]())[_0x2dbd('0x40')](_0x2dbd('0x47'),squel['str'](hopperContacts))[_0x2dbd('0x40')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x2dbd('0x44'),squel[_0x2dbd('0x3b')]()['field'](_0x2dbd('0x48'))['from']('cm_hopper_final')[_0x2dbd('0x40')](_0x3ab920+_0x2dbd('0x49'),_0x65db7a['id'][_0x2dbd('0x3f')]()))[_0x2dbd('0x40')](_0x2dbd('0x44'),squel[_0x2dbd('0x3b')]()[_0x2dbd('0x3c')](_0x2dbd('0x20'))[_0x2dbd('0x45')]('cm_hopper')[_0x2dbd('0x40')](_0x3ab920+_0x2dbd('0x49'),_0x65db7a['id']['toString']())))[_0x2dbd('0x3f')]();return _0x2e3880;};function _0x47f20e(_0x5397e4,_0x4875bb){var _0x15b25b=squel[_0x2dbd('0x35')]()[_0x2dbd('0x36')](_0x2dbd('0x4a'))[_0x2dbd('0x37')]([_0x2dbd('0x20'),_0x2dbd('0x38'),_0x2dbd('0x3e'),'ListId',_0x4875bb,_0x2dbd('0x39'),_0x2dbd('0x3a')],squel[_0x2dbd('0x3b')]()[_0x2dbd('0x3c')](_0x2dbd('0x20'),'phone')[_0x2dbd('0x3c')](_0x2dbd('0x3d'),_0x2dbd('0x38'))[_0x2dbd('0x3c')]('id',_0x2dbd('0x3e'))[_0x2dbd('0x3c')](LISTID['toString'](),_0x2dbd('0x28'))[_0x2dbd('0x3c')](_0x5397e4['id'][_0x2dbd('0x3f')](),_0x4875bb)['field'](_0x2dbd('0x3d'),_0x2dbd('0x39'))[_0x2dbd('0x3c')]('NOW()','updatedAt')[_0x2dbd('0x45')](_0x2dbd('0x46'))[_0x2dbd('0x40')](_0x2dbd('0x41'))[_0x2dbd('0x40')](_0x2dbd('0x42'),LISTID[_0x2dbd('0x3f')]())['where'](_0x2dbd('0x47'),squel[_0x2dbd('0x4b')](hopperContacts))['where'](_0x2dbd('0x43')))[_0x2dbd('0x3f')]();return _0x15b25b;}function _0x4f855b(_0x898423,_0x22ba2e){var _0x362db8=squel[_0x2dbd('0x35')]()['into'](_0x2dbd('0x4c'))[_0x2dbd('0x37')](['phone','ContactId',_0x2dbd('0x28'),_0x22ba2e,'createdAt',_0x2dbd('0x3a')],squel['select']()[_0x2dbd('0x3c')](_0x2dbd('0x20'),'phone')['field']('id',_0x2dbd('0x3e'))[_0x2dbd('0x3c')](LISTID['toString'](),'ListId')[_0x2dbd('0x3c')](_0x898423['id'][_0x2dbd('0x3f')](),_0x22ba2e)[_0x2dbd('0x3c')](_0x2dbd('0x3d'),_0x2dbd('0x39'))[_0x2dbd('0x3c')](_0x2dbd('0x3d'),_0x2dbd('0x3a'))['from'](_0x2dbd('0x46'))['where'](_0x2dbd('0x41'))[_0x2dbd('0x40')](_0x2dbd('0x42'),LISTID[_0x2dbd('0x3f')]())['where'](_0x2dbd('0x47'),squel['str'](hopperContacts))[_0x2dbd('0x40')](_0x2dbd('0x43')))['toString']();return _0x362db8;}return db['VoiceQueue'][_0x2dbd('0x4d')]({'where':{'type':_0x2dbd('0x4e')},'attributes':['id',_0x2dbd('0x4f')],'include':[{'model':db[_0x2dbd('0x50')],'as':'Lists','where':{'id':LISTID}}]})[_0x2dbd('0x51')](function(_0x309ac1){var _0x1a813b=[];if(_0x309ac1){var _0x118ce9;for(var _0x7f9910=0x0,_0x271506;_0x7f9910<_0x309ac1[_0x2dbd('0x1a')];_0x7f9910+=0x1){_0x271506=_0x309ac1[_0x7f9910][_0x2dbd('0x52')]({'plain':!![]});switch(_0x271506[_0x2dbd('0x4f')]){case _0x2dbd('0x53'):_0x1a813b[_0x2dbd('0x54')](db['sequelize'][_0x2dbd('0x55')](_0x5c2b96(_0x271506,_0x2dbd('0x56')))['then'](function(){})[_0x2dbd('0x57')](_0x13aa31()));break;case'onlyIfOpen':_0x1a813b[_0x2dbd('0x54')](db[_0x2dbd('0x58')][_0x2dbd('0x55')](_0x12c203(_0x271506,_0x2dbd('0x56')))['then'](function(){})['catch'](_0x13aa31()));break;default:_0x1a813b[_0x2dbd('0x54')](db['sequelize'][_0x2dbd('0x55')](_0x47f20e(_0x271506,_0x2dbd('0x56')))[_0x2dbd('0x51')](function(){})[_0x2dbd('0x57')](_0x13aa31()));}}}return _0x1a813b;})[_0x2dbd('0x59')]()[_0x2dbd('0x51')](function(){return db[_0x2dbd('0x5a')][_0x2dbd('0x4d')]({'where':{'type':_0x2dbd('0x4e')},'attributes':['id'],'include':[{'model':db[_0x2dbd('0x50')],'as':_0x2dbd('0x5b'),'where':{'id':LISTID}}]})[_0x2dbd('0x51')](function(_0x30d6f9){var _0x24e46b=[];if(_0x30d6f9){var _0x5e2ad0;for(var _0x2f63ef=0x0,_0x2b61c7;_0x2f63ef<_0x30d6f9['length'];_0x2f63ef+=0x1){_0x2b61c7=_0x30d6f9[_0x2f63ef][_0x2dbd('0x52')]({'plain':!![]});_0x24e46b[_0x2dbd('0x54')](db[_0x2dbd('0x58')]['query'](_0x4f855b(_0x2b61c7,_0x2dbd('0x56')))[_0x2dbd('0x51')](function(){})['catch'](_0x13aa31()));}}return _0x24e46b;})[_0x2dbd('0x59')]();})[_0x2dbd('0x51')](function(){return db[_0x2dbd('0x5c')]['findAll']({'attributes':['id',_0x2dbd('0x4f')],'include':[{'model':db[_0x2dbd('0x50')],'as':_0x2dbd('0x5d'),'where':{'id':LISTID}}]})['then'](function(_0x3930df){var _0x4705b9=[];if(_0x3930df){for(var _0x5a1f38=0x0,_0x507dc9;_0x5a1f38<_0x3930df['length'];_0x5a1f38+=0x1){_0x507dc9=_0x3930df[_0x5a1f38][_0x2dbd('0x52')]({'plain':!![]});switch(_0x507dc9['dialCheckDuplicateType']){case'always':_0x4705b9[_0x2dbd('0x54')](db['sequelize']['query'](_0x5c2b96(_0x507dc9,_0x2dbd('0x5e')))[_0x2dbd('0x51')](function(){})['catch'](_0x13aa31()));break;case _0x2dbd('0x5f'):_0x4705b9[_0x2dbd('0x54')](db[_0x2dbd('0x58')][_0x2dbd('0x55')](_0x12c203(_0x507dc9,'CampaignId'))['then'](function(){})[_0x2dbd('0x57')](_0x13aa31()));break;default:_0x4705b9[_0x2dbd('0x54')](db[_0x2dbd('0x58')][_0x2dbd('0x55')](_0x47f20e(_0x507dc9,'CampaignId'))[_0x2dbd('0x51')](function(){})['catch'](_0x13aa31()));}}}return _0x4705b9;})[_0x2dbd('0x59')]();})[_0x2dbd('0x51')](function(){return db['Campaign'][_0x2dbd('0x4d')]({'attributes':['id'],'include':[{'model':db[_0x2dbd('0x50')],'as':_0x2dbd('0x5b'),'where':{'id':LISTID}}]})[_0x2dbd('0x51')](function(_0x878a77){var _0x5f10cc=[];if(_0x878a77){for(var _0x41e086=0x0,_0xcdb599;_0x41e086<_0x878a77[_0x2dbd('0x1a')];_0x41e086+=0x1){_0xcdb599=_0x878a77[_0x41e086][_0x2dbd('0x52')]({'plain':!![]});_0x5f10cc['push'](db['sequelize'][_0x2dbd('0x55')](_0x4f855b(_0xcdb599,_0x2dbd('0x5e')))[_0x2dbd('0x51')](function(){})[_0x2dbd('0x57')](_0x13aa31()));}}return _0x5f10cc;})[_0x2dbd('0x59')]();})[_0x2dbd('0x57')](function(_0x2d4702){logger[_0x2dbd('0x14')]('cmContact,\x20%s,\x20%s',_0x2dbd('0x60'),_0x2d4702[_0x2dbd('0x30')]);});}var processPromises=function(_0x512304){return BPromise['all'](promises)['then'](function(_0x3112b6){})[_0x2dbd('0x57')](function(_0x274467){logger['error'](_0x2dbd('0x61'),JSON[_0x2dbd('0x31')](_0x274467));})[_0x2dbd('0x62')](function(){socket['emit'](_0x2dbd('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x512304){return _0x512304[_0x2dbd('0x64')]();}});};var endCsv=function(){return BPromise[_0x2dbd('0x65')]()[_0x2dbd('0x51')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x2dbd('0x66')](_0x2dbd('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x296cbe){logger[_0x2dbd('0x14')](_0x2dbd('0x67'),JSON['stringify'](_0x296cbe));}finally{process[_0x2dbd('0x68')](0x0);}});};process['on']('SIGINT',function(){logger[_0x2dbd('0x69')](_0x2dbd('0x6a'));endCsv();});function main(){return BPromise[_0x2dbd('0x65')]()[_0x2dbd('0x51')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x2dbd('0x11')](',');return db['CmContact'][_0x2dbd('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1e6089){var _0x4e7101=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x4e7101,{'header':!![],'skipEmptyLines':!![],'step':function(_0x234ae5,_0xd9cc84){total+=0x1;var _0x4456b3=total;promises[_0x2dbd('0x54')](checkRow(_0x234ae5,_0x1e6089,_0x4456b3)['then'](function(){success+=0x1;})['catch'](function(_0x4f24e5){if(_0x4f24e5[_0x2dbd('0x14')]){errors+=0x1;delete _0x4f24e5['error'];}else if(_0x4f24e5[_0x2dbd('0x2a')]){duplicates+=0x1;delete _0x4f24e5[_0x2dbd('0x2a')];}rows[_0x2dbd('0x54')](_0x4f24e5);}));if(total%0xc8===0x0){_0xd9cc84[_0x2dbd('0x6b')]();return processPromises(_0xd9cc84);}},'complete':function(){return processPromises()[_0x2dbd('0x51')](function(){logger[_0x2dbd('0x69')](_0x2dbd('0x6c'));endCsv();});},'error':function(_0x2e24cc,_0x3b3dc8){logger[_0x2dbd('0x69')](_0x2dbd('0x6d'),JSON[_0x2dbd('0x31')](_0x2e24cc));endCsv();}});})[_0x2dbd('0x57')](function(_0x1495bf){logger[_0x2dbd('0x14')](_0x2dbd('0x6e'),JSON[_0x2dbd('0x31')](_0x1495bf));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index cb14455..02fc350 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 _0x8a9a=[')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','error','message','exit','code','info','sequelize','query','spread','push','catch','stringify','send','binding','root','server/files/tmp','.csv','keys','header','writeFileSync','data','length','rows','errors','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','Abort\x20parser','abort','SystemError','duplicates','\x20LIKE\x20cm_contacts;','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','contact:import:','unlink','complete','argv','existsSync','parse','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_hopper_black','cm_contacts','\x20=\x20?','concat','CompanyId'];(function(_0x1e63b9,_0x2349a7){var _0x2cced3=function(_0x46c5dd){while(--_0x46c5dd){_0x1e63b9['push'](_0x1e63b9['shift']());}};_0x2cced3(++_0x2349a7);}(_0x8a9a,0x1d3));var _0xa8a9=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8a9a[_0x160c73];return _0xd9302;};'use strict';var fs=require('fs');var path=require(_0xa8a9('0x0'));var _=require(_0xa8a9('0x1'));var Papa=require(_0xa8a9('0x2'));var util=require(_0xa8a9('0x3'));var BPromise=require(_0xa8a9('0x4'));var moment=require(_0xa8a9('0x5'));var squel=require(_0xa8a9('0x6'));var Redis=require(_0xa8a9('0x7'));var db=require(_0xa8a9('0x8'))['db'];var config=require(_0xa8a9('0x9'));var logger=require(_0xa8a9('0xa'))(_0xa8a9('0xb'));config[_0xa8a9('0xc')]=_[_0xa8a9('0xd')](config[_0xa8a9('0xc')],{'host':_0xa8a9('0xe'),'port':0x18eb});var socket=require(_0xa8a9('0xf'))(new Redis(config[_0xa8a9('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xa8a9('0x10')](_0xa8a9('0x11'));function isEmail(_0x19ae07){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))*$/[_0xa8a9('0x12')](_0x19ae07);}function selectNotIn(_0x27c9aa,_0x23a180,_0x6014c4,_0x28cde4,_0x5c28b9){return squel[_0xa8a9('0x13')]()[_0xa8a9('0x14')]('phone')[_0xa8a9('0x15')](_0x28cde4)['join'](_0x23a180,null,_0x23a180+_0xa8a9('0x16')+_0x28cde4+'.'+_0x6014c4)[_0xa8a9('0x17')](_0x28cde4+'.'+_0x6014c4+_0xa8a9('0x18')+_0x27c9aa+'.'+_0x6014c4)[_0xa8a9('0x17')](_0x23a180+_0xa8a9('0x19')+_0x5c28b9[_0xa8a9('0x1a')]()+')');}function insertCmHopper(_0x2470a0,_0x5cade6,_0x389dcb,_0x52e588,_0x2b42dd){var _0x244182=[_0xa8a9('0x1b'),'cm_contacts.scheduledat',_0xa8a9('0x1c'),'cm_contacts.ListId',_0x5cade6+'.'+_0x52e588,_0xa8a9('0x1d'),_0xa8a9('0x1e'),_0xa8a9('0x1f'),_0xa8a9('0x20'),'\x22'+_0x2b42dd+'\x22'];return squel[_0xa8a9('0x21')]()[_0xa8a9('0x22')](_0xa8a9('0x23'))[_0xa8a9('0x24')]([_0xa8a9('0x25'),_0xa8a9('0x26'),_0xa8a9('0x27'),_0xa8a9('0x28'),_0x52e588,_0xa8a9('0x29'),_0xa8a9('0x2a'),_0xa8a9('0x2b'),_0xa8a9('0x2c'),'recallme'],squel[_0xa8a9('0x13')]()[_0xa8a9('0x2d')](_0x244182)[_0xa8a9('0x15')](_0x5cade6)[_0xa8a9('0x1a')]('cm_contacts',null,_0xa8a9('0x2e')+_0x5cade6+'.CmListId')['join'](_0x389dcb,null,_0x389dcb+_0xa8a9('0x16')+_0x5cade6+'.'+_0x52e588)[_0xa8a9('0x17')](_0x5cade6+_0xa8a9('0x2f'),_0x2470a0)[_0xa8a9('0x17')](_0xa8a9('0x30'),NOW)[_0xa8a9('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5cade6,_0x389dcb,_0x52e588,_0xa8a9('0x23'),['\x22always\x22',_0xa8a9('0x31')]))[_0xa8a9('0x17')](_0xa8a9('0x32'),selectNotIn(_0x5cade6,_0x389dcb,_0x52e588,_0xa8a9('0x23'),[_0xa8a9('0x33')])))['toString']();}function insertCmHopperBlack(_0x195950,_0x27917e,_0x58cf0c,_0x5bcd12){var _0x587b63=['cm_contacts.phone',_0xa8a9('0x1c'),'cm_contacts.ListId',_0x27917e+'.'+_0x5bcd12,_0xa8a9('0x1d'),_0xa8a9('0x1e')];return squel['insert']()[_0xa8a9('0x22')](_0xa8a9('0x34'))['fromQuery']([_0xa8a9('0x25'),_0xa8a9('0x27'),_0xa8a9('0x28'),_0x5bcd12,_0xa8a9('0x29'),_0xa8a9('0x2a')],squel[_0xa8a9('0x13')]()[_0xa8a9('0x2d')](_0x587b63)[_0xa8a9('0x15')](_0x27917e)[_0xa8a9('0x1a')](_0xa8a9('0x35'),null,_0xa8a9('0x2e')+_0x27917e+'.CmListId')[_0xa8a9('0x1a')](_0x58cf0c,null,_0x58cf0c+_0xa8a9('0x16')+_0x27917e+'.'+_0x5bcd12)[_0xa8a9('0x17')](_0x27917e+_0xa8a9('0x2f'),_0x195950)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xa8a9('0x17')](_0xa8a9('0x32'),squel[_0xa8a9('0x13')]()['field'](_0xa8a9('0x25'))[_0xa8a9('0x15')](_0xa8a9('0x34'))[_0xa8a9('0x17')]('ListId\x20=\x20?',_0x195950)['where'](_0x5bcd12+_0xa8a9('0x36'),_0x27917e+'.'+_0x5bcd12)))['toString']();}function insertCmContact(_0x48bd0a,_0x5d9c30,_0x3a24ed,_0x55653b){var _0x96e2ea=_[_0xa8a9('0x37')](_['keys'](_0x55653b),[_0xa8a9('0x28'),_0xa8a9('0x38'),_0xa8a9('0x29'),'updatedAt']);return squel[_0xa8a9('0x21')]()[_0xa8a9('0x22')]('cm_contacts')['fromQuery'](_0x96e2ea,squel['select']()[_0xa8a9('0x2d')](_0x96e2ea)['from'](_0x5d9c30)[_0xa8a9('0x17')]('('+_0x3a24ed[_0xa8a9('0x1a')](',')+_0xa8a9('0x39'),squel[_0xa8a9('0x13')]()[_0xa8a9('0x2d')](_0x3a24ed)[_0xa8a9('0x15')](_0xa8a9('0x35'))[_0xa8a9('0x17')]('ListId\x20=\x20?',_0x48bd0a)['where']('deletedAt\x20IS\x20NULL'))[_0xa8a9('0x17')](_0xa8a9('0x3a'),squel[_0xa8a9('0x13')]()[_0xa8a9('0x14')](_0xa8a9('0x3b'),_0xa8a9('0x3c'))[_0xa8a9('0x15')](_0x5d9c30)[_0xa8a9('0x3d')](_0x3a24ed[_0xa8a9('0x1a')](','))))['toString']();}function handleStop(){logger['info'](_0xa8a9('0x3e'));stopped=!![];}function handleUncaughtException(_0x6bcbbb){logger[_0xa8a9('0x3f')](_0x6bcbbb[_0xa8a9('0x40')]);process[_0xa8a9('0x41')](0x1);}function handleError(_0x58a2f3,_0x1afa8f){stats['errors']['push']({'name':_0x1afa8f[_0xa8a9('0x42')],'message':_0x1afa8f[_0xa8a9('0x40')],'row':_0x58a2f3});}function handleQuery(_0xb091ef){logger[_0xa8a9('0x43')](_0xb091ef);return db[_0xa8a9('0x44')][_0xa8a9('0x45')](_0xb091ef)[_0xa8a9('0x46')](function(_0x349001){results[_0xa8a9('0x47')](_0x349001);})[_0xa8a9('0x48')](function(_0x25428f){logger[_0xa8a9('0x3f')](_0x25428f[_0xa8a9('0x40')]);});}function main(_0x3b698c,_0x33f3ea,_0x1256d4,_0x59d781){logger[_0xa8a9('0x43')]('main',_0x3b698c,JSON[_0xa8a9('0x49')](_0x33f3ea));process[_0xa8a9('0x4a')]('start');var _0x8aaf3=_0x33f3ea[_0xa8a9('0x4b')];var _0x5578bf=_0x33f3ea['socket_timestamp'];var _0x35f404=path['join'](config[_0xa8a9('0x4c')],_0xa8a9('0x4d'),_0x5578bf+_0xa8a9('0x4e'));var _0x163f2d=_[_0xa8a9('0x4f')](_0x8aaf3)[_0xa8a9('0x1a')]();logger['info'](_0xa8a9('0x50'),_0x163f2d);fs[_0xa8a9('0x51')](_0x35f404,_0x163f2d+'\x0a');Papa['parse'](fs['createReadStream'](_0x3b698c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x8b6e71,_0x8aeec){try{for(var _0x5e695a=0x0,_0x24c058=[];_0x5e695a<_0x8b6e71[_0xa8a9('0x52')][_0xa8a9('0x53')];_0x5e695a++){stats[_0xa8a9('0x54')]+=0x1;if(_0x8b6e71['errors'][_0x5e695a]){handleError(_0x8b6e71['data'][_0x5e695a],_0x8b6e71[_0xa8a9('0x55')][_0x5e695a]);}else{var _0x5ef977=[];for(var _0x13345b in _0x8aaf3){if(_0x8aaf3['hasOwnProperty'](_0x13345b)){if(_0x8b6e71[_0xa8a9('0x52')][_0x5e695a][_0x8aaf3[_0x13345b]]){var _0x2b487b=_[_0xa8a9('0x56')](_0x8b6e71[_0xa8a9('0x52')][_0x5e695a][_0x8aaf3[_0x13345b]][_0xa8a9('0x57')](/"/g,'\x27'));switch(_0x13345b){case'scheduledat':var _0x6a96ac=moment(_0x2b487b,_0xa8a9('0x11'),!![]);if(_0x6a96ac[_0xa8a9('0x58')]()){_0x24c058['push']('\x22'+_0x2b487b+'\x22');}else{_0x5ef977[_0xa8a9('0x47')](_0xa8a9('0x59'));}break;case _0xa8a9('0x2b'):var _0x5a386a=parseInt(_0x2b487b);_0x2b487b=_['isNaN'](_0x5a386a)||_0x5a386a<0x0||_0x5a386a>0x4?_0x59d781?0x3:0x2:_0x5a386a;_0x24c058[_0xa8a9('0x47')]('\x22'+_0x2b487b+'\x22');break;case'UserId':var _0xd39f8f=parseInt(_0x2b487b);if(_[_0xa8a9('0x5a')](_0xd39f8f)&&_[_0xa8a9('0x5b')](_0x1256d4,_0xd39f8f)){_0x24c058['push']('\x22'+_0xd39f8f+'\x22');}else{_0x5ef977[_0xa8a9('0x47')](_0xa8a9('0x5c'));}break;case _0xa8a9('0x5d'):if(isEmail(_0x2b487b)){_0x24c058[_0xa8a9('0x47')]('\x22'+_0x2b487b+'\x22');}else{_0x5ef977[_0xa8a9('0x47')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x40ec70=moment(_0x2b487b,_0xa8a9('0x5e'),!![]);if(_0x40ec70[_0xa8a9('0x58')]()){_0x24c058['push']('\x22'+_0x2b487b+'\x22');}else{_0x5ef977[_0xa8a9('0x47')](_0xa8a9('0x5f'));}break;default:_0x24c058[_0xa8a9('0x47')]('\x22'+_0x2b487b+'\x22');}}else{switch(_0x13345b){case _0xa8a9('0x60'):case _0xa8a9('0x25'):_0x5ef977['push'](_0x13345b+_0xa8a9('0x61'));break;default:_0x24c058[_0xa8a9('0x47')]('\x22\x22');}}}}if(_0x5ef977[_0xa8a9('0x53')]){handleError(_0x8b6e71[_0xa8a9('0x52')][_0x5e695a],{'code':_0xa8a9('0x62'),'message':_0x5ef977[_0xa8a9('0x1a')]()});}else{fs[_0xa8a9('0x63')](_0x35f404,_0x24c058['join']()+'\x0a');}_0x24c058=[];}if(!(stats['rows']%0xc8)){socket['emit']('contact:import:'+_0x5578bf,stats);stats[_0xa8a9('0x55')]=[];}}if(stopped){logger[_0xa8a9('0x43')](_0xa8a9('0x64'));_0x8aeec[_0xa8a9('0x65')]();}}catch(_0x8b6134){handleError(_0x8b6e71['data'][_0x5e695a],{'code':_0xa8a9('0x66'),'message':_0x8b6134[_0xa8a9('0x40')]});logger[_0xa8a9('0x3f')]('step',_0x8b6134[_0xa8a9('0x40')]);}},'complete':function(){try{var _0x3145a8=[];var _0x46eb82=_0xa8a9('0x35');if(_0x33f3ea[_0xa8a9('0x67')]&&_0x33f3ea[_0xa8a9('0x67')][_0xa8a9('0x53')]){_0x46eb82='cm_contacts_'+_0x5578bf;_0x3145a8[_0xa8a9('0x47')]('CREATE\x20TABLE\x20'+_0x46eb82+_0xa8a9('0x68'));}var _0x35caab=util[_0xa8a9('0x10')]('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',_0x35f404,_0x46eb82,_0x163f2d,_0x33f3ea[_0xa8a9('0x28')],_0x33f3ea[_0xa8a9('0x38')]||null,NOW,NOW);if(_[_0xa8a9('0x69')](_0x8aaf3[_0xa8a9('0x26')])){_0x35caab+=_0xa8a9('0x6a');}_0x3145a8['push'](_0x35caab);if(_0x33f3ea[_0xa8a9('0x67')]&&_0x33f3ea[_0xa8a9('0x67')]['length']){_0x3145a8[_0xa8a9('0x47')](insertCmContact(_0x33f3ea['ListId'],_0x46eb82,_0x33f3ea[_0xa8a9('0x67')],_0x8aaf3));_0x3145a8[_0xa8a9('0x47')](_0xa8a9('0x6b')+_0x46eb82+';');}_0x3145a8[_0xa8a9('0x47')](insertCmHopper(_0x33f3ea['ListId'],'voice_queues_has_cm_lists',_0xa8a9('0x6c'),_0xa8a9('0x6d'),_0x59d781));_0x3145a8[_0xa8a9('0x47')](insertCmHopperBlack(_0x33f3ea[_0xa8a9('0x28')],_0xa8a9('0x6e'),'voice_queues',_0xa8a9('0x6d')));_0x3145a8[_0xa8a9('0x47')](insertCmHopper(_0x33f3ea[_0xa8a9('0x28')],'campaigns_has_cm_lists',_0xa8a9('0x6f'),_0xa8a9('0x70'),_0x59d781));_0x3145a8['push'](insertCmHopperBlack(_0x33f3ea[_0xa8a9('0x28')],_0xa8a9('0x71'),_0xa8a9('0x6f'),_0xa8a9('0x70')));BPromise[_0xa8a9('0x72')](_0x3145a8,handleQuery)[_0xa8a9('0x73')](function(_0x114b96){stats[_0xa8a9('0x74')]=!![];stats['affectedRows']=_0x33f3ea[_0xa8a9('0x67')]&&_0x33f3ea['duplicates'][_0xa8a9('0x53')]?results[0x2][_0xa8a9('0x75')]:results[0x0][_0xa8a9('0x75')];socket['emit'](_0xa8a9('0x76')+_0x5578bf,stats);fs[_0xa8a9('0x77')](_0x3b698c);fs[_0xa8a9('0x77')](_0x35f404);process[_0xa8a9('0x41')](0x0);})[_0xa8a9('0x48')](function(_0x2456d6){logger[_0xa8a9('0x3f')](_0x2456d6[_0xa8a9('0x40')]);process[_0xa8a9('0x41')](0x1);});}catch(_0xd8ecf7){logger[_0xa8a9('0x3f')](_0xa8a9('0x78'),_0xd8ecf7[_0xa8a9('0x40')]);process[_0xa8a9('0x41')](0x1);}},'error':function(_0x3b1b7e,_0x3d1f28,_0x91d685,_0x2eb190){throw new Error(_0x2eb190);}});}function validate(){if(process[_0xa8a9('0x79')]&&process[_0xa8a9('0x79')][_0xa8a9('0x53')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x149361=path[_0xa8a9('0x1a')](config[_0xa8a9('0x4c')],'server/files/tmp',process[_0xa8a9('0x79')][0x2]);if(!fs[_0xa8a9('0x7a')](_0x149361)){throw new Error('file\x20doesn\x27t\x20exists');}var _0xe7c842={};try{_0xe7c842=JSON[_0xa8a9('0x7b')](process[_0xa8a9('0x79')][0x3]);if(!_0xe7c842['binding']){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0xe7c842[_0xa8a9('0x4b')][_0xa8a9('0x25')]){throw new Error(_0xa8a9('0x7c'));}if(!_0xe7c842['binding'][_0xa8a9('0x60')]){throw new Error(_0xa8a9('0x7d'));}var _0x2d2e58=0x0;if(_0xe7c842['binding'][_0xa8a9('0x2c')]){_0x2d2e58=0x1;}if(!_0xe7c842[_0xa8a9('0x28')]){throw new Error(_0xa8a9('0x7e'));}}catch(_0x19ead){throw new Error(_0xa8a9('0x7f'));}var _0x47d7c4=[];try{_0x47d7c4=_[_0xa8a9('0x80')](JSON[_0xa8a9('0x7b')](process[_0xa8a9('0x79')][0x4]),'id');}catch(_0x4c0421){logger[_0xa8a9('0x43')](_0xa8a9('0x81'));}main(_0x149361,_0xe7c842,_0x47d7c4,_0x2d2e58);}validate();process['on'](_0xa8a9('0x82'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x4699=['cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','insert','createdAt','cm_hopper_black','\x20=\x20?','concat','ListId','CompanyId','updatedAt',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','info','error','message','exit','errors','push','code','sequelize','query','catch','main','send','start','binding','socket_timestamp','root','server/files/tmp','header','writeFileSync','createReadStream','data','length','rows','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','\x20not\x20specified','appendFileSync','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','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','fromQuery','scheduledat','ContactId','UserId','recallme','fields','from','cm_contacts'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x4699,0xe5));var _0x9469=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4699[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x9469('0x0'));var _=require(_0x9469('0x1'));var Papa=require(_0x9469('0x2'));var util=require('util');var BPromise=require(_0x9469('0x3'));var moment=require('moment');var squel=require('squel');var Redis=require(_0x9469('0x4'));var db=require(_0x9469('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x9469('0x6'))(_0x9469('0x7'));config[_0x9469('0x8')]=_[_0x9469('0x9')](config[_0x9469('0x8')],{'host':_0x9469('0xa'),'port':0x18eb});var socket=require(_0x9469('0xb'))(new Redis(config[_0x9469('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x9469('0xc')](_0x9469('0xd'));function isEmail(_0xe81f24){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))*$/[_0x9469('0xe')](_0xe81f24);}function selectNotIn(_0x149508,_0x416c4b,_0x4a0308,_0x48c41d,_0x588572){return squel[_0x9469('0xf')]()[_0x9469('0x10')](_0x9469('0x11'))['from'](_0x48c41d)[_0x9469('0x12')](_0x416c4b,null,_0x416c4b+_0x9469('0x13')+_0x48c41d+'.'+_0x4a0308)[_0x9469('0x14')](_0x48c41d+'.'+_0x4a0308+_0x9469('0x15')+_0x149508+'.'+_0x4a0308)['where'](_0x416c4b+_0x9469('0x16')+_0x588572[_0x9469('0x12')]()+')');}function insertCmHopper(_0x3d136e,_0x1c0d02,_0x292707,_0x4b94b4,_0x43a552){var _0x3002b7=[_0x9469('0x17'),_0x9469('0x18'),_0x9469('0x19'),'cm_contacts.ListId',_0x1c0d02+'.'+_0x4b94b4,_0x9469('0x1a'),_0x9469('0x1b'),_0x9469('0x1c'),_0x9469('0x1d'),'\x22'+_0x43a552+'\x22'];return squel['insert']()[_0x9469('0x1e')]('cm_hopper')[_0x9469('0x1f')]([_0x9469('0x11'),_0x9469('0x20'),_0x9469('0x21'),'ListId',_0x4b94b4,'createdAt','updatedAt','priority',_0x9469('0x22'),_0x9469('0x23')],squel[_0x9469('0xf')]()[_0x9469('0x24')](_0x3002b7)[_0x9469('0x25')](_0x1c0d02)[_0x9469('0x12')](_0x9469('0x26'),null,_0x9469('0x27')+_0x1c0d02+_0x9469('0x28'))[_0x9469('0x12')](_0x292707,null,_0x292707+_0x9469('0x13')+_0x1c0d02+'.'+_0x4b94b4)[_0x9469('0x14')](_0x1c0d02+_0x9469('0x29'),_0x3d136e)[_0x9469('0x14')](_0x9469('0x2a'),NOW)[_0x9469('0x14')](_0x9469('0x2b'),selectNotIn(_0x1c0d02,_0x292707,_0x4b94b4,_0x9469('0x2c'),[_0x9469('0x2d'),_0x9469('0x2e')]))[_0x9469('0x14')](_0x9469('0x2b'),selectNotIn(_0x1c0d02,_0x292707,_0x4b94b4,_0x9469('0x2c'),[_0x9469('0x2d')])))[_0x9469('0x2f')]();}function insertCmHopperBlack(_0x550b8e,_0x2c7597,_0x2010a9,_0x5239c3){var _0x198e16=[_0x9469('0x17'),'cm_contacts.id',_0x9469('0x30'),_0x2c7597+'.'+_0x5239c3,'cm_contacts.createdAt',_0x9469('0x1b')];return squel[_0x9469('0x31')]()['into']('cm_hopper_black')['fromQuery']([_0x9469('0x11'),_0x9469('0x21'),'ListId',_0x5239c3,_0x9469('0x32'),'updatedAt'],squel[_0x9469('0xf')]()['fields'](_0x198e16)[_0x9469('0x25')](_0x2c7597)[_0x9469('0x12')]('cm_contacts',null,_0x9469('0x27')+_0x2c7597+'.CmListId')[_0x9469('0x12')](_0x2010a9,null,_0x2010a9+_0x9469('0x13')+_0x2c7597+'.'+_0x5239c3)[_0x9469('0x14')](_0x2c7597+_0x9469('0x29'),_0x550b8e)['where'](_0x9469('0x2a'),NOW)[_0x9469('0x14')](_0x9469('0x2b'),squel[_0x9469('0xf')]()['field']('phone')[_0x9469('0x25')](_0x9469('0x33'))['where']('ListId\x20=\x20?',_0x550b8e)[_0x9469('0x14')](_0x5239c3+_0x9469('0x34'),_0x2c7597+'.'+_0x5239c3)))[_0x9469('0x2f')]();}function insertCmContact(_0x36e4e3,_0x213d02,_0xba6d47,_0x15ba95){var _0x1f10ea=_[_0x9469('0x35')](_['keys'](_0x15ba95),[_0x9469('0x36'),_0x9469('0x37'),_0x9469('0x32'),_0x9469('0x38')]);return squel['insert']()[_0x9469('0x1e')]('cm_contacts')[_0x9469('0x1f')](_0x1f10ea,squel[_0x9469('0xf')]()[_0x9469('0x24')](_0x1f10ea)['from'](_0x213d02)['where']('('+_0xba6d47[_0x9469('0x12')](',')+_0x9469('0x39'),squel['select']()[_0x9469('0x24')](_0xba6d47)[_0x9469('0x25')]('cm_contacts')[_0x9469('0x14')](_0x9469('0x3a'),_0x36e4e3)[_0x9469('0x14')](_0x9469('0x3b')))[_0x9469('0x14')](_0x9469('0x3c'),squel[_0x9469('0xf')]()['field']('MIN(id)','min_id')[_0x9469('0x25')](_0x213d02)['group'](_0xba6d47[_0x9469('0x12')](','))))[_0x9469('0x2f')]();}function handleStop(){logger[_0x9469('0x3d')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2f0735){logger[_0x9469('0x3e')](_0x2f0735[_0x9469('0x3f')]);process[_0x9469('0x40')](0x1);}function handleError(_0x4a5484,_0x159154){stats[_0x9469('0x41')][_0x9469('0x42')]({'name':_0x159154[_0x9469('0x43')],'message':_0x159154[_0x9469('0x3f')],'row':_0x4a5484});}function handleQuery(_0x3a2381){logger[_0x9469('0x3d')](_0x3a2381);return db[_0x9469('0x44')][_0x9469('0x45')](_0x3a2381)['spread'](function(_0x1fc51f){results[_0x9469('0x42')](_0x1fc51f);})[_0x9469('0x46')](function(_0xca5780){logger[_0x9469('0x3e')](_0xca5780[_0x9469('0x3f')]);});}function main(_0x287ca9,_0x4991bd,_0x5c8bb5,_0x4f23dc){logger[_0x9469('0x3d')](_0x9469('0x47'),_0x287ca9,JSON['stringify'](_0x4991bd));process[_0x9469('0x48')](_0x9469('0x49'));var _0x553159=_0x4991bd[_0x9469('0x4a')];var _0x459aa9=_0x4991bd[_0x9469('0x4b')];var _0x12ec57=path[_0x9469('0x12')](config[_0x9469('0x4c')],_0x9469('0x4d'),_0x459aa9+'.csv');var _0x1fb953=_['keys'](_0x553159)[_0x9469('0x12')]();logger['info'](_0x9469('0x4e'),_0x1fb953);fs[_0x9469('0x4f')](_0x12ec57,_0x1fb953+'\x0a');Papa['parse'](fs[_0x9469('0x50')](_0x287ca9),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2825f3,_0x4fea3e){try{for(var _0x1bf46f=0x0,_0x11ea87=[];_0x1bf46f<_0x2825f3[_0x9469('0x51')][_0x9469('0x52')];_0x1bf46f++){stats[_0x9469('0x53')]+=0x1;if(_0x2825f3['errors'][_0x1bf46f]){handleError(_0x2825f3[_0x9469('0x51')][_0x1bf46f],_0x2825f3['errors'][_0x1bf46f]);}else{var _0x17e6f4=[];for(var _0x1e7101 in _0x553159){if(_0x553159[_0x9469('0x54')](_0x1e7101)){if(_0x2825f3['data'][_0x1bf46f][_0x553159[_0x1e7101]]){var _0x542443=_['trim'](_0x2825f3['data'][_0x1bf46f][_0x553159[_0x1e7101]][_0x9469('0x55')](/"/g,'\x27'));switch(_0x1e7101){case _0x9469('0x20'):var _0x3c3ba7=moment(_0x542443,_0x9469('0xd'),!![]);if(_0x3c3ba7[_0x9469('0x56')]()){_0x11ea87['push']('\x22'+_0x542443+'\x22');}else{_0x17e6f4[_0x9469('0x42')](_0x9469('0x57'));}break;case _0x9469('0x58'):var _0x151054=parseInt(_0x542443);_0x542443=_[_0x9469('0x59')](_0x151054)||_0x151054<0x0||_0x151054>0x4?_0x4f23dc?0x3:0x2:_0x151054;_0x11ea87[_0x9469('0x42')]('\x22'+_0x542443+'\x22');break;case _0x9469('0x22'):var _0xb6bbfe=parseInt(_0x542443);if(_[_0x9469('0x5a')](_0xb6bbfe)&&_[_0x9469('0x5b')](_0x5c8bb5,_0xb6bbfe)){_0x11ea87[_0x9469('0x42')]('\x22'+_0xb6bbfe+'\x22');}else{_0x17e6f4[_0x9469('0x42')](_0x9469('0x5c'));}break;case _0x9469('0x5d'):if(isEmail(_0x542443)){_0x11ea87[_0x9469('0x42')]('\x22'+_0x542443+'\x22');}else{_0x17e6f4['push'](_0x9469('0x5e'));}break;case _0x9469('0x5f'):var _0x215bcd=moment(_0x542443,_0x9469('0x60'),!![]);if(_0x215bcd[_0x9469('0x56')]()){_0x11ea87[_0x9469('0x42')]('\x22'+_0x542443+'\x22');}else{_0x17e6f4[_0x9469('0x42')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x11ea87[_0x9469('0x42')]('\x22'+_0x542443+'\x22');}}else{switch(_0x1e7101){case'firstName':case _0x9469('0x11'):_0x17e6f4[_0x9469('0x42')](_0x1e7101+_0x9469('0x61'));break;default:_0x11ea87[_0x9469('0x42')]('\x22\x22');}}}}if(_0x17e6f4['length']){handleError(_0x2825f3['data'][_0x1bf46f],{'code':'SystemRow','message':_0x17e6f4[_0x9469('0x12')]()});}else{fs[_0x9469('0x62')](_0x12ec57,_0x11ea87['join']()+'\x0a');}_0x11ea87=[];}if(!(stats['rows']%0xc8)){socket[_0x9469('0x63')](_0x9469('0x64')+_0x459aa9,stats);stats[_0x9469('0x41')]=[];}}if(stopped){logger[_0x9469('0x3d')](_0x9469('0x65'));_0x4fea3e['abort']();}}catch(_0x4bc434){handleError(_0x2825f3[_0x9469('0x51')][_0x1bf46f],{'code':_0x9469('0x66'),'message':_0x4bc434['message']});logger['error'](_0x9469('0x67'),_0x4bc434[_0x9469('0x3f')]);}},'complete':function(){try{var _0x4a583a=[];var _0x3398e2=_0x9469('0x26');if(_0x4991bd[_0x9469('0x68')]&&_0x4991bd[_0x9469('0x68')][_0x9469('0x52')]){_0x3398e2=_0x9469('0x69')+_0x459aa9;_0x4a583a[_0x9469('0x42')](_0x9469('0x6a')+_0x3398e2+_0x9469('0x6b'));}var _0x259c6c=util['format']('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',_0x12ec57,_0x3398e2,_0x1fb953,_0x4991bd[_0x9469('0x36')],_0x4991bd['CompanyId']||null,NOW,NOW);if(_[_0x9469('0x6c')](_0x553159[_0x9469('0x20')])){_0x259c6c+=_0x9469('0x6d');}_0x4a583a[_0x9469('0x42')](_0x259c6c);if(_0x4991bd['duplicates']&&_0x4991bd[_0x9469('0x68')][_0x9469('0x52')]){_0x4a583a[_0x9469('0x42')](insertCmContact(_0x4991bd[_0x9469('0x36')],_0x3398e2,_0x4991bd['duplicates'],_0x553159));_0x4a583a[_0x9469('0x42')](_0x9469('0x6e')+_0x3398e2+';');}_0x4a583a[_0x9469('0x42')](insertCmHopper(_0x4991bd[_0x9469('0x36')],_0x9469('0x6f'),_0x9469('0x70'),_0x9469('0x71'),_0x4f23dc));_0x4a583a['push'](insertCmHopperBlack(_0x4991bd[_0x9469('0x36')],_0x9469('0x72'),_0x9469('0x70'),_0x9469('0x71')));_0x4a583a[_0x9469('0x42')](insertCmHopper(_0x4991bd[_0x9469('0x36')],_0x9469('0x73'),'campaigns',_0x9469('0x74'),_0x4f23dc));_0x4a583a[_0x9469('0x42')](insertCmHopperBlack(_0x4991bd[_0x9469('0x36')],_0x9469('0x75'),'campaigns',_0x9469('0x74')));BPromise['each'](_0x4a583a,handleQuery)['then'](function(_0x1e458b){stats[_0x9469('0x76')]=!![];stats[_0x9469('0x77')]=_0x4991bd[_0x9469('0x68')]&&_0x4991bd['duplicates'][_0x9469('0x52')]?results[0x2]['affectedRows']:results[0x0][_0x9469('0x77')];socket[_0x9469('0x63')]('contact:import:'+_0x459aa9,stats);fs[_0x9469('0x78')](_0x287ca9);fs[_0x9469('0x78')](_0x12ec57);process[_0x9469('0x40')](0x0);})['catch'](function(_0x561dca){logger[_0x9469('0x3e')](_0x561dca[_0x9469('0x3f')]);process[_0x9469('0x40')](0x1);});}catch(_0x3e66e2){logger['error'](_0x9469('0x79'),_0x3e66e2[_0x9469('0x3f')]);process[_0x9469('0x40')](0x1);}},'error':function(_0x29b798,_0x55e1ca,_0x52dcfd,_0x536eb5){throw new Error(_0x536eb5);}});}function validate(){if(process[_0x9469('0x7a')]&&process['argv'][_0x9469('0x52')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x50eb35=path[_0x9469('0x12')](config[_0x9469('0x4c')],'server/files/tmp',process[_0x9469('0x7a')][0x2]);if(!fs[_0x9469('0x7b')](_0x50eb35)){throw new Error(_0x9469('0x7c'));}var _0x9ecffc={};try{_0x9ecffc=JSON[_0x9469('0x7d')](process['argv'][0x3]);if(!_0x9ecffc[_0x9469('0x4a')]){throw new Error(_0x9469('0x7e'));}if(!_0x9ecffc['binding'][_0x9469('0x11')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x9ecffc['binding'][_0x9469('0x7f')]){throw new Error(_0x9469('0x80'));}var _0x313b8c=0x0;if(_0x9ecffc[_0x9469('0x4a')][_0x9469('0x22')]){_0x313b8c=0x1;}if(!_0x9ecffc[_0x9469('0x36')]){throw new Error(_0x9469('0x81'));}}catch(_0x5528b8){throw new Error(_0x9469('0x82'));}var _0xa063e1=[];try{_0xa063e1=_['map'](JSON[_0x9469('0x7d')](process[_0x9469('0x7a')][0x4]),'id');}catch(_0x3dc137){logger['info'](_0x9469('0x83'));}main(_0x50eb35,_0x9ecffc,_0xa063e1,_0x313b8c);}validate();process['on'](_0x9469('0x84'),handleStop);process['on'](_0x9469('0x85'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 147832b..2b35f5d 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 _0x473e=['calleridnum','outbound','string','Outbound\x20Call','getDescriptions','inbound','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','Hold\x20Time','holdtime','Talk\x20Time','talktime','destcalleridnum','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','getSubjects','toLowerCase','voice','push','variable'];(function(_0x26ff26,_0x4189d7){var _0x309fde=function(_0x4faa99){while(--_0x4faa99){_0x26ff26['push'](_0x26ff26['shift']());}};_0x309fde(++_0x4189d7);}(_0x473e,0x187));var _0xe473=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x473e[_0x3dd15e];return _0x231fd0;};'use strict';exports[_0xe473('0x0')]=function(_0x3fa681,_0x91d4ba){var _0x4aedcd=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x3fa681[_0xe473('0x1')]()){case _0xe473('0x2'):switch(_0x91d4ba[_0xe473('0x1')]()){case'inbound':_0x4aedcd[_0xe473('0x3')]({'type':_0xe473('0x4'),'content':'','variableName':'queue'});_0x4aedcd[_0xe473('0x3')]({'type':_0xe473('0x4'),'content':'','variableName':_0xe473('0x5')});break;case _0xe473('0x6'):_0x4aedcd[_0xe473('0x3')]({'type':_0xe473('0x7'),'content':_0xe473('0x8'),'variableName':null});_0x4aedcd['push']({'type':_0xe473('0x4'),'content':'','variableName':'destcalleridnum'});break;}}return _0x4aedcd;};exports[_0xe473('0x9')]=function(_0x3a9fc5,_0x15c64b){var _0x2efc45=[];switch(_0x3a9fc5[_0xe473('0x1')]()){case _0xe473('0x2'):switch(_0x15c64b['toLowerCase']()){case _0xe473('0xa'):_0x2efc45=[{'type':'string','content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xe473('0xb'),'content':'','key':'Caller\x20Number','keyType':_0xe473('0x4'),'variableName':'calleridnum'},{'type':_0xe473('0xb'),'content':'','key':_0xe473('0xc'),'keyType':'variable','variableName':_0xe473('0xd')},{'type':_0xe473('0xb'),'content':'','key':_0xe473('0xe'),'keyType':_0xe473('0x4'),'variableName':_0xe473('0xf')},{'type':_0xe473('0xb'),'content':'','key':'Queue','keyType':_0xe473('0x4'),'variableName':_0xe473('0x10')},{'type':_0xe473('0xb'),'content':'','key':_0xe473('0x11'),'keyType':_0xe473('0x4'),'variableName':_0xe473('0x12')},{'type':_0xe473('0xb'),'content':'','key':_0xe473('0x13'),'keyType':_0xe473('0x4'),'variableName':_0xe473('0x14')},{'type':_0xe473('0x7'),'content':_0xe473('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0xe473('0xb'),'content':'','key':_0xe473('0x16'),'keyType':_0xe473('0x4'),'variableName':_0xe473('0x17')},{'type':_0xe473('0xb'),'content':'','key':'Agent\x20Number','keyType':_0xe473('0x4'),'variableName':'destcalleridnum'},{'type':_0xe473('0x7'),'content':_0xe473('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xe473('0xb'),'content':'','key':_0xe473('0x19'),'keyType':'variable','variableName':_0xe473('0x14')},{'type':_0xe473('0xb'),'content':'','key':_0xe473('0x1a'),'keyType':_0xe473('0x4'),'variableName':_0xe473('0x1b')},{'type':'keyValue','content':'','key':_0xe473('0x1c'),'keyType':_0xe473('0x4'),'variableName':'agentcompleteAt'},{'type':_0xe473('0xb'),'content':'','key':_0xe473('0x1d'),'keyType':_0xe473('0x4'),'variableName':_0xe473('0x1e')},{'type':_0xe473('0xb'),'content':'','key':_0xe473('0x1f'),'keyType':_0xe473('0x4'),'variableName':_0xe473('0x20')}];break;case'outbound':_0x2efc45=[{'type':_0xe473('0x7'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':'variable','keyContent':'','variableName':_0xe473('0x21')},{'type':_0xe473('0xb'),'content':'','key':_0xe473('0x22'),'keyType':'variable','keyContent':'','variableName':_0xe473('0x23')},{'type':'keyValue','content':'','key':_0xe473('0x11'),'keyType':_0xe473('0x4'),'keyContent':'','variableName':'uniqueid'},{'type':_0xe473('0xb'),'content':'','key':_0xe473('0x13'),'keyType':_0xe473('0x4'),'keyContent':'','variableName':_0xe473('0x24')},{'type':_0xe473('0x7'),'content':'***\x20Time\x20Info\x20***'},{'type':_0xe473('0xb'),'content':'','key':_0xe473('0x25'),'keyType':_0xe473('0x4'),'keyContent':'','variableName':_0xe473('0x26')},{'type':_0xe473('0xb'),'content':'','key':_0xe473('0x27'),'keyType':'variable','keyContent':'','variableName':_0xe473('0x28')},{'type':_0xe473('0xb'),'content':'','key':_0xe473('0x29'),'keyType':_0xe473('0x4'),'keyContent':'','variableName':_0xe473('0x2a')},{'type':_0xe473('0xb'),'content':'','key':_0xe473('0x2b'),'keyType':_0xe473('0x4'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x2efc45;}; \ No newline at end of file +var _0xf17a=['***\x20Agent\x20Info\x20***','Agent\x20Name','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','Hold\x20Time','holdtime','Called\x20Number','Member\x20Name','starttime','Answer\x20Time','answertime','Complete\x20Time','Duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','UniqueId','uniqueid','Date','agentcalledAt'];(function(_0x32c8bb,_0x41c3ca){var _0x3f895a=function(_0x45dce3){while(--_0x45dce3){_0x32c8bb['push'](_0x32c8bb['shift']());}};_0x3f895a(++_0x41c3ca);}(_0xf17a,0x151));var _0xaf17=function(_0x3d05a6,_0x50c60a){_0x3d05a6=_0x3d05a6-0x0;var _0xfb3e68=_0xf17a[_0x3d05a6];return _0xfb3e68;};'use strict';exports[_0xaf17('0x0')]=function(_0x17b6ac,_0x5bc22c){var _0x46e479=[{'type':_0xaf17('0x1'),'content':_0xaf17('0x2'),'variableName':null}];switch(_0x17b6ac[_0xaf17('0x3')]()){case _0xaf17('0x4'):switch(_0x5bc22c[_0xaf17('0x3')]()){case _0xaf17('0x5'):_0x46e479[_0xaf17('0x6')]({'type':_0xaf17('0x7'),'content':'','variableName':_0xaf17('0x8')});_0x46e479[_0xaf17('0x6')]({'type':'variable','content':'','variableName':_0xaf17('0x9')});break;case _0xaf17('0xa'):_0x46e479['push']({'type':_0xaf17('0x1'),'content':_0xaf17('0xb'),'variableName':null});_0x46e479[_0xaf17('0x6')]({'type':'variable','content':'','variableName':_0xaf17('0xc')});break;}}return _0x46e479;};exports['getDescriptions']=function(_0x9a124a,_0x1b9323){var _0x3ead7f=[];switch(_0x9a124a[_0xaf17('0x3')]()){case'voice':switch(_0x1b9323[_0xaf17('0x3')]()){case _0xaf17('0x5'):_0x3ead7f=[{'type':_0xaf17('0x1'),'content':_0xaf17('0xd'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Caller\x20Number','keyType':_0xaf17('0x7'),'variableName':'calleridnum'},{'type':_0xaf17('0xe'),'content':'','key':_0xaf17('0xf'),'keyType':_0xaf17('0x7'),'variableName':_0xaf17('0x10')},{'type':'keyValue','content':'','key':_0xaf17('0x11'),'keyType':_0xaf17('0x7'),'variableName':_0xaf17('0x12')},{'type':_0xaf17('0xe'),'content':'','key':'Queue','keyType':_0xaf17('0x7'),'variableName':_0xaf17('0x8')},{'type':_0xaf17('0xe'),'content':'','key':_0xaf17('0x13'),'keyType':_0xaf17('0x7'),'variableName':_0xaf17('0x14')},{'type':'keyValue','content':'','key':_0xaf17('0x15'),'keyType':_0xaf17('0x7'),'variableName':_0xaf17('0x16')},{'type':_0xaf17('0x1'),'content':_0xaf17('0x17'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xaf17('0x18'),'keyType':_0xaf17('0x7'),'variableName':'destcalleridname'},{'type':_0xaf17('0xe'),'content':'','key':'Agent\x20Number','keyType':_0xaf17('0x7'),'variableName':_0xaf17('0xc')},{'type':_0xaf17('0x1'),'content':_0xaf17('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xaf17('0xe'),'content':'','key':'Agent\x20Ring','keyType':_0xaf17('0x7'),'variableName':'agentcalledAt'},{'type':_0xaf17('0xe'),'content':'','key':_0xaf17('0x1a'),'keyType':'variable','variableName':_0xaf17('0x1b')},{'type':_0xaf17('0xe'),'content':'','key':_0xaf17('0x1c'),'keyType':_0xaf17('0x7'),'variableName':'agentcompleteAt'},{'type':_0xaf17('0xe'),'content':'','key':_0xaf17('0x1d'),'keyType':'variable','variableName':_0xaf17('0x1e')},{'type':_0xaf17('0xe'),'content':'','key':'Talk\x20Time','keyType':_0xaf17('0x7'),'variableName':'talktime'}];break;case _0xaf17('0xa'):_0x3ead7f=[{'type':_0xaf17('0x1'),'content':_0xaf17('0xd'),'variableName':null},{'type':_0xaf17('0xe'),'content':'','key':_0xaf17('0x1f'),'keyType':_0xaf17('0x7'),'keyContent':'','variableName':_0xaf17('0xc')},{'type':_0xaf17('0xe'),'content':'','key':_0xaf17('0x20'),'keyType':_0xaf17('0x7'),'keyContent':'','variableName':'membername'},{'type':_0xaf17('0xe'),'content':'','key':_0xaf17('0x13'),'keyType':'variable','keyContent':'','variableName':_0xaf17('0x14')},{'type':_0xaf17('0xe'),'content':'','key':_0xaf17('0x15'),'keyType':_0xaf17('0x7'),'keyContent':'','variableName':_0xaf17('0x21')},{'type':_0xaf17('0x1'),'content':_0xaf17('0x19')},{'type':_0xaf17('0xe'),'content':'','key':_0xaf17('0x22'),'keyType':_0xaf17('0x7'),'keyContent':'','variableName':_0xaf17('0x23')},{'type':_0xaf17('0xe'),'content':'','key':_0xaf17('0x24'),'keyType':_0xaf17('0x7'),'keyContent':'','variableName':'endtime'},{'type':_0xaf17('0xe'),'content':'','key':_0xaf17('0x25'),'keyType':_0xaf17('0x7'),'keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':_0xaf17('0x26'),'keyType':_0xaf17('0x7'),'keyContent':'','variableName':_0xaf17('0x27')}];break;}}return _0x3ead7f;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 45af55a..4e97952 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 _0x2775=['catch','error','tracked','user','clone','body','omit','phone','fax','lodash','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','then','update','info'];(function(_0x7f9072,_0x19a24c){var _0x150f32=function(_0x4cb7f6){while(--_0x4cb7f6){_0x7f9072['push'](_0x7f9072['shift']());}};_0x150f32(++_0x19a24c);}(_0x2775,0x159));var _0x5277=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0x2775[_0x45d1fd];return _0xd0e542;};'use strict';var _=require(_0x5277('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require(_0x5277('0x1'))(_0x5277('0x2')),'fax':require(_0x5277('0x1'))(_0x5277('0x3')),'sms':require(_0x5277('0x1'))(_0x5277('0x4')),'chat':require(_0x5277('0x1'))(_0x5277('0x5')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getInteractionId(_0x4d45c1,_0x108560,_0x1e9158){if(_0x4d45c1&&_0x4d45c1[_[_0x5277('0x6')](_0x1e9158)+_0x5277('0x7')]){return _0x4d45c1[_[_0x5277('0x6')](_0x1e9158)+_0x5277('0x7')];}else if(_0x4d45c1&&_0x4d45c1['id']){return _0x4d45c1['id'];}else if(_0x108560&&_0x108560['id']){return _0x108560['id'];}else{return _0x5277('0x8');}}function log(_0x578e3b,_0x57cfb7,_0x383b5b,_0x5d0d86,_0x5693cc,_0x2e4f3e){loggers[_0x5693cc[_0x5277('0x9')]()][_0x578e3b](_0x5277('0xa'),_0x2e4f3e[_0x5277('0xb')](),_0x57cfb7?_0x57cfb7['id']:null,_0x57cfb7?_0x57cfb7[_0x5277('0xc')]:null,_0x57cfb7?_0x57cfb7['role']:null,getInteractionId(_0x383b5b,_0x5d0d86,_0x5693cc),_0x383b5b?JSON[_0x5277('0xd')](_0x383b5b):_0x5277('0xe'));}function updateUser(_0x802647,_0x31b9bb,_0xdac384,_0x580c1a,_0x1506a1){db[_[_0x5277('0x6')](_0x580c1a)+_0x5277('0xf')]['findOne']({'where':{'id':getInteractionId(_0x31b9bb,_0xdac384,_0x580c1a)}})[_0x5277('0x10')](function(_0x584e6c){if(_0x584e6c){return _0x584e6c[_0x5277('0x11')]({'UserId':_0x802647?_0x802647['id']:null});}})['then'](function(_0xafac4d){if(_0xafac4d){log(_0x5277('0x12'),_0x802647,_0x31b9bb,_0xdac384,_0x580c1a,_0x1506a1);}})[_0x5277('0x13')](function(){log(_0x5277('0x14'),_0x802647,_0x31b9bb,_0xdac384,_0x580c1a,_0x1506a1);});}exports[_0x5277('0x15')]=function(_0x4e9b06,_0x215ef3){return function(_0x261b59,_0xac0263,_0x9623d5){var _0x5b1d8a=_0x261b59[_0x5277('0x16')];var _0x988f4d={};var _0x3fcebb=_0x261b59['query'];if(_0x988f4d){_0x988f4d=_[_0x5277('0x17')](_0x261b59[_0x5277('0x18')]);_0x988f4d=_[_0x5277('0x19')](_0x988f4d,['body','html',_0x5277('0x1a'),_0x5277('0x1b'),'mobile']);}updateUser(_0x5b1d8a,_0x988f4d,_0x3fcebb,_0x4e9b06,_0x215ef3);_0x9623d5(null);};}; \ No newline at end of file +var _0xf8e0=['user','query','clone','body','omit','html','fax','mobile','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','toLowerCase','toUpperCase','role','stringify','null','Interaction','then','update','catch','error','tracked'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xf8e0,0x10d));var _0x0f8e=function(_0x31cae7,_0x297087){_0x31cae7=_0x31cae7-0x0;var _0x3f8521=_0xf8e0[_0x31cae7];return _0x3f8521;};'use strict';var _=require(_0x0f8e('0x0'));var db=require(_0x0f8e('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x0f8e('0x2')),'mail':require(_0x0f8e('0x3'))(_0x0f8e('0x4')),'fax':require(_0x0f8e('0x3'))('fax-interactions'),'sms':require('../../config/logger')(_0x0f8e('0x5')),'chat':require(_0x0f8e('0x3'))(_0x0f8e('0x6')),'whatsapp':require(_0x0f8e('0x3'))(_0x0f8e('0x7'))};function getInteractionId(_0x223660,_0x1570fb,_0x2380f3){if(_0x223660&&_0x223660[_[_0x0f8e('0x8')](_0x2380f3)+'InteractionId']){return _0x223660[_[_0x0f8e('0x8')](_0x2380f3)+_0x0f8e('0x9')];}else if(_0x223660&&_0x223660['id']){return _0x223660['id'];}else if(_0x1570fb&&_0x1570fb['id']){return _0x1570fb['id'];}else{return'unknown';}}function log(_0x189f16,_0x3d910b,_0x4ceceb,_0x483f99,_0x1e7706,_0x138da4){loggers[_0x1e7706[_0x0f8e('0xa')]()][_0x189f16]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x138da4[_0x0f8e('0xb')](),_0x3d910b?_0x3d910b['id']:null,_0x3d910b?_0x3d910b['name']:null,_0x3d910b?_0x3d910b[_0x0f8e('0xc')]:null,getInteractionId(_0x4ceceb,_0x483f99,_0x1e7706),_0x4ceceb?JSON[_0x0f8e('0xd')](_0x4ceceb):_0x0f8e('0xe'));}function updateUser(_0x280cce,_0x3db633,_0x2bc4aa,_0x427317,_0x21a62e){db[_[_0x0f8e('0x8')](_0x427317)+_0x0f8e('0xf')]['findOne']({'where':{'id':getInteractionId(_0x3db633,_0x2bc4aa,_0x427317)}})[_0x0f8e('0x10')](function(_0x2b2073){if(_0x2b2073){return _0x2b2073[_0x0f8e('0x11')]({'UserId':_0x280cce?_0x280cce['id']:null});}})[_0x0f8e('0x10')](function(_0x33b3b4){if(_0x33b3b4){log('info',_0x280cce,_0x3db633,_0x2bc4aa,_0x427317,_0x21a62e);}})[_0x0f8e('0x12')](function(){log(_0x0f8e('0x13'),_0x280cce,_0x3db633,_0x2bc4aa,_0x427317,_0x21a62e);});}exports[_0x0f8e('0x14')]=function(_0x1243ee,_0x4f2a9d){return function(_0x45a778,_0x89396d,_0x2b43c9){var _0x18768a=_0x45a778[_0x0f8e('0x15')];var _0x1ec813={};var _0x4acf80=_0x45a778[_0x0f8e('0x16')];if(_0x1ec813){_0x1ec813=_[_0x0f8e('0x17')](_0x45a778[_0x0f8e('0x18')]);_0x1ec813=_[_0x0f8e('0x19')](_0x1ec813,[_0x0f8e('0x18'),_0x0f8e('0x1a'),'phone',_0x0f8e('0x1b'),_0x0f8e('0x1c')]);}updateUser(_0x18768a,_0x1ec813,_0x4acf80,_0x1243ee,_0x4f2a9d);_0x2b43c9(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 73eaf6c..06ddec4 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 _0x9f66=['format','%s:%s:%s','update','base64','utf8','parse','use','findOne','then','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','crypto','util','composable-middleware','data1','license','split','createDecipher','aes-256-ctr'];(function(_0x12f63f,_0x2165bc){var _0x500c13=function(_0x810faa){while(--_0x810faa){_0x12f63f['push'](_0x12f63f['shift']());}};_0x500c13(++_0x2165bc);}(_0x9f66,0xb8));var _0x69f6=function(_0x6beff7,_0x5432ed){_0x6beff7=_0x6beff7-0x0;var _0x2489fd=_0x9f66[_0x6beff7];return _0x2489fd;};'use strict';var crypto=require(_0x69f6('0x0'));var util=require(_0x69f6('0x1'));var compose=require(_0x69f6('0x2'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x5f03ae,_0x5a0eb5){if(_0x5f03ae&&_0x5a0eb5){if(_0x5a0eb5[_0x69f6('0x3')]&&_0x5a0eb5['license']){var _0x2398da=_0x5a0eb5['data1'];var _0xa0cddf=_0x5a0eb5[_0x69f6('0x4')];var _0x4d77c6=_0x2398da[_0x69f6('0x5')]('-')[0x4];var _0xf2006b=_0x2398da['split']('-')[0x0];var _0x457cf5=crypto[_0x69f6('0x6')](_0x69f6('0x7'),util[_0x69f6('0x8')](_0x69f6('0x9'),_0x4d77c6,_0x2398da,_0xf2006b));var _0x1fcc19=_0x457cf5[_0x69f6('0xa')](_0xa0cddf,_0x69f6('0xb'),'utf8');_0x1fcc19+=_0x457cf5['final'](_0x69f6('0xc'));var _0x1147a2=JSON[_0x69f6('0xd')](_0x1fcc19);return _0x1147a2['hasOwnProperty'](_0x5f03ae)?_0x1147a2[_0x5f03ae]:null;}}return null;}function isLimit(_0x5cfb5e,_0x4c03e3,_0x16c86d,_0x3acdd2){var _0x27d6b6=_0x4c03e3;return compose()[_0x69f6('0xe')](function(_0x5e191d,_0x189aa6,_0x13a6b3){return db['License'][_0x69f6('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x69f6('0x10')](function(_0x5d3fc4){var _0x1f46f8=getValueFromLicense(_0x5cfb5e,_0x5d3fc4);return _0x1f46f8?_0x1f46f8:_0x27d6b6;})[_0x69f6('0x10')](function(_0x4ce1e9){_0x27d6b6=_0x4ce1e9;return _0x16c86d['count'](_0x3acdd2);})[_0x69f6('0x10')](function(_0x4529fe){if(_0x4529fe>=_0x27d6b6){return _0x189aa6['status'](0x193)[_0x69f6('0x11')]({'message':util[_0x69f6('0x8')](_0x69f6('0x12'),_0x5cfb5e)});}_0x13a6b3();})[_0x69f6('0x13')](function(_0x48d250){_0x13a6b3(_0x48d250);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x69f6('0x14')],{'where':{'$or':[{'role':_0x69f6('0x15')},{'role':_0x69f6('0x16')}]}});}exports[_0x69f6('0x17')]=isUserLimit; \ No newline at end of file +var _0xfa2e=['isUserLimit','crypto','util','composable-middleware','../../mysqldb','data1','split','createDecipher','format','%s:%s:%s','update','utf8','final','parse','findOne','then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','admin','user'];(function(_0x5eab69,_0x468a6e){var _0x354f2a=function(_0x4dde09){while(--_0x4dde09){_0x5eab69['push'](_0x5eab69['shift']());}};_0x354f2a(++_0x468a6e);}(_0xfa2e,0x109));var _0xefa2=function(_0x4f3ff5,_0xae9bee){_0x4f3ff5=_0x4f3ff5-0x0;var _0x2b5f69=_0xfa2e[_0x4f3ff5];return _0x2b5f69;};'use strict';var crypto=require(_0xefa2('0x0'));var util=require(_0xefa2('0x1'));var compose=require(_0xefa2('0x2'));var db=require(_0xefa2('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x35a1d9,_0x194947){if(_0x35a1d9&&_0x194947){if(_0x194947['data1']&&_0x194947['license']){var _0xc10abf=_0x194947[_0xefa2('0x4')];var _0x341a6f=_0x194947['license'];var _0x129ce8=_0xc10abf[_0xefa2('0x5')]('-')[0x4];var _0x347253=_0xc10abf[_0xefa2('0x5')]('-')[0x0];var _0x43e44d=crypto[_0xefa2('0x6')]('aes-256-ctr',util[_0xefa2('0x7')](_0xefa2('0x8'),_0x129ce8,_0xc10abf,_0x347253));var _0x1ccabe=_0x43e44d[_0xefa2('0x9')](_0x341a6f,'base64',_0xefa2('0xa'));_0x1ccabe+=_0x43e44d[_0xefa2('0xb')]('utf8');var _0x3a3cf3=JSON[_0xefa2('0xc')](_0x1ccabe);return _0x3a3cf3['hasOwnProperty'](_0x35a1d9)?_0x3a3cf3[_0x35a1d9]:null;}}return null;}function isLimit(_0x25578f,_0x35cd47,_0x2311a1,_0x30e668){var _0x590160=_0x35cd47;return compose()['use'](function(_0x1ad91d,_0x464654,_0x176262){return db['License'][_0xefa2('0xd')]({'where':{'id':0x1},'raw':!![]})[_0xefa2('0xe')](function(_0x38412a){var _0x1c21e6=getValueFromLicense(_0x25578f,_0x38412a);return _0x1c21e6?_0x1c21e6:_0x590160;})[_0xefa2('0xe')](function(_0x296a4d){_0x590160=_0x296a4d;return _0x2311a1[_0xefa2('0xf')](_0x30e668);})[_0xefa2('0xe')](function(_0x5d5824){if(_0x5d5824>=_0x590160){return _0x464654['status'](0x193)[_0xefa2('0x10')]({'message':util['format'](_0xefa2('0x11'),_0x25578f)});}_0x176262();})[_0xefa2('0x12')](function(_0x56bf0a){_0x176262(_0x56bf0a);});});}function isUserLimit(){return isLimit('users',0x1,db['User'],{'where':{'$or':[{'role':_0xefa2('0x13')},{'role':_0xefa2('0x14')}]}});}exports[_0xefa2('0x15')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index b0fe74a..bca8c2e 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 _0x6522=['NOT\x20IN\x20?','=\x20?','$ne','$startsWith','$endsWith','LIKE\x20?','<\x20?','$gt','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','$substring','pop','DATE','format','utcOffset','minutes','lodash','moment','sqlOperator','[$or]','and','replace','split','slice','forEach','shift','match','filter','indexOf','push','buildExpression','operator','$eq','$between','value','includes','$lte','add','days','castTo','text','CAST(','field','\x20AS\x20','$notIn','\x20IS\x20NULL)','$in'];(function(_0x4d097e,_0x50144b){var _0x49c673=function(_0x427c58){while(--_0x427c58){_0x4d097e['push'](_0x4d097e['shift']());}};_0x49c673(++_0x50144b);}(_0x6522,0x77));var _0x2652=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6522[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2652('0x0'));var moment=require(_0x2652('0x1'));exports['parseSearch']=function(_0x5aa331){var _0x24b4a9={'conditions':[]};_0x24b4a9[_0x2652('0x2')]=_['startsWith'](_0x5aa331,_0x2652('0x3'))?'or':_0x2652('0x4');var _0x348994=_0x5aa331[_0x2652('0x5')]('[$and]','')['replace'](_0x2652('0x3'),'')[_0x2652('0x6')]('||');for(var _0x123f8d=0x0;_0x123f8d<_0x348994['length'];_0x123f8d++){var _0x5a232d=_0x348994[_0x123f8d][_0x2652('0x6')](':=');var _0x40c513=_0x5a232d[0x0];var _0x127a73=_0x5a232d[_0x2652('0x7')](0x1);_0x127a73[_0x2652('0x8')](function(_0x1ac43f){var _0x2db367=_0x1ac43f[_0x2652('0x6')]('[')[_0x2652('0x9')]();var _0x5417b1=_0x1ac43f[_0x2652('0xa')](/\[(.*?)\]/g);_0x5417b1[_0x2652('0x8')](function(_0xe2efaa){var _0x5d3123=_0xe2efaa[_0x2652('0x6')]('[')[_0x2652('0xb')](function(_0x1ff16e){return _0x1ff16e[_0x2652('0xc')](']')>-0x1;})['map'](function(_0x1e5321){return _0x1e5321['split'](']')[0x0];})[0x0];_0x24b4a9['conditions'][_0x2652('0xd')]({'field':_0x40c513,'operator':_0x2db367,'value':_0x5d3123});});});}return _0x24b4a9;};exports[_0x2652('0xe')]=function(_0x3d6ede,_0x17b1d6,_0x417c86){var _0x2dd02f={};if(_0x17b1d6==='DATE'){if(_0x417c86[_0x2652('0xf')]===_0x2652('0x10')){_0x417c86['operator']=_0x2652('0x11');_0x417c86[_0x2652('0x12')]+=','+_0x417c86[_0x2652('0x12')];}else if(_[_0x2652('0x13')](['$gt',_0x2652('0x14')],_0x417c86[_0x2652('0xf')])){_0x417c86[_0x2652('0x12')]=moment(_0x417c86[_0x2652('0x12')])[_0x2652('0x15')](0x1,_0x2652('0x16'))['format']('YYYY-MM-DD');}}if(_0x417c86[_0x2652('0x17')]){_0x17b1d6=_0x417c86[_0x2652('0x17')];_0x2dd02f[_0x2652('0x18')]=_0x2652('0x19')+_0x3d6ede+'.'+_0x417c86[_0x2652('0x1a')]+_0x2652('0x1b')+_0x417c86[_0x2652('0x17')]+')\x20'+parseOperator(_0x417c86[_0x2652('0xf')]);}else{_0x2dd02f['text']=_0x3d6ede+'.'+_0x417c86[_0x2652('0x1a')]+'\x20'+parseOperator(_0x417c86['operator']);}if(_[_0x2652('0x13')](['$ne',_0x2652('0x1c')],_0x417c86[_0x2652('0xf')]))_0x2dd02f[_0x2652('0x18')]='('+_0x2dd02f[_0x2652('0x18')]+'\x20OR\x20'+_0x3d6ede+'.'+_0x417c86['field']+_0x2652('0x1d');_0x2dd02f[_0x2652('0x12')]=parseValue(_0x17b1d6,_0x417c86[_0x2652('0xf')],_0x417c86[_0x2652('0x12')]);return _0x2dd02f;};function parseOperator(_0x56cd4c){var _0x4bdba3;switch(_0x56cd4c){case _0x2652('0x1e'):_0x4bdba3='IN\x20?';break;case'$notIn':_0x4bdba3=_0x2652('0x1f');break;case _0x2652('0x10'):_0x4bdba3=_0x2652('0x20');break;case _0x2652('0x21'):_0x4bdba3='<>\x20?';break;case'$substring':case _0x2652('0x22'):case _0x2652('0x23'):_0x4bdba3=_0x2652('0x24');break;case'$lt':_0x4bdba3=_0x2652('0x25');break;case _0x2652('0x26'):_0x4bdba3=_0x2652('0x27');break;case _0x2652('0x14'):_0x4bdba3=_0x2652('0x28');break;case _0x2652('0x29'):_0x4bdba3='>=\x20?';break;case _0x2652('0x11'):_0x4bdba3=_0x2652('0x2a');break;}return _0x4bdba3;}function parseValue(_0x5a9cd2,_0x4c68bc,_0x35c307){var _0x2df57c={'start':undefined,'end':undefined};switch(_0x4c68bc){case _0x2652('0x1e'):case _0x2652('0x1c'):_0x2df57c[_0x2652('0x2b')]=_0x35c307['split'](',');break;case _0x2652('0x2c'):_0x2df57c[_0x2652('0x2b')]='%'+_0x35c307+'%';break;case _0x2652('0x22'):_0x2df57c[_0x2652('0x2b')]=_0x35c307+'%';break;case _0x2652('0x23'):_0x2df57c['start']='%'+_0x35c307;break;case'$between':var _0x4c9ff1=_0x35c307[_0x2652('0x6')](',');var _0x35c307=_0x4c9ff1[_0x2652('0x9')]();var _0x2ae869=_0x4c9ff1[_0x2652('0x2d')]();if(_0x5a9cd2===_0x2652('0x2e')){_0x35c307=moment(_0x35c307)['utcOffset'](0x0,!![])[_0x2652('0x2f')]();_0x2ae869=moment(_0x2ae869)[_0x2652('0x30')](0x0,!![])['add'](0x17,'hours')[_0x2652('0x15')](0x3b,_0x2652('0x31'))[_0x2652('0x15')](0x3b,'seconds')[_0x2652('0x2f')]();}_0x2df57c={'start':_0x35c307,'end':_0x2ae869};break;default:_0x2df57c[_0x2652('0x2b')]=_0x35c307;break;}return _0x2df57c;} \ No newline at end of file +var _0xeffb=['BETWEEN\x20?\x20AND\x20?','start','$endsWith','shift','pop','utcOffset','hours','minutes','moment','parseSearch','startsWith','[$or]','and','replace','[$and]','split','slice','forEach','match','filter','indexOf','map','push','buildExpression','DATE','operator','$between','value','includes','add','days','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','$in','IN\x20?','$notIn','NOT\x20IN\x20?','$eq','=\x20?','$ne','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','<\x20?','$gt','$lte','<=\x20?','$gte'];(function(_0x5970af,_0x2bf902){var _0x33ef0d=function(_0x2d61a5){while(--_0x2d61a5){_0x5970af['push'](_0x5970af['shift']());}};_0x33ef0d(++_0x2bf902);}(_0xeffb,0x152));var _0xbeff=function(_0x2718c7,_0x5a1636){_0x2718c7=_0x2718c7-0x0;var _0x59d89c=_0xeffb[_0x2718c7];return _0x59d89c;};'use strict';var _=require('lodash');var moment=require(_0xbeff('0x0'));exports[_0xbeff('0x1')]=function(_0x3e8814){var _0x19a558={'conditions':[]};_0x19a558['sqlOperator']=_[_0xbeff('0x2')](_0x3e8814,_0xbeff('0x3'))?'or':_0xbeff('0x4');var _0x3e4940=_0x3e8814[_0xbeff('0x5')](_0xbeff('0x6'),'')[_0xbeff('0x5')](_0xbeff('0x3'),'')[_0xbeff('0x7')]('||');for(var _0x18968e=0x0;_0x18968e<_0x3e4940['length'];_0x18968e++){var _0x1c298c=_0x3e4940[_0x18968e][_0xbeff('0x7')](':=');var _0x40a8a1=_0x1c298c[0x0];var _0x112074=_0x1c298c[_0xbeff('0x8')](0x1);_0x112074[_0xbeff('0x9')](function(_0x4d1aa7){var _0x29322c=_0x4d1aa7[_0xbeff('0x7')]('[')['shift']();var _0x461e56=_0x4d1aa7[_0xbeff('0xa')](/\[(.*?)\]/g);_0x461e56['forEach'](function(_0x11a4b5){var _0x10b4a6=_0x11a4b5[_0xbeff('0x7')]('[')[_0xbeff('0xb')](function(_0x41346d){return _0x41346d[_0xbeff('0xc')](']')>-0x1;})[_0xbeff('0xd')](function(_0x2065d3){return _0x2065d3[_0xbeff('0x7')](']')[0x0];})[0x0];_0x19a558['conditions'][_0xbeff('0xe')]({'field':_0x40a8a1,'operator':_0x29322c,'value':_0x10b4a6});});});}return _0x19a558;};exports[_0xbeff('0xf')]=function(_0x51139d,_0x5f3759,_0x5aabf4){var _0x562696={};if(_0x5f3759===_0xbeff('0x10')){if(_0x5aabf4['operator']==='$eq'){_0x5aabf4[_0xbeff('0x11')]=_0xbeff('0x12');_0x5aabf4[_0xbeff('0x13')]+=','+_0x5aabf4[_0xbeff('0x13')];}else if(_[_0xbeff('0x14')](['$gt','$lte'],_0x5aabf4['operator'])){_0x5aabf4['value']=moment(_0x5aabf4[_0xbeff('0x13')])[_0xbeff('0x15')](0x1,_0xbeff('0x16'))[_0xbeff('0x17')](_0xbeff('0x18'));}}if(_0x5aabf4['castTo']){_0x5f3759=_0x5aabf4[_0xbeff('0x19')];_0x562696[_0xbeff('0x1a')]=_0xbeff('0x1b')+_0x51139d+'.'+_0x5aabf4['field']+_0xbeff('0x1c')+_0x5aabf4[_0xbeff('0x19')]+')\x20'+parseOperator(_0x5aabf4[_0xbeff('0x11')]);}else{_0x562696['text']=_0x51139d+'.'+_0x5aabf4['field']+'\x20'+parseOperator(_0x5aabf4[_0xbeff('0x11')]);}if(_[_0xbeff('0x14')](['$ne','$notIn'],_0x5aabf4[_0xbeff('0x11')]))_0x562696['text']='('+_0x562696[_0xbeff('0x1a')]+'\x20OR\x20'+_0x51139d+'.'+_0x5aabf4[_0xbeff('0x1d')]+'\x20IS\x20NULL)';_0x562696['value']=parseValue(_0x5f3759,_0x5aabf4[_0xbeff('0x11')],_0x5aabf4[_0xbeff('0x13')]);return _0x562696;};function parseOperator(_0x2b66fa){var _0x53c89e;switch(_0x2b66fa){case _0xbeff('0x1e'):_0x53c89e=_0xbeff('0x1f');break;case _0xbeff('0x20'):_0x53c89e=_0xbeff('0x21');break;case _0xbeff('0x22'):_0x53c89e=_0xbeff('0x23');break;case _0xbeff('0x24'):_0x53c89e=_0xbeff('0x25');break;case _0xbeff('0x26'):case _0xbeff('0x27'):case'$endsWith':_0x53c89e=_0xbeff('0x28');break;case _0xbeff('0x29'):_0x53c89e=_0xbeff('0x2a');break;case _0xbeff('0x2b'):_0x53c89e='>\x20?';break;case _0xbeff('0x2c'):_0x53c89e=_0xbeff('0x2d');break;case _0xbeff('0x2e'):_0x53c89e='>=\x20?';break;case'$between':_0x53c89e=_0xbeff('0x2f');break;}return _0x53c89e;}function parseValue(_0x3d67aa,_0x21ffd8,_0x17d46a){var _0x57b3ed={'start':undefined,'end':undefined};switch(_0x21ffd8){case _0xbeff('0x1e'):case _0xbeff('0x20'):_0x57b3ed[_0xbeff('0x30')]=_0x17d46a[_0xbeff('0x7')](',');break;case _0xbeff('0x26'):_0x57b3ed[_0xbeff('0x30')]='%'+_0x17d46a+'%';break;case _0xbeff('0x27'):_0x57b3ed[_0xbeff('0x30')]=_0x17d46a+'%';break;case _0xbeff('0x31'):_0x57b3ed[_0xbeff('0x30')]='%'+_0x17d46a;break;case _0xbeff('0x12'):var _0xa719e9=_0x17d46a[_0xbeff('0x7')](',');var _0x17d46a=_0xa719e9[_0xbeff('0x32')]();var _0x5a9880=_0xa719e9[_0xbeff('0x33')]();if(_0x3d67aa===_0xbeff('0x10')){_0x17d46a=moment(_0x17d46a)[_0xbeff('0x34')](0x0,!![])['format']();_0x5a9880=moment(_0x5a9880)[_0xbeff('0x34')](0x0,!![])['add'](0x17,_0xbeff('0x35'))[_0xbeff('0x15')](0x3b,_0xbeff('0x36'))['add'](0x3b,'seconds')['format']();}_0x57b3ed={'start':_0x17d46a,'end':_0x5a9880};break;default:_0x57b3ed['start']=_0x17d46a;break;}return _0x57b3ed;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 95f0437..708a77d 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 _0xcfcf=['fields','nolimit','order','filters','pick','filter','where','merge','type','VIRTUAL','lower','name','options','lodash','sequelize','moment','parse','keys','split','forOwn','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','uniqueid','isArray','limit','offset','sort','map','indexOf','cast','col','priority','unsigned','substr','DESC','ASC','omit','isEmpty','length','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','replace','push','join','query','$id','model','attributes','intersection'];(function(_0x4a8c61,_0x3942d3){var _0x5e810a=function(_0x48a1ac){while(--_0x48a1ac){_0x4a8c61['push'](_0x4a8c61['shift']());}};_0x5e810a(++_0x3942d3);}(_0xcfcf,0x134));var _0xfcfc=function(_0x4f46f1,_0x2a39b9){_0x4f46f1=_0x4f46f1-0x0;var _0x5e146b=_0xcfcf[_0x4f46f1];return _0x5e146b;};'use strict';var _=require(_0xfcfc('0x0'));var sequelize=require(_0xfcfc('0x1'));var moment=require(_0xfcfc('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2eaf10){var _0x38d7ba=['ne'];try{var _0x7a02d7=JSON[_0xfcfc('0x3')](_0x2eaf10);var _0x3450b3=Object[_0xfcfc('0x4')](_0x7a02d7)[0x0];return _0x38d7ba['includes'](_0x3450b3);}catch(_0x26e82c){return![];}}function getOperatorValue(_0x46a49e){var _0x3fa585=JSON[_0xfcfc('0x3')](_0x46a49e);var _0x35cc71=Object['keys'](_0x3fa585)[0x0];var _0x5248b6=_0x3fa585[_0x35cc71];return{['$'+_0x35cc71]:_0x5248b6};}exports['fields']=function(_0x1dbbde){var _0x4a7c16=null;if(_0x1dbbde){_0x4a7c16=_0x1dbbde[_0xfcfc('0x5')](',');}return _0x4a7c16;};exports['filters']=function(_0x5c53b5,_0x37168e){var _0x28cb2b={};if(!_['isEmpty'](_0x5c53b5)){_[_0xfcfc('0x6')](_0x5c53b5,function(_0x1083be,_0x24d8a5){try{if(_0x37168e){var _0x36ed3f=_['find'](_0x37168e,{'name':_0x24d8a5})||{};if(hasSequelizeOperator(_0x1083be)){_0x28cb2b[_0x24d8a5]=getOperatorValue(_0x1083be);}else if(_0x36ed3f['type']===_0xfcfc('0x7')&&_[_0xfcfc('0x8')](_0x1083be)){var _0x25f760=JSON['parse'](_0x1083be);var _0x1b466b={'$gte':moment(moment(_0x25f760[_0xfcfc('0x9')])[_0xfcfc('0xa')](_0xfcfc('0xb')))[_0xfcfc('0xc')]()[_0xfcfc('0xa')](),'$lte':moment(moment(_0x25f760[_0xfcfc('0xd')])[_0xfcfc('0xa')](_0xfcfc('0xb')))['utc']()[_0xfcfc('0xe')](0x1,'s')[_0xfcfc('0xa')]()};_0x28cb2b[_0x24d8a5]=_0x1b466b;}else if(_0x36ed3f['name']===_0xfcfc('0xf')){_0x28cb2b[_0x24d8a5]=_0x1083be;}else{_0x28cb2b[_0x24d8a5]=_[_0xfcfc('0x10')](_0x1083be)?_0x1083be:JSON['parse'](_0x1083be);}}else{_0x28cb2b[_0x24d8a5]=_['isArray'](_0x1083be)?_0x1083be:JSON[_0xfcfc('0x3')](_0x1083be);}}catch(_0xd239be){_0x28cb2b[_0x24d8a5]=_0x1083be[_0xfcfc('0x5')](',');}});}return _0x28cb2b;};exports[_0xfcfc('0x11')]=function(_0x56b4f1){_0x56b4f1=parseInt(_0x56b4f1,0xa);if(!_0x56b4f1||_0x56b4f1<0x0){_0x56b4f1=LIMIT_VALUE;}return _0x56b4f1;};exports[_0xfcfc('0x12')]=function(_0x15ad76){_0x15ad76=parseInt(_0x15ad76,0xa);if(!_0x15ad76||_0x15ad76<0x0){_0x15ad76=0x0;}return _0x15ad76;};exports[_0xfcfc('0x13')]=function(_0x1ea511){var _0x4ed0d0,_0x5a9039=null;if(_0x1ea511){_0x4ed0d0=_0x1ea511[_0xfcfc('0x5')](',');_0x5a9039=_[_0xfcfc('0x14')](_0x4ed0d0,function(_0x21ab14){if(_0x21ab14[_0xfcfc('0x15')]('-')===0x0){return[_0x21ab14==='priority'?sequelize[_0xfcfc('0x16')](sequelize[_0xfcfc('0x17')](_0xfcfc('0x18')),_0xfcfc('0x19')):_0x21ab14[_0xfcfc('0x1a')](0x1),_0xfcfc('0x1b')];}else{return[_0x21ab14===_0xfcfc('0x18')?sequelize[_0xfcfc('0x16')](sequelize[_0xfcfc('0x17')]('priority'),_0xfcfc('0x19')):_0x21ab14,_0xfcfc('0x1c')];}});}return _0x5a9039;};exports[_0xfcfc('0x1d')]=function(_0x43894e,_0x249af5){if(_[_0xfcfc('0x1e')](_0x43894e)){return _0x43894e;}if(_[_0xfcfc('0x10')](_0x43894e)){for(var _0x16f7e1=0x0;_0x16f7e1<_0x43894e[_0xfcfc('0x1f')];_0x16f7e1+=0x1){_0x43894e[_0x16f7e1]=this[_0xfcfc('0x1d')](_0x43894e[_0x16f7e1],_0x249af5);}return _0x43894e;}if(!_['isObject'](_0x43894e)){return _0x43894e;}if(_[_0xfcfc('0x20')](_0x249af5)){_0x249af5=[_0x249af5];}if(!_['isArray'](_0x249af5)){return _0x43894e;}for(var _0x3daf1e=0x0;_0x3daf1e<_0x249af5[_0xfcfc('0x1f')];_0x3daf1e+=0x1){_['unset'](_0x43894e,_0x249af5[_0x3daf1e]);}for(var _0xf79f4d in _0x43894e){if(_0x43894e[_0xfcfc('0x21')](_0xf79f4d)){_0x43894e[_0xf79f4d]=this[_0xfcfc('0x1d')](_0x43894e[_0xf79f4d],_0x249af5);}}return _0x43894e;};exports[_0xfcfc('0x22')]=function(_0xa67912){return _0xa67912[_0xfcfc('0x23')](RegExp(_0xfcfc('0x24')))?!![]:![];};exports['isEmail']=function(_0x14f774){return _0x14f774['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xfcfc('0x25')]=function(_0x36fab0){var _0x47ae3f=[];_0x36fab0['split'](/[ ,]+/)['forEach'](function(_0x331e47){_0x331e47=_0x331e47[_0xfcfc('0x26')](/([^:]")"+/g,'$1');_0x331e47='+'+_0x331e47+'*';if(_0x331e47['includes']('@'))_0x331e47='\x22'+_0x331e47+'\x22';_0x47ae3f[_0xfcfc('0x27')](_0x331e47);});return _0x47ae3f[_0xfcfc('0x28')]('\x20');};exports['getOptions']=function(_0xaf141a,_0x18a7c1,_0x40035c){var _0x38040d={},_0x226e6d={};if(_0x18a7c1[_0xfcfc('0x29')][_0xfcfc('0x2a')]){_0x18a7c1[_0xfcfc('0x29')]['id']=_0x18a7c1['query'][_0xfcfc('0x2a')];delete _0x18a7c1['query'][_0xfcfc('0x2a')];}_0x38040d[_0xfcfc('0x2b')]=_[_0xfcfc('0x14')](_0xaf141a,'name');_0x38040d[_0xfcfc('0x29')]=_[_0xfcfc('0x4')](_0x18a7c1[_0xfcfc('0x29')]);_0x38040d['filters']=_['intersection'](_0x38040d[_0xfcfc('0x2b')],_0x38040d[_0xfcfc('0x29')]);_0x226e6d[_0xfcfc('0x2c')]=_[_0xfcfc('0x2d')](_0x38040d[_0xfcfc('0x2b')],this[_0xfcfc('0x2e')](_0x18a7c1[_0xfcfc('0x29')][_0xfcfc('0x2e')]));_0x226e6d[_0xfcfc('0x2c')]=_0x226e6d[_0xfcfc('0x2c')]['length']?_0x226e6d['attributes']:_0x38040d['model'];if(!_0x18a7c1[_0xfcfc('0x29')][_0xfcfc('0x21')](_0xfcfc('0x2f'))){_0x226e6d['limit']=this[_0xfcfc('0x11')](_0x18a7c1[_0xfcfc('0x29')]['limit']);_0x226e6d[_0xfcfc('0x12')]=this['offset'](_0x18a7c1[_0xfcfc('0x29')][_0xfcfc('0x12')]);}_0x226e6d[_0xfcfc('0x30')]=this[_0xfcfc('0x13')](_0x18a7c1[_0xfcfc('0x29')][_0xfcfc('0x13')]);_0x226e6d['where']=this[_0xfcfc('0x31')](_[_0xfcfc('0x32')](_0x18a7c1[_0xfcfc('0x29')],_0x38040d[_0xfcfc('0x31')]),_0xaf141a);if(_0x18a7c1[_0xfcfc('0x29')][_0xfcfc('0x33')]){_0x226e6d[_0xfcfc('0x34')]=_[_0xfcfc('0x35')](_0x226e6d[_0xfcfc('0x34')],{'$or':_[_0xfcfc('0x14')](_0xaf141a,function(_0x261db2){if(_0x261db2[_0xfcfc('0x36')]!==_0xfcfc('0x37')){if(_0x40035c){return sequelize[_0xfcfc('0x34')](sequelize['fn'](_0xfcfc('0x38'),sequelize[_0xfcfc('0x17')](_0x261db2[_0xfcfc('0x39')])),{'$like':sequelize['fn'](_0xfcfc('0x38'),'%'+_0x18a7c1['query'][_0xfcfc('0x33')]+'%')});}else{var _0x185251={};_0x185251[_0x261db2[_0xfcfc('0x39')]]={'$like':'%'+_0x18a7c1[_0xfcfc('0x29')]['filter']+'%'};return _0x185251;}}})});}_0x226e6d=_[_0xfcfc('0x35')]({},_0x226e6d,_0x18a7c1[_0xfcfc('0x3a')]);return _0x226e6d;}; \ No newline at end of file +var _0x8c92=['name','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','pick','filter','where','lower','merge','lodash','sequelize','moment','keys','includes','parse','forOwn','type','DATE','format','YYYY-MM-DD','utc','$lte','isArray','split','offset','sort','indexOf','cast','col','priority','substr','DESC','omit','isEmpty','length','isObject','unset','isNumeric','match','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','map'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0x8c92,0x7a));var _0x28c9=function(_0xf62f27,_0x249f1d){_0xf62f27=_0xf62f27-0x0;var _0x4f7985=_0x8c92[_0xf62f27];return _0x4f7985;};'use strict';var _=require(_0x28c9('0x0'));var sequelize=require(_0x28c9('0x1'));var moment=require(_0x28c9('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1bb90a){var _0xab7548=['ne'];try{var _0x3050bb=JSON['parse'](_0x1bb90a);var _0x3b4ef9=Object[_0x28c9('0x3')](_0x3050bb)[0x0];return _0xab7548[_0x28c9('0x4')](_0x3b4ef9);}catch(_0x16e6d3){return![];}}function getOperatorValue(_0x5de80c){var _0xe16047=JSON[_0x28c9('0x5')](_0x5de80c);var _0x46a1d2=Object[_0x28c9('0x3')](_0xe16047)[0x0];var _0x30ac7f=_0xe16047[_0x46a1d2];return{['$'+_0x46a1d2]:_0x30ac7f};}exports['fields']=function(_0x181f73){var _0x4c4f36=null;if(_0x181f73){_0x4c4f36=_0x181f73['split'](',');}return _0x4c4f36;};exports['filters']=function(_0x3817c0,_0xa6729e){var _0x4a32a5={};if(!_['isEmpty'](_0x3817c0)){_[_0x28c9('0x6')](_0x3817c0,function(_0x1bdd84,_0x1bfbfa){try{if(_0xa6729e){var _0xfc2310=_['find'](_0xa6729e,{'name':_0x1bfbfa})||{};if(hasSequelizeOperator(_0x1bdd84)){_0x4a32a5[_0x1bfbfa]=getOperatorValue(_0x1bdd84);}else if(_0xfc2310[_0x28c9('0x7')]===_0x28c9('0x8')&&_['isPlainObject'](_0x1bdd84)){var _0x3b85d8=JSON[_0x28c9('0x5')](_0x1bdd84);var _0x323b1b={'$gte':moment(moment(_0x3b85d8['$gte'])[_0x28c9('0x9')](_0x28c9('0xa')))[_0x28c9('0xb')]()['format'](),'$lte':moment(moment(_0x3b85d8[_0x28c9('0xc')])[_0x28c9('0x9')](_0x28c9('0xa')))[_0x28c9('0xb')]()['subtract'](0x1,'s')[_0x28c9('0x9')]()};_0x4a32a5[_0x1bfbfa]=_0x323b1b;}else if(_0xfc2310['name']==='uniqueid'){_0x4a32a5[_0x1bfbfa]=_0x1bdd84;}else{_0x4a32a5[_0x1bfbfa]=_[_0x28c9('0xd')](_0x1bdd84)?_0x1bdd84:JSON['parse'](_0x1bdd84);}}else{_0x4a32a5[_0x1bfbfa]=_[_0x28c9('0xd')](_0x1bdd84)?_0x1bdd84:JSON[_0x28c9('0x5')](_0x1bdd84);}}catch(_0x2c7579){_0x4a32a5[_0x1bfbfa]=_0x1bdd84[_0x28c9('0xe')](',');}});}return _0x4a32a5;};exports['limit']=function(_0x4e2954){_0x4e2954=parseInt(_0x4e2954,0xa);if(!_0x4e2954||_0x4e2954<0x0){_0x4e2954=LIMIT_VALUE;}return _0x4e2954;};exports[_0x28c9('0xf')]=function(_0x6a75e8){_0x6a75e8=parseInt(_0x6a75e8,0xa);if(!_0x6a75e8||_0x6a75e8<0x0){_0x6a75e8=0x0;}return _0x6a75e8;};exports[_0x28c9('0x10')]=function(_0x57c5fd){var _0x2bb53e,_0x3dc065=null;if(_0x57c5fd){_0x2bb53e=_0x57c5fd['split'](',');_0x3dc065=_['map'](_0x2bb53e,function(_0x2100b9){if(_0x2100b9[_0x28c9('0x11')]('-')===0x0){return[_0x2100b9==='priority'?sequelize[_0x28c9('0x12')](sequelize[_0x28c9('0x13')](_0x28c9('0x14')),'unsigned'):_0x2100b9[_0x28c9('0x15')](0x1),_0x28c9('0x16')];}else{return[_0x2100b9===_0x28c9('0x14')?sequelize[_0x28c9('0x12')](sequelize[_0x28c9('0x13')](_0x28c9('0x14')),'unsigned'):_0x2100b9,'ASC'];}});}return _0x3dc065;};exports[_0x28c9('0x17')]=function(_0x199774,_0x27398d){if(_[_0x28c9('0x18')](_0x199774)){return _0x199774;}if(_[_0x28c9('0xd')](_0x199774)){for(var _0x866421=0x0;_0x866421<_0x199774[_0x28c9('0x19')];_0x866421+=0x1){_0x199774[_0x866421]=this[_0x28c9('0x17')](_0x199774[_0x866421],_0x27398d);}return _0x199774;}if(!_[_0x28c9('0x1a')](_0x199774)){return _0x199774;}if(_['isString'](_0x27398d)){_0x27398d=[_0x27398d];}if(!_[_0x28c9('0xd')](_0x27398d)){return _0x199774;}for(var _0x36ca53=0x0;_0x36ca53<_0x27398d[_0x28c9('0x19')];_0x36ca53+=0x1){_[_0x28c9('0x1b')](_0x199774,_0x27398d[_0x36ca53]);}for(var _0x4620df in _0x199774){if(_0x199774['hasOwnProperty'](_0x4620df)){_0x199774[_0x4620df]=this['omit'](_0x199774[_0x4620df],_0x27398d);}}return _0x199774;};exports[_0x28c9('0x1c')]=function(_0x8fe07f){return _0x8fe07f[_0x28c9('0x1d')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x1cd5b3){return _0x1cd5b3[_0x28c9('0x1d')](/^\S+@\S+$/)?!![]:![];};exports[_0x28c9('0x1e')]=function(_0x274016){var _0x495324=[];_0x274016['split'](/[ ,]+/)[_0x28c9('0x1f')](function(_0xc9db6f){_0xc9db6f=_0xc9db6f[_0x28c9('0x20')](/([^:]")"+/g,'$1');_0xc9db6f='+'+_0xc9db6f+'*';if(_0xc9db6f[_0x28c9('0x4')]('@'))_0xc9db6f='\x22'+_0xc9db6f+'\x22';_0x495324[_0x28c9('0x21')](_0xc9db6f);});return _0x495324[_0x28c9('0x22')]('\x20');};exports[_0x28c9('0x23')]=function(_0x526587,_0x5dcddb,_0x5df323){var _0x2736ec={},_0x7d8976={};if(_0x5dcddb[_0x28c9('0x24')][_0x28c9('0x25')]){_0x5dcddb[_0x28c9('0x24')]['id']=_0x5dcddb['query'][_0x28c9('0x25')];delete _0x5dcddb[_0x28c9('0x24')][_0x28c9('0x25')];}_0x2736ec[_0x28c9('0x26')]=_[_0x28c9('0x27')](_0x526587,_0x28c9('0x28'));_0x2736ec['query']=_['keys'](_0x5dcddb[_0x28c9('0x24')]);_0x2736ec[_0x28c9('0x29')]=_[_0x28c9('0x2a')](_0x2736ec['model'],_0x2736ec[_0x28c9('0x24')]);_0x7d8976[_0x28c9('0x2b')]=_['intersection'](_0x2736ec[_0x28c9('0x26')],this[_0x28c9('0x2c')](_0x5dcddb['query'][_0x28c9('0x2c')]));_0x7d8976['attributes']=_0x7d8976[_0x28c9('0x2b')][_0x28c9('0x19')]?_0x7d8976[_0x28c9('0x2b')]:_0x2736ec[_0x28c9('0x26')];if(!_0x5dcddb['query'][_0x28c9('0x2d')](_0x28c9('0x2e'))){_0x7d8976[_0x28c9('0x2f')]=this[_0x28c9('0x2f')](_0x5dcddb[_0x28c9('0x24')][_0x28c9('0x2f')]);_0x7d8976[_0x28c9('0xf')]=this[_0x28c9('0xf')](_0x5dcddb[_0x28c9('0x24')][_0x28c9('0xf')]);}_0x7d8976[_0x28c9('0x30')]=this['sort'](_0x5dcddb[_0x28c9('0x24')]['sort']);_0x7d8976['where']=this[_0x28c9('0x29')](_[_0x28c9('0x31')](_0x5dcddb['query'],_0x2736ec['filters']),_0x526587);if(_0x5dcddb[_0x28c9('0x24')][_0x28c9('0x32')]){_0x7d8976[_0x28c9('0x33')]=_['merge'](_0x7d8976[_0x28c9('0x33')],{'$or':_['map'](_0x526587,function(_0x17975f){if(_0x17975f[_0x28c9('0x7')]!=='VIRTUAL'){if(_0x5df323){return sequelize[_0x28c9('0x33')](sequelize['fn'](_0x28c9('0x34'),sequelize[_0x28c9('0x13')](_0x17975f[_0x28c9('0x28')])),{'$like':sequelize['fn']('lower','%'+_0x5dcddb[_0x28c9('0x24')][_0x28c9('0x32')]+'%')});}else{var _0x15d1f9={};_0x15d1f9[_0x17975f['name']]={'$like':'%'+_0x5dcddb[_0x28c9('0x24')]['filter']+'%'};return _0x15d1f9;}}})});}_0x7d8976=_[_0x28c9('0x35')]({},_0x7d8976,_0x5dcddb['options']);return _0x7d8976;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index c9eb950..411a3b0 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83c6=['path','passport','cors','./environment','../mysqldb','default','get','env','production','set','root','development','test','appPath','join','client','use','json\x20replacer','toISOString','split','static','/server/views','html','ejs','renderFile','view\x20engine','50mb','initialize','body-parser','cookie-parser'];(function(_0x29f959,_0x1cdf73){var _0x39d606=function(_0x277fef){while(--_0x277fef){_0x29f959['push'](_0x29f959['shift']());}};_0x39d606(++_0x1cdf73);}(_0x83c6,0x76));var _0x683c=function(_0x2e011c,_0x537dad){_0x2e011c=_0x2e011c-0x0;var _0x479194=_0x83c6[_0x2e011c];return _0x479194;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x683c('0x0'));var methodOverride=require('method-override');var cookieParser=require(_0x683c('0x1'));var errorHandler=require('errorhandler');var path=require(_0x683c('0x2'));var passport=require(_0x683c('0x3'));var cors=require(_0x683c('0x4'));var moment=require('moment');var config=require(_0x683c('0x5'));var db=require(_0x683c('0x6'))['db'];exports[_0x683c('0x7')]=function(_0x1abab6){var _0x56f43f=_0x1abab6[_0x683c('0x8')](_0x683c('0x9'));if(_0x56f43f===_0x683c('0xa')){_0x1abab6[_0x683c('0xb')]('appPath',path['join'](config[_0x683c('0xc')],'public'));}if(_0x56f43f===_0x683c('0xd')||_0x56f43f===_0x683c('0xe')){_0x1abab6['set'](_0x683c('0xf'),path[_0x683c('0x10')](config[_0x683c('0xc')],_0x683c('0x11')));_0x1abab6[_0x683c('0x12')](errorHandler());}_0x1abab6[_0x683c('0xb')](_0x683c('0x13'),function(_0x1a3876,_0x481ec5){if(this[_0x1a3876]instanceof Date){_0x481ec5=this[_0x1a3876][_0x683c('0x14')]()[_0x683c('0x15')]('.')[0x0]+'Z';}return _0x481ec5;});_0x1abab6[_0x683c('0x12')](express[_0x683c('0x16')](_0x1abab6[_0x683c('0x8')]('appPath')));_0x1abab6[_0x683c('0xb')]('views',config[_0x683c('0xc')]+_0x683c('0x17'));_0x1abab6['engine'](_0x683c('0x18'),require(_0x683c('0x19'))[_0x683c('0x1a')]);_0x1abab6[_0x683c('0xb')](_0x683c('0x1b'),'html');_0x1abab6['use'](bodyParser['urlencoded']({'limit':_0x683c('0x1c'),'extended':!![]}));_0x1abab6[_0x683c('0x12')](bodyParser['json']({'limit':'50mb'}));_0x1abab6[_0x683c('0x12')](cors());_0x1abab6[_0x683c('0x12')](methodOverride());_0x1abab6[_0x683c('0x12')](cookieParser());_0x1abab6[_0x683c('0x12')](passport[_0x683c('0x1d')]());}; \ No newline at end of file +var _0x4432=['cors','./environment','../mysqldb','default','get','set','appPath','join','root','public','client','use','json\x20replacer','toISOString','split','static','views','/server/views','html','ejs','view\x20engine','50mb','json','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','passport'];(function(_0x28829c,_0xba7837){var _0x6e88f5=function(_0x33cae5){while(--_0x33cae5){_0x28829c['push'](_0x28829c['shift']());}};_0x6e88f5(++_0xba7837);}(_0x4432,0x158));var _0x2443=function(_0x29bca4,_0x3e76de){_0x29bca4=_0x29bca4-0x0;var _0x560231=_0x4432[_0x29bca4];return _0x560231;};'use strict';var express=require(_0x2443('0x0'));var favicon=require(_0x2443('0x1'));var bodyParser=require(_0x2443('0x2'));var methodOverride=require(_0x2443('0x3'));var cookieParser=require(_0x2443('0x4'));var errorHandler=require(_0x2443('0x5'));var path=require(_0x2443('0x6'));var passport=require(_0x2443('0x7'));var cors=require(_0x2443('0x8'));var moment=require('moment');var config=require(_0x2443('0x9'));var db=require(_0x2443('0xa'))['db'];exports[_0x2443('0xb')]=function(_0x5a8718){var _0x5f4caa=_0x5a8718[_0x2443('0xc')]('env');if(_0x5f4caa==='production'){_0x5a8718[_0x2443('0xd')](_0x2443('0xe'),path[_0x2443('0xf')](config[_0x2443('0x10')],_0x2443('0x11')));}if(_0x5f4caa==='development'||_0x5f4caa==='test'){_0x5a8718[_0x2443('0xd')](_0x2443('0xe'),path['join'](config['root'],_0x2443('0x12')));_0x5a8718[_0x2443('0x13')](errorHandler());}_0x5a8718['set'](_0x2443('0x14'),function(_0x80a0a3,_0x4e7fe0){if(this[_0x80a0a3]instanceof Date){_0x4e7fe0=this[_0x80a0a3][_0x2443('0x15')]()[_0x2443('0x16')]('.')[0x0]+'Z';}return _0x4e7fe0;});_0x5a8718[_0x2443('0x13')](express[_0x2443('0x17')](_0x5a8718[_0x2443('0xc')](_0x2443('0xe'))));_0x5a8718['set'](_0x2443('0x18'),config['root']+_0x2443('0x19'));_0x5a8718['engine'](_0x2443('0x1a'),require(_0x2443('0x1b'))['renderFile']);_0x5a8718[_0x2443('0xd')](_0x2443('0x1c'),_0x2443('0x1a'));_0x5a8718[_0x2443('0x13')](bodyParser['urlencoded']({'limit':_0x2443('0x1d'),'extended':!![]}));_0x5a8718[_0x2443('0x13')](bodyParser[_0x2443('0x1e')]({'limit':_0x2443('0x1d')}));_0x5a8718[_0x2443('0x13')](cors());_0x5a8718[_0x2443('0x13')](methodOverride());_0x5a8718['use'](cookieParser());_0x5a8718['use'](passport[_0x2443('0x1f')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index f6eb3bd..5bb6b0d 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 _0xef6f=['concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','model','join','createHash','md5','update','digest','getUuid','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','hex','substring','crypto','execSync','../environment','networkInterfaces','orderBy','length','filter','family','IPv4'];(function(_0x5d7709,_0x1740c9){var _0x1736e6=function(_0x5614f8){while(--_0x5614f8){_0x5d7709['push'](_0x5d7709['shift']());}};_0x1736e6(++_0x1740c9);}(_0xef6f,0x1a4));var _0xfef6=function(_0x8523dd,_0x55e600){_0x8523dd=_0x8523dd-0x0;var _0x12835a=_0xef6f[_0x8523dd];return _0x12835a;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xfef6('0x0'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0xfef6('0x1')];var config=require(_0xfef6('0x2'));function getInterfaces(){var _0x582895=[];var _0x18ae5e=os[_0xfef6('0x3')]();var _0x326445=_[_0xfef6('0x4')](_['keys'](_0x18ae5e));for(var _0x5604d8=0x0;_0x5604d8<_0x326445[_0xfef6('0x5')];_0x5604d8++){var _0x2e0b4f=_0x18ae5e[_0x326445[_0x5604d8]][_0xfef6('0x6')](function(_0xddb4a3){return _0xddb4a3[_0xfef6('0x7')]===_0xfef6('0x8')&&_0xddb4a3['internal']===![];});_0x582895=_0x582895[_0xfef6('0x9')](_0x2e0b4f);}return _0x582895;}function getFirstInterface(){var _0x144095=_[_0xfef6('0xa')](getInterfaces());return{'macAddress':_0x144095&&_0x144095[_0xfef6('0xb')]?_0x144095[_0xfef6('0xb')]:_0xfef6('0xc'),'ipAddress':_0x144095&&_0x144095[_0xfef6('0xd')]?_0x144095['address']:_0xfef6('0xe')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x40e245=_[_0xfef6('0x4')](os[_0xfef6('0xf')]()['map'](function(_0x479f64){return _0x479f64[_0xfef6('0x10')];}))[_0xfef6('0x11')](':');return crypto[_0xfef6('0x12')](_0xfef6('0x13'))[_0xfef6('0x14')](_0x40e245)[_0xfef6('0x15')]('hex');}exports[_0xfef6('0x16')]=function(){var _0x5e7579=os['platform']();var _0x20c629=/[0-9a-f-]{36}/;if(config[_0xfef6('0x17')]&&_0x20c629[_0xfef6('0x18')](config[_0xfef6('0x17')])){return config[_0xfef6('0x17')];}else if(_0x5e7579===_0xfef6('0x19')){return exec(_0xfef6('0x1a'),{'encoding':_0xfef6('0x1b')})[_0xfef6('0x1c')]('\x0d\x0a','');}else{var _0x30129e=getFirstInterface();var _0x55df27=getCPUhash();var _0x5a1465=_0x55df27+'|'+os[_0xfef6('0x1d')]()+'|'+_0x30129e['macAddress']+'|'+_0x30129e[_0xfef6('0x1e')];var _0x285bfd=crypto['createHash'](_0xfef6('0x13'))[_0xfef6('0x14')](_0x5a1465)[_0xfef6('0x15')](_0xfef6('0x1f'));return _0x285bfd[_0xfef6('0x20')](0x0,0x8)+'-'+_0x285bfd[_0xfef6('0x20')](0x8,0xc)+'-'+_0x285bfd[_0xfef6('0x20')](0xc,0x10)+'-'+_0x285bfd[_0xfef6('0x20')](0x10,0x14)+'-'+_0x285bfd[_0xfef6('0x20')](0x14);}}; \ No newline at end of file +var _0x2c86=['digest','hex','getUuid','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid','hostname','macAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync','../environment','keys','family','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','join','createHash','md5'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x2c86,0x136));var _0x62c8=function(_0x44a437,_0x51228a){_0x44a437=_0x44a437-0x0;var _0x3f3b2c=_0x2c86[_0x44a437];return _0x3f3b2c;};'use strict';var _=require(_0x62c8('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x62c8('0x1'));var exec=require(_0x62c8('0x2'))[_0x62c8('0x3')];var config=require(_0x62c8('0x4'));function getInterfaces(){var _0x373ed3=[];var _0x3aa44e=os['networkInterfaces']();var _0x19ed63=_['orderBy'](_[_0x62c8('0x5')](_0x3aa44e));for(var _0x3108b4=0x0;_0x3108b4<_0x19ed63['length'];_0x3108b4++){var _0x4f9272=_0x3aa44e[_0x19ed63[_0x3108b4]]['filter'](function(_0x881591){return _0x881591[_0x62c8('0x6')]==='IPv4'&&_0x881591[_0x62c8('0x7')]===![];});_0x373ed3=_0x373ed3[_0x62c8('0x8')](_0x4f9272);}return _0x373ed3;}function getFirstInterface(){var _0x3cab9d=_[_0x62c8('0x9')](getInterfaces());return{'macAddress':_0x3cab9d&&_0x3cab9d[_0x62c8('0xa')]?_0x3cab9d[_0x62c8('0xa')]:_0x62c8('0xb'),'ipAddress':_0x3cab9d&&_0x3cab9d[_0x62c8('0xc')]?_0x3cab9d[_0x62c8('0xc')]:_0x62c8('0xd')};}exports[_0x62c8('0xe')]=getFirstInterface;function getCPUhash(){var _0x1f9690=_[_0x62c8('0xf')](os[_0x62c8('0x10')]()['map'](function(_0x177360){return _0x177360['model'];}))[_0x62c8('0x11')](':');return crypto[_0x62c8('0x12')](_0x62c8('0x13'))['update'](_0x1f9690)[_0x62c8('0x14')](_0x62c8('0x15'));}exports[_0x62c8('0x16')]=function(){var _0xe2f20f=os[_0x62c8('0x17')]();var _0x37c892=/[0-9a-f-]{36}/;if(config[_0x62c8('0x18')]&&_0x37c892[_0x62c8('0x19')](config[_0x62c8('0x18')])){return config['licenseToken'];}else if(_0xe2f20f==='win32'){return exec(_0x62c8('0x1a'),{'encoding':'utf8'})['replace']('\x0d\x0a','');}else{var _0x5ba89e=getFirstInterface();var _0x3ec56a=getCPUhash();var _0x301f2a=_0x3ec56a+'|'+os[_0x62c8('0x1b')]()+'|'+_0x5ba89e[_0x62c8('0x1c')]+'|'+_0x5ba89e['ipAddress'];var _0x330c86=crypto[_0x62c8('0x12')](_0x62c8('0x13'))['update'](_0x301f2a)[_0x62c8('0x14')](_0x62c8('0x15'));return _0x330c86['substring'](0x0,0x8)+'-'+_0x330c86[_0x62c8('0x1d')](0x8,0xc)+'-'+_0x330c86[_0x62c8('0x1d')](0xc,0x10)+'-'+_0x330c86[_0x62c8('0x1d')](0x10,0x14)+'-'+_0x330c86[_0x62c8('0x1d')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 6f9b3ea..2ebc6ce 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 _0x6e3d=['YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','default','util','bluebird','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','then','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s'];(function(_0x469052,_0x4d1654){var _0x5883c7=function(_0x4a6d96){while(--_0x4a6d96){_0x469052['push'](_0x469052['shift']());}};_0x5883c7(++_0x4d1654);}(_0x6e3d,0xd7));var _0xd6e3=function(_0x587ba2,_0x42eb40){_0x587ba2=_0x587ba2-0x0;var _0x50ec73=_0x6e3d[_0x587ba2];return _0x50ec73;};'use strict';var util=require(_0xd6e3('0x0'));var moment=require('moment');var rp=require('request-promise');var BPromise=require(_0xd6e3('0x1'));var pkginfo=require('pkginfo')(module,_0xd6e3('0x2'));var db=require(_0xd6e3('0x3'))['db'];var encryptor=require(_0xd6e3('0x4'));var hardware=require(_0xd6e3('0x5'));var logger=require(_0xd6e3('0x6'))(_0xd6e3('0x7'));var HOST=_0xd6e3('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1e702a){return new BPromise(function(_0x5cab86,_0x29d3c1){var _0x26a1b9=util[_0xd6e3('0x9')](_0xd6e3('0xa'),HOST,_0x1e702a,module[_0xd6e3('0xb')][_0xd6e3('0x2')]);if(oldToken){_0x26a1b9=util[_0xd6e3('0x9')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x1e702a,module[_0xd6e3('0xb')]['version'],oldToken);}var _0x274b53={'uri':_0x26a1b9,'method':_0xd6e3('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x274b53)[_0xd6e3('0xd')](function(_0x49033c){_0x5cab86(_0x49033c);})['catch'](function(_0x34a556){_0x29d3c1(_0x34a556);});});}function manageLicense(_0x49309d,_0x19b14f){var _0x58de63=_0x19b14f[_0xd6e3('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x58de63[_0xd6e3('0xf')]!==_0x49309d&&!_0x58de63[_0xd6e3('0x10')]){oldToken=_0x58de63['data1'];}httpRequest(_0x49309d)['then'](function(_0x481677){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x481677[_0xd6e3('0x11')]){isOldTokenSent=![];if(!_0x58de63[_0xd6e3('0x7')]&&_0x58de63[_0xd6e3('0x7')]!=_0x481677['license']||_0x58de63[_0xd6e3('0x7')]&&_0x58de63[_0xd6e3('0x10')]){logger[_0xd6e3('0x12')](_0xd6e3('0x13'));}if(_0x58de63[_0xd6e3('0x7')]&&!_0x58de63['data2']&&_0x58de63[_0xd6e3('0x7')]!=_0x481677[_0xd6e3('0x7')]){logger[_0xd6e3('0x12')](_0xd6e3('0x14'));}if(_0x58de63[_0xd6e3('0x7')]&&!_0x58de63['data2']&&_0x58de63[_0xd6e3('0x7')]==_0x481677[_0xd6e3('0x7')]){return _0x19b14f;}return _0x19b14f[_0xd6e3('0x15')]({'data1':_0x49309d,'data2':null,'license':_0x481677[_0xd6e3('0x7')]});}else{if(_0x481677[_0xd6e3('0x7')]||_0x58de63[_0xd6e3('0x7')]){if(!_0x58de63[_0xd6e3('0x10')]){if(_0x58de63[_0xd6e3('0xf')]==_0x49309d){GRAY_PERIOD_REASON=_0xd6e3('0x16');logger[_0xd6e3('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xd6e3('0x17');logger['info'](_0xd6e3('0x18'),_0x58de63[_0xd6e3('0xf')],_0x49309d);}logger[_0xd6e3('0x12')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xd6e3('0x9')](_0xd6e3('0x19')));return _0x19b14f[_0xd6e3('0x15')]({'data2':encryptor['encryptString'](moment()[_0xd6e3('0x9')](_0xd6e3('0x19')))});}else{if(moment()[_0xd6e3('0x1a')](encryptor[_0xd6e3('0x1b')](_0x58de63['data2']),_0xd6e3('0x1c'))>DAYS){logger[_0xd6e3('0x12')](_0xd6e3('0x1d'),moment()[_0xd6e3('0x9')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x19b14f[_0xd6e3('0x15')]({'data1':_0x49309d,'data2':null,'license':null});}}}else{if(_0x58de63[_0xd6e3('0xf')]!=_0x49309d){logger[_0xd6e3('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x58de63[_0xd6e3('0xf')],_0x49309d);return _0x19b14f[_0xd6e3('0x15')]({'data1':_0x49309d,'data2':null,'license':null});}}}return _0x19b14f;})[_0xd6e3('0xd')](function(_0x423105){_0x19b14f=_0x423105;})['catch'](function(_0x3ec478){logger[_0xd6e3('0x1e')](_0x3ec478[_0xd6e3('0x1f')]);})[_0xd6e3('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0xd6e3('0x21')](),_0x19b14f);},TIME);});}function defaultLicense(){var _0x33e6f5=hardware['getUuid']();if(_0x33e6f5){return db[_0xd6e3('0x22')][_0xd6e3('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x33e6f5}})[_0xd6e3('0x24')](function(_0x4a2d1b,_0x2ec5fa){logger[_0xd6e3('0x12')](_0xd6e3('0x25'),_0x33e6f5);manageLicense(_0x33e6f5,_0x4a2d1b);})[_0xd6e3('0x26')](function(_0x4dc7d1){logger[_0xd6e3('0x1e')](_0x4dc7d1[_0xd6e3('0x1f')]);});}}exports[_0xd6e3('0x27')]=defaultLicense; \ No newline at end of file +var _0x1fc6=['catch','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','diff','DEMO\x20START\x20AT\x20%s','then','error','finally','getUuid','License','findOrCreate','spread','message','default','util','moment','request-promise','bluebird','version','../../components/encryptor','./hardware','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET'];(function(_0x1b1596,_0x4543d1){var _0x5bf36b=function(_0x41a471){while(--_0x41a471){_0x1b1596['push'](_0x1b1596['shift']());}};_0x5bf36b(++_0x4543d1);}(_0x1fc6,0xe3));var _0x61fc=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0x1fc6[_0x4b6830];return _0x239e4a;};'use strict';var util=require(_0x61fc('0x0'));var moment=require(_0x61fc('0x1'));var rp=require(_0x61fc('0x2'));var BPromise=require(_0x61fc('0x3'));var pkginfo=require('pkginfo')(module,_0x61fc('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x61fc('0x5'));var hardware=require(_0x61fc('0x6'));var logger=require('../logger')('license');var HOST=_0x61fc('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x33226f){return new BPromise(function(_0x173edc,_0x4d165b){var _0x2447db=util[_0x61fc('0x8')](_0x61fc('0x9'),HOST,_0x33226f,module[_0x61fc('0xa')][_0x61fc('0x4')]);if(oldToken){_0x2447db=util['format'](_0x61fc('0xb'),HOST,_0x33226f,module['exports'][_0x61fc('0x4')],oldToken);}var _0x3f2fbd={'uri':_0x2447db,'method':_0x61fc('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x3f2fbd)['then'](function(_0x52ca8a){_0x173edc(_0x52ca8a);})[_0x61fc('0xd')](function(_0xd432bf){_0x4d165b(_0xd432bf);});});}function manageLicense(_0x2f1dcf,_0x149386){var _0x562994=_0x149386['get']({'plain':!![]});if(!isOldTokenSent&&_0x562994[_0x61fc('0xe')]!==_0x2f1dcf&&!_0x562994[_0x61fc('0xf')]){oldToken=_0x562994['data1'];}httpRequest(_0x2f1dcf)['then'](function(_0x38a9a1){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x38a9a1[_0x61fc('0x10')]){isOldTokenSent=![];if(!_0x562994[_0x61fc('0x11')]&&_0x562994[_0x61fc('0x11')]!=_0x38a9a1[_0x61fc('0x11')]||_0x562994[_0x61fc('0x11')]&&_0x562994[_0x61fc('0xf')]){logger[_0x61fc('0x12')](_0x61fc('0x13'));}if(_0x562994[_0x61fc('0x11')]&&!_0x562994['data2']&&_0x562994[_0x61fc('0x11')]!=_0x38a9a1[_0x61fc('0x11')]){logger['info'](_0x61fc('0x14'));}if(_0x562994[_0x61fc('0x11')]&&!_0x562994['data2']&&_0x562994['license']==_0x38a9a1['license']){return _0x149386;}return _0x149386[_0x61fc('0x15')]({'data1':_0x2f1dcf,'data2':null,'license':_0x38a9a1[_0x61fc('0x11')]});}else{if(_0x38a9a1[_0x61fc('0x11')]||_0x562994['license']){if(!_0x562994['data2']){if(_0x562994['data1']==_0x2f1dcf){GRAY_PERIOD_REASON=_0x61fc('0x16');logger[_0x61fc('0x12')](_0x61fc('0x17'));}else{GRAY_PERIOD_REASON=_0x61fc('0x18');logger['info'](_0x61fc('0x19'),_0x562994[_0x61fc('0xe')],_0x2f1dcf);}logger[_0x61fc('0x12')](_0x61fc('0x1a'),GRAY_PERIOD_REASON[_0x61fc('0x1b')](),moment()[_0x61fc('0x8')]('YYYY-MM-DD\x20HH:mm'));return _0x149386[_0x61fc('0x15')]({'data2':encryptor[_0x61fc('0x1c')](moment()[_0x61fc('0x8')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x61fc('0x1d')](encryptor['decryptString'](_0x562994['data2']),'days')>DAYS){logger[_0x61fc('0x12')](_0x61fc('0x1e'),moment()[_0x61fc('0x8')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x149386[_0x61fc('0x15')]({'data1':_0x2f1dcf,'data2':null,'license':null});}}}else{if(_0x562994['data1']!=_0x2f1dcf){logger[_0x61fc('0x12')](_0x61fc('0x19'),_0x562994['data1'],_0x2f1dcf);return _0x149386[_0x61fc('0x15')]({'data1':_0x2f1dcf,'data2':null,'license':null});}}}return _0x149386;})[_0x61fc('0x1f')](function(_0x179338){_0x149386=_0x179338;})['catch'](function(_0x1b6d50){logger[_0x61fc('0x20')](_0x1b6d50['message']);})[_0x61fc('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x61fc('0x22')](),_0x149386);},TIME);});}function defaultLicense(){var _0xc69b24=hardware[_0x61fc('0x22')]();if(_0xc69b24){return db[_0x61fc('0x23')][_0x61fc('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0xc69b24}})[_0x61fc('0x25')](function(_0x29d904,_0x3abd32){logger[_0x61fc('0x12')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0xc69b24);manageLicense(_0xc69b24,_0x29d904);})[_0x61fc('0xd')](function(_0x3386c5){logger[_0x61fc('0x20')](_0x3386c5[_0x61fc('0x26')]);});}}exports[_0x61fc('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index ebdf5c1..c4107e6 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 _0xc154=['split','decryptString','format','parse','demo','uuid','machineUuid','add','disabled','message','User','findAll','sequelize','COUNT','col','role','count','admin','telephone','users','forEach','user','countBy','catch','exports','util','moment','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','find','defaults','then','data1','license','License\x20key\x20value\x20not\x20found'];(function(_0x1625e3,_0x26b9ed){var _0x3fdea6=function(_0x4f0d1f){while(--_0x4f0d1f){_0x1625e3['push'](_0x1625e3['shift']());}};_0x3fdea6(++_0x26b9ed);}(_0xc154,0xb9));var _0x4c15=function(_0x5de5f1,_0x59f49a){_0x5de5f1=_0x5de5f1-0x0;var _0x303549=_0xc154[_0x5de5f1];return _0x303549;};'use strict';var util=require(_0x4c15('0x0'));var _=require('lodash');var moment=require(_0x4c15('0x1'));var BPromise=require(_0x4c15('0x2'));var hardware=require(_0x4c15('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x4c15('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4c15('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x4c15('0x6'),'machineUuid':hardware[_0x4c15('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4c15('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x4c15('0x8'),'machineUuid':hardware[_0x4c15('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1c6baa){return new BPromise(function(_0x1947db,_0x56569c){return db['License'][_0x4c15('0x9')](_[_0x4c15('0xa')](_0x1c6baa,{'raw':!![],'where':{'id':0x1}}))[_0x4c15('0xb')](function(_0x104407){return checkLicense(_0x104407,null);})['then'](function(_0x77fe00){_0x1947db(_0x77fe00);return;})['catch'](function(_0x101b75){_0x56569c(_0x101b75);});});}function checkLicense(_0x9eccdc,_0x2056dc){if(!_0x9eccdc){demoLicense['uuid']=_0x9eccdc[_0x4c15('0xc')];return demoLicense;}try{var _0x27b34f=_0x2056dc||_0x9eccdc[_0x4c15('0xd')];if(_['isEmpty'](_0x27b34f)){throw new Error(_0x4c15('0xe'));}var _0x424037=_0x9eccdc[_0x4c15('0xc')];var _0x2d3403=_0x9eccdc['data2'];var _0x31c347=_0x424037['split']('-')[0x4];var _0x18b444=_0x424037[_0x4c15('0xf')]('-')[0x0];var _0x2db500=encryptor[_0x4c15('0x10')](_0x27b34f,util[_0x4c15('0x11')]('%s:%s:%s',_0x31c347,_0x424037,_0x18b444));var _0x161b40=JSON[_0x4c15('0x12')](_0x2db500);_0x161b40[_0x4c15('0x13')]=![];_0x161b40[_0x4c15('0x14')]=_0x424037;_0x161b40[_0x4c15('0x15')]=hardware['getUuid']();if(_0x2d3403){var _0x5dd73b=encryptor[_0x4c15('0x10')](_0x2d3403);_0x161b40['gray']=_0x5dd73b;_0x161b40['deadline']=moment(_0x5dd73b)[_0x4c15('0x16')](0x7,'days')['format']();_0x161b40['grayReason']=_0x161b40[_0x4c15('0x14')]!=_0x161b40['machineUuid']?'changed':_0x4c15('0x17');}return _0x161b40;}catch(_0x1f51fe){breakingLicense[_0x4c15('0x14')]=_0x9eccdc['data1'];breakingLicense[_0x4c15('0x18')]=_0x1f51fe[_0x4c15('0x18')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2a2774,_0x4a23e3){getLicense()[_0x4c15('0xb')](function(_0x12c2bf){return db[_0x4c15('0x19')][_0x4c15('0x1a')]({'attributes':['role',[db[_0x4c15('0x1b')]['fn'](_0x4c15('0x1c'),db['sequelize'][_0x4c15('0x1d')](_0x4c15('0x1e'))),_0x4c15('0x1f')]],'group':_0x4c15('0x1e'),'where':{'role':{'$or':[_0x4c15('0x20'),'user',_0x4c15('0x21')]}},'raw':!![]})[_0x4c15('0xb')](function(_0x3feb7a){var _0x5e3018={'user':_0x12c2bf[_0x4c15('0x22')]||0x0,'telephone':_0x12c2bf['telephones']||0x0};_0x3feb7a[_0x4c15('0x23')](function(_0x5848fe){var _0x1c9a47=_0x5848fe[_0x4c15('0x1e')]==='admin'?_0x4c15('0x24'):_0x5848fe['role'];_0x5e3018[_0x1c9a47]-=_0x5848fe['count'];if(_0x5e3018[_0x1c9a47]<0x0)_0x5e3018[_0x1c9a47]=0x0;});_0x2a2774(_0x5e3018);return;});})['catch'](function(_0x2bfa0f){_0x4a23e3(_0x2bfa0f);});});}function checkUserLimits(_0x37eb6c){return new BPromise(function(_0x2c6d8b,_0x1889d8){getLimits()['then'](function(_0x3a270f){var _0x5b5bbf=_['pick'](_[_0x4c15('0x25')](_0x37eb6c,'role'),[_0x4c15('0x20'),_0x4c15('0x24'),_0x4c15('0x21')]);var _0x5acea1=(_0x5b5bbf[_0x4c15('0x20')]||0x0)+(_0x5b5bbf[_0x4c15('0x24')]||0x0);var _0xa84bfb=_0x5b5bbf[_0x4c15('0x21')]||0x0;if(_0x5acea1>_0x3a270f[_0x4c15('0x24')])return _0x1889d8('License\x20limit\x20reached\x20for\x20users');if(_0xa84bfb>_0x3a270f[_0x4c15('0x21')])return _0x1889d8('License\x20limit\x20reached\x20for\x20telephones');return _0x2c6d8b();})[_0x4c15('0x26')](function(_0x2ee8e9){_0x1889d8(_0x2ee8e9);});});}module[_0x4c15('0x27')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x4fbd=['defaults','then','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','%s:%s:%s','parse','demo','deadline','days','format','machineUuid','changed','disabled','message','User','findAll','role','sequelize','COUNT','col','count','admin','user','users','catch','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','Demo\x20license','2027-01-01T00:00:00.000Z','getUuid','License','find'];(function(_0x1d689b,_0x5596a1){var _0x1c7bdb=function(_0x59e14d){while(--_0x59e14d){_0x1d689b['push'](_0x1d689b['shift']());}};_0x1c7bdb(++_0x5596a1);}(_0x4fbd,0x1d5));var _0xd4fb=function(_0x5adf29,_0x194122){_0x5adf29=_0x5adf29-0x0;var _0x40443b=_0x4fbd[_0x5adf29];return _0x40443b;};'use strict';var util=require(_0xd4fb('0x0'));var _=require(_0xd4fb('0x1'));var moment=require(_0xd4fb('0x2'));var BPromise=require(_0xd4fb('0x3'));var hardware=require(_0xd4fb('0x4'));var encryptor=require(_0xd4fb('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xd4fb('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd4fb('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xd4fb('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2d0e1e){return new BPromise(function(_0x5bf7db,_0xf51dc1){return db[_0xd4fb('0x9')][_0xd4fb('0xa')](_[_0xd4fb('0xb')](_0x2d0e1e,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x2d1e31){return checkLicense(_0x2d1e31,null);})[_0xd4fb('0xc')](function(_0x22fdb5){_0x5bf7db(_0x22fdb5);return;})['catch'](function(_0x4671d1){_0xf51dc1(_0x4671d1);});});}function checkLicense(_0xf3d79b,_0x22d5f0){if(!_0xf3d79b){demoLicense[_0xd4fb('0xd')]=_0xf3d79b[_0xd4fb('0xe')];return demoLicense;}try{var _0x2e33a8=_0x22d5f0||_0xf3d79b[_0xd4fb('0xf')];if(_[_0xd4fb('0x10')](_0x2e33a8)){throw new Error(_0xd4fb('0x11'));}var _0x1989f1=_0xf3d79b['data1'];var _0x2196b4=_0xf3d79b[_0xd4fb('0x12')];var _0x167c7c=_0x1989f1[_0xd4fb('0x13')]('-')[0x4];var _0x9cc586=_0x1989f1[_0xd4fb('0x13')]('-')[0x0];var _0x3ebfa3=encryptor[_0xd4fb('0x14')](_0x2e33a8,util['format'](_0xd4fb('0x15'),_0x167c7c,_0x1989f1,_0x9cc586));var _0xfc42a9=JSON[_0xd4fb('0x16')](_0x3ebfa3);_0xfc42a9[_0xd4fb('0x17')]=![];_0xfc42a9['uuid']=_0x1989f1;_0xfc42a9['machineUuid']=hardware[_0xd4fb('0x8')]();if(_0x2196b4){var _0x3c1955=encryptor[_0xd4fb('0x14')](_0x2196b4);_0xfc42a9['gray']=_0x3c1955;_0xfc42a9[_0xd4fb('0x18')]=moment(_0x3c1955)['add'](0x7,_0xd4fb('0x19'))[_0xd4fb('0x1a')]();_0xfc42a9['grayReason']=_0xfc42a9[_0xd4fb('0xd')]!=_0xfc42a9[_0xd4fb('0x1b')]?_0xd4fb('0x1c'):_0xd4fb('0x1d');}return _0xfc42a9;}catch(_0x1d6541){breakingLicense[_0xd4fb('0xd')]=_0xf3d79b[_0xd4fb('0xe')];breakingLicense[_0xd4fb('0x1e')]=_0x1d6541[_0xd4fb('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x397c0a,_0xaf2fe2){getLicense()[_0xd4fb('0xc')](function(_0x1c808b){return db[_0xd4fb('0x1f')][_0xd4fb('0x20')]({'attributes':[_0xd4fb('0x21'),[db[_0xd4fb('0x22')]['fn'](_0xd4fb('0x23'),db['sequelize'][_0xd4fb('0x24')](_0xd4fb('0x21'))),_0xd4fb('0x25')]],'group':_0xd4fb('0x21'),'where':{'role':{'$or':[_0xd4fb('0x26'),_0xd4fb('0x27'),'telephone']}},'raw':!![]})[_0xd4fb('0xc')](function(_0x2d68ed){var _0x2c069b={'user':_0x1c808b[_0xd4fb('0x28')]||0x0,'telephone':_0x1c808b['telephones']||0x0};_0x2d68ed['forEach'](function(_0x410eae){var _0x516539=_0x410eae[_0xd4fb('0x21')]===_0xd4fb('0x26')?_0xd4fb('0x27'):_0x410eae['role'];_0x2c069b[_0x516539]-=_0x410eae[_0xd4fb('0x25')];if(_0x2c069b[_0x516539]<0x0)_0x2c069b[_0x516539]=0x0;});_0x397c0a(_0x2c069b);return;});})[_0xd4fb('0x29')](function(_0x16e90c){_0xaf2fe2(_0x16e90c);});});}function checkUserLimits(_0x36df60){return new BPromise(function(_0x4d40a8,_0x2e01c0){getLimits()[_0xd4fb('0xc')](function(_0x12082d){var _0x31a2e4=_[_0xd4fb('0x2a')](_[_0xd4fb('0x2b')](_0x36df60,_0xd4fb('0x21')),[_0xd4fb('0x26'),'user',_0xd4fb('0x2c')]);var _0x4b65e3=(_0x31a2e4[_0xd4fb('0x26')]||0x0)+(_0x31a2e4[_0xd4fb('0x27')]||0x0);var _0x197b4f=_0x31a2e4[_0xd4fb('0x2c')]||0x0;if(_0x4b65e3>_0x12082d[_0xd4fb('0x27')])return _0x2e01c0(_0xd4fb('0x2d'));if(_0x197b4f>_0x12082d[_0xd4fb('0x2c')])return _0x2e01c0(_0xd4fb('0x2e'));return _0x4d40a8();})[_0xd4fb('0x29')](function(_0x57d9ca){_0x2e01c0(_0x57d9ca);});});}module[_0xd4fb('0x2f')]={'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 dcfd7a6..36b611d 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 _0x1c9a=['myappanuglar-secret','secret','exports'];(function(_0x37d280,_0x14318a){var _0x43e923=function(_0x1da6e4){while(--_0x1da6e4){_0x37d280['push'](_0x37d280['shift']());}};_0x43e923(++_0x14318a);}(_0x1c9a,0x98));var _0xa1c9=function(_0x261ab3,_0x477995){_0x261ab3=_0x261ab3-0x0;var _0x457d50=_0x1c9a[_0x261ab3];return _0x457d50;};'use strict';module[_0xa1c9('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xa1c9('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xa1c9('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x0b0e=['secret','exports','myappanuglar-secret'];(function(_0x1a8ce2,_0x4a6bac){var _0x56c87f=function(_0x399932){while(--_0x399932){_0x1a8ce2['push'](_0x1a8ce2['shift']());}};_0x56c87f(++_0x4a6bac);}(_0x0b0e,0x187));var _0xe0b0=function(_0x44fef1,_0x132cf4){_0x44fef1=_0x44fef1-0x0;var _0x3c3a04=_0x0b0e[_0x44fef1];return _0x3c3a04;};'use strict';module[_0xe0b0('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xe0b0('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xe0b0('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 958ce58..9ba8c04 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb177=['Console','env','debugLevel','moment','util','path','INFO','join','/var','log','xcally','format','%s-%s.log','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','transports','File','%s-%s','error','info'];(function(_0x14474a,_0x5be492){var _0x1f8b71=function(_0x4a7acd){while(--_0x4a7acd){_0x14474a['push'](_0x14474a['shift']());}};_0x1f8b71(++_0x5be492);}(_0xb177,0x1a3));var _0x7b17=function(_0x56a110,_0x4bf523){_0x56a110=_0x56a110-0x0;var _0x1c41e0=_0xb177[_0x56a110];return _0x1c41e0;};'use strict';var moment=require(_0x7b17('0x0'));var winston=require('winston');var util=require(_0x7b17('0x1'));var path=require(_0x7b17('0x2'));var debugLevel=_0x7b17('0x3');function filename(_0x23080d,_0x59e9ad){return path[_0x7b17('0x4')](_0x7b17('0x5'),_0x7b17('0x6'),_0x7b17('0x7'),util[_0x7b17('0x8')](_0x7b17('0x9'),_0x23080d,_0x59e9ad));}function formatter(_0x4c27c3,_0x3d393d){_0x3d393d[_0x7b17('0xa')]=_0x3d393d['message'][_0x7b17('0xb')](/@@{/g,_0x7b17('0xc'))['replace'](/}@@/g,'}}}')['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x7b17('0x8')](_0x7b17('0xd'),moment()[_0x7b17('0x8')](_0x7b17('0xe')),_0x3d393d[_0x7b17('0xf')][_0x7b17('0x10')](),_0x4c27c3,_0x3d393d[_0x7b17('0xa')]);}module[_0x7b17('0x11')]=function(_0xd1f9da){return new winston['Logger']({'transports':[new winston[(_0x7b17('0x12'))][(_0x7b17('0x13'))]({'name':util[_0x7b17('0x8')](_0x7b17('0x14'),_0xd1f9da,_0x7b17('0x15')),'filename':filename(_0xd1f9da,_0x7b17('0x15')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x11c532){return formatter(_0xd1f9da,_0x11c532);}}),new winston[(_0x7b17('0x12'))][(_0x7b17('0x13'))]({'name':util['format'](_0x7b17('0x14'),_0xd1f9da,_0x7b17('0x16')),'filename':filename(_0xd1f9da,_0x7b17('0x16')),'level':_0x7b17('0x16'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2459c6){return formatter(_0xd1f9da,_0x2459c6);}}),new winston[(_0x7b17('0x12'))][(_0x7b17('0x17'))]({'level':process[_0x7b17('0x18')][_0x7b17('0x19')]||debugLevel,'json':![],'formatter':function(_0x31222a){return formatter(_0xd1f9da,_0x31222a);}})]});}; \ No newline at end of file +var _0xacb7=['{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','File','error','%s-%s','info','Console','debugLevel','winston','util','path','INFO','join','log','xcally','format','%s-%s.log','message','replace'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xacb7,0x72));var _0x7acb=function(_0x45f850,_0x3795d0){_0x45f850=_0x45f850-0x0;var _0x47e576=_0xacb7[_0x45f850];return _0x47e576;};'use strict';var moment=require('moment');var winston=require(_0x7acb('0x0'));var util=require(_0x7acb('0x1'));var path=require(_0x7acb('0x2'));var debugLevel=_0x7acb('0x3');function filename(_0xe7afe9,_0x2869b6){return path[_0x7acb('0x4')]('/var',_0x7acb('0x5'),_0x7acb('0x6'),util[_0x7acb('0x7')](_0x7acb('0x8'),_0xe7afe9,_0x2869b6));}function formatter(_0x254685,_0x10664d){_0x10664d[_0x7acb('0x9')]=_0x10664d[_0x7acb('0x9')][_0x7acb('0xa')](/@@{/g,_0x7acb('0xb'))[_0x7acb('0xa')](/}@@/g,_0x7acb('0xc'))[_0x7acb('0xa')](/@{/g,'{{')['replace'](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x7acb('0x7')](_0x7acb('0xd')),_0x10664d[_0x7acb('0xe')][_0x7acb('0xf')](),_0x254685,_0x10664d[_0x7acb('0x9')]);}module[_0x7acb('0x10')]=function(_0x13ad64){return new winston[(_0x7acb('0x11'))]({'transports':[new winston[(_0x7acb('0x12'))][(_0x7acb('0x13'))]({'name':util[_0x7acb('0x7')]('%s-%s',_0x13ad64,_0x7acb('0x14')),'filename':filename(_0x13ad64,'error'),'level':_0x7acb('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xd5dc9d){return formatter(_0x13ad64,_0xd5dc9d);}}),new winston[(_0x7acb('0x12'))][(_0x7acb('0x13'))]({'name':util['format'](_0x7acb('0x15'),_0x13ad64,_0x7acb('0x16')),'filename':filename(_0x13ad64,_0x7acb('0x16')),'level':_0x7acb('0x16'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2a4e8e){return formatter(_0x13ad64,_0x2a4e8e);}}),new winston[(_0x7acb('0x12'))][(_0x7acb('0x17'))]({'level':process['env'][_0x7acb('0x18')]||debugLevel,'json':![],'formatter':function(_0x16f24b){return formatter(_0x13ad64,_0x16f24b);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index a563ab3..076e84d 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 _0x0cf7=['../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js'];(function(_0x1e2687,_0x42644d){var _0xe8545f=function(_0x26f9d0){while(--_0x26f9d0){_0x1e2687['push'](_0x1e2687['shift']());}};_0xe8545f(++_0x42644d);}(_0x0cf7,0x164));var _0x70cf=function(_0x59bd17,_0x2b0d69){_0x59bd17=_0x59bd17-0x0;var _0x155547=_0x0cf7[_0x59bd17];return _0x155547;};'use strict';var path=require(_0x70cf('0x0'));var os=require('os');var config={'apps':[{'name':_0x70cf('0x1'),'script':path[_0x70cf('0x2')](__dirname,_0x70cf('0x3'))},{'name':_0x70cf('0x4'),'script':path[_0x70cf('0x2')](__dirname,_0x70cf('0x5'))},{'name':_0x70cf('0x6'),'script':path[_0x70cf('0x2')](__dirname,_0x70cf('0x7'))},{'name':'email','script':path[_0x70cf('0x2')](__dirname,_0x70cf('0x8'))},{'name':_0x70cf('0x9'),'script':path['join'](__dirname,'../../services/routing/index.js')},{'name':_0x70cf('0xa'),'script':path[_0x70cf('0x2')](__dirname,_0x70cf('0xb'))}]};module[_0x70cf('0xc')]=config; \ No newline at end of file +var _0xcc26=['agi','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports','path','express','../../services/express/index.js','ami','join','../../services/ami/index.js'];(function(_0xd3bc07,_0x3a11a5){var _0x10aa85=function(_0xb8f14e){while(--_0xb8f14e){_0xd3bc07['push'](_0xd3bc07['shift']());}};_0x10aa85(++_0x3a11a5);}(_0xcc26,0x1ce));var _0x6cc2=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xcc26[_0x342700];return _0x53406f;};'use strict';var path=require(_0x6cc2('0x0'));var os=require('os');var config={'apps':[{'name':_0x6cc2('0x1'),'script':path['join'](__dirname,_0x6cc2('0x2'))},{'name':_0x6cc2('0x3'),'script':path[_0x6cc2('0x4')](__dirname,_0x6cc2('0x5'))},{'name':_0x6cc2('0x6'),'script':path['join'](__dirname,_0x6cc2('0x7'))},{'name':'email','script':path[_0x6cc2('0x4')](__dirname,_0x6cc2('0x8'))},{'name':_0x6cc2('0x9'),'script':path[_0x6cc2('0x4')](__dirname,_0x6cc2('0xa'))},{'name':_0x6cc2('0xb'),'script':path[_0x6cc2('0x4')](__dirname,'../../services/xdr/index.js')}]};module[_0x6cc2('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 611a28b..5f57687 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 _0xc30b=['describe','delete','dump','saved','bluebird','./config','connect','start','then','disconnect','restart','list'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc30b,0x154));var _0xbc30=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xc30b[_0xe73080];return _0x12cbc4;};'use strict';var pm2=require('pm2');var BPromise=require(_0xbc30('0x0'));var config=require(_0xbc30('0x1'));function connect(){return new BPromise(function(_0x1c6bed,_0x2600f4){return pm2[_0xbc30('0x2')](function(_0x33d966){if(_0x33d966){return _0x2600f4(_0x33d966);}return _0x1c6bed('connected');});});};exports[_0xbc30('0x3')]=function(_0x23ba1d){return connect()[_0xbc30('0x4')](function(){return new BPromise(function(_0x4d8f33,_0x2d6df6){return pm2[_0xbc30('0x3')](_0x23ba1d,function(_0xfa8fa7,_0x30d6f2){if(_0xfa8fa7){return _0x2d6df6(_0xfa8fa7);}pm2[_0xbc30('0x5')]();return _0x4d8f33(_0x30d6f2);});});});};exports['stop']=function(_0x1e717c){return connect()[_0xbc30('0x4')](function(){return new BPromise(function(_0x42e24,_0x225812){return pm2['stop'](_0x1e717c,function(_0x56759e,_0x2aafd3){if(_0x56759e){return _0x225812(_0x56759e);}pm2['disconnect']();return _0x42e24(_0x2aafd3);});});});};exports[_0xbc30('0x6')]=function(_0x529b68){return connect()[_0xbc30('0x4')](function(){return new BPromise(function(_0x7b38c3,_0x3d2fd0){return pm2['restart'](_0x529b68,function(_0x59b704,_0x4b3b95){if(_0x59b704){return _0x3d2fd0(_0x59b704);}pm2[_0xbc30('0x5')]();return _0x7b38c3(_0x4b3b95);});});});};exports[_0xbc30('0x7')]=function(){return connect()[_0xbc30('0x4')](function(){return new BPromise(function(_0x1fdab1,_0x5e9663){return pm2['list'](function(_0x41b3bc,_0x1d9725){if(_0x41b3bc){return _0x5e9663(_0x41b3bc);}pm2[_0xbc30('0x5')]();return _0x1fdab1(_0x1d9725);});});});};exports['describe']=function(_0x2f51e9){return connect()[_0xbc30('0x4')](function(){return new BPromise(function(_0x2f8672,_0x52831e){return pm2[_0xbc30('0x8')](_0x2f51e9,function(_0x487187,_0x2efc19){if(_0x487187){return _0x52831e(_0x487187);}pm2[_0xbc30('0x5')]();return _0x2f8672(_0x2efc19);});});});};exports[_0xbc30('0x9')]=function(_0x46454d){return connect()[_0xbc30('0x4')](function(){return new BPromise(function(_0x5ee270,_0x1a9ba1){return pm2['delete'](_0x46454d,function(_0x2da445,_0x192040){if(_0x2da445){return _0x1a9ba1(_0x2da445);}pm2['disconnect']();return _0x5ee270(_0x192040);});});});};exports[_0xbc30('0xa')]=function(){return connect()[_0xbc30('0x4')](function(){return new BPromise(function(_0x5ec6ab,_0x123f59){return pm2[_0xbc30('0xa')](function(_0x5d6b3f){if(_0x5d6b3f){return _0x123f59(_0x5d6b3f);}return _0x5ec6ab(_0xbc30('0xb'));});});});}; \ No newline at end of file +var _0x9faa=['restart','list','describe','delete','dump','saved','bluebird','./config','start','then','disconnect','stop'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x9faa,0x17a));var _0xa9fa=function(_0x22a0c6,_0x584023){_0x22a0c6=_0x22a0c6-0x0;var _0x3ca121=_0x9faa[_0x22a0c6];return _0x3ca121;};'use strict';var pm2=require('pm2');var BPromise=require(_0xa9fa('0x0'));var config=require(_0xa9fa('0x1'));function connect(){return new BPromise(function(_0xfeec95,_0x3e28f9){return pm2['connect'](function(_0x56a4ea){if(_0x56a4ea){return _0x3e28f9(_0x56a4ea);}return _0xfeec95('connected');});});};exports[_0xa9fa('0x2')]=function(_0x1cfaf0){return connect()[_0xa9fa('0x3')](function(){return new BPromise(function(_0x362440,_0x471683){return pm2[_0xa9fa('0x2')](_0x1cfaf0,function(_0x1f0184,_0x4f6ec0){if(_0x1f0184){return _0x471683(_0x1f0184);}pm2[_0xa9fa('0x4')]();return _0x362440(_0x4f6ec0);});});});};exports[_0xa9fa('0x5')]=function(_0x21360a){return connect()['then'](function(){return new BPromise(function(_0x5df748,_0x131239){return pm2[_0xa9fa('0x5')](_0x21360a,function(_0x324d4f,_0x34e28d){if(_0x324d4f){return _0x131239(_0x324d4f);}pm2[_0xa9fa('0x4')]();return _0x5df748(_0x34e28d);});});});};exports[_0xa9fa('0x6')]=function(_0x10595e){return connect()['then'](function(){return new BPromise(function(_0x1952f0,_0x1dbed3){return pm2['restart'](_0x10595e,function(_0x3a45dd,_0x366fb8){if(_0x3a45dd){return _0x1dbed3(_0x3a45dd);}pm2['disconnect']();return _0x1952f0(_0x366fb8);});});});};exports[_0xa9fa('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x45f7e5,_0x22913c){return pm2[_0xa9fa('0x7')](function(_0x19f973,_0x2a71a5){if(_0x19f973){return _0x22913c(_0x19f973);}pm2[_0xa9fa('0x4')]();return _0x45f7e5(_0x2a71a5);});});});};exports['describe']=function(_0xe5e567){return connect()['then'](function(){return new BPromise(function(_0x4994c9,_0x4719d0){return pm2[_0xa9fa('0x8')](_0xe5e567,function(_0x4a54db,_0x23bcfd){if(_0x4a54db){return _0x4719d0(_0x4a54db);}pm2[_0xa9fa('0x4')]();return _0x4994c9(_0x23bcfd);});});});};exports['delete']=function(_0x46c962){return connect()[_0xa9fa('0x3')](function(){return new BPromise(function(_0x5d8eea,_0x2924c1){return pm2[_0xa9fa('0x9')](_0x46c962,function(_0x4a4e27,_0x5a732b){if(_0x4a4e27){return _0x2924c1(_0x4a4e27);}pm2['disconnect']();return _0x5d8eea(_0x5a732b);});});});};exports[_0xa9fa('0xa')]=function(){return connect()[_0xa9fa('0x3')](function(){return new BPromise(function(_0x777168,_0x5ccb29){return pm2[_0xa9fa('0xa')](function(_0x42c0d6){if(_0x42c0d6){return _0x5ccb29(_0x42c0d6);}return _0x777168(_0xa9fa('0xb'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index d796e11..020779e 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 _0x171c=['redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','findAll','lastMsgAt','subtract','length','info','[CHAT]\x20Interactions\x20to\x20close:','ChatInteraction','update','format','join','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','../../mysqldb','../logger'];(function(_0x25491b,_0x44edfa){var _0x15206d=function(_0x5ae1c0){while(--_0x5ae1c0){_0x25491b['push'](_0x25491b['shift']());}};_0x15206d(++_0x44edfa);}(_0x171c,0xb1));var _0xc171=function(_0x56a602,_0x11e8ed){_0x56a602=_0x56a602-0x0;var _0x2e9df3=_0x171c[_0x56a602];return _0x2e9df3;};'use strict';var _=require(_0xc171('0x0'));var moment=require(_0xc171('0x1'));var Redis=require(_0xc171('0x2'));var util=require('util');var config=require('../../config/environment');var db=require(_0xc171('0x3'))['db'];var logger=require(_0xc171('0x4'))('schedule');config[_0xc171('0x5')]=_[_0xc171('0x6')](config[_0xc171('0x5')],{'host':_0xc171('0x7'),'port':0x18eb});var io=require(_0xc171('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x56a87c=0x0;var _0x1736ba=[];return db[_0xc171('0x9')][_0xc171('0xa')]({'raw':!![],'attributes':['id',_0xc171('0xb')],'where':{'id':0x1}})[_0xc171('0xc')](function(_0x18e0ac){_0x56a87c=_0x18e0ac[_0xc171('0xb')];if(_0x56a87c){return db['ChatInteraction'][_0xc171('0xd')]({'raw':!![],'attributes':['id',_0xc171('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xc171('0xf')](_0x18e0ac[_0xc171('0xb')],'minutes')}}});}else{return[];}})['then'](function(_0x34b088){if(_0x34b088&&_0x34b088[_0xc171('0x10')]){_0x1736ba=_['map'](_0x34b088||[],'id');logger[_0xc171('0x11')](_0xc171('0x12'),_0x1736ba['join']());return db[_0xc171('0x13')][_0xc171('0x14')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xc171('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1736ba}});}})[_0xc171('0xc')](function(){if(_0x1736ba&&_0x1736ba[_0xc171('0x10')]){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x1736ba[_0xc171('0x16')]());for(var _0x56ef25=0x0;_0x56ef25<_0x1736ba[_0xc171('0x10')];_0x56ef25++){io['emit']('chatInteraction:update',{'id':_0x1736ba[_0x56ef25],'closed':!![]});}}})['catch'](function(_0x3c4cfa){logger[_0xc171('0x17')](_0xc171('0x18'),_0x3c4cfa?util['inspect'](_0x3c4cfa,{'showHidden':![],'depth':null}):'');});}exports[_0xc171('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x3721=['map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../logger','schedule','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','findAll','lastMsgAt','minutes','length'];(function(_0x2fd99d,_0x214192){var _0x328b60=function(_0x3f847d){while(--_0x3f847d){_0x2fd99d['push'](_0x2fd99d['shift']());}};_0x328b60(++_0x214192);}(_0x3721,0x1ae));var _0x1372=function(_0x4e3079,_0xa938e4){_0x4e3079=_0x4e3079-0x0;var _0x51aa46=_0x3721[_0x4e3079];return _0x51aa46;};'use strict';var _=require(_0x1372('0x0'));var moment=require(_0x1372('0x1'));var Redis=require(_0x1372('0x2'));var util=require(_0x1372('0x3'));var config=require(_0x1372('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x1372('0x5'))(_0x1372('0x6'));config[_0x1372('0x7')]=_['defaults'](config[_0x1372('0x7')],{'host':_0x1372('0x8'),'port':0x18eb});var io=require(_0x1372('0x9'))(new Redis(config[_0x1372('0x7')]));function closeInteractions(){var _0x3487b8=0x0;var _0x345ab1=[];return db[_0x1372('0xa')][_0x1372('0xb')]({'raw':!![],'attributes':['id',_0x1372('0xc')],'where':{'id':0x1}})[_0x1372('0xd')](function(_0x47bab8){_0x3487b8=_0x47bab8[_0x1372('0xc')];if(_0x3487b8){return db['ChatInteraction'][_0x1372('0xe')]({'raw':!![],'attributes':['id',_0x1372('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x47bab8[_0x1372('0xc')],_0x1372('0x10'))}}});}else{return[];}})['then'](function(_0x343da2){if(_0x343da2&&_0x343da2[_0x1372('0x11')]){_0x345ab1=_[_0x1372('0x12')](_0x343da2||[],'id');logger[_0x1372('0x13')](_0x1372('0x14'),_0x345ab1[_0x1372('0x15')]());return db[_0x1372('0x16')][_0x1372('0x17')]({'closeReason':_0x1372('0x18'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x1372('0x19'))},{'where':{'id':_0x345ab1}});}})['then'](function(){if(_0x345ab1&&_0x345ab1['length']){logger[_0x1372('0x13')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x345ab1[_0x1372('0x15')]());for(var _0x18e295=0x0;_0x18e295<_0x345ab1[_0x1372('0x11')];_0x18e295++){io[_0x1372('0x1a')](_0x1372('0x1b'),{'id':_0x345ab1[_0x18e295],'closed':!![]});}}})[_0x1372('0x1c')](function(_0x40a56e){logger[_0x1372('0x1d')](_0x1372('0x1e'),_0x40a56e?util['inspect'](_0x40a56e,{'showHidden':![],'depth':null}):'');});}exports[_0x1372('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 6c947e7..a33a420 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 _0x25d8=['join','../../files/reports','savename','basename','extname','existsSync','status','Sent','message','attachments','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','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','error','error\x20mail','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','then','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','MailServerOut','keys','jobs','toString','keyBy','intersection','difference','exists','stop','deleteJob','delete\x20cron','toRun','length','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','stop\x20cron','update','update\x20cron','util','lodash','moment','cron-job-manager','../logger','schedule','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount','host','port','secure','authentication','user','pass','format','\x22%s\x22\x20<%s>','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber'];(function(_0x427aa3,_0x1171d9){var _0x12f535=function(_0x3b36fa){while(--_0x3b36fa){_0x427aa3['push'](_0x427aa3['shift']());}};_0x12f535(++_0x1171d9);}(_0x25d8,0x140));var _0x825d=function(_0x32e7fb,_0x457034){_0x32e7fb=_0x32e7fb-0x0;var _0x53fbc1=_0x25d8[_0x32e7fb];return _0x53fbc1;};'use strict';var fs=require('fs');var util=require(_0x825d('0x0'));var path=require('path');var _=require(_0x825d('0x1'));var moment=require(_0x825d('0x2'));var CronJobManager=require(_0x825d('0x3'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x825d('0x4'))(_0x825d('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0x825d('0x6')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x36e5e8,_0x36b7f6){return function(){logger[_0x825d('0x7')](_0x825d('0x8'),_0x36e5e8[_0x825d('0x9')]);var _0x30f936=!![];var _0x1290e9={'tls':{'rejectUnauthorized':![]}};if(_0x36e5e8['MailAccount'][_0x825d('0xa')]['service']){_0x1290e9[_0x825d('0xb')]=_0x36e5e8[_0x825d('0xc')][_0x825d('0xa')][_0x825d('0xb')];}else{_0x1290e9[_0x825d('0xd')]=_0x36e5e8[_0x825d('0xc')][_0x825d('0xa')]['host'];_0x1290e9[_0x825d('0xe')]=_0x36e5e8[_0x825d('0xc')][_0x825d('0xa')][_0x825d('0xe')];_0x1290e9[_0x825d('0xf')]=_0x36e5e8[_0x825d('0xc')][_0x825d('0xa')][_0x825d('0xf')];}if(_0x36e5e8[_0x825d('0xc')]['Smtp'][_0x825d('0x10')]){_0x1290e9['auth']={'user':_0x36e5e8[_0x825d('0xc')][_0x825d('0xa')][_0x825d('0x11')],'pass':_0x36e5e8[_0x825d('0xc')][_0x825d('0xa')][_0x825d('0x12')]};}var _0x56899f={'account':_0x1290e9,'message':{'from':util[_0x825d('0x13')](_0x825d('0x14'),_0x36e5e8[_0x825d('0xc')]['name'],_0x36e5e8['MailAccount']['email']||_0x36e5e8['MailAccount'][_0x825d('0xa')][_0x825d('0x11')]),'to':_0x36e5e8[_0x825d('0x9')],'cc':_0x36e5e8['cc'],'bcc':_0x36e5e8['bcc'],'subject':util[_0x825d('0x13')](_0x825d('0x15'),_0x36b7f6[_0x825d('0x16')],_0x36e5e8[_0x825d('0x17')],_0x36e5e8['subtractUnit'])}};var _0x6823b0=path[_0x825d('0x18')](__dirname,_0x825d('0x19'));var _0x2d4ed5=_0x36b7f6[_0x825d('0x1a')];var _0x1aef8a=util[_0x825d('0x13')]('%s.%s',path[_0x825d('0x1b')](_0x36b7f6[_0x825d('0x1a')],path[_0x825d('0x1c')](_0x36b7f6[_0x825d('0x1a')])),'zip');var _0x6af092=path[_0x825d('0x18')](_0x6823b0,_0x2d4ed5);var _0x22c635=path[_0x825d('0x18')](_0x6823b0,_0x1aef8a);if(fs[_0x825d('0x1d')](_0x6af092)){_0x36b7f6[_0x825d('0x1e')]=_0x825d('0x1f');_0x56899f[_0x825d('0x20')][_0x825d('0x21')]=[{'filename':_0x2d4ed5,'path':_0x6af092}];_0x56899f[_0x825d('0x20')][_0x825d('0x22')]=util['format'](_0x825d('0x23'),JSON[_0x825d('0x24')](_0x36b7f6,null,0x2));}else if(fs[_0x825d('0x1d')](_0x22c635)){_0x36b7f6[_0x825d('0x1e')]='Sent';_0x56899f['message'][_0x825d('0x21')]=[{'filename':_0x1aef8a,'path':_0x22c635}];}else{_0x56899f[_0x825d('0x20')]['text']=_0x825d('0x25');if(!_0x36e5e8[_0x825d('0x26')]){_0x30f936=![];logger[_0x825d('0x7')](_0x825d('0x27'));}}if(_0x30f936){return client['request'](_0x825d('0x28'),_0x56899f)['then'](function(_0xdef04e){if(_0xdef04e[_0x825d('0x29')]){return logger[_0x825d('0x29')](_0x825d('0x2a'),JSON[_0x825d('0x24')](_0xdef04e));}return logger['info'](_0x825d('0x2b'));})['catch'](function(_0x55fa51){return logger[_0x825d('0x29')](_0x825d('0x2a'),JSON[_0x825d('0x24')](_0x55fa51));});}};}function handleError(){return function(_0x82f60c){return logger[_0x825d('0x29')](JSON[_0x825d('0x24')](_0x82f60c));};}function handleResult(_0x699411){return function(_0x2498c3){logger[_0x825d('0x7')](_0x825d('0x2c'),JSON[_0x825d('0x24')](_0x2498c3));if(_0x699411[_0x825d('0xc')]&&_0x699411[_0x825d('0xc')][_0x825d('0xa')]&&!_[_0x825d('0x2d')](_0x699411['email'])){setTimeout(handleSendEmail(_0x699411,_0x2498c3),0x3c*0x3e8);}};}function handleJob(_0x393af2){return function(){try{if(_[_0x825d('0x2d')](_0x393af2[_0x825d('0x17')])){return logger['info'](_0x825d('0x2e'));}if(_[_0x825d('0x2d')](_0x393af2[_0x825d('0x2f')])){return logger[_0x825d('0x7')](_0x825d('0x30'));}var _0x32a20b={'startDate':moment()[_0x825d('0x31')](_0x393af2[_0x825d('0x17')],_0x393af2[_0x825d('0x2f')])[_0x825d('0x13')](_0x825d('0x32')),'endDate':moment()[_0x825d('0x13')](_0x825d('0x32')),'type':'scheduled','output':_0x393af2[_0x825d('0x33')],'name':_0x393af2[_0x825d('0x16')]};if(!_[_0x825d('0x2d')](_0x393af2['DefaultReportId'])){logger[_0x825d('0x7')](_0x825d('0x34'),_0x393af2['DefaultReportId']);return analyticDefaultReportController[_0x825d('0x35')]({'id':_0x393af2[_0x825d('0x36')]},_0x32a20b)[_0x825d('0x37')](handleResult(_0x393af2))[_0x825d('0x38')](handleError());}if(!_[_0x825d('0x2d')](_0x393af2[_0x825d('0x39')])){logger[_0x825d('0x7')](_0x825d('0x3a'),_0x393af2[_0x825d('0x39')]);return analyticCustomReportController[_0x825d('0x35')]({'id':_0x393af2['CustomReportId']},_0x32a20b)[_0x825d('0x37')](handleResult(_0x393af2))[_0x825d('0x38')](handleError());}}catch(_0x549085){logger[_0x825d('0x29')](JSON['stringify'](_0x549085));}return logger[_0x825d('0x7')]('no\x20report\x20id');};}function getJobs(_0x1f8d7c){var _0x4ecc26={};if(_0x1f8d7c){_0x4ecc26['id']=_0x1f8d7c;}return db['Schedule']['findAll']({'where':_0x4ecc26,'include':[{'model':db[_0x825d('0xc')],'attributes':['id',_0x825d('0x16'),_0x825d('0x9')],'include':[{'model':db[_0x825d('0x3b')],'as':_0x825d('0xa')}]}]})[_0x825d('0x37')](function(_0xb43608){var _0x283ce0=_[_0x825d('0x3c')](manager[_0x825d('0x3d')]);var _0x55017c=_['map'](_0xb43608,function(_0x58cd6f){return _0x58cd6f['id'][_0x825d('0x3e')]();});var _0x3306d3=_[_0x825d('0x3f')](_0xb43608,function(_0x5e8d8b){return _0x5e8d8b['id']['toString']();});var _0x186ea1=_0x1f8d7c?_0x55017c:_['difference'](_0x55017c,_0x283ce0);var _0xd9af40=_[_0x825d('0x40')](_0x55017c,_0x283ce0);var _0x83911e=_[_0x825d('0x41')](_0x283ce0,_0x55017c);var _0x892d94;var _0x4531d0;for(_0x892d94=0x0;_0x892d94<_0x83911e['length']&&!_0x1f8d7c;_0x892d94+=0x1){_0x4531d0=_0x83911e[_0x892d94][_0x825d('0x3e')]();if(manager[_0x825d('0x42')](_0x4531d0)){manager[_0x825d('0x43')](_0x4531d0);manager[_0x825d('0x44')](_0x4531d0);logger[_0x825d('0x7')](_0x825d('0x45'),_0x4531d0);}}logger['info'](_0x825d('0x46'),JSON[_0x825d('0x24')](_0x186ea1));for(_0x892d94=0x0;_0x892d94<_0x186ea1[_0x825d('0x47')];_0x892d94+=0x1){_0x4531d0=_0x186ea1[_0x892d94][_0x825d('0x3e')]();logger['info'](_0x825d('0x48'),_0x4531d0);if(_0x1f8d7c){logger['info'](_0x825d('0x49'),_0x1f8d7c);logger[_0x825d('0x7')](JSON[_0x825d('0x24')](_0x3306d3[_0x4531d0]));BPromise[_0x825d('0x4a')]()[_0x825d('0x37')](handleJob(_0x3306d3[_0x4531d0]));logger[_0x825d('0x7')](_0x825d('0x4b'),_0x3306d3[_0x4531d0][_0x825d('0x16')],_0x3306d3[_0x4531d0]['cron']);}else if(_0x3306d3[_0x4531d0][_0x825d('0x4c')]&&_0x3306d3[_0x4531d0][_0x825d('0x4d')]&&moment()[_0x825d('0x4e')](_0x3306d3[_0x4531d0][_0x825d('0x4f')],_0x3306d3[_0x4531d0][_0x825d('0x50')])){manager[_0x825d('0x51')](_0x4531d0,_0x3306d3[_0x4531d0][_0x825d('0x4c')],handleJob(_0x3306d3[_0x4531d0]));manager[_0x825d('0x52')](_0x4531d0);logger[_0x825d('0x7')]('add\x20cron',_0x3306d3[_0x4531d0][_0x825d('0x16')],_0x3306d3[_0x4531d0][_0x825d('0x4c')]);}else if(manager['exists'](_0x4531d0)){manager['stop'](_0x4531d0);manager[_0x825d('0x44')](_0x4531d0);logger[_0x825d('0x7')](_0x825d('0x53'),_0x3306d3[_0x4531d0][_0x825d('0x16')],_0x3306d3[_0x4531d0][_0x825d('0x4c')]);}}for(_0x892d94=0x0,_0x4531d0;_0x892d94<_0xd9af40[_0x825d('0x47')]&&!_0x1f8d7c;_0x892d94+=0x1){_0x4531d0=_0xd9af40[_0x892d94][_0x825d('0x3e')]();if(manager[_0x825d('0x42')](_0x4531d0)){if(_0x3306d3[_0x4531d0][_0x825d('0x4c')]&&_0x3306d3[_0x4531d0][_0x825d('0x4d')]&&moment()[_0x825d('0x4e')](_0x3306d3[_0x4531d0][_0x825d('0x4f')],_0x3306d3[_0x4531d0][_0x825d('0x50')])){manager[_0x825d('0x54')](_0x4531d0,_0x3306d3[_0x4531d0][_0x825d('0x4c')],handleJob(_0x3306d3[_0x4531d0]));logger[_0x825d('0x7')](_0x825d('0x55'),_0x3306d3[_0x4531d0][_0x825d('0x16')],_0x3306d3[_0x4531d0][_0x825d('0x4c')]);}else{manager[_0x825d('0x43')](_0x4531d0);manager[_0x825d('0x44')](_0x4531d0);logger[_0x825d('0x7')](_0x825d('0x53'),_0x3306d3[_0x4531d0][_0x825d('0x16')],_0x3306d3[_0x4531d0][_0x825d('0x4c')]);}}}})[_0x825d('0x38')](function(_0x24e79d){logger[_0x825d('0x29')](JSON[_0x825d('0x24')](_0x24e79d));});}exports['run']=function(_0x378b20){return getJobs(_0x378b20);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x37ef=['sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','isNil','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','keys','map','toString','keyBy','difference','intersection','exists','stop','deleteJob','delete\x20cron','toRun','length','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update','update\x20cron','run','util','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount','host','port','secure','authentication','auth','user','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','attachments','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','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a'];(function(_0x146148,_0x4c5eb5){var _0x44bc63=function(_0x1e5528){while(--_0x1e5528){_0x146148['push'](_0x146148['shift']());}};_0x44bc63(++_0x4c5eb5);}(_0x37ef,0x94));var _0xf37e=function(_0x1cf234,_0x4768a1){_0x1cf234=_0x1cf234-0x0;var _0x2bcd6f=_0x37ef[_0x1cf234];return _0x2bcd6f;};'use strict';var fs=require('fs');var util=require(_0xf37e('0x0'));var path=require(_0xf37e('0x1'));var _=require(_0xf37e('0x2'));var moment=require(_0xf37e('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xf37e('0x4'));var BPromise=require(_0xf37e('0x5'));var logger=require(_0xf37e('0x6'))(_0xf37e('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xf37e('0x8'));var analyticDefaultReportController=require(_0xf37e('0x9'));var client=jayson[_0xf37e('0xa')][_0xf37e('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x30aa9d,_0x1cfa7a){return function(){logger[_0xf37e('0xc')](_0xf37e('0xd'),_0x30aa9d[_0xf37e('0xe')]);var _0x1d7608=!![];var _0x4c4c2b={'tls':{'rejectUnauthorized':![]}};if(_0x30aa9d['MailAccount'][_0xf37e('0xf')][_0xf37e('0x10')]){_0x4c4c2b[_0xf37e('0x10')]=_0x30aa9d[_0xf37e('0x11')]['Smtp']['service'];}else{_0x4c4c2b[_0xf37e('0x12')]=_0x30aa9d['MailAccount']['Smtp'][_0xf37e('0x12')];_0x4c4c2b[_0xf37e('0x13')]=_0x30aa9d[_0xf37e('0x11')]['Smtp'][_0xf37e('0x13')];_0x4c4c2b[_0xf37e('0x14')]=_0x30aa9d[_0xf37e('0x11')][_0xf37e('0xf')]['secure'];}if(_0x30aa9d[_0xf37e('0x11')][_0xf37e('0xf')][_0xf37e('0x15')]){_0x4c4c2b[_0xf37e('0x16')]={'user':_0x30aa9d['MailAccount'][_0xf37e('0xf')][_0xf37e('0x17')],'pass':_0x30aa9d['MailAccount']['Smtp']['pass']};}var _0x2207af={'account':_0x4c4c2b,'message':{'from':util[_0xf37e('0x18')](_0xf37e('0x19'),_0x30aa9d[_0xf37e('0x11')][_0xf37e('0x1a')],_0x30aa9d[_0xf37e('0x11')][_0xf37e('0xe')]||_0x30aa9d[_0xf37e('0x11')]['Smtp'][_0xf37e('0x17')]),'to':_0x30aa9d[_0xf37e('0xe')],'cc':_0x30aa9d['cc'],'bcc':_0x30aa9d[_0xf37e('0x1b')],'subject':util[_0xf37e('0x18')](_0xf37e('0x1c'),_0x1cfa7a[_0xf37e('0x1a')],_0x30aa9d[_0xf37e('0x1d')],_0x30aa9d['subtractUnit'])}};var _0x2c9fd8=path[_0xf37e('0x1e')](__dirname,_0xf37e('0x1f'));var _0x389aa9=_0x1cfa7a[_0xf37e('0x20')];var _0x33410a=util[_0xf37e('0x18')](_0xf37e('0x21'),path[_0xf37e('0x22')](_0x1cfa7a[_0xf37e('0x20')],path[_0xf37e('0x23')](_0x1cfa7a[_0xf37e('0x20')])),_0xf37e('0x24'));var _0x5a3ef8=path[_0xf37e('0x1e')](_0x2c9fd8,_0x389aa9);var _0x2c10d2=path[_0xf37e('0x1e')](_0x2c9fd8,_0x33410a);if(fs[_0xf37e('0x25')](_0x5a3ef8)){_0x1cfa7a[_0xf37e('0x26')]=_0xf37e('0x27');_0x2207af['message'][_0xf37e('0x28')]=[{'filename':_0x389aa9,'path':_0x5a3ef8}];_0x2207af[_0xf37e('0x29')][_0xf37e('0x2a')]=util[_0xf37e('0x18')](_0xf37e('0x2b'),JSON[_0xf37e('0x2c')](_0x1cfa7a,null,0x2));}else if(fs[_0xf37e('0x25')](_0x2c10d2)){_0x1cfa7a[_0xf37e('0x26')]=_0xf37e('0x27');_0x2207af[_0xf37e('0x29')]['attachments']=[{'filename':_0x33410a,'path':_0x2c10d2}];}else{_0x2207af[_0xf37e('0x29')][_0xf37e('0x2a')]=_0xf37e('0x2d');if(!_0x30aa9d[_0xf37e('0x2e')]){_0x1d7608=![];logger[_0xf37e('0xc')](_0xf37e('0x2f'));}}if(_0x1d7608){return client[_0xf37e('0x30')](_0xf37e('0x31'),_0x2207af)[_0xf37e('0x32')](function(_0x381931){if(_0x381931[_0xf37e('0x33')]){return logger[_0xf37e('0x33')](_0xf37e('0x34'),JSON[_0xf37e('0x2c')](_0x381931));}return logger['info'](_0xf37e('0x35'));})[_0xf37e('0x36')](function(_0x2871fd){return logger[_0xf37e('0x33')](_0xf37e('0x34'),JSON[_0xf37e('0x2c')](_0x2871fd));});}};}function handleError(){return function(_0x122cfd){return logger['error'](JSON[_0xf37e('0x2c')](_0x122cfd));};}function handleResult(_0x5096e2){return function(_0x3082b4){logger[_0xf37e('0xc')]('data',JSON['stringify'](_0x3082b4));if(_0x5096e2[_0xf37e('0x11')]&&_0x5096e2['MailAccount']['Smtp']&&!_[_0xf37e('0x37')](_0x5096e2[_0xf37e('0xe')])){setTimeout(handleSendEmail(_0x5096e2,_0x3082b4),0x3c*0x3e8);}};}function handleJob(_0x4891d4){return function(){try{if(_[_0xf37e('0x37')](_0x4891d4[_0xf37e('0x1d')])){return logger[_0xf37e('0xc')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xf37e('0x37')](_0x4891d4[_0xf37e('0x38')])){return logger[_0xf37e('0xc')](_0xf37e('0x39'));}var _0x1a1318={'startDate':moment()[_0xf37e('0x3a')](_0x4891d4[_0xf37e('0x1d')],_0x4891d4[_0xf37e('0x38')])[_0xf37e('0x18')](_0xf37e('0x3b')),'endDate':moment()[_0xf37e('0x18')](_0xf37e('0x3b')),'type':'scheduled','output':_0x4891d4[_0xf37e('0x3c')],'name':_0x4891d4[_0xf37e('0x1a')]};if(!_[_0xf37e('0x37')](_0x4891d4['DefaultReportId'])){logger[_0xf37e('0xc')](_0xf37e('0x3d'),_0x4891d4['DefaultReportId']);return analyticDefaultReportController[_0xf37e('0x3e')]({'id':_0x4891d4[_0xf37e('0x3f')]},_0x1a1318)[_0xf37e('0x32')](handleResult(_0x4891d4))[_0xf37e('0x36')](handleError());}if(!_[_0xf37e('0x37')](_0x4891d4[_0xf37e('0x40')])){logger['info'](_0xf37e('0x41'),_0x4891d4[_0xf37e('0x40')]);return analyticCustomReportController[_0xf37e('0x3e')]({'id':_0x4891d4[_0xf37e('0x40')]},_0x1a1318)['then'](handleResult(_0x4891d4))[_0xf37e('0x36')](handleError());}}catch(_0x4af290){logger[_0xf37e('0x33')](JSON[_0xf37e('0x2c')](_0x4af290));}return logger['info'](_0xf37e('0x42'));};}function getJobs(_0xc5c0a){var _0x4994a9={};if(_0xc5c0a){_0x4994a9['id']=_0xc5c0a;}return db[_0xf37e('0x43')][_0xf37e('0x44')]({'where':_0x4994a9,'include':[{'model':db[_0xf37e('0x11')],'attributes':['id','name',_0xf37e('0xe')],'include':[{'model':db['MailServerOut'],'as':_0xf37e('0xf')}]}]})[_0xf37e('0x32')](function(_0x18c2e7){var _0x2edc2b=_[_0xf37e('0x45')](manager['jobs']);var _0x457f00=_[_0xf37e('0x46')](_0x18c2e7,function(_0x40aae2){return _0x40aae2['id'][_0xf37e('0x47')]();});var _0x4931c4=_[_0xf37e('0x48')](_0x18c2e7,function(_0x2e6bed){return _0x2e6bed['id'][_0xf37e('0x47')]();});var _0x182175=_0xc5c0a?_0x457f00:_[_0xf37e('0x49')](_0x457f00,_0x2edc2b);var _0x239954=_[_0xf37e('0x4a')](_0x457f00,_0x2edc2b);var _0x52f763=_[_0xf37e('0x49')](_0x2edc2b,_0x457f00);var _0x1e03b5;var _0x2cc7a6;for(_0x1e03b5=0x0;_0x1e03b5<_0x52f763['length']&&!_0xc5c0a;_0x1e03b5+=0x1){_0x2cc7a6=_0x52f763[_0x1e03b5]['toString']();if(manager[_0xf37e('0x4b')](_0x2cc7a6)){manager[_0xf37e('0x4c')](_0x2cc7a6);manager[_0xf37e('0x4d')](_0x2cc7a6);logger[_0xf37e('0xc')](_0xf37e('0x4e'),_0x2cc7a6);}}logger['info'](_0xf37e('0x4f'),JSON['stringify'](_0x182175));for(_0x1e03b5=0x0;_0x1e03b5<_0x182175[_0xf37e('0x50')];_0x1e03b5+=0x1){_0x2cc7a6=_0x182175[_0x1e03b5][_0xf37e('0x47')]();logger[_0xf37e('0xc')](_0xf37e('0x51'),_0x2cc7a6);if(_0xc5c0a){logger[_0xf37e('0xc')](_0xf37e('0x52'),_0xc5c0a);logger[_0xf37e('0xc')](JSON[_0xf37e('0x2c')](_0x4931c4[_0x2cc7a6]));BPromise[_0xf37e('0x53')]()[_0xf37e('0x32')](handleJob(_0x4931c4[_0x2cc7a6]));logger[_0xf37e('0xc')](_0xf37e('0x54'),_0x4931c4[_0x2cc7a6][_0xf37e('0x1a')],_0x4931c4[_0x2cc7a6][_0xf37e('0x55')]);}else if(_0x4931c4[_0x2cc7a6][_0xf37e('0x55')]&&_0x4931c4[_0x2cc7a6][_0xf37e('0x56')]&&moment()[_0xf37e('0x57')](_0x4931c4[_0x2cc7a6][_0xf37e('0x58')],_0x4931c4[_0x2cc7a6][_0xf37e('0x59')])){manager[_0xf37e('0x5a')](_0x2cc7a6,_0x4931c4[_0x2cc7a6][_0xf37e('0x55')],handleJob(_0x4931c4[_0x2cc7a6]));manager[_0xf37e('0x5b')](_0x2cc7a6);logger[_0xf37e('0xc')](_0xf37e('0x5c'),_0x4931c4[_0x2cc7a6][_0xf37e('0x1a')],_0x4931c4[_0x2cc7a6]['cron']);}else if(manager[_0xf37e('0x4b')](_0x2cc7a6)){manager[_0xf37e('0x4c')](_0x2cc7a6);manager[_0xf37e('0x4d')](_0x2cc7a6);logger[_0xf37e('0xc')](_0xf37e('0x5d'),_0x4931c4[_0x2cc7a6]['name'],_0x4931c4[_0x2cc7a6][_0xf37e('0x55')]);}}for(_0x1e03b5=0x0,_0x2cc7a6;_0x1e03b5<_0x239954[_0xf37e('0x50')]&&!_0xc5c0a;_0x1e03b5+=0x1){_0x2cc7a6=_0x239954[_0x1e03b5]['toString']();if(manager[_0xf37e('0x4b')](_0x2cc7a6)){if(_0x4931c4[_0x2cc7a6]['cron']&&_0x4931c4[_0x2cc7a6][_0xf37e('0x56')]&&moment()[_0xf37e('0x57')](_0x4931c4[_0x2cc7a6]['startAt'],_0x4931c4[_0x2cc7a6][_0xf37e('0x59')])){manager[_0xf37e('0x5e')](_0x2cc7a6,_0x4931c4[_0x2cc7a6][_0xf37e('0x55')],handleJob(_0x4931c4[_0x2cc7a6]));logger[_0xf37e('0xc')](_0xf37e('0x5f'),_0x4931c4[_0x2cc7a6][_0xf37e('0x1a')],_0x4931c4[_0x2cc7a6][_0xf37e('0x55')]);}else{manager[_0xf37e('0x4c')](_0x2cc7a6);manager[_0xf37e('0x4d')](_0x2cc7a6);logger[_0xf37e('0xc')](_0xf37e('0x5d'),_0x4931c4[_0x2cc7a6]['name'],_0x4931c4[_0x2cc7a6][_0xf37e('0x55')]);}}}})[_0xf37e('0x36')](function(_0x47a1d3){logger['error'](JSON[_0xf37e('0x2c')](_0x47a1d3));});}exports[_0xf37e('0x60')]=function(_0x5d96a0){return getJobs(_0x5d96a0);};exports['start']=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 7d36ffb..2428c1a 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 _0x693f=['name','SequelizeValidationError','error','inspect','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','Cloud\x20Provider\x20not\x20available','forEach','push','all','start','lodash','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','Comprehend','detectSentiment','substring','info','transcribeName','data1','data2','transcribeRegion','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','then','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','catch'];(function(_0x2b9720,_0x596021){var _0x183670=function(_0x95527b){while(--_0x95527b){_0x2b9720['push'](_0x2b9720['shift']());}};_0x183670(++_0x596021);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};var _=require(_0xf693('0x0'));var AWS=require(_0xf693('0x1'));var rp=require(_0xf693('0x2'));var util=require(_0xf693('0x3'));var BPromise=require('bluebird');var db=require(_0xf693('0x4'))['db'];var logger=require(_0xf693('0x5'))(_0xf693('0x6'));function getTranscriptionJob(_0x1d272f,_0x3d2e05,_0x6e749b,_0x42578c){return new Promise(function(_0x4b4d39,_0x1d3b17){var _0x33305c=new AWS['TranscribeService']({'accessKeyId':_0x3d2e05,'secretAccessKey':_0x1d272f,'region':_0x6e749b});_0x33305c[_0xf693('0x7')]({'TranscriptionJobName':_0x42578c},function(_0x594505,_0x38e78a){if(_0x594505){return _0x1d3b17(_0x594505);}else{return _0x4b4d39(_0x38e78a);}});});}function sentiment(_0x4ae88f,_0x3dfb0d,_0x17075d,_0x48984a,_0x4b09d6){return new Promise(function(_0x5d9159,_0x38b847){var _0x527cd9=new AWS[(_0xf693('0x8'))]({'accessKeyId':_0x3dfb0d,'secretAccessKey':_0x4ae88f,'region':_0x17075d});_0x527cd9[_0xf693('0x9')]({'Text':_0x48984a,'LanguageCode':_0x4b09d6[_0xf693('0xa')](0x0,0x2)},function(_0x1dc0da,_0x1f9205){if(_0x1dc0da){return _0x38b847(_0x1dc0da);}else{return _0x5d9159(_0x1f9205);}});});}function checkTranscribeJob(_0x5a5a35,_0x5d0d4c,_0xd08be1){var _0x38bd65;return new BPromise(function(_0x4c9ab7,_0x25d3f6){logger[_0xf693('0xb')](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x5a5a35['id'],_0x5a5a35[_0xf693('0xc')]));return getTranscriptionJob(_0xd08be1[_0xf693('0xd')],_0xd08be1[_0xf693('0xe')],_0x5d0d4c[_0xf693('0xf')],_0x5a5a35[_0xf693('0xc')])['then'](function(_0x1d9278){logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x11'),_0x5a5a35['id'],_0x5a5a35[_0xf693('0xc')],_0x1d9278[_0xf693('0x12')]['TranscriptionJobStatus']));if(!_0x5a5a35['fileText']){switch(_0x1d9278['TranscriptionJob'][_0xf693('0x13')]){case _0xf693('0x14'):var _0x3f4d4d={'transcribeStatus':_0x1d9278[_0xf693('0x12')][_0xf693('0x13')],'fileUri':_0x1d9278['TranscriptionJob'][_0xf693('0x15')][_0xf693('0x16')]};logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x17'),_0x5a5a35['id']));return rp({'uri':_0x1d9278[_0xf693('0x12')][_0xf693('0x15')][_0xf693('0x16')],'json':!![]})['then'](function(_0x505ada){logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x18'),_0x5a5a35['id']));if(_0x505ada&&_0x505ada[_0xf693('0x19')]&&_0x505ada[_0xf693('0x19')][_0xf693('0x1a')]&&_0x505ada['results'][_0xf693('0x1a')][_0xf693('0x1b')]){_0x3f4d4d[_0xf693('0x1c')]='';for(var _0x414a3f=0x0;_0x414a3f<_0x505ada['results'][_0xf693('0x1a')][_0xf693('0x1b')];_0x414a3f++){_0x3f4d4d[_0xf693('0x1c')]+=_0x505ada[_0xf693('0x19')][_0xf693('0x1a')][_0x414a3f][_0xf693('0x1d')]+'';}}return _0x5a5a35[_0xf693('0x1e')](_0x3f4d4d);})[_0xf693('0x1f')](function(){logger[_0xf693('0xb')](util[_0xf693('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5a5a35['id']));if(!_0x5a5a35[_0xf693('0x20')]){throw new db[(_0xf693('0x21'))][(_0xf693('0x22'))](_0xf693('0x23'));}if(!_0x5d0d4c[_0xf693('0x24')]||!_0x5d0d4c[_0xf693('0x25')]||!_0x5d0d4c[_0xf693('0x26')]||!_0x5d0d4c[_0xf693('0x27')]||!_0x5d0d4c['bucket']){throw new db[(_0xf693('0x21'))][(_0xf693('0x22'))](_0xf693('0x28'));}if(!_0x3f4d4d[_0xf693('0x1c')]){throw new Error('Transcript\x20not\x20available');}if(_0x5d0d4c['sentimentAccountId']===_0xd08be1['id']){return _0xd08be1;}else{return db[_0xf693('0x29')][_0xf693('0x2a')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xf693('0x1f')](function(_0x3f6bb5){if(!_0x3f6bb5){throw new db[(_0xf693('0x21'))][(_0xf693('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3f6bb5[_0xf693('0xd')]||!_0x3f6bb5[_0xf693('0xe')]){throw new db[(_0xf693('0x21'))][(_0xf693('0x22'))](_0xf693('0x2b'));}_0x38bd65=_0x3f6bb5;logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x2c'),_0x5a5a35['id']));return sentiment(_0x38bd65['data1'],_0x38bd65[_0xf693('0xe')],_0x5d0d4c[_0xf693('0x26')],_0x3f4d4d[_0xf693('0x1c')],_0x5d0d4c[_0xf693('0x27')]);})[_0xf693('0x1f')](function(_0x192f20){logger['info'](util['format'](_0xf693('0x2d'),_0x5a5a35['id']));return _0x5a5a35[_0xf693('0x1e')]({'sentiment':_0x192f20[_0xf693('0x2e')],'sPositive':_0x192f20['SentimentScore'][_0xf693('0x2f')],'sNegative':_0x192f20[_0xf693('0x30')][_0xf693('0x31')],'sMixed':_0x192f20[_0xf693('0x30')][_0xf693('0x32')],'sNeutral':_0x192f20['SentimentScore'][_0xf693('0x33')]});})[_0xf693('0x1f')](function(){logger[_0xf693('0xb')](util['format'](_0xf693('0x34'),_0x5a5a35['id']));_0x4c9ab7();});case'FAILED':return _0x5a5a35[_0xf693('0x1e')]({'transcribeStatus':_0xf693('0x35'),'failureReason':_0x1d9278[_0xf693('0x12')][_0xf693('0x36')]})[_0xf693('0x1f')](function(){logger['info'](util[_0xf693('0x10')](_0xf693('0x34'),_0x5a5a35['id']));_0x4c9ab7();});default:logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x37'),_0x5a5a35['id']));break;}}else{return BPromise[_0xf693('0x38')]()[_0xf693('0x1f')](function(){if(!_0x5a5a35[_0xf693('0x20')]){throw new db[(_0xf693('0x21'))]['ValidationError'](_0xf693('0x23'));}if(!_0x5d0d4c['sentiment']||!_0x5d0d4c['sentimentAccountId']||!_0x5d0d4c[_0xf693('0x26')]||!_0x5d0d4c[_0xf693('0x27')]||!_0x5d0d4c[_0xf693('0x39')]){throw new db['Sequelize'][(_0xf693('0x22'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x5a5a35[_0xf693('0x1c')]){throw new Error('Transcript\x20not\x20available');}if(_0x5d0d4c[_0xf693('0x25')]===_0xd08be1['id']){return _0xd08be1;}else{return db[_0xf693('0x29')][_0xf693('0x2a')]({'where':{'id':_settings[_0xf693('0x25')]}});}})[_0xf693('0x1f')](function(_0x47bc1b){if(!_0x47bc1b){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x47bc1b[_0xf693('0xd')]||!_0x47bc1b[_0xf693('0xe')]){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x38bd65=_0x47bc1b;logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x2c'),_0x5a5a35['id']));return sentiment(_0x38bd65[_0xf693('0xd')],_0x38bd65['data2'],_0x5d0d4c[_0xf693('0x26')],_0x5a5a35[_0xf693('0x1c')],_0x5d0d4c[_0xf693('0x27')]);})['then'](function(_0x40a47c){logger[_0xf693('0xb')](util['format'](_0xf693('0x2d'),_0x5a5a35['id']));return _0x5a5a35[_0xf693('0x1e')]({'sentiment':_0x40a47c['Sentiment'],'sPositive':_0x40a47c[_0xf693('0x30')][_0xf693('0x2f')],'sNegative':_0x40a47c['SentimentScore'][_0xf693('0x31')],'sMixed':_0x40a47c[_0xf693('0x30')][_0xf693('0x32')],'sNeutral':_0x40a47c[_0xf693('0x30')]['Neutral'],'transcribeStatus':_0xf693('0x14')});})[_0xf693('0x1f')](function(){logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x34'),_0x5a5a35['id']));_0x4c9ab7();});}})[_0xf693('0x3a')](function(_0x4a6266){if(_0x4a6266){if(!_0x4a6266[_0xf693('0x3b')]||_0x4a6266[_0xf693('0x3b')]!==_0xf693('0x3c')){logger[_0xf693('0x3d')](util[_0xf693('0x10')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x5a5a35['id']),util[_0xf693('0x3e')](_0x4a6266,{'showHidden':![],'depth':null}));}}_0x4c9ab7();});});}function checkTranscribe(){var _0x14e256;var _0x5b66a4;var _0x1952fb;return db['VoiceRecording']['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xf693('0x1f')](function(_0x178cca){if(!_0x178cca||!_0x178cca[_0xf693('0x1b')]){throw new db[(_0xf693('0x21'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x14e256=_0x178cca;return db[_0xf693('0x3f')]['findOne']({'where':{'id':0x1}});})[_0xf693('0x1f')](function(_0x2fe232){if(!_0x2fe232){throw new db[(_0xf693('0x21'))]['ValidationError'](_0xf693('0x40'));}_0x5b66a4=_0x2fe232;if(!_0x5b66a4[_0xf693('0x6')]||!_0x5b66a4[_0xf693('0x41')]||!_0x5b66a4[_0xf693('0xf')]||!_0x5b66a4[_0xf693('0x27')]||!_0x5b66a4[_0xf693('0x39')]){throw new db['Sequelize']['ValidationError'](_0xf693('0x42'));}return db['CloudProvider']['findOne']({'where':{'id':_0x5b66a4[_0xf693('0x41')]}});})[_0xf693('0x1f')](function(_0x4ed7fa){if(!_0x4ed7fa){throw new db[(_0xf693('0x21'))][(_0xf693('0x22'))](_0xf693('0x43'));}if(!_0x4ed7fa[_0xf693('0xd')]||!_0x4ed7fa['data2']){throw new db['Sequelize'][(_0xf693('0x22'))](_0xf693('0x2b'));}_0x1952fb=_0x4ed7fa;var _0x1361ac=[];_0x14e256[_0xf693('0x44')](function(_0x54fb64){_0x1361ac[_0xf693('0x45')](checkTranscribeJob(_0x54fb64,_0x5b66a4,_0x1952fb));});return BPromise[_0xf693('0x46')](_0x1361ac);})['catch'](function(_0x22044c){if(_0x22044c){if(!_0x22044c[_0xf693('0x3b')]||_0x22044c[_0xf693('0x3b')]!==_0xf693('0x3c')){logger[_0xf693('0x3d')](util[_0xf693('0x3e')](_0x22044c,{'showHidden':![],'depth':null}));}}});}exports[_0xf693('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x81a5=['transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','fileText','length','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','CloudProvider','Positive','Neutral','COMPLETED','catch','SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','name','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb'];(function(_0x16a588,_0x57f290){var _0x2b2037=function(_0x43d394){while(--_0x43d394){_0x16a588['push'](_0x16a588['shift']());}};_0x2b2037(++_0x57f290);}(_0x81a5,0x1c8));var _0x581a=function(_0x389e35,_0x148973){_0x389e35=_0x389e35-0x0;var _0x50acc1=_0x81a5[_0x389e35];return _0x50acc1;};var _=require(_0x581a('0x0'));var AWS=require(_0x581a('0x1'));var rp=require(_0x581a('0x2'));var util=require(_0x581a('0x3'));var BPromise=require(_0x581a('0x4'));var db=require(_0x581a('0x5'))['db'];var logger=require('../../config/logger')(_0x581a('0x6'));function getTranscriptionJob(_0x5125ac,_0x4f5f9a,_0x51d349,_0x4b491c){return new Promise(function(_0x21fea7,_0x56065e){var _0xdcb7c0=new AWS[(_0x581a('0x7'))]({'accessKeyId':_0x4f5f9a,'secretAccessKey':_0x5125ac,'region':_0x51d349});_0xdcb7c0[_0x581a('0x8')]({'TranscriptionJobName':_0x4b491c},function(_0x18dec1,_0x23ba13){if(_0x18dec1){return _0x56065e(_0x18dec1);}else{return _0x21fea7(_0x23ba13);}});});}function sentiment(_0x2356d3,_0x3fe553,_0x31b3ac,_0x524948,_0x1c9869){return new Promise(function(_0x493493,_0x1541f1){var _0x8e2264=new AWS[(_0x581a('0x9'))]({'accessKeyId':_0x3fe553,'secretAccessKey':_0x2356d3,'region':_0x31b3ac});_0x8e2264[_0x581a('0xa')]({'Text':_0x524948,'LanguageCode':_0x1c9869['substring'](0x0,0x2)},function(_0x4f4f5f,_0x58ebc0){if(_0x4f4f5f){return _0x1541f1(_0x4f4f5f);}else{return _0x493493(_0x58ebc0);}});});}function checkTranscribeJob(_0x5b1378,_0x5dac2a,_0x48a2e3){var _0x96c299;return new BPromise(function(_0x270eef,_0x4f3ce4){logger[_0x581a('0xb')](util[_0x581a('0xc')](_0x581a('0xd'),_0x5b1378['id'],_0x5b1378[_0x581a('0xe')]));return getTranscriptionJob(_0x48a2e3[_0x581a('0xf')],_0x48a2e3[_0x581a('0x10')],_0x5dac2a[_0x581a('0x11')],_0x5b1378[_0x581a('0xe')])['then'](function(_0x11f50b){logger[_0x581a('0xb')](util['format'](_0x581a('0x12'),_0x5b1378['id'],_0x5b1378[_0x581a('0xe')],_0x11f50b[_0x581a('0x13')][_0x581a('0x14')]));if(!_0x5b1378['fileText']){switch(_0x11f50b[_0x581a('0x13')][_0x581a('0x14')]){case'COMPLETED':var _0x4bdc1a={'transcribeStatus':_0x11f50b[_0x581a('0x13')][_0x581a('0x14')],'fileUri':_0x11f50b[_0x581a('0x13')][_0x581a('0x15')][_0x581a('0x16')]};logger[_0x581a('0xb')](util[_0x581a('0xc')](_0x581a('0x17'),_0x5b1378['id']));return rp({'uri':_0x11f50b['TranscriptionJob'][_0x581a('0x15')][_0x581a('0x16')],'json':!![]})[_0x581a('0x18')](function(_0x4f619d){logger['info'](util[_0x581a('0xc')](_0x581a('0x19'),_0x5b1378['id']));if(_0x4f619d&&_0x4f619d[_0x581a('0x1a')]&&_0x4f619d[_0x581a('0x1a')]['transcripts']&&_0x4f619d[_0x581a('0x1a')][_0x581a('0x1b')]['length']){_0x4bdc1a[_0x581a('0x1c')]='';for(var _0x3ce207=0x0;_0x3ce207<_0x4f619d[_0x581a('0x1a')][_0x581a('0x1b')][_0x581a('0x1d')];_0x3ce207++){_0x4bdc1a['fileText']+=_0x4f619d['results'][_0x581a('0x1b')][_0x3ce207]['transcript']+'';}}return _0x5b1378['update'](_0x4bdc1a);})[_0x581a('0x18')](function(){logger[_0x581a('0xb')](util[_0x581a('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5b1378['id']));if(!_0x5b1378[_0x581a('0x1e')]){throw new db[(_0x581a('0x1f'))][(_0x581a('0x20'))](_0x581a('0x21'));}if(!_0x5dac2a['sentiment']||!_0x5dac2a[_0x581a('0x22')]||!_0x5dac2a[_0x581a('0x23')]||!_0x5dac2a[_0x581a('0x24')]||!_0x5dac2a[_0x581a('0x25')]){throw new db[(_0x581a('0x1f'))][(_0x581a('0x20'))](_0x581a('0x26'));}if(!_0x4bdc1a[_0x581a('0x1c')]){throw new Error(_0x581a('0x27'));}if(_0x5dac2a[_0x581a('0x22')]===_0x48a2e3['id']){return _0x48a2e3;}else{return db['CloudProvider'][_0x581a('0x28')]({'where':{'id':_settings[_0x581a('0x22')]}});}})['then'](function(_0x3d9f4a){if(!_0x3d9f4a){throw new db[(_0x581a('0x1f'))]['ValidationError'](_0x581a('0x29'));}if(!_0x3d9f4a[_0x581a('0xf')]||!_0x3d9f4a[_0x581a('0x10')]){throw new db[(_0x581a('0x1f'))][(_0x581a('0x20'))](_0x581a('0x2a'));}_0x96c299=_0x3d9f4a;logger[_0x581a('0xb')](util[_0x581a('0xc')](_0x581a('0x2b'),_0x5b1378['id']));return sentiment(_0x96c299[_0x581a('0xf')],_0x96c299['data2'],_0x5dac2a['sentimentRegion'],_0x4bdc1a['fileText'],_0x5dac2a[_0x581a('0x24')]);})[_0x581a('0x18')](function(_0xfbfb4f){logger['info'](util['format'](_0x581a('0x2c'),_0x5b1378['id']));return _0x5b1378[_0x581a('0x2d')]({'sentiment':_0xfbfb4f[_0x581a('0x2e')],'sPositive':_0xfbfb4f[_0x581a('0x2f')]['Positive'],'sNegative':_0xfbfb4f[_0x581a('0x2f')][_0x581a('0x30')],'sMixed':_0xfbfb4f['SentimentScore'][_0x581a('0x31')],'sNeutral':_0xfbfb4f[_0x581a('0x2f')]['Neutral']});})[_0x581a('0x18')](function(){logger[_0x581a('0xb')](util[_0x581a('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5b1378['id']));_0x270eef();});case _0x581a('0x32'):return _0x5b1378[_0x581a('0x2d')]({'transcribeStatus':_0x581a('0x32'),'failureReason':_0x11f50b[_0x581a('0x13')][_0x581a('0x33')]})[_0x581a('0x18')](function(){logger[_0x581a('0xb')](util[_0x581a('0xc')](_0x581a('0x34'),_0x5b1378['id']));_0x270eef();});default:logger[_0x581a('0xb')](util['format'](_0x581a('0x35'),_0x5b1378['id']));break;}}else{return BPromise[_0x581a('0x36')]()[_0x581a('0x18')](function(){if(!_0x5b1378[_0x581a('0x1e')]){throw new db[(_0x581a('0x1f'))][(_0x581a('0x20'))](_0x581a('0x21'));}if(!_0x5dac2a[_0x581a('0x37')]||!_0x5dac2a[_0x581a('0x22')]||!_0x5dac2a['sentimentRegion']||!_0x5dac2a[_0x581a('0x24')]||!_0x5dac2a[_0x581a('0x25')]){throw new db[(_0x581a('0x1f'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x5b1378['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x5dac2a[_0x581a('0x22')]===_0x48a2e3['id']){return _0x48a2e3;}else{return db[_0x581a('0x38')][_0x581a('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x581a('0x18')](function(_0x54ef6f){if(!_0x54ef6f){throw new db[(_0x581a('0x1f'))][(_0x581a('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x54ef6f['data1']||!_0x54ef6f[_0x581a('0x10')]){throw new db[(_0x581a('0x1f'))]['ValidationError'](_0x581a('0x2a'));}_0x96c299=_0x54ef6f;logger[_0x581a('0xb')](util[_0x581a('0xc')](_0x581a('0x2b'),_0x5b1378['id']));return sentiment(_0x96c299[_0x581a('0xf')],_0x96c299[_0x581a('0x10')],_0x5dac2a[_0x581a('0x23')],_0x5b1378[_0x581a('0x1c')],_0x5dac2a[_0x581a('0x24')]);})[_0x581a('0x18')](function(_0x2a6e5f){logger[_0x581a('0xb')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x5b1378['id']));return _0x5b1378[_0x581a('0x2d')]({'sentiment':_0x2a6e5f[_0x581a('0x2e')],'sPositive':_0x2a6e5f[_0x581a('0x2f')][_0x581a('0x39')],'sNegative':_0x2a6e5f[_0x581a('0x2f')]['Negative'],'sMixed':_0x2a6e5f[_0x581a('0x2f')][_0x581a('0x31')],'sNeutral':_0x2a6e5f[_0x581a('0x2f')][_0x581a('0x3a')],'transcribeStatus':_0x581a('0x3b')});})[_0x581a('0x18')](function(){logger[_0x581a('0xb')](util['format'](_0x581a('0x34'),_0x5b1378['id']));_0x270eef();});}})[_0x581a('0x3c')](function(_0x58bce3){if(_0x58bce3){if(!_0x58bce3['name']||_0x58bce3['name']!==_0x581a('0x3d')){logger[_0x581a('0x3e')](util[_0x581a('0xc')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x5b1378['id']),util[_0x581a('0x3f')](_0x58bce3,{'showHidden':![],'depth':null}));}}_0x270eef();});});}function checkTranscribe(){var _0x35990b;var _0x462107;var _0x3b80ca;return db[_0x581a('0x40')][_0x581a('0x41')]({'where':{'transcribeStatus':_0x581a('0x42')}})[_0x581a('0x18')](function(_0x20b420){if(!_0x20b420||!_0x20b420[_0x581a('0x1d')]){throw new db[(_0x581a('0x1f'))]['ValidationError'](_0x581a('0x43'));}_0x35990b=_0x20b420;return db[_0x581a('0x44')]['findOne']({'where':{'id':0x1}});})[_0x581a('0x18')](function(_0x181818){if(!_0x181818){throw new db[(_0x581a('0x1f'))][(_0x581a('0x20'))](_0x581a('0x45'));}_0x462107=_0x181818;if(!_0x462107['transcribe']||!_0x462107[_0x581a('0x46')]||!_0x462107[_0x581a('0x11')]||!_0x462107['language']||!_0x462107[_0x581a('0x25')]){throw new db['Sequelize'][(_0x581a('0x20'))](_0x581a('0x47'));}return db[_0x581a('0x38')][_0x581a('0x28')]({'where':{'id':_0x462107['transcribeAccountId']}});})[_0x581a('0x18')](function(_0xca8463){if(!_0xca8463){throw new db[(_0x581a('0x1f'))][(_0x581a('0x20'))](_0x581a('0x29'));}if(!_0xca8463[_0x581a('0xf')]||!_0xca8463[_0x581a('0x10')]){throw new db[(_0x581a('0x1f'))][(_0x581a('0x20'))](_0x581a('0x2a'));}_0x3b80ca=_0xca8463;var _0x46139c=[];_0x35990b[_0x581a('0x48')](function(_0x4e5995){_0x46139c[_0x581a('0x49')](checkTranscribeJob(_0x4e5995,_0x462107,_0x3b80ca));});return BPromise[_0x581a('0x4a')](_0x46139c);})[_0x581a('0x3c')](function(_0x226450){if(_0x226450){if(!_0x226450[_0x581a('0x4b')]||_0x226450[_0x581a('0x4b')]!==_0x581a('0x3d')){logger[_0x581a('0x3e')](util[_0x581a('0x3f')](_0x226450,{'showHidden':![],'depth':null}));}}});}exports[_0x581a('0x4c')]=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 fae591f..5b01ccd 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 _0xd250=['../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','map','info','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','whatsappInteraction:update','catch','error','start','lodash','moment','ioredis','util'];(function(_0x35859d,_0x53205e){var _0x2f8cc0=function(_0x214c8a){while(--_0x214c8a){_0x35859d['push'](_0x35859d['shift']());}};_0x2f8cc0(++_0x53205e);}(_0xd250,0x70));var _0x0d25=function(_0xef4cf0,_0x16c9c3){_0xef4cf0=_0xef4cf0-0x0;var _0x497ad2=_0xd250[_0xef4cf0];return _0x497ad2;};'use strict';var _=require(_0x0d25('0x0'));var moment=require(_0x0d25('0x1'));var Redis=require(_0x0d25('0x2'));var util=require(_0x0d25('0x3'));var config=require(_0x0d25('0x4'));var db=require(_0x0d25('0x5'))['db'];var logger=require(_0x0d25('0x6'))(_0x0d25('0x7'));config[_0x0d25('0x8')]=_[_0x0d25('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0d25('0xa'))(new Redis(config[_0x0d25('0x8')]));function closeInteractions(){var _0x2aaf25=[];return db[_0x0d25('0xb')][_0x0d25('0xc')]({'raw':!![],'attributes':['id',_0x0d25('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x0d25('0xe')](0x18,_0x0d25('0xf'))}}})['then'](function(_0x1ea8b9){if(_0x1ea8b9&&_0x1ea8b9['length']){_0x2aaf25=_[_0x0d25('0x10')](_0x1ea8b9||[],'id');logger[_0x0d25('0x11')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x2aaf25[_0x0d25('0x12')]());return db[_0x0d25('0xb')][_0x0d25('0x13')]({'closeReason':'system','disposition':_0x0d25('0x14'),'closed':!![],'closedAt':moment()[_0x0d25('0x15')](_0x0d25('0x16'))},{'where':{'id':_0x2aaf25}});}})['then'](function(){if(_0x2aaf25&&_0x2aaf25[_0x0d25('0x17')]){logger[_0x0d25('0x11')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x2aaf25['join']());for(var _0xdbae67=0x0;_0xdbae67<_0x2aaf25[_0x0d25('0x17')];_0xdbae67++){io[_0x0d25('0x18')](_0x0d25('0x19'),{'id':_0x2aaf25[_0xdbae67],'closed':!![]});}}})[_0x0d25('0x1a')](function(_0x315506){logger[_0x0d25('0x1b')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x315506?util['inspect'](_0x315506,{'showHidden':![],'depth':null}):'');});}exports[_0x0d25('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x69cf=['catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','format','YYYY-MM-DD\x20HH:mm:ss','join','emit','whatsappInteraction:update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x69cf,0xf5));var _0xf69c=function(_0x1fd6f4,_0x4b8481){_0x1fd6f4=_0x1fd6f4-0x0;var _0x32b7f1=_0x69cf[_0x1fd6f4];return _0x32b7f1;};'use strict';var _=require(_0xf69c('0x0'));var moment=require(_0xf69c('0x1'));var Redis=require(_0xf69c('0x2'));var util=require(_0xf69c('0x3'));var config=require('../../config/environment');var db=require(_0xf69c('0x4'))['db'];var logger=require(_0xf69c('0x5'))(_0xf69c('0x6'));config[_0xf69c('0x7')]=_[_0xf69c('0x8')](config[_0xf69c('0x7')],{'host':_0xf69c('0x9'),'port':0x18eb});var io=require(_0xf69c('0xa'))(new Redis(config['redis']));function closeInteractions(){var _0x5d2a57=[];return db[_0xf69c('0xb')][_0xf69c('0xc')]({'raw':!![],'attributes':['id',_0xf69c('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xf69c('0xe')](0x18,_0xf69c('0xf'))}}})['then'](function(_0x501d0c){if(_0x501d0c&&_0x501d0c[_0xf69c('0x10')]){_0x5d2a57=_['map'](_0x501d0c||[],'id');logger[_0xf69c('0x11')](_0xf69c('0x12'),_0x5d2a57['join']());return db[_0xf69c('0xb')][_0xf69c('0x13')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xf69c('0x14')](_0xf69c('0x15'))},{'where':{'id':_0x5d2a57}});}})['then'](function(){if(_0x5d2a57&&_0x5d2a57['length']){logger[_0xf69c('0x11')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x5d2a57[_0xf69c('0x16')]());for(var _0x18bce8=0x0;_0x18bce8<_0x5d2a57[_0xf69c('0x10')];_0x18bce8++){io[_0xf69c('0x17')](_0xf69c('0x18'),{'id':_0x5d2a57[_0x18bce8],'closed':!![]});}}})[_0xf69c('0x19')](function(_0x487e99){logger[_0xf69c('0x1a')](_0xf69c('0x1b'),_0x487e99?util[_0xf69c('0x1c')](_0x487e99,{'showHidden':![],'depth':null}):'');});}exports[_0xf69c('0x1d')]=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 1b3fe1f..2f3ee8d 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4261=['now','Biondo','CmContact','destroy','then','bulkCreate','log','contacts1','CmHopper','hopper1','finished\x20populating','contacts2','hopper2','push','Innocenzo','innocenzo.biondo','@xcally.com'];(function(_0x4bfb70,_0x294fd8){var _0x5e8421=function(_0x4fa843){while(--_0x4fa843){_0x4bfb70['push'](_0x4bfb70['shift']());}};_0x5e8421(++_0x294fd8);}(_0x4261,0x84));var _0x1426=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x4261[_0x311c35];return _0x5cc50c;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x1426('0x0')]({'id':i,'firstName':_0x1426('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x1426('0x2')+i+_0x1426('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x1426('0x0')]({'id':i,'active':![],'scheduledat':Date[_0x1426('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1426('0x4')](),'updatedAt':Date[_0x1426('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x1426('0x0')]({'id':i,'firstName':_0x1426('0x1')+i,'lastName':_0x1426('0x5')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x1426('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x1426('0x0')]({'id':i,'active':![],'scheduledat':Date[_0x1426('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1426('0x4')](),'updatedAt':Date[_0x1426('0x4')]()});}db[_0x1426('0x6')][_0x1426('0x7')]({'where':{}})[_0x1426('0x8')](function(){return db[_0x1426('0x6')][_0x1426('0x9')](contacts);})['then'](function(){console[_0x1426('0xa')]('finished\x20populating',_0x1426('0xb'));return db[_0x1426('0xc')]['destroy']({'where':{}});})[_0x1426('0x8')](function(){return db[_0x1426('0xc')][_0x1426('0x9')](hopper);})[_0x1426('0x8')](function(){console[_0x1426('0xa')]('finished\x20populating',_0x1426('0xd'));return db[_0x1426('0x6')][_0x1426('0x9')](contacts2);})[_0x1426('0x8')](function(){console[_0x1426('0xa')](_0x1426('0xe'),_0x1426('0xf'));return db[_0x1426('0xc')][_0x1426('0x9')](hopper2);})['then'](function(){console[_0x1426('0xa')](_0x1426('0xe'),_0x1426('0x10'));})['catch'](function(_0x4522ff){console['log'](_0x4522ff);}); \ No newline at end of file +var _0xc8a6=['finished\x20populating','contacts1','CmHopper','hopper1','contacts2','util','../mysqldb','push','Innocenzo','@xcally.com','now','Biondo','innocenzo.biondo','CmContact','bulkCreate','then','log'];(function(_0x47cd84,_0x3056b9){var _0x800299=function(_0x7a34ba){while(--_0x7a34ba){_0x47cd84['push'](_0x47cd84['shift']());}};_0x800299(++_0x3056b9);}(_0xc8a6,0x1e1));var _0x6c8a=function(_0x23975,_0x48b66d){_0x23975=_0x23975-0x0;var _0x3bf49a=_0xc8a6[_0x23975];return _0x3bf49a;};'use strict';var util=require(_0x6c8a('0x0'));var db=require(_0x6c8a('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6c8a('0x2')]({'id':i,'firstName':_0x6c8a('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x6c8a('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x6c8a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x6c8a('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6c8a('0x5')](),'updatedAt':Date[_0x6c8a('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6c8a('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x6c8a('0x6')+i,'phone':0xf879fb460+i,'email':_0x6c8a('0x7')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6c8a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x6c8a('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0x6c8a('0x8')]['destroy']({'where':{}})['then'](function(){return db[_0x6c8a('0x8')][_0x6c8a('0x9')](contacts);})[_0x6c8a('0xa')](function(){console[_0x6c8a('0xb')](_0x6c8a('0xc'),_0x6c8a('0xd'));return db[_0x6c8a('0xe')]['destroy']({'where':{}});})[_0x6c8a('0xa')](function(){return db[_0x6c8a('0xe')][_0x6c8a('0x9')](hopper);})[_0x6c8a('0xa')](function(){console[_0x6c8a('0xb')](_0x6c8a('0xc'),_0x6c8a('0xf'));return db[_0x6c8a('0x8')][_0x6c8a('0x9')](contacts2);})['then'](function(){console[_0x6c8a('0xb')](_0x6c8a('0xc'),_0x6c8a('0x10'));return db[_0x6c8a('0xe')][_0x6c8a('0x9')](hopper2);})['then'](function(){console[_0x6c8a('0xb')]('finished\x20populating','hopper2');})['catch'](function(_0x34036a){console[_0x6c8a('0xb')](_0x34036a);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 8e1d59c..429ca90 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbbbe=['all','yes','/etc/pki/tls/private/motion.key','User','bulkCreate','add\x20user','catch','util','../mysqldb','push','format','%s%s','%s%s@xcally.com','agent','password','friend','udp','wss'];(function(_0x50a4c1,_0x43dbce){var _0x3b20b6=function(_0x53daf9){while(--_0x53daf9){_0x50a4c1['push'](_0x50a4c1['shift']());}};_0x3b20b6(++_0x43dbce);}(_0xbbbe,0x15d));var _0xebbb=function(_0x441ea0,_0x60e671){_0x441ea0=_0x441ea0-0x0;var _0x47c7ad=_0xbbbe[_0x441ea0];return _0x47c7ad;};'use strict';var util=require(_0xebbb('0x0'));var db=require(_0xebbb('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xebbb('0x2')]({'name':util[_0xebbb('0x3')](_0xebbb('0x4'),'agent',i),'fullname':util[_0xebbb('0x3')](_0xebbb('0x4'),'agent',i),'email':util[_0xebbb('0x3')](_0xebbb('0x5'),'agent',i),'role':_0xebbb('0x6'),'password':_0xebbb('0x7'),'internal':0xfa0+i,'type':_0xebbb('0x8'),'transport':[_0xebbb('0x9'),'ws',_0xebbb('0xa')],'disallow':[_0xebbb('0xb')],'allow':['ulaw'],'defaultuser':util[_0xebbb('0x3')](_0xebbb('0x4'),_0xebbb('0x6'),i),'encryption':_0xebbb('0xc'),'avpf':_0xebbb('0xc'),'force_avp':_0xebbb('0xc'),'icesupport':_0xebbb('0xc'),'dtlsenable':_0xebbb('0xc'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xebbb('0xd'),'dtlssetup':'actpass','callerid':util[_0xebbb('0x3')]('\x22%s\x22\x20<%s>',util[_0xebbb('0x3')]('%s%s',_0xebbb('0x6'),i),0xfa0+i)});}db[_0xebbb('0xe')][_0xebbb('0xf')](users)['then'](function(){console['log'](_0xebbb('0x10'));})[_0xebbb('0x11')](function(_0x2d43be){console['log'](_0x2d43be);}); \ No newline at end of file +var _0x1eb1=['util','push','format','%s%s','agent','%s%s@xcally.com','password','friend','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0x1eb1,0x17c));var _0x11eb=function(_0x4f3438,_0x382b43){_0x4f3438=_0x4f3438-0x0;var _0x3de714=_0x1eb1[_0x4f3438];return _0x3de714;};'use strict';var util=require(_0x11eb('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x11eb('0x1')]({'name':util[_0x11eb('0x2')](_0x11eb('0x3'),_0x11eb('0x4'),i),'fullname':util['format'](_0x11eb('0x3'),_0x11eb('0x4'),i),'email':util[_0x11eb('0x2')](_0x11eb('0x5'),_0x11eb('0x4'),i),'role':'agent','password':_0x11eb('0x6'),'internal':0xfa0+i,'type':_0x11eb('0x7'),'transport':['udp','ws',_0x11eb('0x8')],'disallow':['all'],'allow':[_0x11eb('0x9')],'defaultuser':util[_0x11eb('0x2')]('%s%s',_0x11eb('0x4'),i),'encryption':_0x11eb('0xa'),'avpf':_0x11eb('0xa'),'force_avp':'yes','icesupport':_0x11eb('0xa'),'dtlsenable':_0x11eb('0xa'),'dtlsverify':'no','dtlscertfile':_0x11eb('0xb'),'dtlsprivatekey':_0x11eb('0xc'),'dtlssetup':_0x11eb('0xd'),'callerid':util['format'](_0x11eb('0xe'),util[_0x11eb('0x2')](_0x11eb('0x3'),_0x11eb('0x4'),i),0xfa0+i)});}db[_0x11eb('0xf')]['bulkCreate'](users)[_0x11eb('0x10')](function(){console[_0x11eb('0x11')](_0x11eb('0x12'));})['catch'](function(_0x2fc495){console['log'](_0x2fc495);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 94b17b2..f932653 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd6f=['Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','map','where','Campaign','ivr','format','%s:queue:%s','Agents','length','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','OpenchannelInteraction','OpenchannelInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','MailQueue','OpenchannelQueue','Trunk','VoiceQueues','FaxQueue','SmsQueues','WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','MailInteractions','user_has_mail_interactions:remove','FaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','log','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','User','role','agent','telephone','type','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll'];(function(_0x376482,_0x57bb69){var _0x365c80=function(_0x282d08){while(--_0x282d08){_0x376482['push'](_0x376482['shift']());}};_0x365c80(++_0x57bb69);}(_0xcd6f,0x17b));var _0xfcd6=function(_0x33c4fe,_0x5eb6c0){_0x33c4fe=_0x33c4fe-0x0;var _0x4920f7=_0xcd6f[_0x33c4fe];return _0x4920f7;};'use strict';var _=require(_0xfcd6('0x0'));var util=require(_0xfcd6('0x1'));var BPromise=require(_0xfcd6('0x2'));var db=require(_0xfcd6('0x3'))['db'];var config=require(_0xfcd6('0x4'));var queryQueues={'attributes':['id',_0xfcd6('0x5')],'include':[{'as':'Agents','model':db[_0xfcd6('0x6')],'attributes':['id',_0xfcd6('0x5'),_0xfcd6('0x7')],'raw':!![],'where':{'role':_0xfcd6('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xfcd6('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xfcd6('0x5')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0xfcd6('0x5'),_0xfcd6('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x7a7f84,_0x541225,_0x12dc78){return db['UserProfileSection']['findOne']({'where':{'name':_0x7a7f84,'userProfileId':_0x541225},'raw':!![]})['then'](function(_0x43b053){if(_0x43b053){if(_0x43b053['autoAssociation']){switch(_0x7a7f84){case'VoiceQueues':case _0xfcd6('0xb'):case _0xfcd6('0xc'):case'SmsQueues':case _0xfcd6('0xd'):case _0xfcd6('0xe'):case _0xfcd6('0xf'):return db[_0x12dc78][_0xfcd6('0x10')](queryQueues);case _0xfcd6('0x11'):return db[_0x12dc78][_0xfcd6('0x10')](queryTelephones);case _0xfcd6('0x12'):return db[_0x12dc78][_0xfcd6('0x10')](queryTrunks);case _0xfcd6('0x13'):return db[_0x12dc78][_0xfcd6('0x10')](queryCampaigns);}}else{return db[_0xfcd6('0x14')][_0xfcd6('0x10')]({'attributes':[_0xfcd6('0x15')],'where':{'sectionId':_0x43b053['id']},'raw':!![]})[_0xfcd6('0x16')](function(_0x47ff00){if(_0x47ff00){var _0x4da943={'where':{'id':_[_0xfcd6('0x17')](_0x47ff00,_0xfcd6('0x15'))},'raw':!![]};switch(_0x12dc78){case'User':_0x4da943[_0xfcd6('0x18')][_0xfcd6('0x7')]=_0xfcd6('0x9');break;case _0xfcd6('0x19'):_0x4da943['where']['type']=_0xfcd6('0x1a');break;}return db[_0x12dc78][_0xfcd6('0x10')](_0x4da943);}else{return[];}});}}else{return[];}})[_0xfcd6('0x16')](function(_0x594357){return _0x594357;});}function joinOrLeaveQueues(_0x5969ca,_0x123131,_0x53bb4c,_0x1176c6){_0x5969ca[_0x123131](util[_0xfcd6('0x1b')](_0xfcd6('0x1c'),_0x53bb4c,_0x1176c6[_0xfcd6('0x5')]));if(_0x1176c6[_0xfcd6('0x1d')]){for(var _0x3affd6=0x0;_0x3affd6<_0x1176c6[_0xfcd6('0x1d')][_0xfcd6('0x1e')];_0x3affd6+=0x1){_0x5969ca[_0x123131](util[_0xfcd6('0x1b')]('user:%s',_0x1176c6[_0xfcd6('0x1d')][_0x3affd6]['name']));}}}function joinOrLeave(_0x318771,_0x173e7d,_0x47b880){var _0xdb56c7;if(_0x318771[_0xfcd6('0x1f')][_0xfcd6('0x20')]['id']){db[_0xfcd6('0x6')][_0xfcd6('0x21')]({'attributes':['id',_0xfcd6('0x5'),'role',_0xfcd6('0x22')],'where':{'id':_0x318771['handshake'][_0xfcd6('0x20')]['id']},'include':[{'model':db[_0xfcd6('0x23')],'as':_0xfcd6('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xfcd6('0x25')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xfcd6('0x26')],'as':_0xfcd6('0x27'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0xfcd6('0x16')](function(_0x150c63){if(_0x150c63){_0xdb56c7=_0x150c63;_0x318771[_0x173e7d](util[_0xfcd6('0x1b')](_0xfcd6('0x28'),_0x150c63[_0xfcd6('0x5')]));var _0x15e459=[];switch(_0x150c63['role']){case _0xfcd6('0x29'):_0x318771[_0x173e7d](_0xfcd6('0x2a'));_0x318771[_0x173e7d](_0xfcd6('0x2b'));if(queryQueues[_0xfcd6('0x2c')](_0xfcd6('0x2d'))){delete queryQueues['include'];}_0x15e459['push'](db[_0xfcd6('0x2e')][_0xfcd6('0x10')](queryQueues));_0x15e459[_0xfcd6('0x2f')](db[_0xfcd6('0x30')][_0xfcd6('0x10')](queryQueues));_0x15e459['push'](db['FaxQueue'][_0xfcd6('0x10')](queryQueues));_0x15e459[_0xfcd6('0x2f')](db['SmsQueue'][_0xfcd6('0x10')](queryQueues));_0x15e459[_0xfcd6('0x2f')](db[_0xfcd6('0x31')][_0xfcd6('0x10')](queryQueues));_0x15e459[_0xfcd6('0x2f')](db[_0xfcd6('0x32')][_0xfcd6('0x10')](queryQueues));_0x15e459['push'](db['WhatsappQueue'][_0xfcd6('0x10')](queryQueues));_0x15e459[_0xfcd6('0x2f')](db['User']['findAll'](queryTelephones));_0x15e459['push'](db[_0xfcd6('0x33')][_0xfcd6('0x10')](queryTrunks));_0x15e459['push'](db['Campaign'][_0xfcd6('0x10')](queryCampaigns));_0x15e459[_0xfcd6('0x2f')](db[_0xfcd6('0x6')][_0xfcd6('0x10')](queryAgents));break;case'user':_0x318771[_0x173e7d](_0xfcd6('0x2a'));_0x318771[_0x173e7d](_0xfcd6('0x2b'));_0x15e459[_0xfcd6('0x2f')](getAssociatedResources(_0xfcd6('0x34'),_0x150c63['userProfileId'],_0xfcd6('0x2e')));_0x15e459[_0xfcd6('0x2f')](getAssociatedResources(_0xfcd6('0xb'),_0x150c63[_0xfcd6('0x22')],_0xfcd6('0x30')));_0x15e459[_0xfcd6('0x2f')](getAssociatedResources('FaxQueues',_0x150c63[_0xfcd6('0x22')],_0xfcd6('0x35')));_0x15e459['push'](getAssociatedResources(_0xfcd6('0x36'),_0x150c63[_0xfcd6('0x22')],'SmsQueue'));_0x15e459['push'](getAssociatedResources(_0xfcd6('0xd'),_0x150c63[_0xfcd6('0x22')],_0xfcd6('0x31')));_0x15e459[_0xfcd6('0x2f')](getAssociatedResources(_0xfcd6('0xe'),_0x150c63[_0xfcd6('0x22')],'OpenchannelQueue'));_0x15e459[_0xfcd6('0x2f')](getAssociatedResources(_0xfcd6('0xf'),_0x150c63['userProfileId'],_0xfcd6('0x37')));_0x15e459['push'](getAssociatedResources('Telephones',_0x150c63[_0xfcd6('0x22')],_0xfcd6('0x6')));_0x15e459[_0xfcd6('0x2f')](getAssociatedResources(_0xfcd6('0x12'),_0x150c63[_0xfcd6('0x22')],_0xfcd6('0x33')));_0x15e459[_0xfcd6('0x2f')](getAssociatedResources(_0xfcd6('0x13'),_0x150c63[_0xfcd6('0x22')],_0xfcd6('0x19')));_0x15e459[_0xfcd6('0x2f')](db['User'][_0xfcd6('0x10')](queryAgents));break;case _0xfcd6('0x8'):_0x318771[_0x173e7d](_0xfcd6('0x2a'));_0x318771[_0x173e7d]('voice:outbound');_0x15e459['push'](_0x150c63[_0xfcd6('0x38')]({'attributes':['id',_0xfcd6('0x5')]}));_0x15e459[_0xfcd6('0x2f')](_0x150c63[_0xfcd6('0x39')]({'attributes':['id',_0xfcd6('0x5')]}));_0x15e459['push'](_0x150c63[_0xfcd6('0x3a')]({'attributes':['id',_0xfcd6('0x5')]}));_0x15e459['push'](_0x150c63[_0xfcd6('0x3b')]({'attributes':['id',_0xfcd6('0x5')]}));_0x15e459[_0xfcd6('0x2f')](_0x150c63['getMailQueues']({'attributes':['id','name']}));_0x15e459[_0xfcd6('0x2f')](_0x150c63['getOpenchannelQueues']({'attributes':['id',_0xfcd6('0x5')]}));_0x15e459[_0xfcd6('0x2f')](_0x150c63[_0xfcd6('0x3c')]({'attributes':['id','name']}));break;}return BPromise[_0xfcd6('0x3d')](_0x15e459);}})[_0xfcd6('0x16')](function(_0x194ce9){if(_0x194ce9&&_0x194ce9[_0xfcd6('0x1e')]){for(var _0x4d928f=0x0;_0x4d928f<_0x194ce9[_0xfcd6('0x1e')];_0x4d928f+=0x1){for(var _0x2f5f50=0x0;_0x2f5f50<_0x194ce9[_0x4d928f][_0xfcd6('0x1e')];_0x2f5f50+=0x1){switch(_0x4d928f){case 0x0:joinOrLeaveQueues(_0x318771,_0x173e7d,_0xfcd6('0x3e'),_0x194ce9[_0x4d928f][_0x2f5f50]);break;case 0x1:joinOrLeaveQueues(_0x318771,_0x173e7d,_0xfcd6('0x3f'),_0x194ce9[_0x4d928f][_0x2f5f50]);break;case 0x2:joinOrLeaveQueues(_0x318771,_0x173e7d,_0xfcd6('0x40'),_0x194ce9[_0x4d928f][_0x2f5f50]);break;case 0x3:joinOrLeaveQueues(_0x318771,_0x173e7d,_0xfcd6('0x41'),_0x194ce9[_0x4d928f][_0x2f5f50]);break;case 0x4:joinOrLeaveQueues(_0x318771,_0x173e7d,_0xfcd6('0x42'),_0x194ce9[_0x4d928f][_0x2f5f50]);break;case 0x5:joinOrLeaveQueues(_0x318771,_0x173e7d,_0xfcd6('0x43'),_0x194ce9[_0x4d928f][_0x2f5f50]);break;case 0x6:joinOrLeaveQueues(_0x318771,_0x173e7d,_0xfcd6('0x44'),_0x194ce9[_0x4d928f][_0x2f5f50]);break;case 0x7:if(_0xdb56c7[_0xfcd6('0x7')]!=='agent')_0x318771[_0x173e7d](util[_0xfcd6('0x1b')](_0xfcd6('0x45'),_0x194ce9[_0x4d928f][_0x2f5f50][_0xfcd6('0x5')]));break;case 0x8:if(_0xdb56c7['role']!==_0xfcd6('0x8'))_0x318771[_0x173e7d](util[_0xfcd6('0x1b')](_0xfcd6('0x46'),_0x194ce9[_0x4d928f][_0x2f5f50][_0xfcd6('0x5')]));break;case 0x9:if(_0xdb56c7[_0xfcd6('0x7')]!==_0xfcd6('0x8'))_0x318771[_0x173e7d](util[_0xfcd6('0x1b')](_0xfcd6('0x47'),_0x194ce9[_0x4d928f][_0x2f5f50][_0xfcd6('0xa')],_0x194ce9[_0x4d928f][_0x2f5f50][_0xfcd6('0x5')]));break;case 0xa:_0x318771[_0x173e7d](util[_0xfcd6('0x1b')](_0xfcd6('0x28'),_0x194ce9[_0x4d928f][_0x2f5f50]['name']));break;}}}}})[_0xfcd6('0x16')](function(){if(_0x173e7d===_0xfcd6('0x48')){var _0x57355b=_[_0xfcd6('0x17')](_0xdb56c7[_0xfcd6('0x24')],'id');return _0xdb56c7[_0xfcd6('0x49')](_0x57355b)['then'](function(){for(var _0x3308f7=0x0;_0x3308f7<_0x57355b[_0xfcd6('0x1e')];_0x3308f7+=0x1){_0x47b880[_0xfcd6('0x4a')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x57355b[_0x3308f7]),'UserId':Number(_0xdb56c7['id'])});}});}})[_0xfcd6('0x16')](function(){if(_0x173e7d==='leave'){var _0x5a7ffa=_[_0xfcd6('0x17')](_0xdb56c7[_0xfcd6('0x4b')],'id');return _0xdb56c7['removeMailInteractions'](_0x5a7ffa)[_0xfcd6('0x16')](function(){for(var _0x358fcf=0x0;_0x358fcf<_0x5a7ffa[_0xfcd6('0x1e')];_0x358fcf+=0x1){_0x47b880[_0xfcd6('0x4a')](_0xfcd6('0x4c'),{'MailInteractionId':Number(_0x5a7ffa[_0x358fcf]),'UserId':Number(_0xdb56c7['id'])});}});}})['then'](function(){if(_0x173e7d===_0xfcd6('0x48')){var _0x2a6925=_['map'](_0xdb56c7[_0xfcd6('0x4d')],'id');return _0xdb56c7['removeFaxInteractions'](_0x2a6925)[_0xfcd6('0x16')](function(){for(var _0x2bb55e=0x0;_0x2bb55e<_0x2a6925[_0xfcd6('0x1e')];_0x2bb55e+=0x1){_0x47b880[_0xfcd6('0x4a')](_0xfcd6('0x4e'),{'FaxInteractionId':Number(_0x2a6925[_0x2bb55e]),'UserId':Number(_0xdb56c7['id'])});}});}})['then'](function(){if(_0x173e7d===_0xfcd6('0x48')){var _0xb2ef13=_[_0xfcd6('0x17')](_0xdb56c7[_0xfcd6('0x4f')],'id');return _0xdb56c7[_0xfcd6('0x50')](_0xb2ef13)[_0xfcd6('0x16')](function(){for(var _0x4b06f2=0x0;_0x4b06f2<_0xb2ef13[_0xfcd6('0x1e')];_0x4b06f2+=0x1){_0x47b880[_0xfcd6('0x4a')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0xb2ef13[_0x4b06f2]),'UserId':Number(_0xdb56c7['id'])});}});}})['then'](function(){if(_0x173e7d===_0xfcd6('0x48')){var _0x1f70f4=_[_0xfcd6('0x17')](_0xdb56c7['OpenchannelInteractions'],'id');return _0xdb56c7[_0xfcd6('0x51')](_0x1f70f4)[_0xfcd6('0x16')](function(){for(var _0x1dc227=0x0;_0x1dc227<_0x1f70f4['length'];_0x1dc227+=0x1){_0x47b880[_0xfcd6('0x4a')](_0xfcd6('0x52'),{'OpenchannelInteractionId':Number(_0x1f70f4[_0x1dc227]),'UserId':Number(_0xdb56c7['id'])});}});}})['then'](function(){if(_0x173e7d===_0xfcd6('0x48')){var _0x450c5c=_[_0xfcd6('0x17')](_0xdb56c7[_0xfcd6('0x53')],'id');return _0xdb56c7[_0xfcd6('0x54')](_0x450c5c)['then'](function(){for(var _0x562629=0x0;_0x562629<_0x450c5c[_0xfcd6('0x1e')];_0x562629+=0x1){_0x47b880[_0xfcd6('0x4a')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x450c5c[_0x562629]),'UserId':Number(_0xdb56c7['id'])});}});}})['catch'](function(_0x5a0e50){_0x318771[_0xfcd6('0x55')](_0x5a0e50);});}}function onDisconnect(_0xb710dd,_0x2d6bc2){joinOrLeave(_0xb710dd,_0xfcd6('0x48'),_0x2d6bc2);}function onConnect(_0x2f15de){joinOrLeave(_0x2f15de,'join');}exports[_0xfcd6('0x56')]=function(_0x340b5f){_0x340b5f['on'](_0xfcd6('0x57'),function(_0x1e4817){_0x1e4817[_0xfcd6('0x58')](0x0);_0x1e4817[_0xfcd6('0x59')]=_0x1e4817[_0xfcd6('0x5a')][_0xfcd6('0x57')][_0xfcd6('0x5b')]+':'+_0x1e4817[_0xfcd6('0x5a')][_0xfcd6('0x57')][_0xfcd6('0x5c')];_0x1e4817[_0xfcd6('0x5d')]=new Date();_0x1e4817[_0xfcd6('0x55')]=function(_0x171056){console[_0xfcd6('0x55')](_0xfcd6('0x5e')+_0x1e4817[_0xfcd6('0x5f')]['name']+'['+_0x1e4817[_0xfcd6('0x59')]+']',_0x171056);};_0x1e4817['on'](_0xfcd6('0x60'),function(){onDisconnect(_0x1e4817,_0x340b5f);_0x1e4817[_0xfcd6('0x55')](_0xfcd6('0x61'));});onConnect(_0x1e4817);_0x1e4817[_0xfcd6('0x55')](_0xfcd6('0x62'));});}; \ No newline at end of file +var _0xa57e=['bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','where','Campaign','type','format','%s:queue:%s','length','user:%s','query','find','handshake','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','include','push','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','userProfileId','VoiceQueue','FaxQueue','OpenchannelQueues','voice:outbound','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave','ChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util'];(function(_0x3fc807,_0x16ee12){var _0x2a4b4d=function(_0x2101f4){while(--_0x2101f4){_0x3fc807['push'](_0x3fc807['shift']());}};_0x2a4b4d(++_0x16ee12);}(_0xa57e,0x67));var _0xea57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa57e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xea57('0x0'));var util=require(_0xea57('0x1'));var BPromise=require(_0xea57('0x2'));var db=require(_0xea57('0x3'))['db'];var config=require(_0xea57('0x4'));var queryQueues={'attributes':['id',_0xea57('0x5')],'include':[{'as':_0xea57('0x6'),'model':db[_0xea57('0x7')],'attributes':['id',_0xea57('0x5'),_0xea57('0x8')],'raw':!![],'where':{'role':_0xea57('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xea57('0x5')],'where':{'role':_0xea57('0xa')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xea57('0x5')],'where':{'role':_0xea57('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xea57('0x5'),'type'],'where':{'type':_0xea57('0xb')}};function getAssociatedResources(_0x332016,_0x107deb,_0x571ced){return db[_0xea57('0xc')][_0xea57('0xd')]({'where':{'name':_0x332016,'userProfileId':_0x107deb},'raw':!![]})[_0xea57('0xe')](function(_0x3b0bd9){if(_0x3b0bd9){if(_0x3b0bd9[_0xea57('0xf')]){switch(_0x332016){case _0xea57('0x10'):case _0xea57('0x11'):case _0xea57('0x12'):case _0xea57('0x13'):case _0xea57('0x14'):case'OpenchannelQueues':case _0xea57('0x15'):return db[_0x571ced][_0xea57('0x16')](queryQueues);case _0xea57('0x17'):return db[_0x571ced][_0xea57('0x16')](queryTelephones);case _0xea57('0x18'):return db[_0x571ced][_0xea57('0x16')](queryTrunks);case _0xea57('0x19'):return db[_0x571ced]['findAll'](queryCampaigns);}}else{return db[_0xea57('0x1a')][_0xea57('0x16')]({'attributes':['resourceId'],'where':{'sectionId':_0x3b0bd9['id']},'raw':!![]})[_0xea57('0xe')](function(_0x1cc12b){if(_0x1cc12b){var _0x3a34f7={'where':{'id':_[_0xea57('0x1b')](_0x1cc12b,_0xea57('0x1c'))},'raw':!![]};switch(_0x571ced){case _0xea57('0x7'):_0x3a34f7[_0xea57('0x1d')][_0xea57('0x8')]=_0xea57('0xa');break;case _0xea57('0x1e'):_0x3a34f7[_0xea57('0x1d')][_0xea57('0x1f')]=_0xea57('0xb');break;}return db[_0x571ced]['findAll'](_0x3a34f7);}else{return[];}});}}else{return[];}})[_0xea57('0xe')](function(_0x333cb9){return _0x333cb9;});}function joinOrLeaveQueues(_0x3abd95,_0x5e9a22,_0x541b40,_0x1514b7){_0x3abd95[_0x5e9a22](util[_0xea57('0x20')](_0xea57('0x21'),_0x541b40,_0x1514b7[_0xea57('0x5')]));if(_0x1514b7[_0xea57('0x6')]){for(var _0x3a6051=0x0;_0x3a6051<_0x1514b7[_0xea57('0x6')][_0xea57('0x22')];_0x3a6051+=0x1){_0x3abd95[_0x5e9a22](util['format'](_0xea57('0x23'),_0x1514b7[_0xea57('0x6')][_0x3a6051][_0xea57('0x5')]));}}}function joinOrLeave(_0x1d154f,_0x2bad6d,_0x5e534b){var _0x3e724f;if(_0x1d154f['handshake'][_0xea57('0x24')]['id']){db[_0xea57('0x7')][_0xea57('0x25')]({'attributes':['id',_0xea57('0x5'),'role','userProfileId'],'where':{'id':_0x1d154f[_0xea57('0x26')][_0xea57('0x24')]['id']},'include':[{'model':db[_0xea57('0x27')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xea57('0x28')],'as':_0xea57('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xea57('0x2a')],'as':_0xea57('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xea57('0x2c'),'attributes':['id'],'raw':!![]},{'model':db[_0xea57('0x2d')],'as':_0xea57('0x2e'),'attributes':['id'],'raw':!![]},{'model':db[_0xea57('0x2f')],'as':_0xea57('0x30'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x38c1a7){if(_0x38c1a7){_0x3e724f=_0x38c1a7;_0x1d154f[_0x2bad6d](util[_0xea57('0x20')](_0xea57('0x23'),_0x38c1a7[_0xea57('0x5')]));var _0x1b7528=[];switch(_0x38c1a7['role']){case _0xea57('0x31'):_0x1d154f[_0x2bad6d](_0xea57('0x32'));_0x1d154f[_0x2bad6d]('voice:outbound');if(queryQueues['hasOwnProperty'](_0xea57('0x33'))){delete queryQueues['include'];}_0x1b7528[_0xea57('0x34')](db['VoiceQueue'][_0xea57('0x16')](queryQueues));_0x1b7528['push'](db['ChatQueue']['findAll'](queryQueues));_0x1b7528[_0xea57('0x34')](db['FaxQueue'][_0xea57('0x16')](queryQueues));_0x1b7528['push'](db['SmsQueue']['findAll'](queryQueues));_0x1b7528['push'](db[_0xea57('0x35')][_0xea57('0x16')](queryQueues));_0x1b7528['push'](db[_0xea57('0x36')][_0xea57('0x16')](queryQueues));_0x1b7528[_0xea57('0x34')](db[_0xea57('0x37')][_0xea57('0x16')](queryQueues));_0x1b7528[_0xea57('0x34')](db['User'][_0xea57('0x16')](queryTelephones));_0x1b7528['push'](db[_0xea57('0x38')]['findAll'](queryTrunks));_0x1b7528[_0xea57('0x34')](db[_0xea57('0x1e')]['findAll'](queryCampaigns));_0x1b7528[_0xea57('0x34')](db[_0xea57('0x7')][_0xea57('0x16')](queryAgents));break;case _0xea57('0x39'):_0x1d154f[_0x2bad6d](_0xea57('0x32'));_0x1d154f[_0x2bad6d]('voice:outbound');_0x1b7528[_0xea57('0x34')](getAssociatedResources(_0xea57('0x10'),_0x38c1a7[_0xea57('0x3a')],_0xea57('0x3b')));_0x1b7528[_0xea57('0x34')](getAssociatedResources(_0xea57('0x11'),_0x38c1a7[_0xea57('0x3a')],'ChatQueue'));_0x1b7528[_0xea57('0x34')](getAssociatedResources(_0xea57('0x12'),_0x38c1a7[_0xea57('0x3a')],_0xea57('0x3c')));_0x1b7528[_0xea57('0x34')](getAssociatedResources(_0xea57('0x13'),_0x38c1a7[_0xea57('0x3a')],'SmsQueue'));_0x1b7528[_0xea57('0x34')](getAssociatedResources(_0xea57('0x14'),_0x38c1a7[_0xea57('0x3a')],'MailQueue'));_0x1b7528[_0xea57('0x34')](getAssociatedResources(_0xea57('0x3d'),_0x38c1a7[_0xea57('0x3a')],_0xea57('0x36')));_0x1b7528[_0xea57('0x34')](getAssociatedResources(_0xea57('0x15'),_0x38c1a7[_0xea57('0x3a')],_0xea57('0x37')));_0x1b7528[_0xea57('0x34')](getAssociatedResources('Telephones',_0x38c1a7[_0xea57('0x3a')],_0xea57('0x7')));_0x1b7528[_0xea57('0x34')](getAssociatedResources(_0xea57('0x18'),_0x38c1a7['userProfileId'],'Trunk'));_0x1b7528['push'](getAssociatedResources(_0xea57('0x19'),_0x38c1a7[_0xea57('0x3a')],'Campaign'));_0x1b7528[_0xea57('0x34')](db[_0xea57('0x7')][_0xea57('0x16')](queryAgents));break;case _0xea57('0x9'):_0x1d154f[_0x2bad6d](_0xea57('0x32'));_0x1d154f[_0x2bad6d](_0xea57('0x3e'));_0x1b7528[_0xea57('0x34')](_0x38c1a7['getVoiceQueues']({'attributes':['id','name']}));_0x1b7528[_0xea57('0x34')](_0x38c1a7[_0xea57('0x3f')]({'attributes':['id','name']}));_0x1b7528['push'](_0x38c1a7[_0xea57('0x40')]({'attributes':['id',_0xea57('0x5')]}));_0x1b7528[_0xea57('0x34')](_0x38c1a7[_0xea57('0x41')]({'attributes':['id',_0xea57('0x5')]}));_0x1b7528[_0xea57('0x34')](_0x38c1a7[_0xea57('0x42')]({'attributes':['id','name']}));_0x1b7528[_0xea57('0x34')](_0x38c1a7[_0xea57('0x43')]({'attributes':['id',_0xea57('0x5')]}));_0x1b7528[_0xea57('0x34')](_0x38c1a7[_0xea57('0x44')]({'attributes':['id',_0xea57('0x5')]}));break;}return BPromise[_0xea57('0x45')](_0x1b7528);}})[_0xea57('0xe')](function(_0x53f7d6){if(_0x53f7d6&&_0x53f7d6['length']){for(var _0x1f4011=0x0;_0x1f4011<_0x53f7d6[_0xea57('0x22')];_0x1f4011+=0x1){for(var _0x348539=0x0;_0x348539<_0x53f7d6[_0x1f4011]['length'];_0x348539+=0x1){switch(_0x1f4011){case 0x0:joinOrLeaveQueues(_0x1d154f,_0x2bad6d,'voice',_0x53f7d6[_0x1f4011][_0x348539]);break;case 0x1:joinOrLeaveQueues(_0x1d154f,_0x2bad6d,_0xea57('0x46'),_0x53f7d6[_0x1f4011][_0x348539]);break;case 0x2:joinOrLeaveQueues(_0x1d154f,_0x2bad6d,_0xea57('0x47'),_0x53f7d6[_0x1f4011][_0x348539]);break;case 0x3:joinOrLeaveQueues(_0x1d154f,_0x2bad6d,'sms',_0x53f7d6[_0x1f4011][_0x348539]);break;case 0x4:joinOrLeaveQueues(_0x1d154f,_0x2bad6d,_0xea57('0x48'),_0x53f7d6[_0x1f4011][_0x348539]);break;case 0x5:joinOrLeaveQueues(_0x1d154f,_0x2bad6d,_0xea57('0x49'),_0x53f7d6[_0x1f4011][_0x348539]);break;case 0x6:joinOrLeaveQueues(_0x1d154f,_0x2bad6d,_0xea57('0x4a'),_0x53f7d6[_0x1f4011][_0x348539]);break;case 0x7:if(_0x3e724f[_0xea57('0x8')]!==_0xea57('0x9'))_0x1d154f[_0x2bad6d](util[_0xea57('0x20')](_0xea57('0x4b'),_0x53f7d6[_0x1f4011][_0x348539][_0xea57('0x5')]));break;case 0x8:if(_0x3e724f['role']!==_0xea57('0x9'))_0x1d154f[_0x2bad6d](util['format'](_0xea57('0x4c'),_0x53f7d6[_0x1f4011][_0x348539]['name']));break;case 0x9:if(_0x3e724f[_0xea57('0x8')]!==_0xea57('0x9'))_0x1d154f[_0x2bad6d](util[_0xea57('0x20')]('campaign:%s:%s',_0x53f7d6[_0x1f4011][_0x348539]['type'],_0x53f7d6[_0x1f4011][_0x348539][_0xea57('0x5')]));break;case 0xa:_0x1d154f[_0x2bad6d](util[_0xea57('0x20')]('user:%s',_0x53f7d6[_0x1f4011][_0x348539][_0xea57('0x5')]));break;}}}}})[_0xea57('0xe')](function(){if(_0x2bad6d===_0xea57('0x4d')){var _0x2e29a0=_[_0xea57('0x1b')](_0x3e724f[_0xea57('0x4e')],'id');return _0x3e724f['removeChatInteractions'](_0x2e29a0)['then'](function(){for(var _0x3d6129=0x0;_0x3d6129<_0x2e29a0[_0xea57('0x22')];_0x3d6129+=0x1){_0x5e534b['emit'](_0xea57('0x4f'),{'ChatInteractionId':Number(_0x2e29a0[_0x3d6129]),'UserId':Number(_0x3e724f['id'])});}});}})[_0xea57('0xe')](function(){if(_0x2bad6d===_0xea57('0x4d')){var _0x39b421=_[_0xea57('0x1b')](_0x3e724f[_0xea57('0x29')],'id');return _0x3e724f[_0xea57('0x50')](_0x39b421)[_0xea57('0xe')](function(){for(var _0x12a496=0x0;_0x12a496<_0x39b421[_0xea57('0x22')];_0x12a496+=0x1){_0x5e534b[_0xea57('0x51')](_0xea57('0x52'),{'MailInteractionId':Number(_0x39b421[_0x12a496]),'UserId':Number(_0x3e724f['id'])});}});}})[_0xea57('0xe')](function(){if(_0x2bad6d===_0xea57('0x4d')){var _0x2799c0=_[_0xea57('0x1b')](_0x3e724f[_0xea57('0x2b')],'id');return _0x3e724f[_0xea57('0x53')](_0x2799c0)[_0xea57('0xe')](function(){for(var _0x1a34d6=0x0;_0x1a34d6<_0x2799c0[_0xea57('0x22')];_0x1a34d6+=0x1){_0x5e534b['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x2799c0[_0x1a34d6]),'UserId':Number(_0x3e724f['id'])});}});}})[_0xea57('0xe')](function(){if(_0x2bad6d===_0xea57('0x4d')){var _0x5a2633=_['map'](_0x3e724f[_0xea57('0x2c')],'id');return _0x3e724f[_0xea57('0x54')](_0x5a2633)['then'](function(){for(var _0x2afd87=0x0;_0x2afd87<_0x5a2633[_0xea57('0x22')];_0x2afd87+=0x1){_0x5e534b['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x5a2633[_0x2afd87]),'UserId':Number(_0x3e724f['id'])});}});}})[_0xea57('0xe')](function(){if(_0x2bad6d==='leave'){var _0x1acf0d=_[_0xea57('0x1b')](_0x3e724f[_0xea57('0x2e')],'id');return _0x3e724f[_0xea57('0x55')](_0x1acf0d)[_0xea57('0xe')](function(){for(var _0x14158d=0x0;_0x14158d<_0x1acf0d[_0xea57('0x22')];_0x14158d+=0x1){_0x5e534b[_0xea57('0x51')](_0xea57('0x56'),{'OpenchannelInteractionId':Number(_0x1acf0d[_0x14158d]),'UserId':Number(_0x3e724f['id'])});}});}})[_0xea57('0xe')](function(){if(_0x2bad6d==='leave'){var _0x5a1f76=_[_0xea57('0x1b')](_0x3e724f[_0xea57('0x30')],'id');return _0x3e724f[_0xea57('0x57')](_0x5a1f76)[_0xea57('0xe')](function(){for(var _0x1ce435=0x0;_0x1ce435<_0x5a1f76['length'];_0x1ce435+=0x1){_0x5e534b['emit'](_0xea57('0x58'),{'WhatsappInteractionId':Number(_0x5a1f76[_0x1ce435]),'UserId':Number(_0x3e724f['id'])});}});}})[_0xea57('0x59')](function(_0x44c086){_0x1d154f[_0xea57('0x5a')](_0x44c086);});}}function onDisconnect(_0x123fa6,_0x4f8172){joinOrLeave(_0x123fa6,_0xea57('0x4d'),_0x4f8172);}function onConnect(_0x38956e){joinOrLeave(_0x38956e,_0xea57('0x5b'));}exports[_0xea57('0x5c')]=function(_0x2aa854){_0x2aa854['on'](_0xea57('0x5d'),function(_0x423372){_0x423372[_0xea57('0x5e')](0x0);_0x423372[_0xea57('0x5f')]=_0x423372[_0xea57('0x60')][_0xea57('0x5d')][_0xea57('0x61')]+':'+_0x423372['request'][_0xea57('0x5d')][_0xea57('0x62')];_0x423372[_0xea57('0x63')]=new Date();_0x423372[_0xea57('0x5a')]=function(_0x55dfd4){console['log'](_0xea57('0x64')+_0x423372[_0xea57('0x65')][_0xea57('0x5')]+'['+_0x423372['address']+']',_0x55dfd4);};_0x423372['on'](_0xea57('0x66'),function(){onDisconnect(_0x423372,_0x2aa854);_0x423372[_0xea57('0x5a')](_0xea57('0x67'));});onConnect(_0x423372);_0x423372['log'](_0xea57('0x68'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 371f52b..c3d1178 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 _0x5943=['model','hook','condition','util','jayson/promise','../logger','triggers','client','http','Chat','afterCreate','newinteraction','ChatInteraction','afterUpdate','closedinteraction','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','newmessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','info','Trigger,\x20%s','EventManager','error','code','catch','channel','motionChannel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','then','contact','User','find','UserId','fullname','email','internal','interface','format','SIP/%s','outgoingmessage','changed','closed','substatus','name','agent','length'];(function(_0x97cba7,_0x404d4f){var _0x31b7fb=function(_0x13d61a){while(--_0x13d61a){_0x97cba7['push'](_0x97cba7['shift']());}};_0x31b7fb(++_0x404d4f);}(_0x5943,0xcc));var _0x3594=function(_0x4c7512,_0xac3c74){_0x4c7512=_0x4c7512-0x0;var _0x4e70b3=_0x5943[_0x4c7512];return _0x4e70b3;};'use strict';var util=require(_0x3594('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x3594('0x1'));var logger=require(_0x3594('0x2'))(_0x3594('0x3'));var _=require('lodash');var client=jayson[_0x3594('0x4')][_0x3594('0x5')]({'port':0x232a});var triggers=[{'channel':_0x3594('0x6'),'model':'ChatInteraction','event':_0x3594('0x7'),'condition':_0x3594('0x8'),'callback':afterCreate},{'channel':_0x3594('0x6'),'model':_0x3594('0x9'),'event':_0x3594('0xa'),'condition':_0x3594('0xb'),'callback':afterUpdate},{'channel':_0x3594('0x6'),'model':'ChatMessage','event':_0x3594('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x3594('0xc'),'model':_0x3594('0xd'),'event':'afterCreate','condition':_0x3594('0x8'),'callback':afterCreate},{'channel':_0x3594('0xc'),'model':'SmsInteraction','event':_0x3594('0xa'),'condition':_0x3594('0xb'),'callback':afterUpdate},{'channel':_0x3594('0xc'),'model':_0x3594('0xe'),'event':_0x3594('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x3594('0xf'),'model':_0x3594('0x10'),'event':_0x3594('0x7'),'condition':_0x3594('0x8'),'callback':afterCreate},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0x3594('0xa'),'condition':_0x3594('0xb'),'callback':afterUpdate},{'channel':_0x3594('0xf'),'model':_0x3594('0x11'),'event':_0x3594('0x7'),'condition':_0x3594('0x12'),'callback':afterCreateMessage},{'channel':_0x3594('0x13'),'model':_0x3594('0x14'),'event':_0x3594('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x3594('0x13'),'model':_0x3594('0x14'),'event':'afterUpdate','condition':_0x3594('0xb'),'callback':afterUpdate},{'channel':_0x3594('0x13'),'model':_0x3594('0x15'),'event':_0x3594('0x7'),'condition':_0x3594('0x12'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x3594('0x16'),'event':'afterCreate','condition':_0x3594('0x8'),'callback':afterCreate},{'channel':_0x3594('0x17'),'model':_0x3594('0x16'),'event':_0x3594('0xa'),'condition':_0x3594('0xb'),'callback':afterUpdate},{'channel':'Mail','model':_0x3594('0x18'),'event':_0x3594('0x7'),'condition':_0x3594('0x12'),'callback':afterCreateMessage},{'channel':_0x3594('0x19'),'model':_0x3594('0x1a'),'event':_0x3594('0x7'),'condition':_0x3594('0x8'),'callback':afterCreate},{'channel':_0x3594('0x19'),'model':_0x3594('0x1a'),'event':_0x3594('0xa'),'condition':_0x3594('0xb'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x3594('0x1b'),'event':'afterCreate','condition':_0x3594('0x12'),'callback':afterCreateMessage}];function request(_0x20bc1e){return client[_0x3594('0x1c')]('EventManager',_0x20bc1e)['then'](function(_0x4b221e){logger[_0x3594('0x1d')](_0x3594('0x1e'),_0x3594('0x1f'),_0x4b221e);if(_0x4b221e['error']){if(_0x4b221e[_0x3594('0x20')][_0x3594('0x21')]===0x1f4){logger[_0x3594('0x20')](_0x3594('0x1e'),'EventManager',_0x4b221e[_0x3594('0x20')]);}}})[_0x3594('0x22')](function(_0x280216){logger[_0x3594('0x20')](_0x3594('0x1e'),_0x3594('0x1f'),_0x280216);});}function afterCreateMessage(_0x16b865,_0x38c55e){return function(_0xdeb037,_0x20fa57){_0xdeb037=_0xdeb037['get']({'plain':!![]});_0xdeb037[_0x3594('0x23')]=_0x16b865;_0xdeb037[_0x3594('0x24')]=_0x16b865;_0xdeb037[_0x3594('0x25')]=_0xdeb037[_0x3594('0x26')];var _0x351169=_0x3594('0x27')+_0xdeb037[_0x3594('0x28')];return db[_0x3594('0x29')][_0x3594('0x2a')](_0x351169,{'type':db[_0x3594('0x2b')][_0x3594('0x2c')][_0x3594('0x2d')],'raw':!![]})[_0x3594('0x2e')](function(_0x26a41c){return _0x26a41c;})[_0x3594('0x2e')](function(_0x446129){if(_0x446129){_0xdeb037[_0x3594('0x2f')]=_0x446129[0x0];}if(_0xdeb037['UserId']){return db[_0x3594('0x30')][_0x3594('0x31')]({'where':{'id':_0xdeb037[_0x3594('0x32')]},'attributes':['id','name',_0x3594('0x33'),_0x3594('0x34'),_0x3594('0x35')],'raw':!![]})['then'](function(_0x24aaf3){_0xdeb037[_0x3594('0x36')]=util[_0x3594('0x37')](_0x3594('0x38'),_0x24aaf3['name']);_0xdeb037['channel']=_0x16b865;_0xdeb037['agent']=_0x24aaf3;return request({'event':'incomingmessage','message':_0xdeb037});})[_0x3594('0x22')](function(_0x4be6a6){console[_0x3594('0x20')](_0x4be6a6);});}else{return request({'event':_0x3594('0x39'),'message':_0xdeb037});}});};}function afterCreate(_0x571467,_0x30ab71){return function(_0x4143c2,_0x371a14){_0x4143c2=_0x4143c2['get']({'plain':!![]});_0x4143c2['channel']=_0x571467;_0x4143c2[_0x3594('0x24')]=_0x571467;_0x4143c2[_0x3594('0x25')]='opened';var _0x448d64=_0x3594('0x27')+_0x4143c2[_0x3594('0x28')];return db[_0x3594('0x29')][_0x3594('0x2a')](_0x448d64,{'type':db[_0x3594('0x2b')]['QueryTypes'][_0x3594('0x2d')],'raw':!![]})[_0x3594('0x2e')](function(_0x3b6ca6){return _0x3b6ca6;})[_0x3594('0x2e')](function(_0x447fd4){if(_0x447fd4){_0x4143c2['contact']=_0x447fd4[0x0];}return request({'event':_0x30ab71,'message':_0x4143c2});});};}function afterUpdate(_0x28c7f8){return function(_0x5669cc){var _0x2e297e=_0x5669cc[_0x3594('0x3a')]('closed')&&_0x5669cc[_0x3594('0x3b')];var _0x3443a0=_0x5669cc[_0x3594('0x3a')](_0x3594('0x3c'));if(_0x2e297e||_0x3443a0){var _0x5f5ac0=_0x2e297e?'closedinteraction':_0x3594('0x3c');var _0x5a45a0=_0x5669cc['get']({'plain':!![]});_0x5a45a0[_0x3594('0x23')]=_0x28c7f8;_0x5a45a0[_0x3594('0x24')]=_0x28c7f8;_0x5a45a0[_0x3594('0x25')]=_0x2e297e?'closed':'substatus';var _0x272df1=_0x3594('0x27')+_0x5a45a0[_0x3594('0x28')];return db[_0x3594('0x29')]['query'](_0x272df1,{'type':db[_0x3594('0x2b')]['QueryTypes']['SELECT'],'raw':!![]})[_0x3594('0x2e')](function(_0x1744d0){if(_0x1744d0){_0x5a45a0[_0x3594('0x2f')]=_0x1744d0[0x0];}if(_0x5a45a0[_0x3594('0x32')]){return db['User'][_0x3594('0x31')]({'where':{'id':_0x5a45a0[_0x3594('0x32')]},'attributes':['id',_0x3594('0x3d'),_0x3594('0x33'),_0x3594('0x34'),_0x3594('0x35')],'raw':!![]})[_0x3594('0x2e')](function(_0x56c691){_0x5a45a0[_0x3594('0x36')]=util['format'](_0x3594('0x38'),_0x56c691[_0x3594('0x3d')]);_0x5a45a0[_0x3594('0x3e')]=_0x56c691;return request({'event':_0x5f5ac0,'message':_0x5a45a0});})[_0x3594('0x22')](function(_0x3dc997){console[_0x3594('0x20')](_0x3dc997);});}else{return request({'event':_0x5f5ac0,'message':_0x5a45a0});}});}};}exports['default']=function(){for(var _0x3c3d4b=0x0;_0x3c3d4b=_0x507caa['agents']){throw Error(_0x0120('0x10'));}_0x147549(_0x16f390);})[_0x0120('0x11')](function(_0x4f28fa){_0x14a267(_0x4f28fa);});});}; \ No newline at end of file +var _0xc477=['count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','./license/util','voice','fax','whatsapp','openchannel','getChannels','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','role','User'];(function(_0xf84ad5,_0x2ca8dd){var _0x133bb1=function(_0x407ca3){while(--_0x407ca3){_0xf84ad5['push'](_0xf84ad5['shift']());}};_0x133bb1(++_0x2ca8dd);}(_0xc477,0x102));var _0x7c47=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0xc477[_0x32b993];return _0x482780;};'use strict';var _=require(_0x7c47('0x0'));var BPromise=require(_0x7c47('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x7c47('0x2'));var channels=[_0x7c47('0x3'),'mail','chat',_0x7c47('0x4'),'sms',_0x7c47('0x5'),_0x7c47('0x6')];exports[_0x7c47('0x7')]=function(){return channels;};exports['isValidChannel']=function(_0x3ba54f){_0x3ba54f=_0x3ba54f[_0x7c47('0x8')]();return _[_0x7c47('0x9')](channels,_0x3ba54f);};exports[_0x7c47('0xa')]=function(_0x239c63,_0x38530c,_0xd319f5,_0x1ab1a8){var _0x58da3a={'loginAttempts':_0x38530c,'blocked':_0xd319f5};if(!_[_0x7c47('0xb')](_0x1ab1a8)){_0x58da3a[_0x7c47('0xc')]=_0x1ab1a8;}return _0x239c63['updateAttributes'](_0x58da3a);};exports['getLicense']=function(_0x5c0580){return new BPromise(function(_0x433b2f,_0x3d2f05){var _0x5f7d23=0x0;if(_0x5c0580[_0x7c47('0xd')]!=='agent'){_0x433b2f(_0x5c0580);}db[_0x7c47('0xe')][_0x7c47('0xf')]({'where':{'role':_0x7c47('0x10'),'online':!![],'id':{'$ne':_0x5c0580['id']}}})[_0x7c47('0x11')](function(_0x40748a){_0x5f7d23=_0x40748a;return util['getLicense']();})[_0x7c47('0x11')](function(_0x335115){if(_0x335115&&_0x335115[_0x7c47('0x12')]&&_0x5f7d23>=_0x335115[_0x7c47('0x12')]){throw Error(_0x7c47('0x13'));}_0x433b2f(_0x5c0580);})[_0x7c47('0x14')](function(_0x519800){_0x3d2f05(_0x519800);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index a8700ff..e667336 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x688a=['render','json','exports','404','status'];(function(_0x1846b8,_0x5e9fd2){var _0x5d29ea=function(_0x26ffc3){while(--_0x26ffc3){_0x1846b8['push'](_0x1846b8['shift']());}};_0x5d29ea(++_0x5e9fd2);}(_0x688a,0x124));var _0xa688=function(_0x42267f,_0x2a65f4){_0x42267f=_0x42267f-0x0;var _0x3dda9b=_0x688a[_0x42267f];return _0x3dda9b;};'use strict';module[_0xa688('0x0')][0x194]=function pageNotFound(_0x28bea8,_0x1bcb12){var _0x4bb45e=_0xa688('0x1');var _0x53646f=0x194;var _0x27bb04={'status':_0x53646f};_0x1bcb12[_0xa688('0x2')](_0x27bb04['status']);_0x1bcb12[_0xa688('0x3')](_0x4bb45e,{},function(_0x415030,_0x27e6c4){if(_0x415030){return _0x1bcb12[_0xa688('0x2')](_0x27bb04[_0xa688('0x2')])[_0xa688('0x4')](_0x27bb04);}_0x1bcb12['send'](_0x27e6c4);});}; \ No newline at end of file +var _0x1a4d=['json','send','exports','status','render'];(function(_0x298048,_0x11dee7){var _0x292596=function(_0x37d7e3){while(--_0x37d7e3){_0x298048['push'](_0x298048['shift']());}};_0x292596(++_0x11dee7);}(_0x1a4d,0x12e));var _0xd1a4=function(_0x11054b,_0x4da7){_0x11054b=_0x11054b-0x0;var _0x5db45f=_0x1a4d[_0x11054b];return _0x5db45f;};'use strict';module[_0xd1a4('0x0')][0x194]=function pageNotFound(_0x42e9df,_0x222530){var _0x4b943e='404';var _0x147b2d=0x194;var _0x253db8={'status':_0x147b2d};_0x222530[_0xd1a4('0x1')](_0x253db8[_0xd1a4('0x1')]);_0x222530[_0xd1a4('0x2')](_0x4b943e,{},function(_0x4fb1a9,_0x21fa7b){if(_0x4fb1a9){return _0x222530[_0xd1a4('0x1')](_0x253db8[_0xd1a4('0x1')])[_0xd1a4('0x3')](_0x253db8);}_0x222530[_0xd1a4('0x4')](_0x21fa7b);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 29256a1..b5b0542 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1be1=['../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','ChatMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoField','../api/intZohoField/intZohoField.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','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','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','Recordings','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteraction','SenderId','belongsTo','userProfileId','belongsToMany','Groups','Contacts','cm_user_has_contacts','Lists','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','WhatsappInteractions','VoiceQueues','UserVoiceQueue','VoicePrefixes','MailQueues','FaxQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueue','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','Applications','Sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','Imap','Smtp','Answers','Interactions','List','ListId','TemplateId','team_has_mail_queues','Teams','Account','Contact','Owner','mail_interaction_has_tags','Tags','Tag','ThroughTags','Users','user_has_mail_interactions','MailInteractionId','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','restrict','TagId','Dispositions','FaxAccountId','Exntensions','fax_interaction_has_tags','FaxInteractionId','Attachment','team_has_fax_queues','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ProactiveActions','OpenchannelQueueReport','Agent','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CmCompany','CompanyId','CmHopper','Company','cm_contact_has_tags','Queue','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyCondition','TriggerAnyId','AnalyticFieldReport','Fields','MetricId','SalesforceConfiguration','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','VariableId','Field','DeskConfiguration','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskAccount','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowConfiguration','FromId','ToId','SessionId','ProjectId','user_has_square_projects','TeamVoiceQueue','ChatQueues','team_has_sms_queues','team_has_whatsapp_queues','TrunkBackup','SquareProjectId','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToAccount','FromAccount','ToAgent','ToChatQueueId','ToChatWebsiteId','ToFaxAccountId','FromOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','cm_user_has_lists','UserProfileSections','Resources','WhatsappAccountId','WhatsappInteractionId','user_has_whatsapp_interactions','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','exports','lodash','jstz','sequelize','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','name','utf8_general_ci','sequelizeHistory','utf8mb4','utf8','database','username','password','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsApplication/smsApplication.model'];(function(_0x739782,_0x1b92e0){var _0x87160f=function(_0x23601c){while(--_0x23601c){_0x739782['push'](_0x739782['shift']());}};_0x87160f(++_0x1b92e0);}(_0x1be1,0x192));var _0x11be=function(_0x483601,_0x65e4b1){_0x483601=_0x483601-0x0;var _0x3029e9=_0x1be1[_0x483601];return _0x3029e9;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0x11be('0x0'));var jstz=require(_0x11be('0x1'));var timezone=jstz['determine']();config[_0x11be('0x2')]=_[_0x11be('0x3')](config[_0x11be('0x2')],{'database':_0x11be('0x4'),'username':'xcall','password':_0x11be('0x5'),'options':{'host':_0x11be('0x6'),'port':0xcea,'dialect':_0x11be('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x11be('0x8')](),'define':{'charset':'utf8','collate':_0x11be('0x9')}}});config[_0x11be('0xa')]=_[_0x11be('0x3')](config[_0x11be('0xa')],{'database':_0x11be('0x4'),'username':'xcall','password':_0x11be('0x5'),'options':{'host':_0x11be('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x11be('0xb')},'logging':![],'timezone':timezone[_0x11be('0x8')](),'define':{'charset':_0x11be('0xc'),'collate':_0x11be('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x11be('0xd')],config[_0x11be('0x2')][_0x11be('0xe')],config['sequelize'][_0x11be('0xf')],config[_0x11be('0x2')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x11be('0xa')]['database'],config['sequelizeHistory']['username'],config['sequelizeHistory']['password'],config['sequelizeHistory']['options'])};db[_0x11be('0x10')]=db['sequelize'][_0x11be('0x11')](_0x11be('0x12'));db[_0x11be('0x13')]=db[_0x11be('0x2')]['import'](_0x11be('0x14'));db[_0x11be('0x15')]=db['sequelize'][_0x11be('0x11')](_0x11be('0x16'));db[_0x11be('0x17')]=db['sequelize']['import'](_0x11be('0x18'));db[_0x11be('0x19')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x11be('0x1a')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x1b'));db[_0x11be('0x1c')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x1d'));db[_0x11be('0x1e')]=db[_0x11be('0x2')]['import'](_0x11be('0x1f'));db[_0x11be('0x20')]=db[_0x11be('0x2')]['import']('../api/voiceMail/voiceMail.model');db[_0x11be('0x21')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x11be('0x22')]=db['sequelize'][_0x11be('0x11')]('../api/voiceCallReport/voiceCallReport.model');db[_0x11be('0x23')]=db[_0x11be('0x2')]['import'](_0x11be('0x24'));db[_0x11be('0x25')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x26'));db[_0x11be('0x27')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x28'));db['MemberReport']=db[_0x11be('0x2')]['import'](_0x11be('0x29'));db[_0x11be('0x2a')]=db['sequelize']['import'](_0x11be('0x2b'));db[_0x11be('0x2c')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x2d'));db[_0x11be('0x2e')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x2f'));db['UserVoiceQueue']=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x30'));db[_0x11be('0x31')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/userChatQueue/userChatQueue.model');db[_0x11be('0x32')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x33'));db[_0x11be('0x34')]=db['sequelize'][_0x11be('0x11')](_0x11be('0x35'));db[_0x11be('0x36')]=db['sequelize'][_0x11be('0x11')]('../api/userSmsQueue/userSmsQueue.model');db['UserOpenchannelQueue']=db['sequelize']['import'](_0x11be('0x37'));db[_0x11be('0x38')]=db[_0x11be('0x2')]['import'](_0x11be('0x39'));db[_0x11be('0x3a')]=db['sequelize'][_0x11be('0x11')]('../api/mailServerIn/mailServerIn.model');db[_0x11be('0x3b')]=db['sequelize'][_0x11be('0x11')](_0x11be('0x3c'));db[_0x11be('0x3d')]=db[_0x11be('0x2')]['import'](_0x11be('0x3e'));db[_0x11be('0x3f')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/mailQueue/mailQueue.model');db[_0x11be('0x40')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x41'));db[_0x11be('0x42')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/mailInteraction/mailInteraction.model');db[_0x11be('0x43')]=db[_0x11be('0x2')]['import'](_0x11be('0x44'));db[_0x11be('0x45')]=db['sequelize'][_0x11be('0x11')]('../api/mailApplication/mailApplication.model');db[_0x11be('0x46')]=db['sequelize'][_0x11be('0x11')](_0x11be('0x47'));db['Dashboard']=db[_0x11be('0x2')]['import'](_0x11be('0x48'));db[_0x11be('0x49')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x4a'));db[_0x11be('0x4b')]=db[_0x11be('0x2')]['import'](_0x11be('0x4c'));db[_0x11be('0x4d')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db['sequelize'][_0x11be('0x11')]('../api/faxInteraction/faxInteraction.model');db[_0x11be('0x4e')]=db['sequelize'][_0x11be('0x11')](_0x11be('0x4f'));db[_0x11be('0x50')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x51'));db[_0x11be('0x52')]=db['sequelize'][_0x11be('0x11')]('../api/faxQueueReport/faxQueueReport.model');db[_0x11be('0x53')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db['sequelize'][_0x11be('0x11')](_0x11be('0x54'));db['SmsInteraction']=db['sequelize']['import'](_0x11be('0x55'));db[_0x11be('0x56')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x57'));db[_0x11be('0x58')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x59'));db[_0x11be('0x5a')]=db[_0x11be('0x2')]['import'](_0x11be('0x5b'));db[_0x11be('0x5c')]=db['sequelize']['import']('../api/openchannelApplication/openchannelApplication.model');db[_0x11be('0x5d')]=db['sequelize'][_0x11be('0x11')](_0x11be('0x5e'));db[_0x11be('0x5f')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x60'));db[_0x11be('0x61')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/openchannelQueue/openchannelQueue.model');db[_0x11be('0x62')]=db['sequelize'][_0x11be('0x11')](_0x11be('0x63'));db['OpenchannelQueueReport']=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x64'));db[_0x11be('0x65')]=db[_0x11be('0x2')]['import']('../api/chatApplication/chatApplication.model');db[_0x11be('0x66')]=db[_0x11be('0x2')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x11be('0x67')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db['sequelize'][_0x11be('0x11')](_0x11be('0x68'));db[_0x11be('0x69')]=db['sequelize']['import'](_0x11be('0x6a'));db[_0x11be('0x6b')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/chatGroup/chatGroup.model');db[_0x11be('0x6c')]=db['sequelize']['import']('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x6d'));db[_0x11be('0x6e')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x6f'));db['CmHopper']=db['sequelize'][_0x11be('0x11')](_0x11be('0x70'));db[_0x11be('0x71')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x72'));db[_0x11be('0x73')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x11be('0x74')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x11be('0x75')]=db[_0x11be('0x2')]['import']('../api/reportAgentPreview/reportAgentPreview.model');db[_0x11be('0x76')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x77'));db['Action']=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x78'));db[_0x11be('0x79')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x7a'));db[_0x11be('0x7b')]=db[_0x11be('0x2')]['import']('../api/cannedAnswer/cannedAnswer.model');db[_0x11be('0x7c')]=db[_0x11be('0x2')]['import'](_0x11be('0x7d'));db[_0x11be('0x7e')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x7f'));db[_0x11be('0x80')]=db[_0x11be('0x2')]['import']('../api/interval/interval.model');db[_0x11be('0x81')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/pause/pause.model');db[_0x11be('0x82')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x83'));db[_0x11be('0x84')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x85'));db[_0x11be('0x86')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x87'));db[_0x11be('0x88')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x89'));db['Tag']=db['sequelize'][_0x11be('0x11')]('../api/tag/tag.model');db[_0x11be('0x8a')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x8b'));db[_0x11be('0x8c')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x8d'));db[_0x11be('0x8e')]=db['sequelize'][_0x11be('0x11')](_0x11be('0x8f'));db[_0x11be('0x90')]=db['sequelize'][_0x11be('0x11')](_0x11be('0x91'));db['IntegrationReport']=db['sequelize']['import']('../api/integrationReport/integrationReport.model');db[_0x11be('0x92')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x93'));db[_0x11be('0x94')]=db['sequelize'][_0x11be('0x11')](_0x11be('0x95'));db[_0x11be('0x96')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x11be('0x97')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x98'));db['AnalyticFieldReport']=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x99'));db[_0x11be('0x9a')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x11be('0x9b')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x9c'));db['SalesforceConfiguration']=db[_0x11be('0x2')]['import'](_0x11be('0x9d'));db[_0x11be('0x9e')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/intSalesforceField/intSalesforceField.model');db[_0x11be('0x9f')]=db[_0x11be('0x2')]['import'](_0x11be('0xa0'));db[_0x11be('0xa1')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x11be('0xa2')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xa3'));db[_0x11be('0xa4')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xa5'));db['DeskConfiguration']=db[_0x11be('0x2')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x11be('0xa6')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xa7'));db[_0x11be('0xa8')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0x11be('0x2')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x11be('0xa9')]=db['sequelize'][_0x11be('0x11')](_0x11be('0xaa'));db['ZendeskAccount']=db[_0x11be('0x2')][_0x11be('0x11')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x11be('0xab')]=db[_0x11be('0x2')]['import'](_0x11be('0xac'));db[_0x11be('0xad')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xae'));db[_0x11be('0xaf')]=db[_0x11be('0x2')]['import'](_0x11be('0xb0'));db[_0x11be('0xb1')]=db[_0x11be('0x2')]['import'](_0x11be('0xb2'));db[_0x11be('0xb3')]=db['sequelize'][_0x11be('0x11')](_0x11be('0xb4'));db[_0x11be('0xb5')]=db['sequelize']['import']('../api/intVtigerAccount/intVtigerAccount.model');db[_0x11be('0xb6')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xb7'));db[_0x11be('0xb8')]=db['sequelize'][_0x11be('0x11')](_0x11be('0xb9'));db[_0x11be('0xba')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xbb'));db['ServicenowConfiguration']=db['sequelize'][_0x11be('0x11')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x11be('0xbc')]=db[_0x11be('0x2')]['import'](_0x11be('0xbd'));db[_0x11be('0xbe')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xbf'));db[_0x11be('0xc0')]=db['sequelize'][_0x11be('0x11')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x11be('0xc1')]=db['sequelize'][_0x11be('0x11')](_0x11be('0xc2'));db[_0x11be('0xc3')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xc4'));db[_0x11be('0xc5')]=db[_0x11be('0x2')]['import'](_0x11be('0xc6'));db[_0x11be('0xc7')]=db['sequelize'][_0x11be('0x11')](_0x11be('0xc8'));db[_0x11be('0x90')]=db['sequelize']['import'](_0x11be('0x91'));db['Network']=db[_0x11be('0x2')]['import'](_0x11be('0xc9'));db[_0x11be('0xca')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/chatQueueReport/chatQueueReport.model');db[_0x11be('0xcb')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xcc'));db[_0x11be('0xcd')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xce'));db[_0x11be('0xcf')]=db[_0x11be('0x2')]['import'](_0x11be('0xd0'));db[_0x11be('0xd1')]=db[_0x11be('0x2')]['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x11be('0xd2')]=db[_0x11be('0x2')]['import'](_0x11be('0xd3'));db[_0x11be('0xd4')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xd5'));db['SquareDetailsReport']=db['sequelize'][_0x11be('0x11')](_0x11be('0xd6'));db[_0x11be('0xd7')]=db[_0x11be('0x2')]['import']('../api/jscriptyProject/jscriptyProject.model');db[_0x11be('0xd8')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/setting/setting.model');db[_0x11be('0xd9')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xda'));db[_0x11be('0xdb')]=db['sequelize'][_0x11be('0x11')]('../api/squareProject/squareProject.model');db['SquareRecording']=db[_0x11be('0x2')][_0x11be('0x11')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db['sequelize'][_0x11be('0x11')](_0x11be('0xdc'));db[_0x11be('0xdd')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xde'));db['License']=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xdf'));db[_0x11be('0xe0')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xe1'));db[_0x11be('0xe2')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xe3'));db['Attachment']=db[_0x11be('0x2')]['import'](_0x11be('0xe4'));db[_0x11be('0xe5')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xe6'));db['MailTransferReport']=db[_0x11be('0x2')][_0x11be('0x11')]('../api/mailTransferReport/mailTransferReport.model');db[_0x11be('0xe7')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xe8'));db[_0x11be('0xe9')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/faxTransferReport/faxTransferReport.model');db[_0x11be('0xea')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xeb'));db['SmsTransferReport']=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xec'));db[_0x11be('0xed')]=db['sequelize'][_0x11be('0x11')](_0x11be('0xee'));db[_0x11be('0xef')]=db['sequelize'][_0x11be('0x11')](_0x11be('0xf0'));db[_0x11be('0xf1')]=db['sequelize'][_0x11be('0x11')]('../api/userProfile/userProfile.model');db[_0x11be('0xf2')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xf3'));db['UserProfileResource']=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xf4'));db[_0x11be('0xf5')]=db['sequelize'][_0x11be('0x11')](_0x11be('0xf6'));db['WhatsappAccount']=db['sequelize'][_0x11be('0x11')](_0x11be('0xf7'));db[_0x11be('0xf8')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xf9'));db['WhatsappInteraction']=db['sequelize'][_0x11be('0x11')](_0x11be('0xfa'));db[_0x11be('0xfb')]=db['sequelize'][_0x11be('0x11')](_0x11be('0xfc'));db[_0x11be('0xfd')]=db[_0x11be('0x2')][_0x11be('0x11')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x11be('0xfe')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0xff'));db['WhatsappQueue']=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x100'));db[_0x11be('0x101')]=db[_0x11be('0x2')]['import'](_0x11be('0x102'));db['TeamVoiceQueue']=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x103'));db[_0x11be('0x104')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x105'));db[_0x11be('0x106')]=db[_0x11be('0x2')][_0x11be('0x11')](_0x11be('0x107'));db[_0x11be('0x10')][_0x11be('0x108')](db[_0x11be('0x20')],{'as':'VoiceMail','onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x10a')});db[_0x11be('0x10')]['hasMany'](db[_0x11be('0x1c')],{'as':_0x11be('0x10b'),'foreignKey':_0x11be('0x10a')});db[_0x11be('0x10')][_0x11be('0x10c')](db[_0x11be('0x2e')],{'as':_0x11be('0x10d'),'foreignKey':_0x11be('0x10a')});db[_0x11be('0x10')][_0x11be('0x10c')](db[_0x11be('0x17')],{'as':_0x11be('0x10e'),'onDelete':_0x11be('0x109'),'hooks':!![]});db[_0x11be('0x10')][_0x11be('0x10c')](db[_0x11be('0x73')],{'as':_0x11be('0x10f'),'foreignKey':_0x11be('0x10a')});db[_0x11be('0x10')][_0x11be('0x10c')](db[_0x11be('0x74')],{'as':_0x11be('0x110'),'foreignKey':_0x11be('0x10a')});db[_0x11be('0x10')]['hasMany'](db[_0x11be('0x75')],{'as':_0x11be('0x75'),'foreignKey':_0x11be('0x10a')});db[_0x11be('0x10')]['hasMany'](db[_0x11be('0x5d')],{'as':_0x11be('0x111'),'foreignKey':'UserId'});db[_0x11be('0x10')][_0x11be('0x10c')](db[_0x11be('0x66')],{'as':_0x11be('0x112'),'foreignKey':_0x11be('0x10a')});db[_0x11be('0x10')][_0x11be('0x10c')](db[_0x11be('0x113')],{'as':_0x11be('0x114'),'foreignKey':_0x11be('0x10a')});db[_0x11be('0x10')]['hasMany'](db[_0x11be('0x115')],{'as':_0x11be('0x116'),'foreignKey':_0x11be('0x10a')});db[_0x11be('0x10')][_0x11be('0x10c')](db[_0x11be('0x42')],{'as':_0x11be('0x117'),'foreignKey':_0x11be('0x10a')});db['User'][_0x11be('0x10c')](db[_0x11be('0x118')],{'as':'WhatsappInteractions','foreignKey':_0x11be('0x10a')});db[_0x11be('0x10')][_0x11be('0x10c')](db[_0x11be('0xf5')],{'as':'UserNotifications','foreignKey':_0x11be('0x119')});db['User'][_0x11be('0x11a')](db['UserProfile'],{'as':_0x11be('0xf1'),'foreignKey':_0x11be('0x11b')});db['User'][_0x11be('0x11c')](db['ChatGroup'],{'as':_0x11be('0x11d'),'through':'chat_group_has_users'});db[_0x11be('0x10')][_0x11be('0x11c')](db['CmContact'],{'as':_0x11be('0x11e'),'through':_0x11be('0x11f')});db[_0x11be('0x10')][_0x11be('0x11c')](db['CmList'],{'as':_0x11be('0x120'),'through':'cm_user_has_lists'});db['User'][_0x11be('0x11c')](db[_0x11be('0xdd')],{'through':_0x11be('0x121')});db['User']['belongsToMany'](db[_0x11be('0x42')],{'as':_0x11be('0x117'),'through':'user_has_mail_interactions'});db[_0x11be('0x10')]['belongsToMany'](db[_0x11be('0x66')],{'as':_0x11be('0x112'),'through':_0x11be('0x122')});db[_0x11be('0x10')][_0x11be('0x11c')](db[_0x11be('0x115')],{'as':_0x11be('0x116'),'through':_0x11be('0x123')});db[_0x11be('0x10')][_0x11be('0x11c')](db['SmsInteraction'],{'as':_0x11be('0x114'),'through':_0x11be('0x124')});db['User'][_0x11be('0x11c')](db[_0x11be('0x5d')],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db['User'][_0x11be('0x11c')](db[_0x11be('0x118')],{'as':_0x11be('0x125'),'through':'user_has_whatsapp_interactions'});db[_0x11be('0x10')]['belongsToMany'](db[_0x11be('0x1a')],{'as':_0x11be('0x126'),'through':_0x11be('0x127'),'required':![]});db[_0x11be('0x10')]['belongsToMany'](db[_0x11be('0xef')],{'as':_0x11be('0x128'),'through':_0x11be('0x106'),'required':![]});db['User'][_0x11be('0x11c')](db[_0x11be('0x3f')],{'as':_0x11be('0x129'),'through':_0x11be('0x32'),'required':![]});db['User'][_0x11be('0x11c')](db[_0x11be('0x69')],{'as':'ChatQueues','through':_0x11be('0x31'),'required':![],'hooks':!![]});db[_0x11be('0x10')][_0x11be('0x11c')](db['FaxQueue'],{'as':_0x11be('0x12a'),'through':_0x11be('0x34'),'required':![]});db[_0x11be('0x10')][_0x11be('0x11c')](db['SmsQueue'],{'as':_0x11be('0x12b'),'through':'UserSmsQueue','required':![]});db[_0x11be('0x10')][_0x11be('0x11c')](db[_0x11be('0x61')],{'as':_0x11be('0x12c'),'through':_0x11be('0x12d'),'required':![]});db[_0x11be('0x10')][_0x11be('0x11c')](db[_0x11be('0x12e')],{'as':_0x11be('0x12f'),'through':_0x11be('0x38'),'required':![]});db[_0x11be('0x10')]['belongsToMany'](db['CmList'],{'through':'cm_user_has_lists'});db[_0x11be('0x10')][_0x11be('0x11c')](db[_0x11be('0x62')],{'as':_0x11be('0x130'),'through':_0x11be('0x131')});db[_0x11be('0x10')][_0x11be('0x11c')](db[_0x11be('0x4b')],{'as':_0x11be('0x132'),'through':_0x11be('0x133')});db[_0x11be('0x10')][_0x11be('0x11c')](db['MailAccount'],{'as':_0x11be('0x134'),'through':_0x11be('0x135')});db['User']['belongsToMany'](db[_0x11be('0x5a')],{'as':'OpenchannelAccounts','through':_0x11be('0x136')});db[_0x11be('0x10')][_0x11be('0x11c')](db[_0x11be('0x53')],{'as':_0x11be('0x137'),'through':_0x11be('0x138')});db['User']['belongsToMany'](db[_0x11be('0x139')],{'as':_0x11be('0x13a'),'through':_0x11be('0x13b')});db[_0x11be('0x10')]['belongsToMany'](db['SquareProject'],{'as':_0x11be('0x13c'),'through':'user_has_square_projects'});db[_0x11be('0x13')]['hasMany'](db[_0x11be('0x17')],{'as':'SpiedAgents','onDelete':_0x11be('0x109'),'foreignKey':'ChanSpyId'});db[_0x11be('0x15')][_0x11be('0x10c')](db[_0x11be('0x17')],{'onDelete':_0x11be('0x109')});db[_0x11be('0x17')][_0x11be('0x10c')](db[_0x11be('0x17')],{'as':_0x11be('0x13d'),'onDelete':_0x11be('0x109')});db[_0x11be('0x19')][_0x11be('0x11c')](db['Sound'],{'as':_0x11be('0x13e'),'through':'moh_has_sounds'});db[_0x11be('0x1a')][_0x11be('0x10c')](db[_0x11be('0x2e')],{'as':_0x11be('0x13f'),'foreignKey':_0x11be('0x140')});db['VoiceQueue'][_0x11be('0x10c')](db['CmHopper'],{'as':_0x11be('0x141'),'foreignKey':_0x11be('0x140')});db[_0x11be('0x1a')][_0x11be('0x10c')](db[_0x11be('0x73')],{'as':_0x11be('0x10f'),'foreignKey':_0x11be('0x140')});db[_0x11be('0x1a')][_0x11be('0x10c')](db[_0x11be('0x74')],{'as':_0x11be('0x142'),'foreignKey':_0x11be('0x140')});db[_0x11be('0x1a')][_0x11be('0x10c')](db['ReportAgentPreview'],{'as':_0x11be('0x75'),'foreignKey':_0x11be('0x140')});db[_0x11be('0x1a')][_0x11be('0x10c')](db['CmHopperBlack'],{'as':_0x11be('0x143'),'foreignKey':_0x11be('0x140')});db[_0x11be('0x1a')]['hasMany'](db['JscriptySessionReport'],{'as':_0x11be('0x144'),'foreignKey':_0x11be('0x140')});db[_0x11be('0x1a')][_0x11be('0x11a')](db[_0x11be('0x2a')],{'as':_0x11be('0x2a'),'foreignKey':_0x11be('0x145')});db[_0x11be('0x1a')]['belongsTo'](db[_0x11be('0x2a')],{'as':'TrunkBackup','foreignKey':_0x11be('0x146')});db[_0x11be('0x1a')][_0x11be('0x11a')](db['Interval'],{'as':'Interval','foreignKey':_0x11be('0x147')});db[_0x11be('0x1a')][_0x11be('0x11a')](db[_0x11be('0x81')],{'as':_0x11be('0x148'),'foreignKey':_0x11be('0x149')});db[_0x11be('0x1a')][_0x11be('0x11c')](db[_0x11be('0xed')],{'as':'Lists','through':_0x11be('0x14a')});db[_0x11be('0x1a')]['belongsToMany'](db['User'],{'as':_0x11be('0x14b'),'through':_0x11be('0x127')});db[_0x11be('0x1a')]['belongsToMany'](db[_0x11be('0xdd')],{'as':'Teams','through':'TeamVoiceQueue'});db[_0x11be('0x1a')][_0x11be('0x11c')](db['CmList'],{'as':_0x11be('0x14c'),'through':_0x11be('0x14d')});db[_0x11be('0x1c')][_0x11be('0x11a')](db[_0x11be('0x10')],{'as':_0x11be('0x10'),'foreignKey':'UserId'});db['ScreenRecording'][_0x11be('0x11a')](db['User'],{'as':_0x11be('0x10'),'foreignKey':_0x11be('0x10a')});db[_0x11be('0x20')][_0x11be('0x10c')](db[_0x11be('0x21')],{'as':_0x11be('0x14e'),'onDelete':_0x11be('0x109'),'foreignKey':'mailboxuser','sourceKey':_0x11be('0x14f')});db[_0x11be('0x21')]['belongsTo'](db[_0x11be('0x20')],{'foreignKey':_0x11be('0x150'),'targetKey':_0x11be('0x14f')});db[_0x11be('0x22')][_0x11be('0x10c')](db[_0x11be('0x27')],{'as':_0x11be('0x151'),'foreignKey':_0x11be('0x152'),'constraints':![]});db[_0x11be('0x22')][_0x11be('0x10c')](db[_0x11be('0x25')],{'as':_0x11be('0x153'),'foreignKey':_0x11be('0x152'),'constraints':![]});db[_0x11be('0x22')][_0x11be('0x11a')](db[_0x11be('0x10')],{'as':'User','foreignKey':_0x11be('0x10a')});db[_0x11be('0x22')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x11be('0x154')});db['MailServerIn']['belongsTo'](db[_0x11be('0x3d')],{'as':_0x11be('0x3d'),'foreignKey':_0x11be('0x155')});db['MailServerOut'][_0x11be('0x11a')](db[_0x11be('0x3d')],{'as':'MailAccount','foreignKey':_0x11be('0x155')});db[_0x11be('0x3d')][_0x11be('0x108')](db[_0x11be('0x3a')],{'as':_0x11be('0x156'),'onDelete':_0x11be('0x109')});db[_0x11be('0x3d')]['hasOne'](db[_0x11be('0x3b')],{'as':_0x11be('0x157'),'onDelete':_0x11be('0x109')});db['MailAccount'][_0x11be('0x10c')](db[_0x11be('0x7c')],{'as':'Dispositions','foreignKey':'MailAccountId','onDelete':_0x11be('0x109')});db['MailAccount']['hasMany'](db[_0x11be('0x7b')],{'as':_0x11be('0x158'),'foreignKey':_0x11be('0x155')});db['MailAccount']['hasMany'](db[_0x11be('0x43')],{'as':_0x11be('0x14e'),'foreignKey':_0x11be('0x155')});db[_0x11be('0x3d')][_0x11be('0x10c')](db[_0x11be('0x42')],{'as':_0x11be('0x159')});db[_0x11be('0x3d')][_0x11be('0x10c')](db[_0x11be('0x45')],{'as':_0x11be('0x13d')});db[_0x11be('0x3d')]['belongsTo'](db['CmList'],{'as':_0x11be('0x15a'),'foreignKey':_0x11be('0x15b')});db[_0x11be('0x3d')]['belongsTo'](db[_0x11be('0x8a')],{'as':_0x11be('0x8a'),'foreignKey':_0x11be('0x15c')});db[_0x11be('0x3d')]['belongsTo'](db[_0x11be('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x11be('0x149')});db['MailAccount'][_0x11be('0x11c')](db['User'],{'as':_0x11be('0x14b'),'through':_0x11be('0x135')});db[_0x11be('0x3f')][_0x11be('0x11c')](db['User'],{'as':_0x11be('0x14b'),'through':_0x11be('0x32')});db['MailQueue'][_0x11be('0x11c')](db[_0x11be('0xdd')],{'through':_0x11be('0x15d'),'as':_0x11be('0x15e')});db[_0x11be('0x42')][_0x11be('0x10c')](db[_0x11be('0x43')],{'as':_0x11be('0x14e'),'onDelete':_0x11be('0x109'),'foreignKey':'MailInteractionId'});db['MailInteraction'][_0x11be('0x11a')](db[_0x11be('0x3d')],{'as':_0x11be('0x15f'),'foreignKey':_0x11be('0x155')});db[_0x11be('0x42')][_0x11be('0x11a')](db[_0x11be('0x6e')],{'as':_0x11be('0x160'),'foreignKey':_0x11be('0x154')});db[_0x11be('0x42')][_0x11be('0x11a')](db[_0x11be('0x10')],{'as':_0x11be('0x161'),'foreignKey':_0x11be('0x10a')});db['MailInteraction'][_0x11be('0x11c')](db['Tag'],{'through':_0x11be('0x162'),'as':_0x11be('0x163')});db['MailInteraction']['belongsToMany'](db[_0x11be('0x164')],{'through':_0x11be('0x162'),'as':_0x11be('0x165')});db['MailInteraction'][_0x11be('0x11c')](db[_0x11be('0x10')],{'as':_0x11be('0x166'),'through':_0x11be('0x167'),'foreignKey':_0x11be('0x168')});db['MailMessage']['hasMany'](db['Attachment'],{'as':_0x11be('0x169'),'onDelete':_0x11be('0x109')});db[_0x11be('0x43')][_0x11be('0x11a')](db[_0x11be('0x10')],{'as':'User'});db[_0x11be('0x43')]['belongsTo'](db[_0x11be('0x6e')],{'onDelete':'cascade','as':_0x11be('0x160')});db[_0x11be('0x43')][_0x11be('0x11a')](db[_0x11be('0x42')],{'as':_0x11be('0x16a'),'foreignKey':_0x11be('0x168')});db[_0x11be('0x43')][_0x11be('0x11a')](db['MailAccount'],{'as':_0x11be('0x15f'),'foreignKey':'MailAccountId'});db['MailMessage']['belongsTo'](db[_0x11be('0x62')],{'as':_0x11be('0x62'),'foreignKey':_0x11be('0x16b')});db[_0x11be('0x43')][_0x11be('0x11a')](db[_0x11be('0x16c')],{'as':_0x11be('0x16c'),'foreignKey':_0x11be('0x16d')});db[_0x11be('0x45')][_0x11be('0x11a')](db[_0x11be('0x10')],{'onDelete':_0x11be('0x16e')});db[_0x11be('0x45')][_0x11be('0x11a')](db[_0x11be('0x3f')],{'onDelete':_0x11be('0x16e')});db['MailApplication'][_0x11be('0x11a')](db['MailAccount'],{'onDelete':_0x11be('0x16e')});db[_0x11be('0x45')][_0x11be('0x11a')](db[_0x11be('0x80')],{'onDelete':_0x11be('0x16e'),'foreignKey':_0x11be('0x147')});db['MailApplication'][_0x11be('0x11a')](db[_0x11be('0x164')],{'onDelete':'restrict','foreignKey':_0x11be('0x16f')});db[_0x11be('0x46')][_0x11be('0x11a')](db[_0x11be('0x3d')],{});db[_0x11be('0x46')][_0x11be('0x11a')](db[_0x11be('0xed')],{'as':_0x11be('0x15a'),'foreignKey':'ListId'});db[_0x11be('0x46')]['belongsTo'](db[_0x11be('0x6e')],{'as':_0x11be('0x160'),'foreignKey':_0x11be('0x154')});db[_0x11be('0x46')][_0x11be('0x11a')](db[_0x11be('0x42')],{});db[_0x11be('0x46')][_0x11be('0x11a')](db[_0x11be('0x43')],{});db[_0x11be('0x46')][_0x11be('0x11a')](db['User'],{});db[_0x11be('0x46')][_0x11be('0x11a')](db[_0x11be('0x3f')],{});db['Dashboard'][_0x11be('0x10c')](db[_0x11be('0x49')],{'as':'Items','onDelete':_0x11be('0x109')});db['FaxAccount'][_0x11be('0x10c')](db[_0x11be('0x7c')],{'as':_0x11be('0x170'),'foreignKey':_0x11be('0x171'),'onDelete':_0x11be('0x109')});db['FaxAccount'][_0x11be('0x10c')](db[_0x11be('0x7b')],{'as':_0x11be('0x158'),'foreignKey':_0x11be('0x171')});db[_0x11be('0x4b')][_0x11be('0x10c')](db[_0x11be('0x115')],{'as':_0x11be('0x159')});db[_0x11be('0x4b')][_0x11be('0x10c')](db[_0x11be('0x4d')],{'as':_0x11be('0x13d')});db[_0x11be('0x4b')]['hasMany'](db[_0x11be('0x17')],{'as':_0x11be('0x172'),'onDelete':'cascade'});db['FaxAccount'][_0x11be('0x10c')](db[_0x11be('0x4e')],{'as':_0x11be('0x14e')});db[_0x11be('0x4b')][_0x11be('0x11a')](db[_0x11be('0x2a')],{'as':_0x11be('0x2a')});db[_0x11be('0x4b')][_0x11be('0x11a')](db['CmList'],{'as':_0x11be('0x15a'),'foreignKey':'ListId'});db[_0x11be('0x4b')]['belongsTo'](db['Pause'],{'as':_0x11be('0x148'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x11be('0x4b')][_0x11be('0x11c')](db['User'],{'as':'Agents','through':_0x11be('0x133')});db[_0x11be('0x4d')][_0x11be('0x11a')](db['User'],{'onDelete':_0x11be('0x16e')});db[_0x11be('0x4d')][_0x11be('0x11a')](db[_0x11be('0x50')],{'onDelete':_0x11be('0x16e')});db[_0x11be('0x4d')]['belongsTo'](db[_0x11be('0x4b')],{'onDelete':_0x11be('0x16e')});db['FaxApplication'][_0x11be('0x11a')](db[_0x11be('0x164')],{'onDelete':_0x11be('0x16e'),'foreignKey':'TagId'});db[_0x11be('0x115')][_0x11be('0x10c')](db['FaxMessage'],{'as':_0x11be('0x14e'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db[_0x11be('0x115')][_0x11be('0x11a')](db['FaxAccount'],{'as':_0x11be('0x15f'),'foreignKey':'FaxAccountId'});db[_0x11be('0x115')][_0x11be('0x11a')](db[_0x11be('0x6e')],{'as':_0x11be('0x160'),'foreignKey':'ContactId'});db[_0x11be('0x115')]['belongsTo'](db[_0x11be('0x10')],{'as':_0x11be('0x161'),'foreignKey':'UserId'});db[_0x11be('0x115')][_0x11be('0x11c')](db[_0x11be('0x164')],{'through':_0x11be('0x173'),'as':'Tags'});db[_0x11be('0x115')][_0x11be('0x11c')](db['Tag'],{'through':_0x11be('0x173'),'as':_0x11be('0x165')});db[_0x11be('0x115')][_0x11be('0x11c')](db[_0x11be('0x10')],{'as':_0x11be('0x166'),'through':_0x11be('0x123'),'foreignKey':_0x11be('0x174')});db[_0x11be('0x4e')][_0x11be('0x11a')](db['User'],{'onDelete':_0x11be('0x109'),'as':_0x11be('0x10')});db[_0x11be('0x4e')][_0x11be('0x11a')](db[_0x11be('0x115')],{'as':_0x11be('0x16a'),'foreignKey':_0x11be('0x174')});db[_0x11be('0x4e')][_0x11be('0x11a')](db['CmContact'],{'onDelete':_0x11be('0x109'),'as':_0x11be('0x160')});db[_0x11be('0x4e')]['belongsTo'](db[_0x11be('0x175')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x11be('0x4e')][_0x11be('0x11a')](db['FaxAccount'],{'as':_0x11be('0x15f'),'foreignKey':'FaxAccountId'});db[_0x11be('0x50')][_0x11be('0x11c')](db[_0x11be('0x10')],{'as':_0x11be('0x14b'),'through':_0x11be('0x34')});db[_0x11be('0x50')][_0x11be('0x11c')](db['Team'],{'through':_0x11be('0x176'),'as':'Teams'});db[_0x11be('0x52')][_0x11be('0x11a')](db[_0x11be('0x4b')],{});db[_0x11be('0x52')][_0x11be('0x11a')](db[_0x11be('0xed')],{'as':_0x11be('0x15a'),'foreignKey':_0x11be('0x15b')});db[_0x11be('0x52')][_0x11be('0x11a')](db[_0x11be('0x6e')],{'as':_0x11be('0x160'),'foreignKey':'ContactId'});db[_0x11be('0x52')][_0x11be('0x11a')](db[_0x11be('0x115')],{});db[_0x11be('0x52')]['belongsTo'](db[_0x11be('0x4e')],{});db[_0x11be('0x52')][_0x11be('0x11a')](db[_0x11be('0x10')],{});db[_0x11be('0x52')][_0x11be('0x11a')](db[_0x11be('0x50')],{});db[_0x11be('0x53')]['hasMany'](db[_0x11be('0x7c')],{'as':_0x11be('0x170'),'foreignKey':_0x11be('0x177'),'onDelete':_0x11be('0x109')});db[_0x11be('0x53')][_0x11be('0x10c')](db[_0x11be('0x7b')],{'as':'Answers','foreignKey':_0x11be('0x177')});db[_0x11be('0x53')][_0x11be('0x10c')](db['SmsMessage'],{'as':_0x11be('0x14e'),'foreignKey':_0x11be('0x177')});db['SmsAccount'][_0x11be('0x10c')](db['SmsInteraction'],{'as':_0x11be('0x159')});db['SmsAccount'][_0x11be('0x10c')](db['SmsApplication'],{'as':'Applications'});db[_0x11be('0x53')][_0x11be('0x11a')](db[_0x11be('0xed')],{'as':_0x11be('0x15a'),'foreignKey':_0x11be('0x15b')});db['SmsAccount'][_0x11be('0x11a')](db[_0x11be('0x81')],{'as':_0x11be('0x148'),'foreignKey':'mandatoryDispositionPauseId'});db['SmsAccount'][_0x11be('0x11c')](db['User'],{'as':'Agents','through':'user_has_sms_accounts'});db['SmsApplication'][_0x11be('0x11a')](db[_0x11be('0x10')],{'onDelete':_0x11be('0x16e')});db['SmsApplication'][_0x11be('0x11a')](db['SmsQueue'],{'onDelete':_0x11be('0x16e')});db[_0x11be('0x178')]['belongsTo'](db[_0x11be('0x53')],{'onDelete':_0x11be('0x16e')});db[_0x11be('0x178')][_0x11be('0x11a')](db[_0x11be('0x80')],{'onDelete':_0x11be('0x16e'),'foreignKey':_0x11be('0x147')});db[_0x11be('0x178')][_0x11be('0x11a')](db[_0x11be('0x164')],{'onDelete':'restrict','foreignKey':_0x11be('0x16f')});db[_0x11be('0x113')][_0x11be('0x10c')](db['SmsMessage'],{'as':_0x11be('0x14e'),'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x179')});db[_0x11be('0x113')][_0x11be('0x11a')](db[_0x11be('0x53')],{'as':_0x11be('0x15f'),'foreignKey':_0x11be('0x177')});db[_0x11be('0x113')]['belongsTo'](db[_0x11be('0x6e')],{'as':_0x11be('0x160'),'foreignKey':_0x11be('0x154')});db[_0x11be('0x113')][_0x11be('0x11a')](db[_0x11be('0x10')],{'as':'Owner','foreignKey':_0x11be('0x10a')});db[_0x11be('0x113')][_0x11be('0x11c')](db[_0x11be('0x164')],{'through':_0x11be('0x17a'),'as':_0x11be('0x163')});db[_0x11be('0x113')][_0x11be('0x11c')](db[_0x11be('0x164')],{'through':_0x11be('0x17a'),'as':_0x11be('0x165')});db[_0x11be('0x113')][_0x11be('0x11c')](db[_0x11be('0x10')],{'as':'Users','through':'user_has_sms_interactions','foreignKey':_0x11be('0x179')});db[_0x11be('0x56')][_0x11be('0x11a')](db[_0x11be('0x10')],{'as':'User'});db['SmsMessage'][_0x11be('0x11a')](db[_0x11be('0x6e')],{'onDelete':_0x11be('0x109'),'as':_0x11be('0x160')});db[_0x11be('0x56')][_0x11be('0x11a')](db['SmsInteraction'],{'onDelete':_0x11be('0x109'),'as':'Interaction','foreignKey':'SmsInteractionId'});db[_0x11be('0x56')][_0x11be('0x11a')](db[_0x11be('0x53')],{'as':'Account','foreignKey':_0x11be('0x177')});db['SmsQueue'][_0x11be('0x11c')](db['User'],{'as':_0x11be('0x14b'),'through':_0x11be('0x36'),'foreignKey':'SmsQueueId'});db['SmsQueue']['belongsToMany'](db['Team'],{'through':'team_has_sms_queues','as':_0x11be('0x15e')});db[_0x11be('0x5a')][_0x11be('0x10c')](db['Disposition'],{'as':_0x11be('0x170'),'foreignKey':_0x11be('0x17b'),'onDelete':_0x11be('0x109')});db[_0x11be('0x5a')]['hasMany'](db[_0x11be('0x7b')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x11be('0x10c')](db[_0x11be('0x5d')],{'as':'Interactions','foreignKey':'OpenchannelAccountId'});db[_0x11be('0x5a')]['hasMany'](db['OpenchannelMessage'],{'as':_0x11be('0x14e'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['hasMany'](db[_0x11be('0x5c')],{'as':'Applications','foreignKey':_0x11be('0x17b')});db[_0x11be('0x5a')][_0x11be('0x11a')](db['CmList'],{'as':_0x11be('0x15a'),'foreignKey':_0x11be('0x15b')});db['OpenchannelAccount']['belongsTo'](db[_0x11be('0x81')],{'as':_0x11be('0x148'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x11be('0x5a')][_0x11be('0x11c')](db[_0x11be('0x10')],{'as':_0x11be('0x14b'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0x11be('0x11a')](db[_0x11be('0x10')],{'onDelete':_0x11be('0x16e')});db['OpenchannelApplication'][_0x11be('0x11a')](db['OpenchannelQueue'],{'onDelete':_0x11be('0x16e'),'foreignKey':_0x11be('0x17c')});db[_0x11be('0x5c')][_0x11be('0x11a')](db[_0x11be('0x5a')],{'onDelete':_0x11be('0x16e'),'foreignKey':_0x11be('0x17b')});db[_0x11be('0x5c')][_0x11be('0x11a')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x11be('0x147')});db['OpenchannelApplication']['belongsTo'](db[_0x11be('0x164')],{'onDelete':_0x11be('0x16e'),'foreignKey':_0x11be('0x16f')});db[_0x11be('0x5d')][_0x11be('0x10c')](db[_0x11be('0x5f')],{'as':_0x11be('0x14e'),'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x17d')});db[_0x11be('0x5d')][_0x11be('0x11a')](db[_0x11be('0x5a')],{'as':_0x11be('0x15f'),'foreignKey':_0x11be('0x17b')});db[_0x11be('0x5d')][_0x11be('0x11a')](db['CmContact'],{'as':_0x11be('0x160'),'foreignKey':_0x11be('0x154')});db['OpenchannelInteraction'][_0x11be('0x11a')](db['User'],{'as':_0x11be('0x161'),'foreignKey':_0x11be('0x10a')});db[_0x11be('0x5d')]['belongsToMany'](db[_0x11be('0x164')],{'through':'openchannel_interaction_has_tags','as':_0x11be('0x163')});db[_0x11be('0x5d')]['belongsToMany'](db[_0x11be('0x164')],{'through':_0x11be('0x17e'),'as':_0x11be('0x165')});db[_0x11be('0x5d')][_0x11be('0x11c')](db[_0x11be('0x10')],{'as':'Users','through':'user_has_openchannel_interactions','foreignKey':_0x11be('0x17d')});db[_0x11be('0x5f')]['belongsTo'](db[_0x11be('0x10')],{'onDelete':_0x11be('0x109'),'as':_0x11be('0x10')});db[_0x11be('0x5f')][_0x11be('0x11a')](db[_0x11be('0x6e')],{'onDelete':_0x11be('0x109'),'as':_0x11be('0x160')});db['OpenchannelMessage'][_0x11be('0x11a')](db[_0x11be('0x5d')],{'onDelete':_0x11be('0x109'),'as':_0x11be('0x16a'),'foreignKey':_0x11be('0x17d')});db[_0x11be('0x5f')]['belongsTo'](db[_0x11be('0x175')],{'as':_0x11be('0x175'),'foreignKey':_0x11be('0x17f')});db[_0x11be('0x5f')][_0x11be('0x11a')](db[_0x11be('0x5a')],{'as':_0x11be('0x15f'),'foreignKey':_0x11be('0x17b')});db[_0x11be('0x61')][_0x11be('0x11c')](db[_0x11be('0x10')],{'as':_0x11be('0x14b'),'through':_0x11be('0x12d'),'foreignKey':_0x11be('0x17c')});db[_0x11be('0x61')][_0x11be('0x11c')](db[_0x11be('0xdd')],{'through':_0x11be('0x180'),'as':_0x11be('0x15e')});db['ChatWebsite'][_0x11be('0x10c')](db[_0x11be('0x7c')],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0x11be('0x109')});db[_0x11be('0x62')][_0x11be('0x10c')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x11be('0x16b')});db[_0x11be('0x62')]['hasMany'](db[_0x11be('0x6c')],{'as':_0x11be('0x181')});db[_0x11be('0x62')][_0x11be('0x10c')](db[_0x11be('0x66')],{'as':_0x11be('0x159')});db['ChatWebsite'][_0x11be('0x10c')](db['ChatApplication'],{'as':_0x11be('0x13d')});db['ChatWebsite'][_0x11be('0x10c')](db['ChatMessage'],{'as':_0x11be('0x14e')});db['ChatWebsite'][_0x11be('0x11a')](db['CmList'],{'as':_0x11be('0x15a'),'foreignKey':_0x11be('0x15b')});db[_0x11be('0x62')]['belongsTo'](db[_0x11be('0x80')],{'as':_0x11be('0x80'),'foreignKey':_0x11be('0x147')});db[_0x11be('0x62')][_0x11be('0x11a')](db[_0x11be('0x3d')],{'as':_0x11be('0x3d'),'foreignKey':_0x11be('0x155')});db[_0x11be('0x62')][_0x11be('0x11a')](db[_0x11be('0x81')],{'as':_0x11be('0x148'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x11be('0x62')]['belongsToMany'](db['User'],{'as':_0x11be('0x14b'),'through':_0x11be('0x131')});db[_0x11be('0x182')][_0x11be('0x11a')](db[_0x11be('0x5a')],{});db[_0x11be('0x182')][_0x11be('0x11a')](db[_0x11be('0xed')],{'as':'List','foreignKey':_0x11be('0x15b')});db[_0x11be('0x182')][_0x11be('0x11a')](db['CmContact'],{'as':'Contact','foreignKey':_0x11be('0x154')});db['OpenchannelQueueReport'][_0x11be('0x11a')](db[_0x11be('0x5d')],{});db[_0x11be('0x182')]['belongsTo'](db[_0x11be('0x5f')],{});db[_0x11be('0x182')][_0x11be('0x11a')](db[_0x11be('0x10')],{});db[_0x11be('0x182')][_0x11be('0x11a')](db['OpenchannelQueue'],{});db[_0x11be('0x65')][_0x11be('0x11a')](db[_0x11be('0x10')],{'as':_0x11be('0x183'),'foreignKey':'UserId','onDelete':_0x11be('0x16e')});db[_0x11be('0x65')][_0x11be('0x11a')](db[_0x11be('0x69')],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':_0x11be('0x16e')});db[_0x11be('0x65')][_0x11be('0x11a')](db['ChatWebsite'],{'as':_0x11be('0x184'),'foreignKey':'ChatWebsiteId','onDelete':_0x11be('0x16e')});db[_0x11be('0x65')]['belongsTo'](db[_0x11be('0x164')],{'onDelete':_0x11be('0x16e'),'foreignKey':_0x11be('0x16f')});db[_0x11be('0x66')][_0x11be('0x10c')](db['ChatMessage'],{'as':_0x11be('0x14e'),'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x185')});db['ChatInteraction'][_0x11be('0x11a')](db[_0x11be('0x62')],{'as':_0x11be('0x15f'),'foreignKey':_0x11be('0x16b')});db[_0x11be('0x66')]['belongsTo'](db[_0x11be('0x6e')],{'as':_0x11be('0x160'),'foreignKey':_0x11be('0x154')});db[_0x11be('0x66')][_0x11be('0x11a')](db[_0x11be('0x10')],{'as':_0x11be('0x161'),'foreignKey':'UserId'});db['ChatInteraction']['belongsToMany'](db[_0x11be('0x164')],{'through':_0x11be('0x186'),'as':_0x11be('0x163')});db[_0x11be('0x66')][_0x11be('0x11c')](db[_0x11be('0x164')],{'through':_0x11be('0x186'),'as':_0x11be('0x165')});db[_0x11be('0x66')][_0x11be('0x11c')](db[_0x11be('0x10')],{'as':'Users','through':_0x11be('0x122'),'foreignKey':_0x11be('0x185')});db[_0x11be('0x67')][_0x11be('0x11a')](db[_0x11be('0x10')],{'onDelete':'cascade','as':_0x11be('0x10')});db[_0x11be('0x67')]['belongsTo'](db[_0x11be('0x6e')],{'onDelete':_0x11be('0x109'),'as':_0x11be('0x160'),'foreignKey':'ContactId'});db[_0x11be('0x67')][_0x11be('0x11a')](db['ChatInteraction'],{'onDelete':_0x11be('0x109'),'as':'Interaction','foreignKey':_0x11be('0x185')});db['ChatMessage'][_0x11be('0x11a')](db[_0x11be('0x175')],{'as':_0x11be('0x175'),'foreignKey':_0x11be('0x17f')});db['ChatMessage'][_0x11be('0x11a')](db['ChatWebsite'],{'as':_0x11be('0x15f'),'foreignKey':_0x11be('0x16b')});db[_0x11be('0x16c')]['hasMany'](db[_0x11be('0x175')],{'as':_0x11be('0x169'),'foreignKey':_0x11be('0x16d'),'onDelete':_0x11be('0x109'),'hooks':!![]});db[_0x11be('0x16c')][_0x11be('0x11a')](db[_0x11be('0x6e')],{'onDelete':_0x11be('0x109'),'as':_0x11be('0x160'),'foreignKey':_0x11be('0x154')});db[_0x11be('0x16c')][_0x11be('0x11a')](db['ChatWebsite'],{'as':_0x11be('0x15f'),'foreignKey':_0x11be('0x16b')});db[_0x11be('0x69')][_0x11be('0x11c')](db[_0x11be('0x10')],{'as':'Agents','through':_0x11be('0x31'),'hooks':!![]});db[_0x11be('0x69')]['belongsToMany'](db[_0x11be('0xdd')],{'through':_0x11be('0x187'),'as':_0x11be('0x15e')});db[_0x11be('0x6b')][_0x11be('0x10c')](db[_0x11be('0xcb')],{'as':_0x11be('0x14e'),'foreignKey':_0x11be('0x188'),'onDelete':'cascade'});db['ChatGroup'][_0x11be('0x11c')](db[_0x11be('0x10')],{'as':_0x11be('0x13f'),'through':'chat_group_has_users'});db[_0x11be('0x6c')][_0x11be('0x11a')](db[_0x11be('0x62')],{'as':_0x11be('0x184'),'foreignKey':_0x11be('0x16b')});db[_0x11be('0x189')]['hasMany'](db[_0x11be('0x6e')],{'as':_0x11be('0x11e'),'foreignKey':_0x11be('0x18a')});db['CmContact']['hasMany'](db[_0x11be('0x18b')],{'as':_0x11be('0x141'),'foreignKey':_0x11be('0x154')});db[_0x11be('0x6e')][_0x11be('0x10c')](db[_0x11be('0x73')],{'as':_0x11be('0x10f'),'foreignKey':_0x11be('0x154')});db[_0x11be('0x6e')][_0x11be('0x10c')](db[_0x11be('0x74')],{'as':_0x11be('0x142'),'foreignKey':_0x11be('0x154')});db[_0x11be('0x6e')][_0x11be('0x10c')](db[_0x11be('0x75')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db[_0x11be('0x6e')]['hasMany'](db[_0x11be('0xd1')],{'as':'JscriptySessions','foreignKey':_0x11be('0x154')});db[_0x11be('0x6e')][_0x11be('0x10c')](db['OpenchannelInteraction'],{'as':_0x11be('0x111'),'foreignKey':_0x11be('0x154'),'onDelete':'restrict'});db['CmContact'][_0x11be('0x10c')](db[_0x11be('0x66')],{'as':'ChatInteractions','foreignKey':_0x11be('0x154'),'onDelete':'restrict'});db[_0x11be('0x6e')][_0x11be('0x10c')](db[_0x11be('0x113')],{'as':_0x11be('0x114'),'foreignKey':_0x11be('0x154'),'onDelete':'restrict'});db[_0x11be('0x6e')][_0x11be('0x10c')](db['FaxInteraction'],{'as':_0x11be('0x116'),'foreignKey':'ContactId','onDelete':_0x11be('0x16e')});db['CmContact'][_0x11be('0x10c')](db[_0x11be('0x42')],{'as':'MailInteractions','foreignKey':_0x11be('0x154'),'onDelete':_0x11be('0x16e')});db[_0x11be('0x6e')]['belongsTo'](db[_0x11be('0x189')],{'as':_0x11be('0x18c'),'foreignKey':_0x11be('0x18a')});db[_0x11be('0x6e')][_0x11be('0x11a')](db[_0x11be('0xed')],{'as':_0x11be('0x15a'),'foreignKey':_0x11be('0x15b'),'onDelete':'cascade'});db['CmContact'][_0x11be('0x11c')](db[_0x11be('0x10')],{'as':_0x11be('0x166'),'through':'cm_user_has_contacts'});db[_0x11be('0x6e')][_0x11be('0x11c')](db[_0x11be('0x164')],{'as':'Tags','through':_0x11be('0x18d')});db[_0x11be('0x6e')][_0x11be('0x11c')](db[_0x11be('0x164')],{'through':_0x11be('0x18d'),'as':'ThroughTags'});db[_0x11be('0x18b')][_0x11be('0x11a')](db[_0x11be('0x6e')],{'as':_0x11be('0x160'),'foreignKey':_0x11be('0x154'),'onDelete':_0x11be('0x109')});db['CmHopper'][_0x11be('0x11a')](db[_0x11be('0xed')],{'as':'List','foreignKey':_0x11be('0x15b'),'onDelete':_0x11be('0x109')});db[_0x11be('0x18b')]['belongsTo'](db[_0x11be('0x10')],{'as':_0x11be('0x183'),'foreignKey':_0x11be('0x10a')});db[_0x11be('0x18b')][_0x11be('0x11a')](db[_0x11be('0x1a')],{'as':_0x11be('0x18e'),'foreignKey':_0x11be('0x140'),'onDelete':_0x11be('0x109')});db['CmHopper'][_0x11be('0x11a')](db[_0x11be('0xe0')],{'as':_0x11be('0xe0'),'foreignKey':_0x11be('0x18f'),'onDelete':'cascade'});db[_0x11be('0x18b')]['belongsTo'](db[_0x11be('0x10')],{'as':_0x11be('0x161'),'foreignKey':_0x11be('0x190')});db[_0x11be('0x71')][_0x11be('0x11a')](db[_0x11be('0x6e')],{'as':_0x11be('0x160'),'foreignKey':_0x11be('0x154'),'onDelete':'cascade'});db[_0x11be('0x71')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x11be('0x15b'),'onDelete':'cascade'});db[_0x11be('0x71')][_0x11be('0x11a')](db[_0x11be('0x1a')],{'as':_0x11be('0x18e'),'foreignKey':_0x11be('0x140'),'onDelete':'cascade'});db[_0x11be('0x71')][_0x11be('0x11a')](db[_0x11be('0xe0')],{'as':_0x11be('0xe0'),'foreignKey':_0x11be('0x18f'),'onDelete':'cascade'});db['Automation']['hasMany'](db[_0x11be('0x7e')],{'as':{'plural':_0x11be('0x191'),'singular':_0x11be('0x192')},'foreignKey':_0x11be('0x193'),'onDelete':_0x11be('0x109'),'hooks':!![]});db[_0x11be('0x79')][_0x11be('0x10c')](db['Condition'],{'as':{'plural':_0x11be('0x194'),'singular':_0x11be('0x195')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0x11be('0x79')][_0x11be('0x10c')](db['Action'],{'as':_0x11be('0x196'),'foreignKey':_0x11be('0x197'),'onDelete':_0x11be('0x109'),'hooks':!![]});db[_0x11be('0x7c')][_0x11be('0x10c')](db[_0x11be('0x7c')],{'as':_0x11be('0x170'),'foreignKey':'ParentId','onDelete':_0x11be('0x109')});db[_0x11be('0x80')][_0x11be('0x10c')](db[_0x11be('0x80')],{'as':_0x11be('0x198'),'foreignKey':_0x11be('0x147'),'onDelete':_0x11be('0x109'),'hooks':!![],'required':![]});db['Interval'][_0x11be('0x10c')](db['VoiceExtension'],{'as':_0x11be('0x10e'),'foreignKey':_0x11be('0x147'),'onDelete':_0x11be('0x16e')});db[_0x11be('0x80')][_0x11be('0x10c')](db[_0x11be('0x45')],{'as':_0x11be('0x199'),'foreignKey':'IntervalId'});db['Interval'][_0x11be('0x10c')](db[_0x11be('0x65')],{'as':_0x11be('0x19a'),'foreignKey':_0x11be('0x147')});db[_0x11be('0x80')][_0x11be('0x10c')](db[_0x11be('0x4d')],{'as':_0x11be('0x19b'),'foreignKey':_0x11be('0x147')});db[_0x11be('0x80')]['hasMany'](db[_0x11be('0x178')],{'as':_0x11be('0x19c'),'foreignKey':_0x11be('0x147')});db[_0x11be('0x86')][_0x11be('0x11a')](db['MailAccount'],{});db[_0x11be('0x86')][_0x11be('0x11a')](db[_0x11be('0x94')],{'foreignKey':_0x11be('0x19d')});db[_0x11be('0x86')][_0x11be('0x11a')](db[_0x11be('0x92')],{'foreignKey':_0x11be('0x19e')});db[_0x11be('0x88')][_0x11be('0x11c')](db['VoiceMusicOnHold'],{'as':_0x11be('0x19f'),'through':_0x11be('0x1a0'),'onDelete':_0x11be('0x16e')});db[_0x11be('0x164')]['belongsToMany'](db['CmContact'],{'through':_0x11be('0x18d')});db['Tag']['belongsToMany'](db[_0x11be('0x66')],{'through':'chat_interaction_has_tags'});db[_0x11be('0x164')][_0x11be('0x11c')](db[_0x11be('0x42')],{'through':_0x11be('0x162')});db[_0x11be('0x164')][_0x11be('0x11c')](db['SmsInteraction'],{'through':_0x11be('0x17a')});db[_0x11be('0x164')][_0x11be('0x11c')](db[_0x11be('0x115')],{'through':'fax_interaction_has_tags'});db[_0x11be('0x164')]['belongsToMany'](db['OpenchannelInteraction'],{'through':_0x11be('0x17e')});db[_0x11be('0x164')][_0x11be('0x11c')](db[_0x11be('0x118')],{'through':_0x11be('0x1a1')});db['Trigger'][_0x11be('0x10c')](db[_0x11be('0x7e')],{'as':{'plural':_0x11be('0x1a2'),'singular':_0x11be('0x1a3')},'foreignKey':_0x11be('0x1a4'),'onDelete':'cascade','hooks':!![]});db[_0x11be('0x8c')][_0x11be('0x10c')](db[_0x11be('0x7e')],{'as':{'plural':'AnyConditions','singular':_0x11be('0x1a5')},'foreignKey':_0x11be('0x1a6'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0x11be('0x10c')](db['Action'],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0x11be('0x109'),'hooks':!![]});db[_0x11be('0x92')][_0x11be('0x10c')](db[_0x11be('0x1a7')],{'as':_0x11be('0x1a8'),'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x19e'),'hooks':!![]});db['AnalyticDefaultReport'][_0x11be('0x10c')](db[_0x11be('0x1a7')],{'as':_0x11be('0x1a8'),'onDelete':_0x11be('0x109'),'foreignKey':'DefaultReportId'});db[_0x11be('0x97')][_0x11be('0x10c')](db[_0x11be('0x1a7')],{'as':_0x11be('0x1a8'),'onDelete':_0x11be('0x109'),'foreignKey':'MetricId'});db[_0x11be('0x1a7')][_0x11be('0x11a')](db['AnalyticMetric'],{'foreignKey':_0x11be('0x1a9')});db[_0x11be('0x9b')][_0x11be('0x10c')](db[_0x11be('0x1aa')],{'as':_0x11be('0x1ab'),'onDelete':'cascade','foreignKey':_0x11be('0x1ac')});db['SalesforceConfiguration']['hasMany'](db[_0x11be('0x9e')],{'as':_0x11be('0x1ad'),'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1ae')});db[_0x11be('0x1aa')][_0x11be('0x10c')](db['SalesforceField'],{'as':_0x11be('0x1af'),'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1b0')});db[_0x11be('0x1aa')][_0x11be('0x10c')](db['SalesforceField'],{'as':_0x11be('0x1a8'),'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1b1')});db[_0x11be('0x1aa')]['belongsTo'](db[_0x11be('0x9b')],{'as':_0x11be('0x15f'),'foreignKey':_0x11be('0x1ac')});db[_0x11be('0x9e')][_0x11be('0x10c')](db[_0x11be('0x9e')],{'as':_0x11be('0x1b2'),'foreignKey':_0x11be('0x1ae')});db[_0x11be('0x9e')][_0x11be('0x10c')](db[_0x11be('0x9e')],{'as':_0x11be('0x1b3'),'foreignKey':'DescriptionId'});db['SalesforceField'][_0x11be('0x10c')](db[_0x11be('0x9e')],{'as':'Field','foreignKey':'FieldId'});db[_0x11be('0x9e')][_0x11be('0x11a')](db[_0x11be('0x8e')],{'as':_0x11be('0x8e'),'foreignKey':_0x11be('0x1b4')});db[_0x11be('0x9f')]['hasMany'](db[_0x11be('0xa1')],{'as':'Configurations','onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1ac')});db[_0x11be('0xa1')][_0x11be('0x10c')](db[_0x11be('0xa2')],{'as':_0x11be('0x1ad'),'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1ae')});db[_0x11be('0xa1')][_0x11be('0x10c')](db[_0x11be('0xa2')],{'as':_0x11be('0x1af'),'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1b0')});db['SugarcrmConfiguration'][_0x11be('0x10c')](db['SugarcrmField'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x11be('0x1b1')});db['SugarcrmConfiguration'][_0x11be('0x11a')](db['SugarcrmAccount'],{'as':_0x11be('0x15f'),'foreignKey':'AccountId'});db[_0x11be('0xa2')][_0x11be('0x10c')](db[_0x11be('0xa2')],{'as':_0x11be('0x1b2'),'foreignKey':_0x11be('0x1ae')});db[_0x11be('0xa2')]['hasMany'](db[_0x11be('0xa2')],{'as':_0x11be('0x1b3'),'foreignKey':_0x11be('0x1b0')});db[_0x11be('0xa2')]['hasMany'](db[_0x11be('0xa2')],{'as':_0x11be('0x1b5'),'foreignKey':'FieldId'});db[_0x11be('0xa2')][_0x11be('0x11a')](db['Variable'],{'as':_0x11be('0x8e'),'foreignKey':_0x11be('0x1b4')});db[_0x11be('0xa4')]['hasMany'](db[_0x11be('0x1b6')],{'as':_0x11be('0x1ab'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x11be('0x1b6')]['hasMany'](db[_0x11be('0xa6')],{'as':_0x11be('0x1ad'),'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1ae')});db[_0x11be('0x1b6')][_0x11be('0x10c')](db[_0x11be('0xa6')],{'as':'Descriptions','onDelete':_0x11be('0x109'),'foreignKey':'DescriptionId'});db[_0x11be('0x1b6')][_0x11be('0x10c')](db[_0x11be('0xa6')],{'as':_0x11be('0x1a8'),'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1b1')});db[_0x11be('0x1b6')][_0x11be('0x11a')](db['DeskAccount'],{'as':_0x11be('0x15f'),'foreignKey':_0x11be('0x1ac')});db[_0x11be('0x1b6')][_0x11be('0x11c')](db['Tag'],{'through':_0x11be('0x1b7')});db[_0x11be('0xa6')][_0x11be('0x10c')](db[_0x11be('0xa6')],{'as':_0x11be('0x1b2'),'foreignKey':'SubjectId'});db[_0x11be('0xa6')][_0x11be('0x10c')](db[_0x11be('0xa6')],{'as':_0x11be('0x1b3'),'foreignKey':_0x11be('0x1b0')});db[_0x11be('0xa6')][_0x11be('0x10c')](db[_0x11be('0xa6')],{'as':_0x11be('0x1b5'),'foreignKey':_0x11be('0x1b1')});db['DeskField']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x11be('0x1b4')});db['ZohoAccount']['hasMany'](db[_0x11be('0x1b8')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x11be('0x1ac')});db[_0x11be('0x1b8')][_0x11be('0x10c')](db[_0x11be('0xa9')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x11be('0x1ae')});db[_0x11be('0x1b8')][_0x11be('0x10c')](db['ZohoField'],{'as':_0x11be('0x1af'),'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1b0')});db[_0x11be('0x1b8')][_0x11be('0x10c')](db[_0x11be('0xa9')],{'as':_0x11be('0x1a8'),'onDelete':'cascade','foreignKey':_0x11be('0x1b1')});db[_0x11be('0x1b8')][_0x11be('0x11a')](db[_0x11be('0xa8')],{'as':_0x11be('0x15f'),'foreignKey':_0x11be('0x1ac')});db[_0x11be('0xa9')][_0x11be('0x10c')](db['ZohoField'],{'as':_0x11be('0x1b2'),'foreignKey':_0x11be('0x1ae')});db['ZohoField']['hasMany'](db[_0x11be('0xa9')],{'as':_0x11be('0x1b3'),'foreignKey':_0x11be('0x1b0')});db['ZohoField'][_0x11be('0x10c')](db[_0x11be('0xa9')],{'as':_0x11be('0x1b5'),'foreignKey':_0x11be('0x1b1')});db[_0x11be('0xa9')][_0x11be('0x11a')](db[_0x11be('0x8e')],{'as':_0x11be('0x8e'),'foreignKey':_0x11be('0x1b4')});db['ZendeskAccount']['hasMany'](db[_0x11be('0xab')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x11be('0xab')]['hasMany'](db['ZendeskField'],{'as':_0x11be('0x1ad'),'foreignKey':_0x11be('0x1ae')});db['ZendeskConfiguration']['hasMany'](db[_0x11be('0xad')],{'as':_0x11be('0x1af'),'foreignKey':'DescriptionId'});db[_0x11be('0xab')][_0x11be('0x10c')](db[_0x11be('0xad')],{'as':_0x11be('0x1a8'),'foreignKey':'FieldId'});db['ZendeskConfiguration'][_0x11be('0x11a')](db[_0x11be('0x1b9')],{'as':_0x11be('0x15f'),'foreignKey':_0x11be('0x1ac')});db[_0x11be('0xab')][_0x11be('0x11c')](db[_0x11be('0x164')],{'through':_0x11be('0x1ba')});db[_0x11be('0xad')]['hasMany'](db[_0x11be('0xad')],{'as':_0x11be('0x1b2'),'foreignKey':'SubjectId'});db['ZendeskField'][_0x11be('0x10c')](db[_0x11be('0xad')],{'as':'Description','foreignKey':_0x11be('0x1b0')});db[_0x11be('0xad')][_0x11be('0x10c')](db[_0x11be('0xad')],{'as':_0x11be('0x1b5'),'foreignKey':_0x11be('0x1b1')});db[_0x11be('0xad')]['belongsTo'](db[_0x11be('0x8e')],{'as':_0x11be('0x8e'),'foreignKey':_0x11be('0x1b4')});db[_0x11be('0xaf')][_0x11be('0x10c')](db[_0x11be('0xb1')],{'as':'Configurations','onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1ac')});db['FreshdeskConfiguration']['hasMany'](db[_0x11be('0xb3')],{'as':_0x11be('0x1ad'),'onDelete':'cascade','foreignKey':_0x11be('0x1ae')});db[_0x11be('0xb1')][_0x11be('0x10c')](db[_0x11be('0xb3')],{'as':_0x11be('0x1af'),'onDelete':_0x11be('0x109'),'foreignKey':'DescriptionId'});db[_0x11be('0xb1')][_0x11be('0x10c')](db['FreshdeskField'],{'as':'Fields','onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1b1')});db['FreshdeskConfiguration'][_0x11be('0x11a')](db[_0x11be('0xaf')],{'as':_0x11be('0x15f'),'foreignKey':_0x11be('0x1ac')});db['FreshdeskConfiguration'][_0x11be('0x11c')](db[_0x11be('0x164')],{'through':_0x11be('0x1bb')});db[_0x11be('0xb3')][_0x11be('0x10c')](db[_0x11be('0xb3')],{'as':'Subject','foreignKey':_0x11be('0x1ae')});db[_0x11be('0xb3')][_0x11be('0x10c')](db[_0x11be('0xb3')],{'as':'Description','foreignKey':_0x11be('0x1b0')});db[_0x11be('0xb3')][_0x11be('0x10c')](db[_0x11be('0xb3')],{'as':'Field','foreignKey':_0x11be('0x1b1')});db[_0x11be('0xb3')]['belongsTo'](db['Variable'],{'as':_0x11be('0x8e'),'foreignKey':_0x11be('0x1b4')});db[_0x11be('0xb5')]['hasMany'](db[_0x11be('0xb6')],{'as':_0x11be('0x1ab'),'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1ac')});db[_0x11be('0xb6')][_0x11be('0x10c')](db[_0x11be('0xb8')],{'as':_0x11be('0x1ad'),'foreignKey':'SubjectId'});db['VtigerConfiguration'][_0x11be('0x10c')](db[_0x11be('0xb8')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x11be('0xb6')][_0x11be('0x10c')](db[_0x11be('0xb8')],{'as':_0x11be('0x1a8'),'foreignKey':'FieldId'});db['VtigerConfiguration'][_0x11be('0x11a')](db['VtigerAccount'],{'as':_0x11be('0x15f'),'foreignKey':_0x11be('0x1ac')});db[_0x11be('0xb8')][_0x11be('0x10c')](db[_0x11be('0xb8')],{'as':_0x11be('0x1b2'),'foreignKey':_0x11be('0x1ae')});db[_0x11be('0xb8')]['hasMany'](db[_0x11be('0xb8')],{'as':_0x11be('0x1b3'),'foreignKey':_0x11be('0x1b0')});db['VtigerField'][_0x11be('0x10c')](db[_0x11be('0xb8')],{'as':'Field','foreignKey':_0x11be('0x1b1')});db[_0x11be('0xb8')]['belongsTo'](db[_0x11be('0x8e')],{'as':'Variable','foreignKey':'VariableId'});db[_0x11be('0xba')]['hasMany'](db['ServicenowConfiguration'],{'as':_0x11be('0x1ab'),'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1ac')});db['ServicenowConfiguration']['hasMany'](db[_0x11be('0xbc')],{'as':'Subjects','foreignKey':_0x11be('0x1ae')});db['ServicenowConfiguration'][_0x11be('0x10c')](db[_0x11be('0xbc')],{'as':_0x11be('0x1af'),'foreignKey':'DescriptionId'});db[_0x11be('0x1bc')][_0x11be('0x10c')](db[_0x11be('0xbc')],{'as':'Fields','foreignKey':_0x11be('0x1b1')});db[_0x11be('0x1bc')][_0x11be('0x11a')](db[_0x11be('0xba')],{'as':'Account','foreignKey':_0x11be('0x1ac')});db[_0x11be('0xbc')][_0x11be('0x10c')](db[_0x11be('0xbc')],{'as':'Subject','foreignKey':_0x11be('0x1ae')});db[_0x11be('0xbc')]['hasMany'](db[_0x11be('0xbc')],{'as':_0x11be('0x1b3'),'foreignKey':_0x11be('0x1b0')});db[_0x11be('0xbc')][_0x11be('0x10c')](db['ServicenowField'],{'as':_0x11be('0x1b5'),'foreignKey':_0x11be('0x1b1')});db[_0x11be('0xbc')][_0x11be('0x11a')](db[_0x11be('0x8e')],{'as':_0x11be('0x8e'),'foreignKey':'VariableId'});db[_0x11be('0xbe')][_0x11be('0x10c')](db[_0x11be('0xc0')],{'as':_0x11be('0x1ab'),'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1ac')});db['Dynamics365Configuration']['hasMany'](db[_0x11be('0xc1')],{'as':'Subjects','onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1ae')});db[_0x11be('0xc0')][_0x11be('0x10c')](db[_0x11be('0xc1')],{'as':_0x11be('0x1af'),'onDelete':'cascade','foreignKey':_0x11be('0x1b0')});db[_0x11be('0xc0')][_0x11be('0x10c')](db[_0x11be('0xc1')],{'as':_0x11be('0x1a8'),'onDelete':'cascade','foreignKey':_0x11be('0x1b1')});db['Dynamics365Configuration'][_0x11be('0x11a')](db[_0x11be('0xbe')],{'as':_0x11be('0x15f'),'foreignKey':'AccountId'});db[_0x11be('0xc1')]['hasMany'](db[_0x11be('0xc1')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x11be('0xc1')]['hasMany'](db['Dynamics365Field'],{'as':_0x11be('0x1b3'),'foreignKey':_0x11be('0x1b0')});db[_0x11be('0xc1')][_0x11be('0x10c')](db[_0x11be('0xc1')],{'as':_0x11be('0x1b5'),'foreignKey':_0x11be('0x1b1')});db[_0x11be('0xc1')][_0x11be('0x11a')](db['Variable'],{'as':_0x11be('0x8e'),'foreignKey':_0x11be('0x1b4')});db['FreshsalesAccount'][_0x11be('0x10c')](db[_0x11be('0xc5')],{'as':_0x11be('0x1ab'),'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1ac')});db[_0x11be('0xc5')][_0x11be('0x10c')](db['FreshsalesField'],{'as':_0x11be('0x1ad'),'foreignKey':_0x11be('0x1ae')});db[_0x11be('0xc5')][_0x11be('0x10c')](db['FreshsalesField'],{'as':_0x11be('0x1af'),'foreignKey':_0x11be('0x1b0')});db[_0x11be('0xc5')][_0x11be('0x10c')](db[_0x11be('0xc7')],{'as':_0x11be('0x1a8'),'foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0x11be('0x11a')](db[_0x11be('0xc3')],{'as':_0x11be('0x15f'),'foreignKey':_0x11be('0x1ac')});db[_0x11be('0xc7')][_0x11be('0x10c')](db[_0x11be('0xc7')],{'as':_0x11be('0x1b2'),'foreignKey':_0x11be('0x1ae')});db[_0x11be('0xc7')][_0x11be('0x10c')](db['FreshsalesField'],{'as':_0x11be('0x1b3'),'foreignKey':_0x11be('0x1b0')});db['FreshsalesField']['hasMany'](db['FreshsalesField'],{'as':_0x11be('0x1b5'),'foreignKey':_0x11be('0x1b1')});db[_0x11be('0xc7')][_0x11be('0x11a')](db[_0x11be('0x8e')],{'as':_0x11be('0x8e'),'foreignKey':_0x11be('0x1b4')});db[_0x11be('0xca')][_0x11be('0x11a')](db['ChatWebsite'],{});db[_0x11be('0xca')][_0x11be('0x11a')](db['CmList'],{'as':_0x11be('0x15a'),'foreignKey':'ListId'});db[_0x11be('0xca')][_0x11be('0x11a')](db['CmContact'],{'as':_0x11be('0x160'),'foreignKey':'ContactId'});db['ChatQueueReport']['belongsTo'](db[_0x11be('0x66')],{});db[_0x11be('0xca')][_0x11be('0x11a')](db[_0x11be('0x67')],{});db[_0x11be('0xca')][_0x11be('0x11a')](db[_0x11be('0x10')],{});db[_0x11be('0xca')][_0x11be('0x11a')](db[_0x11be('0x69')],{});db[_0x11be('0xcb')][_0x11be('0x11a')](db[_0x11be('0x10')],{'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1bd')});db[_0x11be('0xcb')][_0x11be('0x11a')](db['User'],{'onDelete':'cascade','foreignKey':_0x11be('0x1be')});db[_0x11be('0xd1')][_0x11be('0x10c')](db['JscriptyQuestionReport'],{'foreignKey':_0x11be('0x1bf'),'onDelete':_0x11be('0x109')});db[_0x11be('0xd1')][_0x11be('0x10c')](db[_0x11be('0xcd')],{'foreignKey':'SessionId','onDelete':'cascade'});db['SmsQueueReport']['belongsTo'](db[_0x11be('0x53')],{});db[_0x11be('0xd2')][_0x11be('0x11a')](db['CmList'],{'as':_0x11be('0x15a'),'foreignKey':_0x11be('0x15b')});db[_0x11be('0xd2')][_0x11be('0x11a')](db[_0x11be('0x6e')],{'as':_0x11be('0x160'),'foreignKey':'ContactId'});db[_0x11be('0xd2')][_0x11be('0x11a')](db['SmsInteraction'],{});db[_0x11be('0xd2')][_0x11be('0x11a')](db[_0x11be('0x56')],{});db[_0x11be('0xd2')][_0x11be('0x11a')](db[_0x11be('0x10')],{});db[_0x11be('0xd2')][_0x11be('0x11a')](db[_0x11be('0x58')],{});db['JscriptyProject'][_0x11be('0x10c')](db[_0x11be('0xd1')],{'foreignKey':'ProjectId'});db[_0x11be('0xd7')][_0x11be('0x10c')](db[_0x11be('0xcf')],{'foreignKey':'ProjectId'});db[_0x11be('0xd7')][_0x11be('0x10c')](db[_0x11be('0xcd')],{'foreignKey':_0x11be('0x1c0')});db[_0x11be('0xdb')][_0x11be('0x11c')](db[_0x11be('0x10')],{'as':_0x11be('0x166'),'through':_0x11be('0x1c1')});db['Team'][_0x11be('0x11c')](db[_0x11be('0x10')],{'as':_0x11be('0x14b'),'through':_0x11be('0x121')});db[_0x11be('0xdd')][_0x11be('0x11c')](db['VoiceQueue'],{'through':_0x11be('0x1c2'),'as':_0x11be('0x126')});db[_0x11be('0xdd')][_0x11be('0x11c')](db[_0x11be('0x3f')],{'through':'team_has_mail_queues','as':'MailQueues'});db[_0x11be('0xdd')][_0x11be('0x11c')](db[_0x11be('0x69')],{'through':_0x11be('0x187'),'as':_0x11be('0x1c3')});db[_0x11be('0xdd')][_0x11be('0x11c')](db['FaxQueue'],{'through':_0x11be('0x176'),'as':_0x11be('0x12a')});db[_0x11be('0xdd')][_0x11be('0x11c')](db[_0x11be('0x58')],{'through':_0x11be('0x1c4'),'as':_0x11be('0x12b')});db[_0x11be('0xdd')][_0x11be('0x11c')](db['OpenchannelQueue'],{'through':_0x11be('0x180'),'as':_0x11be('0x12c')});db[_0x11be('0xdd')][_0x11be('0x11c')](db[_0x11be('0x12e')],{'through':_0x11be('0x1c5'),'as':'WhatsappQueues'});db['Team'][_0x11be('0x11c')](db['VoicePrefix'],{'through':_0x11be('0x104'),'as':'VoicePrefixes'});db[_0x11be('0xe0')]['hasMany'](db[_0x11be('0x18b')],{'as':'Hoppers','foreignKey':_0x11be('0x18f')});db[_0x11be('0xe0')][_0x11be('0x10c')](db['CmHopperFinal'],{'as':_0x11be('0x10f'),'foreignKey':_0x11be('0x18f')});db[_0x11be('0xe0')][_0x11be('0x10c')](db[_0x11be('0x74')],{'as':_0x11be('0x142'),'foreignKey':'CampaignId'});db[_0x11be('0xe0')][_0x11be('0x10c')](db[_0x11be('0x71')],{'as':'HopperBlacks','foreignKey':_0x11be('0x18f')});db[_0x11be('0xe0')]['belongsTo'](db[_0x11be('0x2a')],{'as':_0x11be('0x2a'),'foreignKey':_0x11be('0x145')});db[_0x11be('0xe0')][_0x11be('0x11a')](db[_0x11be('0x2a')],{'as':_0x11be('0x1c6'),'foreignKey':_0x11be('0x146')});db['Campaign'][_0x11be('0x11a')](db[_0x11be('0x80')],{'as':'Interval','foreignKey':_0x11be('0x147')});db['Campaign'][_0x11be('0x11a')](db['SquareProject'],{'as':_0x11be('0xdb'),'foreignKey':_0x11be('0x1c7')});db['Campaign']['belongsToMany'](db[_0x11be('0xed')],{'as':_0x11be('0x120'),'through':'campaigns_has_cm_lists'});db['Campaign'][_0x11be('0x11c')](db[_0x11be('0xed')],{'as':'BlackLists','through':_0x11be('0x1c8')});db[_0x11be('0x175')]['belongsTo'](db[_0x11be('0x16c')],{'as':'ChatOfflineMessage','foreignKey':_0x11be('0x16d')});db['MailTransferReport'][_0x11be('0x11a')](db['MailMessage'],{});db[_0x11be('0x1c9')][_0x11be('0x11a')](db[_0x11be('0x42')],{});db[_0x11be('0x1c9')][_0x11be('0x11a')](db['MailAccount'],{'foreignKey':_0x11be('0x1ca'),'as':'FromAccount'});db['MailTransferReport']['belongsTo'](db[_0x11be('0x10')],{'foreignKey':_0x11be('0x1cb'),'as':_0x11be('0x1cc')});db[_0x11be('0x1c9')][_0x11be('0x11a')](db[_0x11be('0x10')],{'foreignKey':_0x11be('0x1cd'),'as':'ToAgent'});db[_0x11be('0x1c9')][_0x11be('0x11a')](db['MailQueue'],{'foreignKey':_0x11be('0x1ce'),'as':_0x11be('0x1cf')});db[_0x11be('0x1c9')][_0x11be('0x11a')](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0x11be('0x1d0')});db[_0x11be('0xe7')]['belongsTo'](db[_0x11be('0x67')],{});db[_0x11be('0xe7')]['belongsTo'](db[_0x11be('0x66')],{});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0x11be('0x1d1')});db['ChatTransferReport'][_0x11be('0x11a')](db[_0x11be('0x10')],{'foreignKey':_0x11be('0x1cb'),'as':_0x11be('0x1cc')});db[_0x11be('0xe7')][_0x11be('0x11a')](db[_0x11be('0x10')],{'foreignKey':_0x11be('0x1cd'),'as':_0x11be('0x1d2')});db[_0x11be('0xe7')][_0x11be('0x11a')](db[_0x11be('0x69')],{'foreignKey':_0x11be('0x1d3'),'as':_0x11be('0x1cf')});db[_0x11be('0xe7')][_0x11be('0x11a')](db[_0x11be('0x62')],{'foreignKey':_0x11be('0x1d4'),'as':_0x11be('0x1d0')});db[_0x11be('0xe9')][_0x11be('0x11a')](db['FaxMessage'],{});db[_0x11be('0xe9')]['belongsTo'](db[_0x11be('0x115')],{});db[_0x11be('0xe9')][_0x11be('0x11a')](db['FaxAccount'],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db[_0x11be('0xe9')]['belongsTo'](db[_0x11be('0x10')],{'foreignKey':'FromUserId','as':'FromAgent'});db['FaxTransferReport'][_0x11be('0x11a')](db['User'],{'foreignKey':_0x11be('0x1cd'),'as':_0x11be('0x1d2')});db[_0x11be('0xe9')][_0x11be('0x11a')](db[_0x11be('0x50')],{'foreignKey':'ToFaxQueueId','as':_0x11be('0x1cf')});db[_0x11be('0xe9')][_0x11be('0x11a')](db[_0x11be('0x4b')],{'foreignKey':_0x11be('0x1d5'),'as':_0x11be('0x1d0')});db[_0x11be('0xea')]['belongsTo'](db[_0x11be('0x5f')],{});db[_0x11be('0xea')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x11be('0xea')][_0x11be('0x11a')](db[_0x11be('0x5a')],{'foreignKey':_0x11be('0x1d6'),'as':_0x11be('0x1d1')});db[_0x11be('0xea')][_0x11be('0x11a')](db['User'],{'foreignKey':_0x11be('0x1cb'),'as':_0x11be('0x1cc')});db[_0x11be('0xea')][_0x11be('0x11a')](db[_0x11be('0x10')],{'foreignKey':_0x11be('0x1cd'),'as':_0x11be('0x1d2')});db[_0x11be('0xea')][_0x11be('0x11a')](db[_0x11be('0x61')],{'foreignKey':'ToOpenchannelQueueId','as':_0x11be('0x1cf')});db[_0x11be('0xea')][_0x11be('0x11a')](db[_0x11be('0x5a')],{'foreignKey':'ToOpenchannelAccountId','as':_0x11be('0x1d0')});db[_0x11be('0x1d7')][_0x11be('0x11a')](db[_0x11be('0x56')],{});db[_0x11be('0x1d7')][_0x11be('0x11a')](db['SmsInteraction'],{});db[_0x11be('0x1d7')][_0x11be('0x11a')](db['SmsAccount'],{'foreignKey':_0x11be('0x1d8'),'as':'FromAccount'});db[_0x11be('0x1d7')][_0x11be('0x11a')](db[_0x11be('0x10')],{'foreignKey':'FromUserId','as':_0x11be('0x1cc')});db[_0x11be('0x1d7')][_0x11be('0x11a')](db[_0x11be('0x10')],{'foreignKey':_0x11be('0x1cd'),'as':_0x11be('0x1d2')});db['SmsTransferReport'][_0x11be('0x11a')](db[_0x11be('0x58')],{'foreignKey':_0x11be('0x1d9'),'as':_0x11be('0x1cf')});db[_0x11be('0x1d7')][_0x11be('0x11a')](db[_0x11be('0x53')],{'foreignKey':_0x11be('0x1da'),'as':_0x11be('0x1d0')});db[_0x11be('0xed')]['hasMany'](db[_0x11be('0x7c')],{'as':'Dispositions','foreignKey':_0x11be('0x15b'),'onDelete':_0x11be('0x109')});db[_0x11be('0xed')][_0x11be('0x10c')](db['CmCustomField'],{'as':_0x11be('0x1db'),'foreignKey':'ListId'});db[_0x11be('0xed')][_0x11be('0x10c')](db[_0x11be('0x6e')],{'as':_0x11be('0x11e'),'onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x15b')});db[_0x11be('0xed')][_0x11be('0x10c')](db[_0x11be('0x73')],{'as':_0x11be('0x10f'),'foreignKey':'ListId'});db[_0x11be('0xed')][_0x11be('0x10c')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x11be('0x15b')});db[_0x11be('0xed')]['hasMany'](db[_0x11be('0x75')],{'as':'ReportAgentPreview','foreignKey':_0x11be('0x15b')});db[_0x11be('0xed')][_0x11be('0x11c')](db[_0x11be('0x1a')],{'as':_0x11be('0x1dc'),'through':_0x11be('0x14a')});db[_0x11be('0xed')]['belongsToMany'](db[_0x11be('0x10')],{'as':'Agents','through':_0x11be('0x1dd')});db[_0x11be('0xef')][_0x11be('0x10c')](db[_0x11be('0x17')],{'as':_0x11be('0x10e'),'onDelete':_0x11be('0x109')});db['VoicePrefix'][_0x11be('0x11c')](db['User'],{'as':_0x11be('0x14b'),'through':_0x11be('0x106')});db['VoicePrefix']['belongsToMany'](db[_0x11be('0xdd')],{'through':_0x11be('0x104'),'as':'Teams'});db[_0x11be('0xf1')][_0x11be('0x10c')](db[_0x11be('0x10')],{'as':'Users','foreignKey':'userProfileId'});db[_0x11be('0xf1')][_0x11be('0x10c')](db[_0x11be('0xf2')],{'as':_0x11be('0x1de'),'foreignKey':_0x11be('0x11b'),'onDelete':_0x11be('0x109')});db[_0x11be('0xf2')]['hasMany'](db['UserProfileResource'],{'as':_0x11be('0x1df'),'foreignKey':'sectionId','onDelete':'cascade'});db['WhatsappAccount'][_0x11be('0x10c')](db[_0x11be('0x7c')],{'as':_0x11be('0x170'),'foreignKey':'WhatsappAccountId','onDelete':_0x11be('0x109')});db[_0x11be('0x139')][_0x11be('0x10c')](db[_0x11be('0x7b')],{'as':_0x11be('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x11be('0x139')][_0x11be('0x10c')](db[_0x11be('0xfb')],{'as':_0x11be('0x14e'),'foreignKey':_0x11be('0x1e0')});db[_0x11be('0x139')]['hasMany'](db['WhatsappInteraction'],{'as':_0x11be('0x159')});db[_0x11be('0x139')][_0x11be('0x10c')](db[_0x11be('0xf8')],{'as':_0x11be('0x13d')});db[_0x11be('0x139')]['belongsTo'](db[_0x11be('0xed')],{'as':_0x11be('0x15a'),'foreignKey':'ListId'});db[_0x11be('0x139')]['belongsTo'](db[_0x11be('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x11be('0x149')});db[_0x11be('0x139')][_0x11be('0x11c')](db['User'],{'as':_0x11be('0x14b'),'through':_0x11be('0x13b')});db[_0x11be('0xf8')][_0x11be('0x11a')](db['User'],{'onDelete':_0x11be('0x16e')});db['WhatsappApplication'][_0x11be('0x11a')](db['WhatsappQueue'],{'onDelete':_0x11be('0x16e')});db['WhatsappApplication'][_0x11be('0x11a')](db['WhatsappAccount'],{'onDelete':_0x11be('0x16e')});db['WhatsappApplication'][_0x11be('0x11a')](db[_0x11be('0x80')],{'onDelete':_0x11be('0x16e'),'foreignKey':_0x11be('0x147')});db[_0x11be('0xf8')][_0x11be('0x11a')](db[_0x11be('0x164')],{'onDelete':_0x11be('0x16e'),'foreignKey':_0x11be('0x16f')});db['WhatsappInteraction'][_0x11be('0x10c')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0x11be('0x109'),'foreignKey':_0x11be('0x1e1')});db[_0x11be('0x118')][_0x11be('0x11a')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0x11be('0x1e0')});db[_0x11be('0x118')][_0x11be('0x11a')](db[_0x11be('0x6e')],{'as':'Contact','foreignKey':'ContactId'});db[_0x11be('0x118')]['belongsTo'](db['User'],{'as':_0x11be('0x161'),'foreignKey':'UserId'});db[_0x11be('0x118')][_0x11be('0x11c')](db['Tag'],{'through':_0x11be('0x1a1'),'as':_0x11be('0x163')});db[_0x11be('0x118')]['belongsToMany'](db[_0x11be('0x164')],{'through':_0x11be('0x1a1'),'as':_0x11be('0x165')});db[_0x11be('0x118')][_0x11be('0x11c')](db[_0x11be('0x10')],{'as':_0x11be('0x166'),'through':_0x11be('0x1e2'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0x11be('0x11a')](db['User'],{'as':_0x11be('0x10')});db[_0x11be('0xfb')]['belongsTo'](db[_0x11be('0x6e')],{'onDelete':_0x11be('0x109'),'as':_0x11be('0x160')});db[_0x11be('0xfb')]['belongsTo'](db['WhatsappInteraction'],{'onDelete':_0x11be('0x109'),'as':'Interaction','foreignKey':_0x11be('0x1e1')});db[_0x11be('0xfb')][_0x11be('0x11a')](db[_0x11be('0x139')],{'as':_0x11be('0x15f'),'foreignKey':_0x11be('0x1e0')});db['WhatsappQueueReport'][_0x11be('0x11a')](db[_0x11be('0x139')],{});db[_0x11be('0xfd')][_0x11be('0x11a')](db[_0x11be('0xed')],{'as':_0x11be('0x15a'),'foreignKey':_0x11be('0x15b')});db['WhatsappQueueReport'][_0x11be('0x11a')](db[_0x11be('0x6e')],{'as':_0x11be('0x160'),'foreignKey':_0x11be('0x154')});db[_0x11be('0xfd')][_0x11be('0x11a')](db[_0x11be('0x118')],{});db[_0x11be('0xfd')][_0x11be('0x11a')](db[_0x11be('0x12e')],{});db[_0x11be('0xfd')][_0x11be('0x11a')](db[_0x11be('0xfb')],{});db[_0x11be('0xfd')][_0x11be('0x11a')](db['User'],{});db['WhatsappTransferReport']['belongsTo'](db[_0x11be('0xfb')],{});db[_0x11be('0xfe')][_0x11be('0x11a')](db['WhatsappInteraction'],{});db[_0x11be('0xfe')][_0x11be('0x11a')](db[_0x11be('0x139')],{'foreignKey':_0x11be('0x1e3'),'as':_0x11be('0x1d1')});db[_0x11be('0xfe')][_0x11be('0x11a')](db[_0x11be('0x139')],{'foreignKey':_0x11be('0x1e4'),'as':_0x11be('0x1d0')});db['WhatsappTransferReport']['belongsTo'](db[_0x11be('0x12e')],{'foreignKey':'ToQueueId','as':_0x11be('0x1cf')});db[_0x11be('0xfe')][_0x11be('0x11a')](db[_0x11be('0x10')],{'foreignKey':_0x11be('0x1cb'),'as':'FromAgent'});db[_0x11be('0xfe')][_0x11be('0x11a')](db[_0x11be('0x10')],{'foreignKey':'ToUserId','as':_0x11be('0x1d2')});db[_0x11be('0x12e')]['belongsToMany'](db[_0x11be('0x10')],{'as':_0x11be('0x14b'),'through':_0x11be('0x38'),'foreignKey':_0x11be('0x1e5')});db['WhatsappQueue'][_0x11be('0x11c')](db[_0x11be('0xdd')],{'through':_0x11be('0x1c5'),'as':_0x11be('0x15e')});module[_0x11be('0x1e6')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa9e0=['../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Attachment','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','WhatsappAccount','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','userProfileId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','MailQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','user_has_square_projects','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','Hoppers','HopperFinals','VoiceQueueId','CmHopperHistory','TrunkId','belongsTo','TrunkBackup','Interval','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceCallReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','MailServerOut','Imap','Smtp','Disposition','Dispositions','CannedAnswer','Answers','Interactions','MailApplication','List','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','Tags','ThroughTags','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','MailQueueReport','ListId','Dashboard','Items','FaxAccountId','Exntensions','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','Users','user_has_fax_interactions','AttachmentId','team_has_fax_queues','SmsAccountId','Owner','sms_interaction_has_tags','user_has_sms_interactions','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','mandatoryDispositionPause','OpenchannelQueue','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','Attachments','Website','CmCompany','CompanyId','JscriptySessions','Company','cm_contact_has_tags','Agent','OwnerId','CampaignId','All','Any','AutomationId','Extensions','MailApplications','ChatApplications','FaxApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','Trigger','AllCondition','TriggerAllId','TriggerId','Fields','AnalyticMetric','MetricId','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','VariableId','Field','Variable','Configurations','DeskField','ZohoAccount','int_zendesk_configuration_has_tags','FreshdeskConfiguration','VtigerConfiguration','VtigerAccount','ServicenowAccount','Dynamics365Field','FromId','ToId','SessionId','ProjectId','JscriptyAnswerReport','user_has_teams','TeamVoiceQueue','VoiceQueues','team_has_chat_queues','WhatsappQueues','HopperHistories','HopperBlacks','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToQueue','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToAgent','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','ToOpenchannelQueueId','FromSmsAccountId','ToSmsAccountId','CmCustomField','Queues','UserProfileSections','UserProfileSection','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','ToWhatsappAccountId','team_has_whatsapp_queues','exports','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network'];(function(_0x2a3f33,_0x13381f){var _0x405459=function(_0x31dddd){while(--_0x31dddd){_0x2a3f33['push'](_0x2a3f33['shift']());}};_0x405459(++_0x13381f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['Trigger']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['Variable']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/variable/variable.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/integrationReport/integrationReport.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['AnalyticExtractedReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticMetric']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['SalesforceField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDeskAccount/intDeskAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['DeskField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['ZohoAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZendeskField/intZendeskField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['VtigerAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intVtigerAccount/intVtigerAccount.model');db['VtigerConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['ServicenowAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['Dynamics365Field']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x8c'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db['JscriptyAnswerReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['SquareReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['SquareProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareMessage']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/team/team.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Migration']=db['sequelize'][_0x0a9e('0x12')]('../api/migration/migration.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/attachment/attachment.model');db['Plugin']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/plugin/plugin.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['OpenchannelTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['UserProfileSection']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userNotification/userNotification.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/whatsappAccount/whatsappAccount.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/whatsappApplication/whatsappApplication.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappQueue/whatsappQueue.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['TeamVoiceQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x11')][_0x0a9e('0x105')](db['VoiceMail'],{'as':_0x0a9e('0x106'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x108')});db['User'][_0x0a9e('0x109')](db[_0x0a9e('0x10a')],{'as':_0x0a9e('0x10b'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x10c'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x109')](db[_0x0a9e('0x16')],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db['User'][_0x0a9e('0x109')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')][_0x0a9e('0x109')](db['CmHopperHistory'],{'as':_0x0a9e('0x10d'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')][_0x0a9e('0x109')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')][_0x0a9e('0x109')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x10e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x109')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x10f'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')]['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x110'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')]['hasMany'](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')][_0x0a9e('0x109')](db[_0x0a9e('0x113')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')][_0x0a9e('0x109')](db['WhatsappInteraction'],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')][_0x0a9e('0x109')](db[_0x0a9e('0xf2')],{'as':_0x0a9e('0x116'),'foreignKey':_0x0a9e('0x117')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xee')],{'as':_0x0a9e('0xee'),'foreignKey':_0x0a9e('0x118')});db['User'][_0x0a9e('0x119')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x11a'),'through':_0x0a9e('0x11b')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x11e')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x11f'),'through':_0x0a9e('0x120')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0xdc')],{'through':'user_has_teams'});db[_0x0a9e('0x11')]['belongsToMany'](db['MailInteraction'],{'as':'MailInteractions','through':_0x0a9e('0x121')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x64')],{'as':'ChatInteractions','through':_0x0a9e('0x122')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'through':'user_has_fax_interactions'});db['User'][_0x0a9e('0x119')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x110'),'through':'user_has_sms_interactions'});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','through':_0x0a9e('0x123')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db['WhatsappInteraction'],{'as':_0x0a9e('0x115'),'through':_0x0a9e('0x124')});db[_0x0a9e('0x11')]['belongsToMany'](db['VoiceQueue'],{'as':'VoiceQueues','through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0xec')],{'as':'VoicePrefixes','through':_0x0a9e('0x103'),'required':![]});db['User'][_0x0a9e('0x119')](db[_0x0a9e('0x3c')],{'as':_0x0a9e('0x125'),'through':'UserMailQueue','required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x67')],{'as':'ChatQueues','through':_0x0a9e('0x126'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x119')](db['FaxQueue'],{'as':_0x0a9e('0x127'),'through':'UserFaxQueue','required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x128'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db['OpenchannelQueue'],{'as':_0x0a9e('0x129'),'through':_0x0a9e('0x35'),'required':![]});db['User'][_0x0a9e('0x119')](db[_0x0a9e('0xfd')],{'as':'WhatsappQueues','through':_0x0a9e('0x37'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db['CmList'],{'through':_0x0a9e('0x120')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x12a'),'through':_0x0a9e('0x12b')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x12c'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x12d'),'through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x59')],{'as':'OpenchannelAccounts','through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db['SmsAccount'],{'as':_0x0a9e('0x130'),'through':_0x0a9e('0x131')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0xf3')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x133')});db['User'][_0x0a9e('0x119')](db[_0x0a9e('0x134')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x136')});db[_0x0a9e('0x13')][_0x0a9e('0x109')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0x0a9e('0x137')});db[_0x0a9e('0x138')][_0x0a9e('0x109')](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x16')][_0x0a9e('0x109')](db['VoiceExtension'],{'as':_0x0a9e('0x139'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x18')][_0x0a9e('0x119')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db['VoiceQueue'][_0x0a9e('0x109')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x13c'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')][_0x0a9e('0x109')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x13d'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')][_0x0a9e('0x109')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x13e'),'foreignKey':_0x0a9e('0x13f')});db[_0x0a9e('0x1a')][_0x0a9e('0x109')](db[_0x0a9e('0x140')],{'as':'HopperHistories','foreignKey':_0x0a9e('0x13f')});db[_0x0a9e('0x1a')][_0x0a9e('0x109')](db[_0x0a9e('0x73')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')][_0x0a9e('0x109')](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':_0x0a9e('0x13f')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0xcc')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x13f')});db['VoiceQueue']['belongsTo'](db['Trunk'],{'as':_0x0a9e('0x28'),'foreignKey':_0x0a9e('0x141')});db[_0x0a9e('0x1a')][_0x0a9e('0x142')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x143'),'foreignKey':'TrunkBackupId'});db[_0x0a9e('0x1a')][_0x0a9e('0x142')](db[_0x0a9e('0x144')],{'as':_0x0a9e('0x144'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x1a')][_0x0a9e('0x142')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x146')});db['VoiceQueue'][_0x0a9e('0x119')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x11f'),'through':_0x0a9e('0x147')});db[_0x0a9e('0x1a')][_0x0a9e('0x119')](db['User'],{'as':_0x0a9e('0x148'),'through':'UserVoiceQueue'});db['VoiceQueue'][_0x0a9e('0x119')](db['Team'],{'as':_0x0a9e('0x149'),'through':'TeamVoiceQueue'});db['VoiceQueue'][_0x0a9e('0x119')](db['CmList'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x14b')});db[_0x0a9e('0x10a')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x108')});db['ScreenRecording']['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x106')][_0x0a9e('0x109')](db[_0x0a9e('0x1f')],{'as':_0x0a9e('0x14c'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x14d'),'sourceKey':_0x0a9e('0x14e')});db['VoiceMailMessage']['belongsTo'](db['VoiceMail'],{'foreignKey':_0x0a9e('0x14d'),'targetKey':_0x0a9e('0x14e')});db[_0x0a9e('0x14f')][_0x0a9e('0x109')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x150'),'foreignKey':_0x0a9e('0x151'),'constraints':![]});db[_0x0a9e('0x14f')]['hasMany'](db['VoiceAgentReport'],{'as':_0x0a9e('0x152'),'foreignKey':_0x0a9e('0x151'),'constraints':![]});db['VoiceCallReport'][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x14f')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x39')][_0x0a9e('0x142')](db[_0x0a9e('0x3b')],{'as':'MailAccount','foreignKey':_0x0a9e('0x155')});db[_0x0a9e('0x156')][_0x0a9e('0x142')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x155')});db[_0x0a9e('0x3b')][_0x0a9e('0x105')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x157'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x3b')]['hasOne'](db['MailServerOut'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x3b')][_0x0a9e('0x109')](db[_0x0a9e('0x159')],{'as':_0x0a9e('0x15a'),'foreignKey':_0x0a9e('0x155'),'onDelete':'cascade'});db[_0x0a9e('0x3b')]['hasMany'](db[_0x0a9e('0x15b')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x155')});db[_0x0a9e('0x3b')][_0x0a9e('0x109')](db[_0x0a9e('0x3e')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x155')});db[_0x0a9e('0x3b')][_0x0a9e('0x109')](db[_0x0a9e('0x113')],{'as':_0x0a9e('0x15d')});db[_0x0a9e('0x3b')][_0x0a9e('0x109')](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x139')});db['MailAccount']['belongsTo'](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':'ListId'});db['MailAccount'][_0x0a9e('0x142')](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x88'),'foreignKey':'TemplateId'});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x146')});db['MailAccount'][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':'user_has_mail_accounts'});db[_0x0a9e('0x3c')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x119')](db[_0x0a9e('0xdc')],{'through':_0x0a9e('0x160'),'as':_0x0a9e('0x149')});db[_0x0a9e('0x113')][_0x0a9e('0x109')](db[_0x0a9e('0x3e')],{'as':_0x0a9e('0x14c'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x113')][_0x0a9e('0x142')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x155')});db[_0x0a9e('0x113')]['belongsTo'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x113')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x108')});db['MailInteraction'][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x163'),'as':_0x0a9e('0x164')});db[_0x0a9e('0x113')][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x163'),'as':_0x0a9e('0x165')});db[_0x0a9e('0x113')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x121'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x3e')][_0x0a9e('0x109')](db[_0x0a9e('0xe1')],{'as':'Attachments','onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x3e')]['belongsTo'](db['User'],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x3e')][_0x0a9e('0x142')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x0a9e('0x3e')][_0x0a9e('0x142')](db[_0x0a9e('0x113')],{'as':_0x0a9e('0x166'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')][_0x0a9e('0x142')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x155')});db[_0x0a9e('0x3e')][_0x0a9e('0x142')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x60'),'foreignKey':_0x0a9e('0x167')});db[_0x0a9e('0x3e')][_0x0a9e('0x142')](db[_0x0a9e('0x66')],{'as':'ChatOfflineMessage','foreignKey':_0x0a9e('0x168')});db[_0x0a9e('0x15e')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x15e')]['belongsTo'](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x15e')][_0x0a9e('0x142')](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x15e')][_0x0a9e('0x142')](db[_0x0a9e('0x144')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x0a9e('0x15e')][_0x0a9e('0x142')](db['Tag'],{'onDelete':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x16a')});db['MailQueueReport'][_0x0a9e('0x142')](db['MailAccount'],{});db[_0x0a9e('0x16b')][_0x0a9e('0x142')](db['CmList'],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c')});db['MailQueueReport'][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':'Contact','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x16b')][_0x0a9e('0x142')](db[_0x0a9e('0x113')],{});db[_0x0a9e('0x16b')][_0x0a9e('0x142')](db['MailMessage'],{});db[_0x0a9e('0x16b')][_0x0a9e('0x142')](db['User'],{});db[_0x0a9e('0x16b')][_0x0a9e('0x142')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x16d')][_0x0a9e('0x109')](db[_0x0a9e('0x43')],{'as':_0x0a9e('0x16e'),'onDelete':'cascade'});db['FaxAccount']['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0x0a9e('0x16f'),'onDelete':_0x0a9e('0x107')});db['FaxAccount']['hasMany'](db[_0x0a9e('0x15b')],{'as':'Answers','foreignKey':_0x0a9e('0x16f')});db[_0x0a9e('0x45')][_0x0a9e('0x109')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x15d')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x139')});db['FaxAccount'][_0x0a9e('0x109')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x170'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x45')][_0x0a9e('0x109')](db[_0x0a9e('0x4a')],{'as':'Messages'});db[_0x0a9e('0x45')]['belongsTo'](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x28')});db['FaxAccount'][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':'List','foreignKey':_0x0a9e('0x16c')});db['FaxAccount'][_0x0a9e('0x142')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x146')});db['FaxAccount'][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x171')});db[_0x0a9e('0x47')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x142')](db[_0x0a9e('0x4c')],{'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':'restrict'});db['FaxApplication'][_0x0a9e('0x142')](db['Tag'],{'onDelete':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x16a')});db['FaxInteraction'][_0x0a9e('0x109')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x14c'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x111')][_0x0a9e('0x142')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x162'),'foreignKey':'FaxAccountId'});db[_0x0a9e('0x111')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':'ContactId'});db[_0x0a9e('0x111')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'as':'Owner','foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x111')][_0x0a9e('0x119')](db['Tag'],{'through':_0x0a9e('0x173'),'as':'Tags'});db[_0x0a9e('0x111')][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x165')});db[_0x0a9e('0x111')][_0x0a9e('0x119')](db['User'],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x175'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x4a')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x11')});db[_0x0a9e('0x4a')][_0x0a9e('0x142')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x166'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x4a')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x153')});db[_0x0a9e('0x4a')][_0x0a9e('0x142')](db[_0x0a9e('0xe1')],{'as':_0x0a9e('0xe1'),'foreignKey':_0x0a9e('0x176')});db['FaxMessage'][_0x0a9e('0x142')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x162'),'foreignKey':'FaxAccountId'});db[_0x0a9e('0x4c')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x119')](db[_0x0a9e('0xdc')],{'through':_0x0a9e('0x177'),'as':_0x0a9e('0x149')});db['FaxQueueReport'][_0x0a9e('0x142')](db[_0x0a9e('0x45')],{});db['FaxQueueReport'][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':'ListId'});db[_0x0a9e('0x4e')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':'ContactId'});db[_0x0a9e('0x4e')][_0x0a9e('0x142')](db[_0x0a9e('0x111')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x142')](db['FaxMessage'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x142')](db['User'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x142')](db[_0x0a9e('0x4c')],{});db['SmsAccount']['hasMany'](db[_0x0a9e('0x159')],{'as':_0x0a9e('0x15a'),'foreignKey':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x50')][_0x0a9e('0x109')](db[_0x0a9e('0x15b')],{'as':_0x0a9e('0x15c'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0x0a9e('0x109')](db['SmsMessage'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x178')});db[_0x0a9e('0x50')][_0x0a9e('0x109')](db['SmsInteraction'],{'as':_0x0a9e('0x15d')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x52')],{'as':'Applications'});db[_0x0a9e('0x50')][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c')});db[_0x0a9e('0x50')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x146')});db[_0x0a9e('0x50')][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x131')});db[_0x0a9e('0x52')]['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x52')][_0x0a9e('0x142')](db[_0x0a9e('0x57')],{'onDelete':'restrict'});db[_0x0a9e('0x52')][_0x0a9e('0x142')](db['SmsAccount'],{'onDelete':'restrict'});db[_0x0a9e('0x52')][_0x0a9e('0x142')](db[_0x0a9e('0x144')],{'onDelete':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x52')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x16a')});db['SmsInteraction'][_0x0a9e('0x109')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x14c'),'onDelete':_0x0a9e('0x107'),'foreignKey':'SmsInteractionId'});db['SmsInteraction'][_0x0a9e('0x142')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x178')});db[_0x0a9e('0x53')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':'ContactId'});db[_0x0a9e('0x53')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x108')});db['SmsInteraction']['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x164')});db['SmsInteraction']['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x17a'),'as':_0x0a9e('0x165')});db[_0x0a9e('0x53')][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x17c')});db[_0x0a9e('0x55')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db['SmsMessage']['belongsTo'](db[_0x0a9e('0x11c')],{'onDelete':'cascade','as':_0x0a9e('0x153')});db[_0x0a9e('0x55')][_0x0a9e('0x142')](db['SmsInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x166'),'foreignKey':_0x0a9e('0x17c')});db[_0x0a9e('0x55')][_0x0a9e('0x142')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x178')});db['SmsQueue'][_0x0a9e('0x119')](db['User'],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x34'),'foreignKey':'SmsQueueId'});db[_0x0a9e('0x57')][_0x0a9e('0x119')](db[_0x0a9e('0xdc')],{'through':_0x0a9e('0x17d'),'as':_0x0a9e('0x149')});db[_0x0a9e('0x59')]['hasMany'](db[_0x0a9e('0x159')],{'as':_0x0a9e('0x15a'),'foreignKey':_0x0a9e('0x17e'),'onDelete':'cascade'});db[_0x0a9e('0x59')][_0x0a9e('0x109')](db[_0x0a9e('0x15b')],{'as':'Answers','foreignKey':_0x0a9e('0x17e')});db[_0x0a9e('0x59')][_0x0a9e('0x109')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x15d'),'foreignKey':_0x0a9e('0x17e')});db['OpenchannelAccount']['hasMany'](db[_0x0a9e('0x5e')],{'as':_0x0a9e('0x14c'),'foreignKey':'OpenchannelAccountId'});db[_0x0a9e('0x59')][_0x0a9e('0x109')](db[_0x0a9e('0x5b')],{'as':_0x0a9e('0x139'),'foreignKey':_0x0a9e('0x17e')});db[_0x0a9e('0x59')]['belongsTo'](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c')});db['OpenchannelAccount'][_0x0a9e('0x142')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x17f'),'foreignKey':_0x0a9e('0x146')});db['OpenchannelAccount']['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x12f')});db['OpenchannelApplication'][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x5b')][_0x0a9e('0x142')](db[_0x0a9e('0x180')],{'onDelete':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x181')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x169'),'foreignKey':'OpenchannelAccountId'});db[_0x0a9e('0x5b')]['belongsTo'](db[_0x0a9e('0x144')],{'onDelete':_0x0a9e('0x169'),'foreignKey':'IntervalId'});db[_0x0a9e('0x5b')][_0x0a9e('0x142')](db['Tag'],{'onDelete':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x16a')});db[_0x0a9e('0x5d')][_0x0a9e('0x109')](db[_0x0a9e('0x5e')],{'as':_0x0a9e('0x14c'),'onDelete':_0x0a9e('0x107'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5d')][_0x0a9e('0x142')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x17e')});db[_0x0a9e('0x5d')][_0x0a9e('0x142')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x5d')][_0x0a9e('0x142')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x108')});db['OpenchannelInteraction'][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x182'),'as':_0x0a9e('0x164')});db[_0x0a9e('0x5d')][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x182'),'as':_0x0a9e('0x165')});db['OpenchannelInteraction']['belongsToMany'](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x123'),'foreignKey':_0x0a9e('0x183')});db[_0x0a9e('0x5e')][_0x0a9e('0x142')](db['User'],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x11')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x11c')],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x153')});db['OpenchannelMessage'][_0x0a9e('0x142')](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x166'),'foreignKey':_0x0a9e('0x183')});db[_0x0a9e('0x5e')]['belongsTo'](db['Attachment'],{'as':_0x0a9e('0xe1'),'foreignKey':_0x0a9e('0x176')});db[_0x0a9e('0x5e')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x17e')});db[_0x0a9e('0x180')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x180')][_0x0a9e('0x119')](db['Team'],{'through':_0x0a9e('0x184'),'as':'Teams'});db[_0x0a9e('0x60')][_0x0a9e('0x109')](db['Disposition'],{'as':_0x0a9e('0x15a'),'foreignKey':'ChatWebsiteId','onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x60')][_0x0a9e('0x109')](db[_0x0a9e('0x15b')],{'as':_0x0a9e('0x15c'),'foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x60')][_0x0a9e('0x109')](db[_0x0a9e('0x185')],{'as':'ProactiveActions'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x15d')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x139')});db[_0x0a9e('0x60')][_0x0a9e('0x109')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x14c')});db['ChatWebsite'][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c')});db[_0x0a9e('0x60')][_0x0a9e('0x142')](db[_0x0a9e('0x144')],{'as':_0x0a9e('0x144'),'foreignKey':'IntervalId'});db[_0x0a9e('0x60')][_0x0a9e('0x142')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x60')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x17f'),'foreignKey':_0x0a9e('0x146')});db['ChatWebsite'][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x12b')});db['OpenchannelQueueReport'][_0x0a9e('0x142')](db[_0x0a9e('0x59')],{});db[_0x0a9e('0x62')][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c')});db['OpenchannelQueueReport'][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154')});db['OpenchannelQueueReport'][_0x0a9e('0x142')](db['OpenchannelInteraction'],{});db[_0x0a9e('0x62')][_0x0a9e('0x142')](db[_0x0a9e('0x5e')],{});db[_0x0a9e('0x62')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')]['belongsTo'](db[_0x0a9e('0x180')],{});db['ChatApplication'][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'as':'Agent','foreignKey':_0x0a9e('0x108'),'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x63')][_0x0a9e('0x142')](db['ChatQueue'],{'as':_0x0a9e('0x186'),'foreignKey':_0x0a9e('0x187'),'onDelete':'restrict'});db[_0x0a9e('0x63')]['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':_0x0a9e('0x167'),'onDelete':_0x0a9e('0x169')});db['ChatApplication'][_0x0a9e('0x142')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x16a')});db[_0x0a9e('0x64')][_0x0a9e('0x109')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x14c'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x188')});db['ChatInteraction'][_0x0a9e('0x142')](db['ChatWebsite'],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x167')});db[_0x0a9e('0x64')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':'ContactId'});db[_0x0a9e('0x64')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'as':'Owner','foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x64')][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x189'),'as':_0x0a9e('0x164')});db[_0x0a9e('0x64')][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x189'),'as':_0x0a9e('0x165')});db[_0x0a9e('0x64')][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x122'),'foreignKey':'ChatInteractionId'});db[_0x0a9e('0x65')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'onDelete':'cascade','as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x65')][_0x0a9e('0x142')](db['ChatInteraction'],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x166'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x65')]['belongsTo'](db['Attachment'],{'as':_0x0a9e('0xe1'),'foreignKey':_0x0a9e('0x176')});db[_0x0a9e('0x65')][_0x0a9e('0x142')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x167')});db[_0x0a9e('0x66')][_0x0a9e('0x109')](db[_0x0a9e('0xe1')],{'as':_0x0a9e('0x18a'),'foreignKey':_0x0a9e('0x168'),'onDelete':_0x0a9e('0x107'),'hooks':!![]});db[_0x0a9e('0x66')]['belongsTo'](db[_0x0a9e('0x11c')],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x153'),'foreignKey':'ContactId'});db['ChatOfflineMessage'][_0x0a9e('0x142')](db['ChatWebsite'],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x167')});db[_0x0a9e('0x67')][_0x0a9e('0x119')](db['User'],{'as':'Agents','through':_0x0a9e('0x126'),'hooks':!![]});db[_0x0a9e('0x67')][_0x0a9e('0x119')](db[_0x0a9e('0xdc')],{'through':'team_has_chat_queues','as':_0x0a9e('0x149')});db[_0x0a9e('0x68')][_0x0a9e('0x109')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x14c'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0x0a9e('0x68')][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x13c'),'through':_0x0a9e('0x11b')});db[_0x0a9e('0x185')][_0x0a9e('0x142')](db['ChatWebsite'],{'as':_0x0a9e('0x18b'),'foreignKey':_0x0a9e('0x167')});db[_0x0a9e('0x18c')]['hasMany'](db['CmContact'],{'as':'Contacts','foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x13d'),'foreignKey':_0x0a9e('0x154')});db['CmContact']['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x13e'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x140')],{'as':'HopperHistories','foreignKey':'ContactId'});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x154')});db['CmContact'][_0x0a9e('0x109')](db[_0x0a9e('0xcc')],{'as':_0x0a9e('0x18e'),'foreignKey':'ContactId'});db['CmContact'][_0x0a9e('0x109')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x154'),'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x11c')]['hasMany'](db['ChatInteraction'],{'as':_0x0a9e('0x10f'),'foreignKey':_0x0a9e('0x154'),'onDelete':'restrict'});db['CmContact']['hasMany'](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x169')});db['CmContact'][_0x0a9e('0x109')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x154'),'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x11c')][_0x0a9e('0x109')](db['MailInteraction'],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x154'),'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x11c')][_0x0a9e('0x142')](db[_0x0a9e('0x18c')],{'as':_0x0a9e('0x18f'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x11c')][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':'List','foreignKey':_0x0a9e('0x16c'),'onDelete':_0x0a9e('0x107')});db['CmContact'][_0x0a9e('0x119')](db['User'],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x11e')});db['CmContact']['belongsToMany'](db[_0x0a9e('0x86')],{'as':'Tags','through':_0x0a9e('0x190')});db[_0x0a9e('0x11c')][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x190'),'as':'ThroughTags'});db[_0x0a9e('0x6d')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x6d')][_0x0a9e('0x142')](db['CmList'],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x6d')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x191'),'foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x142')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x186'),'foreignKey':'VoiceQueueId','onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x6d')][_0x0a9e('0x142')](db[_0x0a9e('0xdf')],{'as':_0x0a9e('0xdf'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x6d')]['belongsTo'](db[_0x0a9e('0x11')],{'as':'Owner','foreignKey':_0x0a9e('0x192')});db[_0x0a9e('0x6f')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x6f')][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x6f')][_0x0a9e('0x142')](db['VoiceQueue'],{'as':_0x0a9e('0x186'),'foreignKey':_0x0a9e('0x13f'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x6f')][_0x0a9e('0x142')](db[_0x0a9e('0xdf')],{'as':_0x0a9e('0xdf'),'foreignKey':_0x0a9e('0x193'),'onDelete':'cascade'});db['Automation']['hasMany'](db['Condition'],{'as':{'plural':_0x0a9e('0x194'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')][_0x0a9e('0x109')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x195'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x107'),'hooks':!![]});db[_0x0a9e('0x76')][_0x0a9e('0x109')](db[_0x0a9e('0x74')],{'as':'Actions','foreignKey':_0x0a9e('0x196'),'onDelete':_0x0a9e('0x107'),'hooks':!![]});db[_0x0a9e('0x159')][_0x0a9e('0x109')](db[_0x0a9e('0x159')],{'as':_0x0a9e('0x15a'),'foreignKey':'ParentId','onDelete':_0x0a9e('0x107')});db['Interval']['hasMany'](db[_0x0a9e('0x144')],{'as':'Intervals','foreignKey':_0x0a9e('0x145'),'onDelete':_0x0a9e('0x107'),'hooks':!![],'required':![]});db[_0x0a9e('0x144')][_0x0a9e('0x109')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x197'),'foreignKey':_0x0a9e('0x145'),'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x144')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x198'),'foreignKey':'IntervalId'});db[_0x0a9e('0x144')][_0x0a9e('0x109')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x199'),'foreignKey':'IntervalId'});db[_0x0a9e('0x144')][_0x0a9e('0x109')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x19a'),'foreignKey':_0x0a9e('0x145')});db['Interval']['hasMany'](db[_0x0a9e('0x52')],{'as':'SmsApplications','foreignKey':_0x0a9e('0x145')});db['Schedule'][_0x0a9e('0x142')](db['MailAccount'],{});db[_0x0a9e('0x82')]['belongsTo'](db[_0x0a9e('0x90')],{'foreignKey':_0x0a9e('0x19b')});db[_0x0a9e('0x82')]['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x19c')});db['Sound'][_0x0a9e('0x119')](db['VoiceMusicOnHold'],{'as':_0x0a9e('0x19d'),'through':'moh_has_sounds','onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x11c')],{'through':_0x0a9e('0x190')});db[_0x0a9e('0x86')][_0x0a9e('0x119')](db[_0x0a9e('0x64')],{'through':_0x0a9e('0x189')});db[_0x0a9e('0x86')][_0x0a9e('0x119')](db[_0x0a9e('0x113')],{'through':'mail_interaction_has_tags'});db[_0x0a9e('0x86')][_0x0a9e('0x119')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x17a')});db[_0x0a9e('0x86')]['belongsToMany'](db['FaxInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x119')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x182')});db[_0x0a9e('0x86')][_0x0a9e('0x119')](db[_0x0a9e('0xf5')],{'through':_0x0a9e('0x19e')});db[_0x0a9e('0x19f')][_0x0a9e('0x109')](db['Condition'],{'as':{'plural':'AllConditions','singular':_0x0a9e('0x1a0')},'foreignKey':_0x0a9e('0x1a1'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x19f')][_0x0a9e('0x109')](db[_0x0a9e('0x7a')],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':_0x0a9e('0x107'),'hooks':!![]});db[_0x0a9e('0x19f')][_0x0a9e('0x109')](db[_0x0a9e('0x74')],{'as':'Actions','foreignKey':_0x0a9e('0x1a2'),'onDelete':_0x0a9e('0x107'),'hooks':!![]});db[_0x0a9e('0x8e')]['hasMany'](db[_0x0a9e('0x94')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x0a9e('0x19c'),'hooks':!![]});db[_0x0a9e('0x90')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x0a9e('0x1a3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x19b')});db['AnalyticMetric'][_0x0a9e('0x109')](db[_0x0a9e('0x94')],{'as':_0x0a9e('0x1a3'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0x0a9e('0x94')][_0x0a9e('0x142')](db[_0x0a9e('0x1a4')],{'foreignKey':_0x0a9e('0x1a5')});db['SalesforceAccount'][_0x0a9e('0x109')](db[_0x0a9e('0x99')],{'as':'Configurations','onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0x99')]['hasMany'](db[_0x0a9e('0x1a7')],{'as':_0x0a9e('0x1a8'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a9')});db[_0x0a9e('0x99')][_0x0a9e('0x109')](db[_0x0a9e('0x1a7')],{'as':_0x0a9e('0x1aa'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0x99')][_0x0a9e('0x109')](db[_0x0a9e('0x1a7')],{'as':_0x0a9e('0x1a3'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0x99')][_0x0a9e('0x142')](db[_0x0a9e('0x98')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0x1a7')]['hasMany'](db[_0x0a9e('0x1a7')],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x1a9')});db['SalesforceField'][_0x0a9e('0x109')](db[_0x0a9e('0x1a7')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x1ab')});db['SalesforceField'][_0x0a9e('0x109')](db[_0x0a9e('0x1a7')],{'as':'Field','foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0x1a7')][_0x0a9e('0x142')](db['Variable'],{'as':'Variable','foreignKey':_0x0a9e('0x1af')});db[_0x0a9e('0x9c')][_0x0a9e('0x109')](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0x9e')][_0x0a9e('0x109')](db['SugarcrmField'],{'as':_0x0a9e('0x1a8'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')][_0x0a9e('0x109')](db[_0x0a9e('0xa0')],{'as':'Descriptions','onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0x9e')]['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1a3'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ac')});db['SugarcrmConfiguration']['belongsTo'](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':'AccountId'});db['SugarcrmField'][_0x0a9e('0x109')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ad'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa0')][_0x0a9e('0x109')](db['SugarcrmField'],{'as':_0x0a9e('0x1ae'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xa0')][_0x0a9e('0x109')](db['SugarcrmField'],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0xa0')]['belongsTo'](db[_0x0a9e('0x1b1')],{'as':_0x0a9e('0x1b1'),'foreignKey':_0x0a9e('0x1af')});db['DeskAccount'][_0x0a9e('0x109')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1b2'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0xa2')][_0x0a9e('0x109')](db[_0x0a9e('0x1b3')],{'as':_0x0a9e('0x1a8'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a9')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1b3')],{'as':_0x0a9e('0x1aa'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ab')});db['DeskConfiguration'][_0x0a9e('0x109')](db[_0x0a9e('0x1b3')],{'as':'Fields','onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0xa2')][_0x0a9e('0x142')](db[_0x0a9e('0xa1')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0xa2')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db[_0x0a9e('0x1b3')][_0x0a9e('0x109')](db['DeskField'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x1a9')});db['DeskField'][_0x0a9e('0x109')](db[_0x0a9e('0x1b3')],{'as':'Description','foreignKey':_0x0a9e('0x1ab')});db['DeskField']['hasMany'](db['DeskField'],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x1ac')});db['DeskField'][_0x0a9e('0x142')](db[_0x0a9e('0x1b1')],{'as':'Variable','foreignKey':_0x0a9e('0x1af')});db[_0x0a9e('0x1b4')]['hasMany'](db[_0x0a9e('0xa6')],{'as':_0x0a9e('0x1b2'),'onDelete':_0x0a9e('0x107'),'foreignKey':'AccountId'});db[_0x0a9e('0xa6')][_0x0a9e('0x109')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1a8'),'onDelete':_0x0a9e('0x107'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1aa'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0xa6')][_0x0a9e('0x109')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1a3'),'onDelete':_0x0a9e('0x107'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x142')](db[_0x0a9e('0x1b4')],{'as':'Account','foreignKey':'AccountId'});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0x0a9e('0x1ad'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x109')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0xa8')]['hasMany'](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':'FieldId'});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x1b1')],{'as':'Variable','foreignKey':_0x0a9e('0x1af')});db[_0x0a9e('0xaa')][_0x0a9e('0x109')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1b2'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0xac')]['hasMany'](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1a8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xac')][_0x0a9e('0x109')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1aa'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0xac')][_0x0a9e('0x109')](db['ZendeskField'],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0xac')][_0x0a9e('0x142')](db['ZendeskAccount'],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0xac')][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0xae')][_0x0a9e('0x109')](db['ZendeskField'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x1a9')});db[_0x0a9e('0xae')]['hasMany'](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0xae')][_0x0a9e('0x109')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0xae')][_0x0a9e('0x142')](db['Variable'],{'as':_0x0a9e('0x1b1'),'foreignKey':_0x0a9e('0x1af')});db[_0x0a9e('0xaf')]['hasMany'](db['FreshdeskConfiguration'],{'as':_0x0a9e('0x1b2'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0x1b6')][_0x0a9e('0x109')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1a8'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a9')});db['FreshdeskConfiguration'][_0x0a9e('0x109')](db[_0x0a9e('0xb2')],{'as':'Descriptions','onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ab')});db['FreshdeskConfiguration']['hasMany'](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1a3'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0xaf')],{'as':'Account','foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x0a9e('0x119')](db['Tag'],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0x0a9e('0x109')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x1a9')});db['FreshdeskField'][_0x0a9e('0x109')](db['FreshdeskField'],{'as':'Description','foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0xb2')][_0x0a9e('0x109')](db['FreshdeskField'],{'as':'Field','foreignKey':'FieldId'});db[_0x0a9e('0xb2')][_0x0a9e('0x142')](db[_0x0a9e('0x1b1')],{'as':_0x0a9e('0x1b1'),'foreignKey':_0x0a9e('0x1af')});db['VtigerAccount'][_0x0a9e('0x109')](db[_0x0a9e('0x1b7')],{'as':_0x0a9e('0x1b2'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0x1b7')]['hasMany'](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1a8'),'foreignKey':_0x0a9e('0x1a9')});db[_0x0a9e('0x1b7')][_0x0a9e('0x109')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1aa'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0x1b7')][_0x0a9e('0x109')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0x1b7')][_0x0a9e('0x142')](db[_0x0a9e('0x1b8')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x1a6')});db['VtigerField'][_0x0a9e('0x109')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':'SubjectId'});db['VtigerField'][_0x0a9e('0x109')](db[_0x0a9e('0xb5')],{'as':'Description','foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0xb5')]['hasMany'](db[_0x0a9e('0xb5')],{'as':'Field','foreignKey':_0x0a9e('0x1ac')});db['VtigerField'][_0x0a9e('0x142')](db[_0x0a9e('0x1b1')],{'as':_0x0a9e('0x1b1'),'foreignKey':_0x0a9e('0x1af')});db['ServicenowAccount'][_0x0a9e('0x109')](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1b2'),'onDelete':'cascade','foreignKey':'AccountId'});db['ServicenowConfiguration']['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1a8'),'foreignKey':_0x0a9e('0x1a9')});db[_0x0a9e('0xb8')][_0x0a9e('0x109')](db['ServicenowField'],{'as':_0x0a9e('0x1aa'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0xb8')][_0x0a9e('0x109')](db['ServicenowField'],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0xb8')][_0x0a9e('0x142')](db[_0x0a9e('0x1b9')],{'as':'Account','foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0xb9')][_0x0a9e('0x109')](db['ServicenowField'],{'as':_0x0a9e('0x1ad'),'foreignKey':'SubjectId'});db[_0x0a9e('0xb9')][_0x0a9e('0x109')](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x1ab')});db['ServicenowField'][_0x0a9e('0x109')](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0xb9')]['belongsTo'](db[_0x0a9e('0x1b1')],{'as':_0x0a9e('0x1b1'),'foreignKey':_0x0a9e('0x1af')});db['Dynamics365Account'][_0x0a9e('0x109')](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0x0a9e('0x107'),'foreignKey':'AccountId'});db[_0x0a9e('0xbc')][_0x0a9e('0x109')](db[_0x0a9e('0x1ba')],{'as':'Subjects','onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a9')});db[_0x0a9e('0xbc')][_0x0a9e('0x109')](db[_0x0a9e('0x1ba')],{'as':_0x0a9e('0x1aa'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ab')});db['Dynamics365Configuration'][_0x0a9e('0x109')](db[_0x0a9e('0x1ba')],{'as':_0x0a9e('0x1a3'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ac')});db['Dynamics365Configuration']['belongsTo'](db[_0x0a9e('0xba')],{'as':'Account','foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0x1ba')]['hasMany'](db[_0x0a9e('0x1ba')],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x1a9')});db['Dynamics365Field'][_0x0a9e('0x109')](db[_0x0a9e('0x1ba')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0x1ba')][_0x0a9e('0x109')](db[_0x0a9e('0x1ba')],{'as':_0x0a9e('0x1b0'),'foreignKey':'FieldId'});db[_0x0a9e('0x1ba')][_0x0a9e('0x142')](db[_0x0a9e('0x1b1')],{'as':_0x0a9e('0x1b1'),'foreignKey':_0x0a9e('0x1af')});db['FreshsalesAccount'][_0x0a9e('0x109')](db['FreshsalesConfiguration'],{'as':_0x0a9e('0x1b2'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a6')});db['FreshsalesConfiguration'][_0x0a9e('0x109')](db['FreshsalesField'],{'as':_0x0a9e('0x1a8'),'foreignKey':_0x0a9e('0x1a9')});db[_0x0a9e('0xbf')][_0x0a9e('0x109')](db['FreshsalesField'],{'as':_0x0a9e('0x1aa'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xbf')][_0x0a9e('0x109')](db['FreshsalesField'],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0xbf')]['belongsTo'](db[_0x0a9e('0xbe')],{'as':'Account','foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0xc1')]['hasMany'](db['FreshsalesField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xc1')][_0x0a9e('0x109')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ae'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc1')]['hasMany'](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1b0'),'foreignKey':'FieldId'});db[_0x0a9e('0xc1')][_0x0a9e('0x142')](db[_0x0a9e('0x1b1')],{'as':_0x0a9e('0x1b1'),'foreignKey':_0x0a9e('0x1af')});db[_0x0a9e('0xc5')][_0x0a9e('0x142')](db['ChatWebsite'],{});db[_0x0a9e('0xc5')][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c')});db[_0x0a9e('0xc5')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0x64')],{});db[_0x0a9e('0xc5')][_0x0a9e('0x142')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xc5')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x142')](db[_0x0a9e('0x67')],{});db[_0x0a9e('0xc7')]['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1bb')});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1bc')});db[_0x0a9e('0xcc')][_0x0a9e('0x109')](db['JscriptyQuestionReport'],{'foreignKey':_0x0a9e('0x1bd'),'onDelete':'cascade'});db[_0x0a9e('0xcc')][_0x0a9e('0x109')](db['JscriptyAnswerReport'],{'foreignKey':_0x0a9e('0x1bd'),'onDelete':'cascade'});db[_0x0a9e('0xcd')][_0x0a9e('0x142')](db['SmsAccount'],{});db[_0x0a9e('0xcd')][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':'List','foreignKey':_0x0a9e('0x16c')});db[_0x0a9e('0xcd')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154')});db['SmsQueueReport'][_0x0a9e('0x142')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xcd')][_0x0a9e('0x142')](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xcd')]['belongsTo'](db['SmsQueue'],{});db[_0x0a9e('0xd2')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0x0a9e('0x1be')});db[_0x0a9e('0xd2')]['hasMany'](db[_0x0a9e('0xca')],{'foreignKey':_0x0a9e('0x1be')});db[_0x0a9e('0xd2')][_0x0a9e('0x109')](db[_0x0a9e('0x1bf')],{'foreignKey':'ProjectId'});db[_0x0a9e('0x134')][_0x0a9e('0x119')](db['User'],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x136')});db[_0x0a9e('0xdc')][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x1c0')});db[_0x0a9e('0xdc')]['belongsToMany'](db['VoiceQueue'],{'through':_0x0a9e('0x1c1'),'as':_0x0a9e('0x1c2')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x160'),'as':_0x0a9e('0x125')});db[_0x0a9e('0xdc')][_0x0a9e('0x119')](db['ChatQueue'],{'through':_0x0a9e('0x1c3'),'as':'ChatQueues'});db['Team'][_0x0a9e('0x119')](db['FaxQueue'],{'through':_0x0a9e('0x177'),'as':'FaxQueues'});db[_0x0a9e('0xdc')]['belongsToMany'](db['SmsQueue'],{'through':_0x0a9e('0x17d'),'as':_0x0a9e('0x128')});db[_0x0a9e('0xdc')]['belongsToMany'](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':_0x0a9e('0x129')});db[_0x0a9e('0xdc')]['belongsToMany'](db[_0x0a9e('0xfd')],{'through':'team_has_whatsapp_queues','as':_0x0a9e('0x1c4')});db['Team'][_0x0a9e('0x119')](db[_0x0a9e('0xec')],{'through':'TeamVoicePrefix','as':'VoicePrefixes'});db['Campaign'][_0x0a9e('0x109')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x13d'),'foreignKey':_0x0a9e('0x193')});db[_0x0a9e('0xdf')][_0x0a9e('0x109')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x13e'),'foreignKey':_0x0a9e('0x193')});db[_0x0a9e('0xdf')][_0x0a9e('0x109')](db[_0x0a9e('0x140')],{'as':_0x0a9e('0x1c5'),'foreignKey':_0x0a9e('0x193')});db[_0x0a9e('0xdf')]['hasMany'](db['CmHopperBlack'],{'as':_0x0a9e('0x1c6'),'foreignKey':_0x0a9e('0x193')});db[_0x0a9e('0xdf')][_0x0a9e('0x142')](db['Trunk'],{'as':_0x0a9e('0x28'),'foreignKey':'TrunkId'});db[_0x0a9e('0xdf')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x0a9e('0xdf')][_0x0a9e('0x142')](db[_0x0a9e('0x144')],{'as':_0x0a9e('0x144'),'foreignKey':'IntervalId'});db['Campaign'][_0x0a9e('0x142')](db['SquareProject'],{'as':_0x0a9e('0x134'),'foreignKey':_0x0a9e('0x1c7')});db['Campaign'][_0x0a9e('0x119')](db['CmList'],{'as':_0x0a9e('0x11f'),'through':_0x0a9e('0x1c8')});db[_0x0a9e('0xdf')][_0x0a9e('0x119')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x1c9')});db[_0x0a9e('0xe1')][_0x0a9e('0x142')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x168')});db[_0x0a9e('0xe2')][_0x0a9e('0x142')](db[_0x0a9e('0x3e')],{});db[_0x0a9e('0xe2')]['belongsTo'](db[_0x0a9e('0x113')],{});db[_0x0a9e('0xe2')][_0x0a9e('0x142')](db['MailAccount'],{'foreignKey':_0x0a9e('0x1ca'),'as':_0x0a9e('0x1cb')});db[_0x0a9e('0xe2')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1cc'),'as':_0x0a9e('0x1cd')});db[_0x0a9e('0xe2')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ce'),'as':'ToAgent'});db[_0x0a9e('0xe2')][_0x0a9e('0x142')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':_0x0a9e('0x1cf')});db['MailTransferReport']['belongsTo'](db[_0x0a9e('0x3b')],{'foreignKey':'ToMailAccountId','as':_0x0a9e('0x1d0')});db['ChatTransferReport'][_0x0a9e('0x142')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe4')]['belongsTo'](db[_0x0a9e('0x64')],{});db['ChatTransferReport']['belongsTo'](db[_0x0a9e('0x60')],{'foreignKey':_0x0a9e('0x1d1'),'as':_0x0a9e('0x1cb')});db[_0x0a9e('0xe4')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1cd')});db[_0x0a9e('0xe4')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ce'),'as':'ToAgent'});db[_0x0a9e('0xe4')][_0x0a9e('0x142')](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1d2'),'as':_0x0a9e('0x1cf')});db[_0x0a9e('0xe4')][_0x0a9e('0x142')](db[_0x0a9e('0x60')],{'foreignKey':_0x0a9e('0x1d3'),'as':_0x0a9e('0x1d0')});db[_0x0a9e('0xe6')][_0x0a9e('0x142')](db[_0x0a9e('0x4a')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x111')],{});db[_0x0a9e('0xe6')]['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1d4'),'as':_0x0a9e('0x1cb')});db[_0x0a9e('0xe6')][_0x0a9e('0x142')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x0a9e('0xe6')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ce'),'as':_0x0a9e('0x1d5')});db[_0x0a9e('0xe6')][_0x0a9e('0x142')](db[_0x0a9e('0x4c')],{'foreignKey':_0x0a9e('0x1d6'),'as':'ToQueue'});db['FaxTransferReport'][_0x0a9e('0x142')](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1d7'),'as':_0x0a9e('0x1d0')});db[_0x0a9e('0x1d8')][_0x0a9e('0x142')](db[_0x0a9e('0x5e')],{});db[_0x0a9e('0x1d8')][_0x0a9e('0x142')](db[_0x0a9e('0x5d')],{});db['OpenchannelTransferReport'][_0x0a9e('0x142')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1cb')});db[_0x0a9e('0x1d8')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1cc'),'as':_0x0a9e('0x1cd')});db[_0x0a9e('0x1d8')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1d5')});db[_0x0a9e('0x1d8')][_0x0a9e('0x142')](db['OpenchannelQueue'],{'foreignKey':_0x0a9e('0x1d9'),'as':_0x0a9e('0x1cf')});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':_0x0a9e('0x1d0')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x55')],{});db['SmsTransferReport'][_0x0a9e('0x142')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xe8')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x0a9e('0x1da'),'as':_0x0a9e('0x1cb')});db[_0x0a9e('0xe8')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1cc'),'as':_0x0a9e('0x1cd')});db[_0x0a9e('0xe8')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ce'),'as':'ToAgent'});db[_0x0a9e('0xe8')][_0x0a9e('0x142')](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1cf')});db[_0x0a9e('0xe8')][_0x0a9e('0x142')](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1db'),'as':'ToAccount'});db[_0x0a9e('0xea')][_0x0a9e('0x109')](db['Disposition'],{'as':_0x0a9e('0x15a'),'foreignKey':'ListId','onDelete':'cascade'});db['CmList'][_0x0a9e('0x109')](db[_0x0a9e('0x1dc')],{'as':'CustomFields','foreignKey':'ListId'});db[_0x0a9e('0xea')][_0x0a9e('0x109')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16c')});db[_0x0a9e('0xea')][_0x0a9e('0x109')](db['CmHopperFinal'],{'as':_0x0a9e('0x13e'),'foreignKey':_0x0a9e('0x16c')});db[_0x0a9e('0xea')][_0x0a9e('0x109')](db[_0x0a9e('0x140')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0x0a9e('0xea')][_0x0a9e('0x109')](db[_0x0a9e('0x73')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db['CmList']['belongsToMany'](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x1dd'),'through':_0x0a9e('0x147')});db[_0x0a9e('0xea')][_0x0a9e('0x119')](db['User'],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x120')});db[_0x0a9e('0xec')][_0x0a9e('0x109')](db[_0x0a9e('0x16')],{'as':'Extensions','onDelete':_0x0a9e('0x107')});db[_0x0a9e('0xec')][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':'UserVoicePrefix'});db[_0x0a9e('0xec')][_0x0a9e('0x119')](db['Team'],{'through':'TeamVoicePrefix','as':'Teams'});db[_0x0a9e('0xee')][_0x0a9e('0x109')](db['User'],{'as':_0x0a9e('0x174'),'foreignKey':'userProfileId'});db['UserProfile']['hasMany'](db['UserProfileSection'],{'as':_0x0a9e('0x1de'),'foreignKey':_0x0a9e('0x118'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x1df')][_0x0a9e('0x109')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x1e0'),'foreignKey':_0x0a9e('0x1e1'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0xf3')][_0x0a9e('0x109')](db['Disposition'],{'as':_0x0a9e('0x15a'),'foreignKey':'WhatsappAccountId','onDelete':_0x0a9e('0x107')});db[_0x0a9e('0xf3')][_0x0a9e('0x109')](db[_0x0a9e('0x15b')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x1e2')});db[_0x0a9e('0xf3')][_0x0a9e('0x109')](db[_0x0a9e('0xf7')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0x0a9e('0x109')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x15d')});db['WhatsappAccount'][_0x0a9e('0x109')](db[_0x0a9e('0xf4')],{'as':_0x0a9e('0x139')});db['WhatsappAccount'][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c')});db['WhatsappAccount'][_0x0a9e('0x142')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x17f'),'foreignKey':_0x0a9e('0x146')});db[_0x0a9e('0xf3')][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x133')});db[_0x0a9e('0xf4')]['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0xf4')]['belongsTo'](db[_0x0a9e('0xfd')],{'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0xf4')][_0x0a9e('0x142')](db[_0x0a9e('0xf3')],{'onDelete':_0x0a9e('0x169')});db['WhatsappApplication'][_0x0a9e('0x142')](db['Interval'],{'onDelete':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0xf4')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x16a')});db[_0x0a9e('0xf5')][_0x0a9e('0x109')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x14c'),'onDelete':_0x0a9e('0x107'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xf5')][_0x0a9e('0x142')](db[_0x0a9e('0xf3')],{'as':_0x0a9e('0x162'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf5')][_0x0a9e('0x142')](db['CmContact'],{'as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf5')]['belongsTo'](db[_0x0a9e('0x11')],{'as':'Owner','foreignKey':_0x0a9e('0x108')});db['WhatsappInteraction'][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':'whatsapp_interaction_has_tags','as':_0x0a9e('0x164')});db[_0x0a9e('0xf5')][_0x0a9e('0x119')](db['Tag'],{'through':_0x0a9e('0x19e'),'as':'ThroughTags'});db[_0x0a9e('0xf5')][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x124'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xf7')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xf7')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x153')});db[_0x0a9e('0xf7')][_0x0a9e('0x142')](db[_0x0a9e('0xf5')],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x166'),'foreignKey':_0x0a9e('0x1e3')});db[_0x0a9e('0xf7')]['belongsTo'](db[_0x0a9e('0xf3')],{'as':'Account','foreignKey':_0x0a9e('0x1e2')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0xf3')],{});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c')});db['WhatsappQueueReport'][_0x0a9e('0x142')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x0a9e('0xf9')][_0x0a9e('0x142')](db[_0x0a9e('0xf5')],{});db[_0x0a9e('0xf9')][_0x0a9e('0x142')](db[_0x0a9e('0xfd')],{});db[_0x0a9e('0xf9')][_0x0a9e('0x142')](db[_0x0a9e('0xf7')],{});db[_0x0a9e('0xf9')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xfb')][_0x0a9e('0x142')](db[_0x0a9e('0xf7')],{});db[_0x0a9e('0xfb')][_0x0a9e('0x142')](db[_0x0a9e('0xf5')],{});db[_0x0a9e('0xfb')][_0x0a9e('0x142')](db[_0x0a9e('0xf3')],{'foreignKey':'FromWhatsappAccountId','as':_0x0a9e('0x1cb')});db['WhatsappTransferReport'][_0x0a9e('0x142')](db[_0x0a9e('0xf3')],{'foreignKey':_0x0a9e('0x1e4'),'as':'ToAccount'});db[_0x0a9e('0xfb')][_0x0a9e('0x142')](db[_0x0a9e('0xfd')],{'foreignKey':'ToQueueId','as':_0x0a9e('0x1cf')});db[_0x0a9e('0xfb')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1cc'),'as':_0x0a9e('0x1cd')});db[_0x0a9e('0xfb')]['belongsTo'](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ce'),'as':_0x0a9e('0x1d5')});db['WhatsappQueue']['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0xfd')][_0x0a9e('0x119')](db[_0x0a9e('0xdc')],{'through':_0x0a9e('0x1e5'),'as':_0x0a9e('0x149')});module[_0x0a9e('0x1e6')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 03ec90b..adc2697 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1fa=['/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/teams','./api/team','/api/license','./api/license','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/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/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/jira','./api/rpc','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','/index.html','username','password','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','code','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerSecret','membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','dsn','secret','registry','oldPassword','isPlainObject','length','isString','replace','}@@','includes','lodash','path','express','express-winston','util','./errors','./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','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','format','connection','other','agent_name','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/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/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./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/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/cmCompany','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/canned_answers','./api/disposition','/api/intervals','./api/interval','./api/pause','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/sounds','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./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/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount'];(function(_0x14490c,_0x50e8ab){var _0x2f6825=function(_0x477b03){while(--_0x477b03){_0x14490c['push'](_0x14490c['shift']());}};_0x2f6825(++_0x50e8ab);}(_0xc1fa,0x83));var _0xac1f=function(_0x44454f,_0x4bfbe8){_0x44454f=_0x44454f-0x0;var _0x475150=_0xc1fa[_0x44454f];return _0x475150;};'use strict';var _=require(_0xac1f('0x0'));var path=require(_0xac1f('0x1'));var express=require(_0xac1f('0x2'));var ewinston=require(_0xac1f('0x3'));var util=require(_0xac1f('0x4'));var errors=require(_0xac1f('0x5'));var config=require('./config/environment');var logger=require(_0xac1f('0x6'))(_0xac1f('0x7'));var authLogger=require(_0xac1f('0x6'))(_0xac1f('0x8'));var safeTemplate=require(_0xac1f('0x9'))[_0xac1f('0xa')];exports[_0xac1f('0xb')]=function(_0x406495){_0x406495[_0xac1f('0xc')](ewinston[_0xac1f('0xd')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x33d385,_0x384cd2){var _0x49c4c0=_0xac1f('0xe');if(!_[_0xac1f('0xf')](_0x33d385[_0xac1f('0x10')])){_0x49c4c0+=_0xac1f('0x11');var _0x221222=_0x33d385['body'];maskSensitiveData(_0x221222);}return safeTemplate(util['format'](_0x49c4c0,_0x33d385[_0xac1f('0x12')],_0x33d385['headers']['x-forwarded-for']?_0x33d385[_0xac1f('0x13')][_0xac1f('0x14')]:_0x33d385['connection'][_0xac1f('0x15')]||_0x33d385['ip'],_0x33d385[_0xac1f('0x16')],_0x384cd2[_0xac1f('0x17')],_0x384cd2[_0xac1f('0x18')],_0x33d385[_0xac1f('0x19')]?_0x33d385[_0xac1f('0x19')]['id']:null,_0x33d385[_0xac1f('0x19')]?_0x33d385[_0xac1f('0x19')][_0xac1f('0x1a')]:null,_0x33d385[_0xac1f('0x19')]?_0x33d385[_0xac1f('0x19')][_0xac1f('0x1b')]:null,_0x221222?util[_0xac1f('0x1c')](_0x221222,![],null):''));}}));_0x406495['use'](ewinston[_0xac1f('0xd')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x1c7610,_0x6f5a10){var _0x494f0c=_0xac1f('0x1d');if(_0x1c7610['body']&&_0x1c7610[_0xac1f('0x10')][_0xac1f('0x1e')]&&_0x1c7610[_0xac1f('0x10')][_0xac1f('0x1f')]){_0x494f0c='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xac1f('0x20')](_0x494f0c,_0x1c7610[_0xac1f('0x12')],_0x1c7610['headers'][_0xac1f('0x14')]?_0x1c7610['headers'][_0xac1f('0x14')]:_0x1c7610[_0xac1f('0x21')][_0xac1f('0x15')]||_0x1c7610['ip'],_0x1c7610[_0xac1f('0x16')],_0x6f5a10[_0xac1f('0x17')],_0x6f5a10[_0xac1f('0x18')],_0x1c7610[_0xac1f('0x19')]?_0x1c7610[_0xac1f('0x19')]['id']:null,_0x1c7610['user']?_0x1c7610['user'][_0xac1f('0x1a')]:null,_0x1c7610[_0xac1f('0x19')]?_0x1c7610[_0xac1f('0x19')][_0xac1f('0x1b')]:null,_0x1c7610[_0xac1f('0x10')]&&_0x1c7610[_0xac1f('0x10')][_0xac1f('0x1e')]?_0x1c7610['body'][_0xac1f('0x1e')]:_0xac1f('0x22'),_0x1c7610[_0xac1f('0x10')]&&_0x1c7610['body']['agent_id']?_0x1c7610[_0xac1f('0x10')][_0xac1f('0x1f')]:'',_0x1c7610[_0xac1f('0x10')]&&_0x1c7610[_0xac1f('0x10')][_0xac1f('0x23')]?_0x1c7610[_0xac1f('0x10')][_0xac1f('0x23')]:'');},'ignoreRoute':function(_0x2c18bb){var _0x22b33a=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x22b33a['test'](_0x2c18bb[_0xac1f('0x16')]);}}));_0x406495[_0xac1f('0xc')](_0xac1f('0x24'),require('./api/user'));_0x406495['use'](_0xac1f('0x25'),require(_0xac1f('0x26')));_0x406495[_0xac1f('0xc')]('/api/voice/contexts',require('./api/voiceContext'));_0x406495[_0xac1f('0xc')](_0xac1f('0x27'),require(_0xac1f('0x28')));_0x406495[_0xac1f('0xc')](_0xac1f('0x29'),require(_0xac1f('0x2a')));_0x406495[_0xac1f('0xc')](_0xac1f('0x2b'),require(_0xac1f('0x2c')));_0x406495[_0xac1f('0xc')](_0xac1f('0x2d'),require(_0xac1f('0x2e')));_0x406495[_0xac1f('0xc')](_0xac1f('0x2f'),require(_0xac1f('0x30')));_0x406495[_0xac1f('0xc')](_0xac1f('0x31'),require('./api/voiceMail'));_0x406495[_0xac1f('0xc')](_0xac1f('0x32'),require(_0xac1f('0x33')));_0x406495['use'](_0xac1f('0x34'),require(_0xac1f('0x35')));_0x406495[_0xac1f('0xc')](_0xac1f('0x36'),require(_0xac1f('0x37')));_0x406495['use'](_0xac1f('0x38'),require(_0xac1f('0x39')));_0x406495[_0xac1f('0xc')](_0xac1f('0x3a'),require(_0xac1f('0x3b')));_0x406495[_0xac1f('0xc')](_0xac1f('0x3c'),require(_0xac1f('0x3d')));_0x406495[_0xac1f('0xc')](_0xac1f('0x3e'),require(_0xac1f('0x3f')));_0x406495[_0xac1f('0xc')](_0xac1f('0x40'),require(_0xac1f('0x41')));_0x406495[_0xac1f('0xc')](_0xac1f('0x42'),require('./api/mailServerOut'));_0x406495['use'](_0xac1f('0x43'),require(_0xac1f('0x44')));_0x406495[_0xac1f('0xc')]('/api/mail/queues',require(_0xac1f('0x45')));_0x406495[_0xac1f('0xc')](_0xac1f('0x46'),require(_0xac1f('0x47')));_0x406495[_0xac1f('0xc')](_0xac1f('0x48'),require('./api/mailInteraction'));_0x406495['use']('/api/mail/messages',require('./api/mailMessage'));_0x406495['use']('/api/mail/applications',require(_0xac1f('0x49')));_0x406495[_0xac1f('0xc')](_0xac1f('0x4a'),require(_0xac1f('0x4b')));_0x406495[_0xac1f('0xc')]('/api/dashboards',require(_0xac1f('0x4c')));_0x406495[_0xac1f('0xc')](_0xac1f('0x4d'),require('./api/dashboardItem'));_0x406495['use']('/api/fax/accounts',require(_0xac1f('0x4e')));_0x406495[_0xac1f('0xc')](_0xac1f('0x4f'),require(_0xac1f('0x50')));_0x406495[_0xac1f('0xc')](_0xac1f('0x51'),require(_0xac1f('0x52')));_0x406495['use']('/api/fax/messages',require(_0xac1f('0x53')));_0x406495['use']('/api/fax/queues',require('./api/faxQueue'));_0x406495[_0xac1f('0xc')](_0xac1f('0x54'),require(_0xac1f('0x55')));_0x406495[_0xac1f('0xc')](_0xac1f('0x56'),require(_0xac1f('0x57')));_0x406495[_0xac1f('0xc')](_0xac1f('0x58'),require(_0xac1f('0x59')));_0x406495[_0xac1f('0xc')]('/api/sms/interactions',require(_0xac1f('0x5a')));_0x406495['use'](_0xac1f('0x5b'),require(_0xac1f('0x5c')));_0x406495[_0xac1f('0xc')](_0xac1f('0x5d'),require(_0xac1f('0x5e')));_0x406495['use'](_0xac1f('0x5f'),require(_0xac1f('0x60')));_0x406495['use'](_0xac1f('0x61'),require(_0xac1f('0x62')));_0x406495[_0xac1f('0xc')]('/api/openchannel/interactions',require(_0xac1f('0x63')));_0x406495[_0xac1f('0xc')](_0xac1f('0x64'),require(_0xac1f('0x65')));_0x406495[_0xac1f('0xc')](_0xac1f('0x66'),require(_0xac1f('0x67')));_0x406495[_0xac1f('0xc')]('/api/chat/websites',require('./api/chatWebsite'));_0x406495[_0xac1f('0xc')](_0xac1f('0x68'),require(_0xac1f('0x69')));_0x406495[_0xac1f('0xc')]('/api/chat/applications',require(_0xac1f('0x6a')));_0x406495[_0xac1f('0xc')](_0xac1f('0x6b'),require(_0xac1f('0x6c')));_0x406495[_0xac1f('0xc')](_0xac1f('0x6d'),require('./api/chatMessage'));_0x406495[_0xac1f('0xc')](_0xac1f('0x6e'),require(_0xac1f('0x6f')));_0x406495[_0xac1f('0xc')](_0xac1f('0x70'),require('./api/chatQueue'));_0x406495[_0xac1f('0xc')](_0xac1f('0x71'),require(_0xac1f('0x72')));_0x406495[_0xac1f('0xc')](_0xac1f('0x73'),require('./api/chatProactiveAction'));_0x406495['use']('/api/cm/companies',require(_0xac1f('0x74')));_0x406495[_0xac1f('0xc')]('/api/cm/contacts',require(_0xac1f('0x75')));_0x406495['use'](_0xac1f('0x76'),require('./api/cmHopper'));_0x406495[_0xac1f('0xc')](_0xac1f('0x77'),require(_0xac1f('0x78')));_0x406495[_0xac1f('0xc')]('/api/cm/hopper_final',require(_0xac1f('0x79')));_0x406495[_0xac1f('0xc')]('/api/cm/hopper_history',require(_0xac1f('0x7a')));_0x406495[_0xac1f('0xc')](_0xac1f('0x7b'),require(_0xac1f('0x7c')));_0x406495[_0xac1f('0xc')](_0xac1f('0x7d'),require(_0xac1f('0x7e')));_0x406495[_0xac1f('0xc')]('/api/automations',require('./api/automation'));_0x406495[_0xac1f('0xc')](_0xac1f('0x7f'),require('./api/cannedAnswer'));_0x406495['use']('/api/dispositions',require(_0xac1f('0x80')));_0x406495[_0xac1f('0xc')]('/api/conditions',require('./api/condition'));_0x406495[_0xac1f('0xc')](_0xac1f('0x81'),require(_0xac1f('0x82')));_0x406495[_0xac1f('0xc')]('/api/pauses',require(_0xac1f('0x83')));_0x406495[_0xac1f('0xc')]('/api/cdr',require('./api/cdr'));_0x406495['use'](_0xac1f('0x84'),require(_0xac1f('0x85')));_0x406495[_0xac1f('0xc')]('/api/schedules',require('./api/schedule'));_0x406495[_0xac1f('0xc')](_0xac1f('0x86'),require(_0xac1f('0x87')));_0x406495[_0xac1f('0xc')]('/api/tags',require(_0xac1f('0x88')));_0x406495['use'](_0xac1f('0x89'),require(_0xac1f('0x8a')));_0x406495[_0xac1f('0xc')](_0xac1f('0x8b'),require(_0xac1f('0x8c')));_0x406495[_0xac1f('0xc')](_0xac1f('0x8d'),require('./api/variable'));_0x406495['use'](_0xac1f('0x8e'),require('./api/integration'));_0x406495[_0xac1f('0xc')](_0xac1f('0x8f'),require(_0xac1f('0x90')));_0x406495[_0xac1f('0xc')](_0xac1f('0x91'),require(_0xac1f('0x92')));_0x406495[_0xac1f('0xc')](_0xac1f('0x93'),require(_0xac1f('0x94')));_0x406495[_0xac1f('0xc')](_0xac1f('0x95'),require(_0xac1f('0x96')));_0x406495['use'](_0xac1f('0x97'),require(_0xac1f('0x98')));_0x406495['use'](_0xac1f('0x99'),require(_0xac1f('0x9a')));_0x406495[_0xac1f('0xc')](_0xac1f('0x9b'),require(_0xac1f('0x9c')));_0x406495[_0xac1f('0xc')](_0xac1f('0x9d'),require('./api/intSalesforceAccount'));_0x406495['use'](_0xac1f('0x9e'),require(_0xac1f('0x9f')));_0x406495[_0xac1f('0xc')]('/api/integrations/salesforce/fields',require(_0xac1f('0xa0')));_0x406495[_0xac1f('0xc')](_0xac1f('0xa1'),require(_0xac1f('0xa2')));_0x406495[_0xac1f('0xc')](_0xac1f('0xa3'),require(_0xac1f('0xa4')));_0x406495['use'](_0xac1f('0xa5'),require(_0xac1f('0xa6')));_0x406495[_0xac1f('0xc')](_0xac1f('0xa7'),require(_0xac1f('0xa8')));_0x406495[_0xac1f('0xc')](_0xac1f('0xa9'),require(_0xac1f('0xaa')));_0x406495[_0xac1f('0xc')](_0xac1f('0xab'),require('./api/intDeskField'));_0x406495['use'](_0xac1f('0xac'),require(_0xac1f('0xad')));_0x406495[_0xac1f('0xc')](_0xac1f('0xae'),require(_0xac1f('0xaf')));_0x406495[_0xac1f('0xc')]('/api/integrations/zoho/fields',require(_0xac1f('0xb0')));_0x406495['use'](_0xac1f('0xb1'),require(_0xac1f('0xb2')));_0x406495[_0xac1f('0xc')](_0xac1f('0xb3'),require(_0xac1f('0xb4')));_0x406495['use'](_0xac1f('0xb5'),require('./api/intZendeskField'));_0x406495[_0xac1f('0xc')](_0xac1f('0xb6'),require(_0xac1f('0xb7')));_0x406495[_0xac1f('0xc')]('/api/integrations/freshdesk/configurations',require(_0xac1f('0xb8')));_0x406495['use']('/api/integrations/freshdesk/fields',require(_0xac1f('0xb9')));_0x406495['use']('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x406495[_0xac1f('0xc')](_0xac1f('0xba'),require(_0xac1f('0xbb')));_0x406495[_0xac1f('0xc')](_0xac1f('0xbc'),require(_0xac1f('0xbd')));_0x406495[_0xac1f('0xc')]('/api/integrations/servicenow/accounts',require(_0xac1f('0xbe')));_0x406495[_0xac1f('0xc')](_0xac1f('0xbf'),require('./api/intServicenowConfiguration'));_0x406495[_0xac1f('0xc')](_0xac1f('0xc0'),require(_0xac1f('0xc1')));_0x406495['use']('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x406495[_0xac1f('0xc')](_0xac1f('0xc2'),require('./api/intDynamics365Configuration'));_0x406495['use'](_0xac1f('0xc3'),require('./api/intDynamics365Field'));_0x406495[_0xac1f('0xc')](_0xac1f('0xc4'),require(_0xac1f('0xc5')));_0x406495[_0xac1f('0xc')](_0xac1f('0xc6'),require('./api/intFreshsalesConfiguration'));_0x406495[_0xac1f('0xc')](_0xac1f('0xc7'),require('./api/intFreshsalesField'));_0x406495[_0xac1f('0xc')]('/api/networks',require(_0xac1f('0xc8')));_0x406495[_0xac1f('0xc')](_0xac1f('0xc9'),require(_0xac1f('0xca')));_0x406495[_0xac1f('0xc')](_0xac1f('0xcb'),require('./api/chatInternalMessage'));_0x406495[_0xac1f('0xc')]('/api/jscripty/answers/reports',require(_0xac1f('0xcc')));_0x406495[_0xac1f('0xc')](_0xac1f('0xcd'),require('./api/jscriptyQuestionReport'));_0x406495[_0xac1f('0xc')](_0xac1f('0xce'),require(_0xac1f('0xcf')));_0x406495[_0xac1f('0xc')]('/api/sms/reports/queue',require(_0xac1f('0xd0')));_0x406495[_0xac1f('0xc')](_0xac1f('0xd1'),require(_0xac1f('0xd2')));_0x406495['use']('/api/square/details/reports',require(_0xac1f('0xd3')));_0x406495[_0xac1f('0xc')](_0xac1f('0xd4'),require(_0xac1f('0xd5')));_0x406495[_0xac1f('0xc')](_0xac1f('0xd6'),require(_0xac1f('0xd7')));_0x406495['use'](_0xac1f('0xd8'),require(_0xac1f('0xd9')));_0x406495['use'](_0xac1f('0xda'),require(_0xac1f('0xdb')));_0x406495['use'](_0xac1f('0xdc'),require('./api/squareRecording'));_0x406495[_0xac1f('0xc')]('/api/square/messages',require('./api/squareMessage'));_0x406495[_0xac1f('0xc')](_0xac1f('0xdd'),require(_0xac1f('0xde')));_0x406495[_0xac1f('0xc')](_0xac1f('0xdf'),require(_0xac1f('0xe0')));_0x406495[_0xac1f('0xc')]('/api/campaigns',require('./api/campaign'));_0x406495[_0xac1f('0xc')](_0xac1f('0xe1'),require(_0xac1f('0xe2')));_0x406495[_0xac1f('0xc')](_0xac1f('0xe3'),require('./api/attachment'));_0x406495[_0xac1f('0xc')](_0xac1f('0xe4'),require(_0xac1f('0xe5')));_0x406495[_0xac1f('0xc')](_0xac1f('0xe6'),require('./api/mailTransferReport'));_0x406495[_0xac1f('0xc')](_0xac1f('0xe7'),require(_0xac1f('0xe8')));_0x406495[_0xac1f('0xc')](_0xac1f('0xe9'),require(_0xac1f('0xea')));_0x406495[_0xac1f('0xc')](_0xac1f('0xeb'),require(_0xac1f('0xec')));_0x406495[_0xac1f('0xc')](_0xac1f('0xed'),require(_0xac1f('0xee')));_0x406495[_0xac1f('0xc')](_0xac1f('0xef'),require('./api/cmList'));_0x406495[_0xac1f('0xc')](_0xac1f('0xf0'),require(_0xac1f('0xf1')));_0x406495[_0xac1f('0xc')](_0xac1f('0xf2'),require(_0xac1f('0xf3')));_0x406495[_0xac1f('0xc')](_0xac1f('0xf4'),require(_0xac1f('0xf5')));_0x406495[_0xac1f('0xc')](_0xac1f('0xf6'),require(_0xac1f('0xf7')));_0x406495['use'](_0xac1f('0xf8'),require(_0xac1f('0xf9')));_0x406495[_0xac1f('0xc')](_0xac1f('0xfa'),require(_0xac1f('0xfb')));_0x406495[_0xac1f('0xc')](_0xac1f('0xfc'),require('./api/whatsappApplication'));_0x406495[_0xac1f('0xc')](_0xac1f('0xfd'),require(_0xac1f('0xfe')));_0x406495[_0xac1f('0xc')](_0xac1f('0xff'),require(_0xac1f('0x100')));_0x406495['use']('/api/whatsapp/reports/queue',require(_0xac1f('0x101')));_0x406495[_0xac1f('0xc')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x406495['use'](_0xac1f('0x102'),require(_0xac1f('0x103')));_0x406495['use'](_0xac1f('0x104'),require('./api/cloudProvider'));_0x406495['use']('/api/realtime',require(_0xac1f('0x105')));_0x406495['use'](_0xac1f('0x106'),require(_0xac1f('0x107')));_0x406495[_0xac1f('0xc')](_0xac1f('0x108'),require(_0xac1f('0x109')));_0x406495[_0xac1f('0xc')]('/api/jira',require(_0xac1f('0x10a')));_0x406495[_0xac1f('0xc')]('/api/rpc',require(_0xac1f('0x10b')));_0x406495[_0xac1f('0xc')]('/api/version',require('./api/version'));_0x406495[_0xac1f('0xc')](_0xac1f('0x10c'),require('./api/system'));_0x406495[_0xac1f('0xc')](_0xac1f('0x10d'),require(_0xac1f('0x10e')));_0x406495[_0xac1f('0xc')](_0xac1f('0x10f'),require(_0xac1f('0x110')));_0x406495['use'](_0xac1f('0x111'),express[_0xac1f('0x112')](path[_0xac1f('0x113')](config[_0xac1f('0x114')],_0xac1f('0x111'))));_0x406495[_0xac1f('0xc')](_0xac1f('0x115'),express[_0xac1f('0x112')](path[_0xac1f('0x113')](config['root'],_0xac1f('0x115'))));_0x406495['use']('/demo',express[_0xac1f('0x112')](path[_0xac1f('0x113')](config[_0xac1f('0x114')],_0xac1f('0x116'))));_0x406495[_0xac1f('0xc')](_0xac1f('0x117'),express[_0xac1f('0x112')](path[_0xac1f('0x113')](config[_0xac1f('0x114')],_0xac1f('0x118'),'3.0.0')));_0x406495[_0xac1f('0xc')](_0xac1f('0x119'),express[_0xac1f('0x112')](path['join'](config[_0xac1f('0x114')],_0xac1f('0x11a'))));_0x406495[_0xac1f('0x11b')]('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x406495[_0xac1f('0x11b')]('/*')[_0xac1f('0x11c')](function(_0x13aab3,_0x23b9db){_0x23b9db[_0xac1f('0x11d')](path[_0xac1f('0x11e')](_0x406495[_0xac1f('0x11c')](_0xac1f('0x11f'))+_0xac1f('0x120')));});};var sensitiveFields=[_0xac1f('0x121'),_0xac1f('0x122'),'newPassword',_0xac1f('0x123'),_0xac1f('0x124'),_0xac1f('0x125'),_0xac1f('0x126'),_0xac1f('0x127'),_0xac1f('0x128'),_0xac1f('0x129'),_0xac1f('0x12a'),_0xac1f('0x12b'),_0xac1f('0x12c'),_0xac1f('0x12d'),_0xac1f('0x12e'),'accessKey',_0xac1f('0x12f'),'token',_0xac1f('0x130'),_0xac1f('0x131'),_0xac1f('0x132'),_0xac1f('0x133'),'consumerKey',_0xac1f('0x134'),_0xac1f('0x135'),'calleridname',_0xac1f('0x136'),_0xac1f('0x137'),'vidaooApiKey',_0xac1f('0x138'),_0xac1f('0x139'),_0xac1f('0x13a'),_0xac1f('0x13b'),_0xac1f('0x13c'),_0xac1f('0x19'),_0xac1f('0x13d'),_0xac1f('0x13e'),'localstationid',_0xac1f('0x13f'),_0xac1f('0x140'),_0xac1f('0x141'),_0xac1f('0x142')];function maskSensitiveData(_0x1e0ad8){var _0x2e0326=/(?!^)[\s\S](?!$)/g;if(!_[_0xac1f('0x143')](_0x1e0ad8))return;for(var _0x3f8ad4 in _0x1e0ad8){if(_['isArray'](_0x1e0ad8[_0x3f8ad4])){for(var _0xa48997=0x0;_0xa48997<_0x1e0ad8[_0x3f8ad4][_0xac1f('0x144')];_0xa48997++){maskSensitiveData(_0x1e0ad8[_0x3f8ad4][_0xa48997]);}}else if(_['isPlainObject'](_0x1e0ad8[_0x3f8ad4])){maskSensitiveData(_0x1e0ad8[_0x3f8ad4]);}else if(_[_0xac1f('0x145')](_0x1e0ad8[_0x3f8ad4])){_0x1e0ad8[_0x3f8ad4]=_0x1e0ad8[_0x3f8ad4]['replace'](/{{{/g,'@@{')[_0xac1f('0x146')](/}}}/g,_0xac1f('0x147'))[_0xac1f('0x146')](/{{/g,'@{')[_0xac1f('0x146')](/}}/g,'}@');if(_[_0xac1f('0x148')](sensitiveFields,_0x3f8ad4)){_0x1e0ad8[_0x3f8ad4]=_0x1e0ad8[_0x3f8ad4]['replace'](_0x2e0326,'*');}}}} \ No newline at end of file +var _0xa348=['./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','/api/migrations','/api/attachments','./api/attachment','./api/plugin','./api/mailTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','/apidoc','static','join','/www','/demo','/snippet','root','snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','sendFile','get','appPath','/index.html','username','password','newPassword','apiKey','firstName','street','phone','mobile','clientSecret','securityToken','tenantId','token','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum','exten','clientEmail','privateKey','secretaccesskey','accountSid','localstationid','dsn','secret','registry','oldPassword','isArray','isPlainObject','isString','replace','includes','lodash','express','./config/environment','./config/logger','api','auth','./safe-template','safeTemplate','default','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','statusCode','responseTime','user','name','role','inspect','logger','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','url','other','agent_id','agent_name','test','/api/users','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports'];(function(_0xda8a79,_0x112acc){var _0x5de72b=function(_0x3d23b3){while(--_0x3d23b3){_0xda8a79['push'](_0xda8a79['shift']());}};_0x5de72b(++_0x112acc);}(_0xa348,0xb2));var _0x8a34=function(_0x4b694b,_0xdc93c1){_0x4b694b=_0x4b694b-0x0;var _0x1e77c2=_0xa348[_0x4b694b];return _0x1e77c2;};'use strict';var _=require(_0x8a34('0x0'));var path=require('path');var express=require(_0x8a34('0x1'));var ewinston=require('express-winston');var util=require('util');var errors=require('./errors');var config=require(_0x8a34('0x2'));var logger=require(_0x8a34('0x3'))(_0x8a34('0x4'));var authLogger=require(_0x8a34('0x3'))(_0x8a34('0x5'));var safeTemplate=require(_0x8a34('0x6'))[_0x8a34('0x7')];exports[_0x8a34('0x8')]=function(_0x26722e){_0x26722e[_0x8a34('0x9')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x43043e,_0x160b71){var _0x3863ce=_0x8a34('0xa');if(!_['isEmpty'](_0x43043e[_0x8a34('0xb')])){_0x3863ce+=_0x8a34('0xc');var _0x53d435=_0x43043e[_0x8a34('0xb')];maskSensitiveData(_0x53d435);}return safeTemplate(util[_0x8a34('0xd')](_0x3863ce,_0x43043e[_0x8a34('0xe')],_0x43043e[_0x8a34('0xf')][_0x8a34('0x10')]?_0x43043e[_0x8a34('0xf')][_0x8a34('0x10')]:_0x43043e[_0x8a34('0x11')]['remoteAddress']||_0x43043e['ip'],_0x43043e['url'],_0x160b71[_0x8a34('0x12')],_0x160b71[_0x8a34('0x13')],_0x43043e['user']?_0x43043e[_0x8a34('0x14')]['id']:null,_0x43043e[_0x8a34('0x14')]?_0x43043e[_0x8a34('0x14')][_0x8a34('0x15')]:null,_0x43043e[_0x8a34('0x14')]?_0x43043e[_0x8a34('0x14')][_0x8a34('0x16')]:null,_0x53d435?util[_0x8a34('0x17')](_0x53d435,![],null):''));}}));_0x26722e[_0x8a34('0x9')](ewinston[_0x8a34('0x18')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x5e9171,_0x3b5ba5){var _0x10cb3b='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x5e9171['body']&&_0x5e9171[_0x8a34('0xb')][_0x8a34('0x19')]&&_0x5e9171[_0x8a34('0xb')]['agent_id']){_0x10cb3b=_0x8a34('0x1a');}return util['format'](_0x10cb3b,_0x5e9171[_0x8a34('0xe')],_0x5e9171[_0x8a34('0xf')][_0x8a34('0x10')]?_0x5e9171[_0x8a34('0xf')]['x-forwarded-for']:_0x5e9171[_0x8a34('0x11')][_0x8a34('0x1b')]||_0x5e9171['ip'],_0x5e9171[_0x8a34('0x1c')],_0x3b5ba5[_0x8a34('0x12')],_0x3b5ba5['responseTime'],_0x5e9171[_0x8a34('0x14')]?_0x5e9171[_0x8a34('0x14')]['id']:null,_0x5e9171[_0x8a34('0x14')]?_0x5e9171[_0x8a34('0x14')][_0x8a34('0x15')]:null,_0x5e9171['user']?_0x5e9171[_0x8a34('0x14')][_0x8a34('0x16')]:null,_0x5e9171['body']&&_0x5e9171['body'][_0x8a34('0x19')]?_0x5e9171[_0x8a34('0xb')]['device']:_0x8a34('0x1d'),_0x5e9171[_0x8a34('0xb')]&&_0x5e9171[_0x8a34('0xb')][_0x8a34('0x1e')]?_0x5e9171[_0x8a34('0xb')]['agent_id']:'',_0x5e9171[_0x8a34('0xb')]&&_0x5e9171[_0x8a34('0xb')][_0x8a34('0x1f')]?_0x5e9171[_0x8a34('0xb')][_0x8a34('0x1f')]:'');},'ignoreRoute':function(_0x55b7b9){var _0x538ef2=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x538ef2[_0x8a34('0x20')](_0x55b7b9[_0x8a34('0x1c')]);}}));_0x26722e[_0x8a34('0x9')](_0x8a34('0x21'),require('./api/user'));_0x26722e[_0x8a34('0x9')](_0x8a34('0x22'),require(_0x8a34('0x23')));_0x26722e[_0x8a34('0x9')]('/api/voice/contexts',require(_0x8a34('0x24')));_0x26722e['use'](_0x8a34('0x25'),require(_0x8a34('0x26')));_0x26722e['use'](_0x8a34('0x27'),require(_0x8a34('0x28')));_0x26722e['use'](_0x8a34('0x29'),require('./api/voiceQueue'));_0x26722e[_0x8a34('0x9')](_0x8a34('0x2a'),require(_0x8a34('0x2b')));_0x26722e['use']('/api/screen/recordings',require('./api/screenRecording'));_0x26722e[_0x8a34('0x9')](_0x8a34('0x2c'),require(_0x8a34('0x2d')));_0x26722e['use'](_0x8a34('0x2e'),require(_0x8a34('0x2f')));_0x26722e[_0x8a34('0x9')]('/api/voice/calls/reports',require(_0x8a34('0x30')));_0x26722e[_0x8a34('0x9')]('/api/voice/dials/reports',require(_0x8a34('0x31')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x32'),require(_0x8a34('0x33')));_0x26722e['use']('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x26722e[_0x8a34('0x9')](_0x8a34('0x34'),require(_0x8a34('0x35')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x36'),require(_0x8a34('0x37')));_0x26722e[_0x8a34('0x9')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x26722e[_0x8a34('0x9')](_0x8a34('0x38'),require(_0x8a34('0x39')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x3a'),require(_0x8a34('0x3b')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x3c'),require('./api/mailQueue'));_0x26722e[_0x8a34('0x9')]('/api/mail/substatuses',require(_0x8a34('0x3d')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x3e'),require(_0x8a34('0x3f')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x40'),require(_0x8a34('0x41')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x42'),require(_0x8a34('0x43')));_0x26722e[_0x8a34('0x9')]('/api/mail/reports/queue',require(_0x8a34('0x44')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x45'),require(_0x8a34('0x46')));_0x26722e[_0x8a34('0x9')]('/api/dashboards/items',require(_0x8a34('0x47')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x48'),require('./api/faxAccount'));_0x26722e[_0x8a34('0x9')](_0x8a34('0x49'),require(_0x8a34('0x4a')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x4b'),require(_0x8a34('0x4c')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x4d'),require(_0x8a34('0x4e')));_0x26722e[_0x8a34('0x9')]('/api/fax/queues',require('./api/faxQueue'));_0x26722e[_0x8a34('0x9')](_0x8a34('0x4f'),require(_0x8a34('0x50')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x51'),require(_0x8a34('0x52')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x53'),require('./api/smsApplication'));_0x26722e[_0x8a34('0x9')]('/api/sms/interactions',require('./api/smsInteraction'));_0x26722e[_0x8a34('0x9')]('/api/sms/messages',require(_0x8a34('0x54')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x55'),require(_0x8a34('0x56')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x57'),require(_0x8a34('0x58')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x59'),require(_0x8a34('0x5a')));_0x26722e['use'](_0x8a34('0x5b'),require(_0x8a34('0x5c')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x5d'),require('./api/openchannelMessage'));_0x26722e['use'](_0x8a34('0x5e'),require(_0x8a34('0x5f')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x60'),require(_0x8a34('0x61')));_0x26722e[_0x8a34('0x9')]('/api/openchannel/reports/queue',require(_0x8a34('0x62')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x63'),require(_0x8a34('0x64')));_0x26722e[_0x8a34('0x9')]('/api/chat/interactions',require(_0x8a34('0x65')));_0x26722e['use'](_0x8a34('0x66'),require(_0x8a34('0x67')));_0x26722e[_0x8a34('0x9')]('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x26722e[_0x8a34('0x9')](_0x8a34('0x68'),require(_0x8a34('0x69')));_0x26722e[_0x8a34('0x9')]('/api/chat/groups',require(_0x8a34('0x6a')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x6b'),require('./api/chatProactiveAction'));_0x26722e['use'](_0x8a34('0x6c'),require(_0x8a34('0x6d')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x6e'),require('./api/cmContact'));_0x26722e['use'](_0x8a34('0x6f'),require('./api/cmHopper'));_0x26722e[_0x8a34('0x9')](_0x8a34('0x70'),require(_0x8a34('0x71')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x72'),require(_0x8a34('0x73')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x74'),require(_0x8a34('0x75')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x76'),require(_0x8a34('0x77')));_0x26722e[_0x8a34('0x9')]('/api/actions',require('./api/action'));_0x26722e[_0x8a34('0x9')](_0x8a34('0x78'),require(_0x8a34('0x79')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x7a'),require(_0x8a34('0x7b')));_0x26722e['use'](_0x8a34('0x7c'),require(_0x8a34('0x7d')));_0x26722e[_0x8a34('0x9')]('/api/conditions',require(_0x8a34('0x7e')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x7f'),require('./api/interval'));_0x26722e[_0x8a34('0x9')](_0x8a34('0x80'),require(_0x8a34('0x81')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x82'),require(_0x8a34('0x83')));_0x26722e[_0x8a34('0x9')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x26722e[_0x8a34('0x9')](_0x8a34('0x84'),require(_0x8a34('0x85')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x86'),require(_0x8a34('0x87')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x88'),require(_0x8a34('0x89')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x8a'),require(_0x8a34('0x8b')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x8c'),require(_0x8a34('0x8d')));_0x26722e[_0x8a34('0x9')]('/api/variables',require(_0x8a34('0x8e')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x8f'),require('./api/integration'));_0x26722e[_0x8a34('0x9')](_0x8a34('0x90'),require(_0x8a34('0x91')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x92'),require(_0x8a34('0x93')));_0x26722e[_0x8a34('0x9')]('/api/analytics/default_reports',require(_0x8a34('0x94')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x95'),require(_0x8a34('0x96')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x97'),require(_0x8a34('0x98')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x99'),require('./api/analyticFieldReport'));_0x26722e[_0x8a34('0x9')]('/api/analytics/tree_reports',require(_0x8a34('0x9a')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x9b'),require('./api/intSalesforceAccount'));_0x26722e[_0x8a34('0x9')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x26722e[_0x8a34('0x9')](_0x8a34('0x9c'),require(_0x8a34('0x9d')));_0x26722e['use']('/api/integrations/sugarcrm/accounts',require(_0x8a34('0x9e')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x9f'),require('./api/intSugarcrmConfiguration'));_0x26722e[_0x8a34('0x9')](_0x8a34('0xa0'),require(_0x8a34('0xa1')));_0x26722e['use']('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0x26722e[_0x8a34('0x9')](_0x8a34('0xa2'),require(_0x8a34('0xa3')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xa4'),require(_0x8a34('0xa5')));_0x26722e['use']('/api/integrations/zoho/accounts',require(_0x8a34('0xa6')));_0x26722e['use'](_0x8a34('0xa7'),require(_0x8a34('0xa8')));_0x26722e['use']('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x26722e[_0x8a34('0x9')](_0x8a34('0xa9'),require(_0x8a34('0xaa')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xab'),require(_0x8a34('0xac')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xad'),require(_0x8a34('0xae')));_0x26722e[_0x8a34('0x9')]('/api/integrations/freshdesk/accounts',require(_0x8a34('0xaf')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xb0'),require(_0x8a34('0xb1')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xb2'),require('./api/intFreshdeskField'));_0x26722e[_0x8a34('0x9')](_0x8a34('0xb3'),require(_0x8a34('0xb4')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xb5'),require(_0x8a34('0xb6')));_0x26722e['use'](_0x8a34('0xb7'),require(_0x8a34('0xb8')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xb9'),require(_0x8a34('0xba')));_0x26722e['use'](_0x8a34('0xbb'),require(_0x8a34('0xbc')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xbd'),require(_0x8a34('0xbe')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xbf'),require(_0x8a34('0xc0')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xc1'),require('./api/intDynamics365Configuration'));_0x26722e[_0x8a34('0x9')](_0x8a34('0xc2'),require(_0x8a34('0xc3')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xc4'),require(_0x8a34('0xc5')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xc6'),require('./api/intFreshsalesConfiguration'));_0x26722e['use'](_0x8a34('0xc7'),require(_0x8a34('0xc8')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xc9'),require(_0x8a34('0xca')));_0x26722e['use']('/api/chat/reports/queue',require(_0x8a34('0xcb')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xcc'),require(_0x8a34('0xcd')));_0x26722e['use'](_0x8a34('0xce'),require(_0x8a34('0xcf')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xd0'),require(_0x8a34('0xd1')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xd2'),require('./api/jscriptySessionReport'));_0x26722e[_0x8a34('0x9')](_0x8a34('0xd3'),require(_0x8a34('0xd4')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xd5'),require(_0x8a34('0xd6')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xd7'),require(_0x8a34('0xd8')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xd9'),require('./api/jscriptyProject'));_0x26722e['use'](_0x8a34('0xda'),require(_0x8a34('0xdb')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xdc'),require('./api/squareOdbc'));_0x26722e[_0x8a34('0x9')](_0x8a34('0xdd'),require('./api/squareProject'));_0x26722e[_0x8a34('0x9')](_0x8a34('0xde'),require(_0x8a34('0xdf')));_0x26722e['use'](_0x8a34('0xe0'),require(_0x8a34('0xe1')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xe2'),require(_0x8a34('0xe3')));_0x26722e[_0x8a34('0x9')]('/api/license',require(_0x8a34('0xe4')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xe5'),require('./api/campaign'));_0x26722e[_0x8a34('0x9')](_0x8a34('0xe6'),require('./api/migration'));_0x26722e[_0x8a34('0x9')](_0x8a34('0xe7'),require(_0x8a34('0xe8')));_0x26722e[_0x8a34('0x9')]('/api/plugins',require(_0x8a34('0xe9')));_0x26722e['use']('/api/mail/reports/transfer',require(_0x8a34('0xea')));_0x26722e[_0x8a34('0x9')]('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x26722e['use'](_0x8a34('0xeb'),require(_0x8a34('0xec')));_0x26722e[_0x8a34('0x9')]('/api/openchannel/reports/transfer',require(_0x8a34('0xed')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xee'),require(_0x8a34('0xef')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xf0'),require(_0x8a34('0xf1')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xf2'),require(_0x8a34('0xf3')));_0x26722e['use'](_0x8a34('0xf4'),require('./api/userProfile'));_0x26722e['use'](_0x8a34('0xf5'),require(_0x8a34('0xf6')));_0x26722e[_0x8a34('0x9')]('/api/userProfile/resources',require(_0x8a34('0xf7')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xf8'),require('./api/userNotification'));_0x26722e['use'](_0x8a34('0xf9'),require('./api/whatsappAccount'));_0x26722e[_0x8a34('0x9')]('/api/whatsapp/applications',require(_0x8a34('0xfa')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xfb'),require(_0x8a34('0xfc')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xfd'),require(_0x8a34('0xfe')));_0x26722e[_0x8a34('0x9')](_0x8a34('0xff'),require(_0x8a34('0x100')));_0x26722e[_0x8a34('0x9')]('/api/whatsapp/reports/transfer',require(_0x8a34('0x101')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x102'),require('./api/whatsappQueue'));_0x26722e[_0x8a34('0x9')](_0x8a34('0x103'),require(_0x8a34('0x104')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x105'),require(_0x8a34('0x106')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x107'),require(_0x8a34('0x108')));_0x26722e[_0x8a34('0x9')]('/api/auth/google',require(_0x8a34('0x109')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x10a'),require(_0x8a34('0x10b')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x10c'),require(_0x8a34('0x10d')));_0x26722e[_0x8a34('0x9')]('/api/version',require(_0x8a34('0x10e')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x10f'),require(_0x8a34('0x110')));_0x26722e['use'](_0x8a34('0x111'),require(_0x8a34('0x112')));_0x26722e[_0x8a34('0x9')](_0x8a34('0x113'),require('./api/webbar'));_0x26722e[_0x8a34('0x9')](_0x8a34('0x114'),express[_0x8a34('0x115')](path[_0x8a34('0x116')](config['root'],_0x8a34('0x114'))));_0x26722e['use'](_0x8a34('0x117'),express[_0x8a34('0x115')](path[_0x8a34('0x116')](config['root'],_0x8a34('0x117'))));_0x26722e[_0x8a34('0x9')](_0x8a34('0x118'),express[_0x8a34('0x115')](path[_0x8a34('0x116')](config['root'],_0x8a34('0x118'))));_0x26722e[_0x8a34('0x9')](_0x8a34('0x119'),express['static'](path[_0x8a34('0x116')](config[_0x8a34('0x11a')],_0x8a34('0x11b'),'3.0.0')));_0x26722e['use'](_0x8a34('0x11c'),express[_0x8a34('0x115')](path[_0x8a34('0x116')](config[_0x8a34('0x11a')],_0x8a34('0x11d'))));_0x26722e[_0x8a34('0x11e')](_0x8a34('0x11f'))['get'](errors[0x194]);_0x26722e[_0x8a34('0x11e')]('/*')['get'](function(_0x3cebf9,_0x513b45){_0x513b45[_0x8a34('0x120')](path['resolve'](_0x26722e[_0x8a34('0x121')](_0x8a34('0x122'))+_0x8a34('0x123')));});};var sensitiveFields=[_0x8a34('0x124'),_0x8a34('0x125'),_0x8a34('0x126'),_0x8a34('0x127'),_0x8a34('0x128'),'lastName',_0x8a34('0x129'),_0x8a34('0x12a'),_0x8a34('0x12b'),'fax','email','clientId',_0x8a34('0x12c'),_0x8a34('0x12d'),'code','accessKey',_0x8a34('0x12e'),_0x8a34('0x12f'),_0x8a34('0x130'),'accessToken',_0x8a34('0x131'),_0x8a34('0x132'),_0x8a34('0x133'),_0x8a34('0x134'),'membername','calleridname',_0x8a34('0x135'),_0x8a34('0x136'),'vidaooApiKey',_0x8a34('0x137'),_0x8a34('0x138'),'accesskeyid',_0x8a34('0x139'),'key','user','pass',_0x8a34('0x13a'),_0x8a34('0x13b'),_0x8a34('0x13c'),_0x8a34('0x13d'),_0x8a34('0x13e'),_0x8a34('0x13f')];function maskSensitiveData(_0x53ed96){var _0x3e4988=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x53ed96))return;for(var _0x449d42 in _0x53ed96){if(_[_0x8a34('0x140')](_0x53ed96[_0x449d42])){for(var _0x49ed73=0x0;_0x49ed73<_0x53ed96[_0x449d42]['length'];_0x49ed73++){maskSensitiveData(_0x53ed96[_0x449d42][_0x49ed73]);}}else if(_[_0x8a34('0x141')](_0x53ed96[_0x449d42])){maskSensitiveData(_0x53ed96[_0x449d42]);}else if(_[_0x8a34('0x142')](_0x53ed96[_0x449d42])){_0x53ed96[_0x449d42]=_0x53ed96[_0x449d42][_0x8a34('0x143')](/{{{/g,'@@{')['replace'](/}}}/g,'}@@')[_0x8a34('0x143')](/{{/g,'@{')[_0x8a34('0x143')](/}}/g,'}@');if(_[_0x8a34('0x144')](sensitiveFields,_0x449d42)){_0x53ed96[_0x449d42]=_0x53ed96[_0x449d42]['replace'](_0x3e4988,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 717db10..4fda2a2 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd298=['../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.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/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','jayson/promise','lodash','../config/environment','listen','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','merge','../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/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc'];(function(_0x41fcc3,_0x4f1d0b){var _0x34155a=function(_0x24df4f){while(--_0x24df4f){_0x41fcc3['push'](_0x41fcc3['shift']());}};_0x34155a(++_0x4f1d0b);}(_0xd298,0xf8));var _0x8d29=function(_0x5c9af3,_0x1a2e07){_0x5c9af3=_0x5c9af3-0x0;var _0x23b332=_0xd298[_0x5c9af3];return _0x23b332;};'use strict';var jayson=require(_0x8d29('0x0'));var BPromise=require('bluebird');var _=require(_0x8d29('0x1'));var config=require(_0x8d29('0x2'));exports[_0x8d29('0x3')]=function(){return new BPromise(function(_0xf8b205,_0xd663d4){var _0x44e9d1={};_0x44e9d1=_['merge'](_0x44e9d1,require('../api/user/user.rpc'));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x4')));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x5')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x7')));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x8')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x9')));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0xa')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0xb')));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0xc')));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0xd')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0xe')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0xf')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x10')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require('../api/mailQueue/mailQueue.rpc'));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require('../api/mailInteraction/mailInteraction.rpc'));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require('../api/mailMessage/mailMessage.rpc'));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require('../api/mailApplication/mailApplication.rpc'));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x11')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require('../api/faxAccount/faxAccount.rpc'));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x12')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require('../api/faxInteraction/faxInteraction.rpc'));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x13')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x14')));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x15')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x16')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x17')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require('../api/smsMessage/smsMessage.rpc'));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x18')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x19')));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x1a')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x1b')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x1c')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x1d')));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x1e')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x1f')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x20')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x21')));_0x44e9d1=_['merge'](_0x44e9d1,require('../api/cmHopper/cmHopper.rpc'));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x22')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x23')));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x24')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x25')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x26')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x27')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x28')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x29')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x2a')));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x2b')));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x2c')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x2d')));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x2e')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x2f')));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x30')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x31')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x32')));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x33')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x34')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x35')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x36')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x37')));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x38')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x39')));_0x44e9d1=_['merge'](_0x44e9d1,require('../api/squareRecording/squareRecording.rpc'));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x3a')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x3b')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require('../api/attachment/attachment.rpc'));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x3c')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x3d')));_0x44e9d1=_['merge'](_0x44e9d1,require(_0x8d29('0x3e')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require(_0x8d29('0x3f')));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x44e9d1=_[_0x8d29('0x6')](_0x44e9d1,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x538370=jayson['server'](_0x44e9d1)['http']();var _0x4b4a33=config[_0x8d29('0x40')][_0x8d29('0x41')]||config[_0x8d29('0x41')]+0x1;var _0xa32390=config['rpc']['ip']||_0x8d29('0x42');_0x538370['on']('error',function(_0x3a931e){return _0xd663d4(_0x3a931e);});_0x538370[_0x8d29('0x3')](_0x4b4a33,_0xa32390,function(){console[_0x8d29('0x43')](_0x8d29('0x44'),_0xa32390,_0x4b4a33);require(_0x8d29('0x45'))['default']();return _0xf8b205('RPC\x20listening\x20on\x20'+_0xa32390+':'+_0x4b4a33);});});}; \ No newline at end of file +var _0xbc45=['../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/plugin/plugin.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','localhost','error','../config/triggers','default','bluebird','lodash','../config/environment','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/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc'];(function(_0x1631b4,_0x58167b){var _0x5e8e10=function(_0x50467a){while(--_0x50467a){_0x1631b4['push'](_0x1631b4['shift']());}};_0x5e8e10(++_0x58167b);}(_0xbc45,0x172));var _0x5bc4=function(_0x3e526a,_0x482999){_0x3e526a=_0x3e526a-0x0;var _0x934cc0=_0xbc45[_0x3e526a];return _0x934cc0;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x5bc4('0x0'));var _=require(_0x5bc4('0x1'));var config=require(_0x5bc4('0x2'));exports[_0x5bc4('0x3')]=function(){return new BPromise(function(_0x36fc89,_0x368b02){var _0x120faa={};_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x5')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x6')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x7')));_0x120faa=_['merge'](_0x120faa,require(_0x5bc4('0x8')));_0x120faa=_['merge'](_0x120faa,require(_0x5bc4('0x9')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0xa')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0xb')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/memberReport/memberReport.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/trunk/trunk.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0xc')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0xd')));_0x120faa=_['merge'](_0x120faa,require(_0x5bc4('0xe')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0xf')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x10')));_0x120faa=_['merge'](_0x120faa,require('../api/mailInteraction/mailInteraction.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x11')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/mailApplication/mailApplication.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x12')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x13')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/faxApplication/faxApplication.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/faxInteraction/faxInteraction.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/faxMessage/faxMessage.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x14')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x15')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x16')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x17')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/smsQueue/smsQueue.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x18')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x19')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x1a')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x1b')));_0x120faa=_['merge'](_0x120faa,require('../api/chatInteraction/chatInteraction.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/chatMessage/chatMessage.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/chatQueue/chatQueue.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/cmContact/cmContact.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/cmHopper/cmHopper.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x1c')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x1d')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x1e')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x1f')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/pause/pause.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x20')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x21')));_0x120faa=_['merge'](_0x120faa,require('../api/trigger/trigger.rpc'));_0x120faa=_['merge'](_0x120faa,require(_0x5bc4('0x22')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x23')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x24')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x25')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x26')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x27')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x120faa=_['merge'](_0x120faa,require(_0x5bc4('0x28')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x29')));_0x120faa=_['merge'](_0x120faa,require(_0x5bc4('0x2a')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/setting/setting.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x2b')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x2c')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/squareRecording/squareRecording.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x2d')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/campaign/campaign.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require('../api/attachment/attachment.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x2e')));_0x120faa=_['merge'](_0x120faa,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x120faa=_['merge'](_0x120faa,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x2f')));_0x120faa=_[_0x5bc4('0x4')](_0x120faa,require(_0x5bc4('0x30')));_0x120faa=_['merge'](_0x120faa,require(_0x5bc4('0x31')));var _0x343e8f=jayson[_0x5bc4('0x32')](_0x120faa)[_0x5bc4('0x33')]();var _0x2d1e3b=config['rpc'][_0x5bc4('0x34')]||config[_0x5bc4('0x34')]+0x1;var _0x37854a=config[_0x5bc4('0x35')]['ip']||_0x5bc4('0x36');_0x343e8f['on'](_0x5bc4('0x37'),function(_0x45b2da){return _0x368b02(_0x45b2da);});_0x343e8f[_0x5bc4('0x3')](_0x2d1e3b,_0x37854a,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x37854a,_0x2d1e3b);require(_0x5bc4('0x38'))[_0x5bc4('0x39')]();return _0x36fc89('RPC\x20listening\x20on\x20'+_0x37854a+':'+_0x2d1e3b);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index 0cdbbaa..4e097a6 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe511=['\x20}\x20}','string','isArray','map','isPlainObject','reduce','safeTemplate','lodash'];(function(_0x53e041,_0x1e8db9){var _0xa5c200=function(_0x24f3ce){while(--_0x24f3ce){_0x53e041['push'](_0x53e041['shift']());}};_0xa5c200(++_0x1e8db9);}(_0xe511,0x16f));var _0x1e51=function(_0x8b885,_0x31740b){_0x8b885=_0x8b885-0x0;var _0x122eb8=_0xe511[_0x8b885];return _0x122eb8;};var _=require(_0x1e51('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x3a7329){return _0x3a7329==='{{'?'{\x20{\x20':_0x1e51('0x1');}function safeTemplate(_0x5b9e45){var _0x253e96=_0x5b9e45;if(typeof _0x5b9e45===_0x1e51('0x2')){_0x253e96=_0x5b9e45['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x1e51('0x3')](_0x5b9e45)){_0x253e96=_0x5b9e45[_0x1e51('0x4')](function(_0x204da7){return safeTemplate(_0x204da7);});}else if(_[_0x1e51('0x5')](_0x5b9e45)){_0x253e96=Object['keys'](_0x5b9e45)[_0x1e51('0x6')](function(_0x21ed6b,_0x5c4590){_0x21ed6b[_0x5c4590]=safeTemplate(_0x5b9e45[_0x5c4590]);return _0x21ed6b;},{});}return _0x253e96;}module['exports'][_0x1e51('0x7')]=safeTemplate; \ No newline at end of file +var _0x757a=['isArray','map','isPlainObject','reduce','exports','safeTemplate','{\x20{\x20','string','replace'];(function(_0xfec2bb,_0x2d6017){var _0x6ee731=function(_0x5cab1d){while(--_0x5cab1d){_0xfec2bb['push'](_0xfec2bb['shift']());}};_0x6ee731(++_0x2d6017);}(_0x757a,0xde));var _0xa757=function(_0x47f7ed,_0x937954){_0x47f7ed=_0x47f7ed-0x0;var _0x56308c=_0x757a[_0x47f7ed];return _0x56308c;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x24afaf){return _0x24afaf==='{{'?_0xa757('0x0'):'\x20}\x20}';}function safeTemplate(_0x5c03c3){var _0x5709ed=_0x5c03c3;if(typeof _0x5c03c3===_0xa757('0x1')){_0x5709ed=_0x5c03c3[_0xa757('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xa757('0x3')](_0x5c03c3)){_0x5709ed=_0x5c03c3[_0xa757('0x4')](function(_0x32630d){return safeTemplate(_0x32630d);});}else if(_[_0xa757('0x5')](_0x5c03c3)){_0x5709ed=Object['keys'](_0x5c03c3)[_0xa757('0x6')](function(_0x4343b6,_0x53be0e){_0x4343b6[_0x53be0e]=safeTemplate(_0x5c03c3[_0x53be0e]);return _0x4343b6;},{});}return _0x5709ed;}module[_0xa757('0x7')][_0xa757('0x8')]=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 1bc536b..1eb6eaf 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 _0xb923=['recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','exec','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./reply','./error','call','setEncoding','utf8','setTimeout','emit','ready','toLowerCase','hangup','520-Invalid','function','substring','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','inherits','prototype','sendRequest','sync','beep','format','noop','VERBOSE\x20\x22%s\x22','isArray','join','EXEC\x20%s\x20%s','setExtension','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22'];(function(_0x3ef8b4,_0x2e2394){var _0x131fe6=function(_0x572dbd){while(--_0x572dbd){_0x3ef8b4['push'](_0x3ef8b4['shift']());}};_0x131fe6(++_0x2e2394);}(_0xb923,0xa2));var _0x3b92=function(_0x255ba2,_0x27f2fa){_0x255ba2=_0x255ba2-0x0;var _0x1238fb=_0xb923[_0x255ba2];return _0x1238fb;};'use strict';var util=require(_0x3b92('0x0'));var _=require(_0x3b92('0x1'));var EventEmitter=require(_0x3b92('0x2'))['EventEmitter'];var AGIReply=require(_0x3b92('0x3'));var AGIError=require(_0x3b92('0x4'));function AGIChannel(_0x513b75){var _0x4d4d81=this,_0x508ed9=new AGIReply(),_0x1d4d24=![],_0x124c8d={};EventEmitter[_0x3b92('0x5')](_0x4d4d81);_0x513b75[_0x3b92('0x6')](_0x3b92('0x7'));_0x513b75[_0x3b92('0x8')](0x8*0x3c*0x3c*0x3e8);_0x508ed9[_0x3b92('0x6')]('utf8');_0x508ed9['on']('headers',function(_0x2aefa5){for(var _0x5976bf in _0x2aefa5){_0x4d4d81[_0x5976bf]=_0x2aefa5[_0x5976bf];}_0x4d4d81[_0x3b92('0x9')](_0x3b92('0xa'));});_0x508ed9['on']('line',function(_0x401978){if(_0x401978[_0x3b92('0xb')]()==_0x3b92('0xc')){_0x4d4d81[_0x3b92('0x9')](_0x3b92('0xc'));return;}if(_0x401978['substring'](0x0,0xb)==_0x3b92('0xd')){_0x1d4d24=!![];}if(_0x1d4d24){_0x124c8d['rx']+=_0x401978+'\x0a';if(_0x401978['search']('520\x20End\x20of\x20proper')!=-0x1){_0x1d4d24=![];}}else{_0x124c8d['rx']=_0x401978;}if(_0x1d4d24){return;}if(typeof _0x124c8d['cb']==_0x3b92('0xe')){var _0xdcd2b6=_0x124c8d['rx']['substring'](0x0,0x3),_0x2c4dcc=null,_0x3ae230=null;_0xdcd2b6=parseInt(_0xdcd2b6);if(isNaN(_0xdcd2b6)){_0x124c8d['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0xdcd2b6!=0xc8){_0x124c8d['cb'](null,{'code':_0xdcd2b6,'result':-0x1,'extra':'KO'});return;}_0x2c4dcc=_0x124c8d['rx'][_0x3b92('0xf')](0x4)['replace']('result=','');if(_0x2c4dcc[_0x3b92('0x10')]('\x20')!=-0x1){_0x2c4dcc=_0x2c4dcc[_0x3b92('0x11')](0x0,_0x2c4dcc[_0x3b92('0x10')]('\x20'));}if(_[_0x3b92('0x12')](_0x2c4dcc,'-1')){_0x2c4dcc=parseInt(_0x2c4dcc);}_0x3ae230=_0x124c8d['rx'][_0x3b92('0x13')]('\x20');if(_0x3ae230['length']==0x3){_0x3ae230=_0x3ae230[0x2][_0x3b92('0xf')](0x1,_0x3ae230[0x2][_0x3b92('0x14')]-0x1);}else if(_0x3ae230['length']>0x3){var _0x4e6da7=/\((.+)\)/;var _0x2d537b=_0x124c8d['rx'][_0x3b92('0x15')](_0x4e6da7);if(_0x2d537b){_0x3ae230=_0x2d537b[0x1];}else{_0x3ae230=null;}}else{_0x3ae230=null;}_0x124c8d['cb'](null,{'code':_0xdcd2b6,'result':_0x2c4dcc,'extra':_0x3ae230});}});_0x513b75['on'](_0x3b92('0x16'),function(_0x1859b4){_0x4d4d81[_0x3b92('0x9')](_0x3b92('0x16'),new AGIError(_0x3b92('0x17'),_0x1859b4[_0x3b92('0x18')]));});_0x513b75['on'](_0x3b92('0x19'),function(){_0x4d4d81[_0x3b92('0x9')](_0x3b92('0x19'),new AGIError(_0x3b92('0x1a')));});_0x513b75['on'](_0x3b92('0x1b'),function(){_0x4d4d81['emit'](_0x3b92('0x1b'),new AGIError(_0x3b92('0x1c')));_0x513b75[_0x3b92('0x1d')]();});_0x513b75[_0x3b92('0x1e')](_0x508ed9);this[_0x3b92('0x1f')]=function(_0x1bb348,_0x52b452){var _0x1bb348=_0x1bb348||'',_0x52b452=typeof _0x52b452=='function'?_0x52b452:new Function();_0x124c8d={'tx':_0x1bb348,'rx':'','cb':_0x52b452};_0x513b75['write'](_0x1bb348+'\x0a');},this['close']=function(){_0x513b75['destroy']();};}util[_0x3b92('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x3b92('0x21')][_0x3b92('0x22')]=function(_0x52d0a9){return this[_0x3b92('0x1f')][_0x3b92('0x23')](this,_0x52d0a9);};AGIChannel[_0x3b92('0x21')]['answer']=function(){return this[_0x3b92('0x22')]('ANSWER');};AGIChannel[_0x3b92('0x21')]['getData']=function(_0x24a15f,_0x2ee842,_0x91d632){_0x24a15f=_0x24a15f===undefined?_0x3b92('0x24'):_0x24a15f;_0x2ee842=_0x2ee842===undefined?'5':_0x2ee842;_0x91d632=_0x91d632===undefined?'1':_0x91d632;return this[_0x3b92('0x22')](util[_0x3b92('0x25')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x24a15f,_0x2ee842*0x3e8,_0x91d632));};AGIChannel[_0x3b92('0x21')][_0x3b92('0x26')]=function(_0x1299e0){_0x1299e0=_0x1299e0||'NO\x20MESSAGE';return this['sendRequest'](util[_0x3b92('0x25')](_0x3b92('0x27'),_0x1299e0));};AGIChannel['prototype']['exec']=function(_0x38b395,_0x5f3763){if(_[_0x3b92('0x28')](_0x5f3763)){return this['sendRequest'](util['format']('EXEC\x20%s\x20%s',_0x38b395,_0x5f3763[_0x3b92('0x29')](',')));}return this[_0x3b92('0x22')](util['format'](_0x3b92('0x2a'),_0x38b395,_0x5f3763));};AGIChannel[_0x3b92('0x21')]['setContext']=function(_0x894041){return this[_0x3b92('0x22')](util[_0x3b92('0x25')]('SET\x20CONTEXT\x20%s',_0x894041));};AGIChannel['prototype'][_0x3b92('0x2b')]=function(_0x1de83c){return this[_0x3b92('0x22')](util['format']('SET\x20EXTENSION\x20%s',_0x1de83c));};AGIChannel[_0x3b92('0x21')]['setPriority']=function(_0x292cd8){return this[_0x3b92('0x22')](util[_0x3b92('0x25')](_0x3b92('0x2c'),_0x292cd8));};AGIChannel[_0x3b92('0x21')][_0x3b92('0xc')]=function(){return this[_0x3b92('0x22')]('HANGUP');};AGIChannel[_0x3b92('0x21')][_0x3b92('0x2d')]=function(_0x1e8d0a,_0x49d036){var _0xbeb32c=_[_0x3b92('0x2e')](_0x49d036)||_[_0x3b92('0x2f')](_0x49d036)?_0x49d036[_0x3b92('0x30')]():_0x49d036;return this[_0x3b92('0x22')](util[_0x3b92('0x25')](_0x3b92('0x31'),_0x1e8d0a,_0xbeb32c?_0xbeb32c[_0x3b92('0x30')]()[_0x3b92('0x32')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x3b92('0x21')][_0x3b92('0x33')]=function(_0x14fec7,_0x33efc5){return this[_0x3b92('0x22')](util[_0x3b92('0x25')](_0x3b92('0x34'),_0x14fec7,_0x33efc5));};AGIChannel[_0x3b92('0x21')][_0x3b92('0x35')]=function(_0x36aeb7,_0x40dcb8){return this[_0x3b92('0x22')](util[_0x3b92('0x25')](_0x3b92('0x36'),_0x36aeb7,_0x40dcb8));};AGIChannel[_0x3b92('0x21')]['sayPhonetic']=function(_0x4423cb,_0x2e821e){return this['sendRequest'](util[_0x3b92('0x25')](_0x3b92('0x37'),_0x4423cb,_0x2e821e));};AGIChannel[_0x3b92('0x21')][_0x3b92('0x38')]=function(_0x4114ad,_0x331dd4,_0x14619a){_0x331dd4=_0x331dd4||this[_0x3b92('0x39')];_0x14619a=_0x14619a||0x1;this[_0x3b92('0x3a')](_0x4114ad);this['setExtension'](_0x331dd4);this[_0x3b92('0x3b')](_0x14619a);return this[_0x3b92('0x26')](util['format'](_0x3b92('0x3c'),_0x4114ad,_0x331dd4,_0x14619a));};AGIChannel['prototype'][_0x3b92('0x3d')]=function(_0x5906f0){return this[_0x3b92('0x22')](util[_0x3b92('0x25')](_0x3b92('0x3e'),_0x5906f0));};AGIChannel[_0x3b92('0x21')][_0x3b92('0x3f')]=function(_0x593d7f,_0x33e950,_0x228682,_0x23375b,_0x40374e,_0x202b07){_0x33e950=_0x33e950||_0x3b92('0x40');_0x228682=_0x228682||'';_0x23375b=_0x23375b===undefined?-0x1:_0x23375b==='-1'?-0x1:_0x23375b*0x3e8;_0x40374e=_0x40374e===undefined?'':'s='+_0x40374e;_0x202b07=_0x202b07?_0x3b92('0x41'):'';return this['sendRequest'](util[_0x3b92('0x25')](_0x3b92('0x42'),_0x593d7f,_0x33e950,_0x228682,_0x23375b,_0x202b07,_0x40374e));};AGIChannel[_0x3b92('0x21')]['streamFile']=function(_0x452bc5,_0x56adfa){_0x56adfa=_0x56adfa||'';return this[_0x3b92('0x22')](util[_0x3b92('0x25')](_0x3b92('0x43'),_0x452bc5,_0x56adfa));};AGIChannel[_0x3b92('0x21')][_0x3b92('0x44')]=function(_0x499df5){return this['exec'](_0x3b92('0x45'),_0x499df5);};AGIChannel['prototype'][_0x3b92('0x46')]=function(_0x543d28){return this[_0x3b92('0x47')]('WAIT',_0x543d28);};AGIChannel[_0x3b92('0x21')][_0x3b92('0x16')]=function(_0x5e9cab,_0x2624db){this[_0x3b92('0x26')](util[_0x3b92('0x25')](_0x3b92('0x48'),_0x5e9cab['id'],_0x5e9cab[_0x3b92('0x49')],_0x2624db));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x3b92('0x4a')]=AGIChannel; \ No newline at end of file +var _0xc965=['E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','destroy','inherits','prototype','sendRequest','command','sync','answer','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','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','agi','exec','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','util','./reply','call','setEncoding','setTimeout','emit','ready','hangup','520-Invalid','search','520\x20End\x20of\x20proper','substring','result=','indexOf','startsWith','length','error','code','close'];(function(_0x20289b,_0x30fda0){var _0xf8c92f=function(_0x5624cd){while(--_0x5624cd){_0x20289b['push'](_0x20289b['shift']());}};_0xf8c92f(++_0x30fda0);}(_0xc965,0x6f));var _0x5c96=function(_0x3fb030,_0x12aebe){_0x3fb030=_0x3fb030-0x0;var _0xd6899b=_0xc965[_0x3fb030];return _0xd6899b;};'use strict';var util=require(_0x5c96('0x0'));var _=require('lodash');var EventEmitter=require('events')['EventEmitter'];var AGIReply=require(_0x5c96('0x1'));var AGIError=require('./error');function AGIChannel(_0x520859){var _0x204c77=this,_0x45c0db=new AGIReply(),_0x539d74=![],_0x452807={};EventEmitter[_0x5c96('0x2')](_0x204c77);_0x520859[_0x5c96('0x3')]('utf8');_0x520859[_0x5c96('0x4')](0x8*0x3c*0x3c*0x3e8);_0x45c0db[_0x5c96('0x3')]('utf8');_0x45c0db['on']('headers',function(_0x2ee632){for(var _0x4bef69 in _0x2ee632){_0x204c77[_0x4bef69]=_0x2ee632[_0x4bef69];}_0x204c77[_0x5c96('0x5')](_0x5c96('0x6'));});_0x45c0db['on']('line',function(_0x176c4a){if(_0x176c4a['toLowerCase']()==_0x5c96('0x7')){_0x204c77[_0x5c96('0x5')](_0x5c96('0x7'));return;}if(_0x176c4a['substring'](0x0,0xb)==_0x5c96('0x8')){_0x539d74=!![];}if(_0x539d74){_0x452807['rx']+=_0x176c4a+'\x0a';if(_0x176c4a[_0x5c96('0x9')](_0x5c96('0xa'))!=-0x1){_0x539d74=![];}}else{_0x452807['rx']=_0x176c4a;}if(_0x539d74){return;}if(typeof _0x452807['cb']=='function'){var _0x2da932=_0x452807['rx'][_0x5c96('0xb')](0x0,0x3),_0x51ef70=null,_0x4e922a=null;_0x2da932=parseInt(_0x2da932);if(isNaN(_0x2da932)){_0x452807['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x2da932!=0xc8){_0x452807['cb'](null,{'code':_0x2da932,'result':-0x1,'extra':'KO'});return;}_0x51ef70=_0x452807['rx'][_0x5c96('0xb')](0x4)['replace'](_0x5c96('0xc'),'');if(_0x51ef70[_0x5c96('0xd')]('\x20')!=-0x1){_0x51ef70=_0x51ef70['substr'](0x0,_0x51ef70[_0x5c96('0xd')]('\x20'));}if(_[_0x5c96('0xe')](_0x51ef70,'-1')){_0x51ef70=parseInt(_0x51ef70);}_0x4e922a=_0x452807['rx']['split']('\x20');if(_0x4e922a[_0x5c96('0xf')]==0x3){_0x4e922a=_0x4e922a[0x2]['substring'](0x1,_0x4e922a[0x2][_0x5c96('0xf')]-0x1);}else if(_0x4e922a[_0x5c96('0xf')]>0x3){var _0x404e50=/\((.+)\)/;var _0x5e5ad8=_0x452807['rx']['match'](_0x404e50);if(_0x5e5ad8){_0x4e922a=_0x5e5ad8[0x1];}else{_0x4e922a=null;}}else{_0x4e922a=null;}_0x452807['cb'](null,{'code':_0x2da932,'result':_0x51ef70,'extra':_0x4e922a});}});_0x520859['on'](_0x5c96('0x10'),function(_0x50b3ae){_0x204c77['emit'](_0x5c96('0x10'),new AGIError('E_AGI_SOCKET_ERROR',_0x50b3ae[_0x5c96('0x11')]));});_0x520859['on'](_0x5c96('0x12'),function(){_0x204c77[_0x5c96('0x5')]('close',new AGIError(_0x5c96('0x13')));});_0x520859['on']('timeout',function(){_0x204c77[_0x5c96('0x5')](_0x5c96('0x14'),new AGIError(_0x5c96('0x15')));_0x520859['destroy']();});_0x520859[_0x5c96('0x16')](_0x45c0db);this['command']=function(_0x31ab,_0x14fac7){var _0x31ab=_0x31ab||'',_0x14fac7=typeof _0x14fac7=='function'?_0x14fac7:new Function();_0x452807={'tx':_0x31ab,'rx':'','cb':_0x14fac7};_0x520859['write'](_0x31ab+'\x0a');},this[_0x5c96('0x12')]=function(){_0x520859[_0x5c96('0x17')]();};}util[_0x5c96('0x18')](AGIChannel,EventEmitter);AGIChannel[_0x5c96('0x19')][_0x5c96('0x1a')]=function(_0x589bc4){return this[_0x5c96('0x1b')][_0x5c96('0x1c')](this,_0x589bc4);};AGIChannel[_0x5c96('0x19')][_0x5c96('0x1d')]=function(){return this[_0x5c96('0x1a')](_0x5c96('0x1e'));};AGIChannel[_0x5c96('0x19')][_0x5c96('0x1f')]=function(_0x223d57,_0x48e686,_0xd919fe){_0x223d57=_0x223d57===undefined?_0x5c96('0x20'):_0x223d57;_0x48e686=_0x48e686===undefined?'5':_0x48e686;_0xd919fe=_0xd919fe===undefined?'1':_0xd919fe;return this[_0x5c96('0x1a')](util['format'](_0x5c96('0x21'),_0x223d57,_0x48e686*0x3e8,_0xd919fe));};AGIChannel[_0x5c96('0x19')][_0x5c96('0x22')]=function(_0x395f04){_0x395f04=_0x395f04||_0x5c96('0x23');return this[_0x5c96('0x1a')](util[_0x5c96('0x24')](_0x5c96('0x25'),_0x395f04));};AGIChannel[_0x5c96('0x19')]['exec']=function(_0x3736ff,_0x593588){if(_[_0x5c96('0x26')](_0x593588)){return this[_0x5c96('0x1a')](util['format'](_0x5c96('0x27'),_0x3736ff,_0x593588['join'](',')));}return this[_0x5c96('0x1a')](util[_0x5c96('0x24')](_0x5c96('0x27'),_0x3736ff,_0x593588));};AGIChannel[_0x5c96('0x19')][_0x5c96('0x28')]=function(_0x5e0565){return this[_0x5c96('0x1a')](util[_0x5c96('0x24')](_0x5c96('0x29'),_0x5e0565));};AGIChannel[_0x5c96('0x19')][_0x5c96('0x2a')]=function(_0x4b9f49){return this['sendRequest'](util[_0x5c96('0x24')](_0x5c96('0x2b'),_0x4b9f49));};AGIChannel['prototype'][_0x5c96('0x2c')]=function(_0x10fb57){return this[_0x5c96('0x1a')](util[_0x5c96('0x24')]('SET\x20PRIORITY\x20%s',_0x10fb57));};AGIChannel[_0x5c96('0x19')][_0x5c96('0x7')]=function(){return this[_0x5c96('0x1a')](_0x5c96('0x2d'));};AGIChannel[_0x5c96('0x19')]['setVariable']=function(_0x4d77b5,_0x58bcd6){var _0x22622e=_[_0x5c96('0x2e')](_0x58bcd6)||_[_0x5c96('0x2f')](_0x58bcd6)?_0x58bcd6['toString']():_0x58bcd6;return this[_0x5c96('0x1a')](util[_0x5c96('0x24')](_0x5c96('0x30'),_0x4d77b5,_0x22622e?_0x22622e['toString']()[_0x5c96('0x31')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x5c96('0x19')]['sayNumber']=function(_0x2b62d0,_0x1e806e){return this['sendRequest'](util[_0x5c96('0x24')](_0x5c96('0x32'),_0x2b62d0,_0x1e806e));};AGIChannel[_0x5c96('0x19')][_0x5c96('0x33')]=function(_0x8f3dea,_0x290e86){return this[_0x5c96('0x1a')](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x8f3dea,_0x290e86));};AGIChannel[_0x5c96('0x19')]['sayPhonetic']=function(_0x47f5fb,_0xedf227){return this[_0x5c96('0x1a')](util['format'](_0x5c96('0x34'),_0x47f5fb,_0xedf227));};AGIChannel['prototype'][_0x5c96('0x35')]=function(_0x2cead7,_0x3f550c,_0x298509){_0x3f550c=_0x3f550c||this[_0x5c96('0x36')];_0x298509=_0x298509||0x1;this[_0x5c96('0x28')](_0x2cead7);this[_0x5c96('0x2a')](_0x3f550c);this[_0x5c96('0x2c')](_0x298509);return this[_0x5c96('0x22')](util[_0x5c96('0x24')]('GOTO\x20%s\x20%s\x20%s',_0x2cead7,_0x3f550c,_0x298509));};AGIChannel[_0x5c96('0x19')][_0x5c96('0x37')]=function(_0x459c2d){return this[_0x5c96('0x1a')](util[_0x5c96('0x24')](_0x5c96('0x38'),_0x459c2d));};AGIChannel[_0x5c96('0x19')][_0x5c96('0x39')]=function(_0x3659c9,_0x3aeb2f,_0x59c0c6,_0x12ba75,_0x3ae780,_0x445f08){_0x3aeb2f=_0x3aeb2f||_0x5c96('0x3a');_0x59c0c6=_0x59c0c6||'';_0x12ba75=_0x12ba75===undefined?-0x1:_0x12ba75==='-1'?-0x1:_0x12ba75*0x3e8;_0x3ae780=_0x3ae780===undefined?'':'s='+_0x3ae780;_0x445f08=_0x445f08?_0x5c96('0x3b'):'';return this['sendRequest'](util[_0x5c96('0x24')](_0x5c96('0x3c'),_0x3659c9,_0x3aeb2f,_0x59c0c6,_0x12ba75,_0x445f08,_0x3ae780));};AGIChannel[_0x5c96('0x19')]['streamFile']=function(_0x2bf26c,_0x10d26a){_0x10d26a=_0x10d26a||'';return this[_0x5c96('0x1a')](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x2bf26c,_0x10d26a));};AGIChannel[_0x5c96('0x19')][_0x5c96('0x3d')]=function(_0x5c52e4){return this['exec']('AGI',_0x5c52e4);};AGIChannel[_0x5c96('0x19')]['wait']=function(_0x2d9a3b){return this[_0x5c96('0x3e')](_0x5c96('0x3f'),_0x2d9a3b);};AGIChannel[_0x5c96('0x19')][_0x5c96('0x10')]=function(_0x39e31e,_0x2af1d2){this[_0x5c96('0x22')](util['format'](_0x5c96('0x40'),_0x39e31e['id'],_0x39e31e['label'],_0x2af1d2));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index da93f9f..6666a18 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 _0xe7e1=['Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x1ccb87,_0x409c48){var _0x3a1b50=function(_0x30d5ea){while(--_0x30d5ea){_0x1ccb87['push'](_0x1ccb87['shift']());}};_0x3a1b50(++_0x409c48);}(_0xe7e1,0xac));var _0x1e7e=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xe7e1[_0x5834bc];return _0x3e183a;};'use strict';var util=require(_0x1e7e('0x0'));var error={'E_AGI_UNDEFINED':_0x1e7e('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x1e7e('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x1e7e('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x1e7e('0x4'),'E_AGI_SOCKET_CLOSE':_0x1e7e('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x1e7e('0x6'),'E_AGI_COMMAND_EMPTY':_0x1e7e('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x1e7e('0x8'),'E_AGI_IVR_ENTRY':_0x1e7e('0x9')};function AGIError(_0xc77cfc){var _0xc77cfc=_0xc77cfc||null,_0x309831=_0x309831||[],_0x18f6e6=0x1,_0x53a570='';if(!error[_0xc77cfc]){_0xc77cfc='E_AGI_UNDEFINED';}_0x309831[_0x1e7e('0xa')](error[_0xc77cfc]);while(arguments[_0x18f6e6]){_0x309831[_0x1e7e('0xa')](arguments[_0x18f6e6]);_0x18f6e6++;}_0x53a570=util[_0x1e7e('0xb')][_0x1e7e('0xc')](util,_0x309831);this[_0x1e7e('0xd')]=_0x53a570;this[_0x1e7e('0xe')]=_0xc77cfc;}module[_0x1e7e('0xf')]=AGIError; \ No newline at end of file +var _0xfc86=['Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0xfc86,0xc7));var _0x6fc8=function(_0x4639d2,_0x41bf0a){_0x4639d2=_0x4639d2-0x0;var _0x5c1f9d=_0xfc86[_0x4639d2];return _0x5c1f9d;};'use strict';var util=require(_0x6fc8('0x0'));var error={'E_AGI_UNDEFINED':_0x6fc8('0x1'),'E_AGI_ARGUMENT_PORT':_0x6fc8('0x2'),'E_AGI_SERVER_ERROR':_0x6fc8('0x3'),'E_AGI_SERVER_CLOSE':_0x6fc8('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x6fc8('0x5'),'E_AGI_SOCKET_ERROR':_0x6fc8('0x6'),'E_AGI_SOCKET_CLOSE':_0x6fc8('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x6fc8('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x6fc8('0x9'),'E_AGI_IVR_ENTRY':_0x6fc8('0xa')};function AGIError(_0x115ced){var _0x115ced=_0x115ced||null,_0x396ab8=_0x396ab8||[],_0x6efa4e=0x1,_0x2c1d50='';if(!error[_0x115ced]){_0x115ced='E_AGI_UNDEFINED';}_0x396ab8[_0x6fc8('0xb')](error[_0x115ced]);while(arguments[_0x6efa4e]){_0x396ab8[_0x6fc8('0xb')](arguments[_0x6efa4e]);_0x6efa4e++;}_0x2c1d50=util[_0x6fc8('0xc')][_0x6fc8('0xd')](util,_0x396ab8);this['message']=_0x2c1d50;this[_0x6fc8('0xe')]=_0x115ced;}module[_0x6fc8('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index a263bfc..58a2011 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 _0x6f7b=['addVertex','vertices','edges','addEdge','push','size','relations','getVertex','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','target','default','vswitch','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','agi','menu','getdigits','numberOfEdges','prototype'];(function(_0x128313,_0x50691d){var _0x77a919=function(_0x320065){while(--_0x320065){_0x128313['push'](_0x128313['shift']());}};_0x77a919(++_0x50691d);}(_0x6f7b,0xbf));var _0xb6f7=function(_0x55a2ef,_0x5948ad){_0x55a2ef=_0x55a2ef-0x0;var _0x1371f1=_0x6f7b[_0x55a2ef];return _0x1371f1;};'use strict';var _=require('lodash');var logger=require('../../../config/logger')(_0xb6f7('0x0'));var verticesWithRetry=[_0xb6f7('0x1'),_0xb6f7('0x2'),'getsecretdigits'];var Graph=function(){this['vertices']={};this['edges']={};this[_0xb6f7('0x3')]=0x0;};Graph[_0xb6f7('0x4')][_0xb6f7('0x5')]=function(_0x552eb9){this[_0xb6f7('0x6')][_0x552eb9['id']]=_0x552eb9;this[_0xb6f7('0x7')][_0x552eb9['id']]=[];};Graph[_0xb6f7('0x4')][_0xb6f7('0x8')]=function(_0x3c26f7,_0x4da8b0,_0xfc1d5){this['edges'][_0x3c26f7][_0xb6f7('0x9')]({'target':_0x4da8b0,'condition':_0xfc1d5});this['numberOfEdges']+=0x1;};Graph[_0xb6f7('0x4')][_0xb6f7('0xa')]=function(){return _['size'](this[_0xb6f7('0x6')]);};Graph['prototype'][_0xb6f7('0xb')]=function(){return this[_0xb6f7('0x3')];};Graph['prototype'][_0xb6f7('0xc')]=function(_0x33a227){return this['vertices'][_0x33a227];};Graph['prototype'][_0xb6f7('0xd')]=function(_0x4608be,_0x21609c){if(!this[_0xb6f7('0x6')][_0x4608be]){return logger[_0xb6f7('0xe')]('no\x20vertex\x20found');}var _0x100ddd=_0x21609c(this[_0xb6f7('0x6')][_0x4608be]);if(!_0x100ddd){return logger[_0xb6f7('0xe')](_0xb6f7('0xf'));}if(this[_0xb6f7('0x7')][_0x4608be][_0xb6f7('0x10')]===0x0){return logger[_0xb6f7('0xe')](_0xb6f7('0x11'));}for(var _0xa689f1=0x0,_0x2465f7=[],_0x493cdc=![];_0xa689f1\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','info','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','evtHangup','mxGraphModel','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','source','target','addEdge','then','catch','createSquareReport','indexOf','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','agicommand','context','extension','priority','code','result','isUndefined','toString','response','agicommand\x20not\x20found','finally','clear','[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','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','port','listening','connection'];(function(_0x4fcd3a,_0x564aea){var _0x5d3ebe=function(_0x5ab420){while(--_0x5ab420){_0x4fcd3a['push'](_0x4fcd3a['shift']());}};_0x5d3ebe(++_0x564aea);}(_0x9892,0x1b3));var _0x2989=function(_0x48ae97,_0x450240){_0x48ae97=_0x48ae97-0x0;var _0x13a62f=_0x9892[_0x48ae97];return _0x13a62f;};'use strict';var parser=require(_0x2989('0x0'));var _=require(_0x2989('0x1'));var syncho=require(_0x2989('0x2'));var util=require(_0x2989('0x3'));var moment=require(_0x2989('0x4'));var config=require(_0x2989('0x5'));var logger=require(_0x2989('0x6'))(_0x2989('0x7'));var utilLicense=require('../../config/license/util');var rpc=require(_0x2989('0x8'));var mailRpc=require('./mailRpc');var Graph=require(_0x2989('0x9'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x2989('0x7')]=_[_0x2989('0xa')](config[_0x2989('0x7')],{'ip':_0x2989('0xb'),'port':0x11dd});function connectionHandler(_0xc7473){process[_0x2989('0xc')](function(){syncho(function(){try{setChannelVariables(_0xc7473);agiHandler(_0xc7473);}catch(_0x5b9917){logger[_0x2989('0xd')](_0x5b9917[_0x2989('0xe')]);}});});}function listeningHandler(){console[_0x2989('0xf')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x2989('0x7')]['port']);logger['info'](util[_0x2989('0x10')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x2989('0x7')]['ip'],config[_0x2989('0x7')]['port']));}function errorHandler(_0xebb5b4){if(_0xebb5b4&&_0xebb5b4['name']&&_0xebb5b4[_0x2989('0x11')]){logger['error'](util[_0x2989('0x10')](_0x2989('0x12'),_0xebb5b4[_0x2989('0x13')],_0xebb5b4[_0x2989('0x11')]));}else{logger[_0x2989('0xd')](util[_0x2989('0x10')]('[ERROR]\x20%s',_0xebb5b4['stack']));}}function closeHandler(){logger['info'](util[_0x2989('0x10')](_0x2989('0x14'),this[_0x2989('0x15')],this[_0x2989('0x16')],this[_0x2989('0x17')],this['dnid'],this[_0x2989('0x18')]));try{createSquareReport(this);}catch(_0x46283c){logger[_0x2989('0xd')](_0x46283c[_0x2989('0xe')]);}}function timeoutHandler(){logger[_0x2989('0x19')](util[_0x2989('0x10')](_0x2989('0x1a'),this[_0x2989('0x15')],this[_0x2989('0x16')],this['callerid'],this['dnid'],this[_0x2989('0x18')]));}function hangupHandler(){logger[_0x2989('0x19')](util[_0x2989('0x10')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x2989('0x15')],this[_0x2989('0x16')],this[_0x2989('0x17')],this[_0x2989('0x1b')],this[_0x2989('0x18')]));this[_0x2989('0x1c')]=!![];}function getRoot(_0x46e44d){return parser['toJson'](_0x46e44d,{'object':!![]})[_0x2989('0x1d')]['root'];}function addVertex(_0xf53cf0,_0x219b8f,_0x1dafc3){_0x219b8f['agicommand']=_0x1dafc3;if(_0x219b8f[_0x2989('0x1e')](_0x2989('0x1f'))){_0x219b8f[_0x2989('0x20')]=parseInt(_0x219b8f[_0x2989('0x1f')],0xa);}_0xf53cf0[_0x2989('0x21')](_[_0x2989('0x22')](_0x219b8f,_0x2989('0x23')));}function initGraph(_0x2ef251,_0x57be1c){var _0x1a7d38=new Graph();for(var _0x4b9d94 in _0x2ef251){if(_0x2ef251['hasOwnProperty'](_0x4b9d94)){if(_['isArray'](_0x2ef251[_0x4b9d94])){for(var _0x56971d=0x0;_0x56971d<_0x2ef251[_0x4b9d94][_0x2989('0x24')];_0x56971d+=0x1){addVertex(_0x1a7d38,_0x2ef251[_0x4b9d94][_0x56971d],_0x4b9d94);}}else{addVertex(_0x1a7d38,_0x2ef251[_0x4b9d94],_0x4b9d94);}}}for(var _0x4fc4fa=0x0;_0x4fc4fa<_0x57be1c[_0x2989('0x24')];_0x4fc4fa+=0x1){if(_0x57be1c[_0x4fc4fa][_0x2989('0x25')]&&_0x57be1c[_0x4fc4fa][_0x2989('0x26')]){_0x1a7d38[_0x2989('0x27')](_0x57be1c[_0x4fc4fa][_0x2989('0x25')],_0x57be1c[_0x4fc4fa][_0x2989('0x26')],_0x57be1c[_0x4fc4fa]['value']);}}return _0x1a7d38;}function getSquareProject(_0x5b9f82,_0x5d6932){rpc['getSquareProject'](_0x5b9f82)[_0x2989('0x28')](function(_0x2da4d5){_0x5d6932(null,_0x2da4d5);})[_0x2989('0x29')](function(_0x119abe){_0x5d6932(null,_0x119abe);});}function createSquareReport(_0x4eee99,_0x20f7c1){rpc[_0x2989('0x2a')](_0x4eee99)[_0x2989('0x28')](function(_0x7ddaee){if(_0x20f7c1){_0x20f7c1(null,_0x7ddaee);}})[_0x2989('0x29')](function(_0x3b4dce){if(_0x20f7c1){_0x20f7c1(null,_0x3b4dce);}});}function setChannelVariables(_0x1908b3){for(var _0x229ee8 in _0x1908b3){if(_0x1908b3[_0x2989('0x1e')](_0x229ee8)){if(_0x229ee8[_0x2989('0x2b')]('agi_')===0x0){_0x1908b3[_0x229ee8[_0x2989('0x2c')](0x4)]=_0x1908b3[_0x229ee8];delete _0x1908b3[_0x229ee8];}}}}function getLogFromObject(_0x5b4aae){return util['inspect'](_0x5b4aae,{'showHidden':![],'depth':null});}function agiHandler(_0x1cb7ad){var _0x47bd33,_0x362e1b,_0x3a6b08,_0xe5aa0a,_0x3846a7;logger[_0x2989('0x2d')]('variables',JSON[_0x2989('0x2e')](_0x1cb7ad,null,0x2));logger[_0x2989('0x19')](util[_0x2989('0x10')](_0x2989('0x2f'),_0x1cb7ad['arg_1'],_0x1cb7ad[_0x2989('0x16')],_0x1cb7ad[_0x2989('0x17')],_0x1cb7ad[_0x2989('0x1b')],_0x1cb7ad[_0x2989('0x18')]));_0x1cb7ad['on'](_0x2989('0xd'),errorHandler);_0x1cb7ad['on'](_0x2989('0x30'),closeHandler);_0x1cb7ad['on'](_0x2989('0x31'),timeoutHandler);_0x1cb7ad[_0x2989('0x1c')]=![];_0x1cb7ad['on'](_0x2989('0x32'),hangupHandler);var _0x44de8f=getSquareProject[_0x2989('0x33')](null,_0x1cb7ad[_0x2989('0x15')]);if(_0x44de8f){if(_0x44de8f[_0x2989('0x34')]){_0x47bd33=getRoot(_0x44de8f['production']);if(_0x47bd33&&_0x47bd33[_0x2989('0x35')]){logger['debug'](_0x2989('0x36'),JSON[_0x2989('0x2e')](_0x47bd33,null,0x2));_0x1cb7ad[_0x2989('0x37')]=moment()[_0x2989('0x10')](_0x2989('0x38'));_0x362e1b=initGraph(_['omit'](_0x47bd33,_0x2989('0x23')),_0x47bd33['mxCell']);_0x3a6b08=new Vertices(_0x1cb7ad,rpc,mailRpc);logger[_0x2989('0x19')](util[_0x2989('0x10')](_0x2989('0x39'),_0x1cb7ad[_0x2989('0x15')],_0x1cb7ad['calleridname'],_0x1cb7ad['callerid'],_0x1cb7ad[_0x2989('0x1b')],_0x1cb7ad[_0x2989('0x18')]));_0x362e1b[_0x2989('0x3a')](_0x47bd33[_0x2989('0x35')]['id'],function(_0x582514){try{_0x582514=_0x3a6b08['clear'](_0x582514);logger['debug'](_0x2989('0x3b'),JSON[_0x2989('0x2e')](_0x582514,null,0x2));if(_0x582514[_0x2989('0x3c')]==='gotoc'){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x1cb7ad['context']=_0x582514['context']||_0x1cb7ad[_0x2989('0x3d')];_0x1cb7ad[_0x2989('0x3e')]=_0x582514[_0x2989('0x3e')];_0x1cb7ad[_0x2989('0x3f')]=_0x582514[_0x2989('0x3f')]?_0x582514[_0x2989('0x3f')]-0x1:0x1;return null;}else if(_0x582514&&_0x3a6b08[_0x582514[_0x2989('0x3c')]]){_0x3846a7=_0x3a6b08[_0x582514[_0x2989('0x3c')]](_0x582514);logger[_0x2989('0x19')]('response',JSON['stringify'](_0x3846a7,null,0x2));if(_0x3846a7&&_0x3846a7[_0x2989('0x40')]===AGI_CODE_SUCCESS&&_0x3846a7[_0x2989('0x41')]!==AGI_RESULT_ERROR&&!_0x1cb7ad[_0x2989('0x1c')]){logger['debug']('response',getLogFromObject(_0x3846a7));return _[_0x2989('0x42')](_0x3846a7['result'])?null:_0x3846a7[_0x2989('0x41')][_0x2989('0x43')]();}else{logger['error'](_0x2989('0x44'),getLogFromObject(_0x3846a7));return null;}}else{logger['error'](_0x2989('0x45'));return null;}}catch(_0x1c150f){logger[_0x2989('0xd')](_0x1c150f[_0x2989('0xe')]);return null;}});if(_0x47bd33[_0x2989('0x46')]){logger['info'](util[_0x2989('0x10')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1cb7ad[_0x2989('0x15')],_0x1cb7ad[_0x2989('0x16')],_0x1cb7ad[_0x2989('0x17')],_0x1cb7ad[_0x2989('0x1b')],_0x1cb7ad[_0x2989('0x18')]));_0x362e1b[_0x2989('0x3a')](_0x47bd33[_0x2989('0x46')]['id'],function(_0xbf2b6a){try{_0xbf2b6a=_0x3a6b08[_0x2989('0x47')](_0xbf2b6a);logger[_0x2989('0x2d')](_0x2989('0x3b'),JSON[_0x2989('0x2e')](_0xbf2b6a,null,0x2));if(_0xbf2b6a&&_0x3a6b08[_0xbf2b6a[_0x2989('0x3c')]]){_0x3846a7=_0x3a6b08[_0xbf2b6a[_0x2989('0x3c')]](_0xbf2b6a);if(_0x3846a7){logger[_0x2989('0x2d')](_0x2989('0x44'),getLogFromObject(_0x3846a7));return _[_0x2989('0x42')](_0x3846a7['result'])?null:_0x3846a7['result'][_0x2989('0x43')]();}else{logger['error'](_0x2989('0x44'),getLogFromObject(_0x3846a7));return null;}}else{logger[_0x2989('0xd')](_0x2989('0x45'));return null;}}catch(_0x1f85b5){logger[_0x2989('0xd')](_0x1f85b5[_0x2989('0xe')]);return null;}});}logger[_0x2989('0x19')](util[_0x2989('0x10')](_0x2989('0x48'),_0x1cb7ad['arg_1'],_0x1cb7ad[_0x2989('0x16')],_0x1cb7ad[_0x2989('0x17')],_0x1cb7ad['dnid'],_0x1cb7ad[_0x2989('0x18')]));logger['info'](util[_0x2989('0x10')](_0x2989('0x49'),_0x1cb7ad[_0x2989('0x3d')],_0x1cb7ad[_0x2989('0x3e')],parseInt(_0x1cb7ad[_0x2989('0x3f')],0xa)+0x1));_0x1cb7ad[_0x2989('0x4a')](_0x1cb7ad[_0x2989('0x3d')],_0x1cb7ad[_0x2989('0x3e')],parseInt(_0x1cb7ad['priority'],0xa)+0x1);_0x1cb7ad[_0x2989('0x30')]();}}else{logger['error'](util[_0x2989('0x10')](_0x2989('0x4b'),_0x1cb7ad[_0x2989('0x15')]));_0x1cb7ad['continueAt'](_0x1cb7ad['context'],_0x1cb7ad[_0x2989('0x3e')],parseInt(_0x1cb7ad[_0x2989('0x3f')],0xa)+0x1);_0x1cb7ad[_0x2989('0x30')]();}}else{logger['error'](util[_0x2989('0x10')]('Project\x20%s\x20not\x20found',_0x1cb7ad['arg_1']));_0x1cb7ad['continueAt'](_0x1cb7ad['context'],_0x1cb7ad[_0x2989('0x3e')],parseInt(_0x1cb7ad[_0x2989('0x3f')],0xa)+0x1);_0x1cb7ad[_0x2989('0x30')]();}}function main(){var _0x3a0ce2;return utilLicense[_0x2989('0x4c')]()['then'](function(_0x2cc73a){if(_0x2cc73a){if(_0x2cc73a[_0x2989('0x4d')]){if(_0x2cc73a[_0x2989('0x4e')]&&_0x2cc73a['callysquare']>0x0){logger[_0x2989('0x19')](util[_0x2989('0x10')](_0x2989('0x4f'),_0x2cc73a['callysquare']));_0x3a0ce2=_0x2cc73a[_0x2989('0x4e')];}else{logger[_0x2989('0x19')](_0x2989('0x50'));}}else{logger['info'](_0x2989('0x51'));_0x3a0ce2=-0x1;}}})[_0x2989('0x29')](function(_0xecf45f){logger['error'](_0x2989('0x52'),_0xecf45f['stack']);})['finally'](function(){var _0x341e20=require(_0x2989('0x53'))(config[_0x2989('0x7')][_0x2989('0x54')],config[_0x2989('0x7')]['ip'],_0x3a0ce2);_0x341e20['on']('error',errorHandler);_0x341e20['on'](_0x2989('0x55'),listeningHandler);_0x341e20['on'](_0x2989('0x56'),connectionHandler);_0x341e20['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x5271=['target','addEdge','getSquareProject','catch','createSquareReport','indexOf','agi_','substring','inspect','variables','stringify','timeout','sync','production','start','debug','joinAt','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','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','close','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','moment','../../config/logger','agi','../../config/license/util','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','stack','log','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','error','[%s]\x20%s','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','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','arg_1','evtHangup','mxGraphModel','root','hasOwnProperty','retry','maxRetry','omit','length','source'];(function(_0x4338d1,_0x25f589){var _0x2b495e=function(_0x5a347e){while(--_0x5a347e){_0x4338d1['push'](_0x4338d1['shift']());}};_0x2b495e(++_0x25f589);}(_0x5271,0xea));var _0x1527=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x5271[_0x20ef64];return _0x3707d8;};'use strict';var parser=require(_0x1527('0x0'));var _=require(_0x1527('0x1'));var syncho=require(_0x1527('0x2'));var util=require(_0x1527('0x3'));var moment=require(_0x1527('0x4'));var config=require('../../config/environment');var logger=require(_0x1527('0x5'))(_0x1527('0x6'));var utilLicense=require(_0x1527('0x7'));var rpc=require('./rpc');var mailRpc=require(_0x1527('0x8'));var Graph=require(_0x1527('0x9'));var Vertices=require(_0x1527('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x1527('0x6')]=_[_0x1527('0xb')](config[_0x1527('0x6')],{'ip':_0x1527('0xc'),'port':0x11dd});function connectionHandler(_0x2df272){process[_0x1527('0xd')](function(){syncho(function(){try{setChannelVariables(_0x2df272);agiHandler(_0x2df272);}catch(_0x31788f){logger['error'](_0x31788f[_0x1527('0xe')]);}});});}function listeningHandler(){console[_0x1527('0xf')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x1527('0x6')][_0x1527('0x10')]);logger['info'](util[_0x1527('0x11')](_0x1527('0x12'),config[_0x1527('0x6')]['ip'],config[_0x1527('0x6')]['port']));}function errorHandler(_0x32286d){if(_0x32286d&&_0x32286d[_0x1527('0x13')]&&_0x32286d[_0x1527('0x14')]){logger[_0x1527('0x15')](util['format'](_0x1527('0x16'),_0x32286d[_0x1527('0x13')],_0x32286d[_0x1527('0x14')]));}else{logger[_0x1527('0x15')](util['format'](_0x1527('0x17'),_0x32286d[_0x1527('0xe')]));}}function closeHandler(){logger[_0x1527('0x18')](util[_0x1527('0x11')](_0x1527('0x19'),this['arg_1'],this[_0x1527('0x1a')],this[_0x1527('0x1b')],this[_0x1527('0x1c')],this[_0x1527('0x1d')]));try{createSquareReport(this);}catch(_0x3a3dcd){logger[_0x1527('0x15')](_0x3a3dcd[_0x1527('0xe')]);}}function timeoutHandler(){logger[_0x1527('0x18')](util['format'](_0x1527('0x1e'),this['arg_1'],this[_0x1527('0x1a')],this['callerid'],this[_0x1527('0x1c')],this[_0x1527('0x1d')]));}function hangupHandler(){logger[_0x1527('0x18')](util[_0x1527('0x11')](_0x1527('0x1f'),this[_0x1527('0x20')],this[_0x1527('0x1a')],this[_0x1527('0x1b')],this[_0x1527('0x1c')],this['uniqueid']));this[_0x1527('0x21')]=!![];}function getRoot(_0x3d562c){return parser['toJson'](_0x3d562c,{'object':!![]})[_0x1527('0x22')][_0x1527('0x23')];}function addVertex(_0x28bc3e,_0x49ef65,_0x28fa2f){_0x49ef65['agicommand']=_0x28fa2f;if(_0x49ef65[_0x1527('0x24')](_0x1527('0x25'))){_0x49ef65[_0x1527('0x26')]=parseInt(_0x49ef65[_0x1527('0x25')],0xa);}_0x28bc3e['addVertex'](_[_0x1527('0x27')](_0x49ef65,'mxCell'));}function initGraph(_0x117bcd,_0x5f11c3){var _0x4674ee=new Graph();for(var _0x3c0128 in _0x117bcd){if(_0x117bcd['hasOwnProperty'](_0x3c0128)){if(_['isArray'](_0x117bcd[_0x3c0128])){for(var _0x373f1f=0x0;_0x373f1f<_0x117bcd[_0x3c0128]['length'];_0x373f1f+=0x1){addVertex(_0x4674ee,_0x117bcd[_0x3c0128][_0x373f1f],_0x3c0128);}}else{addVertex(_0x4674ee,_0x117bcd[_0x3c0128],_0x3c0128);}}}for(var _0x1f0b2b=0x0;_0x1f0b2b<_0x5f11c3[_0x1527('0x28')];_0x1f0b2b+=0x1){if(_0x5f11c3[_0x1f0b2b][_0x1527('0x29')]&&_0x5f11c3[_0x1f0b2b][_0x1527('0x2a')]){_0x4674ee[_0x1527('0x2b')](_0x5f11c3[_0x1f0b2b][_0x1527('0x29')],_0x5f11c3[_0x1f0b2b][_0x1527('0x2a')],_0x5f11c3[_0x1f0b2b]['value']);}}return _0x4674ee;}function getSquareProject(_0x411fbe,_0x34d43d){rpc[_0x1527('0x2c')](_0x411fbe)['then'](function(_0x28844b){_0x34d43d(null,_0x28844b);})[_0x1527('0x2d')](function(_0x23584c){_0x34d43d(null,_0x23584c);});}function createSquareReport(_0x2dc4d9,_0x263abf){rpc[_0x1527('0x2e')](_0x2dc4d9)['then'](function(_0x4c723c){if(_0x263abf){_0x263abf(null,_0x4c723c);}})[_0x1527('0x2d')](function(_0x3ec532){if(_0x263abf){_0x263abf(null,_0x3ec532);}});}function setChannelVariables(_0x3905be){for(var _0x4308a0 in _0x3905be){if(_0x3905be['hasOwnProperty'](_0x4308a0)){if(_0x4308a0[_0x1527('0x2f')](_0x1527('0x30'))===0x0){_0x3905be[_0x4308a0[_0x1527('0x31')](0x4)]=_0x3905be[_0x4308a0];delete _0x3905be[_0x4308a0];}}}}function getLogFromObject(_0x48b39c){return util[_0x1527('0x32')](_0x48b39c,{'showHidden':![],'depth':null});}function agiHandler(_0x1775f4){var _0x112fcf,_0x4cf936,_0x240bc9,_0x1402cd,_0x37b204;logger['debug'](_0x1527('0x33'),JSON[_0x1527('0x34')](_0x1775f4,null,0x2));logger[_0x1527('0x18')](util[_0x1527('0x11')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1775f4[_0x1527('0x20')],_0x1775f4[_0x1527('0x1a')],_0x1775f4[_0x1527('0x1b')],_0x1775f4['dnid'],_0x1775f4[_0x1527('0x1d')]));_0x1775f4['on'](_0x1527('0x15'),errorHandler);_0x1775f4['on']('close',closeHandler);_0x1775f4['on'](_0x1527('0x35'),timeoutHandler);_0x1775f4[_0x1527('0x21')]=![];_0x1775f4['on']('hangup',hangupHandler);var _0x48b4b4=getSquareProject[_0x1527('0x36')](null,_0x1775f4[_0x1527('0x20')]);if(_0x48b4b4){if(_0x48b4b4[_0x1527('0x37')]){_0x112fcf=getRoot(_0x48b4b4[_0x1527('0x37')]);if(_0x112fcf&&_0x112fcf[_0x1527('0x38')]){logger[_0x1527('0x39')](_0x1527('0x23'),JSON[_0x1527('0x34')](_0x112fcf,null,0x2));_0x1775f4[_0x1527('0x3a')]=moment()[_0x1527('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x4cf936=initGraph(_['omit'](_0x112fcf,_0x1527('0x3b')),_0x112fcf[_0x1527('0x3b')]);_0x240bc9=new Vertices(_0x1775f4,rpc,mailRpc);logger[_0x1527('0x18')](util[_0x1527('0x11')](_0x1527('0x3c'),_0x1775f4[_0x1527('0x20')],_0x1775f4['calleridname'],_0x1775f4[_0x1527('0x1b')],_0x1775f4[_0x1527('0x1c')],_0x1775f4[_0x1527('0x1d')]));_0x4cf936[_0x1527('0x3d')](_0x112fcf[_0x1527('0x38')]['id'],function(_0x5e3d0d){try{_0x5e3d0d=_0x240bc9[_0x1527('0x3e')](_0x5e3d0d);logger[_0x1527('0x39')](_0x1527('0x3f'),JSON[_0x1527('0x34')](_0x5e3d0d,null,0x2));if(_0x5e3d0d[_0x1527('0x40')]===_0x1527('0x41')){logger[_0x1527('0x18')](_0x1527('0x42'));_0x1775f4[_0x1527('0x43')]=_0x5e3d0d[_0x1527('0x43')]||_0x1775f4[_0x1527('0x43')];_0x1775f4[_0x1527('0x44')]=_0x5e3d0d[_0x1527('0x44')];_0x1775f4['priority']=_0x5e3d0d['priority']?_0x5e3d0d[_0x1527('0x45')]-0x1:0x1;return null;}else if(_0x5e3d0d&&_0x240bc9[_0x5e3d0d[_0x1527('0x40')]]){_0x37b204=_0x240bc9[_0x5e3d0d[_0x1527('0x40')]](_0x5e3d0d);logger[_0x1527('0x18')](_0x1527('0x46'),JSON[_0x1527('0x34')](_0x37b204,null,0x2));if(_0x37b204&&_0x37b204[_0x1527('0x47')]===AGI_CODE_SUCCESS&&_0x37b204[_0x1527('0x48')]!==AGI_RESULT_ERROR&&!_0x1775f4[_0x1527('0x21')]){logger[_0x1527('0x39')](_0x1527('0x46'),getLogFromObject(_0x37b204));return _[_0x1527('0x49')](_0x37b204['result'])?null:_0x37b204[_0x1527('0x48')][_0x1527('0x4a')]();}else{logger['error']('response',getLogFromObject(_0x37b204));return null;}}else{logger['error'](_0x1527('0x4b'));return null;}}catch(_0x4dd01d){logger[_0x1527('0x15')](_0x4dd01d[_0x1527('0xe')]);return null;}});if(_0x112fcf[_0x1527('0x4c')]){logger[_0x1527('0x18')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1775f4[_0x1527('0x20')],_0x1775f4[_0x1527('0x1a')],_0x1775f4['callerid'],_0x1775f4[_0x1527('0x1c')],_0x1775f4[_0x1527('0x1d')]));_0x4cf936['traverseBFS'](_0x112fcf[_0x1527('0x4c')]['id'],function(_0xcaddab){try{_0xcaddab=_0x240bc9[_0x1527('0x3e')](_0xcaddab);logger['debug'](_0x1527('0x3f'),JSON[_0x1527('0x34')](_0xcaddab,null,0x2));if(_0xcaddab&&_0x240bc9[_0xcaddab[_0x1527('0x40')]]){_0x37b204=_0x240bc9[_0xcaddab[_0x1527('0x40')]](_0xcaddab);if(_0x37b204){logger[_0x1527('0x39')](_0x1527('0x46'),getLogFromObject(_0x37b204));return _[_0x1527('0x49')](_0x37b204['result'])?null:_0x37b204[_0x1527('0x48')][_0x1527('0x4a')]();}else{logger[_0x1527('0x15')]('response',getLogFromObject(_0x37b204));return null;}}else{logger[_0x1527('0x15')]('agicommand\x20not\x20found');return null;}}catch(_0x3ba0e4){logger[_0x1527('0x15')](_0x3ba0e4[_0x1527('0xe')]);return null;}});}logger[_0x1527('0x18')](util[_0x1527('0x11')](_0x1527('0x4d'),_0x1775f4[_0x1527('0x20')],_0x1775f4[_0x1527('0x1a')],_0x1775f4[_0x1527('0x1b')],_0x1775f4['dnid'],_0x1775f4[_0x1527('0x1d')]));logger[_0x1527('0x18')](util['format'](_0x1527('0x4e'),_0x1775f4[_0x1527('0x43')],_0x1775f4[_0x1527('0x44')],parseInt(_0x1775f4['priority'],0xa)+0x1));_0x1775f4['continueAt'](_0x1775f4['context'],_0x1775f4['extension'],parseInt(_0x1775f4[_0x1527('0x45')],0xa)+0x1);_0x1775f4[_0x1527('0x4f')]();}}else{logger[_0x1527('0x15')](util[_0x1527('0x11')](_0x1527('0x50'),_0x1775f4[_0x1527('0x20')]));_0x1775f4[_0x1527('0x51')](_0x1775f4[_0x1527('0x43')],_0x1775f4[_0x1527('0x44')],parseInt(_0x1775f4[_0x1527('0x45')],0xa)+0x1);_0x1775f4[_0x1527('0x4f')]();}}else{logger[_0x1527('0x15')](util[_0x1527('0x11')](_0x1527('0x52'),_0x1775f4['arg_1']));_0x1775f4[_0x1527('0x51')](_0x1775f4[_0x1527('0x43')],_0x1775f4[_0x1527('0x44')],parseInt(_0x1775f4['priority'],0xa)+0x1);_0x1775f4[_0x1527('0x4f')]();}}function main(){var _0x15f1fb;return utilLicense[_0x1527('0x53')]()['then'](function(_0x320fe7){if(_0x320fe7){if(_0x320fe7[_0x1527('0x54')]){if(_0x320fe7[_0x1527('0x55')]&&_0x320fe7[_0x1527('0x55')]>0x0){logger[_0x1527('0x18')](util[_0x1527('0x11')]('[LICENSE]\x20CHANNELS:\x20%s',_0x320fe7[_0x1527('0x55')]));_0x15f1fb=_0x320fe7['callysquare'];}else{logger[_0x1527('0x18')](_0x1527('0x56'));}}else{logger[_0x1527('0x18')](_0x1527('0x57'));_0x15f1fb=-0x1;}}})[_0x1527('0x2d')](function(_0x5008d6){logger[_0x1527('0x15')](_0x1527('0x58'),_0x5008d6[_0x1527('0xe')]);})['finally'](function(){var _0x4bb7b1=require(_0x1527('0x59'))(config[_0x1527('0x6')][_0x1527('0x10')],config['agi']['ip'],_0x15f1fb);_0x4bb7b1['on'](_0x1527('0x15'),errorHandler);_0x4bb7b1['on'](_0x1527('0x5a'),listeningHandler);_0x4bb7b1['on'](_0x1527('0x5b'),connectionHandler);_0x4bb7b1['on'](_0x1527('0x4f'),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 78f4dca..92b8c29 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 _0xc138=['request','then','error','message','catch','sendMailMessage','SendMail','bluebird','jayson/promise','http'];(function(_0x34dc1a,_0x41a261){var _0x217a76=function(_0x44674d){while(--_0x44674d){_0x34dc1a['push'](_0x34dc1a['shift']());}};_0x217a76(++_0x41a261);}(_0xc138,0x147));var _0x8c13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc138[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x8c13('0x0'));var jayson=require(_0x8c13('0x1'));var client=jayson['client'][_0x8c13('0x2')]({'port':0x232b});function request(_0x1ec2ad,_0x36c82c){return new BPromise(function(_0x3c4cf8,_0x52b347){return client[_0x8c13('0x3')](_0x1ec2ad,_0x36c82c)[_0x8c13('0x4')](function(_0x39bad9){if(_0x39bad9['error']){return _0x52b347(_0x39bad9[_0x8c13('0x5')][_0x8c13('0x6')]);}else{return _0x3c4cf8(_0x39bad9['result']);}})[_0x8c13('0x7')](function(_0x504a4c){return _0x52b347(_0x504a4c);});});}exports[_0x8c13('0x8')]=function(_0x4176d4,_0x3dda01){return request(_0x8c13('0x9'),{'account':_0x4176d4,'message':_0x3dda01});}; \ No newline at end of file +var _0xf1e7=['then','message','result','sendMailMessage','SendMail','jayson/promise','client'];(function(_0x593175,_0x4fd3b9){var _0x20fdf1=function(_0x424a8a){while(--_0x424a8a){_0x593175['push'](_0x593175['shift']());}};_0x20fdf1(++_0x4fd3b9);}(_0xf1e7,0x155));var _0x7f1e=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xf1e7[_0x413feb];return _0x40ee88;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x7f1e('0x0'));var client=jayson[_0x7f1e('0x1')]['http']({'port':0x232b});function request(_0x3794d6,_0x429fcd){return new BPromise(function(_0x2b7ab0,_0xc3d6c1){return client['request'](_0x3794d6,_0x429fcd)[_0x7f1e('0x2')](function(_0x531de4){if(_0x531de4['error']){return _0xc3d6c1(_0x531de4['error'][_0x7f1e('0x3')]);}else{return _0x2b7ab0(_0x531de4[_0x7f1e('0x4')]);}})['catch'](function(_0x58afad){return _0xc3d6c1(_0x58afad);});});}exports[_0x7f1e('0x5')]=function(_0x10ed00,_0x13f1cf){return request(_0x7f1e('0x6'),{'account':_0x10ed00,'message':_0x13f1cf});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index f622f0a..b956d95 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 _0xf91d=['stream','Transform','call','_localBuffer','_inBody','inherits','prototype','toString','indexOf','substring','length','split','slice','trim','headers','line','exports','util'];(function(_0x24d76d,_0x435608){var _0x2b909f=function(_0x318aff){while(--_0x318aff){_0x24d76d['push'](_0x24d76d['shift']());}};_0x2b909f(++_0x435608);}(_0xf91d,0x155));var _0xdf91=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xf91d[_0x40a045];return _0x1a687c;};'use strict';var util=require(_0xdf91('0x0'));var Transform=require(_0xdf91('0x1'))[_0xdf91('0x2')];function AGIReply(_0x95d77d){Transform[_0xdf91('0x3')](this,_0x95d77d);this[_0xdf91('0x4')]='';this[_0xdf91('0x5')]=![];}util[_0xdf91('0x6')](AGIReply,Transform);AGIReply[_0xdf91('0x7')]['_transform']=function(_0x9e88e5,_0x293539,_0x224ff8){var _0x487cb8='\x0a',_0x71f381=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x5cc25a=-0x1,_0x482672=-0x1,_0x460774='',_0x40d9eb=0x0,_0x5d710a='',_0x32f329='';this[_0xdf91('0x4')]+=_0x9e88e5[_0xdf91('0x8')]();_0x5d710a=this[_0xdf91('0x4')];if(!this['_inBody']){_0x40d9eb=0x0;while(_0x71f381[_0x40d9eb]){while((_0x482672=_0x5d710a[_0xdf91('0x9')](_0x71f381[_0x40d9eb]))!=-0x1){_0x460774=_0x71f381[_0x40d9eb];_0x32f329=_0x5d710a[_0xdf91('0xa')](0x0,_0x482672);_0x5d710a=_0x5d710a[_0xdf91('0xa')](_0x482672+_0x460774[_0xdf91('0xb')]);var _0x59868e=_0x32f329[_0xdf91('0xc')](_0x487cb8),_0x52646d=0x0,_0x5b7a10={},_0x469cc3='',_0x4bad36='',_0x39a056=-0x1;while(_0x59868e[_0x52646d]){_0x39a056=_0x59868e[_0x52646d][_0xdf91('0x9')](':');if(_0x39a056!=-0x1){_0x469cc3=_0x59868e[_0x52646d][_0xdf91('0xd')](0x0,_0x39a056)[_0xdf91('0xe')]();_0x4bad36=_0x59868e[_0x52646d][_0xdf91('0xd')](_0x39a056+0x1)['trim']();if(_0x469cc3[_0xdf91('0xb')]>0x0){_0x5b7a10[_0x469cc3]=_0x4bad36;}}else{}_0x52646d++;}this['emit'](_0xdf91('0xf'),_0x5b7a10);this['_inBody']=!![];}_0x40d9eb++;}this['_localBuffer']=_0x5d710a;}else{while((_0x5cc25a=_0x5d710a[_0xdf91('0x9')](_0x487cb8))!=-0x1){_0x32f329=_0x5d710a[_0xdf91('0xa')](0x0,_0x5cc25a);this['emit'](_0xdf91('0x10'),_0x32f329);_0x5d710a=_0x5d710a[_0xdf91('0xa')](_0x5cc25a+_0x487cb8[_0xdf91('0xb')]);}this[_0xdf91('0x4')]=_0x5d710a;}_0x224ff8();};module[_0xdf91('0x11')]=AGIReply; \ No newline at end of file +var _0xad5a=['_transform','\x0d\x0a\x0d\x0a','toString','_localBuffer','indexOf','substring','length','split','slice','trim','emit','headers','line','exports','util','stream','Transform','call','_inBody','inherits'];(function(_0x42100a,_0x206948){var _0x4809ec=function(_0x18b560){while(--_0x18b560){_0x42100a['push'](_0x42100a['shift']());}};_0x4809ec(++_0x206948);}(_0xad5a,0x18a));var _0xaad5=function(_0xee1137,_0x37bf0e){_0xee1137=_0xee1137-0x0;var _0x3264b2=_0xad5a[_0xee1137];return _0x3264b2;};'use strict';var util=require(_0xaad5('0x0'));var Transform=require(_0xaad5('0x1'))[_0xaad5('0x2')];function AGIReply(_0x37ebf8){Transform[_0xaad5('0x3')](this,_0x37ebf8);this['_localBuffer']='';this[_0xaad5('0x4')]=![];}util[_0xaad5('0x5')](AGIReply,Transform);AGIReply['prototype'][_0xaad5('0x6')]=function(_0x5e5776,_0x5aa18b,_0x3415ed){var _0xd1aa25='\x0a',_0x307966=['\x0a\x0a',_0xaad5('0x7')],_0x142925=-0x1,_0x4aa5ad=-0x1,_0xbdd3fd='',_0x19f660=0x0,_0x523565='',_0x5428f2='';this['_localBuffer']+=_0x5e5776[_0xaad5('0x8')]();_0x523565=this[_0xaad5('0x9')];if(!this[_0xaad5('0x4')]){_0x19f660=0x0;while(_0x307966[_0x19f660]){while((_0x4aa5ad=_0x523565[_0xaad5('0xa')](_0x307966[_0x19f660]))!=-0x1){_0xbdd3fd=_0x307966[_0x19f660];_0x5428f2=_0x523565[_0xaad5('0xb')](0x0,_0x4aa5ad);_0x523565=_0x523565[_0xaad5('0xb')](_0x4aa5ad+_0xbdd3fd[_0xaad5('0xc')]);var _0x124a7b=_0x5428f2[_0xaad5('0xd')](_0xd1aa25),_0x4d6635=0x0,_0x73512c={},_0x5dea1e='',_0x93deb2='',_0x55ee3d=-0x1;while(_0x124a7b[_0x4d6635]){_0x55ee3d=_0x124a7b[_0x4d6635][_0xaad5('0xa')](':');if(_0x55ee3d!=-0x1){_0x5dea1e=_0x124a7b[_0x4d6635][_0xaad5('0xe')](0x0,_0x55ee3d)[_0xaad5('0xf')]();_0x93deb2=_0x124a7b[_0x4d6635][_0xaad5('0xe')](_0x55ee3d+0x1)[_0xaad5('0xf')]();if(_0x5dea1e[_0xaad5('0xc')]>0x0){_0x73512c[_0x5dea1e]=_0x93deb2;}}else{}_0x4d6635++;}this[_0xaad5('0x10')](_0xaad5('0x11'),_0x73512c);this[_0xaad5('0x4')]=!![];}_0x19f660++;}this[_0xaad5('0x9')]=_0x523565;}else{while((_0x142925=_0x523565[_0xaad5('0xa')](_0xd1aa25))!=-0x1){_0x5428f2=_0x523565[_0xaad5('0xb')](0x0,_0x142925);this[_0xaad5('0x10')](_0xaad5('0x12'),_0x5428f2);_0x523565=_0x523565['substring'](_0x142925+_0xd1aa25[_0xaad5('0xc')]);}this[_0xaad5('0x9')]=_0x523565;}_0x3415ed();};module[_0xaad5('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index f11bb57..86279f9 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 _0xe89a=['getSoundById','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','bluebird','moment','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','email','name','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getTrunkById'];(function(_0x346534,_0x4d51c7){var _0x5d8ee0=function(_0x50a30c){while(--_0x50a30c){_0x346534['push'](_0x346534['shift']());}};_0x5d8ee0(++_0x4d51c7);}(_0xe89a,0x1ef));var _0xae89=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xe89a[_0x1694f5];return _0x5b4321;};'use strict';var BPromise=require(_0xae89('0x0'));var moment=require(_0xae89('0x1'));var _=require('lodash');var util=require('util');var jayson=require(_0xae89('0x2'));var client=jayson[_0xae89('0x3')][_0xae89('0x4')]({'port':0x2329});function request(_0x3223d3,_0x52170c){return new BPromise(function(_0x41779c,_0x46c0c8){return client[_0xae89('0x5')](_0x3223d3,_0x52170c)[_0xae89('0x6')](function(_0x32c3b8){if(_0x32c3b8[_0xae89('0x7')]){return _0x46c0c8(_0x32c3b8[_0xae89('0x7')][_0xae89('0x8')]);}else{return _0x41779c(_0x32c3b8[_0xae89('0x9')]);}})[_0xae89('0xa')](function(_0xd92fca){return _0x46c0c8(_0xd92fca);});});}exports[_0xae89('0xb')]=function(_0x323f78){return request(_0xae89('0xc'),{'options':{'raw':![],'where':{'name':_0x323f78},'attributes':[_0xae89('0xd')]}});};exports[_0xae89('0xe')]=function(_0x116716){return request(_0xae89('0xf'),{'options':{'raw':![],'where':{'id':_0x116716},'include':[{'model':_0xae89('0x10'),'as':_0xae89('0x11')}],'attributes':['id','name',_0xae89('0x12')]}});};exports['getSquareProjectById']=function(_0x419eb0){return request(_0xae89('0xc'),{'options':{'where':{'id':_0x419eb0},'attributes':[_0xae89('0x13')]}});};exports['getVoiceQueueById']=function(_0x262488){return request(_0xae89('0x14'),{'options':{'where':{'id':_0x262488},'attributes':[_0xae89('0x13')]}});};exports['getVariableById']=function(_0x306d67){return request(_0xae89('0x15'),{'options':{'where':{'id':_0x306d67},'attributes':[_0xae89('0x13')]}});};exports[_0xae89('0x16')]=function(_0x93856f){return request(_0xae89('0x17'),{'options':{'where':{'id':_0x93856f},'attributes':['dsn']}});};exports[_0xae89('0x18')]=function(_0x5c4b2d){return request(_0xae89('0x19'),{'options':{'where':{'id':_0x5c4b2d},'attributes':[_0xae89('0x13')]}});};exports[_0xae89('0x1a')]=function(_0x58c33f){return request('ShowTrunk',{'options':{'where':{'id':_0x58c33f},'attributes':[_0xae89('0x13')]}});};exports[_0xae89('0x1b')]=function(_0x32dc49){return request('ShowSound',{'options':{'where':{'id':_0x32dc49},'attributes':[_0xae89('0x1c')]}});};exports[_0xae89('0x1d')]=function(_0x1c0878){return request(_0xae89('0x1e'),{'options':{'raw':![],'where':{'id':_0x1c0878},'include':[{'model':_0xae89('0x1f'),'as':_0xae89('0x20')}]}});};exports[_0xae89('0x21')]=function(_0x3757bf){return request(_0xae89('0x22'),{'options':{'where':{'id':_0x3757bf},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x171690){return request('CreateSmsMessage',{'body':_0x171690});};exports[_0xae89('0x23')]=function(_0x4cb264){return request(_0xae89('0x24'),{'body':_0x4cb264});};exports[_0xae89('0x25')]=function(_0x2810e3){return request(_0xae89('0x26'),{'body':_[_0xae89('0x27')](_0x2810e3,{'project_name':_0x2810e3[_0xae89('0x28')],'prev_project_name':_0x2810e3[_0xae89('0x29')]||'','is_subproject':_0x2810e3[_0xae89('0x29')]?!![]:![],'leaveAt':moment()['format'](_0xae89('0x2a'))})});};exports[_0xae89('0x2b')]=function(_0x9a834e){return request(_0xae89('0x2c'),{'body':_0x9a834e});};exports[_0xae89('0x2d')]=function(_0x4665b4){return request(_0xae89('0x2e'),{'body':_0x4665b4});};exports['createCmContact']=function(_0xbe00d0){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0xbe00d0[_0xae89('0x2f')],'ListId':_0xbe00d0['ListId']}}})[_0xae89('0x6')](function(_0x133c8f){if(_0x133c8f){return _0x133c8f;}return request(_0xae89('0x30'),{'body':_0xbe00d0});});};exports[_0xae89('0x31')]=function(_0x541aa3){return request(_0xae89('0x32'),{'options':{'where':{'id':_0x541aa3},'attributes':[_0xae89('0x13')]}});};exports[_0xae89('0x33')]=function(_0x504550,_0x134dde){return request(_0xae89('0x34'),{'body':{'interface':_0x134dde},'options':{'where':_0x504550}});};exports[_0xae89('0x35')]=function(_0x21c140,_0x3ba810,_0x2db178){return request(_0xae89('0x36'),{'body':{'type':_0x3ba810,'uniqueid':_0x2db178},'options':{'where':_0x21c140}});};exports[_0xae89('0x37')]=function(_0x3ba286){return request('UnpauseUser',{'body':{},'options':{'where':_0x3ba286}});};exports[_0xae89('0x38')]=function(_0x4b2123){return request(_0xae89('0x39'),{'body':{},'options':{'where':_0x4b2123}});}; \ No newline at end of file +var _0xd157=['LoginUser','agentPause','agentUnpause','LogoutUser','bluebird','lodash','util','client','http','request','error','message','result','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','ListId','then','getPauseById','ShowPause','agentLogin'];(function(_0x4e13fe,_0x3643ef){var _0x15bb96=function(_0x384dd2){while(--_0x384dd2){_0x4e13fe['push'](_0x4e13fe['shift']());}};_0x15bb96(++_0x3643ef);}(_0xd157,0xec));var _0x7d15=function(_0x5e0201,_0x2cff3a){_0x5e0201=_0x5e0201-0x0;var _0x5cfa5a=_0xd157[_0x5e0201];return _0x5cfa5a;};'use strict';var BPromise=require(_0x7d15('0x0'));var moment=require('moment');var _=require(_0x7d15('0x1'));var util=require(_0x7d15('0x2'));var jayson=require('jayson/promise');var client=jayson[_0x7d15('0x3')][_0x7d15('0x4')]({'port':0x2329});function request(_0x1e5372,_0x2dc553){return new BPromise(function(_0x574a97,_0x751ee9){return client[_0x7d15('0x5')](_0x1e5372,_0x2dc553)['then'](function(_0x4c273f){if(_0x4c273f[_0x7d15('0x6')]){return _0x751ee9(_0x4c273f['error'][_0x7d15('0x7')]);}else{return _0x574a97(_0x4c273f[_0x7d15('0x8')]);}})['catch'](function(_0x3121ea){return _0x751ee9(_0x3121ea);});});}exports[_0x7d15('0x9')]=function(_0x1ee493){return request(_0x7d15('0xa'),{'options':{'raw':![],'where':{'name':_0x1ee493},'attributes':[_0x7d15('0xb')]}});};exports[_0x7d15('0xc')]=function(_0x198a97){return request(_0x7d15('0xd'),{'options':{'raw':![],'where':{'id':_0x198a97},'include':[{'model':_0x7d15('0xe'),'as':_0x7d15('0xf')}],'attributes':['id',_0x7d15('0x10'),_0x7d15('0x11')]}});};exports['getSquareProjectById']=function(_0x54d279){return request(_0x7d15('0xa'),{'options':{'where':{'id':_0x54d279},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x5417c0){return request(_0x7d15('0x12'),{'options':{'where':{'id':_0x5417c0},'attributes':[_0x7d15('0x10')]}});};exports[_0x7d15('0x13')]=function(_0x1efb79){return request(_0x7d15('0x14'),{'options':{'where':{'id':_0x1efb79},'attributes':[_0x7d15('0x10')]}});};exports[_0x7d15('0x15')]=function(_0x12df2c){return request(_0x7d15('0x16'),{'options':{'where':{'id':_0x12df2c},'attributes':[_0x7d15('0x17')]}});};exports[_0x7d15('0x18')]=function(_0x4c8061){return request('ShowUser',{'options':{'where':{'id':_0x4c8061},'attributes':['name']}});};exports['getTrunkById']=function(_0x5c326d){return request(_0x7d15('0x19'),{'options':{'where':{'id':_0x5c326d},'attributes':['name']}});};exports[_0x7d15('0x1a')]=function(_0x154887){return request(_0x7d15('0x1b'),{'options':{'where':{'id':_0x154887},'attributes':[_0x7d15('0x1c')]}});};exports[_0x7d15('0x1d')]=function(_0x4fcdc1){return request(_0x7d15('0x1e'),{'options':{'raw':![],'where':{'id':_0x4fcdc1},'include':[{'model':_0x7d15('0x1f'),'as':_0x7d15('0x20')}]}});};exports[_0x7d15('0x21')]=function(_0x54a1c3){return request(_0x7d15('0x22'),{'options':{'where':{'id':_0x54a1c3},'attributes':['id',_0x7d15('0x10')]}});};exports[_0x7d15('0x23')]=function(_0x5c361d){return request(_0x7d15('0x24'),{'body':_0x5c361d});};exports[_0x7d15('0x25')]=function(_0x211b92){return request('CreateSquareDetailsReport',{'body':_0x211b92});};exports[_0x7d15('0x26')]=function(_0x3cd2a0){return request('CreateSquareReport',{'body':_[_0x7d15('0x27')](_0x3cd2a0,{'project_name':_0x3cd2a0[_0x7d15('0x28')],'prev_project_name':_0x3cd2a0[_0x7d15('0x29')]||'','is_subproject':_0x3cd2a0[_0x7d15('0x29')]?!![]:![],'leaveAt':moment()[_0x7d15('0x2a')](_0x7d15('0x2b'))})});};exports[_0x7d15('0x2c')]=function(_0x5e3f06){return request('CreateSquareRecording',{'body':_0x5e3f06});};exports[_0x7d15('0x2d')]=function(_0x1c2617){return request(_0x7d15('0x2e'),{'body':_0x1c2617});};exports['createCmContact']=function(_0xf32243){return request(_0x7d15('0x2f'),{'options':{'raw':![],'where':{'phone':_0xf32243[_0x7d15('0x30')],'ListId':_0xf32243[_0x7d15('0x31')]}}})[_0x7d15('0x32')](function(_0x4fc7c0){if(_0x4fc7c0){return _0x4fc7c0;}return request('CreateCmContact',{'body':_0xf32243});});};exports[_0x7d15('0x33')]=function(_0x258023){return request(_0x7d15('0x34'),{'options':{'where':{'id':_0x258023},'attributes':['name']}});};exports[_0x7d15('0x35')]=function(_0x33b519,_0x32c02a){return request(_0x7d15('0x36'),{'body':{'interface':_0x32c02a},'options':{'where':_0x33b519}});};exports[_0x7d15('0x37')]=function(_0x5e9ac2,_0x21367a,_0x1658d0){return request('PauseUser',{'body':{'type':_0x21367a,'uniqueid':_0x1658d0},'options':{'where':_0x5e9ac2}});};exports[_0x7d15('0x38')]=function(_0x446ba9){return request('UnpauseUser',{'body':{},'options':{'where':_0x446ba9}});};exports['agentLogout']=function(_0x10e10d){return request(_0x7d15('0x39'),{'body':{},'options':{'where':_0x10e10d}});}; \ 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 1e20a0c..b191030 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 _0xf1c6=['exports'];(function(_0x4daa74,_0x45c38a){var _0x305e2a=function(_0x160956){while(--_0x160956){_0x4daa74['push'](_0x4daa74['shift']());}};_0x305e2a(++_0x45c38a);}(_0xf1c6,0x145));var _0x6f1c=function(_0x337c88,_0x113a6a){_0x337c88=_0x337c88-0x0;var _0x45e9b8=_0xf1c6[_0x337c88];return _0x45e9b8;};var polly=require('./polly');var lex=require('./lex');module[_0x6f1c('0x0')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x6347=['./lex','./polly'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x6347,0x1c9));var _0x7634=function(_0x1ce127,_0x45f404){_0x1ce127=_0x1ce127-0x0;var _0x37fd9f=_0x6347[_0x1ce127];return _0x37fd9f;};var polly=require(_0x7634('0x0'));var lex=require(_0x7634('0x1'));module['exports']={'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 91b170a..85e2722 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 _0xd64b=['./lib/api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd64b,0xc1));var _0xbd64=function(_0x31ade7,_0x4a2dab){_0x31ade7=_0x31ade7-0x0;var _0x1b20ad=_0xd64b[_0x31ade7];return _0x1b20ad;};'use strict';var lex=require(_0xbd64('0x0'));module['exports']=function(_0xf0de04,_0x4bfb7c,_0x30b9b3,_0xcbecd5,_0x64bd3b,_0x3f1f05){return lex(_0xf0de04,_0x4bfb7c,_0x30b9b3,_0xcbecd5,_0x64bd3b,_0x3f1f05);}; \ No newline at end of file +var _0xa9e0=['exports','./lib/api'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var lex=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]=function(_0x29929c,_0x5dd881,_0x550fbc,_0x18d5c9,_0x4ce2f1,_0x333808){return lex(_0x29929c,_0x5dd881,_0x550fbc,_0x18d5c9,_0x4ce2f1,_0x333808);}; \ 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 4d1cb42..b4ef8fd 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(_0xed99ea,_0x192231){var _0x5d4da1=function(_0x1a392c){while(--_0x1a392c){_0xed99ea['push'](_0xed99ea['shift']());}};_0x5d4da1(++_0x192231);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(_0x2e73cc,_0x416f2b){var _0x105034=function(_0x47fcab){while(--_0x47fcab){_0x2e73cc['push'](_0x2e73cc['shift']());}};_0x105034(++_0x416f2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 69b99f4..a598896 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 _0x0bee=['./lib/api','exports'];(function(_0x470afe,_0xf0475){var _0x10e28a=function(_0x224f54){while(--_0x224f54){_0x470afe['push'](_0x470afe['shift']());}};_0x10e28a(++_0xf0475);}(_0x0bee,0x12a));var _0xe0be=function(_0x1b5ffc,_0x430ef5){_0x1b5ffc=_0x1b5ffc-0x0;var _0x1c4f5f=_0x0bee[_0x1b5ffc];return _0x1c4f5f;};'use strict';var polly=require(_0xe0be('0x0'));module[_0xe0be('0x1')]=function(_0x54956f,_0x12ffa7,_0x31b049,_0x5621ae,_0x12edb8,_0x165624,_0x836724){return polly(_0x54956f,_0x12ffa7,_0x31b049,_0x5621ae,_0x12edb8,_0x165624,_0x836724);}; \ No newline at end of file +var _0x53b3=['./lib/api','exports'];(function(_0x1bec0d,_0x338db4){var _0x49e3e3=function(_0x372c7a){while(--_0x372c7a){_0x1bec0d['push'](_0x1bec0d['shift']());}};_0x49e3e3(++_0x338db4);}(_0x53b3,0xbc));var _0x353b=function(_0x1c6089,_0x3816e2){_0x1c6089=_0x1c6089-0x0;var _0x4d97c1=_0x53b3[_0x1c6089];return _0x4d97c1;};'use strict';var polly=require(_0x353b('0x0'));module[_0x353b('0x1')]=function(_0xf99f7b,_0xcfa6b,_0x23fe16,_0x5c3cb9,_0x19649c,_0x10af0e,_0x32722e){return polly(_0xf99f7b,_0xcfa6b,_0x23fe16,_0x5c3cb9,_0x19649c,_0x10af0e,_0x32722e);}; \ 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 ecbd4fe..50810f1 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 _0x9af0=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile'];(function(_0x2e132f,_0x4f036f){var _0x32257c=function(_0x1d599b){while(--_0x1d599b){_0x2e132f['push'](_0x2e132f['shift']());}};_0x32257c(++_0x4f036f);}(_0x9af0,0x13a));var _0x09af=function(_0x58fee3,_0x46e7e5){_0x58fee3=_0x58fee3-0x0;var _0x404cfa=_0x9af0[_0x58fee3];return _0x404cfa;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x09af('0x0'));var rs=require(_0x09af('0x1'));var AWS=require(_0x09af('0x2'));function pollyResult(_0x21296c,_0x4a40b0,_0x33a664){return new BPromise(function(_0x211cfc,_0xa38ee8){_0x21296c[_0x09af('0x3')](_0x4a40b0,function(_0x390a33,_0x23c18e){if(_0x390a33){_0xa38ee8(_0x390a33);}else if(_0x23c18e){if(_0x23c18e[_0x09af('0x4')]instanceof Buffer){fs[_0x09af('0x5')](_0x33a664,_0x23c18e[_0x09af('0x4')],function(_0x304074){if(_0x304074){_0xa38ee8(_0x304074);}else{_0x211cfc();}});}else{_0xa38ee8(new Error(_0x09af('0x6')));}}else{_0xa38ee8(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x09af('0x7')]=function(_0x5a20bc,_0x2eb651,_0x5afe2d,_0xcf0a73,_0x27afed,_0x3dc999,_0x58ad35){var _0x15ace6=new AWS[(_0x09af('0x8'))]({'accessKeyId':_0x5a20bc,'secretAccessKey':_0x2eb651,'region':_0x5afe2d});var _0x1b78c2={'Text':_0x27afed,'TextType':_0x3dc999||_0x09af('0x9'),'OutputFormat':'mp3','VoiceId':_0xcf0a73};return pollyResult(_0x15ace6,_0x1b78c2,_0x58ad35);}; \ No newline at end of file +var _0x2ccf=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','aws-sdk','synthesizeSpeech','AudioStream'];(function(_0x5b0e16,_0x40b866){var _0x95f9bf=function(_0x19d8cc){while(--_0x19d8cc){_0x5b0e16['push'](_0x5b0e16['shift']());}};_0x95f9bf(++_0x40b866);}(_0x2ccf,0x15b));var _0xf2cc=function(_0x5f5b02,_0x5b03ee){_0x5f5b02=_0x5f5b02-0x0;var _0x135b4f=_0x2ccf[_0x5f5b02];return _0x135b4f;};'use strict';var fs=require('fs');var path=require(_0xf2cc('0x0'));var BPromise=require(_0xf2cc('0x1'));var rs=require('randomstring');var AWS=require(_0xf2cc('0x2'));function pollyResult(_0x5a8498,_0x3d5429,_0x4a494c){return new BPromise(function(_0x2d4e36,_0x1fbf5e){_0x5a8498[_0xf2cc('0x3')](_0x3d5429,function(_0xdf0866,_0x119138){if(_0xdf0866){_0x1fbf5e(_0xdf0866);}else if(_0x119138){if(_0x119138[_0xf2cc('0x4')]instanceof Buffer){fs[_0xf2cc('0x5')](_0x4a494c,_0x119138[_0xf2cc('0x4')],function(_0xf5253e){if(_0xf5253e){_0x1fbf5e(_0xf5253e);}else{_0x2d4e36();}});}else{_0x1fbf5e(new Error(_0xf2cc('0x6')));}}else{_0x1fbf5e(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xf2cc('0x7')]=function(_0x1f954e,_0x349a42,_0x117ddd,_0x41fce0,_0x55e8be,_0x3a4188,_0x5a8040){var _0x1ba3f2=new AWS[(_0xf2cc('0x8'))]({'accessKeyId':_0x1f954e,'secretAccessKey':_0x349a42,'region':_0x117ddd});var _0x29d17f={'Text':_0x55e8be,'TextType':_0x3a4188||_0xf2cc('0x9'),'OutputFormat':_0xf2cc('0xa'),'VoiceId':_0x41fce0};return pollyResult(_0x1ba3f2,_0x29d17f,_0x5a8040);}; \ 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 da28497..7b67437 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x25a4b9,_0x5b3727,_0x5e2b61,_0x52a375){return asr(_0x25a4b9,_0x5b3727,_0x5e2b61);}; \ No newline at end of file +var _0x6063=['exports','./lib/api'];(function(_0x549996,_0xd04634){var _0x4de5d1=function(_0x1883a7){while(--_0x1883a7){_0x549996['push'](_0x549996['shift']());}};_0x4de5d1(++_0xd04634);}(_0x6063,0x157));var _0x3606=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x6063[_0x42cae2];return _0x5f256f;};'use strict';var asr=require(_0x3606('0x0'));module[_0x3606('0x1')]=function(_0x383bc3,_0x2fc13a,_0x351c4e,_0x416675){return asr(_0x383bc3,_0x2fc13a,_0x351c4e);}; \ 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 7d248ad..6e7f0c0 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 _0x9099=['https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','base64','POST','/v1/speech:recognize?key=','LINEAR16','url'];(function(_0x4bd83e,_0x1e40c0){var _0x185ed3=function(_0x357601){while(--_0x357601){_0x4bd83e['push'](_0x4bd83e['shift']());}};_0x185ed3(++_0x1e40c0);}(_0x9099,0x1ac));var _0x9909=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x9099[_0x47a7d0];return _0xb9bd08;};'use strict';var url=require(_0x9909('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x9909('0x1');module[_0x9909('0x2')]=function(_0x38e636,_0x2524d3,_0x3fd4b4){return new BPromise(function(_0x34aabc,_0x2168ff){var _0x6eb0ac;if(typeof _0x38e636!==_0x9909('0x3')||_0x38e636[_0x9909('0x4')]===0x0){return _0x2168ff(_0x9909('0x5'));}if(typeof _0x2524d3!==_0x9909('0x3')||_0x2524d3[_0x9909('0x4')]===0x0){return _0x2168ff(_0x9909('0x6'));}if(typeof _0x3fd4b4!=='undefined'&&(typeof _0x3fd4b4!==_0x9909('0x3')||_0x3fd4b4['length']===0x0)){return _0x2168ff('lang\x20should\x20be\x20a\x20string');}try{_0x6eb0ac=fs['readFileSync'](_0x38e636)['toString'](_0x9909('0x7'));}catch(_0x592725){return _0x2168ff(_0x592725);}return _0x34aabc({'method':_0x9909('0x8'),'uri':host+_0x9909('0x9')+_0x2524d3,'body':{'config':{'encoding':_0x9909('0xa'),'sampleRateHertz':'8000','languageCode':_0x3fd4b4},'audio':{'content':_0x6eb0ac}},'json':!![]});});}; \ No newline at end of file +var _0x8ce3=['url','bluebird','exports','string','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','POST','/v1/speech:recognize?key=','LINEAR16','8000'];(function(_0xf09d6f,_0x1d9834){var _0x3742fa=function(_0x1ba17e){while(--_0x1ba17e){_0xf09d6f['push'](_0xf09d6f['shift']());}};_0x3742fa(++_0x1d9834);}(_0x8ce3,0xc3));var _0x38ce=function(_0x404992,_0x58aca1){_0x404992=_0x404992-0x0;var _0x384bae=_0x8ce3[_0x404992];return _0x384bae;};'use strict';var url=require(_0x38ce('0x0'));var BPromise=require(_0x38ce('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x38ce('0x2')]=function(_0x2b99b0,_0xee1d0e,_0x26ec48){return new BPromise(function(_0x1b4dd4,_0x17b96d){var _0x1efae3;if(typeof _0x2b99b0!==_0x38ce('0x3')||_0x2b99b0['length']===0x0){return _0x17b96d(_0x38ce('0x4'));}if(typeof _0xee1d0e!==_0x38ce('0x3')||_0xee1d0e['length']===0x0){return _0x17b96d(_0x38ce('0x5'));}if(typeof _0x26ec48!==_0x38ce('0x6')&&(typeof _0x26ec48!==_0x38ce('0x3')||_0x26ec48['length']===0x0)){return _0x17b96d(_0x38ce('0x7'));}try{_0x1efae3=fs['readFileSync'](_0x2b99b0)[_0x38ce('0x8')]('base64');}catch(_0x133bd5){return _0x17b96d(_0x133bd5);}return _0x1b4dd4({'method':_0x38ce('0x9'),'uri':host+_0x38ce('0xa')+_0xee1d0e,'body':{'config':{'encoding':_0x38ce('0xb'),'sampleRateHertz':_0x38ce('0xc'),'languageCode':_0x26ec48},'audio':{'content':_0x1efae3}},'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 133aa2f..408da3f 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 _0x4b9f=['exports','./asr'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x4b9f,0x121));var _0xf4b9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4b9f[_0x17d9e3];return _0x14192d;};var asr=require(_0xf4b9('0x0'));module[_0xf4b9('0x1')]={'asr':asr}; \ No newline at end of file +var _0xc142=['exports','./asr'];(function(_0x48ca00,_0x2f2886){var _0x3f17d3=function(_0x41204b){while(--_0x41204b){_0x48ca00['push'](_0x48ca00['shift']());}};_0x3f17d3(++_0x2f2886);}(_0xc142,0x1dd));var _0x2c14=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc142[_0x3dd15e];return _0x231fd0;};var asr=require(_0x2c14('0x0'));module[_0x2c14('0x1')]={'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 97a71fb..69fff42 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 _0xd2bc=['googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','textRequest','result','source','actionIncomplete','fulfillment','speech','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','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','freeform=3','sestekNDA','nda','text','channelData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','https','md5','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./sestek','agi','protocol','host','path','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','info','finish\x20download\x20file','close','unlink','pipe','end','https:','transcode','error\x20convert','finish\x20to\x20convert','base64','777','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','resolve','generate','.mp3','writeFile','chmodSync','then','.wav','googleCloudTTS\x20path','split','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','tmp','goggleTTS\x20path'];(function(_0x3732e1,_0x304dc1){var _0x51e120=function(_0x33c129){while(--_0x33c129){_0x3732e1['push'](_0x3732e1['shift']());}};_0x51e120(++_0x304dc1);}(_0xd2bc,0xd0));var _0xcd2b=function(_0x107ca9,_0x26e2c7){_0x107ca9=_0x107ca9-0x0;var _0x56ec3f=_0xd2bc[_0x107ca9];return _0x56ec3f;};'use strict';var apiai=require(_0xcd2b('0x0'));var BPromise=require(_0xcd2b('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xcd2b('0x2'));var https=require(_0xcd2b('0x3'));var md5=require(_0xcd2b('0x4'));var path=require('path');var querystring=require(_0xcd2b('0x5'));var rp=require(_0xcd2b('0x6'));var rs=require(_0xcd2b('0x7'));var sox=require(_0xcd2b('0x8'));var tts=require(_0xcd2b('0x9'));var urlParse=require(_0xcd2b('0xa'))[_0xcd2b('0xb')];var util=require(_0xcd2b('0xc'));var aws=require(_0xcd2b('0xd'));var google=require('./google');var sestek=require(_0xcd2b('0xe'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0xcd2b('0xf'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x195713,_0xd286c2){return new BPromise(function(_0x4dbe42,_0x19ad4d){var _0x20bb85=urlParse(_0x195713);var _0x577b5b=_0x20bb85[_0xcd2b('0x10')]==='https:'?https:http;var _0x428075={'host':_0x20bb85[_0xcd2b('0x11')],'path':_0x20bb85[_0xcd2b('0x12')],'headers':{'user-agent':_0xcd2b('0x13')}};_0x577b5b[_0xcd2b('0x14')](_0x428075,function(_0x24f7a1){if(_0x24f7a1[_0xcd2b('0x15')]!==0xc8){logger[_0xcd2b('0x16')]('request\x20to\x20'+_0x195713+_0xcd2b('0x17')+_0x24f7a1[_0xcd2b('0x15')]+'\x20('+_0x24f7a1[_0xcd2b('0x18')]+')');_0x19ad4d(new Error(_0xcd2b('0x19')+_0x195713+_0xcd2b('0x17')+_0x24f7a1[_0xcd2b('0x15')]+'\x20('+_0x24f7a1['statusMessage']+')'));return;}var _0x1e4e03=fs[_0xcd2b('0x1a')](_0xd286c2);_0x1e4e03['on']('finish',function(){logger[_0xcd2b('0x1b')](_0xcd2b('0x1c'));_0x1e4e03[_0xcd2b('0x1d')](_0x4dbe42);});_0x1e4e03['on']('error',function(_0x4ecbb2){fs[_0xcd2b('0x1e')](_0xd286c2);logger[_0xcd2b('0x16')]('download\x20error',_0x4ecbb2);_0x19ad4d(_0x4ecbb2);});_0x24f7a1[_0xcd2b('0x1f')](_0x1e4e03);})['on'](_0xcd2b('0x16'),function(_0xd8aff1){logger['error'](_0xd8aff1);_0x19ad4d(_0xd8aff1);})[_0xcd2b('0x20')]();});}function uploadFile(_0x590842){return new BPromise(function(_0x50b462,_0x1427a6){var _0x335e49=urlParse(_0x590842);var _0x292ba7=_0x335e49[_0xcd2b('0x10')]===_0xcd2b('0x21')?https:http;var _0x1f531b={'host':_0x335e49[_0xcd2b('0x11')],'path':_0x335e49['path'],'headers':{'user-agent':_0xcd2b('0x13')}};_0x292ba7[_0xcd2b('0x14')](_0x1f531b,function(_0x513e9c){if(_0x513e9c[_0xcd2b('0x15')]!==0xc8){_0x1427a6(new Error('request\x20to\x20'+_0x590842+_0xcd2b('0x17')+_0x513e9c[_0xcd2b('0x15')]+'\x20('+_0x513e9c[_0xcd2b('0x18')]+')'));return;}var _0x26362b='';_0x513e9c['on']('data',function(_0x1f7312){_0x26362b+=_0x1f7312;});_0x513e9c['on'](_0xcd2b('0x20'),function(){_0x50b462(_0x26362b);});})['on'](_0xcd2b('0x16'),function(_0x1c5be4){_0x1427a6(_0x1c5be4);})[_0xcd2b('0x20')]();});}function convertFile(_0x1ac755,_0x5f538c){return new BPromise(function(_0x33dbd8,_0x44df34){var _0x27e31a=sox[_0xcd2b('0x22')](_0x1ac755,_0x5f538c,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x27e31a['on']('error',function(_0x2b4a75){logger[_0xcd2b('0x16')](_0xcd2b('0x23'),_0x2b4a75);_0x44df34(_0x2b4a75);});_0x27e31a['on'](_0xcd2b('0x20'),function(){logger['info'](_0xcd2b('0x24'));_0x33dbd8();});_0x27e31a['start']();});}function base64Decode(_0x43cdbb,_0x8fae8c){var _0x3a8632=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+'.wav');fs['writeFileSync'](_0x3a8632,_0x43cdbb,_0xcd2b('0x25'));return convertFile(_0x3a8632,_0x8fae8c)['then'](function(){try{fs['unlink'](_0x3a8632);fs['chmodSync'](_0x8fae8c,_0xcd2b('0x26'));}catch(_0x385787){logger['error'](_0x385787);}return _0x8fae8c['split']('.')[0x0];});}function base64Encode(_0x37c810){var _0x577a96=fs[_0xcd2b('0x27')](_0x37c810);return new Buffer(_0x577a96)[_0xcd2b('0x28')](_0xcd2b('0x25'));}exports['googleCloudTTS']=function(_0x324814,_0x3d39a4,_0x1f0f7c,_0xfc1365,_0x4cea87,_0x530c7a){var _0x42c2f7,_0x5a2790;var _0x4be6a7=_0xcd2b('0x29');var _0x2b8fa7=_0xcd2b('0x2a')+_0x324814;var _0x273cd5={};if(_0x3d39a4===_0xcd2b('0x2b')){_0x273cd5[_0xcd2b('0x2c')]={'ssml':_0x1f0f7c};}else{_0x273cd5[_0xcd2b('0x2c')]={'text':_0x1f0f7c};};_0x273cd5[_0xcd2b('0x2d')]={'languageCode':_0xfc1365,'ssmlGender':_0x4cea87};_0x273cd5[_0xcd2b('0x2e')]={'audioEncoding':_0xcd2b('0x2f'),'sampleRateHertz':0x1f40};var _0x235f48={'url':_0x4be6a7+_0xcd2b('0x30')+_0x2b8fa7,'method':'POST','json':!![],'body':_0x273cd5};return rp(_0x235f48)['then'](function(_0x4ef04f){return new BPromise(function(_0x5f51e5,_0x228b9b){_0x42c2f7=path[_0xcd2b('0x31')](__dirname,'tmp',rs[_0xcd2b('0x32')](0x4)+_0xcd2b('0x33'));var _0x2f6baf=Buffer['from'](_0x4ef04f['audioContent'],_0xcd2b('0x25'));return fs[_0xcd2b('0x34')](_0x42c2f7,_0x2f6baf,function(_0x245113){_0x228b9b(_0x245113);},function(_0x4fdc18){fs[_0xcd2b('0x35')](_0x42c2f7,_0xcd2b('0x26'));_0x5f51e5(_0x4fdc18);});});})[_0xcd2b('0x36')](function(_0x5e68d2){_0x5a2790=path[_0xcd2b('0x31')](__dirname,'tmp',rs['generate'](0x4)+_0xcd2b('0x37'));return convertFile(_0x42c2f7,_0x5a2790);})[_0xcd2b('0x36')](function(){try{fs[_0xcd2b('0x1e')](_0x42c2f7);fs[_0xcd2b('0x35')](_0x5a2790,_0xcd2b('0x26'));}catch(_0x2e55f9){logger['error'](_0x2e55f9);}logger[_0xcd2b('0x1b')](_0xcd2b('0x38'),_0x5a2790[_0xcd2b('0x39')]('.')[0x0]);return _0x5a2790[_0xcd2b('0x39')]('.')[0x0];});};exports['googleTTS']=function(_0x2e4131,_0xe7e51e){var _0x274f07=_0xcd2b('0x3a');var _0x597cd1,_0x49aa36;var _0x568ebb;var _0x2512cb={'encoding':_0xcd2b('0x3b'),'method':_0xcd2b('0x3c'),'timeout':0x2710,'url':_0x274f07,'headers':{'Content-Type':_0xcd2b('0x3d')},'body':_0xcd2b('0x3e')+encodeURIComponent(JSON[_0xcd2b('0x3f')]([[[_0xcd2b('0x40'),JSON['stringify']([_0x2e4131,_0xe7e51e||'en',![],_0xcd2b('0x41')]),null,_0xcd2b('0x42')]]]))};return rp(_0x2512cb)[_0xcd2b('0x36')](function(_0x458188){try{_0x568ebb=eval(_0x458188[_0xcd2b('0x43')](0x5))[0x0][0x2];}catch(_0x789878){throw new Error(_0xcd2b('0x44')+_0x458188['data']);}if(!_0x568ebb){if(_0x2e4131[_0xcd2b('0x45')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xcd2b('0x46')+_0xe7e51e+_0xcd2b('0x47'));}}try{_0x568ebb=eval(_0x568ebb)[0x0];}catch(_0x559efb){throw new Error(_0xcd2b('0x44')+res['data']);}const _0x3f8467=_0x568ebb;_0x597cd1=path[_0xcd2b('0x31')](__dirname,_0xcd2b('0x48'),rs[_0xcd2b('0x32')](0x4)+_0xcd2b('0x33'));fs['writeFileSync'](_0x597cd1,_0x568ebb,{'encoding':_0xcd2b('0x25')});_0x49aa36=path[_0xcd2b('0x31')](__dirname,'tmp',rs[_0xcd2b('0x32')](0x4)+_0xcd2b('0x37'));return convertFile(_0x597cd1,_0x49aa36);})['then'](function(){try{fs[_0xcd2b('0x1e')](_0x597cd1);fs[_0xcd2b('0x35')](_0x49aa36,_0xcd2b('0x26'));}catch(_0x52b04f){logger[_0xcd2b('0x16')](_0x52b04f);}logger[_0xcd2b('0x1b')](_0xcd2b('0x49'),_0x49aa36['split']('.')[0x0]);return _0x49aa36[_0xcd2b('0x39')]('.')[0x0];});};exports[_0xcd2b('0x4a')]=function(_0x5c54f8,_0x1e06f0,_0x5251bc){return google[_0xcd2b('0x4b')](_0x5c54f8,_0x1e06f0,_0x5251bc)[_0xcd2b('0x36')](function(_0x1c81d7){logger[_0xcd2b('0x1b')](_0x1c81d7[_0xcd2b('0x4c')]);return rp(_0x1c81d7);})[_0xcd2b('0x36')](function(_0x31a668){var _0x591c48='';var _0x4db98d=0x0;try{fs[_0xcd2b('0x1e')](_0x5c54f8);}catch(_0x255457){logger[_0xcd2b('0x16')](_0x255457);}if(_0x31a668&&_0x31a668[_0xcd2b('0x4d')]){_0x591c48=_0x31a668['results'][_0xcd2b('0x4e')](function(_0x46a962){return _0x46a962&&_0x46a962[_0xcd2b('0x4f')][0x0]&&_0x46a962['alternatives'][0x0][_0xcd2b('0x50')]?_0x46a962['alternatives'][0x0]['transcript']:'';})[_0xcd2b('0x51')]('\x0a');_0x4db98d=_0x31a668['results'][_0xcd2b('0x4e')](function(_0x5488e5){return _0x5488e5&&_0x5488e5[_0xcd2b('0x4f')][0x0]&&_0x5488e5[_0xcd2b('0x4f')][0x0][_0xcd2b('0x52')]?_0x5488e5['alternatives'][0x0][_0xcd2b('0x52')]:0x0;})[_0xcd2b('0x51')]('\x0a');}logger['info'](_0xcd2b('0x53'),_0x591c48);logger[_0xcd2b('0x1b')](_0xcd2b('0x54'),_0x4db98d);return{'transcript':_0x591c48,'confidence':_0x4db98d};})[_0xcd2b('0x55')](function(_0x45a5b9){logger['error']('[%s]\x20%s:%s',_0x45a5b9[_0xcd2b('0x15')],_0x45a5b9[_0xcd2b('0x56')],_0x45a5b9[_0xcd2b('0x57')]);});};exports[_0xcd2b('0x58')]=function(_0x150bca,_0x18ef5f,_0x32e998,_0x430a60){var _0x2c0bf1=apiai(_0x18ef5f,{'language':_0x430a60||'en'});return _0x2c0bf1[_0xcd2b('0x59')](_0x32e998,{'sessionId':md5(_0x150bca)})[_0xcd2b('0x36')](function(_0x2021bf){logger[_0xcd2b('0x1b')](JSON[_0xcd2b('0x3f')](_0x2021bf));return{'source':_0x2021bf[_0xcd2b('0x5a')][_0xcd2b('0x5b')],'resolvedQuery':_0x2021bf['result']['resolvedQuery'],'action':_0x2021bf[_0xcd2b('0x5a')]['action'],'actionIncomplete':_0x2021bf[_0xcd2b('0x5a')][_0xcd2b('0x5c')],'speech':_0x2021bf[_0xcd2b('0x5a')][_0xcd2b('0x5d')][_0xcd2b('0x5e')],'score':_0x2021bf[_0xcd2b('0x5a')]['score'],'statusCode':_0x2021bf[_0xcd2b('0x5f')][_0xcd2b('0x60')],'endConversation':_0x2021bf[_0xcd2b('0x5a')][_0xcd2b('0x61')][_0xcd2b('0x62')]||![],'isFallbackIntent':_0x2021bf[_0xcd2b('0x5a')][_0xcd2b('0x61')][_0xcd2b('0x63')]};});};exports[_0xcd2b('0x64')]=function(_0x1f3da3,_0x528683,_0x33e611,_0x17fb57,_0x43479f,_0x4a84eb){var _0x37fc1d=_0x17fb57[_0xcd2b('0x65')](/\\n/g,'\x0a');var _0x2338ec={'credentials':{'private_key':_0x37fc1d,'client_email':_0x33e611}};var _0x1712f7=new dialogflow[(_0xcd2b('0x66'))](_0x2338ec);var _0x5caad6=_0x1712f7[_0xcd2b('0x67')](_0x528683,md5(_0x1f3da3));var _0x2d941a={'session':_0x5caad6,'queryInput':{'text':{'text':_0x43479f,'languageCode':_0x4a84eb}}};return _0x1712f7['detectIntent'](_0x2d941a)[_0xcd2b('0x36')](function(_0x5dde4c){if(_0x5dde4c&&_0x5dde4c[_0xcd2b('0x45')]){logger[_0xcd2b('0x1b')](_0xcd2b('0x68'),JSON[_0xcd2b('0x3f')](_0x5dde4c));var _0x49e93e=_0x5dde4c[0x0];if(_0x49e93e){var _0x5d8864={'action':_0x49e93e[_0xcd2b('0x69')][_0xcd2b('0x6a')],'allRequiredParamsPresent':_0x49e93e[_0xcd2b('0x69')][_0xcd2b('0x6b')],'endConversation':_0x49e93e[_0xcd2b('0x69')][_0xcd2b('0x6c')]&&_0x49e93e['queryResult'][_0xcd2b('0x6c')][_0xcd2b('0x6d')]?_0x49e93e['queryResult']['diagnosticInfo'][_0xcd2b('0x6d')][_0xcd2b('0x6e')][_0xcd2b('0x6f')]:![],'fulfillmentText':_0x49e93e['queryResult'][_0xcd2b('0x70')],'intentName':_0x49e93e['queryResult'][_0xcd2b('0x71')][_0xcd2b('0x56')],'intentDisplayName':_0x49e93e['queryResult'][_0xcd2b('0x71')][_0xcd2b('0x72')],'isFallbackIntent':_0x49e93e[_0xcd2b('0x69')]['intent'][_0xcd2b('0x73')],'languageCode':_0x49e93e[_0xcd2b('0x69')][_0xcd2b('0x74')],'queryText':_0x49e93e['queryResult'][_0xcd2b('0x75')],'responseId':_0x49e93e[_0xcd2b('0x76')],'score':_0x49e93e[_0xcd2b('0x69')][_0xcd2b('0x77')],'speech':_0x49e93e['queryResult'][_0xcd2b('0x70')],'providerResponse':JSON['stringify'](_0x5dde4c)};return _0x5d8864;}}});};exports[_0xcd2b('0x78')]=function(_0x3d4920,_0x197dfe,_0x4fb7d7,_0x126eb2){return tilde['asr'](_0x3d4920,_0x197dfe,_0x4fb7d7,_0x126eb2)[_0xcd2b('0x36')](function(_0x33527e){try{fs[_0xcd2b('0x1e')](_0x3d4920);}catch(_0x141e53){logger[_0xcd2b('0x16')](_0x141e53);}logger[_0xcd2b('0x1b')](_0xcd2b('0x79'),_0x33527e[_0xcd2b('0x50')]);logger[_0xcd2b('0x1b')](_0xcd2b('0x7a'),_0x33527e[_0xcd2b('0x52')]);return _0x33527e;});};exports[_0xcd2b('0x7b')]=function(_0xcbd7c5,_0x2c1244,_0x48420a,_0x4ddfd5,_0x24856a,_0x302ff6){var _0x38c890=path[_0xcd2b('0x31')](__dirname,_0xcd2b('0x48'),rs[_0xcd2b('0x32')](0x4)+_0xcd2b('0x33'));var _0x1f12b7;return aws[_0xcd2b('0x7c')](_0xcbd7c5,_0x2c1244,_0x48420a,_0x4ddfd5,_0x24856a,_0x302ff6,_0x38c890)['then'](function(){_0x1f12b7=path[_0xcd2b('0x31')](__dirname,_0xcd2b('0x48'),rs['generate'](0x4)+'.wav');return convertFile(_0x38c890,_0x1f12b7);})[_0xcd2b('0x36')](function(){try{fs[_0xcd2b('0x1e')](_0x38c890);fs[_0xcd2b('0x35')](_0x1f12b7,'777');}catch(_0x25e6cf){logger[_0xcd2b('0x16')](_0x25e6cf);}return _0x1f12b7[_0xcd2b('0x39')]('.')[0x0];});};exports[_0xcd2b('0x7d')]=function(_0x5628b1,_0xe3e686,_0x501e81,_0x19442c,_0x49ac3b,_0x3d185e){return aws['lex'](_0x5628b1,_0xe3e686,_0x501e81,_0x19442c,_0x49ac3b,_0x3d185e)['then'](function(_0x16102f){logger[_0xcd2b('0x1b')](JSON[_0xcd2b('0x3f')](_0x16102f));return _0x16102f;});};exports[_0xcd2b('0x7e')]=function(_0x44a799,_0x4967cb,_0x170b8d,_0x52fadd){var _0x2a529b=util[_0xcd2b('0x7f')](_0xcd2b('0x80'),ISPEECH_API,_0x44a799,encodeURIComponent(_0x4967cb),_0x170b8d,_0x52fadd);var _0x20fd4f=path[_0xcd2b('0x31')](__dirname,_0xcd2b('0x48'),rs['generate'](0x4)+'.mp3');var _0x3c7ff3;return downloadFile(_0x2a529b,_0x20fd4f)[_0xcd2b('0x36')](function(){_0x3c7ff3=path[_0xcd2b('0x31')](__dirname,_0xcd2b('0x48'),rs['generate'](0x4)+_0xcd2b('0x37'));return convertFile(_0x20fd4f,_0x3c7ff3);})[_0xcd2b('0x36')](function(){try{fs[_0xcd2b('0x1e')](_0x20fd4f);fs[_0xcd2b('0x35')](_0x3c7ff3,_0xcd2b('0x26'));}catch(_0x1dfbf0){logger[_0xcd2b('0x16')](_0x1dfbf0);}return _0x3c7ff3[_0xcd2b('0x39')]('.')[0x0];});};exports[_0xcd2b('0x81')]=function(_0x10816e,_0x24ef28,_0x502ce5,_0x3ac5b0){var _0x3ddfde=util[_0xcd2b('0x7f')](_0xcd2b('0x82'),ISPEECH_API,_0x24ef28,_0x502ce5,base64Encode(_0x10816e),_0x3ac5b0?util[_0xcd2b('0x7f')](_0xcd2b('0x83'),encodeURIComponent(_0x3ac5b0)):_0xcd2b('0x84'));return uploadFile(_0x3ddfde)['then'](function(_0xdf9b5a){return querystring['parse'](_0xdf9b5a);});};exports[_0xcd2b('0x85')]=function(_0x1075e2,_0x3fb62d){return sestek[_0xcd2b('0x86')](_0x1075e2,_0x3fb62d)[_0xcd2b('0x36')](function(_0x3092d9){logger[_0xcd2b('0x1b')](JSON[_0xcd2b('0x3f')](_0x3092d9));var _0x24f4b6={'speech':_0x3092d9[_0xcd2b('0x87')],'action':_0x3092d9['channelData']?_0x3092d9[_0xcd2b('0x88')]['CustomAction']:undefined,'actiondata':_0x3092d9['channelData']?_0x3092d9['channelData']['CustomActionData']:undefined};if(_0x3092d9['channelData']&&_0x3092d9[_0xcd2b('0x88')][_0xcd2b('0x89')]){return base64Decode(_0x3092d9[_0xcd2b('0x88')][_0xcd2b('0x89')][_0xcd2b('0x8a')],path[_0xcd2b('0x31')](__dirname,_0xcd2b('0x48'),rs[_0xcd2b('0x32')](0x4)+_0xcd2b('0x37')))['then'](function(_0x16082a){_0x24f4b6[_0xcd2b('0x8b')]=_0x16082a;return _0x24f4b6;});}return _0x24f4b6;});};exports[_0xcd2b('0x8c')]=function(){return __dirname;}; \ No newline at end of file +var _0x0bf3=['endConversation','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','name','intent','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','Tilde\x20ASR\x20transcription','polly','lex','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','https','md5','path','querystring','request-promise','randomstring','sox','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','end','data','transcode','wav','start','resolve','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','MP3','text:synthesize','POST','tmp','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','generate','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','result','source','resolvedQuery','actionIncomplete','speech','score','status','code','metadata'];(function(_0x3b0178,_0x589c17){var _0x22bc28=function(_0x1647aa){while(--_0x1647aa){_0x3b0178['push'](_0x3b0178['shift']());}};_0x22bc28(++_0x589c17);}(_0x0bf3,0x147));var _0x30bf=function(_0x446e35,_0x300da4){_0x446e35=_0x446e35-0x0;var _0xc0081b=_0x0bf3[_0x446e35];return _0xc0081b;};'use strict';var apiai=require(_0x30bf('0x0'));var BPromise=require(_0x30bf('0x1'));var dialogflow=require(_0x30bf('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x30bf('0x3'));var md5=require(_0x30bf('0x4'));var path=require(_0x30bf('0x5'));var querystring=require(_0x30bf('0x6'));var rp=require(_0x30bf('0x7'));var rs=require(_0x30bf('0x8'));var sox=require(_0x30bf('0x9'));var tts=require('google-tts-api');var urlParse=require('url')[_0x30bf('0xa')];var util=require(_0x30bf('0xb'));var aws=require(_0x30bf('0xc'));var google=require(_0x30bf('0xd'));var sestek=require(_0x30bf('0xe'));var tilde=require(_0x30bf('0xf'));var logger=require(_0x30bf('0x10'))(_0x30bf('0x11'));var ISPEECH_API=_0x30bf('0x12');function downloadFile(_0xe2ecce,_0x3b297e){return new BPromise(function(_0x11ba05,_0x507885){var _0x3629ed=urlParse(_0xe2ecce);var _0x15e8a0=_0x3629ed[_0x30bf('0x13')]===_0x30bf('0x14')?https:http;var _0x2a104d={'host':_0x3629ed[_0x30bf('0x15')],'path':_0x3629ed[_0x30bf('0x5')],'headers':{'user-agent':_0x30bf('0x16')}};_0x15e8a0[_0x30bf('0x17')](_0x2a104d,function(_0x4f8fae){if(_0x4f8fae[_0x30bf('0x18')]!==0xc8){logger['error'](_0x30bf('0x19')+_0xe2ecce+_0x30bf('0x1a')+_0x4f8fae['statusCode']+'\x20('+_0x4f8fae[_0x30bf('0x1b')]+')');_0x507885(new Error('request\x20to\x20'+_0xe2ecce+_0x30bf('0x1a')+_0x4f8fae[_0x30bf('0x18')]+'\x20('+_0x4f8fae[_0x30bf('0x1b')]+')'));return;}var _0x55a29c=fs[_0x30bf('0x1c')](_0x3b297e);_0x55a29c['on'](_0x30bf('0x1d'),function(){logger[_0x30bf('0x1e')](_0x30bf('0x1f'));_0x55a29c[_0x30bf('0x20')](_0x11ba05);});_0x55a29c['on'](_0x30bf('0x21'),function(_0xc6b33e){fs[_0x30bf('0x22')](_0x3b297e);logger[_0x30bf('0x21')](_0x30bf('0x23'),_0xc6b33e);_0x507885(_0xc6b33e);});_0x4f8fae[_0x30bf('0x24')](_0x55a29c);})['on'](_0x30bf('0x21'),function(_0xb70e2d){logger[_0x30bf('0x21')](_0xb70e2d);_0x507885(_0xb70e2d);})[_0x30bf('0x25')]();});}function uploadFile(_0x45dd7c){return new BPromise(function(_0x2915da,_0x25f61b){var _0x28dd6d=urlParse(_0x45dd7c);var _0x24ad98=_0x28dd6d['protocol']===_0x30bf('0x14')?https:http;var _0x45cae4={'host':_0x28dd6d[_0x30bf('0x15')],'path':_0x28dd6d['path'],'headers':{'user-agent':_0x30bf('0x16')}};_0x24ad98[_0x30bf('0x17')](_0x45cae4,function(_0x3307f4){if(_0x3307f4['statusCode']!==0xc8){_0x25f61b(new Error('request\x20to\x20'+_0x45dd7c+_0x30bf('0x1a')+_0x3307f4['statusCode']+'\x20('+_0x3307f4['statusMessage']+')'));return;}var _0x23ef8f='';_0x3307f4['on'](_0x30bf('0x26'),function(_0x4d17e0){_0x23ef8f+=_0x4d17e0;});_0x3307f4['on'](_0x30bf('0x25'),function(){_0x2915da(_0x23ef8f);});})['on'](_0x30bf('0x21'),function(_0x2cc633){_0x25f61b(_0x2cc633);})[_0x30bf('0x25')]();});}function convertFile(_0x57701b,_0x5d8244){return new BPromise(function(_0x22ab88,_0x19f673){var _0x27e525=sox[_0x30bf('0x27')](_0x57701b,_0x5d8244,{'sampleRate':0x1f40,'format':_0x30bf('0x28'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x27e525['on'](_0x30bf('0x21'),function(_0x2aae77){logger['error']('error\x20convert',_0x2aae77);_0x19f673(_0x2aae77);});_0x27e525['on'](_0x30bf('0x25'),function(){logger['info']('finish\x20to\x20convert');_0x22ab88();});_0x27e525[_0x30bf('0x29')]();});}function base64Decode(_0x11c605,_0x18d5b0){var _0xa4102d=path[_0x30bf('0x2a')](__dirname,'tmp',rs['generate'](0x4)+_0x30bf('0x2b'));fs[_0x30bf('0x2c')](_0xa4102d,_0x11c605,_0x30bf('0x2d'));return convertFile(_0xa4102d,_0x18d5b0)[_0x30bf('0x2e')](function(){try{fs[_0x30bf('0x22')](_0xa4102d);fs[_0x30bf('0x2f')](_0x18d5b0,_0x30bf('0x30'));}catch(_0x2034ea){logger[_0x30bf('0x21')](_0x2034ea);}return _0x18d5b0[_0x30bf('0x31')]('.')[0x0];});}function base64Encode(_0x57551a){var _0xb54e1b=fs[_0x30bf('0x32')](_0x57551a);return new Buffer(_0xb54e1b)[_0x30bf('0x33')](_0x30bf('0x2d'));}exports[_0x30bf('0x34')]=function(_0x290f8c,_0x2513b5,_0x4cb4bb,_0x89b100,_0x2714f6,_0x56c47a){var _0x269c24,_0xbae754;var _0xa962bb=_0x30bf('0x35');var _0x33c313=_0x30bf('0x36')+_0x290f8c;var _0x1077f8={};if(_0x2513b5==='ssml'){_0x1077f8['input']={'ssml':_0x4cb4bb};}else{_0x1077f8[_0x30bf('0x37')]={'text':_0x4cb4bb};};_0x1077f8[_0x30bf('0x38')]={'languageCode':_0x89b100,'ssmlGender':_0x2714f6};_0x1077f8['audioConfig']={'audioEncoding':_0x30bf('0x39'),'sampleRateHertz':0x1f40};var _0x3f7f23={'url':_0xa962bb+_0x30bf('0x3a')+_0x33c313,'method':_0x30bf('0x3b'),'json':!![],'body':_0x1077f8};return rp(_0x3f7f23)[_0x30bf('0x2e')](function(_0x7aedd5){return new BPromise(function(_0x3a81d0,_0x3fc625){_0x269c24=path['resolve'](__dirname,_0x30bf('0x3c'),rs['generate'](0x4)+_0x30bf('0x3d'));var _0x45b84e=Buffer[_0x30bf('0x3e')](_0x7aedd5[_0x30bf('0x3f')],_0x30bf('0x2d'));return fs[_0x30bf('0x40')](_0x269c24,_0x45b84e,function(_0x154804){_0x3fc625(_0x154804);},function(_0x426a27){fs[_0x30bf('0x2f')](_0x269c24,_0x30bf('0x30'));_0x3a81d0(_0x426a27);});});})['then'](function(_0x366b78){_0xbae754=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+'.wav');return convertFile(_0x269c24,_0xbae754);})['then'](function(){try{fs[_0x30bf('0x22')](_0x269c24);fs['chmodSync'](_0xbae754,'777');}catch(_0x1e1182){logger['error'](_0x1e1182);}logger[_0x30bf('0x1e')](_0x30bf('0x41'),_0xbae754['split']('.')[0x0]);return _0xbae754[_0x30bf('0x31')]('.')[0x0];});};exports[_0x30bf('0x42')]=function(_0x244526,_0x31f19f){var _0x162993=_0x30bf('0x43');var _0x3d9cac,_0x4d99e2;var _0x488a66;var _0x40b093={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x162993,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x30bf('0x44')+encodeURIComponent(JSON[_0x30bf('0x45')]([[[_0x30bf('0x46'),JSON[_0x30bf('0x45')]([_0x244526,_0x31f19f||'en',![],_0x30bf('0x47')]),null,_0x30bf('0x48')]]]))};return rp(_0x40b093)[_0x30bf('0x2e')](function(_0x5e6353){try{_0x488a66=eval(_0x5e6353[_0x30bf('0x49')](0x5))[0x0][0x2];}catch(_0x5e3edf){throw new Error(_0x30bf('0x4a')+_0x5e6353[_0x30bf('0x26')]);}if(!_0x488a66){if(_0x244526['length']>0xc8){throw new Error(_0x30bf('0x4b'));}else{throw new Error(_0x30bf('0x4c')+_0x31f19f+_0x30bf('0x4d'));}}try{_0x488a66=eval(_0x488a66)[0x0];}catch(_0x48e345){throw new Error(_0x30bf('0x4a')+res[_0x30bf('0x26')]);}const _0x326b1b=_0x488a66;_0x3d9cac=path[_0x30bf('0x2a')](__dirname,_0x30bf('0x3c'),rs[_0x30bf('0x4e')](0x4)+_0x30bf('0x3d'));fs[_0x30bf('0x2c')](_0x3d9cac,_0x488a66,{'encoding':'base64'});_0x4d99e2=path[_0x30bf('0x2a')](__dirname,'tmp',rs[_0x30bf('0x4e')](0x4)+_0x30bf('0x2b'));return convertFile(_0x3d9cac,_0x4d99e2);})[_0x30bf('0x2e')](function(){try{fs['unlink'](_0x3d9cac);fs[_0x30bf('0x2f')](_0x4d99e2,'777');}catch(_0x59046b){logger[_0x30bf('0x21')](_0x59046b);}logger[_0x30bf('0x1e')](_0x30bf('0x4f'),_0x4d99e2[_0x30bf('0x31')]('.')[0x0]);return _0x4d99e2[_0x30bf('0x31')]('.')[0x0];});};exports[_0x30bf('0x50')]=function(_0x48be76,_0xf5d31d,_0x4209f3){return google[_0x30bf('0x51')](_0x48be76,_0xf5d31d,_0x4209f3)[_0x30bf('0x2e')](function(_0xff1088){logger[_0x30bf('0x1e')](_0xff1088[_0x30bf('0x52')]);return rp(_0xff1088);})[_0x30bf('0x2e')](function(_0x537ad5){var _0x4290da='';var _0xceb82f=0x0;try{fs[_0x30bf('0x22')](_0x48be76);}catch(_0x364a5d){logger[_0x30bf('0x21')](_0x364a5d);}if(_0x537ad5&&_0x537ad5[_0x30bf('0x53')]){_0x4290da=_0x537ad5['results'][_0x30bf('0x54')](function(_0x55ed20){return _0x55ed20&&_0x55ed20[_0x30bf('0x55')][0x0]&&_0x55ed20[_0x30bf('0x55')][0x0][_0x30bf('0x56')]?_0x55ed20[_0x30bf('0x55')][0x0][_0x30bf('0x56')]:'';})[_0x30bf('0x57')]('\x0a');_0xceb82f=_0x537ad5['results'][_0x30bf('0x54')](function(_0x2436ce){return _0x2436ce&&_0x2436ce[_0x30bf('0x55')][0x0]&&_0x2436ce[_0x30bf('0x55')][0x0][_0x30bf('0x58')]?_0x2436ce[_0x30bf('0x55')][0x0][_0x30bf('0x58')]:0x0;})[_0x30bf('0x57')]('\x0a');}logger[_0x30bf('0x1e')](_0x30bf('0x59'),_0x4290da);logger[_0x30bf('0x1e')](_0x30bf('0x5a'),_0xceb82f);return{'transcript':_0x4290da,'confidence':_0xceb82f};})[_0x30bf('0x5b')](function(_0xb2d0b5){logger[_0x30bf('0x21')](_0x30bf('0x5c'),_0xb2d0b5[_0x30bf('0x18')],_0xb2d0b5['name'],_0xb2d0b5[_0x30bf('0x5d')]);});};exports[_0x30bf('0x5e')]=function(_0x32844a,_0x4ff260,_0x56b585,_0x1690da){var _0x44aeca=apiai(_0x4ff260,{'language':_0x1690da||'en'});return _0x44aeca[_0x30bf('0x5f')](_0x56b585,{'sessionId':md5(_0x32844a)})[_0x30bf('0x2e')](function(_0xc8d476){logger[_0x30bf('0x1e')](JSON[_0x30bf('0x45')](_0xc8d476));return{'source':_0xc8d476[_0x30bf('0x60')][_0x30bf('0x61')],'resolvedQuery':_0xc8d476[_0x30bf('0x60')][_0x30bf('0x62')],'action':_0xc8d476['result']['action'],'actionIncomplete':_0xc8d476[_0x30bf('0x60')][_0x30bf('0x63')],'speech':_0xc8d476['result']['fulfillment'][_0x30bf('0x64')],'score':_0xc8d476[_0x30bf('0x60')][_0x30bf('0x65')],'statusCode':_0xc8d476[_0x30bf('0x66')][_0x30bf('0x67')],'endConversation':_0xc8d476[_0x30bf('0x60')][_0x30bf('0x68')][_0x30bf('0x69')]||![],'isFallbackIntent':_0xc8d476[_0x30bf('0x60')][_0x30bf('0x68')][_0x30bf('0x6a')]};});};exports[_0x30bf('0x6b')]=function(_0x18adc1,_0x55ee6f,_0x2d58d0,_0x171366,_0xb0b258,_0x4ddc28){var _0x1c66cf=_0x171366[_0x30bf('0x6c')](/\\n/g,'\x0a');var _0x259362={'credentials':{'private_key':_0x1c66cf,'client_email':_0x2d58d0}};var _0x1471ca=new dialogflow['SessionsClient'](_0x259362);var _0x4fe658=_0x1471ca[_0x30bf('0x6d')](_0x55ee6f,md5(_0x18adc1));var _0x2644b9={'session':_0x4fe658,'queryInput':{'text':{'text':_0xb0b258,'languageCode':_0x4ddc28}}};return _0x1471ca[_0x30bf('0x6e')](_0x2644b9)[_0x30bf('0x2e')](function(_0x4de2aa){if(_0x4de2aa&&_0x4de2aa[_0x30bf('0x6f')]){logger[_0x30bf('0x1e')](_0x30bf('0x70'),JSON['stringify'](_0x4de2aa));var _0x16be7c=_0x4de2aa[0x0];if(_0x16be7c){var _0x1c3d8a={'action':_0x16be7c[_0x30bf('0x71')][_0x30bf('0x72')],'allRequiredParamsPresent':_0x16be7c[_0x30bf('0x71')][_0x30bf('0x73')],'endConversation':_0x16be7c['queryResult']['diagnosticInfo']&&_0x16be7c[_0x30bf('0x71')][_0x30bf('0x74')][_0x30bf('0x75')]?_0x16be7c[_0x30bf('0x71')]['diagnosticInfo'][_0x30bf('0x75')]['end_conversation'][_0x30bf('0x76')]:![],'fulfillmentText':_0x16be7c[_0x30bf('0x71')][_0x30bf('0x77')],'intentName':_0x16be7c[_0x30bf('0x71')]['intent'][_0x30bf('0x78')],'intentDisplayName':_0x16be7c[_0x30bf('0x71')][_0x30bf('0x79')][_0x30bf('0x7a')],'isFallbackIntent':_0x16be7c['queryResult'][_0x30bf('0x79')][_0x30bf('0x7b')],'languageCode':_0x16be7c[_0x30bf('0x71')][_0x30bf('0x7c')],'queryText':_0x16be7c[_0x30bf('0x71')][_0x30bf('0x7d')],'responseId':_0x16be7c['responseId'],'score':_0x16be7c['queryResult'][_0x30bf('0x7e')],'speech':_0x16be7c['queryResult'][_0x30bf('0x77')],'providerResponse':JSON[_0x30bf('0x45')](_0x4de2aa)};return _0x1c3d8a;}}});};exports['tildeASR']=function(_0x27ffcf,_0x216cd0,_0x2e482a,_0x1183d2){return tilde[_0x30bf('0x51')](_0x27ffcf,_0x216cd0,_0x2e482a,_0x1183d2)[_0x30bf('0x2e')](function(_0x1f1126){try{fs[_0x30bf('0x22')](_0x27ffcf);}catch(_0x283af2){logger[_0x30bf('0x21')](_0x283af2);}logger['info'](_0x30bf('0x7f'),_0x1f1126[_0x30bf('0x56')]);logger[_0x30bf('0x1e')]('Tilde\x20ASR\x20confidence',_0x1f1126[_0x30bf('0x58')]);return _0x1f1126;});};exports['awsPolly']=function(_0x39cd90,_0x377a43,_0x4abe78,_0x1f6060,_0x4e5573,_0x2cafca){var _0x238628=path[_0x30bf('0x2a')](__dirname,'tmp',rs[_0x30bf('0x4e')](0x4)+_0x30bf('0x3d'));var _0x2a6dc8;return aws[_0x30bf('0x80')](_0x39cd90,_0x377a43,_0x4abe78,_0x1f6060,_0x4e5573,_0x2cafca,_0x238628)[_0x30bf('0x2e')](function(){_0x2a6dc8=path[_0x30bf('0x2a')](__dirname,_0x30bf('0x3c'),rs[_0x30bf('0x4e')](0x4)+_0x30bf('0x2b'));return convertFile(_0x238628,_0x2a6dc8);})[_0x30bf('0x2e')](function(){try{fs[_0x30bf('0x22')](_0x238628);fs[_0x30bf('0x2f')](_0x2a6dc8,_0x30bf('0x30'));}catch(_0x5972d2){logger['error'](_0x5972d2);}return _0x2a6dc8['split']('.')[0x0];});};exports['awsLex']=function(_0x47bdde,_0x42868e,_0x5a173b,_0x39657d,_0x192642,_0x16dcac){return aws[_0x30bf('0x81')](_0x47bdde,_0x42868e,_0x5a173b,_0x39657d,_0x192642,_0x16dcac)['then'](function(_0x37da7d){logger[_0x30bf('0x1e')](JSON['stringify'](_0x37da7d));return _0x37da7d;});};exports['ispeechTTS']=function(_0x2e1392,_0x502a64,_0x43e226,_0x1f6eee){var _0x5e3060=util[_0x30bf('0x82')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x2e1392,encodeURIComponent(_0x502a64),_0x43e226,_0x1f6eee);var _0xdab1a8=path[_0x30bf('0x2a')](__dirname,_0x30bf('0x3c'),rs['generate'](0x4)+_0x30bf('0x3d'));var _0x5e096b;return downloadFile(_0x5e3060,_0xdab1a8)['then'](function(){_0x5e096b=path[_0x30bf('0x2a')](__dirname,_0x30bf('0x3c'),rs['generate'](0x4)+_0x30bf('0x2b'));return convertFile(_0xdab1a8,_0x5e096b);})[_0x30bf('0x2e')](function(){try{fs[_0x30bf('0x22')](_0xdab1a8);fs[_0x30bf('0x2f')](_0x5e096b,_0x30bf('0x30'));}catch(_0x2383d8){logger[_0x30bf('0x21')](_0x2383d8);}return _0x5e096b[_0x30bf('0x31')]('.')[0x0];});};exports[_0x30bf('0x83')]=function(_0x1ac32b,_0x16e3b0,_0x4e5258,_0x43e7ae){var _0x1f5032=util[_0x30bf('0x82')](_0x30bf('0x84'),ISPEECH_API,_0x16e3b0,_0x4e5258,base64Encode(_0x1ac32b),_0x43e7ae?util[_0x30bf('0x82')](_0x30bf('0x85'),encodeURIComponent(_0x43e7ae)):_0x30bf('0x86'));return uploadFile(_0x1f5032)[_0x30bf('0x2e')](function(_0x30ab5b){return querystring[_0x30bf('0xa')](_0x30ab5b);});};exports[_0x30bf('0x87')]=function(_0x34aa30,_0x518be3){return sestek[_0x30bf('0x88')](_0x34aa30,_0x518be3)['then'](function(_0x218097){logger['info'](JSON[_0x30bf('0x45')](_0x218097));var _0xced6f2={'speech':_0x218097[_0x30bf('0x89')],'action':_0x218097[_0x30bf('0x8a')]?_0x218097[_0x30bf('0x8a')][_0x30bf('0x8b')]:undefined,'actiondata':_0x218097[_0x30bf('0x8a')]?_0x218097[_0x30bf('0x8a')]['CustomActionData']:undefined};if(_0x218097[_0x30bf('0x8a')]&&_0x218097[_0x30bf('0x8a')][_0x30bf('0x8c')]){return base64Decode(_0x218097[_0x30bf('0x8a')]['AudioFromTts'][_0x30bf('0x8d')],path[_0x30bf('0x2a')](__dirname,'tmp',rs['generate'](0x4)+'.wav'))[_0x30bf('0x2e')](function(_0x22fa76){_0xced6f2[_0x30bf('0x8e')]=_0x22fa76;return _0xced6f2;});}return _0xced6f2;});};exports[_0x30bf('0x8f')]=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 50c7a15..e653d42 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 _0xfe44=['exports','./nda'];(function(_0x682323,_0x2e00fe){var _0x4965dc=function(_0x17c6c2){while(--_0x17c6c2){_0x682323['push'](_0x682323['shift']());}};_0x4965dc(++_0x2e00fe);}(_0xfe44,0x1b7));var _0x4fe4=function(_0xf42378,_0x5db672){_0xf42378=_0xf42378-0x0;var _0x1fcb34=_0xfe44[_0xf42378];return _0x1fcb34;};var nda=require(_0x4fe4('0x0'));module[_0x4fe4('0x1')]={'nda':nda}; \ No newline at end of file +var _0x5027=['./nda','exports'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x5027,0x1ea));var _0x7502=function(_0x2ff8b4,_0x2188e4){_0x2ff8b4=_0x2ff8b4-0x0;var _0x22ee1c=_0x5027[_0x2ff8b4];return _0x22ee1c;};var nda=require(_0x7502('0x0'));module[_0x7502('0x1')]={'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 edc7618..6ff435d 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 _0x1542=['extension','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomActionData','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','ndauth_url','/token','username','password','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','uniqueid','callerid','calleridname'];(function(_0x3f6bc,_0x1b5ff6){var _0x526dde=function(_0x24d86b){while(--_0x24d86b){_0x3f6bc['push'](_0x3f6bc['shift']());}};_0x526dde(++_0x1b5ff6);}(_0x1542,0x116));var _0x2154=function(_0x268206,_0x557a4c){_0x268206=_0x268206-0x0;var _0x54887d=_0x1542[_0x268206];return _0x54887d;};'use strict';var rp=require(_0x2154('0x0'));var url=require(_0x2154('0x1'));var logger=require(_0x2154('0x2'))(_0x2154('0x3'));module[_0x2154('0x4')]=function(_0x4faf69,_0x42644b){var _0x376a87={'method':_0x2154('0x5'),'uri':url['resolve'](_0x42644b[_0x2154('0x6')],_0x2154('0x7')),'form':{'grant_type':'password','username':_0x42644b[_0x2154('0x8')],'password':_0x42644b[_0x2154('0x9')]},'json':!![]};return rp(_0x376a87)[_0x2154('0xa')](function(_0x791345){var _0x2e6295={'method':_0x2154('0x5'),'uri':url[_0x2154('0xb')](_0x42644b[_0x2154('0xc')],_0x2154('0xd')),'body':{'type':_0x42644b[_0x2154('0xe')]||'message','channelId':_0x2154('0xf'),'conversation':{'id':_0x4faf69[_0x2154('0x10')]},'from':{'id':_0x4faf69[_0x2154('0x11')],'name':_0x4faf69[_0x2154('0x12')]},'recipient':{'id':_0x4faf69['dnid'],'name':_0x4faf69[_0x2154('0x13')]},'text':_0x42644b[_0x2154('0x14')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x791345[_0x2154('0x15')]},'json':!![]};if(_0x42644b[_0x2154('0x16')]){_0x2e6295[_0x2154('0x17')][_0x2154('0x18')][_0x2154('0x19')]=_0x42644b[_0x2154('0x16')];}if(_0x42644b[_0x2154('0x1a')]=='1'){_0x2e6295['body']['channelData'][_0x2154('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x42644b[_0x2154('0x1c')]){_0x2e6295['body']['channelData']['CustomAction']=_0x42644b[_0x2154('0x1c')];if(_0x42644b['custom_action_data']){_0x2e6295[_0x2154('0x17')]['channelData'][_0x2154('0x1d')]=_0x42644b[_0x2154('0x1e')];}}logger[_0x2154('0x1f')](JSON[_0x2154('0x20')](_0x2e6295));return rp(_0x2e6295);});}; \ No newline at end of file +var _0xaa88=['then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','uniqueid','callerid','calleridname','extension','text','access_token','project','body','ProjectName','ndagenerate_audio','channelData','custom_action','CustomAction','custom_action_data','CustomActionData','stringify','request-promise','url','../../../../../config/logger','agi','POST','resolve','ndauth_url','username'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaa88,0x137));var _0x8aa8=function(_0x108d5f,_0x33f82d){_0x108d5f=_0x108d5f-0x0;var _0x456ea3=_0xaa88[_0x108d5f];return _0x456ea3;};'use strict';var rp=require(_0x8aa8('0x0'));var url=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));module['exports']=function(_0x4ba9dd,_0x3a5b12){var _0x43f7e4={'method':_0x8aa8('0x4'),'uri':url[_0x8aa8('0x5')](_0x3a5b12[_0x8aa8('0x6')],'/token'),'form':{'grant_type':'password','username':_0x3a5b12[_0x8aa8('0x7')],'password':_0x3a5b12['password']},'json':!![]};return rp(_0x43f7e4)[_0x8aa8('0x8')](function(_0x1ed84d){var _0x27c08d={'method':_0x8aa8('0x4'),'uri':url['resolve'](_0x3a5b12[_0x8aa8('0x9')],_0x8aa8('0xa')),'body':{'type':_0x3a5b12[_0x8aa8('0xb')]||'message','channelId':_0x8aa8('0xc'),'conversation':{'id':_0x4ba9dd[_0x8aa8('0xd')]},'from':{'id':_0x4ba9dd[_0x8aa8('0xe')],'name':_0x4ba9dd[_0x8aa8('0xf')]},'recipient':{'id':_0x4ba9dd['dnid'],'name':_0x4ba9dd[_0x8aa8('0x10')]},'text':_0x3a5b12[_0x8aa8('0x11')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x1ed84d[_0x8aa8('0x12')]},'json':!![]};if(_0x3a5b12[_0x8aa8('0x13')]){_0x27c08d[_0x8aa8('0x14')]['channelData'][_0x8aa8('0x15')]=_0x3a5b12[_0x8aa8('0x13')];}if(_0x3a5b12[_0x8aa8('0x16')]=='1'){_0x27c08d['body'][_0x8aa8('0x17')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x3a5b12[_0x8aa8('0x18')]){_0x27c08d[_0x8aa8('0x14')][_0x8aa8('0x17')][_0x8aa8('0x19')]=_0x3a5b12[_0x8aa8('0x18')];if(_0x3a5b12[_0x8aa8('0x1a')]){_0x27c08d[_0x8aa8('0x14')][_0x8aa8('0x17')][_0x8aa8('0x1b')]=_0x3a5b12['custom_action_data'];}}logger['info'](JSON[_0x8aa8('0x1c')](_0x27c08d));return rp(_0x27c08d);});}; \ 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 51d5941..74bfae9 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x2cee6a,_0x4f4687,_0x587c9,_0x4cee25){return asr(_0x2cee6a,_0x4f4687,_0x587c9,_0x4cee25);}; \ No newline at end of file +var _0x3bcc=['exports'];(function(_0x134950,_0x476da3){var _0x8538c0=function(_0x528a1d){while(--_0x528a1d){_0x134950['push'](_0x134950['shift']());}};_0x8538c0(++_0x476da3);}(_0x3bcc,0x1a9));var _0xc3bc=function(_0x57905c,_0x1c1c26){_0x57905c=_0x57905c-0x0;var _0x5e70b1=_0x3bcc[_0x57905c];return _0x5e70b1;};'use strict';var asr=require('./lib/api');module[_0xc3bc('0x0')]=function(_0x2498b9,_0x48cae4,_0x6e201a,_0x26dd81){return asr(_0x2498b9,_0x48cae4,_0x6e201a,_0x26dd81);}; \ 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 a1cfe44..0ab8eba 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 _0x3f4f=['EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','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','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','lodash','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close'];(function(_0x3057c1,_0x390ebd){var _0xf3589f=function(_0x3a68b4){while(--_0x3a68b4){_0x3057c1['push'](_0x3057c1['shift']());}};_0xf3589f(++_0x390ebd);}(_0x3f4f,0x95));var _0xf3f4=function(_0x8d9062,_0x988535){_0x8d9062=_0x8d9062-0x0;var _0x3dcc96=_0x3f4f[_0x8d9062];return _0x3dcc96;};'use strict';var BPromise=require('bluebird');var _=require(_0xf3f4('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xf3f4('0x1'));var logger=require(_0xf3f4('0x2'))('agi');module[_0xf3f4('0x3')]=function(_0x202003,_0x508b08,_0x385307,_0x21ce78){return new BPromise(function(_0x455168,_0x1152f2){logger[_0xf3f4('0x4')](_0xf3f4('0x5'),_0x21ce78||_0xf3f4('0x6'));var _0xe17108=new WebSocket(_0x21ce78||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x5062bf='';var _0x39357b='0';var _0x4e7f4a='1';var _0x58d900='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0xaeffae(_0xe498a3){var _0x49eac7=crypto[_0xf3f4('0x7')](_0xf3f4('0x8'));_0x49eac7[_0xf3f4('0x9')](_0xe498a3);return _0x49eac7[_0xf3f4('0xa')](_0xf3f4('0xb'));}function _0x5bc619(){try{logger[_0xf3f4('0x4')](_0xf3f4('0xc'));var _0x4cd774=moment()[_0xf3f4('0xd')]();var _0x14f3fb=_0xaeffae(_0x4cd774+_0x508b08+_0x385307);_0xe17108[_0xf3f4('0xe')](JSON[_0xf3f4('0xf')]({'appID':_0x508b08,'timestamp':_0x4cd774,'appKey':_0x14f3fb}));var _0x48aca5=fs[_0xf3f4('0x10')](_0x202003);_0x48aca5['on'](_0xf3f4('0x11'),function(_0x449c99){_0xe17108[_0xf3f4('0xe')](_0x449c99);});_0x48aca5['on'](_0xf3f4('0x12'),function(){_0xe17108[_0xf3f4('0xe')](_0xf3f4('0x13'));});}catch(_0xc091f5){logger[_0xf3f4('0x14')](_0xf3f4('0x15'),JSON['stringify'](_0xc091f5));_0xe17108[_0xf3f4('0x16')]();}}function _0x638ac(_0x295b9f){try{if(_0x295b9f){var _0x14c14d=JSON[_0xf3f4('0x17')](_0x295b9f);switch(_0x14c14d[_0xf3f4('0x18')]){case 0x0:if(_0x14c14d[_0xf3f4('0x19')]){if(_0x14c14d['result']['final']){logger['info'](_0xf3f4('0x1a'),JSON[_0xf3f4('0xf')](_0x14c14d['result'][_0xf3f4('0x1b')]));_0x5062bf=_0x14c14d[_0xf3f4('0x19')][_0xf3f4('0x1b')][0x0][_0xf3f4('0x1c')];_0x39357b=_0x14c14d[_0xf3f4('0x19')][_0xf3f4('0x1b')][0x0][_0xf3f4('0x1d')];_0x4e7f4a='0';_0x58d900=_0xf3f4('0x1e');_0xe17108[_0xf3f4('0x16')]();}}break;case 0x1:logger[_0xf3f4('0x4')](_0xf3f4('0x1f'));_0x4e7f4a='1';_0x58d900=_0xf3f4('0x1f');break;case 0x2:logger[_0xf3f4('0x4')](_0xf3f4('0x20'));_0x4e7f4a='2';_0x58d900=_0xf3f4('0x20');break;case 0x9:logger[_0xf3f4('0x4')](_0xf3f4('0x21'));_0x4e7f4a='9';_0x58d900='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xf3f4('0x4')](_0xf3f4('0x22'));_0x4e7f4a='10';_0x58d900=_0xf3f4('0x22');break;case 0xb:logger[_0xf3f4('0x4')](_0xf3f4('0x23'));_0x4e7f4a='11';_0x58d900=_0xf3f4('0x23');}}}catch(_0x4cfe5f){logger['error'](_0xf3f4('0x24'),JSON['stringify'](_0x4cfe5f));_0xe17108[_0xf3f4('0x16')]();}}function _0x1d0d50(){logger[_0xf3f4('0x4')](_0xf3f4('0x25'));_0x455168({'transcript':_0x5062bf,'confidence':_0x39357b,'status':_0x4e7f4a,'status_message':_0x58d900});}function _0x25fd5e(_0x3e74ba){logger['error'](_0xf3f4('0x26'));if(!_[_0xf3f4('0x27')](_0x3e74ba)){logger[_0xf3f4('0x14')](_[_0xf3f4('0x28')](_0x3e74ba)?JSON[_0xf3f4('0xf')](_0x3e74ba):_0x3e74ba);}}_0xe17108['on']('open',_0x5bc619);_0xe17108['on'](_0xf3f4('0x29'),_0x638ac);_0xe17108['on'](_0xf3f4('0x12'),_0x1d0d50);_0xe17108['on'](_0xf3f4('0x14'),_0x25fd5e);});}; \ No newline at end of file +var _0x7d57=['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','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','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','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','bluebird','lodash','moment','crypto','exports','info','Tilde\x20URI'];(function(_0x12ab49,_0x3622c3){var _0x679594=function(_0x1f2843){while(--_0x1f2843){_0x12ab49['push'](_0x12ab49['shift']());}};_0x679594(++_0x3622c3);}(_0x7d57,0x161));var _0x77d5=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0x7d57[_0x2605dc];return _0x4568c9;};'use strict';var BPromise=require(_0x77d5('0x0'));var _=require(_0x77d5('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x77d5('0x2'));var crypto=require(_0x77d5('0x3'));var logger=require('../../../../../../config/logger')('agi');module[_0x77d5('0x4')]=function(_0x353aeb,_0x5b3bd0,_0x57f11f,_0xc492a0){return new BPromise(function(_0x242bb5,_0x53d864){logger[_0x77d5('0x5')](_0x77d5('0x6'),_0xc492a0||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x23a4ef=new WebSocket(_0xc492a0||_0x77d5('0x7'),{'perMessageDeflate':![]});var _0x306e2d='';var _0x37aa57='0';var _0x5136ce='1';var _0x413262=_0x77d5('0x8');function _0x4cf3c6(_0x4303be){var _0x464c27=crypto[_0x77d5('0x9')]('sha1');_0x464c27['update'](_0x4303be);return _0x464c27[_0x77d5('0xa')](_0x77d5('0xb'));}function _0x5e6f24(){try{logger[_0x77d5('0x5')](_0x77d5('0xc'));var _0xe82137=moment()[_0x77d5('0xd')]();var _0x3e5c8d=_0x4cf3c6(_0xe82137+_0x5b3bd0+_0x57f11f);_0x23a4ef[_0x77d5('0xe')](JSON[_0x77d5('0xf')]({'appID':_0x5b3bd0,'timestamp':_0xe82137,'appKey':_0x3e5c8d}));var _0x2a6393=fs[_0x77d5('0x10')](_0x353aeb);_0x2a6393['on'](_0x77d5('0x11'),function(_0x1640f7){_0x23a4ef[_0x77d5('0xe')](_0x1640f7);});_0x2a6393['on']('close',function(){_0x23a4ef[_0x77d5('0xe')]('EOS');});}catch(_0x4301b1){logger[_0x77d5('0x12')](_0x77d5('0x13'),JSON[_0x77d5('0xf')](_0x4301b1));_0x23a4ef[_0x77d5('0x14')]();}}function _0x3fb29b(_0x23e99d){try{if(_0x23e99d){var _0x28072a=JSON['parse'](_0x23e99d);switch(_0x28072a[_0x77d5('0x15')]){case 0x0:if(_0x28072a[_0x77d5('0x16')]){if(_0x28072a[_0x77d5('0x16')][_0x77d5('0x17')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x28072a[_0x77d5('0x16')][_0x77d5('0x18')]));_0x306e2d=_0x28072a[_0x77d5('0x16')][_0x77d5('0x18')][0x0][_0x77d5('0x19')];_0x37aa57=_0x28072a[_0x77d5('0x16')][_0x77d5('0x18')][0x0][_0x77d5('0x1a')];_0x5136ce='0';_0x413262=_0x77d5('0x1b');_0x23a4ef['terminate']();}}break;case 0x1:logger[_0x77d5('0x5')](_0x77d5('0x8'));_0x5136ce='1';_0x413262=_0x77d5('0x8');break;case 0x2:logger[_0x77d5('0x5')](_0x77d5('0x1c'));_0x5136ce='2';_0x413262=_0x77d5('0x1c');break;case 0x9:logger[_0x77d5('0x5')](_0x77d5('0x1d'));_0x5136ce='9';_0x413262='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x77d5('0x5')](_0x77d5('0x1e'));_0x5136ce='10';_0x413262=_0x77d5('0x1e');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x5136ce='11';_0x413262=_0x77d5('0x1f');}}}catch(_0x34b416){logger['error'](_0x77d5('0x20'),JSON[_0x77d5('0xf')](_0x34b416));_0x23a4ef[_0x77d5('0x14')]();}}function _0x24278d(){logger[_0x77d5('0x5')](_0x77d5('0x21'));_0x242bb5({'transcript':_0x306e2d,'confidence':_0x37aa57,'status':_0x5136ce,'status_message':_0x413262});}function _0x9849d(_0xca3564){logger['error'](_0x77d5('0x22'));if(!_[_0x77d5('0x23')](_0xca3564)){logger[_0x77d5('0x12')](_[_0x77d5('0x24')](_0xca3564)?JSON[_0x77d5('0xf')](_0xca3564):_0xca3564);}}_0x23a4ef['on'](_0x77d5('0x25'),_0x5e6f24);_0x23a4ef['on'](_0x77d5('0x26'),_0x3fb29b);_0x23a4ef['on'](_0x77d5('0x27'),_0x24278d);_0x23a4ef['on'](_0x77d5('0x12'),_0x9849d);});}; \ 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 a9009cc..7a80607 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 _0xaa49=['./asr'];(function(_0x582628,_0x45dc5d){var _0x4dfea5=function(_0x2ed090){while(--_0x2ed090){_0x582628['push'](_0x582628['shift']());}};_0x4dfea5(++_0x45dc5d);}(_0xaa49,0x18c));var _0x9aa4=function(_0x50a7fb,_0x697a05){_0x50a7fb=_0x50a7fb-0x0;var _0x516c79=_0xaa49[_0x50a7fb];return _0x516c79;};var asr=require(_0x9aa4('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x6664=['./asr'];(function(_0x3cd005,_0x4c995a){var _0x3e7d8b=function(_0x137659){while(--_0x137659){_0x3cd005['push'](_0x3cd005['shift']());}};_0x3e7d8b(++_0x4c995a);}(_0x6664,0x165));var _0x4666=function(_0x516a77,_0xef2264){_0x516a77=_0x516a77-0x0;var _0x428556=_0x6664[_0x516a77];return _0x428556;};var asr=require(_0x4666('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 4ad05b8..184ccce 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 _0x0e05=['listening','connection','getConnections','E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','ready','close','exports','net','events','EventEmitter','./error','./channel','emit','error','E_AGI_ARGUMENT_PORT','createServer'];(function(_0x145e4f,_0x1e072e){var _0x2356d0=function(_0xdfa0d9){while(--_0xdfa0d9){_0x145e4f['push'](_0x145e4f['shift']());}};_0x2356d0(++_0x1e072e);}(_0x0e05,0x117));var _0x50e0=function(_0x38785b,_0x451a72){_0x38785b=_0x38785b-0x0;var _0x2f7183=_0x0e05[_0x38785b];return _0x2f7183;};'use strict';var util=require('util');var net=require(_0x50e0('0x0'));var EventEmitter=require(_0x50e0('0x1'))[_0x50e0('0x2')];var AGIError=require(_0x50e0('0x3'));var AGIChannel=require(_0x50e0('0x4'));var AGIServer=function(_0x353f67,_0x352f06,_0x19abb7){var _0x59d039=this,_0x353f67=_0x353f67||0x11dd,_0x352f06=_0x352f06||'127.0.0.1',_0x28d54e=null,_0x159a47=0x0;EventEmitter['call'](_0x59d039);function _0x2e5f80(){if(!_0x353f67){_0x59d039[_0x50e0('0x5')](_0x50e0('0x6'),new AGIError(_0x50e0('0x7')));return![];}_0x28d54e=net[_0x50e0('0x8')]();_0x28d54e['listen'](_0x353f67,_0x352f06);_0x28d54e['on'](_0x50e0('0x9'),function(){_0x59d039[_0x50e0('0x5')]('listening');});_0x28d54e['on'](_0x50e0('0xa'),function(_0x187cfa){_0x28d54e[_0x50e0('0xb')](function(_0x5ea1fb,_0x34cd23){if(_0x5ea1fb){_0x59d039[_0x50e0('0x5')](_0x50e0('0x6'),new AGIError(_0x50e0('0xc'),_0x5ea1fb));}else if(_0x19abb7&&_0x19abb7<0x0){_0x59d039['emit'](_0x50e0('0x6'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x187cfa[_0x50e0('0xd')]();}else if(_0x19abb7&&_0x19abb7>0x0&&_0x19abb7<_0x34cd23){_0x159a47+=0x1;_0x59d039['emit']('error',new AGIError(_0x50e0('0xe'),_0x159a47));_0x187cfa[_0x50e0('0xd')]();}else{var _0x33fba8=new AGIChannel(_0x187cfa);_0x33fba8['on'](_0x50e0('0xf'),function(){_0x59d039[_0x50e0('0x5')]('connection',_0x33fba8);});}});});_0x28d54e['on'](_0x50e0('0x6'),function(_0x1eb667){_0x59d039[_0x50e0('0x5')](_0x50e0('0x6'),new AGIError('E_AGI_SERVER_ERROR',_0x1eb667['code']));});_0x28d54e['on'](_0x50e0('0x10'),function(){_0x59d039[_0x50e0('0x5')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process['nextTick'](function(){_0x2e5f80();});};util['inherits'](AGIServer,EventEmitter);module[_0x50e0('0x11')]=function(_0x466f4d,_0x339621,_0x9d4388){return new AGIServer(_0x466f4d,_0x339621,_0x9d4388);}; \ No newline at end of file +var _0x8835=['getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','listen','listening'];(function(_0x38c769,_0x2c602e){var _0x42c78=function(_0x389d3b){while(--_0x389d3b){_0x38c769['push'](_0x38c769['shift']());}};_0x42c78(++_0x2c602e);}(_0x8835,0x9b));var _0x5883=function(_0x22906a,_0x184e09){_0x22906a=_0x22906a-0x0;var _0x90666c=_0x8835[_0x22906a];return _0x90666c;};'use strict';var util=require(_0x5883('0x0'));var net=require(_0x5883('0x1'));var EventEmitter=require(_0x5883('0x2'))[_0x5883('0x3')];var AGIError=require(_0x5883('0x4'));var AGIChannel=require(_0x5883('0x5'));var AGIServer=function(_0x354f19,_0x4e5803,_0x585d62){var _0x305d26=this,_0x354f19=_0x354f19||0x11dd,_0x4e5803=_0x4e5803||_0x5883('0x6'),_0x27cf4a=null,_0x582f74=0x0;EventEmitter[_0x5883('0x7')](_0x305d26);function _0x3ec537(){if(!_0x354f19){_0x305d26[_0x5883('0x8')](_0x5883('0x9'),new AGIError(_0x5883('0xa')));return![];}_0x27cf4a=net['createServer']();_0x27cf4a[_0x5883('0xb')](_0x354f19,_0x4e5803);_0x27cf4a['on']('listening',function(){_0x305d26[_0x5883('0x8')](_0x5883('0xc'));});_0x27cf4a['on']('connection',function(_0x41acda){_0x27cf4a[_0x5883('0xd')](function(_0x2e1ce9,_0x26f333){if(_0x2e1ce9){_0x305d26[_0x5883('0x8')](_0x5883('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x2e1ce9));}else if(_0x585d62&&_0x585d62<0x0){_0x305d26[_0x5883('0x8')](_0x5883('0x9'),new AGIError(_0x5883('0xe')));_0x41acda[_0x5883('0xf')]();}else if(_0x585d62&&_0x585d62>0x0&&_0x585d62<_0x26f333){_0x582f74+=0x1;_0x305d26[_0x5883('0x8')]('error',new AGIError(_0x5883('0x10'),_0x582f74));_0x41acda[_0x5883('0xf')]();}else{var _0x41c083=new AGIChannel(_0x41acda);_0x41c083['on'](_0x5883('0x11'),function(){_0x305d26[_0x5883('0x8')](_0x5883('0x12'),_0x41c083);});}});});_0x27cf4a['on'](_0x5883('0x9'),function(_0x3c236f){_0x305d26[_0x5883('0x8')](_0x5883('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x3c236f['code']));});_0x27cf4a['on'](_0x5883('0x13'),function(){_0x305d26['emit'](_0x5883('0x13'),new AGIError(_0x5883('0x14')));});}process[_0x5883('0x15')](function(){_0x3ec537();});};util[_0x5883('0x16')](AGIServer,EventEmitter);module[_0x5883('0x17')]=function(_0x10bf6c,_0x3789e6,_0x29043b){return new AGIServer(_0x10bf6c,_0x3789e6,_0x29043b);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 0bf7a1a..71bea9d 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 _0xd12b=['google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','MP3','googleTTS','restAPI','url','timeout','includes','PUT','method','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','parse','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','length','saveRestApiResult','%s.%s','isArray','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','noop','exec','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','lumenvoxtts','no\x20text\x20configured','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_CONFIDENCE()','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','getSquareOdbc','no\x20query\x20configured','replace','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','bot','DIALOGFLOW_%s','speech','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','out','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','maxRetry','file_id','no\x20file\x20audio\x20found','response','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','TILDE_ASR_%s','gotoc','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','failure','math','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','macro','gosub','position','QUEUE','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','Smtp','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','127.0.0.1','Executed\x20command\x20%s\x20%s','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','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','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','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','name','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getUserById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','Intervals','getSoundPath','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','calleridname','context','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','callerid','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','trim','googleCloudTTS','apiKey'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd12b,0x17e));var _0xbd12=function(_0x3504a0,_0x3f770f){_0x3504a0=_0x3504a0-0x0;var _0x3dfca3=_0xd12b[_0x3504a0];return _0x3dfca3;};'use strict';var fs=require('fs');var path=require(_0xbd12('0x0'));var util=require(_0xbd12('0x1'));var _=require(_0xbd12('0x2'));var sh=require(_0xbd12('0x3'));var odbc=require(_0xbd12('0x4'))();var rs=require(_0xbd12('0x5'));var moment=require(_0xbd12('0x6'));var Mustache=require('mustache');var rp=require(_0xbd12('0x7'));var logger=require(_0xbd12('0x8'))(_0xbd12('0x9'));var config=require(_0xbd12('0xa'));var scripts=require(_0xbd12('0xb'));var FILES_PATH=_0xbd12('0xc');var recursiveMapAttributes=[_0xbd12('0xd'),_0xbd12('0xe')];var verticesWithRetry=[_0xbd12('0xf'),'getdigits',_0xbd12('0x10')];var AGIVertices=function(_0x5d5457,_0x3e5e02,_0x289298){this[_0xbd12('0x11')]=_0x5d5457;this[_0xbd12('0x12')]=_0x3e5e02;this[_0xbd12('0x13')]=_0x289298;};AGIVertices[_0xbd12('0x14')][_0xbd12('0x15')]=function(_0x4dfba6,_0x907ba7){this['rpc'][_0xbd12('0x16')](_0x4dfba6)[_0xbd12('0x17')](function(_0x300bb7){_0x907ba7(null,_0x300bb7?_0x300bb7['name']:![]);})[_0xbd12('0x18')](function(_0x53ddbc){_0x907ba7(_0x53ddbc);});};AGIVertices['prototype'][_0xbd12('0x19')]=function(_0x5891f8,_0x296f36){this['rpc']['getVoiceQueueById'](_0x5891f8)[_0xbd12('0x17')](function(_0x53e7f6){_0x296f36(null,_0x53e7f6?_0x53e7f6[_0xbd12('0x1a')]:![]);})['catch'](function(_0x30ac77){_0x296f36(_0x30ac77);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x1b')]=function(_0x37874b,_0xeaa7f8){this[_0xbd12('0x12')][_0xbd12('0x1c')](_0x37874b)[_0xbd12('0x17')](function(_0x1861d0){_0xeaa7f8(null,_0x1861d0?_0x1861d0[_0xbd12('0x1a')]:![]);})[_0xbd12('0x18')](function(_0x17b0b2){_0xeaa7f8(_0x17b0b2);});};AGIVertices[_0xbd12('0x14')]['getSquareOdbc']=function(_0x15aaa5,_0x152180){this[_0xbd12('0x12')][_0xbd12('0x1d')](_0x15aaa5)[_0xbd12('0x17')](function(_0x662d31){_0x152180(null,_0x662d31?_0x662d31[_0xbd12('0x1e')]:![]);})['catch'](function(_0x58d6c2){_0x152180(_0x58d6c2);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x1f')]=function(_0x2f7b2b,_0x549b76){this[_0xbd12('0x12')][_0xbd12('0x20')](_0x2f7b2b)[_0xbd12('0x17')](function(_0x3556ec){_0x549b76(null,_0x3556ec?_0x3556ec['name']:![]);})[_0xbd12('0x18')](function(_0x1e8b82){_0x549b76(_0x1e8b82);});};AGIVertices[_0xbd12('0x14')]['getTrunk']=function(_0x25d0d9,_0x380d4e){this[_0xbd12('0x12')]['getTrunkById'](_0x25d0d9)[_0xbd12('0x17')](function(_0x146197){_0x380d4e(null,_0x146197?_0x146197['name']:![]);})[_0xbd12('0x18')](function(_0x37028a){_0x380d4e(_0x37028a);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x21')]=function(_0x4f4b6c,_0x3b31e3){var _0x2c7a81=this;this[_0xbd12('0x12')][_0xbd12('0x22')](_0x4f4b6c)['then'](function(_0x3ad45c){_0x3b31e3(null,_0x3ad45c?_0x2c7a81['getSoundPath'](_0x3ad45c[_0xbd12('0x23')]):![]);})['catch'](function(_0xfcaeb){_0x3b31e3(_0xfcaeb);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x24')]=function(_0x542f93,_0x46a19c){this['rpc'][_0xbd12('0x25')](_0x542f93)[_0xbd12('0x17')](function(_0x10efa4){_0x46a19c(null,_0x10efa4?_0x10efa4:![]);})[_0xbd12('0x18')](function(_0x4ddee8){_0x46a19c(_0x4ddee8);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x26')]=function(_0x1ed8d0,_0x1cf090,_0x4af110){this['mailRpc'][_0xbd12('0x26')](_0x1ed8d0,_0x1cf090)[_0xbd12('0x17')](function(){_0x4af110(null);})[_0xbd12('0x18')](function(_0x53c1e7){_0x4af110(_0x53c1e7);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x27')]=function(_0x333171,_0x1ae08b){this[_0xbd12('0x12')][_0xbd12('0x28')](_0x333171)[_0xbd12('0x17')](function(_0x13edca){if(_0x13edca){if(_0x13edca['IntervalId']){_0x1ae08b(null,[_0x13edca[_0xbd12('0x29')]]);}else{_0x1ae08b(null,_[_0xbd12('0x2a')](_0x13edca[_0xbd12('0x2b')],_0xbd12('0x29')));}}else{_0x1ae08b(null,![]);}})['catch'](function(_0xd85e89){_0x1ae08b(_0xd85e89);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x2c')]=function(_0x13ebc9){return util[_0xbd12('0x2d')]('%s/sounds/converted/%s',FILES_PATH,_0x13ebc9);};AGIVertices[_0xbd12('0x14')][_0xbd12('0x2e')]=function(_0x509aa7,_0x4b9490,_0x303b6a){odbc[_0xbd12('0x2f')](_0x509aa7,function(_0x41bdda){if(_0x41bdda){logger[_0xbd12('0x30')](_0xbd12('0x31'),_0x41bdda);_0x303b6a(_0x41bdda);}else{logger[_0xbd12('0x32')](_0xbd12('0x33'));odbc[_0xbd12('0x34')](_0x4b9490,function(_0x4249fa,_0x4718e9){if(_0x4249fa){logger[_0xbd12('0x32')](_0xbd12('0x35'),_0x4b9490);_0x303b6a(_0x4249fa);}else{logger[_0xbd12('0x32')]('Query\x20executed\x20correctly\x20%s',_0x4b9490);odbc[_0xbd12('0x36')](function(_0x30c22d){if(_0x30c22d){logger['error'](_0xbd12('0x37'),_0x30c22d);}_0x303b6a(null,_0x4718e9);});}});}});};AGIVertices[_0xbd12('0x14')]['getSmsAccount']=function(_0x173375,_0x1fd5d6){this[_0xbd12('0x12')][_0xbd12('0x38')](_0x173375)['then'](function(_0x5806ce){_0x1fd5d6(null,_0x5806ce?_0x5806ce:![]);})[_0xbd12('0x18')](function(_0x2f792f){_0x1fd5d6(_0x2f792f);});};AGIVertices['prototype'][_0xbd12('0x39')]=function(_0x4f6ad9,_0x12965c){this[_0xbd12('0x12')]['createSmsMessage'](_0x4f6ad9)[_0xbd12('0x17')](function(_0xece23f){_0x12965c(null,_0xece23f);})[_0xbd12('0x18')](function(_0x3ef1a1){_0x12965c(_0x3ef1a1);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x3a')]=function(_0x385a0d,_0x2fef5a,_0x316fbe){this[_0xbd12('0x12')][_0xbd12('0x3a')]({'uniqueid':this[_0xbd12('0x11')][_0xbd12('0x3b')],'node':_0x385a0d[_0xbd12('0x3c')],'application':_0x385a0d[_0xbd12('0x3d')],'data':_0x2fef5a||null,'project_name':this[_0xbd12('0x11')][_0xbd12('0x3e')],'callerid':this[_0xbd12('0x11')]['callerid']})[_0xbd12('0x17')](function(_0x2a5dfc){if(_0x316fbe){_0x316fbe(null,_0x2a5dfc);}})[_0xbd12('0x18')](function(_0x3b9306){if(_0x316fbe){_0x316fbe(_0x3b9306);}});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x3f')]=function(_0x439803,_0x546c0e,_0xd9c0fc,_0x541d9e){this[_0xbd12('0x12')]['createSquareRecording']({'uniqueid':this[_0xbd12('0x11')][_0xbd12('0x3b')],'callerid':this[_0xbd12('0x11')]['callerid'],'calleridname':this[_0xbd12('0x11')][_0xbd12('0x40')],'context':this[_0xbd12('0x11')][_0xbd12('0x41')],'extension':this[_0xbd12('0x11')][_0xbd12('0x42')],'priority':this['channel'][_0xbd12('0x43')],'accountcode':this[_0xbd12('0x11')]['accountcode'],'dnid':this[_0xbd12('0x11')][_0xbd12('0x44')],'projectName':this['channel'][_0xbd12('0x3e')],'saveName':_0x546c0e,'filename':_0x439803[_0xbd12('0x45')]||_0x546c0e,'savePath':_0xd9c0fc})[_0xbd12('0x17')](function(_0x18dea7){_0x541d9e(null,_0x18dea7);})[_0xbd12('0x18')](function(_0x24cbb6){_0x541d9e(_0x24cbb6);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x46')]=function(_0x5d3125,_0x2893c4,_0x4a9060,_0x1143b2,_0x1313f9){this['rpc'][_0xbd12('0x46')]({'uniqueid':this['channel'][_0xbd12('0x3b')],'body':_0x5d3125,'direction':_0x2893c4,'providerName':_0x4a9060,'providerResponse':_0x1143b2})[_0xbd12('0x17')](function(_0x1db68c){if(_0x1313f9){_0x1313f9(null,_0x1db68c);}})[_0xbd12('0x18')](function(_0x135b72){if(_0x1313f9){_0x1313f9(_0x135b72);}});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x47')]=function(_0x4efecd,_0x9d2bfa){this[_0xbd12('0x12')][_0xbd12('0x47')]({'firstName':_[_0xbd12('0x48')](_0x4efecd[_0xbd12('0x1a')])||_[_0xbd12('0x49')](_0x4efecd[_0xbd12('0x1a')])?_0xbd12('0x4a')+Math[_0xbd12('0x4b')]():_0x4efecd['name'],'lastName':_[_0xbd12('0x48')](_0x4efecd[_0xbd12('0x4c')])||_[_0xbd12('0x49')](_0x4efecd['lastName'])?null:_0x4efecd[_0xbd12('0x4c')],'phone':_0x4efecd['phone'],'ListId':_0x4efecd['list_id'],'scheduledat':_0x4efecd[_0xbd12('0x4d')],'callbackUniqueid':this['channel'][_0xbd12('0x3b')],'tags':'callback','description':_0xbd12('0x4e')+_0x4efecd[_0xbd12('0x4d')][_0xbd12('0x4f')](),'priority':_0x4efecd[_0xbd12('0x50')]})[_0xbd12('0x17')](function(_0x97218c){_0x9d2bfa(null,_0x97218c);})[_0xbd12('0x18')](function(_0xc21aaa){_0x9d2bfa(_0xc21aaa);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x51')]=function(_0x15caa8,_0x48459c){this[_0xbd12('0x12')][_0xbd12('0x52')](_0x15caa8)[_0xbd12('0x17')](function(_0xf3f0f9){_0x48459c(null,_0xf3f0f9?_0xf3f0f9[_0xbd12('0x1a')]:![]);})[_0xbd12('0x18')](function(_0x2f3b83){_0x48459c(_0x2f3b83);});};AGIVertices['prototype'][_0xbd12('0x53')]=function(_0x85e8da,_0x3a2acd,_0x14e0db){var _0xda1f4e={'role':_0xbd12('0x54')};_0xda1f4e[_0x85e8da]=this[_0xbd12('0x11')][_0xbd12('0x55')];this[_0xbd12('0x12')]['agentPause'](_0xda1f4e,_0x3a2acd,this[_0xbd12('0x11')][_0xbd12('0x3b')])[_0xbd12('0x17')](function(_0x414da2){_0x14e0db(null,_[_0xbd12('0x49')](_0x414da2)?![]:!![]);})[_0xbd12('0x18')](function(_0x3272b7){logger[_0xbd12('0x30')](_0x3272b7);_0x14e0db(null,![]);});};AGIVertices[_0xbd12('0x14')]['agentUnpause']=function(_0x49f13d,_0x5067e5){var _0x113cc0={'role':_0xbd12('0x54')};_0x113cc0[_0x49f13d]=this['channel'][_0xbd12('0x55')];this[_0xbd12('0x12')][_0xbd12('0x56')](_0x113cc0)[_0xbd12('0x17')](function(_0x287c08){_0x5067e5(null,_[_0xbd12('0x49')](_0x287c08)?![]:!![]);})[_0xbd12('0x18')](function(_0x166c5d){logger['error'](_0x166c5d);_0x5067e5(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x4d4937,_0x4ef285){var _0x1b1a45={'role':_0xbd12('0x54')};_0x1b1a45[_0x4d4937]=this['channel'][_0xbd12('0x55')];this['rpc'][_0xbd12('0x57')](_0x1b1a45)['then'](function(_0x3fb798){_0x4ef285(null,_['isNil'](_0x3fb798)?![]:!![]);})[_0xbd12('0x18')](function(_0xd1496b){logger[_0xbd12('0x30')](_0xd1496b);_0x4ef285(null,![]);});};AGIVertices[_0xbd12('0x14')]['agentLogin']=function(_0x3c4d40,_0x27a9b6){var _0x15cd4={'role':_0xbd12('0x54')};_0x15cd4[_0x3c4d40]=this[_0xbd12('0x11')][_0xbd12('0x55')];var _0x30a4c8=_0x3c4d40!=_0xbd12('0x58')?util[_0xbd12('0x2d')](_0xbd12('0x59'),_0xbd12('0x5a'),this[_0xbd12('0x11')]['callerid']):undefined;this[_0xbd12('0x12')][_0xbd12('0x5b')](_0x15cd4,_0x30a4c8)['then'](function(_0x271143){_0x27a9b6(null,_[_0xbd12('0x49')](_0x271143)?![]:!![]);})[_0xbd12('0x18')](function(_0x51c92c){logger['error'](_0x51c92c);_0x27a9b6(null,![]);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x5c')]=function(_0x54a313,_0x28bedf){sh['exec'](_[_0xbd12('0x5d')](_0x54a313),function(_0x5e1723,_0x1d534e){var _0x1c011f=_0x1d534e['replace'](/(\r\n|\n|\r)/gm,'');_0x28bedf(null,_0x1c011f);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x5e')]=function(_0x2090ba,_0x58c697){scripts[_0xbd12('0x5e')](_0x2090ba[_0xbd12('0x5f')],_0x2090ba[_0xbd12('0x60')]||_0xbd12('0x61'),_0x2090ba[_0xbd12('0x61')],_0x2090ba[_0xbd12('0x62')]||'en-US',_0x2090ba[_0xbd12('0x63')]||_0xbd12('0x64'),_0x2090ba['audioEncoding']||_0xbd12('0x65'))['then'](function(_0x1c37ca){_0x58c697(null,_0x1c37ca);})[_0xbd12('0x18')](function(_0x2e20fa){_0x58c697(_0x2e20fa);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x66')]=function(_0x2053ed,_0x3c0a16){scripts['googleTTS'](_0x2053ed[_0xbd12('0x61')],_0x2053ed['google_tts_language']||'en',0x1)[_0xbd12('0x17')](function(_0x1c39ed){_0x3c0a16(null,_0x1c39ed);})[_0xbd12('0x18')](function(_0x363a33){_0x3c0a16(_0x363a33);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x67')]=function(_0x3a4648,_0x11cdd4){var _0x3e1ed8={'uri':_0x3a4648[_0xbd12('0x68')],'method':_0x3a4648['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3a4648[_0xbd12('0x69')])==='number'&&parseInt(_0x3a4648[_0xbd12('0x69')])>=0x1?parseInt(_0x3a4648['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xbd12('0x6a')](['POST',_0xbd12('0x6b')],_0x3e1ed8[_0xbd12('0x6c')][_0xbd12('0x6d')]())){try{_0x3e1ed8[_0xbd12('0x6e')]=_0x3a4648[_0xbd12('0xe')]?JSON['parse'](_0x3a4648[_0xbd12('0xe')]):{};}catch(_0x111ef7){logger[_0xbd12('0x30')](_0xbd12('0x6f'),_0x111ef7);}}try{_0x3e1ed8[_0xbd12('0x70')]=_0x3a4648[_0xbd12('0xd')]?JSON['parse'](_0x3a4648[_0xbd12('0xd')]):{};}catch(_0x555b6a){logger[_0xbd12('0x30')](_0xbd12('0x71'),_0x555b6a);}if(_0x3a4648[_0xbd12('0x72')]){try{var _0x5d6abd=require(_0x3a4648[_0xbd12('0x72')])[_0xbd12('0x73')](this,_0x3e1ed8);_0x3e1ed8[_0xbd12('0x74')]=Mustache['render'](_0x3a4648[_0xbd12('0x68')],_0x5d6abd,{},['$$','$$']);if(_0x3e1ed8[_0xbd12('0x70')]){_0x3e1ed8[_0xbd12('0x70')]=JSON[_0xbd12('0x75')](Mustache[_0xbd12('0x76')](JSON[_0xbd12('0x77')](_0x3e1ed8[_0xbd12('0x70')]),_0x5d6abd,{},['$$','$$']));}if(_0x3e1ed8[_0xbd12('0x6e')]){_0x3e1ed8[_0xbd12('0x6e')]=JSON['parse'](Mustache[_0xbd12('0x76')](JSON[_0xbd12('0x77')](_0x3e1ed8[_0xbd12('0x6e')]),_0x5d6abd,{},['$$','$$']));}}catch(_0x1b03d9){logger[_0xbd12('0x30')](_0xbd12('0x78'),_0x1b03d9);}}rp(_0x3e1ed8)[_0xbd12('0x17')](function(_0x4137b0){var _0x52e48f={'statusCode':_0x4137b0[_0xbd12('0x79')]||0xc8,'statusMessage':_0x4137b0[_0xbd12('0x7a')]||'OK','headers':_0x4137b0['headers']||{},'body':_0x4137b0['body']||{}};_0x11cdd4(null,_0x52e48f);})['catch'](function(_0x2ffd6e){var _0x281969={'statusCode':_0x2ffd6e['statusCode']||0x1f4,'statusMessage':_0x2ffd6e[_0xbd12('0x7b')]||_0xbd12('0x7c'),'headers':_0x2ffd6e[_0xbd12('0x7d')][_0xbd12('0x70')]||{},'body':_0x2ffd6e[_0xbd12('0x7d')][_0xbd12('0x6e')]||{}};_0x11cdd4(null,_0x281969);});};AGIVertices[_0xbd12('0x14')]['googleDialogflow']=function(_0x910f7,_0x5ad6ec){scripts[_0xbd12('0x7e')](this[_0xbd12('0x11')][_0xbd12('0x3b')],_0x910f7[_0xbd12('0x7f')],_0x910f7[_0xbd12('0x61')],_0x910f7[_0xbd12('0x80')]||'en')['then'](function(_0x4d2988){_0x5ad6ec(null,_0x4d2988);})['catch'](function(_0xefd7f5){_0x5ad6ec(_0xefd7f5);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x81')]=function(_0x87c6e7,_0x2afd8b){scripts['googleDialogflowV2'](this[_0xbd12('0x11')]['uniqueid'],_0x87c6e7['dialogflowV2_project_id'],_0x87c6e7[_0xbd12('0x82')],_0x87c6e7[_0xbd12('0x83')],_0x87c6e7['text'],_0x87c6e7[_0xbd12('0x84')]||'en')[_0xbd12('0x17')](function(_0xce62c8){_0x2afd8b(null,_0xce62c8);})[_0xbd12('0x18')](function(_0x226f0a){_0x2afd8b(_0x226f0a);});};AGIVertices['prototype'][_0xbd12('0x85')]=function(_0x344ae5,_0x103502){scripts[_0xbd12('0x85')](this['channel'],_0x344ae5)[_0xbd12('0x17')](function(_0x7506d5){_0x103502(null,_0x7506d5);})[_0xbd12('0x18')](function(_0x3d54c8){_0x103502(_0x3d54c8);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x86')]=function(_0x2c33f2,_0x563898){scripts[_0xbd12('0x86')](_0x2c33f2['key'],_0x2c33f2[_0xbd12('0x61')],_0x2c33f2['ispeech_tts_language']||_0xbd12('0x87'),_0x2c33f2[_0xbd12('0x88')])[_0xbd12('0x17')](function(_0x342fb7){_0x563898(null,_0x342fb7);})[_0xbd12('0x18')](function(_0x9d34cd){_0x563898(_0x9d34cd);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x89')]=function(_0x2a01a6,_0x2f4f55,_0x314c7c){scripts[_0xbd12('0x89')](_0x2f4f55,_0x2a01a6['key'],_0x2a01a6[_0xbd12('0x8a')]||'en-US',this[_0xbd12('0x8b')](_0x2a01a6[_0xbd12('0x8c')])?_0x2a01a6[_0xbd12('0x8c')]:undefined)['then'](function(_0x2538a5){_0x314c7c(null,_0x2538a5);})[_0xbd12('0x18')](function(_0x10c280){_0x314c7c(_0x10c280);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x8d')]=function(_0x43e976,_0x587841){scripts[_0xbd12('0x8d')](_0x43e976[_0xbd12('0x8e')],_0x43e976[_0xbd12('0x8f')],_0x43e976[_0xbd12('0x90')],_0x43e976[_0xbd12('0x91')]||_0xbd12('0x92'),_0x43e976['text'],_0x43e976[_0xbd12('0x93')]||'text')[_0xbd12('0x17')](function(_0x5a1f95){_0x587841(null,_0x5a1f95);})[_0xbd12('0x18')](function(_0x1c9191){_0x587841(_0x1c9191);});};AGIVertices['prototype'][_0xbd12('0x94')]=function(_0x309c13,_0x544ef6){scripts[_0xbd12('0x94')](this[_0xbd12('0x11')][_0xbd12('0x3b')],_0x309c13[_0xbd12('0x8e')],_0x309c13[_0xbd12('0x8f')],_0x309c13[_0xbd12('0x95')],_0x309c13[_0xbd12('0x61')],_0x309c13['aws_bot_name'])[_0xbd12('0x17')](function(_0x31eb0d){_0x544ef6(null,_0x31eb0d);})[_0xbd12('0x18')](function(_0x5c43d5){_0x544ef6(_0x5c43d5);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x96')]=function(_0x10eb0e,_0x52e469,_0x1b2c4b){scripts['googleASR'](_0x52e469,_0x10eb0e[_0xbd12('0x7f')],_0x10eb0e[_0xbd12('0x97')]||_0xbd12('0x87'))[_0xbd12('0x17')](function(_0x18ad3d){_0x1b2c4b(null,_0x18ad3d);})[_0xbd12('0x18')](function(_0xb5879f){_0x1b2c4b(_0xb5879f);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x98')]=function(_0x21250f,_0x367bd7,_0x5b10cc){scripts[_0xbd12('0x98')](_0x367bd7,_0x21250f['appid'],_0x21250f[_0xbd12('0x99')],_0x21250f[_0xbd12('0x74')])[_0xbd12('0x17')](function(_0x9e1e74){_0x5b10cc(null,_0x9e1e74);})[_0xbd12('0x18')](function(_0x345b88){_0x5b10cc(_0x345b88);});};AGIVertices[_0xbd12('0x14')][_0xbd12('0x9a')]=function(_0x53983a){var _0x20cc73=_[_0xbd12('0x6a')](verticesWithRetry,_0x53983a[_0xbd12('0x3d')])?_0x53983a:_[_0xbd12('0x9b')](_0x53983a);for(var _0x46876e in _0x20cc73){if(_0x20cc73['hasOwnProperty'](_0x46876e)){if(_0x20cc73[_0x46876e]&&_[_0xbd12('0x9c')](_0x20cc73[_0x46876e])){if(_['includes'](recursiveMapAttributes,_0x46876e)){_0x20cc73[_0x46876e]=this[_0xbd12('0x9d')](_0x20cc73[_0x46876e]);}else{_0x20cc73[_0x46876e]=this[_0xbd12('0x9e')](_0x20cc73[_0x46876e]);}}}}return _0x20cc73;};AGIVertices[_0xbd12('0x14')][_0xbd12('0x9f')]=function(_0x546beb){for(var _0x19d4fc in _0x546beb){if(_0x546beb[_0xbd12('0xa0')](_0x19d4fc)){if(_[_0xbd12('0xa1')](_0x546beb[_0x19d4fc])){this[_0xbd12('0x9f')](_0x546beb[_0x19d4fc]);}else if(_['isArray'](_0x546beb[_0x19d4fc])){for(var _0x2f5aaf=0x0;_0x2f5aaf<_0x546beb[_0x19d4fc][_0xbd12('0xa2')];_0x2f5aaf++){this[_0xbd12('0x9f')](_0x546beb[_0x19d4fc][_0x2f5aaf]);}}else if(_['isString'](_0x546beb[_0x19d4fc])){_0x546beb[_0x19d4fc]=this[_0xbd12('0x9e')](_0x546beb[_0x19d4fc]);}}}};AGIVertices[_0xbd12('0x14')][_0xbd12('0xa3')]=function(_0x233bfb,_0x19d2be){for(var _0x5d4002 in _0x233bfb){if(_0x233bfb[_0xbd12('0xa0')](_0x5d4002)){if(_[_0xbd12('0xa1')](_0x233bfb[_0x5d4002])){if(!_[_0xbd12('0x48')](_0x233bfb[_0x5d4002])){this['saveRestApiResult'](_0x233bfb[_0x5d4002],util[_0xbd12('0x2d')](_0xbd12('0xa4'),_0x19d2be,_0x5d4002));}}else if(_[_0xbd12('0xa5')](_0x233bfb[_0x5d4002])){for(var _0x560cdf=0x0;_0x560cdf<_0x233bfb[_0x5d4002][_0xbd12('0xa2')];_0x560cdf++){this[_0xbd12('0xa3')](_0x233bfb[_0x5d4002][_0x560cdf],util[_0xbd12('0x2d')](_0xbd12('0xa4'),_0x19d2be,_0x5d4002+'['+_0x560cdf+']'));}}else{if(!_['isNil'](_0x233bfb[_0x5d4002])){this[_0xbd12('0x11')][_0xbd12('0xa6')](util[_0xbd12('0x2d')](_0xbd12('0xa4'),_0x19d2be,_0x5d4002),_0x233bfb[_0x5d4002]);}}}}};AGIVertices[_0xbd12('0x14')][_0xbd12('0x9d')]=function(_0x407d20){try{var _0x1b8457=JSON[_0xbd12('0x75')](_0x407d20);this['recursiveNodeIndex'](_0x1b8457);return JSON[_0xbd12('0x77')](_0x1b8457);}catch(_0x4d328d){return this[_0xbd12('0x9e')](_0x407d20);}};AGIVertices[_0xbd12('0x14')]['replaceAllVariables']=function(_0x273a76){var _0x78c23=_0x273a76[_0xbd12('0xa7')]('{');for(var _0x1b5a8f=0x1;_0x1b5a8f<_0x78c23[_0xbd12('0xa2')];_0x1b5a8f+=0x1){var _0x184c62=_0x78c23[_0x1b5a8f][_0xbd12('0xa7')]('}');if(_0x184c62['length']>0x1){_0x273a76=_0x273a76[_0xbd12('0xa8')]('{'+_0x184c62[0x0]+'}',this['channel'][_0xbd12('0x15')](_0x184c62[0x0])[_0xbd12('0xa9')]||_0x184c62[0x0]);}}if(_0x78c23[_0xbd12('0xa2')]===0x1){return _0x273a76[_0xbd12('0x4f')]();}return this[_0xbd12('0x9e')](_0x273a76);};AGIVertices[_0xbd12('0x14')][_0xbd12('0xaa')]=function(_0x3f15d0,_0x3bab4b){var _0x4629ae=this[_0xbd12('0x11')][_0xbd12('0x15')](_0x3f15d0);if(_0x4629ae[_0xbd12('0xab')]===-0x1){return _0x4629ae;}logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0xac'),_0x3bab4b,_0x4629ae[_0xbd12('0xa9')]));return this[_0xbd12('0x11')][_0xbd12('0xa6')](_0x3bab4b,_0x4629ae[_0xbd12('0xa9')]);};AGIVertices['prototype']['isConfigured']=function(_0x234e85){return _0x234e85&&_0x234e85!=='0'&&_0x234e85!=='-1'&&_0x234e85!=='';};AGIVertices[_0xbd12('0x14')]['maxRetry']=function(_0x4500c3){this['createSquareDetailsReport'][_0xbd12('0x73')](this,_0x4500c3,'-');_0x4500c3[_0xbd12('0xad')]=_0x4500c3['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xbd12('0x14')]['mrcpsynth']=function(_0x119831){logger[_0xbd12('0x32')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x119831[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x119831[_0xbd12('0x61')])){return this['channel'][_0xbd12('0xae')]('no\x20text\x20configured');}var _0xdc9a99='\x22'+_0x119831[_0xbd12('0x61')]+'\x22';if(this['isConfigured'](_0x119831[_0xbd12('0x7d')])){_0xdc9a99+=','+_0x119831[_0xbd12('0x7d')];}var _0x431b00=this['channel'][_0xbd12('0xaf')]('MRCPSynth',_0xdc9a99);if(_0x431b00[_0xbd12('0xab')]===-0x1){return _0x431b00;}return this['channel'][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0xb0'),_0xdc9a99));};AGIVertices[_0xbd12('0x14')]['mrcprecog']=function(_0x3de066){logger['info'](util[_0xbd12('0x2d')](_0xbd12('0xb1'),_0x3de066[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x3de066[_0xbd12('0xb2')])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0xb3'));}var _0x314388=_0x3de066['grammar'];if(this[_0xbd12('0x8b')](_0x3de066[_0xbd12('0x7d')])){_0x314388+=','+_0x3de066[_0xbd12('0x7d')];}var _0x1eeefd=this[_0xbd12('0x11')][_0xbd12('0xaf')](_0xbd12('0xb4'),_0x314388);if(_0x1eeefd['result']===-0x1){return _0x1eeefd;}var _0x15fccc=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xbd12('0xb5'));if(_0x15fccc[_0xbd12('0xab')]===-0x1){return _0x15fccc;}var _0x2dc34e=this['getAndSetVariable']('RECOG_INPUT()',_0xbd12('0xb6'));if(_0x2dc34e['result']===-0x1){return _0x2dc34e;}var _0x15a779=this['getAndSetVariable'](_0xbd12('0xb7'),_0xbd12('0xb8'));if(_0x15a779[_0xbd12('0xab')]===-0x1){return _0x15a779;}return this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0xb9'),_0x314388));};AGIVertices[_0xbd12('0x14')][_0xbd12('0x9')]=function(_0x368404){logger['info'](util['format'](_0xbd12('0xba'),_0x368404[_0xbd12('0x3c')]));return this[_0xbd12('0x11')][_0xbd12('0x9')]([_0x368404['command'],_0x368404[_0xbd12('0xbb')]]);};AGIVertices[_0xbd12('0x14')][_0xbd12('0xbc')]=function(_0x5eefff){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x5eefff['label']));if(this[_0xbd12('0x8b')](_0x5eefff[_0xbd12('0x69')])){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0xbd'),_0x5eefff[_0xbd12('0x69')]));var _0x37882b=this[_0xbd12('0x11')]['wait'](_0x5eefff[_0xbd12('0x69')]);if(_0x37882b[_0xbd12('0xab')]===-0x1){return _0x37882b;}}return this[_0xbd12('0x11')][_0xbd12('0xbc')]();};AGIVertices['prototype'][_0xbd12('0xbe')]=function(_0x4a3818){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0xbf'),_0x4a3818[_0xbd12('0x3c')]));if(!this['isConfigured'](_0x4a3818[_0xbd12('0xc0')])){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x4a3818,_0xbd12('0xc1'));}_0x4a3818['scheduledAt']=moment();if(this[_0xbd12('0x8b')](_0x4a3818[_0xbd12('0xc2')])){_0x4a3818[_0xbd12('0x4d')]=moment()[_0xbd12('0xc3')](_0x4a3818[_0xbd12('0xc2')],'minutes');}if(!this[_0xbd12('0x8b')](_0x4a3818[_0xbd12('0x50')])){_0x4a3818['callback_priority']=0x2;}this[_0xbd12('0x47')][_0xbd12('0x73')](this,_0x4a3818);return this[_0xbd12('0x11')]['noop'](util[_0xbd12('0x2d')](_0xbd12('0xc4'),_0x4a3818[_0xbd12('0xc5')],_0x4a3818[_0xbd12('0xc0')],_0x4a3818['scheduledAt']));};AGIVertices['prototype'][_0xbd12('0xc6')]=function(_0x2d231b){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0xc7'),_0x2d231b[_0xbd12('0x3c')]));var _0x417faa=this[_0xbd12('0x11')][_0xbd12('0xaf')](_0x2d231b['application'],_0x2d231b['options']);if(_0x417faa[_0xbd12('0xab')]===-0x1){return _0x417faa;}return this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')]('Executed\x20command\x20%s\x20%s',_0x2d231b['application'],_0x2d231b[_0xbd12('0x7d')]));};AGIVertices[_0xbd12('0x14')][_0xbd12('0xc8')]=function(_0x554003){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x554003[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x554003[_0xbd12('0x61')])){return this['channel'][_0xbd12('0xae')](_0xbd12('0xc9'));}var _0x88022b='\x22'+_0x554003['text']+'\x22';if(this['isConfigured'](_0x554003[_0xbd12('0x7d')])){_0x88022b+=','+_0x554003[_0xbd12('0x7d')];}var _0x15a175=this[_0xbd12('0x11')]['exec'](_0xbd12('0xca'),_0x88022b);if(_0x15a175['result']===-0x1){return _0x15a175;}return this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0xb0'),_0x88022b));};AGIVertices[_0xbd12('0x14')][_0xbd12('0xcb')]=function(_0x3693a6){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0xcc'),_0x3693a6[_0xbd12('0x3c')]));if(!this['isConfigured'](_0x3693a6['text'])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0xc9'));}var _0x525d3e='\x22'+_0x3693a6['text']+'\x22';if(this[_0xbd12('0x8b')](_0x3693a6['options'])){_0x525d3e+=','+_0x3693a6['options'];}var _0x42e629=this['channel']['exec'](_0xbd12('0xca'),_0x525d3e);if(_0x42e629['result']===-0x1){return _0x42e629;}return this[_0xbd12('0x11')]['noop'](util['format'](_0xbd12('0xb0'),_0x525d3e));};AGIVertices['prototype'][_0xbd12('0xcd')]=function(_0x2eec0b){logger['info'](util['format'](_0xbd12('0xce'),_0x2eec0b[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x2eec0b[_0xbd12('0xb2')])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0xb3'));}var _0x4b640d=_0x2eec0b[_0xbd12('0xb2')];if(this[_0xbd12('0x8b')](_0x2eec0b[_0xbd12('0x7d')])){_0x4b640d+=','+_0x2eec0b[_0xbd12('0x7d')];}var _0xaf4474=this[_0xbd12('0x11')][_0xbd12('0xaf')](_0xbd12('0xb4'),_0x4b640d);if(_0xaf4474[_0xbd12('0xab')]===-0x1){return _0xaf4474;}var _0x5dd120=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xbd12('0xcf'));if(_0x5dd120['result']===-0x1){return _0x5dd120;}var _0x98f376=this[_0xbd12('0xaa')](_0xbd12('0xd0'),_0xbd12('0xd1'));if(_0x98f376[_0xbd12('0xab')]===-0x1){return _0x98f376;}var _0x597afb=this[_0xbd12('0xaa')](_0xbd12('0xb7'),'LUMENVOX_ASR_INSTANCE');if(_0x597afb['result']===-0x1){return _0x597afb;}return this['channel'][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0xb9'),_0x4b640d));};AGIVertices['prototype'][_0xbd12('0xd2')]=function(_0x8efd9){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0xd3'),_0x8efd9['label']));if(!this[_0xbd12('0x8b')](_0x8efd9['grammar'])){return this[_0xbd12('0x11')][_0xbd12('0xae')]('no\x20grammar\x20configured');}var _0x3bb7a8=_0x8efd9[_0xbd12('0xb2')];if(this[_0xbd12('0x8b')](_0x8efd9['options'])){_0x3bb7a8+=','+_0x8efd9[_0xbd12('0x7d')];}var _0x4dfe32=this['channel'][_0xbd12('0xaf')]('MRCPRecog',_0x3bb7a8);if(_0x4dfe32[_0xbd12('0xab')]===-0x1){return _0x4dfe32;}var _0x507b09=this[_0xbd12('0xaa')](_0xbd12('0xd4'),'SESTEK_ASR_CONFIDENCE');if(_0x507b09[_0xbd12('0xab')]===-0x1){return _0x507b09;}var _0x2a6246=this['getAndSetVariable'](_0xbd12('0xd0'),_0xbd12('0xd5'));if(_0x2a6246['result']===-0x1){return _0x2a6246;}var _0x4a460d=this['getAndSetVariable'](_0xbd12('0xb7'),_0xbd12('0xd6'));if(_0x4a460d[_0xbd12('0xab')]===-0x1){return _0x4a460d;}return this[_0xbd12('0x11')][_0xbd12('0xae')](util['format'](_0xbd12('0xb9'),_0x3bb7a8));};AGIVertices[_0xbd12('0x14')][_0xbd12('0xd7')]=function(_0x4e3e4c){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0xd8'),_0x4e3e4c[_0xbd12('0x3c')]));if(!this['isConfigured'](_0x4e3e4c[_0xbd12('0xd9')])){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x4e3e4c,'no\x20database\x20selected');}var _0x291dc5=this[_0xbd12('0xda')][_0xbd12('0x73')](this,_0x4e3e4c['odbc_id']);if(!_0x291dc5){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x4e3e4c,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x4e3e4c[_0xbd12('0x34')])){return this['channel']['error'](_0x4e3e4c,_0xbd12('0xdb'));}var _0x1be0cc=_0x4e3e4c[_0xbd12('0x34')][_0xbd12('0xdc')](/(\r\n|\n|\r)/gm,'\x20');this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0xdd'),_0x1be0cc));var _0x359dc4=this[_0xbd12('0x2e')][_0xbd12('0x73')](this,_0x291dc5,_0x1be0cc);this['createSquareDetailsReport'][_0xbd12('0x73')](this,_0x4e3e4c,_0x1be0cc);if(!this[_0xbd12('0x8b')](_0x4e3e4c['variable_id'])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0xde'));}var _0x2ebc95=this[_0xbd12('0x15')][_0xbd12('0x73')](this,_0x4e3e4c[_0xbd12('0xdf')]);if(!_0x2ebc95){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x4e3e4c,_0xbd12('0xe0'));}var _0x1a50f9=this;_0x359dc4[_0xbd12('0xe1')](function(_0x2710f4,_0x873398){Object[_0xbd12('0xe2')](_0x2710f4)[_0xbd12('0xe1')](function(_0x523fdf){_0x1a50f9[_0xbd12('0x11')][_0xbd12('0xa6')](util[_0xbd12('0x2d')]('%s[%s][%s]',_0x2ebc95,_0x873398,_0x523fdf),_0x2710f4[_0x523fdf]);});});this[_0xbd12('0x11')]['setVariable'](util[_0xbd12('0x2d')](_0xbd12('0xe3'),_0x2ebc95),_0x359dc4[_0xbd12('0xa2')]);return this[_0xbd12('0x11')]['noop'](util[_0xbd12('0x2d')]('variable\x20%s\x20set',_0x2ebc95));};AGIVertices[_0xbd12('0x14')][_0xbd12('0xe4')]=function(_0x1ce51c){logger[_0xbd12('0xe5')](util[_0xbd12('0x2d')](_0xbd12('0xe6'),_0x1ce51c[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x1ce51c[_0xbd12('0xe7')])){return this['channel'][_0xbd12('0x30')](_0x1ce51c,_0xbd12('0xe8'));}var _0x1c1245=this[_0xbd12('0x1f')][_0xbd12('0x73')](this,_0x1ce51c[_0xbd12('0xe7')]);if(!_0x1c1245){return this[_0xbd12('0x11')]['error'](_0x1ce51c,_0xbd12('0xe9'));}var _0xf0f8a4=this[_0xbd12('0x11')][_0xbd12('0xaf')]('DIAL',[util[_0xbd12('0x2d')](_0xbd12('0xea'),_0x1c1245),_0x1ce51c[_0xbd12('0x69')],_0x1ce51c[_0xbd12('0xeb')],_0x1ce51c['url']]);if(_0xf0f8a4[_0xbd12('0xab')]===-0x1){return _0xf0f8a4;}return this['channel'][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0xec'),_0xbd12('0xed')));};AGIVertices[_0xbd12('0x14')][_0xbd12('0xee')]=function(_0xf0624d){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0xf0624d[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0xf0624d[_0xbd12('0x7f')])){return this['channel']['noop']('no\x20key\x20configured');}if(!this[_0xbd12('0x8b')](_0xf0624d[_0xbd12('0x61')])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0xc9'));}this[_0xbd12('0x11')][_0xbd12('0xef')]=!![];this[_0xbd12('0x3a')](_0xf0624d);this[_0xbd12('0x46')](_0xf0624d[_0xbd12('0x61')],'in','','');this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')]('Trying\x20Dialogflow:\x20%s',_0xf0624d[_0xbd12('0x61')]));var _0x48dc72=this['googleDialogflow'][_0xbd12('0x73')](this,_0xf0624d);if(_0x48dc72){for(var _0x377b8d in _0x48dc72){if(_0x48dc72[_0xbd12('0xa0')](_0x377b8d)){this[_0xbd12('0x11')][_0xbd12('0xa6')](util[_0xbd12('0x2d')](_0xbd12('0xf0'),_0x377b8d['toUpperCase']()),_0x48dc72[_0x377b8d]);}}this['createSquareMessage'](_0x48dc72[_0xbd12('0xf1')],'out',_0xbd12('0xee'),'');return this['channel'][_0xbd12('0xae')](util[_0xbd12('0x2d')]('Dialogflow\x20Result\x20%s',_0x48dc72['speech']));}return this['channel']['error'](_0xf0624d,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xbd12('0x14')][_0xbd12('0xf2')]=function(_0x312f3e){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0xf3'),_0x312f3e[_0xbd12('0x3c')]));if(!this['isConfigured'](_0x312f3e['dialogflowV2_project_id'])){return this[_0xbd12('0x11')][_0xbd12('0xae')]('no\x20project_id\x20configured');}if(!this[_0xbd12('0x8b')](_0x312f3e['client_email'])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0xf4'));}if(!this[_0xbd12('0x8b')](_0x312f3e[_0xbd12('0x83')])){return this[_0xbd12('0x11')][_0xbd12('0xae')]('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x312f3e[_0xbd12('0x84')])){return this['channel'][_0xbd12('0xae')](_0xbd12('0xf5'));}if(!this[_0xbd12('0x8b')](_0x312f3e['text'])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0xc9'));}this['channel'][_0xbd12('0xef')]=!![];this[_0xbd12('0x3a')](_0x312f3e);this[_0xbd12('0x46')](_0x312f3e[_0xbd12('0x61')],'in','','');this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0xf6'),_0x312f3e[_0xbd12('0x61')]));var _0x35b6a3=this[_0xbd12('0x81')][_0xbd12('0x73')](this,_0x312f3e);if(_0x35b6a3){for(var _0x389b98 in _0x35b6a3){if(_0x35b6a3[_0xbd12('0xa0')](_0x389b98)){if(_0x389b98!==_0xbd12('0xf7')){this[_0xbd12('0x11')][_0xbd12('0xa6')](util[_0xbd12('0x2d')](_0xbd12('0xf0'),_0x389b98['toUpperCase']()),_0x35b6a3[_0x389b98]);}}}this[_0xbd12('0x46')](_0x35b6a3['speech'],_0xbd12('0xf8'),_0xbd12('0xf2'),_0x35b6a3[_0xbd12('0xf7')]);return this[_0xbd12('0x11')]['noop'](util[_0xbd12('0x2d')](_0xbd12('0xf9'),_0x35b6a3[_0xbd12('0xf1')]));}return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x312f3e,'DialogflowV2\x20is\x20unreachable');};AGIVertices['prototype'][_0xbd12('0xfa')]=function(_0xc577a7){logger[_0xbd12('0x32')](util['format'](_0xbd12('0xfb'),_0xc577a7[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0xc577a7[_0xbd12('0xfc')])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0xfd'));}if(!this[_0xbd12('0x8b')](_0xc577a7[_0xbd12('0xfe')])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0xff'));}if(!this[_0xbd12('0x8b')](_0xc577a7[_0xbd12('0x100')])){return this['channel']['noop'](_0xbd12('0x101'));}if(!this['isConfigured'](_0xc577a7[_0xbd12('0x102')])){return this[_0xbd12('0x11')]['noop'](_0xbd12('0xc9'));}this[_0xbd12('0x11')][_0xbd12('0xef')]=!![];this[_0xbd12('0x3a')](_0xc577a7);this[_0xbd12('0x46')](_0xc577a7[_0xbd12('0x61')],'in','','');this[_0xbd12('0x11')]['noop'](util[_0xbd12('0x2d')](_0xbd12('0x103'),_0xc577a7[_0xbd12('0x61')]));var _0x1c5164=this[_0xbd12('0x85')]['sync'](this,_0xc577a7);if(_0x1c5164){for(var _0x5b2ce9 in _0x1c5164){if(_0x1c5164[_0xbd12('0xa0')](_0x5b2ce9)){this[_0xbd12('0x11')][_0xbd12('0xa6')](util[_0xbd12('0x2d')](_0xbd12('0x104'),_0x5b2ce9[_0xbd12('0x6d')]()),_0x1c5164[_0x5b2ce9]);}}this[_0xbd12('0x46')](_0x1c5164[_0xbd12('0xf1')],_0xbd12('0xf8'),_0xbd12('0xfa'),'');if(_0x1c5164[_0xbd12('0x105')]){this[_0xbd12('0x11')]['noop'](util[_0xbd12('0x2d')](_0xbd12('0x106'),_0x1c5164[_0xbd12('0x105')]));var _0x4d4f53=this[_0xbd12('0x11')][_0xbd12('0x107')](_0x1c5164[_0xbd12('0x105')]);try{fs['unlink'](_0x1c5164[_0xbd12('0x105')]+_0xbd12('0x108'));}catch(_0x169fd2){logger[_0xbd12('0x30')](_0x169fd2);}return _0x4d4f53;}else{return this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x109'),_0x1c5164[_0xbd12('0xf1')]));}}return this[_0xbd12('0x11')]['error'](_0xc577a7,_0xbd12('0x10a'));};AGIVertices[_0xbd12('0x14')][_0xbd12('0x10b')]=function(_0x1cb8ba){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x10c'),_0x1cb8ba[_0xbd12('0x3c')]));return this[_0xbd12('0x11')]['noop'](_0xbd12('0x10b'));};AGIVertices[_0xbd12('0x14')][_0xbd12('0x10d')]=function(_0x3c8ed4){logger['info'](util['format'](_0xbd12('0x10e'),_0x3c8ed4[_0xbd12('0x3c')]));var _0x1059eb='';if(_0x3c8ed4[_0xbd12('0x10f')]){if(!this[_0xbd12('0x8b')](_0x3c8ed4['trunk_id'])){return this[_0xbd12('0x11')]['error'](_0x3c8ed4,_0xbd12('0x110'));}else{var _0x5bd00a=parseInt(_0x3c8ed4[_0xbd12('0x10f')],0xa);if(isNaN(_0x5bd00a)){_0x1059eb=_0x3c8ed4[_0xbd12('0x10f')];}else{_0x1059eb=this[_0xbd12('0x111')][_0xbd12('0x73')](this,_0x3c8ed4['trunk_id']);if(!_0x1059eb){return this['channel'][_0xbd12('0x30')](_0x3c8ed4,'no\x20trunk\x20found');}}}}else if(_0x3c8ed4[_0xbd12('0x112')]){_0x1059eb=_0x3c8ed4[_0xbd12('0x112')];}else{return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x3c8ed4,_0xbd12('0x110'));}var _0x51ae35=this[_0xbd12('0x11')]['exec'](_0xbd12('0xed'),[util[_0xbd12('0x2d')](_0xbd12('0x113'),_0x1059eb,_0x3c8ed4[_0xbd12('0xc5')]),_0x3c8ed4[_0xbd12('0x69')],_0x3c8ed4[_0xbd12('0xeb')],_0x3c8ed4['url']]);if(_0x51ae35['result']===-0x1){return _0x51ae35;}return this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0xec'),_0xbd12('0xed')));};AGIVertices[_0xbd12('0x14')]['finally']=function(_0x444faa){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x114'),_0x444faa['label']));return this['channel']['noop'](_0xbd12('0x115'));};AGIVertices[_0xbd12('0x14')][_0xbd12('0x116')]=function(_0x54c0d2){logger['info'](util[_0xbd12('0x2d')](_0xbd12('0x117'),_0x54c0d2['label']));if(_0x54c0d2[_0xbd12('0xad')]===0x0){return this[_0xbd12('0x118')](_0x54c0d2);}_0x54c0d2[_0xbd12('0xad')]-=0x1;if(!this[_0xbd12('0x8b')](_0x54c0d2[_0xbd12('0x119')])){return this[_0xbd12('0x11')]['error'](_0x54c0d2,'no\x20file\x20audio\x20selected');}var _0x19bfe3=this['getSound'][_0xbd12('0x73')](this,_0x54c0d2[_0xbd12('0x119')]);if(!_0x19bfe3){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x54c0d2,_0xbd12('0x11a'));}if(!this['isConfigured'](_0x54c0d2['variable_id'])){return this['channel']['error'](_0xbd12('0xde'));}var _0x526c58=this[_0xbd12('0x11')]['getData'](_0x19bfe3,_0x54c0d2[_0xbd12('0x11b')],_0x54c0d2['maxdigit']);var _0x12a328=_0x526c58[_0xbd12('0xab')]?_0x526c58[_0xbd12('0xab')][_0xbd12('0x4f')]():'';logger['info']('test',JSON[_0xbd12('0x77')](_0x526c58));if(_0x526c58[_0xbd12('0xab')]===-0x1){this[_0xbd12('0x3a')]['sync'](this,_0x54c0d2,_0x12a328);return _0x526c58;}else if(_0x526c58[_0xbd12('0xa9')]===_0xbd12('0x69')){_0x526c58['result']=_0x12a328['length']>=parseInt(_0x54c0d2['mindigit'])?'x':'i';}else{_0x526c58[_0xbd12('0xab')]=_0x12a328[_0xbd12('0xa2')]>=parseInt(_0x54c0d2['mindigit'])&&_0x12a328['length']<=parseInt(_0x54c0d2[_0xbd12('0x11c')])?'x':'i';}var _0x5d4c84=this[_0xbd12('0x15')][_0xbd12('0x73')](this,_0x54c0d2[_0xbd12('0xdf')]);if(!_0x5d4c84){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x54c0d2,'no\x20variable\x20found');}this['channel'][_0xbd12('0xa6')](_0x5d4c84,_0x12a328);if(this[_0xbd12('0x8b')](_0x54c0d2[_0xbd12('0x11d')])){var _0xfd754b=parseInt(_0x54c0d2[_0xbd12('0x11d')],0xa);var _0x2dfcdb=rs[_0xbd12('0x11e')]({'charset':'*','length':_0xfd754b});var _0x4cef8a=_0x12a328[_0xbd12('0xa2')];if(_0x4cef8a>0x0){if(_0x4cef8a>_0xfd754b){this[_0xbd12('0x3a')]['sync'](this,_0x54c0d2,_0x54c0d2[_0xbd12('0x11f')]===_0xbd12('0x120')?_0x2dfcdb+_0x12a328[_0xbd12('0x121')](_0xfd754b):_0x12a328[_0xbd12('0x121')](0x0,_0x4cef8a-_0xfd754b)+_0x2dfcdb);}else{this[_0xbd12('0x3a')][_0xbd12('0x73')](this,_0x54c0d2,rs['generate']({'charset':'*','length':_0x4cef8a}));}}else{this[_0xbd12('0x3a')]['sync'](this,_0x54c0d2,'');}}else{this[_0xbd12('0x3a')]['sync'](this,_0x54c0d2,_0x12a328);}return _0x526c58;};AGIVertices['prototype'][_0xbd12('0x10')]=function(_0x198427){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x122'),_0x198427[_0xbd12('0x3c')]));return this[_0xbd12('0x116')](_0x198427);};AGIVertices['prototype'][_0xbd12('0x123')]=function(_0x57c682){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x124'),_0x57c682[_0xbd12('0x3c')]));this['createSquareDetailsReport'][_0xbd12('0x73')](this,_0x57c682,_0x57c682[_0xbd12('0x125')]);return this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x126'),_0x57c682['goalname']));};AGIVertices[_0xbd12('0x14')]['awspolly']=function(_0x416542){logger['info'](util[_0xbd12('0x2d')](_0xbd12('0x127'),_0x416542[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x416542[_0xbd12('0x8e')])||!this['isConfigured'](_0x416542[_0xbd12('0x8f')])){return this[_0xbd12('0x11')]['noop'](_0xbd12('0x128'));}if(!this[_0xbd12('0x8b')](_0x416542['text'])){return this['channel'][_0xbd12('0xae')]('no\x20text\x20configured');}this[_0xbd12('0x11')][_0xbd12('0xae')](util['format'](_0xbd12('0x129'),_0x416542[_0xbd12('0x61')]));var _0x2bbbb6=this['awsPolly'][_0xbd12('0x73')](this,_0x416542);if(_0x2bbbb6){this[_0xbd12('0x11')][_0xbd12('0xae')](util['format'](_0xbd12('0x12a'),_0x2bbbb6));var _0x21c410=this['channel'][_0xbd12('0x107')](_0x2bbbb6);try{fs[_0xbd12('0x12b')](_0x2bbbb6+_0xbd12('0x108'));}catch(_0x2db159){logger[_0xbd12('0x30')](_0x2db159);}return _0x21c410;}return this['channel'][_0xbd12('0x30')](_0x416542,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xbd12('0x14')][_0xbd12('0x12c')]=function(_0x29058b){logger[_0xbd12('0x32')](util['format'](_0xbd12('0x12d'),_0x29058b[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x29058b[_0xbd12('0x8e')])||!this['isConfigured'](_0x29058b[_0xbd12('0x8f')])){return this['channel'][_0xbd12('0xae')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xbd12('0x8b')](_0x29058b[_0xbd12('0x12e')])){return this[_0xbd12('0x11')]['noop'](_0xbd12('0x12f'));}if(!this['isConfigured'](_0x29058b[_0xbd12('0x61')])){return this['channel'][_0xbd12('0xae')](_0xbd12('0xc9'));}this[_0xbd12('0x11')][_0xbd12('0xef')]=!![];this[_0xbd12('0x3a')](_0x29058b);this[_0xbd12('0x46')](_0x29058b['text'],'in','','');this[_0xbd12('0x11')]['noop'](util[_0xbd12('0x2d')]('Trying\x20Amazon\x20Lex:\x20%s',_0x29058b['text']));var _0x2c01fc=this[_0xbd12('0x94')][_0xbd12('0x73')](this,_0x29058b);if(_0x2c01fc){for(var _0x3e8710 in _0x2c01fc){if(_0x2c01fc[_0xbd12('0xa0')](_0x3e8710)&&_['isString'](_0x2c01fc[_0x3e8710])){this['channel'][_0xbd12('0xa6')](util['format'](_0xbd12('0x130'),_0x3e8710[_0xbd12('0x6d')]()),_0x2c01fc[_0x3e8710]);}}if(_[_0xbd12('0x49')](_0x2c01fc[_0xbd12('0x7b')])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0x131'));}else{this[_0xbd12('0x46')](_0x2c01fc[_0xbd12('0x7b')],'out',_0xbd12('0x132'),'');return this[_0xbd12('0x11')][_0xbd12('0xae')](util['format'](_0xbd12('0x133'),_0x2c01fc[_0xbd12('0x7b')]));}}return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x29058b,_0xbd12('0x134'));};AGIVertices[_0xbd12('0x14')][_0xbd12('0x135')]=function(_0x421a36){logger['info'](util[_0xbd12('0x2d')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x421a36[_0xbd12('0x3c')],_0x421a36[_0xbd12('0x69')]));if(!this[_0xbd12('0x8b')](_0x421a36['key'])){return this['channel'][_0xbd12('0xae')](_0xbd12('0x136'));}var _0x49ce85=_0xbd12('0x137');var _0x2483b8=util['format'](_0xbd12('0x138'),FILES_PATH,rs[_0xbd12('0x11e')](0x4));var _0x2db20e=util[_0xbd12('0x2d')]('%s.%s',_0x2483b8,_0x49ce85);var _0xfe7d43=!![];if(_0x421a36[_0xbd12('0x139')]===_0xbd12('0x13a')){_0xfe7d43=![];}var _0x98843c=this[_0xbd12('0x11')][_0xbd12('0x13b')](_0x2483b8,_0x49ce85,_0x421a36[_0xbd12('0x13c')],_0x421a36[_0xbd12('0x69')],undefined,_0xfe7d43);if(_0x98843c['result']!==-0x1){this['channel'][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x13d'),_0x2db20e));var _0x362c2f=this[_0xbd12('0x96')]['sync'](this,_0x421a36,_0x2db20e);if(_0x362c2f){for(var _0x3a6927 in _0x362c2f){if(_0x362c2f[_0xbd12('0xa0')](_0x3a6927)){this[_0xbd12('0x11')][_0xbd12('0xa6')](util['format'](_0xbd12('0x13e'),_0x3a6927[_0xbd12('0x6d')]()),_0x362c2f[_0x3a6927]);}}return this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x362c2f)));}}return _0x98843c;};AGIVertices[_0xbd12('0x14')][_0xbd12('0x13f')]=function(_0x3408a2){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x140'),_0x3408a2[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x3408a2[_0xbd12('0x141')])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0x142'));}if(!this['isConfigured'](_0x3408a2['appsecret'])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0x143'));}var _0x51db67=_0xbd12('0x137');var _0x2e61ae=util['format'](_0xbd12('0x138'),FILES_PATH,rs[_0xbd12('0x11e')](0x4));var _0x683ae9=util[_0xbd12('0x2d')](_0xbd12('0xa4'),_0x2e61ae,_0x51db67);var _0x23546c=!![];if(_0x3408a2['beep']===_0xbd12('0x13a')){_0x23546c=![];}var _0x279338=this['channel']['recordFile'](_0x2e61ae,_0x51db67,_0x3408a2[_0xbd12('0x13c')],_0x3408a2[_0xbd12('0x69')],undefined,_0x23546c);if(_0x279338['result']!==-0x1){this[_0xbd12('0x11')]['noop'](util[_0xbd12('0x2d')]('tilde\x20%s\x20file\x20created',_0x683ae9));var _0x4dd6a9=this['tildeASR'][_0xbd12('0x73')](this,_0x3408a2,_0x683ae9);if(_0x4dd6a9){for(var _0x422711 in _0x4dd6a9){if(_0x4dd6a9['hasOwnProperty'](_0x422711)){this['channel'][_0xbd12('0xa6')](util[_0xbd12('0x2d')](_0xbd12('0x144'),_0x422711[_0xbd12('0x6d')]()),_0x4dd6a9[_0x422711]);}}return this[_0xbd12('0x11')]['noop'](util[_0xbd12('0x2d')]('TildeASR\x20Result\x20%s',JSON[_0xbd12('0x77')](_0x4dd6a9)));}}return _0x279338;};AGIVertices[_0xbd12('0x14')][_0xbd12('0x145')]=function(_0x41067b){logger[_0xbd12('0x32')](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x41067b[_0xbd12('0x3c')]));return this[_0xbd12('0x11')][_0xbd12('0x146')](_0x41067b['context'],_0x41067b[_0xbd12('0x42')],_0x41067b[_0xbd12('0x43')]);};AGIVertices[_0xbd12('0x14')]['gotoif']=function(_0x12cfa9){logger[_0xbd12('0x32')](util['format'](_0xbd12('0x147'),_0x12cfa9[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x12cfa9[_0xbd12('0x148')])){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x12cfa9,_0xbd12('0x149'));}try{var _0x36e11f=eval(_0x12cfa9[_0xbd12('0x148')])?_0xbd12('0x14a'):_0xbd12('0x14b');this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x14c'),_0x12cfa9[_0xbd12('0x148')],_0x36e11f));return{'code':0xc8,'result':_0x36e11f};}catch(_0x5c1f12){return{'code':0xc8,'result':_0xbd12('0x14b')};}};AGIVertices['prototype']['gotoiftime']=function(_0x4b7e1b){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x14d'),_0x4b7e1b[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x4b7e1b[_0xbd12('0x14e')])){return this[_0xbd12('0x11')]['error'](_0x4b7e1b,_0xbd12('0x14f'));}var _0x1e0043=this['getIntervals'][_0xbd12('0x73')](this,_0x4b7e1b[_0xbd12('0x14e')]);if(!_0x1e0043){return this['channel'][_0xbd12('0x30')](_0x4b7e1b,_0xbd12('0x150'));}for(var _0x964f21=0x0;_0x964f21<_0x1e0043[_0xbd12('0xa2')];_0x964f21+=0x1){var _0x59ccd8=this[_0xbd12('0x11')][_0xbd12('0x15')](util[_0xbd12('0x2d')](_0xbd12('0x151'),_0x1e0043[_0x964f21]));if(_0x59ccd8['result']===-0x1){return _0x59ccd8;}logger['info'](util[_0xbd12('0x2d')](_0xbd12('0x152'),_0x1e0043[_0x964f21],_0x59ccd8[_0xbd12('0xa9')]));if(_0x59ccd8[_0xbd12('0xa9')]===_0xbd12('0x14a')){logger['info'](util['format'](_0xbd12('0x152'),_0x1e0043[_0x964f21],_0xbd12('0x14a')));this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x152'),_0x1e0043[_0x964f21],_0xbd12('0x14a')));return{'code':0xc8,'result':_0xbd12('0x14a')};}else{logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x152'),_0x1e0043[_0x964f21],'false'));this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')]('IFTIME\x20%s\x20%s',_0x1e0043[_0x964f21],_0xbd12('0x14b')));}}return{'code':0xc8,'result':_0xbd12('0x14b')};};AGIVertices['prototype'][_0xbd12('0x153')]=function(_0x78fe27){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x78fe27['label']));return this['channel']['hangup']();};AGIVertices[_0xbd12('0x14')][_0xbd12('0x154')]=function(_0xc18279){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x155'),_0xc18279[_0xbd12('0x3c')]));if(!this['isConfigured'](_0xc18279[_0xbd12('0x7f')])){return this[_0xbd12('0x11')]['noop'](_0xbd12('0x136'));}var _0x2e2d19='wav';var _0x1e2c53=util[_0xbd12('0x2d')](_0xbd12('0x138'),FILES_PATH,rs[_0xbd12('0x11e')](0x4));var _0x39bcca=util[_0xbd12('0x2d')](_0xbd12('0xa4'),_0x1e2c53,_0x2e2d19);var _0x2c6604=!![];if(_0xc18279[_0xbd12('0x139')]===_0xbd12('0x13a')){_0x2c6604=![];}var _0x18216e=this[_0xbd12('0x11')]['recordFile'](_0x1e2c53,_0x2e2d19,_0xc18279[_0xbd12('0x13c')],_0xc18279['timeout'],undefined,_0x2c6604);if(_0x18216e[_0xbd12('0xab')]!==-0x1){this[_0xbd12('0x11')][_0xbd12('0xae')](util['format'](_0xbd12('0x156'),_0x39bcca));var _0x37abfa=this[_0xbd12('0x89')][_0xbd12('0x73')](this,_0xc18279,_0x39bcca);if(_0x37abfa){for(var _0x4d205b in _0x37abfa){if(_0x37abfa[_0xbd12('0xa0')](_0x4d205b)){this[_0xbd12('0x11')][_0xbd12('0xa6')](util[_0xbd12('0x2d')](_0xbd12('0x157'),_0x4d205b[_0xbd12('0x6d')]()),_0x37abfa[_0x4d205b]);}}return this[_0xbd12('0x11')][_0xbd12('0xae')](util['format'](_0xbd12('0x158'),JSON[_0xbd12('0x77')](_0x37abfa)));}}return _0x18216e;};AGIVertices[_0xbd12('0x14')][_0xbd12('0x159')]=function(_0x10d30e){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x15a'),_0x10d30e[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x10d30e[_0xbd12('0x7f')])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0x136'));}if(!this[_0xbd12('0x8b')](_0x10d30e['text'])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0xc9'));}this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x15b'),_0x10d30e['text']));var _0x371afc=this[_0xbd12('0x86')][_0xbd12('0x73')](this,_0x10d30e);if(_0x371afc){this[_0xbd12('0x11')]['noop'](util[_0xbd12('0x2d')](_0xbd12('0x156'),_0x371afc));var _0x46f1db=this[_0xbd12('0x11')][_0xbd12('0x107')](_0x371afc,_0x10d30e[_0xbd12('0x13c')]);try{fs[_0xbd12('0x12b')](_0x371afc+_0xbd12('0x108'));}catch(_0x30a0c5){logger[_0xbd12('0x30')](_0x30a0c5);}return _0x46f1db;}return this[_0xbd12('0x11')]['error'](_0x10d30e,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xbd12('0x14')]['login']=function(_0x4ae50c){logger[_0xbd12('0x32')](util['format'](_0xbd12('0x15c'),_0x4ae50c[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x4ae50c['findBy'])){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x4ae50c,_0xbd12('0x15d'));}logger[_0xbd12('0x32')](util[_0xbd12('0x2d')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbd12('0x11')][_0xbd12('0x55')],_0x4ae50c[_0xbd12('0x15e')]));var _0x3da4dd=this['agentLogin'][_0xbd12('0x73')](this,_0x4ae50c[_0xbd12('0x15e')]);if(_0x3da4dd){logger['info'](util['format'](_0xbd12('0x15f'),this[_0xbd12('0x11')][_0xbd12('0x55')],_0x4ae50c[_0xbd12('0x15e')]));this['channel'][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x15f'),this[_0xbd12('0x11')]['callerid'],_0x4ae50c[_0xbd12('0x15e')]));return{'code':0xc8,'result':_0xbd12('0x160')};}else{logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x161'),this[_0xbd12('0x11')]['callerid'],_0x4ae50c[_0xbd12('0x15e')]));this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x161'),this[_0xbd12('0x11')]['callerid'],_0x4ae50c[_0xbd12('0x15e')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xbd12('0x14')][_0xbd12('0x162')]=function(_0x180176){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x163'),_0x180176['label']));if(!this[_0xbd12('0x8b')](_0x180176[_0xbd12('0x15e')])){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x180176,_0xbd12('0x15d'));}logger['info'](util[_0xbd12('0x2d')](_0xbd12('0x164'),this[_0xbd12('0x11')][_0xbd12('0x55')],_0x180176[_0xbd12('0x15e')]));var _0x3852ce=this[_0xbd12('0x57')][_0xbd12('0x73')](this,_0x180176[_0xbd12('0x15e')]);if(_0x3852ce){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xbd12('0x11')]['callerid'],_0x180176[_0xbd12('0x15e')]));this['channel'][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x15f'),this[_0xbd12('0x11')]['callerid'],_0x180176[_0xbd12('0x15e')]));return{'code':0xc8,'result':_0xbd12('0x160')};}else{logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x161'),this[_0xbd12('0x11')][_0xbd12('0x55')],_0x180176[_0xbd12('0x15e')]));this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x161'),this[_0xbd12('0x11')][_0xbd12('0x55')],_0x180176[_0xbd12('0x15e')]));return{'code':0xc8,'result':_0xbd12('0x165')};}};AGIVertices['prototype'][_0xbd12('0x166')]=function(_0x9cbbcb){logger[_0xbd12('0x32')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x9cbbcb[_0xbd12('0x3c')]));if(!this['isConfigured'](_0x9cbbcb[_0xbd12('0x167')])){return this['channel'][_0xbd12('0x30')](_0x9cbbcb,'no\x20operation\x20configured');}this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x168'),_0x9cbbcb[_0xbd12('0x167')]));var _0x24a6bb=eval(_0x9cbbcb[_0xbd12('0x167')]);if(!this[_0xbd12('0x8b')](_0x9cbbcb[_0xbd12('0xdf')])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0xde'));}var _0x2f736e=this[_0xbd12('0x15')][_0xbd12('0x73')](this,_0x9cbbcb[_0xbd12('0xdf')]);if(!_0x2f736e){return this[_0xbd12('0x11')]['error'](_0x9cbbcb,_0xbd12('0xe0'));}if(_['isArray'](_0x24a6bb)){var _0x82e56d=this;_0x24a6bb[_0xbd12('0xe1')](function(_0xd9ac3b,_0x241351){_0x82e56d[_0xbd12('0x11')]['setVariable'](util[_0xbd12('0x2d')](_0xbd12('0x169'),_0x2f736e,_0x241351),_0xd9ac3b);});return this[_0xbd12('0x11')]['noop'](util[_0xbd12('0x2d')](_0xbd12('0x16a'),_0x2f736e));}else{return this[_0xbd12('0x11')]['setVariable'](_0x2f736e,_0x24a6bb);}};AGIVertices['prototype'][_0xbd12('0xf')]=function(_0x2f484c){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x16b'),_0x2f484c[_0xbd12('0x3c')]));if(_0x2f484c[_0xbd12('0xad')]===0x0){return this[_0xbd12('0x118')](_0x2f484c);}_0x2f484c[_0xbd12('0xad')]-=0x1;if(!this[_0xbd12('0x8b')](_0x2f484c['file_id'])){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x2f484c,_0xbd12('0x16c'));}var _0x481ec2=this[_0xbd12('0x21')][_0xbd12('0x73')](this,_0x2f484c[_0xbd12('0x119')]);if(!_0x481ec2){return this['channel']['error'](_0x2f484c,_0xbd12('0x11a'));}var _0x4f1973=this[_0xbd12('0x11')][_0xbd12('0x16d')](_0x481ec2,_0x2f484c[_0xbd12('0x11b')],_0x2f484c[_0xbd12('0x16e')]);var _0x44b666=_0x4f1973['result'];if(_0x4f1973[_0xbd12('0xab')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x2f484c,'-1');return _0x4f1973;}else if(_0x4f1973[_0xbd12('0xa9')]===_0xbd12('0x69')){_0x4f1973[_0xbd12('0xab')]=_0x4f1973['result'][_0xbd12('0xa2')]>0x0?_0x4f1973[_0xbd12('0xab')]:'t';}else if(_[_0xbd12('0x48')](_0x4f1973['result'])){_0x4f1973[_0xbd12('0xab')]='#';_0x44b666='#';}if(!this[_0xbd12('0x8b')](_0x2f484c[_0xbd12('0xdf')])){this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0xde'));}else{var _0xbe2001=this[_0xbd12('0x15')]['sync'](this,_0x2f484c[_0xbd12('0xdf')]);if(!_0xbe2001){return this[_0xbd12('0x11')]['error'](_0x2f484c,_0xbd12('0xe0'));}this[_0xbd12('0x11')]['setVariable'](_0xbe2001,_0x44b666);}this[_0xbd12('0x3a')][_0xbd12('0x73')](this,_0x2f484c,_0x44b666);return _0x4f1973;};AGIVertices[_0xbd12('0x14')][_0xbd12('0xae')]=function(_0xa6ba90){logger[_0xbd12('0x32')](util['format'](_0xbd12('0x16f'),_0xa6ba90[_0xbd12('0x3c')]));return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xa6ba90[_0xbd12('0x170')]||_0xa6ba90[_0xbd12('0x3c')]);};AGIVertices[_0xbd12('0x14')][_0xbd12('0x171')]=function(_0x2b6ff6){logger['info'](util['format'](_0xbd12('0x172'),_0x2b6ff6[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x2b6ff6[_0xbd12('0x15e')])){return this['channel'][_0xbd12('0x30')](_0x2b6ff6,_0xbd12('0x15d'));}logger[_0xbd12('0x32')](util[_0xbd12('0x2d')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbd12('0x11')][_0xbd12('0x55')],_0x2b6ff6[_0xbd12('0x15e')]));var _0x31421f=this[_0xbd12('0x51')][_0xbd12('0x73')](this,_0x2b6ff6[_0xbd12('0x173')]);var _0x495d37=this[_0xbd12('0x53')][_0xbd12('0x73')](this,_0x2b6ff6[_0xbd12('0x15e')],_0x31421f);if(_0x495d37){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xbd12('0x55')],_0x2b6ff6[_0xbd12('0x15e')]));this['channel'][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x15f'),this[_0xbd12('0x11')][_0xbd12('0x55')],_0x2b6ff6[_0xbd12('0x15e')]));return{'code':0xc8,'result':_0xbd12('0x160')};}else{logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x161'),this[_0xbd12('0x11')][_0xbd12('0x55')],_0x2b6ff6[_0xbd12('0x15e')]));this[_0xbd12('0x11')][_0xbd12('0xae')](util['format'](_0xbd12('0x15f'),this['channel'][_0xbd12('0x55')],_0x2b6ff6[_0xbd12('0x15e')]));return{'code':0xc8,'result':_0xbd12('0x165')};}};AGIVertices['prototype'][_0xbd12('0x174')]=function(_0x2b70a0){logger[_0xbd12('0x32')](util['format'](_0xbd12('0x175'),_0x2b70a0['label']));if(!this[_0xbd12('0x8b')](_0x2b70a0[_0xbd12('0x119')])){return this['channel'][_0xbd12('0x30')](_0x2b70a0,_0xbd12('0x16c'));}var _0x30ea18=this['getSound'][_0xbd12('0x73')](this,_0x2b70a0['file_id']);if(!_0x30ea18){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x2b70a0,'no\x20file\x20audio\x20found');}var _0x4bda4a=this[_0xbd12('0x11')][_0xbd12('0xaf')](_0xbd12('0x176'),[_0x30ea18,_0x2b70a0[_0xbd12('0xeb')]]);if(_0x4bda4a[_0xbd12('0xab')]===-0x1){return _0x4bda4a;}return this[_0xbd12('0x11')]['noop'](util[_0xbd12('0x2d')]('Executed\x20command\x20%s\x20%s',_0xbd12('0x176'),_0x30ea18));};AGIVertices['prototype']['queue']=function(_0x456fac){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x177'),_0x456fac[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x456fac['queue_id'])){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x456fac,'no\x20queue\x20selected');}var _0x476d75='';var _0xc35fef=parseInt(_0x456fac[_0xbd12('0x178')],0xa);if(isNaN(_0xc35fef)){_0x476d75=_0x456fac[_0xbd12('0x178')];}else{_0x476d75=this[_0xbd12('0x19')][_0xbd12('0x73')](this,_0x456fac['queue_id']);if(!_0x476d75){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x456fac,_0xbd12('0x179'));}}var _0x24cdbc='';if(this[_0xbd12('0x8b')](_0x456fac[_0xbd12('0x119')])){var _0x2fca2a=this['getSound'][_0xbd12('0x73')](this,_0x456fac[_0xbd12('0x119')]);if(_0x2fca2a){_0x24cdbc=_0x2fca2a;}}this['createSquareDetailsReport'][_0xbd12('0x73')](this,_0x456fac,_0x476d75);if(_0x456fac[_0xbd12('0xeb')]['indexOf']('x')<0x0){_0x456fac[_0xbd12('0xeb')]+='x';}if(_0x456fac['opts'][_0xbd12('0x17a')]('X')<0x0){_0x456fac[_0xbd12('0xeb')]+='X';}this[_0xbd12('0x11')]['setVariable'](_0xbd12('0x17b'),_0x476d75?_0x476d75['toLowerCase']():'');var _0x4c18de=this[_0xbd12('0x11')][_0xbd12('0xaf')]('QUEUE',[_0x476d75,_0x456fac[_0xbd12('0xeb')],_0x456fac[_0xbd12('0x68')],_0x24cdbc,_0x456fac['timeout'],_0x456fac[_0xbd12('0x9')],_0x456fac[_0xbd12('0x17c')],_0x456fac[_0xbd12('0x17d')],'',_0x456fac[_0xbd12('0x17e')]]);if(_0x4c18de['result']===-0x1){return _0x4c18de;}return this[_0xbd12('0x11')]['noop'](util[_0xbd12('0x2d')]('Executed\x20command\x20%s\x20%s',_0xbd12('0x17f'),_0x476d75));};AGIVertices[_0xbd12('0x14')]['record']=function(_0x58e265){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x180'),_0x58e265['label']));var _0x3be741=_0x58e265[_0xbd12('0x181')]||_0xbd12('0x137');var _0x3d6c5c=util['format'](_0xbd12('0x182'),this[_0xbd12('0x11')][_0xbd12('0x3b')],rs['generate'](0x5));var _0x303472=util[_0xbd12('0x2d')](_0xbd12('0x183'),FILES_PATH,_0x3d6c5c,_0x3be741);var _0x437403=util['format'](_0xbd12('0x138'),FILES_PATH,_0x3d6c5c);this[_0xbd12('0x3f')]['sync'](this,_0x58e265,_0x3d6c5c,_0x303472);this[_0xbd12('0x11')]['setVariable'](_0xbd12('0x184'),_0x3d6c5c);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x437403,_0x3be741,_0x58e265['escape_digits'],_0x58e265['timeout']);return this['channel'][_0xbd12('0x13b')](_0x437403,_0x3be741,_0x58e265[_0xbd12('0x185')],_0x58e265[_0xbd12('0x69')],undefined,!![]);};AGIVertices['prototype'][_0xbd12('0x186')]=function(_0x33d52d){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x187'),_0x33d52d['label']));if(!this['isConfigured'](_0x33d52d[_0xbd12('0x68')])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0x188'));}var _0x59beee=this['restAPI'][_0xbd12('0x73')](this,_0x33d52d);logger['info'](util['format'](_0xbd12('0x189'),util[_0xbd12('0x18a')](_0x59beee,{'showHidden':![],'depth':null})));if(!this[_0xbd12('0x8b')](_0x33d52d[_0xbd12('0xdf')])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0x18b'));}var _0x53a036=this['getVariable']['sync'](this,_0x33d52d[_0xbd12('0xdf')]);if(!_0x53a036){return this[_0xbd12('0x11')]['error'](_0x33d52d,'no\x20variable\x20found');}this[_0xbd12('0x11')][_0xbd12('0xa6')](util[_0xbd12('0x2d')](_0xbd12('0x18c'),_0x53a036),_0x59beee[_0xbd12('0x79')]?_0x59beee['statusCode']:'200');this[_0xbd12('0x11')]['setVariable'](util[_0xbd12('0x2d')](_0xbd12('0x18d'),_0x53a036),_0x59beee[_0xbd12('0x7a')]?_0x59beee[_0xbd12('0x7a')]:'OK');if(_0x59beee['body']){try{this[_0xbd12('0xa3')](_0x59beee[_0xbd12('0x6e')],_0x53a036);}catch(_0x42c683){logger[_0xbd12('0x30')](util[_0xbd12('0x2d')](_0xbd12('0x18e'),_0x53a036));}}return this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')]('variable\x20%s\x20set',_0x53a036));};AGIVertices[_0xbd12('0x14')][_0xbd12('0x18f')]=function(_0x4cde8a){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x190'),_0x4cde8a[_0xbd12('0x3c')]));return this['channel'][_0xbd12('0x191')](_0x4cde8a['digits'][_0xbd12('0xdc')](/\s+/g,''),_0x4cde8a[_0xbd12('0x185')]);};AGIVertices[_0xbd12('0x14')]['saynumber']=function(_0x30272a){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x30272a[_0xbd12('0x3c')]));return this[_0xbd12('0x11')][_0xbd12('0x192')](_0x30272a[_0xbd12('0x193')][_0xbd12('0xdc')](/\s+/g,''),_0x30272a[_0xbd12('0x185')]);};AGIVertices[_0xbd12('0x14')][_0xbd12('0x194')]=function(_0x577d5f){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x195'),_0x577d5f['label']));return this[_0xbd12('0x11')][_0xbd12('0x196')](_0x577d5f[_0xbd12('0x61')],_0x577d5f[_0xbd12('0x185')]);};AGIVertices[_0xbd12('0x14')][_0xbd12('0x197')]=function(_0x3e96fd){logger[_0xbd12('0x32')](util['format'](_0xbd12('0x198'),_0x3e96fd[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x3e96fd['account_id'])){return this['channel'][_0xbd12('0xae')](_0xbd12('0x199'));}var _0x553e16=this[_0xbd12('0x24')]['sync'](this,_0x3e96fd[_0xbd12('0x19a')]);if(!_0x553e16||!_0x553e16['Smtp']){return this['channel'][_0xbd12('0x30')](_0x3e96fd,_0xbd12('0x19b'));}var _0xa54de1={'from':util[_0xbd12('0x2d')](_0xbd12('0x19c'),_0x553e16['name'],_0x553e16[_0xbd12('0x19d')]||_0x553e16['Smtp'][_0xbd12('0x19e')]),'to':_0x3e96fd['to']||'','cc':_0x3e96fd['cc']||'','bcc':_0x3e96fd[_0xbd12('0x19f')]||'','subject':_0x3e96fd[_0xbd12('0x1a0')],'html':_0x3e96fd['text'],'text':_0x3e96fd[_0xbd12('0x61')]};var _0x72a3fa={'tls':{'rejectUnauthorized':![]}};if(_0x553e16['Smtp'][_0xbd12('0x1a1')]){_0x72a3fa[_0xbd12('0x1a1')]=_0x553e16[_0xbd12('0x1a2')][_0xbd12('0x1a1')];}else{_0x72a3fa[_0xbd12('0x1a3')]=_0x553e16['Smtp']['host'];_0x72a3fa[_0xbd12('0x1a4')]=_0x553e16['Smtp'][_0xbd12('0x1a4')];_0x72a3fa[_0xbd12('0x1a5')]=_0x553e16['Smtp'][_0xbd12('0x1a5')];}if(_0x553e16[_0xbd12('0x1a2')][_0xbd12('0x1a6')]){_0x72a3fa[_0xbd12('0x1a7')]={'user':_0x553e16[_0xbd12('0x1a2')][_0xbd12('0x19e')],'pass':_0x553e16[_0xbd12('0x1a2')][_0xbd12('0x1a8')]};}if(this[_0xbd12('0x8b')](_0x3e96fd[_0xbd12('0x1a9')])){}logger[_0xbd12('0xe5')](_0xbd12('0x1aa'),JSON['stringify'](_0xa54de1));this[_0xbd12('0x3a')][_0xbd12('0x73')](this,_0x3e96fd,_0x3e96fd[_0xbd12('0x19a')]);this['channel'][_0xbd12('0xae')](util[_0xbd12('0x2d')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x553e16[_0xbd12('0x1a')]));this[_0xbd12('0x26')]['sync'](this,_0x72a3fa,_0xa54de1);return this['channel'][_0xbd12('0xae')](_0xbd12('0x1ab'));};AGIVertices[_0xbd12('0x14')][_0xbd12('0x1ac')]=function(_0x1d553c){logger['info'](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x1d553c[_0xbd12('0x3c')]));return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0x1ad'));};AGIVertices['prototype'][_0xbd12('0x1ae')]=function(_0x35b090){logger[_0xbd12('0x32')](util['format'](_0xbd12('0x1af'),_0x35b090[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x35b090[_0xbd12('0x1b0')])){return this[_0xbd12('0x11')][_0xbd12('0xae')]('no\x20sms\x20account\x20configured');}var _0x26ef1e=this[_0xbd12('0x1b1')][_0xbd12('0x73')](this,_0x35b090[_0xbd12('0x1b0')]);if(!_0x26ef1e){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x35b090,_0xbd12('0x1b2'));}var _0x38175d={'body':_0x35b090[_0xbd12('0x1b3')],'phone':_0x35b090['to']||'','SmsAccountId':_0x26ef1e['id']};logger[_0xbd12('0xe5')]('sendSMS\x20message',JSON['stringify'](_0x38175d));this[_0xbd12('0x3a')][_0xbd12('0x73')](this,_0x35b090,_0x35b090[_0xbd12('0x1b0')]);this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x1b4'),_0x26ef1e['name']));this[_0xbd12('0x39')][_0xbd12('0x73')](this,_0x38175d);return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0x1b5'));};AGIVertices[_0xbd12('0x14')]['set']=function(_0xa1d9ba){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x1b6'),_0xa1d9ba['label']));if(!this[_0xbd12('0x8b')](_0xa1d9ba[_0xbd12('0xdf')])){return this[_0xbd12('0x11')]['error'](_0xa1d9ba,_0xbd12('0x1b7'));}var _0x19732b=this[_0xbd12('0x15')][_0xbd12('0x73')](this,_0xa1d9ba[_0xbd12('0xdf')]);if(!_0x19732b){return this['channel']['error'](_0xa1d9ba,'no\x20variable\x20found');}return this[_0xbd12('0x11')][_0xbd12('0xa6')](_0x19732b,_0xa1d9ba[_0xbd12('0x1b8')]);};AGIVertices['prototype'][_0xbd12('0x1b9')]=function(_0x563619){logger['info'](util['format'](_0xbd12('0x1ba'),_0x563619[_0xbd12('0x3c')]));this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0x1bb'));if(_0x563619[_0xbd12('0xbc')]==='yes'){this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0x1bc'));return this[_0xbd12('0x11')]['answer']();}return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0x1bd'));};AGIVertices[_0xbd12('0x14')][_0xbd12('0x1be')]=function(_0x2ad1d1){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x1bf'),_0x2ad1d1[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x2ad1d1[_0xbd12('0x1c0')])){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x2ad1d1,_0xbd12('0x1c1'));}var _0x5cf154=this['getSquareProject']['sync'](this,_0x2ad1d1[_0xbd12('0x1c0')]);if(!this['isConfigured'](_0x5cf154)){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x2ad1d1,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0x2ad1d1[_0xbd12('0x1c0')]));}if(_0x5cf154===this[_0xbd12('0x11')][_0xbd12('0x3e')]){return this['channel']['error'](_0x2ad1d1,_0xbd12('0x1c2'));}this[_0xbd12('0x3a')][_0xbd12('0x73')](this,_0x2ad1d1,_0x5cf154);var _0x221e7d=this[_0xbd12('0x11')]['exec']('AGI',util[_0xbd12('0x2d')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0xbd12('0x1a3')]||_0xbd12('0x1c3'),_0x5cf154,this[_0xbd12('0x11')][_0xbd12('0x3e')]));if(_0x221e7d['result']===-0x1){return _0x221e7d;}return this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x1c4'),_0xbd12('0x1c5'),_0x5cf154));};AGIVertices[_0xbd12('0x14')][_0xbd12('0x1c6')]=function(_0x4e1c3a){logger[_0xbd12('0x32')](util['format'](_0xbd12('0x1c7'),_0x4e1c3a[_0xbd12('0x3c')]));var _0x240704=this[_0xbd12('0x5c')][_0xbd12('0x73')](this,_0x4e1c3a[_0xbd12('0x1c8')]);this[_0xbd12('0x3a')][_0xbd12('0x73')](this,_0x4e1c3a,_0x4e1c3a[_0xbd12('0x1c8')]);if(this[_0xbd12('0x8b')](_0x4e1c3a[_0xbd12('0xdf')])){var _0x500aad=this[_0xbd12('0x15')][_0xbd12('0x73')](this,_0x4e1c3a[_0xbd12('0xdf')]);if(_0x500aad){this[_0xbd12('0x11')][_0xbd12('0xa6')](_0x500aad,_0x240704);return this[_0xbd12('0x11')]['noop'](util[_0xbd12('0x2d')](_0xbd12('0x1c9'),_0x4e1c3a['command'],_0x500aad));}}return this[_0xbd12('0x11')]['noop'](util[_0xbd12('0x2d')](_0xbd12('0x1ca'),_0x4e1c3a[_0xbd12('0x1c8')]));};AGIVertices['prototype'][_0xbd12('0x1cb')]=function(_0xec316c){logger[_0xbd12('0x32')](util['format'](_0xbd12('0x1cc'),_0xec316c['label']));_0xec316c[_0xbd12('0x61')]=_0xec316c[_0xbd12('0x61')][_0xbd12('0xdc')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0xec316c[_0xbd12('0x5f')])){return this['channel']['noop']('no\x20apiKey\x20configured');}if(!this[_0xbd12('0x8b')](_0xec316c[_0xbd12('0x61')])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0xc9'));}this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x1cd'),_0xec316c[_0xbd12('0x61')]));var _0x25e76a=this['googleCloudTTS'][_0xbd12('0x73')](this,_0xec316c);if(_0x25e76a){this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x1ce'),_0x25e76a));var _0x581fc8=this[_0xbd12('0x11')][_0xbd12('0x107')](_0x25e76a);try{fs[_0xbd12('0x12b')](_0x25e76a+_0xbd12('0x108'));}catch(_0x1fd541){logger['error'](_0x1fd541);}return _0x581fc8;}return this[_0xbd12('0x11')]['error'](_0xec316c,_0xbd12('0x1cf'));};AGIVertices[_0xbd12('0x14')][_0xbd12('0x1d0')]=function(_0x2ab590){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x1d1'),_0x2ab590[_0xbd12('0x3c')]));_0x2ab590['text']=_0x2ab590[_0xbd12('0x61')][_0xbd12('0xdc')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xbd12('0x8b')](_0x2ab590[_0xbd12('0x61')])){return this[_0xbd12('0x11')][_0xbd12('0xae')](_0xbd12('0xc9'));}this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x1d2'),_0x2ab590[_0xbd12('0x61')]));var _0x391e2f=this[_0xbd12('0x66')][_0xbd12('0x73')](this,_0x2ab590);if(_0x391e2f){this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x1d3'),_0x391e2f));var _0x2c17e0=this[_0xbd12('0x11')][_0xbd12('0x107')](_0x391e2f);try{fs['unlink'](_0x391e2f+'.wav');}catch(_0x32aa63){logger['error'](_0x32aa63);}return _0x2c17e0;}return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x2ab590,_0xbd12('0x1d4'));};AGIVertices[_0xbd12('0x14')][_0xbd12('0x1d5')]=function(_0x44cef7){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x1d6'),_0x44cef7['label']));if(!this[_0xbd12('0x8b')](_0x44cef7['findBy'])){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x44cef7,_0xbd12('0x15d'));}logger['info'](util[_0xbd12('0x2d')](_0xbd12('0x164'),this['channel'][_0xbd12('0x55')],_0x44cef7['findBy']));var _0x3b700c=this[_0xbd12('0x56')][_0xbd12('0x73')](this,_0x44cef7[_0xbd12('0x15e')]);if(_0x3b700c){logger[_0xbd12('0x32')](util['format'](_0xbd12('0x15f'),this[_0xbd12('0x11')][_0xbd12('0x55')],_0x44cef7[_0xbd12('0x15e')]));this['channel']['noop'](util[_0xbd12('0x2d')](_0xbd12('0x15f'),this[_0xbd12('0x11')][_0xbd12('0x55')],_0x44cef7[_0xbd12('0x15e')]));return{'code':0xc8,'result':'success'};}else{logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x161'),this['channel'][_0xbd12('0x55')],_0x44cef7[_0xbd12('0x15e')]));this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xbd12('0x11')][_0xbd12('0x55')],_0x44cef7['findBy']));return{'code':0xc8,'result':_0xbd12('0x165')};}};AGIVertices[_0xbd12('0x14')][_0xbd12('0x1d7')]=function(_0x565e85){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x1d8'),_0x565e85[_0xbd12('0x3c')]));var _0x3958a8=this[_0xbd12('0x11')][_0xbd12('0xaf')]('VOICEMAIL',[_0x565e85[_0xbd12('0x1d9')],_0x565e85[_0xbd12('0x7d')]]);if(_0x3958a8[_0xbd12('0xab')]===-0x1){return _0x3958a8;}return this[_0xbd12('0x11')][_0xbd12('0xae')](util[_0xbd12('0x2d')](_0xbd12('0x1c4'),_0xbd12('0x1da'),_0x565e85[_0xbd12('0x1d9')]));};AGIVertices[_0xbd12('0x14')]['vswitch']=function(_0x294909){logger[_0xbd12('0x32')](util[_0xbd12('0x2d')](_0xbd12('0x1db'),_0x294909[_0xbd12('0x3c')]));if(!this[_0xbd12('0x8b')](_0x294909['variable_id'])){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x294909,_0xbd12('0x1b7'));}var _0xbaa341=this[_0xbd12('0x15')][_0xbd12('0x73')](this,_0x294909[_0xbd12('0xdf')]);if(!_0xbaa341){return this[_0xbd12('0x11')][_0xbd12('0x30')](_0x294909,_0xbd12('0xe0'));}var _0x2549a1=this[_0xbd12('0x11')]['getVariable'](_0xbaa341);return{'code':0xc8,'result':_0x2549a1[_0xbd12('0xa9')]?_0x2549a1[_0xbd12('0xa9')]:'-'};};String[_0xbd12('0x14')][_0xbd12('0xa8')]=function(_0x458561,_0x4e2f31){return this[_0xbd12('0xa7')](_0x458561)[_0xbd12('0x1dc')](_0x4e2f31);};module[_0xbd12('0x1dd')]=AGIVertices; \ No newline at end of file +var _0x8ba6=['no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','lumenvoxasr','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','SIP/%s','opts','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','googleDialogflow','DIALOGFLOW_%s','speech','dialogflow','Dialogflow\x20Result\x20%s','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','out','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','SESTEK_NDA_%s','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','DIAL','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','test','mindigit','maxdigit','hiddendigitsnum','generate','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','AWS_LEX_%s','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','wav','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','streamFile','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','statusCode','%s_STATUS_MESSAGE','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','email','Smtp','user','subject','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','start','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','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','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','lodash','odbc','randomstring','moment','mustache','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getSound','getSoundById','getSoundPath','getMailAccount','sendMailMessage','getIntervalById','interval','map','Intervals','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','createSquareRecording','uniqueid','callerid','calleridname','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','isNil','phone','list_id','callback','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','MALE','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','POST','PUT','toUpperCase','parse','headers','computedVariables','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','includes','isString','replaceObjectAllVariables','replaceAllVariables','hasOwnProperty','isPlainObject','recursiveNodeIndex','saveRestApiResult','%s.%s','isArray','setVariable','format','split','length','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','result','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar'];(function(_0x50bfbe,_0x35e70f){var _0x3fa8a6=function(_0x11fb23){while(--_0x11fb23){_0x50bfbe['push'](_0x50bfbe['shift']());}};_0x3fa8a6(++_0x35e70f);}(_0x8ba6,0x11b));var _0x68ba=function(_0x58b077,_0x538ad4){_0x58b077=_0x58b077-0x0;var _0x13f91d=_0x8ba6[_0x58b077];return _0x13f91d;};'use strict';var fs=require('fs');var path=require(_0x68ba('0x0'));var util=require('util');var _=require(_0x68ba('0x1'));var sh=require('shelljs');var odbc=require(_0x68ba('0x2'))();var rs=require(_0x68ba('0x3'));var moment=require(_0x68ba('0x4'));var Mustache=require(_0x68ba('0x5'));var rp=require('request-promise');var logger=require('../../config/logger')(_0x68ba('0x6'));var config=require(_0x68ba('0x7'));var scripts=require(_0x68ba('0x8'));var FILES_PATH=_0x68ba('0x9');var recursiveMapAttributes=[_0x68ba('0xa'),_0x68ba('0xb')];var verticesWithRetry=[_0x68ba('0xc'),_0x68ba('0xd'),'getsecretdigits'];var AGIVertices=function(_0x33891a,_0x31bec9,_0x1ec922){this[_0x68ba('0xe')]=_0x33891a;this[_0x68ba('0xf')]=_0x31bec9;this[_0x68ba('0x10')]=_0x1ec922;};AGIVertices[_0x68ba('0x11')][_0x68ba('0x12')]=function(_0x2535ed,_0x2b7f65){this['rpc'][_0x68ba('0x13')](_0x2535ed)[_0x68ba('0x14')](function(_0x505116){_0x2b7f65(null,_0x505116?_0x505116['name']:![]);})[_0x68ba('0x15')](function(_0x577fe8){_0x2b7f65(_0x577fe8);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x16')]=function(_0x43e6cb,_0x382b39){this[_0x68ba('0xf')][_0x68ba('0x17')](_0x43e6cb)[_0x68ba('0x14')](function(_0x4c2693){_0x382b39(null,_0x4c2693?_0x4c2693[_0x68ba('0x18')]:![]);})[_0x68ba('0x15')](function(_0x1ce168){_0x382b39(_0x1ce168);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x19')]=function(_0x509a6a,_0x2babf4){this[_0x68ba('0xf')]['getSquareProjectById'](_0x509a6a)['then'](function(_0x33a324){_0x2babf4(null,_0x33a324?_0x33a324[_0x68ba('0x18')]:![]);})[_0x68ba('0x15')](function(_0x22d909){_0x2babf4(_0x22d909);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x1a')]=function(_0xb58385,_0x3aaa02){this[_0x68ba('0xf')][_0x68ba('0x1b')](_0xb58385)[_0x68ba('0x14')](function(_0x3bb47f){_0x3aaa02(null,_0x3bb47f?_0x3bb47f[_0x68ba('0x1c')]:![]);})['catch'](function(_0x5b09ee){_0x3aaa02(_0x5b09ee);});};AGIVertices[_0x68ba('0x11')]['getUser']=function(_0x27ed6a,_0x1299e0){this[_0x68ba('0xf')]['getUserById'](_0x27ed6a)['then'](function(_0x414090){_0x1299e0(null,_0x414090?_0x414090[_0x68ba('0x18')]:![]);})[_0x68ba('0x15')](function(_0x434d7a){_0x1299e0(_0x434d7a);});};AGIVertices['prototype']['getTrunk']=function(_0x10d265,_0x7cb225){this[_0x68ba('0xf')]['getTrunkById'](_0x10d265)[_0x68ba('0x14')](function(_0x5c7fbc){_0x7cb225(null,_0x5c7fbc?_0x5c7fbc[_0x68ba('0x18')]:![]);})[_0x68ba('0x15')](function(_0x2011d9){_0x7cb225(_0x2011d9);});};AGIVertices['prototype'][_0x68ba('0x1d')]=function(_0x4fcd25,_0x4da416){var _0x18fa9f=this;this['rpc'][_0x68ba('0x1e')](_0x4fcd25)['then'](function(_0x2ed5c3){_0x4da416(null,_0x2ed5c3?_0x18fa9f[_0x68ba('0x1f')](_0x2ed5c3['save_name']):![]);})[_0x68ba('0x15')](function(_0x533352){_0x4da416(_0x533352);});};AGIVertices['prototype'][_0x68ba('0x20')]=function(_0x1fe628,_0x2c21cc){this[_0x68ba('0xf')]['getMailAccountById'](_0x1fe628)['then'](function(_0x4e47bd){_0x2c21cc(null,_0x4e47bd?_0x4e47bd:![]);})[_0x68ba('0x15')](function(_0x26c11e){_0x2c21cc(_0x26c11e);});};AGIVertices['prototype']['sendMailMessage']=function(_0x51df1a,_0x53acc7,_0x141fdc){this[_0x68ba('0x10')][_0x68ba('0x21')](_0x51df1a,_0x53acc7)[_0x68ba('0x14')](function(){_0x141fdc(null);})[_0x68ba('0x15')](function(_0x3a8548){_0x141fdc(_0x3a8548);});};AGIVertices['prototype']['getIntervals']=function(_0x181b7e,_0x1b23e3){this[_0x68ba('0xf')][_0x68ba('0x22')](_0x181b7e)[_0x68ba('0x14')](function(_0x8a1044){if(_0x8a1044){if(_0x8a1044['IntervalId']){_0x1b23e3(null,[_0x8a1044[_0x68ba('0x23')]]);}else{_0x1b23e3(null,_[_0x68ba('0x24')](_0x8a1044[_0x68ba('0x25')],_0x68ba('0x23')));}}else{_0x1b23e3(null,![]);}})['catch'](function(_0x42a9a0){_0x1b23e3(_0x42a9a0);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x1f')]=function(_0x53dc5a){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x53dc5a);};AGIVertices[_0x68ba('0x11')][_0x68ba('0x26')]=function(_0x1364ac,_0x4a93a1,_0x468fd5){odbc[_0x68ba('0x27')](_0x1364ac,function(_0x490cf8){if(_0x490cf8){logger[_0x68ba('0x28')](_0x68ba('0x29'),_0x490cf8);_0x468fd5(_0x490cf8);}else{logger[_0x68ba('0x2a')](_0x68ba('0x2b'));odbc[_0x68ba('0x2c')](_0x4a93a1,function(_0x1bc540,_0x256b1f){if(_0x1bc540){logger[_0x68ba('0x2a')](_0x68ba('0x2d'),_0x4a93a1);_0x468fd5(_0x1bc540);}else{logger[_0x68ba('0x2a')]('Query\x20executed\x20correctly\x20%s',_0x4a93a1);odbc['close'](function(_0x2837e9){if(_0x2837e9){logger[_0x68ba('0x28')](_0x68ba('0x2e'),_0x2837e9);}_0x468fd5(null,_0x256b1f);});}});}});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x2f')]=function(_0x3355c1,_0x2562dd){this[_0x68ba('0xf')][_0x68ba('0x30')](_0x3355c1)[_0x68ba('0x14')](function(_0x5d1111){_0x2562dd(null,_0x5d1111?_0x5d1111:![]);})['catch'](function(_0x3f2e44){_0x2562dd(_0x3f2e44);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x31')]=function(_0x4f8400,_0x1cba92){this['rpc'][_0x68ba('0x31')](_0x4f8400)[_0x68ba('0x14')](function(_0x37ea9b){_0x1cba92(null,_0x37ea9b);})[_0x68ba('0x15')](function(_0x2fcea9){_0x1cba92(_0x2fcea9);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x32')]=function(_0x203246,_0xdfcc6a,_0x58e670){this[_0x68ba('0xf')][_0x68ba('0x32')]({'uniqueid':this[_0x68ba('0xe')]['uniqueid'],'node':_0x203246[_0x68ba('0x33')],'application':_0x203246[_0x68ba('0x34')],'data':_0xdfcc6a||null,'project_name':this[_0x68ba('0xe')][_0x68ba('0x35')],'callerid':this[_0x68ba('0xe')]['callerid']})[_0x68ba('0x14')](function(_0x11be8d){if(_0x58e670){_0x58e670(null,_0x11be8d);}})[_0x68ba('0x15')](function(_0x393f86){if(_0x58e670){_0x58e670(_0x393f86);}});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x36')]=function(_0x3a72a2,_0x45a5d6,_0x48675f,_0x322466){this['rpc'][_0x68ba('0x36')]({'uniqueid':this[_0x68ba('0xe')][_0x68ba('0x37')],'callerid':this['channel'][_0x68ba('0x38')],'calleridname':this[_0x68ba('0xe')][_0x68ba('0x39')],'context':this[_0x68ba('0xe')]['context'],'extension':this['channel'][_0x68ba('0x3a')],'priority':this[_0x68ba('0xe')][_0x68ba('0x3b')],'accountcode':this[_0x68ba('0xe')]['accountcode'],'dnid':this[_0x68ba('0xe')][_0x68ba('0x3c')],'projectName':this[_0x68ba('0xe')][_0x68ba('0x35')],'saveName':_0x45a5d6,'filename':_0x3a72a2[_0x68ba('0x3d')]||_0x45a5d6,'savePath':_0x48675f})[_0x68ba('0x14')](function(_0x2f1334){_0x322466(null,_0x2f1334);})[_0x68ba('0x15')](function(_0x10ad5a){_0x322466(_0x10ad5a);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x3e')]=function(_0x113fb9,_0x529d19,_0x2f07c7,_0xa6e30a,_0x176366){this[_0x68ba('0xf')][_0x68ba('0x3e')]({'uniqueid':this[_0x68ba('0xe')]['uniqueid'],'body':_0x113fb9,'direction':_0x529d19,'providerName':_0x2f07c7,'providerResponse':_0xa6e30a})[_0x68ba('0x14')](function(_0x5b6ee7){if(_0x176366){_0x176366(null,_0x5b6ee7);}})[_0x68ba('0x15')](function(_0xeba8){if(_0x176366){_0x176366(_0xeba8);}});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x3f')]=function(_0x42d77b,_0x347750){this['rpc'][_0x68ba('0x3f')]({'firstName':_[_0x68ba('0x40')](_0x42d77b['name'])||_['isNil'](_0x42d77b[_0x68ba('0x18')])?_0x68ba('0x41')+Math[_0x68ba('0x42')]():_0x42d77b['name'],'lastName':_['isEmpty'](_0x42d77b[_0x68ba('0x43')])||_[_0x68ba('0x44')](_0x42d77b[_0x68ba('0x43')])?null:_0x42d77b[_0x68ba('0x43')],'phone':_0x42d77b[_0x68ba('0x45')],'ListId':_0x42d77b[_0x68ba('0x46')],'scheduledat':_0x42d77b['scheduledAt'],'callbackUniqueid':this['channel'][_0x68ba('0x37')],'tags':_0x68ba('0x47'),'description':'Callback\x20scheduled\x20at\x20'+_0x42d77b[_0x68ba('0x48')][_0x68ba('0x49')](),'priority':_0x42d77b[_0x68ba('0x4a')]})['then'](function(_0xa87688){_0x347750(null,_0xa87688);})['catch'](function(_0x11b82a){_0x347750(_0x11b82a);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x4b')]=function(_0x516eac,_0x136fb0){this[_0x68ba('0xf')][_0x68ba('0x4c')](_0x516eac)[_0x68ba('0x14')](function(_0x5c20e3){_0x136fb0(null,_0x5c20e3?_0x5c20e3[_0x68ba('0x18')]:![]);})[_0x68ba('0x15')](function(_0x33aaa1){_0x136fb0(_0x33aaa1);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x4d')]=function(_0x463152,_0x2a51ef,_0x15787b){var _0x50c3a8={'role':'agent'};_0x50c3a8[_0x463152]=this[_0x68ba('0xe')][_0x68ba('0x38')];this[_0x68ba('0xf')][_0x68ba('0x4d')](_0x50c3a8,_0x2a51ef,this[_0x68ba('0xe')][_0x68ba('0x37')])[_0x68ba('0x14')](function(_0x1d0ed0){_0x15787b(null,_[_0x68ba('0x44')](_0x1d0ed0)?![]:!![]);})[_0x68ba('0x15')](function(_0x437859){logger[_0x68ba('0x28')](_0x437859);_0x15787b(null,![]);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x4e')]=function(_0x2d366f,_0x25015b){var _0x492e64={'role':_0x68ba('0x4f')};_0x492e64[_0x2d366f]=this['channel']['callerid'];this[_0x68ba('0xf')]['agentUnpause'](_0x492e64)[_0x68ba('0x14')](function(_0x1d2d2c){_0x25015b(null,_[_0x68ba('0x44')](_0x1d2d2c)?![]:!![]);})[_0x68ba('0x15')](function(_0x527d98){logger[_0x68ba('0x28')](_0x527d98);_0x25015b(null,![]);});};AGIVertices[_0x68ba('0x11')]['agentLogout']=function(_0x51bd78,_0x4c3291){var _0x37967e={'role':_0x68ba('0x4f')};_0x37967e[_0x51bd78]=this[_0x68ba('0xe')][_0x68ba('0x38')];this[_0x68ba('0xf')][_0x68ba('0x50')](_0x37967e)[_0x68ba('0x14')](function(_0x27217f){_0x4c3291(null,_[_0x68ba('0x44')](_0x27217f)?![]:!![]);})[_0x68ba('0x15')](function(_0x56fa08){logger[_0x68ba('0x28')](_0x56fa08);_0x4c3291(null,![]);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x51')]=function(_0x5f3fb5,_0xaf6093){var _0x52918e={'role':_0x68ba('0x4f')};_0x52918e[_0x5f3fb5]=this[_0x68ba('0xe')][_0x68ba('0x38')];var _0x57a14a=_0x5f3fb5!=_0x68ba('0x52')?util['format'](_0x68ba('0x53'),'LOCAL',this['channel'][_0x68ba('0x38')]):undefined;this[_0x68ba('0xf')][_0x68ba('0x51')](_0x52918e,_0x57a14a)[_0x68ba('0x14')](function(_0x5e48fa){_0xaf6093(null,_['isNil'](_0x5e48fa)?![]:!![]);})[_0x68ba('0x15')](function(_0x181d58){logger[_0x68ba('0x28')](_0x181d58);_0xaf6093(null,![]);});};AGIVertices[_0x68ba('0x11')]['shellCommand']=function(_0x4a6571,_0x460372){sh[_0x68ba('0x54')](_[_0x68ba('0x55')](_0x4a6571),function(_0x477b2c,_0x5d2443){var _0xb80896=_0x5d2443[_0x68ba('0x56')](/(\r\n|\n|\r)/gm,'');_0x460372(null,_0xb80896);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x57')]=function(_0x86332d,_0x563c3e){scripts['googleCloudTTS'](_0x86332d[_0x68ba('0x58')],_0x86332d[_0x68ba('0x59')]||_0x68ba('0x5a'),_0x86332d[_0x68ba('0x5a')],_0x86332d['languageCode']||_0x68ba('0x5b'),_0x86332d['ssmlGender']||_0x68ba('0x5c'),_0x86332d['audioEncoding']||_0x68ba('0x5d'))[_0x68ba('0x14')](function(_0x5ae038){_0x563c3e(null,_0x5ae038);})[_0x68ba('0x15')](function(_0x5755e5){_0x563c3e(_0x5755e5);});};AGIVertices['prototype'][_0x68ba('0x5e')]=function(_0x51d023,_0x568b8e){scripts[_0x68ba('0x5e')](_0x51d023['text'],_0x51d023[_0x68ba('0x5f')]||'en',0x1)[_0x68ba('0x14')](function(_0x4593d2){_0x568b8e(null,_0x4593d2);})[_0x68ba('0x15')](function(_0x2125c6){_0x568b8e(_0x2125c6);});};AGIVertices['prototype'][_0x68ba('0x60')]=function(_0x5901f4,_0x35224f){var _0x23bc17={'uri':_0x5901f4[_0x68ba('0x61')],'method':_0x5901f4[_0x68ba('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5901f4[_0x68ba('0x63')])==='number'&&parseInt(_0x5901f4[_0x68ba('0x63')])>=0x1?parseInt(_0x5901f4[_0x68ba('0x63')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x68ba('0x64'),_0x68ba('0x65')],_0x23bc17[_0x68ba('0x62')][_0x68ba('0x66')]())){try{_0x23bc17['body']=_0x5901f4[_0x68ba('0xb')]?JSON[_0x68ba('0x67')](_0x5901f4[_0x68ba('0xb')]):{};}catch(_0x4779b2){logger[_0x68ba('0x28')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4779b2);}}try{_0x23bc17[_0x68ba('0x68')]=_0x5901f4[_0x68ba('0xa')]?JSON[_0x68ba('0x67')](_0x5901f4[_0x68ba('0xa')]):{};}catch(_0x3acdc3){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3acdc3);}if(_0x5901f4[_0x68ba('0x69')]){try{var _0x51beb7=require(_0x5901f4[_0x68ba('0x69')])['sync'](this,_0x23bc17);_0x23bc17[_0x68ba('0x6a')]=Mustache['render'](_0x5901f4[_0x68ba('0x61')],_0x51beb7,{},['$$','$$']);if(_0x23bc17[_0x68ba('0x68')]){_0x23bc17['headers']=JSON['parse'](Mustache[_0x68ba('0x6b')](JSON[_0x68ba('0x6c')](_0x23bc17['headers']),_0x51beb7,{},['$$','$$']));}if(_0x23bc17[_0x68ba('0x6d')]){_0x23bc17[_0x68ba('0x6d')]=JSON['parse'](Mustache[_0x68ba('0x6b')](JSON[_0x68ba('0x6c')](_0x23bc17[_0x68ba('0x6d')]),_0x51beb7,{},['$$','$$']));}}catch(_0x430358){logger[_0x68ba('0x28')](_0x68ba('0x6e'),_0x430358);}}rp(_0x23bc17)[_0x68ba('0x14')](function(_0x4c467b){var _0x354089={'statusCode':_0x4c467b['statusCode']||0xc8,'statusMessage':_0x4c467b[_0x68ba('0x6f')]||'OK','headers':_0x4c467b[_0x68ba('0x68')]||{},'body':_0x4c467b[_0x68ba('0x6d')]||{}};_0x35224f(null,_0x354089);})[_0x68ba('0x15')](function(_0xada353){var _0x903556={'statusCode':_0xada353['statusCode']||0x1f4,'statusMessage':_0xada353[_0x68ba('0x70')]||_0x68ba('0x71'),'headers':_0xada353['options']['headers']||{},'body':_0xada353[_0x68ba('0x72')][_0x68ba('0x6d')]||{}};_0x35224f(null,_0x903556);});};AGIVertices[_0x68ba('0x11')]['googleDialogflow']=function(_0x20d54d,_0x5dc0db){scripts['googleDialogflow'](this[_0x68ba('0xe')][_0x68ba('0x37')],_0x20d54d[_0x68ba('0x73')],_0x20d54d['text'],_0x20d54d[_0x68ba('0x74')]||'en')[_0x68ba('0x14')](function(_0xc1feaf){_0x5dc0db(null,_0xc1feaf);})[_0x68ba('0x15')](function(_0x5d49e2){_0x5dc0db(_0x5d49e2);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x75')]=function(_0x5e8661,_0x424176){scripts[_0x68ba('0x75')](this[_0x68ba('0xe')][_0x68ba('0x37')],_0x5e8661[_0x68ba('0x76')],_0x5e8661[_0x68ba('0x77')],_0x5e8661[_0x68ba('0x78')],_0x5e8661[_0x68ba('0x5a')],_0x5e8661[_0x68ba('0x79')]||'en')[_0x68ba('0x14')](function(_0x4fa874){_0x424176(null,_0x4fa874);})[_0x68ba('0x15')](function(_0x3c2166){_0x424176(_0x3c2166);});};AGIVertices[_0x68ba('0x11')]['sestekNDA']=function(_0xcf122,_0x16a9a8){scripts[_0x68ba('0x7a')](this[_0x68ba('0xe')],_0xcf122)[_0x68ba('0x14')](function(_0x11d397){_0x16a9a8(null,_0x11d397);})[_0x68ba('0x15')](function(_0x27c412){_0x16a9a8(_0x27c412);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x7b')]=function(_0x12b337,_0x884673){scripts[_0x68ba('0x7b')](_0x12b337[_0x68ba('0x73')],_0x12b337['text'],_0x12b337[_0x68ba('0x7c')]||'en-US',_0x12b337['speed'])['then'](function(_0x56823d){_0x884673(null,_0x56823d);})[_0x68ba('0x15')](function(_0x34da6e){_0x884673(_0x34da6e);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x7d')]=function(_0x56b6ea,_0x442312,_0x52c872){scripts[_0x68ba('0x7d')](_0x442312,_0x56b6ea[_0x68ba('0x73')],_0x56b6ea[_0x68ba('0x7e')]||'en-US',this[_0x68ba('0x7f')](_0x56b6ea[_0x68ba('0x80')])?_0x56b6ea[_0x68ba('0x80')]:undefined)[_0x68ba('0x14')](function(_0x269e27){_0x52c872(null,_0x269e27);})[_0x68ba('0x15')](function(_0x446010){_0x52c872(_0x446010);});};AGIVertices['prototype']['awsPolly']=function(_0x677967,_0x2a02f5){scripts[_0x68ba('0x81')](_0x677967[_0x68ba('0x82')],_0x677967[_0x68ba('0x83')],_0x677967['aws_polly_region'],_0x677967['aws_polly_voice']||_0x68ba('0x84'),_0x677967['text'],_0x677967[_0x68ba('0x85')]||_0x68ba('0x5a'))['then'](function(_0x1eff53){_0x2a02f5(null,_0x1eff53);})[_0x68ba('0x15')](function(_0x310b58){_0x2a02f5(_0x310b58);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x86')]=function(_0x1e5339,_0x2a0525){scripts[_0x68ba('0x86')](this['channel'][_0x68ba('0x37')],_0x1e5339['aws_access_key_id'],_0x1e5339[_0x68ba('0x83')],_0x1e5339[_0x68ba('0x87')],_0x1e5339['text'],_0x1e5339[_0x68ba('0x88')])[_0x68ba('0x14')](function(_0x260b35){_0x2a0525(null,_0x260b35);})['catch'](function(_0x34c8a4){_0x2a0525(_0x34c8a4);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x89')]=function(_0x556349,_0xe549b1,_0x8072){scripts['googleASR'](_0xe549b1,_0x556349[_0x68ba('0x73')],_0x556349[_0x68ba('0x8a')]||_0x68ba('0x5b'))['then'](function(_0xf1f8d9){_0x8072(null,_0xf1f8d9);})['catch'](function(_0x74bb6d){_0x8072(_0x74bb6d);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x8b')]=function(_0x12351b,_0x5722e8,_0x4f1acf){scripts[_0x68ba('0x8b')](_0x5722e8,_0x12351b[_0x68ba('0x8c')],_0x12351b['appsecret'],_0x12351b[_0x68ba('0x6a')])['then'](function(_0x372d2a){_0x4f1acf(null,_0x372d2a);})[_0x68ba('0x15')](function(_0x3ec919){_0x4f1acf(_0x3ec919);});};AGIVertices[_0x68ba('0x11')][_0x68ba('0x8d')]=function(_0x5911cb){var _0x2f33d6=_[_0x68ba('0x8e')](verticesWithRetry,_0x5911cb[_0x68ba('0x34')])?_0x5911cb:_['clone'](_0x5911cb);for(var _0x3725b3 in _0x2f33d6){if(_0x2f33d6['hasOwnProperty'](_0x3725b3)){if(_0x2f33d6[_0x3725b3]&&_[_0x68ba('0x8f')](_0x2f33d6[_0x3725b3])){if(_[_0x68ba('0x8e')](recursiveMapAttributes,_0x3725b3)){_0x2f33d6[_0x3725b3]=this[_0x68ba('0x90')](_0x2f33d6[_0x3725b3]);}else{_0x2f33d6[_0x3725b3]=this[_0x68ba('0x91')](_0x2f33d6[_0x3725b3]);}}}}return _0x2f33d6;};AGIVertices[_0x68ba('0x11')]['recursiveNodeIndex']=function(_0x520fd8){for(var _0x50e09b in _0x520fd8){if(_0x520fd8[_0x68ba('0x92')](_0x50e09b)){if(_[_0x68ba('0x93')](_0x520fd8[_0x50e09b])){this[_0x68ba('0x94')](_0x520fd8[_0x50e09b]);}else if(_['isArray'](_0x520fd8[_0x50e09b])){for(var _0x22eee7=0x0;_0x22eee7<_0x520fd8[_0x50e09b]['length'];_0x22eee7++){this[_0x68ba('0x94')](_0x520fd8[_0x50e09b][_0x22eee7]);}}else if(_['isString'](_0x520fd8[_0x50e09b])){_0x520fd8[_0x50e09b]=this[_0x68ba('0x91')](_0x520fd8[_0x50e09b]);}}}};AGIVertices[_0x68ba('0x11')][_0x68ba('0x95')]=function(_0x502d18,_0x3fe03b){for(var _0x521ee6 in _0x502d18){if(_0x502d18[_0x68ba('0x92')](_0x521ee6)){if(_['isPlainObject'](_0x502d18[_0x521ee6])){if(!_[_0x68ba('0x40')](_0x502d18[_0x521ee6])){this['saveRestApiResult'](_0x502d18[_0x521ee6],util['format'](_0x68ba('0x96'),_0x3fe03b,_0x521ee6));}}else if(_[_0x68ba('0x97')](_0x502d18[_0x521ee6])){for(var _0x24d942=0x0;_0x24d942<_0x502d18[_0x521ee6]['length'];_0x24d942++){this[_0x68ba('0x95')](_0x502d18[_0x521ee6][_0x24d942],util['format'](_0x68ba('0x96'),_0x3fe03b,_0x521ee6+'['+_0x24d942+']'));}}else{if(!_[_0x68ba('0x44')](_0x502d18[_0x521ee6])){this[_0x68ba('0xe')][_0x68ba('0x98')](util[_0x68ba('0x99')](_0x68ba('0x96'),_0x3fe03b,_0x521ee6),_0x502d18[_0x521ee6]);}}}}};AGIVertices[_0x68ba('0x11')]['replaceObjectAllVariables']=function(_0x3770a1){try{var _0xfd2be0=JSON[_0x68ba('0x67')](_0x3770a1);this[_0x68ba('0x94')](_0xfd2be0);return JSON[_0x68ba('0x6c')](_0xfd2be0);}catch(_0x491f8b){return this[_0x68ba('0x91')](_0x3770a1);}};AGIVertices['prototype'][_0x68ba('0x91')]=function(_0x97732f){var _0x4da5d7=_0x97732f[_0x68ba('0x9a')]('{');for(var _0x3bacf4=0x1;_0x3bacf4<_0x4da5d7[_0x68ba('0x9b')];_0x3bacf4+=0x1){var _0x3bb2bc=_0x4da5d7[_0x3bacf4][_0x68ba('0x9a')]('}');if(_0x3bb2bc[_0x68ba('0x9b')]>0x1){_0x97732f=_0x97732f[_0x68ba('0x9c')]('{'+_0x3bb2bc[0x0]+'}',this[_0x68ba('0xe')]['getVariable'](_0x3bb2bc[0x0])[_0x68ba('0x9d')]||_0x3bb2bc[0x0]);}}if(_0x4da5d7[_0x68ba('0x9b')]===0x1){return _0x97732f[_0x68ba('0x49')]();}return this[_0x68ba('0x91')](_0x97732f);};AGIVertices[_0x68ba('0x11')][_0x68ba('0x9e')]=function(_0x5abc13,_0x43056a){var _0x5f3fc0=this['channel'][_0x68ba('0x12')](_0x5abc13);if(_0x5f3fc0['result']===-0x1){return _0x5f3fc0;}logger['info'](util['format'](_0x68ba('0x9f'),_0x43056a,_0x5f3fc0['extra']));return this[_0x68ba('0xe')][_0x68ba('0x98')](_0x43056a,_0x5f3fc0[_0x68ba('0x9d')]);};AGIVertices['prototype'][_0x68ba('0x7f')]=function(_0x4c90ec){return _0x4c90ec&&_0x4c90ec!=='0'&&_0x4c90ec!=='-1'&&_0x4c90ec!=='';};AGIVertices[_0x68ba('0x11')][_0x68ba('0xa0')]=function(_0x44538a){this[_0x68ba('0x32')][_0x68ba('0xa1')](this,_0x44538a,'-');_0x44538a[_0x68ba('0xa2')]=_0x44538a['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x68ba('0x11')][_0x68ba('0xa3')]=function(_0x5a7aa3){logger[_0x68ba('0x2a')](util['format'](_0x68ba('0xa4'),_0x5a7aa3['label']));if(!this['isConfigured'](_0x5a7aa3[_0x68ba('0x5a')])){return this[_0x68ba('0xe')]['noop'](_0x68ba('0xa5'));}var _0x2101ee='\x22'+_0x5a7aa3[_0x68ba('0x5a')]+'\x22';if(this['isConfigured'](_0x5a7aa3[_0x68ba('0x72')])){_0x2101ee+=','+_0x5a7aa3['options'];}var _0x2398e8=this['channel'][_0x68ba('0x54')](_0x68ba('0xa6'),_0x2101ee);if(_0x2398e8[_0x68ba('0xa7')]===-0x1){return _0x2398e8;}return this['channel'][_0x68ba('0xa8')](util['format'](_0x68ba('0xa9'),_0x2101ee));};AGIVertices[_0x68ba('0x11')][_0x68ba('0xaa')]=function(_0x3dd708){logger[_0x68ba('0x2a')](util['format'](_0x68ba('0xab'),_0x3dd708[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x3dd708[_0x68ba('0xac')])){return this[_0x68ba('0xe')][_0x68ba('0xa8')](_0x68ba('0xad'));}var _0x4f3c26=_0x3dd708[_0x68ba('0xac')];if(this[_0x68ba('0x7f')](_0x3dd708[_0x68ba('0x72')])){_0x4f3c26+=','+_0x3dd708[_0x68ba('0x72')];}var _0x40beef=this[_0x68ba('0xe')]['exec'](_0x68ba('0xae'),_0x4f3c26);if(_0x40beef['result']===-0x1){return _0x40beef;}var _0x379a1b=this[_0x68ba('0x9e')]('RECOG_CONFIDENCE()',_0x68ba('0xaf'));if(_0x379a1b['result']===-0x1){return _0x379a1b;}var _0x2801fa=this[_0x68ba('0x9e')](_0x68ba('0xb0'),_0x68ba('0xb1'));if(_0x2801fa[_0x68ba('0xa7')]===-0x1){return _0x2801fa;}var _0x54c57d=this[_0x68ba('0x9e')](_0x68ba('0xb2'),'MRCP_RECOG_INSTANCE');if(_0x54c57d['result']===-0x1){return _0x54c57d;}return this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0xb3'),_0x4f3c26));};AGIVertices[_0x68ba('0x11')][_0x68ba('0x6')]=function(_0x479812){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0xb4'),_0x479812['label']));return this['channel'][_0x68ba('0x6')]([_0x479812['command'],_0x479812['args']]);};AGIVertices['prototype'][_0x68ba('0xb5')]=function(_0x1c67ff){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0xb6'),_0x1c67ff[_0x68ba('0x33')]));if(this[_0x68ba('0x7f')](_0x1c67ff[_0x68ba('0x63')])){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0xb7'),_0x1c67ff['timeout']));var _0x360b9a=this['channel'][_0x68ba('0xb8')](_0x1c67ff[_0x68ba('0x63')]);if(_0x360b9a[_0x68ba('0xa7')]===-0x1){return _0x360b9a;}}return this[_0x68ba('0xe')][_0x68ba('0xb5')]();};AGIVertices['prototype'][_0x68ba('0x47')]=function(_0x381592){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x381592[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x381592[_0x68ba('0x46')])){return this['channel']['error'](_0x381592,_0x68ba('0xb9'));}_0x381592[_0x68ba('0x48')]=moment();if(this[_0x68ba('0x7f')](_0x381592[_0x68ba('0xba')])){_0x381592[_0x68ba('0x48')]=moment()[_0x68ba('0xbb')](_0x381592['delay'],_0x68ba('0xbc'));}if(!this[_0x68ba('0x7f')](_0x381592[_0x68ba('0x4a')])){_0x381592[_0x68ba('0x4a')]=0x2;}this[_0x68ba('0x3f')]['sync'](this,_0x381592);return this['channel'][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0xbd'),_0x381592[_0x68ba('0x45')],_0x381592[_0x68ba('0x46')],_0x381592['scheduledAt']));};AGIVertices[_0x68ba('0x11')]['custom_app']=function(_0x57408e){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x57408e[_0x68ba('0x33')]));var _0x239d67=this[_0x68ba('0xe')][_0x68ba('0x54')](_0x57408e[_0x68ba('0xbe')],_0x57408e['options']);if(_0x239d67[_0x68ba('0xa7')]===-0x1){return _0x239d67;}return this[_0x68ba('0xe')]['noop'](util[_0x68ba('0x99')](_0x68ba('0xbf'),_0x57408e[_0x68ba('0xbe')],_0x57408e[_0x68ba('0x72')]));};AGIVertices['prototype'][_0x68ba('0xc0')]=function(_0x4ebf04){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0xc1'),_0x4ebf04[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x4ebf04['text'])){return this[_0x68ba('0xe')]['noop'](_0x68ba('0xa5'));}var _0x373f5c='\x22'+_0x4ebf04[_0x68ba('0x5a')]+'\x22';if(this[_0x68ba('0x7f')](_0x4ebf04[_0x68ba('0x72')])){_0x373f5c+=','+_0x4ebf04[_0x68ba('0x72')];}var _0x46fc01=this[_0x68ba('0xe')][_0x68ba('0x54')](_0x68ba('0xa6'),_0x373f5c);if(_0x46fc01[_0x68ba('0xa7')]===-0x1){return _0x46fc01;}return this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0xa9'),_0x373f5c));};AGIVertices[_0x68ba('0x11')][_0x68ba('0xc2')]=function(_0x3bb75d){logger['info'](util[_0x68ba('0x99')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x3bb75d[_0x68ba('0x33')]));if(!this['isConfigured'](_0x3bb75d[_0x68ba('0x5a')])){return this[_0x68ba('0xe')][_0x68ba('0xa8')]('no\x20text\x20configured');}var _0x46989a='\x22'+_0x3bb75d[_0x68ba('0x5a')]+'\x22';if(this['isConfigured'](_0x3bb75d[_0x68ba('0x72')])){_0x46989a+=','+_0x3bb75d[_0x68ba('0x72')];}var _0x135d40=this['channel'][_0x68ba('0x54')](_0x68ba('0xa6'),_0x46989a);if(_0x135d40[_0x68ba('0xa7')]===-0x1){return _0x135d40;}return this['channel'][_0x68ba('0xa8')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x46989a));};AGIVertices[_0x68ba('0x11')][_0x68ba('0xc3')]=function(_0xb73906){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0xb73906['label']));if(!this[_0x68ba('0x7f')](_0xb73906[_0x68ba('0xac')])){return this[_0x68ba('0xe')]['noop'](_0x68ba('0xad'));}var _0x1da3e3=_0xb73906[_0x68ba('0xac')];if(this[_0x68ba('0x7f')](_0xb73906[_0x68ba('0x72')])){_0x1da3e3+=','+_0xb73906[_0x68ba('0x72')];}var _0x33d112=this[_0x68ba('0xe')][_0x68ba('0x54')](_0x68ba('0xae'),_0x1da3e3);if(_0x33d112[_0x68ba('0xa7')]===-0x1){return _0x33d112;}var _0x59eb82=this[_0x68ba('0x9e')](_0x68ba('0xc4'),_0x68ba('0xc5'));if(_0x59eb82['result']===-0x1){return _0x59eb82;}var _0x3f6d8c=this[_0x68ba('0x9e')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x3f6d8c[_0x68ba('0xa7')]===-0x1){return _0x3f6d8c;}var _0x1f0460=this[_0x68ba('0x9e')](_0x68ba('0xb2'),_0x68ba('0xc6'));if(_0x1f0460['result']===-0x1){return _0x1f0460;}return this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0xb3'),_0x1da3e3));};AGIVertices['prototype']['sestekasr']=function(_0x3f997d){logger[_0x68ba('0x2a')](util['format'](_0x68ba('0xc7'),_0x3f997d[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x3f997d['grammar'])){return this[_0x68ba('0xe')]['noop'](_0x68ba('0xad'));}var _0x192fc9=_0x3f997d['grammar'];if(this[_0x68ba('0x7f')](_0x3f997d[_0x68ba('0x72')])){_0x192fc9+=','+_0x3f997d[_0x68ba('0x72')];}var _0x3c31aa=this[_0x68ba('0xe')]['exec'](_0x68ba('0xae'),_0x192fc9);if(_0x3c31aa[_0x68ba('0xa7')]===-0x1){return _0x3c31aa;}var _0x16261c=this[_0x68ba('0x9e')](_0x68ba('0xc4'),_0x68ba('0xc8'));if(_0x16261c[_0x68ba('0xa7')]===-0x1){return _0x16261c;}var _0x476d30=this[_0x68ba('0x9e')](_0x68ba('0xb0'),_0x68ba('0xc9'));if(_0x476d30[_0x68ba('0xa7')]===-0x1){return _0x476d30;}var _0x202a79=this['getAndSetVariable']('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x202a79['result']===-0x1){return _0x202a79;}return this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0xb3'),_0x192fc9));};AGIVertices['prototype'][_0x68ba('0xca')]=function(_0x5137ce){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0xcb'),_0x5137ce['label']));if(!this[_0x68ba('0x7f')](_0x5137ce['odbc_id'])){return this[_0x68ba('0xe')]['error'](_0x5137ce,'no\x20database\x20selected');}var _0x50209c=this[_0x68ba('0x1a')][_0x68ba('0xa1')](this,_0x5137ce[_0x68ba('0xcc')]);if(!_0x50209c){return this['channel'][_0x68ba('0x28')](_0x5137ce,_0x68ba('0xcd'));}if(!this['isConfigured'](_0x5137ce[_0x68ba('0x2c')])){return this['channel']['error'](_0x5137ce,_0x68ba('0xce'));}var _0x12bd6c=_0x5137ce[_0x68ba('0x2c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0xcf'),_0x12bd6c));var _0x574056=this[_0x68ba('0x26')][_0x68ba('0xa1')](this,_0x50209c,_0x12bd6c);this[_0x68ba('0x32')]['sync'](this,_0x5137ce,_0x12bd6c);if(!this['isConfigured'](_0x5137ce[_0x68ba('0xd0')])){return this[_0x68ba('0xe')]['noop'](_0x68ba('0xd1'));}var _0x49de84=this[_0x68ba('0x12')][_0x68ba('0xa1')](this,_0x5137ce[_0x68ba('0xd0')]);if(!_0x49de84){return this['channel']['error'](_0x5137ce,_0x68ba('0xd2'));}var _0x50dee5=this;_0x574056['forEach'](function(_0x31de81,_0x4c8ec7){Object[_0x68ba('0xd3')](_0x31de81)['forEach'](function(_0x5b5db7){_0x50dee5[_0x68ba('0xe')][_0x68ba('0x98')](util[_0x68ba('0x99')](_0x68ba('0xd4'),_0x49de84,_0x4c8ec7,_0x5b5db7),_0x31de81[_0x5b5db7]);});});this[_0x68ba('0xe')]['setVariable'](util['format'](_0x68ba('0xd5'),_0x49de84),_0x574056[_0x68ba('0x9b')]);return this['channel'][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0xd6'),_0x49de84));};AGIVertices['prototype'][_0x68ba('0xd7')]=function(_0x1489fe){logger[_0x68ba('0xd8')](util[_0x68ba('0x99')](_0x68ba('0xd9'),_0x1489fe[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x1489fe[_0x68ba('0xda')])){return this[_0x68ba('0xe')]['error'](_0x1489fe,'no\x20user\x20selected');}var _0x585549=this['getUser'][_0x68ba('0xa1')](this,_0x1489fe['sip_id']);if(!_0x585549){return this[_0x68ba('0xe')]['error'](_0x1489fe,_0x68ba('0xdb'));}var _0x4fc8f8=this[_0x68ba('0xe')][_0x68ba('0x54')]('DIAL',[util[_0x68ba('0x99')](_0x68ba('0xdc'),_0x585549),_0x1489fe['timeout'],_0x1489fe[_0x68ba('0xdd')],_0x1489fe['url']]);if(_0x4fc8f8[_0x68ba('0xa7')]===-0x1){return _0x4fc8f8;}return this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x68ba('0x11')]['dialogflow']=function(_0x3c6d35){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0xde'),_0x3c6d35[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x3c6d35[_0x68ba('0x73')])){return this[_0x68ba('0xe')][_0x68ba('0xa8')](_0x68ba('0xdf'));}if(!this[_0x68ba('0x7f')](_0x3c6d35['text'])){return this[_0x68ba('0xe')][_0x68ba('0xa8')](_0x68ba('0xa5'));}this[_0x68ba('0xe')][_0x68ba('0xe0')]=!![];this['createSquareDetailsReport'](_0x3c6d35);this['createSquareMessage'](_0x3c6d35['text'],'in','','');this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0xe1'),_0x3c6d35['text']));var _0x189973=this[_0x68ba('0xe2')][_0x68ba('0xa1')](this,_0x3c6d35);if(_0x189973){for(var _0x5b0015 in _0x189973){if(_0x189973[_0x68ba('0x92')](_0x5b0015)){this[_0x68ba('0xe')][_0x68ba('0x98')](util[_0x68ba('0x99')](_0x68ba('0xe3'),_0x5b0015[_0x68ba('0x66')]()),_0x189973[_0x5b0015]);}}this[_0x68ba('0x3e')](_0x189973[_0x68ba('0xe4')],'out',_0x68ba('0xe5'),'');return this[_0x68ba('0xe')]['noop'](util[_0x68ba('0x99')](_0x68ba('0xe6'),_0x189973['speech']));}return this['channel'][_0x68ba('0x28')](_0x3c6d35,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x68ba('0x11')][_0x68ba('0xe7')]=function(_0x1e6da4){logger[_0x68ba('0x2a')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x1e6da4[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x1e6da4[_0x68ba('0x76')])){return this['channel'][_0x68ba('0xa8')](_0x68ba('0xe8'));}if(!this[_0x68ba('0x7f')](_0x1e6da4[_0x68ba('0x77')])){return this[_0x68ba('0xe')][_0x68ba('0xa8')](_0x68ba('0xe9'));}if(!this['isConfigured'](_0x1e6da4[_0x68ba('0x78')])){return this['channel']['noop'](_0x68ba('0xea'));}if(!this[_0x68ba('0x7f')](_0x1e6da4['dialogflowV2_language'])){return this[_0x68ba('0xe')][_0x68ba('0xa8')](_0x68ba('0xeb'));}if(!this[_0x68ba('0x7f')](_0x1e6da4[_0x68ba('0x5a')])){return this['channel'][_0x68ba('0xa8')]('no\x20text\x20configured');}this[_0x68ba('0xe')][_0x68ba('0xe0')]=!![];this[_0x68ba('0x32')](_0x1e6da4);this['createSquareMessage'](_0x1e6da4[_0x68ba('0x5a')],'in','','');this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')]('Trying\x20DialogflowV2:\x20%s',_0x1e6da4[_0x68ba('0x5a')]));var _0x3ea123=this[_0x68ba('0x75')][_0x68ba('0xa1')](this,_0x1e6da4);if(_0x3ea123){for(var _0x1c7cd1 in _0x3ea123){if(_0x3ea123[_0x68ba('0x92')](_0x1c7cd1)){if(_0x1c7cd1!==_0x68ba('0xec')){this['channel'][_0x68ba('0x98')](util[_0x68ba('0x99')]('DIALOGFLOW_%s',_0x1c7cd1[_0x68ba('0x66')]()),_0x3ea123[_0x1c7cd1]);}}}this['createSquareMessage'](_0x3ea123[_0x68ba('0xe4')],_0x68ba('0xed'),_0x68ba('0xe7'),_0x3ea123['providerResponse']);return this[_0x68ba('0xe')][_0x68ba('0xa8')](util['format'](_0x68ba('0xee'),_0x3ea123['speech']));}return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x1e6da4,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x68ba('0x11')][_0x68ba('0xef')]=function(_0x368c66){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0xf0'),_0x368c66[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x368c66[_0x68ba('0xf1')])){return this[_0x68ba('0xe')][_0x68ba('0xa8')](_0x68ba('0xf2'));}if(!this[_0x68ba('0x7f')](_0x368c66[_0x68ba('0xf3')])){return this[_0x68ba('0xe')][_0x68ba('0xa8')](_0x68ba('0xf4'));}if(!this[_0x68ba('0x7f')](_0x368c66[_0x68ba('0xf5')])){return this[_0x68ba('0xe')]['noop']('no\x20password\x20configured');}if(!this[_0x68ba('0x7f')](_0x368c66[_0x68ba('0xf6')])){return this['channel'][_0x68ba('0xa8')](_0x68ba('0xa5'));}this[_0x68ba('0xe')][_0x68ba('0xe0')]=!![];this['createSquareDetailsReport'](_0x368c66);this[_0x68ba('0x3e')](_0x368c66[_0x68ba('0x5a')],'in','','');this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')]('Trying\x20SestekNDA:\x20%s',_0x368c66[_0x68ba('0x5a')]));var _0x420c45=this['sestekNDA'][_0x68ba('0xa1')](this,_0x368c66);if(_0x420c45){for(var _0x36f5ee in _0x420c45){if(_0x420c45[_0x68ba('0x92')](_0x36f5ee)){this[_0x68ba('0xe')][_0x68ba('0x98')](util[_0x68ba('0x99')](_0x68ba('0xf7'),_0x36f5ee[_0x68ba('0x66')]()),_0x420c45[_0x36f5ee]);}}this[_0x68ba('0x3e')](_0x420c45[_0x68ba('0xe4')],_0x68ba('0xed'),_0x68ba('0xef'),'');if(_0x420c45[_0x68ba('0xf8')]){this[_0x68ba('0xe')]['noop'](util[_0x68ba('0x99')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x420c45[_0x68ba('0xf8')]));var _0x347084=this[_0x68ba('0xe')]['streamFile'](_0x420c45[_0x68ba('0xf8')]);try{fs[_0x68ba('0xf9')](_0x420c45[_0x68ba('0xf8')]+_0x68ba('0xfa'));}catch(_0x4cff85){logger[_0x68ba('0x28')](_0x4cff85);}return _0x347084;}else{return this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0xfb'),_0x420c45[_0x68ba('0xe4')]));}}return this[_0x68ba('0xe')]['error'](_0x368c66,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x68ba('0x11')][_0x68ba('0xfc')]=function(_0x56c192){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0xfd'),_0x56c192[_0x68ba('0x33')]));return this[_0x68ba('0xe')][_0x68ba('0xa8')](_0x68ba('0xfc'));};AGIVertices['prototype'][_0x68ba('0xfe')]=function(_0x1453ea){logger['info'](util[_0x68ba('0x99')](_0x68ba('0xff'),_0x1453ea[_0x68ba('0x33')]));var _0x5deb5e='';if(_0x1453ea[_0x68ba('0x100')]){if(!this['isConfigured'](_0x1453ea[_0x68ba('0x100')])){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x1453ea,'no\x20trunk\x20selected');}else{var _0x4e4c13=parseInt(_0x1453ea[_0x68ba('0x100')],0xa);if(isNaN(_0x4e4c13)){_0x5deb5e=_0x1453ea[_0x68ba('0x100')];}else{_0x5deb5e=this[_0x68ba('0x101')][_0x68ba('0xa1')](this,_0x1453ea['trunk_id']);if(!_0x5deb5e){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x1453ea,_0x68ba('0x102'));}}}}else if(_0x1453ea[_0x68ba('0x103')]){_0x5deb5e=_0x1453ea[_0x68ba('0x103')];}else{return this['channel'][_0x68ba('0x28')](_0x1453ea,_0x68ba('0x104'));}var _0x461d7f=this[_0x68ba('0xe')][_0x68ba('0x54')](_0x68ba('0x105'),[util[_0x68ba('0x99')](_0x68ba('0x106'),_0x5deb5e,_0x1453ea[_0x68ba('0x45')]),_0x1453ea[_0x68ba('0x63')],_0x1453ea[_0x68ba('0xdd')],_0x1453ea[_0x68ba('0x61')]]);if(_0x461d7f[_0x68ba('0xa7')]===-0x1){return _0x461d7f;}return this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0x107'),_0x68ba('0x105')));};AGIVertices[_0x68ba('0x11')][_0x68ba('0x108')]=function(_0x4e3d5a){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x109'),_0x4e3d5a[_0x68ba('0x33')]));return this[_0x68ba('0xe')]['noop'](_0x68ba('0x108'));};AGIVertices['prototype'][_0x68ba('0xd')]=function(_0x4f2a59){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x4f2a59[_0x68ba('0x33')]));if(_0x4f2a59[_0x68ba('0xa2')]===0x0){return this[_0x68ba('0xa0')](_0x4f2a59);}_0x4f2a59[_0x68ba('0xa2')]-=0x1;if(!this[_0x68ba('0x7f')](_0x4f2a59[_0x68ba('0x10a')])){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x4f2a59,_0x68ba('0x10b'));}var _0x389684=this[_0x68ba('0x1d')][_0x68ba('0xa1')](this,_0x4f2a59[_0x68ba('0x10a')]);if(!_0x389684){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x4f2a59,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x4f2a59[_0x68ba('0xd0')])){return this[_0x68ba('0xe')]['error'](_0x68ba('0xd1'));}var _0xd5dbde=this['channel'][_0x68ba('0x10c')](_0x389684,_0x4f2a59['response'],_0x4f2a59['maxdigit']);var _0x55ab42=_0xd5dbde[_0x68ba('0xa7')]?_0xd5dbde['result'][_0x68ba('0x49')]():'';logger[_0x68ba('0x2a')](_0x68ba('0x10d'),JSON[_0x68ba('0x6c')](_0xd5dbde));if(_0xd5dbde[_0x68ba('0xa7')]===-0x1){this['createSquareDetailsReport'][_0x68ba('0xa1')](this,_0x4f2a59,_0x55ab42);return _0xd5dbde;}else if(_0xd5dbde['extra']===_0x68ba('0x63')){_0xd5dbde[_0x68ba('0xa7')]=_0x55ab42['length']>=parseInt(_0x4f2a59[_0x68ba('0x10e')])?'x':'i';}else{_0xd5dbde[_0x68ba('0xa7')]=_0x55ab42[_0x68ba('0x9b')]>=parseInt(_0x4f2a59[_0x68ba('0x10e')])&&_0x55ab42['length']<=parseInt(_0x4f2a59[_0x68ba('0x10f')])?'x':'i';}var _0x518e67=this[_0x68ba('0x12')][_0x68ba('0xa1')](this,_0x4f2a59['variable_id']);if(!_0x518e67){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x4f2a59,_0x68ba('0xd2'));}this['channel'][_0x68ba('0x98')](_0x518e67,_0x55ab42);if(this[_0x68ba('0x7f')](_0x4f2a59[_0x68ba('0x110')])){var _0x5cee66=parseInt(_0x4f2a59[_0x68ba('0x110')],0xa);var _0x447590=rs[_0x68ba('0x111')]({'charset':'*','length':_0x5cee66});var _0xa94228=_0x55ab42[_0x68ba('0x9b')];if(_0xa94228>0x0){if(_0xa94228>_0x5cee66){this[_0x68ba('0x32')][_0x68ba('0xa1')](this,_0x4f2a59,_0x4f2a59['hiddendigitspos']===_0x68ba('0x112')?_0x447590+_0x55ab42[_0x68ba('0x113')](_0x5cee66):_0x55ab42[_0x68ba('0x113')](0x0,_0xa94228-_0x5cee66)+_0x447590);}else{this['createSquareDetailsReport'][_0x68ba('0xa1')](this,_0x4f2a59,rs[_0x68ba('0x111')]({'charset':'*','length':_0xa94228}));}}else{this[_0x68ba('0x32')][_0x68ba('0xa1')](this,_0x4f2a59,'');}}else{this[_0x68ba('0x32')]['sync'](this,_0x4f2a59,_0x55ab42);}return _0xd5dbde;};AGIVertices['prototype'][_0x68ba('0x114')]=function(_0x58da02){logger[_0x68ba('0x2a')](util['format'](_0x68ba('0x115'),_0x58da02[_0x68ba('0x33')]));return this[_0x68ba('0xd')](_0x58da02);};AGIVertices[_0x68ba('0x11')][_0x68ba('0x116')]=function(_0xab30b3){logger['info'](util[_0x68ba('0x99')](_0x68ba('0x117'),_0xab30b3['label']));this[_0x68ba('0x32')][_0x68ba('0xa1')](this,_0xab30b3,_0xab30b3['goalname']);return this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0x118'),_0xab30b3[_0x68ba('0x119')]));};AGIVertices['prototype'][_0x68ba('0x11a')]=function(_0x27dcfc){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x11b'),_0x27dcfc[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x27dcfc[_0x68ba('0x82')])||!this['isConfigured'](_0x27dcfc[_0x68ba('0x83')])){return this[_0x68ba('0xe')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x68ba('0x7f')](_0x27dcfc[_0x68ba('0x5a')])){return this['channel'][_0x68ba('0xa8')]('no\x20text\x20configured');}this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0x11c'),_0x27dcfc[_0x68ba('0x5a')]));var _0x1da3de=this[_0x68ba('0x81')][_0x68ba('0xa1')](this,_0x27dcfc);if(_0x1da3de){this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0x11d'),_0x1da3de));var _0x483c94=this[_0x68ba('0xe')]['streamFile'](_0x1da3de);try{fs[_0x68ba('0xf9')](_0x1da3de+_0x68ba('0xfa'));}catch(_0x2b00cf){logger[_0x68ba('0x28')](_0x2b00cf);}return _0x483c94;}return this['channel'][_0x68ba('0x28')](_0x27dcfc,_0x68ba('0x11e'));};AGIVertices[_0x68ba('0x11')]['awslex']=function(_0x1e2c53){logger['info'](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x1e2c53[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x1e2c53[_0x68ba('0x82')])||!this[_0x68ba('0x7f')](_0x1e2c53[_0x68ba('0x83')])){return this['channel'][_0x68ba('0xa8')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x68ba('0x7f')](_0x1e2c53['aws_bot_name'])){return this[_0x68ba('0xe')][_0x68ba('0xa8')]('no\x20bot\x20name\x20configured');}if(!this[_0x68ba('0x7f')](_0x1e2c53[_0x68ba('0x5a')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x68ba('0xe')][_0x68ba('0xe0')]=!![];this['createSquareDetailsReport'](_0x1e2c53);this[_0x68ba('0x3e')](_0x1e2c53[_0x68ba('0x5a')],'in','','');this['channel'][_0x68ba('0xa8')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x1e2c53[_0x68ba('0x5a')]));var _0x36b325=this[_0x68ba('0x86')]['sync'](this,_0x1e2c53);if(_0x36b325){for(var _0x4dc526 in _0x36b325){if(_0x36b325[_0x68ba('0x92')](_0x4dc526)&&_['isString'](_0x36b325[_0x4dc526])){this[_0x68ba('0xe')][_0x68ba('0x98')](util[_0x68ba('0x99')](_0x68ba('0x11f'),_0x4dc526['toUpperCase']()),_0x36b325[_0x4dc526]);}}if(_[_0x68ba('0x44')](_0x36b325[_0x68ba('0x70')])){return this[_0x68ba('0xe')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this['createSquareMessage'](_0x36b325[_0x68ba('0x70')],_0x68ba('0xed'),'amazonlex','');return this[_0x68ba('0xe')]['noop'](util[_0x68ba('0x99')](_0x68ba('0x120'),_0x36b325[_0x68ba('0x70')]));}}return this[_0x68ba('0xe')]['error'](_0x1e2c53,_0x68ba('0x121'));};AGIVertices[_0x68ba('0x11')][_0x68ba('0x122')]=function(_0x350c7a){logger[_0x68ba('0x2a')](util['format'](_0x68ba('0x123'),_0x350c7a[_0x68ba('0x33')],_0x350c7a['timeout']));if(!this['isConfigured'](_0x350c7a[_0x68ba('0x73')])){return this['channel'][_0x68ba('0xa8')](_0x68ba('0xdf'));}var _0xe2e168='wav';var _0x40fd74=util[_0x68ba('0x99')](_0x68ba('0x124'),FILES_PATH,rs[_0x68ba('0x111')](0x4));var _0x5c23d1=util[_0x68ba('0x99')]('%s.%s',_0x40fd74,_0xe2e168);var _0x355785=!![];if(_0x350c7a[_0x68ba('0x125')]===_0x68ba('0x126')){_0x355785=![];}var _0x2621b5=this[_0x68ba('0xe')][_0x68ba('0x127')](_0x40fd74,_0xe2e168,_0x350c7a['intKey'],_0x350c7a[_0x68ba('0x63')],undefined,_0x355785);if(_0x2621b5[_0x68ba('0xa7')]!==-0x1){this[_0x68ba('0xe')]['noop'](util[_0x68ba('0x99')](_0x68ba('0x128'),_0x5c23d1));var _0x5ba3b3=this[_0x68ba('0x89')]['sync'](this,_0x350c7a,_0x5c23d1);if(_0x5ba3b3){for(var _0x4a18b5 in _0x5ba3b3){if(_0x5ba3b3[_0x68ba('0x92')](_0x4a18b5)){this['channel'][_0x68ba('0x98')](util[_0x68ba('0x99')](_0x68ba('0x129'),_0x4a18b5['toUpperCase']()),_0x5ba3b3[_0x4a18b5]);}}return this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0x12a'),JSON[_0x68ba('0x6c')](_0x5ba3b3)));}}return _0x2621b5;};AGIVertices[_0x68ba('0x11')][_0x68ba('0x12b')]=function(_0x4ef275){logger[_0x68ba('0x2a')](util['format'](_0x68ba('0x12c'),_0x4ef275[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x4ef275[_0x68ba('0x8c')])){return this['channel']['noop'](_0x68ba('0x12d'));}if(!this[_0x68ba('0x7f')](_0x4ef275[_0x68ba('0x12e')])){return this[_0x68ba('0xe')][_0x68ba('0xa8')](_0x68ba('0x12f'));}var _0x15239a=_0x68ba('0x130');var _0x440389=util[_0x68ba('0x99')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x3b21c0=util[_0x68ba('0x99')]('%s.%s',_0x440389,_0x15239a);var _0x132b63=!![];if(_0x4ef275[_0x68ba('0x125')]==='NOBEEP'){_0x132b63=![];}var _0x23afa2=this[_0x68ba('0xe')][_0x68ba('0x127')](_0x440389,_0x15239a,_0x4ef275[_0x68ba('0x131')],_0x4ef275[_0x68ba('0x63')],undefined,_0x132b63);if(_0x23afa2['result']!==-0x1){this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0x132'),_0x3b21c0));var _0xb06d32=this['tildeASR'][_0x68ba('0xa1')](this,_0x4ef275,_0x3b21c0);if(_0xb06d32){for(var _0x44b9e6 in _0xb06d32){if(_0xb06d32['hasOwnProperty'](_0x44b9e6)){this[_0x68ba('0xe')][_0x68ba('0x98')](util[_0x68ba('0x99')](_0x68ba('0x133'),_0x44b9e6['toUpperCase']()),_0xb06d32[_0x44b9e6]);}}return this['channel'][_0x68ba('0xa8')](util['format'](_0x68ba('0x134'),JSON[_0x68ba('0x6c')](_0xb06d32)));}}return _0x23afa2;};AGIVertices[_0x68ba('0x11')]['gotoc']=function(_0x5ebca0){logger[_0x68ba('0x2a')](util['format'](_0x68ba('0x135'),_0x5ebca0[_0x68ba('0x33')]));return this[_0x68ba('0xe')][_0x68ba('0x136')](_0x5ebca0[_0x68ba('0x137')],_0x5ebca0[_0x68ba('0x3a')],_0x5ebca0[_0x68ba('0x3b')]);};AGIVertices[_0x68ba('0x11')][_0x68ba('0x138')]=function(_0x4b72ae){logger[_0x68ba('0x2a')](util['format'](_0x68ba('0x139'),_0x4b72ae[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x4b72ae[_0x68ba('0x13a')])){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x4b72ae,_0x68ba('0x13b'));}try{var _0x3d6afe=eval(_0x4b72ae[_0x68ba('0x13a')])?_0x68ba('0x13c'):_0x68ba('0x13d');this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0x13e'),_0x4b72ae[_0x68ba('0x13a')],_0x3d6afe));return{'code':0xc8,'result':_0x3d6afe};}catch(_0xd9cb52){return{'code':0xc8,'result':_0x68ba('0x13d')};}};AGIVertices[_0x68ba('0x11')]['gotoiftime']=function(_0x3f9fa2){logger['info'](util[_0x68ba('0x99')](_0x68ba('0x13f'),_0x3f9fa2['label']));if(!this['isConfigured'](_0x3f9fa2[_0x68ba('0x140')])){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x3f9fa2,_0x68ba('0x141'));}var _0x197af6=this[_0x68ba('0x142')][_0x68ba('0xa1')](this,_0x3f9fa2[_0x68ba('0x140')]);if(!_0x197af6){return this['channel']['error'](_0x3f9fa2,_0x68ba('0x143'));}for(var _0x3e1b40=0x0;_0x3e1b40<_0x197af6['length'];_0x3e1b40+=0x1){var _0x2205eb=this['channel'][_0x68ba('0x12')](util['format'](_0x68ba('0x144'),_0x197af6[_0x3e1b40]));if(_0x2205eb[_0x68ba('0xa7')]===-0x1){return _0x2205eb;}logger['info'](util[_0x68ba('0x99')](_0x68ba('0x145'),_0x197af6[_0x3e1b40],_0x2205eb[_0x68ba('0x9d')]));if(_0x2205eb[_0x68ba('0x9d')]===_0x68ba('0x13c')){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')]('IFTIME\x20%s\x20%s',_0x197af6[_0x3e1b40],_0x68ba('0x13c')));this[_0x68ba('0xe')][_0x68ba('0xa8')](util['format'](_0x68ba('0x145'),_0x197af6[_0x3e1b40],_0x68ba('0x13c')));return{'code':0xc8,'result':'true'};}else{logger[_0x68ba('0x2a')](util[_0x68ba('0x99')]('IFTIME\x20%s\x20%s',_0x197af6[_0x3e1b40],_0x68ba('0x13d')));this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0x145'),_0x197af6[_0x3e1b40],_0x68ba('0x13d')));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0x68ba('0x146')]=function(_0x9702ba){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x147'),_0x9702ba['label']));return this[_0x68ba('0xe')][_0x68ba('0x146')]();};AGIVertices[_0x68ba('0x11')][_0x68ba('0x148')]=function(_0x33dc2a){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x33dc2a[_0x68ba('0x33')]));if(!this['isConfigured'](_0x33dc2a[_0x68ba('0x73')])){return this['channel'][_0x68ba('0xa8')](_0x68ba('0xdf'));}var _0x448611=_0x68ba('0x130');var _0x43af0c=util[_0x68ba('0x99')]('%s/recordings/%s',FILES_PATH,rs[_0x68ba('0x111')](0x4));var _0x96987e=util[_0x68ba('0x99')]('%s.%s',_0x43af0c,_0x448611);var _0x30b2f4=!![];if(_0x33dc2a[_0x68ba('0x125')]===_0x68ba('0x126')){_0x30b2f4=![];}var _0x185000=this[_0x68ba('0xe')][_0x68ba('0x127')](_0x43af0c,_0x448611,_0x33dc2a[_0x68ba('0x131')],_0x33dc2a['timeout'],undefined,_0x30b2f4);if(_0x185000[_0x68ba('0xa7')]!==-0x1){this[_0x68ba('0xe')]['noop'](util[_0x68ba('0x99')](_0x68ba('0x149'),_0x96987e));var _0x4c0b37=this[_0x68ba('0x7d')][_0x68ba('0xa1')](this,_0x33dc2a,_0x96987e);if(_0x4c0b37){for(var _0xd8341a in _0x4c0b37){if(_0x4c0b37[_0x68ba('0x92')](_0xd8341a)){this[_0x68ba('0xe')]['setVariable'](util['format'](_0x68ba('0x14a'),_0xd8341a[_0x68ba('0x66')]()),_0x4c0b37[_0xd8341a]);}}return this[_0x68ba('0xe')][_0x68ba('0xa8')](util['format'](_0x68ba('0x14b'),JSON[_0x68ba('0x6c')](_0x4c0b37)));}}return _0x185000;};AGIVertices[_0x68ba('0x11')][_0x68ba('0x14c')]=function(_0xf54a16){logger[_0x68ba('0x2a')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0xf54a16[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0xf54a16[_0x68ba('0x73')])){return this[_0x68ba('0xe')]['noop'](_0x68ba('0xdf'));}if(!this[_0x68ba('0x7f')](_0xf54a16['text'])){return this['channel'][_0x68ba('0xa8')](_0x68ba('0xa5'));}this['channel']['noop'](util[_0x68ba('0x99')](_0x68ba('0x14d'),_0xf54a16['text']));var _0x4d7e03=this[_0x68ba('0x7b')]['sync'](this,_0xf54a16);if(_0x4d7e03){this[_0x68ba('0xe')]['noop'](util[_0x68ba('0x99')](_0x68ba('0x149'),_0x4d7e03));var _0x2e52c5=this[_0x68ba('0xe')][_0x68ba('0x14e')](_0x4d7e03,_0xf54a16[_0x68ba('0x131')]);try{fs['unlink'](_0x4d7e03+'.wav');}catch(_0x137077){logger[_0x68ba('0x28')](_0x137077);}return _0x2e52c5;}return this[_0x68ba('0xe')][_0x68ba('0x28')](_0xf54a16,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x68ba('0x11')][_0x68ba('0x14f')]=function(_0x2121dd){logger['info'](util[_0x68ba('0x99')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x2121dd[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x2121dd[_0x68ba('0x150')])){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x2121dd,_0x68ba('0x151'));}logger[_0x68ba('0x2a')](util['format'](_0x68ba('0x152'),this[_0x68ba('0xe')][_0x68ba('0x38')],_0x2121dd[_0x68ba('0x150')]));var _0x4005f3=this[_0x68ba('0x51')][_0x68ba('0xa1')](this,_0x2121dd[_0x68ba('0x150')]);if(_0x4005f3){logger[_0x68ba('0x2a')](util['format'](_0x68ba('0x153'),this['channel'][_0x68ba('0x38')],_0x2121dd[_0x68ba('0x150')]));this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x68ba('0xe')][_0x68ba('0x38')],_0x2121dd['findBy']));return{'code':0xc8,'result':_0x68ba('0x154')};}else{logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x155'),this[_0x68ba('0xe')][_0x68ba('0x38')],_0x2121dd['findBy']));this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0x155'),this[_0x68ba('0xe')][_0x68ba('0x38')],_0x2121dd[_0x68ba('0x150')]));return{'code':0xc8,'result':_0x68ba('0x156')};}};AGIVertices[_0x68ba('0x11')][_0x68ba('0x157')]=function(_0x3acb8d){logger['info'](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x3acb8d[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x3acb8d['findBy'])){return this[_0x68ba('0xe')]['error'](_0x3acb8d,_0x68ba('0x151'));}logger[_0x68ba('0x2a')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x68ba('0xe')]['callerid'],_0x3acb8d[_0x68ba('0x150')]));var _0x58f5f8=this[_0x68ba('0x50')][_0x68ba('0xa1')](this,_0x3acb8d[_0x68ba('0x150')]);if(_0x58f5f8){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x153'),this[_0x68ba('0xe')][_0x68ba('0x38')],_0x3acb8d[_0x68ba('0x150')]));this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x68ba('0xe')][_0x68ba('0x38')],_0x3acb8d[_0x68ba('0x150')]));return{'code':0xc8,'result':_0x68ba('0x154')};}else{logger['info'](util['format'](_0x68ba('0x155'),this[_0x68ba('0xe')][_0x68ba('0x38')],_0x3acb8d[_0x68ba('0x150')]));this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0x155'),this[_0x68ba('0xe')]['callerid'],_0x3acb8d[_0x68ba('0x150')]));return{'code':0xc8,'result':_0x68ba('0x156')};}};AGIVertices[_0x68ba('0x11')][_0x68ba('0x158')]=function(_0x6f2b6f){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x159'),_0x6f2b6f[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x6f2b6f[_0x68ba('0x15a')])){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x6f2b6f,_0x68ba('0x15b'));}this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0x15c'),_0x6f2b6f['operation']));var _0x7ab495=eval(_0x6f2b6f[_0x68ba('0x15a')]);if(!this[_0x68ba('0x7f')](_0x6f2b6f[_0x68ba('0xd0')])){return this[_0x68ba('0xe')][_0x68ba('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x525f56=this[_0x68ba('0x12')][_0x68ba('0xa1')](this,_0x6f2b6f['variable_id']);if(!_0x525f56){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x6f2b6f,_0x68ba('0xd2'));}if(_[_0x68ba('0x97')](_0x7ab495)){var _0x1dbc34=this;_0x7ab495['forEach'](function(_0x2d0f87,_0x3e094e){_0x1dbc34[_0x68ba('0xe')][_0x68ba('0x98')](util[_0x68ba('0x99')]('%s[%s]',_0x525f56,_0x3e094e),_0x2d0f87);});return this[_0x68ba('0xe')]['noop'](util[_0x68ba('0x99')](_0x68ba('0x15d'),_0x525f56));}else{return this[_0x68ba('0xe')][_0x68ba('0x98')](_0x525f56,_0x7ab495);}};AGIVertices[_0x68ba('0x11')][_0x68ba('0xc')]=function(_0x58b898){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x15e'),_0x58b898['label']));if(_0x58b898['retry']===0x0){return this['maxRetry'](_0x58b898);}_0x58b898[_0x68ba('0xa2')]-=0x1;if(!this['isConfigured'](_0x58b898['file_id'])){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x58b898,_0x68ba('0x10b'));}var _0x1c387c=this[_0x68ba('0x1d')][_0x68ba('0xa1')](this,_0x58b898['file_id']);if(!_0x1c387c){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x58b898,_0x68ba('0x15f'));}var _0x2299b8=this[_0x68ba('0xe')][_0x68ba('0x10c')](_0x1c387c,_0x58b898[_0x68ba('0x160')],_0x58b898[_0x68ba('0x161')]);var _0x43e1cd=_0x2299b8[_0x68ba('0xa7')];if(_0x2299b8[_0x68ba('0xa7')]===-0x1){this[_0x68ba('0x32')]['sync'](this,_0x58b898,'-1');return _0x2299b8;}else if(_0x2299b8[_0x68ba('0x9d')]===_0x68ba('0x63')){_0x2299b8[_0x68ba('0xa7')]=_0x2299b8[_0x68ba('0xa7')][_0x68ba('0x9b')]>0x0?_0x2299b8[_0x68ba('0xa7')]:'t';}else if(_[_0x68ba('0x40')](_0x2299b8[_0x68ba('0xa7')])){_0x2299b8[_0x68ba('0xa7')]='#';_0x43e1cd='#';}if(!this[_0x68ba('0x7f')](_0x58b898['variable_id'])){this['channel'][_0x68ba('0xa8')](_0x68ba('0xd1'));}else{var _0x4de060=this[_0x68ba('0x12')]['sync'](this,_0x58b898[_0x68ba('0xd0')]);if(!_0x4de060){return this[_0x68ba('0xe')]['error'](_0x58b898,_0x68ba('0xd2'));}this[_0x68ba('0xe')][_0x68ba('0x98')](_0x4de060,_0x43e1cd);}this[_0x68ba('0x32')][_0x68ba('0xa1')](this,_0x58b898,_0x43e1cd);return _0x2299b8;};AGIVertices[_0x68ba('0x11')]['noop']=function(_0x1abd0f){logger['info'](util[_0x68ba('0x99')](_0x68ba('0x162'),_0x1abd0f[_0x68ba('0x33')]));return this[_0x68ba('0xe')][_0x68ba('0xa8')](_0x1abd0f[_0x68ba('0x163')]||_0x1abd0f[_0x68ba('0x33')]);};AGIVertices[_0x68ba('0x11')]['pause']=function(_0x1dd4ed){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x164'),_0x1dd4ed[_0x68ba('0x33')]));if(!this['isConfigured'](_0x1dd4ed[_0x68ba('0x150')])){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x1dd4ed,_0x68ba('0x151'));}logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x152'),this[_0x68ba('0xe')][_0x68ba('0x38')],_0x1dd4ed[_0x68ba('0x150')]));var _0x15d51f=this[_0x68ba('0x4b')][_0x68ba('0xa1')](this,_0x1dd4ed[_0x68ba('0x165')]);var _0xa5fbe8=this['agentPause'][_0x68ba('0xa1')](this,_0x1dd4ed[_0x68ba('0x150')],_0x15d51f);if(_0xa5fbe8){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x153'),this[_0x68ba('0xe')]['callerid'],_0x1dd4ed[_0x68ba('0x150')]));this[_0x68ba('0xe')][_0x68ba('0xa8')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x68ba('0x38')],_0x1dd4ed['findBy']));return{'code':0xc8,'result':_0x68ba('0x154')};}else{logger[_0x68ba('0x2a')](util[_0x68ba('0x99')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x68ba('0x38')],_0x1dd4ed[_0x68ba('0x150')]));this['channel'][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0x153'),this[_0x68ba('0xe')][_0x68ba('0x38')],_0x1dd4ed['findBy']));return{'code':0xc8,'result':_0x68ba('0x156')};}};AGIVertices[_0x68ba('0x11')][_0x68ba('0x166')]=function(_0x15beb9){logger['info'](util[_0x68ba('0x99')](_0x68ba('0x167'),_0x15beb9['label']));if(!this[_0x68ba('0x7f')](_0x15beb9[_0x68ba('0x10a')])){return this['channel'][_0x68ba('0x28')](_0x15beb9,_0x68ba('0x10b'));}var _0x464255=this['getSound']['sync'](this,_0x15beb9['file_id']);if(!_0x464255){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x15beb9,_0x68ba('0x15f'));}var _0x56f330=this[_0x68ba('0xe')]['exec'](_0x68ba('0x168'),[_0x464255,_0x15beb9['opts']]);if(_0x56f330[_0x68ba('0xa7')]===-0x1){return _0x56f330;}return this['channel']['noop'](util[_0x68ba('0x99')]('Executed\x20command\x20%s\x20%s',_0x68ba('0x168'),_0x464255));};AGIVertices['prototype'][_0x68ba('0x169')]=function(_0x256ec9){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x16a'),_0x256ec9[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x256ec9[_0x68ba('0x16b')])){return this[_0x68ba('0xe')]['error'](_0x256ec9,_0x68ba('0x16c'));}var _0x185265='';var _0x5d23bc=parseInt(_0x256ec9[_0x68ba('0x16b')],0xa);if(isNaN(_0x5d23bc)){_0x185265=_0x256ec9[_0x68ba('0x16b')];}else{_0x185265=this[_0x68ba('0x16')][_0x68ba('0xa1')](this,_0x256ec9[_0x68ba('0x16b')]);if(!_0x185265){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x256ec9,_0x68ba('0x16d'));}}var _0x329f63='';if(this[_0x68ba('0x7f')](_0x256ec9[_0x68ba('0x10a')])){var _0x34602d=this[_0x68ba('0x1d')][_0x68ba('0xa1')](this,_0x256ec9[_0x68ba('0x10a')]);if(_0x34602d){_0x329f63=_0x34602d;}}this[_0x68ba('0x32')]['sync'](this,_0x256ec9,_0x185265);if(_0x256ec9[_0x68ba('0xdd')][_0x68ba('0x16e')]('x')<0x0){_0x256ec9[_0x68ba('0xdd')]+='x';}if(_0x256ec9['opts'][_0x68ba('0x16e')]('X')<0x0){_0x256ec9[_0x68ba('0xdd')]+='X';}this['channel'][_0x68ba('0x98')](_0x68ba('0x16f'),_0x185265?_0x185265['toLowerCase']():'');var _0x494d31=this['channel']['exec'](_0x68ba('0x170'),[_0x185265,_0x256ec9[_0x68ba('0xdd')],_0x256ec9[_0x68ba('0x61')],_0x329f63,_0x256ec9[_0x68ba('0x63')],_0x256ec9[_0x68ba('0x6')],_0x256ec9[_0x68ba('0x171')],_0x256ec9[_0x68ba('0x172')],'',_0x256ec9[_0x68ba('0x173')]]);if(_0x494d31[_0x68ba('0xa7')]===-0x1){return _0x494d31;}return this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0xbf'),_0x68ba('0x170'),_0x185265));};AGIVertices[_0x68ba('0x11')][_0x68ba('0x174')]=function(_0x32f185){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x175'),_0x32f185[_0x68ba('0x33')]));var _0x165834=_0x32f185[_0x68ba('0x176')]||_0x68ba('0x130');var _0x4eb265=util[_0x68ba('0x99')]('%s_%s',this[_0x68ba('0xe')][_0x68ba('0x37')],rs['generate'](0x5));var _0x44b7ac=util[_0x68ba('0x99')](_0x68ba('0x177'),FILES_PATH,_0x4eb265,_0x165834);var _0x2f1ed6=util[_0x68ba('0x99')](_0x68ba('0x124'),FILES_PATH,_0x4eb265);this['createSquareRecording'][_0x68ba('0xa1')](this,_0x32f185,_0x4eb265,_0x44b7ac);this[_0x68ba('0xe')][_0x68ba('0x98')](_0x68ba('0x178'),_0x4eb265);logger[_0x68ba('0x2a')](_0x68ba('0x179'),_0x2f1ed6,_0x165834,_0x32f185[_0x68ba('0x17a')],_0x32f185['timeout']);return this['channel']['recordFile'](_0x2f1ed6,_0x165834,_0x32f185[_0x68ba('0x17a')],_0x32f185[_0x68ba('0x63')],undefined,!![]);};AGIVertices['prototype'][_0x68ba('0x17b')]=function(_0x3186c9){logger[_0x68ba('0x2a')](util['format'](_0x68ba('0x17c'),_0x3186c9[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x3186c9['url'])){return this[_0x68ba('0xe')]['noop'](_0x68ba('0x17d'));}var _0x273d14=this[_0x68ba('0x60')][_0x68ba('0xa1')](this,_0x3186c9);logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x17e'),util[_0x68ba('0x17f')](_0x273d14,{'showHidden':![],'depth':null})));if(!this[_0x68ba('0x7f')](_0x3186c9[_0x68ba('0xd0')])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x4e4056=this['getVariable'][_0x68ba('0xa1')](this,_0x3186c9['variable_id']);if(!_0x4e4056){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x3186c9,_0x68ba('0xd2'));}this[_0x68ba('0xe')][_0x68ba('0x98')](util[_0x68ba('0x99')]('%s_STATUS_CODE',_0x4e4056),_0x273d14[_0x68ba('0x180')]?_0x273d14['statusCode']:'200');this[_0x68ba('0xe')][_0x68ba('0x98')](util[_0x68ba('0x99')](_0x68ba('0x181'),_0x4e4056),_0x273d14[_0x68ba('0x6f')]?_0x273d14[_0x68ba('0x6f')]:'OK');if(_0x273d14[_0x68ba('0x6d')]){try{this[_0x68ba('0x95')](_0x273d14[_0x68ba('0x6d')],_0x4e4056);}catch(_0x5d9c57){logger[_0x68ba('0x28')](util[_0x68ba('0x99')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x4e4056));}}return this['channel']['noop'](util[_0x68ba('0x99')](_0x68ba('0xd6'),_0x4e4056));};AGIVertices['prototype']['saydigits']=function(_0x948fa7){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x182'),_0x948fa7['label']));return this[_0x68ba('0xe')]['sayDigits'](_0x948fa7[_0x68ba('0x183')][_0x68ba('0x56')](/\s+/g,''),_0x948fa7[_0x68ba('0x17a')]);};AGIVertices[_0x68ba('0x11')]['saynumber']=function(_0x20f2f){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x184'),_0x20f2f[_0x68ba('0x33')]));return this['channel'][_0x68ba('0x185')](_0x20f2f[_0x68ba('0x186')][_0x68ba('0x56')](/\s+/g,''),_0x20f2f[_0x68ba('0x17a')]);};AGIVertices[_0x68ba('0x11')][_0x68ba('0x187')]=function(_0x1e62f9){logger[_0x68ba('0x2a')](util['format'](_0x68ba('0x188'),_0x1e62f9[_0x68ba('0x33')]));return this['channel'][_0x68ba('0x189')](_0x1e62f9[_0x68ba('0x5a')],_0x1e62f9['escape_digits']);};AGIVertices[_0x68ba('0x11')][_0x68ba('0x18a')]=function(_0x387b83){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x18b'),_0x387b83[_0x68ba('0x33')]));if(!this['isConfigured'](_0x387b83[_0x68ba('0x18c')])){return this['channel']['noop'](_0x68ba('0x18d'));}var _0xba449f=this[_0x68ba('0x20')][_0x68ba('0xa1')](this,_0x387b83['account_id']);if(!_0xba449f||!_0xba449f['Smtp']){return this[_0x68ba('0xe')]['error'](_0x387b83,'no\x20mail\x20account\x20found');}var _0x1884bc={'from':util[_0x68ba('0x99')]('\x22%s\x22\x20<%s>',_0xba449f[_0x68ba('0x18')],_0xba449f[_0x68ba('0x18e')]||_0xba449f[_0x68ba('0x18f')][_0x68ba('0x190')]),'to':_0x387b83['to']||'','cc':_0x387b83['cc']||'','bcc':_0x387b83['bcc']||'','subject':_0x387b83[_0x68ba('0x191')],'html':_0x387b83['text'],'text':_0x387b83[_0x68ba('0x5a')]};var _0xfbd961={'tls':{'rejectUnauthorized':![]}};if(_0xba449f[_0x68ba('0x18f')]['service']){_0xfbd961['service']=_0xba449f[_0x68ba('0x18f')][_0x68ba('0x192')];}else{_0xfbd961[_0x68ba('0x193')]=_0xba449f['Smtp'][_0x68ba('0x193')];_0xfbd961[_0x68ba('0x194')]=_0xba449f[_0x68ba('0x18f')][_0x68ba('0x194')];_0xfbd961['secure']=_0xba449f[_0x68ba('0x18f')][_0x68ba('0x195')];}if(_0xba449f[_0x68ba('0x18f')][_0x68ba('0x196')]){_0xfbd961[_0x68ba('0x197')]={'user':_0xba449f[_0x68ba('0x18f')][_0x68ba('0x190')],'pass':_0xba449f[_0x68ba('0x18f')]['pass']};}if(this['isConfigured'](_0x387b83[_0x68ba('0x198')])){}logger[_0x68ba('0xd8')](_0x68ba('0x199'),JSON[_0x68ba('0x6c')](_0x1884bc));this['createSquareDetailsReport'][_0x68ba('0xa1')](this,_0x387b83,_0x387b83[_0x68ba('0x18c')]);this[_0x68ba('0xe')][_0x68ba('0xa8')](util['format'](_0x68ba('0x19a'),_0xba449f[_0x68ba('0x18')]));this[_0x68ba('0x21')][_0x68ba('0xa1')](this,_0xfbd961,_0x1884bc);return this[_0x68ba('0xe')][_0x68ba('0xa8')](_0x68ba('0x19b'));};AGIVertices[_0x68ba('0x11')]['sendFax']=function(_0x59cc17){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x59cc17[_0x68ba('0x33')]));return this[_0x68ba('0xe')]['noop'](_0x68ba('0x19c'));};AGIVertices['prototype'][_0x68ba('0x19d')]=function(_0x4a91cb){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x19e'),_0x4a91cb[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x4a91cb[_0x68ba('0x19f')])){return this['channel'][_0x68ba('0xa8')]('no\x20sms\x20account\x20configured');}var _0x40d228=this[_0x68ba('0x2f')]['sync'](this,_0x4a91cb[_0x68ba('0x19f')]);if(!_0x40d228){return this['channel'][_0x68ba('0x28')](_0x4a91cb,'no\x20sms\x20account\x20found');}var _0x31be53={'body':_0x4a91cb[_0x68ba('0x1a0')],'phone':_0x4a91cb['to']||'','SmsAccountId':_0x40d228['id']};logger[_0x68ba('0xd8')](_0x68ba('0x1a1'),JSON[_0x68ba('0x6c')](_0x31be53));this[_0x68ba('0x32')]['sync'](this,_0x4a91cb,_0x4a91cb[_0x68ba('0x19f')]);this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x40d228[_0x68ba('0x18')]));this[_0x68ba('0x31')][_0x68ba('0xa1')](this,_0x31be53);return this['channel'][_0x68ba('0xa8')](_0x68ba('0x1a2'));};AGIVertices[_0x68ba('0x11')][_0x68ba('0x1a3')]=function(_0x191965){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x191965[_0x68ba('0x33')]));if(!this['isConfigured'](_0x191965['variable_id'])){return this[_0x68ba('0xe')]['error'](_0x191965,_0x68ba('0x1a4'));}var _0x49b6de=this['getVariable'][_0x68ba('0xa1')](this,_0x191965['variable_id']);if(!_0x49b6de){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x191965,'no\x20variable\x20found');}return this[_0x68ba('0xe')][_0x68ba('0x98')](_0x49b6de,_0x191965['variable_value']);};AGIVertices[_0x68ba('0x11')][_0x68ba('0x1a5')]=function(_0x326b72){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')]('Enter\x20in\x20START\x20(%s)\x20block',_0x326b72[_0x68ba('0x33')]));this[_0x68ba('0xe')][_0x68ba('0xa8')](_0x68ba('0x1a6'));if(_0x326b72['answer']===_0x68ba('0x1a7')){this[_0x68ba('0xe')][_0x68ba('0xa8')](_0x68ba('0x1a8'));return this[_0x68ba('0xe')][_0x68ba('0xb5')]();}return this[_0x68ba('0xe')]['noop'](_0x68ba('0x1a9'));};AGIVertices[_0x68ba('0x11')][_0x68ba('0x1aa')]=function(_0x510610){logger[_0x68ba('0x2a')](util['format'](_0x68ba('0x1ab'),_0x510610[_0x68ba('0x33')]));if(!this['isConfigured'](_0x510610[_0x68ba('0x1ac')])){return this['channel'][_0x68ba('0x28')](_0x510610,_0x68ba('0x1ad'));}var _0x4149d1=this[_0x68ba('0x19')][_0x68ba('0xa1')](this,_0x510610['project_id']);if(!this['isConfigured'](_0x4149d1)){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x510610,util[_0x68ba('0x99')](_0x68ba('0x1ae'),_0x510610['project_id']));}if(_0x4149d1===this[_0x68ba('0xe')][_0x68ba('0x35')]){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x510610,_0x68ba('0x1af'));}this[_0x68ba('0x32')]['sync'](this,_0x510610,_0x4149d1);var _0x27b8e6=this[_0x68ba('0xe')]['exec'](_0x68ba('0x1b0'),util['format'](_0x68ba('0x1b1'),config['agi'][_0x68ba('0x193')]||_0x68ba('0x1b2'),_0x4149d1,this[_0x68ba('0xe')][_0x68ba('0x35')]));if(_0x27b8e6[_0x68ba('0xa7')]===-0x1){return _0x27b8e6;}return this['channel']['noop'](util[_0x68ba('0x99')]('Executed\x20command\x20%s\x20%s',_0x68ba('0x1b0'),_0x4149d1));};AGIVertices[_0x68ba('0x11')][_0x68ba('0x1b3')]=function(_0x727386){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x1b4'),_0x727386[_0x68ba('0x33')]));var _0x555075=this[_0x68ba('0x1b5')][_0x68ba('0xa1')](this,_0x727386[_0x68ba('0x1b6')]);this[_0x68ba('0x32')][_0x68ba('0xa1')](this,_0x727386,_0x727386[_0x68ba('0x1b6')]);if(this['isConfigured'](_0x727386['variable_id'])){var _0x4c68a0=this['getVariable']['sync'](this,_0x727386[_0x68ba('0xd0')]);if(_0x4c68a0){this[_0x68ba('0xe')]['setVariable'](_0x4c68a0,_0x555075);return this[_0x68ba('0xe')][_0x68ba('0xa8')](util['format'](_0x68ba('0x1b7'),_0x727386['command'],_0x4c68a0));}}return this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x727386[_0x68ba('0x1b6')]));};AGIVertices['prototype'][_0x68ba('0x1b8')]=function(_0x39acd9){logger['info'](util[_0x68ba('0x99')](_0x68ba('0x1b9'),_0x39acd9[_0x68ba('0x33')]));_0x39acd9[_0x68ba('0x5a')]=_0x39acd9[_0x68ba('0x5a')][_0x68ba('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x68ba('0x7f')](_0x39acd9[_0x68ba('0x58')])){return this[_0x68ba('0xe')][_0x68ba('0xa8')](_0x68ba('0x1ba'));}if(!this['isConfigured'](_0x39acd9[_0x68ba('0x5a')])){return this[_0x68ba('0xe')]['noop'](_0x68ba('0xa5'));}this['channel'][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0x1bb'),_0x39acd9['text']));var _0x4cc03a=this[_0x68ba('0x57')]['sync'](this,_0x39acd9);if(_0x4cc03a){this['channel'][_0x68ba('0xa8')](util['format'](_0x68ba('0x1bc'),_0x4cc03a));var _0xf3c130=this[_0x68ba('0xe')][_0x68ba('0x14e')](_0x4cc03a);try{fs[_0x68ba('0xf9')](_0x4cc03a+_0x68ba('0xfa'));}catch(_0x2ac2f6){logger[_0x68ba('0x28')](_0x2ac2f6);}return _0xf3c130;}return this['channel'][_0x68ba('0x28')](_0x39acd9,_0x68ba('0x1bd'));};AGIVertices[_0x68ba('0x11')]['tts']=function(_0x54bcb4){logger[_0x68ba('0x2a')](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x54bcb4[_0x68ba('0x33')]));_0x54bcb4['text']=_0x54bcb4[_0x68ba('0x5a')][_0x68ba('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x68ba('0x7f')](_0x54bcb4[_0x68ba('0x5a')])){return this[_0x68ba('0xe')][_0x68ba('0xa8')](_0x68ba('0xa5'));}this['channel'][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0x1be'),_0x54bcb4[_0x68ba('0x5a')]));var _0x29f697=this[_0x68ba('0x5e')]['sync'](this,_0x54bcb4);if(_0x29f697){this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0x1bf'),_0x29f697));var _0x11745e=this['channel'][_0x68ba('0x14e')](_0x29f697);try{fs[_0x68ba('0xf9')](_0x29f697+'.wav');}catch(_0x1ccb73){logger[_0x68ba('0x28')](_0x1ccb73);}return _0x11745e;}return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x54bcb4,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x68ba('0x11')][_0x68ba('0x1c0')]=function(_0x3b3abe){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x1c1'),_0x3b3abe[_0x68ba('0x33')]));if(!this[_0x68ba('0x7f')](_0x3b3abe[_0x68ba('0x150')])){return this['channel']['error'](_0x3b3abe,'no\x20find\x20by\x20configured');}logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x152'),this[_0x68ba('0xe')][_0x68ba('0x38')],_0x3b3abe[_0x68ba('0x150')]));var _0x280a5f=this['agentUnpause'][_0x68ba('0xa1')](this,_0x3b3abe[_0x68ba('0x150')]);if(_0x280a5f){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')](_0x68ba('0x153'),this[_0x68ba('0xe')][_0x68ba('0x38')],_0x3b3abe[_0x68ba('0x150')]));this[_0x68ba('0xe')]['noop'](util[_0x68ba('0x99')](_0x68ba('0x153'),this[_0x68ba('0xe')][_0x68ba('0x38')],_0x3b3abe[_0x68ba('0x150')]));return{'code':0xc8,'result':_0x68ba('0x154')};}else{logger[_0x68ba('0x2a')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x68ba('0xe')][_0x68ba('0x38')],_0x3b3abe[_0x68ba('0x150')]));this[_0x68ba('0xe')]['noop'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x68ba('0xe')][_0x68ba('0x38')],_0x3b3abe[_0x68ba('0x150')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x68ba('0x1c2')]=function(_0x2bd652){logger[_0x68ba('0x2a')](util[_0x68ba('0x99')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x2bd652[_0x68ba('0x33')]));var _0x529fb8=this[_0x68ba('0xe')][_0x68ba('0x54')](_0x68ba('0x1c3'),[_0x2bd652[_0x68ba('0x1c4')],_0x2bd652[_0x68ba('0x72')]]);if(_0x529fb8[_0x68ba('0xa7')]===-0x1){return _0x529fb8;}return this[_0x68ba('0xe')][_0x68ba('0xa8')](util[_0x68ba('0x99')](_0x68ba('0xbf'),_0x68ba('0x1c3'),_0x2bd652[_0x68ba('0x1c4')]));};AGIVertices[_0x68ba('0x11')]['vswitch']=function(_0x173cea){logger['info'](util[_0x68ba('0x99')](_0x68ba('0x1c5'),_0x173cea[_0x68ba('0x33')]));if(!this['isConfigured'](_0x173cea[_0x68ba('0xd0')])){return this[_0x68ba('0xe')][_0x68ba('0x28')](_0x173cea,_0x68ba('0x1a4'));}var _0x3d3796=this[_0x68ba('0x12')][_0x68ba('0xa1')](this,_0x173cea[_0x68ba('0xd0')]);if(!_0x3d3796){return this['channel'][_0x68ba('0x28')](_0x173cea,_0x68ba('0xd2'));}var _0x350823=this['channel'][_0x68ba('0x12')](_0x3d3796);return{'code':0xc8,'result':_0x350823[_0x68ba('0x9d')]?_0x350823[_0x68ba('0x9d')]:'-'};};String[_0x68ba('0x11')][_0x68ba('0x9c')]=function(_0x2fd364,_0x112ce8){return this['split'](_0x2fd364)[_0x68ba('0x1c6')](_0x112ce8);};module[_0x68ba('0x1c7')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 704dc3b..98414ef 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 _0xe8f4=['milliseconds','seconds','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','acwTimeout','timer','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','catch','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','[%s][HANGUP:LINKEDID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','bind','syncHangupRequest','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer'];(function(_0x2c7083,_0x2cfab6){var _0x1bad14=function(_0x535a90){while(--_0x535a90){_0x2c7083['push'](_0x2c7083['shift']());}};_0x1bad14(++_0x2cfab6);}(_0xe8f4,0xeb));var _0x4e8f=function(_0x166ecd,_0x5b569f){_0x166ecd=_0x166ecd-0x0;var _0x56e207=_0xe8f4[_0x166ecd];return _0x56e207;};'use strict';var util=require(_0x4e8f('0x0'));var _=require(_0x4e8f('0x1'));var moment=require(_0x4e8f('0x2'));var ami=require(_0x4e8f('0x3'));var logger=require(_0x4e8f('0x4'))(_0x4e8f('0x5'));var RpcUser=require(_0x4e8f('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x5ab9bb){this['voiceQueues']=_0x5ab9bb[_0x4e8f('0x7')];this[_0x4e8f('0x8')]=_0x5ab9bb[_0x4e8f('0x8')];this[_0x4e8f('0x9')]=_0x5ab9bb['timers'];this[_0x4e8f('0xa')]={};ami['on'](_0x4e8f('0xb'),this['syncAgentConnect'][_0x4e8f('0xc')](this));ami['on']('hanguprequest',this[_0x4e8f('0xd')][_0x4e8f('0xc')](this));ami['on']('hangup',this[_0x4e8f('0xe')]['bind'](this));ami['on']('agentringnoanswer',this[_0x4e8f('0xf')][_0x4e8f('0xc')](this));ami['on'](_0x4e8f('0x10'),this[_0x4e8f('0x11')][_0x4e8f('0xc')](this));ami['on'](_0x4e8f('0x12'),this[_0x4e8f('0x13')][_0x4e8f('0xc')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0x4e8f('0xc')](this));}function getDiff(_0x112e0e){var _0x4526d7=moment()[_0x4e8f('0x14')](0x0);var _0x574d30=moment(_0x112e0e)[_0x4e8f('0x14')](0x0);return _0x4526d7['diff'](_0x574d30,_0x4e8f('0x15'));}Acw['prototype'][_0x4e8f('0x16')]=function(_0x58dc78){try{var _0x231ca0=this;var _0xcebb46=this['channels'][_0x58dc78][_0x4e8f('0x17')];var _0x12c22a=this[_0x4e8f('0xa')][_0x58dc78][_0x4e8f('0x18')];var _0x288429=this[_0x4e8f('0x7')][_0x12c22a];var _0x5e97b8=![];var _0x11ea1a=_0x4e8f('0x19');if(_0x288429[_0x4e8f('0x1a')]){if(_0x288429['mandatoryDispositionPause']['name']){_0x5e97b8=!![];_0x11ea1a=_0x288429[_0x4e8f('0x1b')][_0x4e8f('0x1c')];}}ami[_0x4e8f('0x1d')]({'action':_0x4e8f('0x1e'),'interface':_0xcebb46,'paused':!![],'reason':_0x11ea1a})[_0x4e8f('0x1f')](function(_0x158c30){if(_0x231ca0[_0x4e8f('0x8')][_0xcebb46]){return RpcUser[_0x4e8f('0x20')](_0x231ca0[_0x4e8f('0x8')][_0xcebb46]['id'])[_0x4e8f('0x1f')](function(_0x391882){if(_0x391882&&!_0x391882[_0x4e8f('0x21')]){logger[_0x4e8f('0x22')](_0x4e8f('0x23'),_0x58dc78,_0xcebb46,_0x12c22a);var _0x5167dd=_0x231ca0[_0x4e8f('0xa')][_0x58dc78][_0x4e8f('0x24')]&&_0x231ca0['channels'][_0x58dc78][_0x4e8f('0x25')]?_0x231ca0[_0x4e8f('0xa')][_0x58dc78][_0x4e8f('0x25')]:_0x58dc78;return RpcUser['savePause'](_0x231ca0['agents'][_0xcebb46],_0x11ea1a,_0x5167dd)[_0x4e8f('0x1f')](function(_0x5c24ac){if(!_0x5e97b8){_0x231ca0[_0x4e8f('0x9')][_0xcebb46]={};logger[_0x4e8f('0x22')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x58dc78,_0x231ca0[_0x4e8f('0x7')][_0x12c22a][_0x4e8f('0x26')],_0xcebb46,_0x12c22a);_0x231ca0['timers'][_0xcebb46][_0x4e8f('0x27')]=setTimeout(_0x231ca0[_0x4e8f('0x28')][_0x4e8f('0xc')](_0x231ca0,_0xcebb46),_0x231ca0['voiceQueues'][_0x12c22a]['acwTimeout']*0x3e8);_0x231ca0[_0x4e8f('0x9')][_0xcebb46]['lastPauseAt']=moment()[_0x4e8f('0x29')](_0x4e8f('0x2a'));_0x231ca0[_0x4e8f('0x9')][_0xcebb46][_0x4e8f('0x2b')]=_0x58dc78;_0x231ca0[_0x4e8f('0x9')][_0xcebb46][_0x4e8f('0x18')]=_0x12c22a;_0x231ca0[_0x4e8f('0x9')][_0xcebb46][_0x4e8f('0x2c')]=function(){var _0x238db2=getDiff(_0x231ca0[_0x4e8f('0x9')][_0xcebb46][_0x4e8f('0x2d')]);clearTimeout(_0x231ca0[_0x4e8f('0x9')][_0xcebb46]['timer']);_0x231ca0[_0x4e8f('0x9')][_0xcebb46][_0x4e8f('0x27')]=![];RpcVoiceAgentReport[_0x4e8f('0x2e')]({'acwtime':_0x238db2},_0x231ca0[_0x4e8f('0x9')][_0xcebb46]['uniqueid'],_0xcebb46)[_0x4e8f('0x1f')](function(_0x37f4fd){logger[_0x4e8f('0x22')](_0x4e8f('0x2f'),_0x58dc78,_0x238db2,_0x37f4fd);})['catch'](function(_0xf37fb1){logger[_0x4e8f('0x30')](_0x4e8f('0x31'),_0x58dc78,_0xf37fb1);});delete _0x231ca0[_0x4e8f('0x9')][_0xcebb46];};}});}else{logger[_0x4e8f('0x22')](_0x4e8f('0x32'),_0x58dc78,_0xcebb46,_0x12c22a);}});}})['catch'](function(_0x5afbe8){logger[_0x4e8f('0x30')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x58dc78,_0x231ca0['voiceQueues'][_0x12c22a][_0x4e8f('0x26')],_0xcebb46,_0x12c22a);})[_0x4e8f('0x33')](function(){delete _0x231ca0[_0x4e8f('0xa')][_0x58dc78];});}catch(_0x925b6d){logger[_0x4e8f('0x30')]('[ACW][START]\x20%s',_0x925b6d[_0x4e8f('0x34')]);}};Acw[_0x4e8f('0x35')][_0x4e8f('0x28')]=function(_0x47a58f){try{var _0x1ff15f=this;if(_0x1ff15f[_0x4e8f('0x9')][_0x47a58f]){_0x1ff15f[_0x4e8f('0x9')][_0x47a58f][_0x4e8f('0x27')]=![];var _0x119350=_0x1ff15f[_0x4e8f('0x9')][_0x47a58f]['uniqueid'];var _0x1b7900=_0x1ff15f['timers'][_0x47a58f][_0x4e8f('0x18')];var _0x160635=_0x1ff15f[_0x4e8f('0x7')][_0x1b7900]['acwTimeout'];logger[_0x4e8f('0x22')](_0x4e8f('0x36'),_0x119350,_0x47a58f);RpcUser[_0x4e8f('0x37')](this[_0x4e8f('0x8')][_0x47a58f]);RpcVoiceAgentReport[_0x4e8f('0x2e')]({'acwtime':_0x160635,'agentacw':!![]},_0x119350,_0x47a58f)[_0x4e8f('0x1f')](function(_0x4ef8ac){logger[_0x4e8f('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x119350,_0x160635,_0x4ef8ac);})[_0x4e8f('0x38')](function(_0x4d261f){logger['error'](_0x4e8f('0x31'),_0x119350,_0x4d261f);});}else{logger['error'](_0x4e8f('0x39'),_0x47a58f);if(_0x1ff15f[_0x4e8f('0x9')]){logger[_0x4e8f('0x22')](_0x4e8f('0x3a'),JSON[_0x4e8f('0x3b')](_0x1ff15f['timers']));}}}catch(_0x18895c){logger[_0x4e8f('0x30')](_0x4e8f('0x3c'),_0x18895c[_0x4e8f('0x34')]);}};Acw[_0x4e8f('0x35')]['syncAgentConnect']=function(_0x4698ed){try{if(this[_0x4e8f('0x7')][_0x4698ed[_0x4e8f('0x18')]]&&(this[_0x4e8f('0x7')][_0x4698ed[_0x4e8f('0x18')]][_0x4e8f('0x5')]||this[_0x4e8f('0x7')][_0x4698ed[_0x4e8f('0x18')]]['mandatoryDisposition'])){if(this['agents'][_0x4698ed['interface']]){this[_0x4e8f('0xa')][_0x4698ed['uniqueid']]={'queue':_0x4698ed['queue'],'interface':_0x4698ed[_0x4e8f('0x17')],'destlinkedid':_0x4698ed[_0x4e8f('0x25')]};}}}catch(_0x250904){logger[_0x4e8f('0x30')](_0x4e8f('0x3d'),_0x250904[_0x4e8f('0x34')]);}};Acw[_0x4e8f('0x35')]['syncAgentConnectPreview']=function(_0x143bbf){try{if(this[_0x4e8f('0x7')][_0x143bbf[_0x4e8f('0x18')]]&&(this[_0x4e8f('0x7')][_0x143bbf[_0x4e8f('0x18')]]['acw']||this[_0x4e8f('0x7')][_0x143bbf[_0x4e8f('0x18')]][_0x4e8f('0x1a')])){if(this[_0x4e8f('0x8')][_0x143bbf[_0x4e8f('0x17')]]){this['channels'][_0x143bbf[_0x4e8f('0x2b')]]={'queue':_0x143bbf['queue'],'interface':_0x143bbf['interface']};}}}catch(_0x416527){logger[_0x4e8f('0x30')](_0x4e8f('0x3e'),_0x416527[_0x4e8f('0x34')]);}};Acw[_0x4e8f('0x35')][_0x4e8f('0xd')]=function(_0x43559a){try{if(this[_0x4e8f('0xa')][_0x43559a[_0x4e8f('0x2b')]]&&_[_0x4e8f('0x3f')](this[_0x4e8f('0xa')][_0x43559a[_0x4e8f('0x2b')]]['attended'])){logger[_0x4e8f('0x22')](_0x4e8f('0x40'),_0x43559a['uniqueid']);this[_0x4e8f('0x16')](_0x43559a[_0x4e8f('0x2b')]);}else if(this['channels'][_0x43559a['linkedid']]&&_['isUndefined'](this[_0x4e8f('0xa')][_0x43559a['linkedid']][_0x4e8f('0x24')])){logger[_0x4e8f('0x22')](_0x4e8f('0x41'),_0x43559a[_0x4e8f('0x42')]);this[_0x4e8f('0x16')](_0x43559a[_0x4e8f('0x42')]);}}catch(_0x48fa39){logger[_0x4e8f('0x30')](_0x4e8f('0x43'),_0x48fa39[_0x4e8f('0x34')]);}};Acw[_0x4e8f('0x35')][_0x4e8f('0xe')]=function(_0x50fa45){try{if(this['channels'][_0x50fa45['uniqueid']]&&this[_0x4e8f('0xa')][_0x50fa45[_0x4e8f('0x2b')]]['attended']){logger[_0x4e8f('0x22')](_0x4e8f('0x44'),_0x50fa45[_0x4e8f('0x2b')]);this[_0x4e8f('0x16')](_0x50fa45[_0x4e8f('0x2b')]);}else if(this[_0x4e8f('0xa')][_0x50fa45[_0x4e8f('0x42')]]&&this[_0x4e8f('0xa')][_0x50fa45[_0x4e8f('0x42')]][_0x4e8f('0x24')]){logger[_0x4e8f('0x22')](_0x4e8f('0x45'),_0x50fa45[_0x4e8f('0x42')]);this[_0x4e8f('0x16')](_0x50fa45[_0x4e8f('0x42')]);}}catch(_0xc88cee){logger[_0x4e8f('0x30')]('[ACW][syncHangup]\x20%s',_0xc88cee['message']);}};Acw[_0x4e8f('0x35')][_0x4e8f('0x11')]=function(_0x14f358){try{if(!_[_0x4e8f('0x46')](this['channels'][_0x14f358[_0x4e8f('0x47')]])){this[_0x4e8f('0x16')](_0x14f358[_0x4e8f('0x47')]);if(this['channels'][_0x14f358[_0x4e8f('0x48')]]){this['channels'][_0x14f358[_0x4e8f('0x48')]][_0x4e8f('0x24')]=!![];this[_0x4e8f('0xa')][_0x14f358[_0x4e8f('0x49')]]=this[_0x4e8f('0xa')][_0x14f358['secondtransfereruniqueid']];delete this[_0x4e8f('0xa')][_0x14f358[_0x4e8f('0x48')]];}}else if(!_[_0x4e8f('0x46')](this['channels'][_0x14f358['transfertargetuniqueid']])){this[_0x4e8f('0x16')](_0x14f358[_0x4e8f('0x49')]);if(this[_0x4e8f('0xa')][_0x14f358['origtransfereruniqueid']]){this[_0x4e8f('0xa')][_0x14f358[_0x4e8f('0x4a')]][_0x4e8f('0x24')]=!![];this[_0x4e8f('0xa')][_0x14f358[_0x4e8f('0x47')]]=this['channels'][_0x14f358[_0x4e8f('0x4a')]];delete this[_0x4e8f('0xa')][_0x14f358[_0x4e8f('0x4a')]];}}}catch(_0x49b8c9){logger[_0x4e8f('0x30')](_0x4e8f('0x4b'),_0x49b8c9['message']);}};Acw[_0x4e8f('0x35')][_0x4e8f('0x13')]=function(_0x5b6e29){try{if(this[_0x4e8f('0xa')][_0x5b6e29['transfereruniqueid']]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x4e8f('0x3b')](_0x5b6e29[_0x4e8f('0x4c')]));this[_0x4e8f('0x16')](_0x5b6e29[_0x4e8f('0x4c')]);}else if(this[_0x4e8f('0xa')][_0x5b6e29[_0x4e8f('0x4d')]]){logger[_0x4e8f('0x22')](_0x4e8f('0x4e'),JSON[_0x4e8f('0x3b')](_0x5b6e29[_0x4e8f('0x4d')]));this[_0x4e8f('0x16')](_0x5b6e29[_0x4e8f('0x4d')]);}}catch(_0x4f532b){logger[_0x4e8f('0x30')]('[ACW][syncBlindTransfer]\x20%s',_0x4f532b[_0x4e8f('0x34')]);}};Acw[_0x4e8f('0x35')]['syncAgentRingNoAnswer']=function(_0x3dbea2){try{if(this[_0x4e8f('0x7')][_0x3dbea2[_0x4e8f('0x18')]]&&this['voiceQueues'][_0x3dbea2[_0x4e8f('0x18')]][_0x4e8f('0x4f')]===_0x4e8f('0x50')){if(this[_0x4e8f('0x8')][_0x3dbea2[_0x4e8f('0x17')]]){logger[_0x4e8f('0x22')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x3dbea2[_0x4e8f('0x2b')],_0x3dbea2[_0x4e8f('0x17')],_0x3dbea2['queue']);return RpcUser[_0x4e8f('0x51')](this[_0x4e8f('0x8')][_0x3dbea2[_0x4e8f('0x17')]],_0x4e8f('0x52'),_0x3dbea2['uniqueid']);}}}catch(_0x3ab970){logger['error'](_0x4e8f('0x53'),_0x3ab970['message']);}};module[_0x4e8f('0x54')]=Acw; \ No newline at end of file +var _0xa8cb=['stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','update','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','interface','acw','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','startAcw','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','seconds','prototype','queue','voiceQueues','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer'];(function(_0x4a248d,_0x10d62a){var _0x411717=function(_0x3479b1){while(--_0x3479b1){_0x4a248d['push'](_0x4a248d['shift']());}};_0x411717(++_0x10d62a);}(_0xa8cb,0x80));var _0xba8c=function(_0x572898,_0x2f2aa1){_0x572898=_0x572898-0x0;var _0x2a7801=_0xa8cb[_0x572898];return _0x2a7801;};'use strict';var util=require(_0xba8c('0x0'));var _=require(_0xba8c('0x1'));var moment=require(_0xba8c('0x2'));var ami=require(_0xba8c('0x3'));var logger=require(_0xba8c('0x4'))('acw');var RpcUser=require(_0xba8c('0x5'));var RpcVoiceAgentReport=require(_0xba8c('0x6'));function Acw(_0x220115){this['voiceQueues']=_0x220115['voiceQueues'];this[_0xba8c('0x7')]=_0x220115[_0xba8c('0x7')];this[_0xba8c('0x8')]=_0x220115[_0xba8c('0x8')];this[_0xba8c('0x9')]={};ami['on'](_0xba8c('0xa'),this[_0xba8c('0xb')][_0xba8c('0xc')](this));ami['on'](_0xba8c('0xd'),this[_0xba8c('0xe')][_0xba8c('0xc')](this));ami['on'](_0xba8c('0xf'),this[_0xba8c('0x10')]['bind'](this));ami['on'](_0xba8c('0x11'),this[_0xba8c('0x12')]['bind'](this));ami['on'](_0xba8c('0x13'),this[_0xba8c('0x14')][_0xba8c('0xc')](this));ami['on'](_0xba8c('0x15'),this[_0xba8c('0x16')][_0xba8c('0xc')](this));ami['on']('custom:agentConnectPreview',this[_0xba8c('0x17')][_0xba8c('0xc')](this));}function getDiff(_0x524202){var _0x18c402=moment()[_0xba8c('0x18')](0x0);var _0x1b4e62=moment(_0x524202)[_0xba8c('0x18')](0x0);return _0x18c402['diff'](_0x1b4e62,_0xba8c('0x19'));}Acw[_0xba8c('0x1a')]['startAcw']=function(_0x33563b){try{var _0x4cc379=this;var _0x38ac50=this[_0xba8c('0x9')][_0x33563b]['interface'];var _0x3d123c=this[_0xba8c('0x9')][_0x33563b][_0xba8c('0x1b')];var _0x2ed42d=this[_0xba8c('0x1c')][_0x3d123c];var _0x16b3c8=![];var _0x1b5bc6=_0xba8c('0x1d');if(_0x2ed42d[_0xba8c('0x1e')]){if(_0x2ed42d['mandatoryDispositionPause'][_0xba8c('0x1f')]){_0x16b3c8=!![];_0x1b5bc6=_0x2ed42d[_0xba8c('0x20')][_0xba8c('0x1f')];}}ami[_0xba8c('0x21')]({'action':_0xba8c('0x22'),'interface':_0x38ac50,'paused':!![],'reason':_0x1b5bc6})['then'](function(_0xf7432e){if(_0x4cc379[_0xba8c('0x7')][_0x38ac50]){return RpcUser['getAgent'](_0x4cc379[_0xba8c('0x7')][_0x38ac50]['id'])[_0xba8c('0x23')](function(_0x161928){if(_0x161928&&!_0x161928[_0xba8c('0x24')]){logger[_0xba8c('0x25')](_0xba8c('0x26'),_0x33563b,_0x38ac50,_0x3d123c);var _0x410bf8=_0x4cc379['channels'][_0x33563b][_0xba8c('0x27')]&&_0x4cc379['channels'][_0x33563b][_0xba8c('0x28')]?_0x4cc379['channels'][_0x33563b][_0xba8c('0x28')]:_0x33563b;return RpcUser['savePause'](_0x4cc379[_0xba8c('0x7')][_0x38ac50],_0x1b5bc6,_0x410bf8)[_0xba8c('0x23')](function(_0x4efe9e){if(!_0x16b3c8){_0x4cc379[_0xba8c('0x8')][_0x38ac50]={};logger[_0xba8c('0x25')](_0xba8c('0x29'),_0x33563b,_0x4cc379[_0xba8c('0x1c')][_0x3d123c][_0xba8c('0x2a')],_0x38ac50,_0x3d123c);_0x4cc379['timers'][_0x38ac50][_0xba8c('0x2b')]=setTimeout(_0x4cc379[_0xba8c('0x2c')][_0xba8c('0xc')](_0x4cc379,_0x38ac50),_0x4cc379['voiceQueues'][_0x3d123c][_0xba8c('0x2a')]*0x3e8);_0x4cc379[_0xba8c('0x8')][_0x38ac50][_0xba8c('0x2d')]=moment()[_0xba8c('0x2e')](_0xba8c('0x2f'));_0x4cc379[_0xba8c('0x8')][_0x38ac50][_0xba8c('0x30')]=_0x33563b;_0x4cc379['timers'][_0x38ac50][_0xba8c('0x1b')]=_0x3d123c;_0x4cc379[_0xba8c('0x8')][_0x38ac50]['updateAcw']=function(){var _0x2d5a91=getDiff(_0x4cc379['timers'][_0x38ac50][_0xba8c('0x2d')]);clearTimeout(_0x4cc379[_0xba8c('0x8')][_0x38ac50][_0xba8c('0x2b')]);_0x4cc379[_0xba8c('0x8')][_0x38ac50][_0xba8c('0x2b')]=![];RpcVoiceAgentReport[_0xba8c('0x31')]({'acwtime':_0x2d5a91},_0x4cc379[_0xba8c('0x8')][_0x38ac50][_0xba8c('0x30')],_0x38ac50)[_0xba8c('0x23')](function(_0x22cd54){logger['info'](_0xba8c('0x32'),_0x33563b,_0x2d5a91,_0x22cd54);})[_0xba8c('0x33')](function(_0x205aa2){logger[_0xba8c('0x34')]('[%s][UPDATE][ERRORS:%s]',_0x33563b,_0x205aa2);});delete _0x4cc379['timers'][_0x38ac50];};}});}else{logger[_0xba8c('0x25')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x33563b,_0x38ac50,_0x3d123c);}});}})['catch'](function(_0x3f0f22){logger['error'](_0xba8c('0x29'),_0x33563b,_0x4cc379[_0xba8c('0x1c')][_0x3d123c][_0xba8c('0x2a')],_0x38ac50,_0x3d123c);})[_0xba8c('0x35')](function(){delete _0x4cc379[_0xba8c('0x9')][_0x33563b];});}catch(_0x5cfd22){logger['error']('[ACW][START]\x20%s',_0x5cfd22[_0xba8c('0x36')]);}};Acw[_0xba8c('0x1a')][_0xba8c('0x2c')]=function(_0x3a6055){try{var _0x4732e=this;if(_0x4732e[_0xba8c('0x8')][_0x3a6055]){_0x4732e[_0xba8c('0x8')][_0x3a6055][_0xba8c('0x2b')]=![];var _0x25f606=_0x4732e[_0xba8c('0x8')][_0x3a6055][_0xba8c('0x30')];var _0x2e2fa0=_0x4732e[_0xba8c('0x8')][_0x3a6055][_0xba8c('0x1b')];var _0xc835d9=_0x4732e[_0xba8c('0x1c')][_0x2e2fa0]['acwTimeout'];logger[_0xba8c('0x25')](_0xba8c('0x37'),_0x25f606,_0x3a6055);RpcUser[_0xba8c('0x38')](this[_0xba8c('0x7')][_0x3a6055]);RpcVoiceAgentReport['update']({'acwtime':_0xc835d9,'agentacw':!![]},_0x25f606,_0x3a6055)['then'](function(_0x4c5fda){logger[_0xba8c('0x25')]('[%s][UPDATE][ACWTIME:%s]',_0x25f606,_0xc835d9,_0x4c5fda);})['catch'](function(_0x4bb689){logger[_0xba8c('0x34')](_0xba8c('0x39'),_0x25f606,_0x4bb689);});}else{logger[_0xba8c('0x34')](_0xba8c('0x3a'),_0x3a6055);if(_0x4732e[_0xba8c('0x8')]){logger['info']('[ACW][TIMERS]',JSON[_0xba8c('0x3b')](_0x4732e['timers']));}}}catch(_0x1240d0){logger[_0xba8c('0x34')](_0xba8c('0x3c'),_0x1240d0['message']);}};Acw[_0xba8c('0x1a')][_0xba8c('0xb')]=function(_0x122acb){try{if(this[_0xba8c('0x1c')][_0x122acb[_0xba8c('0x1b')]]&&(this['voiceQueues'][_0x122acb['queue']]['acw']||this[_0xba8c('0x1c')][_0x122acb[_0xba8c('0x1b')]][_0xba8c('0x1e')])){if(this[_0xba8c('0x7')][_0x122acb[_0xba8c('0x3d')]]){this[_0xba8c('0x9')][_0x122acb[_0xba8c('0x30')]]={'queue':_0x122acb[_0xba8c('0x1b')],'interface':_0x122acb[_0xba8c('0x3d')],'destlinkedid':_0x122acb[_0xba8c('0x28')]};}}}catch(_0x4c0118){logger[_0xba8c('0x34')]('[ACW][syncAgentConnect]\x20%s',_0x4c0118['message']);}};Acw[_0xba8c('0x1a')][_0xba8c('0x17')]=function(_0x3780d8){try{if(this[_0xba8c('0x1c')][_0x3780d8[_0xba8c('0x1b')]]&&(this[_0xba8c('0x1c')][_0x3780d8[_0xba8c('0x1b')]][_0xba8c('0x3e')]||this[_0xba8c('0x1c')][_0x3780d8['queue']][_0xba8c('0x1e')])){if(this[_0xba8c('0x7')][_0x3780d8[_0xba8c('0x3d')]]){this['channels'][_0x3780d8['uniqueid']]={'queue':_0x3780d8[_0xba8c('0x1b')],'interface':_0x3780d8[_0xba8c('0x3d')]};}}}catch(_0x27a8bf){logger[_0xba8c('0x34')](_0xba8c('0x3f'),_0x27a8bf[_0xba8c('0x36')]);}};Acw[_0xba8c('0x1a')][_0xba8c('0xe')]=function(_0x5f43be){try{if(this[_0xba8c('0x9')][_0x5f43be[_0xba8c('0x30')]]&&_['isUndefined'](this['channels'][_0x5f43be[_0xba8c('0x30')]][_0xba8c('0x27')])){logger[_0xba8c('0x25')](_0xba8c('0x40'),_0x5f43be['uniqueid']);this[_0xba8c('0x41')](_0x5f43be[_0xba8c('0x30')]);}else if(this[_0xba8c('0x9')][_0x5f43be['linkedid']]&&_[_0xba8c('0x42')](this['channels'][_0x5f43be[_0xba8c('0x43')]]['attended'])){logger[_0xba8c('0x25')](_0xba8c('0x44'),_0x5f43be[_0xba8c('0x43')]);this['startAcw'](_0x5f43be[_0xba8c('0x43')]);}}catch(_0x1f7e4a){logger[_0xba8c('0x34')](_0xba8c('0x45'),_0x1f7e4a['message']);}};Acw[_0xba8c('0x1a')]['syncHangup']=function(_0x3702ee){try{if(this[_0xba8c('0x9')][_0x3702ee[_0xba8c('0x30')]]&&this[_0xba8c('0x9')][_0x3702ee['uniqueid']][_0xba8c('0x27')]){logger['info'](_0xba8c('0x46'),_0x3702ee[_0xba8c('0x30')]);this[_0xba8c('0x41')](_0x3702ee[_0xba8c('0x30')]);}else if(this[_0xba8c('0x9')][_0x3702ee[_0xba8c('0x43')]]&&this[_0xba8c('0x9')][_0x3702ee[_0xba8c('0x43')]][_0xba8c('0x27')]){logger[_0xba8c('0x25')](_0xba8c('0x47'),_0x3702ee[_0xba8c('0x43')]);this[_0xba8c('0x41')](_0x3702ee['linkedid']);}}catch(_0x36a169){logger[_0xba8c('0x34')]('[ACW][syncHangup]\x20%s',_0x36a169[_0xba8c('0x36')]);}};Acw[_0xba8c('0x1a')][_0xba8c('0x14')]=function(_0x1d354d){try{if(!_[_0xba8c('0x48')](this[_0xba8c('0x9')][_0x1d354d[_0xba8c('0x49')]])){this[_0xba8c('0x41')](_0x1d354d[_0xba8c('0x49')]);if(this['channels'][_0x1d354d['secondtransfereruniqueid']]){this[_0xba8c('0x9')][_0x1d354d[_0xba8c('0x4a')]][_0xba8c('0x27')]=!![];this[_0xba8c('0x9')][_0x1d354d[_0xba8c('0x4b')]]=this[_0xba8c('0x9')][_0x1d354d[_0xba8c('0x4a')]];delete this['channels'][_0x1d354d[_0xba8c('0x4a')]];}}else if(!_[_0xba8c('0x48')](this[_0xba8c('0x9')][_0x1d354d[_0xba8c('0x4b')]])){this['startAcw'](_0x1d354d['transfertargetuniqueid']);if(this['channels'][_0x1d354d['origtransfereruniqueid']]){this[_0xba8c('0x9')][_0x1d354d['origtransfereruniqueid']][_0xba8c('0x27')]=!![];this[_0xba8c('0x9')][_0x1d354d[_0xba8c('0x49')]]=this[_0xba8c('0x9')][_0x1d354d[_0xba8c('0x4c')]];delete this[_0xba8c('0x9')][_0x1d354d[_0xba8c('0x4c')]];}}}catch(_0x478fa9){logger['error'](_0xba8c('0x4d'),_0x478fa9['message']);}};Acw['prototype']['syncBlindTransfer']=function(_0x476da0){try{if(this[_0xba8c('0x9')][_0x476da0['transfereruniqueid']]){logger[_0xba8c('0x25')](_0xba8c('0x4e'),JSON[_0xba8c('0x3b')](_0x476da0[_0xba8c('0x4f')]));this[_0xba8c('0x41')](_0x476da0['transfereruniqueid']);}else if(this[_0xba8c('0x9')][_0x476da0['transfererlinkedid']]){logger[_0xba8c('0x25')](_0xba8c('0x50'),JSON[_0xba8c('0x3b')](_0x476da0[_0xba8c('0x51')]));this['startAcw'](_0x476da0['transfererlinkedid']);}}catch(_0x502bd8){logger[_0xba8c('0x34')]('[ACW][syncBlindTransfer]\x20%s',_0x502bd8[_0xba8c('0x36')]);}};Acw[_0xba8c('0x1a')][_0xba8c('0x12')]=function(_0x45632a){try{if(this[_0xba8c('0x1c')][_0x45632a[_0xba8c('0x1b')]]&&this[_0xba8c('0x1c')][_0x45632a[_0xba8c('0x1b')]][_0xba8c('0x52')]==='all'){if(this['agents'][_0x45632a[_0xba8c('0x3d')]]){logger[_0xba8c('0x25')](_0xba8c('0x53'),_0x45632a[_0xba8c('0x30')],_0x45632a['interface'],_0x45632a[_0xba8c('0x1b')]);return RpcUser['savePause'](this[_0xba8c('0x7')][_0x45632a[_0xba8c('0x3d')]],'Auto-Pause',_0x45632a['uniqueid']);}}}catch(_0x16ccb3){logger[_0xba8c('0x34')](_0xba8c('0x54'),_0x16ccb3[_0xba8c('0x36')]);}};module[_0xba8c('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index b0cb540..9b6f361 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 _0x3703=['Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','error','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionQueueSummary','asterisk-manager','bluebird','moment','util','ami','asterisk','port','username','keepConnected','Action','promisify','action','format'];(function(_0x5b1e55,_0x30fb19){var _0x19696b=function(_0x25ac4f){while(--_0x25ac4f){_0x5b1e55['push'](_0x5b1e55['shift']());}};_0x19696b(++_0x30fb19);}(_0x3703,0x1e3));var _0x3370=function(_0x1ad9b4,_0x5df9ed){_0x1ad9b4=_0x1ad9b4-0x0;var _0xbbee74=_0x3703[_0x1ad9b4];return _0xbbee74;};'use strict';var Manager=require(_0x3370('0x0'));var BPromise=require(_0x3370('0x1'));var moment=require(_0x3370('0x2'));var util=require(_0x3370('0x3'));var _=require('lodash');var logger=require('../../config/logger')(_0x3370('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x3370('0x5')][_0x3370('0x6')],config[_0x3370('0x5')]['ip'],config['asterisk'][_0x3370('0x7')],config[_0x3370('0x5')]['password'],!![]);ami[_0x3370('0x8')]();ami[_0x3370('0x9')]=BPromise[_0x3370('0xa')](ami[_0x3370('0xb')]);function error(_0x20c420){logger['error'](util[_0x3370('0xc')](_0x3370('0xd'),config[_0x3370('0x5')][_0x3370('0x7')],config[_0x3370('0x5')]['ip'],config[_0x3370('0x5')][_0x3370('0x6')],util[_0x3370('0xe')](_0x20c420,![],null)));}function close(){logger[_0x3370('0xf')](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x3370('0x7')],config[_0x3370('0x5')]['ip'],config[_0x3370('0x5')]['port']));}ami[_0x3370('0x10')]=function(){return function(){return ami[_0x3370('0x9')]({'action':'sipshowregistry'});};};ami[_0x3370('0x11')]=function(){return function(){return ami[_0x3370('0x9')]({'action':_0x3370('0x12')});};};ami['actionSipPeerStatus']=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x3370('0x9')]({'action':'queuesummary'});};};ami[_0x3370('0x13')]=function(){return function(){return ami[_0x3370('0x9')]({'action':_0x3370('0x14')});};};function connect(_0x1fbdd2){logger[_0x3370('0x15')](util[_0x3370('0xc')](_0x3370('0x16'),config['asterisk'][_0x3370('0x7')],config[_0x3370('0x5')]['ip'],config[_0x3370('0x5')][_0x3370('0x6')]));ami[_0x3370('0x17')]('error',error);ami[_0x3370('0x17')]('close',close);}ami['on'](_0x3370('0x18'),connect);ami['on'](_0x3370('0x19'),function(_0x26aa4d){logger[_0x3370('0x15')](util['format'](_0x3370('0x1a'),config[_0x3370('0x5')][_0x3370('0x7')],config[_0x3370('0x5')]['ip'],config[_0x3370('0x5')][_0x3370('0x6')],util[_0x3370('0xe')](_0x26aa4d,![],null)));});ami['on'](_0x3370('0x1b'),function(_0x4d2e92){logger[_0x3370('0x15')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x3370('0x5')]['username'],config[_0x3370('0x5')]['ip'],config[_0x3370('0x5')][_0x3370('0x6')]));return BPromise[_0x3370('0x1c')]()[_0x3370('0x1d')](ami[_0x3370('0x10')]())['then'](ami['actionDeviceStateList']())[_0x3370('0x1d')](ami['actionSipPeerStatus']())[_0x3370('0x1d')](ami[_0x3370('0x1e')]())[_0x3370('0x1d')](ami['actionCoreShowChannels']())['catch'](function(_0x4566d8){console['log'](_0x4566d8);});});ami[_0x3370('0x17')](_0x3370('0xf'),error);ami['once']('close',close);module['exports']=ami; \ No newline at end of file +var _0xd31a=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionDeviceStateList','catch','log','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','../../config/environment','port','asterisk','username','password','keepConnected','Action','promisify','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','format','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x402c8f,_0x30cc1d){var _0x11e809=function(_0x4ccfa3){while(--_0x4ccfa3){_0x402c8f['push'](_0x402c8f['shift']());}};_0x11e809(++_0x30cc1d);}(_0xd31a,0x81));var _0xad31=function(_0x5d6e9f,_0x512229){_0x5d6e9f=_0x5d6e9f-0x0;var _0x440047=_0xd31a[_0x5d6e9f];return _0x440047;};'use strict';var Manager=require(_0xad31('0x0'));var BPromise=require(_0xad31('0x1'));var moment=require(_0xad31('0x2'));var util=require(_0xad31('0x3'));var _=require(_0xad31('0x4'));var logger=require(_0xad31('0x5'))('ami');var config=require(_0xad31('0x6'));var ami=new Manager(config['asterisk'][_0xad31('0x7')],config[_0xad31('0x8')]['ip'],config['asterisk'][_0xad31('0x9')],config[_0xad31('0x8')][_0xad31('0xa')],!![]);ami[_0xad31('0xb')]();ami[_0xad31('0xc')]=BPromise[_0xad31('0xd')](ami['action']);function error(_0x7ec4a8){logger[_0xad31('0xe')](util['format'](_0xad31('0xf'),config['asterisk']['username'],config[_0xad31('0x8')]['ip'],config['asterisk'][_0xad31('0x7')],util['inspect'](_0x7ec4a8,![],null)));}function close(){logger['error'](util[_0xad31('0x10')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xad31('0x8')][_0xad31('0x9')],config[_0xad31('0x8')]['ip'],config[_0xad31('0x8')]['port']));}ami[_0xad31('0x11')]=function(){return function(){return ami['Action']({'action':_0xad31('0x12')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xad31('0xc')]({'action':_0xad31('0x13')});};};ami[_0xad31('0x14')]=function(){return function(){return ami[_0xad31('0xc')]({'action':_0xad31('0x15')});};};ami[_0xad31('0x16')]=function(){return function(){return ami[_0xad31('0xc')]({'action':_0xad31('0x17')});};};ami[_0xad31('0x18')]=function(){return function(){return ami[_0xad31('0xc')]({'action':'coreshowchannels'});};};function connect(_0x2fd9d6){logger[_0xad31('0x19')](util[_0xad31('0x10')](_0xad31('0x1a'),config[_0xad31('0x8')][_0xad31('0x9')],config['asterisk']['ip'],config[_0xad31('0x8')]['port']));ami[_0xad31('0x1b')](_0xad31('0xe'),error);ami[_0xad31('0x1b')](_0xad31('0x1c'),close);}ami['on'](_0xad31('0x1d'),connect);ami['on'](_0xad31('0x1e'),function(_0x5808d1){logger['info'](util[_0xad31('0x10')](_0xad31('0x1f'),config[_0xad31('0x8')][_0xad31('0x9')],config['asterisk']['ip'],config['asterisk']['port'],util[_0xad31('0x20')](_0x5808d1,![],null)));});ami['on'](_0xad31('0x21'),function(_0x52a94b){logger[_0xad31('0x19')](util[_0xad31('0x10')](_0xad31('0x22'),config['asterisk'][_0xad31('0x9')],config[_0xad31('0x8')]['ip'],config[_0xad31('0x8')]['port']));return BPromise['resolve']()[_0xad31('0x23')](ami[_0xad31('0x11')]())[_0xad31('0x23')](ami[_0xad31('0x24')]())[_0xad31('0x23')](ami[_0xad31('0x14')]())[_0xad31('0x23')](ami[_0xad31('0x16')]())[_0xad31('0x23')](ami[_0xad31('0x18')]())[_0xad31('0x25')](function(_0x2dbda7){console[_0xad31('0x26')](_0x2dbda7);});});ami[_0xad31('0x1b')](_0xad31('0xe'),error);ami[_0xad31('0x1b')](_0xad31('0x1c'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index d8087ef..d68effb 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 _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x9db5d3,_0x4eea5e){var _0x477a81=function(_0x28e774){while(--_0x28e774){_0x9db5d3['push'](_0x9db5d3['shift']());}};_0x477a81(++_0x4eea5e);}(_0xb43b,0x1b2));var _0xbb43=function(_0x28475f,_0x97d4ca){_0x28475f=_0x28475f-0x0;var _0x31ba2c=_0xb43b[_0x28475f];return _0x31ba2c;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x1a89ca,_0x27394b){var _0x29cbb2=function(_0x31e1f4){while(--_0x31e1f4){_0x1a89ca['push'](_0x1a89ca['shift']());}};_0x29cbb2(++_0x27394b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xb7e7[_0x38ced4];return _0x547c07;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index d0b936d..bc9f851 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 _0x9fa6=['moment','string','isNil','voiceQueue','uniqueid','name','Contact','phone','firstName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','dialCutDigit','substring','getQueue','exports','lodash'];(function(_0x2f7110,_0x5307d9){var _0x13a4eb=function(_0xa1559c){while(--_0xa1559c){_0x2f7110['push'](_0x2f7110['shift']());}};_0x13a4eb(++_0x5307d9);}(_0x9fa6,0x194));var _0x69fa=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x9fa6[_0x500419];return _0x241c1a;};'use strict';var util=require('util');var _=require(_0x69fa('0x0'));var moment=require(_0x69fa('0x1'));function checkNameSurname(_0x59fbfa,_0x2611ba,_0x27efc5){var _0x2b7cd0='';if(!_['isNil'](_0x2611ba)&&_0x69fa('0x2')===typeof _0x2611ba){_0x2b7cd0+=_0x2611ba;}if(!_[_0x69fa('0x3')](_0x27efc5)&&_0x69fa('0x2')===typeof _0x27efc5){_0x2b7cd0+='\x20'+_0x27efc5;}if(_0x2b7cd0!==''){return _0x2b7cd0;}return _0x59fbfa;}function Action(_0x41197f,_0x51e35e,_0x5e8c59){this[_0x69fa('0x4')]=_0x41197f;this[_0x69fa('0x5')]=_0x5e8c59||undefined;this[_0x69fa('0x6')]=checkNameSurname(_0x51e35e[_0x69fa('0x7')][_0x69fa('0x8')],_0x51e35e['Contact'][_0x69fa('0x9')],_0x51e35e['Contact']['lastName']);this[_0x69fa('0xa')]=_0x51e35e['Contact'][_0x69fa('0x8')];this[_0x69fa('0xb')]=_0x41197f[_0x69fa('0x6')];this[_0x69fa('0xc')]=_0x51e35e['active']||![];this[_0x69fa('0xd')]=_0x41197f['type'];this[_0x69fa('0xe')]=_0x41197f['dialQueueTimeout']||0x3;this[_0x69fa('0xf')]=_0x51e35e[_0x69fa('0xf')];this[_0x69fa('0x10')]=_0x51e35e[_0x69fa('0x10')];this[_0x69fa('0x11')]=_0x51e35e[_0x69fa('0x11')];this[_0x69fa('0x12')]=_0x51e35e[_0x69fa('0x12')];this[_0x69fa('0x13')]=_0x51e35e[_0x69fa('0x13')];this['countdropretry']=_0x51e35e[_0x69fa('0x14')];this['countabandonedretry']=_0x51e35e[_0x69fa('0x15')];this[_0x69fa('0x16')]=_0x51e35e[_0x69fa('0x16')];this[_0x69fa('0x17')]=_0x51e35e['countagentrejectretry'];this['ContactId']=_0x51e35e[_0x69fa('0x18')];this['ListId']=_0x51e35e[_0x69fa('0x19')];this[_0x69fa('0x1a')]=_0x51e35e[_0x69fa('0x1a')];this[_0x69fa('0x1b')]=_0x51e35e[_0x69fa('0x1b')];this['CampaignId']=_0x51e35e[_0x69fa('0x1c')];this['idHopper']=_0x51e35e['id'];this[_0x69fa('0x1d')]=_0x51e35e['Contact'][_0x69fa('0x9')]||'';this[_0x69fa('0x1e')]=moment()[_0x69fa('0x1f')](_0x69fa('0x20'));this[_0x69fa('0x21')]=_0x51e35e[_0x69fa('0x21')];this[_0x69fa('0x22')]=_0x51e35e['callbackuniqueid'];this[_0x69fa('0x23')]=_0x51e35e[_0x69fa('0x23')];this[_0x69fa('0x24')]=_0x51e35e[_0x69fa('0x24')];this[_0x69fa('0x25')]='';this[_0x69fa('0x26')]='';}Action[_0x69fa('0x27')][_0x69fa('0x28')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x69fa('0x6')],this[_0x69fa('0x4')][_0x69fa('0x29')]>0x0?this[_0x69fa('0xa')][_0x69fa('0x2a')](this[_0x69fa('0x4')][_0x69fa('0x29')]):this[_0x69fa('0xa')]);};Action[_0x69fa('0x27')][_0x69fa('0x2b')]=function(){return this[_0x69fa('0xb')];};module[_0x69fa('0x2c')]=Action; \ No newline at end of file +var _0xa6b9=['uniqueid','Contact','phone','firstName','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','prototype','number','substring','dialCutDigit','getQueue','queue','exports','util','lodash','string','isNil','voiceQueue'];(function(_0x2c1d85,_0x30a616){var _0x38cf1b=function(_0x322a4d){while(--_0x322a4d){_0x2c1d85['push'](_0x2c1d85['shift']());}};_0x38cf1b(++_0x30a616);}(_0xa6b9,0x19f));var _0x9a6b=function(_0x483884,_0x324751){_0x483884=_0x483884-0x0;var _0x34d520=_0xa6b9[_0x483884];return _0x34d520;};'use strict';var util=require(_0x9a6b('0x0'));var _=require(_0x9a6b('0x1'));var moment=require('moment');function checkNameSurname(_0x1a568c,_0xc8abe9,_0x3bfe44){var _0x206794='';if(!_['isNil'](_0xc8abe9)&&_0x9a6b('0x2')===typeof _0xc8abe9){_0x206794+=_0xc8abe9;}if(!_[_0x9a6b('0x3')](_0x3bfe44)&&_0x9a6b('0x2')===typeof _0x3bfe44){_0x206794+='\x20'+_0x3bfe44;}if(_0x206794!==''){return _0x206794;}return _0x1a568c;}function Action(_0xa7126,_0x4e75e0,_0x2b9ccc){this[_0x9a6b('0x4')]=_0xa7126;this[_0x9a6b('0x5')]=_0x2b9ccc||undefined;this['name']=checkNameSurname(_0x4e75e0[_0x9a6b('0x6')][_0x9a6b('0x7')],_0x4e75e0[_0x9a6b('0x6')][_0x9a6b('0x8')],_0x4e75e0[_0x9a6b('0x6')]['lastName']);this['number']=_0x4e75e0['Contact'][_0x9a6b('0x7')];this['queue']=_0xa7126[_0x9a6b('0x9')];this[_0x9a6b('0xa')]=_0x4e75e0[_0x9a6b('0xa')]||![];this[_0x9a6b('0xb')]=_0xa7126['type'];this[_0x9a6b('0xc')]=_0xa7126[_0x9a6b('0xc')]||0x3;this['scheduledat']=_0x4e75e0[_0x9a6b('0xd')];this[_0x9a6b('0xe')]=_0x4e75e0[_0x9a6b('0xe')];this[_0x9a6b('0xf')]=_0x4e75e0[_0x9a6b('0xf')];this['countnoanswerretry']=_0x4e75e0[_0x9a6b('0x10')];this[_0x9a6b('0x11')]=_0x4e75e0[_0x9a6b('0x11')];this[_0x9a6b('0x12')]=_0x4e75e0[_0x9a6b('0x12')];this[_0x9a6b('0x13')]=_0x4e75e0['countabandonedretry'];this[_0x9a6b('0x14')]=_0x4e75e0['countmachineretry'];this[_0x9a6b('0x15')]=_0x4e75e0[_0x9a6b('0x15')];this[_0x9a6b('0x16')]=_0x4e75e0['ContactId'];this[_0x9a6b('0x17')]=_0x4e75e0[_0x9a6b('0x17')];this['UserId']=_0x4e75e0[_0x9a6b('0x18')];this[_0x9a6b('0x19')]=_0x4e75e0['VoiceQueueId'];this[_0x9a6b('0x1a')]=_0x4e75e0[_0x9a6b('0x1a')];this[_0x9a6b('0x1b')]=_0x4e75e0['id'];this[_0x9a6b('0x1c')]=_0x4e75e0['Contact'][_0x9a6b('0x8')]||'';this[_0x9a6b('0x1d')]=moment()[_0x9a6b('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x4e75e0[_0x9a6b('0x1f')];this[_0x9a6b('0x20')]=_0x4e75e0[_0x9a6b('0x20')];this[_0x9a6b('0x21')]=_0x4e75e0[_0x9a6b('0x21')];this[_0x9a6b('0x22')]=_0x4e75e0[_0x9a6b('0x22')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x9a6b('0x23')]['getCaller']=function(){return util[_0x9a6b('0x1e')]('\x22%s\x22\x20<%s>',this[_0x9a6b('0x9')],this[_0x9a6b('0x4')]['dialCutDigit']>0x0?this[_0x9a6b('0x24')][_0x9a6b('0x25')](this[_0x9a6b('0x4')][_0x9a6b('0x26')]):this[_0x9a6b('0x24')]);};Action[_0x9a6b('0x23')][_0x9a6b('0x27')]=function(){return this[_0x9a6b('0x28')];};module[_0x9a6b('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 98e8a85..01f7036 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 _0x448f=['calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','endtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name'];(function(_0x1c5d53,_0x1029a2){var _0x2ef0f8=function(_0x3f6697){while(--_0x3f6697){_0x1c5d53['push'](_0x1c5d53['shift']());}};_0x2ef0f8(++_0x1029a2);}(_0x448f,0xd4));var _0xf448=function(_0x585ee5,_0x1c9dba){_0x585ee5=_0x585ee5-0x0;var _0x470808=_0x448f[_0x585ee5];return _0x470808;};'use strict';var util=require(_0xf448('0x0'));var _=require(_0xf448('0x1'));var moment=require(_0xf448('0x2'));function getSeconds(_0x5f07df,_0x171f65){var _0x338162=moment(_0x5f07df)[_0xf448('0x3')](0x0);var _0x2d147e=moment(_0x171f65)[_0xf448('0x3')](0x0);return _0x338162[_0xf448('0x4')](_0x2d147e,_0xf448('0x5'));}function AgentComplete(_0x5996bb,_0x365993){this[_0xf448('0x6')]=0x4;this[_0xf448('0x7')]='Answer';this['scheduledat']=_0x5996bb[_0xf448('0x8')];this[_0xf448('0x9')]=_0x5996bb['type'];this[_0xf448('0xa')]=_0x5996bb[_0xf448('0x9')]===_0xf448('0xb')?'queue':_0x5996bb[_0xf448('0x9')];this[_0xf448('0xc')]=_0x5996bb[_0xf448('0xc')];this[_0xf448('0xd')]=_0x5996bb[_0xf448('0xd')];this[_0xf448('0xe')]=_0x5996bb[_0xf448('0xe')];this['countglobal']=_0x5996bb[_0xf448('0xc')]+_0x5996bb['countcongestionretry']+_0x5996bb[_0xf448('0xe')]+_0x5996bb[_0xf448('0xf')]+_0x5996bb[_0xf448('0x10')]+_0x5996bb[_0xf448('0x11')]+_0x5996bb['countmachineretry']+_0x5996bb[_0xf448('0x12')];this['countnosuchnumberretry']=_0x5996bb[_0xf448('0xf')];this[_0xf448('0x10')]=_0x5996bb['countdropretry'];this['countabandonedretry']=_0x5996bb[_0xf448('0x11')];this[_0xf448('0x13')]=_0x5996bb[_0xf448('0x13')];this[_0xf448('0x12')]=_0x5996bb['countagentrejectretry'];this[_0xf448('0x14')]=_0x365993['uniqueid'];this[_0xf448('0x15')]=_0x5996bb[_0xf448('0x16')];this[_0xf448('0x17')]=_0x5996bb[_0xf448('0x18')];this[_0xf448('0x19')]=_0x5996bb[_0xf448('0x19')];this[_0xf448('0x1a')]=_0x5996bb[_0xf448('0x1a')];this['answertime']=_0x5996bb[_0xf448('0x1b')];this['endtime']=moment()[_0xf448('0x1c')](_0xf448('0x1d'));this[_0xf448('0x1e')]=getSeconds(_0x5996bb['responsetime'],_0x5996bb['starttime']);this['holdtime']=getSeconds(_0x5996bb[_0xf448('0x1b')],_0x5996bb['responsetime']);this[_0xf448('0x1f')]=getSeconds(this[_0xf448('0x20')],_0x5996bb['answertime']);this['queue']=_0x365993[_0xf448('0x21')];this[_0xf448('0x22')]=_0x365993[_0xf448('0x22')];this[_0xf448('0x23')]=_0x365993[_0xf448('0x23')];this['callback']=_0x5996bb[_0xf448('0x24')];this[_0xf448('0x25')]=_0x5996bb['callbackuniqueid'];this[_0xf448('0x26')]=_0x5996bb[_0xf448('0x26')];this[_0xf448('0x27')]=_0x5996bb[_0xf448('0x27')];this[_0xf448('0x28')]=_0x5996bb[_0xf448('0x28')];this[_0xf448('0x29')]=_0x5996bb[_0xf448('0x29')];this['UserId']=_0x5996bb['UserId'];this[_0xf448('0x2a')]=_0x5996bb[_0xf448('0x2a')];this[_0xf448('0x2b')]=_0x5996bb['CampaignId'];this[_0xf448('0x2c')]=_0x5996bb['originatecalleridnum']||'';this[_0xf448('0x2d')]=_0x5996bb[_0xf448('0x2d')]||'';}module[_0xf448('0x2e')]=AgentComplete; \ No newline at end of file +var _0x160f=['uniqueid','name','number','starttime','responsetime','answertime','endtime','format','ringtime','talktime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry'];(function(_0x1123df,_0x43de3d){var _0x12d029=function(_0x51a1fb){while(--_0x51a1fb){_0x1123df['push'](_0x1123df['shift']());}};_0x12d029(++_0x43de3d);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xf160('0x0'));var _=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));function getSeconds(_0x2966aa,_0x5bf9e1){var _0x4513f1=moment(_0x2966aa)[_0xf160('0x3')](0x0);var _0x183b15=moment(_0x5bf9e1)[_0xf160('0x3')](0x0);return _0x4513f1[_0xf160('0x4')](_0x183b15,_0xf160('0x5'));}function AgentComplete(_0x4a6f3d,_0x311d63){this[_0xf160('0x6')]=0x4;this['statedesc']='Answer';this[_0xf160('0x7')]=_0x4a6f3d['scheduledat'];this['type']=_0x4a6f3d['type'];this[_0xf160('0x8')]=_0x4a6f3d[_0xf160('0x9')]===_0xf160('0xa')?_0xf160('0xb'):_0x4a6f3d['type'];this['countbusyretry']=_0x4a6f3d[_0xf160('0xc')];this[_0xf160('0xd')]=_0x4a6f3d[_0xf160('0xd')];this['countnoanswerretry']=_0x4a6f3d[_0xf160('0xe')];this[_0xf160('0xf')]=_0x4a6f3d[_0xf160('0xc')]+_0x4a6f3d[_0xf160('0xd')]+_0x4a6f3d[_0xf160('0xe')]+_0x4a6f3d['countnosuchnumberretry']+_0x4a6f3d[_0xf160('0x10')]+_0x4a6f3d['countabandonedretry']+_0x4a6f3d[_0xf160('0x11')]+_0x4a6f3d[_0xf160('0x12')];this[_0xf160('0x13')]=_0x4a6f3d[_0xf160('0x13')];this[_0xf160('0x10')]=_0x4a6f3d[_0xf160('0x10')];this[_0xf160('0x14')]=_0x4a6f3d[_0xf160('0x14')];this[_0xf160('0x11')]=_0x4a6f3d['countmachineretry'];this[_0xf160('0x12')]=_0x4a6f3d[_0xf160('0x12')];this[_0xf160('0x15')]=_0x311d63[_0xf160('0x15')];this['calleridname']=_0x4a6f3d[_0xf160('0x16')];this['calleridnum']=_0x4a6f3d[_0xf160('0x17')];this[_0xf160('0x18')]=_0x4a6f3d[_0xf160('0x18')];this[_0xf160('0x19')]=_0x4a6f3d[_0xf160('0x19')];this[_0xf160('0x1a')]=_0x4a6f3d[_0xf160('0x1a')];this[_0xf160('0x1b')]=moment()[_0xf160('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf160('0x1d')]=getSeconds(_0x4a6f3d[_0xf160('0x19')],_0x4a6f3d[_0xf160('0x18')]);this['holdtime']=getSeconds(_0x4a6f3d[_0xf160('0x1a')],_0x4a6f3d[_0xf160('0x19')]);this[_0xf160('0x1e')]=getSeconds(this[_0xf160('0x1b')],_0x4a6f3d[_0xf160('0x1a')]);this[_0xf160('0xb')]=_0x311d63[_0xf160('0xb')];this['membername']=_0x311d63[_0xf160('0x1f')];this[_0xf160('0x20')]=_0x311d63[_0xf160('0x20')];this[_0xf160('0x21')]=_0x4a6f3d['callback'];this[_0xf160('0x22')]=_0x4a6f3d[_0xf160('0x22')];this['callbackat']=_0x4a6f3d['callbackat'];this[_0xf160('0x23')]=_0x4a6f3d[_0xf160('0x23')];this[_0xf160('0x24')]=_0x4a6f3d['ContactId'];this[_0xf160('0x25')]=_0x4a6f3d[_0xf160('0x25')];this[_0xf160('0x26')]=_0x4a6f3d[_0xf160('0x26')];this[_0xf160('0x27')]=_0x4a6f3d[_0xf160('0x27')];this['CampaignId']=_0x4a6f3d['CampaignId'];this['originatecalleridnum']=_0x4a6f3d[_0xf160('0x28')]||'';this[_0xf160('0x29')]=_0x4a6f3d[_0xf160('0x29')]||'';}module[_0xf160('0x2a')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index de91b8c..00e892e 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 _0xf725=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat'];(function(_0x3b88e3,_0x4e69dc){var _0x1d915f=function(_0x2279bb){while(--_0x2279bb){_0x3b88e3['push'](_0x3b88e3['shift']());}};_0x1d915f(++_0x4e69dc);}(_0xf725,0x7e));var _0x5f72=function(_0x1ccb44,_0x1ca460){_0x1ccb44=_0x1ccb44-0x0;var _0x3430bb=_0xf725[_0x1ccb44];return _0x3430bb;};'use strict';var util=require(_0x5f72('0x0'));var _=require(_0x5f72('0x1'));var moment=require(_0x5f72('0x2'));function getSeconds(_0x3ccab6,_0x1ab380){var _0x2fb465=moment(_0x3ccab6)[_0x5f72('0x3')](0x0);var _0x172588=moment(_0x1ab380)[_0x5f72('0x3')](0x0);return _0x2fb465[_0x5f72('0x4')](_0x172588,'seconds');}function Final(_0x453992){this[_0x5f72('0x5')]=_0x453992[_0x5f72('0x5')];this[_0x5f72('0x6')]=_0x453992[_0x5f72('0x6')];this[_0x5f72('0x7')]=_0x453992[_0x5f72('0x7')];this['campaigntype']=_0x453992['type']===_0x5f72('0x8')?_0x5f72('0x9'):_0x453992['type'];this[_0x5f72('0xa')]=_0x453992[_0x5f72('0xa')];this['countcongestionretry']=_0x453992[_0x5f72('0xb')];this[_0x5f72('0xc')]=_0x453992[_0x5f72('0xc')];this[_0x5f72('0xd')]=_0x453992[_0x5f72('0xa')]+_0x453992[_0x5f72('0xb')]+_0x453992[_0x5f72('0xc')]+_0x453992['countnosuchnumberretry']+_0x453992[_0x5f72('0xe')]+_0x453992[_0x5f72('0xf')]+_0x453992[_0x5f72('0x10')]+_0x453992[_0x5f72('0x11')];this[_0x5f72('0x12')]=_0x453992['countnosuchnumberretry'];this[_0x5f72('0xe')]=_0x453992['countdropretry'];this['countabandonedretry']=_0x453992[_0x5f72('0xf')];this['countmachineretry']=_0x453992[_0x5f72('0x10')];this['countagentrejectretry']=_0x453992[_0x5f72('0x11')];this['queue']=_0x453992[_0x5f72('0x9')];this[_0x5f72('0x13')]=_0x453992['calleridname'];this[_0x5f72('0x14')]=_0x453992[_0x5f72('0x14')];this[_0x5f72('0x15')]=_0x453992['starttime'];this['responsetime']=_0x453992['responsetime'];this[_0x5f72('0x16')]=_0x453992[_0x5f72('0x17')];this[_0x5f72('0x18')]=_0x453992[_0x5f72('0x18')]||0x0;this[_0x5f72('0x19')]=_0x453992[_0x5f72('0x19')]||0x0;this[_0x5f72('0x1a')]=_0x453992['talktime']||0x0;this[_0x5f72('0x1b')]=_0x453992[_0x5f72('0x1b')];this[_0x5f72('0x1c')]=_0x453992[_0x5f72('0x1c')];this[_0x5f72('0x1d')]=_0x453992[_0x5f72('0x1d')];this[_0x5f72('0x1e')]=_0x453992[_0x5f72('0x1e')];this[_0x5f72('0x1f')]=_0x453992[_0x5f72('0x1f')];this[_0x5f72('0x20')]=_0x453992['ListId'];this[_0x5f72('0x21')]=_0x453992[_0x5f72('0x21')];this[_0x5f72('0x22')]=_0x453992[_0x5f72('0x22')];this['CampaignId']=_0x453992[_0x5f72('0x23')];this[_0x5f72('0x24')]=_0x453992['originatecalleridnum']||'';this[_0x5f72('0x25')]=_0x453992[_0x5f72('0x25')]||'';}module[_0x5f72('0x26')]=Final; \ No newline at end of file +var _0x3baf=['countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','campaigntype','outbound','queue','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x35912e,_0x498365){var _0x254f21=function(_0x33050e){while(--_0x33050e){_0x35912e['push'](_0x35912e['shift']());}};_0x254f21(++_0x498365);}(_0x3baf,0xf7));var _0xf3ba=function(_0x3ab164,_0x2fa5e9){_0x3ab164=_0x3ab164-0x0;var _0x39565e=_0x3baf[_0x3ab164];return _0x39565e;};'use strict';var util=require(_0xf3ba('0x0'));var _=require(_0xf3ba('0x1'));var moment=require(_0xf3ba('0x2'));function getSeconds(_0x3979b3,_0x29bbc2){var _0x22f9c0=moment(_0x3979b3)[_0xf3ba('0x3')](0x0);var _0x306bdd=moment(_0x29bbc2)[_0xf3ba('0x3')](0x0);return _0x22f9c0[_0xf3ba('0x4')](_0x306bdd,_0xf3ba('0x5'));}function Final(_0x1c7a62){this[_0xf3ba('0x6')]=_0x1c7a62[_0xf3ba('0x6')];this[_0xf3ba('0x7')]=_0x1c7a62['scheduledat'];this['type']=_0x1c7a62['type'];this[_0xf3ba('0x8')]=_0x1c7a62['type']===_0xf3ba('0x9')?_0xf3ba('0xa'):_0x1c7a62[_0xf3ba('0xb')];this[_0xf3ba('0xc')]=_0x1c7a62[_0xf3ba('0xc')];this[_0xf3ba('0xd')]=_0x1c7a62[_0xf3ba('0xd')];this[_0xf3ba('0xe')]=_0x1c7a62[_0xf3ba('0xe')];this[_0xf3ba('0xf')]=_0x1c7a62[_0xf3ba('0xc')]+_0x1c7a62[_0xf3ba('0xd')]+_0x1c7a62[_0xf3ba('0xe')]+_0x1c7a62[_0xf3ba('0x10')]+_0x1c7a62[_0xf3ba('0x11')]+_0x1c7a62[_0xf3ba('0x12')]+_0x1c7a62[_0xf3ba('0x13')]+_0x1c7a62[_0xf3ba('0x14')];this['countnosuchnumberretry']=_0x1c7a62[_0xf3ba('0x10')];this['countdropretry']=_0x1c7a62[_0xf3ba('0x11')];this[_0xf3ba('0x12')]=_0x1c7a62[_0xf3ba('0x12')];this[_0xf3ba('0x13')]=_0x1c7a62[_0xf3ba('0x13')];this['countagentrejectretry']=_0x1c7a62[_0xf3ba('0x14')];this[_0xf3ba('0xa')]=_0x1c7a62[_0xf3ba('0xa')];this['calleridname']=_0x1c7a62[_0xf3ba('0x15')];this[_0xf3ba('0x16')]=_0x1c7a62[_0xf3ba('0x16')];this[_0xf3ba('0x17')]=_0x1c7a62['starttime'];this[_0xf3ba('0x18')]=_0x1c7a62[_0xf3ba('0x18')];this['endtime']=_0x1c7a62['responsetime'];this[_0xf3ba('0x19')]=_0x1c7a62[_0xf3ba('0x19')]||0x0;this[_0xf3ba('0x1a')]=_0x1c7a62['holdtime']||0x0;this[_0xf3ba('0x1b')]=_0x1c7a62[_0xf3ba('0x1b')]||0x0;this[_0xf3ba('0x1c')]=_0x1c7a62[_0xf3ba('0x1c')];this[_0xf3ba('0x1d')]=_0x1c7a62[_0xf3ba('0x1d')];this[_0xf3ba('0x1e')]=_0x1c7a62['callbackat'];this['recallme']=_0x1c7a62['recallme'];this[_0xf3ba('0x1f')]=_0x1c7a62[_0xf3ba('0x1f')];this[_0xf3ba('0x20')]=_0x1c7a62[_0xf3ba('0x20')];this[_0xf3ba('0x21')]=_0x1c7a62['UserId'];this['VoiceQueueId']=_0x1c7a62[_0xf3ba('0x22')];this[_0xf3ba('0x23')]=_0x1c7a62['CampaignId'];this[_0xf3ba('0x24')]=_0x1c7a62[_0xf3ba('0x24')]||'';this['originatecalleridname']=_0x1c7a62['originatecalleridname']||'';}module[_0xf3ba('0x25')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 802b3c1..33f6575 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 _0xa221=['number','starttime','responsetime','endtime','ringtime','talktime','membername','IVR','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum'];(function(_0x13a5e9,_0x3c8612){var _0x38f010=function(_0x4891c8){while(--_0x4891c8){_0x13a5e9['push'](_0x13a5e9['shift']());}};_0x38f010(++_0x3c8612);}(_0xa221,0x1d5));var _0x1a22=function(_0x2212c9,_0x3c02c4){_0x2212c9=_0x2212c9-0x0;var _0x5bb4a9=_0xa221[_0x2212c9];return _0x5bb4a9;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x1a22('0x0'));function getSeconds(_0x11bf33,_0x4ee5d5){var _0x3d04a7=moment(_0x11bf33)[_0x1a22('0x1')](0x0);var _0x1047c8=moment(_0x4ee5d5)[_0x1a22('0x1')](0x0);return _0x3d04a7[_0x1a22('0x2')](_0x1047c8,_0x1a22('0x3'));}function Hangup(_0x18c847,_0x502ffc){this['state']=0x4;this[_0x1a22('0x4')]=_0x1a22('0x5');this[_0x1a22('0x6')]=_0x18c847[_0x1a22('0x6')];this[_0x1a22('0x7')]=_0x18c847[_0x1a22('0x7')];this['campaigntype']=_0x18c847['type']===_0x1a22('0x8')?_0x1a22('0x9'):_0x18c847[_0x1a22('0x7')];this[_0x1a22('0xa')]=_0x18c847[_0x1a22('0xa')];this[_0x1a22('0xb')]=_0x18c847['countcongestionretry'];this[_0x1a22('0xc')]=_0x18c847[_0x1a22('0xc')];this[_0x1a22('0xd')]=_0x18c847[_0x1a22('0xa')]+_0x18c847[_0x1a22('0xb')]+_0x18c847['countnoanswerretry']+_0x18c847[_0x1a22('0xe')]+_0x18c847[_0x1a22('0xf')]+_0x18c847[_0x1a22('0x10')]+_0x18c847[_0x1a22('0x11')]+_0x18c847[_0x1a22('0x12')];this[_0x1a22('0xe')]=_0x18c847[_0x1a22('0xe')];this['countdropretry']=_0x18c847['countdropretry'];this[_0x1a22('0x10')]=_0x18c847['countabandonedretry'];this[_0x1a22('0x11')]=_0x18c847['countmachineretry'];this[_0x1a22('0x12')]=_0x18c847[_0x1a22('0x12')];this[_0x1a22('0x13')]=_0x502ffc['uniqueid'];this[_0x1a22('0x14')]=_0x18c847[_0x1a22('0x15')];this[_0x1a22('0x16')]=_0x18c847[_0x1a22('0x17')];this[_0x1a22('0x18')]=_0x18c847['starttime'];this[_0x1a22('0x19')]=_0x18c847[_0x1a22('0x19')];this[_0x1a22('0x1a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x1a22('0x1b')]=getSeconds(_0x18c847['responsetime'],_0x18c847['starttime']);this['holdtime']=0x0;this[_0x1a22('0x1c')]=getSeconds(this[_0x1a22('0x1a')],_0x18c847[_0x1a22('0x19')]);this['queue']=_0x18c847[_0x1a22('0x9')];this[_0x1a22('0x1d')]=_0x1a22('0x1e');this[_0x1a22('0x1f')]=_0x502ffc['cause-txt'];this[_0x1a22('0x20')]=_0x18c847['callback'];this['callbackuniqueid']=_0x18c847['callbackuniqueid'];this[_0x1a22('0x21')]=_0x18c847[_0x1a22('0x21')];this[_0x1a22('0x22')]=_0x18c847[_0x1a22('0x22')];this[_0x1a22('0x23')]=_0x18c847[_0x1a22('0x23')];this[_0x1a22('0x24')]=_0x18c847[_0x1a22('0x24')];this[_0x1a22('0x25')]=_0x18c847['UserId'];this[_0x1a22('0x26')]=_0x18c847[_0x1a22('0x26')];this[_0x1a22('0x27')]=_0x18c847['CampaignId'];}module[_0x1a22('0x28')]=Hangup; \ No newline at end of file +var _0xf2fe=['countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','queue','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','seconds','statedesc','Answer','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xf2fe,0xc5));var _0xef2f=function(_0x2a7bc4,_0x304bb7){_0x2a7bc4=_0x2a7bc4-0x0;var _0x6e42ed=_0xf2fe[_0x2a7bc4];return _0x6e42ed;};'use strict';var util=require(_0xef2f('0x0'));var _=require('lodash');var moment=require(_0xef2f('0x1'));function getSeconds(_0x4c25f9,_0x2372be){var _0x3ff0c0=moment(_0x4c25f9)[_0xef2f('0x2')](0x0);var _0x423e6e=moment(_0x2372be)['milliseconds'](0x0);return _0x3ff0c0[_0xef2f('0x3')](_0x423e6e,_0xef2f('0x4'));}function Hangup(_0x3d6fb0,_0x38b1ea){this['state']=0x4;this[_0xef2f('0x5')]=_0xef2f('0x6');this['scheduledat']=_0x3d6fb0['scheduledat'];this[_0xef2f('0x7')]=_0x3d6fb0[_0xef2f('0x7')];this[_0xef2f('0x8')]=_0x3d6fb0[_0xef2f('0x7')]==='outbound'?'queue':_0x3d6fb0['type'];this[_0xef2f('0x9')]=_0x3d6fb0[_0xef2f('0x9')];this['countcongestionretry']=_0x3d6fb0[_0xef2f('0xa')];this['countnoanswerretry']=_0x3d6fb0[_0xef2f('0xb')];this[_0xef2f('0xc')]=_0x3d6fb0[_0xef2f('0x9')]+_0x3d6fb0[_0xef2f('0xa')]+_0x3d6fb0['countnoanswerretry']+_0x3d6fb0[_0xef2f('0xd')]+_0x3d6fb0['countdropretry']+_0x3d6fb0[_0xef2f('0xe')]+_0x3d6fb0['countmachineretry']+_0x3d6fb0[_0xef2f('0xf')];this[_0xef2f('0xd')]=_0x3d6fb0[_0xef2f('0xd')];this['countdropretry']=_0x3d6fb0[_0xef2f('0x10')];this[_0xef2f('0xe')]=_0x3d6fb0[_0xef2f('0xe')];this['countmachineretry']=_0x3d6fb0['countmachineretry'];this[_0xef2f('0xf')]=_0x3d6fb0['countagentrejectretry'];this['uniqueid']=_0x38b1ea[_0xef2f('0x11')];this[_0xef2f('0x12')]=_0x3d6fb0[_0xef2f('0x13')];this[_0xef2f('0x14')]=_0x3d6fb0[_0xef2f('0x15')];this['starttime']=_0x3d6fb0[_0xef2f('0x16')];this[_0xef2f('0x17')]=_0x3d6fb0[_0xef2f('0x17')];this[_0xef2f('0x18')]=moment()[_0xef2f('0x19')](_0xef2f('0x1a'));this[_0xef2f('0x1b')]=getSeconds(_0x3d6fb0[_0xef2f('0x17')],_0x3d6fb0[_0xef2f('0x16')]);this[_0xef2f('0x1c')]=0x0;this['talktime']=getSeconds(this['endtime'],_0x3d6fb0[_0xef2f('0x17')]);this[_0xef2f('0x1d')]=_0x3d6fb0[_0xef2f('0x1d')];this[_0xef2f('0x1e')]='IVR';this[_0xef2f('0x1f')]=_0x38b1ea[_0xef2f('0x20')];this[_0xef2f('0x21')]=_0x3d6fb0[_0xef2f('0x21')];this[_0xef2f('0x22')]=_0x3d6fb0[_0xef2f('0x22')];this['callbackat']=_0x3d6fb0[_0xef2f('0x23')];this[_0xef2f('0x24')]=_0x3d6fb0[_0xef2f('0x24')];this[_0xef2f('0x25')]=_0x3d6fb0['ContactId'];this['ListId']=_0x3d6fb0[_0xef2f('0x26')];this['UserId']=_0x3d6fb0['UserId'];this[_0xef2f('0x27')]=_0x3d6fb0[_0xef2f('0x27')];this[_0xef2f('0x28')]=_0x3d6fb0['CampaignId'];}module[_0xef2f('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index c26c536..f1d65ce 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 _0xddc9=['outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype'];(function(_0x4314d7,_0x355218){var _0x5c599b=function(_0x556354){while(--_0x556354){_0x4314d7['push'](_0x4314d7['shift']());}};_0x5c599b(++_0x355218);}(_0xddc9,0x89));var _0x9ddc=function(_0x58137c,_0x13bb5b){_0x58137c=_0x58137c-0x0;var _0x5b0112=_0xddc9[_0x58137c];return _0x5b0112;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x9ddc('0x0'));function getSeconds(_0x374c45,_0x40b6b4){var _0x2d9e48=moment(_0x374c45)[_0x9ddc('0x1')](0x0);var _0x1f5823=moment(_0x40b6b4)[_0x9ddc('0x1')](0x0);return _0x2d9e48[_0x9ddc('0x2')](_0x1f5823,_0x9ddc('0x3'));}function History(_0x3b31b4){this['uniqueid']=_0x3b31b4['uniqueid'];this[_0x9ddc('0x4')]=_0x3b31b4[_0x9ddc('0x4')]||undefined;this[_0x9ddc('0x5')]=_0x3b31b4[_0x9ddc('0x5')];this[_0x9ddc('0x6')]=_0x3b31b4[_0x9ddc('0x5')]===_0x9ddc('0x7')?'queue':_0x3b31b4['type'];this[_0x9ddc('0x8')]=_0x3b31b4[_0x9ddc('0x8')];this[_0x9ddc('0x9')]=_0x3b31b4['countcongestionretry'];this[_0x9ddc('0xa')]=_0x3b31b4[_0x9ddc('0xa')];this['countglobal']=_0x3b31b4[_0x9ddc('0x8')]+_0x3b31b4['countcongestionretry']+_0x3b31b4[_0x9ddc('0xa')]+_0x3b31b4[_0x9ddc('0xb')]+_0x3b31b4[_0x9ddc('0xc')]+_0x3b31b4['countabandonedretry']+_0x3b31b4['countmachineretry']+_0x3b31b4[_0x9ddc('0xd')];this[_0x9ddc('0xb')]=_0x3b31b4['countnosuchnumberretry'];this[_0x9ddc('0xc')]=_0x3b31b4[_0x9ddc('0xc')];this[_0x9ddc('0xe')]=_0x3b31b4['countabandonedretry'];this[_0x9ddc('0xf')]=_0x3b31b4[_0x9ddc('0xf')];this[_0x9ddc('0xd')]=_0x3b31b4[_0x9ddc('0xd')];this['queue']=_0x3b31b4['queue'];this[_0x9ddc('0x10')]=_0x3b31b4[_0x9ddc('0x11')];this[_0x9ddc('0x12')]=_0x3b31b4[_0x9ddc('0x13')];this[_0x9ddc('0x14')]=_0x3b31b4[_0x9ddc('0x14')];this[_0x9ddc('0x15')]=_0x3b31b4[_0x9ddc('0x15')];this[_0x9ddc('0x16')]=_0x3b31b4[_0x9ddc('0x15')];this[_0x9ddc('0x17')]=getSeconds(_0x3b31b4[_0x9ddc('0x15')],_0x3b31b4[_0x9ddc('0x14')]);this[_0x9ddc('0x18')]=0x0;this[_0x9ddc('0x19')]=0x0;this[_0x9ddc('0x1a')]=_0x3b31b4[_0x9ddc('0x1a')];this['callbackuniqueid']=_0x3b31b4['callbackuniqueid'];this[_0x9ddc('0x1b')]=_0x3b31b4['callbackat'];this[_0x9ddc('0x1c')]=_0x3b31b4['recallme'];this[_0x9ddc('0x1d')]=_0x3b31b4[_0x9ddc('0x1d')];this[_0x9ddc('0x1e')]=_0x3b31b4['ListId'];this[_0x9ddc('0x1f')]=_0x3b31b4[_0x9ddc('0x1f')];this[_0x9ddc('0x20')]=_0x3b31b4[_0x9ddc('0x20')];this[_0x9ddc('0x21')]=_0x3b31b4[_0x9ddc('0x21')];this[_0x9ddc('0x22')]=_0x3b31b4['originatecalleridnum']||'';this[_0x9ddc('0x23')]=_0x3b31b4[_0x9ddc('0x23')]||'';}module['exports']=History; \ No newline at end of file +var _0xc91b=['holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xc91b,0x17e));var _0xbc91=function(_0x43b9ae,_0x47578e){_0x43b9ae=_0x43b9ae-0x0;var _0x211597=_0xc91b[_0x43b9ae];return _0x211597;};'use strict';var util=require(_0xbc91('0x0'));var _=require(_0xbc91('0x1'));var moment=require(_0xbc91('0x2'));function getSeconds(_0x2bd409,_0x4d216c){var _0x449e42=moment(_0x2bd409)[_0xbc91('0x3')](0x0);var _0x24c166=moment(_0x4d216c)['milliseconds'](0x0);return _0x449e42[_0xbc91('0x4')](_0x24c166,_0xbc91('0x5'));}function History(_0x4baece){this['uniqueid']=_0x4baece[_0xbc91('0x6')];this['scheduledat']=_0x4baece['scheduledat']||undefined;this[_0xbc91('0x7')]=_0x4baece[_0xbc91('0x7')];this[_0xbc91('0x8')]=_0x4baece['type']===_0xbc91('0x9')?_0xbc91('0xa'):_0x4baece[_0xbc91('0x7')];this[_0xbc91('0xb')]=_0x4baece[_0xbc91('0xb')];this['countcongestionretry']=_0x4baece[_0xbc91('0xc')];this[_0xbc91('0xd')]=_0x4baece['countnoanswerretry'];this[_0xbc91('0xe')]=_0x4baece[_0xbc91('0xb')]+_0x4baece[_0xbc91('0xc')]+_0x4baece[_0xbc91('0xd')]+_0x4baece['countnosuchnumberretry']+_0x4baece[_0xbc91('0xf')]+_0x4baece['countabandonedretry']+_0x4baece[_0xbc91('0x10')]+_0x4baece[_0xbc91('0x11')];this[_0xbc91('0x12')]=_0x4baece[_0xbc91('0x12')];this[_0xbc91('0xf')]=_0x4baece[_0xbc91('0xf')];this[_0xbc91('0x13')]=_0x4baece[_0xbc91('0x13')];this[_0xbc91('0x10')]=_0x4baece['countmachineretry'];this['countagentrejectretry']=_0x4baece['countagentrejectretry'];this['queue']=_0x4baece[_0xbc91('0xa')];this[_0xbc91('0x14')]=_0x4baece[_0xbc91('0x15')];this[_0xbc91('0x16')]=_0x4baece[_0xbc91('0x17')];this[_0xbc91('0x18')]=_0x4baece['starttime'];this[_0xbc91('0x19')]=_0x4baece[_0xbc91('0x19')];this[_0xbc91('0x1a')]=_0x4baece[_0xbc91('0x19')];this[_0xbc91('0x1b')]=getSeconds(_0x4baece[_0xbc91('0x19')],_0x4baece['starttime']);this[_0xbc91('0x1c')]=0x0;this[_0xbc91('0x1d')]=0x0;this['callback']=_0x4baece[_0xbc91('0x1e')];this[_0xbc91('0x1f')]=_0x4baece[_0xbc91('0x1f')];this[_0xbc91('0x20')]=_0x4baece[_0xbc91('0x20')];this[_0xbc91('0x21')]=_0x4baece[_0xbc91('0x21')];this[_0xbc91('0x22')]=_0x4baece[_0xbc91('0x22')];this['ListId']=_0x4baece[_0xbc91('0x23')];this[_0xbc91('0x24')]=_0x4baece[_0xbc91('0x24')];this[_0xbc91('0x25')]=_0x4baece[_0xbc91('0x25')];this[_0xbc91('0x26')]=_0x4baece[_0xbc91('0x26')];this[_0xbc91('0x27')]=_0x4baece[_0xbc91('0x27')]||'';this['originatecalleridname']=_0x4baece['originatecalleridname']||'';}module[_0xbc91('0x28')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 9c25e9f..3339cfa 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 _0x3299=['outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','voice:queue:%s','voice_queue:save','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\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','predictiveIntervalDroppedCallsTimeout','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:\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---------','One\x20call\x20every:\x20\x20\x20\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','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','starttime','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','sequence','enqueue','channel','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','saveInDb','merge','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','SIP/%s','reachable','status','unmonitored','uniqueid','isNil','variable','amdstatus','exten','dialAMDActive','value','HANGUP','state','statedesc','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countglobal','countbusyretry','reason\x2019\x20machine....','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','Unknow','reason','agent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','droptime','Drop','dropreason','TIMEOUT','agiafterat','dialDropMaxRetry','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncQueueMember','actionid','strategy','locked','stateinterface','rrmemory','push','pick','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','syncQueueSummary','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','dialQueueOptions','dialAgiAfterHangupAgent','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','trim','dialCutDigit','substring','SIP/%s/%s%s','xcally-motion-dialer','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','responsetime','getQueue','response','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropRetryFrequency','[rescheduleContact][Drop]','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','Abandoned','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','Success','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dropRate','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','Unknown\x20Predictive','outboundQueuePauses','[CatchErlangB]','busyFactor','[getDataPredictive]','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','inBlackList','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','Contact.phone','[actionOriginateIvr]\x20','not_inuse','[actionOriginate]\x20','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','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','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','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','defaults','localhost','../rpc/cmHopper','./action','./history','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','syncNewExten','varset','syncVarSet','syncQueueStatusComplete','loopCampaigns','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','[ifTime][Action]','stringify','milliseconds','diff','emit','type','outbound','answered','available','loggedIn','pTalking','sumDuration','talking','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay'];(function(_0x4f4c2a,_0x5f5a28){var _0xd15be6=function(_0x1bc725){while(--_0x1bc725){_0x4f4c2a['push'](_0x4f4c2a['shift']());}};_0xd15be6(++_0x5f5a28);}(_0x3299,0x1bc));var _0x9329=function(_0x2147b3,_0x3bc712){_0x2147b3=_0x2147b3-0x0;var _0x155260=_0x3299[_0x2147b3];return _0x155260;};'use strict';var util=require('util');var _=require(_0x9329('0x0'));var BPromise=require(_0x9329('0x1'));var uuid=require(_0x9329('0x2'));var moment=require(_0x9329('0x3'));var rr=require('rr');var md5=require(_0x9329('0x4'));var Redis=require(_0x9329('0x5'));var ut=require(_0x9329('0x6'));var config=require(_0x9329('0x7'));var logger=require(_0x9329('0x8'))(_0x9329('0x9'));var loggerBooked=require(_0x9329('0x8'))(_0x9329('0xa'));var loggerPredictive=require(_0x9329('0x8'))(_0x9329('0xb'));var loggerPredictiveCalls=require(_0x9329('0x8'))(_0x9329('0xc'));var loggerSyncQueueSummary=require(_0x9329('0x8'))('syncQueueSummary');var ami=require(_0x9329('0xd'));config[_0x9329('0xe')]=_[_0x9329('0xf')](config[_0x9329('0xe')],{'host':_0x9329('0x10'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9329('0xe')]));var cmHopper=require(_0x9329('0x11'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x9329('0x12'));var History=require(_0x9329('0x13'));var Final=require(_0x9329('0x14'));var AgentComplete=require(_0x9329('0x15'));var QueueCallerAbandon=require(_0x9329('0x16'));var Hangup=require('./hangup');var ipAgi=process[_0x9329('0x17')][_0x9329('0x18')]||_0x9329('0x19');var strategy={'rrmemory':'rrmemory','roundrobin':_0x9329('0x1a')};var Sequence=function(){};Sequence[_0x9329('0x1b')]['enqueue']=function(_0x342e47){this[_0x9329('0x1c')]=this['tail']?this[_0x9329('0x1c')][_0x9329('0x1d')](_0x342e47):_0x342e47();};function Dialer(_0x1c35d5,_0x28c751){this['sequence']=new Sequence();this[_0x9329('0x1e')]=_0x28c751;this['voiceQueues']=_0x1c35d5[_0x9329('0x1f')];this[_0x9329('0x20')]=_0x1c35d5['campaigns'];this[_0x9329('0x21')]=_0x1c35d5[_0x9329('0x21')];this['trunks']=_0x1c35d5[_0x9329('0x22')];this['maxNumberOriginate']=config[_0x9329('0x23')]||0x2;this['channels']={};this[_0x9329('0x24')]={};this['contactsId']={};this[_0x9329('0x25')]={};this[_0x9329('0x26')]={};this[_0x9329('0x27')]={};this[_0x9329('0x28')]={};this[_0x9329('0x29')]={};this[_0x9329('0x2a')]={};this['queueBookedRR']={};ami['on'](_0x9329('0x2b'),this[_0x9329('0x2c')][_0x9329('0x2d')](this));ami['on'](_0x9329('0x2e'),this[_0x9329('0x2f')]['bind'](this));ami['on'](_0x9329('0x30'),this[_0x9329('0x31')]['bind'](this));ami['on'](_0x9329('0x32'),this[_0x9329('0x33')][_0x9329('0x2d')](this));ami['on'](_0x9329('0x34'),this['syncQueueSummary']['bind'](this));ami['on'](_0x9329('0x35'),this[_0x9329('0x36')][_0x9329('0x2d')](this));ami['on']('newexten',this[_0x9329('0x37')]['bind'](this));ami['on'](_0x9329('0x38'),this[_0x9329('0x39')][_0x9329('0x2d')](this));ami['on']('queuemember',this['syncQueueMember'][_0x9329('0x2d')](this));ami['on']('queuestatuscomplete',this[_0x9329('0x3a')]['bind'](this));this[_0x9329('0x3b')]();this['loopClearZombieChannels']();}function isNotNull(_0x46fb80){return _0x46fb80!==null&&!_[_0x9329('0x3c')](_0x46fb80);}function checkIsLoggedIn(_0x5cd7db,_0x15c27b){return function(){if(_0x15c27b<=0x0){_0x5cd7db[_0x9329('0x3d')]='AGENTS_NOT_LOGGED';throw _0x5cd7db[_0x9329('0x3e')]+_0x9329('0x3f');}};}function isActive(_0x1699b4){return _0x1699b4;}function checkIsActive(_0x333bc2,_0x505e7d){return function(){if(!isActive(_0x505e7d)){_0x333bc2['message']='NOT_ACTIVE';throw _0x333bc2[_0x9329('0x3e')]+'\x20NOT\x20Active';}};}function checkInterval(_0x4b4b0d){return function(){if(!isNotNull(_0x4b4b0d['Interval'])){_0x4b4b0d[_0x9329('0x3d')]=_0x9329('0x40');throw _0x4b4b0d['name']+_0x9329('0x41');}if(!isNotNull(_0x4b4b0d[_0x9329('0x42')][_0x9329('0x43')])){_0x4b4b0d[_0x9329('0x3d')]='INTERVAL_IS_NULL';throw _0x4b4b0d[_0x9329('0x3e')]+_0x9329('0x41');}if(!isNotNull(_[_0x9329('0x44')](_0x4b4b0d[_0x9329('0x42')][_0x9329('0x43')]))){_0x4b4b0d[_0x9329('0x3d')]='INTERVAL_IS_NULL';throw _0x4b4b0d[_0x9329('0x3e')]+_0x9329('0x41');}};}function msgResponse(_0x3f4e3f,_0x3ae0a5,_0x34e015){return{'action':_0x3f4e3f,'response':_0x3ae0a5,'message':_0x34e015,'stack':_0x34e015};}function myreject(_0x40c7b5){return function(_0xb30d69){return _0x40c7b5(msgResponse(_0x9329('0x45'),'Error',JSON[_0x9329('0x46')](_0xb30d69)));};}function getSeconds(_0x4f5202,_0x11dc44){var _0x22086e=moment(_0x4f5202)[_0x9329('0x47')](0x0);var _0x2c7588=moment(_0x11dc44)[_0x9329('0x47')](0x0);return _0x22086e[_0x9329('0x48')](_0x2c7588,'seconds');}function emit(_0x5e8cb3,_0xec9ed4,_0x14afc8){io['to'](_0x5e8cb3)[_0x9329('0x49')](_0xec9ed4,_0x14afc8);}function emitVoiceQueueSummary(_0xc748ff){if(_0xc748ff[_0x9329('0x4a')]===_0x9329('0x4b')){var _0x3a9e91={'id':_0xc748ff['id'],'name':_0xc748ff[_0x9329('0x3e')],'strategy':_0xc748ff['strategy'],'answered':_0xc748ff[_0x9329('0x4c')],'available':_0xc748ff[_0x9329('0x4d')],'loggedIn':_0xc748ff[_0x9329('0x4e')],'pTalking':_0xc748ff[_0x9329('0x4f')],'sumBillable':_0xc748ff['sumBillable'],'sumDuration':_0xc748ff[_0x9329('0x50')],'sumHoldTime':_0xc748ff['sumHoldTime']||0x0,'talking':_0xc748ff[_0x9329('0x51')],'total':_0xc748ff['total'],'type':_0xc748ff[_0x9329('0x4a')],'unmanaged':_0xc748ff['unmanaged'],'abandoned':_0xc748ff[_0x9329('0x52')],'waiting':_0xc748ff[_0x9329('0x53')],'loggedInDb':_0xc748ff[_0x9329('0x54')],'dialActive':_0xc748ff[_0x9329('0x55')],'dialMethod':_0xc748ff['dialMethod'],'dialOriginateCallerIdName':_0xc748ff[_0x9329('0x56')],'dialOriginateCallerIdNumber':_0xc748ff[_0x9329('0x57')],'dialOriginateTimeout':_0xc748ff[_0x9329('0x58')],'dialPrefix':_0xc748ff[_0x9329('0x59')],'outboundAnswerAgiCallsDay':_0xc748ff[_0x9329('0x5a')],'outboundAnswerCallsDay':_0xc748ff[_0x9329('0x5b')],'outboundBlacklistCallsDay':_0xc748ff[_0x9329('0x5c')],'outboundBusyCallsDay':_0xc748ff['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0xc748ff[_0x9329('0x5d')],'outboundDropCallsDayACS':_0xc748ff[_0x9329('0x5e')],'outboundDropCallsDayCallersExit':_0xc748ff[_0x9329('0x5f')],'outboundDropCallsDayTimeout':_0xc748ff[_0x9329('0x60')],'outboundNoAnswerCallsDay':_0xc748ff[_0x9329('0x61')],'outboundNoSuchCallsDay':_0xc748ff['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0xc748ff[_0x9329('0x62')],'outboundReCallsDay':_0xc748ff[_0x9329('0x63')],'outboundRejectCallsDay':_0xc748ff[_0x9329('0x64')],'outboundUnknownCallsDay':_0xc748ff[_0x9329('0x65')],'predictiveIntervalAnsweredCalls':_0xc748ff[_0x9329('0x66')],'predictiveIntervalAvgHoldtime':_0xc748ff[_0x9329('0x67')],'predictiveIntervalAvgTalktime':_0xc748ff[_0x9329('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0xc748ff[_0x9329('0x69')],'predictiveIntervalDroppedCallsTimeout':_0xc748ff['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0xc748ff['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0xc748ff[_0x9329('0x6a')],'predictiveIntervalHitRate':_0xc748ff['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0xc748ff[_0x9329('0x6b')],'predictiveIntervalPauses':_0xc748ff[_0x9329('0x6c')],'predictiveIntervalAvailable':_0xc748ff[_0x9329('0x6d')],'predictiveIntervalTotalCalls':_0xc748ff[_0x9329('0x6e')],'message':_0xc748ff[_0x9329('0x3d')],'originated':_0xc748ff[_0x9329('0x6f')],'erlangCalls':_0xc748ff[_0x9329('0x70')],'erlangCallToSecond':_0xc748ff[_0x9329('0x71')],'erlangAbandonmentRate':_0xc748ff[_0x9329('0x72')],'erlangBusyFactor':_0xc748ff[_0x9329('0x73')],'startPredictive':_0xc748ff[_0x9329('0x27')],'startProgressive':_0xc748ff[_0x9329('0x28')]};if(_0xc748ff['Trunk']){_0x3a9e91['Trunk']={'id':_0xc748ff[_0x9329('0x74')]['id'],'name':_0xc748ff['Trunk'][_0x9329('0x3e')],'active':_0xc748ff[_0x9329('0x74')][_0x9329('0x75')],'callerid':_0xc748ff[_0x9329('0x74')][_0x9329('0x76')]};}if(_0xc748ff[_0x9329('0x42')]){_0x3a9e91['Interval']={'id':_0xc748ff[_0x9329('0x42')]['id'],'name':_0xc748ff[_0x9329('0x42')][_0x9329('0x3e')]};}var _0x5a4adb=md5(JSON[_0x9329('0x46')](_0x3a9e91));if(_0xc748ff[_0x9329('0x4')]!==_0x5a4adb){_0xc748ff[_0x9329('0x4')]=_0x5a4adb;emit(util['format'](_0x9329('0x77'),_0x3a9e91[_0x9329('0x3e')]),_0x9329('0x78'),_0x3a9e91);}}}function emitCampaignSummary(_0x21eeb8){if(_0x21eeb8[_0x9329('0x4a')]==='ivr'){emit(util[_0x9329('0x79')](_0x9329('0x7a'),_0x21eeb8[_0x9329('0x3e')]),_0x9329('0x7b'),_0x21eeb8);}}function checkGetDataPredictive(_0x24bdf8){if(isNotNull(_0x24bdf8)&&!_[_0x9329('0x44')](_0x24bdf8)){loggerPredictive[_0x9329('0x7c')](_0x9329('0x7d'));loggerPredictive[_0x9329('0x7c')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24bdf8[_0x9329('0x6e')]);loggerPredictive[_0x9329('0x7c')](_0x9329('0x7e'),_0x24bdf8[_0x9329('0x66')]);loggerPredictive[_0x9329('0x7c')](_0x9329('0x7f'),_0x24bdf8[_0x9329('0x80')]);loggerPredictive['info'](_0x9329('0x81'),_0x24bdf8[_0x9329('0x69')]);loggerPredictive[_0x9329('0x7c')](_0x9329('0x82'),_0x24bdf8[_0x9329('0x67')]);loggerPredictive[_0x9329('0x7c')](_0x9329('0x83'),_0x24bdf8[_0x9329('0x68')]);loggerPredictive[_0x9329('0x7c')](_0x9329('0x84'));if(_0x24bdf8[_0x9329('0x6e')]>0x0){if(!_[_0x9329('0x3c')](_0x24bdf8[_0x9329('0x68')])&&_0x24bdf8[_0x9329('0x68')]>0x0){return!![];}loggerPredictive[_0x9329('0x7c')](_0x9329('0x85'));if(!_['isUndefined'](_0x24bdf8['predictiveIntervalAvgHoldtime'])&&_0x24bdf8[_0x9329('0x67')]>0x0){return!![];}loggerPredictive[_0x9329('0x7c')](_0x9329('0x86'));}else{loggerPredictive[_0x9329('0x7c')](_0x9329('0x87'));}}else{loggerPredictive['info'](_0x9329('0x88'));}return![];}function mergeDataErlangB(_0x3ebf93){return function(_0x44d415){loggerPredictive['info'](_0x9329('0x89'));loggerPredictive[_0x9329('0x7c')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44d415['erlangCalls']);loggerPredictive[_0x9329('0x7c')](_0x9329('0x8a'),_0x44d415[_0x9329('0x71')]);loggerPredictive[_0x9329('0x7c')](_0x9329('0x8b'),_0x44d415[_0x9329('0x72')]);loggerPredictive[_0x9329('0x7c')](_0x9329('0x8c'),_0x44d415['erlangBusyFactor']);loggerPredictive[_0x9329('0x7c')](_0x9329('0x8b'),_0x44d415[_0x9329('0x72')]);loggerPredictive[_0x9329('0x7c')]('---------------------------');_['merge'](_0x3ebf93,_0x44d415);};}function getDiff(_0x21c8a2){var _0x1fa2a2=moment()[_0x9329('0x47')](0x0);var _0x3f6ec9=moment(_0x21c8a2)[_0x9329('0x47')](0x0);return _0x1fa2a2[_0x9329('0x48')](_0x3f6ec9,_0x9329('0x8d'));}function ifInterval(_0x58cd2c,_0x5918c9){if(_['isUndefined'](_0x5918c9)){return![];}return getDiff(_0x5918c9)<_0x58cd2c*0x3c;}function freeVariablesPredictive(_0x218df5){if(isNotNull(_0x218df5)){if(!_[_0x9329('0x3c')](_0x218df5[_0x9329('0x28')])){_0x218df5[_0x9329('0x28')]=undefined;loggerPredictive[_0x9329('0x7c')](_0x218df5[_0x9329('0x3e')],_0x9329('0x8e'));}if(!_[_0x9329('0x3c')](_0x218df5['startPredictive'])){_0x218df5[_0x9329('0x27')]=undefined;loggerPredictive[_0x9329('0x7c')](_0x218df5[_0x9329('0x3e')],_0x9329('0x8f'));}if(!_[_0x9329('0x3c')](_0x218df5['handlePredictive'])){clearInterval(_0x218df5[_0x9329('0x90')]);_0x218df5[_0x9329('0x90')]=undefined;loggerPredictive['info'](_0x218df5[_0x9329('0x3e')],_0x9329('0x91'));}}}function erlangb(_0x2063ff,_0x5baff0){if(_0x5baff0===0x0){return 0x0;}var _0x7891c9=0x1;for(var _0x140637=0x1;_0x140637<=_0x5baff0;_0x140637+=0x1){_0x7891c9=0x1+_0x7891c9*_0x140637/_0x2063ff;}return 0x1/_0x7891c9;}function isVoiceQueueOutbound(_0x4bb91b){return _0x4bb91b===_0x9329('0x4b');}function isNotPreview(_0x4326cc){return _0x4326cc!==_0x9329('0x1e');}function isCampaignIvr(_0x29bbaa){return _0x29bbaa===_0x9329('0x92');}function getCallerId(_0xf9237d,_0x112323,_0x488e41){if(!_[_0x9329('0x3c')](_0x488e41)&&typeof _0x488e41===_0x9329('0x93')&&!_[_0x9329('0x44')](_0x488e41)){if(!_[_0x9329('0x3c')](_0x112323)&&typeof _0x112323===_0x9329('0x93')&&!_[_0x9329('0x44')](_0x112323)){return util[_0x9329('0x79')](_0x9329('0x94'),_0x112323,_0x488e41);}return util['format']('\x22%s\x22\x20<%s>',_0x488e41,_0x488e41);}if(!_['isUndefined'](_0xf9237d)&&typeof _0xf9237d===_0x9329('0x93')&&!_[_0x9329('0x44')](_0xf9237d)){return _0xf9237d;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x585df7,_0x2cd5c3){return function(_0x1cbfe0){freeVariablesPredictive(_0x2cd5c3);emitVoiceQueueSummary(_0x2cd5c3);emitCampaignSummary(_0x2cd5c3);loggerSyncQueueSummary[_0x9329('0x95')](_0x585df7,util[_0x9329('0x96')](_0x1cbfe0,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xeabb8f,_0x3324d3){return function(_0x53ba98){loggerPredictive[_0x9329('0x95')](_0x3324d3[_0x9329('0x3e')],_0xeabb8f);loggerPredictive[_0x9329('0x95')](_0x53ba98[_0x9329('0x97')]);freeVariablesPredictive(_0x3324d3);};}function loggerCatch(_0x1f3a4e){return function(_0x1545b5){logger[_0x9329('0x95')](_0x1f3a4e,util['inspect'](_0x1545b5,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x36966b){return _0x36966b&&!_[_0x9329('0x3c')](_0x36966b)&&_0x36966b[_0x9329('0x98')]>0x0;}function decremetOriginate(_0x5be7ed){if(!_[_0x9329('0x3c')](_0x5be7ed)&&_0x5be7ed!==null){if(typeof _0x5be7ed[_0x9329('0x6f')]!==_0x9329('0x99')){if(_0x5be7ed['originated']>0x0){_0x5be7ed[_0x9329('0x6f')]-=0x1;}else{logger[_0x9329('0x95')](_0x9329('0x9a'));}}}else{logger[_0x9329('0x95')](_0x9329('0x9b'));}}function checkContactLowerLimitOriginate(_0x203796,_0x2f712c,_0x2cfb17){if(_0x2f712c>_0x2cfb17){for(var _0x3dc304=0x0;_0x3dc304<_0x2f712c-_0x2cfb17;_0x3dc304+=0x1){decremetOriginate(_0x203796);}}}function loggerGetContactDialer(_0x1e96bf,_0x10432e,_0x40439c){return function(_0x195ffb){checkContactLowerLimitOriginate(_0x10432e,_0x40439c,0x0);logger['error'](_0x1e96bf,util[_0x9329('0x96')](_0x195ffb,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x150fff){return function(_0x3f669c){if(isNotNull(_0x3f669c)&&isNotNull(_0x3f669c[0x0])){if(_0x3f669c[0x0][_0x9329('0x9c')]>0x0){_0x150fff[_0x9329('0x3d')]='RESCHEDULED_CONTACTS';logger['info'](_0x9329('0x9d')+_0x150fff[_0x9329('0x3e')],_0x3f669c[0x0][_0x9329('0x9c')],'contacts');}else{_0x150fff[_0x9329('0x3d')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0x9329('0x9e')+_0x150fff['name']);}}};}function notSendMessagesQueue(_0x1493fa){if(_0x1493fa['sendMessageOneNotActive']){freeVariablesPredictive(_0x1493fa);if(_0x1493fa['originated']===0x0&&_0x1493fa[_0x9329('0x51')]===0x0&&_0x1493fa[_0x9329('0x53')]===0x0&&(_0x1493fa[_0x9329('0x4f')]||0x0)===0x0){_0x1493fa[_0x9329('0x9f')]=![];_0x1493fa[_0x9329('0x4d')]=0x0;_0x1493fa['message']=_0x9329('0xa0');loggerSyncQueueSummary[_0x9329('0x95')](_0x9329('0xa1'),_0x1493fa['name'],_0x9329('0xa2'));}else{_0x1493fa[_0x9329('0x3d')]=_0x9329('0xa3');loggerSyncQueueSummary[_0x9329('0x95')](_0x9329('0xa1'),_0x1493fa['name'],_0x9329('0xa4'));}emitVoiceQueueSummary(_0x1493fa);}}function notSendMessagesCampaign(_0x5d504c){if(_0x5d504c['sendMessageOneNotActive']){if(_0x5d504c['originated']===0x0){_0x5d504c[_0x9329('0x9f')]=![];_0x5d504c[_0x9329('0x3d')]=_0x9329('0xa0');loggerSyncQueueSummary['error'](_0x9329('0xa5'),_0x5d504c['name'],'is\x20not\x20active');}else{_0x5d504c[_0x9329('0x3d')]=_0x9329('0xa3');loggerSyncQueueSummary[_0x9329('0x95')](_0x9329('0xa5'),_0x5d504c[_0x9329('0x3e')],_0x9329('0xa4'));}emitCampaignSummary(_0x5d504c);}}function createObjHistory(_0xd0425a,_0x10e2bb,_0x17a89e,_0x589f10,_0x255c7b){_0xd0425a[_0x9329('0x3d')]=_0x17a89e;var _0x57c4f1=new Action(_0xd0425a,_0x10e2bb);var _0x5c23c3=new History(_0x57c4f1);_0x5c23c3['state']=_0x589f10;_0x5c23c3['statedesc']=_0x255c7b;_0x5c23c3['endtime']=_0x57c4f1[_0x9329('0xa6')];return _0x5c23c3;}Dialer[_0x9329('0x1b')][_0x9329('0xa7')]=function(){var _0x1b1534=this;setInterval(function(){_0x1b1534[_0x9329('0xa8')](_0x1b1534['uniqueId'],_0x9329('0xa9'));_0x1b1534[_0x9329('0xa8')](_0x1b1534[_0x9329('0x24')],_0x9329('0xaa'));},0x32c8);};Dialer[_0x9329('0x1b')]['clearZombieChannels']=function(_0x5279b6,_0x13d876){var _0x2f6b91=this;for(var _0x4ad6e3 in _0x5279b6){if(typeof _0x5279b6[_0x4ad6e3]!==_0x9329('0x99')){this[_0x9329('0xab')][_0x9329('0xac')](function(){if(!_['isNil'](_0x5279b6[_0x4ad6e3])){return ami['Action']({'action':'status','channel':_0x5279b6[_0x4ad6e3][_0x9329('0xad')]})[_0x9329('0xae')](function(_0x39f6bc){if(_0x39f6bc['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x5279b6[_0x4ad6e3]&&_0x5279b6[_0x4ad6e3][_0x9329('0x4a')]!==_0x9329('0x92')){_0x2f6b91[_0x9329('0xaf')](_0x2f6b91['voiceQueues'][_0x5279b6[_0x4ad6e3][_0x9329('0xb0')]]);logger[_0x9329('0x95')](_0x9329('0xb1'),_0x13d876,_0x4ad6e3,_0x5279b6[_0x4ad6e3][_0x9329('0xb0')]);delete _0x5279b6[_0x4ad6e3];}if(_0x5279b6[_0x4ad6e3]&&_0x5279b6[_0x4ad6e3]['type']===_0x9329('0x92')){_0x2f6b91[_0x9329('0xaf')](_0x2f6b91['campaigns'][_0x5279b6[_0x4ad6e3][_0x9329('0xb0')]]);logger['error'](_0x9329('0xb2'),_0x13d876,_0x4ad6e3,_0x5279b6[_0x4ad6e3]['queue']);delete _0x5279b6[_0x4ad6e3];}},0x2328);}});}});}}};Dialer[_0x9329('0x1b')]['countReScheduled']=function(_0x560a14){return BPromise['resolve']()[_0x9329('0xb3')](cmHopper[_0x9329('0xb4')](_0x560a14))['catch'](loggerCatch(_0x9329('0xb5')));};Dialer[_0x9329('0x1b')][_0x9329('0xb6')]=function(_0x42a345){return BPromise[_0x9329('0xb7')]()[_0x9329('0xb3')](cmHopperBlack[_0x9329('0xb6')](_0x42a345))['catch'](loggerCatch(_0x9329('0xb8')));};Dialer[_0x9329('0x1b')][_0x9329('0xb9')]=function(_0x3e01ec){return BPromise[_0x9329('0xb7')]()['then'](cmHopperBlack[_0x9329('0xb9')](_0x3e01ec))[_0x9329('0xae')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x9329('0x1b')][_0x9329('0xba')]=function(_0x14e7b7){return BPromise['resolve']()[_0x9329('0xb3')](cmHopperHistory[_0x9329('0xbb')](_0x14e7b7))[_0x9329('0xae')](loggerCatch(_0x9329('0xbc')));};Dialer[_0x9329('0x1b')][_0x9329('0xbd')]=function(_0x269a20){return BPromise[_0x9329('0xb7')]()[_0x9329('0xb3')](cmHopper['rescheduleContact'](_0x269a20))['catch'](loggerCatch(_0x9329('0xbe')));};Dialer['prototype'][_0x9329('0xbf')]=function(_0x4bbb70,_0x4f1204,_0x686aab){return BPromise['resolve']()[_0x9329('0xb3')](cmHopper[_0x9329('0xbf')](_0x4bbb70,_0x4f1204,_0x686aab))[_0x9329('0xae')](loggerCatch(_0x9329('0xc0')));};Dialer[_0x9329('0x1b')][_0x9329('0xc1')]=function(_0x23e34c,_0x4b0c9c,_0x4e7aa3,_0x276a17,_0x505c2a){return BPromise[_0x9329('0xb7')]()['then'](cmHopper[_0x9329('0xc1')](_0x23e34c,_0x4b0c9c,_0x4e7aa3,_0x276a17))[_0x9329('0xae')](function(_0x1df2cf){_0x505c2a[_0x9329('0xc2')]-=_0x4e7aa3;_0x505c2a[_0x9329('0xc2')]=_0x505c2a[_0x9329('0xc2')]>0x0?_0x505c2a[_0x9329('0xc2')]:0x0;loggerCatch(_0x9329('0xc3'))(_0x1df2cf);});};Dialer[_0x9329('0x1b')][_0x9329('0xc4')]=function(_0x242a5a,_0x514cc0,_0xec2e76,_0x2bddf1){return BPromise[_0x9329('0xb7')]()['then'](cmHopper[_0x9329('0xc4')](_0x242a5a,_0x514cc0,_0xec2e76))[_0x9329('0xae')](function(_0xdf88fe){_0x2bddf1[_0x9329('0xc2')]-=_0x514cc0;_0x2bddf1[_0x9329('0xc2')]=_0x2bddf1[_0x9329('0xc2')]>0x0?_0x2bddf1['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0xdf88fe);});};Dialer[_0x9329('0x1b')][_0x9329('0xc5')]=function(_0x10a388){return BPromise[_0x9329('0xb7')]()[_0x9329('0xb3')](voiceQueueRt[_0x9329('0xc5')](_0x10a388))['catch'](loggerCatch(_0x9329('0xc6')));};Dialer[_0x9329('0x1b')][_0x9329('0xc7')]=function(_0x4f92ff){return BPromise[_0x9329('0xb7')]()[_0x9329('0xb3')](cmHopper[_0x9329('0xc7')](_0x4f92ff))[_0x9329('0xae')](loggerCatch(_0x9329('0xc8')));};Dialer[_0x9329('0x1b')]['createHistory']=function(_0x1b0d9c){return BPromise[_0x9329('0xb7')]()[_0x9329('0xb3')](cmHopperHistory[_0x9329('0xc9')](_0x1b0d9c))[_0x9329('0xae')](loggerCatch('[createHistory]\x20'));};Dialer['prototype'][_0x9329('0xaf')]=function(_0x6a178e){if(!_[_0x9329('0x3c')](_0x6a178e)&&_0x6a178e!==null){if(typeof _0x6a178e[_0x9329('0x6f')]!==_0x9329('0x99')){if(_0x6a178e['originated']>0x0){_0x6a178e['originated']-=0x1;}else{logger[_0x9329('0x95')](_0x9329('0xca'));}}}else{logger[_0x9329('0x95')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x9329('0x1b')][_0x9329('0xcb')]=function(_0x4b2df4,_0x505ee6){var _0xc00dc3=this;return function(_0x5b44dc){_0xc00dc3[_0x9329('0xaf')](_0x505ee6);logger[_0x9329('0x95')](_0x4b2df4,util[_0x9329('0x96')](_0x5b44dc,{'showHidden':![],'depth':null}));};};Dialer[_0x9329('0x1b')][_0x9329('0xcc')]=function(_0x4da060,_0x4ac7bf,_0x4601f9){var _0xc613b9={'state':0x19,'statedesc':_0x9329('0xcd')};this[_0x9329('0xaf')](_0x4ac7bf);this[_0x9329('0xce')](_[_0x9329('0xcf')](_0xc613b9,_['pick'](_0x4601f9,[_0x9329('0xd0'),_0x9329('0xd1'),_0x9329('0xd2'),_0x9329('0xd3'),_0x9329('0xd4')])),_0x9329('0xd5'),_0x9329('0xd6'));logger[_0x9329('0x95')](_0x4da060);};Dialer[_0x9329('0x1b')][_0x9329('0xd7')]=function(_0x3c9c0d){return _0x3c9c0d==='Success';};Dialer[_0x9329('0x1b')]['isTrunkReachable']=function(_0x2f2fc9){return!_[_0x9329('0x3c')](_0x2f2fc9)&&_0x2f2fc9&&!_[_0x9329('0x3c')](_0x2f2fc9['name'])&&!_['isUndefined'](_0x2f2fc9['active'])&&_0x2f2fc9[_0x9329('0x75')]&&(this[_0x9329('0x22')][util['format'](_0x9329('0xd8'),_0x2f2fc9[_0x9329('0x3e')])]['status']===_0x9329('0xd9')||this[_0x9329('0x22')][util['format']('SIP/%s',_0x2f2fc9[_0x9329('0x3e')])][_0x9329('0xda')]===_0x9329('0xdb'));};Dialer[_0x9329('0x1b')]['saveInDb']=function(_0x580809,_0x59b06d,_0x56d90a){this[_0x9329('0xc9')](_0x580809)[_0x9329('0xae')](loggerCatch(_0x59b06d));this[_0x9329('0xc7')](_0x580809)[_0x9329('0xae')](loggerCatch(_0x56d90a));};Dialer['prototype']['syncVarSet']=function(_0x339249){var _0x5f4ccf=this[_0x9329('0x25')][_0x339249[_0x9329('0xdc')]];var _0x4472ba;if(!_[_0x9329('0xdd')](_0x339249)&&!_[_0x9329('0xdd')](_0x339249['variable'])&&!_[_0x9329('0xdd')](_0x339249[_0x9329('0xde')][_0x9329('0xdf')])&&_0x339249[_0x9329('0xe0')]==='xcally-motion-dialer'&&_0x5f4ccf){if(_0x5f4ccf[_0x9329('0x4a')]!==_0x9329('0x92')&&this['voiceQueues'][_0x5f4ccf['queue']][_0x9329('0xe1')]&&_0x339249[_0x9329('0xe2')]===_0x9329('0xe3')){delete this[_0x9329('0x25')][_0x339249[_0x9329('0xdc')]];this[_0x9329('0xaf')](this['voiceQueues'][_0x5f4ccf[_0x9329('0xb0')]]);this[_0x9329('0x1f')][_0x5f4ccf[_0x9329('0xb0')]]['outboundAnswerCallsDay']+=0x1;this[_0x9329('0x1f')][_0x5f4ccf['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x4472ba=new Hangup(_0x5f4ccf,_0x339249);_0x4472ba[_0x9329('0xe4')]=0x12;_0x4472ba[_0x9329('0xe5')]=_0x9329('0xe6');_0x4472ba[_0x9329('0xe7')]=_0x9329('0xe8');ami['emit'](_0x9329('0xe9'),ut[_0x9329('0xea')](_0x4472ba,_0x9329('0xeb')));this[_0x9329('0xce')](_0x4472ba,_0x9329('0xec'),_0x9329('0xed'));}if(_0x5f4ccf[_0x9329('0x4a')]!==_0x9329('0x92')&&this['voiceQueues'][_0x5f4ccf[_0x9329('0xb0')]]['dialAMDActive']&&_0x339249[_0x9329('0xe2')]==='MACHINE'){var _0x4b9f8f=this;return new BPromise(function(_0x4a22bd,_0x28a0dc){delete _0x4b9f8f[_0x9329('0x25')][_0x339249['uniqueid']];_0x4b9f8f[_0x9329('0xaf')](_0x4b9f8f[_0x9329('0x1f')][_0x5f4ccf[_0x9329('0xb0')]]);_0x4b9f8f[_0x9329('0x1f')][_0x5f4ccf[_0x9329('0xb0')]][_0x9329('0x5b')]+=0x1;_0x4b9f8f[_0x9329('0x1f')][_0x5f4ccf[_0x9329('0xb0')]]['outboundAnswerAgiCallsDay']+=0x1;var _0xc772b4=_0x4b9f8f[_0x9329('0x1f')][_0x5f4ccf[_0x9329('0xb0')]];var _0x251efa=new Hangup(_0x5f4ccf,_0x339249);_0x251efa[_0x9329('0xe4')]=0x13;_0x251efa[_0x9329('0xe5')]=_0x9329('0xee');_0x251efa[_0x9329('0xe7')]=_0x9329('0xe8');_0x251efa[_0x9329('0xef')]+=0x1;_0x251efa['countglobal']+=0x1;_0x251efa['amd']=!![];ami[_0x9329('0x49')](_0x9329('0xe9'),ut[_0x9329('0xea')](_0x251efa,_0x9329('0xeb')));_0x4b9f8f[_0x9329('0xc9')](_0x251efa)['catch'](loggerCatch(_0x9329('0xf0')));if(_0x251efa['countbusyretry']+_0x251efa[_0x9329('0xf1')]+_0x251efa[_0x9329('0xf2')]+_0x251efa[_0x9329('0xf3')]+_0x251efa[_0x9329('0xf4')]+_0x251efa[_0x9329('0xf5')]+_0x251efa['countmachineretry']+_0x251efa[_0x9329('0xf6')]>=_0xc772b4[_0x9329('0xf7')]){_0x4b9f8f[_0x9329('0xf8')](_0x251efa,_0x4a22bd,_0x28a0dc,_0x9329('0xf9'));}else{if(_0x251efa[_0x9329('0xef')]>=_0xc772b4[_0x9329('0xfa')]){_0x4b9f8f[_0x9329('0xfb')](_0x251efa,_0x4a22bd,_0x28a0dc,'reason\x2019\x20machine....');}else{_0x4b9f8f[_0x9329('0xbd')]({'active':![],'countmachineretry':_0x251efa['countmachineretry'],'scheduledat':moment()[_0x9329('0xfc')](_0xc772b4[_0x9329('0xfd')],_0x9329('0xfe'))[_0x9329('0x79')](_0x9329('0xff')),'ContactId':_0x251efa[_0x9329('0xd0')],'ListId':_0x251efa[_0x9329('0xd1')],'VoiceQueueId':_0x251efa[_0x9329('0xd3')]||undefined,'CampaignId':_0x251efa[_0x9329('0xd4')]||undefined})[_0x9329('0xae')](loggerCatch(_0x9329('0x100')));_0x4a22bd({'reschedule':0x1});}}});}if(_0x5f4ccf[_0x9329('0x4a')]===_0x9329('0x92')&&this[_0x9329('0x20')][_0x5f4ccf[_0x9329('0xb0')]][_0x9329('0xe1')]&&_0x339249['value']===_0x9329('0xe3')){delete this['uniqueId'][_0x339249[_0x9329('0xdc')]];this[_0x9329('0xaf')](this[_0x9329('0x20')][_0x5f4ccf[_0x9329('0xb0')]]);_0x4472ba=new Hangup(_0x5f4ccf,_0x339249);_0x4472ba[_0x9329('0xe4')]=0x12;_0x4472ba[_0x9329('0xe5')]=_0x9329('0xe6');_0x4472ba['membername']=_0x9329('0xe8');ami[_0x9329('0x49')]('custom:amd',ut['buildObj'](_0x4472ba,_0x9329('0xeb')));this[_0x9329('0xce')](_0x4472ba,_0x9329('0x101'),_0x9329('0x102'));}if(_0x5f4ccf['type']===_0x9329('0x92')&&this['campaigns'][_0x5f4ccf['queue']]['dialAMDActive']&&_0x339249[_0x9329('0xe2')]===_0x9329('0x103')){var _0x4b9f8f=this;return new BPromise(function(_0x3d336c,_0x35b30f){delete _0x4b9f8f[_0x9329('0x25')][_0x339249[_0x9329('0xdc')]];_0x4b9f8f[_0x9329('0xaf')](_0x4b9f8f['campaigns'][_0x5f4ccf[_0x9329('0xb0')]]);_0x4b9f8f[_0x9329('0x20')][_0x5f4ccf['queue']][_0x9329('0x5b')]+=0x1;_0x4b9f8f['campaigns'][_0x5f4ccf['queue']][_0x9329('0x5a')]+=0x1;var _0x1727d5=_0x4b9f8f[_0x9329('0x20')][_0x5f4ccf[_0x9329('0xb0')]];var _0x59e26e=new Hangup(_0x5f4ccf,_0x339249);_0x59e26e[_0x9329('0xe4')]=0x13;_0x59e26e[_0x9329('0xe5')]='Machine';_0x59e26e[_0x9329('0xe7')]=_0x9329('0xe8');_0x59e26e[_0x9329('0xef')]+=0x1;_0x59e26e[_0x9329('0x104')]+=0x1;_0x59e26e['amd']=!![];ami[_0x9329('0x49')]('custom:amd',ut[_0x9329('0xea')](_0x59e26e,_0x9329('0xeb')));_0x4b9f8f[_0x9329('0xc9')](_0x59e26e)[_0x9329('0xae')](loggerCatch(_0x9329('0xf0')));if(_0x59e26e[_0x9329('0x105')]+_0x59e26e[_0x9329('0xf1')]+_0x59e26e['countnoanswerretry']+_0x59e26e[_0x9329('0xf3')]+_0x59e26e['countdropretry']+_0x59e26e[_0x9329('0xf5')]+_0x59e26e[_0x9329('0xef')]+_0x59e26e['countagentrejectretry']>=_0x1727d5[_0x9329('0xf7')]){_0x4b9f8f[_0x9329('0xf8')](_0x59e26e,_0x3d336c,_0x35b30f,'reason19\x20machine....');}else{if(_0x59e26e['countmachineretry']>=_0x1727d5[_0x9329('0xfa')]){_0x4b9f8f[_0x9329('0xfb')](_0x59e26e,_0x3d336c,_0x35b30f,_0x9329('0x106'));}else{_0x4b9f8f[_0x9329('0xbd')]({'active':![],'countmachineretry':_0x59e26e[_0x9329('0xef')],'scheduledat':moment()[_0x9329('0xfc')](_0x1727d5['dialMachineRetryFrequency'],_0x9329('0xfe'))[_0x9329('0x79')](_0x9329('0xff')),'ContactId':_0x59e26e[_0x9329('0xd0')],'ListId':_0x59e26e[_0x9329('0xd1')],'VoiceQueueId':_0x59e26e[_0x9329('0xd3')]||undefined,'CampaignId':_0x59e26e[_0x9329('0xd4')]||undefined})[_0x9329('0xae')](loggerCatch(_0x9329('0x100')));_0x3d336c({'reschedule':0x1});}}});}}};Dialer[_0x9329('0x1b')][_0x9329('0x36')]=function(_0x4dd361){var _0x194443=this[_0x9329('0x25')][_0x4dd361[_0x9329('0xdc')]];var _0x449700=this;var _0x227108;if(_0x194443&&_0x194443['type']==='ivr'){delete this[_0x9329('0x25')][_0x4dd361['uniqueid']];this[_0x9329('0xaf')](this[_0x9329('0x20')][_0x194443['queue']]);this[_0x9329('0x20')][_0x194443['queue']]['ivrAnswerCallsDay']+=0x1;_0x227108=new Hangup(_0x194443,_0x4dd361);this[_0x9329('0xc9')](_0x227108)[_0x9329('0xae')](loggerCatch(_0x9329('0x107')));this[_0x9329('0xc7')](_0x227108)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x194443&&_0x194443[_0x9329('0x4a')]!==_0x9329('0x92')&&isNotNull(this[_0x9329('0x1f')][_0x194443[_0x9329('0xb0')]][_0x9329('0x108')])){delete this[_0x9329('0x25')][_0x4dd361[_0x9329('0xdc')]];this[_0x9329('0xaf')](this[_0x9329('0x1f')][_0x194443[_0x9329('0xb0')]]);this[_0x9329('0x1f')][_0x194443[_0x9329('0xb0')]]['outboundAnswerCallsDay']+=0x1;this[_0x9329('0x1f')][_0x194443['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x227108=new Hangup(_0x194443,_0x4dd361);_0x227108[_0x9329('0xe4')]=0x10;_0x227108[_0x9329('0xe5')]=_0x9329('0x109');_0x227108[_0x9329('0xe7')]=_0x9329('0x10a');this[_0x9329('0xc9')](_0x227108)['catch'](loggerCatch(_0x9329('0x107')));this[_0x9329('0xc7')](_0x227108)['catch'](loggerCatch(_0x9329('0x10b')));}if(_0x194443&&_0x194443['type']!==_0x9329('0x92')&&!isNotNull(this[_0x9329('0x1f')][_0x194443[_0x9329('0xb0')]]['dialQueueProject'])){delete this[_0x9329('0x25')][_0x4dd361['uniqueid']];this[_0x9329('0xaf')](this[_0x9329('0x1f')][_0x194443[_0x9329('0xb0')]]);this[_0x9329('0x1f')][_0x194443[_0x9329('0xb0')]]['outboundUnknownCallsDay']+=0x1;_0x227108=new Hangup(_0x194443,_0x4dd361);_0x227108[_0x9329('0xe4')]=0xc;_0x227108[_0x9329('0xe5')]=_0x4dd361['cause-txt'];_0x227108[_0x9329('0xe7')]=_0x9329('0x10c');this[_0x9329('0xc9')](_0x227108)[_0x9329('0xae')](loggerCatch(_0x9329('0x107')));this[_0x9329('0xc7')](_0x227108)[_0x9329('0xae')](loggerCatch(_0x9329('0x10b')));}};Dialer[_0x9329('0x1b')][_0x9329('0x33')]=function(_0x1597f2){var _0x1c8103=this['uniqueId'][_0x1597f2[_0x9329('0xdc')]];var _0x5b9730=this;if(this[_0x9329('0x1f')][_0x1597f2['queue']]){if(_0x1c8103&&_0x1c8103[_0x9329('0x4a')]!=='ivr'){delete this['uniqueId'][_0x1597f2[_0x9329('0xdc')]];this['voiceQueues'][_0x1597f2['queue']]['outboundAnswerCallsDay']+=0x1;var _0x337b56=new AgentComplete(_0x1c8103,_0x1597f2);if(_0x1597f2[_0x9329('0x10d')]===_0x9329('0x10e')){_0x337b56['agiafterat']=this['voiceQueues'][_0x1597f2[_0x9329('0xb0')]]['dialQueueProject2']&&this[_0x9329('0x1f')][_0x1597f2[_0x9329('0xb0')]]['dialAgiAfterHangupAgent']?moment()[_0x9329('0x79')](_0x9329('0xff')):undefined;}this[_0x9329('0xc9')](_0x337b56)['catch'](loggerCatch(_0x9329('0x10f')));this[_0x9329('0xc7')](_0x337b56)['catch'](loggerCatch(_0x9329('0x110')));}}};Dialer[_0x9329('0x1b')][_0x9329('0x2c')]=function(_0x55658f){if(this[_0x9329('0x1f')][_0x55658f[_0x9329('0xb0')]]){if(this[_0x9329('0x25')][_0x55658f['uniqueid']]&&this['uniqueId'][_0x55658f[_0x9329('0xdc')]]['type']!=='ivr'){this[_0x9329('0xaf')](this[_0x9329('0x1f')][_0x55658f[_0x9329('0xb0')]]);this[_0x9329('0x25')][_0x55658f['uniqueid']][_0x9329('0x111')]=moment()['format'](_0x9329('0xff'));}}};Dialer[_0x9329('0x1b')][_0x9329('0x112')]=function(_0x426cb6){this[_0x9329('0xc9')](_0x426cb6)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x9329('0xc7')](_0x426cb6)[_0x9329('0xae')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x9329('0x1b')][_0x9329('0x2f')]=function(_0x5b200f){var _0x237f1d=this[_0x9329('0x25')][_0x5b200f['uniqueid']];var _0x233803=this;if(this['voiceQueues'][_0x5b200f[_0x9329('0xb0')]]){if(_0x237f1d&&_0x237f1d[_0x9329('0x4a')]!=='ivr'){delete this[_0x9329('0x25')][_0x5b200f[_0x9329('0xdc')]];this[_0x9329('0xaf')](this[_0x9329('0x1f')][_0x5b200f[_0x9329('0xb0')]]);_0x237f1d['droptime']=moment()['format'](_0x9329('0xff'));var _0x21affc=new QueueCallerAbandon(_0x237f1d,_0x5b200f);if(getSeconds(_0x237f1d[_0x9329('0x113')],_0x237f1d['responsetime'])>=_0x237f1d['dialQueueTimeout']){this[_0x9329('0x1f')][_0x5b200f['queue']][_0x9329('0x80')]+=0x1;this[_0x9329('0x1f')][_0x5b200f['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0x9329('0x1f')][_0x5b200f[_0x9329('0xb0')]][_0x9329('0x6a')]+=0x1;_0x21affc[_0x9329('0xe4')]=0xa;_0x21affc[_0x9329('0xe5')]=_0x9329('0x114');_0x21affc[_0x9329('0x115')]=_0x9329('0x116');_0x21affc[_0x9329('0x117')]=this[_0x9329('0x1f')][_0x5b200f['queue']]['dialQueueProject2']?moment()['format'](_0x9329('0xff')):undefined;_0x21affc[_0x9329('0xf4')]+=0x1;_0x21affc[_0x9329('0x104')]+=0x1;if(_0x21affc[_0x9329('0xf4')]>=this['voiceQueues'][_0x5b200f[_0x9329('0xb0')]][_0x9329('0x118')]){this[_0x9329('0x112')](_0x21affc);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x21affc['countdropretry'],'scheduledat':moment()[_0x9329('0xfc')](this[_0x9329('0x1f')][_0x5b200f['queue']]['dialDropRetryFrequency'],_0x9329('0xfe'))[_0x9329('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x237f1d['ContactId'],'ListId':_0x237f1d[_0x9329('0xd1')],'VoiceQueueId':_0x237f1d[_0x9329('0xd3')]||undefined,'CampaignId':_0x237f1d[_0x9329('0xd4')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));var _0x26a246=new History(_0x21affc);_0x26a246[_0x9329('0xe4')]=0xa;_0x26a246['statedesc']=_0x9329('0x114');_0x26a246[_0x9329('0xa6')]=moment()[_0x9329('0x79')]('YYYY-MM-DD\x20HH:mm:ss');_0x26a246[_0x9329('0x119')]=_0x26a246['starttime'];_0x26a246[_0x9329('0x11a')]=_0x21affc[_0x9329('0x11a')];_0x26a246['calleridnum']=_0x21affc[_0x9329('0x11b')];this[_0x9329('0xc9')](_0x26a246)[_0x9329('0xae')](loggerCatch(_0x9329('0x11c')));}}else{this[_0x9329('0x1f')][_0x5b200f['queue']][_0x9329('0x69')]+=0x1;this['voiceQueues'][_0x5b200f[_0x9329('0xb0')]]['outboundDropCallsDayCallersExit']+=0x1;_0x21affc[_0x9329('0xe4')]=0xb;_0x21affc[_0x9329('0xe5')]='Abandoned';_0x21affc[_0x9329('0x115')]='CALLEREXIT';_0x21affc['countabandonedretry']+=0x1;_0x21affc[_0x9329('0x104')]+=0x1;if(_0x21affc[_0x9329('0xf5')]>=this['voiceQueues'][_0x5b200f[_0x9329('0xb0')]]['dialAbandonedMaxRetry']){this['queueCallerAbandonCreateState'](_0x21affc);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x21affc['countabandonedretry'],'scheduledat':moment()[_0x9329('0xfc')](this[_0x9329('0x1f')][_0x5b200f[_0x9329('0xb0')]][_0x9329('0x11d')],_0x9329('0xfe'))[_0x9329('0x79')](_0x9329('0xff')),'ContactId':_0x237f1d['ContactId'],'ListId':_0x237f1d[_0x9329('0xd1')],'VoiceQueueId':_0x237f1d[_0x9329('0xd3')]||undefined,'CampaignId':_0x237f1d[_0x9329('0xd4')]||undefined})['catch'](loggerCatch(_0x9329('0x11e')));var _0x26a246=new History(_0x21affc);_0x26a246['state']=0xb;_0x26a246[_0x9329('0xe5')]='Abandoned';_0x26a246[_0x9329('0xa6')]=moment()[_0x9329('0x79')]('YYYY-MM-DD\x20HH:mm:ss');_0x26a246['endtime']=_0x26a246['starttime'];_0x26a246[_0x9329('0x11a')]=_0x21affc[_0x9329('0x11a')];_0x26a246[_0x9329('0x11b')]=_0x21affc[_0x9329('0x11b')];this['createHistory'](_0x26a246)[_0x9329('0xae')](loggerCatch(_0x9329('0x11f')));}}}}};Dialer[_0x9329('0x1b')][_0x9329('0x37')]=function(_0x23f59a){if(this[_0x9329('0x24')][_0x23f59a[_0x9329('0xdc')]]){this['actions'][_0x23f59a[_0x9329('0xdc')]]['channel']=_0x23f59a[_0x9329('0xad')];}if(this[_0x9329('0x25')][_0x23f59a[_0x9329('0xdc')]]){this[_0x9329('0x25')][_0x23f59a[_0x9329('0xdc')]][_0x9329('0xad')]=_0x23f59a[_0x9329('0xad')];}};Dialer[_0x9329('0x1b')][_0x9329('0x120')]=function(_0x3c394c){if(strategy[this[_0x9329('0x1f')][this['actions'][_0x3c394c[_0x9329('0x121')]][_0x9329('0xb0')]][_0x9329('0x122')]]===_0x9329('0x1a')){if(this[_0x9329('0x24')][_0x3c394c[_0x9329('0x121')]]&&_[_0x9329('0xdd')](this[_0x9329('0x24')][_0x3c394c[_0x9329('0x121')]][_0x9329('0x123')])&&_0x3c394c[_0x9329('0xda')]==='1'&&_0x3c394c['paused']==='0'){if(this['agents'][_0x3c394c['stateinterface']]){if(!this[_0x9329('0x21')][_0x3c394c[_0x9329('0x124')]][_0x9329('0x123')]){this[_0x9329('0x21')][_0x3c394c[_0x9329('0x124')]][_0x9329('0x123')]=!![];this[_0x9329('0x24')][_0x3c394c[_0x9329('0x121')]]['locked']=!![];this['actions'][_0x3c394c[_0x9329('0x121')]]['stateinterface']=_0x3c394c[_0x9329('0x124')];}}}}else if((strategy[this[_0x9329('0x1f')][this[_0x9329('0x24')][_0x3c394c['actionid']][_0x9329('0xb0')]][_0x9329('0x122')]]||_0x9329('0x125'))==='rrmemory'){if(this['actions'][_0x3c394c[_0x9329('0x121')]]){if(this[_0x9329('0x21')][_0x3c394c['stateinterface']]){this['actions'][_0x3c394c[_0x9329('0x121')]][_0x9329('0x124')]=_0x3c394c[_0x9329('0x124')];if(_['isNil'](this[_0x9329('0x2a')][this[_0x9329('0x24')][_0x3c394c['actionid']][_0x9329('0xb0')]])){this['queueBooked'][this[_0x9329('0x24')][_0x3c394c[_0x9329('0x121')]][_0x9329('0xb0')]]=[];}this[_0x9329('0x2a')][this[_0x9329('0x24')][_0x3c394c['actionid']][_0x9329('0xb0')]][_0x9329('0x126')](_['merge'](_[_0x9329('0x127')](this[_0x9329('0x24')][_0x3c394c[_0x9329('0x121')]],[_0x9329('0x128'),_0x9329('0x124')]),{'status':_0x3c394c[_0x9329('0xda')],'paused':_0x3c394c[_0x9329('0x129')]}));}}}};function unlockQueueStatus(_0x273431,_0x1c0f6a){setTimeout(function(){if(_[_0x9329('0x3c')](_0x273431[_0x9329('0x12a')])){loggerBooked[_0x9329('0x95')](_0x9329('0x12b'),_0x1c0f6a);}_0x273431[_0x9329('0x12a')]=!![];loggerBooked[_0x9329('0x7c')](_0x9329('0x12c'),_0x1c0f6a,JSON['stringify'](_['pick'](_0x273431,['name',_0x9329('0x12a')])));},0x1f3);}Dialer[_0x9329('0x1b')][_0x9329('0x3a')]=function(_0x4b8993){var _0x2438fb=this;var _0x3a0a23=_0x2438fb[_0x9329('0x1f')][_0x2438fb[_0x9329('0x24')][_0x4b8993['actionid']][_0x9329('0xb0')]];if(strategy[this[_0x9329('0x1f')][this[_0x9329('0x24')][_0x4b8993['actionid']][_0x9329('0xb0')]]['strategy']]===_0x9329('0x1a')){if(this[_0x9329('0x24')][_0x4b8993[_0x9329('0x121')]]&&this['actions'][_0x4b8993[_0x9329('0x121')]][_0x9329('0x124')]){this[_0x9329('0x1e')][_0x9329('0x12d')](this[_0x9329('0x24')][_0x4b8993[_0x9329('0x121')]][_0x9329('0x128')],this[_0x9329('0x24')][_0x4b8993[_0x9329('0x121')]][_0x9329('0x124')])[_0x9329('0xae')](function(_0x374b13){logger[_0x9329('0x95')](_0x9329('0x12e'),util[_0x9329('0x96')](_0x374b13,{'showHidden':![],'depth':null}));})[_0x9329('0x1d')](function(){_0x2438fb['updateOriginated'](_0x2438fb[_0x9329('0x1f')][_0x2438fb[_0x9329('0x24')][_0x4b8993['actionid']][_0x9329('0xb0')]]);_0x2438fb['agents'][_0x2438fb[_0x9329('0x24')][_0x4b8993['actionid']][_0x9329('0x124')]][_0x9329('0x123')]=![];delete _0x2438fb[_0x9329('0x24')][_0x4b8993[_0x9329('0x121')]];unlockQueueStatus(_0x3a0a23);});}else{this[_0x9329('0xaf')](this[_0x9329('0x1f')][this[_0x9329('0x24')][_0x4b8993['actionid']]['queue']]);this[_0x9329('0xbd')]({'active':![],'ContactId':this['actions'][_0x4b8993['actionid']][_0x9329('0xd0')],'ListId':this[_0x9329('0x24')][_0x4b8993[_0x9329('0x121')]][_0x9329('0xd1')],'VoiceQueueId':this[_0x9329('0x24')][_0x4b8993[_0x9329('0x121')]][_0x9329('0xd3')]||undefined,'CampaignId':this[_0x9329('0x24')][_0x4b8993[_0x9329('0x121')]][_0x9329('0xd4')]||undefined})[_0x9329('0xae')](loggerCatch(_0x9329('0x12f')));delete this[_0x9329('0x24')][_0x4b8993[_0x9329('0x121')]];unlockQueueStatus(_0x3a0a23);}}else if((strategy[this[_0x9329('0x1f')][this['actions'][_0x4b8993[_0x9329('0x121')]][_0x9329('0xb0')]][_0x9329('0x122')]]||_0x9329('0x125'))===_0x9329('0x125')){var _0x2ed859;if(this[_0x9329('0x24')][_0x4b8993[_0x9329('0x121')]]&&!_['isEmpty'](this[_0x9329('0x2a')][this[_0x9329('0x24')][_0x4b8993[_0x9329('0x121')]][_0x9329('0xb0')]])){if(this['queueBookedRR'][_0x2438fb[_0x9329('0x24')][_0x4b8993[_0x9329('0x121')]]['queue']]){this[_0x9329('0x130')][_0x2438fb[_0x9329('0x24')][_0x4b8993['actionid']][_0x9329('0xb0')]]=this[_0x9329('0x130')][this[_0x9329('0x24')][_0x4b8993[_0x9329('0x121')]][_0x9329('0xb0')]]?this[_0x9329('0x130')][this[_0x9329('0x24')][_0x4b8993['actionid']][_0x9329('0xb0')]]:this['queueBooked'][this[_0x9329('0x24')][_0x4b8993[_0x9329('0x121')]][_0x9329('0xb0')]]?this['queueBooked'][this[_0x9329('0x24')][_0x4b8993[_0x9329('0x121')]][_0x9329('0xb0')]][_0x9329('0x131')]||0x0:0x0;}this['queueBooked'][this[_0x9329('0x24')][_0x4b8993['actionid']][_0x9329('0xb0')]][_0x9329('0x131')]=this[_0x9329('0x130')][this['actions'][_0x4b8993[_0x9329('0x121')]][_0x9329('0xb0')]];for(var _0x4e88c8=0x0;_0x4e88c8=0x0;})[_0x9329('0xae')](myreject(_0x10fc4e)));}}else{_0x146214['push'](ami[_0x9329('0x14b')]({'action':_0x9329('0x14c'),'command':util[_0x9329('0x79')](_0x9329('0x14d'),_0x1fea0f,!_[_0x9329('0x3c')](config[_0x9329('0x148')][_0xf0d459])?_0xf0d459:'')})[_0x9329('0xb3')](function(_0xa8b492){return _0xa8b492[_0x9329('0x14f')]['indexOf']('true')>=0x0;})['catch'](myreject(_0x10fc4e)));}BPromise[_0x9329('0x152')](_0x146214)[_0x9329('0xb3')](function(_0x41225c){var _0x1ab866=_[_0x9329('0x153')](_0x41225c);if(_0x1ab866){return _0x21adfa(_0x1ab866);}else{_0x15d22c[_0x9329('0x3d')]=_0xd3e22e?_0x9329('0x154'):'INTERVAL_IS_OVERTIME';return _0x10fc4e(msgResponse('[ifTime][promiseAll]',_0x9329('0x144'),_0x9329('0x155')+_0xd3e22e+'\x20'+_0x4ddffc+_0x9329('0x156')+util[_0x9329('0x96')](_0x1fea0f,{'showHidden':![],'depth':null})+_0x9329('0x157')+_0xf0d459));}})[_0x9329('0xae')](function(_0x47548f){return _0x10fc4e(msgResponse('ifTime',_0x9329('0x144'),JSON['stringify'](_0x47548f)));});});};Dialer[_0x9329('0x1b')][_0x9329('0x158')]=function(_0x31a79b){var _0x63289d=this;return function(){switch(_0x31a79b[_0x9329('0x159')]){case _0x9329('0x15a'):freeVariablesPredictive(_0x31a79b);_0x63289d[_0x9329('0x15b')](_0x31a79b,0x1);break;case _0x9329('0x15c'):freeVariablesPredictive(_0x31a79b);_0x63289d['handlePower'](_0x31a79b,_0x31a79b[_0x9329('0x15d')]);break;case _0x9329('0xb'):_0x63289d[_0x9329('0xb')](_0x31a79b);break;case _0x9329('0xa'):freeVariablesPredictive(_0x31a79b);_0x63289d['handlePower'](_0x31a79b,0x1);break;default:freeVariablesPredictive(_0x31a79b);logger['error'](_0x9329('0x15e'),_0x31a79b['name'],_0x9329('0x15f'));}};};Dialer[_0x9329('0x1b')][_0x9329('0x160')]=function(_0x1cd37e){var _0x230348=this;return function(){_0x230348[_0x9329('0x161')](_0x1cd37e);};};Dialer[_0x9329('0x1b')][_0x9329('0x162')]=function(_0x201b3a){var _0x112463=this;if(isNotPreview(_0x201b3a['dialMethod'])){if(isVoiceQueueOutbound(_0x201b3a[_0x9329('0x4a')])&&isActive(_0x201b3a[_0x9329('0x55')])){_0x201b3a[_0x9329('0x9f')]=!![];BPromise['resolve']()['then'](checkIsLoggedIn(_0x201b3a,_0x201b3a[_0x9329('0x4e')]))[_0x9329('0xb3')](checkIsActive(_0x201b3a,_0x201b3a['dialActive']))['then'](checkInterval(_0x201b3a))[_0x9329('0xb3')](_0x112463[_0x9329('0x13d')](_0x201b3a))[_0x9329('0xb3')](_0x112463[_0x9329('0x142')](_0x201b3a[_0x9329('0x163')],_0x201b3a[_0x9329('0x164')],_0x201b3a[_0x9329('0x3e')],_0x201b3a))[_0x9329('0xb3')](_0x112463[_0x9329('0x165')](_0x201b3a[_0x9329('0x42')],_0x201b3a['dialTimezone'],_0x201b3a[_0x9329('0x3e')],_0x201b3a))['then'](_0x112463[_0x9329('0x158')](_0x201b3a))[_0x9329('0xae')](loggerCatchQueueSummary(_0x9329('0x166'),_0x201b3a));}else{notSendMessagesQueue(_0x201b3a);}}else{freeVariablesPredictive(_0x201b3a);}};Dialer[_0x9329('0x1b')][_0x9329('0x13c')]=function(){var _0x23c574=this;var _0x1cdd17;for(var _0x3c3a24 in this['campaigns']){if(typeof this[_0x9329('0x20')][_0x3c3a24]!==_0x9329('0x99')){_0x1cdd17=this[_0x9329('0x20')][_0x3c3a24];if(isCampaignIvr(_0x1cdd17[_0x9329('0x4a')])&&isActive(_0x1cdd17['active'])){_0x1cdd17['sendMessageOneNotActive']=!![];BPromise[_0x9329('0xb7')]()[_0x9329('0xb3')](checkIsActive(_0x1cdd17,_0x1cdd17['active']))[_0x9329('0xb3')](checkInterval(_0x1cdd17))['then'](_0x23c574[_0x9329('0x13d')](_0x1cdd17))[_0x9329('0xb3')](_0x23c574[_0x9329('0x142')](_0x1cdd17[_0x9329('0x163')],_0x1cdd17[_0x9329('0x164')],_0x1cdd17[_0x9329('0x3e')],_0x1cdd17))[_0x9329('0xb3')](_0x23c574[_0x9329('0x165')](_0x1cdd17[_0x9329('0x42')],_0x1cdd17['dialTimezone'],_0x1cdd17[_0x9329('0x3e')],_0x1cdd17))[_0x9329('0xb3')](_0x23c574[_0x9329('0x160')](_0x1cdd17))[_0x9329('0xae')](loggerCatchQueueSummary(_0x9329('0x167'),_0x1cdd17));}else{notSendMessagesCampaign(_0x1cdd17);}}}};function getCallerIdRandom(_0x5326b7,_0x397617){var _0x4cfd3c;var _0x21b341;var _0x2579e2;if(_0x397617<=0x0){_0x397617=0x1;}_0x4cfd3c=new RegExp(_0x9329('0x168')+_0x397617+'}$');_0x21b341=Math[_0x9329('0x169')](0xa,_0x397617-0x1);_0x2579e2=Math[_0x9329('0x169')](0xa,_0x397617)-0x1;return util['format']('%s',_[_0x9329('0x16a')](_0x5326b7,_0x4cfd3c,_[_0x9329('0x16b')](_0x21b341,_0x2579e2)));}function extractCalleridName(_0x1f06e9){var _0x25de5d=_0x1f06e9[_0x9329('0x16c')](/"(.*?)"/);return _0x25de5d?_0x25de5d[0x1]:_0x1f06e9;}function extractCalleridNumber(_0xdac3d0){var _0x2dda9e=_0xdac3d0[_0x9329('0x16c')](/<(.*?)>/);return _0x2dda9e?_0x2dda9e[0x1]:_0xdac3d0;}Dialer[_0x9329('0x1b')][_0x9329('0x16d')]=function(_0x74d794,_0x381ae9){var _0x57b103=this;var _0x58d657=uuid['v4']();this[_0x9329('0x24')][_0x58d657]=new Action(_0x74d794,_0x381ae9,_0x58d657);return new BPromise(function(_0x1ac570,_0x14e7cf){if(_['isUndefined'](_0x74d794)&&typeof _0x74d794!==_0x9329('0x16e')){return _0x14e7cf(msgResponse(_0x9329('0x16f'),_0x9329('0x144'),_0x9329('0x170')));}if(_[_0x9329('0x3c')](_0x381ae9['Contact']['phone'])||_0x381ae9[_0x9329('0x171')][_0x9329('0x172')]===null){return _0x14e7cf(msgResponse(_0x9329('0x16f'),_0x9329('0x144'),_0x9329('0x173')));}var _0x372d40={'XMD-CALLERID':_0x57b103[_0x9329('0x24')][_0x58d657][_0x9329('0x174')](),'XMD-AGI':_0x74d794[_0x9329('0x108')]?util['format'](_0x9329('0x175'),ipAgi,_0x74d794[_0x9329('0x108')]):_0x9329('0x176'),'XMD-AGIAFTER':_0x74d794[_0x9329('0x177')]?util['format'](_0x9329('0x175'),ipAgi,_0x74d794[_0x9329('0x177')]):_0x9329('0x176'),'XMD-QUEUE':_0x74d794[_0x9329('0x4a')]==='outbound'?util[_0x9329('0x79')]('\x22%s,%s%s,,,%s\x22',_0x74d794[_0x9329('0x3e')],_0x74d794[_0x9329('0x178')]||'',_0x74d794[_0x9329('0x179')]?'c':'',_0x74d794['dialQueueTimeout']||0x3):_0x9329('0x176'),'XMD-CONTACTID':_0x381ae9[_0x9329('0xd0')],'XMD-CDRTYPE':_0x9329('0x9'),'CALLERID(all)':_0x57b103['actions'][_0x58d657][_0x9329('0x174')](),'XMD-AMD':_0x74d794[_0x9329('0xe1')]?_0x9329('0x17a'):_0x9329('0x176'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x74d794[_0x9329('0xe1')]){_0x372d40[_0x9329('0x17b')]=_0x74d794[_0x9329('0x17c')]||0x9c4;_0x372d40[_0x9329('0x17d')]=_0x74d794['dialAMDGreeting']||0x5dc;_0x372d40['XMD-AMDAFTERGREETINGSILENCE']=_0x74d794[_0x9329('0x17e')]||0x320;_0x372d40[_0x9329('0x17f')]=_0x74d794[_0x9329('0x180')]||0x1388;_0x372d40['XMD-AMDMINWORDLENGTH']=_0x74d794[_0x9329('0x181')]||0x64;_0x372d40['XMD-AMDBETWEENWORDSSILENCE']=_0x74d794[_0x9329('0x182')]||0x32;_0x372d40[_0x9329('0x183')]=_0x74d794[_0x9329('0x184')]||0x3;_0x372d40[_0x9329('0x185')]=_0x74d794['dialAMDSilenceThreshold']||0x100;_0x372d40[_0x9329('0x186')]=_0x74d794[_0x9329('0x187')]||0x1388;}if(_0x74d794['type']===_0x9329('0x4b')){_0x372d40[_0x9329('0x188')]=_0x381ae9[_0x9329('0xd3')];}else{_0x372d40[_0x9329('0x189')]=_0x381ae9[_0x9329('0xd4')];}for(var _0x58190f in _0x381ae9[_0x9329('0x171')]){if(typeof _0x381ae9['Contact'][_0x58190f]!==_0x9329('0x99')){if(isNotNull(_0x381ae9[_0x9329('0x171')][_0x58190f])&&_0x58190f!=='id'&&_0x58190f!==_0x9329('0x18a')&&_0x58190f!==_0x9329('0x18b')&&_0x58190f!=='updatedAt'){_0x372d40[util[_0x9329('0x79')](_0x9329('0x18c'),_0x9329('0x18d'),_[_0x9329('0x18e')](_0x58190f))]=_0x381ae9[_0x9329('0x171')][_0x58190f];}}}var _0x2500a9=_0x57b103[_0x9329('0x13e')](_0x74d794[_0x9329('0x74')])?getCallerId(_0x74d794[_0x9329('0x74')][_0x9329('0x76')],_0x74d794['dialOriginateCallerIdName'],_0x74d794[_0x9329('0x18f')]>0x0?getCallerIdRandom(_0x74d794[_0x9329('0x57')],_0x74d794[_0x9329('0x18f')]):_0x74d794[_0x9329('0x57')]):getCallerId(_[_0x9329('0xdd')](_0x74d794[_0x9329('0x13f')])?_0x74d794[_0x9329('0x74')][_0x9329('0x76')]:_0x74d794[_0x9329('0x13f')][_0x9329('0x76')],_0x74d794[_0x9329('0x56')],_0x74d794[_0x9329('0x18f')]>0x0?getCallerIdRandom(_0x74d794[_0x9329('0x57')],_0x74d794[_0x9329('0x18f')]):_0x74d794['dialOriginateCallerIdNumber']);if(_0x2500a9){_0x372d40[_0x9329('0x190')]=_0x57b103[_0x9329('0x24')][_0x58d657][_0x9329('0x191')]=extractCalleridName(_0x2500a9);_0x372d40['XMD-ORIGINATECALLERIDNUM']=_0x57b103['actions'][_0x58d657]['originatecalleridnum']=extractCalleridNumber(_0x2500a9);}return ami[_0x9329('0x14b')]({'actionid':_0x58d657,'action':_0x9329('0x16f'),'channel':_0x57b103[_0x9329('0x13e')](_0x74d794['Trunk'])?util['format']('SIP/%s/%s%s',_0x74d794[_0x9329('0x74')][_0x9329('0x3e')],isNotNull(_0x74d794['dialPrefix'])?_0x74d794['dialPrefix'][_0x9329('0x192')]()||'':'',_0x74d794[_0x9329('0x193')]>0x0?_0x381ae9[_0x9329('0x171')][_0x9329('0x172')][_0x9329('0x194')](_0x74d794[_0x9329('0x193')]):_0x381ae9['Contact']['phone']):util[_0x9329('0x79')](_0x9329('0x195'),_['isNil'](_0x74d794[_0x9329('0x13f')])?_0x74d794[_0x9329('0x74')][_0x9329('0x3e')]:_0x74d794['TrunkBackup'][_0x9329('0x3e')],isNotNull(_0x74d794[_0x9329('0x59')])?_0x74d794[_0x9329('0x59')]['trim']()||'':'',_0x74d794['dialCutDigit']>0x0?_0x381ae9[_0x9329('0x171')][_0x9329('0x172')][_0x9329('0x194')](_0x74d794['dialCutDigit']):_0x381ae9[_0x9329('0x171')][_0x9329('0x172')]),'callerid':_0x2500a9,'Exten':_0x9329('0x196'),'Context':_0x9329('0x197'),'Priority':'1','variable':_0x372d40,'timeout':(_0x74d794[_0x9329('0x58')]||0x1e)*0x3e8,'async':!![],'channelid':_0x58d657})[_0x9329('0xb3')](function(_0x2d142a){return _0x1ac570(_0x2d142a);})[_0x9329('0xae')](function(_0x1c5a1e){_0x74d794[_0x9329('0x62')]+=0x1;var _0xba4bdd=new History(_0x57b103[_0x9329('0x24')][_0x58d657]);logger['error'](util['format'](_0x9329('0x198'),JSON['stringify'](_0x1c5a1e)));_0xba4bdd[_0x9329('0xe4')]=0xe;_0xba4bdd[_0x9329('0xe5')]=_0x9329('0x199');_0xba4bdd[_0x9329('0xa6')]=moment()[_0x9329('0x79')](_0x9329('0xff'));_0xba4bdd['endtime']=_0xba4bdd[_0x9329('0xa6')];_0x57b103[_0x9329('0xc9')](_0xba4bdd)[_0x9329('0xae')](loggerCatch(_0x9329('0x19a')));_0x57b103[_0x9329('0xc7')](_0xba4bdd)[_0x9329('0xae')](loggerCatch(_0x9329('0x19a')))[_0x9329('0x1d')](function(){delete _0x57b103[_0x9329('0x24')][_0x58d657];return _0x14e7cf(msgResponse(_0x9329('0x16f'),_0x9329('0x19b'),_0x9329('0x19c')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x16a2eb){var _0x4faa9e=this[_0x9329('0x24')][_0x16a2eb[_0x9329('0x121')]];if(_0x4faa9e){delete this[_0x9329('0x24')][_0x16a2eb['actionid']];_0x4faa9e[_0x9329('0x19d')]=moment()['format'](_0x9329('0xff'));var _0x414da8=_0x4faa9e[_0x9329('0x4a')]==='ivr'?this[_0x9329('0x20')][_0x4faa9e[_0x9329('0xb0')]]:this[_0x9329('0x1f')][_0x4faa9e[_0x9329('0x19e')]()];if(!this[_0x9329('0xd7')](_0x16a2eb[_0x9329('0x19f')])){this[_0x9329('0xaf')](_0x414da8);return this['callProgressDetecting'](_0x4faa9e,_0x414da8,_0x16a2eb)['catch'](loggerCatch(_0x9329('0x1a0')));}this[_0x9329('0x25')][_0x16a2eb['uniqueid']]=_0x4faa9e;}};Dialer[_0x9329('0x1b')][_0x9329('0x1a1')]=function(_0x47735e,_0x521c86,_0xaeeb72){var _0x3b94e4=new History(_0x521c86);if(_0x3b94e4['countbusyretry']+_0x3b94e4['countcongestionretry']+_0x3b94e4[_0x9329('0xf2')]+_0x3b94e4[_0x9329('0xf3')]+_0x3b94e4[_0x9329('0xf4')]+_0x3b94e4[_0x9329('0xf5')]+_0x3b94e4[_0x9329('0xef')]+_0x3b94e4[_0x9329('0xf6')]>=_0xaeeb72[_0x9329('0xf7')]-0x1){return!![];}switch(_0x47735e){case 0x3:if(_0x3b94e4[_0x9329('0xf2')]>=_0xaeeb72[_0x9329('0x1a2')]-0x1){return!![];}this[_0x9329('0xbd')]({'active':![],'countnoanswerretry':_0x3b94e4[_0x9329('0xf2')]+=0x1,'scheduledat':moment()[_0x9329('0xfc')](_0xaeeb72[_0x9329('0x1a3')],_0x9329('0xfe'))[_0x9329('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3b94e4[_0x9329('0xd0')],'ListId':_0x3b94e4[_0x9329('0xd1')],'VoiceQueueId':_0x3b94e4[_0x9329('0xd3')]||undefined,'CampaignId':_0x3b94e4[_0x9329('0xd4')]||undefined})[_0x9329('0xae')](loggerCatch(_0x9329('0x1a4')));break;case 0x5:if(_0x3b94e4[_0x9329('0x105')]>=_0xaeeb72[_0x9329('0x1a5')]-0x1){return!![];}this[_0x9329('0xbd')]({'active':![],'countbusyretry':_0x3b94e4[_0x9329('0x105')]+=0x1,'scheduledat':moment()[_0x9329('0xfc')](_0xaeeb72[_0x9329('0x1a6')],'minutes')['format'](_0x9329('0xff')),'ContactId':_0x3b94e4[_0x9329('0xd0')],'ListId':_0x3b94e4[_0x9329('0xd1')],'VoiceQueueId':_0x3b94e4['VoiceQueueId']||undefined,'CampaignId':_0x3b94e4[_0x9329('0xd4')]||undefined})[_0x9329('0xae')](loggerCatch(_0x9329('0x1a7')));break;case 0x8:if(_0x3b94e4[_0x9329('0xf1')]>=_0xaeeb72['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x3b94e4[_0x9329('0xf1')]+=0x1,'scheduledat':moment()[_0x9329('0xfc')](_0xaeeb72[_0x9329('0x1a8')],_0x9329('0xfe'))['format'](_0x9329('0xff')),'ContactId':_0x3b94e4[_0x9329('0xd0')],'ListId':_0x3b94e4[_0x9329('0xd1')],'VoiceQueueId':_0x3b94e4[_0x9329('0xd3')]||undefined,'CampaignId':_0x3b94e4[_0x9329('0xd4')]||undefined})[_0x9329('0xae')](loggerCatch(_0x9329('0x1a9')));break;case 0x0:if(_0x3b94e4['countnosuchnumberretry']>=_0xaeeb72[_0x9329('0x1aa')]-0x1){return!![];}else{this[_0x9329('0xbd')]({'active':![],'countnosuchnumberretry':_0x3b94e4[_0x9329('0xf3')]+=0x1,'scheduledat':moment()[_0x9329('0xfc')](_0xaeeb72[_0x9329('0x1ab')],_0x9329('0xfe'))[_0x9329('0x79')](_0x9329('0xff')),'ContactId':_0x3b94e4[_0x9329('0xd0')],'ListId':_0x3b94e4[_0x9329('0xd1')],'VoiceQueueId':_0x3b94e4['VoiceQueueId']||undefined,'CampaignId':_0x3b94e4[_0x9329('0xd4')]||undefined})[_0x9329('0xae')](loggerCatch(_0x9329('0x1ac')));}break;case 0xa:if(_0x3b94e4[_0x9329('0xf4')]>=_0xaeeb72[_0x9329('0x118')]-0x1){return!![];}this[_0x9329('0xbd')]({'active':![],'countdropretry':_0x3b94e4[_0x9329('0xf4')]+=0x1,'scheduledat':moment()['add'](_0xaeeb72[_0x9329('0x1ad')],_0x9329('0xfe'))[_0x9329('0x79')](_0x9329('0xff')),'ContactId':_0x3b94e4[_0x9329('0xd0')],'ListId':_0x3b94e4['ListId'],'VoiceQueueId':_0x3b94e4[_0x9329('0xd3')]||undefined,'CampaignId':_0x3b94e4[_0x9329('0xd4')]||undefined})[_0x9329('0xae')](loggerCatch(_0x9329('0x1ae')));break;case 0xb:if(_0x3b94e4[_0x9329('0xf5')]>=_0xaeeb72[_0x9329('0x1af')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x3b94e4['countabandonedretry']+=0x1,'scheduledat':moment()[_0x9329('0xfc')](_0xaeeb72[_0x9329('0x11d')],'minutes')[_0x9329('0x79')](_0x9329('0xff')),'ContactId':_0x3b94e4[_0x9329('0xd0')],'ListId':_0x3b94e4[_0x9329('0xd1')],'VoiceQueueId':_0x3b94e4['VoiceQueueId']||undefined,'CampaignId':_0x3b94e4[_0x9329('0xd4')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x3b94e4[_0x9329('0xef')]>=_0xaeeb72[_0x9329('0xfa')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x3b94e4[_0x9329('0xef')]+=0x1,'scheduledat':moment()[_0x9329('0xfc')](_0xaeeb72[_0x9329('0xfd')],_0x9329('0xfe'))[_0x9329('0x79')](_0x9329('0xff')),'ContactId':_0x3b94e4[_0x9329('0xd0')],'ListId':_0x3b94e4[_0x9329('0xd1')],'VoiceQueueId':_0x3b94e4[_0x9329('0xd3')]||undefined,'CampaignId':_0x3b94e4[_0x9329('0xd4')]||undefined})[_0x9329('0xae')](loggerCatch(_0x9329('0x100')));break;case 0x14:if(_0x3b94e4[_0x9329('0xf6')]>=_0xaeeb72[_0x9329('0x1b0')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x3b94e4[_0x9329('0xf6')]+=0x1,'scheduledat':moment()[_0x9329('0xfc')](_0xaeeb72[_0x9329('0x1b1')],_0x9329('0xfe'))[_0x9329('0x79')](_0x9329('0xff')),'ContactId':_0x3b94e4[_0x9329('0xd0')],'ListId':_0x3b94e4[_0x9329('0xd1')],'VoiceQueueId':_0x3b94e4[_0x9329('0xd3')]||undefined,'CampaignId':_0x3b94e4[_0x9329('0xd4')]||undefined})[_0x9329('0xae')](loggerCatch(_0x9329('0x1b2')));break;default:return!![];}};Dialer['prototype'][_0x9329('0x1b3')]=function(_0x2dce9a,_0x1cc81e,_0x20def3){var _0x1cf1a3=this;var _0x5bb63f=new History(_0x2dce9a);return new BPromise(function(_0x5b58ab,_0x53ea7c){if(_['isUndefined'](_0x1cc81e)&&typeof _0x1cc81e!==_0x9329('0x16e')){return _0x53ea7c(msgResponse('[callProgressDetecting]',_0x9329('0x144'),_0x9329('0x1b4')));}if(_[_0x9329('0x3c')](_0x20def3)&&typeof _0x20def3!==_0x9329('0x16e')){return _0x53ea7c(msgResponse(_0x9329('0x1b5'),_0x9329('0x144'),_0x9329('0x1b6')));}switch(_0x20def3[_0x9329('0x10d')]){case'0':_0x1cc81e[_0x9329('0x1b7')]+=0x1;_0x5bb63f[_0x9329('0xe4')]=0x0;_0x5bb63f['statedesc']='NoSuchNumber';_0x5bb63f[_0x9329('0xf3')]+=0x1;_0x5bb63f[_0x9329('0x104')]+=0x1;ami[_0x9329('0x49')]('custom:agentnosuchnumber',ut[_0x9329('0xea')](_0x2dce9a,'nosuchnumber'));_0x1cf1a3[_0x9329('0xc9')](_0x5bb63f)['catch'](loggerCatch(_0x9329('0xf0')));if(_0x1cf1a3[_0x9329('0x1a1')](0x0,_0x2dce9a,_0x1cc81e)){if(_0x5bb63f[_0x9329('0xf3')]>=_0x1cc81e[_0x9329('0x1aa')]){_0x1cf1a3[_0x9329('0xfb')](_0x5bb63f,_0x5b58ab,_0x53ea7c,_0x9329('0x1b8'));}else{_0x1cf1a3['stateGlobal'](_0x5bb63f,_0x5b58ab,_0x53ea7c,_0x9329('0x1b8'));}}break;case'3':_0x1cc81e['outboundNoAnswerCallsDay']+=0x1;_0x5bb63f[_0x9329('0xe4')]=0x3;_0x5bb63f[_0x9329('0xe5')]=_0x9329('0x1b9');_0x5bb63f[_0x9329('0xf2')]+=0x1;_0x5bb63f[_0x9329('0x104')]+=0x1;ami[_0x9329('0x49')](_0x9329('0x1ba'),ut[_0x9329('0xea')](_0x2dce9a,_0x9329('0x1bb')));_0x1cf1a3['createHistory'](_0x5bb63f)['catch'](loggerCatch(_0x9329('0x1bc')));if(_0x1cf1a3[_0x9329('0x1a1')](0x3,_0x2dce9a,_0x1cc81e)){if(_0x5bb63f[_0x9329('0xf2')]>=_0x1cc81e['dialNoAnswerMaxRetry']){_0x1cf1a3[_0x9329('0xfb')](_0x5bb63f,_0x5b58ab,_0x53ea7c,'reason\x203\x20ringing\x20no\x20answer');}else{_0x1cf1a3['stateGlobal'](_0x5bb63f,_0x5b58ab,_0x53ea7c,_0x9329('0x1bd'));}}break;case'5':_0x1cc81e['outboundBusyCallsDay']+=0x1;_0x5bb63f['state']=0x5;_0x5bb63f['statedesc']=_0x9329('0x1be');_0x5bb63f['countbusyretry']+=0x1;_0x5bb63f[_0x9329('0x104')]+=0x1;ami[_0x9329('0x49')]('custom:agentbusy',ut['buildObj'](_0x2dce9a,_0x9329('0x1bf')));_0x1cf1a3[_0x9329('0xc9')](_0x5bb63f)[_0x9329('0xae')](loggerCatch(_0x9329('0x1c0')));if(_0x1cf1a3[_0x9329('0x1a1')](0x5,_0x2dce9a,_0x1cc81e)){if(_0x5bb63f[_0x9329('0x105')]>=_0x1cc81e[_0x9329('0x1a5')]){_0x1cf1a3[_0x9329('0xfb')](_0x5bb63f,_0x5b58ab,_0x53ea7c,_0x9329('0x1c1'));}else{_0x1cf1a3[_0x9329('0xf8')](_0x5bb63f,_0x5b58ab,_0x53ea7c,_0x9329('0x1c1'));}}break;case'8':_0x1cc81e[_0x9329('0x5d')]+=0x1;_0x5bb63f[_0x9329('0xe4')]=0x8;_0x5bb63f['statedesc']='Congestion';_0x5bb63f[_0x9329('0xf1')]+=0x1;_0x5bb63f[_0x9329('0x104')]+=0x1;ami[_0x9329('0x49')](_0x9329('0x1c2'),ut[_0x9329('0xea')](_0x2dce9a,'congestion'));_0x1cf1a3[_0x9329('0xc9')](_0x5bb63f)[_0x9329('0xae')](loggerCatch(_0x9329('0x1c3')));if(_0x1cf1a3[_0x9329('0x1a1')](0x8,_0x2dce9a,_0x1cc81e)){if(_0x5bb63f[_0x9329('0xf1')]>=_0x1cc81e[_0x9329('0x1c4')]){_0x1cf1a3[_0x9329('0xfb')](_0x5bb63f,_0x5b58ab,_0x53ea7c,_0x9329('0x1c5'));}else{_0x1cf1a3[_0x9329('0xf8')](_0x5bb63f,_0x5b58ab,_0x53ea7c,_0x9329('0x1c5'));}}break;case'11':_0x1cc81e[_0x9329('0x1c6')]+=0x1;_0x5bb63f['state']=0xb;_0x5bb63f['statedesc']=_0x9329('0x1c7');_0x5bb63f[_0x9329('0xf5')]+=0x1;_0x5bb63f[_0x9329('0x104')]+=0x1;_0x1cf1a3[_0x9329('0xc9')](_0x5bb63f)[_0x9329('0xae')](loggerCatch(_0x9329('0x11f')));if(_0x1cf1a3['checkRetriveMax'](0xb,_0x2dce9a,_0x1cc81e)){if(_0x5bb63f[_0x9329('0xf5')]>=_0x1cc81e[_0x9329('0x1af')]){_0x1cf1a3['createStateFinal'](_0x5bb63f,_0x5b58ab,_0x53ea7c,'reason\x2011\x20abandoned');}else{_0x1cf1a3[_0x9329('0xf8')](_0x5bb63f,_0x5b58ab,_0x53ea7c,_0x9329('0x1c8'));}}break;case'20':_0x1cc81e['outboundRejectCallsDay']+=0x1;_0x5bb63f['state']=0x14;_0x5bb63f[_0x9329('0xe5')]=_0x9329('0x1c9');_0x5bb63f[_0x9329('0xf6')]+=0x1;_0x5bb63f[_0x9329('0x104')]+=0x1;ami[_0x9329('0x49')](_0x9329('0x1ca'),ut[_0x9329('0xea')](_0x2dce9a,_0x9329('0x1cb')));_0x1cf1a3[_0x9329('0xc9')](_0x5bb63f)[_0x9329('0xae')](loggerCatch(_0x9329('0x1cc')));if(_0x1cf1a3[_0x9329('0x1a1')](0x14,_0x2dce9a,_0x1cc81e)){if(_0x5bb63f[_0x9329('0xf6')]>=_0x1cc81e[_0x9329('0x1b0')]){_0x1cf1a3[_0x9329('0xfb')](_0x5bb63f,_0x5b58ab,_0x53ea7c,_0x9329('0x1cd'));}else{_0x1cf1a3[_0x9329('0xf8')](_0x5bb63f,_0x5b58ab,_0x53ea7c,_0x9329('0x1cd'));}}break;default:_0x1cc81e['outboundUnknownCallsDay']+=0x1;_0x5bb63f['state']=0xc;_0x5bb63f[_0x9329('0xe5')]=_0x20def3[_0x9329('0x10d')];_0x1cf1a3[_0x9329('0xc9')](_0x5bb63f)[_0x9329('0xae')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x1cf1a3[_0x9329('0x1a1')](_0x20def3[_0x9329('0x10d')],_0x2dce9a,_0x1cc81e)){if(_0x5bb63f[_0x9329('0x105')]+_0x5bb63f[_0x9329('0xf1')]+_0x5bb63f[_0x9329('0xf2')]+_0x5bb63f['countnosuchnumberretry']+_0x5bb63f['countdropretry']+_0x5bb63f[_0x9329('0xf5')]+_0x5bb63f['countmachineretry']+_0x5bb63f[_0x9329('0xf6')]>=_0x1cc81e[_0x9329('0xf7')]){_0x1cf1a3[_0x9329('0xf8')](_0x5bb63f,_0x5b58ab,_0x53ea7c,_0x20def3[_0x9329('0x10d')]);}else{_0x1cf1a3['createStateFinal'](_0x5bb63f,_0x5b58ab,_0x53ea7c,_0x20def3[_0x9329('0x10d')]);}}}});};Dialer[_0x9329('0x1b')][_0x9329('0xf8')]=function(_0x1c3801,_0x14abb1,_0x394dca,_0x267c2f){var _0x2ec28b=new Final(_0x1c3801);_0x2ec28b[_0x9329('0xe4')]=0xf;_0x2ec28b[_0x9329('0xe5')]=_0x9329('0x1ce');this['createStateFinal'](_0x2ec28b,_0x14abb1,_0x394dca,_0x267c2f);};Dialer[_0x9329('0x1b')]['createStateFinal']=function(_0x476400,_0x2acb3b,_0x5f4b0c,_0x3b9906){this[_0x9329('0xc7')](_0x476400)[_0x9329('0xb3')](function(){return _0x2acb3b(msgResponse('[callProgressDetecting]',_0x9329('0x1cf'),_0x3b9906));})[_0x9329('0xae')](function(){return _0x5f4b0c(msgResponse('[moveContactManagedDialer][0]',_0x9329('0x144'),'contact\x20not\x20moved'));});};Dialer[_0x9329('0x1b')][_0x9329('0xb')]=function(_0x5a029a){var _0x2bf2b4=_0x5a029a['dialPredictiveOptimizationPercentage']/0x64;var _0x17fc8d=_0x5a029a[_0x9329('0x60')]/(_0x5a029a['outboundDropCallsDayTimeout']+_0x5a029a['outboundAnswerCallsDay']);var _0x493037=Math['round'](_0x5a029a[_0x9329('0x6d')]*(_0x5a029a[_0x9329('0x1d0')]/0x64));var _0x368baa=Math[_0x9329('0x1d1')](_0x5a029a[_0x9329('0x6d')]*(_0x5a029a[_0x9329('0x1d2')]/0x64));var _0x43f845=_0x5a029a[_0x9329('0x4d')]+_0x5a029a[_0x9329('0x51')];var _0x6ddedd=Math[_0x9329('0x1d3')](_0x5a029a[_0x9329('0x70')]*_0x5a029a['erlangAbandonmentRate']*_0x5a029a[_0x9329('0x1d4')]*_0x5a029a[_0x9329('0x6b')]);if(_[_0x9329('0x3c')](_0x5a029a[_0x9329('0x28')])){if(!_[_0x9329('0x3c')](_0x5a029a[_0x9329('0x27')])){_0x5a029a[_0x9329('0x27')]=undefined;loggerPredictive[_0x9329('0x95')]('[startMethodPredictive][StartProgressive]',_0x9329('0x1d5'));}if(!_[_0x9329('0x3c')](_0x5a029a[_0x9329('0x90')])){loggerPredictive[_0x9329('0x95')](_0x9329('0x1d6'),_0x9329('0x1d7'));clearInterval(_0x5a029a['handlePredictive']);_0x5a029a['handlePredictive']=undefined;}_0x5a029a[_0x9329('0x28')]=moment()[_0x9329('0x79')](_0x9329('0xff'));loggerPredictive[_0x9329('0x7c')](_0x5a029a['name'],_0x9329('0x1d8'),_0x5a029a[_0x9329('0x28')]);this[_0x9329('0x15b')](_0x5a029a,0x1);}else if(ifInterval(_0x5a029a[_0x9329('0x1d9')],_0x5a029a[_0x9329('0x28')])){this[_0x9329('0x15b')](_0x5a029a,0x1);loggerPredictiveCalls[_0x9329('0x7c')]('[startMethodPredictive][StartProgressive][Loop]',_0x5a029a['startProgressive'],_0x5a029a['name']);_0x5a029a[_0x9329('0x70')]=0x0;_0x5a029a[_0x9329('0x6a')]=0x0;}else if(_0x2bf2b4<_0x17fc8d&&_0x5a029a['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x5a029a);loggerPredictive[_0x9329('0x7c')](_0x9329('0x1da'),'Dropped\x20calls\x20day',_0x17fc8d,_0x9329('0x28'),_0x5a029a[_0x9329('0x3e')]);}else if(_0x6ddedd<_0x5a029a['predictiveIntervalErlangCallsDroppedCalls']&&_0x5a029a[_0x9329('0x1db')]==='dropRate'){freeVariablesPredictive(_0x5a029a);loggerPredictive[_0x9329('0x7c')](_0x9329('0x1dc'),'Max\x20Drop\x20',_0x6ddedd,'Drop\x20in\x20this\x20interval',_0x5a029a['predictiveIntervalErlangCallsDroppedCalls'],_0x9329('0x28'),_0x5a029a[_0x9329('0x3e')]);}else if(!ifInterval(_0x5a029a[_0x9329('0x1d9')],_0x5a029a['startProgressive'])&&_[_0x9329('0x3c')](_0x5a029a[_0x9329('0x27')])&&!_['isUndefined'](_0x5a029a[_0x9329('0x28')])){_0x5a029a['startPredictive']=moment()[_0x9329('0x79')](_0x9329('0xff'));loggerPredictive[_0x9329('0x7c')](_0x5a029a['name'],'started\x20in\x20predictive\x20at',_0x5a029a[_0x9329('0x27')]);this[_0x9329('0xba')](_0x5a029a[_0x9329('0x1d9')])[_0x9329('0xb3')](this[_0x9329('0x1dd')](_0x5a029a))[_0x9329('0xb3')](mergeDataErlangB(_0x5a029a))[_0x9329('0xb3')](this[_0x9329('0x1de')](_0x5a029a))[_0x9329('0xae')](loggerCatchPredictive(_0x9329('0x1df'),_0x5a029a));}else if(!ifInterval(_0x5a029a['dialPredictiveInterval'],_0x5a029a[_0x9329('0x27')])){_0x5a029a['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x5a029a['startPredictive']=moment()[_0x9329('0x79')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x9329('0x7c')](_0x5a029a[_0x9329('0x3e')],_0x9329('0x1e0'),_0x5a029a[_0x9329('0x27')]);clearInterval(_0x5a029a[_0x9329('0x90')]);_0x5a029a[_0x9329('0x90')]=undefined;this[_0x9329('0xba')](_0x5a029a[_0x9329('0x1d9')])[_0x9329('0xb3')](this[_0x9329('0x1dd')](_0x5a029a))[_0x9329('0xb3')](mergeDataErlangB(_0x5a029a))[_0x9329('0xb3')](this['startMethodPredictive'](_0x5a029a))[_0x9329('0xae')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x5a029a));}else if(_0x5a029a['predictiveIntervalAvailable']&&_0x43f845<_0x5a029a[_0x9329('0x6d')]-_0x368baa){freeVariablesPredictive(_0x5a029a);loggerPredictive[_0x9329('0x7c')](_0x5a029a['name'],_0x9329('0x1e1'),_0x43f845,_0x9329('0x1e2'),_0x5a029a['predictiveIntervalAvailable'],'-',_0x368baa,'=',_0x5a029a['predictiveIntervalAvailable']-_0x368baa,')');}else if(_0x5a029a[_0x9329('0x6d')]&&_0x43f845>_0x5a029a[_0x9329('0x6d')]+_0x493037){freeVariablesPredictive(_0x5a029a);loggerPredictive[_0x9329('0x7c')](_0x5a029a[_0x9329('0x3e')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x43f845,_0x9329('0x1e3'),_0x5a029a['predictiveIntervalAvailable'],'+',_0x493037,'=',_0x5a029a[_0x9329('0x6d')]+_0x493037,')');}};Dialer[_0x9329('0x1b')][_0x9329('0x1dd')]=function(_0x351cbe){var _0x4cfbf5=this;return function(_0x182fcf){return new BPromise(function(_0x4bee59,_0x2348a5){_['merge'](_0x351cbe,_0x182fcf[0x0]);if(checkGetDataPredictive(_0x182fcf[0x0])){var _0x140ced=_0x351cbe[_0x9329('0x6d')]=_0x351cbe[_0x9329('0x51')]+_0x351cbe[_0x9329('0x4d')];var _0x1d0e48=_0x351cbe['dialPredictiveInterval']*0x3c;var _0xa59dc5=_0x182fcf[0x0][_0x9329('0x68')]+_0x182fcf[0x0]['predictiveIntervalAvgHoldtime'];var _0x10cef2=(_0x182fcf[0x0][_0x9329('0x66')]+_0x182fcf[0x0][_0x9329('0x80')]+_0x182fcf[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x182fcf[0x0][_0x9329('0x6e')];_0x351cbe[_0x9329('0x1d4')]=_0x10cef2>0x0?_0x10cef2:0x1;switch(_0x351cbe[_0x9329('0x1db')]){case _0x9329('0x1e4'):var _0x273ba5=_0x351cbe[_0x9329('0x1e5')]/0x64;return _0x4cfbf5[_0x9329('0x1e6')](_0x140ced,_0x1d0e48,_0xa59dc5,_0x10cef2,_0x273ba5)[_0x9329('0xb3')](function(_0x293144){return _0x4bee59(_0x293144);});case _0x9329('0x1e7'):var _0x556b98=_0x351cbe[_0x9329('0x1e5')]/0x64;return _0x4cfbf5['busyFactor'](_0x140ced,_0x1d0e48,_0xa59dc5,_0x10cef2,_0x556b98)[_0x9329('0xb3')](function(_0x4e5b73){return _0x4bee59(_0x4e5b73);});default:return _0x2348a5(msgResponse('[getDataPredictive]',_0x9329('0x144'),_0x9329('0x1e8')));}}else{return _0x2348a5(msgResponse('[getDataPredictive]',_0x9329('0x144'),'check\x20failure'));}});};};Dialer[_0x9329('0x1b')]['getDataPredictiveOld']=function(_0x3344dc){var _0x15557e=this;return function(_0x5c7218){return new BPromise(function(_0x3bc034,_0x5d390a){_['merge'](_0x3344dc,_0x5c7218[0x0]);if(checkGetDataPredictive(_0x5c7218[0x0])){loggerPredictive['info'](JSON[_0x9329('0x46')](_0x5c7218[0x0]));if(_0x3344dc[_0x9329('0x1db')]===_0x9329('0x1e4')){return _0x15557e[_0x9329('0xc5')](_0x3344dc['id'])[_0x9329('0xb3')](function(_0x2be122){var _0x1711a3=_0x3344dc['loggedIn']-_0x2be122[0x0][_0x9329('0x1e9')];var _0x453d2d=_0x3344dc[_0x9329('0x1d9')]*0x3c;var _0x5f527b=_0x5c7218[0x0]['predictiveIntervalAvgTalktime']+_0x5c7218[0x0]['predictiveIntervalAvgHoldtime'];var _0x2709ba=(_0x5c7218[0x0][_0x9329('0x66')]+_0x5c7218[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5c7218[0x0][_0x9329('0x69')])/_0x5c7218[0x0]['predictiveIntervalTotalCalls'];var _0x2e0817=_0x3344dc['dialPredictiveOptimizationPercentage']/0x64;_0x3344dc[_0x9329('0x6c')]=_0x2be122[0x0][_0x9329('0x1e9')]||0x0;_0x3344dc[_0x9329('0x1d4')]=_0x2709ba>0x0?_0x2709ba:0x1;return _0x15557e[_0x9329('0x1e6')](_0x1711a3,_0x453d2d,_0x5f527b,_0x2709ba,_0x2e0817);})[_0x9329('0xb3')](function(_0x27dd28){return _0x3bc034(_0x27dd28);})['catch'](function(_0x84417f){return _0x5d390a(msgResponse(_0x9329('0x1ea'),'Failure',JSON[_0x9329('0x46')](_0x84417f)));});}if(_0x3344dc[_0x9329('0x1db')]==='agentBusyFactor'){return _0x15557e[_0x9329('0xc5')](_0x3344dc['id'])[_0x9329('0xb3')](function(_0x4cf40e){var _0x26fabd=_0x3344dc[_0x9329('0x4e')]-_0x4cf40e[0x0][_0x9329('0x1e9')];var _0x564855=_0x3344dc[_0x9329('0x1d9')]*0x3c;var _0x3b74a1=_0x5c7218[0x0][_0x9329('0x68')]+_0x5c7218[0x0][_0x9329('0x67')];var _0x42bc64=(_0x5c7218[0x0]['predictiveIntervalAnsweredCalls']+_0x5c7218[0x0][_0x9329('0x80')]+_0x5c7218[0x0][_0x9329('0x69')])/_0x5c7218[0x0]['predictiveIntervalTotalCalls'];var _0x6df8de=_0x3344dc['dialPredictiveOptimizationPercentage']/0x64;_0x3344dc[_0x9329('0x6c')]=_0x4cf40e[0x0]['outboundQueuePauses']||0x0;_0x3344dc[_0x9329('0x1d4')]=_0x42bc64>0x0?_0x42bc64:0x1;return _0x15557e[_0x9329('0x1eb')](_0x26fabd,_0x564855,_0x3b74a1,_0x42bc64,_0x6df8de);})['then'](function(_0x3e9d6e){return _0x3bc034(_0x3e9d6e);})['catch'](function(_0x41ad95){return _0x5d390a(msgResponse(_0x9329('0x1ea'),_0x9329('0x144'),JSON['stringify'](_0x41ad95)));});}}else{return _0x5d390a(msgResponse(_0x9329('0x1ec'),'Failure',_0x9329('0x1ed')));}});};};Dialer[_0x9329('0x1b')][_0x9329('0x1de')]=function(_0x2958a2){var _0x21d55b=this;return function(){var _0xfd3c2d=0x0;var _0x261a95=Math[_0x9329('0x1d3')](_0x2958a2['erlangCallToSecond']*0x3e8);if(_0x261a95>0x0){_0x261a95=_0x261a95<0x64?0x64:_0x261a95;loggerPredictive[_0x9329('0x7c')](_0x2958a2[_0x9329('0x3e')],_0x9329('0x1ee'),_0x261a95,'milliseconds');_0x2958a2['handlePredictive']=setInterval(function(){_0x21d55b[_0x9329('0x90')](_0x2958a2);loggerPredictiveCalls[_0x9329('0x7c')](_0x9329('0x1ef'),_0xfd3c2d+=0x1);},_0x261a95);}else{loggerPredictive[_0x9329('0x7c')](_0x2958a2[_0x9329('0x3e')],_0x9329('0x1f0'));}};};Dialer[_0x9329('0x1b')][_0x9329('0x1f1')]=function(_0x34cf52,_0x5b7009){var _0xb9c02c=this;return function(_0x2f37e3){if(_[_0x9329('0x44')](_0x2f37e3)){if(_[_0x9329('0xdd')](_0x5b7009['UserId'])||!_0x5b7009[_0x9329('0x1f2')]){if(_0x34cf52[_0x9329('0x159')]===_0x9329('0xa')){_0x34cf52[_0x9329('0x12a')]=_[_0x9329('0x3c')](_0x34cf52[_0x9329('0x12a')])?!![]:_0x34cf52[_0x9329('0x12a')];var _0x41c046=uuid['v4']();_0xb9c02c[_0x9329('0x24')][_0x41c046]=new Action(_0x34cf52,_0x5b7009,_0x41c046);loggerBooked[_0x9329('0x7c')]('[booked][checkContactBlack]',_0x41c046,_0x9329('0x1f3'),JSON[_0x9329('0x46')](_0x34cf52[_0x9329('0x12a')]),_0x9329('0x1f4'),_0x34cf52[_0x9329('0x3e')]);if(_0x34cf52[_0x9329('0x12a')]){_0x34cf52['queueStatusComplete']=![];_0xb9c02c[_0x9329('0x2a')][_0xb9c02c[_0x9329('0x24')][_0x41c046][_0x9329('0xb0')]]=[];ami[_0x9329('0x14b')]({'actionid':_0x41c046,'action':_0x9329('0x1f5'),'queue':_0x34cf52[_0x9329('0x3e')]})['catch'](function(){_0xb9c02c[_0x9329('0xaf')](_0x34cf52);_0xb9c02c[_0x9329('0xbd')]({'active':![],'ContactId':_0xb9c02c[_0x9329('0x24')][_0x41c046][_0x9329('0xd0')],'ListId':_0xb9c02c[_0x9329('0x24')][_0x41c046]['ListId'],'VoiceQueueId':_0xb9c02c[_0x9329('0x24')][_0x41c046][_0x9329('0xd3')]||undefined,'CampaignId':_0xb9c02c[_0x9329('0x24')][_0x41c046][_0x9329('0xd4')]||undefined})[_0x9329('0xae')](loggerCatch(_0x9329('0x1f6')));delete _0xb9c02c['actions'][_0x41c046];});}else{loggerBooked['info'](_0x9329('0x1f7'),JSON['stringify'](_0x34cf52['queueStatusComplete']),_0x9329('0x1f4'),_0x34cf52[_0x9329('0x3e')]);_0xb9c02c['updateOriginated'](_0x34cf52);_0xb9c02c[_0x9329('0xbd')]({'active':![],'ContactId':_0xb9c02c[_0x9329('0x24')][_0x41c046][_0x9329('0xd0')],'ListId':_0xb9c02c[_0x9329('0x24')][_0x41c046][_0x9329('0xd1')],'VoiceQueueId':_0xb9c02c[_0x9329('0x24')][_0x41c046][_0x9329('0xd3')]||undefined,'CampaignId':_0xb9c02c[_0x9329('0x24')][_0x41c046][_0x9329('0xd4')]||undefined})[_0x9329('0xae')](loggerCatch(_0x9329('0x1f6')));delete _0xb9c02c[_0x9329('0x24')][_0x41c046];}}else{return _0xb9c02c['actionOriginate'](_0x34cf52,_0x5b7009);}}else{if(getDiff(_0x5b7009[_0x9329('0x1f8')])<_0x34cf52[_0x9329('0x1f9')]*0x3c){if(_0x5b7009['Agent']&&!_0x5b7009[_0x9329('0x1fa')][_0x9329('0x1fb')]){_0xb9c02c[_0x9329('0x1e')][_0x9329('0x12d')](_0x5b7009['id'])[_0x9329('0x1d')](function(){_0xb9c02c[_0x9329('0xaf')](_0x34cf52);});}else{_0xb9c02c[_0x9329('0xbf')]({'active':![]},_0x5b7009['id'],0x1)['finally'](function(){_0xb9c02c[_0x9329('0xaf')](_0x34cf52);});}}else{_0x34cf52[_0x9329('0x63')]+=0x1;_0xb9c02c['updateOriginated'](_0x34cf52);if(_0x34cf52['dialRecallInQueue']){_0xb9c02c['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5b7009[_0x9329('0xd0')],'ListId':_0x5b7009[_0x9329('0xd1')],'VoiceQueueId':_0x5b7009['VoiceQueueId']||undefined,'CampaignId':_0x5b7009[_0x9329('0xd4')]||undefined})['catch'](loggerCatch(_0x9329('0x1fc')));_0xb9c02c[_0x9329('0xc9')](createObjHistory(_0x34cf52,_0x5b7009,_0x9329('0x1fd'),0x17,'RecallInQueue'))['catch'](loggerCatch(_0x9329('0x1fe')));}else{_0xb9c02c[_0x9329('0xce')](createObjHistory(_0x34cf52,_0x5b7009,_0x9329('0x1ff'),0x16,_0x9329('0x200')),'[Originate][HistoryRecallClose][historyCatch]',_0x9329('0x201'));}}}}else{_0x34cf52[_0x9329('0x5c')]+=0x1;_0xb9c02c[_0x9329('0xce')](createObjHistory(_0x34cf52,_0x5b7009,_0x9329('0x202'),0xd,'Blacklist'),_0x9329('0x203'),'[Originate][MoveBlacklist]');throw _0x9329('0x204');}};};Dialer[_0x9329('0x1b')]['handleIvr']=function(_0x4163cb){var _0x4ca14f=this;var _0x1d955b=_0x4163cb['limitCalls']-_0x4163cb['originated']-_0x4163cb[_0x9329('0xc2')];emitCampaignSummary(_0x4163cb);if(_0x1d955b>0x0){if(_0x1d955b>this[_0x9329('0x23')]){_0x1d955b=this[_0x9329('0x23')];}_0x4163cb[_0x9329('0xc2')]+=_0x1d955b;this['getContactDialerIvr'](_0x4163cb['id'],_0x1d955b,_0x4163cb[_0x9329('0x205')],_0x4163cb)[_0x9329('0xb3')](function(_0x5e3e63){_0x4163cb['temp']-=_0x1d955b;_0x4163cb[_0x9329('0xc2')]=_0x4163cb['temp']>0x0?_0x4163cb[_0x9329('0xc2')]:0x0;if(!checkContactEmpty(_0x5e3e63)){_0x4163cb[_0x9329('0x3d')]=_0x9329('0x206');logger[_0x9329('0x7c')](_0x9329('0x207')+_0x4163cb[_0x9329('0x3e')]);}else{_0x4163cb['originated']+=_0x5e3e63['length'];_0x4163cb[_0x9329('0x3d')]=_0x9329('0x208');for(var _0x1ed879=0x0;_0x1ed879<_0x5e3e63[_0x9329('0x98')];_0x1ed879+=0x1){_0x4163cb[_0x9329('0x209')]+=0x1;if(_[_0x9329('0xdd')](_0x5e3e63[_0x1ed879])||_[_0x9329('0xdd')](_0x5e3e63[_0x1ed879][_0x9329('0x171')])||_[_0x9329('0xdd')](_0x5e3e63[_0x1ed879][_0x9329('0x171')][_0x9329('0x172')])){_0x4ca14f[_0x9329('0xcc')]('[actionOriginate]\x20',_0x4163cb,_0x5e3e63[_0x1ed879]);}else{_0x4ca14f[_0x9329('0xb9')](_[_0x9329('0x127')](_0x5e3e63[_0x1ed879],[_0x9329('0xd4'),_0x9329('0x20a')]))['then'](_0x4ca14f[_0x9329('0x1f1')](_0x4163cb,_0x5e3e63[_0x1ed879]))[_0x9329('0xae')](_0x4ca14f[_0x9329('0xcb')](_0x9329('0x20b'),_0x4163cb));}}}})[_0x9329('0xae')](loggerGetContactDialer('[getContactCampaign2]',_0x4163cb,_0x1d955b));}};Dialer[_0x9329('0x1b')][_0x9329('0x15b')]=function(_0xb3875d,_0x3800de){var _0x3c3db1=this;var _0x5406db=[];var _0x26b296=_0x3800de>=0x1?_0x3800de:0x1;if(_0xb3875d[_0x9329('0x159')]==='booked'){_0x26b296=0x1;}var _0x1019aa=Math[_0x9329('0x1d3')](_0xb3875d[_0x9329('0x4d')]*_0x26b296)-_0xb3875d[_0x9329('0x6f')]-_0xb3875d[_0x9329('0xc2')];emitVoiceQueueSummary(_0xb3875d);if(_0xb3875d['dialLimitQueue']>0x0){var _0xc7ea82=_0xb3875d['dialLimitQueue']-_0xb3875d['originated']-_0xb3875d[_0x9329('0x51')]-_0xb3875d[_0x9329('0xc2')]-_0xb3875d[_0x9329('0x4f')];if(_0x1019aa>_0xc7ea82){_0x1019aa=_0xc7ea82;}}if(_0x1019aa>0x0){if(_0xb3875d[_0x9329('0x159')]===_0x9329('0xa')){_0x1019aa=0x1;}if(_0x1019aa>this[_0x9329('0x23')]){_0x1019aa=this[_0x9329('0x23')];}_0xb3875d[_0x9329('0xc2')]+=_0x1019aa;for(var _0x557866 in this['agents']){if(typeof this[_0x9329('0x21')][_0x557866]!==_0x9329('0x99')){if(this['agents'][_0x557866][_0x9329('0xe4')]===_0x9329('0x20c')&&this['agents'][_0x557866][_0x9329('0xda')]===_0x9329('0xd9')){_0x5406db[_0x9329('0x126')](this[_0x9329('0x21')][_0x557866]['id']);}}}this[_0x9329('0xc1')](_0xb3875d['id'],_0x5406db,_0x1019aa,_0xb3875d[_0x9329('0x205')],_0xb3875d)[_0x9329('0xb3')](function(_0x54bcc2){_0xb3875d[_0x9329('0xc2')]-=_0x1019aa;_0xb3875d[_0x9329('0xc2')]=_0xb3875d[_0x9329('0xc2')]>0x0?_0xb3875d[_0x9329('0xc2')]:0x0;if(!checkContactEmpty(_0x54bcc2)){_0x3c3db1[_0x9329('0xb4')](_0xb3875d)[_0x9329('0xb3')](sendMessageReschedule(_0xb3875d))[_0x9329('0xae')](loggerCatch('[countReScheduled]\x20'));}else{_0xb3875d[_0x9329('0x6f')]+=_0x54bcc2[_0x9329('0x98')];_0xb3875d[_0x9329('0x3d')]=_0xb3875d[_0x9329('0x159')]===_0x9329('0xa')?'ACTIVE':'RUNNING';for(var _0x5a5712=0x0;_0x5a5712<_0x54bcc2[_0x9329('0x98')];_0x5a5712+=0x1){if(_[_0x9329('0xdd')](_0x54bcc2[_0x5a5712])||_[_0x9329('0xdd')](_0x54bcc2[_0x5a5712][_0x9329('0x171')])||_[_0x9329('0xdd')](_0x54bcc2[_0x5a5712][_0x9329('0x171')][_0x9329('0x172')])){_0x3c3db1['emptyContact'](_0x9329('0x20d'),_0xb3875d,_0x54bcc2[_0x5a5712]);}else{_0x3c3db1[_0x9329('0xb6')](_[_0x9329('0x127')](_0x54bcc2[_0x5a5712],['VoiceQueueId','Contact.phone']))[_0x9329('0xb3')](_0x3c3db1[_0x9329('0x1f1')](_0xb3875d,_0x54bcc2[_0x5a5712]))[_0x9329('0xae')](_0x3c3db1[_0x9329('0xcb')](_0x9329('0x20d'),_0xb3875d));}}}})[_0x9329('0xae')](loggerGetContactDialer(_0x9329('0x20e'),_0xb3875d,_0x1019aa));}};Dialer['prototype'][_0x9329('0x90')]=function(_0x9bd966){if(_0x9bd966[_0x9329('0x20f')]>0x0){var _0x13c74e=_0x9bd966['dialLimitQueue']-_0x9bd966[_0x9329('0x6f')]-_0x9bd966[_0x9329('0x51')];if(_0x13c74e>0x0){this[_0x9329('0x210')](_0x9bd966);}else{loggerPredictiveCalls[_0x9329('0x7c')](_0x9329('0x211'));}}else{this[_0x9329('0x210')](_0x9bd966);}};Dialer[_0x9329('0x1b')][_0x9329('0x210')]=function(_0x5b4794){var _0x5c0ef8=this;var _0x18c268=[];_0x5b4794['originated']+=0x1;for(var _0x5774eb in this[_0x9329('0x21')]){if(typeof this[_0x9329('0x21')][_0x5774eb]!=='undefined'){if(this[_0x9329('0x21')][_0x5774eb][_0x9329('0xe4')]===_0x9329('0x20c')&&this[_0x9329('0x21')][_0x5774eb][_0x9329('0xda')]===_0x9329('0xd9')){_0x18c268[_0x9329('0x126')](this['agents'][_0x5774eb]['id']);}}}this[_0x9329('0xc1')](_0x5b4794['id'],_0x18c268,0x1,_0x5b4794[_0x9329('0x205')],_0x5b4794)[_0x9329('0xb3')](function(_0x260cf0){if(!checkContactEmpty(_0x260cf0)){checkContactLowerLimitOriginate(_0x5b4794,0x1,0x0);_0x5c0ef8[_0x9329('0xb4')](_0x5b4794)[_0x9329('0xb3')](sendMessageReschedule(_0x5b4794))[_0x9329('0xae')](loggerCatch('[countReScheduled]\x20'));}else{_0x5b4794[_0x9329('0x3d')]=_0x9329('0x208');if(_['isNil'](_0x260cf0[0x0])||_['isNil'](_0x260cf0[0x0][_0x9329('0x171')])||_[_0x9329('0xdd')](_0x260cf0[0x0]['Contact'][_0x9329('0x172')])){_0x5c0ef8[_0x9329('0xcc')]('[actionOriginate]\x20',_0x5b4794,_0x260cf0[0x0]);}else{_0x5c0ef8[_0x9329('0xb6')](_[_0x9329('0x127')](_0x260cf0[0x0],['VoiceQueueId',_0x9329('0x20a')]))[_0x9329('0xb3')](_0x5c0ef8[_0x9329('0x1f1')](_0x5b4794,_0x260cf0[0x0]))[_0x9329('0xae')](_0x5c0ef8[_0x9329('0xcb')](_0x9329('0x212'),_0x5b4794));}}})[_0x9329('0xae')](loggerGetContactDialer(_0x9329('0x213'),_0x5b4794,0x1));emitVoiceQueueSummary(_0x5b4794);};Dialer[_0x9329('0x1b')]['abandonmentRate']=function(_0x513ff9,_0x24c29e,_0x39a2ca,_0x5a76b1,_0x35094b,_0x128d36){loggerPredictive[_0x9329('0x7c')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x9329('0x7c')](_0x9329('0x214'),_0x513ff9);loggerPredictive[_0x9329('0x7c')](_0x9329('0x215'),_0x24c29e);loggerPredictive[_0x9329('0x7c')](_0x9329('0x216'),_0x39a2ca);loggerPredictive['info'](_0x9329('0x217'),_0x5a76b1);loggerPredictive[_0x9329('0x7c')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x35094b);loggerPredictive[_0x9329('0x7c')](_0x9329('0x84'));return new BPromise(function(_0x5976d0,_0x5a6468){if(_0x513ff9<=0x0||isNaN(_0x513ff9)){return _0x5a6468(msgResponse(_0x9329('0x218'),_0x9329('0x19b'),_0x9329('0x219')+_0x513ff9));}if(_0x39a2ca<=0x0||isNaN(_0x39a2ca)){return _0x5a6468(msgResponse('[abandonmentRate]',_0x9329('0x19b'),'Ts\x20=\x20'+_0x39a2ca));}if(_0x5a76b1<=0x0||isNaN(_0x5a76b1)){return _0x5a6468(msgResponse(_0x9329('0x218'),_0x9329('0x19b'),_0x9329('0x21a')+_0x5a76b1));}if(_0x24c29e<=0x0||isNaN(_0x24c29e)){return _0x5a6468(msgResponse(_0x9329('0x218'),_0x9329('0x19b'),_0x9329('0x21b')+_0x24c29e));}if(_0x35094b<=0x0||isNaN(_0x35094b)){return _0x5a6468(msgResponse(_0x9329('0x218'),'Error',_0x9329('0x21c')+_0x35094b));}_0x128d36=_0x128d36||0x0;var _0x6088f5=0x1/_0x39a2ca;var _0x206404=0x0;var _0x4e520b=0x0;var _0x5d68fe=0x0;var _0x17f3d4=0x0;for(var _0x551bf0=0x0;_0x5d68fe<_0x35094b;_0x551bf0+=0x1){_0x4e520b=_0x551bf0/_0x24c29e;_0x206404=(_0x5a76b1*_0x4e520b+_0x128d36)/_0x6088f5;_0x5d68fe=erlangb(_0x206404,_0x513ff9);_0x17f3d4=_0x206404/_0x513ff9*(0x1-erlangb(_0x206404,_0x513ff9));}return _0x5976d0({'erlangCalls':_0x551bf0,'erlangCallToSecond':_0x24c29e/_0x551bf0,'erlangAbandonmentRate':_0x5d68fe,'erlangBusyFactor':_0x17f3d4});});};Dialer[_0x9329('0x1b')][_0x9329('0x1eb')]=function(_0x26f00a,_0x2c02cb,_0x3863c7,_0xbf945f,_0x4af8c9,_0x5e27fb){loggerPredictive['info'](_0x9329('0x21d'));loggerPredictive[_0x9329('0x7c')](_0x9329('0x214'),_0x26f00a);loggerPredictive[_0x9329('0x7c')](_0x9329('0x215'),_0x2c02cb);loggerPredictive[_0x9329('0x7c')](_0x9329('0x216'),_0x3863c7);loggerPredictive[_0x9329('0x7c')](_0x9329('0x217'),_0xbf945f);loggerPredictive[_0x9329('0x7c')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4af8c9);loggerPredictive[_0x9329('0x7c')](_0x9329('0x84'));return new BPromise(function(_0x1c9621,_0x110afe){if(_0x26f00a<=0x0||isNaN(_0x26f00a)){return _0x110afe(msgResponse(_0x9329('0x21e'),_0x9329('0x19b'),'m\x20=\x20'+_0x26f00a));}if(_0x3863c7<=0x0||isNaN(_0x3863c7)){return _0x110afe(msgResponse(_0x9329('0x21e'),'Error',_0x9329('0x21f')+_0x3863c7));}if(_0xbf945f<=0x0||isNaN(_0xbf945f)){return _0x110afe(msgResponse(_0x9329('0x21e'),'Error',_0x9329('0x21a')+_0xbf945f));}if(_0x2c02cb<=0x0||isNaN(_0x2c02cb)){return _0x110afe(msgResponse(_0x9329('0x21e'),'Error',_0x9329('0x21b')+_0x2c02cb));}if(_0x4af8c9<=0x0||isNaN(_0x4af8c9)){return _0x110afe(msgResponse(_0x9329('0x21e'),'Error',_0x9329('0x220')+_0x4af8c9));}_0x5e27fb=_0x5e27fb||0x0;var _0x154a86=0x1/_0x3863c7;var _0x4a03b6=0x0;var _0xadaac5=0x0;var _0x1cee96=0x0;var _0x1f633c=0x0;for(var _0x58b0f3=0x0;_0x1f633c<_0x4af8c9;_0x58b0f3+=0x1){_0xadaac5=_0x58b0f3/_0x2c02cb;_0x4a03b6=(_0xbf945f*_0xadaac5+_0x5e27fb)/_0x154a86;_0x1cee96=erlangb(_0x4a03b6,_0x26f00a);_0x1f633c=_0x4a03b6/_0x26f00a*(0x1-erlangb(_0x4a03b6,_0x26f00a));}return _0x1c9621({'erlangCalls':_0x58b0f3,'erlangCallToSecond':_0x2c02cb/_0x58b0f3,'erlangAbandonmentRate':_0x1cee96,'erlangBusyFactor':_0x1f633c});});};module['exports']=Dialer; \ No newline at end of file +var _0xc737=['unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','active','SIP/%s','reachable','unmonitored','syncVarSet','variable','exten','dialAMDActive','value','uniqueid','outboundAnswerAgiCallsDay','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','statedesc','countmachineretry','countbusyretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HANGUP','HangupInAMD','[syncHangupInAMDIvr]','Machine','countglobal','[syncAgentComplete][createHistory][0]','countagentrejectretry','add','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','AnswerAGI','AGI','dialQueueProject','cause-txt','[syncHangupIvr]','syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','answertime','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','minutes','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','paused','stateinterface','agents','rrmemory','push','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','run','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','loopCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','indexOf','true','all','some','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','progressive','power','handlePower','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIfTime','dialGlobalInterval','[syncQueueSummary]','syncCampaigns','dialTimezone','[syncCampaigns]','\x5cw{0,','pow','random','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','getCaller','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','tags','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','trim','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','callProgressDetecting','[callProgressDetecting]\x20','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','checkRetriveMax','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','dialAbandonedMaxRetry','outboundRejectCallsDay','AgentReject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','averageHandleTime','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','booked','[booked][checkContactBlack]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[getContactCampaign2]','dialLimitQueue','not_inuse','[actionOriginate]\x20','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[countReScheduled]\x20','[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','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','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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]','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','md5','ioredis','../preview/util/util','../../../config/logger','dialer','predictive','predictiveCalls','redis','defaults','socket.io-emitter','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncQueueSummary','hangup','syncHangup','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','Interval','Intervals','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','startProgressive','Trunk','callerid','format','voice_queue:save','ivr','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\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:\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','Drop\x20Rate:\x20\x20\x20\x20\x20\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','erlangBusyFactor','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','endtime','starttime','loopClearZombieChannels','clearZombieChannels','[actions]','sequence','isNil','Action','status','channel','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','countReScheduled','resolve','then','catch','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact'];(function(_0x376d9a,_0x26a6d9){var _0x5a12ea=function(_0x123a1d){while(--_0x123a1d){_0x376d9a['push'](_0x376d9a['shift']());}};_0x5a12ea(++_0x26a6d9);}(_0xc737,0x154));var _0x7c73=function(_0x3c060c,_0x545bc4){_0x3c060c=_0x3c060c-0x0;var _0x5aef0d=_0xc737[_0x3c060c];return _0x5aef0d;};'use strict';var util=require(_0x7c73('0x0'));var _=require(_0x7c73('0x1'));var BPromise=require(_0x7c73('0x2'));var uuid=require(_0x7c73('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0x7c73('0x4'));var Redis=require(_0x7c73('0x5'));var ut=require(_0x7c73('0x6'));var config=require('../../../config/environment/');var logger=require(_0x7c73('0x7'))(_0x7c73('0x8'));var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require(_0x7c73('0x7'))(_0x7c73('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0x7c73('0xa'));var loggerSyncQueueSummary=require(_0x7c73('0x7'))('syncQueueSummary');var ami=require('../ami');config[_0x7c73('0xb')]=_[_0x7c73('0xc')](config[_0x7c73('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x7c73('0xd'))(new Redis(config[_0x7c73('0xb')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x7c73('0xe'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x7c73('0xf'));var Action=require(_0x7c73('0x10'));var History=require(_0x7c73('0x11'));var Final=require('./final');var AgentComplete=require(_0x7c73('0x12'));var QueueCallerAbandon=require(_0x7c73('0x13'));var Hangup=require(_0x7c73('0x14'));var ipAgi=process[_0x7c73('0x15')]['XCALLY_IP_AGI']||_0x7c73('0x16');var strategy={'rrmemory':'rrmemory','roundrobin':_0x7c73('0x17')};var Sequence=function(){};Sequence[_0x7c73('0x18')][_0x7c73('0x19')]=function(_0x291a8a){this[_0x7c73('0x1a')]=this[_0x7c73('0x1a')]?this[_0x7c73('0x1a')][_0x7c73('0x1b')](_0x291a8a):_0x291a8a();};function Dialer(_0x5091d6,_0xbf66e){this['sequence']=new Sequence();this[_0x7c73('0x1c')]=_0xbf66e;this[_0x7c73('0x1d')]=_0x5091d6['voiceQueues'];this['campaigns']=_0x5091d6[_0x7c73('0x1e')];this['agents']=_0x5091d6['agents'];this[_0x7c73('0x1f')]=_0x5091d6[_0x7c73('0x1f')];this[_0x7c73('0x20')]=config[_0x7c73('0x20')]||0x2;this['channels']={};this[_0x7c73('0x21')]={};this[_0x7c73('0x22')]={};this[_0x7c73('0x23')]={};this[_0x7c73('0x24')]={};this[_0x7c73('0x25')]={};this['startProgressive']={};this[_0x7c73('0x26')]={};this[_0x7c73('0x27')]={};this[_0x7c73('0x28')]={};ami['on'](_0x7c73('0x29'),this[_0x7c73('0x2a')][_0x7c73('0x2b')](this));ami['on'](_0x7c73('0x2c'),this[_0x7c73('0x2d')][_0x7c73('0x2b')](this));ami['on']('originateresponse',this[_0x7c73('0x2e')]['bind'](this));ami['on'](_0x7c73('0x2f'),this['syncAgentComplete'][_0x7c73('0x2b')](this));ami['on']('custom:queuesummary',this[_0x7c73('0x30')]['bind'](this));ami['on'](_0x7c73('0x31'),this[_0x7c73('0x32')][_0x7c73('0x2b')](this));ami['on']('newexten',this[_0x7c73('0x33')][_0x7c73('0x2b')](this));ami['on'](_0x7c73('0x34'),this['syncVarSet'][_0x7c73('0x2b')](this));ami['on'](_0x7c73('0x35'),this[_0x7c73('0x36')][_0x7c73('0x2b')](this));ami['on'](_0x7c73('0x37'),this[_0x7c73('0x38')]['bind'](this));this['loopCampaigns']();this['loopClearZombieChannels']();}function isNotNull(_0x30fa4f){return _0x30fa4f!==null&&!_[_0x7c73('0x39')](_0x30fa4f);}function checkIsLoggedIn(_0x383494,_0x49b1ad){return function(){if(_0x49b1ad<=0x0){_0x383494['message']=_0x7c73('0x3a');throw _0x383494[_0x7c73('0x3b')]+_0x7c73('0x3c');}};}function isActive(_0x334cf1){return _0x334cf1;}function checkIsActive(_0x2aa14f,_0x2b924f){return function(){if(!isActive(_0x2b924f)){_0x2aa14f[_0x7c73('0x3d')]=_0x7c73('0x3e');throw _0x2aa14f[_0x7c73('0x3b')]+_0x7c73('0x3f');}};}function checkInterval(_0x50d0ea){return function(){if(!isNotNull(_0x50d0ea['Interval'])){_0x50d0ea[_0x7c73('0x3d')]=_0x7c73('0x40');throw _0x50d0ea[_0x7c73('0x3b')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x50d0ea[_0x7c73('0x41')][_0x7c73('0x42')])){_0x50d0ea[_0x7c73('0x3d')]=_0x7c73('0x40');throw _0x50d0ea[_0x7c73('0x3b')]+_0x7c73('0x43');}if(!isNotNull(_[_0x7c73('0x44')](_0x50d0ea[_0x7c73('0x41')]['Intervals']))){_0x50d0ea[_0x7c73('0x3d')]=_0x7c73('0x40');throw _0x50d0ea[_0x7c73('0x3b')]+_0x7c73('0x43');}};}function msgResponse(_0xe670a4,_0x267c64,_0x2fbe78){return{'action':_0xe670a4,'response':_0x267c64,'message':_0x2fbe78,'stack':_0x2fbe78};}function myreject(_0x3cfb63){return function(_0x32af21){return _0x3cfb63(msgResponse(_0x7c73('0x45'),_0x7c73('0x46'),JSON[_0x7c73('0x47')](_0x32af21)));};}function getSeconds(_0x96cd91,_0x3c780d){var _0x39cca0=moment(_0x96cd91)[_0x7c73('0x48')](0x0);var _0x5c9fb5=moment(_0x3c780d)[_0x7c73('0x48')](0x0);return _0x39cca0[_0x7c73('0x49')](_0x5c9fb5,'seconds');}function emit(_0x3c3873,_0x1a2bb2,_0x55a86d){io['to'](_0x3c3873)[_0x7c73('0x4a')](_0x1a2bb2,_0x55a86d);}function emitVoiceQueueSummary(_0x5b96dd){if(_0x5b96dd[_0x7c73('0x4b')]===_0x7c73('0x4c')){var _0xde1390={'id':_0x5b96dd['id'],'name':_0x5b96dd[_0x7c73('0x3b')],'strategy':_0x5b96dd[_0x7c73('0x4d')],'answered':_0x5b96dd[_0x7c73('0x4e')],'available':_0x5b96dd[_0x7c73('0x4f')],'loggedIn':_0x5b96dd[_0x7c73('0x50')],'pTalking':_0x5b96dd[_0x7c73('0x51')],'sumBillable':_0x5b96dd['sumBillable'],'sumDuration':_0x5b96dd[_0x7c73('0x52')],'sumHoldTime':_0x5b96dd[_0x7c73('0x53')]||0x0,'talking':_0x5b96dd[_0x7c73('0x54')],'total':_0x5b96dd[_0x7c73('0x55')],'type':_0x5b96dd[_0x7c73('0x4b')],'unmanaged':_0x5b96dd['unmanaged'],'abandoned':_0x5b96dd['abandoned'],'waiting':_0x5b96dd[_0x7c73('0x56')],'loggedInDb':_0x5b96dd[_0x7c73('0x57')],'dialActive':_0x5b96dd[_0x7c73('0x58')],'dialMethod':_0x5b96dd[_0x7c73('0x59')],'dialOriginateCallerIdName':_0x5b96dd[_0x7c73('0x5a')],'dialOriginateCallerIdNumber':_0x5b96dd[_0x7c73('0x5b')],'dialOriginateTimeout':_0x5b96dd[_0x7c73('0x5c')],'dialPrefix':_0x5b96dd[_0x7c73('0x5d')],'outboundAnswerAgiCallsDay':_0x5b96dd['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x5b96dd[_0x7c73('0x5e')],'outboundBlacklistCallsDay':_0x5b96dd[_0x7c73('0x5f')],'outboundBusyCallsDay':_0x5b96dd[_0x7c73('0x60')],'outboundCongestionCallsDay':_0x5b96dd[_0x7c73('0x61')],'outboundDropCallsDayACS':_0x5b96dd[_0x7c73('0x62')],'outboundDropCallsDayCallersExit':_0x5b96dd[_0x7c73('0x63')],'outboundDropCallsDayTimeout':_0x5b96dd['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x5b96dd[_0x7c73('0x64')],'outboundNoSuchCallsDay':_0x5b96dd[_0x7c73('0x65')],'outboundOriginateFailureCallsDay':_0x5b96dd[_0x7c73('0x66')],'outboundReCallsDay':_0x5b96dd[_0x7c73('0x67')],'outboundRejectCallsDay':_0x5b96dd['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x5b96dd['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x5b96dd['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x5b96dd[_0x7c73('0x68')],'predictiveIntervalAvgTalktime':_0x5b96dd[_0x7c73('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x5b96dd[_0x7c73('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x5b96dd[_0x7c73('0x6b')],'predictiveIntervalErlangCalls':_0x5b96dd['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x5b96dd[_0x7c73('0x6c')],'predictiveIntervalHitRate':_0x5b96dd[_0x7c73('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x5b96dd[_0x7c73('0x6e')],'predictiveIntervalPauses':_0x5b96dd[_0x7c73('0x6f')],'predictiveIntervalAvailable':_0x5b96dd[_0x7c73('0x70')],'predictiveIntervalTotalCalls':_0x5b96dd[_0x7c73('0x71')],'message':_0x5b96dd[_0x7c73('0x3d')],'originated':_0x5b96dd[_0x7c73('0x72')],'erlangCalls':_0x5b96dd['erlangCalls'],'erlangCallToSecond':_0x5b96dd[_0x7c73('0x73')],'erlangAbandonmentRate':_0x5b96dd['erlangAbandonmentRate'],'erlangBusyFactor':_0x5b96dd['erlangBusyFactor'],'startPredictive':_0x5b96dd[_0x7c73('0x25')],'startProgressive':_0x5b96dd[_0x7c73('0x74')]};if(_0x5b96dd[_0x7c73('0x75')]){_0xde1390[_0x7c73('0x75')]={'id':_0x5b96dd['Trunk']['id'],'name':_0x5b96dd[_0x7c73('0x75')]['name'],'active':_0x5b96dd[_0x7c73('0x75')]['active'],'callerid':_0x5b96dd['Trunk'][_0x7c73('0x76')]};}if(_0x5b96dd[_0x7c73('0x41')]){_0xde1390[_0x7c73('0x41')]={'id':_0x5b96dd[_0x7c73('0x41')]['id'],'name':_0x5b96dd['Interval'][_0x7c73('0x3b')]};}var _0x2866bb=md5(JSON['stringify'](_0xde1390));if(_0x5b96dd[_0x7c73('0x4')]!==_0x2866bb){_0x5b96dd['md5']=_0x2866bb;emit(util[_0x7c73('0x77')]('voice:queue:%s',_0xde1390['name']),_0x7c73('0x78'),_0xde1390);}}}function emitCampaignSummary(_0x561fb0){if(_0x561fb0['type']===_0x7c73('0x79')){emit(util[_0x7c73('0x77')](_0x7c73('0x7a'),_0x561fb0['name']),'campaign:save',_0x561fb0);}}function checkGetDataPredictive(_0x444ebf){if(isNotNull(_0x444ebf)&&!_[_0x7c73('0x44')](_0x444ebf)){loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x7c'));loggerPredictive[_0x7c73('0x7b')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x444ebf['predictiveIntervalTotalCalls']);loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x7d'),_0x444ebf[_0x7c73('0x7e')]);loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x7f'),_0x444ebf[_0x7c73('0x6b')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x444ebf[_0x7c73('0x6a')]);loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x80'),_0x444ebf['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0x7c73('0x81'),_0x444ebf[_0x7c73('0x69')]);loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x82'));if(_0x444ebf[_0x7c73('0x71')]>0x0){if(!_[_0x7c73('0x39')](_0x444ebf['predictiveIntervalAvgTalktime'])&&_0x444ebf['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x83'));if(!_[_0x7c73('0x39')](_0x444ebf[_0x7c73('0x68')])&&_0x444ebf[_0x7c73('0x68')]>0x0){return!![];}loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x84'));}else{loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x85'));}}else{loggerPredictive['info'](_0x7c73('0x86'));}return![];}function mergeDataErlangB(_0x1b4967){return function(_0x519d24){loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x87'));loggerPredictive['info'](_0x7c73('0x88'),_0x519d24[_0x7c73('0x89')]);loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x8a'),_0x519d24[_0x7c73('0x73')]);loggerPredictive['info'](_0x7c73('0x8b'),_0x519d24[_0x7c73('0x8c')]);loggerPredictive['info'](_0x7c73('0x8d'),_0x519d24[_0x7c73('0x8e')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x519d24[_0x7c73('0x8c')]);loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x82'));_[_0x7c73('0x8f')](_0x1b4967,_0x519d24);};}function getDiff(_0x49756c){var _0x1ef08f=moment()[_0x7c73('0x48')](0x0);var _0x866541=moment(_0x49756c)['milliseconds'](0x0);return _0x1ef08f[_0x7c73('0x49')](_0x866541,_0x7c73('0x90'));}function ifInterval(_0x2cbc70,_0x512ca){if(_['isUndefined'](_0x512ca)){return![];}return getDiff(_0x512ca)<_0x2cbc70*0x3c;}function freeVariablesPredictive(_0x481a37){if(isNotNull(_0x481a37)){if(!_[_0x7c73('0x39')](_0x481a37['startProgressive'])){_0x481a37['startProgressive']=undefined;loggerPredictive['info'](_0x481a37[_0x7c73('0x3b')],_0x7c73('0x91'));}if(!_[_0x7c73('0x39')](_0x481a37[_0x7c73('0x25')])){_0x481a37[_0x7c73('0x25')]=undefined;loggerPredictive[_0x7c73('0x7b')](_0x481a37[_0x7c73('0x3b')],_0x7c73('0x92'));}if(!_[_0x7c73('0x39')](_0x481a37[_0x7c73('0x93')])){clearInterval(_0x481a37['handlePredictive']);_0x481a37[_0x7c73('0x93')]=undefined;loggerPredictive[_0x7c73('0x7b')](_0x481a37[_0x7c73('0x3b')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x4e00fd,_0x53a3ca){if(_0x53a3ca===0x0){return 0x0;}var _0x32eca5=0x1;for(var _0x508058=0x1;_0x508058<=_0x53a3ca;_0x508058+=0x1){_0x32eca5=0x1+_0x32eca5*_0x508058/_0x4e00fd;}return 0x1/_0x32eca5;}function isVoiceQueueOutbound(_0x4a33b5){return _0x4a33b5===_0x7c73('0x4c');}function isNotPreview(_0x2e2e6e){return _0x2e2e6e!==_0x7c73('0x1c');}function isCampaignIvr(_0x1423d7){return _0x1423d7===_0x7c73('0x79');}function getCallerId(_0x1a3da1,_0x426881,_0x5ac074){if(!_[_0x7c73('0x39')](_0x5ac074)&&typeof _0x5ac074===_0x7c73('0x94')&&!_[_0x7c73('0x44')](_0x5ac074)){if(!_[_0x7c73('0x39')](_0x426881)&&typeof _0x426881==='string'&&!_['isEmpty'](_0x426881)){return util[_0x7c73('0x77')](_0x7c73('0x95'),_0x426881,_0x5ac074);}return util['format'](_0x7c73('0x95'),_0x5ac074,_0x5ac074);}if(!_[_0x7c73('0x39')](_0x1a3da1)&&typeof _0x1a3da1===_0x7c73('0x94')&&!_['isEmpty'](_0x1a3da1)){return _0x1a3da1;}return _0x7c73('0x96');}function loggerCatchQueueSummary(_0x2bfb85,_0x1ee48c){return function(_0x141ba5){freeVariablesPredictive(_0x1ee48c);emitVoiceQueueSummary(_0x1ee48c);emitCampaignSummary(_0x1ee48c);loggerSyncQueueSummary[_0x7c73('0x97')](_0x2bfb85,util['inspect'](_0x141ba5,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x31765d,_0x49306b){return function(_0x27075f){loggerPredictive['error'](_0x49306b['name'],_0x31765d);loggerPredictive[_0x7c73('0x97')](_0x27075f[_0x7c73('0x98')]);freeVariablesPredictive(_0x49306b);};}function loggerCatch(_0x387592){return function(_0x4b5c09){logger[_0x7c73('0x97')](_0x387592,util[_0x7c73('0x99')](_0x4b5c09,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5ea1e1){return _0x5ea1e1&&!_[_0x7c73('0x39')](_0x5ea1e1)&&_0x5ea1e1['length']>0x0;}function decremetOriginate(_0x2c21c8){if(!_[_0x7c73('0x39')](_0x2c21c8)&&_0x2c21c8!==null){if(typeof _0x2c21c8['originated']!==_0x7c73('0x9a')){if(_0x2c21c8[_0x7c73('0x72')]>0x0){_0x2c21c8[_0x7c73('0x72')]-=0x1;}else{logger[_0x7c73('0x97')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x7c73('0x97')](_0x7c73('0x9b'));}}function checkContactLowerLimitOriginate(_0x2c759a,_0x594ade,_0x471da6){if(_0x594ade>_0x471da6){for(var _0x43feeb=0x0;_0x43feeb<_0x594ade-_0x471da6;_0x43feeb+=0x1){decremetOriginate(_0x2c759a);}}}function loggerGetContactDialer(_0x45294f,_0x45c7b2,_0x4f7159){return function(_0x3be10d){checkContactLowerLimitOriginate(_0x45c7b2,_0x4f7159,0x0);logger[_0x7c73('0x97')](_0x45294f,util['inspect'](_0x3be10d,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x461cdf){return function(_0x36eae8){if(isNotNull(_0x36eae8)&&isNotNull(_0x36eae8[0x0])){if(_0x36eae8[0x0][_0x7c73('0x9c')]>0x0){_0x461cdf[_0x7c73('0x3d')]=_0x7c73('0x9d');logger[_0x7c73('0x7b')](_0x7c73('0x9e')+_0x461cdf['name'],_0x36eae8[0x0][_0x7c73('0x9c')],_0x7c73('0x9f'));}else{_0x461cdf[_0x7c73('0x3d')]=_0x7c73('0xa0');logger[_0x7c73('0x7b')](_0x7c73('0xa1')+_0x461cdf[_0x7c73('0x3b')]);}}};}function notSendMessagesQueue(_0x563070){if(_0x563070['sendMessageOneNotActive']){freeVariablesPredictive(_0x563070);if(_0x563070['originated']===0x0&&_0x563070[_0x7c73('0x54')]===0x0&&_0x563070['waiting']===0x0&&(_0x563070['pTalking']||0x0)===0x0){_0x563070[_0x7c73('0xa2')]=![];_0x563070[_0x7c73('0x4f')]=0x0;_0x563070[_0x7c73('0x3d')]=_0x7c73('0x3e');loggerSyncQueueSummary[_0x7c73('0x97')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x563070[_0x7c73('0x3b')],'is\x20not\x20active');}else{_0x563070[_0x7c73('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0x7c73('0xa3'),_0x563070[_0x7c73('0x3b')],_0x7c73('0xa4'));}emitVoiceQueueSummary(_0x563070);}}function notSendMessagesCampaign(_0x2c4d0e){if(_0x2c4d0e[_0x7c73('0xa2')]){if(_0x2c4d0e[_0x7c73('0x72')]===0x0){_0x2c4d0e[_0x7c73('0xa2')]=![];_0x2c4d0e[_0x7c73('0x3d')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x7c73('0x97')](_0x7c73('0xa5'),_0x2c4d0e[_0x7c73('0x3b')],'is\x20not\x20active');}else{_0x2c4d0e['message']=_0x7c73('0xa6');loggerSyncQueueSummary[_0x7c73('0x97')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2c4d0e[_0x7c73('0x3b')],'is\x20disactive');}emitCampaignSummary(_0x2c4d0e);}}function createObjHistory(_0x1c2247,_0x56f30e,_0x223ebb,_0x2e139e,_0x3048c8){_0x1c2247[_0x7c73('0x3d')]=_0x223ebb;var _0x26fa06=new Action(_0x1c2247,_0x56f30e);var _0x227499=new History(_0x26fa06);_0x227499[_0x7c73('0xa7')]=_0x2e139e;_0x227499['statedesc']=_0x3048c8;_0x227499[_0x7c73('0xa8')]=_0x26fa06[_0x7c73('0xa9')];return _0x227499;}Dialer[_0x7c73('0x18')][_0x7c73('0xaa')]=function(){var _0x5dd59a=this;setInterval(function(){_0x5dd59a[_0x7c73('0xab')](_0x5dd59a[_0x7c73('0x23')],'[uniqueid]');_0x5dd59a['clearZombieChannels'](_0x5dd59a[_0x7c73('0x21')],_0x7c73('0xac'));},0x32c8);};Dialer[_0x7c73('0x18')][_0x7c73('0xab')]=function(_0x12a825,_0x5e40f2){var _0x30d242=this;for(var _0x14498d in _0x12a825){if(typeof _0x12a825[_0x14498d]!=='undefined'){this[_0x7c73('0xad')][_0x7c73('0x19')](function(){if(!_[_0x7c73('0xae')](_0x12a825[_0x14498d])){return ami[_0x7c73('0xaf')]({'action':_0x7c73('0xb0'),'channel':_0x12a825[_0x14498d][_0x7c73('0xb1')]})['catch'](function(_0x14d8cf){if(_0x14d8cf[_0x7c73('0x3d')]===_0x7c73('0xb2')){setTimeout(function(){if(_0x12a825[_0x14498d]&&_0x12a825[_0x14498d][_0x7c73('0x4b')]!==_0x7c73('0x79')){_0x30d242[_0x7c73('0xb3')](_0x30d242[_0x7c73('0x1d')][_0x12a825[_0x14498d]['queue']]);logger['error'](_0x7c73('0xb4'),_0x5e40f2,_0x14498d,_0x12a825[_0x14498d]['queue']);delete _0x12a825[_0x14498d];}if(_0x12a825[_0x14498d]&&_0x12a825[_0x14498d][_0x7c73('0x4b')]===_0x7c73('0x79')){_0x30d242['updateOriginated'](_0x30d242[_0x7c73('0x1e')][_0x12a825[_0x14498d][_0x7c73('0xb5')]]);logger[_0x7c73('0x97')]('[Dialer][checkChannel][ivr]',_0x5e40f2,_0x14498d,_0x12a825[_0x14498d][_0x7c73('0xb5')]);delete _0x12a825[_0x14498d];}},0x2328);}});}});}}};Dialer['prototype'][_0x7c73('0xb6')]=function(_0xa14e52){return BPromise[_0x7c73('0xb7')]()[_0x7c73('0xb8')](cmHopper['countReScheduled'](_0xa14e52))[_0x7c73('0xb9')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x7c73('0x18')]['checkIsBlackList']=function(_0x504143){return BPromise[_0x7c73('0xb7')]()[_0x7c73('0xb8')](cmHopperBlack[_0x7c73('0xba')](_0x504143))[_0x7c73('0xb9')](loggerCatch(_0x7c73('0xbb')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x3d6970){return BPromise[_0x7c73('0xb7')]()[_0x7c73('0xb8')](cmHopperBlack[_0x7c73('0xbc')](_0x3d6970))[_0x7c73('0xb9')](loggerCatch(_0x7c73('0xbd')));};Dialer[_0x7c73('0x18')]['averageHandleTime']=function(_0x5d3eaa){return BPromise[_0x7c73('0xb7')]()[_0x7c73('0xb8')](cmHopperHistory[_0x7c73('0xbe')](_0x5d3eaa))[_0x7c73('0xb9')](loggerCatch(_0x7c73('0xbf')));};Dialer[_0x7c73('0x18')][_0x7c73('0xc0')]=function(_0x35a6bb){return BPromise[_0x7c73('0xb7')]()[_0x7c73('0xb8')](cmHopper[_0x7c73('0xc0')](_0x35a6bb))[_0x7c73('0xb9')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype']['unlockContact']=function(_0x4e6f13,_0x234bd5,_0x282d4f){return BPromise[_0x7c73('0xb7')]()[_0x7c73('0xb8')](cmHopper[_0x7c73('0xc1')](_0x4e6f13,_0x234bd5,_0x282d4f))[_0x7c73('0xb9')](loggerCatch(_0x7c73('0xc2')));};Dialer['prototype'][_0x7c73('0xc3')]=function(_0x18ea32,_0x583cbe,_0x5f69c7,_0x4a68a6,_0x114c39){return BPromise[_0x7c73('0xb7')]()[_0x7c73('0xb8')](cmHopper[_0x7c73('0xc3')](_0x18ea32,_0x583cbe,_0x5f69c7,_0x4a68a6))[_0x7c73('0xb9')](function(_0x5c4825){_0x114c39[_0x7c73('0xc4')]-=_0x5f69c7;_0x114c39[_0x7c73('0xc4')]=_0x114c39[_0x7c73('0xc4')]>0x0?_0x114c39['temp']:0x0;loggerCatch(_0x7c73('0xc5'))(_0x5c4825);});};Dialer[_0x7c73('0x18')][_0x7c73('0xc6')]=function(_0x195b2d,_0xdc043b,_0x34a7ac,_0x2531ad){return BPromise['resolve']()[_0x7c73('0xb8')](cmHopper['getContactDialerIvr'](_0x195b2d,_0xdc043b,_0x34a7ac))[_0x7c73('0xb9')](function(_0x2ec145){_0x2531ad[_0x7c73('0xc4')]-=_0xdc043b;_0x2531ad[_0x7c73('0xc4')]=_0x2531ad[_0x7c73('0xc4')]>0x0?_0x2531ad[_0x7c73('0xc4')]:0x0;loggerCatch(_0x7c73('0xc7'))(_0x2ec145);});};Dialer[_0x7c73('0x18')][_0x7c73('0xc8')]=function(_0x50a9c8){return BPromise['resolve']()[_0x7c73('0xb8')](voiceQueueRt['getVoiceQueueRtPauses'](_0x50a9c8))[_0x7c73('0xb9')](loggerCatch(_0x7c73('0xc9')));};Dialer[_0x7c73('0x18')][_0x7c73('0xca')]=function(_0x4281b6){return BPromise[_0x7c73('0xb7')]()[_0x7c73('0xb8')](cmHopper[_0x7c73('0xca')](_0x4281b6))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x7c73('0x18')][_0x7c73('0xcb')]=function(_0x22cafe){return BPromise[_0x7c73('0xb7')]()['then'](cmHopperHistory['createHistory'](_0x22cafe))['catch'](loggerCatch(_0x7c73('0xcc')));};Dialer[_0x7c73('0x18')][_0x7c73('0xb3')]=function(_0x46f25f){if(!_[_0x7c73('0x39')](_0x46f25f)&&_0x46f25f!==null){if(typeof _0x46f25f['originated']!==_0x7c73('0x9a')){if(_0x46f25f[_0x7c73('0x72')]>0x0){_0x46f25f[_0x7c73('0x72')]-=0x1;}else{logger[_0x7c73('0x97')](_0x7c73('0xcd'));}}}else{logger[_0x7c73('0x97')](_0x7c73('0xce'));}};Dialer['prototype'][_0x7c73('0xcf')]=function(_0x3da94c,_0x11b727){var _0x251bdb=this;return function(_0x18c201){_0x251bdb[_0x7c73('0xb3')](_0x11b727);logger[_0x7c73('0x97')](_0x3da94c,util[_0x7c73('0x99')](_0x18c201,{'showHidden':![],'depth':null}));};};Dialer[_0x7c73('0x18')][_0x7c73('0xd0')]=function(_0xf09a83,_0x570d3c,_0x1be8b0){var _0x4bafd0={'state':0x19,'statedesc':'notFound'};this[_0x7c73('0xb3')](_0x570d3c);this[_0x7c73('0xd1')](_[_0x7c73('0x8f')](_0x4bafd0,_[_0x7c73('0xd2')](_0x1be8b0,[_0x7c73('0xd3'),_0x7c73('0xd4'),_0x7c73('0xd5'),_0x7c73('0xd6'),_0x7c73('0xd7')])),_0x7c73('0xd8'),'[emptyContact]');logger['error'](_0xf09a83);};Dialer[_0x7c73('0x18')][_0x7c73('0xd9')]=function(_0xee7292){return _0xee7292===_0x7c73('0xda');};Dialer['prototype']['isTrunkReachable']=function(_0xee7f95){return!_['isUndefined'](_0xee7f95)&&_0xee7f95&&!_['isUndefined'](_0xee7f95[_0x7c73('0x3b')])&&!_[_0x7c73('0x39')](_0xee7f95[_0x7c73('0xdb')])&&_0xee7f95[_0x7c73('0xdb')]&&(this[_0x7c73('0x1f')][util[_0x7c73('0x77')](_0x7c73('0xdc'),_0xee7f95[_0x7c73('0x3b')])][_0x7c73('0xb0')]===_0x7c73('0xdd')||this[_0x7c73('0x1f')][util['format'](_0x7c73('0xdc'),_0xee7f95[_0x7c73('0x3b')])][_0x7c73('0xb0')]===_0x7c73('0xde'));};Dialer[_0x7c73('0x18')]['saveInDb']=function(_0x7caf4e,_0x3e06af,_0x2689bd){this['createHistory'](_0x7caf4e)[_0x7c73('0xb9')](loggerCatch(_0x3e06af));this[_0x7c73('0xca')](_0x7caf4e)['catch'](loggerCatch(_0x2689bd));};Dialer['prototype'][_0x7c73('0xdf')]=function(_0xcd0ad0){var _0x23cc93=this[_0x7c73('0x23')][_0xcd0ad0['uniqueid']];var _0x58d6ba;if(!_[_0x7c73('0xae')](_0xcd0ad0)&&!_[_0x7c73('0xae')](_0xcd0ad0[_0x7c73('0xe0')])&&!_['isNil'](_0xcd0ad0[_0x7c73('0xe0')]['amdstatus'])&&_0xcd0ad0[_0x7c73('0xe1')]==='xcally-motion-dialer'&&_0x23cc93){if(_0x23cc93[_0x7c73('0x4b')]!==_0x7c73('0x79')&&this['voiceQueues'][_0x23cc93[_0x7c73('0xb5')]][_0x7c73('0xe2')]&&_0xcd0ad0[_0x7c73('0xe3')]==='HANGUP'){delete this[_0x7c73('0x23')][_0xcd0ad0[_0x7c73('0xe4')]];this[_0x7c73('0xb3')](this[_0x7c73('0x1d')][_0x23cc93[_0x7c73('0xb5')]]);this[_0x7c73('0x1d')][_0x23cc93['queue']][_0x7c73('0x5e')]+=0x1;this['voiceQueues'][_0x23cc93[_0x7c73('0xb5')]][_0x7c73('0xe5')]+=0x1;_0x58d6ba=new Hangup(_0x23cc93,_0xcd0ad0);_0x58d6ba[_0x7c73('0xa7')]=0x12;_0x58d6ba['statedesc']='HangupInAMD';_0x58d6ba[_0x7c73('0xe6')]=_0x7c73('0xe7');ami[_0x7c73('0x4a')](_0x7c73('0xe8'),ut[_0x7c73('0xe9')](_0x58d6ba,_0x7c73('0xea')));this[_0x7c73('0xd1')](_0x58d6ba,_0x7c73('0xeb'),_0x7c73('0xec'));}if(_0x23cc93['type']!==_0x7c73('0x79')&&this[_0x7c73('0x1d')][_0x23cc93[_0x7c73('0xb5')]][_0x7c73('0xe2')]&&_0xcd0ad0[_0x7c73('0xe3')]===_0x7c73('0xed')){var _0x3b598d=this;return new BPromise(function(_0x4c86a9,_0x2ce949){delete _0x3b598d[_0x7c73('0x23')][_0xcd0ad0[_0x7c73('0xe4')]];_0x3b598d[_0x7c73('0xb3')](_0x3b598d[_0x7c73('0x1d')][_0x23cc93['queue']]);_0x3b598d[_0x7c73('0x1d')][_0x23cc93[_0x7c73('0xb5')]][_0x7c73('0x5e')]+=0x1;_0x3b598d[_0x7c73('0x1d')][_0x23cc93['queue']][_0x7c73('0xe5')]+=0x1;var _0x799cfe=_0x3b598d[_0x7c73('0x1d')][_0x23cc93[_0x7c73('0xb5')]];var _0x593695=new Hangup(_0x23cc93,_0xcd0ad0);_0x593695[_0x7c73('0xa7')]=0x13;_0x593695[_0x7c73('0xee')]='Machine';_0x593695[_0x7c73('0xe6')]=_0x7c73('0xe7');_0x593695[_0x7c73('0xef')]+=0x1;_0x593695['countglobal']+=0x1;_0x593695['amd']=!![];ami['emit'](_0x7c73('0xe8'),ut['buildObj'](_0x593695,'amd'));_0x3b598d[_0x7c73('0xcb')](_0x593695)[_0x7c73('0xb9')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x593695[_0x7c73('0xf0')]+_0x593695['countcongestionretry']+_0x593695['countnoanswerretry']+_0x593695['countnosuchnumberretry']+_0x593695[_0x7c73('0xf1')]+_0x593695[_0x7c73('0xf2')]+_0x593695['countmachineretry']+_0x593695['countagentrejectretry']>=_0x799cfe[_0x7c73('0xf3')]){_0x3b598d[_0x7c73('0xf4')](_0x593695,_0x4c86a9,_0x2ce949,_0x7c73('0xf5'));}else{if(_0x593695[_0x7c73('0xef')]>=_0x799cfe[_0x7c73('0xf6')]){_0x3b598d[_0x7c73('0xf7')](_0x593695,_0x4c86a9,_0x2ce949,_0x7c73('0xf8'));}else{_0x3b598d['rescheduleContact']({'active':![],'countmachineretry':_0x593695[_0x7c73('0xef')],'scheduledat':moment()['add'](_0x799cfe[_0x7c73('0xf9')],'minutes')['format'](_0x7c73('0xfa')),'ContactId':_0x593695[_0x7c73('0xd3')],'ListId':_0x593695[_0x7c73('0xd4')],'VoiceQueueId':_0x593695[_0x7c73('0xd6')]||undefined,'CampaignId':_0x593695[_0x7c73('0xd7')]||undefined})[_0x7c73('0xb9')](loggerCatch(_0x7c73('0xfb')));_0x4c86a9({'reschedule':0x1});}}});}if(_0x23cc93['type']===_0x7c73('0x79')&&this[_0x7c73('0x1e')][_0x23cc93[_0x7c73('0xb5')]][_0x7c73('0xe2')]&&_0xcd0ad0[_0x7c73('0xe3')]===_0x7c73('0xfc')){delete this[_0x7c73('0x23')][_0xcd0ad0[_0x7c73('0xe4')]];this['updateOriginated'](this[_0x7c73('0x1e')][_0x23cc93[_0x7c73('0xb5')]]);_0x58d6ba=new Hangup(_0x23cc93,_0xcd0ad0);_0x58d6ba[_0x7c73('0xa7')]=0x12;_0x58d6ba[_0x7c73('0xee')]=_0x7c73('0xfd');_0x58d6ba[_0x7c73('0xe6')]=_0x7c73('0xe7');ami[_0x7c73('0x4a')]('custom:amd',ut[_0x7c73('0xe9')](_0x58d6ba,_0x7c73('0xea')));this['saveInDb'](_0x58d6ba,'[syncHangupInAMDIvr][createHistory]',_0x7c73('0xfe'));}if(_0x23cc93[_0x7c73('0x4b')]==='ivr'&&this[_0x7c73('0x1e')][_0x23cc93['queue']][_0x7c73('0xe2')]&&_0xcd0ad0[_0x7c73('0xe3')]===_0x7c73('0xed')){var _0x3b598d=this;return new BPromise(function(_0x4f862f,_0x2c74f5){delete _0x3b598d[_0x7c73('0x23')][_0xcd0ad0[_0x7c73('0xe4')]];_0x3b598d['updateOriginated'](_0x3b598d[_0x7c73('0x1e')][_0x23cc93[_0x7c73('0xb5')]]);_0x3b598d[_0x7c73('0x1e')][_0x23cc93['queue']]['outboundAnswerCallsDay']+=0x1;_0x3b598d[_0x7c73('0x1e')][_0x23cc93[_0x7c73('0xb5')]][_0x7c73('0xe5')]+=0x1;var _0x1a3725=_0x3b598d[_0x7c73('0x1e')][_0x23cc93[_0x7c73('0xb5')]];var _0x46db62=new Hangup(_0x23cc93,_0xcd0ad0);_0x46db62[_0x7c73('0xa7')]=0x13;_0x46db62[_0x7c73('0xee')]=_0x7c73('0xff');_0x46db62[_0x7c73('0xe6')]=_0x7c73('0xe7');_0x46db62['countmachineretry']+=0x1;_0x46db62[_0x7c73('0x100')]+=0x1;_0x46db62['amd']=!![];ami[_0x7c73('0x4a')](_0x7c73('0xe8'),ut[_0x7c73('0xe9')](_0x46db62,_0x7c73('0xea')));_0x3b598d[_0x7c73('0xcb')](_0x46db62)['catch'](loggerCatch(_0x7c73('0x101')));if(_0x46db62[_0x7c73('0xf0')]+_0x46db62['countcongestionretry']+_0x46db62['countnoanswerretry']+_0x46db62['countnosuchnumberretry']+_0x46db62[_0x7c73('0xf1')]+_0x46db62[_0x7c73('0xf2')]+_0x46db62[_0x7c73('0xef')]+_0x46db62[_0x7c73('0x102')]>=_0x1a3725[_0x7c73('0xf3')]){_0x3b598d[_0x7c73('0xf4')](_0x46db62,_0x4f862f,_0x2c74f5,_0x7c73('0xf5'));}else{if(_0x46db62[_0x7c73('0xef')]>=_0x1a3725[_0x7c73('0xf6')]){_0x3b598d[_0x7c73('0xf7')](_0x46db62,_0x4f862f,_0x2c74f5,_0x7c73('0xf8'));}else{_0x3b598d[_0x7c73('0xc0')]({'active':![],'countmachineretry':_0x46db62['countmachineretry'],'scheduledat':moment()[_0x7c73('0x103')](_0x1a3725[_0x7c73('0xf9')],'minutes')[_0x7c73('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x46db62[_0x7c73('0xd3')],'ListId':_0x46db62[_0x7c73('0xd4')],'VoiceQueueId':_0x46db62[_0x7c73('0xd6')]||undefined,'CampaignId':_0x46db62[_0x7c73('0xd7')]||undefined})[_0x7c73('0xb9')](loggerCatch('[rescheduleContact][Machine]'));_0x4f862f({'reschedule':0x1});}}});}}};Dialer[_0x7c73('0x18')][_0x7c73('0x32')]=function(_0xb10da5){var _0x14d839=this[_0x7c73('0x23')][_0xb10da5['uniqueid']];var _0x5b5f78=this;var _0x1e56e4;if(_0x14d839&&_0x14d839['type']===_0x7c73('0x79')){delete this[_0x7c73('0x23')][_0xb10da5['uniqueid']];this['updateOriginated'](this[_0x7c73('0x1e')][_0x14d839['queue']]);this['campaigns'][_0x14d839[_0x7c73('0xb5')]][_0x7c73('0x104')]+=0x1;_0x1e56e4=new Hangup(_0x14d839,_0xb10da5);this[_0x7c73('0xcb')](_0x1e56e4)['catch'](loggerCatch(_0x7c73('0x105')));this[_0x7c73('0xca')](_0x1e56e4)[_0x7c73('0xb9')](loggerCatch('[syncHangupIvr]'));}if(_0x14d839&&_0x14d839[_0x7c73('0x4b')]!==_0x7c73('0x79')&&isNotNull(this[_0x7c73('0x1d')][_0x14d839[_0x7c73('0xb5')]]['dialQueueProject'])){delete this[_0x7c73('0x23')][_0xb10da5[_0x7c73('0xe4')]];this['updateOriginated'](this[_0x7c73('0x1d')][_0x14d839['queue']]);this['voiceQueues'][_0x14d839[_0x7c73('0xb5')]][_0x7c73('0x5e')]+=0x1;this['voiceQueues'][_0x14d839[_0x7c73('0xb5')]][_0x7c73('0xe5')]+=0x1;_0x1e56e4=new Hangup(_0x14d839,_0xb10da5);_0x1e56e4[_0x7c73('0xa7')]=0x10;_0x1e56e4['statedesc']=_0x7c73('0x106');_0x1e56e4[_0x7c73('0xe6')]=_0x7c73('0x107');this[_0x7c73('0xcb')](_0x1e56e4)[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x105')));this['moveContactManagedDialer'](_0x1e56e4)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x14d839&&_0x14d839[_0x7c73('0x4b')]!==_0x7c73('0x79')&&!isNotNull(this[_0x7c73('0x1d')][_0x14d839[_0x7c73('0xb5')]][_0x7c73('0x108')])){delete this[_0x7c73('0x23')][_0xb10da5[_0x7c73('0xe4')]];this[_0x7c73('0xb3')](this[_0x7c73('0x1d')][_0x14d839['queue']]);this['voiceQueues'][_0x14d839[_0x7c73('0xb5')]]['outboundUnknownCallsDay']+=0x1;_0x1e56e4=new Hangup(_0x14d839,_0xb10da5);_0x1e56e4[_0x7c73('0xa7')]=0xc;_0x1e56e4['statedesc']=_0xb10da5[_0x7c73('0x109')];_0x1e56e4[_0x7c73('0xe6')]='Unknow';this[_0x7c73('0xcb')](_0x1e56e4)[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x105')));this[_0x7c73('0xca')](_0x1e56e4)['catch'](loggerCatch(_0x7c73('0x10a')));}};Dialer[_0x7c73('0x18')][_0x7c73('0x10b')]=function(_0x35e95c){var _0x529aa1=this[_0x7c73('0x23')][_0x35e95c[_0x7c73('0xe4')]];var _0x5bc3bb=this;if(this[_0x7c73('0x1d')][_0x35e95c[_0x7c73('0xb5')]]){if(_0x529aa1&&_0x529aa1['type']!==_0x7c73('0x79')){delete this[_0x7c73('0x23')][_0x35e95c['uniqueid']];this[_0x7c73('0x1d')][_0x35e95c[_0x7c73('0xb5')]][_0x7c73('0x5e')]+=0x1;var _0xe93ba6=new AgentComplete(_0x529aa1,_0x35e95c);if(_0x35e95c[_0x7c73('0x10c')]===_0x7c73('0x10d')){_0xe93ba6[_0x7c73('0x10e')]=this['voiceQueues'][_0x35e95c[_0x7c73('0xb5')]][_0x7c73('0x10f')]&&this[_0x7c73('0x1d')][_0x35e95c[_0x7c73('0xb5')]][_0x7c73('0x110')]?moment()[_0x7c73('0x77')](_0x7c73('0xfa')):undefined;}this[_0x7c73('0xcb')](_0xe93ba6)[_0x7c73('0xb9')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0xe93ba6)[_0x7c73('0xb9')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x7c73('0x18')]['syncAgentConnect']=function(_0xb7562d){if(this['voiceQueues'][_0xb7562d[_0x7c73('0xb5')]]){if(this[_0x7c73('0x23')][_0xb7562d['uniqueid']]&&this[_0x7c73('0x23')][_0xb7562d[_0x7c73('0xe4')]][_0x7c73('0x4b')]!==_0x7c73('0x79')){this[_0x7c73('0xb3')](this[_0x7c73('0x1d')][_0xb7562d[_0x7c73('0xb5')]]);this[_0x7c73('0x23')][_0xb7562d[_0x7c73('0xe4')]][_0x7c73('0x111')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x7c73('0x18')]['queueCallerAbandonCreateState']=function(_0x168ed0){this[_0x7c73('0xcb')](_0x168ed0)[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x112')));this[_0x7c73('0xca')](_0x168ed0)[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x113')));};Dialer['prototype'][_0x7c73('0x2d')]=function(_0x1d9224){var _0x1a04e3=this['uniqueId'][_0x1d9224[_0x7c73('0xe4')]];var _0x3abf75=this;if(this[_0x7c73('0x1d')][_0x1d9224[_0x7c73('0xb5')]]){if(_0x1a04e3&&_0x1a04e3[_0x7c73('0x4b')]!==_0x7c73('0x79')){delete this[_0x7c73('0x23')][_0x1d9224[_0x7c73('0xe4')]];this[_0x7c73('0xb3')](this[_0x7c73('0x1d')][_0x1d9224['queue']]);_0x1a04e3[_0x7c73('0x114')]=moment()[_0x7c73('0x77')](_0x7c73('0xfa'));var _0x96d2=new QueueCallerAbandon(_0x1a04e3,_0x1d9224);if(getSeconds(_0x1a04e3['droptime'],_0x1a04e3['responsetime'])>=_0x1a04e3[_0x7c73('0x115')]){this[_0x7c73('0x1d')][_0x1d9224[_0x7c73('0xb5')]][_0x7c73('0x6b')]+=0x1;this[_0x7c73('0x1d')][_0x1d9224[_0x7c73('0xb5')]][_0x7c73('0x116')]+=0x1;this[_0x7c73('0x1d')][_0x1d9224['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x96d2['state']=0xa;_0x96d2[_0x7c73('0xee')]=_0x7c73('0x117');_0x96d2[_0x7c73('0x118')]=_0x7c73('0x119');_0x96d2[_0x7c73('0x10e')]=this[_0x7c73('0x1d')][_0x1d9224[_0x7c73('0xb5')]][_0x7c73('0x10f')]?moment()[_0x7c73('0x77')](_0x7c73('0xfa')):undefined;_0x96d2['countdropretry']+=0x1;_0x96d2[_0x7c73('0x100')]+=0x1;if(_0x96d2[_0x7c73('0xf1')]>=this[_0x7c73('0x1d')][_0x1d9224[_0x7c73('0xb5')]][_0x7c73('0x11a')]){this[_0x7c73('0x11b')](_0x96d2);}else{this[_0x7c73('0xc0')]({'active':![],'countdropretry':_0x96d2['countdropretry'],'scheduledat':moment()[_0x7c73('0x103')](this[_0x7c73('0x1d')][_0x1d9224[_0x7c73('0xb5')]][_0x7c73('0x11c')],_0x7c73('0x11d'))[_0x7c73('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1a04e3[_0x7c73('0xd3')],'ListId':_0x1a04e3[_0x7c73('0xd4')],'VoiceQueueId':_0x1a04e3['VoiceQueueId']||undefined,'CampaignId':_0x1a04e3['CampaignId']||undefined})[_0x7c73('0xb9')](loggerCatch('[rescheduleContact][Drop]'));var _0x52c1f0=new History(_0x96d2);_0x52c1f0[_0x7c73('0xa7')]=0xa;_0x52c1f0[_0x7c73('0xee')]=_0x7c73('0x117');_0x52c1f0['starttime']=moment()[_0x7c73('0x77')]('YYYY-MM-DD\x20HH:mm:ss');_0x52c1f0[_0x7c73('0xa8')]=_0x52c1f0[_0x7c73('0xa9')];_0x52c1f0[_0x7c73('0x11e')]=_0x96d2[_0x7c73('0x11e')];_0x52c1f0['calleridnum']=_0x96d2[_0x7c73('0x11f')];this[_0x7c73('0xcb')](_0x52c1f0)[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x120')));}}else{this[_0x7c73('0x1d')][_0x1d9224[_0x7c73('0xb5')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x1d9224['queue']][_0x7c73('0x63')]+=0x1;_0x96d2['state']=0xb;_0x96d2[_0x7c73('0xee')]=_0x7c73('0x121');_0x96d2[_0x7c73('0x118')]=_0x7c73('0x122');_0x96d2['countabandonedretry']+=0x1;_0x96d2[_0x7c73('0x100')]+=0x1;if(_0x96d2[_0x7c73('0xf2')]>=this[_0x7c73('0x1d')][_0x1d9224[_0x7c73('0xb5')]]['dialAbandonedMaxRetry']){this[_0x7c73('0x11b')](_0x96d2);}else{this[_0x7c73('0xc0')]({'active':![],'countabandonedretry':_0x96d2[_0x7c73('0xf2')],'scheduledat':moment()[_0x7c73('0x103')](this[_0x7c73('0x1d')][_0x1d9224[_0x7c73('0xb5')]]['dialAbandonedRetryFrequency'],'minutes')[_0x7c73('0x77')](_0x7c73('0xfa')),'ContactId':_0x1a04e3[_0x7c73('0xd3')],'ListId':_0x1a04e3[_0x7c73('0xd4')],'VoiceQueueId':_0x1a04e3[_0x7c73('0xd6')]||undefined,'CampaignId':_0x1a04e3[_0x7c73('0xd7')]||undefined})['catch'](loggerCatch(_0x7c73('0x123')));var _0x52c1f0=new History(_0x96d2);_0x52c1f0[_0x7c73('0xa7')]=0xb;_0x52c1f0[_0x7c73('0xee')]=_0x7c73('0x121');_0x52c1f0[_0x7c73('0xa9')]=moment()[_0x7c73('0x77')](_0x7c73('0xfa'));_0x52c1f0[_0x7c73('0xa8')]=_0x52c1f0[_0x7c73('0xa9')];_0x52c1f0[_0x7c73('0x11e')]=_0x96d2[_0x7c73('0x11e')];_0x52c1f0[_0x7c73('0x11f')]=_0x96d2[_0x7c73('0x11f')];this[_0x7c73('0xcb')](_0x52c1f0)[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x124')));}}}}};Dialer[_0x7c73('0x18')][_0x7c73('0x33')]=function(_0x38f353){if(this[_0x7c73('0x21')][_0x38f353[_0x7c73('0xe4')]]){this['actions'][_0x38f353[_0x7c73('0xe4')]][_0x7c73('0xb1')]=_0x38f353[_0x7c73('0xb1')];}if(this['uniqueId'][_0x38f353['uniqueid']]){this[_0x7c73('0x23')][_0x38f353['uniqueid']]['channel']=_0x38f353[_0x7c73('0xb1')];}};Dialer['prototype'][_0x7c73('0x36')]=function(_0x5f4646){if(strategy[this[_0x7c73('0x1d')][this['actions'][_0x5f4646[_0x7c73('0x125')]][_0x7c73('0xb5')]][_0x7c73('0x4d')]]===_0x7c73('0x17')){if(this[_0x7c73('0x21')][_0x5f4646['actionid']]&&_[_0x7c73('0xae')](this[_0x7c73('0x21')][_0x5f4646['actionid']]['locked'])&&_0x5f4646['status']==='1'&&_0x5f4646[_0x7c73('0x126')]==='0'){if(this['agents'][_0x5f4646[_0x7c73('0x127')]]){if(!this['agents'][_0x5f4646[_0x7c73('0x127')]]['locked']){this[_0x7c73('0x128')][_0x5f4646[_0x7c73('0x127')]]['locked']=!![];this[_0x7c73('0x21')][_0x5f4646['actionid']]['locked']=!![];this[_0x7c73('0x21')][_0x5f4646[_0x7c73('0x125')]][_0x7c73('0x127')]=_0x5f4646[_0x7c73('0x127')];}}}}else if((strategy[this['voiceQueues'][this[_0x7c73('0x21')][_0x5f4646[_0x7c73('0x125')]][_0x7c73('0xb5')]][_0x7c73('0x4d')]]||_0x7c73('0x129'))===_0x7c73('0x129')){if(this[_0x7c73('0x21')][_0x5f4646[_0x7c73('0x125')]]){if(this[_0x7c73('0x128')][_0x5f4646[_0x7c73('0x127')]]){this[_0x7c73('0x21')][_0x5f4646[_0x7c73('0x125')]][_0x7c73('0x127')]=_0x5f4646[_0x7c73('0x127')];if(_['isNil'](this[_0x7c73('0x27')][this[_0x7c73('0x21')][_0x5f4646['actionid']][_0x7c73('0xb5')]])){this['queueBooked'][this[_0x7c73('0x21')][_0x5f4646['actionid']][_0x7c73('0xb5')]]=[];}this['queueBooked'][this[_0x7c73('0x21')][_0x5f4646[_0x7c73('0x125')]][_0x7c73('0xb5')]][_0x7c73('0x12a')](_[_0x7c73('0x8f')](_['pick'](this['actions'][_0x5f4646[_0x7c73('0x125')]],[_0x7c73('0x12b'),_0x7c73('0x127')]),{'status':_0x5f4646[_0x7c73('0xb0')],'paused':_0x5f4646[_0x7c73('0x126')]}));}}}};function unlockQueueStatus(_0x33de19,_0x57bf67){setTimeout(function(){if(_['isUndefined'](_0x33de19[_0x7c73('0x12c')])){loggerBooked[_0x7c73('0x97')]('[unlockQueueStatus][undefined]',_0x57bf67);}_0x33de19[_0x7c73('0x12c')]=!![];loggerBooked[_0x7c73('0x7b')](_0x7c73('0x12d'),_0x57bf67,JSON[_0x7c73('0x47')](_[_0x7c73('0xd2')](_0x33de19,['name',_0x7c73('0x12c')])));},0x1f3);}Dialer[_0x7c73('0x18')][_0x7c73('0x38')]=function(_0x3ff309){var _0x2a96e7=this;var _0x4cdf5d=_0x2a96e7[_0x7c73('0x1d')][_0x2a96e7[_0x7c73('0x21')][_0x3ff309[_0x7c73('0x125')]]['queue']];if(strategy[this[_0x7c73('0x1d')][this['actions'][_0x3ff309[_0x7c73('0x125')]][_0x7c73('0xb5')]]['strategy']]===_0x7c73('0x17')){if(this['actions'][_0x3ff309[_0x7c73('0x125')]]&&this[_0x7c73('0x21')][_0x3ff309[_0x7c73('0x125')]]['stateinterface']){this['preview']['run'](this['actions'][_0x3ff309[_0x7c73('0x125')]][_0x7c73('0x12b')],this['actions'][_0x3ff309['actionid']][_0x7c73('0x127')])[_0x7c73('0xb9')](function(_0x2e70ae){logger['error'](_0x7c73('0x12e'),util['inspect'](_0x2e70ae,{'showHidden':![],'depth':null}));})[_0x7c73('0x1b')](function(){_0x2a96e7[_0x7c73('0xb3')](_0x2a96e7[_0x7c73('0x1d')][_0x2a96e7[_0x7c73('0x21')][_0x3ff309[_0x7c73('0x125')]][_0x7c73('0xb5')]]);_0x2a96e7[_0x7c73('0x128')][_0x2a96e7[_0x7c73('0x21')][_0x3ff309[_0x7c73('0x125')]][_0x7c73('0x127')]]['locked']=![];delete _0x2a96e7[_0x7c73('0x21')][_0x3ff309[_0x7c73('0x125')]];unlockQueueStatus(_0x4cdf5d);});}else{this['updateOriginated'](this[_0x7c73('0x1d')][this[_0x7c73('0x21')][_0x3ff309['actionid']]['queue']]);this[_0x7c73('0xc0')]({'active':![],'ContactId':this['actions'][_0x3ff309['actionid']]['ContactId'],'ListId':this[_0x7c73('0x21')][_0x3ff309[_0x7c73('0x125')]][_0x7c73('0xd4')],'VoiceQueueId':this['actions'][_0x3ff309[_0x7c73('0x125')]][_0x7c73('0xd6')]||undefined,'CampaignId':this['actions'][_0x3ff309[_0x7c73('0x125')]][_0x7c73('0xd7')]||undefined})[_0x7c73('0xb9')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x7c73('0x21')][_0x3ff309[_0x7c73('0x125')]];unlockQueueStatus(_0x4cdf5d);}}else if((strategy[this['voiceQueues'][this[_0x7c73('0x21')][_0x3ff309[_0x7c73('0x125')]][_0x7c73('0xb5')]][_0x7c73('0x4d')]]||_0x7c73('0x129'))==='rrmemory'){var _0x2a35b5;if(this[_0x7c73('0x21')][_0x3ff309[_0x7c73('0x125')]]&&!_['isEmpty'](this[_0x7c73('0x27')][this[_0x7c73('0x21')][_0x3ff309['actionid']][_0x7c73('0xb5')]])){if(this['queueBookedRR'][_0x2a96e7['actions'][_0x3ff309[_0x7c73('0x125')]][_0x7c73('0xb5')]]){this[_0x7c73('0x28')][_0x2a96e7[_0x7c73('0x21')][_0x3ff309[_0x7c73('0x125')]][_0x7c73('0xb5')]]=this['queueBookedRR'][this[_0x7c73('0x21')][_0x3ff309[_0x7c73('0x125')]][_0x7c73('0xb5')]]?this[_0x7c73('0x28')][this[_0x7c73('0x21')][_0x3ff309[_0x7c73('0x125')]][_0x7c73('0xb5')]]:this[_0x7c73('0x27')][this[_0x7c73('0x21')][_0x3ff309[_0x7c73('0x125')]][_0x7c73('0xb5')]]?this['queueBooked'][this[_0x7c73('0x21')][_0x3ff309[_0x7c73('0x125')]][_0x7c73('0xb5')]][_0x7c73('0x12f')]||0x0:0x0;}this['queueBooked'][this[_0x7c73('0x21')][_0x3ff309[_0x7c73('0x125')]]['queue']][_0x7c73('0x12f')]=this[_0x7c73('0x28')][this[_0x7c73('0x21')][_0x3ff309[_0x7c73('0x125')]][_0x7c73('0xb5')]];for(var _0x82f9b3=0x0;_0x82f9b3=0x0;})[_0x7c73('0xb9')](myreject(_0x3ffb33)));}}else{_0x513838[_0x7c73('0x12a')](ami[_0x7c73('0xaf')]({'action':_0x7c73('0x149'),'command':util['format'](_0x7c73('0x14a'),_0x408124,!_[_0x7c73('0x39')](config[_0x7c73('0x145')][_0x32930d])?_0x32930d:'')})[_0x7c73('0xb8')](function(_0xb4b3ca){return _0xb4b3ca['content']['indexOf']('true')>=0x0;})[_0x7c73('0xb9')](myreject(_0x3ffb33)));}BPromise[_0x7c73('0x14d')](_0x513838)['then'](function(_0x16452a){var _0x248bd2=_[_0x7c73('0x14e')](_0x16452a);if(_0x248bd2){return _0x44f1e9(_0x248bd2);}else{_0x3187f2['message']=_0x4794e3?'GLOBAL_INTERVAL_IS_OVERTIME':_0x7c73('0x14f');return _0x3ffb33(msgResponse('[ifTime][promiseAll]',_0x7c73('0x143'),_0x7c73('0x150')+_0x4794e3+'\x20'+_0x5bb64f+_0x7c73('0x151')+util[_0x7c73('0x99')](_0x408124,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x32930d));}})[_0x7c73('0xb9')](function(_0x15a778){return _0x3ffb33(msgResponse(_0x7c73('0x13f'),'Failure',JSON[_0x7c73('0x47')](_0x15a778)));});});};Dialer[_0x7c73('0x18')]['checkDialMethod']=function(_0x5482bd){var _0x5d8ca3=this;return function(){switch(_0x5482bd[_0x7c73('0x59')]){case _0x7c73('0x152'):freeVariablesPredictive(_0x5482bd);_0x5d8ca3['handlePower'](_0x5482bd,0x1);break;case _0x7c73('0x153'):freeVariablesPredictive(_0x5482bd);_0x5d8ca3[_0x7c73('0x154')](_0x5482bd,_0x5482bd['dialPowerLevel']);break;case _0x7c73('0x9'):_0x5d8ca3[_0x7c73('0x9')](_0x5482bd);break;case'booked':freeVariablesPredictive(_0x5482bd);_0x5d8ca3[_0x7c73('0x154')](_0x5482bd,0x1);break;default:freeVariablesPredictive(_0x5482bd);logger[_0x7c73('0x97')](_0x7c73('0x155'),_0x5482bd[_0x7c73('0x3b')],_0x7c73('0x156'));}};};Dialer[_0x7c73('0x18')][_0x7c73('0x157')]=function(_0x189ae3){var _0x29ecef=this;return function(){_0x29ecef[_0x7c73('0x158')](_0x189ae3);};};Dialer[_0x7c73('0x18')][_0x7c73('0x30')]=function(_0x50b4bd){var _0x1f909e=this;if(isNotPreview(_0x50b4bd[_0x7c73('0x59')])){if(isVoiceQueueOutbound(_0x50b4bd[_0x7c73('0x4b')])&&isActive(_0x50b4bd[_0x7c73('0x58')])){_0x50b4bd['sendMessageOneNotActive']=!![];BPromise[_0x7c73('0xb7')]()['then'](checkIsLoggedIn(_0x50b4bd,_0x50b4bd[_0x7c73('0x50')]))[_0x7c73('0xb8')](checkIsActive(_0x50b4bd,_0x50b4bd[_0x7c73('0x58')]))[_0x7c73('0xb8')](checkInterval(_0x50b4bd))[_0x7c73('0xb8')](_0x1f909e[_0x7c73('0x13a')](_0x50b4bd))['then'](_0x1f909e[_0x7c73('0x159')](_0x50b4bd[_0x7c73('0x15a')],_0x50b4bd['dialTimezone'],_0x50b4bd[_0x7c73('0x3b')],_0x50b4bd))['then'](_0x1f909e['checkIfTimeIntervals'](_0x50b4bd['Interval'],_0x50b4bd['dialTimezone'],_0x50b4bd['name'],_0x50b4bd))[_0x7c73('0xb8')](_0x1f909e['checkDialMethod'](_0x50b4bd))[_0x7c73('0xb9')](loggerCatchQueueSummary(_0x7c73('0x15b'),_0x50b4bd));}else{notSendMessagesQueue(_0x50b4bd);}}else{freeVariablesPredictive(_0x50b4bd);}};Dialer[_0x7c73('0x18')][_0x7c73('0x15c')]=function(){var _0x35aa83=this;var _0x553f98;for(var _0x53249f in this[_0x7c73('0x1e')]){if(typeof this[_0x7c73('0x1e')][_0x53249f]!==_0x7c73('0x9a')){_0x553f98=this[_0x7c73('0x1e')][_0x53249f];if(isCampaignIvr(_0x553f98['type'])&&isActive(_0x553f98['active'])){_0x553f98[_0x7c73('0xa2')]=!![];BPromise[_0x7c73('0xb7')]()['then'](checkIsActive(_0x553f98,_0x553f98[_0x7c73('0xdb')]))[_0x7c73('0xb8')](checkInterval(_0x553f98))[_0x7c73('0xb8')](_0x35aa83[_0x7c73('0x13a')](_0x553f98))[_0x7c73('0xb8')](_0x35aa83[_0x7c73('0x159')](_0x553f98[_0x7c73('0x15a')],_0x553f98[_0x7c73('0x15d')],_0x553f98[_0x7c73('0x3b')],_0x553f98))[_0x7c73('0xb8')](_0x35aa83[_0x7c73('0x140')](_0x553f98[_0x7c73('0x41')],_0x553f98[_0x7c73('0x15d')],_0x553f98['name'],_0x553f98))['then'](_0x35aa83[_0x7c73('0x157')](_0x553f98))[_0x7c73('0xb9')](loggerCatchQueueSummary(_0x7c73('0x15e'),_0x553f98));}else{notSendMessagesCampaign(_0x553f98);}}}};function getCallerIdRandom(_0x1ab88f,_0x58f58b){var _0x5bfc4a;var _0x4aa677;var _0x28e36e;if(_0x58f58b<=0x0){_0x58f58b=0x1;}_0x5bfc4a=new RegExp(_0x7c73('0x15f')+_0x58f58b+'}$');_0x4aa677=Math[_0x7c73('0x160')](0xa,_0x58f58b-0x1);_0x28e36e=Math[_0x7c73('0x160')](0xa,_0x58f58b)-0x1;return util[_0x7c73('0x77')]('%s',_['replace'](_0x1ab88f,_0x5bfc4a,_[_0x7c73('0x161')](_0x4aa677,_0x28e36e)));}function extractCalleridName(_0x19c718){var _0x4b7048=_0x19c718['match'](/"(.*?)"/);return _0x4b7048?_0x4b7048[0x1]:_0x19c718;}function extractCalleridNumber(_0x68251c){var _0x35a2f6=_0x68251c['match'](/<(.*?)>/);return _0x35a2f6?_0x35a2f6[0x1]:_0x68251c;}Dialer[_0x7c73('0x18')]['actionOriginate']=function(_0x152509,_0x508a5d){var _0x585a5e=this;var _0x49ffdc=uuid['v4']();this[_0x7c73('0x21')][_0x49ffdc]=new Action(_0x152509,_0x508a5d,_0x49ffdc);return new BPromise(function(_0x1461fc,_0x5cc256){if(_[_0x7c73('0x39')](_0x152509)&&typeof _0x152509!==_0x7c73('0x162')){return _0x5cc256(msgResponse(_0x7c73('0x163'),_0x7c73('0x143'),_0x7c73('0x164')));}if(_[_0x7c73('0x39')](_0x508a5d[_0x7c73('0x165')][_0x7c73('0x166')])||_0x508a5d[_0x7c73('0x165')][_0x7c73('0x166')]===null){return _0x5cc256(msgResponse(_0x7c73('0x163'),'Failure',_0x7c73('0x167')));}var _0x3169f7={'XMD-CALLERID':_0x585a5e[_0x7c73('0x21')][_0x49ffdc]['getCaller'](),'XMD-AGI':_0x152509[_0x7c73('0x108')]?util['format'](_0x7c73('0x168'),ipAgi,_0x152509[_0x7c73('0x108')]):_0x7c73('0x169'),'XMD-AGIAFTER':_0x152509[_0x7c73('0x10f')]?util[_0x7c73('0x77')]('\x22agi://%s/square,%s\x22',ipAgi,_0x152509[_0x7c73('0x10f')]):_0x7c73('0x169'),'XMD-QUEUE':_0x152509[_0x7c73('0x4b')]===_0x7c73('0x4c')?util[_0x7c73('0x77')](_0x7c73('0x16a'),_0x152509[_0x7c73('0x3b')],_0x152509['dialQueueOptions']||'',_0x152509[_0x7c73('0x110')]?'c':'',_0x152509[_0x7c73('0x115')]||0x3):_0x7c73('0x169'),'XMD-CONTACTID':_0x508a5d[_0x7c73('0xd3')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x585a5e[_0x7c73('0x21')][_0x49ffdc][_0x7c73('0x16b')](),'XMD-AMD':_0x152509[_0x7c73('0xe2')]?_0x7c73('0x16c'):_0x7c73('0x169'),'XMD-DESTINATION':_0x7c73('0x16d')};if(_0x152509[_0x7c73('0xe2')]){_0x3169f7[_0x7c73('0x16e')]=_0x152509[_0x7c73('0x16f')]||0x9c4;_0x3169f7[_0x7c73('0x170')]=_0x152509[_0x7c73('0x171')]||0x5dc;_0x3169f7[_0x7c73('0x172')]=_0x152509[_0x7c73('0x173')]||0x320;_0x3169f7['XMD-AMDTOTALANALYSISTIME']=_0x152509['dialAMDTotalAnalysisTime']||0x1388;_0x3169f7[_0x7c73('0x174')]=_0x152509['dialAMDMinWordLength']||0x64;_0x3169f7['XMD-AMDBETWEENWORDSSILENCE']=_0x152509[_0x7c73('0x175')]||0x32;_0x3169f7['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x152509[_0x7c73('0x176')]||0x3;_0x3169f7[_0x7c73('0x177')]=_0x152509['dialAMDSilenceThreshold']||0x100;_0x3169f7[_0x7c73('0x178')]=_0x152509[_0x7c73('0x179')]||0x1388;}if(_0x152509[_0x7c73('0x4b')]===_0x7c73('0x4c')){_0x3169f7['XMD-VOICEQUEUEID']=_0x508a5d[_0x7c73('0xd6')];}else{_0x3169f7['XMD-CAMPAIGNID']=_0x508a5d[_0x7c73('0xd7')];}for(var _0x36bd05 in _0x508a5d['Contact']){if(typeof _0x508a5d[_0x7c73('0x165')][_0x36bd05]!==_0x7c73('0x9a')){if(isNotNull(_0x508a5d[_0x7c73('0x165')][_0x36bd05])&&_0x36bd05!=='id'&&_0x36bd05!==_0x7c73('0x17a')&&_0x36bd05!=='createdAt'&&_0x36bd05!==_0x7c73('0x17b')){_0x3169f7[util[_0x7c73('0x77')](_0x7c73('0x17c'),_0x7c73('0x17d'),_[_0x7c73('0x17e')](_0x36bd05))]=_0x508a5d['Contact'][_0x36bd05];}}}var _0x4ac9ef=_0x585a5e['isTrunkReachable'](_0x152509['Trunk'])?getCallerId(_0x152509['Trunk'][_0x7c73('0x76')],_0x152509[_0x7c73('0x5a')],_0x152509[_0x7c73('0x17f')]>0x0?getCallerIdRandom(_0x152509[_0x7c73('0x5b')],_0x152509[_0x7c73('0x17f')]):_0x152509[_0x7c73('0x5b')]):getCallerId(_[_0x7c73('0xae')](_0x152509[_0x7c73('0x13c')])?_0x152509['Trunk'][_0x7c73('0x76')]:_0x152509[_0x7c73('0x13c')]['callerid'],_0x152509[_0x7c73('0x5a')],_0x152509['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x152509[_0x7c73('0x5b')],_0x152509[_0x7c73('0x17f')]):_0x152509[_0x7c73('0x5b')]);if(_0x4ac9ef){_0x3169f7[_0x7c73('0x180')]=_0x585a5e[_0x7c73('0x21')][_0x49ffdc][_0x7c73('0x181')]=extractCalleridName(_0x4ac9ef);_0x3169f7[_0x7c73('0x182')]=_0x585a5e[_0x7c73('0x21')][_0x49ffdc][_0x7c73('0x183')]=extractCalleridNumber(_0x4ac9ef);}return ami[_0x7c73('0xaf')]({'actionid':_0x49ffdc,'action':_0x7c73('0x163'),'channel':_0x585a5e['isTrunkReachable'](_0x152509[_0x7c73('0x75')])?util[_0x7c73('0x77')](_0x7c73('0x184'),_0x152509['Trunk'][_0x7c73('0x3b')],isNotNull(_0x152509['dialPrefix'])?_0x152509[_0x7c73('0x5d')]['trim']()||'':'',_0x152509[_0x7c73('0x185')]>0x0?_0x508a5d[_0x7c73('0x165')][_0x7c73('0x166')]['substring'](_0x152509['dialCutDigit']):_0x508a5d[_0x7c73('0x165')][_0x7c73('0x166')]):util[_0x7c73('0x77')](_0x7c73('0x184'),_[_0x7c73('0xae')](_0x152509[_0x7c73('0x13c')])?_0x152509['Trunk'][_0x7c73('0x3b')]:_0x152509[_0x7c73('0x13c')][_0x7c73('0x3b')],isNotNull(_0x152509[_0x7c73('0x5d')])?_0x152509[_0x7c73('0x5d')][_0x7c73('0x186')]()||'':'',_0x152509[_0x7c73('0x185')]>0x0?_0x508a5d[_0x7c73('0x165')][_0x7c73('0x166')][_0x7c73('0x187')](_0x152509['dialCutDigit']):_0x508a5d[_0x7c73('0x165')][_0x7c73('0x166')]),'callerid':_0x4ac9ef,'Exten':_0x7c73('0x16d'),'Context':_0x7c73('0x188'),'Priority':'1','variable':_0x3169f7,'timeout':(_0x152509['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x49ffdc})['then'](function(_0xe65318){return _0x1461fc(_0xe65318);})[_0x7c73('0xb9')](function(_0x58fc23){_0x152509[_0x7c73('0x66')]+=0x1;var _0x412923=new History(_0x585a5e[_0x7c73('0x21')][_0x49ffdc]);logger[_0x7c73('0x97')](util[_0x7c73('0x77')](_0x7c73('0x189'),JSON[_0x7c73('0x47')](_0x58fc23)));_0x412923[_0x7c73('0xa7')]=0xe;_0x412923['statedesc']=_0x7c73('0x18a');_0x412923[_0x7c73('0xa9')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x412923[_0x7c73('0xa8')]=_0x412923[_0x7c73('0xa9')];_0x585a5e['createHistory'](_0x412923)[_0x7c73('0xb9')](loggerCatch('[originate][error]'));_0x585a5e[_0x7c73('0xca')](_0x412923)[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x18b')))[_0x7c73('0x1b')](function(){delete _0x585a5e[_0x7c73('0x21')][_0x49ffdc];return _0x5cc256(msgResponse(_0x7c73('0x163'),_0x7c73('0x46'),_0x7c73('0x18c')));});});});};Dialer[_0x7c73('0x18')][_0x7c73('0x2e')]=function(_0x7b9968){var _0xbc70aa=this[_0x7c73('0x21')][_0x7b9968[_0x7c73('0x125')]];if(_0xbc70aa){delete this[_0x7c73('0x21')][_0x7b9968[_0x7c73('0x125')]];_0xbc70aa['responsetime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x4caf56=_0xbc70aa[_0x7c73('0x4b')]==='ivr'?this['campaigns'][_0xbc70aa['queue']]:this['voiceQueues'][_0xbc70aa[_0x7c73('0x18d')]()];if(!this['isSuccess'](_0x7b9968['response'])){this[_0x7c73('0xb3')](_0x4caf56);return this[_0x7c73('0x18e')](_0xbc70aa,_0x4caf56,_0x7b9968)['catch'](loggerCatch(_0x7c73('0x18f')));}this['uniqueId'][_0x7b9968[_0x7c73('0xe4')]]=_0xbc70aa;}};Dialer['prototype']['checkRetriveMax']=function(_0x337f8d,_0x150cc4,_0xfeba8a){var _0x4e1ab0=new History(_0x150cc4);if(_0x4e1ab0[_0x7c73('0xf0')]+_0x4e1ab0[_0x7c73('0x190')]+_0x4e1ab0[_0x7c73('0x191')]+_0x4e1ab0[_0x7c73('0x192')]+_0x4e1ab0['countdropretry']+_0x4e1ab0[_0x7c73('0xf2')]+_0x4e1ab0[_0x7c73('0xef')]+_0x4e1ab0[_0x7c73('0x102')]>=_0xfeba8a[_0x7c73('0xf3')]-0x1){return!![];}switch(_0x337f8d){case 0x3:if(_0x4e1ab0[_0x7c73('0x191')]>=_0xfeba8a[_0x7c73('0x193')]-0x1){return!![];}this[_0x7c73('0xc0')]({'active':![],'countnoanswerretry':_0x4e1ab0[_0x7c73('0x191')]+=0x1,'scheduledat':moment()['add'](_0xfeba8a[_0x7c73('0x194')],_0x7c73('0x11d'))['format'](_0x7c73('0xfa')),'ContactId':_0x4e1ab0[_0x7c73('0xd3')],'ListId':_0x4e1ab0[_0x7c73('0xd4')],'VoiceQueueId':_0x4e1ab0[_0x7c73('0xd6')]||undefined,'CampaignId':_0x4e1ab0[_0x7c73('0xd7')]||undefined})[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x195')));break;case 0x5:if(_0x4e1ab0[_0x7c73('0xf0')]>=_0xfeba8a['dialBusyMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x4e1ab0[_0x7c73('0xf0')]+=0x1,'scheduledat':moment()[_0x7c73('0x103')](_0xfeba8a[_0x7c73('0x196')],_0x7c73('0x11d'))[_0x7c73('0x77')](_0x7c73('0xfa')),'ContactId':_0x4e1ab0[_0x7c73('0xd3')],'ListId':_0x4e1ab0[_0x7c73('0xd4')],'VoiceQueueId':_0x4e1ab0['VoiceQueueId']||undefined,'CampaignId':_0x4e1ab0[_0x7c73('0xd7')]||undefined})[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x197')));break;case 0x8:if(_0x4e1ab0[_0x7c73('0x190')]>=_0xfeba8a[_0x7c73('0x198')]-0x1){return!![];}this[_0x7c73('0xc0')]({'active':![],'countcongestionretry':_0x4e1ab0[_0x7c73('0x190')]+=0x1,'scheduledat':moment()['add'](_0xfeba8a[_0x7c73('0x199')],_0x7c73('0x11d'))[_0x7c73('0x77')](_0x7c73('0xfa')),'ContactId':_0x4e1ab0[_0x7c73('0xd3')],'ListId':_0x4e1ab0[_0x7c73('0xd4')],'VoiceQueueId':_0x4e1ab0[_0x7c73('0xd6')]||undefined,'CampaignId':_0x4e1ab0[_0x7c73('0xd7')]||undefined})[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x19a')));break;case 0x0:if(_0x4e1ab0[_0x7c73('0x192')]>=_0xfeba8a[_0x7c73('0x19b')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x4e1ab0[_0x7c73('0x192')]+=0x1,'scheduledat':moment()[_0x7c73('0x103')](_0xfeba8a['dialNoSuchNumberRetryFrequency'],_0x7c73('0x11d'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e1ab0['ContactId'],'ListId':_0x4e1ab0[_0x7c73('0xd4')],'VoiceQueueId':_0x4e1ab0[_0x7c73('0xd6')]||undefined,'CampaignId':_0x4e1ab0[_0x7c73('0xd7')]||undefined})[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x19c')));}break;case 0xa:if(_0x4e1ab0[_0x7c73('0xf1')]>=_0xfeba8a[_0x7c73('0x11a')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x4e1ab0[_0x7c73('0xf1')]+=0x1,'scheduledat':moment()[_0x7c73('0x103')](_0xfeba8a[_0x7c73('0x11c')],'minutes')['format'](_0x7c73('0xfa')),'ContactId':_0x4e1ab0[_0x7c73('0xd3')],'ListId':_0x4e1ab0[_0x7c73('0xd4')],'VoiceQueueId':_0x4e1ab0[_0x7c73('0xd6')]||undefined,'CampaignId':_0x4e1ab0[_0x7c73('0xd7')]||undefined})[_0x7c73('0xb9')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x4e1ab0['countabandonedretry']>=_0xfeba8a['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x7c73('0xc0')]({'active':![],'countabandonedretry':_0x4e1ab0[_0x7c73('0xf2')]+=0x1,'scheduledat':moment()['add'](_0xfeba8a['dialAbandonedRetryFrequency'],_0x7c73('0x11d'))['format'](_0x7c73('0xfa')),'ContactId':_0x4e1ab0['ContactId'],'ListId':_0x4e1ab0['ListId'],'VoiceQueueId':_0x4e1ab0[_0x7c73('0xd6')]||undefined,'CampaignId':_0x4e1ab0['CampaignId']||undefined})['catch'](loggerCatch(_0x7c73('0x123')));break;case 0x13:if(_0x4e1ab0[_0x7c73('0xef')]>=_0xfeba8a[_0x7c73('0xf6')]-0x1){return!![];}this[_0x7c73('0xc0')]({'active':![],'countmachineretry':_0x4e1ab0['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0xfeba8a[_0x7c73('0xf9')],'minutes')[_0x7c73('0x77')](_0x7c73('0xfa')),'ContactId':_0x4e1ab0[_0x7c73('0xd3')],'ListId':_0x4e1ab0[_0x7c73('0xd4')],'VoiceQueueId':_0x4e1ab0[_0x7c73('0xd6')]||undefined,'CampaignId':_0x4e1ab0[_0x7c73('0xd7')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x4e1ab0[_0x7c73('0x102')]>=_0xfeba8a['dialAgentRejectMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x4e1ab0[_0x7c73('0x102')]+=0x1,'scheduledat':moment()['add'](_0xfeba8a[_0x7c73('0x19d')],_0x7c73('0x11d'))[_0x7c73('0x77')](_0x7c73('0xfa')),'ContactId':_0x4e1ab0[_0x7c73('0xd3')],'ListId':_0x4e1ab0[_0x7c73('0xd4')],'VoiceQueueId':_0x4e1ab0[_0x7c73('0xd6')]||undefined,'CampaignId':_0x4e1ab0['CampaignId']||undefined})[_0x7c73('0xb9')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x7c73('0x18')][_0x7c73('0x18e')]=function(_0x506b10,_0x2a524d,_0x36538b){var _0x2ad0f7=this;var _0x45f419=new History(_0x506b10);return new BPromise(function(_0x160a46,_0x25eca3){if(_[_0x7c73('0x39')](_0x2a524d)&&typeof _0x2a524d!==_0x7c73('0x162')){return _0x25eca3(msgResponse('[callProgressDetecting]',_0x7c73('0x143'),_0x7c73('0x19e')));}if(_[_0x7c73('0x39')](_0x36538b)&&typeof _0x36538b!==_0x7c73('0x162')){return _0x25eca3(msgResponse(_0x7c73('0x19f'),_0x7c73('0x143'),_0x7c73('0x1a0')));}switch(_0x36538b['reason']){case'0':_0x2a524d[_0x7c73('0x65')]+=0x1;_0x45f419[_0x7c73('0xa7')]=0x0;_0x45f419[_0x7c73('0xee')]=_0x7c73('0x1a1');_0x45f419[_0x7c73('0x192')]+=0x1;_0x45f419[_0x7c73('0x100')]+=0x1;ami[_0x7c73('0x4a')]('custom:agentnosuchnumber',ut[_0x7c73('0xe9')](_0x506b10,_0x7c73('0x1a2')));_0x2ad0f7['createHistory'](_0x45f419)[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x101')));if(_0x2ad0f7['checkRetriveMax'](0x0,_0x506b10,_0x2a524d)){if(_0x45f419[_0x7c73('0x192')]>=_0x2a524d[_0x7c73('0x19b')]){_0x2ad0f7[_0x7c73('0xf7')](_0x45f419,_0x160a46,_0x25eca3,'reason\x200\x20no\x20such\x20number....');}else{_0x2ad0f7[_0x7c73('0xf4')](_0x45f419,_0x160a46,_0x25eca3,_0x7c73('0x1a3'));}}break;case'3':_0x2a524d[_0x7c73('0x64')]+=0x1;_0x45f419['state']=0x3;_0x45f419['statedesc']=_0x7c73('0x1a4');_0x45f419[_0x7c73('0x191')]+=0x1;_0x45f419[_0x7c73('0x100')]+=0x1;ami[_0x7c73('0x4a')](_0x7c73('0x1a5'),ut['buildObj'](_0x506b10,_0x7c73('0x1a6')));_0x2ad0f7[_0x7c73('0xcb')](_0x45f419)[_0x7c73('0xb9')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x2ad0f7[_0x7c73('0x1a7')](0x3,_0x506b10,_0x2a524d)){if(_0x45f419[_0x7c73('0x191')]>=_0x2a524d[_0x7c73('0x193')]){_0x2ad0f7[_0x7c73('0xf7')](_0x45f419,_0x160a46,_0x25eca3,'reason\x203\x20ringing\x20no\x20answer');}else{_0x2ad0f7[_0x7c73('0xf4')](_0x45f419,_0x160a46,_0x25eca3,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x2a524d[_0x7c73('0x60')]+=0x1;_0x45f419[_0x7c73('0xa7')]=0x5;_0x45f419[_0x7c73('0xee')]=_0x7c73('0x1a8');_0x45f419['countbusyretry']+=0x1;_0x45f419[_0x7c73('0x100')]+=0x1;ami['emit'](_0x7c73('0x1a9'),ut[_0x7c73('0xe9')](_0x506b10,'busy'));_0x2ad0f7[_0x7c73('0xcb')](_0x45f419)[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x1aa')));if(_0x2ad0f7[_0x7c73('0x1a7')](0x5,_0x506b10,_0x2a524d)){if(_0x45f419['countbusyretry']>=_0x2a524d[_0x7c73('0x1ab')]){_0x2ad0f7['createStateFinal'](_0x45f419,_0x160a46,_0x25eca3,'reason\x205\x20busy');}else{_0x2ad0f7[_0x7c73('0xf4')](_0x45f419,_0x160a46,_0x25eca3,_0x7c73('0x1ac'));}}break;case'8':_0x2a524d['outboundCongestionCallsDay']+=0x1;_0x45f419[_0x7c73('0xa7')]=0x8;_0x45f419['statedesc']='Congestion';_0x45f419[_0x7c73('0x190')]+=0x1;_0x45f419[_0x7c73('0x100')]+=0x1;ami[_0x7c73('0x4a')]('custom:agentcongestion',ut['buildObj'](_0x506b10,_0x7c73('0x1ad')));_0x2ad0f7['createHistory'](_0x45f419)[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x1ae')));if(_0x2ad0f7[_0x7c73('0x1a7')](0x8,_0x506b10,_0x2a524d)){if(_0x45f419['countcongestionretry']>=_0x2a524d[_0x7c73('0x198')]){_0x2ad0f7[_0x7c73('0xf7')](_0x45f419,_0x160a46,_0x25eca3,_0x7c73('0x1af'));}else{_0x2ad0f7[_0x7c73('0xf4')](_0x45f419,_0x160a46,_0x25eca3,'reason\x208\x20congestion');}}break;case'11':_0x2a524d[_0x7c73('0x1b0')]+=0x1;_0x45f419[_0x7c73('0xa7')]=0xb;_0x45f419[_0x7c73('0xee')]=_0x7c73('0x121');_0x45f419[_0x7c73('0xf2')]+=0x1;_0x45f419[_0x7c73('0x100')]+=0x1;_0x2ad0f7['createHistory'](_0x45f419)[_0x7c73('0xb9')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x2ad0f7[_0x7c73('0x1a7')](0xb,_0x506b10,_0x2a524d)){if(_0x45f419['countabandonedretry']>=_0x2a524d[_0x7c73('0x1b1')]){_0x2ad0f7[_0x7c73('0xf7')](_0x45f419,_0x160a46,_0x25eca3,'reason\x2011\x20abandoned');}else{_0x2ad0f7[_0x7c73('0xf4')](_0x45f419,_0x160a46,_0x25eca3,'reason\x2011\x20abandoned');}}break;case'20':_0x2a524d[_0x7c73('0x1b2')]+=0x1;_0x45f419[_0x7c73('0xa7')]=0x14;_0x45f419[_0x7c73('0xee')]=_0x7c73('0x1b3');_0x45f419['countagentrejectretry']+=0x1;_0x45f419['countglobal']+=0x1;ami[_0x7c73('0x4a')]('custom:agentreject',ut[_0x7c73('0xe9')](_0x506b10,'agentreject'));_0x2ad0f7[_0x7c73('0xcb')](_0x45f419)[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x1b4')));if(_0x2ad0f7[_0x7c73('0x1a7')](0x14,_0x506b10,_0x2a524d)){if(_0x45f419['countagentrejectretry']>=_0x2a524d[_0x7c73('0x1b5')]){_0x2ad0f7['createStateFinal'](_0x45f419,_0x160a46,_0x25eca3,_0x7c73('0x1b6'));}else{_0x2ad0f7['stateGlobal'](_0x45f419,_0x160a46,_0x25eca3,_0x7c73('0x1b6'));}}break;default:_0x2a524d[_0x7c73('0x1b7')]+=0x1;_0x45f419[_0x7c73('0xa7')]=0xc;_0x45f419['statedesc']=_0x36538b['reason'];_0x2ad0f7[_0x7c73('0xcb')](_0x45f419)[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x1b8')));if(_0x2ad0f7[_0x7c73('0x1a7')](_0x36538b['reason'],_0x506b10,_0x2a524d)){if(_0x45f419['countbusyretry']+_0x45f419[_0x7c73('0x190')]+_0x45f419['countnoanswerretry']+_0x45f419[_0x7c73('0x192')]+_0x45f419['countdropretry']+_0x45f419[_0x7c73('0xf2')]+_0x45f419['countmachineretry']+_0x45f419[_0x7c73('0x102')]>=_0x2a524d[_0x7c73('0xf3')]){_0x2ad0f7[_0x7c73('0xf4')](_0x45f419,_0x160a46,_0x25eca3,_0x36538b[_0x7c73('0x10c')]);}else{_0x2ad0f7[_0x7c73('0xf7')](_0x45f419,_0x160a46,_0x25eca3,_0x36538b[_0x7c73('0x10c')]);}}}});};Dialer[_0x7c73('0x18')]['stateGlobal']=function(_0x533c78,_0xe29d11,_0x5d24e4,_0x20b4ef){var _0xdca2e2=new Final(_0x533c78);_0xdca2e2[_0x7c73('0xa7')]=0xf;_0xdca2e2[_0x7c73('0xee')]=_0x7c73('0x1b9');this[_0x7c73('0xf7')](_0xdca2e2,_0xe29d11,_0x5d24e4,_0x20b4ef);};Dialer[_0x7c73('0x18')][_0x7c73('0xf7')]=function(_0x5da743,_0x4927b9,_0x4a4567,_0x5daf64){this['moveContactManagedDialer'](_0x5da743)[_0x7c73('0xb8')](function(){return _0x4927b9(msgResponse(_0x7c73('0x19f'),_0x7c73('0xda'),_0x5daf64));})[_0x7c73('0xb9')](function(){return _0x4a4567(msgResponse(_0x7c73('0x1ba'),_0x7c73('0x143'),_0x7c73('0x1bb')));});};Dialer[_0x7c73('0x18')][_0x7c73('0x9')]=function(_0x172171){var _0x7d9be9=_0x172171[_0x7c73('0x1bc')]/0x64;var _0x4b8746=_0x172171[_0x7c73('0x116')]/(_0x172171[_0x7c73('0x116')]+_0x172171[_0x7c73('0x5e')]);var _0x47c546=Math[_0x7c73('0x1bd')](_0x172171['predictiveIntervalAvailable']*(_0x172171[_0x7c73('0x1be')]/0x64));var _0x34599b=Math[_0x7c73('0x1bd')](_0x172171[_0x7c73('0x70')]*(_0x172171['predictiveIntervalMinThreshold']/0x64));var _0x49aa5a=_0x172171[_0x7c73('0x4f')]+_0x172171['talking'];var _0x5b3746=Math[_0x7c73('0x1bf')](_0x172171[_0x7c73('0x89')]*_0x172171[_0x7c73('0x8c')]*_0x172171[_0x7c73('0x6d')]*_0x172171['predictiveIntervalMultiplicativeFactor']);if(_[_0x7c73('0x39')](_0x172171[_0x7c73('0x74')])){if(!_[_0x7c73('0x39')](_0x172171['startPredictive'])){_0x172171['startPredictive']=undefined;loggerPredictive[_0x7c73('0x97')](_0x7c73('0x1c0'),_0x7c73('0x1c1'));}if(!_[_0x7c73('0x39')](_0x172171[_0x7c73('0x93')])){loggerPredictive[_0x7c73('0x97')](_0x7c73('0x1c0'),_0x7c73('0x1c2'));clearInterval(_0x172171['handlePredictive']);_0x172171[_0x7c73('0x93')]=undefined;}_0x172171['startProgressive']=moment()[_0x7c73('0x77')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x7c73('0x7b')](_0x172171[_0x7c73('0x3b')],_0x7c73('0x1c3'),_0x172171[_0x7c73('0x74')]);this['handlePower'](_0x172171,0x1);}else if(ifInterval(_0x172171[_0x7c73('0x1c4')],_0x172171[_0x7c73('0x74')])){this[_0x7c73('0x154')](_0x172171,0x1);loggerPredictiveCalls[_0x7c73('0x7b')](_0x7c73('0x1c5'),_0x172171[_0x7c73('0x74')],_0x172171[_0x7c73('0x3b')]);_0x172171['erlangCalls']=0x0;_0x172171[_0x7c73('0x6c')]=0x0;}else if(_0x7d9be9<_0x4b8746&&_0x172171[_0x7c73('0x1c6')]==='dropRate'){freeVariablesPredictive(_0x172171);loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x1c7'),_0x7c73('0x1c8'),_0x4b8746,_0x7c73('0x74'),_0x172171[_0x7c73('0x3b')]);}else if(_0x5b3746<_0x172171[_0x7c73('0x6c')]&&_0x172171[_0x7c73('0x1c6')]===_0x7c73('0x1c9')){freeVariablesPredictive(_0x172171);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x7c73('0x1ca'),_0x5b3746,_0x7c73('0x1cb'),_0x172171[_0x7c73('0x6c')],_0x7c73('0x74'),_0x172171[_0x7c73('0x3b')]);}else if(!ifInterval(_0x172171[_0x7c73('0x1c4')],_0x172171[_0x7c73('0x74')])&&_[_0x7c73('0x39')](_0x172171['startPredictive'])&&!_['isUndefined'](_0x172171[_0x7c73('0x74')])){_0x172171[_0x7c73('0x25')]=moment()[_0x7c73('0x77')](_0x7c73('0xfa'));loggerPredictive[_0x7c73('0x7b')](_0x172171['name'],'started\x20in\x20predictive\x20at',_0x172171[_0x7c73('0x25')]);this[_0x7c73('0x1cc')](_0x172171['dialPredictiveInterval'])['then'](this['getDataPredictive'](_0x172171))[_0x7c73('0xb8')](mergeDataErlangB(_0x172171))['then'](this[_0x7c73('0x1cd')](_0x172171))[_0x7c73('0xb9')](loggerCatchPredictive(_0x7c73('0x1ce'),_0x172171));}else if(!ifInterval(_0x172171['dialPredictiveInterval'],_0x172171['startPredictive'])){_0x172171[_0x7c73('0x6c')]=0x0;_0x172171[_0x7c73('0x25')]=moment()[_0x7c73('0x77')](_0x7c73('0xfa'));loggerPredictive[_0x7c73('0x7b')](_0x172171['name'],_0x7c73('0x1cf'),_0x172171[_0x7c73('0x25')]);clearInterval(_0x172171['handlePredictive']);_0x172171[_0x7c73('0x93')]=undefined;this[_0x7c73('0x1cc')](_0x172171[_0x7c73('0x1c4')])['then'](this[_0x7c73('0x1d0')](_0x172171))[_0x7c73('0xb8')](mergeDataErlangB(_0x172171))[_0x7c73('0xb8')](this['startMethodPredictive'](_0x172171))[_0x7c73('0xb9')](loggerCatchPredictive(_0x7c73('0x1d1'),_0x172171));}else if(_0x172171[_0x7c73('0x70')]&&_0x49aa5a<_0x172171['predictiveIntervalAvailable']-_0x34599b){freeVariablesPredictive(_0x172171);loggerPredictive[_0x7c73('0x7b')](_0x172171['name'],_0x7c73('0x1d2'),_0x49aa5a,_0x7c73('0x1d3'),_0x172171[_0x7c73('0x70')],'-',_0x34599b,'=',_0x172171[_0x7c73('0x70')]-_0x34599b,')');}else if(_0x172171['predictiveIntervalAvailable']&&_0x49aa5a>_0x172171[_0x7c73('0x70')]+_0x47c546){freeVariablesPredictive(_0x172171);loggerPredictive['info'](_0x172171['name'],_0x7c73('0x1d2'),_0x49aa5a,_0x7c73('0x1d4'),_0x172171[_0x7c73('0x70')],'+',_0x47c546,'=',_0x172171[_0x7c73('0x70')]+_0x47c546,')');}};Dialer[_0x7c73('0x18')][_0x7c73('0x1d0')]=function(_0x56a092){var _0x255121=this;return function(_0x429ac9){return new BPromise(function(_0x233967,_0x234735){_[_0x7c73('0x8f')](_0x56a092,_0x429ac9[0x0]);if(checkGetDataPredictive(_0x429ac9[0x0])){var _0x22a838=_0x56a092[_0x7c73('0x70')]=_0x56a092[_0x7c73('0x54')]+_0x56a092[_0x7c73('0x4f')];var _0x59e49b=_0x56a092[_0x7c73('0x1c4')]*0x3c;var _0x2900cc=_0x429ac9[0x0][_0x7c73('0x69')]+_0x429ac9[0x0]['predictiveIntervalAvgHoldtime'];var _0x9d6375=(_0x429ac9[0x0][_0x7c73('0x7e')]+_0x429ac9[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x429ac9[0x0][_0x7c73('0x6a')])/_0x429ac9[0x0][_0x7c73('0x71')];_0x56a092[_0x7c73('0x6d')]=_0x9d6375>0x0?_0x9d6375:0x1;switch(_0x56a092[_0x7c73('0x1c6')]){case _0x7c73('0x1c9'):var _0xab713d=_0x56a092[_0x7c73('0x1bc')]/0x64;return _0x255121[_0x7c73('0x1d5')](_0x22a838,_0x59e49b,_0x2900cc,_0x9d6375,_0xab713d)['then'](function(_0x12c1d3){return _0x233967(_0x12c1d3);});case'agentBusyFactor':var _0x7a6346=_0x56a092[_0x7c73('0x1bc')]/0x64;return _0x255121[_0x7c73('0x1d6')](_0x22a838,_0x59e49b,_0x2900cc,_0x9d6375,_0x7a6346)[_0x7c73('0xb8')](function(_0x4b39cc){return _0x233967(_0x4b39cc);});default:return _0x234735(msgResponse(_0x7c73('0x1d7'),_0x7c73('0x143'),_0x7c73('0x1d8')));}}else{return _0x234735(msgResponse(_0x7c73('0x1d7'),_0x7c73('0x143'),_0x7c73('0x1d9')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x5e9a5f){var _0x521efc=this;return function(_0x2b8b08){return new BPromise(function(_0x31ab13,_0x12aa4d){_['merge'](_0x5e9a5f,_0x2b8b08[0x0]);if(checkGetDataPredictive(_0x2b8b08[0x0])){loggerPredictive[_0x7c73('0x7b')](JSON[_0x7c73('0x47')](_0x2b8b08[0x0]));if(_0x5e9a5f[_0x7c73('0x1c6')]==='dropRate'){return _0x521efc['getVoiceQueueRtPauses'](_0x5e9a5f['id'])['then'](function(_0x46606d){var _0x23b626=_0x5e9a5f['loggedIn']-_0x46606d[0x0][_0x7c73('0x1da')];var _0x25ba70=_0x5e9a5f['dialPredictiveInterval']*0x3c;var _0x37876c=_0x2b8b08[0x0][_0x7c73('0x69')]+_0x2b8b08[0x0][_0x7c73('0x68')];var _0x36f774=(_0x2b8b08[0x0]['predictiveIntervalAnsweredCalls']+_0x2b8b08[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2b8b08[0x0][_0x7c73('0x6a')])/_0x2b8b08[0x0][_0x7c73('0x71')];var _0xab415d=_0x5e9a5f[_0x7c73('0x1bc')]/0x64;_0x5e9a5f[_0x7c73('0x6f')]=_0x46606d[0x0][_0x7c73('0x1da')]||0x0;_0x5e9a5f[_0x7c73('0x6d')]=_0x36f774>0x0?_0x36f774:0x1;return _0x521efc[_0x7c73('0x1d5')](_0x23b626,_0x25ba70,_0x37876c,_0x36f774,_0xab415d);})[_0x7c73('0xb8')](function(_0x593e44){return _0x31ab13(_0x593e44);})[_0x7c73('0xb9')](function(_0x1c02b3){return _0x12aa4d(msgResponse(_0x7c73('0x1db'),_0x7c73('0x143'),JSON[_0x7c73('0x47')](_0x1c02b3)));});}if(_0x5e9a5f['dialPredictiveOptimization']===_0x7c73('0x1dc')){return _0x521efc[_0x7c73('0xc8')](_0x5e9a5f['id'])[_0x7c73('0xb8')](function(_0x430b75){var _0x1241d2=_0x5e9a5f[_0x7c73('0x50')]-_0x430b75[0x0][_0x7c73('0x1da')];var _0x43a93a=_0x5e9a5f[_0x7c73('0x1c4')]*0x3c;var _0x4069c0=_0x2b8b08[0x0][_0x7c73('0x69')]+_0x2b8b08[0x0][_0x7c73('0x68')];var _0x4d5911=(_0x2b8b08[0x0]['predictiveIntervalAnsweredCalls']+_0x2b8b08[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2b8b08[0x0][_0x7c73('0x6a')])/_0x2b8b08[0x0]['predictiveIntervalTotalCalls'];var _0x598e52=_0x5e9a5f['dialPredictiveOptimizationPercentage']/0x64;_0x5e9a5f[_0x7c73('0x6f')]=_0x430b75[0x0][_0x7c73('0x1da')]||0x0;_0x5e9a5f[_0x7c73('0x6d')]=_0x4d5911>0x0?_0x4d5911:0x1;return _0x521efc['busyFactor'](_0x1241d2,_0x43a93a,_0x4069c0,_0x4d5911,_0x598e52);})[_0x7c73('0xb8')](function(_0x1f4aed){return _0x31ab13(_0x1f4aed);})[_0x7c73('0xb9')](function(_0x5685b1){return _0x12aa4d(msgResponse('[CatchErlangB]','Failure',JSON[_0x7c73('0x47')](_0x5685b1)));});}}else{return _0x12aa4d(msgResponse('[getDataPredictive]','Failure',_0x7c73('0x1d9')));}});};};Dialer['prototype'][_0x7c73('0x1cd')]=function(_0x6e335c){var _0x507acb=this;return function(){var _0x56e920=0x0;var _0x10505b=Math[_0x7c73('0x1bf')](_0x6e335c[_0x7c73('0x73')]*0x3e8);if(_0x10505b>0x0){_0x10505b=_0x10505b<0x64?0x64:_0x10505b;loggerPredictive[_0x7c73('0x7b')](_0x6e335c[_0x7c73('0x3b')],_0x7c73('0x1dd'),_0x10505b,_0x7c73('0x48'));_0x6e335c['handlePredictive']=setInterval(function(){_0x507acb['handlePredictive'](_0x6e335c);loggerPredictiveCalls[_0x7c73('0x7b')](_0x7c73('0x1de'),_0x56e920+=0x1);},_0x10505b);}else{loggerPredictive['info'](_0x6e335c[_0x7c73('0x3b')],_0x7c73('0x1df'));}};};Dialer[_0x7c73('0x18')][_0x7c73('0x1e0')]=function(_0x10789f,_0xd9a750){var _0x19a9aa=this;return function(_0x32c628){if(_['isEmpty'](_0x32c628)){if(_[_0x7c73('0xae')](_0xd9a750[_0x7c73('0xd5')])||!_0xd9a750[_0x7c73('0x1e1')]){if(_0x10789f[_0x7c73('0x59')]===_0x7c73('0x1e2')){_0x10789f[_0x7c73('0x12c')]=_[_0x7c73('0x39')](_0x10789f['queueStatusComplete'])?!![]:_0x10789f[_0x7c73('0x12c')];var _0x303d8a=uuid['v4']();_0x19a9aa[_0x7c73('0x21')][_0x303d8a]=new Action(_0x10789f,_0xd9a750,_0x303d8a);loggerBooked[_0x7c73('0x7b')](_0x7c73('0x1e3'),_0x303d8a,'queueStatusComplete:\x20',JSON[_0x7c73('0x47')](_0x10789f[_0x7c73('0x12c')]),_0x7c73('0x1e4'),_0x10789f['name']);if(_0x10789f['queueStatusComplete']){_0x10789f[_0x7c73('0x12c')]=![];_0x19a9aa[_0x7c73('0x27')][_0x19a9aa['actions'][_0x303d8a][_0x7c73('0xb5')]]=[];ami[_0x7c73('0xaf')]({'actionid':_0x303d8a,'action':'queuestatus','queue':_0x10789f[_0x7c73('0x3b')]})['catch'](function(){_0x19a9aa[_0x7c73('0xb3')](_0x10789f);_0x19a9aa[_0x7c73('0xc0')]({'active':![],'ContactId':_0x19a9aa[_0x7c73('0x21')][_0x303d8a][_0x7c73('0xd3')],'ListId':_0x19a9aa[_0x7c73('0x21')][_0x303d8a][_0x7c73('0xd4')],'VoiceQueueId':_0x19a9aa[_0x7c73('0x21')][_0x303d8a][_0x7c73('0xd6')]||undefined,'CampaignId':_0x19a9aa['actions'][_0x303d8a][_0x7c73('0xd7')]||undefined})[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x1e5')));delete _0x19a9aa[_0x7c73('0x21')][_0x303d8a];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0x7c73('0x47')](_0x10789f[_0x7c73('0x12c')]),_0x7c73('0x1e4'),_0x10789f[_0x7c73('0x3b')]);_0x19a9aa[_0x7c73('0xb3')](_0x10789f);_0x19a9aa[_0x7c73('0xc0')]({'active':![],'ContactId':_0x19a9aa[_0x7c73('0x21')][_0x303d8a][_0x7c73('0xd3')],'ListId':_0x19a9aa[_0x7c73('0x21')][_0x303d8a][_0x7c73('0xd4')],'VoiceQueueId':_0x19a9aa[_0x7c73('0x21')][_0x303d8a][_0x7c73('0xd6')]||undefined,'CampaignId':_0x19a9aa[_0x7c73('0x21')][_0x303d8a][_0x7c73('0xd7')]||undefined})[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x1e5')));delete _0x19a9aa[_0x7c73('0x21')][_0x303d8a];}}else{return _0x19a9aa[_0x7c73('0x1e6')](_0x10789f,_0xd9a750);}}else{if(getDiff(_0xd9a750[_0x7c73('0x1e7')])<_0x10789f[_0x7c73('0x1e8')]*0x3c){if(_0xd9a750[_0x7c73('0x1e9')]&&!_0xd9a750[_0x7c73('0x1e9')][_0x7c73('0x1ea')]){_0x19a9aa[_0x7c73('0x1c')]['run'](_0xd9a750['id'])[_0x7c73('0x1b')](function(){_0x19a9aa[_0x7c73('0xb3')](_0x10789f);});}else{_0x19a9aa[_0x7c73('0xc1')]({'active':![]},_0xd9a750['id'],0x1)[_0x7c73('0x1b')](function(){_0x19a9aa[_0x7c73('0xb3')](_0x10789f);});}}else{_0x10789f[_0x7c73('0x67')]+=0x1;_0x19a9aa[_0x7c73('0xb3')](_0x10789f);if(_0x10789f[_0x7c73('0x1eb')]){_0x19a9aa[_0x7c73('0xc0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xd9a750[_0x7c73('0xd3')],'ListId':_0xd9a750[_0x7c73('0xd4')],'VoiceQueueId':_0xd9a750[_0x7c73('0xd6')]||undefined,'CampaignId':_0xd9a750[_0x7c73('0xd7')]||undefined})[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x1ec')));_0x19a9aa[_0x7c73('0xcb')](createObjHistory(_0x10789f,_0xd9a750,_0x7c73('0x1ed'),0x17,_0x7c73('0x1ee')))[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x1ef')));}else{_0x19a9aa[_0x7c73('0xd1')](createObjHistory(_0x10789f,_0xd9a750,_0x7c73('0x1f0'),0x16,_0x7c73('0x1f1')),'[Originate][HistoryRecallClose][historyCatch]',_0x7c73('0x1f2'));}}}}else{_0x10789f[_0x7c73('0x5f')]+=0x1;_0x19a9aa[_0x7c73('0xd1')](createObjHistory(_0x10789f,_0xd9a750,'BLACKLIST',0xd,'Blacklist'),_0x7c73('0x1f3'),_0x7c73('0x1f4'));throw _0x7c73('0x1f5');}};};Dialer[_0x7c73('0x18')][_0x7c73('0x158')]=function(_0x31639e){var _0x900c2b=this;var _0x2e5eb9=_0x31639e[_0x7c73('0x1f6')]-_0x31639e[_0x7c73('0x72')]-_0x31639e['temp'];emitCampaignSummary(_0x31639e);if(_0x2e5eb9>0x0){if(_0x2e5eb9>this['maxNumberOriginate']){_0x2e5eb9=this[_0x7c73('0x20')];}_0x31639e[_0x7c73('0xc4')]+=_0x2e5eb9;this['getContactDialerIvr'](_0x31639e['id'],_0x2e5eb9,_0x31639e[_0x7c73('0x1f7')],_0x31639e)[_0x7c73('0xb8')](function(_0x4a9b34){_0x31639e['temp']-=_0x2e5eb9;_0x31639e[_0x7c73('0xc4')]=_0x31639e['temp']>0x0?_0x31639e[_0x7c73('0xc4')]:0x0;if(!checkContactEmpty(_0x4a9b34)){_0x31639e[_0x7c73('0x3d')]=_0x7c73('0xa0');logger[_0x7c73('0x7b')]('[getContactCampaign2][Empty]'+_0x31639e[_0x7c73('0x3b')]);}else{_0x31639e[_0x7c73('0x72')]+=_0x4a9b34[_0x7c73('0x130')];_0x31639e[_0x7c73('0x3d')]=_0x7c73('0x1f8');for(var _0x5d8b12=0x0;_0x5d8b12<_0x4a9b34['length'];_0x5d8b12+=0x1){_0x31639e[_0x7c73('0x1f9')]+=0x1;if(_[_0x7c73('0xae')](_0x4a9b34[_0x5d8b12])||_[_0x7c73('0xae')](_0x4a9b34[_0x5d8b12][_0x7c73('0x165')])||_[_0x7c73('0xae')](_0x4a9b34[_0x5d8b12][_0x7c73('0x165')][_0x7c73('0x166')])){_0x900c2b['emptyContact']('[actionOriginate]\x20',_0x31639e,_0x4a9b34[_0x5d8b12]);}else{_0x900c2b[_0x7c73('0xbc')](_[_0x7c73('0xd2')](_0x4a9b34[_0x5d8b12],['CampaignId','Contact.phone']))[_0x7c73('0xb8')](_0x900c2b['checkContactBlack'](_0x31639e,_0x4a9b34[_0x5d8b12]))['catch'](_0x900c2b[_0x7c73('0xcf')]('[actionOriginateIvr]\x20',_0x31639e));}}}})[_0x7c73('0xb9')](loggerGetContactDialer(_0x7c73('0x1fa'),_0x31639e,_0x2e5eb9));}};Dialer[_0x7c73('0x18')][_0x7c73('0x154')]=function(_0x150c55,_0x2284e4){var _0x4de259=this;var _0x4d2273=[];var _0x673a56=_0x2284e4>=0x1?_0x2284e4:0x1;if(_0x150c55[_0x7c73('0x59')]===_0x7c73('0x1e2')){_0x673a56=0x1;}var _0x4ce2df=Math[_0x7c73('0x1bf')](_0x150c55[_0x7c73('0x4f')]*_0x673a56)-_0x150c55[_0x7c73('0x72')]-_0x150c55['temp'];emitVoiceQueueSummary(_0x150c55);if(_0x150c55[_0x7c73('0x1fb')]>0x0){var _0x182bce=_0x150c55[_0x7c73('0x1fb')]-_0x150c55[_0x7c73('0x72')]-_0x150c55[_0x7c73('0x54')]-_0x150c55['temp']-_0x150c55[_0x7c73('0x51')];if(_0x4ce2df>_0x182bce){_0x4ce2df=_0x182bce;}}if(_0x4ce2df>0x0){if(_0x150c55[_0x7c73('0x59')]===_0x7c73('0x1e2')){_0x4ce2df=0x1;}if(_0x4ce2df>this[_0x7c73('0x20')]){_0x4ce2df=this[_0x7c73('0x20')];}_0x150c55['temp']+=_0x4ce2df;for(var _0x50827d in this[_0x7c73('0x128')]){if(typeof this[_0x7c73('0x128')][_0x50827d]!==_0x7c73('0x9a')){if(this[_0x7c73('0x128')][_0x50827d][_0x7c73('0xa7')]===_0x7c73('0x1fc')&&this[_0x7c73('0x128')][_0x50827d][_0x7c73('0xb0')]===_0x7c73('0xdd')){_0x4d2273[_0x7c73('0x12a')](this['agents'][_0x50827d]['id']);}}}this[_0x7c73('0xc3')](_0x150c55['id'],_0x4d2273,_0x4ce2df,_0x150c55[_0x7c73('0x1f7')],_0x150c55)[_0x7c73('0xb8')](function(_0x5ad25e){_0x150c55['temp']-=_0x4ce2df;_0x150c55[_0x7c73('0xc4')]=_0x150c55[_0x7c73('0xc4')]>0x0?_0x150c55[_0x7c73('0xc4')]:0x0;if(!checkContactEmpty(_0x5ad25e)){_0x4de259[_0x7c73('0xb6')](_0x150c55)[_0x7c73('0xb8')](sendMessageReschedule(_0x150c55))[_0x7c73('0xb9')](loggerCatch('[countReScheduled]\x20'));}else{_0x150c55['originated']+=_0x5ad25e[_0x7c73('0x130')];_0x150c55['message']=_0x150c55[_0x7c73('0x59')]===_0x7c73('0x1e2')?'ACTIVE':_0x7c73('0x1f8');for(var _0x16dc34=0x0;_0x16dc34<_0x5ad25e[_0x7c73('0x130')];_0x16dc34+=0x1){if(_['isNil'](_0x5ad25e[_0x16dc34])||_[_0x7c73('0xae')](_0x5ad25e[_0x16dc34][_0x7c73('0x165')])||_[_0x7c73('0xae')](_0x5ad25e[_0x16dc34][_0x7c73('0x165')]['phone'])){_0x4de259['emptyContact'](_0x7c73('0x1fd'),_0x150c55,_0x5ad25e[_0x16dc34]);}else{_0x4de259[_0x7c73('0xba')](_['pick'](_0x5ad25e[_0x16dc34],[_0x7c73('0xd6'),_0x7c73('0x1fe')]))[_0x7c73('0xb8')](_0x4de259[_0x7c73('0x1e0')](_0x150c55,_0x5ad25e[_0x16dc34]))[_0x7c73('0xb9')](_0x4de259[_0x7c73('0xcf')](_0x7c73('0x1fd'),_0x150c55));}}}})['catch'](loggerGetContactDialer(_0x7c73('0x1ff'),_0x150c55,_0x4ce2df));}};Dialer['prototype'][_0x7c73('0x93')]=function(_0xed724f){if(_0xed724f[_0x7c73('0x1fb')]>0x0){var _0x4a0ace=_0xed724f['dialLimitQueue']-_0xed724f[_0x7c73('0x72')]-_0xed724f[_0x7c73('0x54')];if(_0x4a0ace>0x0){this['tryOriginatePredictive'](_0xed724f);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0x7c73('0x200')](_0xed724f);}};Dialer['prototype'][_0x7c73('0x200')]=function(_0x4d5916){var _0x5716c3=this;var _0x128854=[];_0x4d5916['originated']+=0x1;for(var _0x4d005c in this[_0x7c73('0x128')]){if(typeof this[_0x7c73('0x128')][_0x4d005c]!=='undefined'){if(this[_0x7c73('0x128')][_0x4d005c]['state']==='not_inuse'&&this[_0x7c73('0x128')][_0x4d005c][_0x7c73('0xb0')]===_0x7c73('0xdd')){_0x128854[_0x7c73('0x12a')](this[_0x7c73('0x128')][_0x4d005c]['id']);}}}this['getContactDialer'](_0x4d5916['id'],_0x128854,0x1,_0x4d5916[_0x7c73('0x1f7')],_0x4d5916)[_0x7c73('0xb8')](function(_0x5b6f3a){if(!checkContactEmpty(_0x5b6f3a)){checkContactLowerLimitOriginate(_0x4d5916,0x1,0x0);_0x5716c3[_0x7c73('0xb6')](_0x4d5916)[_0x7c73('0xb8')](sendMessageReschedule(_0x4d5916))[_0x7c73('0xb9')](loggerCatch(_0x7c73('0x201')));}else{_0x4d5916[_0x7c73('0x3d')]='RUNNING';if(_[_0x7c73('0xae')](_0x5b6f3a[0x0])||_[_0x7c73('0xae')](_0x5b6f3a[0x0][_0x7c73('0x165')])||_[_0x7c73('0xae')](_0x5b6f3a[0x0][_0x7c73('0x165')]['phone'])){_0x5716c3[_0x7c73('0xd0')]('[actionOriginate]\x20',_0x4d5916,_0x5b6f3a[0x0]);}else{_0x5716c3[_0x7c73('0xba')](_['pick'](_0x5b6f3a[0x0],[_0x7c73('0xd6'),_0x7c73('0x1fe')]))[_0x7c73('0xb8')](_0x5716c3['checkContactBlack'](_0x4d5916,_0x5b6f3a[0x0]))[_0x7c73('0xb9')](_0x5716c3[_0x7c73('0xcf')](_0x7c73('0x202'),_0x4d5916));}}})['catch'](loggerGetContactDialer(_0x7c73('0x203'),_0x4d5916,0x1));emitVoiceQueueSummary(_0x4d5916);};Dialer[_0x7c73('0x18')]['abandonmentRate']=function(_0x144a20,_0x33794b,_0x29ffe0,_0x3f931d,_0x43a105,_0x29995e){loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x204'));loggerPredictive['info'](_0x7c73('0x205'),_0x144a20);loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x206'),_0x33794b);loggerPredictive['info'](_0x7c73('0x207'),_0x29ffe0);loggerPredictive['info'](_0x7c73('0x208'),_0x3f931d);loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x209'),_0x43a105);loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x82'));return new BPromise(function(_0x32cbd8,_0x4551b8){if(_0x144a20<=0x0||isNaN(_0x144a20)){return _0x4551b8(msgResponse(_0x7c73('0x20a'),_0x7c73('0x46'),_0x7c73('0x20b')+_0x144a20));}if(_0x29ffe0<=0x0||isNaN(_0x29ffe0)){return _0x4551b8(msgResponse('[abandonmentRate]',_0x7c73('0x46'),_0x7c73('0x20c')+_0x29ffe0));}if(_0x3f931d<=0x0||isNaN(_0x3f931d)){return _0x4551b8(msgResponse(_0x7c73('0x20a'),'Error','p\x20=\x20'+_0x3f931d));}if(_0x33794b<=0x0||isNaN(_0x33794b)){return _0x4551b8(msgResponse(_0x7c73('0x20a'),_0x7c73('0x46'),_0x7c73('0x20d')+_0x33794b));}if(_0x43a105<=0x0||isNaN(_0x43a105)){return _0x4551b8(msgResponse(_0x7c73('0x20a'),_0x7c73('0x46'),_0x7c73('0x20e')+_0x43a105));}_0x29995e=_0x29995e||0x0;var _0x302e88=0x1/_0x29ffe0;var _0x3db71c=0x0;var _0x595bd8=0x0;var _0x1d60b1=0x0;var _0x5a4491=0x0;for(var _0x1ab4cf=0x0;_0x1d60b1<_0x43a105;_0x1ab4cf+=0x1){_0x595bd8=_0x1ab4cf/_0x33794b;_0x3db71c=(_0x3f931d*_0x595bd8+_0x29995e)/_0x302e88;_0x1d60b1=erlangb(_0x3db71c,_0x144a20);_0x5a4491=_0x3db71c/_0x144a20*(0x1-erlangb(_0x3db71c,_0x144a20));}return _0x32cbd8({'erlangCalls':_0x1ab4cf,'erlangCallToSecond':_0x33794b/_0x1ab4cf,'erlangAbandonmentRate':_0x1d60b1,'erlangBusyFactor':_0x5a4491});});};Dialer[_0x7c73('0x18')]['busyFactor']=function(_0xb66956,_0xd375b7,_0x15e7e5,_0x404a9c,_0x3b9284,_0x4608d1){loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x20f'));loggerPredictive[_0x7c73('0x7b')]('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',_0xb66956);loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x206'),_0xd375b7);loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x207'),_0x15e7e5);loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x208'),_0x404a9c);loggerPredictive[_0x7c73('0x7b')](_0x7c73('0x210'),_0x3b9284);loggerPredictive['info'](_0x7c73('0x82'));return new BPromise(function(_0x55105a,_0xf7b5b2){if(_0xb66956<=0x0||isNaN(_0xb66956)){return _0xf7b5b2(msgResponse('[busyFactor]',_0x7c73('0x46'),_0x7c73('0x20b')+_0xb66956));}if(_0x15e7e5<=0x0||isNaN(_0x15e7e5)){return _0xf7b5b2(msgResponse(_0x7c73('0x211'),_0x7c73('0x46'),_0x7c73('0x20c')+_0x15e7e5));}if(_0x404a9c<=0x0||isNaN(_0x404a9c)){return _0xf7b5b2(msgResponse(_0x7c73('0x211'),_0x7c73('0x46'),_0x7c73('0x212')+_0x404a9c));}if(_0xd375b7<=0x0||isNaN(_0xd375b7)){return _0xf7b5b2(msgResponse('[busyFactor]',_0x7c73('0x46'),_0x7c73('0x20d')+_0xd375b7));}if(_0x3b9284<=0x0||isNaN(_0x3b9284)){return _0xf7b5b2(msgResponse(_0x7c73('0x211'),_0x7c73('0x46'),_0x7c73('0x213')+_0x3b9284));}_0x4608d1=_0x4608d1||0x0;var _0x2c3b09=0x1/_0x15e7e5;var _0xc36ab6=0x0;var _0x453b9b=0x0;var _0x8df09f=0x0;var _0x38c269=0x0;for(var _0x2587f7=0x0;_0x38c269<_0x3b9284;_0x2587f7+=0x1){_0x453b9b=_0x2587f7/_0xd375b7;_0xc36ab6=(_0x404a9c*_0x453b9b+_0x4608d1)/_0x2c3b09;_0x8df09f=erlangb(_0xc36ab6,_0xb66956);_0x38c269=_0xc36ab6/_0xb66956*(0x1-erlangb(_0xc36ab6,_0xb66956));}return _0x55105a({'erlangCalls':_0x2587f7,'erlangCallToSecond':_0xd375b7/_0x2587f7,'erlangAbandonmentRate':_0x8df09f,'erlangBusyFactor':_0x38c269});});};module[_0x7c73('0x214')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index ee32355..a98ec52 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 _0xbaa5=['countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','responsetime','droptime','endtime','starttime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x13ae09,_0x41efab){var _0x475ac8=function(_0x73662f){while(--_0x73662f){_0x13ae09['push'](_0x13ae09['shift']());}};_0x475ac8(++_0x41efab);}(_0xbaa5,0x1d5));var _0x5baa=function(_0x253780,_0x5c02d7){_0x253780=_0x253780-0x0;var _0x33990c=_0xbaa5[_0x253780];return _0x33990c;};'use strict';var util=require(_0x5baa('0x0'));var _=require(_0x5baa('0x1'));var moment=require(_0x5baa('0x2'));function getSeconds(_0x10d5ad,_0x1cc2f0){var _0x10d7bd=moment(_0x10d5ad)[_0x5baa('0x3')](0x0);var _0x26cde5=moment(_0x1cc2f0)[_0x5baa('0x3')](0x0);return _0x10d7bd[_0x5baa('0x4')](_0x26cde5,'seconds');}function QueueCallerAbandon(_0x116264,_0x117888){this['scheduledat']=_0x116264['scheduledat'];this[_0x5baa('0x5')]=_0x116264[_0x5baa('0x5')];this[_0x5baa('0x6')]=_0x116264[_0x5baa('0x5')]==='outbound'?_0x5baa('0x7'):_0x116264[_0x5baa('0x5')];this['countbusyretry']=_0x116264[_0x5baa('0x8')];this[_0x5baa('0x9')]=_0x116264[_0x5baa('0x9')];this['countnoanswerretry']=_0x116264[_0x5baa('0xa')];this[_0x5baa('0xb')]=_0x116264[_0x5baa('0x8')]+_0x116264['countcongestionretry']+_0x116264[_0x5baa('0xa')]+_0x116264[_0x5baa('0xc')]+_0x116264[_0x5baa('0xd')]+_0x116264[_0x5baa('0xe')]+_0x116264[_0x5baa('0xf')]+_0x116264[_0x5baa('0x10')];this[_0x5baa('0xc')]=_0x116264[_0x5baa('0xc')];this[_0x5baa('0xd')]=_0x116264[_0x5baa('0xd')];this['countabandonedretry']=_0x116264['countabandonedretry'];this[_0x5baa('0xf')]=_0x116264[_0x5baa('0xf')];this['countagentrejectretry']=_0x116264[_0x5baa('0x10')];this[_0x5baa('0x11')]=_0x117888[_0x5baa('0x11')];this[_0x5baa('0x12')]=_0x116264[_0x5baa('0x13')];this[_0x5baa('0x14')]=_0x116264['number'];this['starttime']=_0x116264['starttime'];this[_0x5baa('0x15')]=_0x116264['responsetime'];this[_0x5baa('0x16')]=_0x116264[_0x5baa('0x16')];this[_0x5baa('0x17')]=this[_0x5baa('0x16')];this['ringtime']=getSeconds(_0x116264['responsetime'],_0x116264[_0x5baa('0x18')]);this['holdtime']=getSeconds(this[_0x5baa('0x16')],_0x116264[_0x5baa('0x15')]);this['talktime']=0x0;this['queue']=_0x117888[_0x5baa('0x7')];this[_0x5baa('0x19')]=_0x117888[_0x5baa('0x1a')];this['reason']=_0x117888[_0x5baa('0x1b')];this[_0x5baa('0x1c')]=_0x116264[_0x5baa('0x1c')];this[_0x5baa('0x1d')]=_0x116264[_0x5baa('0x1d')];this[_0x5baa('0x1e')]=_0x116264[_0x5baa('0x1e')];this[_0x5baa('0x1f')]=_0x116264[_0x5baa('0x1f')];this['ContactId']=_0x116264[_0x5baa('0x20')];this[_0x5baa('0x21')]=_0x116264['ListId'];this[_0x5baa('0x22')]=_0x116264[_0x5baa('0x22')];this[_0x5baa('0x23')]=_0x116264[_0x5baa('0x23')];this['CampaignId']=_0x116264[_0x5baa('0x24')];this[_0x5baa('0x25')]=_0x116264[_0x5baa('0x25')]||'';this[_0x5baa('0x26')]=_0x116264[_0x5baa('0x26')]||'';}module[_0x5baa('0x27')]=QueueCallerAbandon; \ No newline at end of file +var _0xd4ea=['responsetime','talktime','queue','connectedlinename','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','droptime','endtime'];(function(_0x1f5143,_0x5e31e6){var _0x383a38=function(_0x2c123c){while(--_0x2c123c){_0x1f5143['push'](_0x1f5143['shift']());}};_0x383a38(++_0x5e31e6);}(_0xd4ea,0x12f));var _0xad4e=function(_0x36b22b,_0x589e80){_0x36b22b=_0x36b22b-0x0;var _0x2ad385=_0xd4ea[_0x36b22b];return _0x2ad385;};'use strict';var util=require(_0xad4e('0x0'));var _=require(_0xad4e('0x1'));var moment=require(_0xad4e('0x2'));function getSeconds(_0x4333c8,_0x5d77ad){var _0xae0ee0=moment(_0x4333c8)[_0xad4e('0x3')](0x0);var _0x5f1d87=moment(_0x5d77ad)[_0xad4e('0x3')](0x0);return _0xae0ee0['diff'](_0x5f1d87,_0xad4e('0x4'));}function QueueCallerAbandon(_0x34918f,_0x460bd6){this[_0xad4e('0x5')]=_0x34918f[_0xad4e('0x5')];this[_0xad4e('0x6')]=_0x34918f[_0xad4e('0x6')];this[_0xad4e('0x7')]=_0x34918f['type']===_0xad4e('0x8')?'queue':_0x34918f[_0xad4e('0x6')];this['countbusyretry']=_0x34918f[_0xad4e('0x9')];this[_0xad4e('0xa')]=_0x34918f['countcongestionretry'];this[_0xad4e('0xb')]=_0x34918f[_0xad4e('0xb')];this[_0xad4e('0xc')]=_0x34918f['countbusyretry']+_0x34918f[_0xad4e('0xa')]+_0x34918f[_0xad4e('0xb')]+_0x34918f[_0xad4e('0xd')]+_0x34918f[_0xad4e('0xe')]+_0x34918f[_0xad4e('0xf')]+_0x34918f[_0xad4e('0x10')]+_0x34918f[_0xad4e('0x11')];this[_0xad4e('0xd')]=_0x34918f[_0xad4e('0xd')];this[_0xad4e('0xe')]=_0x34918f[_0xad4e('0xe')];this[_0xad4e('0xf')]=_0x34918f[_0xad4e('0xf')];this['countmachineretry']=_0x34918f[_0xad4e('0x10')];this[_0xad4e('0x11')]=_0x34918f['countagentrejectretry'];this['uniqueid']=_0x460bd6[_0xad4e('0x12')];this[_0xad4e('0x13')]=_0x34918f[_0xad4e('0x14')];this[_0xad4e('0x15')]=_0x34918f['number'];this[_0xad4e('0x16')]=_0x34918f[_0xad4e('0x16')];this['responsetime']=_0x34918f['responsetime'];this['droptime']=_0x34918f[_0xad4e('0x17')];this[_0xad4e('0x18')]=this['droptime'];this['ringtime']=getSeconds(_0x34918f['responsetime'],_0x34918f[_0xad4e('0x16')]);this['holdtime']=getSeconds(this[_0xad4e('0x17')],_0x34918f[_0xad4e('0x19')]);this[_0xad4e('0x1a')]=0x0;this[_0xad4e('0x1b')]=_0x460bd6[_0xad4e('0x1b')];this['membername']=_0x460bd6[_0xad4e('0x1c')];this[_0xad4e('0x1d')]=_0x460bd6['reason'];this[_0xad4e('0x1e')]=_0x34918f[_0xad4e('0x1e')];this[_0xad4e('0x1f')]=_0x34918f['callbackuniqueid'];this[_0xad4e('0x20')]=_0x34918f[_0xad4e('0x20')];this['recallme']=_0x34918f['recallme'];this['ContactId']=_0x34918f[_0xad4e('0x21')];this[_0xad4e('0x22')]=_0x34918f[_0xad4e('0x22')];this[_0xad4e('0x23')]=_0x34918f[_0xad4e('0x23')];this[_0xad4e('0x24')]=_0x34918f[_0xad4e('0x24')];this[_0xad4e('0x25')]=_0x34918f[_0xad4e('0x25')];this[_0xad4e('0x26')]=_0x34918f[_0xad4e('0x26')]||'';this[_0xad4e('0x27')]=_0x34918f[_0xad4e('0x27')]||'';}module[_0xad4e('0x28')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 4c8c848..11e0dd1 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(_0x26544a,_0x20a796){var _0x5a712c=function(_0x2886c4){while(--_0x2886c4){_0x26544a['push'](_0x26544a['shift']());}};_0x5a712c(++_0x20a796);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x339562,_0x4b746d){var _0x4237be=function(_0x4170c8){while(--_0x4170c8){_0x339562['push'](_0x339562['shift']());}};_0x4237be(++_0x4b746d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 9d859a6..dcb4f3b 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 _0x5ec9=['variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','notify','calleridnum','catch','error','stringify','\x20receiveFax\x20','merge','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\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','message','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','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','format','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','path','./util/gs','fax','../ami','./util/util','./action','../rpc/faxAccount','../rpc/attachment','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','localstationid','channels','uniqueid','channel','name','info'];(function(_0x27c298,_0x33f47b){var _0x4d6d76=function(_0x3510b2){while(--_0x3510b2){_0x27c298['push'](_0x27c298['shift']());}};_0x4d6d76(++_0x33f47b);}(_0x5ec9,0x144));var _0x95ec=function(_0x3c3f5a,_0x3c1804){_0x3c3f5a=_0x3c3f5a-0x0;var _0x3016ab=_0x5ec9[_0x3c3f5a];return _0x3016ab;};'use strict';var util=require(_0x95ec('0x0'));var _=require(_0x95ec('0x1'));var BPromise=require(_0x95ec('0x2'));var uuid=require(_0x95ec('0x3'));var moment=require('moment');var path=require(_0x95ec('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x95ec('0x5'));var logger=require('../../../config/logger')(_0x95ec('0x6'));var ami=require(_0x95ec('0x7'));var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require(_0x95ec('0x8'));var Action=require(_0x95ec('0x9'));var faxAccount=require(_0x95ec('0xa'));var attachment=require(_0x95ec('0xb'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x1e0635){this['channels']={};this[_0x95ec('0xc')]=_0x1e0635[_0x95ec('0xc')];this[_0x95ec('0xd')]=_0x1e0635[_0x95ec('0xd')];this[_0x95ec('0xe')]={};ami['on'](_0x95ec('0xf'),this['syncNewchannel'][_0x95ec('0x10')](this));ami['on'](_0x95ec('0x11'),this[_0x95ec('0x12')][_0x95ec('0x10')](this));ami['on'](_0x95ec('0x13'),this[_0x95ec('0x14')][_0x95ec('0x10')](this));ami['on'](_0x95ec('0x15'),this[_0x95ec('0x16')][_0x95ec('0x10')](this));ami['on'](_0x95ec('0x17'),this[_0x95ec('0x18')][_0x95ec('0x10')](this));ami['on'](_0x95ec('0x19'),this[_0x95ec('0x1a')][_0x95ec('0x10')](this));ami['on'](_0x95ec('0x1b'),this[_0x95ec('0x1c')][_0x95ec('0x10')](this));ami['on'](_0x95ec('0x1d'),this[_0x95ec('0x1e')]['bind'](this));}Fax[_0x95ec('0x1f')][_0x95ec('0x20')]=function(_0x5c45b3){if(_0x5c45b3[_0x95ec('0x21')]===_0x95ec('0x22')){for(var _0x305281 in this[_0x95ec('0xc')]){if(this[_0x95ec('0xc')][_0x95ec('0x23')](_0x305281)){if(_0x5c45b3['exten']===this[_0x95ec('0xc')][_0x305281][_0x95ec('0x24')]){this[_0x95ec('0x25')][_0x5c45b3[_0x95ec('0x26')]]={};this['channels'][_0x5c45b3[_0x95ec('0x26')]][_0x95ec('0x27')]=_0x5c45b3[_0x95ec('0x27')];this[_0x95ec('0x25')][_0x5c45b3[_0x95ec('0x26')]]['id']=this[_0x95ec('0xc')][_0x305281]['id'];this['channels'][_0x5c45b3['uniqueid']]['name']=this['faxAccounts'][_0x305281][_0x95ec('0x28')];logger['info'](_0x5c45b3[_0x95ec('0x26')],'\x20syncNewchannel\x20');}}}}if(this[_0x95ec('0xe')][_0x5c45b3[_0x95ec('0x26')]]){this['channels'][_0x5c45b3[_0x95ec('0x26')]]={};this[_0x95ec('0x25')][_0x5c45b3[_0x95ec('0x26')]]['channel']=_0x5c45b3[_0x95ec('0x27')];logger[_0x95ec('0x29')](_0x5c45b3[_0x95ec('0x26')],'\x20syncNewchannel\x20');}};Fax[_0x95ec('0x1f')]['syncVarSet']=function(_0x352e8f){if(this[_0x95ec('0x25')][_0x352e8f[_0x95ec('0x26')]]){for(var _0xfcfd5b in _0x352e8f[_0x95ec('0x2a')]){if(_0x352e8f['variable'][_0x95ec('0x23')](_0xfcfd5b)){this[_0x95ec('0x25')][_0x352e8f['uniqueid']][_0xfcfd5b]=_0x352e8f[_0x95ec('0x2b')];}}}};Fax[_0x95ec('0x1f')][_0x95ec('0x14')]=function(_0x1d387f){if(this[_0x95ec('0x25')][_0x1d387f['uniqueid']]){this[_0x95ec('0x25')][_0x1d387f[_0x95ec('0x26')]][_0x95ec('0x2c')]=_0x1d387f[_0x95ec('0x2c')];this[_0x95ec('0x25')][_0x1d387f['uniqueid']][_0x95ec('0x2d')]=_0x1d387f[_0x95ec('0x2d')];}};Fax[_0x95ec('0x1f')][_0x95ec('0x16')]=function(_0x2373a6){if(this['channels'][_0x2373a6[_0x95ec('0x26')]]){for(var _0x3e824e in _0x2373a6[_0x95ec('0x2a')]){if(_0x2373a6[_0x95ec('0x2a')][_0x95ec('0x23')](_0x3e824e)){this[_0x95ec('0x25')][_0x2373a6[_0x95ec('0x26')]][_0x3e824e]=_0x2373a6['value'];}}}};Fax['prototype']['syncFaxStatus']=function(_0x3e2eaa){if(this['channels'][_0x3e2eaa[_0x95ec('0x26')]]){this[_0x95ec('0x25')][_0x3e2eaa[_0x95ec('0x26')]][_0x95ec('0x2e')]=_0x3e2eaa[_0x95ec('0x2e')];this['channels'][_0x3e2eaa[_0x95ec('0x26')]][_0x95ec('0x2f')]=_0x3e2eaa[_0x95ec('0x2f')];this['channels'][_0x3e2eaa['uniqueid']][_0x95ec('0x24')]=_0x3e2eaa['localstationid'];this[_0x95ec('0x25')][_0x3e2eaa['uniqueid']][_0x95ec('0x30')]=_0x3e2eaa['filename'];logger[_0x95ec('0x29')](_0x3e2eaa['uniqueid'],_0x95ec('0x31'));}};Fax['prototype'][_0x95ec('0x1a')]=function(_0x57b9ce){var _0x529ae5=this;if(this['channels'][_0x57b9ce[_0x95ec('0x26')]]){var _0x263cbc=this[_0x95ec('0x25')][_0x57b9ce[_0x95ec('0x26')]]['id'];this[_0x95ec('0x25')][_0x57b9ce[_0x95ec('0x26')]]['remotestationid']=_0x57b9ce[_0x95ec('0x32')];this[_0x95ec('0x25')][_0x57b9ce['uniqueid']][_0x95ec('0x33')]=_0x57b9ce['pagestransferred'];this[_0x95ec('0x25')][_0x57b9ce[_0x95ec('0x26')]][_0x95ec('0x24')]=_0x57b9ce[_0x95ec('0x24')];this[_0x95ec('0x25')][_0x57b9ce[_0x95ec('0x26')]][_0x95ec('0x34')]=_0x57b9ce[_0x95ec('0x34')];this[_0x95ec('0x25')][_0x57b9ce[_0x95ec('0x26')]]['transferrate']=_0x57b9ce[_0x95ec('0x35')];this[_0x95ec('0x25')][_0x57b9ce[_0x95ec('0x26')]][_0x95ec('0x30')]=_0x57b9ce[_0x95ec('0x30')];this['channels'][_0x57b9ce[_0x95ec('0x26')]]['calleridnum']=_0x57b9ce['calleridnum'];if(this[_0x95ec('0x25')][_0x57b9ce[_0x95ec('0x26')]][_0x95ec('0x33')]>0x0){tiff2pdf(_0x57b9ce[_0x95ec('0x30')],_0x95ec('0x36'),function(_0x35557b){logger[_0x95ec('0x29')](_0x57b9ce['uniqueid'],_0x95ec('0x37'),_0x35557b['message']);attachment[_0x95ec('0x38')]({'name':path[_0x95ec('0x39')](_0x57b9ce[_0x95ec('0x30')])[_0x95ec('0x28')],'basename':path['parse'](_0x57b9ce[_0x95ec('0x30')])[_0x95ec('0x28')]+_0x95ec('0x3a'),'type':_0x95ec('0x3b')})[_0x95ec('0x3c')](function(_0x116fad){faxAccount[_0x95ec('0x3d')](_0x263cbc,{'from':_0x57b9ce[_0x95ec('0x3e')],'mapKey':'fax','body':path['parse'](_0x57b9ce['filename'])[_0x95ec('0x28')]+'.pdf','AttachmentId':_0x116fad['id']})[_0x95ec('0x3f')](function(_0x378dc8){logger[_0x95ec('0x40')](_0x57b9ce['uniqueid'],'\x20notify\x20',JSON[_0x95ec('0x41')](_0x378dc8));});})[_0x95ec('0x3f')](function(_0x1e4410){logger['error'](_0x57b9ce[_0x95ec('0x26')],_0x95ec('0x42'),JSON[_0x95ec('0x41')](_0x1e4410));});});}logger[_0x95ec('0x29')](_0x57b9ce[_0x95ec('0x26')],_0x95ec('0x42'));}};Fax[_0x95ec('0x1f')][_0x95ec('0x1e')]=function(_0x1942a7){if(this[_0x95ec('0xe')][_0x1942a7[_0x95ec('0x26')]]){_[_0x95ec('0x43')](this['channels'][_0x1942a7['uniqueid']],_['pick'](_0x1942a7,[_0x95ec('0x44'),_0x95ec('0x45')]));}};function updateStatus(_0x6783db){if(_0x6783db[_0x95ec('0x46')]){faxMessage[_0x95ec('0x47')](_0x6783db[_0x95ec('0x46')],{'failMessage':_0x95ec('0x48')})[_0x95ec('0x3c')](function(_0x32db04){ut[_0x95ec('0x49')]('[Fax][Message][Error][Updated]',_0x32db04);})[_0x95ec('0x3f')](function(_0x435a58){ut[_0x95ec('0x49')](_0x95ec('0x4a'),_0x435a58);});}else{ut[_0x95ec('0x49')](_0x95ec('0x4b'));}}Fax[_0x95ec('0x1f')][_0x95ec('0x4c')]=function(_0x4c3a69,_0x18c1a5,_0x162493){var _0x1c0e10=this;var _0x3257df={};if(_0x18c1a5){_0x3257df={'read':_0x18c1a5};}else{_0x3257df={'failMessage':_0x162493};}if(this[_0x95ec('0xe')][_0x4c3a69][_0x95ec('0x46')]){faxMessage[_0x95ec('0x47')](this['actions'][_0x4c3a69][_0x95ec('0x46')],_0x3257df)[_0x95ec('0x3c')](function(_0x4e50fa){ut['logger'](_0x95ec('0x4d'),_0x4e50fa);})[_0x95ec('0x3f')](function(_0x1f4230){ut[_0x95ec('0x49')](_0x95ec('0x4e'),_0x1f4230);})[_0x95ec('0x4f')](function(){delete _0x1c0e10[_0x95ec('0x25')][_0x4c3a69];delete _0x1c0e10[_0x95ec('0xe')][_0x4c3a69];});}else{ut[_0x95ec('0x49')](_0x95ec('0x50'));delete this[_0x95ec('0x25')][_0x4c3a69];delete this['actions'][_0x4c3a69];}};Fax['prototype'][_0x95ec('0x1c')]=function(_0x1f337b){var _0x3c508a=this;if(this[_0x95ec('0x25')][_0x1f337b[_0x95ec('0x26')]]){if(this[_0x95ec('0xe')][_0x1f337b[_0x95ec('0x26')]]){this['channels'][_0x1f337b[_0x95ec('0x26')]]['id']=this[_0x95ec('0xe')][_0x1f337b[_0x95ec('0x26')]]['id'];this['channels'][_0x1f337b['uniqueid']]['name']=this['actions'][_0x1f337b[_0x95ec('0x26')]]['name'];}logger[_0x95ec('0x29')](_0x1f337b[_0x95ec('0x26')],this[_0x95ec('0xe')][_0x1f337b[_0x95ec('0x26')]]?_0x95ec('0x51'):_0x95ec('0x52'),JSON[_0x95ec('0x41')](this[_0x95ec('0x25')][_0x1f337b[_0x95ec('0x26')]]));if(this['actions'][_0x1f337b[_0x95ec('0x26')]]){if(this[_0x95ec('0x25')][_0x1f337b[_0x95ec('0x26')]][_0x95ec('0x53')]>0x0&&this['channels'][_0x1f337b['uniqueid']][_0x95ec('0x17')]===_0x95ec('0x54')){this[_0x95ec('0x4c')](_0x1f337b[_0x95ec('0x26')],!![]);}else{this[_0x95ec('0x4c')](_0x1f337b[_0x95ec('0x26')],![],this['channels'][_0x1f337b[_0x95ec('0x26')]][_0x95ec('0x55')]?_0x95ec('0x56')+this[_0x95ec('0x25')][_0x1f337b['uniqueid']][_0x95ec('0x55')]:'SENDING\x20FAILED');}}}};Fax[_0x95ec('0x1f')][_0x95ec('0x57')]=function(_0x1ad101){var _0xbefe5d=this;return new BPromise(function(_0xb09551,_0x1a9cec){_0xbefe5d[_0x95ec('0x58')](_0x1ad101,_0xbefe5d[_0x95ec('0xc')][_0x1ad101[_0x95ec('0x59')]])[_0x95ec('0x3c')](function(_0x255586){ut[_0x95ec('0x49')]('[Fax][execOriginate][success]',_0x255586);_0xb09551(ut[_0x95ec('0x5a')](_0x95ec('0x5b')));})[_0x95ec('0x3f')](function(_0x1dd9b3){ut[_0x95ec('0x49')]('[Fax][execOriginate][failure]',_0x1dd9b3);updateStatus(_0x1ad101);_0x1a9cec(ut[_0x95ec('0x5a')](_0x95ec('0x5c')));});});};Fax[_0x95ec('0x1f')][_0x95ec('0x5d')]=function(_0x159f47){var _0x44e858=this;return new BPromise(function(_0x444942,_0x3b9908){var _0x4cae67=_0x44e858[_0x95ec('0x5e')](_0x44e858[_0x95ec('0xc')][_0x159f47[_0x95ec('0x59')]][_0x95ec('0x5f')],_0x159f47);if(_0x4cae67[_0x95ec('0x60')]){_0x444942(ut[_0x95ec('0x5a')](_0x95ec('0x61')));}else{_0x3b9908(ut['message'](_0x4cae67[_0x95ec('0x5a')]));}});};function originate(_0x51b595,_0x2e59e6,_0x1545a8){return new BPromise(function(_0x3221a5,_0x51096d){if(_0x1545a8){var _0xe8ca56=util['format'](_0x95ec('0x62'),path[_0x95ec('0x39')](_0x51b595[_0x95ec('0x4')])[_0x95ec('0x28')],_0x51b595[_0x95ec('0x4')]);gs[_0x95ec('0x63')](_0xe8ca56)[_0x95ec('0x3c')](function(){_0x51b595['path']=util[_0x95ec('0x64')](_0x95ec('0x65'),path[_0x95ec('0x39')](_0x51b595[_0x95ec('0x4')])[_0x95ec('0x66')],path['parse'](_0x51b595[_0x95ec('0x4')])['name']);_0x2e59e6[_0x95ec('0x67')]=_0x51b595[_0x95ec('0x4')];ut[_0x95ec('0x49')]('Convert\x20pdf\x20to\x20tif','');ami[_0x95ec('0x68')](ut[_0x95ec('0x69')](_0x51b595,_0x2e59e6))[_0x95ec('0x3c')](function(_0x2848a8){_0x3221a5(_0x2848a8);})['catch'](function(_0x25697e){_0x51096d(_0x25697e);});})[_0x95ec('0x3f')](function(_0x76a927){_0x51096d(_0x76a927);});}else{ami[_0x95ec('0x68')](ut[_0x95ec('0x69')](_0x51b595,_0x2e59e6))['then'](function(_0x1f7864){_0x3221a5(_0x1f7864);})[_0x95ec('0x3f')](function(_0x5c33cf){_0x51096d(_0x5c33cf);});}});}Fax[_0x95ec('0x1f')]['execOriginate']=function(_0x33c20c,_0x4e1269){var _0x2ed340=this;return new BPromise(function(_0x2412c8,_0x5388bb){var _0xb2ac8b=uuid['v4']();var _0xe8f5c9=ut[_0x95ec('0x6a')](_0x33c20c,_0x4e1269);_0x2ed340[_0x95ec('0xe')][_0xb2ac8b]=new Action(_0xb2ac8b,_0x4e1269,_0x33c20c);var _0x1e1f4b=_0x2ed340[_0x95ec('0xe')][_0xb2ac8b];if(path['parse'](_0x33c20c['path'])[_0x95ec('0x6b')]===_0x95ec('0x3a')){originate(_0x1e1f4b,_0xe8f5c9,!![])[_0x95ec('0x3c')](function(_0x443f7f){_0x2412c8(_0x443f7f);})[_0x95ec('0x3f')](function(_0x30adcc){_0x5388bb(_0x30adcc);});}else{originate(_0x1e1f4b,_0xe8f5c9,![])[_0x95ec('0x3c')](function(_0x24dfb9){_0x2412c8(_0x24dfb9);})[_0x95ec('0x3f')](function(_0x15b227){_0x5388bb(_0x15b227);});}});};Fax[_0x95ec('0x1f')][_0x95ec('0x6c')]=function(_0x481795){return!_[_0x95ec('0x6d')](_0x481795)&&!_['isNil'](_0x481795[_0x95ec('0x28')])&&!_[_0x95ec('0x6d')](_0x481795[_0x95ec('0x6e')])&&_0x481795[_0x95ec('0x6e')]&&!_[_0x95ec('0x6d')](this['trunks'][util['format']('SIP/%s',_0x481795['name'])])&&!_[_0x95ec('0x6d')](this[_0x95ec('0xd')][util[_0x95ec('0x64')]('SIP/%s',_0x481795[_0x95ec('0x28')])][_0x95ec('0x2f')])&&(this[_0x95ec('0xd')][util['format'](_0x95ec('0x6f'),_0x481795[_0x95ec('0x28')])][_0x95ec('0x2f')]===_0x95ec('0x70')||this['trunks'][util[_0x95ec('0x64')]('SIP/%s',_0x481795['name'])][_0x95ec('0x2f')]===_0x95ec('0x71'));};Fax[_0x95ec('0x1f')]['checkTrunk']=function(_0x5bb9e4,_0x243abc){if(!this[_0x95ec('0x6c')](_0x5bb9e4)){ut['logger'](_0x95ec('0x72'),_[_0x95ec('0x6d')](_0x5bb9e4)?'':_0x5bb9e4[_0x95ec('0x28')]+_0x95ec('0x73'));return{'isValid':![],'message':_0x95ec('0x74')};}if(_[_0x95ec('0x6d')](_0x243abc[_0x95ec('0x6')])){ut['logger'](_0x95ec('0x75'),JSON[_0x95ec('0x41')](_0x243abc));return{'isValid':![],'message':_0x95ec('0x76')};}if(_[_0x95ec('0x6d')](_0x243abc[_0x95ec('0x4')])){ut[_0x95ec('0x49')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x95ec('0x41')](_0x243abc));return{'isValid':![],'message':_0x95ec('0x77')};}return{'isValid':!![],'message':_0x95ec('0x78')};};module[_0x95ec('0x79')]=Fax; \ No newline at end of file +var _0xc68f=['info','\x20syncNewchannel\x20','variable','value','channelstate','syncNewExten','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','notify','catch','error','stringify','\x20receiveFax\x20','merge','pick','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','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','isTrunkReachable','isNil','active','trunks','format','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','actions','newchannel','syncNewchannel','varset','syncVarSet','newstate','syncNewState','bind','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channels','channel','name'];(function(_0xfd10aa,_0x3a5c45){var _0x57d673=function(_0x38efdb){while(--_0x38efdb){_0xfd10aa['push'](_0xfd10aa['shift']());}};_0x57d673(++_0x3a5c45);}(_0xc68f,0xcf));var _0xfc68=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc68f[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0xfc68('0x0'));var _=require('lodash');var BPromise=require(_0xfc68('0x1'));var uuid=require(_0xfc68('0x2'));var moment=require(_0xfc68('0x3'));var path=require(_0xfc68('0x4'));var tiff2pdf=require(_0xfc68('0x5'));var gs=require(_0xfc68('0x6'));var logger=require(_0xfc68('0x7'))(_0xfc68('0x8'));var ami=require('../ami');var rpcDb=require(_0xfc68('0x9'));var Channel=require(_0xfc68('0xa'));var ut=require('./util/util');var Action=require(_0xfc68('0xb'));var faxAccount=require(_0xfc68('0xc'));var attachment=require(_0xfc68('0xd'));var faxMessage=require(_0xfc68('0xe'));function Fax(_0x36270d){this['channels']={};this[_0xfc68('0xf')]=_0x36270d[_0xfc68('0xf')];this['trunks']=_0x36270d['trunks'];this[_0xfc68('0x10')]={};ami['on'](_0xfc68('0x11'),this[_0xfc68('0x12')]['bind'](this));ami['on'](_0xfc68('0x13'),this[_0xfc68('0x14')]['bind'](this));ami['on'](_0xfc68('0x15'),this[_0xfc68('0x16')][_0xfc68('0x17')](this));ami['on'](_0xfc68('0x18'),this['syncNewExten'][_0xfc68('0x17')](this));ami['on'](_0xfc68('0x19'),this[_0xfc68('0x1a')][_0xfc68('0x17')](this));ami['on'](_0xfc68('0x1b'),this[_0xfc68('0x1c')][_0xfc68('0x17')](this));ami['on']('hangup',this[_0xfc68('0x1d')][_0xfc68('0x17')](this));ami['on']('originateresponse',this[_0xfc68('0x1e')][_0xfc68('0x17')](this));}Fax[_0xfc68('0x1f')][_0xfc68('0x12')]=function(_0x5a1ed7){if(_0x5a1ed7[_0xfc68('0x20')]===_0xfc68('0x21')){for(var _0x1d8991 in this['faxAccounts']){if(this[_0xfc68('0xf')][_0xfc68('0x22')](_0x1d8991)){if(_0x5a1ed7[_0xfc68('0x23')]===this[_0xfc68('0xf')][_0x1d8991][_0xfc68('0x24')]){this['channels'][_0x5a1ed7[_0xfc68('0x25')]]={};this[_0xfc68('0x26')][_0x5a1ed7[_0xfc68('0x25')]][_0xfc68('0x27')]=_0x5a1ed7[_0xfc68('0x27')];this[_0xfc68('0x26')][_0x5a1ed7[_0xfc68('0x25')]]['id']=this['faxAccounts'][_0x1d8991]['id'];this[_0xfc68('0x26')][_0x5a1ed7[_0xfc68('0x25')]][_0xfc68('0x28')]=this[_0xfc68('0xf')][_0x1d8991][_0xfc68('0x28')];logger[_0xfc68('0x29')](_0x5a1ed7['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0xfc68('0x10')][_0x5a1ed7[_0xfc68('0x25')]]){this['channels'][_0x5a1ed7[_0xfc68('0x25')]]={};this[_0xfc68('0x26')][_0x5a1ed7[_0xfc68('0x25')]]['channel']=_0x5a1ed7['channel'];logger[_0xfc68('0x29')](_0x5a1ed7['uniqueid'],_0xfc68('0x2a'));}};Fax[_0xfc68('0x1f')]['syncVarSet']=function(_0x572c09){if(this['channels'][_0x572c09['uniqueid']]){for(var _0x34260b in _0x572c09[_0xfc68('0x2b')]){if(_0x572c09[_0xfc68('0x2b')]['hasOwnProperty'](_0x34260b)){this[_0xfc68('0x26')][_0x572c09[_0xfc68('0x25')]][_0x34260b]=_0x572c09[_0xfc68('0x2c')];}}}};Fax[_0xfc68('0x1f')][_0xfc68('0x16')]=function(_0x138576){if(this[_0xfc68('0x26')][_0x138576[_0xfc68('0x25')]]){this[_0xfc68('0x26')][_0x138576['uniqueid']][_0xfc68('0x2d')]=_0x138576[_0xfc68('0x2d')];this['channels'][_0x138576[_0xfc68('0x25')]]['channelstatedesc']=_0x138576['channelstatedesc'];}};Fax[_0xfc68('0x1f')][_0xfc68('0x2e')]=function(_0x51dec2){if(this[_0xfc68('0x26')][_0x51dec2[_0xfc68('0x25')]]){for(var _0x584028 in _0x51dec2[_0xfc68('0x2b')]){if(_0x51dec2[_0xfc68('0x2b')]['hasOwnProperty'](_0x584028)){this[_0xfc68('0x26')][_0x51dec2[_0xfc68('0x25')]][_0x584028]=_0x51dec2[_0xfc68('0x2c')];}}}};Fax[_0xfc68('0x1f')][_0xfc68('0x1a')]=function(_0x10f249){if(this[_0xfc68('0x26')][_0x10f249[_0xfc68('0x25')]]){this['channels'][_0x10f249[_0xfc68('0x25')]][_0xfc68('0x2f')]=_0x10f249['operation'];this[_0xfc68('0x26')][_0x10f249[_0xfc68('0x25')]][_0xfc68('0x30')]=_0x10f249[_0xfc68('0x30')];this[_0xfc68('0x26')][_0x10f249[_0xfc68('0x25')]][_0xfc68('0x24')]=_0x10f249[_0xfc68('0x24')];this[_0xfc68('0x26')][_0x10f249['uniqueid']]['filename']=_0x10f249[_0xfc68('0x31')];logger[_0xfc68('0x29')](_0x10f249[_0xfc68('0x25')],_0xfc68('0x32'));}};Fax[_0xfc68('0x1f')]['syncReceiveFax']=function(_0x2274a4){var _0xfec1bb=this;if(this[_0xfc68('0x26')][_0x2274a4[_0xfc68('0x25')]]){var _0x15bc7e=this[_0xfc68('0x26')][_0x2274a4[_0xfc68('0x25')]]['id'];this[_0xfc68('0x26')][_0x2274a4[_0xfc68('0x25')]]['remotestationid']=_0x2274a4[_0xfc68('0x33')];this['channels'][_0x2274a4['uniqueid']]['pagestransferred']=_0x2274a4[_0xfc68('0x34')];this[_0xfc68('0x26')][_0x2274a4['uniqueid']][_0xfc68('0x24')]=_0x2274a4['localstationid'];this[_0xfc68('0x26')][_0x2274a4[_0xfc68('0x25')]]['resolution']=_0x2274a4['resolution'];this[_0xfc68('0x26')][_0x2274a4['uniqueid']][_0xfc68('0x35')]=_0x2274a4[_0xfc68('0x35')];this[_0xfc68('0x26')][_0x2274a4['uniqueid']][_0xfc68('0x31')]=_0x2274a4[_0xfc68('0x31')];this[_0xfc68('0x26')][_0x2274a4[_0xfc68('0x25')]][_0xfc68('0x36')]=_0x2274a4['calleridnum'];if(this[_0xfc68('0x26')][_0x2274a4[_0xfc68('0x25')]][_0xfc68('0x34')]>0x0){tiff2pdf(_0x2274a4[_0xfc68('0x31')],_0xfc68('0x37'),function(_0xf9ce42){logger[_0xfc68('0x29')](_0x2274a4[_0xfc68('0x25')],_0xfc68('0x38'),_0xf9ce42[_0xfc68('0x39')]);attachment[_0xfc68('0x3a')]({'name':path[_0xfc68('0x3b')](_0x2274a4[_0xfc68('0x31')])[_0xfc68('0x28')],'basename':path[_0xfc68('0x3b')](_0x2274a4[_0xfc68('0x31')])[_0xfc68('0x28')]+_0xfc68('0x3c'),'type':'application/pdf'})[_0xfc68('0x3d')](function(_0x5132a0){faxAccount[_0xfc68('0x3e')](_0x15bc7e,{'from':_0x2274a4[_0xfc68('0x36')],'mapKey':'fax','body':path['parse'](_0x2274a4['filename'])[_0xfc68('0x28')]+_0xfc68('0x3c'),'AttachmentId':_0x5132a0['id']})[_0xfc68('0x3f')](function(_0x4a0080){logger[_0xfc68('0x40')](_0x2274a4[_0xfc68('0x25')],'\x20notify\x20',JSON[_0xfc68('0x41')](_0x4a0080));});})[_0xfc68('0x3f')](function(_0x4cc4e2){logger[_0xfc68('0x40')](_0x2274a4['uniqueid'],_0xfc68('0x42'),JSON['stringify'](_0x4cc4e2));});});}logger[_0xfc68('0x29')](_0x2274a4[_0xfc68('0x25')],_0xfc68('0x42'));}};Fax[_0xfc68('0x1f')][_0xfc68('0x1e')]=function(_0x31cf4d){if(this[_0xfc68('0x10')][_0x31cf4d['uniqueid']]){_[_0xfc68('0x43')](this[_0xfc68('0x26')][_0x31cf4d['uniqueid']],_[_0xfc68('0x44')](_0x31cf4d,[_0xfc68('0x45'),_0xfc68('0x46')]));}};function updateStatus(_0xcf4358){if(_0xcf4358['AttachmentId']){faxMessage[_0xfc68('0x47')](_0xcf4358[_0xfc68('0x48')],{'failMessage':_0xfc68('0x49')})[_0xfc68('0x3d')](function(_0x490607){ut['logger'](_0xfc68('0x4a'),_0x490607);})[_0xfc68('0x3f')](function(_0x3fec7f){ut[_0xfc68('0x4b')](_0xfc68('0x4c'),_0x3fec7f);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xfc68('0x1f')][_0xfc68('0x4d')]=function(_0x4437f6,_0x1d446d,_0x39befd){var _0x3aca63=this;var _0x1f4889={};if(_0x1d446d){_0x1f4889={'read':_0x1d446d};}else{_0x1f4889={'failMessage':_0x39befd};}if(this[_0xfc68('0x10')][_0x4437f6][_0xfc68('0x48')]){faxMessage[_0xfc68('0x47')](this[_0xfc68('0x10')][_0x4437f6][_0xfc68('0x48')],_0x1f4889)[_0xfc68('0x3d')](function(_0x77d1b3){ut[_0xfc68('0x4b')](_0xfc68('0x4e'),_0x77d1b3);})['catch'](function(_0xcd252f){ut['logger'](_0xfc68('0x4f'),_0xcd252f);})[_0xfc68('0x50')](function(){delete _0x3aca63[_0xfc68('0x26')][_0x4437f6];delete _0x3aca63['actions'][_0x4437f6];});}else{ut[_0xfc68('0x4b')](_0xfc68('0x51'));delete this[_0xfc68('0x26')][_0x4437f6];delete this[_0xfc68('0x10')][_0x4437f6];}};Fax[_0xfc68('0x1f')][_0xfc68('0x1d')]=function(_0x2d88dc){var _0x53f903=this;if(this[_0xfc68('0x26')][_0x2d88dc['uniqueid']]){if(this[_0xfc68('0x10')][_0x2d88dc[_0xfc68('0x25')]]){this['channels'][_0x2d88dc['uniqueid']]['id']=this[_0xfc68('0x10')][_0x2d88dc['uniqueid']]['id'];this[_0xfc68('0x26')][_0x2d88dc[_0xfc68('0x25')]][_0xfc68('0x28')]=this[_0xfc68('0x10')][_0x2d88dc[_0xfc68('0x25')]][_0xfc68('0x28')];}logger[_0xfc68('0x29')](_0x2d88dc['uniqueid'],this['actions'][_0x2d88dc[_0xfc68('0x25')]]?_0xfc68('0x52'):_0xfc68('0x53'),JSON[_0xfc68('0x41')](this['channels'][_0x2d88dc['uniqueid']]));if(this[_0xfc68('0x10')][_0x2d88dc[_0xfc68('0x25')]]){if(this['channels'][_0x2d88dc[_0xfc68('0x25')]][_0xfc68('0x54')]>0x0&&this[_0xfc68('0x26')][_0x2d88dc['uniqueid']][_0xfc68('0x19')]===_0xfc68('0x55')){this[_0xfc68('0x4d')](_0x2d88dc['uniqueid'],!![]);}else{this['updateStatus'](_0x2d88dc['uniqueid'],![],this[_0xfc68('0x26')][_0x2d88dc[_0xfc68('0x25')]][_0xfc68('0x56')]?_0xfc68('0x57')+this[_0xfc68('0x26')][_0x2d88dc[_0xfc68('0x25')]][_0xfc68('0x56')]:_0xfc68('0x58'));}}}};Fax[_0xfc68('0x1f')][_0xfc68('0x59')]=function(_0x36061c){var _0x43cf21=this;return new BPromise(function(_0x3a9c56,_0xe7edda){_0x43cf21[_0xfc68('0x5a')](_0x36061c,_0x43cf21[_0xfc68('0xf')][_0x36061c[_0xfc68('0x5b')]])['then'](function(_0x5d94c2){ut[_0xfc68('0x4b')](_0xfc68('0x5c'),_0x5d94c2);_0x3a9c56(ut[_0xfc68('0x39')](_0xfc68('0x5d')));})['catch'](function(_0x56e6e5){ut['logger']('[Fax][execOriginate][failure]',_0x56e6e5);updateStatus(_0x36061c);_0xe7edda(ut['message'](_0xfc68('0x5e')));});});};Fax[_0xfc68('0x1f')][_0xfc68('0x5f')]=function(_0x1b5f27){var _0x14826a=this;return new BPromise(function(_0x2fce3e,_0x3a8fb9){var _0x2866b0=_0x14826a[_0xfc68('0x60')](_0x14826a[_0xfc68('0xf')][_0x1b5f27[_0xfc68('0x5b')]][_0xfc68('0x61')],_0x1b5f27);if(_0x2866b0[_0xfc68('0x62')]){_0x2fce3e(ut[_0xfc68('0x39')]('Trunk\x20Reachable'));}else{_0x3a8fb9(ut[_0xfc68('0x39')](_0x2866b0[_0xfc68('0x39')]));}});};function originate(_0x54dccb,_0x1e1609,_0x5dc252){return new BPromise(function(_0x4ca4be,_0x31320b){if(_0x5dc252){var _0x5be93c=util['format'](_0xfc68('0x63'),path[_0xfc68('0x3b')](_0x54dccb[_0xfc68('0x4')])['name'],_0x54dccb[_0xfc68('0x4')]);gs[_0xfc68('0x64')](_0x5be93c)[_0xfc68('0x3d')](function(){_0x54dccb[_0xfc68('0x4')]=util['format'](_0xfc68('0x65'),path[_0xfc68('0x3b')](_0x54dccb[_0xfc68('0x4')])[_0xfc68('0x66')],path[_0xfc68('0x3b')](_0x54dccb[_0xfc68('0x4')])['name']);_0x1e1609[_0xfc68('0x67')]=_0x54dccb['path'];ut[_0xfc68('0x4b')](_0xfc68('0x68'),'');ami[_0xfc68('0x69')](ut['variablesAction'](_0x54dccb,_0x1e1609))[_0xfc68('0x3d')](function(_0x474351){_0x4ca4be(_0x474351);})[_0xfc68('0x3f')](function(_0x678f71){_0x31320b(_0x678f71);});})['catch'](function(_0x277ab8){_0x31320b(_0x277ab8);});}else{ami[_0xfc68('0x69')](ut[_0xfc68('0x6a')](_0x54dccb,_0x1e1609))[_0xfc68('0x3d')](function(_0x5cdc07){_0x4ca4be(_0x5cdc07);})[_0xfc68('0x3f')](function(_0x56f99d){_0x31320b(_0x56f99d);});}});}Fax[_0xfc68('0x1f')][_0xfc68('0x5a')]=function(_0x1cd60e,_0x1ab91e){var _0x1e7b99=this;return new BPromise(function(_0x50b0b8,_0x5578d1){var _0x524299=uuid['v4']();var _0x2339e1=ut[_0xfc68('0x6b')](_0x1cd60e,_0x1ab91e);_0x1e7b99[_0xfc68('0x10')][_0x524299]=new Action(_0x524299,_0x1ab91e,_0x1cd60e);var _0x353820=_0x1e7b99[_0xfc68('0x10')][_0x524299];if(path['parse'](_0x1cd60e[_0xfc68('0x4')])[_0xfc68('0x6c')]===_0xfc68('0x3c')){originate(_0x353820,_0x2339e1,!![])[_0xfc68('0x3d')](function(_0x5cba6b){_0x50b0b8(_0x5cba6b);})[_0xfc68('0x3f')](function(_0x25b3c5){_0x5578d1(_0x25b3c5);});}else{originate(_0x353820,_0x2339e1,![])[_0xfc68('0x3d')](function(_0x2a101a){_0x50b0b8(_0x2a101a);})['catch'](function(_0x371180){_0x5578d1(_0x371180);});}});};Fax['prototype'][_0xfc68('0x6d')]=function(_0x26aa62){return!_[_0xfc68('0x6e')](_0x26aa62)&&!_[_0xfc68('0x6e')](_0x26aa62[_0xfc68('0x28')])&&!_[_0xfc68('0x6e')](_0x26aa62[_0xfc68('0x6f')])&&_0x26aa62[_0xfc68('0x6f')]&&!_[_0xfc68('0x6e')](this[_0xfc68('0x70')][util[_0xfc68('0x71')](_0xfc68('0x72'),_0x26aa62[_0xfc68('0x28')])])&&!_[_0xfc68('0x6e')](this[_0xfc68('0x70')][util[_0xfc68('0x71')](_0xfc68('0x72'),_0x26aa62[_0xfc68('0x28')])][_0xfc68('0x30')])&&(this[_0xfc68('0x70')][util[_0xfc68('0x71')](_0xfc68('0x72'),_0x26aa62['name'])][_0xfc68('0x30')]===_0xfc68('0x73')||this[_0xfc68('0x70')][util[_0xfc68('0x71')]('SIP/%s',_0x26aa62[_0xfc68('0x28')])][_0xfc68('0x30')]===_0xfc68('0x74'));};Fax['prototype']['checkTrunk']=function(_0x1590ca,_0x451ae9){if(!this['isTrunkReachable'](_0x1590ca)){ut[_0xfc68('0x4b')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0xfc68('0x6e')](_0x1590ca)?'':_0x1590ca[_0xfc68('0x28')]+_0xfc68('0x75'));return{'isValid':![],'message':_0xfc68('0x76')};}if(_[_0xfc68('0x6e')](_0x451ae9[_0xfc68('0x8')])){ut[_0xfc68('0x4b')](_0xfc68('0x77'),JSON[_0xfc68('0x41')](_0x451ae9));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x451ae9[_0xfc68('0x4')])){ut['logger'](_0xfc68('0x78'),JSON[_0xfc68('0x41')](_0x451ae9));return{'isValid':![],'message':_0xfc68('0x79')};}return{'isValid':!![],'message':_0xfc68('0x7a')};};module[_0xfc68('0x7b')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 28550f7..e52d7f9 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 _0xeff6=['lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch','[Notify]\x20','util','bluebird','../../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeff6,0xa5));var _0x6eff=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xeff6[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x6eff('0x0'));var BPromise=require(_0x6eff('0x1'));var logger=require(_0x6eff('0x2'))('preview');var _=require(_0x6eff('0x3'));var faxAccount=require(_0x6eff('0x4'));function loggerCatch(_0x2bc88e){return function(_0x4ba245){logger[_0x6eff('0x5')](_0x2bc88e,util[_0x6eff('0x6')](_0x4ba245,{'showHidden':![],'depth':null}));};}exports[_0x6eff('0x7')]=function(_0x28102a,_0x1b955d){return BPromise[_0x6eff('0x8')]()[_0x6eff('0x9')](faxAccount[_0x6eff('0x7')](_0x28102a,_0x1b955d))[_0x6eff('0xa')](loggerCatch(_0x6eff('0xb')));}; \ No newline at end of file +var _0x0b1b=['lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','[Notify]\x20','util','bluebird','../../../config/logger','preview'];(function(_0x24b582,_0x3c38c1){var _0x31118c=function(_0x485e3a){while(--_0x485e3a){_0x24b582['push'](_0x24b582['shift']());}};_0x31118c(++_0x3c38c1);}(_0x0b1b,0x1dc));var _0xb0b1=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x0b1b[_0x220f3f];return _0x1f170e;};'use strict';var util=require(_0xb0b1('0x0'));var BPromise=require(_0xb0b1('0x1'));var logger=require(_0xb0b1('0x2'))(_0xb0b1('0x3'));var _=require(_0xb0b1('0x4'));var faxAccount=require(_0xb0b1('0x5'));function loggerCatch(_0x170ec6){return function(_0x3dcf23){logger[_0xb0b1('0x6')](_0x170ec6,util[_0xb0b1('0x7')](_0x3dcf23,{'showHidden':![],'depth':null}));};}exports[_0xb0b1('0x8')]=function(_0x8b2bf9,_0x384695){return BPromise[_0xb0b1('0x9')]()[_0xb0b1('0xa')](faxAccount[_0xb0b1('0x8')](_0x8b2bf9,_0x384695))['catch'](loggerCatch(_0xb0b1('0xb')));}; \ 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 8ab1523..1c3d956 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 _0x939e=['Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','fax','child_process','info'];(function(_0x295748,_0xc8a90f){var _0x6191f8=function(_0x29c31d){while(--_0x29c31d){_0x295748['push'](_0x295748['shift']());}};_0x6191f8(++_0xc8a90f);}(_0x939e,0x16e));var _0xe939=function(_0x411c2e,_0x4ece66){_0x411c2e=_0x411c2e-0x0;var _0x5ed361=_0x939e[_0x411c2e];return _0x5ed361;};'use strict';var util=require(_0xe939('0x0'));var logger=require(_0xe939('0x1'))(_0xe939('0x2'));var BPromise=require('bluebird');var exec=require(_0xe939('0x3'))['exec'];exports['execute']=function(_0x22b8af){return new BPromise(function(_0x4a3258,_0x59628c){exec(_0x22b8af,function(_0x2c96b8,_0x2c9105,_0x3134ff){logger[_0xe939('0x4')](_0xe939('0x5'),_0x2c9105);if(_0x2c96b8){logger['info'](_0xe939('0x5'),_0xe939('0x6'),util['inspect'](_0x2c96b8,{'showHidden':![],'depth':null}),_0x2c9105,_0x3134ff);_0x59628c(_0x2c96b8);}_0x4a3258(_0x2c9105);});});}; \ No newline at end of file +var _0xd3e0=['inspect','../../../../config/logger','exec','execute','info','Exec\x20gs'];(function(_0x2a1d55,_0x1c2544){var _0x23821e=function(_0x53df4e){while(--_0x53df4e){_0x2a1d55['push'](_0x2a1d55['shift']());}};_0x23821e(++_0x1c2544);}(_0xd3e0,0x11b));var _0x0d3e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd3e0[_0x59ee6f];return _0x4c0979;};'use strict';var util=require('util');var logger=require(_0x0d3e('0x0'))('fax');var BPromise=require('bluebird');var exec=require('child_process')[_0x0d3e('0x1')];exports[_0x0d3e('0x2')]=function(_0x252b84){return new BPromise(function(_0x43576b,_0x22bbf3){exec(_0x252b84,function(_0x2bd2d2,_0xf79ca7,_0x3bac31){logger[_0x0d3e('0x3')](_0x0d3e('0x4'),_0xf79ca7);if(_0x2bd2d2){logger[_0x0d3e('0x3')](_0x0d3e('0x4'),'\x20Error\x20:',util[_0x0d3e('0x5')](_0x2bd2d2,{'showHidden':![],'depth':null}),_0xf79ca7,_0x3bac31);_0x22bbf3(_0x2bd2d2);}_0x43576b(_0xf79ca7);});});}; \ 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 49ea6ed..c132fd8 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 _0x9ae0=['uniqueid','util','lodash','moment','../../../../config/logger','message','logger','info','addVariables','ecm','minrate','maxrate','format','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','headerinfo'];(function(_0xa6aba5,_0x4a90d1){var _0x51b4a5=function(_0x1bacbd){while(--_0x1bacbd){_0xa6aba5['push'](_0xa6aba5['shift']());}};_0x51b4a5(++_0x4a90d1);}(_0x9ae0,0x7e));var _0x09ae=function(_0xc99e78,_0x26f9cf){_0xc99e78=_0xc99e78-0x0;var _0x533ee5=_0x9ae0[_0xc99e78];return _0x533ee5;};'use strict';var util=require(_0x09ae('0x0'));var _=require(_0x09ae('0x1'));var moment=require(_0x09ae('0x2'));var logger=require(_0x09ae('0x3'))('fax');exports[_0x09ae('0x4')]=function(_0x1ed663){return{'message':_0x1ed663};};exports[_0x09ae('0x5')]=function(_0x2150ad,_0x2c52fe){logger[_0x09ae('0x6')](_0x2150ad,util['inspect'](_0x2c52fe,{'showHidden':![],'depth':null}));};exports[_0x09ae('0x7')]=function(_0x43600a,_0x4ab59a){var _0x5cefc7={'XMF-ECM':_0x4ab59a[_0x09ae('0x8')],'XMF-HEADERINFO':_0x4ab59a['headerinfo'],'XMF-MINRATE':_0x4ab59a[_0x09ae('0x9')],'XMF-MAXRATE':_0x4ab59a[_0x09ae('0xa')],'XMF-MODEM':util[_0x09ae('0xb')]('\x22%s\x22',_0x4ab59a[_0x09ae('0xc')]),'XMF-GATEWAY':_0x4ab59a[_0x09ae('0xd')],'XMF-FAXDETECT':_0x4ab59a[_0x09ae('0xe')],'XMF-T38TIMEOUT':_0x4ab59a[_0x09ae('0xf')],'XMF-LOCALSTATIONID':_0x4ab59a[_0x09ae('0x10')],'XMF-PATH':_0x43600a[_0x09ae('0x11')]};return _0x5cefc7;};exports[_0x09ae('0x12')]=function(_0x25f663,_0x3d2abb){return{'actionid':_0x25f663['uniqueid'],'action':_0x09ae('0x13'),'channel':_0x25f663[_0x09ae('0x14')],'Exten':_0x09ae('0x15'),'Context':'from-sip','Priority':'1','callerid':util['format'](_0x09ae('0x16'),_0x25f663[_0x09ae('0x17')]?_0x25f663['headerinfo']:'',_0x25f663[_0x09ae('0x10')]),'variable':_0x3d2abb,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x25f663[_0x09ae('0x18')]};}; \ No newline at end of file +var _0x3ce1=['gateway','faxdetect','t38timeout','localstationid','path','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','message','logger','info','inspect','addVariables','headerinfo','minrate','format','\x22%s\x22'];(function(_0x24b04b,_0xdb2210){var _0x16c4fb=function(_0x35a69f){while(--_0x35a69f){_0x24b04b['push'](_0x24b04b['shift']());}};_0x16c4fb(++_0xdb2210);}(_0x3ce1,0xf0));var _0x13ce=function(_0x240a6d,_0x51a3d4){_0x240a6d=_0x240a6d-0x0;var _0x4d0de8=_0x3ce1[_0x240a6d];return _0x4d0de8;};'use strict';var util=require(_0x13ce('0x0'));var _=require(_0x13ce('0x1'));var moment=require(_0x13ce('0x2'));var logger=require(_0x13ce('0x3'))('fax');exports[_0x13ce('0x4')]=function(_0x37931f){return{'message':_0x37931f};};exports[_0x13ce('0x5')]=function(_0x255d50,_0x42800d){logger[_0x13ce('0x6')](_0x255d50,util[_0x13ce('0x7')](_0x42800d,{'showHidden':![],'depth':null}));};exports[_0x13ce('0x8')]=function(_0x4e16e1,_0x3709be){var _0x55e276={'XMF-ECM':_0x3709be['ecm'],'XMF-HEADERINFO':_0x3709be[_0x13ce('0x9')],'XMF-MINRATE':_0x3709be[_0x13ce('0xa')],'XMF-MAXRATE':_0x3709be['maxrate'],'XMF-MODEM':util[_0x13ce('0xb')](_0x13ce('0xc'),_0x3709be['modem']),'XMF-GATEWAY':_0x3709be[_0x13ce('0xd')],'XMF-FAXDETECT':_0x3709be[_0x13ce('0xe')],'XMF-T38TIMEOUT':_0x3709be[_0x13ce('0xf')],'XMF-LOCALSTATIONID':_0x3709be[_0x13ce('0x10')],'XMF-PATH':_0x4e16e1[_0x13ce('0x11')]};return _0x55e276;};exports['variablesAction']=function(_0x5b1a31,_0x2f60c7){return{'actionid':_0x5b1a31[_0x13ce('0x12')],'action':'originate','channel':_0x5b1a31[_0x13ce('0x13')],'Exten':_0x13ce('0x14'),'Context':_0x13ce('0x15'),'Priority':'1','callerid':util['format'](_0x13ce('0x16'),_0x5b1a31['headerinfo']?_0x5b1a31['headerinfo']:'',_0x5b1a31[_0x13ce('0x10')]),'variable':_0x2f60c7,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5b1a31[_0x13ce('0x12')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index da46ad9..3a841f9 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 _0x040f=['getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','bluebird','util','./server','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','getTelephones','then','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts'];(function(_0x2b9062,_0x42a0cf){var _0x813c2b=function(_0x4f15db){while(--_0x4f15db){_0x2b9062['push'](_0x2b9062['shift']());}};_0x813c2b(++_0x42a0cf);}(_0x040f,0x1e0));var _0xf040=function(_0x43535c,_0x1a2ca2){_0x43535c=_0x43535c-0x0;var _0x34d941=_0x040f[_0x43535c];return _0x34d941;};'use strict';var BPromise=require(_0xf040('0x0'));var util=require(_0xf040('0x1'));var moment=require('moment');var server=require(_0xf040('0x2'));var Realtime=require('./realtime');var Report=require(_0xf040('0x3'));var Acw=require(_0xf040('0x4'));var Trigger=require(_0xf040('0x5'));var Dialer=require(_0xf040('0x6'));var Preview=require(_0xf040('0x7'));var Fax=require(_0xf040('0x8'));var user=require(_0xf040('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xf040('0xa'));var trunk=require('./rpc/trunk');var trigger=require(_0xf040('0xb'));var template=require(_0xf040('0xc'));var cmHopperHistory=require(_0xf040('0xd'));var campaign=require(_0xf040('0xe'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xf040('0xf'));var freshdesk=require(_0xf040('0x10'));var desk=require('./rpc/integrations/desk');var zoho=require(_0xf040('0x11'));var vtiger=require(_0xf040('0x12'));var freshsales=require(_0xf040('0x13'));var servicenow=require(_0xf040('0x14'));var dynamics365=require(_0xf040('0x15'));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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xf040('0x16')](_0xf040('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xf040('0x16')](_0xf040('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xf040('0x18')]()['then'](user['getAgents']())['then'](realtime['initAgents']())['then'](user[_0xf040('0x19')]())[_0xf040('0x1a')](realtime['initTelephones']())[_0xf040('0x1a')](trunk[_0xf040('0x1b')]())[_0xf040('0x1a')](realtime[_0xf040('0x1c')]())['then'](voiceQueue[_0xf040('0x1d')]())['then'](realtime[_0xf040('0x1e')]())[_0xf040('0x1a')](trigger[_0xf040('0x1f')]())[_0xf040('0x1a')](realtime['initTriggers']())[_0xf040('0x1a')](template['getTemplates']())[_0xf040('0x1a')](realtime[_0xf040('0x20')]())[_0xf040('0x1a')](zendesk['getZendeskAccounts']())[_0xf040('0x1a')](realtime[_0xf040('0x21')]())[_0xf040('0x1a')](salesforce[_0xf040('0x22')]())[_0xf040('0x1a')](realtime[_0xf040('0x23')]())[_0xf040('0x1a')](sugarcrm[_0xf040('0x24')]())[_0xf040('0x1a')](realtime[_0xf040('0x25')]())[_0xf040('0x1a')](freshdesk[_0xf040('0x26')]())['then'](realtime[_0xf040('0x27')]())[_0xf040('0x1a')](desk[_0xf040('0x28')]())['then'](realtime['initDeskAccounts']())[_0xf040('0x1a')](zoho[_0xf040('0x29')]())['then'](realtime[_0xf040('0x2a')]())[_0xf040('0x1a')](vtiger[_0xf040('0x2b')]())['then'](realtime[_0xf040('0x2c')]())[_0xf040('0x1a')](freshsales[_0xf040('0x2d')]())['then'](realtime[_0xf040('0x2e')]())[_0xf040('0x1a')](servicenow['getServicenowAccounts']())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0xf040('0x2f')]())['then'](realtime[_0xf040('0x30')]())[_0xf040('0x1a')](campaign[_0xf040('0x31')]())['then'](realtime[_0xf040('0x32')]())[_0xf040('0x1a')](voiceExtension[_0xf040('0x33')]())[_0xf040('0x1a')](realtime[_0xf040('0x34')]())[_0xf040('0x1a')](faxAccount[_0xf040('0x35')]())[_0xf040('0x1a')](realtime[_0xf040('0x36')]())[_0xf040('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0xf040('0x18')]()[_0xf040('0x1a')](voiceQueueReport[_0xf040('0x37')]())[_0xf040('0x1a')](realtime[_0xf040('0x38')]())[_0xf040('0x1a')](cmHopperHistory[_0xf040('0x39')]())[_0xf040('0x1a')](realtime[_0xf040('0x3a')]())['then'](cmHopperHistory[_0xf040('0x3b')]())[_0xf040('0x1a')](realtime[_0xf040('0x3c')]())['then'](voiceCallReport[_0xf040('0x3d')]())['then'](realtime[_0xf040('0x3e')]())[_0xf040('0x1a')](function(_0xf31628){})[_0xf040('0x3f')](function(_0x3e1409){console[_0xf040('0x40')](_0x3e1409);});}function main(){return server['listen'](realtime,preview,fax)[_0xf040('0x1a')](function(_0x3c8e8a){return initRealtime();})[_0xf040('0x1a')](function(){return initParams();})[_0xf040('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xf040('0x3f')](function(_0xf8d258){console[_0xf040('0x40')](_0xf8d258);});}main(); \ No newline at end of file +var _0xd083=['./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','log','listen','sync','util','moment','./server','./realtime','./report','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount'];(function(_0x4ccad0,_0x2c1f1f){var _0x49ea59=function(_0x188659){while(--_0x188659){_0x4ccad0['push'](_0x4ccad0['shift']());}};_0x49ea59(++_0x2c1f1f);}(_0xd083,0x147));var _0x3d08=function(_0x389213,_0x14a50d){_0x389213=_0x389213-0x0;var _0x4ad6ca=_0xd083[_0x389213];return _0x4ad6ca;};'use strict';var BPromise=require('bluebird');var util=require(_0x3d08('0x0'));var moment=require(_0x3d08('0x1'));var server=require(_0x3d08('0x2'));var Realtime=require(_0x3d08('0x3'));var Report=require(_0x3d08('0x4'));var Acw=require('./acw');var Trigger=require(_0x3d08('0x5'));var Dialer=require(_0x3d08('0x6'));var Preview=require(_0x3d08('0x7'));var Fax=require(_0x3d08('0x8'));var user=require(_0x3d08('0x9'));var voiceQueue=require(_0x3d08('0xa'));var voiceQueueReport=require(_0x3d08('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x3d08('0xc'));var trigger=require(_0x3d08('0xd'));var template=require(_0x3d08('0xe'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x3d08('0xf'));var voiceExtension=require(_0x3d08('0x10'));var faxAccount=require(_0x3d08('0x11'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x3d08('0x12'));var sugarcrm=require(_0x3d08('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x3d08('0x14'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x3d08('0x15'));var freshsales=require(_0x3d08('0x16'));var servicenow=require(_0x3d08('0x17'));var dynamics365=require(_0x3d08('0x18'));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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x3d08('0x19')](_0x3d08('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x3d08('0x19')](_0x3d08('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x3d08('0x1b')](user['getAgents']())['then'](realtime[_0x3d08('0x1c')]())[_0x3d08('0x1b')](user[_0x3d08('0x1d')]())['then'](realtime[_0x3d08('0x1e')]())['then'](trunk[_0x3d08('0x1f')]())[_0x3d08('0x1b')](realtime[_0x3d08('0x20')]())[_0x3d08('0x1b')](voiceQueue[_0x3d08('0x21')]())[_0x3d08('0x1b')](realtime[_0x3d08('0x22')]())['then'](trigger['getTriggers']())['then'](realtime['initTriggers']())[_0x3d08('0x1b')](template[_0x3d08('0x23')]())[_0x3d08('0x1b')](realtime[_0x3d08('0x24')]())['then'](zendesk['getZendeskAccounts']())['then'](realtime[_0x3d08('0x25')]())[_0x3d08('0x1b')](salesforce[_0x3d08('0x26')]())[_0x3d08('0x1b')](realtime[_0x3d08('0x27')]())[_0x3d08('0x1b')](sugarcrm['getSugarcrmAccounts']())[_0x3d08('0x1b')](realtime[_0x3d08('0x28')]())['then'](freshdesk[_0x3d08('0x29')]())['then'](realtime[_0x3d08('0x2a')]())[_0x3d08('0x1b')](desk[_0x3d08('0x2b')]())[_0x3d08('0x1b')](realtime[_0x3d08('0x2c')]())[_0x3d08('0x1b')](zoho[_0x3d08('0x2d')]())[_0x3d08('0x1b')](realtime[_0x3d08('0x2e')]())[_0x3d08('0x1b')](vtiger[_0x3d08('0x2f')]())[_0x3d08('0x1b')](realtime[_0x3d08('0x30')]())[_0x3d08('0x1b')](freshsales['getFreshsalesAccounts']())[_0x3d08('0x1b')](realtime['initFreshsalesAccounts']())[_0x3d08('0x1b')](servicenow[_0x3d08('0x31')]())['then'](realtime[_0x3d08('0x32')]())[_0x3d08('0x1b')](dynamics365[_0x3d08('0x33')]())['then'](realtime[_0x3d08('0x34')]())['then'](campaign[_0x3d08('0x35')]())[_0x3d08('0x1b')](realtime[_0x3d08('0x36')]())['then'](voiceExtension[_0x3d08('0x37')]())['then'](realtime[_0x3d08('0x38')]())['then'](faxAccount[_0x3d08('0x39')]())[_0x3d08('0x1b')](realtime[_0x3d08('0x3a')]())[_0x3d08('0x1b')](function(){return realtime;});}function initParams(){return BPromise[_0x3d08('0x3b')]()[_0x3d08('0x1b')](voiceQueueReport[_0x3d08('0x3c')]())[_0x3d08('0x1b')](realtime['initVoiceQueueReports']())[_0x3d08('0x1b')](cmHopperHistory[_0x3d08('0x3d')]())[_0x3d08('0x1b')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x3d08('0x3e')]())[_0x3d08('0x1b')](realtime[_0x3d08('0x3f')]())[_0x3d08('0x1b')](voiceCallReport['getVoiceCallReports']())[_0x3d08('0x1b')](realtime[_0x3d08('0x40')]())[_0x3d08('0x1b')](function(_0x519cce){})[_0x3d08('0x41')](function(_0x234f3d){console[_0x3d08('0x42')](_0x234f3d);});}function main(){return server[_0x3d08('0x43')](realtime,preview,fax)[_0x3d08('0x1b')](function(_0x473424){return initRealtime();})[_0x3d08('0x1b')](function(){return initParams();})[_0x3d08('0x1b')](function(){report[_0x3d08('0x44')]();setInterval(initRealtime,0x1388);})[_0x3d08('0x41')](function(_0x335dd3){console[_0x3d08('0x42')](_0x335dd3);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 02cc017..65cd533 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(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xedd9,0xfc));var _0x9edd=function(_0x1499ef,_0x5371fd){_0x1499ef=_0x1499ef-0x0;var _0x4179bc=_0xedd9[_0x1499ef];return _0x4179bc;};'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 _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x42167f,_0x36c277){var _0x20f119=function(_0x1f79f3){while(--_0x1f79f3){_0x42167f['push'](_0x42167f['shift']());}};_0x20f119(++_0x36c277);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 09a921e..b7287a5 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 _0xa156=['dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','temp','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0xa156,0x127));var _0x6a15=function(_0x488c32,_0x518a48){_0x488c32=_0x488c32-0x0;var _0xec4525=_0xa156[_0x488c32];return _0xec4525;};'use strict';function Campaign(_0x15313a){this['id']=_0x15313a['id']||0x0;this[_0x6a15('0x0')]=_0x15313a[_0x6a15('0x0')]||'';this[_0x6a15('0x1')]=_0x15313a[_0x6a15('0x1')]||_0x6a15('0x2');this['originated']=0x0;this[_0x6a15('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x6a15('0x4')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0x6a15('0x5')]=_0x15313a[_0x6a15('0x5')];this[_0x6a15('0x6')]=_0x15313a[_0x6a15('0x6')];this[_0x6a15('0x7')]=_0x15313a[_0x6a15('0x7')]||null;this[_0x6a15('0x8')]=_0x15313a['dialGlobalInterval']?_0x15313a['dialGlobalInterval']:null;this[_0x6a15('0x9')]=_0x15313a[_0x6a15('0x9')];this['dialOriginateCallerIdNumber']=_0x15313a[_0x6a15('0xa')];this['dialOriginateTimeout']=_0x15313a['dialOriginateTimeout']||0x1e;this[_0x6a15('0xb')]=_0x15313a[_0x6a15('0xb')];this[_0x6a15('0xc')]=_0x15313a[_0x6a15('0xc')];this['dialBusyMaxRetry']=_0x15313a[_0x6a15('0xd')];this[_0x6a15('0xe')]=_0x15313a[_0x6a15('0xe')];this[_0x6a15('0xf')]=_0x15313a[_0x6a15('0xf')];this[_0x6a15('0x10')]=_0x15313a[_0x6a15('0x10')];this['dialGlobalMaxRetry']=_0x15313a[_0x6a15('0x11')];this[_0x6a15('0x12')]=_0x15313a['dialNoSuchNumberMaxRetry']||0x3;this[_0x6a15('0x13')]=_0x15313a[_0x6a15('0x13')]||0x96;this[_0x6a15('0x14')]=_0x15313a[_0x6a15('0x14')]||0x3;this['dialDropRetryFrequency']=_0x15313a[_0x6a15('0x15')]||0x96;this[_0x6a15('0x16')]=_0x15313a[_0x6a15('0x16')]||0x3;this[_0x6a15('0x17')]=_0x15313a[_0x6a15('0x17')]||0x96;this[_0x6a15('0x18')]=_0x15313a[_0x6a15('0x18')]||0x3;this[_0x6a15('0x19')]=_0x15313a[_0x6a15('0x19')]||0x96;this[_0x6a15('0x1a')]=_0x15313a[_0x6a15('0x1a')]||0x3;this[_0x6a15('0x1b')]=_0x15313a[_0x6a15('0x1b')]||0x96;this[_0x6a15('0x1c')]=_0x15313a[_0x6a15('0x1c')]||_0x6a15('0x1d');this['dialPrefix']=_0x15313a[_0x6a15('0x1e')]||undefined;this[_0x6a15('0x1f')]=_0x15313a[_0x6a15('0x1f')]||undefined;this[_0x6a15('0x20')]=_0x15313a['dialCutDigit']||undefined;this[_0x6a15('0x21')]=_0x15313a['TrunkBackup']?_0x15313a['TrunkBackup']:undefined;this['Trunk']=_0x15313a[_0x6a15('0x22')]?_0x15313a['Trunk']:undefined;this[_0x6a15('0x23')]=_0x15313a[_0x6a15('0x23')]?_0x15313a['Interval']:undefined;this['SquareProject']=_0x15313a[_0x6a15('0x24')]?_0x15313a['SquareProject']:undefined;this['dialQueueProject']=_0x15313a[_0x6a15('0x24')]?_0x15313a['SquareProject'][_0x6a15('0x0')]:undefined;this['dialAMDActive']=_0x15313a['dialAMDActive']||![];this[_0x6a15('0x25')]=_0x15313a[_0x6a15('0x25')];this[_0x6a15('0x26')]=_0x15313a[_0x6a15('0x26')];this['dialAMDAfterGreetingSilence']=_0x15313a[_0x6a15('0x27')];this[_0x6a15('0x28')]=_0x15313a[_0x6a15('0x28')];this['dialAMDMinWordLength']=_0x15313a[_0x6a15('0x29')];this[_0x6a15('0x2a')]=_0x15313a[_0x6a15('0x2a')];this[_0x6a15('0x2b')]=_0x15313a[_0x6a15('0x2b')];this[_0x6a15('0x2c')]=_0x15313a[_0x6a15('0x2c')];this[_0x6a15('0x2d')]=_0x15313a[_0x6a15('0x2d')];}module['exports']=Campaign; \ No newline at end of file +var _0x6208=['dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x3ca337,_0x143289){var _0x4b9205=function(_0x529a68){while(--_0x529a68){_0x3ca337['push'](_0x3ca337['shift']());}};_0x4b9205(++_0x143289);}(_0x6208,0x135));var _0x8620=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6208[_0x3947c9];return _0x2e7871;};'use strict';function Campaign(_0x2ba31d){this['id']=_0x2ba31d['id']||0x0;this[_0x8620('0x0')]=_0x2ba31d[_0x8620('0x0')]||'';this['type']=_0x2ba31d['type']||'campaign';this[_0x8620('0x1')]=0x0;this[_0x8620('0x2')]=0x0;this[_0x8620('0x3')]=0x0;this[_0x8620('0x4')]=0x0;this[_0x8620('0x5')]='';this[_0x8620('0x6')]=!![];this[_0x8620('0x7')]=_0x2ba31d[_0x8620('0x7')];this['limitCalls']=_0x2ba31d[_0x8620('0x8')];this[_0x8620('0x9')]=_0x2ba31d['dialTimezone']||null;this[_0x8620('0xa')]=_0x2ba31d[_0x8620('0xa')]?_0x2ba31d[_0x8620('0xa')]:null;this['dialOriginateCallerIdName']=_0x2ba31d[_0x8620('0xb')];this[_0x8620('0xc')]=_0x2ba31d[_0x8620('0xc')];this[_0x8620('0xd')]=_0x2ba31d['dialOriginateTimeout']||0x1e;this[_0x8620('0xe')]=_0x2ba31d[_0x8620('0xe')];this[_0x8620('0xf')]=_0x2ba31d[_0x8620('0xf')];this[_0x8620('0x10')]=_0x2ba31d[_0x8620('0x10')];this[_0x8620('0x11')]=_0x2ba31d[_0x8620('0x11')];this[_0x8620('0x12')]=_0x2ba31d[_0x8620('0x12')];this['dialNoAnswerRetryFrequency']=_0x2ba31d['dialNoAnswerRetryFrequency'];this[_0x8620('0x13')]=_0x2ba31d[_0x8620('0x13')];this[_0x8620('0x14')]=_0x2ba31d[_0x8620('0x14')]||0x3;this[_0x8620('0x15')]=_0x2ba31d[_0x8620('0x15')]||0x96;this[_0x8620('0x16')]=_0x2ba31d[_0x8620('0x16')]||0x3;this['dialDropRetryFrequency']=_0x2ba31d[_0x8620('0x17')]||0x96;this[_0x8620('0x18')]=_0x2ba31d[_0x8620('0x18')]||0x3;this[_0x8620('0x19')]=_0x2ba31d['dialAbandonedRetryFrequency']||0x96;this[_0x8620('0x1a')]=_0x2ba31d[_0x8620('0x1a')]||0x3;this[_0x8620('0x1b')]=_0x2ba31d[_0x8620('0x1b')]||0x96;this['dialAgentRejectMaxRetry']=_0x2ba31d[_0x8620('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x2ba31d[_0x8620('0x1d')]||0x96;this[_0x8620('0x1e')]=_0x2ba31d[_0x8620('0x1e')]||_0x8620('0x1f');this[_0x8620('0x20')]=_0x2ba31d[_0x8620('0x20')]||undefined;this[_0x8620('0x21')]=_0x2ba31d[_0x8620('0x21')]||undefined;this[_0x8620('0x22')]=_0x2ba31d[_0x8620('0x22')]||undefined;this[_0x8620('0x23')]=_0x2ba31d['TrunkBackup']?_0x2ba31d['TrunkBackup']:undefined;this[_0x8620('0x24')]=_0x2ba31d[_0x8620('0x24')]?_0x2ba31d[_0x8620('0x24')]:undefined;this[_0x8620('0x25')]=_0x2ba31d[_0x8620('0x25')]?_0x2ba31d[_0x8620('0x25')]:undefined;this[_0x8620('0x26')]=_0x2ba31d[_0x8620('0x26')]?_0x2ba31d[_0x8620('0x26')]:undefined;this[_0x8620('0x27')]=_0x2ba31d[_0x8620('0x26')]?_0x2ba31d['SquareProject'][_0x8620('0x0')]:undefined;this[_0x8620('0x28')]=_0x2ba31d[_0x8620('0x28')]||![];this[_0x8620('0x29')]=_0x2ba31d[_0x8620('0x29')];this['dialAMDGreeting']=_0x2ba31d[_0x8620('0x2a')];this[_0x8620('0x2b')]=_0x2ba31d[_0x8620('0x2b')];this[_0x8620('0x2c')]=_0x2ba31d[_0x8620('0x2c')];this['dialAMDMinWordLength']=_0x2ba31d[_0x8620('0x2d')];this[_0x8620('0x2e')]=_0x2ba31d['dialAMDBetweenWordsSilence'];this[_0x8620('0x2f')]=_0x2ba31d[_0x8620('0x2f')];this[_0x8620('0x30')]=_0x2ba31d[_0x8620('0x30')];this[_0x8620('0x31')]=_0x2ba31d['dialAMDMaximumWordLength'];}module[_0x8620('0x32')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 7ef8843..ed4fce3 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 _0x2fc9=['lastdata','duration','billableseconds','holdtime','tag','disposition','monitor','queue','monitors','transfercalleridnum','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','unmanaged','abandoned','lastapplication'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x2fc9,0xc2));var _0x92fc=function(_0x187279,_0x26d152){_0x187279=_0x187279-0x0;var _0x3da59d=_0x2fc9[_0x187279];return _0x3da59d;};'use strict';function Channel(){this['starttime']=null;this[_0x92fc('0x0')]='';this[_0x92fc('0x1')]='';this[_0x92fc('0x2')]=0x0;this[_0x92fc('0x3')]='';this[_0x92fc('0x4')]=undefined;this[_0x92fc('0x5')]=undefined;this[_0x92fc('0x6')]=0x0;this[_0x92fc('0x7')]='';this[_0x92fc('0x8')]=0x0;this[_0x92fc('0x9')]=0x0;this[_0x92fc('0xa')]=0x0;this['answered']=![];this['answertime']=null;this['endtime']=null;this[_0x92fc('0xb')]=![];this[_0x92fc('0xc')]=![];this[_0x92fc('0xd')]='';this[_0x92fc('0xe')]='';this[_0x92fc('0xf')]=0x0;this[_0x92fc('0x10')]=0x0;this[_0x92fc('0x11')]=0x0;this['type']=null;this[_0x92fc('0x12')]=null;this[_0x92fc('0x13')]=null;this[_0x92fc('0x14')]=![];this['monitorFilename']=null;this[_0x92fc('0x15')]=null;this[_0x92fc('0x16')]=[];this[_0x92fc('0x17')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this[_0x92fc('0x18')]=0x0;}module[_0x92fc('0x19')]=Channel; \ No newline at end of file +var _0x1472=['disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','linkedid','exten','answered','unmanaged','lastapplication','lastdata','duration','holdtime','type'];(function(_0x51d7cf,_0x3d9a36){var _0x44b7ce=function(_0x389958){while(--_0x389958){_0x51d7cf['push'](_0x51d7cf['shift']());}};_0x44b7ce(++_0x3d9a36);}(_0x1472,0x166));var _0x2147=function(_0x382168,_0xe03b6a){_0x382168=_0x382168-0x0;var _0x3ecf7e=_0x1472[_0x382168];return _0x3ecf7e;};'use strict';function Channel(){this[_0x2147('0x0')]=null;this[_0x2147('0x1')]='';this[_0x2147('0x2')]='';this[_0x2147('0x3')]=0x0;this[_0x2147('0x4')]='';this[_0x2147('0x5')]=undefined;this[_0x2147('0x6')]=undefined;this[_0x2147('0x7')]=0x0;this['context']='';this['uniqueid']=0x0;this[_0x2147('0x8')]=0x0;this[_0x2147('0x9')]=0x0;this[_0x2147('0xa')]=![];this['answertime']=null;this['endtime']=null;this[_0x2147('0xb')]=![];this['abandoned']=![];this[_0x2147('0xc')]='';this[_0x2147('0xd')]='';this[_0x2147('0xe')]=0x0;this['billableseconds']=0x0;this[_0x2147('0xf')]=0x0;this[_0x2147('0x10')]=null;this['tag']=null;this[_0x2147('0x11')]=null;this[_0x2147('0x12')]=![];this[_0x2147('0x13')]=null;this[_0x2147('0x14')]=null;this[_0x2147('0x15')]=[];this['transfercalleridnum']=undefined;this[_0x2147('0x16')]=undefined;this['transferType']=undefined;this[_0x2147('0x17')]=0x0;}module[_0x2147('0x18')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index e79b9d4..831c190 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 _0xa45c=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xa45c,0xb6));var _0xca45=function(_0x2158c5,_0x4c3900){_0x2158c5=_0x2158c5-0x0;var _0x21f1e4=_0xa45c[_0x2158c5];return _0x21f1e4;};'use strict';function DeskAccount(_0x22d85a){this['id']=_0x22d85a['id']||0x0;this[_0xca45('0x0')]=_0x22d85a[_0xca45('0x0')]||'';this[_0xca45('0x1')]=_0x22d85a[_0xca45('0x1')]||'';this[_0xca45('0x2')]=_0x22d85a[_0xca45('0x2')]||'';this[_0xca45('0x3')]=_0x22d85a[_0xca45('0x3')]||'';this[_0xca45('0x4')]=_0x22d85a[_0xca45('0x4')]||'';this[_0xca45('0x5')]=_0x22d85a[_0xca45('0x5')]||'';this['consumerSecret']=_0x22d85a[_0xca45('0x6')]||'';this[_0xca45('0x7')]=_0x22d85a['token']||'';this[_0xca45('0x8')]=_0x22d85a[_0xca45('0x8')]||'';this[_0xca45('0x9')]=_0x22d85a[_0xca45('0x9')]||'';this['serverUrl']=_0x22d85a[_0xca45('0xa')]||'';this[_0xca45('0xb')]=_0x22d85a[_0xca45('0xb')]||{};}module[_0xca45('0xc')]=DeskAccount; \ No newline at end of file +var _0x5dd6=['tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x5dd6,0x1d9));var _0x65dd=function(_0x15b0d0,_0x49d4bc){_0x15b0d0=_0x15b0d0-0x0;var _0x31a929=_0x5dd6[_0x15b0d0];return _0x31a929;};'use strict';function DeskAccount(_0x380598){this['id']=_0x380598['id']||0x0;this[_0x65dd('0x0')]=_0x380598[_0x65dd('0x0')]||'';this[_0x65dd('0x1')]=_0x380598[_0x65dd('0x1')]||'';this[_0x65dd('0x2')]=_0x380598[_0x65dd('0x2')]||'';this[_0x65dd('0x3')]=_0x380598[_0x65dd('0x3')]||'';this[_0x65dd('0x4')]=_0x380598[_0x65dd('0x4')]||'';this[_0x65dd('0x5')]=_0x380598[_0x65dd('0x5')]||'';this[_0x65dd('0x6')]=_0x380598[_0x65dd('0x6')]||'';this[_0x65dd('0x7')]=_0x380598[_0x65dd('0x7')]||'';this[_0x65dd('0x8')]=_0x380598[_0x65dd('0x8')]||'';this[_0x65dd('0x9')]=_0x380598[_0x65dd('0x9')]||'';this[_0x65dd('0xa')]=_0x380598[_0x65dd('0xa')]||'';this[_0x65dd('0xb')]=_0x380598[_0x65dd('0xb')]||{};}module[_0x65dd('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index ea46828..a95e925 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 _0x2750=['clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0x2aa786,_0x493775){var _0x5bcfec=function(_0x63b0b8){while(--_0x63b0b8){_0x2aa786['push'](_0x2aa786['shift']());}};_0x5bcfec(++_0x493775);}(_0x2750,0x13b));var _0x0275=function(_0x1a950f,_0x42f586){_0x1a950f=_0x1a950f-0x0;var _0xef5a3f=_0x2750[_0x1a950f];return _0xef5a3f;};'use strict';function Dynamics365Account(_0x1c9f4d){this['id']=_0x1c9f4d['id']||0x0;this['name']=_0x1c9f4d[_0x0275('0x0')]||'';this[_0x0275('0x1')]=_0x1c9f4d[_0x0275('0x1')]||'';this[_0x0275('0x2')]=_0x1c9f4d[_0x0275('0x2')]||'';this[_0x0275('0x3')]=_0x1c9f4d[_0x0275('0x3')]||'';this[_0x0275('0x4')]=_0x1c9f4d[_0x0275('0x4')]||'';this[_0x0275('0x5')]=_0x1c9f4d['clientId']||'';this[_0x0275('0x6')]=_0x1c9f4d[_0x0275('0x6')]||{};this[_0x0275('0x7')]=_0x1c9f4d[_0x0275('0x7')]||'';this['Configurations']=_0x1c9f4d[_0x0275('0x8')]||{};}module[_0x0275('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x3c81=['Configurations','exports','name','username','tenantId','clientId','clientSecret','serverUrl'];(function(_0x217d92,_0x315c46){var _0x10b1f8=function(_0x543a97){while(--_0x543a97){_0x217d92['push'](_0x217d92['shift']());}};_0x10b1f8(++_0x315c46);}(_0x3c81,0x102));var _0x13c8=function(_0x1e197a,_0x2a26ab){_0x1e197a=_0x1e197a-0x0;var _0x584ed5=_0x3c81[_0x1e197a];return _0x584ed5;};'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 diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index a94a772..46501a7 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 _0x8d53=['Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','SIP'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0x8d53,0xa4));var _0x38d5=function(_0xfc3b7e,_0x4df801){_0xfc3b7e=_0xfc3b7e-0x0;var _0x4396d4=_0x8d53[_0xfc3b7e];return _0x4396d4;};'use strict';function FaxAccount(_0x16e522){this['id']=_0x16e522['id']||0x0;this[_0x38d5('0x0')]=_0x16e522[_0x38d5('0x0')]||'';this[_0x38d5('0x1')]=_0x16e522[_0x38d5('0x1')];this[_0x38d5('0x2')]=_0x16e522[_0x38d5('0x2')];this[_0x38d5('0x3')]=_0x16e522[_0x38d5('0x3')];this[_0x38d5('0x4')]=_0x16e522[_0x38d5('0x4')];this[_0x38d5('0x5')]=_0x16e522[_0x38d5('0x5')]||0x960;this[_0x38d5('0x6')]=_0x16e522[_0x38d5('0x6')]||0x3840;this[_0x38d5('0x7')]=_0x16e522[_0x38d5('0x7')]||'v17,v27,v29';this['gateway']=_0x16e522[_0x38d5('0x8')]||'no';this[_0x38d5('0x9')]=_0x16e522[_0x38d5('0x9')]||'no';this['t38timeout']=_0x16e522[_0x38d5('0xa')]||0x1388;this['tech']=_0x16e522['tech']||_0x38d5('0xb');this[_0x38d5('0xc')]=_0x16e522[_0x38d5('0xc')]?_0x16e522['Trunk']:undefined;this[_0x38d5('0xd')]=_0x16e522[_0x38d5('0xd')];this[_0x38d5('0xe')]=_0x16e522[_0x38d5('0xe')];}module[_0x38d5('0xf')]=FaxAccount; \ No newline at end of file +var _0xd222=['localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo'];(function(_0x4b4493,_0x49a69a){var _0x180f32=function(_0x1133bb){while(--_0x1133bb){_0x4b4493['push'](_0x4b4493['shift']());}};_0x180f32(++_0x49a69a);}(_0xd222,0x15c));var _0x2d22=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0xd222[_0x2b5513];return _0x578fd2;};'use strict';function FaxAccount(_0x25e8b9){this['id']=_0x25e8b9['id']||0x0;this[_0x2d22('0x0')]=_0x25e8b9[_0x2d22('0x0')]||'';this[_0x2d22('0x1')]=_0x25e8b9['description'];this[_0x2d22('0x2')]=_0x25e8b9[_0x2d22('0x2')];this[_0x2d22('0x3')]=_0x25e8b9[_0x2d22('0x3')];this[_0x2d22('0x4')]=_0x25e8b9['localstationid'];this[_0x2d22('0x5')]=_0x25e8b9[_0x2d22('0x5')]||0x960;this[_0x2d22('0x6')]=_0x25e8b9[_0x2d22('0x6')]||0x3840;this[_0x2d22('0x7')]=_0x25e8b9[_0x2d22('0x7')]||'v17,v27,v29';this['gateway']=_0x25e8b9[_0x2d22('0x8')]||'no';this['faxdetect']=_0x25e8b9[_0x2d22('0x9')]||'no';this[_0x2d22('0xa')]=_0x25e8b9[_0x2d22('0xa')]||0x1388;this['tech']=_0x25e8b9['tech']||_0x2d22('0xb');this[_0x2d22('0xc')]=_0x25e8b9['Trunk']?_0x25e8b9[_0x2d22('0xc')]:undefined;this[_0x2d22('0xd')]=_0x25e8b9[_0x2d22('0xd')];this[_0x2d22('0xe')]=_0x25e8b9[_0x2d22('0xe')];}module[_0x2d22('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index fab088b..0257816 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 _0x6de5=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x445829,_0x4a36d4){var _0x7141fc=function(_0x43000b){while(--_0x43000b){_0x445829['push'](_0x445829['shift']());}};_0x7141fc(++_0x4a36d4);}(_0x6de5,0x195));var _0x56de=function(_0x50781f,_0x1dbe42){_0x50781f=_0x50781f-0x0;var _0x469927=_0x6de5[_0x50781f];return _0x469927;};'use strict';function FreshdeskAccount(_0x551cdf){this['id']=_0x551cdf['id']||0x0;this[_0x56de('0x0')]=_0x551cdf[_0x56de('0x0')]||'';this[_0x56de('0x1')]=_0x551cdf[_0x56de('0x1')]||'';this[_0x56de('0x2')]=_0x551cdf[_0x56de('0x3')]||'';this[_0x56de('0x4')]=_0x551cdf[_0x56de('0x4')]||'';this[_0x56de('0x5')]=_0x551cdf[_0x56de('0x5')]||'';this[_0x56de('0x6')]=_0x551cdf[_0x56de('0x6')]||{};}module[_0x56de('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x0c41=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x3316ee,_0x1c9247){var _0x5837c1=function(_0x35cc0d){while(--_0x35cc0d){_0x3316ee['push'](_0x3316ee['shift']());}};_0x5837c1(++_0x1c9247);}(_0x0c41,0x80));var _0x10c4=function(_0x41b06b,_0x34d7bb){_0x41b06b=_0x41b06b-0x0;var _0x52fce1=_0x0c41[_0x41b06b];return _0x52fce1;};'use strict';function FreshdeskAccount(_0x59f53e){this['id']=_0x59f53e['id']||0x0;this[_0x10c4('0x0')]=_0x59f53e['name']||'';this['username']=_0x59f53e[_0x10c4('0x1')]||'';this[_0x10c4('0x2')]=_0x59f53e[_0x10c4('0x3')]||'';this['remoteUri']=_0x59f53e[_0x10c4('0x4')]||'';this[_0x10c4('0x5')]=_0x59f53e[_0x10c4('0x5')]||'';this[_0x10c4('0x6')]=_0x59f53e[_0x10c4('0x6')]||{};}module[_0x10c4('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 b44d949..a592351 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 _0x7d9f=['name','username','token','remoteUri','serverUrl','exports'];(function(_0x141585,_0x32d3e1){var _0x204ca7=function(_0x1c114d){while(--_0x1c114d){_0x141585['push'](_0x141585['shift']());}};_0x204ca7(++_0x32d3e1);}(_0x7d9f,0x15c));var _0xf7d9=function(_0xc2c13a,_0x1070d3){_0xc2c13a=_0xc2c13a-0x0;var _0x2b8e2f=_0x7d9f[_0xc2c13a];return _0x2b8e2f;};'use strict';function FreshsalesAccount(_0x1adc1f){this['id']=_0x1adc1f['id']||0x0;this[_0xf7d9('0x0')]=_0x1adc1f[_0xf7d9('0x0')]||'';this[_0xf7d9('0x1')]=_0x1adc1f[_0xf7d9('0x1')]||'';this['apiKey']=_0x1adc1f[_0xf7d9('0x2')]||'';this[_0xf7d9('0x3')]=_0x1adc1f[_0xf7d9('0x3')]||'';this[_0xf7d9('0x4')]=_0x1adc1f[_0xf7d9('0x4')]||'';this['Configurations']=_0x1adc1f['Configurations']||{};}module[_0xf7d9('0x5')]=FreshsalesAccount; \ No newline at end of file +var _0xf3fe=['username','apiKey','remoteUri','serverUrl','Configurations','name'];(function(_0x48f70e,_0x164895){var _0x87c997=function(_0xc48c3a){while(--_0xc48c3a){_0x48f70e['push'](_0x48f70e['shift']());}};_0x87c997(++_0x164895);}(_0xf3fe,0x1cd));var _0xef3f=function(_0x3859ef,_0x43c9e5){_0x3859ef=_0x3859ef-0x0;var _0x11fe66=_0xf3fe[_0x3859ef];return _0x11fe66;};'use strict';function FreshsalesAccount(_0x4f5e4f){this['id']=_0x4f5e4f['id']||0x0;this[_0xef3f('0x0')]=_0x4f5e4f[_0xef3f('0x0')]||'';this[_0xef3f('0x1')]=_0x4f5e4f[_0xef3f('0x1')]||'';this[_0xef3f('0x2')]=_0x4f5e4f['token']||'';this[_0xef3f('0x3')]=_0x4f5e4f[_0xef3f('0x3')]||'';this[_0xef3f('0x4')]=_0x4f5e4f[_0xef3f('0x4')]||'';this[_0xef3f('0x5')]=_0x4f5e4f['Configurations']||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 630186c..3166d8d 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 _0x2092=['type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','assigned','lastAssignedTo','voice','mohtime','variables','exports'];(function(_0x1df9de,_0x40c529){var _0xcd0adb=function(_0x2658d1){while(--_0x2658d1){_0x1df9de['push'](_0x1df9de['shift']());}};_0xcd0adb(++_0x40c529);}(_0x2092,0x1d0));var _0x2209=function(_0x2e0eeb,_0x5bc292){_0x2e0eeb=_0x2e0eeb-0x0;var _0x3c790e=_0x2092[_0x2e0eeb];return _0x3c790e;};'use strict';function QueueReport(){this[_0x2209('0x0')]=_0x2209('0x1');this[_0x2209('0x2')]='';this[_0x2209('0x3')]='';this[_0x2209('0x4')]='';this[_0x2209('0x5')]='';this[_0x2209('0x6')]=null;this[_0x2209('0x7')]=null;this[_0x2209('0x8')]=0x1;this[_0x2209('0x9')]=0x1;this['queuecallerabandon']=![];this[_0x2209('0xa')]=null;this[_0x2209('0xb')]=![];this[_0x2209('0xc')]=null;this[_0x2209('0xd')]=![];this[_0x2209('0xe')]=null;this[_0x2209('0xf')]=0x1;this[_0x2209('0x10')]='';this[_0x2209('0x11')]='';this[_0x2209('0x12')]='';this[_0x2209('0x13')]='';this[_0x2209('0x14')]='';this[_0x2209('0x15')]='';this[_0x2209('0x16')]='';this['holdtime']=0x0;this[_0x2209('0x17')]=![];this[_0x2209('0x18')]='';this['motionChannel']=_0x2209('0x19');this[_0x2209('0x1a')]=0x0;this[_0x2209('0x1b')]={};}module[_0x2209('0x1c')]=QueueReport; \ No newline at end of file +var _0x5cfc=['mohtime','variables','type','inbound','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','exten','holdtime','assigned','lastAssignedTo','motionChannel','voice'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5cfc,0x106));var _0xc5cf=function(_0x132558,_0x521d93){_0x132558=_0x132558-0x0;var _0x34f138=_0x5cfc[_0x132558];return _0x34f138;};'use strict';function QueueReport(){this[_0xc5cf('0x0')]=_0xc5cf('0x1');this['uniqueid']='';this['calleridnum']='';this['calleridname']='';this[_0xc5cf('0x2')]='';this[_0xc5cf('0x3')]=null;this[_0xc5cf('0x4')]=null;this[_0xc5cf('0x5')]=0x1;this[_0xc5cf('0x6')]=0x1;this[_0xc5cf('0x7')]=![];this[_0xc5cf('0x8')]=null;this[_0xc5cf('0x9')]=![];this[_0xc5cf('0xa')]=null;this[_0xc5cf('0xb')]=![];this[_0xc5cf('0xc')]=null;this[_0xc5cf('0xd')]=0x1;this[_0xc5cf('0xe')]='';this[_0xc5cf('0xf')]='';this['connectedlinename']='';this[_0xc5cf('0x10')]='';this[_0xc5cf('0x11')]='';this[_0xc5cf('0x12')]='';this['priority']='';this[_0xc5cf('0x13')]=0x0;this[_0xc5cf('0x14')]=![];this[_0xc5cf('0x15')]='';this[_0xc5cf('0x16')]=_0xc5cf('0x17');this[_0xc5cf('0x18')]=0x0;this[_0xc5cf('0x19')]={};}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 245fa74..a670dc2 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 _0xf61e=['type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken'];(function(_0x393b6d,_0x110c42){var _0x493cac=function(_0x36dc60){while(--_0x36dc60){_0x393b6d['push'](_0x393b6d['shift']());}};_0x493cac(++_0x110c42);}(_0xf61e,0x191));var _0xef61=function(_0x1f99a9,_0x1cb2b1){_0x1f99a9=_0x1f99a9-0x0;var _0x315b2a=_0xf61e[_0x1f99a9];return _0x315b2a;};'use strict';function SalesforceAccount(_0x746928){this['id']=_0x746928['id']||0x0;this[_0xef61('0x0')]=_0x746928[_0xef61('0x0')]||'';this[_0xef61('0x1')]=_0x746928[_0xef61('0x1')]||'';this[_0xef61('0x2')]=_0x746928[_0xef61('0x2')]||'';this[_0xef61('0x3')]=_0x746928[_0xef61('0x3')]||'';this[_0xef61('0x4')]=_0x746928[_0xef61('0x4')]||'';this[_0xef61('0x5')]=_0x746928['clientSecret']||'';this[_0xef61('0x6')]=_0x746928[_0xef61('0x6')]||'';this['type']=_0x746928[_0xef61('0x7')]||_0xef61('0x8');this[_0xef61('0x9')]=_0x746928['serverUrl']||'';this['Configurations']=_0x746928[_0xef61('0xa')]||{};}module[_0xef61('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x1349=['remoteUri','password','clientId','clientSecret','securityToken','integrationTab','serverUrl','Configurations','name','username'];(function(_0x13cf40,_0x25edbb){var _0x254da2=function(_0x5abb83){while(--_0x5abb83){_0x13cf40['push'](_0x13cf40['shift']());}};_0x254da2(++_0x25edbb);}(_0x1349,0x1ac));var _0x9134=function(_0x2039ac,_0x3cd5ce){_0x2039ac=_0x2039ac-0x0;var _0x3ce494=_0x1349[_0x2039ac];return _0x3ce494;};'use strict';function SalesforceAccount(_0x35679e){this['id']=_0x35679e['id']||0x0;this[_0x9134('0x0')]=_0x35679e[_0x9134('0x0')]||'';this[_0x9134('0x1')]=_0x35679e[_0x9134('0x1')]||'';this[_0x9134('0x2')]=_0x35679e[_0x9134('0x2')]||'';this[_0x9134('0x3')]=_0x35679e[_0x9134('0x3')]||'';this['clientId']=_0x35679e[_0x9134('0x4')]||'';this['clientSecret']=_0x35679e[_0x9134('0x5')]||'';this[_0x9134('0x6')]=_0x35679e[_0x9134('0x6')]||'';this['type']=_0x35679e['type']||_0x9134('0x7');this['serverUrl']=_0x35679e[_0x9134('0x8')]||'';this[_0x9134('0x9')]=_0x35679e[_0x9134('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 764be6f..fbf33b4 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 _0x2e5d=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x3ab928,_0x2b990b){var _0xf47692=function(_0x311b8e){while(--_0x311b8e){_0x3ab928['push'](_0x3ab928['shift']());}};_0xf47692(++_0x2b990b);}(_0x2e5d,0x1b2));var _0xd2e5=function(_0x1e48d3,_0x5d8c43){_0x1e48d3=_0x1e48d3-0x0;var _0x2852b1=_0x2e5d[_0x1e48d3];return _0x2852b1;};'use strict';function ServicenowAccount(_0x57a6b5){this['id']=_0x57a6b5['id']||0x0;this[_0xd2e5('0x0')]=_0x57a6b5['name']||'';this[_0xd2e5('0x1')]=_0x57a6b5[_0xd2e5('0x1')]||'';this[_0xd2e5('0x2')]=_0x57a6b5['password']||'';this[_0xd2e5('0x3')]=_0x57a6b5[_0xd2e5('0x3')]||'';this['serverUrl']=_0x57a6b5[_0xd2e5('0x4')]||'';this[_0xd2e5('0x5')]=_0x57a6b5[_0xd2e5('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x1c9e=['name','password','remoteUri','serverUrl','Configurations'];(function(_0x1a638,_0x5b389c){var _0x5b585c=function(_0x586488){while(--_0x586488){_0x1a638['push'](_0x1a638['shift']());}};_0x5b585c(++_0x5b389c);}(_0x1c9e,0x9b));var _0xe1c9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1c9e[_0x2641f9];return _0x585741;};'use strict';function ServicenowAccount(_0xc9ecb0){this['id']=_0xc9ecb0['id']||0x0;this['name']=_0xc9ecb0[_0xe1c9('0x0')]||'';this['username']=_0xc9ecb0['username']||'';this[_0xe1c9('0x1')]=_0xc9ecb0[_0xe1c9('0x1')]||'';this[_0xe1c9('0x2')]=_0xc9ecb0[_0xe1c9('0x2')]||'';this['serverUrl']=_0xc9ecb0[_0xe1c9('0x3')]||'';this[_0xe1c9('0x4')]=_0xc9ecb0[_0xe1c9('0x4')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index e1799e7..86e4537 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 _0xc0f3=['serverUrl','Configurations','name','username','remoteUri'];(function(_0xe135a4,_0x547d5a){var _0x45d59b=function(_0x1ac48d){while(--_0x1ac48d){_0xe135a4['push'](_0xe135a4['shift']());}};_0x45d59b(++_0x547d5a);}(_0xc0f3,0x106));var _0x3c0f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc0f3[_0x14add3];return _0x4a174f;};'use strict';function SugarcrmAccount(_0x57cc15){this['id']=_0x57cc15['id']||0x0;this[_0x3c0f('0x0')]=_0x57cc15[_0x3c0f('0x0')]||'';this[_0x3c0f('0x1')]=_0x57cc15[_0x3c0f('0x1')]||'';this['password']=_0x57cc15['password']||'';this[_0x3c0f('0x2')]=_0x57cc15[_0x3c0f('0x2')]||'';this[_0x3c0f('0x3')]=_0x57cc15['serverUrl']||'';this[_0x3c0f('0x4')]=_0x57cc15['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0xe92e=['password','remoteUri','serverUrl','Configurations','name'];(function(_0x3070ba,_0x1ab6ec){var _0x12ed15=function(_0x562888){while(--_0x562888){_0x3070ba['push'](_0x3070ba['shift']());}};_0x12ed15(++_0x1ab6ec);}(_0xe92e,0xdb));var _0xee92=function(_0x4c32ff,_0x5492b5){_0x4c32ff=_0x4c32ff-0x0;var _0x42a975=_0xe92e[_0x4c32ff];return _0x42a975;};'use strict';function SugarcrmAccount(_0x5db35c){this['id']=_0x5db35c['id']||0x0;this[_0xee92('0x0')]=_0x5db35c[_0xee92('0x0')]||'';this['username']=_0x5db35c['username']||'';this[_0xee92('0x1')]=_0x5db35c['password']||'';this[_0xee92('0x2')]=_0x5db35c[_0xee92('0x2')]||'';this['serverUrl']=_0x5db35c[_0xee92('0x3')]||'';this['Configurations']=_0x5db35c[_0xee92('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index bd801fe..c595910 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 _0x237d=['unknown','stateTime','status','address','name','accountcode','state'];(function(_0x36aad0,_0x3d2e17){var _0x31e987=function(_0x2d0fe4){while(--_0x2d0fe4){_0x36aad0['push'](_0x36aad0['shift']());}};_0x31e987(++_0x3d2e17);}(_0x237d,0x1d9));var _0xd237=function(_0x2bc49c,_0x10c717){_0x2bc49c=_0x2bc49c-0x0;var _0x55f9d4=_0x237d[_0x2bc49c];return _0x55f9d4;};'use strict';function Telephone(_0x2414e1){this['id']=_0x2414e1['id']||0x0;this[_0xd237('0x0')]=_0x2414e1[_0xd237('0x0')]||'';this[_0xd237('0x1')]=_0x2414e1['accountcode']||'';this[_0xd237('0x2')]=_0xd237('0x3');this[_0xd237('0x4')]=0x0;this[_0xd237('0x5')]=_0xd237('0x3');this[_0xd237('0x6')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x6c38=['accountcode','unknown','address','name'];(function(_0x827b48,_0x366985){var _0x4bd5bc=function(_0x4c6973){while(--_0x4c6973){_0x827b48['push'](_0x827b48['shift']());}};_0x4bd5bc(++_0x366985);}(_0x6c38,0x8f));var _0x86c3=function(_0xaa8688,_0x210e26){_0xaa8688=_0xaa8688-0x0;var _0x321487=_0x6c38[_0xaa8688];return _0x321487;};'use strict';function Telephone(_0x41cdbd){this['id']=_0x41cdbd['id']||0x0;this[_0x86c3('0x0')]=_0x41cdbd[_0x86c3('0x0')]||'';this[_0x86c3('0x1')]=_0x41cdbd[_0x86c3('0x1')]||'';this['state']=_0x86c3('0x2');this['stateTime']=0x0;this['status']='unknown';this[_0x86c3('0x3')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index b3c013f..f6b0185 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 _0xb10b=['name','html'];(function(_0x4f2c85,_0x396382){var _0x288a48=function(_0xa9fed6){while(--_0xa9fed6){_0x4f2c85['push'](_0x4f2c85['shift']());}};_0x288a48(++_0x396382);}(_0xb10b,0x12a));var _0xbb10=function(_0x8be9fb,_0x2f90d9){_0x8be9fb=_0x8be9fb-0x0;var _0x3b41ac=_0xb10b[_0x8be9fb];return _0x3b41ac;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x112832,_0x513a32){var _0x20b720=function(_0x4be093){while(--_0x4be093){_0x112832['push'](_0x112832['shift']());}};_0x20b720(++_0x513a32);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 c8f4716..c634c81 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 _0xda3f=['Actions','name','status','AllConditions','AnyConditions'];(function(_0x399dc8,_0x38c21a){var _0x2cec7f=function(_0x592d26){while(--_0x592d26){_0x399dc8['push'](_0x399dc8['shift']());}};_0x2cec7f(++_0x38c21a);}(_0xda3f,0xec));var _0xfda3=function(_0x1d78b7,_0x4aabb7){_0x1d78b7=_0x1d78b7-0x0;var _0x2b48b2=_0xda3f[_0x1d78b7];return _0x2b48b2;};'use strict';function Trigger(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['channel']=_0x33f0ce['channel']||'voice';this[_0xfda3('0x1')]=_0x33f0ce['status']||![];this[_0xfda3('0x2')]=_0x33f0ce[_0xfda3('0x2')]||[];this['AnyConditions']=_0x33f0ce[_0xfda3('0x3')]||[];this[_0xfda3('0x4')]=_0x33f0ce['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x52a6e3,_0x4a73b4){var _0x8910d0=function(_0x57e5ef){while(--_0x57e5ef){_0x52a6e3['push'](_0x52a6e3['shift']());}};_0x8910d0(++_0x4a73b4);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 18deb44..9e06889 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 _0x255e=['stateRegistry','registrationtime','address','defaultuser','name','unknown','stateTime','registry','indexOf','split','host','domain','domainport','refresh'];(function(_0x1caf4f,_0xd0b32d){var _0x11b9e2=function(_0xabd605){while(--_0xabd605){_0x1caf4f['push'](_0x1caf4f['shift']());}};_0x11b9e2(++_0xd0b32d);}(_0x255e,0x90));var _0xe255=function(_0x14b398,_0x11e611){_0x14b398=_0x14b398-0x0;var _0x474407=_0x255e[_0x14b398];return _0x474407;};'use strict';function Trunk(_0xe4800c){this['id']=_0xe4800c['id']||0x0;this['active']=_0xe4800c['active']||![];this[_0xe255('0x0')]=_0xe4800c[_0xe255('0x0')]||'';this['state']=_0xe255('0x1');this[_0xe255('0x2')]=0x0;this['status']=_0xe255('0x1');this['registry']=_0xe4800c[_0xe255('0x3')]&&_0xe4800c[_0xe255('0x3')][_0xe255('0x4')](':')?_0xe4800c[_0xe255('0x3')][_0xe255('0x5')](':')[0x0]:'';this[_0xe255('0x6')]='';this['port']='';this[_0xe255('0x7')]='';this[_0xe255('0x8')]='';this[_0xe255('0x9')]='';this[_0xe255('0xa')]='unknown';this[_0xe255('0xb')]='';this[_0xe255('0xc')]='';this[_0xe255('0xd')]=_0xe4800c[_0xe255('0xd')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0xa3d2=['stateRegistry','registrationtime','defaultuser','exports','active','name','unknown','stateTime','status','registry','indexOf','host','port','domain','domainport'];(function(_0x536437,_0x1bfe0e){var _0x2ebd68=function(_0x399f66){while(--_0x399f66){_0x536437['push'](_0x536437['shift']());}};_0x2ebd68(++_0x1bfe0e);}(_0xa3d2,0x8b));var _0x2a3d=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0xa3d2[_0x215dc8];return _0x583ea3;};'use strict';function Trunk(_0x228f28){this['id']=_0x228f28['id']||0x0;this[_0x2a3d('0x0')]=_0x228f28['active']||![];this[_0x2a3d('0x1')]=_0x228f28[_0x2a3d('0x1')]||'';this['state']=_0x2a3d('0x2');this[_0x2a3d('0x3')]=0x0;this[_0x2a3d('0x4')]='unknown';this[_0x2a3d('0x5')]=_0x228f28[_0x2a3d('0x5')]&&_0x228f28[_0x2a3d('0x5')][_0x2a3d('0x6')](':')?_0x228f28['registry']['split'](':')[0x0]:'';this[_0x2a3d('0x7')]='';this[_0x2a3d('0x8')]='';this[_0x2a3d('0x9')]='';this[_0x2a3d('0xa')]='';this['refresh']='';this[_0x2a3d('0xb')]=_0x2a3d('0x2');this[_0x2a3d('0xc')]='';this['address']='';this[_0x2a3d('0xd')]=_0x228f28[_0x2a3d('0xd')]||'';}module[_0x2a3d('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 9918065..e5cc0fb 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 _0x8c37=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x70fd53,_0x2a95a6){var _0x4b71c5=function(_0x4b349d){while(--_0x4b349d){_0x70fd53['push'](_0x70fd53['shift']());}};_0x4b71c5(++_0x2a95a6);}(_0x8c37,0xd0));var _0x78c3=function(_0x448713,_0x48f9d7){_0x448713=_0x448713-0x0;var _0x1b6892=_0x8c37[_0x448713];return _0x1b6892;};'use strict';function voiceExtension(_0x3fbd11){this['id']=_0x3fbd11['id']||0x0;this[_0x78c3('0x0')]=_0x3fbd11['exten']||'';this['recordingFormat']=_0x3fbd11[_0x78c3('0x1')]||_0x78c3('0x2');this[_0x78c3('0x3')]=_0x3fbd11[_0x78c3('0x3')]||![];}module[_0x78c3('0x4')]=voiceExtension; \ No newline at end of file +var _0x22f9=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0x3c33c4,_0x3490ea){var _0x2c4b73=function(_0x30c053){while(--_0x30c053){_0x3c33c4['push'](_0x3c33c4['shift']());}};_0x2c4b73(++_0x3490ea);}(_0x22f9,0xf3));var _0x922f=function(_0x18bb31,_0x422c3d){_0x18bb31=_0x18bb31-0x0;var _0x4530b6=_0x22f9[_0x18bb31];return _0x4530b6;};'use strict';function voiceExtension(_0x3031d3){this['id']=_0x3031d3['id']||0x0;this[_0x922f('0x0')]=_0x3031d3[_0x922f('0x0')]||'';this[_0x922f('0x1')]=_0x3031d3['recordingFormat']||'none';this[_0x922f('0x2')]=_0x3031d3[_0x922f('0x2')]||![];}module[_0x922f('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 3ccfae7..11a2eb5 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 _0x503a=['tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','invalid','unavailable','ringing','onhold','wav','wav49','gsm','rrmemory','name','monitor_format','type','waiting','talking','total','sumDuration','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions'];(function(_0xc1ba52,_0x489cb5){var _0x3b92c0=function(_0x235d42){while(--_0x235d42){_0xc1ba52['push'](_0xc1ba52['shift']());}};_0x3b92c0(++_0x489cb5);}(_0x503a,0x1b4));var _0xa503=function(_0x1f1837,_0x4b304e){_0x1f1837=_0x1f1837-0x0;var _0x25ab57=_0x503a[_0x1f1837];return _0x25ab57;};'use strict';var statusDesc=['unknown',_0xa503('0x0'),_0xa503('0x1'),'busy',_0xa503('0x2'),_0xa503('0x3'),_0xa503('0x4'),'ringinuse',_0xa503('0x5')];var monitorFormat={'wav':_0xa503('0x6'),'wav49':_0xa503('0x7'),'gsm':_0xa503('0x8')};var strategy={'rrmemory':_0xa503('0x9'),'roundrobin':'roundrobin'};function VoiceQueue(_0x2417e6){this['id']=_0x2417e6['id']||0x0;this[_0xa503('0xa')]=_0x2417e6['name']||'';this[_0xa503('0xb')]=_0x2417e6[_0xa503('0xb')]||'';this[_0xa503('0xc')]=_0x2417e6[_0xa503('0xc')]||'inbound';this[_0xa503('0xd')]=0x0;this[_0xa503('0xe')]=0x0;this[_0xa503('0xf')]=0x0;this['answered']=0x0;this[_0xa503('0x10')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0xa503('0x11')]=0x0;this[_0xa503('0x12')]=0x0;this[_0xa503('0x13')]=0x0;this[_0xa503('0x14')]=0x0;this[_0xa503('0x15')]=_0x2417e6[_0xa503('0x15')]||![];this[_0xa503('0x16')]=_0x2417e6[_0xa503('0x16')]||0xa;this[_0xa503('0x17')]=_0x2417e6[_0xa503('0x17')]||'no';this['sendMessageOneNotActive']=!![];this[_0xa503('0x18')]='';this[_0xa503('0x19')]=0x0;this[_0xa503('0x1a')]=0x0;this[_0xa503('0x1b')]=_0x2417e6['dialTimezone']||null;this[_0xa503('0x1c')]=_0x2417e6['dialGlobalInterval']?_0x2417e6[_0xa503('0x1c')]:null;this[_0xa503('0x1d')]=_0x2417e6[_0xa503('0x1d')];this[_0xa503('0x1e')]=_0x2417e6[_0xa503('0x1e')]||_0xa503('0x1f');this[_0xa503('0x20')]=_0x2417e6[_0xa503('0x20')]||0x0;this[_0xa503('0x21')]=_0x2417e6[_0xa503('0x21')]||0x0;this['dialPowerLevel']=_0x2417e6[_0xa503('0x22')]||0x1;this[_0xa503('0x23')]=_0x2417e6[_0xa503('0x23')]||_0xa503('0x24');this[_0xa503('0x25')]=_0x2417e6['dialPredictiveOptimizationPercentage']||0.03;this[_0xa503('0x26')]=_0x2417e6['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x2417e6[_0xa503('0x27')]||_0xa503('0x28');this['dialOriginateCallerIdNumber']=_0x2417e6[_0xa503('0x29')]||_0xa503('0x28');this[_0xa503('0x2a')]=_0x2417e6[_0xa503('0x2a')]||0x1e;this[_0xa503('0x2b')]=_0x2417e6[_0xa503('0x2b')]||_0xa503('0x2c');this['dialQueueTimeout']=_0x2417e6[_0xa503('0x2d')]||0x3;this[_0xa503('0x2e')]=_0x2417e6[_0xa503('0x2e')]||undefined;this['dialCongestionMaxRetry']=_0x2417e6[_0xa503('0x2f')]||0x3;this[_0xa503('0x30')]=_0x2417e6[_0xa503('0x30')]||0x96;this[_0xa503('0x31')]=_0x2417e6[_0xa503('0x31')]||0x3;this[_0xa503('0x32')]=_0x2417e6[_0xa503('0x32')]||0x96;this[_0xa503('0x33')]=_0x2417e6[_0xa503('0x33')]||0x3;this[_0xa503('0x34')]=_0x2417e6[_0xa503('0x34')]||0x96;this[_0xa503('0x35')]=_0x2417e6[_0xa503('0x35')]||0x3;this[_0xa503('0x36')]=_0x2417e6[_0xa503('0x36')]||0x96;this['dialDropMaxRetry']=_0x2417e6[_0xa503('0x37')]||0x3;this[_0xa503('0x38')]=_0x2417e6['dialDropRetryFrequency']||0x96;this[_0xa503('0x39')]=_0x2417e6[_0xa503('0x39')]||0x3;this[_0xa503('0x3a')]=_0x2417e6[_0xa503('0x3a')]||0x96;this['dialMachineMaxRetry']=_0x2417e6[_0xa503('0x3b')]||0x3;this[_0xa503('0x3c')]=_0x2417e6[_0xa503('0x3c')]||0x96;this[_0xa503('0x3d')]=_0x2417e6[_0xa503('0x3d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x2417e6[_0xa503('0x3e')]||0x96;this[_0xa503('0x3f')]=_0x2417e6['dialGlobalMaxRetry']||0x4;this[_0xa503('0x40')]=_0x2417e6[_0xa503('0x40')]?_0x2417e6['Trunk']:undefined;this[_0xa503('0x41')]=_0x2417e6[_0xa503('0x41')]?_0x2417e6[_0xa503('0x41')]:undefined;this[_0xa503('0x42')]=_0x2417e6[_0xa503('0x42')]||undefined;this[_0xa503('0x43')]=_0x2417e6[_0xa503('0x43')]?_0x2417e6[_0xa503('0x43')]:undefined;this['dialOrderByScheduledAt']=_0x2417e6[_0xa503('0x44')]||'DESC';this[_0xa503('0x45')]=_0x2417e6[_0xa503('0x45')]||undefined;this[_0xa503('0x46')]=_0x2417e6['dialCutDigit']||undefined;this['strategy']=strategy[_0x2417e6[_0xa503('0x47')]]||_0xa503('0x9');this[_0xa503('0x48')]=!![];this['dialAMDActive']=_0x2417e6[_0xa503('0x49')]||![];this['dialAMDInitialSilence']=_0x2417e6[_0xa503('0x4a')];this[_0xa503('0x4b')]=_0x2417e6[_0xa503('0x4b')];this[_0xa503('0x4c')]=_0x2417e6[_0xa503('0x4c')];this['dialAMDTotalAnalysisTime']=_0x2417e6['dialAMDTotalAnalysisTime'];this[_0xa503('0x4d')]=_0x2417e6[_0xa503('0x4d')];this[_0xa503('0x4e')]=_0x2417e6[_0xa503('0x4e')];this[_0xa503('0x4f')]=_0x2417e6[_0xa503('0x4f')];this['dialAMDSilenceThreshold']=_0x2417e6[_0xa503('0x50')];this[_0xa503('0x51')]=_0x2417e6[_0xa503('0x51')];this[_0xa503('0x52')]=0x0;this[_0xa503('0x53')]=0x0;this['timeout']=_0x2417e6['timeout'];this[_0xa503('0x54')]=0x0;this[_0xa503('0x55')]=0x0;this[_0xa503('0x56')]=0x0;this[_0xa503('0x57')]=0x0;this[_0xa503('0x58')]=0x0;this[_0xa503('0x59')]=0x0;this[_0xa503('0x5a')]=0x0;this[_0xa503('0x5b')]=0x0;this[_0xa503('0x5c')]=0x0;this[_0xa503('0x5d')]=0x0;this[_0xa503('0x5e')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xa503('0x5f')]=0x0;this[_0xa503('0x60')]=0x0;this[_0xa503('0x61')]=undefined;this[_0xa503('0x62')]=undefined;this[_0xa503('0x63')]=undefined;this[_0xa503('0x64')]=1.05;this[_0xa503('0x65')]=0x0;this[_0xa503('0x66')]=0x0;this[_0xa503('0x67')]=0x0;this[_0xa503('0x68')]=0x0;this[_0xa503('0x69')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xa503('0x6a')]=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x2417e6[_0xa503('0x6b')]||0x14;this[_0xa503('0x6c')]=_0x2417e6[_0xa503('0x6b')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xa503('0x6d')]=0x0;this[_0xa503('0x6e')]=0x1;this['erlangCalls']=0x0;this[_0xa503('0x6f')]=0x0;this[_0xa503('0x70')]=0x0;this['erlangBusyFactor']=0x0;this[_0xa503('0x71')]=_0x2417e6[_0xa503('0x71')]||0x1e;this['dialRecallInQueue']=_0x2417e6['dialRecallInQueue']||![];this['dialQueueProject2']=_0x2417e6[_0xa503('0x72')]||undefined;this[_0xa503('0x73')]=_0x2417e6[_0xa503('0x73')]||![];this[_0xa503('0x74')]=_0x2417e6[_0xa503('0x74')]||![];this[_0xa503('0xb')]=monitorFormat[_0x2417e6[_0xa503('0xb')]]?monitorFormat[_0x2417e6[_0xa503('0xb')]]:undefined;this[_0xa503('0x75')]=_0x2417e6[_0xa503('0x75')]||![];this[_0xa503('0x76')]=_0x2417e6[_0xa503('0x76')]?_0x2417e6['mandatoryDispositionPause']:undefined;}module[_0xa503('0x77')]=VoiceQueue; \ No newline at end of file +var _0x8ce1=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','gsm','rrmemory','name','monitor_format','type','inbound','waiting','talking','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8ce1,0xc7));var _0x18ce=function(_0x3883c0,_0x3cb0f8){_0x3883c0=_0x3883c0-0x0;var _0x1a4e1a=_0x8ce1[_0x3883c0];return _0x1a4e1a;};'use strict';var statusDesc=[_0x18ce('0x0'),'not_inuse',_0x18ce('0x1'),_0x18ce('0x2'),_0x18ce('0x3'),_0x18ce('0x4'),_0x18ce('0x5'),_0x18ce('0x6'),_0x18ce('0x7')];var monitorFormat={'wav':_0x18ce('0x8'),'wav49':'wav49','gsm':_0x18ce('0x9')};var strategy={'rrmemory':_0x18ce('0xa'),'roundrobin':'roundrobin'};function VoiceQueue(_0x31f7c4){this['id']=_0x31f7c4['id']||0x0;this[_0x18ce('0xb')]=_0x31f7c4[_0x18ce('0xb')]||'';this[_0x18ce('0xc')]=_0x31f7c4[_0x18ce('0xc')]||'';this[_0x18ce('0xd')]=_0x31f7c4['type']||_0x18ce('0xe');this[_0x18ce('0xf')]=0x0;this[_0x18ce('0x10')]=0x0;this[_0x18ce('0x11')]=0x0;this[_0x18ce('0x12')]=0x0;this['sumDuration']=0x0;this[_0x18ce('0x13')]=0x0;this[_0x18ce('0x14')]=0x0;this[_0x18ce('0x15')]=0x0;this[_0x18ce('0x16')]=0x0;this[_0x18ce('0x17')]=0x0;this[_0x18ce('0x18')]=0x0;this[_0x18ce('0x19')]=_0x31f7c4[_0x18ce('0x19')]||![];this['acwTimeout']=_0x31f7c4[_0x18ce('0x1a')]||0xa;this[_0x18ce('0x1b')]=_0x31f7c4['autopause']||'no';this[_0x18ce('0x1c')]=!![];this[_0x18ce('0x1d')]='';this['originated']=0x0;this[_0x18ce('0x1e')]=0x0;this[_0x18ce('0x1f')]=_0x31f7c4['dialTimezone']||null;this['dialGlobalInterval']=_0x31f7c4['dialGlobalInterval']?_0x31f7c4[_0x18ce('0x20')]:null;this[_0x18ce('0x21')]=_0x31f7c4[_0x18ce('0x21')];this[_0x18ce('0x22')]=_0x31f7c4[_0x18ce('0x22')]||'progressive';this['dialLimitChannel']=_0x31f7c4[_0x18ce('0x23')]||0x0;this[_0x18ce('0x24')]=_0x31f7c4[_0x18ce('0x24')]||0x0;this[_0x18ce('0x25')]=_0x31f7c4[_0x18ce('0x25')]||0x1;this[_0x18ce('0x26')]=_0x31f7c4[_0x18ce('0x26')]||_0x18ce('0x27');this[_0x18ce('0x28')]=_0x31f7c4['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x31f7c4['dialPredictiveInterval']||0x258;this[_0x18ce('0x29')]=_0x31f7c4['dialOriginateCallerIdName']||'anonymous';this['dialOriginateCallerIdNumber']=_0x31f7c4[_0x18ce('0x2a')]||_0x18ce('0x2b');this['dialOriginateTimeout']=_0x31f7c4[_0x18ce('0x2c')]||0x1e;this[_0x18ce('0x2d')]=_0x31f7c4['dialQueueOptions']||_0x18ce('0x2e');this[_0x18ce('0x2f')]=_0x31f7c4['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x31f7c4[_0x18ce('0x30')]||undefined;this[_0x18ce('0x31')]=_0x31f7c4[_0x18ce('0x31')]||0x3;this[_0x18ce('0x32')]=_0x31f7c4['dialCongestionRetryFrequency']||0x96;this[_0x18ce('0x33')]=_0x31f7c4[_0x18ce('0x33')]||0x3;this[_0x18ce('0x34')]=_0x31f7c4[_0x18ce('0x34')]||0x96;this[_0x18ce('0x35')]=_0x31f7c4[_0x18ce('0x35')]||0x3;this['dialNoAnswerRetryFrequency']=_0x31f7c4[_0x18ce('0x36')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x31f7c4[_0x18ce('0x37')]||0x3;this[_0x18ce('0x38')]=_0x31f7c4['dialNoSuchNumberRetryFrequency']||0x96;this[_0x18ce('0x39')]=_0x31f7c4[_0x18ce('0x39')]||0x3;this[_0x18ce('0x3a')]=_0x31f7c4[_0x18ce('0x3a')]||0x96;this[_0x18ce('0x3b')]=_0x31f7c4[_0x18ce('0x3b')]||0x3;this['dialAbandonedRetryFrequency']=_0x31f7c4[_0x18ce('0x3c')]||0x96;this['dialMachineMaxRetry']=_0x31f7c4['dialMachineMaxRetry']||0x3;this[_0x18ce('0x3d')]=_0x31f7c4[_0x18ce('0x3d')]||0x96;this[_0x18ce('0x3e')]=_0x31f7c4[_0x18ce('0x3e')]||0x3;this[_0x18ce('0x3f')]=_0x31f7c4[_0x18ce('0x3f')]||0x96;this[_0x18ce('0x40')]=_0x31f7c4[_0x18ce('0x40')]||0x4;this[_0x18ce('0x41')]=_0x31f7c4[_0x18ce('0x41')]?_0x31f7c4[_0x18ce('0x41')]:undefined;this['TrunkBackup']=_0x31f7c4[_0x18ce('0x42')]?_0x31f7c4[_0x18ce('0x42')]:undefined;this[_0x18ce('0x43')]=_0x31f7c4[_0x18ce('0x43')]||undefined;this['Interval']=_0x31f7c4[_0x18ce('0x44')]?_0x31f7c4[_0x18ce('0x44')]:undefined;this[_0x18ce('0x45')]=_0x31f7c4['dialOrderByScheduledAt']||'DESC';this[_0x18ce('0x46')]=_0x31f7c4[_0x18ce('0x46')]||undefined;this[_0x18ce('0x47')]=_0x31f7c4[_0x18ce('0x47')]||undefined;this[_0x18ce('0x48')]=strategy[_0x31f7c4['strategy']]||_0x18ce('0xa');this[_0x18ce('0x49')]=!![];this[_0x18ce('0x4a')]=_0x31f7c4[_0x18ce('0x4a')]||![];this[_0x18ce('0x4b')]=_0x31f7c4[_0x18ce('0x4b')];this[_0x18ce('0x4c')]=_0x31f7c4[_0x18ce('0x4c')];this[_0x18ce('0x4d')]=_0x31f7c4[_0x18ce('0x4d')];this[_0x18ce('0x4e')]=_0x31f7c4[_0x18ce('0x4e')];this[_0x18ce('0x4f')]=_0x31f7c4[_0x18ce('0x4f')];this[_0x18ce('0x50')]=_0x31f7c4['dialAMDBetweenWordsSilence'];this[_0x18ce('0x51')]=_0x31f7c4[_0x18ce('0x51')];this['dialAMDSilenceThreshold']=_0x31f7c4[_0x18ce('0x52')];this['dialAMDMaximumWordLength']=_0x31f7c4[_0x18ce('0x53')];this[_0x18ce('0x54')]=0x0;this[_0x18ce('0x55')]=0x0;this[_0x18ce('0x56')]=_0x31f7c4[_0x18ce('0x56')];this[_0x18ce('0x57')]=0x0;this[_0x18ce('0x58')]=0x0;this[_0x18ce('0x59')]=0x0;this[_0x18ce('0x5a')]=0x0;this[_0x18ce('0x5b')]=0x0;this[_0x18ce('0x5c')]=0x0;this[_0x18ce('0x5d')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x18ce('0x5e')]=0x0;this[_0x18ce('0x5f')]=0x0;this[_0x18ce('0x60')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x18ce('0x61')]=0x0;this[_0x18ce('0x62')]=0x0;this[_0x18ce('0x63')]=undefined;this[_0x18ce('0x64')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x18ce('0x65')]=0x0;this[_0x18ce('0x66')]=0x0;this[_0x18ce('0x67')]=0x0;this[_0x18ce('0x68')]=0x0;this[_0x18ce('0x69')]=0x0;this[_0x18ce('0x6a')]=0x0;this[_0x18ce('0x6b')]=0x0;this[_0x18ce('0x6c')]=0x0;this['predictiveIntervalMaxThreshold']=_0x31f7c4['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x18ce('0x6d')]=_0x31f7c4[_0x18ce('0x6e')]||0xa;this[_0x18ce('0x6f')]=0x0;this[_0x18ce('0x70')]=0x0;this[_0x18ce('0x71')]=0x1;this[_0x18ce('0x72')]=0x0;this[_0x18ce('0x73')]=0x0;this[_0x18ce('0x74')]=0x0;this[_0x18ce('0x75')]=0x0;this['dialRecallMeTimeout']=_0x31f7c4[_0x18ce('0x76')]||0x1e;this['dialRecallInQueue']=_0x31f7c4[_0x18ce('0x77')]||![];this[_0x18ce('0x78')]=_0x31f7c4[_0x18ce('0x78')]||undefined;this[_0x18ce('0x79')]=_0x31f7c4[_0x18ce('0x79')]||![];this['dialAgiAfterHangupAgent']=_0x31f7c4[_0x18ce('0x7a')]||![];this[_0x18ce('0xc')]=monitorFormat[_0x31f7c4['monitor_format']]?monitorFormat[_0x31f7c4[_0x18ce('0xc')]]:undefined;this[_0x18ce('0x7b')]=_0x31f7c4[_0x18ce('0x7b')]||![];this[_0x18ce('0x7c')]=_0x31f7c4['mandatoryDispositionPause']?_0x31f7c4[_0x18ce('0x7c')]:undefined;}module[_0x18ce('0x7d')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 215609a..e4c4a35 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 _0x403f=['username','accessKey','remoteUri','serverUrl','Configurations','name'];(function(_0x3641bb,_0xb69b54){var _0x65651d=function(_0x45d2e9){while(--_0x45d2e9){_0x3641bb['push'](_0x3641bb['shift']());}};_0x65651d(++_0xb69b54);}(_0x403f,0x19d));var _0xf403=function(_0x80da31,_0x47b81a){_0x80da31=_0x80da31-0x0;var _0x9dc6b7=_0x403f[_0x80da31];return _0x9dc6b7;};'use strict';function VtigerAccount(_0x26e9f1){this['id']=_0x26e9f1['id']||0x0;this[_0xf403('0x0')]=_0x26e9f1[_0xf403('0x0')]||'';this[_0xf403('0x1')]=_0x26e9f1[_0xf403('0x1')]||'';this[_0xf403('0x2')]=_0x26e9f1[_0xf403('0x2')]||'';this[_0xf403('0x3')]=_0x26e9f1['remoteUri']||'';this[_0xf403('0x4')]=_0x26e9f1[_0xf403('0x4')]||'';this[_0xf403('0x5')]=_0x26e9f1['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0xf3d8=['username','accessKey','remoteUri','serverUrl','Configurations','name'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xf3d8,0xdd));var _0x8f3d=function(_0x492221,_0x9e2521){_0x492221=_0x492221-0x0;var _0x398bf9=_0xf3d8[_0x492221];return _0x398bf9;};'use strict';function VtigerAccount(_0x44850c){this['id']=_0x44850c['id']||0x0;this[_0x8f3d('0x0')]=_0x44850c[_0x8f3d('0x0')]||'';this[_0x8f3d('0x1')]=_0x44850c[_0x8f3d('0x1')]||'';this[_0x8f3d('0x2')]=_0x44850c[_0x8f3d('0x2')]||'';this[_0x8f3d('0x3')]=_0x44850c[_0x8f3d('0x3')]||'';this['serverUrl']=_0x44850c[_0x8f3d('0x4')]||'';this[_0x8f3d('0x5')]=_0x44850c['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 96fa343..7f81e98 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 _0x5533=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5533,0xd2));var _0x3553=function(_0x5f027a,_0x4095f2){_0x5f027a=_0x5f027a-0x0;var _0x198eb5=_0x5533[_0x5f027a];return _0x198eb5;};'use strict';function ZendeskAccount(_0x352720){this['id']=_0x352720['id']||0x0;this['name']=_0x352720[_0x3553('0x0')]||'';this[_0x3553('0x1')]=_0x352720[_0x3553('0x1')]||'';this[_0x3553('0x2')]=_0x352720['password']||'';this['token']=_0x352720[_0x3553('0x3')]||'';this['remoteUri']=_0x352720[_0x3553('0x4')]||'';this[_0x3553('0x5')]=_0x352720[_0x3553('0x5')]||'';this[_0x3553('0x6')]=_0x352720['type']||_0x3553('0x7');this[_0x3553('0x8')]=_0x352720[_0x3553('0x8')]||'';this[_0x3553('0x9')]=_0x352720[_0x3553('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x0d34=['username','password','token','remoteUri','authType','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x198d28,_0x324a54){var _0x1ffc63=function(_0x405b85){while(--_0x405b85){_0x198d28['push'](_0x198d28['shift']());}};_0x1ffc63(++_0x324a54);}(_0x0d34,0x167));var _0x40d3=function(_0x46f44e,_0x22ed75){_0x46f44e=_0x46f44e-0x0;var _0x5dd889=_0x0d34[_0x46f44e];return _0x5dd889;};'use strict';function ZendeskAccount(_0x3545e9){this['id']=_0x3545e9['id']||0x0;this[_0x40d3('0x0')]=_0x3545e9[_0x40d3('0x0')]||'';this[_0x40d3('0x1')]=_0x3545e9['username']||'';this[_0x40d3('0x2')]=_0x3545e9['password']||'';this['token']=_0x3545e9[_0x40d3('0x3')]||'';this[_0x40d3('0x4')]=_0x3545e9[_0x40d3('0x4')]||'';this[_0x40d3('0x5')]=_0x3545e9[_0x40d3('0x5')]||'';this['type']=_0x3545e9['type']||_0x40d3('0x6');this[_0x40d3('0x7')]=_0x3545e9['serverUrl']||'';this['Configurations']=_0x3545e9[_0x40d3('0x8')]||{};}module[_0x40d3('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index fad4cb4..47edd06 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 _0xcd5a=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone'];(function(_0x179ed3,_0x1c394d){var _0x2a8c24=function(_0x1d5fa5){while(--_0x1d5fa5){_0x179ed3['push'](_0x179ed3['shift']());}};_0x2a8c24(++_0x1c394d);}(_0xcd5a,0x1a9));var _0xacd5=function(_0x47d0d1,_0x470787){_0x47d0d1=_0x47d0d1-0x0;var _0x598c94=_0xcd5a[_0x47d0d1];return _0x598c94;};'use strict';function ZohoAccount(_0x1abc8f){this['id']=_0x1abc8f['id']||0x0;this[_0xacd5('0x0')]=_0x1abc8f[_0xacd5('0x0')]||'';this[_0xacd5('0x1')]=_0x1abc8f[_0xacd5('0x1')]||'';this['host']=_0x1abc8f[_0xacd5('0x2')]||'';this[_0xacd5('0x3')]=_0x1abc8f[_0xacd5('0x3')]||'';this[_0xacd5('0x4')]=_0x1abc8f[_0xacd5('0x4')]||'';this[_0xacd5('0x5')]=_0x1abc8f[_0xacd5('0x5')]||'';this[_0xacd5('0x6')]=_0x1abc8f['serverUrl']||'';this['code']=_0x1abc8f[_0xacd5('0x7')]||'';this[_0xacd5('0x8')]=_0x1abc8f[_0xacd5('0x8')]||'';this[_0xacd5('0x9')]=_0x1abc8f['Configurations']||{};}module[_0xacd5('0xa')]=ZohoAccount; \ No newline at end of file +var _0xdcb4=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name'];(function(_0x3b594b,_0x5835c3){var _0x1ea5f8=function(_0x191b3e){while(--_0x191b3e){_0x3b594b['push'](_0x3b594b['shift']());}};_0x1ea5f8(++_0x5835c3);}(_0xdcb4,0x133));var _0x4dcb=function(_0x2ed6b3,_0x407736){_0x2ed6b3=_0x2ed6b3-0x0;var _0x560aad=_0xdcb4[_0x2ed6b3];return _0x560aad;};'use strict';function ZohoAccount(_0xfef10d){this['id']=_0xfef10d['id']||0x0;this[_0x4dcb('0x0')]=_0xfef10d[_0x4dcb('0x0')]||'';this[_0x4dcb('0x1')]=_0xfef10d[_0x4dcb('0x1')]||'';this[_0x4dcb('0x2')]=_0xfef10d[_0x4dcb('0x2')]||'';this[_0x4dcb('0x3')]=_0xfef10d[_0x4dcb('0x3')]||'';this['clientId']=_0xfef10d[_0x4dcb('0x4')]||'';this[_0x4dcb('0x5')]=_0xfef10d['clientSecret']||'';this[_0x4dcb('0x6')]=_0xfef10d[_0x4dcb('0x6')]||'';this[_0x4dcb('0x7')]=_0xfef10d['code']||'';this[_0x4dcb('0x8')]=_0xfef10d[_0x4dcb('0x8')]||'';this['Configurations']=_0xfef10d[_0x4dcb('0x9')]||{};}module[_0x4dcb('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index b9f7d1c..1a060cb 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 _0x04d8=['callbackat','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','util','lodash','moment','isNil','string','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid'];(function(_0x213c2f,_0x394152){var _0x43a27f=function(_0x469ab0){while(--_0x469ab0){_0x213c2f['push'](_0x213c2f['shift']());}};_0x43a27f(++_0x394152);}(_0x04d8,0xea));var _0x804d=function(_0x38854e,_0x23cbc9){_0x38854e=_0x38854e-0x0;var _0x3f8415=_0x04d8[_0x38854e];return _0x3f8415;};'use strict';var util=require(_0x804d('0x0'));var _=require(_0x804d('0x1'));var moment=require(_0x804d('0x2'));function checkNameSurname(_0x30adde,_0x12602f,_0x9fc90d){var _0x14c6cf='';if(!_[_0x804d('0x3')](_0x12602f)&&_0x804d('0x4')===typeof _0x12602f){_0x14c6cf+=_0x12602f;}if(!_[_0x804d('0x3')](_0x9fc90d)&&_0x804d('0x4')===typeof _0x9fc90d){_0x14c6cf+='\x20'+_0x9fc90d;}if(_0x14c6cf!==''){return _0x14c6cf;}return _0x30adde;}function Action(_0x3a2b95,_0x5ef070,_0x48c618,_0x1a2f54,_0x24966b){this[_0x804d('0x5')]=_0x48c618||undefined;this[_0x804d('0x6')]=_0x3a2b95['id'];this['queue']=_0x5ef070[_0x804d('0x7')];this[_0x804d('0x8')]=_0x5ef070['type'];this[_0x804d('0x9')]=_0x804d('0xa');this[_0x804d('0xb')]=![];this[_0x804d('0xc')]=_[_0x804d('0x3')](_0x3a2b95[_0x804d('0xd')])?undefined:_0x3a2b95['Agent'][_0x804d('0x7')];this[_0x804d('0xe')]=this[_0x804d('0xc')]?util[_0x804d('0xf')](_0x804d('0x10'),this['membername']):_0x1a2f54||undefined;this[_0x804d('0x11')]=checkNameSurname(_0x3a2b95[_0x804d('0x12')]['phone'],_0x3a2b95[_0x804d('0x12')][_0x804d('0x13')],_0x3a2b95[_0x804d('0x12')][_0x804d('0x14')]);this[_0x804d('0x15')]=_0x3a2b95[_0x804d('0x15')]||![];this[_0x804d('0x16')]=_0x3a2b95[_0x804d('0x12')][_0x804d('0x17')];this[_0x804d('0x18')]=_0x3a2b95[_0x804d('0x18')];this[_0x804d('0x19')]=_0x3a2b95[_0x804d('0x19')]||0x0;this['countcongestionretry']=_0x3a2b95[_0x804d('0x1a')]||0x0;this[_0x804d('0x1b')]=_0x3a2b95['countnoanswerretry']||0x0;this[_0x804d('0x1c')]=(_0x3a2b95[_0x804d('0x19')]||0x0)+(_0x3a2b95[_0x804d('0x1a')]||0x0)+(_0x3a2b95[_0x804d('0x1b')]||0x0)+(_0x3a2b95[_0x804d('0x1d')]||0x0)+(_0x3a2b95[_0x804d('0x1e')]||0x0)+(_0x3a2b95[_0x804d('0x1f')]||0x0)+(_0x3a2b95[_0x804d('0x20')]||0x0)+(_0x3a2b95['countagentrejectretry']||0x0);this[_0x804d('0x1d')]=_0x3a2b95['countnosuchnumberretry']||0x0;this['countdropretry']=_0x3a2b95[_0x804d('0x1e')]||0x0;this['countabandonedretry']=_0x3a2b95[_0x804d('0x1f')]||0x0;this[_0x804d('0x20')]=_0x3a2b95[_0x804d('0x20')]||0x0;this[_0x804d('0x21')]=_0x3a2b95[_0x804d('0x21')]||0x0;this[_0x804d('0x22')]=_0x3a2b95[_0x804d('0x22')];this[_0x804d('0x23')]=_0x3a2b95[_0x804d('0x23')];this['callbackat']=_0x3a2b95[_0x804d('0x24')];this['recallme']=_0x3a2b95['recallme'];this['ContactId']=_0x3a2b95[_0x804d('0x25')];this[_0x804d('0x26')]=_0x3a2b95['ListId'];this['UserId']=_[_0x804d('0x3')](_0x3a2b95[_0x804d('0xd')])?_0x3a2b95['UserId']:_0x3a2b95['Agent']['id'];this[_0x804d('0x27')]=_0x3a2b95[_0x804d('0x27')];this[_0x804d('0x28')]='';this[_0x804d('0x29')]='';}Action[_0x804d('0x2a')]['getCaller']=function(){return util[_0x804d('0xf')](_0x804d('0x2b'),this[_0x804d('0x11')],this[_0x804d('0x2c')]);};module['exports']=Action; \ No newline at end of file +var _0x4d72=['VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','number','exports','lodash','moment','string','isNil','uniqueid','idContact','queue','name','type','dialAnswer','membername','Agent','SIP/%s','calleridname','Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4d72,0x12e));var _0x24d7=function(_0x9febdb,_0xde1b2){_0x9febdb=_0x9febdb-0x0;var _0x2603c1=_0x4d72[_0x9febdb];return _0x2603c1;};'use strict';var util=require('util');var _=require(_0x24d7('0x0'));var moment=require(_0x24d7('0x1'));function checkNameSurname(_0x4c204a,_0x408ab9,_0x493173){var _0x1aedcf='';if(!_['isNil'](_0x408ab9)&&_0x24d7('0x2')===typeof _0x408ab9){_0x1aedcf+=_0x408ab9;}if(!_[_0x24d7('0x3')](_0x493173)&&_0x24d7('0x2')===typeof _0x493173){_0x1aedcf+='\x20'+_0x493173;}if(_0x1aedcf!==''){return _0x1aedcf;}return _0x4c204a;}function Action(_0x419cec,_0x30c05b,_0xb44f94,_0x7816dc,_0xef6ca5){this[_0x24d7('0x4')]=_0xb44f94||undefined;this[_0x24d7('0x5')]=_0x419cec['id'];this[_0x24d7('0x6')]=_0x30c05b[_0x24d7('0x7')];this[_0x24d7('0x8')]=_0x30c05b[_0x24d7('0x8')];this['campaigntype']=_0x24d7('0x6');this[_0x24d7('0x9')]=![];this[_0x24d7('0xa')]=_[_0x24d7('0x3')](_0x419cec[_0x24d7('0xb')])?undefined:_0x419cec[_0x24d7('0xb')][_0x24d7('0x7')];this['channelAgent']=this[_0x24d7('0xa')]?util['format'](_0x24d7('0xc'),this[_0x24d7('0xa')]):_0x7816dc||undefined;this[_0x24d7('0xd')]=checkNameSurname(_0x419cec[_0x24d7('0xe')]['phone'],_0x419cec['Contact'][_0x24d7('0xf')],_0x419cec[_0x24d7('0xe')][_0x24d7('0x10')]);this[_0x24d7('0x11')]=_0x419cec['active']||![];this[_0x24d7('0x12')]=_0x419cec[_0x24d7('0xe')]['phone'];this[_0x24d7('0x13')]=_0x419cec[_0x24d7('0x13')];this[_0x24d7('0x14')]=_0x419cec[_0x24d7('0x14')]||0x0;this[_0x24d7('0x15')]=_0x419cec[_0x24d7('0x15')]||0x0;this[_0x24d7('0x16')]=_0x419cec[_0x24d7('0x16')]||0x0;this['countglobal']=(_0x419cec[_0x24d7('0x14')]||0x0)+(_0x419cec['countcongestionretry']||0x0)+(_0x419cec[_0x24d7('0x16')]||0x0)+(_0x419cec['countnosuchnumberretry']||0x0)+(_0x419cec[_0x24d7('0x17')]||0x0)+(_0x419cec[_0x24d7('0x18')]||0x0)+(_0x419cec[_0x24d7('0x19')]||0x0)+(_0x419cec['countagentrejectretry']||0x0);this[_0x24d7('0x1a')]=_0x419cec[_0x24d7('0x1a')]||0x0;this[_0x24d7('0x17')]=_0x419cec['countdropretry']||0x0;this[_0x24d7('0x18')]=_0x419cec[_0x24d7('0x18')]||0x0;this[_0x24d7('0x19')]=_0x419cec['countmachineretry']||0x0;this[_0x24d7('0x1b')]=_0x419cec[_0x24d7('0x1b')]||0x0;this['callback']=_0x419cec['callback'];this[_0x24d7('0x1c')]=_0x419cec[_0x24d7('0x1c')];this[_0x24d7('0x1d')]=_0x419cec[_0x24d7('0x1d')];this[_0x24d7('0x1e')]=_0x419cec['recallme'];this[_0x24d7('0x1f')]=_0x419cec[_0x24d7('0x1f')];this[_0x24d7('0x20')]=_0x419cec['ListId'];this[_0x24d7('0x21')]=_['isNil'](_0x419cec['Agent'])?_0x419cec[_0x24d7('0x21')]:_0x419cec[_0x24d7('0xb')]['id'];this['VoiceQueueId']=_0x419cec[_0x24d7('0x22')];this[_0x24d7('0x23')]='';this[_0x24d7('0x24')]='';}Action['prototype'][_0x24d7('0x25')]=function(){return util[_0x24d7('0x26')](_0x24d7('0x27'),this['calleridname'],this[_0x24d7('0x28')]);};module[_0x24d7('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index bb6eb3a..3e2ac8e 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 _0x337a=['logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','execRun','unlock','unlockContact','disableContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialCutDigit','trim','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:agentconnect','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','reason','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','inspect','syncAttendedTransfer','syncBlindTransfer','transfererlinkedid','exports','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','defaults','localhost','socket.io-emitter','redis','prototype','enqueue','tail','finally','voiceQueues','trunks','actions','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','loopCampaigns','campaignsPreview','emit','type','name','answered','pTalking','sumBillable','sumHoldTime','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','active','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_presence:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','hasOwnProperty','outbound','clearZombieChannels','setMessage','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','status','channel','catch','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','agents','length','getDiff','dialRecallMeTimeout','Agent','run','then','logger2','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','linkedid','ANSWER','answertime','[syncHangup][talking][increment]','\x20Queue','pTalking:\x20','acw','buildAcw','complete','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','uniqueid','outboundBusyCallsDay','countbusyretry','Busy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','dialBusyMaxRetry','dialBusyRetryFrequency','unlockAgent','custom:agentnoanswer','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','countcongestionretry','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x337a,0x67));var _0xa337=function(_0x51135b,_0x1337cb){_0x51135b=_0x51135b-0x0;var _0x5a9ce9=_0x337a[_0x51135b];return _0x5a9ce9;};'use strict';var util=require('util');var _=require(_0xa337('0x0'));var BPromise=require(_0xa337('0x1'));var uuid=require(_0xa337('0x2'));var moment=require(_0xa337('0x3'));var md5=require(_0xa337('0x4'));var Redis=require(_0xa337('0x5'));var config=require(_0xa337('0x6'));var logger=require(_0xa337('0x7'))(_0xa337('0x8'));var loggerAction=require('../../../config/logger')(_0xa337('0x9'));var ami=require(_0xa337('0xa'));var rpcDb=require(_0xa337('0xb'));var Action=require(_0xa337('0xc'));var ut=require(_0xa337('0xd'));config['redis']=_[_0xa337('0xe')](config['redis'],{'host':_0xa337('0xf'),'port':0x18eb});var io=require(_0xa337('0x10'))(new Redis(config[_0xa337('0x11')]));var Sequence=function(){};Sequence[_0xa337('0x12')][_0xa337('0x13')]=function(_0x2202cd){this[_0xa337('0x14')]=this[_0xa337('0x14')]?this[_0xa337('0x14')][_0xa337('0x15')](_0x2202cd):_0x2202cd();};function Preview(_0x459072){this['sequence']=new Sequence();this['campaignsPreview']=_0x459072[_0xa337('0x16')];this[_0xa337('0x17')]=_0x459072[_0xa337('0x17')];this[_0xa337('0x18')]={};this['agents']=_0x459072['agents'];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this['syncOriginateResponse'][_0xa337('0x19')](this));ami['on']('hangup',this[_0xa337('0x1a')][_0xa337('0x19')](this));ami['on'](_0xa337('0x1b'),this[_0xa337('0x1c')][_0xa337('0x19')](this));ami['on'](_0xa337('0x1d'),this[_0xa337('0x1e')]['bind'](this));ami['on'](_0xa337('0x1f'),this[_0xa337('0x20')][_0xa337('0x19')](this));ami['on'](_0xa337('0x21'),this[_0xa337('0x22')][_0xa337('0x19')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xa337('0x19')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));this[_0xa337('0x23')](this[_0xa337('0x24')]);}function emit(_0x4d4eed,_0x19424f,_0x4928ee){io['to'](_0x4d4eed)[_0xa337('0x25')](_0x19424f,_0x4928ee);}function emitCampaignPreview(_0x3a8cbf){if(_0x3a8cbf[_0xa337('0x26')]==='outbound'){var _0x26db7c={'id':_0x3a8cbf['id'],'name':_0x3a8cbf[_0xa337('0x27')],'strategy':_0x3a8cbf['strategy'],'answered':_0x3a8cbf[_0xa337('0x28')],'available':_0x3a8cbf['available'],'loggedIn':_0x3a8cbf['loggedIn'],'pTalking':_0x3a8cbf[_0xa337('0x29')],'sumBillable':_0x3a8cbf[_0xa337('0x2a')],'sumDuration':_0x3a8cbf['sumDuration'],'sumHoldTime':_0x3a8cbf[_0xa337('0x2b')]||0x0,'talking':_0x3a8cbf['talking'],'total':_0x3a8cbf[_0xa337('0x2c')],'type':_0x3a8cbf[_0xa337('0x26')],'unmanaged':_0x3a8cbf[_0xa337('0x2d')],'abandoned':_0x3a8cbf[_0xa337('0x2e')],'waiting':_0x3a8cbf[_0xa337('0x2f')],'loggedInDb':_0x3a8cbf['loggedInDb'],'dialActive':_0x3a8cbf[_0xa337('0x30')],'dialMethod':_0x3a8cbf[_0xa337('0x31')],'dialOriginateCallerIdName':_0x3a8cbf[_0xa337('0x32')],'dialOriginateCallerIdNumber':_0x3a8cbf['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3a8cbf[_0xa337('0x33')],'dialPrefix':_0x3a8cbf[_0xa337('0x34')],'outboundAnswerAgiCallsDay':_0x3a8cbf[_0xa337('0x35')],'outboundAnswerCallsDay':_0x3a8cbf[_0xa337('0x36')],'outboundBlacklistCallsDay':_0x3a8cbf[_0xa337('0x37')],'outboundBusyCallsDay':_0x3a8cbf['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x3a8cbf[_0xa337('0x38')],'outboundDropCallsDayACS':_0x3a8cbf[_0xa337('0x39')],'outboundDropCallsDayCallersExit':_0x3a8cbf[_0xa337('0x3a')],'outboundDropCallsDayTimeout':_0x3a8cbf[_0xa337('0x3b')],'outboundNoAnswerCallsDay':_0x3a8cbf[_0xa337('0x3c')],'outboundNoSuchCallsDay':_0x3a8cbf[_0xa337('0x3d')],'outboundOriginateFailureCallsDay':_0x3a8cbf[_0xa337('0x3e')],'outboundReCallsDay':_0x3a8cbf[_0xa337('0x3f')],'outboundRejectCallsDay':_0x3a8cbf['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x3a8cbf[_0xa337('0x40')],'outboundAbandonedCallsDay':_0x3a8cbf[_0xa337('0x41')],'predictiveIntervalAnsweredCalls':_0x3a8cbf[_0xa337('0x42')],'predictiveIntervalAvgHoldtime':_0x3a8cbf['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3a8cbf['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3a8cbf['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x3a8cbf[_0xa337('0x43')],'predictiveIntervalErlangCalls':_0x3a8cbf[_0xa337('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0x3a8cbf[_0xa337('0x45')],'predictiveIntervalHitRate':_0x3a8cbf[_0xa337('0x46')],'predictiveIntervalMultiplicativeFactor':_0x3a8cbf['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3a8cbf[_0xa337('0x47')],'predictiveIntervalAvailable':_0x3a8cbf[_0xa337('0x48')],'predictiveIntervalTotalCalls':_0x3a8cbf['predictiveIntervalTotalCalls'],'message':_0x3a8cbf[_0xa337('0x49')],'originated':_0x3a8cbf[_0xa337('0x4a')],'erlangCalls':_0x3a8cbf['erlangCalls'],'erlangCallToSecond':_0x3a8cbf[_0xa337('0x4b')],'erlangAbandonmentRate':_0x3a8cbf['erlangAbandonmentRate'],'erlangBusyFactor':_0x3a8cbf[_0xa337('0x4c')],'startPredictive':_0x3a8cbf[_0xa337('0x4d')],'startProgressive':_0x3a8cbf['startProgressive']};if(_0x3a8cbf[_0xa337('0x4e')]){_0x26db7c[_0xa337('0x4e')]={'id':_0x3a8cbf[_0xa337('0x4e')]['id'],'name':_0x3a8cbf[_0xa337('0x4e')][_0xa337('0x27')],'active':_0x3a8cbf[_0xa337('0x4e')][_0xa337('0x4f')],'callerid':_0x3a8cbf['Trunk']['callerid']};}if(_0x3a8cbf[_0xa337('0x50')]){_0x26db7c[_0xa337('0x50')]={'id':_0x3a8cbf[_0xa337('0x50')]['id'],'name':_0x3a8cbf[_0xa337('0x50')][_0xa337('0x27')]};}var _0x3c0217=md5(JSON[_0xa337('0x51')](_0x26db7c));if(_0x3a8cbf['md5']!==_0x3c0217){_0x3a8cbf[_0xa337('0x4')]=_0x3c0217;emit(util[_0xa337('0x52')](_0xa337('0x53'),_0x26db7c['name']),_0xa337('0x54'),_0x26db7c);}}}function emitVoiceQueueChannelRemove(_0x5f0fda){logger[_0xa337('0x55')](_0xa337('0x56'),JSON[_0xa337('0x51')](_0x5f0fda));emit(util[_0xa337('0x52')](_0xa337('0x53'),_0x5f0fda['name']),'voice_queue_channel:remove',_0x5f0fda);io[_0xa337('0x25')](_0xa337('0x57'),_0x5f0fda);}function notSendMessagesQueue(_0x241c36){if(_0x241c36[_0xa337('0x58')]){if(_0x241c36[_0xa337('0x4a')]===0x0&&_0x241c36[_0xa337('0x29')]===0x0){_0x241c36[_0xa337('0x58')]=![];_0x241c36[_0xa337('0x59')]=0x0;_0x241c36[_0xa337('0x5a')]=0x0;_0x241c36[_0xa337('0x49')]=_0xa337('0x5b');ut['logger'](_0xa337('0x5c'),_0x241c36['name']+_0xa337('0x5d'));}else{_0x241c36[_0xa337('0x49')]=_0xa337('0x5e');ut[_0xa337('0x5f')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x241c36[_0xa337('0x27')]+_0xa337('0x60'));}emitCampaignPreview(_0x241c36);}}Preview[_0xa337('0x12')][_0xa337('0x23')]=function(){var _0x277beb=this;setInterval(function(){_0x277beb[_0xa337('0x61')]();},0x7cf);};Preview[_0xa337('0x12')]['syncCampaigns']=function(){var _0xab074d=this['campaignsPreview'];this[_0xa337('0x62')]+=0x1;for(var _0x8289f0 in _0xab074d){if(_0xab074d[_0xa337('0x63')](_0x8289f0)&&(_0xab074d[_0x8289f0][_0xa337('0x31')]===_0xa337('0x8')||_0xab074d[_0x8289f0][_0xa337('0x31')]==='booked')&&_0xab074d[_0x8289f0][_0xa337('0x26')]===_0xa337('0x64')){if(this[_0xa337('0x62')]>0x7){this[_0xa337('0x62')]=0x0;this[_0xa337('0x65')]();}}if(_0xab074d['hasOwnProperty'](_0x8289f0)&&_0xab074d[_0x8289f0][_0xa337('0x31')]===_0xa337('0x8')&&_0xab074d[_0x8289f0]['type']===_0xa337('0x64')){if(_0xab074d[_0x8289f0][_0xa337('0x30')]){this[_0xa337('0x66')](_0xab074d[_0x8289f0]);this['recallMe'](_0xab074d[_0x8289f0]);}else{notSendMessagesQueue(_0xab074d[_0x8289f0]);}}}};Preview[_0xa337('0x12')]['clearZombieChannel']=function(_0x46885a){var _0x44f78e=this;this['sequence']['enqueue'](function(){if(!_[_0xa337('0x67')](_0x44f78e['actions'][_0x46885a])){loggerAction[_0xa337('0x55')](_0xa337('0x68'),_0x46885a,_0xa337('0x69'),_0x44f78e[_0xa337('0x18')][_0x46885a][_0xa337('0x6a')],_0xa337('0x6b'),JSON['stringify'](_0x44f78e[_0xa337('0x24')][_0x44f78e['actions'][_0x46885a][_0xa337('0x6a')]][_0xa337('0x4a')]),'pTalking:\x20',JSON[_0xa337('0x51')](_0x44f78e[_0xa337('0x24')][_0x44f78e['actions'][_0x46885a]['queue']][_0xa337('0x29')]),JSON[_0xa337('0x51')](_0x44f78e[_0xa337('0x18')][_0x46885a][_0xa337('0x6c')]),JSON[_0xa337('0x51')](_[_0xa337('0x6d')](_0x44f78e[_0xa337('0x18')][_0x46885a],[_0xa337('0x6e'),_0xa337('0x6f'),'VoiceQueueId',_0xa337('0x70')])));return ami[_0xa337('0x71')]({'action':_0xa337('0x72'),'channel':_0x44f78e['actions'][_0x46885a][_0xa337('0x73')]})[_0xa337('0x74')](function(_0x13b5c3){if(_0x13b5c3[_0xa337('0x49')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x44f78e[_0xa337('0x18')][_0x46885a]){ut['updateOriginated'](_0x44f78e['campaignsPreview'][_0x44f78e['actions'][_0x46885a][_0xa337('0x6a')]],_0xa337('0x75'));if(_0x44f78e[_0xa337('0x18')][_0x46885a][_0xa337('0x6c')]===!![]){ut[_0xa337('0x76')](_0x44f78e[_0xa337('0x24')][_0x44f78e[_0xa337('0x18')][_0x46885a][_0xa337('0x6a')]],_0xa337('0x75'));ut[_0xa337('0x77')](_0xa337('0x78')+_0x46885a,_0x44f78e[_0xa337('0x18')][_0x46885a][_0xa337('0x6a')]);}ut[_0xa337('0x77')](_0xa337('0x79')+_0x46885a,_0x44f78e[_0xa337('0x18')][_0x46885a][_0xa337('0x6a')]);delete _0x44f78e[_0xa337('0x18')][_0x46885a];}},0x2328);}});}});};Preview[_0xa337('0x12')][_0xa337('0x65')]=function(){var _0x4faf7a=this;loggerAction[_0xa337('0x55')](_0xa337('0x7a'),_[_0xa337('0x7b')](this[_0xa337('0x18')]));for(var _0x5d8e20 in this[_0xa337('0x18')]){if(_0x4faf7a['actions'][_0xa337('0x63')](_0x5d8e20)){_0x4faf7a['clearZombieChannel'](_0x5d8e20);}}};Preview[_0xa337('0x12')]['recallMe']=function(_0x37c15b){var _0x2a4a22=this;rpcDb[_0xa337('0x7c')](_0x37c15b['id'],ut[_0xa337('0x7d')](this[_0xa337('0x7e')]))['then'](function(_0x3ec0ea){if(!_[_0xa337('0x67')](_0x3ec0ea)){for(var _0x4966d4=0x0;_0x4966d4<_0x3ec0ea[_0xa337('0x7f')];_0x4966d4+=0x1){if(ut[_0xa337('0x80')](_0x3ec0ea[_0x4966d4]['scheduledat'])<_0x37c15b[_0xa337('0x81')]*0x3c){if(_0x3ec0ea[_0x4966d4][_0xa337('0x82')]&&!_0x3ec0ea[_0x4966d4]['Agent']['voicePause']){_0x2a4a22[_0xa337('0x83')](_0x3ec0ea[_0x4966d4]['id'])[_0xa337('0x84')](ut[_0xa337('0x85')]('[RecallMe]'))[_0xa337('0x74')](ut[_0xa337('0x85')]('[RecallMe]'));}else{rpcDb['disableContact'](_0x3ec0ea[_0x4966d4]['id']);}}else{var _0x598d0d=new Action(_0x3ec0ea[_0x4966d4],_0x37c15b);_0x598d0d[_0xa337('0x86')]=moment()[_0xa337('0x52')](_0xa337('0x87'));_0x37c15b[_0xa337('0x3f')]+=0x1;ut[_0xa337('0x88')](_0x598d0d,0x17,_0xa337('0x89'));if(_0x37c15b[_0xa337('0x8a')]){rpcDb['rescheduleContactInQueue'](ut[_0xa337('0x8b')](_0x3ec0ea[_0x4966d4]));rpcDb[_0xa337('0x8c')](_0x598d0d,_0xa337('0x8d'));}else{ut[_0xa337('0x88')](_0x598d0d,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x598d0d,'[HistoryRecallClose]');rpcDb[_0xa337('0x8e')](_0x598d0d,_0xa337('0x8f'));}}}}})['catch'](ut[_0xa337('0x85')](_0xa337('0x90')));};Preview[_0xa337('0x12')][_0xa337('0x66')]=function(_0x324203){_0x324203[_0xa337('0x58')]=!![];if(ut[_0xa337('0x91')](_0x324203[_0xa337('0x92')])){_0x324203[_0xa337('0x49')]=_0xa337('0x93');}else if(!ut[_0xa337('0x94')](_0x324203[_0xa337('0x30')])){_0x324203['message']='NOT_ACTIVE';}else if(!this[_0xa337('0x95')](_0x324203['Trunk'])){if(!this[_0xa337('0x95')](_0x324203[_0xa337('0x96')])){_0x324203['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x324203['message']=_0xa337('0x97');}}else{_0x324203[_0xa337('0x49')]='ACTIVE';}emitCampaignPreview(_0x324203);};Preview[_0xa337('0x12')][_0xa337('0x98')]=function(_0x273424,_0x3df4c9,_0xb2c336){var _0x9fad8=this;var _0x43be18=this['actions'][_0x3df4c9];var _0x47d167=this['campaignsPreview'][_0x43be18[_0xa337('0x6a')]];var _0x37b516;if(_0x47d167){switch(_0xb2c336){case'1':_0x47d167['outboundNoSuchCallsDay']+=0x1;_0x43be18['countnosuchnumberretry']+=0x1;_0x43be18['countglobal']=ut[_0xa337('0x99')](_0x43be18);ut['logCustomer'](_0x43be18,0x0,_0xa337('0x9a'));ami[_0xa337('0x25')](_0xa337('0x9b'),ut[_0xa337('0x9c')](_0x43be18,'nosuchnumber'));rpcDb[_0xa337('0x8c')](_0x43be18,_0xa337('0x9d'));if(ut[_0xa337('0x99')](_0x43be18)>=_0x47d167[_0xa337('0x9e')]){_0x37b516=ut['cloneAction'](_0x43be18,0xf,_0xa337('0x9f'));rpcDb[_0xa337('0x8e')](_0x37b516,_0xa337('0xa0'));}else{if(_0x43be18[_0xa337('0xa1')]>=_0x47d167[_0xa337('0xa2')]){rpcDb['createCustomerFinal'](_0x43be18,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xa337('0xa3')](ut[_0xa337('0xa4')](_0x43be18,_0xa337('0xa1'),_0x47d167[_0xa337('0xa5')]),_0x43be18['unlockAgent'],_0x43be18[_0xa337('0xa6')]);}}delete this[_0xa337('0x18')][_0x273424[_0xa337('0xa7')]];break;case _0xa337('0xa8'):var _0x1cc60b=moment()['format'](_0xa337('0x87'));_0x43be18['responsetime']=_0x1cc60b;_0x43be18[_0xa337('0xa9')]=_0x1cc60b;_0x43be18[_0xa337('0x6c')]=!![];_0x47d167[_0xa337('0x29')]+=0x1;logger[_0xa337('0x55')](_0xa337('0xaa'),_0x43be18['uniqueid'],_0xa337('0xab'),_0x47d167[_0xa337('0x27')],_0xa337('0xac'),_0x47d167[_0xa337('0x29')]);ami[_0xa337('0x25')]('custom:agentconnect',ut[_0xa337('0x9c')](_0x43be18,'connect',this['campaignsPreview'][_0x43be18[_0xa337('0x6a')]]));if(_0x47d167[_0xa337('0xad')]){ami[_0xa337('0x25')]('custom:agentConnectPreview',ut[_0xa337('0xae')](_0x43be18));}break;case'16':ami[_0xa337('0x25')]('custom:agentcomplete',ut['buildObj'](_0x43be18,_0xa337('0xaf'),this[_0xa337('0x24')][_0x43be18[_0xa337('0x6a')]]));emitVoiceQueueChannelRemove(ut[_0xa337('0x9c')](_0x43be18,_0xa337('0xaf')));_0x47d167[_0xa337('0x36')]+=0x1;_0x47d167[_0xa337('0x2c')]+=0x1;_0x47d167[_0xa337('0x28')]+=0x1;ut[_0xa337('0x76')](_0x47d167,_0xa337('0xb0'));_0x43be18[_0xa337('0xb1')]=ut[_0xa337('0x99')](_0x43be18);ut['logCustomer'](_0x43be18,0x4,_0xa337('0xb2'));rpcDb[_0xa337('0x8c')](_0x43be18,_0xa337('0xb3'));rpcDb[_0xa337('0x8e')](_0x43be18,_0xa337('0xb4'));rpcDb[_0xa337('0xb5')](_0x43be18);_0x47d167[_0xa337('0xb6')]+=_0x43be18['talktime'];_0x47d167[_0xa337('0x2a')]+=_0x43be18[_0xa337('0xb7')];logger['info']('[syncHangup][talking][decrement]',_0x43be18[_0xa337('0xb8')],'\x20Queue',_0x47d167[_0xa337('0x27')],_0xa337('0xac'),_0x47d167['pTalking']);delete this[_0xa337('0x18')][_0x273424[_0xa337('0xa7')]];break;case'BUSY':_0x47d167[_0xa337('0xb9')]+=0x1;_0x43be18[_0xa337('0xba')]+=0x1;_0x43be18['countglobal']=ut[_0xa337('0x99')](_0x43be18);ut['logCustomer'](_0x43be18,0x5,_0xa337('0xbb'));ami[_0xa337('0x25')]('custom:agentbusy',ut[_0xa337('0x9c')](_0x43be18,_0xa337('0xbc')));rpcDb[_0xa337('0x8c')](_0x43be18,_0xa337('0xbd'));if(ut[_0xa337('0x99')](_0x43be18)>=_0x47d167[_0xa337('0x9e')]){_0x37b516=ut[_0xa337('0xbe')](_0x43be18,0xf,_0xa337('0x9f'));rpcDb[_0xa337('0x8e')](_0x37b516,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x43be18[_0xa337('0xba')]>=_0x47d167[_0xa337('0xbf')]){rpcDb[_0xa337('0x8e')](_0x43be18,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb['rescheduleContact'](ut[_0xa337('0xa4')](_0x43be18,'countbusyretry',_0x47d167[_0xa337('0xc0')]),_0x43be18[_0xa337('0xc1')],_0x43be18[_0xa337('0xa6')]);}}break;case'NOANSWER':_0x47d167[_0xa337('0x3c')]+=0x1;_0x43be18['countnoanswerretry']+=0x1;_0x43be18[_0xa337('0xb1')]=ut[_0xa337('0x99')](_0x43be18);ut[_0xa337('0x88')](_0x43be18,0x3,'NoAnswer');ami['emit'](_0xa337('0xc2'),ut[_0xa337('0x9c')](_0x43be18,'noanswer'));rpcDb['createCustomerHistory'](_0x43be18,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0xa337('0x99')](_0x43be18)>=_0x47d167[_0xa337('0x9e')]){_0x37b516=ut['cloneAction'](_0x43be18,0xf,_0xa337('0x9f'));rpcDb[_0xa337('0x8e')](_0x37b516,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x43be18[_0xa337('0xc3')]>=_0x47d167[_0xa337('0xc4')]){rpcDb[_0xa337('0x8e')](_0x43be18,_0xa337('0xc5'));}else{rpcDb[_0xa337('0xa3')](ut[_0xa337('0xa4')](_0x43be18,_0xa337('0xc3'),_0x47d167['dialNoAnswerRetryFrequency']),_0x43be18[_0xa337('0xc1')],_0x43be18[_0xa337('0xa6')]);}}break;case _0xa337('0xc6'):_0x47d167[_0xa337('0x38')]+=0x1;_0x43be18[_0xa337('0xc7')]+=0x1;_0x43be18[_0xa337('0xb1')]=ut[_0xa337('0x99')](_0x43be18);ut[_0xa337('0x88')](_0x43be18,0x8,'Congestion');ami['emit'](_0xa337('0xc8'),ut[_0xa337('0x9c')](_0x43be18,'congestion'));rpcDb[_0xa337('0x8c')](_0x43be18,_0xa337('0xc9'));if(ut[_0xa337('0x99')](_0x43be18)>=_0x47d167['dialGlobalMaxRetry']){_0x37b516=ut[_0xa337('0xbe')](_0x43be18,0xf,_0xa337('0x9f'));rpcDb[_0xa337('0x8e')](_0x37b516,_0xa337('0xca'));}else{if(_0x43be18['countcongestionretry']>=_0x47d167['dialCongestionMaxRetry']){rpcDb[_0xa337('0x8e')](_0x43be18,_0xa337('0xc9'));}else{rpcDb['rescheduleContact'](ut[_0xa337('0xa4')](_0x43be18,_0xa337('0xc7'),_0x47d167[_0xa337('0xc0')]),_0x43be18[_0xa337('0xc1')],_0x43be18['activeContact']);}}break;case'CANCEL':_0x47d167[_0xa337('0xcb')]+=0x1;_0x43be18[_0xa337('0xcc')]+=0x1;_0x43be18[_0xa337('0xb1')]=ut['totalGlobal'](_0x43be18);ut['logCustomer'](_0x43be18,0x14,_0xa337('0xcd'));ami[_0xa337('0x25')](_0xa337('0xce'),ut[_0xa337('0x9c')](_0x43be18,_0xa337('0xcf')));rpcDb[_0xa337('0x8c')](_0x43be18,_0xa337('0xd0'));if(ut[_0xa337('0x99')](_0x43be18)>=_0x47d167[_0xa337('0x9e')]){_0x37b516=ut[_0xa337('0xbe')](_0x43be18,0x14,_0xa337('0xcd'));rpcDb['createCustomerFinal'](_0x37b516,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x43be18[_0xa337('0xcc')]>=_0x47d167['dialAgentRejectMaxRetry']){rpcDb[_0xa337('0x8e')](_0x43be18,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0xa337('0xa4')](_0x43be18,_0xa337('0xcc'),_0x47d167['dialAgentRejectRetryFrequency']),_0x43be18[_0xa337('0xc1')],_0x43be18[_0xa337('0xa6')]);}}break;case _0xa337('0xd1'):_0x47d167[_0xa337('0x41')]+=0x1;_0x43be18['countabandonedretry']+=0x1;_0x43be18[_0xa337('0xb1')]=ut[_0xa337('0x99')](_0x43be18);ut[_0xa337('0x88')](_0x43be18,0xb,_0xa337('0xd2'));rpcDb[_0xa337('0x8c')](_0x43be18,_0xa337('0xd3'));if(ut[_0xa337('0x99')](_0x43be18)>=_0x47d167[_0xa337('0x9e')]){_0x37b516=ut[_0xa337('0xbe')](_0x43be18,0xf,'Global');rpcDb[_0xa337('0x8e')](_0x37b516,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x43be18[_0xa337('0xd4')]>=_0x47d167[_0xa337('0xd5')]){rpcDb['createCustomerFinal'](_0x43be18,_0xa337('0xd3'));}else{rpcDb[_0xa337('0xa3')](ut['scheduledAt'](_0x43be18,_0xa337('0xd6'),_0x47d167[_0xa337('0xd7')]),_0x43be18[_0xa337('0xc1')],_0x43be18[_0xa337('0xa6')]);}}break;case'18':_0x47d167[_0xa337('0x40')]+=0x1;_0x43be18[_0xa337('0xd8')]+=0x1;_0x43be18[_0xa337('0xb1')]=ut[_0xa337('0x99')](_0x43be18);ut[_0xa337('0x88')](_0x43be18,0x12,_0x273424['cause-txt']||_0x273424[_0xa337('0xd9')]);ami[_0xa337('0x25')](_0xa337('0xda'),ut[_0xa337('0x9c')](_0x43be18,'amd'));rpcDb[_0xa337('0x8c')](_0x43be18,_0xa337('0xdb'));if(ut[_0xa337('0x99')](_0x43be18)>=_0x47d167[_0xa337('0x9e')]){_0x37b516=ut[_0xa337('0xbe')](_0x43be18,0xf,'Global');rpcDb[_0xa337('0x8e')](_0x37b516,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xa337('0x8e')](_0x43be18,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0xa337('0x18')][_0x273424[_0xa337('0xa7')]];break;case'19':_0x47d167[_0xa337('0x40')]+=0x1;_0x43be18[_0xa337('0xb1')]=ut[_0xa337('0x99')](_0x43be18);ut[_0xa337('0x88')](_0x43be18,0x13,_0x273424['cause-txt']||_0x273424['dialstatus']);ami[_0xa337('0x25')]('custom:amd',ut[_0xa337('0x9c')](_0x43be18,'amd'));rpcDb['createCustomerHistory'](_0x43be18,_0xa337('0xdc'));if(ut['totalGlobal'](_0x43be18)>=_0x47d167[_0xa337('0x9e')]){_0x37b516=ut['cloneAction'](_0x43be18,0xf,_0xa337('0x9f'));rpcDb['createCustomerFinal'](_0x37b516,_0xa337('0xdc'));}else{rpcDb[_0xa337('0x8e')](_0x43be18,_0xa337('0xdc'));}delete this[_0xa337('0x18')][_0x273424[_0xa337('0xa7')]];break;default:if(_0x43be18['dialAnswer']){ut[_0xa337('0x76')](_0x47d167,_0xa337('0xdd'));ut['loggerError'](_0xa337('0xde')+_0x47d167[_0xa337('0x27')],_0x273424);}_0x47d167[_0xa337('0x40')]+=0x1;_0x43be18[_0xa337('0xb1')]=ut[_0xa337('0x99')](_0x43be18);ut['logCustomer'](_0x43be18,0xc,_0x273424['cause-txt']||_0x273424[_0xa337('0xd9')]);rpcDb['createCustomerHistory'](_0x43be18,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0xa337('0x99')](_0x43be18)>=_0x47d167[_0xa337('0x9e')]){_0x37b516=ut['cloneAction'](_0x43be18,0xf,_0xa337('0x9f'));rpcDb[_0xa337('0x8e')](_0x37b516,_0xa337('0xdf'));}else{rpcDb['createCustomerFinal'](_0x43be18,_0xa337('0xdf'));}delete this['actions'][_0x273424['linkedid']];}if(!(_0x43be18[_0xa337('0x6c')]&&_0xb2c336==='16')){ut[_0xa337('0xe0')](_0x47d167,_0xa337('0xe1'));logger[_0xa337('0x55')](_0xa337('0xe2'),_0x43be18[_0xa337('0xb8')],_0xa337('0xab'),_0x47d167[_0xa337('0x27')],_0xa337('0x6b'),_0x47d167[_0xa337('0x4a')]);}if(_0xb2c336!==_0xa337('0xa8')){delete this[_0xa337('0x18')][_0x273424['linkedid']];delete this[_0xa337('0x18')][_0x273424[_0xa337('0xe3')]];}}};Preview['prototype'][_0xa337('0xe4')]=function(_0x3a0958,_0x56f094,_0x117e38){if(_['isUndefined'](_0x56f094)&&_0xa337('0xe5')!==typeof _0x56f094){return;}if(_[_0xa337('0xe6')](_0x117e38)&&'object'!==typeof _0x117e38){return;}switch(_0x117e38['reason']){case'0':ut[_0xa337('0xe7')](_0x3a0958,0x0,_0xa337('0x9a'));rpcDb[_0xa337('0xe8')](_0x3a0958,_0xa337('0xe9'));break;case'3':ut[_0xa337('0xe7')](_0x3a0958,0x3,_0xa337('0xea'));rpcDb['createAgentHistory'](_0x3a0958,_0xa337('0xeb'));break;case'5':ut[_0xa337('0xe7')](_0x3a0958,0x5,_0xa337('0xbb'));rpcDb['createAgentHistory'](_0x3a0958,_0xa337('0xec'));break;case'8':ut['logAgent'](_0x3a0958,0x8,_0xa337('0xed'));rpcDb['createAgentHistory'](_0x3a0958,_0xa337('0xee'));break;case'22':ut[_0xa337('0xe7')](_0x3a0958,0x16,_0xa337('0xef'));rpcDb[_0xa337('0xe8')](_0x3a0958,_0xa337('0xf0'));break;default:ut['logAgent'](_0x3a0958,0xc,_0x117e38['reason']);rpcDb[_0xa337('0xe8')](_0x3a0958,_0xa337('0xee'));}ut[_0xa337('0xe0')](_0x56f094,_0xa337('0xf1'));logger[_0xa337('0x55')](_0xa337('0xf2'),_0x3a0958[_0xa337('0xb8')],_0xa337('0xab'),_0x56f094[_0xa337('0x27')],_0xa337('0x6b'),_0x56f094['originated']);delete this[_0xa337('0x18')][_0x3a0958[_0xa337('0xb8')]];};Preview[_0xa337('0x12')][_0xa337('0xf3')]=function(_0x5b4c0d,_0x4bf3b6,_0x610a9e,_0x114a6b,_0x4f8fdb){var _0x3dc48f=this;return new BPromise(function(_0x30a99e,_0xc122b8){if(_[_0xa337('0x67')](_0x4bf3b6)||_[_0xa337('0x67')](_0x4bf3b6[_0xa337('0xf4')])||_[_0xa337('0x67')](_0x4bf3b6[_0xa337('0xf4')][_0xa337('0xf5')])||_['isNil'](_0x4bf3b6[_0xa337('0xf6')])){_0xc122b8(ut[_0xa337('0x49')](_0xa337('0xf7'),_0x114a6b,_0x4f8fdb));return;}var _0x32b9ca=uuid['v4']();var _0x541bd2=_0x3dc48f[_0xa337('0x24')][_0x4bf3b6[_0xa337('0x69')][_0xa337('0x27')]];var _0x424b96=_0x610a9e?_0x3dc48f[_0xa337('0x7e')][_0x610a9e]['id']:undefined;_0x3dc48f[_0xa337('0x18')][_0x32b9ca]=new Action(_0x4bf3b6,_0x541bd2,_0x32b9ca,_0x610a9e,_0x424b96);var _0x4f17e6=_0x3dc48f[_0xa337('0x18')][_0x32b9ca];_0x4f17e6[_0xa337('0xc1')]=_0x114a6b;_0x4f17e6[_0xa337('0xa6')]=_0x4f8fdb;_0x4f17e6[_0xa337('0xf8')]=_0x610a9e;if(_[_0xa337('0xf9')](_0x5b4c0d)){_0x3dc48f['execCall'](_0x4f17e6,_0x541bd2,_0x4bf3b6,_0x610a9e)[_0xa337('0x84')](function(_0x2ca144){logger[_0xa337('0x55')]('[Preview][execCall][success]','Queue:\x20'+_0x4f17e6[_0xa337('0x6a')]+_0xa337('0xfa')+_0x4f17e6[_0xa337('0xfb')],JSON[_0xa337('0x51')](_0x2ca144));ami['emit'](_0xa337('0xfc'),ut[_0xa337('0x9c')](_0x4f17e6,_0xa337('0xfd'),_0x3dc48f[_0xa337('0x24')][_0x4f17e6[_0xa337('0x6a')]]));_0x30a99e(ut[_0xa337('0x49')]('Calling'));})['catch'](function(_0x421df0){ut[_0xa337('0x5f')]('[Preview][execCall][failure]',_0x421df0);_0xc122b8(ut[_0xa337('0x49')](_0xa337('0xfe'),_0x114a6b,_0x4f8fdb));});}else{_0x541bd2[_0xa337('0x37')]+=0x1;ut['logBlacklist'](_0x4f17e6);rpcDb[_0xa337('0xff')](_0x4f17e6,_0xa337('0x100'));delete _0x3dc48f[_0xa337('0x18')][_0x32b9ca];_0xc122b8(ut[_0xa337('0x49')](_0xa337('0x101'),_0x114a6b,_0x4f8fdb));}});};Preview['prototype']['isTrunkReachable']=function(_0x320d55){return!_[_0xa337('0x67')](_0x320d55)&&!_[_0xa337('0x67')](_0x320d55[_0xa337('0x27')])&&!_[_0xa337('0x67')](_0x320d55[_0xa337('0x4f')])&&_0x320d55['active']&&!_['isNil'](this[_0xa337('0x17')][util[_0xa337('0x52')](_0xa337('0x102'),_0x320d55['name'])])&&!_[_0xa337('0x67')](this[_0xa337('0x17')][util['format'](_0xa337('0x102'),_0x320d55['name'])][_0xa337('0x72')])&&(this['trunks'][util[_0xa337('0x52')](_0xa337('0x102'),_0x320d55[_0xa337('0x27')])]['status']===_0xa337('0x103')||this[_0xa337('0x17')][util['format']('SIP/%s',_0x320d55[_0xa337('0x27')])][_0xa337('0x72')]==='unmonitored');};Preview['prototype'][_0xa337('0x83')]=function(_0x14af4d,_0x3c3908){var _0x47eb96=this;return new BPromise(function(_0x511455,_0x2ab4ba){_0x47eb96[_0xa337('0x104')](_0x14af4d,_0x3c3908)['then'](function(_0x4e8c6a){_0x511455(_['pick'](_0x4e8c6a,[_0xa337('0x49')]));})['catch'](function(_0x4314a7){if(_0x4314a7[_0xa337('0x105')]){rpcDb[_0xa337('0x106')](_0x14af4d);}if(_0x4314a7[_0xa337('0x4f')]){rpcDb[_0xa337('0x107')](_0x14af4d);}_0x2ab4ba(_[_0xa337('0x6d')](_0x4314a7,['message']));});});};Preview[_0xa337('0x12')][_0xa337('0x104')]=function(_0x1db064,_0x410803){var _0x336d2c=this;return new BPromise(function(_0x5f164b,_0x31f80c){var _0x1f4c78,_0x1d5979;rpcDb[_0xa337('0x108')](_0x1db064)[_0xa337('0x84')](function(_0x504a12){if(!_[_0xa337('0x67')](_0x504a12[0x0])){_0x1d5979=_0x504a12[0x0][_0xa337('0x109')]?![]:!![];_0x1f4c78=_0x504a12[0x0][_0xa337('0x109')]?!![]:![];_0x1f4c78=_0x410803?!![]:_0x1f4c78;}var _0x42f4b5=_0x336d2c[_0xa337('0x10a')](_0x504a12);if(_0x42f4b5[_0xa337('0x10b')]){rpcDb[_0xa337('0x10c')](_[_0xa337('0x6d')](_0x504a12[0x0],[_0xa337('0xf6'),'Contact.phone']))['then'](function(_0x26c730){_0x336d2c[_0xa337('0xf3')](_0x26c730,_0x504a12[0x0],_0x410803,_0x1d5979,_0x1f4c78)['then'](function(_0x419e0c){_0x5f164b(_0x419e0c);})[_0xa337('0x74')](function(_0x207def){_0x31f80c(_0x207def);});})['catch'](function(_0x468279){ut[_0xa337('0x5f')]('[Preview][checkIsBlackList]',_0x468279);_0x31f80c(ut[_0xa337('0x49')]('Call\x20unsuccessful',_0x1d5979,_0x1f4c78));});}else{_0x31f80c(ut[_0xa337('0x49')](_0x42f4b5[_0xa337('0x49')],_0x1d5979,_0x1f4c78));}})[_0xa337('0x74')](function(_0x55934f){ut[_0xa337('0x5f')](_0xa337('0x10d'),_0x55934f);_0x31f80c(ut[_0xa337('0x49')](_0xa337('0x10e'),![],!![]));});});};Preview['prototype'][_0xa337('0x10a')]=function(_0x5b9897){if(_[_0xa337('0x67')](_0x5b9897)||_['isEmpty'](_0x5b9897)||!_[_0xa337('0x67')](_0x5b9897[0x0][_0xa337('0x82')])&&_[_0xa337('0x67')](_0x5b9897[0x0][_0xa337('0x82')]['name'])){ut[_0xa337('0x5f')](_0xa337('0x10f'),_0x5b9897);return{'isValid':![],'message':'Empty\x20Contact'};}var _0xde475b=this[_0xa337('0x24')][_0x5b9897[0x0][_0xa337('0x69')][_0xa337('0x27')]];_0xde475b['message']='ACTIVE';if(_[_0xa337('0x67')](_0xde475b)){ut['logger'](_0xa337('0x110'),_0xde475b);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xa337('0x95')](_0xde475b['Trunk'])){ut[_0xa337('0x5f')](_0xa337('0x111'),_0xa337('0x112')+_0xde475b[_0xa337('0x27')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0xde475b[_0xa337('0x96')])){ut['logger'](_0xa337('0x111'),_0xde475b[_0xa337('0x27')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xa337('0x113')};}}if(!ut[_0xa337('0x94')](_0xde475b['dialActive'])){ut[_0xa337('0x5f')](_0xa337('0x114'),_0xde475b[_0xa337('0x27')]+_0xa337('0x115'));return{'isValid':![],'message':_0xa337('0x112')+_0xde475b[_0xa337('0x27')]+_0xa337('0x115')};}return{'isValid':!![],'message':_0xa337('0x116')};};Preview[_0xa337('0x12')][_0xa337('0x117')]=function(_0x8f79a0,_0x433dd0,_0xe505d9,_0x4cf653){var _0x31acc9=this;return new BPromise(function(_0x405a14,_0x2f0f22){var _0x4c5ef0=_0x8f79a0['uniqueid'];var _0x34c2e5=_0x31acc9['isTrunkReachable'](_0x433dd0[_0xa337('0x4e')])?util[_0xa337('0x52')](_0xa337('0x118'),_0x433dd0['Trunk'][_0xa337('0x27')],_[_0xa337('0x67')](_0x433dd0['dialPrefix'])?'':_0x433dd0[_0xa337('0x34')]['trim']()||'',_0x433dd0[_0xa337('0x119')]>0x0?_0xe505d9[_0xa337('0xf4')][_0xa337('0xf5')]['substring'](_0x433dd0[_0xa337('0x119')]):_0xe505d9[_0xa337('0xf4')][_0xa337('0xf5')]):util[_0xa337('0x52')](_0xa337('0x118'),_[_0xa337('0x67')](_0x433dd0[_0xa337('0x96')])?_0x433dd0[_0xa337('0x4e')][_0xa337('0x27')]:_0x433dd0[_0xa337('0x96')][_0xa337('0x27')],_[_0xa337('0x67')](_0x433dd0['dialPrefix'])?'':_0x433dd0[_0xa337('0x34')][_0xa337('0x11a')]()||'',_0x433dd0['dialCutDigit']>0x0?_0xe505d9[_0xa337('0xf4')][_0xa337('0xf5')][_0xa337('0x11b')](_0x433dd0[_0xa337('0x119')]):_0xe505d9[_0xa337('0xf4')][_0xa337('0xf5')]);var _0x56e7e2=_0x31acc9[_0xa337('0x95')](_0x433dd0['Trunk'])?ut[_0xa337('0x11c')](_0x433dd0['Trunk'][_0xa337('0x11d')],_0x433dd0[_0xa337('0x32')],_0x433dd0[_0xa337('0x11e')]>0x0?ut[_0xa337('0x11f')](_0x433dd0['dialOriginateCallerIdNumber'],_0x433dd0[_0xa337('0x11e')]):_0x433dd0[_0xa337('0x120')]):ut[_0xa337('0x11c')](_[_0xa337('0x67')](_0x433dd0[_0xa337('0x96')])?_0x433dd0[_0xa337('0x4e')]['callerid']:_0x433dd0[_0xa337('0x96')]['callerid'],_0x433dd0['dialOriginateCallerIdName'],_0x433dd0['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xa337('0x11f')](_0x433dd0[_0xa337('0x120')],_0x433dd0[_0xa337('0x11e')]):_0x433dd0['dialOriginateCallerIdNumber']);if(_0x56e7e2){_0x8f79a0[_0xa337('0x121')]=ut['extractCalleridName'](_0x56e7e2);_0x8f79a0[_0xa337('0x122')]=ut[_0xa337('0x123')](_0x56e7e2);}var _0x1482c3=ut[_0xa337('0x124')](_0x433dd0,_0xe505d9,_0x34c2e5,_0x56e7e2,_0x4c5ef0,_0x8f79a0);_[_0xa337('0x125')](_0x8f79a0,ut[_0xa337('0x126')](_0x1482c3));_0x8f79a0[_0xa337('0x86')]=moment()[_0xa337('0x52')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0xa337('0x71')](ut[_0xa337('0x127')](_0x8f79a0,_0x433dd0,_0x1482c3,_0x8f79a0[_0xa337('0xa6')],_0x4cf653))[_0xa337('0x84')](function(_0x51a16c){var _0x2b15fc=_0x8f79a0[_0xa337('0x128')];if(!_[_0xa337('0x67')](_0x2b15fc)){if(!_[_0xa337('0x67')](_0x31acc9['agents'][_0x2b15fc])){_0x31acc9[_0xa337('0x7e')][_0x2b15fc][_0xa337('0x129')]=_0x8f79a0[_0xa337('0x12a')];emit(util[_0xa337('0x52')]('user:%s',_0x31acc9[_0xa337('0x7e')][_0x2b15fc][_0xa337('0x27')]),_0xa337('0x12b'),{'destaccountcode':_0x31acc9[_0xa337('0x7e')][_0x2b15fc][_0xa337('0x12c')],'destconnectedlinenum':_0x8f79a0[_0xa337('0x12a')]});}}_0x433dd0[_0xa337('0x4a')]+=0x1;logger[_0xa337('0x55')](_0xa337('0x12d'),_0x4c5ef0,'\x20Queue',_0x433dd0[_0xa337('0x27')],_0xa337('0x6b'),_0x433dd0[_0xa337('0x4a')]);_0x405a14(_0x51a16c);})[_0xa337('0x74')](function(_0x10f714){ut[_0xa337('0xe7')](_0x8f79a0,0xe,_0xa337('0x12e'));rpcDb[_0xa337('0xe8')](_0x8f79a0,_0xa337('0x12f'));_0x2f0f22(_0x10f714);});});};Preview[_0xa337('0x12')][_0xa337('0x20')]=function(_0x16a6ea){if(this[_0xa337('0x18')][_0x16a6ea[_0xa337('0xa7')]]){this['actions'][_0x16a6ea[_0xa337('0xa7')]][_0xa337('0x73')]=_0x16a6ea['channel'];}};Preview['prototype']['syncOriginateResponse']=function(_0xee178c){var _0x4d5270=this;var _0x2d67a8=this[_0xa337('0x18')][_0xee178c[_0xa337('0x130')]];if(_0x2d67a8){if(_0x2d67a8[_0xa337('0xf8')]&&this['agents'][_0x2d67a8[_0xa337('0xf8')]]){ut[_0xa337('0x131')](_0x2d67a8,this[_0xa337('0x7e')][_0x2d67a8['lookAgent']][_0xa337('0x27')],this[_0xa337('0x7e')][_0x2d67a8[_0xa337('0xf8')]]['id']);}var _0x929e0f=_[_0xa337('0x132')](_0x2d67a8);_0x929e0f[_0xa337('0x133')]=moment()[_0xa337('0x52')](_0xa337('0x87'));var _0x53344d=_0x4d5270[_0xa337('0x24')][_0x2d67a8['queue']];if(ut[_0xa337('0x134')](_0xee178c[_0xa337('0x135')])){if(_0x2d67a8[_0xa337('0xc1')]){rpcDb[_0xa337('0x106')](_0x2d67a8['idContact']);}if(_0x2d67a8[_0xa337('0xa6')]){rpcDb['disableContact'](_0x2d67a8[_0xa337('0xfb')]);}ami['emit'](_0xa337('0x136'),ut['buildObj'](_0x2d67a8,_0xa337('0x137'),this[_0xa337('0x24')][_0x2d67a8[_0xa337('0x6a')]]));this['callProgressDetectingAgent'](_0x929e0f,_0x53344d,_0xee178c);}else{_0x2d67a8['starttime']=moment()[_0xa337('0x52')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xa337('0xe7')](_0x929e0f,0x4,_0xa337('0xb2'));rpcDb[_0xa337('0xe8')](_0x929e0f,_0xa337('0x138'));}}};Preview[_0xa337('0x12')][_0xa337('0x1a')]=function(_0x466f2c){var _0x14aeda=this;var _0x1414b0=this['actions'][_0x466f2c[_0xa337('0xa7')]];var _0x5b4f66;if(_0x1414b0){_0x5b4f66=this[_0xa337('0x24')][_0x1414b0[_0xa337('0x6a')]];logger[_0xa337('0x55')](_0xa337('0x139'),_0x466f2c['linkedid'],_0xa337('0xab'),_0x5b4f66[_0xa337('0x27')],_0xa337('0xac'),_0x5b4f66[_0xa337('0x29')]);}if(this[_0xa337('0x18')][_0x466f2c[_0xa337('0xa7')]]&&_0x466f2c[_0xa337('0xa7')]!==_0x466f2c[_0xa337('0xb8')]){if(_0x466f2c[_0xa337('0x13a')]==='16'&&this[_0xa337('0x18')][_0x466f2c[_0xa337('0xa7')]][_0xa337('0x6c')]){this[_0xa337('0x98')](_0x466f2c,_0x466f2c[_0xa337('0xa7')],_0x466f2c['cause']);}else if(this[_0xa337('0x18')][_0x466f2c[_0xa337('0xa7')]]['dialAnswer']){logger[_0xa337('0x55')]('[syncHangup][talking][cause]',_0x466f2c['linkedid'],_0x466f2c['cause'],_0xa337('0xab'),_0x5b4f66['name'],_0xa337('0xac'),_0x5b4f66[_0xa337('0x29')]);this['callProgressDetectingCustomer'](_0x466f2c,_0x466f2c['linkedid'],_0x466f2c['cause']);}}else if(_0x1414b0&&_[_0xa337('0x67')](_0x1414b0[_0xa337('0x13b')])&&_0x5b4f66[_0xa337('0x13c')]&&_0x466f2c[_0xa337('0xa7')]===_0x466f2c[_0xa337('0xb8')]&&_['isNil'](_0x466f2c[_0xa337('0x13d')])&&_0x466f2c[_0xa337('0x13a')]==='16'&&_0x466f2c[_0xa337('0x13e')]==='6'&&_['isUndefined'](_0x1414b0[_0xa337('0x13f')])){if(_0x1414b0['unlockAgent']){rpcDb[_0xa337('0x106')](_0x1414b0[_0xa337('0xfb')]);}if(_0x1414b0[_0xa337('0xa6')]){rpcDb['disableContact'](_0x1414b0[_0xa337('0xfb')]);}_0x466f2c['reason']='22';this[_0xa337('0xe4')](_0x1414b0,_0x5b4f66,_0x466f2c);}else if(_0x1414b0&&_0x1414b0[_0xa337('0x13f')]){if(_0x466f2c['cause']==='16'&&this[_0xa337('0x18')][_0x466f2c[_0xa337('0xa7')]][_0xa337('0x6c')]){logger['info'](_0xa337('0x140'),_0x466f2c['linkedid'],_0x466f2c[_0xa337('0x13a')],_0xa337('0xab'),_0x5b4f66[_0xa337('0x27')],_0xa337('0xac'),_0x5b4f66[_0xa337('0x29')]);this[_0xa337('0x98')](_0x466f2c,_0x466f2c[_0xa337('0xa7')],_0x466f2c[_0xa337('0x13a')]);}else if(this[_0xa337('0x18')][_0x466f2c[_0xa337('0xa7')]][_0xa337('0x6c')]){logger[_0xa337('0x55')]('[syncHangup][talking][cause]',_0x466f2c[_0xa337('0xa7')],_0x466f2c[_0xa337('0x13a')],_0xa337('0xab'),_0x5b4f66[_0xa337('0x27')],_0xa337('0xac'),_0x5b4f66[_0xa337('0x29')]);this[_0xa337('0x98')](_0x466f2c,_0x466f2c[_0xa337('0xa7')],_0x466f2c[_0xa337('0x13a')]);}}};Preview[_0xa337('0x12')][_0xa337('0x1e')]=function(_0x47372b){if(this['actions'][_0x47372b[_0xa337('0xe3')]]&&_0x47372b[_0xa337('0xe3')]!==_0x47372b[_0xa337('0x141')]){this[_0xa337('0x98')](_0x47372b,_0x47372b[_0xa337('0xe3')],_0x47372b[_0xa337('0xd9')]);}};Preview[_0xa337('0x12')][_0xa337('0x1c')]=function(_0x3d5f63){if(this[_0xa337('0x18')][_0x3d5f63[_0xa337('0xa7')]]&&_0x3d5f63[_0xa337('0xa7')]!==_0x3d5f63[_0xa337('0xb8')]&&!this[_0xa337('0x18')][_0x3d5f63[_0xa337('0xa7')]][_0xa337('0x6c')]){if(_0x3d5f63[_0xa337('0x13a')]==='1'){this[_0xa337('0x98')](_0x3d5f63,_0x3d5f63[_0xa337('0xa7')],_0x3d5f63[_0xa337('0x13a')]);}}};Preview[_0xa337('0x12')][_0xa337('0x142')]=function(_0x233c73,_0x8b897a,_0x14fd7c){if(this[_0xa337('0x18')][_0x233c73]){if(_[_0xa337('0x67')](this[_0xa337('0x18')][_0x233c73]['variables'])){this[_0xa337('0x18')][_0x233c73][_0xa337('0x143')]={};}this['actions'][_0x233c73]['variables'][_0x8b897a]=_0x14fd7c;}};Preview[_0xa337('0x12')][_0xa337('0x22')]=function(_0xd9080d){try{if(!_['isNil'](_0xd9080d)){if(ut[_0xa337('0x144')](_[_0xa337('0x145')](_0xd9080d[_0xa337('0x146')])[0x0])){this[_0xa337('0x142')](_0xd9080d[_0xa337('0xb8')],_[_0xa337('0x145')](_0xd9080d[_0xa337('0x146')])[0x0],_0xd9080d[_0xa337('0x147')]);}}}catch(_0x21bac1){logger[_0xa337('0x148')]('[syncVarSet][Preview]',util[_0xa337('0x149')](_0x21bac1,{'showHidden':![],'depth':null}));}};Preview[_0xa337('0x12')][_0xa337('0x14a')]=function(_0x269a1a){if(_0x269a1a){if(this[_0xa337('0x18')][_0x269a1a['transfertargetlinkedid']]){this[_0xa337('0x18')][_0x269a1a['transfertargetlinkedid']][_0xa337('0x13f')]=!![];}}};Preview['prototype'][_0xa337('0x14b')]=function(_0x1f19e2){if(_0x1f19e2){if(this[_0xa337('0x18')][_0x1f19e2[_0xa337('0x14c')]]){this['actions'][_0x1f19e2[_0xa337('0x14c')]]['transfer']=!![];}}};module[_0xa337('0x14d')]=Preview; \ No newline at end of file +var _0xd13f=['predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','md5','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','available','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','logger','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','preview','booked','clearZombieChannels','setMessage','recallMe','clearZombieChannel','sequence','isNil','actions','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','updateOriginated','decrementTalkink','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','getContactRecallMe','agents','then','length','getDiff','scheduledat','dialRecallMeTimeout','voicePause','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','busy','[callProgressDetectingCustomer][logBusy]','rescheduleContact','scheduledAt','countbusyretry','unlockAgent','activeContact','NOANSWER','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','logAgent','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','lookAgent','isEmpty','[Preview][execCall][success]','\x20IdHopper:\x20','idContact','Calling','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','reachable','unlock','unlockContact','getContactPreview','recallme','isValid','checkIsBlackList','Contact.phone','Call\x20unsuccessful','validateContact','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','channelAgent','calleridnum','user:%s','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','response','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','variables','keys','variable','value','[syncVarSet][Preview]','inspect','transfererlinkedid','exports','util','uuid','moment','ioredis','../../../config/environment','../../../config/logger','../ami','./util/util','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','clockClearZombieChannels','syncOriginateResponse','bind','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','pTalking','sumBillable','sumDuration','talking','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls'];(function(_0x90e688,_0x24c789){var _0x5aa5c5=function(_0x459f40){while(--_0x459f40){_0x90e688['push'](_0x90e688['shift']());}};_0x5aa5c5(++_0x24c789);}(_0xd13f,0x112));var _0xfd13=function(_0x1a1ef7,_0x45c008){_0x1a1ef7=_0x1a1ef7-0x0;var _0x21a9b4=_0xd13f[_0x1a1ef7];return _0x21a9b4;};'use strict';var util=require(_0xfd13('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xfd13('0x1'));var moment=require(_0xfd13('0x2'));var md5=require('md5');var Redis=require(_0xfd13('0x3'));var config=require(_0xfd13('0x4'));var logger=require(_0xfd13('0x5'))('preview');var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0xfd13('0x6'));var rpcDb=require('./rpcDb');var Action=require('./action');var ut=require(_0xfd13('0x7'));config[_0xfd13('0x8')]=_[_0xfd13('0x9')](config['redis'],{'host':_0xfd13('0xa'),'port':0x18eb});var io=require(_0xfd13('0xb'))(new Redis(config[_0xfd13('0x8')]));var Sequence=function(){};Sequence['prototype'][_0xfd13('0xc')]=function(_0x140235){this[_0xfd13('0xd')]=this['tail']?this[_0xfd13('0xd')][_0xfd13('0xe')](_0x140235):_0x140235();};function Preview(_0x511a27){this['sequence']=new Sequence();this[_0xfd13('0xf')]=_0x511a27[_0xfd13('0x10')];this['trunks']=_0x511a27[_0xfd13('0x11')];this['actions']={};this['agents']=_0x511a27['agents'];this[_0xfd13('0x12')]=0x0;ami['on']('originateresponse',this[_0xfd13('0x13')][_0xfd13('0x14')](this));ami['on']('hangup',this[_0xfd13('0x15')][_0xfd13('0x14')](this));ami['on'](_0xfd13('0x16'),this[_0xfd13('0x17')][_0xfd13('0x14')](this));ami['on']('dialend',this[_0xfd13('0x18')]['bind'](this));ami['on'](_0xfd13('0x19'),this[_0xfd13('0x1a')][_0xfd13('0x14')](this));ami['on'](_0xfd13('0x1b'),this[_0xfd13('0x1c')][_0xfd13('0x14')](this));ami['on'](_0xfd13('0x1d'),this[_0xfd13('0x1e')][_0xfd13('0x14')](this));ami['on'](_0xfd13('0x1f'),this[_0xfd13('0x20')][_0xfd13('0x14')](this));this[_0xfd13('0x21')](this[_0xfd13('0xf')]);}function emit(_0x30e591,_0xb5d678,_0x26bcd6){io['to'](_0x30e591)[_0xfd13('0x22')](_0xb5d678,_0x26bcd6);}function emitCampaignPreview(_0x205a0d){if(_0x205a0d[_0xfd13('0x23')]===_0xfd13('0x24')){var _0xb7ad9b={'id':_0x205a0d['id'],'name':_0x205a0d[_0xfd13('0x25')],'strategy':_0x205a0d[_0xfd13('0x26')],'answered':_0x205a0d[_0xfd13('0x27')],'available':_0x205a0d['available'],'loggedIn':_0x205a0d['loggedIn'],'pTalking':_0x205a0d[_0xfd13('0x28')],'sumBillable':_0x205a0d[_0xfd13('0x29')],'sumDuration':_0x205a0d[_0xfd13('0x2a')],'sumHoldTime':_0x205a0d['sumHoldTime']||0x0,'talking':_0x205a0d[_0xfd13('0x2b')],'total':_0x205a0d['total'],'type':_0x205a0d[_0xfd13('0x23')],'unmanaged':_0x205a0d['unmanaged'],'abandoned':_0x205a0d[_0xfd13('0x2c')],'waiting':_0x205a0d[_0xfd13('0x2d')],'loggedInDb':_0x205a0d[_0xfd13('0x2e')],'dialActive':_0x205a0d[_0xfd13('0x2f')],'dialMethod':_0x205a0d[_0xfd13('0x30')],'dialOriginateCallerIdName':_0x205a0d[_0xfd13('0x31')],'dialOriginateCallerIdNumber':_0x205a0d[_0xfd13('0x32')],'dialOriginateTimeout':_0x205a0d[_0xfd13('0x33')],'dialPrefix':_0x205a0d[_0xfd13('0x34')],'outboundAnswerAgiCallsDay':_0x205a0d[_0xfd13('0x35')],'outboundAnswerCallsDay':_0x205a0d['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x205a0d[_0xfd13('0x36')],'outboundBusyCallsDay':_0x205a0d[_0xfd13('0x37')],'outboundCongestionCallsDay':_0x205a0d[_0xfd13('0x38')],'outboundDropCallsDayACS':_0x205a0d['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x205a0d['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x205a0d[_0xfd13('0x39')],'outboundNoAnswerCallsDay':_0x205a0d[_0xfd13('0x3a')],'outboundNoSuchCallsDay':_0x205a0d['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x205a0d[_0xfd13('0x3b')],'outboundReCallsDay':_0x205a0d[_0xfd13('0x3c')],'outboundRejectCallsDay':_0x205a0d[_0xfd13('0x3d')],'outboundUnknownCallsDay':_0x205a0d[_0xfd13('0x3e')],'outboundAbandonedCallsDay':_0x205a0d['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x205a0d[_0xfd13('0x3f')],'predictiveIntervalAvgHoldtime':_0x205a0d['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x205a0d[_0xfd13('0x40')],'predictiveIntervalDroppedCallsCallersExit':_0x205a0d[_0xfd13('0x41')],'predictiveIntervalDroppedCallsTimeout':_0x205a0d[_0xfd13('0x42')],'predictiveIntervalErlangCalls':_0x205a0d[_0xfd13('0x43')],'predictiveIntervalErlangCallsDroppedCalls':_0x205a0d[_0xfd13('0x44')],'predictiveIntervalHitRate':_0x205a0d[_0xfd13('0x45')],'predictiveIntervalMultiplicativeFactor':_0x205a0d['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x205a0d[_0xfd13('0x46')],'predictiveIntervalAvailable':_0x205a0d[_0xfd13('0x47')],'predictiveIntervalTotalCalls':_0x205a0d['predictiveIntervalTotalCalls'],'message':_0x205a0d[_0xfd13('0x48')],'originated':_0x205a0d[_0xfd13('0x49')],'erlangCalls':_0x205a0d[_0xfd13('0x4a')],'erlangCallToSecond':_0x205a0d[_0xfd13('0x4b')],'erlangAbandonmentRate':_0x205a0d[_0xfd13('0x4c')],'erlangBusyFactor':_0x205a0d[_0xfd13('0x4d')],'startPredictive':_0x205a0d[_0xfd13('0x4e')],'startProgressive':_0x205a0d[_0xfd13('0x4f')]};if(_0x205a0d[_0xfd13('0x50')]){_0xb7ad9b[_0xfd13('0x50')]={'id':_0x205a0d[_0xfd13('0x50')]['id'],'name':_0x205a0d[_0xfd13('0x50')][_0xfd13('0x25')],'active':_0x205a0d[_0xfd13('0x50')][_0xfd13('0x51')],'callerid':_0x205a0d[_0xfd13('0x50')][_0xfd13('0x52')]};}if(_0x205a0d['Interval']){_0xb7ad9b['Interval']={'id':_0x205a0d[_0xfd13('0x53')]['id'],'name':_0x205a0d['Interval'][_0xfd13('0x25')]};}var _0x12b13f=md5(JSON['stringify'](_0xb7ad9b));if(_0x205a0d[_0xfd13('0x54')]!==_0x12b13f){_0x205a0d[_0xfd13('0x54')]=_0x12b13f;emit(util['format']('voice:queue:%s',_0xb7ad9b['name']),_0xfd13('0x55'),_0xb7ad9b);}}}function emitVoiceQueueChannelRemove(_0x46e324){logger[_0xfd13('0x56')](_0xfd13('0x57'),JSON[_0xfd13('0x58')](_0x46e324));emit(util[_0xfd13('0x59')](_0xfd13('0x5a'),_0x46e324['name']),_0xfd13('0x5b'),_0x46e324);io[_0xfd13('0x22')](_0xfd13('0x5c'),_0x46e324);}function notSendMessagesQueue(_0x3a2c5a){if(_0x3a2c5a[_0xfd13('0x5d')]){if(_0x3a2c5a[_0xfd13('0x49')]===0x0&&_0x3a2c5a[_0xfd13('0x28')]===0x0){_0x3a2c5a['sendMessageOneNotActive']=![];_0x3a2c5a[_0xfd13('0x5e')]=0x0;_0x3a2c5a['paused']=0x0;_0x3a2c5a[_0xfd13('0x48')]='NOT_ACTIVE';ut['logger'](_0xfd13('0x5f'),_0x3a2c5a[_0xfd13('0x25')]+_0xfd13('0x60'));}else{_0x3a2c5a[_0xfd13('0x48')]='IS_DISACTIVED';ut[_0xfd13('0x61')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x3a2c5a[_0xfd13('0x25')]+_0xfd13('0x62'));}emitCampaignPreview(_0x3a2c5a);}}Preview[_0xfd13('0x63')]['loopCampaigns']=function(){var _0x11e4f8=this;setInterval(function(){_0x11e4f8[_0xfd13('0x64')]();},0x7cf);};Preview[_0xfd13('0x63')][_0xfd13('0x64')]=function(){var _0x1265f3=this[_0xfd13('0xf')];this[_0xfd13('0x12')]+=0x1;for(var _0x47caf4 in _0x1265f3){if(_0x1265f3[_0xfd13('0x65')](_0x47caf4)&&(_0x1265f3[_0x47caf4][_0xfd13('0x30')]===_0xfd13('0x66')||_0x1265f3[_0x47caf4][_0xfd13('0x30')]===_0xfd13('0x67'))&&_0x1265f3[_0x47caf4][_0xfd13('0x23')]===_0xfd13('0x24')){if(this['clockClearZombieChannels']>0x7){this[_0xfd13('0x12')]=0x0;this[_0xfd13('0x68')]();}}if(_0x1265f3['hasOwnProperty'](_0x47caf4)&&_0x1265f3[_0x47caf4][_0xfd13('0x30')]===_0xfd13('0x66')&&_0x1265f3[_0x47caf4][_0xfd13('0x23')]===_0xfd13('0x24')){if(_0x1265f3[_0x47caf4][_0xfd13('0x2f')]){this[_0xfd13('0x69')](_0x1265f3[_0x47caf4]);this[_0xfd13('0x6a')](_0x1265f3[_0x47caf4]);}else{notSendMessagesQueue(_0x1265f3[_0x47caf4]);}}}};Preview[_0xfd13('0x63')][_0xfd13('0x6b')]=function(_0x1e9a79){var _0x24adac=this;this[_0xfd13('0x6c')]['enqueue'](function(){if(!_[_0xfd13('0x6d')](_0x24adac[_0xfd13('0x6e')][_0x1e9a79])){loggerAction[_0xfd13('0x56')](_0xfd13('0x6f'),_0x1e9a79,_0xfd13('0x70'),_0x24adac[_0xfd13('0x6e')][_0x1e9a79]['queue'],_0xfd13('0x71'),JSON['stringify'](_0x24adac[_0xfd13('0xf')][_0x24adac[_0xfd13('0x6e')][_0x1e9a79][_0xfd13('0x72')]][_0xfd13('0x49')]),_0xfd13('0x73'),JSON[_0xfd13('0x58')](_0x24adac[_0xfd13('0xf')][_0x24adac[_0xfd13('0x6e')][_0x1e9a79][_0xfd13('0x72')]][_0xfd13('0x28')]),JSON[_0xfd13('0x58')](_0x24adac[_0xfd13('0x6e')][_0x1e9a79][_0xfd13('0x74')]),JSON[_0xfd13('0x58')](_[_0xfd13('0x75')](_0x24adac[_0xfd13('0x6e')][_0x1e9a79],[_0xfd13('0x76'),_0xfd13('0x77'),_0xfd13('0x78'),_0xfd13('0x79')])));return ami[_0xfd13('0x7a')]({'action':_0xfd13('0x7b'),'channel':_0x24adac[_0xfd13('0x6e')][_0x1e9a79][_0xfd13('0x7c')]})[_0xfd13('0x7d')](function(_0x510d1f){if(_0x510d1f[_0xfd13('0x48')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x24adac[_0xfd13('0x6e')][_0x1e9a79]){ut[_0xfd13('0x7e')](_0x24adac[_0xfd13('0xf')][_0x24adac[_0xfd13('0x6e')][_0x1e9a79][_0xfd13('0x72')]],'[clearZombieChannel]');if(_0x24adac['actions'][_0x1e9a79][_0xfd13('0x74')]===!![]){ut[_0xfd13('0x7f')](_0x24adac[_0xfd13('0xf')][_0x24adac[_0xfd13('0x6e')][_0x1e9a79]['queue']],_0xfd13('0x80'));ut['loggerError'](_0xfd13('0x81')+_0x1e9a79,_0x24adac[_0xfd13('0x6e')][_0x1e9a79][_0xfd13('0x72')]);}ut[_0xfd13('0x82')](_0xfd13('0x83')+_0x1e9a79,_0x24adac[_0xfd13('0x6e')][_0x1e9a79][_0xfd13('0x72')]);delete _0x24adac[_0xfd13('0x6e')][_0x1e9a79];}},0x2328);}});}});};Preview[_0xfd13('0x63')][_0xfd13('0x68')]=function(){var _0x3af5d1=this;loggerAction[_0xfd13('0x56')]('[action]',_['size'](this[_0xfd13('0x6e')]));for(var _0x52acdb in this[_0xfd13('0x6e')]){if(_0x3af5d1[_0xfd13('0x6e')]['hasOwnProperty'](_0x52acdb)){_0x3af5d1[_0xfd13('0x6b')](_0x52acdb);}}};Preview[_0xfd13('0x63')][_0xfd13('0x6a')]=function(_0xd046c6){var _0x4a92c1=this;rpcDb[_0xfd13('0x84')](_0xd046c6['id'],ut['agentReadyId'](this[_0xfd13('0x85')]))[_0xfd13('0x86')](function(_0x139e64){if(!_[_0xfd13('0x6d')](_0x139e64)){for(var _0x84e757=0x0;_0x84e757<_0x139e64[_0xfd13('0x87')];_0x84e757+=0x1){if(ut[_0xfd13('0x88')](_0x139e64[_0x84e757][_0xfd13('0x89')])<_0xd046c6[_0xfd13('0x8a')]*0x3c){if(_0x139e64[_0x84e757]['Agent']&&!_0x139e64[_0x84e757]['Agent'][_0xfd13('0x8b')]){_0x4a92c1['run'](_0x139e64[_0x84e757]['id'])['then'](ut[_0xfd13('0x8c')]('[RecallMe]'))[_0xfd13('0x7d')](ut[_0xfd13('0x8c')]('[RecallMe]'));}else{rpcDb[_0xfd13('0x8d')](_0x139e64[_0x84e757]['id']);}}else{var _0x542889=new Action(_0x139e64[_0x84e757],_0xd046c6);_0x542889[_0xfd13('0x8e')]=moment()[_0xfd13('0x59')](_0xfd13('0x8f'));_0xd046c6[_0xfd13('0x3c')]+=0x1;ut[_0xfd13('0x90')](_0x542889,0x17,_0xfd13('0x91'));if(_0xd046c6['dialRecallInQueue']){rpcDb[_0xfd13('0x92')](ut[_0xfd13('0x93')](_0x139e64[_0x84e757]));rpcDb['createCustomerHistory'](_0x542889,_0xfd13('0x94'));}else{ut[_0xfd13('0x90')](_0x542889,0x16,_0xfd13('0x95'));rpcDb[_0xfd13('0x96')](_0x542889,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x542889,_0xfd13('0x97'));}}}}})[_0xfd13('0x7d')](ut[_0xfd13('0x8c')](_0xfd13('0x98')));};Preview['prototype'][_0xfd13('0x69')]=function(_0x3261dc){_0x3261dc['sendMessageOneNotActive']=!![];if(ut[_0xfd13('0x99')](_0x3261dc[_0xfd13('0x9a')])){_0x3261dc['message']=_0xfd13('0x9b');}else if(!ut[_0xfd13('0x9c')](_0x3261dc[_0xfd13('0x2f')])){_0x3261dc[_0xfd13('0x48')]=_0xfd13('0x9d');}else if(!this[_0xfd13('0x9e')](_0x3261dc['Trunk'])){if(!this[_0xfd13('0x9e')](_0x3261dc[_0xfd13('0x9f')])){_0x3261dc[_0xfd13('0x48')]='TRUNK_IS_NOT_REACHABLE';}else{_0x3261dc[_0xfd13('0x48')]=_0xfd13('0xa0');}}else{_0x3261dc[_0xfd13('0x48')]=_0xfd13('0xa0');}emitCampaignPreview(_0x3261dc);};Preview['prototype'][_0xfd13('0xa1')]=function(_0x1b2670,_0x44fc92,_0x96b4c0){var _0x5c0fc4=this;var _0x51db02=this[_0xfd13('0x6e')][_0x44fc92];var _0x46397=this['campaignsPreview'][_0x51db02[_0xfd13('0x72')]];var _0x4a35ee;if(_0x46397){switch(_0x96b4c0){case'1':_0x46397[_0xfd13('0xa2')]+=0x1;_0x51db02['countnosuchnumberretry']+=0x1;_0x51db02['countglobal']=ut[_0xfd13('0xa3')](_0x51db02);ut['logCustomer'](_0x51db02,0x0,_0xfd13('0xa4'));ami['emit']('custom:agentnosuchnumber',ut[_0xfd13('0xa5')](_0x51db02,_0xfd13('0xa6')));rpcDb[_0xfd13('0x96')](_0x51db02,_0xfd13('0xa7'));if(ut[_0xfd13('0xa3')](_0x51db02)>=_0x46397[_0xfd13('0xa8')]){_0x4a35ee=ut[_0xfd13('0xa9')](_0x51db02,0xf,_0xfd13('0xaa'));rpcDb[_0xfd13('0xab')](_0x4a35ee,_0xfd13('0xac'));}else{if(_0x51db02[_0xfd13('0xad')]>=_0x46397[_0xfd13('0xae')]){rpcDb[_0xfd13('0xab')](_0x51db02,_0xfd13('0xac'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x51db02,_0xfd13('0xad'),_0x46397[_0xfd13('0xaf')]),_0x51db02['unlockAgent'],_0x51db02['activeContact']);}}delete this[_0xfd13('0x6e')][_0x1b2670[_0xfd13('0xb0')]];break;case _0xfd13('0xb1'):var _0x3326fc=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x51db02[_0xfd13('0xb2')]=_0x3326fc;_0x51db02[_0xfd13('0xb3')]=_0x3326fc;_0x51db02['dialAnswer']=!![];_0x46397['pTalking']+=0x1;logger[_0xfd13('0x56')](_0xfd13('0xb4'),_0x51db02[_0xfd13('0xb5')],_0xfd13('0xb6'),_0x46397[_0xfd13('0x25')],'pTalking:\x20',_0x46397[_0xfd13('0x28')]);ami[_0xfd13('0x22')](_0xfd13('0xb7'),ut[_0xfd13('0xa5')](_0x51db02,_0xfd13('0xb8'),this[_0xfd13('0xf')][_0x51db02['queue']]));if(_0x46397[_0xfd13('0xb9')]){ami[_0xfd13('0x22')](_0xfd13('0xba'),ut[_0xfd13('0xbb')](_0x51db02));}break;case'16':ami['emit'](_0xfd13('0xbc'),ut['buildObj'](_0x51db02,_0xfd13('0xbd'),this[_0xfd13('0xf')][_0x51db02[_0xfd13('0x72')]]));emitVoiceQueueChannelRemove(ut[_0xfd13('0xa5')](_0x51db02,_0xfd13('0xbd')));_0x46397[_0xfd13('0xbe')]+=0x1;_0x46397[_0xfd13('0xbf')]+=0x1;_0x46397[_0xfd13('0x27')]+=0x1;ut['decrementTalkink'](_0x46397,_0xfd13('0xc0'));_0x51db02[_0xfd13('0xc1')]=ut[_0xfd13('0xa3')](_0x51db02);ut[_0xfd13('0x90')](_0x51db02,0x4,_0xfd13('0xc2'));rpcDb[_0xfd13('0x96')](_0x51db02,_0xfd13('0xc3'));rpcDb[_0xfd13('0xab')](_0x51db02,_0xfd13('0xc4'));rpcDb[_0xfd13('0xc5')](_0x51db02);_0x46397[_0xfd13('0x2a')]+=_0x51db02[_0xfd13('0xc6')];_0x46397[_0xfd13('0x29')]+=_0x51db02[_0xfd13('0xc6')];logger[_0xfd13('0x56')](_0xfd13('0xc7'),_0x51db02[_0xfd13('0xb5')],_0xfd13('0xb6'),_0x46397['name'],_0xfd13('0x73'),_0x46397[_0xfd13('0x28')]);delete this[_0xfd13('0x6e')][_0x1b2670[_0xfd13('0xb0')]];break;case _0xfd13('0xc8'):_0x46397['outboundBusyCallsDay']+=0x1;_0x51db02['countbusyretry']+=0x1;_0x51db02[_0xfd13('0xc1')]=ut[_0xfd13('0xa3')](_0x51db02);ut[_0xfd13('0x90')](_0x51db02,0x5,'Busy');ami[_0xfd13('0x22')]('custom:agentbusy',ut['buildObj'](_0x51db02,_0xfd13('0xc9')));rpcDb[_0xfd13('0x96')](_0x51db02,'[callProgressDetectingCustomer][logBusy]');if(ut[_0xfd13('0xa3')](_0x51db02)>=_0x46397[_0xfd13('0xa8')]){_0x4a35ee=ut[_0xfd13('0xa9')](_0x51db02,0xf,_0xfd13('0xaa'));rpcDb[_0xfd13('0xab')](_0x4a35ee,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x51db02['countbusyretry']>=_0x46397['dialBusyMaxRetry']){rpcDb[_0xfd13('0xab')](_0x51db02,_0xfd13('0xca'));}else{rpcDb[_0xfd13('0xcb')](ut[_0xfd13('0xcc')](_0x51db02,_0xfd13('0xcd'),_0x46397['dialBusyRetryFrequency']),_0x51db02[_0xfd13('0xce')],_0x51db02[_0xfd13('0xcf')]);}}break;case _0xfd13('0xd0'):_0x46397['outboundNoAnswerCallsDay']+=0x1;_0x51db02[_0xfd13('0xd1')]+=0x1;_0x51db02[_0xfd13('0xc1')]=ut[_0xfd13('0xa3')](_0x51db02);ut['logCustomer'](_0x51db02,0x3,'NoAnswer');ami['emit'](_0xfd13('0xd2'),ut[_0xfd13('0xa5')](_0x51db02,_0xfd13('0xd3')));rpcDb[_0xfd13('0x96')](_0x51db02,_0xfd13('0xd4'));if(ut[_0xfd13('0xa3')](_0x51db02)>=_0x46397[_0xfd13('0xa8')]){_0x4a35ee=ut['cloneAction'](_0x51db02,0xf,_0xfd13('0xaa'));rpcDb['createCustomerFinal'](_0x4a35ee,_0xfd13('0xd5'));}else{if(_0x51db02[_0xfd13('0xd1')]>=_0x46397['dialNoAnswerMaxRetry']){rpcDb[_0xfd13('0xab')](_0x51db02,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xfd13('0xcb')](ut[_0xfd13('0xcc')](_0x51db02,_0xfd13('0xd1'),_0x46397[_0xfd13('0xd6')]),_0x51db02[_0xfd13('0xce')],_0x51db02[_0xfd13('0xcf')]);}}break;case _0xfd13('0xd7'):_0x46397[_0xfd13('0x38')]+=0x1;_0x51db02[_0xfd13('0xd8')]+=0x1;_0x51db02['countglobal']=ut[_0xfd13('0xa3')](_0x51db02);ut[_0xfd13('0x90')](_0x51db02,0x8,_0xfd13('0xd9'));ami['emit'](_0xfd13('0xda'),ut[_0xfd13('0xa5')](_0x51db02,_0xfd13('0xdb')));rpcDb['createCustomerHistory'](_0x51db02,_0xfd13('0xdc'));if(ut[_0xfd13('0xa3')](_0x51db02)>=_0x46397['dialGlobalMaxRetry']){_0x4a35ee=ut[_0xfd13('0xa9')](_0x51db02,0xf,_0xfd13('0xaa'));rpcDb[_0xfd13('0xab')](_0x4a35ee,_0xfd13('0xdd'));}else{if(_0x51db02[_0xfd13('0xd8')]>=_0x46397[_0xfd13('0xde')]){rpcDb[_0xfd13('0xab')](_0x51db02,_0xfd13('0xdc'));}else{rpcDb[_0xfd13('0xcb')](ut[_0xfd13('0xcc')](_0x51db02,_0xfd13('0xd8'),_0x46397[_0xfd13('0xdf')]),_0x51db02[_0xfd13('0xce')],_0x51db02[_0xfd13('0xcf')]);}}break;case _0xfd13('0xe0'):_0x46397[_0xfd13('0x3d')]+=0x1;_0x51db02[_0xfd13('0xe1')]+=0x1;_0x51db02['countglobal']=ut['totalGlobal'](_0x51db02);ut[_0xfd13('0x90')](_0x51db02,0x14,_0xfd13('0xe2'));ami['emit'](_0xfd13('0xe3'),ut[_0xfd13('0xa5')](_0x51db02,'agentreject'));rpcDb[_0xfd13('0x96')](_0x51db02,_0xfd13('0xe4'));if(ut[_0xfd13('0xa3')](_0x51db02)>=_0x46397[_0xfd13('0xa8')]){_0x4a35ee=ut[_0xfd13('0xa9')](_0x51db02,0x14,_0xfd13('0xe2'));rpcDb['createCustomerFinal'](_0x4a35ee,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x51db02[_0xfd13('0xe1')]>=_0x46397[_0xfd13('0xe5')]){rpcDb[_0xfd13('0xab')](_0x51db02,_0xfd13('0xe6'));}else{rpcDb[_0xfd13('0xcb')](ut[_0xfd13('0xcc')](_0x51db02,_0xfd13('0xe1'),_0x46397['dialAgentRejectRetryFrequency']),_0x51db02[_0xfd13('0xce')],_0x51db02['activeContact']);}}break;case _0xfd13('0xe7'):_0x46397['outboundAbandonedCallsDay']+=0x1;_0x51db02['countabandonedretry']+=0x1;_0x51db02[_0xfd13('0xc1')]=ut['totalGlobal'](_0x51db02);ut[_0xfd13('0x90')](_0x51db02,0xb,_0xfd13('0xe8'));rpcDb['createCustomerHistory'](_0x51db02,_0xfd13('0xe9'));if(ut[_0xfd13('0xa3')](_0x51db02)>=_0x46397[_0xfd13('0xa8')]){_0x4a35ee=ut[_0xfd13('0xa9')](_0x51db02,0xf,_0xfd13('0xaa'));rpcDb['createCustomerFinal'](_0x4a35ee,_0xfd13('0xe9'));}else{if(_0x51db02[_0xfd13('0xea')]>=_0x46397[_0xfd13('0xeb')]){rpcDb[_0xfd13('0xab')](_0x51db02,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x51db02,_0xfd13('0xec'),_0x46397['dialAbandonedRetryFrequency']),_0x51db02[_0xfd13('0xce')],_0x51db02[_0xfd13('0xcf')]);}}break;case'18':_0x46397[_0xfd13('0x3e')]+=0x1;_0x51db02[_0xfd13('0xed')]+=0x1;_0x51db02[_0xfd13('0xc1')]=ut['totalGlobal'](_0x51db02);ut[_0xfd13('0x90')](_0x51db02,0x12,_0x1b2670[_0xfd13('0xee')]||_0x1b2670[_0xfd13('0xef')]);ami[_0xfd13('0x22')](_0xfd13('0xf0'),ut[_0xfd13('0xa5')](_0x51db02,_0xfd13('0xf1')));rpcDb['createCustomerHistory'](_0x51db02,_0xfd13('0xf2'));if(ut[_0xfd13('0xa3')](_0x51db02)>=_0x46397[_0xfd13('0xa8')]){_0x4a35ee=ut[_0xfd13('0xa9')](_0x51db02,0xf,_0xfd13('0xaa'));rpcDb[_0xfd13('0xab')](_0x4a35ee,_0xfd13('0xf2'));}else{rpcDb[_0xfd13('0xab')](_0x51db02,_0xfd13('0xf2'));}delete this['actions'][_0x1b2670[_0xfd13('0xb0')]];break;case'19':_0x46397[_0xfd13('0x3e')]+=0x1;_0x51db02[_0xfd13('0xc1')]=ut[_0xfd13('0xa3')](_0x51db02);ut['logCustomer'](_0x51db02,0x13,_0x1b2670[_0xfd13('0xee')]||_0x1b2670[_0xfd13('0xef')]);ami['emit'](_0xfd13('0xf0'),ut[_0xfd13('0xa5')](_0x51db02,'amd'));rpcDb[_0xfd13('0x96')](_0x51db02,_0xfd13('0xf3'));if(ut[_0xfd13('0xa3')](_0x51db02)>=_0x46397[_0xfd13('0xa8')]){_0x4a35ee=ut['cloneAction'](_0x51db02,0xf,_0xfd13('0xaa'));rpcDb[_0xfd13('0xab')](_0x4a35ee,_0xfd13('0xf3'));}else{rpcDb[_0xfd13('0xab')](_0x51db02,_0xfd13('0xf3'));}delete this[_0xfd13('0x6e')][_0x1b2670[_0xfd13('0xb0')]];break;default:if(_0x51db02['dialAnswer']){ut[_0xfd13('0x7f')](_0x46397,'[default]');ut[_0xfd13('0x82')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x46397[_0xfd13('0x25')],_0x1b2670);}_0x46397[_0xfd13('0x3e')]+=0x1;_0x51db02['countglobal']=ut[_0xfd13('0xa3')](_0x51db02);ut[_0xfd13('0x90')](_0x51db02,0xc,_0x1b2670['cause-txt']||_0x1b2670[_0xfd13('0xef')]);rpcDb[_0xfd13('0x96')](_0x51db02,'[callProgressDetectingCustomer][logUnknown]');if(ut['totalGlobal'](_0x51db02)>=_0x46397['dialGlobalMaxRetry']){_0x4a35ee=ut[_0xfd13('0xa9')](_0x51db02,0xf,_0xfd13('0xaa'));rpcDb[_0xfd13('0xab')](_0x4a35ee,_0xfd13('0xf4'));}else{rpcDb[_0xfd13('0xab')](_0x51db02,_0xfd13('0xf4'));}delete this[_0xfd13('0x6e')][_0x1b2670[_0xfd13('0xb0')]];}if(!(_0x51db02[_0xfd13('0x74')]&&_0x96b4c0==='16')){ut[_0xfd13('0x7e')](_0x46397,_0xfd13('0xf5'));logger[_0xfd13('0x56')](_0xfd13('0xf6'),_0x51db02[_0xfd13('0xb5')],_0xfd13('0xb6'),_0x46397[_0xfd13('0x25')],'originated:\x20',_0x46397[_0xfd13('0x49')]);}if(_0x96b4c0!==_0xfd13('0xb1')){delete this[_0xfd13('0x6e')][_0x1b2670[_0xfd13('0xb0')]];delete this[_0xfd13('0x6e')][_0x1b2670['destlinkedid']];}}};Preview['prototype'][_0xfd13('0xf7')]=function(_0xe25ca9,_0x197833,_0x149077){if(_[_0xfd13('0xf8')](_0x197833)&&_0xfd13('0xf9')!==typeof _0x197833){return;}if(_[_0xfd13('0xf8')](_0x149077)&&_0xfd13('0xf9')!==typeof _0x149077){return;}switch(_0x149077[_0xfd13('0xfa')]){case'0':ut['logAgent'](_0xe25ca9,0x0,'NoSuchNumber');rpcDb[_0xfd13('0xfb')](_0xe25ca9,_0xfd13('0xfc'));break;case'3':ut['logAgent'](_0xe25ca9,0x3,_0xfd13('0xfd'));rpcDb[_0xfd13('0xfb')](_0xe25ca9,_0xfd13('0xfe'));break;case'5':ut[_0xfd13('0xff')](_0xe25ca9,0x5,_0xfd13('0x100'));rpcDb[_0xfd13('0xfb')](_0xe25ca9,_0xfd13('0x101'));break;case'8':ut['logAgent'](_0xe25ca9,0x8,_0xfd13('0xd9'));rpcDb[_0xfd13('0xfb')](_0xe25ca9,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0xfd13('0xff')](_0xe25ca9,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0xe25ca9,_0xfd13('0x102'));break;default:ut[_0xfd13('0xff')](_0xe25ca9,0xc,_0x149077['reason']);rpcDb[_0xfd13('0xfb')](_0xe25ca9,_0xfd13('0x103'));}ut[_0xfd13('0x7e')](_0x197833,'[callProgressDetectingAgent]');logger[_0xfd13('0x56')](_0xfd13('0x104'),_0xe25ca9[_0xfd13('0xb5')],'\x20Queue',_0x197833['name'],_0xfd13('0x71'),_0x197833[_0xfd13('0x49')]);delete this[_0xfd13('0x6e')][_0xe25ca9['uniqueid']];};Preview['prototype'][_0xfd13('0x105')]=function(_0xa70d06,_0x15b670,_0x5f4b43,_0x5a2c3b,_0x35d5d8){var _0x4ebac0=this;return new BPromise(function(_0x447982,_0x2893f3){if(_[_0xfd13('0x6d')](_0x15b670)||_[_0xfd13('0x6d')](_0x15b670[_0xfd13('0x106')])||_[_0xfd13('0x6d')](_0x15b670[_0xfd13('0x106')][_0xfd13('0x107')])||_[_0xfd13('0x6d')](_0x15b670[_0xfd13('0x78')])){_0x2893f3(ut['message']('Contact\x20is\x20undefined',_0x5a2c3b,_0x35d5d8));return;}var _0x36e075=uuid['v4']();var _0x1f940b=_0x4ebac0[_0xfd13('0xf')][_0x15b670['Queue']['name']];var _0x4e2fba=_0x5f4b43?_0x4ebac0[_0xfd13('0x85')][_0x5f4b43]['id']:undefined;_0x4ebac0[_0xfd13('0x6e')][_0x36e075]=new Action(_0x15b670,_0x1f940b,_0x36e075,_0x5f4b43,_0x4e2fba);var _0x4a8e85=_0x4ebac0[_0xfd13('0x6e')][_0x36e075];_0x4a8e85[_0xfd13('0xce')]=_0x5a2c3b;_0x4a8e85[_0xfd13('0xcf')]=_0x35d5d8;_0x4a8e85[_0xfd13('0x108')]=_0x5f4b43;if(_[_0xfd13('0x109')](_0xa70d06)){_0x4ebac0['execCall'](_0x4a8e85,_0x1f940b,_0x15b670,_0x5f4b43)['then'](function(_0x5c7b97){logger[_0xfd13('0x56')](_0xfd13('0x10a'),'Queue:\x20'+_0x4a8e85[_0xfd13('0x72')]+_0xfd13('0x10b')+_0x4a8e85[_0xfd13('0x10c')],JSON[_0xfd13('0x58')](_0x5c7b97));ami['emit']('custom:agentcalled',ut['buildObj'](_0x4a8e85,'called',_0x4ebac0[_0xfd13('0xf')][_0x4a8e85[_0xfd13('0x72')]]));_0x447982(ut[_0xfd13('0x48')](_0xfd13('0x10d')));})['catch'](function(_0x40d8ef){ut['logger']('[Preview][execCall][failure]',_0x40d8ef);_0x2893f3(ut[_0xfd13('0x48')](_0xfd13('0x10e'),_0x5a2c3b,_0x35d5d8));});}else{_0x1f940b[_0xfd13('0x36')]+=0x1;ut[_0xfd13('0x10f')](_0x4a8e85);rpcDb[_0xfd13('0x110')](_0x4a8e85,_0xfd13('0x111'));delete _0x4ebac0[_0xfd13('0x6e')][_0x36e075];_0x2893f3(ut['message']('Contact\x20in\x20black\x20List',_0x5a2c3b,_0x35d5d8));}});};Preview[_0xfd13('0x63')][_0xfd13('0x9e')]=function(_0xe31420){return!_['isNil'](_0xe31420)&&!_[_0xfd13('0x6d')](_0xe31420['name'])&&!_['isNil'](_0xe31420[_0xfd13('0x51')])&&_0xe31420[_0xfd13('0x51')]&&!_[_0xfd13('0x6d')](this[_0xfd13('0x11')][util[_0xfd13('0x59')](_0xfd13('0x112'),_0xe31420[_0xfd13('0x25')])])&&!_[_0xfd13('0x6d')](this[_0xfd13('0x11')][util['format']('SIP/%s',_0xe31420['name'])]['status'])&&(this[_0xfd13('0x11')][util[_0xfd13('0x59')](_0xfd13('0x112'),_0xe31420['name'])][_0xfd13('0x7b')]===_0xfd13('0x113')||this['trunks'][util[_0xfd13('0x59')](_0xfd13('0x112'),_0xe31420[_0xfd13('0x25')])][_0xfd13('0x7b')]==='unmonitored');};Preview[_0xfd13('0x63')]['run']=function(_0x1a6ac4,_0x6b2229){var _0x3eb7b9=this;return new BPromise(function(_0x9dbdf3,_0x5e230c){_0x3eb7b9['execRun'](_0x1a6ac4,_0x6b2229)[_0xfd13('0x86')](function(_0xe2245f){_0x9dbdf3(_[_0xfd13('0x75')](_0xe2245f,[_0xfd13('0x48')]));})['catch'](function(_0x24c8eb){if(_0x24c8eb[_0xfd13('0x114')]){rpcDb[_0xfd13('0x115')](_0x1a6ac4);}if(_0x24c8eb['active']){rpcDb[_0xfd13('0x8d')](_0x1a6ac4);}_0x5e230c(_['pick'](_0x24c8eb,[_0xfd13('0x48')]));});});};Preview[_0xfd13('0x63')]['execRun']=function(_0x19aec1,_0x19a15c){var _0x376ddd=this;return new BPromise(function(_0x19cdfe,_0x4371eb){var _0x3ce9d4,_0x5d09dc;rpcDb[_0xfd13('0x116')](_0x19aec1)[_0xfd13('0x86')](function(_0x2f0e31){if(!_['isNil'](_0x2f0e31[0x0])){_0x5d09dc=_0x2f0e31[0x0][_0xfd13('0x117')]?![]:!![];_0x3ce9d4=_0x2f0e31[0x0][_0xfd13('0x117')]?!![]:![];_0x3ce9d4=_0x19a15c?!![]:_0x3ce9d4;}var _0x60d532=_0x376ddd['validateContact'](_0x2f0e31);if(_0x60d532[_0xfd13('0x118')]){rpcDb[_0xfd13('0x119')](_[_0xfd13('0x75')](_0x2f0e31[0x0],[_0xfd13('0x78'),_0xfd13('0x11a')]))[_0xfd13('0x86')](function(_0x4d1714){_0x376ddd[_0xfd13('0x105')](_0x4d1714,_0x2f0e31[0x0],_0x19a15c,_0x5d09dc,_0x3ce9d4)[_0xfd13('0x86')](function(_0x4b9087){_0x19cdfe(_0x4b9087);})[_0xfd13('0x7d')](function(_0x2d6826){_0x4371eb(_0x2d6826);});})['catch'](function(_0x10b1e5){ut['logger']('[Preview][checkIsBlackList]',_0x10b1e5);_0x4371eb(ut[_0xfd13('0x48')]('Call\x20unsuccessful',_0x5d09dc,_0x3ce9d4));});}else{_0x4371eb(ut[_0xfd13('0x48')](_0x60d532[_0xfd13('0x48')],_0x5d09dc,_0x3ce9d4));}})[_0xfd13('0x7d')](function(_0x336508){ut['logger']('[Preview][getContactPreview]',_0x336508);_0x4371eb(ut[_0xfd13('0x48')](_0xfd13('0x11b'),![],!![]));});});};Preview[_0xfd13('0x63')][_0xfd13('0x11c')]=function(_0x2c2fd1){if(_[_0xfd13('0x6d')](_0x2c2fd1)||_[_0xfd13('0x109')](_0x2c2fd1)||!_['isNil'](_0x2c2fd1[0x0][_0xfd13('0x11d')])&&_[_0xfd13('0x6d')](_0x2c2fd1[0x0][_0xfd13('0x11d')][_0xfd13('0x25')])){ut[_0xfd13('0x61')](_0xfd13('0x11e'),_0x2c2fd1);return{'isValid':![],'message':_0xfd13('0x11f')};}var _0xd36f23=this[_0xfd13('0xf')][_0x2c2fd1[0x0][_0xfd13('0x70')][_0xfd13('0x25')]];_0xd36f23[_0xfd13('0x48')]=_0xfd13('0xa0');if(_['isNil'](_0xd36f23)){ut['logger'](_0xfd13('0x120'),_0xd36f23);return{'isValid':![],'message':_0xfd13('0x121')};}if(!this[_0xfd13('0x9e')](_0xd36f23[_0xfd13('0x50')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0xfd13('0x122')+_0xd36f23[_0xfd13('0x25')]+_0xfd13('0x123'));if(!this[_0xfd13('0x9e')](_0xd36f23['TrunkBackup'])){ut[_0xfd13('0x61')](_0xfd13('0x124'),_0xd36f23[_0xfd13('0x25')]+_0xfd13('0x125'));return{'isValid':![],'message':_0xfd13('0x126')};}}if(!ut[_0xfd13('0x9c')](_0xd36f23[_0xfd13('0x2f')])){ut['logger'](_0xfd13('0x127'),_0xd36f23['name']+_0xfd13('0x128'));return{'isValid':![],'message':_0xfd13('0x122')+_0xd36f23[_0xfd13('0x25')]+_0xfd13('0x128')};}return{'isValid':!![],'message':_0xfd13('0x129')};};Preview['prototype'][_0xfd13('0x12a')]=function(_0x57d644,_0x3bb2cc,_0x34f25a,_0x4468e3){var _0x167156=this;return new BPromise(function(_0x1a5a98,_0x358a31){var _0x19a50e=_0x57d644[_0xfd13('0xb5')];var _0x4967bf=_0x167156[_0xfd13('0x9e')](_0x3bb2cc[_0xfd13('0x50')])?util[_0xfd13('0x59')](_0xfd13('0x12b'),_0x3bb2cc[_0xfd13('0x50')][_0xfd13('0x25')],_[_0xfd13('0x6d')](_0x3bb2cc['dialPrefix'])?'':_0x3bb2cc['dialPrefix'][_0xfd13('0x12c')]()||'',_0x3bb2cc[_0xfd13('0x12d')]>0x0?_0x34f25a[_0xfd13('0x106')][_0xfd13('0x107')][_0xfd13('0x12e')](_0x3bb2cc[_0xfd13('0x12d')]):_0x34f25a[_0xfd13('0x106')][_0xfd13('0x107')]):util[_0xfd13('0x59')](_0xfd13('0x12b'),_[_0xfd13('0x6d')](_0x3bb2cc[_0xfd13('0x9f')])?_0x3bb2cc[_0xfd13('0x50')]['name']:_0x3bb2cc[_0xfd13('0x9f')][_0xfd13('0x25')],_[_0xfd13('0x6d')](_0x3bb2cc[_0xfd13('0x34')])?'':_0x3bb2cc['dialPrefix'][_0xfd13('0x12c')]()||'',_0x3bb2cc['dialCutDigit']>0x0?_0x34f25a['Contact'][_0xfd13('0x107')][_0xfd13('0x12e')](_0x3bb2cc['dialCutDigit']):_0x34f25a['Contact'][_0xfd13('0x107')]);var _0x245b5a=_0x167156[_0xfd13('0x9e')](_0x3bb2cc[_0xfd13('0x50')])?ut[_0xfd13('0x12f')](_0x3bb2cc[_0xfd13('0x50')][_0xfd13('0x52')],_0x3bb2cc[_0xfd13('0x31')],_0x3bb2cc['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xfd13('0x130')](_0x3bb2cc[_0xfd13('0x32')],_0x3bb2cc[_0xfd13('0x131')]):_0x3bb2cc['dialOriginateCallerIdNumber']):ut[_0xfd13('0x12f')](_[_0xfd13('0x6d')](_0x3bb2cc[_0xfd13('0x9f')])?_0x3bb2cc['Trunk'][_0xfd13('0x52')]:_0x3bb2cc[_0xfd13('0x9f')][_0xfd13('0x52')],_0x3bb2cc[_0xfd13('0x31')],_0x3bb2cc['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xfd13('0x130')](_0x3bb2cc[_0xfd13('0x32')],_0x3bb2cc[_0xfd13('0x131')]):_0x3bb2cc[_0xfd13('0x32')]);if(_0x245b5a){_0x57d644[_0xfd13('0x132')]=ut['extractCalleridName'](_0x245b5a);_0x57d644[_0xfd13('0x133')]=ut[_0xfd13('0x134')](_0x245b5a);}var _0xafa0a8=ut[_0xfd13('0x135')](_0x3bb2cc,_0x34f25a,_0x4967bf,_0x245b5a,_0x19a50e,_0x57d644);_[_0xfd13('0x136')](_0x57d644,ut[_0xfd13('0x137')](_0xafa0a8));_0x57d644[_0xfd13('0x8e')]=moment()[_0xfd13('0x59')]('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut[_0xfd13('0x138')](_0x57d644,_0x3bb2cc,_0xafa0a8,_0x57d644[_0xfd13('0xcf')],_0x4468e3))[_0xfd13('0x86')](function(_0x4e50a3){var _0x50d734=_0x57d644[_0xfd13('0x139')];if(!_[_0xfd13('0x6d')](_0x50d734)){if(!_[_0xfd13('0x6d')](_0x167156[_0xfd13('0x85')][_0x50d734])){_0x167156[_0xfd13('0x85')][_0x50d734]['destconnectedlinenum']=_0x57d644[_0xfd13('0x13a')];emit(util[_0xfd13('0x59')](_0xfd13('0x13b'),_0x167156[_0xfd13('0x85')][_0x50d734][_0xfd13('0x25')]),'user:agentconnect',{'destaccountcode':_0x167156['agents'][_0x50d734]['accountcode'],'destconnectedlinenum':_0x57d644['calleridnum']});}}_0x3bb2cc[_0xfd13('0x49')]+=0x1;logger['info']('[originated][increment]',_0x19a50e,_0xfd13('0xb6'),_0x3bb2cc[_0xfd13('0x25')],_0xfd13('0x71'),_0x3bb2cc[_0xfd13('0x49')]);_0x1a5a98(_0x4e50a3);})[_0xfd13('0x7d')](function(_0x337fd1){ut['logAgent'](_0x57d644,0xe,_0xfd13('0x13c'));rpcDb[_0xfd13('0xfb')](_0x57d644,_0xfd13('0x13d'));_0x358a31(_0x337fd1);});});};Preview[_0xfd13('0x63')][_0xfd13('0x1a')]=function(_0xe60a6f){if(this['actions'][_0xe60a6f[_0xfd13('0xb0')]]){this['actions'][_0xe60a6f[_0xfd13('0xb0')]][_0xfd13('0x7c')]=_0xe60a6f[_0xfd13('0x7c')];}};Preview['prototype'][_0xfd13('0x13')]=function(_0x2fdf93){var _0x1e652c=this;var _0x6274d8=this['actions'][_0x2fdf93[_0xfd13('0x13e')]];if(_0x6274d8){if(_0x6274d8[_0xfd13('0x108')]&&this[_0xfd13('0x85')][_0x6274d8[_0xfd13('0x108')]]){ut[_0xfd13('0x13f')](_0x6274d8,this['agents'][_0x6274d8['lookAgent']][_0xfd13('0x25')],this['agents'][_0x6274d8['lookAgent']]['id']);}var _0x3d3b92=_[_0xfd13('0x140')](_0x6274d8);_0x3d3b92[_0xfd13('0xb2')]=moment()[_0xfd13('0x59')](_0xfd13('0x8f'));var _0x1dcb1f=_0x1e652c[_0xfd13('0xf')][_0x6274d8['queue']];if(ut['isFailure'](_0x2fdf93[_0xfd13('0x141')])){if(_0x6274d8[_0xfd13('0xce')]){rpcDb['unlockContact'](_0x6274d8[_0xfd13('0x10c')]);}if(_0x6274d8[_0xfd13('0xcf')]){rpcDb[_0xfd13('0x8d')](_0x6274d8[_0xfd13('0x10c')]);}ami[_0xfd13('0x22')](_0xfd13('0x142'),ut[_0xfd13('0xa5')](_0x6274d8,_0xfd13('0x143'),this[_0xfd13('0xf')][_0x6274d8[_0xfd13('0x72')]]));this[_0xfd13('0xf7')](_0x3d3b92,_0x1dcb1f,_0x2fdf93);}else{_0x6274d8[_0xfd13('0x8e')]=moment()['format'](_0xfd13('0x8f'));ut[_0xfd13('0xff')](_0x3d3b92,0x4,_0xfd13('0xc2'));rpcDb[_0xfd13('0xfb')](_0x3d3b92,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0xfd13('0x63')][_0xfd13('0x15')]=function(_0x8c7c86){var _0x4b4b44=this;var _0x51d2ea=this[_0xfd13('0x6e')][_0x8c7c86[_0xfd13('0xb0')]];var _0x567040;if(_0x51d2ea){_0x567040=this[_0xfd13('0xf')][_0x51d2ea[_0xfd13('0x72')]];logger[_0xfd13('0x56')](_0xfd13('0x144'),_0x8c7c86[_0xfd13('0xb0')],_0xfd13('0xb6'),_0x567040[_0xfd13('0x25')],_0xfd13('0x73'),_0x567040[_0xfd13('0x28')]);}if(this[_0xfd13('0x6e')][_0x8c7c86[_0xfd13('0xb0')]]&&_0x8c7c86[_0xfd13('0xb0')]!==_0x8c7c86[_0xfd13('0xb5')]){if(_0x8c7c86[_0xfd13('0x145')]==='16'&&this['actions'][_0x8c7c86[_0xfd13('0xb0')]]['dialAnswer']){this[_0xfd13('0xa1')](_0x8c7c86,_0x8c7c86[_0xfd13('0xb0')],_0x8c7c86[_0xfd13('0x145')]);}else if(this[_0xfd13('0x6e')][_0x8c7c86['linkedid']][_0xfd13('0x74')]){logger[_0xfd13('0x56')](_0xfd13('0x146'),_0x8c7c86[_0xfd13('0xb0')],_0x8c7c86[_0xfd13('0x145')],_0xfd13('0xb6'),_0x567040[_0xfd13('0x25')],'pTalking:\x20',_0x567040[_0xfd13('0x28')]);this['callProgressDetectingCustomer'](_0x8c7c86,_0x8c7c86['linkedid'],_0x8c7c86[_0xfd13('0x145')]);}}else if(_0x51d2ea&&_['isNil'](_0x51d2ea[_0xfd13('0x147')])&&_0x567040[_0xfd13('0x148')]&&_0x8c7c86[_0xfd13('0xb0')]===_0x8c7c86[_0xfd13('0xb5')]&&_['isNil'](_0x8c7c86[_0xfd13('0xfa')])&&_0x8c7c86['cause']==='16'&&_0x8c7c86[_0xfd13('0x149')]==='6'&&_[_0xfd13('0xf8')](_0x51d2ea[_0xfd13('0x14a')])){if(_0x51d2ea[_0xfd13('0xce')]){rpcDb[_0xfd13('0x115')](_0x51d2ea[_0xfd13('0x10c')]);}if(_0x51d2ea[_0xfd13('0xcf')]){rpcDb[_0xfd13('0x8d')](_0x51d2ea[_0xfd13('0x10c')]);}_0x8c7c86['reason']='22';this[_0xfd13('0xf7')](_0x51d2ea,_0x567040,_0x8c7c86);}else if(_0x51d2ea&&_0x51d2ea[_0xfd13('0x14a')]){if(_0x8c7c86[_0xfd13('0x145')]==='16'&&this[_0xfd13('0x6e')][_0x8c7c86[_0xfd13('0xb0')]][_0xfd13('0x74')]){logger['info'](_0xfd13('0x14b'),_0x8c7c86[_0xfd13('0xb0')],_0x8c7c86[_0xfd13('0x145')],_0xfd13('0xb6'),_0x567040[_0xfd13('0x25')],_0xfd13('0x73'),_0x567040[_0xfd13('0x28')]);this[_0xfd13('0xa1')](_0x8c7c86,_0x8c7c86[_0xfd13('0xb0')],_0x8c7c86[_0xfd13('0x145')]);}else if(this[_0xfd13('0x6e')][_0x8c7c86[_0xfd13('0xb0')]]['dialAnswer']){logger[_0xfd13('0x56')]('[syncHangup][talking][cause]',_0x8c7c86[_0xfd13('0xb0')],_0x8c7c86[_0xfd13('0x145')],_0xfd13('0xb6'),_0x567040[_0xfd13('0x25')],_0xfd13('0x73'),_0x567040[_0xfd13('0x28')]);this[_0xfd13('0xa1')](_0x8c7c86,_0x8c7c86[_0xfd13('0xb0')],_0x8c7c86['cause']);}}};Preview[_0xfd13('0x63')][_0xfd13('0x18')]=function(_0x3cc66d){if(this[_0xfd13('0x6e')][_0x3cc66d[_0xfd13('0x14c')]]&&_0x3cc66d[_0xfd13('0x14c')]!==_0x3cc66d[_0xfd13('0x14d')]){this['callProgressDetectingCustomer'](_0x3cc66d,_0x3cc66d['destlinkedid'],_0x3cc66d[_0xfd13('0xef')]);}};Preview[_0xfd13('0x63')][_0xfd13('0x17')]=function(_0x59d07c){if(this[_0xfd13('0x6e')][_0x59d07c[_0xfd13('0xb0')]]&&_0x59d07c[_0xfd13('0xb0')]!==_0x59d07c['uniqueid']&&!this[_0xfd13('0x6e')][_0x59d07c[_0xfd13('0xb0')]][_0xfd13('0x74')]){if(_0x59d07c['cause']==='1'){this[_0xfd13('0xa1')](_0x59d07c,_0x59d07c[_0xfd13('0xb0')],_0x59d07c['cause']);}}};Preview[_0xfd13('0x63')][_0xfd13('0x14e')]=function(_0x335bf5,_0x110bd7,_0xf34369){if(this[_0xfd13('0x6e')][_0x335bf5]){if(_[_0xfd13('0x6d')](this[_0xfd13('0x6e')][_0x335bf5][_0xfd13('0x14f')])){this[_0xfd13('0x6e')][_0x335bf5]['variables']={};}this[_0xfd13('0x6e')][_0x335bf5]['variables'][_0x110bd7]=_0xf34369;}};Preview[_0xfd13('0x63')]['syncVarSet']=function(_0xe8a6c1){try{if(!_['isNil'](_0xe8a6c1)){if(ut['filterKey'](_[_0xfd13('0x150')](_0xe8a6c1[_0xfd13('0x151')])[0x0])){this[_0xfd13('0x14e')](_0xe8a6c1[_0xfd13('0xb5')],_['keys'](_0xe8a6c1[_0xfd13('0x151')])[0x0],_0xe8a6c1[_0xfd13('0x152')]);}}}catch(_0x472489){logger['error'](_0xfd13('0x153'),util[_0xfd13('0x154')](_0x472489,{'showHidden':![],'depth':null}));}};Preview[_0xfd13('0x63')][_0xfd13('0x1e')]=function(_0x1c4665){if(_0x1c4665){if(this['actions'][_0x1c4665['transfertargetlinkedid']]){this[_0xfd13('0x6e')][_0x1c4665['transfertargetlinkedid']][_0xfd13('0x14a')]=!![];}}};Preview['prototype'][_0xfd13('0x20')]=function(_0x5aa102){if(_0x5aa102){if(this['actions'][_0x5aa102[_0xfd13('0x155')]]){this[_0xfd13('0x6e')][_0x5aa102[_0xfd13('0x155')]][_0xfd13('0x14a')]=!![];}}};module[_0xfd13('0x156')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index b137301..068a09a 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 _0x67bd=['endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','then','catch','resolve','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercompleteAt'];(function(_0xee9c80,_0x10bca8){var _0x214cce=function(_0x3253bb){while(--_0x3253bb){_0xee9c80['push'](_0xee9c80['shift']());}};_0x214cce(++_0x10bca8);}(_0x67bd,0xb9));var _0xd67b=function(_0x4aac1b,_0x4680f3){_0x4aac1b=_0x4aac1b-0x0;var _0x19fd33=_0x67bd[_0x4aac1b];return _0x19fd33;};'use strict';var util=require(_0xd67b('0x0'));var BPromise=require(_0xd67b('0x1'));var logger=require(_0xd67b('0x2'))(_0xd67b('0x3'));var _=require(_0xd67b('0x4'));var cmHopper=require(_0xd67b('0x5'));var cmHopperFinal=require(_0xd67b('0x6'));var cmHopperHistory=require(_0xd67b('0x7'));var cmHopperBlack=require(_0xd67b('0x8'));var voiceQueueRt=require(_0xd67b('0x9'));var agentReportPreview=require(_0xd67b('0xa'));var voiceQueueReport=require(_0xd67b('0xb'));function loggerCatch(_0x5d2a60){return function(_0x576244){logger[_0xd67b('0xc')](_0x5d2a60,util[_0xd67b('0xd')](_0x576244,{'showHidden':![],'depth':null}));};}function create(_0x4fa894){return BPromise['resolve']()[_0xd67b('0xe')](cmHopperHistory['createHistory'](_0x4fa894))[_0xd67b('0xf')](loggerCatch('[createHistory]\x20'));}function createAgent(_0xadab6e){return BPromise[_0xd67b('0x10')]()[_0xd67b('0xe')](agentReportPreview['createHistory'](_0xadab6e))[_0xd67b('0xf')](loggerCatch(_0xd67b('0x11')));}function moveContact(_0x2986a3){return BPromise['resolve']()['then'](cmHopper[_0xd67b('0x12')](_0x2986a3,!![]))[_0xd67b('0xf')](loggerCatch(_0xd67b('0x13')));}exports[_0xd67b('0x14')]=function(_0x1fd930){return BPromise['resolve']()[_0xd67b('0xe')](cmHopperBlack['checkIsBlackList'](_0x1fd930))[_0xd67b('0xf')](loggerCatch(_0xd67b('0x15')));};exports[_0xd67b('0x16')]=function(_0x32a9a8){return BPromise[_0xd67b('0x10')]()[_0xd67b('0xe')](cmHopper['getContactPreview'](_0x32a9a8))[_0xd67b('0xf')](loggerCatch(_0xd67b('0x17')));};exports['createHistory']=function(_0x5585b2,_0x423b71){create(_0x5585b2)[_0xd67b('0xf')](loggerCatch(_0x423b71));moveContact(_0x5585b2)[_0xd67b('0xf')](loggerCatch(_0x423b71));};exports[_0xd67b('0x18')]=function(_0x24f485,_0x354654){createAgent(_0x24f485)[_0xd67b('0xf')](loggerCatch(_0x354654));};exports[_0xd67b('0x19')]=function(_0x4e6607,_0x1cd72b){create(_0x4e6607)[_0xd67b('0xf')](loggerCatch(_0x1cd72b));};exports[_0xd67b('0x1a')]=function(_0x25e4ad,_0x4fb51e){moveContact(_0x25e4ad)[_0xd67b('0xf')](loggerCatch(_0x4fb51e));};exports[_0xd67b('0x1b')]=function(_0x5caeb1,_0x4a4a31,_0x288b6c){if(_0x4a4a31){_0x5caeb1[_0xd67b('0x1c')]=null;}if(_0x288b6c){_0x5caeb1[_0xd67b('0x1d')]=![];}return BPromise[_0xd67b('0x10')]()[_0xd67b('0xe')](cmHopper[_0xd67b('0x1b')](_0x5caeb1))['catch'](loggerCatch(_0xd67b('0x1e')));};exports[_0xd67b('0x1f')]=function(_0x5815e4){return BPromise[_0xd67b('0x10')]()[_0xd67b('0xe')](cmHopper[_0xd67b('0x1f')](_0x5815e4))[_0xd67b('0xf')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x2b0645){return BPromise[_0xd67b('0x10')]()[_0xd67b('0xe')](cmHopper['unlockContact']({'UserId':null},_0x2b0645,0x1))[_0xd67b('0xf')](loggerCatch(_0xd67b('0x20')));};exports['disableContact']=function(_0x1c46b5){return BPromise[_0xd67b('0x10')]()[_0xd67b('0xe')](cmHopper['unlockContact']({'active':![]},_0x1c46b5,0x1))[_0xd67b('0xf')](loggerCatch(_0xd67b('0x21')));};exports[_0xd67b('0x22')]=function(_0xd220ea){var _0xd7ff96={};_0xd7ff96['type']=_0xd220ea['type'];_0xd7ff96[_0xd67b('0x23')]=_0xd220ea[_0xd67b('0x23')];_0xd7ff96['calleridnum']=_0xd220ea[_0xd67b('0x24')];_0xd7ff96[_0xd67b('0x25')]=_0xd220ea[_0xd67b('0x25')];_0xd7ff96[_0xd67b('0x26')]=_0xd220ea[_0xd67b('0x26')];_0xd7ff96[_0xd67b('0x27')]=_0xd220ea['answertime'];_0xd7ff96[_0xd67b('0x28')]=_0xd220ea[_0xd67b('0x29')];_0xd7ff96['queuecallercomplete']=0x1;_0xd7ff96[_0xd67b('0x2a')]=_0xd220ea[_0xd67b('0x2b')];_0xd7ff96[_0xd67b('0x2c')]=_0xd220ea[_0xd67b('0x2d')];_0xd7ff96[_0xd67b('0x2e')]=_0xd67b('0x2f');_0xd7ff96[_0xd67b('0x30')]=_0xd67b('0x31');_0xd7ff96[_0xd67b('0x32')]=0x0;_0xd7ff96[_0xd67b('0x33')]=0x1;_0xd7ff96[_0xd67b('0x34')]=_0xd220ea[_0xd67b('0x2d')];_0xd7ff96['queuecallerexitreason']='COMPLETED';return BPromise[_0xd67b('0x10')]()['then'](voiceQueueReport[_0xd67b('0x35')](_0xd7ff96))['catch'](loggerCatch(_0xd67b('0x36')));};exports[_0xd67b('0x37')]=function(_0x30834f,_0xa094c6){return BPromise[_0xd67b('0x10')]()[_0xd67b('0xe')](cmHopper[_0xd67b('0x37')](_0x30834f,_0xa094c6))[_0xd67b('0xf')](loggerCatch(_0xd67b('0x38')));};exports['rescheduleContactInQueue']=function(_0x4c8d31){return BPromise[_0xd67b('0x10')]()['then'](cmHopper['rescheduleContact'](_0x4c8d31,!![],!![]))['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xae76=['rescheduleContactInQueue','rescheduleContact','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','then','createHistory','catch','[createHistory]\x20','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerFinal','UserId','active','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20'];(function(_0x3c509d,_0x45f50d){var _0x5d30ed=function(_0x3b98e1){while(--_0x3b98e1){_0x3c509d['push'](_0x3c509d['shift']());}};_0x5d30ed(++_0x45f50d);}(_0xae76,0x1c3));var _0x6ae7=function(_0x2f938f,_0x923379){_0x2f938f=_0x2f938f-0x0;var _0x360c98=_0xae76[_0x2f938f];return _0x360c98;};'use strict';var util=require(_0x6ae7('0x0'));var BPromise=require('bluebird');var logger=require(_0x6ae7('0x1'))(_0x6ae7('0x2'));var _=require('lodash');var cmHopper=require(_0x6ae7('0x3'));var cmHopperFinal=require(_0x6ae7('0x4'));var cmHopperHistory=require(_0x6ae7('0x5'));var cmHopperBlack=require(_0x6ae7('0x6'));var voiceQueueRt=require(_0x6ae7('0x7'));var agentReportPreview=require(_0x6ae7('0x8'));var voiceQueueReport=require(_0x6ae7('0x9'));function loggerCatch(_0x5db856){return function(_0x22bf0b){logger[_0x6ae7('0xa')](_0x5db856,util['inspect'](_0x22bf0b,{'showHidden':![],'depth':null}));};}function create(_0x42d36a){return BPromise['resolve']()[_0x6ae7('0xb')](cmHopperHistory[_0x6ae7('0xc')](_0x42d36a))[_0x6ae7('0xd')](loggerCatch(_0x6ae7('0xe')));}function createAgent(_0x19098a){return BPromise[_0x6ae7('0xf')]()[_0x6ae7('0xb')](agentReportPreview[_0x6ae7('0xc')](_0x19098a))[_0x6ae7('0xd')](loggerCatch(_0x6ae7('0xe')));}function moveContact(_0x29baaa){return BPromise[_0x6ae7('0xf')]()[_0x6ae7('0xb')](cmHopper[_0x6ae7('0x10')](_0x29baaa,!![]))['catch'](loggerCatch(_0x6ae7('0x11')));}exports[_0x6ae7('0x12')]=function(_0x94e3d){return BPromise[_0x6ae7('0xf')]()[_0x6ae7('0xb')](cmHopperBlack[_0x6ae7('0x12')](_0x94e3d))[_0x6ae7('0xd')](loggerCatch(_0x6ae7('0x13')));};exports[_0x6ae7('0x14')]=function(_0x4c4ef2){return BPromise[_0x6ae7('0xf')]()['then'](cmHopper[_0x6ae7('0x14')](_0x4c4ef2))[_0x6ae7('0xd')](loggerCatch(_0x6ae7('0x15')));};exports['createHistory']=function(_0x279687,_0x22f293){create(_0x279687)[_0x6ae7('0xd')](loggerCatch(_0x22f293));moveContact(_0x279687)['catch'](loggerCatch(_0x22f293));};exports['createAgentHistory']=function(_0x402b1e,_0x449c80){createAgent(_0x402b1e)['catch'](loggerCatch(_0x449c80));};exports['createCustomerHistory']=function(_0x343a83,_0x21659f){create(_0x343a83)['catch'](loggerCatch(_0x21659f));};exports[_0x6ae7('0x16')]=function(_0x510ad7,_0x3349ee){moveContact(_0x510ad7)[_0x6ae7('0xd')](loggerCatch(_0x3349ee));};exports['rescheduleContact']=function(_0x4b9cc5,_0x3e1323,_0x35f484){if(_0x3e1323){_0x4b9cc5[_0x6ae7('0x17')]=null;}if(_0x35f484){_0x4b9cc5[_0x6ae7('0x18')]=![];}return BPromise[_0x6ae7('0xf')]()['then'](cmHopper['rescheduleContact'](_0x4b9cc5))[_0x6ae7('0xd')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x6ae7('0x19')]=function(_0x381ebb){return BPromise[_0x6ae7('0xf')]()[_0x6ae7('0xb')](cmHopper['countReScheduled'](_0x381ebb))[_0x6ae7('0xd')](loggerCatch('[countReScheduled]\x20'));};exports[_0x6ae7('0x1a')]=function(_0x56f3ee){return BPromise[_0x6ae7('0xf')]()[_0x6ae7('0xb')](cmHopper[_0x6ae7('0x1a')]({'UserId':null},_0x56f3ee,0x1))[_0x6ae7('0xd')](loggerCatch(_0x6ae7('0x1b')));};exports[_0x6ae7('0x1c')]=function(_0x468b47){return BPromise[_0x6ae7('0xf')]()[_0x6ae7('0xb')](cmHopper[_0x6ae7('0x1a')]({'active':![]},_0x468b47,0x1))['catch'](loggerCatch(_0x6ae7('0x1d')));};exports[_0x6ae7('0x1e')]=function(_0xc66594){var _0x4ff646={};_0x4ff646[_0x6ae7('0x1f')]=_0xc66594[_0x6ae7('0x1f')];_0x4ff646[_0x6ae7('0x20')]=_0xc66594['uniqueid'];_0x4ff646[_0x6ae7('0x21')]=_0xc66594[_0x6ae7('0x21')];_0x4ff646[_0x6ae7('0x22')]=_0xc66594[_0x6ae7('0x22')];_0x4ff646[_0x6ae7('0x23')]=_0xc66594['queue'];_0x4ff646[_0x6ae7('0x24')]=_0xc66594[_0x6ae7('0x25')];_0x4ff646['queuecallerleaveAt']=_0xc66594['answertime'];_0x4ff646[_0x6ae7('0x26')]=0x1;_0x4ff646[_0x6ae7('0x27')]=_0xc66594[_0x6ae7('0x28')];_0x4ff646[_0x6ae7('0x29')]=_0xc66594[_0x6ae7('0x2a')];_0x4ff646['context']=_0x6ae7('0x2b');_0x4ff646[_0x6ae7('0x2c')]=_0x6ae7('0x2d');_0x4ff646['holdtime']=0x0;_0x4ff646[_0x6ae7('0x2e')]=0x1;_0x4ff646[_0x6ae7('0x2f')]=_0xc66594['membername'];_0x4ff646[_0x6ae7('0x30')]=_0x6ae7('0x31');return BPromise[_0x6ae7('0xf')]()[_0x6ae7('0xb')](voiceQueueReport['create'](_0x4ff646))[_0x6ae7('0xd')](loggerCatch(_0x6ae7('0x32')));};exports[_0x6ae7('0x33')]=function(_0x53073b,_0xe5baa5){return BPromise['resolve']()[_0x6ae7('0xb')](cmHopper['getContactRecallMe'](_0x53073b,_0xe5baa5))[_0x6ae7('0xd')](loggerCatch(_0x6ae7('0x34')));};exports[_0x6ae7('0x35')]=function(_0x2a0a02){return BPromise[_0x6ae7('0xf')]()[_0x6ae7('0xb')](cmHopper[_0x6ae7('0x36')](_0x2a0a02,!![],!![]))['catch'](loggerCatch(_0x6ae7('0x37')));}; \ 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 e0d54d8..b857bdf 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 _0xd87f=['scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','pTalking','IsNotLoggedIn','lastevent','queue','interface','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','getDiff','createBody','CampaignId','filterKey','campaigntype','dialAnswer','countcongestionretry','countglobal','callback','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqoslossbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','replace','random','extractCalleridName','extractCalleridNumber','match','util','lodash','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','addVariables','Queue','name','calleridnum','ContactId','dialer','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','xcally-motion-preview','Contact','hasOwnProperty','tags','updatedAt','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','responsetime','endtime','logAgent','state','ringtime','logLookAgent','membername','logCustomer','starttime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','originate','timeout','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xd87f,0xbf));var _0xfd87=function(_0x3051cf,_0x4b9a6f){_0x3051cf=_0x3051cf-0x0;var _0x5e24b5=_0xd87f[_0x3051cf];return _0x5e24b5;};'use strict';var util=require(_0xfd87('0x0'));var _=require(_0xfd87('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0xfd87('0x2'));var ipAgi=process[_0xfd87('0x3')][_0xfd87('0x4')]||_0xfd87('0x5');function getSeconds(_0x5c1f92,_0x426dca){var _0x25abd0=moment(_0x5c1f92)[_0xfd87('0x6')](0x0);var _0x4551ba=moment(_0x426dca)['milliseconds'](0x0);return _0x25abd0[_0xfd87('0x7')](_0x4551ba,_0xfd87('0x8'));}exports[_0xfd87('0x9')]=function(_0x1fb754){return function(_0x4d5f96){logger[_0xfd87('0xa')](_0x1fb754,util[_0xfd87('0xb')](_0x4d5f96,{'showHidden':![],'depth':null}));};};exports[_0xfd87('0xc')]=function(_0x897d74,_0x4d8c33){logger[_0xfd87('0xd')](_0x897d74,util[_0xfd87('0xb')](_0x4d8c33,{'showHidden':![],'depth':null}));};exports[_0xfd87('0xe')]=function(_0x2bb1f0,_0x3cbc43){logger[_0xfd87('0xa')](_0x2bb1f0,util[_0xfd87('0xb')](_0x3cbc43,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x5ad4fa){return function(_0x174f24){logger[_0xfd87('0xd')](_0x5ad4fa,util[_0xfd87('0xb')](_0x174f24,{'showHidden':![],'depth':null}));};};exports[_0xfd87('0xf')]=function(_0x5a5e67,_0xda92aa,_0x3c4e36){return{'message':_0x5a5e67,'unlock':_0xda92aa,'active':_0x3c4e36};};exports[_0xfd87('0x10')]=function(_0x1bbcc4,_0x53e447,_0xdff825){if(!_[_0xfd87('0x11')](_0xdff825)&&_0xfd87('0x12')===typeof _0xdff825&&!_[_0xfd87('0x13')](_0xdff825)){if(!_[_0xfd87('0x11')](_0x53e447)&&'string'===typeof _0x53e447&&!_['isEmpty'](_0x53e447)){return util['format'](_0xfd87('0x14'),_0x53e447,_0xdff825);}return util[_0xfd87('0x15')]('\x22%s\x22\x20<%s>',_0xdff825,_0xdff825);}if(!_['isUndefined'](_0x1bbcc4)&&_0xfd87('0x12')===typeof _0x1bbcc4&&!_['isEmpty'](_0x1bbcc4)){return _0x1bbcc4;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x3400e7){if(_['isNil'](_0x3400e7)){return![];}return _0x3400e7;};exports[_0xfd87('0x16')]=function(_0x5c78d,_0x5f4e7f,_0x47cd08,_0x293ad3,_0x1757d3,_0x882ba2){var _0x38a28e={'XMD-QUEUE':_0x5f4e7f[_0xfd87('0x17')]?_0x5f4e7f[_0xfd87('0x17')][_0xfd87('0x18')]:'','XMD-CALLERID':_0x293ad3,'XMD-CALLERID-PREVIEW':_0x882ba2?util[_0xfd87('0x15')](_0xfd87('0x14'),_0x882ba2['calleridname'],_0x882ba2[_0xfd87('0x19')]):_0x293ad3,'XMD-DIALID':_0x1757d3,'XMD-CONTACTID':_0x5f4e7f[_0xfd87('0x1a')],'XMD-CDRTYPE':_0xfd87('0x1b'),'CALLERID(all)':_0x293ad3,'XMD-VOICEQUEUEID':_0x5f4e7f['VoiceQueueId'],'XMD-DIALCHANNEL':_0x47cd08,'XMD-DIALTIMEOUT':_0x5c78d['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xfd87('0x15')]('\x22rtTxX%s%s\x22',_0x5c78d[_0xfd87('0x1c')]?'g':'',_[_0xfd87('0x13')](_0x5c78d[_0xfd87('0x1d')])?'':_0xfd87('0x1e')),'XMD-DIALURL':_0x5c78d[_0xfd87('0x1f')]||'','XMD-AGI':_0x5c78d[_0xfd87('0x20')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x5c78d[_0xfd87('0x20')]):_0xfd87('0x21'),'XMD-AGIAFTER':_0x5c78d['dialQueueProject2']?util[_0xfd87('0x15')](_0xfd87('0x22'),ipAgi,_0x5c78d[_0xfd87('0x1c')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x882ba2?_0x882ba2[_0xfd87('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x882ba2?_0x882ba2['originatecalleridname']:'','XMD-DESTINATION':_0xfd87('0x24')};if(!_[_0xfd87('0x13')](_0x5c78d[_0xfd87('0x1d')])){_0x38a28e[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x5c78d[_0xfd87('0x1d')];_0x38a28e[util[_0xfd87('0x15')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x1757d3;}if(_0x5f4e7f&&_0x5f4e7f[_0xfd87('0x25')]){for(var _0x35b0e6 in _0x5f4e7f['Contact']){if(_0x5f4e7f['Contact'][_0xfd87('0x26')](_0x35b0e6)){if(!_['isNil'](_0x5f4e7f[_0xfd87('0x25')][_0x35b0e6])&&_0x35b0e6!=='id'&&_0x35b0e6!==_0xfd87('0x27')&&_0x35b0e6!=='createdAt'&&_0x35b0e6!==_0xfd87('0x28')){_0x38a28e[util[_0xfd87('0x15')]('%s%s',_0xfd87('0x29'),_[_0xfd87('0x2a')](_0x35b0e6))]=_0x5f4e7f['Contact'][_0x35b0e6];}}}}return _0x38a28e;};exports[_0xfd87('0x2b')]=function(_0x284d48){var _0x3e2577={};for(var _0x197d47 in _0x284d48){if(_0x284d48[_0xfd87('0x26')](_0x197d47)){_0x3e2577[util[_0xfd87('0x15')]('%s',_[_0xfd87('0x2c')](_0x197d47))]=_0x284d48[_0x197d47];}}return{'variables':_0x3e2577};};exports[_0xfd87('0x2d')]=function(_0x25fe19,_0x4dd09e){if(!_[_0xfd87('0x2e')](_0x25fe19)){if(_0x25fe19[_0xfd87('0x26')]('originated')){if(_0x25fe19[_0xfd87('0x2f')]>0x0){_0x25fe19[_0xfd87('0x2f')]-=0x1;}else{logger[_0xfd87('0xa')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x4dd09e);}}}else{logger[_0xfd87('0xa')](_0xfd87('0x30'),_0x4dd09e);}};exports[_0xfd87('0x31')]=function(_0x125202){var _0x1e254a=moment()[_0xfd87('0x15')](_0xfd87('0x32'));_0x125202['state']=0xd;_0x125202[_0xfd87('0x33')]=_0xfd87('0x34');_0x125202['starttime']=_0x1e254a;_0x125202[_0xfd87('0x35')]=_0x1e254a;_0x125202[_0xfd87('0x36')]=_0x1e254a;};exports[_0xfd87('0x37')]=function(_0x4ec244,_0x4fbd95,_0x2cd6eb){var _0x496f27=moment()[_0xfd87('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x4ec244[_0xfd87('0x38')]=_0x4fbd95;_0x4ec244[_0xfd87('0x33')]=_0x2cd6eb;_0x4ec244['responsetime']=_0x496f27;_0x4ec244[_0xfd87('0x39')]=getSeconds(_0x4ec244[_0xfd87('0x35')],_0x4ec244['starttime']);};exports[_0xfd87('0x3a')]=function(_0x1381d1,_0x18623f,_0xe956ec){_0x1381d1[_0xfd87('0x3b')]=_0x18623f;_0x1381d1['UserId']=_0xe956ec;};exports[_0xfd87('0x3c')]=function(_0x47eb55,_0x1ab73d,_0x48d90e){var _0xd5db64=moment()[_0xfd87('0x15')](_0xfd87('0x32'));_0x47eb55[_0xfd87('0x38')]=_0x1ab73d;_0x47eb55[_0xfd87('0x33')]=_0x48d90e;_0x47eb55[_0xfd87('0x35')]=_0x47eb55[_0xfd87('0x35')]?_0x47eb55[_0xfd87('0x35')]:_0xd5db64;_0x47eb55['endtime']=_0x47eb55[_0xfd87('0x36')]?_0x47eb55['endtime']:_0xd5db64;_0x47eb55[_0xfd87('0x39')]=getSeconds(_0x47eb55[_0xfd87('0x35')]||0x0,_0x47eb55[_0xfd87('0x3d')]||0x0);_0x47eb55[_0xfd87('0x3e')]=_0x47eb55[_0xfd87('0x3f')]?getSeconds(_0x47eb55[_0xfd87('0x36')],_0x47eb55[_0xfd87('0x3f')]):0x0;};exports[_0xfd87('0x40')]=function(_0x1364f9){return _0x1364f9===_0xfd87('0x41');};exports[_0xfd87('0x42')]=function(_0x4b2564,_0x2fb951,_0xc73d09,_0x2723e6,_0x4afe18){var _0x46e173=_0x2723e6?_0xfd87('0x43'):_0x4b2564['calleridname'];_0x46e173=_0x4afe18?'BOOKED':_0x46e173;return{'actionid':_0x4b2564[_0xfd87('0x44')],'action':_0xfd87('0x45'),'channel':_0x4b2564['channelAgent'],'callerid':util['format'](_0xfd87('0x14'),_0x46e173,_0x4b2564['calleridnum']),'Exten':_0xfd87('0x24'),'Context':'from-sip','Priority':'1','variable':_0xc73d09,'timeout':(_0x2fb951[_0xfd87('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4b2564['uniqueid']};};exports[_0xfd87('0x47')]=function(_0x3e3968){return _0x3e3968[_0xfd87('0x48')]+_0x3e3968['countcongestionretry']+_0x3e3968[_0xfd87('0x49')]+_0x3e3968[_0xfd87('0x4a')]+_0x3e3968[_0xfd87('0x4b')];};exports[_0xfd87('0x4c')]=function(_0x36a142){var _0x855edb=_[_0xfd87('0x4d')](_0x36a142);_0x855edb['state']=0xf;_0x855edb[_0xfd87('0x33')]=_0xfd87('0x4e');return _0x855edb;};exports[_0xfd87('0x4f')]=function(_0x2aaec0,_0x2316f9,_0x237ce1){var _0x59a5d4={};_0x59a5d4[_0x2316f9]=_0x2aaec0[_0x2316f9];_0x59a5d4[_0xfd87('0x50')]=![];_0x59a5d4[_0xfd87('0x51')]=moment()[_0xfd87('0x52')](_0x237ce1,_0xfd87('0x53'))[_0xfd87('0x15')](_0xfd87('0x32'));_0x59a5d4['ContactId']=_0x2aaec0[_0xfd87('0x1a')];_0x59a5d4['ListId']=_0x2aaec0[_0xfd87('0x54')];_0x59a5d4[_0xfd87('0x55')]=_0x2aaec0[_0xfd87('0x55')]||undefined;return _0x59a5d4;};exports['decrementTalkink']=function(_0x6371df,_0x51c341){if(!_[_0xfd87('0x2e')](_0x6371df)){if(_0x6371df[_0xfd87('0x56')]>0x0){_0x6371df['pTalking']-=0x1;}else{logger[_0xfd87('0xa')](_0x51c341,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xfd87('0xa')](_0x51c341,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xfd87('0x57')]=function(_0x12e7a0){if(_0x12e7a0<=0x0){return!![];}return![];};exports['buildObj']=function(_0x34af11,_0x341827,_0x4d73a2){_0x34af11[_0xfd87('0x58')]=_0x341827;_0x34af11[_0xfd87('0x18')]=_0x34af11[_0xfd87('0x59')];_0x34af11[_0xfd87('0x5a')]=_0x34af11['channelAgent'];_0x34af11['motionChannel']=_0xfd87('0x5b');if(_0x4d73a2){_0x34af11[_0xfd87('0x5c')]=_0x4d73a2[_0xfd87('0x5c')];}return _0x34af11;};exports[_0xfd87('0x5d')]=function(_0x2d3e0b){var _0x552881={};_0x552881[_0xfd87('0x59')]=_0x2d3e0b['queue'];_0x552881[_0xfd87('0x5a')]=_0x2d3e0b['channelAgent'];_0x552881[_0xfd87('0x44')]=_0x2d3e0b['uniqueid'];return _0x552881;};exports[_0xfd87('0x5e')]=function(_0x30cd89){var _0x41b164=[];for(var _0x355f4e in _0x30cd89){if(_0x30cd89['hasOwnProperty'](_0x355f4e)){if(!_['isNil'](_0x30cd89[_0x355f4e])&&_0x30cd89[_0x355f4e][_0xfd87('0x38')]===_0xfd87('0x5f')&&_0x30cd89[_0x355f4e][_0xfd87('0x60')]===_0xfd87('0x61')){_0x41b164['push'](_0x30cd89[_0x355f4e]['id']);}}}return _0x41b164;};exports[_0xfd87('0x62')]=function(_0x148c8b){var _0x2447ab=moment()['milliseconds'](0x0);var _0x4dbafd=moment(_0x148c8b)[_0xfd87('0x6')](0x0);return _0x2447ab[_0xfd87('0x7')](_0x4dbafd,_0xfd87('0x8'));};exports[_0xfd87('0x63')]=function(_0xc4bebd){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xc4bebd[_0xfd87('0x1a')],'ListId':_0xc4bebd[_0xfd87('0x54')],'VoiceQueueId':_0xc4bebd['VoiceQueueId']||undefined,'CampaignId':_0xc4bebd[_0xfd87('0x64')]||undefined};};exports[_0xfd87('0x65')]=function(_0x225e61){if(_0x225e61===_0xfd87('0x44')||_0x225e61==='idContact'||_0x225e61==='queue'||_0x225e61==='type'||_0x225e61===_0xfd87('0x66')||_0x225e61===_0xfd87('0x67')||_0x225e61==='membername'||_0x225e61==='channelAgent'||_0x225e61==='calleridname'||_0x225e61===_0xfd87('0x50')||_0x225e61===_0xfd87('0x19')||_0x225e61==='scheduledat'||_0x225e61===_0xfd87('0x48')||_0x225e61===_0xfd87('0x68')||_0x225e61===_0xfd87('0x49')||_0x225e61===_0xfd87('0x69')||_0x225e61===_0xfd87('0x6a')||_0x225e61==='callbackuniqueid'||_0x225e61===_0xfd87('0x6b')||_0x225e61===_0xfd87('0x6c')||_0x225e61===_0xfd87('0x1a')||_0x225e61===_0xfd87('0x54')||_0x225e61===_0xfd87('0x6d')||_0x225e61==='VoiceQueueId'||_0x225e61===_0xfd87('0x6e')||_0x225e61===_0xfd87('0x6f')||_0x225e61===_0xfd87('0x70')||_0x225e61===_0xfd87('0x71')||_0x225e61===_0xfd87('0x72')||_0x225e61===_0xfd87('0x73')||_0x225e61==='xmd-dialtimeout'||_0x225e61==='xmd-dialoptions'||_0x225e61===_0xfd87('0x74')||_0x225e61===_0xfd87('0x75')||_0x225e61===_0xfd87('0x76')||_0x225e61==='xmd-cdrtype'||_0x225e61==='xmd-callerid'||_0x225e61==='xmd-agiafter'||_0x225e61===_0xfd87('0x77')||_0x225e61===_0xfd87('0x78')||_0x225e61===_0xfd87('0x79')||_0x225e61===_0xfd87('0x7a')||_0x225e61===_0xfd87('0x7b')||_0x225e61===_0xfd87('0x7c')||_0x225e61==='rtpaudioqoslossbridged'||_0x225e61===_0xfd87('0x7d')||_0x225e61==='rtpaudioqosrttbridged'||_0x225e61===_0xfd87('0x78')||_0x225e61===_0xfd87('0x79')||_0x225e61==='rtpaudioqosjitter'||_0x225e61==='rtpaudioqosjitterbridged'||_0x225e61==='rtpaudioqosloss'||_0x225e61===_0xfd87('0x7e')||_0x225e61===_0xfd87('0x7d')||_0x225e61==='rtpaudioqosrttbridged'||_0x225e61===_0xfd87('0x7f')||_0x225e61==='bridgepvtcallid'||_0x225e61===_0xfd87('0x38')||_0x225e61===_0xfd87('0x33')){return![];}return!![];};exports[_0xfd87('0x80')]=function(_0x738f3d,_0x5b986a){var _0x20522a,_0x3353d2,_0x5998f4;if(_0x5b986a<=0x0){_0x5b986a=0x1;}_0x20522a=new RegExp(_0xfd87('0x81')+_0x5b986a+'}$');_0x3353d2=Math['pow'](0xa,_0x5b986a-0x1);_0x5998f4=Math['pow'](0xa,_0x5b986a)-0x1;return util[_0xfd87('0x15')]('%s',_[_0xfd87('0x82')](_0x738f3d,_0x20522a,_[_0xfd87('0x83')](_0x3353d2,_0x5998f4)));};exports[_0xfd87('0x84')]=function(_0x17090c){var _0x1a1278=_0x17090c['match'](/"(.*?)"/);return _0x1a1278?_0x1a1278[0x1]:_0x17090c;};exports[_0xfd87('0x85')]=function(_0x841c7c){var _0x25cbc8=_0x841c7c[_0xfd87('0x86')](/<(.*?)>/);return _0x25cbc8?_0x25cbc8[0x1]:_0x841c7c;}; \ No newline at end of file +var _0x5c11=['../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','seconds','loggerCatch','error','inspect','logger','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','dialQueueProject2','originatecalleridnum','originatecalleridname','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','isNil','tags','XMD-','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','endtime','ringtime','logLookAgent','membername','logCustomer','talktime','answertime','Failure','variablesAction','RECALL','originate','channelAgent','xcally-motion-preview','totalGlobal','countnoanswerretry','countagentrejectretry','cloneAction','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','uniqueid','agentReadyId','not_inuse','status','getDiff','diff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','calleridnum','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','pow','extractCalleridName','extractCalleridNumber','util','lodash','moment'];(function(_0x42fd38,_0x31a2b9){var _0x2c8b91=function(_0x26cd8a){while(--_0x26cd8a){_0x42fd38['push'](_0x42fd38['shift']());}};_0x2c8b91(++_0x31a2b9);}(_0x5c11,0x189));var _0x15c1=function(_0x19a21c,_0x4e03f8){_0x19a21c=_0x19a21c-0x0;var _0x3e9b9f=_0x5c11[_0x19a21c];return _0x3e9b9f;};'use strict';var util=require(_0x15c1('0x0'));var _=require(_0x15c1('0x1'));var moment=require(_0x15c1('0x2'));var logger=require(_0x15c1('0x3'))('preview');var ipAgi=process[_0x15c1('0x4')][_0x15c1('0x5')]||_0x15c1('0x6');function getSeconds(_0x261c71,_0x238cb3){var _0x58e131=moment(_0x261c71)[_0x15c1('0x7')](0x0);var _0x43e8dc=moment(_0x238cb3)[_0x15c1('0x7')](0x0);return _0x58e131['diff'](_0x43e8dc,_0x15c1('0x8'));}exports[_0x15c1('0x9')]=function(_0x3700e7){return function(_0x3e1bb7){logger[_0x15c1('0xa')](_0x3700e7,util[_0x15c1('0xb')](_0x3e1bb7,{'showHidden':![],'depth':null}));};};exports[_0x15c1('0xc')]=function(_0xfb09c2,_0x1093a4){logger['info'](_0xfb09c2,util[_0x15c1('0xb')](_0x1093a4,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x35f0a1,_0x1d6995){logger[_0x15c1('0xa')](_0x35f0a1,util[_0x15c1('0xb')](_0x1d6995,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x3c4f79){return function(_0x228882){logger[_0x15c1('0xd')](_0x3c4f79,util[_0x15c1('0xb')](_0x228882,{'showHidden':![],'depth':null}));};};exports[_0x15c1('0xe')]=function(_0x1503d2,_0x396798,_0x3c95d9){return{'message':_0x1503d2,'unlock':_0x396798,'active':_0x3c95d9};};exports[_0x15c1('0xf')]=function(_0x317c19,_0x205c85,_0xd0ec78){if(!_['isUndefined'](_0xd0ec78)&&'string'===typeof _0xd0ec78&&!_['isEmpty'](_0xd0ec78)){if(!_[_0x15c1('0x10')](_0x205c85)&&_0x15c1('0x11')===typeof _0x205c85&&!_[_0x15c1('0x12')](_0x205c85)){return util[_0x15c1('0x13')]('\x22%s\x22\x20<%s>',_0x205c85,_0xd0ec78);}return util[_0x15c1('0x13')]('\x22%s\x22\x20<%s>',_0xd0ec78,_0xd0ec78);}if(!_[_0x15c1('0x10')](_0x317c19)&&_0x15c1('0x11')===typeof _0x317c19&&!_[_0x15c1('0x12')](_0x317c19)){return _0x317c19;}return _0x15c1('0x14');};exports[_0x15c1('0x15')]=function(_0x3855e2){if(_['isNil'](_0x3855e2)){return![];}return _0x3855e2;};exports[_0x15c1('0x16')]=function(_0x2f6cf5,_0xffa096,_0x276b26,_0x849e53,_0xbae88,_0x16bec8){var _0x5aa9e1={'XMD-QUEUE':_0xffa096[_0x15c1('0x17')]?_0xffa096[_0x15c1('0x17')][_0x15c1('0x18')]:'','XMD-CALLERID':_0x849e53,'XMD-CALLERID-PREVIEW':_0x16bec8?util[_0x15c1('0x13')]('\x22%s\x22\x20<%s>',_0x16bec8[_0x15c1('0x19')],_0x16bec8['calleridnum']):_0x849e53,'XMD-DIALID':_0xbae88,'XMD-CONTACTID':_0xffa096[_0x15c1('0x1a')],'XMD-CDRTYPE':_0x15c1('0x1b'),'CALLERID(all)':_0x849e53,'XMD-VOICEQUEUEID':_0xffa096[_0x15c1('0x1c')],'XMD-DIALCHANNEL':_0x276b26,'XMD-DIALTIMEOUT':_0x2f6cf5['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x15c1('0x13')](_0x15c1('0x1d'),_0x2f6cf5['dialQueueProject2']?'g':'',_[_0x15c1('0x12')](_0x2f6cf5['monitor_format'])?'':_0x15c1('0x1e')),'XMD-DIALURL':_0x2f6cf5[_0x15c1('0x1f')]||'','XMD-AGI':_0x2f6cf5[_0x15c1('0x20')]?util[_0x15c1('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2f6cf5['dialQueueProject']):_0x15c1('0x21'),'XMD-AGIAFTER':_0x2f6cf5['dialQueueProject2']?util[_0x15c1('0x13')](_0x15c1('0x22'),ipAgi,_0x2f6cf5[_0x15c1('0x23')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x16bec8?_0x16bec8[_0x15c1('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x16bec8?_0x16bec8[_0x15c1('0x25')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_['isEmpty'](_0x2f6cf5[_0x15c1('0x26')])){_0x5aa9e1[util[_0x15c1('0x13')]('%s',_0x15c1('0x27'))]=_0x2f6cf5[_0x15c1('0x26')];_0x5aa9e1[util[_0x15c1('0x13')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0xbae88;}if(_0xffa096&&_0xffa096['Contact']){for(var _0x1d8b71 in _0xffa096[_0x15c1('0x28')]){if(_0xffa096[_0x15c1('0x28')][_0x15c1('0x29')](_0x1d8b71)){if(!_[_0x15c1('0x2a')](_0xffa096['Contact'][_0x1d8b71])&&_0x1d8b71!=='id'&&_0x1d8b71!==_0x15c1('0x2b')&&_0x1d8b71!=='createdAt'&&_0x1d8b71!=='updatedAt'){_0x5aa9e1[util[_0x15c1('0x13')]('%s%s',_0x15c1('0x2c'),_['toUpper'](_0x1d8b71))]=_0xffa096[_0x15c1('0x28')][_0x1d8b71];}}}}return _0x5aa9e1;};exports[_0x15c1('0x2d')]=function(_0x1d7e4c){var _0x576c8b={};for(var _0x5ebbf9 in _0x1d7e4c){if(_0x1d7e4c['hasOwnProperty'](_0x5ebbf9)){_0x576c8b[util[_0x15c1('0x13')]('%s',_[_0x15c1('0x2e')](_0x5ebbf9))]=_0x1d7e4c[_0x5ebbf9];}}return{'variables':_0x576c8b};};exports[_0x15c1('0x2f')]=function(_0x5007b8,_0x300290){if(!_[_0x15c1('0x2a')](_0x5007b8)){if(_0x5007b8[_0x15c1('0x29')](_0x15c1('0x30'))){if(_0x5007b8['originated']>0x0){_0x5007b8[_0x15c1('0x30')]-=0x1;}else{logger['error'](_0x15c1('0x31'),_0x300290);}}}else{logger[_0x15c1('0xa')](_0x15c1('0x32'),_0x300290);}};exports['logBlacklist']=function(_0x27cef8){var _0x50ac2a=moment()['format'](_0x15c1('0x33'));_0x27cef8[_0x15c1('0x34')]=0xd;_0x27cef8[_0x15c1('0x35')]=_0x15c1('0x36');_0x27cef8[_0x15c1('0x37')]=_0x50ac2a;_0x27cef8[_0x15c1('0x38')]=_0x50ac2a;_0x27cef8[_0x15c1('0x39')]=_0x50ac2a;};exports['logAgent']=function(_0x4ed2eb,_0x5845bf,_0x1e7368){var _0x8a0c23=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4ed2eb[_0x15c1('0x34')]=_0x5845bf;_0x4ed2eb[_0x15c1('0x35')]=_0x1e7368;_0x4ed2eb['responsetime']=_0x8a0c23;_0x4ed2eb[_0x15c1('0x3a')]=getSeconds(_0x4ed2eb[_0x15c1('0x38')],_0x4ed2eb[_0x15c1('0x37')]);};exports[_0x15c1('0x3b')]=function(_0x3b01cd,_0xe0291,_0x8067d5){_0x3b01cd[_0x15c1('0x3c')]=_0xe0291;_0x3b01cd['UserId']=_0x8067d5;};exports[_0x15c1('0x3d')]=function(_0x369e99,_0x5b1f8a,_0x438bd4){var _0x5aa558=moment()['format'](_0x15c1('0x33'));_0x369e99[_0x15c1('0x34')]=_0x5b1f8a;_0x369e99[_0x15c1('0x35')]=_0x438bd4;_0x369e99['responsetime']=_0x369e99[_0x15c1('0x38')]?_0x369e99[_0x15c1('0x38')]:_0x5aa558;_0x369e99[_0x15c1('0x39')]=_0x369e99[_0x15c1('0x39')]?_0x369e99[_0x15c1('0x39')]:_0x5aa558;_0x369e99[_0x15c1('0x3a')]=getSeconds(_0x369e99['responsetime']||0x0,_0x369e99[_0x15c1('0x37')]||0x0);_0x369e99[_0x15c1('0x3e')]=_0x369e99[_0x15c1('0x3f')]?getSeconds(_0x369e99[_0x15c1('0x39')],_0x369e99[_0x15c1('0x3f')]):0x0;};exports['isFailure']=function(_0x171f23){return _0x171f23===_0x15c1('0x40');};exports[_0x15c1('0x41')]=function(_0x3b0b98,_0x136e34,_0x761a29,_0x2e8832,_0x57c2ca){var _0x466312=_0x2e8832?_0x15c1('0x42'):_0x3b0b98[_0x15c1('0x19')];_0x466312=_0x57c2ca?'BOOKED':_0x466312;return{'actionid':_0x3b0b98['uniqueid'],'action':_0x15c1('0x43'),'channel':_0x3b0b98[_0x15c1('0x44')],'callerid':util[_0x15c1('0x13')]('\x22%s\x22\x20<%s>',_0x466312,_0x3b0b98['calleridnum']),'Exten':_0x15c1('0x45'),'Context':'from-sip','Priority':'1','variable':_0x761a29,'timeout':(_0x136e34['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3b0b98['uniqueid']};};exports[_0x15c1('0x46')]=function(_0x256350){return _0x256350['countbusyretry']+_0x256350['countcongestionretry']+_0x256350[_0x15c1('0x47')]+_0x256350[_0x15c1('0x48')]+_0x256350['countnosuchnumberretry'];};exports[_0x15c1('0x49')]=function(_0xd9b05d){var _0x4708b6=_['clone'](_0xd9b05d);_0x4708b6[_0x15c1('0x34')]=0xf;_0x4708b6[_0x15c1('0x35')]='Global';return _0x4708b6;};exports[_0x15c1('0x4a')]=function(_0x4c2255,_0x548d00,_0x245a93){var _0x382333={};_0x382333[_0x548d00]=_0x4c2255[_0x548d00];_0x382333[_0x15c1('0x4b')]=![];_0x382333['scheduledat']=moment()[_0x15c1('0x4c')](_0x245a93,_0x15c1('0x4d'))[_0x15c1('0x13')](_0x15c1('0x33'));_0x382333['ContactId']=_0x4c2255[_0x15c1('0x1a')];_0x382333[_0x15c1('0x4e')]=_0x4c2255[_0x15c1('0x4e')];_0x382333[_0x15c1('0x1c')]=_0x4c2255['VoiceQueueId']||undefined;return _0x382333;};exports[_0x15c1('0x4f')]=function(_0x406946,_0x5d269b){if(!_['isNil'](_0x406946)){if(_0x406946[_0x15c1('0x50')]>0x0){_0x406946[_0x15c1('0x50')]-=0x1;}else{logger[_0x15c1('0xa')](_0x5d269b,_0x15c1('0x51'));}}else{logger['error'](_0x5d269b,_0x15c1('0x52'));}};exports[_0x15c1('0x53')]=function(_0x1dfe29){if(_0x1dfe29<=0x0){return!![];}return![];};exports[_0x15c1('0x54')]=function(_0x4430bf,_0x11d03d,_0x259405){_0x4430bf[_0x15c1('0x55')]=_0x11d03d;_0x4430bf[_0x15c1('0x18')]=_0x4430bf[_0x15c1('0x56')];_0x4430bf[_0x15c1('0x57')]=_0x4430bf[_0x15c1('0x44')];_0x4430bf[_0x15c1('0x58')]=_0x15c1('0x59');if(_0x259405){_0x4430bf[_0x15c1('0x5a')]=_0x259405['mandatoryDisposition'];}return _0x4430bf;};exports[_0x15c1('0x5b')]=function(_0x3d0444){var _0x18eb7d={};_0x18eb7d[_0x15c1('0x56')]=_0x3d0444[_0x15c1('0x56')];_0x18eb7d[_0x15c1('0x57')]=_0x3d0444['channelAgent'];_0x18eb7d[_0x15c1('0x5c')]=_0x3d0444['uniqueid'];return _0x18eb7d;};exports[_0x15c1('0x5d')]=function(_0x273566){var _0xf1e18e=[];for(var _0x47fa27 in _0x273566){if(_0x273566[_0x15c1('0x29')](_0x47fa27)){if(!_[_0x15c1('0x2a')](_0x273566[_0x47fa27])&&_0x273566[_0x47fa27]['state']===_0x15c1('0x5e')&&_0x273566[_0x47fa27][_0x15c1('0x5f')]==='reachable'){_0xf1e18e['push'](_0x273566[_0x47fa27]['id']);}}}return _0xf1e18e;};exports[_0x15c1('0x60')]=function(_0x6916a3){var _0x4c8430=moment()['milliseconds'](0x0);var _0x5181bc=moment(_0x6916a3)[_0x15c1('0x7')](0x0);return _0x4c8430[_0x15c1('0x61')](_0x5181bc,_0x15c1('0x8'));};exports[_0x15c1('0x62')]=function(_0x41ebc5){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x41ebc5['ContactId'],'ListId':_0x41ebc5[_0x15c1('0x4e')],'VoiceQueueId':_0x41ebc5[_0x15c1('0x1c')]||undefined,'CampaignId':_0x41ebc5[_0x15c1('0x63')]||undefined};};exports[_0x15c1('0x64')]=function(_0x1c8e32){if(_0x1c8e32===_0x15c1('0x5c')||_0x1c8e32===_0x15c1('0x65')||_0x1c8e32===_0x15c1('0x56')||_0x1c8e32===_0x15c1('0x66')||_0x1c8e32===_0x15c1('0x67')||_0x1c8e32===_0x15c1('0x68')||_0x1c8e32===_0x15c1('0x3c')||_0x1c8e32===_0x15c1('0x44')||_0x1c8e32===_0x15c1('0x19')||_0x1c8e32===_0x15c1('0x4b')||_0x1c8e32===_0x15c1('0x69')||_0x1c8e32==='scheduledat'||_0x1c8e32==='countbusyretry'||_0x1c8e32==='countcongestionretry'||_0x1c8e32===_0x15c1('0x47')||_0x1c8e32===_0x15c1('0x6a')||_0x1c8e32===_0x15c1('0x6b')||_0x1c8e32===_0x15c1('0x6c')||_0x1c8e32===_0x15c1('0x6d')||_0x1c8e32===_0x15c1('0x6e')||_0x1c8e32===_0x15c1('0x1a')||_0x1c8e32===_0x15c1('0x4e')||_0x1c8e32===_0x15c1('0x6f')||_0x1c8e32==='VoiceQueueId'||_0x1c8e32===_0x15c1('0x70')||_0x1c8e32==='xmd-voicequeueid'||_0x1c8e32==='xmd-queue'||_0x1c8e32==='xmd-phone'||_0x1c8e32===_0x15c1('0x71')||_0x1c8e32===_0x15c1('0x72')||_0x1c8e32==='xmd-dialtimeout'||_0x1c8e32===_0x15c1('0x73')||_0x1c8e32===_0x15c1('0x74')||_0x1c8e32===_0x15c1('0x75')||_0x1c8e32==='xmd-contactid'||_0x1c8e32===_0x15c1('0x76')||_0x1c8e32===_0x15c1('0x77')||_0x1c8e32===_0x15c1('0x78')||_0x1c8e32==='xmd-agi'||_0x1c8e32===_0x15c1('0x79')||_0x1c8e32===_0x15c1('0x7a')||_0x1c8e32===_0x15c1('0x7b')||_0x1c8e32===_0x15c1('0x7c')||_0x1c8e32===_0x15c1('0x7d')||_0x1c8e32===_0x15c1('0x7e')||_0x1c8e32===_0x15c1('0x7f')||_0x1c8e32==='rtpaudioqosrttbridged'||_0x1c8e32===_0x15c1('0x79')||_0x1c8e32==='rtpaudioqosbridged'||_0x1c8e32==='rtpaudioqosjitter'||_0x1c8e32===_0x15c1('0x7c')||_0x1c8e32===_0x15c1('0x7d')||_0x1c8e32===_0x15c1('0x7e')||_0x1c8e32===_0x15c1('0x7f')||_0x1c8e32===_0x15c1('0x80')||_0x1c8e32==='bridgepeer'||_0x1c8e32==='bridgepvtcallid'||_0x1c8e32==='state'||_0x1c8e32===_0x15c1('0x35')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x4ed8db,_0x4aaa2a){var _0x2091d3,_0x572e81,_0x568881;if(_0x4aaa2a<=0x0){_0x4aaa2a=0x1;}_0x2091d3=new RegExp('\x5cw{0,'+_0x4aaa2a+'}$');_0x572e81=Math[_0x15c1('0x81')](0xa,_0x4aaa2a-0x1);_0x568881=Math['pow'](0xa,_0x4aaa2a)-0x1;return util[_0x15c1('0x13')]('%s',_['replace'](_0x4ed8db,_0x2091d3,_['random'](_0x572e81,_0x568881)));};exports[_0x15c1('0x82')]=function(_0x3d7230){var _0x9495df=_0x3d7230['match'](/"(.*?)"/);return _0x9495df?_0x9495df[0x1]:_0x3d7230;};exports[_0x15c1('0x83')]=function(_0x510cb5){var _0xf4bf26=_0x510cb5['match'](/<(.*?)>/);return _0xf4bf26?_0xf4bf26[0x1]:_0x510cb5;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index a5a9ba9..ac7188a 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 _0x9fac=['queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','string','number'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x9fac,0x17e));var _0xc9fa=function(_0x295360,_0xbad09){_0x295360=_0x295360-0x0;var _0x3f9ee4=_0x9fac[_0x295360];return _0x3f9ee4;};'use strict';exports['queueadd']={'queue':{'type':_0xc9fa('0x0'),'required':!![]},'interface':{'type':_0xc9fa('0x0'),'required':!![]},'membername':{'type':_0xc9fa('0x0'),'required':!![]},'penalty':{'type':_0xc9fa('0x1'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xc9fa('0x2')]={'queue':{'type':_0xc9fa('0x0'),'required':!![]},'interface':{'type':_0xc9fa('0x0'),'required':!![]}};exports[_0xc9fa('0x3')]={'interface':{'type':_0xc9fa('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xc9fa('0x0'),'required':![]}};exports[_0xc9fa('0x4')]={'module':{'type':'string','required':![]}};exports[_0xc9fa('0x5')]={'uniqueid':{'type':_0xc9fa('0x0'),'required':!![]}};exports[_0xc9fa('0x6')]={'uniqueid':{'type':_0xc9fa('0x0'),'required':!![]},'filename':{'type':_0xc9fa('0x0')},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xc9fa('0x0'),'required':!![]}};exports[_0xc9fa('0x7')]={'uniqueid':{'type':_0xc9fa('0x0'),'required':!![]},'exten':{'type':_0xc9fa('0x0'),'required':!![]},'context':{'type':_0xc9fa('0x0')}}; \ No newline at end of file +var _0xe2c1=['number','queueremove','boolean','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string'];(function(_0x3f7e8b,_0x7291d1){var _0x4eb892=function(_0x4ed54e){while(--_0x4ed54e){_0x3f7e8b['push'](_0x3f7e8b['shift']());}};_0x4eb892(++_0x7291d1);}(_0xe2c1,0x127));var _0x1e2c=function(_0x1be2ae,_0x127f82){_0x1be2ae=_0x1be2ae-0x0;var _0x307002=_0xe2c1[_0x1be2ae];return _0x307002;};'use strict';exports['queueadd']={'queue':{'type':_0x1e2c('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x1e2c('0x1'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x1e2c('0x2')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x1e2c('0x0'),'required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':_0x1e2c('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x1e2c('0x0'),'required':![]}};exports[_0x1e2c('0x4')]={'uniqueid':{'type':_0x1e2c('0x0'),'required':!![]}};exports[_0x1e2c('0x5')]={'uniqueid':{'type':_0x1e2c('0x0'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x1e2c('0x0')},'mixmonitorid':{'type':'string'}};exports[_0x1e2c('0x6')]={'uniqueid':{'type':_0x1e2c('0x0'),'required':!![]}};exports[_0x1e2c('0x7')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x1e2c('0x0'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index cace335..6b44841 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 _0x3d73=['format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','agents','isUndefined','initVoiceQueues','length','initTemplates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','queuecallerleaveAt','diff','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','seconds','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','queueChannels','timers','settings','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty'];(function(_0x497391,_0x471b68){var _0x1f88dc=function(_0xf0cf64){while(--_0xf0cf64){_0x497391['push'](_0x497391['shift']());}};_0x1f88dc(++_0x471b68);}(_0x3d73,0x182));var _0x33d7=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x3d73[_0x4f9b18];return _0x29f20c;};'use strict';var BPromise=require(_0x33d7('0x0'));var util=require(_0x33d7('0x1'));var _=require('lodash');var moment=require(_0x33d7('0x2'));var Agent=require(_0x33d7('0x3'));var Telephone=require(_0x33d7('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x33d7('0x5'));var Trigger=require('../model/trigger');var Template=require(_0x33d7('0x6'));var Campaign=require(_0x33d7('0x7'));var VoiceExtension=require(_0x33d7('0x8'));var ZendeskAccount=require(_0x33d7('0x9'));var SalesforceAccount=require(_0x33d7('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x33d7('0xb'));var ZohoAccount=require(_0x33d7('0xc'));var DeskAccount=require(_0x33d7('0xd'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x33d7('0xe'));var FreshsalesAccount=require(_0x33d7('0xf'));var FaxAccount=require(_0x33d7('0x10'));var Realtime=function(){this['agents']={};this[_0x33d7('0x11')]={};this[_0x33d7('0x12')]={};this[_0x33d7('0x13')]={};this[_0x33d7('0x14')]={};this[_0x33d7('0x15')]={};this[_0x33d7('0x16')]={};this[_0x33d7('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x33d7('0x18')]={};this['channels']={};this[_0x33d7('0x19')]={};this['outboundChannels']={};this[_0x33d7('0x1a')]={};this[_0x33d7('0x1b')]={};this['zendeskAccounts']={};this[_0x33d7('0x1c')]={};this[_0x33d7('0x1d')]={};this[_0x33d7('0x1e')]={};this[_0x33d7('0x1f')]={};this[_0x33d7('0x20')]={};this[_0x33d7('0x21')]={};this['servicenowAccounts']={};this[_0x33d7('0x22')]={};this['freshsalesAccounts']={};this[_0x33d7('0x23')]={};};function freeIsNotKey(_0x48c3ee,_0x2afa75,_0x12f3e3){var _0x2239ca=_[_0x33d7('0x24')](_0x48c3ee,function(_0x484c32,_0x36e1a6){return _0x484c32[_0x12f3e3];});for(var _0x18a293 in _0x2afa75){if(_0x2afa75[_0x33d7('0x25')](_0x18a293)){if(!_0x2239ca[_0x18a293]){delete _0x2afa75[_0x18a293];}}}}function freeIsNotKeySip(_0x40d2e3,_0x4f350f){var _0x57a358=_[_0x33d7('0x24')](_0x40d2e3,function(_0x5625cc,_0x5e2fc1){return util[_0x33d7('0x26')](_0x33d7('0x27'),_0x5625cc[_0x33d7('0x28')]);});for(var _0x177f6f in _0x4f350f){if(_0x4f350f[_0x33d7('0x25')](_0x177f6f)){if(!_0x57a358[_0x177f6f]){delete _0x4f350f[_0x177f6f];}}}}function freeIsNotKeyAgent(_0x24b543,_0x10ccc0){var _0x5c9c52=_[_0x33d7('0x24')](_0x24b543,function(_0x474853,_0x429e96){var _0x1d2557=_[_0x33d7('0x29')](_0x474853[_0x33d7('0x2a')])?util['format']('SIP/%s',_0x474853['name']):_0x474853[_0x33d7('0x2a')];return _0x1d2557;});for(var _0x4c75f8 in _0x10ccc0){if(_0x10ccc0[_0x33d7('0x25')](_0x4c75f8)){if(!_0x5c9c52[_0x4c75f8]){delete _0x10ccc0[_0x4c75f8];}}}}function clearVoiceCallReports(_0x4391a1){_0x4391a1[_0x33d7('0x2b')]=0x0;_0x4391a1[_0x33d7('0x2c')]=0x0;_0x4391a1[_0x33d7('0x2d')]=0x0;_0x4391a1['sumDuration']=0x0;_0x4391a1[_0x33d7('0x2e')]=0x0;}function clearCampaigns(_0xec1a){if(!_[_0x33d7('0x2f')](_0xec1a)){for(var _0x5854a4 in _0xec1a){if(_0xec1a[_0x33d7('0x25')](_0x5854a4)){_0xec1a[_0x5854a4][_0x33d7('0x30')]=0x0;_0xec1a[_0x5854a4][_0x33d7('0x31')]=0x0;}}}}function clearVoiceQueues(_0x1b70be){if(!_[_0x33d7('0x2f')](_0x1b70be)){for(var _0x882664 in _0x1b70be){if(_0x1b70be[_0x33d7('0x25')](_0x882664)){_0x1b70be[_0x882664]['total']=0x0;_0x1b70be[_0x882664][_0x33d7('0x2c')]=0x0;_0x1b70be[_0x882664][_0x33d7('0x32')]=0x0;_0x1b70be[_0x882664][_0x33d7('0x33')]=0x0;_0x1b70be[_0x882664][_0x33d7('0x2d')]=0x0;_0x1b70be[_0x882664][_0x33d7('0x34')]=0x0;_0x1b70be[_0x882664][_0x33d7('0x2e')]=0x0;_0x1b70be[_0x882664][_0x33d7('0x35')]=0x0;_0x1b70be[_0x882664][_0x33d7('0x36')]=0x0;_0x1b70be[_0x882664][_0x33d7('0x37')]=0x0;_0x1b70be[_0x882664]['outboundCongestionCallsDay']=0x0;_0x1b70be[_0x882664][_0x33d7('0x38')]=0x0;_0x1b70be[_0x882664][_0x33d7('0x39')]=0x0;_0x1b70be[_0x882664]['outboundDropCallsDayTimeout']=0x0;_0x1b70be[_0x882664][_0x33d7('0x3a')]=0x0;_0x1b70be[_0x882664][_0x33d7('0x3b')]=0x0;_0x1b70be[_0x882664][_0x33d7('0x3c')]=0x0;_0x1b70be[_0x882664][_0x33d7('0x3d')]=0x0;_0x1b70be[_0x882664][_0x33d7('0x3e')]=0x0;_0x1b70be[_0x882664][_0x33d7('0x35')]=0x0;_0x1b70be[_0x882664][_0x33d7('0x3f')]=0x0;_0x1b70be[_0x882664][_0x33d7('0x40')]=!![];}}}}Realtime[_0x33d7('0x41')][_0x33d7('0x42')]=function(_0x1823a1,_0x35a78c){for(var _0x3adacc in _0x35a78c){if(_0x1823a1[_0x33d7('0x25')](_0x3adacc)){_0x1823a1[_0x3adacc]=_0x35a78c[_0x3adacc];}}};Realtime[_0x33d7('0x41')]['initAgents']=function(){var _0x1eca20=this;return function(_0x468e5a){if(_0x468e5a){freeIsNotKeyAgent(_0x468e5a,_0x1eca20['agents']);for(var _0x4361c1=0x0,_0x247ffd={},_0x226c63={};_0x4361c1<_0x468e5a['length'];_0x4361c1+=0x1){_0x247ffd=_0x468e5a[_0x4361c1];var _0x3a694e=_['isNil'](_0x247ffd[_0x33d7('0x2a')])?util['format'](_0x33d7('0x27'),_0x247ffd['name']):_0x247ffd['interface'];if(_['isUndefined'](_0x1eca20[_0x33d7('0x43')][_0x3a694e])){_0x1eca20[_0x33d7('0x43')][_0x3a694e]=new Agent(_0x247ffd);}else{_0x1eca20['mergeFromDatabase'](_0x1eca20['agents'][_0x3a694e],_0x247ffd);}}}return _0x1eca20[_0x33d7('0x43')];};};Realtime[_0x33d7('0x41')]['initTelephones']=function(){var _0x5bb372=this;return function(_0x5dea39){if(_0x5dea39){freeIsNotKeySip(_0x5dea39,_0x5bb372['telephones']);for(var _0xf6dc45=0x0,_0x2c2037={},_0x4f078c={};_0xf6dc45<_0x5dea39['length'];_0xf6dc45+=0x1){_0x2c2037=_0x5dea39[_0xf6dc45];if(_[_0x33d7('0x44')](_0x5bb372[_0x33d7('0x11')][util[_0x33d7('0x26')](_0x33d7('0x27'),_0x2c2037['name'])])){_0x5bb372[_0x33d7('0x11')][util[_0x33d7('0x26')](_0x33d7('0x27'),_0x2c2037[_0x33d7('0x28')])]=new Telephone(_0x2c2037);}else{_0x5bb372[_0x33d7('0x42')](_0x5bb372[_0x33d7('0x11')][util[_0x33d7('0x26')](_0x33d7('0x27'),_0x2c2037[_0x33d7('0x28')])],_0x2c2037);}}}return _0x5bb372[_0x33d7('0x11')];};};Realtime[_0x33d7('0x41')]['initTrunks']=function(){var _0x5ecbf7=this;return function(_0x472a93){if(_0x472a93){freeIsNotKeySip(_0x472a93,_0x5ecbf7[_0x33d7('0x12')]);for(var _0x54bd5d=0x0,_0x5f9556={},_0x3a0a42={};_0x54bd5d<_0x472a93['length'];_0x54bd5d+=0x1){_0x5f9556=_0x472a93[_0x54bd5d];if(_[_0x33d7('0x44')](_0x5ecbf7[_0x33d7('0x12')][util[_0x33d7('0x26')]('SIP/%s',_0x5f9556['name'])])){_0x5ecbf7[_0x33d7('0x12')][util[_0x33d7('0x26')](_0x33d7('0x27'),_0x5f9556['name'])]=new Trunk(_0x5f9556);}else{_0x5ecbf7[_0x33d7('0x42')](_0x5ecbf7[_0x33d7('0x12')][util[_0x33d7('0x26')](_0x33d7('0x27'),_0x5f9556[_0x33d7('0x28')])],_0x5f9556);}}}return _0x5ecbf7[_0x33d7('0x12')];};};Realtime[_0x33d7('0x41')][_0x33d7('0x45')]=function(){var _0x3ee55=this;return function(_0x1147cd){if(_0x1147cd){freeIsNotKey(_0x1147cd,_0x3ee55['voiceQueues'],_0x33d7('0x28'));for(var _0x54c4af=0x0,_0x4de9a6={},_0x3d7f9a={};_0x54c4af<_0x1147cd[_0x33d7('0x46')];_0x54c4af+=0x1){_0x4de9a6=_0x1147cd[_0x54c4af];if(_[_0x33d7('0x44')](_0x3ee55['voiceQueues'][_0x4de9a6[_0x33d7('0x28')]])){_0x3ee55[_0x33d7('0x13')][_0x4de9a6[_0x33d7('0x28')]]=new VoiceQueue(_0x4de9a6);}else{_0x3ee55[_0x33d7('0x42')](_0x3ee55[_0x33d7('0x13')][_0x4de9a6[_0x33d7('0x28')]],_0x4de9a6);}}}return _0x3ee55[_0x33d7('0x13')];};};Realtime['prototype']['initTriggers']=function(){var _0x5eaf87=this;return function(_0x409608){if(_0x409608){freeIsNotKey(_0x409608,_0x5eaf87[_0x33d7('0x14')],'id');for(var _0x16d260=0x0,_0x56a2ef={},_0x267b93={};_0x16d260<_0x409608[_0x33d7('0x46')];_0x16d260+=0x1){_0x56a2ef=_0x409608[_0x16d260];if(_[_0x33d7('0x44')](_0x5eaf87['triggers'][_0x56a2ef['id']])){_0x5eaf87[_0x33d7('0x14')][_0x56a2ef['id']]=new Trigger(_0x56a2ef);}else{_0x5eaf87[_0x33d7('0x42')](_0x5eaf87[_0x33d7('0x14')][_0x56a2ef['id']],_0x56a2ef);}}}return _0x5eaf87[_0x33d7('0x14')];};};Realtime[_0x33d7('0x41')][_0x33d7('0x47')]=function(){var _0x4777e1=this;return function(_0x2f3437){if(_0x2f3437){freeIsNotKey(_0x2f3437,_0x4777e1['templates'],'id');for(var _0x4c93a0=0x0,_0x2bfd20={},_0x43adbf={};_0x4c93a0<_0x2f3437['length'];_0x4c93a0+=0x1){_0x2bfd20=_0x2f3437[_0x4c93a0];if(_['isUndefined'](_0x4777e1[_0x33d7('0x16')][_0x2bfd20['id']])){_0x4777e1[_0x33d7('0x16')][_0x2bfd20['id']]=new Template(_0x2bfd20);}else{_0x4777e1[_0x33d7('0x42')](_0x4777e1[_0x33d7('0x16')][_0x2bfd20['id']],_0x2bfd20);}}}return _0x4777e1[_0x33d7('0x16')];};};Realtime['prototype'][_0x33d7('0x48')]=function(){var _0x5a1c84=this;return function(_0x5efb25){if(_0x5efb25){freeIsNotKey(_0x5efb25,_0x5a1c84[_0x33d7('0x49')],'id');for(var _0x2e4b3f=0x0,_0x22e33e={},_0x4baf85={};_0x2e4b3f<_0x5efb25[_0x33d7('0x46')];_0x2e4b3f+=0x1){_0x22e33e=_0x5efb25[_0x2e4b3f];if(_['isUndefined'](_0x5a1c84['zendeskAccounts'][_0x22e33e['id']])){_0x5a1c84['zendeskAccounts'][_0x22e33e['id']]=new ZendeskAccount(_0x22e33e);}else{_0x5a1c84[_0x33d7('0x42')](_0x5a1c84[_0x33d7('0x49')][_0x22e33e['id']],_0x22e33e);}}}return _0x5a1c84[_0x33d7('0x49')];};};Realtime[_0x33d7('0x41')][_0x33d7('0x4a')]=function(){var _0x31ab47=this;return function(_0x32f59f){if(_0x32f59f){freeIsNotKey(_0x32f59f,_0x31ab47['salesforceAccounts'],'id');for(var _0x2799fa=0x0,_0x72a762={},_0x1186ea={};_0x2799fa<_0x32f59f[_0x33d7('0x46')];_0x2799fa+=0x1){_0x72a762=_0x32f59f[_0x2799fa];if(_[_0x33d7('0x44')](_0x31ab47['salesforceAccounts'][_0x72a762['id']])){_0x31ab47[_0x33d7('0x1c')][_0x72a762['id']]=new SalesforceAccount(_0x72a762);}else{_0x31ab47['mergeFromDatabase'](_0x31ab47[_0x33d7('0x1c')][_0x72a762['id']],_0x72a762);}}}return _0x31ab47['salesforceAccounts'];};};Realtime[_0x33d7('0x41')][_0x33d7('0x4b')]=function(){var _0x1b7107=this;return function(_0x1fef00){if(_0x1fef00){freeIsNotKey(_0x1fef00,_0x1b7107['freshdeskAccounts'],'id');for(var _0x14426f=0x0,_0x267379={},_0x45d53a={};_0x14426f<_0x1fef00[_0x33d7('0x46')];_0x14426f+=0x1){_0x267379=_0x1fef00[_0x14426f];if(_['isUndefined'](_0x1b7107[_0x33d7('0x1e')][_0x267379['id']])){_0x1b7107[_0x33d7('0x1e')][_0x267379['id']]=new FreshdeskAccount(_0x267379);}else{_0x1b7107[_0x33d7('0x42')](_0x1b7107[_0x33d7('0x1e')][_0x267379['id']],_0x267379);}}}return _0x1b7107[_0x33d7('0x1e')];};};Realtime[_0x33d7('0x41')][_0x33d7('0x4c')]=function(){var _0x870506=this;return function(_0x5a9299){if(_0x5a9299){freeIsNotKey(_0x5a9299,_0x870506[_0x33d7('0x1f')],'id');for(var _0x1c96cd=0x0,_0x5818b6={},_0x3bc939={};_0x1c96cd<_0x5a9299[_0x33d7('0x46')];_0x1c96cd+=0x1){_0x5818b6=_0x5a9299[_0x1c96cd];if(_[_0x33d7('0x44')](_0x870506[_0x33d7('0x1f')][_0x5818b6['id']])){_0x870506[_0x33d7('0x1f')][_0x5818b6['id']]=new ZohoAccount(_0x5818b6);}else{_0x870506['mergeFromDatabase'](_0x870506[_0x33d7('0x1f')][_0x5818b6['id']],_0x5818b6);}}}return _0x870506[_0x33d7('0x1f')];};};Realtime[_0x33d7('0x41')][_0x33d7('0x4d')]=function(){var _0x10c208=this;return function(_0x1a4dbf){if(_0x1a4dbf){freeIsNotKey(_0x1a4dbf,_0x10c208[_0x33d7('0x20')],'id');for(var _0x3579ef=0x0,_0x1353e2={},_0x51a302={};_0x3579ef<_0x1a4dbf[_0x33d7('0x46')];_0x3579ef+=0x1){_0x1353e2=_0x1a4dbf[_0x3579ef];if(_[_0x33d7('0x44')](_0x10c208[_0x33d7('0x20')][_0x1353e2['id']])){_0x10c208[_0x33d7('0x20')][_0x1353e2['id']]=new DeskAccount(_0x1353e2);}else{_0x10c208['mergeFromDatabase'](_0x10c208['deskAccounts'][_0x1353e2['id']],_0x1353e2);}}}return _0x10c208['deskAccounts'];};};Realtime[_0x33d7('0x41')]['initSugarcrmAccounts']=function(){var _0x5be448=this;return function(_0x2b5a69){if(_0x2b5a69){freeIsNotKey(_0x2b5a69,_0x5be448[_0x33d7('0x1d')],'id');for(var _0x25289a=0x0,_0x14c60={},_0x5ec564={};_0x25289a<_0x2b5a69[_0x33d7('0x46')];_0x25289a+=0x1){_0x14c60=_0x2b5a69[_0x25289a];if(_[_0x33d7('0x44')](_0x5be448[_0x33d7('0x1d')][_0x14c60['id']])){_0x5be448[_0x33d7('0x1d')][_0x14c60['id']]=new SugarcrmAccount(_0x14c60);}else{_0x5be448[_0x33d7('0x42')](_0x5be448[_0x33d7('0x1d')][_0x14c60['id']],_0x14c60);}}}return _0x5be448[_0x33d7('0x1d')];};};Realtime[_0x33d7('0x41')][_0x33d7('0x4e')]=function(){var _0x39a698=this;return function(_0x281473){if(_0x281473){freeIsNotKey(_0x281473,_0x39a698['vtigerAccounts'],'id');for(var _0x5e49fe=0x0,_0x172099={},_0x140e50={};_0x5e49fe<_0x281473[_0x33d7('0x46')];_0x5e49fe+=0x1){_0x172099=_0x281473[_0x5e49fe];if(_['isUndefined'](_0x39a698[_0x33d7('0x21')][_0x172099['id']])){_0x39a698[_0x33d7('0x21')][_0x172099['id']]=new VtigerAccount(_0x172099);}else{_0x39a698[_0x33d7('0x42')](_0x39a698[_0x33d7('0x21')][_0x172099['id']],_0x172099);}}}return _0x39a698[_0x33d7('0x21')];};};Realtime[_0x33d7('0x41')][_0x33d7('0x4f')]=function(){var _0x22fdfe=this;return function(_0x14663e){if(_0x14663e){freeIsNotKey(_0x14663e,_0x22fdfe[_0x33d7('0x50')],'id');for(var _0xe391e0=0x0,_0x213ceb={},_0x39a5ec={};_0xe391e0<_0x14663e[_0x33d7('0x46')];_0xe391e0+=0x1){_0x213ceb=_0x14663e[_0xe391e0];if(_['isUndefined'](_0x22fdfe['servicenowAccounts'][_0x213ceb['id']])){_0x22fdfe['servicenowAccounts'][_0x213ceb['id']]=new ServicenowAccount(_0x213ceb);}else{_0x22fdfe[_0x33d7('0x42')](_0x22fdfe['servicenowAccounts'][_0x213ceb['id']],_0x213ceb);}}}return _0x22fdfe[_0x33d7('0x50')];};};Realtime[_0x33d7('0x41')]['initDynamics365Accounts']=function(){var _0x190a49=this;return function(_0x4839df){if(_0x4839df){freeIsNotKey(_0x4839df,_0x190a49[_0x33d7('0x22')],'id');for(var _0x498182=0x0,_0x4ffba9={},_0x815d9b={};_0x498182<_0x4839df['length'];_0x498182+=0x1){_0x4ffba9=_0x4839df[_0x498182];if(_[_0x33d7('0x44')](_0x190a49[_0x33d7('0x22')][_0x4ffba9['id']])){_0x190a49[_0x33d7('0x22')][_0x4ffba9['id']]=new Dynamics365Account(_0x4ffba9);}else{_0x190a49[_0x33d7('0x42')](_0x190a49['dynamics365Accounts'][_0x4ffba9['id']],_0x4ffba9);}}}return _0x190a49['dynamics365Accounts'];};};Realtime[_0x33d7('0x41')][_0x33d7('0x51')]=function(){var _0x3df7ae=this;return function(_0x5dc614){if(_0x5dc614){freeIsNotKey(_0x5dc614,_0x3df7ae['freshsalesAccounts'],'id');for(var _0x5cdbd9=0x0,_0xa1f918={},_0x2dac51={};_0x5cdbd9<_0x5dc614[_0x33d7('0x46')];_0x5cdbd9+=0x1){_0xa1f918=_0x5dc614[_0x5cdbd9];if(_[_0x33d7('0x44')](_0x3df7ae[_0x33d7('0x52')][_0xa1f918['id']])){_0x3df7ae[_0x33d7('0x52')][_0xa1f918['id']]=new FreshsalesAccount(_0xa1f918);}else{_0x3df7ae['mergeFromDatabase'](_0x3df7ae[_0x33d7('0x52')][_0xa1f918['id']],_0xa1f918);}}}return _0x3df7ae['freshsalesAccounts'];};};Realtime[_0x33d7('0x41')][_0x33d7('0x53')]=function(){var _0x203a87=this;return function(_0x2ab1a2){for(var _0x5dd5ef=0x0;_0x5dd5ef<_0x2ab1a2[_0x33d7('0x46')];_0x5dd5ef+=0x1){_['merge'](_0x203a87[_0x33d7('0x13')][_0x2ab1a2[_0x5dd5ef][_0x33d7('0x28')]],_0x2ab1a2[_0x5dd5ef]);}return _0x203a87[_0x33d7('0x13')];};};Realtime['prototype'][_0x33d7('0x54')]=function(){var _0xb3542f=this;return function(_0x4b0142){clearVoiceQueues(_0xb3542f[_0x33d7('0x13')]);if(_0x4b0142){_0x4b0142=_[_0x33d7('0x55')](_0x4b0142,_0x33d7('0x56'));for(var _0x461adb in _0x4b0142){if(_0x4b0142['hasOwnProperty'](_0x461adb)){var _0x25c7ea={};for(var _0x422b88=0x0;_0x422b88<_0x4b0142[_0x461adb][_0x33d7('0x46')];_0x422b88+=0x1){var _0x1d5daa=_0x4b0142[_0x461adb][_0x422b88]['queue'];if(_0xb3542f[_0x33d7('0x13')][_0x1d5daa]){if(_0x4b0142[_0x461adb][_0x422b88][_0x33d7('0x57')]){_0xb3542f['voiceQueues'][_0x1d5daa]['unmanaged']+=0x1;}if(_0x4b0142[_0x461adb][_0x422b88]['queuecallerabandon']){_0xb3542f[_0x33d7('0x13')][_0x1d5daa][_0x33d7('0x33')]+=0x1;}_0xb3542f[_0x33d7('0x13')][_0x1d5daa][_0x33d7('0x2d')]+=moment(_0x4b0142[_0x461adb][_0x422b88][_0x33d7('0x58')])[_0x33d7('0x59')](moment(_0x4b0142[_0x461adb][_0x422b88]['queuecallerjoinAt']),'seconds')||0x0;if(_0x422b88===_0x4b0142[_0x461adb][_0x33d7('0x46')]-0x1){_0xb3542f[_0x33d7('0x13')][_0x1d5daa]['sumDuration']+=moment(_0x4b0142[_0x461adb][_0x422b88]['queuecallercompleteAt']||_0x4b0142[_0x461adb][_0x422b88][_0x33d7('0x5a')]||_0x4b0142[_0x461adb][_0x422b88][_0x33d7('0x5b')])['diff'](moment(_0x4b0142[_0x461adb][_0x422b88][_0x33d7('0x5c')]),'seconds')||0x0;_0xb3542f[_0x33d7('0x13')][_0x1d5daa][_0x33d7('0x2b')]+=0x1;if(_0x4b0142[_0x461adb][_0x422b88][_0x33d7('0x5d')]){_0xb3542f[_0x33d7('0x13')][_0x1d5daa][_0x33d7('0x2c')]+=0x1;_0xb3542f[_0x33d7('0x13')][_0x1d5daa][_0x33d7('0x2e')]+=moment(_0x4b0142[_0x461adb][_0x422b88][_0x33d7('0x5e')])['diff'](moment(_0x4b0142[_0x461adb][_0x422b88][_0x33d7('0x58')]),_0x33d7('0x5f'))||0x0;}}else{_0xb3542f[_0x33d7('0x13')][_0x1d5daa]['sumDuration']+=_0xb3542f[_0x33d7('0x13')][_0x1d5daa][_0x33d7('0x2d')]||0x0;}}}}}}return _0xb3542f[_0x33d7('0x13')];};};Realtime['prototype'][_0x33d7('0x60')]=function(){var _0x5798b3=this;return function(_0x7f3001){clearVoiceCallReports(_0x5798b3[_0x33d7('0x17')]);if(_0x7f3001){for(var _0x553a9d=0x0;_0x553a9d<_0x7f3001[_0x33d7('0x46')];_0x553a9d+=0x1){_0x5798b3[_0x33d7('0x17')]['total']+=0x1;_0x5798b3[_0x33d7('0x17')][_0x33d7('0x34')]+=_0x7f3001[_0x553a9d][_0x33d7('0x61')];if(_0x7f3001[_0x553a9d][_0x33d7('0x62')]===_0x33d7('0x63')){_0x5798b3[_0x33d7('0x17')]['answered']+=0x1;_0x5798b3[_0x33d7('0x17')][_0x33d7('0x2d')]+=_0x7f3001[_0x553a9d][_0x33d7('0x61')]-_0x7f3001[_0x553a9d][_0x33d7('0x64')]||0x0;_0x5798b3[_0x33d7('0x17')][_0x33d7('0x2e')]+=_0x7f3001[_0x553a9d][_0x33d7('0x64')];}}}return _0x5798b3['outbound'];};};Realtime[_0x33d7('0x41')]['initCampaigns']=function(){var _0x56fbce=this;return function(_0x55e587){if(_0x55e587){freeIsNotKey(_0x55e587,_0x56fbce[_0x33d7('0x15')],'name');for(var _0x224c97=0x0,_0x5365df={};_0x224c97<_0x55e587[_0x33d7('0x46')];_0x224c97+=0x1){_0x5365df=_0x55e587[_0x224c97];if(_[_0x33d7('0x44')](_0x56fbce[_0x33d7('0x15')][_0x5365df[_0x33d7('0x28')]])){_0x56fbce[_0x33d7('0x15')][_0x5365df[_0x33d7('0x28')]]=new Campaign(_0x5365df);}else{_0x56fbce[_0x33d7('0x42')](_0x56fbce[_0x33d7('0x15')][_0x5365df[_0x33d7('0x28')]],_0x5365df);_0x56fbce['campaigns'][_0x5365df[_0x33d7('0x28')]]['dialQueueProject']=_0x5365df[_0x33d7('0x65')]?_0x5365df['SquareProject'][_0x33d7('0x28')]:undefined;}}}return _0x56fbce[_0x33d7('0x15')];};};Realtime[_0x33d7('0x41')][_0x33d7('0x66')]=function(){var _0x5dacf4=this;return function(_0x3fa88d){if(_0x3fa88d){freeIsNotKey(_0x3fa88d,_0x5dacf4[_0x33d7('0x18')],'id');for(var _0x4e8463=0x0,_0xe541fc={};_0x4e8463<_0x3fa88d['length'];_0x4e8463+=0x1){_0xe541fc=_0x3fa88d[_0x4e8463];if(_[_0x33d7('0x44')](_0x5dacf4[_0x33d7('0x18')][_0xe541fc['id']])){_0x5dacf4[_0x33d7('0x18')][_0xe541fc['id']]=new VoiceExtension(_0xe541fc);}else{_0x5dacf4[_0x33d7('0x42')](_0x5dacf4['voiceExtensions'][_0xe541fc['id']],_0xe541fc);}}}return _0x5dacf4[_0x33d7('0x18')];};};Realtime[_0x33d7('0x41')][_0x33d7('0x67')]=function(){var _0x1cb4c9=this;return function(_0x51cb03){clearCampaigns(_0x1cb4c9[_0x33d7('0x15')]);for(var _0xacadbd=0x0;_0xacadbd<_0x51cb03[_0x33d7('0x46')];_0xacadbd+=0x1){_['merge'](_0x1cb4c9['campaigns'][_0x51cb03[_0xacadbd]['name']],_0x51cb03[_0xacadbd]);}return _0x1cb4c9['campaigns'];};};Realtime['prototype'][_0x33d7('0x68')]=function(){var _0x5c85f9=this;return function(_0x461fe2){if(_0x461fe2){freeIsNotKey(_0x461fe2,_0x5c85f9['faxAccounts'],'id');for(var _0x395c33=0x0,_0x1a7418={},_0x57a29f={};_0x395c33<_0x461fe2[_0x33d7('0x46')];_0x395c33+=0x1){_0x1a7418=_0x461fe2[_0x395c33];if(_[_0x33d7('0x44')](_0x5c85f9['faxAccounts'][_0x1a7418['id']])){_0x5c85f9[_0x33d7('0x23')][_0x1a7418['id']]=new FaxAccount(_0x1a7418);}else{_0x5c85f9[_0x33d7('0x42')](_0x5c85f9[_0x33d7('0x23')][_0x1a7418['id']],_0x1a7418);}}}return _0x5c85f9[_0x33d7('0x23')];};};module[_0x33d7('0x69')]=Realtime; \ No newline at end of file +var _0x067f=['vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','name','hasOwnProperty','isNil','interface','SIP/%s','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','queueStatusComplete','prototype','initAgents','isUndefined','agents','mergeFromDatabase','initTelephones','trunks','length','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','seconds','queuecallercomplete','duration','disposition','ANSWERED','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','bluebird','util','moment','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','telephones','voiceQueues','campaigns','templates','outbound','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts'];(function(_0x3df920,_0x1348d7){var _0x4345a6=function(_0x4b5740){while(--_0x4b5740){_0x3df920['push'](_0x3df920['shift']());}};_0x4345a6(++_0x1348d7);}(_0x067f,0x183));var _0xf067=function(_0x1ff0a6,_0x4ad360){_0x1ff0a6=_0x1ff0a6-0x0;var _0x1d40fe=_0x067f[_0x1ff0a6];return _0x1d40fe;};'use strict';var BPromise=require(_0xf067('0x0'));var util=require(_0xf067('0x1'));var _=require('lodash');var moment=require(_0xf067('0x2'));var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require(_0xf067('0x3'));var VoiceQueue=require(_0xf067('0x4'));var Trigger=require(_0xf067('0x5'));var Template=require(_0xf067('0x6'));var Campaign=require(_0xf067('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xf067('0x8'));var SalesforceAccount=require(_0xf067('0x9'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xf067('0xa'));var ZohoAccount=require(_0xf067('0xb'));var DeskAccount=require(_0xf067('0xc'));var VtigerAccount=require(_0xf067('0xd'));var ServicenowAccount=require(_0xf067('0xe'));var Dynamics365Account=require(_0xf067('0xf'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf067('0x10'));var Realtime=function(){this['agents']={};this[_0xf067('0x11')]={};this['trunks']={};this[_0xf067('0x12')]={};this['triggers']={};this[_0xf067('0x13')]={};this[_0xf067('0x14')]={};this[_0xf067('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this['queueChannels']={};this[_0xf067('0x16')]={};this[_0xf067('0x17')]={};this['settings']={};this[_0xf067('0x18')]={};this[_0xf067('0x19')]={};this[_0xf067('0x1a')]={};this[_0xf067('0x1b')]={};this[_0xf067('0x1c')]={};this['deskAccounts']={};this[_0xf067('0x1d')]={};this['servicenowAccounts']={};this[_0xf067('0x1e')]={};this[_0xf067('0x1f')]={};this[_0xf067('0x20')]={};};function freeIsNotKey(_0x1ad3e2,_0x5a61bc,_0x2bd8ad){var _0x3d59ec=_[_0xf067('0x21')](_0x1ad3e2,function(_0x5add68,_0x4c22f4){return _0x5add68[_0x2bd8ad];});for(var _0x359b46 in _0x5a61bc){if(_0x5a61bc['hasOwnProperty'](_0x359b46)){if(!_0x3d59ec[_0x359b46]){delete _0x5a61bc[_0x359b46];}}}}function freeIsNotKeySip(_0x3cf65a,_0x26f873){var _0xe2ab81=_[_0xf067('0x21')](_0x3cf65a,function(_0xae3561,_0x21ac01){return util[_0xf067('0x22')]('SIP/%s',_0xae3561[_0xf067('0x23')]);});for(var _0x361395 in _0x26f873){if(_0x26f873[_0xf067('0x24')](_0x361395)){if(!_0xe2ab81[_0x361395]){delete _0x26f873[_0x361395];}}}}function freeIsNotKeyAgent(_0x5044d7,_0x24b292){var _0x3f5768=_[_0xf067('0x21')](_0x5044d7,function(_0x270337,_0x34f00f){var _0x2a3072=_[_0xf067('0x25')](_0x270337[_0xf067('0x26')])?util[_0xf067('0x22')](_0xf067('0x27'),_0x270337[_0xf067('0x23')]):_0x270337[_0xf067('0x26')];return _0x2a3072;});for(var _0x582160 in _0x24b292){if(_0x24b292[_0xf067('0x24')](_0x582160)){if(!_0x3f5768[_0x582160]){delete _0x24b292[_0x582160];}}}}function clearVoiceCallReports(_0x43ec74){_0x43ec74[_0xf067('0x28')]=0x0;_0x43ec74[_0xf067('0x29')]=0x0;_0x43ec74[_0xf067('0x2a')]=0x0;_0x43ec74[_0xf067('0x2b')]=0x0;_0x43ec74[_0xf067('0x2c')]=0x0;}function clearCampaigns(_0xa34b0e){if(!_[_0xf067('0x2d')](_0xa34b0e)){for(var _0x11fea4 in _0xa34b0e){if(_0xa34b0e[_0xf067('0x24')](_0x11fea4)){_0xa34b0e[_0x11fea4][_0xf067('0x2e')]=0x0;_0xa34b0e[_0x11fea4][_0xf067('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x43628c){if(!_[_0xf067('0x2d')](_0x43628c)){for(var _0x3e6ce8 in _0x43628c){if(_0x43628c[_0xf067('0x24')](_0x3e6ce8)){_0x43628c[_0x3e6ce8][_0xf067('0x28')]=0x0;_0x43628c[_0x3e6ce8][_0xf067('0x29')]=0x0;_0x43628c[_0x3e6ce8][_0xf067('0x30')]=0x0;_0x43628c[_0x3e6ce8][_0xf067('0x31')]=0x0;_0x43628c[_0x3e6ce8][_0xf067('0x2a')]=0x0;_0x43628c[_0x3e6ce8][_0xf067('0x2b')]=0x0;_0x43628c[_0x3e6ce8]['sumBillable']=0x0;_0x43628c[_0x3e6ce8]['outboundAnswerAgiCallsDay']=0x0;_0x43628c[_0x3e6ce8][_0xf067('0x32')]=0x0;_0x43628c[_0x3e6ce8][_0xf067('0x33')]=0x0;_0x43628c[_0x3e6ce8][_0xf067('0x34')]=0x0;_0x43628c[_0x3e6ce8][_0xf067('0x35')]=0x0;_0x43628c[_0x3e6ce8]['outboundUnknownCallsDay']=0x0;_0x43628c[_0x3e6ce8][_0xf067('0x36')]=0x0;_0x43628c[_0x3e6ce8][_0xf067('0x37')]=0x0;_0x43628c[_0x3e6ce8][_0xf067('0x38')]=0x0;_0x43628c[_0x3e6ce8][_0xf067('0x39')]=0x0;_0x43628c[_0x3e6ce8]['outboundRejectCallsDay']=0x0;_0x43628c[_0x3e6ce8][_0xf067('0x3a')]=0x0;_0x43628c[_0x3e6ce8]['outboundAnswerAgiCallsDay']=0x0;_0x43628c[_0x3e6ce8]['outboundAnswerCallsDay']=0x0;_0x43628c[_0x3e6ce8][_0xf067('0x3b')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x201739,_0x349a33){for(var _0x1d97ed in _0x349a33){if(_0x201739[_0xf067('0x24')](_0x1d97ed)){_0x201739[_0x1d97ed]=_0x349a33[_0x1d97ed];}}};Realtime[_0xf067('0x3c')][_0xf067('0x3d')]=function(){var _0x3dbbe1=this;return function(_0x19f953){if(_0x19f953){freeIsNotKeyAgent(_0x19f953,_0x3dbbe1['agents']);for(var _0x1cb0cf=0x0,_0x386d46={},_0x305fe4={};_0x1cb0cf<_0x19f953['length'];_0x1cb0cf+=0x1){_0x386d46=_0x19f953[_0x1cb0cf];var _0x5a6209=_[_0xf067('0x25')](_0x386d46[_0xf067('0x26')])?util[_0xf067('0x22')](_0xf067('0x27'),_0x386d46[_0xf067('0x23')]):_0x386d46[_0xf067('0x26')];if(_[_0xf067('0x3e')](_0x3dbbe1[_0xf067('0x3f')][_0x5a6209])){_0x3dbbe1[_0xf067('0x3f')][_0x5a6209]=new Agent(_0x386d46);}else{_0x3dbbe1[_0xf067('0x40')](_0x3dbbe1['agents'][_0x5a6209],_0x386d46);}}}return _0x3dbbe1[_0xf067('0x3f')];};};Realtime[_0xf067('0x3c')][_0xf067('0x41')]=function(){var _0x5c9b4d=this;return function(_0x3bcb55){if(_0x3bcb55){freeIsNotKeySip(_0x3bcb55,_0x5c9b4d[_0xf067('0x11')]);for(var _0x393da6=0x0,_0x199f0f={},_0x33e823={};_0x393da6<_0x3bcb55['length'];_0x393da6+=0x1){_0x199f0f=_0x3bcb55[_0x393da6];if(_[_0xf067('0x3e')](_0x5c9b4d[_0xf067('0x11')][util['format'](_0xf067('0x27'),_0x199f0f['name'])])){_0x5c9b4d[_0xf067('0x11')][util['format']('SIP/%s',_0x199f0f['name'])]=new Telephone(_0x199f0f);}else{_0x5c9b4d[_0xf067('0x40')](_0x5c9b4d[_0xf067('0x11')][util['format'](_0xf067('0x27'),_0x199f0f[_0xf067('0x23')])],_0x199f0f);}}}return _0x5c9b4d[_0xf067('0x11')];};};Realtime[_0xf067('0x3c')]['initTrunks']=function(){var _0x7e3427=this;return function(_0x5bea2a){if(_0x5bea2a){freeIsNotKeySip(_0x5bea2a,_0x7e3427[_0xf067('0x42')]);for(var _0x2cbecf=0x0,_0x24653b={},_0x33e13a={};_0x2cbecf<_0x5bea2a[_0xf067('0x43')];_0x2cbecf+=0x1){_0x24653b=_0x5bea2a[_0x2cbecf];if(_[_0xf067('0x3e')](_0x7e3427[_0xf067('0x42')][util[_0xf067('0x22')](_0xf067('0x27'),_0x24653b['name'])])){_0x7e3427[_0xf067('0x42')][util[_0xf067('0x22')](_0xf067('0x27'),_0x24653b['name'])]=new Trunk(_0x24653b);}else{_0x7e3427[_0xf067('0x40')](_0x7e3427[_0xf067('0x42')][util[_0xf067('0x22')](_0xf067('0x27'),_0x24653b[_0xf067('0x23')])],_0x24653b);}}}return _0x7e3427[_0xf067('0x42')];};};Realtime[_0xf067('0x3c')]['initVoiceQueues']=function(){var _0x50fa51=this;return function(_0x69cf8a){if(_0x69cf8a){freeIsNotKey(_0x69cf8a,_0x50fa51[_0xf067('0x12')],_0xf067('0x23'));for(var _0x4b4072=0x0,_0x9fc284={},_0x1eae54={};_0x4b4072<_0x69cf8a[_0xf067('0x43')];_0x4b4072+=0x1){_0x9fc284=_0x69cf8a[_0x4b4072];if(_['isUndefined'](_0x50fa51[_0xf067('0x12')][_0x9fc284[_0xf067('0x23')]])){_0x50fa51[_0xf067('0x12')][_0x9fc284[_0xf067('0x23')]]=new VoiceQueue(_0x9fc284);}else{_0x50fa51[_0xf067('0x40')](_0x50fa51[_0xf067('0x12')][_0x9fc284[_0xf067('0x23')]],_0x9fc284);}}}return _0x50fa51[_0xf067('0x12')];};};Realtime['prototype'][_0xf067('0x44')]=function(){var _0x3d6015=this;return function(_0x5eb1e8){if(_0x5eb1e8){freeIsNotKey(_0x5eb1e8,_0x3d6015[_0xf067('0x45')],'id');for(var _0x4f2d34=0x0,_0x3ab585={},_0x3528dd={};_0x4f2d34<_0x5eb1e8[_0xf067('0x43')];_0x4f2d34+=0x1){_0x3ab585=_0x5eb1e8[_0x4f2d34];if(_[_0xf067('0x3e')](_0x3d6015[_0xf067('0x45')][_0x3ab585['id']])){_0x3d6015[_0xf067('0x45')][_0x3ab585['id']]=new Trigger(_0x3ab585);}else{_0x3d6015['mergeFromDatabase'](_0x3d6015[_0xf067('0x45')][_0x3ab585['id']],_0x3ab585);}}}return _0x3d6015[_0xf067('0x45')];};};Realtime['prototype'][_0xf067('0x46')]=function(){var _0x4ab142=this;return function(_0x583b8f){if(_0x583b8f){freeIsNotKey(_0x583b8f,_0x4ab142['templates'],'id');for(var _0x2d8a82=0x0,_0x52e771={},_0x1bb07a={};_0x2d8a82<_0x583b8f['length'];_0x2d8a82+=0x1){_0x52e771=_0x583b8f[_0x2d8a82];if(_[_0xf067('0x3e')](_0x4ab142[_0xf067('0x14')][_0x52e771['id']])){_0x4ab142['templates'][_0x52e771['id']]=new Template(_0x52e771);}else{_0x4ab142[_0xf067('0x40')](_0x4ab142[_0xf067('0x14')][_0x52e771['id']],_0x52e771);}}}return _0x4ab142['templates'];};};Realtime[_0xf067('0x3c')][_0xf067('0x47')]=function(){var _0x41f6d1=this;return function(_0x42e4c5){if(_0x42e4c5){freeIsNotKey(_0x42e4c5,_0x41f6d1[_0xf067('0x18')],'id');for(var _0x5cb873=0x0,_0x340881={},_0x63ace={};_0x5cb873<_0x42e4c5[_0xf067('0x43')];_0x5cb873+=0x1){_0x340881=_0x42e4c5[_0x5cb873];if(_[_0xf067('0x3e')](_0x41f6d1[_0xf067('0x18')][_0x340881['id']])){_0x41f6d1[_0xf067('0x18')][_0x340881['id']]=new ZendeskAccount(_0x340881);}else{_0x41f6d1['mergeFromDatabase'](_0x41f6d1['zendeskAccounts'][_0x340881['id']],_0x340881);}}}return _0x41f6d1[_0xf067('0x18')];};};Realtime['prototype'][_0xf067('0x48')]=function(){var _0x5bcb46=this;return function(_0x53818f){if(_0x53818f){freeIsNotKey(_0x53818f,_0x5bcb46[_0xf067('0x19')],'id');for(var _0x3cf68a=0x0,_0xad49a2={},_0x1e1240={};_0x3cf68a<_0x53818f[_0xf067('0x43')];_0x3cf68a+=0x1){_0xad49a2=_0x53818f[_0x3cf68a];if(_['isUndefined'](_0x5bcb46[_0xf067('0x19')][_0xad49a2['id']])){_0x5bcb46[_0xf067('0x19')][_0xad49a2['id']]=new SalesforceAccount(_0xad49a2);}else{_0x5bcb46[_0xf067('0x40')](_0x5bcb46[_0xf067('0x19')][_0xad49a2['id']],_0xad49a2);}}}return _0x5bcb46['salesforceAccounts'];};};Realtime[_0xf067('0x3c')][_0xf067('0x49')]=function(){var _0x2ce600=this;return function(_0x153f36){if(_0x153f36){freeIsNotKey(_0x153f36,_0x2ce600[_0xf067('0x1b')],'id');for(var _0x25e44f=0x0,_0x5ec23b={},_0x4afe5c={};_0x25e44f<_0x153f36[_0xf067('0x43')];_0x25e44f+=0x1){_0x5ec23b=_0x153f36[_0x25e44f];if(_['isUndefined'](_0x2ce600[_0xf067('0x1b')][_0x5ec23b['id']])){_0x2ce600[_0xf067('0x1b')][_0x5ec23b['id']]=new FreshdeskAccount(_0x5ec23b);}else{_0x2ce600['mergeFromDatabase'](_0x2ce600[_0xf067('0x1b')][_0x5ec23b['id']],_0x5ec23b);}}}return _0x2ce600[_0xf067('0x1b')];};};Realtime[_0xf067('0x3c')][_0xf067('0x4a')]=function(){var _0x1b9bac=this;return function(_0x4e682b){if(_0x4e682b){freeIsNotKey(_0x4e682b,_0x1b9bac[_0xf067('0x1c')],'id');for(var _0x49e58e=0x0,_0x37221c={},_0x50e29c={};_0x49e58e<_0x4e682b[_0xf067('0x43')];_0x49e58e+=0x1){_0x37221c=_0x4e682b[_0x49e58e];if(_[_0xf067('0x3e')](_0x1b9bac[_0xf067('0x1c')][_0x37221c['id']])){_0x1b9bac[_0xf067('0x1c')][_0x37221c['id']]=new ZohoAccount(_0x37221c);}else{_0x1b9bac[_0xf067('0x40')](_0x1b9bac['zohoAccounts'][_0x37221c['id']],_0x37221c);}}}return _0x1b9bac[_0xf067('0x1c')];};};Realtime[_0xf067('0x3c')][_0xf067('0x4b')]=function(){var _0x8d039e=this;return function(_0x4ff8ac){if(_0x4ff8ac){freeIsNotKey(_0x4ff8ac,_0x8d039e[_0xf067('0x4c')],'id');for(var _0x2aeb63=0x0,_0x5060ef={},_0x26daf3={};_0x2aeb63<_0x4ff8ac[_0xf067('0x43')];_0x2aeb63+=0x1){_0x5060ef=_0x4ff8ac[_0x2aeb63];if(_[_0xf067('0x3e')](_0x8d039e[_0xf067('0x4c')][_0x5060ef['id']])){_0x8d039e['deskAccounts'][_0x5060ef['id']]=new DeskAccount(_0x5060ef);}else{_0x8d039e[_0xf067('0x40')](_0x8d039e[_0xf067('0x4c')][_0x5060ef['id']],_0x5060ef);}}}return _0x8d039e[_0xf067('0x4c')];};};Realtime['prototype'][_0xf067('0x4d')]=function(){var _0x527382=this;return function(_0x13e6ab){if(_0x13e6ab){freeIsNotKey(_0x13e6ab,_0x527382[_0xf067('0x1a')],'id');for(var _0x20e7f0=0x0,_0x27b704={},_0x408f75={};_0x20e7f0<_0x13e6ab[_0xf067('0x43')];_0x20e7f0+=0x1){_0x27b704=_0x13e6ab[_0x20e7f0];if(_[_0xf067('0x3e')](_0x527382['sugarcrmAccounts'][_0x27b704['id']])){_0x527382[_0xf067('0x1a')][_0x27b704['id']]=new SugarcrmAccount(_0x27b704);}else{_0x527382[_0xf067('0x40')](_0x527382[_0xf067('0x1a')][_0x27b704['id']],_0x27b704);}}}return _0x527382[_0xf067('0x1a')];};};Realtime[_0xf067('0x3c')][_0xf067('0x4e')]=function(){var _0x2f0d5c=this;return function(_0x1ef3eb){if(_0x1ef3eb){freeIsNotKey(_0x1ef3eb,_0x2f0d5c['vtigerAccounts'],'id');for(var _0x213997=0x0,_0x9facab={},_0xd77a46={};_0x213997<_0x1ef3eb['length'];_0x213997+=0x1){_0x9facab=_0x1ef3eb[_0x213997];if(_[_0xf067('0x3e')](_0x2f0d5c[_0xf067('0x1d')][_0x9facab['id']])){_0x2f0d5c['vtigerAccounts'][_0x9facab['id']]=new VtigerAccount(_0x9facab);}else{_0x2f0d5c['mergeFromDatabase'](_0x2f0d5c['vtigerAccounts'][_0x9facab['id']],_0x9facab);}}}return _0x2f0d5c[_0xf067('0x1d')];};};Realtime[_0xf067('0x3c')][_0xf067('0x4f')]=function(){var _0x5c5cac=this;return function(_0x3f8bfb){if(_0x3f8bfb){freeIsNotKey(_0x3f8bfb,_0x5c5cac[_0xf067('0x50')],'id');for(var _0x1c0749=0x0,_0x3c28c9={},_0x466f1a={};_0x1c0749<_0x3f8bfb[_0xf067('0x43')];_0x1c0749+=0x1){_0x3c28c9=_0x3f8bfb[_0x1c0749];if(_[_0xf067('0x3e')](_0x5c5cac[_0xf067('0x50')][_0x3c28c9['id']])){_0x5c5cac[_0xf067('0x50')][_0x3c28c9['id']]=new ServicenowAccount(_0x3c28c9);}else{_0x5c5cac['mergeFromDatabase'](_0x5c5cac['servicenowAccounts'][_0x3c28c9['id']],_0x3c28c9);}}}return _0x5c5cac[_0xf067('0x50')];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x283a5e=this;return function(_0x3b1653){if(_0x3b1653){freeIsNotKey(_0x3b1653,_0x283a5e[_0xf067('0x1e')],'id');for(var _0x2b8d24=0x0,_0x44ebe2={},_0x5762fb={};_0x2b8d24<_0x3b1653[_0xf067('0x43')];_0x2b8d24+=0x1){_0x44ebe2=_0x3b1653[_0x2b8d24];if(_[_0xf067('0x3e')](_0x283a5e[_0xf067('0x1e')][_0x44ebe2['id']])){_0x283a5e['dynamics365Accounts'][_0x44ebe2['id']]=new Dynamics365Account(_0x44ebe2);}else{_0x283a5e[_0xf067('0x40')](_0x283a5e[_0xf067('0x1e')][_0x44ebe2['id']],_0x44ebe2);}}}return _0x283a5e[_0xf067('0x1e')];};};Realtime[_0xf067('0x3c')][_0xf067('0x51')]=function(){var _0x58c0c0=this;return function(_0x18ec73){if(_0x18ec73){freeIsNotKey(_0x18ec73,_0x58c0c0['freshsalesAccounts'],'id');for(var _0x5c5695=0x0,_0x3ec7d1={},_0x2defba={};_0x5c5695<_0x18ec73[_0xf067('0x43')];_0x5c5695+=0x1){_0x3ec7d1=_0x18ec73[_0x5c5695];if(_[_0xf067('0x3e')](_0x58c0c0[_0xf067('0x1f')][_0x3ec7d1['id']])){_0x58c0c0[_0xf067('0x1f')][_0x3ec7d1['id']]=new FreshsalesAccount(_0x3ec7d1);}else{_0x58c0c0['mergeFromDatabase'](_0x58c0c0['freshsalesAccounts'][_0x3ec7d1['id']],_0x3ec7d1);}}}return _0x58c0c0[_0xf067('0x1f')];};};Realtime['prototype'][_0xf067('0x52')]=function(){var _0x3cc01f=this;return function(_0x1c4f4e){for(var _0x30efe0=0x0;_0x30efe0<_0x1c4f4e[_0xf067('0x43')];_0x30efe0+=0x1){_['merge'](_0x3cc01f[_0xf067('0x12')][_0x1c4f4e[_0x30efe0][_0xf067('0x23')]],_0x1c4f4e[_0x30efe0]);}return _0x3cc01f['voiceQueues'];};};Realtime[_0xf067('0x3c')][_0xf067('0x53')]=function(){var _0x9c8d09=this;return function(_0x2d1dc4){clearVoiceQueues(_0x9c8d09[_0xf067('0x12')]);if(_0x2d1dc4){_0x2d1dc4=_[_0xf067('0x54')](_0x2d1dc4,'uniqueid');for(var _0x832e84 in _0x2d1dc4){if(_0x2d1dc4['hasOwnProperty'](_0x832e84)){var _0x51cf7e={};for(var _0x282767=0x0;_0x282767<_0x2d1dc4[_0x832e84][_0xf067('0x43')];_0x282767+=0x1){var _0x376d73=_0x2d1dc4[_0x832e84][_0x282767][_0xf067('0x55')];if(_0x9c8d09['voiceQueues'][_0x376d73]){if(_0x2d1dc4[_0x832e84][_0x282767]['queuecallerexit']){_0x9c8d09[_0xf067('0x12')][_0x376d73][_0xf067('0x30')]+=0x1;}if(_0x2d1dc4[_0x832e84][_0x282767][_0xf067('0x56')]){_0x9c8d09[_0xf067('0x12')][_0x376d73]['abandoned']+=0x1;}_0x9c8d09[_0xf067('0x12')][_0x376d73]['sumHoldTime']+=moment(_0x2d1dc4[_0x832e84][_0x282767][_0xf067('0x57')])['diff'](moment(_0x2d1dc4[_0x832e84][_0x282767][_0xf067('0x58')]),'seconds')||0x0;if(_0x282767===_0x2d1dc4[_0x832e84][_0xf067('0x43')]-0x1){_0x9c8d09[_0xf067('0x12')][_0x376d73][_0xf067('0x2b')]+=moment(_0x2d1dc4[_0x832e84][_0x282767][_0xf067('0x59')]||_0x2d1dc4[_0x832e84][_0x282767][_0xf067('0x5a')]||_0x2d1dc4[_0x832e84][_0x282767][_0xf067('0x5b')])[_0xf067('0x5c')](moment(_0x2d1dc4[_0x832e84][_0x282767]['queuecallerjoinAt']),_0xf067('0x5d'))||0x0;_0x9c8d09[_0xf067('0x12')][_0x376d73][_0xf067('0x28')]+=0x1;if(_0x2d1dc4[_0x832e84][_0x282767][_0xf067('0x5e')]){_0x9c8d09[_0xf067('0x12')][_0x376d73]['answered']+=0x1;_0x9c8d09[_0xf067('0x12')][_0x376d73][_0xf067('0x2c')]+=moment(_0x2d1dc4[_0x832e84][_0x282767][_0xf067('0x59')])[_0xf067('0x5c')](moment(_0x2d1dc4[_0x832e84][_0x282767][_0xf067('0x57')]),_0xf067('0x5d'))||0x0;}}else{_0x9c8d09[_0xf067('0x12')][_0x376d73][_0xf067('0x2b')]+=_0x9c8d09[_0xf067('0x12')][_0x376d73][_0xf067('0x2a')]||0x0;}}}}}}return _0x9c8d09[_0xf067('0x12')];};};Realtime['prototype']['initVoiceCallReports']=function(){var _0x5ec96e=this;return function(_0xb0097a){clearVoiceCallReports(_0x5ec96e[_0xf067('0x15')]);if(_0xb0097a){for(var _0x16e758=0x0;_0x16e758<_0xb0097a[_0xf067('0x43')];_0x16e758+=0x1){_0x5ec96e[_0xf067('0x15')]['total']+=0x1;_0x5ec96e[_0xf067('0x15')]['sumDuration']+=_0xb0097a[_0x16e758][_0xf067('0x5f')];if(_0xb0097a[_0x16e758][_0xf067('0x60')]===_0xf067('0x61')){_0x5ec96e['outbound']['answered']+=0x1;_0x5ec96e[_0xf067('0x15')][_0xf067('0x2a')]+=_0xb0097a[_0x16e758]['duration']-_0xb0097a[_0x16e758][_0xf067('0x62')]||0x0;_0x5ec96e[_0xf067('0x15')][_0xf067('0x2c')]+=_0xb0097a[_0x16e758]['billableseconds'];}}}return _0x5ec96e[_0xf067('0x15')];};};Realtime['prototype']['initCampaigns']=function(){var _0xd41ee1=this;return function(_0x371a9f){if(_0x371a9f){freeIsNotKey(_0x371a9f,_0xd41ee1[_0xf067('0x13')],'name');for(var _0x162446=0x0,_0x4311fe={};_0x162446<_0x371a9f[_0xf067('0x43')];_0x162446+=0x1){_0x4311fe=_0x371a9f[_0x162446];if(_['isUndefined'](_0xd41ee1[_0xf067('0x13')][_0x4311fe[_0xf067('0x23')]])){_0xd41ee1[_0xf067('0x13')][_0x4311fe[_0xf067('0x23')]]=new Campaign(_0x4311fe);}else{_0xd41ee1['mergeFromDatabase'](_0xd41ee1['campaigns'][_0x4311fe['name']],_0x4311fe);_0xd41ee1[_0xf067('0x13')][_0x4311fe[_0xf067('0x23')]][_0xf067('0x63')]=_0x4311fe[_0xf067('0x64')]?_0x4311fe['SquareProject'][_0xf067('0x23')]:undefined;}}}return _0xd41ee1[_0xf067('0x13')];};};Realtime[_0xf067('0x3c')][_0xf067('0x65')]=function(){var _0x353abd=this;return function(_0x13ba5d){if(_0x13ba5d){freeIsNotKey(_0x13ba5d,_0x353abd['voiceExtensions'],'id');for(var _0x44a557=0x0,_0x8d41a={};_0x44a557<_0x13ba5d[_0xf067('0x43')];_0x44a557+=0x1){_0x8d41a=_0x13ba5d[_0x44a557];if(_[_0xf067('0x3e')](_0x353abd[_0xf067('0x66')][_0x8d41a['id']])){_0x353abd[_0xf067('0x66')][_0x8d41a['id']]=new VoiceExtension(_0x8d41a);}else{_0x353abd[_0xf067('0x40')](_0x353abd[_0xf067('0x66')][_0x8d41a['id']],_0x8d41a);}}}return _0x353abd[_0xf067('0x66')];};};Realtime[_0xf067('0x3c')][_0xf067('0x67')]=function(){var _0x5e419f=this;return function(_0x2c347c){clearCampaigns(_0x5e419f[_0xf067('0x13')]);for(var _0x5f2ec8=0x0;_0x5f2ec8<_0x2c347c['length'];_0x5f2ec8+=0x1){_['merge'](_0x5e419f['campaigns'][_0x2c347c[_0x5f2ec8]['name']],_0x2c347c[_0x5f2ec8]);}return _0x5e419f[_0xf067('0x13')];};};Realtime[_0xf067('0x3c')]['initFaxAccounts']=function(){var _0x5d8e96=this;return function(_0x2ff251){if(_0x2ff251){freeIsNotKey(_0x2ff251,_0x5d8e96[_0xf067('0x20')],'id');for(var _0x345705=0x0,_0x8ced0a={},_0x2e3973={};_0x345705<_0x2ff251[_0xf067('0x43')];_0x345705+=0x1){_0x8ced0a=_0x2ff251[_0x345705];if(_[_0xf067('0x3e')](_0x5d8e96[_0xf067('0x20')][_0x8ced0a['id']])){_0x5d8e96[_0xf067('0x20')][_0x8ced0a['id']]=new FaxAccount(_0x8ced0a);}else{_0x5d8e96[_0xf067('0x40')](_0x5d8e96[_0xf067('0x20')][_0x8ced0a['id']],_0x8ced0a);}}}return _0x5d8e96[_0xf067('0x20')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 84cd238..e68fd26 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 _0x6d7d=['calleridname','transfers','linkedid','transfereelinkedid','uniqueid','monitor','monitors','createdAt','exten','connectedlinename','membername','originatecalleridnum','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','voiceQueueReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','accountcode','name','isNil','find','length','connectedlinenum','assigned','interface','format','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','type','dialer','lastapplication','queue','lastdata','context','from-sip','xcally-motion-preview','calleridnum','destinationchannel','channel','disposition','callerid','\x22%s\x22\x20<%s>'];(function(_0x4fc847,_0x4d91de){var _0xd1a04e=function(_0x518c98){while(--_0x518c98){_0x4fc847['push'](_0x4fc847['shift']());}};_0xd1a04e(++_0x4d91de);}(_0x6d7d,0xc3));var _0xd6d7=function(_0x2f7fc1,_0x48abd0){_0x2f7fc1=_0x2f7fc1-0x0;var _0x35ddc5=_0x6d7d[_0x2f7fc1];return _0x35ddc5;};'use strict';var _=require(_0xd6d7('0x0'));var moment=require(_0xd6d7('0x1'));var util=require('util');var config=require(_0xd6d7('0x2'));var ami=require(_0xd6d7('0x3'));var RpcVoiceAgentReport=require(_0xd6d7('0x4'));var RpcVoiceCallReport=require(_0xd6d7('0x5'));var RpcVoiceDialReport=require(_0xd6d7('0x6'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xd6d7('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xd6d7('0x8'));var VoiceCallReport=require(_0xd6d7('0x9'));var VoiceAgentReport=require(_0xd6d7('0xa'));var VoiceDialReport=require(_0xd6d7('0xb'));var UserReport=require(_0xd6d7('0xc'));function Report(_0x5aaa5d){this[_0xd6d7('0xd')]=_0x5aaa5d;this[_0xd6d7('0xe')]=_0x5aaa5d[_0xd6d7('0xe')];this[_0xd6d7('0xf')]=_0x5aaa5d[_0xd6d7('0xf')];}Report[_0xd6d7('0x10')][_0xd6d7('0x11')]=function(_0xf4f71d){var _0x5372d3=new VoiceQueueReport(this[_0xd6d7('0xd')]);var _0x5d7260=new VoiceAgentReport(this[_0xd6d7('0xd')]);var _0x5ee2a7=new VoiceDialReport(this['realtime']);var _0x26ec94=new VoiceCallReport(this[_0xd6d7('0xd')]);var _0x104861=new UserReport(this['realtime']);if(config[_0xd6d7('0x12')]&&config[_0xd6d7('0x12')][_0xd6d7('0x13')]){ami['on']('custom:voiceQueueReport',this[_0xd6d7('0x14')]['bind'](this));ami['on']('custom:voiceCallReport',this[_0xd6d7('0x15')][_0xd6d7('0x16')](this));ami['on'](_0xd6d7('0x17'),this[_0xd6d7('0x18')]['bind'](this));ami['on'](_0xd6d7('0x19'),this[_0xd6d7('0x1a')]['bind'](this));ami['on'](_0xd6d7('0x1b'),this[_0xd6d7('0x1c')][_0xd6d7('0x16')](this));ami['on']('attendedtransfer',this[_0xd6d7('0x1d')][_0xd6d7('0x16')](this));}};Report[_0xd6d7('0x10')][_0xd6d7('0x1e')]=function(_0x15c0ea){var _0x351a5e;_0x351a5e=_['find'](this[_0xd6d7('0xe')],function(_0x2022ac){return _0x2022ac[_0xd6d7('0x1f')]==_0x15c0ea||_0x2022ac[_0xd6d7('0x20')]==_0x15c0ea;});if(_[_0xd6d7('0x21')](_0x351a5e)){var _0x23ed18=_[_0xd6d7('0x22')](this['telephones'],function(_0x19bfca){return _0x19bfca['accountcode']==_0x15c0ea||_0x19bfca[_0xd6d7('0x20')]==_0x15c0ea;});if(_0x23ed18){_0x351a5e=_[_0xd6d7('0x22')](this[_0xd6d7('0xe')],function(_0x59f23c){return _0x59f23c['interface']==util['format']('SIP/%s',_0x23ed18[_0xd6d7('0x20')]);});}}return _0x351a5e;};Report[_0xd6d7('0x10')]['voiceQueueReport']=function(_0x27924d){for(var _0xe0b63d=0x0;_0xe0b63d<_0x27924d[_0xd6d7('0x23')];_0xe0b63d+=0x1){var _0x10727f=this['findAgent'](_0x27924d[_0xe0b63d][_0xd6d7('0x24')]);if(_0x10727f){_0x27924d[_0xe0b63d][_0xd6d7('0x1f')]=_0x10727f['accountcode'];_0x27924d[_0xe0b63d][_0xd6d7('0x25')]=!![];_0x27924d[_0xe0b63d]['lastAssignedTo']=_0x10727f[_0xd6d7('0x20')];_0x27924d[_0xe0b63d][_0xd6d7('0x26')]=_[_0xd6d7('0x21')](_0x10727f[_0xd6d7('0x26')])?util[_0xd6d7('0x27')](_0xd6d7('0x28'),_0x10727f[_0xd6d7('0x20')]):_0x10727f[_0xd6d7('0x26')];if(_0x27924d[_0xe0b63d][_0xd6d7('0x29')]){_0x27924d[_0xe0b63d][_0xd6d7('0x2a')]=moment()['format'](_0xd6d7('0x2b'));}if(_0x27924d[_0xe0b63d][_0xd6d7('0x2c')]){_0x27924d[_0xe0b63d][_0xd6d7('0x2d')]=moment()['format'](_0xd6d7('0x2b'));}RpcMemberReport['voiceQueueReport'](_0x27924d[_0xe0b63d]);}RpcVoiceQueueReport[_0xd6d7('0x2e')](_0x27924d[_0xe0b63d]);}};function extractCalleridNumber(_0x36295c){var _0x3d632a=_0x36295c[_0xd6d7('0x2f')](/<(.*?)>/);return _0x3d632a?_0x3d632a[0x1]:_0x36295c;}Report['prototype'][_0xd6d7('0x15')]=function(_0xcf58b5){_0xcf58b5['destination']=_0xcf58b5[_0xd6d7('0x30')]||_0xcf58b5['exten'];if(_0xcf58b5[_0xd6d7('0x31')]==_0xd6d7('0x32')){_0xcf58b5[_0xd6d7('0x33')]=_0xd6d7('0x34');_0xcf58b5[_0xd6d7('0x35')]=_0xcf58b5[_0xd6d7('0x34')];if(_0xcf58b5[_0xd6d7('0x36')]=='from-voip-provider'){_0xcf58b5[_0xd6d7('0x1f')]='';_0xcf58b5[_0xd6d7('0x30')]=extractCalleridNumber(_0xcf58b5['callerid']);}else if(_0xcf58b5[_0xd6d7('0x36')]==_0xd6d7('0x37')){if(_0xcf58b5[_0xd6d7('0x30')]==_0xd6d7('0x38')){_0xcf58b5[_0xd6d7('0x30')]=extractCalleridNumber(_0xcf58b5['calleridpreview']);_0xcf58b5[_0xd6d7('0x39')]=_0xcf58b5['originatecalleridnum'];_0xcf58b5[_0xd6d7('0x3a')]=[_0xcf58b5['channel'],_0xcf58b5[_0xd6d7('0x3b')]=_0xcf58b5['destinationchannel']][0x0];_0xcf58b5['callerid']=_0xcf58b5['calleridpreview'];}else{_0xcf58b5['destination']=_0xcf58b5['calleridnum'];_0xcf58b5['calleridnum']=_0xcf58b5['originatecalleridnum'];if(_0xcf58b5[_0xd6d7('0x3c')]=='ANSWERED'){_0xcf58b5[_0xd6d7('0x1f')]=_0xcf58b5[_0xd6d7('0x24')];}else{_0xcf58b5[_0xd6d7('0x1f')]='';}}}}else{_0xcf58b5[_0xd6d7('0x3d')]=util[_0xd6d7('0x27')](_0xd6d7('0x3e'),_0xcf58b5[_0xd6d7('0x3f')],_0xcf58b5[_0xd6d7('0x39')]);}if(RpcVoiceTransferReport[_0xd6d7('0x40')][_0xcf58b5[_0xd6d7('0x41')]]){var _0x115a10=RpcVoiceTransferReport['transfers'][_0xcf58b5[_0xd6d7('0x41')]];_0x115a10[_0xd6d7('0x42')]=_0xcf58b5[_0xd6d7('0x43')];RpcVoiceTransferReport[_0xd6d7('0x1c')](_0x115a10);delete RpcVoiceTransferReport[_0xd6d7('0x40')][_0xcf58b5[_0xd6d7('0x41')]];}RpcVoiceCallReport['create'](_0xcf58b5);if(_0xcf58b5[_0xd6d7('0x44')]){for(var _0x335598=0x0;_0x335598<_0xcf58b5[_0xd6d7('0x45')][_0xd6d7('0x23')];_0x335598+=0x1){_0xcf58b5['monitorFilename']=_0xcf58b5['monitors'][_0x335598]['filename'];_0xcf58b5[_0xd6d7('0x46')]=_0xcf58b5[_0xd6d7('0x45')][_0x335598]['createdAt'];if(_0xcf58b5[_0xd6d7('0x47')]==_0xd6d7('0x38')){_0xcf58b5[_0xd6d7('0x39')]=_0xcf58b5[_0xd6d7('0x24')];_0xcf58b5[_0xd6d7('0x3f')]=_0xcf58b5[_0xd6d7('0x48')];_0xcf58b5['connectedlinenum']=_0xcf58b5[_0xd6d7('0x1f')];_0xcf58b5[_0xd6d7('0x48')]=_0xcf58b5[_0xd6d7('0x49')];_0xcf58b5[_0xd6d7('0x47')]=_0xcf58b5[_0xd6d7('0x4a')];}else if(_0xcf58b5[_0xd6d7('0x47')]==_0xd6d7('0x4b')){_0xcf58b5['calleridnum']=_0xcf58b5[_0xd6d7('0x30')];_0xcf58b5[_0xd6d7('0x47')]=_0xcf58b5[_0xd6d7('0x4a')];}RpcVoiceRecording[_0xd6d7('0x2e')](_0xcf58b5);}}};Report['prototype'][_0xd6d7('0x18')]=function(_0x530adb){if(_[_0xd6d7('0x4c')](_0x530adb)){_0x530adb[_0xd6d7('0x4d')](function(_0x3253ed){RpcVoiceAgentReport[_0xd6d7('0x2e')](_0x3253ed);});}else{RpcVoiceAgentReport[_0xd6d7('0x2e')](_0x530adb);}};Report[_0xd6d7('0x10')][_0xd6d7('0x1a')]=function(_0xbcac01){RpcVoiceDialReport[_0xd6d7('0x2e')](_0xbcac01);var _0x5b5b80;var _0x1ab086;var _0x5ea06e=_0xbcac01[_0xd6d7('0x3b')];if(_[_0xd6d7('0x4e')](_0x5ea06e,_0xd6d7('0x4f'))){_0x1ab086=_0x5ea06e[_0xd6d7('0x50')](_0x5ea06e[_0xd6d7('0x51')]('/')+0x1,_0x5ea06e[_0xd6d7('0x51')]('@'));_0x5b5b80=_[_0xd6d7('0x22')](this[_0xd6d7('0xe')],function(_0x4ad04d){return _0x4ad04d['mobile']==_0x1ab086||_0x4ad04d[_0xd6d7('0x52')]==_0x1ab086||_0x4ad04d[_0xd6d7('0x1f')]==_0x1ab086;});}else{_0x1ab086=_0x5ea06e['substring'](_0x5ea06e['indexOf']('/')+0x1,_0x5ea06e[_0xd6d7('0x53')]('-'));_0x5b5b80=this[_0xd6d7('0x1e')](_0x1ab086);}if(_0x5b5b80){_0xbcac01[_0xd6d7('0x26')]=_[_0xd6d7('0x21')](_0x5b5b80['interface'])?util[_0xd6d7('0x27')](_0xd6d7('0x28'),_0x5b5b80['name']):_0x5b5b80[_0xd6d7('0x26')];_0xbcac01[_0xd6d7('0x49')]=_0x5b5b80[_0xd6d7('0x20')];_0xbcac01[_0xd6d7('0x1f')]=_0x5b5b80['accountcode'];RpcMemberReport[_0xd6d7('0x1a')](_0xbcac01);}};Report[_0xd6d7('0x10')][_0xd6d7('0x1c')]=function(_0x4df16d){RpcVoiceTransferReport[_0xd6d7('0x40')][_0x4df16d[_0xd6d7('0x54')]]=_0x4df16d;};Report[_0xd6d7('0x10')]['attendedTransfer']=function(_0x15bd72){RpcVoiceTransferReport[_0xd6d7('0x1d')](_0x15bd72);};module[_0xd6d7('0x55')]=Report; \ No newline at end of file +var _0xf7d1=['queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','lastdata','queue','context','from-voip-provider','destinationchannel','channel','calleridnum','originatecalleridnum','disposition','ANSWERED','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','monitor','monitors','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','startsWith','indexOf','mobile','phone','substring','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','sync','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','prototype','findAgent','find','accountcode','name','isNil','format','SIP/%s','length','connectedlinenum','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3f3663,_0xa80fa8){var _0x3b9dd0=function(_0x1acf1c){while(--_0x1acf1c){_0x3f3663['push'](_0x3f3663['shift']());}};_0x3b9dd0(++_0xa80fa8);}(_0xf7d1,0x188));var _0x1f7d=function(_0x481726,_0x1376ec){_0x481726=_0x481726-0x0;var _0x4d5f55=_0xf7d1[_0x481726];return _0x4d5f55;};'use strict';var _=require(_0x1f7d('0x0'));var moment=require(_0x1f7d('0x1'));var util=require(_0x1f7d('0x2'));var config=require(_0x1f7d('0x3'));var ami=require(_0x1f7d('0x4'));var RpcVoiceAgentReport=require(_0x1f7d('0x5'));var RpcVoiceCallReport=require(_0x1f7d('0x6'));var RpcVoiceDialReport=require(_0x1f7d('0x7'));var RpcMemberReport=require(_0x1f7d('0x8'));var RpcVoiceQueueReport=require(_0x1f7d('0x9'));var RpcVoiceRecording=require(_0x1f7d('0xa'));var RpcVoiceTransferReport=require(_0x1f7d('0xb'));var VoiceQueueReport=require(_0x1f7d('0xc'));var VoiceCallReport=require(_0x1f7d('0xd'));var VoiceAgentReport=require(_0x1f7d('0xe'));var VoiceDialReport=require(_0x1f7d('0xf'));var UserReport=require('./userReport');function Report(_0x5284f7){this[_0x1f7d('0x10')]=_0x5284f7;this[_0x1f7d('0x11')]=_0x5284f7[_0x1f7d('0x11')];this[_0x1f7d('0x12')]=_0x5284f7['telephones'];}Report['prototype'][_0x1f7d('0x13')]=function(_0x46165d){var _0x1b86a8=new VoiceQueueReport(this[_0x1f7d('0x10')]);var _0x5ba271=new VoiceAgentReport(this[_0x1f7d('0x10')]);var _0x1d4ae0=new VoiceDialReport(this[_0x1f7d('0x10')]);var _0x511530=new VoiceCallReport(this['realtime']);var _0x26258e=new UserReport(this[_0x1f7d('0x10')]);if(config[_0x1f7d('0x14')]&&config[_0x1f7d('0x14')][_0x1f7d('0x15')]){ami['on']('custom:voiceQueueReport',this[_0x1f7d('0x16')][_0x1f7d('0x17')](this));ami['on'](_0x1f7d('0x18'),this[_0x1f7d('0x19')][_0x1f7d('0x17')](this));ami['on'](_0x1f7d('0x1a'),this[_0x1f7d('0x1b')]['bind'](this));ami['on'](_0x1f7d('0x1c'),this[_0x1f7d('0x1d')]['bind'](this));ami['on'](_0x1f7d('0x1e'),this[_0x1f7d('0x1f')][_0x1f7d('0x17')](this));ami['on']('attendedtransfer',this[_0x1f7d('0x20')]['bind'](this));}};Report[_0x1f7d('0x21')][_0x1f7d('0x22')]=function(_0x39dbbd){var _0x3d46ef;_0x3d46ef=_[_0x1f7d('0x23')](this['agents'],function(_0x101771){return _0x101771[_0x1f7d('0x24')]==_0x39dbbd||_0x101771[_0x1f7d('0x25')]==_0x39dbbd;});if(_[_0x1f7d('0x26')](_0x3d46ef)){var _0x199b0d=_[_0x1f7d('0x23')](this[_0x1f7d('0x12')],function(_0x1d2740){return _0x1d2740[_0x1f7d('0x24')]==_0x39dbbd||_0x1d2740[_0x1f7d('0x25')]==_0x39dbbd;});if(_0x199b0d){_0x3d46ef=_[_0x1f7d('0x23')](this[_0x1f7d('0x11')],function(_0x1ab7aa){return _0x1ab7aa['interface']==util[_0x1f7d('0x27')](_0x1f7d('0x28'),_0x199b0d[_0x1f7d('0x25')]);});}}return _0x3d46ef;};Report[_0x1f7d('0x21')][_0x1f7d('0x16')]=function(_0x42e3ac){for(var _0x2706c2=0x0;_0x2706c2<_0x42e3ac[_0x1f7d('0x29')];_0x2706c2+=0x1){var _0x52b857=this[_0x1f7d('0x22')](_0x42e3ac[_0x2706c2][_0x1f7d('0x2a')]);if(_0x52b857){_0x42e3ac[_0x2706c2]['accountcode']=_0x52b857['accountcode'];_0x42e3ac[_0x2706c2]['assigned']=!![];_0x42e3ac[_0x2706c2][_0x1f7d('0x2b')]=_0x52b857[_0x1f7d('0x25')];_0x42e3ac[_0x2706c2][_0x1f7d('0x2c')]=_[_0x1f7d('0x26')](_0x52b857[_0x1f7d('0x2c')])?util[_0x1f7d('0x27')]('SIP/%s',_0x52b857['name']):_0x52b857[_0x1f7d('0x2c')];if(_0x42e3ac[_0x2706c2][_0x1f7d('0x2d')]){_0x42e3ac[_0x2706c2][_0x1f7d('0x2e')]=moment()[_0x1f7d('0x27')](_0x1f7d('0x2f'));}if(_0x42e3ac[_0x2706c2][_0x1f7d('0x30')]){_0x42e3ac[_0x2706c2][_0x1f7d('0x31')]=moment()[_0x1f7d('0x27')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x1f7d('0x16')](_0x42e3ac[_0x2706c2]);}RpcVoiceQueueReport[_0x1f7d('0x32')](_0x42e3ac[_0x2706c2]);}};function extractCalleridNumber(_0x5ceb94){var _0x5099d8=_0x5ceb94[_0x1f7d('0x33')](/<(.*?)>/);return _0x5099d8?_0x5099d8[0x1]:_0x5ceb94;}Report[_0x1f7d('0x21')][_0x1f7d('0x19')]=function(_0xdd8ecf){_0xdd8ecf['destination']=_0xdd8ecf[_0x1f7d('0x34')]||_0xdd8ecf[_0x1f7d('0x35')];if(_0xdd8ecf[_0x1f7d('0x36')]==_0x1f7d('0x37')){_0xdd8ecf[_0x1f7d('0x38')]='queue';_0xdd8ecf[_0x1f7d('0x39')]=_0xdd8ecf[_0x1f7d('0x3a')];if(_0xdd8ecf[_0x1f7d('0x3b')]==_0x1f7d('0x3c')){_0xdd8ecf[_0x1f7d('0x24')]='';_0xdd8ecf[_0x1f7d('0x34')]=extractCalleridNumber(_0xdd8ecf['callerid']);}else if(_0xdd8ecf[_0x1f7d('0x3b')]=='from-sip'){if(_0xdd8ecf[_0x1f7d('0x34')]=='xcally-motion-preview'){_0xdd8ecf[_0x1f7d('0x34')]=extractCalleridNumber(_0xdd8ecf['calleridpreview']);_0xdd8ecf['calleridnum']=_0xdd8ecf['originatecalleridnum'];_0xdd8ecf[_0x1f7d('0x3d')]=[_0xdd8ecf[_0x1f7d('0x3e')],_0xdd8ecf[_0x1f7d('0x3e')]=_0xdd8ecf[_0x1f7d('0x3d')]][0x0];_0xdd8ecf['callerid']=_0xdd8ecf['calleridpreview'];}else{_0xdd8ecf[_0x1f7d('0x34')]=_0xdd8ecf[_0x1f7d('0x3f')];_0xdd8ecf[_0x1f7d('0x3f')]=_0xdd8ecf[_0x1f7d('0x40')];if(_0xdd8ecf[_0x1f7d('0x41')]==_0x1f7d('0x42')){_0xdd8ecf[_0x1f7d('0x24')]=_0xdd8ecf[_0x1f7d('0x2a')];}else{_0xdd8ecf[_0x1f7d('0x24')]='';}}}}else{_0xdd8ecf['callerid']=util[_0x1f7d('0x27')]('\x22%s\x22\x20<%s>',_0xdd8ecf[_0x1f7d('0x43')],_0xdd8ecf[_0x1f7d('0x3f')]);}if(RpcVoiceTransferReport[_0x1f7d('0x44')][_0xdd8ecf[_0x1f7d('0x45')]]){var _0x37ad81=RpcVoiceTransferReport[_0x1f7d('0x44')][_0xdd8ecf['linkedid']];_0x37ad81[_0x1f7d('0x46')]=_0xdd8ecf[_0x1f7d('0x47')];RpcVoiceTransferReport['blindTransfer'](_0x37ad81);delete RpcVoiceTransferReport[_0x1f7d('0x44')][_0xdd8ecf[_0x1f7d('0x45')]];}RpcVoiceCallReport['create'](_0xdd8ecf);if(_0xdd8ecf[_0x1f7d('0x48')]){for(var _0x56b2c7=0x0;_0x56b2c7<_0xdd8ecf[_0x1f7d('0x49')][_0x1f7d('0x29')];_0x56b2c7+=0x1){_0xdd8ecf['monitorFilename']=_0xdd8ecf[_0x1f7d('0x49')][_0x56b2c7][_0x1f7d('0x4a')];_0xdd8ecf[_0x1f7d('0x4b')]=_0xdd8ecf[_0x1f7d('0x49')][_0x56b2c7][_0x1f7d('0x4b')];if(_0xdd8ecf[_0x1f7d('0x35')]=='xcally-motion-preview'){_0xdd8ecf[_0x1f7d('0x3f')]=_0xdd8ecf[_0x1f7d('0x2a')];_0xdd8ecf['calleridname']=_0xdd8ecf[_0x1f7d('0x4c')];_0xdd8ecf[_0x1f7d('0x2a')]=_0xdd8ecf[_0x1f7d('0x24')];_0xdd8ecf[_0x1f7d('0x4c')]=_0xdd8ecf[_0x1f7d('0x4d')];_0xdd8ecf[_0x1f7d('0x35')]=_0xdd8ecf['originatecalleridnum'];}else if(_0xdd8ecf[_0x1f7d('0x35')]==_0x1f7d('0x4e')){_0xdd8ecf[_0x1f7d('0x3f')]=_0xdd8ecf[_0x1f7d('0x34')];_0xdd8ecf[_0x1f7d('0x35')]=_0xdd8ecf[_0x1f7d('0x40')];}RpcVoiceRecording[_0x1f7d('0x32')](_0xdd8ecf);}}};Report[_0x1f7d('0x21')][_0x1f7d('0x1b')]=function(_0x549b79){if(_[_0x1f7d('0x4f')](_0x549b79)){_0x549b79['forEach'](function(_0x9bc61a){RpcVoiceAgentReport[_0x1f7d('0x32')](_0x9bc61a);});}else{RpcVoiceAgentReport[_0x1f7d('0x32')](_0x549b79);}};Report[_0x1f7d('0x21')][_0x1f7d('0x1d')]=function(_0x34615c){RpcVoiceDialReport['create'](_0x34615c);var _0x17a850;var _0x2ef4db;var _0x5422f4=_0x34615c[_0x1f7d('0x3e')];if(_[_0x1f7d('0x50')](_0x5422f4,'Local')){_0x2ef4db=_0x5422f4['substring'](_0x5422f4[_0x1f7d('0x51')]('/')+0x1,_0x5422f4['indexOf']('@'));_0x17a850=_['find'](this[_0x1f7d('0x11')],function(_0xca7ee7){return _0xca7ee7[_0x1f7d('0x52')]==_0x2ef4db||_0xca7ee7[_0x1f7d('0x53')]==_0x2ef4db||_0xca7ee7[_0x1f7d('0x24')]==_0x2ef4db;});}else{_0x2ef4db=_0x5422f4[_0x1f7d('0x54')](_0x5422f4[_0x1f7d('0x51')]('/')+0x1,_0x5422f4[_0x1f7d('0x55')]('-'));_0x17a850=this[_0x1f7d('0x22')](_0x2ef4db);}if(_0x17a850){_0x34615c[_0x1f7d('0x2c')]=_[_0x1f7d('0x26')](_0x17a850['interface'])?util[_0x1f7d('0x27')](_0x1f7d('0x28'),_0x17a850[_0x1f7d('0x25')]):_0x17a850[_0x1f7d('0x2c')];_0x34615c[_0x1f7d('0x4d')]=_0x17a850['name'];_0x34615c['accountcode']=_0x17a850['accountcode'];RpcMemberReport[_0x1f7d('0x1d')](_0x34615c);}};Report[_0x1f7d('0x21')][_0x1f7d('0x1f')]=function(_0x47606a){RpcVoiceTransferReport['transfers'][_0x47606a[_0x1f7d('0x56')]]=_0x47606a;};Report[_0x1f7d('0x21')][_0x1f7d('0x20')]=function(_0x51b106){RpcVoiceTransferReport[_0x1f7d('0x20')](_0x51b106);};module[_0x1f7d('0x57')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 7d999e4..b497b32 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8eac=['name','trunk:save','[userReport][registry]','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','Local','substring','indexOf','mobile','phone','accountcode','updateStatusRealtime','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','error','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','find','stateRegistry','merge','omit','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format'];(function(_0x106493,_0x3a36dc){var _0x3b9ca0=function(_0x5b12a3){while(--_0x5b12a3){_0x106493['push'](_0x106493['shift']());}};_0x3b9ca0(++_0x3a36dc);}(_0x8eac,0x1ed));var _0xc8ea=function(_0x47cde9,_0x19d013){_0x47cde9=_0x47cde9-0x0;var _0x26fdf1=_0x8eac[_0x47cde9];return _0x26fdf1;};'use strict';var _=require('lodash');var moment=require(_0xc8ea('0x0'));var util=require(_0xc8ea('0x1'));var Redis=require(_0xc8ea('0x2'));var BPromise=require(_0xc8ea('0x3'));var config=require(_0xc8ea('0x4'));var logger=require(_0xc8ea('0x5'))(_0xc8ea('0x6'));var ami=require('../ami');config[_0xc8ea('0x7')]=_[_0xc8ea('0x8')](config[_0xc8ea('0x7')],{'host':_0xc8ea('0x9'),'port':0x18eb});var io=require(_0xc8ea('0xa'))(new Redis(config['redis']));function UserReport(_0x4b0272){this[_0xc8ea('0xb')]=_0x4b0272[_0xc8ea('0xb')];this['agents']=_0x4b0272[_0xc8ea('0xc')];this[_0xc8ea('0xd')]=_0x4b0272[_0xc8ea('0xd')];ami['on']('registryentry',this[_0xc8ea('0xe')]['bind'](this));ami['on'](_0xc8ea('0xf'),this[_0xc8ea('0xe')][_0xc8ea('0x10')](this));ami['on'](_0xc8ea('0x11'),this[_0xc8ea('0x12')][_0xc8ea('0x10')](this));ami['on'](_0xc8ea('0x13'),this['syncPeerStatus'][_0xc8ea('0x10')](this));return this[_0xc8ea('0x14')]();}function showSipRegistrations(){Promise[_0xc8ea('0x15')]()[_0xc8ea('0x16')](ami[_0xc8ea('0x17')]())[_0xc8ea('0x18')](function(_0x349717){logger['error']('[userReport][sipshowregistry]',util[_0xc8ea('0x19')](_0x349717,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xc8ea('0x15')]()[_0xc8ea('0x16')](ami[_0xc8ea('0x1a')]())[_0xc8ea('0x18')](function(_0x291ba4){logger['error'](_0xc8ea('0x1b'),util['inspect'](_0x291ba4,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xc8ea('0x15')]()[_0xc8ea('0x16')](ami[_0xc8ea('0x1c')]())[_0xc8ea('0x18')](function(_0x29346b){logger[_0xc8ea('0x1d')](_0xc8ea('0x1e'),util[_0xc8ea('0x19')](_0x29346b,{'showHidden':![],'depth':null}));});}UserReport[_0xc8ea('0x1f')][_0xc8ea('0x14')]=function(){setInterval(function(){BPromise[_0xc8ea('0x15')]()[_0xc8ea('0x16')](showSipRegistrations())[_0xc8ea('0x16')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0xc8ea('0x1f')][_0xc8ea('0x20')]=function(_0xb39e96){return _0xb39e96!==null&&!_[_0xc8ea('0x21')](_0xb39e96);};UserReport[_0xc8ea('0x1f')][_0xc8ea('0x22')]=function(_0x13c304,_0x3a88ba,_0x2b6f17){io['to'](_0x13c304)[_0xc8ea('0x22')](_0x3a88ba,_0x2b6f17);};UserReport[_0xc8ea('0x1f')][_0xc8ea('0xe')]=function(_0xc48ea2){try{if(this[_0xc8ea('0x20')](_0xc48ea2)){logger['info'](_0xc8ea('0x23'),_0xc48ea2[_0xc8ea('0x24')],_0xc48ea2[_0xc8ea('0x25')]);logger[_0xc8ea('0x26')]('[userReport][registry]',util[_0xc8ea('0x19')](_0xc48ea2,{'showHidden':![],'depth':null}));var _0x2cb5de=_[_0xc8ea('0x27')](this[_0xc8ea('0xb')],{'defaultuser':_0xc48ea2[_0xc8ea('0x24')]});if(_0x2cb5de){_0xc48ea2[_0xc8ea('0x28')]=_0xc48ea2[_0xc8ea('0x25')];_[_0xc8ea('0x29')](_0x2cb5de,_[_0xc8ea('0x2a')](_0xc48ea2,['event',_0xc8ea('0x2b'),_0xc8ea('0x24'),_0xc8ea('0x25')]));logger[_0xc8ea('0x26')](_0xc8ea('0x2c'),util['inspect'](_0x2cb5de,{'showHidden':![],'depth':null}));this['emit'](util[_0xc8ea('0x2d')]('trunk:%s',_0x2cb5de[_0xc8ea('0x2e')]),_0xc8ea('0x2f'),_0x2cb5de);}}}catch(_0x1cdfc9){logger[_0xc8ea('0x1d')](_0xc8ea('0x30'),util[_0xc8ea('0x19')](_0x1cdfc9,{'showHidden':![],'depth':null}));}};UserReport[_0xc8ea('0x1f')]['syncDeviceState']=function(_0x2d6bf0){try{if(this[_0xc8ea('0x20')](_0x2d6bf0)){logger[_0xc8ea('0x31')](_0xc8ea('0x32'),_0x2d6bf0[_0xc8ea('0x33')],_0x2d6bf0[_0xc8ea('0x25')]);logger['debug'](_0xc8ea('0x34'),util[_0xc8ea('0x19')](_0x2d6bf0,{'showHidden':![],'depth':null}));if(this[_0xc8ea('0xc')][_0x2d6bf0['device']]){if(!this[_0xc8ea('0xc')][_0x2d6bf0[_0xc8ea('0x33')]][_0xc8ea('0x35')]||_0x2d6bf0[_0xc8ea('0x25')][_0xc8ea('0x36')]()==_0xc8ea('0x37')){this['agents'][_0x2d6bf0[_0xc8ea('0x33')]]['local']=![];if(this[_0xc8ea('0xc')][_0x2d6bf0[_0xc8ea('0x33')]][_0xc8ea('0x25')]!==_0x2d6bf0[_0xc8ea('0x25')]['toLowerCase']()){this['agents'][_0x2d6bf0['device']][_0xc8ea('0x38')]=_['toNumber'](moment()[_0xc8ea('0x2d')]('x'));}this[_0xc8ea('0xc')][_0x2d6bf0[_0xc8ea('0x33')]][_0xc8ea('0x25')]=_0x2d6bf0[_0xc8ea('0x25')]['toLowerCase']();this[_0xc8ea('0xc')][_0x2d6bf0[_0xc8ea('0x33')]]['updateStatusRealtime'](_0x2d6bf0);}}else if(this[_0xc8ea('0xd')][_0x2d6bf0[_0xc8ea('0x33')]]){if(this[_0xc8ea('0xd')][_0x2d6bf0['device']]['state']!==_0x2d6bf0[_0xc8ea('0x25')][_0xc8ea('0x36')]()){this[_0xc8ea('0xd')][_0x2d6bf0[_0xc8ea('0x33')]][_0xc8ea('0x38')]=_[_0xc8ea('0x39')](moment()[_0xc8ea('0x2d')]('x'));}this[_0xc8ea('0xd')][_0x2d6bf0[_0xc8ea('0x33')]][_0xc8ea('0x25')]=_0x2d6bf0['state']['toLowerCase']();logger['debug']('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0xc8ea('0x19')](this['telephones'][_0x2d6bf0[_0xc8ea('0x33')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xc8ea('0x2d')](_0xc8ea('0x3a'),this[_0xc8ea('0xd')][_0x2d6bf0[_0xc8ea('0x33')]][_0xc8ea('0x2e')]),_0xc8ea('0x3b'),this['telephones'][_0x2d6bf0['device']]);}else if(this[_0xc8ea('0xb')][_0x2d6bf0[_0xc8ea('0x33')]]){if(this[_0xc8ea('0xb')][_0x2d6bf0['device']][_0xc8ea('0x25')]!==_0x2d6bf0[_0xc8ea('0x25')][_0xc8ea('0x36')]()){this['trunks'][_0x2d6bf0['device']][_0xc8ea('0x38')]=_['toNumber'](moment()[_0xc8ea('0x2d')]('x'));}this['trunks'][_0x2d6bf0[_0xc8ea('0x33')]][_0xc8ea('0x25')]=_0x2d6bf0['state'][_0xc8ea('0x36')]();logger[_0xc8ea('0x26')](_0xc8ea('0x3c'),util['inspect'](this['trunks'][_0x2d6bf0[_0xc8ea('0x33')]],{'showHidden':![],'depth':null}));this[_0xc8ea('0x22')](util[_0xc8ea('0x2d')](_0xc8ea('0x3d'),this[_0xc8ea('0xb')][_0x2d6bf0[_0xc8ea('0x33')]][_0xc8ea('0x2e')]),_0xc8ea('0x2f'),this['trunks'][_0x2d6bf0[_0xc8ea('0x33')]]);}else if(_['startsWith'](_0x2d6bf0[_0xc8ea('0x33')],_0xc8ea('0x3e'))){var _0x5d9ddb=_0x2d6bf0[_0xc8ea('0x33')];var _0x1e0c8d=_0x5d9ddb[_0xc8ea('0x3f')](_0x5d9ddb[_0xc8ea('0x40')]('/')+0x1,_0x5d9ddb[_0xc8ea('0x40')]('@'));var _0x47e115=_['find'](this[_0xc8ea('0xc')],function(_0x194649){return _0x194649[_0xc8ea('0x41')]==_0x1e0c8d||_0x194649[_0xc8ea('0x42')]==_0x1e0c8d||_0x194649[_0xc8ea('0x43')]==_0x1e0c8d;});if(_0x47e115){if(_0x47e115[_0xc8ea('0x25')]!==_0x2d6bf0['state'][_0xc8ea('0x36')]()){_0x47e115['stateTime']=_[_0xc8ea('0x39')](moment()[_0xc8ea('0x2d')]('x'));}_0x47e115[_0xc8ea('0x25')]=_0x2d6bf0[_0xc8ea('0x25')][_0xc8ea('0x36')]();_0x47e115[_0xc8ea('0x35')]=!![];_0x47e115[_0xc8ea('0x44')](_0x2d6bf0);}}}}catch(_0x4aa173){logger[_0xc8ea('0x1d')]('[userReport][devicestatechange]',util[_0xc8ea('0x19')](_0x4aa173,{'showHidden':![],'depth':null}));}};UserReport[_0xc8ea('0x1f')][_0xc8ea('0x45')]=function(_0x2b2201){try{if(this[_0xc8ea('0x20')](_0x2b2201)&&this[_0xc8ea('0x20')](_0x2b2201[_0xc8ea('0x13')])){logger[_0xc8ea('0x31')](_0xc8ea('0x46'),_0x2b2201[_0xc8ea('0x47')],_0x2b2201[_0xc8ea('0x48')],_0x2b2201[_0xc8ea('0x13')]);logger[_0xc8ea('0x26')]('[userReport][peerstatus]',util[_0xc8ea('0x19')](_0x2b2201,{'showHidden':![],'depth':null}));if(this[_0xc8ea('0xc')][_0x2b2201[_0xc8ea('0x47')]]){if(!this[_0xc8ea('0xc')][_0x2b2201[_0xc8ea('0x47')]][_0xc8ea('0x35')]||_0x2b2201[_0xc8ea('0x13')][_0xc8ea('0x36')]()=='registered'){this['agents'][_0x2b2201[_0xc8ea('0x47')]][_0xc8ea('0x35')]=![];this[_0xc8ea('0xc')][_0x2b2201[_0xc8ea('0x47')]][_0xc8ea('0x49')]=_0x2b2201['peerstatus'][_0xc8ea('0x36')]();this[_0xc8ea('0xc')][_0x2b2201[_0xc8ea('0x47')]][_0xc8ea('0x48')]=_0x2b2201[_0xc8ea('0x48')];this[_0xc8ea('0xc')][_0x2b2201['peer']][_0xc8ea('0x44')](_0x2b2201);}}else if(this[_0xc8ea('0xd')][_0x2b2201[_0xc8ea('0x47')]]){this[_0xc8ea('0xd')][_0x2b2201[_0xc8ea('0x47')]]['status']=_0x2b2201[_0xc8ea('0x13')][_0xc8ea('0x36')]();this[_0xc8ea('0xd')][_0x2b2201[_0xc8ea('0x47')]][_0xc8ea('0x48')]=_0x2b2201[_0xc8ea('0x48')];logger[_0xc8ea('0x26')](_0xc8ea('0x4a'),util[_0xc8ea('0x19')](this[_0xc8ea('0xd')][_0x2b2201[_0xc8ea('0x47')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xc8ea('0x2d')]('telephone:%s',this[_0xc8ea('0xd')][_0x2b2201['peer']][_0xc8ea('0x2e')]),_0xc8ea('0x3b'),this[_0xc8ea('0xd')][_0x2b2201['peer']]);}else if(this[_0xc8ea('0xb')][_0x2b2201[_0xc8ea('0x47')]]){this[_0xc8ea('0xb')][_0x2b2201['peer']][_0xc8ea('0x49')]=_0x2b2201[_0xc8ea('0x13')][_0xc8ea('0x36')]();this[_0xc8ea('0xb')][_0x2b2201[_0xc8ea('0x47')]][_0xc8ea('0x48')]=_0x2b2201[_0xc8ea('0x48')];logger['debug'](_0xc8ea('0x4b'),util[_0xc8ea('0x19')](this[_0xc8ea('0xb')][_0x2b2201[_0xc8ea('0x47')]],{'showHidden':![],'depth':null}));this[_0xc8ea('0x22')](util[_0xc8ea('0x2d')]('trunk:%s',this[_0xc8ea('0xb')][_0x2b2201['peer']]['name']),_0xc8ea('0x2f'),this['trunks'][_0x2b2201[_0xc8ea('0x47')]]);}}}catch(_0x22ee24){logger[_0xc8ea('0x1d')]('[userReport][peerstatus]',util[_0xc8ea('0x19')](_0x22ee24,{'showHidden':![],'depth':null}));}};module[_0xc8ea('0x4c')]=UserReport; \ No newline at end of file +var _0x914c=['../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','bind','registry','syncRegistry','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','then','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','inspect','prototype','isNotNull','isUndefined','emit','[userReport][registry]\x20registry:%s\x20state:%s','state','merge','omit','event','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][registry]','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','inuse','stateTime','toNumber','toLowerCase','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','indexOf','phone','updateStatusRealtime','peer','[userReport][peerstatus]','address','status','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x914c,0x122));var _0xc914=function(_0x14a513,_0x3239f){_0x14a513=_0x14a513-0x0;var _0x47236c=_0x914c[_0x14a513];return _0x47236c;};'use strict';var _=require(_0xc914('0x0'));var moment=require(_0xc914('0x1'));var util=require(_0xc914('0x2'));var Redis=require(_0xc914('0x3'));var BPromise=require(_0xc914('0x4'));var config=require(_0xc914('0x5'));var logger=require(_0xc914('0x6'))(_0xc914('0x7'));var ami=require(_0xc914('0x8'));config[_0xc914('0x9')]=_[_0xc914('0xa')](config['redis'],{'host':_0xc914('0xb'),'port':0x18eb});var io=require(_0xc914('0xc'))(new Redis(config['redis']));function UserReport(_0x3c8a6c){this['trunks']=_0x3c8a6c[_0xc914('0xd')];this[_0xc914('0xe')]=_0x3c8a6c[_0xc914('0xe')];this[_0xc914('0xf')]=_0x3c8a6c['telephones'];ami['on']('registryentry',this['syncRegistry'][_0xc914('0x10')](this));ami['on'](_0xc914('0x11'),this[_0xc914('0x12')]['bind'](this));ami['on']('devicestatechange',this[_0xc914('0x13')][_0xc914('0x10')](this));ami['on'](_0xc914('0x14'),this[_0xc914('0x15')]['bind'](this));return this[_0xc914('0x16')]();}function showSipRegistrations(){Promise[_0xc914('0x17')]()['then'](ami[_0xc914('0x18')]())[_0xc914('0x19')](function(_0x2fed6c){logger[_0xc914('0x1a')](_0xc914('0x1b'),util['inspect'](_0x2fed6c,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xc914('0x17')]()[_0xc914('0x1c')](ami[_0xc914('0x1d')]())[_0xc914('0x19')](function(_0x243ed7){logger[_0xc914('0x1a')](_0xc914('0x1e'),util['inspect'](_0x243ed7,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xc914('0x17')]()[_0xc914('0x1c')](ami[_0xc914('0x1f')]())[_0xc914('0x19')](function(_0x21006d){logger[_0xc914('0x1a')](_0xc914('0x20'),util[_0xc914('0x21')](_0x21006d,{'showHidden':![],'depth':null}));});}UserReport[_0xc914('0x22')][_0xc914('0x16')]=function(){setInterval(function(){BPromise['resolve']()[_0xc914('0x1c')](showSipRegistrations())[_0xc914('0x1c')](listDeviceStates())[_0xc914('0x1c')](showPeersStatus());},0x32c8);};UserReport[_0xc914('0x22')][_0xc914('0x23')]=function(_0x18adad){return _0x18adad!==null&&!_[_0xc914('0x24')](_0x18adad);};UserReport[_0xc914('0x22')][_0xc914('0x25')]=function(_0x2d3c0c,_0x2f4461,_0x5d873e){io['to'](_0x2d3c0c)[_0xc914('0x25')](_0x2f4461,_0x5d873e);};UserReport[_0xc914('0x22')][_0xc914('0x12')]=function(_0x22649d){try{if(this[_0xc914('0x23')](_0x22649d)){logger['info'](_0xc914('0x26'),_0x22649d['username'],_0x22649d['state']);logger['debug']('[userReport][registry]',util[_0xc914('0x21')](_0x22649d,{'showHidden':![],'depth':null}));var _0x1cec13=_['find'](this[_0xc914('0xd')],{'defaultuser':_0x22649d['username']});if(_0x1cec13){_0x22649d['stateRegistry']=_0x22649d[_0xc914('0x27')];_[_0xc914('0x28')](_0x1cec13,_[_0xc914('0x29')](_0x22649d,[_0xc914('0x2a'),_0xc914('0x2b'),'username',_0xc914('0x27')]));logger[_0xc914('0x2c')](_0xc914('0x2d'),util[_0xc914('0x21')](_0x1cec13,{'showHidden':![],'depth':null}));this[_0xc914('0x25')](util[_0xc914('0x2e')](_0xc914('0x2f'),_0x1cec13[_0xc914('0x30')]),_0xc914('0x31'),_0x1cec13);}}}catch(_0x12b817){logger[_0xc914('0x1a')](_0xc914('0x32'),util['inspect'](_0x12b817,{'showHidden':![],'depth':null}));}};UserReport[_0xc914('0x22')][_0xc914('0x13')]=function(_0x3fd5e0){try{if(this[_0xc914('0x23')](_0x3fd5e0)){logger[_0xc914('0x33')](_0xc914('0x34'),_0x3fd5e0[_0xc914('0x35')],_0x3fd5e0[_0xc914('0x27')]);logger[_0xc914('0x2c')](_0xc914('0x36'),util[_0xc914('0x21')](_0x3fd5e0,{'showHidden':![],'depth':null}));if(this[_0xc914('0xe')][_0x3fd5e0[_0xc914('0x35')]]){if(!this[_0xc914('0xe')][_0x3fd5e0[_0xc914('0x35')]][_0xc914('0x37')]||_0x3fd5e0[_0xc914('0x27')]['toLowerCase']()==_0xc914('0x38')){this['agents'][_0x3fd5e0[_0xc914('0x35')]][_0xc914('0x37')]=![];if(this[_0xc914('0xe')][_0x3fd5e0[_0xc914('0x35')]][_0xc914('0x27')]!==_0x3fd5e0[_0xc914('0x27')]['toLowerCase']()){this[_0xc914('0xe')][_0x3fd5e0[_0xc914('0x35')]][_0xc914('0x39')]=_[_0xc914('0x3a')](moment()['format']('x'));}this[_0xc914('0xe')][_0x3fd5e0[_0xc914('0x35')]][_0xc914('0x27')]=_0x3fd5e0[_0xc914('0x27')][_0xc914('0x3b')]();this['agents'][_0x3fd5e0['device']]['updateStatusRealtime'](_0x3fd5e0);}}else if(this['telephones'][_0x3fd5e0[_0xc914('0x35')]]){if(this[_0xc914('0xf')][_0x3fd5e0[_0xc914('0x35')]][_0xc914('0x27')]!==_0x3fd5e0[_0xc914('0x27')][_0xc914('0x3b')]()){this['telephones'][_0x3fd5e0[_0xc914('0x35')]][_0xc914('0x39')]=_[_0xc914('0x3a')](moment()['format']('x'));}this['telephones'][_0x3fd5e0['device']][_0xc914('0x27')]=_0x3fd5e0[_0xc914('0x27')]['toLowerCase']();logger[_0xc914('0x2c')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0xc914('0x21')](this[_0xc914('0xf')][_0x3fd5e0[_0xc914('0x35')]],{'showHidden':![],'depth':null}));this[_0xc914('0x25')](util[_0xc914('0x2e')](_0xc914('0x3c'),this[_0xc914('0xf')][_0x3fd5e0[_0xc914('0x35')]][_0xc914('0x30')]),_0xc914('0x3d'),this['telephones'][_0x3fd5e0[_0xc914('0x35')]]);}else if(this[_0xc914('0xd')][_0x3fd5e0[_0xc914('0x35')]]){if(this[_0xc914('0xd')][_0x3fd5e0[_0xc914('0x35')]][_0xc914('0x27')]!==_0x3fd5e0[_0xc914('0x27')]['toLowerCase']()){this[_0xc914('0xd')][_0x3fd5e0['device']][_0xc914('0x39')]=_[_0xc914('0x3a')](moment()[_0xc914('0x2e')]('x'));}this['trunks'][_0x3fd5e0['device']][_0xc914('0x27')]=_0x3fd5e0[_0xc914('0x27')]['toLowerCase']();logger['debug'](_0xc914('0x3e'),util[_0xc914('0x21')](this['trunks'][_0x3fd5e0[_0xc914('0x35')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xc914('0x2e')]('trunk:%s',this[_0xc914('0xd')][_0x3fd5e0['device']]['name']),_0xc914('0x31'),this[_0xc914('0xd')][_0x3fd5e0[_0xc914('0x35')]]);}else if(_[_0xc914('0x3f')](_0x3fd5e0['device'],_0xc914('0x40'))){var _0x542782=_0x3fd5e0[_0xc914('0x35')];var _0x54a230=_0x542782['substring'](_0x542782[_0xc914('0x41')]('/')+0x1,_0x542782[_0xc914('0x41')]('@'));var _0x1a24fa=_['find'](this['agents'],function(_0x440fc9){return _0x440fc9['mobile']==_0x54a230||_0x440fc9[_0xc914('0x42')]==_0x54a230||_0x440fc9['accountcode']==_0x54a230;});if(_0x1a24fa){if(_0x1a24fa['state']!==_0x3fd5e0[_0xc914('0x27')][_0xc914('0x3b')]()){_0x1a24fa[_0xc914('0x39')]=_['toNumber'](moment()[_0xc914('0x2e')]('x'));}_0x1a24fa['state']=_0x3fd5e0[_0xc914('0x27')][_0xc914('0x3b')]();_0x1a24fa[_0xc914('0x37')]=!![];_0x1a24fa[_0xc914('0x43')](_0x3fd5e0);}}}}catch(_0x357131){logger['error'](_0xc914('0x36'),util[_0xc914('0x21')](_0x357131,{'showHidden':![],'depth':null}));}};UserReport[_0xc914('0x22')][_0xc914('0x15')]=function(_0x1eb61a){try{if(this[_0xc914('0x23')](_0x1eb61a)&&this[_0xc914('0x23')](_0x1eb61a[_0xc914('0x14')])){logger[_0xc914('0x33')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x1eb61a[_0xc914('0x44')],_0x1eb61a['address'],_0x1eb61a['peerstatus']);logger[_0xc914('0x2c')](_0xc914('0x45'),util['inspect'](_0x1eb61a,{'showHidden':![],'depth':null}));if(this[_0xc914('0xe')][_0x1eb61a[_0xc914('0x44')]]){if(!this['agents'][_0x1eb61a[_0xc914('0x44')]]['local']||_0x1eb61a[_0xc914('0x14')][_0xc914('0x3b')]()=='registered'){this[_0xc914('0xe')][_0x1eb61a[_0xc914('0x44')]][_0xc914('0x37')]=![];this['agents'][_0x1eb61a[_0xc914('0x44')]]['status']=_0x1eb61a[_0xc914('0x14')][_0xc914('0x3b')]();this[_0xc914('0xe')][_0x1eb61a[_0xc914('0x44')]][_0xc914('0x46')]=_0x1eb61a[_0xc914('0x46')];this[_0xc914('0xe')][_0x1eb61a[_0xc914('0x44')]]['updateStatusRealtime'](_0x1eb61a);}}else if(this[_0xc914('0xf')][_0x1eb61a[_0xc914('0x44')]]){this['telephones'][_0x1eb61a[_0xc914('0x44')]][_0xc914('0x47')]=_0x1eb61a[_0xc914('0x14')][_0xc914('0x3b')]();this['telephones'][_0x1eb61a[_0xc914('0x44')]][_0xc914('0x46')]=_0x1eb61a[_0xc914('0x46')];logger[_0xc914('0x2c')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0xc914('0x21')](this[_0xc914('0xf')][_0x1eb61a[_0xc914('0x44')]],{'showHidden':![],'depth':null}));this[_0xc914('0x25')](util[_0xc914('0x2e')]('telephone:%s',this[_0xc914('0xf')][_0x1eb61a[_0xc914('0x44')]][_0xc914('0x30')]),_0xc914('0x3d'),this['telephones'][_0x1eb61a[_0xc914('0x44')]]);}else if(this['trunks'][_0x1eb61a[_0xc914('0x44')]]){this[_0xc914('0xd')][_0x1eb61a[_0xc914('0x44')]]['status']=_0x1eb61a[_0xc914('0x14')][_0xc914('0x3b')]();this['trunks'][_0x1eb61a[_0xc914('0x44')]][_0xc914('0x46')]=_0x1eb61a[_0xc914('0x46')];logger[_0xc914('0x2c')](_0xc914('0x48'),util[_0xc914('0x21')](this['trunks'][_0x1eb61a['peer']],{'showHidden':![],'depth':null}));this['emit'](util[_0xc914('0x2e')](_0xc914('0x2f'),this[_0xc914('0xd')][_0x1eb61a['peer']][_0xc914('0x30')]),'trunk:save',this[_0xc914('0xd')][_0x1eb61a[_0xc914('0x44')]]);}}}catch(_0x2e094d){logger[_0xc914('0x1a')](_0xc914('0x45'),util['inspect'](_0x2e094d,{'showHidden':![],'depth':null}));}};module[_0xc914('0x49')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 7137ecf..ea074aa 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x4b8ffd,_0x11755e){var _0x41d50b=function(_0x441f1e){while(--_0x441f1e){_0x4b8ffd['push'](_0x4b8ffd['shift']());}};_0x41d50b(++_0x11755e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file +var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x258a29,_0x309152){var _0x49261b=function(_0x5e897a){while(--_0x5e897a){_0x258a29['push'](_0x258a29['shift']());}};_0x49261b(++_0x309152);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 806e050..5a3cff1 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe108=['keys','includes','lastdata','cdr(','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','answertime','diff','connectedlinename','membername','UserId','routealias','accountcode','user:agentconnect','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.wav49','replace','.WAV','isNil','monitors','push','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','xmd-phone','value','xmd-callerid','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','parse','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','resolve','then','transferType','undefined','stopRecordingOnTransfer','Action','catch','StopMixMonitor','finally','destinationchannel','event','BlindTransfer','blindTransfers','custom:voiceCallReport','[%s][voiceCallReport][hangup]','origtransferercalleridnum','transfertargetcalleridnum','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','outbound','routeid','ATTENDED','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','BLIND','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','exports','moment','path','../../../config/environment','../../../config/logger','ami','../model/channel','../rpc/setting','queue','agi','dial','playback','NO\x20ANSWER','FAILED','redis','defaults','localhost','agents','coreshowchannel','syncNewExten','bind','newexten','syncNewChannel','newstate','syncNewState','varset','syncVarSet','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','isNotNull','isUndefined','prototype','emit','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','linkedid','channels','pick','context','from-sip','channel','split','xcally-motion-preview','connectedlinenum','format','user:%s','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','merge','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','name','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','applicationdata','appdata','startsWith','CDR(routeAlias)','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds'];(function(_0x8762a0,_0x3b4a18){var _0xc68f49=function(_0x255b32){while(--_0x255b32){_0x8762a0['push'](_0x8762a0['shift']());}};_0xc68f49(++_0x3b4a18);}(_0xe108,0x6b));var _0x8e10=function(_0x303875,_0x29fc7f){_0x303875=_0x303875-0x0;var _0x507814=_0xe108[_0x303875];return _0x507814;};'use strict';var _=require('lodash');var moment=require(_0x8e10('0x0'));var util=require('util');var path=require(_0x8e10('0x1'));var Redis=require('ioredis');var config=require(_0x8e10('0x2'));var logger=require(_0x8e10('0x3'))(_0x8e10('0x4'));var ami=require('../ami');var Channel=require(_0x8e10('0x5'));var RpcSetting=require(_0x8e10('0x6'));var applications=['set',_0x8e10('0x7'),_0x8e10('0x8'),_0x8e10('0x9'),_0x8e10('0xa'),'voicemail'];var dispositions=[_0x8e10('0xb'),_0x8e10('0xc'),'FAILED',_0x8e10('0xb'),_0x8e10('0xb'),'NO\x20ANSWER','ANSWERED','BUSY',_0x8e10('0xc'),'FAILED',_0x8e10('0xc')];config[_0x8e10('0xd')]=_[_0x8e10('0xe')](config[_0x8e10('0xd')],{'host':_0x8e10('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8e10('0xd')]));function VoiceCallReport(_0x3c224d){this['channels']=_0x3c224d['channels'];this[_0x8e10('0x10')]=_0x3c224d['agents'];this['blindTransfers']={};ami['on'](_0x8e10('0x11'),this[_0x8e10('0x12')][_0x8e10('0x13')](this));ami['on'](_0x8e10('0x14'),this[_0x8e10('0x12')]['bind'](this));ami['on']('newchannel',this[_0x8e10('0x15')][_0x8e10('0x13')](this));ami['on'](_0x8e10('0x16'),this[_0x8e10('0x17')][_0x8e10('0x13')](this));ami['on'](_0x8e10('0x18'),this[_0x8e10('0x19')]['bind'](this));ami['on']('hangup',this[_0x8e10('0x1a')][_0x8e10('0x13')](this));ami['on']('newcallerid',this[_0x8e10('0x1b')]['bind'](this));ami['on'](_0x8e10('0x1c'),this[_0x8e10('0x1d')][_0x8e10('0x13')](this));ami['on'](_0x8e10('0x1e'),this['syncBlindTransfer'][_0x8e10('0x13')](this));ami['on']('musiconholdstart',this[_0x8e10('0x1f')]['bind'](this));ami['on'](_0x8e10('0x20'),this[_0x8e10('0x21')]['bind'](this));try{logger['info']('[voiceCallReport][coreshowchannels]\x20started');ami[_0x8e10('0x22')]();}catch(_0x3d0d45){logger[_0x8e10('0x23')](_0x8e10('0x24'),util[_0x8e10('0x25')](_0x3d0d45,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x8e10('0x26')]=function(_0x5f39c0){return _0x5f39c0!==null&&!_[_0x8e10('0x27')](_0x5f39c0);};VoiceCallReport[_0x8e10('0x28')][_0x8e10('0x29')]=function(_0x2faf70,_0x4897e7,_0x4c6926){io['to'](_0x2faf70)[_0x8e10('0x29')](_0x4897e7,_0x4c6926);};VoiceCallReport['prototype'][_0x8e10('0x1b')]=function(_0x5cdd62){try{if(this[_0x8e10('0x26')](_0x5cdd62)){logger[_0x8e10('0x2a')](_0x8e10('0x2b'),_0x5cdd62[_0x8e10('0x2c')],_0x5cdd62[_0x8e10('0x2d')],_0x5cdd62[_0x8e10('0x2e')]);logger[_0x8e10('0x2f')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x5cdd62['uniqueid'],util[_0x8e10('0x25')](_0x5cdd62,{'showHidden':![],'depth':null}));if(_0x5cdd62[_0x8e10('0x2c')]===_0x5cdd62[_0x8e10('0x30')]){if(!_[_0x8e10('0x27')](this['channels'][_0x5cdd62[_0x8e10('0x2c')]])){_['merge'](this[_0x8e10('0x31')][_0x5cdd62['uniqueid']],_[_0x8e10('0x32')](_0x5cdd62,_['keys'](this['channels'][_0x5cdd62['uniqueid']])));}}if(_0x5cdd62[_0x8e10('0x33')]===_0x8e10('0x34')){if(this[_0x8e10('0x10')][_0x5cdd62[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]]){if(_0x5cdd62['exten']==_0x8e10('0x37')){this['agents'][_0x5cdd62[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]]['destconnectedlinenum']=_0x5cdd62[_0x8e10('0x38')];this[_0x8e10('0x29')](util[_0x8e10('0x39')](_0x8e10('0x3a'),this[_0x8e10('0x10')][_0x5cdd62['channel'][_0x8e10('0x36')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0x8e10('0x10')][_0x5cdd62['channel'][_0x8e10('0x36')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x5cdd62['connectedlinenum']});}}}}}catch(_0x2adefd){logger[_0x8e10('0x23')](_0x8e10('0x3b'),_0x5cdd62['uniqueid'],util['inspect'](_0x2adefd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8e10('0x28')][_0x8e10('0x15')]=function(_0x368776){try{if(this[_0x8e10('0x26')](_0x368776)){logger[_0x8e10('0x2f')](_0x8e10('0x3c'),_0x368776[_0x8e10('0x2c')],util[_0x8e10('0x25')](_0x368776,{'showHidden':![],'depth':null}));if(_0x368776[_0x8e10('0x2c')]===_0x368776[_0x8e10('0x30')]&&_0x368776[_0x8e10('0x35')]!=_0x8e10('0x3d')){if(_[_0x8e10('0x27')](this[_0x8e10('0x31')][_0x368776[_0x8e10('0x2c')]])){logger[_0x8e10('0x2a')](_0x8e10('0x3e'),_0x368776[_0x8e10('0x2c')],_0x368776[_0x8e10('0x33')],_0x368776[_0x8e10('0x3f')]);this[_0x8e10('0x31')][_0x368776[_0x8e10('0x2c')]]=new Channel();this[_0x8e10('0x31')][_0x368776[_0x8e10('0x2c')]][_0x8e10('0x40')]=moment()[_0x8e10('0x39')](_0x8e10('0x41'));this[_0x8e10('0x31')][_0x368776[_0x8e10('0x2c')]][_0x8e10('0x42')]=dispositions[_[_0x8e10('0x43')](_0x368776['channelstate'])];_[_0x8e10('0x44')](this[_0x8e10('0x31')][_0x368776[_0x8e10('0x2c')]],_[_0x8e10('0x32')](_0x368776,_['keys'](this['channels'][_0x368776[_0x8e10('0x2c')]])));if(_0x368776['context']===_0x8e10('0x34')){if(this[_0x8e10('0x10')][_0x368776[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]]){if(_[_0x8e10('0x27')](this[_0x8e10('0x10')][_0x368776[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]][_0x8e10('0x45')])){this[_0x8e10('0x10')][_0x368776['channel'][_0x8e10('0x36')]('-')[0x0]][_0x8e10('0x45')]=_0x368776['exten'];logger['debug'](_0x8e10('0x46'),_0x368776[_0x8e10('0x2c')],util[_0x8e10('0x25')]({'id':this['agents'][_0x368776[_0x8e10('0x35')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x8e10('0x10')][_0x368776[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x368776[_0x8e10('0x3f')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x8e10('0x39')](_0x8e10('0x3a'),this[_0x8e10('0x10')][_0x368776[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]][_0x8e10('0x47')]),'user:agentconnect',{'id':this[_0x8e10('0x10')][_0x368776[_0x8e10('0x35')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x8e10('0x10')][_0x368776['channel'][_0x8e10('0x36')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x368776[_0x8e10('0x3f')]});}}}}}}}catch(_0x154f20){logger[_0x8e10('0x23')](_0x8e10('0x48'),_0x368776[_0x8e10('0x2c')],util['inspect'](_0x154f20,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x8e10('0x12')]=function(_0x381ee6){try{if(this[_0x8e10('0x26')](_0x381ee6)){logger[_0x8e10('0x2f')](_0x8e10('0x49'),_0x381ee6['uniqueid'],util['inspect'](_0x381ee6,{'showHidden':![],'depth':null}));if(_0x381ee6[_0x8e10('0x2c')]===_0x381ee6['linkedid']&&_0x381ee6['exten']!='h'&&_0x381ee6[_0x8e10('0x35')]!=_0x8e10('0x3d')){_0x381ee6[_0x8e10('0x4a')]=_0x381ee6[_0x8e10('0x4a')]['toLowerCase']();_0x381ee6[_0x8e10('0x4b')]=_0x381ee6[_0x8e10('0x4c')]&&_0x381ee6['appdata'][_0x8e10('0x4d')](_0x8e10('0x4e'))?_0x381ee6[_0x8e10('0x4c')]:(_0x381ee6['appdata']||_0x381ee6[_0x8e10('0x4b')])[_0x8e10('0x4f')]();logger[_0x8e10('0x2a')](_0x8e10('0x50'),_0x381ee6[_0x8e10('0x2c')],_0x381ee6[_0x8e10('0x4a')],_0x381ee6[_0x8e10('0x4b')]);if(_[_0x8e10('0x27')](this[_0x8e10('0x31')][_0x381ee6[_0x8e10('0x2c')]])){this[_0x8e10('0x31')][_0x381ee6['uniqueid']]=new Channel();this[_0x8e10('0x31')][_0x381ee6[_0x8e10('0x2c')]]['starttime']=_0x381ee6[_0x8e10('0x51')]?moment()[_0x8e10('0x52')](moment['duration'](_0x381ee6[_0x8e10('0x51')])[_0x8e10('0x53')](),_0x8e10('0x53'))['format'](_0x8e10('0x41')):moment()[_0x8e10('0x39')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8e10('0x31')][_0x381ee6[_0x8e10('0x2c')]][_0x8e10('0x42')]=_0x8e10('0xb');}_[_0x8e10('0x44')](this[_0x8e10('0x31')][_0x381ee6[_0x8e10('0x2c')]],_['pick'](_0x381ee6,_[_0x8e10('0x54')](this[_0x8e10('0x31')][_0x381ee6[_0x8e10('0x2c')]])));if(_[_0x8e10('0x55')](applications,_0x381ee6['application'])){this[_0x8e10('0x31')][_0x381ee6[_0x8e10('0x2c')]]['lastapplication']=_0x381ee6[_0x8e10('0x4a')];this[_0x8e10('0x31')][_0x381ee6['uniqueid']][_0x8e10('0x56')]=_0x381ee6[_0x8e10('0x4b')];if(_0x381ee6[_0x8e10('0x4a')]==='set'&&_[_0x8e10('0x4d')](_0x381ee6[_0x8e10('0x4b')]['toLowerCase'](),_0x8e10('0x57'))){var _0x507a45=_0x381ee6[_0x8e10('0x4b')][_0x8e10('0x36')]('=');var _0x2e1d94=_0x507a45[0x0][_0x8e10('0x4f')]()[_0x8e10('0x58')](/cdr\((.*)\)/);if(_0x2e1d94){this[_0x8e10('0x31')][_0x381ee6[_0x8e10('0x2c')]][_0x2e1d94[0x1]]=_0x507a45[0x1];}}else if(_0x381ee6['application']==='queue'){this[_0x8e10('0x31')][_0x381ee6[_0x8e10('0x2c')]][_0x8e10('0x7')]=_0x381ee6[_0x8e10('0x4b')][_0x8e10('0x36')](',')[0x0];}}}}}catch(_0x57903d){logger['error'](_0x8e10('0x59'),_0x381ee6['uniqueid'],util[_0x8e10('0x25')](_0x57903d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8e10('0x28')][_0x8e10('0x17')]=function(_0x299998){try{if(this[_0x8e10('0x26')](_0x299998)){logger[_0x8e10('0x2a')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x299998[_0x8e10('0x2c')],_0x299998[_0x8e10('0x30')],_0x299998[_0x8e10('0x2d')],_0x299998[_0x8e10('0x2e')]);logger[_0x8e10('0x2f')](_0x8e10('0x5a'),_0x299998[_0x8e10('0x2c')],util[_0x8e10('0x25')](_0x299998,{'showHidden':![],'depth':null}));if(_0x299998[_0x8e10('0x2c')]!==_0x299998[_0x8e10('0x30')]){if(this['channels'][_0x299998[_0x8e10('0x30')]]){if(_0x299998[_0x8e10('0x5b')]==='6'){if(!this[_0x8e10('0x31')][_0x299998['linkedid']][_0x8e10('0x5c')]){var _0x1a8901=moment();this[_0x8e10('0x31')][_0x299998[_0x8e10('0x30')]][_0x8e10('0x5c')]=!![];this['channels'][_0x299998[_0x8e10('0x30')]][_0x8e10('0x5d')]=_0x1a8901[_0x8e10('0x39')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x8e10('0x31')][_0x299998[_0x8e10('0x30')]]['starttime']){this[_0x8e10('0x31')][_0x299998[_0x8e10('0x30')]]['holdtime']=_0x1a8901[_0x8e10('0x5e')](this['channels'][_0x299998[_0x8e10('0x30')]][_0x8e10('0x40')],_0x8e10('0x53'));}}this['channels'][_0x299998[_0x8e10('0x30')]][_0x8e10('0x30')]=_0x299998[_0x8e10('0x2c')];if(_0x299998['calleridnum']!==_0x8e10('0x37')){this[_0x8e10('0x31')][_0x299998[_0x8e10('0x30')]][_0x8e10('0x38')]=_0x299998['calleridnum'];}this[_0x8e10('0x31')][_0x299998[_0x8e10('0x30')]][_0x8e10('0x5f')]=_0x299998[_0x8e10('0x2d')];this[_0x8e10('0x31')][_0x299998[_0x8e10('0x30')]]['destinationchannel']=_0x299998[_0x8e10('0x35')];this[_0x8e10('0x31')][_0x299998[_0x8e10('0x30')]][_0x8e10('0x42')]=dispositions[_[_0x8e10('0x43')](_0x299998[_0x8e10('0x5b')])];if(this['agents'][_0x299998[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]]){this[_0x8e10('0x31')][_0x299998[_0x8e10('0x30')]]['UserId']=this[_0x8e10('0x10')][_0x299998['channel']['split']('-')[0x0]]['id'];this[_0x8e10('0x31')][_0x299998[_0x8e10('0x30')]][_0x8e10('0x60')]=this['agents'][_0x299998[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]][_0x8e10('0x47')];}}}}else{if(this[_0x8e10('0x31')][_0x299998[_0x8e10('0x2c')]]){if(_0x299998[_0x8e10('0x5b')]==='6'){if(this[_0x8e10('0x10')][_0x299998[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]]){this[_0x8e10('0x31')][_0x299998[_0x8e10('0x2c')]][_0x8e10('0x61')]=this[_0x8e10('0x10')][_0x299998['channel'][_0x8e10('0x36')]('-')[0x0]]['id'];this[_0x8e10('0x31')][_0x299998[_0x8e10('0x2c')]][_0x8e10('0x60')]=this[_0x8e10('0x10')][_0x299998['channel'][_0x8e10('0x36')]('-')[0x0]][_0x8e10('0x47')];}}}}if(_0x299998[_0x8e10('0x5b')]==='6'&&_0x299998[_0x8e10('0x33')]===_0x8e10('0x34')){if(this[_0x8e10('0x10')][_0x299998[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]]){this[_0x8e10('0x10')][_0x299998[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]]['destconnectedlinenum']=_0x299998[_0x8e10('0x3f')];var _0x5924d3,_0x3b3c0a;if(this[_0x8e10('0x31')][_0x299998[_0x8e10('0x2c')]]){_0x5924d3=this[_0x8e10('0x31')][_0x299998[_0x8e10('0x2c')]][_0x8e10('0x62')];_0x3b3c0a=this['channels'][_0x299998['uniqueid']][_0x8e10('0x7')];}else if(this[_0x8e10('0x31')][_0x299998[_0x8e10('0x30')]]){_0x5924d3=this['channels'][_0x299998[_0x8e10('0x30')]][_0x8e10('0x62')];_0x3b3c0a=this['channels'][_0x299998[_0x8e10('0x30')]][_0x8e10('0x7')];}logger['debug']('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x299998['uniqueid'],util[_0x8e10('0x25')]({'id':this['agents'][_0x299998[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]]['id'],'destaccountcode':this[_0x8e10('0x10')][_0x299998[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]][_0x8e10('0x63')],'destconnectedlinenum':_0x299998[_0x8e10('0x3f')],'routealias':_0x5924d3,'queue':_0x3b3c0a||undefined},{'showHidden':![],'depth':null}));this[_0x8e10('0x29')](util[_0x8e10('0x39')]('user:%s',this[_0x8e10('0x10')][_0x299998[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]][_0x8e10('0x47')]),_0x8e10('0x64'),{'id':this[_0x8e10('0x10')][_0x299998[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x8e10('0x10')][_0x299998[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]][_0x8e10('0x63')],'destconnectedlinenum':_0x299998['exten'],'routealias':_0x5924d3,'queue':_0x3b3c0a||undefined});}}}}catch(_0x17803c){logger[_0x8e10('0x23')](_0x8e10('0x65'),_0x299998[_0x8e10('0x2c')],util[_0x8e10('0x25')](_0x17803c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8e10('0x28')][_0x8e10('0x66')]=function(_0x2667fa,_0x14449f){try{if(this[_0x8e10('0x31')][_0x2667fa]){logger[_0x8e10('0x2a')](_0x8e10('0x67'),_0x2667fa,_0x14449f);this[_0x8e10('0x31')][_0x2667fa]['monitor']=!![];if(_[_0x8e10('0x68')](_0x14449f,_0x8e10('0x69'))){_0x14449f=_0x14449f[_0x8e10('0x6a')](_0x8e10('0x69'),_0x8e10('0x6b'));}this['channels'][_0x2667fa]['monitorFilename']=_0x14449f;var _0xedbf04=_['find'](this['channels'][_0x2667fa]['monitors'],{'filename':_0x14449f});if(_[_0x8e10('0x6c')](_0xedbf04)){this[_0x8e10('0x31')][_0x2667fa][_0x8e10('0x6d')][_0x8e10('0x6e')]({'filename':_0x14449f,'createdAt':moment()[_0x8e10('0x39')](_0x8e10('0x41')),'mixmonitorid':'','status':'rec'});}}}catch(_0x3c0cd9){logger[_0x8e10('0x23')]('[%s][voiceCallReport][mixMonitorFilename]',_0x2667fa,util[_0x8e10('0x25')](_0x3c0cd9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8e10('0x28')]['syncVarSet']=function(_0x254651){try{if(this[_0x8e10('0x26')](_0x254651)){logger[_0x8e10('0x2f')](_0x8e10('0x6f'),_0x254651[_0x8e10('0x2c')],util['inspect'](_0x254651,{'showHidden':![],'depth':null}));if(this['channels'][_0x254651[_0x8e10('0x2c')]]&&_0x254651[_0x8e10('0x35')]!=_0x8e10('0x3d')){if(this['isNotNull'](_0x254651[_0x8e10('0x70')])){if(this[_0x8e10('0x26')](_0x254651[_0x8e10('0x70')][_0x8e10('0x71')])){logger[_0x8e10('0x2a')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x254651[_0x8e10('0x2c')],_0x254651['value']);this[_0x8e10('0x66')](_0x254651['uniqueid'],_0x254651['value']);}else if(this['isNotNull'](_0x254651[_0x8e10('0x70')][_0x8e10('0x72')])){logger[_0x8e10('0x2a')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x254651[_0x8e10('0x2c')],_0x254651[_0x8e10('0x73')]);this['channels'][_0x254651[_0x8e10('0x2c')]][_0x8e10('0x2e')]=_0x254651[_0x8e10('0x73')];}else if(this[_0x8e10('0x26')](_0x254651[_0x8e10('0x70')][_0x8e10('0x74')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x254651[_0x8e10('0x2c')],_0x254651['value']);this[_0x8e10('0x31')][_0x254651[_0x8e10('0x2c')]][_0x8e10('0x75')]=_0x254651[_0x8e10('0x73')];}else if(this[_0x8e10('0x26')](_0x254651['variable'][_0x8e10('0x76')])){logger[_0x8e10('0x2a')](_0x8e10('0x77'),_0x254651[_0x8e10('0x2c')],_0x254651[_0x8e10('0x73')]);this[_0x8e10('0x31')][_0x254651[_0x8e10('0x2c')]][_0x8e10('0x78')]=_0x254651[_0x8e10('0x73')];}else if(this['isNotNull'](_0x254651[_0x8e10('0x70')][_0x8e10('0x79')])){logger['info'](_0x8e10('0x7a'),_0x254651[_0x8e10('0x2c')],_0x254651[_0x8e10('0x73')][_0x8e10('0x36')](',')[0x0]);this[_0x8e10('0x31')][_0x254651[_0x8e10('0x2c')]][_0x8e10('0x7')]=_0x254651['value']['split'](',')[0x0];}else if(this[_0x8e10('0x26')](_0x254651[_0x8e10('0x70')][_0x8e10('0x7b')])){logger['info'](_0x8e10('0x7c'),_0x254651['uniqueid'],_0x254651[_0x8e10('0x73')]);this[_0x8e10('0x31')][_0x254651['uniqueid']][_0x8e10('0x7d')]=_0x254651[_0x8e10('0x73')];}else if(this[_0x8e10('0x26')](_0x254651[_0x8e10('0x70')][_0x8e10('0x7e')])){logger['info'](_0x8e10('0x7f'),_0x254651['uniqueid'],_0x254651[_0x8e10('0x73')]);this[_0x8e10('0x31')][_0x254651[_0x8e10('0x2c')]][_0x8e10('0x80')]=_0x254651['value'];}else if(this['isNotNull'](_0x254651[_0x8e10('0x70')][_0x8e10('0x81')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x254651[_0x8e10('0x2c')],_0x254651[_0x8e10('0x73')]);this[_0x8e10('0x31')][_0x254651['uniqueid']]['calleridpreview']=_0x254651[_0x8e10('0x73')];}else if(this[_0x8e10('0x26')](_0x254651[_0x8e10('0x70')]['xmcs-queue'])){logger[_0x8e10('0x2a')](_0x8e10('0x82'),_0x254651[_0x8e10('0x2c')],_0x254651[_0x8e10('0x73')]);this[_0x8e10('0x31')][_0x254651[_0x8e10('0x2c')]][_0x8e10('0x7')]=_0x254651[_0x8e10('0x73')];}else if(this['isNotNull'](_0x254651['variable'][_0x8e10('0x83')])){logger[_0x8e10('0x2a')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x254651[_0x8e10('0x2c')],_0x254651[_0x8e10('0x73')]);this[_0x8e10('0x31')][_0x254651[_0x8e10('0x2c')]][_0x8e10('0x84')]=_0x254651[_0x8e10('0x73')];}}}else if(this[_0x8e10('0x26')](_0x254651[_0x8e10('0x70')]['mixmonitor_filename'])){if(_0x254651[_0x8e10('0x73')]){var _0x97c914=path[_0x8e10('0x85')](_0x254651['value'])[_0x8e10('0x47')];logger[_0x8e10('0x2a')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x97c914,_0x254651['value']);this[_0x8e10('0x66')](_0x97c914,_0x254651['value']);}}else if(this[_0x8e10('0x31')][_0x254651['linkedid']]){if(this[_0x8e10('0x26')](_0x254651[_0x8e10('0x70')])){if(this[_0x8e10('0x26')](_0x254651[_0x8e10('0x70')][_0x8e10('0x83')])){logger[_0x8e10('0x2a')](_0x8e10('0x86'),_0x254651['linkedid'],_0x254651[_0x8e10('0x73')]);this[_0x8e10('0x31')][_0x254651[_0x8e10('0x30')]][_0x8e10('0x87')]=_0x254651[_0x8e10('0x73')];}}}}}catch(_0x4c9f80){logger[_0x8e10('0x23')](_0x8e10('0x88'),_0x254651[_0x8e10('0x2c')],util[_0x8e10('0x25')](_0x4c9f80,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8e10('0x28')][_0x8e10('0x1a')]=function(_0x23bcd1){try{if(this['isNotNull'](_0x23bcd1)){logger[_0x8e10('0x2f')](_0x8e10('0x89'),_0x23bcd1[_0x8e10('0x2c')],util['inspect'](_0x23bcd1,{'showHidden':![],'depth':null}));if(this[_0x8e10('0x31')][_0x23bcd1[_0x8e10('0x2c')]]){logger['info'](_0x8e10('0x8a'),_0x23bcd1['uniqueid'],_0x23bcd1[_0x8e10('0x8b')]);var _0x428557=moment();this['channels'][_0x23bcd1[_0x8e10('0x2c')]][_0x8e10('0x8c')]=_0x428557[_0x8e10('0x39')](_0x8e10('0x41'));this[_0x8e10('0x31')][_0x23bcd1[_0x8e10('0x2c')]][_0x8e10('0x51')]=_0x428557[_0x8e10('0x5e')](this[_0x8e10('0x31')][_0x23bcd1[_0x8e10('0x2c')]][_0x8e10('0x40')],_0x8e10('0x53'));if(this[_0x8e10('0x31')][_0x23bcd1['uniqueid']][_0x8e10('0x5c')]){this[_0x8e10('0x31')][_0x23bcd1[_0x8e10('0x2c')]][_0x8e10('0x8d')]=_0x428557['diff'](this['channels'][_0x23bcd1[_0x8e10('0x2c')]][_0x8e10('0x5d')],_0x8e10('0x53'));this[_0x8e10('0x31')][_0x23bcd1[_0x8e10('0x2c')]]['holdtime']=this[_0x8e10('0x31')][_0x23bcd1[_0x8e10('0x2c')]][_0x8e10('0x51')]-this['channels'][_0x23bcd1[_0x8e10('0x2c')]]['billableseconds'];}if(_0x23bcd1[_0x8e10('0x33')]===_0x8e10('0x34')){if(this[_0x8e10('0x10')][_0x23bcd1[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]]){this[_0x8e10('0x10')][_0x23bcd1[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]]=_[_0x8e10('0x8e')](this[_0x8e10('0x10')][_0x23bcd1[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]],['destconnectedlinenum']);logger[_0x8e10('0x2f')](_0x8e10('0x8f'),_0x23bcd1[_0x8e10('0x2c')],util['inspect']({'id':this[_0x8e10('0x10')][_0x23bcd1[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x23bcd1[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0x8e10('0x29')](util[_0x8e10('0x39')](_0x8e10('0x3a'),this[_0x8e10('0x10')][_0x23bcd1[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]][_0x8e10('0x47')]),_0x8e10('0x90'),{'id':this[_0x8e10('0x10')][_0x23bcd1['channel'][_0x8e10('0x36')]('-')[0x0]]['id'],'destaccountcode':this[_0x8e10('0x10')][_0x23bcd1[_0x8e10('0x35')][_0x8e10('0x36')]('-')[0x0]][_0x8e10('0x63')]});for(var _0x2265fe=0x0;_0x2265fe0x0?_0x2a342c:0x0;this[_0x73fb('0x13')][_0x2bc96e[_0x73fb('0x63')]][_0x73fb('0x32')]=this['voiceQueues'][_0x2bc96e[_0x73fb('0x63')]][_0x73fb('0x32')]>_[_0x73fb('0x67')](_0x2bc96e[_0x73fb('0x69')])?_[_0x73fb('0x67')](_0x2bc96e[_0x73fb('0x69')]):this[_0x73fb('0x13')][_0x2bc96e[_0x73fb('0x63')]]['talking'];this[_0x73fb('0x4f')](this[_0x73fb('0x13')][_0x2bc96e['queue']],_0x73fb('0x16'));}logger[_0x73fb('0x45')](_0x73fb('0x6b'),util[_0x73fb('0x40')](this[_0x73fb('0x13')][_0x2bc96e[_0x73fb('0x63')]],{'showHidden':![],'depth':null}));ami[_0x73fb('0x44')](_0x73fb('0x6c'),this[_0x73fb('0x13')][_0x2bc96e[_0x73fb('0x63')]]);}}}catch(_0x1401bf){logger['error']('[voiceQueueReport][queuesummary]',util[_0x73fb('0x40')](_0x1401bf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x73fb('0xa')][_0x73fb('0x1a')]=function(_0x121872){logger[_0x73fb('0x45')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x73fb('0x40')](_0x121872,{'showHidden':![],'depth':null}));this[_0x73fb('0x60')]=!![];};VoiceQueueReport['prototype'][_0x73fb('0x1c')]=function(_0x454641){try{if(this['isNotNull'](_0x454641)){logger[_0x73fb('0x45')](_0x73fb('0x6d'),_0x454641[_0x73fb('0x48')],util['inspect'](_0x454641,{'showHidden':![],'depth':null}));if(_[_0x73fb('0x6e')](this[_0x73fb('0xf')][_0x454641['uniqueid']]))this[_0x73fb('0xf')][_0x454641[_0x73fb('0x48')]]=[];if(_[_0x73fb('0x6e')](this[_0x73fb('0x11')][_0x454641['uniqueid']]))this['channels'][_0x454641[_0x73fb('0x48')]]={};var _0x20b003=new QueueReport();_0x20b003[_0x73fb('0x4b')]=_0x454641[_0x73fb('0x63')];_0x20b003[_0x73fb('0x6f')]=this['voiceQueues'][_0x20b003['name']]&&this[_0x73fb('0x13')][_0x20b003[_0x73fb('0x4b')]][_0x73fb('0x6f')]?this[_0x73fb('0x13')][_0x20b003[_0x73fb('0x4b')]][_0x73fb('0x6f')]||_0x73fb('0x50'):_0x73fb('0x50');_0x20b003[_0x73fb('0x63')]=_0x454641['queue'];_0x20b003[_0x73fb('0x70')]=moment()[_0x73fb('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x20b003[_0x73fb('0x71')]=_0x454641['position'];_0x20b003['count']=_0x454641[_0x73fb('0x72')];_0x20b003['uniqueid']=_0x454641[_0x73fb('0x48')];_0x20b003[_0x73fb('0x73')]=this[_0x73fb('0x11')][_0x454641[_0x73fb('0x48')]][_0x73fb('0x73')];logger[_0x73fb('0x65')](_0x73fb('0x74'),_0x20b003[_0x73fb('0x4b')],_0x20b003['type']);_[_0x73fb('0x75')](_0x20b003,_[_0x73fb('0x76')](_0x454641,_[_0x73fb('0x77')](_0x20b003)));this[_0x73fb('0xf')][_0x454641[_0x73fb('0x48')]][_0x73fb('0x78')](_0x20b003);this[_0x73fb('0x11')][_0x454641['uniqueid']]=_0x20b003;this[_0x73fb('0x79')](_0x20b003,_0x73fb('0x1b'));}}catch(_0x2d9ff4){logger[_0x73fb('0x3e')](_0x73fb('0x6d'),_0x454641[_0x73fb('0x48')],util['inspect'](_0x2d9ff4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x73fb('0xa')][_0x73fb('0x7a')]=function(_0x154b28){try{if(this[_0x73fb('0x62')](_0x154b28)){logger['debug'](_0x73fb('0x7b'),_0x154b28[_0x73fb('0x48')],util[_0x73fb('0x40')](_0x154b28,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x154b28[_0x73fb('0x48')]]){var _0x4b1f50=_[_0x73fb('0x7c')](this[_0x73fb('0xf')][_0x154b28[_0x73fb('0x48')]]);_0x4b1f50[_0x73fb('0x7d')]=![];_0x4b1f50[_0x73fb('0x7e')]=null;_0x4b1f50[_0x73fb('0x7f')]=_0x154b28[_0x73fb('0x7f')];_0x4b1f50[_0x73fb('0x80')]=_0x154b28[_0x73fb('0x80')];_0x4b1f50[_0x73fb('0x1d')]=!![];_0x4b1f50[_0x73fb('0x81')]=moment()[_0x73fb('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x4b1f50[_0x73fb('0x82')]=_0x73fb('0x83');_0x4b1f50[_0x73fb('0x84')]=null;logger[_0x73fb('0x65')](_0x73fb('0x85'),_0x4b1f50[_0x73fb('0x4b')],_0x4b1f50[_0x73fb('0x6f')]);this['channels'][_0x154b28[_0x73fb('0x48')]]=_0x4b1f50;this['emitVoiceQueueChannelRemove'](_0x4b1f50,_0x73fb('0x1d'));}}}catch(_0x1471f0){logger['error'](_0x73fb('0x7b'),_0x154b28[_0x73fb('0x48')],util['inspect'](_0x1471f0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x73fb('0xa')][_0x73fb('0x86')]=function(_0x490206){try{if(this['isNotNull'](_0x490206)){logger[_0x73fb('0x45')](_0x73fb('0x87'),_0x490206[_0x73fb('0x48')],util[_0x73fb('0x40')](_0x490206,{'showHidden':![],'depth':null}));if(this[_0x73fb('0xf')][_0x490206[_0x73fb('0x48')]]){var _0x14b761=_[_0x73fb('0x7c')](this['queueReports'][_0x490206[_0x73fb('0x48')]]);_0x14b761[_0x73fb('0x88')]=moment()['format'](_0x73fb('0x89'));_0x14b761[_0x73fb('0x8a')]=_0x490206[_0x73fb('0x8a')];_0x14b761['connectedlinename']=_0x490206['connectedlinename'];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x14b761[_0x73fb('0x4b')],_0x14b761[_0x73fb('0x6f')],_0x490206['connectedlinenum'],_0x490206[_0x73fb('0x8b')]);this[_0x73fb('0x11')][_0x490206['uniqueid']]=_0x14b761;this[_0x73fb('0x79')](_0x14b761,_0x73fb('0x8c'));}}}catch(_0x2f7543){logger[_0x73fb('0x3e')]('[%s][voiceQueueReport][queuecallerleave]',_0x490206[_0x73fb('0x48')],util[_0x73fb('0x40')](_0x2f7543,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x73fb('0xa')]['syncAgentConnect']=function(_0x2c1c12){try{if(this['isNotNull'](_0x2c1c12)){logger['debug'](_0x73fb('0x8d'),_0x2c1c12[_0x73fb('0x48')],util[_0x73fb('0x40')](_0x2c1c12,{'showHidden':![],'depth':null}));if(this[_0x73fb('0xf')][_0x2c1c12[_0x73fb('0x48')]]){var _0x30699f=_['last'](this[_0x73fb('0xf')][_0x2c1c12[_0x73fb('0x48')]]);_0x30699f['queuecallercomplete']=!![];_0x30699f[_0x73fb('0x82')]='COMPLETEDBYAGENT';logger['info'](_0x73fb('0x8e'),_0x30699f[_0x73fb('0x4b')],_0x30699f['type']);}}}catch(_0x3a0898){logger[_0x73fb('0x3e')](_0x73fb('0x8d'),_0x2c1c12['uniqueid'],util[_0x73fb('0x40')](_0x3a0898,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x73fb('0xa')]['syncAgentComplete']=function(_0x373ee3){try{if(this[_0x73fb('0x62')](_0x373ee3)){logger[_0x73fb('0x45')](_0x73fb('0x8f'),_0x373ee3[_0x73fb('0x48')],util[_0x73fb('0x40')](_0x373ee3,{'showHidden':![],'depth':null}));if(this[_0x73fb('0xf')][_0x373ee3['uniqueid']]){var _0x372654=_['last'](this[_0x73fb('0xf')][_0x373ee3['uniqueid']]);_0x372654[_0x73fb('0x1d')]=![];_0x372654[_0x73fb('0x81')]=null;_0x372654[_0x73fb('0x90')]=!![];_0x372654[_0x73fb('0x84')]=_0x373ee3[_0x73fb('0x91')];_0x372654[_0x73fb('0x7f')]=_0x373ee3['holdtime'];_0x372654['queuecallercomplete']=!![];_0x372654['queuecallerexit']=![];_0x372654[_0x73fb('0x92')]=null;if(!_0x372654[_0x73fb('0x93')]){if(_0x373ee3[_0x73fb('0x94')]==_0x73fb('0x93')){_0x372654[_0x73fb('0x82')]=_0x73fb('0x95');logger[_0x73fb('0x65')](_0x73fb('0x96'),_0x372654[_0x73fb('0x4b')],_0x372654['type']);}else{if(_['startsWith'](_0x373ee3[_0x73fb('0x3b')][_0x73fb('0x97')](),_0x73fb('0x98'))){if(this['queueReports'][_0x373ee3[_0x73fb('0x99')]]){var _0x1af647=_[_0x73fb('0x7c')](this['queueReports'][_0x373ee3[_0x73fb('0x99')]]);_0x1af647[_0x73fb('0x7d')]=![];_0x1af647[_0x73fb('0x9a')]=!![];_0x1af647[_0x73fb('0x92')]=moment(_0x372654['queuecallerjoinAt'])[_0x73fb('0x9b')](_0x373ee3[_0x73fb('0x7f')],_0x73fb('0x9c'))[_0x73fb('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x1af647['queuecallerexitreason']=_0x73fb('0x9d');_0x1af647[_0x73fb('0x93')]=!![];_0x1af647[_0x73fb('0x9e')]=_0x73fb('0x9f');_0x1af647[_0x73fb('0xa0')]=_0x373ee3[_0x73fb('0xa1')];_0x1af647[_0x73fb('0xa2')]=_0x373ee3['uniqueid'];logger[_0x73fb('0x65')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x1af647[_0x73fb('0x4b')],_0x1af647[_0x73fb('0x6f')]);var _0xe2999e=this[_0x73fb('0xf')][_0x373ee3[_0x73fb('0x99')]];this[_0x73fb('0xf')][_0x373ee3['linkedid']]=this[_0x73fb('0xf')][_0x373ee3[_0x73fb('0x48')]];this[_0x73fb('0xf')][_0x373ee3[_0x73fb('0x48')]]=_0xe2999e;}}else{_0x372654[_0x73fb('0x82')]=_0x73fb('0xa3')+_0x373ee3['reason'][_0x73fb('0xa4')]();logger[_0x73fb('0x65')](_0x73fb('0xa5'),_0x372654['name'],_0x372654[_0x73fb('0x6f')],_0x372654['queuecallerexitreason']);}}}this[_0x73fb('0x11')][_0x373ee3['uniqueid']]=_0x372654;this['emitVoiceQueueChannelRemove'](_0x372654,'agentcomplete');}}}catch(_0x25f77c){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x373ee3[_0x73fb('0x48')],util['inspect'](_0x25f77c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x73fb('0xa')][_0x73fb('0xa6')]=function(_0x4f8cc1){try{if(this[_0x73fb('0x62')](_0x4f8cc1)){logger[_0x73fb('0x45')]('[%s][voiceQueueReport][varset]',_0x4f8cc1[_0x73fb('0x48')],util[_0x73fb('0x40')](_0x4f8cc1,{'showHidden':![],'depth':null}));this[_0x73fb('0xa7')](_0x4f8cc1[_0x73fb('0x48')],_[_0x73fb('0x77')](_0x4f8cc1[_0x73fb('0xa8')])[0x0],_0x4f8cc1['value']);if(this[_0x73fb('0xf')][_0x4f8cc1['uniqueid']]){var _0x32a639=_['last'](this['queueReports'][_0x4f8cc1[_0x73fb('0x48')]]);if(_0x32a639){if(this[_0x73fb('0x62')](_0x4f8cc1[_0x73fb('0xa8')])&&this[_0x73fb('0x62')](_0x4f8cc1[_0x73fb('0xa8')][_0x73fb('0xa9')])){switch(_0x4f8cc1['value']){case'CONTINUE':_0x32a639['queuecallerexit']=![];_0x32a639[_0x73fb('0x92')]=null;break;case _0x73fb('0xaa'):_0x32a639[_0x73fb('0xab')]='timeout';_0x32a639[_0x73fb('0x9a')]=!![];_0x32a639['queuecallerexitAt']=moment()['format'](_0x73fb('0x89'));_0x32a639['queuecallerleaveAt']=moment()[_0x73fb('0x49')](_0x73fb('0x89'));logger['debug'](_0x73fb('0xac'),_0x4f8cc1[_0x73fb('0x48')],util[_0x73fb('0x40')](_0x32a639,{'showHidden':![],'depth':null}));ami[_0x73fb('0x44')]('custom:timeout',_0x32a639);break;default:_0x32a639[_0x73fb('0x9a')]=!![];_0x32a639[_0x73fb('0x92')]=moment()[_0x73fb('0x49')](_0x73fb('0x89'));_0x32a639['queuecallerleaveAt']=moment()['format'](_0x73fb('0x89'));}_0x32a639[_0x73fb('0x1d')]=![];_0x32a639[_0x73fb('0x81')]=null;_0x32a639[_0x73fb('0x82')]=_0x4f8cc1['value'];this['channels'][_0x4f8cc1['uniqueid']]=_0x32a639;this[_0x73fb('0xad')](_0x32a639,_0x73fb('0xae'));}else if(this[_0x73fb('0x62')](_0x4f8cc1[_0x73fb('0xa8')])&&this[_0x73fb('0x62')](_0x4f8cc1[_0x73fb('0xa8')][_0x73fb('0xaf')])){if(!_0x32a639[_0x73fb('0x1d')]){_0x32a639[_0x73fb('0x9a')]=!![];_0x32a639[_0x73fb('0x92')]=moment()[_0x73fb('0x49')](_0x73fb('0x89'));_0x32a639[_0x73fb('0x82')]=_0x73fb('0xb0');_0x32a639[_0x73fb('0x88')]=moment()[_0x73fb('0x49')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x73fb('0x11')][_0x4f8cc1[_0x73fb('0x48')]]=_0x32a639;}}logger[_0x73fb('0x65')](_0x73fb('0xb1'),_0x4f8cc1[_0x73fb('0x48')],_0x32a639['name'],_0x32a639[_0x73fb('0x6f')],_[_0x73fb('0x77')](_0x4f8cc1['variable'])[0x0],_0x4f8cc1[_0x73fb('0xb2')]);_0x32a639[_0x73fb('0x15')]=this[_0x73fb('0x15')][_0x4f8cc1['uniqueid']];}}}}catch(_0x20c821){logger[_0x73fb('0x3e')](_0x73fb('0xb3'),_0x4f8cc1['uniqueid'],util[_0x73fb('0x40')](_0x20c821,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x73fb('0xa')][_0x73fb('0xa7')]=function(_0x4b7fd6,_0x4c6316,_0x1ea72a){var _0x37bad7=[_0x73fb('0xb4'),_0x73fb('0xb5'),_0x73fb('0xb6'),_0x73fb('0xb7'),'rtpaudioqosloss',_0x73fb('0xb8'),_0x73fb('0xb9'),_0x73fb('0xba'),_0x73fb('0xbb'),'sipuri',_0x73fb('0xbc'),_0x73fb('0xbd'),_0x73fb('0xbe'),_0x73fb('0xbf'),_0x73fb('0xc0'),_0x73fb('0xc1'),_0x73fb('0x91'),'memberpenalty','memberrealtime'];if(!_['isNil'](_0x4c6316)&&!_[_0x73fb('0xc2')](_0x37bad7,_0x4c6316)){if(_['isUndefined'](this[_0x73fb('0x15')][_0x4b7fd6])){this[_0x73fb('0x15')][_0x4b7fd6]={};}this[_0x73fb('0x15')][_0x4b7fd6][_0x4c6316]=_0x1ea72a;}};VoiceQueueReport[_0x73fb('0xa')][_0x73fb('0x22')]=function(_0x4f3ae6){try{if(this[_0x73fb('0x62')](_0x4f3ae6)){logger[_0x73fb('0x45')](_0x73fb('0xc3'),_0x4f3ae6[_0x73fb('0x48')],util['inspect'](_0x4f3ae6,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4f3ae6[_0x73fb('0x48')]]){for(var _0x287548=0x0,_0x51f020={};_0x2875480x0?_0x29c3af:0x0;this[_0x1471('0x14')][_0x39c480[_0x1471('0x74')]][_0x1471('0x3b')]=this[_0x1471('0x14')][_0x39c480[_0x1471('0x74')]]['talking']>_['toNumber'](_0x39c480[_0x1471('0x7a')])?_[_0x1471('0x79')](_0x39c480[_0x1471('0x7a')]):this[_0x1471('0x14')][_0x39c480[_0x1471('0x74')]][_0x1471('0x3b')];this['emitVoiceQueueSummary'](this['voiceQueues'][_0x39c480[_0x1471('0x74')]],_0x1471('0x18'));}logger[_0x1471('0x4f')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x1471('0x46')](this[_0x1471('0x14')][_0x39c480[_0x1471('0x74')]],{'showHidden':![],'depth':null}));ami[_0x1471('0x4d')](_0x1471('0x7b'),this['voiceQueues'][_0x39c480[_0x1471('0x74')]]);}}}catch(_0x2e4ef2){logger[_0x1471('0x44')](_0x1471('0x72'),util[_0x1471('0x46')](_0x2e4ef2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1471('0xc')][_0x1471('0x1b')]=function(_0x14440f){logger[_0x1471('0x4f')](_0x1471('0x7c'),util[_0x1471('0x46')](_0x14440f,{'showHidden':![],'depth':null}));this[_0x1471('0x15')]=!![];};VoiceQueueReport[_0x1471('0xc')][_0x1471('0x1d')]=function(_0x13ad4d){try{if(this[_0x1471('0x6c')](_0x13ad4d)){logger[_0x1471('0x4f')]('[%s][voiceQueueReport][queuecallerjoin]',_0x13ad4d[_0x1471('0x50')],util[_0x1471('0x46')](_0x13ad4d,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x1471('0x10')][_0x13ad4d[_0x1471('0x50')]]))this[_0x1471('0x10')][_0x13ad4d[_0x1471('0x50')]]=[];if(_[_0x1471('0x6d')](this[_0x1471('0x12')][_0x13ad4d[_0x1471('0x50')]]))this[_0x1471('0x12')][_0x13ad4d[_0x1471('0x50')]]={};var _0x5a33b9=new QueueReport();_0x5a33b9[_0x1471('0x52')]=_0x13ad4d['queue'];_0x5a33b9[_0x1471('0x59')]=this[_0x1471('0x14')][_0x5a33b9[_0x1471('0x52')]]&&this[_0x1471('0x14')][_0x5a33b9[_0x1471('0x52')]]['type']?this[_0x1471('0x14')][_0x5a33b9['name']][_0x1471('0x59')]||'inbound':'inbound';_0x5a33b9[_0x1471('0x74')]=_0x13ad4d[_0x1471('0x74')];_0x5a33b9[_0x1471('0x7d')]=moment()['format'](_0x1471('0x7e'));_0x5a33b9[_0x1471('0x7f')]=_0x13ad4d[_0x1471('0x7f')];_0x5a33b9[_0x1471('0x80')]=_0x13ad4d['count'];_0x5a33b9['uniqueid']=_0x13ad4d[_0x1471('0x50')];_0x5a33b9['routealias']=this[_0x1471('0x12')][_0x13ad4d[_0x1471('0x50')]][_0x1471('0x81')];logger[_0x1471('0x82')](_0x1471('0x83'),_0x5a33b9['name'],_0x5a33b9[_0x1471('0x59')]);_['merge'](_0x5a33b9,_[_0x1471('0x84')](_0x13ad4d,_[_0x1471('0x85')](_0x5a33b9)));this['queueReports'][_0x13ad4d[_0x1471('0x50')]][_0x1471('0x86')](_0x5a33b9);this[_0x1471('0x12')][_0x13ad4d['uniqueid']]=_0x5a33b9;this[_0x1471('0x4e')](_0x5a33b9,_0x1471('0x1c'));}}catch(_0x4a7c34){logger[_0x1471('0x44')](_0x1471('0x87'),_0x13ad4d[_0x1471('0x50')],util[_0x1471('0x46')](_0x4a7c34,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1471('0xc')][_0x1471('0x1f')]=function(_0x5664a3){try{if(this[_0x1471('0x6c')](_0x5664a3)){logger[_0x1471('0x4f')]('[%s][voiceQueueReport][queuecallerabandon]',_0x5664a3[_0x1471('0x50')],util['inspect'](_0x5664a3,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5664a3[_0x1471('0x50')]]){var _0x52f4ae=_[_0x1471('0x88')](this[_0x1471('0x10')][_0x5664a3['uniqueid']]);_0x52f4ae[_0x1471('0x89')]=![];_0x52f4ae[_0x1471('0x8a')]=null;_0x52f4ae[_0x1471('0x8b')]=_0x5664a3['holdtime'];_0x52f4ae[_0x1471('0x8c')]=_0x5664a3['originalposition'];_0x52f4ae[_0x1471('0x1e')]=!![];_0x52f4ae[_0x1471('0x8d')]=moment()[_0x1471('0x6a')](_0x1471('0x7e'));_0x52f4ae[_0x1471('0x8e')]='ABANDONED';_0x52f4ae[_0x1471('0x8f')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x52f4ae[_0x1471('0x52')],_0x52f4ae[_0x1471('0x59')]);this[_0x1471('0x12')][_0x5664a3[_0x1471('0x50')]]=_0x52f4ae;this[_0x1471('0x4b')](_0x52f4ae,'queuecallerabandon');}}}catch(_0x15c3cd){logger[_0x1471('0x44')](_0x1471('0x90'),_0x5664a3['uniqueid'],util['inspect'](_0x15c3cd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1471('0xc')][_0x1471('0x21')]=function(_0x4ab37d){try{if(this[_0x1471('0x6c')](_0x4ab37d)){logger[_0x1471('0x4f')](_0x1471('0x91'),_0x4ab37d['uniqueid'],util[_0x1471('0x46')](_0x4ab37d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4ab37d['uniqueid']]){var _0x544815=_[_0x1471('0x88')](this[_0x1471('0x10')][_0x4ab37d[_0x1471('0x50')]]);_0x544815['queuecallerleaveAt']=moment()['format'](_0x1471('0x7e'));_0x544815[_0x1471('0x92')]=_0x4ab37d['connectedlinenum'];_0x544815['connectedlinename']=_0x4ab37d['connectedlinename'];logger[_0x1471('0x82')](_0x1471('0x93'),_0x544815[_0x1471('0x52')],_0x544815[_0x1471('0x59')],_0x4ab37d[_0x1471('0x92')],_0x4ab37d[_0x1471('0x94')]);this[_0x1471('0x12')][_0x4ab37d[_0x1471('0x50')]]=_0x544815;this['emitVoiceQueueChannelSave'](_0x544815,_0x1471('0x20'));}}}catch(_0x39c0c4){logger['error'](_0x1471('0x91'),_0x4ab37d[_0x1471('0x50')],util[_0x1471('0x46')](_0x39c0c4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1471('0xc')][_0x1471('0x25')]=function(_0x4239c2){try{if(this[_0x1471('0x6c')](_0x4239c2)){logger[_0x1471('0x4f')](_0x1471('0x95'),_0x4239c2[_0x1471('0x50')],util[_0x1471('0x46')](_0x4239c2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4239c2['uniqueid']]){var _0x2257b9=_['last'](this[_0x1471('0x10')][_0x4239c2[_0x1471('0x50')]]);_0x2257b9[_0x1471('0x89')]=!![];_0x2257b9['queuecallerexitreason']=_0x1471('0x96');logger[_0x1471('0x82')](_0x1471('0x97'),_0x2257b9['name'],_0x2257b9[_0x1471('0x59')]);}}}catch(_0x3a89f7){logger['error'](_0x1471('0x95'),_0x4239c2[_0x1471('0x50')],util[_0x1471('0x46')](_0x3a89f7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1471('0x23')]=function(_0xe011f1){try{if(this[_0x1471('0x6c')](_0xe011f1)){logger[_0x1471('0x4f')](_0x1471('0x98'),_0xe011f1['uniqueid'],util[_0x1471('0x46')](_0xe011f1,{'showHidden':![],'depth':null}));if(this[_0x1471('0x10')][_0xe011f1[_0x1471('0x50')]]){var _0x5358e3=_[_0x1471('0x88')](this[_0x1471('0x10')][_0xe011f1[_0x1471('0x50')]]);_0x5358e3[_0x1471('0x1e')]=![];_0x5358e3[_0x1471('0x8d')]=null;_0x5358e3[_0x1471('0x99')]=!![];_0x5358e3['lastAssignedTo']=_0xe011f1['membername'];_0x5358e3[_0x1471('0x8b')]=_0xe011f1['holdtime'];_0x5358e3['queuecallercomplete']=!![];_0x5358e3['queuecallerexit']=![];_0x5358e3[_0x1471('0x9a')]=null;if(!_0x5358e3[_0x1471('0x9b')]){if(_0xe011f1[_0x1471('0x9c')]==_0x1471('0x9b')){_0x5358e3[_0x1471('0x8e')]=_0x1471('0x9d');logger[_0x1471('0x82')](_0x1471('0x9e'),_0x5358e3['name'],_0x5358e3['type']);}else{if(_[_0x1471('0x9f')](_0xe011f1[_0x1471('0x42')][_0x1471('0xa0')](),_0x1471('0xa1'))){if(this['queueReports'][_0xe011f1[_0x1471('0xa2')]]){var _0x1852d8=_['last'](this[_0x1471('0x10')][_0xe011f1[_0x1471('0xa2')]]);_0x1852d8[_0x1471('0x89')]=![];_0x1852d8[_0x1471('0xa3')]=!![];_0x1852d8[_0x1471('0x9a')]=moment(_0x5358e3[_0x1471('0x7d')])[_0x1471('0xa4')](_0xe011f1['holdtime'],_0x1471('0xa5'))[_0x1471('0x6a')](_0x1471('0x7e'));_0x1852d8[_0x1471('0x8e')]=_0x1471('0xa6');_0x1852d8[_0x1471('0x9b')]=!![];_0x1852d8['transfertype']=_0x1471('0xa7');_0x1852d8[_0x1471('0xa8')]=_0xe011f1[_0x1471('0xa9')];_0x1852d8[_0x1471('0xaa')]=_0xe011f1[_0x1471('0x50')];logger[_0x1471('0x82')](_0x1471('0xab'),_0x1852d8[_0x1471('0x52')],_0x1852d8[_0x1471('0x59')]);var _0x2504ef=this['queueReports'][_0xe011f1[_0x1471('0xa2')]];this['queueReports'][_0xe011f1[_0x1471('0xa2')]]=this[_0x1471('0x10')][_0xe011f1[_0x1471('0x50')]];this[_0x1471('0x10')][_0xe011f1[_0x1471('0x50')]]=_0x2504ef;}}else{_0x5358e3[_0x1471('0x8e')]=_0x1471('0xac')+_0xe011f1[_0x1471('0x9c')][_0x1471('0xad')]();logger[_0x1471('0x82')](_0x1471('0xae'),_0x5358e3[_0x1471('0x52')],_0x5358e3[_0x1471('0x59')],_0x5358e3[_0x1471('0x8e')]);}}}this[_0x1471('0x12')][_0xe011f1[_0x1471('0x50')]]=_0x5358e3;this[_0x1471('0x4b')](_0x5358e3,_0x1471('0x22'));}}}catch(_0x3b51f2){logger[_0x1471('0x44')](_0x1471('0x98'),_0xe011f1[_0x1471('0x50')],util['inspect'](_0x3b51f2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1471('0x27')]=function(_0x38d9c8){try{if(this[_0x1471('0x6c')](_0x38d9c8)){logger[_0x1471('0x4f')](_0x1471('0xaf'),_0x38d9c8['uniqueid'],util[_0x1471('0x46')](_0x38d9c8,{'showHidden':![],'depth':null}));this[_0x1471('0xb0')](_0x38d9c8[_0x1471('0x50')],_[_0x1471('0x85')](_0x38d9c8[_0x1471('0xb1')])[0x0],_0x38d9c8[_0x1471('0xb2')]);if(this[_0x1471('0x10')][_0x38d9c8[_0x1471('0x50')]]){var _0x5d8d3a=_[_0x1471('0x88')](this['queueReports'][_0x38d9c8['uniqueid']]);if(_0x5d8d3a){if(this[_0x1471('0x6c')](_0x38d9c8[_0x1471('0xb1')])&&this['isNotNull'](_0x38d9c8[_0x1471('0xb1')][_0x1471('0xb3')])){switch(_0x38d9c8['value']){case'CONTINUE':_0x5d8d3a['queuecallerexit']=![];_0x5d8d3a[_0x1471('0x9a')]=null;break;case _0x1471('0xb4'):_0x5d8d3a['lastevent']=_0x1471('0xb5');_0x5d8d3a[_0x1471('0xa3')]=!![];_0x5d8d3a[_0x1471('0x9a')]=moment()[_0x1471('0x6a')](_0x1471('0x7e'));_0x5d8d3a['queuecallerleaveAt']=moment()[_0x1471('0x6a')](_0x1471('0x7e'));logger[_0x1471('0x4f')](_0x1471('0xb6'),_0x38d9c8['uniqueid'],util[_0x1471('0x46')](_0x5d8d3a,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x5d8d3a);break;default:_0x5d8d3a[_0x1471('0xa3')]=!![];_0x5d8d3a[_0x1471('0x9a')]=moment()['format'](_0x1471('0x7e'));_0x5d8d3a[_0x1471('0xb7')]=moment()[_0x1471('0x6a')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5d8d3a[_0x1471('0x1e')]=![];_0x5d8d3a[_0x1471('0x8d')]=null;_0x5d8d3a['queuecallerexitreason']=_0x38d9c8[_0x1471('0xb2')];this['channels'][_0x38d9c8[_0x1471('0x50')]]=_0x5d8d3a;this['emitVoiceQueueChannelRemove'](_0x5d8d3a,_0x1471('0x26'));}else if(this[_0x1471('0x6c')](_0x38d9c8[_0x1471('0xb1')])&&this[_0x1471('0x6c')](_0x38d9c8[_0x1471('0xb1')][_0x1471('0xb8')])){if(!_0x5d8d3a[_0x1471('0x1e')]){_0x5d8d3a[_0x1471('0xa3')]=!![];_0x5d8d3a[_0x1471('0x9a')]=moment()[_0x1471('0x6a')](_0x1471('0x7e'));_0x5d8d3a[_0x1471('0x8e')]=_0x1471('0xb9');_0x5d8d3a[_0x1471('0xb7')]=moment()[_0x1471('0x6a')](_0x1471('0x7e'));this['channels'][_0x38d9c8['uniqueid']]=_0x5d8d3a;}}logger[_0x1471('0x82')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x38d9c8['uniqueid'],_0x5d8d3a[_0x1471('0x52')],_0x5d8d3a['type'],_[_0x1471('0x85')](_0x38d9c8['variable'])[0x0],_0x38d9c8[_0x1471('0xb2')]);_0x5d8d3a[_0x1471('0x17')]=this[_0x1471('0x17')][_0x38d9c8['uniqueid']];}}}}catch(_0x891be3){logger[_0x1471('0x44')](_0x1471('0xaf'),_0x38d9c8[_0x1471('0x50')],util[_0x1471('0x46')](_0x891be3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1471('0xc')]['addVariable']=function(_0x508b70,_0x4dbf83,_0x37423c){var _0xdb8977=['rtpaudioqos',_0x1471('0xba'),_0x1471('0xbb'),_0x1471('0xbc'),_0x1471('0xbd'),_0x1471('0xbe'),_0x1471('0xbf'),'rtpaudioqosrttbridged',_0x1471('0xc0'),_0x1471('0xc1'),'bridgepeer',_0x1471('0xc2'),_0x1471('0xc3'),_0x1471('0xc4'),_0x1471('0xc5'),'memberlastcall','membername',_0x1471('0xc6'),'memberrealtime'];if(!_['isNil'](_0x4dbf83)&&!_[_0x1471('0xc7')](_0xdb8977,_0x4dbf83)){if(_[_0x1471('0x6d')](this[_0x1471('0x17')][_0x508b70])){this['variables'][_0x508b70]={};}this[_0x1471('0x17')][_0x508b70][_0x4dbf83]=_0x37423c;}};VoiceQueueReport[_0x1471('0xc')][_0x1471('0x29')]=function(_0x16b66c){try{if(this[_0x1471('0x6c')](_0x16b66c)){logger[_0x1471('0x4f')](_0x1471('0xc8'),_0x16b66c['uniqueid'],util[_0x1471('0x46')](_0x16b66c,{'showHidden':![],'depth':null}));if(this[_0x1471('0x10')][_0x16b66c['uniqueid']]){for(var _0x3925ca=0x0,_0x50e7f9={};_0x3925ca=0x0?moment(_0x45bb81[_0xc4e8('0x14')])[_0xc4e8('0xe')](_0x45bb81[_0xc4e8('0x13')],_0xc4e8('0x15')):null,'data1':_0xc4e8('0x16'),'data2':_0x45bb81['accountcode'],'data3':_0x45bb81['exten'],'data4':_0x45bb81['dialstring']||null,'role':_0xc4e8('0x17'),'internal':_0x45bb81[_0xc4e8('0x10')]?_[_0xc4e8('0xf')](_0x45bb81[_0xc4e8('0x10')]):undefined,'uniqueid':_0x45bb81[_0xc4e8('0x11')]},'log':_0xc4e8('0x5')});}; \ No newline at end of file +var _0xabce=['seconds','outbound','dialstring','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','Request','CreateMemberReport','lastAssignedTo','isNil','format','SIP/%s','TALKING','queuecallerleaveAt','diff','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','voice','membername','interface','endtime','starttime'];(function(_0x4afe21,_0xd3a32f){var _0x5130a7=function(_0x2f5b17){while(--_0x2f5b17){_0x4afe21['push'](_0x4afe21['shift']());}};_0x5130a7(++_0xd3a32f);}(_0xabce,0x1f3));var _0xeabc=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xabce[_0x5b561d];return _0x431060;};'use strict';var moment=require('moment');var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var client=require(_0xeabc('0x2'));exports[_0xeabc('0x3')]=function(_0x365eba){var _0x26bf6f=_0x365eba[_0xeabc('0x4')]||_0x365eba['queuecallerexitAt'];return client[_0xeabc('0x5')](_0xeabc('0x6'),{'body':{'channel':'voice','membername':_0x365eba[_0xeabc('0x7')],'interface':_[_0xeabc('0x8')](_0x365eba['interface'])?util[_0xeabc('0x9')](_0xeabc('0xa'),_0x365eba['lastAssignedTo']):_0x365eba['interface'],'type':_0xeabc('0xb'),'enterAt':_0x365eba[_0xeabc('0xc')],'exitAt':_0x26bf6f,'duration':moment(_0x26bf6f)[_0xeabc('0xd')](_0x365eba[_0xeabc('0xc')],'seconds'),'data1':_0xeabc('0xe'),'data2':_0x365eba[_0xeabc('0xf')],'data3':_0x365eba[_0xeabc('0x10')],'data4':null,'data5':_0x365eba[_0xeabc('0x11')],'role':_0xeabc('0x12'),'internal':_0x365eba[_0xeabc('0x13')]?_[_0xeabc('0x14')](_0x365eba[_0xeabc('0x13')]):undefined,'uniqueid':_0x365eba[_0xeabc('0x15')]},'log':'CreateMemberReport'});};exports[_0xeabc('0x16')]=function(_0x3c5e1a){return client[_0xeabc('0x5')](_0xeabc('0x6'),{'body':{'channel':_0xeabc('0x17'),'membername':_0x3c5e1a[_0xeabc('0x18')],'interface':_0x3c5e1a[_0xeabc('0x19')],'type':_0xeabc('0xb'),'enterAt':_0x3c5e1a['starttime'],'exitAt':_0x3c5e1a[_0xeabc('0x1a')],'duration':moment(_0x3c5e1a['endtime'])[_0xeabc('0xd')](_0x3c5e1a[_0xeabc('0x1b')],'seconds')>=0x0?moment(_0x3c5e1a[_0xeabc('0x1a')])[_0xeabc('0xd')](_0x3c5e1a['starttime'],_0xeabc('0x1c')):null,'data1':_0xeabc('0x1d'),'data2':_0x3c5e1a['accountcode'],'data3':_0x3c5e1a[_0xeabc('0x10')],'data4':_0x3c5e1a[_0xeabc('0x1e')]||null,'role':_0xeabc('0x12'),'internal':_0x3c5e1a[_0xeabc('0x13')]?_[_0xeabc('0x14')](_0x3c5e1a[_0xeabc('0x13')]):undefined,'uniqueid':_0x3c5e1a[_0xeabc('0x15')]},'log':_0xeabc('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 4770d68..bd6a039 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 _0xfc61=['../client','getSettings','Request','ShowSetting'];(function(_0x41b459,_0x52858e){var _0x3f09da=function(_0x315e55){while(--_0x315e55){_0x41b459['push'](_0x41b459['shift']());}};_0x3f09da(++_0x52858e);}(_0xfc61,0x78));var _0x1fc6=function(_0x57d3cd,_0x2d772a){_0x57d3cd=_0x57d3cd-0x0;var _0x3b67c0=_0xfc61[_0x57d3cd];return _0x3b67c0;};'use strict';var client=require(_0x1fc6('0x0'));exports[_0x1fc6('0x1')]=function(){return client[_0x1fc6('0x2')](_0x1fc6('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':'GetSettings'});}; \ No newline at end of file +var _0xf6fb=['Request','ShowSetting','GetSettings'];(function(_0x2c5293,_0x55c13c){var _0x3c16f5=function(_0x4d3fa6){while(--_0x4d3fa6){_0x2c5293['push'](_0x2c5293['shift']());}};_0x3c16f5(++_0x55c13c);}(_0xf6fb,0x111));var _0xbf6f=function(_0x34ac35,_0x46f0ce){_0x34ac35=_0x34ac35-0x0;var _0x71100f=_0xf6fb[_0x34ac35];return _0x71100f;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0xbf6f('0x0')](_0xbf6f('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0xbf6f('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index c367e45..dbf44dc 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 _0xb4fe=['getTemplates','GetTemplate','name','html','../client'];(function(_0x50f675,_0x4280e1){var _0x313ffb=function(_0x4875a5){while(--_0x4875a5){_0x50f675['push'](_0x50f675['shift']());}};_0x313ffb(++_0x4280e1);}(_0xb4fe,0x117));var _0xeb4f=function(_0xf58e04,_0x5f2873){_0xf58e04=_0xf58e04-0x0;var _0x11e9d9=_0xb4fe[_0xf58e04];return _0x11e9d9;};'use strict';var client=require(_0xeb4f('0x0'));exports[_0xeb4f('0x1')]=function(_0x1e0ccc){return function(_0x40ed1c){return client['Request'](_0xeb4f('0x2'),{'options':{'raw':!![],'attributes':['id',_0xeb4f('0x3'),_0xeb4f('0x4')]},'log':_0xeb4f('0x2')});};}; \ No newline at end of file +var _0xa38c=['html','../client','getTemplates','Request','GetTemplate','name'];(function(_0x5bedf7,_0x2add92){var _0x5f11fc=function(_0x1ea10f){while(--_0x1ea10f){_0x5bedf7['push'](_0x5bedf7['shift']());}};_0x5f11fc(++_0x2add92);}(_0xa38c,0x1bd));var _0xca38=function(_0x4aa222,_0x103892){_0x4aa222=_0x4aa222-0x0;var _0x3e9fc0=_0xa38c[_0x4aa222];return _0x3e9fc0;};'use strict';var client=require(_0xca38('0x0'));exports[_0xca38('0x1')]=function(_0x4f063a){return function(_0x373b85){return client[_0xca38('0x2')](_0xca38('0x3'),{'options':{'raw':!![],'attributes':['id',_0xca38('0x4'),_0xca38('0x5')]},'log':_0xca38('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 79f7c0b..ab684ef 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 _0x81d2=['data4','data5','data7','GetTrigger','../client','Request','name','status','AllConditions','field','operator','Condition','AnyConditions','value','Action','Actions','action','data1','data2','data3'];(function(_0x4acf6f,_0x5072e5){var _0x3c6d3a=function(_0x4c72a6){while(--_0x4c72a6){_0x4acf6f['push'](_0x4acf6f['shift']());}};_0x3c6d3a(++_0x5072e5);}(_0x81d2,0x7c));var _0x281d=function(_0x141444,_0x2e551e){_0x141444=_0x141444-0x0;var _0x350f36=_0x81d2[_0x141444];return _0x350f36;};'use strict';var client=require(_0x281d('0x0'));exports['getTriggers']=function(_0x7c4e77){return function(_0x5df345){return client[_0x281d('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x281d('0x2'),'channel',_0x281d('0x3')],'include':[{'model':'Condition','as':_0x281d('0x4'),'attributes':['id',_0x281d('0x5'),_0x281d('0x6'),'value']},{'model':_0x281d('0x7'),'as':_0x281d('0x8'),'attributes':['id',_0x281d('0x5'),_0x281d('0x6'),_0x281d('0x9')]},{'model':_0x281d('0xa'),'as':_0x281d('0xb'),'attributes':['id',_0x281d('0xc'),_0x281d('0xd'),_0x281d('0xe'),_0x281d('0xf'),_0x281d('0x10'),_0x281d('0x11'),'data6',_0x281d('0x12')]}]},'log':_0x281d('0x13')});};}; \ No newline at end of file +var _0xf065=['data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','field','operator','value','AnyConditions','Action','Actions','action','data2','data3'];(function(_0x24af8a,_0x36499e){var _0x47fb01=function(_0x261ba8){while(--_0x261ba8){_0x24af8a['push'](_0x24af8a['shift']());}};_0x47fb01(++_0x36499e);}(_0xf065,0x13f));var _0x5f06=function(_0x10121f,_0x56b9aa){_0x10121f=_0x10121f-0x0;var _0x3bff1a=_0xf065[_0x10121f];return _0x3bff1a;};'use strict';var client=require(_0x5f06('0x0'));exports[_0x5f06('0x1')]=function(_0x28b5d3){return function(_0x5cee43){return client[_0x5f06('0x2')](_0x5f06('0x3'),{'options':{'raw':![],'attributes':['id',_0x5f06('0x4'),_0x5f06('0x5'),_0x5f06('0x6')],'include':[{'model':_0x5f06('0x7'),'as':'AllConditions','attributes':['id',_0x5f06('0x8'),_0x5f06('0x9'),_0x5f06('0xa')]},{'model':'Condition','as':_0x5f06('0xb'),'attributes':['id',_0x5f06('0x8'),_0x5f06('0x9'),_0x5f06('0xa')]},{'model':_0x5f06('0xc'),'as':_0x5f06('0xd'),'attributes':['id',_0x5f06('0xe'),'data1',_0x5f06('0xf'),_0x5f06('0x10'),_0x5f06('0x11'),_0x5f06('0x12'),_0x5f06('0x13'),_0x5f06('0x14')]}]},'log':_0x5f06('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 0532c25..59041d3 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 _0xd8c0=['GetTrunk','registry','defaultuser','../client','getTrunks'];(function(_0x25cd6d,_0x30a718){var _0x7811e1=function(_0x29c1a1){while(--_0x29c1a1){_0x25cd6d['push'](_0x25cd6d['shift']());}};_0x7811e1(++_0x30a718);}(_0xd8c0,0x76));var _0x0d8c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd8c0[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x0d8c('0x0'));exports[_0x0d8c('0x1')]=function(_0x4ae80d){return function(_0xea7683){return client['Request'](_0x0d8c('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x0d8c('0x3'),_0x0d8c('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xfa2d=['getTrunks','Request','registry','defaultuser','../client'];(function(_0x156a0d,_0x3946ce){var _0x98a9ba=function(_0x46c1b2){while(--_0x46c1b2){_0x156a0d['push'](_0x156a0d['shift']());}};_0x98a9ba(++_0x3946ce);}(_0xfa2d,0x112));var _0xdfa2=function(_0x487cd3,_0x553df0){_0x487cd3=_0x487cd3-0x0;var _0x19f284=_0xfa2d[_0x487cd3];return _0x19f284;};'use strict';var client=require(_0xdfa2('0x0'));exports[_0xdfa2('0x1')]=function(_0x398998){return function(_0x511f43){return client[_0xdfa2('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xdfa2('0x3'),_0xdfa2('0x4')]},'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 0f35149..bca7293 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 _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x3a4597,_0x2732f5){var _0x2dc20a=function(_0x93bbfb){while(--_0x93bbfb){_0x3a4597['push'](_0x3a4597['shift']());}};_0x2dc20a(++_0x2732f5);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file +var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x30b111,_0x2e2566){var _0x39e7e4=function(_0x477886){while(--_0x477886){_0x30b111['push'](_0x30b111['shift']());}};_0x39e7e4(++_0x2e2566);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 5897bc3..67afece 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 _0x2fc9=['update','Request','UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport'];(function(_0x25a613,_0x5cfa10){var _0x2fb23d=function(_0x3a90b3){while(--_0x3a90b3){_0x25a613['push'](_0x25a613['shift']());}};_0x2fb23d(++_0x5cfa10);}(_0x2fc9,0xcf));var _0x92fc=function(_0x56e32e,_0x9eb2f6){_0x56e32e=_0x56e32e-0x0;var _0x2a757b=_0x2fc9[_0x56e32e];return _0x2a757b;};'use strict';var client=require(_0x92fc('0x0'));exports[_0x92fc('0x1')]=function(_0x470dcf){return client['Request'](_0x92fc('0x2'),{'body':_0x470dcf,'log':_0x92fc('0x2')});};exports[_0x92fc('0x3')]=function(_0x2c81e2,_0x59a856,_0x2a78b7){return client[_0x92fc('0x4')](_0x92fc('0x5'),{'body':_0x2c81e2,'options':{'where':{'uniqueid':_0x59a856,'interface':_0x2a78b7,'agentcomplete':!![]}},'log':_0x92fc('0x5')});}; \ No newline at end of file +var _0x569b=['UpdateVoiceAgentReport','../client','create'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x569b,0x100));var _0xb569=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x569b[_0x1ccdf7];return _0x52a0ae;};'use strict';var client=require(_0xb569('0x0'));exports[_0xb569('0x1')]=function(_0x149da1){return client['Request']('CreateVoiceAgentReport',{'body':_0x149da1,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x358ce2,_0x36b6cf,_0x11b57e){return client['Request'](_0xb569('0x2'),{'body':_0x358ce2,'options':{'where':{'uniqueid':_0x36b6cf,'interface':_0x11b57e,'agentcomplete':!![]}},'log':_0xb569('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 850cf83..0b23499 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 _0x38d4=['GetVoiceCallReports','util','lodash','../client','Request','CreateVoiceCallReport','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','billableseconds'];(function(_0xcd0e4f,_0x4a53a5){var _0x4e2524=function(_0x507474){while(--_0x507474){_0xcd0e4f['push'](_0xcd0e4f['shift']());}};_0x4e2524(++_0x4a53a5);}(_0x38d4,0xc7));var _0x438d=function(_0x15ddc9,_0x209223){_0x15ddc9=_0x15ddc9-0x0;var _0x2fc9e8=_0x38d4[_0x15ddc9];return _0x2fc9e8;};'use strict';var moment=require('moment');var util=require(_0x438d('0x0'));var _=require(_0x438d('0x1'));var client=require(_0x438d('0x2'));exports['create']=function(_0x238c1a){return client[_0x438d('0x3')](_0x438d('0x4'),{'body':_['merge'](_0x238c1a,{'source':_0x238c1a[_0x438d('0x5')],'destinationcontext':_0x238c1a[_0x438d('0x6')],'callerid':_0x238c1a[_0x438d('0x7')],'amaflags':_0x438d('0x8')}),'log':_0x438d('0x4')});};exports[_0x438d('0x9')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0x438d('0xa')],'createdAt':{'$between':[moment()['startOf'](_0x438d('0xb'))[_0x438d('0xc')](_0x438d('0xd')),moment()[_0x438d('0xe')](_0x438d('0xb'))[_0x438d('0xc')](_0x438d('0xd'))]}},'attributes':[_0x438d('0xf'),'disposition','duration',_0x438d('0x10')]},'log':_0x438d('0x11')});};}; \ No newline at end of file +var _0xb328=['outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','duration','GetVoiceCallReports','moment','util','lodash','create','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb328,0xba));var _0x8b32=function(_0x2f5742,_0x1d7dc1){_0x2f5742=_0x2f5742-0x0;var _0x50b577=_0xb328[_0x2f5742];return _0x50b577;};'use strict';var moment=require(_0x8b32('0x0'));var util=require(_0x8b32('0x1'));var _=require(_0x8b32('0x2'));var client=require('../client');exports[_0x8b32('0x3')]=function(_0x56e918){return client[_0x8b32('0x4')](_0x8b32('0x5'),{'body':_[_0x8b32('0x6')](_0x56e918,{'source':_0x56e918[_0x8b32('0x7')],'destinationcontext':_0x56e918[_0x8b32('0x8')],'callerid':_0x56e918['callerid'],'amaflags':_0x8b32('0x9')}),'log':_0x8b32('0x5')});};exports[_0x8b32('0xa')]=function(){return function(){return client[_0x8b32('0x4')](_0x8b32('0xb'),{'options':{'where':{'type':[_0x8b32('0xc')],'createdAt':{'$between':[moment()[_0x8b32('0xd')](_0x8b32('0xe'))['format'](_0x8b32('0xf')),moment()['endOf'](_0x8b32('0xe'))['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition',_0x8b32('0x10'),'billableseconds']},'log':_0x8b32('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 017c37a..e299e7f 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 _0x4f16=['CreateVoiceDialReport','../client','Request'];(function(_0x4dc3c4,_0x4e86db){var _0x23b848=function(_0x531598){while(--_0x531598){_0x4dc3c4['push'](_0x4dc3c4['shift']());}};_0x23b848(++_0x4e86db);}(_0x4f16,0x1c0));var _0x64f1=function(_0x2ae444,_0x5e9881){_0x2ae444=_0x2ae444-0x0;var _0x4d8790=_0x4f16[_0x2ae444];return _0x4d8790;};'use strict';var client=require(_0x64f1('0x0'));exports['create']=function(_0x16bf0c){return client[_0x64f1('0x1')](_0x64f1('0x2'),{'body':_0x16bf0c,'log':_0x64f1('0x2')});}; \ No newline at end of file +var _0xedcd=['CreateVoiceDialReport'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xedcd,0x11c));var _0xdedc=function(_0x21afb4,_0x4daa5e){_0x21afb4=_0x21afb4-0x0;var _0x236d4f=_0xedcd[_0x21afb4];return _0x236d4f;};'use strict';var client=require('../client');exports['create']=function(_0x5a46c8){return client['Request']('CreateVoiceDialReport',{'body':_0x5a46c8,'log':_0xdedc('0x0')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index ff00188..bc444bf 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 _0x1d5b=['../client','getVoiceExtensions','Request','exten'];(function(_0x20c983,_0x5ae1fb){var _0x1f7057=function(_0x529466){while(--_0x529466){_0x20c983['push'](_0x20c983['shift']());}};_0x1f7057(++_0x5ae1fb);}(_0x1d5b,0x13c));var _0xb1d5=function(_0x296fbc,_0x558a4a){_0x296fbc=_0x296fbc-0x0;var _0x17bfec=_0x1d5b[_0x296fbc];return _0x17bfec;};'use strict';var client=require(_0xb1d5('0x0'));exports[_0xb1d5('0x1')]=function(){return function(){return client[_0xb1d5('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xb1d5('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xb1d5('0x1')});};}; \ No newline at end of file +var _0x263f=['exten','recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x263f,0x182));var _0xf263=function(_0x111267,_0x22e668){_0x111267=_0x111267-0x0;var _0x39d613=_0x263f[_0x111267];return _0x39d613;};'use strict';var client=require(_0xf263('0x0'));exports[_0xf263('0x1')]=function(){return function(){return client[_0xf263('0x2')](_0xf263('0x3'),{'options':{'raw':!![],'attributes':['id',_0xf263('0x4'),_0xf263('0x5')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index fa52b6e..68df21c 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 _0x8c79=['dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','mandatoryDispositionPause','callerid','Interval','Intervals','../client','getVoiceQueues','GetVoiceQueue','name','acw','autopause','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry'];(function(_0x46df05,_0xdfcece){var _0x5576d6=function(_0x13a5cd){while(--_0x13a5cd){_0x46df05['push'](_0x46df05['shift']());}};_0x5576d6(++_0xdfcece);}(_0x8c79,0x120));var _0x98c7=function(_0x1381c6,_0x33d826){_0x1381c6=_0x1381c6-0x0;var _0x35a1c8=_0x8c79[_0x1381c6];return _0x35a1c8;};'use strict';var client=require(_0x98c7('0x0'));exports[_0x98c7('0x1')]=function(){return function(){return client['Request'](_0x98c7('0x2'),{'options':{'raw':![],'attributes':['id',_0x98c7('0x3'),_0x98c7('0x4'),'acwTimeout',_0x98c7('0x5'),_0x98c7('0x6'),_0x98c7('0x7'),_0x98c7('0x8'),_0x98c7('0x9'),'dialLimitChannel',_0x98c7('0xa'),'dialPowerLevel',_0x98c7('0xb'),_0x98c7('0xc'),_0x98c7('0xd'),_0x98c7('0xe'),_0x98c7('0xf'),_0x98c7('0x10'),'dialQueueOptions',_0x98c7('0x11'),_0x98c7('0x12'),_0x98c7('0x13'),_0x98c7('0x14'),_0x98c7('0x15'),_0x98c7('0x16'),_0x98c7('0x17'),_0x98c7('0x18'),'dialGlobalMaxRetry','dialTimezone',_0x98c7('0x19'),_0x98c7('0x1a'),_0x98c7('0x1b'),_0x98c7('0x1c'),_0x98c7('0x1d'),_0x98c7('0x1e'),_0x98c7('0x1f'),_0x98c7('0x20'),_0x98c7('0x21'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0x98c7('0x22'),_0x98c7('0x23'),'timeout',_0x98c7('0x24'),_0x98c7('0x25'),'dialOrderByScheduledAt',_0x98c7('0x26'),_0x98c7('0x27'),_0x98c7('0x28'),_0x98c7('0x6'),_0x98c7('0x29'),_0x98c7('0x2a'),_0x98c7('0x2b'),_0x98c7('0x2c'),_0x98c7('0x2d'),_0x98c7('0x2e'),_0x98c7('0x2f'),'dialAbandonedMaxRetry',_0x98c7('0x30'),_0x98c7('0x31'),_0x98c7('0x32'),_0x98c7('0x33'),_0x98c7('0x34'),_0x98c7('0x35'),'dialPredictiveIntervalMaxThreshold',_0x98c7('0x36')],'include':[{'model':_0x98c7('0x37'),'as':'Trunk','attributes':['id',_0x98c7('0x3'),'callerid',_0x98c7('0x38')]},{'model':_0x98c7('0x39'),'as':_0x98c7('0x3a'),'attributes':['id',_0x98c7('0x3')]},{'model':_0x98c7('0x37'),'as':'TrunkBackup','attributes':['id','name',_0x98c7('0x3b'),'active']},{'model':_0x98c7('0x3c'),'as':_0x98c7('0x3c'),'attributes':['id',_0x98c7('0x3')],'include':[{'model':_0x98c7('0x3c'),'as':_0x98c7('0x3d'),'attributes':['id',_0x98c7('0x3'),'interval']}]}]},'log':_0x98c7('0x1')});};}; \ No newline at end of file +var _0x3eeb=['dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','getVoiceQueues','Request','name','acw','autopause','monitor_format','type','dialActive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3eeb,0xbb));var _0xb3ee=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3eeb[_0x501510];return _0x1e6ee5;};'use strict';var client=require('../client');exports[_0xb3ee('0x0')]=function(){return function(){return client[_0xb3ee('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xb3ee('0x2'),_0xb3ee('0x3'),'acwTimeout',_0xb3ee('0x4'),_0xb3ee('0x5'),_0xb3ee('0x6'),_0xb3ee('0x7'),'dialMethod','dialLimitChannel',_0xb3ee('0x8'),_0xb3ee('0x9'),_0xb3ee('0xa'),'dialPredictiveOptimizationPercentage',_0xb3ee('0xb'),_0xb3ee('0xc'),_0xb3ee('0xd'),_0xb3ee('0xe'),_0xb3ee('0xf'),_0xb3ee('0x10'),'dialQueueProject','dialCongestionMaxRetry',_0xb3ee('0x11'),_0xb3ee('0x12'),'dialBusyRetryFrequency',_0xb3ee('0x13'),_0xb3ee('0x14'),'dialGlobalMaxRetry',_0xb3ee('0x15'),'dialGlobalInterval',_0xb3ee('0x16'),'dialCheckDuplicateType',_0xb3ee('0x17'),_0xb3ee('0x18'),_0xb3ee('0x19'),'dialAMDAfterGreetingSilence',_0xb3ee('0x1a'),_0xb3ee('0x1b'),'dialAMDBetweenWordsSilence',_0xb3ee('0x1c'),_0xb3ee('0x1d'),_0xb3ee('0x1e'),_0xb3ee('0x1f'),'dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent',_0xb3ee('0x20'),_0xb3ee('0x21'),_0xb3ee('0x5'),'strategy',_0xb3ee('0x22'),_0xb3ee('0x23'),_0xb3ee('0x24'),_0xb3ee('0x25'),'dialDropMaxRetry',_0xb3ee('0x26'),_0xb3ee('0x27'),_0xb3ee('0x28'),_0xb3ee('0x29'),_0xb3ee('0x2a'),_0xb3ee('0x2b'),_0xb3ee('0x2c'),_0xb3ee('0x2d'),_0xb3ee('0x2e'),_0xb3ee('0x2f')],'include':[{'model':_0xb3ee('0x30'),'as':_0xb3ee('0x30'),'attributes':['id','name',_0xb3ee('0x31'),_0xb3ee('0x32')]},{'model':_0xb3ee('0x33'),'as':_0xb3ee('0x34'),'attributes':['id',_0xb3ee('0x2')]},{'model':_0xb3ee('0x30'),'as':_0xb3ee('0x35'),'attributes':['id',_0xb3ee('0x2'),_0xb3ee('0x31'),_0xb3ee('0x32')]},{'model':_0xb3ee('0x36'),'as':'Interval','attributes':['id','name'],'include':[{'model':_0xb3ee('0x36'),'as':'Intervals','attributes':['id',_0xb3ee('0x2'),_0xb3ee('0x37')]}]}]},'log':_0xb3ee('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 54e9aed..61e79c7 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(_0x13e36c,_0x382900){var _0x1f4430=function(_0x36b9d8){while(--_0x36b9d8){_0x13e36c['push'](_0x13e36c['shift']());}};_0x1f4430(++_0x382900);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x46cb0b,_0x3ea80e){var _0x212467=function(_0x18bcfe){while(--_0x18bcfe){_0x46cb0b['push'](_0x46cb0b['shift']());}};_0x212467(++_0x3ea80e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 a611d86..d500b38 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 _0x3399=['getVoiceQueueRtPauses','Request'];(function(_0x5edeb1,_0x263873){var _0x3707f4=function(_0x19f45e){while(--_0x19f45e){_0x5edeb1['push'](_0x5edeb1['shift']());}};_0x3707f4(++_0x263873);}(_0x3399,0xc8));var _0x9339=function(_0x2df2f3,_0x4043ab){_0x2df2f3=_0x2df2f3-0x0;var _0xfb1307=_0x3399[_0x2df2f3];return _0xfb1307;};'use strict';var client=require('../client');exports[_0x9339('0x0')]=function(_0x4d2149){return function(){return client[_0x9339('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x4d2149,'paused':!![]},'raw':!![]},'log':_0x9339('0x0')});};}; \ No newline at end of file +var _0x29b4=['../client','getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x33aae2,_0x58c8f0){var _0x3a65d7=function(_0x30cfa3){while(--_0x30cfa3){_0x33aae2['push'](_0x33aae2['shift']());}};_0x3a65d7(++_0x58c8f0);}(_0x29b4,0x153));var _0x429b=function(_0x4e0991,_0x47b35d){_0x4e0991=_0x4e0991-0x0;var _0x505544=_0x29b4[_0x4e0991];return _0x505544;};'use strict';var client=require(_0x429b('0x0'));exports[_0x429b('0x1')]=function(_0x59ec4f){return function(){return client['Request'](_0x429b('0x2'),{'options':{'where':{'VoiceQueueId':_0x59ec4f,'paused':!![]},'raw':!![]},'log':_0x429b('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index f60ed7f..8fcb78f 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(_0x2502d7,_0xe7b4e7){var _0x355f1e=function(_0x2bb0b1){while(--_0x2bb0b1){_0x2502d7['push'](_0x2502d7['shift']());}};_0x355f1e(++_0xe7b4e7);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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(_0x3970e9,_0x73f319){var _0x2239fe=function(_0x36c844){while(--_0x36c844){_0x3970e9['push'](_0x3970e9['shift']());}};_0x2239fe(++_0x73f319);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 7183327..7807586 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 _0xa6ea=['origtransferercontext','origtransfererexten','attended','blindTransfer','Request','result','transfererchannel','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','isexternal'];(function(_0x3f0553,_0x1ee7d8){var _0x185007=function(_0x47adc1){while(--_0x47adc1){_0x3f0553['push'](_0x3f0553['shift']());}};_0x185007(++_0x1ee7d8);}(_0xa6ea,0x123));var _0xaa6e=function(_0x2bb7c1,_0x420e06){_0x2bb7c1=_0x2bb7c1-0x0;var _0x4414fc=_0xa6ea[_0x2bb7c1];return _0x4414fc;};'use strict';var client=require('../client');exports['transfers']={};exports[_0xaa6e('0x0')]=function(_0x56264c){return client[_0xaa6e('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0x56264c[_0xaa6e('0x2')],'transfererchannel':_0x56264c[_0xaa6e('0x3')],'transferercalleridnum':_0x56264c['transferercalleridnum'],'transferercalleridname':_0x56264c['transferercalleridname'],'transfererconnectedlinenum':_0x56264c[_0xaa6e('0x4')],'transfererconnectedlinename':_0x56264c[_0xaa6e('0x5')],'transfereraccountcode':_0x56264c['transfereraccountcode'],'transferercontext':_0x56264c[_0xaa6e('0x6')],'transfererexten':_0x56264c['transfererexten'],'transfererlinkedid':_0x56264c['transfererlinkedid'],'transfereechannel':_0x56264c[_0xaa6e('0x7')],'transfereecalleridnum':_0x56264c[_0xaa6e('0x8')],'transfereecalleridname':_0x56264c[_0xaa6e('0x9')],'transfereeconnectedlinenum':_0x56264c[_0xaa6e('0xa')],'transfereeconnectedlinename':_0x56264c[_0xaa6e('0xb')],'transfereeaccountcode':_0x56264c[_0xaa6e('0xc')],'transfereecontext':_0x56264c[_0xaa6e('0xd')],'transfereeexten':_0x56264c['transfereeexten'],'transfereelinkedid':_0x56264c[_0xaa6e('0xe')],'isexternal':_0x56264c['isexternal'],'context':_0x56264c[_0xaa6e('0xf')],'extension':_0x56264c[_0xaa6e('0x10')],'type':_0xaa6e('0x11')},'log':_0xaa6e('0x12')});};exports[_0xaa6e('0x13')]=function(_0x39ba54){return client[_0xaa6e('0x1')](_0xaa6e('0x12'),{'body':{'result':_0x39ba54['result'],'transfererchannel':_0x39ba54['origtransfererchannel'],'transferercalleridnum':_0x39ba54[_0xaa6e('0x14')],'transferercalleridname':_0x39ba54[_0xaa6e('0x15')],'transfererconnectedlinenum':_0x39ba54[_0xaa6e('0x16')],'transfererconnectedlinename':_0x39ba54['secondtransfererconnectedlinename'],'transfereraccountcode':_0x39ba54[_0xaa6e('0x17')],'transferercontext':_0x39ba54[_0xaa6e('0x18')],'transfererexten':_0x39ba54[_0xaa6e('0x19')],'transfererlinkedid':_0x39ba54['origtransfererlinkedid'],'transfereechannel':_0x39ba54[_0xaa6e('0x1a')],'transfereecalleridnum':_0x39ba54[_0xaa6e('0x1b')],'transfereecalleridname':_0x39ba54[_0xaa6e('0x1c')],'transfereeconnectedlinenum':_0x39ba54[_0xaa6e('0x1d')],'transfereeconnectedlinename':_0x39ba54['transfertargetconnectedlinename'],'transfereeaccountcode':_0x39ba54[_0xaa6e('0x1e')],'transfereecontext':_0x39ba54[_0xaa6e('0x1f')],'transfereeexten':_0x39ba54['transfertargetexten'],'transfereelinkedid':_0x39ba54['transfertargetlinkedid'],'isexternal':_0x39ba54[_0xaa6e('0x20')],'context':_0x39ba54[_0xaa6e('0x21')],'extension':_0x39ba54[_0xaa6e('0x22')],'type':_0xaa6e('0x23')},'log':_0xaa6e('0x12')});}; \ No newline at end of file +var _0x807e=['transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transfererexten','transfererlinkedid','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','extension','attendedTransfer','result','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','CreateVoiceTransferReport'];(function(_0x2d02c4,_0x44e908){var _0x1eac81=function(_0x7eb31d){while(--_0x7eb31d){_0x2d02c4['push'](_0x2d02c4['shift']());}};_0x1eac81(++_0x44e908);}(_0x807e,0x10f));var _0xe807=function(_0x29080a,_0x3ec29f){_0x29080a=_0x29080a-0x0;var _0x5e5585=_0x807e[_0x29080a];return _0x5e5585;};'use strict';var client=require('../client');exports['transfers']={};exports['blindTransfer']=function(_0x2bb589){return client['Request'](_0xe807('0x0'),{'body':{'result':_0x2bb589['result'],'transfererchannel':_0x2bb589[_0xe807('0x1')],'transferercalleridnum':_0x2bb589[_0xe807('0x2')],'transferercalleridname':_0x2bb589['transferercalleridname'],'transfererconnectedlinenum':_0x2bb589[_0xe807('0x3')],'transfererconnectedlinename':_0x2bb589[_0xe807('0x4')],'transfereraccountcode':_0x2bb589['transfereraccountcode'],'transferercontext':_0x2bb589['transferercontext'],'transfererexten':_0x2bb589[_0xe807('0x5')],'transfererlinkedid':_0x2bb589[_0xe807('0x6')],'transfereechannel':_0x2bb589['transfereechannel'],'transfereecalleridnum':_0x2bb589[_0xe807('0x7')],'transfereecalleridname':_0x2bb589['transfereecalleridname'],'transfereeconnectedlinenum':_0x2bb589[_0xe807('0x8')],'transfereeconnectedlinename':_0x2bb589[_0xe807('0x9')],'transfereeaccountcode':_0x2bb589[_0xe807('0xa')],'transfereecontext':_0x2bb589[_0xe807('0xb')],'transfereeexten':_0x2bb589['transfereeexten'],'transfereelinkedid':_0x2bb589[_0xe807('0xc')],'isexternal':_0x2bb589[_0xe807('0xd')],'context':_0x2bb589[_0xe807('0xe')],'extension':_0x2bb589[_0xe807('0xf')],'type':'blind'},'log':_0xe807('0x0')});};exports[_0xe807('0x10')]=function(_0x41ce47){return client['Request'](_0xe807('0x0'),{'body':{'result':_0x41ce47[_0xe807('0x11')],'transfererchannel':_0x41ce47['origtransfererchannel'],'transferercalleridnum':_0x41ce47[_0xe807('0x12')],'transferercalleridname':_0x41ce47[_0xe807('0x13')],'transfererconnectedlinenum':_0x41ce47[_0xe807('0x14')],'transfererconnectedlinename':_0x41ce47[_0xe807('0x15')],'transfereraccountcode':_0x41ce47['origtransfereraccountcode'],'transferercontext':_0x41ce47['secondtransferercontext'],'transfererexten':_0x41ce47[_0xe807('0x16')],'transfererlinkedid':_0x41ce47[_0xe807('0x17')],'transfereechannel':_0x41ce47['transfertargetchannel'],'transfereecalleridnum':_0x41ce47[_0xe807('0x18')],'transfereecalleridname':_0x41ce47[_0xe807('0x19')],'transfereeconnectedlinenum':_0x41ce47[_0xe807('0x1a')],'transfereeconnectedlinename':_0x41ce47[_0xe807('0x1b')],'transfereeaccountcode':_0x41ce47[_0xe807('0x1c')],'transfereecontext':_0x41ce47[_0xe807('0x1d')],'transfereeexten':_0x41ce47[_0xe807('0x1e')],'transfereelinkedid':_0x41ce47[_0xe807('0x1f')],'isexternal':_0x41ce47[_0xe807('0xd')],'context':_0x41ce47[_0xe807('0x20')],'extension':_0x41ce47[_0xe807('0x21')],'type':'attended'},'log':_0xe807('0x0')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index f4be0a1..3a0e8f8 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 _0x6ec2=['error','asterisk','username','ami\x20disconnected','join','module','action','Reload','Action','message','pick','command','Command','content','catch','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','channel','%s.%s','filename','uniqueid','wav','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','map','resolve','then','StopMixMonitor','destinationchannel','status','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','emit','custom:','event','faxAccounts','server','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','moment','../properties','../ami','listen','format','SIP','name','timers','timer','updateAcw','agents','QueuePause','isConnected'];(function(_0x3760d9,_0x4e4e2e){var _0x28f707=function(_0x45ce70){while(--_0x45ce70){_0x3760d9['push'](_0x3760d9['shift']());}};_0x28f707(++_0x4e4e2e);}(_0x6ec2,0x78));var _0x26ec=function(_0x2a027a,_0x51341a){_0x2a027a=_0x2a027a-0x0;var _0x3ee06e=_0x6ec2[_0x2a027a];return _0x3ee06e;};'use strict';var _=require(_0x26ec('0x0'));var util=require(_0x26ec('0x1'));var jayson=require(_0x26ec('0x2'));var schema=require(_0x26ec('0x3'));var BPromise=require(_0x26ec('0x4'));var moment=require(_0x26ec('0x5'));var config=require('../../../config/environment');var properties=require(_0x26ec('0x6'));var ami=require(_0x26ec('0x7'));exports[_0x26ec('0x8')]=function(_0x13f29c,_0x375e01,_0x4ce209){return new BPromise(function(_0x3b5955,_0x4e8781){var _0x4cadb0={'QueuePause':function(_0xf2cd1d){return new Promise(function(_0x2802e7,_0x14c6ae){var _0x4a70c4=util[_0x26ec('0x9')]('%s/%s',_0x26ec('0xa'),_0xf2cd1d[_0x26ec('0xb')]);if(_0x13f29c[_0x26ec('0xc')]&&_0x13f29c[_0x26ec('0xc')][_0x4a70c4]&&_0x13f29c[_0x26ec('0xc')][_0x4a70c4][_0x26ec('0xd')]){_0x13f29c[_0x26ec('0xc')][_0x4a70c4][_0x26ec('0xe')]();}if(_0x13f29c[_0x26ec('0xf')][_0x4a70c4]){_0x13f29c[_0x26ec('0xf')][_0x4a70c4]['updateStatusRealtime']({'statePause':_0xf2cd1d['pause']?!![]:![]});}_0x2802e7({'code':0xc8,'message':_0x26ec('0x10')});});},'Reload':function(_0x1bec27){var _0x1149fb=this;return new Promise(function(_0x25ba7c,_0x4142fe){if(ami[_0x26ec('0x11')]()==![]){return _0x4142fe(_0x1149fb[_0x26ec('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x26ec('0x13')][_0x26ec('0x14')],_0x26ec('0x15')][_0x26ec('0x16')]('\x20')));}_0x1bec27=_['pick'](_0x1bec27,_['keys'](properties[_0x26ec('0x17')]));_0x1bec27[_0x26ec('0x18')]=_0x26ec('0x19');return ami[_0x26ec('0x1a')](_0x1bec27)['then'](function(_0x17282d){_0x25ba7c({'code':0xc8,'message':_0x17282d[_0x26ec('0x1b')]});})['catch'](function(_0x5ef1e5){_0x4142fe(_0x1149fb['error'](0x1f5,_0x5ef1e5[_0x26ec('0x1b')]));});});},'Command':function(_0x38516d){var _0x60511e=this;return new Promise(function(_0x4f6eb5,_0x4ad50c){if(ami[_0x26ec('0x11')]()==![]){return _0x4ad50c(_0x60511e[_0x26ec('0x12')](0x1f4,[config[_0x26ec('0x13')]['ip'],config[_0x26ec('0x13')][_0x26ec('0x14')],_0x26ec('0x15')]['join']('\x20')));}_0x38516d=_[_0x26ec('0x1c')](_0x38516d,_0x26ec('0x1d'));_0x38516d[_0x26ec('0x18')]=_0x26ec('0x1e');return ami[_0x26ec('0x1a')](_0x38516d)['then'](function(_0x5202e6){_0x4f6eb5({'code':0xc8,'message':_0x5202e6[_0x26ec('0x1f')]});})[_0x26ec('0x20')](function(_0x65aea3){_0x4ad50c(_0x60511e['error'](0x1f5,_0x65aea3['message']));});});},'VoiceQueues':function(_0x19cadf){return new Promise(function(_0xaf6c39,_0x16aba4){var _0x365fac=[];for(var _0x4030ea in _0x13f29c[_0x26ec('0x21')]){if(_0x13f29c[_0x26ec('0x21')]['hasOwnProperty'](_0x4030ea)){var _0x50fedc=_0x13f29c['voiceQueues'][_0x4030ea];var _0x45509f={'id':_0x50fedc['id'],'name':_0x50fedc[_0x26ec('0xb')],'strategy':_0x50fedc[_0x26ec('0x22')],'answered':_0x50fedc[_0x26ec('0x23')],'available':_0x50fedc[_0x26ec('0x24')],'loggedIn':_0x50fedc[_0x26ec('0x25')],'pTalking':_0x50fedc[_0x26ec('0x26')],'sumBillable':_0x50fedc['sumBillable'],'sumDuration':_0x50fedc[_0x26ec('0x27')],'sumHoldTime':_0x50fedc['sumHoldTime']||0x0,'talking':_0x50fedc[_0x26ec('0x28')],'total':_0x50fedc[_0x26ec('0x29')],'type':_0x50fedc['type'],'unmanaged':_0x50fedc[_0x26ec('0x2a')],'abandoned':_0x50fedc[_0x26ec('0x2b')],'waiting':_0x50fedc[_0x26ec('0x2c')],'loggedInDb':_0x50fedc[_0x26ec('0x2d')]};if(_0x50fedc[_0x26ec('0x2e')]===_0x26ec('0x2f')){_0x45509f['dialActive']=_0x50fedc[_0x26ec('0x30')];_0x45509f['dialMethod']=_0x50fedc[_0x26ec('0x31')];_0x45509f['dialOriginateCallerIdName']=_0x50fedc[_0x26ec('0x32')];_0x45509f[_0x26ec('0x33')]=_0x50fedc['dialOriginateCallerIdNumber'];_0x45509f[_0x26ec('0x34')]=_0x50fedc[_0x26ec('0x34')];_0x45509f[_0x26ec('0x35')]=_0x50fedc[_0x26ec('0x35')];_0x45509f[_0x26ec('0x36')]=_0x50fedc[_0x26ec('0x36')];_0x45509f['outboundAnswerAgiCallsDay']=_0x50fedc['outboundAnswerAgiCallsDay'];_0x45509f['outboundAnswerCallsDay']=_0x50fedc['outboundAnswerCallsDay'];_0x45509f['outboundBlacklistCallsDay']=_0x50fedc[_0x26ec('0x37')];_0x45509f[_0x26ec('0x38')]=_0x50fedc[_0x26ec('0x38')];_0x45509f[_0x26ec('0x39')]=_0x50fedc[_0x26ec('0x39')];_0x45509f['outboundDropCallsDayACS']=_0x50fedc[_0x26ec('0x3a')];_0x45509f[_0x26ec('0x3b')]=_0x50fedc[_0x26ec('0x3b')];_0x45509f[_0x26ec('0x3c')]=_0x50fedc[_0x26ec('0x3c')];_0x45509f['outboundNoAnswerCallsDay']=_0x50fedc[_0x26ec('0x3d')];_0x45509f[_0x26ec('0x3e')]=_0x50fedc[_0x26ec('0x3e')];_0x45509f[_0x26ec('0x3f')]=_0x50fedc[_0x26ec('0x3f')];_0x45509f[_0x26ec('0x40')]=_0x50fedc[_0x26ec('0x40')];_0x45509f[_0x26ec('0x41')]=_0x50fedc[_0x26ec('0x41')];_0x45509f[_0x26ec('0x42')]=_0x50fedc['outboundUnknownCallsDay'];_0x45509f['predictiveIntervalAnsweredCalls']=_0x50fedc[_0x26ec('0x43')];_0x45509f[_0x26ec('0x44')]=_0x50fedc['predictiveIntervalAvgHoldtime'];_0x45509f[_0x26ec('0x45')]=_0x50fedc['predictiveIntervalAvgTalktime'];_0x45509f[_0x26ec('0x46')]=_0x50fedc[_0x26ec('0x46')];_0x45509f[_0x26ec('0x47')]=_0x50fedc[_0x26ec('0x47')];_0x45509f[_0x26ec('0x48')]=_0x50fedc[_0x26ec('0x48')];_0x45509f['predictiveIntervalErlangCallsDroppedCalls']=_0x50fedc[_0x26ec('0x49')];_0x45509f[_0x26ec('0x4a')]=_0x50fedc[_0x26ec('0x4a')];_0x45509f[_0x26ec('0x4b')]=_0x50fedc[_0x26ec('0x4b')];_0x45509f[_0x26ec('0x4c')]=_0x50fedc[_0x26ec('0x4c')];_0x45509f[_0x26ec('0x4d')]=_0x50fedc[_0x26ec('0x4d')];_0x45509f[_0x26ec('0x4e')]=_0x50fedc[_0x26ec('0x4e')];_0x45509f[_0x26ec('0x1b')]=_0x50fedc[_0x26ec('0x1b')];_0x45509f[_0x26ec('0x4f')]=_0x50fedc[_0x26ec('0x4f')];_0x45509f['erlangCalls']=_0x50fedc[_0x26ec('0x50')];_0x45509f[_0x26ec('0x51')]=_0x50fedc[_0x26ec('0x51')];_0x45509f[_0x26ec('0x52')]=_0x50fedc[_0x26ec('0x52')];_0x45509f[_0x26ec('0x53')]=_0x50fedc['erlangBusyFactor'];_0x45509f['startPredictive']=_0x50fedc[_0x26ec('0x54')];_0x45509f['startProgressive']=_0x50fedc[_0x26ec('0x55')];}if(_0x50fedc[_0x26ec('0x56')]){_0x45509f[_0x26ec('0x56')]={'id':_0x50fedc[_0x26ec('0x56')]['id'],'name':_0x50fedc[_0x26ec('0x56')][_0x26ec('0xb')],'active':_0x50fedc[_0x26ec('0x56')][_0x26ec('0x57')],'callerid':_0x50fedc['Trunk'][_0x26ec('0x58')]};}if(_0x50fedc[_0x26ec('0x59')]){_0x45509f[_0x26ec('0x59')]={'id':_0x50fedc['Interval']['id'],'name':_0x50fedc[_0x26ec('0x59')][_0x26ec('0xb')]};}_0x365fac[_0x26ec('0x5a')](_0x45509f);}}_0xaf6c39({'count':_0x365fac[_0x26ec('0x5b')],'rows':_0x365fac});});},'UpdateVoiceQueue':function(_0xe89d5f){return new Promise(function(_0x1d698b,_0x42724f){var _0xbfc5a2=_[_0x26ec('0x5c')](_0x13f29c[_0x26ec('0x21')],{'id':parseInt(_0xe89d5f['id'])});var _0x211947=_[_0x26ec('0x5d')](_0xe89d5f,['id']);if(_0xbfc5a2){for(var _0x2950bd in _0x211947){if(typeof _0x211947[_0x2950bd]!==_0x26ec('0x5e')&&typeof _0xbfc5a2[_0x2950bd]!=='undefined'){_0xbfc5a2[_0x2950bd]=_0x211947[_0x2950bd];}}_0x1d698b(_0xbfc5a2);}else{_0x42724f();}});},'VoiceChannels':function(_0x59cda3){return new Promise(function(_0x121e2f,_0x5be55c){var _0x4f873e=_[_0x26ec('0x5f')](_0x13f29c[_0x26ec('0x60')]);_0x121e2f({'count':_0x4f873e[_0x26ec('0x5b')],'rows':_0x4f873e});});},'VoiceChannelMixMonitor':function(_0x551045){var _0x4a5ce1=this;return new Promise(function(_0x5edd85,_0x534a11){if(ami[_0x26ec('0x11')]()==![]){return _0x534a11(_0x4a5ce1['error'](0x1f4,[config[_0x26ec('0x13')]['ip'],config[_0x26ec('0x13')]['username'],'ami\x20disconnected'][_0x26ec('0x16')]('\x20')));}var _0x2d5866=schema(properties['voicechannel'])[_0x26ec('0x3')](_0x551045);if(_0x2d5866[_0x26ec('0x5b')]>0x0){return _0x534a11(_0x4a5ce1['error'](0x1f4,_['map'](_0x2d5866,_0x26ec('0x1b'))[_0x26ec('0x16')](',\x20')));}var _0x10a4f3=_['find'](_0x13f29c[_0x26ec('0x60')],{'uniqueid':_0x551045['uniqueid']});if(_0x10a4f3&&_0x10a4f3[_0x26ec('0x61')]){var _0x179f9f=util[_0x26ec('0x9')](_0x26ec('0x62'),_0x551045[_0x26ec('0x63')]||_0x551045[_0x26ec('0x64')],_0x551045['format']||_0x26ec('0x65'));return ami[_0x26ec('0x1a')]({'action':'MixMonitor','channel':_0x10a4f3[_0x26ec('0x61')],'file':_0x179f9f,'options':_0x26ec('0x66')})['then'](function(_0x316416){var _0x47b2e9=_['find'](_0x10a4f3[_0x26ec('0x67')],{'filename':_0x26ec('0x68')+_0x179f9f[_0x26ec('0x69')]()});if(_['isNil'](_0x47b2e9)){_0x10a4f3['monitors'][_0x26ec('0x5a')]({'filename':_0x26ec('0x68')+_0x179f9f[_0x26ec('0x69')](),'createdAt':moment()['format'](_0x26ec('0x6a')),'mixmonitorid':_0x316416[_0x26ec('0x6b')],'status':'rec'});}else{_0x47b2e9['mixmonitorid']=_0x316416[_0x26ec('0x6b')];_0x47b2e9['status']=_0x26ec('0x6c');}_0x5edd85({'code':0xc8,'message':[_0x551045[_0x26ec('0x64')],_0x26ec('0x6d'),_0x316416[_0x26ec('0x6b')]]['join']('\x20'),'mixmonitorid':_0x316416['mixmonitorid']});})[_0x26ec('0x20')](function(_0xad1ee7){_0x534a11(_0x4a5ce1[_0x26ec('0x12')](0x1f5,[_0x551045[_0x26ec('0x64')],_0xad1ee7[_0x26ec('0x1b')][_0x26ec('0x69')]()][_0x26ec('0x16')]('\x20')));});}else{return _0x534a11(_0x4a5ce1['error'](0x1f5,_0x26ec('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0x4a67e4){var _0x41d0fa=this;return new Promise(function(_0x2e77a9,_0x2e0c77){if(ami[_0x26ec('0x11')]()==![]){return _0x2e0c77(_0x41d0fa[_0x26ec('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x26ec('0x13')][_0x26ec('0x14')],_0x26ec('0x15')][_0x26ec('0x16')]('\x20')));}var _0x53ffa5=schema(properties[_0x26ec('0x6f')])[_0x26ec('0x3')](_0x4a67e4);if(_0x53ffa5['length']>0x0){return _0x2e0c77(_0x41d0fa[_0x26ec('0x12')](0x1f4,_[_0x26ec('0x70')](_0x53ffa5,_0x26ec('0x1b'))[_0x26ec('0x16')](',\x20')));}var _0x2a9c55=_[_0x26ec('0x5c')](_0x13f29c[_0x26ec('0x60')],{'uniqueid':_0x4a67e4['uniqueid']});if(_0x2a9c55){return BPromise[_0x26ec('0x71')]()[_0x26ec('0x72')](function(){if(_0x2a9c55['channel']){return ami[_0x26ec('0x1a')]({'action':_0x26ec('0x73'),'channel':_0x2a9c55[_0x26ec('0x61')],'mixmonitorid':_0x4a67e4[_0x26ec('0x6b')]})[_0x26ec('0x20')](function(_0x3ba1c8){});}})[_0x26ec('0x72')](function(){if(_0x2a9c55[_0x26ec('0x74')]){return ami[_0x26ec('0x1a')]({'action':_0x26ec('0x73'),'channel':_0x2a9c55[_0x26ec('0x74')],'mixmonitorid':_0x4a67e4[_0x26ec('0x6b')]})[_0x26ec('0x20')](function(_0x35bac1){});}})[_0x26ec('0x72')](function(_0x4a8769){var _0x504aa6=_['find'](_0x2a9c55['monitors'],{'mixmonitorid':_0x4a67e4[_0x26ec('0x6b')]});if(_0x504aa6){_0x504aa6[_0x26ec('0x75')]=_0x26ec('0x76');}})['then'](function(){var _0x1ae4a5=util['format'](_0x26ec('0x62'),_0x4a67e4[_0x26ec('0x63')]||_0x4a67e4[_0x26ec('0x64')],_0x4a67e4['format']||_0x26ec('0x65'));var _0x2579c2=_[_0x26ec('0x5c')](_0x2a9c55[_0x26ec('0x67')],{'filename':_0x26ec('0x68')+_0x1ae4a5['toLowerCase']()});if(_0x2579c2){_0x2579c2[_0x26ec('0x75')]=_0x26ec('0x76');}})['then'](function(){_0x2e77a9({'code':0xc8,'message':[_0x4a67e4[_0x26ec('0x64')],_0x26ec('0x77')][_0x26ec('0x16')]('\x20')});})['catch'](function(_0x29aac1){_0x2e0c77(_0x41d0fa[_0x26ec('0x12')](0x1f5,[_0x4a67e4[_0x26ec('0x64')],_0x29aac1[_0x26ec('0x1b')][_0x26ec('0x69')]()][_0x26ec('0x16')]('\x20')));});}else{return _0x2e0c77(_0x41d0fa[_0x26ec('0x12')](0x1f5,_0x26ec('0x6e')));}});},'VoiceQueuesChannels':function(_0x1bb8ea){return new Promise(function(_0x2e283e,_0x1ab092){var _0x6ab7d4=_[_0x26ec('0x5f')](_0x13f29c[_0x26ec('0x78')]);_0x2e283e({'count':_0x6ab7d4[_0x26ec('0x5b')],'rows':_0x6ab7d4});});},'VoiceQueuesChannel':function(_0x463cba){var _0x5d4514=this;return new Promise(function(_0x483cec,_0x1abe14){var _0x3596d3=schema(properties[_0x26ec('0x79')])[_0x26ec('0x3')](_0x463cba);if(_0x3596d3[_0x26ec('0x5b')]>0x0){return _0x1abe14(_0x5d4514[_0x26ec('0x12')](0x1f4,_['map'](_0x3596d3,_0x26ec('0x1b'))[_0x26ec('0x16')](',\x20')));}var _0x474cf3=_[_0x26ec('0x5c')](_0x13f29c[_0x26ec('0x78')],{'uniqueid':_0x463cba[_0x26ec('0x64')]});if(_0x474cf3){_0x483cec(_0x474cf3);}else{return _0x1abe14(_0x5d4514[_0x26ec('0x12')](0x1f5,_0x26ec('0x6e')));}});},'VoiceQueuesChannelHangup':function(_0x8f92bf){var _0x19245c=this;return new Promise(function(_0x3e777c,_0x5db03e){if(ami[_0x26ec('0x11')]()==![]){return _0x5db03e(_0x19245c[_0x26ec('0x12')](0x1f4,[config[_0x26ec('0x13')]['ip'],config['asterisk'][_0x26ec('0x14')],_0x26ec('0x15')]['join']('\x20')));}var _0x1c2155=schema(properties['voicequeuechannelhangup'])[_0x26ec('0x3')](_0x8f92bf);if(_0x1c2155[_0x26ec('0x5b')]>0x0){return _0x5db03e(_0x19245c[_0x26ec('0x12')](0x1f4,_[_0x26ec('0x70')](_0x1c2155,_0x26ec('0x1b'))[_0x26ec('0x16')](',\x20')));}var _0x504b25=_[_0x26ec('0x5c')](_0x13f29c[_0x26ec('0x78')],{'uniqueid':_0x8f92bf['uniqueid']});if(_0x504b25&&_0x504b25[_0x26ec('0x61')]){return ami[_0x26ec('0x1a')]({'action':'Hangup','channel':_0x504b25[_0x26ec('0x61')]})['then'](function(_0x461820){_0x3e777c({'code':0xc8,'message':[_0x8f92bf[_0x26ec('0x64')],_0x461820['message'][_0x26ec('0x69')]()][_0x26ec('0x16')]('\x20')});})['catch'](function(_0x12fd59){_0x5db03e(_0x19245c[_0x26ec('0x12')](0x1f5,[_0x8f92bf[_0x26ec('0x64')],_0x12fd59[_0x26ec('0x1b')][_0x26ec('0x69')]()][_0x26ec('0x16')]('\x20')));});}else{return _0x5db03e(_0x19245c[_0x26ec('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x423015){var _0x367f19=this;return new Promise(function(_0x5781bb,_0x511bc7){if(ami['isConnected']()==![]){return _0x511bc7(_0x367f19[_0x26ec('0x12')](0x1f4,[config[_0x26ec('0x13')]['ip'],config[_0x26ec('0x13')]['username'],_0x26ec('0x15')][_0x26ec('0x16')]('\x20')));}var _0x32a7f1=schema(properties[_0x26ec('0x7a')])[_0x26ec('0x3')](_0x423015);if(_0x32a7f1[_0x26ec('0x5b')]>0x0){return _0x511bc7(_0x367f19[_0x26ec('0x12')](0x1f4,_['map'](_0x32a7f1,_0x26ec('0x1b'))[_0x26ec('0x16')](',\x20')));}var _0x1385e4=_[_0x26ec('0x5c')](_0x13f29c[_0x26ec('0x78')],{'uniqueid':_0x423015[_0x26ec('0x64')]});if(_0x1385e4&&_0x1385e4[_0x26ec('0x61')]){return ami[_0x26ec('0x1a')]({'action':_0x26ec('0x7b'),'channel':_0x1385e4[_0x26ec('0x61')],'exten':_0x423015[_0x26ec('0x7c')],'context':_0x423015[_0x26ec('0x7d')]||_0x1385e4[_0x26ec('0x7d')],'priority':0x1})[_0x26ec('0x72')](function(_0x3ed214){_0x5781bb({'code':0xc8,'message':[_0x423015[_0x26ec('0x64')],_0x3ed214[_0x26ec('0x1b')][_0x26ec('0x69')]()][_0x26ec('0x16')]('\x20')});})[_0x26ec('0x20')](function(_0x3d197f){_0x511bc7(_0x367f19[_0x26ec('0x12')](0x1f5,[_0x423015[_0x26ec('0x64')],_0x3d197f[_0x26ec('0x1b')][_0x26ec('0x69')]()][_0x26ec('0x16')]('\x20')));});}else{return _0x511bc7(_0x367f19['error'](0x1f5,_0x26ec('0x6e')));}});},'Agents':function(_0x6bb743){return new Promise(function(_0x42ae13,_0x2fd410){var _0xe558f4=_[_0x26ec('0x5f')](_0x13f29c[_0x26ec('0xf')]);_0x42ae13({'count':_0xe558f4[_0x26ec('0x5b')],'rows':_0xe558f4});});},'Telephones':function(_0x3c1f1c){return new Promise(function(_0x54d0f3,_0x2309b3){var _0x3ce8eb=_[_0x26ec('0x5f')](_0x13f29c[_0x26ec('0x7e')]);_0x54d0f3({'count':_0x3ce8eb[_0x26ec('0x5b')],'rows':_0x3ce8eb});});},'Trunks':function(_0x9eaa77){return new Promise(function(_0x13ca0b,_0x44f706){var _0x55b0fb=_[_0x26ec('0x5f')](_0x13f29c[_0x26ec('0x7f')]);_0x13ca0b({'count':_0x55b0fb['length'],'rows':_0x55b0fb});});},'OutboundChannels':function(_0x2b14c8){return new Promise(function(_0xa3ca2,_0x5d3e6b){var _0x57c1ea=_[_0x26ec('0x5f')](_0x13f29c[_0x26ec('0x80')]);_0xa3ca2({'count':_0x57c1ea[_0x26ec('0x5b')],'rows':_0x57c1ea});});},'Outbound':function(_0x45c2d9){return new Promise(function(_0x1ee360,_0x63d051){_0x1ee360(_0x13f29c[_0x26ec('0x2f')]);});},'Campaigns':function(_0x100554){return new Promise(function(_0xbac8ed,_0x33b422){var _0x5c604c=_[_0x26ec('0x5f')](_0x13f29c['campaigns']);_0xbac8ed({'count':_0x5c604c[_0x26ec('0x5b')],'rows':_0x5c604c});});},'VoiceQueuesPreview':function(_0x4dd8f6){var _0x5945a9=this;return new Promise(function(_0x5637f6,_0x49e271){_0x375e01[_0x26ec('0x81')](_0x4dd8f6['id'])[_0x26ec('0x72')](function(_0xb6c857){_0x5637f6({'code':0xc8,'message':_0xb6c857[_0x26ec('0x1b')]});})[_0x26ec('0x20')](function(_0x4a394e){_0x49e271(_0x5945a9['error'](0x1f4,_0x4a394e['message']));});});},'EventManager':function(_0xab5773){var _0x39a003=this;return new Promise(function(_0x20b9ae,_0x3b832a){if(!_0xab5773['event']){return _0x3b832a(_0x39a003[_0x26ec('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x26ec('0x82')](_0x26ec('0x83')+_0xab5773[_0x26ec('0x84')],_0xab5773[_0x26ec('0x1b')]);_0x20b9ae({'code':0xc8,'message':_0xab5773});});},'FaxAccounts':function(_0x88de21){return new Promise(function(_0x5e5870,_0x408d88){var _0x5aadb0=_[_0x26ec('0x5f')](_0x13f29c[_0x26ec('0x85')]);_0x5e5870({'count':_0x5aadb0[_0x26ec('0x5b')],'rows':_0x5aadb0});});},'SendFax':function(_0x554a01){var _0x3df968=this;return new Promise(function(_0x49a672,_0x3440c3){_0x4ce209['send'](_0x554a01)[_0x26ec('0x72')](function(_0x357f2f){_0x49a672({'code':0xc8,'message':_0x357f2f[_0x26ec('0x1b')]});})[_0x26ec('0x20')](function(_0x481ed7){_0x3440c3(_0x3df968[_0x26ec('0x12')](0x1f4,_0x481ed7['message']));});});},'CheckAfterSend':function(_0x2cefa0){var _0x39b8df=this;return new Promise(function(_0x1f3972,_0x4bf4ac){_0x4ce209['checkAfterSend'](_0x2cefa0)[_0x26ec('0x72')](function(_0x1497b8){_0x1f3972({'code':0xc8,'message':_0x1497b8[_0x26ec('0x1b')]});})[_0x26ec('0x20')](function(_0x4f3bbb){_0x4bf4ac(_0x39b8df['error'](0x1f4,_0x4f3bbb[_0x26ec('0x1b')]));});});}};var _0x4aa432=jayson[_0x26ec('0x86')](_0x4cadb0)['http']();_0x4aa432['on'](_0x26ec('0x12'),function(_0x4da032){return _0x4e8781(_0x4da032);});_0x4aa432[_0x26ec('0x8')](0x232a,_0x26ec('0x87'),function(){console[_0x26ec('0x88')](_0x26ec('0x89'),0x232a);return _0x3b5955('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x4873=['erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','channel','%s.%s','filename','uniqueid','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','ami\x20disconnected','validate','resolve','StopMixMonitor','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','../properties','../ami','listen','format','SIP','timers','updateAcw','agents','QueuePause','isConnected','asterisk','username','join','pick','keys','module','action','Reload','Action','then','message','catch','error','command','Command','content','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','type','outbound','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond'];(function(_0x3818c0,_0x542521){var _0x55ec33=function(_0x2be9ea){while(--_0x2be9ea){_0x3818c0['push'](_0x3818c0['shift']());}};_0x55ec33(++_0x542521);}(_0x4873,0x1df));var _0x3487=function(_0x31f0c2,_0x41da71){_0x31f0c2=_0x31f0c2-0x0;var _0x4a94b9=_0x4873[_0x31f0c2];return _0x4a94b9;};'use strict';var _=require(_0x3487('0x0'));var util=require(_0x3487('0x1'));var jayson=require(_0x3487('0x2'));var schema=require('validate');var BPromise=require(_0x3487('0x3'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x3487('0x4'));var ami=require(_0x3487('0x5'));exports[_0x3487('0x6')]=function(_0x1d6d6c,_0x2fc292,_0xbe12a4){return new BPromise(function(_0x2611dc,_0x193589){var _0x4a2407={'QueuePause':function(_0x1d4cae){return new Promise(function(_0x3df081,_0x1d0487){var _0x3be031=util[_0x3487('0x7')]('%s/%s',_0x3487('0x8'),_0x1d4cae['name']);if(_0x1d6d6c[_0x3487('0x9')]&&_0x1d6d6c[_0x3487('0x9')][_0x3be031]&&_0x1d6d6c['timers'][_0x3be031]['timer']){_0x1d6d6c[_0x3487('0x9')][_0x3be031][_0x3487('0xa')]();}if(_0x1d6d6c['agents'][_0x3be031]){_0x1d6d6c[_0x3487('0xb')][_0x3be031]['updateStatusRealtime']({'statePause':_0x1d4cae['pause']?!![]:![]});}_0x3df081({'code':0xc8,'message':_0x3487('0xc')});});},'Reload':function(_0x1be2e0){var _0x3883c7=this;return new Promise(function(_0x3033b3,_0x8d7a3c){if(ami[_0x3487('0xd')]()==![]){return _0x8d7a3c(_0x3883c7['error'](0x1f4,[config[_0x3487('0xe')]['ip'],config[_0x3487('0xe')][_0x3487('0xf')],'ami\x20disconnected'][_0x3487('0x10')]('\x20')));}_0x1be2e0=_[_0x3487('0x11')](_0x1be2e0,_[_0x3487('0x12')](properties[_0x3487('0x13')]));_0x1be2e0[_0x3487('0x14')]=_0x3487('0x15');return ami[_0x3487('0x16')](_0x1be2e0)[_0x3487('0x17')](function(_0x320894){_0x3033b3({'code':0xc8,'message':_0x320894[_0x3487('0x18')]});})[_0x3487('0x19')](function(_0x41795b){_0x8d7a3c(_0x3883c7[_0x3487('0x1a')](0x1f5,_0x41795b[_0x3487('0x18')]));});});},'Command':function(_0x56f282){var _0x320349=this;return new Promise(function(_0x594ff6,_0x2fd2e8){if(ami[_0x3487('0xd')]()==![]){return _0x2fd2e8(_0x320349[_0x3487('0x1a')](0x1f4,[config[_0x3487('0xe')]['ip'],config[_0x3487('0xe')][_0x3487('0xf')],'ami\x20disconnected'][_0x3487('0x10')]('\x20')));}_0x56f282=_[_0x3487('0x11')](_0x56f282,_0x3487('0x1b'));_0x56f282[_0x3487('0x14')]=_0x3487('0x1c');return ami[_0x3487('0x16')](_0x56f282)['then'](function(_0x384792){_0x594ff6({'code':0xc8,'message':_0x384792[_0x3487('0x1d')]});})[_0x3487('0x19')](function(_0x482551){_0x2fd2e8(_0x320349['error'](0x1f5,_0x482551[_0x3487('0x18')]));});});},'VoiceQueues':function(_0x20be9a){return new Promise(function(_0x2a0b57,_0x3a9d76){var _0x4c6882=[];for(var _0x79a183 in _0x1d6d6c[_0x3487('0x1e')]){if(_0x1d6d6c['voiceQueues'][_0x3487('0x1f')](_0x79a183)){var _0x3fb245=_0x1d6d6c['voiceQueues'][_0x79a183];var _0x59968f={'id':_0x3fb245['id'],'name':_0x3fb245[_0x3487('0x20')],'strategy':_0x3fb245[_0x3487('0x21')],'answered':_0x3fb245[_0x3487('0x22')],'available':_0x3fb245[_0x3487('0x23')],'loggedIn':_0x3fb245[_0x3487('0x24')],'pTalking':_0x3fb245[_0x3487('0x25')],'sumBillable':_0x3fb245[_0x3487('0x26')],'sumDuration':_0x3fb245[_0x3487('0x27')],'sumHoldTime':_0x3fb245[_0x3487('0x28')]||0x0,'talking':_0x3fb245[_0x3487('0x29')],'total':_0x3fb245[_0x3487('0x2a')],'type':_0x3fb245['type'],'unmanaged':_0x3fb245['unmanaged'],'abandoned':_0x3fb245[_0x3487('0x2b')],'waiting':_0x3fb245[_0x3487('0x2c')],'loggedInDb':_0x3fb245['loggedInDb']};if(_0x3fb245[_0x3487('0x2d')]===_0x3487('0x2e')){_0x59968f['dialActive']=_0x3fb245['dialActive'];_0x59968f[_0x3487('0x2f')]=_0x3fb245[_0x3487('0x2f')];_0x59968f[_0x3487('0x30')]=_0x3fb245['dialOriginateCallerIdName'];_0x59968f[_0x3487('0x31')]=_0x3fb245['dialOriginateCallerIdNumber'];_0x59968f['dialOriginateTimeout']=_0x3fb245['dialOriginateTimeout'];_0x59968f[_0x3487('0x32')]=_0x3fb245[_0x3487('0x32')];_0x59968f['temp']=_0x3fb245['temp'];_0x59968f[_0x3487('0x33')]=_0x3fb245['outboundAnswerAgiCallsDay'];_0x59968f['outboundAnswerCallsDay']=_0x3fb245[_0x3487('0x34')];_0x59968f[_0x3487('0x35')]=_0x3fb245[_0x3487('0x35')];_0x59968f['outboundBusyCallsDay']=_0x3fb245[_0x3487('0x36')];_0x59968f[_0x3487('0x37')]=_0x3fb245[_0x3487('0x37')];_0x59968f[_0x3487('0x38')]=_0x3fb245['outboundDropCallsDayACS'];_0x59968f[_0x3487('0x39')]=_0x3fb245[_0x3487('0x39')];_0x59968f['outboundDropCallsDayTimeout']=_0x3fb245[_0x3487('0x3a')];_0x59968f[_0x3487('0x3b')]=_0x3fb245[_0x3487('0x3b')];_0x59968f[_0x3487('0x3c')]=_0x3fb245[_0x3487('0x3c')];_0x59968f[_0x3487('0x3d')]=_0x3fb245[_0x3487('0x3d')];_0x59968f[_0x3487('0x3e')]=_0x3fb245[_0x3487('0x3e')];_0x59968f['outboundRejectCallsDay']=_0x3fb245[_0x3487('0x3f')];_0x59968f[_0x3487('0x40')]=_0x3fb245['outboundUnknownCallsDay'];_0x59968f['predictiveIntervalAnsweredCalls']=_0x3fb245[_0x3487('0x41')];_0x59968f[_0x3487('0x42')]=_0x3fb245[_0x3487('0x42')];_0x59968f['predictiveIntervalAvgTalktime']=_0x3fb245['predictiveIntervalAvgTalktime'];_0x59968f['predictiveIntervalDroppedCallsCallersExit']=_0x3fb245[_0x3487('0x43')];_0x59968f[_0x3487('0x44')]=_0x3fb245['predictiveIntervalDroppedCallsTimeout'];_0x59968f[_0x3487('0x45')]=_0x3fb245[_0x3487('0x45')];_0x59968f[_0x3487('0x46')]=_0x3fb245[_0x3487('0x46')];_0x59968f[_0x3487('0x47')]=_0x3fb245[_0x3487('0x47')];_0x59968f[_0x3487('0x48')]=_0x3fb245[_0x3487('0x48')];_0x59968f[_0x3487('0x49')]=_0x3fb245['predictiveIntervalPauses'];_0x59968f[_0x3487('0x4a')]=_0x3fb245[_0x3487('0x4a')];_0x59968f['predictiveIntervalTotalCalls']=_0x3fb245['predictiveIntervalTotalCalls'];_0x59968f[_0x3487('0x18')]=_0x3fb245['message'];_0x59968f['originated']=_0x3fb245[_0x3487('0x4b')];_0x59968f['erlangCalls']=_0x3fb245['erlangCalls'];_0x59968f[_0x3487('0x4c')]=_0x3fb245[_0x3487('0x4c')];_0x59968f['erlangAbandonmentRate']=_0x3fb245['erlangAbandonmentRate'];_0x59968f[_0x3487('0x4d')]=_0x3fb245[_0x3487('0x4d')];_0x59968f['startPredictive']=_0x3fb245[_0x3487('0x4e')];_0x59968f[_0x3487('0x4f')]=_0x3fb245['startProgressive'];}if(_0x3fb245[_0x3487('0x50')]){_0x59968f[_0x3487('0x50')]={'id':_0x3fb245[_0x3487('0x50')]['id'],'name':_0x3fb245['Trunk'][_0x3487('0x20')],'active':_0x3fb245[_0x3487('0x50')][_0x3487('0x51')],'callerid':_0x3fb245[_0x3487('0x50')][_0x3487('0x52')]};}if(_0x3fb245[_0x3487('0x53')]){_0x59968f[_0x3487('0x53')]={'id':_0x3fb245[_0x3487('0x53')]['id'],'name':_0x3fb245['Interval'][_0x3487('0x20')]};}_0x4c6882[_0x3487('0x54')](_0x59968f);}}_0x2a0b57({'count':_0x4c6882[_0x3487('0x55')],'rows':_0x4c6882});});},'UpdateVoiceQueue':function(_0x2795f3){return new Promise(function(_0x3315da,_0x31e766){var _0x324ebb=_[_0x3487('0x56')](_0x1d6d6c['voiceQueues'],{'id':parseInt(_0x2795f3['id'])});var _0x59f0fa=_[_0x3487('0x57')](_0x2795f3,['id']);if(_0x324ebb){for(var _0x32ddbb in _0x59f0fa){if(typeof _0x59f0fa[_0x32ddbb]!==_0x3487('0x58')&&typeof _0x324ebb[_0x32ddbb]!==_0x3487('0x58')){_0x324ebb[_0x32ddbb]=_0x59f0fa[_0x32ddbb];}}_0x3315da(_0x324ebb);}else{_0x31e766();}});},'VoiceChannels':function(_0x5bff36){return new Promise(function(_0x50b81c,_0x1f373b){var _0x122456=_[_0x3487('0x59')](_0x1d6d6c[_0x3487('0x5a')]);_0x50b81c({'count':_0x122456[_0x3487('0x55')],'rows':_0x122456});});},'VoiceChannelMixMonitor':function(_0x3f46af){var _0x357670=this;return new Promise(function(_0x1cac2c,_0x515e68){if(ami['isConnected']()==![]){return _0x515e68(_0x357670[_0x3487('0x1a')](0x1f4,[config[_0x3487('0xe')]['ip'],config['asterisk'][_0x3487('0xf')],'ami\x20disconnected']['join']('\x20')));}var _0x12ebfc=schema(properties[_0x3487('0x5b')])['validate'](_0x3f46af);if(_0x12ebfc[_0x3487('0x55')]>0x0){return _0x515e68(_0x357670[_0x3487('0x1a')](0x1f4,_[_0x3487('0x5c')](_0x12ebfc,'message')[_0x3487('0x10')](',\x20')));}var _0x56b3fa=_[_0x3487('0x56')](_0x1d6d6c[_0x3487('0x5a')],{'uniqueid':_0x3f46af['uniqueid']});if(_0x56b3fa&&_0x56b3fa[_0x3487('0x5d')]){var _0xb6be79=util[_0x3487('0x7')](_0x3487('0x5e'),_0x3f46af[_0x3487('0x5f')]||_0x3f46af[_0x3487('0x60')],_0x3f46af[_0x3487('0x7')]||'wav');return ami[_0x3487('0x16')]({'action':_0x3487('0x61'),'channel':_0x56b3fa['channel'],'file':_0xb6be79,'options':_0x3487('0x62')})[_0x3487('0x17')](function(_0x3e03e4){var _0x36bae6=_[_0x3487('0x56')](_0x56b3fa[_0x3487('0x63')],{'filename':_0x3487('0x64')+_0xb6be79[_0x3487('0x65')]()});if(_[_0x3487('0x66')](_0x36bae6)){_0x56b3fa[_0x3487('0x63')]['push']({'filename':_0x3487('0x64')+_0xb6be79[_0x3487('0x65')](),'createdAt':moment()[_0x3487('0x7')](_0x3487('0x67')),'mixmonitorid':_0x3e03e4[_0x3487('0x68')],'status':_0x3487('0x69')});}else{_0x36bae6['mixmonitorid']=_0x3e03e4[_0x3487('0x68')];_0x36bae6[_0x3487('0x6a')]='rec';}_0x1cac2c({'code':0xc8,'message':[_0x3f46af['uniqueid'],_0x3487('0x6b'),_0x3e03e4[_0x3487('0x68')]][_0x3487('0x10')]('\x20'),'mixmonitorid':_0x3e03e4[_0x3487('0x68')]});})[_0x3487('0x19')](function(_0x24ce5b){_0x515e68(_0x357670['error'](0x1f5,[_0x3f46af['uniqueid'],_0x24ce5b[_0x3487('0x18')][_0x3487('0x65')]()]['join']('\x20')));});}else{return _0x515e68(_0x357670[_0x3487('0x1a')](0x1f5,_0x3487('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x143d42){var _0x48c4ea=this;return new Promise(function(_0x43a4c5,_0xa278c6){if(ami['isConnected']()==![]){return _0xa278c6(_0x48c4ea['error'](0x1f4,[config[_0x3487('0xe')]['ip'],config[_0x3487('0xe')][_0x3487('0xf')],_0x3487('0x6d')]['join']('\x20')));}var _0x463d65=schema(properties[_0x3487('0x5b')])[_0x3487('0x6e')](_0x143d42);if(_0x463d65[_0x3487('0x55')]>0x0){return _0xa278c6(_0x48c4ea['error'](0x1f4,_['map'](_0x463d65,_0x3487('0x18'))['join'](',\x20')));}var _0x347a8c=_[_0x3487('0x56')](_0x1d6d6c[_0x3487('0x5a')],{'uniqueid':_0x143d42[_0x3487('0x60')]});if(_0x347a8c){return BPromise[_0x3487('0x6f')]()[_0x3487('0x17')](function(){if(_0x347a8c[_0x3487('0x5d')]){return ami[_0x3487('0x16')]({'action':_0x3487('0x70'),'channel':_0x347a8c[_0x3487('0x5d')],'mixmonitorid':_0x143d42[_0x3487('0x68')]})['catch'](function(_0x468064){});}})[_0x3487('0x17')](function(){if(_0x347a8c['destinationchannel']){return ami[_0x3487('0x16')]({'action':'StopMixMonitor','channel':_0x347a8c['destinationchannel'],'mixmonitorid':_0x143d42[_0x3487('0x68')]})[_0x3487('0x19')](function(_0x23a38a){});}})[_0x3487('0x17')](function(_0x3d47c3){var _0x2dcfd2=_[_0x3487('0x56')](_0x347a8c['monitors'],{'mixmonitorid':_0x143d42[_0x3487('0x68')]});if(_0x2dcfd2){_0x2dcfd2[_0x3487('0x6a')]=_0x3487('0x71');}})[_0x3487('0x17')](function(){var _0x1612e5=util[_0x3487('0x7')](_0x3487('0x5e'),_0x143d42[_0x3487('0x5f')]||_0x143d42[_0x3487('0x60')],_0x143d42[_0x3487('0x7')]||'wav');var _0x548e3e=_[_0x3487('0x56')](_0x347a8c['monitors'],{'filename':_0x3487('0x64')+_0x1612e5[_0x3487('0x65')]()});if(_0x548e3e){_0x548e3e[_0x3487('0x6a')]=_0x3487('0x71');}})['then'](function(){_0x43a4c5({'code':0xc8,'message':[_0x143d42[_0x3487('0x60')],_0x3487('0x72')][_0x3487('0x10')]('\x20')});})[_0x3487('0x19')](function(_0x11c4bf){_0xa278c6(_0x48c4ea[_0x3487('0x1a')](0x1f5,[_0x143d42['uniqueid'],_0x11c4bf[_0x3487('0x18')][_0x3487('0x65')]()]['join']('\x20')));});}else{return _0xa278c6(_0x48c4ea[_0x3487('0x1a')](0x1f5,_0x3487('0x6c')));}});},'VoiceQueuesChannels':function(_0xad8256){return new Promise(function(_0x459138,_0x379b7f){var _0x2daca0=_[_0x3487('0x59')](_0x1d6d6c[_0x3487('0x73')]);_0x459138({'count':_0x2daca0[_0x3487('0x55')],'rows':_0x2daca0});});},'VoiceQueuesChannel':function(_0x4180eb){var _0x5469ba=this;return new Promise(function(_0x14c921,_0x5d7d62){var _0x4b2992=schema(properties[_0x3487('0x74')])['validate'](_0x4180eb);if(_0x4b2992[_0x3487('0x55')]>0x0){return _0x5d7d62(_0x5469ba[_0x3487('0x1a')](0x1f4,_[_0x3487('0x5c')](_0x4b2992,'message')[_0x3487('0x10')](',\x20')));}var _0x2e3da3=_[_0x3487('0x56')](_0x1d6d6c['queueChannels'],{'uniqueid':_0x4180eb[_0x3487('0x60')]});if(_0x2e3da3){_0x14c921(_0x2e3da3);}else{return _0x5d7d62(_0x5469ba[_0x3487('0x1a')](0x1f5,_0x3487('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x5b7787){var _0x4bdd41=this;return new Promise(function(_0x168786,_0xd2e056){if(ami[_0x3487('0xd')]()==![]){return _0xd2e056(_0x4bdd41[_0x3487('0x1a')](0x1f4,[config[_0x3487('0xe')]['ip'],config[_0x3487('0xe')][_0x3487('0xf')],_0x3487('0x6d')][_0x3487('0x10')]('\x20')));}var _0xd482a=schema(properties[_0x3487('0x75')])[_0x3487('0x6e')](_0x5b7787);if(_0xd482a[_0x3487('0x55')]>0x0){return _0xd2e056(_0x4bdd41[_0x3487('0x1a')](0x1f4,_[_0x3487('0x5c')](_0xd482a,_0x3487('0x18'))[_0x3487('0x10')](',\x20')));}var _0x33ffb6=_[_0x3487('0x56')](_0x1d6d6c['queueChannels'],{'uniqueid':_0x5b7787[_0x3487('0x60')]});if(_0x33ffb6&&_0x33ffb6[_0x3487('0x5d')]){return ami[_0x3487('0x16')]({'action':_0x3487('0x76'),'channel':_0x33ffb6[_0x3487('0x5d')]})['then'](function(_0x4d97c9){_0x168786({'code':0xc8,'message':[_0x5b7787[_0x3487('0x60')],_0x4d97c9[_0x3487('0x18')][_0x3487('0x65')]()][_0x3487('0x10')]('\x20')});})[_0x3487('0x19')](function(_0x39b3d7){_0xd2e056(_0x4bdd41[_0x3487('0x1a')](0x1f5,[_0x5b7787['uniqueid'],_0x39b3d7[_0x3487('0x18')]['toLowerCase']()]['join']('\x20')));});}else{return _0xd2e056(_0x4bdd41[_0x3487('0x1a')](0x1f5,_0x3487('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x457a78){var _0x44dc2f=this;return new Promise(function(_0x3adaa2,_0x19a455){if(ami[_0x3487('0xd')]()==![]){return _0x19a455(_0x44dc2f[_0x3487('0x1a')](0x1f4,[config[_0x3487('0xe')]['ip'],config[_0x3487('0xe')][_0x3487('0xf')],_0x3487('0x6d')][_0x3487('0x10')]('\x20')));}var _0x11d40c=schema(properties[_0x3487('0x77')])['validate'](_0x457a78);if(_0x11d40c[_0x3487('0x55')]>0x0){return _0x19a455(_0x44dc2f[_0x3487('0x1a')](0x1f4,_[_0x3487('0x5c')](_0x11d40c,_0x3487('0x18'))['join'](',\x20')));}var _0x530c6e=_['find'](_0x1d6d6c[_0x3487('0x73')],{'uniqueid':_0x457a78[_0x3487('0x60')]});if(_0x530c6e&&_0x530c6e[_0x3487('0x5d')]){return ami[_0x3487('0x16')]({'action':_0x3487('0x78'),'channel':_0x530c6e['channel'],'exten':_0x457a78[_0x3487('0x79')],'context':_0x457a78['context']||_0x530c6e[_0x3487('0x7a')],'priority':0x1})[_0x3487('0x17')](function(_0x188aec){_0x3adaa2({'code':0xc8,'message':[_0x457a78[_0x3487('0x60')],_0x188aec[_0x3487('0x18')][_0x3487('0x65')]()][_0x3487('0x10')]('\x20')});})['catch'](function(_0x136789){_0x19a455(_0x44dc2f[_0x3487('0x1a')](0x1f5,[_0x457a78[_0x3487('0x60')],_0x136789[_0x3487('0x18')][_0x3487('0x65')]()][_0x3487('0x10')]('\x20')));});}else{return _0x19a455(_0x44dc2f[_0x3487('0x1a')](0x1f5,_0x3487('0x6c')));}});},'Agents':function(_0x2dce91){return new Promise(function(_0x8d3164,_0x2f5012){var _0x3b0540=_['values'](_0x1d6d6c['agents']);_0x8d3164({'count':_0x3b0540[_0x3487('0x55')],'rows':_0x3b0540});});},'Telephones':function(_0x3188e9){return new Promise(function(_0xcfb667,_0x3abde2){var _0x311560=_['values'](_0x1d6d6c['telephones']);_0xcfb667({'count':_0x311560[_0x3487('0x55')],'rows':_0x311560});});},'Trunks':function(_0x47c8a7){return new Promise(function(_0x43c120,_0x3c7469){var _0x1c3a61=_[_0x3487('0x59')](_0x1d6d6c[_0x3487('0x7b')]);_0x43c120({'count':_0x1c3a61[_0x3487('0x55')],'rows':_0x1c3a61});});},'OutboundChannels':function(_0xd12729){return new Promise(function(_0x1cb7e9,_0x57b4e1){var _0x409dde=_[_0x3487('0x59')](_0x1d6d6c[_0x3487('0x7c')]);_0x1cb7e9({'count':_0x409dde['length'],'rows':_0x409dde});});},'Outbound':function(_0x252eec){return new Promise(function(_0x2ffab6,_0x8608ac){_0x2ffab6(_0x1d6d6c[_0x3487('0x2e')]);});},'Campaigns':function(_0x492292){return new Promise(function(_0x50571e,_0x34eda4){var _0x32ed8c=_[_0x3487('0x59')](_0x1d6d6c[_0x3487('0x7d')]);_0x50571e({'count':_0x32ed8c[_0x3487('0x55')],'rows':_0x32ed8c});});},'VoiceQueuesPreview':function(_0x6beb62){var _0x3b9992=this;return new Promise(function(_0x80288a,_0x258bf4){_0x2fc292['run'](_0x6beb62['id'])[_0x3487('0x17')](function(_0xc9382d){_0x80288a({'code':0xc8,'message':_0xc9382d[_0x3487('0x18')]});})[_0x3487('0x19')](function(_0x59c0fb){_0x258bf4(_0x3b9992['error'](0x1f4,_0x59c0fb[_0x3487('0x18')]));});});},'EventManager':function(_0x4b528b){var _0x5ef864=this;return new Promise(function(_0x2e32cc,_0x64d58e){if(!_0x4b528b[_0x3487('0x7e')]){return _0x64d58e(_0x5ef864[_0x3487('0x1a')](0x1f4,_0x3487('0x7f')));}ami[_0x3487('0x80')](_0x3487('0x81')+_0x4b528b[_0x3487('0x7e')],_0x4b528b['message']);_0x2e32cc({'code':0xc8,'message':_0x4b528b});});},'FaxAccounts':function(_0x3d3b7e){return new Promise(function(_0x215a57,_0x574449){var _0xddf26e=_['values'](_0x1d6d6c[_0x3487('0x82')]);_0x215a57({'count':_0xddf26e['length'],'rows':_0xddf26e});});},'SendFax':function(_0x2cf63e){var _0x3e70eb=this;return new Promise(function(_0xfc35d,_0xbcb012){_0xbe12a4[_0x3487('0x83')](_0x2cf63e)[_0x3487('0x17')](function(_0x50413f){_0xfc35d({'code':0xc8,'message':_0x50413f[_0x3487('0x18')]});})['catch'](function(_0x5bc11b){_0xbcb012(_0x3e70eb[_0x3487('0x1a')](0x1f4,_0x5bc11b[_0x3487('0x18')]));});});},'CheckAfterSend':function(_0xc7fd3f){var _0x2e7509=this;return new Promise(function(_0x609d8e,_0x2f943d){_0xbe12a4[_0x3487('0x84')](_0xc7fd3f)['then'](function(_0x44d7ee){_0x609d8e({'code':0xc8,'message':_0x44d7ee[_0x3487('0x18')]});})[_0x3487('0x19')](function(_0x1803ae){_0x2f943d(_0x2e7509['error'](0x1f4,_0x1803ae['message']));});});}};var _0x4340fb=jayson[_0x3487('0x85')](_0x4a2407)[_0x3487('0x86')]();_0x4340fb['on']('error',function(_0x54652c){return _0x193589(_0x54652c);});_0x4340fb['listen'](0x232a,_0x3487('0x87'),function(){console[_0x3487('0x88')](_0x3487('0x89'),0x232a);return _0x2611dc(_0x3487('0x8a')+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 2f98e6c..69f5fe6 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 _0x6f0d=['length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','info','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','scheduledAt','updatedAt','resolve','then','isEmpty'];(function(_0x5d781e,_0x39250e){var _0x5db6b0=function(_0x37b30e){while(--_0x37b30e){_0x5d781e['push'](_0x5d781e['shift']());}};_0x5db6b0(++_0x39250e);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x4b5a7d,_0x1a4bad){_0x4b5a7d=_0x4b5a7d-0x0;var _0x4c8c23=_0x6f0d[_0x4b5a7d];return _0x4c8c23;};'use strict';var _=require('lodash');var BPromise=require(_0xd6f0('0x0'));var Redis=require(_0xd6f0('0x1'));var util=require(_0xd6f0('0x2'));var config=require(_0xd6f0('0x3'));var logger=require('../../../../config/logger')(_0xd6f0('0x4'));var cmContactRpc=require(_0xd6f0('0x5'));config[_0xd6f0('0x6')]=_[_0xd6f0('0x7')](config[_0xd6f0('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xd6f0('0x8'))(new Redis(config['redis']));function emit(_0xe21ac4,_0x1af29c,_0x8b89a9,_0x1a48a0,_0x4c4916){logger['info'](_0xd6f0('0x9'),_0xe21ac4,_0x1af29c['id'],_0x8b89a9,_0x1a48a0,JSON[_0xd6f0('0xa')](_0x4c4916));io['to'](_0x8b89a9)[_0xd6f0('0xb')](_0x1a48a0,_0x4c4916);}exports[_0xd6f0('0xc')]=function(_0x225dcf,_0x4db64a,_0x136eee,_0xee144c){var _0x329f69,_0x44bba6;var _0x4d10a1={};var _0x1ce8d5=Number(_0x136eee[_0xd6f0('0xd')]);var _0x306aad=_0x136eee[_0xd6f0('0xe')]?Boolean(Number(_0x136eee[_0xd6f0('0xe')])):![];var _0x409549;var _0x2bf5b8=![];if(!_[_0xd6f0('0xf')](_0x136eee[_0xd6f0('0x10')])){if(_0x136eee['data5']=='1')_0x2bf5b8=!![];}if(!_0x2bf5b8){if(_0xee144c[_0xd6f0('0x11')]){_0x4d10a1['id']=_0xee144c[_0xd6f0('0x11')];}}if(!_0x4d10a1['id']){_0x4d10a1['ListId']=_0x1ce8d5;_0x409549=_0x136eee[_0xd6f0('0x12')]&&_0x136eee['data3']!=='0'?_0x136eee[_0xd6f0('0x12')][_0xd6f0('0x13')](','):[_0xd6f0('0x14')];_0x4d10a1[_0xd6f0('0x15')]=_[_0xd6f0('0x16')](_0x409549,function(_0x61defb){var _0x25da0c={};_0x25da0c[_0x61defb]=_0xee144c[_0xd6f0('0x17')]?_0xee144c[_0xd6f0('0x18')]:_0xee144c[_0xd6f0('0x19')];return _0x25da0c;});}var _0x23ab6c=['id',_0xd6f0('0x1a'),_0xd6f0('0x1b'),_0xd6f0('0x14'),_0xd6f0('0x1c'),_0xd6f0('0x1d'),'ListId','createdAt',_0xd6f0('0x1e'),_0xd6f0('0x1f')];var _0x1158dc=_['union'](_0x23ab6c,_0x409549);BPromise[_0xd6f0('0x20')]()[_0xd6f0('0x21')](cmContactRpc['getContacts']({'attributes':_0x1158dc,'where':_0x4d10a1}))[_0xd6f0('0x21')](function(_0x515687){_0x44bba6=_0x515687;if(!_[_0xd6f0('0x22')](_0x44bba6)){if(_0x44bba6[_0xd6f0('0x23')]===0x1){_0x329f69=_0x44bba6[0x0];logger['info'](_0xd6f0('0x24'),_0xee144c[_0xd6f0('0x25')],_0x4db64a['id'],_0x329f69['id']);}else{logger['info'](_0xd6f0('0x26'),_0xee144c[_0xd6f0('0x25')],_0x4db64a['id'],_[_0xd6f0('0x16')](_0x44bba6,'id')['join'](','));}return;}else{logger[_0xd6f0('0x27')](_0xd6f0('0x28'),_0xee144c['uniqueid'],_0x4db64a['id']);var _0xcea0ae={'ListId':_0x1ce8d5};var _0x551be8=_0x136eee[_0xd6f0('0x29')]&&_0x136eee[_0xd6f0('0x29')]!=='0'?_0x136eee[_0xd6f0('0x29')]:_0xd6f0('0x14');if(_0x306aad){logger[_0xd6f0('0x27')](_0xd6f0('0x2a'),_0xee144c[_0xd6f0('0x25')],_0x4db64a['id']);_0xcea0ae[_0x551be8]=_[_0xd6f0('0xf')](_0xee144c['routeId'])?_0xee144c[_0xd6f0('0x19')]:_0xee144c[_0xd6f0('0x18')];if(_['isNil'](_0xee144c[_0xd6f0('0x17')])){_0xcea0ae[_0xd6f0('0x1a')]=_0xee144c[_0xd6f0('0x2b')]&&_0xee144c[_0xd6f0('0x2b')]!==_0xd6f0('0x2c')?_0xee144c[_0xd6f0('0x2b')]:_0xd6f0('0x2d');}else{_0xcea0ae[_0xd6f0('0x1a')]=_0xee144c[_0xd6f0('0x2e')]&&_0xee144c[_0xd6f0('0x2e')]!==_0xd6f0('0x2c')?_0xee144c[_0xd6f0('0x2e')]:_0xd6f0('0x2d');}return BPromise[_0xd6f0('0x20')]()[_0xd6f0('0x21')](cmContactRpc[_0xd6f0('0x2f')](_0xcea0ae))[_0xd6f0('0x21')](function(_0x376890){_0x329f69=_0x376890;_0x44bba6[_0xd6f0('0x30')](_0x376890);if(_0x329f69){logger[_0xd6f0('0x27')](_0xd6f0('0x31'),_0xee144c[_0xd6f0('0x25')],_0x4db64a['id'],_0x329f69['id']);}return;});}else{logger['info'](_0xd6f0('0x32'),_0xee144c['uniqueid'],_0x4db64a['id']);_0xcea0ae[_0x551be8]=_['isNil'](_0xee144c[_0xd6f0('0x17')])?_0xee144c[_0xd6f0('0x19')]:_0xee144c[_0xd6f0('0x18')];if(_[_0xd6f0('0xf')](_0xee144c[_0xd6f0('0x17')])){_0xcea0ae['firstName']=_0xee144c[_0xd6f0('0x2b')]&&_0xee144c['calleridname']!==_0xd6f0('0x2c')?_0xee144c[_0xd6f0('0x2b')]:_0xd6f0('0x2d');}else{_0xcea0ae[_0xd6f0('0x1a')]=_0xee144c[_0xd6f0('0x2e')]&&_0xee144c['destcalleridname']!==''?_0xee144c[_0xd6f0('0x2e')]:_0xd6f0('0x2d');}_0x329f69=_0xcea0ae;_0x44bba6['push'](_0xcea0ae);return;}}})[_0xd6f0('0x21')](function(){if(_0x225dcf){emit(_0xee144c['uniqueid'],_0x4db64a,util[_0xd6f0('0x33')](_0xd6f0('0x34'),_0x225dcf[_0xd6f0('0x35')]),util[_0xd6f0('0x33')](_0xd6f0('0x36'),_0x136eee[_0xd6f0('0x37')][_0xd6f0('0x38')]()),{'evt':_['merge'](_0xee144c,{'autoCreate':_0x306aad}),'contact':_0x329f69===undefined?{}:_0x329f69,'contacts':_0x44bba6['length']===0x0?undefined:_0x44bba6});}});}; \ No newline at end of file +var _0x7bae=['data5','xmd-contactid','ListId','data3','map','firstName','lastName','phone','mobile','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridnum','routeId','','calleridname','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','destcalleridnum','format','user:%s','trigger:%s','action','toLowerCase','merge','ioredis','util','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','data2','isNil'];(function(_0x21188a,_0x437f2b){var _0x3fb3fa=function(_0x12f8e4){while(--_0x12f8e4){_0x21188a['push'](_0x21188a['shift']());}};_0x3fb3fa(++_0x437f2b);}(_0x7bae,0x13b));var _0xe7ba=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x7bae[_0x5416db];return _0x243e35;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0xe7ba('0x0'));var util=require(_0xe7ba('0x1'));var config=require('../../../../config/environment');var logger=require(_0xe7ba('0x2'))('trigger');var cmContactRpc=require(_0xe7ba('0x3'));config[_0xe7ba('0x4')]=_[_0xe7ba('0x5')](config[_0xe7ba('0x4')],{'host':_0xe7ba('0x6'),'port':0x18eb});var io=require(_0xe7ba('0x7'))(new Redis(config[_0xe7ba('0x4')]));function emit(_0x3c5e59,_0x10b307,_0x34fb18,_0x160565,_0x27b1d5){logger[_0xe7ba('0x8')](_0xe7ba('0x9'),_0x3c5e59,_0x10b307['id'],_0x34fb18,_0x160565,JSON['stringify'](_0x27b1d5));io['to'](_0x34fb18)[_0xe7ba('0xa')](_0x160565,_0x27b1d5);}exports[_0xe7ba('0xb')]=function(_0x375ebb,_0x276bc3,_0x15083a,_0x1672f0){var _0x99a86f,_0x448bcc;var _0x194447={};var _0x4b6597=Number(_0x15083a[_0xe7ba('0xc')]);var _0x588c8b=_0x15083a[_0xe7ba('0xd')]?Boolean(Number(_0x15083a[_0xe7ba('0xd')])):![];var _0x390596;var _0x17e4e6=![];if(!_[_0xe7ba('0xe')](_0x15083a[_0xe7ba('0xf')])){if(_0x15083a['data5']=='1')_0x17e4e6=!![];}if(!_0x17e4e6){if(_0x1672f0['xmd-contactid']){_0x194447['id']=_0x1672f0[_0xe7ba('0x10')];}}if(!_0x194447['id']){_0x194447[_0xe7ba('0x11')]=_0x4b6597;_0x390596=_0x15083a[_0xe7ba('0x12')]&&_0x15083a['data3']!=='0'?_0x15083a[_0xe7ba('0x12')]['split'](','):['phone'];_0x194447['$or']=_[_0xe7ba('0x13')](_0x390596,function(_0x4e87f5){var _0x41a773={};_0x41a773[_0x4e87f5]=_0x1672f0['routeId']?_0x1672f0['destcalleridnum']:_0x1672f0['calleridnum'];return _0x41a773;});}var _0x3f326a=['id',_0xe7ba('0x14'),_0xe7ba('0x15'),_0xe7ba('0x16'),_0xe7ba('0x17'),'fax',_0xe7ba('0x11'),_0xe7ba('0x18'),_0xe7ba('0x19'),_0xe7ba('0x1a')];var _0x4aaf35=_[_0xe7ba('0x1b')](_0x3f326a,_0x390596);BPromise[_0xe7ba('0x1c')]()['then'](cmContactRpc[_0xe7ba('0x1d')]({'attributes':_0x4aaf35,'where':_0x194447}))[_0xe7ba('0x1e')](function(_0x27c882){_0x448bcc=_0x27c882;if(!_[_0xe7ba('0x1f')](_0x448bcc)){if(_0x448bcc[_0xe7ba('0x20')]===0x1){_0x99a86f=_0x448bcc[0x0];logger[_0xe7ba('0x8')](_0xe7ba('0x21'),_0x1672f0[_0xe7ba('0x22')],_0x276bc3['id'],_0x99a86f['id']);}else{logger[_0xe7ba('0x8')](_0xe7ba('0x23'),_0x1672f0['uniqueid'],_0x276bc3['id'],_['map'](_0x448bcc,'id')['join'](','));}return;}else{logger['info'](_0xe7ba('0x24'),_0x1672f0['uniqueid'],_0x276bc3['id']);var _0x4ecc0d={'ListId':_0x4b6597};var _0x5ece11=_0x15083a[_0xe7ba('0x25')]&&_0x15083a[_0xe7ba('0x25')]!=='0'?_0x15083a[_0xe7ba('0x25')]:_0xe7ba('0x16');if(_0x588c8b){logger[_0xe7ba('0x8')](_0xe7ba('0x26'),_0x1672f0[_0xe7ba('0x22')],_0x276bc3['id']);_0x4ecc0d[_0x5ece11]=_[_0xe7ba('0xe')](_0x1672f0['routeId'])?_0x1672f0[_0xe7ba('0x27')]:_0x1672f0['destcalleridnum'];if(_[_0xe7ba('0xe')](_0x1672f0[_0xe7ba('0x28')])){_0x4ecc0d[_0xe7ba('0x14')]=_0x1672f0['calleridname']&&_0x1672f0['calleridname']!==_0xe7ba('0x29')?_0x1672f0[_0xe7ba('0x2a')]:_0xe7ba('0x2b');}else{_0x4ecc0d[_0xe7ba('0x14')]=_0x1672f0[_0xe7ba('0x2c')]&&_0x1672f0['destcalleridname']!==_0xe7ba('0x29')?_0x1672f0[_0xe7ba('0x2c')]:'Unknown';}return BPromise[_0xe7ba('0x1c')]()['then'](cmContactRpc['createContact'](_0x4ecc0d))[_0xe7ba('0x1e')](function(_0x134f21){_0x99a86f=_0x134f21;_0x448bcc[_0xe7ba('0x2d')](_0x134f21);if(_0x99a86f){logger['info'](_0xe7ba('0x2e'),_0x1672f0['uniqueid'],_0x276bc3['id'],_0x99a86f['id']);}return;});}else{logger[_0xe7ba('0x8')](_0xe7ba('0x2f'),_0x1672f0[_0xe7ba('0x22')],_0x276bc3['id']);_0x4ecc0d[_0x5ece11]=_[_0xe7ba('0xe')](_0x1672f0[_0xe7ba('0x28')])?_0x1672f0['calleridnum']:_0x1672f0[_0xe7ba('0x30')];if(_[_0xe7ba('0xe')](_0x1672f0['routeId'])){_0x4ecc0d[_0xe7ba('0x14')]=_0x1672f0[_0xe7ba('0x2a')]&&_0x1672f0[_0xe7ba('0x2a')]!==''?_0x1672f0[_0xe7ba('0x2a')]:_0xe7ba('0x2b');}else{_0x4ecc0d['firstName']=_0x1672f0[_0xe7ba('0x2c')]&&_0x1672f0[_0xe7ba('0x2c')]!==_0xe7ba('0x29')?_0x1672f0['destcalleridname']:_0xe7ba('0x2b');}_0x99a86f=_0x4ecc0d;_0x448bcc[_0xe7ba('0x2d')](_0x4ecc0d);return;}}})['then'](function(){if(_0x375ebb){emit(_0x1672f0[_0xe7ba('0x22')],_0x276bc3,util[_0xe7ba('0x31')](_0xe7ba('0x32'),_0x375ebb['name']),util['format'](_0xe7ba('0x33'),_0x15083a[_0xe7ba('0x34')][_0xe7ba('0x35')]()),{'evt':_[_0xe7ba('0x36')](_0x1672f0,{'autoCreate':_0x588c8b}),'contact':_0x99a86f===undefined?{}:_0x99a86f,'contacts':_0x448bcc[_0xe7ba('0x20')]===0x0?undefined:_0x448bcc});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 8591df6..fa91986 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 _0x2d9b=['merge','Actions','action','contactmanager','motionbar','browser','data1','html','render','data2','uri','buildUri','data3','data4','location','uriLocation','windowWidth','isNil','data5','800','600','format','trigger:%s:%s','toLowerCase','jscripty','user:%s','name','trigger:%s','exec','integration','voiceQueues','routeId','urlforward','script','parse','query','search','replace','channel','AllConditions','length','AnyConditions','some','checkConditions','field','account','chat','ChatWebsiteId','value','upperFirst','AccountId','interaction','message','event','queue','agent','membername','operator','lastevent','exports','url','ioredis','./urlforward','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:amd','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','emit','stringify','prototype','clone','motionChannel','voice','interface','hasOwnProperty','status','checkTrigger'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2d9b,0xb0));var _0xb2d9=function(_0x143630,_0x2828b9){_0x143630=_0x143630-0x0;var _0x37fa01=_0x2d9b[_0x143630];return _0x37fa01;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0xb2d9('0x0'));var Mustache=require('mustache');var Redis=require(_0xb2d9('0x1'));var urlforward=require(_0xb2d9('0x2'));var integration=require('./integration');var cmContact=require(_0xb2d9('0x3'));var script=require(_0xb2d9('0x4'));var config=require(_0xb2d9('0x5'));var logger=require(_0xb2d9('0x6'))(_0xb2d9('0x7'));var ami=require(_0xb2d9('0x8'));config[_0xb2d9('0x9')]=_[_0xb2d9('0xa')](config[_0xb2d9('0x9')],{'host':_0xb2d9('0xb'),'port':0x18eb});var io=require(_0xb2d9('0xc'))(new Redis(config[_0xb2d9('0x9')]));var operators={'equals':function(_0x17e24d,_0x5e97dd){return _0x17e24d==_0x5e97dd;},'not_equals':function(_0x1e65c0,_0x2d463f){return _0x1e65c0!=_0x2d463f;}};var barAndWebActions=[_0xb2d9('0xd'),_0xb2d9('0x0'),_0xb2d9('0xe')];function Trigger(_0x3e2c18){this[_0xb2d9('0xf')]=_0x3e2c18['triggers'];this['agents']=_0x3e2c18[_0xb2d9('0x10')];this['voiceQueues']=_0x3e2c18['voiceQueues'];this[_0xb2d9('0x11')]=_0x3e2c18[_0xb2d9('0x11')];this['voiceExtensions']=_0x3e2c18[_0xb2d9('0x12')];this[_0xb2d9('0x13')]=_0x3e2c18[_0xb2d9('0x13')];this[_0xb2d9('0x14')]=_0x3e2c18[_0xb2d9('0x14')];this[_0xb2d9('0x15')]=_0x3e2c18[_0xb2d9('0x15')];this[_0xb2d9('0x16')]=_0x3e2c18['sugarcrmAccounts'];this[_0xb2d9('0x17')]=_0x3e2c18['zohoAccounts'];this[_0xb2d9('0x18')]=_0x3e2c18['deskAccounts'];this[_0xb2d9('0x19')]=_0x3e2c18[_0xb2d9('0x19')];this[_0xb2d9('0x1a')]=_0x3e2c18[_0xb2d9('0x1a')];this[_0xb2d9('0x1b')]=_0x3e2c18[_0xb2d9('0x1b')];this['freshsalesAccounts']=_0x3e2c18[_0xb2d9('0x1c')];this[_0xb2d9('0x1d')]={'zendesk':this[_0xb2d9('0x13')],'salesforce':this[_0xb2d9('0x15')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xb2d9('0x16')],'zoho':this['zohoAccounts'],'desk':this['deskAccounts'],'vtiger':this[_0xb2d9('0x19')],'dynamics365':this[_0xb2d9('0x1b')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xb2d9('0x1a')]};ami['on'](_0xb2d9('0x1e'),this[_0xb2d9('0x1f')][_0xb2d9('0x20')](this));ami['on'](_0xb2d9('0x21'),this[_0xb2d9('0x1f')][_0xb2d9('0x20')](this));ami['on'](_0xb2d9('0x22'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentcomplete',this[_0xb2d9('0x1f')][_0xb2d9('0x20')](this));ami['on'](_0xb2d9('0x23'),this[_0xb2d9('0x1f')][_0xb2d9('0x20')](this));ami['on'](_0xb2d9('0x24'),this[_0xb2d9('0x1f')][_0xb2d9('0x20')](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0xb2d9('0x20')](this));ami['on']('custom:agentcongestion',this[_0xb2d9('0x1f')][_0xb2d9('0x20')](this));ami['on']('custom:agentreject',this[_0xb2d9('0x1f')][_0xb2d9('0x20')](this));ami['on'](_0xb2d9('0x25'),this[_0xb2d9('0x1f')][_0xb2d9('0x20')](this));ami['on']('custom:queuecallerabandon',this['syncCustomEvent'][_0xb2d9('0x20')](this));ami['on'](_0xb2d9('0x26'),this['syncCustomEvent'][_0xb2d9('0x20')](this));ami['on']('custom:dialbegin',this[_0xb2d9('0x27')][_0xb2d9('0x20')](this));ami['on'](_0xb2d9('0x28'),this[_0xb2d9('0x27')][_0xb2d9('0x20')](this));ami['on'](_0xb2d9('0x29'),this[_0xb2d9('0x27')]['bind'](this));ami['on'](_0xb2d9('0x2a'),this[_0xb2d9('0x1f')]['bind'](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0xb2d9('0x20')](this));ami['on'](_0xb2d9('0x2b'),this[_0xb2d9('0x1f')][_0xb2d9('0x20')](this));ami['on'](_0xb2d9('0x2c'),this['syncCustomEvent'][_0xb2d9('0x20')](this));ami['on']('custom:outgoingmessage',this[_0xb2d9('0x1f')][_0xb2d9('0x20')](this));ami['on'](_0xb2d9('0x2d'),this[_0xb2d9('0x1f')][_0xb2d9('0x20')](this));ami['on']('custom:rejectmessage',this['syncCustomEvent']['bind'](this));}Trigger['prototype'][_0xb2d9('0x2e')]=function(_0x84e850,_0x33817e,_0x4702f1){logger['info'](_0x84e850,_0x33817e,JSON[_0xb2d9('0x2f')](_0x4702f1));io['to'](_0x84e850)[_0xb2d9('0x2e')](_0x33817e,_0x4702f1);};Trigger[_0xb2d9('0x30')][_0xb2d9('0x1f')]=function(_0x1754e1){var _0x14f44b=_[_0xb2d9('0x31')](_0x1754e1);if(typeof _0x14f44b[_0xb2d9('0x32')]==='undefined'){_0x14f44b[_0xb2d9('0x32')]=_0xb2d9('0x33');}this['checkTriggers'](_0x14f44b);};Trigger[_0xb2d9('0x30')][_0xb2d9('0x27')]=function(_0x206d7e){if(this[_0xb2d9('0x10')][_0x206d7e[_0xb2d9('0x34')]]){this[_0xb2d9('0x1f')](_0x206d7e);}};Trigger['prototype']['checkTriggers']=function(_0x4802e5){var _0x30c65f;for(var _0xfe2fed in this['triggers']){if(this[_0xb2d9('0xf')][_0xb2d9('0x35')](_0xfe2fed)){if(this['triggers'][_0xfe2fed][_0xb2d9('0x36')]){_0x30c65f=this[_0xb2d9('0x37')](this[_0xb2d9('0xf')][_0xfe2fed],_0x4802e5);if(_0x30c65f){_[_0xb2d9('0x38')](_0x4802e5,_0x4802e5['variables']);for(var _0x52bc06=0x0,_0x5c345d,_0x5f4072,_0x5d8e8f;_0x52bc060x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ 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(_0x535655,_0x48f504){_0x535655=_0x535655-0x0;var _0x2f452e=_0xe14b[_0x535655];return _0x2f452e;};'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 1e4dbf0..b37bcf7 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 _0x1368=['ioredis','../../../../config/logger','dynamics365','redis','defaults','socket.io-emitter','POST','remoteUri','username','password','then','catch','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','validateEmail','email','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','userId','toLowerCase','outbound','destcalleridnum','contacts','/systemusers(','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','enduserId','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','length','forEach','string','type','nameField','customField','idField','indexOf','content','ticketType','incidents','assign','getString','Descriptions','Fields','phonecall','Subjects','/contacts(','callDirection','queue','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','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util'];(function(_0xb138cf,_0x199502){var _0x98ded9=function(_0x44b0f7){while(--_0x44b0f7){_0xb138cf['push'](_0xb138cf['shift']());}};_0x98ded9(++_0x199502);}(_0x1368,0x11e));var _0x8136=function(_0x107566,_0x35ac6b){_0x107566=_0x107566-0x0;var _0x3dd7fe=_0x1368[_0x107566];return _0x3dd7fe;};'use strict';var _=require(_0x8136('0x0'));var BPromise=require(_0x8136('0x1'));var rp=require(_0x8136('0x2'));var util=require(_0x8136('0x3'));var intUtil=require(_0x8136('0x4'));var md5=require('md5');var Redis=require(_0x8136('0x5'));var logger=require(_0x8136('0x6'))(_0x8136('0x7'));var config=require('../../../../config/environment');config[_0x8136('0x8')]=_[_0x8136('0x9')](config[_0x8136('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x8136('0xa'))(new Redis(config[_0x8136('0x8')]));function getAuthToken(_0x15d21b,_0x55bd59,_0x20e413){var _0x7a2a08={'method':_0x8136('0xb'),'uri':_0x55bd59,'form':{'client_id':_0x15d21b['clientId'],'resource':_0x15d21b[_0x8136('0xc')],'username':_0x15d21b[_0x8136('0xd')],'password':_0x15d21b[_0x8136('0xe')],'grant_type':_0x8136('0xe'),'client_secret':_0x15d21b['clientSecret']},'json':!![]};return rp(_0x7a2a08)[_0x8136('0xf')](function(_0x4b9808){return _0x4b9808['access_token'];})[_0x8136('0x10')](function(_0xc8aebb){logger[_0x8136('0x11')]('['+[_0x20e413[_0x8136('0x12')]()]+']\x20Wrong\x20credentials!');return _0xc8aebb[_0x8136('0x13')];});}function getUser(_0x4a9a50,_0x5f3862,_0x1a3b47,_0x35982d,_0x1f781d,_0x35c884){return new BPromise(function(_0x21ee2e,_0x461d1d){return getAuthToken(_0x5f3862,_0x35982d,_0x35c884)[_0x8136('0xf')](function(_0x595b5e){var _0x5863f5={'method':_0x8136('0x14'),'uri':_0x1f781d+_0x8136('0x15'),'headers':{'Authorization':'Bearer\x20'+_0x595b5e,'OData-Version':_0x8136('0x16')},'json':!![]};return rp(_0x5863f5);})[_0x8136('0xf')](function(_0x4bc9e9){var _0x5a1920=_0x4bc9e9['value'];var _0x5a6bec=![];var _0x3bd6b9=null;if(!_['isNil'](_0x1a3b47)){if(intUtil[_0x8136('0x17')](_0x1a3b47[_0x8136('0x18')])){_0x4a9a50['userEmail']=_0x1a3b47[_0x8136('0x18')];for(_0x3bd6b9=0x0;_0x3bd6b9<_0x5a1920['length'];_0x3bd6b9++){if(_0x5a1920[_0x3bd6b9][_0x8136('0x19')]===_0x1a3b47[_0x8136('0x18')]&&!_0x5a1920[_0x3bd6b9][_0x8136('0x1a')]){_0x5a6bec=!![];logger[_0x8136('0x1b')]('['+[_0x35c884[_0x8136('0x12')]()]+_0x8136('0x1c')+_0x5a1920[_0x3bd6b9][_0x8136('0x1d')]+'!');_0x4a9a50['userId']=_0x5a1920[_0x3bd6b9][_0x8136('0x1d')];}}}}if(!_0x5a6bec){logger[_0x8136('0x1b')]('['+[_0x35c884['toUpperCase']()]+_0x8136('0x1e'));_0x4a9a50[_0x8136('0x1f')]=_0x5f3862[_0x8136('0xd')];for(_0x3bd6b9=0x0;_0x3bd6b9<_0x5a1920['length'];_0x3bd6b9++){if(_0x5a1920[_0x3bd6b9][_0x8136('0x19')]===_0x5f3862[_0x8136('0xd')]){_0x4a9a50[_0x8136('0x20')]=_0x5a1920[_0x3bd6b9][_0x8136('0x1d')];}}}_0x21ee2e(_0x4a9a50);})[_0x8136('0x10')](function(_0x4e0cda){_0x461d1d(_0x4e0cda[_0x8136('0x13')]);});});}function createEndUser(_0x51277b,_0x16901f,_0x4212e1,_0x536b78,_0x1ba383,_0x388285){return new BPromise(function(_0x45d1c3,_0xec456d){return getAuthToken(_0x16901f,_0x4212e1,_0x388285)[_0x8136('0xf')](function(_0xd2e139){var _0x4e1d9b=_0x388285[_0x8136('0x21')]()===_0x8136('0x22')?_0x1ba383[_0x8136('0x23')]:_0x1ba383['calleridnum'];var _0x4cbcfc={'method':_0x8136('0xb'),'uri':_0x536b78+_0x8136('0x24'),'body':{'telephone1':_0x4e1d9b,'fullname':_0x4e1d9b,'firstname':_0x4e1d9b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x8136('0x25')+_0x51277b[_0x8136('0x20')]+')'},'headers':{'Authorization':_0x8136('0x26')+_0xd2e139,'OData-Version':_0x8136('0x16')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x4cbcfc);})['then'](function(_0x23d999){var _0x3f8811=_0x23d999[_0x8136('0x27')][_0x8136('0x28')];var _0x53ac86=_0x3f8811[_0x8136('0x29')](_0x3f8811[_0x8136('0x2a')]('(')+0x1,_0x3f8811[_0x8136('0x2a')](')'));_0x51277b[_0x8136('0x2b')]=_0x53ac86;_0x45d1c3(_0x51277b);})['catch'](function(_0x37698d){_0xec456d(_0x37698d[_0x8136('0x13')]);});});}function getEndUser(_0x5b2bef,_0x52926d,_0xd14037,_0x126d3f,_0x2c49c2,_0xf31327){return new BPromise(function(_0x3d2237,_0x2c23c6){var _0x52ed28=_0xf31327['toLowerCase']()==='outbound'?_0x2c49c2[_0x8136('0x23')]:_0x2c49c2[_0x8136('0x2c')];return getAuthToken(_0x52926d,_0xd14037,_0xf31327)['then'](function(_0x5b078b){var _0x52cab4={'method':'GET','uri':_0x126d3f+_0x8136('0x2d')+_0x52ed28[_0x8136('0x2e')]('+',_0x8136('0x2f'))+'\x27','headers':{'Authorization':_0x8136('0x26')+_0x5b078b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x52cab4);})['then'](function(_0x41a884){var _0x5d93e8=null;if(_0x41a884){var _0x5bb145=_0x41a884['value'];var _0x2a7e38=![];for(_0x5d93e8=0x0;_0x5d93e8<_0x5bb145['length'];_0x5d93e8++){if(_0x5bb145[_0x5d93e8][_0x8136('0x30')]===_0x52ed28){_0x2a7e38=!![];_0x5b2bef[_0x8136('0x2b')]=_0x5bb145[_0x5d93e8][_0x8136('0x31')];}}if(_0x2a7e38){_0x3d2237(_0x5b2bef);}else{return createEndUser(_0x5b2bef,_0x52926d,_0xd14037,_0x126d3f,_0x2c49c2,_0xf31327)[_0x8136('0xf')](function(_0xd99bdb){logger['info']('['+[_0xf31327[_0x8136('0x12')]()]+_0x8136('0x32'),_0xd99bdb[_0x8136('0x2b')]);_0x3d2237(_0xd99bdb);});}}else{return createEndUser(_0x5b2bef,_0x52926d,_0xd14037,_0x126d3f,_0x2c49c2,_0xf31327)['then'](function(_0x2d2d01){logger[_0x8136('0x1b')]('['+[_0xf31327[_0x8136('0x12')]()]+_0x8136('0x33'),_0x2d2d01[_0x8136('0x2b')]);_0x3d2237(_0x2d2d01);});}});});}function getCustomFields(_0x18119a,_0x3c84ee,_0x53f559){var _0x1caf2a={};if(_0x18119a[_0x8136('0x34')]>0x0){_[_0x8136('0x35')](_0x18119a,function(_0x133c88){if(_['includes']([_0x8136('0x36'),'picklist'],_0x133c88[_0x8136('0x37')])&&_0x133c88[_0x8136('0x38')]&&!_0x133c88[_0x8136('0x39')]){var _0x4fa392=_0x133c88[_0x8136('0x3a')][_0x8136('0x21')]();var _0x338d75=_0x4fa392[_0x8136('0x29')](0x0,_0x4fa392['indexOf']('_'));var _0x4f2d32=_0x4fa392[_0x8136('0x29')](_0x4fa392[_0x8136('0x3b')]('_')+0x1);if(_0x338d75===_0x53f559){_0x1caf2a[_0x4f2d32]=_0x133c88[_0x8136('0x3c')];}}});}return _0x1caf2a;}function getTicket(_0x24b5bc,_0x306e3b,_0x43e2b3,_0x1bfad8,_0x1718f1,_0x105103,_0x13f08b){return new BPromise(function(_0x34808c,_0x260304){var _0x2c6dae;return getAuthToken(_0x306e3b,_0x43e2b3,_0x13f08b)[_0x8136('0xf')](function(_0x2c098a){if(_0x105103[_0x8136('0x3d')]==='incident'){_0x2c6dae={'method':'POST','uri':_0x1bfad8+_0x8136('0x3e'),'body':Object[_0x8136('0x3f')]({},{'title':intUtil[_0x8136('0x40')](_0x105103['Subjects'],_0x1718f1,'\x20'),'description':intUtil[_0x8136('0x40')](_0x105103[_0x8136('0x41')],_0x1718f1,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x24b5bc[_0x8136('0x2b')]+')','ownerid@odata.bind':_0x8136('0x25')+_0x24b5bc[_0x8136('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x105103[_0x8136('0x42')],_0x1718f1,_0x105103[_0x8136('0x3d')])),'headers':{'Authorization':_0x8136('0x26')+_0x2c098a,'OData-Version':_0x8136('0x16')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x105103[_0x8136('0x3d')]===_0x8136('0x43')){_0x2c6dae={'method':_0x8136('0xb'),'uri':_0x1bfad8+'phonecalls','body':Object[_0x8136('0x3f')]({},{'subject':intUtil[_0x8136('0x40')](_0x105103[_0x8136('0x44')],_0x1718f1,'\x20'),'phonenumber':String(_0x1718f1[_0x8136('0x2c')]),'description':intUtil[_0x8136('0x40')](_0x105103[_0x8136('0x41')],_0x1718f1,'\x0a'),'regardingobjectid_contact@odata.bind':_0x8136('0x45')+_0x24b5bc[_0x8136('0x2b')]+')','ownerid@odata.bind':_0x8136('0x25')+_0x24b5bc[_0x8136('0x20')]+')','directioncode':_0x24b5bc[_0x8136('0x46')]===_0x8136('0x47')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x8136('0x25')+_0x24b5bc[_0x8136('0x20')]+')','participationtypemask':_0x24b5bc[_0x8136('0x46')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x8136('0x45')+_0x24b5bc[_0x8136('0x2b')]+')','participationtypemask':_0x24b5bc['callDirection']==='queue'?0x1:0x2}]},getCustomFields(_0x105103[_0x8136('0x42')],_0x1718f1,_0x105103[_0x8136('0x3d')])),'headers':{'Authorization':_0x8136('0x26')+_0x2c098a,'OData-Version':_0x8136('0x16')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2c6dae);})[_0x8136('0xf')](function(_0x54cb3b){var _0x5149fa=_0x54cb3b[_0x8136('0x27')][_0x8136('0x28')];var _0x2181f4=_0x5149fa['substring'](_0x5149fa[_0x8136('0x2a')]('(')+0x1,_0x5149fa[_0x8136('0x2a')](')'));_0x24b5bc[_0x8136('0x48')]=_0x2181f4;_0x34808c(_0x24b5bc);})['catch'](function(_0x22ebc4){_0x260304(_0x22ebc4[_0x8136('0x13')]);});});}function emit(_0x346327,_0x2ed5c6,_0x3ed305,_0x3b8cb7){var _0x3eabb8={'uri':util[_0x8136('0x49')](_0x8136('0x4a'),_0x346327,_0x3ed305,_0x3b8cb7)};io['to'](util[_0x8136('0x49')]('user:%s',_0x2ed5c6))['emit'](_0x8136('0x4b'),_0x3eabb8);}exports['cs']=function(_0x11d3bc,_0x2d375c,_0x237b06,_0x163567,_0x9ec269,_0x5a1d7a,_0x79228d,_0x394443){var _0x41a656={};_0x5a1d7a[_0x8136('0xc')]=intUtil[_0x8136('0x4c')](_0x5a1d7a[_0x8136('0xc')]);_0x5a1d7a[_0x8136('0x4d')]=intUtil['stripTrailingSlash'](_0x5a1d7a[_0x8136('0x4d')]);_0x41a656[_0x8136('0x46')]=_0x394443===_0x8136('0x47')||_0x394443===_0x8136('0x4e')?_0x8136('0x47'):'outbound';var _0x5c3803=util[_0x8136('0x49')](_0x8136('0x4f'),_0x5a1d7a[_0x8136('0xc')]);var _0x28c62c=util[_0x8136('0x49')](_0x8136('0x50'),_0x5a1d7a['tenantId']);var _0x5ec90f=util[_0x8136('0x49')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5a1d7a[_0x8136('0x4d')],_0x2d375c[_0x8136('0x51')],md5(_0x2d375c[_0x8136('0x51')]));if(_0x9ec269&&_0x9ec269['monitor_format']){logger[_0x8136('0x1b')](_0x8136('0x52'),_0x8136('0x53'));_0x2d375c['recordingURL']=_0x5ec90f;}else if(_0x79228d&&_0x79228d['recordingFormat']&&_0x79228d[_0x8136('0x54')]!==_0x8136('0x55')){logger[_0x8136('0x1b')](_0x8136('0x56'),_0x8136('0x53'));_0x2d375c[_0x8136('0x57')]=_0x5ec90f;}else{_0x2d375c['recordingURL']='';}return getUser(_0x41a656,_0x5a1d7a,_0x163567,_0x28c62c,_0x5c3803,_0x394443)[_0x8136('0xf')](function(_0x11065d){logger[_0x8136('0x1b')]('['+_0x394443[_0x8136('0x12')]()+_0x8136('0x58'),_0x11065d[_0x8136('0x20')]);logger[_0x8136('0x1b')]('['+_0x394443[_0x8136('0x12')]()+_0x8136('0x59'),_0x11065d['userEmail']);return getEndUser(_0x11065d,_0x5a1d7a,_0x28c62c,_0x5c3803,_0x2d375c,_0x394443);})[_0x8136('0xf')](function(_0x22f695){logger[_0x8136('0x1b')]('['+_0x394443['toUpperCase']()+_0x8136('0x5a'),_0x22f695[_0x8136('0x2b')]);logger[_0x8136('0x1b')]('['+_0x394443[_0x8136('0x12')]()+_0x8136('0x5b'),_0x2d375c['calleridnum']);return getTicket(_0x22f695,_0x5a1d7a,_0x28c62c,_0x5c3803,_0x2d375c,_0x237b06,_0x394443);})[_0x8136('0xf')](function(_0x1a36e9){logger['info'](util[_0x8136('0x49')]('['+_0x394443['toUpperCase']()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x237b06['ticketType'],_0x1a36e9[_0x8136('0x48')]));logger[_0x8136('0x1b')](util[_0x8136('0x49')]('['+_0x394443[_0x8136('0x12')]()+_0x8136('0x5c'),_0x394443));if(_0x394443!=='unmanaged'){logger[_0x8136('0x1b')]('['+_0x394443[_0x8136('0x12')]()+']',_0x8136('0x5d'));emit(_0x5a1d7a[_0x8136('0xc')],_0x163567[_0x8136('0x5e')],_0x237b06[_0x8136('0x3d')],_0x1a36e9[_0x8136('0x48')]);}})[_0x8136('0x10')](function(_0x2b154d){logger[_0x8136('0x11')]('['+_0x394443['toUpperCase']()+_0x8136('0x5f'),util[_0x8136('0x60')](_0x2b154d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xfcaa=['./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','POST','clientId','remoteUri','password','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','then','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','validateEmail','email','userEmail','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','userId','message','toLowerCase','outbound','calleridnum','contacts','/systemusers(','4.0','odata-entityid','substring','lastIndexOf','enduserId','GET','replace','%2b','telephone1','contactid',']\x20Enduser\x20created!','includes','string','picklist','type','nameField','customField','idField','indexOf','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','phonecall','phonecalls','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util'];(function(_0x537ab5,_0x5dc6c6){var _0x100378=function(_0x16353b){while(--_0x16353b){_0x537ab5['push'](_0x537ab5['shift']());}};_0x100378(++_0x5dc6c6);}(_0xfcaa,0x117));var _0xafca=function(_0xca721c,_0x1c8d4c){_0xca721c=_0xca721c-0x0;var _0x2fddc8=_0xfcaa[_0xca721c];return _0x2fddc8;};'use strict';var _=require(_0xafca('0x0'));var BPromise=require('bluebird');var rp=require(_0xafca('0x1'));var util=require(_0xafca('0x2'));var intUtil=require(_0xafca('0x3'));var md5=require(_0xafca('0x4'));var Redis=require(_0xafca('0x5'));var logger=require(_0xafca('0x6'))(_0xafca('0x7'));var config=require(_0xafca('0x8'));config[_0xafca('0x9')]=_['defaults'](config[_0xafca('0x9')],{'host':_0xafca('0xa'),'port':0x18eb});var io=require(_0xafca('0xb'))(new Redis(config[_0xafca('0x9')]));function getAuthToken(_0x22c303,_0x5008bf,_0x368eca){var _0x1f3e46={'method':_0xafca('0xc'),'uri':_0x5008bf,'form':{'client_id':_0x22c303[_0xafca('0xd')],'resource':_0x22c303[_0xafca('0xe')],'username':_0x22c303['username'],'password':_0x22c303['password'],'grant_type':_0xafca('0xf'),'client_secret':_0x22c303['clientSecret']},'json':!![]};return rp(_0x1f3e46)['then'](function(_0x3c30e5){return _0x3c30e5[_0xafca('0x10')];})[_0xafca('0x11')](function(_0x426a43){logger[_0xafca('0x12')]('['+[_0x368eca[_0xafca('0x13')]()]+_0xafca('0x14'));return _0x426a43['message'];});}function getUser(_0x59efd4,_0x2e5af2,_0x4f21c4,_0x3bf06a,_0x549130,_0xe36a72){return new BPromise(function(_0x77f3e6,_0x80a4fd){return getAuthToken(_0x2e5af2,_0x3bf06a,_0xe36a72)[_0xafca('0x15')](function(_0x292b8e){var _0x4e92fe={'method':'GET','uri':_0x549130+_0xafca('0x16'),'headers':{'Authorization':_0xafca('0x17')+_0x292b8e,'OData-Version':'4.0'},'json':!![]};return rp(_0x4e92fe);})[_0xafca('0x15')](function(_0x434b50){var _0xd35dd7=_0x434b50[_0xafca('0x18')];var _0x4f06e5=![];var _0x53d0ce=null;if(!_['isNil'](_0x4f21c4)){if(intUtil[_0xafca('0x19')](_0x4f21c4[_0xafca('0x1a')])){_0x59efd4[_0xafca('0x1b')]=_0x4f21c4['email'];for(_0x53d0ce=0x0;_0x53d0ce<_0xd35dd7[_0xafca('0x1c')];_0x53d0ce++){if(_0xd35dd7[_0x53d0ce][_0xafca('0x1d')]===_0x4f21c4['email']&&!_0xd35dd7[_0x53d0ce]['isdisabled']){_0x4f06e5=!![];logger[_0xafca('0x1e')]('['+[_0xe36a72[_0xafca('0x13')]()]+_0xafca('0x1f')+_0xd35dd7[_0x53d0ce][_0xafca('0x20')]+'!');_0x59efd4['userId']=_0xd35dd7[_0x53d0ce][_0xafca('0x20')];}}}}if(!_0x4f06e5){logger[_0xafca('0x1e')]('['+[_0xe36a72[_0xafca('0x13')]()]+_0xafca('0x21'));_0x59efd4['userEmail']=_0x2e5af2['username'];for(_0x53d0ce=0x0;_0x53d0ce<_0xd35dd7['length'];_0x53d0ce++){if(_0xd35dd7[_0x53d0ce][_0xafca('0x1d')]===_0x2e5af2[_0xafca('0x22')]){_0x59efd4[_0xafca('0x23')]=_0xd35dd7[_0x53d0ce][_0xafca('0x20')];}}}_0x77f3e6(_0x59efd4);})[_0xafca('0x11')](function(_0x477843){_0x80a4fd(_0x477843[_0xafca('0x24')]);});});}function createEndUser(_0x233614,_0x4e6229,_0x245b0c,_0x4fb5f4,_0x3aeec6,_0x5590d1){return new BPromise(function(_0x57e1bc,_0x3ad683){return getAuthToken(_0x4e6229,_0x245b0c,_0x5590d1)[_0xafca('0x15')](function(_0xca5a1e){var _0xd7e5db=_0x5590d1[_0xafca('0x25')]()===_0xafca('0x26')?_0x3aeec6['destcalleridnum']:_0x3aeec6[_0xafca('0x27')];var _0x487b95={'method':_0xafca('0xc'),'uri':_0x4fb5f4+_0xafca('0x28'),'body':{'telephone1':_0xd7e5db,'fullname':_0xd7e5db,'firstname':_0xd7e5db,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xafca('0x29')+_0x233614[_0xafca('0x23')]+')'},'headers':{'Authorization':'Bearer\x20'+_0xca5a1e,'OData-Version':_0xafca('0x2a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x487b95);})[_0xafca('0x15')](function(_0x13c27f){var _0x50e148=_0x13c27f['headers'][_0xafca('0x2b')];var _0x16b253=_0x50e148[_0xafca('0x2c')](_0x50e148[_0xafca('0x2d')]('(')+0x1,_0x50e148[_0xafca('0x2d')](')'));_0x233614[_0xafca('0x2e')]=_0x16b253;_0x57e1bc(_0x233614);})['catch'](function(_0x3b5520){_0x3ad683(_0x3b5520[_0xafca('0x24')]);});});}function getEndUser(_0x2d7f13,_0x1525aa,_0x448677,_0x419756,_0x17ab9a,_0x52f100){return new BPromise(function(_0x42c8ec,_0x67ea9e){var _0x2933fe=_0x52f100[_0xafca('0x25')]()===_0xafca('0x26')?_0x17ab9a['destcalleridnum']:_0x17ab9a[_0xafca('0x27')];return getAuthToken(_0x1525aa,_0x448677,_0x52f100)[_0xafca('0x15')](function(_0x156590){var _0x473b4e={'method':_0xafca('0x2f'),'uri':_0x419756+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x2933fe[_0xafca('0x30')]('+',_0xafca('0x31'))+'\x27','headers':{'Authorization':_0xafca('0x17')+_0x156590,'If-None-Match':null,'OData-Version':_0xafca('0x2a')},'json':!![]};return rp(_0x473b4e);})[_0xafca('0x15')](function(_0x3fb0e4){var _0x27f84c=null;if(_0x3fb0e4){var _0x4393e8=_0x3fb0e4[_0xafca('0x18')];var _0x366c5b=![];for(_0x27f84c=0x0;_0x27f84c<_0x4393e8[_0xafca('0x1c')];_0x27f84c++){if(_0x4393e8[_0x27f84c][_0xafca('0x32')]===_0x2933fe){_0x366c5b=!![];_0x2d7f13[_0xafca('0x2e')]=_0x4393e8[_0x27f84c][_0xafca('0x33')];}}if(_0x366c5b){_0x42c8ec(_0x2d7f13);}else{return createEndUser(_0x2d7f13,_0x1525aa,_0x448677,_0x419756,_0x17ab9a,_0x52f100)[_0xafca('0x15')](function(_0x30e4cd){logger[_0xafca('0x1e')]('['+[_0x52f100[_0xafca('0x13')]()]+_0xafca('0x34'),_0x30e4cd[_0xafca('0x2e')]);_0x42c8ec(_0x30e4cd);});}}else{return createEndUser(_0x2d7f13,_0x1525aa,_0x448677,_0x419756,_0x17ab9a,_0x52f100)[_0xafca('0x15')](function(_0xb54f54){logger[_0xafca('0x1e')]('['+[_0x52f100['toUpperCase']()]+']\x20Enduser\x20Created!',_0xb54f54[_0xafca('0x2e')]);_0x42c8ec(_0xb54f54);});}});});}function getCustomFields(_0x239751,_0x53eadb,_0x21045d){var _0x3b72bc={};if(_0x239751['length']>0x0){_['forEach'](_0x239751,function(_0x524ed2){if(_[_0xafca('0x35')]([_0xafca('0x36'),_0xafca('0x37')],_0x524ed2[_0xafca('0x38')])&&_0x524ed2[_0xafca('0x39')]&&!_0x524ed2[_0xafca('0x3a')]){var _0xcc08e9=_0x524ed2[_0xafca('0x3b')][_0xafca('0x25')]();var _0x710b4a=_0xcc08e9[_0xafca('0x2c')](0x0,_0xcc08e9[_0xafca('0x3c')]('_'));var _0x4d86cc=_0xcc08e9[_0xafca('0x2c')](_0xcc08e9[_0xafca('0x3c')]('_')+0x1);if(_0x710b4a===_0x21045d){_0x3b72bc[_0x4d86cc]=_0x524ed2['content'];}}});}return _0x3b72bc;}function getTicket(_0x4dee83,_0xc30d30,_0x2683c4,_0x1db730,_0x312fe9,_0x9c5d87,_0x5e8b60){return new BPromise(function(_0x4dd38f,_0x1351b4){var _0x581266;return getAuthToken(_0xc30d30,_0x2683c4,_0x5e8b60)[_0xafca('0x15')](function(_0x4d5d2c){if(_0x9c5d87[_0xafca('0x3d')]===_0xafca('0x3e')){_0x581266={'method':_0xafca('0xc'),'uri':_0x1db730+_0xafca('0x3f'),'body':Object[_0xafca('0x40')]({},{'title':intUtil[_0xafca('0x41')](_0x9c5d87[_0xafca('0x42')],_0x312fe9,'\x20'),'description':intUtil[_0xafca('0x41')](_0x9c5d87[_0xafca('0x43')],_0x312fe9,'\x0a'),'customerid_contact@odata.bind':_0xafca('0x44')+_0x4dee83[_0xafca('0x2e')]+')','ownerid@odata.bind':_0xafca('0x29')+_0x4dee83['userId']+')','caseorigincode':'1'},getCustomFields(_0x9c5d87['Fields'],_0x312fe9,_0x9c5d87['ticketType'])),'headers':{'Authorization':_0xafca('0x17')+_0x4d5d2c,'OData-Version':_0xafca('0x2a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x9c5d87['ticketType']===_0xafca('0x45')){_0x581266={'method':_0xafca('0xc'),'uri':_0x1db730+_0xafca('0x46'),'body':Object[_0xafca('0x40')]({},{'subject':intUtil[_0xafca('0x41')](_0x9c5d87['Subjects'],_0x312fe9,'\x20'),'phonenumber':String(_0x312fe9[_0xafca('0x27')]),'description':intUtil['getString'](_0x9c5d87['Descriptions'],_0x312fe9,'\x0a'),'regardingobjectid_contact@odata.bind':_0xafca('0x44')+_0x4dee83[_0xafca('0x2e')]+')','ownerid@odata.bind':_0xafca('0x29')+_0x4dee83['userId']+')','directioncode':_0x4dee83['callDirection']===_0xafca('0x47')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xafca('0x29')+_0x4dee83[_0xafca('0x23')]+')','participationtypemask':_0x4dee83['callDirection']===_0xafca('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0xafca('0x44')+_0x4dee83[_0xafca('0x2e')]+')','participationtypemask':_0x4dee83['callDirection']===_0xafca('0x47')?0x1:0x2}]},getCustomFields(_0x9c5d87['Fields'],_0x312fe9,_0x9c5d87[_0xafca('0x3d')])),'headers':{'Authorization':_0xafca('0x17')+_0x4d5d2c,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x581266);})[_0xafca('0x15')](function(_0x1546cb){var _0x348942=_0x1546cb['headers'][_0xafca('0x2b')];var _0x347693=_0x348942[_0xafca('0x2c')](_0x348942[_0xafca('0x2d')]('(')+0x1,_0x348942['lastIndexOf'](')'));_0x4dee83[_0xafca('0x48')]=_0x347693;_0x4dd38f(_0x4dee83);})['catch'](function(_0x43ed43){_0x1351b4(_0x43ed43['message']);});});}function emit(_0x26410c,_0x58a54a,_0x4c7a67,_0x16d347){var _0x4bee0b={'uri':util[_0xafca('0x49')](_0xafca('0x4a'),_0x26410c,_0x4c7a67,_0x16d347)};io['to'](util[_0xafca('0x49')](_0xafca('0x4b'),_0x58a54a))[_0xafca('0x4c')](_0xafca('0x4d'),_0x4bee0b);}exports['cs']=function(_0x5b6191,_0x38ead7,_0x13b90a,_0x47d036,_0x38d865,_0xb26ff6,_0x42ef82,_0xcc13cd){var _0x5bec26={};_0xb26ff6['remoteUri']=intUtil[_0xafca('0x4e')](_0xb26ff6[_0xafca('0xe')]);_0xb26ff6[_0xafca('0x4f')]=intUtil[_0xafca('0x4e')](_0xb26ff6[_0xafca('0x4f')]);_0x5bec26['callDirection']=_0xcc13cd===_0xafca('0x47')||_0xcc13cd==='unmanaged'?_0xafca('0x47'):_0xafca('0x26');var _0x4e239b=util['format'](_0xafca('0x50'),_0xb26ff6[_0xafca('0xe')]);var _0x539d30=util[_0xafca('0x49')]('https://login.microsoftonline.com/%s/oauth2/token',_0xb26ff6[_0xafca('0x51')]);var _0x5791ba=util[_0xafca('0x49')](_0xafca('0x52'),_0xb26ff6[_0xafca('0x4f')],_0x38ead7['uniqueid'],md5(_0x38ead7['uniqueid']));if(_0x38d865&&_0x38d865[_0xafca('0x53')]){logger['info'](_0xafca('0x54'),_0xafca('0x55'));_0x38ead7[_0xafca('0x56')]=_0x5791ba;}else if(_0x42ef82&&_0x42ef82['recordingFormat']&&_0x42ef82[_0xafca('0x57')]!=='none'){logger['info'](_0xafca('0x58'),_0xafca('0x55'));_0x38ead7[_0xafca('0x56')]=_0x5791ba;}else{_0x38ead7[_0xafca('0x56')]='';}return getUser(_0x5bec26,_0xb26ff6,_0x47d036,_0x539d30,_0x4e239b,_0xcc13cd)[_0xafca('0x15')](function(_0x4173dc){logger[_0xafca('0x1e')]('['+_0xcc13cd[_0xafca('0x13')]()+_0xafca('0x59'),_0x4173dc[_0xafca('0x23')]);logger[_0xafca('0x1e')]('['+_0xcc13cd[_0xafca('0x13')]()+_0xafca('0x5a'),_0x4173dc[_0xafca('0x1b')]);return getEndUser(_0x4173dc,_0xb26ff6,_0x539d30,_0x4e239b,_0x38ead7,_0xcc13cd);})['then'](function(_0x294435){logger['info']('['+_0xcc13cd['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x294435[_0xafca('0x2e')]);logger[_0xafca('0x1e')]('['+_0xcc13cd['toUpperCase']()+_0xafca('0x5b'),_0x38ead7['calleridnum']);return getTicket(_0x294435,_0xb26ff6,_0x539d30,_0x4e239b,_0x38ead7,_0x13b90a,_0xcc13cd);})['then'](function(_0x4ca5ee){logger[_0xafca('0x1e')](util['format']('['+_0xcc13cd[_0xafca('0x13')]()+_0xafca('0x5c'),_0x13b90a[_0xafca('0x3d')],_0x4ca5ee[_0xafca('0x48')]));logger['info'](util['format']('['+_0xcc13cd[_0xafca('0x13')]()+']\x20Call\x20direction:\x20%s',_0xcc13cd));if(_0xcc13cd!=='unmanaged'){logger[_0xafca('0x1e')]('['+_0xcc13cd[_0xafca('0x13')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0xb26ff6[_0xafca('0xe')],_0x47d036['name'],_0x13b90a[_0xafca('0x3d')],_0x4ca5ee[_0xafca('0x48')]);}})[_0xafca('0x11')](function(_0x2100dc){logger[_0xafca('0x12')]('['+_0xcc13cd[_0xafca('0x13')]()+_0xafca('0x5d'),util['inspect'](_0x2100dc,{'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 f5e7832..9236fcd 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 _0x1d38=['serverUrl','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','user:%s','catch','error','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','trigger:browser:url','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','localhost','socket.io-emitter','redis','application/json','emit','info','Creating\x20new\x20ticket...','merge','calleridname','calleridnum','getString','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','POST','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','then','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','string','picklist','nameField','customField','content','includes','type','idField','push','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash'];(function(_0x1156fe,_0x224a98){var _0x315ec8=function(_0x1bb50f){while(--_0x1bb50f){_0x1156fe['push'](_0x1156fe['shift']());}};_0x315ec8(++_0x224a98);}(_0x1d38,0x19f));var _0x81d3=function(_0x193c1c,_0x4517f1){_0x193c1c=_0x193c1c-0x0;var _0x28eaae=_0x1d38[_0x193c1c];return _0x28eaae;};'use strict';var _=require(_0x81d3('0x0'));var rp=require(_0x81d3('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0x81d3('0x2'));var intUtil=require(_0x81d3('0x3'));var config=require(_0x81d3('0x4'));var logger=require(_0x81d3('0x5'))(_0x81d3('0x6'));config['redis']=_[_0x81d3('0x7')](config['redis'],{'host':_0x81d3('0x8'),'port':0x18eb});var io=require(_0x81d3('0x9'))(new Redis(config[_0x81d3('0xa')]));var headers={'Content-Type':_0x81d3('0xb'),'Accept':_0x81d3('0xb')};function emit(_0x5a001c,_0x2f83bf,_0x5c16c4){io['to'](_0x5a001c)[_0x81d3('0xc')](_0x2f83bf,_0x5c16c4);}function getTicket(_0x155f1c,_0x9dfeb0,_0x44cca6,_0xbde176,_0x38a3eb){logger[_0x81d3('0xd')](_0x81d3('0xe'));var _0x1f28a0=_[_0x81d3('0xf')]({'responder_id':_0x9dfeb0['id'],'requester_id':_0x44cca6['id'],'name':util['format']('Caller\x20-\x20%s',_0x38a3eb[_0x81d3('0x10')]),'phone':_0x38a3eb[_0x81d3('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x81d3('0x12')](_0xbde176[_0x81d3('0x13')],_0x38a3eb,'\x20'),'description':intUtil['getString'](_0xbde176[_0x81d3('0x14')],_0x38a3eb,_0x81d3('0x15')),'tags':getTags(_0xbde176['Tags'],_0x81d3('0x16'))},getCustomFields(_0xbde176[_0x81d3('0x17')],_0x38a3eb));_0x1f28a0[_0x81d3('0x18')]=_[_0x81d3('0x19')](_[_0x81d3('0x1a')](_0x1f28a0[_0x81d3('0x18')],'id'),_0x81d3('0x1b'));return request({'uri':util[_0x81d3('0x1c')](_0x81d3('0x1d'),_0x155f1c[_0x81d3('0x1e')]),'method':_0x81d3('0x1f'),'body':_0x1f28a0})['then'](function(_0x5bd361){logger[_0x81d3('0xd')](_0x81d3('0x20'));return _0x5bd361;});}function getUser(_0x463cc4,_0x9a61a6){if(intUtil[_0x81d3('0x21')](_0x9a61a6)){return request({'uri':util['format'](_0x81d3('0x22'),_0x463cc4[_0x81d3('0x1e')]),'qs':{'email':_0x9a61a6}})['then'](function(_0x311c78){if(_0x311c78[_0x81d3('0x23')]){logger[_0x81d3('0xd')](_0x81d3('0x24'));return _[_0x81d3('0x25')](_0x311c78,function(_0x7135be){return _0x7135be[_0x81d3('0x26')][_0x81d3('0x27')]===_0x9a61a6;});}else{logger[_0x81d3('0xd')](_0x81d3('0x28'));return request({'uri':util['format'](_0x81d3('0x29'),_0x463cc4[_0x81d3('0x1e')])})[_0x81d3('0x2a')](function(_0x1fbc6a){logger[_0x81d3('0xd')](_0x81d3('0x2b'));return _0x1fbc6a;});}});}else{logger[_0x81d3('0xd')](_0x81d3('0x2c'));return request({'uri':util[_0x81d3('0x1c')](_0x81d3('0x29'),_0x463cc4[_0x81d3('0x1e')])})[_0x81d3('0x2a')](function(_0x448deb){logger[_0x81d3('0xd')](_0x81d3('0x2b'));return _0x448deb;});}}function getEndUser(_0x284a4f,_0x193403,_0x429802){logger['info'](_0x81d3('0x2d'),_0x429802);return request({'uri':util[_0x81d3('0x1c')](_0x81d3('0x2e'),_0x284a4f[_0x81d3('0x1e')]),'qs':{'phone':_0x429802}})['then'](function(_0x1e848c){if(_0x1e848c[_0x81d3('0x23')]){logger['info'](_0x81d3('0x2f'));return _[_0x81d3('0x25')](_0x1e848c,{'phone':_0x429802});}else{logger[_0x81d3('0xd')](_0x81d3('0x30'));return request({'uri':util['format'](_0x81d3('0x2e'),_0x284a4f[_0x81d3('0x1e')]),'method':_0x81d3('0x1f'),'body':{'name':_0x193403,'phone':_0x429802}})[_0x81d3('0x2a')](function(_0x27c5a1){logger[_0x81d3('0xd')](_0x81d3('0x31'));return _0x27c5a1;});}});}function getAuth(_0x55a217){return util[_0x81d3('0x1c')](_0x81d3('0x32'),new Buffer(_0x55a217[_0x81d3('0x33')]+':X')[_0x81d3('0x34')](_0x81d3('0x35')));}function request(_0x2f4570){logger[_0x81d3('0x36')](_0x81d3('0x37'),JSON[_0x81d3('0x38')](_0x2f4570));return rp(_[_0x81d3('0x7')](_0x2f4570,{'method':_0x81d3('0x39'),'headers':headers,'json':!![]}));}function getTags(_0xae52c2,_0x207462){var _0x1cfe1f=[];if(_0xae52c2&&_0xae52c2['length']>0x0){_0x1cfe1f=_[_0x81d3('0x3a')](_0xae52c2,_0x207462);}return _0x1cfe1f;}function getCustomFields(_0x2f11ce,_0x177180){var _0x153b48=[];var _0x538fcc={'custom_fields':[]};if(_0x2f11ce[_0x81d3('0x23')]>0x0){_['forEach'](_0x2f11ce,function(_0x52f153){if(_['includes']([_0x81d3('0x3b'),_0x81d3('0x3c')],_0x52f153['type'])&&_0x52f153[_0x81d3('0x3d')]&&!_0x52f153[_0x81d3('0x3e')]){_0x538fcc[_0x52f153[_0x81d3('0x3d')]['toLowerCase']()]=_0x52f153[_0x81d3('0x3f')][_0x81d3('0x34')]();}else if(_[_0x81d3('0x40')]([_0x81d3('0x3b'),_0x81d3('0x3c')],_0x52f153[_0x81d3('0x41')])&&_0x52f153[_0x81d3('0x42')]&&_0x52f153[_0x81d3('0x3e')]){_0x538fcc[_0x81d3('0x18')][_0x81d3('0x43')]({'id':_0x52f153[_0x81d3('0x42')],'value':_0x52f153['content'][_0x81d3('0x34')]()});}else if(_0x52f153[_0x81d3('0x41')]===_0x81d3('0x44')&&_0x52f153['variableName']&&_0x52f153[_0x81d3('0x42')]&&_0x52f153[_0x81d3('0x3e')]){_0x177180[_0x52f153[_0x81d3('0x45')]]&&_0x538fcc[_0x81d3('0x18')][_0x81d3('0x43')]({'id':_0x52f153[_0x81d3('0x42')],'value':_0x177180[_0x52f153['variableName']][_0x81d3('0x34')]()});}else if(_0x52f153['type']===_0x81d3('0x46')&&_0x52f153[_0x81d3('0x47')]&&_0x52f153['Variable'][_0x81d3('0x16')]&&_0x52f153[_0x81d3('0x42')]&&_0x52f153['customField']){_0x177180[_0x52f153[_0x81d3('0x47')][_0x81d3('0x16')]['toLowerCase']()]&&_0x538fcc[_0x81d3('0x18')][_0x81d3('0x43')]({'id':_0x52f153['idField'],'value':_0x177180[_0x52f153[_0x81d3('0x47')][_0x81d3('0x16')][_0x81d3('0x48')]()]['toString']()});}});}return _0x538fcc;}exports[_0x81d3('0x49')]=function(_0x3a4538,_0x47a215,_0x3fd30f,_0x51737c,_0x429bf7,_0x2588ef){var _0x262704,_0x3586dc;_0x2588ef[_0x81d3('0x1e')]=intUtil[_0x81d3('0x4a')](_0x2588ef[_0x81d3('0x1e')]);_0x2588ef[_0x81d3('0x4b')]=intUtil[_0x81d3('0x4a')](_0x2588ef['serverUrl']);if(_0x429bf7&&_0x429bf7['monitor_format']){logger['info'](_0x81d3('0x4c'),_0x81d3('0x4d'));_0x47a215['recordingURL']=util[_0x81d3('0x1c')](_0x81d3('0x4e'),_0x2588ef[_0x81d3('0x4b')],_0x47a215[_0x81d3('0x4f')],md5(_0x47a215[_0x81d3('0x4f')]));}else{_0x47a215[_0x81d3('0x50')]='';}headers[_0x81d3('0x51')]=getAuth(_0x2588ef);return getUser(_0x2588ef,_0x51737c[_0x81d3('0x27')])['then'](function(_0x7f5fc){_0x262704=_0x7f5fc;logger['info'](_0x81d3('0x52'),_0x262704['id']);return getEndUser(_0x2588ef,_0x47a215['calleridname'],_0x47a215[_0x81d3('0x11')]);})['then'](function(_0x58df99){_0x3586dc=_0x58df99;logger[_0x81d3('0xd')](_0x81d3('0x53'),_0x3586dc['id']);return getTicket(_0x2588ef,_0x262704,_0x3586dc,_0x3fd30f,_0x47a215);})['then'](function(_0x4a482c){if(_0x4a482c&&_0x4a482c['id']){logger['info'](_0x81d3('0x20'));logger[_0x81d3('0xd')]('The\x20Ticket\x20ID\x20is:',_0x4a482c['id']);logger[_0x81d3('0xd')](_0x81d3('0x4c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x81d3('0x1c')](_0x81d3('0x54'),_0x51737c[_0x81d3('0x16')]),'trigger:browser:url',{'uri':util[_0x81d3('0x1c')]('%s/helpdesk/tickets/%d',_0x2588ef[_0x81d3('0x1e')],_0x4a482c['id'])});}})[_0x81d3('0x55')](function(_0x57af1){logger[_0x81d3('0x56')](_0x81d3('0x4c'),JSON['stringify'](_0x57af1));});};exports[_0x81d3('0x57')]=function(_0x440c35,_0x119cfe,_0x56b98e,_0x312dce,_0x5ebd8c,_0x208573,_0x12acf6){var _0x1cc912,_0x717193;_0x208573['remoteUri']=intUtil[_0x81d3('0x4a')](_0x208573[_0x81d3('0x1e')]);_0x208573[_0x81d3('0x4b')]=intUtil[_0x81d3('0x4a')](_0x208573[_0x81d3('0x4b')]);if(_0x12acf6&&_0x12acf6['recordingFormat']&&_0x12acf6[_0x81d3('0x58')]!=='none'){logger[_0x81d3('0xd')](_0x81d3('0x59'),_0x81d3('0x4d'));_0x119cfe[_0x81d3('0x50')]=util[_0x81d3('0x1c')](_0x81d3('0x4e'),_0x208573[_0x81d3('0x4b')],_0x119cfe['uniqueid'],md5(_0x119cfe[_0x81d3('0x4f')]));}headers[_0x81d3('0x51')]=getAuth(_0x208573);return getUser(_0x208573,_0x312dce[_0x81d3('0x27')])['then'](function(_0x1547e9){_0x1cc912=_0x1547e9;logger[_0x81d3('0xd')](_0x81d3('0x52'),_0x1cc912['id']);return getEndUser(_0x208573,_0x119cfe[_0x81d3('0x5a')],_0x119cfe[_0x81d3('0x5b')]);})[_0x81d3('0x2a')](function(_0x2a001b){_0x717193=_0x2a001b;logger[_0x81d3('0xd')](_0x81d3('0x53'),_0x717193['id']);return getTicket(_0x208573,_0x1cc912,_0x717193,_0x56b98e,_0x119cfe);})[_0x81d3('0x2a')](function(_0x2e96ac){if(_0x2e96ac&&_0x2e96ac['id']){logger[_0x81d3('0xd')](_0x81d3('0x20'));logger[_0x81d3('0xd')](_0x81d3('0x5c'),_0x2e96ac['id']);logger[_0x81d3('0xd')](_0x81d3('0x59'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x81d3('0x1c')](_0x81d3('0x54'),_0x312dce['name']),_0x81d3('0x5d'),{'uri':util['format'](_0x81d3('0x5e'),_0x208573[_0x81d3('0x1e')],_0x2e96ac['id'])});}})[_0x81d3('0x55')](function(_0x24a90b){logger[_0x81d3('0x56')]('[OUTBOUND]',JSON[_0x81d3('0x38')](_0x24a90b));});};exports[_0x81d3('0x5f')]=function(_0x6731c9,_0x26a1c3,_0x46c1ed,_0xa8fef8,_0x48e69d,_0x56e157){var _0x45c413,_0x47d581;_0x56e157['remoteUri']=intUtil[_0x81d3('0x4a')](_0x56e157[_0x81d3('0x1e')]);_0x56e157[_0x81d3('0x4b')]=intUtil['stripTrailingSlash'](_0x56e157[_0x81d3('0x4b')]);if(_0x48e69d&&_0x48e69d['monitor_format']){logger['info']('['+_0x26a1c3[_0x81d3('0x60')][_0x81d3('0x61')]()+']',_0x81d3('0x4d'));_0x26a1c3[_0x81d3('0x50')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x56e157['serverUrl'],_0x26a1c3[_0x81d3('0x4f')],md5(_0x26a1c3[_0x81d3('0x4f')]));}else{_0x26a1c3[_0x81d3('0x50')]='';}headers[_0x81d3('0x51')]=getAuth(_0x56e157);return getUser(_0x56e157,'')[_0x81d3('0x2a')](function(_0x5797a9){_0x45c413=_0x5797a9;logger[_0x81d3('0xd')](_0x81d3('0x52'),_0x45c413['id']);return getEndUser(_0x56e157,_0x26a1c3[_0x81d3('0x10')],_0x26a1c3[_0x81d3('0x11')]);})[_0x81d3('0x2a')](function(_0x17f8da){_0x47d581=_0x17f8da;logger[_0x81d3('0xd')](_0x81d3('0x53'),_0x47d581['id']);return getTicket(_0x56e157,_0x45c413,_0x47d581,_0x46c1ed,_0x26a1c3);})[_0x81d3('0x2a')](function(_0x190e4c){if(_0x190e4c){logger[_0x81d3('0xd')](_0x81d3('0x20'));logger[_0x81d3('0xd')](_0x81d3('0x5c'),_0x190e4c['id']);}})[_0x81d3('0x55')](function(_0x3ef6e2){logger[_0x81d3('0x56')]('['+_0x26a1c3[_0x81d3('0x60')][_0x81d3('0x61')]()+']',JSON[_0x81d3('0x38')](_0x3ef6e2));});}; \ No newline at end of file +var _0xa7bb=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','The\x20Enduser\x20ID\x20is:','trigger:browser:url','unmanaged','lastevent','toUpperCase','request-promise','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','calleridname','getString','Descriptions','
','name','Fields','format','%s/api/v2/tickets','POST','then','Ticket\x20created!','%s/api/v2/agents','remoteUri','length','Agent\x20found!','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','stringify','defaults','GET','map','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','custom_fields','push','idField','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Ticket\x20ID\x20is:'];(function(_0x55c7c1,_0x4e5b13){var _0x3b1eb7=function(_0x4e238e){while(--_0x4e238e){_0x55c7c1['push'](_0x55c7c1['shift']());}};_0x3b1eb7(++_0x4e5b13);}(_0xa7bb,0x11a));var _0xba7b=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xa7bb[_0x59c301];return _0x3866b9;};'use strict';var _=require('lodash');var rp=require(_0xba7b('0x0'));var md5=require('md5');var util=require(_0xba7b('0x1'));var Redis=require('ioredis');var intUtil=require(_0xba7b('0x2'));var config=require(_0xba7b('0x3'));var logger=require(_0xba7b('0x4'))(_0xba7b('0x5'));config[_0xba7b('0x6')]=_['defaults'](config[_0xba7b('0x6')],{'host':_0xba7b('0x7'),'port':0x18eb});var io=require(_0xba7b('0x8'))(new Redis(config['redis']));var headers={'Content-Type':_0xba7b('0x9'),'Accept':_0xba7b('0x9')};function emit(_0x105769,_0x5bb21d,_0x3f5084){io['to'](_0x105769)[_0xba7b('0xa')](_0x5bb21d,_0x3f5084);}function getTicket(_0x4b1db8,_0xca0639,_0x285aaf,_0x3c2503,_0x43dc75){logger[_0xba7b('0xb')](_0xba7b('0xc'));var _0x42c9aa=_[_0xba7b('0xd')]({'responder_id':_0xca0639['id'],'requester_id':_0x285aaf['id'],'name':util['format']('Caller\x20-\x20%s',_0x43dc75[_0xba7b('0xe')]),'phone':_0x43dc75['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xba7b('0xf')](_0x3c2503['Subjects'],_0x43dc75,'\x20'),'description':intUtil[_0xba7b('0xf')](_0x3c2503[_0xba7b('0x10')],_0x43dc75,_0xba7b('0x11')),'tags':getTags(_0x3c2503['Tags'],_0xba7b('0x12'))},getCustomFields(_0x3c2503[_0xba7b('0x13')],_0x43dc75));_0x42c9aa['custom_fields']=_['mapValues'](_['keyBy'](_0x42c9aa['custom_fields'],'id'),'value');return request({'uri':util[_0xba7b('0x14')](_0xba7b('0x15'),_0x4b1db8['remoteUri']),'method':_0xba7b('0x16'),'body':_0x42c9aa})[_0xba7b('0x17')](function(_0x3e7bf6){logger['info'](_0xba7b('0x18'));return _0x3e7bf6;});}function getUser(_0x46f20a,_0x28b3a6){if(intUtil['validateEmail'](_0x28b3a6)){return request({'uri':util[_0xba7b('0x14')](_0xba7b('0x19'),_0x46f20a[_0xba7b('0x1a')]),'qs':{'email':_0x28b3a6}})[_0xba7b('0x17')](function(_0x34c4bb){if(_0x34c4bb[_0xba7b('0x1b')]){logger[_0xba7b('0xb')](_0xba7b('0x1c'));return _['find'](_0x34c4bb,function(_0x26b074){return _0x26b074[_0xba7b('0x1d')][_0xba7b('0x1e')]===_0x28b3a6;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xba7b('0x14')](_0xba7b('0x1f'),_0x46f20a[_0xba7b('0x1a')])})[_0xba7b('0x17')](function(_0x509eb9){logger[_0xba7b('0xb')](_0xba7b('0x20'));return _0x509eb9;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xba7b('0x14')](_0xba7b('0x1f'),_0x46f20a[_0xba7b('0x1a')])})[_0xba7b('0x17')](function(_0x3b8f9f){logger['info'](_0xba7b('0x20'));return _0x3b8f9f;});}}function getEndUser(_0x108048,_0x2322fb,_0xf00da1){logger[_0xba7b('0xb')](_0xba7b('0x21'),_0xf00da1);return request({'uri':util['format'](_0xba7b('0x22'),_0x108048['remoteUri']),'qs':{'phone':_0xf00da1}})[_0xba7b('0x17')](function(_0x6a6edd){if(_0x6a6edd[_0xba7b('0x1b')]){logger[_0xba7b('0xb')](_0xba7b('0x23'));return _[_0xba7b('0x24')](_0x6a6edd,{'phone':_0xf00da1});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xba7b('0x14')](_0xba7b('0x22'),_0x108048['remoteUri']),'method':'POST','body':{'name':_0x2322fb,'phone':_0xf00da1}})['then'](function(_0x321a1f){logger[_0xba7b('0xb')](_0xba7b('0x25'));return _0x321a1f;});}});}function getAuth(_0x81db6){return util[_0xba7b('0x14')](_0xba7b('0x26'),new Buffer(_0x81db6[_0xba7b('0x27')]+':X')[_0xba7b('0x28')](_0xba7b('0x29')));}function request(_0x3d4f51){logger[_0xba7b('0x2a')]('[HTTP]',JSON[_0xba7b('0x2b')](_0x3d4f51));return rp(_[_0xba7b('0x2c')](_0x3d4f51,{'method':_0xba7b('0x2d'),'headers':headers,'json':!![]}));}function getTags(_0x4b93f5,_0xcbc7db){var _0x6ccbf3=[];if(_0x4b93f5&&_0x4b93f5[_0xba7b('0x1b')]>0x0){_0x6ccbf3=_[_0xba7b('0x2e')](_0x4b93f5,_0xcbc7db);}return _0x6ccbf3;}function getCustomFields(_0x452aa6,_0x54bb67){var _0x42fec9=[];var _0x101378={'custom_fields':[]};if(_0x452aa6[_0xba7b('0x1b')]>0x0){_[_0xba7b('0x2f')](_0x452aa6,function(_0x55d463){if(_[_0xba7b('0x30')](['string',_0xba7b('0x31')],_0x55d463[_0xba7b('0x32')])&&_0x55d463[_0xba7b('0x33')]&&!_0x55d463[_0xba7b('0x34')]){_0x101378[_0x55d463[_0xba7b('0x33')][_0xba7b('0x35')]()]=_0x55d463[_0xba7b('0x36')][_0xba7b('0x28')]();}else if(_[_0xba7b('0x30')]([_0xba7b('0x37'),'picklist'],_0x55d463[_0xba7b('0x32')])&&_0x55d463['idField']&&_0x55d463['customField']){_0x101378[_0xba7b('0x38')][_0xba7b('0x39')]({'id':_0x55d463[_0xba7b('0x3a')],'value':_0x55d463[_0xba7b('0x36')][_0xba7b('0x28')]()});}else if(_0x55d463['type']===_0xba7b('0x3b')&&_0x55d463[_0xba7b('0x3c')]&&_0x55d463[_0xba7b('0x3a')]&&_0x55d463['customField']){_0x54bb67[_0x55d463[_0xba7b('0x3c')]]&&_0x101378[_0xba7b('0x38')][_0xba7b('0x39')]({'id':_0x55d463[_0xba7b('0x3a')],'value':_0x54bb67[_0x55d463[_0xba7b('0x3c')]][_0xba7b('0x28')]()});}else if(_0x55d463[_0xba7b('0x32')]===_0xba7b('0x3d')&&_0x55d463[_0xba7b('0x3e')]&&_0x55d463[_0xba7b('0x3e')]['name']&&_0x55d463[_0xba7b('0x3a')]&&_0x55d463[_0xba7b('0x34')]){_0x54bb67[_0x55d463[_0xba7b('0x3e')]['name'][_0xba7b('0x35')]()]&&_0x101378['custom_fields'][_0xba7b('0x39')]({'id':_0x55d463[_0xba7b('0x3a')],'value':_0x54bb67[_0x55d463[_0xba7b('0x3e')][_0xba7b('0x12')][_0xba7b('0x35')]()][_0xba7b('0x28')]()});}});}return _0x101378;}exports[_0xba7b('0x3f')]=function(_0x225784,_0x7caea,_0x2fb55d,_0x2b39f9,_0xbab11,_0x4d098c){var _0x3e3664,_0x4c63d3;_0x4d098c['remoteUri']=intUtil[_0xba7b('0x40')](_0x4d098c[_0xba7b('0x1a')]);_0x4d098c[_0xba7b('0x41')]=intUtil[_0xba7b('0x40')](_0x4d098c[_0xba7b('0x41')]);if(_0xbab11&&_0xbab11[_0xba7b('0x42')]){logger[_0xba7b('0xb')]('[QUEUE]',_0xba7b('0x43'));_0x7caea['recordingURL']=util[_0xba7b('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d098c[_0xba7b('0x41')],_0x7caea[_0xba7b('0x44')],md5(_0x7caea['uniqueid']));}else{_0x7caea[_0xba7b('0x45')]='';}headers[_0xba7b('0x46')]=getAuth(_0x4d098c);return getUser(_0x4d098c,_0x2b39f9[_0xba7b('0x1e')])['then'](function(_0x258d5f){_0x3e3664=_0x258d5f;logger['info'](_0xba7b('0x47'),_0x3e3664['id']);return getEndUser(_0x4d098c,_0x7caea[_0xba7b('0xe')],_0x7caea[_0xba7b('0x48')]);})['then'](function(_0x3eb32b){_0x4c63d3=_0x3eb32b;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4c63d3['id']);return getTicket(_0x4d098c,_0x3e3664,_0x4c63d3,_0x2fb55d,_0x7caea);})['then'](function(_0x29a28c){if(_0x29a28c&&_0x29a28c['id']){logger['info'](_0xba7b('0x18'));logger[_0xba7b('0xb')](_0xba7b('0x49'),_0x29a28c['id']);logger[_0xba7b('0xb')]('[QUEUE]',_0xba7b('0x4a'));emit(util[_0xba7b('0x14')](_0xba7b('0x4b'),_0x2b39f9[_0xba7b('0x12')]),'trigger:browser:url',{'uri':util[_0xba7b('0x14')](_0xba7b('0x4c'),_0x4d098c[_0xba7b('0x1a')],_0x29a28c['id'])});}})[_0xba7b('0x4d')](function(_0x4e604d){logger[_0xba7b('0x4e')]('[QUEUE]',JSON[_0xba7b('0x2b')](_0x4e604d));});};exports['outbound']=function(_0x25dabe,_0xdd22b1,_0x18639b,_0x2cbc59,_0x404c7f,_0x56096a,_0x2d1c9d){var _0x362b76,_0x3a4f9b;_0x56096a[_0xba7b('0x1a')]=intUtil[_0xba7b('0x40')](_0x56096a[_0xba7b('0x1a')]);_0x56096a[_0xba7b('0x41')]=intUtil[_0xba7b('0x40')](_0x56096a[_0xba7b('0x41')]);if(_0x2d1c9d&&_0x2d1c9d[_0xba7b('0x4f')]&&_0x2d1c9d['recordingFormat']!==_0xba7b('0x50')){logger[_0xba7b('0xb')](_0xba7b('0x51'),_0xba7b('0x43'));_0xdd22b1[_0xba7b('0x45')]=util[_0xba7b('0x14')](_0xba7b('0x52'),_0x56096a[_0xba7b('0x41')],_0xdd22b1[_0xba7b('0x44')],md5(_0xdd22b1[_0xba7b('0x44')]));}headers[_0xba7b('0x46')]=getAuth(_0x56096a);return getUser(_0x56096a,_0x2cbc59[_0xba7b('0x1e')])[_0xba7b('0x17')](function(_0x425a88){_0x362b76=_0x425a88;logger[_0xba7b('0xb')](_0xba7b('0x47'),_0x362b76['id']);return getEndUser(_0x56096a,_0xdd22b1[_0xba7b('0x53')],_0xdd22b1['destcalleridnum']);})[_0xba7b('0x17')](function(_0x99d3a){_0x3a4f9b=_0x99d3a;logger[_0xba7b('0xb')](_0xba7b('0x54'),_0x3a4f9b['id']);return getTicket(_0x56096a,_0x362b76,_0x3a4f9b,_0x18639b,_0xdd22b1);})['then'](function(_0x39974d){if(_0x39974d&&_0x39974d['id']){logger[_0xba7b('0xb')]('Ticket\x20created!');logger[_0xba7b('0xb')]('The\x20Ticket\x20ID\x20is:',_0x39974d['id']);logger[_0xba7b('0xb')](_0xba7b('0x51'),_0xba7b('0x4a'));emit(util['format'](_0xba7b('0x4b'),_0x2cbc59['name']),_0xba7b('0x55'),{'uri':util['format'](_0xba7b('0x4c'),_0x56096a['remoteUri'],_0x39974d['id'])});}})[_0xba7b('0x4d')](function(_0x4f0feb){logger[_0xba7b('0x4e')](_0xba7b('0x51'),JSON[_0xba7b('0x2b')](_0x4f0feb));});};exports[_0xba7b('0x56')]=function(_0x56d70c,_0x27d018,_0x2e6496,_0x2df781,_0x570a34,_0x126ad0){var _0x40c728,_0x40b468;_0x126ad0[_0xba7b('0x1a')]=intUtil[_0xba7b('0x40')](_0x126ad0[_0xba7b('0x1a')]);_0x126ad0[_0xba7b('0x41')]=intUtil[_0xba7b('0x40')](_0x126ad0[_0xba7b('0x41')]);if(_0x570a34&&_0x570a34['monitor_format']){logger['info']('['+_0x27d018[_0xba7b('0x57')][_0xba7b('0x58')]()+']','Recording\x20is\x20enabled!');_0x27d018[_0xba7b('0x45')]=util[_0xba7b('0x14')](_0xba7b('0x52'),_0x126ad0['serverUrl'],_0x27d018[_0xba7b('0x44')],md5(_0x27d018[_0xba7b('0x44')]));}else{_0x27d018[_0xba7b('0x45')]='';}headers[_0xba7b('0x46')]=getAuth(_0x126ad0);return getUser(_0x126ad0,'')[_0xba7b('0x17')](function(_0x3dd630){_0x40c728=_0x3dd630;logger['info'](_0xba7b('0x47'),_0x40c728['id']);return getEndUser(_0x126ad0,_0x27d018[_0xba7b('0xe')],_0x27d018['calleridnum']);})['then'](function(_0x207e73){_0x40b468=_0x207e73;logger[_0xba7b('0xb')](_0xba7b('0x54'),_0x40b468['id']);return getTicket(_0x126ad0,_0x40c728,_0x40b468,_0x2e6496,_0x27d018);})[_0xba7b('0x17')](function(_0x5953f8){if(_0x5953f8){logger[_0xba7b('0xb')](_0xba7b('0x18'));logger['info'](_0xba7b('0x49'),_0x5953f8['id']);}})['catch'](function(_0x13cbf7){logger[_0xba7b('0x4e')]('['+_0x27d018[_0xba7b('0x57')][_0xba7b('0x58')]()+']',JSON['stringify'](_0x13cbf7));});}; \ 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 318ce15..93b4472 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 _0xaeff=['queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail','catch','toUpperCase','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','add','ticketId','task','Task\x20created:','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','toLowerCase','outbound','calleridnum','callDirection'];(function(_0x20ea48,_0x1adbda){var _0x2461e8=function(_0x59922d){while(--_0x59922d){_0x20ea48['push'](_0x20ea48['shift']());}};_0x2461e8(++_0x1adbda);}(_0xaeff,0x167));var _0xfaef=function(_0x3d81d5,_0x50be32){_0x3d81d5=_0x3d81d5-0x0;var _0x2eccbb=_0xaeff[_0x3d81d5];return _0x2eccbb;};'use strict';var _=require(_0xfaef('0x0'));var rp=require(_0xfaef('0x1'));var md5=require(_0xfaef('0x2'));var util=require(_0xfaef('0x3'));var moment=require(_0xfaef('0x4'));var Promise=require(_0xfaef('0x5'));var Redis=require('ioredis');var intUtil=require(_0xfaef('0x6'));var config=require(_0xfaef('0x7'));var logger=require(_0xfaef('0x8'))(_0xfaef('0x9'));config[_0xfaef('0xa')]=_[_0xfaef('0xb')](config[_0xfaef('0xa')],{'host':_0xfaef('0xc'),'port':0x18eb});var io=require(_0xfaef('0xd'))(new Redis(config['redis']));function getAdminId(_0x4d8c6d,_0x5cfaa2,_0x33a83c,_0x5709c4){return new Promise(function(_0x18c82c,_0x534e16){var _0x913c3e=![];var _0x2aa6cc={'method':_0xfaef('0xe'),'uri':_0x5709c4+_0xfaef('0xf'),'json':!![]};_0x2aa6cc[_0xfaef('0x10')]=_0x33a83c;logger[_0xfaef('0x11')](_0xfaef('0x12'));return rp(_0x2aa6cc)['then'](function(_0x249539){if(_0x249539){var _0x1cb817=_0x249539[_0xfaef('0x13')];var _0x10bd16=null;for(_0x10bd16=0x0;_0x10bd16<_0x1cb817[_0xfaef('0x14')];_0x10bd16++){if(_0x1cb817[_0x10bd16][_0xfaef('0x15')]===_0x4d8c6d['adminEmail']){_0x4d8c6d[_0xfaef('0x16')]=_0x1cb817[_0x10bd16]['id'];_0x913c3e=!![];}}if(_0x913c3e){logger[_0xfaef('0x11')](_0xfaef('0x17'),_0x4d8c6d[_0xfaef('0x16')]);_0x18c82c(_0x4d8c6d);}else{_0x534e16({'statusCode':0x194,'message':_0xfaef('0x18')});}}else{_0x534e16({'statusCode':0x194,'message':_0xfaef('0x18')});}})['catch'](function(_0x224b04){logger[_0xfaef('0x19')]('['+[_0x5cfaa2['toUpperCase']()]+']',_0x224b04['message']);_0x534e16(_0x224b04);});});}function getUser(_0x592916,_0x762470,_0xeb936e){return function(_0x456d54){return new Promise(function(_0x5167ab,_0x4a0917){var _0x54af9a={'method':_0xfaef('0xe'),'uri':_0xeb936e+_0xfaef('0xf'),'json':!![]};_0x54af9a[_0xfaef('0x10')]=_0x762470;logger[_0xfaef('0x11')](_0xfaef('0x1a'));return rp(_0x54af9a)[_0xfaef('0x1b')](function(_0x49854e){if(_0x49854e){var _0x271a21=_0x49854e[_0xfaef('0x13')];var _0x547c2a=![];var _0x5e5bcd=null;if(_0x456d54[_0xfaef('0x1c')]!==null){logger[_0xfaef('0x11')](_0xfaef('0x1d'),_0x456d54[_0xfaef('0x1c')]);_0x456d54[_0xfaef('0x1e')]=_0x456d54[_0xfaef('0x1c')];for(_0x5e5bcd=0x0;_0x5e5bcd<_0x271a21['length'];_0x5e5bcd++){if(_0x271a21[_0x5e5bcd][_0xfaef('0x15')]===_0x456d54[_0xfaef('0x1c')]){_0x547c2a=!![];_0x456d54[_0xfaef('0x1f')]=_0x271a21[_0x5e5bcd]['id'];logger[_0xfaef('0x11')](_0xfaef('0x20'),_0x456d54['userId']);}}}if(!_0x547c2a){logger['info'](_0xfaef('0x21'));_0x456d54[_0xfaef('0x1e')]=_0x456d54[_0xfaef('0x22')];_0x456d54[_0xfaef('0x1f')]=_0x456d54[_0xfaef('0x16')];_0x547c2a=!![];}if(_0x547c2a){_0x5167ab(_0x456d54);}else{_0x4a0917({'statusCode':0x194,'message':_0xfaef('0x18')});}}else{_0x4a0917({'statusCode':0x194,'message':_0xfaef('0x18')});}})[_0xfaef('0x23')](function(_0x14d805){logger[_0xfaef('0x19')]('['+[_0x592916[_0xfaef('0x24')]()]+']',_0x14d805[_0xfaef('0x25')]);_0x4a0917(_0x14d805);});});};}function searchContact(_0x3c11a5,_0x580f87,_0x4dfa37,_0x3e5f58){return new Promise(function(_0x167c48,_0x5d95e2){var _0x386ed7={'method':_0xfaef('0xe'),'headers':_0x580f87,'uri':_0x3c11a5+_0xfaef('0x26')+_0x3e5f58+_0xfaef('0x27')+_0x4dfa37+_0xfaef('0x28'),'json':!![]};rp(_0x386ed7)[_0xfaef('0x1b')](function(_0x1cec7a){var _0x47bac0=_[_0xfaef('0x29')](_0x1cec7a[_0xfaef('0x2a')][_0xfaef('0x2a')],[_0x4dfa37,_0x3e5f58]);_0x167c48(_0x47bac0);})[_0xfaef('0x23')](function(_0x5ef9b0){_0x5d95e2(_0x5ef9b0);});});}function getEndUser(_0x345adb,_0x55d845,_0x277f40){return function(_0x421301){return new Promise(function(_0x2521eb,_0x1cce88){logger['info'](util['format'](_0xfaef('0x2b'),_0x421301[_0xfaef('0x2c')]));searchContact(_0x277f40,_0x55d845,_0xfaef('0x2d'),_0x421301[_0xfaef('0x2c')])['then'](function(_0x2aba0e){if(_0x2aba0e){_0x421301[_0xfaef('0x2e')]=_0x2aba0e['id'];logger[_0xfaef('0x11')]('Contact\x20found\x20mobile_number:',_0x421301[_0xfaef('0x2e')]);return _0x2521eb(_0x421301);}searchContact(_0x277f40,_0x55d845,'work_number',_0x421301['contactNumber'])[_0xfaef('0x1b')](function(_0x532df4){if(_0x532df4){_0x421301['endUserId']=_0x532df4['id'];logger[_0xfaef('0x11')]('Contact\x20found\x20work_number:',_0x421301[_0xfaef('0x2e')]);return _0x2521eb(_0x421301);}createEndUser(_0x421301,_0x345adb,_0x55d845,_0x277f40)[_0xfaef('0x1b')](function(_0x3781d4){logger['info'](_0xfaef('0x2f'),_0x3781d4[_0xfaef('0x2e')]);return _0x2521eb(_0x3781d4);});});})[_0xfaef('0x23')](function(_0x1ea074){_0x1cce88(_0x1ea074);});});};}function createEndUser(_0x1a9bc1,_0x5a5289,_0x329c88,_0x35efcf){return new Promise(function(_0x16bbd0,_0x3a0746){var _0x431989=moment();var _0x7ea889={'method':_0xfaef('0x30'),'uri':_0x35efcf+_0xfaef('0x31'),'body':{'contact':{'last_name':_0x1a9bc1[_0xfaef('0x2c')],'work_number':_0x1a9bc1[_0xfaef('0x2c')],'mobile_number':_0x1a9bc1[_0xfaef('0x2c')],'owner_id':_0x1a9bc1[_0xfaef('0x1f')],'created_at':_0x431989[_0xfaef('0x32')](_0xfaef('0x33'))}},'json':!![]};_0x7ea889['headers']=_0x329c88;logger[_0xfaef('0x11')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x7ea889)[_0xfaef('0x1b')](function(_0x41790e){_0x1a9bc1['endUserId']=_0x41790e['contact']['id'];_0x16bbd0(_0x1a9bc1);})['catch'](function(_0x443125){logger[_0xfaef('0x19')]('['+[_0x5a5289['toUpperCase']()]+']',_0x443125[_0xfaef('0x25')]);_0x3a0746(_0x443125[_0xfaef('0x25')]);});});}function getTicket(_0x45b3d7,_0x4e28ea,_0x2b5efd,_0xa2c39b,_0x39cba5){return function(_0x2e4996){logger[_0xfaef('0x11')](_0xfaef('0x34'));return new Promise(function(_0x3deadf,_0x4324c5){var _0x4c36e9=moment();var _0x5e8f9d={'method':'POST','uri':_0x2b5efd+_0xfaef('0x35'),'body':{'title':intUtil[_0xfaef('0x36')](_0xa2c39b[_0xfaef('0x37')],_0x39cba5,'\x20'),'description':intUtil[_0xfaef('0x36')](_0xa2c39b['Descriptions'],_0x39cba5,'\x0a'),'owner_id':_0x2e4996['userId'],'creater_id':_0x2e4996[_0xfaef('0x16')],'targetable_id':_0x2e4996['endUserId'],'targetable_type':_0xfaef('0x38'),'created_at':_0x4c36e9[_0xfaef('0x32')](_0xfaef('0x33')),'due_date':_0x4c36e9[_0xfaef('0x39')](0x1e,'m')[_0xfaef('0x32')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x5e8f9d['headers']=_0x4e28ea;return rp(_0x5e8f9d)[_0xfaef('0x1b')](function(_0x3792d9){_0x2e4996[_0xfaef('0x3a')]=_0x3792d9[_0xfaef('0x3b')]['id'];logger[_0xfaef('0x11')](_0xfaef('0x3c'),_0x2e4996[_0xfaef('0x3a')]);_0x3deadf(_0x2e4996);})[_0xfaef('0x23')](function(_0x1578af){logger[_0xfaef('0x19')]('['+[_0x45b3d7['toUpperCase']()]+']',_0x1578af[_0xfaef('0x25')]);_0x4324c5(_0x1578af['message']);});});};}function emit(_0x38bec4,_0x1a93ee,_0x19834b){var _0x48ac6f={'uri':_0x38bec4+'/contacts/'+_0x19834b};io['to'](util[_0xfaef('0x32')](_0xfaef('0x3d'),_0x1a93ee))['emit'](_0xfaef('0x3e'),_0x48ac6f);}exports['cs']=function(_0x372dda,_0x9b20ba,_0x1ba025,_0x5c5db0,_0x473127,_0x370879,_0xc08fa8,_0x1ef56c){var _0x310db7={};var _0x5cc575={'Authorization':_0xfaef('0x3f')+_0x370879[_0xfaef('0x40')]};_0x370879['remoteUri']=intUtil['stripTrailingSlash'](_0x370879[_0xfaef('0x41')]);_0x370879['serverUrl']=intUtil[_0xfaef('0x42')](_0x370879['serverUrl']);var _0xd6b37d=_0x370879[_0xfaef('0x41')];_0x310db7[_0xfaef('0x22')]=_0x370879['username'];_0x310db7[_0xfaef('0x2c')]=_0x1ef56c[_0xfaef('0x43')]()===_0xfaef('0x44')?_0x9b20ba['destcalleridnum']:_0x9b20ba[_0xfaef('0x45')];_0x310db7[_0xfaef('0x46')]=_0x1ef56c===_0xfaef('0x47')||_0x1ef56c===_0xfaef('0x48')?_0xfaef('0x47'):'outbound';if(_0x5c5db0){_0x310db7[_0xfaef('0x1c')]=_0x5c5db0[_0xfaef('0x15')];}var _0x147ab7=util[_0xfaef('0x32')](_0xfaef('0x49'),_0x370879[_0xfaef('0x4a')],_0x9b20ba['uniqueid'],md5(_0x9b20ba['uniqueid']));if(_0x473127&&_0x473127[_0xfaef('0x4b')]){logger['info']('[QUEUE]',_0xfaef('0x4c'));_0x9b20ba['recordingURL']=_0x147ab7;}else if(_0xc08fa8&&_0xc08fa8['recordingFormat']&&_0xc08fa8[_0xfaef('0x4d')]!==_0xfaef('0x4e')){logger[_0xfaef('0x11')](_0xfaef('0x4f'),'Recording\x20is\x20enabled!');_0x9b20ba[_0xfaef('0x50')]=_0x147ab7;}else{_0x9b20ba[_0xfaef('0x50')]='';}return getAdminId(_0x310db7,_0x1ef56c,_0x5cc575,_0xd6b37d)[_0xfaef('0x1b')](getUser(_0x1ef56c,_0x5cc575,_0xd6b37d))[_0xfaef('0x1b')](getEndUser(_0x1ef56c,_0x5cc575,_0xd6b37d))[_0xfaef('0x1b')](getTicket(_0x1ef56c,_0x5cc575,_0xd6b37d,_0x1ba025,_0x9b20ba))[_0xfaef('0x1b')](function(_0x3bbd9a){logger[_0xfaef('0x11')](util[_0xfaef('0x32')](_0xfaef('0x51'),_0x3bbd9a[_0xfaef('0x3a')]));if(_0x1ef56c!==_0xfaef('0x48')){logger[_0xfaef('0x11')]('['+[_0x1ef56c[_0xfaef('0x24')]()]+']',_0xfaef('0x52'));emit(_0xd6b37d,_0x5c5db0[_0xfaef('0x53')],_0x3bbd9a[_0xfaef('0x2e')]);}})[_0xfaef('0x23')](function(_0x3ea4a8){logger[_0xfaef('0x19')]('['+[_0x1ef56c[_0xfaef('0x24')]()]+_0xfaef('0x54'),util[_0xfaef('0x55')](_0x3ea4a8,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3d55=['[QUEUE]','recordingURL','recordingFormat','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','adminEmail','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','GET','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','userId','User\x20found:','adminId','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Contact','add','Task\x20created:','ticketId','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format'];(function(_0x82b0b9,_0x10057b){var _0x138417=function(_0x1772d5){while(--_0x1772d5){_0x82b0b9['push'](_0x82b0b9['shift']());}};_0x138417(++_0x10057b);}(_0x3d55,0x1a2));var _0x53d5=function(_0x4c49cd,_0x1b630d){_0x4c49cd=_0x4c49cd-0x0;var _0x29ba71=_0x3d55[_0x4c49cd];return _0x29ba71;};'use strict';var _=require('lodash');var rp=require(_0x53d5('0x0'));var md5=require(_0x53d5('0x1'));var util=require(_0x53d5('0x2'));var moment=require('moment');var Promise=require(_0x53d5('0x3'));var Redis=require(_0x53d5('0x4'));var intUtil=require(_0x53d5('0x5'));var config=require(_0x53d5('0x6'));var logger=require('../../../../config/logger')('freshsales');config[_0x53d5('0x7')]=_[_0x53d5('0x8')](config[_0x53d5('0x7')],{'host':_0x53d5('0x9'),'port':0x18eb});var io=require(_0x53d5('0xa'))(new Redis(config[_0x53d5('0x7')]));function getAdminId(_0x5abddb,_0x223ace,_0x326a12,_0x2a79b2){return new Promise(function(_0x7fa7f5,_0x53f32a){var _0x1daff6=![];var _0x3ba5c9={'method':'GET','uri':_0x2a79b2+_0x53d5('0xb'),'json':!![]};_0x3ba5c9[_0x53d5('0xc')]=_0x326a12;logger[_0x53d5('0xd')](_0x53d5('0xe'));return rp(_0x3ba5c9)[_0x53d5('0xf')](function(_0x15f9bc){if(_0x15f9bc){var _0x376f38=_0x15f9bc[_0x53d5('0x10')];var _0x14eb8e=null;for(_0x14eb8e=0x0;_0x14eb8e<_0x376f38[_0x53d5('0x11')];_0x14eb8e++){if(_0x376f38[_0x14eb8e]['email']===_0x5abddb[_0x53d5('0x12')]){_0x5abddb['adminId']=_0x376f38[_0x14eb8e]['id'];_0x1daff6=!![];}}if(_0x1daff6){logger[_0x53d5('0xd')]('Admin\x20found:',_0x5abddb['adminId']);_0x7fa7f5(_0x5abddb);}else{_0x53f32a({'statusCode':0x194,'message':_0x53d5('0x13')});}}else{_0x53f32a({'statusCode':0x194,'message':_0x53d5('0x13')});}})[_0x53d5('0x14')](function(_0x217365){logger[_0x53d5('0x15')]('['+[_0x223ace[_0x53d5('0x16')]()]+']',_0x217365['message']);_0x53f32a(_0x217365);});});}function getUser(_0x211a42,_0x5974d3,_0x27d402){return function(_0x5590c6){return new Promise(function(_0x25a059,_0x1efa18){var _0x352f60={'method':_0x53d5('0x17'),'uri':_0x27d402+_0x53d5('0xb'),'json':!![]};_0x352f60[_0x53d5('0xc')]=_0x5974d3;logger[_0x53d5('0xd')](_0x53d5('0x18'));return rp(_0x352f60)['then'](function(_0x358d97){if(_0x358d97){var _0x45c95e=_0x358d97[_0x53d5('0x10')];var _0x4fc668=![];var _0x510191=null;if(_0x5590c6[_0x53d5('0x19')]!==null){logger[_0x53d5('0xd')](_0x53d5('0x1a'),_0x5590c6[_0x53d5('0x19')]);_0x5590c6[_0x53d5('0x1b')]=_0x5590c6['agentEmail'];for(_0x510191=0x0;_0x510191<_0x45c95e[_0x53d5('0x11')];_0x510191++){if(_0x45c95e[_0x510191][_0x53d5('0x1c')]===_0x5590c6[_0x53d5('0x19')]){_0x4fc668=!![];_0x5590c6[_0x53d5('0x1d')]=_0x45c95e[_0x510191]['id'];logger[_0x53d5('0xd')](_0x53d5('0x1e'),_0x5590c6['userId']);}}}if(!_0x4fc668){logger[_0x53d5('0xd')]('Admin\x20selected');_0x5590c6['userEmail']=_0x5590c6[_0x53d5('0x12')];_0x5590c6[_0x53d5('0x1d')]=_0x5590c6[_0x53d5('0x1f')];_0x4fc668=!![];}if(_0x4fc668){_0x25a059(_0x5590c6);}else{_0x1efa18({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x1efa18({'statusCode':0x194,'message':_0x53d5('0x13')});}})[_0x53d5('0x14')](function(_0x33aa82){logger[_0x53d5('0x15')]('['+[_0x211a42[_0x53d5('0x16')]()]+']',_0x33aa82[_0x53d5('0x20')]);_0x1efa18(_0x33aa82);});});};}function searchContact(_0x4e365c,_0x788a21,_0x106d2f,_0x510874){return new Promise(function(_0x1c6694,_0x3658c7){var _0x525047={'method':_0x53d5('0x17'),'headers':_0x788a21,'uri':_0x4e365c+_0x53d5('0x21')+_0x510874+_0x53d5('0x22')+_0x106d2f+_0x53d5('0x23'),'json':!![]};rp(_0x525047)[_0x53d5('0xf')](function(_0x545427){var _0x5de937=_[_0x53d5('0x24')](_0x545427[_0x53d5('0x25')]['contacts'],[_0x106d2f,_0x510874]);_0x1c6694(_0x5de937);})['catch'](function(_0x508a7e){_0x3658c7(_0x508a7e);});});}function getEndUser(_0x1b5694,_0x43642e,_0x573ce7){return function(_0x4aedbd){return new Promise(function(_0x4e911b,_0x541988){logger[_0x53d5('0xd')](util[_0x53d5('0x26')]('Searching\x20contact\x20with\x20phone\x20%s',_0x4aedbd[_0x53d5('0x27')]));searchContact(_0x573ce7,_0x43642e,_0x53d5('0x28'),_0x4aedbd[_0x53d5('0x27')])[_0x53d5('0xf')](function(_0x159f43){if(_0x159f43){_0x4aedbd[_0x53d5('0x29')]=_0x159f43['id'];logger[_0x53d5('0xd')](_0x53d5('0x2a'),_0x4aedbd[_0x53d5('0x29')]);return _0x4e911b(_0x4aedbd);}searchContact(_0x573ce7,_0x43642e,_0x53d5('0x2b'),_0x4aedbd[_0x53d5('0x27')])[_0x53d5('0xf')](function(_0x2e74f6){if(_0x2e74f6){_0x4aedbd[_0x53d5('0x29')]=_0x2e74f6['id'];logger[_0x53d5('0xd')]('Contact\x20found\x20work_number:',_0x4aedbd[_0x53d5('0x29')]);return _0x4e911b(_0x4aedbd);}createEndUser(_0x4aedbd,_0x1b5694,_0x43642e,_0x573ce7)['then'](function(_0x65c6d7){logger[_0x53d5('0xd')](_0x53d5('0x2c'),_0x65c6d7[_0x53d5('0x29')]);return _0x4e911b(_0x65c6d7);});});})[_0x53d5('0x14')](function(_0x5cfc43){_0x541988(_0x5cfc43);});});};}function createEndUser(_0x327890,_0x9300a4,_0x443e7b,_0x18dc4c){return new Promise(function(_0x56682c,_0x8eb01a){var _0x29fbbd=moment();var _0xf31400={'method':_0x53d5('0x2d'),'uri':_0x18dc4c+_0x53d5('0x2e'),'body':{'contact':{'last_name':_0x327890[_0x53d5('0x27')],'work_number':_0x327890[_0x53d5('0x27')],'mobile_number':_0x327890[_0x53d5('0x27')],'owner_id':_0x327890[_0x53d5('0x1d')],'created_at':_0x29fbbd['format'](_0x53d5('0x2f'))}},'json':!![]};_0xf31400[_0x53d5('0xc')]=_0x443e7b;logger['info'](_0x53d5('0x30'));return rp(_0xf31400)[_0x53d5('0xf')](function(_0x653bbe){_0x327890[_0x53d5('0x29')]=_0x653bbe[_0x53d5('0x31')]['id'];_0x56682c(_0x327890);})[_0x53d5('0x14')](function(_0x37b462){logger['error']('['+[_0x9300a4[_0x53d5('0x16')]()]+']',_0x37b462[_0x53d5('0x20')]);_0x8eb01a(_0x37b462[_0x53d5('0x20')]);});});}function getTicket(_0x12286a,_0x2219a7,_0x25e9d2,_0x4a9c0d,_0xc257ca){return function(_0xa3e03b){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x556d2a,_0x5af4b1){var _0xfdac6a=moment();var _0x55c7f9={'method':_0x53d5('0x2d'),'uri':_0x25e9d2+_0x53d5('0x32'),'body':{'title':intUtil[_0x53d5('0x33')](_0x4a9c0d['Subjects'],_0xc257ca,'\x20'),'description':intUtil[_0x53d5('0x33')](_0x4a9c0d['Descriptions'],_0xc257ca,'\x0a'),'owner_id':_0xa3e03b[_0x53d5('0x1d')],'creater_id':_0xa3e03b['adminId'],'targetable_id':_0xa3e03b[_0x53d5('0x29')],'targetable_type':_0x53d5('0x34'),'created_at':_0xfdac6a[_0x53d5('0x26')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0xfdac6a[_0x53d5('0x35')](0x1e,'m')[_0x53d5('0x26')](_0x53d5('0x2f'))},'json':!![]};_0x55c7f9['headers']=_0x2219a7;return rp(_0x55c7f9)[_0x53d5('0xf')](function(_0x58d412){_0xa3e03b['ticketId']=_0x58d412['task']['id'];logger[_0x53d5('0xd')](_0x53d5('0x36'),_0xa3e03b[_0x53d5('0x37')]);_0x556d2a(_0xa3e03b);})['catch'](function(_0xe531d7){logger['error']('['+[_0x12286a[_0x53d5('0x16')]()]+']',_0xe531d7[_0x53d5('0x20')]);_0x5af4b1(_0xe531d7['message']);});});};}function emit(_0x6da15f,_0x1e3816,_0x261aac){var _0x1a5d65={'uri':_0x6da15f+_0x53d5('0x38')+_0x261aac};io['to'](util['format'](_0x53d5('0x39'),_0x1e3816))[_0x53d5('0x3a')]('trigger:browser:url',_0x1a5d65);}exports['cs']=function(_0x39109d,_0xa01e1,_0x116192,_0x4a8fe1,_0x245fc9,_0x526584,_0x4343d6,_0x8e9e4e){var _0x19e9aa={};var _0x2dab8f={'Authorization':_0x53d5('0x3b')+_0x526584[_0x53d5('0x3c')]};_0x526584[_0x53d5('0x3d')]=intUtil[_0x53d5('0x3e')](_0x526584[_0x53d5('0x3d')]);_0x526584[_0x53d5('0x3f')]=intUtil['stripTrailingSlash'](_0x526584['serverUrl']);var _0xb90db0=_0x526584['remoteUri'];_0x19e9aa['adminEmail']=_0x526584[_0x53d5('0x40')];_0x19e9aa[_0x53d5('0x27')]=_0x8e9e4e[_0x53d5('0x41')]()===_0x53d5('0x42')?_0xa01e1[_0x53d5('0x43')]:_0xa01e1[_0x53d5('0x44')];_0x19e9aa['callDirection']=_0x8e9e4e==='queue'||_0x8e9e4e===_0x53d5('0x45')?_0x53d5('0x46'):'outbound';if(_0x4a8fe1){_0x19e9aa[_0x53d5('0x19')]=_0x4a8fe1[_0x53d5('0x1c')];}var _0x28166a=util[_0x53d5('0x26')](_0x53d5('0x47'),_0x526584['serverUrl'],_0xa01e1[_0x53d5('0x48')],md5(_0xa01e1[_0x53d5('0x48')]));if(_0x245fc9&&_0x245fc9[_0x53d5('0x49')]){logger['info'](_0x53d5('0x4a'),'Recording\x20is\x20enabled!');_0xa01e1[_0x53d5('0x4b')]=_0x28166a;}else if(_0x4343d6&&_0x4343d6[_0x53d5('0x4c')]&&_0x4343d6[_0x53d5('0x4c')]!=='none'){logger[_0x53d5('0xd')]('[OUTBOUND]',_0x53d5('0x4d'));_0xa01e1[_0x53d5('0x4b')]=_0x28166a;}else{_0xa01e1[_0x53d5('0x4b')]='';}return getAdminId(_0x19e9aa,_0x8e9e4e,_0x2dab8f,_0xb90db0)[_0x53d5('0xf')](getUser(_0x8e9e4e,_0x2dab8f,_0xb90db0))[_0x53d5('0xf')](getEndUser(_0x8e9e4e,_0x2dab8f,_0xb90db0))[_0x53d5('0xf')](getTicket(_0x8e9e4e,_0x2dab8f,_0xb90db0,_0x116192,_0xa01e1))[_0x53d5('0xf')](function(_0x419338){logger[_0x53d5('0xd')](util[_0x53d5('0x26')](_0x53d5('0x4e'),_0x419338[_0x53d5('0x37')]));if(_0x8e9e4e!==_0x53d5('0x45')){logger[_0x53d5('0xd')]('['+[_0x8e9e4e[_0x53d5('0x16')]()]+']',_0x53d5('0x4f'));emit(_0xb90db0,_0x4a8fe1[_0x53d5('0x50')],_0x419338[_0x53d5('0x29')]);}})[_0x53d5('0x14')](function(_0x5ccafd){logger['error']('['+[_0x8e9e4e['toUpperCase']()]+_0x53d5('0x51'),util['inspect'](_0x5ccafd,{'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 25be500..07a0aeb 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 _0xc297=['Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','salesforce','zoho','desk','vtiger','dynamics365','unknown\x20integration','../../../../config/logger','toLowerCase','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./vtiger','./servicenow','./dynamics365','./freshsales','sugarcrm','freshdesk','freshsales','exec','includes','data1','data2'];(function(_0x24384a,_0x32271e){var _0x3e5bce=function(_0x30f328){while(--_0x30f328){_0x24384a['push'](_0x24384a['shift']());}};_0x3e5bce(++_0x32271e);}(_0xc297,0x16b));var _0x7c29=function(_0x5c5c52,_0x36d085){_0x5c5c52=_0x5c5c52-0x0;var _0x4229ff=_0xc297[_0x5c5c52];return _0x4229ff;};'use strict';var _=require(_0x7c29('0x0'));var util=require(_0x7c29('0x1'));var zendesk=require(_0x7c29('0x2'));var salesforce=require(_0x7c29('0x3'));var sugarcrm=require(_0x7c29('0x4'));var freshdesk=require(_0x7c29('0x5'));var zoho=require('./zoho');var desk=require('./desk');var vtiger=require(_0x7c29('0x6'));var servicenow=require(_0x7c29('0x7'));var dynamics365=require(_0x7c29('0x8'));var freshsales=require(_0x7c29('0x9'));var integrations=['zendesk','salesforce',_0x7c29('0xa'),_0x7c29('0xb'),'zoho','desk','vtiger','dynamics365',_0x7c29('0xc'),'servicenow'];exports[_0x7c29('0xd')]=function(_0xfea186,_0x52a042,_0x346a08,_0xd80e11,_0x5797db,_0x9dfa1a){if(_0x346a08){if(_[_0x7c29('0xe')](integrations,_0xfea186[_0x7c29('0xf')]['toLowerCase']())){try{var _0x33546c=null;var _0x56b4df='';var _0x3f6940=_0x346a08[_0xfea186[_0x7c29('0xf')]['toLowerCase']()];if(_0x3f6940){var _0x259d43=_0x3f6940[_0xfea186[_0x7c29('0x10')]];if(_0x259d43){var _0x2d15c2=_['find'](_0x259d43[_0x7c29('0x11')],{'id':parseInt(_0xfea186[_0x7c29('0x12')],0xa)});if(_0x2d15c2){if(_0xd80e11){if(_0x5797db&&_0x52a042[_0x7c29('0x13')]){_0x56b4df=_0x7c29('0x13');}else if(_0x52a042[_0x7c29('0x14')]){_0x56b4df=_0x7c29('0x15');}else{console[_0x7c29('0x16')](_0x7c29('0x17'),_0x52a042);}}else{_0x56b4df=_0x7c29('0x18');}switch(_0xfea186[_0x7c29('0xf')]['toLowerCase']()){case'zendesk':zendesk[_0x56b4df](_0xfea186,_0x52a042,_0x2d15c2,_0xd80e11,_0x5797db,_0x259d43,_0x9dfa1a);break;case _0x7c29('0x19'):salesforce[_0x56b4df](_0xfea186,_0x52a042,_0x2d15c2,_0xd80e11,_0x5797db,_0x259d43,_0x9dfa1a);break;case _0x7c29('0xa'):sugarcrm[_0x56b4df](_0xfea186,_0x52a042,_0x2d15c2,_0xd80e11,_0x5797db,_0x259d43,_0x9dfa1a);break;case'freshdesk':freshdesk[_0x56b4df](_0xfea186,_0x52a042,_0x2d15c2,_0xd80e11,_0x5797db,_0x259d43,_0x9dfa1a);break;case _0x7c29('0x1a'):zoho[_0x56b4df](_0xfea186,_0x52a042,_0x2d15c2,_0xd80e11,_0x5797db,_0x259d43,_0x9dfa1a);break;case _0x7c29('0x1b'):desk[_0x56b4df](_0xfea186,_0x52a042,_0x2d15c2,_0xd80e11,_0x5797db,_0x259d43,_0x9dfa1a);break;case _0x7c29('0x1c'):vtiger[_0x56b4df](_0xfea186,_0x52a042,_0x2d15c2,_0xd80e11,_0x5797db,_0x259d43,_0x9dfa1a);break;case _0x7c29('0xc'):freshsales['cs'](_0xfea186,_0x52a042,_0x2d15c2,_0xd80e11,_0x5797db,_0x259d43,_0x9dfa1a,_0x56b4df);break;case'servicenow':servicenow['cs'](_0xfea186,_0x52a042,_0x2d15c2,_0xd80e11,_0x5797db,_0x259d43,_0x9dfa1a,_0x56b4df);break;case _0x7c29('0x1d'):dynamics365['cs'](_0xfea186,_0x52a042,_0x2d15c2,_0xd80e11,_0x5797db,_0x259d43,_0x9dfa1a,_0x56b4df);break;default:console[_0x7c29('0x16')](_0x7c29('0x1e'));}}else{_0x33546c=require(_0x7c29('0x1f'))(_0xfea186[_0x7c29('0xf')][_0x7c29('0x20')]());_0x33546c[_0x7c29('0x21')](_0x7c29('0x22'),util[_0x7c29('0x23')](_0x7c29('0x24'),_0xfea186[_0x7c29('0xf')][_0x7c29('0x20')](),_0xfea186[_0x7c29('0x12')]));}}else{_0x33546c=require('../../../../config/logger')(_0xfea186[_0x7c29('0xf')][_0x7c29('0x20')]());_0x33546c[_0x7c29('0x21')]('[EXEC]',util[_0x7c29('0x23')](_0x7c29('0x25'),_0xfea186[_0x7c29('0xf')][_0x7c29('0x20')](),_0xfea186[_0x7c29('0x10')]));}}else{}}catch(_0x3f7cec){console[_0x7c29('0x21')](_0x3f7cec);}}}}; \ No newline at end of file +var _0xc694=['./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','freshsales','servicenow','exec','data1','toLowerCase','data2','find','Configurations','queue','routeId','log','unmanaged','dynamics365','../../../../config/logger','format','%s\x20configuration\x20#%s\x20not\x20found','error','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util'];(function(_0x3dfeb9,_0x1cc6e4){var _0x412314=function(_0x321253){while(--_0x321253){_0x3dfeb9['push'](_0x3dfeb9['shift']());}};_0x412314(++_0x1cc6e4);}(_0xc694,0x6d));var _0x4c69=function(_0x1ce9ea,_0x32e6f4){_0x1ce9ea=_0x1ce9ea-0x0;var _0x2a95b9=_0xc694[_0x1ce9ea];return _0x2a95b9;};'use strict';var _=require(_0x4c69('0x0'));var util=require(_0x4c69('0x1'));var zendesk=require(_0x4c69('0x2'));var salesforce=require(_0x4c69('0x3'));var sugarcrm=require(_0x4c69('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0x4c69('0x5'));var desk=require(_0x4c69('0x6'));var vtiger=require(_0x4c69('0x7'));var servicenow=require(_0x4c69('0x8'));var dynamics365=require(_0x4c69('0x9'));var freshsales=require(_0x4c69('0xa'));var integrations=[_0x4c69('0xb'),_0x4c69('0xc'),_0x4c69('0xd'),_0x4c69('0xe'),_0x4c69('0xf'),_0x4c69('0x10'),_0x4c69('0x11'),'dynamics365',_0x4c69('0x12'),_0x4c69('0x13')];exports[_0x4c69('0x14')]=function(_0x1c8ba8,_0x590f82,_0x47b179,_0x1fcb6d,_0x119acd,_0x8b889c){if(_0x47b179){if(_['includes'](integrations,_0x1c8ba8[_0x4c69('0x15')][_0x4c69('0x16')]())){try{var _0x43993d=null;var _0x4e24c3='';var _0x5ba287=_0x47b179[_0x1c8ba8[_0x4c69('0x15')]['toLowerCase']()];if(_0x5ba287){var _0x5a7821=_0x5ba287[_0x1c8ba8[_0x4c69('0x17')]];if(_0x5a7821){var _0x5f9e0=_[_0x4c69('0x18')](_0x5a7821[_0x4c69('0x19')],{'id':parseInt(_0x1c8ba8['data3'],0xa)});if(_0x5f9e0){if(_0x1fcb6d){if(_0x119acd&&_0x590f82[_0x4c69('0x1a')]){_0x4e24c3=_0x4c69('0x1a');}else if(_0x590f82[_0x4c69('0x1b')]){_0x4e24c3='outbound';}else{console[_0x4c69('0x1c')]('EVENT\x20UNKNOWN',_0x590f82);}}else{_0x4e24c3=_0x4c69('0x1d');}switch(_0x1c8ba8['data1'][_0x4c69('0x16')]()){case _0x4c69('0xb'):zendesk[_0x4e24c3](_0x1c8ba8,_0x590f82,_0x5f9e0,_0x1fcb6d,_0x119acd,_0x5a7821,_0x8b889c);break;case'salesforce':salesforce[_0x4e24c3](_0x1c8ba8,_0x590f82,_0x5f9e0,_0x1fcb6d,_0x119acd,_0x5a7821,_0x8b889c);break;case _0x4c69('0xd'):sugarcrm[_0x4e24c3](_0x1c8ba8,_0x590f82,_0x5f9e0,_0x1fcb6d,_0x119acd,_0x5a7821,_0x8b889c);break;case _0x4c69('0xe'):freshdesk[_0x4e24c3](_0x1c8ba8,_0x590f82,_0x5f9e0,_0x1fcb6d,_0x119acd,_0x5a7821,_0x8b889c);break;case _0x4c69('0xf'):zoho[_0x4e24c3](_0x1c8ba8,_0x590f82,_0x5f9e0,_0x1fcb6d,_0x119acd,_0x5a7821,_0x8b889c);break;case _0x4c69('0x10'):desk[_0x4e24c3](_0x1c8ba8,_0x590f82,_0x5f9e0,_0x1fcb6d,_0x119acd,_0x5a7821,_0x8b889c);break;case _0x4c69('0x11'):vtiger[_0x4e24c3](_0x1c8ba8,_0x590f82,_0x5f9e0,_0x1fcb6d,_0x119acd,_0x5a7821,_0x8b889c);break;case _0x4c69('0x12'):freshsales['cs'](_0x1c8ba8,_0x590f82,_0x5f9e0,_0x1fcb6d,_0x119acd,_0x5a7821,_0x8b889c,_0x4e24c3);break;case _0x4c69('0x13'):servicenow['cs'](_0x1c8ba8,_0x590f82,_0x5f9e0,_0x1fcb6d,_0x119acd,_0x5a7821,_0x8b889c,_0x4e24c3);break;case _0x4c69('0x1e'):dynamics365['cs'](_0x1c8ba8,_0x590f82,_0x5f9e0,_0x1fcb6d,_0x119acd,_0x5a7821,_0x8b889c,_0x4e24c3);break;default:console[_0x4c69('0x1c')]('unknown\x20integration');}}else{_0x43993d=require(_0x4c69('0x1f'))(_0x1c8ba8['data1'][_0x4c69('0x16')]());_0x43993d['error']('[EXEC]',util[_0x4c69('0x20')](_0x4c69('0x21'),_0x1c8ba8[_0x4c69('0x15')][_0x4c69('0x16')](),_0x1c8ba8['data3']));}}else{_0x43993d=require(_0x4c69('0x1f'))(_0x1c8ba8[_0x4c69('0x15')][_0x4c69('0x16')]());_0x43993d[_0x4c69('0x22')](_0x4c69('0x23'),util[_0x4c69('0x20')](_0x4c69('0x24'),_0x1c8ba8['data1']['toLowerCase'](),_0x1c8ba8[_0x4c69('0x17')]));}}else{}}catch(_0x291c7e){console['error'](_0x291c7e);}}}}; \ 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 2d6a9fe..ed60133 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 _0xa8d1=['identity','then','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','attributes','type','toLowerCase','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','upperFirst','create','forEach','string','idField','content','toString','variableName','customVariable','Variable','name','password','concat','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','assign','Subjects','getString','Descriptions','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ticketType','Case','ContactId','AccountId','leadId','isNil','validateEmail','sobject','User','find','execute','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.'];(function(_0x33de0a,_0x5170ac){var _0x5288e1=function(_0x3bcf6d){while(--_0x3bcf6d){_0x33de0a['push'](_0x33de0a['shift']());}};_0x5288e1(++_0x5170ac);}(_0xa8d1,0x14d));var _0x1a8d=function(_0x32292b,_0x4e9525){_0x32292b=_0x32292b-0x0;var _0x1845b4=_0xa8d1[_0x32292b];return _0x1845b4;};'use strict';var _=require('lodash');var rp=require(_0x1a8d('0x0'));var moment=require(_0x1a8d('0x1'));var BPromise=require(_0x1a8d('0x2'));var md5=require(_0x1a8d('0x3'));var jsforce=require(_0x1a8d('0x4'));var util=require(_0x1a8d('0x5'));var Redis=require(_0x1a8d('0x6'));var intUtil=require('./util');var config=require(_0x1a8d('0x7'));var logger=require(_0x1a8d('0x8'))(_0x1a8d('0x9'));config[_0x1a8d('0xa')]=_['defaults'](config[_0x1a8d('0xa')],{'host':_0x1a8d('0xb'),'port':0x18eb});var io=require(_0x1a8d('0xc'))(new Redis(config[_0x1a8d('0xa')]));function emit(_0x3b057f,_0x24d43f,_0x5545c3){io['to'](_0x3b057f)[_0x1a8d('0xd')](_0x24d43f,_0x5545c3);}function getTicket(_0x96f5,_0x4729d6,_0x1cbb8f,_0x5925e5,_0x17f0aa,_0x599ba4,_0x1af52e,_0x274a8d){var _0x23d2bd=Object[_0x1a8d('0xe')]({},{'OwnerId':_0x4729d6['id'],'Subject':intUtil['getString'](_0x5925e5[_0x1a8d('0xf')],_0x17f0aa,'\x20'),'Description':intUtil[_0x1a8d('0x10')](_0x5925e5[_0x1a8d('0x11')],_0x17f0aa,'\x0a')},getCustomFields(_0x599ba4,_0x17f0aa));if(_0x1cbb8f){if(_0x5925e5['ticketType']==='Task'){_0x23d2bd[_0x1a8d('0x12')]=moment['utc']();_0x23d2bd[_0x1a8d('0x13')]=![];_0x23d2bd[_0x1a8d('0x14')]=![];if(_0x1cbb8f[_0x1a8d('0x15')]===_0x1a8d('0x16')||_0x1cbb8f[_0x1a8d('0x15')]===_0x1a8d('0x17')){_0x23d2bd[_0x1a8d('0x18')]=_0x1cbb8f['id'];}else if(_0x1cbb8f[_0x1a8d('0x15')]===_0x1a8d('0x19')){_0x23d2bd[_0x1a8d('0x1a')]=_0x1cbb8f['id'];}}else if(_0x5925e5[_0x1a8d('0x1b')]===_0x1a8d('0x1c')){if(_0x1cbb8f[_0x1a8d('0x15')]===_0x1a8d('0x16')){_0x23d2bd[_0x1a8d('0x1d')]=_0x1cbb8f['id'];}else if(_0x1cbb8f['endUserType']===_0x1a8d('0x19')){_0x23d2bd[_0x1a8d('0x1e')]=_0x1cbb8f['id'];}else if(_0x1cbb8f['endUserType']===_0x1a8d('0x17')&&_0x5925e5[_0x1a8d('0x1f')]){_0x23d2bd[_0x5925e5[_0x1a8d('0x1f')]]=_0x1cbb8f['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x1af52e['sobject'](_0x5925e5[_0x1a8d('0x1b')])['create'](_0x23d2bd);}function getUser(_0x37f500,_0x50fa5c,_0x52e4e4){if(!_[_0x1a8d('0x20')](_0x50fa5c)&&intUtil[_0x1a8d('0x21')](_0x50fa5c)){var _0x3b2937={'Email':_0x50fa5c};var _0x10db32={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x52e4e4[_0x1a8d('0x22')](_0x1a8d('0x23'))[_0x1a8d('0x24')](_0x3b2937,_0x10db32)[_0x1a8d('0x25')]()['then'](function(_0x515a6b){if(_0x515a6b[_0x1a8d('0x26')]){var _0x5edad0=_[_0x1a8d('0x24')](_0x515a6b,function(_0x5b70f7){return _0x5b70f7[_0x1a8d('0x27')]===_0x50fa5c;});if(_0x5edad0){logger[_0x1a8d('0x28')](_0x1a8d('0x29'),_0x50fa5c);return BPromise[_0x1a8d('0x2a')]({'id':_0x5edad0['Id'],'name':_0x5edad0[_0x1a8d('0x2b')]});}}else{logger[_0x1a8d('0x28')](_0x1a8d('0x2c'),_0x50fa5c);return _0x52e4e4[_0x1a8d('0x2d')]()[_0x1a8d('0x2e')](function(_0x2c31d6){return BPromise[_0x1a8d('0x2a')]({'id':_0x2c31d6[_0x1a8d('0x2f')],'name':_0x2c31d6[_0x1a8d('0x30')]});});}});}else{logger[_0x1a8d('0x28')](_0x1a8d('0x2c'),_0x50fa5c);return _0x52e4e4['identity']()['then'](function(_0x113b24){return BPromise[_0x1a8d('0x2a')]({'id':_0x113b24[_0x1a8d('0x2f')],'name':_0x113b24[_0x1a8d('0x30')]});});}}function getEndUser(_0x277f14,_0x927511,_0x547b03,_0x1f2f93,_0x5f3b35){var _0x4aaa10={'$or':{'Phone':_0x1f2f93}};var _0x5a4860={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x1a8d('0x2e')](function(){logger[_0x1a8d('0x28')](_0x1a8d('0x31'),_0x1f2f93,_0x927511[_0x1a8d('0x32')]);switch(_0x927511[_0x1a8d('0x32')]){case _0x1a8d('0x33'):var _0x181967=_[_0x1a8d('0x34')](_0x4aaa10);if(_0x927511[_0x1a8d('0x35')]){var _0x27734c={};_0x27734c[_0x927511[_0x1a8d('0x35')]]=_0x1f2f93;_[_0x1a8d('0x36')](_0x181967[_0x1a8d('0x37')],_0x27734c);}return _0x5f3b35[_0x1a8d('0x22')](_0x1a8d('0x38'))[_0x1a8d('0x24')](_0x181967,_0x5a4860)[_0x1a8d('0x25')]()[_0x1a8d('0x2e')](function(_0x1b75ee){if(_0x1b75ee&&_0x1b75ee['length']){return _0x1b75ee;}else{var _0x5c5acd=_[_0x1a8d('0x34')](_0x4aaa10);if(_0x927511[_0x1a8d('0x39')]){var _0x141a0f={};_0x141a0f[_0x927511[_0x1a8d('0x39')]]=_0x1f2f93;_['merge'](_0x5c5acd[_0x1a8d('0x37')],_0x141a0f);}return _0x5f3b35[_0x1a8d('0x22')](_0x1a8d('0x3a'))[_0x1a8d('0x24')](_0x5c5acd,_0x5a4860);}});case _0x1a8d('0x3b'):var _0x2ec8ea=_['cloneDeep'](_0x4aaa10);if(_0x927511[_0x1a8d('0x3c')]){var _0x27734c={};_0x27734c[_0x927511[_0x1a8d('0x3c')]]=_0x1f2f93;_[_0x1a8d('0x36')](_0x2ec8ea['$or'],_0x27734c);}return _0x5f3b35[_0x1a8d('0x22')](_0x1a8d('0x3d'))['find'](_0x2ec8ea,_0x5a4860)[_0x1a8d('0x25')]()[_0x1a8d('0x2e')](function(_0x4506b8){if(_0x4506b8&&_0x4506b8['length']){return _0x4506b8;}else{var _0x5e7749=_[_0x1a8d('0x34')](_0x4aaa10);if(_0x927511[_0x1a8d('0x35')]){var _0x11cd7e={};_0x11cd7e[_0x927511[_0x1a8d('0x35')]]=_0x1f2f93;_[_0x1a8d('0x36')](_0x5e7749[_0x1a8d('0x37')],_0x11cd7e);}return _0x5f3b35[_0x1a8d('0x22')]('Contact')[_0x1a8d('0x24')](_0x5e7749,_0x5a4860)['then'](function(_0x51c50f){if(_0x51c50f&&_0x51c50f['length']){return _0x51c50f;}else{var _0x11a339=_['cloneDeep'](_0x4aaa10);if(_0x927511['additionalSearchLead']){var _0x3f5032={};_0x3f5032[_0x927511[_0x1a8d('0x39')]]=_0x1f2f93;_[_0x1a8d('0x36')](_0x11a339[_0x1a8d('0x37')],_0x3f5032);}return _0x5f3b35['sobject']('Lead')[_0x1a8d('0x24')](_0x11a339,_0x5a4860);}});}});case _0x1a8d('0x16'):var _0x181967=_['cloneDeep'](_0x4aaa10);if(_0x927511[_0x1a8d('0x35')]){var _0x27734c={};_0x27734c[_0x927511[_0x1a8d('0x35')]]=_0x1f2f93;_['merge'](_0x181967['$or'],_0x27734c);}return _0x5f3b35[_0x1a8d('0x22')](_0x1a8d('0x38'))[_0x1a8d('0x24')](_0x181967,_0x5a4860)[_0x1a8d('0x25')]();case _0x1a8d('0x17'):var _0x315d3d=_[_0x1a8d('0x34')](_0x4aaa10);if(_0x927511[_0x1a8d('0x39')]){var _0x27734c={};_0x27734c[_0x927511[_0x1a8d('0x39')]]=_0x1f2f93;_[_0x1a8d('0x36')](_0x315d3d[_0x1a8d('0x37')],_0x27734c);}return _0x5f3b35[_0x1a8d('0x22')]('Lead')['find'](_0x315d3d,_0x5a4860);case _0x1a8d('0x19'):var _0x2ec8ea=_['cloneDeep'](_0x4aaa10);if(_0x927511[_0x1a8d('0x3c')]){var _0x27734c={};_0x27734c[_0x927511[_0x1a8d('0x3c')]]=_0x1f2f93;_[_0x1a8d('0x36')](_0x2ec8ea[_0x1a8d('0x37')],_0x27734c);}return _0x5f3b35[_0x1a8d('0x22')](_0x1a8d('0x3d'))[_0x1a8d('0x24')](_0x2ec8ea,_0x5a4860);default:return null;}})['then'](function(_0x517495){if(_0x517495&&_0x517495[_0x1a8d('0x26')]){var _0x6f81cb=_['first'](_0x517495);if(_0x6f81cb){return BPromise[_0x1a8d('0x2a')]({'id':_0x6f81cb['Id'],'name':_0x6f81cb[_0x1a8d('0x2b')],'phone':_0x6f81cb['Phone'],'endUserType':_0x6f81cb[_0x1a8d('0x3e')][_0x1a8d('0x3f')][_0x1a8d('0x40')]()});}}})[_0x1a8d('0x2e')](function(_0x1b4c33){if(_0x1b4c33){logger[_0x1a8d('0x28')](_0x1a8d('0x41'),_0x1b4c33['endUserType'],_0x1f2f93);return BPromise[_0x1a8d('0x2a')](_0x1b4c33);}else{logger[_0x1a8d('0x28')](_0x1a8d('0x42'),_0x1f2f93);var _0x25dd44={'Phone':_0x1f2f93};if(_0x927511['moduleCreate']){if(_0x927511[_0x1a8d('0x43')]===_0x1a8d('0x16')){logger[_0x1a8d('0x28')](_0x1a8d('0x44'),_0x1f2f93,_0x927511[_0x1a8d('0x43')]);_0x25dd44[_0x1a8d('0x45')]=_0x547b03!==_0x1a8d('0x46')?_0x547b03:util[_0x1a8d('0x47')](_0x1a8d('0x48'),_0x1f2f93);}else if(_0x927511[_0x1a8d('0x43')]===_0x1a8d('0x17')){logger[_0x1a8d('0x28')](_0x1a8d('0x44'),_0x1f2f93,_0x927511['moduleCreate']);_0x25dd44[_0x1a8d('0x45')]=_0x547b03!==''?_0x547b03:util[_0x1a8d('0x47')](_0x1a8d('0x48'),_0x1f2f93);_0x25dd44['Company']='No\x20Company';}else if(_0x927511['moduleCreate']===_0x1a8d('0x19')){logger[_0x1a8d('0x28')](_0x1a8d('0x44'),_0x1f2f93,_0x927511[_0x1a8d('0x43')]);_0x25dd44[_0x1a8d('0x2b')]=_0x547b03!==''?_0x547b03:util[_0x1a8d('0x47')](_0x1a8d('0x48'),_0x1f2f93);}else{return null;}}return _0x5f3b35[_0x1a8d('0x22')](_[_0x1a8d('0x49')](_0x927511['moduleCreate']))[_0x1a8d('0x4a')](_0x25dd44)[_0x1a8d('0x2e')](function(_0x541250){return BPromise[_0x1a8d('0x2a')]({'id':_0x541250['id'],'endUserType':_0x927511['moduleCreate']});});}});}function getCustomFields(_0x3dfe02,_0x21578c){var _0x30e854={};if(_0x3dfe02[_0x1a8d('0x26')]>0x0){_[_0x1a8d('0x4b')](_0x3dfe02,function(_0x1d0467){if(_['includes']([_0x1a8d('0x4c'),'picklist'],_0x1d0467[_0x1a8d('0x3f')])&&_0x1d0467['idField']){_0x30e854[_0x1d0467[_0x1a8d('0x4d')]]=_0x1d0467[_0x1a8d('0x4e')][_0x1a8d('0x4f')]();}else if(_0x1d0467[_0x1a8d('0x3f')]==='variable'&&_0x1d0467[_0x1a8d('0x50')]&&_0x1d0467['idField']){_0x21578c[_0x1d0467[_0x1a8d('0x50')]]&&(_0x30e854[_0x1d0467[_0x1a8d('0x4d')]]=_0x21578c[_0x1d0467[_0x1a8d('0x50')]][_0x1a8d('0x4f')]());}else if(_0x1d0467[_0x1a8d('0x3f')]===_0x1a8d('0x51')&&_0x1d0467[_0x1a8d('0x52')]&&_0x1d0467[_0x1a8d('0x52')][_0x1a8d('0x53')]&&_0x1d0467[_0x1a8d('0x4d')]){_0x21578c[_0x1d0467['Variable'][_0x1a8d('0x53')]['toLowerCase']()]&&(_0x30e854[_0x1d0467[_0x1a8d('0x4d')]]=_0x21578c[_0x1d0467[_0x1a8d('0x52')][_0x1a8d('0x53')]['toLowerCase']()][_0x1a8d('0x4f')]());}});}return _0x30e854;}function getConnection(_0x4c2a25){var _0xcf44b4=_0x4c2a25[_0x1a8d('0x54')][_0x1a8d('0x55')](_0x4c2a25['securityToken']);var _0x52dec4=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4c2a25[_0x1a8d('0x56')]||_0x1a8d('0x57'),'clientId':_0x4c2a25[_0x1a8d('0x58')],'clientSecret':_0x4c2a25[_0x1a8d('0x59')]}});return _0x52dec4[_0x1a8d('0x5a')](_0x4c2a25['username'],_0xcf44b4)[_0x1a8d('0x2e')](function(){logger[_0x1a8d('0x28')](_0x1a8d('0x5b'));return _0x52dec4;});}exports[_0x1a8d('0x5c')]=function(_0xb96705,_0x494648,_0x20d82f,_0x409b99,_0x31cd5a,_0x388c75){var _0x54f2ec,_0x49e570,_0x243c15,_0x3560d2;_0x388c75[_0x1a8d('0x5d')]=intUtil[_0x1a8d('0x5e')](_0x388c75['serverUrl']);_0x388c75[_0x1a8d('0x56')]=intUtil['stripTrailingSlash'](_0x388c75[_0x1a8d('0x56')]);if(_0x31cd5a&&_0x31cd5a[_0x1a8d('0x5f')]){logger[_0x1a8d('0x28')]('[QUEUE]','Recording\x20is\x20enabled!');_0x494648[_0x1a8d('0x60')]=util[_0x1a8d('0x47')](_0x1a8d('0x61'),_0x388c75[_0x1a8d('0x5d')],_0x494648[_0x1a8d('0x62')],md5(_0x494648[_0x1a8d('0x62')]));}else{_0x494648[_0x1a8d('0x60')]='';}return getConnection(_0x388c75)[_0x1a8d('0x2e')](function(_0x4a8361){_0x3560d2=_0x4a8361;return getUser(_0x388c75,_0x409b99[_0x1a8d('0x63')],_0x3560d2);})[_0x1a8d('0x2e')](function(_0x293159){_0x54f2ec=_0x293159;return getEndUser(_0x388c75,_0x20d82f,_0x494648[_0x1a8d('0x64')],_0x494648[_0x1a8d('0x65')],_0x3560d2);})[_0x1a8d('0x2e')](function(_0x26c9d5){_0x49e570=_0x26c9d5;return getTicket(_0x388c75,_0x54f2ec,_0x49e570,_0x20d82f,_0x494648,_0x20d82f[_0x1a8d('0x66')],_0x3560d2,_0x1a8d('0x5c'));})[_0x1a8d('0x2e')](function(_0x4d3fee){_0x243c15=_0x4d3fee;logger[_0x1a8d('0x28')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x243c15['id']);logger[_0x1a8d('0x28')](_0x1a8d('0x67'),_0x243c15['id'],_0x409b99[_0x1a8d('0x53')],_0x388c75[_0x1a8d('0x3f')]);switch(_0x388c75[_0x1a8d('0x3f')]){case _0x1a8d('0x68'):emit(util['format'](_0x1a8d('0x69'),_0x409b99[_0x1a8d('0x53')]),'trigger:salesforce:display',{'recordId':_0x243c15['id']});break;case _0x1a8d('0x6a'):emit(util['format']('user:%s',_0x409b99['name']),_0x1a8d('0x6b'),{'uri':util[_0x1a8d('0x47')](_0x1a8d('0x6c'),_0x3560d2[_0x1a8d('0x6d')],_0x243c15['id'])});break;default:logger[_0x1a8d('0x6e')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x1a8d('0x6f')](function(_0x446b33){logger[_0x1a8d('0x6e')]('[QUEUE]',_0x446b33);});};exports['outbound']=function(_0x4ed878,_0x4c6f59,_0x19a8eb,_0x3435bc,_0x3b80c4,_0xd262af,_0x51ada1){var _0xbbc22f,_0x141426,_0x52fb6c,_0xe359d2;_0xd262af[_0x1a8d('0x5d')]=intUtil[_0x1a8d('0x5e')](_0xd262af['serverUrl']);_0xd262af[_0x1a8d('0x56')]=intUtil[_0x1a8d('0x5e')](_0xd262af[_0x1a8d('0x56')]);if(_0x51ada1&&_0x51ada1[_0x1a8d('0x70')]&&_0x51ada1[_0x1a8d('0x70')]!==_0x1a8d('0x71')){logger[_0x1a8d('0x28')](_0x1a8d('0x72'),_0x1a8d('0x73'));_0x4c6f59[_0x1a8d('0x60')]=util[_0x1a8d('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd262af[_0x1a8d('0x5d')],_0x4c6f59[_0x1a8d('0x62')],md5(_0x4c6f59[_0x1a8d('0x62')]));}return getConnection(_0xd262af)[_0x1a8d('0x2e')](function(_0x342461){_0xe359d2=_0x342461;return getUser(_0xd262af,_0x3435bc[_0x1a8d('0x63')],_0xe359d2);})[_0x1a8d('0x2e')](function(_0x318b6b){_0xbbc22f=_0x318b6b;return getEndUser(_0xd262af,_0x19a8eb,_0x4c6f59[_0x1a8d('0x74')],_0x4c6f59[_0x1a8d('0x75')],_0xe359d2);})['then'](function(_0x167f89){_0x141426=_0x167f89;return getTicket(_0xd262af,_0xbbc22f,_0x141426,_0x19a8eb,_0x4c6f59,_0x19a8eb[_0x1a8d('0x66')],_0xe359d2,_0x1a8d('0x76'));})[_0x1a8d('0x2e')](function(_0x584195){_0x52fb6c=_0x584195;logger[_0x1a8d('0x28')](_0x1a8d('0x77'),_0x52fb6c['id']);logger[_0x1a8d('0x28')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x52fb6c['id'],_0x3435bc['name'],_0xd262af['type']);switch(_0xd262af[_0x1a8d('0x3f')]){case _0x1a8d('0x68'):emit(util['format'](_0x1a8d('0x69'),_0x3435bc[_0x1a8d('0x53')]),'trigger:salesforce:display',{'recordId':_0x52fb6c['id']});break;case'newTab':emit(util[_0x1a8d('0x47')]('user:%s',_0x3435bc['name']),'trigger:browser:url',{'uri':util[_0x1a8d('0x47')](_0x1a8d('0x6c'),_0xe359d2['instanceUrl'],_0x52fb6c['id'])});break;default:logger[_0x1a8d('0x6e')](_0x1a8d('0x72'),_0x1a8d('0x78'));}})[_0x1a8d('0x6f')](function(_0x45bb19){logger['error'](_0x1a8d('0x72'),_0x45bb19);});};exports[_0x1a8d('0x79')]=function(_0x13fa5,_0x78a2c0,_0x188bfe,_0x51726d,_0x3f2950,_0xff03b2){var _0xa8784c,_0x265821,_0x2e8118,_0x5dea27;_0xff03b2[_0x1a8d('0x5d')]=intUtil[_0x1a8d('0x5e')](_0xff03b2[_0x1a8d('0x5d')]);_0xff03b2[_0x1a8d('0x56')]=intUtil[_0x1a8d('0x5e')](_0xff03b2[_0x1a8d('0x56')]);if(_0x3f2950&&_0x3f2950[_0x1a8d('0x5f')]){logger[_0x1a8d('0x28')]('['+_0x78a2c0[_0x1a8d('0x7a')][_0x1a8d('0x7b')]()+']',_0x1a8d('0x73'));_0x78a2c0[_0x1a8d('0x60')]=util[_0x1a8d('0x47')](_0x1a8d('0x61'),_0xff03b2[_0x1a8d('0x5d')],_0x78a2c0[_0x1a8d('0x62')],md5(_0x78a2c0[_0x1a8d('0x62')]));}else{_0x78a2c0['recordingURL']='';}return getConnection(_0xff03b2)[_0x1a8d('0x2e')](function(_0x11d59b){_0x5dea27=_0x11d59b;if(!_['isNil'](_0x51726d)){return getUser(_0xff03b2,_0x51726d[_0x1a8d('0x53')],_0x5dea27);}else{return getUser(_0xff03b2,null,_0x5dea27);}})[_0x1a8d('0x2e')](function(_0x1002c1){_0xa8784c=_0x1002c1;return getEndUser(_0xff03b2,_0x188bfe,_0x78a2c0[_0x1a8d('0x64')],_0x78a2c0[_0x1a8d('0x65')],_0x5dea27);})[_0x1a8d('0x2e')](function(_0x442e22){_0x265821=_0x442e22;return getTicket(_0xff03b2,_0xa8784c,_0x265821,_0x188bfe,_0x78a2c0,_0x188bfe[_0x1a8d('0x66')],_0x5dea27);})[_0x1a8d('0x2e')](function(_0x55a101){_0x2e8118=_0x55a101;logger[_0x1a8d('0x28')]('['+_0x78a2c0['lastevent'][_0x1a8d('0x7b')]()+_0x1a8d('0x7c'),_0x2e8118['id']);logger[_0x1a8d('0x28')]('['+_0x78a2c0[_0x1a8d('0x7a')][_0x1a8d('0x7b')]()+_0x1a8d('0x7d'),_0xff03b2['type']);})[_0x1a8d('0x6f')](function(_0x2b0c6e){logger[_0x1a8d('0x6e')]('['+_0x78a2c0[_0x1a8d('0x7a')]['toUpperCase']()+']',_0x2b0c6e);});}; \ No newline at end of file +var _0x44b4=['content','toString','variable','variableName','customVariable','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','newTab','user:%s','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','calleridname','calleridnum',']\x20Integration\x20account\x20type\x20%s.','catch','lodash','request-promise','moment','bluebird','jsforce','ioredis','./util','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','Task','ActivityDate','IsReminderSet','endUserType','lead','WhoId','account','ticketType','Case','AccountId','leadId','create','isNil','validateEmail','sobject','User','find','execute','then','length','Email','info','Agent\x20%s\x20found.','resolve','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','additionalSearchContact','merge','$or','cloneDeep','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','contact','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Company','No\x20Company','upperFirst','forEach','string','picklist','idField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44b4,0x138));var _0x444b=function(_0x3be650,_0x3e75f6){_0x3be650=_0x3be650-0x0;var _0x440588=_0x44b4[_0x3be650];return _0x440588;};'use strict';var _=require(_0x444b('0x0'));var rp=require(_0x444b('0x1'));var moment=require(_0x444b('0x2'));var BPromise=require(_0x444b('0x3'));var md5=require('md5');var jsforce=require(_0x444b('0x4'));var util=require('util');var Redis=require(_0x444b('0x5'));var intUtil=require(_0x444b('0x6'));var config=require('../../../../config/environment');var logger=require(_0x444b('0x7'))(_0x444b('0x8'));config[_0x444b('0x9')]=_[_0x444b('0xa')](config[_0x444b('0x9')],{'host':_0x444b('0xb'),'port':0x18eb});var io=require(_0x444b('0xc'))(new Redis(config[_0x444b('0x9')]));function emit(_0x526005,_0xe70b0c,_0xdea3e){io['to'](_0x526005)[_0x444b('0xd')](_0xe70b0c,_0xdea3e);}function getTicket(_0x1a041b,_0x2cd233,_0x1216ce,_0x2f8ffe,_0x47e1a8,_0x5ca738,_0x4e0dc0,_0x13c8e1){var _0x4abc0f=Object[_0x444b('0xe')]({},{'OwnerId':_0x2cd233['id'],'Subject':intUtil[_0x444b('0xf')](_0x2f8ffe[_0x444b('0x10')],_0x47e1a8,'\x20'),'Description':intUtil[_0x444b('0xf')](_0x2f8ffe[_0x444b('0x11')],_0x47e1a8,'\x0a')},getCustomFields(_0x5ca738,_0x47e1a8));if(_0x1216ce){if(_0x2f8ffe['ticketType']===_0x444b('0x12')){_0x4abc0f[_0x444b('0x13')]=moment['utc']();_0x4abc0f[_0x444b('0x14')]=![];_0x4abc0f['IsRecurrence']=![];if(_0x1216ce[_0x444b('0x15')]==='contact'||_0x1216ce[_0x444b('0x15')]===_0x444b('0x16')){_0x4abc0f[_0x444b('0x17')]=_0x1216ce['id'];}else if(_0x1216ce[_0x444b('0x15')]===_0x444b('0x18')){_0x4abc0f['WhatId']=_0x1216ce['id'];}}else if(_0x2f8ffe[_0x444b('0x19')]===_0x444b('0x1a')){if(_0x1216ce[_0x444b('0x15')]==='contact'){_0x4abc0f['ContactId']=_0x1216ce['id'];}else if(_0x1216ce[_0x444b('0x15')]===_0x444b('0x18')){_0x4abc0f[_0x444b('0x1b')]=_0x1216ce['id'];}else if(_0x1216ce[_0x444b('0x15')]==='lead'&&_0x2f8ffe['leadId']){_0x4abc0f[_0x2f8ffe[_0x444b('0x1c')]]=_0x1216ce['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x4e0dc0['sobject'](_0x2f8ffe[_0x444b('0x19')])[_0x444b('0x1d')](_0x4abc0f);}function getUser(_0x45c7d3,_0x3a9b97,_0x315591){if(!_[_0x444b('0x1e')](_0x3a9b97)&&intUtil[_0x444b('0x1f')](_0x3a9b97)){var _0x129c1a={'Email':_0x3a9b97};var _0x15f52a={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x315591[_0x444b('0x20')](_0x444b('0x21'))[_0x444b('0x22')](_0x129c1a,_0x15f52a)[_0x444b('0x23')]()[_0x444b('0x24')](function(_0x3934e4){if(_0x3934e4[_0x444b('0x25')]){var _0x53d81b=_[_0x444b('0x22')](_0x3934e4,function(_0x90ed6a){return _0x90ed6a[_0x444b('0x26')]===_0x3a9b97;});if(_0x53d81b){logger[_0x444b('0x27')](_0x444b('0x28'),_0x3a9b97);return BPromise[_0x444b('0x29')]({'id':_0x53d81b['Id'],'name':_0x53d81b['Name']});}}else{logger['info'](_0x444b('0x2a'),_0x3a9b97);return _0x315591[_0x444b('0x2b')]()['then'](function(_0x592b90){return BPromise['resolve']({'id':_0x592b90[_0x444b('0x2c')],'name':_0x592b90[_0x444b('0x2d')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3a9b97);return _0x315591[_0x444b('0x2b')]()[_0x444b('0x24')](function(_0xdaf149){return BPromise['resolve']({'id':_0xdaf149[_0x444b('0x2c')],'name':_0xdaf149[_0x444b('0x2d')]});});}}function getEndUser(_0x4fec34,_0x81b3e9,_0x5ba030,_0x7b7a97,_0x4b79c7){var _0x10a502={'$or':{'Phone':_0x7b7a97}};var _0x5d9f97={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x444b('0x29')]()[_0x444b('0x24')](function(){logger['info'](_0x444b('0x2e'),_0x7b7a97,_0x81b3e9[_0x444b('0x2f')]);switch(_0x81b3e9[_0x444b('0x2f')]){case _0x444b('0x30'):var _0x53ea72=_['cloneDeep'](_0x10a502);if(_0x81b3e9[_0x444b('0x31')]){var _0xa3df0b={};_0xa3df0b[_0x81b3e9[_0x444b('0x31')]]=_0x7b7a97;_[_0x444b('0x32')](_0x53ea72[_0x444b('0x33')],_0xa3df0b);}return _0x4b79c7[_0x444b('0x20')]('Contact')['find'](_0x53ea72,_0x5d9f97)['execute']()[_0x444b('0x24')](function(_0x4b6391){if(_0x4b6391&&_0x4b6391[_0x444b('0x25')]){return _0x4b6391;}else{var _0x451852=_[_0x444b('0x34')](_0x10a502);if(_0x81b3e9[_0x444b('0x35')]){var _0x38fe9d={};_0x38fe9d[_0x81b3e9[_0x444b('0x35')]]=_0x7b7a97;_[_0x444b('0x32')](_0x451852[_0x444b('0x33')],_0x38fe9d);}return _0x4b79c7[_0x444b('0x20')](_0x444b('0x36'))[_0x444b('0x22')](_0x451852,_0x5d9f97);}});case _0x444b('0x37'):var _0x5ef5e6=_[_0x444b('0x34')](_0x10a502);if(_0x81b3e9['additionalSearchAccount']){var _0xa3df0b={};_0xa3df0b[_0x81b3e9[_0x444b('0x38')]]=_0x7b7a97;_[_0x444b('0x32')](_0x5ef5e6[_0x444b('0x33')],_0xa3df0b);}return _0x4b79c7[_0x444b('0x20')](_0x444b('0x39'))['find'](_0x5ef5e6,_0x5d9f97)[_0x444b('0x23')]()['then'](function(_0x5ba1dd){if(_0x5ba1dd&&_0x5ba1dd['length']){return _0x5ba1dd;}else{var _0x56ccb7=_['cloneDeep'](_0x10a502);if(_0x81b3e9[_0x444b('0x31')]){var _0x17a0cb={};_0x17a0cb[_0x81b3e9[_0x444b('0x31')]]=_0x7b7a97;_[_0x444b('0x32')](_0x56ccb7[_0x444b('0x33')],_0x17a0cb);}return _0x4b79c7[_0x444b('0x20')](_0x444b('0x3a'))[_0x444b('0x22')](_0x56ccb7,_0x5d9f97)[_0x444b('0x24')](function(_0x491192){if(_0x491192&&_0x491192['length']){return _0x491192;}else{var _0x4a0b5e=_[_0x444b('0x34')](_0x10a502);if(_0x81b3e9[_0x444b('0x35')]){var _0x4ed9e8={};_0x4ed9e8[_0x81b3e9[_0x444b('0x35')]]=_0x7b7a97;_[_0x444b('0x32')](_0x4a0b5e['$or'],_0x4ed9e8);}return _0x4b79c7['sobject'](_0x444b('0x36'))['find'](_0x4a0b5e,_0x5d9f97);}});}});case _0x444b('0x3b'):var _0x53ea72=_['cloneDeep'](_0x10a502);if(_0x81b3e9[_0x444b('0x31')]){var _0xa3df0b={};_0xa3df0b[_0x81b3e9[_0x444b('0x31')]]=_0x7b7a97;_[_0x444b('0x32')](_0x53ea72['$or'],_0xa3df0b);}return _0x4b79c7[_0x444b('0x20')](_0x444b('0x3a'))[_0x444b('0x22')](_0x53ea72,_0x5d9f97)['execute']();case _0x444b('0x16'):var _0x2ef7a1=_[_0x444b('0x34')](_0x10a502);if(_0x81b3e9[_0x444b('0x35')]){var _0xa3df0b={};_0xa3df0b[_0x81b3e9[_0x444b('0x35')]]=_0x7b7a97;_['merge'](_0x2ef7a1[_0x444b('0x33')],_0xa3df0b);}return _0x4b79c7[_0x444b('0x20')]('Lead')[_0x444b('0x22')](_0x2ef7a1,_0x5d9f97);case _0x444b('0x18'):var _0x5ef5e6=_[_0x444b('0x34')](_0x10a502);if(_0x81b3e9[_0x444b('0x38')]){var _0xa3df0b={};_0xa3df0b[_0x81b3e9['additionalSearchAccount']]=_0x7b7a97;_[_0x444b('0x32')](_0x5ef5e6['$or'],_0xa3df0b);}return _0x4b79c7[_0x444b('0x20')](_0x444b('0x39'))[_0x444b('0x22')](_0x5ef5e6,_0x5d9f97);default:return null;}})['then'](function(_0x585783){if(_0x585783&&_0x585783[_0x444b('0x25')]){var _0x451be3=_[_0x444b('0x3c')](_0x585783);if(_0x451be3){return BPromise[_0x444b('0x29')]({'id':_0x451be3['Id'],'name':_0x451be3[_0x444b('0x3d')],'phone':_0x451be3[_0x444b('0x3e')],'endUserType':_0x451be3[_0x444b('0x3f')][_0x444b('0x40')][_0x444b('0x41')]()});}}})[_0x444b('0x24')](function(_0x4445c5){if(_0x4445c5){logger[_0x444b('0x27')](_0x444b('0x42'),_0x4445c5['endUserType'],_0x7b7a97);return BPromise[_0x444b('0x29')](_0x4445c5);}else{logger[_0x444b('0x27')](_0x444b('0x43'),_0x7b7a97);var _0x8ce47b={'Phone':_0x7b7a97};if(_0x81b3e9[_0x444b('0x44')]){if(_0x81b3e9[_0x444b('0x44')]===_0x444b('0x3b')){logger[_0x444b('0x27')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x7b7a97,_0x81b3e9[_0x444b('0x44')]);_0x8ce47b['LastName']=_0x5ba030!==_0x444b('0x45')?_0x5ba030:util['format'](_0x444b('0x46'),_0x7b7a97);}else if(_0x81b3e9[_0x444b('0x44')]===_0x444b('0x16')){logger[_0x444b('0x27')](_0x444b('0x47'),_0x7b7a97,_0x81b3e9['moduleCreate']);_0x8ce47b[_0x444b('0x48')]=_0x5ba030!==_0x444b('0x45')?_0x5ba030:util[_0x444b('0x49')](_0x444b('0x46'),_0x7b7a97);_0x8ce47b[_0x444b('0x4a')]=_0x444b('0x4b');}else if(_0x81b3e9[_0x444b('0x44')]===_0x444b('0x18')){logger[_0x444b('0x27')](_0x444b('0x47'),_0x7b7a97,_0x81b3e9['moduleCreate']);_0x8ce47b[_0x444b('0x3d')]=_0x5ba030!==''?_0x5ba030:util[_0x444b('0x49')]('Caller\x20-\x20%s',_0x7b7a97);}else{return null;}}return _0x4b79c7[_0x444b('0x20')](_[_0x444b('0x4c')](_0x81b3e9[_0x444b('0x44')]))[_0x444b('0x1d')](_0x8ce47b)[_0x444b('0x24')](function(_0x2ef589){return BPromise[_0x444b('0x29')]({'id':_0x2ef589['id'],'endUserType':_0x81b3e9['moduleCreate']});});}});}function getCustomFields(_0x95e39e,_0x17e461){var _0x478589={};if(_0x95e39e[_0x444b('0x25')]>0x0){_[_0x444b('0x4d')](_0x95e39e,function(_0x3f7f16){if(_['includes']([_0x444b('0x4e'),_0x444b('0x4f')],_0x3f7f16[_0x444b('0x40')])&&_0x3f7f16[_0x444b('0x50')]){_0x478589[_0x3f7f16['idField']]=_0x3f7f16[_0x444b('0x51')][_0x444b('0x52')]();}else if(_0x3f7f16[_0x444b('0x40')]===_0x444b('0x53')&&_0x3f7f16[_0x444b('0x54')]&&_0x3f7f16[_0x444b('0x50')]){_0x17e461[_0x3f7f16[_0x444b('0x54')]]&&(_0x478589[_0x3f7f16[_0x444b('0x50')]]=_0x17e461[_0x3f7f16[_0x444b('0x54')]][_0x444b('0x52')]());}else if(_0x3f7f16[_0x444b('0x40')]===_0x444b('0x55')&&_0x3f7f16[_0x444b('0x56')]&&_0x3f7f16[_0x444b('0x56')][_0x444b('0x57')]&&_0x3f7f16[_0x444b('0x50')]){_0x17e461[_0x3f7f16[_0x444b('0x56')][_0x444b('0x57')][_0x444b('0x41')]()]&&(_0x478589[_0x3f7f16[_0x444b('0x50')]]=_0x17e461[_0x3f7f16['Variable'][_0x444b('0x57')][_0x444b('0x41')]()][_0x444b('0x52')]());}});}return _0x478589;}function getConnection(_0x368b3a){var _0x4c684b=_0x368b3a[_0x444b('0x58')][_0x444b('0x59')](_0x368b3a['securityToken']);var _0x1ce330=new jsforce[(_0x444b('0x5a'))]({'oauth2':{'loginUrl':_0x368b3a[_0x444b('0x5b')]||_0x444b('0x5c'),'clientId':_0x368b3a[_0x444b('0x5d')],'clientSecret':_0x368b3a[_0x444b('0x5e')]}});return _0x1ce330[_0x444b('0x5f')](_0x368b3a[_0x444b('0x60')],_0x4c684b)[_0x444b('0x24')](function(){logger[_0x444b('0x27')](_0x444b('0x61'));return _0x1ce330;});}exports['queue']=function(_0x5e22f4,_0x183f44,_0x1c4b73,_0x581a2d,_0x4377e5,_0x2ab7cc){var _0xde488f,_0xbd6a12,_0x1fdb5a,_0x517bef;_0x2ab7cc[_0x444b('0x62')]=intUtil[_0x444b('0x63')](_0x2ab7cc[_0x444b('0x62')]);_0x2ab7cc[_0x444b('0x5b')]=intUtil['stripTrailingSlash'](_0x2ab7cc[_0x444b('0x5b')]);if(_0x4377e5&&_0x4377e5[_0x444b('0x64')]){logger[_0x444b('0x27')](_0x444b('0x65'),'Recording\x20is\x20enabled!');_0x183f44['recordingURL']=util[_0x444b('0x49')](_0x444b('0x66'),_0x2ab7cc[_0x444b('0x62')],_0x183f44[_0x444b('0x67')],md5(_0x183f44[_0x444b('0x67')]));}else{_0x183f44[_0x444b('0x68')]='';}return getConnection(_0x2ab7cc)[_0x444b('0x24')](function(_0x40e7fb){_0x517bef=_0x40e7fb;return getUser(_0x2ab7cc,_0x581a2d[_0x444b('0x69')],_0x517bef);})[_0x444b('0x24')](function(_0x437c24){_0xde488f=_0x437c24;return getEndUser(_0x2ab7cc,_0x1c4b73,_0x183f44['calleridname'],_0x183f44['calleridnum'],_0x517bef);})['then'](function(_0x11bd2a){_0xbd6a12=_0x11bd2a;return getTicket(_0x2ab7cc,_0xde488f,_0xbd6a12,_0x1c4b73,_0x183f44,_0x1c4b73['Fields'],_0x517bef,_0x444b('0x6a'));})[_0x444b('0x24')](function(_0x293ca9){_0x1fdb5a=_0x293ca9;logger[_0x444b('0x27')](_0x444b('0x6b'),_0x1fdb5a['id']);logger[_0x444b('0x27')](_0x444b('0x6c'),_0x1fdb5a['id'],_0x581a2d['name'],_0x2ab7cc['type']);switch(_0x2ab7cc['type']){case _0x444b('0x6d'):emit(util[_0x444b('0x49')]('user:%s',_0x581a2d[_0x444b('0x57')]),'trigger:salesforce:display',{'recordId':_0x1fdb5a['id']});break;case _0x444b('0x6e'):emit(util[_0x444b('0x49')](_0x444b('0x6f'),_0x581a2d[_0x444b('0x57')]),_0x444b('0x70'),{'uri':util[_0x444b('0x49')](_0x444b('0x71'),_0x517bef['instanceUrl'],_0x1fdb5a['id'])});break;default:logger[_0x444b('0x72')](_0x444b('0x73'));}})['catch'](function(_0x2cce78){logger[_0x444b('0x72')](_0x444b('0x65'),_0x2cce78);});};exports[_0x444b('0x74')]=function(_0x12a5c8,_0x344cdf,_0x5402b3,_0x2fce4d,_0x3009fd,_0x37ee7b,_0x21f4fc){var _0x1a5fa8,_0x1ceeca,_0x33600a,_0xcd6d78;_0x37ee7b[_0x444b('0x62')]=intUtil['stripTrailingSlash'](_0x37ee7b[_0x444b('0x62')]);_0x37ee7b[_0x444b('0x5b')]=intUtil[_0x444b('0x63')](_0x37ee7b[_0x444b('0x5b')]);if(_0x21f4fc&&_0x21f4fc[_0x444b('0x75')]&&_0x21f4fc[_0x444b('0x75')]!==_0x444b('0x76')){logger[_0x444b('0x27')](_0x444b('0x77'),_0x444b('0x78'));_0x344cdf[_0x444b('0x68')]=util[_0x444b('0x49')](_0x444b('0x66'),_0x37ee7b['serverUrl'],_0x344cdf[_0x444b('0x67')],md5(_0x344cdf[_0x444b('0x67')]));}return getConnection(_0x37ee7b)[_0x444b('0x24')](function(_0x50e0fc){_0xcd6d78=_0x50e0fc;return getUser(_0x37ee7b,_0x2fce4d[_0x444b('0x69')],_0xcd6d78);})[_0x444b('0x24')](function(_0x248e85){_0x1a5fa8=_0x248e85;return getEndUser(_0x37ee7b,_0x5402b3,_0x344cdf[_0x444b('0x79')],_0x344cdf[_0x444b('0x7a')],_0xcd6d78);})[_0x444b('0x24')](function(_0x5183bb){_0x1ceeca=_0x5183bb;return getTicket(_0x37ee7b,_0x1a5fa8,_0x1ceeca,_0x5402b3,_0x344cdf,_0x5402b3['Fields'],_0xcd6d78,_0x444b('0x74'));})['then'](function(_0x95e75){_0x33600a=_0x95e75;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x33600a['id']);logger[_0x444b('0x27')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x33600a['id'],_0x2fce4d['name'],_0x37ee7b[_0x444b('0x40')]);switch(_0x37ee7b[_0x444b('0x40')]){case _0x444b('0x6d'):emit(util['format']('user:%s',_0x2fce4d[_0x444b('0x57')]),'trigger:salesforce:display',{'recordId':_0x33600a['id']});break;case _0x444b('0x6e'):emit(util[_0x444b('0x49')]('user:%s',_0x2fce4d[_0x444b('0x57')]),_0x444b('0x70'),{'uri':util['format'](_0x444b('0x71'),_0xcd6d78['instanceUrl'],_0x33600a['id'])});break;default:logger['error'](_0x444b('0x77'),_0x444b('0x7b'));}})['catch'](function(_0x137512){logger[_0x444b('0x72')]('[OUTBOUND]',_0x137512);});};exports[_0x444b('0x7c')]=function(_0x1d2348,_0xf324c8,_0xd5fc40,_0x2dd5f1,_0x3a90aa,_0x19d83b){var _0x4975af,_0xd3e01f,_0x59c14a,_0x28687b;_0x19d83b['serverUrl']=intUtil[_0x444b('0x63')](_0x19d83b[_0x444b('0x62')]);_0x19d83b[_0x444b('0x5b')]=intUtil[_0x444b('0x63')](_0x19d83b[_0x444b('0x5b')]);if(_0x3a90aa&&_0x3a90aa[_0x444b('0x64')]){logger[_0x444b('0x27')]('['+_0xf324c8[_0x444b('0x7d')][_0x444b('0x7e')]()+']',_0x444b('0x78'));_0xf324c8[_0x444b('0x68')]=util['format'](_0x444b('0x66'),_0x19d83b['serverUrl'],_0xf324c8['uniqueid'],md5(_0xf324c8[_0x444b('0x67')]));}else{_0xf324c8['recordingURL']='';}return getConnection(_0x19d83b)[_0x444b('0x24')](function(_0x2be3f9){_0x28687b=_0x2be3f9;if(!_['isNil'](_0x2dd5f1)){return getUser(_0x19d83b,_0x2dd5f1[_0x444b('0x57')],_0x28687b);}else{return getUser(_0x19d83b,null,_0x28687b);}})[_0x444b('0x24')](function(_0x589cea){_0x4975af=_0x589cea;return getEndUser(_0x19d83b,_0xd5fc40,_0xf324c8[_0x444b('0x7f')],_0xf324c8[_0x444b('0x80')],_0x28687b);})[_0x444b('0x24')](function(_0x5c98df){_0xd3e01f=_0x5c98df;return getTicket(_0x19d83b,_0x4975af,_0xd3e01f,_0xd5fc40,_0xf324c8,_0xd5fc40['Fields'],_0x28687b);})[_0x444b('0x24')](function(_0x35e077){_0x59c14a=_0x35e077;logger[_0x444b('0x27')]('['+_0xf324c8[_0x444b('0x7d')][_0x444b('0x7e')]()+']\x20Ticket\x20%s\x20created.',_0x59c14a['id']);logger[_0x444b('0x27')]('['+_0xf324c8['lastevent'][_0x444b('0x7e')]()+_0x444b('0x81'),_0x19d83b['type']);})[_0x444b('0x82')](function(_0x93721a){logger[_0x444b('0x72')]('['+_0xf324c8[_0x444b('0x7d')][_0x444b('0x7e')]()+']',_0x93721a);});}; \ 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 cd32356..720d7c0 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 _0xd19e=['customField','toLowerCase','toString','type','idField','content','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','md5','ioredis','./util','../../../../config/environment','defaults','redis','localhost','then','length','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','userId','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','endUserId','error','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','forEach','includes','string','picklist'];(function(_0x2e35bc,_0x40919a){var _0x10f1e4=function(_0x1ce3ba){while(--_0x1ce3ba){_0x2e35bc['push'](_0x2e35bc['shift']());}};_0x10f1e4(++_0x40919a);}(_0xd19e,0xa8));var _0xed19=function(_0x593b07,_0x49e64e){_0x593b07=_0x593b07-0x0;var _0x5d534d=_0xd19e[_0x593b07];return _0x5d534d;};'use strict';var _=require(_0xed19('0x0'));var Promise=require(_0xed19('0x1'));var rp=require(_0xed19('0x2'));var util=require('util');var md5=require(_0xed19('0x3'));var Redis=require(_0xed19('0x4'));var intUtil=require(_0xed19('0x5'));var config=require(_0xed19('0x6'));var logger=require('../../../../config/logger')('servicenow');config['redis']=_[_0xed19('0x7')](config[_0xed19('0x8')],{'host':_0xed19('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xed19('0x8')]));function getAdminUser(_0x36c95d,_0x4ad018,_0x555412,_0x4cf488,_0x4c63fa,_0x283089){return new Promise(function(_0x24ace5,_0x41cdc6){var _0x1367ef={'method':'GET','uri':_0x4cf488+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x4c63fa+'&'+_0x283089,'auth':_0x4ad018,'json':!![]};return rp(_0x1367ef)[_0xed19('0xa')](function(_0xc27843){if(_0xc27843['result'][_0xed19('0xb')]>0x0){_0x555412[_0xed19('0xc')]=_0xc27843[_0xed19('0xd')][0x0][_0xed19('0xe')];}logger[_0xed19('0xf')]('['+[_0x36c95d[_0xed19('0x10')]()]+_0xed19('0x11'),_0x555412);_0x24ace5(_0x555412);})[_0xed19('0x12')](function(_0xa47f41){logger['error']('['+[_0x36c95d[_0xed19('0x10')]()]+']',_0xa47f41['message']);_0x41cdc6(_0xa47f41[_0xed19('0x13')]);});});}function getUser(_0x37a70b,_0x1ab556,_0x50c2e0,_0x1527e7,_0x53db14){return function(_0x1bd404){logger[_0xed19('0xf')]('['+[_0x37a70b[_0xed19('0x10')]()]+_0xed19('0x14'),_0x1bd404);return new Promise(function(_0x153086,_0xf5d6e8){if(intUtil[_0xed19('0x15')](_0x1bd404[_0xed19('0x16')])){var _0x47cb23={'method':_0xed19('0x17'),'uri':_0x50c2e0+_0xed19('0x18')+_0x1bd404['userEmail']+'&'+_0x1527e7+'&'+_0x53db14,'auth':_0x1ab556,'json':!![]};logger['info']('['+[_0x37a70b[_0xed19('0x10')]()]+_0xed19('0x19'),_0x47cb23);return rp(_0x47cb23)[_0xed19('0xa')](function(_0x1a967d){logger[_0xed19('0xf')]('['+[_0x37a70b['toUpperCase']()]+'],\x20getUser\x20entity',_0x1a967d);if(_0x1a967d[_0xed19('0xd')]['length']>0x0&&String(_0x1a967d[_0xed19('0xd')][0x0][_0xed19('0x1a')])===_0xed19('0x1b')){_0x1bd404[_0xed19('0x1c')]=_0x1a967d[_0xed19('0xd')][0x0][_0xed19('0xe')];}else{_0x1bd404[_0xed19('0x1c')]=_0x1bd404[_0xed19('0xc')];_0x1bd404[_0xed19('0x16')]=_0x1bd404[_0xed19('0x1d')];}logger[_0xed19('0xf')]('['+[_0x37a70b[_0xed19('0x10')]()]+'],\x20getUser\x20crm',_0x1bd404);_0x153086(_0x1bd404);})[_0xed19('0x12')](function(_0xebf80){logger['error']('['+[_0x37a70b[_0xed19('0x10')]()]+']',_0xebf80[_0xed19('0x13')]);_0xf5d6e8(_0xebf80[_0xed19('0x13')]);});}else{logger[_0xed19('0xf')]('['+[_0x37a70b[_0xed19('0x10')]()]+']\x20using\x20admin\x20profile');_0x1bd404['userId']=_0x1bd404[_0xed19('0xc')];_0x1bd404['userEmail']=_0x1bd404[_0xed19('0x1d')];_0x153086(_0x1bd404);}});};}function createEndUser(_0x26bfb5,_0x286be2,_0x3d3ece,_0x4b4d0c,_0x193ecc){logger[_0xed19('0xf')]('['+[_0x26bfb5['toUpperCase']()]+_0xed19('0x1e'),_0x3d3ece);return new Promise(function(_0x58fe8a,_0x4c6fcf){var _0x2ae298={'method':_0xed19('0x1f'),'uri':_0x4b4d0c+_0xed19('0x20')+_0x193ecc,'body':{'user_name':_0x3d3ece[_0xed19('0x21')],'roles':'user','first_name':_0x3d3ece[_0xed19('0x21')],'active':'true','date_format':_0xed19('0x22'),'phone':_0x3d3ece['endUserNumber']},'auth':_0x286be2,'json':!![]};return rp(_0x2ae298)[_0xed19('0xa')](function(_0x1971f3){logger['info']('['+[_0x26bfb5[_0xed19('0x10')]()]+_0xed19('0x23'),_0x1971f3[_0xed19('0xd')]);_0x3d3ece[_0xed19('0x24')]=_0x1971f3['result']['sys_id'];_0x58fe8a(_0x3d3ece);})[_0xed19('0x12')](function(_0x5c0422){logger[_0xed19('0x25')]('['+[_0x26bfb5[_0xed19('0x10')]()]+']',_0x5c0422[_0xed19('0x13')]);_0x4c6fcf(_0x5c0422[_0xed19('0x13')]);});});}function getEndUser(_0xfb9a31,_0x367d1c,_0x46fd3b,_0x5bef02,_0x49ce93){return function(_0x52704c){logger['info']('['+[_0xfb9a31[_0xed19('0x10')]()]+_0xed19('0x26'),_0x52704c);return new Promise(function(_0x59620a,_0x26073e){var _0x37501d={'method':_0xed19('0x17'),'uri':_0x46fd3b+_0xed19('0x27')+_0x52704c[_0xed19('0x21')]+'&'+_0x5bef02+'&'+_0x49ce93,'auth':_0x367d1c,'json':!![]};return rp(_0x37501d)[_0xed19('0xa')](function(_0x3c3056){if(_0x3c3056['result'][_0xed19('0xb')]>0x0){_0x52704c[_0xed19('0x24')]=_0x3c3056[_0xed19('0xd')][0x0][_0xed19('0xe')];logger[_0xed19('0xf')]('['+[_0xfb9a31['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x52704c);_0x59620a(_0x52704c);}else{return createEndUser(_0xfb9a31,_0x367d1c,_0x52704c,_0x46fd3b,_0x5bef02)[_0xed19('0xa')](function(_0x307e98){logger[_0xed19('0xf')]('['+[_0xfb9a31[_0xed19('0x10')]()]+'],\x20createEndUser\x20crm',_0x307e98);_0x59620a(_0x307e98);});}})[_0xed19('0x12')](function(_0xec8d5a){logger['error']('['+[_0xfb9a31[_0xed19('0x10')]()]+']',_0xec8d5a[_0xed19('0x13')]);_0x26073e(_0xec8d5a[_0xed19('0x13')]);});});};}function getCustomFields(_0x180802,_0x2c450a){var _0x1125ab={};if(_0x180802[_0xed19('0xb')]>0x0){_[_0xed19('0x28')](_0x180802,function(_0x57104e){if(_[_0xed19('0x29')]([_0xed19('0x2a'),_0xed19('0x2b')],_0x57104e['type'])&&_0x57104e['nameField']&&!_0x57104e[_0xed19('0x2c')]){_0x1125ab[_0x57104e['nameField'][_0xed19('0x2d')]()]=_0x57104e['content'][_0xed19('0x2e')]();}else if(_[_0xed19('0x29')]([_0xed19('0x2a'),_0xed19('0x2b')],_0x57104e[_0xed19('0x2f')])&&_0x57104e[_0xed19('0x30')]&&_0x57104e['customField']){_0x1125ab[_0x57104e[_0xed19('0x30')][_0xed19('0x2d')]()]=_0x57104e[_0xed19('0x31')]['toString']();}else if(_0x57104e[_0xed19('0x2f')]==='variable'&&_0x57104e['variableName']&&_0x57104e[_0xed19('0x30')]&&_0x57104e[_0xed19('0x2c')]){_0x1125ab[_0x57104e[_0xed19('0x30')][_0xed19('0x2d')]()]=_0x2c450a[_0x57104e['variableName']][_0xed19('0x2e')]();}else if(_0x57104e[_0xed19('0x2f')]===_0xed19('0x32')&&_0x57104e[_0xed19('0x33')]&&_0x57104e[_0xed19('0x33')][_0xed19('0x34')]&&_0x57104e[_0xed19('0x30')]&&_0x57104e[_0xed19('0x2c')]){_0x1125ab[_0x57104e[_0xed19('0x30')]['toLowerCase']()]=_0x2c450a[_0x57104e['Variable']['name'][_0xed19('0x2d')]()][_0xed19('0x2e')]();}});}return _0x1125ab;}function getTicket(_0xf17a2,_0x20e294,_0x33f25e,_0x540e5c,_0x55dad2,_0x4fc089){return function(_0x40b19f){logger[_0xed19('0xf')]('['+[_0xf17a2[_0xed19('0x10')]()]+_0xed19('0x35'),_0x40b19f);return new Promise(function(_0x288f94,_0x2acb49){var _0x41c96b=_0xf17a2[_0xed19('0x2d')]()==='outbound'?_0x40b19f[_0xed19('0x1c')]:_0x40b19f[_0xed19('0x24')];var _0x40e9d5={'method':_0xed19('0x1f'),'uri':_0x33f25e+_0xed19('0x36')+'?'+_0x4fc089,'body':Object['assign']({},{'active':_0xed19('0x1b'),'caller_id':_0x41c96b,'assigned_to':_0x40b19f[_0xed19('0x1c')],'short_description':intUtil['getString'](_0x540e5c[_0xed19('0x37')],_0x55dad2,'\x20'),'description':intUtil['getString'](_0x540e5c['Descriptions'],_0x55dad2,'\x0a')},getCustomFields(_0x540e5c[_0xed19('0x38')],_0x55dad2)),'auth':_0x20e294,'json':!![]};return rp(_0x40e9d5)['then'](function(_0x4ea20c){logger['info']('['+[_0xf17a2[_0xed19('0x10')]()]+_0xed19('0x39'),_0x4ea20c['result']);_0x40b19f[_0xed19('0x3a')]=_0x4ea20c[_0xed19('0xd')]['sys_id'];_0x40b19f['ticketNumber']=_0x4ea20c[_0xed19('0xd')][_0xed19('0x3b')];logger['info']('['+[_0xf17a2['toUpperCase']()]+_0xed19('0x3c'),_0x40b19f);_0x288f94(_0x40b19f);})[_0xed19('0x12')](function(_0xc41402){logger[_0xed19('0x25')]('['+[_0xf17a2[_0xed19('0x10')]()]+']',_0xc41402['message']);_0x2acb49(_0xc41402[_0xed19('0x13')]);});});};}function createRemoteTag(_0x3efc24,_0x35fc49,_0x218330,_0x205392){return new Promise(function(_0x109882,_0x349c54){var _0x3e5a9a={'method':_0xed19('0x1f'),'uri':_0x218330+_0xed19('0x3d')+'?'+_0x205392,'body':{'short_description':_0x3efc24,'global':!![],'active':!![],'name':_0x3efc24},'auth':_0x35fc49,'json':!![]};return rp(_0x3e5a9a)[_0xed19('0xa')](function(_0x218b1a){var _0x246f32=_0x218b1a[_0xed19('0xd')]['sys_id'];_0x109882(_0x246f32);});});}function getRemoteTag(_0xa91bb6,_0x3d3d0e,_0x39d3e8,_0x32383c,_0x4611b3){return new Promise(function(_0x2a8b63,_0xe9fdf2){var _0x52163b={'method':'GET','uri':_0x39d3e8+_0xed19('0x3d')+_0xed19('0x3e')+_0xa91bb6+'&'+_0x32383c,'auth':_0x3d3d0e,'json':!![]};return rp(_0x52163b)[_0xed19('0xa')](function(_0x38feb9){if(_0x38feb9[_0xed19('0xd')][_0xed19('0xb')]>0x0){var _0x4f83fe=_0x38feb9[_0xed19('0xd')][0x0][_0xed19('0xe')];_0x2a8b63(_0x4f83fe);}else{return createRemoteTag(_0xa91bb6,_0x3d3d0e,_0x39d3e8,_0x32383c)[_0xed19('0xa')](function(_0x24276c){_0x2a8b63(_0x24276c);});}});});}function assignTagToIncident(_0x488e1b,_0x201baf,_0x28c6fd,_0x39de8b,_0x5cd5c1){return new Promise(function(_0x3a1340,_0x976484){var _0x3397ee={'method':'POST','uri':_0x28c6fd+_0xed19('0x3f')+'?'+_0x5cd5c1,'body':{'label':_0x488e1b,'table':_0xed19('0x36'),'id_type':_0xed19('0x40'),'table_key':_0x39de8b[_0xed19('0x3a')],'title':_0xed19('0x41')+_0x39de8b[_0xed19('0x42')],'id_display':_0x39de8b[_0xed19('0x42')]},'auth':_0x201baf,'json':!![]};return rp(_0x3397ee)[_0xed19('0xa')](function(_0x286b6a){_0x3a1340();})['catch'](function(){_0x3a1340();});});}function manageTags(_0x4afa0f,_0x2424e1,_0x704c42,_0x2b1fed,_0x19e89e,_0x780e56,_0x15eb40){return new Promise(function(_0x1fc0b3,_0x28a063){var _0x1ff726=[];_0x2424e1[_0xed19('0x28')](function(_0x5cbb5a){_0x1ff726[_0xed19('0x43')](getRemoteTag(_0x5cbb5a,_0x704c42,_0x2b1fed,_0x780e56,_0x15eb40));});return Promise[_0xed19('0x44')](_0x1ff726)[_0xed19('0xa')](function(_0x20f128){if(_0x20f128[_0xed19('0xb')]){logger['info']('['+[_0x4afa0f['toUpperCase']()]+_0xed19('0x45'),_0x20f128);var _0x40f682=[];_0x20f128[_0xed19('0x28')](function(_0x23c0dd){_0x40f682[_0xed19('0x43')](assignTagToIncident(_0x23c0dd,_0x704c42,_0x2b1fed,_0x19e89e,_0x780e56));});return Promise[_0xed19('0x44')](_0x40f682)[_0xed19('0xa')](function(){_0x1fc0b3();})[_0xed19('0x12')](function(){_0x1fc0b3();});}else{_0x1fc0b3();}});});}function getTags(_0x26f2b9,_0x1bfe03,_0x38e46d,_0x25fd3e,_0x30ea60,_0x2168f3){return function(_0x473041){return new Promise(function(_0x51508d,_0x102d7e){var _0x3376d1=[];var _0x3bad55=_0x25fd3e['Tags'];if(_0x3bad55&&_0x3bad55['length']>0x0){_0x3376d1=_[_0xed19('0x46')](_0x3bad55,'name');}if(_0x3376d1[_0xed19('0xb')]>0x0){return manageTags(_0x26f2b9,_0x3376d1,_0x1bfe03,_0x38e46d,_0x473041,_0x30ea60,_0x2168f3)[_0xed19('0xa')](function(){_0x51508d(_0x473041);});}else{_0x51508d(_0x473041);}});};}function emit(_0x83b24,_0x178dfa,_0x249181){var _0x2a0870=_0xed19('0x47')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xed19('0x48')+'%255EORDERBYDESCnumber';var _0x4bb503={'uri':_0x83b24+_0xed19('0x49')+_0x249181+_0x2a0870};io['to'](util[_0xed19('0x4a')](_0xed19('0x4b'),_0x178dfa))[_0xed19('0x4c')](_0xed19('0x4d'),_0x4bb503);}exports['cs']=function(_0x2bb107,_0x37fa8a,_0x5ed4f8,_0x48c530,_0x11be8b,_0x27ba22,_0x1cdbc1,_0xa72fc5){var _0x5d69d1={};var _0x54f9de={'user':_0x27ba22[_0xed19('0x4e')],'pass':_0x27ba22[_0xed19('0x4f')]};var _0x1fbe37='sysparm_limit=1';var _0x3cf9ff=_0xed19('0x50');_0x27ba22[_0xed19('0x51')]=intUtil[_0xed19('0x52')](_0x27ba22[_0xed19('0x51')]);_0x27ba22[_0xed19('0x53')]=intUtil[_0xed19('0x52')](_0x27ba22['serverUrl']);var _0x3b1673=util['format'](_0xed19('0x54'),_0x27ba22['remoteUri']);_0x5d69d1['userEmail']=!_[_0xed19('0x55')](_0x48c530)?_0x48c530[_0xed19('0x56')]:null;_0x5d69d1[_0xed19('0x1d')]=_0x27ba22[_0xed19('0x56')];_0x5d69d1[_0xed19('0x21')]=_0xa72fc5['toLowerCase']()===_0xed19('0x57')?_0x37fa8a[_0xed19('0x58')]:_0x37fa8a[_0xed19('0x59')];_0x5d69d1[_0xed19('0x5a')]=_0xa72fc5===_0xed19('0x5b')||_0xa72fc5===_0xed19('0x5c')?'queue':'outbound';var _0x26733c=util[_0xed19('0x4a')](_0xed19('0x5d'),_0x27ba22[_0xed19('0x53')],_0x37fa8a[_0xed19('0x5e')],md5(_0x37fa8a[_0xed19('0x5e')]));if(_0x11be8b&&_0x11be8b[_0xed19('0x5f')]){logger[_0xed19('0xf')](_0xed19('0x60'),'Recording\x20is\x20enabled!');_0x37fa8a[_0xed19('0x61')]=_0x26733c;}else if(_0x1cdbc1&&_0x1cdbc1[_0xed19('0x62')]&&_0x1cdbc1[_0xed19('0x62')]!=='none'){logger[_0xed19('0xf')](_0xed19('0x63'),_0xed19('0x64'));_0x37fa8a[_0xed19('0x61')]=_0x26733c;}else{_0x37fa8a[_0xed19('0x61')]='';}return getAdminUser(_0xa72fc5,_0x54f9de,_0x5d69d1,_0x3b1673,_0x3cf9ff,_0x1fbe37)[_0xed19('0xa')](getUser(_0xa72fc5,_0x54f9de,_0x3b1673,_0x3cf9ff,_0x1fbe37))[_0xed19('0xa')](getEndUser(_0xa72fc5,_0x54f9de,_0x3b1673,_0x3cf9ff,_0x1fbe37))[_0xed19('0xa')](getTicket(_0xa72fc5,_0x54f9de,_0x3b1673,_0x5ed4f8,_0x37fa8a,_0x3cf9ff))[_0xed19('0xa')](function(_0x23e36e){logger[_0xed19('0xf')](util['format'](_0xed19('0x65'),_0x23e36e[_0xed19('0x3a')]));logger[_0xed19('0xf')](util[_0xed19('0x4a')](_0xed19('0x66'),_0xa72fc5));if(_0xa72fc5!==_0xed19('0x5c')){logger[_0xed19('0xf')]('['+[_0xa72fc5['toUpperCase']()]+']',_0xed19('0x67'));emit(_0x27ba22['remoteUri'],_0x48c530[_0xed19('0x34')],_0x23e36e[_0xed19('0x3a')]);}})[_0xed19('0x12')](function(_0x5a6b1c){logger[_0xed19('0x25')]('['+[_0xa72fc5[_0xed19('0x10')]()]+_0xed19('0x68'),util[_0xed19('0x69')](_0x5a6b1c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x59a5=['ticketNumber','number',']\x20getTicket\x20crm','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','email','queue','unmanaged','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','util','md5','ioredis','./util','../../../../config/environment','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','result','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','active','true','userId','adminId','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','sys_id','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','error','forEach','string','picklist','nameField','customField','toLowerCase','content','toString','includes','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId'];(function(_0x2958a7,_0x569f19){var _0x1e0865=function(_0x230883){while(--_0x230883){_0x2958a7['push'](_0x2958a7['shift']());}};_0x1e0865(++_0x569f19);}(_0x59a5,0x162));var _0x559a=function(_0x573faa,_0x5563b3){_0x573faa=_0x573faa-0x0;var _0x2760e9=_0x59a5[_0x573faa];return _0x2760e9;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0x559a('0x0'));var md5=require(_0x559a('0x1'));var Redis=require(_0x559a('0x2'));var intUtil=require(_0x559a('0x3'));var config=require(_0x559a('0x4'));var logger=require('../../../../config/logger')(_0x559a('0x5'));config[_0x559a('0x6')]=_[_0x559a('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x559a('0x8'))(new Redis(config[_0x559a('0x6')]));function getAdminUser(_0x47a641,_0xaaa338,_0x5a8662,_0x2b7ef9,_0x2d1fed,_0x296608){return new Promise(function(_0xfedbb3,_0x389232){var _0x2196cd={'method':_0x559a('0x9'),'uri':_0x2b7ef9+_0x559a('0xa')+'&'+_0x2d1fed+'&'+_0x296608,'auth':_0xaaa338,'json':!![]};return rp(_0x2196cd)[_0x559a('0xb')](function(_0x4e19c5){if(_0x4e19c5['result'][_0x559a('0xc')]>0x0){_0x5a8662['adminId']=_0x4e19c5[_0x559a('0xd')][0x0]['sys_id'];}logger[_0x559a('0xe')]('['+[_0x47a641[_0x559a('0xf')]()]+_0x559a('0x10'),_0x5a8662);_0xfedbb3(_0x5a8662);})[_0x559a('0x11')](function(_0x4efabe){logger['error']('['+[_0x47a641[_0x559a('0xf')]()]+']',_0x4efabe[_0x559a('0x12')]);_0x389232(_0x4efabe['message']);});});}function getUser(_0x1b4a79,_0x4fe74b,_0x3119a1,_0xf1aa7,_0x27e2b5){return function(_0x5d051a){logger[_0x559a('0xe')]('['+[_0x1b4a79['toUpperCase']()]+_0x559a('0x13'),_0x5d051a);return new Promise(function(_0x37fe71,_0x42e927){if(intUtil[_0x559a('0x14')](_0x5d051a[_0x559a('0x15')])){var _0x483d25={'method':_0x559a('0x9'),'uri':_0x3119a1+_0x559a('0x16')+_0x5d051a[_0x559a('0x15')]+'&'+_0xf1aa7+'&'+_0x27e2b5,'auth':_0x4fe74b,'json':!![]};logger['info']('['+[_0x1b4a79['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x483d25);return rp(_0x483d25)[_0x559a('0xb')](function(_0x5f188d){logger[_0x559a('0xe')]('['+[_0x1b4a79['toUpperCase']()]+'],\x20getUser\x20entity',_0x5f188d);if(_0x5f188d[_0x559a('0xd')][_0x559a('0xc')]>0x0&&String(_0x5f188d[_0x559a('0xd')][0x0][_0x559a('0x17')])===_0x559a('0x18')){_0x5d051a['userId']=_0x5f188d[_0x559a('0xd')][0x0]['sys_id'];}else{_0x5d051a[_0x559a('0x19')]=_0x5d051a[_0x559a('0x1a')];_0x5d051a[_0x559a('0x15')]=_0x5d051a[_0x559a('0x1b')];}logger[_0x559a('0xe')]('['+[_0x1b4a79['toUpperCase']()]+_0x559a('0x1c'),_0x5d051a);_0x37fe71(_0x5d051a);})[_0x559a('0x11')](function(_0x2766db){logger['error']('['+[_0x1b4a79['toUpperCase']()]+']',_0x2766db['message']);_0x42e927(_0x2766db[_0x559a('0x12')]);});}else{logger[_0x559a('0xe')]('['+[_0x1b4a79[_0x559a('0xf')]()]+']\x20using\x20admin\x20profile');_0x5d051a[_0x559a('0x19')]=_0x5d051a['adminId'];_0x5d051a[_0x559a('0x15')]=_0x5d051a[_0x559a('0x1b')];_0x37fe71(_0x5d051a);}});};}function createEndUser(_0x224b21,_0x399e49,_0x52c163,_0x1afc30,_0x1e8399){logger[_0x559a('0xe')]('['+[_0x224b21['toUpperCase']()]+_0x559a('0x1d'),_0x52c163);return new Promise(function(_0x3bd23b,_0x3a8a0f){var _0x2bf8d4={'method':_0x559a('0x1e'),'uri':_0x1afc30+_0x559a('0x1f')+_0x1e8399,'body':{'user_name':_0x52c163[_0x559a('0x20')],'roles':'user','first_name':_0x52c163[_0x559a('0x20')],'active':_0x559a('0x18'),'date_format':_0x559a('0x21'),'phone':_0x52c163[_0x559a('0x20')]},'auth':_0x399e49,'json':!![]};return rp(_0x2bf8d4)['then'](function(_0x2357a7){logger[_0x559a('0xe')]('['+[_0x224b21[_0x559a('0xf')]()]+_0x559a('0x22'),_0x2357a7[_0x559a('0xd')]);_0x52c163['endUserId']=_0x2357a7[_0x559a('0xd')]['sys_id'];_0x3bd23b(_0x52c163);})[_0x559a('0x11')](function(_0x301e03){logger['error']('['+[_0x224b21[_0x559a('0xf')]()]+']',_0x301e03['message']);_0x3a8a0f(_0x301e03['message']);});});}function getEndUser(_0x47ab7c,_0x5a85e7,_0x508561,_0x397f90,_0x1eb3e7){return function(_0x16ad32){logger[_0x559a('0xe')]('['+[_0x47ab7c[_0x559a('0xf')]()]+_0x559a('0x23'),_0x16ad32);return new Promise(function(_0x4bbec8,_0xca16ab){var _0x3e5761={'method':'GET','uri':_0x508561+_0x559a('0x24')+_0x16ad32[_0x559a('0x20')]+'&'+_0x397f90+'&'+_0x1eb3e7,'auth':_0x5a85e7,'json':!![]};return rp(_0x3e5761)['then'](function(_0x580beb){if(_0x580beb['result'][_0x559a('0xc')]>0x0){_0x16ad32[_0x559a('0x25')]=_0x580beb[_0x559a('0xd')][0x0][_0x559a('0x26')];logger[_0x559a('0xe')]('['+[_0x47ab7c[_0x559a('0xf')]()]+_0x559a('0x27'),_0x16ad32);_0x4bbec8(_0x16ad32);}else{return createEndUser(_0x47ab7c,_0x5a85e7,_0x16ad32,_0x508561,_0x397f90)[_0x559a('0xb')](function(_0x54e260){logger[_0x559a('0xe')]('['+[_0x47ab7c[_0x559a('0xf')]()]+_0x559a('0x28'),_0x54e260);_0x4bbec8(_0x54e260);});}})[_0x559a('0x11')](function(_0x5729de){logger[_0x559a('0x29')]('['+[_0x47ab7c['toUpperCase']()]+']',_0x5729de[_0x559a('0x12')]);_0xca16ab(_0x5729de[_0x559a('0x12')]);});});};}function getCustomFields(_0x135961,_0x2dc4ab){var _0x5355e6={};if(_0x135961[_0x559a('0xc')]>0x0){_[_0x559a('0x2a')](_0x135961,function(_0x4f05b7){if(_['includes']([_0x559a('0x2b'),_0x559a('0x2c')],_0x4f05b7['type'])&&_0x4f05b7[_0x559a('0x2d')]&&!_0x4f05b7[_0x559a('0x2e')]){_0x5355e6[_0x4f05b7[_0x559a('0x2d')][_0x559a('0x2f')]()]=_0x4f05b7[_0x559a('0x30')][_0x559a('0x31')]();}else if(_[_0x559a('0x32')](['string','picklist'],_0x4f05b7['type'])&&_0x4f05b7[_0x559a('0x33')]&&_0x4f05b7[_0x559a('0x2e')]){_0x5355e6[_0x4f05b7['idField'][_0x559a('0x2f')]()]=_0x4f05b7['content'][_0x559a('0x31')]();}else if(_0x4f05b7['type']===_0x559a('0x34')&&_0x4f05b7[_0x559a('0x35')]&&_0x4f05b7['idField']&&_0x4f05b7['customField']){_0x5355e6[_0x4f05b7['idField'][_0x559a('0x2f')]()]=_0x2dc4ab[_0x4f05b7['variableName']][_0x559a('0x31')]();}else if(_0x4f05b7['type']===_0x559a('0x36')&&_0x4f05b7[_0x559a('0x37')]&&_0x4f05b7[_0x559a('0x37')][_0x559a('0x38')]&&_0x4f05b7[_0x559a('0x33')]&&_0x4f05b7[_0x559a('0x2e')]){_0x5355e6[_0x4f05b7[_0x559a('0x33')][_0x559a('0x2f')]()]=_0x2dc4ab[_0x4f05b7['Variable'][_0x559a('0x38')][_0x559a('0x2f')]()][_0x559a('0x31')]();}});}return _0x5355e6;}function getTicket(_0x419a85,_0x2c49e2,_0x58d77c,_0x5bdbb7,_0x8f76ec,_0x4883b6){return function(_0x57cc8a){logger[_0x559a('0xe')]('['+[_0x419a85[_0x559a('0xf')]()]+_0x559a('0x39'),_0x57cc8a);return new Promise(function(_0x2b9a66,_0x21f276){var _0xaa3a30=_0x419a85[_0x559a('0x2f')]()===_0x559a('0x3a')?_0x57cc8a['userId']:_0x57cc8a[_0x559a('0x25')];var _0x3b472f={'method':_0x559a('0x1e'),'uri':_0x58d77c+_0x559a('0x3b')+'?'+_0x4883b6,'body':Object['assign']({},{'active':_0x559a('0x18'),'caller_id':_0xaa3a30,'assigned_to':_0x57cc8a[_0x559a('0x19')],'short_description':intUtil[_0x559a('0x3c')](_0x5bdbb7[_0x559a('0x3d')],_0x8f76ec,'\x20'),'description':intUtil[_0x559a('0x3c')](_0x5bdbb7[_0x559a('0x3e')],_0x8f76ec,'\x0a')},getCustomFields(_0x5bdbb7[_0x559a('0x3f')],_0x8f76ec)),'auth':_0x2c49e2,'json':!![]};return rp(_0x3b472f)[_0x559a('0xb')](function(_0x210e57){logger[_0x559a('0xe')]('['+[_0x419a85[_0x559a('0xf')]()]+_0x559a('0x40'),_0x210e57[_0x559a('0xd')]);_0x57cc8a[_0x559a('0x41')]=_0x210e57['result'][_0x559a('0x26')];_0x57cc8a[_0x559a('0x42')]=_0x210e57[_0x559a('0xd')][_0x559a('0x43')];logger['info']('['+[_0x419a85['toUpperCase']()]+_0x559a('0x44'),_0x57cc8a);_0x2b9a66(_0x57cc8a);})[_0x559a('0x11')](function(_0x235922){logger[_0x559a('0x29')]('['+[_0x419a85[_0x559a('0xf')]()]+']',_0x235922[_0x559a('0x12')]);_0x21f276(_0x235922['message']);});});};}function createRemoteTag(_0x15e2ca,_0x50a16f,_0x144ab7,_0x2fff72){return new Promise(function(_0x400724,_0xb7d745){var _0x4cf8aa={'method':_0x559a('0x1e'),'uri':_0x144ab7+'label'+'?'+_0x2fff72,'body':{'short_description':_0x15e2ca,'global':!![],'active':!![],'name':_0x15e2ca},'auth':_0x50a16f,'json':!![]};return rp(_0x4cf8aa)[_0x559a('0xb')](function(_0x3751f7){var _0x2f8e17=_0x3751f7['result'][_0x559a('0x26')];_0x400724(_0x2f8e17);});});}function getRemoteTag(_0x6d97a8,_0x1e35d5,_0x1586a1,_0x5197e0,_0x2296dc){return new Promise(function(_0x56a812,_0x37abf0){var _0x38036c={'method':_0x559a('0x9'),'uri':_0x1586a1+'label'+_0x559a('0x45')+_0x6d97a8+'&'+_0x5197e0,'auth':_0x1e35d5,'json':!![]};return rp(_0x38036c)[_0x559a('0xb')](function(_0x1c06c4){if(_0x1c06c4[_0x559a('0xd')][_0x559a('0xc')]>0x0){var _0x188360=_0x1c06c4[_0x559a('0xd')][0x0]['sys_id'];_0x56a812(_0x188360);}else{return createRemoteTag(_0x6d97a8,_0x1e35d5,_0x1586a1,_0x5197e0)[_0x559a('0xb')](function(_0x1aecd4){_0x56a812(_0x1aecd4);});}});});}function assignTagToIncident(_0x4c2834,_0x2022c3,_0x11bcb4,_0x3117f9,_0x3d7f32){return new Promise(function(_0x255126,_0x5b16e3){var _0x28cb30={'method':_0x559a('0x1e'),'uri':_0x11bcb4+_0x559a('0x46')+'?'+_0x3d7f32,'body':{'label':_0x4c2834,'table':_0x559a('0x3b'),'id_type':_0x559a('0x47'),'table_key':_0x3117f9[_0x559a('0x41')],'title':_0x559a('0x48')+_0x3117f9['ticketNumber'],'id_display':_0x3117f9[_0x559a('0x42')]},'auth':_0x2022c3,'json':!![]};return rp(_0x28cb30)[_0x559a('0xb')](function(_0x3dd660){_0x255126();})[_0x559a('0x11')](function(){_0x255126();});});}function manageTags(_0x171551,_0x41cb9e,_0x370176,_0x53e81b,_0x1fcd24,_0x11c4b6,_0x27ecac){return new Promise(function(_0x3af27a,_0x28747e){var _0x20efaa=[];_0x41cb9e[_0x559a('0x2a')](function(_0x19bb62){_0x20efaa[_0x559a('0x49')](getRemoteTag(_0x19bb62,_0x370176,_0x53e81b,_0x11c4b6,_0x27ecac));});return Promise[_0x559a('0x4a')](_0x20efaa)[_0x559a('0xb')](function(_0x466efe){if(_0x466efe[_0x559a('0xc')]){logger[_0x559a('0xe')]('['+[_0x171551['toUpperCase']()]+_0x559a('0x4b'),_0x466efe);var _0x2047e6=[];_0x466efe[_0x559a('0x2a')](function(_0xab8f01){_0x2047e6[_0x559a('0x49')](assignTagToIncident(_0xab8f01,_0x370176,_0x53e81b,_0x1fcd24,_0x11c4b6));});return Promise['all'](_0x2047e6)[_0x559a('0xb')](function(){_0x3af27a();})['catch'](function(){_0x3af27a();});}else{_0x3af27a();}});});}function getTags(_0x291807,_0x1560ea,_0xd0b843,_0x36600f,_0x164bf7,_0x1e803f){return function(_0x26ceee){return new Promise(function(_0x37f35d,_0xd0a495){var _0xc1c581=[];var _0x2a9aeb=_0x36600f[_0x559a('0x4c')];if(_0x2a9aeb&&_0x2a9aeb[_0x559a('0xc')]>0x0){_0xc1c581=_[_0x559a('0x4d')](_0x2a9aeb,_0x559a('0x38'));}if(_0xc1c581[_0x559a('0xc')]>0x0){return manageTags(_0x291807,_0xc1c581,_0x1560ea,_0xd0b843,_0x26ceee,_0x164bf7,_0x1e803f)[_0x559a('0xb')](function(){_0x37f35d(_0x26ceee);});}else{_0x37f35d(_0x26ceee);}});};}function emit(_0x2ee6db,_0x5a9a29,_0x3f50d9){var _0x56db7c='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x559a('0x4e')+_0x559a('0x4f');var _0x37a7f9={'uri':_0x2ee6db+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x3f50d9+_0x56db7c};io['to'](util[_0x559a('0x50')]('user:%s',_0x5a9a29))[_0x559a('0x51')](_0x559a('0x52'),_0x37a7f9);}exports['cs']=function(_0x40fcee,_0x474d26,_0x159e9a,_0x2b584b,_0x58cdda,_0x11bf4b,_0xea39d3,_0x269cdd){var _0x6d27be={};var _0x50ffc6={'user':_0x11bf4b[_0x559a('0x53')],'pass':_0x11bf4b[_0x559a('0x54')]};var _0x5368b8=_0x559a('0x55');var _0x3b88c=_0x559a('0x56');_0x11bf4b[_0x559a('0x57')]=intUtil['stripTrailingSlash'](_0x11bf4b[_0x559a('0x57')]);_0x11bf4b[_0x559a('0x58')]=intUtil[_0x559a('0x59')](_0x11bf4b[_0x559a('0x58')]);var _0xbc29e8=util['format'](_0x559a('0x5a'),_0x11bf4b['remoteUri']);_0x6d27be[_0x559a('0x15')]=!_['isNil'](_0x2b584b)?_0x2b584b['email']:null;_0x6d27be[_0x559a('0x1b')]=_0x11bf4b[_0x559a('0x5b')];_0x6d27be['endUserNumber']=_0x269cdd[_0x559a('0x2f')]()===_0x559a('0x3a')?_0x474d26['destcalleridnum']:_0x474d26['calleridnum'];_0x6d27be['callDirection']=_0x269cdd===_0x559a('0x5c')||_0x269cdd===_0x559a('0x5d')?_0x559a('0x5c'):_0x559a('0x3a');var _0x3b2ab2=util[_0x559a('0x50')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x11bf4b[_0x559a('0x58')],_0x474d26[_0x559a('0x5e')],md5(_0x474d26[_0x559a('0x5e')]));if(_0x58cdda&&_0x58cdda[_0x559a('0x5f')]){logger[_0x559a('0xe')]('[QUEUE]',_0x559a('0x60'));_0x474d26[_0x559a('0x61')]=_0x3b2ab2;}else if(_0xea39d3&&_0xea39d3[_0x559a('0x62')]&&_0xea39d3[_0x559a('0x62')]!==_0x559a('0x63')){logger[_0x559a('0xe')](_0x559a('0x64'),_0x559a('0x60'));_0x474d26[_0x559a('0x61')]=_0x3b2ab2;}else{_0x474d26[_0x559a('0x61')]='';}return getAdminUser(_0x269cdd,_0x50ffc6,_0x6d27be,_0xbc29e8,_0x3b88c,_0x5368b8)[_0x559a('0xb')](getUser(_0x269cdd,_0x50ffc6,_0xbc29e8,_0x3b88c,_0x5368b8))[_0x559a('0xb')](getEndUser(_0x269cdd,_0x50ffc6,_0xbc29e8,_0x3b88c,_0x5368b8))[_0x559a('0xb')](getTicket(_0x269cdd,_0x50ffc6,_0xbc29e8,_0x159e9a,_0x474d26,_0x3b88c))['then'](function(_0x12eab3){logger[_0x559a('0xe')](util[_0x559a('0x50')](_0x559a('0x65'),_0x12eab3['ticketId']));logger[_0x559a('0xe')](util[_0x559a('0x50')]('call\x20direction:\x20%s',_0x269cdd));if(_0x269cdd!=='unmanaged'){logger['info']('['+[_0x269cdd['toUpperCase']()]+']',_0x559a('0x66'));emit(_0x11bf4b[_0x559a('0x57')],_0x2b584b[_0x559a('0x38')],_0x12eab3[_0x559a('0x41')]);}})[_0x559a('0x11')](function(_0x48b53e){logger[_0x559a('0x29')]('['+[_0x269cdd[_0x559a('0xf')]()]+_0x559a('0x67'),util[_0x559a('0x68')](_0x48b53e,{'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 962e8e0..b22dfdf 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 _0x6a0d=['name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','debug','[HTTP]','merge','map','string','nameField','type','customField','custom_fields','content','Variable','toLowerCase','login','username','password','PLAIN','Account\x20%d\x20is\x20not\x20valid','Calls','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','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','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','[OUTBOUND]','destcalleridnum','Fields','Outbound','error','lastevent','toUpperCase','calleridname','bluebird','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','localhost','socket.io-emitter','redis','POST','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','description','Descriptions','date_start','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','Agent\x20found!','resolve'];(function(_0x509578,_0x2a2324){var _0x2080b9=function(_0xe9e16c){while(--_0xe9e16c){_0x509578['push'](_0x509578['shift']());}};_0x2080b9(++_0x2a2324);}(_0x6a0d,0x1a0));var _0xd6a0=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x6a0d[_0x31e29a];return _0x32d892;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0xd6a0('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xd6a0('0x1'));var logger=require(_0xd6a0('0x2'))(_0xd6a0('0x3'));config['redis']=_[_0xd6a0('0x4')](config['redis'],{'host':_0xd6a0('0x5'),'port':0x18eb});var io=require(_0xd6a0('0x6'))(new Redis(config[_0xd6a0('0x7')]));var def={'method':_0xd6a0('0x8'),'json':!![]};function emit(_0x2dad6d,_0x118a19,_0x11ac60){io['to'](_0x2dad6d)['emit'](_0x118a19,_0x11ac60);}function getTicket(_0x50b09f,_0x185768,_0x17f27f,_0x520284,_0x3f24ec,_0x43171b,_0x1fdd02,_0x38b4a5){logger['info'](_0xd6a0('0x9'));var _0x3456b6=new Date();var _0x57d6f5=[{'name':_0xd6a0('0xa'),'value':intUtil[_0xd6a0('0xb')](_0x520284[_0xd6a0('0xc')],_0x3f24ec,'\x20')},{'name':_0xd6a0('0xd'),'value':_0x185768['id']},{'name':'created_by','value':_0x185768['id']},{'name':_0xd6a0('0xe'),'value':intUtil[_0xd6a0('0xb')](_0x520284[_0xd6a0('0xf')],_0x3f24ec,'\x0a')},{'name':_0xd6a0('0x10'),'value':_0x3456b6['toISOString']()['slice'](0x0,0x13)[_0xd6a0('0x11')]('T','\x20')},{'name':_0xd6a0('0x12'),'value':'0'},{'name':_0xd6a0('0x13'),'value':'15'},{'name':_0xd6a0('0x14'),'value':_0x17f27f['id']},{'name':_0xd6a0('0x15'),'value':_0xd6a0('0x16')},{'name':'parent_name','value':_0x17f27f['name']},{'name':_0xd6a0('0x17'),'value':_0x38b4a5}];if(_0x43171b[_0xd6a0('0x18')]){_[_0xd6a0('0x19')](_0x43171b,function(_0x1cf12c){if(_0x3f24ec[_0x1cf12c[_0xd6a0('0x1a')]]){_0x57d6f5[_0xd6a0('0x1b')]({'name':_0x1cf12c[_0xd6a0('0x1c')],'value':_0x3f24ec[_0x1cf12c['variableName']]});}});}return request({'form':{'method':_0xd6a0('0x1d'),'input_type':_0xd6a0('0x1e'),'response_type':_0xd6a0('0x1e'),'rest_data':JSON[_0xd6a0('0x1f')]({'session':_0x1fdd02['id'],'module_name':'Calls','name_value_list':_0x57d6f5})}});}function getAuth(_0x21c011){return util[_0xd6a0('0x20')](_0xd6a0('0x21'),new Buffer(_0x21c011[_0xd6a0('0x22')]+':X')[_0xd6a0('0x23')](_0xd6a0('0x24')));}function getServerInfo(_0x477690){return request({'form':{'method':_0xd6a0('0x25'),'input_type':_0xd6a0('0x1e'),'response_type':_0xd6a0('0x1e'),'rest_data':JSON[_0xd6a0('0x1f')]({'session':_0x477690['id']})}});}function getUser(_0x2333c7,_0x2b27c5,_0x3ba558){if(!_[_0xd6a0('0x26')](_0x2b27c5)){logger[_0xd6a0('0x27')](_0xd6a0('0x28'),_0x2b27c5);return request({'form':{'method':'get_entry_list','input_type':_0xd6a0('0x1e'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x3ba558['id'],'module_name':_0xd6a0('0x29'),'query':util['format'](_0xd6a0('0x2a'),_0x2b27c5),'order_by':'','offset':'0','select_fields':['id',_0xd6a0('0xa'),_0xd6a0('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xd6a0('0x2c')](function(_0x40a919){if(_0x40a919[_0xd6a0('0x2d')][_0xd6a0('0x18')]){var _0x431a89=_['find'](_0x40a919[_0xd6a0('0x2d')],function(_0x235e23){return _0x235e23['name_value_list'][_0xd6a0('0x2b')]['value']===_0x2b27c5;});if(_0x431a89){logger['info'](_0xd6a0('0x2e'));return BPromise[_0xd6a0('0x2f')]({'id':_0x431a89[_0xd6a0('0x30')]['id'][_0xd6a0('0x31')],'name':_0x431a89['name_value_list']['name'][_0xd6a0('0x31')]});}}logger[_0xd6a0('0x27')](_0xd6a0('0x32'));return BPromise[_0xd6a0('0x2f')]({'id':_0x3ba558['name_value_list'][_0xd6a0('0x33')]['value'],'name':_0x3ba558[_0xd6a0('0x30')]['user_name'][_0xd6a0('0x31')]});});}else{logger['info'](_0xd6a0('0x34'));return BPromise[_0xd6a0('0x2f')]({'id':_0x3ba558[_0xd6a0('0x30')][_0xd6a0('0x33')][_0xd6a0('0x31')],'name':_0x3ba558[_0xd6a0('0x30')]['user_name'][_0xd6a0('0x31')]});}}function getEndUser(_0x32cf10,_0x3b36ac,_0x57a86e,_0x3f5146){logger[_0xd6a0('0x27')](_0xd6a0('0x35'),_0x57a86e);return request({'form':{'method':_0xd6a0('0x36'),'input_type':_0xd6a0('0x1e'),'response_type':_0xd6a0('0x1e'),'rest_data':JSON[_0xd6a0('0x1f')]({'session':_0x3f5146['id'],'module_name':'Contacts','query':util[_0xd6a0('0x20')](_0xd6a0('0x37'),_0x57a86e),'order_by':'','offset':'0','select_fields':['id',_0xd6a0('0xa'),_0xd6a0('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x1dacb2){if(_0x1dacb2['entry_list'][_0xd6a0('0x18')]){var _0xa4ab32=_[_0xd6a0('0x39')](_0x1dacb2['entry_list'],function(_0x163c38){return _0x163c38[_0xd6a0('0x30')][_0xd6a0('0x38')]['value']===_0x57a86e;});if(_0xa4ab32){logger['info'](_0xd6a0('0x3a'));return BPromise['resolve']({'id':_0xa4ab32[_0xd6a0('0x30')]['id']['value'],'name':_0xa4ab32[_0xd6a0('0x30')]['name'][_0xd6a0('0x31')],'phone':_0xa4ab32[_0xd6a0('0x30')][_0xd6a0('0x38')][_0xd6a0('0x31')]});}}else{logger[_0xd6a0('0x27')](_0xd6a0('0x3b'));return request({'form':{'method':'set_entry','input_type':_0xd6a0('0x1e'),'response_type':_0xd6a0('0x1e'),'rest_data':JSON[_0xd6a0('0x1f')]({'session':_0x3f5146['id'],'module_name':_0xd6a0('0x16'),'name_value_list':[{'name':_0xd6a0('0x3c'),'value':_0x3b36ac!==_0xd6a0('0x3d')?_0x3b36ac:util['format']('Caller\x20-\x20%s',_0x57a86e)},{'name':_0xd6a0('0x38'),'value':_0x57a86e}]})}})[_0xd6a0('0x2c')](function(_0x15ea18){logger[_0xd6a0('0x27')]('Enduser\x20created.');return BPromise['resolve']({'id':_0x15ea18['id'],'name':_0x15ea18['entry_list']['first_name'][_0xd6a0('0x31')],'phone':_0x15ea18['entry_list'][_0xd6a0('0x38')][_0xd6a0('0x31')]});});}});}function request(_0x2d0108){logger[_0xd6a0('0x3e')](_0xd6a0('0x3f'),JSON[_0xd6a0('0x1f')](_0x2d0108));return rp(_[_0xd6a0('0x40')](def,_0x2d0108));}function getTags(_0x496e80,_0x509410){var _0x26c382=[];if(_0x496e80&&_0x496e80[_0xd6a0('0x18')]>0x0){_0x26c382=_[_0xd6a0('0x41')](_0x496e80,_0x509410);}return _0x26c382;}function getCustomFields(_0x5115f0,_0xb52bde){var _0x130b93=[];var _0x59df05={'custom_fields':[]};if(_0x5115f0[_0xd6a0('0x18')]>0x0){_[_0xd6a0('0x19')](_0x5115f0,function(_0x125b35){if(_0x125b35['type']===_0xd6a0('0x42')&&_0x125b35['nameField']&&!_0x125b35['customField']){_0x59df05[_0x125b35[_0xd6a0('0x43')]['toLowerCase']()]=_0x125b35['content']['toString']();}else if(_0x125b35[_0xd6a0('0x44')]===_0xd6a0('0x42')&&_0x125b35[_0xd6a0('0x1c')]&&_0x125b35[_0xd6a0('0x45')]){_0x59df05[_0xd6a0('0x46')]['push']({'id':_0x125b35[_0xd6a0('0x1c')],'value':_0x125b35[_0xd6a0('0x47')]['toString']()});}else if(_0x125b35[_0xd6a0('0x44')]==='variable'&&_0x125b35[_0xd6a0('0x1a')]&&_0x125b35[_0xd6a0('0x1c')]&&_0x125b35[_0xd6a0('0x45')]){_0xb52bde[_0x125b35['variableName']]&&_0x59df05['custom_fields'][_0xd6a0('0x1b')]({'id':_0x125b35[_0xd6a0('0x1c')],'value':_0xb52bde[_0x125b35[_0xd6a0('0x1a')]]['toString']()});}else if(_0x125b35[_0xd6a0('0x44')]==='customVariable'&&_0x125b35[_0xd6a0('0x48')]&&_0x125b35[_0xd6a0('0x48')]['name']&&_0x125b35[_0xd6a0('0x1c')]&&_0x125b35['customField']){_0xb52bde[_0x125b35[_0xd6a0('0x48')][_0xd6a0('0xa')][_0xd6a0('0x49')]()]&&_0x59df05[_0xd6a0('0x46')][_0xd6a0('0x1b')]({'id':_0x125b35[_0xd6a0('0x1c')],'value':_0xb52bde[_0x125b35[_0xd6a0('0x48')][_0xd6a0('0xa')]['toLowerCase']()][_0xd6a0('0x23')]()});}});}return _0x59df05;}function getConnection(_0x15bded){return request({'method':'POST','form':{'method':_0xd6a0('0x4a'),'input_type':_0xd6a0('0x1e'),'response_type':_0xd6a0('0x1e'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x15bded[_0xd6a0('0x4b')],'password':_0x15bded[_0xd6a0('0x4c')],'encryption':_0xd6a0('0x4d')},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x18cc03){var _0x84430d=_0x18cc03;if(_0x84430d['id']){def['sessionID']=_0x84430d['id'];return BPromise['resolve'](_0x84430d);}else{throw new Error(util['format'](_0xd6a0('0x4e'),_0x15bded['id']));}});}function setRelationship(_0x5a6642,_0x53d9ce,_0x22c13c,_0x3308d4){return request({'form':{'method':'set_relationship','input_type':_0xd6a0('0x1e'),'response_type':_0xd6a0('0x1e'),'rest_data':JSON['stringify']({'session':_0x5a6642['id'],'module_name':_0xd6a0('0x4f'),'module_id':_0x22c13c['id'],'link_field_name':_0x3308d4,'related_ids':[_0x53d9ce['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x541d90,_0x478e15,_0xd7f478,_0xd0b341,_0x3b4e07,_0x44fe77){var _0x143ebc,_0x4d183e,_0x39224e,_0xc183f7;_0x44fe77[_0xd6a0('0x50')]=intUtil['stripTrailingSlash'](_0x44fe77[_0xd6a0('0x50')]);_0x44fe77[_0xd6a0('0x51')]=intUtil[_0xd6a0('0x52')](_0x44fe77['serverUrl']);def[_0xd6a0('0x53')]=util[_0xd6a0('0x20')](_0xd6a0('0x54'),_0x44fe77[_0xd6a0('0x50')]);if(_0x3b4e07&&_0x3b4e07[_0xd6a0('0x55')]){logger[_0xd6a0('0x27')]('[QUEUE]',_0xd6a0('0x56'));_0x478e15['recordingURL']=util[_0xd6a0('0x20')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x44fe77[_0xd6a0('0x51')],_0x478e15[_0xd6a0('0x57')],md5(_0x478e15[_0xd6a0('0x57')]));}else{_0x478e15[_0xd6a0('0x58')]='';}return getConnection(_0x44fe77)['then'](function(_0x168ef4){_0xc183f7=_0x168ef4;return getUser(_0x44fe77,_0xd0b341[_0xd6a0('0xa')],_0xc183f7);})[_0xd6a0('0x2c')](function(_0x466e25){_0x143ebc=_0x466e25;logger[_0xd6a0('0x27')](_0xd6a0('0x59'),_0x143ebc['id']);return getEndUser(_0x44fe77,_0x478e15['calleridname'],_0x478e15[_0xd6a0('0x5a')],_0xc183f7);})[_0xd6a0('0x2c')](function(_0x361cd7){_0x4d183e=_0x361cd7;logger[_0xd6a0('0x27')](_0xd6a0('0x5b'),_0x4d183e['id']);return getTicket(_0x44fe77,_0x143ebc,_0x4d183e,_0xd7f478,_0x478e15,_0xd7f478['Fields'],_0xc183f7,_0xd6a0('0x5c'));})[_0xd6a0('0x2c')](function(_0x2c7990){_0x39224e=_0x2c7990;logger[_0xd6a0('0x27')](_0xd6a0('0x5d'));logger[_0xd6a0('0x27')](_0xd6a0('0x5e'),_0x39224e['id']);return setRelationship(_0xc183f7,_0x143ebc,_0x39224e,_0xd6a0('0x5f'));})[_0xd6a0('0x2c')](function(){return setRelationship(_0xc183f7,_0x4d183e,_0x39224e,_0xd6a0('0x60'));})[_0xd6a0('0x2c')](function(){return getServerInfo(_0xc183f7);})[_0xd6a0('0x2c')](function(_0x373153){var _0x2e00d0=parseInt(_0x373153[_0xd6a0('0x61')][_0xd6a0('0x62')](0x0));var _0x1e47cf=util['format'](_0xd6a0('0x63'),_0x44fe77['remoteUri'],_0x39224e['id']);if(_0x2e00d0>0x6){_0x1e47cf=util['format'](_0xd6a0('0x64'),_0x44fe77[_0xd6a0('0x50')],_0x39224e['id']);}logger[_0xd6a0('0x27')](_0xd6a0('0x65'),_0xd6a0('0x66'));emit(util[_0xd6a0('0x20')](_0xd6a0('0x67'),_0xd0b341[_0xd6a0('0xa')]),_0xd6a0('0x68'),{'uri':_0x1e47cf});})[_0xd6a0('0x69')](function(_0x3d2de9){logger['error'](_0xd6a0('0x65'),JSON[_0xd6a0('0x1f')](_0x3d2de9));});};exports[_0xd6a0('0x6a')]=function(_0x2ca692,_0x531ded,_0x571aae,_0x5ad8bb,_0x21c992,_0x2b50f3,_0x376404){var _0xe5dc43,_0x41a6da,_0x50b842,_0x28455f;_0x2b50f3[_0xd6a0('0x50')]=intUtil['stripTrailingSlash'](_0x2b50f3['remoteUri']);_0x2b50f3[_0xd6a0('0x51')]=intUtil['stripTrailingSlash'](_0x2b50f3[_0xd6a0('0x51')]);def['uri']=util[_0xd6a0('0x20')](_0xd6a0('0x54'),_0x2b50f3[_0xd6a0('0x50')]);if(_0x376404&&_0x376404[_0xd6a0('0x6b')]&&_0x376404['recordingFormat']!=='none'){logger[_0xd6a0('0x27')](_0xd6a0('0x6c'),_0xd6a0('0x56'));_0x531ded['recordingURL']=util[_0xd6a0('0x20')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b50f3[_0xd6a0('0x51')],_0x531ded[_0xd6a0('0x57')],md5(_0x531ded[_0xd6a0('0x57')]));}return getConnection(_0x2b50f3)['then'](function(_0x6925aa){_0x28455f=_0x6925aa;return getUser(_0x2b50f3,_0x5ad8bb['name'],_0x28455f);})['then'](function(_0x1d5680){_0xe5dc43=_0x1d5680;logger[_0xd6a0('0x27')](_0xd6a0('0x59'),_0xe5dc43['id']);return getEndUser(_0x2b50f3,_0x531ded['destcalleridname'],_0x531ded[_0xd6a0('0x6d')],_0x28455f);})[_0xd6a0('0x2c')](function(_0x58a3cb){_0x41a6da=_0x58a3cb;logger[_0xd6a0('0x27')]('The\x20Enduser\x20ID\x20is:',_0x41a6da['id']);return getTicket(_0x2b50f3,_0xe5dc43,_0x41a6da,_0x571aae,_0x531ded,_0x571aae[_0xd6a0('0x6e')],_0x28455f,_0xd6a0('0x6f'));})[_0xd6a0('0x2c')](function(_0x41bdd9){_0x50b842=_0x41bdd9;logger['info'](_0xd6a0('0x5d'));logger[_0xd6a0('0x27')](_0xd6a0('0x5e'),_0x50b842['id']);return setRelationship(_0x28455f,_0xe5dc43,_0x50b842,_0xd6a0('0x5f'));})[_0xd6a0('0x2c')](function(){return setRelationship(_0x28455f,_0x41a6da,_0x50b842,_0xd6a0('0x60'));})[_0xd6a0('0x2c')](function(){return getServerInfo(_0x28455f);})['then'](function(_0x4e6b78){var _0x2b0b96=parseInt(_0x4e6b78[_0xd6a0('0x61')]['charAt'](0x0));var _0x4a8928=util[_0xd6a0('0x20')](_0xd6a0('0x63'),_0x2b50f3[_0xd6a0('0x50')],_0x50b842['id']);if(_0x2b0b96>0x6){_0x4a8928=util[_0xd6a0('0x20')](_0xd6a0('0x64'),_0x2b50f3[_0xd6a0('0x50')],_0x50b842['id']);}logger[_0xd6a0('0x27')](_0xd6a0('0x6c'),_0xd6a0('0x66'));emit(util[_0xd6a0('0x20')]('user:%s',_0x5ad8bb[_0xd6a0('0xa')]),_0xd6a0('0x68'),{'uri':_0x4a8928});})[_0xd6a0('0x69')](function(_0x332d0f){logger[_0xd6a0('0x70')]('[OUTBOUND]',JSON['stringify'](_0x332d0f));});};exports['unmanaged']=function(_0x480664,_0x488365,_0x272206,_0x4dc234,_0x25d36f,_0x486984){var _0x2028d6,_0x405d4b,_0x1fed95,_0x1e845c;_0x486984['remoteUri']=intUtil['stripTrailingSlash'](_0x486984[_0xd6a0('0x50')]);_0x486984['serverUrl']=intUtil['stripTrailingSlash'](_0x486984[_0xd6a0('0x51')]);def['uri']=util[_0xd6a0('0x20')]('%s/service/v4_1/rest.php',_0x486984['remoteUri']);if(_0x25d36f&&_0x25d36f[_0xd6a0('0x55')]){logger[_0xd6a0('0x27')]('['+_0x488365[_0xd6a0('0x71')][_0xd6a0('0x72')]()+']',_0xd6a0('0x56'));_0x488365[_0xd6a0('0x58')]=util[_0xd6a0('0x20')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x486984[_0xd6a0('0x51')],_0x488365['uniqueid'],md5(_0x488365[_0xd6a0('0x57')]));}else{_0x488365[_0xd6a0('0x58')]='';}return getConnection(_0x486984)[_0xd6a0('0x2c')](function(_0x122c9f){_0x1e845c=_0x122c9f;if(!_[_0xd6a0('0x26')](_0x4dc234)){return getUser(_0x486984,_0x4dc234[_0xd6a0('0xa')],_0x1e845c);}else{return getUser(_0x486984,null,_0x1e845c);}})[_0xd6a0('0x2c')](function(_0x56ec41){_0x2028d6=_0x56ec41;logger[_0xd6a0('0x27')](_0xd6a0('0x59'),_0x2028d6['id']);return getEndUser(_0x486984,_0x488365[_0xd6a0('0x73')],_0x488365['calleridnum'],_0x1e845c);})[_0xd6a0('0x2c')](function(_0x320a92){_0x405d4b=_0x320a92;logger[_0xd6a0('0x27')](_0xd6a0('0x5b'),_0x405d4b['id']);return getTicket(_0x486984,_0x2028d6,_0x405d4b,_0x272206,_0x488365,_0x272206[_0xd6a0('0x6e')],_0x1e845c,_0xd6a0('0x5c'));})[_0xd6a0('0x2c')](function(_0x2c7643){_0x1fed95=_0x2c7643;logger[_0xd6a0('0x27')]('Ticket\x20created!');logger[_0xd6a0('0x27')](_0xd6a0('0x5e'),_0x1fed95['id']);return setRelationship(_0x1e845c,_0x2028d6,_0x1fed95,_0xd6a0('0x5f'));})[_0xd6a0('0x2c')](function(){return setRelationship(_0x1e845c,_0x405d4b,_0x1fed95,_0xd6a0('0x60'));})[_0xd6a0('0x2c')](function(){return getServerInfo(_0x1e845c);})[_0xd6a0('0x69')](function(_0x5f5952){logger['error']('['+_0x488365[_0xd6a0('0x71')][_0xd6a0('0x72')]()+']',JSON[_0xd6a0('0x1f')](_0x5f5952));});}; \ No newline at end of file +var _0xa9cc=['forEach','push','idField','variableName','set_entry','stringify','Basic\x20%s','apiKey','toString','base64','get_server_info','JSON','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','user_name','then','entry_list','length','find','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','map','type','string','customField','nameField','toLowerCase','content','custom_fields','variable','customVariable','Variable','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','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...','trigger:browser:url','catch','error','recordingFormat','none','[OUTBOUND]','destcalleridnum','Outbound','Ticket\x20created!','version','user:%s','toUpperCase','calleridname','calleridnum','lastevent','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','toISOString','slice','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9cc,0x14d));var _0xca9c=function(_0x5cc9cf,_0x7be987){_0x5cc9cf=_0x5cc9cf-0x0;var _0x3bb1d8=_0xa9cc[_0x5cc9cf];return _0x3bb1d8;};'use strict';var _=require(_0xca9c('0x0'));var rp=require(_0xca9c('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0xca9c('0x2'));var Redis=require(_0xca9c('0x3'));var intUtil=require(_0xca9c('0x4'));var config=require(_0xca9c('0x5'));var logger=require(_0xca9c('0x6'))(_0xca9c('0x7'));config[_0xca9c('0x8')]=_[_0xca9c('0x9')](config[_0xca9c('0x8')],{'host':_0xca9c('0xa'),'port':0x18eb});var io=require(_0xca9c('0xb'))(new Redis(config[_0xca9c('0x8')]));var def={'method':_0xca9c('0xc'),'json':!![]};function emit(_0x523b71,_0x2ed2e8,_0x1f3d55){io['to'](_0x523b71)['emit'](_0x2ed2e8,_0x1f3d55);}function getTicket(_0x5dda47,_0x446c94,_0x1851ca,_0x57681f,_0xa62b11,_0x37a283,_0x202388,_0x4756ce){logger[_0xca9c('0xd')](_0xca9c('0xe'));var _0x5d2aa0=new Date();var _0x4cd8c8=[{'name':_0xca9c('0xf'),'value':intUtil[_0xca9c('0x10')](_0x57681f[_0xca9c('0x11')],_0xa62b11,'\x20')},{'name':'assigned_user_id','value':_0x446c94['id']},{'name':_0xca9c('0x12'),'value':_0x446c94['id']},{'name':_0xca9c('0x13'),'value':intUtil[_0xca9c('0x10')](_0x57681f[_0xca9c('0x14')],_0xa62b11,'\x0a')},{'name':'date_start','value':_0x5d2aa0[_0xca9c('0x15')]()[_0xca9c('0x16')](0x0,0x13)[_0xca9c('0x17')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xca9c('0x18'),'value':'15'},{'name':_0xca9c('0x19'),'value':_0x1851ca['id']},{'name':_0xca9c('0x1a'),'value':_0xca9c('0x1b')},{'name':_0xca9c('0x1c'),'value':_0x1851ca[_0xca9c('0xf')]},{'name':_0xca9c('0x1d'),'value':_0x4756ce}];if(_0x37a283['length']){_[_0xca9c('0x1e')](_0x37a283,function(_0x420345){if(_0xa62b11[_0x420345['variableName']]){_0x4cd8c8[_0xca9c('0x1f')]({'name':_0x420345[_0xca9c('0x20')],'value':_0xa62b11[_0x420345[_0xca9c('0x21')]]});}});}return request({'form':{'method':_0xca9c('0x22'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xca9c('0x23')]({'session':_0x202388['id'],'module_name':'Calls','name_value_list':_0x4cd8c8})}});}function getAuth(_0x1c228b){return util['format'](_0xca9c('0x24'),new Buffer(_0x1c228b[_0xca9c('0x25')]+':X')[_0xca9c('0x26')](_0xca9c('0x27')));}function getServerInfo(_0xff9841){return request({'form':{'method':_0xca9c('0x28'),'input_type':'JSON','response_type':_0xca9c('0x29'),'rest_data':JSON['stringify']({'session':_0xff9841['id']})}});}function getUser(_0x2f8b49,_0x5add3b,_0x170a75){if(!_[_0xca9c('0x2a')](_0x5add3b)){logger[_0xca9c('0xd')](_0xca9c('0x2b'),_0x5add3b);return request({'form':{'method':_0xca9c('0x2c'),'input_type':_0xca9c('0x29'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x170a75['id'],'module_name':_0xca9c('0x2d'),'query':util[_0xca9c('0x2e')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x5add3b),'order_by':'','offset':'0','select_fields':['id','name',_0xca9c('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xca9c('0x30')](function(_0x4eb49a){if(_0x4eb49a[_0xca9c('0x31')][_0xca9c('0x32')]){var _0xf5698a=_[_0xca9c('0x33')](_0x4eb49a[_0xca9c('0x31')],function(_0x5b9003){return _0x5b9003[_0xca9c('0x34')][_0xca9c('0x2f')][_0xca9c('0x35')]===_0x5add3b;});if(_0xf5698a){logger[_0xca9c('0xd')]('Agent\x20found!');return BPromise[_0xca9c('0x36')]({'id':_0xf5698a[_0xca9c('0x34')]['id'][_0xca9c('0x35')],'name':_0xf5698a['name_value_list'][_0xca9c('0xf')][_0xca9c('0x35')]});}}logger[_0xca9c('0xd')](_0xca9c('0x37'));return BPromise[_0xca9c('0x36')]({'id':_0x170a75[_0xca9c('0x34')][_0xca9c('0x38')][_0xca9c('0x35')],'name':_0x170a75[_0xca9c('0x34')][_0xca9c('0x2f')][_0xca9c('0x35')]});});}else{logger[_0xca9c('0xd')](_0xca9c('0x39'));return BPromise[_0xca9c('0x36')]({'id':_0x170a75[_0xca9c('0x34')]['user_id'][_0xca9c('0x35')],'name':_0x170a75[_0xca9c('0x34')][_0xca9c('0x2f')]['value']});}}function getEndUser(_0x5312f0,_0x2011fb,_0x57d7f4,_0x331945){logger[_0xca9c('0xd')]('Searching\x20enduser\x20with\x20phone',_0x57d7f4);return request({'form':{'method':_0xca9c('0x2c'),'input_type':'JSON','response_type':_0xca9c('0x29'),'rest_data':JSON['stringify']({'session':_0x331945['id'],'module_name':'Contacts','query':util[_0xca9c('0x2e')](_0xca9c('0x3a'),_0x57d7f4),'order_by':'','offset':'0','select_fields':['id','name',_0xca9c('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xca9c('0x30')](function(_0x3be581){if(_0x3be581['entry_list'][_0xca9c('0x32')]){var _0x240008=_['find'](_0x3be581['entry_list'],function(_0x22b30a){return _0x22b30a[_0xca9c('0x34')]['phone_home']['value']===_0x57d7f4;});if(_0x240008){logger[_0xca9c('0xd')]('Enduser\x20found!');return BPromise[_0xca9c('0x36')]({'id':_0x240008[_0xca9c('0x34')]['id'][_0xca9c('0x35')],'name':_0x240008[_0xca9c('0x34')]['name'][_0xca9c('0x35')],'phone':_0x240008[_0xca9c('0x34')][_0xca9c('0x3b')][_0xca9c('0x35')]});}}else{logger[_0xca9c('0xd')](_0xca9c('0x3c'));return request({'form':{'method':_0xca9c('0x22'),'input_type':_0xca9c('0x29'),'response_type':_0xca9c('0x29'),'rest_data':JSON['stringify']({'session':_0x331945['id'],'module_name':_0xca9c('0x1b'),'name_value_list':[{'name':_0xca9c('0x3d'),'value':_0x2011fb!==_0xca9c('0x3e')?_0x2011fb:util[_0xca9c('0x2e')](_0xca9c('0x3f'),_0x57d7f4)},{'name':_0xca9c('0x3b'),'value':_0x57d7f4}]})}})[_0xca9c('0x30')](function(_0x4c6b4b){logger[_0xca9c('0xd')](_0xca9c('0x40'));return BPromise[_0xca9c('0x36')]({'id':_0x4c6b4b['id'],'name':_0x4c6b4b[_0xca9c('0x31')][_0xca9c('0x3d')][_0xca9c('0x35')],'phone':_0x4c6b4b[_0xca9c('0x31')][_0xca9c('0x3b')][_0xca9c('0x35')]});});}});}function request(_0x17e558){logger[_0xca9c('0x41')](_0xca9c('0x42'),JSON[_0xca9c('0x23')](_0x17e558));return rp(_['merge'](def,_0x17e558));}function getTags(_0x3a311f,_0x4f7e66){var _0x3d0d22=[];if(_0x3a311f&&_0x3a311f[_0xca9c('0x32')]>0x0){_0x3d0d22=_[_0xca9c('0x43')](_0x3a311f,_0x4f7e66);}return _0x3d0d22;}function getCustomFields(_0x3af3fb,_0x27619b){var _0x13dcfe=[];var _0x25e33f={'custom_fields':[]};if(_0x3af3fb[_0xca9c('0x32')]>0x0){_[_0xca9c('0x1e')](_0x3af3fb,function(_0x2bb2e9){if(_0x2bb2e9[_0xca9c('0x44')]===_0xca9c('0x45')&&_0x2bb2e9['nameField']&&!_0x2bb2e9[_0xca9c('0x46')]){_0x25e33f[_0x2bb2e9[_0xca9c('0x47')][_0xca9c('0x48')]()]=_0x2bb2e9[_0xca9c('0x49')][_0xca9c('0x26')]();}else if(_0x2bb2e9['type']===_0xca9c('0x45')&&_0x2bb2e9[_0xca9c('0x20')]&&_0x2bb2e9[_0xca9c('0x46')]){_0x25e33f[_0xca9c('0x4a')][_0xca9c('0x1f')]({'id':_0x2bb2e9[_0xca9c('0x20')],'value':_0x2bb2e9['content'][_0xca9c('0x26')]()});}else if(_0x2bb2e9['type']===_0xca9c('0x4b')&&_0x2bb2e9[_0xca9c('0x21')]&&_0x2bb2e9[_0xca9c('0x20')]&&_0x2bb2e9['customField']){_0x27619b[_0x2bb2e9[_0xca9c('0x21')]]&&_0x25e33f[_0xca9c('0x4a')][_0xca9c('0x1f')]({'id':_0x2bb2e9[_0xca9c('0x20')],'value':_0x27619b[_0x2bb2e9[_0xca9c('0x21')]][_0xca9c('0x26')]()});}else if(_0x2bb2e9[_0xca9c('0x44')]===_0xca9c('0x4c')&&_0x2bb2e9[_0xca9c('0x4d')]&&_0x2bb2e9[_0xca9c('0x4d')]['name']&&_0x2bb2e9[_0xca9c('0x20')]&&_0x2bb2e9[_0xca9c('0x46')]){_0x27619b[_0x2bb2e9[_0xca9c('0x4d')][_0xca9c('0xf')]['toLowerCase']()]&&_0x25e33f['custom_fields'][_0xca9c('0x1f')]({'id':_0x2bb2e9[_0xca9c('0x20')],'value':_0x27619b[_0x2bb2e9['Variable'][_0xca9c('0xf')][_0xca9c('0x48')]()][_0xca9c('0x26')]()});}});}return _0x25e33f;}function getConnection(_0xd46643){return request({'method':_0xca9c('0xc'),'form':{'method':'login','input_type':_0xca9c('0x29'),'response_type':_0xca9c('0x29'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0xd46643['username'],'password':_0xd46643[_0xca9c('0x4e')],'encryption':_0xca9c('0x4f')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xca9c('0x30')](function(_0x5b7234){var _0x4ce59c=_0x5b7234;if(_0x4ce59c['id']){def[_0xca9c('0x50')]=_0x4ce59c['id'];return BPromise['resolve'](_0x4ce59c);}else{throw new Error(util[_0xca9c('0x2e')](_0xca9c('0x51'),_0xd46643['id']));}});}function setRelationship(_0xd98c8b,_0x469dd4,_0x4ddef5,_0x120146){return request({'form':{'method':_0xca9c('0x52'),'input_type':_0xca9c('0x29'),'response_type':_0xca9c('0x29'),'rest_data':JSON['stringify']({'session':_0xd98c8b['id'],'module_name':'Calls','module_id':_0x4ddef5['id'],'link_field_name':_0x120146,'related_ids':[_0x469dd4['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xca9c('0x53')]=function(_0x5acd29,_0xce354e,_0x50135f,_0x5e64b2,_0x38bee4,_0xb22063){var _0x3180b1,_0x54935b,_0x1085f0,_0x2fbab6;_0xb22063[_0xca9c('0x54')]=intUtil[_0xca9c('0x55')](_0xb22063[_0xca9c('0x54')]);_0xb22063[_0xca9c('0x56')]=intUtil[_0xca9c('0x55')](_0xb22063[_0xca9c('0x56')]);def[_0xca9c('0x57')]=util[_0xca9c('0x2e')](_0xca9c('0x58'),_0xb22063['remoteUri']);if(_0x38bee4&&_0x38bee4[_0xca9c('0x59')]){logger[_0xca9c('0xd')](_0xca9c('0x5a'),_0xca9c('0x5b'));_0xce354e[_0xca9c('0x5c')]=util[_0xca9c('0x2e')](_0xca9c('0x5d'),_0xb22063[_0xca9c('0x56')],_0xce354e[_0xca9c('0x5e')],md5(_0xce354e['uniqueid']));}else{_0xce354e[_0xca9c('0x5c')]='';}return getConnection(_0xb22063)['then'](function(_0x2d3f75){_0x2fbab6=_0x2d3f75;return getUser(_0xb22063,_0x5e64b2[_0xca9c('0xf')],_0x2fbab6);})[_0xca9c('0x30')](function(_0xcf8f03){_0x3180b1=_0xcf8f03;logger['info'](_0xca9c('0x5f'),_0x3180b1['id']);return getEndUser(_0xb22063,_0xce354e['calleridname'],_0xce354e['calleridnum'],_0x2fbab6);})[_0xca9c('0x30')](function(_0x1e838f){_0x54935b=_0x1e838f;logger[_0xca9c('0xd')](_0xca9c('0x60'),_0x54935b['id']);return getTicket(_0xb22063,_0x3180b1,_0x54935b,_0x50135f,_0xce354e,_0x50135f[_0xca9c('0x61')],_0x2fbab6,_0xca9c('0x62'));})[_0xca9c('0x30')](function(_0x2abfe5){_0x1085f0=_0x2abfe5;logger[_0xca9c('0xd')]('Ticket\x20created!');logger[_0xca9c('0xd')](_0xca9c('0x63'),_0x1085f0['id']);return setRelationship(_0x2fbab6,_0x3180b1,_0x1085f0,_0xca9c('0x64'));})['then'](function(){return setRelationship(_0x2fbab6,_0x54935b,_0x1085f0,_0xca9c('0x65'));})[_0xca9c('0x30')](function(){return getServerInfo(_0x2fbab6);})[_0xca9c('0x30')](function(_0xf01427){var _0x1cb5ad=parseInt(_0xf01427['version'][_0xca9c('0x66')](0x0));var _0x5c3b44=util['format'](_0xca9c('0x67'),_0xb22063[_0xca9c('0x54')],_0x1085f0['id']);if(_0x1cb5ad>0x6){_0x5c3b44=util['format'](_0xca9c('0x68'),_0xb22063[_0xca9c('0x54')],_0x1085f0['id']);}logger['info']('[QUEUE]',_0xca9c('0x69'));emit(util['format']('user:%s',_0x5e64b2[_0xca9c('0xf')]),_0xca9c('0x6a'),{'uri':_0x5c3b44});})[_0xca9c('0x6b')](function(_0x530eaa){logger[_0xca9c('0x6c')](_0xca9c('0x5a'),JSON[_0xca9c('0x23')](_0x530eaa));});};exports['outbound']=function(_0x2054b0,_0x4861c4,_0x303b93,_0x25ab6b,_0x35fd08,_0xc939a5,_0x807776){var _0x5bff7a,_0x2248ab,_0x29c575,_0x3426c8;_0xc939a5[_0xca9c('0x54')]=intUtil['stripTrailingSlash'](_0xc939a5['remoteUri']);_0xc939a5[_0xca9c('0x56')]=intUtil[_0xca9c('0x55')](_0xc939a5[_0xca9c('0x56')]);def[_0xca9c('0x57')]=util['format'](_0xca9c('0x58'),_0xc939a5[_0xca9c('0x54')]);if(_0x807776&&_0x807776[_0xca9c('0x6d')]&&_0x807776[_0xca9c('0x6d')]!==_0xca9c('0x6e')){logger[_0xca9c('0xd')](_0xca9c('0x6f'),_0xca9c('0x5b'));_0x4861c4[_0xca9c('0x5c')]=util[_0xca9c('0x2e')](_0xca9c('0x5d'),_0xc939a5['serverUrl'],_0x4861c4[_0xca9c('0x5e')],md5(_0x4861c4['uniqueid']));}return getConnection(_0xc939a5)[_0xca9c('0x30')](function(_0x55afcc){_0x3426c8=_0x55afcc;return getUser(_0xc939a5,_0x25ab6b[_0xca9c('0xf')],_0x3426c8);})['then'](function(_0x5a3619){_0x5bff7a=_0x5a3619;logger[_0xca9c('0xd')](_0xca9c('0x5f'),_0x5bff7a['id']);return getEndUser(_0xc939a5,_0x4861c4['destcalleridname'],_0x4861c4[_0xca9c('0x70')],_0x3426c8);})[_0xca9c('0x30')](function(_0x1776b4){_0x2248ab=_0x1776b4;logger[_0xca9c('0xd')]('The\x20Enduser\x20ID\x20is:',_0x2248ab['id']);return getTicket(_0xc939a5,_0x5bff7a,_0x2248ab,_0x303b93,_0x4861c4,_0x303b93['Fields'],_0x3426c8,_0xca9c('0x71'));})[_0xca9c('0x30')](function(_0x506376){_0x29c575=_0x506376;logger[_0xca9c('0xd')](_0xca9c('0x72'));logger[_0xca9c('0xd')](_0xca9c('0x63'),_0x29c575['id']);return setRelationship(_0x3426c8,_0x5bff7a,_0x29c575,_0xca9c('0x64'));})[_0xca9c('0x30')](function(){return setRelationship(_0x3426c8,_0x2248ab,_0x29c575,_0xca9c('0x65'));})['then'](function(){return getServerInfo(_0x3426c8);})[_0xca9c('0x30')](function(_0x4424f8){var _0x21572c=parseInt(_0x4424f8[_0xca9c('0x73')][_0xca9c('0x66')](0x0));var _0x483c72=util[_0xca9c('0x2e')](_0xca9c('0x67'),_0xc939a5[_0xca9c('0x54')],_0x29c575['id']);if(_0x21572c>0x6){_0x483c72=util[_0xca9c('0x2e')](_0xca9c('0x68'),_0xc939a5[_0xca9c('0x54')],_0x29c575['id']);}logger[_0xca9c('0xd')](_0xca9c('0x6f'),_0xca9c('0x69'));emit(util[_0xca9c('0x2e')](_0xca9c('0x74'),_0x25ab6b[_0xca9c('0xf')]),_0xca9c('0x6a'),{'uri':_0x483c72});})[_0xca9c('0x6b')](function(_0x5b380d){logger['error'](_0xca9c('0x6f'),JSON[_0xca9c('0x23')](_0x5b380d));});};exports['unmanaged']=function(_0x51a40c,_0xb84cfb,_0x148d2a,_0x173598,_0x36626e,_0x43fb43){var _0x50470e,_0x3d893a,_0x7c921f,_0x47363a;_0x43fb43[_0xca9c('0x54')]=intUtil[_0xca9c('0x55')](_0x43fb43[_0xca9c('0x54')]);_0x43fb43[_0xca9c('0x56')]=intUtil['stripTrailingSlash'](_0x43fb43[_0xca9c('0x56')]);def[_0xca9c('0x57')]=util[_0xca9c('0x2e')](_0xca9c('0x58'),_0x43fb43[_0xca9c('0x54')]);if(_0x36626e&&_0x36626e['monitor_format']){logger['info']('['+_0xb84cfb['lastevent'][_0xca9c('0x75')]()+']',_0xca9c('0x5b'));_0xb84cfb[_0xca9c('0x5c')]=util['format'](_0xca9c('0x5d'),_0x43fb43['serverUrl'],_0xb84cfb[_0xca9c('0x5e')],md5(_0xb84cfb['uniqueid']));}else{_0xb84cfb[_0xca9c('0x5c')]='';}return getConnection(_0x43fb43)['then'](function(_0x3ed20e){_0x47363a=_0x3ed20e;if(!_[_0xca9c('0x2a')](_0x173598)){return getUser(_0x43fb43,_0x173598['name'],_0x47363a);}else{return getUser(_0x43fb43,null,_0x47363a);}})[_0xca9c('0x30')](function(_0x147820){_0x50470e=_0x147820;logger[_0xca9c('0xd')](_0xca9c('0x5f'),_0x50470e['id']);return getEndUser(_0x43fb43,_0xb84cfb[_0xca9c('0x76')],_0xb84cfb[_0xca9c('0x77')],_0x47363a);})[_0xca9c('0x30')](function(_0x4f2974){_0x3d893a=_0x4f2974;logger['info'](_0xca9c('0x60'),_0x3d893a['id']);return getTicket(_0x43fb43,_0x50470e,_0x3d893a,_0x148d2a,_0xb84cfb,_0x148d2a[_0xca9c('0x61')],_0x47363a,_0xca9c('0x62'));})['then'](function(_0x45c01d){_0x7c921f=_0x45c01d;logger[_0xca9c('0xd')](_0xca9c('0x72'));logger[_0xca9c('0xd')](_0xca9c('0x63'),_0x7c921f['id']);return setRelationship(_0x47363a,_0x50470e,_0x7c921f,'users');})['then'](function(){return setRelationship(_0x47363a,_0x3d893a,_0x7c921f,'contacts');})[_0xca9c('0x30')](function(){return getServerInfo(_0x47363a);})[_0xca9c('0x6b')](function(_0x68aab8){logger[_0xca9c('0x6c')]('['+_0xb84cfb[_0xca9c('0x78')][_0xca9c('0x75')]()+']',JSON['stringify'](_0x68aab8));});}; \ 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 843ff8e..096275c 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 _0x61c3=['customVariable','join','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','test','util','length','sortBy','type','string','push','variable','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent'];(function(_0x29f56d,_0x3610a8){var _0x4f6ce8=function(_0x55905b){while(--_0x55905b){_0x29f56d['push'](_0x29f56d['shift']());}};_0x4f6ce8(++_0x3610a8);}(_0x61c3,0x174));var _0x361c=function(_0x32b61c,_0x121633){_0x32b61c=_0x32b61c-0x0;var _0x59b444=_0x61c3[_0x32b61c];return _0x59b444;};'use strict';var _=require('lodash');var util=require(_0x361c('0x0'));exports['getString']=function(_0xb5867e,_0x98a578,_0x364fc7){var _0x57c9b1=[];if(_0xb5867e[_0x361c('0x1')]>0x0){var _0x41c878=_[_0x361c('0x2')](_0xb5867e,['id']);for(var _0x1a8863=0x0;_0x1a8863<_0x41c878[_0x361c('0x1')];_0x1a8863++){var _0xa36289=_0x41c878[_0x1a8863];if(_0xa36289[_0x361c('0x3')]===_0x361c('0x4')){_0x57c9b1[_0x361c('0x5')](_0xa36289['content']);}else if(_0xa36289[_0x361c('0x3')]===_0x361c('0x6')&&_0xa36289['variableName']){_0x98a578[_0xa36289[_0x361c('0x7')]]&&_0x57c9b1[_0x361c('0x5')](_0x98a578[_0xa36289[_0x361c('0x7')]][_0x361c('0x8')]());}else if(_0xa36289[_0x361c('0x3')]==='customVariable'&&_0xa36289[_0x361c('0x9')]&&_0xa36289['Variable'][_0x361c('0xa')]){_0x98a578[_0xa36289[_0x361c('0x9')][_0x361c('0xa')][_0x361c('0xb')]()]&&_0x57c9b1[_0x361c('0x5')](_0x98a578[_0xa36289['Variable'][_0x361c('0xa')][_0x361c('0xb')]()]['toString']());}else if(_0xa36289['type']===_0x361c('0xc')){if(_0xa36289[_0x361c('0xd')]===_0x361c('0x4')&&_0xa36289[_0x361c('0xe')]){_0x57c9b1[_0x361c('0x5')](util[_0x361c('0xf')](_0x361c('0x10'),_0xa36289[_0x361c('0xe')],_0xa36289[_0x361c('0x11')]));}else if(_0xa36289[_0x361c('0xd')]===_0x361c('0x6')&&_0xa36289['variableName']&&_0xa36289['key']){_0x98a578[_0xa36289[_0x361c('0x7')]]&&_0x57c9b1[_0x361c('0x5')](util[_0x361c('0xf')](_0x361c('0x10'),_0xa36289['key'],_0x98a578[_0xa36289[_0x361c('0x7')]]));}else if(_0xa36289[_0x361c('0xd')]===_0x361c('0x12')&&_0xa36289[_0x361c('0x9')]&&_0xa36289['Variable']['name']&&_0xa36289['key']){_0x98a578[_0xa36289[_0x361c('0x9')]['name']['toLowerCase']()]&&_0x57c9b1[_0x361c('0x5')](util[_0x361c('0xf')](_0x361c('0x10'),_0xa36289[_0x361c('0xe')],_0x98a578[_0xa36289[_0x361c('0x9')][_0x361c('0xa')][_0x361c('0xb')]()]));}}}}return _0x57c9b1[_0x361c('0x13')](_0x364fc7);};exports[_0x361c('0x14')]=function(_0x6deb72){var _0x21a9bf=_0x6deb72['slice'](-0x1);if(_0x21a9bf==='/'){_0x6deb72=_0x6deb72[_0x361c('0x15')](0x0,_0x6deb72[_0x361c('0x16')](_0x21a9bf));}return _0x6deb72;};exports[_0x361c('0x17')]=function(_0x53960e){if(!_[_0x361c('0x18')](_0x53960e)&&_0x53960e!==''){var _0x344414=/^(([^<>()\[\]\\.,;:\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 _0x344414[_0x361c('0x19')](String(_0x53960e)[_0x361c('0xb')]());}else{return![];}}; \ No newline at end of file +var _0x2a08=['length','sortBy','type','string','push','content','variableName','toString','Variable','name','toLowerCase','keyValue','key','format','%s:\x20%s','keyContent','keyType','variable','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','lodash','util','getString'];(function(_0x1a6cb8,_0x431948){var _0x524e8c=function(_0x2febf8){while(--_0x2febf8){_0x1a6cb8['push'](_0x1a6cb8['shift']());}};_0x524e8c(++_0x431948);}(_0x2a08,0x185));var _0x82a0=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x2a08[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x82a0('0x0'));var util=require(_0x82a0('0x1'));exports[_0x82a0('0x2')]=function(_0x2a6ab0,_0x419df5,_0x30b3b5){var _0x372edf=[];if(_0x2a6ab0[_0x82a0('0x3')]>0x0){var _0x27cfb3=_[_0x82a0('0x4')](_0x2a6ab0,['id']);for(var _0x3ee837=0x0;_0x3ee837<_0x27cfb3[_0x82a0('0x3')];_0x3ee837++){var _0x7d0dc8=_0x27cfb3[_0x3ee837];if(_0x7d0dc8[_0x82a0('0x5')]===_0x82a0('0x6')){_0x372edf[_0x82a0('0x7')](_0x7d0dc8[_0x82a0('0x8')]);}else if(_0x7d0dc8[_0x82a0('0x5')]==='variable'&&_0x7d0dc8[_0x82a0('0x9')]){_0x419df5[_0x7d0dc8[_0x82a0('0x9')]]&&_0x372edf['push'](_0x419df5[_0x7d0dc8['variableName']][_0x82a0('0xa')]());}else if(_0x7d0dc8['type']==='customVariable'&&_0x7d0dc8[_0x82a0('0xb')]&&_0x7d0dc8[_0x82a0('0xb')][_0x82a0('0xc')]){_0x419df5[_0x7d0dc8[_0x82a0('0xb')][_0x82a0('0xc')][_0x82a0('0xd')]()]&&_0x372edf[_0x82a0('0x7')](_0x419df5[_0x7d0dc8[_0x82a0('0xb')][_0x82a0('0xc')][_0x82a0('0xd')]()][_0x82a0('0xa')]());}else if(_0x7d0dc8['type']===_0x82a0('0xe')){if(_0x7d0dc8['keyType']===_0x82a0('0x6')&&_0x7d0dc8[_0x82a0('0xf')]){_0x372edf[_0x82a0('0x7')](util[_0x82a0('0x10')](_0x82a0('0x11'),_0x7d0dc8[_0x82a0('0xf')],_0x7d0dc8[_0x82a0('0x12')]));}else if(_0x7d0dc8[_0x82a0('0x13')]===_0x82a0('0x14')&&_0x7d0dc8['variableName']&&_0x7d0dc8[_0x82a0('0xf')]){_0x419df5[_0x7d0dc8[_0x82a0('0x9')]]&&_0x372edf[_0x82a0('0x7')](util['format'](_0x82a0('0x11'),_0x7d0dc8[_0x82a0('0xf')],_0x419df5[_0x7d0dc8[_0x82a0('0x9')]]));}else if(_0x7d0dc8[_0x82a0('0x13')]==='customVariable'&&_0x7d0dc8[_0x82a0('0xb')]&&_0x7d0dc8[_0x82a0('0xb')][_0x82a0('0xc')]&&_0x7d0dc8['key']){_0x419df5[_0x7d0dc8[_0x82a0('0xb')]['name'][_0x82a0('0xd')]()]&&_0x372edf[_0x82a0('0x7')](util[_0x82a0('0x10')]('%s:\x20%s',_0x7d0dc8[_0x82a0('0xf')],_0x419df5[_0x7d0dc8['Variable']['name'][_0x82a0('0xd')]()]));}}}}return _0x372edf[_0x82a0('0x15')](_0x30b3b5);};exports[_0x82a0('0x16')]=function(_0x311f5c){var _0x1215c8=_0x311f5c[_0x82a0('0x17')](-0x1);if(_0x1215c8==='/'){_0x311f5c=_0x311f5c[_0x82a0('0x18')](0x0,_0x311f5c[_0x82a0('0x19')](_0x1215c8));}return _0x311f5c;};exports[_0x82a0('0x1a')]=function(_0x512a94){if(!_[_0x82a0('0x1b')](_0x512a94)&&_0x512a94!==''){var _0x5162aa=/^(([^<>()\[\]\\.,;:\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 _0x5162aa['test'](String(_0x512a94)[_0x82a0('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 c419923..7aac30e 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 _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','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','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x1f930e,_0x24c403){var _0x5bfa2b=function(_0x2e4893){while(--_0x2e4893){_0x1f930e['push'](_0x1f930e['shift']());}};_0x5bfa2b(++_0x24c403);}(_0xe706,0xa3));var _0x6e70=function(_0x56a936,_0x457a1b){_0x56a936=_0x56a936-0x0;var _0x5ec02b=_0xe706[_0x56a936];return _0x5ec02b;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ 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(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 0cace08..9a02088 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 _0x728f=['toUpperCase','md5','util','ioredis','./util','zendesk','defaults','redis','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','merge','Tags','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','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','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','map','includes','string','type','nameField','customField','content','picklist','idField','custom_fields','push','variable','variableName','customVariable','Variable','name','toLowerCase','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','POST','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','user:%s','replace','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent'];(function(_0x4b51f3,_0x1c2776){var _0x1119e8=function(_0x28a70d){while(--_0x28a70d){_0x4b51f3['push'](_0x4b51f3['shift']());}};_0x1119e8(++_0x1c2776);}(_0x728f,0x14b));var _0xf728=function(_0x18d568,_0x36f1db){_0x18d568=_0x18d568-0x0;var _0x17bfbd=_0x728f[_0x18d568];return _0x17bfbd;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xf728('0x0'));var util=require(_0xf728('0x1'));var Redis=require(_0xf728('0x2'));var intUtil=require(_0xf728('0x3'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xf728('0x4'));config['redis']=_[_0xf728('0x5')](config[_0xf728('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xf728('0x7'))(new Redis(config[_0xf728('0x6')]));function emit(_0x5e07c0,_0x29dd1f,_0x10bf2c){io['to'](_0x5e07c0)['emit'](_0x29dd1f,_0x10bf2c);}var headers={'Content-Type':_0xf728('0x8'),'Accept':_0xf728('0x8')};function getTicket(_0x56f5b6,_0x43c0d5,_0x3400fa,_0xa5e1bc,_0x241c75){logger[_0xf728('0x9')](_0xf728('0xa'));return request({'uri':util['format'](_0xf728('0xb'),_0x56f5b6[_0xf728('0xc')]),'method':'POST','body':{'ticket':_[_0xf728('0xd')]({'requester_id':_0x3400fa['id'],'submitter_id':_0x43c0d5?_0x43c0d5['id']:undefined,'assignee_id':_0x43c0d5?_0x43c0d5['id']:undefined,'tags':getTags(_0xa5e1bc[_0xf728('0xe')],'name'),'subject':intUtil[_0xf728('0xf')](_0xa5e1bc[_0xf728('0x10')],_0x241c75,'\x20'),'description':intUtil[_0xf728('0xf')](_0xa5e1bc['Descriptions'],_0x241c75,'\x0a'),'comment':{'public':![],'body':intUtil[_0xf728('0xf')](_0xa5e1bc[_0xf728('0x11')],_0x241c75,'\x0a')}},getCustomFields(_0xa5e1bc['Fields'],_0x241c75))}})[_0xf728('0x12')](function(_0x3dc675){logger[_0xf728('0x9')](_0xf728('0x13'));return _0x3dc675[_0xf728('0x14')];});}function getUser(_0x319304,_0x4e5720){if(intUtil[_0xf728('0x15')](_0x4e5720)){logger[_0xf728('0x9')](_0xf728('0x16'),_0x4e5720);return request({'uri':util[_0xf728('0x17')](_0xf728('0x18'),_0x319304[_0xf728('0xc')]),'qs':{'query':util[_0xf728('0x17')]('type:user\x20role:agent\x20email:%s',_0x4e5720)}})[_0xf728('0x12')](function(_0x49d587){if(_0x49d587['count']){logger[_0xf728('0x9')](_0xf728('0x19'));return _[_0xf728('0x1a')](_0x49d587[_0xf728('0x1b')],{'email':_0x4e5720,'role':_0xf728('0x1c')});}else{logger['info'](_0xf728('0x1d'));return request({'uri':util[_0xf728('0x17')](_0xf728('0x1e'),_0x319304['remoteUri'])})[_0xf728('0x12')](function(_0x3b47ea){logger['info']('Admin\x20account\x20selected.');return _0x3b47ea[_0xf728('0x1f')];});}});}else{logger[_0xf728('0x9')](_0xf728('0x1d'));return request({'uri':util[_0xf728('0x17')](_0xf728('0x1e'),_0x319304[_0xf728('0xc')])})[_0xf728('0x12')](function(_0x16ae88){logger[_0xf728('0x9')](_0xf728('0x20'));return _0x16ae88[_0xf728('0x1f')];});}}function getEndUser(_0x4008a1,_0x12d9fb,_0x3e9d4c){logger[_0xf728('0x9')](_0xf728('0x21'),_0x3e9d4c);return request({'uri':util[_0xf728('0x17')]('%s/search.json',_0x4008a1['remoteUri']),'qs':{'query':util[_0xf728('0x17')](_0xf728('0x22'),_0x3e9d4c)}})[_0xf728('0x12')](function(_0x441cd9){var _0x108731;if(_0x441cd9['results'][_0xf728('0x23')]){_0x441cd9[_0xf728('0x1b')]=_[_0xf728('0x24')](_0x441cd9['results'],{'suspended':![],'role':_0xf728('0x25')});if(_0x441cd9[_0xf728('0x1b')][_0xf728('0x23')]){_0x108731=_[_0xf728('0x26')](_0x441cd9[_0xf728('0x1b')]);}}if(_0x108731){logger[_0xf728('0x9')](_0xf728('0x27'));return _0x108731;}else{logger[_0xf728('0x9')](_0xf728('0x28'));return request({'uri':util[_0xf728('0x17')](_0xf728('0x29'),_0x4008a1['remoteUri']),'method':'POST','body':{'user':{'role':_0xf728('0x25'),'name':util['format'](_0xf728('0x2a'),_0x12d9fb||_0x3e9d4c),'phone':_0x3e9d4c}}})[_0xf728('0x12')](function(_0xb81279){logger[_0xf728('0x9')](_0xf728('0x2b'));return _0xb81279['user'];});}});}function getAuth(_0x3ee954){var _0x3f6c86;if(_0x3ee954['authType']===_0xf728('0x2c')){_0x3f6c86=util[_0xf728('0x17')]('%s:%s',_0x3ee954[_0xf728('0x2d')],_0x3ee954['password']);}else if(_0x3ee954['authType']===_0xf728('0x2e')){_0x3f6c86=util[_0xf728('0x17')](_0xf728('0x2f'),_0x3ee954[_0xf728('0x2d')],_0x3ee954['token']);}return util[_0xf728('0x17')](_0xf728('0x30'),new Buffer(_0x3f6c86)[_0xf728('0x31')]('base64'));}function request(_0x283ab0){logger[_0xf728('0x32')](_0xf728('0x33'),JSON[_0xf728('0x34')](_0x283ab0));return rp(_[_0xf728('0x5')](_0x283ab0,{'method':_0xf728('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x1d7e14,_0x159cb8){var _0x163b8a=[];if(_0x1d7e14&&_0x1d7e14['length']>0x0){_0x163b8a=_[_0xf728('0x36')](_0x1d7e14,_0x159cb8);}return _0x163b8a;}function getCustomFields(_0x2e1eff,_0x3f78f9){var _0x1232b8=[];var _0x586a0c={'custom_fields':[]};if(_0x2e1eff[_0xf728('0x23')]>0x0){_['forEach'](_0x2e1eff,function(_0x17ea65){if(_[_0xf728('0x37')]([_0xf728('0x38'),'picklist'],_0x17ea65[_0xf728('0x39')])&&_0x17ea65[_0xf728('0x3a')]&&!_0x17ea65[_0xf728('0x3b')]){_0x586a0c[_0x17ea65[_0xf728('0x3a')]['toLowerCase']()]=_0x17ea65[_0xf728('0x3c')][_0xf728('0x31')]();}else if(_['includes']([_0xf728('0x38'),_0xf728('0x3d')],_0x17ea65[_0xf728('0x39')])&&_0x17ea65[_0xf728('0x3e')]&&_0x17ea65[_0xf728('0x3b')]){_0x586a0c[_0xf728('0x3f')][_0xf728('0x40')]({'id':_0x17ea65[_0xf728('0x3e')],'value':_0x17ea65['content'][_0xf728('0x31')]()});}else if(_0x17ea65[_0xf728('0x39')]===_0xf728('0x41')&&_0x17ea65[_0xf728('0x42')]&&_0x17ea65[_0xf728('0x3e')]&&_0x17ea65['customField']){_0x3f78f9[_0x17ea65['variableName']]&&_0x586a0c[_0xf728('0x3f')][_0xf728('0x40')]({'id':_0x17ea65['idField'],'value':_0x3f78f9[_0x17ea65['variableName']][_0xf728('0x31')]()});}else if(_0x17ea65[_0xf728('0x39')]===_0xf728('0x43')&&_0x17ea65[_0xf728('0x44')]&&_0x17ea65[_0xf728('0x44')][_0xf728('0x45')]&&_0x17ea65[_0xf728('0x3e')]&&_0x17ea65[_0xf728('0x3b')]){_0x3f78f9[_0x17ea65['Variable']['name']['toLowerCase']()]&&_0x586a0c[_0xf728('0x3f')][_0xf728('0x40')]({'id':_0x17ea65['idField'],'value':_0x3f78f9[_0x17ea65[_0xf728('0x44')][_0xf728('0x45')][_0xf728('0x46')]()][_0xf728('0x31')]()});}});}return _0x586a0c;}exports[_0xf728('0x47')]=function(_0x22b19c,_0x3d44a8,_0x13cada,_0xf07724,_0x397931,_0x412751){var _0x2c84e6,_0x5e52f5;_0x412751[_0xf728('0xc')]=intUtil['stripTrailingSlash'](_0x412751[_0xf728('0xc')]);_0x412751[_0xf728('0x48')]=intUtil[_0xf728('0x49')](_0x412751[_0xf728('0x48')]);if(_0x397931&&_0x397931['monitor_format']){logger[_0xf728('0x9')](_0xf728('0x4a'),_0xf728('0x4b'));_0x3d44a8[_0xf728('0x4c')]=util[_0xf728('0x17')](_0xf728('0x4d'),_0x412751['serverUrl'],_0x3d44a8['uniqueid'],md5(_0x3d44a8[_0xf728('0x4e')]));}else{_0x3d44a8[_0xf728('0x4c')]='';}headers[_0xf728('0x4f')]=getAuth(_0x412751);return getUser(_0x412751,_0xf07724[_0xf728('0x50')])[_0xf728('0x12')](function(_0x883547){_0x2c84e6=_0x883547;logger[_0xf728('0x9')](_0xf728('0x51'),_0x2c84e6['id']);return getEndUser(_0x412751,_0x3d44a8[_0xf728('0x52')],_0x3d44a8[_0xf728('0x53')]);})[_0xf728('0x12')](function(_0x11f438){_0x5e52f5=_0x11f438;logger[_0xf728('0x9')](_0xf728('0x54'),_0x5e52f5['id']);return getTicket(_0x412751,_0x2c84e6,_0x5e52f5,_0x13cada,_0x3d44a8);})[_0xf728('0x12')](function(_0x4288f3){if(_0x4288f3){logger[_0xf728('0x9')]('The\x20Ticket\x20ID\x20is:',_0x4288f3['id']);switch(_0x412751[_0xf728('0x39')]){case _0xf728('0x55'):logger[_0xf728('0x9')](_0xf728('0x4a'),_0xf728('0x56'));return request({'uri':util['format'](_0xf728('0x57'),_0x412751[_0xf728('0xc')],_0x2c84e6['id'],_0x4288f3['id']),'method':_0xf728('0x58')});case _0xf728('0x59'):logger['info'](_0xf728('0x4a'),_0xf728('0x5a'));emit(util[_0xf728('0x17')]('user:%s',_0xf07724[_0xf728('0x45')]),_0xf728('0x5b'),{'uri':util[_0xf728('0x17')](_0xf728('0x5c'),_0x412751[_0xf728('0xc')]['replace'](_0xf728('0x5d'),''),_0x4288f3['id'])});break;default:logger[_0xf728('0x5e')]('[QUEUE]',_0xf728('0x5f'));}}})['catch'](function(_0x14c473){logger[_0xf728('0x5e')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xf728('0x60')](_0x14c473,{'showHidden':!![],'depth':null}));});};exports[_0xf728('0x61')]=function(_0x50a6e9,_0x1e87b8,_0x4d8808,_0x27a9f3,_0x4b4073,_0x2e2e4e,_0x14e8a4){var _0x3778ee,_0x2fe9f5;_0x2e2e4e[_0xf728('0xc')]=intUtil[_0xf728('0x49')](_0x2e2e4e[_0xf728('0xc')]);_0x2e2e4e[_0xf728('0x48')]=intUtil[_0xf728('0x49')](_0x2e2e4e[_0xf728('0x48')]);if(_0x14e8a4&&_0x14e8a4[_0xf728('0x62')]&&_0x14e8a4[_0xf728('0x62')]!==_0xf728('0x63')){logger[_0xf728('0x9')](_0xf728('0x64'),'Recording\x20is\x20enabled!');_0x1e87b8['recordingURL']=util[_0xf728('0x17')](_0xf728('0x4d'),_0x2e2e4e['serverUrl'],_0x1e87b8[_0xf728('0x4e')],md5(_0x1e87b8[_0xf728('0x4e')]));}headers[_0xf728('0x4f')]=getAuth(_0x2e2e4e);return getUser(_0x2e2e4e,_0x27a9f3[_0xf728('0x50')])[_0xf728('0x12')](function(_0x23c21f){_0x3778ee=_0x23c21f;logger['info'](_0xf728('0x51'),_0x3778ee['id']);return getEndUser(_0x2e2e4e,_0x1e87b8[_0xf728('0x65')],_0x1e87b8[_0xf728('0x66')]);})[_0xf728('0x12')](function(_0x56c539){_0x2fe9f5=_0x56c539;logger[_0xf728('0x9')](_0xf728('0x54'),_0x2fe9f5['id']);return getTicket(_0x2e2e4e,_0x3778ee,_0x2fe9f5,_0x4d8808,_0x1e87b8);})[_0xf728('0x12')](function(_0x151f8c){if(_0x151f8c){logger[_0xf728('0x9')]('The\x20Ticket\x20ID\x20is:',_0x151f8c['id']);switch(_0x2e2e4e[_0xf728('0x39')]){case _0xf728('0x55'):logger[_0xf728('0x9')](_0xf728('0x64'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0xf728('0x57'),_0x2e2e4e[_0xf728('0xc')],_0x3778ee['id'],_0x151f8c['id']),'method':'POST'});case _0xf728('0x59'):logger[_0xf728('0x9')](_0xf728('0x64'),_0xf728('0x5a'));emit(util['format'](_0xf728('0x67'),_0x27a9f3[_0xf728('0x45')]),_0xf728('0x5b'),{'uri':util[_0xf728('0x17')](_0xf728('0x5c'),_0x2e2e4e['remoteUri'][_0xf728('0x68')](_0xf728('0x5d'),''),_0x151f8c['id'])});break;default:logger[_0xf728('0x5e')](_0xf728('0x64'),_0xf728('0x5f'));}}})[_0xf728('0x69')](function(_0x3a2894){logger[_0xf728('0x5e')](_0xf728('0x6a'),util['inspect'](_0x3a2894,{'showHidden':!![],'depth':null}));});};exports[_0xf728('0x6b')]=function(_0x5df88e,_0x4c59e4,_0x2356e5,_0x3bcfaa,_0x252612,_0x2e0a60){var _0x360e9b,_0x5d8499;_0x2e0a60[_0xf728('0xc')]=intUtil[_0xf728('0x49')](_0x2e0a60[_0xf728('0xc')]);_0x2e0a60[_0xf728('0x48')]=intUtil[_0xf728('0x49')](_0x2e0a60[_0xf728('0x48')]);if(_0x252612&&_0x252612['monitor_format']){logger['info']('['+_0x4c59e4[_0xf728('0x6c')]['toUpperCase']()+']',_0xf728('0x4b'));_0x4c59e4[_0xf728('0x4c')]=util[_0xf728('0x17')](_0xf728('0x4d'),_0x2e0a60[_0xf728('0x48')],_0x4c59e4[_0xf728('0x4e')],md5(_0x4c59e4[_0xf728('0x4e')]));}else{_0x4c59e4[_0xf728('0x4c')]='';}headers[_0xf728('0x4f')]=getAuth(_0x2e0a60);return getUser(_0x2e0a60)['then'](function(_0x51ddaa){_0x360e9b=_0x51ddaa;logger[_0xf728('0x9')](_0xf728('0x51'),_0x360e9b['id']);return getEndUser(_0x2e0a60,_0x4c59e4['calleridname'],_0x4c59e4[_0xf728('0x53')]);})[_0xf728('0x12')](function(_0x44ab80){_0x5d8499=_0x44ab80;logger['info'](_0xf728('0x54'),_0x5d8499['id']);return getTicket(_0x2e0a60,_0x360e9b,_0x5d8499,_0x2356e5,_0x4c59e4);})[_0xf728('0x12')](function(_0x12753a){if(_0x12753a){logger[_0xf728('0x9')]('The\x20Ticket\x20ID\x20is:',_0x12753a['id']);}})['catch'](function(_0x1b4dfc){logger[_0xf728('0x5e')]('['+_0x4c59e4['lastevent'][_0xf728('0x6d')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0xf728('0x60')](_0x1b4dfc,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7fcb=['length','forEach','includes','string','picklist','type','nameField','customField','custom_fields','push','content','variable','variableName','idField','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','uniqueid','recordingURL','The\x20User\x20ID\x20is:','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','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Authorization','email','destcalleridname','destcalleridnum','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','monitor_format','lastevent','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','remoteUri','count','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]'];(function(_0x3d5ad5,_0x3dc81d){var _0x3e7395=function(_0x2de2f8){while(--_0x2de2f8){_0x3d5ad5['push'](_0x3d5ad5['shift']());}};_0x3e7395(++_0x3dc81d);}(_0x7fcb,0xa6));var _0xb7fc=function(_0x2e364c,_0x3a9865){_0x2e364c=_0x2e364c-0x0;var _0x13f7b4=_0x7fcb[_0x2e364c];return _0x13f7b4;};'use strict';var _=require(_0xb7fc('0x0'));var rp=require('request-promise');var md5=require(_0xb7fc('0x1'));var util=require(_0xb7fc('0x2'));var Redis=require(_0xb7fc('0x3'));var intUtil=require(_0xb7fc('0x4'));var config=require(_0xb7fc('0x5'));var logger=require(_0xb7fc('0x6'))(_0xb7fc('0x7'));config[_0xb7fc('0x8')]=_['defaults'](config[_0xb7fc('0x8')],{'host':_0xb7fc('0x9'),'port':0x18eb});var io=require(_0xb7fc('0xa'))(new Redis(config[_0xb7fc('0x8')]));function emit(_0x2716cf,_0x522d9b,_0x2449d4){io['to'](_0x2716cf)[_0xb7fc('0xb')](_0x522d9b,_0x2449d4);}var headers={'Content-Type':_0xb7fc('0xc'),'Accept':_0xb7fc('0xc')};function getTicket(_0x1c4c33,_0x575a66,_0x2603af,_0x530267,_0x2e576b){logger[_0xb7fc('0xd')](_0xb7fc('0xe'));return request({'uri':util[_0xb7fc('0xf')](_0xb7fc('0x10'),_0x1c4c33['remoteUri']),'method':_0xb7fc('0x11'),'body':{'ticket':_[_0xb7fc('0x12')]({'requester_id':_0x2603af['id'],'submitter_id':_0x575a66?_0x575a66['id']:undefined,'assignee_id':_0x575a66?_0x575a66['id']:undefined,'tags':getTags(_0x530267['Tags'],'name'),'subject':intUtil['getString'](_0x530267['Subjects'],_0x2e576b,'\x20'),'description':intUtil[_0xb7fc('0x13')](_0x530267[_0xb7fc('0x14')],_0x2e576b,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x530267[_0xb7fc('0x14')],_0x2e576b,'\x0a')}},getCustomFields(_0x530267[_0xb7fc('0x15')],_0x2e576b))}})[_0xb7fc('0x16')](function(_0x2fe532){logger[_0xb7fc('0xd')](_0xb7fc('0x17'));return _0x2fe532[_0xb7fc('0x18')];});}function getUser(_0x52671d,_0x5904d1){if(intUtil['validateEmail'](_0x5904d1)){logger[_0xb7fc('0xd')](_0xb7fc('0x19'),_0x5904d1);return request({'uri':util[_0xb7fc('0xf')]('%s/search.json',_0x52671d[_0xb7fc('0x1a')]),'qs':{'query':util[_0xb7fc('0xf')]('type:user\x20role:agent\x20email:%s',_0x5904d1)}})[_0xb7fc('0x16')](function(_0x281d67){if(_0x281d67[_0xb7fc('0x1b')]){logger['info'](_0xb7fc('0x1c'));return _[_0xb7fc('0x1d')](_0x281d67[_0xb7fc('0x1e')],{'email':_0x5904d1,'role':_0xb7fc('0x1f')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xb7fc('0x20'),_0x52671d[_0xb7fc('0x1a')])})[_0xb7fc('0x16')](function(_0x468bd4){logger[_0xb7fc('0xd')](_0xb7fc('0x21'));return _0x468bd4[_0xb7fc('0x22')];});}});}else{logger[_0xb7fc('0xd')](_0xb7fc('0x23'));return request({'uri':util[_0xb7fc('0xf')](_0xb7fc('0x20'),_0x52671d[_0xb7fc('0x1a')])})['then'](function(_0x3c592a){logger[_0xb7fc('0xd')](_0xb7fc('0x21'));return _0x3c592a[_0xb7fc('0x22')];});}}function getEndUser(_0x19dd49,_0x517ea2,_0x4f5bfa){logger['info'](_0xb7fc('0x24'),_0x4f5bfa);return request({'uri':util[_0xb7fc('0xf')]('%s/search.json',_0x19dd49['remoteUri']),'qs':{'query':util['format'](_0xb7fc('0x25'),_0x4f5bfa)}})[_0xb7fc('0x16')](function(_0x23563a){var _0x4b6ba8;if(_0x23563a[_0xb7fc('0x1e')]['length']){_0x23563a['results']=_[_0xb7fc('0x26')](_0x23563a[_0xb7fc('0x1e')],{'suspended':![],'role':_0xb7fc('0x27')});if(_0x23563a[_0xb7fc('0x1e')]['length']){_0x4b6ba8=_['first'](_0x23563a['results']);}}if(_0x4b6ba8){logger[_0xb7fc('0xd')]('Enduser\x20found!');return _0x4b6ba8;}else{logger[_0xb7fc('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format']('%s/users.json',_0x19dd49[_0xb7fc('0x1a')]),'method':'POST','body':{'user':{'role':_0xb7fc('0x27'),'name':util[_0xb7fc('0xf')](_0xb7fc('0x28'),_0x517ea2||_0x4f5bfa),'phone':_0x4f5bfa}}})['then'](function(_0x26cc10){logger['info'](_0xb7fc('0x29'));return _0x26cc10[_0xb7fc('0x22')];});}});}function getAuth(_0x9f4159){var _0x57fe16;if(_0x9f4159['authType']===_0xb7fc('0x2a')){_0x57fe16=util[_0xb7fc('0xf')](_0xb7fc('0x2b'),_0x9f4159[_0xb7fc('0x2c')],_0x9f4159[_0xb7fc('0x2a')]);}else if(_0x9f4159[_0xb7fc('0x2d')]===_0xb7fc('0x2e')){_0x57fe16=util[_0xb7fc('0xf')](_0xb7fc('0x2f'),_0x9f4159[_0xb7fc('0x2c')],_0x9f4159[_0xb7fc('0x2e')]);}return util[_0xb7fc('0xf')](_0xb7fc('0x30'),new Buffer(_0x57fe16)[_0xb7fc('0x31')](_0xb7fc('0x32')));}function request(_0x4888a9){logger['debug'](_0xb7fc('0x33'),JSON['stringify'](_0x4888a9));return rp(_['defaults'](_0x4888a9,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0xf84074,_0x54ea46){var _0x3a61b1=[];if(_0xf84074&&_0xf84074[_0xb7fc('0x34')]>0x0){_0x3a61b1=_['map'](_0xf84074,_0x54ea46);}return _0x3a61b1;}function getCustomFields(_0x2ff328,_0x36317b){var _0x583543=[];var _0x5d6703={'custom_fields':[]};if(_0x2ff328[_0xb7fc('0x34')]>0x0){_[_0xb7fc('0x35')](_0x2ff328,function(_0x3a61ea){if(_[_0xb7fc('0x36')]([_0xb7fc('0x37'),_0xb7fc('0x38')],_0x3a61ea[_0xb7fc('0x39')])&&_0x3a61ea[_0xb7fc('0x3a')]&&!_0x3a61ea[_0xb7fc('0x3b')]){_0x5d6703[_0x3a61ea[_0xb7fc('0x3a')]['toLowerCase']()]=_0x3a61ea['content'][_0xb7fc('0x31')]();}else if(_[_0xb7fc('0x36')]([_0xb7fc('0x37'),_0xb7fc('0x38')],_0x3a61ea[_0xb7fc('0x39')])&&_0x3a61ea['idField']&&_0x3a61ea[_0xb7fc('0x3b')]){_0x5d6703[_0xb7fc('0x3c')][_0xb7fc('0x3d')]({'id':_0x3a61ea['idField'],'value':_0x3a61ea[_0xb7fc('0x3e')][_0xb7fc('0x31')]()});}else if(_0x3a61ea[_0xb7fc('0x39')]===_0xb7fc('0x3f')&&_0x3a61ea[_0xb7fc('0x40')]&&_0x3a61ea[_0xb7fc('0x41')]&&_0x3a61ea[_0xb7fc('0x3b')]){_0x36317b[_0x3a61ea[_0xb7fc('0x40')]]&&_0x5d6703['custom_fields'][_0xb7fc('0x3d')]({'id':_0x3a61ea[_0xb7fc('0x41')],'value':_0x36317b[_0x3a61ea[_0xb7fc('0x40')]][_0xb7fc('0x31')]()});}else if(_0x3a61ea[_0xb7fc('0x39')]==='customVariable'&&_0x3a61ea['Variable']&&_0x3a61ea[_0xb7fc('0x42')][_0xb7fc('0x43')]&&_0x3a61ea[_0xb7fc('0x41')]&&_0x3a61ea[_0xb7fc('0x3b')]){_0x36317b[_0x3a61ea['Variable'][_0xb7fc('0x43')]['toLowerCase']()]&&_0x5d6703[_0xb7fc('0x3c')][_0xb7fc('0x3d')]({'id':_0x3a61ea[_0xb7fc('0x41')],'value':_0x36317b[_0x3a61ea[_0xb7fc('0x42')]['name'][_0xb7fc('0x44')]()]['toString']()});}});}return _0x5d6703;}exports[_0xb7fc('0x45')]=function(_0x24bd88,_0x548d8b,_0x4d660a,_0x664fa3,_0x5d0310,_0x8e021b){var _0x3e34db,_0x4bd82b;_0x8e021b[_0xb7fc('0x1a')]=intUtil[_0xb7fc('0x46')](_0x8e021b[_0xb7fc('0x1a')]);_0x8e021b[_0xb7fc('0x47')]=intUtil[_0xb7fc('0x46')](_0x8e021b['serverUrl']);if(_0x5d0310&&_0x5d0310['monitor_format']){logger[_0xb7fc('0xd')](_0xb7fc('0x48'),'Recording\x20is\x20enabled!');_0x548d8b['recordingURL']=util[_0xb7fc('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x8e021b[_0xb7fc('0x47')],_0x548d8b['uniqueid'],md5(_0x548d8b[_0xb7fc('0x49')]));}else{_0x548d8b[_0xb7fc('0x4a')]='';}headers['Authorization']=getAuth(_0x8e021b);return getUser(_0x8e021b,_0x664fa3['email'])[_0xb7fc('0x16')](function(_0x1187ee){_0x3e34db=_0x1187ee;logger['info'](_0xb7fc('0x4b'),_0x3e34db['id']);return getEndUser(_0x8e021b,_0x548d8b[_0xb7fc('0x4c')],_0x548d8b[_0xb7fc('0x4d')]);})[_0xb7fc('0x16')](function(_0x33f1b3){_0x4bd82b=_0x33f1b3;logger[_0xb7fc('0xd')](_0xb7fc('0x4e'),_0x4bd82b['id']);return getTicket(_0x8e021b,_0x3e34db,_0x4bd82b,_0x4d660a,_0x548d8b);})['then'](function(_0x26ec1c){if(_0x26ec1c){logger[_0xb7fc('0xd')](_0xb7fc('0x4f'),_0x26ec1c['id']);switch(_0x8e021b[_0xb7fc('0x39')]){case _0xb7fc('0x50'):logger[_0xb7fc('0xd')](_0xb7fc('0x48'),_0xb7fc('0x51'));return request({'uri':util[_0xb7fc('0xf')](_0xb7fc('0x52'),_0x8e021b[_0xb7fc('0x1a')],_0x3e34db['id'],_0x26ec1c['id']),'method':_0xb7fc('0x11')});case _0xb7fc('0x53'):logger['info'](_0xb7fc('0x48'),_0xb7fc('0x54'));emit(util[_0xb7fc('0xf')](_0xb7fc('0x55'),_0x664fa3[_0xb7fc('0x43')]),_0xb7fc('0x56'),{'uri':util[_0xb7fc('0xf')](_0xb7fc('0x57'),_0x8e021b[_0xb7fc('0x1a')]['replace'](_0xb7fc('0x58'),''),_0x26ec1c['id'])});break;default:logger[_0xb7fc('0x59')](_0xb7fc('0x48'),_0xb7fc('0x5a'));}}})['catch'](function(_0x423d5f){logger['error'](_0xb7fc('0x5b'),util[_0xb7fc('0x5c')](_0x423d5f,{'showHidden':!![],'depth':null}));});};exports[_0xb7fc('0x5d')]=function(_0x4bc8c0,_0xc20d07,_0x4977a3,_0x6222ee,_0x4b14bc,_0x36c727,_0x3e72ce){var _0x1c1075,_0x34a564;_0x36c727[_0xb7fc('0x1a')]=intUtil[_0xb7fc('0x46')](_0x36c727[_0xb7fc('0x1a')]);_0x36c727[_0xb7fc('0x47')]=intUtil[_0xb7fc('0x46')](_0x36c727[_0xb7fc('0x47')]);if(_0x3e72ce&&_0x3e72ce[_0xb7fc('0x5e')]&&_0x3e72ce['recordingFormat']!==_0xb7fc('0x5f')){logger['info'](_0xb7fc('0x60'),_0xb7fc('0x61'));_0xc20d07['recordingURL']=util[_0xb7fc('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x36c727[_0xb7fc('0x47')],_0xc20d07[_0xb7fc('0x49')],md5(_0xc20d07['uniqueid']));}headers[_0xb7fc('0x62')]=getAuth(_0x36c727);return getUser(_0x36c727,_0x6222ee[_0xb7fc('0x63')])[_0xb7fc('0x16')](function(_0x13437c){_0x1c1075=_0x13437c;logger['info']('The\x20User\x20ID\x20is:',_0x1c1075['id']);return getEndUser(_0x36c727,_0xc20d07[_0xb7fc('0x64')],_0xc20d07[_0xb7fc('0x65')]);})['then'](function(_0x5351a2){_0x34a564=_0x5351a2;logger[_0xb7fc('0xd')]('The\x20Enduser\x20ID\x20is:',_0x34a564['id']);return getTicket(_0x36c727,_0x1c1075,_0x34a564,_0x4977a3,_0xc20d07);})[_0xb7fc('0x16')](function(_0x3e5b68){if(_0x3e5b68){logger[_0xb7fc('0xd')](_0xb7fc('0x4f'),_0x3e5b68['id']);switch(_0x36c727[_0xb7fc('0x39')]){case'integrationTab':logger['info'](_0xb7fc('0x60'),_0xb7fc('0x51'));return request({'uri':util['format'](_0xb7fc('0x52'),_0x36c727['remoteUri'],_0x1c1075['id'],_0x3e5b68['id']),'method':_0xb7fc('0x11')});case _0xb7fc('0x53'):logger[_0xb7fc('0xd')](_0xb7fc('0x60'),_0xb7fc('0x54'));emit(util[_0xb7fc('0xf')](_0xb7fc('0x55'),_0x6222ee['name']),_0xb7fc('0x56'),{'uri':util[_0xb7fc('0xf')](_0xb7fc('0x57'),_0x36c727[_0xb7fc('0x1a')]['replace'](_0xb7fc('0x58'),''),_0x3e5b68['id'])});break;default:logger[_0xb7fc('0x59')](_0xb7fc('0x60'),_0xb7fc('0x5a'));}}})[_0xb7fc('0x66')](function(_0x207e16){logger[_0xb7fc('0x59')](_0xb7fc('0x67'),util[_0xb7fc('0x5c')](_0x207e16,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x5e221c,_0x50f49c,_0x211b5a,_0x4faf32,_0x3439f8,_0xa23408){var _0xb97fcb,_0x13de5c;_0xa23408[_0xb7fc('0x1a')]=intUtil[_0xb7fc('0x46')](_0xa23408[_0xb7fc('0x1a')]);_0xa23408[_0xb7fc('0x47')]=intUtil[_0xb7fc('0x46')](_0xa23408[_0xb7fc('0x47')]);if(_0x3439f8&&_0x3439f8[_0xb7fc('0x68')]){logger['info']('['+_0x50f49c[_0xb7fc('0x69')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x50f49c['recordingURL']=util[_0xb7fc('0xf')](_0xb7fc('0x6a'),_0xa23408[_0xb7fc('0x47')],_0x50f49c[_0xb7fc('0x49')],md5(_0x50f49c[_0xb7fc('0x49')]));}else{_0x50f49c[_0xb7fc('0x4a')]='';}headers[_0xb7fc('0x62')]=getAuth(_0xa23408);return getUser(_0xa23408)[_0xb7fc('0x16')](function(_0x233449){_0xb97fcb=_0x233449;logger['info'](_0xb7fc('0x4b'),_0xb97fcb['id']);return getEndUser(_0xa23408,_0x50f49c[_0xb7fc('0x4c')],_0x50f49c[_0xb7fc('0x4d')]);})[_0xb7fc('0x16')](function(_0x3b4cc9){_0x13de5c=_0x3b4cc9;logger['info'](_0xb7fc('0x4e'),_0x13de5c['id']);return getTicket(_0xa23408,_0xb97fcb,_0x13de5c,_0x211b5a,_0x50f49c);})['then'](function(_0x1a4baa){if(_0x1a4baa){logger[_0xb7fc('0xd')](_0xb7fc('0x4f'),_0x1a4baa['id']);}})[_0xb7fc('0x66')](function(_0x5b7fb8){logger[_0xb7fc('0x59')]('['+_0x50f49c['lastevent'][_0xb7fc('0x6b')]()+']'+_0xb7fc('0x6c'),util['inspect'](_0x5b7fb8,{'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 29d6f6f..7b9a064 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 _0x0ade=['https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','unmanaged','/api/voice/recordings/','calleridname','toUpperCase','lodash','request-promise','util','./util','moment','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','string','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','add','seconds','catch','stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','profile','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','then','code','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Leads','nothing','contact','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Contacts','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','complete','connect','Answered','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','SUCCESS','err','queue','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url'];(function(_0x5eaca6,_0x59aecf){var _0x148069=function(_0xc3c64b){while(--_0xc3c64b){_0x5eaca6['push'](_0x5eaca6['shift']());}};_0x148069(++_0x59aecf);}(_0x0ade,0xab));var _0xe0ad=function(_0x56e429,_0x546a27){_0x56e429=_0x56e429-0x0;var _0x20d987=_0x0ade[_0x56e429];return _0x20d987;};'use strict';var _=require(_0xe0ad('0x0'));var rp=require(_0xe0ad('0x1'));var md5=require('md5');var util=require(_0xe0ad('0x2'));var intUtil=require(_0xe0ad('0x3'));var moment=require(_0xe0ad('0x4'));var Redis=require(_0xe0ad('0x5'));var BPromise=require(_0xe0ad('0x6'));var config=require(_0xe0ad('0x7'));var logger=require('../../../../config/logger')(_0xe0ad('0x8'));config[_0xe0ad('0x9')]=_[_0xe0ad('0xa')](config[_0xe0ad('0x9')],{'host':_0xe0ad('0xb'),'port':0x18eb});var io=require(_0xe0ad('0xc'))(new Redis(config['redis']));function emit(_0x448d,_0x1add4e,_0x5e290c){io['to'](_0x448d)[_0xe0ad('0xd')](_0x1add4e,_0x5e290c);}function request(_0x1bbe93){logger[_0xe0ad('0xe')](_0xe0ad('0xf'),JSON[_0xe0ad('0x10')](_0x1bbe93));return rp(_0x1bbe93);}function getCustomFields(_0x4b5ab7,_0x3b39ea){var _0x288a70={};if(_0x4b5ab7[_0xe0ad('0x11')]>0x0){_['forEach'](_0x4b5ab7,function(_0x584f66){if(_['includes']([_0xe0ad('0x12'),'picklist'],_0x584f66[_0xe0ad('0x13')])&&_0x584f66['idField']){_0x288a70[_0x584f66[_0xe0ad('0x14')]]=_0x584f66['content'][_0xe0ad('0x15')]();}else if(_0x584f66[_0xe0ad('0x13')]===_0xe0ad('0x16')&&_0x584f66['variableName']&&_0x584f66['idField']&&_0x3b39ea[_0x584f66['variableName']]){_0x288a70[_0x584f66['idField']]=_0x3b39ea[_0x584f66[_0xe0ad('0x17')]][_0xe0ad('0x15')]();}else if(_0x584f66[_0xe0ad('0x13')]===_0xe0ad('0x18')&&_0x584f66[_0xe0ad('0x19')]&&_0x584f66[_0xe0ad('0x19')][_0xe0ad('0x1a')]&&_0x584f66[_0xe0ad('0x14')]&&_0x3b39ea[_0x584f66[_0xe0ad('0x19')][_0xe0ad('0x1a')][_0xe0ad('0x1b')]()]){_0x288a70[_0x584f66[_0xe0ad('0x14')]]=_0x3b39ea[_0x584f66[_0xe0ad('0x19')][_0xe0ad('0x1a')][_0xe0ad('0x1b')]()][_0xe0ad('0x15')]();}});}return _0x288a70;}function getName(_0x27a7f4){if(_0x27a7f4['indexOf']('\x20')>0x0){var _0x374104=_0x27a7f4[_0xe0ad('0x1c')](/ (.+)/);if(_0x374104[0x1]){return _0x374104;}}return[_0x27a7f4,_0x27a7f4];}var accountsTokens={};function getAccessToken(_0x1cbc3f){return new Promise(function(_0x35349d,_0x2beaf4){if(!_[_0xe0ad('0x1d')](accountsTokens[_0x1cbc3f['id']])&&!_[_0xe0ad('0x1d')](accountsTokens[_0x1cbc3f['id']][_0xe0ad('0x1e')])){if(moment()[_0xe0ad('0x1f')](accountsTokens[_0x1cbc3f['id']][_0xe0ad('0x20')])){_0x35349d(accountsTokens[_0x1cbc3f['id']]['access_token']);}}var _0x22ef57;switch(_0x1cbc3f[_0xe0ad('0x21')]){case'US':_0x22ef57=_0xe0ad('0x22');break;case'AU':_0x22ef57=_0xe0ad('0x23');break;case'EU':_0x22ef57=_0xe0ad('0x24');break;case'IN':_0x22ef57='https://accounts.zoho.in';break;case'CN':_0x22ef57='https://accounts.zoho.com.cn';break;default:_0x22ef57=_0xe0ad('0x24');break;}var _0x5b38e1={'method':_0xe0ad('0x25'),'uri':_0x22ef57+_0xe0ad('0x26'),'qs':{'refresh_token':_0x1cbc3f[_0xe0ad('0x27')],'client_id':_0x1cbc3f['clientId'],'client_secret':_0x1cbc3f['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x5b38e1)['then'](function(_0xab41b2){accountsTokens[_0x1cbc3f['id']]={'access_token':_0xab41b2['access_token'],'expires_in':moment()[_0xe0ad('0x28')](_0xab41b2['expires_in'],_0xe0ad('0x29'))};_0x35349d(_0xab41b2['access_token']);})[_0xe0ad('0x2a')](function(_0x2857ee){logger['error']('Failing\x20creating\x20the\x20access_token',_0x2857ee[_0xe0ad('0x2b')]);_0x2beaf4(_0x2857ee);});});}function getUser(_0x86f886,_0x434a43,_0x92854f,_0x574ba9){logger[_0xe0ad('0x2c')]('Search\x20user');return request({'method':_0xe0ad('0x2d'),'uri':util[_0xe0ad('0x2e')](_0xe0ad('0x2f'),_0x434a43),'qs':{'type':_0xe0ad('0x30')},'headers':{'Authorization':_0xe0ad('0x31')+_0x86f886},'json':!![]})['then'](function(_0x22ff6f){if(_0x22ff6f[_0xe0ad('0x32')]){var _0xf58dc8=-0x1;if(_[_0xe0ad('0x33')](_0x22ff6f[_0xe0ad('0x32')])){if(!_[_0xe0ad('0x1d')](_0x574ba9)){_0xf58dc8=_[_0xe0ad('0x34')](_0x22ff6f[_0xe0ad('0x32')],function(_0x57b179){return _0x57b179[_0xe0ad('0x35')]===_0x574ba9;});}if(_0xf58dc8>=0x0){logger[_0xe0ad('0x2c')](_0xe0ad('0x36'));}else{logger[_0xe0ad('0x2c')](_0xe0ad('0x37'));_0xf58dc8=_['findIndex'](_0x22ff6f[_0xe0ad('0x32')],function(_0x29b0c1){return _0x29b0c1['profile'][_0xe0ad('0x1a')]===_0xe0ad('0x38');});}return _0x22ff6f[_0xe0ad('0x32')][_0xf58dc8];}else{if(_0x22ff6f[_0xe0ad('0x39')][_0xe0ad('0x3a')][_0xe0ad('0x1a')]===_0xe0ad('0x38')){logger[_0xe0ad('0x2c')]('Using\x20the\x20admin\x20account!');user=_0x22ff6f[_0xe0ad('0x39')];return user;}else{logger[_0xe0ad('0x3b')](_0xe0ad('0x3c'),JSON[_0xe0ad('0x10')](_0x22ff6f));throw new Error(_0xe0ad('0x3d')+JSON[_0xe0ad('0x10')](_0x22ff6f));}}}else{logger['error'](_0xe0ad('0x3c'),JSON[_0xe0ad('0x10')](_0x22ff6f));throw new Error(_0xe0ad('0x3d')+JSON[_0xe0ad('0x10')](_0x22ff6f));}})['catch'](function(_0x1dc0b5){console[_0xe0ad('0x3b')](_0x1dc0b5);});}function getZohoUser(_0x51812c,_0x41f4aa){return new BPromise(function(_0x53d288,_0x33bc04){request(_0x51812c)['then'](function(_0xe7bc24){var _0x150bab=null;if(_0xe7bc24){_0x150bab=_0xe7bc24[_0xe0ad('0x3e')][0x0];_0x150bab[_0xe0ad('0x3f')]=_0x41f4aa;}_0x53d288(_0x150bab);})['catch'](function(_0x1f7410){_0x33bc04(_0x1f7410);});});}function createEndUser(_0x7237e5,_0x22f192,_0x4f2dad,_0x2ee805,_0x572ea1,_0x2eb9f6){var _0x4f2dad=getName(_0x4f2dad);return request({'method':'POST','uri':_0xe0ad('0x40')+_0x22f192+_0xe0ad('0x41')+_[_0xe0ad('0x42')](_0x2eb9f6[_0xe0ad('0x43')])+'s','body':{'data':[{'Last_Name':_0x4f2dad[0x1],'First_Name':_0x4f2dad[0x0],'Phone':_0x2ee805,'Owner':{'name':!_[_0xe0ad('0x1d')](_0x572ea1[_0xe0ad('0x44')]['name'])?_0x572ea1[_0xe0ad('0x44')]['name']:!_[_0xe0ad('0x1d')](_0x572ea1[_0xe0ad('0x45')])?_0x572ea1[_0xe0ad('0x45')]+'\x20'+_0x572ea1['last_name']:_0x572ea1[_0xe0ad('0x46')],'id':_0x572ea1['id']}}]},'headers':{'Authorization':_0xe0ad('0x31')+_0x7237e5},'json':!![]})[_0xe0ad('0x47')](function(_0x1e69f2){if(_0x1e69f2&&_0x1e69f2[_0xe0ad('0x3e')][0x0][_0xe0ad('0x48')]==='SUCCESS'){var _0x22241f=_0x1e69f2[_0xe0ad('0x3e')][0x0][_0xe0ad('0x49')];_0x22241f[_0xe0ad('0x3f')]=_[_0xe0ad('0x42')](_0x2eb9f6[_0xe0ad('0x43')])+'s';return _0x22241f;}logger[_0xe0ad('0x3b')](_0xe0ad('0x3c'),JSON['stringify'](data));throw new Error(_0xe0ad('0x4a')+JSON[_0xe0ad('0x10')](data));})[_0xe0ad('0x2a')](function(_0x34dff6){console[_0xe0ad('0x4b')](_0xe0ad('0x4c'),_0x34dff6);});}function getEndUser(_0x4ca965,_0x5d6b5d,_0x1f89bf,_0xf32183,_0x57fd46,_0x22f51c,_0x1835de){var _0x26801e={'method':_0xe0ad('0x2d'),'uri':'','headers':{'Authorization':_0xe0ad('0x31')+_0x4ca965},'json':!![]};switch(_0x1835de[_0xe0ad('0x4d')]){case _0xe0ad('0x4e'):_0x26801e[_0xe0ad('0x4f')]=_0xe0ad('0x40')+_0x5d6b5d+_0xe0ad('0x50')+_0x57fd46+'))';return getZohoUser(_0x26801e,'Contacts')['then'](function(_0x39bb8e){if(_0x39bb8e)return _0x39bb8e;_0x26801e[_0xe0ad('0x4f')]=_0xe0ad('0x40')+_0x5d6b5d+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x57fd46+'))';return getZohoUser(_0x26801e,_0xe0ad('0x51'))[_0xe0ad('0x47')](function(_0x1b451a){if(_0x1b451a)return _0x1b451a;if(_0x1835de[_0xe0ad('0x43')]!=_0xe0ad('0x52')){return createEndUser(_0x4ca965,_0x5d6b5d,_0xf32183,_0x57fd46,_0x22f51c,_0x1835de);}else{return{};}});});break;case _0xe0ad('0x53'):_0x26801e['uri']=_0xe0ad('0x40')+_0x5d6b5d+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x57fd46+'))';return getZohoUser(_0x26801e,'Contacts')[_0xe0ad('0x47')](function(_0x5b0a4d){if(_0x5b0a4d)return _0x5b0a4d;if(_0x1835de['moduleCreate']!='nothing'){return createEndUser(_0x4ca965,_0x5d6b5d,_0xf32183,_0x57fd46,_0x22f51c,_0x1835de);}else{return{};}});break;case'lead':_0x26801e[_0xe0ad('0x4f')]=_0xe0ad('0x40')+_0x5d6b5d+_0xe0ad('0x54')+_0x57fd46+'))';return getZohoUser(_0x26801e,_0xe0ad('0x51'))[_0xe0ad('0x47')](function(_0x5a8cd8){if(_0x5a8cd8)return _0x5a8cd8;if(_0x1835de[_0xe0ad('0x43')]!=_0xe0ad('0x52')){return createEndUser(_0x4ca965,_0x5d6b5d,_0xf32183,_0x57fd46,_0x22f51c,_0x1835de);}else{return{};}});break;}}function getCall(_0x16a94b,_0x2a04a9,_0x278e54,_0x378a91,_0x49d4c9,_0x2b6e78,_0x295a9d,_0x206bec){logger[_0xe0ad('0x2c')](_0xe0ad('0x55'));var _0x24ea15={};_0x24ea15[_0xe0ad('0x56')]={'name':!_[_0xe0ad('0x1d')](_0x378a91[_0xe0ad('0x44')][_0xe0ad('0x1a')])&&!_['isNil'](_0x378a91[_0xe0ad('0x3a')][_0xe0ad('0x1a')])&&_0x378a91[_0xe0ad('0x3a')][_0xe0ad('0x1a')]===_0xe0ad('0x57')?_0x378a91[_0xe0ad('0x44')][_0xe0ad('0x1a')]:!_[_0xe0ad('0x1d')](_0x378a91[_0xe0ad('0x45')])?_0x378a91[_0xe0ad('0x45')]+'\x20'+_0x378a91[_0xe0ad('0x46')]:_0x378a91['last_name'],'id':_0x378a91['id']};_0x24ea15[_0xe0ad('0x58')]=intUtil[_0xe0ad('0x59')](_0x2b6e78[_0xe0ad('0x5a')],_0x295a9d,'\x20');_0x24ea15[_0xe0ad('0x5b')]=intUtil['getString'](_0x2b6e78[_0xe0ad('0x5c')],_0x295a9d,'\x0a');if(_0x49d4c9[_0xe0ad('0x3f')]===_0xe0ad('0x5d')){_0x24ea15[_0xe0ad('0x5e')]={'name':!_['isNil'](_0x49d4c9[_0xe0ad('0x5f')])?_0x49d4c9[_0xe0ad('0x5f')]:!_[_0xe0ad('0x1d')](_0x49d4c9[_0xe0ad('0x60')])?_0x49d4c9[_0xe0ad('0x60')]+'\x20'+_0x49d4c9[_0xe0ad('0x61')]:_0x49d4c9['Last_Name'],'id':_0x49d4c9['id']};}if(_0x49d4c9[_0xe0ad('0x3f')]===_0xe0ad('0x51')){_0x24ea15[_0xe0ad('0x62')]={'name':!_[_0xe0ad('0x1d')](_0x49d4c9[_0xe0ad('0x5f')])?_0x49d4c9[_0xe0ad('0x5f')]:!_[_0xe0ad('0x1d')](_0x49d4c9[_0xe0ad('0x60')])?_0x49d4c9['First_Name']+'\x20'+_0x49d4c9[_0xe0ad('0x61')]:_0x49d4c9[_0xe0ad('0x61')],'id':_0x49d4c9['id']};_0x24ea15['$se_module']=_[_0xe0ad('0x42')](_0x49d4c9[_0xe0ad('0x3f')]);}if(_0x295a9d[_0xe0ad('0x63')]){_0x24ea15[_0xe0ad('0x64')]=moment[_0xe0ad('0x65')](parseInt(_0x295a9d[_0xe0ad('0x63')])*0x3e8)[_0xe0ad('0x2e')]('mm:ss');}else if(_0x295a9d[_0xe0ad('0x66')]&&_0x295a9d['endtime']){_0x24ea15['Call_Duration']=moment[_0xe0ad('0x65')](moment(_0x295a9d[_0xe0ad('0x67')],_0xe0ad('0x68'))[_0xe0ad('0x69')](moment(_0x295a9d[_0xe0ad('0x6a')],_0xe0ad('0x68'))))[_0xe0ad('0x2e')]('mm:ss');}switch(_0x295a9d[_0xe0ad('0x6b')]){case _0xe0ad('0x6c'):_0x24ea15[_0xe0ad('0x6d')]='Called';break;case _0xe0ad('0x6e'):case _0xe0ad('0x6f'):_0x24ea15[_0xe0ad('0x6d')]=_0xe0ad('0x70');break;case'rejected':_0x24ea15[_0xe0ad('0x6d')]=_0xe0ad('0x71');break;case _0xe0ad('0x72'):_0x24ea15[_0xe0ad('0x6d')]=_0xe0ad('0x73');break;case _0xe0ad('0x74'):_0x24ea15[_0xe0ad('0x6d')]=_0xe0ad('0x75');default:}_0x24ea15[_0xe0ad('0x76')]=(_0x206bec==='outbound'?moment(_0x295a9d[_0xe0ad('0x6a')])[_0xe0ad('0x2e')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x295a9d[_0xe0ad('0x77')])[_0xe0ad('0x2e')](_0xe0ad('0x68')))||moment()[_0xe0ad('0x2e')](_0xe0ad('0x68'));_0x24ea15[_0xe0ad('0x78')]=_0x206bec||_0xe0ad('0x79');_0x24ea15=_[_0xe0ad('0x7a')](_0x24ea15,getCustomFields(_0x2b6e78['Fields'],_0x295a9d));return request({'method':'POST','uri':_0xe0ad('0x40')+_0x2a04a9+_0xe0ad('0x7b'),'headers':{'Authorization':_0xe0ad('0x31')+_0x16a94b},'body':{'data':[_0x24ea15]},'json':!![]})[_0xe0ad('0x47')](function(_0x2091a0){if(_0x2091a0&&_0x2091a0['data'][0x0]['code']===_0xe0ad('0x7c')){logger[_0xe0ad('0x2c')]('Call\x20created!');return{'id':_0x2091a0[_0xe0ad('0x3e')][0x0]['details']['id']};}})['catch'](function(_0x1b7ee3){logger[_0xe0ad('0x2c')](_0xe0ad('0x7d'),_0x1b7ee3[_0xe0ad('0x2b')]);console[_0xe0ad('0x4b')](_0xe0ad('0x7d'),_0x1b7ee3);});}exports[_0xe0ad('0x7e')]=function(_0x21b065,_0x9215b1,_0x4f6f26,_0x363523,_0x3e487c,_0x55def4){var _0x47c07a,_0x4723ff,_0x2d8ae0;_0x55def4[_0xe0ad('0x7f')]=intUtil['stripTrailingSlash'](_0x55def4[_0xe0ad('0x7f')]);_0x55def4['serverUrl']=intUtil['stripTrailingSlash'](_0x55def4[_0xe0ad('0x80')]);if(_0x3e487c&&_0x3e487c[_0xe0ad('0x81')]){logger[_0xe0ad('0x2c')](_0xe0ad('0x82'),_0xe0ad('0x83'));_0x9215b1['recordingURL']=_0x55def4['serverUrl']+'/api/voice/recordings/'+_0x9215b1[_0xe0ad('0x84')]+_0xe0ad('0x85')+md5(_0x9215b1[_0xe0ad('0x84')]);}else{_0x9215b1[_0xe0ad('0x86')]='';}var _0xaf8347=_0x55def4[_0xe0ad('0x7f')]===_0xe0ad('0x87')?'eu':_0xe0ad('0x88');return getAccessToken(_0x55def4)[_0xe0ad('0x47')](function(_0x16a029){_0x2d8ae0=_0x16a029;return getUser(_0x2d8ae0,_0xaf8347,_0x55def4,_0x363523[_0xe0ad('0x35')]);})[_0xe0ad('0x47')](function(_0x589e09){_0x47c07a=_0x589e09;logger['info'](_0xe0ad('0x89'),_0x47c07a['id']);return getEndUser(_0x2d8ae0,_0xaf8347,_0x55def4,_0x9215b1['calleridname'],_0x9215b1[_0xe0ad('0x8a')],_0x47c07a,_0x4f6f26);})[_0xe0ad('0x47')](function(_0x2422c8){_0x4723ff=_0x2422c8;return getCall(_0x2d8ae0,_0xaf8347,_0x55def4,_0x47c07a,_0x4723ff,_0x4f6f26,_0x9215b1,_0xe0ad('0x79'));})['then'](function(_0x300fbf){if(_0x300fbf){logger['info'](_0xe0ad('0x8b'),_0x300fbf['id']);logger['info']('[QUEUE]',_0xe0ad('0x8c'));emit(util[_0xe0ad('0x2e')](_0xe0ad('0x8d'),_0x363523[_0xe0ad('0x1a')]),_0xe0ad('0x8e'),{'uri':_0xe0ad('0x8f')+_0x55def4[_0xe0ad('0x7f')]+_0xe0ad('0x90')+_0x300fbf['id']});}})[_0xe0ad('0x2a')](function(_0x16bd57){logger[_0xe0ad('0x3b')](_0xe0ad('0x82'),JSON['stringify'](_0x16bd57));});};exports[_0xe0ad('0x91')]=function(_0x5b41bf,_0x454725,_0x14199c,_0xeeb0,_0x1ed116,_0x28b4eb,_0x26833f){var _0x4abbbb,_0x2329a6,_0x2ad782;_0x28b4eb[_0xe0ad('0x7f')]=intUtil['stripTrailingSlash'](_0x28b4eb[_0xe0ad('0x7f')]);_0x28b4eb[_0xe0ad('0x80')]=intUtil[_0xe0ad('0x92')](_0x28b4eb[_0xe0ad('0x80')]);if(_0x26833f&&_0x26833f[_0xe0ad('0x93')]&&_0x26833f[_0xe0ad('0x93')]!==_0xe0ad('0x94')){logger[_0xe0ad('0x2c')](_0xe0ad('0x95'),_0xe0ad('0x83'));_0x454725[_0xe0ad('0x86')]=_0x28b4eb[_0xe0ad('0x80')]+'/api/voice/recordings/'+_0x454725['uniqueid']+_0xe0ad('0x85')+md5(_0x454725[_0xe0ad('0x84')]);}var _0x5e5f6f=_0x28b4eb[_0xe0ad('0x7f')]==='zoho.eu'?'eu':_0xe0ad('0x88');return getAccessToken(_0x28b4eb)[_0xe0ad('0x47')](function(_0x4c704f){_0x2ad782=_0x4c704f;return getUser(_0x2ad782,_0x5e5f6f,_0x28b4eb,_0xeeb0[_0xe0ad('0x35')]);})[_0xe0ad('0x47')](function(_0x396bd9){_0x4abbbb=_0x396bd9;logger[_0xe0ad('0x2c')](_0xe0ad('0x89'),_0x4abbbb['id']);return getEndUser(_0x2ad782,_0x5e5f6f,_0x28b4eb,_0x454725[_0xe0ad('0x96')],_0x454725[_0xe0ad('0x97')],_0x4abbbb,_0x14199c);})['then'](function(_0x102a06){_0x2329a6=_0x102a06;return getCall(_0x2ad782,_0x5e5f6f,_0x28b4eb,_0x4abbbb,_0x2329a6,_0x14199c,_0x454725,_0xe0ad('0x98'));})[_0xe0ad('0x47')](function(_0x25f1d6){if(_0x25f1d6){logger[_0xe0ad('0x2c')]('The\x20Call\x20ID\x20is:',_0x25f1d6['id']);logger[_0xe0ad('0x2c')](_0xe0ad('0x95'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe0ad('0x2e')](_0xe0ad('0x8d'),_0xeeb0[_0xe0ad('0x1a')]),_0xe0ad('0x8e'),{'uri':_0xe0ad('0x8f')+_0x28b4eb[_0xe0ad('0x7f')]+_0xe0ad('0x90')+_0x25f1d6['id']});}})[_0xe0ad('0x2a')](function(_0x2a3018){logger[_0xe0ad('0x3b')]('[OUTBOUND]',JSON[_0xe0ad('0x10')](_0x2a3018));});};exports[_0xe0ad('0x99')]=function(_0x2194dd,_0x2c9709,_0x265a3b,_0x23232d,_0x3ee2b7,_0x1486a4){var _0x2ea9a9,_0x24eefa,_0x3c4433;_0x1486a4[_0xe0ad('0x7f')]=intUtil[_0xe0ad('0x92')](_0x1486a4[_0xe0ad('0x7f')]);_0x1486a4[_0xe0ad('0x80')]=intUtil[_0xe0ad('0x92')](_0x1486a4['serverUrl']);if(_0x3ee2b7&&_0x3ee2b7[_0xe0ad('0x81')]){logger['info']('['+_0x2c9709['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x2c9709[_0xe0ad('0x86')]=_0x1486a4[_0xe0ad('0x80')]+_0xe0ad('0x9a')+_0x2c9709[_0xe0ad('0x84')]+_0xe0ad('0x85')+md5(_0x2c9709[_0xe0ad('0x84')]);}else{_0x2c9709[_0xe0ad('0x86')]='';}var _0x260dfd=_0x1486a4[_0xe0ad('0x7f')]===_0xe0ad('0x87')?'eu':_0xe0ad('0x88');return getAccessToken(_0x1486a4)['then'](function(_0x33b411){_0x3c4433=_0x33b411;return getUser(_0x3c4433,_0x260dfd,_0x1486a4);})[_0xe0ad('0x47')](function(_0x34739c){_0x2ea9a9=_0x34739c;logger[_0xe0ad('0x2c')](_0xe0ad('0x89'),_0x2ea9a9['id']);return getEndUser(_0x3c4433,_0x260dfd,_0x1486a4,_0x2c9709[_0xe0ad('0x9b')],_0x2c9709[_0xe0ad('0x8a')],_0x2ea9a9,_0x265a3b);})[_0xe0ad('0x47')](function(_0x15b1d4){_0x24eefa=_0x15b1d4;return getCall(_0x3c4433,_0x260dfd,_0x1486a4,_0x2ea9a9,_0x24eefa,_0x265a3b,_0x2c9709,_0xe0ad('0x79'));})[_0xe0ad('0x47')](function(_0x4fd205){if(_0x4fd205){logger[_0xe0ad('0x2c')](_0xe0ad('0x8b'),_0x4fd205['id']);}})[_0xe0ad('0x2a')](function(_0x4525bc){logger[_0xe0ad('0x3b')]('['+_0x2c9709[_0xe0ad('0x6b')][_0xe0ad('0x9c')]()+']',JSON[_0xe0ad('0x10')](_0x4525bc));});}; \ No newline at end of file +var _0x506b=['util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','socket.io-emitter','debug','[HTTP]','length','forEach','includes','picklist','type','idField','variableName','toString','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','then','add','error','Failing\x20creating\x20the\x20access_token','stack','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','startCase','role','first_name','last_name','code','details','moduleCreate','Error:\x20','CREATE\x20ERROR','GET','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','unmanaged','toUpperCase','lodash','request-promise','md5'];(function(_0x3cf30e,_0x5d51aa){var _0x3469f8=function(_0x55e887){while(--_0x55e887){_0x3cf30e['push'](_0x3cf30e['shift']());}};_0x3469f8(++_0x5d51aa);}(_0x506b,0x13d));var _0xb506=function(_0x557938,_0x4fb2d9){_0x557938=_0x557938-0x0;var _0x40693b=_0x506b[_0x557938];return _0x40693b;};'use strict';var _=require(_0xb506('0x0'));var rp=require(_0xb506('0x1'));var md5=require(_0xb506('0x2'));var util=require(_0xb506('0x3'));var intUtil=require(_0xb506('0x4'));var moment=require(_0xb506('0x5'));var Redis=require(_0xb506('0x6'));var BPromise=require(_0xb506('0x7'));var config=require(_0xb506('0x8'));var logger=require(_0xb506('0x9'))(_0xb506('0xa'));config['redis']=_[_0xb506('0xb')](config[_0xb506('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0xb506('0xd'))(new Redis(config[_0xb506('0xc')]));function emit(_0x306fda,_0x335902,_0x21adb6){io['to'](_0x306fda)['emit'](_0x335902,_0x21adb6);}function request(_0x445e82){logger[_0xb506('0xe')](_0xb506('0xf'),JSON['stringify'](_0x445e82));return rp(_0x445e82);}function getCustomFields(_0x4ba41e,_0x3487ec){var _0x2ed10f={};if(_0x4ba41e[_0xb506('0x10')]>0x0){_[_0xb506('0x11')](_0x4ba41e,function(_0x5384a7){if(_[_0xb506('0x12')](['string',_0xb506('0x13')],_0x5384a7[_0xb506('0x14')])&&_0x5384a7[_0xb506('0x15')]){_0x2ed10f[_0x5384a7[_0xb506('0x15')]]=_0x5384a7['content']['toString']();}else if(_0x5384a7[_0xb506('0x14')]==='variable'&&_0x5384a7[_0xb506('0x16')]&&_0x5384a7['idField']&&_0x3487ec[_0x5384a7['variableName']]){_0x2ed10f[_0x5384a7[_0xb506('0x15')]]=_0x3487ec[_0x5384a7['variableName']][_0xb506('0x17')]();}else if(_0x5384a7['type']==='customVariable'&&_0x5384a7[_0xb506('0x18')]&&_0x5384a7[_0xb506('0x18')][_0xb506('0x19')]&&_0x5384a7[_0xb506('0x15')]&&_0x3487ec[_0x5384a7[_0xb506('0x18')][_0xb506('0x19')][_0xb506('0x1a')]()]){_0x2ed10f[_0x5384a7[_0xb506('0x15')]]=_0x3487ec[_0x5384a7[_0xb506('0x18')][_0xb506('0x19')][_0xb506('0x1a')]()][_0xb506('0x17')]();}});}return _0x2ed10f;}function getName(_0x1fbf79){if(_0x1fbf79[_0xb506('0x1b')]('\x20')>0x0){var _0x38c634=_0x1fbf79[_0xb506('0x1c')](/ (.+)/);if(_0x38c634[0x1]){return _0x38c634;}}return[_0x1fbf79,_0x1fbf79];}var accountsTokens={};function getAccessToken(_0x34d5a8){return new Promise(function(_0x5f5ca9,_0x42ca38){if(!_[_0xb506('0x1d')](accountsTokens[_0x34d5a8['id']])&&!_[_0xb506('0x1d')](accountsTokens[_0x34d5a8['id']][_0xb506('0x1e')])){if(moment()[_0xb506('0x1f')](accountsTokens[_0x34d5a8['id']][_0xb506('0x20')])){_0x5f5ca9(accountsTokens[_0x34d5a8['id']][_0xb506('0x1e')]);}}var _0x507654;switch(_0x34d5a8['zone']){case'US':_0x507654=_0xb506('0x21');break;case'AU':_0x507654='https://accounts.zoho.com.au';break;case'EU':_0x507654=_0xb506('0x22');break;case'IN':_0x507654=_0xb506('0x23');break;case'CN':_0x507654=_0xb506('0x24');break;default:_0x507654=_0xb506('0x22');break;}var _0x1b895b={'method':_0xb506('0x25'),'uri':_0x507654+_0xb506('0x26'),'qs':{'refresh_token':_0x34d5a8[_0xb506('0x27')],'client_id':_0x34d5a8['clientId'],'client_secret':_0x34d5a8[_0xb506('0x28')],'grant_type':_0xb506('0x29')},'json':!![]};return rp(_0x1b895b)[_0xb506('0x2a')](function(_0x293cd6){accountsTokens[_0x34d5a8['id']]={'access_token':_0x293cd6['access_token'],'expires_in':moment()[_0xb506('0x2b')](_0x293cd6[_0xb506('0x20')],'seconds')};_0x5f5ca9(_0x293cd6[_0xb506('0x1e')]);})['catch'](function(_0x4f1532){logger[_0xb506('0x2c')](_0xb506('0x2d'),_0x4f1532[_0xb506('0x2e')]);_0x42ca38(_0x4f1532);});});}function getUser(_0x2e81e6,_0x3005fa,_0x4672fc,_0x39541c){logger['info']('Search\x20user');return request({'method':'GET','uri':util[_0xb506('0x2f')](_0xb506('0x30'),_0x3005fa),'qs':{'type':_0xb506('0x31')},'headers':{'Authorization':_0xb506('0x32')+_0x2e81e6},'json':!![]})['then'](function(_0x340ceb){if(_0x340ceb['users']){var _0x59324f=-0x1;if(_[_0xb506('0x33')](_0x340ceb[_0xb506('0x34')])){if(!_['isNil'](_0x39541c)){_0x59324f=_[_0xb506('0x35')](_0x340ceb[_0xb506('0x34')],function(_0x18dbe3){return _0x18dbe3[_0xb506('0x36')]===_0x39541c;});}if(_0x59324f>=0x0){logger[_0xb506('0x37')](_0xb506('0x38'));}else{logger['info'](_0xb506('0x39'));_0x59324f=_[_0xb506('0x35')](_0x340ceb[_0xb506('0x34')],function(_0xb986b7){return _0xb986b7[_0xb506('0x3a')][_0xb506('0x19')]===_0xb506('0x3b');});}return _0x340ceb['users'][_0x59324f];}else{if(_0x340ceb[_0xb506('0x3c')][_0xb506('0x3a')][_0xb506('0x19')]===_0xb506('0x3b')){logger[_0xb506('0x37')](_0xb506('0x39'));user=_0x340ceb[_0xb506('0x3c')];return user;}else{logger[_0xb506('0x2c')](_0xb506('0x3d'),JSON[_0xb506('0x3e')](_0x340ceb));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xb506('0x3e')](_0x340ceb));}}}else{logger[_0xb506('0x2c')](_0xb506('0x3d'),JSON[_0xb506('0x3e')](_0x340ceb));throw new Error(_0xb506('0x3f')+JSON[_0xb506('0x3e')](_0x340ceb));}})[_0xb506('0x40')](function(_0x5cf8e){console['error'](_0x5cf8e);});}function getZohoUser(_0x495708,_0x3b808a){return new BPromise(function(_0x3231c1,_0x38d1f6){request(_0x495708)['then'](function(_0x2561ea){var _0x502a20=null;if(_0x2561ea){_0x502a20=_0x2561ea[_0xb506('0x41')][0x0];_0x502a20[_0xb506('0x42')]=_0x3b808a;}_0x3231c1(_0x502a20);})[_0xb506('0x40')](function(_0x4bccb1){_0x38d1f6(_0x4bccb1);});});}function createEndUser(_0x4a7461,_0x5a5d09,_0x5f0dda,_0x2d834e,_0x3fae5b,_0x5e127a){var _0x5f0dda=getName(_0x5f0dda);return request({'method':_0xb506('0x25'),'uri':'https://www.zohoapis.'+_0x5a5d09+'/crm/v2/'+_[_0xb506('0x43')](_0x5e127a['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x5f0dda[0x1],'First_Name':_0x5f0dda[0x0],'Phone':_0x2d834e,'Owner':{'name':!_[_0xb506('0x1d')](_0x3fae5b[_0xb506('0x44')][_0xb506('0x19')])?_0x3fae5b[_0xb506('0x44')][_0xb506('0x19')]:!_['isNil'](_0x3fae5b[_0xb506('0x45')])?_0x3fae5b[_0xb506('0x45')]+'\x20'+_0x3fae5b[_0xb506('0x46')]:_0x3fae5b[_0xb506('0x46')],'id':_0x3fae5b['id']}}]},'headers':{'Authorization':_0xb506('0x32')+_0x4a7461},'json':!![]})[_0xb506('0x2a')](function(_0x24135f){if(_0x24135f&&_0x24135f['data'][0x0][_0xb506('0x47')]==='SUCCESS'){var _0x3c543d=_0x24135f[_0xb506('0x41')][0x0][_0xb506('0x48')];_0x3c543d[_0xb506('0x42')]=_[_0xb506('0x43')](_0x5e127a[_0xb506('0x49')])+'s';return _0x3c543d;}logger[_0xb506('0x2c')]('The\x20failing\x20result\x20is',JSON[_0xb506('0x3e')](data));throw new Error(_0xb506('0x4a')+JSON[_0xb506('0x3e')](data));})[_0xb506('0x40')](function(_0x435e3b){console['log'](_0xb506('0x4b'),_0x435e3b);});}function getEndUser(_0x39c2d8,_0x2aa40b,_0x4633a2,_0x31b5ef,_0x362144,_0x55bdb2,_0x5387dc){var _0x50c9e5={'method':_0xb506('0x4c'),'uri':'','headers':{'Authorization':_0xb506('0x32')+_0x39c2d8},'json':!![]};switch(_0x5387dc[_0xb506('0x4d')]){case _0xb506('0x4e'):_0x50c9e5[_0xb506('0x4f')]=_0xb506('0x50')+_0x2aa40b+_0xb506('0x51')+_0x362144+'))';return getZohoUser(_0x50c9e5,_0xb506('0x52'))[_0xb506('0x2a')](function(_0x2fa315){if(_0x2fa315)return _0x2fa315;_0x50c9e5['uri']=_0xb506('0x50')+_0x2aa40b+_0xb506('0x53')+_0x362144+'))';return getZohoUser(_0x50c9e5,_0xb506('0x54'))[_0xb506('0x2a')](function(_0x5623d9){if(_0x5623d9)return _0x5623d9;if(_0x5387dc[_0xb506('0x49')]!=_0xb506('0x55')){return createEndUser(_0x39c2d8,_0x2aa40b,_0x31b5ef,_0x362144,_0x55bdb2,_0x5387dc);}else{return{};}});});break;case _0xb506('0x56'):_0x50c9e5[_0xb506('0x4f')]=_0xb506('0x50')+_0x2aa40b+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x362144+'))';return getZohoUser(_0x50c9e5,'Contacts')[_0xb506('0x2a')](function(_0x56aecd){if(_0x56aecd)return _0x56aecd;if(_0x5387dc[_0xb506('0x49')]!=_0xb506('0x55')){return createEndUser(_0x39c2d8,_0x2aa40b,_0x31b5ef,_0x362144,_0x55bdb2,_0x5387dc);}else{return{};}});break;case _0xb506('0x57'):_0x50c9e5[_0xb506('0x4f')]=_0xb506('0x50')+_0x2aa40b+_0xb506('0x53')+_0x362144+'))';return getZohoUser(_0x50c9e5,_0xb506('0x54'))[_0xb506('0x2a')](function(_0x5a8f11){if(_0x5a8f11)return _0x5a8f11;if(_0x5387dc['moduleCreate']!=_0xb506('0x55')){return createEndUser(_0x39c2d8,_0x2aa40b,_0x31b5ef,_0x362144,_0x55bdb2,_0x5387dc);}else{return{};}});break;}}function getCall(_0x39ce72,_0x544727,_0x5df893,_0x8653,_0x5990cd,_0x45def7,_0x414e37,_0x170661){logger[_0xb506('0x37')](_0xb506('0x58'));var _0x48049e={};_0x48049e[_0xb506('0x59')]={'name':!_[_0xb506('0x1d')](_0x8653['role'][_0xb506('0x19')])&&!_[_0xb506('0x1d')](_0x8653[_0xb506('0x3a')][_0xb506('0x19')])&&_0x8653[_0xb506('0x3a')][_0xb506('0x19')]===_0xb506('0x5a')?_0x8653[_0xb506('0x44')][_0xb506('0x19')]:!_[_0xb506('0x1d')](_0x8653[_0xb506('0x45')])?_0x8653[_0xb506('0x45')]+'\x20'+_0x8653[_0xb506('0x46')]:_0x8653['last_name'],'id':_0x8653['id']};_0x48049e[_0xb506('0x5b')]=intUtil[_0xb506('0x5c')](_0x45def7[_0xb506('0x5d')],_0x414e37,'\x20');_0x48049e[_0xb506('0x5e')]=intUtil[_0xb506('0x5c')](_0x45def7[_0xb506('0x5f')],_0x414e37,'\x0a');if(_0x5990cd[_0xb506('0x42')]===_0xb506('0x52')){_0x48049e[_0xb506('0x60')]={'name':!_[_0xb506('0x1d')](_0x5990cd[_0xb506('0x61')])?_0x5990cd[_0xb506('0x61')]:!_[_0xb506('0x1d')](_0x5990cd['First_Name'])?_0x5990cd[_0xb506('0x62')]+'\x20'+_0x5990cd[_0xb506('0x63')]:_0x5990cd[_0xb506('0x63')],'id':_0x5990cd['id']};}if(_0x5990cd[_0xb506('0x42')]===_0xb506('0x54')){_0x48049e[_0xb506('0x64')]={'name':!_[_0xb506('0x1d')](_0x5990cd[_0xb506('0x61')])?_0x5990cd[_0xb506('0x61')]:!_[_0xb506('0x1d')](_0x5990cd[_0xb506('0x62')])?_0x5990cd['First_Name']+'\x20'+_0x5990cd[_0xb506('0x63')]:_0x5990cd[_0xb506('0x63')],'id':_0x5990cd['id']};_0x48049e[_0xb506('0x65')]=_[_0xb506('0x43')](_0x5990cd[_0xb506('0x42')]);}if(_0x414e37[_0xb506('0x66')]){_0x48049e[_0xb506('0x67')]=moment[_0xb506('0x68')](parseInt(_0x414e37['talktime'])*0x3e8)['format'](_0xb506('0x69'));}else if(_0x414e37[_0xb506('0x6a')]&&_0x414e37[_0xb506('0x6b')]){_0x48049e[_0xb506('0x67')]=moment[_0xb506('0x68')](moment(_0x414e37[_0xb506('0x6b')],_0xb506('0x6c'))[_0xb506('0x6d')](moment(_0x414e37[_0xb506('0x6e')],'YYYY-MM-DDTHH:mm:ss')))[_0xb506('0x2f')](_0xb506('0x69'));}switch(_0x414e37[_0xb506('0x6f')]){case _0xb506('0x70'):_0x48049e[_0xb506('0x71')]=_0xb506('0x72');break;case _0xb506('0x73'):case _0xb506('0x74'):_0x48049e[_0xb506('0x71')]='Answered';break;case'rejected':_0x48049e[_0xb506('0x71')]=_0xb506('0x75');break;case _0xb506('0x76'):_0x48049e[_0xb506('0x71')]=_0xb506('0x77');break;case'timeout':_0x48049e[_0xb506('0x71')]=_0xb506('0x78');default:}_0x48049e[_0xb506('0x79')]=(_0x170661===_0xb506('0x7a')?moment(_0x414e37[_0xb506('0x6e')])[_0xb506('0x2f')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x414e37[_0xb506('0x7b')])[_0xb506('0x2f')](_0xb506('0x6c')))||moment()[_0xb506('0x2f')]('YYYY-MM-DDTHH:mm:ss');_0x48049e[_0xb506('0x7c')]=_0x170661||_0xb506('0x7d');_0x48049e=_[_0xb506('0x7e')](_0x48049e,getCustomFields(_0x45def7[_0xb506('0x7f')],_0x414e37));return request({'method':'POST','uri':_0xb506('0x50')+_0x544727+_0xb506('0x80'),'headers':{'Authorization':_0xb506('0x32')+_0x39ce72},'body':{'data':[_0x48049e]},'json':!![]})[_0xb506('0x2a')](function(_0x2fc31c){if(_0x2fc31c&&_0x2fc31c[_0xb506('0x41')][0x0]['code']===_0xb506('0x81')){logger['info'](_0xb506('0x82'));return{'id':_0x2fc31c[_0xb506('0x41')][0x0][_0xb506('0x48')]['id']};}})['catch'](function(_0x32c59b){logger[_0xb506('0x37')](_0xb506('0x83'),_0x32c59b[_0xb506('0x2e')]);console['log'](_0xb506('0x83'),_0x32c59b);});}exports[_0xb506('0x84')]=function(_0x204736,_0x12543e,_0xd5403a,_0x1a2ae8,_0x4348d3,_0x4684c8){var _0x5af8dd,_0x2d0975,_0x20ab8b;_0x4684c8[_0xb506('0x85')]=intUtil[_0xb506('0x86')](_0x4684c8['host']);_0x4684c8[_0xb506('0x87')]=intUtil[_0xb506('0x86')](_0x4684c8[_0xb506('0x87')]);if(_0x4348d3&&_0x4348d3[_0xb506('0x88')]){logger['info'](_0xb506('0x89'),_0xb506('0x8a'));_0x12543e['recordingURL']=_0x4684c8['serverUrl']+_0xb506('0x8b')+_0x12543e[_0xb506('0x8c')]+_0xb506('0x8d')+md5(_0x12543e['uniqueid']);}else{_0x12543e[_0xb506('0x8e')]='';}var _0x4d4f70=_0x4684c8[_0xb506('0x85')]===_0xb506('0x8f')?'eu':_0xb506('0x90');return getAccessToken(_0x4684c8)['then'](function(_0x2684d5){_0x20ab8b=_0x2684d5;return getUser(_0x20ab8b,_0x4d4f70,_0x4684c8,_0x1a2ae8[_0xb506('0x36')]);})[_0xb506('0x2a')](function(_0x1e9538){_0x5af8dd=_0x1e9538;logger[_0xb506('0x37')](_0xb506('0x91'),_0x5af8dd['id']);return getEndUser(_0x20ab8b,_0x4d4f70,_0x4684c8,_0x12543e[_0xb506('0x92')],_0x12543e[_0xb506('0x93')],_0x5af8dd,_0xd5403a);})[_0xb506('0x2a')](function(_0x3d672e){_0x2d0975=_0x3d672e;return getCall(_0x20ab8b,_0x4d4f70,_0x4684c8,_0x5af8dd,_0x2d0975,_0xd5403a,_0x12543e,_0xb506('0x7d'));})[_0xb506('0x2a')](function(_0x465f9b){if(_0x465f9b){logger[_0xb506('0x37')](_0xb506('0x94'),_0x465f9b['id']);logger[_0xb506('0x37')](_0xb506('0x89'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x1a2ae8[_0xb506('0x19')]),_0xb506('0x95'),{'uri':'https://crm.'+_0x4684c8['host']+_0xb506('0x96')+_0x465f9b['id']});}})[_0xb506('0x40')](function(_0x1414c3){logger[_0xb506('0x2c')]('[QUEUE]',JSON['stringify'](_0x1414c3));});};exports[_0xb506('0x7a')]=function(_0x2fbb79,_0x110191,_0xc7771a,_0x284602,_0x16a337,_0x1ed32b,_0x456d32){var _0x431ac5,_0x5a3bdb,_0x13af5b;_0x1ed32b['host']=intUtil['stripTrailingSlash'](_0x1ed32b['host']);_0x1ed32b[_0xb506('0x87')]=intUtil[_0xb506('0x86')](_0x1ed32b[_0xb506('0x87')]);if(_0x456d32&&_0x456d32[_0xb506('0x97')]&&_0x456d32[_0xb506('0x97')]!==_0xb506('0x98')){logger[_0xb506('0x37')](_0xb506('0x99'),'Recording\x20is\x20enabled!');_0x110191[_0xb506('0x8e')]=_0x1ed32b['serverUrl']+_0xb506('0x8b')+_0x110191[_0xb506('0x8c')]+_0xb506('0x8d')+md5(_0x110191[_0xb506('0x8c')]);}var _0x52a814=_0x1ed32b[_0xb506('0x85')]===_0xb506('0x8f')?'eu':_0xb506('0x90');return getAccessToken(_0x1ed32b)[_0xb506('0x2a')](function(_0x22c595){_0x13af5b=_0x22c595;return getUser(_0x13af5b,_0x52a814,_0x1ed32b,_0x284602[_0xb506('0x36')]);})[_0xb506('0x2a')](function(_0x390b8f){_0x431ac5=_0x390b8f;logger[_0xb506('0x37')]('The\x20User\x20ID\x20is:',_0x431ac5['id']);return getEndUser(_0x13af5b,_0x52a814,_0x1ed32b,_0x110191['destcalleridname'],_0x110191[_0xb506('0x9a')],_0x431ac5,_0xc7771a);})[_0xb506('0x2a')](function(_0x46327f){_0x5a3bdb=_0x46327f;return getCall(_0x13af5b,_0x52a814,_0x1ed32b,_0x431ac5,_0x5a3bdb,_0xc7771a,_0x110191,_0xb506('0x9b'));})[_0xb506('0x2a')](function(_0x24a404){if(_0x24a404){logger['info'](_0xb506('0x94'),_0x24a404['id']);logger['info'](_0xb506('0x99'),_0xb506('0x9c'));emit(util[_0xb506('0x2f')]('user:%s',_0x284602[_0xb506('0x19')]),_0xb506('0x95'),{'uri':_0xb506('0x9d')+_0x1ed32b[_0xb506('0x85')]+'/crm/EntityInfo.do?module=Calls&id='+_0x24a404['id']});}})[_0xb506('0x40')](function(_0x2b7e3e){logger['error'](_0xb506('0x99'),JSON['stringify'](_0x2b7e3e));});};exports[_0xb506('0x9e')]=function(_0x59c04a,_0xada106,_0x4f2d78,_0x5485aa,_0x4d945b,_0x272076){var _0x6b99bd,_0x4eab0c,_0x1e9e60;_0x272076[_0xb506('0x85')]=intUtil[_0xb506('0x86')](_0x272076[_0xb506('0x85')]);_0x272076['serverUrl']=intUtil[_0xb506('0x86')](_0x272076['serverUrl']);if(_0x4d945b&&_0x4d945b[_0xb506('0x88')]){logger[_0xb506('0x37')]('['+_0xada106['lastevent'][_0xb506('0x9f')]()+']',_0xb506('0x8a'));_0xada106['recordingURL']=_0x272076[_0xb506('0x87')]+_0xb506('0x8b')+_0xada106[_0xb506('0x8c')]+_0xb506('0x8d')+md5(_0xada106[_0xb506('0x8c')]);}else{_0xada106[_0xb506('0x8e')]='';}var _0x3c5a96=_0x272076[_0xb506('0x85')]===_0xb506('0x8f')?'eu':_0xb506('0x90');return getAccessToken(_0x272076)[_0xb506('0x2a')](function(_0x29074){_0x1e9e60=_0x29074;return getUser(_0x1e9e60,_0x3c5a96,_0x272076);})[_0xb506('0x2a')](function(_0x6c2ee9){_0x6b99bd=_0x6c2ee9;logger[_0xb506('0x37')]('The\x20User\x20ID\x20is:',_0x6b99bd['id']);return getEndUser(_0x1e9e60,_0x3c5a96,_0x272076,_0xada106[_0xb506('0x92')],_0xada106['calleridnum'],_0x6b99bd,_0x4f2d78);})['then'](function(_0x43a7c7){_0x4eab0c=_0x43a7c7;return getCall(_0x1e9e60,_0x3c5a96,_0x272076,_0x6b99bd,_0x4eab0c,_0x4f2d78,_0xada106,_0xb506('0x7d'));})[_0xb506('0x2a')](function(_0x49b580){if(_0x49b580){logger[_0xb506('0x37')](_0xb506('0x94'),_0x49b580['id']);}})[_0xb506('0x40')](function(_0xd8f1f5){logger['error']('['+_0xada106[_0xb506('0x6f')][_0xb506('0x9f')]()+']',JSON[_0xb506('0x3e')](_0xd8f1f5));});}; \ 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 77629da..dab22e3 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 _0xcad5=['format','info','shelljs','mustache','../../../../config/logger','trigger','data2','data3','render'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xcad5,0xbf));var _0x5cad=function(_0x5065fa,_0x327628){_0x5065fa=_0x5065fa-0x0;var _0x16b669=_0xcad5[_0x5065fa];return _0x16b669;};'use strict';var util=require('util');var sh=require(_0x5cad('0x0'));var Mustache=require(_0x5cad('0x1'));var logger=require(_0x5cad('0x2'))(_0x5cad('0x3'));exports['exec']=function(_0x3a5dff,_0x532245){var _0xea8266=_0x3a5dff[_0x5cad('0x4')]?_0x3a5dff['data2']:'Script';var _0x49cf96=_0x3a5dff[_0x5cad('0x5')]?Mustache[_0x5cad('0x6')](_0x3a5dff[_0x5cad('0x5')],_0x532245):_0x532245;sh['exec'](_0x49cf96,function(_0x324394,_0x358f85,_0xce2d4a){if(_0x324394!==0x0){logger['error'](util[_0x5cad('0x7')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0xea8266,_0x49cf96,_0x324394,_0xce2d4a));}else{logger[_0x5cad('0x8')](util[_0x5cad('0x7')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0xea8266,_0x49cf96,_0x358f85));}});}; \ No newline at end of file +var _0xd3a7=['data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','../../../../config/logger','exec','data2'];(function(_0x418f05,_0x5a1b0f){var _0x4e5347=function(_0xb26d30){while(--_0xb26d30){_0x418f05['push'](_0x418f05['shift']());}};_0x4e5347(++_0x5a1b0f);}(_0xd3a7,0xed));var _0x7d3a=function(_0x3616d4,_0x150635){_0x3616d4=_0x3616d4-0x0;var _0x506a07=_0xd3a7[_0x3616d4];return _0x506a07;};'use strict';var util=require(_0x7d3a('0x0'));var sh=require('shelljs');var Mustache=require(_0x7d3a('0x1'));var logger=require(_0x7d3a('0x2'))('trigger');exports[_0x7d3a('0x3')]=function(_0x428397,_0x5752a7){var _0x501721=_0x428397[_0x7d3a('0x4')]?_0x428397['data2']:'Script';var _0x2ccdcf=_0x428397[_0x7d3a('0x5')]?Mustache['render'](_0x428397[_0x7d3a('0x5')],_0x5752a7):_0x5752a7;sh[_0x7d3a('0x3')](_0x2ccdcf,function(_0xc04f87,_0xe19628,_0xff2302){if(_0xc04f87!==0x0){logger[_0x7d3a('0x6')](util[_0x7d3a('0x7')](_0x7d3a('0x8'),_0x501721,_0x2ccdcf,_0xc04f87,_0xff2302));}else{logger[_0x7d3a('0x9')](util['format'](_0x7d3a('0xa'),_0x501721,_0x2ccdcf,_0xe19628));}});}; \ 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 a857e74..debedb6 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 _0x4416=['util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data5','number','headers','parse','data6','error','stack','GET','DELETE','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data2','statusCode','name','request-promise'];(function(_0x2c3a8f,_0x374e56){var _0x189412=function(_0x560055){while(--_0x560055){_0x2c3a8f['push'](_0x2c3a8f['shift']());}};_0x189412(++_0x374e56);}(_0x4416,0x197));var _0x6441=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x4416[_0xdea41a];return _0x15d0d8;};'use strict';var rp=require(_0x6441('0x0'));var util=require(_0x6441('0x1'));var _=require(_0x6441('0x2'));var Mustache=require(_0x6441('0x3'));var logger=require(_0x6441('0x4'))(_0x6441('0x5'));exports[_0x6441('0x6')]=function(_0x3ad09e,_0x474f0b){var _0x1e30e3,_0x405809;var _0x2b6010={'method':_0x3ad09e[_0x6441('0x7')][_0x6441('0x8')](),'uri':Mustache[_0x6441('0x9')](_0x3ad09e['data2'],_0x474f0b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3ad09e[_0x6441('0xa')])===_0x6441('0xb')&&parseInt(_0x3ad09e['data5'])>=0x1&&parseInt(_0x3ad09e[_0x6441('0xa')])<=0xa?parseInt(_0x3ad09e[_0x6441('0xa')])*0x3e8:0x5*0x3e8};try{_0x2b6010[_0x6441('0xc')]=_0x3ad09e['data6']?JSON[_0x6441('0xd')](Mustache[_0x6441('0x9')](_0x3ad09e[_0x6441('0xe')],_0x474f0b)):{};}catch(_0x4e47a0){logger[_0x6441('0xf')](_0x4e47a0[_0x6441('0x10')]);}switch(_0x3ad09e['data1'][_0x6441('0x8')]()){case _0x6441('0x11'):case _0x6441('0x12'):_0x1e30e3=null;_0x2b6010['qs']=_0x474f0b;break;case'POST':case _0x6441('0x13'):if(_0x3ad09e[_0x6441('0x14')]){try{_0x1e30e3=JSON[_0x6441('0xd')](Mustache[_0x6441('0x9')](_0x3ad09e['data7'],_0x474f0b));_0x2b6010[_0x6441('0x15')]=_0x1e30e3;}catch(_0x417f2e){logger[_0x6441('0xf')](_0x417f2e['stack']);logger[_0x6441('0xf')](_0x6441('0x16'));}}else{_0x1e30e3=_0x474f0b;_0x2b6010[_0x6441('0x15')]=_0x1e30e3;}break;}logger[_0x6441('0x17')](util[_0x6441('0x18')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x3ad09e[_0x6441('0x7')],_0x3ad09e['data2'],JSON[_0x6441('0x19')](_0x2b6010)));rp(_0x2b6010)[_0x6441('0x1a')](function(_0x4ec2f7){_0x1e30e3=!_[_0x6441('0x1b')](_0x1e30e3)?_0x6441('0x1c')+_0x1e30e3:'';_0x405809=typeof _0x4ec2f7[_0x6441('0x15')]===_0x6441('0x1d')?JSON[_0x6441('0x19')](_0x4ec2f7[_0x6441('0x15')]):_0x4ec2f7[_0x6441('0x15')];logger['info'](util['format'](_0x6441('0x1e'),_0x3ad09e[_0x6441('0x7')],_0x3ad09e[_0x6441('0x1f')],_0x4ec2f7['statusCode'],_0x405809));})['catch'](function(_0x289e07){logger[_0x6441('0xf')](util[_0x6441('0x18')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x3ad09e['data1'],_0x3ad09e[_0x6441('0x1f')],_0x289e07[_0x6441('0x20')],_0x289e07[_0x6441('0x21')],_0x289e07['message']));});}; \ No newline at end of file +var _0x647b=['stack','toUpperCase','GET','POST','data7','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil',',\x20request\x20body:\x20','object','statusCode','catch','data1','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data2','data5','number','headers','data6','parse','render'];(function(_0x503eef,_0x15283e){var _0x22a142=function(_0xe1e3f4){while(--_0xe1e3f4){_0x503eef['push'](_0x503eef['shift']());}};_0x22a142(++_0x15283e);}(_0x647b,0x102));var _0xb647=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x647b[_0xbca1b1];return _0x4e1686;};'use strict';var rp=require(_0xb647('0x0'));var util=require(_0xb647('0x1'));var _=require(_0xb647('0x2'));var Mustache=require(_0xb647('0x3'));var logger=require(_0xb647('0x4'))(_0xb647('0x5'));exports[_0xb647('0x6')]=function(_0x5bad34,_0x16cf6d){var _0x5a537f,_0x163df5;var _0x234c88={'method':_0x5bad34['data1']['toUpperCase'](),'uri':Mustache['render'](_0x5bad34[_0xb647('0x7')],_0x16cf6d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5bad34[_0xb647('0x8')])===_0xb647('0x9')&&parseInt(_0x5bad34[_0xb647('0x8')])>=0x1&&parseInt(_0x5bad34[_0xb647('0x8')])<=0xa?parseInt(_0x5bad34[_0xb647('0x8')])*0x3e8:0x5*0x3e8};try{_0x234c88[_0xb647('0xa')]=_0x5bad34[_0xb647('0xb')]?JSON[_0xb647('0xc')](Mustache[_0xb647('0xd')](_0x5bad34[_0xb647('0xb')],_0x16cf6d)):{};}catch(_0xa677f7){logger['error'](_0xa677f7[_0xb647('0xe')]);}switch(_0x5bad34['data1'][_0xb647('0xf')]()){case _0xb647('0x10'):case'DELETE':_0x5a537f=null;_0x234c88['qs']=_0x16cf6d;break;case _0xb647('0x11'):case'PUT':if(_0x5bad34[_0xb647('0x12')]){try{_0x5a537f=JSON[_0xb647('0xc')](Mustache['render'](_0x5bad34[_0xb647('0x12')],_0x16cf6d));_0x234c88['body']=_0x5a537f;}catch(_0x38c09f){logger[_0xb647('0x13')](_0x38c09f[_0xb647('0xe')]);logger[_0xb647('0x13')](_0xb647('0x14'));}}else{_0x5a537f=_0x16cf6d;_0x234c88[_0xb647('0x15')]=_0x5a537f;}break;}logger[_0xb647('0x16')](util[_0xb647('0x17')](_0xb647('0x18'),_0x5bad34['data1'],_0x5bad34[_0xb647('0x7')],JSON[_0xb647('0x19')](_0x234c88)));rp(_0x234c88)['then'](function(_0x2e004f){_0x5a537f=!_[_0xb647('0x1a')](_0x5a537f)?_0xb647('0x1b')+_0x5a537f:'';_0x163df5=typeof _0x2e004f[_0xb647('0x15')]===_0xb647('0x1c')?JSON['stringify'](_0x2e004f[_0xb647('0x15')]):_0x2e004f[_0xb647('0x15')];logger[_0xb647('0x16')](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x5bad34['data1'],_0x5bad34[_0xb647('0x7')],_0x2e004f[_0xb647('0x1d')],_0x163df5));})[_0xb647('0x1e')](function(_0x4561e5){logger[_0xb647('0x13')](util[_0xb647('0x17')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5bad34[_0xb647('0x1f')],_0x5bad34[_0xb647('0x7')],_0x4561e5[_0xb647('0x1d')],_0x4561e5[_0xb647('0x20')],_0x4561e5[_0xb647('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 3927f73..b6024cc 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 _0x5a4f=['Request','request','rpc','routing','error','message','catch','exports','jayson/promise','../../config/logger','client','http'];(function(_0x41b0fc,_0x1cb85d){var _0x245de8=function(_0x4f194f){while(--_0x4f194f){_0x41b0fc['push'](_0x41b0fc['shift']());}};_0x245de8(++_0x1cb85d);}(_0x5a4f,0x134));var _0xf5a4=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x5a4f[_0x17928f];return _0x500b63;};'use strict';var jayson=require(_0xf5a4('0x0'));var BPromise=require('bluebird');var logger=require(_0xf5a4('0x1'))('routing');var client=jayson[_0xf5a4('0x2')][_0xf5a4('0x3')]({'port':0x2329});client[_0xf5a4('0x4')]=function(_0x377727,_0x224e54){return new BPromise(function(_0x57cd30,_0x363d9f){return client[_0xf5a4('0x5')](_0x377727,_0x224e54)['then'](function(_0x2a56e9){logger['debug'](_0xf5a4('0x6'),_0xf5a4('0x7'),_0x377727,_0x224e54,_0x2a56e9);if(_0x2a56e9['error']){logger[_0xf5a4('0x8')](_0xf5a4('0x6'),'routing',_0x377727,_0x2a56e9['error'][_0xf5a4('0x9')],_0x224e54);return _0x363d9f(_0x2a56e9[_0xf5a4('0x8')]['message']);}else{return _0x57cd30(_0x2a56e9['result']);}})[_0xf5a4('0xa')](function(_0xe34824){logger[_0xf5a4('0x8')](_0xf5a4('0x6'),_0xf5a4('0x7'),_0x377727,_0xe34824,_0x224e54);return _0x363d9f(_0xe34824);});});};module[_0xf5a4('0xb')]=client; \ No newline at end of file +var _0x0bee=['then','rpc','error','message','result','catch','exports','jayson/promise','bluebird','routing','client','http','Request'];(function(_0x346ad1,_0x40a6d1){var _0x558f98=function(_0x58f817){while(--_0x58f817){_0x346ad1['push'](_0x346ad1['shift']());}};_0x558f98(++_0x40a6d1);}(_0x0bee,0x19a));var _0xe0be=function(_0x30b2d1,_0x566209){_0x30b2d1=_0x30b2d1-0x0;var _0x4f3cb6=_0x0bee[_0x30b2d1];return _0x4f3cb6;};'use strict';var jayson=require(_0xe0be('0x0'));var BPromise=require(_0xe0be('0x1'));var logger=require('../../config/logger')(_0xe0be('0x2'));var client=jayson[_0xe0be('0x3')][_0xe0be('0x4')]({'port':0x2329});client[_0xe0be('0x5')]=function(_0x45de5f,_0x6a9afc){return new BPromise(function(_0x6e7875,_0x358758){return client['request'](_0x45de5f,_0x6a9afc)[_0xe0be('0x6')](function(_0x5a17ed){logger['debug'](_0xe0be('0x7'),_0xe0be('0x2'),_0x45de5f,_0x6a9afc,_0x5a17ed);if(_0x5a17ed[_0xe0be('0x8')]){logger[_0xe0be('0x8')](_0xe0be('0x7'),'routing',_0x45de5f,_0x5a17ed[_0xe0be('0x8')]['message'],_0x6a9afc);return _0x358758(_0x5a17ed[_0xe0be('0x8')][_0xe0be('0x9')]);}else{return _0x6e7875(_0x5a17ed[_0xe0be('0xa')]);}})[_0xe0be('0xb')](function(_0x2f7138){logger[_0xe0be('0x8')](_0xe0be('0x7'),_0xe0be('0x2'),_0x45de5f,_0x2f7138,_0x6a9afc);return _0x358758(_0x2f7138);});});};module[_0xe0be('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 2029a69..8f556d0 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 _0x75c2=['bluebird','./server','./realtime','./lib/email','getMailAccounts','then','initMailAccounts','refresh','mailAccounts','listen','getSettings','catch','log'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x75c2,0x1a0));var _0x275c=function(_0xda4418,_0x2c63f8){_0xda4418=_0xda4418-0x0;var _0x113dae=_0x75c2[_0xda4418];return _0x113dae;};'use strict';var BPromise=require(_0x275c('0x0'));var server=require(_0x275c('0x1'));var Realtime=require(_0x275c('0x2'));var EmailChannel=require(_0x275c('0x3'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()['then'](mailAccount[_0x275c('0x4')]())[_0x275c('0x5')](realtime[_0x275c('0x6')]())['then'](function(){email[_0x275c('0x7')](realtime[_0x275c('0x8')]);return realtime;});}function main(){return server[_0x275c('0x9')](realtime,email)[_0x275c('0x5')](function(){return initRealtime();})[_0x275c('0x5')](function(){return setting[_0x275c('0xa')]();})[_0x275c('0x5')](function(_0x43521f){return setInterval(initRealtime,_0x43521f['loginMailFrequency']*0x3e8);})[_0x275c('0xb')](function(_0x3a40e2){console[_0x275c('0xc')](_0x3a40e2);});}main(); \ No newline at end of file +var _0xfde2=['loginMailFrequency','log','./rpc/mailAccount','./rpc/setting','resolve','then','refresh','getSettings'];(function(_0x4b7b0e,_0x2f3a01){var _0x5028ab=function(_0x3d2c9c){while(--_0x3d2c9c){_0x4b7b0e['push'](_0x4b7b0e['shift']());}};_0x5028ab(++_0x2f3a01);}(_0xfde2,0xea));var _0x2fde=function(_0x1830a9,_0x1583bd){_0x1830a9=_0x1830a9-0x0;var _0x2b6166=_0xfde2[_0x1830a9];return _0x2b6166;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require('./lib/email');var mailAccount=require(_0x2fde('0x0'));var setting=require(_0x2fde('0x1'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x2fde('0x2')]()[_0x2fde('0x3')](mailAccount['getMailAccounts']())[_0x2fde('0x3')](realtime['initMailAccounts']())[_0x2fde('0x3')](function(){email[_0x2fde('0x4')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0x2fde('0x3')](function(){return initRealtime();})[_0x2fde('0x3')](function(){return setting[_0x2fde('0x5')]();})[_0x2fde('0x3')](function(_0x405e05){return setInterval(initRealtime,_0x405e05[_0x2fde('0x6')]*0x3e8);})['catch'](function(_0x10b275){console[_0x2fde('0x7')](_0x10b275);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 1e32546..7dca180 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 _0x73bd=['exports','lodash','moment','../../../config/environment','email','redis','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','name','key','active','status','Imap','messageStatus','total','isNil','stringify','md5','emit','mailAccount:update','refresh','hasOwnProperty','box','bind','end','error','handleImapError','handleImapBox','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','Mail\x20accepted\x20from\x20routing','catch','lastSync','sendMail','Smtp','verify','then','verified'];(function(_0x182d3b,_0x17ddb0){var _0x547d32=function(_0x97f716){while(--_0x97f716){_0x182d3b['push'](_0x182d3b['shift']());}};_0x547d32(++_0x17ddb0);}(_0x73bd,0xc5));var _0xd73b=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x73bd[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xd73b('0x0'));var moment=require(_0xd73b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require('ioredis');var config=require(_0xd73b('0x2'));var logger=require('../../../config/logger')(_0xd73b('0x3'));config[_0xd73b('0x4')]=_['defaults'](config[_0xd73b('0x4')],{'host':_0xd73b('0x5'),'port':0x18eb});var io=require(_0xd73b('0x6'))(new Redis(config[_0xd73b('0x4')]));var EmailImap=require('./imap');var EmailSmtp=require(_0xd73b('0x7'));var mailAccount=require(_0xd73b('0x8'));var md5Accounts={};function EmailChannel(_0x379d79){logger[_0xd73b('0x9')]('start\x20email\x20channel');this[_0xd73b('0xa')]=_0x379d79[_0xd73b('0xa')];this[_0xd73b('0xb')]={};this[_0xd73b('0xc')]=new EmailSmtp();}EmailChannel[_0xd73b('0xd')]['emit']=function(_0xabb234){var _0x35e561=this[_0xd73b('0xa')][_0xabb234];var _0x136a6d={'id':_0x35e561['id'],'name':_0x35e561[_0xd73b('0xe')],'key':_0x35e561[_0xd73b('0xf')],'active':_0x35e561[_0xd73b('0x10')],'Imap':{'status':_0x35e561['Imap'][_0xd73b('0x11')],'messageStatus':_0x35e561[_0xd73b('0x12')][_0xd73b('0x13')],'total':_0x35e561[_0xd73b('0x12')][_0xd73b('0x14')]}};if(_[_0xd73b('0x15')](md5Accounts[_0xabb234])){md5Accounts[_0xabb234]={};}var _0x2291ae=md5(JSON[_0xd73b('0x16')](_0x136a6d));if(md5Accounts[_0xabb234]['md5']!==_0x2291ae){md5Accounts[_0xabb234][_0xd73b('0x17')]=_0x2291ae;io[_0xd73b('0x18')](_0xd73b('0x19'),_0x136a6d);}};EmailChannel[_0xd73b('0xd')][_0xd73b('0x1a')]=function(_0x4429c2){for(var _0x447759 in _0x4429c2){if(_0x4429c2[_0xd73b('0x1b')](_0x447759)){if(_0x4429c2[_0x447759][_0xd73b('0x12')]&&_0x4429c2[_0x447759]['active']){var _0x308734=_0x4429c2[_0x447759][_0xd73b('0x12')];if(!this['imapAccounts'][_0xd73b('0x1b')](_0x308734['id'])){this['imapAccounts'][_0x308734['id']]=new EmailImap(_0x308734,_0x4429c2[_0x447759]['email']);this[_0xd73b('0xb')][_0x308734['id']]['on'](_0xd73b('0x1c'),this['handleImapBox'][_0xd73b('0x1d')](this,_0x447759));this['imapAccounts'][_0x308734['id']]['on'](_0xd73b('0x3'),this['handleImapEmail']['bind'](this,_0x447759));this['imapAccounts'][_0x308734['id']]['on'](_0xd73b('0x1e'),this['handleImapEnd'][_0xd73b('0x1d')](this,_0x447759));this[_0xd73b('0xb')][_0x308734['id']]['on'](_0xd73b('0x1f'),this[_0xd73b('0x20')][_0xd73b('0x1d')](this,_0x447759));}}else{if(_[_0xd73b('0x15')](this['mailAccounts'][_0x447759][_0xd73b('0x12')])){this[_0xd73b('0xa')][_0x447759][_0xd73b('0x12')]={};}this[_0xd73b('0xa')][_0x447759][_0xd73b('0x12')]['status']='disabled';this[_0xd73b('0xa')][_0x447759][_0xd73b('0x12')]['messageStatus']='';this['emit'](_0x447759);}}}};EmailChannel['prototype'][_0xd73b('0x21')]=function(_0x4fe3dd,_0x15e480){if(this[_0xd73b('0xa')][_0x4fe3dd]){this[_0xd73b('0xa')][_0x4fe3dd]['Imap'][_0xd73b('0x11')]='connected';this[_0xd73b('0xa')][_0x4fe3dd][_0xd73b('0x12')][_0xd73b('0x13')]=_0x15e480[_0xd73b('0xe')];if(_0x15e480[_0xd73b('0x22')]){this[_0xd73b('0xa')][_0x4fe3dd]['Imap']['total']=_0x15e480[_0xd73b('0x22')][_0xd73b('0x14')];}return this[_0xd73b('0x18')](_0x4fe3dd);}};EmailChannel[_0xd73b('0xd')][_0xd73b('0x23')]=function(_0x449ec7,_0x581535){logger['info'](_0xd73b('0x24'),_0x581535[_0xd73b('0x25')],_0x581535[_0xd73b('0x26')],_0x581535['from'],_0x449ec7);if(this[_0xd73b('0xa')][_0x449ec7]){return mailAccount[_0xd73b('0x27')](_0x449ec7,_0x581535)['then'](function(_0x2e548c){if(_0x2e548c){logger['info'](_0xd73b('0x28'));}})[_0xd73b('0x29')](function(_0x32ff8d){logger[_0xd73b('0x1f')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xd73b('0x16')](_0x32ff8d));});}};EmailChannel['prototype']['handleImapEnd']=function(_0xc5ff82){if(this['mailAccounts'][_0xc5ff82]&&this[_0xd73b('0xa')][_0xc5ff82][_0xd73b('0x12')]){if(this[_0xd73b('0xb')][this[_0xd73b('0xa')][_0xc5ff82]['Imap']['id']]){delete this['imapAccounts'][this['mailAccounts'][_0xc5ff82]['Imap']['id']];}this[_0xd73b('0xa')][_0xc5ff82][_0xd73b('0x12')][_0xd73b('0x2a')]=moment();this[_0xd73b('0x18')](_0xc5ff82);}};EmailChannel[_0xd73b('0xd')][_0xd73b('0x20')]=function(_0x51cd46,_0x2fd2a5){if(this['mailAccounts'][_0x51cd46]){this[_0xd73b('0xa')][_0x51cd46]['Imap'][_0xd73b('0x11')]=_0xd73b('0x1f');this[_0xd73b('0xa')][_0x51cd46][_0xd73b('0x12')][_0xd73b('0x13')]=_0x2fd2a5;return this[_0xd73b('0x18')](_0x51cd46);}};EmailChannel[_0xd73b('0xd')][_0xd73b('0x2b')]=function(_0xc06db3,_0xf1a1dd){return this[_0xd73b('0xc')]['send'](_0xc06db3,_0xf1a1dd);};EmailChannel[_0xd73b('0xd')]['verifySmtp']=function(_0x26ecfa){var _0x142607=this;if(this['mailAccounts'][_0x26ecfa['id']]){if(_['isNil'](this['mailAccounts'][_0x26ecfa['id']]['Smtp'])){this[_0xd73b('0xa')][_0x26ecfa['id']]['Smtp']={};}this[_0xd73b('0xa')][_0x26ecfa['id']][_0xd73b('0x2c')]['lastSync']=moment();return new BPromise(function(_0x4ff16f,_0x44851b){return _0x142607[_0xd73b('0xc')][_0xd73b('0x2d')](_0x26ecfa)[_0xd73b('0x2e')](function(_0x4fb183){_0x142607[_0xd73b('0xa')][_0x26ecfa['id']][_0xd73b('0x2c')][_0xd73b('0x11')]=_0xd73b('0x2f');_0x142607['mailAccounts'][_0x26ecfa['id']][_0xd73b('0x2c')]['messageStatus']='';_0x142607[_0xd73b('0x18')](_0x26ecfa['id']);_0x4ff16f(_0x4fb183);})[_0xd73b('0x29')](function(_0x20db0f){_0x142607[_0xd73b('0xa')][_0x26ecfa['id']][_0xd73b('0x2c')][_0xd73b('0x11')]='error';_0x142607['mailAccounts'][_0x26ecfa['id']][_0xd73b('0x2c')][_0xd73b('0x13')]=_0x20db0f;_0x142607[_0xd73b('0x18')](_0x26ecfa['id']);_0x44851b(_0x20db0f);});});}return this[_0xd73b('0xc')][_0xd73b('0x2d')](_0x26ecfa);};module[_0xd73b('0x30')]=EmailChannel; \ No newline at end of file +var _0x5f3d=['connected','messages','info','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','handleImapError','sendMail','send','Smtp','verify','verified','exports','lodash','moment','md5','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','mailAccounts','smtp','emit','name','key','active','Imap','messageStatus','total','isNil','mailAccount:update','prototype','refresh','hasOwnProperty','imapAccounts','bind','handleImapEmail','end','handleImapEnd','error','status','disabled'];(function(_0x451550,_0x3e1d2c){var _0x270b39=function(_0x539d04){while(--_0x539d04){_0x451550['push'](_0x451550['shift']());}};_0x270b39(++_0x3e1d2c);}(_0x5f3d,0x1f0));var _0xd5f3=function(_0x3f3abc,_0x2fde3b){_0x3f3abc=_0x3f3abc-0x0;var _0x506321=_0x5f3d[_0x3f3abc];return _0x506321;};'use strict';var _=require(_0xd5f3('0x0'));var moment=require(_0xd5f3('0x1'));var BPromise=require('bluebird');var md5=require(_0xd5f3('0x2'));var Redis=require('ioredis');var config=require(_0xd5f3('0x3'));var logger=require(_0xd5f3('0x4'))(_0xd5f3('0x5'));config[_0xd5f3('0x6')]=_['defaults'](config['redis'],{'host':_0xd5f3('0x7'),'port':0x18eb});var io=require(_0xd5f3('0x8'))(new Redis(config['redis']));var EmailImap=require(_0xd5f3('0x9'));var EmailSmtp=require(_0xd5f3('0xa'));var mailAccount=require(_0xd5f3('0xb'));var md5Accounts={};function EmailChannel(_0x46cbd0){logger['info']('start\x20email\x20channel');this[_0xd5f3('0xc')]=_0x46cbd0[_0xd5f3('0xc')];this['imapAccounts']={};this[_0xd5f3('0xd')]=new EmailSmtp();}EmailChannel['prototype'][_0xd5f3('0xe')]=function(_0x4bf68b){var _0x1a03eb=this[_0xd5f3('0xc')][_0x4bf68b];var _0x1e319b={'id':_0x1a03eb['id'],'name':_0x1a03eb[_0xd5f3('0xf')],'key':_0x1a03eb[_0xd5f3('0x10')],'active':_0x1a03eb[_0xd5f3('0x11')],'Imap':{'status':_0x1a03eb[_0xd5f3('0x12')]['status'],'messageStatus':_0x1a03eb[_0xd5f3('0x12')][_0xd5f3('0x13')],'total':_0x1a03eb[_0xd5f3('0x12')][_0xd5f3('0x14')]}};if(_[_0xd5f3('0x15')](md5Accounts[_0x4bf68b])){md5Accounts[_0x4bf68b]={};}var _0x3d681d=md5(JSON['stringify'](_0x1e319b));if(md5Accounts[_0x4bf68b][_0xd5f3('0x2')]!==_0x3d681d){md5Accounts[_0x4bf68b][_0xd5f3('0x2')]=_0x3d681d;io['emit'](_0xd5f3('0x16'),_0x1e319b);}};EmailChannel[_0xd5f3('0x17')][_0xd5f3('0x18')]=function(_0x2da27e){for(var _0x5d096e in _0x2da27e){if(_0x2da27e[_0xd5f3('0x19')](_0x5d096e)){if(_0x2da27e[_0x5d096e]['Imap']&&_0x2da27e[_0x5d096e][_0xd5f3('0x11')]){var _0xb29fe2=_0x2da27e[_0x5d096e][_0xd5f3('0x12')];if(!this[_0xd5f3('0x1a')][_0xd5f3('0x19')](_0xb29fe2['id'])){this[_0xd5f3('0x1a')][_0xb29fe2['id']]=new EmailImap(_0xb29fe2,_0x2da27e[_0x5d096e][_0xd5f3('0x5')]);this['imapAccounts'][_0xb29fe2['id']]['on']('box',this['handleImapBox'][_0xd5f3('0x1b')](this,_0x5d096e));this[_0xd5f3('0x1a')][_0xb29fe2['id']]['on']('email',this[_0xd5f3('0x1c')][_0xd5f3('0x1b')](this,_0x5d096e));this[_0xd5f3('0x1a')][_0xb29fe2['id']]['on'](_0xd5f3('0x1d'),this[_0xd5f3('0x1e')][_0xd5f3('0x1b')](this,_0x5d096e));this[_0xd5f3('0x1a')][_0xb29fe2['id']]['on'](_0xd5f3('0x1f'),this['handleImapError'][_0xd5f3('0x1b')](this,_0x5d096e));}}else{if(_['isNil'](this[_0xd5f3('0xc')][_0x5d096e]['Imap'])){this[_0xd5f3('0xc')][_0x5d096e][_0xd5f3('0x12')]={};}this[_0xd5f3('0xc')][_0x5d096e][_0xd5f3('0x12')][_0xd5f3('0x20')]=_0xd5f3('0x21');this[_0xd5f3('0xc')][_0x5d096e][_0xd5f3('0x12')][_0xd5f3('0x13')]='';this[_0xd5f3('0xe')](_0x5d096e);}}}};EmailChannel[_0xd5f3('0x17')]['handleImapBox']=function(_0x205a4a,_0x44f41e){if(this[_0xd5f3('0xc')][_0x205a4a]){this['mailAccounts'][_0x205a4a][_0xd5f3('0x12')][_0xd5f3('0x20')]=_0xd5f3('0x22');this[_0xd5f3('0xc')][_0x205a4a][_0xd5f3('0x12')][_0xd5f3('0x13')]=_0x44f41e[_0xd5f3('0xf')];if(_0x44f41e[_0xd5f3('0x23')]){this[_0xd5f3('0xc')][_0x205a4a][_0xd5f3('0x12')][_0xd5f3('0x14')]=_0x44f41e[_0xd5f3('0x23')][_0xd5f3('0x14')];}return this[_0xd5f3('0xe')](_0x205a4a);}};EmailChannel[_0xd5f3('0x17')]['handleImapEmail']=function(_0x2e44d3,_0x54cf49){logger[_0xd5f3('0x24')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x54cf49[_0xd5f3('0x25')],_0x54cf49[_0xd5f3('0x26')],_0x54cf49['from'],_0x2e44d3);if(this[_0xd5f3('0xc')][_0x2e44d3]){return mailAccount[_0xd5f3('0x27')](_0x2e44d3,_0x54cf49)[_0xd5f3('0x28')](function(_0x34c562){if(_0x34c562){logger['info'](_0xd5f3('0x29'));}})[_0xd5f3('0x2a')](function(_0x12aa47){logger['error'](_0xd5f3('0x2b'),JSON[_0xd5f3('0x2c')](_0x12aa47));});}};EmailChannel[_0xd5f3('0x17')]['handleImapEnd']=function(_0x54991b){if(this[_0xd5f3('0xc')][_0x54991b]&&this['mailAccounts'][_0x54991b][_0xd5f3('0x12')]){if(this[_0xd5f3('0x1a')][this[_0xd5f3('0xc')][_0x54991b][_0xd5f3('0x12')]['id']]){delete this[_0xd5f3('0x1a')][this['mailAccounts'][_0x54991b][_0xd5f3('0x12')]['id']];}this[_0xd5f3('0xc')][_0x54991b]['Imap'][_0xd5f3('0x2d')]=moment();this[_0xd5f3('0xe')](_0x54991b);}};EmailChannel[_0xd5f3('0x17')][_0xd5f3('0x2e')]=function(_0x16a1b8,_0x3dee6d){if(this[_0xd5f3('0xc')][_0x16a1b8]){this[_0xd5f3('0xc')][_0x16a1b8][_0xd5f3('0x12')][_0xd5f3('0x20')]=_0xd5f3('0x1f');this['mailAccounts'][_0x16a1b8][_0xd5f3('0x12')][_0xd5f3('0x13')]=_0x3dee6d;return this['emit'](_0x16a1b8);}};EmailChannel[_0xd5f3('0x17')][_0xd5f3('0x2f')]=function(_0x377aec,_0x2961be){return this[_0xd5f3('0xd')][_0xd5f3('0x30')](_0x377aec,_0x2961be);};EmailChannel[_0xd5f3('0x17')]['verifySmtp']=function(_0x6a89d9){var _0x278d87=this;if(this[_0xd5f3('0xc')][_0x6a89d9['id']]){if(_['isNil'](this[_0xd5f3('0xc')][_0x6a89d9['id']][_0xd5f3('0x31')])){this[_0xd5f3('0xc')][_0x6a89d9['id']]['Smtp']={};}this[_0xd5f3('0xc')][_0x6a89d9['id']][_0xd5f3('0x31')]['lastSync']=moment();return new BPromise(function(_0x18562d,_0x56504e){return _0x278d87[_0xd5f3('0xd')][_0xd5f3('0x32')](_0x6a89d9)[_0xd5f3('0x28')](function(_0x409a55){_0x278d87['mailAccounts'][_0x6a89d9['id']][_0xd5f3('0x31')][_0xd5f3('0x20')]=_0xd5f3('0x33');_0x278d87[_0xd5f3('0xc')][_0x6a89d9['id']][_0xd5f3('0x31')][_0xd5f3('0x13')]='';_0x278d87[_0xd5f3('0xe')](_0x6a89d9['id']);_0x18562d(_0x409a55);})[_0xd5f3('0x2a')](function(_0x10baa9){_0x278d87[_0xd5f3('0xc')][_0x6a89d9['id']][_0xd5f3('0x31')]['status']=_0xd5f3('0x1f');_0x278d87[_0xd5f3('0xc')][_0x6a89d9['id']][_0xd5f3('0x31')]['messageStatus']=_0x10baa9;_0x278d87[_0xd5f3('0xe')](_0x6a89d9['id']);_0x56504e(_0x10baa9);});});}return this['smtp'][_0xd5f3('0x32')](_0x6a89d9);};module[_0xd5f3('0x34')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 37e68d8..45c3eaf 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 _0x67db=['ready','handleReady','end','handleEnd','bind','connect','inherits','prototype','getAccount','authTimeout','isNil','service','authentication','user','password','host','port','tls','required','getHost','anonymous@xcally.com','openBox','mailbox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','search','handleReadUnseen','length','message','handleFetchMessage','error','handleFetchEnd','closeBox','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','stringify','textCode','hasOwnProperty','upperFirst','path','util','imap','mailparser','simpleParser','iconv','EventEmitter','./utils','email','INBOX','account','once'];(function(_0x248e47,_0x4bdb9b){var _0x274cf1=function(_0x89e97e){while(--_0x89e97e){_0x248e47['push'](_0x248e47['shift']());}};_0x274cf1(++_0x4bdb9b);}(_0x67db,0x150));var _0xb67d=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x67db[_0x45d3f0];return _0x314b79;};'use strict';var fs=require('fs');var path=require(_0xb67d('0x0'));var util=require(_0xb67d('0x1'));var Imap=require(_0xb67d('0x2'));var _=require('lodash');var rs=require('randomstring');var simpleParser=require(_0xb67d('0x3'))[_0xb67d('0x4')];var Iconv=require(_0xb67d('0x5'))['Iconv'];var EventEmitter=require('events')[_0xb67d('0x6')];var utils=require(_0xb67d('0x7'));var logger=require('../../../config/logger')(_0xb67d('0x8'));function EmailImap(_0x6b6d24,_0x18a3eb){this['mailbox']=_0xb67d('0x9');this['account']=this['getAccount'](_0x6b6d24,_0x18a3eb);this['imap']=new Imap(this[_0xb67d('0xa')]);this[_0xb67d('0x2')][_0xb67d('0xb')](_0xb67d('0xc'),this[_0xb67d('0xd')]['bind'](this));this[_0xb67d('0x2')][_0xb67d('0xb')](_0xb67d('0xe'),this[_0xb67d('0xf')][_0xb67d('0x10')](this));this['imap']['on']('error',this['handleError'][_0xb67d('0x10')](this));this[_0xb67d('0x2')][_0xb67d('0x11')]();}util[_0xb67d('0x12')](EmailImap,EventEmitter);EmailImap[_0xb67d('0x13')][_0xb67d('0x14')]=function(_0x4ab6ba,_0x3e34ca){var _0x5eeb29={'connTimeout':_0x4ab6ba['connTimeout']?_0x4ab6ba['connTimeout']*0x3e8:0x2710,'authTimeout':_0x4ab6ba['authTimeout']?_0x4ab6ba[_0xb67d('0x15')]*0x3e8:0x1388};if(_[_0xb67d('0x16')](_0x4ab6ba[_0xb67d('0x17')])){if(_0x4ab6ba[_0xb67d('0x18')]){_0x5eeb29[_0xb67d('0x19')]=_0x4ab6ba[_0xb67d('0x19')];_0x5eeb29[_0xb67d('0x1a')]=_0x4ab6ba[_0xb67d('0x1a')];}_0x5eeb29['host']=_0x4ab6ba[_0xb67d('0x1b')];_0x5eeb29[_0xb67d('0x1c')]=_0x4ab6ba[_0xb67d('0x1c')]||0x3e1;if(_0x4ab6ba[_0xb67d('0x1d')]){_0x5eeb29[_0xb67d('0x1d')]=!![];}else{_0x5eeb29[_0xb67d('0x1d')]=![];_0x5eeb29['autotls']=_0xb67d('0x1e');}}else{_0x5eeb29['user']=_0x4ab6ba['user'];_0x5eeb29[_0xb67d('0x1a')]=_0x4ab6ba[_0xb67d('0x1a')];_0x5eeb29[_0xb67d('0x1b')]=utils[_0xb67d('0x1f')](_0x4ab6ba[_0xb67d('0x17')]);_0x5eeb29[_0xb67d('0x1c')]=0x3e1;_0x5eeb29[_0xb67d('0x1d')]=!![];}_0x5eeb29[_0xb67d('0x8')]=_0x3e34ca||_0x4ab6ba[_0xb67d('0x19')]||_0xb67d('0x20');return _0x5eeb29;};EmailImap['prototype'][_0xb67d('0xd')]=function(){this[_0xb67d('0x2')][_0xb67d('0x21')](this[_0xb67d('0x22')],![],this[_0xb67d('0x23')][_0xb67d('0x10')](this));};EmailImap['prototype'][_0xb67d('0x23')]=function(_0x1a1472,_0x29c0b6){if(_0x1a1472){this[_0xb67d('0x24')](_0x1a1472,!![]);}else{this[_0xb67d('0x25')](_0xb67d('0x26'),_0x29c0b6);this[_0xb67d('0x27')]();}};EmailImap[_0xb67d('0x13')][_0xb67d('0x28')]=function(_0x586629){if(_0x586629){this[_0xb67d('0x24')](_0x586629,!![]);}else{this[_0xb67d('0x2')][_0xb67d('0xe')]();}};EmailImap[_0xb67d('0x13')]['readUnseen']=function(){this[_0xb67d('0x2')][_0xb67d('0x29')](['UNSEEN'],this['handleReadUnseen'][_0xb67d('0x10')](this));};EmailImap[_0xb67d('0x13')][_0xb67d('0x2a')]=function(_0x2fe123,_0x147e07){if(_0x2fe123){this[_0xb67d('0x24')](_0x2fe123,!![]);}else{if(_0x147e07[_0xb67d('0x2b')]){try{var _0x197bdf=this[_0xb67d('0x2')]['fetch'](_0x147e07,{'bodies':'','markSeen':!![]});_0x197bdf['on'](_0xb67d('0x2c'),this[_0xb67d('0x2d')][_0xb67d('0x10')](this));_0x197bdf[_0xb67d('0xb')](_0xb67d('0x2e'),this['handleFetchError'][_0xb67d('0x10')](this));_0x197bdf[_0xb67d('0xb')](_0xb67d('0xe'),this[_0xb67d('0x2f')]['bind'](this));}catch(_0x54b986){logger[_0xb67d('0x2e')](_0x54b986);}}else{this[_0xb67d('0x2')][_0xb67d('0x30')](!![],this[_0xb67d('0x28')][_0xb67d('0x10')](this));}}};EmailImap['prototype'][_0xb67d('0x2d')]=function(_0x375de9,_0x5916a5){_0x375de9['on']('body',this['handleMessageBody'][_0xb67d('0x10')](this));_0x375de9[_0xb67d('0xb')](_0xb67d('0x31'),this['handleMessageAttributes']['bind'](this));_0x375de9[_0xb67d('0xb')](_0xb67d('0xe'),this[_0xb67d('0x32')][_0xb67d('0x10')](this));};EmailImap[_0xb67d('0x13')]['handleMessageBody']=function(_0x4b9a66,_0x223106){simpleParser(_0x4b9a66,{'Iconv':Iconv},this[_0xb67d('0x33')]['bind'](this));};EmailImap[_0xb67d('0x13')][_0xb67d('0x34')]=function(_0x1f725b){};EmailImap[_0xb67d('0x13')][_0xb67d('0x32')]=function(){};EmailImap[_0xb67d('0x13')][_0xb67d('0x33')]=function(_0x1a4d54,_0x24f4c9){if(_0x1a4d54){logger['error'](_0x1a4d54);}else{var _0x31f9a5=this;utils[_0xb67d('0x35')](this[_0xb67d('0xa')],_0x24f4c9,function(_0x14a8c6){_0x31f9a5['emit'](_0xb67d('0x8'),_0x14a8c6);});}};EmailImap[_0xb67d('0x13')]['handleFetchEnd']=function(){this[_0xb67d('0x2')]['closeBox'](!![],this['handleCloseBox'][_0xb67d('0x10')](this));};EmailImap[_0xb67d('0x13')]['handleFetchError']=function(_0x31dcf7){this[_0xb67d('0x24')](_0x31dcf7);this[_0xb67d('0x2')]['closeBox'](!![],this[_0xb67d('0x28')][_0xb67d('0x10')](this));};EmailImap[_0xb67d('0x13')]['handleEnd']=function(){this[_0xb67d('0x25')](_0xb67d('0xe'));};EmailImap['prototype']['handleError']=function(_0x219144,_0x252412){logger[_0xb67d('0x2e')](_0xb67d('0x24'),this[_0xb67d('0xa')][_0xb67d('0x8')],JSON[_0xb67d('0x36')](_0x219144));var _0x17f7cd='';if(_0x219144){if(_0x219144[_0xb67d('0x37')]){_0x17f7cd=_0x219144[_0xb67d('0x37')];}else{for(var _0x25c738 in _0x219144){if(_0x219144[_0xb67d('0x38')](_0x25c738)){_0x17f7cd+=_[_0xb67d('0x39')](_0x25c738)+':\x20'+_0x219144[_0x25c738]+'\x0a';}}}}if(_0x252412){this[_0xb67d('0x2')][_0xb67d('0xe')]();}else{this[_0xb67d('0x25')]('error',_0x17f7cd);this[_0xb67d('0x25')](_0xb67d('0xe'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x56e5=['handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','stringify','textCode','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','getAccount','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','handleOpenBox','emit','box','readUnseen','prototype','handleCloseBox','search','handleReadUnseen','length','fetch','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body'];(function(_0x229598,_0x308749){var _0x55b77f=function(_0x39838e){while(--_0x39838e){_0x229598['push'](_0x229598['shift']());}};_0x55b77f(++_0x308749);}(_0x56e5,0x18f));var _0x556e=function(_0x575dfc,_0x14014c){_0x575dfc=_0x575dfc-0x0;var _0x2e31c7=_0x56e5[_0x575dfc];return _0x2e31c7;};'use strict';var fs=require('fs');var path=require(_0x556e('0x0'));var util=require(_0x556e('0x1'));var Imap=require(_0x556e('0x2'));var _=require(_0x556e('0x3'));var rs=require(_0x556e('0x4'));var simpleParser=require(_0x556e('0x5'))[_0x556e('0x6')];var Iconv=require(_0x556e('0x7'))[_0x556e('0x8')];var EventEmitter=require('events')[_0x556e('0x9')];var utils=require(_0x556e('0xa'));var logger=require(_0x556e('0xb'))(_0x556e('0xc'));function EmailImap(_0x5a387b,_0x59bb72){this[_0x556e('0xd')]=_0x556e('0xe');this[_0x556e('0xf')]=this['getAccount'](_0x5a387b,_0x59bb72);this[_0x556e('0x2')]=new Imap(this[_0x556e('0xf')]);this[_0x556e('0x2')][_0x556e('0x10')](_0x556e('0x11'),this[_0x556e('0x12')][_0x556e('0x13')](this));this[_0x556e('0x2')]['once'](_0x556e('0x14'),this[_0x556e('0x15')]['bind'](this));this[_0x556e('0x2')]['on'](_0x556e('0x16'),this[_0x556e('0x17')][_0x556e('0x13')](this));this[_0x556e('0x2')][_0x556e('0x18')]();}util[_0x556e('0x19')](EmailImap,EventEmitter);EmailImap['prototype'][_0x556e('0x1a')]=function(_0x3a816b,_0x39b193){var _0xb5e054={'connTimeout':_0x3a816b[_0x556e('0x1b')]?_0x3a816b[_0x556e('0x1b')]*0x3e8:0x2710,'authTimeout':_0x3a816b[_0x556e('0x1c')]?_0x3a816b['authTimeout']*0x3e8:0x1388};if(_[_0x556e('0x1d')](_0x3a816b[_0x556e('0x1e')])){if(_0x3a816b[_0x556e('0x1f')]){_0xb5e054[_0x556e('0x20')]=_0x3a816b[_0x556e('0x20')];_0xb5e054[_0x556e('0x21')]=_0x3a816b[_0x556e('0x21')];}_0xb5e054[_0x556e('0x22')]=_0x3a816b[_0x556e('0x22')];_0xb5e054[_0x556e('0x23')]=_0x3a816b[_0x556e('0x23')]||0x3e1;if(_0x3a816b[_0x556e('0x24')]){_0xb5e054[_0x556e('0x24')]=!![];}else{_0xb5e054[_0x556e('0x24')]=![];_0xb5e054[_0x556e('0x25')]=_0x556e('0x26');}}else{_0xb5e054[_0x556e('0x20')]=_0x3a816b[_0x556e('0x20')];_0xb5e054[_0x556e('0x21')]=_0x3a816b[_0x556e('0x21')];_0xb5e054[_0x556e('0x22')]=utils[_0x556e('0x27')](_0x3a816b[_0x556e('0x1e')]);_0xb5e054['port']=0x3e1;_0xb5e054[_0x556e('0x24')]=!![];}_0xb5e054[_0x556e('0xc')]=_0x39b193||_0x3a816b[_0x556e('0x20')]||_0x556e('0x28');return _0xb5e054;};EmailImap['prototype'][_0x556e('0x12')]=function(){this[_0x556e('0x2')]['openBox'](this[_0x556e('0xd')],![],this[_0x556e('0x29')][_0x556e('0x13')](this));};EmailImap['prototype'][_0x556e('0x29')]=function(_0x21a98c,_0x40b924){if(_0x21a98c){this[_0x556e('0x17')](_0x21a98c,!![]);}else{this[_0x556e('0x2a')](_0x556e('0x2b'),_0x40b924);this[_0x556e('0x2c')]();}};EmailImap[_0x556e('0x2d')][_0x556e('0x2e')]=function(_0x1f50ac){if(_0x1f50ac){this['handleError'](_0x1f50ac,!![]);}else{this[_0x556e('0x2')][_0x556e('0x14')]();}};EmailImap[_0x556e('0x2d')][_0x556e('0x2c')]=function(){this[_0x556e('0x2')][_0x556e('0x2f')](['UNSEEN'],this[_0x556e('0x30')][_0x556e('0x13')](this));};EmailImap[_0x556e('0x2d')][_0x556e('0x30')]=function(_0x5b0824,_0x53fa39){if(_0x5b0824){this[_0x556e('0x17')](_0x5b0824,!![]);}else{if(_0x53fa39[_0x556e('0x31')]){try{var _0x52280d=this[_0x556e('0x2')][_0x556e('0x32')](_0x53fa39,{'bodies':'','markSeen':!![]});_0x52280d['on']('message',this['handleFetchMessage'][_0x556e('0x13')](this));_0x52280d[_0x556e('0x10')](_0x556e('0x16'),this[_0x556e('0x33')][_0x556e('0x13')](this));_0x52280d[_0x556e('0x10')]('end',this[_0x556e('0x34')][_0x556e('0x13')](this));}catch(_0x38583b){logger[_0x556e('0x16')](_0x38583b);}}else{this[_0x556e('0x2')][_0x556e('0x35')](!![],this['handleCloseBox'][_0x556e('0x13')](this));}}};EmailImap[_0x556e('0x2d')][_0x556e('0x36')]=function(_0x310819,_0x12e881){_0x310819['on'](_0x556e('0x37'),this['handleMessageBody'][_0x556e('0x13')](this));_0x310819[_0x556e('0x10')]('attributes',this[_0x556e('0x38')][_0x556e('0x13')](this));_0x310819[_0x556e('0x10')](_0x556e('0x14'),this[_0x556e('0x39')]['bind'](this));};EmailImap['prototype'][_0x556e('0x3a')]=function(_0x5e623d,_0x599d5e){simpleParser(_0x5e623d,{'Iconv':Iconv},this[_0x556e('0x3b')]['bind'](this));};EmailImap[_0x556e('0x2d')][_0x556e('0x38')]=function(_0x506271){};EmailImap[_0x556e('0x2d')][_0x556e('0x39')]=function(){};EmailImap[_0x556e('0x2d')][_0x556e('0x3b')]=function(_0x4494ad,_0x4d2d21){if(_0x4494ad){logger[_0x556e('0x16')](_0x4494ad);}else{var _0x4076bd=this;utils[_0x556e('0x3c')](this[_0x556e('0xf')],_0x4d2d21,function(_0x1b49a0){_0x4076bd[_0x556e('0x2a')](_0x556e('0xc'),_0x1b49a0);});}};EmailImap[_0x556e('0x2d')][_0x556e('0x34')]=function(){this['imap'][_0x556e('0x35')](!![],this[_0x556e('0x2e')]['bind'](this));};EmailImap[_0x556e('0x2d')][_0x556e('0x33')]=function(_0x4330ac){this[_0x556e('0x17')](_0x4330ac);this[_0x556e('0x2')][_0x556e('0x35')](!![],this['handleCloseBox'][_0x556e('0x13')](this));};EmailImap[_0x556e('0x2d')][_0x556e('0x15')]=function(){this['emit'](_0x556e('0x14'));};EmailImap[_0x556e('0x2d')][_0x556e('0x17')]=function(_0x4d0c3d,_0xb4d71f){logger[_0x556e('0x16')]('handleError',this['account']['email'],JSON[_0x556e('0x3d')](_0x4d0c3d));var _0x40e64a='';if(_0x4d0c3d){if(_0x4d0c3d[_0x556e('0x3e')]){_0x40e64a=_0x4d0c3d[_0x556e('0x3e')];}else{for(var _0x1152aa in _0x4d0c3d){if(_0x4d0c3d['hasOwnProperty'](_0x1152aa)){_0x40e64a+=_[_0x556e('0x3f')](_0x1152aa)+':\x20'+_0x4d0c3d[_0x1152aa]+'\x0a';}}}}if(_0xb4d71f){this[_0x556e('0x2')]['end']();}else{this[_0x556e('0x2a')](_0x556e('0x16'),_0x40e64a);this[_0x556e('0x2a')]('end');}};module[_0x556e('0x40')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 32bf5a4..7c12c7c 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 _0xf9db=['nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','exports'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xf9db,0x1ad));var _0xbf9d=function(_0x41dc9e,_0x130d81){_0x41dc9e=_0x41dc9e-0x0;var _0x4ef870=_0xf9db[_0x41dc9e];return _0x4ef870;};'use strict';var nodemailer=require(_0xbf9d('0x0'));var BPromise=require(_0xbf9d('0x1'));var inlineBase64=require(_0xbf9d('0x2'));function EmailSmtp(){}EmailSmtp[_0xbf9d('0x3')][_0xbf9d('0x4')]=function(_0x33b08e,_0xabd700){return new BPromise(function(_0x11080e,_0x535eb1){var _0x4b1b8f=nodemailer[_0xbf9d('0x5')](_0x33b08e);_0x4b1b8f[_0xbf9d('0x6')](_0xbf9d('0x7'),inlineBase64());_0x4b1b8f[_0xbf9d('0x8')](_0xabd700,function(_0xd198ca,_0x1e112c){if(_0xd198ca){_0x535eb1(_0xd198ca[_0xbf9d('0x9')]());}else{_0x11080e(_0x1e112c);}});});};EmailSmtp[_0xbf9d('0x3')]['verify']=function(_0x28b232){return new BPromise(function(_0x26af58,_0x292a58){var _0x253a92=nodemailer[_0xbf9d('0x5')](_0x28b232);_0x253a92[_0xbf9d('0xa')](function(_0x4aa350,_0x66dbb6){if(_0x4aa350){_0x292a58(_0x4aa350[_0xbf9d('0x9')]());}else{if(_0x66dbb6){_0x26af58(_0x66dbb6);}else{_0x292a58(_0xbf9d('0xb'));}}});});};module[_0xbf9d('0xc')]=EmailSmtp; \ No newline at end of file +var _0x028b=['createTransport','compile','sendMail','toString','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype'];(function(_0x36ed7a,_0x3d48db){var _0x1383f2=function(_0x2a983a){while(--_0x2a983a){_0x36ed7a['push'](_0x36ed7a['shift']());}};_0x1383f2(++_0x3d48db);}(_0x028b,0x1eb));var _0xb028=function(_0x120f15,_0x2c0000){_0x120f15=_0x120f15-0x0;var _0x6e8fd4=_0x028b[_0x120f15];return _0x6e8fd4;};'use strict';var nodemailer=require(_0xb028('0x0'));var BPromise=require(_0xb028('0x1'));var inlineBase64=require(_0xb028('0x2'));function EmailSmtp(){}EmailSmtp[_0xb028('0x3')]['send']=function(_0x3af1fb,_0x67563c){return new BPromise(function(_0x3efe1a,_0x41933f){var _0x422de3=nodemailer[_0xb028('0x4')](_0x3af1fb);_0x422de3['use'](_0xb028('0x5'),inlineBase64());_0x422de3[_0xb028('0x6')](_0x67563c,function(_0x4f133c,_0x200d99){if(_0x4f133c){_0x41933f(_0x4f133c[_0xb028('0x7')]());}else{_0x3efe1a(_0x200d99);}});});};EmailSmtp[_0xb028('0x3')]['verify']=function(_0x4e53b0){return new BPromise(function(_0x177212,_0x624538){var _0x3d7b63=nodemailer[_0xb028('0x4')](_0x4e53b0);_0x3d7b63['verify'](function(_0x597cdf,_0x5c4513){if(_0x597cdf){_0x624538(_0x597cdf['toString']());}else{if(_0x5c4513){_0x177212(_0x5c4513);}else{_0x624538('Not\x20verifired');}}});});};module[_0xb028('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 b7923ca..5f1cd3c 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 _0x9f0e=['randomstring','path','util','email','../../../config/environment','head','address','anonymous','generate','value','name','substring','indexOf','length','join','Anonymous','pop','isEmpty','@xcally.com','test','html','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','lodash','moment'];(function(_0x3db122,_0x5e6bee){var _0x325b67=function(_0x5095af){while(--_0x5095af){_0x3db122['push'](_0x3db122['shift']());}};_0x325b67(++_0x5e6bee);}(_0x9f0e,0x116));var _0xe9f0=function(_0x3c224e,_0x2ae548){_0x3c224e=_0x3c224e-0x0;var _0x122a8=_0x9f0e[_0x3c224e];return _0x122a8;};'use strict';var _=require(_0xe9f0('0x0'));var moment=require(_0xe9f0('0x1'));var random=require(_0xe9f0('0x2'));var fs=require('fs');var path=require(_0xe9f0('0x3'));var util=require(_0xe9f0('0x4'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0xe9f0('0x5'));var config=require(_0xe9f0('0x6'));function getAddress(_0x3c589d){var _0x202d69=_[_0xe9f0('0x7')](_0x3c589d['value']);return _0x202d69&&_0x202d69['address']?_0x202d69[_0xe9f0('0x8')]:_0xe9f0('0x9')+random[_0xe9f0('0xa')](0x6)+'@xcally.com';}function getFirstName(_0xf4a256){var _0x335b82=_[_0xe9f0('0x7')](_0xf4a256[_0xe9f0('0xb')]);if(_0x335b82&&_0x335b82[_0xe9f0('0xc')]){if(_0x335b82[_0xe9f0('0xc')]==_0x335b82[_0xe9f0('0x8')]){return _0x335b82[_0xe9f0('0xc')][_0xe9f0('0xd')](0x0,_0x335b82['name'][_0xe9f0('0xe')]('@'));}var _0x329ecd=_0x335b82[_0xe9f0('0xc')]['split'](/\s+/);return _0x329ecd[_0xe9f0('0xf')]>0x1?_0x329ecd['slice'](0x0,-0x1)[_0xe9f0('0x10')]('\x20'):_0x335b82[_0xe9f0('0xc')];}return _0xe9f0('0x11');}function getLastName(_0x216601){var _0x55a388=_[_0xe9f0('0x7')](_0x216601['value']);if(_0x55a388&&_0x55a388[_0xe9f0('0xc')]){var _0x23914b=_0x55a388[_0xe9f0('0xc')]['split'](/\s+/);return _0x23914b[_0xe9f0('0xf')]>0x1?_0x23914b[_0xe9f0('0x12')]():'';}return'';}function getMails(_0x2e68ef,_0x598eee){var _0xaa7aa6='';for(var _0x1e16e0=0x0;_0x1e16e0<_0x598eee[_0xe9f0('0xb')][_0xe9f0('0xf')];_0x1e16e0+=0x1){if(_0x598eee[_0xe9f0('0xb')][_0x1e16e0][_0xe9f0('0x8')]!==_0x2e68ef){if(!_[_0xe9f0('0x13')](_0xaa7aa6)){_0xaa7aa6+=',';}_0xaa7aa6+=_0x598eee['value'][_0x1e16e0][_0xe9f0('0xc')]||_0x598eee[_0xe9f0('0xb')][_0x1e16e0][_0xe9f0('0x8')]||'';_0xaa7aa6+='\x20<';_0xaa7aa6+=_0x598eee['value'][_0x1e16e0][_0xe9f0('0x8')]?_0x598eee[_0xe9f0('0xb')][_0x1e16e0][_0xe9f0('0x8')]:_0xe9f0('0x9')+random['generate'](0x6)+_0xe9f0('0x14');_0xaa7aa6+='>';}}return _0xaa7aa6;}function parseEmail(_0xfaa312,_0x583687,_0x51e03f){if(_0x583687['html']){var _0x12fe9f=/)<[^<]*)*<\/script>/gi;while(_0x12fe9f[_0xe9f0('0x15')](_0x583687[_0xe9f0('0x16')])){_0x583687[_0xe9f0('0x16')]=_0x583687[_0xe9f0('0x16')]['replace'](_0x12fe9f,'');}if(_0x583687[_0xe9f0('0x16')][_0xe9f0('0x17')](_0xe9f0('0x18'))){var _0x10801b=[];_0x583687[_0xe9f0('0x19')][_0xe9f0('0x1a')](_0x37c0fc=>{_0x10801b[_0xe9f0('0x1b')](_0x37c0fc[_0xe9f0('0x1c')]);});var _0x3fce54=/]+>/g;var _0x48128a=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x371095=_0x583687[_0xe9f0('0x16')][_0xe9f0('0x1d')](_0x48128a,_0xe9f0('0x1e'));var _0x4cf1b1=_0x371095[_0xe9f0('0x1d')](_0x3fce54,_0xe9f0('0x1f'));for(let _0x856ac8=0x0;_0x856ac8<_0x10801b[_0xe9f0('0xf')];_0x856ac8++){var _0x4335c6=_0x4cf1b1['replace'](_0xe9f0('0x1f'),_0xe9f0('0x20')+_0x10801b[_0x856ac8]+_0xe9f0('0x21'));_0x4cf1b1=_0x4335c6;}_0x583687[_0xe9f0('0x16')]=_0x4cf1b1;}_0x51e03f[_0xe9f0('0x22')]=_0x583687[_0xe9f0('0x16')];}else{_0x51e03f[_0xe9f0('0x22')]=_0x583687[_0xe9f0('0x23')];}if(_0x51e03f[_0xe9f0('0x22')]){_0x51e03f[_0xe9f0('0x22')]=_0x51e03f[_0xe9f0('0x22')][_0xe9f0('0x1d')](/0x0){var _0x3d4eb7=[_0xe9f0('0x2f'),_0xe9f0('0x30'),'Precedence:\x20auto_reply'];for(var _0x1e2016=0x0;_0x1e2016<_0x583687[_0xe9f0('0x2e')][_0xe9f0('0xf')];_0x1e2016++){var _0x571366=_['indexOf'](_0x3d4eb7,_0x583687[_0xe9f0('0x2e')][_0x1e2016]['line']);if(_0x571366>=0x0){_0x51e03f[_0xe9f0('0x31')]=!![];}}}return _0x51e03f;}exports[_0xe9f0('0x32')]=function(_0x314f0e,_0x42d9d2,_0x4f1663){var _0x123739={'from':getAddress(_0x42d9d2[_0xe9f0('0x33')]),'firstName':getFirstName(_0x42d9d2[_0xe9f0('0x33')]),'lastName':getLastName(_0x42d9d2[_0xe9f0('0x33')]),'mapKey':_0xe9f0('0x5'),'message':{'from':getMails(_0x314f0e['email'],_0x42d9d2[_0xe9f0('0x33')]),'to':_0x314f0e[_0xe9f0('0x5')],'cc':'','subject':_0x42d9d2[_0xe9f0('0x34')]||'','messageId':_0x42d9d2[_0xe9f0('0x35')],'inReplyTo':_0x42d9d2[_0xe9f0('0x36')],'sentAt':moment(_0x42d9d2['date'])[_0xe9f0('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x42d9d2['html']&&!_0x42d9d2[_0xe9f0('0x23')]){var _0x17b832=_['filter'](_0x42d9d2[_0xe9f0('0x19')],{'contentType':_0xe9f0('0x37')});if(_0x17b832[_0xe9f0('0xf')]){logger[_0xe9f0('0x38')](util[_0xe9f0('0x2a')](_0xe9f0('0x39'),_0x42d9d2[_0xe9f0('0x35')]));tnef['parseBuffer'](_[_0xe9f0('0x3a')](_0x17b832)['content'],function(_0x3b8712,_0x5a3488){if(_0x5a3488){_0x42d9d2[_0xe9f0('0x16')]=_0x5a3488['BodyHTML']||_0xe9f0('0x3b');if(_0x5a3488[_0xe9f0('0x3c')]){for(var _0x422324=0x0;_0x422324<_0x5a3488['Attachments'][_0xe9f0('0xf')];_0x422324++){var _0xcf426d=_0x5a3488[_0xe9f0('0x3c')][_0x422324];_0x123739[_0xe9f0('0x25')][_0xe9f0('0x19')][_0xe9f0('0x1b')]({'filename':_0xcf426d[_0xe9f0('0x3d')],'content':Buffer[_0xe9f0('0x33')](_0xcf426d[_0xe9f0('0x3e')])});}}}_0x4f1663(parseEmail(_0x314f0e,_0x42d9d2,_0x123739));});}else{_0x42d9d2[_0xe9f0('0x16')]=_0xe9f0('0x3b');_0x4f1663(parseEmail(_0x314f0e,_0x42d9d2,_0x123739));}}else{_0x4f1663(parseEmail(_0x314f0e,_0x42d9d2,_0x123739));}};exports[_0xe9f0('0x3f')]=function(_0x57beee){switch(_0x57beee){case'gmail':return _0xe9f0('0x40');case _0xe9f0('0x41'):return _0xe9f0('0x42');case'hotmail':return _0xe9f0('0x43');case'outlook365':return _0xe9f0('0x44');}return _0xe9f0('0x45');}; \ No newline at end of file +var _0xf9ac=['replace','includes','attachments','forEach','push','filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','127.0.0.1','lodash','path','util','../../../config/logger','../../../config/environment','head','value','address','generate','@xcally.com','name','substring','indexOf','length','slice','Anonymous','split','pop','isEmpty','html','test'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf9ac,0x87));var _0xcf9a=function(_0x557895,_0x595f7c){_0x557895=_0x557895-0x0;var _0x323973=_0xf9ac[_0x557895];return _0x323973;};'use strict';var _=require(_0xcf9a('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0xcf9a('0x1'));var util=require(_0xcf9a('0x2'));var tnef=require('node-tnef');var logger=require(_0xcf9a('0x3'))('email');var config=require(_0xcf9a('0x4'));function getAddress(_0x518dc3){var _0x48da91=_[_0xcf9a('0x5')](_0x518dc3[_0xcf9a('0x6')]);return _0x48da91&&_0x48da91[_0xcf9a('0x7')]?_0x48da91[_0xcf9a('0x7')]:'anonymous'+random[_0xcf9a('0x8')](0x6)+_0xcf9a('0x9');}function getFirstName(_0x4c0665){var _0x536f2f=_[_0xcf9a('0x5')](_0x4c0665['value']);if(_0x536f2f&&_0x536f2f[_0xcf9a('0xa')]){if(_0x536f2f['name']==_0x536f2f[_0xcf9a('0x7')]){return _0x536f2f['name'][_0xcf9a('0xb')](0x0,_0x536f2f[_0xcf9a('0xa')][_0xcf9a('0xc')]('@'));}var _0x53c5ae=_0x536f2f['name']['split'](/\s+/);return _0x53c5ae[_0xcf9a('0xd')]>0x1?_0x53c5ae[_0xcf9a('0xe')](0x0,-0x1)['join']('\x20'):_0x536f2f[_0xcf9a('0xa')];}return _0xcf9a('0xf');}function getLastName(_0xe8fe56){var _0x583cdf=_[_0xcf9a('0x5')](_0xe8fe56['value']);if(_0x583cdf&&_0x583cdf['name']){var _0x58cdd2=_0x583cdf['name'][_0xcf9a('0x10')](/\s+/);return _0x58cdd2[_0xcf9a('0xd')]>0x1?_0x58cdd2[_0xcf9a('0x11')]():'';}return'';}function getMails(_0xaadfd7,_0x16b7d){var _0xced14a='';for(var _0x25dc10=0x0;_0x25dc10<_0x16b7d['value'][_0xcf9a('0xd')];_0x25dc10+=0x1){if(_0x16b7d[_0xcf9a('0x6')][_0x25dc10]['address']!==_0xaadfd7){if(!_[_0xcf9a('0x12')](_0xced14a)){_0xced14a+=',';}_0xced14a+=_0x16b7d['value'][_0x25dc10][_0xcf9a('0xa')]||_0x16b7d['value'][_0x25dc10][_0xcf9a('0x7')]||'';_0xced14a+='\x20<';_0xced14a+=_0x16b7d[_0xcf9a('0x6')][_0x25dc10][_0xcf9a('0x7')]?_0x16b7d[_0xcf9a('0x6')][_0x25dc10][_0xcf9a('0x7')]:'anonymous'+random['generate'](0x6)+_0xcf9a('0x9');_0xced14a+='>';}}return _0xced14a;}function parseEmail(_0x5f3ac0,_0x46d8b0,_0x2e308a){if(_0x46d8b0[_0xcf9a('0x13')]){var _0x5e8019=/)<[^<]*)*<\/script>/gi;while(_0x5e8019[_0xcf9a('0x14')](_0x46d8b0[_0xcf9a('0x13')])){_0x46d8b0[_0xcf9a('0x13')]=_0x46d8b0['html'][_0xcf9a('0x15')](_0x5e8019,'');}if(_0x46d8b0[_0xcf9a('0x13')][_0xcf9a('0x16')]('{_0x4f43b9[_0xcf9a('0x19')](_0x11f372[_0xcf9a('0x1a')]);});var _0x3d2135=/]+>/g;var _0x4f9b8c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2c46c5=_0x46d8b0['html']['replace'](_0x4f9b8c,_0xcf9a('0x1b'));var _0x798016=_0x2c46c5[_0xcf9a('0x15')](_0x3d2135,_0xcf9a('0x1c'));for(let _0x3497f4=0x0;_0x3497f4<_0x4f43b9[_0xcf9a('0xd')];_0x3497f4++){var _0x17386b=_0x798016['replace']('_IMG',_0xcf9a('0x1d')+_0x4f43b9[_0x3497f4]+_0xcf9a('0x1e'));_0x798016=_0x17386b;}_0x46d8b0['html']=_0x798016;}_0x2e308a['body']=_0x46d8b0['html'];}else{_0x2e308a[_0xcf9a('0x1f')]=_0x46d8b0[_0xcf9a('0x20')];}if(_0x2e308a[_0xcf9a('0x1f')]){_0x2e308a['body']=_0x2e308a[_0xcf9a('0x1f')][_0xcf9a('0x15')](/0x0){var _0x2da846=[_0xcf9a('0x32'),_0xcf9a('0x33'),_0xcf9a('0x34')];for(var _0x27273a=0x0;_0x27273a<_0x46d8b0[_0xcf9a('0x31')][_0xcf9a('0xd')];_0x27273a++){var _0x3a6a6d=_['indexOf'](_0x2da846,_0x46d8b0['headerLines'][_0x27273a][_0xcf9a('0x35')]);if(_0x3a6a6d>=0x0){_0x2e308a['isAutoreply']=!![];}}}return _0x2e308a;}exports[_0xcf9a('0x36')]=function(_0x325d85,_0x46233c,_0x4ad76b){var _0x424476={'from':getAddress(_0x46233c[_0xcf9a('0x37')]),'firstName':getFirstName(_0x46233c[_0xcf9a('0x37')]),'lastName':getLastName(_0x46233c[_0xcf9a('0x37')]),'mapKey':'email','message':{'from':getMails(_0x325d85[_0xcf9a('0x23')],_0x46233c[_0xcf9a('0x37')]),'to':_0x325d85[_0xcf9a('0x23')],'cc':'','subject':_0x46233c[_0xcf9a('0x38')]||'','messageId':_0x46233c['messageId'],'inReplyTo':_0x46233c[_0xcf9a('0x39')],'sentAt':moment(_0x46233c[_0xcf9a('0x3a')])[_0xcf9a('0x29')](_0xcf9a('0x3b')),'attach':![],'attachments':[]}};if(!_0x46233c[_0xcf9a('0x13')]&&!_0x46233c[_0xcf9a('0x20')]){var _0x48b3af=_['filter'](_0x46233c[_0xcf9a('0x17')],{'contentType':_0xcf9a('0x3c')});if(_0x48b3af[_0xcf9a('0xd')]){logger[_0xcf9a('0x3d')](util[_0xcf9a('0x29')](_0xcf9a('0x3e'),_0x46233c[_0xcf9a('0x3f')]));tnef[_0xcf9a('0x40')](_[_0xcf9a('0x41')](_0x48b3af)[_0xcf9a('0x2f')],function(_0xacf25,_0x435973){if(_0x435973){_0x46233c[_0xcf9a('0x13')]=_0x435973[_0xcf9a('0x42')]||_0xcf9a('0x43');if(_0x435973['Attachments']){for(var _0x15a195=0x0;_0x15a195<_0x435973[_0xcf9a('0x44')][_0xcf9a('0xd')];_0x15a195++){var _0x2b02bf=_0x435973[_0xcf9a('0x44')][_0x15a195];_0x424476[_0xcf9a('0x24')][_0xcf9a('0x17')][_0xcf9a('0x19')]({'filename':_0x2b02bf[_0xcf9a('0x45')],'content':Buffer[_0xcf9a('0x37')](_0x2b02bf['Data'])});}}}_0x4ad76b(parseEmail(_0x325d85,_0x46233c,_0x424476));});}else{_0x46233c[_0xcf9a('0x13')]=_0xcf9a('0x43');_0x4ad76b(parseEmail(_0x325d85,_0x46233c,_0x424476));}}else{_0x4ad76b(parseEmail(_0x325d85,_0x46233c,_0x424476));}};exports[_0xcf9a('0x46')]=function(_0x5058d8){switch(_0x5058d8){case _0xcf9a('0x47'):return _0xcf9a('0x48');case _0xcf9a('0x49'):return _0xcf9a('0x4a');case _0xcf9a('0x4b'):return _0xcf9a('0x4c');case'outlook365':return'outlook.office365.com';}return _0xcf9a('0x4d');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index c592c57..fdfb251 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 _0xcaf7=['Smtp','lodash','name','Service','key','SERV','active','Imap'];(function(_0x133387,_0x1cda82){var _0x54b6b7=function(_0x4b971d){while(--_0x4b971d){_0x133387['push'](_0x133387['shift']());}};_0x54b6b7(++_0x1cda82);}(_0xcaf7,0x139));var _0x7caf=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xcaf7[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x7caf('0x0'));function MailAccount(_0x4a64ab){this['id']=_0x4a64ab['id']||0x0;this[_0x7caf('0x1')]=_0x4a64ab[_0x7caf('0x1')]||_0x7caf('0x2');this[_0x7caf('0x3')]=_0x4a64ab[_0x7caf('0x3')]||_0x7caf('0x4');this[_0x7caf('0x5')]=_0x4a64ab['active']||![];this['Imap']=_0x4a64ab[_0x7caf('0x6')]||[];this[_0x7caf('0x7')]=_0x4a64ab['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xf82a=['name','Service','key','active','Imap','Smtp','exports','lodash'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xf82a,0x137));var _0xaf82=function(_0x20933e,_0x5574fb){_0x20933e=_0x20933e-0x0;var _0x317aaa=_0xf82a[_0x20933e];return _0x317aaa;};'use strict';var _=require(_0xaf82('0x0'));function MailAccount(_0x18282d){this['id']=_0x18282d['id']||0x0;this[_0xaf82('0x1')]=_0x18282d['name']||_0xaf82('0x2');this[_0xaf82('0x3')]=_0x18282d[_0xaf82('0x3')]||'SERV';this['active']=_0x18282d[_0xaf82('0x4')]||![];this[_0xaf82('0x5')]=_0x18282d['Imap']||[];this[_0xaf82('0x6')]=_0x18282d[_0xaf82('0x6')]||[];}module[_0xaf82('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 ecf2bb8..89cb035 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 _0x12a6=['isUndefined','merge','mailAccounts','mapKeys','hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12a6,0xca));var _0x612a=function(_0x772156,_0x5b5faa){_0x772156=_0x772156-0x0;var _0x79234b=_0x12a6[_0x772156];return _0x79234b;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x612a('0x0')]={};};function freeIsNotKey(_0x1a96e0,_0x42ee92,_0x14249e){var _0x2a58e5=_[_0x612a('0x1')](_0x1a96e0,function(_0x19f5f8,_0x7ec9b6){return _0x19f5f8[_0x14249e];});for(var _0x39db50 in _0x42ee92){if(_0x42ee92[_0x612a('0x2')](_0x39db50)){if(!_0x2a58e5[_0x39db50]){delete _0x42ee92[_0x39db50];}}}}Realtime['prototype'][_0x612a('0x3')]=function(_0x202eb6,_0x35debb){for(var _0x215618 in _0x35debb){if(_0x202eb6[_0x612a('0x2')](_0x215618)){_0x202eb6[_0x215618]=_0x35debb[_0x215618];}}};Realtime[_0x612a('0x4')][_0x612a('0x5')]=function(){var _0x489744=this;return function(_0x2581bb){if(_0x2581bb){freeIsNotKey(_0x2581bb,_0x489744['mailAccounts'],'id');for(var _0x3e0430=0x0,_0x2d424f={},_0x442f6e={};_0x3e0430<_0x2581bb['length'];_0x3e0430+=0x1){_0x2d424f=_0x2581bb[_0x3e0430];if(_[_0x612a('0x6')](_0x489744[_0x612a('0x0')][_0x2d424f['id']])){_0x489744[_0x612a('0x0')][_0x2d424f['id']]=new MailAccount(_0x2d424f);}else{_[_0x612a('0x7')](_0x489744[_0x612a('0x0')][_0x2d424f['id']],_0x2d424f);}}}return _0x489744[_0x612a('0x0')];};};module['exports']=Realtime; \ No newline at end of file +var _0x78dc=['mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','lodash'];(function(_0x190010,_0x348926){var _0x269c11=function(_0x674770){while(--_0x674770){_0x190010['push'](_0x190010['shift']());}};_0x269c11(++_0x348926);}(_0x78dc,0x1d8));var _0xc78d=function(_0x285824,_0x3da647){_0x285824=_0x285824-0x0;var _0x311d7e=_0x78dc[_0x285824];return _0x311d7e;};'use strict';var _=require(_0xc78d('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xc78d('0x1')]={};};function freeIsNotKey(_0x5d07ce,_0x40590c,_0x5bc2b0){var _0x155a63=_[_0xc78d('0x2')](_0x5d07ce,function(_0xe0cc31,_0x2a04fa){return _0xe0cc31[_0x5bc2b0];});for(var _0x34edfa in _0x40590c){if(_0x40590c[_0xc78d('0x3')](_0x34edfa)){if(!_0x155a63[_0x34edfa]){delete _0x40590c[_0x34edfa];}}}}Realtime[_0xc78d('0x4')][_0xc78d('0x5')]=function(_0x26ee89,_0xbf3c02){for(var _0x4fa5f7 in _0xbf3c02){if(_0x26ee89[_0xc78d('0x3')](_0x4fa5f7)){_0x26ee89[_0x4fa5f7]=_0xbf3c02[_0x4fa5f7];}}};Realtime[_0xc78d('0x4')][_0xc78d('0x6')]=function(){var _0x3b2802=this;return function(_0x185d40){if(_0x185d40){freeIsNotKey(_0x185d40,_0x3b2802[_0xc78d('0x1')],'id');for(var _0x3fd70e=0x0,_0x402544={},_0x23b376={};_0x3fd70e<_0x185d40[_0xc78d('0x7')];_0x3fd70e+=0x1){_0x402544=_0x185d40[_0x3fd70e];if(_[_0xc78d('0x8')](_0x3b2802[_0xc78d('0x1')][_0x402544['id']])){_0x3b2802[_0xc78d('0x1')][_0x402544['id']]=new MailAccount(_0x402544);}else{_[_0xc78d('0x9')](_0x3b2802[_0xc78d('0x1')][_0x402544['id']],_0x402544);}}}return _0x3b2802[_0xc78d('0x1')];};};module[_0xc78d('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 28dfcfd..33ecd74 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 _0xf1d4=['active','key','MailServerIn','Imap','Smtp','getMailAccount','notify','NotifyMailAccount','../client','Request','name','service'];(function(_0x568cf0,_0x1a44cb){var _0x360f81=function(_0x414953){while(--_0x414953){_0x568cf0['push'](_0x568cf0['shift']());}};_0x360f81(++_0x1a44cb);}(_0xf1d4,0x158));var _0x4f1d=function(_0x1a3cc1,_0x588f9e){_0x1a3cc1=_0x1a3cc1-0x0;var _0x1a7934=_0xf1d4[_0x1a3cc1];return _0x1a7934;};'use strict';var client=require(_0x4f1d('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x4f1d('0x1')]('GetMailAccount',{'options':{'attributes':['id',_0x4f1d('0x2'),_0x4f1d('0x3'),'email',_0x4f1d('0x4'),_0x4f1d('0x5'),'ListId','TemplateId'],'raw':![],'include':[{'model':_0x4f1d('0x6'),'as':_0x4f1d('0x7')},{'model':'MailServerOut','as':_0x4f1d('0x8')}]},'log':_0x4f1d('0x9')});};};exports[_0x4f1d('0xa')]=function(_0x19bbcb,_0x13766a){return client[_0x4f1d('0x1')](_0x4f1d('0xb'),{'account':{'id':_0x19bbcb},'body':_0x13766a,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x4a03=['notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','service','email','active','ListId','TemplateId','Imap','MailServerOut','getMailAccount'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0x4a03,0x16e));var _0x34a0=function(_0x648d93,_0x5f49c7){_0x648d93=_0x648d93-0x0;var _0x43c1c7=_0x4a03[_0x648d93];return _0x43c1c7;};'use strict';var client=require('../client');exports[_0x34a0('0x0')]=function(){return function(){return client[_0x34a0('0x1')](_0x34a0('0x2'),{'options':{'attributes':['id','name',_0x34a0('0x3'),_0x34a0('0x4'),_0x34a0('0x5'),'key',_0x34a0('0x6'),_0x34a0('0x7')],'raw':![],'include':[{'model':'MailServerIn','as':_0x34a0('0x8')},{'model':_0x34a0('0x9'),'as':'Smtp'}]},'log':_0x34a0('0xa')});};};exports[_0x34a0('0xb')]=function(_0x592827,_0xb182cc){return client[_0x34a0('0x1')](_0x34a0('0xc'),{'account':{'id':_0x592827},'body':_0xb182cc,'log':_0x34a0('0xc')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index dbd55c4..c23cde9 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 _0x076d=['getSettings','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x574365,_0x268cfe){var _0x1d9d1a=function(_0x1ce936){while(--_0x1ce936){_0x574365['push'](_0x574365['shift']());}};_0x1d9d1a(++_0x268cfe);}(_0x076d,0x19c));var _0xd076=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x076d[_0x278e3c];return _0x3e2d9b;};'use strict';var client=require('../client');exports[_0xd076('0x0')]=function(){return client['Request'](_0xd076('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd076('0x2')]},'log':_0xd076('0x3')});}; \ No newline at end of file +var _0x7dea=['GetSettings','../client','getSettings','Request'];(function(_0x4469f2,_0x707b40){var _0x38babd=function(_0x4f2722){while(--_0x4f2722){_0x4469f2['push'](_0x4469f2['shift']());}};_0x38babd(++_0x707b40);}(_0x7dea,0x151));var _0xa7de=function(_0x500325,_0x39861f){_0x500325=_0x500325-0x0;var _0x38ee65=_0x7dea[_0x500325];return _0x38ee65;};'use strict';var client=require(_0xa7de('0x0'));exports[_0xa7de('0x1')]=function(){return client[_0xa7de('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xa7de('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 3b4261a..7e9105e 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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 d6d72f9..8854657 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 _0x589c=['redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/express','once','listening','log','port','exports','lodash','http','ioredis','createServer','listen','websocket','polling','defaults'];(function(_0x12f81b,_0x3dd66d){var _0x4a3559=function(_0x2e5817){while(--_0x2e5817){_0x12f81b['push'](_0x12f81b['shift']());}};_0x4a3559(++_0x3dd66d);}(_0x589c,0x1d8));var _0xc589=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x589c[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xc589('0x0'));var http=require(_0xc589('0x1'));var express=require('express');var sticky=require('sticky-session');var Redis=require(_0xc589('0x2'));var config=require('../../config/environment');var app=express();var server=http[_0xc589('0x3')](app);server['timeout']=0xdbba0;if(sticky[_0xc589('0x4')](server,config['port'])){var socketio=require('socket.io')(server,{'transports':[_0xc589('0x5'),_0xc589('0x6')]});config['redis']=_[_0xc589('0x7')](config[_0xc589('0x8')],{'host':_0xc589('0x9'),'port':0x18eb});socketio[_0xc589('0xa')](require(_0xc589('0xb'))({'pubClient':new Redis(config[_0xc589('0x8')]),'subClient':new Redis(config['redis'])}));require(_0xc589('0xc'))[_0xc589('0xd')]();require('../../config/socketio')['default'](socketio);require(_0xc589('0xe'))[_0xc589('0xd')](app);require('../../routes')[_0xc589('0xd')](app);}else{server[_0xc589('0xf')](_0xc589('0x10'),function(){console[_0xc589('0x11')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xc589('0x12')]);});}exports=module[_0xc589('0x13')]=app; \ No newline at end of file +var _0x094c=['port','socket.io','polling','redis','defaults','localhost','adapter','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','sticky-session','../../config/environment','createServer','timeout','listen'];(function(_0x40d078,_0x210a77){var _0x46fc81=function(_0x3673da){while(--_0x3673da){_0x40d078['push'](_0x40d078['shift']());}};_0x46fc81(++_0x210a77);}(_0x094c,0xdf));var _0xc094=function(_0x58f555,_0x552ef2){_0x58f555=_0x58f555-0x0;var _0x4eb99b=_0x094c[_0x58f555];return _0x4eb99b;};'use strict';var _=require(_0xc094('0x0'));var http=require(_0xc094('0x1'));var express=require('express');var sticky=require(_0xc094('0x2'));var Redis=require('ioredis');var config=require(_0xc094('0x3'));var app=express();var server=http[_0xc094('0x4')](app);server[_0xc094('0x5')]=0xdbba0;if(sticky[_0xc094('0x6')](server,config[_0xc094('0x7')])){var socketio=require(_0xc094('0x8'))(server,{'transports':['websocket',_0xc094('0x9')]});config[_0xc094('0xa')]=_[_0xc094('0xb')](config['redis'],{'host':_0xc094('0xc'),'port':0x18eb});socketio[_0xc094('0xd')](require('socket.io-redis')({'pubClient':new Redis(config[_0xc094('0xa')]),'subClient':new Redis(config[_0xc094('0xa')])}));require(_0xc094('0xe'))[_0xc094('0xf')]();require(_0xc094('0x10'))['default'](socketio);require(_0xc094('0x11'))['default'](app);require(_0xc094('0x12'))[_0xc094('0xf')](app);}else{server['once'](_0xc094('0x13'),function(){console[_0xc094('0x14')](_0xc094('0x15'),config['port']);});}exports=module[_0xc094('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index dc512d7..982da8a 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 _0x8cb0=['rpc','message','result','catch','exports','bluebird','../../config/logger','routing','client','debug','error'];(function(_0x3419f9,_0x1bbad6){var _0xf27862=function(_0x201ed1){while(--_0x201ed1){_0x3419f9['push'](_0x3419f9['shift']());}};_0xf27862(++_0x1bbad6);}(_0x8cb0,0x19c));var _0x08cb=function(_0x19b14d,_0x4fc470){_0x19b14d=_0x19b14d-0x0;var _0x26637a=_0x8cb0[_0x19b14d];return _0x26637a;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x08cb('0x0'));var logger=require(_0x08cb('0x1'))(_0x08cb('0x2'));var client=jayson[_0x08cb('0x3')]['http']({'port':0x2329});client['Request']=function(_0x504db9,_0xecd9f6){return new BPromise(function(_0x201a3b,_0x496766){return client['request'](_0x504db9,_0xecd9f6)['then'](function(_0x2eaffd){logger[_0x08cb('0x4')]('rpc',_0x08cb('0x2'),_0x504db9,_0xecd9f6,_0x2eaffd);if(_0x2eaffd[_0x08cb('0x5')]){logger[_0x08cb('0x5')](_0x08cb('0x6'),_0x08cb('0x2'),_0x504db9,_0x2eaffd[_0x08cb('0x5')][_0x08cb('0x7')],_0xecd9f6);return _0x496766(_0x2eaffd[_0x08cb('0x5')][_0x08cb('0x7')]);}else{return _0x201a3b(_0x2eaffd[_0x08cb('0x8')]);}})[_0x08cb('0x9')](function(_0x5be857){logger[_0x08cb('0x5')](_0x08cb('0x6'),_0x08cb('0x2'),_0x504db9,_0x5be857,_0xecd9f6);return _0x496766(_0x5be857);});});};module[_0x08cb('0xa')]=client; \ No newline at end of file +var _0x9845=['rpc','error','message','result','catch','exports','bluebird','../../config/logger','routing','http','request','then','debug'];(function(_0x3766e3,_0x18056c){var _0x1eccfd=function(_0x2729a3){while(--_0x2729a3){_0x3766e3['push'](_0x3766e3['shift']());}};_0x1eccfd(++_0x18056c);}(_0x9845,0x17f));var _0x5984=function(_0x1ce575,_0xbcf48f){_0x1ce575=_0x1ce575-0x0;var _0x20118a=_0x9845[_0x1ce575];return _0x20118a;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x5984('0x0'));var logger=require(_0x5984('0x1'))(_0x5984('0x2'));var client=jayson['client'][_0x5984('0x3')]({'port':0x2329});client['Request']=function(_0x3203c7,_0x4a505c){return new BPromise(function(_0x125b7c,_0x266e46){return client[_0x5984('0x4')](_0x3203c7,_0x4a505c)[_0x5984('0x5')](function(_0x239343){logger[_0x5984('0x6')](_0x5984('0x7'),_0x5984('0x2'),_0x3203c7,_0x4a505c,_0x239343);if(_0x239343[_0x5984('0x8')]){logger[_0x5984('0x8')](_0x5984('0x7'),_0x5984('0x2'),_0x3203c7,_0x239343[_0x5984('0x8')][_0x5984('0x9')],_0x4a505c);return _0x266e46(_0x239343['error'][_0x5984('0x9')]);}else{return _0x125b7c(_0x239343[_0x5984('0xa')]);}})[_0x5984('0xb')](function(_0x28a7fb){logger[_0x5984('0x8')](_0x5984('0x7'),_0x5984('0x2'),_0x3203c7,_0x28a7fb,_0x4a505c);return _0x266e46(_0x28a7fb);});});};module[_0x5984('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index a680303..df42be9 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 _0x8937=['getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initWhatsappQueues','catch','log','bluebird','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues'];(function(_0x488e31,_0x3857c3){var _0x4f825f=function(_0x1c75fa){while(--_0x1c75fa){_0x488e31['push'](_0x488e31['shift']());}};_0x4f825f(++_0x3857c3);}(_0x8937,0x140));var _0x7893=function(_0x247a26,_0x32d4e9){_0x247a26=_0x247a26-0x0;var _0x17ad3b=_0x8937[_0x247a26];return _0x17ad3b;};'use strict';var BPromise=require(_0x7893('0x0'));var server=require('./server');var Realtime=require('./realtime');var user=require(_0x7893('0x1'));var interval=require(_0x7893('0x2'));var openchannelQueue=require(_0x7893('0x3'));var chatQueue=require(_0x7893('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x7893('0x5'));var faxQueue=require(_0x7893('0x6'));var whatsappQueue=require(_0x7893('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x7893('0x8')]()['then'](user[_0x7893('0x9')]())[_0x7893('0xa')](realtime[_0x7893('0xb')]())['then'](interval[_0x7893('0xc')]())[_0x7893('0xa')](realtime[_0x7893('0xd')]())['then'](openchannelQueue[_0x7893('0xe')]())[_0x7893('0xa')](realtime[_0x7893('0xf')]())[_0x7893('0xa')](chatQueue[_0x7893('0x10')]())[_0x7893('0xa')](realtime[_0x7893('0x11')]())[_0x7893('0xa')](smsQueue[_0x7893('0x12')]())[_0x7893('0xa')](realtime[_0x7893('0x13')]())[_0x7893('0xa')](mailQueue[_0x7893('0x14')]())[_0x7893('0xa')](realtime[_0x7893('0x15')]())['then'](faxQueue[_0x7893('0x16')]())['then'](realtime['initFaxQueues']())[_0x7893('0xa')](whatsappQueue['getWhatsappQueues']())[_0x7893('0xa')](realtime[_0x7893('0x17')]())[_0x7893('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x7893('0xa')](function(_0x500ec8){return initRealtime();})['then'](function(_0x39804a){return setInterval(initRealtime,0x1388);})[_0x7893('0x18')](function(_0x5d6f00){console[_0x7893('0x19')](_0x5d6f00);});}main(); \ No newline at end of file +var _0x9988=['listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues'];(function(_0x460d7f,_0x2b4399){var _0x4b2475=function(_0x39f37f){while(--_0x39f37f){_0x460d7f['push'](_0x460d7f['shift']());}};_0x4b2475(++_0x2b4399);}(_0x9988,0x8a));var _0x8998=function(_0x11859d,_0x1c9f0e){_0x11859d=_0x11859d-0x0;var _0x6c172e=_0x9988[_0x11859d];return _0x6c172e;};'use strict';var BPromise=require(_0x8998('0x0'));var server=require(_0x8998('0x1'));var Realtime=require(_0x8998('0x2'));var user=require(_0x8998('0x3'));var interval=require(_0x8998('0x4'));var openchannelQueue=require(_0x8998('0x5'));var chatQueue=require(_0x8998('0x6'));var smsQueue=require(_0x8998('0x7'));var mailQueue=require(_0x8998('0x8'));var faxQueue=require(_0x8998('0x9'));var whatsappQueue=require(_0x8998('0xa'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x8998('0xb')]()[_0x8998('0xc')](user['getAgents']())['then'](realtime[_0x8998('0xd')]())['then'](interval['getIntervals']())['then'](realtime[_0x8998('0xe')]())[_0x8998('0xc')](openchannelQueue[_0x8998('0xf')]())['then'](realtime['initOpenchannelQueues']())[_0x8998('0xc')](chatQueue[_0x8998('0x10')]())['then'](realtime[_0x8998('0x11')]())['then'](smsQueue['getSmsQueues']())[_0x8998('0xc')](realtime[_0x8998('0x12')]())[_0x8998('0xc')](mailQueue['getMailQueues']())[_0x8998('0xc')](realtime[_0x8998('0x13')]())['then'](faxQueue[_0x8998('0x14')]())[_0x8998('0xc')](realtime[_0x8998('0x15')]())[_0x8998('0xc')](whatsappQueue[_0x8998('0x16')]())[_0x8998('0xc')](realtime[_0x8998('0x17')]())[_0x8998('0xc')](function(){return realtime;});}function main(){return server[_0x8998('0x18')](realtime)['then'](function(_0x53cd38){return initRealtime();})[_0x8998('0xc')](function(_0x18eb56){return setInterval(initRealtime,0x1388);})[_0x8998('0x19')](function(_0xac34a7){console[_0x8998('0x1a')](_0xac34a7);});}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 60f6496..f8fbf71 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(_0x1f992c,_0x165083){var _0x35d9b9=function(_0x43443f){while(--_0x43443f){_0x1f992c['push'](_0x1f992c['shift']());}};_0x35d9b9(++_0x165083);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xc4aa[_0x11005e];return _0x29338f;};'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 _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0xbcaced,_0xfe13ad){var _0x3edf80=function(_0x6b8d20){while(--_0x6b8d20){_0xbcaced['push'](_0xbcaced['shift']());}};_0x3edf80(++_0xfe13ad);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0x5fc3[_0x2b8077];return _0x308091;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};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 caa3c1b..67e76b7 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 _0x3ad4=['message','result','sendMailMessage','SendMail','jayson/promise','client','then','error'];(function(_0x352962,_0x1a16ab){var _0x52561d=function(_0x44668a){while(--_0x44668a){_0x352962['push'](_0x352962['shift']());}};_0x52561d(++_0x1a16ab);}(_0x3ad4,0xdc));var _0x43ad=function(_0x175f79,_0x7fed9){_0x175f79=_0x175f79-0x0;var _0x5005da=_0x3ad4[_0x175f79];return _0x5005da;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x43ad('0x0'));var client=jayson[_0x43ad('0x1')]['http']({'port':0x232b});function request(_0x399cc3,_0x483b32){return new BPromise(function(_0x2b6ea4,_0x2850a5){return client['request'](_0x399cc3,_0x483b32)[_0x43ad('0x2')](function(_0x168272){if(_0x168272[_0x43ad('0x3')]){return _0x2850a5(_0x168272[_0x43ad('0x3')][_0x43ad('0x4')]);}else{return _0x2b6ea4(_0x168272[_0x43ad('0x5')]);}})['catch'](function(_0x968599){return _0x2850a5(_0x968599);});});}exports[_0x43ad('0x6')]=function(_0x511915,_0xd54e9d){return request(_0x43ad('0x7'),{'account':_0x511915,'message':_0xd54e9d});}; \ No newline at end of file +var _0xa984=['request','then','error','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0xbd4746,_0x9ca2c8){var _0x2afcef=function(_0x5c6a0b){while(--_0x5c6a0b){_0xbd4746['push'](_0xbd4746['shift']());}};_0x2afcef(++_0x9ca2c8);}(_0xa984,0x103));var _0x4a98=function(_0xebc72a,_0x5a55c5){_0xebc72a=_0xebc72a-0x0;var _0x441d7d=_0xa984[_0xebc72a];return _0x441d7d;};'use strict';var BPromise=require(_0x4a98('0x0'));var jayson=require(_0x4a98('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0xb9c724,_0x2cad26){return new BPromise(function(_0x111082,_0x596f3c){return client[_0x4a98('0x2')](_0xb9c724,_0x2cad26)[_0x4a98('0x3')](function(_0x28abec){if(_0x28abec[_0x4a98('0x4')]){return _0x596f3c(_0x28abec['error']['message']);}else{return _0x111082(_0x28abec[_0x4a98('0x5')]);}})[_0x4a98('0x6')](function(_0x2d85e4){return _0x596f3c(_0x2d85e4);});});}exports[_0x4a98('0x7')]=function(_0x2f3588,_0x2c726d){return request(_0x4a98('0x8'),{'account':_0x2f3588,'message':_0x2c726d});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 8941342..e1d45df 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 _0x0a48=['busyQueue','updateRealtime','prototype','Capacity','CurrentCapacity','maxcapacity','working','idle','mail','chat','openchannel','whatsapp','getChannelStatus','Status','StatusTime','toNumber','format','mailPause','chatStatus','chatStatusTime','chatCurrentCapacity','faxStatusTime','openchannelCurrentCapacity','stringify','md5','user:save','exports','lodash','moment','ioredis','../../../config/environment','redis','defaults','name','online','voicePause','chatPause','faxPause','smsPause','openchannelPause','unknown','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy'];(function(_0x55e15b,_0x282c76){var _0x179751=function(_0x42e0fb){while(--_0x42e0fb){_0x55e15b['push'](_0x55e15b['shift']());}};_0x179751(++_0x282c76);}(_0x0a48,0x95));var _0x80a4=function(_0x36ef37,_0x2008b3){_0x36ef37=_0x36ef37-0x0;var _0x2a9a38=_0x0a48[_0x36ef37];return _0x2a9a38;};'use strict';var _=require(_0x80a4('0x0'));var moment=require(_0x80a4('0x1'));var md5=require('md5');var Redis=require(_0x80a4('0x2'));var config=require(_0x80a4('0x3'));config[_0x80a4('0x4')]=_[_0x80a4('0x5')](config[_0x80a4('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x80a4('0x4')]));function Agent(_0xf487dc){this['id']=_0xf487dc['id']||0x0;this[_0x80a4('0x6')]=_0xf487dc[_0x80a4('0x6')]||'';this['online']=_0xf487dc[_0x80a4('0x7')]||!![];this['voicePause']=_0xf487dc[_0x80a4('0x8')]||![];this[_0x80a4('0x9')]=_0xf487dc[_0x80a4('0x9')]||![];this['mailPause']=_0xf487dc['mailPause']||![];this[_0x80a4('0xa')]=_0xf487dc[_0x80a4('0xa')]||![];this[_0x80a4('0xb')]=_0xf487dc[_0x80a4('0xb')]||![];this['openchannelPause']=_0xf487dc[_0x80a4('0xc')]||![];this['chatStatus']=_0x80a4('0xd');this['chatStatusTime']=0x0;this[_0x80a4('0xe')]=_0xf487dc[_0x80a4('0xe')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x80a4('0xf')]=_0x80a4('0xd');this[_0x80a4('0x10')]=0x0;this[_0x80a4('0x11')]=_0xf487dc[_0x80a4('0x11')]||0x0;this[_0x80a4('0x12')]=0x0;this[_0x80a4('0x13')]='unknown';this['faxStatusTime']=0x0;this[_0x80a4('0x14')]=_0xf487dc[_0x80a4('0x14')]||0x0;this[_0x80a4('0x15')]=0x0;this[_0x80a4('0x16')]='unknown';this[_0x80a4('0x17')]=0x0;this[_0x80a4('0x18')]=_0xf487dc[_0x80a4('0x18')]||0x0;this[_0x80a4('0x19')]=0x0;this[_0x80a4('0x1a')]=_0x80a4('0xd');this[_0x80a4('0x1b')]=0x0;this[_0x80a4('0x1c')]=_0xf487dc[_0x80a4('0x1c')]||0x0;this[_0x80a4('0x1d')]=0x0;this[_0x80a4('0x1e')]=_0x80a4('0xd');this[_0x80a4('0x1f')]=0x0;this[_0x80a4('0x20')]=_0xf487dc[_0x80a4('0x20')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x80a4('0x21')]=![];this[_0x80a4('0x22')]=undefined;this['md5']='';this[_0x80a4('0x23')]();}Agent[_0x80a4('0x24')]['getChannelStatus']=function(_0x3e5b08){if(this[_0x3e5b08+'CurrentCapacity']>0x0){if(this[_0x3e5b08+_0x80a4('0x25')]>0x0&&this[_0x3e5b08+_0x80a4('0x26')]>=this[_0x3e5b08+_0x80a4('0x25')]){return _0x80a4('0x27');}else{return _0x80a4('0x28');}}else{return _0x80a4('0x29');}};Agent[_0x80a4('0x24')][_0x80a4('0x23')]=function(){var _0x478d57=[_0x80a4('0x2a'),_0x80a4('0x2b'),_0x80a4('0x2c'),'fax','sms',_0x80a4('0x2d')];for(var _0x2d1752=0x0;_0x2d1752<_0x478d57['length'];_0x2d1752+=0x1){var _0x31865b=this[_0x80a4('0x2e')](_0x478d57[_0x2d1752]);if(this[_0x478d57[_0x2d1752]+_0x80a4('0x2f')]!==_0x31865b){this[_0x478d57[_0x2d1752]+_0x80a4('0x30')]=_[_0x80a4('0x31')](moment()[_0x80a4('0x32')]('x'));}this[_0x478d57[_0x2d1752]+_0x80a4('0x2f')]=_0x31865b;}var _0x57822c={'id':this['id'],'name':this[_0x80a4('0x6')],'online':this[_0x80a4('0x7')],'voicePause':this[_0x80a4('0x8')],'chatPause':this[_0x80a4('0x9')],'mailPause':this[_0x80a4('0x33')],'smsPause':this[_0x80a4('0xb')],'faxPause':this[_0x80a4('0xa')],'openchannelPause':this[_0x80a4('0xc')],'chatStatus':this[_0x80a4('0x34')],'chatStatusTime':this[_0x80a4('0x35')],'chatCapacity':this[_0x80a4('0xe')],'chatCurrentCapacity':this[_0x80a4('0x36')],'mailStatus':this[_0x80a4('0xf')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x80a4('0x13')],'faxStatusTime':this[_0x80a4('0x37')],'faxCapacity':this[_0x80a4('0x14')],'faxCurrentCapacity':this[_0x80a4('0x15')],'smsStatus':this[_0x80a4('0x16')],'smsStatusTime':this[_0x80a4('0x17')],'smsCapacity':this[_0x80a4('0x18')],'smsCurrentCapacity':this[_0x80a4('0x19')],'whatsappStatus':this[_0x80a4('0x1a')],'whatsappStatusTime':this[_0x80a4('0x1b')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x80a4('0x1d')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x80a4('0x1f')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x80a4('0x38')],'busy':this[_0x80a4('0x21')],'busyQueue':this[_0x80a4('0x22')]};var _0x155358=md5(JSON[_0x80a4('0x39')](_0x57822c));if(this[_0x80a4('0x3a')]!==_0x155358){this[_0x80a4('0x3a')]=_0x155358;io['emit'](_0x80a4('0x3b'),_0x57822c);}};module[_0x80a4('0x3c')]=Agent; \ No newline at end of file +var _0x3bc0=['../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCurrentCapacity','busy','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','sms','whatsapp','Status','StatusTime','toNumber','format','openchannelStatusTime','openchannelCapacity','stringify','emit','exports','lodash','moment','md5','ioredis'];(function(_0x2e68f3,_0x13dc10){var _0x977ca0=function(_0x372c6d){while(--_0x372c6d){_0x2e68f3['push'](_0x2e68f3['shift']());}};_0x977ca0(++_0x13dc10);}(_0x3bc0,0xec));var _0x03bc=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x3bc0[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x03bc('0x0'));var moment=require(_0x03bc('0x1'));var md5=require(_0x03bc('0x2'));var Redis=require(_0x03bc('0x3'));var config=require(_0x03bc('0x4'));config[_0x03bc('0x5')]=_[_0x03bc('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x03bc('0x7'))(new Redis(config[_0x03bc('0x5')]));function Agent(_0x1466ba){this['id']=_0x1466ba['id']||0x0;this[_0x03bc('0x8')]=_0x1466ba[_0x03bc('0x8')]||'';this[_0x03bc('0x9')]=_0x1466ba[_0x03bc('0x9')]||!![];this[_0x03bc('0xa')]=_0x1466ba['voicePause']||![];this[_0x03bc('0xb')]=_0x1466ba[_0x03bc('0xb')]||![];this[_0x03bc('0xc')]=_0x1466ba[_0x03bc('0xc')]||![];this[_0x03bc('0xd')]=_0x1466ba[_0x03bc('0xd')]||![];this[_0x03bc('0xe')]=_0x1466ba[_0x03bc('0xe')]||![];this['openchannelPause']=_0x1466ba[_0x03bc('0xf')]||![];this[_0x03bc('0x10')]=_0x03bc('0x11');this[_0x03bc('0x12')]=0x0;this[_0x03bc('0x13')]=_0x1466ba['chatCapacity']||0x0;this[_0x03bc('0x14')]=0x0;this[_0x03bc('0x15')]=_0x03bc('0x11');this['mailStatusTime']=0x0;this[_0x03bc('0x16')]=_0x1466ba[_0x03bc('0x16')]||0x0;this[_0x03bc('0x17')]=0x0;this['faxStatus']='unknown';this[_0x03bc('0x18')]=0x0;this[_0x03bc('0x19')]=_0x1466ba[_0x03bc('0x19')]||0x0;this[_0x03bc('0x1a')]=0x0;this[_0x03bc('0x1b')]='unknown';this[_0x03bc('0x1c')]=0x0;this['smsCapacity']=_0x1466ba[_0x03bc('0x1d')]||0x0;this[_0x03bc('0x1e')]=0x0;this[_0x03bc('0x1f')]='unknown';this[_0x03bc('0x20')]=0x0;this[_0x03bc('0x21')]=_0x1466ba[_0x03bc('0x21')]||0x0;this[_0x03bc('0x22')]=0x0;this[_0x03bc('0x23')]='unknown';this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x1466ba['openchannelCapacity']||0x0;this[_0x03bc('0x24')]=0x0;this[_0x03bc('0x25')]=![];this['busyQueue']=undefined;this[_0x03bc('0x2')]='';this[_0x03bc('0x26')]();}Agent[_0x03bc('0x27')][_0x03bc('0x28')]=function(_0x47b93f){if(this[_0x47b93f+_0x03bc('0x29')]>0x0){if(this[_0x47b93f+_0x03bc('0x2a')]>0x0&&this[_0x47b93f+'CurrentCapacity']>=this[_0x47b93f+_0x03bc('0x2a')]){return _0x03bc('0x2b');}else{return _0x03bc('0x2c');}}else{return _0x03bc('0x2d');}};Agent[_0x03bc('0x27')]['updateRealtime']=function(){var _0x4463ec=[_0x03bc('0x2e'),_0x03bc('0x2f'),_0x03bc('0x30'),'fax',_0x03bc('0x31'),_0x03bc('0x32')];for(var _0x2e4040=0x0;_0x2e4040<_0x4463ec['length'];_0x2e4040+=0x1){var _0x27ab21=this[_0x03bc('0x28')](_0x4463ec[_0x2e4040]);if(this[_0x4463ec[_0x2e4040]+_0x03bc('0x33')]!==_0x27ab21){this[_0x4463ec[_0x2e4040]+_0x03bc('0x34')]=_[_0x03bc('0x35')](moment()[_0x03bc('0x36')]('x'));}this[_0x4463ec[_0x2e4040]+_0x03bc('0x33')]=_0x27ab21;}var _0x6923e4={'id':this['id'],'name':this[_0x03bc('0x8')],'online':this[_0x03bc('0x9')],'voicePause':this[_0x03bc('0xa')],'chatPause':this[_0x03bc('0xb')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0x03bc('0xd')],'openchannelPause':this[_0x03bc('0xf')],'chatStatus':this[_0x03bc('0x10')],'chatStatusTime':this[_0x03bc('0x12')],'chatCapacity':this[_0x03bc('0x13')],'chatCurrentCapacity':this[_0x03bc('0x14')],'mailStatus':this[_0x03bc('0x15')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x03bc('0x17')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x03bc('0x18')],'faxCapacity':this[_0x03bc('0x19')],'faxCurrentCapacity':this[_0x03bc('0x1a')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x03bc('0x1c')],'smsCapacity':this[_0x03bc('0x1d')],'smsCurrentCapacity':this[_0x03bc('0x1e')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x03bc('0x20')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x03bc('0x22')],'openchannelStatus':this[_0x03bc('0x23')],'openchannelStatusTime':this[_0x03bc('0x37')],'openchannelCapacity':this[_0x03bc('0x38')],'openchannelCurrentCapacity':this[_0x03bc('0x24')],'busy':this[_0x03bc('0x25')],'busyQueue':this['busyQueue']};var _0x5f1554=md5(JSON[_0x03bc('0x39')](_0x6923e4));if(this[_0x03bc('0x2')]!==_0x5f1554){this[_0x03bc('0x2')]=_0x5f1554;io[_0x03bc('0x3a')]('user:save',_0x6923e4);}};module[_0x03bc('0x3b')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 167f612..74ce3e2 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 _0x07d8=['paused','available','format','chat:queue:%s','chat_queue:save','exports','lodash','util','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','_rr','map','length','online','loggedIn'];(function(_0x2daf1f,_0x806caf){var _0x252ed3=function(_0x43ad1a){while(--_0x43ad1a){_0x2daf1f['push'](_0x2daf1f['shift']());}};_0x252ed3(++_0x806caf);}(_0x07d8,0xc3));var _0x807d=function(_0x33c7f0,_0x5c9f1c){_0x33c7f0=_0x33c7f0-0x0;var _0x491bef=_0x07d8[_0x33c7f0];return _0x491bef;};'use strict';var _=require(_0x807d('0x0'));var md5=require('md5');var util=require(_0x807d('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x807d('0x2')]=_[_0x807d('0x3')](config[_0x807d('0x2')],{'host':_0x807d('0x4'),'port':0x18eb});var io=require(_0x807d('0x5'))(new Redis(config[_0x807d('0x2')]));function ChatQueue(_0x56462d){this['id']=_0x56462d['id']||0x0;this[_0x807d('0x6')]=_0x56462d['name']||'';this['timeout']=_0x56462d[_0x807d('0x7')]||0xa;this['strategy']=_0x56462d[_0x807d('0x8')]||_0x807d('0x9');this[_0x807d('0xa')]=_0x56462d[_0x807d('0xa')];this[_0x807d('0xb')]={};this[_0x807d('0xc')]=0x0;this[_0x807d('0xd')]='';this['updateRouting']();this[_0x807d('0xe')]();}ChatQueue[_0x807d('0xf')]['updateRouting']=function(){var _0x118ecf=this[_0x807d('0xb')][_0x807d('0x10')];this['mapAgentsId']=_[_0x807d('0x11')](this[_0x807d('0xa')],'id');this['mapAgentsId'][_0x807d('0x10')]=_0x118ecf;};ChatQueue[_0x807d('0xf')][_0x807d('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x25f883=0x0;_0x25f883=0x0?this['available']:0x0;var _0x1c9a11={'id':this['id'],'available':this[_0x807d('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x807d('0x6')],'paused':this['paused'],'waiting':this[_0x807d('0xc')]};var _0x26656b=md5(JSON['stringify'](_0x1c9a11));if(this[_0x807d('0xd')]!==_0x26656b){this[_0x807d('0xd')]=_0x26656b;io['to'](util[_0x807d('0x17')](_0x807d('0x18'),_0x1c9a11['name']))['emit'](_0x807d('0x19'),_0x1c9a11);}};module[_0x807d('0x1a')]=ChatQueue; \ No newline at end of file +var _0x90d0=['emit','chat_queue:save','lodash','md5','util','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','updateRealtime','length','online','loggedIn','chatPause','paused','available','stringify','format','chat:queue:%s'];(function(_0x4dba6d,_0x1e7655){var _0xf54502=function(_0x2920fc){while(--_0x2920fc){_0x4dba6d['push'](_0x4dba6d['shift']());}};_0xf54502(++_0x1e7655);}(_0x90d0,0x110));var _0x090d=function(_0x1eb786,_0x1b5f72){_0x1eb786=_0x1eb786-0x0;var _0x460cad=_0x90d0[_0x1eb786];return _0x460cad;};'use strict';var _=require(_0x090d('0x0'));var md5=require(_0x090d('0x1'));var util=require(_0x090d('0x2'));var Redis=require(_0x090d('0x3'));var config=require('../../../config/environment');config[_0x090d('0x4')]=_[_0x090d('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x090d('0x6'))(new Redis(config[_0x090d('0x4')]));function ChatQueue(_0x310f6a){this['id']=_0x310f6a['id']||0x0;this[_0x090d('0x7')]=_0x310f6a[_0x090d('0x7')]||'';this['timeout']=_0x310f6a[_0x090d('0x8')]||0xa;this['strategy']=_0x310f6a[_0x090d('0x9')]||_0x090d('0xa');this['Agents']=_0x310f6a[_0x090d('0xb')];this[_0x090d('0xc')]={};this[_0x090d('0xd')]=0x0;this['md5']='';this[_0x090d('0xe')]();this['updateRealtime']();}ChatQueue['prototype'][_0x090d('0xe')]=function(){var _0x4ab03f=this[_0x090d('0xc')][_0x090d('0xf')];this[_0x090d('0xc')]=_[_0x090d('0x10')](this[_0x090d('0xb')],'id');this[_0x090d('0xc')][_0x090d('0xf')]=_0x4ab03f;};ChatQueue[_0x090d('0x11')][_0x090d('0x12')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x2710f1=0x0;_0x2710f1=0x0?this[_0x090d('0x18')]:0x0;var _0x267343={'id':this['id'],'available':this[_0x090d('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x090d('0x7')],'paused':this[_0x090d('0x17')],'waiting':this['waiting']};var _0x24b449=md5(JSON[_0x090d('0x19')](_0x267343));if(this[_0x090d('0x1')]!==_0x24b449){this[_0x090d('0x1')]=_0x24b449;io['to'](util[_0x090d('0x1a')](_0x090d('0x1b'),_0x267343['name']))[_0x090d('0x1c')](_0x090d('0x1d'),_0x267343);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 2dcaaa4..a8751f0 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 _0xef03=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','length','online','faxPause','paused','available','stringify','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x274a03,_0xa661ae){var _0x53b6dc=function(_0x29a5df){while(--_0x29a5df){_0x274a03['push'](_0x274a03['shift']());}};_0x53b6dc(++_0xa661ae);}(_0xef03,0xe4));var _0x3ef0=function(_0x14743d,_0x2ea170){_0x14743d=_0x14743d-0x0;var _0x34b2bc=_0xef03[_0x14743d];return _0x34b2bc;};'use strict';var _=require(_0x3ef0('0x0'));var md5=require(_0x3ef0('0x1'));var util=require(_0x3ef0('0x2'));var Redis=require(_0x3ef0('0x3'));var config=require(_0x3ef0('0x4'));config[_0x3ef0('0x5')]=_['defaults'](config[_0x3ef0('0x5')],{'host':_0x3ef0('0x6'),'port':0x18eb});var io=require(_0x3ef0('0x7'))(new Redis(config[_0x3ef0('0x5')]));function FaxQueue(_0xc7c85){this['id']=_0xc7c85['id']||0x0;this[_0x3ef0('0x8')]=_0xc7c85['name']||'';this[_0x3ef0('0x9')]=_0xc7c85[_0x3ef0('0x9')]||0xa;this[_0x3ef0('0xa')]=_0xc7c85[_0x3ef0('0xa')]||_0x3ef0('0xb');this[_0x3ef0('0xc')]=_0xc7c85['Agents'];this[_0x3ef0('0xd')]={};this[_0x3ef0('0xe')]=0x0;this[_0x3ef0('0x1')]='';this[_0x3ef0('0xf')]();this[_0x3ef0('0x10')]();}FaxQueue['prototype']['updateRouting']=function(){var _0x1497ae=this[_0x3ef0('0xd')][_0x3ef0('0x11')];this['mapAgentsId']=_['map'](this[_0x3ef0('0xc')],'id');this[_0x3ef0('0xd')][_0x3ef0('0x11')]=_0x1497ae;};FaxQueue[_0x3ef0('0x12')][_0x3ef0('0x10')]=function(){this[_0x3ef0('0x13')]=0x0;this['paused']=0x0;for(var _0x184037=0x0;_0x184037=0x0?this[_0x3ef0('0x18')]:0x0;var _0x36b468={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3ef0('0x13')],'name':this['name'],'paused':this[_0x3ef0('0x17')],'waiting':this[_0x3ef0('0xe')]};var _0x5b5ef8=md5(JSON[_0x3ef0('0x19')](_0x36b468));if(this[_0x3ef0('0x1')]!==_0x5b5ef8){this['md5']=_0x5b5ef8;io['to'](util['format'](_0x3ef0('0x1a'),_0x36b468['name']))[_0x3ef0('0x1b')](_0x3ef0('0x1c'),_0x36b468);}};module[_0x3ef0('0x1d')]=FaxQueue; \ No newline at end of file +var _0x9195=['ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','faxPause','available','format','fax:queue:%s','emit','fax_queue:save','exports','md5'];(function(_0xd51e1f,_0x2a93af){var _0x17f520=function(_0x502085){while(--_0x502085){_0xd51e1f['push'](_0xd51e1f['shift']());}};_0x17f520(++_0x2a93af);}(_0x9195,0xdf));var _0x5919=function(_0xd9ee0f,_0x301d80){_0xd9ee0f=_0xd9ee0f-0x0;var _0x2c7db5=_0x9195[_0xd9ee0f];return _0x2c7db5;};'use strict';var _=require('lodash');var md5=require(_0x5919('0x0'));var util=require('util');var Redis=require(_0x5919('0x1'));var config=require(_0x5919('0x2'));config[_0x5919('0x3')]=_[_0x5919('0x4')](config[_0x5919('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x5919('0x5'))(new Redis(config[_0x5919('0x3')]));function FaxQueue(_0x131d6a){this['id']=_0x131d6a['id']||0x0;this[_0x5919('0x6')]=_0x131d6a['name']||'';this['timeout']=_0x131d6a['timeout']||0xa;this[_0x5919('0x7')]=_0x131d6a[_0x5919('0x7')]||_0x5919('0x8');this[_0x5919('0x9')]=_0x131d6a['Agents'];this[_0x5919('0xa')]={};this[_0x5919('0xb')]=0x0;this['md5']='';this[_0x5919('0xc')]();this[_0x5919('0xd')]();}FaxQueue[_0x5919('0xe')]['updateRouting']=function(){var _0x1a62b6=this['mapAgentsId'][_0x5919('0xf')];this[_0x5919('0xa')]=_[_0x5919('0x10')](this[_0x5919('0x9')],'id');this['mapAgentsId']['_rr']=_0x1a62b6;};FaxQueue[_0x5919('0xe')]['updateRealtime']=function(){this[_0x5919('0x11')]=0x0;this[_0x5919('0x12')]=0x0;for(var _0x5104bd=0x0;_0x5104bd=0x0?this['available']:0x0;var _0x2c2b20={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5919('0x11')],'name':this[_0x5919('0x6')],'paused':this[_0x5919('0x12')],'waiting':this[_0x5919('0xb')]};var _0x1cc35a=md5(JSON['stringify'](_0x2c2b20));if(this[_0x5919('0x0')]!==_0x1cc35a){this['md5']=_0x1cc35a;io['to'](util[_0x5919('0x17')](_0x5919('0x18'),_0x2c2b20[_0x5919('0x6')]))[_0x5919('0x19')](_0x5919('0x1a'),_0x2c2b20);}};module[_0x5919('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 7d686a6..a104351 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 _0x11c9=['name','Intervals','exports'];(function(_0x33c1be,_0x162144){var _0x1803c5=function(_0x1ee948){while(--_0x1ee948){_0x33c1be['push'](_0x33c1be['shift']());}};_0x1803c5(++_0x162144);}(_0x11c9,0x1cb));var _0x911c=function(_0x10d34b,_0x4fef76){_0x10d34b=_0x10d34b-0x0;var _0x92b0bf=_0x11c9[_0x10d34b];return _0x92b0bf;};'use strict';function Interval(_0x559f5b){this['id']=_0x559f5b['id']||0x0;this[_0x911c('0x0')]=_0x559f5b[_0x911c('0x0')]||'';this[_0x911c('0x1')]=_0x559f5b['Intervals']||{};}module[_0x911c('0x2')]=Interval; \ No newline at end of file +var _0x57ad=['name','Intervals'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57ad,0x1c8));var _0xd57a=function(_0x51fb74,_0x5b169b){_0x51fb74=_0x51fb74-0x0;var _0x1d62dd=_0x57ad[_0x51fb74];return _0x1d62dd;};'use strict';function Interval(_0x566beb){this['id']=_0x566beb['id']||0x0;this[_0xd57a('0x0')]=_0x566beb[_0xd57a('0x0')]||'';this[_0xd57a('0x1')]=_0x566beb[_0xd57a('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index cfbc5e6..044cbc6 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 _0x5856=['online','mailPause','available','mail:queue:%s','emit','mail_queue:save','lodash','util','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length'];(function(_0x2c4c15,_0x49245d){var _0x4499d7=function(_0x1ed911){while(--_0x1ed911){_0x2c4c15['push'](_0x2c4c15['shift']());}};_0x4499d7(++_0x49245d);}(_0x5856,0x8d));var _0x6585=function(_0x60df74,_0x458e29){_0x60df74=_0x60df74-0x0;var _0x5ee872=_0x5856[_0x60df74];return _0x5ee872;};'use strict';var _=require(_0x6585('0x0'));var md5=require('md5');var util=require(_0x6585('0x1'));var Redis=require('ioredis');var config=require(_0x6585('0x2'));config[_0x6585('0x3')]=_[_0x6585('0x4')](config[_0x6585('0x3')],{'host':_0x6585('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x525b34){this['id']=_0x525b34['id']||0x0;this[_0x6585('0x6')]=_0x525b34[_0x6585('0x6')]||'';this['timeout']=_0x525b34[_0x6585('0x7')]||0xa;this['strategy']=_0x525b34[_0x6585('0x8')]||'beepall';this[_0x6585('0x9')]=_0x525b34[_0x6585('0x9')];this[_0x6585('0xa')]={};this[_0x6585('0xb')]=0x0;this[_0x6585('0xc')]='';this[_0x6585('0xd')]();this[_0x6585('0xe')]();}MailQueue[_0x6585('0xf')]['updateRouting']=function(){var _0x201eaf=this['mapAgentsId'][_0x6585('0x10')];this['mapAgentsId']=_[_0x6585('0x11')](this[_0x6585('0x9')],'id');this[_0x6585('0xa')][_0x6585('0x10')]=_0x201eaf;};MailQueue[_0x6585('0xf')]['updateRealtime']=function(){this[_0x6585('0x12')]=0x0;this[_0x6585('0x13')]=0x0;for(var _0x4bbf66=0x0;_0x4bbf66=0x0?this[_0x6585('0x17')]:0x0;var _0xb3258={'id':this['id'],'available':this[_0x6585('0x17')],'loggedIn':this[_0x6585('0x12')],'name':this['name'],'paused':this[_0x6585('0x13')],'waiting':this[_0x6585('0xb')]};var _0xf5c51=md5(JSON['stringify'](_0xb3258));if(this[_0x6585('0xc')]!==_0xf5c51){this['md5']=_0xf5c51;io['to'](util['format'](_0x6585('0x18'),_0xb3258[_0x6585('0x6')]))[_0x6585('0x19')](_0x6585('0x1a'),_0xb3258);}};module['exports']=MailQueue; \ No newline at end of file +var _0x799e=['updateRouting','prototype','_rr','map','updateRealtime','length','loggedIn','mailPause','paused','available','waiting','format','mail:queue:%s','emit','mail_queue:save','exports','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x799e,0x1d2));var _0xe799=function(_0x22aa2c,_0x326958){_0x22aa2c=_0x22aa2c-0x0;var _0x23a008=_0x799e[_0x22aa2c];return _0x23a008;};'use strict';var _=require('lodash');var md5=require(_0xe799('0x0'));var util=require(_0xe799('0x1'));var Redis=require(_0xe799('0x2'));var config=require(_0xe799('0x3'));config['redis']=_[_0xe799('0x4')](config['redis'],{'host':_0xe799('0x5'),'port':0x18eb});var io=require(_0xe799('0x6'))(new Redis(config[_0xe799('0x7')]));function MailQueue(_0x44ecc3){this['id']=_0x44ecc3['id']||0x0;this[_0xe799('0x8')]=_0x44ecc3[_0xe799('0x8')]||'';this[_0xe799('0x9')]=_0x44ecc3['timeout']||0xa;this[_0xe799('0xa')]=_0x44ecc3[_0xe799('0xa')]||_0xe799('0xb');this[_0xe799('0xc')]=_0x44ecc3[_0xe799('0xc')];this[_0xe799('0xd')]={};this['waiting']=0x0;this['md5']='';this[_0xe799('0xe')]();this['updateRealtime']();}MailQueue[_0xe799('0xf')][_0xe799('0xe')]=function(){var _0x1bbb81=this['mapAgentsId'][_0xe799('0x10')];this[_0xe799('0xd')]=_[_0xe799('0x11')](this[_0xe799('0xc')],'id');this[_0xe799('0xd')][_0xe799('0x10')]=_0x1bbb81;};MailQueue[_0xe799('0xf')][_0xe799('0x12')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x1de2d4=0x0;_0x1de2d4=0x0?this[_0xe799('0x17')]:0x0;var _0x54ad26={'id':this['id'],'available':this[_0xe799('0x17')],'loggedIn':this[_0xe799('0x14')],'name':this[_0xe799('0x8')],'paused':this[_0xe799('0x16')],'waiting':this[_0xe799('0x18')]};var _0x1fba5a=md5(JSON['stringify'](_0x54ad26));if(this[_0xe799('0x0')]!==_0x1fba5a){this['md5']=_0x1fba5a;io['to'](util[_0xe799('0x19')](_0xe799('0x1a'),_0x54ad26[_0xe799('0x8')]))[_0xe799('0x1b')](_0xe799('0x1c'),_0x54ad26);}};module[_0xe799('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 76c56d1..8d21592 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(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0x2ef3,0xba));var _0x32ef=function(_0x3f91df,_0x5c2739){_0x3f91df=_0x3f91df-0x0;var _0x444469=_0x2ef3[_0x3f91df];return _0x444469;};'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 _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x521757,_0x20ac6a){var _0x3fe84e=function(_0x176a12){while(--_0x176a12){_0x521757['push'](_0x521757['shift']());}};_0x3fe84e(++_0x20ac6a);}(_0x814b,0x1a2));var _0xb814=function(_0x2002b3,_0x11e91c){_0x2002b3=_0x2002b3-0x0;var _0x2756f0=_0x814b[_0x2002b3];return _0x2756f0;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index e18d9b6..38f62c2 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 _0x49e9=['exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x49e9,0x10f));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x949e('0x0'));var md5=require(_0x949e('0x1'));var util=require('util');var Redis=require(_0x949e('0x2'));var config=require(_0x949e('0x3'));config[_0x949e('0x4')]=_['defaults'](config['redis'],{'host':_0x949e('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x949e('0x4')]));function SmsQueue(_0xb1aae0){this['id']=_0xb1aae0['id']||0x0;this[_0x949e('0x6')]=_0xb1aae0['name']||'';this[_0x949e('0x7')]=_0xb1aae0[_0x949e('0x7')]||0xa;this[_0x949e('0x8')]=_0xb1aae0[_0x949e('0x8')]||_0x949e('0x9');this[_0x949e('0xa')]=_0xb1aae0[_0x949e('0xa')];this['mapAgentsId']={};this[_0x949e('0xb')]=0x0;this['md5']='';this[_0x949e('0xc')]();this[_0x949e('0xd')]();}SmsQueue[_0x949e('0xe')]['updateRouting']=function(){var _0x2e401f=this[_0x949e('0xf')][_0x949e('0x10')];this[_0x949e('0xf')]=_[_0x949e('0x11')](this[_0x949e('0xa')],'id');this[_0x949e('0xf')][_0x949e('0x10')]=_0x2e401f;};SmsQueue[_0x949e('0xe')][_0x949e('0xd')]=function(){this[_0x949e('0x12')]=0x0;this[_0x949e('0x13')]=0x0;for(var _0x3e0e54=0x0;_0x3e0e54=0x0?this[_0x949e('0x17')]:0x0;var _0x868913={'id':this['id'],'available':this[_0x949e('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x949e('0x6')],'paused':this[_0x949e('0x13')],'waiting':this[_0x949e('0xb')]};var _0x2f0f57=md5(JSON[_0x949e('0x18')](_0x868913));if(this[_0x949e('0x1')]!==_0x2f0f57){this[_0x949e('0x1')]=_0x2f0f57;io['to'](util[_0x949e('0x19')](_0x949e('0x1a'),_0x868913[_0x949e('0x6')]))[_0x949e('0x1b')](_0x949e('0x1c'),_0x868913);}};module[_0x949e('0x1d')]=SmsQueue; \ No newline at end of file +var _0x402f=['mapAgentsId','waiting','md5','updateRouting','updateRealtime','paused','length','online','loggedIn','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','util','redis','defaults','socket.io-emitter','name','timeout','beepall','Agents'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x402f,0x6f));var _0xf402=function(_0x512db2,_0x59629b){_0x512db2=_0x512db2-0x0;var _0x65247c=_0x402f[_0x512db2];return _0x65247c;};'use strict';var _=require(_0xf402('0x0'));var md5=require('md5');var util=require(_0xf402('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xf402('0x2')]=_[_0xf402('0x3')](config[_0xf402('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xf402('0x4'))(new Redis(config['redis']));function SmsQueue(_0x20c2cc){this['id']=_0x20c2cc['id']||0x0;this[_0xf402('0x5')]=_0x20c2cc[_0xf402('0x5')]||'';this[_0xf402('0x6')]=_0x20c2cc[_0xf402('0x6')]||0xa;this['strategy']=_0x20c2cc['strategy']||_0xf402('0x7');this[_0xf402('0x8')]=_0x20c2cc[_0xf402('0x8')];this[_0xf402('0x9')]={};this[_0xf402('0xa')]=0x0;this[_0xf402('0xb')]='';this[_0xf402('0xc')]();this[_0xf402('0xd')]();}SmsQueue['prototype'][_0xf402('0xc')]=function(){var _0x496916=this['mapAgentsId']['_rr'];this['mapAgentsId']=_['map'](this[_0xf402('0x8')],'id');this['mapAgentsId']['_rr']=_0x496916;};SmsQueue['prototype'][_0xf402('0xd')]=function(){this['loggedIn']=0x0;this[_0xf402('0xe')]=0x0;for(var _0xb3deb6=0x0;_0xb3deb6=0x0?this[_0xf402('0x12')]:0x0;var _0x5d7236={'id':this['id'],'available':this[_0xf402('0x12')],'loggedIn':this[_0xf402('0x11')],'name':this[_0xf402('0x5')],'paused':this[_0xf402('0xe')],'waiting':this['waiting']};var _0x14fdcc=md5(JSON[_0xf402('0x13')](_0x5d7236));if(this[_0xf402('0xb')]!==_0x14fdcc){this[_0xf402('0xb')]=_0x14fdcc;io['to'](util[_0xf402('0x14')](_0xf402('0x15'),_0x5d7236[_0xf402('0x5')]))[_0xf402('0x16')](_0xf402('0x17'),_0x5d7236);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 8b34b02..553b665 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 _0x3b44=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','paused','length','online','loggedIn','available','stringify','format','whatsapp:queue:%s','emit','lodash','md5','util','ioredis','redis','localhost','name','timeout','strategy'];(function(_0x131e02,_0x327e1a){var _0x29c2bc=function(_0x2c21cc){while(--_0x2c21cc){_0x131e02['push'](_0x131e02['shift']());}};_0x29c2bc(++_0x327e1a);}(_0x3b44,0x12f));var _0x43b4=function(_0x46a5ce,_0xa8652e){_0x46a5ce=_0x46a5ce-0x0;var _0x27361e=_0x3b44[_0x46a5ce];return _0x27361e;};'use strict';var _=require(_0x43b4('0x0'));var md5=require(_0x43b4('0x1'));var util=require(_0x43b4('0x2'));var Redis=require(_0x43b4('0x3'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0x43b4('0x4')],{'host':_0x43b4('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x43b4('0x4')]));function WhatsappQueue(_0x2f25db){this['id']=_0x2f25db['id']||0x0;this['name']=_0x2f25db[_0x43b4('0x6')]||'';this[_0x43b4('0x7')]=_0x2f25db[_0x43b4('0x7')]||0xa;this[_0x43b4('0x8')]=_0x2f25db[_0x43b4('0x8')]||_0x43b4('0x9');this[_0x43b4('0xa')]=_0x2f25db[_0x43b4('0xa')];this[_0x43b4('0xb')]={};this[_0x43b4('0xc')]=0x0;this[_0x43b4('0x1')]='';this[_0x43b4('0xd')]();this[_0x43b4('0xe')]();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x484b56=this[_0x43b4('0xb')][_0x43b4('0xf')];this[_0x43b4('0xb')]=_['map'](this['Agents'],'id');this[_0x43b4('0xb')]['_rr']=_0x484b56;};WhatsappQueue[_0x43b4('0x10')][_0x43b4('0xe')]=function(){this['loggedIn']=0x0;this[_0x43b4('0x11')]=0x0;for(var _0x59584d=0x0;_0x59584d=0x0?this[_0x43b4('0x15')]:0x0;var _0x2ca86a={'id':this['id'],'available':this['available'],'loggedIn':this[_0x43b4('0x14')],'name':this[_0x43b4('0x6')],'paused':this[_0x43b4('0x11')],'waiting':this[_0x43b4('0xc')]};var _0x42fb12=md5(JSON[_0x43b4('0x16')](_0x2ca86a));if(this[_0x43b4('0x1')]!==_0x42fb12){this[_0x43b4('0x1')]=_0x42fb12;io['to'](util[_0x43b4('0x17')](_0x43b4('0x18'),_0x2ca86a['name']))[_0x43b4('0x19')]('whatsapp_queue:save',_0x2ca86a);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x1a40=['redis','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused','online','whatsappPause','available','stringify','format','emit','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x59dba3,_0x4af9fd){var _0x32ec4f=function(_0x292ba7){while(--_0x292ba7){_0x59dba3['push'](_0x59dba3['shift']());}};_0x32ec4f(++_0x4af9fd);}(_0x1a40,0xc3));var _0x01a4=function(_0x10c87b,_0x4696da){_0x10c87b=_0x10c87b-0x0;var _0x42b7f3=_0x1a40[_0x10c87b];return _0x42b7f3;};'use strict';var _=require(_0x01a4('0x0'));var md5=require(_0x01a4('0x1'));var util=require(_0x01a4('0x2'));var Redis=require(_0x01a4('0x3'));var config=require(_0x01a4('0x4'));config[_0x01a4('0x5')]=_['defaults'](config[_0x01a4('0x5')],{'host':_0x01a4('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x01a4('0x5')]));function WhatsappQueue(_0x7e3f6){this['id']=_0x7e3f6['id']||0x0;this[_0x01a4('0x7')]=_0x7e3f6[_0x01a4('0x7')]||'';this[_0x01a4('0x8')]=_0x7e3f6[_0x01a4('0x8')]||0xa;this[_0x01a4('0x9')]=_0x7e3f6['strategy']||'beepall';this[_0x01a4('0xa')]=_0x7e3f6[_0x01a4('0xa')];this[_0x01a4('0xb')]={};this[_0x01a4('0xc')]=0x0;this[_0x01a4('0x1')]='';this[_0x01a4('0xd')]();this['updateRealtime']();}WhatsappQueue[_0x01a4('0xe')]['updateRouting']=function(){var _0x392d15=this[_0x01a4('0xb')][_0x01a4('0xf')];this[_0x01a4('0xb')]=_['map'](this[_0x01a4('0xa')],'id');this[_0x01a4('0xb')][_0x01a4('0xf')]=_0x392d15;};WhatsappQueue[_0x01a4('0xe')][_0x01a4('0x10')]=function(){this[_0x01a4('0x11')]=0x0;this[_0x01a4('0x12')]=0x0;for(var _0x36b659=0x0;_0x36b659=0x0?this[_0x01a4('0x15')]:0x0;var _0x2aa2d5={'id':this['id'],'available':this[_0x01a4('0x15')],'loggedIn':this[_0x01a4('0x11')],'name':this[_0x01a4('0x7')],'paused':this[_0x01a4('0x12')],'waiting':this['waiting']};var _0x33688e=md5(JSON[_0x01a4('0x16')](_0x2aa2d5));if(this[_0x01a4('0x1')]!==_0x33688e){this[_0x01a4('0x1')]=_0x33688e;io['to'](util[_0x01a4('0x17')]('whatsapp:queue:%s',_0x2aa2d5[_0x01a4('0x7')]))[_0x01a4('0x18')]('whatsapp_queue:save',_0x2aa2d5);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 46f12ec..b944893 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 _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(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 +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(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 a94617c..dc4e3fb 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 _0x1d8f=['AddTagsToChatInteraction','addTagsToChatInteraction','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x598dd8,_0x2bd5c2){var _0x36041e=function(_0x27a054){while(--_0x27a054){_0x598dd8['push'](_0x598dd8['shift']());}};_0x36041e(++_0x2bd5c2);}(_0x1d8f,0x1c9));var _0xf1d8=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x1d8f[_0x4fde08];return _0x12e725;};'use strict';var client=require('../client');exports[_0xf1d8('0x0')]=function(_0x45e00f,_0x1df274){return client[_0xf1d8('0x1')](_0xf1d8('0x2'),{'body':_0x1df274,'options':{'where':{'id':_0x45e00f}},'log':_0xf1d8('0x3')});};exports[_0xf1d8('0x4')]=function(_0x295e49,_0x400148){return client['Request'](_0xf1d8('0x5'),{'body':_0x400148,'options':{'where':{'id':_0x295e49}},'log':_0xf1d8('0x6')});}; \ No newline at end of file +var _0xaf0b=['addTags','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xaf0b,0x150));var _0xbaf0=function(_0xde9436,_0x519363){_0xde9436=_0xde9436-0x0;var _0x2b82db=_0xaf0b[_0xde9436];return _0x2b82db;};'use strict';var client=require('../client');exports[_0xbaf0('0x0')]=function(_0x571f40,_0x4f46c2){return client[_0xbaf0('0x1')](_0xbaf0('0x2'),{'body':_0x4f46c2,'options':{'where':{'id':_0x571f40}},'log':_0xbaf0('0x3')});};exports[_0xbaf0('0x4')]=function(_0x528908,_0x49a65a){return client[_0xbaf0('0x1')]('AddTagsToChatInteraction',{'body':_0x49a65a,'options':{'where':{'id':_0x528908}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index c596aa0..998b032 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 _0x4daa=['CreateChatMessage','../client','create','Request'];(function(_0x2dd750,_0x628547){var _0x40bf45=function(_0x30954c){while(--_0x30954c){_0x2dd750['push'](_0x2dd750['shift']());}};_0x40bf45(++_0x628547);}(_0x4daa,0x145));var _0xa4da=function(_0x20e283,_0x2b5a6e){_0x20e283=_0x20e283-0x0;var _0x199e10=_0x4daa[_0x20e283];return _0x199e10;};'use strict';var client=require(_0xa4da('0x0'));exports[_0xa4da('0x1')]=function(_0x2ee0a3){return client[_0xa4da('0x2')](_0xa4da('0x3'),{'body':_0x2ee0a3,'log':'createChatMessage'});}; \ No newline at end of file +var _0x48c1=['createChatMessage','../client','Request'];(function(_0x2e1ca2,_0x150397){var _0x60bc65=function(_0x12de2d){while(--_0x12de2d){_0x2e1ca2['push'](_0x2e1ca2['shift']());}};_0x60bc65(++_0x150397);}(_0x48c1,0x184));var _0x148c=function(_0x20b29c,_0xe22528){_0x20b29c=_0x20b29c-0x0;var _0x20d81b=_0x48c1[_0x20b29c];return _0x20d81b;};'use strict';var client=require(_0x148c('0x0'));exports['create']=function(_0x9fe1a8){return client[_0x148c('0x1')]('CreateChatMessage',{'body':_0x9fe1a8,'log':_0x148c('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 14a3bc4..cdcd0cf 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 _0xf29c=['Request','GetChatQueue','name','timeout','strategy','User','Agents','online','chatPause','getChatQueues'];(function(_0x3a04ff,_0x40432a){var _0x5059a8=function(_0x1ccb7e){while(--_0x1ccb7e){_0x3a04ff['push'](_0x3a04ff['shift']());}};_0x5059a8(++_0x40432a);}(_0xf29c,0xc7));var _0xcf29=function(_0x1651b0,_0xc1d5d2){_0x1651b0=_0x1651b0-0x0;var _0x31ed17=_0xf29c[_0x1651b0];return _0x31ed17;};'use strict';var client=require('../client');exports[_0xcf29('0x0')]=function(){return function(){return client[_0xcf29('0x1')](_0xcf29('0x2'),{'options':{'raw':![],'attributes':['id',_0xcf29('0x3'),_0xcf29('0x4'),_0xcf29('0x5')],'include':[{'model':_0xcf29('0x6'),'as':_0xcf29('0x7'),'attributes':['id',_0xcf29('0x3'),_0xcf29('0x8'),_0xcf29('0x9')]}]},'log':_0xcf29('0x0')});};}; \ No newline at end of file +var _0x39d9=['User','online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy'];(function(_0x3f954d,_0x451d43){var _0x176617=function(_0x304fa4){while(--_0x304fa4){_0x3f954d['push'](_0x3f954d['shift']());}};_0x176617(++_0x451d43);}(_0x39d9,0x17f));var _0x939d=function(_0x3b9219,_0x5805f8){_0x3b9219=_0x3b9219-0x0;var _0x310bb9=_0x39d9[_0x3b9219];return _0x310bb9;};'use strict';var client=require(_0x939d('0x0'));exports[_0x939d('0x1')]=function(){return function(){return client[_0x939d('0x2')](_0x939d('0x3'),{'options':{'raw':![],'attributes':['id',_0x939d('0x4'),_0x939d('0x5'),_0x939d('0x6')],'include':[{'model':_0x939d('0x7'),'as':'Agents','attributes':['id',_0x939d('0x4'),_0x939d('0x8'),_0x939d('0x9')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 123c956..5026345 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 _0x52b2=['Request','CreateChatQueueReport','UpdateChatQueueReport','DESC','../client','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x52b2,0x11e));var _0x252b=function(_0x3706c1,_0x560595){_0x3706c1=_0x3706c1-0x0;var _0x4372e7=_0x52b2[_0x3706c1];return _0x4372e7;};'use strict';var client=require(_0x252b('0x0'));exports[_0x252b('0x1')]=function(_0xc64efc){return client[_0x252b('0x2')](_0x252b('0x3'),{'body':_0xc64efc,'log':_0x252b('0x3')});};exports['update']=function(_0x22d6b2,_0x35fe82){return client[_0x252b('0x2')](_0x252b('0x4'),{'body':_0x35fe82,'options':{'where':{'uniqueid':_0x22d6b2},'order':[['id',_0x252b('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x5640=['update','UpdateChatQueueReport','DESC','../client','Request','CreateChatQueueReport'];(function(_0x2b03a4,_0x165f9d){var _0x5f18ec=function(_0x3f7730){while(--_0x3f7730){_0x2b03a4['push'](_0x2b03a4['shift']());}};_0x5f18ec(++_0x165f9d);}(_0x5640,0x111));var _0x0564=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5640[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x0564('0x0'));exports['create']=function(_0xaefcb6){return client[_0x0564('0x1')](_0x0564('0x2'),{'body':_0xaefcb6,'log':_0x0564('0x2')});};exports[_0x0564('0x3')]=function(_0x10487f,_0x1cbb9d){return client[_0x0564('0x1')](_0x0564('0x4'),{'body':_0x1cbb9d,'options':{'where':{'uniqueid':_0x10487f},'order':[['id',_0x0564('0x5')]],'limit':0x1},'log':_0x0564('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 154ffcf..a85fa9a 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 _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x4fdbb9,_0x2a214e){var _0x1007cc=function(_0x4fe87a){while(--_0x4fe87a){_0x4fdbb9['push'](_0x4fdbb9['shift']());}};_0x1007cc(++_0x2a214e);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x49a3e2,_0x419808){var _0x287ac2=function(_0x2c51d6){while(--_0x2c51d6){_0x49a3e2['push'](_0x49a3e2['shift']());}};_0x287ac2(++_0x419808);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 12d7add..fdb1661 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 _0x526b=['../client','create','CreateFaxMessage','createFaxMessage'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x526b,0xd4));var _0xb526=function(_0x2df3a2,_0x2d52dc){_0x2df3a2=_0x2df3a2-0x0;var _0xee707c=_0x526b[_0x2df3a2];return _0xee707c;};'use strict';var client=require(_0xb526('0x0'));exports[_0xb526('0x1')]=function(_0xb80103){return client['Request'](_0xb526('0x2'),{'body':_0xb80103,'log':_0xb526('0x3')});}; \ No newline at end of file +var _0xa7e7=['Request','createFaxMessage','../client'];(function(_0x1304c6,_0x6bb485){var _0x2e6654=function(_0x2b623c){while(--_0x2b623c){_0x1304c6['push'](_0x1304c6['shift']());}};_0x2e6654(++_0x6bb485);}(_0xa7e7,0x1a9));var _0x7a7e=function(_0x258d02,_0x43d710){_0x258d02=_0x258d02-0x0;var _0x3022ba=_0xa7e7[_0x258d02];return _0x3022ba;};'use strict';var client=require(_0x7a7e('0x0'));exports['create']=function(_0x1fc691){return client[_0x7a7e('0x1')]('CreateFaxMessage',{'body':_0x1fc691,'log':_0x7a7e('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index f6aae9c..d623074 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 _0xfcc3=['strategy','Agents','online','faxPause','getFaxQueues','../client','Request','GetFaxQueue','name','timeout'];(function(_0x1ebf25,_0xea4c5d){var _0x3e7a2a=function(_0x34ba72){while(--_0x34ba72){_0x1ebf25['push'](_0x1ebf25['shift']());}};_0x3e7a2a(++_0xea4c5d);}(_0xfcc3,0x69));var _0x3fcc=function(_0x6d31a4,_0x2cdcd2){_0x6d31a4=_0x6d31a4-0x0;var _0x2c37b6=_0xfcc3[_0x6d31a4];return _0x2c37b6;};'use strict';var client=require(_0x3fcc('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x3fcc('0x1')](_0x3fcc('0x2'),{'options':{'raw':![],'attributes':['id',_0x3fcc('0x3'),_0x3fcc('0x4'),_0x3fcc('0x5')],'include':[{'model':'User','as':_0x3fcc('0x6'),'attributes':['id','name',_0x3fcc('0x7'),_0x3fcc('0x8')]}]},'log':_0x3fcc('0x9')});};}; \ No newline at end of file +var _0x6770=['strategy','User','Agents','online','faxPause','../client','getFaxQueues','GetFaxQueue','name','timeout'];(function(_0x433c37,_0x4b1371){var _0x108807=function(_0x2022b0){while(--_0x2022b0){_0x433c37['push'](_0x433c37['shift']());}};_0x108807(++_0x4b1371);}(_0x6770,0xb9));var _0x0677=function(_0x1df5eb,_0x473088){_0x1df5eb=_0x1df5eb-0x0;var _0x506f9e=_0x6770[_0x1df5eb];return _0x506f9e;};'use strict';var client=require(_0x0677('0x0'));exports[_0x0677('0x1')]=function(){return function(){return client['Request'](_0x0677('0x2'),{'options':{'raw':![],'attributes':['id',_0x0677('0x3'),_0x0677('0x4'),_0x0677('0x5')],'include':[{'model':_0x0677('0x6'),'as':_0x0677('0x7'),'attributes':['id',_0x0677('0x3'),_0x0677('0x8'),_0x0677('0x9')]}]},'log':_0x0677('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 6370f3b..4a72575 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 _0x55dc=['update','UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport'];(function(_0x48b359,_0x3af1bd){var _0x41351b=function(_0x347d55){while(--_0x347d55){_0x48b359['push'](_0x48b359['shift']());}};_0x41351b(++_0x3af1bd);}(_0x55dc,0xf8));var _0xc55d=function(_0x5b45e1,_0xedfcae){_0x5b45e1=_0x5b45e1-0x0;var _0x5190e7=_0x55dc[_0x5b45e1];return _0x5190e7;};'use strict';var client=require(_0xc55d('0x0'));exports[_0xc55d('0x1')]=function(_0x3c72d6){return client[_0xc55d('0x2')](_0xc55d('0x3'),{'body':_0x3c72d6,'log':'CreateFaxQueueReport'});};exports[_0xc55d('0x4')]=function(_0x40339e,_0x346993){return client[_0xc55d('0x2')]('UpdateFaxQueueReport',{'body':_0x346993,'options':{'where':{'uniqueid':_0x40339e},'order':[['id','DESC']],'limit':0x1},'log':_0xc55d('0x5')});}; \ No newline at end of file +var _0x24a0=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x51b0dc,_0x5307b7){var _0x13fa89=function(_0x2c880f){while(--_0x2c880f){_0x51b0dc['push'](_0x51b0dc['shift']());}};_0x13fa89(++_0x5307b7);}(_0x24a0,0x11e));var _0x024a=function(_0x3d710b,_0x280332){_0x3d710b=_0x3d710b-0x0;var _0x4c4463=_0x24a0[_0x3d710b];return _0x4c4463;};'use strict';var client=require(_0x024a('0x0'));exports[_0x024a('0x1')]=function(_0x4ad1da){return client[_0x024a('0x2')](_0x024a('0x3'),{'body':_0x4ad1da,'log':_0x024a('0x3')});};exports[_0x024a('0x4')]=function(_0x5bd9a1,_0x567456){return client['Request'](_0x024a('0x5'),{'body':_0x567456,'options':{'where':{'uniqueid':_0x5bd9a1},'order':[['id',_0x024a('0x6')]],'limit':0x1},'log':_0x024a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 6af02f8..a638f57 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 _0xdf4d=['name','Interval','Intervals','interval','../client','getIntervals','Request'];(function(_0x1c0c98,_0x1f700b){var _0x36fdba=function(_0x1792f7){while(--_0x1792f7){_0x1c0c98['push'](_0x1c0c98['shift']());}};_0x36fdba(++_0x1f700b);}(_0xdf4d,0x66));var _0xddf4=function(_0x3d867d,_0x59a3e8){_0x3d867d=_0x3d867d-0x0;var _0x1b17c3=_0xdf4d[_0x3d867d];return _0x1b17c3;};'use strict';var client=require(_0xddf4('0x0'));exports[_0xddf4('0x1')]=function(){return function(){return client[_0xddf4('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xddf4('0x3')],'include':[{'model':_0xddf4('0x4'),'as':_0xddf4('0x5'),'attributes':['id','name',_0xddf4('0x6')]}]},'log':_0xddf4('0x1')});};}; \ No newline at end of file +var _0xf165=['Interval','../client','getIntervals','name'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0xf165,0x65));var _0x5f16=function(_0x158fd6,_0x37e2ed){_0x158fd6=_0x158fd6-0x0;var _0x4f9dd3=_0xf165[_0x158fd6];return _0x4f9dd3;};'use strict';var client=require(_0x5f16('0x0'));exports[_0x5f16('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x5f16('0x2')],'include':[{'model':_0x5f16('0x3'),'as':'Intervals','attributes':['id',_0x5f16('0x2'),'interval']}]},'log':_0x5f16('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index c9e3c1b..9b1eacd 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 _0x2542=['AddTagsToMailInteraction','../client','update','UpdateMailInteraction','addTags','Request'];(function(_0xe7ce74,_0x5bee8b){var _0x5e3aa2=function(_0x1e27e7){while(--_0x1e27e7){_0xe7ce74['push'](_0xe7ce74['shift']());}};_0x5e3aa2(++_0x5bee8b);}(_0x2542,0x169));var _0x2254=function(_0x55184c,_0x2f584b){_0x55184c=_0x55184c-0x0;var _0x3dc4a1=_0x2542[_0x55184c];return _0x3dc4a1;};'use strict';var client=require(_0x2254('0x0'));exports[_0x2254('0x1')]=function(_0x2f3bcd,_0x20dfee){return client['Request'](_0x2254('0x2'),{'body':_0x20dfee,'options':{'where':{'id':_0x2f3bcd}},'log':'updateMailInteraction'});};exports[_0x2254('0x3')]=function(_0x3b3dcb,_0x27f5c9){return client[_0x2254('0x4')](_0x2254('0x5'),{'body':_0x27f5c9,'options':{'where':{'id':_0x3b3dcb}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x25e7=['addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x1d1c7a,_0x2bd1e0){var _0x7bfb9=function(_0xa0c993){while(--_0xa0c993){_0x1d1c7a['push'](_0x1d1c7a['shift']());}};_0x7bfb9(++_0x2bd1e0);}(_0x25e7,0x1d6));var _0x725e=function(_0xc8db78,_0x58b5a7){_0xc8db78=_0xc8db78-0x0;var _0x3483f3=_0x25e7[_0xc8db78];return _0x3483f3;};'use strict';var client=require(_0x725e('0x0'));exports[_0x725e('0x1')]=function(_0x2752fa,_0x3fdca4){return client[_0x725e('0x2')](_0x725e('0x3'),{'body':_0x3fdca4,'options':{'where':{'id':_0x2752fa}},'log':_0x725e('0x4')});};exports[_0x725e('0x5')]=function(_0x3d7893,_0x3da706){return client['Request']('AddTagsToMailInteraction',{'body':_0x3da706,'options':{'where':{'id':_0x3d7893}},'log':_0x725e('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 1e89e35..ea61318 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 _0x0e83=['createMailMessage','create','Request','CreateMailMessage'];(function(_0xe78a06,_0x4fcfed){var _0x4f676d=function(_0x3a09fe){while(--_0x3a09fe){_0xe78a06['push'](_0xe78a06['shift']());}};_0x4f676d(++_0x4fcfed);}(_0x0e83,0x1e1));var _0x30e8=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x0e83[_0x35885a];return _0xe86249;};'use strict';var client=require('../client');exports[_0x30e8('0x0')]=function(_0x2ea0a0){return client[_0x30e8('0x1')](_0x30e8('0x2'),{'body':_0x2ea0a0,'log':_0x30e8('0x3')});}; \ No newline at end of file +var _0xcd87=['CreateMailMessage','createMailMessage','../client'];(function(_0x3139e2,_0x2504fc){var _0x5df831=function(_0x137b37){while(--_0x137b37){_0x3139e2['push'](_0x3139e2['shift']());}};_0x5df831(++_0x2504fc);}(_0xcd87,0x7a));var _0x7cd8=function(_0xae9f7a,_0x5cce98){_0xae9f7a=_0xae9f7a-0x0;var _0x3c21be=_0xcd87[_0xae9f7a];return _0x3c21be;};'use strict';var client=require(_0x7cd8('0x0'));exports['create']=function(_0xec9866){return client['Request'](_0x7cd8('0x1'),{'body':_0xec9866,'log':_0x7cd8('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index c75ca02..64eaefb 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 _0x30bc=['Request','GetMailQueue','name','User','Agents','online','mailPause','../client','getMailQueues'];(function(_0x456a84,_0x46bc0b){var _0x1117d6=function(_0x20f9d1){while(--_0x20f9d1){_0x456a84['push'](_0x456a84['shift']());}};_0x1117d6(++_0x46bc0b);}(_0x30bc,0x14b));var _0xc30b=function(_0x3cc31a,_0x4bbb08){_0x3cc31a=_0x3cc31a-0x0;var _0xe50e0c=_0x30bc[_0x3cc31a];return _0xe50e0c;};'use strict';var client=require(_0xc30b('0x0'));exports[_0xc30b('0x1')]=function(){return function(){return client[_0xc30b('0x2')](_0xc30b('0x3'),{'options':{'raw':![],'attributes':['id',_0xc30b('0x4'),'timeout','strategy'],'include':[{'model':_0xc30b('0x5'),'as':_0xc30b('0x6'),'attributes':['id',_0xc30b('0x4'),_0xc30b('0x7'),_0xc30b('0x8')]}]},'log':_0xc30b('0x1')});};}; \ No newline at end of file +var _0xae4e=['getMailQueues','name','timeout','strategy','User','Agents','online','mailPause','../client'];(function(_0x3b6f58,_0x5870de){var _0x987c61=function(_0x3a9281){while(--_0x3a9281){_0x3b6f58['push'](_0x3b6f58['shift']());}};_0x987c61(++_0x5870de);}(_0xae4e,0x116));var _0xeae4=function(_0xf84063,_0x2a7135){_0xf84063=_0xf84063-0x0;var _0x599e14=_0xae4e[_0xf84063];return _0x599e14;};'use strict';var client=require(_0xeae4('0x0'));exports[_0xeae4('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xeae4('0x2'),_0xeae4('0x3'),_0xeae4('0x4')],'include':[{'model':_0xeae4('0x5'),'as':_0xeae4('0x6'),'attributes':['id',_0xeae4('0x2'),_0xeae4('0x7'),_0xeae4('0x8')]}]},'log':_0xeae4('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 334e7a8..7f59068 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 _0x64b5=['create','Request','CreateMailQueueReport','update','DESC','UpdateMailQueueReport','../client'];(function(_0x57684d,_0x229066){var _0x2b21c3=function(_0x580778){while(--_0x580778){_0x57684d['push'](_0x57684d['shift']());}};_0x2b21c3(++_0x229066);}(_0x64b5,0xbc));var _0x564b=function(_0x31c117,_0x4545c5){_0x31c117=_0x31c117-0x0;var _0x4b237f=_0x64b5[_0x31c117];return _0x4b237f;};'use strict';var client=require(_0x564b('0x0'));exports[_0x564b('0x1')]=function(_0x3198fa){return client[_0x564b('0x2')](_0x564b('0x3'),{'body':_0x3198fa,'log':_0x564b('0x3')});};exports[_0x564b('0x4')]=function(_0x4e10b5,_0x4f5e9e){return client[_0x564b('0x2')]('UpdateMailQueueReport',{'body':_0x4f5e9e,'options':{'where':{'uniqueid':_0x4e10b5},'order':[['id',_0x564b('0x5')]],'limit':0x1},'log':_0x564b('0x6')});}; \ No newline at end of file +var _0x86ba=['../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0x86ba,0x1ce));var _0xa86b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x86ba[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0xa86b('0x0'));exports[_0xa86b('0x1')]=function(_0xff48fa){return client[_0xa86b('0x2')](_0xa86b('0x3'),{'body':_0xff48fa,'log':_0xa86b('0x3')});};exports[_0xa86b('0x4')]=function(_0x1ff397,_0x4644ab){return client['Request'](_0xa86b('0x5'),{'body':_0x4644ab,'options':{'where':{'uniqueid':_0x1ff397},'order':[['id','DESC']],'limit':0x1},'log':_0xa86b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 987ac27..fe86bf4 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 _0xbcce=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbcce,0x1b8));var _0xebcc=function(_0x528cfc,_0x31eec7){_0x528cfc=_0x528cfc-0x0;var _0x35ccfd=_0xbcce[_0x528cfc];return _0x35ccfd;};'use strict';var client=require('../client');exports['update']=function(_0x3e052e,_0x47a3aa){return client['Request'](_0xebcc('0x0'),{'body':_0x47a3aa,'options':{'where':{'id':_0x3e052e}},'log':_0xebcc('0x1')});};exports[_0xebcc('0x2')]=function(_0x5d45f4,_0x15d8ef){return client[_0xebcc('0x3')](_0xebcc('0x4'),{'body':_0x15d8ef,'options':{'where':{'id':_0x5d45f4}},'log':_0xebcc('0x5')});}; \ No newline at end of file +var _0xfb4d=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x16a1bf,_0x372fda){var _0x2c129a=function(_0x1b87a1){while(--_0x1b87a1){_0x16a1bf['push'](_0x16a1bf['shift']());}};_0x2c129a(++_0x372fda);}(_0xfb4d,0xb3));var _0xdfb4=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xfb4d[_0x13b8f3];return _0x1a6d06;};'use strict';var client=require(_0xdfb4('0x0'));exports[_0xdfb4('0x1')]=function(_0x35e325,_0x17efb7){return client[_0xdfb4('0x2')](_0xdfb4('0x3'),{'body':_0x17efb7,'options':{'where':{'id':_0x35e325}},'log':_0xdfb4('0x4')});};exports['addTags']=function(_0x22b34a,_0x2b7dce){return client['Request'](_0xdfb4('0x5'),{'body':_0x2b7dce,'options':{'where':{'id':_0x22b34a}},'log':_0xdfb4('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 4399a51..35c3b80 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 _0x99e8=['Request','createOpenchannelMessage','../client','create'];(function(_0x31fdd,_0x26658c){var _0x5155e0=function(_0x5e5b65){while(--_0x5e5b65){_0x31fdd['push'](_0x31fdd['shift']());}};_0x5155e0(++_0x26658c);}(_0x99e8,0x18a));var _0x899e=function(_0x5b9e91,_0x451918){_0x5b9e91=_0x5b9e91-0x0;var _0x10e262=_0x99e8[_0x5b9e91];return _0x10e262;};'use strict';var client=require(_0x899e('0x0'));exports[_0x899e('0x1')]=function(_0x11eebf){return client[_0x899e('0x2')]('CreateOpenchannelMessage',{'body':_0x11eebf,'log':_0x899e('0x3')});}; \ No newline at end of file +var _0xe876=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x25b34d,_0x3e527c){var _0x2b7caf=function(_0x596e9b){while(--_0x596e9b){_0x25b34d['push'](_0x25b34d['shift']());}};_0x2b7caf(++_0x3e527c);}(_0xe876,0xdb));var _0x6e87=function(_0x2c13b7,_0x585053){_0x2c13b7=_0x2c13b7-0x0;var _0x1bb147=_0xe876[_0x2c13b7];return _0x1bb147;};'use strict';var client=require(_0x6e87('0x0'));exports[_0x6e87('0x1')]=function(_0x3d53e1){return client[_0x6e87('0x2')](_0x6e87('0x3'),{'body':_0x3d53e1,'log':_0x6e87('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 6a2045d..1144960 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 _0x252b=['getOpenchannelQueues','Request','name','timeout','User','Agents','online','../client'];(function(_0x3ab4d9,_0x4a5c83){var _0x254a3c=function(_0x12c36c){while(--_0x12c36c){_0x3ab4d9['push'](_0x3ab4d9['shift']());}};_0x254a3c(++_0x4a5c83);}(_0x252b,0x117));var _0xb252=function(_0x24689f,_0x4fff42){_0x24689f=_0x24689f-0x0;var _0x2c1c51=_0x252b[_0x24689f];return _0x2c1c51;};'use strict';var client=require(_0xb252('0x0'));exports[_0xb252('0x1')]=function(){return function(){return client[_0xb252('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xb252('0x3'),_0xb252('0x4'),'strategy'],'include':[{'model':_0xb252('0x5'),'as':_0xb252('0x6'),'attributes':['id',_0xb252('0x3'),_0xb252('0x7'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x9b40=['strategy','getOpenchannelQueues','GetOpenchannelQueue','name','timeout'];(function(_0x4b4f44,_0xbbb238){var _0x5c9a08=function(_0x94f241){while(--_0x94f241){_0x4b4f44['push'](_0x4b4f44['shift']());}};_0x5c9a08(++_0xbbb238);}(_0x9b40,0xf6));var _0x09b4=function(_0x687843,_0x26671e){_0x687843=_0x687843-0x0;var _0x5d1a52=_0x9b40[_0x687843];return _0x5d1a52;};'use strict';var client=require('../client');exports[_0x09b4('0x0')]=function(){return function(){return client['Request'](_0x09b4('0x1'),{'options':{'raw':![],'attributes':['id',_0x09b4('0x2'),_0x09b4('0x3'),_0x09b4('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x09b4('0x2'),'online','openchannelPause']}]},'log':_0x09b4('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index eadbd02..c2915eb 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 _0x7e7b=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0x55d911,_0x2b768c){var _0x3104c2=function(_0x1b4386){while(--_0x1b4386){_0x55d911['push'](_0x55d911['shift']());}};_0x3104c2(++_0x2b768c);}(_0x7e7b,0x133));var _0xb7e7=function(_0x447d73,_0x50f8c7){_0x447d73=_0x447d73-0x0;var _0x343b07=_0x7e7b[_0x447d73];return _0x343b07;};'use strict';var client=require(_0xb7e7('0x0'));exports[_0xb7e7('0x1')]=function(_0x4ec5b2){return client[_0xb7e7('0x2')](_0xb7e7('0x3'),{'body':_0x4ec5b2,'log':_0xb7e7('0x3')});};exports[_0xb7e7('0x4')]=function(_0x758014,_0x253534){return client[_0xb7e7('0x2')](_0xb7e7('0x5'),{'body':_0x253534,'options':{'where':{'uniqueid':_0x758014},'order':[['id',_0xb7e7('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x0b96=['update','Request','DESC','UpdateOpenchannelQueueReport','../client','create','CreateOpenchannelQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b96,0xa5));var _0x60b9=function(_0x521b61,_0x47e2b4){_0x521b61=_0x521b61-0x0;var _0x476cdf=_0x0b96[_0x521b61];return _0x476cdf;};'use strict';var client=require(_0x60b9('0x0'));exports[_0x60b9('0x1')]=function(_0x2552bc){return client['Request'](_0x60b9('0x2'),{'body':_0x2552bc,'log':_0x60b9('0x2')});};exports[_0x60b9('0x3')]=function(_0x4a68ca,_0x348b51){return client[_0x60b9('0x4')]('UpdateOpenchannelQueueReport',{'body':_0x348b51,'options':{'where':{'uniqueid':_0x4a68ca},'order':[['id',_0x60b9('0x5')]],'limit':0x1},'log':_0x60b9('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 57dddc1..8d50cc1 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 _0x624c=['AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request','UpdateSmsInteraction','addTags'];(function(_0x249565,_0x2a026a){var _0x43dee8=function(_0x15a1ab){while(--_0x15a1ab){_0x249565['push'](_0x249565['shift']());}};_0x43dee8(++_0x2a026a);}(_0x624c,0x1ee));var _0xc624=function(_0x32b09a,_0x426696){_0x32b09a=_0x32b09a-0x0;var _0x1a543e=_0x624c[_0x32b09a];return _0x1a543e;};'use strict';var client=require('../client');exports[_0xc624('0x0')]=function(_0x46aec8,_0x41c23b){return client[_0xc624('0x1')](_0xc624('0x2'),{'body':_0x41c23b,'options':{'where':{'id':_0x46aec8}},'log':'updateSmsInteraction'});};exports[_0xc624('0x3')]=function(_0x483c73,_0x1e6dbe){return client['Request'](_0xc624('0x4'),{'body':_0x1e6dbe,'options':{'where':{'id':_0x483c73}},'log':_0xc624('0x5')});}; \ No newline at end of file +var _0x1b69=['Request','UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x1b69,0x190));var _0x91b6=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x1b69[_0x11ce46];return _0x368a1e;};'use strict';var client=require('../client');exports['update']=function(_0x4e96ea,_0x3142e3){return client[_0x91b6('0x0')](_0x91b6('0x1'),{'body':_0x3142e3,'options':{'where':{'id':_0x4e96ea}},'log':'updateSmsInteraction'});};exports[_0x91b6('0x2')]=function(_0xbbd6b7,_0x35a742){return client[_0x91b6('0x0')](_0x91b6('0x3'),{'body':_0x35a742,'options':{'where':{'id':_0xbbd6b7}},'log':_0x91b6('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 63ff2c0..d8935b4 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 _0x5398=['createSmsMessage','../client','create','Request'];(function(_0x1382be,_0x49bc15){var _0x1cdb85=function(_0x5b14cc){while(--_0x5b14cc){_0x1382be['push'](_0x1382be['shift']());}};_0x1cdb85(++_0x49bc15);}(_0x5398,0x91));var _0x8539=function(_0x56553d,_0x3b1365){_0x56553d=_0x56553d-0x0;var _0x47cc2e=_0x5398[_0x56553d];return _0x47cc2e;};'use strict';var client=require(_0x8539('0x0'));exports[_0x8539('0x1')]=function(_0x41d143){return client[_0x8539('0x2')]('CreateSmsMessage',{'body':_0x41d143,'log':_0x8539('0x3')});}; \ No newline at end of file +var _0x2a7c=['CreateSmsMessage','../client','create','Request'];(function(_0x330d84,_0x17d231){var _0x3590fc=function(_0x14eb11){while(--_0x14eb11){_0x330d84['push'](_0x330d84['shift']());}};_0x3590fc(++_0x17d231);}(_0x2a7c,0x155));var _0xc2a7=function(_0x3619f,_0xa3aa14){_0x3619f=_0x3619f-0x0;var _0x2f37a4=_0x2a7c[_0x3619f];return _0x2f37a4;};'use strict';var client=require(_0xc2a7('0x0'));exports[_0xc2a7('0x1')]=function(_0x23d3f2){return client[_0xc2a7('0x2')](_0xc2a7('0x3'),{'body':_0x23d3f2,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 537a3b6..0d99499 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 _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x27eb45,_0x59c345){var _0x2efb4d=function(_0x1de3ac){while(--_0x1de3ac){_0x27eb45['push'](_0x27eb45['shift']());}};_0x2efb4d(++_0x59c345);}(_0xb7e7,0x121));var _0x7b7e=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0xb7e7[_0x39d544];return _0x5a5ff2;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x14919a,_0x8e38b6){var _0x7a3de0=function(_0x15e5cc){while(--_0x15e5cc){_0x14919a['push'](_0x14919a['shift']());}};_0x7a3de0(++_0x8e38b6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index ca42382..e4f4e16 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(_0x30839e,_0x49a0ad){var _0x542091=function(_0x570f60){while(--_0x570f60){_0x30839e['push'](_0x30839e['shift']());}};_0x542091(++_0x49a0ad);}(_0x70e0,0x17b));var _0x070e=function(_0x18082d,_0x211884){_0x18082d=_0x18082d-0x0;var _0x182ffa=_0x70e0[_0x18082d];return _0x182ffa;};'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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x449611,_0x3e33c0){var _0x4400f0=function(_0x2d86cb){while(--_0x2d86cb){_0x449611['push'](_0x449611['shift']());}};_0x4400f0(++_0x3e33c0);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 5b7b7dd..076ca2e 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(_0x22ab4a,_0x85b2){var _0x301e6d=function(_0x49c142){while(--_0x49c142){_0x22ab4a['push'](_0x22ab4a['shift']());}};_0x301e6d(++_0x85b2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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(_0x519e33,_0x49b004){var _0x164575=function(_0x388bcb){while(--_0x388bcb){_0x519e33['push'](_0x519e33['shift']());}};_0x164575(++_0x49b004);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 0643aff..974f344 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 _0xf8af=['Request','UpdateWhatsappInteraction','addTags','../client'];(function(_0x137bfc,_0x2782ee){var _0x3d0642=function(_0x296374){while(--_0x296374){_0x137bfc['push'](_0x137bfc['shift']());}};_0x3d0642(++_0x2782ee);}(_0xf8af,0x8b));var _0xff8a=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xf8af[_0x27af45];return _0x18df21;};'use strict';var client=require(_0xff8a('0x0'));exports['update']=function(_0x873efc,_0x3991a6){return client[_0xff8a('0x1')](_0xff8a('0x2'),{'body':_0x3991a6,'options':{'where':{'id':_0x873efc}},'log':'updateWhatsappInteraction'});};exports[_0xff8a('0x3')]=function(_0x460bf6,_0x11cfa2){return client[_0xff8a('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x11cfa2,'options':{'where':{'id':_0x460bf6}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x9e8a=['Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','../client','update'];(function(_0x4b89f2,_0x5bc1b6){var _0x17a92a=function(_0x1b2412){while(--_0x1b2412){_0x4b89f2['push'](_0x4b89f2['shift']());}};_0x17a92a(++_0x5bc1b6);}(_0x9e8a,0x112));var _0xa9e8=function(_0x3b46d6,_0x1438c7){_0x3b46d6=_0x3b46d6-0x0;var _0x141de1=_0x9e8a[_0x3b46d6];return _0x141de1;};'use strict';var client=require(_0xa9e8('0x0'));exports[_0xa9e8('0x1')]=function(_0x1f8ea6,_0x5c6bb4){return client[_0xa9e8('0x2')](_0xa9e8('0x3'),{'body':_0x5c6bb4,'options':{'where':{'id':_0x1f8ea6}},'log':_0xa9e8('0x4')});};exports[_0xa9e8('0x5')]=function(_0xe3b2c8,_0x57736c){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0x57736c,'options':{'where':{'id':_0xe3b2c8}},'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 68a9930..37146d5 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 _0x5116=['create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0x5116,0x198));var _0x6511=function(_0x4e3be7,_0x19fda2){_0x4e3be7=_0x4e3be7-0x0;var _0x500344=_0x5116[_0x4e3be7];return _0x500344;};'use strict';var client=require('../client');exports[_0x6511('0x0')]=function(_0x16d020){return client[_0x6511('0x1')](_0x6511('0x2'),{'body':_0x16d020,'log':_0x6511('0x3')});}; \ No newline at end of file +var _0xd288=['create'];(function(_0x3e3cf6,_0x211b69){var _0x23d373=function(_0x552444){while(--_0x552444){_0x3e3cf6['push'](_0x3e3cf6['shift']());}};_0x23d373(++_0x211b69);}(_0xd288,0x1e3));var _0x8d28=function(_0x55829d,_0x5e0efe){_0x55829d=_0x55829d-0x0;var _0x211cb8=_0xd288[_0x55829d];return _0x211cb8;};'use strict';var client=require('../client');exports[_0x8d28('0x0')]=function(_0x3b8a91){return client['Request']('CreateWhatsappMessage',{'body':_0x3b8a91,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 71c991d..463013e 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 _0xb586=['Request','GetWhatsappQueue','timeout','strategy','User','Agents','name','online','whatsappPause','getWhatsappQueues'];(function(_0x297957,_0x55cdaa){var _0x579813=function(_0xcd0096){while(--_0xcd0096){_0x297957['push'](_0x297957['shift']());}};_0x579813(++_0x55cdaa);}(_0xb586,0xb4));var _0x6b58=function(_0x47a5bd,_0x508329){_0x47a5bd=_0x47a5bd-0x0;var _0x5c2184=_0xb586[_0x47a5bd];return _0x5c2184;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0x6b58('0x0')](_0x6b58('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x6b58('0x2'),_0x6b58('0x3')],'include':[{'model':_0x6b58('0x4'),'as':_0x6b58('0x5'),'attributes':['id',_0x6b58('0x6'),_0x6b58('0x7'),_0x6b58('0x8')]}]},'log':_0x6b58('0x9')});};}; \ No newline at end of file +var _0x0138=['Agents','whatsappPause','../client','getWhatsappQueues','Request','name','strategy','User'];(function(_0x26985e,_0x1f59a7){var _0x2d31fb=function(_0x5dbee0){while(--_0x5dbee0){_0x26985e['push'](_0x26985e['shift']());}};_0x2d31fb(++_0x1f59a7);}(_0x0138,0x9a));var _0x8013=function(_0xeeb049,_0x2e9c3f){_0xeeb049=_0xeeb049-0x0;var _0x164032=_0x0138[_0xeeb049];return _0x164032;};'use strict';var client=require(_0x8013('0x0'));exports[_0x8013('0x1')]=function(){return function(){return client[_0x8013('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x8013('0x3'),'timeout',_0x8013('0x4')],'include':[{'model':_0x8013('0x5'),'as':_0x8013('0x6'),'attributes':['id','name','online',_0x8013('0x7')]}]},'log':_0x8013('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 01153b4..b7e080a 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 _0x10d7=['Request','UpdateWhatsappQueueReport','create','CreateWhatsappQueueReport'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x10d7,0xd2));var _0x710d=function(_0x353360,_0x51845e){_0x353360=_0x353360-0x0;var _0x307407=_0x10d7[_0x353360];return _0x307407;};'use strict';var client=require('../client');exports[_0x710d('0x0')]=function(_0x160990){return client['Request']('CreateWhatsappQueueReport',{'body':_0x160990,'log':_0x710d('0x1')});};exports['update']=function(_0x339d17,_0x303ee1){return client[_0x710d('0x2')](_0x710d('0x3'),{'body':_0x303ee1,'options':{'where':{'uniqueid':_0x339d17},'order':[['id','DESC']],'limit':0x1},'log':_0x710d('0x3')});}; \ No newline at end of file +var _0xd361=['update','Request','UpdateWhatsappQueueReport','DESC','../client','CreateWhatsappQueueReport'];(function(_0x1a72b8,_0x1e4f4b){var _0x39f72d=function(_0x35aef1){while(--_0x35aef1){_0x1a72b8['push'](_0x1a72b8['shift']());}};_0x39f72d(++_0x1e4f4b);}(_0xd361,0xee));var _0x1d36=function(_0xd8a1c9,_0x2e4e4f){_0xd8a1c9=_0xd8a1c9-0x0;var _0x453988=_0xd361[_0xd8a1c9];return _0x453988;};'use strict';var client=require(_0x1d36('0x0'));exports['create']=function(_0x2eab7f){return client['Request'](_0x1d36('0x1'),{'body':_0x2eab7f,'log':_0x1d36('0x1')});};exports[_0x1d36('0x2')]=function(_0x5b3abc,_0x537a8c){return client[_0x1d36('0x3')](_0x1d36('0x4'),{'body':_0x537a8c,'options':{'where':{'uniqueid':_0x5b3abc},'order':[['id',_0x1d36('0x5')]],'limit':0x1},'log':_0x1d36('0x4')});}; \ 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 01d355c..42d25d5 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 _0x68b6=['toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','join','stop','agents','createQueue','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','string','number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name'];(function(_0x547dde,_0x577eff){var _0xca4f9f=function(_0x569b12){while(--_0x569b12){_0x547dde['push'](_0x547dde['shift']());}};_0xca4f9f(++_0x577eff);}(_0x68b6,0x1a3));var _0x668b=function(_0x1d4162,_0xd03a6){_0x1d4162=_0x1d4162-0x0;var _0x40700b=_0x68b6[_0x1d4162];return _0x40700b;};'use strict';var schema=require(_0x668b('0x0'));var _=require(_0x668b('0x1'));var util=require(_0x668b('0x2'));var seqqueue=require(_0x668b('0x3'));var logger=require(_0x668b('0x4'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':_0x668b('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x668b('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x150b12,_0x5e06fa,_0x3b7f69){return logger['info'](util[_0x668b('0x7')](_0x668b('0x8'),_0x150b12,_0x5e06fa[_0x668b('0x9')],_0x3b7f69));}function handleFindAgent(_0x13f0f4){return function(_0x5d5a44){return _0x5d5a44[_0x668b('0x9')][_0x668b('0xa')]()===_0x13f0f4[_0x668b('0xa')]();};}exports[_0x668b('0xb')]=function(_0x595671,_0x175a47,_0x5d0a32,_0x340ece){return function(_0x4995b6){try{var _0x31a5e4={'name':_0x175a47[0x0],'timeout':_0x175a47[0x1]};var _0x3afda2=queue[_0x668b('0x0')](_0x31a5e4,{'typecast':!![]});if(_0x3afda2[_0x668b('0xc')]){logger[_0x668b('0xd')](_0x668b('0xe'),_0x595671,_[_0x668b('0xf')](_0x3afda2,'message')[_0x668b('0x10')](',\x20'));_0x4995b6[_0x668b('0x11')]();}else{var _0x531db5=_['find'](_0x5d0a32[_0x668b('0x12')],handleFindAgent(_0x31a5e4['name']));if(_0x531db5){var _0x29d3ab=(_0x31a5e4['timeout']||0xa)*0x3e8;var _0x2707ba,_0x44f8ce;var _0x2fae29=seqqueue[_0x668b('0x13')](_0x29d3ab);_0x2fae29['id']=_0x595671;_0x2fae29[_0x668b('0x14')]=_0x29d3ab;_0x2fae29[_0x668b('0x15')]=_0x340ece[_0x668b('0x15')];writeLog(_0x595671,_0x531db5,util[_0x668b('0x7')](_0x668b('0x16'),_0x29d3ab));_0x5d0a32[_0x668b('0x17')][_0x595671]['on']('end',function(){logger['info'](_0x668b('0x18'),_0x595671);clearTimeout(_0x44f8ce);_0x44f8ce=undefined;_0x2fae29['close']();if(_0x5d0a32[_0x668b('0x17')][_0x595671]){delete _0x5d0a32['rules'][_0x595671];}_0x4995b6['stop']();});_0x5d0a32[_0x668b('0x17')][_0x595671]['on'](_0x668b('0x19'),function(){if(_0x5d0a32[_0x668b('0x17')][_0x595671]){delete _0x5d0a32[_0x668b('0x17')][_0x595671];}});_0x44f8ce=setTimeout(function(){logger['info'](_0x668b('0x1a'),_0x595671);clearTimeout(_0x44f8ce);_0x2fae29[_0x668b('0x1b')]();_0x4995b6[_0x668b('0x1c')]();},_0x29d3ab);strategy[_0x668b('0x1d')](_0x2fae29,_0x531db5,_0x5d0a32,_0x340ece);}else{logger[_0x668b('0xd')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x595671,_0x31a5e4[_0x668b('0x9')]);_0x4995b6[_0x668b('0x11')]();}}}catch(_0x1fbb73){console[_0x668b('0x1e')](_0x1fbb73);logger[_0x668b('0xd')](_0x668b('0x1f'),_0x595671,_0x1fbb73[_0x668b('0x20')]);_0x4995b6['stop']();}};}; \ No newline at end of file +var _0x0db4=['[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format'];(function(_0x232610,_0x432b82){var _0x1f3da7=function(_0x209d51){while(--_0x209d51){_0x232610['push'](_0x232610['shift']());}};_0x1f3da7(++_0x432b82);}(_0x0db4,0xec));var _0x40db=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x0db4[_0x21549c];return _0x426cbd;};'use strict';var schema=require('validate');var _=require(_0x40db('0x0'));var util=require(_0x40db('0x1'));var seqqueue=require(_0x40db('0x2'));var logger=require(_0x40db('0x3'))(_0x40db('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x40db('0x5'),'required':!![],'message':_0x40db('0x6')},'timeout':{'type':_0x40db('0x7'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x3fab89,_0x9a94bf,_0x452a4a){return logger[_0x40db('0x8')](util[_0x40db('0x9')](_0x40db('0xa'),_0x3fab89,_0x9a94bf[_0x40db('0xb')],_0x452a4a));}function handleFindAgent(_0xecbeff){return function(_0x2f5e29){return _0x2f5e29[_0x40db('0xb')][_0x40db('0xc')]()===_0xecbeff[_0x40db('0xc')]();};}exports[_0x40db('0xd')]=function(_0x3bfdbb,_0x111549,_0x3f310a,_0x3d7f03){return function(_0x3582d2){try{var _0x16b575={'name':_0x111549[0x0],'timeout':_0x111549[0x1]};var _0x26ff4c=queue[_0x40db('0xe')](_0x16b575,{'typecast':!![]});if(_0x26ff4c[_0x40db('0xf')]){logger['error'](_0x40db('0x10'),_0x3bfdbb,_[_0x40db('0x11')](_0x26ff4c,_0x40db('0x12'))[_0x40db('0x13')](',\x20'));_0x3582d2[_0x40db('0x14')]();}else{var _0x19720f=_[_0x40db('0x15')](_0x3f310a[_0x40db('0x16')],handleFindAgent(_0x16b575[_0x40db('0xb')]));if(_0x19720f){var _0x57ded4=(_0x16b575[_0x40db('0x17')]||0xa)*0x3e8;var _0x53fc82,_0x1a3d66;var _0x131acc=seqqueue[_0x40db('0x18')](_0x57ded4);_0x131acc['id']=_0x3bfdbb;_0x131acc[_0x40db('0x19')]=_0x57ded4;_0x131acc[_0x40db('0x1a')]=_0x3d7f03[_0x40db('0x1a')];writeLog(_0x3bfdbb,_0x19720f,util['format'](_0x40db('0x1b'),_0x57ded4));_0x3f310a[_0x40db('0x1c')][_0x3bfdbb]['on'](_0x40db('0x1d'),function(){logger[_0x40db('0x8')](_0x40db('0x1e'),_0x3bfdbb);clearTimeout(_0x1a3d66);_0x1a3d66=undefined;_0x131acc[_0x40db('0x1f')]();if(_0x3f310a['rules'][_0x3bfdbb]){delete _0x3f310a['rules'][_0x3bfdbb];}_0x3582d2['stop']();});_0x3f310a[_0x40db('0x1c')][_0x3bfdbb]['on'](_0x40db('0x20'),function(){if(_0x3f310a['rules'][_0x3bfdbb]){delete _0x3f310a[_0x40db('0x1c')][_0x3bfdbb];}});_0x1a3d66=setTimeout(function(){logger[_0x40db('0x8')](_0x40db('0x21'),_0x3bfdbb);clearTimeout(_0x1a3d66);_0x131acc['close']();_0x3582d2[_0x40db('0x22')]();},_0x57ded4);strategy[_0x40db('0x23')](_0x131acc,_0x19720f,_0x3f310a,_0x3d7f03);}else{logger[_0x40db('0x24')](_0x40db('0x25'),_0x3bfdbb,_0x16b575[_0x40db('0xb')]);_0x3582d2[_0x40db('0x14')]();}}}catch(_0x37b109){console[_0x40db('0x26')](_0x37b109);logger['error'](_0x40db('0x27'),_0x3bfdbb,_0x37b109[_0x40db('0x28')]);_0x3582d2[_0x40db('0x14')]();}};}; \ 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 1c4f6a3..c447017 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 _0x5075=['../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','toString','postText','amazonlex','dialogState','Failed','error','lodash','./utils'];(function(_0x2ddbb6,_0x421115){var _0x2fb040=function(_0x2b4fff){while(--_0x2b4fff){_0x2ddbb6['push'](_0x2ddbb6['shift']());}};_0x2fb040(++_0x421115);}(_0x5075,0x19c));var _0x5507=function(_0x582d5a,_0x3b57c0){_0x582d5a=_0x582d5a-0x0;var _0x5625ef=_0x5075[_0x582d5a];return _0x5625ef;};'use strict';var _=require(_0x5507('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))('routing');var rpc={'chatMessage':require(_0x5507('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x5507('0x4')),'smsMessage':require(_0x5507('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5507('0x6'))};exports[_0x5507('0x7')]=function(_0x5c9f0d,_0x23b96a){return function(_0x4a45d3){try{if(!_['isNil'](this[_0x5507('0x8')][_0x5507('0x9')])){logger[_0x5507('0xa')]('[%s][AMAZONLEX]\x20%s',_0x5c9f0d,_0x5507('0xb'));return _0x4a45d3[_0x5507('0xc')]();}var _0x45fa68={'ContactId':this[_0x5507('0xd')]['id'],'sentAt':moment()['format'](_0x5507('0xe')),'direction':_0x5507('0xf')};if(this[_0x5507('0x10')]===_0x5507('0x11')||this[_0x5507('0x10')]===_0x5507('0x12')){_0x45fa68['phone']=this[_0x5507('0x8')][_0x5507('0x13')];}var _0x2f0469=this[_0x5507('0x10')];if(_0x2f0469==='chat'){_0x45fa68[_0x5507('0x14')]=this[_0x5507('0x15')]['id'];}else{_0x45fa68[_[_0x5507('0x16')](_0x2f0469)+_0x5507('0x17')]=this['account']['id'];}_0x45fa68[_[_0x5507('0x16')](_0x2f0469)+'InteractionId']=this[_0x5507('0x8')]['id'];if(this['interaction'][_0x5507('0x18')]){var _0x21bf64=_0x23b96a[0x4];if(!_[_0x5507('0x19')](_0x21bf64)){_0x45fa68[_0x5507('0x1a')]=utils[_0x5507('0x1b')](_0x21bf64,this);return rpc[_0x2f0469+_0x5507('0x1c')][_0x5507('0x1d')](_0x45fa68)[_0x5507('0x1e')](function(_0x47b8ad){logger['info'](_0x5507('0x1f'),_0x5c9f0d,_0x45fa68['body']);})[_0x5507('0x20')](function(_0x5171ca){logger['error'](_0x5507('0x1f'),_0x5c9f0d,JSON[_0x5507('0x21')](_0x5171ca));})[_0x5507('0x22')](function(){logger['info'](_0x5507('0x23'),_0x5c9f0d);_0x4a45d3[_0x5507('0x24')]();});}else{logger[_0x5507('0xa')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x5c9f0d);_0x4a45d3[_0x5507('0x24')]();}}else{var _0x48978f=this;var _0x2728f0=new AWS[(_0x5507('0x25'))]({'accessKeyId':_0x23b96a[0x0],'secretAccessKey':_0x23b96a[0x1],'region':_0x23b96a[0x2]});var _0x2cf8dd={'botAlias':_0x5507('0x26'),'botName':_0x23b96a[0x3],'inputText':this[_0x5507('0x27')]['body'],'userId':this[_0x5507('0x10')]+':'+this[_0x5507('0x8')]['id'][_0x5507('0x28')]()};_0x2728f0[_0x5507('0x29')](_0x2cf8dd,function(_0x1dc735,_0x3a079d){if(_0x1dc735){logger['error'](_0x5507('0x1f'),_0x5c9f0d,_0x1dc735[_0x5507('0x27')]);_0x4a45d3['next']();}else if(_0x3a079d&&_0x3a079d[_0x5507('0x27')]){_0x48978f[_0x5507('0x1a')][_0x5507('0x2a')]=_0x3a079d;_0x45fa68['body']=_0x3a079d[_0x5507('0x27')];_0x45fa68['providerName']=_0x5507('0x2a');_0x45fa68['providerResponse']=JSON[_0x5507('0x21')](_0x3a079d);return rpc[_0x2f0469+_0x5507('0x1c')][_0x5507('0x1d')](_0x45fa68)['then'](function(_0x5a408a){logger['info'](_0x5507('0x1f'),_0x5c9f0d,_0x45fa68['body']);if(_0x3a079d[_0x5507('0x2b')]==_0x5507('0x2c')){_0x4a45d3[_0x5507('0xc')]();}else{_0x4a45d3[_0x5507('0x24')]();}})[_0x5507('0x20')](function(_0x45d1e5){logger[_0x5507('0x2d')](_0x5507('0x1f'),_0x5c9f0d,JSON[_0x5507('0x21')](_0x45d1e5));_0x4a45d3[_0x5507('0xc')]();});}else{_0x4a45d3['next']();}});}}catch(_0x5caa8f){logger[_0x5507('0x2d')](_0x5507('0x1f'),_0x5c9f0d,JSON[_0x5507('0x21')](_0x5caa8f));_0x4a45d3[_0x5507('0x24')]();}};}; \ No newline at end of file +var _0x9935=['consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','ChatWebsiteId','AccountId','account','InteractionId','created','body','create','then','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','toString','postText','error','message','amazonlex','providerName','providerResponse','Message','Failed','catch','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x229b3d,_0x317df5){var _0x5c5dd7=function(_0x22eb01){while(--_0x22eb01){_0x229b3d['push'](_0x229b3d['shift']());}};_0x5c5dd7(++_0x317df5);}(_0x9935,0x1ea));var _0x5993=function(_0x234c80,_0x4f9c06){_0x234c80=_0x234c80-0x0;var _0x423b5b=_0x9935[_0x234c80];return _0x423b5b;};'use strict';var _=require(_0x5993('0x0'));var moment=require(_0x5993('0x1'));var AWS=require(_0x5993('0x2'));var utils=require('./utils');var logger=require(_0x5993('0x3'))(_0x5993('0x4'));var rpc={'chatMessage':require(_0x5993('0x5')),'openchannelMessage':require(_0x5993('0x6')),'mailMessage':require(_0x5993('0x7')),'smsMessage':require(_0x5993('0x8')),'faxMessage':require(_0x5993('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x5993('0xa')]=function(_0xc284e6,_0x3a99bb){return function(_0x44c8df){try{if(!_[_0x5993('0xb')](this[_0x5993('0xc')][_0x5993('0xd')])){logger[_0x5993('0xe')](_0x5993('0xf'),_0xc284e6,_0x5993('0x10'));return _0x44c8df[_0x5993('0x11')]();}var _0x2d6ce0={'ContactId':this[_0x5993('0x12')]['id'],'sentAt':moment()[_0x5993('0x13')](_0x5993('0x14')),'direction':_0x5993('0x15')};if(this[_0x5993('0x16')]===_0x5993('0x17')||this['channel']===_0x5993('0x18')){_0x2d6ce0['phone']=this[_0x5993('0xc')][_0x5993('0x19')];}var _0x48eeb0=this[_0x5993('0x16')];if(_0x48eeb0==='chat'){_0x2d6ce0[_0x5993('0x1a')]=this['account']['id'];}else{_0x2d6ce0[_['upperFirst'](_0x48eeb0)+_0x5993('0x1b')]=this[_0x5993('0x1c')]['id'];}_0x2d6ce0[_['upperFirst'](_0x48eeb0)+_0x5993('0x1d')]=this[_0x5993('0xc')]['id'];if(this[_0x5993('0xc')][_0x5993('0x1e')]){var _0x26894e=_0x3a99bb[0x4];if(!_['isEmpty'](_0x26894e)){_0x2d6ce0[_0x5993('0x1f')]=utils['getMustacheRender'](_0x26894e,this);return rpc[_0x48eeb0+'Message'][_0x5993('0x20')](_0x2d6ce0)[_0x5993('0x21')](function(_0x18aaed){logger[_0x5993('0xe')](_0x5993('0xf'),_0xc284e6,_0x2d6ce0[_0x5993('0x1f')]);})['catch'](function(_0x306814){logger['error'](_0x5993('0xf'),_0xc284e6,JSON[_0x5993('0x22')](_0x306814));})[_0x5993('0x23')](function(){logger[_0x5993('0xe')](_0x5993('0x24'),_0xc284e6);_0x44c8df[_0x5993('0x25')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0xc284e6);_0x44c8df[_0x5993('0x25')]();}}else{var _0x35249d=this;var _0x436e85=new AWS[(_0x5993('0x26'))]({'accessKeyId':_0x3a99bb[0x0],'secretAccessKey':_0x3a99bb[0x1],'region':_0x3a99bb[0x2]});var _0x536693={'botAlias':_0x5993('0x27'),'botName':_0x3a99bb[0x3],'inputText':this['message'][_0x5993('0x1f')],'userId':this['channel']+':'+this[_0x5993('0xc')]['id'][_0x5993('0x28')]()};_0x436e85[_0x5993('0x29')](_0x536693,function(_0x51b391,_0x2eb28c){if(_0x51b391){logger[_0x5993('0x2a')](_0x5993('0xf'),_0xc284e6,_0x51b391[_0x5993('0x2b')]);_0x44c8df['next']();}else if(_0x2eb28c&&_0x2eb28c[_0x5993('0x2b')]){_0x35249d['body'][_0x5993('0x2c')]=_0x2eb28c;_0x2d6ce0[_0x5993('0x1f')]=_0x2eb28c['message'];_0x2d6ce0[_0x5993('0x2d')]=_0x5993('0x2c');_0x2d6ce0[_0x5993('0x2e')]=JSON[_0x5993('0x22')](_0x2eb28c);return rpc[_0x48eeb0+_0x5993('0x2f')][_0x5993('0x20')](_0x2d6ce0)[_0x5993('0x21')](function(_0x3381b2){logger['info'](_0x5993('0xf'),_0xc284e6,_0x2d6ce0['body']);if(_0x2eb28c['dialogState']==_0x5993('0x30')){_0x44c8df[_0x5993('0x11')]();}else{_0x44c8df[_0x5993('0x25')]();}})[_0x5993('0x31')](function(_0x7be1ba){logger[_0x5993('0x2a')](_0x5993('0xf'),_0xc284e6,JSON[_0x5993('0x22')](_0x7be1ba));_0x44c8df[_0x5993('0x11')]();});}else{_0x44c8df['next']();}});}}catch(_0x15aa2e){logger['error']('[%s][AMAZONLEX]\x20%s',_0xc284e6,JSON[_0x5993('0x22')](_0x15aa2e));_0x44c8df['stop']();}};}; \ 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 7018954..77e23d1 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 _0xc9b1=['Re:\x20','chat','account','upperFirst','AccountId','Message','service','Smtp','host','port','secure','authentication','auth','pass','inReplyTo','messageId','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','error','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','message','from','phone','subject','startsWith','Re:'];(function(_0x39df50,_0x158c04){var _0x1714e6=function(_0x3ca344){while(--_0x3ca344){_0x39df50['push'](_0x39df50['shift']());}};_0x1714e6(++_0x158c04);}(_0xc9b1,0x76));var _0x1c9b=function(_0x15d339,_0x31b4e4){_0x15d339=_0x15d339-0x0;var _0x589f9c=_0xc9b1[_0x15d339];return _0x589f9c;};'use strict';var _=require(_0x1c9b('0x0'));var moment=require(_0x1c9b('0x1'));var utils=require(_0x1c9b('0x2'));var logger=require(_0x1c9b('0x3'))(_0x1c9b('0x4'));var rpc={'chatMessage':require(_0x1c9b('0x5')),'openchannelMessage':require(_0x1c9b('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x1c9b('0x7')),'faxMessage':require(_0x1c9b('0x8')),'whatsappMessage':require(_0x1c9b('0x9')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x1c9b('0xa')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x1c9b('0xb')),'faxInteraction':require(_0x1c9b('0xc')),'whatsappInteraction':require(_0x1c9b('0xd'))};var mailRpc=require(_0x1c9b('0xe'));exports[_0x1c9b('0xf')]=function(_0x1aef7a,_0x33678e,_0x3c8e58,_0x105b2a){return function(_0x43cb62){try{var _0x1e255a=this['channel'];if(_0x1e255a===_0x1c9b('0x10')&&_0x105b2a[_0x1c9b('0x11')][_0x1c9b('0x12')]){logger[_0x1c9b('0x13')](_0x1c9b('0x14'),_0x1aef7a,_0x1c9b('0x15'));return _0x43cb62[_0x1c9b('0x16')]();}if(_0x33678e[0x0]==='1'&&(_[_0x1c9b('0x17')](this['interaction'][_0x1c9b('0x18')])||!this[_0x1c9b('0x19')][_0x1c9b('0x18')])){logger[_0x1c9b('0x13')]('[%s][AUTOREPLY]\x20%s',_0x1aef7a,_0x1c9b('0x1a'));return _0x43cb62[_0x1c9b('0x16')]();}if(_0x33678e[0x0]==='2'&&this[_0x1c9b('0x19')][_0x1c9b('0x1b')]){logger[_0x1c9b('0x13')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1aef7a,_0x1c9b('0x1c'));return _0x43cb62[_0x1c9b('0x16')]();}var _0x5d1106={'ContactId':this['contact']['id'],'sentAt':moment()[_0x1c9b('0x1d')](_0x1c9b('0x1e')),'direction':_0x1c9b('0x1f')};if(this[_0x1c9b('0x20')]===_0x1c9b('0x10')){_0x5d1106[_0x1c9b('0x11')]=utils['getMustacheRender'](_0x33678e[0x2],this);}else{_0x5d1106[_0x1c9b('0x11')]=utils[_0x1c9b('0x21')](_0x33678e[0x1],this);}if(this[_0x1c9b('0x22')]){_0x5d1106['to']=this[_0x1c9b('0x22')][_0x1c9b('0x23')]||'';if(this[_0x1c9b('0x20')]===_0x1c9b('0x10')&&_0x33678e[0x1]==='1'){_0x5d1106['cc']=this[_0x1c9b('0x22')]['cc']||'';}_0x5d1106[_0x1c9b('0x23')]=this['message']['to']||'';_0x5d1106[_0x1c9b('0x24')]=this['message'][_0x1c9b('0x24')]||'';_0x5d1106['read']=!![];if(this[_0x1c9b('0x22')][_0x1c9b('0x25')]){_0x5d1106[_0x1c9b('0x25')]='';_0x5d1106['subject']+=_[_0x1c9b('0x26')](this[_0x1c9b('0x22')][_0x1c9b('0x25')],_0x1c9b('0x27'))?'':_0x1c9b('0x28');_0x5d1106[_0x1c9b('0x25')]+=this[_0x1c9b('0x22')]['subject'];}}if(this[_0x1c9b('0x20')]===_0x1c9b('0x29')){_0x5d1106['ChatWebsiteId']=this[_0x1c9b('0x2a')]['id'];}else{_0x5d1106[_[_0x1c9b('0x2b')](this[_0x1c9b('0x20')])+_0x1c9b('0x2c')]=this[_0x1c9b('0x2a')]['id'];}_0x5d1106[_[_0x1c9b('0x2b')](this[_0x1c9b('0x20')])+'InteractionId']=this[_0x1c9b('0x19')]['id'];var _0x78bc9=this[_0x1c9b('0x19')];if(rpc[this[_0x1c9b('0x20')]+_0x1c9b('0x2d')]){if(this[_0x1c9b('0x20')]==='mail'){var _0x4ecb3f={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp']['service']){_0x4ecb3f[_0x1c9b('0x2e')]=this[_0x1c9b('0x2a')][_0x1c9b('0x2f')]['service'];}else{_0x4ecb3f[_0x1c9b('0x30')]=this[_0x1c9b('0x2a')][_0x1c9b('0x2f')][_0x1c9b('0x30')];_0x4ecb3f[_0x1c9b('0x31')]=this[_0x1c9b('0x2a')]['Smtp'][_0x1c9b('0x31')];_0x4ecb3f[_0x1c9b('0x32')]=this[_0x1c9b('0x2a')][_0x1c9b('0x2f')][_0x1c9b('0x32')];}if(this[_0x1c9b('0x2a')]['Smtp'][_0x1c9b('0x33')]){_0x4ecb3f[_0x1c9b('0x34')]={'user':this[_0x1c9b('0x2a')][_0x1c9b('0x2f')]['user'],'pass':this[_0x1c9b('0x2a')][_0x1c9b('0x2f')][_0x1c9b('0x35')]};}_0x5d1106[_0x1c9b('0x36')]=this[_0x1c9b('0x22')][_0x1c9b('0x37')];_0x5d1106['html']=_0x1c9b('0x38')+_[_0x1c9b('0x39')](_0x5d1106['body'],_0x1c9b('0x3a'),'','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','update','stringify','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','autoreplyExecuted','Interaction','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','interaction','created','Autoreply\x20already\x20sent','next','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','from','phone','message','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst'];(function(_0x4344a2,_0x4798ee){var _0x3dc2cb=function(_0x1a127d){while(--_0x1a127d){_0x4344a2['push'](_0x4344a2['shift']());}};_0x3dc2cb(++_0x4798ee);}(_0xbba0,0x10b));var _0x0bba=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xbba0[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x0bba('0x0'));var moment=require(_0x0bba('0x1'));var utils=require(_0x0bba('0x2'));var logger=require(_0x0bba('0x3'))(_0x0bba('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x0bba('0x5')),'smsMessage':require(_0x0bba('0x6')),'faxMessage':require(_0x0bba('0x7')),'whatsappMessage':require(_0x0bba('0x8')),'chatInteraction':require(_0x0bba('0x9')),'openchannelInteraction':require(_0x0bba('0xa')),'mailInteraction':require(_0x0bba('0xb')),'smsInteraction':require(_0x0bba('0xc')),'faxInteraction':require(_0x0bba('0xd')),'whatsappInteraction':require(_0x0bba('0xe'))};var mailRpc=require('../../mailRpc');exports[_0x0bba('0xf')]=function(_0x34d0c5,_0x57937d,_0x1b7e69,_0x4f41d2){return function(_0x1a8521){try{var _0x1d96e0=this['channel'];if(_0x1d96e0===_0x0bba('0x10')&&_0x4f41d2[_0x0bba('0x11')][_0x0bba('0x12')]){logger[_0x0bba('0x13')](_0x0bba('0x14'),_0x34d0c5,_0x0bba('0x15'));return _0x1a8521['next']();}if(_0x57937d[0x0]==='1'&&(_['isNil'](this[_0x0bba('0x16')]['created'])||!this[_0x0bba('0x16')][_0x0bba('0x17')])){logger[_0x0bba('0x13')](_0x0bba('0x14'),_0x34d0c5,_0x0bba('0x18'));return _0x1a8521[_0x0bba('0x19')]();}if(_0x57937d[0x0]==='2'&&this['interaction']['autoreplyExecuted']){logger[_0x0bba('0x13')](_0x0bba('0x1a'),_0x34d0c5,_0x0bba('0x1b'));return _0x1a8521[_0x0bba('0x19')]();}var _0x3fc28b={'ContactId':this['contact']['id'],'sentAt':moment()[_0x0bba('0x1c')](_0x0bba('0x1d')),'direction':_0x0bba('0x1e')};if(this[_0x0bba('0x1f')]===_0x0bba('0x10')){_0x3fc28b[_0x0bba('0x11')]=utils[_0x0bba('0x20')](_0x57937d[0x2],this);}else{_0x3fc28b[_0x0bba('0x11')]=utils[_0x0bba('0x20')](_0x57937d[0x1],this);}if(this['message']){_0x3fc28b['to']=this['message'][_0x0bba('0x21')]||'';if(this[_0x0bba('0x1f')]===_0x0bba('0x10')&&_0x57937d[0x1]==='1'){_0x3fc28b['cc']=this['message']['cc']||'';}_0x3fc28b['from']=this['message']['to']||'';_0x3fc28b[_0x0bba('0x22')]=this[_0x0bba('0x23')]['phone']||'';_0x3fc28b[_0x0bba('0x24')]=!![];if(this[_0x0bba('0x23')]['subject']){_0x3fc28b[_0x0bba('0x25')]='';_0x3fc28b['subject']+=_[_0x0bba('0x26')](this[_0x0bba('0x23')][_0x0bba('0x25')],_0x0bba('0x27'))?'':_0x0bba('0x28');_0x3fc28b[_0x0bba('0x25')]+=this[_0x0bba('0x23')]['subject'];}}if(this['channel']===_0x0bba('0x29')){_0x3fc28b[_0x0bba('0x2a')]=this[_0x0bba('0x2b')]['id'];}else{_0x3fc28b[_[_0x0bba('0x2c')](this[_0x0bba('0x1f')])+'AccountId']=this[_0x0bba('0x2b')]['id'];}_0x3fc28b[_[_0x0bba('0x2c')](this[_0x0bba('0x1f')])+_0x0bba('0x2d')]=this[_0x0bba('0x16')]['id'];var _0x52bed9=this[_0x0bba('0x16')];if(rpc[this[_0x0bba('0x1f')]+_0x0bba('0x2e')]){if(this[_0x0bba('0x1f')]===_0x0bba('0x10')){var _0x50df2e={'tls':{'rejectUnauthorized':![]}};if(this[_0x0bba('0x2b')][_0x0bba('0x2f')][_0x0bba('0x30')]){_0x50df2e['service']=this[_0x0bba('0x2b')][_0x0bba('0x2f')][_0x0bba('0x30')];}else{_0x50df2e[_0x0bba('0x31')]=this['account'][_0x0bba('0x2f')]['host'];_0x50df2e[_0x0bba('0x32')]=this['account']['Smtp'][_0x0bba('0x32')];_0x50df2e[_0x0bba('0x33')]=this[_0x0bba('0x2b')][_0x0bba('0x2f')]['secure'];}if(this[_0x0bba('0x2b')]['Smtp'][_0x0bba('0x34')]){_0x50df2e[_0x0bba('0x35')]={'user':this[_0x0bba('0x2b')][_0x0bba('0x2f')][_0x0bba('0x36')],'pass':this[_0x0bba('0x2b')][_0x0bba('0x2f')]['pass']};}_0x3fc28b[_0x0bba('0x37')]=this[_0x0bba('0x23')][_0x0bba('0x38')];_0x3fc28b[_0x0bba('0x39')]=''+_[_0x0bba('0x3a')](_0x3fc28b['body'],_0x0bba('0x3b'),_0x0bba('0x3c'))+_0x0bba('0x3d');_0x3fc28b['headers']={'Auto-Submitted':_0x0bba('0x3e'),'X-Auto-Response-Suppress':_0x0bba('0x3f'),'Precedence':_0x0bba('0x40')};return mailRpc[_0x0bba('0x41')](_0x50df2e,_0x3fc28b)[_0x0bba('0x42')](function(_0x4428ca){logger[_0x0bba('0x13')](_0x0bba('0x43'),_0x34d0c5);_0x3fc28b[_0x0bba('0x38')]=_0x4428ca[_0x0bba('0x23')][_0x0bba('0x38')];return rpc[_0x1d96e0+_0x0bba('0x2e')]['create'](_0x3fc28b);})['then'](function(_0x458de6){logger[_0x0bba('0x13')]('[%s][AUTOREPLY]\x20%s',_0x34d0c5,JSON['stringify'](_0x458de6));})[_0x0bba('0x44')](function(_0x3d4fb5){logger[_0x0bba('0x45')](_0x0bba('0x46'),_0x34d0c5,JSON['stringify'](_0x3d4fb5));})[_0x0bba('0x47')](function(){Promise[_0x0bba('0x48')]()[_0x0bba('0x42')](function(){if(_0x57937d[0x0]!=='2'||_0x52bed9['autoreplyExecuted'])return;return rpc[_0x1d96e0+'Interaction'][_0x0bba('0x49')](_0x52bed9['id'],{'autoreplyExecuted':!![]})[_0x0bba('0x42')](function(_0x519309){logger['info'](_0x0bba('0x1a'),_0x34d0c5,JSON[_0x0bba('0x4a')](_0x519309));})[_0x0bba('0x44')](function(_0x428d41){logger[_0x0bba('0x45')](_0x0bba('0x4b'),_0x34d0c5,JSON[_0x0bba('0x4a')](_0x428d41));});})[_0x0bba('0x42')](function(){_0x1a8521[_0x0bba('0x19')]();});});}else{return rpc[this[_0x0bba('0x1f')]+'Message']['create'](_0x3fc28b)[_0x0bba('0x42')](function(_0x3efc9e){logger[_0x0bba('0x13')]('[%s][AUTOREPLY]\x20%s',_0x34d0c5,_0x3fc28b[_0x0bba('0x11')]);})[_0x0bba('0x44')](function(_0x3e61ed){logger[_0x0bba('0x45')](_0x0bba('0x14'),_0x34d0c5,JSON[_0x0bba('0x4a')](_0x3e61ed));})['finally'](function(){Promise['resolve']()[_0x0bba('0x42')](function(){if(_0x57937d[0x0]!=='2'||_0x52bed9[_0x0bba('0x4c')])return;return rpc[_0x1d96e0+_0x0bba('0x4d')][_0x0bba('0x49')](_0x52bed9['id'],{'autoreplyExecuted':!![]})[_0x0bba('0x42')](function(_0x335e80){logger[_0x0bba('0x13')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x34d0c5,JSON[_0x0bba('0x4a')](_0x335e80));})['catch'](function(_0x1e1d85){logger['error'](_0x0bba('0x4b'),_0x34d0c5,JSON['stringify'](_0x1e1d85));});})['then'](function(){_0x1a8521['next']();});});}}}catch(_0x32497f){logger[_0x0bba('0x45')](_0x0bba('0x14'),_0x34d0c5,JSON['stringify'](_0x32497f));_0x1a8521['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 732f34e..8ecc650 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f26=['routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f26,0x1e1));var _0x63f2=function(_0x37849e,_0x323ebd){_0x37849e=_0x37849e-0x0;var _0xa1878a=_0x3f26[_0x37849e];return _0xa1878a;};'use strict';var moment=require(_0x63f2('0x0'));var logger=require(_0x63f2('0x1'))(_0x63f2('0x2'));var rpc={'chatInteraction':require(_0x63f2('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x63f2('0x4')),'mailInteraction':require(_0x63f2('0x5')),'faxInteraction':require(_0x63f2('0x6')),'whatsappInteraction':require(_0x63f2('0x7'))};exports['consequence']=function(_0xa6ccc6,_0x55f6f3,_0xc87455,_0x4c0621){return function(_0x560020){try{logger[_0x63f2('0x8')](_0x63f2('0x9'),_0xa6ccc6,_0x55f6f3[0x0]);var _0x93f352={'closed':0x1,'closedAt':moment()['format'](_0x63f2('0xa')),'closeReason':_0x63f2('0xb'),'disposition':_0x55f6f3[0x0]};if(rpc[_0x4c0621[_0x63f2('0xc')]+_0x63f2('0xd')]){rpc[_0x4c0621[_0x63f2('0xc')]+'Interaction']['update'](_0x4c0621[_0x63f2('0xe')]['id'],_0x93f352)[_0x63f2('0xf')](function(_0x2555b5){logger['info'](_0x63f2('0x10'),_0xa6ccc6,_0x4c0621[_0x63f2('0xe')]['id']);})[_0x63f2('0x11')](function(_0x3427d4){logger[_0x63f2('0x12')](_0x63f2('0x13'),_0xa6ccc6,JSON[_0x63f2('0x14')](_0x3427d4));})[_0x63f2('0x15')](function(){_0x560020['stop']();});}}catch(_0x63985b){logger['error'](_0x63f2('0x13'),_0xa6ccc6,JSON[_0x63f2('0x14')](_0x63985b));_0x560020[_0x63f2('0x16')]();}};}; \ No newline at end of file +var _0x0c48=['error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!'];(function(_0x11144e,_0x48498f){var _0x59e9fa=function(_0x525a43){while(--_0x525a43){_0x11144e['push'](_0x11144e['shift']());}};_0x59e9fa(++_0x48498f);}(_0x0c48,0x16a));var _0x80c4=function(_0x2a4095,_0x13f4f0){_0x2a4095=_0x2a4095-0x0;var _0x52eeab=_0x0c48[_0x2a4095];return _0x52eeab;};'use strict';var moment=require(_0x80c4('0x0'));var logger=require('../../../../config/logger')(_0x80c4('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x80c4('0x2')),'smsInteraction':require(_0x80c4('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x80c4('0x4')),'whatsappInteraction':require(_0x80c4('0x5'))};exports['consequence']=function(_0x1478b2,_0x815bcc,_0x1b0177,_0x2f594e){return function(_0x11207f){try{logger['info'](_0x80c4('0x6'),_0x1478b2,_0x815bcc[0x0]);var _0x3d9f4f={'closed':0x1,'closedAt':moment()[_0x80c4('0x7')](_0x80c4('0x8')),'closeReason':_0x80c4('0x9'),'disposition':_0x815bcc[0x0]};if(rpc[_0x2f594e[_0x80c4('0xa')]+'Interaction']){rpc[_0x2f594e[_0x80c4('0xa')]+_0x80c4('0xb')]['update'](_0x2f594e[_0x80c4('0xc')]['id'],_0x3d9f4f)[_0x80c4('0xd')](function(_0x526ae4){logger[_0x80c4('0xe')](_0x80c4('0xf'),_0x1478b2,_0x2f594e[_0x80c4('0xc')]['id']);})['catch'](function(_0x4a8fef){logger[_0x80c4('0x10')](_0x80c4('0x11'),_0x1478b2,JSON[_0x80c4('0x12')](_0x4a8fef));})[_0x80c4('0x13')](function(){_0x11207f[_0x80c4('0x14')]();});}}catch(_0x5ee1e4){logger[_0x80c4('0x10')](_0x80c4('0x11'),_0x1478b2,JSON[_0x80c4('0x12')](_0x5ee1e4));_0x11207f[_0x80c4('0x14')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index f748302..4ddedb7 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cff=['info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','create','then','catch','error','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','fulfillment','providerResponse','Message','result','metadata','endConversation','stringify','lodash','moment','md5','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction'];(function(_0x4f280f,_0x2c8f5e){var _0x3376a2=function(_0xe8a6c9){while(--_0xe8a6c9){_0x4f280f['push'](_0x4f280f['shift']());}};_0x3376a2(++_0x2c8f5e);}(_0x4cff,0x14a));var _0xf4cf=function(_0x3faf55,_0xf5947c){_0x3faf55=_0x3faf55-0x0;var _0x161e7c=_0x4cff[_0x3faf55];return _0x161e7c;};'use strict';var _=require(_0xf4cf('0x0'));var moment=require(_0xf4cf('0x1'));var apiai=require('apiai-promise');var md5=require(_0xf4cf('0x2'));var utils=require('./utils');var logger=require(_0xf4cf('0x3'))(_0xf4cf('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xf4cf('0x5')),'mailMessage':require(_0xf4cf('0x6')),'smsMessage':require(_0xf4cf('0x7')),'faxMessage':require(_0xf4cf('0x8')),'whatsappMessage':require(_0xf4cf('0x9'))};exports[_0xf4cf('0xa')]=function(_0x53a3e6,_0x25d0cf){return function(_0x125a37){try{if(!_[_0xf4cf('0xb')](this[_0xf4cf('0xc')]['UserId'])){logger[_0xf4cf('0xd')](_0xf4cf('0xe'),_0x53a3e6,_0xf4cf('0xf'));return _0x125a37[_0xf4cf('0x10')]();}var _0x520c03={'ContactId':this[_0xf4cf('0x11')]['id'],'sentAt':moment()[_0xf4cf('0x12')](_0xf4cf('0x13')),'direction':_0xf4cf('0x14')};if(this['channel']==='sms'||this[_0xf4cf('0x15')]==='whatsapp'){_0x520c03['phone']=this['interaction'][_0xf4cf('0x16')];}var _0x3e6f30=this[_0xf4cf('0x15')];if(_0x3e6f30===_0xf4cf('0x17')){_0x520c03[_0xf4cf('0x18')]=this[_0xf4cf('0x19')]['id'];}else{_0x520c03[_[_0xf4cf('0x1a')](_0x3e6f30)+_0xf4cf('0x1b')]=this[_0xf4cf('0x19')]['id'];}_0x520c03[_[_0xf4cf('0x1a')](_0x3e6f30)+'InteractionId']=this[_0xf4cf('0xc')]['id'];if(this[_0xf4cf('0xc')][_0xf4cf('0x1c')]){var _0x1ac34a=_0x25d0cf[0x2];if(!_[_0xf4cf('0x1d')](_0x1ac34a)){_0x520c03[_0xf4cf('0x1e')]=utils[_0xf4cf('0x1f')](_0x1ac34a,this);return rpc[_0x3e6f30+'Message'][_0xf4cf('0x20')](_0x520c03)[_0xf4cf('0x21')](function(_0x329347){logger['info'](_0xf4cf('0xe'),_0x53a3e6,_0x520c03['body']);})[_0xf4cf('0x22')](function(_0x5d2a81){logger[_0xf4cf('0x23')]('[%s][DIALOGFLOW]\x20%s',_0x53a3e6,JSON['stringify'](_0x5d2a81));})['finally'](function(){logger[_0xf4cf('0xd')](_0xf4cf('0x24'),_0x53a3e6);_0x125a37[_0xf4cf('0x25')]();});}else{logger[_0xf4cf('0xd')](_0xf4cf('0x26'),_0x53a3e6);_0x125a37[_0xf4cf('0x25')]();}}else{var _0x1ca3d5=this;var _0x571eee=apiai(_0x25d0cf[0x0],{'language':_0x25d0cf[0x1]||'en'});return _0x571eee[_0xf4cf('0x27')](this[_0xf4cf('0x28')][_0xf4cf('0x1e')],{'sessionId':md5(this[_0xf4cf('0xc')]['id'])})[_0xf4cf('0x21')](function(_0x2bd35d){_0x1ca3d5['body'][_0xf4cf('0x29')]=_0x2bd35d;_0x520c03[_0xf4cf('0x1e')]=_0x2bd35d['result'][_0xf4cf('0x2a')]['speech'];_0x520c03['providerName']=_0xf4cf('0x29');_0x520c03[_0xf4cf('0x2b')]=JSON['stringify'](_0x2bd35d);return rpc[_0x3e6f30+_0xf4cf('0x2c')]['create'](_0x520c03)[_0xf4cf('0x21')](function(_0x2eb695){logger[_0xf4cf('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x53a3e6,_0x520c03['body']);if(_0x2bd35d[_0xf4cf('0x2d')][_0xf4cf('0x2e')][_0xf4cf('0x2f')]){_0x125a37[_0xf4cf('0x10')]();}else{_0x125a37[_0xf4cf('0x25')]();}})[_0xf4cf('0x22')](function(_0xa90899){logger['error'](_0xf4cf('0xe'),_0x53a3e6,JSON[_0xf4cf('0x30')](_0xa90899));_0x125a37[_0xf4cf('0x10')]();});})[_0xf4cf('0x22')](function(_0x33b5c2){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x53a3e6,_0x33b5c2[_0xf4cf('0x28')]);_0x125a37[_0xf4cf('0x10')]();});}}catch(_0x191c25){logger[_0xf4cf('0x23')](_0xf4cf('0xe'),_0x53a3e6,JSON[_0xf4cf('0x30')](_0x191c25));_0x125a37[_0xf4cf('0x25')]();}};}; \ No newline at end of file +var _0x5a5a=['speech','providerResponse','metadata','endConversation','error','stringify','moment','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','finally','info','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','dialogflow','result'];(function(_0x381df6,_0x190833){var _0x26be31=function(_0x57bc43){while(--_0x57bc43){_0x381df6['push'](_0x381df6['shift']());}};_0x26be31(++_0x190833);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0xa30527,_0x331991){_0xa30527=_0xa30527-0x0;var _0xf40364=_0x5a5a[_0xa30527];return _0xf40364;};'use strict';var _=require('lodash');var moment=require(_0xa5a5('0x0'));var apiai=require(_0xa5a5('0x1'));var md5=require(_0xa5a5('0x2'));var utils=require(_0xa5a5('0x3'));var logger=require(_0xa5a5('0x4'))('routing');var rpc={'chatMessage':require(_0xa5a5('0x5')),'openchannelMessage':require(_0xa5a5('0x6')),'mailMessage':require(_0xa5a5('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xa5a5('0x8'))};exports[_0xa5a5('0x9')]=function(_0x5691f1,_0x3ea00f){return function(_0xf2ea20){try{if(!_[_0xa5a5('0xa')](this[_0xa5a5('0xb')][_0xa5a5('0xc')])){logger['info'](_0xa5a5('0xd'),_0x5691f1,_0xa5a5('0xe'));return _0xf2ea20[_0xa5a5('0xf')]();}var _0x2dace1={'ContactId':this[_0xa5a5('0x10')]['id'],'sentAt':moment()[_0xa5a5('0x11')](_0xa5a5('0x12')),'direction':_0xa5a5('0x13')};if(this[_0xa5a5('0x14')]===_0xa5a5('0x15')||this[_0xa5a5('0x14')]===_0xa5a5('0x16')){_0x2dace1['phone']=this[_0xa5a5('0xb')][_0xa5a5('0x17')];}var _0x3917b1=this[_0xa5a5('0x14')];if(_0x3917b1===_0xa5a5('0x18')){_0x2dace1[_0xa5a5('0x19')]=this['account']['id'];}else{_0x2dace1[_[_0xa5a5('0x1a')](_0x3917b1)+_0xa5a5('0x1b')]=this[_0xa5a5('0x1c')]['id'];}_0x2dace1[_[_0xa5a5('0x1a')](_0x3917b1)+_0xa5a5('0x1d')]=this[_0xa5a5('0xb')]['id'];if(this[_0xa5a5('0xb')][_0xa5a5('0x1e')]){var _0x48d369=_0x3ea00f[0x2];if(!_[_0xa5a5('0x1f')](_0x48d369)){_0x2dace1[_0xa5a5('0x20')]=utils[_0xa5a5('0x21')](_0x48d369,this);return rpc[_0x3917b1+_0xa5a5('0x22')][_0xa5a5('0x23')](_0x2dace1)[_0xa5a5('0x24')](function(_0x28c89f){logger['info'](_0xa5a5('0xd'),_0x5691f1,_0x2dace1[_0xa5a5('0x20')]);})[_0xa5a5('0x25')](function(_0x3776cb){logger['error'](_0xa5a5('0xd'),_0x5691f1,JSON['stringify'](_0x3776cb));})[_0xa5a5('0x26')](function(){logger[_0xa5a5('0x27')](_0xa5a5('0x28'),_0x5691f1);_0xf2ea20[_0xa5a5('0x29')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x5691f1);_0xf2ea20[_0xa5a5('0x29')]();}}else{var _0x1a258f=this;var _0x417df3=apiai(_0x3ea00f[0x0],{'language':_0x3ea00f[0x1]||'en'});return _0x417df3['textRequest'](this[_0xa5a5('0x2a')]['body'],{'sessionId':md5(this[_0xa5a5('0xb')]['id'])})['then'](function(_0x4c0ff2){_0x1a258f[_0xa5a5('0x20')][_0xa5a5('0x2b')]=_0x4c0ff2;_0x2dace1[_0xa5a5('0x20')]=_0x4c0ff2[_0xa5a5('0x2c')]['fulfillment'][_0xa5a5('0x2d')];_0x2dace1['providerName']=_0xa5a5('0x2b');_0x2dace1[_0xa5a5('0x2e')]=JSON['stringify'](_0x4c0ff2);return rpc[_0x3917b1+'Message'][_0xa5a5('0x23')](_0x2dace1)[_0xa5a5('0x24')](function(_0x47992c){logger['info'](_0xa5a5('0xd'),_0x5691f1,_0x2dace1[_0xa5a5('0x20')]);if(_0x4c0ff2[_0xa5a5('0x2c')][_0xa5a5('0x2f')][_0xa5a5('0x30')]){_0xf2ea20[_0xa5a5('0xf')]();}else{_0xf2ea20['stop']();}})[_0xa5a5('0x25')](function(_0x4d1eef){logger[_0xa5a5('0x31')]('[%s][DIALOGFLOW]\x20%s',_0x5691f1,JSON[_0xa5a5('0x32')](_0x4d1eef));_0xf2ea20[_0xa5a5('0xf')]();});})['catch'](function(_0x47ed1d){logger['error'](_0xa5a5('0xd'),_0x5691f1,_0x47ed1d['message']);_0xf2ea20[_0xa5a5('0xf')]();});}}catch(_0x378dda){logger['error'](_0xa5a5('0xd'),_0x5691f1,JSON[_0xa5a5('0x32')](_0x378dda));_0xf2ea20['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 1e42ded..f0999f0 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x844b=['md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','stringify','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','account','InteractionId','created','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','sessionPath','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ENDCONVERSATION','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerName','providerResponse','fulfillmentText','all','lodash'];(function(_0x2480be,_0x590716){var _0x4fad22=function(_0x50512b){while(--_0x50512b){_0x2480be['push'](_0x2480be['shift']());}};_0x4fad22(++_0x590716);}(_0x844b,0x1cd));var _0xb844=function(_0x58d5ac,_0x11c4bc){_0x58d5ac=_0x58d5ac-0x0;var _0x37985c=_0x844b[_0x58d5ac];return _0x37985c;};'use strict';var _=require(_0xb844('0x0'));var dialogflow=require('dialogflow');var md5=require(_0xb844('0x1'));var moment=require(_0xb844('0x2'));var Promise=require(_0xb844('0x3'));var logger=require(_0xb844('0x4'))(_0xb844('0x5'));var utils=require(_0xb844('0x6'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xb844('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xb844('0x8')),'whatsappMessage':require(_0xb844('0x9'))};function createMessage(_0x24966d,_0x58e722,_0x4579fc,_0x585a4d){return new Promise(function(_0x4f103d,_0x2736a4){var _0x3305cb=_['clone'](_0x4579fc);_0x3305cb['body']=_0x585a4d;return rpc[_0x58e722+_0xb844('0xa')][_0xb844('0xb')](_0x3305cb)[_0xb844('0xc')](function(){logger[_0xb844('0xd')](_0xb844('0xe'),_0x24966d,_0x3305cb[_0xb844('0xf')]);_0x4f103d();})[_0xb844('0x10')](function(_0x3a2c34){logger[_0xb844('0x11')](_0xb844('0xe'),_0x24966d,JSON[_0xb844('0x12')](_0x3a2c34));_0x2736a4(_0x3a2c34);});});}exports['consequence']=function(_0x2d8549,_0x41a8aa){return function(_0x22ae7a){try{if(!_[_0xb844('0x13')](this[_0xb844('0x14')][_0xb844('0x15')])){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x2d8549,_0xb844('0x16'));return _0x22ae7a[_0xb844('0x17')]();}var _0x243dc5={'ContactId':this[_0xb844('0x18')]['id'],'sentAt':moment()[_0xb844('0x19')](_0xb844('0x1a')),'direction':_0xb844('0x1b')};if(this[_0xb844('0x1c')]===_0xb844('0x1d')||this[_0xb844('0x1c')]==='whatsapp'){_0x243dc5[_0xb844('0x1e')]=this[_0xb844('0x14')]['phone'];}var _0x1ef82e=this[_0xb844('0x1c')];if(_0x1ef82e==='chat'){_0x243dc5['ChatWebsiteId']=this['account']['id'];}else{_0x243dc5[_['upperFirst'](_0x1ef82e)+'AccountId']=this[_0xb844('0x1f')]['id'];}_0x243dc5[_['upperFirst'](_0x1ef82e)+_0xb844('0x20')]=this[_0xb844('0x14')]['id'];if(this[_0xb844('0x14')][_0xb844('0x21')]){var _0x16d396=_0x41a8aa[0x4];if(!_['isEmpty'](_0x16d396)){_0x243dc5[_0xb844('0xf')]=utils[_0xb844('0x22')](_0x16d396,this);return rpc[_0x1ef82e+_0xb844('0xa')][_0xb844('0xb')](_0x243dc5)['then'](function(_0x4f5573){logger['info'](_0xb844('0xe'),_0x2d8549,_0x243dc5[_0xb844('0xf')]);})[_0xb844('0x10')](function(_0x13ef11){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x2d8549,JSON[_0xb844('0x12')](_0x13ef11));})[_0xb844('0x23')](function(){logger[_0xb844('0xd')](_0xb844('0x24'),_0x2d8549);_0x22ae7a['stop']();});}else{logger[_0xb844('0xd')](_0xb844('0x25'),_0x2d8549);_0x22ae7a[_0xb844('0x26')]();}}else{var _0x6bde8e=this;var _0x37fcec=_0x41a8aa[0x2][_0xb844('0x27')](/\\n/g,'\x0a');var _0x25a4b3={'credentials':{'private_key':_0x37fcec,'client_email':_0x41a8aa[0x1]}};var _0x24558f=new dialogflow[(_0xb844('0x28'))](_0x25a4b3);var _0x2554ad=_0x24558f[_0xb844('0x29')](_0x41a8aa[0x0],md5(_0x6bde8e[_0xb844('0x14')]['id']));var _0x1530ee={'session':_0x2554ad,'queryInput':{'text':{'text':_0x6bde8e['message'][_0xb844('0xf')],'languageCode':_0x41a8aa[0x3]||'en'}}};return _0x24558f[_0xb844('0x2a')](_0x1530ee)[_0xb844('0xc')](function(_0x396bbf){if(_0x396bbf&&_0x396bbf[_0xb844('0x2b')]){_0x6bde8e[_0xb844('0xf')][_0xb844('0x2c')]=_0x396bbf;var _0x32f7cb=_0x396bbf[0x0];var _0x3dcdca=_0x32f7cb[_0xb844('0x2d')][_0xb844('0x2e')]&&_0x32f7cb[_0xb844('0x2d')][_0xb844('0x2e')][_0xb844('0x2f')]?_0x32f7cb[_0xb844('0x2d')][_0xb844('0x2e')][_0xb844('0x2f')][_0xb844('0x30')][_0xb844('0x31')]:![];_0x6bde8e['body'][_0xb844('0x32')]=_0x32f7cb[_0xb844('0x2d')][_0xb844('0x33')];_0x6bde8e[_0xb844('0xf')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x32f7cb[_0xb844('0x2d')]['allRequiredParamsPresent'];_0x6bde8e[_0xb844('0xf')][_0xb844('0x34')]=_0x32f7cb['queryResult'][_0xb844('0x2e')]&&_0x32f7cb['queryResult'][_0xb844('0x2e')][_0xb844('0x2f')]?_0x32f7cb[_0xb844('0x2d')]['diagnosticInfo'][_0xb844('0x2f')][_0xb844('0x30')][_0xb844('0x31')]:![];_0x6bde8e[_0xb844('0xf')]['DIALOGFLOWV2_INTENTNAME']=_0x32f7cb[_0xb844('0x2d')]['intent'][_0xb844('0x35')];_0x6bde8e[_0xb844('0xf')][_0xb844('0x36')]=_0x32f7cb[_0xb844('0x2d')][_0xb844('0x37')]['displayName'];_0x6bde8e['body']['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x32f7cb[_0xb844('0x2d')]['intent'][_0xb844('0x38')];_0x6bde8e['body'][_0xb844('0x39')]=_0x32f7cb[_0xb844('0x2d')][_0xb844('0x3a')];_0x6bde8e[_0xb844('0xf')][_0xb844('0x3b')]=_0x32f7cb[_0xb844('0x2d')][_0xb844('0x3c')];_0x6bde8e['body'][_0xb844('0x3d')]=_0x32f7cb['queryResult']['intentDetectionConfidence'];_0x243dc5[_0xb844('0x3e')]='dialogflowV2';_0x243dc5[_0xb844('0x3f')]=JSON[_0xb844('0x12')](_0x396bbf);var _0x431a22=[];for(var _0x3e65c9=0x0;_0x3e65c9<_0x396bbf[_0xb844('0x2b')];_0x3e65c9++){var _0x2274ba=_0x396bbf[_0x3e65c9];if(_0x2274ba&&_0x2274ba['queryResult']&&_0x2274ba[_0xb844('0x2d')][_0xb844('0x40')]){_0x431a22['push'](createMessage(_0x2d8549,_0x1ef82e,_0x243dc5,_0x2274ba[_0xb844('0x2d')][_0xb844('0x40')]));}}return Promise[_0xb844('0x41')](_0x431a22)[_0xb844('0xc')](function(){if(_0x3dcdca){_0x22ae7a[_0xb844('0x17')]();}else{_0x22ae7a['stop']();}})[_0xb844('0x10')](function(_0x5f0475){logger['error'](_0xb844('0xe'),_0x2d8549,JSON['stringify'](_0x5f0475));_0x22ae7a[_0xb844('0x17')]();});}})[_0xb844('0x10')](function(_0xcfe52c){logger[_0xb844('0x11')](_0xb844('0xe'),_0x2d8549,_0xcfe52c['message']);_0x22ae7a[_0xb844('0x17')]();});}}catch(_0x30670a){logger[_0xb844('0x11')](_0xb844('0xe'),_0x2d8549,JSON[_0xb844('0x12')](_0x30670a));_0x22ae7a[_0xb844('0x26')]();}};}; \ No newline at end of file +var _0x2a2f=['DIALOGFLOWV2_ISFALLBACKINTENT','languageCode','providerResponse','fulfillmentText','all','stop','lodash','dialogflow','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','clone','body','Message','create','info','catch','error','[%s][DIALOGFLOWV2]\x20%s','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','InteractionId','getMustacheRender','then','stringify','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','fields','DIALOGFLOWV2_INTENTNAME','intent','name','displayName'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x2a2f,0x1c6));var _0xf2a2=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2a2f[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xf2a2('0x0'));var dialogflow=require(_0xf2a2('0x1'));var md5=require('md5');var moment=require('moment');var Promise=require(_0xf2a2('0x2'));var logger=require(_0xf2a2('0x3'))(_0xf2a2('0x4'));var utils=require(_0xf2a2('0x5'));var rpc={'chatMessage':require(_0xf2a2('0x6')),'openchannelMessage':require(_0xf2a2('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xf2a2('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x374313,_0x273acc,_0x3b1aa6,_0x4f4bda){return new Promise(function(_0x1aef52,_0x1da0db){var _0x1fdd71=_[_0xf2a2('0x9')](_0x3b1aa6);_0x1fdd71[_0xf2a2('0xa')]=_0x4f4bda;return rpc[_0x273acc+_0xf2a2('0xb')][_0xf2a2('0xc')](_0x1fdd71)['then'](function(){logger[_0xf2a2('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x374313,_0x1fdd71[_0xf2a2('0xa')]);_0x1aef52();})[_0xf2a2('0xe')](function(_0x1127b7){logger[_0xf2a2('0xf')](_0xf2a2('0x10'),_0x374313,JSON['stringify'](_0x1127b7));_0x1da0db(_0x1127b7);});});}exports['consequence']=function(_0x203596,_0x446286){return function(_0x4e0c8a){try{if(!_[_0xf2a2('0x11')](this['interaction'][_0xf2a2('0x12')])){logger[_0xf2a2('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x203596,_0xf2a2('0x13'));return _0x4e0c8a[_0xf2a2('0x14')]();}var _0x4e8e9a={'ContactId':this[_0xf2a2('0x15')]['id'],'sentAt':moment()[_0xf2a2('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xf2a2('0x17')};if(this[_0xf2a2('0x18')]===_0xf2a2('0x19')||this[_0xf2a2('0x18')]===_0xf2a2('0x1a')){_0x4e8e9a[_0xf2a2('0x1b')]=this[_0xf2a2('0x1c')][_0xf2a2('0x1b')];}var _0x2cd9a2=this[_0xf2a2('0x18')];if(_0x2cd9a2===_0xf2a2('0x1d')){_0x4e8e9a[_0xf2a2('0x1e')]=this[_0xf2a2('0x1f')]['id'];}else{_0x4e8e9a[_['upperFirst'](_0x2cd9a2)+'AccountId']=this[_0xf2a2('0x1f')]['id'];}_0x4e8e9a[_['upperFirst'](_0x2cd9a2)+_0xf2a2('0x20')]=this['interaction']['id'];if(this['interaction']['created']){var _0x518010=_0x446286[0x4];if(!_['isEmpty'](_0x518010)){_0x4e8e9a[_0xf2a2('0xa')]=utils[_0xf2a2('0x21')](_0x518010,this);return rpc[_0x2cd9a2+_0xf2a2('0xb')][_0xf2a2('0xc')](_0x4e8e9a)[_0xf2a2('0x22')](function(_0x590053){logger[_0xf2a2('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x203596,_0x4e8e9a['body']);})[_0xf2a2('0xe')](function(_0x464736){logger['error'](_0xf2a2('0x10'),_0x203596,JSON[_0xf2a2('0x23')](_0x464736));})[_0xf2a2('0x24')](function(){logger['info'](_0xf2a2('0x25'),_0x203596);_0x4e0c8a['stop']();});}else{logger[_0xf2a2('0xd')](_0xf2a2('0x26'),_0x203596);_0x4e0c8a['stop']();}}else{var _0x1f94aa=this;var _0x8bda7=_0x446286[0x2][_0xf2a2('0x27')](/\\n/g,'\x0a');var _0x44c732={'credentials':{'private_key':_0x8bda7,'client_email':_0x446286[0x1]}};var _0x3b37d8=new dialogflow[(_0xf2a2('0x28'))](_0x44c732);var _0x5663ef=_0x3b37d8['sessionPath'](_0x446286[0x0],md5(_0x1f94aa['interaction']['id']));var _0x342d80={'session':_0x5663ef,'queryInput':{'text':{'text':_0x1f94aa[_0xf2a2('0x29')][_0xf2a2('0xa')],'languageCode':_0x446286[0x3]||'en'}}};return _0x3b37d8[_0xf2a2('0x2a')](_0x342d80)[_0xf2a2('0x22')](function(_0x3084c5){if(_0x3084c5&&_0x3084c5[_0xf2a2('0x2b')]){_0x1f94aa[_0xf2a2('0xa')][_0xf2a2('0x2c')]=_0x3084c5;var _0x5305ba=_0x3084c5[0x0];var _0x14db27=_0x5305ba[_0xf2a2('0x2d')][_0xf2a2('0x2e')]&&_0x5305ba[_0xf2a2('0x2d')][_0xf2a2('0x2e')]['fields']?_0x5305ba[_0xf2a2('0x2d')][_0xf2a2('0x2e')]['fields'][_0xf2a2('0x2f')][_0xf2a2('0x30')]:![];_0x1f94aa['body'][_0xf2a2('0x31')]=_0x5305ba[_0xf2a2('0x2d')][_0xf2a2('0x32')];_0x1f94aa['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x5305ba[_0xf2a2('0x2d')][_0xf2a2('0x33')];_0x1f94aa[_0xf2a2('0xa')][_0xf2a2('0x34')]=_0x5305ba['queryResult'][_0xf2a2('0x2e')]&&_0x5305ba['queryResult'][_0xf2a2('0x2e')][_0xf2a2('0x35')]?_0x5305ba['queryResult'][_0xf2a2('0x2e')][_0xf2a2('0x35')][_0xf2a2('0x2f')]['boolValue']:![];_0x1f94aa[_0xf2a2('0xa')][_0xf2a2('0x36')]=_0x5305ba[_0xf2a2('0x2d')][_0xf2a2('0x37')][_0xf2a2('0x38')];_0x1f94aa[_0xf2a2('0xa')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x5305ba[_0xf2a2('0x2d')][_0xf2a2('0x37')][_0xf2a2('0x39')];_0x1f94aa['body'][_0xf2a2('0x3a')]=_0x5305ba['queryResult'][_0xf2a2('0x37')]['isFallback'];_0x1f94aa[_0xf2a2('0xa')]['DIALOGFLOWV2_LANGUAGECODE']=_0x5305ba[_0xf2a2('0x2d')][_0xf2a2('0x3b')];_0x1f94aa[_0xf2a2('0xa')]['DIALOGFLOWV2_QUERYTEXT']=_0x5305ba[_0xf2a2('0x2d')]['queryText'];_0x1f94aa[_0xf2a2('0xa')]['DIALOGFLOWV2_SCORE']=_0x5305ba[_0xf2a2('0x2d')]['intentDetectionConfidence'];_0x4e8e9a['providerName']='dialogflowV2';_0x4e8e9a[_0xf2a2('0x3c')]=JSON[_0xf2a2('0x23')](_0x3084c5);var _0x312ad7=[];for(var _0x167e88=0x0;_0x167e88<_0x3084c5[_0xf2a2('0x2b')];_0x167e88++){var _0x30df9c=_0x3084c5[_0x167e88];if(_0x30df9c&&_0x30df9c[_0xf2a2('0x2d')]&&_0x30df9c[_0xf2a2('0x2d')][_0xf2a2('0x3d')]){_0x312ad7['push'](createMessage(_0x203596,_0x2cd9a2,_0x4e8e9a,_0x30df9c[_0xf2a2('0x2d')]['fulfillmentText']));}}return Promise[_0xf2a2('0x3e')](_0x312ad7)[_0xf2a2('0x22')](function(){if(_0x14db27){_0x4e0c8a[_0xf2a2('0x14')]();}else{_0x4e0c8a[_0xf2a2('0x3f')]();}})['catch'](function(_0x1c6bb1){logger['error'](_0xf2a2('0x10'),_0x203596,JSON[_0xf2a2('0x23')](_0x1c6bb1));_0x4e0c8a[_0xf2a2('0x14')]();});}})[_0xf2a2('0xe')](function(_0x362253){logger[_0xf2a2('0xf')](_0xf2a2('0x10'),_0x203596,_0x362253[_0xf2a2('0x29')]);_0x4e0c8a[_0xf2a2('0x14')]();});}}catch(_0x22d4c6){logger[_0xf2a2('0xf')](_0xf2a2('0x10'),_0x203596,JSON[_0xf2a2('0x23')](_0x22d4c6));_0x4e0c8a[_0xf2a2('0x3f')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 6246aab..2fc28a0 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3ee=['condition','priorityTrue','priorityFalse','info','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xc3ee,0x12a));var _0xec3e=function(_0x15b0dc,_0x265bde){_0x15b0dc=_0x15b0dc-0x0;var _0x11476e=_0xc3ee[_0x15b0dc];return _0x11476e;};'use strict';var schema=require(_0xec3e('0x0'));var _=require(_0xec3e('0x1'));var htmlToText=require(_0xec3e('0x2'));var utils=require(_0xec3e('0x3'));var logger=require(_0xec3e('0x4'))(_0xec3e('0x5'));var gotoif=schema({'condition':{'type':_0xec3e('0x6'),'required':!![],'message':_0xec3e('0x7')},'priorityTrue':{'type':_0xec3e('0x8'),'message':_0xec3e('0x9')},'priorityFalse':{'type':'number','message':_0xec3e('0xa')}});exports[_0xec3e('0xb')]=function(_0x4a7653,_0x5d7b5a){return function(_0x27f665){try{var _0x421a4c={'condition':htmlToText[_0xec3e('0xc')](utils[_0xec3e('0xd')](_0x5d7b5a[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5d7b5a[0x1],'priorityFalse':_0x5d7b5a[0x2]};var _0x372b54=gotoif['validate'](_0x421a4c,{'typecast':!![]});if(_0x372b54[_0xec3e('0xe')]){logger[_0xec3e('0xf')](_0xec3e('0x10'),_0x4a7653,_[_0xec3e('0x11')](_0x372b54,_0xec3e('0x12'))[_0xec3e('0x13')](',\x20'));_0x27f665[_0xec3e('0x14')]();}else{try{var _0xd5760e=eval('('+_0x421a4c[_0xec3e('0x15')]+')');var _0x3f740c=_0xd5760e?_0x421a4c[_0xec3e('0x16')]:_0x421a4c[_0xec3e('0x17')];logger[_0xec3e('0x18')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x4a7653,_0x421a4c[_0xec3e('0x15')],_0xd5760e,_0x3f740c||_0xec3e('0x19'));if(_0x3f740c){var _0x396d79=_[_0xec3e('0x1a')](_0x27f665['rules'](),{'p':_0x3f740c});if(_0x396d79>=0x0){logger[_0xec3e('0x18')](_0xec3e('0x1b'),_0x4a7653,_0x3f740c||_0xec3e('0x19'),_0x396d79);_0x27f665['next'](_0x396d79);}else{logger[_0xec3e('0x18')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x4a7653,_0x3f740c||_0xec3e('0x19'));_0x27f665[_0xec3e('0x14')]();}}else{_0x27f665[_0xec3e('0x19')]();}}catch(_0x1389d6){logger[_0xec3e('0xf')](_0xec3e('0x1c'),_0x4a7653,_0x1389d6[_0xec3e('0x12')]);_0x27f665['stop']();}}}catch(_0x27e50f){logger[_0xec3e('0xf')](_0xec3e('0x10'),_0x4a7653,JSON['stringify'](_0x27e50f));_0x27f665[_0xec3e('0x14')]();}};}; \ No newline at end of file +var _0x724d=['rules','info','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','consequence','getMustacheRender','error','[%s][GOTOIF]\x20%s','map','message','join','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next'];(function(_0x76fc49,_0x186176){var _0x454e7e=function(_0x1d29f4){while(--_0x1d29f4){_0x76fc49['push'](_0x76fc49['shift']());}};_0x454e7e(++_0x186176);}(_0x724d,0x69));var _0xd724=function(_0x3fb9dd,_0x174fff){_0x3fb9dd=_0x3fb9dd-0x0;var _0x20136a=_0x724d[_0x3fb9dd];return _0x20136a;};'use strict';var schema=require(_0xd724('0x0'));var _=require('lodash');var htmlToText=require(_0xd724('0x1'));var utils=require(_0xd724('0x2'));var logger=require(_0xd724('0x3'))(_0xd724('0x4'));var gotoif=schema({'condition':{'type':_0xd724('0x5'),'required':!![],'message':_0xd724('0x6')},'priorityTrue':{'type':_0xd724('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0xd724('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xd724('0x8')]=function(_0x4d54e5,_0x1585e){return function(_0x59ca8a){try{var _0x2309af={'condition':htmlToText['fromString'](utils[_0xd724('0x9')](_0x1585e[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1585e[0x1],'priorityFalse':_0x1585e[0x2]};var _0x5e6c19=gotoif['validate'](_0x2309af,{'typecast':!![]});if(_0x5e6c19['length']){logger[_0xd724('0xa')](_0xd724('0xb'),_0x4d54e5,_[_0xd724('0xc')](_0x5e6c19,_0xd724('0xd'))[_0xd724('0xe')](',\x20'));_0x59ca8a['stop']();}else{try{var _0x3b5a9a=eval('('+_0x2309af['condition']+')');var _0x2d8b2d=_0x3b5a9a?_0x2309af[_0xd724('0xf')]:_0x2309af[_0xd724('0x10')];logger['info'](_0xd724('0x11'),_0x4d54e5,_0x2309af[_0xd724('0x12')],_0x3b5a9a,_0x2d8b2d||_0xd724('0x13'));if(_0x2d8b2d){var _0x419e4c=_['findIndex'](_0x59ca8a[_0xd724('0x14')](),{'p':_0x2d8b2d});if(_0x419e4c>=0x0){logger[_0xd724('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x4d54e5,_0x2d8b2d||_0xd724('0x13'),_0x419e4c);_0x59ca8a['next'](_0x419e4c);}else{logger[_0xd724('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x4d54e5,_0x2d8b2d||_0xd724('0x13'));_0x59ca8a[_0xd724('0x16')]();}}else{_0x59ca8a['next']();}}catch(_0x4155a8){logger[_0xd724('0xa')](_0xd724('0x17'),_0x4d54e5,_0x4155a8[_0xd724('0xd')]);_0x59ca8a['stop']();}}}catch(_0x290130){logger[_0xd724('0xa')](_0xd724('0xb'),_0x4d54e5,JSON[_0xd724('0x18')](_0x290130));_0x59ca8a['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 6f3147f..a7a91b0 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 _0x8d9f=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','map','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','error','validate','lodash','../../../../config/logger','number'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8d9f,0x119));var _0xf8d9=function(_0x4cc1c2,_0x3b717e){_0x4cc1c2=_0x4cc1c2-0x0;var _0x4a34a5=_0x8d9f[_0x4cc1c2];return _0x4a34a5;};'use strict';var schema=require(_0xf8d9('0x0'));var _=require(_0xf8d9('0x1'));var logger=require(_0xf8d9('0x2'))('routing');var gotop=schema({'priority':{'type':_0xf8d9('0x3'),'required':!![],'message':_0xf8d9('0x4')}});exports[_0xf8d9('0x5')]=function(_0x56700e,_0x495ee8){return function(_0x5dcec7){try{var _0x543630={'priority':_0x495ee8[0x0]};var _0x3c0202=gotop['validate'](_0x543630,{'typecast':!![]});if(_0x3c0202[_0xf8d9('0x6')]){logger['error'](_0xf8d9('0x7'),_0x56700e,_[_0xf8d9('0x8')](_0x3c0202,_0xf8d9('0x9'))[_0xf8d9('0xa')](',\x20'));_0x5dcec7['stop']();}else{logger[_0xf8d9('0xb')](_0xf8d9('0xc'),_0x56700e,_0x543630[_0xf8d9('0xd')]);if(_0x543630[_0xf8d9('0xd')]){var _0x5082cc=_['findIndex'](_0x5dcec7[_0xf8d9('0xe')](),{'p':_0x543630[_0xf8d9('0xd')]});if(_0x5082cc>=0x0){logger['info'](_0xf8d9('0xf'),_0x56700e,_0x543630[_0xf8d9('0xd')]||_0xf8d9('0x10'),_0x5082cc);_0x5dcec7['next'](_0x5082cc);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x56700e,_0x543630[_0xf8d9('0xd')]||_0xf8d9('0x10'));_0x5dcec7[_0xf8d9('0x11')]();}}else{_0x5dcec7[_0xf8d9('0x10')]();}}}catch(_0x92191){logger[_0xf8d9('0x12')](_0xf8d9('0x7'),_0x56700e,JSON['stringify'](_0x92191));_0x5dcec7[_0xf8d9('0x11')]();}};}; \ No newline at end of file +var _0xa0e8=['length','error','[%s][GOTOP]\x20%s','map','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','next','stop','stringify','validate','lodash','../../../../config/logger','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence'];(function(_0x4ae503,_0x45a969){var _0x338102=function(_0x5a5134){while(--_0x5a5134){_0x4ae503['push'](_0x4ae503['shift']());}};_0x338102(++_0x45a969);}(_0xa0e8,0x12d));var _0x8a0e=function(_0x2216f4,_0x47f1fc){_0x2216f4=_0x2216f4-0x0;var _0x1ebf36=_0xa0e8[_0x2216f4];return _0x1ebf36;};'use strict';var schema=require(_0x8a0e('0x0'));var _=require(_0x8a0e('0x1'));var logger=require(_0x8a0e('0x2'))('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x8a0e('0x3')}});exports[_0x8a0e('0x4')]=function(_0x155749,_0x1a52fc){return function(_0x5ad158){try{var _0x2ac882={'priority':_0x1a52fc[0x0]};var _0xd5533=gotop[_0x8a0e('0x0')](_0x2ac882,{'typecast':!![]});if(_0xd5533[_0x8a0e('0x5')]){logger[_0x8a0e('0x6')](_0x8a0e('0x7'),_0x155749,_[_0x8a0e('0x8')](_0xd5533,'message')['join'](',\x20'));_0x5ad158['stop']();}else{logger[_0x8a0e('0x9')](_0x8a0e('0xa'),_0x155749,_0x2ac882[_0x8a0e('0xb')]);if(_0x2ac882[_0x8a0e('0xb')]){var _0x25bfaf=_['findIndex'](_0x5ad158[_0x8a0e('0xc')](),{'p':_0x2ac882['priority']});if(_0x25bfaf>=0x0){logger['info'](_0x8a0e('0xd'),_0x155749,_0x2ac882[_0x8a0e('0xb')]||'next',_0x25bfaf);_0x5ad158['next'](_0x25bfaf);}else{logger[_0x8a0e('0x9')](_0x8a0e('0xe'),_0x155749,_0x2ac882['priority']||_0x8a0e('0xf'));_0x5ad158[_0x8a0e('0x10')]();}}else{_0x5ad158[_0x8a0e('0xf')]();}}}catch(_0x506d08){logger[_0x8a0e('0x6')](_0x8a0e('0x7'),_0x155749,JSON[_0x8a0e('0x11')](_0x506d08));_0x5ad158[_0x8a0e('0x10')]();}};}; \ 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 4dfaa43..37bcd35 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 _0x63cf=['../../rpc/faxMessage','consequence','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage'];(function(_0x2bf36a,_0x9fb45d){var _0xb962c5=function(_0x1f23ab){while(--_0x1f23ab){_0x2bf36a['push'](_0x2bf36a['shift']());}};_0xb962c5(++_0x9fb45d);}(_0x63cf,0xc9));var _0xf63c=function(_0x40b493,_0x4050de){_0x40b493=_0x40b493-0x0;var _0x548365=_0x63cf[_0x40b493];return _0x548365;};'use strict';var _=require(_0xf63c('0x0'));var utils=require(_0xf63c('0x1'));var logger=require(_0xf63c('0x2'))(_0xf63c('0x3'));var rpc={'chatMessage':require(_0xf63c('0x4')),'openchannelMessage':require(_0xf63c('0x5')),'mailMessage':require(_0xf63c('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf63c('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xf63c('0x8')]=function(_0x1f1946,_0x30da33){return function(_0x2fe800){try{var _0x6be9b2={'body':utils['getMustacheRender'](_0x30da33[0x0],this),'ContactId':this[_0xf63c('0x9')]['id']};if(this[_0xf63c('0xa')]===_0xf63c('0xb')){_0x6be9b2[_0xf63c('0xc')]=this[_0xf63c('0xd')]['id'];}else{_0x6be9b2[_[_0xf63c('0xe')](this[_0xf63c('0xa')])+_0xf63c('0xf')]=this[_0xf63c('0xd')]['id'];}_0x6be9b2[_[_0xf63c('0xe')](this[_0xf63c('0xa')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0xf63c('0xa')]+_0xf63c('0x10')]){return rpc[this[_0xf63c('0xa')]+_0xf63c('0x10')][_0xf63c('0x11')](_0x6be9b2)[_0xf63c('0x12')](function(_0x1dddf3){logger[_0xf63c('0x13')](_0xf63c('0x14'),_0x1f1946,_0x6be9b2[_0xf63c('0x15')]);_0x2fe800[_0xf63c('0x16')]();})[_0xf63c('0x17')](function(_0x43219a){logger['error'](_0xf63c('0x14'),_0x1f1946,JSON[_0xf63c('0x18')](_0x43219a));_0x2fe800[_0xf63c('0x19')]();});}}catch(_0x5cd8c1){logger['error'](_0xf63c('0x14'),_0x1f1946,JSON[_0xf63c('0x18')](_0x5cd8c1));_0x2fe800[_0xf63c('0x19')]();}};}; \ No newline at end of file +var _0xc2ff=['chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','next','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc2ff,0x195));var _0xfc2f=function(_0x28eda8,_0x207c34){_0x28eda8=_0x28eda8-0x0;var _0x1670a0=_0xc2ff[_0x28eda8];return _0x1670a0;};'use strict';var _=require(_0xfc2f('0x0'));var utils=require(_0xfc2f('0x1'));var logger=require(_0xfc2f('0x2'))('routing');var rpc={'chatMessage':require(_0xfc2f('0x3')),'openchannelMessage':require(_0xfc2f('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xfc2f('0x5')),'faxMessage':require(_0xfc2f('0x6')),'whatsappMessage':require(_0xfc2f('0x7'))};exports[_0xfc2f('0x8')]=function(_0xb533f6,_0x8c487){return function(_0x39f537){try{var _0xe55612={'body':utils[_0xfc2f('0x9')](_0x8c487[0x0],this),'ContactId':this['contact']['id']};if(this[_0xfc2f('0xa')]===_0xfc2f('0xb')){_0xe55612[_0xfc2f('0xc')]=this[_0xfc2f('0xd')]['id'];}else{_0xe55612[_[_0xfc2f('0xe')](this[_0xfc2f('0xa')])+_0xfc2f('0xf')]=this[_0xfc2f('0xd')]['id'];}_0xe55612[_[_0xfc2f('0xe')](this[_0xfc2f('0xa')])+_0xfc2f('0x10')]=this[_0xfc2f('0x11')]['id'];if(rpc[this[_0xfc2f('0xa')]+_0xfc2f('0x12')]){return rpc[this[_0xfc2f('0xa')]+_0xfc2f('0x12')]['create'](_0xe55612)[_0xfc2f('0x13')](function(_0x54b377){logger[_0xfc2f('0x14')](_0xfc2f('0x15'),_0xb533f6,_0xe55612[_0xfc2f('0x16')]);_0x39f537[_0xfc2f('0x17')]();})['catch'](function(_0x216347){logger['error'](_0xfc2f('0x15'),_0xb533f6,JSON[_0xfc2f('0x18')](_0x216347));_0x39f537[_0xfc2f('0x19')]();});}}catch(_0x3d985e){logger['error'](_0xfc2f('0x15'),_0xb533f6,JSON[_0xfc2f('0x18')](_0x3d985e));_0x39f537[_0xfc2f('0x19')]();}};}; \ 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 d0a4035..20be1a5 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 _0x1679=['next','error','[%s][NOOP]\x20%s','stringify','stop','../../../../config/logger','info','getMustacheRender'];(function(_0x28b7aa,_0x25a6ca){var _0x44669a=function(_0x2fa40d){while(--_0x2fa40d){_0x28b7aa['push'](_0x28b7aa['shift']());}};_0x44669a(++_0x25a6ca);}(_0x1679,0xf5));var _0x9167=function(_0x3ce586,_0xc9d3b5){_0x3ce586=_0x3ce586-0x0;var _0x16c6d0=_0x1679[_0x3ce586];return _0x16c6d0;};'use strict';var utils=require('./utils');var logger=require(_0x9167('0x0'))('routing');exports['consequence']=function(_0xc83ac7,_0x3184eb){return function(_0x4a482c){try{logger[_0x9167('0x1')]('[%s][NOOP]\x20%s',_0xc83ac7,utils[_0x9167('0x2')](_0x3184eb[0x0],this));_0x4a482c[_0x9167('0x3')]();}catch(_0x4f1fdf){logger[_0x9167('0x4')](_0x9167('0x5'),_0xc83ac7,JSON[_0x9167('0x6')](_0x4f1fdf));_0x4a482c[_0x9167('0x7')]();}};}; \ No newline at end of file +var _0xf40f=['./utils','../../../../config/logger','routing','consequence','info','next','[%s][NOOP]\x20%s','stringify','stop'];(function(_0x167307,_0x5a60ae){var _0x550140=function(_0x5b5009){while(--_0x5b5009){_0x167307['push'](_0x167307['shift']());}};_0x550140(++_0x5a60ae);}(_0xf40f,0x90));var _0xff40=function(_0x907c81,_0x3a22df){_0x907c81=_0x907c81-0x0;var _0x29d2ba=_0xf40f[_0x907c81];return _0x29d2ba;};'use strict';var utils=require(_0xff40('0x0'));var logger=require(_0xff40('0x1'))(_0xff40('0x2'));exports[_0xff40('0x3')]=function(_0x8d699c,_0x33d510){return function(_0x3e3a8d){try{logger[_0xff40('0x4')]('[%s][NOOP]\x20%s',_0x8d699c,utils['getMustacheRender'](_0x33d510[0x0],this));_0x3e3a8d[_0xff40('0x5')]();}catch(_0xd4b0d2){logger['error'](_0xff40('0x6'),_0x8d699c,JSON[_0xff40('0x7')](_0xd4b0d2));_0x3e3a8d[_0xff40('0x8')]();}};}; \ 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 265964b..a19d807 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 _0x9211=['./strategy','redis','localhost','account','from','joinAt','emit','clone','queue','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','QueueReport','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','length','map','createQueue','atimeout','qtimeout','rules','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','log','stack','stop','validate','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger'];(function(_0x1d29f6,_0x45f6a0){var _0x491093=function(_0x29ceed){while(--_0x29ceed){_0x1d29f6['push'](_0x1d29f6['shift']());}};_0x491093(++_0x45f6a0);}(_0x9211,0x170));var _0x1921=function(_0x26a382,_0x3d54db){_0x26a382=_0x26a382-0x0;var _0x14f9c8=_0x9211[_0x26a382];return _0x14f9c8;};'use strict';var schema=require(_0x1921('0x0'));var _=require('lodash');var util=require(_0x1921('0x1'));var seqqueue=require(_0x1921('0x2'));var moment=require(_0x1921('0x3'));var Redis=require(_0x1921('0x4'));var config=require(_0x1921('0x5'));var logger=require(_0x1921('0x6'))('routing');var strategy=require(_0x1921('0x7'));config[_0x1921('0x8')]=_['defaults'](config[_0x1921('0x8')],{'host':_0x1921('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id','queue_id',_0x1921('0xa'),'queue',_0x1921('0xb'),_0x1921('0xc')];function emit(_0x2af134,_0x512781,_0x18ffad){io['to'](_0x2af134)[_0x1921('0xd')](_0x512781,_0x18ffad);}function emitChannelQueueInteraction(_0x536e0a,_0x1787d5,_0x1ca625,_0x4a4d10,_0x29040f,_0x578843,_0x41ca8c,_0x462c9a){var _0x338e23=_[_0x1921('0xe')](_0x1ca625);_0x338e23['queue_id']=_0x462c9a;_0x338e23[_0x1921('0xf')]=_0x1787d5;_0x338e23['account']=_0x4a4d10;_0x338e23['id']=_0x29040f;if(_0x578843){_0x41ca8c[util[_0x1921('0x10')](_0x1921('0x11'),_0x536e0a)][_0x29040f]=_[_0x1921('0x12')](_0x338e23,attributes);}else{delete _0x41ca8c[util['format'](_0x1921('0x11'),_0x536e0a)][_0x29040f];}emit(util[_0x1921('0x10')](_0x1921('0x13'),_0x536e0a,_0x1787d5),util[_0x1921('0x10')](_0x1921('0x14'),_0x536e0a,_0x578843?_0x1921('0x15'):'remove'),_['pick'](_0x338e23,attributes));}var rpc={'openchannelQueueReport':require(_0x1921('0x16')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x1921('0x17')),'smsQueueReport':require(_0x1921('0x18')),'faxQueueReport':require(_0x1921('0x19')),'whatsappQueueReport':require(_0x1921('0x1a'))};var queue=schema({'name':{'type':_0x1921('0x1b'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x1921('0x1c'),'message':_0x1921('0x1d')}});function startRouting(_0x545847,_0x59b028,_0x5f1db0,_0x372053){if(_0x545847&&_0x59b028&&_0x5f1db0){_0x59b028[_0x1921('0x1e')]+=0x1;var _0x1ff30f={'uniqueid':_0x545847,'from':_0x5f1db0[_0x1921('0x1f')]?_0x5f1db0[_0x1921('0x1f')][_0x1921('0xb')]:'','joinAt':moment()[_0x1921('0x10')](_0x1921('0x20')),'ContactId':_0x5f1db0['contact']?_0x5f1db0[_0x1921('0x21')]['id']:null,'ListId':_0x5f1db0[_0x1921('0x22')]?_0x5f1db0['list']['id']:null};_0x1ff30f[_[_0x1921('0x23')](_0x5f1db0[_0x1921('0x24')])+_0x1921('0x25')]=_0x59b028['id']||null;_0x1ff30f[_[_0x1921('0x23')](_0x5f1db0['channel'])+_0x1921('0x26')]=_0x5f1db0[_0x1921('0x27')]?_0x5f1db0['interaction']['id']:null;_0x1ff30f[_[_0x1921('0x23')](_0x5f1db0[_0x1921('0x24')])+_0x1921('0x28')]=_0x5f1db0[_0x1921('0x29')]?_0x5f1db0[_0x1921('0x29')]['id']:null;_0x1ff30f[_[_0x1921('0x23')](_0x5f1db0['channel'])+(_0x5f1db0[_0x1921('0x24')]!==_0x1921('0x2a')?_0x1921('0x2b'):_0x1921('0x2c'))]=_0x5f1db0[_0x1921('0xa')]?_0x5f1db0[_0x1921('0xa')]['id']:null;logger[_0x1921('0x2d')](util['format'](_0x1921('0x2e'),_0x545847,_0x59b028['name']));emitChannelQueueInteraction(_0x5f1db0[_0x1921('0x24')],_0x59b028['name'],_0x1ff30f,_0x5f1db0[_0x1921('0xa')][_0x1921('0x2f')],_0x5f1db0[_0x1921('0x29')]['id'],!![],_0x372053,_0x59b028['id']);if(rpc[_0x5f1db0[_0x1921('0x24')]+'QueueReport']){return rpc[_0x5f1db0['channel']+'QueueReport'][_0x1921('0x30')](_0x1ff30f)[_0x1921('0x31')](function(_0x429da5){logger[_0x1921('0x32')](_0x1921('0x33'));});}}}function stopRouting(_0x369e1f,_0x37023a,_0x32e5e7,_0x5c1b53){if(_0x369e1f&&_0x37023a){_0x37023a[_0x1921('0x1e')]-=0x1;var _0x517b30={'leaveAt':moment()[_0x1921('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x1921('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x1921('0x34')};logger[_0x1921('0x2d')](util[_0x1921('0x10')](_0x1921('0x35'),_0x369e1f,_0x37023a[_0x1921('0x2f')]));emitChannelQueueInteraction(_0x32e5e7[_0x1921('0x24')],_0x37023a[_0x1921('0x2f')],_0x32e5e7[_0x1921('0x1f')],_0x32e5e7[_0x1921('0xa')]['name'],_0x32e5e7[_0x1921('0x29')]['id'],![],_0x5c1b53,_0x37023a['id']);if(rpc[_0x32e5e7[_0x1921('0x24')]+_0x1921('0x36')]){return rpc[_0x32e5e7[_0x1921('0x24')]+'QueueReport']['update'](_0x369e1f,_0x517b30)[_0x1921('0x31')](function(_0x33dabf){logger['error'](_0x1921('0x37'));});}}}function endRouting(_0x5a94b0,_0x598c06,_0xbc8e4b,_0x52b2a3){if(_0x5a94b0&&_0x598c06){_0x598c06[_0x1921('0x1e')]-=0x1;var _0x14d5e7={'leaveAt':moment()['format'](_0x1921('0x20')),'exitAt':moment()[_0x1921('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x1921('0x38')};logger[_0x1921('0x2d')](util['format'](_0x1921('0x39'),_0x5a94b0,_0x598c06['name']));emitChannelQueueInteraction(_0xbc8e4b[_0x1921('0x24')],_0x598c06[_0x1921('0x2f')],_0xbc8e4b['body'],_0xbc8e4b['account'][_0x1921('0x2f')],_0xbc8e4b[_0x1921('0x29')]['id'],![],_0x52b2a3);if(rpc[_0xbc8e4b[_0x1921('0x24')]+'QueueReport']){return rpc[_0xbc8e4b[_0x1921('0x24')]+_0x1921('0x36')][_0x1921('0x3a')](_0x5a94b0,_0x14d5e7)['catch'](function(_0x4505e7){logger[_0x1921('0x32')](_0x1921('0x37'));});}}}function handleFindQueue(_0x177804){return function(_0x1be289){return _0x1be289[_0x1921('0x2f')][_0x1921('0x3b')]()===_0x177804[_0x1921('0x3b')]();};}exports[_0x1921('0x3c')]=function(_0x56736d,_0x5c4ecb,_0x49704c,_0x34b3a4){return function(_0x38c2ff){try{var _0x350ab0={'name':_0x5c4ecb[0x0],'timeout':_0x5c4ecb[0x1]};var _0xe5f312=queue[_0x1921('0x0')](_0x350ab0,{'typecast':!![]});if(_0xe5f312[_0x1921('0x3d')]){logger[_0x1921('0x32')]('[%s][QUEUE]\x20%s',_0x56736d,_[_0x1921('0x3e')](_0xe5f312,_0x1921('0x29'))['join'](',\x20'));_0x38c2ff['stop']();}else{var _0x51fb46=_['find'](_0x49704c[_0x34b3a4['channel']+'Queues'],handleFindQueue(_0x350ab0['name']));if(_0x51fb46){startRouting(_0x56736d,_0x51fb46,_0x34b3a4,_0x49704c);var _0x50263e=(_0x51fb46['timeout']||0xa)*0x3e8;var _0x5219c2=(_0x350ab0[_0x1921('0x38')]||0x14)*0x3e8;var _0x3cab70,_0x565b5a;if(_0x50263e>_0x5219c2){_0x5219c2=_0x50263e;}var _0x2c5c14=seqqueue[_0x1921('0x3f')](_0x50263e);_0x2c5c14['id']=_0x56736d;_0x2c5c14[_0x1921('0x40')]=_0x50263e;_0x2c5c14[_0x1921('0x41')]=_0x5219c2;_0x2c5c14[_0x1921('0x24')]=_0x34b3a4[_0x1921('0x24')];_0x49704c['rules'][_0x56736d]['on']('end',function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x56736d);stopRouting(_0x56736d,_0x51fb46,_0x34b3a4,_0x49704c);clearTimeout(_0x3cab70);_0x3cab70=undefined;_0x2c5c14['close'](!![]);if(_0x49704c['rules'][_0x56736d]){delete _0x49704c['rules'][_0x56736d];}_0x38c2ff['stop']();});_0x49704c[_0x1921('0x42')][_0x56736d]['on']('complete',function(){if(_0x49704c[_0x1921('0x42')][_0x56736d]){delete _0x49704c[_0x1921('0x42')][_0x56736d];}});_0x3cab70=setTimeout(function(){logger[_0x1921('0x2d')](_0x1921('0x43'),_0x56736d);endRouting(_0x56736d,_0x51fb46,_0x34b3a4,_0x49704c);clearTimeout(_0x3cab70);_0x2c5c14[_0x1921('0x44')](!![]);_0x38c2ff[_0x1921('0x45')]();},_0x5219c2);switch(_0x51fb46[_0x1921('0x46')]){case'rrmemory':strategy[_0x1921('0x47')](_0x2c5c14,_0x51fb46,_0x49704c,_0x34b3a4);break;default:strategy['beepall'](_0x2c5c14,_0x51fb46,_0x49704c,_0x34b3a4);}}else{logger[_0x1921('0x32')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x56736d,_0x350ab0['name']);_0x38c2ff['stop']();}}}catch(_0x44f87e){console[_0x1921('0x48')](_0x44f87e);logger['error']('[%s][QUEUE]\x20%s',_0x56736d,_0x44f87e[_0x1921('0x49')]);_0x38c2ff[_0x1921('0x4a')]();}};}; \ No newline at end of file +var _0xfbd1=['../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','contact','list','upperFirst','QueueId','channel','InteractionId','interaction','MessageId','message','chat','info','name','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','QueueReport','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','routing','./strategy','redis','localhost','socket.io-emitter','queue','from','joinAt','emit','clone','queue_id','account','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport'];(function(_0x2febde,_0x3fbc16){var _0x41cab8=function(_0x152cd7){while(--_0x152cd7){_0x2febde['push'](_0x2febde['shift']());}};_0x41cab8(++_0x3fbc16);}(_0xfbd1,0x7f));var _0x1fbd=function(_0x130705,_0x2d266b){_0x130705=_0x130705-0x0;var _0x1fa991=_0xfbd1[_0x130705];return _0x1fa991;};'use strict';var schema=require(_0x1fbd('0x0'));var _=require(_0x1fbd('0x1'));var util=require(_0x1fbd('0x2'));var seqqueue=require(_0x1fbd('0x3'));var moment=require(_0x1fbd('0x4'));var Redis=require(_0x1fbd('0x5'));var config=require(_0x1fbd('0x6'));var logger=require('../../../../config/logger')(_0x1fbd('0x7'));var strategy=require(_0x1fbd('0x8'));config[_0x1fbd('0x9')]=_['defaults'](config[_0x1fbd('0x9')],{'host':_0x1fbd('0xa'),'port':0x18eb});var io=require(_0x1fbd('0xb'))(new Redis(config[_0x1fbd('0x9')]));var attributes=['id','queue_id','account',_0x1fbd('0xc'),_0x1fbd('0xd'),_0x1fbd('0xe')];function emit(_0x4cb907,_0x5307d6,_0x55e21b){io['to'](_0x4cb907)[_0x1fbd('0xf')](_0x5307d6,_0x55e21b);}function emitChannelQueueInteraction(_0x2c0a5f,_0xf82b23,_0x2d6f4d,_0x475a70,_0x4a0d2d,_0x3301b2,_0x28eab8,_0x579296){var _0x2c5b53=_[_0x1fbd('0x10')](_0x2d6f4d);_0x2c5b53[_0x1fbd('0x11')]=_0x579296;_0x2c5b53[_0x1fbd('0xc')]=_0xf82b23;_0x2c5b53[_0x1fbd('0x12')]=_0x475a70;_0x2c5b53['id']=_0x4a0d2d;if(_0x3301b2){_0x28eab8[util[_0x1fbd('0x13')](_0x1fbd('0x14'),_0x2c0a5f)][_0x4a0d2d]=_[_0x1fbd('0x15')](_0x2c5b53,attributes);}else{delete _0x28eab8[util[_0x1fbd('0x13')](_0x1fbd('0x14'),_0x2c0a5f)][_0x4a0d2d];}emit(util[_0x1fbd('0x13')](_0x1fbd('0x16'),_0x2c0a5f,_0xf82b23),util['format'](_0x1fbd('0x17'),_0x2c0a5f,_0x3301b2?'save':_0x1fbd('0x18')),_[_0x1fbd('0x15')](_0x2c5b53,attributes));}var rpc={'openchannelQueueReport':require(_0x1fbd('0x19')),'mailQueueReport':require(_0x1fbd('0x1a')),'chatQueueReport':require(_0x1fbd('0x1b')),'smsQueueReport':require(_0x1fbd('0x1c')),'faxQueueReport':require(_0x1fbd('0x1d')),'whatsappQueueReport':require(_0x1fbd('0x1e'))};var queue=schema({'name':{'type':_0x1fbd('0x1f'),'required':!![],'message':_0x1fbd('0x20')},'timeout':{'type':_0x1fbd('0x21'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0xf33e35,_0x5d27a2,_0x5c8ab9,_0x219ee8){if(_0xf33e35&&_0x5d27a2&&_0x5c8ab9){_0x5d27a2[_0x1fbd('0x22')]+=0x1;var _0x33a66d={'uniqueid':_0xf33e35,'from':_0x5c8ab9[_0x1fbd('0x23')]?_0x5c8ab9[_0x1fbd('0x23')]['from']:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5c8ab9[_0x1fbd('0x24')]?_0x5c8ab9[_0x1fbd('0x24')]['id']:null,'ListId':_0x5c8ab9['list']?_0x5c8ab9[_0x1fbd('0x25')]['id']:null};_0x33a66d[_[_0x1fbd('0x26')](_0x5c8ab9['channel'])+_0x1fbd('0x27')]=_0x5d27a2['id']||null;_0x33a66d[_['upperFirst'](_0x5c8ab9[_0x1fbd('0x28')])+_0x1fbd('0x29')]=_0x5c8ab9[_0x1fbd('0x2a')]?_0x5c8ab9[_0x1fbd('0x2a')]['id']:null;_0x33a66d[_[_0x1fbd('0x26')](_0x5c8ab9[_0x1fbd('0x28')])+_0x1fbd('0x2b')]=_0x5c8ab9[_0x1fbd('0x2c')]?_0x5c8ab9[_0x1fbd('0x2c')]['id']:null;_0x33a66d[_[_0x1fbd('0x26')](_0x5c8ab9[_0x1fbd('0x28')])+(_0x5c8ab9[_0x1fbd('0x28')]!==_0x1fbd('0x2d')?'AccountId':'WebsiteId')]=_0x5c8ab9[_0x1fbd('0x12')]?_0x5c8ab9[_0x1fbd('0x12')]['id']:null;logger[_0x1fbd('0x2e')](util[_0x1fbd('0x13')]('[%s][START:QUEUE][NAME:%s]',_0xf33e35,_0x5d27a2[_0x1fbd('0x2f')]));emitChannelQueueInteraction(_0x5c8ab9[_0x1fbd('0x28')],_0x5d27a2[_0x1fbd('0x2f')],_0x33a66d,_0x5c8ab9[_0x1fbd('0x12')][_0x1fbd('0x2f')],_0x5c8ab9['message']['id'],!![],_0x219ee8,_0x5d27a2['id']);if(rpc[_0x5c8ab9[_0x1fbd('0x28')]+'QueueReport']){return rpc[_0x5c8ab9[_0x1fbd('0x28')]+'QueueReport']['create'](_0x33a66d)[_0x1fbd('0x30')](function(_0x155185){logger[_0x1fbd('0x31')](_0x1fbd('0x32'));});}}}function stopRouting(_0x4bca39,_0x5202e6,_0x238958,_0x35d287){if(_0x4bca39&&_0x5202e6){_0x5202e6['waiting']-=0x1;var _0x212f97={'leaveAt':moment()[_0x1fbd('0x13')](_0x1fbd('0x33')),'acceptAt':moment()[_0x1fbd('0x13')](_0x1fbd('0x33')),'reason':'accepted'};logger[_0x1fbd('0x2e')](util['format'](_0x1fbd('0x34'),_0x4bca39,_0x5202e6[_0x1fbd('0x2f')]));emitChannelQueueInteraction(_0x238958[_0x1fbd('0x28')],_0x5202e6[_0x1fbd('0x2f')],_0x238958[_0x1fbd('0x23')],_0x238958[_0x1fbd('0x12')][_0x1fbd('0x2f')],_0x238958[_0x1fbd('0x2c')]['id'],![],_0x35d287,_0x5202e6['id']);if(rpc[_0x238958['channel']+_0x1fbd('0x35')]){return rpc[_0x238958[_0x1fbd('0x28')]+_0x1fbd('0x35')][_0x1fbd('0x36')](_0x4bca39,_0x212f97)['catch'](function(_0x49d284){logger[_0x1fbd('0x31')](_0x1fbd('0x37'));});}}}function endRouting(_0x4f7af5,_0xe3f2be,_0x2a9d5b,_0x420a1a){if(_0x4f7af5&&_0xe3f2be){_0xe3f2be[_0x1fbd('0x22')]-=0x1;var _0x52018d={'leaveAt':moment()[_0x1fbd('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x1fbd('0x38')};logger[_0x1fbd('0x2e')](util[_0x1fbd('0x13')](_0x1fbd('0x39'),_0x4f7af5,_0xe3f2be[_0x1fbd('0x2f')]));emitChannelQueueInteraction(_0x2a9d5b[_0x1fbd('0x28')],_0xe3f2be[_0x1fbd('0x2f')],_0x2a9d5b['body'],_0x2a9d5b['account'][_0x1fbd('0x2f')],_0x2a9d5b[_0x1fbd('0x2c')]['id'],![],_0x420a1a);if(rpc[_0x2a9d5b[_0x1fbd('0x28')]+_0x1fbd('0x35')]){return rpc[_0x2a9d5b[_0x1fbd('0x28')]+_0x1fbd('0x35')][_0x1fbd('0x36')](_0x4f7af5,_0x52018d)[_0x1fbd('0x30')](function(_0x6f631d){logger[_0x1fbd('0x31')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x59671d){return function(_0x4a6673){return _0x4a6673[_0x1fbd('0x2f')][_0x1fbd('0x3a')]()===_0x59671d['toLowerCase']();};}exports['consequence']=function(_0x5ddc7a,_0x5df9b7,_0x2edc13,_0xcbecbb){return function(_0x116b7a){try{var _0x26ef39={'name':_0x5df9b7[0x0],'timeout':_0x5df9b7[0x1]};var _0x4c7331=queue[_0x1fbd('0x0')](_0x26ef39,{'typecast':!![]});if(_0x4c7331[_0x1fbd('0x3b')]){logger[_0x1fbd('0x31')](_0x1fbd('0x3c'),_0x5ddc7a,_['map'](_0x4c7331,_0x1fbd('0x2c'))[_0x1fbd('0x3d')](',\x20'));_0x116b7a[_0x1fbd('0x3e')]();}else{var _0x3c2eb7=_[_0x1fbd('0x3f')](_0x2edc13[_0xcbecbb[_0x1fbd('0x28')]+_0x1fbd('0x40')],handleFindQueue(_0x26ef39['name']));if(_0x3c2eb7){startRouting(_0x5ddc7a,_0x3c2eb7,_0xcbecbb,_0x2edc13);var _0x5d224d=(_0x3c2eb7[_0x1fbd('0x38')]||0xa)*0x3e8;var _0x11694d=(_0x26ef39[_0x1fbd('0x38')]||0x14)*0x3e8;var _0x489d48,_0x6f0e60;if(_0x5d224d>_0x11694d){_0x11694d=_0x5d224d;}var _0x4786b3=seqqueue['createQueue'](_0x5d224d);_0x4786b3['id']=_0x5ddc7a;_0x4786b3['atimeout']=_0x5d224d;_0x4786b3[_0x1fbd('0x41')]=_0x11694d;_0x4786b3['channel']=_0xcbecbb['channel'];_0x2edc13[_0x1fbd('0x42')][_0x5ddc7a]['on'](_0x1fbd('0x43'),function(){logger[_0x1fbd('0x2e')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x5ddc7a);stopRouting(_0x5ddc7a,_0x3c2eb7,_0xcbecbb,_0x2edc13);clearTimeout(_0x489d48);_0x489d48=undefined;_0x4786b3[_0x1fbd('0x44')](!![]);if(_0x2edc13[_0x1fbd('0x42')][_0x5ddc7a]){delete _0x2edc13[_0x1fbd('0x42')][_0x5ddc7a];}_0x116b7a[_0x1fbd('0x3e')]();});_0x2edc13[_0x1fbd('0x42')][_0x5ddc7a]['on'](_0x1fbd('0x45'),function(){if(_0x2edc13[_0x1fbd('0x42')][_0x5ddc7a]){delete _0x2edc13['rules'][_0x5ddc7a];}});_0x489d48=setTimeout(function(){logger[_0x1fbd('0x2e')](_0x1fbd('0x46'),_0x5ddc7a);endRouting(_0x5ddc7a,_0x3c2eb7,_0xcbecbb,_0x2edc13);clearTimeout(_0x489d48);_0x4786b3[_0x1fbd('0x44')](!![]);_0x116b7a[_0x1fbd('0x47')]();},_0x11694d);switch(_0x3c2eb7[_0x1fbd('0x48')]){case'rrmemory':strategy[_0x1fbd('0x49')](_0x4786b3,_0x3c2eb7,_0x2edc13,_0xcbecbb);break;default:strategy[_0x1fbd('0x4a')](_0x4786b3,_0x3c2eb7,_0x2edc13,_0xcbecbb);}}else{logger[_0x1fbd('0x31')](_0x1fbd('0x4b'),_0x5ddc7a,_0x26ef39[_0x1fbd('0x2f')]);_0x116b7a[_0x1fbd('0x3e')]();}}}catch(_0x5dbab5){console['log'](_0x5dbab5);logger[_0x1fbd('0x31')](_0x1fbd('0x3c'),_0x5ddc7a,_0x5dbab5[_0x1fbd('0x4c')]);_0x116b7a[_0x1fbd('0x3e')]();}};}; \ 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 70d7bea..a111150 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 _0xdeda=['./util','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','handleTimeout','timeout','prototype','handleDrained','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','isAgentAvailable','channel','busyQueue','showNotification','writeLog','forcedOwnership',':FORCED','info','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','busy','STOP','TIMEOUT','exports','lodash','uuid'];(function(_0x411ae4,_0x5760eb){var _0x3d701b=function(_0x2ae432){while(--_0x2ae432){_0x411ae4['push'](_0x411ae4['shift']());}};_0x3d701b(++_0x5760eb);}(_0xdeda,0x148));var _0xaded=function(_0x238f08,_0x17b2d6){_0x238f08=_0x238f08-0x0;var _0x306697=_0xdeda[_0x238f08];return _0x306697;};'use strict';var _=require(_0xaded('0x0'));var uuid=require(_0xaded('0x1'));var util=require(_0xaded('0x2'));var logger=require('../../../../../config/logger')(_0xaded('0x3'));var Agent=function(_0x2b2999,_0xfecc30,_0x3c97dc,_0x40d5ce){this[_0xaded('0x4')]=uuid['v4']();this[_0xaded('0x5')]=_0x2b2999;this[_0xaded('0x6')]=_0xfecc30;this[_0xaded('0x7')]=_0x3c97dc;this[_0xaded('0x3')]=_0x40d5ce;this[_0xaded('0x5')][_0xaded('0x8')](this[_0xaded('0x9')][_0xaded('0xa')](this),this[_0xaded('0xb')]['bind'](this));this[_0xaded('0x5')]['on'](_0xaded('0xc'),this[_0xaded('0xb')][_0xaded('0xa')](this));this[_0xaded('0x5')]['on']('drained',this['handleDrained'][_0xaded('0xa')](this));};Agent['prototype'][_0xaded('0x8')]=function(){this[_0xaded('0x5')][_0xaded('0x8')](this[_0xaded('0x9')][_0xaded('0xa')](this),this[_0xaded('0xb')][_0xaded('0xa')](this));};Agent[_0xaded('0xd')][_0xaded('0xe')]=function(){this['handleTimeout'](!![]);};Agent[_0xaded('0xd')][_0xaded('0x9')]=function(_0x950cc2){logger['info'](_0xaded('0xf'),this[_0xaded('0x5')]['id'],this['agent']['id']);if(_[_0xaded('0x10')](this[_0xaded('0x7')][_0xaded('0x11')][this['agent']['id']])){logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xaded('0x5')]['id'],this[_0xaded('0x6')]['id']);setTimeout(this[_0xaded('0x8')][_0xaded('0xa')](this),0x3e8);}else{if(this[_0xaded('0x3')]['forcedOwnership']||util[_0xaded('0x12')](this['squeue']['id'],this[_0xaded('0x7')][_0xaded('0x11')][this[_0xaded('0x6')]['id']],this['squeue'][_0xaded('0x13')],![])){this['realtime'][_0xaded('0x11')][this[_0xaded('0x6')]['id']]['busy']=!![];this[_0xaded('0x7')]['agents'][this[_0xaded('0x6')]['id']][_0xaded('0x14')]=undefined;util[_0xaded('0x15')](this[_0xaded('0x4')],this[_0xaded('0x5')]['id'],this[_0xaded('0x7')][_0xaded('0x11')][this['agent']['id']],null,this[_0xaded('0x3')]);util[_0xaded('0x16')](this[_0xaded('0x5')]['id'],this['realtime'][_0xaded('0x11')][this[_0xaded('0x6')]['id']],'RINGING'+(this[_0xaded('0x3')][_0xaded('0x17')]?_0xaded('0x18'):''));}else{logger[_0xaded('0x19')](_0xaded('0x1a'),this[_0xaded('0x5')]['id'],this[_0xaded('0x6')]['id']);setTimeout(this[_0xaded('0x8')][_0xaded('0xa')](this),0x3e8);}}};Agent[_0xaded('0xd')][_0xaded('0xb')]=function(_0x851358){if(_['isNil'](this[_0xaded('0x7')][_0xaded('0x11')][this['agent']['id']])){return logger[_0xaded('0x19')](_0xaded('0x1b'),this['squeue']['id'],this[_0xaded('0x6')]['id']);}else{logger['info'](_0xaded('0x1c'),this[_0xaded('0x5')]['id'],this[_0xaded('0x6')]['id']);util['hideNotification'](this[_0xaded('0x4')],this['squeue']['id'],this[_0xaded('0x7')][_0xaded('0x11')][this[_0xaded('0x6')]['id']],null,this['routing']);this[_0xaded('0x7')][_0xaded('0x11')][this[_0xaded('0x6')]['id']][_0xaded('0x1d')]=![];this[_0xaded('0x7')]['agents'][this[_0xaded('0x6')]['id']]['busyQueue']=undefined;util[_0xaded('0x16')](this[_0xaded('0x5')]['id'],this[_0xaded('0x7')]['agents'][this[_0xaded('0x6')]['id']],_0x851358?_0xaded('0x1e'):_0xaded('0x1f'));}if(!_0x851358){setTimeout(this[_0xaded('0x8')]['bind'](this),0x3e8);}};function agent(_0x35d45b,_0x5e4171,_0x441249,_0xcb411f){return new Agent(_0x35d45b,_0x5e4171,_0x441249,_0xcb411f);}module[_0xaded('0x20')]=agent; \ No newline at end of file +var _0x48a3=['bind','handleTimeout','timeout','squeue','prototype','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','showNotification','notificationId','writeLog',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','busy','busyQueue','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','agent','push','handleRun'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0x48a3,0x1e9));var _0x348a=function(_0x4ca536,_0x57c8de){_0x4ca536=_0x4ca536-0x0;var _0x3bd35f=_0x48a3[_0x4ca536];return _0x3bd35f;};'use strict';var _=require('lodash');var uuid=require(_0x348a('0x0'));var util=require(_0x348a('0x1'));var logger=require(_0x348a('0x2'))(_0x348a('0x3'));var Agent=function(_0x592687,_0x6b93a9,_0x116469,_0x18703c){this['notificationId']=uuid['v4']();this['squeue']=_0x592687;this[_0x348a('0x4')]=_0x6b93a9;this['realtime']=_0x116469;this['routing']=_0x18703c;this['squeue'][_0x348a('0x5')](this[_0x348a('0x6')][_0x348a('0x7')](this),this[_0x348a('0x8')]['bind'](this));this['squeue']['on'](_0x348a('0x9'),this['handleTimeout'][_0x348a('0x7')](this));this[_0x348a('0xa')]['on']('drained',this['handleDrained'][_0x348a('0x7')](this));};Agent[_0x348a('0xb')]['push']=function(){this['squeue'][_0x348a('0x5')](this['handleRun']['bind'](this),this[_0x348a('0x8')]['bind'](this));};Agent[_0x348a('0xb')][_0x348a('0xc')]=function(){this['handleTimeout'](!![]);};Agent[_0x348a('0xb')][_0x348a('0x6')]=function(_0x5d3f24){logger[_0x348a('0xd')](_0x348a('0xe'),this[_0x348a('0xa')]['id'],this[_0x348a('0x4')]['id']);if(_[_0x348a('0xf')](this[_0x348a('0x10')][_0x348a('0x11')][this[_0x348a('0x4')]['id']])){logger[_0x348a('0xd')](_0x348a('0x12'),this[_0x348a('0xa')]['id'],this['agent']['id']);setTimeout(this[_0x348a('0x5')][_0x348a('0x7')](this),0x3e8);}else{if(this[_0x348a('0x3')][_0x348a('0x13')]||util['isAgentAvailable'](this[_0x348a('0xa')]['id'],this['realtime'][_0x348a('0x11')][this[_0x348a('0x4')]['id']],this[_0x348a('0xa')][_0x348a('0x14')],![])){this[_0x348a('0x10')]['agents'][this[_0x348a('0x4')]['id']]['busy']=!![];this[_0x348a('0x10')][_0x348a('0x11')][this[_0x348a('0x4')]['id']]['busyQueue']=undefined;util[_0x348a('0x15')](this[_0x348a('0x16')],this[_0x348a('0xa')]['id'],this[_0x348a('0x10')][_0x348a('0x11')][this[_0x348a('0x4')]['id']],null,this[_0x348a('0x3')]);util[_0x348a('0x17')](this[_0x348a('0xa')]['id'],this[_0x348a('0x10')][_0x348a('0x11')][this[_0x348a('0x4')]['id']],'RINGING'+(this[_0x348a('0x3')][_0x348a('0x13')]?_0x348a('0x18'):''));}else{logger[_0x348a('0xd')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x348a('0x5')]['bind'](this),0x3e8);}}};Agent[_0x348a('0xb')][_0x348a('0x8')]=function(_0x1904f4){if(_[_0x348a('0xf')](this[_0x348a('0x10')][_0x348a('0x11')][this[_0x348a('0x4')]['id']])){return logger[_0x348a('0xd')](_0x348a('0x12'),this[_0x348a('0xa')]['id'],this[_0x348a('0x4')]['id']);}else{logger[_0x348a('0xd')](_0x348a('0x19'),this[_0x348a('0xa')]['id'],this[_0x348a('0x4')]['id']);util['hideNotification'](this[_0x348a('0x16')],this['squeue']['id'],this[_0x348a('0x10')][_0x348a('0x11')][this[_0x348a('0x4')]['id']],null,this['routing']);this['realtime'][_0x348a('0x11')][this[_0x348a('0x4')]['id']][_0x348a('0x1a')]=![];this[_0x348a('0x10')][_0x348a('0x11')][this['agent']['id']][_0x348a('0x1b')]=undefined;util[_0x348a('0x17')](this[_0x348a('0xa')]['id'],this[_0x348a('0x10')]['agents'][this[_0x348a('0x4')]['id']],_0x1904f4?_0x348a('0x1c'):_0x348a('0x1d'));}if(!_0x1904f4){setTimeout(this[_0x348a('0x5')][_0x348a('0x7')](this),0x3e8);}};function agent(_0x860d32,_0x2134b5,_0x3e7396,_0x441122){return new Agent(_0x860d32,_0x2134b5,_0x3e7396,_0x441122);}module[_0x348a('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 b16885a..705863c 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 _0x2975=['handleTimeout','bind','timeout','drained','handleDrained','prototype','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','RINGING','busy','name','showNotification','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','busyQueue','uuid','./util','../../../../../config/logger','routing','squeue','queue','realtime','push','handleRun'];(function(_0x156ce2,_0x4e5f83){var _0x26c8c7=function(_0x534e6f){while(--_0x534e6f){_0x156ce2['push'](_0x156ce2['shift']());}};_0x26c8c7(++_0x4e5f83);}(_0x2975,0x1c5));var _0x5297=function(_0x150c74,_0x538248){_0x150c74=_0x150c74-0x0;var _0x56bcee=_0x2975[_0x150c74];return _0x56bcee;};'use strict';var _=require('lodash');var uuid=require(_0x5297('0x0'));var util=require(_0x5297('0x1'));var logger=require(_0x5297('0x2'))(_0x5297('0x3'));var Beepall=function(_0x115e60,_0x178801,_0x5b6624,_0x56371f){this['notificationId']=uuid['v4']();this[_0x5297('0x4')]=_0x115e60;this[_0x5297('0x5')]=_0x178801;this[_0x5297('0x6')]=_0x5b6624;this[_0x5297('0x3')]=_0x56371f;this[_0x5297('0x4')][_0x5297('0x7')](this[_0x5297('0x8')]['bind'](this),this[_0x5297('0x9')][_0x5297('0xa')](this));this[_0x5297('0x4')]['on'](_0x5297('0xb'),this[_0x5297('0x9')]['bind'](this));this[_0x5297('0x4')]['on'](_0x5297('0xc'),this[_0x5297('0xd')]['bind'](this));};Beepall[_0x5297('0xe')][_0x5297('0x7')]=function(){this[_0x5297('0x4')]['push'](this[_0x5297('0x8')][_0x5297('0xa')](this),this['handleTimeout']['bind'](this));};Beepall[_0x5297('0xe')][_0x5297('0xd')]=function(_0x5cd992){this[_0x5297('0x9')](!![]);};Beepall['prototype'][_0x5297('0x8')]=function(_0x2af382){var _0x4fbe4d=!![];if(!_[_0x5297('0xf')](this[_0x5297('0x5')])&&!_[_0x5297('0xf')](this[_0x5297('0x5')][_0x5297('0x10')])&&this[_0x5297('0x5')][_0x5297('0x10')][_0x5297('0x11')]>0x0){for(var _0x4ae2fe=0x0,_0x23474a;_0x4ae2fe0x0){for(var _0x173f8e=0x0,_0x4bb73c;_0x173f8e0x0&&_0x31fed2[_0x19c269+_0x6c1c('0x26')]>=_0x31fed2[_0x19c269+'Capacity']){writeLog(_0x9c6c55,_0x31fed2,_0x19c269[_0x6c1c('0x27')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x6c1c('0x28')]=function(_0x4c23f8,_0xcd3179,_0x5f286b,_0x436d17,_0xf557ba){return sendNotification(!![],_0x4c23f8,_0xcd3179,_0x5f286b,_0x436d17,_0xf557ba);};exports['hideNotification']=function(_0x3b1a4f,_0x24da4c,_0x4e13e3,_0x3b319a,_0x19a8f1){return sendNotification(![],_0x3b1a4f,_0x24da4c,_0x4e13e3,_0x3b319a,_0x19a8f1);};exports[_0x6c1c('0x29')]=writeLog; \ No newline at end of file +var _0x5334=['error','format','message','save','remove','info','isAgentAvailable','busy','OFFLINE','Pause','PAUSE','Capacity','hasOwnProperty','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/logger','redis','defaults','emit','user:%s','name','user:save','\x20interaction','account','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5334,0x84));var _0x4533=function(_0x51d9c7,_0x1b0652){_0x51d9c7=_0x51d9c7-0x0;var _0x144a43=_0x5334[_0x51d9c7];return _0x144a43;};'use strict';var _=require(_0x4533('0x0'));var util=require(_0x4533('0x1'));var utils=require(_0x4533('0x2'));var Mustache=require(_0x4533('0x3'));var Redis=require(_0x4533('0x4'));var config=require('../../../../../config/environment');var logger=require(_0x4533('0x5'))('routing');config[_0x4533('0x6')]=_[_0x4533('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4533('0x6')]));function emit(_0x4dea06,_0x4d89e7,_0x487906){io['to'](_0x4dea06)[_0x4533('0x8')](_0x4d89e7,_0x487906);}function sendNotification(_0x42f94b,_0x300877,_0x2489b6,_0x31018b,_0x21b22f,_0xd417){io['to'](util['format'](_0x4533('0x9'),_0x31018b[_0x4533('0xa')]))[_0x4533('0x8')](_0x4533('0xb'),_0x31018b);var _0x5465bf=_0xd417||{};var _0x7b2420=_0x2489b6['split']('.');var _0xc63e3={'uniqueid':_0x300877,'channel':_0x7b2420[0x0],'id':_0x7b2420[0x1],'title':_0x7b2420[0x0]+_0x4533('0xc'),'interactionId':_0x7b2420[0x2],'queue':_0x21b22f?_0x21b22f[_0x4533('0xa')]:null,'sound':_0x5465bf[_0x4533('0xd')]['notificationSound'],'shake':_0x5465bf[_0x4533('0xd')][_0x4533('0xe')]};try{if(!_0x5465bf[_0x4533('0xf')]){_0x5465bf[_0x4533('0xf')]={};}if(_0x21b22f){_0x5465bf['body'][_0x4533('0x10')]=_0x21b22f;}else if(_0x5465bf['body']['queue']){delete _0x5465bf[_0x4533('0xf')][_0x4533('0x10')];}_0xc63e3['msg']=utils[_0x4533('0x11')](_0x5465bf[_0x4533('0xd')][_0x4533('0x12')],_0x5465bf);}catch(_0x551b0d){_0xc63e3[_0x4533('0x13')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x4533('0x14')](util[_0x4533('0x15')]('[%s][QUEUE]\x20%s',_0x300877,_0x551b0d[_0x4533('0x16')]));}io['to'](util['format']('user:%s',_0x31018b[_0x4533('0xa')]))[_0x4533('0x8')](util['format']('notification:%s',_0x42f94b?_0x4533('0x17'):_0x4533('0x18')),_0xc63e3);}function writeLog(_0x3467ba,_0x1b08fa,_0x6766eb){return logger[_0x4533('0x19')](util[_0x4533('0x15')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x3467ba,_0x1b08fa[_0x4533('0xa')],_0x6766eb));}exports[_0x4533('0x1a')]=function(_0x2901f1,_0x4aa438,_0x513011,_0x138fd9){if(_0x4aa438[_0x4533('0x1b')]){writeLog(_0x2901f1,_0x4aa438,'BUSY');return![];}if(!_0x4aa438['online']){writeLog(_0x2901f1,_0x4aa438,_0x4533('0x1c'));return![];}if(_0x4aa438[_0x513011+_0x4533('0x1d')]){writeLog(_0x2901f1,_0x4aa438,_0x4533('0x1e'));return![];}if(_0x138fd9&&_0x4aa438['hasOwnProperty'](_0x513011+_0x4533('0x1f'))&&_0x4aa438[_0x4533('0x20')](_0x513011+_0x4533('0x21'))){if(_0x4aa438[_0x513011+_0x4533('0x1f')]>0x0&&_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 diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 5c355a6..cbeb0b3 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 _0x5b4a=['replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s'];(function(_0x3836ae,_0x33dcdb){var _0x4d4a64=function(_0x58810e){while(--_0x58810e){_0x3836ae['push'](_0x3836ae['shift']());}};_0x4d4a64(++_0x33dcdb);}(_0x5b4a,0x1d1));var _0xa5b4=function(_0x23280e,_0x277637){_0x23280e=_0x23280e-0x0;var _0x1a1c3b=_0x5b4a[_0x23280e];return _0x1a1c3b;};'use strict';var schema=require(_0xa5b4('0x0'));var sh=require(_0xa5b4('0x1'));var _=require(_0xa5b4('0x2'));var utils=require(_0xa5b4('0x3'));var logger=require(_0xa5b4('0x4'))(_0xa5b4('0x5'));var system=schema({'command':{'type':_0xa5b4('0x6'),'required':!![],'message':_0xa5b4('0x7')}});exports['consequence']=function(_0x5d214f,_0x3f0c4f){return function(_0x434b27){try{var _0x4b8ac3={'command':_0x3f0c4f[0x0]};var _0x2b3120=system[_0xa5b4('0x0')](_0x4b8ac3,{'typecast':!![]});if(_0x2b3120[_0xa5b4('0x8')]){logger[_0xa5b4('0x9')](_0xa5b4('0xa'),_0x5d214f,_[_0xa5b4('0xb')](_0x2b3120,_0xa5b4('0xc'))[_0xa5b4('0xd')](',\x20'));logger[_0xa5b4('0xe')](_0xa5b4('0xf'),_0x5d214f);_0x434b27[_0xa5b4('0x10')]();}else{var _0xd75dac=this;var _0x340f36=utils[_0xa5b4('0x11')](_0x3f0c4f[0x0],this);logger[_0xa5b4('0xe')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x5d214f,_0x340f36);sh[_0xa5b4('0x12')](_[_0xa5b4('0x13')](_0x340f36),function(_0x2510ef,_0x4b9280){logger[_0xa5b4('0xe')](_0xa5b4('0x14'),_0x5d214f,_0x2510ef);if(_0x2510ef==0x0){var _0x4deaca=_0x4b9280[_0xa5b4('0x15')](/(\r\n|\n|\r)/gm,'');if(_[_0xa5b4('0x16')](_0x3f0c4f[0x1])||_[_0xa5b4('0x17')](_0x3f0c4f[0x1])){logger[_0xa5b4('0xe')](_0xa5b4('0x18'),_0x5d214f);_0xd75dac[_0xa5b4('0x19')][_0x3f0c4f[0x1]]=_0x4deaca;}else{logger['info'](_0xa5b4('0x1a'),_0x5d214f,_0x3f0c4f[0x1],_0x4deaca);_0xd75dac[_0xa5b4('0x19')][_0x3f0c4f[0x1]]=_0x4deaca;}}_0x434b27[_0xa5b4('0x10')]();});}}catch(_0x3df116){logger['error'](_0xa5b4('0xa'),_0x5d214f,_['isObject'](_0x3df116)?JSON['stringify'](_0x3df116):_0x3df116);logger[_0xa5b4('0xe')](_0xa5b4('0xf'),_0x5d214f);_0x434b27[_0xa5b4('0x10')]();}};}; \ No newline at end of file +var _0x9292=['isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','consequence','length','error','message','next','getMustacheRender','info','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace'];(function(_0x108db1,_0x89896d){var _0x16848d=function(_0x2726f6){while(--_0x2726f6){_0x108db1['push'](_0x108db1['shift']());}};_0x16848d(++_0x89896d);}(_0x9292,0x176));var _0x2929=function(_0x5ce678,_0x189a26){_0x5ce678=_0x5ce678-0x0;var _0x3c3ac2=_0x9292[_0x5ce678];return _0x3c3ac2;};'use strict';var schema=require(_0x2929('0x0'));var sh=require(_0x2929('0x1'));var _=require(_0x2929('0x2'));var utils=require(_0x2929('0x3'));var logger=require(_0x2929('0x4'))(_0x2929('0x5'));var system=schema({'command':{'type':_0x2929('0x6'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x2929('0x7')]=function(_0x65fbd3,_0xcc636a){return function(_0x2605a9){try{var _0x3e3955={'command':_0xcc636a[0x0]};var _0x4da268=system[_0x2929('0x0')](_0x3e3955,{'typecast':!![]});if(_0x4da268[_0x2929('0x8')]){logger[_0x2929('0x9')]('[%s][SYSTEM]\x20%s',_0x65fbd3,_['map'](_0x4da268,_0x2929('0xa'))['join'](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x65fbd3);_0x2605a9[_0x2929('0xb')]();}else{var _0x20ac8f=this;var _0x44349c=utils[_0x2929('0xc')](_0xcc636a[0x0],this);logger[_0x2929('0xd')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x65fbd3,_0x44349c);sh[_0x2929('0xe')](_['trim'](_0x44349c),function(_0x227b2d,_0x40af1f){logger['info'](_0x2929('0xf'),_0x65fbd3,_0x227b2d);if(_0x227b2d==0x0){var _0x2bc5fe=_0x40af1f[_0x2929('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x2929('0x11')](_0xcc636a[0x1])||_[_0x2929('0x12')](_0xcc636a[0x1])){logger[_0x2929('0xd')]('[%s][SYSTEM]\x20no\x20variable',_0x65fbd3);_0x20ac8f[_0x2929('0x13')][_0xcc636a[0x1]]=_0x2bc5fe;}else{logger['info'](_0x2929('0x14'),_0x65fbd3,_0xcc636a[0x1],_0x2bc5fe);_0x20ac8f['body'][_0xcc636a[0x1]]=_0x2bc5fe;}}_0x2605a9[_0x2929('0xb')]();});}}catch(_0xee6565){logger['error']('[%s][SYSTEM]\x20%s',_0x65fbd3,_[_0x2929('0x15')](_0xee6565)?JSON['stringify'](_0xee6565):_0xee6565);logger[_0x2929('0xd')](_0x2929('0x16'),_0x65fbd3);_0x2605a9[_0x2929('0xb')]();}};}; \ 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 5d08cd1..4cc5a78 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 _0x36ce=['../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','message','join','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','next','isObject','stringify','validate','lodash','../../rpc/chatInteraction'];(function(_0x33a6e9,_0x307cbe){var _0x2830fe=function(_0x9fd6ff){while(--_0x9fd6ff){_0x33a6e9['push'](_0x33a6e9['shift']());}};_0x2830fe(++_0x307cbe);}(_0x36ce,0x1a1));var _0xe36c=function(_0x35650f,_0x5efc31){_0x35650f=_0x35650f-0x0;var _0x2a9651=_0x36ce[_0x35650f];return _0x2a9651;};'use strict';var schema=require(_0xe36c('0x0'));var _=require(_0xe36c('0x1'));var rpc={'chatInteraction':require(_0xe36c('0x2')),'openchannelInteraction':require(_0xe36c('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xe36c('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xe36c('0x5'))};var logger=require(_0xe36c('0x6'))(_0xe36c('0x7'));var tag=schema({'tag':{'type':_0xe36c('0x8'),'required':!![],'message':_0xe36c('0x9')}});exports[_0xe36c('0xa')]=function(_0x4bcf6f,_0x19219a,_0x151c74,_0x84590e){return function(_0x4491ef){try{var _0xe9cea1={'tag':_0x19219a[0x0]};var _0x1f2d18=tag[_0xe36c('0x0')](_0xe9cea1,{'typecast':!![]});if(_0x1f2d18['length']){logger[_0xe36c('0xb')](_0xe36c('0xc'),_0x4bcf6f,_['map'](_0x1f2d18,_0xe36c('0xd'))[_0xe36c('0xe')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x4bcf6f);_0x4491ef['next']();}else{var _0x2d87c7={'ids':[_0x19219a[0x0]]};if(rpc[_0x84590e['channel']+'Interaction']){rpc[_0x84590e[_0xe36c('0xf')]+_0xe36c('0x10')][_0xe36c('0x11')](_0x84590e[_0xe36c('0x12')]['id'],_0x2d87c7)[_0xe36c('0x13')](function(_0x106983){logger[_0xe36c('0x14')](_0xe36c('0x15'),_0x4bcf6f,_0x19219a[0x1],_0x84590e[_0xe36c('0xf')],_0x84590e[_0xe36c('0x12')]['id']);})[_0xe36c('0x16')](function(_0x4b08c8){logger[_0xe36c('0xb')](_0xe36c('0xc'),_0x4bcf6f,JSON['stringify'](_0x4b08c8));logger[_0xe36c('0x14')](_0xe36c('0x17'),_0x4bcf6f);})[_0xe36c('0x18')](function(){_0x4491ef[_0xe36c('0x19')]();});}}}catch(_0x572571){logger[_0xe36c('0xb')](_0xe36c('0xc'),_0x4bcf6f,_[_0xe36c('0x1a')](_0x572571)?JSON[_0xe36c('0x1b')](_0x572571):_0x572571);logger[_0xe36c('0x14')](_0xe36c('0x17'),_0x4bcf6f);_0x4491ef['next']();}};}; \ No newline at end of file +var _0x0595=['error','[%s][TAG]\x20%s','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','channel','catch','stringify','finally','next','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence','length'];(function(_0x35e5bb,_0x167e28){var _0x4cd629=function(_0x58013b){while(--_0x58013b){_0x35e5bb['push'](_0x35e5bb['shift']());}};_0x4cd629(++_0x167e28);}(_0x0595,0x1ec));var _0x5059=function(_0x1cd674,_0x4d037d){_0x1cd674=_0x1cd674-0x0;var _0x405e39=_0x0595[_0x1cd674];return _0x405e39;};'use strict';var schema=require('validate');var _=require(_0x5059('0x0'));var rpc={'chatInteraction':require(_0x5059('0x1')),'openchannelInteraction':require(_0x5059('0x2')),'smsInteraction':require(_0x5059('0x3')),'mailInteraction':require(_0x5059('0x4')),'faxInteraction':require(_0x5059('0x5')),'whatsappInteraction':require(_0x5059('0x6'))};var logger=require(_0x5059('0x7'))(_0x5059('0x8'));var tag=schema({'tag':{'type':_0x5059('0x9'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x5059('0xa')]=function(_0x4965ac,_0x292c7b,_0x1b8a20,_0x1a6a10){return function(_0x249238){try{var _0x10f11d={'tag':_0x292c7b[0x0]};var _0x23ebd2=tag['validate'](_0x10f11d,{'typecast':!![]});if(_0x23ebd2[_0x5059('0xb')]){logger[_0x5059('0xc')](_0x5059('0xd'),_0x4965ac,_['map'](_0x23ebd2,_0x5059('0xe'))['join'](',\x20'));logger[_0x5059('0xf')](_0x5059('0x10'),_0x4965ac);_0x249238['next']();}else{var _0x2a7228={'ids':[_0x292c7b[0x0]]};if(rpc[_0x1a6a10['channel']+_0x5059('0x11')]){rpc[_0x1a6a10['channel']+'Interaction'][_0x5059('0x12')](_0x1a6a10[_0x5059('0x13')]['id'],_0x2a7228)[_0x5059('0x14')](function(_0x5ff210){logger[_0x5059('0xf')](_0x5059('0x15'),_0x4965ac,_0x292c7b[0x1],_0x1a6a10[_0x5059('0x16')],_0x1a6a10[_0x5059('0x13')]['id']);})[_0x5059('0x17')](function(_0xb1e501){logger[_0x5059('0xc')]('[%s][TAG]\x20%s',_0x4965ac,JSON[_0x5059('0x18')](_0xb1e501));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x4965ac);})[_0x5059('0x19')](function(){_0x249238[_0x5059('0x1a')]();});}}}catch(_0x73c262){logger[_0x5059('0xc')](_0x5059('0xd'),_0x4965ac,_[_0x5059('0x1b')](_0x73c262)?JSON['stringify'](_0x73c262):_0x73c262);logger['info'](_0x5059('0x10'),_0x4965ac);_0x249238[_0x5059('0x1a')]();}};}; \ 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 a78c930..022a9ec 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(_0x3572bf,_0xe1c369){var _0x3599e9=function(_0x539df2){while(--_0x539df2){_0x3572bf['push'](_0x3572bf['shift']());}};_0x3599e9(++_0xe1c369);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x5ba188,_0x20d44c){var _0x339276=function(_0x2d3e81){while(--_0x2d3e81){_0x5ba188['push'](_0x5ba188['shift']());}};_0x339276(++_0x20d44c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 3d0f022..b4404b1 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 _0x1a68=['lodash','util','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','applications','isArray','length','join','.js','app','toLowerCase','split','mail','slice','push','appdata','dialogflowv2','tag','format','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','rules','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:'];(function(_0x2d812f,_0xf98128){var _0x130ce3=function(_0x52f8f2){while(--_0x52f8f2){_0x2d812f['push'](_0x2d812f['shift']());}};_0x130ce3(++_0xf98128);}(_0x1a68,0x174));var _0x81a6=function(_0x309bd9,_0x3f658d){_0x309bd9=_0x309bd9-0x0;var _0x4b1427=_0x1a68[_0x309bd9];return _0x4b1427;};'use strict';var _=require(_0x81a6('0x0'));var util=require(_0x81a6('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x81a6('0x2'));var BPromise=require(_0x81a6('0x3'));var uuid=require(_0x81a6('0x4'));var config=require(_0x81a6('0x5'));var logger=require(_0x81a6('0x6'))(_0x81a6('0x7'));var rpc={'openchannelQueueReport':require(_0x81a6('0x8')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x81a6('0x9')),'smsQueueReport':require(_0x81a6('0xa')),'faxQueueReport':require(_0x81a6('0xb')),'whatsappQueueReport':require(_0x81a6('0xc'))};var RuleEngine=require(_0x81a6('0xd'));function getId(_0x196fda,_0x16b89f,_0x2b7fb3){return util['format'](_0x81a6('0xe'),_0x196fda,_0x16b89f||0x0,_0x2b7fb3||0x0);}function getIntervals(_0x480b6e,_0x1cef24){var _0x3ce0df=[];if(!_[_0x81a6('0xf')](_0x1cef24[_0x81a6('0x10')])&&!_[_0x81a6('0xf')](_0x480b6e[_0x1cef24[_0x81a6('0x10')]])&&!_[_0x81a6('0xf')](_0x480b6e[_0x1cef24[_0x81a6('0x10')]][_0x81a6('0x11')])){_0x3ce0df=_[_0x81a6('0x12')](_0x480b6e[_0x1cef24['IntervalId']][_0x81a6('0x11')],_0x81a6('0x13'));}else if(!_[_0x81a6('0xf')](_0x1cef24[_0x81a6('0x13')])){_0x3ce0df=[_0x1cef24[_0x81a6('0x13')]];}return _0x3ce0df;}exports[_0x81a6('0x14')]=function(_0x454343){_0x454343['rules']={};return new BPromise(function(_0x39824f,_0x4e861f){var _0x374475={'Start':function(_0x1a1ba8){var _0x3c9bfe=this;return new Promise(function(_0x44f240,_0x48d5c6){if(_0x1a1ba8){try{var _0x418d97=[];var _0x59eb20=getId(_0x1a1ba8[_0x81a6('0x15')],_0x1a1ba8[_0x81a6('0x16')]?_0x1a1ba8[_0x81a6('0x16')]['id']:0x0,_0x1a1ba8[_0x81a6('0x17')]?_0x1a1ba8['interaction']['id']:0x0);if(_0x1a1ba8[_0x81a6('0x18')]&&_[_0x81a6('0x19')](_0x1a1ba8[_0x81a6('0x18')])&&_0x1a1ba8['applications']['length']){for(var _0x2c6476=0x0;_0x2c6476<_0x1a1ba8[_0x81a6('0x18')][_0x81a6('0x1a')];_0x2c6476+=0x1){var _0x4afc0a=_0x1a1ba8['applications'][_0x2c6476];if(fs['existsSync'](path[_0x81a6('0x1b')](__dirname,'applications',_0x4afc0a['app']+_0x81a6('0x1c')))){var _0x1e94af=[];switch(_0x4afc0a[_0x81a6('0x1d')][_0x81a6('0x1e')]()){case'autoreply':var _0x57838f=_0x4afc0a['appdata'][_0x81a6('0x1f')](',');if(_0x1a1ba8['channel']===_0x81a6('0x20')){_0x1e94af['push'](_0x57838f[0x0]);_0x1e94af['push'](_0x57838f[0x1]);_0x1e94af['push'](_0x57838f[_0x81a6('0x21')](0x2,_0x57838f[_0x81a6('0x1a')])['join'](','));}else{_0x1e94af[_0x81a6('0x22')](_0x57838f[0x0]);_0x1e94af[_0x81a6('0x22')](_0x57838f[_0x81a6('0x21')](0x1,_0x57838f[_0x81a6('0x1a')])[_0x81a6('0x1b')](','));}break;case'dialogflow':var _0x1d90c9=_0x4afc0a[_0x81a6('0x23')][_0x81a6('0x1f')](',');_0x1e94af[_0x81a6('0x22')](_0x1d90c9[0x0]);_0x1e94af[_0x81a6('0x22')](_0x1d90c9[0x1]);_0x1e94af[_0x81a6('0x22')](_0x1d90c9[_0x81a6('0x21')](0x2,_0x1d90c9[_0x81a6('0x1a')])[_0x81a6('0x1b')](','));break;case _0x81a6('0x24'):var _0x518577=_0x4afc0a[_0x81a6('0x23')][_0x81a6('0x1f')](',');_0x1e94af[_0x81a6('0x22')](_0x518577[0x0]);_0x1e94af[_0x81a6('0x22')](_0x518577[0x1]);_0x1e94af['push'](_0x518577[0x2]);_0x1e94af[_0x81a6('0x22')](_0x518577[0x3]);_0x1e94af[_0x81a6('0x22')](_0x518577[_0x81a6('0x21')](0x4,_0x518577[_0x81a6('0x1a')])[_0x81a6('0x1b')](','));break;case'amazonlex':var _0x552485=_0x4afc0a['appdata'][_0x81a6('0x1f')](',');_0x1e94af[_0x81a6('0x22')](_0x552485[0x0]);_0x1e94af[_0x81a6('0x22')](_0x552485[0x1]);_0x1e94af['push'](_0x552485[0x2]);_0x1e94af['push'](_0x552485[0x3]);_0x1e94af[_0x81a6('0x22')](_0x552485[_0x81a6('0x21')](0x4,_0x552485[_0x81a6('0x1a')])[_0x81a6('0x1b')](','));break;case _0x81a6('0x16'):_0x1e94af[_0x81a6('0x22')](_0x4afc0a[_0x81a6('0x23')]);break;case _0x81a6('0x25'):_0x1e94af['push'](_0x4afc0a['TagId']);_0x1e94af[_0x81a6('0x22')](_0x4afc0a[_0x81a6('0x23')]);break;default:_0x1e94af=_['isNil'](_0x4afc0a[_0x81a6('0x23')])?[]:_0x4afc0a[_0x81a6('0x23')][_0x81a6('0x1f')](',');}var _0x192482={'id':util[_0x81a6('0x26')]('%s:%s:%s',_0x59eb20,_0x4afc0a['id'],_0x4afc0a['app']),'condition':require('./interval')[_0x81a6('0x27')](_0x59eb20,getIntervals(_0x454343[_0x81a6('0x28')],_0x4afc0a),_0x454343),'consequence':require(_0x81a6('0x29')+_0x4afc0a[_0x81a6('0x1d')])[_0x81a6('0x2a')](_0x59eb20,_0x1e94af,_0x454343,_0x1a1ba8),'p':_0x4afc0a[_0x81a6('0x2b')]||0x0};logger[_0x81a6('0x2c')](_0x81a6('0x2d'),_0x192482['id'],_0x81a6('0x2e'),getIntervals(_0x454343[_0x81a6('0x28')],_0x4afc0a)[_0x81a6('0x1b')](_0x81a6('0x2f')));_0x418d97[_0x81a6('0x22')](_0x192482);}else{logger[_0x81a6('0x30')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x81a6('0x1b')](__dirname,_0x81a6('0x18'),_0x4afc0a[_0x81a6('0x1d')]+_0x81a6('0x1c')));}}_0x454343[_0x81a6('0x31')][_0x59eb20]=new RuleEngine(_0x418d97);_0x454343['rules'][_0x59eb20]['execute'](_0x1a1ba8,function(_0x383798){logger['info'](_0x81a6('0x32'),JSON[_0x81a6('0x33')](_0x383798[_0x81a6('0x34')]));if(_0x454343[_0x81a6('0x31')][_0x59eb20]){_0x454343['rules'][_0x59eb20][_0x81a6('0x35')](_0x81a6('0x36'));}});return _0x44f240({'code':0xc8,'message':_0x1a1ba8});}else{logger['info'](_0x81a6('0x37'));return _0x44f240({'code':0xc8,'message':_0x1a1ba8});}}catch(_0x3c8485){logger[_0x81a6('0x30')](_0x3c8485[_0x81a6('0x38')]);return _0x48d5c6(_0x3c9bfe['error'](0x1f4,_0x3c8485));}}return _0x48d5c6('routing\x20is\x20empty');});},'AcceptMessage':function(_0x5007be){var _0x2399c9=this;return new Promise(function(_0x1e1aca,_0x2de95c){if(_0x5007be[_0x81a6('0x39')]&&_0x5007be[_0x81a6('0x39')]['id']){if(_0x454343[_0x81a6('0x3a')][_0x5007be['agent']['id']]){_0x454343[_0x81a6('0x3a')][_0x5007be[_0x81a6('0x39')]['id']][_0x81a6('0x3b')]=![];_0x454343['agents'][_0x5007be['agent']['id']][_0x81a6('0x3c')]=undefined;}}if(_0x5007be[_0x81a6('0x16')]&&_0x5007be[_0x81a6('0x16')]['id']){try{var _0x39e9ac=getId(_0x5007be[_0x81a6('0x15')],_0x5007be[_0x81a6('0x16')]?_0x5007be[_0x81a6('0x16')]['id']:0x0,_0x5007be[_0x81a6('0x17')]?_0x5007be[_0x81a6('0x17')]['id']:0x0);if(_0x454343[_0x81a6('0x31')][_0x39e9ac]){_0x454343[_0x81a6('0x31')][_0x39e9ac]['emit']('end');if(rpc[_0x5007be[_0x81a6('0x15')]+'QueueReport']){rpc[_0x5007be['channel']+_0x81a6('0x3d')][_0x81a6('0x3e')](_0x39e9ac,{'UserId':_0x5007be[_0x81a6('0x16')][_0x81a6('0x3f')]})[_0x81a6('0x40')](function(_0x55481d){logger[_0x81a6('0x30')](_0x81a6('0x41'));});}}return _0x1e1aca({'code':0xc8,'message':_0x5007be});}catch(_0x2c8df2){logger[_0x81a6('0x30')](_0x2c8df2[_0x81a6('0x38')]);return _0x2de95c(_0x2399c9['error'](0x1f4,_0x2c8df2));}}logger[_0x81a6('0x30')](_0x81a6('0x42'));return _0x2de95c(_0x2399c9[_0x81a6('0x30')](0x1f4,_0x81a6('0x42')));});},'RejectMessage':function(_0x40f339){var _0x29a780=this;return new Promise(function(_0x57e9c2,_0xa6672b){if(_0x40f339[_0x81a6('0x39')]&&_0x40f339['agent']['id']){try{if(_0x454343['agents'][_0x40f339[_0x81a6('0x39')]['id']]){_0x454343[_0x81a6('0x3a')][_0x40f339[_0x81a6('0x39')]['id']]['busy']=![];_0x454343[_0x81a6('0x3a')][_0x40f339[_0x81a6('0x39')]['id']]['busyQueue']=undefined;}return _0x57e9c2({'code':0xc8,'message':_0x40f339});}catch(_0x58d357){logger[_0x81a6('0x30')](_0x58d357[_0x81a6('0x38')]);return _0xa6672b(_0x29a780[_0x81a6('0x30')](0x1f4,_0x58d357));}}logger['error']('message\x20is\x20empty');return _0xa6672b(_0x29a780[_0x81a6('0x30')](0x1f4,_0x81a6('0x42')));});},'AbandonInteraction':function(_0x46d42c){var _0x29f832=this;return new Promise(function(_0x94f690,_0x3d64a8){if(_0x46d42c[_0x81a6('0x15')]&&_0x46d42c[_0x81a6('0x17')]&&_0x46d42c[_0x81a6('0x17')]['id']){try{var _0x4f4808=getId(_0x46d42c[_0x81a6('0x15')],_0x46d42c[_0x81a6('0x16')]?_0x46d42c[_0x81a6('0x16')]['id']:0x0,_0x46d42c[_0x81a6('0x17')]?_0x46d42c[_0x81a6('0x17')]['id']:0x0);if(_0x454343[_0x81a6('0x31')][_0x4f4808]){_0x454343[_0x81a6('0x31')][_0x4f4808][_0x81a6('0x35')]('end');}return _0x94f690({'code':0xc8,'message':_0x46d42c});}catch(_0x222237){logger[_0x81a6('0x30')](_0x222237[_0x81a6('0x38')]);return _0x3d64a8(_0x29f832[_0x81a6('0x30')](0x1f4,_0x222237));}}logger[_0x81a6('0x30')]('message\x20is\x20empty');return _0x3d64a8(_0x29f832[_0x81a6('0x30')](0x1f4,_0x81a6('0x42')));});},'AgentCapacity':function(_0x1c18aa){var _0x4c046a=this;return new Promise(function(_0x37b191,_0x2744ef){if(_0x454343[_0x81a6('0x3a')][_0x81a6('0x43')](_0x1c18aa['id'])){for(var _0x1aeb02 in _0x1c18aa[_0x81a6('0x44')]){if(_0x1c18aa[_0x81a6('0x44')][_0x81a6('0x43')](_0x1aeb02)){if(_0x454343[_0x81a6('0x3a')][_0x1c18aa['id']]['hasOwnProperty'](_0x1aeb02+_0x81a6('0x45'))){_0x454343[_0x81a6('0x3a')][_0x1c18aa['id']][_0x1aeb02+'CurrentCapacity']=parseInt(_0x1c18aa[_0x81a6('0x44')][_0x1aeb02],0xa);}}}_0x454343[_0x81a6('0x3a')][_0x1c18aa['id']]['updateRealtime']();return _0x37b191({'code':0xc8,'message':_0x454343[_0x81a6('0x3a')][_0x1c18aa['id']]});}else{return _0x2744ef(_0x4c046a[_0x81a6('0x30')](0x1f4,_0x81a6('0x46')));}});},'Agents':function(_0x3f4058){return new Promise(function(_0x4f66f8,_0x4de3e5){var _0x9d3388=_[_0x81a6('0x47')](_0x454343[_0x81a6('0x3a')]);_0x4f66f8({'count':_0x9d3388['length'],'rows':_0x9d3388});});},'ChatQueues':function(_0x144c9a){return new Promise(function(_0x141789,_0x3fc620){var _0xa14141=[];for(var _0x1fe919 in _0x454343[_0x81a6('0x48')]){if(_0x454343[_0x81a6('0x48')][_0x81a6('0x43')](_0x1fe919)){var _0x1d20f9=_0x454343[_0x81a6('0x48')][_0x1fe919];var _0x6154e6={'id':_0x1d20f9['id'],'available':_0x1d20f9[_0x81a6('0x49')],'loggedIn':_0x1d20f9[_0x81a6('0x4a')],'name':_0x1d20f9[_0x81a6('0x4b')],'paused':_0x1d20f9[_0x81a6('0x4c')],'waiting':_0x1d20f9['waiting']};_0xa14141[_0x81a6('0x22')](_0x6154e6);}}_0x141789({'count':_0xa14141[_0x81a6('0x1a')],'rows':_0xa14141});});},'MailQueues':function(_0x43a822){return new Promise(function(_0x374c05,_0x4e4168){var _0x2f57f2=[];for(var _0x234b03 in _0x454343[_0x81a6('0x4d')]){if(_0x454343['mailQueues'][_0x81a6('0x43')](_0x234b03)){var _0x11261b=_0x454343['mailQueues'][_0x234b03];var _0x4ecfce={'id':_0x11261b['id'],'available':_0x11261b[_0x81a6('0x49')],'loggedIn':_0x11261b[_0x81a6('0x4a')],'name':_0x11261b[_0x81a6('0x4b')],'paused':_0x11261b[_0x81a6('0x4c')],'waiting':_0x11261b[_0x81a6('0x4e')]};_0x2f57f2[_0x81a6('0x22')](_0x4ecfce);}}_0x374c05({'count':_0x2f57f2[_0x81a6('0x1a')],'rows':_0x2f57f2});});},'OpenchannelQueues':function(_0x113b0a){return new Promise(function(_0x50fa09,_0x210f2f){var _0x498973=[];for(var _0x4d375c in _0x454343[_0x81a6('0x4f')]){if(_0x454343[_0x81a6('0x4f')][_0x81a6('0x43')](_0x4d375c)){var _0x176469=_0x454343[_0x81a6('0x4f')][_0x4d375c];var _0x183d25={'id':_0x176469['id'],'available':_0x176469['available'],'loggedIn':_0x176469[_0x81a6('0x4a')],'name':_0x176469[_0x81a6('0x4b')],'paused':_0x176469[_0x81a6('0x4c')],'waiting':_0x176469[_0x81a6('0x4e')]};_0x498973['push'](_0x183d25);}}_0x50fa09({'count':_0x498973['length'],'rows':_0x498973});});},'SmsQueues':function(_0x5ea0cf){return new Promise(function(_0x2a43d7,_0x469732){var _0x1034a1=[];for(var _0x360724 in _0x454343[_0x81a6('0x50')]){if(_0x454343[_0x81a6('0x50')]['hasOwnProperty'](_0x360724)){var _0x3ac993=_0x454343[_0x81a6('0x50')][_0x360724];var _0x355b4f={'id':_0x3ac993['id'],'available':_0x3ac993[_0x81a6('0x49')],'loggedIn':_0x3ac993['loggedIn'],'name':_0x3ac993[_0x81a6('0x4b')],'paused':_0x3ac993[_0x81a6('0x4c')],'waiting':_0x3ac993['waiting']};_0x1034a1['push'](_0x355b4f);}}_0x2a43d7({'count':_0x1034a1[_0x81a6('0x1a')],'rows':_0x1034a1});});},'FaxQueues':function(_0x32c903){return new Promise(function(_0x4af619,_0x18b110){var _0x4af9f3=[];for(var _0x48ad9f in _0x454343[_0x81a6('0x51')]){if(_0x454343['faxQueues'][_0x81a6('0x43')](_0x48ad9f)){var _0x1c5189=_0x454343[_0x81a6('0x51')][_0x48ad9f];var _0x2e8b06={'id':_0x1c5189['id'],'available':_0x1c5189['available'],'loggedIn':_0x1c5189['loggedIn'],'name':_0x1c5189[_0x81a6('0x4b')],'paused':_0x1c5189['paused'],'waiting':_0x1c5189[_0x81a6('0x4e')]};_0x4af9f3['push'](_0x2e8b06);}}_0x4af619({'count':_0x4af9f3['length'],'rows':_0x4af9f3});});},'WhatsappQueues':function(_0x5a5739){return new Promise(function(_0x33df21,_0x38b2f3){var _0x9fc1c5=[];for(var _0x1b9368 in _0x454343[_0x81a6('0x52')]){if(_0x454343[_0x81a6('0x52')][_0x81a6('0x43')](_0x1b9368)){var _0x142b87=_0x454343[_0x81a6('0x52')][_0x1b9368];var _0x4de607={'id':_0x142b87['id'],'available':_0x142b87[_0x81a6('0x49')],'loggedIn':_0x142b87[_0x81a6('0x4a')],'name':_0x142b87['name'],'paused':_0x142b87[_0x81a6('0x4c')],'waiting':_0x142b87[_0x81a6('0x4e')]};_0x9fc1c5['push'](_0x4de607);}}_0x33df21({'count':_0x9fc1c5['length'],'rows':_0x9fc1c5});});},'ChatQueuesWaitingInteractions':function(_0x1eb7bc){return new Promise(function(_0x1a29bc,_0x3ba05a){var _0x536626=_[_0x81a6('0x47')](_0x454343['chatQueuesWaitingInteractions']);_0x1a29bc({'count':_0x536626['length'],'rows':_0x536626});});},'MailQueuesWaitingInteractions':function(_0x14b255){return new Promise(function(_0xe99af4,_0x4e6c51){var _0x26fff0=_['values'](_0x454343[_0x81a6('0x53')]);_0xe99af4({'count':_0x26fff0['length'],'rows':_0x26fff0});});},'OpenchannelQueuesWaitingInteractions':function(_0xd510b9){return new Promise(function(_0x5512db,_0x308f87){var _0x8d7e43=_[_0x81a6('0x47')](_0x454343[_0x81a6('0x54')]);_0x5512db({'count':_0x8d7e43[_0x81a6('0x1a')],'rows':_0x8d7e43});});},'SmsQueuesWaitingInteractions':function(_0xbca0ef){return new Promise(function(_0xacded1,_0x2e859e){var _0x28d5c4=_[_0x81a6('0x47')](_0x454343[_0x81a6('0x55')]);_0xacded1({'count':_0x28d5c4['length'],'rows':_0x28d5c4});});},'FaxQueuesWaitingInteractions':function(_0x55fcf7){return new Promise(function(_0x321315,_0x50cc42){var _0x524e3f=_[_0x81a6('0x47')](_0x454343[_0x81a6('0x56')]);_0x321315({'count':_0x524e3f['length'],'rows':_0x524e3f});});},'WhatsappQueuesWaitingInteractions':function(_0x9999bf){return new Promise(function(_0x2d7b74,_0x4f4f10){var _0x18b906=_[_0x81a6('0x47')](_0x454343['whatsappQueuesWaitingInteractions']);_0x2d7b74({'count':_0x18b906[_0x81a6('0x1a')],'rows':_0x18b906});});}};var _0x320b4d=jayson[_0x81a6('0x57')](_0x374475)[_0x81a6('0x58')]();_0x320b4d['on'](_0x81a6('0x30'),function(_0x3ea7f7){logger['error'](JSON[_0x81a6('0x33')](_0x3ea7f7));return _0x4e861f(_0x3ea7f7);});_0x320b4d[_0x81a6('0x14')](0x232c,_0x81a6('0x59'),function(){console[_0x81a6('0x5a')](_0x81a6('0x5b'),0x232c);return _0x39824f(_0x81a6('0x5c')+0x232c);});});}; \ No newline at end of file +var _0xac11=['../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','toLowerCase','appdata','split','mail','push','slice','dialogflow','amazonlex','tag','%s:%s:%s','./interval','intervals','./applications/','priority','on\x20interval','\x20|\x20','error','.js','execute','info','Applications\x20executed','matchPath','complete','No\x20applications\x20to\x20execute','stack','agent','agents','busy','emit','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','capacity','hasOwnProperty','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','stringify','127.0.0.1','log','lodash','path','jayson/promise','bluebird','../../../config/environment','../rpc/openchannelQueueReport','../rpc/mailQueueReport'];(function(_0x5ae0da,_0x181492){var _0x4ec133=function(_0x3814b7){while(--_0x3814b7){_0x5ae0da['push'](_0x5ae0da['shift']());}};_0x4ec133(++_0x181492);}(_0xac11,0xad));var _0x1ac1=function(_0x1a0437,_0x403005){_0x1a0437=_0x1a0437-0x0;var _0x267508=_0xac11[_0x1a0437];return _0x267508;};'use strict';var _=require(_0x1ac1('0x0'));var util=require('util');var path=require(_0x1ac1('0x1'));var fs=require('fs');var jayson=require(_0x1ac1('0x2'));var BPromise=require(_0x1ac1('0x3'));var uuid=require('uuid');var config=require(_0x1ac1('0x4'));var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0x1ac1('0x5')),'mailQueueReport':require(_0x1ac1('0x6')),'chatQueueReport':require(_0x1ac1('0x7')),'smsQueueReport':require(_0x1ac1('0x8')),'faxQueueReport':require(_0x1ac1('0x9')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x1ac1('0xa'));function getId(_0x4c8269,_0x4ea7bc,_0xce7c36){return util[_0x1ac1('0xb')]('%s.%s.%s',_0x4c8269,_0x4ea7bc||0x0,_0xce7c36||0x0);}function getIntervals(_0x5ce7ba,_0xece834){var _0x2ea76f=[];if(!_[_0x1ac1('0xc')](_0xece834[_0x1ac1('0xd')])&&!_[_0x1ac1('0xc')](_0x5ce7ba[_0xece834[_0x1ac1('0xd')]])&&!_[_0x1ac1('0xc')](_0x5ce7ba[_0xece834[_0x1ac1('0xd')]][_0x1ac1('0xe')])){_0x2ea76f=_[_0x1ac1('0xf')](_0x5ce7ba[_0xece834['IntervalId']][_0x1ac1('0xe')],_0x1ac1('0x10'));}else if(!_[_0x1ac1('0xc')](_0xece834[_0x1ac1('0x10')])){_0x2ea76f=[_0xece834[_0x1ac1('0x10')]];}return _0x2ea76f;}exports[_0x1ac1('0x11')]=function(_0x47b173){_0x47b173[_0x1ac1('0x12')]={};return new BPromise(function(_0x2e0b0b,_0x433e7d){var _0x370097={'Start':function(_0x10157f){var _0x38afec=this;return new Promise(function(_0xb5adca,_0x3c2b74){if(_0x10157f){try{var _0x196bba=[];var _0x52249e=getId(_0x10157f[_0x1ac1('0x13')],_0x10157f[_0x1ac1('0x14')]?_0x10157f[_0x1ac1('0x14')]['id']:0x0,_0x10157f[_0x1ac1('0x15')]?_0x10157f[_0x1ac1('0x15')]['id']:0x0);if(_0x10157f[_0x1ac1('0x16')]&&_[_0x1ac1('0x17')](_0x10157f[_0x1ac1('0x16')])&&_0x10157f[_0x1ac1('0x16')][_0x1ac1('0x18')]){for(var _0x19dd3e=0x0;_0x19dd3e<_0x10157f['applications']['length'];_0x19dd3e+=0x1){var _0x3328a5=_0x10157f['applications'][_0x19dd3e];if(fs[_0x1ac1('0x19')](path[_0x1ac1('0x1a')](__dirname,_0x1ac1('0x16'),_0x3328a5[_0x1ac1('0x1b')]+'.js'))){var _0x19c474=[];switch(_0x3328a5[_0x1ac1('0x1b')][_0x1ac1('0x1c')]()){case'autoreply':var _0x1c959a=_0x3328a5[_0x1ac1('0x1d')][_0x1ac1('0x1e')](',');if(_0x10157f[_0x1ac1('0x13')]===_0x1ac1('0x1f')){_0x19c474[_0x1ac1('0x20')](_0x1c959a[0x0]);_0x19c474[_0x1ac1('0x20')](_0x1c959a[0x1]);_0x19c474[_0x1ac1('0x20')](_0x1c959a[_0x1ac1('0x21')](0x2,_0x1c959a[_0x1ac1('0x18')])['join'](','));}else{_0x19c474[_0x1ac1('0x20')](_0x1c959a[0x0]);_0x19c474[_0x1ac1('0x20')](_0x1c959a[_0x1ac1('0x21')](0x1,_0x1c959a[_0x1ac1('0x18')])['join'](','));}break;case _0x1ac1('0x22'):var _0x16962f=_0x3328a5[_0x1ac1('0x1d')][_0x1ac1('0x1e')](',');_0x19c474[_0x1ac1('0x20')](_0x16962f[0x0]);_0x19c474['push'](_0x16962f[0x1]);_0x19c474['push'](_0x16962f[_0x1ac1('0x21')](0x2,_0x16962f[_0x1ac1('0x18')])['join'](','));break;case'dialogflowv2':var _0x1a34c9=_0x3328a5['appdata'][_0x1ac1('0x1e')](',');_0x19c474[_0x1ac1('0x20')](_0x1a34c9[0x0]);_0x19c474['push'](_0x1a34c9[0x1]);_0x19c474[_0x1ac1('0x20')](_0x1a34c9[0x2]);_0x19c474[_0x1ac1('0x20')](_0x1a34c9[0x3]);_0x19c474['push'](_0x1a34c9[_0x1ac1('0x21')](0x4,_0x1a34c9[_0x1ac1('0x18')])[_0x1ac1('0x1a')](','));break;case _0x1ac1('0x23'):var _0x35fea8=_0x3328a5[_0x1ac1('0x1d')][_0x1ac1('0x1e')](',');_0x19c474[_0x1ac1('0x20')](_0x35fea8[0x0]);_0x19c474[_0x1ac1('0x20')](_0x35fea8[0x1]);_0x19c474[_0x1ac1('0x20')](_0x35fea8[0x2]);_0x19c474['push'](_0x35fea8[0x3]);_0x19c474[_0x1ac1('0x20')](_0x35fea8[_0x1ac1('0x21')](0x4,_0x35fea8[_0x1ac1('0x18')])['join'](','));break;case'message':_0x19c474['push'](_0x3328a5['appdata']);break;case _0x1ac1('0x24'):_0x19c474[_0x1ac1('0x20')](_0x3328a5['TagId']);_0x19c474['push'](_0x3328a5[_0x1ac1('0x1d')]);break;default:_0x19c474=_[_0x1ac1('0xc')](_0x3328a5[_0x1ac1('0x1d')])?[]:_0x3328a5['appdata'][_0x1ac1('0x1e')](',');}var _0x448c71={'id':util[_0x1ac1('0xb')](_0x1ac1('0x25'),_0x52249e,_0x3328a5['id'],_0x3328a5[_0x1ac1('0x1b')]),'condition':require(_0x1ac1('0x26'))['condition'](_0x52249e,getIntervals(_0x47b173[_0x1ac1('0x27')],_0x3328a5),_0x47b173),'consequence':require(_0x1ac1('0x28')+_0x3328a5[_0x1ac1('0x1b')])['consequence'](_0x52249e,_0x19c474,_0x47b173,_0x10157f),'p':_0x3328a5[_0x1ac1('0x29')]||0x0};logger['info']('Push\x20new\x20rule',_0x448c71['id'],_0x1ac1('0x2a'),getIntervals(_0x47b173[_0x1ac1('0x27')],_0x3328a5)['join'](_0x1ac1('0x2b')));_0x196bba['push'](_0x448c71);}else{logger[_0x1ac1('0x2c')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x1ac1('0x1a')](__dirname,_0x1ac1('0x16'),_0x3328a5[_0x1ac1('0x1b')]+_0x1ac1('0x2d')));}}_0x47b173[_0x1ac1('0x12')][_0x52249e]=new RuleEngine(_0x196bba);_0x47b173['rules'][_0x52249e][_0x1ac1('0x2e')](_0x10157f,function(_0x17b0bb){logger[_0x1ac1('0x2f')](_0x1ac1('0x30'),JSON['stringify'](_0x17b0bb[_0x1ac1('0x31')]));if(_0x47b173['rules'][_0x52249e]){_0x47b173['rules'][_0x52249e]['emit'](_0x1ac1('0x32'));}});return _0xb5adca({'code':0xc8,'message':_0x10157f});}else{logger[_0x1ac1('0x2f')](_0x1ac1('0x33'));return _0xb5adca({'code':0xc8,'message':_0x10157f});}}catch(_0x1f4e0e){logger[_0x1ac1('0x2c')](_0x1f4e0e[_0x1ac1('0x34')]);return _0x3c2b74(_0x38afec[_0x1ac1('0x2c')](0x1f4,_0x1f4e0e));}}return _0x3c2b74('routing\x20is\x20empty');});},'AcceptMessage':function(_0x486869){var _0x172bc9=this;return new Promise(function(_0x5a9be4,_0x209822){if(_0x486869[_0x1ac1('0x35')]&&_0x486869[_0x1ac1('0x35')]['id']){if(_0x47b173[_0x1ac1('0x36')][_0x486869[_0x1ac1('0x35')]['id']]){_0x47b173[_0x1ac1('0x36')][_0x486869[_0x1ac1('0x35')]['id']][_0x1ac1('0x37')]=![];_0x47b173[_0x1ac1('0x36')][_0x486869[_0x1ac1('0x35')]['id']]['busyQueue']=undefined;}}if(_0x486869[_0x1ac1('0x14')]&&_0x486869[_0x1ac1('0x14')]['id']){try{var _0x3ed482=getId(_0x486869[_0x1ac1('0x13')],_0x486869[_0x1ac1('0x14')]?_0x486869['message']['id']:0x0,_0x486869[_0x1ac1('0x15')]?_0x486869[_0x1ac1('0x15')]['id']:0x0);if(_0x47b173['rules'][_0x3ed482]){_0x47b173[_0x1ac1('0x12')][_0x3ed482][_0x1ac1('0x38')](_0x1ac1('0x39'));if(rpc[_0x486869[_0x1ac1('0x13')]+_0x1ac1('0x3a')]){rpc[_0x486869[_0x1ac1('0x13')]+_0x1ac1('0x3a')][_0x1ac1('0x3b')](_0x3ed482,{'UserId':_0x486869['message'][_0x1ac1('0x3c')]})[_0x1ac1('0x3d')](function(_0x169b43){logger[_0x1ac1('0x2c')](_0x1ac1('0x3e'));});}}return _0x5a9be4({'code':0xc8,'message':_0x486869});}catch(_0x3040af){logger[_0x1ac1('0x2c')](_0x3040af['stack']);return _0x209822(_0x172bc9[_0x1ac1('0x2c')](0x1f4,_0x3040af));}}logger['error'](_0x1ac1('0x3f'));return _0x209822(_0x172bc9['error'](0x1f4,_0x1ac1('0x3f')));});},'RejectMessage':function(_0x141a57){var _0x5be38e=this;return new Promise(function(_0x1bc581,_0x372614){if(_0x141a57[_0x1ac1('0x35')]&&_0x141a57[_0x1ac1('0x35')]['id']){try{if(_0x47b173['agents'][_0x141a57[_0x1ac1('0x35')]['id']]){_0x47b173[_0x1ac1('0x36')][_0x141a57[_0x1ac1('0x35')]['id']][_0x1ac1('0x37')]=![];_0x47b173[_0x1ac1('0x36')][_0x141a57[_0x1ac1('0x35')]['id']][_0x1ac1('0x40')]=undefined;}return _0x1bc581({'code':0xc8,'message':_0x141a57});}catch(_0x440392){logger[_0x1ac1('0x2c')](_0x440392[_0x1ac1('0x34')]);return _0x372614(_0x5be38e['error'](0x1f4,_0x440392));}}logger[_0x1ac1('0x2c')]('message\x20is\x20empty');return _0x372614(_0x5be38e['error'](0x1f4,_0x1ac1('0x3f')));});},'AbandonInteraction':function(_0x314d00){var _0x2a3016=this;return new Promise(function(_0x3ddd1c,_0x48a0ec){if(_0x314d00[_0x1ac1('0x13')]&&_0x314d00[_0x1ac1('0x15')]&&_0x314d00['interaction']['id']){try{var _0x4f7818=getId(_0x314d00[_0x1ac1('0x13')],_0x314d00[_0x1ac1('0x14')]?_0x314d00[_0x1ac1('0x14')]['id']:0x0,_0x314d00[_0x1ac1('0x15')]?_0x314d00[_0x1ac1('0x15')]['id']:0x0);if(_0x47b173[_0x1ac1('0x12')][_0x4f7818]){_0x47b173[_0x1ac1('0x12')][_0x4f7818][_0x1ac1('0x38')]('end');}return _0x3ddd1c({'code':0xc8,'message':_0x314d00});}catch(_0x179bba){logger['error'](_0x179bba[_0x1ac1('0x34')]);return _0x48a0ec(_0x2a3016['error'](0x1f4,_0x179bba));}}logger[_0x1ac1('0x2c')](_0x1ac1('0x3f'));return _0x48a0ec(_0x2a3016[_0x1ac1('0x2c')](0x1f4,_0x1ac1('0x3f')));});},'AgentCapacity':function(_0x2a96d3){var _0x14051f=this;return new Promise(function(_0x5a1708,_0x43f2ce){if(_0x47b173[_0x1ac1('0x36')]['hasOwnProperty'](_0x2a96d3['id'])){for(var _0x3cfc46 in _0x2a96d3[_0x1ac1('0x41')]){if(_0x2a96d3[_0x1ac1('0x41')][_0x1ac1('0x42')](_0x3cfc46)){if(_0x47b173[_0x1ac1('0x36')][_0x2a96d3['id']][_0x1ac1('0x42')](_0x3cfc46+_0x1ac1('0x43'))){_0x47b173[_0x1ac1('0x36')][_0x2a96d3['id']][_0x3cfc46+_0x1ac1('0x43')]=parseInt(_0x2a96d3['capacity'][_0x3cfc46],0xa);}}}_0x47b173[_0x1ac1('0x36')][_0x2a96d3['id']]['updateRealtime']();return _0x5a1708({'code':0xc8,'message':_0x47b173[_0x1ac1('0x36')][_0x2a96d3['id']]});}else{return _0x43f2ce(_0x14051f[_0x1ac1('0x2c')](0x1f4,_0x1ac1('0x44')));}});},'Agents':function(_0x4e8aa4){return new Promise(function(_0x13d9d1,_0x4bdd70){var _0x36a21f=_[_0x1ac1('0x45')](_0x47b173['agents']);_0x13d9d1({'count':_0x36a21f[_0x1ac1('0x18')],'rows':_0x36a21f});});},'ChatQueues':function(_0x303e13){return new Promise(function(_0x562a4c,_0x351f3b){var _0xed36c=[];for(var _0x1d4f4d in _0x47b173[_0x1ac1('0x46')]){if(_0x47b173[_0x1ac1('0x46')][_0x1ac1('0x42')](_0x1d4f4d)){var _0x32e46a=_0x47b173[_0x1ac1('0x46')][_0x1d4f4d];var _0x390687={'id':_0x32e46a['id'],'available':_0x32e46a[_0x1ac1('0x47')],'loggedIn':_0x32e46a['loggedIn'],'name':_0x32e46a[_0x1ac1('0x48')],'paused':_0x32e46a[_0x1ac1('0x49')],'waiting':_0x32e46a[_0x1ac1('0x4a')]};_0xed36c[_0x1ac1('0x20')](_0x390687);}}_0x562a4c({'count':_0xed36c[_0x1ac1('0x18')],'rows':_0xed36c});});},'MailQueues':function(_0x4c75b3){return new Promise(function(_0x271fa,_0x2ea8ee){var _0x3fda57=[];for(var _0x921fd0 in _0x47b173['mailQueues']){if(_0x47b173[_0x1ac1('0x4b')]['hasOwnProperty'](_0x921fd0)){var _0x22ad16=_0x47b173[_0x1ac1('0x4b')][_0x921fd0];var _0x522a9a={'id':_0x22ad16['id'],'available':_0x22ad16['available'],'loggedIn':_0x22ad16[_0x1ac1('0x4c')],'name':_0x22ad16[_0x1ac1('0x48')],'paused':_0x22ad16[_0x1ac1('0x49')],'waiting':_0x22ad16['waiting']};_0x3fda57[_0x1ac1('0x20')](_0x522a9a);}}_0x271fa({'count':_0x3fda57[_0x1ac1('0x18')],'rows':_0x3fda57});});},'OpenchannelQueues':function(_0x152f14){return new Promise(function(_0x7e4752,_0x268cee){var _0x466201=[];for(var _0x2d0018 in _0x47b173[_0x1ac1('0x4d')]){if(_0x47b173[_0x1ac1('0x4d')][_0x1ac1('0x42')](_0x2d0018)){var _0x1464a6=_0x47b173['openchannelQueues'][_0x2d0018];var _0x3b923f={'id':_0x1464a6['id'],'available':_0x1464a6[_0x1ac1('0x47')],'loggedIn':_0x1464a6[_0x1ac1('0x4c')],'name':_0x1464a6[_0x1ac1('0x48')],'paused':_0x1464a6[_0x1ac1('0x49')],'waiting':_0x1464a6[_0x1ac1('0x4a')]};_0x466201[_0x1ac1('0x20')](_0x3b923f);}}_0x7e4752({'count':_0x466201[_0x1ac1('0x18')],'rows':_0x466201});});},'SmsQueues':function(_0x36a467){return new Promise(function(_0x80670,_0x58198b){var _0x3ec4a3=[];for(var _0x4f1532 in _0x47b173[_0x1ac1('0x4e')]){if(_0x47b173[_0x1ac1('0x4e')]['hasOwnProperty'](_0x4f1532)){var _0x577a96=_0x47b173['smsQueues'][_0x4f1532];var _0x5eea86={'id':_0x577a96['id'],'available':_0x577a96['available'],'loggedIn':_0x577a96[_0x1ac1('0x4c')],'name':_0x577a96['name'],'paused':_0x577a96['paused'],'waiting':_0x577a96[_0x1ac1('0x4a')]};_0x3ec4a3[_0x1ac1('0x20')](_0x5eea86);}}_0x80670({'count':_0x3ec4a3[_0x1ac1('0x18')],'rows':_0x3ec4a3});});},'FaxQueues':function(_0x499dd2){return new Promise(function(_0x4c839b,_0x201a6f){var _0x557d8f=[];for(var _0x3e8a0d in _0x47b173[_0x1ac1('0x4f')]){if(_0x47b173['faxQueues'][_0x1ac1('0x42')](_0x3e8a0d)){var _0x4ff694=_0x47b173[_0x1ac1('0x4f')][_0x3e8a0d];var _0x2c5322={'id':_0x4ff694['id'],'available':_0x4ff694[_0x1ac1('0x47')],'loggedIn':_0x4ff694[_0x1ac1('0x4c')],'name':_0x4ff694[_0x1ac1('0x48')],'paused':_0x4ff694[_0x1ac1('0x49')],'waiting':_0x4ff694[_0x1ac1('0x4a')]};_0x557d8f[_0x1ac1('0x20')](_0x2c5322);}}_0x4c839b({'count':_0x557d8f[_0x1ac1('0x18')],'rows':_0x557d8f});});},'WhatsappQueues':function(_0x27eb07){return new Promise(function(_0x9d55ff,_0x170505){var _0x4292b2=[];for(var _0x573bba in _0x47b173[_0x1ac1('0x50')]){if(_0x47b173[_0x1ac1('0x50')][_0x1ac1('0x42')](_0x573bba)){var _0x5e2547=_0x47b173[_0x1ac1('0x50')][_0x573bba];var _0x54c256={'id':_0x5e2547['id'],'available':_0x5e2547[_0x1ac1('0x47')],'loggedIn':_0x5e2547[_0x1ac1('0x4c')],'name':_0x5e2547['name'],'paused':_0x5e2547['paused'],'waiting':_0x5e2547[_0x1ac1('0x4a')]};_0x4292b2[_0x1ac1('0x20')](_0x54c256);}}_0x9d55ff({'count':_0x4292b2[_0x1ac1('0x18')],'rows':_0x4292b2});});},'ChatQueuesWaitingInteractions':function(_0x632137){return new Promise(function(_0x4f8e5e,_0x40f7b4){var _0x3fb62d=_[_0x1ac1('0x45')](_0x47b173[_0x1ac1('0x51')]);_0x4f8e5e({'count':_0x3fb62d[_0x1ac1('0x18')],'rows':_0x3fb62d});});},'MailQueuesWaitingInteractions':function(_0x2af51a){return new Promise(function(_0x447599,_0x1ae212){var _0xf6f987=_[_0x1ac1('0x45')](_0x47b173[_0x1ac1('0x52')]);_0x447599({'count':_0xf6f987[_0x1ac1('0x18')],'rows':_0xf6f987});});},'OpenchannelQueuesWaitingInteractions':function(_0x1829b8){return new Promise(function(_0x5d6232,_0x383dfe){var _0xdf1ecf=_['values'](_0x47b173[_0x1ac1('0x53')]);_0x5d6232({'count':_0xdf1ecf[_0x1ac1('0x18')],'rows':_0xdf1ecf});});},'SmsQueuesWaitingInteractions':function(_0x531081){return new Promise(function(_0x521f2f,_0x4d738e){var _0x240f6c=_[_0x1ac1('0x45')](_0x47b173[_0x1ac1('0x54')]);_0x521f2f({'count':_0x240f6c[_0x1ac1('0x18')],'rows':_0x240f6c});});},'FaxQueuesWaitingInteractions':function(_0x18e388){return new Promise(function(_0x217dc5,_0x397ea6){var _0x25f246=_[_0x1ac1('0x45')](_0x47b173[_0x1ac1('0x55')]);_0x217dc5({'count':_0x25f246[_0x1ac1('0x18')],'rows':_0x25f246});});},'WhatsappQueuesWaitingInteractions':function(_0x27465c){return new Promise(function(_0x180f50,_0x1f07a0){var _0x5021b8=_[_0x1ac1('0x45')](_0x47b173['whatsappQueuesWaitingInteractions']);_0x180f50({'count':_0x5021b8[_0x1ac1('0x18')],'rows':_0x5021b8});});}};var _0x4d7fd5=jayson['server'](_0x370097)[_0x1ac1('0x56')]();_0x4d7fd5['on'](_0x1ac1('0x2c'),function(_0x5ba71a){logger[_0x1ac1('0x2c')](JSON[_0x1ac1('0x57')](_0x5ba71a));return _0x433e7d(_0x5ba71a);});_0x4d7fd5[_0x1ac1('0x11')](0x232c,_0x1ac1('0x58'),function(){console[_0x1ac1('0x59')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x2e0b0b('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 6a45a6d..151a1fa 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 _0xe17c=['log','stack','util','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error','message','result','catch','condition','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xe17c,0xbc));var _0xce17=function(_0x3327db,_0x56bdf3){_0x3327db=_0x3327db-0x0;var _0x5c6b5d=_0xe17c[_0x3327db];return _0x5c6b5d;};'use strict';var util=require(_0xce17('0x0'));var BPromise=require('bluebird');var jayson=require(_0xce17('0x1'));var _=require(_0xce17('0x2'));var logger=require(_0xce17('0x3'))(_0xce17('0x4'));var client=jayson['client'][_0xce17('0x5')]({'port':0x232a});function request(_0x4085f9,_0x164f35){return new BPromise(function(_0x4dfc54,_0x447252){return client[_0xce17('0x6')](_0x4085f9,_0x164f35)[_0xce17('0x7')](function(_0x4e5763){if(_0x4e5763[_0xce17('0x8')]){return _0x447252(_0x4e5763['error'][_0xce17('0x9')]);}else{return _0x4dfc54(_0x4e5763[_0xce17('0xa')]);}})[_0xce17('0xb')](function(_0x3b3601){return _0x447252(_0x3b3601);});});}exports[_0xce17('0xc')]=function(_0x18059a,_0x3ee903,_0x123f75){return function(_0x42f56e){if(_0x123f75['rules']&&!_0x123f75['rules'][_0x18059a]){logger[_0xce17('0xd')](_0xce17('0xe'),_0x18059a);return _0x42f56e[_0xce17('0xf')]();}var _0x49f64c=[];for(var _0x1bb97d=0x0;_0x1bb97d<_0x3ee903[_0xce17('0x10')];_0x1bb97d+=0x1){_0x49f64c[_0xce17('0x11')](request(_0xce17('0x12'),{'command':util[_0xce17('0x13')](_0xce17('0x14'),_0x3ee903[_0x1bb97d])})[_0xce17('0x7')](function(_0x501972){return _0x501972&&_0x501972[_0xce17('0x9')]&&_0x501972[_0xce17('0x9')]['indexOf'](_0xce17('0x15'))>=0x0?!![]:![];})['catch'](function(_0x15c055){logger['error'](_0xce17('0x16'),_0x18059a,_0x3ee903[_0x1bb97d]);}));}BPromise[_0xce17('0x17')](_0x49f64c)[_0xce17('0x7')](function(_0xee727){var _0x43ad8c=_[_0xce17('0x18')](_0xee727);logger['info'](_0xce17('0x19'),_0x18059a,_0x3ee903[_0xce17('0x1a')](_0xce17('0x1b')),_0x43ad8c);_0x42f56e[_0xce17('0x1c')](_0x43ad8c);})['catch'](function(_0x43c713){console[_0xce17('0x1d')](_0x43c713);logger[_0xce17('0x8')](_0xce17('0x19'),_0x18059a,_0x3ee903[_0xce17('0x1a')](_0xce17('0x1b')),_0x43c713[_0xce17('0x1e')]);_0x42f56e['stop']();});};}; \ No newline at end of file +var _0x8279=['stop','util','bluebird','jayson/promise','lodash','routing','request','then','error','message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','Command','format','iftime\x20%s','indexOf','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','log','stack'];(function(_0x51500b,_0x48aba5){var _0x3f2648=function(_0x1a4c89){while(--_0x1a4c89){_0x51500b['push'](_0x51500b['shift']());}};_0x3f2648(++_0x48aba5);}(_0x8279,0x1b1));var _0x9827=function(_0x252fbf,_0x59126d){_0x252fbf=_0x252fbf-0x0;var _0x102b85=_0x8279[_0x252fbf];return _0x102b85;};'use strict';var util=require(_0x9827('0x0'));var BPromise=require(_0x9827('0x1'));var jayson=require(_0x9827('0x2'));var _=require(_0x9827('0x3'));var logger=require('../../../config/logger')(_0x9827('0x4'));var client=jayson['client']['http']({'port':0x232a});function request(_0x538e74,_0x3e9584){return new BPromise(function(_0xe7dc7a,_0x13f156){return client[_0x9827('0x5')](_0x538e74,_0x3e9584)[_0x9827('0x6')](function(_0x1b2b2a){if(_0x1b2b2a[_0x9827('0x7')]){return _0x13f156(_0x1b2b2a[_0x9827('0x7')][_0x9827('0x8')]);}else{return _0xe7dc7a(_0x1b2b2a['result']);}})[_0x9827('0x9')](function(_0x55f439){return _0x13f156(_0x55f439);});});}exports[_0x9827('0xa')]=function(_0x558fae,_0xd3fef8,_0x164dbc){return function(_0x56ed5d){if(_0x164dbc[_0x9827('0xb')]&&!_0x164dbc['rules'][_0x558fae]){logger[_0x9827('0xc')](_0x9827('0xd'),_0x558fae);return _0x56ed5d['stop']();}var _0x425bf2=[];for(var _0x1639bc=0x0;_0x1639bc<_0xd3fef8[_0x9827('0xe')];_0x1639bc+=0x1){_0x425bf2[_0x9827('0xf')](request(_0x9827('0x10'),{'command':util[_0x9827('0x11')](_0x9827('0x12'),_0xd3fef8[_0x1639bc])})[_0x9827('0x6')](function(_0x225f18){return _0x225f18&&_0x225f18[_0x9827('0x8')]&&_0x225f18[_0x9827('0x8')][_0x9827('0x13')]('true')>=0x0?!![]:![];})['catch'](function(_0x3ef599){logger[_0x9827('0x7')]('[%s][INTERVAL]\x20%s',_0x558fae,_0xd3fef8[_0x1639bc]);}));}BPromise[_0x9827('0x14')](_0x425bf2)[_0x9827('0x6')](function(_0x2cbb61){var _0xc27936=_[_0x9827('0x15')](_0x2cbb61);logger[_0x9827('0xc')](_0x9827('0x16'),_0x558fae,_0xd3fef8['join'](_0x9827('0x17')),_0xc27936);_0x56ed5d['when'](_0xc27936);})['catch'](function(_0x40eabe){console[_0x9827('0x18')](_0x40eabe);logger['error'](_0x9827('0x16'),_0x558fae,_0xd3fef8['join'](_0x9827('0x17')),_0x40eabe[_0x9827('0x19')]);_0x56ed5d[_0x9827('0x1a')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index b716513..6d1ed5e 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 _0xac4a=['now','lastevent','called','connectedlinename','format','membername','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcomplete','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','ATTENDED','transfertargetuniqueid','calleridnum','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agent','lodash','util','./utils','info','uniqueid','channel','queue','interface','connectedlinenum','getVoiceQueueByName','type','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt'];(function(_0x1e9a2d,_0x5332b6){var _0x5ea713=function(_0x405956){while(--_0x405956){_0x1e9a2d['push'](_0x1e9a2d['shift']());}};_0x5ea713(++_0x5332b6);}(_0xac4a,0x13f));var _0xaac4=function(_0x5c111d,_0x5aa57f){_0x5c111d=_0x5c111d-0x0;var _0x9bee9d=_0xac4a[_0x5c111d];return _0x9bee9d;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var utils=require(_0xaac4('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x132fc3,_0x38f4f4){utils[_0xaac4('0x3')](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x132fc3[_0xaac4('0x4')],_0x132fc3[_0xaac4('0x5')],_0x132fc3[_0xaac4('0x6')],_0x132fc3['membername'],_0x132fc3[_0xaac4('0x7')],_0x132fc3['calleridnum'],_0x132fc3[_0xaac4('0x8')],_0x132fc3['lastevent']));if(_0x132fc3[_0xaac4('0x6')]){utils[_0xaac4('0x9')](_0x132fc3['queue'])['then'](function(_0x349671){if(_0x349671){_0x132fc3['type']=_0x349671[_0xaac4('0xa')];_0x132fc3['agentacw']=_0x132fc3['agentcomplete']?_0x349671[_0xaac4('0xb')]:![];_0x132fc3[_0xaac4('0xc')]=_0x132fc3[_0xaac4('0xd')]?_0x349671[_0xaac4('0xe')]:0x0;}utils[_0xaac4('0xf')]('CreateVoiceAgentReport',_0x132fc3);});}else{utils['request'](_0xaac4('0x10'),_0x132fc3);}if(_0x38f4f4){delete transfers[_0x132fc3[_0xaac4('0x4')]];}else{delete agents[_0x132fc3[_0xaac4('0x11')]];}}exports['agentcalled']=function(_0x6a808d){try{utils[_0xaac4('0x12')](util['format'](_0xaac4('0x13'),_0x6a808d[_0xaac4('0x4')]),_0x6a808d);agents[_0x6a808d[_0xaac4('0x11')]]=_0x6a808d;agents[_0x6a808d[_0xaac4('0x11')]][_0xaac4('0x14')]=utils[_0xaac4('0x15')]();agents[_0x6a808d[_0xaac4('0x11')]][_0xaac4('0x16')]=_0xaac4('0x17');agents[_0x6a808d[_0xaac4('0x11')]][_0xaac4('0x8')]=null;agents[_0x6a808d[_0xaac4('0x11')]][_0xaac4('0x18')]=null;utils['info'](util[_0xaac4('0x19')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x6a808d[_0xaac4('0x4')],agents[_0x6a808d['destuniqueid']][_0xaac4('0x1a')],_0x6a808d[_0xaac4('0x11')]));}catch(_0xa22b76){utils[_0xaac4('0x1b')](util[_0xaac4('0x19')](_0xaac4('0x13'),_0x6a808d[_0xaac4('0x4')]),_0xa22b76);}};exports[_0xaac4('0x1c')]=function(_0x4166ee){try{if(!_['isNil'](agents[_0x4166ee[_0xaac4('0x11')]])){utils['debug'](util[_0xaac4('0x19')](_0xaac4('0x1d'),_0x4166ee[_0xaac4('0x4')]),_0x4166ee);utils[_0xaac4('0x3')](util[_0xaac4('0x19')](_0xaac4('0x1e'),_0x4166ee['uniqueid'],agents[_0x4166ee[_0xaac4('0x11')]][_0xaac4('0x1a')],_0x4166ee[_0xaac4('0x11')]));agents[_0x4166ee[_0xaac4('0x11')]][_0xaac4('0x1c')]=!![];agents[_0x4166ee[_0xaac4('0x11')]][_0xaac4('0x1f')]=utils['now']();agents[_0x4166ee[_0xaac4('0x11')]]['lastevent']='timeout';agents[_0x4166ee['destuniqueid']]['reason']=_0xaac4('0x20');agents[_0x4166ee[_0xaac4('0x11')]][_0xaac4('0x21')]=_0x4166ee[_0xaac4('0x22')]?parseInt(_0x4166ee[_0xaac4('0x22')])/0x3e8:0x0;agents[_0x4166ee[_0xaac4('0x11')]][_0xaac4('0x23')]=0x0;unanswered[_0xaac4('0x24')](_0x4166ee[_0xaac4('0x11')]);}}catch(_0x386c9b){utils['error'](util[_0xaac4('0x19')](_0xaac4('0x1d'),_0x4166ee[_0xaac4('0x4')]),_0x386c9b);}};exports[_0xaac4('0x25')]=function(_0x669b34){try{_[_0xaac4('0x26')](agents,function(_0x5e469a,_0xcf6c1){if(_0x5e469a['uniqueid']==_0x669b34[_0xaac4('0x4')]&&!_[_0xaac4('0x27')](unanswered,_0x5e469a[_0xaac4('0x11')])){utils[_0xaac4('0x12')](util['format']('[%s][agents][queuecallerabandon]',_0x669b34['uniqueid']),_0x669b34);utils[_0xaac4('0x3')](util[_0xaac4('0x19')](_0xaac4('0x28'),_0x669b34[_0xaac4('0x4')],_0x5e469a[_0xaac4('0x1a')],_0x5e469a[_0xaac4('0x11')]));_0x5e469a[_0xaac4('0x1c')]=!![];_0x5e469a[_0xaac4('0x1f')]=utils[_0xaac4('0x15')]();_0x5e469a[_0xaac4('0x16')]=_0xaac4('0x29');_0x5e469a[_0xaac4('0x2a')]=_0xaac4('0x29');_0x5e469a[_0xaac4('0x21')]=_0x669b34[_0xaac4('0x21')];_0x5e469a['talktime']=0x0;writeDB(_0x5e469a);}});}catch(_0x5bad9f){utils[_0xaac4('0x1b')](util[_0xaac4('0x19')](_0xaac4('0x2b'),_0x669b34['uniqueid']),_0x5bad9f);}};exports[_0xaac4('0x2c')]=function(_0x16fae8){try{if(agents[_0x16fae8[_0xaac4('0x11')]]){utils[_0xaac4('0x12')](util[_0xaac4('0x19')](_0xaac4('0x2d'),_0x16fae8[_0xaac4('0x4')]),_0x16fae8);utils['info'](util[_0xaac4('0x19')](_0xaac4('0x2e'),_0x16fae8[_0xaac4('0x4')],agents[_0x16fae8['destuniqueid']][_0xaac4('0x1a')],_0x16fae8['destuniqueid']));agents[_0x16fae8['destuniqueid']][_0xaac4('0x2f')]=utils[_0xaac4('0x15')]();agents[_0x16fae8[_0xaac4('0x11')]]['connectedlinenum']=_0x16fae8['connectedlinenum'];agents[_0x16fae8[_0xaac4('0x11')]][_0xaac4('0x18')]=_0x16fae8[_0xaac4('0x18')];agents[_0x16fae8[_0xaac4('0x11')]][_0xaac4('0x21')]=_0x16fae8[_0xaac4('0x22')];agents[_0x16fae8['destuniqueid']]['lastevent']=_0xaac4('0x30');_[_0xaac4('0x26')](agents,function(_0x5371b4,_0x416a5b){if(_0x5371b4[_0xaac4('0x11')]!=_0x16fae8[_0xaac4('0x11')]&&_0x5371b4['uniqueid']==_0x16fae8[_0xaac4('0x4')]){_0x5371b4[_0xaac4('0x23')]=0x0;_0x5371b4[_0xaac4('0x21')]=_0x16fae8['ringtime'];_0x5371b4[_0xaac4('0x1c')]=!![];_0x5371b4[_0xaac4('0x1f')]=utils[_0xaac4('0x15')]();_0x5371b4[_0xaac4('0x16')]='answered_elsewhere';_0x5371b4[_0xaac4('0x2a')]='answered_elsewhere';_0x5371b4['answeredelsewheredestinationuniqueid']=_0x16fae8[_0xaac4('0x11')];_0x5371b4[_0xaac4('0x31')]=_0x16fae8[_0xaac4('0x1a')];writeDB(_0x5371b4);}});}}catch(_0x40c007){utils[_0xaac4('0x1b')](util[_0xaac4('0x19')](_0xaac4('0x2d'),_0x16fae8[_0xaac4('0x4')]),_0x40c007);}};exports['agentcomplete']=function(_0x15191a){try{if(!_[_0xaac4('0x32')](agents[_0x15191a[_0xaac4('0x11')]])){utils[_0xaac4('0x12')](util['format'](_0xaac4('0x33'),_0x15191a[_0xaac4('0x4')]),_0x15191a);utils[_0xaac4('0x3')](util['format'](_0xaac4('0x34'),_0x15191a[_0xaac4('0x4')],agents[_0x15191a[_0xaac4('0x11')]][_0xaac4('0x1a')],_0x15191a['destuniqueid']));agents[_0x15191a[_0xaac4('0x11')]][_0xaac4('0x35')]=!![];agents[_0x15191a[_0xaac4('0x11')]]['agentcompleteAt']=utils[_0xaac4('0x15')]();agents[_0x15191a[_0xaac4('0x11')]][_0xaac4('0x23')]=utils[_0xaac4('0x36')](agents[_0x15191a[_0xaac4('0x11')]][_0xaac4('0x37')],agents[_0x15191a[_0xaac4('0x11')]][_0xaac4('0x2f')]);agents[_0x15191a[_0xaac4('0x11')]]['reason']=_0x15191a[_0xaac4('0x2a')];agents[_0x15191a[_0xaac4('0x11')]][_0xaac4('0x16')]=_0xaac4('0x38');writeDB(agents[_0x15191a[_0xaac4('0x11')]]);}}catch(_0x5dca5c){utils['error'](util[_0xaac4('0x19')](_0xaac4('0x33'),_0x15191a[_0xaac4('0x4')]),_0x5dca5c);}};exports[_0xaac4('0x39')]=function(_0x5f33ea){try{if(!_[_0xaac4('0x32')](agents[_0x5f33ea['transfereruniqueid']])){utils[_0xaac4('0x12')](util[_0xaac4('0x19')]('[%s][agents][blindtransfer]',_0x5f33ea[_0xaac4('0x4')]),_0x5f33ea);utils[_0xaac4('0x3')](util[_0xaac4('0x19')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x5f33ea['uniqueid'],agents[_0x5f33ea[_0xaac4('0x3a')]][_0xaac4('0x1a')],agents[_0x5f33ea[_0xaac4('0x3a')]][_0xaac4('0x4')]));agents[_0x5f33ea[_0xaac4('0x3a')]][_0xaac4('0x3b')]=!![];agents[_0x5f33ea['transfereruniqueid']][_0xaac4('0x3c')]=_0xaac4('0x3d');agents[_0x5f33ea[_0xaac4('0x3a')]][_0xaac4('0x3e')]=_0x5f33ea['extension'];agents[_0x5f33ea[_0xaac4('0x3a')]]['transferuniqueid']=agents[_0x5f33ea[_0xaac4('0x3a')]][_0xaac4('0x4')];}}catch(_0x460252){utils[_0xaac4('0x1b')](util[_0xaac4('0x19')](_0xaac4('0x3f'),_0x5f33ea[_0xaac4('0x4')]),_0x460252);}};exports[_0xaac4('0x40')]=function(_0x28aed5){try{utils[_0xaac4('0x12')](util[_0xaac4('0x19')](_0xaac4('0x41'),_0x28aed5[_0xaac4('0x42')]),_0x28aed5);if(_0x28aed5[_0xaac4('0x42')]==_0x28aed5['origtransfererlinkedid']){if(!_[_0xaac4('0x32')](agents[_0x28aed5[_0xaac4('0x43')]])){utils[_0xaac4('0x3')](util[_0xaac4('0x19')](_0xaac4('0x44'),_0x28aed5[_0xaac4('0x42')],agents[_0x28aed5[_0xaac4('0x43')]][_0xaac4('0x1a')]));agents[_0x28aed5['secondtransfereruniqueid']][_0xaac4('0x3b')]=!![];agents[_0x28aed5['secondtransfereruniqueid']][_0xaac4('0x3c')]='ATTENDED';agents[_0x28aed5[_0xaac4('0x43')]]['transferexten']=_0x28aed5['origtransfererexten'];agents[_0x28aed5[_0xaac4('0x43')]][_0xaac4('0x45')]=_0x28aed5['origtransfereruniqueid'];}if(_0x28aed5[_0xaac4('0x46')]&&agents[_0x28aed5[_0xaac4('0x46')]]){agents[_0x28aed5[_0xaac4('0x46')]][_0xaac4('0x47')]=0x1;transfers[_0x28aed5[_0xaac4('0x46')]]=_[_0xaac4('0x48')](agents[_0x28aed5['transfereeuniqueid']]);transfers[_0x28aed5[_0xaac4('0x46')]]['calleridnum']=agents[_0x28aed5[_0xaac4('0x43')]]['calleridnum'];transfers[_0x28aed5['transfereeuniqueid']]['calleridname']=agents[_0x28aed5[_0xaac4('0x43')]][_0xaac4('0x49')];transfers[_0x28aed5[_0xaac4('0x46')]][_0xaac4('0x14')]=utils['now']();transfers[_0x28aed5[_0xaac4('0x46')]][_0xaac4('0x2f')]=utils[_0xaac4('0x15')]();transfers[_0x28aed5['transfereeuniqueid']][_0xaac4('0x21')]=0x0;transfers[_0x28aed5[_0xaac4('0x46')]][_0xaac4('0x47')]=0x2;}}else if(_0x28aed5[_0xaac4('0x43')]==_0x28aed5[_0xaac4('0x4a')]){if(!_[_0xaac4('0x32')](agents[_0x28aed5[_0xaac4('0x42')]])){utils['info'](util['format'](_0xaac4('0x44'),_0x28aed5['origtransfereruniqueid'],agents[_0x28aed5['origtransfereruniqueid']][_0xaac4('0x1a')]));agents[_0x28aed5['origtransfereruniqueid']][_0xaac4('0x3b')]=!![];agents[_0x28aed5['origtransfereruniqueid']][_0xaac4('0x3c')]=_0xaac4('0x4b');agents[_0x28aed5['origtransfereruniqueid']]['transferexten']=_0x28aed5['secondtransfererexten'];agents[_0x28aed5['origtransfereruniqueid']][_0xaac4('0x45')]=_0x28aed5[_0xaac4('0x43')];}if(_0x28aed5[_0xaac4('0x4c')]&&agents[_0x28aed5[_0xaac4('0x4c')]]){agents[_0x28aed5['transfertargetuniqueid']][_0xaac4('0x47')]=0x1;transfers[_0x28aed5[_0xaac4('0x4c')]]=_[_0xaac4('0x48')](agents[_0x28aed5[_0xaac4('0x4c')]]);transfers[_0x28aed5[_0xaac4('0x4c')]][_0xaac4('0x4d')]=agents[_0x28aed5[_0xaac4('0x42')]][_0xaac4('0x4d')];transfers[_0x28aed5[_0xaac4('0x4c')]][_0xaac4('0x49')]=agents[_0x28aed5[_0xaac4('0x42')]]['calleridname'];transfers[_0x28aed5['transfertargetuniqueid']][_0xaac4('0x14')]=utils['now']();transfers[_0x28aed5['transfertargetuniqueid']][_0xaac4('0x2f')]=utils['now']();transfers[_0x28aed5[_0xaac4('0x4c')]][_0xaac4('0x21')]=0x0;transfers[_0x28aed5[_0xaac4('0x4c')]][_0xaac4('0x47')]=0x2;}}}catch(_0x50eeee){utils[_0xaac4('0x1b')](util[_0xaac4('0x19')](_0xaac4('0x41'),_0x28aed5[_0xaac4('0x42')]),_0x50eeee);}};exports[_0xaac4('0x4e')]=function(_0x3a1b41){try{utils['debug'](util[_0xaac4('0x19')](_0xaac4('0x4f'),_0x3a1b41['uniqueid']),_0x3a1b41);if(agents[_0x3a1b41[_0xaac4('0x4')]]&&agents[_0x3a1b41[_0xaac4('0x4')]]['reason']==='timeout'){if(_0x3a1b41[_0xaac4('0x50')]==='21'){agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x2a')]=_0xaac4('0x51');agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x16')]=_0xaac4('0x51');}utils[_0xaac4('0x3')](util['format'](_0xaac4('0x52'),_0x3a1b41[_0xaac4('0x4')],agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x1a')],agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x2a')],agents[_0x3a1b41['uniqueid']][_0xaac4('0x16')]));writeDB(agents[_0x3a1b41[_0xaac4('0x4')]]);var _0x53059b=unanswered['indexOf'](_0x3a1b41['uniqueid']);if(_0x53059b>-0x1){unanswered[_0xaac4('0x53')](_0x53059b,0x1);}}if(transfers[_0x3a1b41['uniqueid']]){transfers[_0x3a1b41['uniqueid']]['agentcomplete']=!![];transfers[_0x3a1b41['uniqueid']]['agentcompleteAt']=utils[_0xaac4('0x15')]();transfers[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x23')]=utils[_0xaac4('0x36')](transfers[_0x3a1b41['uniqueid']][_0xaac4('0x37')],transfers[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x2f')]);transfers[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x2a')]=_0xaac4('0x54');transfers[_0x3a1b41[_0xaac4('0x4')]]['lastevent']=_0xaac4('0x38');utils['info'](util['format'](_0xaac4('0x52'),_0x3a1b41[_0xaac4('0x4')],transfers[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x1a')],transfers[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x2a')],transfers[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x16')]));writeDB(transfers[_0x3a1b41[_0xaac4('0x4')]],!![]);}if(agents[_0x3a1b41[_0xaac4('0x4')]]&&agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x2f')]){agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x35')]=!![];agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x37')]=utils[_0xaac4('0x15')]();agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x23')]=utils[_0xaac4('0x36')](agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x37')],agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x2f')]);agents[_0x3a1b41[_0xaac4('0x4')]]['reason']=agents[_0x3a1b41[_0xaac4('0x4')]][_0xaac4('0x3b')]?_0xaac4('0x3b'):_0xaac4('0x54');agents[_0x3a1b41[_0xaac4('0x4')]]['lastevent']=_0xaac4('0x38');utils[_0xaac4('0x3')](util[_0xaac4('0x19')](_0xaac4('0x52'),_0x3a1b41[_0xaac4('0x4')],agents[_0x3a1b41['uniqueid']][_0xaac4('0x1a')],agents[_0x3a1b41['uniqueid']][_0xaac4('0x2a')],agents[_0x3a1b41[_0xaac4('0x4')]]['lastevent']));writeDB(agents[_0x3a1b41[_0xaac4('0x4')]]);}}catch(_0x55cf3c){utils[_0xaac4('0x1b')](util[_0xaac4('0x19')]('[%s][agents][hangup]',_0x3a1b41[_0xaac4('0x4')]),_0x55cf3c);}}; \ No newline at end of file +var _0x5423=['info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','agentringnoanswer','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','error','queuecallerabandon','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','cause','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','connectedlinenum','lastevent','queue','then','type','agentcomplete','acw','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5423,0xe3));var _0x3542=function(_0x72ef6d,_0x5e3a3a){_0x72ef6d=_0x72ef6d-0x0;var _0x5b7be9=_0x5423[_0x72ef6d];return _0x5b7be9;};'use strict';var _=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x331a98,_0x457909){utils['info'](util[_0x3542('0x2')](_0x3542('0x3'),_0x331a98[_0x3542('0x4')],_0x331a98[_0x3542('0x5')],_0x331a98['queue'],_0x331a98[_0x3542('0x6')],_0x331a98[_0x3542('0x7')],_0x331a98[_0x3542('0x8')],_0x331a98[_0x3542('0x9')],_0x331a98[_0x3542('0xa')]));if(_0x331a98['queue']){utils['getVoiceQueueByName'](_0x331a98[_0x3542('0xb')])[_0x3542('0xc')](function(_0x53ece9){if(_0x53ece9){_0x331a98[_0x3542('0xd')]=_0x53ece9[_0x3542('0xd')];_0x331a98['agentacw']=_0x331a98[_0x3542('0xe')]?_0x53ece9[_0x3542('0xf')]:![];_0x331a98['acwtime']=_0x331a98[_0x3542('0x10')]?_0x53ece9[_0x3542('0x11')]:0x0;}utils[_0x3542('0x12')](_0x3542('0x13'),_0x331a98);});}else{utils[_0x3542('0x12')](_0x3542('0x13'),_0x331a98);}if(_0x457909){delete transfers[_0x331a98[_0x3542('0x4')]];}else{delete agents[_0x331a98[_0x3542('0x14')]];}}exports[_0x3542('0x15')]=function(_0x1a9062){try{utils[_0x3542('0x16')](util[_0x3542('0x2')](_0x3542('0x17'),_0x1a9062['uniqueid']),_0x1a9062);agents[_0x1a9062[_0x3542('0x14')]]=_0x1a9062;agents[_0x1a9062['destuniqueid']][_0x3542('0x18')]=utils[_0x3542('0x19')]();agents[_0x1a9062[_0x3542('0x14')]]['lastevent']=_0x3542('0x1a');agents[_0x1a9062[_0x3542('0x14')]][_0x3542('0x9')]=null;agents[_0x1a9062['destuniqueid']][_0x3542('0x1b')]=null;utils[_0x3542('0x1c')](util[_0x3542('0x2')](_0x3542('0x1d'),_0x1a9062['uniqueid'],agents[_0x1a9062[_0x3542('0x14')]]['membername'],_0x1a9062[_0x3542('0x14')]));}catch(_0x369e0c){utils['error'](util[_0x3542('0x2')](_0x3542('0x17'),_0x1a9062[_0x3542('0x4')]),_0x369e0c);}};exports[_0x3542('0x1e')]=function(_0x212950){try{if(!_['isNil'](agents[_0x212950['destuniqueid']])){utils['debug'](util[_0x3542('0x2')]('[%s][agents][agentringnoanswer]',_0x212950[_0x3542('0x4')]),_0x212950);utils['info'](util[_0x3542('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x212950['uniqueid'],agents[_0x212950[_0x3542('0x14')]][_0x3542('0x6')],_0x212950['destuniqueid']));agents[_0x212950['destuniqueid']][_0x3542('0x1e')]=!![];agents[_0x212950['destuniqueid']][_0x3542('0x1f')]=utils[_0x3542('0x19')]();agents[_0x212950[_0x3542('0x14')]][_0x3542('0xa')]=_0x3542('0x20');agents[_0x212950[_0x3542('0x14')]][_0x3542('0x21')]=_0x3542('0x20');agents[_0x212950[_0x3542('0x14')]][_0x3542('0x22')]=_0x212950[_0x3542('0x23')]?parseInt(_0x212950[_0x3542('0x23')])/0x3e8:0x0;agents[_0x212950[_0x3542('0x14')]][_0x3542('0x24')]=0x0;unanswered[_0x3542('0x25')](_0x212950[_0x3542('0x14')]);}}catch(_0x303412){utils[_0x3542('0x26')](util[_0x3542('0x2')]('[%s][agents][agentringnoanswer]',_0x212950[_0x3542('0x4')]),_0x303412);}};exports[_0x3542('0x27')]=function(_0x2aec76){try{_['forIn'](agents,function(_0x402c97,_0xc6f23b){if(_0x402c97[_0x3542('0x4')]==_0x2aec76[_0x3542('0x4')]&&!_['includes'](unanswered,_0x402c97['destuniqueid'])){utils[_0x3542('0x16')](util[_0x3542('0x2')](_0x3542('0x28'),_0x2aec76[_0x3542('0x4')]),_0x2aec76);utils[_0x3542('0x1c')](util[_0x3542('0x2')](_0x3542('0x29'),_0x2aec76['uniqueid'],_0x402c97['membername'],_0x402c97[_0x3542('0x14')]));_0x402c97['agentringnoanswer']=!![];_0x402c97['agentringnoanswerAt']=utils[_0x3542('0x19')]();_0x402c97['lastevent']='abandoned';_0x402c97[_0x3542('0x21')]=_0x3542('0x2a');_0x402c97[_0x3542('0x22')]=_0x2aec76['holdtime'];_0x402c97[_0x3542('0x24')]=0x0;writeDB(_0x402c97);}});}catch(_0x49b523){utils[_0x3542('0x26')](util[_0x3542('0x2')]('[%s][agents][queuecallerabandon]',_0x2aec76[_0x3542('0x4')]),_0x49b523);}};exports['agentconnect']=function(_0x204e5e){try{if(agents[_0x204e5e[_0x3542('0x14')]]){utils[_0x3542('0x16')](util['format'](_0x3542('0x2b'),_0x204e5e['uniqueid']),_0x204e5e);utils[_0x3542('0x1c')](util[_0x3542('0x2')](_0x3542('0x2c'),_0x204e5e[_0x3542('0x4')],agents[_0x204e5e[_0x3542('0x14')]][_0x3542('0x6')],_0x204e5e[_0x3542('0x14')]));agents[_0x204e5e[_0x3542('0x14')]][_0x3542('0x2d')]=utils[_0x3542('0x19')]();agents[_0x204e5e[_0x3542('0x14')]][_0x3542('0x9')]=_0x204e5e[_0x3542('0x9')];agents[_0x204e5e['destuniqueid']][_0x3542('0x1b')]=_0x204e5e['connectedlinename'];agents[_0x204e5e['destuniqueid']][_0x3542('0x22')]=_0x204e5e[_0x3542('0x23')];agents[_0x204e5e[_0x3542('0x14')]][_0x3542('0xa')]=_0x3542('0x2e');_[_0x3542('0x2f')](agents,function(_0xc7f13c,_0x42e87a){if(_0xc7f13c['destuniqueid']!=_0x204e5e[_0x3542('0x14')]&&_0xc7f13c['uniqueid']==_0x204e5e[_0x3542('0x4')]){_0xc7f13c[_0x3542('0x24')]=0x0;_0xc7f13c['holdtime']=_0x204e5e[_0x3542('0x23')];_0xc7f13c[_0x3542('0x1e')]=!![];_0xc7f13c['agentringnoanswerAt']=utils[_0x3542('0x19')]();_0xc7f13c[_0x3542('0xa')]='answered_elsewhere';_0xc7f13c[_0x3542('0x21')]=_0x3542('0x30');_0xc7f13c[_0x3542('0x31')]=_0x204e5e[_0x3542('0x14')];_0xc7f13c[_0x3542('0x32')]=_0x204e5e[_0x3542('0x6')];writeDB(_0xc7f13c);}});}}catch(_0x2b54b9){utils['error'](util['format'](_0x3542('0x2b'),_0x204e5e[_0x3542('0x4')]),_0x2b54b9);}};exports[_0x3542('0xe')]=function(_0xdeebd3){try{if(!_[_0x3542('0x33')](agents[_0xdeebd3['destuniqueid']])){utils[_0x3542('0x16')](util['format'](_0x3542('0x34'),_0xdeebd3[_0x3542('0x4')]),_0xdeebd3);utils[_0x3542('0x1c')](util['format'](_0x3542('0x35'),_0xdeebd3[_0x3542('0x4')],agents[_0xdeebd3['destuniqueid']][_0x3542('0x6')],_0xdeebd3[_0x3542('0x14')]));agents[_0xdeebd3[_0x3542('0x14')]][_0x3542('0xe')]=!![];agents[_0xdeebd3[_0x3542('0x14')]][_0x3542('0x36')]=utils[_0x3542('0x19')]();agents[_0xdeebd3[_0x3542('0x14')]]['talktime']=utils['diffTime'](agents[_0xdeebd3['destuniqueid']][_0x3542('0x36')],agents[_0xdeebd3[_0x3542('0x14')]][_0x3542('0x2d')]);agents[_0xdeebd3[_0x3542('0x14')]][_0x3542('0x21')]=_0xdeebd3[_0x3542('0x21')];agents[_0xdeebd3[_0x3542('0x14')]]['lastevent']=_0x3542('0x37');writeDB(agents[_0xdeebd3[_0x3542('0x14')]]);}}catch(_0x3da43e){utils[_0x3542('0x26')](util['format'](_0x3542('0x34'),_0xdeebd3[_0x3542('0x4')]),_0x3da43e);}};exports['blindtransfer']=function(_0x528f8c){try{if(!_[_0x3542('0x33')](agents[_0x528f8c[_0x3542('0x38')]])){utils[_0x3542('0x16')](util[_0x3542('0x2')](_0x3542('0x39'),_0x528f8c[_0x3542('0x4')]),_0x528f8c);utils[_0x3542('0x1c')](util['format'](_0x3542('0x3a'),_0x528f8c[_0x3542('0x4')],agents[_0x528f8c[_0x3542('0x38')]][_0x3542('0x6')],agents[_0x528f8c[_0x3542('0x38')]][_0x3542('0x4')]));agents[_0x528f8c[_0x3542('0x38')]][_0x3542('0x3b')]=!![];agents[_0x528f8c[_0x3542('0x38')]]['transfertype']='blind';agents[_0x528f8c[_0x3542('0x38')]]['transferexten']=_0x528f8c['extension'];agents[_0x528f8c['transfereruniqueid']][_0x3542('0x3c')]=agents[_0x528f8c[_0x3542('0x38')]][_0x3542('0x4')];}}catch(_0x48cfc4){utils[_0x3542('0x26')](util[_0x3542('0x2')]('[%s][agents][blindtransfer]',_0x528f8c[_0x3542('0x4')]),_0x48cfc4);}};exports[_0x3542('0x3d')]=function(_0x442000){try{utils[_0x3542('0x16')](util[_0x3542('0x2')]('[%s][agents][attendedtransfer]',_0x442000[_0x3542('0x3e')]),_0x442000);if(_0x442000[_0x3542('0x3e')]==_0x442000[_0x3542('0x3f')]){if(!_[_0x3542('0x33')](agents[_0x442000[_0x3542('0x40')]])){utils['info'](util['format'](_0x3542('0x41'),_0x442000[_0x3542('0x3e')],agents[_0x442000[_0x3542('0x40')]]['membername']));agents[_0x442000[_0x3542('0x40')]][_0x3542('0x3b')]=!![];agents[_0x442000[_0x3542('0x40')]][_0x3542('0x42')]=_0x3542('0x43');agents[_0x442000['secondtransfereruniqueid']]['transferexten']=_0x442000[_0x3542('0x44')];agents[_0x442000['secondtransfereruniqueid']][_0x3542('0x3c')]=_0x442000[_0x3542('0x3e')];}if(_0x442000['transfereeuniqueid']&&agents[_0x442000[_0x3542('0x45')]]){agents[_0x442000[_0x3542('0x45')]][_0x3542('0x46')]=0x1;transfers[_0x442000[_0x3542('0x45')]]=_[_0x3542('0x47')](agents[_0x442000['transfereeuniqueid']]);transfers[_0x442000['transfereeuniqueid']][_0x3542('0x8')]=agents[_0x442000['secondtransfereruniqueid']][_0x3542('0x8')];transfers[_0x442000[_0x3542('0x45')]][_0x3542('0x48')]=agents[_0x442000['secondtransfereruniqueid']][_0x3542('0x48')];transfers[_0x442000[_0x3542('0x45')]][_0x3542('0x18')]=utils[_0x3542('0x19')]();transfers[_0x442000[_0x3542('0x45')]][_0x3542('0x2d')]=utils['now']();transfers[_0x442000[_0x3542('0x45')]][_0x3542('0x22')]=0x0;transfers[_0x442000[_0x3542('0x45')]][_0x3542('0x46')]=0x2;}}else if(_0x442000[_0x3542('0x40')]==_0x442000[_0x3542('0x49')]){if(!_['isNil'](agents[_0x442000[_0x3542('0x3e')]])){utils[_0x3542('0x1c')](util[_0x3542('0x2')](_0x3542('0x41'),_0x442000['origtransfereruniqueid'],agents[_0x442000[_0x3542('0x3e')]][_0x3542('0x6')]));agents[_0x442000['origtransfereruniqueid']]['transfer']=!![];agents[_0x442000[_0x3542('0x3e')]]['transfertype']=_0x3542('0x43');agents[_0x442000['origtransfereruniqueid']]['transferexten']=_0x442000[_0x3542('0x4a')];agents[_0x442000[_0x3542('0x3e')]][_0x3542('0x3c')]=_0x442000[_0x3542('0x40')];}if(_0x442000[_0x3542('0x4b')]&&agents[_0x442000[_0x3542('0x4b')]]){agents[_0x442000[_0x3542('0x4b')]]['agententerreason']=0x1;transfers[_0x442000[_0x3542('0x4b')]]=_[_0x3542('0x47')](agents[_0x442000[_0x3542('0x4b')]]);transfers[_0x442000[_0x3542('0x4b')]][_0x3542('0x8')]=agents[_0x442000['origtransfereruniqueid']][_0x3542('0x8')];transfers[_0x442000[_0x3542('0x4b')]][_0x3542('0x48')]=agents[_0x442000[_0x3542('0x3e')]][_0x3542('0x48')];transfers[_0x442000[_0x3542('0x4b')]][_0x3542('0x18')]=utils['now']();transfers[_0x442000[_0x3542('0x4b')]]['agentconnectAt']=utils[_0x3542('0x19')]();transfers[_0x442000[_0x3542('0x4b')]][_0x3542('0x22')]=0x0;transfers[_0x442000[_0x3542('0x4b')]]['agententerreason']=0x2;}}}catch(_0x47c624){utils['error'](util[_0x3542('0x2')](_0x3542('0x4c'),_0x442000[_0x3542('0x3e')]),_0x47c624);}};exports[_0x3542('0x4d')]=function(_0x1ebe3a){try{utils[_0x3542('0x16')](util[_0x3542('0x2')](_0x3542('0x4e'),_0x1ebe3a[_0x3542('0x4')]),_0x1ebe3a);if(agents[_0x1ebe3a['uniqueid']]&&agents[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x21')]===_0x3542('0x20')){if(_0x1ebe3a[_0x3542('0x4f')]==='21'){agents[_0x1ebe3a[_0x3542('0x4')]]['reason']='rejected';agents[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0xa')]='rejected';}utils[_0x3542('0x1c')](util['format'](_0x3542('0x50'),_0x1ebe3a['uniqueid'],agents[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x6')],agents[_0x1ebe3a['uniqueid']]['reason'],agents[_0x1ebe3a['uniqueid']][_0x3542('0xa')]));writeDB(agents[_0x1ebe3a['uniqueid']]);var _0x16159f=unanswered[_0x3542('0x51')](_0x1ebe3a['uniqueid']);if(_0x16159f>-0x1){unanswered[_0x3542('0x52')](_0x16159f,0x1);}}if(transfers[_0x1ebe3a[_0x3542('0x4')]]){transfers[_0x1ebe3a[_0x3542('0x4')]]['agentcomplete']=!![];transfers[_0x1ebe3a[_0x3542('0x4')]]['agentcompleteAt']=utils[_0x3542('0x19')]();transfers[_0x1ebe3a['uniqueid']][_0x3542('0x24')]=utils[_0x3542('0x53')](transfers[_0x1ebe3a[_0x3542('0x4')]]['agentcompleteAt'],transfers[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x2d')]);transfers[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x21')]='agent';transfers[_0x1ebe3a['uniqueid']][_0x3542('0xa')]=_0x3542('0x37');utils[_0x3542('0x1c')](util[_0x3542('0x2')](_0x3542('0x50'),_0x1ebe3a[_0x3542('0x4')],transfers[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x6')],transfers[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x21')],transfers[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0xa')]));writeDB(transfers[_0x1ebe3a[_0x3542('0x4')]],!![]);}if(agents[_0x1ebe3a[_0x3542('0x4')]]&&agents[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x2d')]){agents[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0xe')]=!![];agents[_0x1ebe3a['uniqueid']][_0x3542('0x36')]=utils[_0x3542('0x19')]();agents[_0x1ebe3a['uniqueid']]['talktime']=utils[_0x3542('0x53')](agents[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x36')],agents[_0x1ebe3a[_0x3542('0x4')]]['agentconnectAt']);agents[_0x1ebe3a[_0x3542('0x4')]][_0x3542('0x21')]=agents[_0x1ebe3a['uniqueid']][_0x3542('0x3b')]?'transfer':_0x3542('0x54');agents[_0x1ebe3a['uniqueid']][_0x3542('0xa')]=_0x3542('0x37');utils[_0x3542('0x1c')](util[_0x3542('0x2')](_0x3542('0x50'),_0x1ebe3a[_0x3542('0x4')],agents[_0x1ebe3a[_0x3542('0x4')]]['membername'],agents[_0x1ebe3a[_0x3542('0x4')]]['reason'],agents[_0x1ebe3a['uniqueid']][_0x3542('0xa')]));writeDB(agents[_0x1ebe3a[_0x3542('0x4')]]);}}catch(_0x2c6f2b){utils[_0x3542('0x26')](util['format'](_0x3542('0x4e'),_0x1ebe3a[_0x3542('0x4')]),_0x2c6f2b);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 58a7e90..c4f54a8 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 _0x2fc5=['NO\x20ANSWER','BUSY','blinds','uniqueid','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','connectedlinenum','lastevent','then','UserId','request','CreateVoiceCallReport','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','format','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','accountcode','calleridnum','exten','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','channelstate','ANSWERED','error','hangup','callerid','calleridname','cause-txt','endtime','duration','diffTime','billableseconds','[%s][calls][hangup]','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','xmd-originatecalleridnum','source','value','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','split','lastIndexOf','includes','execif','gotoif','lodash','util','./utils','./transfers.controller','FAILED'];(function(_0x10ed0c,_0x5936db){var _0x43ed46=function(_0x53f016){while(--_0x53f016){_0x10ed0c['push'](_0x10ed0c['shift']());}};_0x43ed46(++_0x5936db);}(_0x2fc5,0x148));var _0x52fc=function(_0x5a92ad,_0x2219a6){_0x5a92ad=_0x5a92ad-0x0;var _0x2466f8=_0x2fc5[_0x5a92ad];return _0x2466f8;};'use strict';var _=require(_0x52fc('0x0'));var util=require(_0x52fc('0x1'));var utils=require(_0x52fc('0x2'));var transfers=require(_0x52fc('0x3'));var dispositions=['NO\x20ANSWER','FAILED',_0x52fc('0x4'),_0x52fc('0x5'),_0x52fc('0x5'),_0x52fc('0x5'),'ANSWERED',_0x52fc('0x6'),_0x52fc('0x4'),_0x52fc('0x4'),_0x52fc('0x4')];var channels={};function writeDB(_0x91c976){var _0x950834;if(transfers[_0x52fc('0x7')][_0x91c976[_0x52fc('0x8')]]){_0x950834=_0x91c976[_0x52fc('0x8')];_0x91c976['uniqueid']=transfers['blinds'][_0x91c976[_0x52fc('0x8')]][_0x52fc('0x9')];}utils[_0x52fc('0xa')](util['format'](_0x52fc('0xb'),_0x91c976[_0x52fc('0x8')],_0x91c976[_0x52fc('0xc')],_0x91c976['queue'],_0x91c976[_0x52fc('0xd')],_0x91c976[_0x52fc('0xe')],_0x91c976['calleridnum'],_0x91c976[_0x52fc('0xf')],_0x91c976[_0x52fc('0x10')]));if(_0x91c976['accountcode']){utils['getUserByInternal'](_0x91c976['accountcode'])[_0x52fc('0x11')](function(_0x5ad85b){if(_0x5ad85b){_0x91c976[_0x52fc('0x12')]=_0x5ad85b['id'];}utils[_0x52fc('0x13')](_0x52fc('0x14'),_0x91c976);});}else{utils['request'](_0x52fc('0x14'),_0x91c976);}if(channels[_0x91c976['uniqueid']]){delete channels[_0x91c976['uniqueid']];}else if(_0x950834&&channels[_0x950834]){delete transfers[_0x52fc('0x7')][_0x950834];delete channels[_0x950834];}}exports['newchannel']=function(_0x23b861){try{utils[_0x52fc('0x15')](util['format'](_0x52fc('0x16'),_0x23b861['uniqueid']),_0x23b861);if(_0x23b861['uniqueid']==_0x23b861[_0x52fc('0x17')]&&_0x23b861[_0x52fc('0xc')]!=_0x52fc('0x18')){utils['info'](util[_0x52fc('0x19')](_0x52fc('0x1a'),_0x23b861['uniqueid'],_0x23b861[_0x52fc('0x1b')],_0x23b861['exten']));channels[_0x23b861[_0x52fc('0x8')]]={'uniqueid':_0x23b861[_0x52fc('0x8')],'accountcode':_0x23b861[_0x52fc('0x1c')],'source':_0x23b861[_0x52fc('0x1d')],'destination':_0x23b861[_0x52fc('0x1e')],'destinationcontext':_0x23b861[_0x52fc('0x1b')],'channel':_0x23b861[_0x52fc('0xc')],'starttime':utils[_0x52fc('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x52fc('0x5'),'amaflags':_0x52fc('0x20')};}}catch(_0xeb43e7){utils['error'](util['format'](_0x52fc('0x16'),_0x23b861['uniqueid']),_0xeb43e7);}};exports[_0x52fc('0x21')]=function(_0x2a90d6){try{utils['debug'](util[_0x52fc('0x19')](_0x52fc('0x22'),_0x2a90d6['uniqueid']),_0x2a90d6);if(!_[_0x52fc('0x23')](channels[_0x2a90d6[_0x52fc('0x8')]])&&_0x2a90d6['channelstate']==0x6){utils['info'](util['format'](_0x52fc('0x24'),_0x2a90d6[_0x52fc('0x8')],_0x2a90d6[_0x52fc('0x1b')],_0x2a90d6[_0x52fc('0xc')]));if(_[_0x52fc('0x23')](channels[_0x2a90d6[_0x52fc('0x8')]][_0x52fc('0x25')])){channels[_0x2a90d6['uniqueid']]['systemanswertime']=utils[_0x52fc('0x1f')]();}}else if(!_[_0x52fc('0x23')](channels[_0x2a90d6[_0x52fc('0x17')]])&&_0x2a90d6['channelstate']==0x6&&_0x2a90d6[_0x52fc('0x1b')]!=_0x52fc('0x26')){utils[_0x52fc('0xa')](util[_0x52fc('0x19')](_0x52fc('0x27'),_0x2a90d6[_0x52fc('0x8')],_0x2a90d6['linkedid'],_0x2a90d6[_0x52fc('0x1b')],_0x2a90d6['channel']));channels[_0x2a90d6['linkedid']]['accountcode']=_0x2a90d6[_0x52fc('0x1c')];channels[_0x2a90d6[_0x52fc('0x17')]][_0x52fc('0x28')]=_0x2a90d6[_0x52fc('0xc')];if(_['isNil'](channels[_0x2a90d6['linkedid']][_0x52fc('0x29')])){channels[_0x2a90d6[_0x52fc('0x17')]][_0x52fc('0x29')]=utils[_0x52fc('0x1f')]();}channels[_0x2a90d6[_0x52fc('0x17')]][_0x52fc('0x2a')]=dispositions[_[_0x52fc('0x2b')](_0x2a90d6[_0x52fc('0x2c')])]||_0x52fc('0x2d');}}catch(_0x46ebf7){utils[_0x52fc('0x2e')](util['format'](_0x52fc('0x22'),_0x2a90d6['uniqueid']),_0x46ebf7);}};exports[_0x52fc('0x2f')]=function(_0x2276ba){try{if(!_['isNil'](channels[_0x2276ba[_0x52fc('0x8')]])){utils['debug'](util[_0x52fc('0x19')]('[%s][calls][hangup]',_0x2276ba[_0x52fc('0x8')]),_0x2276ba);if(_[_0x52fc('0x23')](channels[_0x2276ba[_0x52fc('0x8')]][_0x52fc('0x30')])){channels[_0x2276ba[_0x52fc('0x8')]][_0x52fc('0x30')]=_0x2276ba[_0x52fc('0x31')]+'\x20<'+_0x2276ba[_0x52fc('0x1d')]+'>';}utils[_0x52fc('0xa')](util[_0x52fc('0x19')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x2276ba['uniqueid'],channels[_0x2276ba[_0x52fc('0x8')]][_0x52fc('0x30')],_0x2276ba[_0x52fc('0x32')]));channels[_0x2276ba['uniqueid']][_0x52fc('0x33')]=utils[_0x52fc('0x1f')]();channels[_0x2276ba['uniqueid']][_0x52fc('0x34')]=utils[_0x52fc('0x35')](channels[_0x2276ba[_0x52fc('0x8')]]['endtime'],channels[_0x2276ba[_0x52fc('0x8')]]['starttime']);channels[_0x2276ba[_0x52fc('0x8')]][_0x52fc('0x36')]=channels[_0x2276ba[_0x52fc('0x8')]][_0x52fc('0x29')]?utils[_0x52fc('0x35')](channels[_0x2276ba[_0x52fc('0x8')]]['endtime'],channels[_0x2276ba[_0x52fc('0x8')]][_0x52fc('0x29')]):0x0;writeDB(channels[_0x2276ba[_0x52fc('0x8')]]);}}catch(_0x3c615c){utils['error'](util[_0x52fc('0x19')](_0x52fc('0x37'),_0x2276ba[_0x52fc('0x8')]),_0x3c615c);}};exports['attendedtransfer']=function(_0xd3bb6e){try{if(!_[_0x52fc('0x23')](channels[_0xd3bb6e['localtwolinkedid']])){utils[_0x52fc('0x15')](util[_0x52fc('0x19')](_0x52fc('0x38'),_0xd3bb6e[_0x52fc('0x39')]),_0xd3bb6e);if(channels[_0xd3bb6e['localtwolinkedid']][_0x52fc('0xc')]==_0xd3bb6e['transfereechannel']){utils[_0x52fc('0xa')](util[_0x52fc('0x19')](_0x52fc('0x3a'),_0xd3bb6e['origtransfereruniqueid'],_0xd3bb6e[_0x52fc('0x3b')],_0xd3bb6e[_0x52fc('0x3c')]));channels[_0xd3bb6e[_0x52fc('0x3b')]][_0x52fc('0x28')]=_0xd3bb6e['secondtransfererchannel'];channels[_0xd3bb6e[_0x52fc('0x3b')]][_0x52fc('0x3d')]='_attended';}else if(channels[_0xd3bb6e[_0x52fc('0x3b')]][_0x52fc('0xc')]=_0xd3bb6e[_0x52fc('0x3e')]){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0xd3bb6e['origtransfereruniqueid'],_0xd3bb6e[_0x52fc('0x3b')],_0xd3bb6e[_0x52fc('0x3f')]));channels[_0xd3bb6e[_0x52fc('0x3b')]][_0x52fc('0x28')]=_0xd3bb6e[_0x52fc('0x3f')];channels[_0xd3bb6e['localtwolinkedid']][_0x52fc('0x3d')]='_attended';}}}catch(_0x4dd367){utils[_0x52fc('0x2e')](util[_0x52fc('0x19')]('[%s][calls][attendedtransfer]',_0xd3bb6e[_0x52fc('0x39')]),_0x4dd367);}};exports[_0x52fc('0x40')]=function(_0x327a47){try{if(!_[_0x52fc('0x23')](channels[_0x327a47[_0x52fc('0x8')]])){utils['debug'](util[_0x52fc('0x19')](_0x52fc('0x41'),_0x327a47['uniqueid']),_0x327a47);channels[_0x327a47[_0x52fc('0x8')]][_0x52fc('0x42')]=utils[_0x52fc('0x1f')]();utils[_0x52fc('0xa')](util[_0x52fc('0x19')](_0x52fc('0x43'),_0x327a47['uniqueid'],channels[_0x327a47[_0x52fc('0x8')]][_0x52fc('0x42')]));}}catch(_0x1a7b47){utils[_0x52fc('0x2e')](util[_0x52fc('0x19')](_0x52fc('0x41'),_0x327a47[_0x52fc('0x8')]),_0x1a7b47);}};exports[_0x52fc('0x44')]=function(_0x5f2613){try{if(!_[_0x52fc('0x23')](channels[_0x5f2613[_0x52fc('0x8')]])){utils['debug'](util['format']('[%s][calls][musiconholdstop]',_0x5f2613[_0x52fc('0x8')]),_0x5f2613);if(!_['isNil'](channels[_0x5f2613['uniqueid']][_0x52fc('0x42')])){channels[_0x5f2613[_0x52fc('0x8')]][_0x52fc('0x45')]+=utils['diffTime'](utils[_0x52fc('0x1f')](),channels[_0x5f2613[_0x52fc('0x8')]][_0x52fc('0x42')]);utils[_0x52fc('0xa')](util[_0x52fc('0x19')](_0x52fc('0x46'),_0x5f2613[_0x52fc('0x8')],channels[_0x5f2613[_0x52fc('0x8')]]['mohtime']));delete channels[_0x5f2613[_0x52fc('0x8')]]['musiconholdstartAt'];}}}catch(_0x289cba){utils[_0x52fc('0x2e')](util[_0x52fc('0x19')]('[%s][calls][musiconholdstop]',_0x5f2613['uniqueid']),_0x289cba);}};exports['varset']=function(_0x11a873){try{if(!_['isNil'](channels[_0x11a873[_0x52fc('0x8')]])){utils['debug'](util[_0x52fc('0x19')](_0x52fc('0x47'),_0x11a873[_0x52fc('0x8')]),_0x11a873);if(!_['isNil'](_0x11a873['variable'][_0x52fc('0x48')])){utils[_0x52fc('0xa')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x11a873['uniqueid'],_0x11a873['value']));channels[_0x11a873[_0x52fc('0x8')]][_0x52fc('0x49')]=_0x11a873[_0x52fc('0x4a')];}if(!_[_0x52fc('0x23')](_0x11a873[_0x52fc('0x4b')][_0x52fc('0x4c')])){utils['info'](util[_0x52fc('0x19')](_0x52fc('0x4d'),_0x11a873['uniqueid'],_0x11a873[_0x52fc('0x4a')]));channels[_0x11a873['uniqueid']][_0x52fc('0x4e')]=_0x11a873[_0x52fc('0x4a')];channels[_0x11a873[_0x52fc('0x8')]][_0x52fc('0x30')]='\x22'+_0x11a873[_0x52fc('0x4a')]+_0x52fc('0x4f')+_0x11a873[_0x52fc('0x4a')]+'>';}if(!_['isNil'](_0x11a873[_0x52fc('0x4b')][_0x52fc('0x50')])||!_[_0x52fc('0x23')](_0x11a873[_0x52fc('0x4b')][_0x52fc('0x51')])){utils['info'](util[_0x52fc('0x19')](_0x52fc('0x52'),_0x11a873['uniqueid'],!_['isNil'](_0x11a873['variable'][_0x52fc('0x50')])?'xmd-callerid-preview':_0x52fc('0x51'),_0x11a873['value']));channels[_0x11a873['uniqueid']][_0x52fc('0x30')]=_0x11a873[_0x52fc('0x4a')];}if(!_[_0x52fc('0x23')](_0x11a873['variable'][_0x52fc('0x53')])||!_[_0x52fc('0x23')](_0x11a873['variable'][_0x52fc('0x54')])){utils[_0x52fc('0xa')](util[_0x52fc('0x19')](_0x52fc('0x52'),_0x11a873['uniqueid'],!_['isNil'](_0x11a873[_0x52fc('0x4b')][_0x52fc('0x53')])?_0x52fc('0x53'):'xmcs-queue',_0x11a873['value']));channels[_0x11a873[_0x52fc('0x8')]][_0x52fc('0x55')]='Queue';channels[_0x11a873['uniqueid']][_0x52fc('0x56')]=_0x11a873[_0x52fc('0x4a')];channels[_0x11a873[_0x52fc('0x8')]][_0x52fc('0x57')]=!![];}if(!_[_0x52fc('0x23')](_0x11a873[_0x52fc('0x4b')][_0x52fc('0x58')])){utils['info'](util['format'](_0x52fc('0x59'),_0x11a873[_0x52fc('0x8')],_0x11a873[_0x52fc('0x4a')]));channels[_0x11a873[_0x52fc('0x8')]][_0x52fc('0x5a')]=_0x11a873[_0x52fc('0x4a')];}if(!_[_0x52fc('0x23')](_0x11a873[_0x52fc('0x4b')][_0x52fc('0x5b')])){utils[_0x52fc('0xa')](util['format'](_0x52fc('0x5c'),_0x11a873[_0x52fc('0x8')],_0x11a873['value']));channels[_0x11a873[_0x52fc('0x8')]][_0x52fc('0x5d')]=_0x11a873[_0x52fc('0x4a')];}if(!_['isNil'](_0x11a873[_0x52fc('0x4b')][_0x52fc('0x5e')])){utils['info'](util[_0x52fc('0x19')](_0x52fc('0x5f'),_0x11a873[_0x52fc('0x8')],_0x11a873['value']));channels[_0x11a873['uniqueid']]['routeid']=_0x11a873['value'];}if(!_['isNil'](_0x11a873[_0x52fc('0x4b')]['sipcallid'])){utils[_0x52fc('0xa')](util[_0x52fc('0x19')](_0x52fc('0x60'),_0x11a873[_0x52fc('0x8')],_0x11a873[_0x52fc('0x4a')]));channels[_0x11a873['uniqueid']][_0x52fc('0x61')]=_0x11a873[_0x52fc('0x4a')];}}}catch(_0x4c0dfe){utils[_0x52fc('0x2e')](util['format'](_0x52fc('0x47'),_0x11a873[_0x52fc('0x8')]),_0x4c0dfe);}};exports[_0x52fc('0x62')]=function(_0x382bdb){try{if(!_[_0x52fc('0x23')](channels[_0x382bdb[_0x52fc('0x8')]])){utils[_0x52fc('0x15')](util[_0x52fc('0x19')](_0x52fc('0x63'),_0x382bdb[_0x52fc('0x8')]),_0x382bdb);utils[_0x52fc('0xa')](util[_0x52fc('0x19')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x382bdb['uniqueid'],_0x382bdb[_0x52fc('0x64')],_0x382bdb[_0x52fc('0x65')]));if(_0x382bdb[_0x52fc('0x64')][_0x52fc('0x66')]()==_0x52fc('0x67')&&_[_0x52fc('0x68')](_0x382bdb['appdata'][_0x52fc('0x66')](),_0x52fc('0x69'))){var _0x4ee65d=_0x382bdb[_0x52fc('0x65')][_0x52fc('0x6a')]('=');var _0x4d7423=_0x4ee65d[0x0]['substring'](_0x4ee65d[0x0][_0x52fc('0x6b')]('(')+0x1,_0x4ee65d[0x0][_0x52fc('0x6b')](')'));var _0x4b7811=_0x4ee65d[0x1];channels[_0x382bdb[_0x52fc('0x8')]][_0x4d7423]=_0x4b7811;}if(!_[_0x52fc('0x6c')]([_0x52fc('0x2f'),'noop',_0x52fc('0x6d'),_0x52fc('0x67'),_0x52fc('0x6e')],_0x382bdb['application'][_0x52fc('0x66')]())){channels[_0x382bdb[_0x52fc('0x8')]][_0x52fc('0x55')]=_0x382bdb[_0x52fc('0x64')];channels[_0x382bdb[_0x52fc('0x8')]]['lastdata']=_0x382bdb[_0x52fc('0x65')];}}}catch(_0x1ff364){utils[_0x52fc('0x2e')](util['format']('[%s][calls][newexten]',_0x382bdb['uniqueid']),_0x1ff364);}}; \ No newline at end of file +var _0xe50a=['[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','channelstate','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','duration','endtime','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','variable','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','execif','gotoif','lodash','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','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','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','debug','[%s][calls][newchannel]','linkedid'];(function(_0x417ef3,_0x5bbbea){var _0x52d552=function(_0x559f7){while(--_0x559f7){_0x417ef3['push'](_0x417ef3['shift']());}};_0x52d552(++_0x5bbbea);}(_0xe50a,0x134));var _0xae50=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xe50a[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0xae50('0x0'));var util=require(_0xae50('0x1'));var utils=require(_0xae50('0x2'));var transfers=require(_0xae50('0x3'));var dispositions=['NO\x20ANSWER',_0xae50('0x4'),_0xae50('0x4'),'NO\x20ANSWER',_0xae50('0x5'),'NO\x20ANSWER',_0xae50('0x6'),_0xae50('0x7'),_0xae50('0x4'),_0xae50('0x4'),_0xae50('0x4')];var channels={};function writeDB(_0x128f6e){var _0x33e52d;if(transfers[_0xae50('0x8')][_0x128f6e[_0xae50('0x9')]]){_0x33e52d=_0x128f6e[_0xae50('0x9')];_0x128f6e[_0xae50('0x9')]=transfers['blinds'][_0x128f6e[_0xae50('0x9')]]['transfereeuniqueid'];}utils[_0xae50('0xa')](util[_0xae50('0xb')](_0xae50('0xc'),_0x128f6e[_0xae50('0x9')],_0x128f6e[_0xae50('0xd')],_0x128f6e[_0xae50('0xe')],_0x128f6e[_0xae50('0xf')],_0x128f6e[_0xae50('0x10')],_0x128f6e[_0xae50('0x11')],_0x128f6e[_0xae50('0x12')],_0x128f6e[_0xae50('0x13')]));if(_0x128f6e[_0xae50('0x14')]){utils['getUserByInternal'](_0x128f6e[_0xae50('0x14')])[_0xae50('0x15')](function(_0x12ec7b){if(_0x12ec7b){_0x128f6e[_0xae50('0x16')]=_0x12ec7b['id'];}utils[_0xae50('0x17')]('CreateVoiceCallReport',_0x128f6e);});}else{utils[_0xae50('0x17')](_0xae50('0x18'),_0x128f6e);}if(channels[_0x128f6e['uniqueid']]){delete channels[_0x128f6e['uniqueid']];}else if(_0x33e52d&&channels[_0x33e52d]){delete transfers[_0xae50('0x8')][_0x33e52d];delete channels[_0x33e52d];}}exports['newchannel']=function(_0x48c232){try{utils[_0xae50('0x19')](util[_0xae50('0xb')](_0xae50('0x1a'),_0x48c232['uniqueid']),_0x48c232);if(_0x48c232[_0xae50('0x9')]==_0x48c232[_0xae50('0x1b')]&&_0x48c232[_0xae50('0xd')]!='OutgoingSpoolFailed'){utils[_0xae50('0xa')](util[_0xae50('0xb')](_0xae50('0x1c'),_0x48c232[_0xae50('0x9')],_0x48c232[_0xae50('0x1d')],_0x48c232['exten']));channels[_0x48c232[_0xae50('0x9')]]={'uniqueid':_0x48c232[_0xae50('0x9')],'accountcode':_0x48c232[_0xae50('0x14')],'source':_0x48c232[_0xae50('0x11')],'destination':_0x48c232[_0xae50('0x1e')],'destinationcontext':_0x48c232['context'],'channel':_0x48c232['channel'],'starttime':utils[_0xae50('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xae50('0x5'),'amaflags':_0xae50('0x20')};}}catch(_0x4fb25f){utils[_0xae50('0x21')](util[_0xae50('0xb')](_0xae50('0x1a'),_0x48c232[_0xae50('0x9')]),_0x4fb25f);}};exports[_0xae50('0x22')]=function(_0x5a4c2a){try{utils[_0xae50('0x19')](util['format'](_0xae50('0x23'),_0x5a4c2a[_0xae50('0x9')]),_0x5a4c2a);if(!_[_0xae50('0x24')](channels[_0x5a4c2a[_0xae50('0x9')]])&&_0x5a4c2a['channelstate']==0x6){utils[_0xae50('0xa')](util[_0xae50('0xb')](_0xae50('0x25'),_0x5a4c2a[_0xae50('0x9')],_0x5a4c2a['context'],_0x5a4c2a[_0xae50('0xd')]));if(_[_0xae50('0x24')](channels[_0x5a4c2a[_0xae50('0x9')]][_0xae50('0x26')])){channels[_0x5a4c2a[_0xae50('0x9')]][_0xae50('0x26')]=utils[_0xae50('0x1f')]();}}else if(!_['isNil'](channels[_0x5a4c2a[_0xae50('0x1b')]])&&_0x5a4c2a['channelstate']==0x6&&_0x5a4c2a[_0xae50('0x1d')]!=_0xae50('0x27')){utils[_0xae50('0xa')](util['format'](_0xae50('0x28'),_0x5a4c2a[_0xae50('0x9')],_0x5a4c2a[_0xae50('0x1b')],_0x5a4c2a[_0xae50('0x1d')],_0x5a4c2a[_0xae50('0xd')]));channels[_0x5a4c2a[_0xae50('0x1b')]]['accountcode']=_0x5a4c2a[_0xae50('0x14')];channels[_0x5a4c2a['linkedid']][_0xae50('0x29')]=_0x5a4c2a['channel'];if(_[_0xae50('0x24')](channels[_0x5a4c2a[_0xae50('0x1b')]][_0xae50('0x2a')])){channels[_0x5a4c2a['linkedid']][_0xae50('0x2a')]=utils[_0xae50('0x1f')]();}channels[_0x5a4c2a[_0xae50('0x1b')]]['disposition']=dispositions[_[_0xae50('0x2b')](_0x5a4c2a[_0xae50('0x2c')])]||_0xae50('0x6');}}catch(_0x9e8ceb){utils[_0xae50('0x21')](util['format'](_0xae50('0x23'),_0x5a4c2a[_0xae50('0x9')]),_0x9e8ceb);}};exports[_0xae50('0x2d')]=function(_0x432f39){try{if(!_['isNil'](channels[_0x432f39[_0xae50('0x9')]])){utils[_0xae50('0x19')](util['format'](_0xae50('0x2e'),_0x432f39[_0xae50('0x9')]),_0x432f39);if(_[_0xae50('0x24')](channels[_0x432f39['uniqueid']]['callerid'])){channels[_0x432f39[_0xae50('0x9')]][_0xae50('0x2f')]=_0x432f39[_0xae50('0x30')]+'\x20<'+_0x432f39[_0xae50('0x11')]+'>';}utils[_0xae50('0xa')](util[_0xae50('0xb')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x432f39[_0xae50('0x9')],channels[_0x432f39['uniqueid']][_0xae50('0x2f')],_0x432f39[_0xae50('0x31')]));channels[_0x432f39['uniqueid']]['endtime']=utils[_0xae50('0x1f')]();channels[_0x432f39['uniqueid']][_0xae50('0x32')]=utils['diffTime'](channels[_0x432f39['uniqueid']][_0xae50('0x33')],channels[_0x432f39[_0xae50('0x9')]]['starttime']);channels[_0x432f39[_0xae50('0x9')]]['billableseconds']=channels[_0x432f39['uniqueid']][_0xae50('0x2a')]?utils[_0xae50('0x34')](channels[_0x432f39[_0xae50('0x9')]][_0xae50('0x33')],channels[_0x432f39[_0xae50('0x9')]][_0xae50('0x2a')]):0x0;writeDB(channels[_0x432f39['uniqueid']]);}}catch(_0x5b19ba){utils['error'](util['format'](_0xae50('0x2e'),_0x432f39[_0xae50('0x9')]),_0x5b19ba);}};exports[_0xae50('0x35')]=function(_0x1fb0b2){try{if(!_[_0xae50('0x24')](channels[_0x1fb0b2[_0xae50('0x36')]])){utils[_0xae50('0x19')](util['format'](_0xae50('0x37'),_0x1fb0b2[_0xae50('0x38')]),_0x1fb0b2);if(channels[_0x1fb0b2[_0xae50('0x36')]][_0xae50('0xd')]==_0x1fb0b2[_0xae50('0x39')]){utils[_0xae50('0xa')](util[_0xae50('0xb')](_0xae50('0x3a'),_0x1fb0b2[_0xae50('0x38')],_0x1fb0b2[_0xae50('0x36')],_0x1fb0b2[_0xae50('0x3b')]));channels[_0x1fb0b2[_0xae50('0x36')]][_0xae50('0x29')]=_0x1fb0b2[_0xae50('0x3b')];channels[_0x1fb0b2['localtwolinkedid']][_0xae50('0x3c')]=_0xae50('0x3d');}else if(channels[_0x1fb0b2[_0xae50('0x36')]][_0xae50('0xd')]=_0x1fb0b2[_0xae50('0x3e')]){utils[_0xae50('0xa')](util[_0xae50('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x1fb0b2[_0xae50('0x38')],_0x1fb0b2[_0xae50('0x36')],_0x1fb0b2['origtransfererchannel']));channels[_0x1fb0b2['localtwolinkedid']][_0xae50('0x29')]=_0x1fb0b2[_0xae50('0x3f')];channels[_0x1fb0b2['localtwolinkedid']][_0xae50('0x3c')]=_0xae50('0x3d');}}}catch(_0x2f9a8e){utils['error'](util['format'](_0xae50('0x37'),_0x1fb0b2[_0xae50('0x38')]),_0x2f9a8e);}};exports['musiconholdstart']=function(_0x184a11){try{if(!_[_0xae50('0x24')](channels[_0x184a11[_0xae50('0x9')]])){utils[_0xae50('0x19')](util[_0xae50('0xb')](_0xae50('0x40'),_0x184a11[_0xae50('0x9')]),_0x184a11);channels[_0x184a11[_0xae50('0x9')]][_0xae50('0x41')]=utils['now']();utils[_0xae50('0xa')](util[_0xae50('0xb')](_0xae50('0x42'),_0x184a11['uniqueid'],channels[_0x184a11['uniqueid']][_0xae50('0x41')]));}}catch(_0x309d57){utils[_0xae50('0x21')](util[_0xae50('0xb')](_0xae50('0x40'),_0x184a11[_0xae50('0x9')]),_0x309d57);}};exports[_0xae50('0x43')]=function(_0x38d8d0){try{if(!_[_0xae50('0x24')](channels[_0x38d8d0[_0xae50('0x9')]])){utils[_0xae50('0x19')](util['format'](_0xae50('0x44'),_0x38d8d0[_0xae50('0x9')]),_0x38d8d0);if(!_['isNil'](channels[_0x38d8d0['uniqueid']][_0xae50('0x41')])){channels[_0x38d8d0[_0xae50('0x9')]][_0xae50('0x45')]+=utils[_0xae50('0x34')](utils['now'](),channels[_0x38d8d0[_0xae50('0x9')]]['musiconholdstartAt']);utils[_0xae50('0xa')](util[_0xae50('0xb')](_0xae50('0x46'),_0x38d8d0[_0xae50('0x9')],channels[_0x38d8d0[_0xae50('0x9')]]['mohtime']));delete channels[_0x38d8d0[_0xae50('0x9')]]['musiconholdstartAt'];}}}catch(_0x1ecb3e){utils[_0xae50('0x21')](util[_0xae50('0xb')](_0xae50('0x44'),_0x38d8d0[_0xae50('0x9')]),_0x1ecb3e);}};exports[_0xae50('0x47')]=function(_0x2d141c){try{if(!_[_0xae50('0x24')](channels[_0x2d141c[_0xae50('0x9')]])){utils['debug'](util[_0xae50('0xb')]('[%s][calls][varset]',_0x2d141c[_0xae50('0x9')]),_0x2d141c);if(!_[_0xae50('0x24')](_0x2d141c['variable'][_0xae50('0x48')])){utils[_0xae50('0xa')](util['format'](_0xae50('0x49'),_0x2d141c[_0xae50('0x9')],_0x2d141c[_0xae50('0x4a')]));channels[_0x2d141c[_0xae50('0x9')]]['source']=_0x2d141c[_0xae50('0x4a')];}if(!_['isNil'](_0x2d141c['variable'][_0xae50('0x4b')])){utils[_0xae50('0xa')](util[_0xae50('0xb')](_0xae50('0x4c'),_0x2d141c['uniqueid'],_0x2d141c['value']));channels[_0x2d141c['uniqueid']][_0xae50('0x4d')]=_0x2d141c['value'];channels[_0x2d141c[_0xae50('0x9')]]['callerid']='\x22'+_0x2d141c[_0xae50('0x4a')]+_0xae50('0x4e')+_0x2d141c[_0xae50('0x4a')]+'>';}if(!_[_0xae50('0x24')](_0x2d141c[_0xae50('0x4f')][_0xae50('0x50')])||!_['isNil'](_0x2d141c[_0xae50('0x4f')][_0xae50('0x51')])){utils[_0xae50('0xa')](util[_0xae50('0xb')](_0xae50('0x52'),_0x2d141c[_0xae50('0x9')],!_[_0xae50('0x24')](_0x2d141c[_0xae50('0x4f')]['xmd-callerid-preview'])?'xmd-callerid-preview':_0xae50('0x51'),_0x2d141c['value']));channels[_0x2d141c[_0xae50('0x9')]][_0xae50('0x2f')]=_0x2d141c['value'];}if(!_['isNil'](_0x2d141c[_0xae50('0x4f')][_0xae50('0x53')])||!_[_0xae50('0x24')](_0x2d141c[_0xae50('0x4f')]['xmcs-queue'])){utils[_0xae50('0xa')](util[_0xae50('0xb')](_0xae50('0x52'),_0x2d141c[_0xae50('0x9')],!_[_0xae50('0x24')](_0x2d141c['variable'][_0xae50('0x53')])?_0xae50('0x53'):_0xae50('0x54'),_0x2d141c[_0xae50('0x4a')]));channels[_0x2d141c[_0xae50('0x9')]][_0xae50('0x55')]=_0xae50('0x56');channels[_0x2d141c[_0xae50('0x9')]]['lastdata']=_0x2d141c[_0xae50('0x4a')];channels[_0x2d141c[_0xae50('0x9')]][_0xae50('0xe')]=!![];}if(!_[_0xae50('0x24')](_0x2d141c[_0xae50('0x4f')][_0xae50('0x57')])){utils[_0xae50('0xa')](util['format'](_0xae50('0x58'),_0x2d141c[_0xae50('0x9')],_0x2d141c[_0xae50('0x4a')]));channels[_0x2d141c[_0xae50('0x9')]][_0xae50('0x59')]=_0x2d141c[_0xae50('0x4a')];}if(!_[_0xae50('0x24')](_0x2d141c['variable'][_0xae50('0x5a')])){utils[_0xae50('0xa')](util[_0xae50('0xb')](_0xae50('0x5b'),_0x2d141c[_0xae50('0x9')],_0x2d141c[_0xae50('0x4a')]));channels[_0x2d141c['uniqueid']][_0xae50('0x5c')]=_0x2d141c[_0xae50('0x4a')];}if(!_['isNil'](_0x2d141c['variable']['outboundrouteid'])){utils[_0xae50('0xa')](util[_0xae50('0xb')](_0xae50('0x5d'),_0x2d141c[_0xae50('0x9')],_0x2d141c[_0xae50('0x4a')]));channels[_0x2d141c[_0xae50('0x9')]][_0xae50('0x5e')]=_0x2d141c[_0xae50('0x4a')];}if(!_['isNil'](_0x2d141c[_0xae50('0x4f')][_0xae50('0x5f')])){utils[_0xae50('0xa')](util['format'](_0xae50('0x60'),_0x2d141c[_0xae50('0x9')],_0x2d141c[_0xae50('0x4a')]));channels[_0x2d141c['uniqueid']][_0xae50('0x5f')]=_0x2d141c['value'];}}}catch(_0x407cb2){utils['error'](util[_0xae50('0xb')](_0xae50('0x61'),_0x2d141c[_0xae50('0x9')]),_0x407cb2);}};exports['newexten']=function(_0xf8cbd9){try{if(!_[_0xae50('0x24')](channels[_0xf8cbd9['uniqueid']])){utils['debug'](util[_0xae50('0xb')](_0xae50('0x62'),_0xf8cbd9['uniqueid']),_0xf8cbd9);utils[_0xae50('0xa')](util[_0xae50('0xb')](_0xae50('0x63'),_0xf8cbd9[_0xae50('0x9')],_0xf8cbd9[_0xae50('0x64')],_0xf8cbd9[_0xae50('0x65')]));if(_0xf8cbd9[_0xae50('0x64')][_0xae50('0x66')]()==_0xae50('0x67')&&_[_0xae50('0x68')](_0xf8cbd9[_0xae50('0x65')][_0xae50('0x66')](),_0xae50('0x69'))){var _0x19e351=_0xf8cbd9['appdata'][_0xae50('0x6a')]('=');var _0x5c528c=_0x19e351[0x0][_0xae50('0x6b')](_0x19e351[0x0][_0xae50('0x6c')]('(')+0x1,_0x19e351[0x0][_0xae50('0x6c')](')'));var _0x5abdbc=_0x19e351[0x1];channels[_0xf8cbd9[_0xae50('0x9')]][_0x5c528c]=_0x5abdbc;}if(!_[_0xae50('0x6d')]([_0xae50('0x2d'),'noop',_0xae50('0x6e'),'set',_0xae50('0x6f')],_0xf8cbd9[_0xae50('0x64')][_0xae50('0x66')]())){channels[_0xf8cbd9[_0xae50('0x9')]][_0xae50('0x55')]=_0xf8cbd9[_0xae50('0x64')];channels[_0xf8cbd9[_0xae50('0x9')]]['lastdata']=_0xf8cbd9[_0xae50('0x65')];}}}catch(_0x24b0cb){utils[_0xae50('0x21')](util['format'](_0xae50('0x62'),_0xf8cbd9['uniqueid']),_0x24b0cb);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index c2bb6e3..62dc333 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 _0xd66f=['close','managerevent','./utils','connect','[core]\x20connected','[core]\x20shutdown','info','[core]\x20fullybooted','error','[core]\x20error'];(function(_0x27ac11,_0x164c17){var _0x5aab19=function(_0x594012){while(--_0x594012){_0x27ac11['push'](_0x27ac11['shift']());}};_0x5aab19(++_0x164c17);}(_0xd66f,0x1ec));var _0xfd66=function(_0x4ae2e9,_0x2c6299){_0x4ae2e9=_0x4ae2e9-0x0;var _0x23b9be=_0xd66f[_0x4ae2e9];return _0x23b9be;};'use strict';var utils=require(_0xfd66('0x0'));exports[_0xfd66('0x1')]=function(){utils['info'](_0xfd66('0x2'));};exports['shutdown']=function(){utils['info'](_0xfd66('0x3'));};exports['fullybooted']=function(){utils[_0xfd66('0x4')](_0xfd66('0x5'));};exports['error']=function(_0x4ce7a4){utils[_0xfd66('0x6')](_0xfd66('0x7'),_0x4ce7a4);};exports[_0xfd66('0x8')]=function(){utils[_0xfd66('0x4')]('[core]\x20close');};exports[_0xfd66('0x9')]=function(_0x20d92c){}; \ No newline at end of file +var _0x58fe=['fullybooted','error','[core]\x20error','close','./utils','info','[core]\x20connected','shutdown','[core]\x20shutdown'];(function(_0x219cc1,_0x3d03b5){var _0x177034=function(_0x45e0fe){while(--_0x45e0fe){_0x219cc1['push'](_0x219cc1['shift']());}};_0x177034(++_0x3d03b5);}(_0x58fe,0x1ab));var _0xe58f=function(_0x1db481,_0x1627b2){_0x1db481=_0x1db481-0x0;var _0x3db95b=_0x58fe[_0x1db481];return _0x3db95b;};'use strict';var utils=require(_0xe58f('0x0'));exports['connect']=function(){utils[_0xe58f('0x1')](_0xe58f('0x2'));};exports[_0xe58f('0x3')]=function(){utils[_0xe58f('0x1')](_0xe58f('0x4'));};exports[_0xe58f('0x5')]=function(){utils[_0xe58f('0x1')]('[core]\x20fullybooted');};exports[_0xe58f('0x6')]=function(_0x1e0f52){utils[_0xe58f('0x6')](_0xe58f('0x7'),_0x1e0f52);};exports[_0xe58f('0x8')]=function(){utils['info']('[core]\x20close');};exports['managerevent']=function(_0x1c0070){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 7656643..2f51b18 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 _0x7de0=['[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','diffTime','holdtime','endtime','billableseconds','error','lodash','./utils','info','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','debug','format','[%s][dials][newexten]','uniqueid','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','startsWith','toLowerCase','cdr(routeid)','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','lastevent','called','dialend','[%s][dials][dialend]','ANSWER','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7de0,0x137));var _0x07de=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7de0[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x07de('0x0'));var util=require('util');var utils=require(_0x07de('0x1'));var dials={};function writeDB(_0x1ebd69){utils[_0x07de('0x2')](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x1ebd69['uniqueid'],_0x1ebd69[_0x07de('0x3')],_0x1ebd69[_0x07de('0x4')],_0x1ebd69[_0x07de('0x5')],_0x1ebd69[_0x07de('0x6')],_0x1ebd69[_0x07de('0x7')]));utils['request'](_0x07de('0x8'),_0x1ebd69);delete dials[_0x1ebd69['uniqueid']];}exports['newexten']=function(_0x9f5e93){try{utils[_0x07de('0x9')](util[_0x07de('0xa')](_0x07de('0xb'),_0x9f5e93[_0x07de('0xc')]),_0x9f5e93);utils['info'](util[_0x07de('0xa')](_0x07de('0xd'),_0x9f5e93[_0x07de('0xc')],_0x9f5e93['application'],_0x9f5e93[_0x07de('0xe')]));if(_0x9f5e93[_0x07de('0xf')]['toLowerCase']()=='set'&&_[_0x07de('0x10')](_0x9f5e93[_0x07de('0xe')][_0x07de('0x11')](),_0x07de('0x12'))){var _0x416b6c=_0x9f5e93[_0x07de('0xe')]['split']('=');dials[_0x9f5e93[_0x07de('0xc')]]={'routeId':_0x416b6c[0x1]};}}catch(_0x544e06){utils['error'](util['format'](_0x07de('0xb'),_0x9f5e93[_0x07de('0xc')]),_0x544e06);}};exports[_0x07de('0x13')]=function(_0x3bba73){try{utils[_0x07de('0x9')](util[_0x07de('0xa')](_0x07de('0x14'),_0x3bba73[_0x07de('0xc')]),_0x3bba73);if(!_[_0x07de('0x15')](_0x3bba73[_0x07de('0x16')][_0x07de('0x17')])){utils[_0x07de('0x2')](util[_0x07de('0xa')](_0x07de('0x18'),_0x3bba73[_0x07de('0xc')],_0x3bba73[_0x07de('0x19')]));dials[_0x3bba73[_0x07de('0xc')]]={'routeId':_0x3bba73[_0x07de('0x19')]};}}catch(_0x20c8be){utils['error'](util[_0x07de('0xa')](_0x07de('0x14'),_0x3bba73[_0x07de('0xc')]),_0x20c8be);}};exports[_0x07de('0x1a')]=function(_0x5a95da){try{if(!_['isNil'](dials[_0x5a95da[_0x07de('0xc')]])){utils['debug'](util[_0x07de('0xa')](_0x07de('0x1b'),_0x5a95da['uniqueid']),_0x5a95da);dials[_0x5a95da[_0x07de('0xc')]]=_[_0x07de('0x1c')](dials[_0x5a95da['uniqueid']],_0x5a95da);dials[_0x5a95da[_0x07de('0xc')]][_0x07de('0x1d')]=utils['now']();dials[_0x5a95da[_0x07de('0xc')]][_0x07de('0x1e')]=_0x07de('0x1f');utils[_0x07de('0x2')](util[_0x07de('0xa')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x5a95da['uniqueid'],dials[_0x5a95da[_0x07de('0xc')]][_0x07de('0x1d')]));}}catch(_0x2e2a6b){utils['error'](util[_0x07de('0xa')](_0x07de('0x1b'),_0x5a95da[_0x07de('0xc')]),_0x2e2a6b);}};exports[_0x07de('0x20')]=function(_0x114332){try{if(!_[_0x07de('0x15')](dials[_0x114332[_0x07de('0xc')]])){utils['debug'](util['format'](_0x07de('0x21'),_0x114332[_0x07de('0xc')]),_0x114332);dials[_0x114332['uniqueid']][_0x07de('0x7')]=_0x114332[_0x07de('0x7')];if(_0x114332[_0x07de('0x7')]==_0x07de('0x22')){dials[_0x114332[_0x07de('0xc')]]=_[_0x07de('0x1c')](dials[_0x114332[_0x07de('0xc')]],_0x114332);dials[_0x114332['uniqueid']]['answertime']=utils[_0x07de('0x23')]();dials[_0x114332[_0x07de('0xc')]][_0x07de('0x1e')]=_0x07de('0x24');utils[_0x07de('0x2')](util[_0x07de('0xa')](_0x07de('0x25'),_0x114332[_0x07de('0xc')],_0x114332[_0x07de('0x7')],dials[_0x114332[_0x07de('0xc')]][_0x07de('0x26')]));}else{utils[_0x07de('0x2')](util[_0x07de('0xa')](_0x07de('0x27'),_0x114332['uniqueid'],_0x114332[_0x07de('0x7')]));}}}catch(_0x14c787){utils['error'](util[_0x07de('0xa')](_0x07de('0x21'),_0x114332['uniqueid']),_0x14c787);}};exports[_0x07de('0x28')]=function(_0x3e3802){try{if(!_[_0x07de('0x15')](dials[_0x3e3802[_0x07de('0xc')]])){utils[_0x07de('0x9')](util[_0x07de('0xa')](_0x07de('0x29'),_0x3e3802[_0x07de('0xc')]),_0x3e3802);utils[_0x07de('0x2')](util[_0x07de('0xa')](_0x07de('0x2a'),_0x3e3802[_0x07de('0xc')],_0x3e3802[_0x07de('0x5')],_0x3e3802[_0x07de('0x2b')],_0x3e3802['cause-txt']));dials[_0x3e3802['uniqueid']]=_['assign'](dials[_0x3e3802[_0x07de('0xc')]],{'endtime':utils[_0x07de('0x23')](),'lastevent':_0x07de('0x2c')});dials[_0x3e3802[_0x07de('0xc')]]['duration']=utils[_0x07de('0x2d')](dials[_0x3e3802[_0x07de('0xc')]]['endtime'],dials[_0x3e3802[_0x07de('0xc')]]['starttime']);dials[_0x3e3802[_0x07de('0xc')]][_0x07de('0x2e')]=utils[_0x07de('0x2d')](dials[_0x3e3802['uniqueid']]['answertime']||dials[_0x3e3802[_0x07de('0xc')]][_0x07de('0x2f')],dials[_0x3e3802[_0x07de('0xc')]][_0x07de('0x1d')]);dials[_0x3e3802['uniqueid']][_0x07de('0x30')]=dials[_0x3e3802[_0x07de('0xc')]][_0x07de('0x26')]?utils[_0x07de('0x2d')](dials[_0x3e3802['uniqueid']][_0x07de('0x2f')],dials[_0x3e3802[_0x07de('0xc')]][_0x07de('0x26')]):0x0;writeDB(dials[_0x3e3802[_0x07de('0xc')]]);}}catch(_0x33fe9a){utils[_0x07de('0x31')](util[_0x07de('0xa')]('[%s][dials][hangup]',_0x3e3802['uniqueid']),_0x33fe9a);}}; \ No newline at end of file +var _0xb542=['[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr(routeid)','error','varset','debug','[%s][dials][varset]','isNil','variable','outboundrouteid','value','dialbegin','[%s][dials][dialbegin]','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','format'];(function(_0x537a6a,_0x39b2e9){var _0x338299=function(_0x1a6d90){while(--_0x1a6d90){_0x537a6a['push'](_0x537a6a['shift']());}};_0x338299(++_0x39b2e9);}(_0xb542,0x109));var _0x2b54=function(_0x4cc9dd,_0x2c0d5b){_0x4cc9dd=_0x4cc9dd-0x0;var _0x4ddfae=_0xb542[_0x4cc9dd];return _0x4ddfae;};'use strict';var _=require(_0x2b54('0x0'));var util=require(_0x2b54('0x1'));var utils=require(_0x2b54('0x2'));var dials={};function writeDB(_0x501f7a){utils[_0x2b54('0x3')](util[_0x2b54('0x4')](_0x2b54('0x5'),_0x501f7a['uniqueid'],_0x501f7a['channel'],_0x501f7a[_0x2b54('0x6')],_0x501f7a[_0x2b54('0x7')],_0x501f7a[_0x2b54('0x8')],_0x501f7a[_0x2b54('0x9')]));utils[_0x2b54('0xa')](_0x2b54('0xb'),_0x501f7a);delete dials[_0x501f7a[_0x2b54('0xc')]];}exports['newexten']=function(_0x52f0e3){try{utils['debug'](util['format'](_0x2b54('0xd'),_0x52f0e3['uniqueid']),_0x52f0e3);utils[_0x2b54('0x3')](util[_0x2b54('0x4')](_0x2b54('0xe'),_0x52f0e3[_0x2b54('0xc')],_0x52f0e3[_0x2b54('0xf')],_0x52f0e3[_0x2b54('0x10')]));if(_0x52f0e3[_0x2b54('0xf')]['toLowerCase']()==_0x2b54('0x11')&&_[_0x2b54('0x12')](_0x52f0e3['appdata'][_0x2b54('0x13')](),_0x2b54('0x14'))){var _0x1bd20b=_0x52f0e3[_0x2b54('0x10')]['split']('=');dials[_0x52f0e3['uniqueid']]={'routeId':_0x1bd20b[0x1]};}}catch(_0x2c3c7b){utils[_0x2b54('0x15')](util[_0x2b54('0x4')](_0x2b54('0xd'),_0x52f0e3[_0x2b54('0xc')]),_0x2c3c7b);}};exports[_0x2b54('0x16')]=function(_0x4f9a4d){try{utils[_0x2b54('0x17')](util['format'](_0x2b54('0x18'),_0x4f9a4d[_0x2b54('0xc')]),_0x4f9a4d);if(!_[_0x2b54('0x19')](_0x4f9a4d[_0x2b54('0x1a')][_0x2b54('0x1b')])){utils[_0x2b54('0x3')](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x4f9a4d['uniqueid'],_0x4f9a4d[_0x2b54('0x1c')]));dials[_0x4f9a4d[_0x2b54('0xc')]]={'routeId':_0x4f9a4d[_0x2b54('0x1c')]};}}catch(_0x4494e1){utils['error'](util[_0x2b54('0x4')]('[%s][dials][varset]',_0x4f9a4d[_0x2b54('0xc')]),_0x4494e1);}};exports[_0x2b54('0x1d')]=function(_0x290d5c){try{if(!_['isNil'](dials[_0x290d5c['uniqueid']])){utils['debug'](util[_0x2b54('0x4')](_0x2b54('0x1e'),_0x290d5c[_0x2b54('0xc')]),_0x290d5c);dials[_0x290d5c[_0x2b54('0xc')]]=_[_0x2b54('0x1f')](dials[_0x290d5c['uniqueid']],_0x290d5c);dials[_0x290d5c[_0x2b54('0xc')]]['starttime']=utils[_0x2b54('0x20')]();dials[_0x290d5c['uniqueid']][_0x2b54('0x21')]=_0x2b54('0x22');utils['info'](util['format'](_0x2b54('0x23'),_0x290d5c['uniqueid'],dials[_0x290d5c['uniqueid']][_0x2b54('0x24')]));}}catch(_0x2d7b23){utils[_0x2b54('0x15')](util[_0x2b54('0x4')](_0x2b54('0x1e'),_0x290d5c[_0x2b54('0xc')]),_0x2d7b23);}};exports['dialend']=function(_0x925a42){try{if(!_[_0x2b54('0x19')](dials[_0x925a42[_0x2b54('0xc')]])){utils[_0x2b54('0x17')](util['format']('[%s][dials][dialend]',_0x925a42[_0x2b54('0xc')]),_0x925a42);dials[_0x925a42[_0x2b54('0xc')]][_0x2b54('0x9')]=_0x925a42[_0x2b54('0x9')];if(_0x925a42[_0x2b54('0x9')]==_0x2b54('0x25')){dials[_0x925a42['uniqueid']]=_[_0x2b54('0x1f')](dials[_0x925a42[_0x2b54('0xc')]],_0x925a42);dials[_0x925a42[_0x2b54('0xc')]][_0x2b54('0x26')]=utils[_0x2b54('0x20')]();dials[_0x925a42['uniqueid']]['lastevent']=_0x2b54('0x27');utils[_0x2b54('0x3')](util[_0x2b54('0x4')](_0x2b54('0x28'),_0x925a42[_0x2b54('0xc')],_0x925a42[_0x2b54('0x9')],dials[_0x925a42[_0x2b54('0xc')]][_0x2b54('0x26')]));}else{utils[_0x2b54('0x3')](util[_0x2b54('0x4')](_0x2b54('0x29'),_0x925a42[_0x2b54('0xc')],_0x925a42[_0x2b54('0x9')]));}}}catch(_0x3ba435){utils[_0x2b54('0x15')](util[_0x2b54('0x4')](_0x2b54('0x2a'),_0x925a42['uniqueid']),_0x3ba435);}};exports[_0x2b54('0x2b')]=function(_0x3f590a){try{if(!_[_0x2b54('0x19')](dials[_0x3f590a[_0x2b54('0xc')]])){utils[_0x2b54('0x17')](util[_0x2b54('0x4')](_0x2b54('0x2c'),_0x3f590a['uniqueid']),_0x3f590a);utils[_0x2b54('0x3')](util[_0x2b54('0x4')](_0x2b54('0x2d'),_0x3f590a[_0x2b54('0xc')],_0x3f590a[_0x2b54('0x7')],_0x3f590a[_0x2b54('0x2e')],_0x3f590a[_0x2b54('0x2f')]));dials[_0x3f590a['uniqueid']]=_['assign'](dials[_0x3f590a[_0x2b54('0xc')]],{'endtime':utils[_0x2b54('0x20')](),'lastevent':_0x2b54('0x30')});dials[_0x3f590a[_0x2b54('0xc')]][_0x2b54('0x31')]=utils[_0x2b54('0x32')](dials[_0x3f590a[_0x2b54('0xc')]][_0x2b54('0x33')],dials[_0x3f590a['uniqueid']]['starttime']);dials[_0x3f590a[_0x2b54('0xc')]][_0x2b54('0x34')]=utils['diffTime'](dials[_0x3f590a[_0x2b54('0xc')]][_0x2b54('0x26')]||dials[_0x3f590a[_0x2b54('0xc')]]['endtime'],dials[_0x3f590a['uniqueid']][_0x2b54('0x24')]);dials[_0x3f590a['uniqueid']][_0x2b54('0x35')]=dials[_0x3f590a[_0x2b54('0xc')]][_0x2b54('0x26')]?utils[_0x2b54('0x32')](dials[_0x3f590a[_0x2b54('0xc')]][_0x2b54('0x33')],dials[_0x3f590a[_0x2b54('0xc')]][_0x2b54('0x26')]):0x0;writeDB(dials[_0x3f590a[_0x2b54('0xc')]]);}}catch(_0x413e07){utils[_0x2b54('0x15')](util[_0x2b54('0x4')](_0x2b54('0x2c'),_0x3f590a[_0x2b54('0xc')]),_0x413e07);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 5bc5ff7..95851b6 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 _0xdf06=['asterisk','port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','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]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','util'];(function(_0x589ada,_0x4183e3){var _0x1c246b=function(_0x3dca2b){while(--_0x3dca2b){_0x589ada['push'](_0x589ada['shift']());}};_0x1c246b(++_0x4183e3);}(_0xdf06,0x87));var _0x6df0=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xdf06[_0x2f5ac5];return _0x37c9a8;};var AsteriskManager=require('asterisk-manager');var config=require(_0x6df0('0x0'));var utils=require(_0x6df0('0x1'));var util=require(_0x6df0('0x2'));var ami=new AsteriskManager(config[_0x6df0('0x3')][_0x6df0('0x4')],config['asterisk']['ip'],config[_0x6df0('0x3')][_0x6df0('0x5')],config[_0x6df0('0x3')][_0x6df0('0x6')],!![]);ami[_0x6df0('0x7')]();if(config['xdr']&&config[_0x6df0('0x8')][_0x6df0('0x9')]){utils[_0x6df0('0xa')](_0x6df0('0xb'));}else{var agents=require('./agents.controller');var calls=require(_0x6df0('0xc'));var queues=require(_0x6df0('0xd'));var recordings=require(_0x6df0('0xe'));var members=require(_0x6df0('0xf'));var dials=require(_0x6df0('0x10'));var transfers=require(_0x6df0('0x11'));var core=require(_0x6df0('0x12'));ami['on'](_0x6df0('0x13'),core[_0x6df0('0x13')]);ami['on'](_0x6df0('0x14'),core[_0x6df0('0x14')]);ami['on'](_0x6df0('0x15'),core[_0x6df0('0x15')]);ami['on'](_0x6df0('0x16'),core[_0x6df0('0x16')]);ami['on']('close',core[_0x6df0('0x17')]);ami['on'](_0x6df0('0x18'),core[_0x6df0('0x18')]);ami['on'](_0x6df0('0x19'),function(_0x382437){try{utils[_0x6df0('0x1a')](util[_0x6df0('0x1b')](_0x6df0('0x1c'),_0x382437['device']),_0x382437);members[_0x6df0('0x19')](_0x382437);}catch(_0x4709ba){utils['error'](util[_0x6df0('0x1b')](_0x6df0('0x1c'),_0x382437[_0x6df0('0x1d')]),_0x4709ba);}});ami['on'](_0x6df0('0x1e'),function(_0x1401ed){try{utils[_0x6df0('0x1a')](util['format'](_0x6df0('0x1f'),_0x1401ed[_0x6df0('0x20')]),_0x1401ed);agents[_0x6df0('0x1e')](_0x1401ed);}catch(_0x1c769a){utils[_0x6df0('0x16')](util['format'](_0x6df0('0x1f'),_0x1401ed[_0x6df0('0x20')]),_0x1c769a);}});ami['on']('agentringnoanswer',function(_0x739030){try{utils[_0x6df0('0x1a')](util[_0x6df0('0x1b')](_0x6df0('0x21'),_0x739030[_0x6df0('0x20')]),_0x739030);agents[_0x6df0('0x22')](_0x739030);}catch(_0x25606d){utils[_0x6df0('0x16')](util[_0x6df0('0x1b')](_0x6df0('0x21'),_0x739030[_0x6df0('0x20')]),_0x25606d);}});ami['on'](_0x6df0('0x23'),function(_0xe3638f){try{utils[_0x6df0('0x1a')](util['format'](_0x6df0('0x24'),_0xe3638f['uniqueid']),_0xe3638f);agents['agentconnect'](_0xe3638f);queues['agentconnect'](_0xe3638f);}catch(_0x3164c8){utils[_0x6df0('0x16')](util['format'](_0x6df0('0x24'),_0xe3638f['uniqueid']),_0x3164c8);}});ami['on'](_0x6df0('0x25'),function(_0xe279ce){try{utils[_0x6df0('0x1a')](util[_0x6df0('0x1b')]('[%s][index][agentcomplete]',_0xe279ce['uniqueid']),_0xe279ce);agents[_0x6df0('0x25')](_0xe279ce);queues[_0x6df0('0x25')](_0xe279ce);members['agentcomplete'](_0xe279ce);}catch(_0x4355fe){utils[_0x6df0('0x16')](util[_0x6df0('0x1b')]('[%s][index][agentcomplete]',_0xe279ce[_0x6df0('0x20')]),_0x4355fe);}});ami['on']('queuecallerabandon',function(_0x584faa){try{utils['debug'](util[_0x6df0('0x1b')](_0x6df0('0x26'),_0x584faa[_0x6df0('0x20')]),_0x584faa);agents['queuecallerabandon'](_0x584faa);queues[_0x6df0('0x27')](_0x584faa);}catch(_0x3360aa){utils['error'](util[_0x6df0('0x1b')](_0x6df0('0x26'),_0x584faa[_0x6df0('0x20')]),_0x3360aa);}});ami['on'](_0x6df0('0x28'),function(_0x4849f1){try{utils[_0x6df0('0x1a')](util['format'](_0x6df0('0x29'),_0x4849f1[_0x6df0('0x20')]),_0x4849f1);queues['queuecallerjoin'](_0x4849f1);recordings['queuecallerjoin'](_0x4849f1);}catch(_0x14d8d8){utils[_0x6df0('0x16')](util[_0x6df0('0x1b')](_0x6df0('0x29'),_0x4849f1[_0x6df0('0x20')]),_0x14d8d8);}});ami['on'](_0x6df0('0x2a'),function(_0x379cfb){try{utils['debug'](util['format'](_0x6df0('0x2b'),_0x379cfb['uniqueid']),_0x379cfb);queues[_0x6df0('0x2a')](_0x379cfb);}catch(_0x10fdab){utils[_0x6df0('0x16')](util[_0x6df0('0x1b')](_0x6df0('0x2b'),_0x379cfb[_0x6df0('0x20')]),_0x10fdab);}});ami['on'](_0x6df0('0x2c'),function(_0x54a0dd){try{utils[_0x6df0('0x1a')](util[_0x6df0('0x1b')](_0x6df0('0x2d'),_0x54a0dd[_0x6df0('0x20')]),_0x54a0dd);queues[_0x6df0('0x2c')](_0x54a0dd);calls[_0x6df0('0x2c')](_0x54a0dd);}catch(_0x558119){utils[_0x6df0('0x16')](util[_0x6df0('0x1b')]('[%s][index][musiconholdstart]',_0x54a0dd['uniqueid']),_0x558119);}});ami['on'](_0x6df0('0x2e'),function(_0x3c6638){try{utils['debug'](util[_0x6df0('0x1b')](_0x6df0('0x2f'),_0x3c6638[_0x6df0('0x20')]),_0x3c6638);queues[_0x6df0('0x2e')](_0x3c6638);calls[_0x6df0('0x2e')](_0x3c6638);}catch(_0x26e958){utils[_0x6df0('0x16')](util[_0x6df0('0x1b')](_0x6df0('0x2f'),_0x3c6638[_0x6df0('0x20')]),_0x26e958);}});ami['on'](_0x6df0('0x30'),function(_0x31cc4e){try{utils[_0x6df0('0x1a')](util['format'](_0x6df0('0x31'),_0x31cc4e[_0x6df0('0x20')]),_0x31cc4e);calls[_0x6df0('0x30')](_0x31cc4e);recordings[_0x6df0('0x30')](_0x31cc4e);}catch(_0x328a28){utils[_0x6df0('0x16')](util[_0x6df0('0x1b')](_0x6df0('0x31'),_0x31cc4e[_0x6df0('0x20')]),_0x328a28);}});ami['on'](_0x6df0('0x32'),function(_0x566c40){try{utils[_0x6df0('0x1a')](util[_0x6df0('0x1b')](_0x6df0('0x33'),_0x566c40[_0x6df0('0x20')]),_0x566c40);calls['hangup'](_0x566c40);recordings[_0x6df0('0x32')](_0x566c40);dials['hangup'](_0x566c40);agents[_0x6df0('0x32')](_0x566c40);queues['hangup'](_0x566c40);}catch(_0x46684b){utils[_0x6df0('0x16')](util[_0x6df0('0x1b')](_0x6df0('0x33'),_0x566c40[_0x6df0('0x20')]),_0x46684b);}});ami['on'](_0x6df0('0x34'),function(_0x31dd0c){try{utils['debug'](util['format'](_0x6df0('0x35'),_0x31dd0c[_0x6df0('0x20')]),_0x31dd0c);members[_0x6df0('0x34')](_0x31dd0c);}catch(_0x2106cf){utils[_0x6df0('0x16')](util['format'](_0x6df0('0x35'),_0x31dd0c[_0x6df0('0x20')]),_0x2106cf);}});ami['on'](_0x6df0('0x36'),function(_0x2a41a8){try{utils['debug'](util['format'](_0x6df0('0x37'),_0x2a41a8['uniqueid']),_0x2a41a8);queues[_0x6df0('0x36')](_0x2a41a8);agents[_0x6df0('0x36')](_0x2a41a8);transfers[_0x6df0('0x36')](_0x2a41a8);}catch(_0x4c32c3){utils[_0x6df0('0x16')](util[_0x6df0('0x1b')](_0x6df0('0x37'),_0x2a41a8['uniqueid']),_0x4c32c3);}});ami['on'](_0x6df0('0x38'),function(_0x3b47ea){try{utils[_0x6df0('0x1a')](util['format'](_0x6df0('0x39'),_0x3b47ea[_0x6df0('0x3a')]),_0x3b47ea);queues[_0x6df0('0x38')](_0x3b47ea);transfers[_0x6df0('0x38')](_0x3b47ea);agents[_0x6df0('0x38')](_0x3b47ea);calls[_0x6df0('0x38')](_0x3b47ea);}catch(_0x53f399){utils[_0x6df0('0x16')](util[_0x6df0('0x1b')](_0x6df0('0x39'),_0x3b47ea[_0x6df0('0x3a')]),_0x53f399);}});ami['on'](_0x6df0('0x3b'),function(_0x2875e4){try{utils[_0x6df0('0x1a')](util[_0x6df0('0x1b')](_0x6df0('0x3c'),_0x2875e4[_0x6df0('0x20')]),_0x2875e4);queues['varset'](_0x2875e4);recordings['varset'](_0x2875e4);calls[_0x6df0('0x3b')](_0x2875e4);dials[_0x6df0('0x3b')](_0x2875e4);}catch(_0x18ab7e){utils['error'](util[_0x6df0('0x1b')](_0x6df0('0x3c'),_0x2875e4[_0x6df0('0x20')]),_0x18ab7e);}});ami['on'](_0x6df0('0x3d'),function(_0x4cf946){try{utils[_0x6df0('0x1a')](util[_0x6df0('0x1b')](_0x6df0('0x3e'),_0x4cf946['uniqueid']),_0x4cf946);calls[_0x6df0('0x3d')](_0x4cf946);recordings[_0x6df0('0x3d')](_0x4cf946);dials['newexten'](_0x4cf946);}catch(_0x221dcb){utils['error'](util[_0x6df0('0x1b')]('[%s][index][newexten]',_0x4cf946[_0x6df0('0x20')]),_0x221dcb);}});ami['on'](_0x6df0('0x3f'),function(_0x1d7439){try{utils[_0x6df0('0x1a')](util[_0x6df0('0x1b')](_0x6df0('0x40'),_0x1d7439[_0x6df0('0x20')]),_0x1d7439);calls[_0x6df0('0x3f')](_0x1d7439);recordings[_0x6df0('0x3f')](_0x1d7439);}catch(_0xfd0b){utils['error'](util['format']('[%s][index][newchannel]',_0x1d7439[_0x6df0('0x20')]),_0xfd0b);}});ami['on'](_0x6df0('0x41'),function(_0x17cc2b){try{utils[_0x6df0('0x1a')](util[_0x6df0('0x1b')]('[%s][index][dialbegin]',_0x17cc2b[_0x6df0('0x20')]),_0x17cc2b);dials[_0x6df0('0x41')](_0x17cc2b);}catch(_0x2285de){utils['error'](util[_0x6df0('0x1b')](_0x6df0('0x42'),_0x17cc2b['uniqueid']),_0x2285de);}});ami['on'](_0x6df0('0x43'),function(_0x1219b9){try{utils[_0x6df0('0x1a')](util['format']('[%s][index][dialend]',_0x1219b9[_0x6df0('0x20')]),_0x1219b9);dials[_0x6df0('0x43')](_0x1219b9);}catch(_0x2eb361){utils[_0x6df0('0x16')](util[_0x6df0('0x1b')](_0x6df0('0x44'),_0x1219b9['uniqueid']),_0x2eb361);}});} \ No newline at end of file +var _0x98a6=['[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','./utils','util','port','asterisk','username','password','keepConnected','xdr','info','XDR\x20DISABLED','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','device','devicestatechange','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup'];(function(_0x45c262,_0x2e3ce5){var _0x4f2ba6=function(_0x4912d1){while(--_0x4912d1){_0x45c262['push'](_0x45c262['shift']());}};_0x4f2ba6(++_0x2e3ce5);}(_0x98a6,0x162));var _0x698a=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x98a6[_0x5317b5];return _0x3b7ce2;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x698a('0x0'));var util=require(_0x698a('0x1'));var ami=new AsteriskManager(config['asterisk'][_0x698a('0x2')],config[_0x698a('0x3')]['ip'],config[_0x698a('0x3')][_0x698a('0x4')],config[_0x698a('0x3')][_0x698a('0x5')],!![]);ami[_0x698a('0x6')]();if(config[_0x698a('0x7')]&&config[_0x698a('0x7')]['disabled']){utils[_0x698a('0x8')](_0x698a('0x9'));}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require(_0x698a('0xa'));var recordings=require(_0x698a('0xb'));var members=require(_0x698a('0xc'));var dials=require(_0x698a('0xd'));var transfers=require(_0x698a('0xe'));var core=require(_0x698a('0xf'));ami['on'](_0x698a('0x10'),core[_0x698a('0x10')]);ami['on']('shutdown',core[_0x698a('0x11')]);ami['on'](_0x698a('0x12'),core['fullybooted']);ami['on'](_0x698a('0x13'),core[_0x698a('0x13')]);ami['on']('close',core[_0x698a('0x14')]);ami['on'](_0x698a('0x15'),core[_0x698a('0x15')]);ami['on']('devicestatechange',function(_0x2cedd7){try{utils[_0x698a('0x16')](util[_0x698a('0x17')]('[%s][index][devicestatechange]',_0x2cedd7[_0x698a('0x18')]),_0x2cedd7);members[_0x698a('0x19')](_0x2cedd7);}catch(_0x5ce578){utils['error'](util[_0x698a('0x17')]('[%s][index][devicestatechange]',_0x2cedd7[_0x698a('0x18')]),_0x5ce578);}});ami['on'](_0x698a('0x1a'),function(_0x3a6e62){try{utils[_0x698a('0x16')](util['format'](_0x698a('0x1b'),_0x3a6e62[_0x698a('0x1c')]),_0x3a6e62);agents['agentcalled'](_0x3a6e62);}catch(_0x322123){utils[_0x698a('0x13')](util[_0x698a('0x17')](_0x698a('0x1b'),_0x3a6e62[_0x698a('0x1c')]),_0x322123);}});ami['on'](_0x698a('0x1d'),function(_0x63087){try{utils[_0x698a('0x16')](util['format']('[%s][index][agentringnoanswer]',_0x63087['uniqueid']),_0x63087);agents['agentringnoanswer'](_0x63087);}catch(_0x2a4cb9){utils[_0x698a('0x13')](util[_0x698a('0x17')](_0x698a('0x1e'),_0x63087[_0x698a('0x1c')]),_0x2a4cb9);}});ami['on'](_0x698a('0x1f'),function(_0x5d43c0){try{utils['debug'](util[_0x698a('0x17')](_0x698a('0x20'),_0x5d43c0[_0x698a('0x1c')]),_0x5d43c0);agents[_0x698a('0x1f')](_0x5d43c0);queues['agentconnect'](_0x5d43c0);}catch(_0x18140f){utils[_0x698a('0x13')](util[_0x698a('0x17')](_0x698a('0x20'),_0x5d43c0['uniqueid']),_0x18140f);}});ami['on']('agentcomplete',function(_0xa20d2){try{utils[_0x698a('0x16')](util[_0x698a('0x17')](_0x698a('0x21'),_0xa20d2[_0x698a('0x1c')]),_0xa20d2);agents[_0x698a('0x22')](_0xa20d2);queues[_0x698a('0x22')](_0xa20d2);members[_0x698a('0x22')](_0xa20d2);}catch(_0x1cd997){utils['error'](util[_0x698a('0x17')](_0x698a('0x21'),_0xa20d2[_0x698a('0x1c')]),_0x1cd997);}});ami['on'](_0x698a('0x23'),function(_0x26ad9b){try{utils[_0x698a('0x16')](util[_0x698a('0x17')](_0x698a('0x24'),_0x26ad9b[_0x698a('0x1c')]),_0x26ad9b);agents[_0x698a('0x23')](_0x26ad9b);queues[_0x698a('0x23')](_0x26ad9b);}catch(_0xfcbd69){utils['error'](util['format']('[%s][index][queuecallerabandon]',_0x26ad9b[_0x698a('0x1c')]),_0xfcbd69);}});ami['on'](_0x698a('0x25'),function(_0x307e51){try{utils[_0x698a('0x16')](util[_0x698a('0x17')](_0x698a('0x26'),_0x307e51[_0x698a('0x1c')]),_0x307e51);queues[_0x698a('0x25')](_0x307e51);recordings[_0x698a('0x25')](_0x307e51);}catch(_0x4de95b){utils['error'](util[_0x698a('0x17')](_0x698a('0x26'),_0x307e51['uniqueid']),_0x4de95b);}});ami['on'](_0x698a('0x27'),function(_0x115bb9){try{utils[_0x698a('0x16')](util[_0x698a('0x17')](_0x698a('0x28'),_0x115bb9[_0x698a('0x1c')]),_0x115bb9);queues[_0x698a('0x27')](_0x115bb9);}catch(_0x7b634c){utils['error'](util[_0x698a('0x17')](_0x698a('0x28'),_0x115bb9[_0x698a('0x1c')]),_0x7b634c);}});ami['on'](_0x698a('0x29'),function(_0x37e207){try{utils['debug'](util[_0x698a('0x17')](_0x698a('0x2a'),_0x37e207[_0x698a('0x1c')]),_0x37e207);queues[_0x698a('0x29')](_0x37e207);calls['musiconholdstart'](_0x37e207);}catch(_0x286d2f){utils[_0x698a('0x13')](util[_0x698a('0x17')]('[%s][index][musiconholdstart]',_0x37e207[_0x698a('0x1c')]),_0x286d2f);}});ami['on'](_0x698a('0x2b'),function(_0x5a8300){try{utils['debug'](util[_0x698a('0x17')](_0x698a('0x2c'),_0x5a8300[_0x698a('0x1c')]),_0x5a8300);queues[_0x698a('0x2b')](_0x5a8300);calls[_0x698a('0x2b')](_0x5a8300);}catch(_0x3e6cc3){utils['error'](util[_0x698a('0x17')](_0x698a('0x2c'),_0x5a8300[_0x698a('0x1c')]),_0x3e6cc3);}});ami['on']('newstate',function(_0x223088){try{utils[_0x698a('0x16')](util[_0x698a('0x17')](_0x698a('0x2d'),_0x223088['uniqueid']),_0x223088);calls[_0x698a('0x2e')](_0x223088);recordings['newstate'](_0x223088);}catch(_0x3b3843){utils['error'](util[_0x698a('0x17')]('[%s][index][newstate]',_0x223088[_0x698a('0x1c')]),_0x3b3843);}});ami['on'](_0x698a('0x2f'),function(_0x52a7c6){try{utils['debug'](util[_0x698a('0x17')](_0x698a('0x30'),_0x52a7c6['uniqueid']),_0x52a7c6);calls[_0x698a('0x2f')](_0x52a7c6);recordings[_0x698a('0x2f')](_0x52a7c6);dials[_0x698a('0x2f')](_0x52a7c6);agents[_0x698a('0x2f')](_0x52a7c6);queues[_0x698a('0x2f')](_0x52a7c6);}catch(_0x2a6b33){utils[_0x698a('0x13')](util[_0x698a('0x17')]('[%s][index][hangup]',_0x52a7c6['uniqueid']),_0x2a6b33);}});ami['on'](_0x698a('0x31'),function(_0x355748){try{utils[_0x698a('0x16')](util[_0x698a('0x17')](_0x698a('0x32'),_0x355748['uniqueid']),_0x355748);members['cdr'](_0x355748);}catch(_0x31ba62){utils[_0x698a('0x13')](util[_0x698a('0x17')](_0x698a('0x32'),_0x355748[_0x698a('0x1c')]),_0x31ba62);}});ami['on'](_0x698a('0x33'),function(_0x42340c){try{utils[_0x698a('0x16')](util[_0x698a('0x17')](_0x698a('0x34'),_0x42340c['uniqueid']),_0x42340c);queues[_0x698a('0x33')](_0x42340c);agents['blindtransfer'](_0x42340c);transfers[_0x698a('0x33')](_0x42340c);}catch(_0x399a89){utils['error'](util['format'](_0x698a('0x34'),_0x42340c[_0x698a('0x1c')]),_0x399a89);}});ami['on']('attendedtransfer',function(_0x82ab1f){try{utils[_0x698a('0x16')](util[_0x698a('0x17')](_0x698a('0x35'),_0x82ab1f[_0x698a('0x36')]),_0x82ab1f);queues['attendedtransfer'](_0x82ab1f);transfers[_0x698a('0x37')](_0x82ab1f);agents[_0x698a('0x37')](_0x82ab1f);calls['attendedtransfer'](_0x82ab1f);}catch(_0x46ae16){utils['error'](util[_0x698a('0x17')](_0x698a('0x35'),_0x82ab1f[_0x698a('0x36')]),_0x46ae16);}});ami['on'](_0x698a('0x38'),function(_0x350e10){try{utils[_0x698a('0x16')](util[_0x698a('0x17')](_0x698a('0x39'),_0x350e10['uniqueid']),_0x350e10);queues['varset'](_0x350e10);recordings[_0x698a('0x38')](_0x350e10);calls[_0x698a('0x38')](_0x350e10);dials[_0x698a('0x38')](_0x350e10);}catch(_0x576bab){utils[_0x698a('0x13')](util[_0x698a('0x17')](_0x698a('0x39'),_0x350e10[_0x698a('0x1c')]),_0x576bab);}});ami['on'](_0x698a('0x3a'),function(_0x3ad12e){try{utils[_0x698a('0x16')](util[_0x698a('0x17')](_0x698a('0x3b'),_0x3ad12e[_0x698a('0x1c')]),_0x3ad12e);calls[_0x698a('0x3a')](_0x3ad12e);recordings[_0x698a('0x3a')](_0x3ad12e);dials[_0x698a('0x3a')](_0x3ad12e);}catch(_0x3af423){utils[_0x698a('0x13')](util[_0x698a('0x17')](_0x698a('0x3b'),_0x3ad12e['uniqueid']),_0x3af423);}});ami['on'](_0x698a('0x3c'),function(_0x727909){try{utils['debug'](util[_0x698a('0x17')](_0x698a('0x3d'),_0x727909[_0x698a('0x1c')]),_0x727909);calls[_0x698a('0x3c')](_0x727909);recordings[_0x698a('0x3c')](_0x727909);}catch(_0x393cea){utils[_0x698a('0x13')](util['format'](_0x698a('0x3d'),_0x727909[_0x698a('0x1c')]),_0x393cea);}});ami['on']('dialbegin',function(_0x40ad23){try{utils['debug'](util[_0x698a('0x17')](_0x698a('0x3e'),_0x40ad23[_0x698a('0x1c')]),_0x40ad23);dials[_0x698a('0x3f')](_0x40ad23);}catch(_0x381bb7){utils[_0x698a('0x13')](util[_0x698a('0x17')](_0x698a('0x40'),_0x40ad23[_0x698a('0x1c')]),_0x381bb7);}});ami['on'](_0x698a('0x41'),function(_0x299c3e){try{utils[_0x698a('0x16')](util[_0x698a('0x17')](_0x698a('0x42'),_0x299c3e[_0x698a('0x1c')]),_0x299c3e);dials[_0x698a('0x41')](_0x299c3e);}catch(_0x174bfe){utils[_0x698a('0x13')](util[_0x698a('0x17')](_0x698a('0x42'),_0x299c3e[_0x698a('0x1c')]),_0x174bfe);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 3b7623e..9d398d7 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 _0x3738=['[%s][members][cdr]','split','destination','data1','data3','destinationchannel','source','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','type','getUserByInterface','then','membername','name','internal','request','CreateMemberReport','getUserByName','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','voice','TALKING','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign'];(function(_0x733333,_0x45f819){var _0x37119b=function(_0xf854a5){while(--_0xf854a5){_0x733333['push'](_0x733333['shift']());}};_0x37119b(++_0x45f819);}(_0x3738,0x1e5));var _0x8373=function(_0x438297,_0x217934){_0x438297=_0x438297-0x0;var _0x51fceb=_0x3738[_0x438297];return _0x51fceb;};'use strict';var _=require('lodash');var util=require(_0x8373('0x0'));var utils=require(_0x8373('0x1'));var members={};var exclude=[_0x8373('0x2'),_0x8373('0x3')];function writeDB(_0x3a4eaa){utils[_0x8373('0x4')](util[_0x8373('0x5')](_0x8373('0x6'),_0x3a4eaa[_0x8373('0x7')],_0x3a4eaa[_0x8373('0x8')],_0x3a4eaa[_0x8373('0x9')],_0x3a4eaa[_0x8373('0xa')],_0x3a4eaa['membername'],_0x3a4eaa[_0x8373('0xb')]));if(_0x3a4eaa[_0x8373('0x8')]){utils[_0x8373('0xc')](_0x3a4eaa[_0x8373('0x8')])[_0x8373('0xd')](function(_0x58a663){if(_0x58a663){_0x3a4eaa[_0x8373('0xe')]=_0x58a663[_0x8373('0xf')];_0x3a4eaa[_0x8373('0x10')]=_0x58a663[_0x8373('0x10')];utils[_0x8373('0x11')](_0x8373('0x12'),_0x3a4eaa);}else{utils[_0x8373('0x13')](_0x3a4eaa[_0x8373('0x8')]['split']('/')[0x1])[_0x8373('0xd')](function(_0x5397d3){if(_0x5397d3){_0x3a4eaa[_0x8373('0xe')]=_0x5397d3['name'];_0x3a4eaa[_0x8373('0x10')]=_0x5397d3[_0x8373('0x10')];utils['request'](_0x8373('0x12'),_0x3a4eaa);}});}})[_0x8373('0x14')](function(_0x3b1be6){utils[_0x8373('0x15')](util['format'](_0x8373('0x16'),_0x3a4eaa[_0x8373('0x7')]),_0x3b1be6);});}delete members[_0x3a4eaa[_0x8373('0x8')]];}function startsWith(_0x5945e9,_0x23f545){return _[_0x8373('0x17')](_0x5945e9,function(_0x3613ed){return _[_0x8373('0x18')](_0x23f545,_0x3613ed);});}exports[_0x8373('0x19')]=function(_0x4eab2f){try{utils[_0x8373('0x1a')](util[_0x8373('0x5')](_0x8373('0x1b'),members[_0x4eab2f[_0x8373('0x1c')]]?members[_0x4eab2f['device']]['uniqueid']:_0x4eab2f[_0x8373('0x1c')]),_0x4eab2f);utils['info'](util[_0x8373('0x5')](_0x8373('0x1d'),members[_0x4eab2f[_0x8373('0x1c')]]?members[_0x4eab2f[_0x8373('0x1c')]]['uniqueid']:_0x4eab2f[_0x8373('0x1c')],_0x4eab2f[_0x8373('0x1e')],_0x4eab2f[_0x8373('0x1c')]));switch(_0x4eab2f[_0x8373('0x1e')]){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x4eab2f[_0x8373('0x1c')])){members[_0x4eab2f['device']]={'channel':_0x8373('0x1f'),'interface':_0x4eab2f[_0x8373('0x1c')],'type':_0x8373('0x20'),'enterAt':utils[_0x8373('0x21')](),'role':'agent'};}break;case _0x8373('0x22'):if(!_[_0x8373('0x23')](members[_0x4eab2f[_0x8373('0x1c')]])){members[_0x4eab2f[_0x8373('0x1c')]][_0x8373('0x24')]=utils[_0x8373('0x21')]();members[_0x4eab2f[_0x8373('0x1c')]][_0x8373('0x25')]=utils[_0x8373('0x26')](members[_0x4eab2f[_0x8373('0x1c')]]['exitAt'],members[_0x4eab2f[_0x8373('0x1c')]][_0x8373('0x27')]);if(members[_0x4eab2f[_0x8373('0x1c')]][_0x8373('0x7')]){writeDB(members[_0x4eab2f[_0x8373('0x1c')]]);}}break;default:break;}}catch(_0x27858f){utils['error'](util[_0x8373('0x5')](_0x8373('0x1b'),members[_0x4eab2f['device']]?members[_0x4eab2f[_0x8373('0x1c')]][_0x8373('0x7')]:_0x4eab2f[_0x8373('0x1c')]),_0x27858f);}};exports[_0x8373('0x28')]=function(_0xdf741b){try{if(!_[_0x8373('0x23')](members[_0xdf741b[_0x8373('0x8')]])){utils[_0x8373('0x1a')](util[_0x8373('0x5')](_0x8373('0x29'),_0xdf741b[_0x8373('0x7')]),_0xdf741b);utils['info'](util[_0x8373('0x5')](_0x8373('0x2a'),_0xdf741b[_0x8373('0x7')],_0xdf741b['interface'],_0xdf741b[_0x8373('0x2b')]));members[_0xdf741b[_0x8373('0x8')]]=_[_0x8373('0x2c')](members[_0xdf741b['interface']],{'data4':_0xdf741b[_0x8373('0x2b')],'uniqueid':_0xdf741b[_0x8373('0x7')]});}}catch(_0x143453){utils[_0x8373('0x15')](util[_0x8373('0x5')](_0x8373('0x29'),_0xdf741b[_0x8373('0x7')]),_0x143453);}};exports['cdr']=function(_0x3f28c0){try{utils[_0x8373('0x1a')](util['format'](_0x8373('0x2d'),_0x3f28c0['uniqueid']),_0x3f28c0);if(_0x3f28c0[_0x8373('0x9')]){var _0x7d8d16=_0x3f28c0[_0x8373('0x9')][_0x8373('0x2e')]('-')[0x0];if(!_[_0x8373('0x23')](members[_0x7d8d16])){members[_0x7d8d16]=_[_0x8373('0x2c')](members[_0x7d8d16],{'data1':members[_0x7d8d16]['data1']||_0x3f28c0['type'],'data2':members[_0x7d8d16][_0x8373('0xa')]||_0x3f28c0['source'],'data3':members[_0x7d8d16]['data3']||_0x3f28c0[_0x8373('0x2f')],'uniqueid':members[_0x7d8d16][_0x8373('0x7')]||_0x3f28c0[_0x8373('0x7')]});utils[_0x8373('0x4')](util[_0x8373('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x3f28c0['uniqueid'],members[_0x7d8d16][_0x8373('0x30')],members[_0x7d8d16][_0x8373('0xa')],members[_0x7d8d16][_0x8373('0x31')]));if(members[_0x7d8d16]['exitAt']){writeDB(members[_0x7d8d16]);}}}if(_0x3f28c0[_0x8373('0x32')]){var _0xcb920b=_0x3f28c0['destinationchannel']['split']('-')[0x0];if(!_['isNil'](members[_0xcb920b])){members[_0xcb920b]=_[_0x8373('0x2c')](members[_0xcb920b],{'data1':members[_0xcb920b][_0x8373('0x30')]||_0x3f28c0[_0x8373('0xb')],'data2':members[_0xcb920b]['data2']||_0x3f28c0[_0x8373('0x33')],'data3':members[_0xcb920b][_0x8373('0x31')]||_0x3f28c0[_0x8373('0x2f')],'uniqueid':members[_0xcb920b][_0x8373('0x7')]||_0x3f28c0[_0x8373('0x7')]});utils[_0x8373('0x4')](util[_0x8373('0x5')](_0x8373('0x34'),_0x3f28c0['uniqueid'],members[_0xcb920b]['data1'],members[_0xcb920b][_0x8373('0xa')],members[_0xcb920b][_0x8373('0x31')]));if(members[_0xcb920b]['exitAt']){writeDB(members[_0xcb920b]);}}}}catch(_0x32518c){utils[_0x8373('0x15')](util[_0x8373('0x5')](_0x8373('0x2d'),_0x3f28c0[_0x8373('0x7')]),_0x32518c);}}; \ No newline at end of file +var _0x69d5=['split','then','catch','error','format','some','devicestatechange','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','now','isNil','duration','diffTime','exitAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','assign','data1','type','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','[%s][members][cdr]','lodash','util','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','getUserByInterface','name','internal','request','CreateMemberReport'];(function(_0x4b300d,_0xd50c9f){var _0x11e5c3=function(_0x4ba48f){while(--_0x4ba48f){_0x4b300d['push'](_0x4b300d['shift']());}};_0x11e5c3(++_0xd50c9f);}(_0x69d5,0x18e));var _0x569d=function(_0x2a506a,_0x2e86ce){_0x2a506a=_0x2a506a-0x0;var _0x31cc00=_0x69d5[_0x2a506a];return _0x31cc00;};'use strict';var _=require(_0x569d('0x0'));var util=require(_0x569d('0x1'));var utils=require('./utils');var members={};var exclude=[_0x569d('0x2'),_0x569d('0x3')];function writeDB(_0x59d647){utils[_0x569d('0x4')](util['format'](_0x569d('0x5'),_0x59d647[_0x569d('0x6')],_0x59d647[_0x569d('0x7')],_0x59d647[_0x569d('0x8')],_0x59d647[_0x569d('0x9')],_0x59d647[_0x569d('0xa')],_0x59d647['type']));if(_0x59d647['interface']){utils[_0x569d('0xb')](_0x59d647[_0x569d('0x7')])['then'](function(_0x5502a1){if(_0x5502a1){_0x59d647[_0x569d('0xa')]=_0x5502a1[_0x569d('0xc')];_0x59d647[_0x569d('0xd')]=_0x5502a1[_0x569d('0xd')];utils[_0x569d('0xe')](_0x569d('0xf'),_0x59d647);}else{utils['getUserByName'](_0x59d647[_0x569d('0x7')][_0x569d('0x10')]('/')[0x1])[_0x569d('0x11')](function(_0x15a204){if(_0x15a204){_0x59d647['membername']=_0x15a204['name'];_0x59d647[_0x569d('0xd')]=_0x15a204[_0x569d('0xd')];utils[_0x569d('0xe')](_0x569d('0xf'),_0x59d647);}});}})[_0x569d('0x12')](function(_0x2503de){utils[_0x569d('0x13')](util[_0x569d('0x14')]('[%s][members][writeDB]',_0x59d647[_0x569d('0x6')]),_0x2503de);});}delete members[_0x59d647[_0x569d('0x7')]];}function startsWith(_0x407113,_0x43e60e){return _[_0x569d('0x15')](_0x407113,function(_0x5e30b3){return _['startsWith'](_0x43e60e,_0x5e30b3);});}exports[_0x569d('0x16')]=function(_0x42ab46){try{utils[_0x569d('0x17')](util['format'](_0x569d('0x18'),members[_0x42ab46[_0x569d('0x19')]]?members[_0x42ab46['device']][_0x569d('0x6')]:_0x42ab46[_0x569d('0x19')]),_0x42ab46);utils['info'](util[_0x569d('0x14')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x42ab46[_0x569d('0x19')]]?members[_0x42ab46[_0x569d('0x19')]][_0x569d('0x6')]:_0x42ab46[_0x569d('0x19')],_0x42ab46['state'],_0x42ab46[_0x569d('0x19')]));switch(_0x42ab46[_0x569d('0x1a')]){case _0x569d('0x1b'):case _0x569d('0x1c'):if(!startsWith(exclude,_0x42ab46[_0x569d('0x19')])){members[_0x42ab46[_0x569d('0x19')]]={'channel':'voice','interface':_0x42ab46[_0x569d('0x19')],'type':'TALKING','enterAt':utils[_0x569d('0x1d')](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0x569d('0x1e')](members[_0x42ab46[_0x569d('0x19')]])){members[_0x42ab46[_0x569d('0x19')]]['exitAt']=utils[_0x569d('0x1d')]();members[_0x42ab46[_0x569d('0x19')]][_0x569d('0x1f')]=utils[_0x569d('0x20')](members[_0x42ab46[_0x569d('0x19')]][_0x569d('0x21')],members[_0x42ab46['device']]['enterAt']);if(members[_0x42ab46[_0x569d('0x19')]]['uniqueid']){writeDB(members[_0x42ab46[_0x569d('0x19')]]);}}break;default:break;}}catch(_0x5e3f5f){utils[_0x569d('0x13')](util[_0x569d('0x14')](_0x569d('0x18'),members[_0x42ab46[_0x569d('0x19')]]?members[_0x42ab46[_0x569d('0x19')]][_0x569d('0x6')]:_0x42ab46['device']),_0x5e3f5f);}};exports['agentcomplete']=function(_0x30d202){try{if(!_[_0x569d('0x1e')](members[_0x30d202[_0x569d('0x7')]])){utils[_0x569d('0x17')](util[_0x569d('0x14')](_0x569d('0x22'),_0x30d202[_0x569d('0x6')]),_0x30d202);utils['info'](util[_0x569d('0x14')](_0x569d('0x23'),_0x30d202[_0x569d('0x6')],_0x30d202['interface'],_0x30d202[_0x569d('0x24')]));members[_0x30d202[_0x569d('0x7')]]=_['assign'](members[_0x30d202[_0x569d('0x7')]],{'data4':_0x30d202[_0x569d('0x24')],'uniqueid':_0x30d202[_0x569d('0x6')]});}}catch(_0x4f9538){utils[_0x569d('0x13')](util['format'](_0x569d('0x22'),_0x30d202[_0x569d('0x6')]),_0x4f9538);}};exports[_0x569d('0x25')]=function(_0x5b4cdf){try{utils['debug'](util[_0x569d('0x14')]('[%s][members][cdr]',_0x5b4cdf[_0x569d('0x6')]),_0x5b4cdf);if(_0x5b4cdf[_0x569d('0x8')]){var _0x174657=_0x5b4cdf['channel'][_0x569d('0x10')]('-')[0x0];if(!_[_0x569d('0x1e')](members[_0x174657])){members[_0x174657]=_[_0x569d('0x26')](members[_0x174657],{'data1':members[_0x174657][_0x569d('0x27')]||_0x5b4cdf[_0x569d('0x28')],'data2':members[_0x174657][_0x569d('0x9')]||_0x5b4cdf['source'],'data3':members[_0x174657]['data3']||_0x5b4cdf[_0x569d('0x29')],'uniqueid':members[_0x174657]['uniqueid']||_0x5b4cdf[_0x569d('0x6')]});utils[_0x569d('0x4')](util[_0x569d('0x14')](_0x569d('0x2a'),_0x5b4cdf[_0x569d('0x6')],members[_0x174657][_0x569d('0x27')],members[_0x174657][_0x569d('0x9')],members[_0x174657][_0x569d('0x2b')]));if(members[_0x174657][_0x569d('0x21')]){writeDB(members[_0x174657]);}}}if(_0x5b4cdf[_0x569d('0x2c')]){var _0x2da59d=_0x5b4cdf['destinationchannel'][_0x569d('0x10')]('-')[0x0];if(!_[_0x569d('0x1e')](members[_0x2da59d])){members[_0x2da59d]=_['assign'](members[_0x2da59d],{'data1':members[_0x2da59d][_0x569d('0x27')]||_0x5b4cdf[_0x569d('0x28')],'data2':members[_0x2da59d][_0x569d('0x9')]||_0x5b4cdf['source'],'data3':members[_0x2da59d][_0x569d('0x2b')]||_0x5b4cdf[_0x569d('0x29')],'uniqueid':members[_0x2da59d][_0x569d('0x6')]||_0x5b4cdf[_0x569d('0x6')]});utils[_0x569d('0x4')](util[_0x569d('0x14')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x5b4cdf[_0x569d('0x6')],members[_0x2da59d]['data1'],members[_0x2da59d][_0x569d('0x9')],members[_0x2da59d]['data3']));if(members[_0x2da59d][_0x569d('0x21')]){writeDB(members[_0x2da59d]);}}}}catch(_0x59e2f8){utils[_0x569d('0x13')](util[_0x569d('0x14')](_0x569d('0x2d'),_0x5b4cdf[_0x569d('0x6')]),_0x59e2f8);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 36c1796..5042244 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 _0x1305=['[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','origtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','clone','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','uniqueid','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','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','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','queuecallercomplete','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid'];(function(_0x5f12c1,_0x17c8ae){var _0x424644=function(_0x5cbc96){while(--_0x5cbc96){_0x5f12c1['push'](_0x5f12c1['shift']());}};_0x424644(++_0x17c8ae);}(_0x1305,0x1b6));var _0x5130=function(_0x4336cc,_0x27ec98){_0x4336cc=_0x4336cc-0x0;var _0x5da213=_0x1305[_0x4336cc];return _0x5da213;};'use strict';var _=require(_0x5130('0x0'));var util=require('util');var utils=require(_0x5130('0x1'));var queues={};function writeDB(_0x5c8dc7){utils[_0x5130('0x2')](util[_0x5130('0x3')](_0x5130('0x4'),_0x5c8dc7['uniqueid'],_0x5c8dc7['channel'],_0x5c8dc7[_0x5130('0x5')],_0x5c8dc7[_0x5130('0x6')],_0x5c8dc7[_0x5130('0x7')],_0x5c8dc7[_0x5130('0x8')],_0x5c8dc7[_0x5130('0x9')]));if(_0x5c8dc7['queue']){utils[_0x5130('0xa')](_0x5c8dc7[_0x5130('0x5')])['then'](function(_0x2bdbea){if(_0x2bdbea){_0x5c8dc7['type']=_0x2bdbea[_0x5130('0xb')];}utils[_0x5130('0xc')](_0x5130('0xd'),_0x5c8dc7);});}else{utils[_0x5130('0xc')]('CreateVoiceQueueReport',_0x5c8dc7);}if(_0x5c8dc7['transfereduniqueid']){delete queues[_0x5c8dc7[_0x5130('0xe')]];}else{delete queues[_0x5c8dc7['uniqueid']];}}exports['queuecallerjoin']=function(_0xd106e4){try{utils[_0x5130('0xf')](util[_0x5130('0x3')](_0x5130('0x10'),_0xd106e4[_0x5130('0x11')]),_0xd106e4);utils[_0x5130('0x2')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0xd106e4[_0x5130('0x11')],_0xd106e4[_0x5130('0x5')],_0xd106e4[_0x5130('0x12')]));queues[_0xd106e4['uniqueid']]=_[_0x5130('0x13')](_0xd106e4,{'originalposition':_0xd106e4[_0x5130('0x12')],'queuecallerjoinAt':utils[_0x5130('0x14')](),'mohtime':0x0});}catch(_0x55838a){utils[_0x5130('0x15')](util['format'](_0x5130('0x10'),_0xd106e4[_0x5130('0x11')]),_0x55838a);}};exports[_0x5130('0x16')]=function(_0xa3e242){try{if(!_[_0x5130('0x17')](queues[_0xa3e242['uniqueid']])){utils[_0x5130('0xf')](util[_0x5130('0x3')](_0x5130('0x18'),_0xa3e242[_0x5130('0x11')]),_0xa3e242);if(queues[_0xa3e242[_0x5130('0x11')]][_0x5130('0x19')]){if(!queues[_0xa3e242[_0x5130('0x11')]]['queuecallerabandon']&&!queues[_0xa3e242[_0x5130('0x11')]][_0x5130('0x1a')]){queues[_0xa3e242[_0x5130('0x11')]]['queuecallercomplete']=!![];queues[_0xa3e242[_0x5130('0x11')]][_0x5130('0x1b')]=utils[_0x5130('0x14')]();queues[_0xa3e242[_0x5130('0x11')]][_0x5130('0x9')]=_0x5130('0x1c');}utils['info'](util[_0x5130('0x3')](_0x5130('0x1d'),_0xa3e242['uniqueid'],queues[_0xa3e242['uniqueid']][_0x5130('0x1e')],queues[_0xa3e242[_0x5130('0x11')]]['queuecallerexitreason']));writeDB(queues[_0xa3e242['uniqueid']]);}else if(queues[_0xa3e242[_0x5130('0x11')]][_0x5130('0xe')]){utils['info'](util[_0x5130('0x3')](_0x5130('0x1f'),_0xa3e242[_0x5130('0x11')],queues[_0xa3e242[_0x5130('0x11')]][_0x5130('0x1e')],queues[_0xa3e242[_0x5130('0x11')]]['transfereduniqueid']));queues[queues[_0xa3e242['uniqueid']]['transfereduniqueid']]=queues[_0xa3e242[_0x5130('0x11')]];queues[queues[_0xa3e242[_0x5130('0x11')]]['transfereduniqueid']][_0x5130('0x20')]=0x2;delete queues[_0xa3e242[_0x5130('0x11')]];}}}catch(_0xf1f0b0){utils['error'](util[_0x5130('0x3')](_0x5130('0x18'),_0xa3e242[_0x5130('0x11')]),_0xf1f0b0);}};exports[_0x5130('0x21')]=function(_0x5a1141){try{utils['debug'](util[_0x5130('0x3')](_0x5130('0x22'),_0x5a1141[_0x5130('0x11')]),_0x5a1141);if(!_[_0x5130('0x17')](_0x5a1141[_0x5130('0x23')][_0x5130('0x24')])&&_0x5a1141[_0x5130('0x25')][_0x5130('0x26')]()!==_0x5130('0x27')){if(!_[_0x5130('0x17')](queues[_0x5a1141[_0x5130('0x11')]])){queues[_0x5a1141[_0x5130('0x11')]][_0x5130('0x28')]=![];queues[_0x5a1141['uniqueid']][_0x5130('0x29')]=null;queues[_0x5a1141['uniqueid']]['queuecallerexit']=!![];queues[_0x5a1141[_0x5130('0x11')]][_0x5130('0x2a')]=utils[_0x5130('0x14')]();queues[_0x5a1141[_0x5130('0x11')]][_0x5130('0x9')]=_0x5a1141[_0x5130('0x25')][_0x5130('0x26')]();utils['info'](util[_0x5130('0x3')](_0x5130('0x2b'),_0x5a1141[_0x5130('0x11')],queues[_0x5a1141[_0x5130('0x11')]]['name'],_0x5a1141[_0x5130('0x25')],queues[_0x5a1141['uniqueid']][_0x5130('0x9')]));writeDB(queues[_0x5a1141[_0x5130('0x11')]]);}}else if(!_[_0x5130('0x17')](_0x5a1141[_0x5130('0x23')]['queueposition'])){if(!_['isNil'](queues[_0x5a1141[_0x5130('0x11')]])&&!queues[_0x5a1141[_0x5130('0x11')]][_0x5130('0x28')]){queues[_0x5a1141[_0x5130('0x11')]][_0x5130('0x28')]=![];queues[_0x5a1141['uniqueid']]['queuecallerabandonAt']=null;queues[_0x5a1141[_0x5130('0x11')]]['queuecallerexit']=!![];queues[_0x5a1141['uniqueid']][_0x5130('0x2a')]=utils[_0x5130('0x14')]();queues[_0x5a1141[_0x5130('0x11')]][_0x5130('0x9')]=_0x5130('0x2c');utils[_0x5130('0x2')](util[_0x5130('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x5a1141[_0x5130('0x11')],queues[_0x5a1141[_0x5130('0x11')]][_0x5130('0x1e')],_0x5a1141[_0x5130('0x25')],queues[_0x5a1141['uniqueid']][_0x5130('0x9')]));}}}catch(_0x18e51e){utils['error'](util[_0x5130('0x3')]('[%s][queues][varset]',_0x5a1141[_0x5130('0x11')]),_0x18e51e);}};exports[_0x5130('0x28')]=function(_0x124a45){try{if(!_[_0x5130('0x17')](queues[_0x124a45[_0x5130('0x11')]])){utils[_0x5130('0xf')](util[_0x5130('0x3')](_0x5130('0x2d'),_0x124a45['uniqueid']),_0x124a45);queues[_0x124a45[_0x5130('0x11')]]['queuecallerexit']=![];queues[_0x124a45[_0x5130('0x11')]][_0x5130('0x2a')]=null;queues[_0x124a45['uniqueid']][_0x5130('0x28')]=!![];queues[_0x124a45[_0x5130('0x11')]][_0x5130('0x29')]=utils[_0x5130('0x14')]();queues[_0x124a45[_0x5130('0x11')]]['queuecallerexitreason']=_0x5130('0x2e');utils[_0x5130('0x2')](util[_0x5130('0x3')](_0x5130('0x2f'),_0x124a45[_0x5130('0x11')],queues[_0x124a45[_0x5130('0x11')]]['name'],queues[_0x124a45[_0x5130('0x11')]][_0x5130('0x9')]));}}catch(_0x1e0e5c){utils[_0x5130('0x15')](util[_0x5130('0x3')]('[%s][queues][queuecallerabandon]',_0x124a45[_0x5130('0x11')]),_0x1e0e5c);}};exports['queuecallerleave']=function(_0x571417){try{if(!_[_0x5130('0x17')](queues[_0x571417[_0x5130('0x11')]])){utils[_0x5130('0xf')](util[_0x5130('0x3')](_0x5130('0x30'),_0x571417[_0x5130('0x11')]),_0x571417);utils[_0x5130('0x2')](util[_0x5130('0x3')](_0x5130('0x31'),_0x571417[_0x5130('0x11')],queues[_0x571417[_0x5130('0x11')]]['name'],_0x571417[_0x5130('0x32')],_0x571417[_0x5130('0x33')]));queues[_0x571417['uniqueid']][_0x5130('0x34')]=!![];queues[_0x571417['uniqueid']][_0x5130('0x19')]=utils[_0x5130('0x14')]();queues[_0x571417['uniqueid']][_0x5130('0x35')]=utils[_0x5130('0x36')](queues[_0x571417[_0x5130('0x11')]][_0x5130('0x19')],queues[_0x571417['uniqueid']][_0x5130('0x37')]);queues[_0x571417['uniqueid']][_0x5130('0x12')]=_0x571417['position'];queues[_0x571417[_0x5130('0x11')]][_0x5130('0x38')]=_0x571417[_0x5130('0x38')];queues[_0x571417[_0x5130('0x11')]][_0x5130('0x32')]=_0x571417[_0x5130('0x32')];queues[_0x571417['uniqueid']][_0x5130('0x33')]=_0x571417['connectedlinename'];}}catch(_0x30d285){utils[_0x5130('0x15')](util[_0x5130('0x3')](_0x5130('0x30'),_0x571417[_0x5130('0x11')]),_0x30d285);}};exports[_0x5130('0x39')]=function(_0x58f2ec){try{if(!_[_0x5130('0x17')](queues[_0x58f2ec[_0x5130('0x11')]])){utils['debug'](util[_0x5130('0x3')](_0x5130('0x3a'),_0x58f2ec['uniqueid']),_0x58f2ec);utils[_0x5130('0x2')](util[_0x5130('0x3')](_0x5130('0x3b'),_0x58f2ec['uniqueid'],queues[_0x58f2ec[_0x5130('0x11')]][_0x5130('0x1e')],_0x58f2ec[_0x5130('0x3c')],_0x58f2ec[_0x5130('0x3d')]));queues[_0x58f2ec[_0x5130('0x11')]][_0x5130('0x28')]=![];queues[_0x58f2ec[_0x5130('0x11')]][_0x5130('0x28')]=![];queues[_0x58f2ec[_0x5130('0x11')]][_0x5130('0x29')]=null;queues[_0x58f2ec[_0x5130('0x11')]][_0x5130('0x1a')]=![];queues[_0x58f2ec[_0x5130('0x11')]][_0x5130('0x9')]=null;queues[_0x58f2ec[_0x5130('0x11')]][_0x5130('0x2a')]=null;queues[_0x58f2ec[_0x5130('0x11')]][_0x5130('0x3e')]=!![];queues[_0x58f2ec[_0x5130('0x11')]][_0x5130('0x8')]=_0x58f2ec[_0x5130('0x3d')];queues[_0x58f2ec[_0x5130('0x11')]][_0x5130('0x6')]=_0x58f2ec['membername'];}}catch(_0xfa8fee){utils[_0x5130('0x15')](util[_0x5130('0x3')](_0x5130('0x3a'),_0x58f2ec[_0x5130('0x11')]),_0xfa8fee);}};exports[_0x5130('0x3f')]=function(_0x6e7fbe){try{if(!_[_0x5130('0x17')](queues[_0x6e7fbe['uniqueid']])){if(queues[_0x6e7fbe['uniqueid']][_0x5130('0x19')]){utils[_0x5130('0xf')](util[_0x5130('0x3')]('[%s][queues][agentcomplete]',_0x6e7fbe[_0x5130('0x11')]),_0x6e7fbe);queues[_0x6e7fbe[_0x5130('0x11')]][_0x5130('0x28')]=![];queues[_0x6e7fbe[_0x5130('0x11')]][_0x5130('0x28')]=![];queues[_0x6e7fbe[_0x5130('0x11')]][_0x5130('0x29')]=null;queues[_0x6e7fbe['uniqueid']][_0x5130('0x1a')]=![];queues[_0x6e7fbe['uniqueid']]['queuecallerexitAt']=null;queues[_0x6e7fbe[_0x5130('0x11')]][_0x5130('0x3e')]=!![];queues[_0x6e7fbe[_0x5130('0x11')]][_0x5130('0x6')]=_0x6e7fbe[_0x5130('0x3c')];queues[_0x6e7fbe[_0x5130('0x11')]][_0x5130('0x40')]=!![];queues[_0x6e7fbe[_0x5130('0x11')]]['queuecallercompleteAt']=utils[_0x5130('0x14')]();if(_0x6e7fbe[_0x5130('0x41')]=='transfer'){if(!queues[_0x6e7fbe[_0x5130('0x11')]][_0x5130('0x42')]){queues[_0x6e7fbe[_0x5130('0x11')]]['queuecallerexitreason']=_0x5130('0x43');}}else{queues[_0x6e7fbe[_0x5130('0x11')]][_0x5130('0x9')]='COMPLETEDBY'+_0x6e7fbe[_0x5130('0x41')][_0x5130('0x26')]();}utils[_0x5130('0x2')](util['format'](_0x5130('0x44'),_0x6e7fbe['uniqueid'],queues[_0x6e7fbe[_0x5130('0x11')]][_0x5130('0x1e')],_0x6e7fbe[_0x5130('0x3c')],queues[_0x6e7fbe[_0x5130('0x11')]][_0x5130('0x9')]));writeDB(queues[_0x6e7fbe['uniqueid']]);}}}catch(_0x3e1c52){utils[_0x5130('0x15')](util[_0x5130('0x3')](_0x5130('0x45'),_0x6e7fbe[_0x5130('0x11')]),_0x3e1c52);}};exports[_0x5130('0x46')]=function(_0x29bc94){try{if(!_[_0x5130('0x17')](queues[_0x29bc94[_0x5130('0x47')]])){utils[_0x5130('0xf')](util[_0x5130('0x3')](_0x5130('0x48'),_0x29bc94[_0x5130('0x11')]),_0x29bc94);queues[_0x29bc94['transfereeuniqueid']][_0x5130('0x42')]=!![];queues[_0x29bc94[_0x5130('0x47')]][_0x5130('0x49')]=_0x5130('0x4a');queues[_0x29bc94[_0x5130('0x47')]][_0x5130('0x4b')]=_0x29bc94['extension'];queues[_0x29bc94[_0x5130('0x47')]][_0x5130('0x4c')]=_0x29bc94[_0x5130('0x47')];queues[_0x29bc94[_0x5130('0x47')]][_0x5130('0x9')]=_0x5130('0x4d');utils[_0x5130('0x2')](util[_0x5130('0x3')](_0x5130('0x4e'),_0x29bc94[_0x5130('0x11')],queues[_0x29bc94[_0x5130('0x47')]][_0x5130('0x1e')],_0x29bc94['transfereeuniqueid'],_0x29bc94['extension']));}}catch(_0x51e923){utils[_0x5130('0x15')](util[_0x5130('0x3')](_0x5130('0x48'),_0x29bc94[_0x5130('0x11')]),_0x51e923);}};exports['attendedtransfer']=function(_0x15341f){try{utils[_0x5130('0xf')](util[_0x5130('0x3')]('[%s][queues][attendedtransfer]',_0x15341f['origtransfereruniqueid']),_0x15341f);if(_0x15341f['origtransfereruniqueid']==_0x15341f[_0x5130('0x4f')]){if(!_[_0x5130('0x17')](queues[_0x15341f[_0x5130('0x50')]])){utils[_0x5130('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x15341f['origtransfereruniqueid'],queues[_0x15341f[_0x5130('0x50')]][_0x5130('0x1e')],_0x15341f['origtransfererexten']));queues[_0x15341f[_0x5130('0x50')]][_0x5130('0x42')]=!![];queues[_0x15341f[_0x5130('0x50')]][_0x5130('0x49')]=_0x5130('0x51');queues[_0x15341f[_0x5130('0x50')]][_0x5130('0x4b')]=_0x15341f[_0x5130('0x52')];queues[_0x15341f[_0x5130('0x50')]][_0x5130('0x4c')]=_0x15341f['origtransfereruniqueid'];queues[_0x15341f[_0x5130('0x50')]][_0x5130('0x9')]=_0x5130('0x53');}if(!_['isNil'](queues[_0x15341f[_0x5130('0x4f')]])){if(_0x15341f[_0x5130('0x54')]&&queues[_0x15341f[_0x5130('0x54')]]){queues[_0x15341f[_0x5130('0x54')]][_0x5130('0x20')]=0x1;queues[_0x15341f['transfereeuniqueid']]=_['clone'](queues[_0x15341f['transfereelinkedid']]);queues[_0x15341f['transfereeuniqueid']][_0x5130('0xe')]=_0x15341f['transfertargetuniqueid'];queues[_0x15341f[_0x5130('0x47')]][_0x5130('0x20')]=0x2;queues[_0x15341f[_0x5130('0x47')]][_0x5130('0x7')]=queues[_0x15341f['secondtransfererlinkedid']]['calleridnum'];queues[_0x15341f[_0x5130('0x47')]][_0x5130('0x55')]=queues[_0x15341f[_0x5130('0x50')]]['calleridname'];queues[_0x15341f[_0x5130('0x47')]][_0x5130('0x37')]=utils[_0x5130('0x14')]();queues[_0x15341f[_0x5130('0x47')]][_0x5130('0x19')]=utils[_0x5130('0x14')]();queues[_0x15341f[_0x5130('0x47')]][_0x5130('0x35')]=0x0;queues[_0x15341f[_0x5130('0x47')]][_0x5130('0x56')]=0x0;utils[_0x5130('0x2')](util['format'](_0x5130('0x57'),_0x15341f[_0x5130('0x58')],queues[_0x15341f['transfereeuniqueid']][_0x5130('0x1e')],queues[_0x15341f[_0x5130('0x47')]]['calleridnum'],queues[_0x15341f['transfereeuniqueid']][_0x5130('0x55')]));}else{utils[_0x5130('0x2')](util[_0x5130('0x3')](_0x5130('0x59'),_0x15341f['origtransfereruniqueid'],queues[_0x15341f[_0x5130('0x4f')]][_0x5130('0x1e')],_0x15341f[_0x5130('0x50')]));queues[_0x15341f[_0x5130('0x4f')]][_0x5130('0xe')]=_0x15341f[_0x5130('0x50')];}}}else if(_0x15341f[_0x5130('0x5a')]==_0x15341f[_0x5130('0x50')]){if(!_['isNil'](queues[_0x15341f[_0x5130('0x4f')]])){utils[_0x5130('0x2')](util[_0x5130('0x3')](_0x5130('0x5b'),_0x15341f[_0x5130('0x58')],queues[_0x15341f[_0x5130('0x4f')]]['name'],_0x15341f['secondtransfereruniqueid'],_0x15341f[_0x5130('0x5c')]));queues[_0x15341f['origtransfererlinkedid']][_0x5130('0x42')]=!![];queues[_0x15341f[_0x5130('0x4f')]][_0x5130('0x49')]='ATTENDED';queues[_0x15341f[_0x5130('0x4f')]][_0x5130('0x4b')]=_0x15341f['secondtransfererexten'];queues[_0x15341f[_0x5130('0x4f')]][_0x5130('0x4c')]=_0x15341f[_0x5130('0x5a')];queues[_0x15341f[_0x5130('0x4f')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x15341f['secondtransfererlinkedid']])){if(_0x15341f[_0x5130('0x5d')]&&queues[_0x15341f['transfertargetlinkedid']]){queues[_0x15341f[_0x5130('0x5d')]][_0x5130('0x20')]=0x1;queues[_0x15341f[_0x5130('0x5e')]]=_[_0x5130('0x5f')](queues[_0x15341f['transfertargetlinkedid']]);queues[_0x15341f['transfertargetuniqueid']]['transfereduniqueid']=_0x15341f[_0x5130('0x5e')];queues[_0x15341f['transfertargetuniqueid']][_0x5130('0x20')]=0x2;queues[_0x15341f['transfertargetuniqueid']]['calleridnum']=queues[_0x15341f[_0x5130('0x4f')]][_0x5130('0x7')];queues[_0x15341f['transfertargetuniqueid']]['calleridname']=queues[_0x15341f[_0x5130('0x4f')]][_0x5130('0x55')];queues[_0x15341f['transfertargetuniqueid']][_0x5130('0x37')]=utils['now']();queues[_0x15341f[_0x5130('0x5e')]][_0x5130('0x19')]=utils[_0x5130('0x14')]();queues[_0x15341f[_0x5130('0x5e')]][_0x5130('0x35')]=0x0;queues[_0x15341f['transfertargetuniqueid']][_0x5130('0x56')]=0x0;utils[_0x5130('0x2')](util[_0x5130('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x15341f[_0x5130('0x58')],queues[_0x15341f[_0x5130('0x5e')]]['name'],queues[_0x15341f[_0x5130('0x5e')]][_0x5130('0xe')],queues[_0x15341f['transfertargetuniqueid']]['calleridnum'],queues[_0x15341f[_0x5130('0x5e')]][_0x5130('0x55')]));}else{utils[_0x5130('0x2')](util[_0x5130('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x15341f[_0x5130('0x58')],queues[_0x15341f[_0x5130('0x50')]]['name'],_0x15341f['origtransfererlinkedid']));queues[_0x15341f[_0x5130('0x50')]][_0x5130('0xe')]=_0x15341f[_0x5130('0x4f')];}}}}catch(_0x4e0894){utils['error'](util[_0x5130('0x3')](_0x5130('0x60'),_0x15341f['origtransfereruniqueid']),_0x4e0894);}};exports[_0x5130('0x61')]=function(_0x2030a9){try{if(!_[_0x5130('0x17')](queues[_0x2030a9[_0x5130('0x11')]])){utils[_0x5130('0xf')](util[_0x5130('0x3')](_0x5130('0x62'),_0x2030a9[_0x5130('0x11')]),_0x2030a9);queues[_0x2030a9[_0x5130('0x11')]][_0x5130('0x63')]=utils[_0x5130('0x14')]();utils[_0x5130('0x2')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x2030a9[_0x5130('0x11')],queues[_0x2030a9[_0x5130('0x11')]][_0x5130('0x1e')],queues[_0x2030a9['uniqueid']][_0x5130('0x63')]));}}catch(_0x5c1479){utils[_0x5130('0x15')](util['format']('[%s][queues][musiconholdstart]',_0x2030a9[_0x5130('0x11')]),_0x5c1479);}};exports[_0x5130('0x64')]=function(_0x1248da){try{if(!_[_0x5130('0x17')](queues[_0x1248da['uniqueid']])){if(!_[_0x5130('0x17')](queues[_0x1248da['uniqueid']][_0x5130('0x63')])){utils[_0x5130('0xf')](util['format'](_0x5130('0x65'),_0x1248da[_0x5130('0x11')]),_0x1248da);queues[_0x1248da[_0x5130('0x11')]][_0x5130('0x56')]+=utils[_0x5130('0x36')](utils[_0x5130('0x14')](),queues[_0x1248da[_0x5130('0x11')]][_0x5130('0x63')]);utils['info'](util[_0x5130('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x1248da[_0x5130('0x11')],queues[_0x1248da[_0x5130('0x11')]][_0x5130('0x1e')],queues[_0x1248da[_0x5130('0x11')]][_0x5130('0x56')]));delete queues[_0x1248da[_0x5130('0x11')]]['musiconholdstartAt'];}}}catch(_0x227072){utils[_0x5130('0x15')](util[_0x5130('0x3')](_0x5130('0x65'),_0x1248da[_0x5130('0x11')]),_0x227072);}}; \ No newline at end of file +var _0xca77=['error','isNil','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','name','transfereduniqueid','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','value','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','mohtime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position'];(function(_0x19af5c,_0x2a00c0){var _0x3a9696=function(_0x1ff80b){while(--_0x1ff80b){_0x19af5c['push'](_0x19af5c['shift']());}};_0x3a9696(++_0x2a00c0);}(_0xca77,0x11f));var _0x7ca7=function(_0x4d8160,_0x3f97a4){_0x4d8160=_0x4d8160-0x0;var _0x178c13=_0xca77[_0x4d8160];return _0x178c13;};'use strict';var _=require(_0x7ca7('0x0'));var util=require(_0x7ca7('0x1'));var utils=require(_0x7ca7('0x2'));var queues={};function writeDB(_0x42fbf1){utils[_0x7ca7('0x3')](util[_0x7ca7('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x42fbf1['uniqueid'],_0x42fbf1[_0x7ca7('0x5')],_0x42fbf1['queue'],_0x42fbf1[_0x7ca7('0x6')],_0x42fbf1[_0x7ca7('0x7')],_0x42fbf1[_0x7ca7('0x8')],_0x42fbf1[_0x7ca7('0x9')]));if(_0x42fbf1[_0x7ca7('0xa')]){utils[_0x7ca7('0xb')](_0x42fbf1[_0x7ca7('0xa')])[_0x7ca7('0xc')](function(_0x4dfa71){if(_0x4dfa71){_0x42fbf1[_0x7ca7('0xd')]=_0x4dfa71[_0x7ca7('0xd')];}utils['request'](_0x7ca7('0xe'),_0x42fbf1);});}else{utils[_0x7ca7('0xf')](_0x7ca7('0xe'),_0x42fbf1);}if(_0x42fbf1['transfereduniqueid']){delete queues[_0x42fbf1['transfereduniqueid']];}else{delete queues[_0x42fbf1[_0x7ca7('0x10')]];}}exports[_0x7ca7('0x11')]=function(_0xb9e3f8){try{utils[_0x7ca7('0x12')](util['format'](_0x7ca7('0x13'),_0xb9e3f8['uniqueid']),_0xb9e3f8);utils['info'](util[_0x7ca7('0x4')](_0x7ca7('0x14'),_0xb9e3f8['uniqueid'],_0xb9e3f8[_0x7ca7('0xa')],_0xb9e3f8[_0x7ca7('0x15')]));queues[_0xb9e3f8['uniqueid']]=_['assign'](_0xb9e3f8,{'originalposition':_0xb9e3f8[_0x7ca7('0x15')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x2a2fe3){utils[_0x7ca7('0x16')](util['format']('[%s][queues][queuecallerjoin]',_0xb9e3f8[_0x7ca7('0x10')]),_0x2a2fe3);}};exports['hangup']=function(_0x332128){try{if(!_[_0x7ca7('0x17')](queues[_0x332128[_0x7ca7('0x10')]])){utils['debug'](util[_0x7ca7('0x4')]('[%s][queues][hangup]',_0x332128[_0x7ca7('0x10')]),_0x332128);if(queues[_0x332128[_0x7ca7('0x10')]][_0x7ca7('0x18')]){if(!queues[_0x332128[_0x7ca7('0x10')]][_0x7ca7('0x19')]&&!queues[_0x332128[_0x7ca7('0x10')]]['queuecallerexit']){queues[_0x332128[_0x7ca7('0x10')]][_0x7ca7('0x1a')]=!![];queues[_0x332128[_0x7ca7('0x10')]][_0x7ca7('0x1b')]=utils[_0x7ca7('0x1c')]();queues[_0x332128[_0x7ca7('0x10')]][_0x7ca7('0x9')]=_0x7ca7('0x1d');}utils[_0x7ca7('0x3')](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x332128[_0x7ca7('0x10')],queues[_0x332128[_0x7ca7('0x10')]][_0x7ca7('0x1e')],queues[_0x332128[_0x7ca7('0x10')]][_0x7ca7('0x9')]));writeDB(queues[_0x332128[_0x7ca7('0x10')]]);}else if(queues[_0x332128['uniqueid']]['transfereduniqueid']){utils[_0x7ca7('0x3')](util[_0x7ca7('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x332128[_0x7ca7('0x10')],queues[_0x332128[_0x7ca7('0x10')]][_0x7ca7('0x1e')],queues[_0x332128['uniqueid']][_0x7ca7('0x1f')]));queues[queues[_0x332128['uniqueid']][_0x7ca7('0x1f')]]=queues[_0x332128[_0x7ca7('0x10')]];queues[queues[_0x332128[_0x7ca7('0x10')]][_0x7ca7('0x1f')]][_0x7ca7('0x20')]=0x2;delete queues[_0x332128['uniqueid']];}}}catch(_0x537e94){utils[_0x7ca7('0x16')](util[_0x7ca7('0x4')]('[%s][queues][hangup]',_0x332128['uniqueid']),_0x537e94);}};exports[_0x7ca7('0x21')]=function(_0x6de56e){try{utils[_0x7ca7('0x12')](util['format'](_0x7ca7('0x22'),_0x6de56e[_0x7ca7('0x10')]),_0x6de56e);if(!_['isNil'](_0x6de56e[_0x7ca7('0x23')][_0x7ca7('0x24')])&&_0x6de56e['value']['toUpperCase']()!=='CONTINUE'){if(!_[_0x7ca7('0x17')](queues[_0x6de56e[_0x7ca7('0x10')]])){queues[_0x6de56e[_0x7ca7('0x10')]][_0x7ca7('0x19')]=![];queues[_0x6de56e[_0x7ca7('0x10')]][_0x7ca7('0x25')]=null;queues[_0x6de56e[_0x7ca7('0x10')]][_0x7ca7('0x26')]=!![];queues[_0x6de56e['uniqueid']][_0x7ca7('0x27')]=utils[_0x7ca7('0x1c')]();queues[_0x6de56e[_0x7ca7('0x10')]][_0x7ca7('0x9')]=_0x6de56e['value'][_0x7ca7('0x28')]();utils[_0x7ca7('0x3')](util[_0x7ca7('0x4')](_0x7ca7('0x29'),_0x6de56e[_0x7ca7('0x10')],queues[_0x6de56e[_0x7ca7('0x10')]][_0x7ca7('0x1e')],_0x6de56e[_0x7ca7('0x2a')],queues[_0x6de56e[_0x7ca7('0x10')]]['queuecallerexitreason']));writeDB(queues[_0x6de56e['uniqueid']]);}}else if(!_[_0x7ca7('0x17')](_0x6de56e[_0x7ca7('0x23')][_0x7ca7('0x2b')])){if(!_[_0x7ca7('0x17')](queues[_0x6de56e[_0x7ca7('0x10')]])&&!queues[_0x6de56e[_0x7ca7('0x10')]][_0x7ca7('0x19')]){queues[_0x6de56e[_0x7ca7('0x10')]][_0x7ca7('0x19')]=![];queues[_0x6de56e[_0x7ca7('0x10')]]['queuecallerabandonAt']=null;queues[_0x6de56e[_0x7ca7('0x10')]][_0x7ca7('0x26')]=!![];queues[_0x6de56e[_0x7ca7('0x10')]]['queuecallerexitAt']=utils[_0x7ca7('0x1c')]();queues[_0x6de56e['uniqueid']][_0x7ca7('0x9')]='EXITWITHKEY';utils[_0x7ca7('0x3')](util[_0x7ca7('0x4')](_0x7ca7('0x2c'),_0x6de56e[_0x7ca7('0x10')],queues[_0x6de56e['uniqueid']][_0x7ca7('0x1e')],_0x6de56e[_0x7ca7('0x2a')],queues[_0x6de56e['uniqueid']]['queuecallerexitreason']));}}}catch(_0x4f9a6e){utils[_0x7ca7('0x16')](util[_0x7ca7('0x4')](_0x7ca7('0x22'),_0x6de56e['uniqueid']),_0x4f9a6e);}};exports[_0x7ca7('0x19')]=function(_0x1cb5df){try{if(!_[_0x7ca7('0x17')](queues[_0x1cb5df[_0x7ca7('0x10')]])){utils[_0x7ca7('0x12')](util['format']('[%s][queues][queuecallerabandon]',_0x1cb5df['uniqueid']),_0x1cb5df);queues[_0x1cb5df['uniqueid']][_0x7ca7('0x26')]=![];queues[_0x1cb5df['uniqueid']][_0x7ca7('0x27')]=null;queues[_0x1cb5df[_0x7ca7('0x10')]][_0x7ca7('0x19')]=!![];queues[_0x1cb5df[_0x7ca7('0x10')]][_0x7ca7('0x25')]=utils['now']();queues[_0x1cb5df[_0x7ca7('0x10')]][_0x7ca7('0x9')]=_0x7ca7('0x2d');utils[_0x7ca7('0x3')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x1cb5df['uniqueid'],queues[_0x1cb5df[_0x7ca7('0x10')]][_0x7ca7('0x1e')],queues[_0x1cb5df[_0x7ca7('0x10')]]['queuecallerexitreason']));}}catch(_0x2f7944){utils[_0x7ca7('0x16')](util[_0x7ca7('0x4')](_0x7ca7('0x2e'),_0x1cb5df['uniqueid']),_0x2f7944);}};exports[_0x7ca7('0x2f')]=function(_0x39f1a6){try{if(!_[_0x7ca7('0x17')](queues[_0x39f1a6[_0x7ca7('0x10')]])){utils[_0x7ca7('0x12')](util[_0x7ca7('0x4')](_0x7ca7('0x30'),_0x39f1a6['uniqueid']),_0x39f1a6);utils[_0x7ca7('0x3')](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x39f1a6['uniqueid'],queues[_0x39f1a6['uniqueid']][_0x7ca7('0x1e')],_0x39f1a6[_0x7ca7('0x31')],_0x39f1a6[_0x7ca7('0x32')]));queues[_0x39f1a6['uniqueid']][_0x7ca7('0x2f')]=!![];queues[_0x39f1a6[_0x7ca7('0x10')]][_0x7ca7('0x18')]=utils[_0x7ca7('0x1c')]();queues[_0x39f1a6[_0x7ca7('0x10')]][_0x7ca7('0x33')]=utils[_0x7ca7('0x34')](queues[_0x39f1a6[_0x7ca7('0x10')]][_0x7ca7('0x18')],queues[_0x39f1a6[_0x7ca7('0x10')]]['queuecallerjoinAt']);queues[_0x39f1a6[_0x7ca7('0x10')]]['position']=_0x39f1a6[_0x7ca7('0x15')];queues[_0x39f1a6['uniqueid']]['count']=_0x39f1a6[_0x7ca7('0x35')];queues[_0x39f1a6[_0x7ca7('0x10')]][_0x7ca7('0x31')]=_0x39f1a6[_0x7ca7('0x31')];queues[_0x39f1a6[_0x7ca7('0x10')]]['connectedlinename']=_0x39f1a6['connectedlinename'];}}catch(_0x85b628){utils[_0x7ca7('0x16')](util[_0x7ca7('0x4')](_0x7ca7('0x30'),_0x39f1a6[_0x7ca7('0x10')]),_0x85b628);}};exports[_0x7ca7('0x36')]=function(_0x3a960e){try{if(!_[_0x7ca7('0x17')](queues[_0x3a960e[_0x7ca7('0x10')]])){utils['debug'](util['format'](_0x7ca7('0x37'),_0x3a960e[_0x7ca7('0x10')]),_0x3a960e);utils['info'](util[_0x7ca7('0x4')](_0x7ca7('0x38'),_0x3a960e['uniqueid'],queues[_0x3a960e[_0x7ca7('0x10')]][_0x7ca7('0x1e')],_0x3a960e[_0x7ca7('0x39')],_0x3a960e['destaccountcode']));queues[_0x3a960e['uniqueid']][_0x7ca7('0x19')]=![];queues[_0x3a960e['uniqueid']][_0x7ca7('0x19')]=![];queues[_0x3a960e['uniqueid']]['queuecallerabandonAt']=null;queues[_0x3a960e[_0x7ca7('0x10')]]['queuecallerexit']=![];queues[_0x3a960e[_0x7ca7('0x10')]][_0x7ca7('0x9')]=null;queues[_0x3a960e['uniqueid']][_0x7ca7('0x27')]=null;queues[_0x3a960e[_0x7ca7('0x10')]][_0x7ca7('0x3a')]=!![];queues[_0x3a960e[_0x7ca7('0x10')]][_0x7ca7('0x8')]=_0x3a960e['destaccountcode'];queues[_0x3a960e['uniqueid']][_0x7ca7('0x6')]=_0x3a960e[_0x7ca7('0x39')];}}catch(_0x1d331f){utils['error'](util[_0x7ca7('0x4')](_0x7ca7('0x37'),_0x3a960e[_0x7ca7('0x10')]),_0x1d331f);}};exports[_0x7ca7('0x3b')]=function(_0x317ab9){try{if(!_[_0x7ca7('0x17')](queues[_0x317ab9['uniqueid']])){if(queues[_0x317ab9[_0x7ca7('0x10')]][_0x7ca7('0x18')]){utils[_0x7ca7('0x12')](util[_0x7ca7('0x4')]('[%s][queues][agentcomplete]',_0x317ab9[_0x7ca7('0x10')]),_0x317ab9);queues[_0x317ab9['uniqueid']]['queuecallerabandon']=![];queues[_0x317ab9[_0x7ca7('0x10')]][_0x7ca7('0x19')]=![];queues[_0x317ab9[_0x7ca7('0x10')]][_0x7ca7('0x25')]=null;queues[_0x317ab9[_0x7ca7('0x10')]][_0x7ca7('0x26')]=![];queues[_0x317ab9[_0x7ca7('0x10')]]['queuecallerexitAt']=null;queues[_0x317ab9[_0x7ca7('0x10')]][_0x7ca7('0x3a')]=!![];queues[_0x317ab9['uniqueid']][_0x7ca7('0x6')]=_0x317ab9[_0x7ca7('0x39')];queues[_0x317ab9['uniqueid']]['queuecallercomplete']=!![];queues[_0x317ab9[_0x7ca7('0x10')]][_0x7ca7('0x1b')]=utils[_0x7ca7('0x1c')]();if(_0x317ab9[_0x7ca7('0x3c')]=='transfer'){if(!queues[_0x317ab9['uniqueid']][_0x7ca7('0x3d')]){queues[_0x317ab9[_0x7ca7('0x10')]][_0x7ca7('0x9')]=_0x7ca7('0x3e');}}else{queues[_0x317ab9[_0x7ca7('0x10')]][_0x7ca7('0x9')]=_0x7ca7('0x3f')+_0x317ab9['reason']['toUpperCase']();}utils[_0x7ca7('0x3')](util[_0x7ca7('0x4')](_0x7ca7('0x40'),_0x317ab9[_0x7ca7('0x10')],queues[_0x317ab9[_0x7ca7('0x10')]][_0x7ca7('0x1e')],_0x317ab9[_0x7ca7('0x39')],queues[_0x317ab9[_0x7ca7('0x10')]][_0x7ca7('0x9')]));writeDB(queues[_0x317ab9[_0x7ca7('0x10')]]);}}}catch(_0x5f1696){utils[_0x7ca7('0x16')](util['format'](_0x7ca7('0x41'),_0x317ab9[_0x7ca7('0x10')]),_0x5f1696);}};exports[_0x7ca7('0x42')]=function(_0x6b28ae){try{if(!_[_0x7ca7('0x17')](queues[_0x6b28ae[_0x7ca7('0x43')]])){utils['debug'](util['format'](_0x7ca7('0x44'),_0x6b28ae[_0x7ca7('0x10')]),_0x6b28ae);queues[_0x6b28ae[_0x7ca7('0x43')]][_0x7ca7('0x3d')]=!![];queues[_0x6b28ae[_0x7ca7('0x43')]][_0x7ca7('0x45')]=_0x7ca7('0x46');queues[_0x6b28ae[_0x7ca7('0x43')]][_0x7ca7('0x47')]=_0x6b28ae['extension'];queues[_0x6b28ae['transfereeuniqueid']][_0x7ca7('0x48')]=_0x6b28ae[_0x7ca7('0x43')];queues[_0x6b28ae['transfereeuniqueid']]['queuecallerexitreason']=_0x7ca7('0x49');utils[_0x7ca7('0x3')](util['format'](_0x7ca7('0x4a'),_0x6b28ae['uniqueid'],queues[_0x6b28ae[_0x7ca7('0x43')]][_0x7ca7('0x1e')],_0x6b28ae[_0x7ca7('0x43')],_0x6b28ae[_0x7ca7('0x4b')]));}}catch(_0x2761ff){utils[_0x7ca7('0x16')](util[_0x7ca7('0x4')](_0x7ca7('0x44'),_0x6b28ae[_0x7ca7('0x10')]),_0x2761ff);}};exports[_0x7ca7('0x4c')]=function(_0x412fb7){try{utils['debug'](util[_0x7ca7('0x4')]('[%s][queues][attendedtransfer]',_0x412fb7[_0x7ca7('0x4d')]),_0x412fb7);if(_0x412fb7['origtransfereruniqueid']==_0x412fb7[_0x7ca7('0x4e')]){if(!_[_0x7ca7('0x17')](queues[_0x412fb7[_0x7ca7('0x4f')]])){utils[_0x7ca7('0x3')](util[_0x7ca7('0x4')](_0x7ca7('0x50'),_0x412fb7['origtransfereruniqueid'],queues[_0x412fb7[_0x7ca7('0x4f')]]['name'],_0x412fb7[_0x7ca7('0x51')]));queues[_0x412fb7[_0x7ca7('0x4f')]]['transfer']=!![];queues[_0x412fb7[_0x7ca7('0x4f')]][_0x7ca7('0x45')]=_0x7ca7('0x52');queues[_0x412fb7['secondtransfererlinkedid']][_0x7ca7('0x47')]=_0x412fb7['origtransfererexten'];queues[_0x412fb7['secondtransfererlinkedid']][_0x7ca7('0x48')]=_0x412fb7[_0x7ca7('0x4d')];queues[_0x412fb7['secondtransfererlinkedid']]['queuecallerexitreason']=_0x7ca7('0x53');}if(!_[_0x7ca7('0x17')](queues[_0x412fb7['origtransfererlinkedid']])){if(_0x412fb7[_0x7ca7('0x54')]&&queues[_0x412fb7['transfereelinkedid']]){queues[_0x412fb7[_0x7ca7('0x54')]][_0x7ca7('0x20')]=0x1;queues[_0x412fb7['transfereeuniqueid']]=_['clone'](queues[_0x412fb7[_0x7ca7('0x54')]]);queues[_0x412fb7[_0x7ca7('0x43')]][_0x7ca7('0x1f')]=_0x412fb7[_0x7ca7('0x55')];queues[_0x412fb7['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x412fb7[_0x7ca7('0x43')]][_0x7ca7('0x7')]=queues[_0x412fb7[_0x7ca7('0x4f')]][_0x7ca7('0x7')];queues[_0x412fb7['transfereeuniqueid']]['calleridname']=queues[_0x412fb7[_0x7ca7('0x4f')]][_0x7ca7('0x56')];queues[_0x412fb7[_0x7ca7('0x43')]][_0x7ca7('0x57')]=utils[_0x7ca7('0x1c')]();queues[_0x412fb7[_0x7ca7('0x43')]]['queuecallerleaveAt']=utils['now']();queues[_0x412fb7['transfereeuniqueid']][_0x7ca7('0x33')]=0x0;queues[_0x412fb7[_0x7ca7('0x43')]]['mohtime']=0x0;utils['info'](util[_0x7ca7('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x412fb7[_0x7ca7('0x4d')],queues[_0x412fb7[_0x7ca7('0x43')]][_0x7ca7('0x1e')],queues[_0x412fb7[_0x7ca7('0x43')]][_0x7ca7('0x7')],queues[_0x412fb7[_0x7ca7('0x43')]][_0x7ca7('0x56')]));}else{utils[_0x7ca7('0x3')](util[_0x7ca7('0x4')](_0x7ca7('0x58'),_0x412fb7['origtransfereruniqueid'],queues[_0x412fb7[_0x7ca7('0x4e')]][_0x7ca7('0x1e')],_0x412fb7[_0x7ca7('0x4f')]));queues[_0x412fb7[_0x7ca7('0x4e')]][_0x7ca7('0x1f')]=_0x412fb7[_0x7ca7('0x4f')];}}}else if(_0x412fb7[_0x7ca7('0x59')]==_0x412fb7[_0x7ca7('0x4f')]){if(!_[_0x7ca7('0x17')](queues[_0x412fb7[_0x7ca7('0x4e')]])){utils[_0x7ca7('0x3')](util['format'](_0x7ca7('0x5a'),_0x412fb7['origtransfereruniqueid'],queues[_0x412fb7[_0x7ca7('0x4e')]][_0x7ca7('0x1e')],_0x412fb7[_0x7ca7('0x59')],_0x412fb7[_0x7ca7('0x5b')]));queues[_0x412fb7[_0x7ca7('0x4e')]][_0x7ca7('0x3d')]=!![];queues[_0x412fb7[_0x7ca7('0x4e')]][_0x7ca7('0x45')]=_0x7ca7('0x52');queues[_0x412fb7[_0x7ca7('0x4e')]]['transferexten']=_0x412fb7[_0x7ca7('0x5b')];queues[_0x412fb7[_0x7ca7('0x4e')]]['transferuniqueid']=_0x412fb7[_0x7ca7('0x59')];queues[_0x412fb7[_0x7ca7('0x4e')]][_0x7ca7('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x7ca7('0x17')](queues[_0x412fb7['secondtransfererlinkedid']])){if(_0x412fb7[_0x7ca7('0x5c')]&&queues[_0x412fb7[_0x7ca7('0x5c')]]){queues[_0x412fb7['transfertargetlinkedid']][_0x7ca7('0x20')]=0x1;queues[_0x412fb7[_0x7ca7('0x55')]]=_['clone'](queues[_0x412fb7[_0x7ca7('0x5c')]]);queues[_0x412fb7[_0x7ca7('0x55')]][_0x7ca7('0x1f')]=_0x412fb7['transfertargetuniqueid'];queues[_0x412fb7[_0x7ca7('0x55')]][_0x7ca7('0x20')]=0x2;queues[_0x412fb7[_0x7ca7('0x55')]][_0x7ca7('0x7')]=queues[_0x412fb7['origtransfererlinkedid']]['calleridnum'];queues[_0x412fb7['transfertargetuniqueid']][_0x7ca7('0x56')]=queues[_0x412fb7[_0x7ca7('0x4e')]][_0x7ca7('0x56')];queues[_0x412fb7[_0x7ca7('0x55')]][_0x7ca7('0x57')]=utils[_0x7ca7('0x1c')]();queues[_0x412fb7[_0x7ca7('0x55')]][_0x7ca7('0x18')]=utils[_0x7ca7('0x1c')]();queues[_0x412fb7[_0x7ca7('0x55')]][_0x7ca7('0x33')]=0x0;queues[_0x412fb7['transfertargetuniqueid']]['mohtime']=0x0;utils[_0x7ca7('0x3')](util[_0x7ca7('0x4')](_0x7ca7('0x5d'),_0x412fb7['origtransfereruniqueid'],queues[_0x412fb7[_0x7ca7('0x55')]][_0x7ca7('0x1e')],queues[_0x412fb7[_0x7ca7('0x55')]][_0x7ca7('0x1f')],queues[_0x412fb7['transfertargetuniqueid']][_0x7ca7('0x7')],queues[_0x412fb7[_0x7ca7('0x55')]][_0x7ca7('0x56')]));}else{utils[_0x7ca7('0x3')](util[_0x7ca7('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x412fb7['origtransfereruniqueid'],queues[_0x412fb7[_0x7ca7('0x4f')]][_0x7ca7('0x1e')],_0x412fb7[_0x7ca7('0x4e')]));queues[_0x412fb7['secondtransfererlinkedid']][_0x7ca7('0x1f')]=_0x412fb7['origtransfererlinkedid'];}}}}catch(_0x2f88d5){utils[_0x7ca7('0x16')](util[_0x7ca7('0x4')](_0x7ca7('0x5e'),_0x412fb7[_0x7ca7('0x4d')]),_0x2f88d5);}};exports[_0x7ca7('0x5f')]=function(_0x298706){try{if(!_[_0x7ca7('0x17')](queues[_0x298706[_0x7ca7('0x10')]])){utils[_0x7ca7('0x12')](util[_0x7ca7('0x4')](_0x7ca7('0x60'),_0x298706[_0x7ca7('0x10')]),_0x298706);queues[_0x298706['uniqueid']][_0x7ca7('0x61')]=utils[_0x7ca7('0x1c')]();utils[_0x7ca7('0x3')](util['format'](_0x7ca7('0x62'),_0x298706[_0x7ca7('0x10')],queues[_0x298706[_0x7ca7('0x10')]][_0x7ca7('0x1e')],queues[_0x298706[_0x7ca7('0x10')]][_0x7ca7('0x61')]));}}catch(_0x130551){utils['error'](util[_0x7ca7('0x4')](_0x7ca7('0x60'),_0x298706[_0x7ca7('0x10')]),_0x130551);}};exports[_0x7ca7('0x63')]=function(_0x551c4f){try{if(!_['isNil'](queues[_0x551c4f[_0x7ca7('0x10')]])){if(!_[_0x7ca7('0x17')](queues[_0x551c4f[_0x7ca7('0x10')]]['musiconholdstartAt'])){utils[_0x7ca7('0x12')](util['format'](_0x7ca7('0x64'),_0x551c4f[_0x7ca7('0x10')]),_0x551c4f);queues[_0x551c4f[_0x7ca7('0x10')]][_0x7ca7('0x65')]+=utils['diffTime'](utils[_0x7ca7('0x1c')](),queues[_0x551c4f[_0x7ca7('0x10')]]['musiconholdstartAt']);utils['info'](util[_0x7ca7('0x4')](_0x7ca7('0x66'),_0x551c4f[_0x7ca7('0x10')],queues[_0x551c4f[_0x7ca7('0x10')]][_0x7ca7('0x1e')],queues[_0x551c4f[_0x7ca7('0x10')]][_0x7ca7('0x65')]));delete queues[_0x551c4f[_0x7ca7('0x10')]][_0x7ca7('0x61')];}}}catch(_0x146b9a){utils[_0x7ca7('0x16')](util[_0x7ca7('0x4')](_0x7ca7('0x64'),_0x551c4f['uniqueid']),_0x146b9a);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index c6cc9e2..0997c9e 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 _0x4970=['[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','./utils','info','format','accountcode','getUserByInternal','membername','name','UserId','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','uniqueid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','debug','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','[%s][recordings][varset]','value','endsWith','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type'];(function(_0x3532dd,_0x2a9df7){var _0x1836fe=function(_0x9156c7){while(--_0x9156c7){_0x3532dd['push'](_0x3532dd['shift']());}};_0x1836fe(++_0x2a9df7);}(_0x4970,0xbb));var _0x0497=function(_0x3faf3b,_0x206193){_0x3faf3b=_0x3faf3b-0x0;var _0x3d587e=_0x4970[_0x3faf3b];return _0x3d587e;};'use strict';var _=require('lodash');var util=require(_0x0497('0x0'));var utils=require(_0x0497('0x1'));var recordings={};function writeDB(_0x10e8f2){utils[_0x0497('0x2')](util[_0x0497('0x3')]('[%s][recordings][writeDB]',_0x10e8f2['uniqueid']));if(_0x10e8f2[_0x0497('0x4')]){utils[_0x0497('0x5')](_0x10e8f2[_0x0497('0x4')])['then'](function(_0x207a36){if(_0x207a36){_0x10e8f2[_0x0497('0x6')]=_0x207a36[_0x0497('0x7')];_0x10e8f2[_0x0497('0x8')]=_0x207a36['id'];}utils[_0x0497('0x9')]('CreateVoiceRecording',_0x10e8f2);});}else{utils[_0x0497('0x9')](_0x0497('0xa'),_0x10e8f2);}}exports[_0x0497('0xb')]=function(_0xefcea9){try{utils['debug'](util['format'](_0x0497('0xc'),_0xefcea9[_0x0497('0xd')]),_0xefcea9);if(_0xefcea9[_0x0497('0xd')]==_0xefcea9['linkedid']){utils[_0x0497('0x2')](util[_0x0497('0x3')](_0x0497('0xe'),_0xefcea9[_0x0497('0xd')],_0xefcea9[_0x0497('0xf')],_0xefcea9[_0x0497('0x10')]));recordings[_0xefcea9[_0x0497('0xd')]]={'uniqueid':_0xefcea9[_0x0497('0xd')],'accountcode':_0xefcea9[_0x0497('0x4')],'exten':_0xefcea9[_0x0497('0x10')],'context':_0xefcea9[_0x0497('0xf')],'channel':_0xefcea9['channel'],'monitors':[]};}}catch(_0x56153c){utils[_0x0497('0x11')](util['format']('[%s][recordings][newchannel]',_0xefcea9[_0x0497('0xd')]),_0x56153c);}};exports['newstate']=function(_0x41acc0){try{utils[_0x0497('0x12')](util[_0x0497('0x3')]('[%s][recordings][newstate]',_0x41acc0[_0x0497('0xd')]),_0x41acc0);if(!_[_0x0497('0x13')](recordings[_0x41acc0[_0x0497('0xd')]])&&_0x41acc0[_0x0497('0x14')]==0x6){utils['info'](util[_0x0497('0x3')](_0x0497('0x15'),_0x41acc0[_0x0497('0xd')],_0x41acc0[_0x0497('0xf')],_0x41acc0[_0x0497('0x16')]));}else if(!_['isNil'](recordings[_0x41acc0[_0x0497('0x17')]])&&_0x41acc0[_0x0497('0x14')]==0x6&&_0x41acc0[_0x0497('0xf')]!=_0x0497('0x18')){utils[_0x0497('0x2')](util[_0x0497('0x3')](_0x0497('0x19'),_0x41acc0['uniqueid'],_0x41acc0['linkedid'],_0x41acc0[_0x0497('0xf')],_0x41acc0[_0x0497('0x16')]));recordings[_0x41acc0[_0x0497('0x17')]][_0x0497('0x4')]=_0x41acc0[_0x0497('0x4')];}}catch(_0x1165ca){utils['error'](util[_0x0497('0x3')]('[%s][recordings][newstate]',_0x41acc0['uniqueid']),_0x1165ca);}};exports[_0x0497('0x1a')]=function(_0x369290){try{if(!_[_0x0497('0x13')](_0x369290['variable'])&&!_[_0x0497('0x13')](_0x369290[_0x0497('0x1b')]['mixmonitor_filename'])){utils[_0x0497('0x12')](util[_0x0497('0x3')](_0x0497('0x1c'),_0x369290[_0x0497('0xd')]),_0x369290);utils[_0x0497('0x2')](util[_0x0497('0x3')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x369290[_0x0497('0xd')],_0x369290[_0x0497('0x1b')],_0x369290[_0x0497('0x1d')]));if(_[_0x0497('0x1e')](_0x369290['value'],_0x0497('0x1f'))){_0x369290[_0x0497('0x1d')]=_0x369290[_0x0497('0x1d')]['replace'](_0x0497('0x1f'),_0x0497('0x20'));}if(recordings[_0x369290[_0x0497('0x17')]]){var _0x58ceaf=_[_0x0497('0x21')](recordings[_0x369290[_0x0497('0x17')]][_0x0497('0x22')],{'value':_0x369290[_0x0497('0x1d')]});if(_[_0x0497('0x13')](_0x58ceaf)){recordings[_0x369290[_0x0497('0x17')]][_0x0497('0x22')][_0x0497('0x23')]({'value':_0x369290[_0x0497('0x1d')]});}}}}catch(_0xa6faf7){utils['error'](util['format'](_0x0497('0x1c'),_0x369290['uniqueid']),_0xa6faf7);}};exports[_0x0497('0x24')]=function(_0x16357d){try{if(!_[_0x0497('0x13')](recordings[_0x16357d[_0x0497('0xd')]])){utils[_0x0497('0x12')](util['format'](_0x0497('0x25'),_0x16357d[_0x0497('0xd')]),_0x16357d);utils['info'](util['format'](_0x0497('0x26'),_0x16357d[_0x0497('0xd')],_0x16357d[_0x0497('0x27')],_0x16357d[_0x0497('0x28')],_0x16357d[_0x0497('0x29')]));recordings[_0x16357d['uniqueid']][_0x0497('0x27')]=_0x16357d[_0x0497('0x27')];recordings[_0x16357d['uniqueid']]['calleridname']=_0x16357d[_0x0497('0x28')];recordings[_0x16357d['uniqueid']][_0x0497('0x2a')]=_0x16357d['connectedlinenum'];recordings[_0x16357d[_0x0497('0xd')]][_0x0497('0x2b')]=_0x16357d['connectedlinename'];if(recordings[_0x16357d[_0x0497('0xd')]][_0x0497('0x2c')]=='outbound'&&recordings[_0x16357d[_0x0497('0xd')]][_0x0497('0x4')]){recordings[_0x16357d[_0x0497('0xd')]]['connectedlinenum']=recordings[_0x16357d[_0x0497('0xd')]][_0x0497('0x4')];recordings[_0x16357d[_0x0497('0xd')]][_0x0497('0x2b')]='';}recordings[_0x16357d['uniqueid']][_0x0497('0x22')]['forEach'](function(_0x4da71f){var _0x4ff2d0=_['clone'](recordings[_0x16357d[_0x0497('0xd')]]);_0x4ff2d0['value']=_0x4da71f[_0x0497('0x1d')];writeDB(_0x4ff2d0);});delete recordings[_0x16357d[_0x0497('0xd')]];}}catch(_0x179ace){utils[_0x0497('0x11')](util[_0x0497('0x3')]('[%s][recordings][hangup]',_0x16357d['uniqueid']),_0x179ace);}};exports['newexten']=function(_0x4f9787){try{if(!_[_0x0497('0x13')](recordings[_0x4f9787[_0x0497('0xd')]])){utils[_0x0497('0x12')](util['format']('[%s][recordings][newexten]',_0x4f9787[_0x0497('0xd')]),_0x4f9787);utils[_0x0497('0x2')](util[_0x0497('0x3')](_0x0497('0x2d'),_0x4f9787[_0x0497('0xd')],_0x4f9787[_0x0497('0x2e')],_0x4f9787[_0x0497('0x2f')]));if(_0x4f9787[_0x0497('0x2e')][_0x0497('0x30')]()==_0x0497('0x31')&&_[_0x0497('0x32')](_0x4f9787[_0x0497('0x2f')][_0x0497('0x30')](),_0x0497('0x33'))){var _0x484120=_0x4f9787[_0x0497('0x2f')][_0x0497('0x34')]('=');var _0x10d996=_0x484120[0x0]['substring'](_0x484120[0x0][_0x0497('0x35')]('(')+0x1,_0x484120[0x0][_0x0497('0x35')](')'));var _0x48cffe=_0x484120[0x1];recordings[_0x4f9787['uniqueid']][_0x10d996]=_0x48cffe;}}}catch(_0x36e709){utils[_0x0497('0x11')](util[_0x0497('0x3')](_0x0497('0x36'),_0x4f9787[_0x0497('0xd')]),_0x36e709);}};exports[_0x0497('0x37')]=function(_0x262397){try{if(!_[_0x0497('0x13')](recordings[_0x262397[_0x0497('0xd')]])){utils[_0x0497('0x12')](util[_0x0497('0x3')]('[%s][recordings][queuecallerjoin]',_0x262397[_0x0497('0xd')]),_0x262397);utils[_0x0497('0x2')](util['format'](_0x0497('0x38'),_0x262397['uniqueid'],_0x262397[_0x0497('0x39')]));recordings[_0x262397['uniqueid']][_0x0497('0x39')]=_0x262397[_0x0497('0x39')];}}catch(_0x255c53){utils[_0x0497('0x11')](util[_0x0497('0x3')]('[%s][recordings][queuecallerjoin]',_0x262397[_0x0497('0xd')]),_0x255c53);}}; \ No newline at end of file +var _0x5549=['debug','[%s][recordings][newchannel]','uniqueid','linkedid','context','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinename','type','forEach','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','split','lastIndexOf','[%s][recordings][newexten]','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','getUserByInternal','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel'];(function(_0x20e26f,_0x1aab69){var _0x597604=function(_0x1e0e8b){while(--_0x1e0e8b){_0x20e26f['push'](_0x20e26f['shift']());}};_0x597604(++_0x1aab69);}(_0x5549,0x1d9));var _0x9554=function(_0x1dfea8,_0x523747){_0x1dfea8=_0x1dfea8-0x0;var _0x10994e=_0x5549[_0x1dfea8];return _0x10994e;};'use strict';var _=require(_0x9554('0x0'));var util=require(_0x9554('0x1'));var utils=require(_0x9554('0x2'));var recordings={};function writeDB(_0x574b84){utils[_0x9554('0x3')](util[_0x9554('0x4')](_0x9554('0x5'),_0x574b84['uniqueid']));if(_0x574b84['accountcode']){utils[_0x9554('0x6')](_0x574b84[_0x9554('0x7')])[_0x9554('0x8')](function(_0x235f7f){if(_0x235f7f){_0x574b84[_0x9554('0x9')]=_0x235f7f[_0x9554('0xa')];_0x574b84[_0x9554('0xb')]=_0x235f7f['id'];}utils[_0x9554('0xc')](_0x9554('0xd'),_0x574b84);});}else{utils[_0x9554('0xc')](_0x9554('0xd'),_0x574b84);}}exports[_0x9554('0xe')]=function(_0x391a8f){try{utils[_0x9554('0xf')](util[_0x9554('0x4')](_0x9554('0x10'),_0x391a8f[_0x9554('0x11')]),_0x391a8f);if(_0x391a8f['uniqueid']==_0x391a8f[_0x9554('0x12')]){utils[_0x9554('0x3')](util[_0x9554('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x391a8f[_0x9554('0x11')],_0x391a8f[_0x9554('0x13')],_0x391a8f['exten']));recordings[_0x391a8f[_0x9554('0x11')]]={'uniqueid':_0x391a8f[_0x9554('0x11')],'accountcode':_0x391a8f[_0x9554('0x7')],'exten':_0x391a8f['exten'],'context':_0x391a8f[_0x9554('0x13')],'channel':_0x391a8f[_0x9554('0x14')],'monitors':[]};}}catch(_0x597904){utils[_0x9554('0x15')](util[_0x9554('0x4')]('[%s][recordings][newchannel]',_0x391a8f[_0x9554('0x11')]),_0x597904);}};exports[_0x9554('0x16')]=function(_0xd02e84){try{utils[_0x9554('0xf')](util['format'](_0x9554('0x17'),_0xd02e84[_0x9554('0x11')]),_0xd02e84);if(!_[_0x9554('0x18')](recordings[_0xd02e84[_0x9554('0x11')]])&&_0xd02e84[_0x9554('0x19')]==0x6){utils[_0x9554('0x3')](util[_0x9554('0x4')](_0x9554('0x1a'),_0xd02e84[_0x9554('0x11')],_0xd02e84[_0x9554('0x13')],_0xd02e84[_0x9554('0x14')]));}else if(!_['isNil'](recordings[_0xd02e84[_0x9554('0x12')]])&&_0xd02e84['channelstate']==0x6&&_0xd02e84[_0x9554('0x13')]!=_0x9554('0x1b')){utils['info'](util['format'](_0x9554('0x1c'),_0xd02e84['uniqueid'],_0xd02e84[_0x9554('0x12')],_0xd02e84['context'],_0xd02e84[_0x9554('0x14')]));recordings[_0xd02e84['linkedid']][_0x9554('0x7')]=_0xd02e84['accountcode'];}}catch(_0x12a7c3){utils[_0x9554('0x15')](util[_0x9554('0x4')]('[%s][recordings][newstate]',_0xd02e84[_0x9554('0x11')]),_0x12a7c3);}};exports[_0x9554('0x1d')]=function(_0x22f737){try{if(!_[_0x9554('0x18')](_0x22f737[_0x9554('0x1e')])&&!_[_0x9554('0x18')](_0x22f737['variable'][_0x9554('0x1f')])){utils[_0x9554('0xf')](util['format'](_0x9554('0x20'),_0x22f737[_0x9554('0x11')]),_0x22f737);utils[_0x9554('0x3')](util[_0x9554('0x4')](_0x9554('0x21'),_0x22f737['uniqueid'],_0x22f737[_0x9554('0x1e')],_0x22f737[_0x9554('0x22')]));if(_[_0x9554('0x23')](_0x22f737[_0x9554('0x22')],_0x9554('0x24'))){_0x22f737[_0x9554('0x22')]=_0x22f737[_0x9554('0x22')][_0x9554('0x25')]('.wav49',_0x9554('0x26'));}if(recordings[_0x22f737[_0x9554('0x12')]]){var _0x578713=_[_0x9554('0x27')](recordings[_0x22f737[_0x9554('0x12')]][_0x9554('0x28')],{'value':_0x22f737[_0x9554('0x22')]});if(_[_0x9554('0x18')](_0x578713)){recordings[_0x22f737[_0x9554('0x12')]]['monitors'][_0x9554('0x29')]({'value':_0x22f737[_0x9554('0x22')]});}}}}catch(_0x4b09e5){utils[_0x9554('0x15')](util[_0x9554('0x4')](_0x9554('0x20'),_0x22f737[_0x9554('0x11')]),_0x4b09e5);}};exports[_0x9554('0x2a')]=function(_0x424f4){try{if(!_[_0x9554('0x18')](recordings[_0x424f4['uniqueid']])){utils['debug'](util[_0x9554('0x4')](_0x9554('0x2b'),_0x424f4[_0x9554('0x11')]),_0x424f4);utils['info'](util[_0x9554('0x4')](_0x9554('0x2c'),_0x424f4[_0x9554('0x11')],_0x424f4[_0x9554('0x2d')],_0x424f4[_0x9554('0x2e')],_0x424f4['cause-txt']));recordings[_0x424f4[_0x9554('0x11')]]['calleridnum']=_0x424f4['calleridnum'];recordings[_0x424f4['uniqueid']][_0x9554('0x2e')]=_0x424f4[_0x9554('0x2e')];recordings[_0x424f4['uniqueid']]['connectedlinenum']=_0x424f4['connectedlinenum'];recordings[_0x424f4[_0x9554('0x11')]][_0x9554('0x2f')]=_0x424f4[_0x9554('0x2f')];if(recordings[_0x424f4[_0x9554('0x11')]][_0x9554('0x30')]=='outbound'&&recordings[_0x424f4[_0x9554('0x11')]][_0x9554('0x7')]){recordings[_0x424f4[_0x9554('0x11')]]['connectedlinenum']=recordings[_0x424f4['uniqueid']][_0x9554('0x7')];recordings[_0x424f4['uniqueid']][_0x9554('0x2f')]='';}recordings[_0x424f4[_0x9554('0x11')]]['monitors'][_0x9554('0x31')](function(_0x9011ff){var _0x41d9ff=_['clone'](recordings[_0x424f4[_0x9554('0x11')]]);_0x41d9ff[_0x9554('0x22')]=_0x9011ff[_0x9554('0x22')];writeDB(_0x41d9ff);});delete recordings[_0x424f4[_0x9554('0x11')]];}}catch(_0x28942d){utils[_0x9554('0x15')](util[_0x9554('0x4')]('[%s][recordings][hangup]',_0x424f4[_0x9554('0x11')]),_0x28942d);}};exports[_0x9554('0x32')]=function(_0x3d85a7){try{if(!_['isNil'](recordings[_0x3d85a7[_0x9554('0x11')]])){utils[_0x9554('0xf')](util[_0x9554('0x4')]('[%s][recordings][newexten]',_0x3d85a7[_0x9554('0x11')]),_0x3d85a7);utils['info'](util[_0x9554('0x4')](_0x9554('0x33'),_0x3d85a7['uniqueid'],_0x3d85a7['application'],_0x3d85a7[_0x9554('0x34')]));if(_0x3d85a7[_0x9554('0x35')][_0x9554('0x36')]()==_0x9554('0x37')&&_[_0x9554('0x38')](_0x3d85a7[_0x9554('0x34')][_0x9554('0x36')](),'cdr')){var _0x1c2190=_0x3d85a7[_0x9554('0x34')][_0x9554('0x39')]('=');var _0x244da9=_0x1c2190[0x0]['substring'](_0x1c2190[0x0]['lastIndexOf']('(')+0x1,_0x1c2190[0x0][_0x9554('0x3a')](')'));var _0x203426=_0x1c2190[0x1];recordings[_0x3d85a7[_0x9554('0x11')]][_0x244da9]=_0x203426;}}}catch(_0x107173){utils['error'](util['format'](_0x9554('0x3b'),_0x3d85a7['uniqueid']),_0x107173);}};exports['queuecallerjoin']=function(_0x7549f7){try{if(!_['isNil'](recordings[_0x7549f7[_0x9554('0x11')]])){utils[_0x9554('0xf')](util[_0x9554('0x4')]('[%s][recordings][queuecallerjoin]',_0x7549f7['uniqueid']),_0x7549f7);utils[_0x9554('0x3')](util[_0x9554('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x7549f7[_0x9554('0x11')],_0x7549f7[_0x9554('0x3c')]));recordings[_0x7549f7['uniqueid']][_0x9554('0x3c')]=_0x7549f7[_0x9554('0x3c')];}}catch(_0x1f520c){utils[_0x9554('0x15')](util[_0x9554('0x4')]('[%s][recordings][queuecallerjoin]',_0x7549f7[_0x9554('0x11')]),_0x1f520c);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 50e5fae..bc0b9e7 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 _0xfe81=['assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','./utils','format','type','attended','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransfereruniqueid','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x4a1f6c,_0x2eaa83){var _0x167c25=function(_0x129a91){while(--_0x129a91){_0x4a1f6c['push'](_0x4a1f6c['shift']());}};_0x167c25(++_0x2eaa83);}(_0xfe81,0x1ef));var _0x1fe8=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xfe81[_0x53abe5];return _0xc1c37e;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x1fe8('0x0'));function writeDB(_0x1f5e4d){utils['info'](util[_0x1fe8('0x1')]('[%s][transfers][writeDB]\x20type:%s',_0x1f5e4d[_0x1fe8('0x2')]===_0x1fe8('0x3')?_0x1f5e4d['origtransfereruniqueid']:_0x1f5e4d[_0x1fe8('0x4')],_0x1f5e4d[_0x1fe8('0x2')]));utils[_0x1fe8('0x5')](_0x1fe8('0x6'),_0x1f5e4d);}exports[_0x1fe8('0x7')]={};exports[_0x1fe8('0x8')]=function(_0x24e5ad){try{utils['debug'](util['format'](_0x1fe8('0x9'),_0x24e5ad[_0x1fe8('0x4')]),_0x24e5ad);utils['info'](util[_0x1fe8('0x1')](_0x1fe8('0xa'),_0x24e5ad[_0x1fe8('0x4')],_0x24e5ad[_0x1fe8('0xb')],_0x24e5ad[_0x1fe8('0xc')],_0x24e5ad['transfereecalleridnum'],_0x24e5ad[_0x1fe8('0xd')]));_0x24e5ad[_0x1fe8('0x2')]='blind';exports[_0x1fe8('0x7')][_0x24e5ad[_0x1fe8('0xe')]]=_0x24e5ad;writeDB(_0x24e5ad);}catch(_0xa92597){utils['error'](util[_0x1fe8('0x1')]('[%s][transfers][blindtransfer]',_0x24e5ad[_0x1fe8('0x4')]),_0xa92597);}};exports[_0x1fe8('0xf')]=function(_0x387bf2){try{utils[_0x1fe8('0x10')](util['format'](_0x1fe8('0x11'),_0x387bf2['origtransfereruniqueid']),_0x387bf2);utils['info'](util[_0x1fe8('0x1')](_0x1fe8('0x12'),_0x387bf2[_0x1fe8('0x13')],_0x387bf2[_0x1fe8('0x14')],_0x387bf2['origtransferercalleridname'],_0x387bf2[_0x1fe8('0x15')],_0x387bf2[_0x1fe8('0x16')]));_0x387bf2=_[_0x1fe8('0x17')](_0x387bf2,{'transfererchannel':_0x387bf2[_0x1fe8('0x18')],'transferercalleridnum':_0x387bf2[_0x1fe8('0x14')],'transferercalleridname':_0x387bf2[_0x1fe8('0x19')],'transfererconnectedlinenum':_0x387bf2[_0x1fe8('0x1a')],'transfererconnectedlinename':_0x387bf2[_0x1fe8('0x1b')],'transfereraccountcode':_0x387bf2[_0x1fe8('0x1c')],'transferercontext':_0x387bf2[_0x1fe8('0x1d')],'transfererexten':_0x387bf2['secondtransfererexten'],'transfererlinkedid':_0x387bf2[_0x1fe8('0x1e')],'context':_0x387bf2[_0x1fe8('0x1f')],'extension':_0x387bf2['origtransfererexten'],'type':'attended'});if(_['isNil'](_0x387bf2['transfereechannel'])){_0x387bf2=_[_0x1fe8('0x17')](_0x387bf2,{'transfereechannel':_0x387bf2[_0x1fe8('0x20')],'transfereecalleridnum':_0x387bf2['transfertargetcalleridnum'],'transfereecalleridname':_0x387bf2[_0x1fe8('0x16')],'transfereeconnectedlinenum':_0x387bf2[_0x1fe8('0x21')],'transfereeconnectedlinename':_0x387bf2[_0x1fe8('0x22')],'transfereeaccountcode':_0x387bf2['transfertargetaccountcode'],'transfereecontext':_0x387bf2['transfertargetcontext'],'transfereeexten':_0x387bf2[_0x1fe8('0x23')],'transfereelinkedid':_0x387bf2[_0x1fe8('0x24')]});}writeDB(_0x387bf2);}catch(_0x4e8f65){utils['error'](util[_0x1fe8('0x1')](_0x1fe8('0x11'),_0x387bf2[_0x1fe8('0x13')]),_0x4e8f65);}}; \ No newline at end of file +var _0xee6b=['transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','error','lodash','./utils','info','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','format','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel'];(function(_0x3c526e,_0x485ba6){var _0x428d46=function(_0x20375f){while(--_0x20375f){_0x3c526e['push'](_0x3c526e['shift']());}};_0x428d46(++_0x485ba6);}(_0xee6b,0x1de));var _0xbee6=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0xee6b[_0x5c2a2b];return _0x19921f;};'use strict';var _=require(_0xbee6('0x0'));var util=require('util');var utils=require(_0xbee6('0x1'));function writeDB(_0x5bc449){utils[_0xbee6('0x2')](util['format'](_0xbee6('0x3'),_0x5bc449[_0xbee6('0x4')]===_0xbee6('0x5')?_0x5bc449[_0xbee6('0x6')]:_0x5bc449[_0xbee6('0x7')],_0x5bc449[_0xbee6('0x4')]));utils[_0xbee6('0x8')](_0xbee6('0x9'),_0x5bc449);}exports[_0xbee6('0xa')]={};exports[_0xbee6('0xb')]=function(_0x3e3d32){try{utils[_0xbee6('0xc')](util['format'](_0xbee6('0xd'),_0x3e3d32[_0xbee6('0x7')]),_0x3e3d32);utils[_0xbee6('0x2')](util['format'](_0xbee6('0xe'),_0x3e3d32[_0xbee6('0x7')],_0x3e3d32[_0xbee6('0xf')],_0x3e3d32[_0xbee6('0x10')],_0x3e3d32['transfereecalleridnum'],_0x3e3d32[_0xbee6('0x11')]));_0x3e3d32['type']='blind';exports[_0xbee6('0xa')][_0x3e3d32[_0xbee6('0x12')]]=_0x3e3d32;writeDB(_0x3e3d32);}catch(_0x5ad3bf){utils['error'](util['format']('[%s][transfers][blindtransfer]',_0x3e3d32[_0xbee6('0x7')]),_0x5ad3bf);}};exports['attendedtransfer']=function(_0x273a43){try{utils[_0xbee6('0xc')](util[_0xbee6('0x13')](_0xbee6('0x14'),_0x273a43[_0xbee6('0x6')]),_0x273a43);utils[_0xbee6('0x2')](util['format'](_0xbee6('0x15'),_0x273a43[_0xbee6('0x6')],_0x273a43[_0xbee6('0x16')],_0x273a43[_0xbee6('0x17')],_0x273a43[_0xbee6('0x18')],_0x273a43[_0xbee6('0x19')]));_0x273a43=_[_0xbee6('0x1a')](_0x273a43,{'transfererchannel':_0x273a43[_0xbee6('0x1b')],'transferercalleridnum':_0x273a43[_0xbee6('0x16')],'transferercalleridname':_0x273a43['origtransferercalleridname'],'transfererconnectedlinenum':_0x273a43[_0xbee6('0x1c')],'transfererconnectedlinename':_0x273a43['secondtransfererconnectedlinename'],'transfereraccountcode':_0x273a43[_0xbee6('0x1d')],'transferercontext':_0x273a43[_0xbee6('0x1e')],'transfererexten':_0x273a43[_0xbee6('0x1f')],'transfererlinkedid':_0x273a43[_0xbee6('0x20')],'context':_0x273a43[_0xbee6('0x21')],'extension':_0x273a43[_0xbee6('0x22')],'type':'attended'});if(_[_0xbee6('0x23')](_0x273a43[_0xbee6('0x24')])){_0x273a43=_[_0xbee6('0x1a')](_0x273a43,{'transfereechannel':_0x273a43[_0xbee6('0x25')],'transfereecalleridnum':_0x273a43[_0xbee6('0x18')],'transfereecalleridname':_0x273a43[_0xbee6('0x19')],'transfereeconnectedlinenum':_0x273a43[_0xbee6('0x26')],'transfereeconnectedlinename':_0x273a43['transfertargetconnectedlinename'],'transfereeaccountcode':_0x273a43[_0xbee6('0x27')],'transfereecontext':_0x273a43[_0xbee6('0x28')],'transfereeexten':_0x273a43[_0xbee6('0x29')],'transfereelinkedid':_0x273a43['transfertargetlinkedid']});}writeDB(_0x273a43);}catch(_0x4ae469){utils[_0xbee6('0x2a')](util[_0xbee6('0x13')]('[%s][transfers][attendedtransfer]',_0x273a43[_0xbee6('0x6')]),_0x4ae469);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 81b7a52..6f264ab 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 _0xaefe=['isBefore','bluebird','jayson/promise','moment','util','client','../../config/logger','xdr','info','debug','error','inspect','request','[utils][request]\x20name:%s','catch','GetUser','internal','interface','then','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','diffTime','diff','now','isAfter'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xaefe,0x91));var _0xeaef=function(_0x3bfdde,_0x306be4){_0x3bfdde=_0x3bfdde-0x0;var _0x3f752a=_0xaefe[_0x3bfdde];return _0x3f752a;};'use strict';var BPromise=require(_0xeaef('0x0'));var jayson=require(_0xeaef('0x1'));var moment=require(_0xeaef('0x2'));var util=require(_0xeaef('0x3'));var client=jayson[_0xeaef('0x4')]['http']({'port':0x2329});var logger=require(_0xeaef('0x5'))(_0xeaef('0x6'));exports['info']=function(_0x55dac0,_0x2bd35e){logger[_0xeaef('0x7')](_0x55dac0,_0x2bd35e?util['inspect'](_0x2bd35e,{'showHidden':![],'depth':null}):'');};exports[_0xeaef('0x8')]=function(_0x353428,_0x20f0fb){logger['debug'](_0x353428,_0x20f0fb?util['inspect'](_0x20f0fb,{'showHidden':![],'depth':null}):'');};exports[_0xeaef('0x9')]=function(_0x209a24,_0x1accde){logger[_0xeaef('0x9')](_0x209a24,_0x1accde?util[_0xeaef('0xa')](_0x1accde,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x5494e2,_0xccb571){return client[_0xeaef('0xb')](_0x5494e2,{'body':_0xccb571})['then'](function(_0x24f935){logger['debug'](_0xeaef('0xc'),_0x5494e2,_0x24f935?util[_0xeaef('0xa')](_0x24f935,{'showHidden':![],'depth':null}):'');})[_0xeaef('0xd')](function(_0x3c5e61){logger[_0xeaef('0x9')](_0xeaef('0xc'),_0x5494e2,_0x3c5e61?util[_0xeaef('0xa')](_0x3c5e61,{'showHidden':![],'depth':null}):'');});};function getUser(_0x245793){return client[_0xeaef('0xb')](_0xeaef('0xe'),{'options':{'raw':!![],'attributes':['id',_0xeaef('0xf'),'name',_0xeaef('0x10')],'where':_0x245793,'limit':0x1}})[_0xeaef('0x11')](function(_0x58f1e9){logger[_0xeaef('0x8')](_0xeaef('0x12'),JSON[_0xeaef('0x13')](_0x245793),_0x58f1e9?util['inspect'](_0x58f1e9,{'showHidden':![],'depth':null}):'');return _0x58f1e9[_0xeaef('0x14')][_0xeaef('0x15')]?_0x58f1e9[_0xeaef('0x14')][0x0]:null;});}exports[_0xeaef('0x16')]=function(_0x55733b){return new BPromise(function(_0x21ba48,_0x270065){if(_0x55733b){return getUser({'internal':_0x55733b})[_0xeaef('0x11')](function(_0x1776ac){logger[_0xeaef('0x7')](_0xeaef('0x17'),_0x55733b,_0x1776ac?_0xeaef('0x18'):_0xeaef('0x19'));return _0x21ba48(_0x1776ac);})['catch'](function(_0x1322eb){logger[_0xeaef('0x9')]('[utils][getUserByInternal]',_0x1322eb?util[_0xeaef('0xa')](_0x1322eb,{'showHidden':![],'depth':null}):'');return _0x21ba48(null);});}return _0x21ba48(null);});};exports[_0xeaef('0x1a')]=function(_0xd3440f){return new BPromise(function(_0x193363,_0x139c72){if(_0xd3440f){return getUser({'interface':_0xd3440f})[_0xeaef('0x11')](function(_0x49c6dd){logger[_0xeaef('0x7')](_0xeaef('0x1b'),_0xd3440f,_0x49c6dd?'found':_0xeaef('0x19'));return _0x193363(_0x49c6dd);})[_0xeaef('0xd')](function(_0x1a1251){logger[_0xeaef('0x9')]('[utils][getUserByInterface]',_0x1a1251?util[_0xeaef('0xa')](_0x1a1251,{'showHidden':![],'depth':null}):'');return _0x193363(null);});}return _0x193363(null);});};exports['getUserByName']=function(_0x5998fc){return new BPromise(function(_0x60377d,_0x70b609){if(_0x5998fc){return getUser({'name':_0x5998fc})[_0xeaef('0x11')](function(_0x47f27d){logger[_0xeaef('0x7')](_0xeaef('0x1c'),_0x5998fc,_0x47f27d?'found':_0xeaef('0x19'));return _0x60377d(_0x47f27d);})[_0xeaef('0xd')](function(_0x408755){logger[_0xeaef('0x9')](_0xeaef('0x1d'),_0x408755?util[_0xeaef('0xa')](_0x408755,{'showHidden':![],'depth':null}):'');return _0x60377d(null);});}return _0x60377d(null);});};exports[_0xeaef('0x1e')]=function(_0x353139){return new BPromise(function(_0x31ad80,_0x282bb8){if(_0x353139){return client[_0xeaef('0xb')](_0xeaef('0x1f'),{'options':{'raw':!![],'attributes':['id',_0xeaef('0x20'),_0xeaef('0x21'),_0xeaef('0x22'),_0xeaef('0x23')],'where':{'name':_0x353139},'limit':0x1}})[_0xeaef('0x11')](function(_0x4a36e4){logger[_0xeaef('0x8')]('[utils][getVoiceQueueByName]\x20name:%s',_0x353139,_0x4a36e4?util[_0xeaef('0xa')](_0x4a36e4,{'showHidden':![],'depth':null}):'');logger['info'](_0xeaef('0x24'),_0x353139,_0x4a36e4?'found':_0xeaef('0x19'));return _0x31ad80(_0x4a36e4['result'][_0xeaef('0x15')]?_0x4a36e4[_0xeaef('0x14')][0x0]:null);})[_0xeaef('0xd')](function(_0x469681){logger[_0xeaef('0x9')]('[utils][getVoiceQueueByName]',_0x469681?util[_0xeaef('0xa')](_0x469681,{'showHidden':![],'depth':null}):'');return _0x31ad80(null);});}return _0x31ad80(null);});};exports['addTime']=function(_0x2e9220,_0x4fd533){return moment(_0x2e9220)[_0xeaef('0x25')](_0x4fd533,_0xeaef('0x26'))['format'](_0xeaef('0x27'));};exports[_0xeaef('0x28')]=function(_0x28b4fe,_0x329934){return moment(_0x28b4fe)[_0xeaef('0x29')](_0x329934,_0xeaef('0x26'))[_0xeaef('0x2a')](_0xeaef('0x27'));};exports[_0xeaef('0x2b')]=function(_0x34d44d,_0x6c96e){return moment(_0x34d44d)[_0xeaef('0x2c')](moment(_0x6c96e),'seconds');};exports['sumTime']=function(_0x5313fc,_0x375e86){return parseInt(_0x5313fc,0xa)+parseInt(_0x375e86,0xa);};exports[_0xeaef('0x2d')]=function(){return moment()['format'](_0xeaef('0x27'));};exports['isAfter']=function(_0x286dba,_0x51189f){if(_0x51189f){return moment(_0x286dba)[_0xeaef('0x2e')](_0x51189f);}return!![];};exports[_0xeaef('0x2f')]=function(_0x5908c9,_0x28b441){if(_0x28b441){return moment(_0x5908c9)['isBefore'](_0x28b441);}else if(_0x5908c9){return!![];}return![];}; \ No newline at end of file +var _0x4471=['format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diff','sumTime','now','isAfter','isBefore','bluebird','moment','util','http','../../config/logger','xdr','info','inspect','debug','error','request','[utils][request]\x20name:%s','GetUser','name','interface','then','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','getUserByInterface','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x4471,0x179));var _0x1447=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4471[_0x21a9d9];return _0x46adce;};'use strict';var BPromise=require(_0x1447('0x0'));var jayson=require('jayson/promise');var moment=require(_0x1447('0x1'));var util=require(_0x1447('0x2'));var client=jayson['client'][_0x1447('0x3')]({'port':0x2329});var logger=require(_0x1447('0x4'))(_0x1447('0x5'));exports[_0x1447('0x6')]=function(_0x5e44bc,_0xeb078c){logger[_0x1447('0x6')](_0x5e44bc,_0xeb078c?util[_0x1447('0x7')](_0xeb078c,{'showHidden':![],'depth':null}):'');};exports[_0x1447('0x8')]=function(_0x1febaa,_0x5883ef){logger['debug'](_0x1febaa,_0x5883ef?util['inspect'](_0x5883ef,{'showHidden':![],'depth':null}):'');};exports[_0x1447('0x9')]=function(_0x356c4c,_0x1c5adc){logger[_0x1447('0x9')](_0x356c4c,_0x1c5adc?util['inspect'](_0x1c5adc,{'showHidden':![],'depth':null}):'');};exports[_0x1447('0xa')]=function(_0x4afec6,_0x1cd1fd){return client[_0x1447('0xa')](_0x4afec6,{'body':_0x1cd1fd})['then'](function(_0x285e6e){logger[_0x1447('0x8')](_0x1447('0xb'),_0x4afec6,_0x285e6e?util[_0x1447('0x7')](_0x285e6e,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x8ae286){logger['error'](_0x1447('0xb'),_0x4afec6,_0x8ae286?util[_0x1447('0x7')](_0x8ae286,{'showHidden':![],'depth':null}):'');});};function getUser(_0x230a9d){return client[_0x1447('0xa')](_0x1447('0xc'),{'options':{'raw':!![],'attributes':['id','internal',_0x1447('0xd'),_0x1447('0xe')],'where':_0x230a9d,'limit':0x1}})[_0x1447('0xf')](function(_0x52fdd6){logger['debug'](_0x1447('0x10'),JSON[_0x1447('0x11')](_0x230a9d),_0x52fdd6?util['inspect'](_0x52fdd6,{'showHidden':![],'depth':null}):'');return _0x52fdd6[_0x1447('0x12')][_0x1447('0x13')]?_0x52fdd6[_0x1447('0x12')][0x0]:null;});}exports[_0x1447('0x14')]=function(_0x3b7939){return new BPromise(function(_0x43eaa0,_0x29496a){if(_0x3b7939){return getUser({'internal':_0x3b7939})[_0x1447('0xf')](function(_0x5a2a36){logger[_0x1447('0x6')](_0x1447('0x15'),_0x3b7939,_0x5a2a36?_0x1447('0x16'):_0x1447('0x17'));return _0x43eaa0(_0x5a2a36);})[_0x1447('0x18')](function(_0x1a24ff){logger[_0x1447('0x9')]('[utils][getUserByInternal]',_0x1a24ff?util['inspect'](_0x1a24ff,{'showHidden':![],'depth':null}):'');return _0x43eaa0(null);});}return _0x43eaa0(null);});};exports[_0x1447('0x19')]=function(_0x56ae85){return new BPromise(function(_0x1e59c7,_0x3e76c9){if(_0x56ae85){return getUser({'interface':_0x56ae85})[_0x1447('0xf')](function(_0x4c2eb2){logger[_0x1447('0x6')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x56ae85,_0x4c2eb2?_0x1447('0x16'):_0x1447('0x17'));return _0x1e59c7(_0x4c2eb2);})[_0x1447('0x18')](function(_0x444bb4){logger[_0x1447('0x9')]('[utils][getUserByInterface]',_0x444bb4?util[_0x1447('0x7')](_0x444bb4,{'showHidden':![],'depth':null}):'');return _0x1e59c7(null);});}return _0x1e59c7(null);});};exports[_0x1447('0x1a')]=function(_0x4e20d6){return new BPromise(function(_0x52ee77,_0x5a9b0d){if(_0x4e20d6){return getUser({'name':_0x4e20d6})[_0x1447('0xf')](function(_0x5738d8){logger[_0x1447('0x6')]('[utils][getUserByName]\x20name:%s\x20%s',_0x4e20d6,_0x5738d8?_0x1447('0x16'):_0x1447('0x17'));return _0x52ee77(_0x5738d8);})['catch'](function(_0x2266f5){logger[_0x1447('0x9')](_0x1447('0x1b'),_0x2266f5?util[_0x1447('0x7')](_0x2266f5,{'showHidden':![],'depth':null}):'');return _0x52ee77(null);});}return _0x52ee77(null);});};exports[_0x1447('0x1c')]=function(_0x178882){return new BPromise(function(_0x12fed1,_0xe18bcf){if(_0x178882){return client[_0x1447('0xa')](_0x1447('0x1d'),{'options':{'raw':!![],'attributes':['id',_0x1447('0xd'),_0x1447('0x1e'),_0x1447('0x1f'),'acwTimeout'],'where':{'name':_0x178882},'limit':0x1}})['then'](function(_0x2b34bd){logger[_0x1447('0x8')](_0x1447('0x20'),_0x178882,_0x2b34bd?util[_0x1447('0x7')](_0x2b34bd,{'showHidden':![],'depth':null}):'');logger[_0x1447('0x6')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x178882,_0x2b34bd?_0x1447('0x16'):_0x1447('0x17'));return _0x12fed1(_0x2b34bd[_0x1447('0x12')][_0x1447('0x13')]?_0x2b34bd[_0x1447('0x12')][0x0]:null);})[_0x1447('0x18')](function(_0x1b6063){logger[_0x1447('0x9')](_0x1447('0x21'),_0x1b6063?util[_0x1447('0x7')](_0x1b6063,{'showHidden':![],'depth':null}):'');return _0x12fed1(null);});}return _0x12fed1(null);});};exports[_0x1447('0x22')]=function(_0x356e9d,_0x54bdf7){return moment(_0x356e9d)[_0x1447('0x23')](_0x54bdf7,_0x1447('0x24'))[_0x1447('0x25')](_0x1447('0x26'));};exports[_0x1447('0x27')]=function(_0x4efe16,_0x481e67){return moment(_0x4efe16)[_0x1447('0x28')](_0x481e67,_0x1447('0x24'))[_0x1447('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x1bc99c,_0x4e89cf){return moment(_0x1bc99c)[_0x1447('0x29')](moment(_0x4e89cf),_0x1447('0x24'));};exports[_0x1447('0x2a')]=function(_0x5b426e,_0x87cd5e){return parseInt(_0x5b426e,0xa)+parseInt(_0x87cd5e,0xa);};exports[_0x1447('0x2b')]=function(){return moment()[_0x1447('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x1447('0x2c')]=function(_0x198d26,_0x27d284){if(_0x27d284){return moment(_0x198d26)[_0x1447('0x2c')](_0x27d284);}return!![];};exports[_0x1447('0x2d')]=function(_0x221e30,_0x5c7e14){if(_0x5c7e14){return moment(_0x221e30)['isBefore'](_0x5c7e14);}else if(_0x221e30){return!![];}return![];}; \ No newline at end of file